summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Abd-El-Malek <jabdelmalek@google.com>2014-05-23 17:28:10 -0700
committerJohn Abd-El-Malek <jabdelmalek@google.com>2014-05-23 17:41:56 -0700
commit3f3b45cc74b0499912409f766a595945dbbfc4c5 (patch)
treeec400b6965477b88ea7f0d335f7e5c52044c346c
parent6fe4aed948337175f6f7f81bb03c37b9c7f535da (diff)
downloadpdfium-3f3b45cc74b0499912409f766a595945dbbfc4c5.tar.xz
Convert all line endings to LF.
-rw-r--r--README (renamed from README.txt)0
-rw-r--r--build/all.gyp28
-rw-r--r--build/gyp_pdfium.py16
-rw-r--r--build/standalone.gypi516
-rw-r--r--core/include/fdrm/fx_crypt.h86
-rw-r--r--core/include/fpdfapi/fpdf_module.h410
-rw-r--r--core/include/fpdfapi/fpdf_objects.h1570
-rw-r--r--core/include/fpdfapi/fpdf_page.h498
-rw-r--r--core/include/fpdfapi/fpdf_pageobj.h1442
-rw-r--r--core/include/fpdfapi/fpdf_parser.h2298
-rw-r--r--core/include/fpdfapi/fpdf_render.h636
-rw-r--r--core/include/fpdfapi/fpdf_resource.h1920
-rw-r--r--core/include/fpdfapi/fpdf_serial.h406
-rw-r--r--core/include/fpdfapi/fpdfapi.h30
-rw-r--r--core/include/fpdfdoc/fpdf_ap.h184
-rw-r--r--core/include/fpdfdoc/fpdf_doc.h3584
-rw-r--r--core/include/fpdfdoc/fpdf_tagged.h198
-rw-r--r--core/include/fpdfdoc/fpdf_vt.h888
-rw-r--r--core/include/fpdftext/fpdf_text.h346
-rw-r--r--core/include/fxcodec/fx_codec.h576
-rw-r--r--core/include/fxcodec/fx_codec_def.h142
-rw-r--r--core/include/fxcodec/fx_codec_provider.h106
-rw-r--r--core/include/fxcrt/fx_basic.h3284
-rw-r--r--core/include/fxcrt/fx_coordinates.h1800
-rw-r--r--core/include/fxcrt/fx_ext.h206
-rw-r--r--core/include/fxcrt/fx_memory.h600
-rw-r--r--core/include/fxcrt/fx_stream.h400
-rw-r--r--core/include/fxcrt/fx_string.h1740
-rw-r--r--core/include/fxcrt/fx_system.h558
-rw-r--r--core/include/fxcrt/fx_xml.h418
-rw-r--r--core/include/fxge/fx_dib.h1212
-rw-r--r--core/include/fxge/fx_font.h856
-rw-r--r--core/include/fxge/fx_freetype.h288
-rw-r--r--core/include/fxge/fx_ge.h1466
-rw-r--r--core/include/fxge/fx_ge_apple.h52
-rw-r--r--core/include/fxge/fx_ge_win32.h210
-rw-r--r--core/include/thirdparties/freetype/foxitnames.h566
-rw-r--r--core/include/thirdparties/freetype/freetype/config/ftconfig.h2
-rw-r--r--core/include/thirdparties/freetype/freetype/freetype.h8032
-rw-r--r--core/include/thirdparties/freetype/freetype/ftsystem.h8
-rw-r--r--core/include/thirdparties/freetype/freetype/internal/ftmemory.h238
-rw-r--r--core/include/thirdparties/freetype/ft2build.h2
-rw-r--r--core/include/thirdparties/libjpeg/jconfig.h90
-rw-r--r--core/include/thirdparties/libjpeg/jerror.h582
-rw-r--r--core/include/thirdparties/libjpeg/jmorecfg.h752
-rw-r--r--core/include/thirdparties/libjpeg/jpegint.h784
-rw-r--r--core/include/thirdparties/libjpeg/jpeglib.h2330
-rw-r--r--core/include/thirdparties/zlib/zconf.h1038
-rw-r--r--core/include/thirdparties/zlib/zlib.h3656
-rw-r--r--core/src/fdrm/crypto/fx_crypt.cpp518
-rw-r--r--core/src/fdrm/crypto/fx_crypt_aes.cpp2026
-rw-r--r--core/src/fdrm/crypto/fx_crypt_sha.cpp1484
-rw-r--r--core/src/fpdfapi/fpdf_basic_module.cpp356
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/CNS1/B5pc-H_0.cpp182
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/CNS1/B5pc-V_0.cpp24
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/CNS1/CNS-EUC-H_0.cpp364
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/CNS1/CNS-EUC-V_0.cpp402
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/CNS1/ETen-B5-H_0.cpp186
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/CNS1/ETen-B5-V_0.cpp26
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/CNS1/ETenms-B5-H_0.cpp18
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/CNS1/ETenms-B5-V_0.cpp28
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/CNS1/UniCNS-UTF16-H_0.cpp7302
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/GB1/GB-EUC-H_0.cpp76
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/GB1/GB-EUC-V_0.cpp30
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/GB1/GBK-EUC-H_2.cpp2730
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/GB1/GBKp-EUC-H_2.cpp2730
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/GB1/GBpc-EUC-H_0.cpp78
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/GB1/GBpc-EUC-V_0.cpp30
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/GB1/UniGB-UCS2-H_4.cpp9234
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/Japan1/83pv-RKSJ-H_1.cpp164
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/Japan1/90ms-RKSJ-H_2.cpp130
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/Japan1/90msp-RKSJ-H_2.cpp130
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/Japan1/90pv-RKSJ-H_1.cpp192
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/Japan1/Add-RKSJ-H_1.cpp440
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/Japan1/Add-RKSJ-V_1.cpp54
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/Japan1/Adobe-Japan1-UCS2_4.cpp3878
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/Japan1/EUC-H_1.cpp96
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/Japan1/H_1.cpp96
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UCS2-HW-V_4.cpp150
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UCS2-H_4.cpp4902
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UCS2-V_4.cpp142
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UTF16-H_5.cpp6898
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UTF16-V_5.cpp162
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/Korea1/Adobe-Korea1-UCS2_2.cpp4604
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/Korea1/KSC-EUC-H_0.cpp328
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/Korea1/KSC-EUC-V_0.cpp28
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/Korea1/KSCms-UHC-HW-H_1.cpp466
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/Korea1/KSCms-UHC-H_1.cpp466
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/Korea1/KSCpc-EUC-H_0.cpp356
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/Korea1/UniKS-UCS2-H_1.cpp5612
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/Korea1/UniKS-UTF16-H_0.cpp96
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/cmap_int.h40
-rw-r--r--core/src/fpdfapi/fpdf_cmaps/fpdf_cmaps.cpp366
-rw-r--r--core/src/fpdfapi/fpdf_edit/editint.h118
-rw-r--r--core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp328
-rw-r--r--core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp4262
-rw-r--r--core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp2410
-rw-r--r--core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp748
-rw-r--r--core/src/fpdfapi/fpdf_font/common.h34
-rw-r--r--core/src/fpdfapi/fpdf_font/font_int.h402
-rw-r--r--core/src/fpdfapi/fpdf_font/fpdf_font.cpp3526
-rw-r--r--core/src/fpdfapi/fpdf_font/fpdf_font_charset.cpp1250
-rw-r--r--core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp3432
-rw-r--r--core/src/fpdfapi/fpdf_font/fpdf_font_utility.cpp194
-rw-r--r--core/src/fpdfapi/fpdf_font/ttgsubtable.cpp904
-rw-r--r--core/src/fpdfapi/fpdf_font/ttgsubtable.h838
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page.cpp2094
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp2802
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp1294
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp1772
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp1414
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_image.cpp232
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp3362
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_parser_new.cpp1644
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp2292
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_path.cpp104
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp556
-rw-r--r--core/src/fpdfapi/fpdf_page/pageint.h1010
-rw-r--r--core/src/fpdfapi/fpdf_parser/filters_int.h238
-rw-r--r--core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp1066
-rw-r--r--core/src/fpdfapi/fpdf_parser/fpdf_parser_document.cpp796
-rw-r--r--core/src/fpdfapi/fpdf_parser/fpdf_parser_encrypt.cpp1914
-rw-r--r--core/src/fpdfapi/fpdf_parser/fpdf_parser_fdf.cpp448
-rw-r--r--core/src/fpdfapi/fpdf_parser/fpdf_parser_filters.cpp1818
-rw-r--r--core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp2688
-rw-r--r--core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp906
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render.cpp2976
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render_cache.cpp778
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp2330
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp3048
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp2186
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp1520
-rw-r--r--core/src/fpdfapi/fpdf_render/render_int.h924
-rw-r--r--core/src/fpdfdoc/doc_action.cpp724
-rw-r--r--core/src/fpdfdoc/doc_annot.cpp1038
-rw-r--r--core/src/fpdfdoc/doc_ap.cpp1616
-rw-r--r--core/src/fpdfdoc/doc_basic.cpp1134
-rw-r--r--core/src/fpdfdoc/doc_bookmark.cpp182
-rw-r--r--core/src/fpdfdoc/doc_form.cpp3328
-rw-r--r--core/src/fpdfdoc/doc_formcontrol.cpp922
-rw-r--r--core/src/fpdfdoc/doc_formfield.cpp2190
-rw-r--r--core/src/fpdfdoc/doc_link.cpp210
-rw-r--r--core/src/fpdfdoc/doc_metadata.cpp304
-rw-r--r--core/src/fpdfdoc/doc_ocg.cpp600
-rw-r--r--core/src/fpdfdoc/doc_tagged.cpp896
-rw-r--r--core/src/fpdfdoc/doc_utils.cpp1498
-rw-r--r--core/src/fpdfdoc/doc_viewerPreferences.cpp62
-rw-r--r--core/src/fpdfdoc/doc_vt.cpp3728
-rw-r--r--core/src/fpdfdoc/doc_vtmodule.cpp34
-rw-r--r--core/src/fpdfdoc/pdf_vt.h1284
-rw-r--r--core/src/fpdfdoc/tagged_int.h182
-rw-r--r--core/src/fpdftext/fpdf_text.cpp1582
-rw-r--r--core/src/fpdftext/fpdf_text_int.cpp5608
-rw-r--r--core/src/fpdftext/fpdf_text_search.cpp650
-rw-r--r--core/src/fpdftext/text_int.h430
-rw-r--r--core/src/fpdftext/txtproc.h140
-rw-r--r--core/src/fpdftext/unicodenormalization.cpp150
-rw-r--r--core/src/fpdftext/unicodenormalizationdata.cpp9322
-rw-r--r--core/src/fx_freetype.h30
-rw-r--r--core/src/fx_jpeglib.h20
-rw-r--r--core/src/fx_zlib.h20
-rw-r--r--core/src/fxcodec/codec/codec_int.h540
-rw-r--r--core/src/fxcodec/codec/fx_codec.cpp894
-rw-r--r--core/src/fxcodec/codec/fx_codec_fax.cpp1936
-rw-r--r--core/src/fxcodec/codec/fx_codec_flate.cpp1890
-rw-r--r--core/src/fxcodec/codec/fx_codec_icc.cpp2720
-rw-r--r--core/src/fxcodec/codec/fx_codec_jbig.cpp424
-rw-r--r--core/src/fxcodec/codec/fx_codec_jpeg.cpp1470
-rw-r--r--core/src/fxcodec/codec/fx_codec_jpx_opj.cpp1598
-rw-r--r--core/src/fxcodec/jbig2/JBig2_ArithDecoder.h252
-rw-r--r--core/src/fxcodec/jbig2/JBig2_ArithIntDecoder.cpp210
-rw-r--r--core/src/fxcodec/jbig2/JBig2_ArithIntDecoder.h78
-rw-r--r--core/src/fxcodec/jbig2/JBig2_ArithQe.h128
-rw-r--r--core/src/fxcodec/jbig2/JBig2_BitStream.h632
-rw-r--r--core/src/fxcodec/jbig2/JBig2_Context.cpp3624
-rw-r--r--core/src/fxcodec/jbig2/JBig2_Context.h270
-rw-r--r--core/src/fxcodec/jbig2/JBig2_Define.h68
-rw-r--r--core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp8580
-rw-r--r--core/src/fxcodec/jbig2/JBig2_GeneralDecoder.h556
-rw-r--r--core/src/fxcodec/jbig2/JBig2_HuffmanDecoder.cpp110
-rw-r--r--core/src/fxcodec/jbig2/JBig2_HuffmanDecoder.h48
-rw-r--r--core/src/fxcodec/jbig2/JBig2_HuffmanTable.cpp386
-rw-r--r--core/src/fxcodec/jbig2/JBig2_HuffmanTable.h84
-rw-r--r--core/src/fxcodec/jbig2/JBig2_HuffmanTable_Standard.h502
-rw-r--r--core/src/fxcodec/jbig2/JBig2_Image.cpp3238
-rw-r--r--core/src/fxcodec/jbig2/JBig2_Image.h136
-rw-r--r--core/src/fxcodec/jbig2/JBig2_List.h134
-rw-r--r--core/src/fxcodec/jbig2/JBig2_Module.h64
-rw-r--r--core/src/fxcodec/jbig2/JBig2_Object.cpp144
-rw-r--r--core/src/fxcodec/jbig2/JBig2_Object.h86
-rw-r--r--core/src/fxcodec/jbig2/JBig2_Page.h38
-rw-r--r--core/src/fxcodec/jbig2/JBig2_PatternDict.cpp48
-rw-r--r--core/src/fxcodec/jbig2/JBig2_PatternDict.h44
-rw-r--r--core/src/fxcodec/jbig2/JBig2_Segment.cpp106
-rw-r--r--core/src/fxcodec/jbig2/JBig2_Segment.h136
-rw-r--r--core/src/fxcodec/jbig2/JBig2_SymbolDict.cpp68
-rw-r--r--core/src/fxcodec/jbig2/JBig2_SymbolDict.h52
-rw-r--r--core/src/fxcodec/lcms2/include/fx_lcms2.h20
-rw-r--r--core/src/fxcodec/lcms2/include/fx_lcms2_plugin.h20
-rw-r--r--core/src/fxcodec/lcms2/lcms2-2.6/src/cmserr.c88
-rw-r--r--core/src/fxcodec/lcms2/lcms2-2.6/src/cmsgmt.c1180
-rw-r--r--core/src/fxcodec/lcms2/src/fx_cmscam02.c14
-rw-r--r--core/src/fxcodec/lcms2/src/fx_cmscgats.c14
-rw-r--r--core/src/fxcodec/lcms2/src/fx_cmscnvrt.c14
-rw-r--r--core/src/fxcodec/lcms2/src/fx_cmserr.c14
-rw-r--r--core/src/fxcodec/lcms2/src/fx_cmsgamma.c14
-rw-r--r--core/src/fxcodec/lcms2/src/fx_cmsgmt.c14
-rw-r--r--core/src/fxcodec/lcms2/src/fx_cmshalf.c14
-rw-r--r--core/src/fxcodec/lcms2/src/fx_cmsintrp.c14
-rw-r--r--core/src/fxcodec/lcms2/src/fx_cmsio0.c14
-rw-r--r--core/src/fxcodec/lcms2/src/fx_cmsio1.c14
-rw-r--r--core/src/fxcodec/lcms2/src/fx_cmslut.c14
-rw-r--r--core/src/fxcodec/lcms2/src/fx_cmsmd5.c14
-rw-r--r--core/src/fxcodec/lcms2/src/fx_cmsmtrx.c14
-rw-r--r--core/src/fxcodec/lcms2/src/fx_cmsnamed.c14
-rw-r--r--core/src/fxcodec/lcms2/src/fx_cmsopt.c14
-rw-r--r--core/src/fxcodec/lcms2/src/fx_cmspack.c14
-rw-r--r--core/src/fxcodec/lcms2/src/fx_cmspcs.c14
-rw-r--r--core/src/fxcodec/lcms2/src/fx_cmsplugin.c14
-rw-r--r--core/src/fxcodec/lcms2/src/fx_cmsps2.c14
-rw-r--r--core/src/fxcodec/lcms2/src/fx_cmssamp.c14
-rw-r--r--core/src/fxcodec/lcms2/src/fx_cmssm.c14
-rw-r--r--core/src/fxcodec/lcms2/src/fx_cmstypes.c14
-rw-r--r--core/src/fxcodec/lcms2/src/fx_cmsvirt.c14
-rw-r--r--core/src/fxcodec/lcms2/src/fx_cmswtpnt.c14
-rw-r--r--core/src/fxcodec/lcms2/src/fx_cmsxform.c14
-rw-r--r--core/src/fxcodec/libjpeg/cderror.h264
-rw-r--r--core/src/fxcodec/libjpeg/cdjpeg.h368
-rw-r--r--core/src/fxcodec/libjpeg/fpdfapi_jcapimin.c566
-rw-r--r--core/src/fxcodec/libjpeg/fpdfapi_jcapistd.c328
-rw-r--r--core/src/fxcodec/libjpeg/fpdfapi_jccoefct.c904
-rw-r--r--core/src/fxcodec/libjpeg/fpdfapi_jccolor.c924
-rw-r--r--core/src/fxcodec/libjpeg/fpdfapi_jcdctmgr.c780
-rw-r--r--core/src/fxcodec/libjpeg/fpdfapi_jchuff.c1830
-rw-r--r--core/src/fxcodec/libjpeg/fpdfapi_jcinit.c150
-rw-r--r--core/src/fxcodec/libjpeg/fpdfapi_jcmainct.c592
-rw-r--r--core/src/fxcodec/libjpeg/fpdfapi_jcmarker.c1334
-rw-r--r--core/src/fxcodec/libjpeg/fpdfapi_jcmaster.c1186
-rw-r--r--core/src/fxcodec/libjpeg/fpdfapi_jcomapi.c218
-rw-r--r--core/src/fxcodec/libjpeg/fpdfapi_jcparam.c1226
-rw-r--r--core/src/fxcodec/libjpeg/fpdfapi_jcphuff.c1672
-rw-r--r--core/src/fxcodec/libjpeg/fpdfapi_jcprepct.c714
-rw-r--r--core/src/fxcodec/libjpeg/fpdfapi_jcsample.c1044
-rw-r--r--core/src/fxcodec/libjpeg/fpdfapi_jctrans.c782
-rw-r--r--core/src/fxcodec/libjpeg/fpdfapi_jdapimin.c796
-rw-r--r--core/src/fxcodec/libjpeg/fpdfapi_jdapistd.c558
-rw-r--r--core/src/fxcodec/libjpeg/fpdfapi_jdcoefct.c1478
-rw-r--r--core/src/fxcodec/libjpeg/fpdfapi_jdcolor.c798
-rw-r--r--core/src/fxcodec/libjpeg/fpdfapi_jddctmgr.c544
-rw-r--r--core/src/fxcodec/libjpeg/fpdfapi_jdhuff.c1314
-rw-r--r--core/src/fxcodec/libjpeg/fpdfapi_jdinput.c768
-rw-r--r--core/src/fxcodec/libjpeg/fpdfapi_jdmainct.c1030
-rw-r--r--core/src/fxcodec/libjpeg/fpdfapi_jdmarker.c2792
-rw-r--r--core/src/fxcodec/libjpeg/fpdfapi_jdmaster.c1120
-rw-r--r--core/src/fxcodec/libjpeg/fpdfapi_jdmerge.c812
-rw-r--r--core/src/fxcodec/libjpeg/fpdfapi_jdphuff.c1342
-rw-r--r--core/src/fxcodec/libjpeg/fpdfapi_jdpostct.c586
-rw-r--r--core/src/fxcodec/libjpeg/fpdfapi_jdsample.c962
-rw-r--r--core/src/fxcodec/libjpeg/fpdfapi_jdtrans.c292
-rw-r--r--core/src/fxcodec/libjpeg/fpdfapi_jerror.c510
-rw-r--r--core/src/fxcodec/libjpeg/fpdfapi_jfdctfst.c454
-rw-r--r--core/src/fxcodec/libjpeg/fpdfapi_jfdctint.c572
-rw-r--r--core/src/fxcodec/libjpeg/fpdfapi_jidctfst.c742
-rw-r--r--core/src/fxcodec/libjpeg/fpdfapi_jidctint.c784
-rw-r--r--core/src/fxcodec/libjpeg/fpdfapi_jidctred.c802
-rw-r--r--core/src/fxcodec/libjpeg/fpdfapi_jmemmgr.c2246
-rw-r--r--core/src/fxcodec/libjpeg/fpdfapi_jmemnobs.c252
-rw-r--r--core/src/fxcodec/libjpeg/fpdfapi_jutils.c364
-rw-r--r--core/src/fxcodec/libjpeg/jchuff.h94
-rw-r--r--core/src/fxcodec/libjpeg/jconfig.h90
-rw-r--r--core/src/fxcodec/libjpeg/jdct.h352
-rw-r--r--core/src/fxcodec/libjpeg/jdhuff.h402
-rw-r--r--core/src/fxcodec/libjpeg/jerror.h582
-rw-r--r--core/src/fxcodec/libjpeg/jinclude.h204
-rw-r--r--core/src/fxcodec/libjpeg/jmemsys.h400
-rw-r--r--core/src/fxcodec/libjpeg/jmorecfg.h752
-rw-r--r--core/src/fxcodec/libjpeg/jpegint.h784
-rw-r--r--core/src/fxcodec/libjpeg/jpeglib.h2330
-rw-r--r--core/src/fxcodec/libjpeg/jversion.h28
-rw-r--r--core/src/fxcodec/libjpeg/transupp.h270
-rw-r--r--core/src/fxcrt/extension.h826
-rw-r--r--core/src/fxcrt/fx_basic_array.cpp730
-rw-r--r--core/src/fxcrt/fx_basic_bstring.cpp2408
-rw-r--r--core/src/fxcrt/fx_basic_buffer.cpp1148
-rw-r--r--core/src/fxcrt/fx_basic_coords.cpp1112
-rw-r--r--core/src/fxcrt/fx_basic_gcc.cpp464
-rw-r--r--core/src/fxcrt/fx_basic_list.cpp282
-rw-r--r--core/src/fxcrt/fx_basic_maps.cpp1308
-rw-r--r--core/src/fxcrt/fx_basic_memmgr.cpp612
-rw-r--r--core/src/fxcrt/fx_basic_memmgr_mini.cpp1644
-rw-r--r--core/src/fxcrt/fx_basic_plex.cpp56
-rw-r--r--core/src/fxcrt/fx_basic_utf.cpp204
-rw-r--r--core/src/fxcrt/fx_basic_util.cpp888
-rw-r--r--core/src/fxcrt/fx_basic_wstring.cpp2336
-rw-r--r--core/src/fxcrt/fx_extension.cpp802
-rw-r--r--core/src/fxcrt/fx_xml_composer.cpp84
-rw-r--r--core/src/fxcrt/fx_xml_parser.cpp2034
-rw-r--r--core/src/fxcrt/fxcrt_platforms.cpp406
-rw-r--r--core/src/fxcrt/fxcrt_platforms.h70
-rw-r--r--core/src/fxcrt/fxcrt_posix.cpp402
-rw-r--r--core/src/fxcrt/fxcrt_posix.h66
-rw-r--r--core/src/fxcrt/fxcrt_windows.cpp444
-rw-r--r--core/src/fxcrt/fxcrt_windows.h66
-rw-r--r--core/src/fxcrt/mem_int.h464
-rw-r--r--core/src/fxcrt/plex.h30
-rw-r--r--core/src/fxcrt/xml_int.h356
-rw-r--r--core/src/fxge/Microsoft SDK/include/DWrite.h10012
-rw-r--r--core/src/fxge/Microsoft SDK/include/Dcommon.h130
-rw-r--r--core/src/fxge/Microsoft SDK/include/GdiPlus.h312
-rw-r--r--core/src/fxge/Microsoft SDK/include/GdiPlusBase.h80
-rw-r--r--core/src/fxge/Microsoft SDK/include/GdiPlusBitmap.h2008
-rw-r--r--core/src/fxge/Microsoft SDK/include/GdiPlusBrush.h1902
-rw-r--r--core/src/fxge/Microsoft SDK/include/GdiPlusCachedBitmap.h142
-rw-r--r--core/src/fxge/Microsoft SDK/include/GdiPlusColor.h418
-rw-r--r--core/src/fxge/Microsoft SDK/include/GdiPlusColorMatrix.h126
-rw-r--r--core/src/fxge/Microsoft SDK/include/GdiPlusEnums.h2504
-rw-r--r--core/src/fxge/Microsoft SDK/include/GdiPlusFlat.h5480
-rw-r--r--core/src/fxge/Microsoft SDK/include/GdiPlusFont.h598
-rw-r--r--core/src/fxge/Microsoft SDK/include/GdiPlusFontCollection.h298
-rw-r--r--core/src/fxge/Microsoft SDK/include/GdiPlusFontFamily.h542
-rw-r--r--core/src/fxge/Microsoft SDK/include/GdiPlusGpStubs.h214
-rw-r--r--core/src/fxge/Microsoft SDK/include/GdiPlusGraphics.h5452
-rw-r--r--core/src/fxge/Microsoft SDK/include/GdiPlusHeaders.h1586
-rw-r--r--core/src/fxge/Microsoft SDK/include/GdiPlusImageCodec.h146
-rw-r--r--core/src/fxge/Microsoft SDK/include/GdiPlusImaging.h1080
-rw-r--r--core/src/fxge/Microsoft SDK/include/GdiPlusLineCaps.h506
-rw-r--r--core/src/fxge/Microsoft SDK/include/GdiPlusMatrix.h618
-rw-r--r--core/src/fxge/Microsoft SDK/include/GdiPlusMem.h98
-rw-r--r--core/src/fxge/Microsoft SDK/include/GdiPlusMetaFile.h748
-rw-r--r--core/src/fxge/Microsoft SDK/include/GdiPlusMetaHeader.h426
-rw-r--r--core/src/fxge/Microsoft SDK/include/GdiPlusPath.h3372
-rw-r--r--core/src/fxge/Microsoft SDK/include/GdiPlusPen.h1038
-rw-r--r--core/src/fxge/Microsoft SDK/include/GdiPlusPixelFormats.h402
-rw-r--r--core/src/fxge/Microsoft SDK/include/GdiPlusRegion.h996
-rw-r--r--core/src/fxge/Microsoft SDK/include/GdiPlusStringFormat.h762
-rw-r--r--core/src/fxge/Microsoft SDK/include/GdiPlusTypes.h1652
-rw-r--r--core/src/fxge/Microsoft SDK/include/GdiPlusimageAttributes.h794
-rw-r--r--core/src/fxge/Microsoft SDK/include/GdiplusInit.h208
-rw-r--r--core/src/fxge/Microsoft SDK/include/sal.h1458
-rw-r--r--core/src/fxge/Microsoft SDK/include/specstrings.h1956
-rw-r--r--core/src/fxge/apple/apple_int.h492
-rw-r--r--core/src/fxge/apple/fx_apple_platform.cpp346
-rw-r--r--core/src/fxge/apple/fx_mac_imp.cpp234
-rw-r--r--core/src/fxge/apple/fx_quartz_device.cpp2276
-rw-r--r--core/src/fxge/dib/dib_int.h176
-rw-r--r--core/src/fxge/dib/fx_dib_composite.cpp9204
-rw-r--r--core/src/fxge/dib/fx_dib_convert.cpp2180
-rw-r--r--core/src/fxge/dib/fx_dib_engine.cpp1734
-rw-r--r--core/src/fxge/dib/fx_dib_main.cpp3468
-rw-r--r--core/src/fxge/dib/fx_dib_transform.cpp1594
-rw-r--r--core/src/fxge/ge/fx_ge.cpp158
-rw-r--r--core/src/fxge/ge/fx_ge_device.cpp810
-rw-r--r--core/src/fxge/ge/fx_ge_font.cpp916
-rw-r--r--core/src/fxge/ge/fx_ge_fontmap.cpp3116
-rw-r--r--core/src/fxge/ge/fx_ge_linux.cpp518
-rw-r--r--core/src/fxge/ge/fx_ge_path.cpp1308
-rw-r--r--core/src/fxge/ge/fx_ge_ps.cpp1314
-rw-r--r--core/src/fxge/ge/fx_ge_text.cpp3548
-rw-r--r--core/src/fxge/ge/text_int.h200
-rw-r--r--core/src/fxge/win32/dwrite_int.h118
-rw-r--r--core/src/fxge/win32/fx_win32_device.cpp2400
-rw-r--r--core/src/fxge/win32/fx_win32_dib.cpp620
-rw-r--r--core/src/fxge/win32/fx_win32_dwrite.cpp960
-rw-r--r--core/src/fxge/win32/fx_win32_gdipext.cpp2572
-rw-r--r--core/src/fxge/win32/fx_win32_print.cpp852
-rw-r--r--core/src/fxge/win32/win32_int.h476
-rw-r--r--fpdfsdk/include/formfiller/FFL_CBA_Fontmap.h102
-rw-r--r--fpdfsdk/include/formfiller/FFL_CheckBox.h54
-rw-r--r--fpdfsdk/include/formfiller/FFL_ComboBox.h138
-rw-r--r--fpdfsdk/include/formfiller/FFL_FormFiller.h356
-rw-r--r--fpdfsdk/include/formfiller/FFL_IFormFiller.h288
-rw-r--r--fpdfsdk/include/formfiller/FFL_ListBox.h88
-rw-r--r--fpdfsdk/include/formfiller/FFL_Notify.h108
-rw-r--r--fpdfsdk/include/formfiller/FFL_PushButton.h50
-rw-r--r--fpdfsdk/include/formfiller/FFL_RadioButton.h50
-rw-r--r--fpdfsdk/include/formfiller/FFL_TextField.h178
-rw-r--r--fpdfsdk/include/formfiller/FFL_Utils.h40
-rw-r--r--fpdfsdk/include/formfiller/FormFiller.h60
-rw-r--r--fpdfsdk/include/fpdf_dataavail.h444
-rw-r--r--fpdfsdk/include/fpdf_ext.h216
-rw-r--r--fpdfsdk/include/fpdf_flatten.h84
-rw-r--r--fpdfsdk/include/fpdf_fwlevent.h572
-rw-r--r--fpdfsdk/include/fpdf_progressive.h188
-rw-r--r--fpdfsdk/include/fpdf_searchex.h66
-rw-r--r--fpdfsdk/include/fpdf_transformpage.h226
-rw-r--r--fpdfsdk/include/fpdfdoc.h460
-rw-r--r--fpdfsdk/include/fpdfedit.h470
-rw-r--r--fpdfsdk/include/fpdfformfill.h1682
-rw-r--r--fpdfsdk/include/fpdfoom.h122
-rw-r--r--fpdfsdk/include/fpdfppo.h68
-rw-r--r--fpdfsdk/include/fpdfsave.h162
-rw-r--r--fpdfsdk/include/fpdftext.h632
-rw-r--r--fpdfsdk/include/fpdfview.h1156
-rw-r--r--fpdfsdk/include/fsdk_actionhandler.h164
-rw-r--r--fpdfsdk/include/fsdk_annothandler.h496
-rw-r--r--fpdfsdk/include/fsdk_baseannot.h372
-rw-r--r--fpdfsdk/include/fsdk_baseform.h584
-rw-r--r--fpdfsdk/include/fsdk_common.h92
-rw-r--r--fpdfsdk/include/fsdk_define.h256
-rw-r--r--fpdfsdk/include/fsdk_mgr.h1230
-rw-r--r--fpdfsdk/include/fsdk_rendercontext.h82
-rw-r--r--fpdfsdk/include/fx_systemhandler.h170
-rw-r--r--fpdfsdk/include/fxedit/fx_edit.h942
-rw-r--r--fpdfsdk/include/fxedit/fxet_edit.h1646
-rw-r--r--fpdfsdk/include/fxedit/fxet_list.h726
-rw-r--r--fpdfsdk/include/fxedit/fxet_stub.h52
-rw-r--r--fpdfsdk/include/javascript/Consts.h252
-rw-r--r--fpdfsdk/include/javascript/Document.h564
-rw-r--r--fpdfsdk/include/javascript/Field.h710
-rw-r--r--fpdfsdk/include/javascript/IJavaScript.h224
-rw-r--r--fpdfsdk/include/javascript/Icon.h84
-rw-r--r--fpdfsdk/include/javascript/JS_Console.h476
-rw-r--r--fpdfsdk/include/javascript/JS_Context.h202
-rw-r--r--fpdfsdk/include/javascript/JS_Define.h1570
-rw-r--r--fpdfsdk/include/javascript/JS_EventHandler.h334
-rw-r--r--fpdfsdk/include/javascript/JS_GlobalData.h194
-rw-r--r--fpdfsdk/include/javascript/JS_Module.h92
-rw-r--r--fpdfsdk/include/javascript/JS_Object.h576
-rw-r--r--fpdfsdk/include/javascript/JS_Runtime.h140
-rw-r--r--fpdfsdk/include/javascript/JS_Value.h372
-rw-r--r--fpdfsdk/include/javascript/JavaScript.h78
-rw-r--r--fpdfsdk/include/javascript/PublicMethods.h202
-rw-r--r--fpdfsdk/include/javascript/app.h450
-rw-r--r--fpdfsdk/include/javascript/color.h156
-rw-r--r--fpdfsdk/include/javascript/console.h76
-rw-r--r--fpdfsdk/include/javascript/event.h140
-rw-r--r--fpdfsdk/include/javascript/global.h170
-rw-r--r--fpdfsdk/include/javascript/report.h70
-rw-r--r--fpdfsdk/include/javascript/resource.h220
-rw-r--r--fpdfsdk/include/javascript/util.h90
-rw-r--r--fpdfsdk/include/pdfwindow/IPDFWindow.h56
-rw-r--r--fpdfsdk/include/pdfwindow/PDFWindow.h56
-rw-r--r--fpdfsdk/include/pdfwindow/PWL_Button.h56
-rw-r--r--fpdfsdk/include/pdfwindow/PWL_Caret.h116
-rw-r--r--fpdfsdk/include/pdfwindow/PWL_ComboBox.h230
-rw-r--r--fpdfsdk/include/pdfwindow/PWL_Edit.h276
-rw-r--r--fpdfsdk/include/pdfwindow/PWL_EditCtrl.h342
-rw-r--r--fpdfsdk/include/pdfwindow/PWL_FontMap.h274
-rw-r--r--fpdfsdk/include/pdfwindow/PWL_Icon.h118
-rw-r--r--fpdfsdk/include/pdfwindow/PWL_IconList.h250
-rw-r--r--fpdfsdk/include/pdfwindow/PWL_Label.h102
-rw-r--r--fpdfsdk/include/pdfwindow/PWL_ListBox.h206
-rw-r--r--fpdfsdk/include/pdfwindow/PWL_ListCtrl.h106
-rw-r--r--fpdfsdk/include/pdfwindow/PWL_Note.h710
-rw-r--r--fpdfsdk/include/pdfwindow/PWL_ScrollBar.h332
-rw-r--r--fpdfsdk/include/pdfwindow/PWL_Signature.h134
-rw-r--r--fpdfsdk/include/pdfwindow/PWL_SpecialButton.h126
-rw-r--r--fpdfsdk/include/pdfwindow/PWL_Utils.h474
-rw-r--r--fpdfsdk/include/pdfwindow/PWL_Wnd.h986
-rw-r--r--fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp600
-rw-r--r--fpdfsdk/src/formfiller/FFL_CheckBox.cpp288
-rw-r--r--fpdfsdk/src/formfiller/FFL_ComboBox.cpp884
-rw-r--r--fpdfsdk/src/formfiller/FFL_FormFiller.cpp1850
-rw-r--r--fpdfsdk/src/formfiller/FFL_IFormFiller.cpp2394
-rw-r--r--fpdfsdk/src/formfiller/FFL_ListBox.cpp638
-rw-r--r--fpdfsdk/src/formfiller/FFL_Notify.cpp344
-rw-r--r--fpdfsdk/src/formfiller/FFL_PushButton.cpp86
-rw-r--r--fpdfsdk/src/formfiller/FFL_RadioButton.cpp274
-rw-r--r--fpdfsdk/src/formfiller/FFL_TextField.cpp824
-rw-r--r--fpdfsdk/src/formfiller/FFL_Utils.cpp266
-rw-r--r--fpdfsdk/src/fpdf_dataavail.cpp330
-rw-r--r--fpdfsdk/src/fpdf_ext.cpp490
-rw-r--r--fpdfsdk/src/fpdf_flatten.cpp1122
-rw-r--r--fpdfsdk/src/fpdf_progressive.cpp228
-rw-r--r--fpdfsdk/src/fpdf_searchex.cpp30
-rw-r--r--fpdfsdk/src/fpdf_transformpage.cpp650
-rw-r--r--fpdfsdk/src/fpdfdoc.cpp518
-rw-r--r--fpdfsdk/src/fpdfeditimg.cpp148
-rw-r--r--fpdfsdk/src/fpdfeditpage.cpp632
-rw-r--r--fpdfsdk/src/fpdfformfill.cpp882
-rw-r--r--fpdfsdk/src/fpdfoom.cpp54
-rw-r--r--fpdfsdk/src/fpdfppo.cpp920
-rw-r--r--fpdfsdk/src/fpdfsave.cpp182
-rw-r--r--fpdfsdk/src/fpdfsdkdll.rc218
-rw-r--r--fpdfsdk/src/fpdftext.cpp556
-rw-r--r--fpdfsdk/src/fpdfview.cpp1758
-rw-r--r--fpdfsdk/src/fsdk_actionhandler.cpp1700
-rw-r--r--fpdfsdk/src/fsdk_annothandler.cpp1890
-rw-r--r--fpdfsdk/src/fsdk_baseannot.cpp2374
-rw-r--r--fpdfsdk/src/fsdk_baseform.cpp6222
-rw-r--r--fpdfsdk/src/fsdk_mgr.cpp2110
-rw-r--r--fpdfsdk/src/fsdk_rendercontext.cpp98
-rw-r--r--fpdfsdk/src/fxedit/fxet_ap.cpp450
-rw-r--r--fpdfsdk/src/fxedit/fxet_edit.cpp7220
-rw-r--r--fpdfsdk/src/fxedit/fxet_list.cpp2024
-rw-r--r--fpdfsdk/src/fxedit/fxet_module.cpp92
-rw-r--r--fpdfsdk/src/fxedit/fxet_pageobjs.cpp1374
-rw-r--r--fpdfsdk/src/javascript/Consts.cpp494
-rw-r--r--fpdfsdk/src/javascript/Document.cpp5054
-rw-r--r--fpdfsdk/src/javascript/Field.cpp8256
-rw-r--r--fpdfsdk/src/javascript/Icon.cpp134
-rw-r--r--fpdfsdk/src/javascript/JS_Context.cpp728
-rw-r--r--fpdfsdk/src/javascript/JS_EventHandler.cpp1352
-rw-r--r--fpdfsdk/src/javascript/JS_GlobalData.cpp1162
-rw-r--r--fpdfsdk/src/javascript/JS_Object.cpp290
-rw-r--r--fpdfsdk/src/javascript/JS_Runtime.cpp940
-rw-r--r--fpdfsdk/src/javascript/JS_Value.cpp1286
-rw-r--r--fpdfsdk/src/javascript/PublicMethods.cpp4670
-rw-r--r--fpdfsdk/src/javascript/app.cpp2268
-rw-r--r--fpdfsdk/src/javascript/color.cpp506
-rw-r--r--fpdfsdk/src/javascript/console.cpp156
-rw-r--r--fpdfsdk/src/javascript/event.cpp758
-rw-r--r--fpdfsdk/src/javascript/global.cpp1100
-rw-r--r--fpdfsdk/src/javascript/report.cpp100
-rw-r--r--fpdfsdk/src/javascript/util.cpp1298
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_Button.cpp106
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_Caret.cpp394
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_ComboBox.cpp1324
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_Edit.cpp2632
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_EditCtrl.cpp1456
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_FontMap.cpp1202
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_Icon.cpp544
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_IconList.cpp1184
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_Label.cpp374
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_ListBox.cpp1264
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_ListCtrl.cpp490
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_Note.cpp3558
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_ScrollBar.cpp2706
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_Signature.cpp440
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_SpecialButton.cpp220
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_Utils.cpp5688
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_Wnd.cpp2684
-rw-r--r--fpdfsdk/src/resource.h42
-rw-r--r--samples/pdfium_test.cc618
-rw-r--r--samples/samples.gyp40
525 files changed, 257825 insertions, 257825 deletions
diff --git a/README.txt b/README
index 3a2cbde22f..3a2cbde22f 100644
--- a/README.txt
+++ b/README
diff --git a/build/all.gyp b/build/all.gyp
index e9229dd7c6..c97871d229 100644
--- a/build/all.gyp
+++ b/build/all.gyp
@@ -1,15 +1,15 @@
-# 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.
-
-{
- 'targets': [
- {
- 'target_name': 'All',
- 'type': 'none',
- 'dependencies': [
- '../samples/samples.gyp:*',
- ],
- }
- ]
+# 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.
+
+{
+ 'targets': [
+ {
+ 'target_name': 'All',
+ 'type': 'none',
+ 'dependencies': [
+ '../samples/samples.gyp:*',
+ ],
+ }
+ ]
} \ No newline at end of file
diff --git a/build/gyp_pdfium.py b/build/gyp_pdfium.py
index 9776c302d4..6831702b54 100644
--- a/build/gyp_pdfium.py
+++ b/build/gyp_pdfium.py
@@ -1,8 +1,8 @@
-# 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.
-
-import os
-
-path = os.path.abspath(os.path.split(__file__)[0])
-execfile(os.path.join(path, 'gyp_pdfium'))
+# 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.
+
+import os
+
+path = os.path.abspath(os.path.split(__file__)[0])
+execfile(os.path.join(path, 'gyp_pdfium'))
diff --git a/build/standalone.gypi b/build/standalone.gypi
index 970c0590c7..d919c1669c 100644
--- a/build/standalone.gypi
+++ b/build/standalone.gypi
@@ -1,259 +1,259 @@
-# 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.
-
-# Definitions to be used when building stand-alone PDFium binaries.
-
-{
- 'variables': {
- 'component%': 'static_library',
- 'clang%': 0,
- 'msvs_multi_core_compile%': '1',
- 'variables': {
- 'variables': {
- 'variables': {
- 'conditions': [
- ['OS=="linux" or OS=="mac"', {
- # This handles the Unix platforms we generally deal with.
- # Anything else gets passed through, which probably won't work
- # very well; such hosts should pass an explicit target_arch
- # to gyp.
- 'host_arch%':
- '<!(uname -m | sed -e "s/i.86/ia32/;\
- s/x86_64/x64/;\
- s/amd64/x64/;\
- s/arm.*/arm/;\
- s/aarch64/arm64/;\
- s/mips.*/mipsel/")',
- }, {
- # OS!="linux" and OS!="mac"
- 'host_arch%': 'ia32',
- }],
- ],
- },
- 'host_arch%': '<(host_arch)',
- 'target_arch%': '<(host_arch)',
- },
- 'host_arch%': '<(host_arch)',
- 'target_arch%': '<(target_arch)',
- },
- 'host_arch%': '<(host_arch)',
- 'target_arch%': '<(target_arch)',
- 'werror%': '-Werror',
- 'v8_optimized_debug%': 0,
- 'icu_gyp_path': '../v8/third_party/icu/icu.gyp',
- 'conditions': [
- ['OS == "win"', {
- 'os_posix%': 0,
- }, {
- 'os_posix%': 1,
- }],
- ],
- },
- 'target_defaults': {
- 'default_configuration': 'Debug',
- 'configurations': {
- 'Debug': {
- 'cflags': [
- '-g',
- '-O0',
- '-fdata-sections',
- '-ffunction-sections',
- ],
- 'msvs_settings': {
- 'VCCLCompilerTool': {
- 'Optimization': '0',
- 'conditions': [
- ['component=="shared_library"', {
- 'RuntimeLibrary': '3', # /MDd
- }, {
- 'RuntimeLibrary': '1', # /MTd
- }],
- ],
- },
- 'VCLinkerTool': {
- 'LinkIncremental': '2',
- },
- },
- 'xcode_settings': {
- 'GCC_OPTIMIZATION_LEVEL': '0', # -O0
- },
- },
- 'Release': {
- 'cflags': [
- '-fno-strict-aliasing',
- ],
- 'xcode_settings': {
- 'GCC_OPTIMIZATION_LEVEL': '3', # -O3
- 'GCC_STRICT_ALIASING': 'NO',
- },
- 'msvs_settings': {
- 'VCCLCompilerTool': {
- 'Optimization': '2',
- 'InlineFunctionExpansion': '2',
- 'EnableIntrinsicFunctions': 'true',
- 'FavorSizeOrSpeed': '0',
- 'StringPooling': 'true',
- 'conditions': [
- ['component=="shared_library"', {
- 'RuntimeLibrary': '2', #/MD
- }, {
- 'RuntimeLibrary': '0', #/MT
- }],
- ],
- },
- 'VCLinkerTool': {
- 'LinkIncremental': '1',
- 'OptimizeReferences': '2',
- 'EnableCOMDATFolding': '2',
- },
- },
- 'conditions': [
- ['OS=="linux"', {
- 'cflags': [
- '-fdata-sections',
- '-ffunction-sections',
- '-O3',
- '-O2',
- ],
- }],
- ['OS=="android"', {
- 'cflags!': [
- '-O3',
- '-Os',
- ],
- 'cflags': [
- '-fdata-sections',
- '-ffunction-sections',
- '-O2',
- ],
- }],
- ], # conditions
- },
- },
- 'defines!': [
- 'DEBUG',
- ],
- 'cflags!': [
- '-Wall',
- '-W',
- '-Wno-unused-parameter',
- '-pthread', '-fno-exceptions',
- '-fvisibility=hidden',
- ],
- 'cflags_cc': [
- '-Wnon-virtual-dtor',
- '-fno-rtti',
- ],
- 'ldflags': [
- '-pthread',
- ],
- 'msvs_cygwin_dirs': ['<(DEPTH)/v8/third_party/cygwin'],
- 'msvs_configuration_attributes': {
- 'OutputDirectory': '<(DEPTH)\\out\\$(ConfigurationName)',
- 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
- 'CharacterSet': '1',
- },
- 'msvs_settings': {
- 'VCCLCompilerTool': {
- 'MinimalRebuild': 'false',
- 'BufferSecurityCheck': 'true',
- 'EnableFunctionLevelLinking': 'true',
- 'RuntimeTypeInfo': 'false',
- 'WarningLevel': '3',
- 'WarnAsError': 'false',
- 'DebugInformationFormat': '3',
- 'Detect64BitPortabilityProblems': 'false',
- 'conditions': [
- [ 'msvs_multi_core_compile', {
- 'AdditionalOptions': ['/MP'],
- }],
- ['component=="shared_library"', {
- 'ExceptionHandling': '1', # /EHsc
- }, {
- 'ExceptionHandling': '0',
- }],
- ],
- },
- 'VCLibrarianTool': {
- 'AdditionalOptions': ['/ignore:4221'],
- },
- 'VCLinkerTool': {
- 'GenerateDebugInformation': 'true',
- 'LinkIncremental': '1',
- # SubSystem values:
- # 0 == not set
- # 1 == /SUBSYSTEM:CONSOLE
- # 2 == /SUBSYSTEM:WINDOWS
- 'SubSystem': '1',
- 'AdditionalDependencies': [
- 'advapi32.lib',
- 'gdi32.lib',
- 'user32.lib',
- ],
- },
- },
- 'xcode_settings': {
- 'ALWAYS_SEARCH_USER_PATHS': 'NO',
- 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
- 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
- # (Equivalent to -fPIC)
- 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
- 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
- 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
- # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
- 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
- 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
- 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror
- 'GCC_WARN_NON_VIRTUAL_DESTRUCTOR': 'YES', # -Wnon-virtual-dtor
- 'SYMROOT': '<(DEPTH)/xcodebuild',
- 'USE_HEADERMAP': 'NO',
- 'OTHER_CFLAGS': [
- '-fno-strict-aliasing',
- ],
- 'WARNING_CFLAGS': [
- '-Wall',
- '-Wendif-labels',
- '-W',
- '-Wno-unused-parameter',
- ],
- },
- },
- 'conditions': [
- ['component=="shared_library"', {
- 'cflags': [
- '-fPIC',
- ],
- }],
- ['OS=="win"', {
- 'target_defaults': {
- 'defines': [
- '_CRT_SECURE_NO_DEPRECATE',
- '_CRT_NONSTDC_NO_DEPRECATE',
- ],
- 'conditions': [
- ['component=="static_library"', {
- 'defines': [
- '_HAS_EXCEPTIONS=0',
- ],
- }],
- ],
- },
- }], # OS=="win"
- ['OS=="mac"', {
- 'target_defaults': {
- 'link_settings': {
- 'libraries': [
- '$(SDKROOT)/System/Library/Frameworks/AppKit.framework',
- '$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework',
- ],
- },
- 'target_conditions': [
- ['_type!="static_library"', {
- 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
- }],
- ], # target_conditions
- }, # target_defaults
- }], # OS=="mac"
- ],
+# 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.
+
+# Definitions to be used when building stand-alone PDFium binaries.
+
+{
+ 'variables': {
+ 'component%': 'static_library',
+ 'clang%': 0,
+ 'msvs_multi_core_compile%': '1',
+ 'variables': {
+ 'variables': {
+ 'variables': {
+ 'conditions': [
+ ['OS=="linux" or OS=="mac"', {
+ # This handles the Unix platforms we generally deal with.
+ # Anything else gets passed through, which probably won't work
+ # very well; such hosts should pass an explicit target_arch
+ # to gyp.
+ 'host_arch%':
+ '<!(uname -m | sed -e "s/i.86/ia32/;\
+ s/x86_64/x64/;\
+ s/amd64/x64/;\
+ s/arm.*/arm/;\
+ s/aarch64/arm64/;\
+ s/mips.*/mipsel/")',
+ }, {
+ # OS!="linux" and OS!="mac"
+ 'host_arch%': 'ia32',
+ }],
+ ],
+ },
+ 'host_arch%': '<(host_arch)',
+ 'target_arch%': '<(host_arch)',
+ },
+ 'host_arch%': '<(host_arch)',
+ 'target_arch%': '<(target_arch)',
+ },
+ 'host_arch%': '<(host_arch)',
+ 'target_arch%': '<(target_arch)',
+ 'werror%': '-Werror',
+ 'v8_optimized_debug%': 0,
+ 'icu_gyp_path': '../v8/third_party/icu/icu.gyp',
+ 'conditions': [
+ ['OS == "win"', {
+ 'os_posix%': 0,
+ }, {
+ 'os_posix%': 1,
+ }],
+ ],
+ },
+ 'target_defaults': {
+ 'default_configuration': 'Debug',
+ 'configurations': {
+ 'Debug': {
+ 'cflags': [
+ '-g',
+ '-O0',
+ '-fdata-sections',
+ '-ffunction-sections',
+ ],
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ 'Optimization': '0',
+ 'conditions': [
+ ['component=="shared_library"', {
+ 'RuntimeLibrary': '3', # /MDd
+ }, {
+ 'RuntimeLibrary': '1', # /MTd
+ }],
+ ],
+ },
+ 'VCLinkerTool': {
+ 'LinkIncremental': '2',
+ },
+ },
+ 'xcode_settings': {
+ 'GCC_OPTIMIZATION_LEVEL': '0', # -O0
+ },
+ },
+ 'Release': {
+ 'cflags': [
+ '-fno-strict-aliasing',
+ ],
+ 'xcode_settings': {
+ 'GCC_OPTIMIZATION_LEVEL': '3', # -O3
+ 'GCC_STRICT_ALIASING': 'NO',
+ },
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ 'Optimization': '2',
+ 'InlineFunctionExpansion': '2',
+ 'EnableIntrinsicFunctions': 'true',
+ 'FavorSizeOrSpeed': '0',
+ 'StringPooling': 'true',
+ 'conditions': [
+ ['component=="shared_library"', {
+ 'RuntimeLibrary': '2', #/MD
+ }, {
+ 'RuntimeLibrary': '0', #/MT
+ }],
+ ],
+ },
+ 'VCLinkerTool': {
+ 'LinkIncremental': '1',
+ 'OptimizeReferences': '2',
+ 'EnableCOMDATFolding': '2',
+ },
+ },
+ 'conditions': [
+ ['OS=="linux"', {
+ 'cflags': [
+ '-fdata-sections',
+ '-ffunction-sections',
+ '-O3',
+ '-O2',
+ ],
+ }],
+ ['OS=="android"', {
+ 'cflags!': [
+ '-O3',
+ '-Os',
+ ],
+ 'cflags': [
+ '-fdata-sections',
+ '-ffunction-sections',
+ '-O2',
+ ],
+ }],
+ ], # conditions
+ },
+ },
+ 'defines!': [
+ 'DEBUG',
+ ],
+ 'cflags!': [
+ '-Wall',
+ '-W',
+ '-Wno-unused-parameter',
+ '-pthread', '-fno-exceptions',
+ '-fvisibility=hidden',
+ ],
+ 'cflags_cc': [
+ '-Wnon-virtual-dtor',
+ '-fno-rtti',
+ ],
+ 'ldflags': [
+ '-pthread',
+ ],
+ 'msvs_cygwin_dirs': ['<(DEPTH)/v8/third_party/cygwin'],
+ 'msvs_configuration_attributes': {
+ 'OutputDirectory': '<(DEPTH)\\out\\$(ConfigurationName)',
+ 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
+ 'CharacterSet': '1',
+ },
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ 'MinimalRebuild': 'false',
+ 'BufferSecurityCheck': 'true',
+ 'EnableFunctionLevelLinking': 'true',
+ 'RuntimeTypeInfo': 'false',
+ 'WarningLevel': '3',
+ 'WarnAsError': 'false',
+ 'DebugInformationFormat': '3',
+ 'Detect64BitPortabilityProblems': 'false',
+ 'conditions': [
+ [ 'msvs_multi_core_compile', {
+ 'AdditionalOptions': ['/MP'],
+ }],
+ ['component=="shared_library"', {
+ 'ExceptionHandling': '1', # /EHsc
+ }, {
+ 'ExceptionHandling': '0',
+ }],
+ ],
+ },
+ 'VCLibrarianTool': {
+ 'AdditionalOptions': ['/ignore:4221'],
+ },
+ 'VCLinkerTool': {
+ 'GenerateDebugInformation': 'true',
+ 'LinkIncremental': '1',
+ # SubSystem values:
+ # 0 == not set
+ # 1 == /SUBSYSTEM:CONSOLE
+ # 2 == /SUBSYSTEM:WINDOWS
+ 'SubSystem': '1',
+ 'AdditionalDependencies': [
+ 'advapi32.lib',
+ 'gdi32.lib',
+ 'user32.lib',
+ ],
+ },
+ },
+ 'xcode_settings': {
+ 'ALWAYS_SEARCH_USER_PATHS': 'NO',
+ 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
+ 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
+ # (Equivalent to -fPIC)
+ 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
+ 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
+ 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
+ # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
+ 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
+ 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
+ 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror
+ 'GCC_WARN_NON_VIRTUAL_DESTRUCTOR': 'YES', # -Wnon-virtual-dtor
+ 'SYMROOT': '<(DEPTH)/xcodebuild',
+ 'USE_HEADERMAP': 'NO',
+ 'OTHER_CFLAGS': [
+ '-fno-strict-aliasing',
+ ],
+ 'WARNING_CFLAGS': [
+ '-Wall',
+ '-Wendif-labels',
+ '-W',
+ '-Wno-unused-parameter',
+ ],
+ },
+ },
+ 'conditions': [
+ ['component=="shared_library"', {
+ 'cflags': [
+ '-fPIC',
+ ],
+ }],
+ ['OS=="win"', {
+ 'target_defaults': {
+ 'defines': [
+ '_CRT_SECURE_NO_DEPRECATE',
+ '_CRT_NONSTDC_NO_DEPRECATE',
+ ],
+ 'conditions': [
+ ['component=="static_library"', {
+ 'defines': [
+ '_HAS_EXCEPTIONS=0',
+ ],
+ }],
+ ],
+ },
+ }], # OS=="win"
+ ['OS=="mac"', {
+ 'target_defaults': {
+ 'link_settings': {
+ 'libraries': [
+ '$(SDKROOT)/System/Library/Frameworks/AppKit.framework',
+ '$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework',
+ ],
+ },
+ 'target_conditions': [
+ ['_type!="static_library"', {
+ 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
+ }],
+ ], # target_conditions
+ }, # target_defaults
+ }], # OS=="mac"
+ ],
} \ No newline at end of file
diff --git a/core/include/fdrm/fx_crypt.h b/core/include/fdrm/fx_crypt.h
index 5e0b786ad0..ec7d55ab8c 100644
--- a/core/include/fdrm/fx_crypt.h
+++ b/core/include/fdrm/fx_crypt.h
@@ -1,43 +1,43 @@
-// 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 _FX_CRYPT_H_
-#define _FX_CRYPT_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-void CRYPT_ArcFourCryptBlock(FX_LPBYTE data, FX_DWORD size, FX_LPCBYTE key, FX_DWORD keylen);
-void CRYPT_ArcFourSetup(FX_LPVOID context, FX_LPCBYTE key, FX_DWORD length);
-void CRYPT_ArcFourCrypt(FX_LPVOID context, FX_LPBYTE data, FX_DWORD size);
-void CRYPT_AESSetKey(FX_LPVOID context, FX_DWORD blocklen, FX_LPCBYTE key, FX_DWORD keylen, FX_BOOL bEncrypt);
-void CRYPT_AESSetIV(FX_LPVOID context, FX_LPCBYTE iv);
-void CRYPT_AESDecrypt(FX_LPVOID context, FX_LPBYTE dest, FX_LPCBYTE src, FX_DWORD size);
-void CRYPT_AESEncrypt(FX_LPVOID context, FX_LPBYTE dest, FX_LPCBYTE src, FX_DWORD size);
-void CRYPT_MD5Generate(FX_LPCBYTE data, FX_DWORD size, FX_BYTE digest[16]);
-void CRYPT_MD5Start(FX_LPVOID context);
-void CRYPT_MD5Update(FX_LPVOID context, FX_LPCBYTE data, FX_DWORD size);
-void CRYPT_MD5Finish(FX_LPVOID context, FX_BYTE digest[16]);
-void CRYPT_SHA1Generate(FX_LPCBYTE data, FX_DWORD size, FX_BYTE digest[20]);
-void CRYPT_SHA1Start(FX_LPVOID context);
-void CRYPT_SHA1Update(FX_LPVOID context, FX_LPCBYTE data, FX_DWORD size);
-void CRYPT_SHA1Finish(FX_LPVOID context, FX_BYTE digest[20]);
-void CRYPT_SHA256Generate(FX_LPCBYTE data, FX_DWORD size, FX_BYTE digest[32]);
-void CRYPT_SHA256Start(FX_LPVOID context);
-void CRYPT_SHA256Update(FX_LPVOID context, FX_LPCBYTE data, FX_DWORD size);
-void CRYPT_SHA256Finish(FX_LPVOID context, FX_BYTE digest[32]);
-void CRYPT_SHA384Start(FX_LPVOID context);
-void CRYPT_SHA384Update(FX_LPVOID context, FX_LPCBYTE data, FX_DWORD size);
-void CRYPT_SHA384Finish(FX_LPVOID context, FX_BYTE digest[48]);
-void CRYPT_SHA384Generate(FX_LPCBYTE data, FX_DWORD size, FX_BYTE digest[48]);
-void CRYPT_SHA512Start(FX_LPVOID context);
-void CRYPT_SHA512Update(FX_LPVOID context, FX_LPCBYTE data, FX_DWORD size);
-void CRYPT_SHA512Finish(FX_LPVOID context, FX_BYTE digest[64]);
-void CRYPT_SHA512Generate(FX_LPCBYTE data, FX_DWORD size, FX_BYTE digest[64]);
-void CRYPT_SetPubKeyDecryptor(FX_BOOL (*func)(FX_LPCBYTE pData, FX_DWORD size, FX_LPBYTE data_buf, FX_DWORD& data_len));
-#ifdef __cplusplus
-};
-#endif
-#endif
+// 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 _FX_CRYPT_H_
+#define _FX_CRYPT_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+void CRYPT_ArcFourCryptBlock(FX_LPBYTE data, FX_DWORD size, FX_LPCBYTE key, FX_DWORD keylen);
+void CRYPT_ArcFourSetup(FX_LPVOID context, FX_LPCBYTE key, FX_DWORD length);
+void CRYPT_ArcFourCrypt(FX_LPVOID context, FX_LPBYTE data, FX_DWORD size);
+void CRYPT_AESSetKey(FX_LPVOID context, FX_DWORD blocklen, FX_LPCBYTE key, FX_DWORD keylen, FX_BOOL bEncrypt);
+void CRYPT_AESSetIV(FX_LPVOID context, FX_LPCBYTE iv);
+void CRYPT_AESDecrypt(FX_LPVOID context, FX_LPBYTE dest, FX_LPCBYTE src, FX_DWORD size);
+void CRYPT_AESEncrypt(FX_LPVOID context, FX_LPBYTE dest, FX_LPCBYTE src, FX_DWORD size);
+void CRYPT_MD5Generate(FX_LPCBYTE data, FX_DWORD size, FX_BYTE digest[16]);
+void CRYPT_MD5Start(FX_LPVOID context);
+void CRYPT_MD5Update(FX_LPVOID context, FX_LPCBYTE data, FX_DWORD size);
+void CRYPT_MD5Finish(FX_LPVOID context, FX_BYTE digest[16]);
+void CRYPT_SHA1Generate(FX_LPCBYTE data, FX_DWORD size, FX_BYTE digest[20]);
+void CRYPT_SHA1Start(FX_LPVOID context);
+void CRYPT_SHA1Update(FX_LPVOID context, FX_LPCBYTE data, FX_DWORD size);
+void CRYPT_SHA1Finish(FX_LPVOID context, FX_BYTE digest[20]);
+void CRYPT_SHA256Generate(FX_LPCBYTE data, FX_DWORD size, FX_BYTE digest[32]);
+void CRYPT_SHA256Start(FX_LPVOID context);
+void CRYPT_SHA256Update(FX_LPVOID context, FX_LPCBYTE data, FX_DWORD size);
+void CRYPT_SHA256Finish(FX_LPVOID context, FX_BYTE digest[32]);
+void CRYPT_SHA384Start(FX_LPVOID context);
+void CRYPT_SHA384Update(FX_LPVOID context, FX_LPCBYTE data, FX_DWORD size);
+void CRYPT_SHA384Finish(FX_LPVOID context, FX_BYTE digest[48]);
+void CRYPT_SHA384Generate(FX_LPCBYTE data, FX_DWORD size, FX_BYTE digest[48]);
+void CRYPT_SHA512Start(FX_LPVOID context);
+void CRYPT_SHA512Update(FX_LPVOID context, FX_LPCBYTE data, FX_DWORD size);
+void CRYPT_SHA512Finish(FX_LPVOID context, FX_BYTE digest[64]);
+void CRYPT_SHA512Generate(FX_LPCBYTE data, FX_DWORD size, FX_BYTE digest[64]);
+void CRYPT_SetPubKeyDecryptor(FX_BOOL (*func)(FX_LPCBYTE pData, FX_DWORD size, FX_LPBYTE data_buf, FX_DWORD& data_len));
+#ifdef __cplusplus
+};
+#endif
+#endif
diff --git a/core/include/fpdfapi/fpdf_module.h b/core/include/fpdfapi/fpdf_module.h
index bc11a96caf..8f0621a57b 100644
--- a/core/include/fpdfapi/fpdf_module.h
+++ b/core/include/fpdfapi/fpdf_module.h
@@ -1,205 +1,205 @@
-// 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 _FPDF_MODULE_
-#define _FPDF_MODULE_
-#ifndef _FXCRT_EXTENSION_
-#include "../fxcrt/fx_ext.h"
-#endif
-class CPDF_ModuleMgr;
-class CPDF_PageModuleDef;
-class CPDF_RenderModuleDef;
-class CPDF_SecurityHandler;
-class CCodec_ModuleMgr;
-class CPDF_Dictionary;
-class ICodec_JpegModule;
-class ICodec_JpxModule;
-class ICodec_FaxModule;
-class ICodec_Jbig2Module;
-class ICodec_IccModule;
-class ICodec_FlateModule;
-#define ADDIN_NAME_CJK "Eastern Asian Language Support"
-#define ADDIN_NAME_DECODER "JPEG2000 and JBIG2 Image Decoders"
-class CPDF_ModuleMgr : public CFX_Object
-{
-public:
-
- static void Create();
-
- static CPDF_ModuleMgr* Get();
-
- static void Destroy();
-
-
-
- void SetCodecModule(CCodec_ModuleMgr* pModule)
- {
- m_pCodecModule = pModule;
- }
- CCodec_ModuleMgr* GetCodecModule()
- {
- return m_pCodecModule;
- }
-
- void InitPageModule();
-
- void InitRenderModule();
-
-
- void SetModulePath(FX_LPCSTR module_name, FX_LPCSTR path);
-
- CFX_ByteString GetModuleFilePath(FX_LPCSTR module_name, FX_LPCSTR name);
-
- void SetDownloadCallback(FX_BOOL (*callback)(FX_LPCSTR module_name));
-
- FX_BOOL DownloadModule(FX_LPCSTR module_name);
-
- void NotifyModuleAvailable(FX_LPCSTR module_name);
-
-
-
- CPDF_RenderModuleDef* GetRenderModule() const
- {
- return m_pRenderModule;
- }
-
- CPDF_PageModuleDef* GetPageModule() const
- {
- return m_pPageModule;
- }
-
-
-
-
- void LoadEmbeddedGB1CMaps();
-
- void LoadEmbeddedCNS1CMaps();
-
- void LoadEmbeddedJapan1CMaps();
-
- void LoadEmbeddedKorea1CMaps();
-
- ICodec_FaxModule* GetFaxModule();
- ICodec_JpegModule* GetJpegModule();
- ICodec_JpxModule* GetJpxModule();
- ICodec_Jbig2Module* GetJbig2Module();
- ICodec_IccModule* GetIccModule();
- ICodec_FlateModule* GetFlateModule();
-
- void RegisterSecurityHandler(FX_LPCSTR name, CPDF_SecurityHandler * (*CreateHandler)(void* param), void* param);
-
- CPDF_SecurityHandler* CreateSecurityHandler(FX_LPCSTR name);
-
- void SetPrivateData(FX_LPVOID module_id, FX_LPVOID pData, PD_CALLBACK_FREEDATA callback);
-
- FX_LPVOID GetPrivateData(FX_LPVOID module_id);
-
- int m_FileBufSize;
-protected:
-
- CPDF_ModuleMgr();
-
- ~CPDF_ModuleMgr();
- void Initialize();
-
- void InitModules();
-
-
-
- CCodec_ModuleMgr* m_pCodecModule;
-
- CPDF_RenderModuleDef* m_pRenderModule;
-
- CPDF_PageModuleDef* m_pPageModule;
-
-
- FX_BOOL (*m_pDownloadCallback)(FX_LPCSTR module_name);
-
- CFX_ByteString m_DefaultModulePath;
-
- CFX_CMapByteStringToPtr m_ModulePathList;
-
- CFX_MapByteStringToPtr m_SecurityHandlerMap;
-
- CFX_PrivateData m_privateData;
-};
-class CPDF_Document;
-class CPDF_DocPageData;
-class CPDF_FontGlobals;
-class IPDF_FontMgr;
-class IPDF_FontMapper;
-class CPDF_ColorSpace;
-class CPDF_PageModuleDef : public CFX_Object
-{
-public:
- virtual ~CPDF_PageModuleDef() {}
-
- virtual CPDF_DocPageData* CreateDocData(CPDF_Document* pDoc)
- {
- return NULL;
- }
-
- virtual void ReleaseDoc(CPDF_Document*) {}
- virtual void ClearDoc(CPDF_Document*) {}
-
- virtual CPDF_FontGlobals* GetFontGlobals()
- {
- return NULL;
- }
-
- virtual void ClearStockFont(CPDF_Document* pDoc) {}
-
- virtual void NotifyCJKAvailable() {}
-
- virtual CPDF_ColorSpace* GetStockCS(int family)
- {
- return NULL;
- }
-};
-class CPDF_PageObjects;
-class CFX_AffineMatrix;
-class CPDF_RenderOptions;
-class CPDF_Page;
-class CPDF_DocRenderData;
-class CPDF_PageRenderCache;
-class CFX_BitmapDevice;
-class CPDF_Stream;
-class CFX_DIBSource;
-class CPDF_RenderConfig;
-class CPDF_Image;
-class CPDF_RenderModuleDef : public CFX_Object
-{
-public:
- virtual ~CPDF_RenderModuleDef() {}
-
- virtual CPDF_DocRenderData* CreateDocData(CPDF_Document* pDoc)
- {
- return NULL;
- }
-
- virtual void DestroyDocData(CPDF_DocRenderData*) {}
- virtual void ClearDocData(CPDF_DocRenderData*) {}
-
- virtual CPDF_DocRenderData* GetRenderData()
- {
- return NULL;
- }
-
- virtual CPDF_PageRenderCache* CreatePageCache(CPDF_Page* pPage)
- {
- return NULL;
- }
-
- virtual void DestroyPageCache(CPDF_PageRenderCache*) {}
-
- virtual void NotifyDecoderAvailable() {}
-
- virtual CPDF_RenderConfig* GetConfig()
- {
- return NULL;
- }
-};
-#endif
+// 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 _FPDF_MODULE_
+#define _FPDF_MODULE_
+#ifndef _FXCRT_EXTENSION_
+#include "../fxcrt/fx_ext.h"
+#endif
+class CPDF_ModuleMgr;
+class CPDF_PageModuleDef;
+class CPDF_RenderModuleDef;
+class CPDF_SecurityHandler;
+class CCodec_ModuleMgr;
+class CPDF_Dictionary;
+class ICodec_JpegModule;
+class ICodec_JpxModule;
+class ICodec_FaxModule;
+class ICodec_Jbig2Module;
+class ICodec_IccModule;
+class ICodec_FlateModule;
+#define ADDIN_NAME_CJK "Eastern Asian Language Support"
+#define ADDIN_NAME_DECODER "JPEG2000 and JBIG2 Image Decoders"
+class CPDF_ModuleMgr : public CFX_Object
+{
+public:
+
+ static void Create();
+
+ static CPDF_ModuleMgr* Get();
+
+ static void Destroy();
+
+
+
+ void SetCodecModule(CCodec_ModuleMgr* pModule)
+ {
+ m_pCodecModule = pModule;
+ }
+ CCodec_ModuleMgr* GetCodecModule()
+ {
+ return m_pCodecModule;
+ }
+
+ void InitPageModule();
+
+ void InitRenderModule();
+
+
+ void SetModulePath(FX_LPCSTR module_name, FX_LPCSTR path);
+
+ CFX_ByteString GetModuleFilePath(FX_LPCSTR module_name, FX_LPCSTR name);
+
+ void SetDownloadCallback(FX_BOOL (*callback)(FX_LPCSTR module_name));
+
+ FX_BOOL DownloadModule(FX_LPCSTR module_name);
+
+ void NotifyModuleAvailable(FX_LPCSTR module_name);
+
+
+
+ CPDF_RenderModuleDef* GetRenderModule() const
+ {
+ return m_pRenderModule;
+ }
+
+ CPDF_PageModuleDef* GetPageModule() const
+ {
+ return m_pPageModule;
+ }
+
+
+
+
+ void LoadEmbeddedGB1CMaps();
+
+ void LoadEmbeddedCNS1CMaps();
+
+ void LoadEmbeddedJapan1CMaps();
+
+ void LoadEmbeddedKorea1CMaps();
+
+ ICodec_FaxModule* GetFaxModule();
+ ICodec_JpegModule* GetJpegModule();
+ ICodec_JpxModule* GetJpxModule();
+ ICodec_Jbig2Module* GetJbig2Module();
+ ICodec_IccModule* GetIccModule();
+ ICodec_FlateModule* GetFlateModule();
+
+ void RegisterSecurityHandler(FX_LPCSTR name, CPDF_SecurityHandler * (*CreateHandler)(void* param), void* param);
+
+ CPDF_SecurityHandler* CreateSecurityHandler(FX_LPCSTR name);
+
+ void SetPrivateData(FX_LPVOID module_id, FX_LPVOID pData, PD_CALLBACK_FREEDATA callback);
+
+ FX_LPVOID GetPrivateData(FX_LPVOID module_id);
+
+ int m_FileBufSize;
+protected:
+
+ CPDF_ModuleMgr();
+
+ ~CPDF_ModuleMgr();
+ void Initialize();
+
+ void InitModules();
+
+
+
+ CCodec_ModuleMgr* m_pCodecModule;
+
+ CPDF_RenderModuleDef* m_pRenderModule;
+
+ CPDF_PageModuleDef* m_pPageModule;
+
+
+ FX_BOOL (*m_pDownloadCallback)(FX_LPCSTR module_name);
+
+ CFX_ByteString m_DefaultModulePath;
+
+ CFX_CMapByteStringToPtr m_ModulePathList;
+
+ CFX_MapByteStringToPtr m_SecurityHandlerMap;
+
+ CFX_PrivateData m_privateData;
+};
+class CPDF_Document;
+class CPDF_DocPageData;
+class CPDF_FontGlobals;
+class IPDF_FontMgr;
+class IPDF_FontMapper;
+class CPDF_ColorSpace;
+class CPDF_PageModuleDef : public CFX_Object
+{
+public:
+ virtual ~CPDF_PageModuleDef() {}
+
+ virtual CPDF_DocPageData* CreateDocData(CPDF_Document* pDoc)
+ {
+ return NULL;
+ }
+
+ virtual void ReleaseDoc(CPDF_Document*) {}
+ virtual void ClearDoc(CPDF_Document*) {}
+
+ virtual CPDF_FontGlobals* GetFontGlobals()
+ {
+ return NULL;
+ }
+
+ virtual void ClearStockFont(CPDF_Document* pDoc) {}
+
+ virtual void NotifyCJKAvailable() {}
+
+ virtual CPDF_ColorSpace* GetStockCS(int family)
+ {
+ return NULL;
+ }
+};
+class CPDF_PageObjects;
+class CFX_AffineMatrix;
+class CPDF_RenderOptions;
+class CPDF_Page;
+class CPDF_DocRenderData;
+class CPDF_PageRenderCache;
+class CFX_BitmapDevice;
+class CPDF_Stream;
+class CFX_DIBSource;
+class CPDF_RenderConfig;
+class CPDF_Image;
+class CPDF_RenderModuleDef : public CFX_Object
+{
+public:
+ virtual ~CPDF_RenderModuleDef() {}
+
+ virtual CPDF_DocRenderData* CreateDocData(CPDF_Document* pDoc)
+ {
+ return NULL;
+ }
+
+ virtual void DestroyDocData(CPDF_DocRenderData*) {}
+ virtual void ClearDocData(CPDF_DocRenderData*) {}
+
+ virtual CPDF_DocRenderData* GetRenderData()
+ {
+ return NULL;
+ }
+
+ virtual CPDF_PageRenderCache* CreatePageCache(CPDF_Page* pPage)
+ {
+ return NULL;
+ }
+
+ virtual void DestroyPageCache(CPDF_PageRenderCache*) {}
+
+ virtual void NotifyDecoderAvailable() {}
+
+ virtual CPDF_RenderConfig* GetConfig()
+ {
+ return NULL;
+ }
+};
+#endif
diff --git a/core/include/fpdfapi/fpdf_objects.h b/core/include/fpdfapi/fpdf_objects.h
index e67144b592..622f39d35f 100644
--- a/core/include/fpdfapi/fpdf_objects.h
+++ b/core/include/fpdfapi/fpdf_objects.h
@@ -1,785 +1,785 @@
-// 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 _FPDF_OBJECTS_
-#define _FPDF_OBJECTS_
-#ifndef _FXCRT_EXTENSION_
-#include "../fxcrt/fx_ext.h"
-#endif
-class CPDF_Document;
-class CPDF_IndirectObjects;
-class CPDF_Null;
-class CPDF_Boolean;
-class CPDF_Number;
-class CPDF_String;
-class CPDF_Stream;
-class CPDF_StreamAcc;
-class CPDF_StreamFilter;
-class CPDF_Array;
-class CPDF_Dictionary;
-class CPDF_Reference;
-class IPDF_DocParser;
-class IFX_FileRead;
-class CPDF_CryptoHandler;
-#define PDFOBJ_INVALID 0
-#define PDFOBJ_BOOLEAN 1
-#define PDFOBJ_NUMBER 2
-#define PDFOBJ_STRING 3
-#define PDFOBJ_NAME 4
-#define PDFOBJ_ARRAY 5
-#define PDFOBJ_DICTIONARY 6
-#define PDFOBJ_STREAM 7
-#define PDFOBJ_NULL 8
-#define PDFOBJ_REFERENCE 9
-typedef IFX_FileStream* (*FPDF_LPFCloneStreamCallback)(CPDF_Stream *pStream, FX_LPVOID pUserData);
-class CPDF_Object : public CFX_Object
-{
-public:
-
- int GetType() const
- {
- return m_Type;
- }
-
- FX_DWORD GetObjNum() const
- {
- return m_ObjNum;
- }
-
- FX_BOOL IsIdentical(CPDF_Object* pObj) const;
-
- CPDF_Object* Clone(FX_BOOL bDirect = FALSE) const;
-
- CPDF_Object* CloneRef(CPDF_IndirectObjects* pObjs) const;
-
- CPDF_Object* GetDirect() const;
-
- void Release();
-
- CFX_ByteString GetString() const;
-
- CFX_ByteStringC GetConstString() const;
-
- CFX_WideString GetUnicodeText(CFX_CharMap* pCharMap = NULL) const;
-
- FX_FLOAT GetNumber() const;
-
- FX_FLOAT GetNumber16() const;
-
- int GetInteger() const;
-
- CPDF_Dictionary* GetDict() const;
-
- CPDF_Array* GetArray() const;
-
- void SetString(const CFX_ByteString& str);
-
- void SetUnicodeText(FX_LPCWSTR pUnicodes, int len = -1);
-
- int GetDirectType() const;
-
- FX_BOOL IsModified() const
- {
- return FALSE;
- }
-protected:
- FX_DWORD m_Type;
- CPDF_Object()
- {
- m_ObjNum = 0;
- }
-
- FX_DWORD m_ObjNum;
-
- void Destroy();
-
-
- ~CPDF_Object() {}
- friend class CPDF_IndirectObjects;
- friend class CPDF_Parser;
- friend class CPDF_SyntaxParser;
-private:
- CPDF_Object(const CPDF_Object& src) {}
- CPDF_Object* CloneInternal(FX_BOOL bDirect, CFX_MapPtrToPtr* visited) const;
-};
-class CPDF_Boolean : public CPDF_Object
-{
-public:
-
- static CPDF_Boolean* Create(FX_BOOL value)
- {
- return FX_NEW CPDF_Boolean(value);
- }
-
- CPDF_Boolean()
- {
- m_Type = PDFOBJ_BOOLEAN;
- }
-
- CPDF_Boolean(FX_BOOL value)
- {
- m_Type = PDFOBJ_BOOLEAN;
- m_bValue = value;
- }
-
- FX_BOOL Identical(CPDF_Boolean* pOther) const
- {
- return m_bValue == pOther->m_bValue;
- }
-protected:
-
- FX_BOOL m_bValue;
- friend class CPDF_Object;
-};
-class CPDF_Number : public CPDF_Object
-{
-public:
-
- static CPDF_Number* Create(int value)
- {
- return FX_NEW CPDF_Number(value);
- }
-
- static CPDF_Number* Create(FX_FLOAT value)
- {
- return FX_NEW CPDF_Number(value);
- }
-
- static CPDF_Number* Create(FX_BSTR str)
- {
- return FX_NEW CPDF_Number(str);
- }
-
- static CPDF_Number* Create(FX_BOOL bInteger, void* pData)
- {
- return FX_NEW CPDF_Number(bInteger, pData);
- }
-
- CPDF_Number()
- {
- m_Type = PDFOBJ_NUMBER;
- }
-
- CPDF_Number(FX_BOOL bInteger, void* pData);
-
- CPDF_Number(int value);
-
- CPDF_Number(FX_FLOAT value);
-
- CPDF_Number(FX_BSTR str);
-
- FX_BOOL Identical(CPDF_Number* pOther) const;
-
- CFX_ByteString GetString() const;
-
- void SetString(FX_BSTR str);
-
- FX_BOOL IsInteger() const
- {
- return m_bInteger;
- }
-
- int GetInteger() const
- {
- return m_bInteger ? m_Integer : (int)m_Float;
- }
-
- FX_FLOAT GetNumber() const
- {
- return m_bInteger ? (FX_FLOAT)m_Integer : m_Float;
- }
-
- void SetNumber(FX_FLOAT value);
-
- FX_FLOAT GetNumber16() const
- {
- return GetNumber();
- }
-
- FX_FLOAT GetFloat() const
- {
- return m_bInteger ? (FX_FLOAT)m_Integer : m_Float;
- }
-protected:
-
- FX_BOOL m_bInteger;
-
- union {
-
- int m_Integer;
-
- FX_FLOAT m_Float;
- };
- friend class CPDF_Object;
-};
-class CPDF_String : public CPDF_Object
-{
-public:
-
- static CPDF_String* Create(const CFX_ByteString& str, FX_BOOL bHex = FALSE)
- {
- return FX_NEW CPDF_String(str, bHex);
- }
-
- static CPDF_String* Create(const CFX_WideString& str)
- {
- return FX_NEW CPDF_String(str);
- }
-
- CPDF_String()
- {
- m_Type = PDFOBJ_STRING;
- m_bHex = FALSE;
- }
-
- CPDF_String(const CFX_ByteString& str, FX_BOOL bHex = FALSE) : m_String(str)
- {
- m_Type = PDFOBJ_STRING;
- m_bHex = bHex;
- }
-
- CPDF_String(const CFX_WideString& str);
-
- CFX_ByteString& GetString()
- {
- return m_String;
- }
-
- FX_BOOL Identical(CPDF_String* pOther) const
- {
- return m_String == pOther->m_String;
- }
-
- FX_BOOL IsHex() const
- {
- return m_bHex;
- }
-protected:
-
- CFX_ByteString m_String;
-
- FX_BOOL m_bHex;
- friend class CPDF_Object;
-};
-class CPDF_Name : public CPDF_Object
-{
-public:
-
- static CPDF_Name* Create(const CFX_ByteString& str)
- {
- return FX_NEW CPDF_Name(str);
- }
-
- static CPDF_Name* Create(FX_BSTR str)
- {
- return FX_NEW CPDF_Name(str);
- }
-
- static CPDF_Name* Create(FX_LPCSTR str)
- {
- return FX_NEW CPDF_Name(str);
- }
-
- CPDF_Name(const CFX_ByteString& str) : m_Name(str)
- {
- m_Type = PDFOBJ_NAME;
- }
-
- CPDF_Name(FX_BSTR str) : m_Name(str)
- {
- m_Type = PDFOBJ_NAME;
- }
-
- CPDF_Name(FX_LPCSTR str) : m_Name(str)
- {
- m_Type = PDFOBJ_NAME;
- }
-
- CFX_ByteString& GetString()
- {
- return m_Name;
- }
-
- FX_BOOL Identical(CPDF_Name* pOther) const
- {
- return m_Name == pOther->m_Name;
- }
-protected:
-
- CFX_ByteString m_Name;
- friend class CPDF_Object;
-};
-class CPDF_Array : public CPDF_Object
-{
-public:
-
- static CPDF_Array* Create()
- {
- return FX_NEW CPDF_Array();
- }
-
- CPDF_Array()
- {
- m_Type = PDFOBJ_ARRAY;
- }
-
- FX_DWORD GetCount() const
- {
- return m_Objects.GetSize();
- }
-
- CPDF_Object* GetElement(FX_DWORD index) const;
-
- CPDF_Object* GetElementValue(FX_DWORD index) const;
-
-
-
- CFX_AffineMatrix GetMatrix();
-
- CFX_FloatRect GetRect();
-
-
-
-
- CFX_ByteString GetString(FX_DWORD index) const;
-
- CFX_ByteStringC GetConstString(FX_DWORD index) const;
-
- int GetInteger(FX_DWORD index) const;
-
- FX_FLOAT GetNumber(FX_DWORD index) const;
-
- CPDF_Dictionary* GetDict(FX_DWORD index) const;
-
- CPDF_Stream* GetStream(FX_DWORD index) const;
-
- CPDF_Array* GetArray(FX_DWORD index) const;
-
- FX_FLOAT GetFloat(FX_DWORD index) const
- {
- return GetNumber(index);
- }
-
-
-
-
- void SetAt(FX_DWORD index, CPDF_Object* pObj, CPDF_IndirectObjects* pObjs = NULL);
-
-
- void InsertAt(FX_DWORD index, CPDF_Object* pObj, CPDF_IndirectObjects* pObjs = NULL);
-
- void RemoveAt(FX_DWORD index);
-
-
- void Add(CPDF_Object* pObj, CPDF_IndirectObjects* pObjs = NULL);
-
-
-
- void AddNumber(FX_FLOAT f);
-
- void AddInteger(int i);
-
- void AddString(const CFX_ByteString& str);
-
- void AddName(const CFX_ByteString& str);
-
- void AddReference(CPDF_IndirectObjects* pDoc, FX_DWORD objnum);
-
- void AddReference(CPDF_IndirectObjects* pDoc, CPDF_Object* obj)
- {
- AddReference(pDoc, obj->GetObjNum());
- }
-
-
- FX_FLOAT GetNumber16(FX_DWORD index) const
- {
- return GetNumber(index);
- }
-
- void AddNumber16(FX_FLOAT value)
- {
- AddNumber(value);
- }
-
- FX_BOOL Identical(CPDF_Array* pOther) const;
-protected:
-
- ~CPDF_Array();
-
- CFX_PtrArray m_Objects;
- friend class CPDF_Object;
-};
-class CPDF_Dictionary : public CPDF_Object
-{
-public:
-
- static CPDF_Dictionary* Create()
- {
- return FX_NEW CPDF_Dictionary();
- }
-
- CPDF_Dictionary()
- {
- m_Type = PDFOBJ_DICTIONARY;
- }
-
-
-
- CPDF_Object* GetElement(FX_BSTR key) const;
-
- CPDF_Object* GetElementValue(FX_BSTR key) const;
-
-
-
-
-
- CFX_ByteString GetString(FX_BSTR key) const;
-
- CFX_ByteStringC GetConstString(FX_BSTR key) const;
-
- CFX_ByteString GetString(FX_BSTR key, FX_BSTR default_str) const;
-
- CFX_ByteStringC GetConstString(FX_BSTR key, FX_BSTR default_str) const;
-
- CFX_WideString GetUnicodeText(FX_BSTR key, CFX_CharMap* pCharMap = NULL) const;
-
- int GetInteger(FX_BSTR key) const;
-
- int GetInteger(FX_BSTR key, int default_int) const;
-
- FX_BOOL GetBoolean(FX_BSTR key, FX_BOOL bDefault = FALSE) const;
-
- FX_FLOAT GetNumber(FX_BSTR key) const;
-
- CPDF_Dictionary* GetDict(FX_BSTR key) const;
-
- CPDF_Stream* GetStream(FX_BSTR key) const;
-
- CPDF_Array* GetArray(FX_BSTR key) const;
-
- CFX_FloatRect GetRect(FX_BSTR key) const;
-
- CFX_AffineMatrix GetMatrix(FX_BSTR key) const;
-
- FX_FLOAT GetFloat(FX_BSTR key) const
- {
- return GetNumber(key);
- }
-
-
- FX_BOOL KeyExist(FX_BSTR key) const;
-
- FX_POSITION GetStartPos() const;
-
- CPDF_Object* GetNextElement(FX_POSITION& pos, CFX_ByteString& key) const;
-
- void SetAt(FX_BSTR key, CPDF_Object* pObj, CPDF_IndirectObjects* pObjs = NULL);
-
-
-
- void SetAtName(FX_BSTR key, const CFX_ByteString& name);
-
-
- void SetAtString(FX_BSTR key, const CFX_ByteString& string);
-
-
- void SetAtInteger(FX_BSTR key, int i);
-
-
- void SetAtNumber(FX_BSTR key, FX_FLOAT f);
-
- void SetAtReference(FX_BSTR key, CPDF_IndirectObjects* pDoc, FX_DWORD objnum);
-
- void SetAtReference(FX_BSTR key, CPDF_IndirectObjects* pDoc, CPDF_Object* obj)
- {
- SetAtReference(key, pDoc, obj->GetObjNum());
- }
-
- void AddReference(FX_BSTR key, CPDF_IndirectObjects* pDoc, FX_DWORD objnum);
-
- void AddReference(FX_BSTR key, CPDF_IndirectObjects* pDoc, CPDF_Object* obj)
- {
- AddReference(key, pDoc, obj->GetObjNum());
- }
-
- void SetAtRect(FX_BSTR key, const CFX_FloatRect& rect);
-
- void SetAtMatrix(FX_BSTR key, const CFX_AffineMatrix& matrix);
-
- void SetAtBoolean(FX_BSTR key, FX_BOOL bValue);
-
-
-
- void RemoveAt(FX_BSTR key);
-
-
- void ReplaceKey(FX_BSTR oldkey, FX_BSTR newkey);
-
- FX_BOOL Identical(CPDF_Dictionary* pDict) const;
-
- int GetCount() const
- {
- return m_Map.GetCount();
- }
-
- void AddValue(FX_BSTR key, CPDF_Object* pObj);
-protected:
-
- ~CPDF_Dictionary();
-
- CFX_CMapByteStringToPtr m_Map;
-
- friend class CPDF_Object;
-};
-class CPDF_Stream : public CPDF_Object
-{
-public:
-
- static CPDF_Stream* Create(FX_LPBYTE pData, FX_DWORD size, CPDF_Dictionary* pDict)
- {
- return FX_NEW CPDF_Stream(pData, size, pDict);
- }
-
- CPDF_Stream(FX_LPBYTE pData, FX_DWORD size, CPDF_Dictionary* pDict);
-
- CPDF_Dictionary* GetDict() const
- {
- return m_pDict;
- }
-
- void SetData(FX_LPCBYTE pData, FX_DWORD size, FX_BOOL bCompressed, FX_BOOL bKeepBuf);
-
- void InitStream(FX_BYTE* pData, FX_DWORD size, CPDF_Dictionary* pDict);
-
- void InitStream(IFX_FileRead *pFile, CPDF_Dictionary* pDict);
-
- FX_BOOL Identical(CPDF_Stream* pOther) const;
-
- CPDF_StreamFilter* GetStreamFilter(FX_BOOL bRaw = FALSE) const;
-
-
-
- FX_DWORD GetRawSize() const
- {
- return m_dwSize;
- }
-
- FX_BOOL ReadRawData(FX_FILESIZE start_pos, FX_LPBYTE pBuf, FX_DWORD buf_size) const;
-
-
- FX_BOOL IsMemoryBased() const
- {
- return m_GenNum == (FX_DWORD) - 1;
- }
-
- CPDF_Stream* Clone(FX_BOOL bDirect, FPDF_LPFCloneStreamCallback lpfCallback, FX_LPVOID pUserData) const;
-protected:
-
- ~CPDF_Stream();
-
- CPDF_Dictionary* m_pDict;
-
- FX_DWORD m_dwSize;
-
- FX_DWORD m_GenNum;
-
- union {
-
- FX_LPBYTE m_pDataBuf;
-
- IFX_FileRead* m_pFile;
- };
-
- FX_FILESIZE m_FileOffset;
-
- CPDF_CryptoHandler* m_pCryptoHandler;
-
- void InitStream(CPDF_Dictionary* pDict);
- friend class CPDF_Object;
- friend class CPDF_StreamAcc;
- friend class CPDF_AttachmentAcc;
-};
-class CPDF_StreamAcc : public CFX_Object
-{
-public:
-
- CPDF_StreamAcc();
-
- ~CPDF_StreamAcc();
-
- void LoadAllData(const CPDF_Stream* pStream, FX_BOOL bRawAccess = FALSE,
- FX_DWORD estimated_size = 0, FX_BOOL bImageAcc = FALSE);
-
- const CPDF_Stream* GetStream() const
- {
- return m_pStream;
- }
-
- CPDF_Dictionary* GetDict() const
- {
- return m_pStream->GetDict();
- }
-
- FX_LPCBYTE GetData() const;
-
- FX_DWORD GetSize() const;
-
- FX_LPBYTE DetachData();
-
- const CFX_ByteString& GetImageDecoder()
- {
- return m_ImageDecoder;
- }
-
- const CPDF_Dictionary* GetImageParam()
- {
- return m_pImageParam;
- }
-protected:
-
- FX_LPBYTE m_pData;
-
- FX_DWORD m_dwSize;
-
- FX_BOOL m_bNewBuf;
-
- CFX_ByteString m_ImageDecoder;
-
- CPDF_Dictionary* m_pImageParam;
-
- const CPDF_Stream* m_pStream;
-
- FX_LPBYTE m_pSrcData;
-};
-CFX_DataFilter* FPDF_CreateFilter(FX_BSTR name, const CPDF_Dictionary* pParam, int width = 0, int height = 0);
-#define FPDF_FILTER_BUFFER_SIZE 20480
-class CPDF_StreamFilter : public CFX_Object
-{
-public:
-
- ~CPDF_StreamFilter();
-
- FX_DWORD ReadBlock(FX_LPBYTE buffer, FX_DWORD size);
-
- FX_DWORD GetSrcPos()
- {
- return m_SrcOffset;
- }
-
- const CPDF_Stream* GetStream()
- {
- return m_pStream;
- }
-protected:
-
- CPDF_StreamFilter() {}
-
- FX_DWORD ReadLeftOver(FX_LPBYTE buffer, FX_DWORD buf_size);
-
- const CPDF_Stream* m_pStream;
-
- CFX_DataFilter* m_pFilter;
-
- CFX_BinaryBuf* m_pBuffer;
-
- FX_DWORD m_BufOffset;
-
- FX_DWORD m_SrcOffset;
-
- FX_BYTE m_SrcBuffer[FPDF_FILTER_BUFFER_SIZE];
- friend class CPDF_Stream;
-};
-class CPDF_Null : public CPDF_Object
-{
-public:
-
- static CPDF_Null* Create()
- {
- return FX_NEW CPDF_Null();
- }
-
- CPDF_Null()
- {
- m_Type = PDFOBJ_NULL;
- }
-};
-class CPDF_Reference : public CPDF_Object
-{
-public:
-
- static CPDF_Reference* Create(CPDF_IndirectObjects* pDoc, int objnum)
- {
- return FX_NEW CPDF_Reference(pDoc, objnum);
- }
-
- CPDF_Reference(CPDF_IndirectObjects* pDoc, int objnum)
- {
- m_Type = PDFOBJ_REFERENCE;
- m_pObjList = pDoc;
- m_RefObjNum = objnum;
- }
-
- CPDF_IndirectObjects* GetObjList() const
- {
- return m_pObjList;
- }
-
- FX_DWORD GetRefObjNum() const
- {
- return m_RefObjNum;
- }
-
- void SetRef(CPDF_IndirectObjects* pDoc, FX_DWORD objnum);
-
- FX_BOOL Identical(CPDF_Reference* pOther) const
- {
- return m_RefObjNum == pOther->m_RefObjNum;
- }
-protected:
-
- CPDF_IndirectObjects* m_pObjList;
-
- FX_DWORD m_RefObjNum;
- friend class CPDF_Object;
-};
-class CPDF_IndirectObjects : public CFX_Object
-{
-public:
-
- CPDF_IndirectObjects(IPDF_DocParser* pParser);
-
- ~CPDF_IndirectObjects();
-
- CPDF_Object* GetIndirectObject(FX_DWORD objnum, struct PARSE_CONTEXT* pContext = NULL);
-
- int GetIndirectType(FX_DWORD objnum);
-
- FX_DWORD AddIndirectObject(CPDF_Object* pObj);
-
- void ReleaseIndirectObject(FX_DWORD objnum);
-
- void InsertIndirectObject(FX_DWORD objnum, CPDF_Object* pObj);
-
- FX_DWORD GetLastObjNum() const;
-
- FX_POSITION GetStartPosition() const
- {
- return m_IndirectObjs.GetStartPosition();
- }
-
- void GetNextAssoc(FX_POSITION& rPos, FX_DWORD& objnum, CPDF_Object*& pObject) const
- {
- m_IndirectObjs.GetNextAssoc(rPos, (void*&)objnum, (void*&)pObject);
- }
-protected:
-
- CFX_MapPtrToPtr m_IndirectObjs;
-
- IPDF_DocParser* m_pParser;
-
- FX_DWORD m_LastObjNum;
-};
-#endif
+// 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 _FPDF_OBJECTS_
+#define _FPDF_OBJECTS_
+#ifndef _FXCRT_EXTENSION_
+#include "../fxcrt/fx_ext.h"
+#endif
+class CPDF_Document;
+class CPDF_IndirectObjects;
+class CPDF_Null;
+class CPDF_Boolean;
+class CPDF_Number;
+class CPDF_String;
+class CPDF_Stream;
+class CPDF_StreamAcc;
+class CPDF_StreamFilter;
+class CPDF_Array;
+class CPDF_Dictionary;
+class CPDF_Reference;
+class IPDF_DocParser;
+class IFX_FileRead;
+class CPDF_CryptoHandler;
+#define PDFOBJ_INVALID 0
+#define PDFOBJ_BOOLEAN 1
+#define PDFOBJ_NUMBER 2
+#define PDFOBJ_STRING 3
+#define PDFOBJ_NAME 4
+#define PDFOBJ_ARRAY 5
+#define PDFOBJ_DICTIONARY 6
+#define PDFOBJ_STREAM 7
+#define PDFOBJ_NULL 8
+#define PDFOBJ_REFERENCE 9
+typedef IFX_FileStream* (*FPDF_LPFCloneStreamCallback)(CPDF_Stream *pStream, FX_LPVOID pUserData);
+class CPDF_Object : public CFX_Object
+{
+public:
+
+ int GetType() const
+ {
+ return m_Type;
+ }
+
+ FX_DWORD GetObjNum() const
+ {
+ return m_ObjNum;
+ }
+
+ FX_BOOL IsIdentical(CPDF_Object* pObj) const;
+
+ CPDF_Object* Clone(FX_BOOL bDirect = FALSE) const;
+
+ CPDF_Object* CloneRef(CPDF_IndirectObjects* pObjs) const;
+
+ CPDF_Object* GetDirect() const;
+
+ void Release();
+
+ CFX_ByteString GetString() const;
+
+ CFX_ByteStringC GetConstString() const;
+
+ CFX_WideString GetUnicodeText(CFX_CharMap* pCharMap = NULL) const;
+
+ FX_FLOAT GetNumber() const;
+
+ FX_FLOAT GetNumber16() const;
+
+ int GetInteger() const;
+
+ CPDF_Dictionary* GetDict() const;
+
+ CPDF_Array* GetArray() const;
+
+ void SetString(const CFX_ByteString& str);
+
+ void SetUnicodeText(FX_LPCWSTR pUnicodes, int len = -1);
+
+ int GetDirectType() const;
+
+ FX_BOOL IsModified() const
+ {
+ return FALSE;
+ }
+protected:
+ FX_DWORD m_Type;
+ CPDF_Object()
+ {
+ m_ObjNum = 0;
+ }
+
+ FX_DWORD m_ObjNum;
+
+ void Destroy();
+
+
+ ~CPDF_Object() {}
+ friend class CPDF_IndirectObjects;
+ friend class CPDF_Parser;
+ friend class CPDF_SyntaxParser;
+private:
+ CPDF_Object(const CPDF_Object& src) {}
+ CPDF_Object* CloneInternal(FX_BOOL bDirect, CFX_MapPtrToPtr* visited) const;
+};
+class CPDF_Boolean : public CPDF_Object
+{
+public:
+
+ static CPDF_Boolean* Create(FX_BOOL value)
+ {
+ return FX_NEW CPDF_Boolean(value);
+ }
+
+ CPDF_Boolean()
+ {
+ m_Type = PDFOBJ_BOOLEAN;
+ }
+
+ CPDF_Boolean(FX_BOOL value)
+ {
+ m_Type = PDFOBJ_BOOLEAN;
+ m_bValue = value;
+ }
+
+ FX_BOOL Identical(CPDF_Boolean* pOther) const
+ {
+ return m_bValue == pOther->m_bValue;
+ }
+protected:
+
+ FX_BOOL m_bValue;
+ friend class CPDF_Object;
+};
+class CPDF_Number : public CPDF_Object
+{
+public:
+
+ static CPDF_Number* Create(int value)
+ {
+ return FX_NEW CPDF_Number(value);
+ }
+
+ static CPDF_Number* Create(FX_FLOAT value)
+ {
+ return FX_NEW CPDF_Number(value);
+ }
+
+ static CPDF_Number* Create(FX_BSTR str)
+ {
+ return FX_NEW CPDF_Number(str);
+ }
+
+ static CPDF_Number* Create(FX_BOOL bInteger, void* pData)
+ {
+ return FX_NEW CPDF_Number(bInteger, pData);
+ }
+
+ CPDF_Number()
+ {
+ m_Type = PDFOBJ_NUMBER;
+ }
+
+ CPDF_Number(FX_BOOL bInteger, void* pData);
+
+ CPDF_Number(int value);
+
+ CPDF_Number(FX_FLOAT value);
+
+ CPDF_Number(FX_BSTR str);
+
+ FX_BOOL Identical(CPDF_Number* pOther) const;
+
+ CFX_ByteString GetString() const;
+
+ void SetString(FX_BSTR str);
+
+ FX_BOOL IsInteger() const
+ {
+ return m_bInteger;
+ }
+
+ int GetInteger() const
+ {
+ return m_bInteger ? m_Integer : (int)m_Float;
+ }
+
+ FX_FLOAT GetNumber() const
+ {
+ return m_bInteger ? (FX_FLOAT)m_Integer : m_Float;
+ }
+
+ void SetNumber(FX_FLOAT value);
+
+ FX_FLOAT GetNumber16() const
+ {
+ return GetNumber();
+ }
+
+ FX_FLOAT GetFloat() const
+ {
+ return m_bInteger ? (FX_FLOAT)m_Integer : m_Float;
+ }
+protected:
+
+ FX_BOOL m_bInteger;
+
+ union {
+
+ int m_Integer;
+
+ FX_FLOAT m_Float;
+ };
+ friend class CPDF_Object;
+};
+class CPDF_String : public CPDF_Object
+{
+public:
+
+ static CPDF_String* Create(const CFX_ByteString& str, FX_BOOL bHex = FALSE)
+ {
+ return FX_NEW CPDF_String(str, bHex);
+ }
+
+ static CPDF_String* Create(const CFX_WideString& str)
+ {
+ return FX_NEW CPDF_String(str);
+ }
+
+ CPDF_String()
+ {
+ m_Type = PDFOBJ_STRING;
+ m_bHex = FALSE;
+ }
+
+ CPDF_String(const CFX_ByteString& str, FX_BOOL bHex = FALSE) : m_String(str)
+ {
+ m_Type = PDFOBJ_STRING;
+ m_bHex = bHex;
+ }
+
+ CPDF_String(const CFX_WideString& str);
+
+ CFX_ByteString& GetString()
+ {
+ return m_String;
+ }
+
+ FX_BOOL Identical(CPDF_String* pOther) const
+ {
+ return m_String == pOther->m_String;
+ }
+
+ FX_BOOL IsHex() const
+ {
+ return m_bHex;
+ }
+protected:
+
+ CFX_ByteString m_String;
+
+ FX_BOOL m_bHex;
+ friend class CPDF_Object;
+};
+class CPDF_Name : public CPDF_Object
+{
+public:
+
+ static CPDF_Name* Create(const CFX_ByteString& str)
+ {
+ return FX_NEW CPDF_Name(str);
+ }
+
+ static CPDF_Name* Create(FX_BSTR str)
+ {
+ return FX_NEW CPDF_Name(str);
+ }
+
+ static CPDF_Name* Create(FX_LPCSTR str)
+ {
+ return FX_NEW CPDF_Name(str);
+ }
+
+ CPDF_Name(const CFX_ByteString& str) : m_Name(str)
+ {
+ m_Type = PDFOBJ_NAME;
+ }
+
+ CPDF_Name(FX_BSTR str) : m_Name(str)
+ {
+ m_Type = PDFOBJ_NAME;
+ }
+
+ CPDF_Name(FX_LPCSTR str) : m_Name(str)
+ {
+ m_Type = PDFOBJ_NAME;
+ }
+
+ CFX_ByteString& GetString()
+ {
+ return m_Name;
+ }
+
+ FX_BOOL Identical(CPDF_Name* pOther) const
+ {
+ return m_Name == pOther->m_Name;
+ }
+protected:
+
+ CFX_ByteString m_Name;
+ friend class CPDF_Object;
+};
+class CPDF_Array : public CPDF_Object
+{
+public:
+
+ static CPDF_Array* Create()
+ {
+ return FX_NEW CPDF_Array();
+ }
+
+ CPDF_Array()
+ {
+ m_Type = PDFOBJ_ARRAY;
+ }
+
+ FX_DWORD GetCount() const
+ {
+ return m_Objects.GetSize();
+ }
+
+ CPDF_Object* GetElement(FX_DWORD index) const;
+
+ CPDF_Object* GetElementValue(FX_DWORD index) const;
+
+
+
+ CFX_AffineMatrix GetMatrix();
+
+ CFX_FloatRect GetRect();
+
+
+
+
+ CFX_ByteString GetString(FX_DWORD index) const;
+
+ CFX_ByteStringC GetConstString(FX_DWORD index) const;
+
+ int GetInteger(FX_DWORD index) const;
+
+ FX_FLOAT GetNumber(FX_DWORD index) const;
+
+ CPDF_Dictionary* GetDict(FX_DWORD index) const;
+
+ CPDF_Stream* GetStream(FX_DWORD index) const;
+
+ CPDF_Array* GetArray(FX_DWORD index) const;
+
+ FX_FLOAT GetFloat(FX_DWORD index) const
+ {
+ return GetNumber(index);
+ }
+
+
+
+
+ void SetAt(FX_DWORD index, CPDF_Object* pObj, CPDF_IndirectObjects* pObjs = NULL);
+
+
+ void InsertAt(FX_DWORD index, CPDF_Object* pObj, CPDF_IndirectObjects* pObjs = NULL);
+
+ void RemoveAt(FX_DWORD index);
+
+
+ void Add(CPDF_Object* pObj, CPDF_IndirectObjects* pObjs = NULL);
+
+
+
+ void AddNumber(FX_FLOAT f);
+
+ void AddInteger(int i);
+
+ void AddString(const CFX_ByteString& str);
+
+ void AddName(const CFX_ByteString& str);
+
+ void AddReference(CPDF_IndirectObjects* pDoc, FX_DWORD objnum);
+
+ void AddReference(CPDF_IndirectObjects* pDoc, CPDF_Object* obj)
+ {
+ AddReference(pDoc, obj->GetObjNum());
+ }
+
+
+ FX_FLOAT GetNumber16(FX_DWORD index) const
+ {
+ return GetNumber(index);
+ }
+
+ void AddNumber16(FX_FLOAT value)
+ {
+ AddNumber(value);
+ }
+
+ FX_BOOL Identical(CPDF_Array* pOther) const;
+protected:
+
+ ~CPDF_Array();
+
+ CFX_PtrArray m_Objects;
+ friend class CPDF_Object;
+};
+class CPDF_Dictionary : public CPDF_Object
+{
+public:
+
+ static CPDF_Dictionary* Create()
+ {
+ return FX_NEW CPDF_Dictionary();
+ }
+
+ CPDF_Dictionary()
+ {
+ m_Type = PDFOBJ_DICTIONARY;
+ }
+
+
+
+ CPDF_Object* GetElement(FX_BSTR key) const;
+
+ CPDF_Object* GetElementValue(FX_BSTR key) const;
+
+
+
+
+
+ CFX_ByteString GetString(FX_BSTR key) const;
+
+ CFX_ByteStringC GetConstString(FX_BSTR key) const;
+
+ CFX_ByteString GetString(FX_BSTR key, FX_BSTR default_str) const;
+
+ CFX_ByteStringC GetConstString(FX_BSTR key, FX_BSTR default_str) const;
+
+ CFX_WideString GetUnicodeText(FX_BSTR key, CFX_CharMap* pCharMap = NULL) const;
+
+ int GetInteger(FX_BSTR key) const;
+
+ int GetInteger(FX_BSTR key, int default_int) const;
+
+ FX_BOOL GetBoolean(FX_BSTR key, FX_BOOL bDefault = FALSE) const;
+
+ FX_FLOAT GetNumber(FX_BSTR key) const;
+
+ CPDF_Dictionary* GetDict(FX_BSTR key) const;
+
+ CPDF_Stream* GetStream(FX_BSTR key) const;
+
+ CPDF_Array* GetArray(FX_BSTR key) const;
+
+ CFX_FloatRect GetRect(FX_BSTR key) const;
+
+ CFX_AffineMatrix GetMatrix(FX_BSTR key) const;
+
+ FX_FLOAT GetFloat(FX_BSTR key) const
+ {
+ return GetNumber(key);
+ }
+
+
+ FX_BOOL KeyExist(FX_BSTR key) const;
+
+ FX_POSITION GetStartPos() const;
+
+ CPDF_Object* GetNextElement(FX_POSITION& pos, CFX_ByteString& key) const;
+
+ void SetAt(FX_BSTR key, CPDF_Object* pObj, CPDF_IndirectObjects* pObjs = NULL);
+
+
+
+ void SetAtName(FX_BSTR key, const CFX_ByteString& name);
+
+
+ void SetAtString(FX_BSTR key, const CFX_ByteString& string);
+
+
+ void SetAtInteger(FX_BSTR key, int i);
+
+
+ void SetAtNumber(FX_BSTR key, FX_FLOAT f);
+
+ void SetAtReference(FX_BSTR key, CPDF_IndirectObjects* pDoc, FX_DWORD objnum);
+
+ void SetAtReference(FX_BSTR key, CPDF_IndirectObjects* pDoc, CPDF_Object* obj)
+ {
+ SetAtReference(key, pDoc, obj->GetObjNum());
+ }
+
+ void AddReference(FX_BSTR key, CPDF_IndirectObjects* pDoc, FX_DWORD objnum);
+
+ void AddReference(FX_BSTR key, CPDF_IndirectObjects* pDoc, CPDF_Object* obj)
+ {
+ AddReference(key, pDoc, obj->GetObjNum());
+ }
+
+ void SetAtRect(FX_BSTR key, const CFX_FloatRect& rect);
+
+ void SetAtMatrix(FX_BSTR key, const CFX_AffineMatrix& matrix);
+
+ void SetAtBoolean(FX_BSTR key, FX_BOOL bValue);
+
+
+
+ void RemoveAt(FX_BSTR key);
+
+
+ void ReplaceKey(FX_BSTR oldkey, FX_BSTR newkey);
+
+ FX_BOOL Identical(CPDF_Dictionary* pDict) const;
+
+ int GetCount() const
+ {
+ return m_Map.GetCount();
+ }
+
+ void AddValue(FX_BSTR key, CPDF_Object* pObj);
+protected:
+
+ ~CPDF_Dictionary();
+
+ CFX_CMapByteStringToPtr m_Map;
+
+ friend class CPDF_Object;
+};
+class CPDF_Stream : public CPDF_Object
+{
+public:
+
+ static CPDF_Stream* Create(FX_LPBYTE pData, FX_DWORD size, CPDF_Dictionary* pDict)
+ {
+ return FX_NEW CPDF_Stream(pData, size, pDict);
+ }
+
+ CPDF_Stream(FX_LPBYTE pData, FX_DWORD size, CPDF_Dictionary* pDict);
+
+ CPDF_Dictionary* GetDict() const
+ {
+ return m_pDict;
+ }
+
+ void SetData(FX_LPCBYTE pData, FX_DWORD size, FX_BOOL bCompressed, FX_BOOL bKeepBuf);
+
+ void InitStream(FX_BYTE* pData, FX_DWORD size, CPDF_Dictionary* pDict);
+
+ void InitStream(IFX_FileRead *pFile, CPDF_Dictionary* pDict);
+
+ FX_BOOL Identical(CPDF_Stream* pOther) const;
+
+ CPDF_StreamFilter* GetStreamFilter(FX_BOOL bRaw = FALSE) const;
+
+
+
+ FX_DWORD GetRawSize() const
+ {
+ return m_dwSize;
+ }
+
+ FX_BOOL ReadRawData(FX_FILESIZE start_pos, FX_LPBYTE pBuf, FX_DWORD buf_size) const;
+
+
+ FX_BOOL IsMemoryBased() const
+ {
+ return m_GenNum == (FX_DWORD) - 1;
+ }
+
+ CPDF_Stream* Clone(FX_BOOL bDirect, FPDF_LPFCloneStreamCallback lpfCallback, FX_LPVOID pUserData) const;
+protected:
+
+ ~CPDF_Stream();
+
+ CPDF_Dictionary* m_pDict;
+
+ FX_DWORD m_dwSize;
+
+ FX_DWORD m_GenNum;
+
+ union {
+
+ FX_LPBYTE m_pDataBuf;
+
+ IFX_FileRead* m_pFile;
+ };
+
+ FX_FILESIZE m_FileOffset;
+
+ CPDF_CryptoHandler* m_pCryptoHandler;
+
+ void InitStream(CPDF_Dictionary* pDict);
+ friend class CPDF_Object;
+ friend class CPDF_StreamAcc;
+ friend class CPDF_AttachmentAcc;
+};
+class CPDF_StreamAcc : public CFX_Object
+{
+public:
+
+ CPDF_StreamAcc();
+
+ ~CPDF_StreamAcc();
+
+ void LoadAllData(const CPDF_Stream* pStream, FX_BOOL bRawAccess = FALSE,
+ FX_DWORD estimated_size = 0, FX_BOOL bImageAcc = FALSE);
+
+ const CPDF_Stream* GetStream() const
+ {
+ return m_pStream;
+ }
+
+ CPDF_Dictionary* GetDict() const
+ {
+ return m_pStream->GetDict();
+ }
+
+ FX_LPCBYTE GetData() const;
+
+ FX_DWORD GetSize() const;
+
+ FX_LPBYTE DetachData();
+
+ const CFX_ByteString& GetImageDecoder()
+ {
+ return m_ImageDecoder;
+ }
+
+ const CPDF_Dictionary* GetImageParam()
+ {
+ return m_pImageParam;
+ }
+protected:
+
+ FX_LPBYTE m_pData;
+
+ FX_DWORD m_dwSize;
+
+ FX_BOOL m_bNewBuf;
+
+ CFX_ByteString m_ImageDecoder;
+
+ CPDF_Dictionary* m_pImageParam;
+
+ const CPDF_Stream* m_pStream;
+
+ FX_LPBYTE m_pSrcData;
+};
+CFX_DataFilter* FPDF_CreateFilter(FX_BSTR name, const CPDF_Dictionary* pParam, int width = 0, int height = 0);
+#define FPDF_FILTER_BUFFER_SIZE 20480
+class CPDF_StreamFilter : public CFX_Object
+{
+public:
+
+ ~CPDF_StreamFilter();
+
+ FX_DWORD ReadBlock(FX_LPBYTE buffer, FX_DWORD size);
+
+ FX_DWORD GetSrcPos()
+ {
+ return m_SrcOffset;
+ }
+
+ const CPDF_Stream* GetStream()
+ {
+ return m_pStream;
+ }
+protected:
+
+ CPDF_StreamFilter() {}
+
+ FX_DWORD ReadLeftOver(FX_LPBYTE buffer, FX_DWORD buf_size);
+
+ const CPDF_Stream* m_pStream;
+
+ CFX_DataFilter* m_pFilter;
+
+ CFX_BinaryBuf* m_pBuffer;
+
+ FX_DWORD m_BufOffset;
+
+ FX_DWORD m_SrcOffset;
+
+ FX_BYTE m_SrcBuffer[FPDF_FILTER_BUFFER_SIZE];
+ friend class CPDF_Stream;
+};
+class CPDF_Null : public CPDF_Object
+{
+public:
+
+ static CPDF_Null* Create()
+ {
+ return FX_NEW CPDF_Null();
+ }
+
+ CPDF_Null()
+ {
+ m_Type = PDFOBJ_NULL;
+ }
+};
+class CPDF_Reference : public CPDF_Object
+{
+public:
+
+ static CPDF_Reference* Create(CPDF_IndirectObjects* pDoc, int objnum)
+ {
+ return FX_NEW CPDF_Reference(pDoc, objnum);
+ }
+
+ CPDF_Reference(CPDF_IndirectObjects* pDoc, int objnum)
+ {
+ m_Type = PDFOBJ_REFERENCE;
+ m_pObjList = pDoc;
+ m_RefObjNum = objnum;
+ }
+
+ CPDF_IndirectObjects* GetObjList() const
+ {
+ return m_pObjList;
+ }
+
+ FX_DWORD GetRefObjNum() const
+ {
+ return m_RefObjNum;
+ }
+
+ void SetRef(CPDF_IndirectObjects* pDoc, FX_DWORD objnum);
+
+ FX_BOOL Identical(CPDF_Reference* pOther) const
+ {
+ return m_RefObjNum == pOther->m_RefObjNum;
+ }
+protected:
+
+ CPDF_IndirectObjects* m_pObjList;
+
+ FX_DWORD m_RefObjNum;
+ friend class CPDF_Object;
+};
+class CPDF_IndirectObjects : public CFX_Object
+{
+public:
+
+ CPDF_IndirectObjects(IPDF_DocParser* pParser);
+
+ ~CPDF_IndirectObjects();
+
+ CPDF_Object* GetIndirectObject(FX_DWORD objnum, struct PARSE_CONTEXT* pContext = NULL);
+
+ int GetIndirectType(FX_DWORD objnum);
+
+ FX_DWORD AddIndirectObject(CPDF_Object* pObj);
+
+ void ReleaseIndirectObject(FX_DWORD objnum);
+
+ void InsertIndirectObject(FX_DWORD objnum, CPDF_Object* pObj);
+
+ FX_DWORD GetLastObjNum() const;
+
+ FX_POSITION GetStartPosition() const
+ {
+ return m_IndirectObjs.GetStartPosition();
+ }
+
+ void GetNextAssoc(FX_POSITION& rPos, FX_DWORD& objnum, CPDF_Object*& pObject) const
+ {
+ m_IndirectObjs.GetNextAssoc(rPos, (void*&)objnum, (void*&)pObject);
+ }
+protected:
+
+ CFX_MapPtrToPtr m_IndirectObjs;
+
+ IPDF_DocParser* m_pParser;
+
+ FX_DWORD m_LastObjNum;
+};
+#endif
diff --git a/core/include/fpdfapi/fpdf_page.h b/core/include/fpdfapi/fpdf_page.h
index 29b8c684a8..3fea866730 100644
--- a/core/include/fpdfapi/fpdf_page.h
+++ b/core/include/fpdfapi/fpdf_page.h
@@ -1,249 +1,249 @@
-// 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 _FPDF_PAGE_
-#define _FPDF_PAGE_
-#ifndef _FPDF_PARSER_
-#include "fpdf_parser.h"
-#endif
-#ifndef _FPDF_RESOURCE_
-#include "fpdf_resource.h"
-#endif
-#ifndef _FX_DIB_H_
-#include "../fxge/fx_dib.h"
-#endif
-class CPDF_PageObjects;
-class CPDF_Page;
-class CPDF_Form;
-class CPDF_ParseOptions;
-class CPDF_PageObject;
-class CPDF_PageRenderCache;
-class CPDF_StreamFilter;
-class CPDF_AllStates;
-class CPDF_ContentParser;
-class CPDF_StreamContentParser;
-class CPDF_ResourceNaming;
-#define PDFTRANS_GROUP 0x0100
-#define PDFTRANS_ISOLATED 0x0200
-#define PDFTRANS_KNOCKOUT 0x0400
-#define PDF_CONTENT_NOT_PARSED 0
-#define PDF_CONTENT_PARSING 1
-#define PDF_CONTENT_PARSED 2
-class CPDF_PageObjects : public CFX_Object
-{
-public:
-
- CPDF_PageObjects(FX_BOOL bReleaseMembers = TRUE);
-
- ~CPDF_PageObjects();
-
-
-
-
- void ContinueParse(IFX_Pause* pPause);
-
- int GetParseState() const
- {
- return m_ParseState;
- }
-
- FX_BOOL IsParsed() const
- {
- return m_ParseState == PDF_CONTENT_PARSED;
- }
-
- int EstimateParseProgress() const;
-
-
-
-
- FX_POSITION GetFirstObjectPosition() const
- {
- return m_ObjectList.GetHeadPosition();
- }
-
- FX_POSITION GetLastObjectPosition() const
- {
- return m_ObjectList.GetTailPosition();
- }
-
- CPDF_PageObject* GetNextObject(FX_POSITION& pos) const
- {
- return (CPDF_PageObject*)m_ObjectList.GetNext(pos);
- }
-
- CPDF_PageObject* GetPrevObject(FX_POSITION& pos) const
- {
- return (CPDF_PageObject*)m_ObjectList.GetPrev(pos);
- }
-
- CPDF_PageObject* GetObjectAt(FX_POSITION pos) const
- {
- return (CPDF_PageObject*)m_ObjectList.GetAt(pos);
- }
-
- FX_DWORD CountObjects() const
- {
- return m_ObjectList.GetCount();
- }
-
- int GetObjectIndex(CPDF_PageObject* pObj) const;
-
- CPDF_PageObject* GetObjectByIndex(int index) const;
-
-
-
-
-
- FX_POSITION InsertObject(FX_POSITION posInsertAfter, CPDF_PageObject* pNewObject);
-
- void Transform(const CFX_AffineMatrix& matrix);
-
- FX_BOOL BackgroundAlphaNeeded() const
- {
- return m_bBackgroundAlphaNeeded;
- }
-
- CFX_FloatRect CalcBoundingBox() const;
-
- CPDF_Dictionary* m_pFormDict;
-
- CPDF_Stream* m_pFormStream;
-
- CPDF_Document* m_pDocument;
-
- CPDF_Dictionary* m_pPageResources;
-
- CPDF_Dictionary* m_pResources;
-
- CFX_FloatRect m_BBox;
-
- int m_Transparency;
-
-protected:
- friend class CPDF_ContentParser;
- friend class CPDF_StreamContentParser;
- friend class CPDF_AllStates;
-
- CFX_PtrList m_ObjectList;
-
- FX_BOOL m_bBackgroundAlphaNeeded;
-
- FX_BOOL m_bReleaseMembers;
- void LoadTransInfo();
- void ClearCacheObjects();
-
- CPDF_ContentParser* m_pParser;
-
- FX_BOOL m_ParseState;
-};
-class CPDF_Page : public CPDF_PageObjects, public CFX_PrivateData
-{
-public:
-
- CPDF_Page();
-
- ~CPDF_Page();
-
- void Load(CPDF_Document* pDocument, CPDF_Dictionary* pPageDict, FX_BOOL bPageCache = TRUE);
-
- void StartParse(CPDF_ParseOptions* pOptions = NULL, FX_BOOL bReParse = FALSE);
-
- void ParseContent(CPDF_ParseOptions* pOptions = NULL, FX_BOOL bReParse = FALSE);
-
- void GetDisplayMatrix(CFX_AffineMatrix& matrix, int xPos, int yPos,
- int xSize, int ySize, int iRotate) const;
-
- FX_FLOAT GetPageWidth() const
- {
- return m_PageWidth;
- }
-
- FX_FLOAT GetPageHeight() const
- {
- return m_PageHeight;
- }
-
- CFX_FloatRect GetPageBBox() const
- {
- return m_BBox;
- }
-
- const CFX_AffineMatrix& GetPageMatrix() const
- {
- return m_PageMatrix;
- }
-
- CPDF_Object* GetPageAttr(FX_BSTR name) const;
-
-
-
- CPDF_PageRenderCache* GetRenderCache() const
- {
- return m_pPageRender;
- }
-
- void ClearRenderCache();
-
-protected:
- friend class CPDF_ContentParser;
-
- FX_FLOAT m_PageWidth;
-
- FX_FLOAT m_PageHeight;
-
- CFX_AffineMatrix m_PageMatrix;
-
- CPDF_PageRenderCache* m_pPageRender;
-};
-class CPDF_ParseOptions : public CFX_Object
-{
-public:
-
- CPDF_ParseOptions();
-
- FX_BOOL m_bTextOnly;
-
- FX_BOOL m_bMarkedContent;
-
- FX_BOOL m_bSeparateForm;
-
- FX_BOOL m_bDecodeInlineImage;
-};
-class CPDF_Form : public CPDF_PageObjects
-{
-public:
-
- CPDF_Form(CPDF_Document* pDocument, CPDF_Dictionary* pPageResources, CPDF_Stream* pFormStream, CPDF_Dictionary* pParentResources = NULL);
-
- ~CPDF_Form();
-
- void StartParse(CPDF_AllStates* pGraphicStates, CFX_AffineMatrix* pParentMatrix,
- CPDF_Type3Char* pType3Char, CPDF_ParseOptions* pOptions, int level = 0);
-
- void ParseContent(CPDF_AllStates* pGraphicStates, CFX_AffineMatrix* pParentMatrix,
- CPDF_Type3Char* pType3Char, CPDF_ParseOptions* pOptions, int level = 0);
-
- CPDF_Form* Clone() const;
-};
-class CPDF_PageContentGenerate : public CFX_Object
-{
-public:
- CPDF_PageContentGenerate(CPDF_Page* pPage);
- ~CPDF_PageContentGenerate();
- FX_BOOL InsertPageObject(CPDF_PageObject* pPageObject);
- void GenerateContent();
- void TransformContent(CFX_Matrix& matrix);
-protected:
- void ProcessImage(CFX_ByteTextBuf& buf, CPDF_ImageObject* pImageObj);
- void ProcessForm(CFX_ByteTextBuf& buf, FX_LPCBYTE data, FX_DWORD size, CFX_Matrix& matrix);
- CFX_ByteString RealizeResource(CPDF_Object* pResourceObj, const FX_CHAR* szType);
-private:
- CPDF_Page* m_pPage;
- CPDF_Document* m_pDocument;
- CFX_PtrArray m_pageObjects;
-};
-#endif
+// 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 _FPDF_PAGE_
+#define _FPDF_PAGE_
+#ifndef _FPDF_PARSER_
+#include "fpdf_parser.h"
+#endif
+#ifndef _FPDF_RESOURCE_
+#include "fpdf_resource.h"
+#endif
+#ifndef _FX_DIB_H_
+#include "../fxge/fx_dib.h"
+#endif
+class CPDF_PageObjects;
+class CPDF_Page;
+class CPDF_Form;
+class CPDF_ParseOptions;
+class CPDF_PageObject;
+class CPDF_PageRenderCache;
+class CPDF_StreamFilter;
+class CPDF_AllStates;
+class CPDF_ContentParser;
+class CPDF_StreamContentParser;
+class CPDF_ResourceNaming;
+#define PDFTRANS_GROUP 0x0100
+#define PDFTRANS_ISOLATED 0x0200
+#define PDFTRANS_KNOCKOUT 0x0400
+#define PDF_CONTENT_NOT_PARSED 0
+#define PDF_CONTENT_PARSING 1
+#define PDF_CONTENT_PARSED 2
+class CPDF_PageObjects : public CFX_Object
+{
+public:
+
+ CPDF_PageObjects(FX_BOOL bReleaseMembers = TRUE);
+
+ ~CPDF_PageObjects();
+
+
+
+
+ void ContinueParse(IFX_Pause* pPause);
+
+ int GetParseState() const
+ {
+ return m_ParseState;
+ }
+
+ FX_BOOL IsParsed() const
+ {
+ return m_ParseState == PDF_CONTENT_PARSED;
+ }
+
+ int EstimateParseProgress() const;
+
+
+
+
+ FX_POSITION GetFirstObjectPosition() const
+ {
+ return m_ObjectList.GetHeadPosition();
+ }
+
+ FX_POSITION GetLastObjectPosition() const
+ {
+ return m_ObjectList.GetTailPosition();
+ }
+
+ CPDF_PageObject* GetNextObject(FX_POSITION& pos) const
+ {
+ return (CPDF_PageObject*)m_ObjectList.GetNext(pos);
+ }
+
+ CPDF_PageObject* GetPrevObject(FX_POSITION& pos) const
+ {
+ return (CPDF_PageObject*)m_ObjectList.GetPrev(pos);
+ }
+
+ CPDF_PageObject* GetObjectAt(FX_POSITION pos) const
+ {
+ return (CPDF_PageObject*)m_ObjectList.GetAt(pos);
+ }
+
+ FX_DWORD CountObjects() const
+ {
+ return m_ObjectList.GetCount();
+ }
+
+ int GetObjectIndex(CPDF_PageObject* pObj) const;
+
+ CPDF_PageObject* GetObjectByIndex(int index) const;
+
+
+
+
+
+ FX_POSITION InsertObject(FX_POSITION posInsertAfter, CPDF_PageObject* pNewObject);
+
+ void Transform(const CFX_AffineMatrix& matrix);
+
+ FX_BOOL BackgroundAlphaNeeded() const
+ {
+ return m_bBackgroundAlphaNeeded;
+ }
+
+ CFX_FloatRect CalcBoundingBox() const;
+
+ CPDF_Dictionary* m_pFormDict;
+
+ CPDF_Stream* m_pFormStream;
+
+ CPDF_Document* m_pDocument;
+
+ CPDF_Dictionary* m_pPageResources;
+
+ CPDF_Dictionary* m_pResources;
+
+ CFX_FloatRect m_BBox;
+
+ int m_Transparency;
+
+protected:
+ friend class CPDF_ContentParser;
+ friend class CPDF_StreamContentParser;
+ friend class CPDF_AllStates;
+
+ CFX_PtrList m_ObjectList;
+
+ FX_BOOL m_bBackgroundAlphaNeeded;
+
+ FX_BOOL m_bReleaseMembers;
+ void LoadTransInfo();
+ void ClearCacheObjects();
+
+ CPDF_ContentParser* m_pParser;
+
+ FX_BOOL m_ParseState;
+};
+class CPDF_Page : public CPDF_PageObjects, public CFX_PrivateData
+{
+public:
+
+ CPDF_Page();
+
+ ~CPDF_Page();
+
+ void Load(CPDF_Document* pDocument, CPDF_Dictionary* pPageDict, FX_BOOL bPageCache = TRUE);
+
+ void StartParse(CPDF_ParseOptions* pOptions = NULL, FX_BOOL bReParse = FALSE);
+
+ void ParseContent(CPDF_ParseOptions* pOptions = NULL, FX_BOOL bReParse = FALSE);
+
+ void GetDisplayMatrix(CFX_AffineMatrix& matrix, int xPos, int yPos,
+ int xSize, int ySize, int iRotate) const;
+
+ FX_FLOAT GetPageWidth() const
+ {
+ return m_PageWidth;
+ }
+
+ FX_FLOAT GetPageHeight() const
+ {
+ return m_PageHeight;
+ }
+
+ CFX_FloatRect GetPageBBox() const
+ {
+ return m_BBox;
+ }
+
+ const CFX_AffineMatrix& GetPageMatrix() const
+ {
+ return m_PageMatrix;
+ }
+
+ CPDF_Object* GetPageAttr(FX_BSTR name) const;
+
+
+
+ CPDF_PageRenderCache* GetRenderCache() const
+ {
+ return m_pPageRender;
+ }
+
+ void ClearRenderCache();
+
+protected:
+ friend class CPDF_ContentParser;
+
+ FX_FLOAT m_PageWidth;
+
+ FX_FLOAT m_PageHeight;
+
+ CFX_AffineMatrix m_PageMatrix;
+
+ CPDF_PageRenderCache* m_pPageRender;
+};
+class CPDF_ParseOptions : public CFX_Object
+{
+public:
+
+ CPDF_ParseOptions();
+
+ FX_BOOL m_bTextOnly;
+
+ FX_BOOL m_bMarkedContent;
+
+ FX_BOOL m_bSeparateForm;
+
+ FX_BOOL m_bDecodeInlineImage;
+};
+class CPDF_Form : public CPDF_PageObjects
+{
+public:
+
+ CPDF_Form(CPDF_Document* pDocument, CPDF_Dictionary* pPageResources, CPDF_Stream* pFormStream, CPDF_Dictionary* pParentResources = NULL);
+
+ ~CPDF_Form();
+
+ void StartParse(CPDF_AllStates* pGraphicStates, CFX_AffineMatrix* pParentMatrix,
+ CPDF_Type3Char* pType3Char, CPDF_ParseOptions* pOptions, int level = 0);
+
+ void ParseContent(CPDF_AllStates* pGraphicStates, CFX_AffineMatrix* pParentMatrix,
+ CPDF_Type3Char* pType3Char, CPDF_ParseOptions* pOptions, int level = 0);
+
+ CPDF_Form* Clone() const;
+};
+class CPDF_PageContentGenerate : public CFX_Object
+{
+public:
+ CPDF_PageContentGenerate(CPDF_Page* pPage);
+ ~CPDF_PageContentGenerate();
+ FX_BOOL InsertPageObject(CPDF_PageObject* pPageObject);
+ void GenerateContent();
+ void TransformContent(CFX_Matrix& matrix);
+protected:
+ void ProcessImage(CFX_ByteTextBuf& buf, CPDF_ImageObject* pImageObj);
+ void ProcessForm(CFX_ByteTextBuf& buf, FX_LPCBYTE data, FX_DWORD size, CFX_Matrix& matrix);
+ CFX_ByteString RealizeResource(CPDF_Object* pResourceObj, const FX_CHAR* szType);
+private:
+ CPDF_Page* m_pPage;
+ CPDF_Document* m_pDocument;
+ CFX_PtrArray m_pageObjects;
+};
+#endif
diff --git a/core/include/fpdfapi/fpdf_pageobj.h b/core/include/fpdfapi/fpdf_pageobj.h
index 1e82680907..90e1b0b90b 100644
--- a/core/include/fpdfapi/fpdf_pageobj.h
+++ b/core/include/fpdfapi/fpdf_pageobj.h
@@ -1,721 +1,721 @@
-// 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 _FPDF_PAGEOBJ_H_
-#define _FPDF_PAGEOBJ_H_
-#ifndef _FPDF_RESOURCE_
-#include "fpdf_resource.h"
-#endif
-#ifndef _FX_GE_H_
-#include "../fxge/fx_ge.h"
-#endif
-class CPDF_Path;
-class CPDF_ClipPathData;
-class CPDF_ClipPath;
-class CPDF_ColorStateData;
-class CPDF_ColorState;
-class CPDF_GraphState;
-class CPDF_TextStateData;
-class CPDF_TextState;
-class CPDF_GeneralStateData;
-class CPDF_GeneralState;
-class CPDF_ContentMarkItem;
-class CPDF_ContentMark;
-class CPDF_GraphicStates;
-class CPDF_PageObject;
-class CPDF_TextObject;
-class CPDF_PathObject;
-class CPDF_ImageObject;
-class CPDF_ShadingObject;
-class CPDF_FormObject;
-class CPDF_InlineImages;
-typedef CFX_PathData CPDF_PathData;
-class CPDF_Path : public CFX_CountRef<CFX_PathData>
-{
-public:
-
-
-
-
- int GetPointCount()
- {
- return m_pObject->m_PointCount;
- }
-
- int GetFlag(int index)
- {
- return m_pObject->m_pPoints[index].m_Flag;
- }
-
- FX_FLOAT GetPointX(int index)
- {
- return m_pObject->m_pPoints[index].m_PointX;
- }
-
- FX_FLOAT GetPointY(int index)
- {
- return m_pObject->m_pPoints[index].m_PointY;
- }
-
-
-
-
- FX_PATHPOINT* GetPoints()
- {
- return m_pObject->m_pPoints;
- }
-
-
- CFX_FloatRect GetBoundingBox() const
- {
- return m_pObject->GetBoundingBox();
- }
-
- CFX_FloatRect GetBoundingBox(FX_FLOAT line_width, FX_FLOAT miter_limit) const
- {
- return m_pObject->GetBoundingBox(line_width, miter_limit);
- }
-
- void Transform(const CFX_AffineMatrix* pMatrix)
- {
- GetModify()->Transform(pMatrix);
- }
-
- void Append(CPDF_Path src, const CFX_AffineMatrix* pMatrix)
- {
- m_pObject->Append(src.m_pObject, pMatrix);
- }
-
- void AppendRect(FX_FLOAT left, FX_FLOAT bottom, FX_FLOAT right, FX_FLOAT top)
- {
- m_pObject->AppendRect(left, bottom, right, top);
- }
-
- FX_BOOL IsRect() const
- {
- return m_pObject->IsRect();
- }
-};
-class CPDF_ClipPathData : public CFX_Object
-{
-public:
-
- CPDF_ClipPathData();
-
- CPDF_ClipPathData(const CPDF_ClipPathData&);
-
- ~CPDF_ClipPathData();
-
- void SetCount(int path_count, int text_count);
-public:
-
- int m_PathCount;
-
- CPDF_Path* m_pPathList;
-
- FX_BYTE* m_pTypeList;
-
- int m_TextCount;
-
- CPDF_TextObject** m_pTextList;
-};
-class CPDF_ClipPath : public CFX_CountRef<CPDF_ClipPathData>
-{
-public:
-
- FX_DWORD GetPathCount() const
- {
- return m_pObject->m_PathCount;
- }
-
- CPDF_Path GetPath(int i) const
- {
- return m_pObject->m_pPathList[i];
- }
-
- int GetClipType(int i) const
- {
- return m_pObject->m_pTypeList[i];
- }
-
- FX_DWORD GetTextCount() const
- {
- return m_pObject->m_TextCount;
- }
-
- CPDF_TextObject* GetText(int i) const
- {
- return m_pObject->m_pTextList[i];
- }
-
- CFX_FloatRect GetClipBox() const;
-
- void AppendPath(CPDF_Path path, int type, FX_BOOL bAutoMerge);
-
- void DeletePath(int layer_index);
-
- void AppendTexts(CPDF_TextObject** pTexts, int count);
-
- void Transform(const CFX_AffineMatrix& matrix);
-};
-class CPDF_ColorStateData : public CFX_Object
-{
-public:
-
- CPDF_ColorStateData() {}
-
- CPDF_ColorStateData(const CPDF_ColorStateData& src);
-
- void Default();
-
- CPDF_Color m_FillColor;
-
- FX_DWORD m_FillRGB;
-
- CPDF_Color m_StrokeColor;
-
- FX_DWORD m_StrokeRGB;
-};
-class CPDF_ColorState : public CFX_CountRef<CPDF_ColorStateData>
-{
-public:
-
- CPDF_Color* GetFillColor() const
- {
- return m_pObject ? &m_pObject->m_FillColor : NULL;
- }
-
- CPDF_Color* GetStrokeColor() const
- {
- return m_pObject ? &m_pObject->m_StrokeColor : NULL;
- }
-
- void SetFillColor(CPDF_ColorSpace* pCS, FX_FLOAT* pValue, int nValues);
-
- void SetStrokeColor(CPDF_ColorSpace* pCS, FX_FLOAT* pValue, int nValues);
-
- void SetFillPattern(CPDF_Pattern* pattern, FX_FLOAT* pValue, int nValues);
-
- void SetStrokePattern(CPDF_Pattern* pattern, FX_FLOAT* pValue, int nValues);
-private:
- void SetColor(CPDF_Color& color, FX_DWORD& rgb, CPDF_ColorSpace* pCS, FX_FLOAT* pValue, int nValues);
-};
-typedef CFX_GraphStateData CPDF_GraphStateData;
-class CPDF_GraphState : public CFX_CountRef<CFX_GraphStateData>
-{
-public:
-};
-class CPDF_TextStateData : public CFX_Object
-{
-public:
-
- CPDF_TextStateData();
-
- CPDF_TextStateData(const CPDF_TextStateData& src);
-
- ~CPDF_TextStateData();
-
- CPDF_Font* m_pFont;
-
- FX_FLOAT m_FontSize;
-
- FX_FLOAT m_CharSpace;
-
- FX_FLOAT m_WordSpace;
-
- FX_FLOAT m_Matrix[4];
-
- int m_TextMode;
-
- FX_FLOAT m_CTM[4];
-};
-class CPDF_TextState : public CFX_CountRef<CPDF_TextStateData>
-{
-public:
-
- CPDF_Font* GetFont() const
- {
- return m_pObject->m_pFont;
- }
-
- void SetFont(CPDF_Font* pFont);
-
- FX_FLOAT GetFontSize() const
- {
- return m_pObject->m_FontSize;
- }
-
- FX_FLOAT* GetMatrix() const
- {
- return m_pObject->m_Matrix;
- }
-
-
-
- FX_FLOAT GetFontSizeV() const;
-
- FX_FLOAT GetFontSizeH() const;
-
- FX_FLOAT GetBaselineAngle() const;
-
- FX_FLOAT GetShearAngle() const;
-
-};
-class CPDF_TransferFunc;
-class CPDF_GeneralStateData : public CFX_Object
-{
-public:
-
- CPDF_GeneralStateData();
-
- CPDF_GeneralStateData(const CPDF_GeneralStateData& src);
- ~CPDF_GeneralStateData();
-
- void SetBlendMode(FX_BSTR blend_mode);
-
- char m_BlendMode[16];
-
- int m_BlendType;
-
- CPDF_Object* m_pSoftMask;
-
- FX_FLOAT m_SMaskMatrix[6];
-
- FX_FLOAT m_StrokeAlpha;
-
- FX_FLOAT m_FillAlpha;
-
- CPDF_Object* m_pTR;
-
- CPDF_TransferFunc* m_pTransferFunc;
-
- CFX_Matrix m_Matrix;
-
- int m_RenderIntent;
-
- FX_BOOL m_StrokeAdjust;
-
- FX_BOOL m_AlphaSource;
-
- FX_BOOL m_TextKnockout;
-
- FX_BOOL m_StrokeOP;
-
- FX_BOOL m_FillOP;
-
- int m_OPMode;
-
- CPDF_Object* m_pBG;
-
- CPDF_Object* m_pUCR;
-
- CPDF_Object* m_pHT;
-
- FX_FLOAT m_Flatness;
-
- FX_FLOAT m_Smoothness;
-};
-class CPDF_GeneralState : public CFX_CountRef<CPDF_GeneralStateData>
-{
-public:
-
- void SetRenderIntent(const CFX_ByteString& ri);
-
- int GetBlendType() const
- {
- return m_pObject ? m_pObject->m_BlendType : FXDIB_BLEND_NORMAL;
- }
-
- int GetAlpha(FX_BOOL bStroke) const
- {
- return m_pObject ? FXSYS_round((bStroke ? m_pObject->m_StrokeAlpha : m_pObject->m_FillAlpha) * 255) : 255;
- }
-};
-class CPDF_ContentMarkItem : public CFX_Object
-{
-public:
-
- typedef enum {
- None,
- PropertiesDict,
- DirectDict,
- MCID
- } ParamType;
-
- CPDF_ContentMarkItem();
-
- CPDF_ContentMarkItem(const CPDF_ContentMarkItem& src);
-
- ~CPDF_ContentMarkItem();
-
- inline const CFX_ByteString& GetName() const
- {
- return m_MarkName;
- }
-
- inline ParamType GetParamType() const
- {
- return m_ParamType;
- }
-
- inline void* GetParam() const
- {
- return m_pParam;
- }
-
- inline FX_BOOL HasMCID() const;
-
- inline void SetName(const CFX_ByteString& name)
- {
- m_MarkName = name;
- }
-
- inline void SetParam(ParamType type, void* param)
- {
- m_ParamType = type;
- m_pParam = param;
- }
-private:
-
- CFX_ByteString m_MarkName;
-
- ParamType m_ParamType;
-
- void* m_pParam;
-};
-class CPDF_ContentMarkData : public CFX_Object
-{
-public:
-
- CPDF_ContentMarkData() { }
-
- CPDF_ContentMarkData(const CPDF_ContentMarkData& src);
-
- inline int CountItems() const
- {
- return m_Marks.GetSize();
- }
-
- inline CPDF_ContentMarkItem& GetItem(int index) const
- {
- return m_Marks[index];
- }
-
- int GetMCID() const;
-
- void AddMark(const CFX_ByteString& name, CPDF_Dictionary* pDict, FX_BOOL bDictNeedClone);
-
- void DeleteLastMark();
-private:
-
- CFX_ObjectArray<CPDF_ContentMarkItem> m_Marks;
-};
-class CPDF_ContentMark : public CFX_CountRef<CPDF_ContentMarkData>
-{
-public:
-
- int GetMCID() const
- {
- return m_pObject ? m_pObject->GetMCID() : -1;
- }
-
- FX_BOOL HasMark(FX_BSTR mark) const;
-
- FX_BOOL LookupMark(FX_BSTR mark, CPDF_Dictionary*& pDict) const;
-};
-#define PDFPAGE_TEXT 1
-#define PDFPAGE_PATH 2
-#define PDFPAGE_IMAGE 3
-#define PDFPAGE_SHADING 4
-#define PDFPAGE_FORM 5
-#define PDFPAGE_INLINES 6
-class CPDF_GraphicStates : public CFX_Object
-{
-public:
-
- void CopyStates(const CPDF_GraphicStates& src);
-
- void DefaultStates();
-
- CPDF_ClipPath m_ClipPath;
-
- CPDF_GraphState m_GraphState;
-
- CPDF_ColorState m_ColorState;
-
- CPDF_TextState m_TextState;
-
- CPDF_GeneralState m_GeneralState;
-};
-class CPDF_PageObject : public CPDF_GraphicStates
-{
-public:
-
- static CPDF_PageObject* Create(int type);
-
- void Release();
-
- CPDF_PageObject* Clone() const;
-
- void Copy(const CPDF_PageObject* pSrcObject);
-
- virtual void Transform(const CFX_AffineMatrix& matrix) = 0;
-
-
-
- void RemoveClipPath();
-
- void AppendClipPath(CPDF_Path path, int type, FX_BOOL bAutoMerge);
-
- void CopyClipPath(CPDF_PageObject* pObj);
-
- void TransformClipPath(CFX_AffineMatrix& matrix);
-
- void TransformGeneralState(CFX_AffineMatrix& matrix);
-
-
- void SetColorState(CPDF_ColorState state)
- {
- m_ColorState = state;
- }
-
- FX_RECT GetBBox(const CFX_AffineMatrix* pMatrix) const;
-
- int m_Type;
-
- FX_FLOAT m_Left;
-
- FX_FLOAT m_Right;
-
- FX_FLOAT m_Top;
-
- FX_FLOAT m_Bottom;
-
- CPDF_ContentMark m_ContentMark;
-protected:
-
- virtual void CopyData(const CPDF_PageObject* pSrcObject) {}
-
- void RecalcBBox();
-
- CPDF_PageObject() {}
-
- virtual ~CPDF_PageObject() {}
-};
-struct CPDF_TextObjectItem : public CFX_Object {
-
- FX_DWORD m_CharCode;
-
- FX_FLOAT m_OriginX;
-
- FX_FLOAT m_OriginY;
-};
-class CPDF_TextObject : public CPDF_PageObject
-{
-public:
-
- CPDF_TextObject();
-
- virtual ~CPDF_TextObject();
-
- int CountItems() const
- {
- return m_nChars;
- }
-
- void GetItemInfo(int index, CPDF_TextObjectItem* pInfo) const;
-
- int CountChars() const;
-
- void GetCharInfo(int index, FX_DWORD& charcode, FX_FLOAT& kerning) const;
- void GetCharInfo(int index, CPDF_TextObjectItem* pInfo) const;
-
- void GetCharRect(int index, CFX_FloatRect& rect) const;
-
-
- FX_FLOAT GetCharWidth(FX_DWORD charcode) const;
- FX_FLOAT GetSpaceCharWidth() const;
-
- FX_FLOAT GetPosX() const
- {
- return m_PosX;
- }
-
- FX_FLOAT GetPosY() const
- {
- return m_PosY;
- }
-
- void GetTextMatrix(CFX_AffineMatrix* pMatrix) const;
-
- CPDF_Font* GetFont() const
- {
- return m_TextState.GetFont();
- }
-
- FX_FLOAT GetFontSize() const
- {
- return m_TextState.GetFontSize();
- }
-
- void SetEmpty();
-
- void SetText(const CFX_ByteString& text);
-
- void SetText(CFX_ByteString* pStrs, FX_FLOAT* pKerning, int nSegs);
-
- void SetText(int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pKernings);
-
- void SetPosition(FX_FLOAT x, FX_FLOAT y);
-
- void SetTextState(CPDF_TextState TextState);
- virtual void Transform(const CFX_AffineMatrix& matrix);
-
- void CalcCharPos(FX_FLOAT* pPosArray) const;
-
-
-
- void SetData(int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pCharPos, FX_FLOAT x, FX_FLOAT y);
-
- void GetData(int& nChars, FX_DWORD*& pCharCodes, FX_FLOAT*& pCharPos)
- {
- nChars = m_nChars;
- pCharCodes = m_pCharCodes;
- pCharPos = m_pCharPos;
- }
-
-
- void RecalcPositionData()
- {
- CalcPositionData(NULL, NULL, 1);
- }
-protected:
- virtual void CopyData(const CPDF_PageObject* pSrcObject);
-
- FX_FLOAT m_PosX;
-
- FX_FLOAT m_PosY;
-
- int m_nChars;
-
- FX_DWORD* m_pCharCodes;
-
- FX_FLOAT* m_pCharPos;
-
- void SetSegments(const CFX_ByteString* pStrs, FX_FLOAT* pKerning, int nSegs);
-
- void CalcPositionData(FX_FLOAT* pTextAdvanceX, FX_FLOAT* pTextAdvanceY, FX_FLOAT horz_scale, int level = 0);
- friend class CPDF_StreamContentParser;
- friend class CPDF_RenderStatus;
- friend class CPDF_QuickDrawer;
- friend class CPDF_TextRenderer;
- friend class CTextPage;
- friend class CPDF_ContentGenerator;
-};
-class CPDF_PathObject : public CPDF_PageObject
-{
-public:
-
- CPDF_PathObject()
- {
- m_Type = PDFPAGE_PATH;
- }
-
- virtual ~CPDF_PathObject() {}
- virtual void Transform(const CFX_AffineMatrix& maxtrix);
-
- void SetGraphState(CPDF_GraphState GraphState);
-
- CPDF_Path m_Path;
-
- int m_FillType;
-
- FX_BOOL m_bStroke;
-
- CFX_AffineMatrix m_Matrix;
-
-
- void CalcBoundingBox();
-protected:
- virtual void CopyData(const CPDF_PageObject* pSrcObjet);
-};
-class CPDF_ImageObject : public CPDF_PageObject
-{
-public:
-
- CPDF_ImageObject();
-
- virtual ~CPDF_ImageObject();
- virtual void Transform(const CFX_AffineMatrix& matrix);
-
- CPDF_Image* m_pImage;
-
- CFX_AffineMatrix m_Matrix;
-
- void CalcBoundingBox();
-private:
- virtual void CopyData(const CPDF_PageObject* pSrcObjet);
-};
-class CPDF_ShadingObject : public CPDF_PageObject
-{
-public:
-
- CPDF_ShadingObject();
-
- virtual ~CPDF_ShadingObject();
-
- CPDF_ShadingPattern* m_pShading;
-
- CFX_AffineMatrix m_Matrix;
-
- CPDF_Page* m_pPage;
- virtual void Transform(const CFX_AffineMatrix& matrix);
-
- void CalcBoundingBox();
-protected:
- virtual void CopyData(const CPDF_PageObject* pSrcObjet);
-};
-class CPDF_FormObject : public CPDF_PageObject
-{
-public:
-
- CPDF_FormObject()
- {
- m_Type = PDFPAGE_FORM;
- m_pForm = NULL;
- }
-
- virtual ~CPDF_FormObject();
- virtual void Transform(const CFX_AffineMatrix& matrix);
-
- CPDF_Form* m_pForm;
-
- CFX_AffineMatrix m_FormMatrix;
-
- void CalcBoundingBox();
-protected:
- virtual void CopyData(const CPDF_PageObject* pSrcObjet);
-};
-class CPDF_InlineImages : public CPDF_PageObject
-{
-public:
-
- CPDF_InlineImages();
-
- virtual ~CPDF_InlineImages();
-
- CPDF_Stream* m_pStream;
-
- CFX_DIBitmap* m_pBitmap;
-
- CFX_ArrayTemplate<CFX_AffineMatrix> m_Matrices;
-
- void AddMatrix(CFX_AffineMatrix& matrix);
-protected:
- virtual void Transform(const CFX_AffineMatrix& matrix) {}
- virtual void CopyData(const CPDF_PageObject* pSrcObjet) {}
-};
-#endif
+// 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 _FPDF_PAGEOBJ_H_
+#define _FPDF_PAGEOBJ_H_
+#ifndef _FPDF_RESOURCE_
+#include "fpdf_resource.h"
+#endif
+#ifndef _FX_GE_H_
+#include "../fxge/fx_ge.h"
+#endif
+class CPDF_Path;
+class CPDF_ClipPathData;
+class CPDF_ClipPath;
+class CPDF_ColorStateData;
+class CPDF_ColorState;
+class CPDF_GraphState;
+class CPDF_TextStateData;
+class CPDF_TextState;
+class CPDF_GeneralStateData;
+class CPDF_GeneralState;
+class CPDF_ContentMarkItem;
+class CPDF_ContentMark;
+class CPDF_GraphicStates;
+class CPDF_PageObject;
+class CPDF_TextObject;
+class CPDF_PathObject;
+class CPDF_ImageObject;
+class CPDF_ShadingObject;
+class CPDF_FormObject;
+class CPDF_InlineImages;
+typedef CFX_PathData CPDF_PathData;
+class CPDF_Path : public CFX_CountRef<CFX_PathData>
+{
+public:
+
+
+
+
+ int GetPointCount()
+ {
+ return m_pObject->m_PointCount;
+ }
+
+ int GetFlag(int index)
+ {
+ return m_pObject->m_pPoints[index].m_Flag;
+ }
+
+ FX_FLOAT GetPointX(int index)
+ {
+ return m_pObject->m_pPoints[index].m_PointX;
+ }
+
+ FX_FLOAT GetPointY(int index)
+ {
+ return m_pObject->m_pPoints[index].m_PointY;
+ }
+
+
+
+
+ FX_PATHPOINT* GetPoints()
+ {
+ return m_pObject->m_pPoints;
+ }
+
+
+ CFX_FloatRect GetBoundingBox() const
+ {
+ return m_pObject->GetBoundingBox();
+ }
+
+ CFX_FloatRect GetBoundingBox(FX_FLOAT line_width, FX_FLOAT miter_limit) const
+ {
+ return m_pObject->GetBoundingBox(line_width, miter_limit);
+ }
+
+ void Transform(const CFX_AffineMatrix* pMatrix)
+ {
+ GetModify()->Transform(pMatrix);
+ }
+
+ void Append(CPDF_Path src, const CFX_AffineMatrix* pMatrix)
+ {
+ m_pObject->Append(src.m_pObject, pMatrix);
+ }
+
+ void AppendRect(FX_FLOAT left, FX_FLOAT bottom, FX_FLOAT right, FX_FLOAT top)
+ {
+ m_pObject->AppendRect(left, bottom, right, top);
+ }
+
+ FX_BOOL IsRect() const
+ {
+ return m_pObject->IsRect();
+ }
+};
+class CPDF_ClipPathData : public CFX_Object
+{
+public:
+
+ CPDF_ClipPathData();
+
+ CPDF_ClipPathData(const CPDF_ClipPathData&);
+
+ ~CPDF_ClipPathData();
+
+ void SetCount(int path_count, int text_count);
+public:
+
+ int m_PathCount;
+
+ CPDF_Path* m_pPathList;
+
+ FX_BYTE* m_pTypeList;
+
+ int m_TextCount;
+
+ CPDF_TextObject** m_pTextList;
+};
+class CPDF_ClipPath : public CFX_CountRef<CPDF_ClipPathData>
+{
+public:
+
+ FX_DWORD GetPathCount() const
+ {
+ return m_pObject->m_PathCount;
+ }
+
+ CPDF_Path GetPath(int i) const
+ {
+ return m_pObject->m_pPathList[i];
+ }
+
+ int GetClipType(int i) const
+ {
+ return m_pObject->m_pTypeList[i];
+ }
+
+ FX_DWORD GetTextCount() const
+ {
+ return m_pObject->m_TextCount;
+ }
+
+ CPDF_TextObject* GetText(int i) const
+ {
+ return m_pObject->m_pTextList[i];
+ }
+
+ CFX_FloatRect GetClipBox() const;
+
+ void AppendPath(CPDF_Path path, int type, FX_BOOL bAutoMerge);
+
+ void DeletePath(int layer_index);
+
+ void AppendTexts(CPDF_TextObject** pTexts, int count);
+
+ void Transform(const CFX_AffineMatrix& matrix);
+};
+class CPDF_ColorStateData : public CFX_Object
+{
+public:
+
+ CPDF_ColorStateData() {}
+
+ CPDF_ColorStateData(const CPDF_ColorStateData& src);
+
+ void Default();
+
+ CPDF_Color m_FillColor;
+
+ FX_DWORD m_FillRGB;
+
+ CPDF_Color m_StrokeColor;
+
+ FX_DWORD m_StrokeRGB;
+};
+class CPDF_ColorState : public CFX_CountRef<CPDF_ColorStateData>
+{
+public:
+
+ CPDF_Color* GetFillColor() const
+ {
+ return m_pObject ? &m_pObject->m_FillColor : NULL;
+ }
+
+ CPDF_Color* GetStrokeColor() const
+ {
+ return m_pObject ? &m_pObject->m_StrokeColor : NULL;
+ }
+
+ void SetFillColor(CPDF_ColorSpace* pCS, FX_FLOAT* pValue, int nValues);
+
+ void SetStrokeColor(CPDF_ColorSpace* pCS, FX_FLOAT* pValue, int nValues);
+
+ void SetFillPattern(CPDF_Pattern* pattern, FX_FLOAT* pValue, int nValues);
+
+ void SetStrokePattern(CPDF_Pattern* pattern, FX_FLOAT* pValue, int nValues);
+private:
+ void SetColor(CPDF_Color& color, FX_DWORD& rgb, CPDF_ColorSpace* pCS, FX_FLOAT* pValue, int nValues);
+};
+typedef CFX_GraphStateData CPDF_GraphStateData;
+class CPDF_GraphState : public CFX_CountRef<CFX_GraphStateData>
+{
+public:
+};
+class CPDF_TextStateData : public CFX_Object
+{
+public:
+
+ CPDF_TextStateData();
+
+ CPDF_TextStateData(const CPDF_TextStateData& src);
+
+ ~CPDF_TextStateData();
+
+ CPDF_Font* m_pFont;
+
+ FX_FLOAT m_FontSize;
+
+ FX_FLOAT m_CharSpace;
+
+ FX_FLOAT m_WordSpace;
+
+ FX_FLOAT m_Matrix[4];
+
+ int m_TextMode;
+
+ FX_FLOAT m_CTM[4];
+};
+class CPDF_TextState : public CFX_CountRef<CPDF_TextStateData>
+{
+public:
+
+ CPDF_Font* GetFont() const
+ {
+ return m_pObject->m_pFont;
+ }
+
+ void SetFont(CPDF_Font* pFont);
+
+ FX_FLOAT GetFontSize() const
+ {
+ return m_pObject->m_FontSize;
+ }
+
+ FX_FLOAT* GetMatrix() const
+ {
+ return m_pObject->m_Matrix;
+ }
+
+
+
+ FX_FLOAT GetFontSizeV() const;
+
+ FX_FLOAT GetFontSizeH() const;
+
+ FX_FLOAT GetBaselineAngle() const;
+
+ FX_FLOAT GetShearAngle() const;
+
+};
+class CPDF_TransferFunc;
+class CPDF_GeneralStateData : public CFX_Object
+{
+public:
+
+ CPDF_GeneralStateData();
+
+ CPDF_GeneralStateData(const CPDF_GeneralStateData& src);
+ ~CPDF_GeneralStateData();
+
+ void SetBlendMode(FX_BSTR blend_mode);
+
+ char m_BlendMode[16];
+
+ int m_BlendType;
+
+ CPDF_Object* m_pSoftMask;
+
+ FX_FLOAT m_SMaskMatrix[6];
+
+ FX_FLOAT m_StrokeAlpha;
+
+ FX_FLOAT m_FillAlpha;
+
+ CPDF_Object* m_pTR;
+
+ CPDF_TransferFunc* m_pTransferFunc;
+
+ CFX_Matrix m_Matrix;
+
+ int m_RenderIntent;
+
+ FX_BOOL m_StrokeAdjust;
+
+ FX_BOOL m_AlphaSource;
+
+ FX_BOOL m_TextKnockout;
+
+ FX_BOOL m_StrokeOP;
+
+ FX_BOOL m_FillOP;
+
+ int m_OPMode;
+
+ CPDF_Object* m_pBG;
+
+ CPDF_Object* m_pUCR;
+
+ CPDF_Object* m_pHT;
+
+ FX_FLOAT m_Flatness;
+
+ FX_FLOAT m_Smoothness;
+};
+class CPDF_GeneralState : public CFX_CountRef<CPDF_GeneralStateData>
+{
+public:
+
+ void SetRenderIntent(const CFX_ByteString& ri);
+
+ int GetBlendType() const
+ {
+ return m_pObject ? m_pObject->m_BlendType : FXDIB_BLEND_NORMAL;
+ }
+
+ int GetAlpha(FX_BOOL bStroke) const
+ {
+ return m_pObject ? FXSYS_round((bStroke ? m_pObject->m_StrokeAlpha : m_pObject->m_FillAlpha) * 255) : 255;
+ }
+};
+class CPDF_ContentMarkItem : public CFX_Object
+{
+public:
+
+ typedef enum {
+ None,
+ PropertiesDict,
+ DirectDict,
+ MCID
+ } ParamType;
+
+ CPDF_ContentMarkItem();
+
+ CPDF_ContentMarkItem(const CPDF_ContentMarkItem& src);
+
+ ~CPDF_ContentMarkItem();
+
+ inline const CFX_ByteString& GetName() const
+ {
+ return m_MarkName;
+ }
+
+ inline ParamType GetParamType() const
+ {
+ return m_ParamType;
+ }
+
+ inline void* GetParam() const
+ {
+ return m_pParam;
+ }
+
+ inline FX_BOOL HasMCID() const;
+
+ inline void SetName(const CFX_ByteString& name)
+ {
+ m_MarkName = name;
+ }
+
+ inline void SetParam(ParamType type, void* param)
+ {
+ m_ParamType = type;
+ m_pParam = param;
+ }
+private:
+
+ CFX_ByteString m_MarkName;
+
+ ParamType m_ParamType;
+
+ void* m_pParam;
+};
+class CPDF_ContentMarkData : public CFX_Object
+{
+public:
+
+ CPDF_ContentMarkData() { }
+
+ CPDF_ContentMarkData(const CPDF_ContentMarkData& src);
+
+ inline int CountItems() const
+ {
+ return m_Marks.GetSize();
+ }
+
+ inline CPDF_ContentMarkItem& GetItem(int index) const
+ {
+ return m_Marks[index];
+ }
+
+ int GetMCID() const;
+
+ void AddMark(const CFX_ByteString& name, CPDF_Dictionary* pDict, FX_BOOL bDictNeedClone);
+
+ void DeleteLastMark();
+private:
+
+ CFX_ObjectArray<CPDF_ContentMarkItem> m_Marks;
+};
+class CPDF_ContentMark : public CFX_CountRef<CPDF_ContentMarkData>
+{
+public:
+
+ int GetMCID() const
+ {
+ return m_pObject ? m_pObject->GetMCID() : -1;
+ }
+
+ FX_BOOL HasMark(FX_BSTR mark) const;
+
+ FX_BOOL LookupMark(FX_BSTR mark, CPDF_Dictionary*& pDict) const;
+};
+#define PDFPAGE_TEXT 1
+#define PDFPAGE_PATH 2
+#define PDFPAGE_IMAGE 3
+#define PDFPAGE_SHADING 4
+#define PDFPAGE_FORM 5
+#define PDFPAGE_INLINES 6
+class CPDF_GraphicStates : public CFX_Object
+{
+public:
+
+ void CopyStates(const CPDF_GraphicStates& src);
+
+ void DefaultStates();
+
+ CPDF_ClipPath m_ClipPath;
+
+ CPDF_GraphState m_GraphState;
+
+ CPDF_ColorState m_ColorState;
+
+ CPDF_TextState m_TextState;
+
+ CPDF_GeneralState m_GeneralState;
+};
+class CPDF_PageObject : public CPDF_GraphicStates
+{
+public:
+
+ static CPDF_PageObject* Create(int type);
+
+ void Release();
+
+ CPDF_PageObject* Clone() const;
+
+ void Copy(const CPDF_PageObject* pSrcObject);
+
+ virtual void Transform(const CFX_AffineMatrix& matrix) = 0;
+
+
+
+ void RemoveClipPath();
+
+ void AppendClipPath(CPDF_Path path, int type, FX_BOOL bAutoMerge);
+
+ void CopyClipPath(CPDF_PageObject* pObj);
+
+ void TransformClipPath(CFX_AffineMatrix& matrix);
+
+ void TransformGeneralState(CFX_AffineMatrix& matrix);
+
+
+ void SetColorState(CPDF_ColorState state)
+ {
+ m_ColorState = state;
+ }
+
+ FX_RECT GetBBox(const CFX_AffineMatrix* pMatrix) const;
+
+ int m_Type;
+
+ FX_FLOAT m_Left;
+
+ FX_FLOAT m_Right;
+
+ FX_FLOAT m_Top;
+
+ FX_FLOAT m_Bottom;
+
+ CPDF_ContentMark m_ContentMark;
+protected:
+
+ virtual void CopyData(const CPDF_PageObject* pSrcObject) {}
+
+ void RecalcBBox();
+
+ CPDF_PageObject() {}
+
+ virtual ~CPDF_PageObject() {}
+};
+struct CPDF_TextObjectItem : public CFX_Object {
+
+ FX_DWORD m_CharCode;
+
+ FX_FLOAT m_OriginX;
+
+ FX_FLOAT m_OriginY;
+};
+class CPDF_TextObject : public CPDF_PageObject
+{
+public:
+
+ CPDF_TextObject();
+
+ virtual ~CPDF_TextObject();
+
+ int CountItems() const
+ {
+ return m_nChars;
+ }
+
+ void GetItemInfo(int index, CPDF_TextObjectItem* pInfo) const;
+
+ int CountChars() const;
+
+ void GetCharInfo(int index, FX_DWORD& charcode, FX_FLOAT& kerning) const;
+ void GetCharInfo(int index, CPDF_TextObjectItem* pInfo) const;
+
+ void GetCharRect(int index, CFX_FloatRect& rect) const;
+
+
+ FX_FLOAT GetCharWidth(FX_DWORD charcode) const;
+ FX_FLOAT GetSpaceCharWidth() const;
+
+ FX_FLOAT GetPosX() const
+ {
+ return m_PosX;
+ }
+
+ FX_FLOAT GetPosY() const
+ {
+ return m_PosY;
+ }
+
+ void GetTextMatrix(CFX_AffineMatrix* pMatrix) const;
+
+ CPDF_Font* GetFont() const
+ {
+ return m_TextState.GetFont();
+ }
+
+ FX_FLOAT GetFontSize() const
+ {
+ return m_TextState.GetFontSize();
+ }
+
+ void SetEmpty();
+
+ void SetText(const CFX_ByteString& text);
+
+ void SetText(CFX_ByteString* pStrs, FX_FLOAT* pKerning, int nSegs);
+
+ void SetText(int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pKernings);
+
+ void SetPosition(FX_FLOAT x, FX_FLOAT y);
+
+ void SetTextState(CPDF_TextState TextState);
+ virtual void Transform(const CFX_AffineMatrix& matrix);
+
+ void CalcCharPos(FX_FLOAT* pPosArray) const;
+
+
+
+ void SetData(int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pCharPos, FX_FLOAT x, FX_FLOAT y);
+
+ void GetData(int& nChars, FX_DWORD*& pCharCodes, FX_FLOAT*& pCharPos)
+ {
+ nChars = m_nChars;
+ pCharCodes = m_pCharCodes;
+ pCharPos = m_pCharPos;
+ }
+
+
+ void RecalcPositionData()
+ {
+ CalcPositionData(NULL, NULL, 1);
+ }
+protected:
+ virtual void CopyData(const CPDF_PageObject* pSrcObject);
+
+ FX_FLOAT m_PosX;
+
+ FX_FLOAT m_PosY;
+
+ int m_nChars;
+
+ FX_DWORD* m_pCharCodes;
+
+ FX_FLOAT* m_pCharPos;
+
+ void SetSegments(const CFX_ByteString* pStrs, FX_FLOAT* pKerning, int nSegs);
+
+ void CalcPositionData(FX_FLOAT* pTextAdvanceX, FX_FLOAT* pTextAdvanceY, FX_FLOAT horz_scale, int level = 0);
+ friend class CPDF_StreamContentParser;
+ friend class CPDF_RenderStatus;
+ friend class CPDF_QuickDrawer;
+ friend class CPDF_TextRenderer;
+ friend class CTextPage;
+ friend class CPDF_ContentGenerator;
+};
+class CPDF_PathObject : public CPDF_PageObject
+{
+public:
+
+ CPDF_PathObject()
+ {
+ m_Type = PDFPAGE_PATH;
+ }
+
+ virtual ~CPDF_PathObject() {}
+ virtual void Transform(const CFX_AffineMatrix& maxtrix);
+
+ void SetGraphState(CPDF_GraphState GraphState);
+
+ CPDF_Path m_Path;
+
+ int m_FillType;
+
+ FX_BOOL m_bStroke;
+
+ CFX_AffineMatrix m_Matrix;
+
+
+ void CalcBoundingBox();
+protected:
+ virtual void CopyData(const CPDF_PageObject* pSrcObjet);
+};
+class CPDF_ImageObject : public CPDF_PageObject
+{
+public:
+
+ CPDF_ImageObject();
+
+ virtual ~CPDF_ImageObject();
+ virtual void Transform(const CFX_AffineMatrix& matrix);
+
+ CPDF_Image* m_pImage;
+
+ CFX_AffineMatrix m_Matrix;
+
+ void CalcBoundingBox();
+private:
+ virtual void CopyData(const CPDF_PageObject* pSrcObjet);
+};
+class CPDF_ShadingObject : public CPDF_PageObject
+{
+public:
+
+ CPDF_ShadingObject();
+
+ virtual ~CPDF_ShadingObject();
+
+ CPDF_ShadingPattern* m_pShading;
+
+ CFX_AffineMatrix m_Matrix;
+
+ CPDF_Page* m_pPage;
+ virtual void Transform(const CFX_AffineMatrix& matrix);
+
+ void CalcBoundingBox();
+protected:
+ virtual void CopyData(const CPDF_PageObject* pSrcObjet);
+};
+class CPDF_FormObject : public CPDF_PageObject
+{
+public:
+
+ CPDF_FormObject()
+ {
+ m_Type = PDFPAGE_FORM;
+ m_pForm = NULL;
+ }
+
+ virtual ~CPDF_FormObject();
+ virtual void Transform(const CFX_AffineMatrix& matrix);
+
+ CPDF_Form* m_pForm;
+
+ CFX_AffineMatrix m_FormMatrix;
+
+ void CalcBoundingBox();
+protected:
+ virtual void CopyData(const CPDF_PageObject* pSrcObjet);
+};
+class CPDF_InlineImages : public CPDF_PageObject
+{
+public:
+
+ CPDF_InlineImages();
+
+ virtual ~CPDF_InlineImages();
+
+ CPDF_Stream* m_pStream;
+
+ CFX_DIBitmap* m_pBitmap;
+
+ CFX_ArrayTemplate<CFX_AffineMatrix> m_Matrices;
+
+ void AddMatrix(CFX_AffineMatrix& matrix);
+protected:
+ virtual void Transform(const CFX_AffineMatrix& matrix) {}
+ virtual void CopyData(const CPDF_PageObject* pSrcObjet) {}
+};
+#endif
diff --git a/core/include/fpdfapi/fpdf_parser.h b/core/include/fpdfapi/fpdf_parser.h
index 9d41539d52..c6c80778a1 100644
--- a/core/include/fpdfapi/fpdf_parser.h
+++ b/core/include/fpdfapi/fpdf_parser.h
@@ -1,1149 +1,1149 @@
-// 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 _FPDF_PARSER_
-#define _FPDF_PARSER_
-#ifndef _FX_BASIC_H_
-#include "../fxcrt/fx_ext.h"
-#endif
-#ifndef _FPDF_OBJECTS_
-#include "fpdf_objects.h"
-#endif
-class CPDF_Document;
-class IPDF_DocParser;
-class CPDF_Parser;
-class CPDF_SecurityHandler;
-class CPDF_StandardSecurityHandler;
-class CPDF_CryptoHandler;
-class CPDF_Object;
-class IFX_FileRead;
-class CFDF_Document;
-class CFDF_Parser;
-class CFX_Font;
-class CFX_AffineMatrix;
-class CFX_FloatRect;
-class CPDF_Point;
-class CPDF_DocPageData;
-class CPDF_DocRenderData;
-class CPDF_ModuleMgr;
-class CFX_DIBSource;
-class CPDF_Font;
-class CPDF_Image;
-class CPDF_ColorSpace;
-class CPDF_Pattern;
-class CPDF_FontEncoding;
-class CPDF_IccProfile;
-class CFX_PrivateData;
-#define FPDFPERM_PRINT 0x0004
-#define FPDFPERM_MODIFY 0x0008
-#define FPDFPERM_EXTRACT 0x0010
-#define FPDFPERM_ANNOT_FORM 0x0020
-#define FPDFPERM_FILL_FORM 0x0100
-#define FPDFPERM_EXTRACT_ACCESS 0x0200
-#define FPDFPERM_ASSEMBLE 0x0400
-#define FPDFPERM_PRINT_HIGH 0x0800
-#define FPDF_PAGE_MAX_NUM 0xFFFFF
-class IPDF_EnumPageHandler
-{
-public:
-
- virtual FX_BOOL EnumPage(CPDF_Dictionary* pPageDict) = 0;
-};
-class CPDF_Document : public CFX_PrivateData, public CPDF_IndirectObjects
-{
-public:
-
- CPDF_Document(IPDF_DocParser* pParser);
-
- CPDF_Document();
-
- ~CPDF_Document();
-
- IPDF_DocParser* GetParser() const
- {
- return m_pParser;
- }
-
- CPDF_Dictionary* GetRoot() const
- {
- return m_pRootDict;
- }
-
- CPDF_Dictionary* GetInfo() const
- {
- return m_pInfoDict;
- }
-
- void GetID(CFX_ByteString& id1, CFX_ByteString& id2) const
- {
- id1 = m_ID1;
- id2 = m_ID2;
- }
-
- int GetPageCount() const;
-
- CPDF_Dictionary* GetPage(int iPage);
-
- int GetPageIndex(FX_DWORD objnum);
-
- void EnumPages(IPDF_EnumPageHandler* pHandler);
-
- FX_DWORD GetUserPermissions(FX_BOOL bCheckRevision = FALSE) const;
-
- FX_BOOL IsOwner() const;
-
-
-
- CPDF_DocPageData* GetPageData()
- {
- return GetValidatePageData();
- }
-
- void ClearPageData();
-
- void RemoveColorSpaceFromPageData(CPDF_Object* pObject);
-
-
- CPDF_DocRenderData* GetRenderData()
- {
- return GetValidateRenderData();
- }
-
- void ClearRenderData();
-
- void ClearRenderFont();
-
-
- FX_BOOL IsFormStream(FX_DWORD objnum, FX_BOOL& bForm) const;
-
-
-
-
- CPDF_Font* LoadFont(CPDF_Dictionary* pFontDict);
-
- CPDF_Font* FindFont(CPDF_Dictionary* pFontDict);
-
- CPDF_ColorSpace* LoadColorSpace(CPDF_Object* pCSObj, CPDF_Dictionary* pResources = NULL);
-
- CPDF_Pattern* LoadPattern(CPDF_Object* pObj, FX_BOOL bShading, const CFX_AffineMatrix* matrix = NULL);
-
- CPDF_Image* LoadImageF(CPDF_Object* pObj);
-
- CPDF_StreamAcc* LoadFontFile(CPDF_Stream* pStream);
-
- CPDF_IccProfile* LoadIccProfile(CPDF_Stream* pStream, int nComponents);
-
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
-
- CPDF_Font* AddWindowsFont(LOGFONTA* pLogFont, FX_BOOL bVert, FX_BOOL bTranslateName = FALSE);
- CPDF_Font* AddWindowsFont(LOGFONTW* pLogFont, FX_BOOL bVert, FX_BOOL bTranslateName = FALSE);
-#endif
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
- CPDF_Font* AddMacFont(CTFontRef pFont, FX_BOOL bVert, FX_BOOL bTranslateName = FALSE);
-#endif
-
- CPDF_Font* AddStandardFont(const FX_CHAR* font, CPDF_FontEncoding* pEncoding);
-
-
- CPDF_Font* AddFont(CFX_Font* pFont, int charset, FX_BOOL bVert);
-
- void CreateNewDoc();
-
- CPDF_Dictionary* CreateNewPage(int iPage);
-
- void DeletePage(int iPage);
-
- void LoadDoc();
- void LoadAsynDoc(CPDF_Dictionary *pLinearized);
- void LoadPages();
-protected:
-
- CPDF_Dictionary* m_pRootDict;
-
- CPDF_Dictionary* m_pInfoDict;
-
- CFX_ByteString m_ID1;
-
- CFX_ByteString m_ID2;
-
-
- FX_BOOL m_bLinearized;
-
- FX_DWORD m_dwFirstPageNo;
-
- FX_DWORD m_dwFirstPageObjNum;
-
- CFX_DWordArray m_PageList;
-
- int _GetPageCount() const;
- CPDF_Dictionary* _FindPDFPage(CPDF_Dictionary* pPages, int iPage, int nPagesToGo, int level);
- int _FindPageIndex(CPDF_Dictionary* pNode, FX_DWORD& skip_count, FX_DWORD objnum, int& index, int level = 0);
- FX_BOOL IsContentUsedElsewhere(FX_DWORD objnum, CPDF_Dictionary* pPageDict);
- FX_BOOL CheckOCGVisible(CPDF_Dictionary* pOCG, FX_BOOL bPrinting);
- CPDF_DocPageData* GetValidatePageData();
- CPDF_DocRenderData* GetValidateRenderData();
- friend class CPDF_Creator;
- friend class CPDF_Parser;
- friend class CPDF_DataAvail;
- friend class CPDF_OCContext;
-
-
-
- CPDF_DocPageData* m_pDocPage;
-
- CPDF_DocRenderData* m_pDocRender;
-
-};
-
-#define PDFWORD_EOF 0
-#define PDFWORD_NUMBER 1
-#define PDFWORD_TEXT 2
-#define PDFWORD_DELIMITER 3
-#define PDFWORD_NAME 4
-class CPDF_SimpleParser : public CFX_Object
-{
-public:
-
- CPDF_SimpleParser(FX_LPCBYTE pData, FX_DWORD dwSize);
-
- CPDF_SimpleParser(FX_BSTR str);
-
- CFX_ByteStringC GetWord();
-
- FX_BOOL SearchToken(FX_BSTR token);
-
- FX_BOOL SkipWord(FX_BSTR token);
-
- FX_BOOL FindTagPair(FX_BSTR start_token, FX_BSTR end_token,
- FX_DWORD& start_pos, FX_DWORD& end_pos);
-
- FX_BOOL FindTagParam(FX_BSTR token, int nParams);
-
- FX_DWORD GetPos()
- {
- return m_dwCurPos;
- }
-
- void SetPos(FX_DWORD pos)
- {
- ASSERT(pos <= m_dwSize);
- m_dwCurPos = pos;
- }
-private:
-
- void ParseWord(FX_LPCBYTE& pStart, FX_DWORD& dwSize, int& type);
-
- FX_LPCBYTE m_pData;
-
- FX_DWORD m_dwSize;
-
- FX_DWORD m_dwCurPos;
-};
-class CPDF_SyntaxParser : public CFX_Object
-{
-public:
-
- CPDF_SyntaxParser();
-
- ~CPDF_SyntaxParser();
-
- void InitParser(IFX_FileRead* pFileAccess, FX_DWORD HeaderOffset);
-
- FX_FILESIZE SavePos()
- {
- return m_Pos;
- }
-
- void RestorePos(FX_FILESIZE pos)
- {
- m_Pos = pos;
- }
-
- CPDF_Object* GetObject(CPDF_IndirectObjects* pObjList, FX_DWORD objnum, FX_DWORD gennum, int level, struct PARSE_CONTEXT* pContext = NULL, FX_BOOL bDecrypt = TRUE);
-
-
- CPDF_Object* GetObjectByStrict(CPDF_IndirectObjects* pObjList, FX_DWORD objnum, FX_DWORD gennum, int level, struct PARSE_CONTEXT* pContext = NULL);
-
- int GetDirectNum();
-
- CFX_ByteString GetString(FX_DWORD objnum, FX_DWORD gennum);
-
- CFX_ByteString GetName();
-
- CFX_ByteString GetKeyword();
-
- void GetBinary(FX_BYTE* buffer, FX_DWORD size);
-
- void ToNextLine();
-
- void ToNextWord();
-
- FX_BOOL SearchWord(FX_BSTR word, FX_BOOL bWholeWord, FX_BOOL bForward, FX_FILESIZE limit);
-
- int SearchMultiWord(FX_BSTR words, FX_BOOL bWholeWord, FX_FILESIZE limit);
-
- FX_FILESIZE FindTag(FX_BSTR tag, FX_FILESIZE limit);
-
- void SetEncrypt(CPDF_CryptoHandler* pCryptoHandler)
- {
- m_pCryptoHandler = pCryptoHandler;
- }
-
- FX_BOOL IsEncrypted()
- {
- return m_pCryptoHandler != NULL;
- }
-
- FX_BOOL GetCharAt(FX_FILESIZE pos, FX_BYTE& ch);
-
- FX_BOOL ReadBlock(FX_BYTE* pBuf, FX_DWORD size);
-
- CFX_ByteString GetNextWord(FX_BOOL& bIsNumber);
-protected:
-
- virtual FX_BOOL GetNextChar(FX_BYTE& ch);
-
- FX_BOOL GetCharAtBackward(FX_FILESIZE pos, FX_BYTE& ch);
-
- void GetNextWord();
-
- FX_BOOL IsWholeWord(FX_FILESIZE startpos, FX_FILESIZE limit, FX_LPCBYTE tag, FX_DWORD taglen);
-
- CFX_ByteString ReadString();
-
- CFX_ByteString ReadHexString();
-
- CPDF_Stream* ReadStream(CPDF_Dictionary* pDict, PARSE_CONTEXT* pContext, FX_DWORD objnum, FX_DWORD gennum);
-
- FX_FILESIZE m_Pos;
-
- FX_BOOL m_bFileStream;
-
- int m_MetadataObjnum;
-
- IFX_FileRead* m_pFileAccess;
-
- FX_DWORD m_HeaderOffset;
-
- FX_FILESIZE m_FileLen;
-
- FX_BYTE* m_pFileBuf;
-
- FX_DWORD m_BufSize;
-
- FX_FILESIZE m_BufOffset;
-
- CPDF_CryptoHandler* m_pCryptoHandler;
-
- FX_BYTE m_WordBuffer[257];
-
- FX_DWORD m_WordSize;
-
- FX_BOOL m_bIsNumber;
-
- FX_FILESIZE m_dwWordPos;
- friend class CPDF_Parser;
- friend class CPDF_DataAvail;
-};
-
-#define PDFPARSE_TYPEONLY 1
-#define PDFPARSE_NOSTREAM 2
-struct PARSE_CONTEXT {
-
- FX_BOOL m_Flags;
-
- FX_FILESIZE m_DictStart;
-
- FX_FILESIZE m_DictEnd;
-
- FX_FILESIZE m_DataStart;
-
- FX_FILESIZE m_DataEnd;
-};
-class IPDF_DocParser : public CFX_Object
-{
-public:
-
- virtual FX_DWORD GetRootObjNum() = 0;
-
- virtual FX_DWORD GetInfoObjNum() = 0;
-
- virtual CPDF_Object* ParseIndirectObject(CPDF_IndirectObjects* pObjList, FX_DWORD objnum, PARSE_CONTEXT* pContext = NULL) = 0;
-
- virtual FX_DWORD GetLastObjNum() = 0;
-
- virtual CPDF_Array* GetIDArray() = 0;
-
- virtual CPDF_Dictionary* GetEncryptDict() = 0;
-
- FX_BOOL IsEncrypted()
- {
- return GetEncryptDict() != NULL;
- }
-
- virtual FX_DWORD GetPermissions(FX_BOOL bCheckRevision = FALSE) = 0;
-
- virtual FX_BOOL IsOwner() = 0;
-
- virtual FX_BOOL IsFormStream(FX_DWORD objnum, FX_BOOL& bForm) = 0;
-};
-
-#define PDFPARSE_ERROR_SUCCESS 0
-#define PDFPARSE_ERROR_FILE 1
-#define PDFPARSE_ERROR_FORMAT 2
-#define PDFPARSE_ERROR_PASSWORD 3
-#define PDFPARSE_ERROR_HANDLER 4
-#define PDFPARSE_ERROR_CERT 5
-class CPDF_Parser : public IPDF_DocParser
-{
-public:
-
- CPDF_Parser();
-
- ~CPDF_Parser();
-
- FX_DWORD StartParse(FX_LPCSTR filename, FX_BOOL bReParse = FALSE);
-
- FX_DWORD StartParse(FX_LPCWSTR filename, FX_BOOL bReParse = FALSE);
-
- FX_DWORD StartParse(IFX_FileRead* pFile, FX_BOOL bReParse = FALSE, FX_BOOL bOwnFileRead = TRUE);
-
- void CloseParser(FX_BOOL bReParse = FALSE);
-
- virtual FX_DWORD GetPermissions(FX_BOOL bCheckRevision = FALSE);
-
- virtual FX_BOOL IsOwner();
-
- void SetPassword(const FX_CHAR* password)
- {
- m_Password = password;
- }
-
- CFX_ByteString GetPassword()
- {
- return m_Password;
- }
-
- CPDF_SecurityHandler* GetSecurityHandler()
- {
- return m_pSecurityHandler;
- }
-
- CPDF_CryptoHandler* GetCryptoHandler()
- {
- return m_Syntax.m_pCryptoHandler;
- }
-
- void SetSecurityHandler(CPDF_SecurityHandler* pSecurityHandler, FX_BOOL bForced = FALSE);
-
- CFX_ByteString GetRecipient()
- {
- return m_bsRecipient;
- }
-
- CPDF_Dictionary* GetTrailer()
- {
- return m_pTrailer;
- }
-
- FX_FILESIZE GetLastXRefOffset()
- {
- return m_LastXRefOffset;
- }
-
- CPDF_Document* GetDocument()
- {
- return m_pDocument;
- }
- CFX_ArrayTemplate<CPDF_Dictionary *> * GetOtherTrailers()
- {
- return &m_Trailers;
- }
-
- virtual FX_DWORD GetRootObjNum();
- virtual FX_DWORD GetInfoObjNum();
- virtual CPDF_Array* GetIDArray();
- virtual CPDF_Dictionary* GetEncryptDict()
- {
- return m_pEncryptDict;
- }
- virtual CPDF_Object* ParseIndirectObject(CPDF_IndirectObjects* pObjList, FX_DWORD objnum, PARSE_CONTEXT* pContext = NULL);
- virtual FX_DWORD GetLastObjNum();
- virtual FX_BOOL IsFormStream(FX_DWORD objnum, FX_BOOL& bForm);
-
- FX_FILESIZE GetObjectOffset(FX_DWORD objnum);
-
- FX_FILESIZE GetObjectSize(FX_DWORD objnum);
-
- int GetObjectVersion(FX_DWORD objnum)
- {
- return m_ObjVersion[objnum];
- }
-
- void GetIndirectBinary(FX_DWORD objnum, FX_BYTE*& pBuffer, FX_DWORD& size);
-
- FX_BOOL GetFileStreamOption()
- {
- return m_Syntax.m_bFileStream;
- }
-
- void SetFileStreamOption(FX_BOOL b)
- {
- m_Syntax.m_bFileStream = b;
- }
-
- IFX_FileRead* GetFileAccess() const
- {
- return m_Syntax.m_pFileAccess;
- }
-
- int GetFileVersion() const
- {
- return m_FileVersion;
- }
-
- FX_BOOL IsXRefStream() const
- {
- return m_bXRefStream;
- }
- CPDF_Object* ParseIndirectObjectAt(CPDF_IndirectObjects* pObjList, FX_FILESIZE pos, FX_DWORD objnum,
- struct PARSE_CONTEXT* pContext);
-
- CPDF_Object* ParseIndirectObjectAtByStrict(CPDF_IndirectObjects* pObjList, FX_FILESIZE pos, FX_DWORD objnum,
- struct PARSE_CONTEXT* pContext, FX_FILESIZE *pResultPos);
-
- FX_DWORD StartAsynParse(IFX_FileRead* pFile, FX_BOOL bReParse = FALSE, FX_BOOL bOwnFileRead = TRUE);
-
- FX_DWORD GetFirstPageNo()
- {
- return m_dwFirstPageNo;
- }
-protected:
-
- CPDF_Document* m_pDocument;
-
- CPDF_SyntaxParser m_Syntax;
- FX_BOOL m_bOwnFileRead;
- CPDF_Object* ParseDirect(CPDF_Object* pObj);
-
- FX_BOOL LoadAllCrossRefV4(FX_FILESIZE pos);
-
- FX_BOOL LoadAllCrossRefV5(FX_FILESIZE pos);
-
- FX_BOOL LoadCrossRefV4(FX_FILESIZE pos, FX_FILESIZE streampos, FX_BOOL bSkip, FX_BOOL bFirst);
-
- FX_BOOL LoadCrossRefV5(FX_FILESIZE pos, FX_FILESIZE& prev, FX_BOOL bMainXRef);
-
- CPDF_Dictionary* LoadTrailerV4();
-
- FX_BOOL RebuildCrossRef();
-
- FX_DWORD SetEncryptHandler();
-
- void ReleaseEncryptHandler();
-
- FX_BOOL LoadLinearizedAllCrossRefV4(FX_FILESIZE pos, FX_DWORD dwObjCount);
-
- FX_BOOL LoadLinearizedCrossRefV4(FX_FILESIZE pos, FX_DWORD dwObjCount);
-
- FX_BOOL LoadLinearizedAllCrossRefV5(FX_FILESIZE pos);
-
- FX_DWORD LoadLinearizedMainXRefTable();
-
- CFX_MapPtrToPtr m_ObjectStreamMap;
-
- CPDF_StreamAcc* GetObjectStream(FX_DWORD number);
-
- FX_BOOL IsLinearizedFile(IFX_FileRead* pFileAccess, FX_DWORD offset);
-
-
-
- int m_FileVersion;
-
- CPDF_Dictionary* m_pTrailer;
-
- CPDF_Dictionary* m_pEncryptDict;
- void SetEncryptDictionary(CPDF_Dictionary* pDict);
-
- FX_FILESIZE m_LastXRefOffset;
-
- FX_BOOL m_bXRefStream;
-
-
- CPDF_SecurityHandler* m_pSecurityHandler;
-
- FX_BOOL m_bForceUseSecurityHandler;
-
- CFX_ByteString m_bsRecipient;
-
- CFX_ByteString m_FilePath;
-
- CFX_ByteString m_Password;
-
- CFX_FileSizeArray m_CrossRef;
-
- CFX_ByteArray m_V5Type;
-
- CFX_FileSizeArray m_SortedOffset;
-
- CFX_WordArray m_ObjVersion;
- CFX_ArrayTemplate<CPDF_Dictionary *> m_Trailers;
-
- FX_BOOL m_bVersionUpdated;
-
- CPDF_Object* m_pLinearized;
-
- FX_DWORD m_dwFirstPageNo;
-
- FX_DWORD m_dwXrefStartObjNum;
- friend class CPDF_Creator;
- friend class CPDF_DataAvail;
-};
-#define FXCIPHER_NONE 0
-#define FXCIPHER_RC4 1
-#define FXCIPHER_AES 2
-#define FXCIPHER_AES2 3
-class CPDF_SecurityHandler : public CFX_Object
-{
-public:
-
- virtual ~CPDF_SecurityHandler() {}
-
- virtual FX_BOOL OnInit(CPDF_Parser* pParser, CPDF_Dictionary* pEncryptDict) = 0;
-
- virtual FX_DWORD GetPermissions() = 0;
-
- virtual FX_BOOL IsOwner() = 0;
-
- virtual FX_BOOL GetCryptInfo(int& cipher, FX_LPCBYTE& buffer, int& keylen) = 0;
-
- virtual FX_BOOL IsMetadataEncrypted()
- {
- return TRUE;
- }
-
- virtual CPDF_CryptoHandler* CreateCryptoHandler() = 0;
-
- virtual CPDF_StandardSecurityHandler* GetStandardHandler()
- {
- return NULL;
- }
-};
-#define PDF_ENCRYPT_CONTENT 0
-class CPDF_StandardSecurityHandler : public CPDF_SecurityHandler
-{
-public:
- CPDF_StandardSecurityHandler();
-
- virtual ~CPDF_StandardSecurityHandler();
- virtual FX_BOOL OnInit(CPDF_Parser* pParser, CPDF_Dictionary* pEncryptDict);
- virtual FX_DWORD GetPermissions();
- virtual FX_BOOL IsOwner()
- {
- return m_bOwner;
- }
- virtual FX_BOOL GetCryptInfo(int& cipher, FX_LPCBYTE& buffer, int& keylen);
- virtual FX_BOOL IsMetadataEncrypted();
- virtual CPDF_CryptoHandler* CreateCryptoHandler();
- virtual CPDF_StandardSecurityHandler* GetStandardHandler()
- {
- return this;
- }
-
- void OnCreate(CPDF_Dictionary* pEncryptDict, CPDF_Array* pIdArray,
- FX_LPCBYTE user_pass, FX_DWORD user_size,
- FX_LPCBYTE owner_pass, FX_DWORD owner_size, FX_DWORD type = PDF_ENCRYPT_CONTENT);
-
- void OnCreate(CPDF_Dictionary* pEncryptDict, CPDF_Array* pIdArray,
- FX_LPCBYTE user_pass, FX_DWORD user_size, FX_DWORD type = PDF_ENCRYPT_CONTENT);
-
- CFX_ByteString GetUserPassword(FX_LPCBYTE owner_pass, FX_DWORD pass_size);
- CFX_ByteString GetUserPassword(FX_LPCBYTE owner_pass, FX_DWORD pass_size, FX_INT32 key_len);
- int GetVersion()
- {
- return m_Version;
- }
- int GetRevision()
- {
- return m_Revision;
- }
-
- int CheckPassword(FX_LPCBYTE password, FX_DWORD pass_size, FX_BOOL bOwner, FX_LPBYTE key);
- int CheckPassword(FX_LPCBYTE password, FX_DWORD pass_size, FX_BOOL bOwner, FX_LPBYTE key, int key_len);
-private:
-
- int m_Version;
-
- int m_Revision;
-
- CPDF_Parser* m_pParser;
-
- CPDF_Dictionary* m_pEncryptDict;
-
- FX_BOOL LoadDict(CPDF_Dictionary* pEncryptDict);
- FX_BOOL LoadDict(CPDF_Dictionary* pEncryptDict, FX_DWORD type, int& cipher, int& key_len);
-
- FX_BOOL CheckUserPassword(FX_LPCBYTE password, FX_DWORD pass_size,
- FX_BOOL bIgnoreEncryptMeta, FX_LPBYTE key, FX_INT32 key_len);
-
- FX_BOOL CheckOwnerPassword(FX_LPCBYTE password, FX_DWORD pass_size, FX_LPBYTE key, FX_INT32 key_len);
- FX_BOOL AES256_CheckPassword(FX_LPCBYTE password, FX_DWORD size, FX_BOOL bOwner, FX_LPBYTE key);
- void AES256_SetPassword(CPDF_Dictionary* pEncryptDict, FX_LPCBYTE password, FX_DWORD size, FX_BOOL bOwner, FX_LPCBYTE key);
- void AES256_SetPerms(CPDF_Dictionary* pEncryptDict, FX_DWORD permission, FX_BOOL bEncryptMetadata, FX_LPCBYTE key);
- void OnCreate(CPDF_Dictionary* pEncryptDict, CPDF_Array* pIdArray,
- FX_LPCBYTE user_pass, FX_DWORD user_size,
- FX_LPCBYTE owner_pass, FX_DWORD owner_size, FX_BOOL bDefault, FX_DWORD type);
- FX_BOOL CheckSecurity(FX_INT32 key_len);
-
- FX_BOOL m_bOwner;
-
- FX_DWORD m_Permissions;
-
- int m_Cipher;
-
- FX_BYTE m_EncryptKey[32];
-
- int m_KeyLen;
-};
-class CPDF_CryptoHandler : public CFX_Object
-{
-public:
-
- virtual ~CPDF_CryptoHandler() {}
-
- virtual FX_BOOL Init(CPDF_Dictionary* pEncryptDict, CPDF_SecurityHandler* pSecurityHandler) = 0;
-
- virtual FX_DWORD DecryptGetSize(FX_DWORD src_size) = 0;
-
- virtual FX_LPVOID DecryptStart(FX_DWORD objnum, FX_DWORD gennum) = 0;
-
- virtual FX_BOOL DecryptStream(FX_LPVOID context, FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf) = 0;
-
- virtual FX_BOOL DecryptFinish(FX_LPVOID context, CFX_BinaryBuf& dest_buf) = 0;
-
-
- virtual FX_DWORD EncryptGetSize(FX_DWORD objnum, FX_DWORD version, FX_LPCBYTE src_buf, FX_DWORD src_size) = 0;
-
- virtual FX_BOOL EncryptContent(FX_DWORD objnum, FX_DWORD version, FX_LPCBYTE src_buf, FX_DWORD src_size,
- FX_LPBYTE dest_buf, FX_DWORD& dest_size) = 0;
-
- void Decrypt(FX_DWORD objnum, FX_DWORD version, CFX_ByteString& str);
-};
-class CPDF_StandardCryptoHandler : public CPDF_CryptoHandler
-{
-public:
-
- CPDF_StandardCryptoHandler();
-
- virtual ~CPDF_StandardCryptoHandler();
-
- FX_BOOL Init(int cipher, FX_LPCBYTE key, int keylen);
- virtual FX_BOOL Init(CPDF_Dictionary* pEncryptDict, CPDF_SecurityHandler* pSecurityHandler);
- virtual FX_DWORD DecryptGetSize(FX_DWORD src_size);
- virtual FX_LPVOID DecryptStart(FX_DWORD objnum, FX_DWORD gennum);
- virtual FX_BOOL DecryptStream(FX_LPVOID context, FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf);
- virtual FX_BOOL DecryptFinish(FX_LPVOID context, CFX_BinaryBuf& dest_buf);
- virtual FX_DWORD EncryptGetSize(FX_DWORD objnum, FX_DWORD version, FX_LPCBYTE src_buf, FX_DWORD src_size);
- virtual FX_BOOL EncryptContent(FX_DWORD objnum, FX_DWORD version, FX_LPCBYTE src_buf, FX_DWORD src_size,
- FX_LPBYTE dest_buf, FX_DWORD& dest_size);
-protected:
-
- virtual void CryptBlock(FX_BOOL bEncrypt, FX_DWORD objnum, FX_DWORD gennum, FX_LPCBYTE src_buf, FX_DWORD src_size,
- FX_LPBYTE dest_buf, FX_DWORD& dest_size);
- virtual FX_LPVOID CryptStart(FX_DWORD objnum, FX_DWORD gennum, FX_BOOL bEncrypt);
- virtual FX_BOOL CryptStream(FX_LPVOID context, FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf, FX_BOOL bEncrypt);
- virtual FX_BOOL CryptFinish(FX_LPVOID context, CFX_BinaryBuf& dest_buf, FX_BOOL bEncrypt);
-
- FX_BYTE m_EncryptKey[32];
-
- int m_KeyLen;
-
- int m_Cipher;
-
- FX_LPBYTE m_pAESContext;
-};
-class CPDF_Point : public CFX_Object
-{
-public:
-
- CPDF_Point(FX_FLOAT xx, FX_FLOAT yy)
- {
- x = xx;
- y = yy;
- }
-
- FX_FLOAT x;
-
- FX_FLOAT y;
-};
-
-#define CPDF_Rect CFX_FloatRect
-#define CPDF_Matrix CFX_AffineMatrix
-CFX_ByteString PDF_NameDecode(FX_BSTR orig);
-CFX_ByteString PDF_NameDecode(const CFX_ByteString& orig);
-CFX_ByteString PDF_NameEncode(const CFX_ByteString& orig);
-CFX_ByteString PDF_EncodeString(const CFX_ByteString& src, FX_BOOL bHex = FALSE);
-CFX_WideString PDF_DecodeText(const CFX_ByteString& str, CFX_CharMap* pCharMap = NULL);
-CFX_WideString PDF_DecodeText(FX_LPCBYTE pData, FX_DWORD size, CFX_CharMap* pCharMap = NULL);
-CFX_ByteString PDF_EncodeText(FX_LPCWSTR pString, int len = -1, CFX_CharMap* pCharMap = NULL);
-FX_FLOAT PDF_ClipFloat(FX_FLOAT f);
-class CFDF_Document : public CPDF_IndirectObjects
-{
-public:
-
- static CFDF_Document* CreateNewDoc();
-
- static CFDF_Document* ParseFile(FX_LPCSTR file_path);
-
- static CFDF_Document* ParseFile(FX_LPCWSTR file_path);
-
- static CFDF_Document* ParseFile(IFX_FileRead *pFile, FX_BOOL bOwnFile = FALSE);
-
- static CFDF_Document* ParseMemory(FX_LPCBYTE pData, FX_DWORD size);
-
- ~CFDF_Document();
-
- FX_BOOL WriteFile(FX_LPCSTR file_path) const;
-
- FX_BOOL WriteFile(FX_LPCWSTR file_path) const;
-
- FX_BOOL WriteFile(IFX_FileWrite *pFile) const;
-
- FX_BOOL WriteBuf(CFX_ByteTextBuf& buf) const;
-
- CPDF_Dictionary* GetRoot() const
- {
- return m_pRootDict;
- }
-
- CFX_WideString GetWin32Path() const;
-protected:
-
- CFDF_Document();
- void ParseStream(IFX_FileRead *pFile, FX_BOOL bOwnFile);
- CPDF_Dictionary* m_pRootDict;
- IFX_FileRead* m_pFile;
- FX_BOOL m_bOwnFile;
-};
-
-CFX_WideString FPDF_FileSpec_GetWin32Path(const CPDF_Object* pFileSpec);
-void FPDF_FileSpec_SetWin32Path(CPDF_Object* pFileSpec, const CFX_WideString& fullpath);
-
-void FlateEncode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size);
-FX_DWORD FlateDecode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size);
-FX_DWORD RunLengthDecode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size);
-class CPDF_NumberTree : public CFX_Object
-{
-public:
-
- CPDF_NumberTree(CPDF_Dictionary* pRoot)
- {
- m_pRoot = pRoot;
- }
-
- CPDF_Object* LookupValue(int num);
-protected:
-
- CPDF_Dictionary* m_pRoot;
-};
-
-class IFX_FileAvail
-{
-public:
-
- virtual FX_BOOL IsDataAvail( FX_FILESIZE offset, FX_DWORD size) = 0;
-};
-class IFX_DownloadHints
-{
-public:
-
- virtual void AddSegment(FX_FILESIZE offset, FX_DWORD size) = 0;
-};
-#define PDF_IS_LINEARIZED 1
-#define PDF_NOT_LINEARIZED 0
-#define PDF_UNKNOW_LINEARIZED -1
-#define PDFFORM_NOTAVAIL 0
-#define PDFFORM_AVAIL 1
-#define PDFFORM_NOTEXIST 2
-class IPDF_DataAvail
-{
-public:
-
- virtual FX_BOOL IsDocAvail(IFX_DownloadHints* pHints) = 0;
-
-
- virtual void SetDocument(CPDF_Document* pDoc) = 0;
-
-
- virtual FX_BOOL IsPageAvail(int iPage, IFX_DownloadHints* pHints) = 0;
-
- virtual FX_BOOL IsLinearized() = 0;
-
- virtual FX_INT32 IsFormAvail(IFX_DownloadHints *pHints) = 0;
-
- virtual FX_INT32 IsLinearizedPDF() = 0;
-
- virtual void GetLinearizedMainXRefInfo(FX_FILESIZE *pPos, FX_DWORD *pSize) = 0;
-};
-class CPDF_SortObjNumArray : public CFX_Object
-{
-public:
-
- void AddObjNum(FX_DWORD dwObjNum);
-
- FX_BOOL Find(FX_DWORD dwObjNum);
-
- void RemoveAll()
- {
- m_number_array.RemoveAll();
- }
-protected:
-
- FX_BOOL BinarySearch(FX_DWORD value, int &iNext);
-protected:
-
- CFX_DWordArray m_number_array;
-};
-enum PDF_PAGENODE_TYPE {
- PDF_PAGENODE_UNKOWN = 0,
- PDF_PAGENODE_PAGE,
- PDF_PAGENODE_PAGES,
- PDF_PAGENODE_ARRAY,
-};
-class CPDF_PageNode : public CFX_Object
-{
-public:
- CPDF_PageNode() : m_type(PDF_PAGENODE_UNKOWN) {}
- ~CPDF_PageNode();
- PDF_PAGENODE_TYPE m_type;
- FX_DWORD m_dwPageNo;
- CFX_PtrArray m_childNode;
-};
-enum PDF_DATAAVAIL_STATUS {
- PDF_DATAAVAIL_HEADER = 0,
- PDF_DATAAVAIL_FIRSTPAGE,
- PDF_DATAAVAIL_FIRSTPAGE_PREPARE,
- PDF_DATAAVAIL_END,
- PDF_DATAAVAIL_CROSSREF,
- PDF_DATAAVAIL_CROSSREF_ITEM,
- PDF_DATAAVAIL_CROSSREF_STREAM,
- PDF_DATAAVAIL_TRAILER,
- PDF_DATAAVAIL_LOADALLCRSOSSREF,
- PDF_DATAAVAIL_ROOT,
- PDF_DATAAVAIL_INFO,
- PDF_DATAAVAIL_ACROFORM,
- PDF_DATAAVAIL_ACROFORM_SUBOBJECT,
- PDF_DATAAVAIL_PAGETREE,
- PDF_DATAAVAIL_PAGE,
- PDF_DATAAVAIL_PAGE_LATERLOAD,
- PDF_DATAAVAIL_RESOURCES,
- PDF_DATAAVAIL_DONE,
- PDF_DATAAVAIL_ERROR,
- PDF_DATAAVAIL_LOADALLFILE,
- PDF_DATAAVAIL_TRAILER_APPEND
-};
-class CPDF_DataAvail : public CFX_Object, public IPDF_DataAvail
-{
-public:
-
- CPDF_DataAvail(IFX_FileAvail* pFileAvail, IFX_FileRead* pFileRead);
- ~CPDF_DataAvail();
-
- virtual FX_BOOL IsDocAvail(IFX_DownloadHints* pHints);
-
-
- virtual void SetDocument(CPDF_Document* pDoc);
-
-
- virtual FX_BOOL IsPageAvail(int iPage, IFX_DownloadHints* pHints);
-
- virtual FX_INT32 IsFormAvail(IFX_DownloadHints *pHints);
-
- virtual FX_INT32 IsLinearizedPDF();
-
- virtual FX_BOOL IsLinearized()
- {
- return m_bLinearized;
- }
-
- virtual void GetLinearizedMainXRefInfo(FX_FILESIZE *pPos, FX_DWORD *pSize);
- IFX_FileRead* GetFileRead() const
- {
- return m_pFileRead;
- }
- IFX_FileAvail* GetFileAvail() const
- {
- return m_pFileAvail;
- }
-protected:
- FX_DWORD GetObjectSize(FX_DWORD objnum, FX_FILESIZE& offset);
- FX_BOOL IsObjectsAvail(CFX_PtrArray& obj_array, FX_BOOL bParsePage, IFX_DownloadHints* pHints, CFX_PtrArray &ret_array);
- FX_BOOL CheckDocStatus(IFX_DownloadHints *pHints);
- FX_BOOL CheckHeader(IFX_DownloadHints* pHints);
- FX_BOOL CheckFirstPage(IFX_DownloadHints *pHints);
- FX_BOOL CheckEnd(IFX_DownloadHints *pHints);
- FX_BOOL CheckCrossRef(IFX_DownloadHints* pHints);
- FX_BOOL CheckCrossRefItem(IFX_DownloadHints *pHints);
- FX_BOOL CheckTrailer(IFX_DownloadHints* pHints);
- FX_BOOL CheckRoot(IFX_DownloadHints* pHints);
- FX_BOOL CheckInfo(IFX_DownloadHints* pHints);
- FX_BOOL CheckPages(IFX_DownloadHints* pHints);
- FX_BOOL CheckPage(IFX_DownloadHints* pHints);
- FX_BOOL CheckResources(IFX_DownloadHints* pHints);
- FX_BOOL CheckAnnots(IFX_DownloadHints* pHints);
- FX_BOOL CheckAcroForm(IFX_DownloadHints* pHints);
- FX_BOOL CheckAcroFormSubObject(IFX_DownloadHints* pHints);
- FX_BOOL CheckTrailerAppend(IFX_DownloadHints* pHints);
- FX_BOOL CheckPageStatus(IFX_DownloadHints* pHints);
- FX_BOOL CheckAllCrossRefStream(IFX_DownloadHints *pHints);
-
- FX_DWORD CheckCrossRefStream(IFX_DownloadHints *pHints, FX_FILESIZE &xref_offset);
- FX_BOOL IsLinearizedFile(FX_LPBYTE pData, FX_DWORD dwLen);
- void SetStartOffset(FX_FILESIZE dwOffset);
- FX_BOOL GetNextToken(CFX_ByteString &token);
- FX_BOOL GetNextChar(FX_BYTE &ch);
- CPDF_Object * ParseIndirectObjectAt(FX_FILESIZE pos, FX_DWORD objnum);
- CPDF_Object * GetObject(FX_DWORD objnum, IFX_DownloadHints* pHints, FX_BOOL *pExistInFile);
- FX_BOOL GetPageKids(CPDF_Parser *pParser, CPDF_Object *pPages);
- FX_BOOL PreparePageItem();
- FX_BOOL LoadPages(IFX_DownloadHints* pHints);
- FX_BOOL LoadAllXref(IFX_DownloadHints* pHints);
- FX_BOOL LoadAllFile(IFX_DownloadHints* pHints);
- FX_BOOL CheckLinearizedData(IFX_DownloadHints* pHints);
- FX_BOOL CheckFileResources(IFX_DownloadHints* pHints);
- FX_BOOL CheckPageAnnots(int iPage, IFX_DownloadHints* pHints);
-
- FX_BOOL CheckLinearizedFirstPage(int iPage, IFX_DownloadHints* pHints);
- FX_BOOL HaveResourceAncestor(CPDF_Dictionary *pDict);
- FX_BOOL CheckPage(FX_INT32 iPage, IFX_DownloadHints* pHints);
- FX_BOOL LoadDocPages(IFX_DownloadHints* pHints);
- FX_BOOL LoadDocPage(FX_INT32 iPage, IFX_DownloadHints* pHints);
- FX_BOOL CheckPageNode(CPDF_PageNode &pageNodes, FX_INT32 iPage, FX_INT32 &iCount, IFX_DownloadHints* pHints);
- FX_BOOL CheckUnkownPageNode(FX_DWORD dwPageNo, CPDF_PageNode *pPageNode, IFX_DownloadHints* pHints);
- FX_BOOL CheckArrayPageNode(FX_DWORD dwPageNo, CPDF_PageNode *pPageNode, IFX_DownloadHints* pHints);
- FX_BOOL CheckPageCount(IFX_DownloadHints* pHints);
- FX_BOOL IsFirstCheck(int iPage);
- void ResetFirstCheck(int iPage);
-
- CPDF_Parser m_parser;
-
- CPDF_SyntaxParser m_syntaxParser;
-
- CPDF_Object *m_pRoot;
-
- FX_DWORD m_dwRootObjNum;
-
- FX_DWORD m_dwInfoObjNum;
-
- CPDF_Object *m_pLinearized;
-
- CPDF_Object *m_pTrailer;
-
- FX_BOOL m_bDocAvail;
-
- FX_FILESIZE m_dwHeaderOffset;
-
- FX_FILESIZE m_dwLastXRefOffset;
-
- FX_FILESIZE m_dwXRefOffset;
-
- FX_FILESIZE m_dwTrailerOffset;
-
- FX_FILESIZE m_dwCurrentOffset;
-
- PDF_DATAAVAIL_STATUS m_docStatus;
-
- IFX_FileAvail* m_pFileAvail;
-
- IFX_FileRead* m_pFileRead;
-
- FX_FILESIZE m_dwFileLen;
-
- CPDF_Document* m_pDocument;
-
- CPDF_SortObjNumArray m_objnum_array;
-
- CFX_PtrArray m_objs_array;
-
- FX_FILESIZE m_Pos;
-
- FX_FILESIZE m_bufferOffset;
-
- FX_DWORD m_bufferSize;
-
- CFX_ByteString m_WordBuf;
-
- FX_BYTE m_WordBuffer[257];
-
- FX_DWORD m_WordSize;
-
- FX_BYTE m_bufferData[512];
-
- CFX_FileSizeArray m_CrossOffset;
-
- CFX_DWordArray m_XRefStreamList;
-
- CFX_DWordArray m_PageObjList;
-
- FX_DWORD m_PagesObjNum;
-
- FX_BOOL m_bLinearized;
-
- FX_DWORD m_dwFirstPageNo;
-
- FX_BOOL m_bLinearedDataOK;
-
- FX_BOOL m_bMainXRefLoad;
-
- FX_BOOL m_bMainXRefLoadedOK;
-
- FX_BOOL m_bPagesTreeLoad;
-
- FX_BOOL m_bPagesLoad;
-
- CPDF_Parser * m_pCurrentParser;
-
- FX_FILESIZE m_dwCurrentXRefSteam;
-
- FX_BOOL m_bAnnotsLoad;
-
- FX_BOOL m_bHaveAcroForm;
-
- FX_DWORD m_dwAcroFormObjNum;
-
- FX_BOOL m_bAcroFormLoad;
-
- CPDF_Object * m_pAcroForm;
-
- CFX_PtrArray m_arrayAcroforms;
-
- CPDF_Dictionary * m_pPageDict;
-
- CPDF_Object * m_pPageResource;
-
- FX_BOOL m_bNeedDownLoadResource;
-
- FX_BOOL m_bPageLoadedOK;
-
- FX_BOOL m_bLinearizedFormParamLoad;
-
- CFX_PtrArray m_PagesArray;
-
- FX_DWORD m_dwEncryptObjNum;
-
- FX_FILESIZE m_dwPrevXRefOffset;
-
- FX_BOOL m_bTotalLoadPageTree;
-
- FX_BOOL m_bCurPageDictLoadOK;
-
- CPDF_PageNode m_pageNodes;
-
- CFX_CMapDWordToDWord * m_pageMapCheckState;
-
- CFX_CMapDWordToDWord * m_pagesLoadState;
-};
-#endif
+// 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 _FPDF_PARSER_
+#define _FPDF_PARSER_
+#ifndef _FX_BASIC_H_
+#include "../fxcrt/fx_ext.h"
+#endif
+#ifndef _FPDF_OBJECTS_
+#include "fpdf_objects.h"
+#endif
+class CPDF_Document;
+class IPDF_DocParser;
+class CPDF_Parser;
+class CPDF_SecurityHandler;
+class CPDF_StandardSecurityHandler;
+class CPDF_CryptoHandler;
+class CPDF_Object;
+class IFX_FileRead;
+class CFDF_Document;
+class CFDF_Parser;
+class CFX_Font;
+class CFX_AffineMatrix;
+class CFX_FloatRect;
+class CPDF_Point;
+class CPDF_DocPageData;
+class CPDF_DocRenderData;
+class CPDF_ModuleMgr;
+class CFX_DIBSource;
+class CPDF_Font;
+class CPDF_Image;
+class CPDF_ColorSpace;
+class CPDF_Pattern;
+class CPDF_FontEncoding;
+class CPDF_IccProfile;
+class CFX_PrivateData;
+#define FPDFPERM_PRINT 0x0004
+#define FPDFPERM_MODIFY 0x0008
+#define FPDFPERM_EXTRACT 0x0010
+#define FPDFPERM_ANNOT_FORM 0x0020
+#define FPDFPERM_FILL_FORM 0x0100
+#define FPDFPERM_EXTRACT_ACCESS 0x0200
+#define FPDFPERM_ASSEMBLE 0x0400
+#define FPDFPERM_PRINT_HIGH 0x0800
+#define FPDF_PAGE_MAX_NUM 0xFFFFF
+class IPDF_EnumPageHandler
+{
+public:
+
+ virtual FX_BOOL EnumPage(CPDF_Dictionary* pPageDict) = 0;
+};
+class CPDF_Document : public CFX_PrivateData, public CPDF_IndirectObjects
+{
+public:
+
+ CPDF_Document(IPDF_DocParser* pParser);
+
+ CPDF_Document();
+
+ ~CPDF_Document();
+
+ IPDF_DocParser* GetParser() const
+ {
+ return m_pParser;
+ }
+
+ CPDF_Dictionary* GetRoot() const
+ {
+ return m_pRootDict;
+ }
+
+ CPDF_Dictionary* GetInfo() const
+ {
+ return m_pInfoDict;
+ }
+
+ void GetID(CFX_ByteString& id1, CFX_ByteString& id2) const
+ {
+ id1 = m_ID1;
+ id2 = m_ID2;
+ }
+
+ int GetPageCount() const;
+
+ CPDF_Dictionary* GetPage(int iPage);
+
+ int GetPageIndex(FX_DWORD objnum);
+
+ void EnumPages(IPDF_EnumPageHandler* pHandler);
+
+ FX_DWORD GetUserPermissions(FX_BOOL bCheckRevision = FALSE) const;
+
+ FX_BOOL IsOwner() const;
+
+
+
+ CPDF_DocPageData* GetPageData()
+ {
+ return GetValidatePageData();
+ }
+
+ void ClearPageData();
+
+ void RemoveColorSpaceFromPageData(CPDF_Object* pObject);
+
+
+ CPDF_DocRenderData* GetRenderData()
+ {
+ return GetValidateRenderData();
+ }
+
+ void ClearRenderData();
+
+ void ClearRenderFont();
+
+
+ FX_BOOL IsFormStream(FX_DWORD objnum, FX_BOOL& bForm) const;
+
+
+
+
+ CPDF_Font* LoadFont(CPDF_Dictionary* pFontDict);
+
+ CPDF_Font* FindFont(CPDF_Dictionary* pFontDict);
+
+ CPDF_ColorSpace* LoadColorSpace(CPDF_Object* pCSObj, CPDF_Dictionary* pResources = NULL);
+
+ CPDF_Pattern* LoadPattern(CPDF_Object* pObj, FX_BOOL bShading, const CFX_AffineMatrix* matrix = NULL);
+
+ CPDF_Image* LoadImageF(CPDF_Object* pObj);
+
+ CPDF_StreamAcc* LoadFontFile(CPDF_Stream* pStream);
+
+ CPDF_IccProfile* LoadIccProfile(CPDF_Stream* pStream, int nComponents);
+
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
+
+ CPDF_Font* AddWindowsFont(LOGFONTA* pLogFont, FX_BOOL bVert, FX_BOOL bTranslateName = FALSE);
+ CPDF_Font* AddWindowsFont(LOGFONTW* pLogFont, FX_BOOL bVert, FX_BOOL bTranslateName = FALSE);
+#endif
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
+ CPDF_Font* AddMacFont(CTFontRef pFont, FX_BOOL bVert, FX_BOOL bTranslateName = FALSE);
+#endif
+
+ CPDF_Font* AddStandardFont(const FX_CHAR* font, CPDF_FontEncoding* pEncoding);
+
+
+ CPDF_Font* AddFont(CFX_Font* pFont, int charset, FX_BOOL bVert);
+
+ void CreateNewDoc();
+
+ CPDF_Dictionary* CreateNewPage(int iPage);
+
+ void DeletePage(int iPage);
+
+ void LoadDoc();
+ void LoadAsynDoc(CPDF_Dictionary *pLinearized);
+ void LoadPages();
+protected:
+
+ CPDF_Dictionary* m_pRootDict;
+
+ CPDF_Dictionary* m_pInfoDict;
+
+ CFX_ByteString m_ID1;
+
+ CFX_ByteString m_ID2;
+
+
+ FX_BOOL m_bLinearized;
+
+ FX_DWORD m_dwFirstPageNo;
+
+ FX_DWORD m_dwFirstPageObjNum;
+
+ CFX_DWordArray m_PageList;
+
+ int _GetPageCount() const;
+ CPDF_Dictionary* _FindPDFPage(CPDF_Dictionary* pPages, int iPage, int nPagesToGo, int level);
+ int _FindPageIndex(CPDF_Dictionary* pNode, FX_DWORD& skip_count, FX_DWORD objnum, int& index, int level = 0);
+ FX_BOOL IsContentUsedElsewhere(FX_DWORD objnum, CPDF_Dictionary* pPageDict);
+ FX_BOOL CheckOCGVisible(CPDF_Dictionary* pOCG, FX_BOOL bPrinting);
+ CPDF_DocPageData* GetValidatePageData();
+ CPDF_DocRenderData* GetValidateRenderData();
+ friend class CPDF_Creator;
+ friend class CPDF_Parser;
+ friend class CPDF_DataAvail;
+ friend class CPDF_OCContext;
+
+
+
+ CPDF_DocPageData* m_pDocPage;
+
+ CPDF_DocRenderData* m_pDocRender;
+
+};
+
+#define PDFWORD_EOF 0
+#define PDFWORD_NUMBER 1
+#define PDFWORD_TEXT 2
+#define PDFWORD_DELIMITER 3
+#define PDFWORD_NAME 4
+class CPDF_SimpleParser : public CFX_Object
+{
+public:
+
+ CPDF_SimpleParser(FX_LPCBYTE pData, FX_DWORD dwSize);
+
+ CPDF_SimpleParser(FX_BSTR str);
+
+ CFX_ByteStringC GetWord();
+
+ FX_BOOL SearchToken(FX_BSTR token);
+
+ FX_BOOL SkipWord(FX_BSTR token);
+
+ FX_BOOL FindTagPair(FX_BSTR start_token, FX_BSTR end_token,
+ FX_DWORD& start_pos, FX_DWORD& end_pos);
+
+ FX_BOOL FindTagParam(FX_BSTR token, int nParams);
+
+ FX_DWORD GetPos()
+ {
+ return m_dwCurPos;
+ }
+
+ void SetPos(FX_DWORD pos)
+ {
+ ASSERT(pos <= m_dwSize);
+ m_dwCurPos = pos;
+ }
+private:
+
+ void ParseWord(FX_LPCBYTE& pStart, FX_DWORD& dwSize, int& type);
+
+ FX_LPCBYTE m_pData;
+
+ FX_DWORD m_dwSize;
+
+ FX_DWORD m_dwCurPos;
+};
+class CPDF_SyntaxParser : public CFX_Object
+{
+public:
+
+ CPDF_SyntaxParser();
+
+ ~CPDF_SyntaxParser();
+
+ void InitParser(IFX_FileRead* pFileAccess, FX_DWORD HeaderOffset);
+
+ FX_FILESIZE SavePos()
+ {
+ return m_Pos;
+ }
+
+ void RestorePos(FX_FILESIZE pos)
+ {
+ m_Pos = pos;
+ }
+
+ CPDF_Object* GetObject(CPDF_IndirectObjects* pObjList, FX_DWORD objnum, FX_DWORD gennum, int level, struct PARSE_CONTEXT* pContext = NULL, FX_BOOL bDecrypt = TRUE);
+
+
+ CPDF_Object* GetObjectByStrict(CPDF_IndirectObjects* pObjList, FX_DWORD objnum, FX_DWORD gennum, int level, struct PARSE_CONTEXT* pContext = NULL);
+
+ int GetDirectNum();
+
+ CFX_ByteString GetString(FX_DWORD objnum, FX_DWORD gennum);
+
+ CFX_ByteString GetName();
+
+ CFX_ByteString GetKeyword();
+
+ void GetBinary(FX_BYTE* buffer, FX_DWORD size);
+
+ void ToNextLine();
+
+ void ToNextWord();
+
+ FX_BOOL SearchWord(FX_BSTR word, FX_BOOL bWholeWord, FX_BOOL bForward, FX_FILESIZE limit);
+
+ int SearchMultiWord(FX_BSTR words, FX_BOOL bWholeWord, FX_FILESIZE limit);
+
+ FX_FILESIZE FindTag(FX_BSTR tag, FX_FILESIZE limit);
+
+ void SetEncrypt(CPDF_CryptoHandler* pCryptoHandler)
+ {
+ m_pCryptoHandler = pCryptoHandler;
+ }
+
+ FX_BOOL IsEncrypted()
+ {
+ return m_pCryptoHandler != NULL;
+ }
+
+ FX_BOOL GetCharAt(FX_FILESIZE pos, FX_BYTE& ch);
+
+ FX_BOOL ReadBlock(FX_BYTE* pBuf, FX_DWORD size);
+
+ CFX_ByteString GetNextWord(FX_BOOL& bIsNumber);
+protected:
+
+ virtual FX_BOOL GetNextChar(FX_BYTE& ch);
+
+ FX_BOOL GetCharAtBackward(FX_FILESIZE pos, FX_BYTE& ch);
+
+ void GetNextWord();
+
+ FX_BOOL IsWholeWord(FX_FILESIZE startpos, FX_FILESIZE limit, FX_LPCBYTE tag, FX_DWORD taglen);
+
+ CFX_ByteString ReadString();
+
+ CFX_ByteString ReadHexString();
+
+ CPDF_Stream* ReadStream(CPDF_Dictionary* pDict, PARSE_CONTEXT* pContext, FX_DWORD objnum, FX_DWORD gennum);
+
+ FX_FILESIZE m_Pos;
+
+ FX_BOOL m_bFileStream;
+
+ int m_MetadataObjnum;
+
+ IFX_FileRead* m_pFileAccess;
+
+ FX_DWORD m_HeaderOffset;
+
+ FX_FILESIZE m_FileLen;
+
+ FX_BYTE* m_pFileBuf;
+
+ FX_DWORD m_BufSize;
+
+ FX_FILESIZE m_BufOffset;
+
+ CPDF_CryptoHandler* m_pCryptoHandler;
+
+ FX_BYTE m_WordBuffer[257];
+
+ FX_DWORD m_WordSize;
+
+ FX_BOOL m_bIsNumber;
+
+ FX_FILESIZE m_dwWordPos;
+ friend class CPDF_Parser;
+ friend class CPDF_DataAvail;
+};
+
+#define PDFPARSE_TYPEONLY 1
+#define PDFPARSE_NOSTREAM 2
+struct PARSE_CONTEXT {
+
+ FX_BOOL m_Flags;
+
+ FX_FILESIZE m_DictStart;
+
+ FX_FILESIZE m_DictEnd;
+
+ FX_FILESIZE m_DataStart;
+
+ FX_FILESIZE m_DataEnd;
+};
+class IPDF_DocParser : public CFX_Object
+{
+public:
+
+ virtual FX_DWORD GetRootObjNum() = 0;
+
+ virtual FX_DWORD GetInfoObjNum() = 0;
+
+ virtual CPDF_Object* ParseIndirectObject(CPDF_IndirectObjects* pObjList, FX_DWORD objnum, PARSE_CONTEXT* pContext = NULL) = 0;
+
+ virtual FX_DWORD GetLastObjNum() = 0;
+
+ virtual CPDF_Array* GetIDArray() = 0;
+
+ virtual CPDF_Dictionary* GetEncryptDict() = 0;
+
+ FX_BOOL IsEncrypted()
+ {
+ return GetEncryptDict() != NULL;
+ }
+
+ virtual FX_DWORD GetPermissions(FX_BOOL bCheckRevision = FALSE) = 0;
+
+ virtual FX_BOOL IsOwner() = 0;
+
+ virtual FX_BOOL IsFormStream(FX_DWORD objnum, FX_BOOL& bForm) = 0;
+};
+
+#define PDFPARSE_ERROR_SUCCESS 0
+#define PDFPARSE_ERROR_FILE 1
+#define PDFPARSE_ERROR_FORMAT 2
+#define PDFPARSE_ERROR_PASSWORD 3
+#define PDFPARSE_ERROR_HANDLER 4
+#define PDFPARSE_ERROR_CERT 5
+class CPDF_Parser : public IPDF_DocParser
+{
+public:
+
+ CPDF_Parser();
+
+ ~CPDF_Parser();
+
+ FX_DWORD StartParse(FX_LPCSTR filename, FX_BOOL bReParse = FALSE);
+
+ FX_DWORD StartParse(FX_LPCWSTR filename, FX_BOOL bReParse = FALSE);
+
+ FX_DWORD StartParse(IFX_FileRead* pFile, FX_BOOL bReParse = FALSE, FX_BOOL bOwnFileRead = TRUE);
+
+ void CloseParser(FX_BOOL bReParse = FALSE);
+
+ virtual FX_DWORD GetPermissions(FX_BOOL bCheckRevision = FALSE);
+
+ virtual FX_BOOL IsOwner();
+
+ void SetPassword(const FX_CHAR* password)
+ {
+ m_Password = password;
+ }
+
+ CFX_ByteString GetPassword()
+ {
+ return m_Password;
+ }
+
+ CPDF_SecurityHandler* GetSecurityHandler()
+ {
+ return m_pSecurityHandler;
+ }
+
+ CPDF_CryptoHandler* GetCryptoHandler()
+ {
+ return m_Syntax.m_pCryptoHandler;
+ }
+
+ void SetSecurityHandler(CPDF_SecurityHandler* pSecurityHandler, FX_BOOL bForced = FALSE);
+
+ CFX_ByteString GetRecipient()
+ {
+ return m_bsRecipient;
+ }
+
+ CPDF_Dictionary* GetTrailer()
+ {
+ return m_pTrailer;
+ }
+
+ FX_FILESIZE GetLastXRefOffset()
+ {
+ return m_LastXRefOffset;
+ }
+
+ CPDF_Document* GetDocument()
+ {
+ return m_pDocument;
+ }
+ CFX_ArrayTemplate<CPDF_Dictionary *> * GetOtherTrailers()
+ {
+ return &m_Trailers;
+ }
+
+ virtual FX_DWORD GetRootObjNum();
+ virtual FX_DWORD GetInfoObjNum();
+ virtual CPDF_Array* GetIDArray();
+ virtual CPDF_Dictionary* GetEncryptDict()
+ {
+ return m_pEncryptDict;
+ }
+ virtual CPDF_Object* ParseIndirectObject(CPDF_IndirectObjects* pObjList, FX_DWORD objnum, PARSE_CONTEXT* pContext = NULL);
+ virtual FX_DWORD GetLastObjNum();
+ virtual FX_BOOL IsFormStream(FX_DWORD objnum, FX_BOOL& bForm);
+
+ FX_FILESIZE GetObjectOffset(FX_DWORD objnum);
+
+ FX_FILESIZE GetObjectSize(FX_DWORD objnum);
+
+ int GetObjectVersion(FX_DWORD objnum)
+ {
+ return m_ObjVersion[objnum];
+ }
+
+ void GetIndirectBinary(FX_DWORD objnum, FX_BYTE*& pBuffer, FX_DWORD& size);
+
+ FX_BOOL GetFileStreamOption()
+ {
+ return m_Syntax.m_bFileStream;
+ }
+
+ void SetFileStreamOption(FX_BOOL b)
+ {
+ m_Syntax.m_bFileStream = b;
+ }
+
+ IFX_FileRead* GetFileAccess() const
+ {
+ return m_Syntax.m_pFileAccess;
+ }
+
+ int GetFileVersion() const
+ {
+ return m_FileVersion;
+ }
+
+ FX_BOOL IsXRefStream() const
+ {
+ return m_bXRefStream;
+ }
+ CPDF_Object* ParseIndirectObjectAt(CPDF_IndirectObjects* pObjList, FX_FILESIZE pos, FX_DWORD objnum,
+ struct PARSE_CONTEXT* pContext);
+
+ CPDF_Object* ParseIndirectObjectAtByStrict(CPDF_IndirectObjects* pObjList, FX_FILESIZE pos, FX_DWORD objnum,
+ struct PARSE_CONTEXT* pContext, FX_FILESIZE *pResultPos);
+
+ FX_DWORD StartAsynParse(IFX_FileRead* pFile, FX_BOOL bReParse = FALSE, FX_BOOL bOwnFileRead = TRUE);
+
+ FX_DWORD GetFirstPageNo()
+ {
+ return m_dwFirstPageNo;
+ }
+protected:
+
+ CPDF_Document* m_pDocument;
+
+ CPDF_SyntaxParser m_Syntax;
+ FX_BOOL m_bOwnFileRead;
+ CPDF_Object* ParseDirect(CPDF_Object* pObj);
+
+ FX_BOOL LoadAllCrossRefV4(FX_FILESIZE pos);
+
+ FX_BOOL LoadAllCrossRefV5(FX_FILESIZE pos);
+
+ FX_BOOL LoadCrossRefV4(FX_FILESIZE pos, FX_FILESIZE streampos, FX_BOOL bSkip, FX_BOOL bFirst);
+
+ FX_BOOL LoadCrossRefV5(FX_FILESIZE pos, FX_FILESIZE& prev, FX_BOOL bMainXRef);
+
+ CPDF_Dictionary* LoadTrailerV4();
+
+ FX_BOOL RebuildCrossRef();
+
+ FX_DWORD SetEncryptHandler();
+
+ void ReleaseEncryptHandler();
+
+ FX_BOOL LoadLinearizedAllCrossRefV4(FX_FILESIZE pos, FX_DWORD dwObjCount);
+
+ FX_BOOL LoadLinearizedCrossRefV4(FX_FILESIZE pos, FX_DWORD dwObjCount);
+
+ FX_BOOL LoadLinearizedAllCrossRefV5(FX_FILESIZE pos);
+
+ FX_DWORD LoadLinearizedMainXRefTable();
+
+ CFX_MapPtrToPtr m_ObjectStreamMap;
+
+ CPDF_StreamAcc* GetObjectStream(FX_DWORD number);
+
+ FX_BOOL IsLinearizedFile(IFX_FileRead* pFileAccess, FX_DWORD offset);
+
+
+
+ int m_FileVersion;
+
+ CPDF_Dictionary* m_pTrailer;
+
+ CPDF_Dictionary* m_pEncryptDict;
+ void SetEncryptDictionary(CPDF_Dictionary* pDict);
+
+ FX_FILESIZE m_LastXRefOffset;
+
+ FX_BOOL m_bXRefStream;
+
+
+ CPDF_SecurityHandler* m_pSecurityHandler;
+
+ FX_BOOL m_bForceUseSecurityHandler;
+
+ CFX_ByteString m_bsRecipient;
+
+ CFX_ByteString m_FilePath;
+
+ CFX_ByteString m_Password;
+
+ CFX_FileSizeArray m_CrossRef;
+
+ CFX_ByteArray m_V5Type;
+
+ CFX_FileSizeArray m_SortedOffset;
+
+ CFX_WordArray m_ObjVersion;
+ CFX_ArrayTemplate<CPDF_Dictionary *> m_Trailers;
+
+ FX_BOOL m_bVersionUpdated;
+
+ CPDF_Object* m_pLinearized;
+
+ FX_DWORD m_dwFirstPageNo;
+
+ FX_DWORD m_dwXrefStartObjNum;
+ friend class CPDF_Creator;
+ friend class CPDF_DataAvail;
+};
+#define FXCIPHER_NONE 0
+#define FXCIPHER_RC4 1
+#define FXCIPHER_AES 2
+#define FXCIPHER_AES2 3
+class CPDF_SecurityHandler : public CFX_Object
+{
+public:
+
+ virtual ~CPDF_SecurityHandler() {}
+
+ virtual FX_BOOL OnInit(CPDF_Parser* pParser, CPDF_Dictionary* pEncryptDict) = 0;
+
+ virtual FX_DWORD GetPermissions() = 0;
+
+ virtual FX_BOOL IsOwner() = 0;
+
+ virtual FX_BOOL GetCryptInfo(int& cipher, FX_LPCBYTE& buffer, int& keylen) = 0;
+
+ virtual FX_BOOL IsMetadataEncrypted()
+ {
+ return TRUE;
+ }
+
+ virtual CPDF_CryptoHandler* CreateCryptoHandler() = 0;
+
+ virtual CPDF_StandardSecurityHandler* GetStandardHandler()
+ {
+ return NULL;
+ }
+};
+#define PDF_ENCRYPT_CONTENT 0
+class CPDF_StandardSecurityHandler : public CPDF_SecurityHandler
+{
+public:
+ CPDF_StandardSecurityHandler();
+
+ virtual ~CPDF_StandardSecurityHandler();
+ virtual FX_BOOL OnInit(CPDF_Parser* pParser, CPDF_Dictionary* pEncryptDict);
+ virtual FX_DWORD GetPermissions();
+ virtual FX_BOOL IsOwner()
+ {
+ return m_bOwner;
+ }
+ virtual FX_BOOL GetCryptInfo(int& cipher, FX_LPCBYTE& buffer, int& keylen);
+ virtual FX_BOOL IsMetadataEncrypted();
+ virtual CPDF_CryptoHandler* CreateCryptoHandler();
+ virtual CPDF_StandardSecurityHandler* GetStandardHandler()
+ {
+ return this;
+ }
+
+ void OnCreate(CPDF_Dictionary* pEncryptDict, CPDF_Array* pIdArray,
+ FX_LPCBYTE user_pass, FX_DWORD user_size,
+ FX_LPCBYTE owner_pass, FX_DWORD owner_size, FX_DWORD type = PDF_ENCRYPT_CONTENT);
+
+ void OnCreate(CPDF_Dictionary* pEncryptDict, CPDF_Array* pIdArray,
+ FX_LPCBYTE user_pass, FX_DWORD user_size, FX_DWORD type = PDF_ENCRYPT_CONTENT);
+
+ CFX_ByteString GetUserPassword(FX_LPCBYTE owner_pass, FX_DWORD pass_size);
+ CFX_ByteString GetUserPassword(FX_LPCBYTE owner_pass, FX_DWORD pass_size, FX_INT32 key_len);
+ int GetVersion()
+ {
+ return m_Version;
+ }
+ int GetRevision()
+ {
+ return m_Revision;
+ }
+
+ int CheckPassword(FX_LPCBYTE password, FX_DWORD pass_size, FX_BOOL bOwner, FX_LPBYTE key);
+ int CheckPassword(FX_LPCBYTE password, FX_DWORD pass_size, FX_BOOL bOwner, FX_LPBYTE key, int key_len);
+private:
+
+ int m_Version;
+
+ int m_Revision;
+
+ CPDF_Parser* m_pParser;
+
+ CPDF_Dictionary* m_pEncryptDict;
+
+ FX_BOOL LoadDict(CPDF_Dictionary* pEncryptDict);
+ FX_BOOL LoadDict(CPDF_Dictionary* pEncryptDict, FX_DWORD type, int& cipher, int& key_len);
+
+ FX_BOOL CheckUserPassword(FX_LPCBYTE password, FX_DWORD pass_size,
+ FX_BOOL bIgnoreEncryptMeta, FX_LPBYTE key, FX_INT32 key_len);
+
+ FX_BOOL CheckOwnerPassword(FX_LPCBYTE password, FX_DWORD pass_size, FX_LPBYTE key, FX_INT32 key_len);
+ FX_BOOL AES256_CheckPassword(FX_LPCBYTE password, FX_DWORD size, FX_BOOL bOwner, FX_LPBYTE key);
+ void AES256_SetPassword(CPDF_Dictionary* pEncryptDict, FX_LPCBYTE password, FX_DWORD size, FX_BOOL bOwner, FX_LPCBYTE key);
+ void AES256_SetPerms(CPDF_Dictionary* pEncryptDict, FX_DWORD permission, FX_BOOL bEncryptMetadata, FX_LPCBYTE key);
+ void OnCreate(CPDF_Dictionary* pEncryptDict, CPDF_Array* pIdArray,
+ FX_LPCBYTE user_pass, FX_DWORD user_size,
+ FX_LPCBYTE owner_pass, FX_DWORD owner_size, FX_BOOL bDefault, FX_DWORD type);
+ FX_BOOL CheckSecurity(FX_INT32 key_len);
+
+ FX_BOOL m_bOwner;
+
+ FX_DWORD m_Permissions;
+
+ int m_Cipher;
+
+ FX_BYTE m_EncryptKey[32];
+
+ int m_KeyLen;
+};
+class CPDF_CryptoHandler : public CFX_Object
+{
+public:
+
+ virtual ~CPDF_CryptoHandler() {}
+
+ virtual FX_BOOL Init(CPDF_Dictionary* pEncryptDict, CPDF_SecurityHandler* pSecurityHandler) = 0;
+
+ virtual FX_DWORD DecryptGetSize(FX_DWORD src_size) = 0;
+
+ virtual FX_LPVOID DecryptStart(FX_DWORD objnum, FX_DWORD gennum) = 0;
+
+ virtual FX_BOOL DecryptStream(FX_LPVOID context, FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf) = 0;
+
+ virtual FX_BOOL DecryptFinish(FX_LPVOID context, CFX_BinaryBuf& dest_buf) = 0;
+
+
+ virtual FX_DWORD EncryptGetSize(FX_DWORD objnum, FX_DWORD version, FX_LPCBYTE src_buf, FX_DWORD src_size) = 0;
+
+ virtual FX_BOOL EncryptContent(FX_DWORD objnum, FX_DWORD version, FX_LPCBYTE src_buf, FX_DWORD src_size,
+ FX_LPBYTE dest_buf, FX_DWORD& dest_size) = 0;
+
+ void Decrypt(FX_DWORD objnum, FX_DWORD version, CFX_ByteString& str);
+};
+class CPDF_StandardCryptoHandler : public CPDF_CryptoHandler
+{
+public:
+
+ CPDF_StandardCryptoHandler();
+
+ virtual ~CPDF_StandardCryptoHandler();
+
+ FX_BOOL Init(int cipher, FX_LPCBYTE key, int keylen);
+ virtual FX_BOOL Init(CPDF_Dictionary* pEncryptDict, CPDF_SecurityHandler* pSecurityHandler);
+ virtual FX_DWORD DecryptGetSize(FX_DWORD src_size);
+ virtual FX_LPVOID DecryptStart(FX_DWORD objnum, FX_DWORD gennum);
+ virtual FX_BOOL DecryptStream(FX_LPVOID context, FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf);
+ virtual FX_BOOL DecryptFinish(FX_LPVOID context, CFX_BinaryBuf& dest_buf);
+ virtual FX_DWORD EncryptGetSize(FX_DWORD objnum, FX_DWORD version, FX_LPCBYTE src_buf, FX_DWORD src_size);
+ virtual FX_BOOL EncryptContent(FX_DWORD objnum, FX_DWORD version, FX_LPCBYTE src_buf, FX_DWORD src_size,
+ FX_LPBYTE dest_buf, FX_DWORD& dest_size);
+protected:
+
+ virtual void CryptBlock(FX_BOOL bEncrypt, FX_DWORD objnum, FX_DWORD gennum, FX_LPCBYTE src_buf, FX_DWORD src_size,
+ FX_LPBYTE dest_buf, FX_DWORD& dest_size);
+ virtual FX_LPVOID CryptStart(FX_DWORD objnum, FX_DWORD gennum, FX_BOOL bEncrypt);
+ virtual FX_BOOL CryptStream(FX_LPVOID context, FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf, FX_BOOL bEncrypt);
+ virtual FX_BOOL CryptFinish(FX_LPVOID context, CFX_BinaryBuf& dest_buf, FX_BOOL bEncrypt);
+
+ FX_BYTE m_EncryptKey[32];
+
+ int m_KeyLen;
+
+ int m_Cipher;
+
+ FX_LPBYTE m_pAESContext;
+};
+class CPDF_Point : public CFX_Object
+{
+public:
+
+ CPDF_Point(FX_FLOAT xx, FX_FLOAT yy)
+ {
+ x = xx;
+ y = yy;
+ }
+
+ FX_FLOAT x;
+
+ FX_FLOAT y;
+};
+
+#define CPDF_Rect CFX_FloatRect
+#define CPDF_Matrix CFX_AffineMatrix
+CFX_ByteString PDF_NameDecode(FX_BSTR orig);
+CFX_ByteString PDF_NameDecode(const CFX_ByteString& orig);
+CFX_ByteString PDF_NameEncode(const CFX_ByteString& orig);
+CFX_ByteString PDF_EncodeString(const CFX_ByteString& src, FX_BOOL bHex = FALSE);
+CFX_WideString PDF_DecodeText(const CFX_ByteString& str, CFX_CharMap* pCharMap = NULL);
+CFX_WideString PDF_DecodeText(FX_LPCBYTE pData, FX_DWORD size, CFX_CharMap* pCharMap = NULL);
+CFX_ByteString PDF_EncodeText(FX_LPCWSTR pString, int len = -1, CFX_CharMap* pCharMap = NULL);
+FX_FLOAT PDF_ClipFloat(FX_FLOAT f);
+class CFDF_Document : public CPDF_IndirectObjects
+{
+public:
+
+ static CFDF_Document* CreateNewDoc();
+
+ static CFDF_Document* ParseFile(FX_LPCSTR file_path);
+
+ static CFDF_Document* ParseFile(FX_LPCWSTR file_path);
+
+ static CFDF_Document* ParseFile(IFX_FileRead *pFile, FX_BOOL bOwnFile = FALSE);
+
+ static CFDF_Document* ParseMemory(FX_LPCBYTE pData, FX_DWORD size);
+
+ ~CFDF_Document();
+
+ FX_BOOL WriteFile(FX_LPCSTR file_path) const;
+
+ FX_BOOL WriteFile(FX_LPCWSTR file_path) const;
+
+ FX_BOOL WriteFile(IFX_FileWrite *pFile) const;
+
+ FX_BOOL WriteBuf(CFX_ByteTextBuf& buf) const;
+
+ CPDF_Dictionary* GetRoot() const
+ {
+ return m_pRootDict;
+ }
+
+ CFX_WideString GetWin32Path() const;
+protected:
+
+ CFDF_Document();
+ void ParseStream(IFX_FileRead *pFile, FX_BOOL bOwnFile);
+ CPDF_Dictionary* m_pRootDict;
+ IFX_FileRead* m_pFile;
+ FX_BOOL m_bOwnFile;
+};
+
+CFX_WideString FPDF_FileSpec_GetWin32Path(const CPDF_Object* pFileSpec);
+void FPDF_FileSpec_SetWin32Path(CPDF_Object* pFileSpec, const CFX_WideString& fullpath);
+
+void FlateEncode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size);
+FX_DWORD FlateDecode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size);
+FX_DWORD RunLengthDecode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size);
+class CPDF_NumberTree : public CFX_Object
+{
+public:
+
+ CPDF_NumberTree(CPDF_Dictionary* pRoot)
+ {
+ m_pRoot = pRoot;
+ }
+
+ CPDF_Object* LookupValue(int num);
+protected:
+
+ CPDF_Dictionary* m_pRoot;
+};
+
+class IFX_FileAvail
+{
+public:
+
+ virtual FX_BOOL IsDataAvail( FX_FILESIZE offset, FX_DWORD size) = 0;
+};
+class IFX_DownloadHints
+{
+public:
+
+ virtual void AddSegment(FX_FILESIZE offset, FX_DWORD size) = 0;
+};
+#define PDF_IS_LINEARIZED 1
+#define PDF_NOT_LINEARIZED 0
+#define PDF_UNKNOW_LINEARIZED -1
+#define PDFFORM_NOTAVAIL 0
+#define PDFFORM_AVAIL 1
+#define PDFFORM_NOTEXIST 2
+class IPDF_DataAvail
+{
+public:
+
+ virtual FX_BOOL IsDocAvail(IFX_DownloadHints* pHints) = 0;
+
+
+ virtual void SetDocument(CPDF_Document* pDoc) = 0;
+
+
+ virtual FX_BOOL IsPageAvail(int iPage, IFX_DownloadHints* pHints) = 0;
+
+ virtual FX_BOOL IsLinearized() = 0;
+
+ virtual FX_INT32 IsFormAvail(IFX_DownloadHints *pHints) = 0;
+
+ virtual FX_INT32 IsLinearizedPDF() = 0;
+
+ virtual void GetLinearizedMainXRefInfo(FX_FILESIZE *pPos, FX_DWORD *pSize) = 0;
+};
+class CPDF_SortObjNumArray : public CFX_Object
+{
+public:
+
+ void AddObjNum(FX_DWORD dwObjNum);
+
+ FX_BOOL Find(FX_DWORD dwObjNum);
+
+ void RemoveAll()
+ {
+ m_number_array.RemoveAll();
+ }
+protected:
+
+ FX_BOOL BinarySearch(FX_DWORD value, int &iNext);
+protected:
+
+ CFX_DWordArray m_number_array;
+};
+enum PDF_PAGENODE_TYPE {
+ PDF_PAGENODE_UNKOWN = 0,
+ PDF_PAGENODE_PAGE,
+ PDF_PAGENODE_PAGES,
+ PDF_PAGENODE_ARRAY,
+};
+class CPDF_PageNode : public CFX_Object
+{
+public:
+ CPDF_PageNode() : m_type(PDF_PAGENODE_UNKOWN) {}
+ ~CPDF_PageNode();
+ PDF_PAGENODE_TYPE m_type;
+ FX_DWORD m_dwPageNo;
+ CFX_PtrArray m_childNode;
+};
+enum PDF_DATAAVAIL_STATUS {
+ PDF_DATAAVAIL_HEADER = 0,
+ PDF_DATAAVAIL_FIRSTPAGE,
+ PDF_DATAAVAIL_FIRSTPAGE_PREPARE,
+ PDF_DATAAVAIL_END,
+ PDF_DATAAVAIL_CROSSREF,
+ PDF_DATAAVAIL_CROSSREF_ITEM,
+ PDF_DATAAVAIL_CROSSREF_STREAM,
+ PDF_DATAAVAIL_TRAILER,
+ PDF_DATAAVAIL_LOADALLCRSOSSREF,
+ PDF_DATAAVAIL_ROOT,
+ PDF_DATAAVAIL_INFO,
+ PDF_DATAAVAIL_ACROFORM,
+ PDF_DATAAVAIL_ACROFORM_SUBOBJECT,
+ PDF_DATAAVAIL_PAGETREE,
+ PDF_DATAAVAIL_PAGE,
+ PDF_DATAAVAIL_PAGE_LATERLOAD,
+ PDF_DATAAVAIL_RESOURCES,
+ PDF_DATAAVAIL_DONE,
+ PDF_DATAAVAIL_ERROR,
+ PDF_DATAAVAIL_LOADALLFILE,
+ PDF_DATAAVAIL_TRAILER_APPEND
+};
+class CPDF_DataAvail : public CFX_Object, public IPDF_DataAvail
+{
+public:
+
+ CPDF_DataAvail(IFX_FileAvail* pFileAvail, IFX_FileRead* pFileRead);
+ ~CPDF_DataAvail();
+
+ virtual FX_BOOL IsDocAvail(IFX_DownloadHints* pHints);
+
+
+ virtual void SetDocument(CPDF_Document* pDoc);
+
+
+ virtual FX_BOOL IsPageAvail(int iPage, IFX_DownloadHints* pHints);
+
+ virtual FX_INT32 IsFormAvail(IFX_DownloadHints *pHints);
+
+ virtual FX_INT32 IsLinearizedPDF();
+
+ virtual FX_BOOL IsLinearized()
+ {
+ return m_bLinearized;
+ }
+
+ virtual void GetLinearizedMainXRefInfo(FX_FILESIZE *pPos, FX_DWORD *pSize);
+ IFX_FileRead* GetFileRead() const
+ {
+ return m_pFileRead;
+ }
+ IFX_FileAvail* GetFileAvail() const
+ {
+ return m_pFileAvail;
+ }
+protected:
+ FX_DWORD GetObjectSize(FX_DWORD objnum, FX_FILESIZE& offset);
+ FX_BOOL IsObjectsAvail(CFX_PtrArray& obj_array, FX_BOOL bParsePage, IFX_DownloadHints* pHints, CFX_PtrArray &ret_array);
+ FX_BOOL CheckDocStatus(IFX_DownloadHints *pHints);
+ FX_BOOL CheckHeader(IFX_DownloadHints* pHints);
+ FX_BOOL CheckFirstPage(IFX_DownloadHints *pHints);
+ FX_BOOL CheckEnd(IFX_DownloadHints *pHints);
+ FX_BOOL CheckCrossRef(IFX_DownloadHints* pHints);
+ FX_BOOL CheckCrossRefItem(IFX_DownloadHints *pHints);
+ FX_BOOL CheckTrailer(IFX_DownloadHints* pHints);
+ FX_BOOL CheckRoot(IFX_DownloadHints* pHints);
+ FX_BOOL CheckInfo(IFX_DownloadHints* pHints);
+ FX_BOOL CheckPages(IFX_DownloadHints* pHints);
+ FX_BOOL CheckPage(IFX_DownloadHints* pHints);
+ FX_BOOL CheckResources(IFX_DownloadHints* pHints);
+ FX_BOOL CheckAnnots(IFX_DownloadHints* pHints);
+ FX_BOOL CheckAcroForm(IFX_DownloadHints* pHints);
+ FX_BOOL CheckAcroFormSubObject(IFX_DownloadHints* pHints);
+ FX_BOOL CheckTrailerAppend(IFX_DownloadHints* pHints);
+ FX_BOOL CheckPageStatus(IFX_DownloadHints* pHints);
+ FX_BOOL CheckAllCrossRefStream(IFX_DownloadHints *pHints);
+
+ FX_DWORD CheckCrossRefStream(IFX_DownloadHints *pHints, FX_FILESIZE &xref_offset);
+ FX_BOOL IsLinearizedFile(FX_LPBYTE pData, FX_DWORD dwLen);
+ void SetStartOffset(FX_FILESIZE dwOffset);
+ FX_BOOL GetNextToken(CFX_ByteString &token);
+ FX_BOOL GetNextChar(FX_BYTE &ch);
+ CPDF_Object * ParseIndirectObjectAt(FX_FILESIZE pos, FX_DWORD objnum);
+ CPDF_Object * GetObject(FX_DWORD objnum, IFX_DownloadHints* pHints, FX_BOOL *pExistInFile);
+ FX_BOOL GetPageKids(CPDF_Parser *pParser, CPDF_Object *pPages);
+ FX_BOOL PreparePageItem();
+ FX_BOOL LoadPages(IFX_DownloadHints* pHints);
+ FX_BOOL LoadAllXref(IFX_DownloadHints* pHints);
+ FX_BOOL LoadAllFile(IFX_DownloadHints* pHints);
+ FX_BOOL CheckLinearizedData(IFX_DownloadHints* pHints);
+ FX_BOOL CheckFileResources(IFX_DownloadHints* pHints);
+ FX_BOOL CheckPageAnnots(int iPage, IFX_DownloadHints* pHints);
+
+ FX_BOOL CheckLinearizedFirstPage(int iPage, IFX_DownloadHints* pHints);
+ FX_BOOL HaveResourceAncestor(CPDF_Dictionary *pDict);
+ FX_BOOL CheckPage(FX_INT32 iPage, IFX_DownloadHints* pHints);
+ FX_BOOL LoadDocPages(IFX_DownloadHints* pHints);
+ FX_BOOL LoadDocPage(FX_INT32 iPage, IFX_DownloadHints* pHints);
+ FX_BOOL CheckPageNode(CPDF_PageNode &pageNodes, FX_INT32 iPage, FX_INT32 &iCount, IFX_DownloadHints* pHints);
+ FX_BOOL CheckUnkownPageNode(FX_DWORD dwPageNo, CPDF_PageNode *pPageNode, IFX_DownloadHints* pHints);
+ FX_BOOL CheckArrayPageNode(FX_DWORD dwPageNo, CPDF_PageNode *pPageNode, IFX_DownloadHints* pHints);
+ FX_BOOL CheckPageCount(IFX_DownloadHints* pHints);
+ FX_BOOL IsFirstCheck(int iPage);
+ void ResetFirstCheck(int iPage);
+
+ CPDF_Parser m_parser;
+
+ CPDF_SyntaxParser m_syntaxParser;
+
+ CPDF_Object *m_pRoot;
+
+ FX_DWORD m_dwRootObjNum;
+
+ FX_DWORD m_dwInfoObjNum;
+
+ CPDF_Object *m_pLinearized;
+
+ CPDF_Object *m_pTrailer;
+
+ FX_BOOL m_bDocAvail;
+
+ FX_FILESIZE m_dwHeaderOffset;
+
+ FX_FILESIZE m_dwLastXRefOffset;
+
+ FX_FILESIZE m_dwXRefOffset;
+
+ FX_FILESIZE m_dwTrailerOffset;
+
+ FX_FILESIZE m_dwCurrentOffset;
+
+ PDF_DATAAVAIL_STATUS m_docStatus;
+
+ IFX_FileAvail* m_pFileAvail;
+
+ IFX_FileRead* m_pFileRead;
+
+ FX_FILESIZE m_dwFileLen;
+
+ CPDF_Document* m_pDocument;
+
+ CPDF_SortObjNumArray m_objnum_array;
+
+ CFX_PtrArray m_objs_array;
+
+ FX_FILESIZE m_Pos;
+
+ FX_FILESIZE m_bufferOffset;
+
+ FX_DWORD m_bufferSize;
+
+ CFX_ByteString m_WordBuf;
+
+ FX_BYTE m_WordBuffer[257];
+
+ FX_DWORD m_WordSize;
+
+ FX_BYTE m_bufferData[512];
+
+ CFX_FileSizeArray m_CrossOffset;
+
+ CFX_DWordArray m_XRefStreamList;
+
+ CFX_DWordArray m_PageObjList;
+
+ FX_DWORD m_PagesObjNum;
+
+ FX_BOOL m_bLinearized;
+
+ FX_DWORD m_dwFirstPageNo;
+
+ FX_BOOL m_bLinearedDataOK;
+
+ FX_BOOL m_bMainXRefLoad;
+
+ FX_BOOL m_bMainXRefLoadedOK;
+
+ FX_BOOL m_bPagesTreeLoad;
+
+ FX_BOOL m_bPagesLoad;
+
+ CPDF_Parser * m_pCurrentParser;
+
+ FX_FILESIZE m_dwCurrentXRefSteam;
+
+ FX_BOOL m_bAnnotsLoad;
+
+ FX_BOOL m_bHaveAcroForm;
+
+ FX_DWORD m_dwAcroFormObjNum;
+
+ FX_BOOL m_bAcroFormLoad;
+
+ CPDF_Object * m_pAcroForm;
+
+ CFX_PtrArray m_arrayAcroforms;
+
+ CPDF_Dictionary * m_pPageDict;
+
+ CPDF_Object * m_pPageResource;
+
+ FX_BOOL m_bNeedDownLoadResource;
+
+ FX_BOOL m_bPageLoadedOK;
+
+ FX_BOOL m_bLinearizedFormParamLoad;
+
+ CFX_PtrArray m_PagesArray;
+
+ FX_DWORD m_dwEncryptObjNum;
+
+ FX_FILESIZE m_dwPrevXRefOffset;
+
+ FX_BOOL m_bTotalLoadPageTree;
+
+ FX_BOOL m_bCurPageDictLoadOK;
+
+ CPDF_PageNode m_pageNodes;
+
+ CFX_CMapDWordToDWord * m_pageMapCheckState;
+
+ CFX_CMapDWordToDWord * m_pagesLoadState;
+};
+#endif
diff --git a/core/include/fpdfapi/fpdf_render.h b/core/include/fpdfapi/fpdf_render.h
index 22ba56fa66..c059bedb2b 100644
--- a/core/include/fpdfapi/fpdf_render.h
+++ b/core/include/fpdfapi/fpdf_render.h
@@ -1,318 +1,318 @@
-// 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 _FPDF_RENDER_
-#define _FPDF_RENDER_
-#ifndef _FPDF_PAGE_
-#include "fpdf_page.h"
-#endif
-#ifndef _FX_GE_H_
-#include "../fxge/fx_ge.h"
-#endif
-class CPDF_RenderContext;
-class CPDF_RenderOptions;
-class CPDF_ImageCache;
-class IPDF_OCContext;
-class CPDF_QuickStretcher;
-class CFX_PathData;
-class CFX_GraphStateData;
-class CFX_RenderDevice;
-class CPDF_TextObject;
-class CPDF_PathObject;
-class CPDF_ImageObject;
-class CPDF_ShadingObject;
-class CPDF_FormObject;
-class IPDF_OCContext
-{
-public:
-
- virtual ~IPDF_OCContext() {}
-
- virtual FX_BOOL CheckOCGVisible(const CPDF_Dictionary* pOCG) = 0;
-
- FX_BOOL CheckObjectVisible(const CPDF_PageObject* pObj);
-};
-#define RENDER_COLOR_NORMAL 0
-#define RENDER_COLOR_GRAY 1
-#define RENDER_COLOR_TWOCOLOR 2
-#define RENDER_COLOR_ALPHA 3
-#define RENDER_CLEARTYPE 0x00000001
-#define RENDER_PRINTGRAPHICTEXT 0x00000002
-#define RENDER_FORCE_DOWNSAMPLE 0x00000004
-#define RENDER_PRINTPREVIEW 0x00000008
-#define RENDER_BGR_STRIPE 0x00000010
-#define RENDER_NO_NATIVETEXT 0x00000020
-#define RENDER_FORCE_HALFTONE 0x00000040
-#define RENDER_RECT_AA 0x00000080
-#define RENDER_FILL_FULLCOVER 0x00000100
-#define RENDER_PRINTIMAGETEXT 0x00000200
-#define RENDER_OVERPRINT 0x00000400
-#define RENDER_THINLINE 0x00000800
-#define RENDER_NOTEXTSMOOTH 0x10000000
-#define RENDER_NOPATHSMOOTH 0x20000000
-#define RENDER_NOIMAGESMOOTH 0x40000000
-#define RENDER_LIMITEDIMAGECACHE 0x80000000
-class CPDF_RenderOptions : public CFX_Object
-{
-public:
-
- CPDF_RenderOptions();
-
- int m_ColorMode;
-
- FX_COLORREF m_BackColor;
-
- FX_COLORREF m_ForeColor;
-
- FX_DWORD m_Flags;
-
- int m_Interpolation;
-
- FX_DWORD m_AddFlags;
-
- IPDF_OCContext* m_pOCContext;
-
- FX_DWORD m_dwLimitCacheSize;
-
- int m_HalftoneLimit;
-
- FX_ARGB TranslateColor(FX_ARGB argb) const;
-};
-class CPDF_RenderContext : public CFX_Object
-{
-public:
-
- CPDF_RenderContext();
-
- void Create(CPDF_Page* pPage, FX_BOOL bFirstLayer = TRUE);
-
- void Create(CPDF_Document* pDoc = NULL, CPDF_PageRenderCache* pPageCache = NULL,
- CPDF_Dictionary* pPageResources = NULL, FX_BOOL bFirstLayer = TRUE);
-
- ~CPDF_RenderContext();
-
- void Clear();
-
- void AppendObjectList(CPDF_PageObjects* pObjs, const CFX_AffineMatrix* pObject2Device);
-
- void SetBackground(class IPDF_BackgroundDraw* pBackground);
-
- void Render(CFX_RenderDevice* pDevice, const CPDF_RenderOptions* pOptions = NULL,
- const CFX_AffineMatrix* pFinalMatrix = NULL);
-
- void DrawObjectList(CFX_RenderDevice* pDevice, CPDF_PageObjects* pObjs,
- const CFX_AffineMatrix* pObject2Device, const CPDF_RenderOptions* pOptions);
-
- void GetBackground(CFX_DIBitmap* pBuffer, const CPDF_PageObject* pObj,
- const CPDF_RenderOptions* pOptions, CFX_AffineMatrix* pFinalMatrix);
-
- CPDF_PageRenderCache* GetPageCache() const
- {
- return m_pPageCache;
- }
-
-
-
- CPDF_Document* m_pDocument;
-
- CPDF_Dictionary* m_pPageResources;
-
- CPDF_PageRenderCache* m_pPageCache;
-
-protected:
-
- CFX_ArrayTemplate<struct _PDF_RenderItem> m_ContentList;
-
- IPDF_BackgroundDraw* m_pBackgroundDraw;
-
- FX_BOOL m_bFirstLayer;
-
- void Render(CFX_RenderDevice* pDevice, const CPDF_PageObject* pStopObj,
- const CPDF_RenderOptions* pOptions, const CFX_AffineMatrix* pFinalMatrix);
- friend class CPDF_RenderStatus;
- friend class CPDF_ProgressiveRenderer;
-};
-class IPDF_BackgroundDraw
-{
-public:
-
- virtual void OnDrawBackground(
- CFX_RenderDevice* pBitmapDevice,
- const CFX_AffineMatrix* pOriginal2Bitmap
- ) = 0;
-};
-class CPDF_ProgressiveRenderer : public CFX_Object
-{
-public:
-
- CPDF_ProgressiveRenderer();
-
- ~CPDF_ProgressiveRenderer();
-
- typedef enum {
- Ready,
- ToBeContinued,
- Done,
- Failed
- } RenderStatus;
-
- RenderStatus GetStatus()
- {
- return m_Status;
- }
-
-
-
- void Start(CPDF_RenderContext* pContext, CFX_RenderDevice* pDevice,
- const CPDF_RenderOptions* pOptions, class IFX_Pause* pPause, FX_BOOL bDropObjects = FALSE);
-
- void Continue(class IFX_Pause* pPause);
-
-
- int EstimateProgress();
-
- void Clear();
-protected:
-
- RenderStatus m_Status;
-
- CPDF_RenderContext* m_pContext;
-
- CFX_RenderDevice* m_pDevice;
-
- const CPDF_RenderOptions* m_pOptions;
-
- FX_BOOL m_bDropObjects;
-
- class CPDF_RenderStatus* m_pRenderer;
-
- CFX_FloatRect m_ClipRect;
-
- FX_DWORD m_LayerIndex;
-
- FX_DWORD m_ObjectIndex;
-
- FX_POSITION m_ObjectPos;
-
- FX_POSITION m_PrevLastPos;
-
- void RenderStep();
-};
-class CPDF_TextRenderer : public CFX_Object
-{
-public:
-
- static void DrawTextString(CFX_RenderDevice* pDevice, int left, int top,
- CPDF_Font* pFont,
- int height,
- const CFX_ByteString& str,
- FX_ARGB argb);
-
- static void DrawTextString(CFX_RenderDevice* pDevice, FX_FLOAT origin_x, FX_FLOAT origin_y,
- CPDF_Font* pFont,
- FX_FLOAT font_size,
- const CFX_AffineMatrix* matrix,
- const CFX_ByteString& str,
- FX_ARGB fill_argb,
- FX_ARGB stroke_argb = 0,
- const CFX_GraphStateData* pGraphState = NULL,
- const CPDF_RenderOptions* pOptions = NULL
- );
-
- static FX_BOOL DrawTextPath(CFX_RenderDevice* pDevice, int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pCharPos,
- CPDF_Font* pFont, FX_FLOAT font_size,
- const CFX_AffineMatrix* pText2User, const CFX_AffineMatrix* pUser2Device,
- const CFX_GraphStateData* pGraphState,
- FX_ARGB fill_argb, FX_ARGB stroke_argb, CFX_PathData* pClippingPath, int nFlag = 0);
-
- static FX_BOOL DrawNormalText(CFX_RenderDevice* pDevice, int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pCharPos,
- CPDF_Font* pFont, FX_FLOAT font_size, const CFX_AffineMatrix* pText2Device,
- FX_ARGB fill_argb, const CPDF_RenderOptions* pOptions);
-
- static FX_BOOL DrawType3Text(CFX_RenderDevice* pDevice, int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pCharPos,
- CPDF_Font* pFont, FX_FLOAT font_size, const CFX_AffineMatrix* pText2Device,
- FX_ARGB fill_argb);
-};
-class IPDF_PageImageCache
-{
-public:
-
- static IPDF_PageImageCache* Create();
-
- virtual ~IPDF_PageImageCache() {}
-
- virtual void OutputPage(CFX_RenderDevice* pDevice, CPDF_Page* pPage,
- int pos_x, int pos_y, int size_x, int size_y, int rotate) = 0;
-
- virtual void SetCacheLimit(FX_DWORD limit) = 0;
-};
-class CPDF_PageRenderCache : public CFX_Object
-{
-public:
- CPDF_PageRenderCache(CPDF_Page* pPage)
- {
- m_pPage = pPage;
- m_nTimeCount = 0;
- m_nCacheSize = 0;
- m_pCurImageCache = NULL;
- m_bCurFindCache = FALSE;
- m_pCurImageCaches = NULL;
- }
- ~CPDF_PageRenderCache()
- {
- ClearAll();
- }
- void ClearAll();
- void ClearImageData();
-
- FX_DWORD EstimateSize();
- void CacheOptimization(FX_INT32 dwLimitCacheSize);
- FX_DWORD GetCachedSize(CPDF_Stream* pStream) const;
- FX_DWORD GetTimeCount() const
- {
- return m_nTimeCount;
- }
- void SetTimeCount(FX_DWORD dwTimeCount)
- {
- m_nTimeCount = dwTimeCount;
- }
-
- void GetCachedBitmap(CPDF_Stream* pStream, CFX_DIBSource*& pBitmap, CFX_DIBSource*& pMask, FX_DWORD& MatteColor,
- FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0, FX_BOOL bLoadMask = FALSE,
- CPDF_RenderStatus* pRenderStatus = NULL, FX_INT32 downsampleWidth = 0, FX_INT32 downsampleHeight = 0);
-
- void ResetBitmap(CPDF_Stream* pStream, const CFX_DIBitmap* pBitmap);
- void ClearImageCache(CPDF_Stream* pStream);
- CPDF_Page* GetPage()
- {
- return m_pPage;
- }
- CFX_MapPtrToPtr m_ImageCaches;
-public:
- FX_BOOL StartGetCachedBitmap(CPDF_Stream* pStream, FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0,
- FX_BOOL bLoadMask = FALSE, CPDF_RenderStatus* pRenderStatus = NULL,
- FX_INT32 downsampleWidth = 0, FX_INT32 downsampleHeight = 0);
-
- FX_BOOL Continue(IFX_Pause* pPause);
- CPDF_ImageCache* m_pCurImageCache;
- CFX_PtrArray* m_pCurImageCaches;
-protected:
- friend class CPDF_Page;
- CPDF_Page* m_pPage;
-
- FX_DWORD m_nTimeCount;
- FX_DWORD m_nCacheSize;
- FX_BOOL m_bCurFindCache;
-};
-class CPDF_RenderConfig : public CFX_Object
-{
-public:
- CPDF_RenderConfig();
- ~CPDF_RenderConfig();
- int m_HalftoneLimit;
- int m_RenderStepLimit;
-};
-#endif
+// 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 _FPDF_RENDER_
+#define _FPDF_RENDER_
+#ifndef _FPDF_PAGE_
+#include "fpdf_page.h"
+#endif
+#ifndef _FX_GE_H_
+#include "../fxge/fx_ge.h"
+#endif
+class CPDF_RenderContext;
+class CPDF_RenderOptions;
+class CPDF_ImageCache;
+class IPDF_OCContext;
+class CPDF_QuickStretcher;
+class CFX_PathData;
+class CFX_GraphStateData;
+class CFX_RenderDevice;
+class CPDF_TextObject;
+class CPDF_PathObject;
+class CPDF_ImageObject;
+class CPDF_ShadingObject;
+class CPDF_FormObject;
+class IPDF_OCContext
+{
+public:
+
+ virtual ~IPDF_OCContext() {}
+
+ virtual FX_BOOL CheckOCGVisible(const CPDF_Dictionary* pOCG) = 0;
+
+ FX_BOOL CheckObjectVisible(const CPDF_PageObject* pObj);
+};
+#define RENDER_COLOR_NORMAL 0
+#define RENDER_COLOR_GRAY 1
+#define RENDER_COLOR_TWOCOLOR 2
+#define RENDER_COLOR_ALPHA 3
+#define RENDER_CLEARTYPE 0x00000001
+#define RENDER_PRINTGRAPHICTEXT 0x00000002
+#define RENDER_FORCE_DOWNSAMPLE 0x00000004
+#define RENDER_PRINTPREVIEW 0x00000008
+#define RENDER_BGR_STRIPE 0x00000010
+#define RENDER_NO_NATIVETEXT 0x00000020
+#define RENDER_FORCE_HALFTONE 0x00000040
+#define RENDER_RECT_AA 0x00000080
+#define RENDER_FILL_FULLCOVER 0x00000100
+#define RENDER_PRINTIMAGETEXT 0x00000200
+#define RENDER_OVERPRINT 0x00000400
+#define RENDER_THINLINE 0x00000800
+#define RENDER_NOTEXTSMOOTH 0x10000000
+#define RENDER_NOPATHSMOOTH 0x20000000
+#define RENDER_NOIMAGESMOOTH 0x40000000
+#define RENDER_LIMITEDIMAGECACHE 0x80000000
+class CPDF_RenderOptions : public CFX_Object
+{
+public:
+
+ CPDF_RenderOptions();
+
+ int m_ColorMode;
+
+ FX_COLORREF m_BackColor;
+
+ FX_COLORREF m_ForeColor;
+
+ FX_DWORD m_Flags;
+
+ int m_Interpolation;
+
+ FX_DWORD m_AddFlags;
+
+ IPDF_OCContext* m_pOCContext;
+
+ FX_DWORD m_dwLimitCacheSize;
+
+ int m_HalftoneLimit;
+
+ FX_ARGB TranslateColor(FX_ARGB argb) const;
+};
+class CPDF_RenderContext : public CFX_Object
+{
+public:
+
+ CPDF_RenderContext();
+
+ void Create(CPDF_Page* pPage, FX_BOOL bFirstLayer = TRUE);
+
+ void Create(CPDF_Document* pDoc = NULL, CPDF_PageRenderCache* pPageCache = NULL,
+ CPDF_Dictionary* pPageResources = NULL, FX_BOOL bFirstLayer = TRUE);
+
+ ~CPDF_RenderContext();
+
+ void Clear();
+
+ void AppendObjectList(CPDF_PageObjects* pObjs, const CFX_AffineMatrix* pObject2Device);
+
+ void SetBackground(class IPDF_BackgroundDraw* pBackground);
+
+ void Render(CFX_RenderDevice* pDevice, const CPDF_RenderOptions* pOptions = NULL,
+ const CFX_AffineMatrix* pFinalMatrix = NULL);
+
+ void DrawObjectList(CFX_RenderDevice* pDevice, CPDF_PageObjects* pObjs,
+ const CFX_AffineMatrix* pObject2Device, const CPDF_RenderOptions* pOptions);
+
+ void GetBackground(CFX_DIBitmap* pBuffer, const CPDF_PageObject* pObj,
+ const CPDF_RenderOptions* pOptions, CFX_AffineMatrix* pFinalMatrix);
+
+ CPDF_PageRenderCache* GetPageCache() const
+ {
+ return m_pPageCache;
+ }
+
+
+
+ CPDF_Document* m_pDocument;
+
+ CPDF_Dictionary* m_pPageResources;
+
+ CPDF_PageRenderCache* m_pPageCache;
+
+protected:
+
+ CFX_ArrayTemplate<struct _PDF_RenderItem> m_ContentList;
+
+ IPDF_BackgroundDraw* m_pBackgroundDraw;
+
+ FX_BOOL m_bFirstLayer;
+
+ void Render(CFX_RenderDevice* pDevice, const CPDF_PageObject* pStopObj,
+ const CPDF_RenderOptions* pOptions, const CFX_AffineMatrix* pFinalMatrix);
+ friend class CPDF_RenderStatus;
+ friend class CPDF_ProgressiveRenderer;
+};
+class IPDF_BackgroundDraw
+{
+public:
+
+ virtual void OnDrawBackground(
+ CFX_RenderDevice* pBitmapDevice,
+ const CFX_AffineMatrix* pOriginal2Bitmap
+ ) = 0;
+};
+class CPDF_ProgressiveRenderer : public CFX_Object
+{
+public:
+
+ CPDF_ProgressiveRenderer();
+
+ ~CPDF_ProgressiveRenderer();
+
+ typedef enum {
+ Ready,
+ ToBeContinued,
+ Done,
+ Failed
+ } RenderStatus;
+
+ RenderStatus GetStatus()
+ {
+ return m_Status;
+ }
+
+
+
+ void Start(CPDF_RenderContext* pContext, CFX_RenderDevice* pDevice,
+ const CPDF_RenderOptions* pOptions, class IFX_Pause* pPause, FX_BOOL bDropObjects = FALSE);
+
+ void Continue(class IFX_Pause* pPause);
+
+
+ int EstimateProgress();
+
+ void Clear();
+protected:
+
+ RenderStatus m_Status;
+
+ CPDF_RenderContext* m_pContext;
+
+ CFX_RenderDevice* m_pDevice;
+
+ const CPDF_RenderOptions* m_pOptions;
+
+ FX_BOOL m_bDropObjects;
+
+ class CPDF_RenderStatus* m_pRenderer;
+
+ CFX_FloatRect m_ClipRect;
+
+ FX_DWORD m_LayerIndex;
+
+ FX_DWORD m_ObjectIndex;
+
+ FX_POSITION m_ObjectPos;
+
+ FX_POSITION m_PrevLastPos;
+
+ void RenderStep();
+};
+class CPDF_TextRenderer : public CFX_Object
+{
+public:
+
+ static void DrawTextString(CFX_RenderDevice* pDevice, int left, int top,
+ CPDF_Font* pFont,
+ int height,
+ const CFX_ByteString& str,
+ FX_ARGB argb);
+
+ static void DrawTextString(CFX_RenderDevice* pDevice, FX_FLOAT origin_x, FX_FLOAT origin_y,
+ CPDF_Font* pFont,
+ FX_FLOAT font_size,
+ const CFX_AffineMatrix* matrix,
+ const CFX_ByteString& str,
+ FX_ARGB fill_argb,
+ FX_ARGB stroke_argb = 0,
+ const CFX_GraphStateData* pGraphState = NULL,
+ const CPDF_RenderOptions* pOptions = NULL
+ );
+
+ static FX_BOOL DrawTextPath(CFX_RenderDevice* pDevice, int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pCharPos,
+ CPDF_Font* pFont, FX_FLOAT font_size,
+ const CFX_AffineMatrix* pText2User, const CFX_AffineMatrix* pUser2Device,
+ const CFX_GraphStateData* pGraphState,
+ FX_ARGB fill_argb, FX_ARGB stroke_argb, CFX_PathData* pClippingPath, int nFlag = 0);
+
+ static FX_BOOL DrawNormalText(CFX_RenderDevice* pDevice, int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pCharPos,
+ CPDF_Font* pFont, FX_FLOAT font_size, const CFX_AffineMatrix* pText2Device,
+ FX_ARGB fill_argb, const CPDF_RenderOptions* pOptions);
+
+ static FX_BOOL DrawType3Text(CFX_RenderDevice* pDevice, int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pCharPos,
+ CPDF_Font* pFont, FX_FLOAT font_size, const CFX_AffineMatrix* pText2Device,
+ FX_ARGB fill_argb);
+};
+class IPDF_PageImageCache
+{
+public:
+
+ static IPDF_PageImageCache* Create();
+
+ virtual ~IPDF_PageImageCache() {}
+
+ virtual void OutputPage(CFX_RenderDevice* pDevice, CPDF_Page* pPage,
+ int pos_x, int pos_y, int size_x, int size_y, int rotate) = 0;
+
+ virtual void SetCacheLimit(FX_DWORD limit) = 0;
+};
+class CPDF_PageRenderCache : public CFX_Object
+{
+public:
+ CPDF_PageRenderCache(CPDF_Page* pPage)
+ {
+ m_pPage = pPage;
+ m_nTimeCount = 0;
+ m_nCacheSize = 0;
+ m_pCurImageCache = NULL;
+ m_bCurFindCache = FALSE;
+ m_pCurImageCaches = NULL;
+ }
+ ~CPDF_PageRenderCache()
+ {
+ ClearAll();
+ }
+ void ClearAll();
+ void ClearImageData();
+
+ FX_DWORD EstimateSize();
+ void CacheOptimization(FX_INT32 dwLimitCacheSize);
+ FX_DWORD GetCachedSize(CPDF_Stream* pStream) const;
+ FX_DWORD GetTimeCount() const
+ {
+ return m_nTimeCount;
+ }
+ void SetTimeCount(FX_DWORD dwTimeCount)
+ {
+ m_nTimeCount = dwTimeCount;
+ }
+
+ void GetCachedBitmap(CPDF_Stream* pStream, CFX_DIBSource*& pBitmap, CFX_DIBSource*& pMask, FX_DWORD& MatteColor,
+ FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0, FX_BOOL bLoadMask = FALSE,
+ CPDF_RenderStatus* pRenderStatus = NULL, FX_INT32 downsampleWidth = 0, FX_INT32 downsampleHeight = 0);
+
+ void ResetBitmap(CPDF_Stream* pStream, const CFX_DIBitmap* pBitmap);
+ void ClearImageCache(CPDF_Stream* pStream);
+ CPDF_Page* GetPage()
+ {
+ return m_pPage;
+ }
+ CFX_MapPtrToPtr m_ImageCaches;
+public:
+ FX_BOOL StartGetCachedBitmap(CPDF_Stream* pStream, FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0,
+ FX_BOOL bLoadMask = FALSE, CPDF_RenderStatus* pRenderStatus = NULL,
+ FX_INT32 downsampleWidth = 0, FX_INT32 downsampleHeight = 0);
+
+ FX_BOOL Continue(IFX_Pause* pPause);
+ CPDF_ImageCache* m_pCurImageCache;
+ CFX_PtrArray* m_pCurImageCaches;
+protected:
+ friend class CPDF_Page;
+ CPDF_Page* m_pPage;
+
+ FX_DWORD m_nTimeCount;
+ FX_DWORD m_nCacheSize;
+ FX_BOOL m_bCurFindCache;
+};
+class CPDF_RenderConfig : public CFX_Object
+{
+public:
+ CPDF_RenderConfig();
+ ~CPDF_RenderConfig();
+ int m_HalftoneLimit;
+ int m_RenderStepLimit;
+};
+#endif
diff --git a/core/include/fpdfapi/fpdf_resource.h b/core/include/fpdfapi/fpdf_resource.h
index eea3afc4c6..49e7148ee6 100644
--- a/core/include/fpdfapi/fpdf_resource.h
+++ b/core/include/fpdfapi/fpdf_resource.h
@@ -1,960 +1,960 @@
-// 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 _FPDF_RESOURCE_
-#define _FPDF_RESOURCE_
-#ifndef _FPDF_PARSER_
-#include "fpdf_parser.h"
-#endif
-#ifndef _FX_FONT_H_
-#include "../fxge/fx_font.h"
-#endif
-class CPDF_Font;
-class CPDF_Type1Font;
-class CPDF_TrueTypeFont;
-class CPDF_CIDFont;
-class CPDF_Type3Font;
-class CPDF_FontEncoding;
-class CPDF_CMap;
-class CPDF_CID2UnicodeMap;
-class CPDF_ColorSpace;
-class CPDF_Color;
-class CPDF_Function;
-class CPDF_Pattern;
-class CPDF_TilingPattern;
-class CPDF_ShadingPattern;
-class CPDF_Image;
-class CPDF_Face;
-class CPDF_ToUnicodeMap;
-class CFX_SubstFont;
-class CFX_Font;
-class CPDF_RenderContext;
-class CPDF_Form;
-class CPDF_ImageObject;
-class CFX_DIBitmap;
-typedef struct FT_FaceRec_* FXFT_Face;
-class CFX_CTTGSUBTable;
-class CPDF_Page;
-#define PDFFONT_TYPE1 1
-#define PDFFONT_TRUETYPE 2
-#define PDFFONT_TYPE3 3
-#define PDFFONT_CIDFONT 4
-#define PDFFONT_FIXEDPITCH 1
-#define PDFFONT_SERIF 2
-#define PDFFONT_SYMBOLIC 4
-#define PDFFONT_SCRIPT 8
-#define PDFFONT_NONSYMBOLIC 32
-#define PDFFONT_ITALIC 64
-#define PDFFONT_ALLCAP 0x10000
-#define PDFFONT_SMALLCAP 0x20000
-#define PDFFONT_FORCEBOLD 0x40000
-#define PDFFONT_USEEXTERNATTR 0x80000
-FX_WCHAR PDF_UnicodeFromAdobeName(const FX_CHAR* name);
-CFX_ByteString PDF_AdobeNameFromUnicode(FX_WCHAR unicode);
-class CPDF_Font : public CFX_Object
-{
-public:
-
- static CPDF_Font* CreateFontF(CPDF_Document* pDoc, CPDF_Dictionary* pFontDict);
-
- static CPDF_Font* GetStockFont(CPDF_Document* pDoc, FX_BSTR fontname);
-
- virtual ~CPDF_Font();
-
-
-
-
- int GetFontType() const
- {
- return m_FontType;
- }
-
- CFX_ByteString GetFontTypeName() const;
-
- const CFX_ByteString& GetBaseFont() const
- {
- return m_BaseFont;
- }
-
- const CFX_SubstFont* GetSubstFont() const
- {
- return m_Font.GetSubstFont();
- }
-
- FX_DWORD GetFlags() const
- {
- return m_Flags;
- }
-
- virtual FX_BOOL IsVertWriting()const;
-
-
-
-
- CPDF_Type1Font* GetType1Font() const
- {
- return m_FontType == PDFFONT_TYPE1 ? (CPDF_Type1Font*)(void*)this : NULL;
- }
-
- CPDF_TrueTypeFont* GetTrueTypeFont() const
- {
- return m_FontType == PDFFONT_TRUETYPE ? (CPDF_TrueTypeFont*)(void*)this : NULL;
- }
-
- CPDF_CIDFont* GetCIDFont() const
- {
- return (m_FontType == PDFFONT_CIDFONT) ? (CPDF_CIDFont*)(void*)this : NULL;
- }
-
- CPDF_Type3Font* GetType3Font() const
- {
- return (m_FontType == PDFFONT_TYPE3) ? (CPDF_Type3Font*)(void*)this : NULL;
- }
-
-
- FX_BOOL IsEmbedded() const
- {
- return m_FontType == PDFFONT_TYPE3 || m_pFontFile != NULL;
- }
-
- virtual FX_BOOL IsUnicodeCompatible() const
- {
- return FALSE;
- }
-
- CPDF_StreamAcc* GetFontFile() const
- {
- return m_pFontFile;
- }
-
- CPDF_Dictionary* GetFontDict() const
- {
- return m_pFontDict;
- }
-
- FX_BOOL IsStandardFont() const;
-
- FXFT_Face GetFace() const
- {
- return m_Font.GetFace();
- }
-
-
-
- virtual FX_DWORD GetNextChar(FX_LPCSTR pString, int& offset) const
- {
- return (FX_BYTE)pString[offset++];
- }
-
- virtual int CountChar(FX_LPCSTR pString, int size) const
- {
- return size;
- }
-
- void AppendChar(CFX_ByteString& str, FX_DWORD charcode) const;
-
- virtual int AppendChar(FX_LPSTR buf, FX_DWORD charcode) const
- {
- *buf = (FX_CHAR)charcode;
- return 1;
- }
-
- virtual int GetCharSize(FX_DWORD charcode) const
- {
- return 1;
- }
-
-
-
-
- virtual int GlyphFromCharCode(FX_DWORD charcode, FX_BOOL *pVertGlyph = NULL) = 0;
- virtual int GlyphFromCharCodeExt(FX_DWORD charcode)
- {
- return GlyphFromCharCode(charcode);
- }
-
- CFX_WideString UnicodeFromCharCode(FX_DWORD charcode) const;
-
- FX_DWORD CharCodeFromUnicode(FX_WCHAR Unicode) const;
-
- CFX_CharMap* GetCharMap()
- {
- return m_pCharMap;
- }
-
- CFX_ByteString EncodeString(const CFX_WideString& str) const;
-
- CFX_WideString DecodeString(const CFX_ByteString& str) const;
-
-
-
-
- void GetFontBBox(FX_RECT& rect) const
- {
- rect = m_FontBBox;
- }
-
- int GetTypeAscent() const
- {
- return m_Ascent;
- }
-
- int GetTypeDescent() const
- {
- return m_Descent;
- }
-
- int GetItalicAngle() const
- {
- return m_ItalicAngle;
- }
-
- int GetStemV() const
- {
- return m_StemV;
- }
-
- int GetStringWidth(const FX_CHAR* pString, int size);
-
- virtual int GetCharWidthF(FX_DWORD charcode, int level = 0) = 0;
-
- virtual int GetCharTypeWidth(FX_DWORD charcode);
-
- virtual void GetCharBBox(FX_DWORD charcode, FX_RECT& rect, int level = 0) = 0;
-
-
-
- CPDF_Document* m_pDocument;
-
- class CFX_PathData* LoadGlyphPath(FX_DWORD charcode, int dest_width = 0);
-
- CFX_Font m_Font;
-protected:
-
- CPDF_Font();
-
- FX_BOOL Initialize();
-
- FX_BOOL Load();
-
- virtual FX_BOOL _Load() = 0;
-
- virtual FX_WCHAR _UnicodeFromCharCode(FX_DWORD charcode) const = 0;
-
- virtual FX_DWORD _CharCodeFromUnicode(FX_WCHAR Unicode) const = 0;
-
- void LoadUnicodeMap();
-
- void LoadPDFEncoding(CPDF_Object* pEncoding, int& iBaseEncoding,
- CFX_ByteString*& pCharNames, FX_BOOL bEmbedded, FX_BOOL bTrueType);
-
- void LoadFontDescriptor(CPDF_Dictionary*);
-
- void LoadCharWidths(FX_WORD* pWidths);
-
- void CheckFontMetrics();
-
- CFX_CharMap* m_pCharMap;
-
-
-
- int m_FontType;
-
- CFX_ByteString m_BaseFont;
-
- CPDF_StreamAcc* m_pFontFile;
-
- CPDF_Dictionary* m_pFontDict;
-
- CPDF_ToUnicodeMap* m_pToUnicodeMap;
-
- FX_BOOL m_bToUnicodeLoaded;
-
-
-
-
- int m_Flags;
-
- FX_RECT m_FontBBox;
-
- int m_StemV;
-
- int m_Ascent;
-
- int m_Descent;
-
- int m_ItalicAngle;
-
-};
-#define PDFFONT_ENCODING_BUILTIN 0
-#define PDFFONT_ENCODING_WINANSI 1
-#define PDFFONT_ENCODING_MACROMAN 2
-#define PDFFONT_ENCODING_MACEXPERT 3
-#define PDFFONT_ENCODING_STANDARD 4
-#define PDFFONT_ENCODING_ADOBE_SYMBOL 5
-#define PDFFONT_ENCODING_ZAPFDINGBATS 6
-#define PDFFONT_ENCODING_PDFDOC 7
-#define PDFFONT_ENCODING_MS_SYMBOL 8
-#define PDFFONT_ENCODING_UNICODE 9
-class CPDF_FontEncoding : public CFX_Object
-{
-public:
-
- CPDF_FontEncoding();
-
- CPDF_FontEncoding(int PredefinedEncoding);
-
- void LoadEncoding(CPDF_Object* pEncoding);
-
- FX_BOOL IsIdentical(CPDF_FontEncoding* pAnother) const;
-
- FX_WCHAR UnicodeFromCharCode(FX_BYTE charcode) const
- {
- return m_Unicodes[charcode];
- }
-
- int CharCodeFromUnicode(FX_WCHAR unicode) const;
-
- void SetUnicode(FX_BYTE charcode, FX_WCHAR unicode)
- {
- m_Unicodes[charcode] = unicode;
- }
-
- CPDF_Object* Realize();
-public:
-
- FX_WCHAR m_Unicodes[256];
-};
-class CPDF_SimpleFont : public CPDF_Font
-{
-public:
-
- CPDF_SimpleFont();
-
- virtual ~CPDF_SimpleFont();
-
- CPDF_FontEncoding* GetEncoding()
- {
- return &m_Encoding;
- }
- virtual int GetCharWidthF(FX_DWORD charcode, int level = 0);
- virtual void GetCharBBox(FX_DWORD charcode, FX_RECT& rect, int level = 0);
- virtual int GlyphFromCharCode(FX_DWORD charcode, FX_BOOL *pVertGlyph = NULL);
- virtual FX_BOOL IsUnicodeCompatible() const;
-protected:
-
- FX_BOOL LoadCommon();
-
- void LoadSubstFont();
-
- void LoadFaceMetrics();
-
- virtual void LoadGlyphMap() = 0;
- virtual FX_WCHAR _UnicodeFromCharCode(FX_DWORD charcode) const
- {
- return m_Encoding.UnicodeFromCharCode((FX_BYTE)charcode);
- }
- virtual FX_DWORD _CharCodeFromUnicode(FX_WCHAR Unicode) const
- {
- return m_Encoding.CharCodeFromUnicode(Unicode);
- }
-
-
-
- CPDF_FontEncoding m_Encoding;
-
- FX_WORD m_GlyphIndex[256];
- FX_WORD m_ExtGID[256];
-
-
-
-
- CFX_ByteString* m_pCharNames;
-
- int m_BaseEncoding;
-
-
-
-
- FX_WORD m_CharWidth[256];
-
- FX_SMALL_RECT m_CharBBox[256];
-
- FX_BOOL m_bUseFontWidth;
-
- void LoadCharMetrics(int charcode);
-
-};
-class CPDF_Type1Font : public CPDF_SimpleFont
-{
-public:
-
- CPDF_Type1Font();
-
- int GetBase14Font()
- {
- return m_Base14Font;
- }
- virtual int GlyphFromCharCodeExt(FX_DWORD charcode);
-protected:
- virtual FX_BOOL _Load();
-
- int m_Base14Font;
- virtual void LoadGlyphMap();
-};
-class CPDF_TrueTypeFont : public CPDF_SimpleFont
-{
-public:
-
- CPDF_TrueTypeFont();
-protected:
- virtual FX_BOOL _Load();
- virtual void LoadGlyphMap();
-};
-class CPDF_Type3Char : public CFX_Object
-{
-public:
-
- CPDF_Type3Char();
-
- ~CPDF_Type3Char();
-
- FX_BOOL LoadBitmap(CPDF_RenderContext* pContext);
-
- FX_BOOL m_bColored;
-
- FX_BOOL m_bPageRequired;
-
-
-
- CPDF_Form* m_pForm;
-
- CFX_AffineMatrix m_ImageMatrix;
-
- CFX_DIBitmap* m_pBitmap;
-
-
- int m_Width;
-
- FX_RECT m_BBox;
-};
-class CPDF_Type3Font : public CPDF_SimpleFont
-{
-public:
- CPDF_Type3Font();
- virtual ~CPDF_Type3Font();
- void SetPageResources(CPDF_Dictionary* pResources)
- {
- m_pPageResources = pResources;
- }
- CPDF_Type3Char* LoadChar(FX_DWORD charcode, int level = 0);
- virtual int GetCharWidthF(FX_DWORD charcode, int level = 0);
- virtual int GetCharTypeWidth(FX_DWORD charcode)
- {
- return GetCharWidthF(charcode);
- }
- virtual void GetCharBBox(FX_DWORD charcode, FX_RECT& rect, int level = 0);
- CFX_AffineMatrix& GetFontMatrix()
- {
- return m_FontMatrix;
- }
- void CheckType3FontMetrics();
-private:
- virtual FX_BOOL _Load();
- virtual void LoadGlyphMap() {}
- int m_CharWidthL[256];
- CPDF_Dictionary* m_pCharProcs;
- CPDF_Dictionary* m_pPageResources;
- CPDF_Dictionary* m_pFontResources;
- CFX_MapPtrToPtr m_CacheMap;
- CFX_MapPtrToPtr m_DeletedMap;
-protected:
- CFX_AffineMatrix m_FontMatrix;
-};
-#define CIDSET_UNKNOWN 0
-#define CIDSET_GB1 1
-#define CIDSET_CNS1 2
-#define CIDSET_JAPAN1 3
-#define CIDSET_KOREA1 4
-#define CIDSET_UNICODE 5
-class CPDF_CIDFont : public CPDF_Font
-{
-public:
-
- CPDF_CIDFont();
-
- virtual ~CPDF_CIDFont();
-
- FX_BOOL LoadGB2312();
- virtual int GlyphFromCharCode(FX_DWORD charcode, FX_BOOL *pVertGlyph = NULL);
- virtual int GetCharWidthF(FX_DWORD charcode, int level = 0);
- virtual void GetCharBBox(FX_DWORD charcode, FX_RECT& rect, int level = 0);
-
- FX_WORD CIDFromCharCode(FX_DWORD charcode) const;
-
- FX_BOOL IsTrueType()
- {
- return !m_bType1;
- }
-
-
- virtual FX_DWORD GetNextChar(const FX_CHAR* pString, int& offset) const;
- virtual int CountChar(const FX_CHAR* pString, int size) const;
- virtual int AppendChar(FX_LPSTR str, FX_DWORD charcode) const;
- virtual int GetCharSize(FX_DWORD charcode) const;
-
-
- int GetCharset() const
- {
- return m_Charset;
- }
-
- FX_LPCBYTE GetCIDTransform(FX_WORD CID) const;
-
-
-
- virtual FX_BOOL IsVertWriting() const;
-
- short GetVertWidth(FX_WORD CID) const;
-
- void GetVertOrigin(FX_WORD CID, short& vx, short& vy) const;
-
- virtual FX_BOOL IsUnicodeCompatible() const;
- virtual FX_BOOL IsFontStyleFromCharCode(FX_DWORD charcode) const;
-protected:
- friend class CPDF_Font;
- virtual FX_BOOL _Load();
- virtual FX_WCHAR _UnicodeFromCharCode(FX_DWORD charcode) const;
- virtual FX_DWORD _CharCodeFromUnicode(FX_WCHAR Unicode) const;
- int GetGlyphIndex(FX_DWORD unicodeb, FX_BOOL *pVertGlyph);
-
- CPDF_CMap* m_pCMap;
-
- CPDF_CMap* m_pAllocatedCMap;
-
- CPDF_CID2UnicodeMap* m_pCID2UnicodeMap;
-
- int m_Charset;
-
- FX_BOOL m_bType1;
-
- CPDF_StreamAcc* m_pCIDToGIDMap;
- FX_BOOL m_bCIDIsGID;
-
-
-
- FX_WORD m_DefaultWidth;
-
- FX_WORD* m_pAnsiWidths;
-
- FX_SMALL_RECT m_CharBBox[256];
-
- CFX_DWordArray m_WidthList;
-
- short m_DefaultVY;
-
- short m_DefaultW1;
-
- CFX_DWordArray m_VertMetrics;
-
-
- void LoadMetricsArray(CPDF_Array* pArray, CFX_DWordArray& result, int nElements);
-
- void LoadSubstFont();
-
- FX_BOOL m_bAdobeCourierStd;
-
- CFX_CTTGSUBTable* m_pTTGSUBTable;
-};
-#define PDFCS_DEVICEGRAY 1
-
-#define PDFCS_DEVICERGB 2
-#define PDFCS_DEVICECMYK 3
-#define PDFCS_CALGRAY 4
-#define PDFCS_CALRGB 5
-#define PDFCS_LAB 6
-#define PDFCS_ICCBASED 7
-#define PDFCS_SEPARATION 8
-#define PDFCS_DEVICEN 9
-#define PDFCS_INDEXED 10
-#define PDFCS_PATTERN 11
-class CPDF_ColorSpace : public CFX_Object
-{
-public:
-
- static CPDF_ColorSpace* GetStockCS(int Family);
-
- static CPDF_ColorSpace* Load(CPDF_Document* pDoc, CPDF_Object* pCSObj);
-
- void ReleaseCS();
-
- int GetBufSize() const;
-
- FX_FLOAT* CreateBuf();
-
- void GetDefaultColor(FX_FLOAT* buf) const;
-
- int CountComponents() const
- {
- return m_nComponents;
- }
-
- int GetFamily() const
- {
- return m_Family;
- }
-
- virtual void GetDefaultValue(int iComponent, FX_FLOAT& value, FX_FLOAT& min, FX_FLOAT& max) const
- {
- value = 0;
- min = 0;
- max = 1.0f;
- }
-
- FX_BOOL sRGB() const;
-
-
-
- virtual FX_BOOL GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const = 0;
-
- virtual FX_BOOL SetRGB(FX_FLOAT* pBuf, FX_FLOAT R, FX_FLOAT G, FX_FLOAT B) const
- {
- return FALSE;
- }
-
-
-
-
- FX_BOOL GetCMYK(FX_FLOAT* pBuf, FX_FLOAT& c, FX_FLOAT& m, FX_FLOAT& y, FX_FLOAT& k) const;
-
- FX_BOOL SetCMYK(FX_FLOAT* pBuf, FX_FLOAT c, FX_FLOAT m, FX_FLOAT y, FX_FLOAT k) const;
-
-
- virtual void TranslateImageLine(FX_LPBYTE dest_buf, FX_LPCBYTE src_buf, int pixels,
- int image_width, int image_height, FX_BOOL bTransMask = FALSE) const;
-
- CPDF_Array*& GetArray()
- {
- return m_pArray;
- }
-
- int GetMaxIndex() const;
-
- virtual CPDF_ColorSpace* GetBaseCS() const
- {
- return NULL;
- }
-
- virtual void EnableStdConversion(FX_BOOL bEnabled);
- CPDF_Document* m_pDocument;
-protected:
-
- CPDF_ColorSpace();
-
- virtual ~CPDF_ColorSpace() {}
- virtual FX_BOOL v_Load(CPDF_Document* pDoc, CPDF_Array* pArray)
- {
- return TRUE;
- }
- virtual FX_BOOL v_GetCMYK(FX_FLOAT* pBuf, FX_FLOAT& c, FX_FLOAT& m, FX_FLOAT& y, FX_FLOAT& k) const
- {
- return FALSE;
- }
- virtual FX_BOOL v_SetCMYK(FX_FLOAT* pBuf, FX_FLOAT c, FX_FLOAT m, FX_FLOAT y, FX_FLOAT k) const
- {
- return FALSE;
- }
-
- int m_Family;
-
- int m_nComponents;
-
- CPDF_Array* m_pArray;
-
- FX_DWORD m_dwStdConversion;
-};
-class CPDF_Color : public CFX_Object
-{
-public:
-
- CPDF_Color()
- {
- m_pBuffer = NULL;
- m_pCS = NULL;
- }
-
- CPDF_Color(int family);
-
- ~CPDF_Color();
-
- FX_BOOL IsNull() const
- {
- return m_pBuffer == NULL;
- }
-
- FX_BOOL IsEqual(const CPDF_Color& other) const;
-
- FX_BOOL IsPattern() const
- {
- return m_pCS && m_pCS->GetFamily() == PDFCS_PATTERN;
- }
-
- void Copy(const CPDF_Color* pSrc);
-
- void SetColorSpace(CPDF_ColorSpace* pCS);
-
- void SetValue(FX_FLOAT* comp);
-
- void SetValue(CPDF_Pattern* pPattern, FX_FLOAT* comp, int ncomps);
-
- FX_BOOL GetRGB(int& R, int& G, int& B) const;
-
- CPDF_Pattern* GetPattern() const;
-
- CPDF_ColorSpace* GetPatternCS() const;
-
- FX_FLOAT* GetPatternColor() const;
-
- CPDF_ColorSpace* m_pCS;
-
- FX_FLOAT* m_pBuffer;
-protected:
- void ReleaseBuffer();
- void ReleaseColorSpace();
-};
-#define PATTERN_TILING 1
-#define PATTERN_SHADING 2
-class CPDF_Pattern : public CFX_Object
-{
-public:
-
- virtual ~CPDF_Pattern() {}
-
- CPDF_Object* m_pPatternObj;
-
- int m_PatternType;
-
- CFX_AffineMatrix m_Pattern2Form;
- CFX_AffineMatrix m_ParentMatrix;
-
- CPDF_Document* m_pDocument;
-
-protected:
-
- CPDF_Pattern(const CFX_AffineMatrix* pParentMatrix)
- {
- if (pParentMatrix) {
- m_ParentMatrix = *pParentMatrix;
- }
- }
-};
-class CPDF_TilingPattern : public CPDF_Pattern
-{
-public:
-
- CPDF_TilingPattern(CPDF_Document* pDoc, CPDF_Object* pPatternObj, const CFX_AffineMatrix* parentMatrix);
-
- virtual ~CPDF_TilingPattern();
-
- FX_BOOL Load();
-
-
-
- FX_BOOL m_bColored;
-
- CFX_FloatRect m_BBox;
-
- FX_FLOAT m_XStep;
-
- FX_FLOAT m_YStep;
-
-
-
- CPDF_Form* m_pForm;
-};
-class CPDF_ShadingPattern : public CPDF_Pattern
-{
-public:
-
- CPDF_ShadingPattern(CPDF_Document* pDoc, CPDF_Object* pPatternObj, FX_BOOL bShading, const CFX_AffineMatrix* parentMatrix);
-
- virtual ~CPDF_ShadingPattern();
-
- CPDF_Object* m_pShadingObj;
-
- FX_BOOL m_bShadingObj;
-
- FX_BOOL Load();
-
- FX_BOOL Reload();
-
- int m_ShadingType;
-
- CPDF_ColorSpace* m_pCS;
-
-
- CPDF_Function* m_pFunctions[4];
-
- int m_nFuncs;
-protected:
- void Clear();
-};
-struct CPDF_MeshVertex {
- FX_FLOAT x, y;
- FX_FLOAT r, g, b;
-};
-class CPDF_MeshStream : public CFX_Object
-{
-public:
-
- FX_BOOL Load(CPDF_Stream* pShadingStream, CPDF_Function** pFuncs, int nFuncs, CPDF_ColorSpace* pCS);
-
- FX_DWORD GetFlag();
-
- void GetCoords(FX_FLOAT& x, FX_FLOAT& y);
-
- void GetColor(FX_FLOAT& r, FX_FLOAT& g, FX_FLOAT& b);
-
- FX_DWORD GetVertex(CPDF_MeshVertex& vertex, CFX_AffineMatrix* pObject2Bitmap);
-
- FX_BOOL GetVertexRow(CPDF_MeshVertex* vertex, int count, CFX_AffineMatrix* pObject2Bitmap);
- CPDF_Function** m_pFuncs;
- CPDF_ColorSpace* m_pCS;
- FX_DWORD m_nFuncs, m_nCoordBits, m_nCompBits, m_nFlagBits, m_nComps;
- FX_DWORD m_CoordMax, m_CompMax;
- FX_FLOAT m_xmin, m_xmax, m_ymin, m_ymax;
- FX_FLOAT m_ColorMin[8], m_ColorMax[8];
- CPDF_StreamAcc m_Stream;
- CFX_BitStream m_BitStream;
-};
-#define PDF_IMAGE_NO_COMPRESS 0x0000
-#define PDF_IMAGE_LOSSY_COMPRESS 0x0001
-#define PDF_IMAGE_LOSSLESS_COMPRESS 0x0002
-#define PDF_IMAGE_MASK_LOSSY_COMPRESS 0x0004
-#define PDF_IMAGE_MASK_LOSSLESS_COMPRESS 0x0008
-class CPDF_ImageSetParam
-{
-public:
- CPDF_ImageSetParam()
- : pMatteColor(NULL)
- , nQuality(80)
- {
- }
- FX_ARGB* pMatteColor;
- FX_INT32 nQuality;
-};
-class CPDF_Image : public CFX_Object
-{
-public:
-
- CPDF_Image(CPDF_Document* pDoc);
-
- ~CPDF_Image();
-
- FX_BOOL LoadImageF(CPDF_Stream* pImageStream, FX_BOOL bInline);
-
- void Release();
-
- CPDF_Image* Clone();
-
- FX_BOOL IsInline()
- {
- return m_bInline;
- }
-
- void SetInlineDict(CPDF_Dictionary* pDict)
- {
- m_pInlineDict = pDict;
- }
-
- CPDF_Dictionary* GetInlineDict() const
- {
- return m_pInlineDict;
- }
-
- CPDF_Stream* GetStream() const
- {
- return m_pStream;
- }
-
- CPDF_Dictionary* GetDict() const
- {
- return m_pStream->GetDict();
- }
-
- CPDF_Dictionary* GetOC() const
- {
- return m_pOC;
- }
-
- CPDF_Document* GetDocument() const
- {
- return m_pDocument;
- }
-
-
-
- FX_INT32 GetPixelHeight() const
- {
- return m_Height;
- }
-
- FX_INT32 GetPixelWidth() const
- {
- return m_Width;
- }
-
-
- FX_BOOL IsMask() const
- {
- return m_bIsMask;
- }
-
- FX_BOOL IsInterpol() const
- {
- return m_bInterpolate;
- }
-
- CFX_DIBSource* LoadDIBSource(CFX_DIBSource** ppMask = NULL, FX_DWORD* pMatteColor = NULL, FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0, FX_BOOL bLoadMask = FALSE) const;
-
-
-
- void SetImage(const CFX_DIBitmap* pDIBitmap, FX_INT32 iCompress, IFX_FileWrite *pFileWrite = NULL, IFX_FileRead *pFileRead = NULL, const CFX_DIBitmap* pMask = NULL, const CPDF_ImageSetParam* pParam = NULL);
-
- void SetJpegImage(FX_BYTE* pImageData, FX_DWORD size);
-
- void SetJpegImage(IFX_FileRead *pFile);
-
- void ResetCache(CPDF_Page* pPage, const CFX_DIBitmap* pDIBitmap);
-
-public:
- FX_BOOL StartLoadDIBSource(CPDF_Dictionary* pFormResource, CPDF_Dictionary* pPageResource, FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0, FX_BOOL bLoadMask = FALSE);
- FX_BOOL Continue(IFX_Pause* pPause);
- CFX_DIBSource* DetachBitmap();
- CFX_DIBSource* DetachMask();
- CFX_DIBSource* m_pDIBSource;
- CFX_DIBSource* m_pMask;
- FX_DWORD m_MatteColor;
-private:
-
- CPDF_Stream* m_pStream;
- FX_BOOL m_bInline;
- CPDF_Dictionary* m_pInlineDict;
-
- FX_INT32 m_Height;
-
- FX_INT32 m_Width;
-
- FX_BOOL m_bIsMask;
-
- FX_BOOL m_bInterpolate;
-
- CPDF_Document* m_pDocument;
-
- CPDF_Dictionary* m_pOC;
- CPDF_Dictionary* InitJPEG(FX_LPBYTE pData, FX_DWORD size);
-};
-#endif
+// 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 _FPDF_RESOURCE_
+#define _FPDF_RESOURCE_
+#ifndef _FPDF_PARSER_
+#include "fpdf_parser.h"
+#endif
+#ifndef _FX_FONT_H_
+#include "../fxge/fx_font.h"
+#endif
+class CPDF_Font;
+class CPDF_Type1Font;
+class CPDF_TrueTypeFont;
+class CPDF_CIDFont;
+class CPDF_Type3Font;
+class CPDF_FontEncoding;
+class CPDF_CMap;
+class CPDF_CID2UnicodeMap;
+class CPDF_ColorSpace;
+class CPDF_Color;
+class CPDF_Function;
+class CPDF_Pattern;
+class CPDF_TilingPattern;
+class CPDF_ShadingPattern;
+class CPDF_Image;
+class CPDF_Face;
+class CPDF_ToUnicodeMap;
+class CFX_SubstFont;
+class CFX_Font;
+class CPDF_RenderContext;
+class CPDF_Form;
+class CPDF_ImageObject;
+class CFX_DIBitmap;
+typedef struct FT_FaceRec_* FXFT_Face;
+class CFX_CTTGSUBTable;
+class CPDF_Page;
+#define PDFFONT_TYPE1 1
+#define PDFFONT_TRUETYPE 2
+#define PDFFONT_TYPE3 3
+#define PDFFONT_CIDFONT 4
+#define PDFFONT_FIXEDPITCH 1
+#define PDFFONT_SERIF 2
+#define PDFFONT_SYMBOLIC 4
+#define PDFFONT_SCRIPT 8
+#define PDFFONT_NONSYMBOLIC 32
+#define PDFFONT_ITALIC 64
+#define PDFFONT_ALLCAP 0x10000
+#define PDFFONT_SMALLCAP 0x20000
+#define PDFFONT_FORCEBOLD 0x40000
+#define PDFFONT_USEEXTERNATTR 0x80000
+FX_WCHAR PDF_UnicodeFromAdobeName(const FX_CHAR* name);
+CFX_ByteString PDF_AdobeNameFromUnicode(FX_WCHAR unicode);
+class CPDF_Font : public CFX_Object
+{
+public:
+
+ static CPDF_Font* CreateFontF(CPDF_Document* pDoc, CPDF_Dictionary* pFontDict);
+
+ static CPDF_Font* GetStockFont(CPDF_Document* pDoc, FX_BSTR fontname);
+
+ virtual ~CPDF_Font();
+
+
+
+
+ int GetFontType() const
+ {
+ return m_FontType;
+ }
+
+ CFX_ByteString GetFontTypeName() const;
+
+ const CFX_ByteString& GetBaseFont() const
+ {
+ return m_BaseFont;
+ }
+
+ const CFX_SubstFont* GetSubstFont() const
+ {
+ return m_Font.GetSubstFont();
+ }
+
+ FX_DWORD GetFlags() const
+ {
+ return m_Flags;
+ }
+
+ virtual FX_BOOL IsVertWriting()const;
+
+
+
+
+ CPDF_Type1Font* GetType1Font() const
+ {
+ return m_FontType == PDFFONT_TYPE1 ? (CPDF_Type1Font*)(void*)this : NULL;
+ }
+
+ CPDF_TrueTypeFont* GetTrueTypeFont() const
+ {
+ return m_FontType == PDFFONT_TRUETYPE ? (CPDF_TrueTypeFont*)(void*)this : NULL;
+ }
+
+ CPDF_CIDFont* GetCIDFont() const
+ {
+ return (m_FontType == PDFFONT_CIDFONT) ? (CPDF_CIDFont*)(void*)this : NULL;
+ }
+
+ CPDF_Type3Font* GetType3Font() const
+ {
+ return (m_FontType == PDFFONT_TYPE3) ? (CPDF_Type3Font*)(void*)this : NULL;
+ }
+
+
+ FX_BOOL IsEmbedded() const
+ {
+ return m_FontType == PDFFONT_TYPE3 || m_pFontFile != NULL;
+ }
+
+ virtual FX_BOOL IsUnicodeCompatible() const
+ {
+ return FALSE;
+ }
+
+ CPDF_StreamAcc* GetFontFile() const
+ {
+ return m_pFontFile;
+ }
+
+ CPDF_Dictionary* GetFontDict() const
+ {
+ return m_pFontDict;
+ }
+
+ FX_BOOL IsStandardFont() const;
+
+ FXFT_Face GetFace() const
+ {
+ return m_Font.GetFace();
+ }
+
+
+
+ virtual FX_DWORD GetNextChar(FX_LPCSTR pString, int& offset) const
+ {
+ return (FX_BYTE)pString[offset++];
+ }
+
+ virtual int CountChar(FX_LPCSTR pString, int size) const
+ {
+ return size;
+ }
+
+ void AppendChar(CFX_ByteString& str, FX_DWORD charcode) const;
+
+ virtual int AppendChar(FX_LPSTR buf, FX_DWORD charcode) const
+ {
+ *buf = (FX_CHAR)charcode;
+ return 1;
+ }
+
+ virtual int GetCharSize(FX_DWORD charcode) const
+ {
+ return 1;
+ }
+
+
+
+
+ virtual int GlyphFromCharCode(FX_DWORD charcode, FX_BOOL *pVertGlyph = NULL) = 0;
+ virtual int GlyphFromCharCodeExt(FX_DWORD charcode)
+ {
+ return GlyphFromCharCode(charcode);
+ }
+
+ CFX_WideString UnicodeFromCharCode(FX_DWORD charcode) const;
+
+ FX_DWORD CharCodeFromUnicode(FX_WCHAR Unicode) const;
+
+ CFX_CharMap* GetCharMap()
+ {
+ return m_pCharMap;
+ }
+
+ CFX_ByteString EncodeString(const CFX_WideString& str) const;
+
+ CFX_WideString DecodeString(const CFX_ByteString& str) const;
+
+
+
+
+ void GetFontBBox(FX_RECT& rect) const
+ {
+ rect = m_FontBBox;
+ }
+
+ int GetTypeAscent() const
+ {
+ return m_Ascent;
+ }
+
+ int GetTypeDescent() const
+ {
+ return m_Descent;
+ }
+
+ int GetItalicAngle() const
+ {
+ return m_ItalicAngle;
+ }
+
+ int GetStemV() const
+ {
+ return m_StemV;
+ }
+
+ int GetStringWidth(const FX_CHAR* pString, int size);
+
+ virtual int GetCharWidthF(FX_DWORD charcode, int level = 0) = 0;
+
+ virtual int GetCharTypeWidth(FX_DWORD charcode);
+
+ virtual void GetCharBBox(FX_DWORD charcode, FX_RECT& rect, int level = 0) = 0;
+
+
+
+ CPDF_Document* m_pDocument;
+
+ class CFX_PathData* LoadGlyphPath(FX_DWORD charcode, int dest_width = 0);
+
+ CFX_Font m_Font;
+protected:
+
+ CPDF_Font();
+
+ FX_BOOL Initialize();
+
+ FX_BOOL Load();
+
+ virtual FX_BOOL _Load() = 0;
+
+ virtual FX_WCHAR _UnicodeFromCharCode(FX_DWORD charcode) const = 0;
+
+ virtual FX_DWORD _CharCodeFromUnicode(FX_WCHAR Unicode) const = 0;
+
+ void LoadUnicodeMap();
+
+ void LoadPDFEncoding(CPDF_Object* pEncoding, int& iBaseEncoding,
+ CFX_ByteString*& pCharNames, FX_BOOL bEmbedded, FX_BOOL bTrueType);
+
+ void LoadFontDescriptor(CPDF_Dictionary*);
+
+ void LoadCharWidths(FX_WORD* pWidths);
+
+ void CheckFontMetrics();
+
+ CFX_CharMap* m_pCharMap;
+
+
+
+ int m_FontType;
+
+ CFX_ByteString m_BaseFont;
+
+ CPDF_StreamAcc* m_pFontFile;
+
+ CPDF_Dictionary* m_pFontDict;
+
+ CPDF_ToUnicodeMap* m_pToUnicodeMap;
+
+ FX_BOOL m_bToUnicodeLoaded;
+
+
+
+
+ int m_Flags;
+
+ FX_RECT m_FontBBox;
+
+ int m_StemV;
+
+ int m_Ascent;
+
+ int m_Descent;
+
+ int m_ItalicAngle;
+
+};
+#define PDFFONT_ENCODING_BUILTIN 0
+#define PDFFONT_ENCODING_WINANSI 1
+#define PDFFONT_ENCODING_MACROMAN 2
+#define PDFFONT_ENCODING_MACEXPERT 3
+#define PDFFONT_ENCODING_STANDARD 4
+#define PDFFONT_ENCODING_ADOBE_SYMBOL 5
+#define PDFFONT_ENCODING_ZAPFDINGBATS 6
+#define PDFFONT_ENCODING_PDFDOC 7
+#define PDFFONT_ENCODING_MS_SYMBOL 8
+#define PDFFONT_ENCODING_UNICODE 9
+class CPDF_FontEncoding : public CFX_Object
+{
+public:
+
+ CPDF_FontEncoding();
+
+ CPDF_FontEncoding(int PredefinedEncoding);
+
+ void LoadEncoding(CPDF_Object* pEncoding);
+
+ FX_BOOL IsIdentical(CPDF_FontEncoding* pAnother) const;
+
+ FX_WCHAR UnicodeFromCharCode(FX_BYTE charcode) const
+ {
+ return m_Unicodes[charcode];
+ }
+
+ int CharCodeFromUnicode(FX_WCHAR unicode) const;
+
+ void SetUnicode(FX_BYTE charcode, FX_WCHAR unicode)
+ {
+ m_Unicodes[charcode] = unicode;
+ }
+
+ CPDF_Object* Realize();
+public:
+
+ FX_WCHAR m_Unicodes[256];
+};
+class CPDF_SimpleFont : public CPDF_Font
+{
+public:
+
+ CPDF_SimpleFont();
+
+ virtual ~CPDF_SimpleFont();
+
+ CPDF_FontEncoding* GetEncoding()
+ {
+ return &m_Encoding;
+ }
+ virtual int GetCharWidthF(FX_DWORD charcode, int level = 0);
+ virtual void GetCharBBox(FX_DWORD charcode, FX_RECT& rect, int level = 0);
+ virtual int GlyphFromCharCode(FX_DWORD charcode, FX_BOOL *pVertGlyph = NULL);
+ virtual FX_BOOL IsUnicodeCompatible() const;
+protected:
+
+ FX_BOOL LoadCommon();
+
+ void LoadSubstFont();
+
+ void LoadFaceMetrics();
+
+ virtual void LoadGlyphMap() = 0;
+ virtual FX_WCHAR _UnicodeFromCharCode(FX_DWORD charcode) const
+ {
+ return m_Encoding.UnicodeFromCharCode((FX_BYTE)charcode);
+ }
+ virtual FX_DWORD _CharCodeFromUnicode(FX_WCHAR Unicode) const
+ {
+ return m_Encoding.CharCodeFromUnicode(Unicode);
+ }
+
+
+
+ CPDF_FontEncoding m_Encoding;
+
+ FX_WORD m_GlyphIndex[256];
+ FX_WORD m_ExtGID[256];
+
+
+
+
+ CFX_ByteString* m_pCharNames;
+
+ int m_BaseEncoding;
+
+
+
+
+ FX_WORD m_CharWidth[256];
+
+ FX_SMALL_RECT m_CharBBox[256];
+
+ FX_BOOL m_bUseFontWidth;
+
+ void LoadCharMetrics(int charcode);
+
+};
+class CPDF_Type1Font : public CPDF_SimpleFont
+{
+public:
+
+ CPDF_Type1Font();
+
+ int GetBase14Font()
+ {
+ return m_Base14Font;
+ }
+ virtual int GlyphFromCharCodeExt(FX_DWORD charcode);
+protected:
+ virtual FX_BOOL _Load();
+
+ int m_Base14Font;
+ virtual void LoadGlyphMap();
+};
+class CPDF_TrueTypeFont : public CPDF_SimpleFont
+{
+public:
+
+ CPDF_TrueTypeFont();
+protected:
+ virtual FX_BOOL _Load();
+ virtual void LoadGlyphMap();
+};
+class CPDF_Type3Char : public CFX_Object
+{
+public:
+
+ CPDF_Type3Char();
+
+ ~CPDF_Type3Char();
+
+ FX_BOOL LoadBitmap(CPDF_RenderContext* pContext);
+
+ FX_BOOL m_bColored;
+
+ FX_BOOL m_bPageRequired;
+
+
+
+ CPDF_Form* m_pForm;
+
+ CFX_AffineMatrix m_ImageMatrix;
+
+ CFX_DIBitmap* m_pBitmap;
+
+
+ int m_Width;
+
+ FX_RECT m_BBox;
+};
+class CPDF_Type3Font : public CPDF_SimpleFont
+{
+public:
+ CPDF_Type3Font();
+ virtual ~CPDF_Type3Font();
+ void SetPageResources(CPDF_Dictionary* pResources)
+ {
+ m_pPageResources = pResources;
+ }
+ CPDF_Type3Char* LoadChar(FX_DWORD charcode, int level = 0);
+ virtual int GetCharWidthF(FX_DWORD charcode, int level = 0);
+ virtual int GetCharTypeWidth(FX_DWORD charcode)
+ {
+ return GetCharWidthF(charcode);
+ }
+ virtual void GetCharBBox(FX_DWORD charcode, FX_RECT& rect, int level = 0);
+ CFX_AffineMatrix& GetFontMatrix()
+ {
+ return m_FontMatrix;
+ }
+ void CheckType3FontMetrics();
+private:
+ virtual FX_BOOL _Load();
+ virtual void LoadGlyphMap() {}
+ int m_CharWidthL[256];
+ CPDF_Dictionary* m_pCharProcs;
+ CPDF_Dictionary* m_pPageResources;
+ CPDF_Dictionary* m_pFontResources;
+ CFX_MapPtrToPtr m_CacheMap;
+ CFX_MapPtrToPtr m_DeletedMap;
+protected:
+ CFX_AffineMatrix m_FontMatrix;
+};
+#define CIDSET_UNKNOWN 0
+#define CIDSET_GB1 1
+#define CIDSET_CNS1 2
+#define CIDSET_JAPAN1 3
+#define CIDSET_KOREA1 4
+#define CIDSET_UNICODE 5
+class CPDF_CIDFont : public CPDF_Font
+{
+public:
+
+ CPDF_CIDFont();
+
+ virtual ~CPDF_CIDFont();
+
+ FX_BOOL LoadGB2312();
+ virtual int GlyphFromCharCode(FX_DWORD charcode, FX_BOOL *pVertGlyph = NULL);
+ virtual int GetCharWidthF(FX_DWORD charcode, int level = 0);
+ virtual void GetCharBBox(FX_DWORD charcode, FX_RECT& rect, int level = 0);
+
+ FX_WORD CIDFromCharCode(FX_DWORD charcode) const;
+
+ FX_BOOL IsTrueType()
+ {
+ return !m_bType1;
+ }
+
+
+ virtual FX_DWORD GetNextChar(const FX_CHAR* pString, int& offset) const;
+ virtual int CountChar(const FX_CHAR* pString, int size) const;
+ virtual int AppendChar(FX_LPSTR str, FX_DWORD charcode) const;
+ virtual int GetCharSize(FX_DWORD charcode) const;
+
+
+ int GetCharset() const
+ {
+ return m_Charset;
+ }
+
+ FX_LPCBYTE GetCIDTransform(FX_WORD CID) const;
+
+
+
+ virtual FX_BOOL IsVertWriting() const;
+
+ short GetVertWidth(FX_WORD CID) const;
+
+ void GetVertOrigin(FX_WORD CID, short& vx, short& vy) const;
+
+ virtual FX_BOOL IsUnicodeCompatible() const;
+ virtual FX_BOOL IsFontStyleFromCharCode(FX_DWORD charcode) const;
+protected:
+ friend class CPDF_Font;
+ virtual FX_BOOL _Load();
+ virtual FX_WCHAR _UnicodeFromCharCode(FX_DWORD charcode) const;
+ virtual FX_DWORD _CharCodeFromUnicode(FX_WCHAR Unicode) const;
+ int GetGlyphIndex(FX_DWORD unicodeb, FX_BOOL *pVertGlyph);
+
+ CPDF_CMap* m_pCMap;
+
+ CPDF_CMap* m_pAllocatedCMap;
+
+ CPDF_CID2UnicodeMap* m_pCID2UnicodeMap;
+
+ int m_Charset;
+
+ FX_BOOL m_bType1;
+
+ CPDF_StreamAcc* m_pCIDToGIDMap;
+ FX_BOOL m_bCIDIsGID;
+
+
+
+ FX_WORD m_DefaultWidth;
+
+ FX_WORD* m_pAnsiWidths;
+
+ FX_SMALL_RECT m_CharBBox[256];
+
+ CFX_DWordArray m_WidthList;
+
+ short m_DefaultVY;
+
+ short m_DefaultW1;
+
+ CFX_DWordArray m_VertMetrics;
+
+
+ void LoadMetricsArray(CPDF_Array* pArray, CFX_DWordArray& result, int nElements);
+
+ void LoadSubstFont();
+
+ FX_BOOL m_bAdobeCourierStd;
+
+ CFX_CTTGSUBTable* m_pTTGSUBTable;
+};
+#define PDFCS_DEVICEGRAY 1
+
+#define PDFCS_DEVICERGB 2
+#define PDFCS_DEVICECMYK 3
+#define PDFCS_CALGRAY 4
+#define PDFCS_CALRGB 5
+#define PDFCS_LAB 6
+#define PDFCS_ICCBASED 7
+#define PDFCS_SEPARATION 8
+#define PDFCS_DEVICEN 9
+#define PDFCS_INDEXED 10
+#define PDFCS_PATTERN 11
+class CPDF_ColorSpace : public CFX_Object
+{
+public:
+
+ static CPDF_ColorSpace* GetStockCS(int Family);
+
+ static CPDF_ColorSpace* Load(CPDF_Document* pDoc, CPDF_Object* pCSObj);
+
+ void ReleaseCS();
+
+ int GetBufSize() const;
+
+ FX_FLOAT* CreateBuf();
+
+ void GetDefaultColor(FX_FLOAT* buf) const;
+
+ int CountComponents() const
+ {
+ return m_nComponents;
+ }
+
+ int GetFamily() const
+ {
+ return m_Family;
+ }
+
+ virtual void GetDefaultValue(int iComponent, FX_FLOAT& value, FX_FLOAT& min, FX_FLOAT& max) const
+ {
+ value = 0;
+ min = 0;
+ max = 1.0f;
+ }
+
+ FX_BOOL sRGB() const;
+
+
+
+ virtual FX_BOOL GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const = 0;
+
+ virtual FX_BOOL SetRGB(FX_FLOAT* pBuf, FX_FLOAT R, FX_FLOAT G, FX_FLOAT B) const
+ {
+ return FALSE;
+ }
+
+
+
+
+ FX_BOOL GetCMYK(FX_FLOAT* pBuf, FX_FLOAT& c, FX_FLOAT& m, FX_FLOAT& y, FX_FLOAT& k) const;
+
+ FX_BOOL SetCMYK(FX_FLOAT* pBuf, FX_FLOAT c, FX_FLOAT m, FX_FLOAT y, FX_FLOAT k) const;
+
+
+ virtual void TranslateImageLine(FX_LPBYTE dest_buf, FX_LPCBYTE src_buf, int pixels,
+ int image_width, int image_height, FX_BOOL bTransMask = FALSE) const;
+
+ CPDF_Array*& GetArray()
+ {
+ return m_pArray;
+ }
+
+ int GetMaxIndex() const;
+
+ virtual CPDF_ColorSpace* GetBaseCS() const
+ {
+ return NULL;
+ }
+
+ virtual void EnableStdConversion(FX_BOOL bEnabled);
+ CPDF_Document* m_pDocument;
+protected:
+
+ CPDF_ColorSpace();
+
+ virtual ~CPDF_ColorSpace() {}
+ virtual FX_BOOL v_Load(CPDF_Document* pDoc, CPDF_Array* pArray)
+ {
+ return TRUE;
+ }
+ virtual FX_BOOL v_GetCMYK(FX_FLOAT* pBuf, FX_FLOAT& c, FX_FLOAT& m, FX_FLOAT& y, FX_FLOAT& k) const
+ {
+ return FALSE;
+ }
+ virtual FX_BOOL v_SetCMYK(FX_FLOAT* pBuf, FX_FLOAT c, FX_FLOAT m, FX_FLOAT y, FX_FLOAT k) const
+ {
+ return FALSE;
+ }
+
+ int m_Family;
+
+ int m_nComponents;
+
+ CPDF_Array* m_pArray;
+
+ FX_DWORD m_dwStdConversion;
+};
+class CPDF_Color : public CFX_Object
+{
+public:
+
+ CPDF_Color()
+ {
+ m_pBuffer = NULL;
+ m_pCS = NULL;
+ }
+
+ CPDF_Color(int family);
+
+ ~CPDF_Color();
+
+ FX_BOOL IsNull() const
+ {
+ return m_pBuffer == NULL;
+ }
+
+ FX_BOOL IsEqual(const CPDF_Color& other) const;
+
+ FX_BOOL IsPattern() const
+ {
+ return m_pCS && m_pCS->GetFamily() == PDFCS_PATTERN;
+ }
+
+ void Copy(const CPDF_Color* pSrc);
+
+ void SetColorSpace(CPDF_ColorSpace* pCS);
+
+ void SetValue(FX_FLOAT* comp);
+
+ void SetValue(CPDF_Pattern* pPattern, FX_FLOAT* comp, int ncomps);
+
+ FX_BOOL GetRGB(int& R, int& G, int& B) const;
+
+ CPDF_Pattern* GetPattern() const;
+
+ CPDF_ColorSpace* GetPatternCS() const;
+
+ FX_FLOAT* GetPatternColor() const;
+
+ CPDF_ColorSpace* m_pCS;
+
+ FX_FLOAT* m_pBuffer;
+protected:
+ void ReleaseBuffer();
+ void ReleaseColorSpace();
+};
+#define PATTERN_TILING 1
+#define PATTERN_SHADING 2
+class CPDF_Pattern : public CFX_Object
+{
+public:
+
+ virtual ~CPDF_Pattern() {}
+
+ CPDF_Object* m_pPatternObj;
+
+ int m_PatternType;
+
+ CFX_AffineMatrix m_Pattern2Form;
+ CFX_AffineMatrix m_ParentMatrix;
+
+ CPDF_Document* m_pDocument;
+
+protected:
+
+ CPDF_Pattern(const CFX_AffineMatrix* pParentMatrix)
+ {
+ if (pParentMatrix) {
+ m_ParentMatrix = *pParentMatrix;
+ }
+ }
+};
+class CPDF_TilingPattern : public CPDF_Pattern
+{
+public:
+
+ CPDF_TilingPattern(CPDF_Document* pDoc, CPDF_Object* pPatternObj, const CFX_AffineMatrix* parentMatrix);
+
+ virtual ~CPDF_TilingPattern();
+
+ FX_BOOL Load();
+
+
+
+ FX_BOOL m_bColored;
+
+ CFX_FloatRect m_BBox;
+
+ FX_FLOAT m_XStep;
+
+ FX_FLOAT m_YStep;
+
+
+
+ CPDF_Form* m_pForm;
+};
+class CPDF_ShadingPattern : public CPDF_Pattern
+{
+public:
+
+ CPDF_ShadingPattern(CPDF_Document* pDoc, CPDF_Object* pPatternObj, FX_BOOL bShading, const CFX_AffineMatrix* parentMatrix);
+
+ virtual ~CPDF_ShadingPattern();
+
+ CPDF_Object* m_pShadingObj;
+
+ FX_BOOL m_bShadingObj;
+
+ FX_BOOL Load();
+
+ FX_BOOL Reload();
+
+ int m_ShadingType;
+
+ CPDF_ColorSpace* m_pCS;
+
+
+ CPDF_Function* m_pFunctions[4];
+
+ int m_nFuncs;
+protected:
+ void Clear();
+};
+struct CPDF_MeshVertex {
+ FX_FLOAT x, y;
+ FX_FLOAT r, g, b;
+};
+class CPDF_MeshStream : public CFX_Object
+{
+public:
+
+ FX_BOOL Load(CPDF_Stream* pShadingStream, CPDF_Function** pFuncs, int nFuncs, CPDF_ColorSpace* pCS);
+
+ FX_DWORD GetFlag();
+
+ void GetCoords(FX_FLOAT& x, FX_FLOAT& y);
+
+ void GetColor(FX_FLOAT& r, FX_FLOAT& g, FX_FLOAT& b);
+
+ FX_DWORD GetVertex(CPDF_MeshVertex& vertex, CFX_AffineMatrix* pObject2Bitmap);
+
+ FX_BOOL GetVertexRow(CPDF_MeshVertex* vertex, int count, CFX_AffineMatrix* pObject2Bitmap);
+ CPDF_Function** m_pFuncs;
+ CPDF_ColorSpace* m_pCS;
+ FX_DWORD m_nFuncs, m_nCoordBits, m_nCompBits, m_nFlagBits, m_nComps;
+ FX_DWORD m_CoordMax, m_CompMax;
+ FX_FLOAT m_xmin, m_xmax, m_ymin, m_ymax;
+ FX_FLOAT m_ColorMin[8], m_ColorMax[8];
+ CPDF_StreamAcc m_Stream;
+ CFX_BitStream m_BitStream;
+};
+#define PDF_IMAGE_NO_COMPRESS 0x0000
+#define PDF_IMAGE_LOSSY_COMPRESS 0x0001
+#define PDF_IMAGE_LOSSLESS_COMPRESS 0x0002
+#define PDF_IMAGE_MASK_LOSSY_COMPRESS 0x0004
+#define PDF_IMAGE_MASK_LOSSLESS_COMPRESS 0x0008
+class CPDF_ImageSetParam
+{
+public:
+ CPDF_ImageSetParam()
+ : pMatteColor(NULL)
+ , nQuality(80)
+ {
+ }
+ FX_ARGB* pMatteColor;
+ FX_INT32 nQuality;
+};
+class CPDF_Image : public CFX_Object
+{
+public:
+
+ CPDF_Image(CPDF_Document* pDoc);
+
+ ~CPDF_Image();
+
+ FX_BOOL LoadImageF(CPDF_Stream* pImageStream, FX_BOOL bInline);
+
+ void Release();
+
+ CPDF_Image* Clone();
+
+ FX_BOOL IsInline()
+ {
+ return m_bInline;
+ }
+
+ void SetInlineDict(CPDF_Dictionary* pDict)
+ {
+ m_pInlineDict = pDict;
+ }
+
+ CPDF_Dictionary* GetInlineDict() const
+ {
+ return m_pInlineDict;
+ }
+
+ CPDF_Stream* GetStream() const
+ {
+ return m_pStream;
+ }
+
+ CPDF_Dictionary* GetDict() const
+ {
+ return m_pStream->GetDict();
+ }
+
+ CPDF_Dictionary* GetOC() const
+ {
+ return m_pOC;
+ }
+
+ CPDF_Document* GetDocument() const
+ {
+ return m_pDocument;
+ }
+
+
+
+ FX_INT32 GetPixelHeight() const
+ {
+ return m_Height;
+ }
+
+ FX_INT32 GetPixelWidth() const
+ {
+ return m_Width;
+ }
+
+
+ FX_BOOL IsMask() const
+ {
+ return m_bIsMask;
+ }
+
+ FX_BOOL IsInterpol() const
+ {
+ return m_bInterpolate;
+ }
+
+ CFX_DIBSource* LoadDIBSource(CFX_DIBSource** ppMask = NULL, FX_DWORD* pMatteColor = NULL, FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0, FX_BOOL bLoadMask = FALSE) const;
+
+
+
+ void SetImage(const CFX_DIBitmap* pDIBitmap, FX_INT32 iCompress, IFX_FileWrite *pFileWrite = NULL, IFX_FileRead *pFileRead = NULL, const CFX_DIBitmap* pMask = NULL, const CPDF_ImageSetParam* pParam = NULL);
+
+ void SetJpegImage(FX_BYTE* pImageData, FX_DWORD size);
+
+ void SetJpegImage(IFX_FileRead *pFile);
+
+ void ResetCache(CPDF_Page* pPage, const CFX_DIBitmap* pDIBitmap);
+
+public:
+ FX_BOOL StartLoadDIBSource(CPDF_Dictionary* pFormResource, CPDF_Dictionary* pPageResource, FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0, FX_BOOL bLoadMask = FALSE);
+ FX_BOOL Continue(IFX_Pause* pPause);
+ CFX_DIBSource* DetachBitmap();
+ CFX_DIBSource* DetachMask();
+ CFX_DIBSource* m_pDIBSource;
+ CFX_DIBSource* m_pMask;
+ FX_DWORD m_MatteColor;
+private:
+
+ CPDF_Stream* m_pStream;
+ FX_BOOL m_bInline;
+ CPDF_Dictionary* m_pInlineDict;
+
+ FX_INT32 m_Height;
+
+ FX_INT32 m_Width;
+
+ FX_BOOL m_bIsMask;
+
+ FX_BOOL m_bInterpolate;
+
+ CPDF_Document* m_pDocument;
+
+ CPDF_Dictionary* m_pOC;
+ CPDF_Dictionary* InitJPEG(FX_LPBYTE pData, FX_DWORD size);
+};
+#endif
diff --git a/core/include/fpdfapi/fpdf_serial.h b/core/include/fpdfapi/fpdf_serial.h
index 9b1642e4a7..87ec7b5a05 100644
--- a/core/include/fpdfapi/fpdf_serial.h
+++ b/core/include/fpdfapi/fpdf_serial.h
@@ -1,203 +1,203 @@
-// 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 _FPDF_SERIAL_
-#define _FPDF_SERIAL_
-#ifndef _FPDF_PAGE_
-#include "fpdf_page.h"
-#endif
-#ifndef _FPDF_PAGEOBJ_H_
-#include "fpdf_pageobj.h"
-#endif
-class CPDF_ObjectStream;
-class CPDF_XRefStream;
-CFX_ByteTextBuf& operator << (CFX_ByteTextBuf& buf, const CPDF_Object* pObj);
-class CPDF_ObjArchiveSaver : public CFX_ArchiveSaver
-{
-public:
-
- friend CPDF_ObjArchiveSaver& operator << (CPDF_ObjArchiveSaver& ar, const CPDF_Object* pObj);
-protected:
-
- CFX_MapPtrToPtr m_ObjectMap;
-};
-class CPDF_ObjArchiveLoader : public CFX_ArchiveLoader
-{
-public:
-
- CPDF_ObjArchiveLoader(FX_LPCBYTE pData, FX_DWORD dwSize) : CFX_ArchiveLoader(pData, dwSize),
- m_IndirectObjects(NULL) {}
-
- friend CPDF_ObjArchiveLoader& operator >> (CPDF_ObjArchiveLoader& ar, CPDF_Object*& pObj);
-protected:
-
- CPDF_IndirectObjects m_IndirectObjects;
-};
-class CPDF_PageArchiveSaver : public CPDF_ObjArchiveSaver
-{
-public:
-
- CPDF_PageArchiveSaver(CPDF_PageObjects* pPageObjs);
-
- friend CPDF_PageArchiveSaver& operator << (CPDF_PageArchiveSaver& ar, CPDF_PageObject* pObj);
-
-
-
- friend CPDF_PageArchiveSaver& operator << (CPDF_PageArchiveSaver& ar, CPDF_ClipPath clip_path);
-
- friend CPDF_PageArchiveSaver& operator << (CPDF_PageArchiveSaver& ar, CPDF_GraphState graph_state);
-
- friend CPDF_PageArchiveSaver& operator << (CPDF_PageArchiveSaver& ar, CPDF_TextState text_state);
-
- friend CPDF_PageArchiveSaver& operator << (CPDF_PageArchiveSaver& ar, CPDF_ColorState color_state);
-
- friend CPDF_PageArchiveSaver& operator << (CPDF_PageArchiveSaver& ar, CPDF_GeneralState general_state);
-
-protected:
-
- CPDF_ClipPath m_LastClipPath;
-
- CPDF_GraphState m_LastGraphState;
-
- CPDF_ColorState m_LastColorState;
-
- CPDF_TextState m_LastTextState;
-
- CPDF_GeneralState m_LastGeneralState;
-
- CPDF_PageObjects* m_pCurPage;
-};
-class CPDF_PageArchiveLoader : public CPDF_ObjArchiveLoader
-{
-public:
-
- CPDF_PageArchiveLoader(CPDF_PageObjects* pPageObjs, FX_LPCBYTE pData, FX_DWORD dwSize);
-
- friend CPDF_PageArchiveLoader& operator >> (CPDF_PageArchiveLoader& ar, CPDF_PageObject*& pObj);
-
-
-
- friend CPDF_PageArchiveLoader& operator >> (CPDF_PageArchiveLoader& ar, CPDF_ClipPath& clip_path);
-
- friend CPDF_PageArchiveLoader& operator >> (CPDF_PageArchiveLoader& ar, CPDF_GraphState& graph_state);
-
- friend CPDF_PageArchiveLoader& operator >> (CPDF_PageArchiveLoader& ar, CPDF_TextState& text_state);
-
- friend CPDF_PageArchiveLoader& operator >> (CPDF_PageArchiveLoader& ar, CPDF_ColorState& color_state);
-
- friend CPDF_PageArchiveLoader& operator >> (CPDF_PageArchiveLoader& ar, CPDF_GeneralState& general_state);
-
-protected:
- void PostProcColor(CPDF_Color& color);
-
- CPDF_Object* AddResource(CPDF_Object* pSrcObj, FX_LPCSTR type);
-
- CPDF_ClipPath m_LastClipPath;
-
- CPDF_GraphState m_LastGraphState;
-
- CPDF_ColorState m_LastColorState;
-
- CPDF_TextState m_LastTextState;
-
- CPDF_GeneralState m_LastGeneralState;
-
- CPDF_PageObjects* m_pCurPage;
-
- CFX_MapPtrToPtr m_ObjectMap;
-};
-#define FPDFCREATE_INCREMENTAL 1
-#define FPDFCREATE_NO_ORIGINAL 2
-#define FPDFCREATE_PROGRESSIVE 4
-#define FPDFCREATE_OBJECTSTREAM 8
-class CPDF_Creator : public CFX_Object
-{
-public:
-
- CPDF_Creator(CPDF_Document* pDoc);
-
- ~CPDF_Creator();
-
- FX_BOOL Create(FX_LPCWSTR filename, FX_DWORD flags = 0);
-
- FX_BOOL Create(FX_LPCSTR filename, FX_DWORD flags = 0);
-
- FX_BOOL Create(IFX_StreamWrite* pFile, FX_DWORD flags = 0);
-
- FX_INT32 Continue(IFX_Pause *pPause = NULL);
-
- FX_BOOL SetFileVersion(FX_INT32 fileVersion = 17);
-protected:
-
- CPDF_Document* m_pDocument;
-
- CPDF_Parser* m_pParser;
-
- FX_BOOL m_bCompress;
-
- FX_BOOL m_bSecurityChanged;
-
- CPDF_Dictionary* m_pEncryptDict;
- FX_DWORD m_dwEnryptObjNum;
- FX_BOOL m_bEncryptCloned;
-
- FX_BOOL m_bStandardSecurity;
-
- CPDF_CryptoHandler* m_pCryptoHandler;
- FX_BOOL m_bNewCrypto;
-
- FX_BOOL m_bEncryptMetadata;
-
- CPDF_Object* m_pMetadata;
-
- CPDF_XRefStream* m_pXRefStream;
-
- FX_INT32 m_ObjectStreamSize;
-
- FX_DWORD m_dwLastObjNum;
- FX_BOOL Create(FX_DWORD flags);
- void ResetStandardSecurity();
- void Clear();
- FX_INT32 WriteDoc_Stage1(IFX_Pause *pPause);
- FX_INT32 WriteDoc_Stage2(IFX_Pause *pPause);
- FX_INT32 WriteDoc_Stage3(IFX_Pause *pPause);
- FX_INT32 WriteDoc_Stage4(IFX_Pause *pPause);
-
- CFX_FileBufferArchive m_File;
-
- FX_FILESIZE m_Offset;
- void InitOldObjNumOffsets();
- void InitNewObjNumOffsets();
- void AppendNewObjNum(FX_DWORD objbum);
- FX_INT32 WriteOldIndirectObject(FX_DWORD objnum);
- FX_INT32 WriteOldObjs(IFX_Pause *pPause);
- FX_INT32 WriteNewObjs(FX_BOOL bIncremental, IFX_Pause *pPause);
- FX_INT32 WriteIndirectObj(const CPDF_Object* pObj);
- FX_INT32 WriteDirectObj(FX_DWORD objnum, const CPDF_Object* pObj, FX_BOOL bEncrypt = TRUE);
- FX_INT32 WriteIndirectObjectToStream(const CPDF_Object* pObj);
- FX_INT32 WriteIndirectObj(FX_DWORD objnum, const CPDF_Object* pObj);
- FX_INT32 WriteIndirectObjectToStream(FX_DWORD objnum, FX_LPCBYTE pBuffer, FX_DWORD dwSize);
- FX_INT32 AppendObjectNumberToXRef(FX_DWORD objnum);
- void InitID(FX_BOOL bDefault = TRUE);
- FX_INT32 WriteStream(const CPDF_Object* pStream, FX_DWORD objnum, CPDF_CryptoHandler* pCrypto);
-
- FX_INT32 m_iStage;
- FX_DWORD m_dwFlags;
- FX_POSITION m_Pos;
- FX_FILESIZE m_XrefStart;
-
- CFX_FileSizeListArray m_ObjectOffset;
-
- CFX_DWordListArray m_ObjectSize;
- CFX_DWordArray m_NewObjNumArray;
-
- CPDF_Array* m_pIDArray;
-
- FX_INT32 m_FileVersion;
- friend class CPDF_ObjectStream;
- friend class CPDF_XRefStream;
-};
-#endif
+// 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 _FPDF_SERIAL_
+#define _FPDF_SERIAL_
+#ifndef _FPDF_PAGE_
+#include "fpdf_page.h"
+#endif
+#ifndef _FPDF_PAGEOBJ_H_
+#include "fpdf_pageobj.h"
+#endif
+class CPDF_ObjectStream;
+class CPDF_XRefStream;
+CFX_ByteTextBuf& operator << (CFX_ByteTextBuf& buf, const CPDF_Object* pObj);
+class CPDF_ObjArchiveSaver : public CFX_ArchiveSaver
+{
+public:
+
+ friend CPDF_ObjArchiveSaver& operator << (CPDF_ObjArchiveSaver& ar, const CPDF_Object* pObj);
+protected:
+
+ CFX_MapPtrToPtr m_ObjectMap;
+};
+class CPDF_ObjArchiveLoader : public CFX_ArchiveLoader
+{
+public:
+
+ CPDF_ObjArchiveLoader(FX_LPCBYTE pData, FX_DWORD dwSize) : CFX_ArchiveLoader(pData, dwSize),
+ m_IndirectObjects(NULL) {}
+
+ friend CPDF_ObjArchiveLoader& operator >> (CPDF_ObjArchiveLoader& ar, CPDF_Object*& pObj);
+protected:
+
+ CPDF_IndirectObjects m_IndirectObjects;
+};
+class CPDF_PageArchiveSaver : public CPDF_ObjArchiveSaver
+{
+public:
+
+ CPDF_PageArchiveSaver(CPDF_PageObjects* pPageObjs);
+
+ friend CPDF_PageArchiveSaver& operator << (CPDF_PageArchiveSaver& ar, CPDF_PageObject* pObj);
+
+
+
+ friend CPDF_PageArchiveSaver& operator << (CPDF_PageArchiveSaver& ar, CPDF_ClipPath clip_path);
+
+ friend CPDF_PageArchiveSaver& operator << (CPDF_PageArchiveSaver& ar, CPDF_GraphState graph_state);
+
+ friend CPDF_PageArchiveSaver& operator << (CPDF_PageArchiveSaver& ar, CPDF_TextState text_state);
+
+ friend CPDF_PageArchiveSaver& operator << (CPDF_PageArchiveSaver& ar, CPDF_ColorState color_state);
+
+ friend CPDF_PageArchiveSaver& operator << (CPDF_PageArchiveSaver& ar, CPDF_GeneralState general_state);
+
+protected:
+
+ CPDF_ClipPath m_LastClipPath;
+
+ CPDF_GraphState m_LastGraphState;
+
+ CPDF_ColorState m_LastColorState;
+
+ CPDF_TextState m_LastTextState;
+
+ CPDF_GeneralState m_LastGeneralState;
+
+ CPDF_PageObjects* m_pCurPage;
+};
+class CPDF_PageArchiveLoader : public CPDF_ObjArchiveLoader
+{
+public:
+
+ CPDF_PageArchiveLoader(CPDF_PageObjects* pPageObjs, FX_LPCBYTE pData, FX_DWORD dwSize);
+
+ friend CPDF_PageArchiveLoader& operator >> (CPDF_PageArchiveLoader& ar, CPDF_PageObject*& pObj);
+
+
+
+ friend CPDF_PageArchiveLoader& operator >> (CPDF_PageArchiveLoader& ar, CPDF_ClipPath& clip_path);
+
+ friend CPDF_PageArchiveLoader& operator >> (CPDF_PageArchiveLoader& ar, CPDF_GraphState& graph_state);
+
+ friend CPDF_PageArchiveLoader& operator >> (CPDF_PageArchiveLoader& ar, CPDF_TextState& text_state);
+
+ friend CPDF_PageArchiveLoader& operator >> (CPDF_PageArchiveLoader& ar, CPDF_ColorState& color_state);
+
+ friend CPDF_PageArchiveLoader& operator >> (CPDF_PageArchiveLoader& ar, CPDF_GeneralState& general_state);
+
+protected:
+ void PostProcColor(CPDF_Color& color);
+
+ CPDF_Object* AddResource(CPDF_Object* pSrcObj, FX_LPCSTR type);
+
+ CPDF_ClipPath m_LastClipPath;
+
+ CPDF_GraphState m_LastGraphState;
+
+ CPDF_ColorState m_LastColorState;
+
+ CPDF_TextState m_LastTextState;
+
+ CPDF_GeneralState m_LastGeneralState;
+
+ CPDF_PageObjects* m_pCurPage;
+
+ CFX_MapPtrToPtr m_ObjectMap;
+};
+#define FPDFCREATE_INCREMENTAL 1
+#define FPDFCREATE_NO_ORIGINAL 2
+#define FPDFCREATE_PROGRESSIVE 4
+#define FPDFCREATE_OBJECTSTREAM 8
+class CPDF_Creator : public CFX_Object
+{
+public:
+
+ CPDF_Creator(CPDF_Document* pDoc);
+
+ ~CPDF_Creator();
+
+ FX_BOOL Create(FX_LPCWSTR filename, FX_DWORD flags = 0);
+
+ FX_BOOL Create(FX_LPCSTR filename, FX_DWORD flags = 0);
+
+ FX_BOOL Create(IFX_StreamWrite* pFile, FX_DWORD flags = 0);
+
+ FX_INT32 Continue(IFX_Pause *pPause = NULL);
+
+ FX_BOOL SetFileVersion(FX_INT32 fileVersion = 17);
+protected:
+
+ CPDF_Document* m_pDocument;
+
+ CPDF_Parser* m_pParser;
+
+ FX_BOOL m_bCompress;
+
+ FX_BOOL m_bSecurityChanged;
+
+ CPDF_Dictionary* m_pEncryptDict;
+ FX_DWORD m_dwEnryptObjNum;
+ FX_BOOL m_bEncryptCloned;
+
+ FX_BOOL m_bStandardSecurity;
+
+ CPDF_CryptoHandler* m_pCryptoHandler;
+ FX_BOOL m_bNewCrypto;
+
+ FX_BOOL m_bEncryptMetadata;
+
+ CPDF_Object* m_pMetadata;
+
+ CPDF_XRefStream* m_pXRefStream;
+
+ FX_INT32 m_ObjectStreamSize;
+
+ FX_DWORD m_dwLastObjNum;
+ FX_BOOL Create(FX_DWORD flags);
+ void ResetStandardSecurity();
+ void Clear();
+ FX_INT32 WriteDoc_Stage1(IFX_Pause *pPause);
+ FX_INT32 WriteDoc_Stage2(IFX_Pause *pPause);
+ FX_INT32 WriteDoc_Stage3(IFX_Pause *pPause);
+ FX_INT32 WriteDoc_Stage4(IFX_Pause *pPause);
+
+ CFX_FileBufferArchive m_File;
+
+ FX_FILESIZE m_Offset;
+ void InitOldObjNumOffsets();
+ void InitNewObjNumOffsets();
+ void AppendNewObjNum(FX_DWORD objbum);
+ FX_INT32 WriteOldIndirectObject(FX_DWORD objnum);
+ FX_INT32 WriteOldObjs(IFX_Pause *pPause);
+ FX_INT32 WriteNewObjs(FX_BOOL bIncremental, IFX_Pause *pPause);
+ FX_INT32 WriteIndirectObj(const CPDF_Object* pObj);
+ FX_INT32 WriteDirectObj(FX_DWORD objnum, const CPDF_Object* pObj, FX_BOOL bEncrypt = TRUE);
+ FX_INT32 WriteIndirectObjectToStream(const CPDF_Object* pObj);
+ FX_INT32 WriteIndirectObj(FX_DWORD objnum, const CPDF_Object* pObj);
+ FX_INT32 WriteIndirectObjectToStream(FX_DWORD objnum, FX_LPCBYTE pBuffer, FX_DWORD dwSize);
+ FX_INT32 AppendObjectNumberToXRef(FX_DWORD objnum);
+ void InitID(FX_BOOL bDefault = TRUE);
+ FX_INT32 WriteStream(const CPDF_Object* pStream, FX_DWORD objnum, CPDF_CryptoHandler* pCrypto);
+
+ FX_INT32 m_iStage;
+ FX_DWORD m_dwFlags;
+ FX_POSITION m_Pos;
+ FX_FILESIZE m_XrefStart;
+
+ CFX_FileSizeListArray m_ObjectOffset;
+
+ CFX_DWordListArray m_ObjectSize;
+ CFX_DWordArray m_NewObjNumArray;
+
+ CPDF_Array* m_pIDArray;
+
+ FX_INT32 m_FileVersion;
+ friend class CPDF_ObjectStream;
+ friend class CPDF_XRefStream;
+};
+#endif
diff --git a/core/include/fpdfapi/fpdfapi.h b/core/include/fpdfapi/fpdfapi.h
index e9fc528dc1..9407735267 100644
--- a/core/include/fpdfapi/fpdfapi.h
+++ b/core/include/fpdfapi/fpdfapi.h
@@ -1,15 +1,15 @@
-// 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 _FPDFAPI_H_
-#define _FPDFAPI_H_
-#include "../../include/fxcrt/fx_basic.h"
-#include "../../include/fxge/fx_ge.h"
-#include "fpdf_module.h"
-#include "fpdf_pageobj.h"
-#include "fpdf_render.h"
-#include "fpdf_serial.h"
-#endif
+// 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 _FPDFAPI_H_
+#define _FPDFAPI_H_
+#include "../../include/fxcrt/fx_basic.h"
+#include "../../include/fxge/fx_ge.h"
+#include "fpdf_module.h"
+#include "fpdf_pageobj.h"
+#include "fpdf_render.h"
+#include "fpdf_serial.h"
+#endif
diff --git a/core/include/fpdfdoc/fpdf_ap.h b/core/include/fpdfdoc/fpdf_ap.h
index 4b6a371110..c2299fc0fc 100644
--- a/core/include/fpdfdoc/fpdf_ap.h
+++ b/core/include/fpdfdoc/fpdf_ap.h
@@ -1,92 +1,92 @@
-// 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
-
-#define _FPDF_AP_H_
-#include "../fxcrt/fx_basic.h"
-#include "../fpdfapi/fpdf_parser.h"
-#include "fpdf_vt.h"
-class IPVT_FontMap
-{
-public:
-
- virtual CPDF_Font* GetPDFFont(FX_INT32 nFontIndex) = 0;
-
- virtual CFX_ByteString GetPDFFontAlias(FX_INT32 nFontIndex) = 0;
-};
-struct CPVT_Dash {
-
- CPVT_Dash(FX_INT32 dash, FX_INT32 gap, FX_INT32 phase) : nDash(dash), nGap(gap), nPhase(phase)
- {}
-
- FX_INT32 nDash;
-
- FX_INT32 nGap;
-
- FX_INT32 nPhase;
-};
-#define CT_TRANSPARENT 0
-#define CT_GRAY 1
-#define CT_RGB 2
-#define CT_CMYK 3
-struct CPVT_Color {
-
- CPVT_Color(FX_INT32 type = 0, FX_FLOAT color1 = 0.0f, FX_FLOAT color2 = 0.0f, FX_FLOAT color3 = 0.0f, FX_FLOAT color4 = 0.0f)
- : nColorType(type), fColor1(color1), fColor2(color2), fColor3(color3), fColor4(color4)
- {}
-
- FX_INT32 nColorType;
- FX_FLOAT fColor1;
- FX_FLOAT fColor2;
- FX_FLOAT fColor3;
- FX_FLOAT fColor4;
-};
-class CPVT_Provider : public IPDF_VariableText_Provider
-{
-public:
-
- CPVT_Provider(IPVT_FontMap * pFontMap);
-
- virtual ~CPVT_Provider();
-
- FX_INT32 GetCharWidth(FX_INT32 nFontIndex, FX_WORD word, FX_INT32 nWordStyle);
-
- FX_INT32 GetTypeAscent(FX_INT32 nFontIndex);
-
- FX_INT32 GetTypeDescent(FX_INT32 nFontIndex);
-
- FX_INT32 GetWordFontIndex(FX_WORD word, FX_INT32 charset, FX_INT32 nFontIndex);
-
- FX_BOOL IsLatinWord(FX_WORD word);
-
- FX_INT32 GetDefaultFontIndex();
-private:
-
- IPVT_FontMap * m_pFontMap;
-};
-#define PBS_SOLID 0
-#define PBS_DASH 1
-#define PBS_BEVELED 2
-#define PBS_INSET 3
-#define PBS_UNDERLINED 4
-class CPVT_GenerateAP
-{
-public:
-
- static FX_BOOL GenerateTextFieldAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict);
-
- static FX_BOOL GenerateComboBoxAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict);
-
- static FX_BOOL GenerateListBoxAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict);
-
- static CFX_ByteString GenerateEditAP(IPVT_FontMap * pFontMap, IPDF_VariableText_Iterator * pIterator,
- const CPDF_Point & ptOffset, FX_BOOL bContinuous, FX_WORD SubWord = 0, const CPVT_WordRange * pVisible = NULL);
-
- static CFX_ByteString GenerateBorderAP(const CPDF_Rect & rect, FX_FLOAT fWidth,
- const CPVT_Color & color, const CPVT_Color & crLeftTop, const CPVT_Color & crRightBottom,
- FX_INT32 nStyle, const CPVT_Dash & dash);
-
- static CFX_ByteString GenerateColorAP(const CPVT_Color & color, const FX_BOOL & bFillOrStroke);
-};
+// 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
+
+#define _FPDF_AP_H_
+#include "../fxcrt/fx_basic.h"
+#include "../fpdfapi/fpdf_parser.h"
+#include "fpdf_vt.h"
+class IPVT_FontMap
+{
+public:
+
+ virtual CPDF_Font* GetPDFFont(FX_INT32 nFontIndex) = 0;
+
+ virtual CFX_ByteString GetPDFFontAlias(FX_INT32 nFontIndex) = 0;
+};
+struct CPVT_Dash {
+
+ CPVT_Dash(FX_INT32 dash, FX_INT32 gap, FX_INT32 phase) : nDash(dash), nGap(gap), nPhase(phase)
+ {}
+
+ FX_INT32 nDash;
+
+ FX_INT32 nGap;
+
+ FX_INT32 nPhase;
+};
+#define CT_TRANSPARENT 0
+#define CT_GRAY 1
+#define CT_RGB 2
+#define CT_CMYK 3
+struct CPVT_Color {
+
+ CPVT_Color(FX_INT32 type = 0, FX_FLOAT color1 = 0.0f, FX_FLOAT color2 = 0.0f, FX_FLOAT color3 = 0.0f, FX_FLOAT color4 = 0.0f)
+ : nColorType(type), fColor1(color1), fColor2(color2), fColor3(color3), fColor4(color4)
+ {}
+
+ FX_INT32 nColorType;
+ FX_FLOAT fColor1;
+ FX_FLOAT fColor2;
+ FX_FLOAT fColor3;
+ FX_FLOAT fColor4;
+};
+class CPVT_Provider : public IPDF_VariableText_Provider
+{
+public:
+
+ CPVT_Provider(IPVT_FontMap * pFontMap);
+
+ virtual ~CPVT_Provider();
+
+ FX_INT32 GetCharWidth(FX_INT32 nFontIndex, FX_WORD word, FX_INT32 nWordStyle);
+
+ FX_INT32 GetTypeAscent(FX_INT32 nFontIndex);
+
+ FX_INT32 GetTypeDescent(FX_INT32 nFontIndex);
+
+ FX_INT32 GetWordFontIndex(FX_WORD word, FX_INT32 charset, FX_INT32 nFontIndex);
+
+ FX_BOOL IsLatinWord(FX_WORD word);
+
+ FX_INT32 GetDefaultFontIndex();
+private:
+
+ IPVT_FontMap * m_pFontMap;
+};
+#define PBS_SOLID 0
+#define PBS_DASH 1
+#define PBS_BEVELED 2
+#define PBS_INSET 3
+#define PBS_UNDERLINED 4
+class CPVT_GenerateAP
+{
+public:
+
+ static FX_BOOL GenerateTextFieldAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict);
+
+ static FX_BOOL GenerateComboBoxAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict);
+
+ static FX_BOOL GenerateListBoxAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict);
+
+ static CFX_ByteString GenerateEditAP(IPVT_FontMap * pFontMap, IPDF_VariableText_Iterator * pIterator,
+ const CPDF_Point & ptOffset, FX_BOOL bContinuous, FX_WORD SubWord = 0, const CPVT_WordRange * pVisible = NULL);
+
+ static CFX_ByteString GenerateBorderAP(const CPDF_Rect & rect, FX_FLOAT fWidth,
+ const CPVT_Color & color, const CPVT_Color & crLeftTop, const CPVT_Color & crRightBottom,
+ FX_INT32 nStyle, const CPVT_Dash & dash);
+
+ static CFX_ByteString GenerateColorAP(const CPVT_Color & color, const FX_BOOL & bFillOrStroke);
+};
diff --git a/core/include/fpdfdoc/fpdf_doc.h b/core/include/fpdfdoc/fpdf_doc.h
index fc19441309..cbb0fd4a11 100644
--- a/core/include/fpdfdoc/fpdf_doc.h
+++ b/core/include/fpdfdoc/fpdf_doc.h
@@ -1,1792 +1,1792 @@
-// 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 _FPDF_DOC_H_
-#define _FPDF_DOC_H_
-#ifndef _FPDF_PARSER_
-#include "../fpdfapi/fpdf_parser.h"
-#endif
-#ifndef _FPDF_RENDER_
-#include "../fpdfapi/fpdf_render.h"
-#endif
-class CPDF_Action;
-class CPDF_Annot;
-class CPDF_AnnotList;
-class CPDF_Bookmark;
-class CPDF_BookmarkTree;
-class CPDF_Dest;
-class CPDF_Link;
-class CPDF_LinkList;
-class CPDF_Metadata;
-class CPDF_NameTree;
-class CPDF_NumberTree;
-class CPDF_TextObject;
-class CPDF_ViewerPreferences;
-class CPDF_Page;
-class CPDF_RenderOptions;
-class CXML_Element;
-class CPDF_OCContext;
-class CPDF_DocJSActions;
-class CPDF_ActionFields;
-class CPDF_AAction;
-class CPDF_FileSpec;
-class CPDF_IconFit;
-class CPDF_DefaultAppearance;
-class CPDF_InterForm;
-class CPDF_FormField;
-class CPDF_FormNotify;
-class CPDF_FormControl;
-class CPDF_LWinParam;
-class CFieldTree;
-class CPDF_ApSettings;
-class CPDF_NameTree : public CFX_Object
-{
-public:
-
- CPDF_NameTree(CPDF_Dictionary* pRoot)
- {
- m_pRoot = pRoot;
- }
-
- CPDF_NameTree(CPDF_Document* pDoc, FX_BSTR category);
-
- CPDF_Object* LookupValue(int nIndex, CFX_ByteString& csName) const;
-
- CPDF_Object* LookupValue(const CFX_ByteString& csName) const;
-
- CPDF_Array* LookupNamedDest(CPDF_Document* pDoc, FX_BSTR sName);
-
- int GetIndex(const CFX_ByteString& csName) const;
-
- int GetCount() const;
-
-
- CPDF_Dictionary* GetRoot() const
- {
- return m_pRoot;
- }
-
-protected:
-
- CPDF_Dictionary* m_pRoot;
-};
-class CPDF_BookmarkTree : public CFX_Object
-{
-public:
-
- CPDF_BookmarkTree(CPDF_Document* pDoc)
- {
- m_pDocument = pDoc;
- }
-public:
-
-
-
- CPDF_Bookmark GetFirstChild(CPDF_Bookmark parent);
-
- CPDF_Bookmark GetNextSibling(CPDF_Bookmark bookmark);
-
-
- CPDF_Document* GetDocument() const
- {
- return m_pDocument;
- }
-protected:
-
- CPDF_Document* m_pDocument;
-};
-#define PDFBOOKMARK_ITALIC 1
-#define PDFBOOKMARK_BOLD 2
-class CPDF_Bookmark : public CFX_Object
-{
-public:
-
- CPDF_Bookmark(CPDF_Dictionary* pDict = NULL)
- {
- m_pDict = pDict;
- }
-
- operator CPDF_Dictionary*() const
- {
- return m_pDict;
- }
-
-
-
- FX_DWORD GetColorRef();
-
- FX_DWORD GetFontStyle();
-
- CFX_WideString GetTitle();
-
-
-
-
- CPDF_Dest GetDest(CPDF_Document* pDocument);
-
- CPDF_Action GetAction();
-
-
- CPDF_Dictionary* m_pDict;
-};
-#define PDFZOOM_XYZ 1
-#define PDFZOOM_FITPAGE 2
-#define PDFZOOM_FITHORZ 3
-#define PDFZOOM_FITVERT 4
-#define PDFZOOM_FITRECT 5
-#define PDFZOOM_FITBBOX 6
-#define PDFZOOM_FITBHORZ 7
-
-#define PDFZOOM_FITBVERT 8
-class CPDF_Dest : public CFX_Object
-{
-public:
-
- CPDF_Dest(CPDF_Object* pObj = NULL)
- {
- m_pObj = pObj;
- }
-
- operator CPDF_Object* () const
- {
- return m_pObj;
- }
-
- CFX_ByteString GetRemoteName();
-
- int GetPageIndex(CPDF_Document* pDoc);
-
- FX_DWORD GetPageObjNum();
-
- int GetZoomMode();
-
- FX_FLOAT GetParam(int index);
-
-
- CPDF_Object* m_pObj;
-};
-class CPDF_OCContext : public CFX_Object, public IPDF_OCContext
-{
-public:
-
- enum UsageType {
- View = 0,
- Design,
- Print,
- Export
- };
-
- CPDF_OCContext(CPDF_Document *pDoc, UsageType eUsageType = View);
-
- virtual ~CPDF_OCContext();
-
- CPDF_Document* GetDocument() const
- {
- return m_pDocument;
- }
-
- UsageType GetUsageType() const
- {
- return m_eUsageType;
- }
-
- FX_BOOL CheckOCGVisible(const CPDF_Dictionary *pOCGDict);
-
- void ResetOCContext();
-protected:
-
- FX_BOOL LoadOCGStateFromConfig(FX_BSTR csConfig, const CPDF_Dictionary *pOCGDict, FX_BOOL &bValidConfig) const;
-
- FX_BOOL LoadOCGState(const CPDF_Dictionary *pOCGDict) const;
-
- FX_BOOL GetOCGVisible(const CPDF_Dictionary *pOCGDict);
-
- FX_BOOL GetOCGVE(CPDF_Array *pExpression, FX_BOOL bFromConfig, int nLevel = 0);
-
- FX_BOOL LoadOCMDState(const CPDF_Dictionary *pOCMDDict, FX_BOOL bFromConfig);
-
- CPDF_Document *m_pDocument;
-
- UsageType m_eUsageType;
-
- CFX_MapPtrTemplate<const CPDF_Dictionary*, void*> m_OCGStates;
-};
-class CPDF_LWinParam : public CFX_Object
-{
-public:
-
- CPDF_LWinParam(CPDF_Dictionary* pDict)
- {
- m_pDict = pDict;
- }
-
- operator CPDF_Dictionary* () const
- {
- return m_pDict;
- }
-
- inline CFX_ByteString GetFileName()
- {
- return m_pDict->GetString("F");
- }
-
-
- inline CFX_ByteString GetDefaultDirectory()
- {
- return m_pDict->GetString("D");
- }
-
-
- inline CFX_ByteString GetOperation()
- {
- return m_pDict->GetString("O");
- }
-
-
- inline CFX_ByteString GetParameter()
- {
- return m_pDict->GetString("P");
- }
-
- CPDF_Dictionary* m_pDict;
-};
-class CPDF_ActionFields : public CFX_Object
-{
-public:
-
- CPDF_ActionFields(const CPDF_Action* pAction)
- {
- m_pAction = (CPDF_Action*)pAction;
- }
-
- operator CPDF_Action*() const
- {
- return m_pAction;
- }
-
- FX_DWORD GetFieldsCount() const;
-
- void GetAllFields(CFX_PtrArray& fieldObjects) const;
-
- CPDF_Object* GetField(FX_DWORD iIndex) const;
-
- CPDF_Action* m_pAction;
-};
-
-#define PDFNAMED_NEXTPAGE 1
-#define PDFNAMED_PREVPAGE 2
-#define PDFNAMED_FIRSTPAGE 3
-#define PDFNAMED_LASTPAGE 4
-#define PDFJS_MAXLENGTH 64
-class CPDF_Action : public CFX_Object
-{
-public:
-
- CPDF_Action(CPDF_Dictionary* pDict = NULL)
- {
- m_pDict = pDict;
- }
-
- operator CPDF_Dictionary* () const
- {
- return m_pDict;
- }
-
- enum ActionType {
- Unknown = 0,
- GoTo,
- GoToR,
- GoToE,
- Launch,
- Thread,
- URI,
- Sound,
- Movie,
- Hide,
- Named,
- SubmitForm,
- ResetForm,
- ImportData,
- JavaScript,
- SetOCGState,
- Rendition,
- Trans,
- GoTo3DView
- };
-
- CFX_ByteString GetTypeName() const
- {
- return m_pDict->GetString("S");
- }
-
- ActionType GetType() const;
-
-
-
- CPDF_Dest GetDest(CPDF_Document* pDoc) const;
-
-
-
-
-
- CFX_WideString GetFilePath() const;
-
-
-
-
- FX_BOOL GetNewWindow() const
- {
- return m_pDict->GetBoolean("NewWindow");
- }
-
-
-
-
- CPDF_LWinParam GetWinParam() const;
-
-
-
-
- CFX_ByteString GetURI(CPDF_Document* pDoc) const;
-
-
-
-
- FX_BOOL GetMouseMap() const
- {
- return m_pDict->GetBoolean("IsMap");
- }
-
-
-
-
- CPDF_ActionFields GetWidgets() const
- {
- return this;
- }
-
-
-
-
- FX_BOOL GetHideStatus() const
- {
- return m_pDict->GetBoolean("H", TRUE);
- }
-
-
-
-
- CFX_ByteString GetNamedAction() const
- {
- return m_pDict->GetString("N");
- }
-
-
-
-
- FX_DWORD GetFlags() const
- {
- return m_pDict->GetInteger("Flags");
- }
-
-
-
-
- CFX_WideString GetJavaScript() const;
-
-
-
-
- CPDF_Dictionary* GetAnnot() const;
-
-
-
-
- FX_INT32 GetOperationType() const;
-
-
-
-
- CPDF_Stream* GetSoundStream() const
- {
- return m_pDict->GetStream("Sound");
- }
-
- FX_FLOAT GetVolume() const
- {
- return m_pDict->GetNumber("Volume");
- }
-
- FX_BOOL IsSynchronous() const
- {
- return m_pDict->GetBoolean("Synchronous");
- }
-
- FX_BOOL IsRepeat() const
- {
- return m_pDict->GetBoolean("Repeat");
- }
-
- FX_BOOL IsMixPlay() const
- {
- return m_pDict->GetBoolean("Mix");
- }
-
-
-
-
- FX_DWORD GetSubActionsCount() const;
-
- CPDF_Action GetSubAction(FX_DWORD iIndex) const;
-
-
- CPDF_Dictionary* m_pDict;
-};
-class CPDF_AAction : public CFX_Object
-{
-public:
-
- CPDF_AAction(CPDF_Dictionary* pDict = NULL)
- {
- m_pDict = pDict;
- }
-
- operator CPDF_Dictionary*() const
- {
- return m_pDict;
- }
-
- enum AActionType {
- CursorEnter = 0,
- CursorExit,
- ButtonDown,
- ButtonUp,
- GetFocus,
- LoseFocus,
- PageOpen,
- PageClose,
- PageVisible,
- PageInvisible,
- OpenPage,
- ClosePage,
- KeyStroke,
- Format,
- Validate,
- Calculate,
- CloseDocument,
- SaveDocument,
- DocumentSaved,
- PrintDocument,
- DocumentPrinted
- };
-
- FX_BOOL ActionExist(AActionType eType) const;
-
- CPDF_Action GetAction(AActionType eType) const;
-
- FX_POSITION GetStartPos() const;
-
- CPDF_Action GetNextAction(FX_POSITION& pos, AActionType& eType) const;
-
- CPDF_Dictionary* m_pDict;
-};
-class CPDF_DocJSActions : public CFX_Object
-{
-public:
- CPDF_DocJSActions(CPDF_Document* pDoc);
-
-
- int CountJSActions() const;
-
- CPDF_Action GetJSAction(int index, CFX_ByteString& csName) const;
-
- CPDF_Action GetJSAction(const CFX_ByteString& csName) const;
-
- int FindJSAction(const CFX_ByteString& csName) const;
-
-
- CPDF_Document* GetDocument() const
- {
- return m_pDocument;
- }
-
-protected:
-
- CPDF_Document* m_pDocument;
-};
-class CPDF_FileSpec : public CFX_Object
-{
-public:
-
- CPDF_FileSpec();
-
- CPDF_FileSpec(CPDF_Object *pObj)
- {
- m_pObj = pObj;
- }
-
- operator CPDF_Object*() const
- {
- return m_pObj;
- }
-
- FX_BOOL IsURL() const;
-
- FX_BOOL GetFileName(CFX_WideString &wsFileName) const;
-
- CPDF_Stream* GetFileStream() const;
-
- void SetFileName(FX_WSTR wsFileName, FX_BOOL bURL = FALSE);
-protected:
-
- CPDF_Object *m_pObj;
-};
-class CPDF_LinkList : public CFX_Object
-{
-public:
-
- CPDF_LinkList(CPDF_Document* pDoc)
- {
- m_pDocument = pDoc;
- }
-
- ~CPDF_LinkList();
-
- CPDF_Link GetLinkAtPoint(CPDF_Page* pPage, FX_FLOAT pdf_x, FX_FLOAT pdf_y);
-
- int CountLinks(CPDF_Page* pPage);
-
- CPDF_Link GetLink(CPDF_Page* pPage, int index);
-
- CPDF_Document* GetDocument() const
- {
- return m_pDocument;
- }
-protected:
-
- CPDF_Document* m_pDocument;
-
- CFX_MapPtrToPtr m_PageMap;
-
- CFX_PtrArray* GetPageLinks(CPDF_Page* pPage);
-
- void LoadPageLinks(CPDF_Page* pPage, CFX_PtrArray* pList);
-};
-class CPDF_Link : public CFX_Object
-{
-public:
-
- CPDF_Link(CPDF_Dictionary* pDict = NULL)
- {
- m_pDict = pDict;
- }
-
- operator CPDF_Dictionary*() const
- {
- return m_pDict;
- }
-
- CFX_FloatRect GetRect();
-
-
-
- CPDF_Dest GetDest(CPDF_Document* pDoc);
-
- CPDF_Action GetAction();
-
-
- CPDF_Dictionary* m_pDict;
-};
-#define ANNOTFLAG_INVISIBLE 1
-#define ANNOTFLAG_HIDDEN 2
-#define ANNOTFLAG_PRINT 4
-#define ANNOTFLAG_NOZOOM 8
-#define ANNOTFLAG_NOROTATE 0x10
-#define ANNOTFLAG_NOVIEW 0x20
-#define ANNOTFLAG_READONLY 0x40
-#define ANNOTFLAG_LOCKED 0x80
-#define ANNOTFLAG_TOGGLENOVIEW 0x100
-class CPDF_Annot : public CFX_PrivateData, public CFX_Object
-{
-public:
-
- CPDF_Annot(CPDF_Dictionary* pDict);
-
- ~CPDF_Annot();
-
- CPDF_Dictionary* m_pAnnotDict;
-
- CFX_ByteString GetSubType() const;
-
- FX_DWORD GetFlags() const
- {
- return m_pAnnotDict->GetInteger("F");
- }
-
- void GetRect(CFX_FloatRect& rect) const;
-
- enum AppearanceMode {
- Normal,
- Rollover,
- Down
- };
-
- FX_BOOL DrawAppearance(const CPDF_Page* pPage, CFX_RenderDevice* pDevice, const CFX_AffineMatrix* pUser2Device,
- AppearanceMode mode, const CPDF_RenderOptions* pOptions);
-
- FX_BOOL DrawInContext(const CPDF_Page* pPage, const CPDF_RenderContext* pContext,
- const CFX_AffineMatrix* pUser2Device, AppearanceMode mode);
-
- void ClearCachedAP();
-
-
- void DrawBorder(CFX_RenderDevice* pDevice, const CFX_AffineMatrix* pUser2Device,
- const CPDF_RenderOptions* pOptions);
-
- CPDF_PageObject* GetBorder(FX_BOOL bPrint, const CPDF_RenderOptions* pOptions);
-
-
-
- int CountIRTNotes();
-
- CPDF_Annot* GetIRTNote(int index);
-
-
- CPDF_Form* GetAPForm(const CPDF_Page* pPage, AppearanceMode mode);
-private:
-
- CFX_MapPtrToPtr m_APMap;
-protected:
- friend class CPDF_AnnotList;
-
- CPDF_AnnotList* m_pList;
-
- CPDF_Reference* NewAnnotRef();
-};
-class CPDF_AnnotList : public CFX_Object
-{
-public:
-
- CPDF_AnnotList(CPDF_Page* pPage);
-
- ~CPDF_AnnotList();
-
- void GetAnnotMatrix(const CPDF_Dictionary* pAnnotDict, const CFX_Matrix* pUser2Device, CFX_Matrix &matrix) const;
-
- void GetAnnotRect(const CPDF_Dictionary* pAnnotDict, const CFX_Matrix* pUser2Device, CPDF_Rect &rtAnnot) const;
-
- void DisplayAnnots(const CPDF_Page* pPage, CFX_RenderDevice* pDevice,
- CFX_AffineMatrix* pMatrix, FX_BOOL bShowWidget,
- CPDF_RenderOptions* pOptions);
-
- void DisplayAnnots(const CPDF_Page* pPage, CPDF_RenderContext* pContext,
- FX_BOOL bPrinting, CFX_AffineMatrix* pMatrix, FX_BOOL bShowWidget,
- CPDF_RenderOptions* pOptions)
- {
- DisplayAnnots(pPage, NULL, pContext, bPrinting, pMatrix, bShowWidget ? 3 : 1, pOptions, NULL);
- }
-
- void DisplayAnnots(const CPDF_Page* pPage, CPDF_RenderContext* pContext,
- FX_BOOL bPrinting, CFX_AffineMatrix* pMatrix, FX_BOOL bShowWidget,
- CPDF_RenderOptions* pOptions, FX_RECT *pClipRect)
- {
- DisplayAnnots(pPage, NULL, pContext, bPrinting, pMatrix, bShowWidget ? 3 : 1, pOptions, pClipRect);
- }
-
- void DisplayAnnots(const CPDF_Page* pPage, CFX_RenderDevice* pDevice, CPDF_RenderContext* pContext,
- FX_BOOL bPrinting, CFX_AffineMatrix* pMatrix, FX_DWORD dwAnnotFlags,
- CPDF_RenderOptions* pOptions, FX_RECT* pClipRect);
-
-
-
- CPDF_Annot* GetAt(int index)
- {
- return (CPDF_Annot*)m_AnnotList.GetAt(index);
- }
-
- int Count()
- {
- return m_AnnotList.GetSize();
- }
-
- int GetIndex(CPDF_Annot* pAnnot);
-
-
- CPDF_Document* GetDocument() const
- {
- return m_pDocument;
- }
-protected:
-
- CFX_PtrArray m_AnnotList;
-
- CPDF_Dictionary* m_pPageDict;
-
- CPDF_Document* m_pDocument;
-
- CFX_PtrArray m_Borders;
-
- void DisplayPass(const CPDF_Page* pPage, CFX_RenderDevice* pDevice,
- CPDF_RenderContext* pContext, FX_BOOL bPrinting, CFX_AffineMatrix* pMatrix,
- FX_BOOL bWidget, CPDF_RenderOptions* pOptions, FX_RECT* clip_rect);
- friend class CPDF_Annot;
-};
-#define COLORTYPE_TRANSPARENT 0
-#define COLORTYPE_GRAY 1
-#define COLORTYPE_RGB 2
-#define COLORTYPE_CMYK 3
-class CPDF_DefaultAppearance : public CFX_Object
-{
-public:
-
- CPDF_DefaultAppearance(const CFX_ByteString& csDA = "")
- {
- m_csDA = csDA;
- }
-
- CPDF_DefaultAppearance(const CPDF_DefaultAppearance& cDA)
- {
- m_csDA = (CFX_ByteString)(CPDF_DefaultAppearance&)cDA;
- }
-
-
- operator CFX_ByteString() const
- {
- return m_csDA;
- }
-
- const CPDF_DefaultAppearance& operator =(const CFX_ByteString& csDA)
- {
- m_csDA = csDA;
- return *this;
- }
-
- const CPDF_DefaultAppearance& operator =(const CPDF_DefaultAppearance& cDA)
- {
- m_csDA = (CFX_ByteString)(CPDF_DefaultAppearance&)cDA;
- return *this;
- }
-
-
-
- FX_BOOL HasFont();
-
- CFX_ByteString GetFontString();
-
- void GetFont(CFX_ByteString& csFontNameTag, FX_FLOAT& fFontSize);
-
-
-
-
- FX_BOOL HasColor(FX_BOOL bStrokingOperation = FALSE);
-
- CFX_ByteString GetColorString(FX_BOOL bStrokingOperation = FALSE);
-
- void GetColor(int& iColorType, FX_FLOAT fc[4], FX_BOOL bStrokingOperation = FALSE);
-
- void GetColor(FX_ARGB& color, int& iColorType, FX_BOOL bStrokingOperation = FALSE);
-
-
-
-
- FX_BOOL HasTextMatrix();
-
- CFX_ByteString GetTextMatrixString();
-
- CFX_AffineMatrix GetTextMatrix();
-
-protected:
-
- CFX_ByteString m_csDA;
-};
-#define FIELDTYPE_UNKNOWN 0
-#define FIELDTYPE_PUSHBUTTON 1
-#define FIELDTYPE_CHECKBOX 2
-#define FIELDTYPE_RADIOBUTTON 3
-#define FIELDTYPE_COMBOBOX 4
-#define FIELDTYPE_LISTBOX 5
-#define FIELDTYPE_TEXTFIELD 6
-#define FIELDTYPE_SIGNATURE 7
-class CPDF_InterForm : public CFX_PrivateData, public CFX_Object
-{
-public:
-
- CPDF_InterForm(CPDF_Document* pDocument, FX_BOOL bUpdateAP);
-
- ~CPDF_InterForm();
-
-
-
- static void EnableUpdateAP(FX_BOOL bUpdateAP);
-
- static FX_BOOL UpdatingAPEnabled();
-
-
- static CFX_ByteString GenerateNewResourceName(const CPDF_Dictionary* pResDict, FX_LPCSTR csType, int iMinLen = 2, FX_LPCSTR csPrefix = "");
-
-
-
- static CPDF_Font* AddSystemDefaultFont(const CPDF_Document* pDocument);
-
- static CPDF_Font* AddSystemFont(const CPDF_Document* pDocument, CFX_ByteString csFontName, FX_BYTE iCharSet = 1);
-
- static CPDF_Font* AddSystemFont(const CPDF_Document* pDocument, CFX_WideString csFontName, FX_BYTE iCharSet = 1);
-
- static CPDF_Font* AddStandardFont(const CPDF_Document* pDocument, CFX_ByteString csFontName);
-
- static CFX_ByteString GetNativeFont(FX_BYTE iCharSet, FX_LPVOID pLogFont = NULL);
-
- static CFX_ByteString GetNativeFont(FX_LPVOID pLogFont = NULL);
-
- static FX_BYTE GetNativeCharSet();
-
- static CPDF_Font* AddNativeFont(FX_BYTE iCharSet, const CPDF_Document* pDocument);
-
- static CPDF_Font* AddNativeFont(const CPDF_Document* pDocument);
-
-
-
-
- FX_BOOL ValidateFieldName(CFX_WideString& csNewFieldName, int iType);
-
- FX_BOOL ValidateFieldName(const CPDF_FormField* pField, CFX_WideString& csNewFieldName);
-
- FX_BOOL ValidateFieldName(const CPDF_FormControl* pControl, CFX_WideString& csNewFieldName);
-
-
-
-
- FX_DWORD CountFields(const CFX_WideString &csFieldName = L"");
-
- CPDF_FormField* GetField(FX_DWORD index, const CFX_WideString &csFieldName = L"");
-
- void GetAllFieldNames(CFX_WideStringArray& allFieldNames);
-
- FX_BOOL IsValidFormField(const void* pField);
-
- CPDF_FormField* GetFieldByDict(CPDF_Dictionary* pFieldDict) const;
-
-
-
-
- FX_DWORD CountControls(CFX_WideString csFieldName = L"");
-
- CPDF_FormControl* GetControl(FX_DWORD index, CFX_WideString csFieldName = L"");
-
- FX_BOOL IsValidFormControl(const void* pControl);
-
- int CountPageControls(CPDF_Page* pPage) const;
-
- CPDF_FormControl* GetPageControl(CPDF_Page* pPage, int index) const;
-
-
- CPDF_FormControl* GetControlAtPoint(CPDF_Page* pPage, FX_FLOAT pdf_x, FX_FLOAT pdf_y) const;
-
- CPDF_FormControl* GetControlByDict(CPDF_Dictionary* pWidgetDict) const;
-
-
-
-
- FX_DWORD CountInternalFields(const CFX_WideString& csFieldName = L"") const;
-
- CPDF_Dictionary* GetInternalField(FX_DWORD index, const CFX_WideString& csFieldName = L"") const;
-
-
-
-
-
- CPDF_Document* GetDocument() const
- {
- return m_pDocument;
- }
-
- CPDF_Dictionary* GetFormDict() const
- {
- return m_pFormDict;
- }
-
-
-
-
- FX_BOOL NeedConstructAP();
-
- void NeedConstructAP(FX_BOOL bNeedAP);
-
-
-
-
- int CountFieldsInCalculationOrder();
-
- CPDF_FormField* GetFieldInCalculationOrder(int index);
-
- int FindFieldInCalculationOrder(const CPDF_FormField* pField);
-
-
-
-
- FX_DWORD CountFormFonts();
-
- CPDF_Font* GetFormFont(FX_DWORD index, CFX_ByteString& csNameTag);
-
- CPDF_Font* GetFormFont(CFX_ByteString csNameTag);
-
- CPDF_Font* GetFormFont(CFX_ByteString csFontName, CFX_ByteString& csNameTag);
-
- CPDF_Font* GetNativeFormFont(FX_BYTE iCharSet, CFX_ByteString& csNameTag);
-
- CPDF_Font* GetNativeFormFont(CFX_ByteString& csNameTag);
-
- FX_BOOL FindFormFont(const CPDF_Font* pFont, CFX_ByteString& csNameTag);
-
- FX_BOOL FindFormFont(CFX_ByteString csFontName, CPDF_Font*& pFont, CFX_ByteString& csNameTag);
-
- inline FX_BOOL FindFormFont(CFX_WideString csFontName, CPDF_Font*& pFont, CFX_ByteString& csNameTag)
- {
- return FindFormFont(PDF_EncodeText(csFontName), pFont, csNameTag);
- }
-
-
-
-
-
- void AddFormFont(const CPDF_Font* pFont, CFX_ByteString& csNameTag);
-
- CPDF_Font* AddNativeFormFont(FX_BYTE iCharSet, CFX_ByteString& csNameTag);
-
- CPDF_Font* AddNativeFormFont(CFX_ByteString& csNameTag);
-
- void RemoveFormFont(const CPDF_Font* pFont);
-
- void RemoveFormFont(CFX_ByteString csNameTag);
-
-
-
-
- CPDF_DefaultAppearance GetDefaultAppearance();
-
- CPDF_Font* GetDefaultFormFont();
-
-
-
- int GetFormAlignment();
-
-
-
-
- CPDF_FormField* CheckRequiredFields(const CFX_PtrArray *fields = NULL, FX_BOOL bIncludeOrExclude = TRUE) const;
-
- CFDF_Document* ExportToFDF(FX_WSTR pdf_path, FX_BOOL bSimpleFileSpec = FALSE) const;
-
- CFDF_Document* ExportToFDF(FX_WSTR pdf_path, CFX_PtrArray& fields, FX_BOOL bIncludeOrExclude = TRUE, FX_BOOL bSimpleFileSpec = FALSE) const;
-
- FX_BOOL ImportFromFDF(const CFDF_Document* pFDFDoc, FX_BOOL bNotify = FALSE);
-
-
-
-
- FX_BOOL ResetForm(const CFX_PtrArray& fields, FX_BOOL bIncludeOrExclude = TRUE, FX_BOOL bNotify = FALSE);
-
- FX_BOOL ResetForm(FX_BOOL bNotify = FALSE);
-
- void ReloadForm();
-
- CPDF_FormNotify* GetFormNotify() const
- {
- return m_pFormNotify;
- }
-
- void SetFormNotify(const CPDF_FormNotify* pNotify);
-
-
- int GetPageWithWidget(int iCurPage, FX_BOOL bNext);
-
-
-
- FX_BOOL IsUpdated()
- {
- return m_bUpdated;
- }
-
- void ClearUpdatedFlag()
- {
- m_bUpdated = FALSE;
- }
-
-
- FX_BOOL HasXFAForm() const;
-
- void FixPageFields(const CPDF_Page* pPage);
-protected:
-
- static FX_BOOL m_bUpdateAP;
-
- void LoadField(CPDF_Dictionary* pFieldDict, int nLevel = 0);
-
- CPDF_Object* GetFieldAttr(CPDF_Dictionary* pFieldDict, const FX_CHAR* name);
-
- CPDF_FormField* AddTerminalField(const CPDF_Dictionary* pFieldDict);
-
- CPDF_FormControl* AddControl(const CPDF_FormField* pField, const CPDF_Dictionary* pWidgetDict);
-
- void FDF_ImportField(CPDF_Dictionary* pField, const CFX_WideString& parent_name, FX_BOOL bNotify = FALSE, int nLevel = 0);
-
- FX_BOOL ValidateFieldName(CFX_WideString& csNewFieldName, int iType, const CPDF_FormField* pExcludedField, const CPDF_FormControl* pExcludedControl);
-
- int CompareFieldName(const CFX_WideString& name1, const CFX_WideString& name2);
-
- int CompareFieldName(const CFX_ByteString& name1, const CFX_ByteString& name2);
-
- CPDF_Document* m_pDocument;
-
- FX_BOOL m_bGenerateAP;
-
- CPDF_Dictionary* m_pFormDict;
-
- CFX_MapPtrToPtr m_ControlMap;
-
- CFieldTree *m_pFieldTree;
-
- CFX_ByteString m_bsEncoding;
-
- CPDF_FormNotify* m_pFormNotify;
-
- FX_BOOL m_bUpdated;
- friend class CPDF_FormControl;
- friend class CPDF_FormField;
-};
-#define FORMFIELD_READONLY 0x01
-#define FORMFIELD_REQUIRED 0x02
-#define FORMFIELD_NOEXPORT 0x04
-#define FORMRADIO_NOTOGGLEOFF 0x100
-#define FORMRADIO_UNISON 0x200
-#define FORMTEXT_MULTILINE 0x100
-#define FORMTEXT_PASSWORD 0x200
-#define FORMTEXT_NOSCROLL 0x400
-#define FORMTEXT_COMB 0x800
-#define FORMCOMBO_EDIT 0x100
-#define FORMLIST_MULTISELECT 0x100
-class CPDF_FormField : public CFX_Object
-{
-public:
-
- enum Type {
- Unknown,
- PushButton,
- RadioButton,
- CheckBox,
- Text,
- RichText,
- File,
- ListBox,
- ComboBox,
- Sign
- };
-
- CFX_WideString GetFullName();
-
- Type GetType()
- {
- return m_Type;
- }
-
- FX_DWORD GetFlags()
- {
- return m_Flags;
- }
-
- CPDF_InterForm* GetInterForm() const
- {
- return m_pForm;
- }
-
- CPDF_Dictionary* GetFieldDict() const
- {
- return m_pDict;
- }
-
- void SetFieldDict(CPDF_Dictionary* pDict)
- {
- m_pDict = pDict;
- }
-
- FX_BOOL ResetField(FX_BOOL bNotify = FALSE);
-
-
-
- int CountControls()
- {
- return m_ControlList.GetSize();
- }
-
- CPDF_FormControl* GetControl(int index)
- {
- return (CPDF_FormControl*)m_ControlList.GetAt(index);
- }
-
- int GetControlIndex(const CPDF_FormControl* pControl);
-
-
-
-
- int GetFieldType();
-
-
-
-
- CPDF_AAction GetAdditionalAction();
-
-
-
-
- CFX_WideString GetAlternateName();
-
-
-
-
- CFX_WideString GetMappingName();
-
-
-
-
- FX_DWORD GetFieldFlags();
-
-
-
-
- CFX_ByteString GetDefaultStyle();
-
-
-
-
- CFX_WideString GetRichTextString();
-
-
-
- CFX_WideString GetValue();
-
- CFX_WideString GetDefaultValue();
-
- FX_BOOL SetValue(const CFX_WideString& value, FX_BOOL bNotify = FALSE);
-
-
-
-
-
- int GetMaxLen();
-
-
-
-
- int CountSelectedItems();
-
- int GetSelectedIndex(int index);
-
- FX_BOOL ClearSelection(FX_BOOL bNotify = FALSE);
-
- FX_BOOL IsItemSelected(int index);
-
- FX_BOOL SetItemSelection(int index, FX_BOOL bSelected, FX_BOOL bNotify = FALSE);
-
- FX_BOOL IsItemDefaultSelected(int index);
-
- int GetDefaultSelectedItem();
-
-
-
-
- int CountOptions();
-
- CFX_WideString GetOptionLabel(int index);
-
- CFX_WideString GetOptionValue(int index);
-
- int FindOption(CFX_WideString csOptLabel);
-
- int FindOptionValue(FX_LPCWSTR csOptValue, int iStartIndex = 0);
-
-
-
-
- FX_BOOL CheckControl(int iControlIndex, FX_BOOL bChecked, FX_BOOL bNotify = FALSE);
-
-
-
-
- int GetTopVisibleIndex();
-
-
-
-
- int CountSelectedOptions();
-
- int GetSelectedOptionIndex(int index);
-
- FX_BOOL IsOptionSelected(int iOptIndex);
-
- FX_BOOL SelectOption(int iOptIndex, FX_BOOL bSelected, FX_BOOL bNotify = FALSE);
-
- FX_BOOL ClearSelectedOptions(FX_BOOL bNotify = FALSE);
-
-
-
-
- FX_FLOAT GetFontSize()
- {
- return m_FontSize;
- }
-
- CPDF_Font* GetFont()
- {
- return m_pFont;
- }
-
-protected:
-
- CPDF_FormField(CPDF_InterForm* pForm, CPDF_Dictionary* pDict);
-
- ~CPDF_FormField();
-
- CPDF_FormField::Type m_Type;
-
- FX_DWORD m_Flags;
-
- CPDF_InterForm* m_pForm;
-
- CPDF_Dictionary* m_pDict;
-
- CFX_PtrArray m_ControlList;
- friend class CPDF_InterForm;
- friend class CPDF_FormControl;
-
-
-
- CFX_WideString GetValue(FX_BOOL bDefault);
-
- FX_BOOL SetValue(const CFX_WideString& value, FX_BOOL bDefault, FX_BOOL bNotify);
-
-
- void SyncFieldFlags();
-
- int FindListSel(CPDF_String* str);
-
- CFX_WideString GetOptionText(int index, int sub_index);
-
- void LoadDA();
-
- void UpdateAP(CPDF_FormControl* pControl);
-
-
-
- CFX_WideString GetCheckValue(FX_BOOL bDefault);
-
- FX_BOOL SetCheckValue(const CFX_WideString& value, FX_BOOL bDefault, FX_BOOL bNotify);
-
-
- FX_FLOAT m_FontSize;
-
- CPDF_Font* m_pFont;
-};
-CPDF_Object* FPDF_GetFieldAttr(CPDF_Dictionary* pFieldDict, const FX_CHAR* name, int nLevel = 0);
-class CPDF_IconFit : public CFX_Object
-{
-public:
-
- CPDF_IconFit(CPDF_Dictionary* pDict = NULL)
- {
- m_pDict = pDict;
- }
-
- operator CPDF_Dictionary*() const
- {
- return m_pDict;
- }
-
-
-
-
- enum ScaleMethod {
- Always = 0,
- Bigger,
- Smaller,
- Never
- };
-
- ScaleMethod GetScaleMethod();
-
-
-
-
- FX_BOOL IsProportionalScale();
-
-
-
-
- void GetIconPosition(FX_FLOAT& fLeft, FX_FLOAT& fBottom);
-
-
-
-
- FX_BOOL GetFittingBounds();
-
-
- CPDF_Dictionary* m_pDict;
-};
-
-#define TEXTPOS_CAPTION 0
-#define TEXTPOS_ICON 1
-#define TEXTPOS_BELOW 2
-#define TEXTPOS_ABOVE 3
-#define TEXTPOS_RIGHT 4
-#define TEXTPOS_LEFT 5
-#define TEXTPOS_OVERLAID 6
-class CPDF_FormControl : public CFX_Object
-{
-public:
-
- CPDF_FormField::Type GetType()
- {
- return m_pField->GetType();
- }
-
- CPDF_InterForm* GetInterForm() const
- {
- return m_pForm;
- }
-
- CPDF_FormField* GetField() const
- {
- return m_pField;
- }
-
- CPDF_Dictionary* GetWidget() const
- {
- return m_pWidgetDict;
- }
-
- CFX_FloatRect GetRect();
-
- void DrawControl(CFX_RenderDevice* pDevice, CFX_AffineMatrix* pMatrix,
- CPDF_Page* pPage, CPDF_Annot::AppearanceMode mode, const CPDF_RenderOptions* pOptions = NULL);
-
-
-
- CFX_ByteString GetCheckedAPState();
-
- CFX_WideString GetExportValue();
-
- FX_BOOL IsChecked();
-
- FX_BOOL IsDefaultChecked();
-
-
-
-
- enum HighlightingMode {
- None = 0,
- Invert,
- Outline,
- Push,
- Toggle
- };
-
- HighlightingMode GetHighlightingMode();
-
-
-
-
- FX_BOOL HasMKEntry(CFX_ByteString csEntry);
-
-
-
-
- int GetRotation();
-
-
-
-
- inline FX_ARGB GetBorderColor(int& iColorType)
- {
- return GetColor(iColorType, "BC");
- }
-
- inline FX_FLOAT GetOriginalBorderColor(int index)
- {
- return GetOriginalColor(index, "BC");
- }
-
- inline void GetOriginalBorderColor(int& iColorType, FX_FLOAT fc[4])
- {
- GetOriginalColor(iColorType, fc, "BC");
- }
-
-
-
-
- inline FX_ARGB GetBackgroundColor(int& iColorType)
- {
- return GetColor(iColorType, "BG");
- }
-
- inline FX_FLOAT GetOriginalBackgroundColor(int index)
- {
- return GetOriginalColor(index, "BG");
- }
-
- inline void GetOriginalBackgroundColor(int& iColorType, FX_FLOAT fc[4])
- {
- GetOriginalColor(iColorType, fc, "BG");
- }
-
-
-
-
- inline CFX_WideString GetNormalCaption()
- {
- return GetCaption("CA");
- }
-
-
-
-
- inline CFX_WideString GetRolloverCaption()
- {
- return GetCaption("RC");
- }
-
-
-
-
- inline CFX_WideString GetDownCaption()
- {
- return GetCaption("AC");
- }
-
-
-
-
- inline CPDF_Stream* GetNormalIcon()
- {
- return GetIcon("I");
- }
-
-
-
-
- inline CPDF_Stream* GetRolloverIcon()
- {
- return GetIcon("RI");
- }
-
-
-
-
- inline CPDF_Stream* GetDownIcon()
- {
- return GetIcon("IX");
- }
-
-
-
-
- CPDF_IconFit GetIconFit();
-
-
-
-
- int GetTextPosition();
-
-
-
-
- CPDF_Action GetAction();
-
-
-
-
- CPDF_AAction GetAdditionalAction();
-
-
-
-
- CPDF_DefaultAppearance GetDefaultAppearance();
-
- CPDF_Font* GetDefaultControlFont();
-
-
-
-
- int GetControlAlignment();
-
-protected:
-
- CPDF_FormControl(CPDF_FormField* pField, CPDF_Dictionary* pWidgetDict);
-
- CFX_ByteString GetOnStateName();
-
- void SetOnStateName(const CFX_ByteString& csOn);
-
- void CheckControl(FX_BOOL bChecked);
-
- FX_ARGB GetColor(int& iColorType, CFX_ByteString csEntry);
-
- FX_FLOAT GetOriginalColor(int index, CFX_ByteString csEntry);
-
- void GetOriginalColor(int& iColorType, FX_FLOAT fc[4], CFX_ByteString csEntry);
-
- CFX_WideString GetCaption(CFX_ByteString csEntry);
-
- CPDF_Stream* GetIcon(CFX_ByteString csEntry);
-
- CPDF_ApSettings GetMK(FX_BOOL bCreate);
-
- CPDF_InterForm* m_pForm;
-
- CPDF_FormField* m_pField;
-
- CPDF_Dictionary* m_pWidgetDict;
- friend class CPDF_InterForm;
- friend class CPDF_FormField;
-};
-class CPDF_FormNotify : public CFX_Object
-{
-public:
-
- virtual ~CPDF_FormNotify() {}
-
- virtual int BeforeValueChange(const CPDF_FormField* pField, CFX_WideString& csValue)
- {
- return 0;
- }
-
- virtual int AfterValueChange(const CPDF_FormField* pField)
- {
- return 0;
- }
-
- virtual int BeforeSelectionChange(const CPDF_FormField* pField, CFX_WideString& csValue)
- {
- return 0;
- }
-
- virtual int AfterSelectionChange(const CPDF_FormField* pField)
- {
- return 0;
- }
-
- virtual int AfterCheckedStatusChange(const CPDF_FormField* pField, const CFX_ByteArray& statusArray)
- {
- return 0;
- }
-
- virtual int BeforeFormReset(const CPDF_InterForm* pForm)
- {
- return 0;
- }
-
- virtual int AfterFormReset(const CPDF_InterForm* pForm)
- {
- return 0;
- }
-
- virtual int BeforeFormImportData(const CPDF_InterForm* pForm)
- {
- return 0;
- }
-
- virtual int AfterFormImportData(const CPDF_InterForm* pForm)
- {
- return 0;
- }
-};
-FX_BOOL FPDF_GenerateAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict);
-class CPDF_PageLabel : public CFX_Object
-{
-public:
-
- CPDF_PageLabel(CPDF_Document* pDocument)
- {
- m_pDocument = pDocument;
- }
-
-
- CFX_WideString GetLabel(int nPage) const;
-
- FX_INT32 GetPageByLabel(FX_BSTR bsLabel) const;
-
-
- FX_INT32 GetPageByLabel(FX_WSTR wsLabel) const;
-
-protected:
- CPDF_Document* m_pDocument;
-};
-class CPDF_Metadata
-{
-public:
-
- CPDF_Metadata();
-
-
- ~CPDF_Metadata();
-
- void LoadDoc(CPDF_Document *pDoc);
-
-
- FX_INT32 GetString(FX_BSTR bsItem, CFX_WideString &wsStr);
-
- CXML_Element* GetRoot() const;
-
- CXML_Element* GetRDF() const;
-
-protected:
- FX_LPVOID m_pData;
-};
-class CPDF_ViewerPreferences
-{
-public:
-
- CPDF_ViewerPreferences(CPDF_Document *pDoc);
-
-
- ~CPDF_ViewerPreferences();
-
-
- FX_BOOL IsDirectionR2L() const;
-
- FX_BOOL PrintScaling() const;
-
-
-protected:
- CPDF_Document* m_pDoc;
-};
-class CPDF_ApSettings : public CFX_Object
-{
-public:
-
- CPDF_ApSettings(CPDF_Dictionary* pDict = NULL)
- {
- m_pDict = pDict;
- }
-
- operator CPDF_Dictionary* () const
- {
- return m_pDict;
- }
-
- FX_BOOL HasMKEntry(FX_BSTR csEntry);
-
-
-
- int GetRotation();
-
-
-
-
- inline FX_ARGB GetBorderColor(int& iColorType)
- {
- return GetColor(iColorType, FX_BSTRC("BC"));
- }
-
- inline FX_FLOAT GetOriginalBorderColor(int index)
- {
- return GetOriginalColor(index, FX_BSTRC("BC"));
- }
-
- inline void GetOriginalBorderColor(int& iColorType, FX_FLOAT fc[4])
- {
- GetOriginalColor(iColorType, fc, FX_BSTRC("BC"));
- }
-
-
-
-
- inline FX_ARGB GetBackgroundColor(int& iColorType)
- {
- return GetColor(iColorType, FX_BSTRC("BG"));
- }
-
- inline FX_FLOAT GetOriginalBackgroundColor(int index)
- {
- return GetOriginalColor(index, FX_BSTRC("BG"));
- }
-
- inline void GetOriginalBackgroundColor(int& iColorType, FX_FLOAT fc[4])
- {
- GetOriginalColor(iColorType, fc, FX_BSTRC("BG"));
- }
-
-
-
-
- inline CFX_WideString GetNormalCaption()
- {
- return GetCaption(FX_BSTRC("CA"));
- }
-
-
-
-
- inline CFX_WideString GetRolloverCaption()
- {
- return GetCaption(FX_BSTRC("RC"));
- }
-
-
-
-
- inline CFX_WideString GetDownCaption()
- {
- return GetCaption(FX_BSTRC("AC"));
- }
-
-
-
-
- inline CPDF_Stream* GetNormalIcon()
- {
- return GetIcon(FX_BSTRC("I"));
- }
-
-
-
-
- inline CPDF_Stream* GetRolloverIcon()
- {
- return GetIcon(FX_BSTRC("RI"));
- }
-
-
-
-
- inline CPDF_Stream* GetDownIcon()
- {
- return GetIcon(FX_BSTRC("IX"));
- }
-
-
-
-
- CPDF_IconFit GetIconFit();
-
-
-
-
- int GetTextPosition();
-
- CPDF_Dictionary* m_pDict;
-protected:
-
- FX_ARGB GetColor(int& iColorType, FX_BSTR csEntry);
-
- FX_FLOAT GetOriginalColor(int index, FX_BSTR csEntry);
-
- void GetOriginalColor(int& iColorType, FX_FLOAT fc[4], FX_BSTR csEntry);
-
- CFX_WideString GetCaption(FX_BSTR csEntry);
-
- CPDF_Stream* GetIcon(FX_BSTR csEntry);
- friend class CPDF_FormControl;
-};
-#endif
+// 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 _FPDF_DOC_H_
+#define _FPDF_DOC_H_
+#ifndef _FPDF_PARSER_
+#include "../fpdfapi/fpdf_parser.h"
+#endif
+#ifndef _FPDF_RENDER_
+#include "../fpdfapi/fpdf_render.h"
+#endif
+class CPDF_Action;
+class CPDF_Annot;
+class CPDF_AnnotList;
+class CPDF_Bookmark;
+class CPDF_BookmarkTree;
+class CPDF_Dest;
+class CPDF_Link;
+class CPDF_LinkList;
+class CPDF_Metadata;
+class CPDF_NameTree;
+class CPDF_NumberTree;
+class CPDF_TextObject;
+class CPDF_ViewerPreferences;
+class CPDF_Page;
+class CPDF_RenderOptions;
+class CXML_Element;
+class CPDF_OCContext;
+class CPDF_DocJSActions;
+class CPDF_ActionFields;
+class CPDF_AAction;
+class CPDF_FileSpec;
+class CPDF_IconFit;
+class CPDF_DefaultAppearance;
+class CPDF_InterForm;
+class CPDF_FormField;
+class CPDF_FormNotify;
+class CPDF_FormControl;
+class CPDF_LWinParam;
+class CFieldTree;
+class CPDF_ApSettings;
+class CPDF_NameTree : public CFX_Object
+{
+public:
+
+ CPDF_NameTree(CPDF_Dictionary* pRoot)
+ {
+ m_pRoot = pRoot;
+ }
+
+ CPDF_NameTree(CPDF_Document* pDoc, FX_BSTR category);
+
+ CPDF_Object* LookupValue(int nIndex, CFX_ByteString& csName) const;
+
+ CPDF_Object* LookupValue(const CFX_ByteString& csName) const;
+
+ CPDF_Array* LookupNamedDest(CPDF_Document* pDoc, FX_BSTR sName);
+
+ int GetIndex(const CFX_ByteString& csName) const;
+
+ int GetCount() const;
+
+
+ CPDF_Dictionary* GetRoot() const
+ {
+ return m_pRoot;
+ }
+
+protected:
+
+ CPDF_Dictionary* m_pRoot;
+};
+class CPDF_BookmarkTree : public CFX_Object
+{
+public:
+
+ CPDF_BookmarkTree(CPDF_Document* pDoc)
+ {
+ m_pDocument = pDoc;
+ }
+public:
+
+
+
+ CPDF_Bookmark GetFirstChild(CPDF_Bookmark parent);
+
+ CPDF_Bookmark GetNextSibling(CPDF_Bookmark bookmark);
+
+
+ CPDF_Document* GetDocument() const
+ {
+ return m_pDocument;
+ }
+protected:
+
+ CPDF_Document* m_pDocument;
+};
+#define PDFBOOKMARK_ITALIC 1
+#define PDFBOOKMARK_BOLD 2
+class CPDF_Bookmark : public CFX_Object
+{
+public:
+
+ CPDF_Bookmark(CPDF_Dictionary* pDict = NULL)
+ {
+ m_pDict = pDict;
+ }
+
+ operator CPDF_Dictionary*() const
+ {
+ return m_pDict;
+ }
+
+
+
+ FX_DWORD GetColorRef();
+
+ FX_DWORD GetFontStyle();
+
+ CFX_WideString GetTitle();
+
+
+
+
+ CPDF_Dest GetDest(CPDF_Document* pDocument);
+
+ CPDF_Action GetAction();
+
+
+ CPDF_Dictionary* m_pDict;
+};
+#define PDFZOOM_XYZ 1
+#define PDFZOOM_FITPAGE 2
+#define PDFZOOM_FITHORZ 3
+#define PDFZOOM_FITVERT 4
+#define PDFZOOM_FITRECT 5
+#define PDFZOOM_FITBBOX 6
+#define PDFZOOM_FITBHORZ 7
+
+#define PDFZOOM_FITBVERT 8
+class CPDF_Dest : public CFX_Object
+{
+public:
+
+ CPDF_Dest(CPDF_Object* pObj = NULL)
+ {
+ m_pObj = pObj;
+ }
+
+ operator CPDF_Object* () const
+ {
+ return m_pObj;
+ }
+
+ CFX_ByteString GetRemoteName();
+
+ int GetPageIndex(CPDF_Document* pDoc);
+
+ FX_DWORD GetPageObjNum();
+
+ int GetZoomMode();
+
+ FX_FLOAT GetParam(int index);
+
+
+ CPDF_Object* m_pObj;
+};
+class CPDF_OCContext : public CFX_Object, public IPDF_OCContext
+{
+public:
+
+ enum UsageType {
+ View = 0,
+ Design,
+ Print,
+ Export
+ };
+
+ CPDF_OCContext(CPDF_Document *pDoc, UsageType eUsageType = View);
+
+ virtual ~CPDF_OCContext();
+
+ CPDF_Document* GetDocument() const
+ {
+ return m_pDocument;
+ }
+
+ UsageType GetUsageType() const
+ {
+ return m_eUsageType;
+ }
+
+ FX_BOOL CheckOCGVisible(const CPDF_Dictionary *pOCGDict);
+
+ void ResetOCContext();
+protected:
+
+ FX_BOOL LoadOCGStateFromConfig(FX_BSTR csConfig, const CPDF_Dictionary *pOCGDict, FX_BOOL &bValidConfig) const;
+
+ FX_BOOL LoadOCGState(const CPDF_Dictionary *pOCGDict) const;
+
+ FX_BOOL GetOCGVisible(const CPDF_Dictionary *pOCGDict);
+
+ FX_BOOL GetOCGVE(CPDF_Array *pExpression, FX_BOOL bFromConfig, int nLevel = 0);
+
+ FX_BOOL LoadOCMDState(const CPDF_Dictionary *pOCMDDict, FX_BOOL bFromConfig);
+
+ CPDF_Document *m_pDocument;
+
+ UsageType m_eUsageType;
+
+ CFX_MapPtrTemplate<const CPDF_Dictionary*, void*> m_OCGStates;
+};
+class CPDF_LWinParam : public CFX_Object
+{
+public:
+
+ CPDF_LWinParam(CPDF_Dictionary* pDict)
+ {
+ m_pDict = pDict;
+ }
+
+ operator CPDF_Dictionary* () const
+ {
+ return m_pDict;
+ }
+
+ inline CFX_ByteString GetFileName()
+ {
+ return m_pDict->GetString("F");
+ }
+
+
+ inline CFX_ByteString GetDefaultDirectory()
+ {
+ return m_pDict->GetString("D");
+ }
+
+
+ inline CFX_ByteString GetOperation()
+ {
+ return m_pDict->GetString("O");
+ }
+
+
+ inline CFX_ByteString GetParameter()
+ {
+ return m_pDict->GetString("P");
+ }
+
+ CPDF_Dictionary* m_pDict;
+};
+class CPDF_ActionFields : public CFX_Object
+{
+public:
+
+ CPDF_ActionFields(const CPDF_Action* pAction)
+ {
+ m_pAction = (CPDF_Action*)pAction;
+ }
+
+ operator CPDF_Action*() const
+ {
+ return m_pAction;
+ }
+
+ FX_DWORD GetFieldsCount() const;
+
+ void GetAllFields(CFX_PtrArray& fieldObjects) const;
+
+ CPDF_Object* GetField(FX_DWORD iIndex) const;
+
+ CPDF_Action* m_pAction;
+};
+
+#define PDFNAMED_NEXTPAGE 1
+#define PDFNAMED_PREVPAGE 2
+#define PDFNAMED_FIRSTPAGE 3
+#define PDFNAMED_LASTPAGE 4
+#define PDFJS_MAXLENGTH 64
+class CPDF_Action : public CFX_Object
+{
+public:
+
+ CPDF_Action(CPDF_Dictionary* pDict = NULL)
+ {
+ m_pDict = pDict;
+ }
+
+ operator CPDF_Dictionary* () const
+ {
+ return m_pDict;
+ }
+
+ enum ActionType {
+ Unknown = 0,
+ GoTo,
+ GoToR,
+ GoToE,
+ Launch,
+ Thread,
+ URI,
+ Sound,
+ Movie,
+ Hide,
+ Named,
+ SubmitForm,
+ ResetForm,
+ ImportData,
+ JavaScript,
+ SetOCGState,
+ Rendition,
+ Trans,
+ GoTo3DView
+ };
+
+ CFX_ByteString GetTypeName() const
+ {
+ return m_pDict->GetString("S");
+ }
+
+ ActionType GetType() const;
+
+
+
+ CPDF_Dest GetDest(CPDF_Document* pDoc) const;
+
+
+
+
+
+ CFX_WideString GetFilePath() const;
+
+
+
+
+ FX_BOOL GetNewWindow() const
+ {
+ return m_pDict->GetBoolean("NewWindow");
+ }
+
+
+
+
+ CPDF_LWinParam GetWinParam() const;
+
+
+
+
+ CFX_ByteString GetURI(CPDF_Document* pDoc) const;
+
+
+
+
+ FX_BOOL GetMouseMap() const
+ {
+ return m_pDict->GetBoolean("IsMap");
+ }
+
+
+
+
+ CPDF_ActionFields GetWidgets() const
+ {
+ return this;
+ }
+
+
+
+
+ FX_BOOL GetHideStatus() const
+ {
+ return m_pDict->GetBoolean("H", TRUE);
+ }
+
+
+
+
+ CFX_ByteString GetNamedAction() const
+ {
+ return m_pDict->GetString("N");
+ }
+
+
+
+
+ FX_DWORD GetFlags() const
+ {
+ return m_pDict->GetInteger("Flags");
+ }
+
+
+
+
+ CFX_WideString GetJavaScript() const;
+
+
+
+
+ CPDF_Dictionary* GetAnnot() const;
+
+
+
+
+ FX_INT32 GetOperationType() const;
+
+
+
+
+ CPDF_Stream* GetSoundStream() const
+ {
+ return m_pDict->GetStream("Sound");
+ }
+
+ FX_FLOAT GetVolume() const
+ {
+ return m_pDict->GetNumber("Volume");
+ }
+
+ FX_BOOL IsSynchronous() const
+ {
+ return m_pDict->GetBoolean("Synchronous");
+ }
+
+ FX_BOOL IsRepeat() const
+ {
+ return m_pDict->GetBoolean("Repeat");
+ }
+
+ FX_BOOL IsMixPlay() const
+ {
+ return m_pDict->GetBoolean("Mix");
+ }
+
+
+
+
+ FX_DWORD GetSubActionsCount() const;
+
+ CPDF_Action GetSubAction(FX_DWORD iIndex) const;
+
+
+ CPDF_Dictionary* m_pDict;
+};
+class CPDF_AAction : public CFX_Object
+{
+public:
+
+ CPDF_AAction(CPDF_Dictionary* pDict = NULL)
+ {
+ m_pDict = pDict;
+ }
+
+ operator CPDF_Dictionary*() const
+ {
+ return m_pDict;
+ }
+
+ enum AActionType {
+ CursorEnter = 0,
+ CursorExit,
+ ButtonDown,
+ ButtonUp,
+ GetFocus,
+ LoseFocus,
+ PageOpen,
+ PageClose,
+ PageVisible,
+ PageInvisible,
+ OpenPage,
+ ClosePage,
+ KeyStroke,
+ Format,
+ Validate,
+ Calculate,
+ CloseDocument,
+ SaveDocument,
+ DocumentSaved,
+ PrintDocument,
+ DocumentPrinted
+ };
+
+ FX_BOOL ActionExist(AActionType eType) const;
+
+ CPDF_Action GetAction(AActionType eType) const;
+
+ FX_POSITION GetStartPos() const;
+
+ CPDF_Action GetNextAction(FX_POSITION& pos, AActionType& eType) const;
+
+ CPDF_Dictionary* m_pDict;
+};
+class CPDF_DocJSActions : public CFX_Object
+{
+public:
+ CPDF_DocJSActions(CPDF_Document* pDoc);
+
+
+ int CountJSActions() const;
+
+ CPDF_Action GetJSAction(int index, CFX_ByteString& csName) const;
+
+ CPDF_Action GetJSAction(const CFX_ByteString& csName) const;
+
+ int FindJSAction(const CFX_ByteString& csName) const;
+
+
+ CPDF_Document* GetDocument() const
+ {
+ return m_pDocument;
+ }
+
+protected:
+
+ CPDF_Document* m_pDocument;
+};
+class CPDF_FileSpec : public CFX_Object
+{
+public:
+
+ CPDF_FileSpec();
+
+ CPDF_FileSpec(CPDF_Object *pObj)
+ {
+ m_pObj = pObj;
+ }
+
+ operator CPDF_Object*() const
+ {
+ return m_pObj;
+ }
+
+ FX_BOOL IsURL() const;
+
+ FX_BOOL GetFileName(CFX_WideString &wsFileName) const;
+
+ CPDF_Stream* GetFileStream() const;
+
+ void SetFileName(FX_WSTR wsFileName, FX_BOOL bURL = FALSE);
+protected:
+
+ CPDF_Object *m_pObj;
+};
+class CPDF_LinkList : public CFX_Object
+{
+public:
+
+ CPDF_LinkList(CPDF_Document* pDoc)
+ {
+ m_pDocument = pDoc;
+ }
+
+ ~CPDF_LinkList();
+
+ CPDF_Link GetLinkAtPoint(CPDF_Page* pPage, FX_FLOAT pdf_x, FX_FLOAT pdf_y);
+
+ int CountLinks(CPDF_Page* pPage);
+
+ CPDF_Link GetLink(CPDF_Page* pPage, int index);
+
+ CPDF_Document* GetDocument() const
+ {
+ return m_pDocument;
+ }
+protected:
+
+ CPDF_Document* m_pDocument;
+
+ CFX_MapPtrToPtr m_PageMap;
+
+ CFX_PtrArray* GetPageLinks(CPDF_Page* pPage);
+
+ void LoadPageLinks(CPDF_Page* pPage, CFX_PtrArray* pList);
+};
+class CPDF_Link : public CFX_Object
+{
+public:
+
+ CPDF_Link(CPDF_Dictionary* pDict = NULL)
+ {
+ m_pDict = pDict;
+ }
+
+ operator CPDF_Dictionary*() const
+ {
+ return m_pDict;
+ }
+
+ CFX_FloatRect GetRect();
+
+
+
+ CPDF_Dest GetDest(CPDF_Document* pDoc);
+
+ CPDF_Action GetAction();
+
+
+ CPDF_Dictionary* m_pDict;
+};
+#define ANNOTFLAG_INVISIBLE 1
+#define ANNOTFLAG_HIDDEN 2
+#define ANNOTFLAG_PRINT 4
+#define ANNOTFLAG_NOZOOM 8
+#define ANNOTFLAG_NOROTATE 0x10
+#define ANNOTFLAG_NOVIEW 0x20
+#define ANNOTFLAG_READONLY 0x40
+#define ANNOTFLAG_LOCKED 0x80
+#define ANNOTFLAG_TOGGLENOVIEW 0x100
+class CPDF_Annot : public CFX_PrivateData, public CFX_Object
+{
+public:
+
+ CPDF_Annot(CPDF_Dictionary* pDict);
+
+ ~CPDF_Annot();
+
+ CPDF_Dictionary* m_pAnnotDict;
+
+ CFX_ByteString GetSubType() const;
+
+ FX_DWORD GetFlags() const
+ {
+ return m_pAnnotDict->GetInteger("F");
+ }
+
+ void GetRect(CFX_FloatRect& rect) const;
+
+ enum AppearanceMode {
+ Normal,
+ Rollover,
+ Down
+ };
+
+ FX_BOOL DrawAppearance(const CPDF_Page* pPage, CFX_RenderDevice* pDevice, const CFX_AffineMatrix* pUser2Device,
+ AppearanceMode mode, const CPDF_RenderOptions* pOptions);
+
+ FX_BOOL DrawInContext(const CPDF_Page* pPage, const CPDF_RenderContext* pContext,
+ const CFX_AffineMatrix* pUser2Device, AppearanceMode mode);
+
+ void ClearCachedAP();
+
+
+ void DrawBorder(CFX_RenderDevice* pDevice, const CFX_AffineMatrix* pUser2Device,
+ const CPDF_RenderOptions* pOptions);
+
+ CPDF_PageObject* GetBorder(FX_BOOL bPrint, const CPDF_RenderOptions* pOptions);
+
+
+
+ int CountIRTNotes();
+
+ CPDF_Annot* GetIRTNote(int index);
+
+
+ CPDF_Form* GetAPForm(const CPDF_Page* pPage, AppearanceMode mode);
+private:
+
+ CFX_MapPtrToPtr m_APMap;
+protected:
+ friend class CPDF_AnnotList;
+
+ CPDF_AnnotList* m_pList;
+
+ CPDF_Reference* NewAnnotRef();
+};
+class CPDF_AnnotList : public CFX_Object
+{
+public:
+
+ CPDF_AnnotList(CPDF_Page* pPage);
+
+ ~CPDF_AnnotList();
+
+ void GetAnnotMatrix(const CPDF_Dictionary* pAnnotDict, const CFX_Matrix* pUser2Device, CFX_Matrix &matrix) const;
+
+ void GetAnnotRect(const CPDF_Dictionary* pAnnotDict, const CFX_Matrix* pUser2Device, CPDF_Rect &rtAnnot) const;
+
+ void DisplayAnnots(const CPDF_Page* pPage, CFX_RenderDevice* pDevice,
+ CFX_AffineMatrix* pMatrix, FX_BOOL bShowWidget,
+ CPDF_RenderOptions* pOptions);
+
+ void DisplayAnnots(const CPDF_Page* pPage, CPDF_RenderContext* pContext,
+ FX_BOOL bPrinting, CFX_AffineMatrix* pMatrix, FX_BOOL bShowWidget,
+ CPDF_RenderOptions* pOptions)
+ {
+ DisplayAnnots(pPage, NULL, pContext, bPrinting, pMatrix, bShowWidget ? 3 : 1, pOptions, NULL);
+ }
+
+ void DisplayAnnots(const CPDF_Page* pPage, CPDF_RenderContext* pContext,
+ FX_BOOL bPrinting, CFX_AffineMatrix* pMatrix, FX_BOOL bShowWidget,
+ CPDF_RenderOptions* pOptions, FX_RECT *pClipRect)
+ {
+ DisplayAnnots(pPage, NULL, pContext, bPrinting, pMatrix, bShowWidget ? 3 : 1, pOptions, pClipRect);
+ }
+
+ void DisplayAnnots(const CPDF_Page* pPage, CFX_RenderDevice* pDevice, CPDF_RenderContext* pContext,
+ FX_BOOL bPrinting, CFX_AffineMatrix* pMatrix, FX_DWORD dwAnnotFlags,
+ CPDF_RenderOptions* pOptions, FX_RECT* pClipRect);
+
+
+
+ CPDF_Annot* GetAt(int index)
+ {
+ return (CPDF_Annot*)m_AnnotList.GetAt(index);
+ }
+
+ int Count()
+ {
+ return m_AnnotList.GetSize();
+ }
+
+ int GetIndex(CPDF_Annot* pAnnot);
+
+
+ CPDF_Document* GetDocument() const
+ {
+ return m_pDocument;
+ }
+protected:
+
+ CFX_PtrArray m_AnnotList;
+
+ CPDF_Dictionary* m_pPageDict;
+
+ CPDF_Document* m_pDocument;
+
+ CFX_PtrArray m_Borders;
+
+ void DisplayPass(const CPDF_Page* pPage, CFX_RenderDevice* pDevice,
+ CPDF_RenderContext* pContext, FX_BOOL bPrinting, CFX_AffineMatrix* pMatrix,
+ FX_BOOL bWidget, CPDF_RenderOptions* pOptions, FX_RECT* clip_rect);
+ friend class CPDF_Annot;
+};
+#define COLORTYPE_TRANSPARENT 0
+#define COLORTYPE_GRAY 1
+#define COLORTYPE_RGB 2
+#define COLORTYPE_CMYK 3
+class CPDF_DefaultAppearance : public CFX_Object
+{
+public:
+
+ CPDF_DefaultAppearance(const CFX_ByteString& csDA = "")
+ {
+ m_csDA = csDA;
+ }
+
+ CPDF_DefaultAppearance(const CPDF_DefaultAppearance& cDA)
+ {
+ m_csDA = (CFX_ByteString)(CPDF_DefaultAppearance&)cDA;
+ }
+
+
+ operator CFX_ByteString() const
+ {
+ return m_csDA;
+ }
+
+ const CPDF_DefaultAppearance& operator =(const CFX_ByteString& csDA)
+ {
+ m_csDA = csDA;
+ return *this;
+ }
+
+ const CPDF_DefaultAppearance& operator =(const CPDF_DefaultAppearance& cDA)
+ {
+ m_csDA = (CFX_ByteString)(CPDF_DefaultAppearance&)cDA;
+ return *this;
+ }
+
+
+
+ FX_BOOL HasFont();
+
+ CFX_ByteString GetFontString();
+
+ void GetFont(CFX_ByteString& csFontNameTag, FX_FLOAT& fFontSize);
+
+
+
+
+ FX_BOOL HasColor(FX_BOOL bStrokingOperation = FALSE);
+
+ CFX_ByteString GetColorString(FX_BOOL bStrokingOperation = FALSE);
+
+ void GetColor(int& iColorType, FX_FLOAT fc[4], FX_BOOL bStrokingOperation = FALSE);
+
+ void GetColor(FX_ARGB& color, int& iColorType, FX_BOOL bStrokingOperation = FALSE);
+
+
+
+
+ FX_BOOL HasTextMatrix();
+
+ CFX_ByteString GetTextMatrixString();
+
+ CFX_AffineMatrix GetTextMatrix();
+
+protected:
+
+ CFX_ByteString m_csDA;
+};
+#define FIELDTYPE_UNKNOWN 0
+#define FIELDTYPE_PUSHBUTTON 1
+#define FIELDTYPE_CHECKBOX 2
+#define FIELDTYPE_RADIOBUTTON 3
+#define FIELDTYPE_COMBOBOX 4
+#define FIELDTYPE_LISTBOX 5
+#define FIELDTYPE_TEXTFIELD 6
+#define FIELDTYPE_SIGNATURE 7
+class CPDF_InterForm : public CFX_PrivateData, public CFX_Object
+{
+public:
+
+ CPDF_InterForm(CPDF_Document* pDocument, FX_BOOL bUpdateAP);
+
+ ~CPDF_InterForm();
+
+
+
+ static void EnableUpdateAP(FX_BOOL bUpdateAP);
+
+ static FX_BOOL UpdatingAPEnabled();
+
+
+ static CFX_ByteString GenerateNewResourceName(const CPDF_Dictionary* pResDict, FX_LPCSTR csType, int iMinLen = 2, FX_LPCSTR csPrefix = "");
+
+
+
+ static CPDF_Font* AddSystemDefaultFont(const CPDF_Document* pDocument);
+
+ static CPDF_Font* AddSystemFont(const CPDF_Document* pDocument, CFX_ByteString csFontName, FX_BYTE iCharSet = 1);
+
+ static CPDF_Font* AddSystemFont(const CPDF_Document* pDocument, CFX_WideString csFontName, FX_BYTE iCharSet = 1);
+
+ static CPDF_Font* AddStandardFont(const CPDF_Document* pDocument, CFX_ByteString csFontName);
+
+ static CFX_ByteString GetNativeFont(FX_BYTE iCharSet, FX_LPVOID pLogFont = NULL);
+
+ static CFX_ByteString GetNativeFont(FX_LPVOID pLogFont = NULL);
+
+ static FX_BYTE GetNativeCharSet();
+
+ static CPDF_Font* AddNativeFont(FX_BYTE iCharSet, const CPDF_Document* pDocument);
+
+ static CPDF_Font* AddNativeFont(const CPDF_Document* pDocument);
+
+
+
+
+ FX_BOOL ValidateFieldName(CFX_WideString& csNewFieldName, int iType);
+
+ FX_BOOL ValidateFieldName(const CPDF_FormField* pField, CFX_WideString& csNewFieldName);
+
+ FX_BOOL ValidateFieldName(const CPDF_FormControl* pControl, CFX_WideString& csNewFieldName);
+
+
+
+
+ FX_DWORD CountFields(const CFX_WideString &csFieldName = L"");
+
+ CPDF_FormField* GetField(FX_DWORD index, const CFX_WideString &csFieldName = L"");
+
+ void GetAllFieldNames(CFX_WideStringArray& allFieldNames);
+
+ FX_BOOL IsValidFormField(const void* pField);
+
+ CPDF_FormField* GetFieldByDict(CPDF_Dictionary* pFieldDict) const;
+
+
+
+
+ FX_DWORD CountControls(CFX_WideString csFieldName = L"");
+
+ CPDF_FormControl* GetControl(FX_DWORD index, CFX_WideString csFieldName = L"");
+
+ FX_BOOL IsValidFormControl(const void* pControl);
+
+ int CountPageControls(CPDF_Page* pPage) const;
+
+ CPDF_FormControl* GetPageControl(CPDF_Page* pPage, int index) const;
+
+
+ CPDF_FormControl* GetControlAtPoint(CPDF_Page* pPage, FX_FLOAT pdf_x, FX_FLOAT pdf_y) const;
+
+ CPDF_FormControl* GetControlByDict(CPDF_Dictionary* pWidgetDict) const;
+
+
+
+
+ FX_DWORD CountInternalFields(const CFX_WideString& csFieldName = L"") const;
+
+ CPDF_Dictionary* GetInternalField(FX_DWORD index, const CFX_WideString& csFieldName = L"") const;
+
+
+
+
+
+ CPDF_Document* GetDocument() const
+ {
+ return m_pDocument;
+ }
+
+ CPDF_Dictionary* GetFormDict() const
+ {
+ return m_pFormDict;
+ }
+
+
+
+
+ FX_BOOL NeedConstructAP();
+
+ void NeedConstructAP(FX_BOOL bNeedAP);
+
+
+
+
+ int CountFieldsInCalculationOrder();
+
+ CPDF_FormField* GetFieldInCalculationOrder(int index);
+
+ int FindFieldInCalculationOrder(const CPDF_FormField* pField);
+
+
+
+
+ FX_DWORD CountFormFonts();
+
+ CPDF_Font* GetFormFont(FX_DWORD index, CFX_ByteString& csNameTag);
+
+ CPDF_Font* GetFormFont(CFX_ByteString csNameTag);
+
+ CPDF_Font* GetFormFont(CFX_ByteString csFontName, CFX_ByteString& csNameTag);
+
+ CPDF_Font* GetNativeFormFont(FX_BYTE iCharSet, CFX_ByteString& csNameTag);
+
+ CPDF_Font* GetNativeFormFont(CFX_ByteString& csNameTag);
+
+ FX_BOOL FindFormFont(const CPDF_Font* pFont, CFX_ByteString& csNameTag);
+
+ FX_BOOL FindFormFont(CFX_ByteString csFontName, CPDF_Font*& pFont, CFX_ByteString& csNameTag);
+
+ inline FX_BOOL FindFormFont(CFX_WideString csFontName, CPDF_Font*& pFont, CFX_ByteString& csNameTag)
+ {
+ return FindFormFont(PDF_EncodeText(csFontName), pFont, csNameTag);
+ }
+
+
+
+
+
+ void AddFormFont(const CPDF_Font* pFont, CFX_ByteString& csNameTag);
+
+ CPDF_Font* AddNativeFormFont(FX_BYTE iCharSet, CFX_ByteString& csNameTag);
+
+ CPDF_Font* AddNativeFormFont(CFX_ByteString& csNameTag);
+
+ void RemoveFormFont(const CPDF_Font* pFont);
+
+ void RemoveFormFont(CFX_ByteString csNameTag);
+
+
+
+
+ CPDF_DefaultAppearance GetDefaultAppearance();
+
+ CPDF_Font* GetDefaultFormFont();
+
+
+
+ int GetFormAlignment();
+
+
+
+
+ CPDF_FormField* CheckRequiredFields(const CFX_PtrArray *fields = NULL, FX_BOOL bIncludeOrExclude = TRUE) const;
+
+ CFDF_Document* ExportToFDF(FX_WSTR pdf_path, FX_BOOL bSimpleFileSpec = FALSE) const;
+
+ CFDF_Document* ExportToFDF(FX_WSTR pdf_path, CFX_PtrArray& fields, FX_BOOL bIncludeOrExclude = TRUE, FX_BOOL bSimpleFileSpec = FALSE) const;
+
+ FX_BOOL ImportFromFDF(const CFDF_Document* pFDFDoc, FX_BOOL bNotify = FALSE);
+
+
+
+
+ FX_BOOL ResetForm(const CFX_PtrArray& fields, FX_BOOL bIncludeOrExclude = TRUE, FX_BOOL bNotify = FALSE);
+
+ FX_BOOL ResetForm(FX_BOOL bNotify = FALSE);
+
+ void ReloadForm();
+
+ CPDF_FormNotify* GetFormNotify() const
+ {
+ return m_pFormNotify;
+ }
+
+ void SetFormNotify(const CPDF_FormNotify* pNotify);
+
+
+ int GetPageWithWidget(int iCurPage, FX_BOOL bNext);
+
+
+
+ FX_BOOL IsUpdated()
+ {
+ return m_bUpdated;
+ }
+
+ void ClearUpdatedFlag()
+ {
+ m_bUpdated = FALSE;
+ }
+
+
+ FX_BOOL HasXFAForm() const;
+
+ void FixPageFields(const CPDF_Page* pPage);
+protected:
+
+ static FX_BOOL m_bUpdateAP;
+
+ void LoadField(CPDF_Dictionary* pFieldDict, int nLevel = 0);
+
+ CPDF_Object* GetFieldAttr(CPDF_Dictionary* pFieldDict, const FX_CHAR* name);
+
+ CPDF_FormField* AddTerminalField(const CPDF_Dictionary* pFieldDict);
+
+ CPDF_FormControl* AddControl(const CPDF_FormField* pField, const CPDF_Dictionary* pWidgetDict);
+
+ void FDF_ImportField(CPDF_Dictionary* pField, const CFX_WideString& parent_name, FX_BOOL bNotify = FALSE, int nLevel = 0);
+
+ FX_BOOL ValidateFieldName(CFX_WideString& csNewFieldName, int iType, const CPDF_FormField* pExcludedField, const CPDF_FormControl* pExcludedControl);
+
+ int CompareFieldName(const CFX_WideString& name1, const CFX_WideString& name2);
+
+ int CompareFieldName(const CFX_ByteString& name1, const CFX_ByteString& name2);
+
+ CPDF_Document* m_pDocument;
+
+ FX_BOOL m_bGenerateAP;
+
+ CPDF_Dictionary* m_pFormDict;
+
+ CFX_MapPtrToPtr m_ControlMap;
+
+ CFieldTree *m_pFieldTree;
+
+ CFX_ByteString m_bsEncoding;
+
+ CPDF_FormNotify* m_pFormNotify;
+
+ FX_BOOL m_bUpdated;
+ friend class CPDF_FormControl;
+ friend class CPDF_FormField;
+};
+#define FORMFIELD_READONLY 0x01
+#define FORMFIELD_REQUIRED 0x02
+#define FORMFIELD_NOEXPORT 0x04
+#define FORMRADIO_NOTOGGLEOFF 0x100
+#define FORMRADIO_UNISON 0x200
+#define FORMTEXT_MULTILINE 0x100
+#define FORMTEXT_PASSWORD 0x200
+#define FORMTEXT_NOSCROLL 0x400
+#define FORMTEXT_COMB 0x800
+#define FORMCOMBO_EDIT 0x100
+#define FORMLIST_MULTISELECT 0x100
+class CPDF_FormField : public CFX_Object
+{
+public:
+
+ enum Type {
+ Unknown,
+ PushButton,
+ RadioButton,
+ CheckBox,
+ Text,
+ RichText,
+ File,
+ ListBox,
+ ComboBox,
+ Sign
+ };
+
+ CFX_WideString GetFullName();
+
+ Type GetType()
+ {
+ return m_Type;
+ }
+
+ FX_DWORD GetFlags()
+ {
+ return m_Flags;
+ }
+
+ CPDF_InterForm* GetInterForm() const
+ {
+ return m_pForm;
+ }
+
+ CPDF_Dictionary* GetFieldDict() const
+ {
+ return m_pDict;
+ }
+
+ void SetFieldDict(CPDF_Dictionary* pDict)
+ {
+ m_pDict = pDict;
+ }
+
+ FX_BOOL ResetField(FX_BOOL bNotify = FALSE);
+
+
+
+ int CountControls()
+ {
+ return m_ControlList.GetSize();
+ }
+
+ CPDF_FormControl* GetControl(int index)
+ {
+ return (CPDF_FormControl*)m_ControlList.GetAt(index);
+ }
+
+ int GetControlIndex(const CPDF_FormControl* pControl);
+
+
+
+
+ int GetFieldType();
+
+
+
+
+ CPDF_AAction GetAdditionalAction();
+
+
+
+
+ CFX_WideString GetAlternateName();
+
+
+
+
+ CFX_WideString GetMappingName();
+
+
+
+
+ FX_DWORD GetFieldFlags();
+
+
+
+
+ CFX_ByteString GetDefaultStyle();
+
+
+
+
+ CFX_WideString GetRichTextString();
+
+
+
+ CFX_WideString GetValue();
+
+ CFX_WideString GetDefaultValue();
+
+ FX_BOOL SetValue(const CFX_WideString& value, FX_BOOL bNotify = FALSE);
+
+
+
+
+
+ int GetMaxLen();
+
+
+
+
+ int CountSelectedItems();
+
+ int GetSelectedIndex(int index);
+
+ FX_BOOL ClearSelection(FX_BOOL bNotify = FALSE);
+
+ FX_BOOL IsItemSelected(int index);
+
+ FX_BOOL SetItemSelection(int index, FX_BOOL bSelected, FX_BOOL bNotify = FALSE);
+
+ FX_BOOL IsItemDefaultSelected(int index);
+
+ int GetDefaultSelectedItem();
+
+
+
+
+ int CountOptions();
+
+ CFX_WideString GetOptionLabel(int index);
+
+ CFX_WideString GetOptionValue(int index);
+
+ int FindOption(CFX_WideString csOptLabel);
+
+ int FindOptionValue(FX_LPCWSTR csOptValue, int iStartIndex = 0);
+
+
+
+
+ FX_BOOL CheckControl(int iControlIndex, FX_BOOL bChecked, FX_BOOL bNotify = FALSE);
+
+
+
+
+ int GetTopVisibleIndex();
+
+
+
+
+ int CountSelectedOptions();
+
+ int GetSelectedOptionIndex(int index);
+
+ FX_BOOL IsOptionSelected(int iOptIndex);
+
+ FX_BOOL SelectOption(int iOptIndex, FX_BOOL bSelected, FX_BOOL bNotify = FALSE);
+
+ FX_BOOL ClearSelectedOptions(FX_BOOL bNotify = FALSE);
+
+
+
+
+ FX_FLOAT GetFontSize()
+ {
+ return m_FontSize;
+ }
+
+ CPDF_Font* GetFont()
+ {
+ return m_pFont;
+ }
+
+protected:
+
+ CPDF_FormField(CPDF_InterForm* pForm, CPDF_Dictionary* pDict);
+
+ ~CPDF_FormField();
+
+ CPDF_FormField::Type m_Type;
+
+ FX_DWORD m_Flags;
+
+ CPDF_InterForm* m_pForm;
+
+ CPDF_Dictionary* m_pDict;
+
+ CFX_PtrArray m_ControlList;
+ friend class CPDF_InterForm;
+ friend class CPDF_FormControl;
+
+
+
+ CFX_WideString GetValue(FX_BOOL bDefault);
+
+ FX_BOOL SetValue(const CFX_WideString& value, FX_BOOL bDefault, FX_BOOL bNotify);
+
+
+ void SyncFieldFlags();
+
+ int FindListSel(CPDF_String* str);
+
+ CFX_WideString GetOptionText(int index, int sub_index);
+
+ void LoadDA();
+
+ void UpdateAP(CPDF_FormControl* pControl);
+
+
+
+ CFX_WideString GetCheckValue(FX_BOOL bDefault);
+
+ FX_BOOL SetCheckValue(const CFX_WideString& value, FX_BOOL bDefault, FX_BOOL bNotify);
+
+
+ FX_FLOAT m_FontSize;
+
+ CPDF_Font* m_pFont;
+};
+CPDF_Object* FPDF_GetFieldAttr(CPDF_Dictionary* pFieldDict, const FX_CHAR* name, int nLevel = 0);
+class CPDF_IconFit : public CFX_Object
+{
+public:
+
+ CPDF_IconFit(CPDF_Dictionary* pDict = NULL)
+ {
+ m_pDict = pDict;
+ }
+
+ operator CPDF_Dictionary*() const
+ {
+ return m_pDict;
+ }
+
+
+
+
+ enum ScaleMethod {
+ Always = 0,
+ Bigger,
+ Smaller,
+ Never
+ };
+
+ ScaleMethod GetScaleMethod();
+
+
+
+
+ FX_BOOL IsProportionalScale();
+
+
+
+
+ void GetIconPosition(FX_FLOAT& fLeft, FX_FLOAT& fBottom);
+
+
+
+
+ FX_BOOL GetFittingBounds();
+
+
+ CPDF_Dictionary* m_pDict;
+};
+
+#define TEXTPOS_CAPTION 0
+#define TEXTPOS_ICON 1
+#define TEXTPOS_BELOW 2
+#define TEXTPOS_ABOVE 3
+#define TEXTPOS_RIGHT 4
+#define TEXTPOS_LEFT 5
+#define TEXTPOS_OVERLAID 6
+class CPDF_FormControl : public CFX_Object
+{
+public:
+
+ CPDF_FormField::Type GetType()
+ {
+ return m_pField->GetType();
+ }
+
+ CPDF_InterForm* GetInterForm() const
+ {
+ return m_pForm;
+ }
+
+ CPDF_FormField* GetField() const
+ {
+ return m_pField;
+ }
+
+ CPDF_Dictionary* GetWidget() const
+ {
+ return m_pWidgetDict;
+ }
+
+ CFX_FloatRect GetRect();
+
+ void DrawControl(CFX_RenderDevice* pDevice, CFX_AffineMatrix* pMatrix,
+ CPDF_Page* pPage, CPDF_Annot::AppearanceMode mode, const CPDF_RenderOptions* pOptions = NULL);
+
+
+
+ CFX_ByteString GetCheckedAPState();
+
+ CFX_WideString GetExportValue();
+
+ FX_BOOL IsChecked();
+
+ FX_BOOL IsDefaultChecked();
+
+
+
+
+ enum HighlightingMode {
+ None = 0,
+ Invert,
+ Outline,
+ Push,
+ Toggle
+ };
+
+ HighlightingMode GetHighlightingMode();
+
+
+
+
+ FX_BOOL HasMKEntry(CFX_ByteString csEntry);
+
+
+
+
+ int GetRotation();
+
+
+
+
+ inline FX_ARGB GetBorderColor(int& iColorType)
+ {
+ return GetColor(iColorType, "BC");
+ }
+
+ inline FX_FLOAT GetOriginalBorderColor(int index)
+ {
+ return GetOriginalColor(index, "BC");
+ }
+
+ inline void GetOriginalBorderColor(int& iColorType, FX_FLOAT fc[4])
+ {
+ GetOriginalColor(iColorType, fc, "BC");
+ }
+
+
+
+
+ inline FX_ARGB GetBackgroundColor(int& iColorType)
+ {
+ return GetColor(iColorType, "BG");
+ }
+
+ inline FX_FLOAT GetOriginalBackgroundColor(int index)
+ {
+ return GetOriginalColor(index, "BG");
+ }
+
+ inline void GetOriginalBackgroundColor(int& iColorType, FX_FLOAT fc[4])
+ {
+ GetOriginalColor(iColorType, fc, "BG");
+ }
+
+
+
+
+ inline CFX_WideString GetNormalCaption()
+ {
+ return GetCaption("CA");
+ }
+
+
+
+
+ inline CFX_WideString GetRolloverCaption()
+ {
+ return GetCaption("RC");
+ }
+
+
+
+
+ inline CFX_WideString GetDownCaption()
+ {
+ return GetCaption("AC");
+ }
+
+
+
+
+ inline CPDF_Stream* GetNormalIcon()
+ {
+ return GetIcon("I");
+ }
+
+
+
+
+ inline CPDF_Stream* GetRolloverIcon()
+ {
+ return GetIcon("RI");
+ }
+
+
+
+
+ inline CPDF_Stream* GetDownIcon()
+ {
+ return GetIcon("IX");
+ }
+
+
+
+
+ CPDF_IconFit GetIconFit();
+
+
+
+
+ int GetTextPosition();
+
+
+
+
+ CPDF_Action GetAction();
+
+
+
+
+ CPDF_AAction GetAdditionalAction();
+
+
+
+
+ CPDF_DefaultAppearance GetDefaultAppearance();
+
+ CPDF_Font* GetDefaultControlFont();
+
+
+
+
+ int GetControlAlignment();
+
+protected:
+
+ CPDF_FormControl(CPDF_FormField* pField, CPDF_Dictionary* pWidgetDict);
+
+ CFX_ByteString GetOnStateName();
+
+ void SetOnStateName(const CFX_ByteString& csOn);
+
+ void CheckControl(FX_BOOL bChecked);
+
+ FX_ARGB GetColor(int& iColorType, CFX_ByteString csEntry);
+
+ FX_FLOAT GetOriginalColor(int index, CFX_ByteString csEntry);
+
+ void GetOriginalColor(int& iColorType, FX_FLOAT fc[4], CFX_ByteString csEntry);
+
+ CFX_WideString GetCaption(CFX_ByteString csEntry);
+
+ CPDF_Stream* GetIcon(CFX_ByteString csEntry);
+
+ CPDF_ApSettings GetMK(FX_BOOL bCreate);
+
+ CPDF_InterForm* m_pForm;
+
+ CPDF_FormField* m_pField;
+
+ CPDF_Dictionary* m_pWidgetDict;
+ friend class CPDF_InterForm;
+ friend class CPDF_FormField;
+};
+class CPDF_FormNotify : public CFX_Object
+{
+public:
+
+ virtual ~CPDF_FormNotify() {}
+
+ virtual int BeforeValueChange(const CPDF_FormField* pField, CFX_WideString& csValue)
+ {
+ return 0;
+ }
+
+ virtual int AfterValueChange(const CPDF_FormField* pField)
+ {
+ return 0;
+ }
+
+ virtual int BeforeSelectionChange(const CPDF_FormField* pField, CFX_WideString& csValue)
+ {
+ return 0;
+ }
+
+ virtual int AfterSelectionChange(const CPDF_FormField* pField)
+ {
+ return 0;
+ }
+
+ virtual int AfterCheckedStatusChange(const CPDF_FormField* pField, const CFX_ByteArray& statusArray)
+ {
+ return 0;
+ }
+
+ virtual int BeforeFormReset(const CPDF_InterForm* pForm)
+ {
+ return 0;
+ }
+
+ virtual int AfterFormReset(const CPDF_InterForm* pForm)
+ {
+ return 0;
+ }
+
+ virtual int BeforeFormImportData(const CPDF_InterForm* pForm)
+ {
+ return 0;
+ }
+
+ virtual int AfterFormImportData(const CPDF_InterForm* pForm)
+ {
+ return 0;
+ }
+};
+FX_BOOL FPDF_GenerateAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict);
+class CPDF_PageLabel : public CFX_Object
+{
+public:
+
+ CPDF_PageLabel(CPDF_Document* pDocument)
+ {
+ m_pDocument = pDocument;
+ }
+
+
+ CFX_WideString GetLabel(int nPage) const;
+
+ FX_INT32 GetPageByLabel(FX_BSTR bsLabel) const;
+
+
+ FX_INT32 GetPageByLabel(FX_WSTR wsLabel) const;
+
+protected:
+ CPDF_Document* m_pDocument;
+};
+class CPDF_Metadata
+{
+public:
+
+ CPDF_Metadata();
+
+
+ ~CPDF_Metadata();
+
+ void LoadDoc(CPDF_Document *pDoc);
+
+
+ FX_INT32 GetString(FX_BSTR bsItem, CFX_WideString &wsStr);
+
+ CXML_Element* GetRoot() const;
+
+ CXML_Element* GetRDF() const;
+
+protected:
+ FX_LPVOID m_pData;
+};
+class CPDF_ViewerPreferences
+{
+public:
+
+ CPDF_ViewerPreferences(CPDF_Document *pDoc);
+
+
+ ~CPDF_ViewerPreferences();
+
+
+ FX_BOOL IsDirectionR2L() const;
+
+ FX_BOOL PrintScaling() const;
+
+
+protected:
+ CPDF_Document* m_pDoc;
+};
+class CPDF_ApSettings : public CFX_Object
+{
+public:
+
+ CPDF_ApSettings(CPDF_Dictionary* pDict = NULL)
+ {
+ m_pDict = pDict;
+ }
+
+ operator CPDF_Dictionary* () const
+ {
+ return m_pDict;
+ }
+
+ FX_BOOL HasMKEntry(FX_BSTR csEntry);
+
+
+
+ int GetRotation();
+
+
+
+
+ inline FX_ARGB GetBorderColor(int& iColorType)
+ {
+ return GetColor(iColorType, FX_BSTRC("BC"));
+ }
+
+ inline FX_FLOAT GetOriginalBorderColor(int index)
+ {
+ return GetOriginalColor(index, FX_BSTRC("BC"));
+ }
+
+ inline void GetOriginalBorderColor(int& iColorType, FX_FLOAT fc[4])
+ {
+ GetOriginalColor(iColorType, fc, FX_BSTRC("BC"));
+ }
+
+
+
+
+ inline FX_ARGB GetBackgroundColor(int& iColorType)
+ {
+ return GetColor(iColorType, FX_BSTRC("BG"));
+ }
+
+ inline FX_FLOAT GetOriginalBackgroundColor(int index)
+ {
+ return GetOriginalColor(index, FX_BSTRC("BG"));
+ }
+
+ inline void GetOriginalBackgroundColor(int& iColorType, FX_FLOAT fc[4])
+ {
+ GetOriginalColor(iColorType, fc, FX_BSTRC("BG"));
+ }
+
+
+
+
+ inline CFX_WideString GetNormalCaption()
+ {
+ return GetCaption(FX_BSTRC("CA"));
+ }
+
+
+
+
+ inline CFX_WideString GetRolloverCaption()
+ {
+ return GetCaption(FX_BSTRC("RC"));
+ }
+
+
+
+
+ inline CFX_WideString GetDownCaption()
+ {
+ return GetCaption(FX_BSTRC("AC"));
+ }
+
+
+
+
+ inline CPDF_Stream* GetNormalIcon()
+ {
+ return GetIcon(FX_BSTRC("I"));
+ }
+
+
+
+
+ inline CPDF_Stream* GetRolloverIcon()
+ {
+ return GetIcon(FX_BSTRC("RI"));
+ }
+
+
+
+
+ inline CPDF_Stream* GetDownIcon()
+ {
+ return GetIcon(FX_BSTRC("IX"));
+ }
+
+
+
+
+ CPDF_IconFit GetIconFit();
+
+
+
+
+ int GetTextPosition();
+
+ CPDF_Dictionary* m_pDict;
+protected:
+
+ FX_ARGB GetColor(int& iColorType, FX_BSTR csEntry);
+
+ FX_FLOAT GetOriginalColor(int index, FX_BSTR csEntry);
+
+ void GetOriginalColor(int& iColorType, FX_FLOAT fc[4], FX_BSTR csEntry);
+
+ CFX_WideString GetCaption(FX_BSTR csEntry);
+
+ CPDF_Stream* GetIcon(FX_BSTR csEntry);
+ friend class CPDF_FormControl;
+};
+#endif
diff --git a/core/include/fpdfdoc/fpdf_tagged.h b/core/include/fpdfdoc/fpdf_tagged.h
index a44c26311b..f3ab01ea28 100644
--- a/core/include/fpdfdoc/fpdf_tagged.h
+++ b/core/include/fpdfdoc/fpdf_tagged.h
@@ -1,99 +1,99 @@
-// 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 _FPDF_TAGGED_H_
-#define _FPDF_TAGGED_H_
-class CPDF_StructTree;
-class CPDF_StructElement;
-struct CPDF_StructKid;
-class CPDF_Document;
-class CPDF_Page;
-class IPDF_ReflowEngine;
-class IPDF_ReflowedPage;
-class CPDF_StructTree : public CFX_Object
-{
-public:
-
- static CPDF_StructTree* LoadDoc(const CPDF_Document* pDoc);
-
- static CPDF_StructTree* LoadPage(const CPDF_Document* pDoc, const CPDF_Dictionary* pPageDict);
-
- virtual ~CPDF_StructTree() {}
-
- virtual int CountTopElements() const = 0;
-
- virtual CPDF_StructElement* GetTopElement(int i) const = 0;
-};
-struct CPDF_StructKid {
- enum {
- Invalid,
- Element,
- PageContent,
- StreamContent,
- Object
- } m_Type;
-
- union {
- struct {
-
- CPDF_StructElement* m_pElement;
-
- CPDF_Dictionary* m_pDict;
- } m_Element;
- struct {
-
- FX_DWORD m_PageObjNum;
-
- FX_DWORD m_ContentId;
- } m_PageContent;
- struct {
-
- FX_DWORD m_PageObjNum;
-
- FX_DWORD m_ContentId;
-
- FX_DWORD m_RefObjNum;
- } m_StreamContent;
- struct {
-
- FX_DWORD m_PageObjNum;
-
- FX_DWORD m_RefObjNum;
- } m_Object;
- };
-};
-class CPDF_StructElement : public CFX_Object
-{
-public:
-
- virtual CPDF_StructTree* GetTree() const = 0;
-
- virtual const CFX_ByteString& GetType() const = 0;
-
- virtual CPDF_StructElement* GetParent() const = 0;
-
- virtual CPDF_Dictionary * GetDict() const = 0;
-
- virtual int CountKids() const = 0;
-
- virtual const CPDF_StructKid& GetKid(int index) const = 0;
-
- virtual CFX_PtrArray* GetObjectArray() = 0;
-
- virtual CPDF_Object* GetAttr(FX_BSTR owner, FX_BSTR name, FX_BOOL bInheritable = FALSE, FX_FLOAT fLevel = 0.0F) = 0;
-
-
-
- virtual CFX_ByteString GetName(FX_BSTR owner, FX_BSTR name, FX_BSTR default_value, FX_BOOL bInheritable = FALSE, int subindex = -1) = 0;
-
- virtual FX_ARGB GetColor(FX_BSTR owner, FX_BSTR name, FX_ARGB default_value, FX_BOOL bInheritable = FALSE, int subindex = -1) = 0;
-
- virtual FX_FLOAT GetNumber(FX_BSTR owner, FX_BSTR name, FX_FLOAT default_value, FX_BOOL bInheritable = FALSE, int subindex = -1) = 0;
-
- virtual int GetInteger(FX_BSTR owner, FX_BSTR name, int default_value, FX_BOOL bInheritable = FALSE, int subindex = -1) = 0;
-
-};
-#endif
+// 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 _FPDF_TAGGED_H_
+#define _FPDF_TAGGED_H_
+class CPDF_StructTree;
+class CPDF_StructElement;
+struct CPDF_StructKid;
+class CPDF_Document;
+class CPDF_Page;
+class IPDF_ReflowEngine;
+class IPDF_ReflowedPage;
+class CPDF_StructTree : public CFX_Object
+{
+public:
+
+ static CPDF_StructTree* LoadDoc(const CPDF_Document* pDoc);
+
+ static CPDF_StructTree* LoadPage(const CPDF_Document* pDoc, const CPDF_Dictionary* pPageDict);
+
+ virtual ~CPDF_StructTree() {}
+
+ virtual int CountTopElements() const = 0;
+
+ virtual CPDF_StructElement* GetTopElement(int i) const = 0;
+};
+struct CPDF_StructKid {
+ enum {
+ Invalid,
+ Element,
+ PageContent,
+ StreamContent,
+ Object
+ } m_Type;
+
+ union {
+ struct {
+
+ CPDF_StructElement* m_pElement;
+
+ CPDF_Dictionary* m_pDict;
+ } m_Element;
+ struct {
+
+ FX_DWORD m_PageObjNum;
+
+ FX_DWORD m_ContentId;
+ } m_PageContent;
+ struct {
+
+ FX_DWORD m_PageObjNum;
+
+ FX_DWORD m_ContentId;
+
+ FX_DWORD m_RefObjNum;
+ } m_StreamContent;
+ struct {
+
+ FX_DWORD m_PageObjNum;
+
+ FX_DWORD m_RefObjNum;
+ } m_Object;
+ };
+};
+class CPDF_StructElement : public CFX_Object
+{
+public:
+
+ virtual CPDF_StructTree* GetTree() const = 0;
+
+ virtual const CFX_ByteString& GetType() const = 0;
+
+ virtual CPDF_StructElement* GetParent() const = 0;
+
+ virtual CPDF_Dictionary * GetDict() const = 0;
+
+ virtual int CountKids() const = 0;
+
+ virtual const CPDF_StructKid& GetKid(int index) const = 0;
+
+ virtual CFX_PtrArray* GetObjectArray() = 0;
+
+ virtual CPDF_Object* GetAttr(FX_BSTR owner, FX_BSTR name, FX_BOOL bInheritable = FALSE, FX_FLOAT fLevel = 0.0F) = 0;
+
+
+
+ virtual CFX_ByteString GetName(FX_BSTR owner, FX_BSTR name, FX_BSTR default_value, FX_BOOL bInheritable = FALSE, int subindex = -1) = 0;
+
+ virtual FX_ARGB GetColor(FX_BSTR owner, FX_BSTR name, FX_ARGB default_value, FX_BOOL bInheritable = FALSE, int subindex = -1) = 0;
+
+ virtual FX_FLOAT GetNumber(FX_BSTR owner, FX_BSTR name, FX_FLOAT default_value, FX_BOOL bInheritable = FALSE, int subindex = -1) = 0;
+
+ virtual int GetInteger(FX_BSTR owner, FX_BSTR name, int default_value, FX_BOOL bInheritable = FALSE, int subindex = -1) = 0;
+
+};
+#endif
diff --git a/core/include/fpdfdoc/fpdf_vt.h b/core/include/fpdfdoc/fpdf_vt.h
index e2825c123d..41025cbe2e 100644
--- a/core/include/fpdfdoc/fpdf_vt.h
+++ b/core/include/fpdfdoc/fpdf_vt.h
@@ -1,444 +1,444 @@
-// 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 _FPDF_VT_H_
-#define _FPDF_VT_H_
-#include "../fxcrt/fx_basic.h"
-#include "../fpdfapi/fpdf_parser.h"
-struct CPVT_WordPlace;
-struct CPVT_WordRange;
-struct CPVT_Word;
-struct CPVT_Line;
-struct CPVT_Section;
-class IPDF_VariableText_Provider;
-class IPDF_VariableText_Iterator;
-class IPDF_VariableText;
-struct CPVT_WordPlace {
-
- CPVT_WordPlace() : nSecIndex(-1), nLineIndex(-1), nWordIndex(-1)
- {
- }
-
- CPVT_WordPlace(FX_INT32 nSecIndex, FX_INT32 nLineIndex, FX_INT32 nWordIndex)
- {
- this->nSecIndex = nSecIndex;
- this->nLineIndex = nLineIndex;
- this->nWordIndex = nWordIndex;
- }
-
- void Default()
- {
- nSecIndex = nLineIndex = nWordIndex = -1;
- }
-
- FX_BOOL operator == (const CPVT_WordPlace & wp) const
- {
- return wp.nSecIndex == this->nSecIndex && wp.nLineIndex == this->nLineIndex && wp.nWordIndex == this->nWordIndex;
- }
-
- FX_BOOL operator != (const CPVT_WordPlace & wp) const
- {
- return wp.nSecIndex != this->nSecIndex || wp.nLineIndex != this->nLineIndex || wp.nWordIndex != this->nWordIndex;
- }
-
- inline FX_INT32 WordCmp(const CPVT_WordPlace & wp) const
- {
- if (this->nSecIndex > wp.nSecIndex) {
- return 1;
- }
- if (this->nSecIndex < wp.nSecIndex) {
- return -1;
- }
- if (this->nLineIndex > wp.nLineIndex) {
- return 1;
- }
- if (this->nLineIndex < wp.nLineIndex) {
- return -1;
- }
- if (this->nWordIndex > wp.nWordIndex) {
- return 1;
- }
- if (this->nWordIndex < wp.nWordIndex) {
- return -1;
- }
- return 0;
- }
-
- inline FX_INT32 LineCmp(const CPVT_WordPlace & wp) const
- {
- if (this->nSecIndex > wp.nSecIndex) {
- return 1;
- }
- if (this->nSecIndex < wp.nSecIndex) {
- return -1;
- }
- if (this->nLineIndex > wp.nLineIndex) {
- return 1;
- }
- if (this->nLineIndex < wp.nLineIndex) {
- return -1;
- }
- return 0;
- }
-
- inline FX_INT32 SecCmp(const CPVT_WordPlace & wp) const
- {
- if (this->nSecIndex > wp.nSecIndex) {
- return 1;
- }
- if (this->nSecIndex < wp.nSecIndex) {
- return -1;
- }
- return 0;
- }
-
- FX_INT32 nSecIndex;
-
- FX_INT32 nLineIndex;
-
- FX_INT32 nWordIndex;
-};
-struct CPVT_WordRange {
-
- CPVT_WordRange()
- {
- }
-
- CPVT_WordRange(const CPVT_WordPlace & begin, const CPVT_WordPlace & end)
- {
- Set(begin, end);
- }
-
- void Default()
- {
- BeginPos.Default();
- EndPos.Default();
- }
-
- void Set(const CPVT_WordPlace & begin, const CPVT_WordPlace & end)
- {
- this->BeginPos = begin;
- this->EndPos = end;
- SwapWordPlace();
- }
-
- void SetBeginPos(const CPVT_WordPlace & begin)
- {
- this->BeginPos = begin;
- SwapWordPlace();
- }
-
- void SetEndPos(const CPVT_WordPlace & end)
- {
- this->EndPos = end;
- SwapWordPlace();
- }
-
- FX_BOOL IsExist() const
- {
- return this->BeginPos != this->EndPos;
- }
-
- FX_BOOL operator != (const CPVT_WordRange & wr) const
- {
- return wr.BeginPos != this->BeginPos || wr.EndPos != this->EndPos;
- }
-
- void SwapWordPlace()
- {
- if (BeginPos.WordCmp(EndPos) > 0) {
- CPVT_WordPlace place = EndPos;
- EndPos = BeginPos;
- BeginPos = place;
- }
- }
-
- CPVT_WordPlace BeginPos;
-
- CPVT_WordPlace EndPos;
-};
-struct CPVT_SecProps : public CFX_Object {
-
- CPVT_SecProps() : fLineLeading(0.0f), fLineIndent(0.0f), nAlignment(0)
- {
- }
-
- CPVT_SecProps(FX_FLOAT lineLeading, FX_FLOAT lineIndent, FX_INT32 alignment) :
- fLineLeading(lineLeading), fLineIndent(lineIndent), nAlignment(alignment)
- {
- }
-
- CPVT_SecProps(const CPVT_SecProps & other) :
- fLineLeading(other.fLineLeading), fLineIndent(other.fLineIndent), nAlignment(other.nAlignment)
- {
- }
-
- FX_FLOAT fLineLeading;
-
- FX_FLOAT fLineIndent;
-
- FX_INT32 nAlignment;
-};
-struct CPVT_WordProps : public CFX_Object {
-
- CPVT_WordProps() : nFontIndex(-1), fFontSize(0.0f), dwWordColor(0), nScriptType(0), nWordStyle(0),
- fCharSpace(0.0f), nHorzScale(0)
- {
- }
-
- CPVT_WordProps(FX_INT32 fontIndex, FX_FLOAT fontSize, FX_COLORREF wordColor = 0, FX_INT32 scriptType = 0, FX_INT32 wordStyle = 0,
- FX_FLOAT charSpace = 0, FX_INT32 horzScale = 100) :
- nFontIndex(fontIndex), fFontSize(fontSize), dwWordColor(wordColor), nScriptType(scriptType),
- nWordStyle(wordStyle), fCharSpace(charSpace), nHorzScale(horzScale)
- {
- }
-
- CPVT_WordProps(const CPVT_WordProps & other) :
- nFontIndex(other.nFontIndex), fFontSize(other.fFontSize), dwWordColor(other.dwWordColor),
- nScriptType(other.nScriptType), nWordStyle(other.nWordStyle), fCharSpace(other.fCharSpace),
- nHorzScale(other.nHorzScale)
- {
- }
-
- FX_INT32 nFontIndex;
-
- FX_FLOAT fFontSize;
-
- FX_COLORREF dwWordColor;
-
- FX_INT32 nScriptType;
-
- FX_INT32 nWordStyle;
-
- FX_FLOAT fCharSpace;
-
- FX_INT32 nHorzScale;
-};
-struct CPVT_Word {
-
- CPVT_Word() : Word(0), nCharset(0), ptWord(0, 0), fAscent(0.0f), fDescent(0.0f), fWidth(0.0f),
- fFontSize(0), WordProps()
- {
- }
-
- FX_WORD Word;
-
- FX_INT32 nCharset;
-
- CPVT_WordPlace WordPlace;
-
- CPDF_Point ptWord;
-
- FX_FLOAT fAscent;
-
- FX_FLOAT fDescent;
-
- FX_FLOAT fWidth;
-
- FX_INT32 nFontIndex;
-
- FX_FLOAT fFontSize;
-
- CPVT_WordProps WordProps;
-};
-struct CPVT_Line {
-
- CPVT_Line() : ptLine(0, 0), fLineWidth(0.0f), fLineAscent(0.0f), fLineDescent(0.0f)
- {
- }
-
- CPVT_WordPlace lineplace;
-
- CPVT_WordPlace lineEnd;
-
- CPDF_Point ptLine;
-
- FX_FLOAT fLineWidth;
-
- FX_FLOAT fLineAscent;
-
- FX_FLOAT fLineDescent;
-};
-struct CPVT_Section {
-
- CPVT_WordPlace secplace;
-
- CPDF_Rect rcSection;
-
- CPVT_SecProps SecProps;
-
- CPVT_WordProps WordProps;
-};
-class IPDF_VariableText_Provider
-{
-public:
-
- virtual FX_INT32 GetCharWidth(FX_INT32 nFontIndex, FX_WORD word, FX_INT32 nWordStyle) = 0;
-
- virtual FX_INT32 GetTypeAscent(FX_INT32 nFontIndex) = 0;
-
- virtual FX_INT32 GetTypeDescent(FX_INT32 nFontIndex) = 0;
-
- virtual FX_INT32 GetWordFontIndex(FX_WORD word, FX_INT32 charset, FX_INT32 nFontIndex) = 0;
-
- virtual FX_BOOL IsLatinWord(FX_WORD word) = 0;
-
- virtual FX_INT32 GetDefaultFontIndex() = 0;
-};
-class IPDF_VariableText_Iterator
-{
-public:
-
- virtual FX_BOOL NextWord() = 0;
-
- virtual FX_BOOL PrevWord() = 0;
-
- virtual FX_BOOL NextLine() = 0;
-
- virtual FX_BOOL PrevLine() = 0;
-
- virtual FX_BOOL NextSection() = 0;
-
- virtual FX_BOOL PrevSection() = 0;
-
- virtual FX_BOOL GetWord(CPVT_Word & word) const = 0;
-
- virtual FX_BOOL SetWord(const CPVT_Word & word) = 0;
-
- virtual FX_BOOL GetLine(CPVT_Line & line) const = 0;
-
- virtual FX_BOOL GetSection(CPVT_Section & section) const = 0;
-
- virtual FX_BOOL SetSection(const CPVT_Section & section) = 0;
-
- virtual void SetAt(FX_INT32 nWordIndex) = 0;
-
- virtual void SetAt(const CPVT_WordPlace & place) = 0;
-
- virtual const CPVT_WordPlace & GetAt() const = 0;
-};
-class IPDF_VariableText
-{
-public:
-
- static IPDF_VariableText* NewVariableText();
-
- static void DelVariableText(IPDF_VariableText* pVT);
-public:
-
- virtual IPDF_VariableText_Provider* SetProvider(IPDF_VariableText_Provider * pProvider) = 0;
-
- virtual IPDF_VariableText_Iterator* GetIterator() = 0;
-
- virtual void SetPlateRect(const CPDF_Rect & rect) = 0;
-
- virtual void SetAlignment(FX_INT32 nFormat = 0) = 0;
-
- virtual void SetPasswordChar(FX_WORD wSubWord = '*') = 0;
-
- virtual void SetLimitChar(FX_INT32 nLimitChar = 0) = 0;
-
- virtual void SetCharArray(FX_INT32 nCharArray = 0) = 0;
-
- virtual void SetCharSpace(FX_FLOAT fCharSpace = 0.0f) = 0;
-
- virtual void SetHorzScale(FX_INT32 nHorzScale = 100) = 0;
-
- virtual void SetMultiLine(FX_BOOL bMultiLine = TRUE) = 0;
-
- virtual void SetAutoReturn(FX_BOOL bAuto = TRUE) = 0;
-
- virtual void SetAutoFontSize(FX_BOOL bAuto = TRUE) = 0;
-
- virtual void SetFontSize(FX_FLOAT fFontSize) = 0;
-
- virtual void SetLineLeading(FX_FLOAT fLineLeading) = 0;
-
- virtual void SetRichText(FX_BOOL bRichText) = 0;
-
- virtual void Initialize() = 0;
-
- virtual FX_BOOL IsValid() const = 0;
-
- virtual FX_BOOL IsRichText() const = 0;
-
- virtual void RearrangeAll() = 0;
-
- virtual void RearrangePart(const CPVT_WordRange & PlaceRange) = 0;
-
- virtual void ResetAll() = 0;
-
- virtual void SetText(FX_LPCWSTR text, FX_INT32 charset = 1, const CPVT_SecProps * pSecProps = NULL,
- const CPVT_WordProps * pWordProps = NULL) = 0;
-
- virtual CPVT_WordPlace InsertWord(const CPVT_WordPlace & place, FX_WORD word, FX_INT32 charset = 1,
- const CPVT_WordProps * pWordProps = NULL) = 0;
-
- virtual CPVT_WordPlace InsertSection(const CPVT_WordPlace & place, const CPVT_SecProps * pSecProps = NULL,
- const CPVT_WordProps * pWordProps = NULL) = 0;
-
- virtual CPVT_WordPlace InsertText(const CPVT_WordPlace & place, FX_LPCWSTR text, FX_INT32 charset = 1,
- const CPVT_SecProps * pSecProps = NULL, const CPVT_WordProps * pWordProps = NULL) = 0;
-
- virtual CPVT_WordPlace DeleteWords(const CPVT_WordRange & PlaceRange) = 0;
-
- virtual CPVT_WordPlace DeleteWord(const CPVT_WordPlace & place) = 0;
-
- virtual CPVT_WordPlace BackSpaceWord(const CPVT_WordPlace & place) = 0;
-
- virtual const CPDF_Rect & GetPlateRect() const = 0;
-
- virtual CPDF_Rect GetContentRect() const = 0;
-
- virtual FX_INT32 GetTotalWords() const = 0;
-
- virtual FX_FLOAT GetFontSize() const = 0;
-
- virtual FX_INT32 GetAlignment() const = 0;
-
- virtual FX_WORD GetPasswordChar() const = 0;
-
- virtual FX_INT32 GetCharArray() const = 0;
-
- virtual FX_INT32 GetLimitChar() const = 0;
-
- virtual FX_BOOL IsMultiLine() const = 0;
-
- virtual FX_INT32 GetHorzScale() const = 0;
-
- virtual FX_FLOAT GetCharSpace() const = 0;
-
- virtual CPVT_WordPlace GetBeginWordPlace() const = 0;
-
- virtual CPVT_WordPlace GetEndWordPlace() const = 0;
-
- virtual CPVT_WordPlace GetPrevWordPlace(const CPVT_WordPlace & place) const = 0;
-
- virtual CPVT_WordPlace GetNextWordPlace(const CPVT_WordPlace & place) const = 0;
-
- virtual CPVT_WordPlace SearchWordPlace(const CPDF_Point & point) const = 0;
-
- virtual CPVT_WordPlace GetUpWordPlace(const CPVT_WordPlace & place, const CPDF_Point & point) const = 0;
-
- virtual CPVT_WordPlace GetDownWordPlace(const CPVT_WordPlace & place, const CPDF_Point & point) const = 0;
-
- virtual CPVT_WordPlace GetLineBeginPlace(const CPVT_WordPlace & place) const = 0;
-
- virtual CPVT_WordPlace GetLineEndPlace(const CPVT_WordPlace & place) const = 0;
-
- virtual CPVT_WordPlace GetSectionBeginPlace(const CPVT_WordPlace & place) const = 0;
-
- virtual CPVT_WordPlace GetSectionEndPlace(const CPVT_WordPlace & place) const = 0;
-
- virtual void UpdateWordPlace(CPVT_WordPlace & place) const = 0;
-
- virtual CPVT_WordPlace AjustLineHeader(const CPVT_WordPlace & place, FX_BOOL bPrevOrNext) const = 0;
-
- virtual FX_INT32 WordPlaceToWordIndex(const CPVT_WordPlace & place) const = 0;
-
- virtual CPVT_WordPlace WordIndexToWordPlace(FX_INT32 index) const = 0;
-};
-#endif
+// 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 _FPDF_VT_H_
+#define _FPDF_VT_H_
+#include "../fxcrt/fx_basic.h"
+#include "../fpdfapi/fpdf_parser.h"
+struct CPVT_WordPlace;
+struct CPVT_WordRange;
+struct CPVT_Word;
+struct CPVT_Line;
+struct CPVT_Section;
+class IPDF_VariableText_Provider;
+class IPDF_VariableText_Iterator;
+class IPDF_VariableText;
+struct CPVT_WordPlace {
+
+ CPVT_WordPlace() : nSecIndex(-1), nLineIndex(-1), nWordIndex(-1)
+ {
+ }
+
+ CPVT_WordPlace(FX_INT32 nSecIndex, FX_INT32 nLineIndex, FX_INT32 nWordIndex)
+ {
+ this->nSecIndex = nSecIndex;
+ this->nLineIndex = nLineIndex;
+ this->nWordIndex = nWordIndex;
+ }
+
+ void Default()
+ {
+ nSecIndex = nLineIndex = nWordIndex = -1;
+ }
+
+ FX_BOOL operator == (const CPVT_WordPlace & wp) const
+ {
+ return wp.nSecIndex == this->nSecIndex && wp.nLineIndex == this->nLineIndex && wp.nWordIndex == this->nWordIndex;
+ }
+
+ FX_BOOL operator != (const CPVT_WordPlace & wp) const
+ {
+ return wp.nSecIndex != this->nSecIndex || wp.nLineIndex != this->nLineIndex || wp.nWordIndex != this->nWordIndex;
+ }
+
+ inline FX_INT32 WordCmp(const CPVT_WordPlace & wp) const
+ {
+ if (this->nSecIndex > wp.nSecIndex) {
+ return 1;
+ }
+ if (this->nSecIndex < wp.nSecIndex) {
+ return -1;
+ }
+ if (this->nLineIndex > wp.nLineIndex) {
+ return 1;
+ }
+ if (this->nLineIndex < wp.nLineIndex) {
+ return -1;
+ }
+ if (this->nWordIndex > wp.nWordIndex) {
+ return 1;
+ }
+ if (this->nWordIndex < wp.nWordIndex) {
+ return -1;
+ }
+ return 0;
+ }
+
+ inline FX_INT32 LineCmp(const CPVT_WordPlace & wp) const
+ {
+ if (this->nSecIndex > wp.nSecIndex) {
+ return 1;
+ }
+ if (this->nSecIndex < wp.nSecIndex) {
+ return -1;
+ }
+ if (this->nLineIndex > wp.nLineIndex) {
+ return 1;
+ }
+ if (this->nLineIndex < wp.nLineIndex) {
+ return -1;
+ }
+ return 0;
+ }
+
+ inline FX_INT32 SecCmp(const CPVT_WordPlace & wp) const
+ {
+ if (this->nSecIndex > wp.nSecIndex) {
+ return 1;
+ }
+ if (this->nSecIndex < wp.nSecIndex) {
+ return -1;
+ }
+ return 0;
+ }
+
+ FX_INT32 nSecIndex;
+
+ FX_INT32 nLineIndex;
+
+ FX_INT32 nWordIndex;
+};
+struct CPVT_WordRange {
+
+ CPVT_WordRange()
+ {
+ }
+
+ CPVT_WordRange(const CPVT_WordPlace & begin, const CPVT_WordPlace & end)
+ {
+ Set(begin, end);
+ }
+
+ void Default()
+ {
+ BeginPos.Default();
+ EndPos.Default();
+ }
+
+ void Set(const CPVT_WordPlace & begin, const CPVT_WordPlace & end)
+ {
+ this->BeginPos = begin;
+ this->EndPos = end;
+ SwapWordPlace();
+ }
+
+ void SetBeginPos(const CPVT_WordPlace & begin)
+ {
+ this->BeginPos = begin;
+ SwapWordPlace();
+ }
+
+ void SetEndPos(const CPVT_WordPlace & end)
+ {
+ this->EndPos = end;
+ SwapWordPlace();
+ }
+
+ FX_BOOL IsExist() const
+ {
+ return this->BeginPos != this->EndPos;
+ }
+
+ FX_BOOL operator != (const CPVT_WordRange & wr) const
+ {
+ return wr.BeginPos != this->BeginPos || wr.EndPos != this->EndPos;
+ }
+
+ void SwapWordPlace()
+ {
+ if (BeginPos.WordCmp(EndPos) > 0) {
+ CPVT_WordPlace place = EndPos;
+ EndPos = BeginPos;
+ BeginPos = place;
+ }
+ }
+
+ CPVT_WordPlace BeginPos;
+
+ CPVT_WordPlace EndPos;
+};
+struct CPVT_SecProps : public CFX_Object {
+
+ CPVT_SecProps() : fLineLeading(0.0f), fLineIndent(0.0f), nAlignment(0)
+ {
+ }
+
+ CPVT_SecProps(FX_FLOAT lineLeading, FX_FLOAT lineIndent, FX_INT32 alignment) :
+ fLineLeading(lineLeading), fLineIndent(lineIndent), nAlignment(alignment)
+ {
+ }
+
+ CPVT_SecProps(const CPVT_SecProps & other) :
+ fLineLeading(other.fLineLeading), fLineIndent(other.fLineIndent), nAlignment(other.nAlignment)
+ {
+ }
+
+ FX_FLOAT fLineLeading;
+
+ FX_FLOAT fLineIndent;
+
+ FX_INT32 nAlignment;
+};
+struct CPVT_WordProps : public CFX_Object {
+
+ CPVT_WordProps() : nFontIndex(-1), fFontSize(0.0f), dwWordColor(0), nScriptType(0), nWordStyle(0),
+ fCharSpace(0.0f), nHorzScale(0)
+ {
+ }
+
+ CPVT_WordProps(FX_INT32 fontIndex, FX_FLOAT fontSize, FX_COLORREF wordColor = 0, FX_INT32 scriptType = 0, FX_INT32 wordStyle = 0,
+ FX_FLOAT charSpace = 0, FX_INT32 horzScale = 100) :
+ nFontIndex(fontIndex), fFontSize(fontSize), dwWordColor(wordColor), nScriptType(scriptType),
+ nWordStyle(wordStyle), fCharSpace(charSpace), nHorzScale(horzScale)
+ {
+ }
+
+ CPVT_WordProps(const CPVT_WordProps & other) :
+ nFontIndex(other.nFontIndex), fFontSize(other.fFontSize), dwWordColor(other.dwWordColor),
+ nScriptType(other.nScriptType), nWordStyle(other.nWordStyle), fCharSpace(other.fCharSpace),
+ nHorzScale(other.nHorzScale)
+ {
+ }
+
+ FX_INT32 nFontIndex;
+
+ FX_FLOAT fFontSize;
+
+ FX_COLORREF dwWordColor;
+
+ FX_INT32 nScriptType;
+
+ FX_INT32 nWordStyle;
+
+ FX_FLOAT fCharSpace;
+
+ FX_INT32 nHorzScale;
+};
+struct CPVT_Word {
+
+ CPVT_Word() : Word(0), nCharset(0), ptWord(0, 0), fAscent(0.0f), fDescent(0.0f), fWidth(0.0f),
+ fFontSize(0), WordProps()
+ {
+ }
+
+ FX_WORD Word;
+
+ FX_INT32 nCharset;
+
+ CPVT_WordPlace WordPlace;
+
+ CPDF_Point ptWord;
+
+ FX_FLOAT fAscent;
+
+ FX_FLOAT fDescent;
+
+ FX_FLOAT fWidth;
+
+ FX_INT32 nFontIndex;
+
+ FX_FLOAT fFontSize;
+
+ CPVT_WordProps WordProps;
+};
+struct CPVT_Line {
+
+ CPVT_Line() : ptLine(0, 0), fLineWidth(0.0f), fLineAscent(0.0f), fLineDescent(0.0f)
+ {
+ }
+
+ CPVT_WordPlace lineplace;
+
+ CPVT_WordPlace lineEnd;
+
+ CPDF_Point ptLine;
+
+ FX_FLOAT fLineWidth;
+
+ FX_FLOAT fLineAscent;
+
+ FX_FLOAT fLineDescent;
+};
+struct CPVT_Section {
+
+ CPVT_WordPlace secplace;
+
+ CPDF_Rect rcSection;
+
+ CPVT_SecProps SecProps;
+
+ CPVT_WordProps WordProps;
+};
+class IPDF_VariableText_Provider
+{
+public:
+
+ virtual FX_INT32 GetCharWidth(FX_INT32 nFontIndex, FX_WORD word, FX_INT32 nWordStyle) = 0;
+
+ virtual FX_INT32 GetTypeAscent(FX_INT32 nFontIndex) = 0;
+
+ virtual FX_INT32 GetTypeDescent(FX_INT32 nFontIndex) = 0;
+
+ virtual FX_INT32 GetWordFontIndex(FX_WORD word, FX_INT32 charset, FX_INT32 nFontIndex) = 0;
+
+ virtual FX_BOOL IsLatinWord(FX_WORD word) = 0;
+
+ virtual FX_INT32 GetDefaultFontIndex() = 0;
+};
+class IPDF_VariableText_Iterator
+{
+public:
+
+ virtual FX_BOOL NextWord() = 0;
+
+ virtual FX_BOOL PrevWord() = 0;
+
+ virtual FX_BOOL NextLine() = 0;
+
+ virtual FX_BOOL PrevLine() = 0;
+
+ virtual FX_BOOL NextSection() = 0;
+
+ virtual FX_BOOL PrevSection() = 0;
+
+ virtual FX_BOOL GetWord(CPVT_Word & word) const = 0;
+
+ virtual FX_BOOL SetWord(const CPVT_Word & word) = 0;
+
+ virtual FX_BOOL GetLine(CPVT_Line & line) const = 0;
+
+ virtual FX_BOOL GetSection(CPVT_Section & section) const = 0;
+
+ virtual FX_BOOL SetSection(const CPVT_Section & section) = 0;
+
+ virtual void SetAt(FX_INT32 nWordIndex) = 0;
+
+ virtual void SetAt(const CPVT_WordPlace & place) = 0;
+
+ virtual const CPVT_WordPlace & GetAt() const = 0;
+};
+class IPDF_VariableText
+{
+public:
+
+ static IPDF_VariableText* NewVariableText();
+
+ static void DelVariableText(IPDF_VariableText* pVT);
+public:
+
+ virtual IPDF_VariableText_Provider* SetProvider(IPDF_VariableText_Provider * pProvider) = 0;
+
+ virtual IPDF_VariableText_Iterator* GetIterator() = 0;
+
+ virtual void SetPlateRect(const CPDF_Rect & rect) = 0;
+
+ virtual void SetAlignment(FX_INT32 nFormat = 0) = 0;
+
+ virtual void SetPasswordChar(FX_WORD wSubWord = '*') = 0;
+
+ virtual void SetLimitChar(FX_INT32 nLimitChar = 0) = 0;
+
+ virtual void SetCharArray(FX_INT32 nCharArray = 0) = 0;
+
+ virtual void SetCharSpace(FX_FLOAT fCharSpace = 0.0f) = 0;
+
+ virtual void SetHorzScale(FX_INT32 nHorzScale = 100) = 0;
+
+ virtual void SetMultiLine(FX_BOOL bMultiLine = TRUE) = 0;
+
+ virtual void SetAutoReturn(FX_BOOL bAuto = TRUE) = 0;
+
+ virtual void SetAutoFontSize(FX_BOOL bAuto = TRUE) = 0;
+
+ virtual void SetFontSize(FX_FLOAT fFontSize) = 0;
+
+ virtual void SetLineLeading(FX_FLOAT fLineLeading) = 0;
+
+ virtual void SetRichText(FX_BOOL bRichText) = 0;
+
+ virtual void Initialize() = 0;
+
+ virtual FX_BOOL IsValid() const = 0;
+
+ virtual FX_BOOL IsRichText() const = 0;
+
+ virtual void RearrangeAll() = 0;
+
+ virtual void RearrangePart(const CPVT_WordRange & PlaceRange) = 0;
+
+ virtual void ResetAll() = 0;
+
+ virtual void SetText(FX_LPCWSTR text, FX_INT32 charset = 1, const CPVT_SecProps * pSecProps = NULL,
+ const CPVT_WordProps * pWordProps = NULL) = 0;
+
+ virtual CPVT_WordPlace InsertWord(const CPVT_WordPlace & place, FX_WORD word, FX_INT32 charset = 1,
+ const CPVT_WordProps * pWordProps = NULL) = 0;
+
+ virtual CPVT_WordPlace InsertSection(const CPVT_WordPlace & place, const CPVT_SecProps * pSecProps = NULL,
+ const CPVT_WordProps * pWordProps = NULL) = 0;
+
+ virtual CPVT_WordPlace InsertText(const CPVT_WordPlace & place, FX_LPCWSTR text, FX_INT32 charset = 1,
+ const CPVT_SecProps * pSecProps = NULL, const CPVT_WordProps * pWordProps = NULL) = 0;
+
+ virtual CPVT_WordPlace DeleteWords(const CPVT_WordRange & PlaceRange) = 0;
+
+ virtual CPVT_WordPlace DeleteWord(const CPVT_WordPlace & place) = 0;
+
+ virtual CPVT_WordPlace BackSpaceWord(const CPVT_WordPlace & place) = 0;
+
+ virtual const CPDF_Rect & GetPlateRect() const = 0;
+
+ virtual CPDF_Rect GetContentRect() const = 0;
+
+ virtual FX_INT32 GetTotalWords() const = 0;
+
+ virtual FX_FLOAT GetFontSize() const = 0;
+
+ virtual FX_INT32 GetAlignment() const = 0;
+
+ virtual FX_WORD GetPasswordChar() const = 0;
+
+ virtual FX_INT32 GetCharArray() const = 0;
+
+ virtual FX_INT32 GetLimitChar() const = 0;
+
+ virtual FX_BOOL IsMultiLine() const = 0;
+
+ virtual FX_INT32 GetHorzScale() const = 0;
+
+ virtual FX_FLOAT GetCharSpace() const = 0;
+
+ virtual CPVT_WordPlace GetBeginWordPlace() const = 0;
+
+ virtual CPVT_WordPlace GetEndWordPlace() const = 0;
+
+ virtual CPVT_WordPlace GetPrevWordPlace(const CPVT_WordPlace & place) const = 0;
+
+ virtual CPVT_WordPlace GetNextWordPlace(const CPVT_WordPlace & place) const = 0;
+
+ virtual CPVT_WordPlace SearchWordPlace(const CPDF_Point & point) const = 0;
+
+ virtual CPVT_WordPlace GetUpWordPlace(const CPVT_WordPlace & place, const CPDF_Point & point) const = 0;
+
+ virtual CPVT_WordPlace GetDownWordPlace(const CPVT_WordPlace & place, const CPDF_Point & point) const = 0;
+
+ virtual CPVT_WordPlace GetLineBeginPlace(const CPVT_WordPlace & place) const = 0;
+
+ virtual CPVT_WordPlace GetLineEndPlace(const CPVT_WordPlace & place) const = 0;
+
+ virtual CPVT_WordPlace GetSectionBeginPlace(const CPVT_WordPlace & place) const = 0;
+
+ virtual CPVT_WordPlace GetSectionEndPlace(const CPVT_WordPlace & place) const = 0;
+
+ virtual void UpdateWordPlace(CPVT_WordPlace & place) const = 0;
+
+ virtual CPVT_WordPlace AjustLineHeader(const CPVT_WordPlace & place, FX_BOOL bPrevOrNext) const = 0;
+
+ virtual FX_INT32 WordPlaceToWordIndex(const CPVT_WordPlace & place) const = 0;
+
+ virtual CPVT_WordPlace WordIndexToWordPlace(FX_INT32 index) const = 0;
+};
+#endif
diff --git a/core/include/fpdftext/fpdf_text.h b/core/include/fpdftext/fpdf_text.h
index 8b5edc348f..2a5e4ac4bd 100644
--- a/core/include/fpdftext/fpdf_text.h
+++ b/core/include/fpdftext/fpdf_text.h
@@ -1,173 +1,173 @@
-// 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 _FPDF_TEXT_H_
-#define _FPDF_TEXT_H_
-#ifndef _FPDF_PARSER_
-#include "../fpdfapi/fpdf_parser.h"
-#endif
-#ifndef _FPDF_PAGEOBJ_H_
-#include "../fpdfapi/fpdf_pageobj.h"
-#endif
-#ifndef _FPDF_PAGE_
-#include "../fpdfapi/fpdf_page.h"
-#endif
-class CPDF_PageObjects;
-#define PDF2TXT_AUTO_ROTATE 1
-#define PDF2TXT_AUTO_WIDTH 2
-#define PDF2TXT_KEEP_COLUMN 4
-#define PDF2TXT_USE_OCR 8
-#define PDF2TXT_INCLUDE_INVISIBLE 16
-void PDF_GetPageText(CFX_ByteStringArray& lines, CPDF_Document* pDoc, CPDF_Dictionary* pPage,
- int iMinWidth, FX_DWORD flags);
-void PDF_GetPageText_Unicode(CFX_WideStringArray& lines, CPDF_Document* pDoc, CPDF_Dictionary* pPage,
- int iMinWidth, FX_DWORD flags);
-void PDF_GetTextStream_Unicode(CFX_WideTextBuf& buffer, CPDF_Document* pDoc, CPDF_Dictionary* pPage,
- FX_DWORD flags);
-CFX_WideString PDF_GetFirstTextLine_Unicode(CPDF_Document* pDoc, CPDF_Dictionary* pPage);
-class IPDF_TextPage;
-class IPDF_LinkExtract;
-class IPDF_TextPageFind;
-#define CHAR_ERROR -1
-#define CHAR_NORMAL 0
-#define CHAR_GENERATED 1
-#define CHAR_UNUNICODE 2
-typedef struct {
- FX_WCHAR m_Unicode;
- FX_WCHAR m_Charcode;
- FX_INT32 m_Flag;
- FX_FLOAT m_FontSize;
- FX_FLOAT m_OriginX;
- FX_FLOAT m_OriginY;
- CFX_FloatRect m_CharBox;
- CPDF_TextObject* m_pTextObj;
- CFX_AffineMatrix m_Matrix;
-} FPDF_CHAR_INFO;
-typedef CFX_ArrayTemplate<CFX_FloatRect> CFX_RectArray;
-#define FPDFTEXT_LRTB 0
-#define FPDFTEXT_RLTB 1
-#define FPDFTEXT_TBRL 2
-#define FPDFTEXT_LEFT -1
-#define FPDFTEXT_RIGHT 1
-#define FPDFTEXT_UP -2
-#define FPDFTEXT_DOWN 2
-class IPDF_ReflowedPage;
-#define FPDFTEXT_WRITINGMODE_UNKNOW 0
-#define FPDFTEXT_WRITINGMODE_LRTB 1
-#define FPDFTEXT_WRITINGMODE_RLTB 2
-#define FPDFTEXT_WRITINGMODE_TBRL 3
-class CPDFText_ParseOptions : public CFX_Object
-{
-public:
-
- CPDFText_ParseOptions();
- FX_BOOL m_bGetCharCodeOnly;
- FX_BOOL m_bNormalizeObjs;
- FX_BOOL m_bOutputHyphen;
-};
-class IPDF_TextPage : public CFX_Object
-{
-public:
-
- virtual ~IPDF_TextPage() {}
- static IPDF_TextPage* CreateTextPage(const CPDF_Page* pPage, CPDFText_ParseOptions ParserOptions);
- static IPDF_TextPage* CreateTextPage(const CPDF_Page* pPage, int flags = 0);
- static IPDF_TextPage* CreateTextPage(const CPDF_PageObjects* pObjs, int flags = 0);
- static IPDF_TextPage* CreateReflowTextPage(IPDF_ReflowedPage* pRefPage);
-
- virtual void NormalizeObjects(FX_BOOL bNormalize) = 0;
-
- virtual FX_BOOL ParseTextPage() = 0;
-
-
- virtual FX_BOOL IsParsered() const = 0;
-public:
-
- virtual int CharIndexFromTextIndex(int TextIndex) const = 0;
-
- virtual int TextIndexFromCharIndex(int CharIndex) const = 0;
-
-
- virtual int CountChars() const = 0;
-
- virtual void GetCharInfo(int index, FPDF_CHAR_INFO & info) const = 0;
-
- virtual void GetRectArray(int start, int nCount, CFX_RectArray& rectArray) const = 0;
-
-
-
- virtual int GetIndexAtPos(CPDF_Point point, FX_FLOAT xTorelance, FX_FLOAT yTorelance) const = 0;
-
- virtual int GetIndexAtPos(FX_FLOAT x, FX_FLOAT y, FX_FLOAT xTorelance, FX_FLOAT yTorelance) const = 0;
-
- virtual int GetOrderByDirection(int index, int direction) const = 0;
-
- virtual CFX_WideString GetTextByRect(CFX_FloatRect rect) const = 0;
-
- virtual void GetRectsArrayByRect(CFX_FloatRect rect, CFX_RectArray& resRectArray) const = 0;
-
-
- virtual int CountRects(int start, int nCount) = 0;
-
- virtual void GetRect(int rectIndex, FX_FLOAT& left, FX_FLOAT& top, FX_FLOAT& right, FX_FLOAT &bottom) const = 0;
-
- virtual FX_BOOL GetBaselineRotate(int rectIndex, int& Rotate) = 0;
-
- virtual FX_BOOL GetBaselineRotate(CFX_FloatRect rect, int& Rotate) = 0;
-
- virtual int CountBoundedSegments(FX_FLOAT left, FX_FLOAT top, FX_FLOAT right, FX_FLOAT bottom, FX_BOOL bContains = FALSE) = 0;
-
- virtual void GetBoundedSegment(int index, int& start, int& count) const = 0;
-
-
- virtual int GetWordBreak(int index, int direction) const = 0;
-
- virtual CFX_WideString GetPageText(int start = 0, int nCount = -1 ) const = 0;
-};
-#define FPDFTEXT_MATCHCASE 0x00000001
-#define FPDFTEXT_MATCHWHOLEWORD 0x00000002
-#define FPDFTEXT_CONSECUTIVE 0x00000004
-class IPDF_TextPageFind : public CFX_Object
-{
-public:
-
- virtual ~IPDF_TextPageFind() {}
-
- static IPDF_TextPageFind* CreatePageFind(const IPDF_TextPage* pTextPage);
-public:
-
- virtual FX_BOOL FindFirst(CFX_WideString findwhat, int flags, int startPos = 0) = 0;
-
- virtual FX_BOOL FindNext() = 0;
-
- virtual FX_BOOL FindPrev() = 0;
-
- virtual void GetRectArray(CFX_RectArray& rects) const = 0;
-
- virtual int GetCurOrder() const = 0;
-
- virtual int GetMatchedCount() const = 0;
-};
-class IPDF_LinkExtract : public CFX_Object
-{
-public:
-
- virtual ~IPDF_LinkExtract() {}
-
- static IPDF_LinkExtract* CreateLinkExtract();
-
- virtual FX_BOOL ExtractLinks(const IPDF_TextPage* pTextPage) = 0;
-public:
-
- virtual int CountLinks() const = 0;
-
- virtual CFX_WideString GetURL(int index) const = 0;
-
- virtual void GetBoundedSegment(int index, int& start, int& count) const = 0;
-
- virtual void GetRects(int index, CFX_RectArray& rects) const = 0;
-};
-#endif
+// 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 _FPDF_TEXT_H_
+#define _FPDF_TEXT_H_
+#ifndef _FPDF_PARSER_
+#include "../fpdfapi/fpdf_parser.h"
+#endif
+#ifndef _FPDF_PAGEOBJ_H_
+#include "../fpdfapi/fpdf_pageobj.h"
+#endif
+#ifndef _FPDF_PAGE_
+#include "../fpdfapi/fpdf_page.h"
+#endif
+class CPDF_PageObjects;
+#define PDF2TXT_AUTO_ROTATE 1
+#define PDF2TXT_AUTO_WIDTH 2
+#define PDF2TXT_KEEP_COLUMN 4
+#define PDF2TXT_USE_OCR 8
+#define PDF2TXT_INCLUDE_INVISIBLE 16
+void PDF_GetPageText(CFX_ByteStringArray& lines, CPDF_Document* pDoc, CPDF_Dictionary* pPage,
+ int iMinWidth, FX_DWORD flags);
+void PDF_GetPageText_Unicode(CFX_WideStringArray& lines, CPDF_Document* pDoc, CPDF_Dictionary* pPage,
+ int iMinWidth, FX_DWORD flags);
+void PDF_GetTextStream_Unicode(CFX_WideTextBuf& buffer, CPDF_Document* pDoc, CPDF_Dictionary* pPage,
+ FX_DWORD flags);
+CFX_WideString PDF_GetFirstTextLine_Unicode(CPDF_Document* pDoc, CPDF_Dictionary* pPage);
+class IPDF_TextPage;
+class IPDF_LinkExtract;
+class IPDF_TextPageFind;
+#define CHAR_ERROR -1
+#define CHAR_NORMAL 0
+#define CHAR_GENERATED 1
+#define CHAR_UNUNICODE 2
+typedef struct {
+ FX_WCHAR m_Unicode;
+ FX_WCHAR m_Charcode;
+ FX_INT32 m_Flag;
+ FX_FLOAT m_FontSize;
+ FX_FLOAT m_OriginX;
+ FX_FLOAT m_OriginY;
+ CFX_FloatRect m_CharBox;
+ CPDF_TextObject* m_pTextObj;
+ CFX_AffineMatrix m_Matrix;
+} FPDF_CHAR_INFO;
+typedef CFX_ArrayTemplate<CFX_FloatRect> CFX_RectArray;
+#define FPDFTEXT_LRTB 0
+#define FPDFTEXT_RLTB 1
+#define FPDFTEXT_TBRL 2
+#define FPDFTEXT_LEFT -1
+#define FPDFTEXT_RIGHT 1
+#define FPDFTEXT_UP -2
+#define FPDFTEXT_DOWN 2
+class IPDF_ReflowedPage;
+#define FPDFTEXT_WRITINGMODE_UNKNOW 0
+#define FPDFTEXT_WRITINGMODE_LRTB 1
+#define FPDFTEXT_WRITINGMODE_RLTB 2
+#define FPDFTEXT_WRITINGMODE_TBRL 3
+class CPDFText_ParseOptions : public CFX_Object
+{
+public:
+
+ CPDFText_ParseOptions();
+ FX_BOOL m_bGetCharCodeOnly;
+ FX_BOOL m_bNormalizeObjs;
+ FX_BOOL m_bOutputHyphen;
+};
+class IPDF_TextPage : public CFX_Object
+{
+public:
+
+ virtual ~IPDF_TextPage() {}
+ static IPDF_TextPage* CreateTextPage(const CPDF_Page* pPage, CPDFText_ParseOptions ParserOptions);
+ static IPDF_TextPage* CreateTextPage(const CPDF_Page* pPage, int flags = 0);
+ static IPDF_TextPage* CreateTextPage(const CPDF_PageObjects* pObjs, int flags = 0);
+ static IPDF_TextPage* CreateReflowTextPage(IPDF_ReflowedPage* pRefPage);
+
+ virtual void NormalizeObjects(FX_BOOL bNormalize) = 0;
+
+ virtual FX_BOOL ParseTextPage() = 0;
+
+
+ virtual FX_BOOL IsParsered() const = 0;
+public:
+
+ virtual int CharIndexFromTextIndex(int TextIndex) const = 0;
+
+ virtual int TextIndexFromCharIndex(int CharIndex) const = 0;
+
+
+ virtual int CountChars() const = 0;
+
+ virtual void GetCharInfo(int index, FPDF_CHAR_INFO & info) const = 0;
+
+ virtual void GetRectArray(int start, int nCount, CFX_RectArray& rectArray) const = 0;
+
+
+
+ virtual int GetIndexAtPos(CPDF_Point point, FX_FLOAT xTorelance, FX_FLOAT yTorelance) const = 0;
+
+ virtual int GetIndexAtPos(FX_FLOAT x, FX_FLOAT y, FX_FLOAT xTorelance, FX_FLOAT yTorelance) const = 0;
+
+ virtual int GetOrderByDirection(int index, int direction) const = 0;
+
+ virtual CFX_WideString GetTextByRect(CFX_FloatRect rect) const = 0;
+
+ virtual void GetRectsArrayByRect(CFX_FloatRect rect, CFX_RectArray& resRectArray) const = 0;
+
+
+ virtual int CountRects(int start, int nCount) = 0;
+
+ virtual void GetRect(int rectIndex, FX_FLOAT& left, FX_FLOAT& top, FX_FLOAT& right, FX_FLOAT &bottom) const = 0;
+
+ virtual FX_BOOL GetBaselineRotate(int rectIndex, int& Rotate) = 0;
+
+ virtual FX_BOOL GetBaselineRotate(CFX_FloatRect rect, int& Rotate) = 0;
+
+ virtual int CountBoundedSegments(FX_FLOAT left, FX_FLOAT top, FX_FLOAT right, FX_FLOAT bottom, FX_BOOL bContains = FALSE) = 0;
+
+ virtual void GetBoundedSegment(int index, int& start, int& count) const = 0;
+
+
+ virtual int GetWordBreak(int index, int direction) const = 0;
+
+ virtual CFX_WideString GetPageText(int start = 0, int nCount = -1 ) const = 0;
+};
+#define FPDFTEXT_MATCHCASE 0x00000001
+#define FPDFTEXT_MATCHWHOLEWORD 0x00000002
+#define FPDFTEXT_CONSECUTIVE 0x00000004
+class IPDF_TextPageFind : public CFX_Object
+{
+public:
+
+ virtual ~IPDF_TextPageFind() {}
+
+ static IPDF_TextPageFind* CreatePageFind(const IPDF_TextPage* pTextPage);
+public:
+
+ virtual FX_BOOL FindFirst(CFX_WideString findwhat, int flags, int startPos = 0) = 0;
+
+ virtual FX_BOOL FindNext() = 0;
+
+ virtual FX_BOOL FindPrev() = 0;
+
+ virtual void GetRectArray(CFX_RectArray& rects) const = 0;
+
+ virtual int GetCurOrder() const = 0;
+
+ virtual int GetMatchedCount() const = 0;
+};
+class IPDF_LinkExtract : public CFX_Object
+{
+public:
+
+ virtual ~IPDF_LinkExtract() {}
+
+ static IPDF_LinkExtract* CreateLinkExtract();
+
+ virtual FX_BOOL ExtractLinks(const IPDF_TextPage* pTextPage) = 0;
+public:
+
+ virtual int CountLinks() const = 0;
+
+ virtual CFX_WideString GetURL(int index) const = 0;
+
+ virtual void GetBoundedSegment(int index, int& start, int& count) const = 0;
+
+ virtual void GetRects(int index, CFX_RectArray& rects) const = 0;
+};
+#endif
diff --git a/core/include/fxcodec/fx_codec.h b/core/include/fxcodec/fx_codec.h
index bee9702b28..e215bb1d79 100644
--- a/core/include/fxcodec/fx_codec.h
+++ b/core/include/fxcodec/fx_codec.h
@@ -1,288 +1,288 @@
-// 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 _FX_CODEC_H_
-#define _FX_CODEC_H_
-#ifndef _FXCRT_EXTENSION_
-#include "../fxcrt/fx_ext.h"
-#endif
-#include "fx_codec_def.h"
-#include "fx_codec_provider.h"
-class CFX_DIBSource;
-class ICodec_ScanlineDecoder;
-class ICodec_BasicModule;
-class ICodec_FaxModule;
-class ICodec_JpegModule;
-class ICodec_JpxModule;
-class ICodec_Jbig2Module;
-class ICodec_IccModule;
-class ICodec_FlateModule;
-class ICodec_Jbig2Encoder;
-class ICodec_ScanlineDecoder;
-class CCodec_ModuleMgr : public CFX_Object
-{
-public:
-
- static CCodec_ModuleMgr* Create();
-
- void Destroy();
-
- void InitJbig2Decoder();
-
- void InitJpxDecoder();
-
-
- void InitIccDecoder();
-
- ICodec_Jbig2Encoder* CreateJbig2Encoder();
-protected:
- CCodec_ModuleMgr();
- ~CCodec_ModuleMgr();
-public:
- ICodec_BasicModule* GetBasicModule()
- {
- return m_pBasicModule;
- }
- ICodec_FaxModule* GetFaxModule()
- {
- return m_pFaxModule;
- }
- ICodec_JpegModule* GetJpegModule()
- {
- return m_pJpegModule;
- }
- ICodec_JpxModule* GetJpxModule()
- {
- return m_pJpxModule;
- }
- ICodec_Jbig2Module* GetJbig2Module()
- {
- return m_pJbig2Module;
- }
- ICodec_IccModule* GetIccModule()
- {
- return m_pIccModule;
- }
- ICodec_FlateModule* GetFlateModule()
- {
- return m_pFlateModule;
- }
-protected:
- ICodec_BasicModule* m_pBasicModule;
- ICodec_FaxModule* m_pFaxModule;
- ICodec_JpegModule* m_pJpegModule;
- ICodec_JpxModule* m_pJpxModule;
- ICodec_Jbig2Module* m_pJbig2Module;
- ICodec_IccModule* m_pIccModule;
- ICodec_FlateModule* m_pFlateModule;
-
-};
-class ICodec_BasicModule : public CFX_Object
-{
-public:
-
- virtual ~ICodec_BasicModule() {}
- virtual FX_BOOL RunLengthEncode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf,
- FX_DWORD& dest_size) = 0;
- virtual FX_BOOL A85Encode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf,
- FX_DWORD& dest_size) = 0;
- virtual ICodec_ScanlineDecoder* CreateRunLengthDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height,
- int nComps, int bpc) = 0;
-};
-class ICodec_ScanlineDecoder : public CFX_Object
-{
-public:
-
- virtual ~ICodec_ScanlineDecoder() {}
-
- virtual FX_DWORD GetSrcOffset() = 0;
-
- virtual void DownScale(int dest_width, int dest_height) = 0;
-
- virtual FX_LPBYTE GetScanline(int line) = 0;
-
- virtual FX_BOOL SkipToScanline(int line, IFX_Pause* pPause) = 0;
-
- virtual int GetWidth() = 0;
-
- virtual int GetHeight() = 0;
-
- virtual int CountComps() = 0;
-
- virtual int GetBPC() = 0;
-
- virtual FX_BOOL IsColorTransformed() = 0;
-
- virtual void ClearImageData() = 0;
-};
-class ICodec_FlateModule : public CFX_Object
-{
-public:
-
- virtual ~ICodec_FlateModule() {}
- virtual ICodec_ScanlineDecoder* CreateDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height,
- int nComps, int bpc, int predictor, int Colors, int BitsPerComponent, int Columns) = 0;
- virtual FX_DWORD FlateOrLZWDecode(FX_BOOL bLZW, const FX_BYTE* src_buf, FX_DWORD src_size, FX_BOOL bEarlyChange,
- int predictor, int Colors, int BitsPerComponent, int Columns,
- FX_DWORD estimated_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size) = 0;
- virtual FX_BOOL Encode(const FX_BYTE* src_buf, FX_DWORD src_size,
- int predictor, int Colors, int BitsPerComponent, int Columns,
- FX_LPBYTE& dest_buf, FX_DWORD& dest_size) = 0;
- virtual FX_BOOL Encode(FX_LPCBYTE src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size) = 0;
-};
-class ICodec_FaxModule : public CFX_Object
-{
-public:
-
- virtual ~ICodec_FaxModule() {}
-
- virtual ICodec_ScanlineDecoder* CreateDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height,
- int K, FX_BOOL EndOfLine, FX_BOOL EncodedByteAlign, FX_BOOL BlackIs1, int Columns, int Rows) = 0;
-
-
- virtual FX_BOOL Encode(FX_LPCBYTE src_buf, int width, int height, int pitch,
- FX_LPBYTE& dest_buf, FX_DWORD& dest_size) = 0;
-};
-class ICodec_JpegModule : public CFX_Object
-{
-public:
-
- virtual ~ICodec_JpegModule() {}
-
- virtual void SetPovider(IFX_JpegProvider* pJP) = 0;
-
- virtual ICodec_ScanlineDecoder* CreateDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size,
- int width, int height, int nComps, FX_BOOL ColorTransform) = 0;
-
- virtual FX_BOOL LoadInfo(FX_LPCBYTE src_buf, FX_DWORD src_size, int& width, int& height,
- int& num_components, int& bits_per_components, FX_BOOL& color_transform,
- FX_LPBYTE* icc_buf_ptr = NULL, FX_DWORD* icc_length = NULL) = 0;
-
- virtual FX_BOOL Encode(const class CFX_DIBSource* pSource, FX_LPBYTE& dest_buf, FX_STRSIZE& dest_size, int quality = 75,
- FX_LPCBYTE icc_buf = NULL, FX_DWORD icc_length = 0) = 0;
-
- virtual void* Start() = 0;
-
- virtual void Finish(void* pContext) = 0;
-
- virtual void Input(void* pContext, FX_LPCBYTE src_buf, FX_DWORD src_size) = 0;
-
- virtual int ReadHeader(void* pContext, int* width, int* height, int* nComps) = 0;
-
-
- virtual int StartScanline(void* pContext, int down_scale) = 0;
-
-
- virtual FX_BOOL ReadScanline(void* pContext, FX_LPBYTE dest_buf) = 0;
-
-
- virtual FX_DWORD GetAvailInput(void* pContext, FX_LPBYTE* avail_buf_ptr = NULL) = 0;
-};
-class ICodec_JpxModule : public CFX_Object
-{
-public:
-
- virtual ~ICodec_JpxModule() {}
-
- virtual FX_LPVOID CreateDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, FX_BOOL useColorSpace = FALSE) = 0;
-
- virtual void GetImageInfo(FX_LPVOID ctx, FX_DWORD& width, FX_DWORD& height,
- FX_DWORD& codestream_nComps, FX_DWORD& output_nComps) = 0;
-
- virtual FX_BOOL Decode(FX_LPVOID ctx, FX_LPBYTE dest_data, int pitch,
- FX_BOOL bTranslateColor, FX_LPBYTE offsets) = 0;
-
- virtual void DestroyDecoder(FX_LPVOID ctx) = 0;
-};
-class ICodec_Jbig2Module : public CFX_Object
-{
-public:
-
- virtual ~ICodec_Jbig2Module() {}
-
- virtual FX_BOOL Decode(FX_DWORD width, FX_DWORD height, FX_LPCBYTE src_buf, FX_DWORD src_size,
- FX_LPCBYTE global_data, FX_DWORD global_size, FX_LPBYTE dest_buf, FX_DWORD dest_pitch) = 0;
-
- virtual FX_BOOL Decode(IFX_FileRead* file_ptr, FX_DWORD& width, FX_DWORD& height,
- FX_DWORD& pitch, FX_LPBYTE& dest_buf) = 0;
- virtual void* CreateJbig2Context() = 0;
-
- virtual FXCODEC_STATUS StartDecode(void* pJbig2Context, FX_DWORD width, FX_DWORD height, FX_LPCBYTE src_buf, FX_DWORD src_size,
- FX_LPCBYTE global_data, FX_DWORD global_size, FX_LPBYTE dest_buf, FX_DWORD dest_pitch, IFX_Pause* pPause) = 0;
-
- virtual FXCODEC_STATUS StartDecode(void* pJbig2Context, IFX_FileRead* file_ptr,
- FX_DWORD& width, FX_DWORD& height, FX_DWORD& pitch, FX_LPBYTE& dest_buf, IFX_Pause* pPause) = 0;
- virtual FXCODEC_STATUS ContinueDecode(void* pJbig2Content, IFX_Pause* pPause) = 0;
- virtual void DestroyJbig2Context(void* pJbig2Content) = 0;
-};
-class ICodec_Jbig2Encoder : public CFX_Object
-{
-public:
-
- virtual ~ICodec_Jbig2Encoder() {}
-};
-class ICodec_IccModule : public CFX_Object
-{
-public:
- typedef enum {
- IccCS_Unknown = 0,
- IccCS_XYZ,
- IccCS_Lab,
- IccCS_Luv,
- IccCS_YCbCr,
- IccCS_Yxy,
- IccCS_Hsv,
- IccCS_Hls,
- IccCS_Gray,
- IccCS_Rgb,
- IccCS_Cmyk,
- IccCS_Cmy
- } IccCS;
- typedef struct _IccParam {
- FX_DWORD Version;
- IccCS ColorSpace;
- FX_DWORD dwProfileType;
- FX_DWORD dwFormat;
- FX_LPBYTE pProfileData;
- FX_DWORD dwProfileSize;
- double Gamma;
- } IccParam;
-
- virtual ~ICodec_IccModule() {}
-
- virtual IccCS GetProfileCS(FX_LPCBYTE pProfileData, unsigned int dwProfileSize) = 0;
-
- virtual IccCS GetProfileCS(IFX_FileRead* pFile) = 0;
-
- virtual FX_LPVOID CreateTransform(ICodec_IccModule::IccParam* pInputParam,
- ICodec_IccModule::IccParam* pOutputParam,
- ICodec_IccModule::IccParam* pProofParam = NULL,
- FX_DWORD dwIntent = Icc_INTENT_PERCEPTUAL,
- FX_DWORD dwFlag = Icc_FLAGS_DEFAULT,
- FX_DWORD dwPrfIntent = Icc_INTENT_ABSOLUTE_COLORIMETRIC,
- FX_DWORD dwPrfFlag = Icc_FLAGS_SOFTPROOFING
- ) = 0;
-
-
- virtual FX_LPVOID CreateTransform_sRGB(FX_LPCBYTE pProfileData, unsigned int dwProfileSize, int nComponents, int intent = 0,
- FX_DWORD dwSrcFormat = Icc_FORMAT_DEFAULT) = 0;
-
- virtual FX_LPVOID CreateTransform_CMYK(FX_LPCBYTE pSrcProfileData, unsigned int dwSrcProfileSize, int nSrcComponents,
- FX_LPCBYTE pDstProfileData, unsigned int dwDstProfileSize, int intent = 0,
- FX_DWORD dwSrcFormat = Icc_FORMAT_DEFAULT,
- FX_DWORD dwDstFormat = Icc_FORMAT_DEFAULT
- ) = 0;
-
- virtual void DestroyTransform(FX_LPVOID pTransform) = 0;
-
- virtual void Translate(FX_LPVOID pTransform, FX_FLOAT* pSrcValues, FX_FLOAT* pDestValues) = 0;
-
- virtual void TranslateScanline(FX_LPVOID pTransform, FX_LPBYTE pDest, FX_LPCBYTE pSrc, int pixels) = 0;
-};
-void AdobeCMYK_to_sRGB(FX_FLOAT c, FX_FLOAT m, FX_FLOAT y, FX_FLOAT k, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B);
-void AdobeCMYK_to_sRGB1(FX_BYTE c, FX_BYTE m, FX_BYTE y, FX_BYTE k, FX_BYTE& R, FX_BYTE& G, FX_BYTE& B);
-FX_BOOL MD5ComputeID(FX_LPCVOID buf, FX_DWORD dwSize, FX_BYTE ID[16]);
-#endif
+// 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 _FX_CODEC_H_
+#define _FX_CODEC_H_
+#ifndef _FXCRT_EXTENSION_
+#include "../fxcrt/fx_ext.h"
+#endif
+#include "fx_codec_def.h"
+#include "fx_codec_provider.h"
+class CFX_DIBSource;
+class ICodec_ScanlineDecoder;
+class ICodec_BasicModule;
+class ICodec_FaxModule;
+class ICodec_JpegModule;
+class ICodec_JpxModule;
+class ICodec_Jbig2Module;
+class ICodec_IccModule;
+class ICodec_FlateModule;
+class ICodec_Jbig2Encoder;
+class ICodec_ScanlineDecoder;
+class CCodec_ModuleMgr : public CFX_Object
+{
+public:
+
+ static CCodec_ModuleMgr* Create();
+
+ void Destroy();
+
+ void InitJbig2Decoder();
+
+ void InitJpxDecoder();
+
+
+ void InitIccDecoder();
+
+ ICodec_Jbig2Encoder* CreateJbig2Encoder();
+protected:
+ CCodec_ModuleMgr();
+ ~CCodec_ModuleMgr();
+public:
+ ICodec_BasicModule* GetBasicModule()
+ {
+ return m_pBasicModule;
+ }
+ ICodec_FaxModule* GetFaxModule()
+ {
+ return m_pFaxModule;
+ }
+ ICodec_JpegModule* GetJpegModule()
+ {
+ return m_pJpegModule;
+ }
+ ICodec_JpxModule* GetJpxModule()
+ {
+ return m_pJpxModule;
+ }
+ ICodec_Jbig2Module* GetJbig2Module()
+ {
+ return m_pJbig2Module;
+ }
+ ICodec_IccModule* GetIccModule()
+ {
+ return m_pIccModule;
+ }
+ ICodec_FlateModule* GetFlateModule()
+ {
+ return m_pFlateModule;
+ }
+protected:
+ ICodec_BasicModule* m_pBasicModule;
+ ICodec_FaxModule* m_pFaxModule;
+ ICodec_JpegModule* m_pJpegModule;
+ ICodec_JpxModule* m_pJpxModule;
+ ICodec_Jbig2Module* m_pJbig2Module;
+ ICodec_IccModule* m_pIccModule;
+ ICodec_FlateModule* m_pFlateModule;
+
+};
+class ICodec_BasicModule : public CFX_Object
+{
+public:
+
+ virtual ~ICodec_BasicModule() {}
+ virtual FX_BOOL RunLengthEncode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf,
+ FX_DWORD& dest_size) = 0;
+ virtual FX_BOOL A85Encode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf,
+ FX_DWORD& dest_size) = 0;
+ virtual ICodec_ScanlineDecoder* CreateRunLengthDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height,
+ int nComps, int bpc) = 0;
+};
+class ICodec_ScanlineDecoder : public CFX_Object
+{
+public:
+
+ virtual ~ICodec_ScanlineDecoder() {}
+
+ virtual FX_DWORD GetSrcOffset() = 0;
+
+ virtual void DownScale(int dest_width, int dest_height) = 0;
+
+ virtual FX_LPBYTE GetScanline(int line) = 0;
+
+ virtual FX_BOOL SkipToScanline(int line, IFX_Pause* pPause) = 0;
+
+ virtual int GetWidth() = 0;
+
+ virtual int GetHeight() = 0;
+
+ virtual int CountComps() = 0;
+
+ virtual int GetBPC() = 0;
+
+ virtual FX_BOOL IsColorTransformed() = 0;
+
+ virtual void ClearImageData() = 0;
+};
+class ICodec_FlateModule : public CFX_Object
+{
+public:
+
+ virtual ~ICodec_FlateModule() {}
+ virtual ICodec_ScanlineDecoder* CreateDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height,
+ int nComps, int bpc, int predictor, int Colors, int BitsPerComponent, int Columns) = 0;
+ virtual FX_DWORD FlateOrLZWDecode(FX_BOOL bLZW, const FX_BYTE* src_buf, FX_DWORD src_size, FX_BOOL bEarlyChange,
+ int predictor, int Colors, int BitsPerComponent, int Columns,
+ FX_DWORD estimated_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size) = 0;
+ virtual FX_BOOL Encode(const FX_BYTE* src_buf, FX_DWORD src_size,
+ int predictor, int Colors, int BitsPerComponent, int Columns,
+ FX_LPBYTE& dest_buf, FX_DWORD& dest_size) = 0;
+ virtual FX_BOOL Encode(FX_LPCBYTE src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size) = 0;
+};
+class ICodec_FaxModule : public CFX_Object
+{
+public:
+
+ virtual ~ICodec_FaxModule() {}
+
+ virtual ICodec_ScanlineDecoder* CreateDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height,
+ int K, FX_BOOL EndOfLine, FX_BOOL EncodedByteAlign, FX_BOOL BlackIs1, int Columns, int Rows) = 0;
+
+
+ virtual FX_BOOL Encode(FX_LPCBYTE src_buf, int width, int height, int pitch,
+ FX_LPBYTE& dest_buf, FX_DWORD& dest_size) = 0;
+};
+class ICodec_JpegModule : public CFX_Object
+{
+public:
+
+ virtual ~ICodec_JpegModule() {}
+
+ virtual void SetPovider(IFX_JpegProvider* pJP) = 0;
+
+ virtual ICodec_ScanlineDecoder* CreateDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size,
+ int width, int height, int nComps, FX_BOOL ColorTransform) = 0;
+
+ virtual FX_BOOL LoadInfo(FX_LPCBYTE src_buf, FX_DWORD src_size, int& width, int& height,
+ int& num_components, int& bits_per_components, FX_BOOL& color_transform,
+ FX_LPBYTE* icc_buf_ptr = NULL, FX_DWORD* icc_length = NULL) = 0;
+
+ virtual FX_BOOL Encode(const class CFX_DIBSource* pSource, FX_LPBYTE& dest_buf, FX_STRSIZE& dest_size, int quality = 75,
+ FX_LPCBYTE icc_buf = NULL, FX_DWORD icc_length = 0) = 0;
+
+ virtual void* Start() = 0;
+
+ virtual void Finish(void* pContext) = 0;
+
+ virtual void Input(void* pContext, FX_LPCBYTE src_buf, FX_DWORD src_size) = 0;
+
+ virtual int ReadHeader(void* pContext, int* width, int* height, int* nComps) = 0;
+
+
+ virtual int StartScanline(void* pContext, int down_scale) = 0;
+
+
+ virtual FX_BOOL ReadScanline(void* pContext, FX_LPBYTE dest_buf) = 0;
+
+
+ virtual FX_DWORD GetAvailInput(void* pContext, FX_LPBYTE* avail_buf_ptr = NULL) = 0;
+};
+class ICodec_JpxModule : public CFX_Object
+{
+public:
+
+ virtual ~ICodec_JpxModule() {}
+
+ virtual FX_LPVOID CreateDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, FX_BOOL useColorSpace = FALSE) = 0;
+
+ virtual void GetImageInfo(FX_LPVOID ctx, FX_DWORD& width, FX_DWORD& height,
+ FX_DWORD& codestream_nComps, FX_DWORD& output_nComps) = 0;
+
+ virtual FX_BOOL Decode(FX_LPVOID ctx, FX_LPBYTE dest_data, int pitch,
+ FX_BOOL bTranslateColor, FX_LPBYTE offsets) = 0;
+
+ virtual void DestroyDecoder(FX_LPVOID ctx) = 0;
+};
+class ICodec_Jbig2Module : public CFX_Object
+{
+public:
+
+ virtual ~ICodec_Jbig2Module() {}
+
+ virtual FX_BOOL Decode(FX_DWORD width, FX_DWORD height, FX_LPCBYTE src_buf, FX_DWORD src_size,
+ FX_LPCBYTE global_data, FX_DWORD global_size, FX_LPBYTE dest_buf, FX_DWORD dest_pitch) = 0;
+
+ virtual FX_BOOL Decode(IFX_FileRead* file_ptr, FX_DWORD& width, FX_DWORD& height,
+ FX_DWORD& pitch, FX_LPBYTE& dest_buf) = 0;
+ virtual void* CreateJbig2Context() = 0;
+
+ virtual FXCODEC_STATUS StartDecode(void* pJbig2Context, FX_DWORD width, FX_DWORD height, FX_LPCBYTE src_buf, FX_DWORD src_size,
+ FX_LPCBYTE global_data, FX_DWORD global_size, FX_LPBYTE dest_buf, FX_DWORD dest_pitch, IFX_Pause* pPause) = 0;
+
+ virtual FXCODEC_STATUS StartDecode(void* pJbig2Context, IFX_FileRead* file_ptr,
+ FX_DWORD& width, FX_DWORD& height, FX_DWORD& pitch, FX_LPBYTE& dest_buf, IFX_Pause* pPause) = 0;
+ virtual FXCODEC_STATUS ContinueDecode(void* pJbig2Content, IFX_Pause* pPause) = 0;
+ virtual void DestroyJbig2Context(void* pJbig2Content) = 0;
+};
+class ICodec_Jbig2Encoder : public CFX_Object
+{
+public:
+
+ virtual ~ICodec_Jbig2Encoder() {}
+};
+class ICodec_IccModule : public CFX_Object
+{
+public:
+ typedef enum {
+ IccCS_Unknown = 0,
+ IccCS_XYZ,
+ IccCS_Lab,
+ IccCS_Luv,
+ IccCS_YCbCr,
+ IccCS_Yxy,
+ IccCS_Hsv,
+ IccCS_Hls,
+ IccCS_Gray,
+ IccCS_Rgb,
+ IccCS_Cmyk,
+ IccCS_Cmy
+ } IccCS;
+ typedef struct _IccParam {
+ FX_DWORD Version;
+ IccCS ColorSpace;
+ FX_DWORD dwProfileType;
+ FX_DWORD dwFormat;
+ FX_LPBYTE pProfileData;
+ FX_DWORD dwProfileSize;
+ double Gamma;
+ } IccParam;
+
+ virtual ~ICodec_IccModule() {}
+
+ virtual IccCS GetProfileCS(FX_LPCBYTE pProfileData, unsigned int dwProfileSize) = 0;
+
+ virtual IccCS GetProfileCS(IFX_FileRead* pFile) = 0;
+
+ virtual FX_LPVOID CreateTransform(ICodec_IccModule::IccParam* pInputParam,
+ ICodec_IccModule::IccParam* pOutputParam,
+ ICodec_IccModule::IccParam* pProofParam = NULL,
+ FX_DWORD dwIntent = Icc_INTENT_PERCEPTUAL,
+ FX_DWORD dwFlag = Icc_FLAGS_DEFAULT,
+ FX_DWORD dwPrfIntent = Icc_INTENT_ABSOLUTE_COLORIMETRIC,
+ FX_DWORD dwPrfFlag = Icc_FLAGS_SOFTPROOFING
+ ) = 0;
+
+
+ virtual FX_LPVOID CreateTransform_sRGB(FX_LPCBYTE pProfileData, unsigned int dwProfileSize, int nComponents, int intent = 0,
+ FX_DWORD dwSrcFormat = Icc_FORMAT_DEFAULT) = 0;
+
+ virtual FX_LPVOID CreateTransform_CMYK(FX_LPCBYTE pSrcProfileData, unsigned int dwSrcProfileSize, int nSrcComponents,
+ FX_LPCBYTE pDstProfileData, unsigned int dwDstProfileSize, int intent = 0,
+ FX_DWORD dwSrcFormat = Icc_FORMAT_DEFAULT,
+ FX_DWORD dwDstFormat = Icc_FORMAT_DEFAULT
+ ) = 0;
+
+ virtual void DestroyTransform(FX_LPVOID pTransform) = 0;
+
+ virtual void Translate(FX_LPVOID pTransform, FX_FLOAT* pSrcValues, FX_FLOAT* pDestValues) = 0;
+
+ virtual void TranslateScanline(FX_LPVOID pTransform, FX_LPBYTE pDest, FX_LPCBYTE pSrc, int pixels) = 0;
+};
+void AdobeCMYK_to_sRGB(FX_FLOAT c, FX_FLOAT m, FX_FLOAT y, FX_FLOAT k, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B);
+void AdobeCMYK_to_sRGB1(FX_BYTE c, FX_BYTE m, FX_BYTE y, FX_BYTE k, FX_BYTE& R, FX_BYTE& G, FX_BYTE& B);
+FX_BOOL MD5ComputeID(FX_LPCVOID buf, FX_DWORD dwSize, FX_BYTE ID[16]);
+#endif
diff --git a/core/include/fxcodec/fx_codec_def.h b/core/include/fxcodec/fx_codec_def.h
index 72b10bd012..0d08da699b 100644
--- a/core/include/fxcodec/fx_codec_def.h
+++ b/core/include/fxcodec/fx_codec_def.h
@@ -1,71 +1,71 @@
-// 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 _FX_CODEC_DEF_H_
-#define _FX_CODEC_DEF_H_
-enum FXCODEC_STATUS {
- FXCODEC_STATUS_ERROR = -1,
- FXCODEC_STATUS_FRAME_READY,
- FXCODEC_STATUS_FRAME_TOBECONTINUE,
- FXCODEC_STATUS_DECODE_READY,
- FXCODEC_STATUS_DECODE_TOBECONTINUE,
- FXCODEC_STATUS_DECODE_FINISH,
- FXCODEC_STATUS_ERR_MEMORY,
- FXCODEC_STATUS_ERR_READ,
- FXCODEC_STATUS_ERR_FLUSH,
- FXCODEC_STATUS_ERR_FORMAT,
- FXCODEC_STATUS_ERR_PARAMS
-};
-#define JP2_SPACE_INVALID -1
-#define JPX_SPACE_INVALID -1
-#define JP2_SPACE_bilevel1 0
-#define JP2_SPACE_YCbCr1 1
-#define JP2_SPACE_YCbCr2 3
-#define JP2_SPACE_YCbCr3 4
-#define JP2_SPACE_PhotoYCC 9
-#define JP2_SPACE_CMY 11
-#define JP2_SPACE_CMYK 12
-#define JP2_SPACE_YCCK 13
-#define JP2_SPACE_CIELab 14
-#define JP2_SPACE_bilevel2 15
-#define JP2_SPACE_sRGB 16
-#define JP2_SPACE_sLUM 17
-#define JP2_SPACE_sYCC 18
-#define JP2_SPACE_CIEJab 19
-#define JP2_SPACE_esRGB 20
-#define JP2_SPACE_ROMMRGB 21
-#define JP2_SPACE_YPbPr60 22
-#define JP2_SPACE_YPbPr50 23
-#define JP2_SPACE_esYCC 24
-#define JP2_SPACE_iccLUM 100
-#define JP2_SPACE_iccRGB 101
-#define Icc_INTENT_PERCEPTUAL 0
-#define Icc_INTENT_RELATIVE_COLORIMETRIC 1
-#define Icc_INTENT_SATURATION 2
-#define Icc_INTENT_ABSOLUTE_COLORIMETRIC 3
-#define Icc_FORMAT_DEFAULT 0
-#define Icc_FORMAT_SWAP (1<<10)
-#define Icc_FLAGS_DEFAULT 0x0000
-#define Icc_FLAGS_BLACKPOINTCOMPENSATION 0x2000
-#define Icc_FLAGS_NOWHITEONWHITEFIXUP 0x0004
-#define Icc_FLAGS_HIGHRESPRECALC 0x0400
-#define Icc_FLAGS_LOWRESPRECALC 0x0800
-#define Icc_FLAGS_GAMUTCHECK 0x1000
-#define Icc_FLAGS_SOFTPROOFING 0x4000
-#define Icc_PARAMTYPE_NONE 0
-#define Icc_PARAMTYPE_BUFFER 1
-#define Icc_PARAMTYPE_PARAM 2
-#define EXIFTAG_USHORT_RESUNIT 296
-#define EXIFTAG_FLOAT_DPIX 282
-#define EXIFTAG_FLOAT_DPIY 283
-#define EXIFTAG_USHORT_ORIENTATION 274
-#define EXIFTAG_STRING_MANUFACTURER 271
-#define EXIFTAG_STRING_MODULE 272
-#define EXIFTAG_STRING_SOFTWARE 305
-#define EXIFTAG_STRING_IAMGEDESCRIPTION 270
-#define EXIFTAG_STRING_DATETIME 306
-#define EXIFTAG_STRING_COPYRIGHT 33432
-#endif
+// 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 _FX_CODEC_DEF_H_
+#define _FX_CODEC_DEF_H_
+enum FXCODEC_STATUS {
+ FXCODEC_STATUS_ERROR = -1,
+ FXCODEC_STATUS_FRAME_READY,
+ FXCODEC_STATUS_FRAME_TOBECONTINUE,
+ FXCODEC_STATUS_DECODE_READY,
+ FXCODEC_STATUS_DECODE_TOBECONTINUE,
+ FXCODEC_STATUS_DECODE_FINISH,
+ FXCODEC_STATUS_ERR_MEMORY,
+ FXCODEC_STATUS_ERR_READ,
+ FXCODEC_STATUS_ERR_FLUSH,
+ FXCODEC_STATUS_ERR_FORMAT,
+ FXCODEC_STATUS_ERR_PARAMS
+};
+#define JP2_SPACE_INVALID -1
+#define JPX_SPACE_INVALID -1
+#define JP2_SPACE_bilevel1 0
+#define JP2_SPACE_YCbCr1 1
+#define JP2_SPACE_YCbCr2 3
+#define JP2_SPACE_YCbCr3 4
+#define JP2_SPACE_PhotoYCC 9
+#define JP2_SPACE_CMY 11
+#define JP2_SPACE_CMYK 12
+#define JP2_SPACE_YCCK 13
+#define JP2_SPACE_CIELab 14
+#define JP2_SPACE_bilevel2 15
+#define JP2_SPACE_sRGB 16
+#define JP2_SPACE_sLUM 17
+#define JP2_SPACE_sYCC 18
+#define JP2_SPACE_CIEJab 19
+#define JP2_SPACE_esRGB 20
+#define JP2_SPACE_ROMMRGB 21
+#define JP2_SPACE_YPbPr60 22
+#define JP2_SPACE_YPbPr50 23
+#define JP2_SPACE_esYCC 24
+#define JP2_SPACE_iccLUM 100
+#define JP2_SPACE_iccRGB 101
+#define Icc_INTENT_PERCEPTUAL 0
+#define Icc_INTENT_RELATIVE_COLORIMETRIC 1
+#define Icc_INTENT_SATURATION 2
+#define Icc_INTENT_ABSOLUTE_COLORIMETRIC 3
+#define Icc_FORMAT_DEFAULT 0
+#define Icc_FORMAT_SWAP (1<<10)
+#define Icc_FLAGS_DEFAULT 0x0000
+#define Icc_FLAGS_BLACKPOINTCOMPENSATION 0x2000
+#define Icc_FLAGS_NOWHITEONWHITEFIXUP 0x0004
+#define Icc_FLAGS_HIGHRESPRECALC 0x0400
+#define Icc_FLAGS_LOWRESPRECALC 0x0800
+#define Icc_FLAGS_GAMUTCHECK 0x1000
+#define Icc_FLAGS_SOFTPROOFING 0x4000
+#define Icc_PARAMTYPE_NONE 0
+#define Icc_PARAMTYPE_BUFFER 1
+#define Icc_PARAMTYPE_PARAM 2
+#define EXIFTAG_USHORT_RESUNIT 296
+#define EXIFTAG_FLOAT_DPIX 282
+#define EXIFTAG_FLOAT_DPIY 283
+#define EXIFTAG_USHORT_ORIENTATION 274
+#define EXIFTAG_STRING_MANUFACTURER 271
+#define EXIFTAG_STRING_MODULE 272
+#define EXIFTAG_STRING_SOFTWARE 305
+#define EXIFTAG_STRING_IAMGEDESCRIPTION 270
+#define EXIFTAG_STRING_DATETIME 306
+#define EXIFTAG_STRING_COPYRIGHT 33432
+#endif
diff --git a/core/include/fxcodec/fx_codec_provider.h b/core/include/fxcodec/fx_codec_provider.h
index 4ef61d8552..a3ef396a27 100644
--- a/core/include/fxcodec/fx_codec_provider.h
+++ b/core/include/fxcodec/fx_codec_provider.h
@@ -1,53 +1,53 @@
-// 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 _FX_CODEC_PROVIDER_H_
-#define _FX_CODEC_PROVIDER_H_
-class IFX_JpegProvider
-{
-public:
-
- virtual void Release() = 0;
-
- virtual void* CreateDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height, int nComps, FX_BOOL ColorTransform) = 0;
-
-
- virtual void DestroyDecoder(void* pDecoder) = 0;
-
- virtual void DownScale(void* pDecoder, int dest_width, int dest_height) = 0;
-
- virtual FX_BOOL Rewind(void* pDecoder) = 0;
-
- virtual FX_LPBYTE GetNextLine(void* pDecoder) = 0;
-
- virtual FX_DWORD GetSrcOffset(void* pDecoder) = 0;
-
-
- virtual FX_BOOL LoadInfo(FX_LPCBYTE src_buf, FX_DWORD src_size, int& width, int& height,
- int& num_components, int& bits_per_components, FX_BOOL& color_transform,
- FX_LPBYTE* icc_buf_ptr = NULL, FX_DWORD* icc_length = NULL) = 0;
-
- virtual FX_BOOL Encode(const class CFX_DIBSource* pSource, FX_LPBYTE& dest_buf, FX_STRSIZE& dest_size, int quality = 75,
- FX_LPCBYTE icc_buf = NULL, FX_DWORD icc_length = 0) = 0;
-
- virtual void* Start() = 0;
-
- virtual void Finish(void* pContext) = 0;
-
- virtual void Input(void* pContext, FX_LPCBYTE src_buf, FX_DWORD src_size) = 0;
-
- virtual int ReadHeader(void* pContext, int* width, int* height, int* nComps) = 0;
-
-
- virtual int StartScanline(void* pContext, int down_scale) = 0;
-
-
- virtual FX_BOOL ReadScanline(void* pContext, FX_LPBYTE dest_buf) = 0;
-
-
- virtual FX_DWORD GetAvailInput(void* pContext, FX_LPBYTE* avail_buf_ptr = NULL) = 0;
-};
-#endif
+// 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 _FX_CODEC_PROVIDER_H_
+#define _FX_CODEC_PROVIDER_H_
+class IFX_JpegProvider
+{
+public:
+
+ virtual void Release() = 0;
+
+ virtual void* CreateDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height, int nComps, FX_BOOL ColorTransform) = 0;
+
+
+ virtual void DestroyDecoder(void* pDecoder) = 0;
+
+ virtual void DownScale(void* pDecoder, int dest_width, int dest_height) = 0;
+
+ virtual FX_BOOL Rewind(void* pDecoder) = 0;
+
+ virtual FX_LPBYTE GetNextLine(void* pDecoder) = 0;
+
+ virtual FX_DWORD GetSrcOffset(void* pDecoder) = 0;
+
+
+ virtual FX_BOOL LoadInfo(FX_LPCBYTE src_buf, FX_DWORD src_size, int& width, int& height,
+ int& num_components, int& bits_per_components, FX_BOOL& color_transform,
+ FX_LPBYTE* icc_buf_ptr = NULL, FX_DWORD* icc_length = NULL) = 0;
+
+ virtual FX_BOOL Encode(const class CFX_DIBSource* pSource, FX_LPBYTE& dest_buf, FX_STRSIZE& dest_size, int quality = 75,
+ FX_LPCBYTE icc_buf = NULL, FX_DWORD icc_length = 0) = 0;
+
+ virtual void* Start() = 0;
+
+ virtual void Finish(void* pContext) = 0;
+
+ virtual void Input(void* pContext, FX_LPCBYTE src_buf, FX_DWORD src_size) = 0;
+
+ virtual int ReadHeader(void* pContext, int* width, int* height, int* nComps) = 0;
+
+
+ virtual int StartScanline(void* pContext, int down_scale) = 0;
+
+
+ virtual FX_BOOL ReadScanline(void* pContext, FX_LPBYTE dest_buf) = 0;
+
+
+ virtual FX_DWORD GetAvailInput(void* pContext, FX_LPBYTE* avail_buf_ptr = NULL) = 0;
+};
+#endif
diff --git a/core/include/fxcrt/fx_basic.h b/core/include/fxcrt/fx_basic.h
index 29bc221e5b..378d6c30a8 100644
--- a/core/include/fxcrt/fx_basic.h
+++ b/core/include/fxcrt/fx_basic.h
@@ -1,1642 +1,1642 @@
-// 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 _FX_BASIC_H_
-#define _FX_BASIC_H_
-#ifndef _FX_SYSTEM_H_
-#include "fx_system.h"
-#endif
-#ifndef _FX_MEMORY_H_
-#include "fx_memory.h"
-#endif
-#ifndef _FX_STRING_H_
-#include "fx_string.h"
-#endif
-#ifndef _FX_STREAM_H_
-#include "fx_stream.h"
-#endif
-class CFX_BinaryBuf : public CFX_Object
-{
-public:
-
- CFX_BinaryBuf(IFX_Allocator* pAllocator = NULL);
-
- CFX_BinaryBuf(FX_STRSIZE size, IFX_Allocator* pAllocator = NULL);
-
- ~CFX_BinaryBuf();
-
- void Clear();
-
- void EstimateSize(FX_STRSIZE size, FX_STRSIZE alloc_step = 0);
-
- void AppendBlock(const void* pBuf, FX_STRSIZE size);
-
- void AppendFill(FX_BYTE byte, FX_STRSIZE count);
-
- void AppendString(FX_BSTR str)
- {
- AppendBlock(str.GetPtr(), str.GetLength());
- }
-
- inline void AppendByte(FX_BYTE byte)
- {
- if (m_AllocSize <= m_DataSize) {
- ExpandBuf(1);
- }
- m_pBuffer[m_DataSize++] = byte;
- }
-
- void InsertBlock(FX_STRSIZE pos, const void* pBuf, FX_STRSIZE size);
-
- void AttachData(void* pBuf, FX_STRSIZE size);
-
- void CopyData(const void* pBuf, FX_STRSIZE size);
-
- void TakeOver(CFX_BinaryBuf& other);
-
- void Delete(int start_index, int count);
-
- FX_LPBYTE GetBuffer() const
- {
- return m_pBuffer;
- }
-
- FX_STRSIZE GetSize() const
- {
- return m_DataSize;
- }
-
- CFX_ByteStringC GetByteString() const;
- void GetByteStringL(CFX_ByteStringL &str) const;
-
- void DetachBuffer();
-
- IFX_Allocator* m_pAllocator;
-protected:
-
- FX_STRSIZE m_AllocStep;
-
- FX_LPBYTE m_pBuffer;
-
- FX_STRSIZE m_DataSize;
-
- FX_STRSIZE m_AllocSize;
-
- void ExpandBuf(FX_STRSIZE size);
-};
-class CFX_ByteTextBuf : public CFX_BinaryBuf
-{
-public:
-
- CFX_ByteTextBuf(IFX_Allocator* pAllocator = NULL) : CFX_BinaryBuf(pAllocator) {}
-
- void operator = (FX_BSTR str);
-
- void AppendChar(int ch)
- {
- AppendByte((FX_BYTE)ch);
- }
-
- CFX_ByteTextBuf& operator << (int i);
-
- CFX_ByteTextBuf& operator << (FX_DWORD i);
-
- CFX_ByteTextBuf& operator << (double f);
-
- CFX_ByteTextBuf& operator << (FX_BSTR lpsz);
-
- CFX_ByteTextBuf& operator << (const CFX_ByteTextBuf& buf);
-
- FX_STRSIZE GetLength() const
- {
- return m_DataSize;
- }
-};
-class CFX_WideTextBuf : public CFX_BinaryBuf
-{
-public:
-
- CFX_WideTextBuf(IFX_Allocator* pAllocator = NULL) : CFX_BinaryBuf(pAllocator) {}
-
- void operator = (FX_LPCWSTR lpsz);
-
- void operator = (FX_WSTR str);
-
- void AppendChar(FX_WCHAR wch);
-
- CFX_WideTextBuf& operator << (int i);
-
- CFX_WideTextBuf& operator << (double f);
-
- CFX_WideTextBuf& operator << (FX_LPCWSTR lpsz);
-
- CFX_WideTextBuf& operator << (FX_WSTR str);
- CFX_WideTextBuf& operator << (const CFX_WideString &str);
-
- CFX_WideTextBuf& operator << (const CFX_WideTextBuf& buf);
-
- FX_STRSIZE GetLength() const
- {
- return m_DataSize / sizeof(FX_WCHAR);
- }
-
- FX_LPWSTR GetBuffer() const
- {
- return (FX_LPWSTR)m_pBuffer;
- }
-
- void Delete(int start_index, int count)
- {
- CFX_BinaryBuf::Delete(start_index * sizeof(FX_WCHAR), count * sizeof(FX_WCHAR));
- }
-
- CFX_WideStringC GetWideString() const;
- void GetWideStringL(CFX_WideStringL& wideText) const;
-};
-class CFX_ArchiveSaver : public CFX_Object
-{
-public:
-
- CFX_ArchiveSaver(IFX_Allocator* pAllocator = NULL) : m_SavingBuf(pAllocator), m_pStream(NULL) {}
-
- CFX_ArchiveSaver& operator << (FX_BYTE i);
-
- CFX_ArchiveSaver& operator << (int i);
-
- CFX_ArchiveSaver& operator << (FX_DWORD i);
-
- CFX_ArchiveSaver& operator << (FX_FLOAT i);
-
- CFX_ArchiveSaver& operator << (double i);
-
- CFX_ArchiveSaver& operator << (FX_BSTR bstr);
-
- CFX_ArchiveSaver& operator << (FX_LPCWSTR bstr);
-
- CFX_ArchiveSaver& operator << (const CFX_WideString& wstr);
-
- void Write(const void* pData, FX_STRSIZE dwSize);
-
- FX_INTPTR GetLength()
- {
- return m_SavingBuf.GetSize();
- }
-
- FX_LPCBYTE GetBuffer()
- {
- return m_SavingBuf.GetBuffer();
- }
-
- void SetStream(IFX_FileStream* pStream)
- {
- m_pStream = pStream;
- }
-protected:
-
- CFX_BinaryBuf m_SavingBuf;
-
- IFX_FileStream* m_pStream;
-};
-class CFX_ArchiveLoader : public CFX_Object
-{
-public:
-
- CFX_ArchiveLoader(FX_LPCBYTE pData, FX_DWORD dwSize);
-
- CFX_ArchiveLoader& operator >> (FX_BYTE& i);
-
- CFX_ArchiveLoader& operator >> (int& i);
-
- CFX_ArchiveLoader& operator >> (FX_DWORD& i);
-
- CFX_ArchiveLoader& operator >> (FX_FLOAT& i);
-
- CFX_ArchiveLoader& operator >> (double& i);
-
- CFX_ArchiveLoader& operator >> (CFX_ByteString& bstr);
-
- CFX_ArchiveLoader& operator >> (CFX_WideString& wstr);
-
- FX_BOOL IsEOF();
-
- FX_BOOL Read(void* pBuf, FX_DWORD dwSize);
-protected:
-
- FX_DWORD m_LoadingPos;
-
- FX_LPCBYTE m_pLoadingBuf;
-
- FX_DWORD m_LoadingSize;
-};
-class IFX_BufferArchive
-{
-public:
-
- IFX_BufferArchive(FX_STRSIZE size, IFX_Allocator* pAllocator = NULL);
-
-
- virtual void Clear();
-
-
- FX_BOOL Flush();
-
-
- FX_INT32 AppendBlock(const void* pBuf, size_t size);
-
- FX_INT32 AppendByte(FX_BYTE byte);
-
- FX_INT32 AppendDWord(FX_DWORD i);
-
-
- FX_INT32 AppendString(FX_BSTR lpsz);
-
-protected:
-
- virtual FX_BOOL DoWork(const void* pBuf, size_t size) = 0;
-
-
- IFX_Allocator* m_pAllocator;
-
- FX_STRSIZE m_BufSize;
-
- FX_LPBYTE m_pBuffer;
-
- FX_STRSIZE m_Length;
-};
-class CFX_FileBufferArchive : public IFX_BufferArchive, public CFX_Object
-{
-public:
- CFX_FileBufferArchive(FX_STRSIZE size = 32768, IFX_Allocator* pAllocator = NULL);
- ~CFX_FileBufferArchive();
- virtual void Clear();
-
- FX_BOOL AttachFile(IFX_StreamWrite *pFile, FX_BOOL bTakeover = FALSE);
-
- FX_BOOL AttachFile(FX_LPCWSTR filename);
-
- FX_BOOL AttachFile(FX_LPCSTR filename);
-private:
-
- virtual FX_BOOL DoWork(const void* pBuf, size_t size);
-
- IFX_StreamWrite *m_pFile;
-
- FX_BOOL m_bTakeover;
-};
-struct CFX_CharMap {
-
- static CFX_CharMap* GetDefaultMapper(FX_INT32 codepage = 0);
-
-
- CFX_WideString (*m_GetWideString)(CFX_CharMap* pMap, const CFX_ByteString& bstr);
-
- CFX_ByteString (*m_GetByteString)(CFX_CharMap* pMap, const CFX_WideString& wstr);
-
- FX_INT32 (*m_GetCodePage)();
-};
-class CFX_UTF8Decoder
-{
-public:
-
- CFX_UTF8Decoder(IFX_Allocator* pAllocator = NULL) : m_Buffer(pAllocator)
- {
- m_PendingBytes = 0;
- }
-
- void Clear();
-
- void Input(FX_BYTE byte);
-
- void AppendChar(FX_DWORD ch);
-
- void ClearStatus()
- {
- m_PendingBytes = 0;
- }
-
- CFX_WideStringC GetResult() const
- {
- return m_Buffer.GetWideString();
- }
- void GetResult(CFX_WideStringL &result) const
- {
- m_Buffer.GetWideStringL(result);
- }
-protected:
-
- int m_PendingBytes;
-
- FX_DWORD m_PendingChar;
-
- CFX_WideTextBuf m_Buffer;
-};
-class CFX_UTF8Encoder
-{
-public:
-
- CFX_UTF8Encoder(IFX_Allocator* pAllocator = NULL) : m_Buffer(pAllocator)
- {
- m_UTF16First = 0;
- }
-
- void Input(FX_WCHAR unicode);
-
- void AppendStr(FX_BSTR str)
- {
- m_UTF16First = 0;
- m_Buffer << str;
- }
-
- CFX_ByteStringC GetResult() const
- {
- return m_Buffer.GetByteString();
- }
- void GetResult(CFX_ByteStringL &result) const
- {
- m_Buffer.GetByteStringL(result);
- }
-protected:
-
- CFX_ByteTextBuf m_Buffer;
-
- FX_DWORD m_UTF16First;
-};
-CFX_ByteString FX_UrlEncode(const CFX_WideString& wsUrl);
-CFX_WideString FX_UrlDecode(const CFX_ByteString& bsUrl);
-CFX_ByteString FX_EncodeURI(const CFX_WideString& wsURI);
-CFX_WideString FX_DecodeURI(const CFX_ByteString& bsURI);
-class CFX_BasicArray : public CFX_Object
-{
-public:
-
- IFX_Allocator* m_pAllocator;
-protected:
-
- CFX_BasicArray(int unit_size, IFX_Allocator* pAllocator = NULL);
-
- ~CFX_BasicArray();
-
- FX_BOOL SetSize(int nNewSize, int nGrowBy);
-
- FX_BOOL Append(const CFX_BasicArray& src);
-
- FX_BOOL Copy(const CFX_BasicArray& src);
-
- FX_LPBYTE InsertSpaceAt(int nIndex, int nCount);
-
- FX_BOOL RemoveAt(int nIndex, int nCount);
-
- FX_BOOL InsertAt(int nStartIndex, const CFX_BasicArray* pNewArray);
-
- const void* GetDataPtr(int index) const;
-protected:
-
- FX_LPBYTE m_pData;
-
- int m_nSize;
-
- int m_nMaxSize;
-
- int m_nGrowBy;
-
- int m_nUnitSize;
-};
-template<class TYPE>
-class CFX_ArrayTemplate : public CFX_BasicArray
-{
-public:
-
- CFX_ArrayTemplate(IFX_Allocator* pAllocator = NULL) : CFX_BasicArray(sizeof(TYPE), pAllocator) {}
-
- int GetSize() const
- {
- return m_nSize;
- }
-
- int GetUpperBound() const
- {
- return m_nSize - 1;
- }
-
- FX_BOOL SetSize(int nNewSize, int nGrowBy = -1)
- {
- return CFX_BasicArray::SetSize(nNewSize, nGrowBy);
- }
-
- void RemoveAll()
- {
- SetSize(0, -1);
- }
-
- const TYPE GetAt(int nIndex) const
- {
- if (nIndex < 0 || nIndex >= m_nSize) {
- return (const TYPE&)(*(volatile const TYPE*)NULL);
- }
- return ((const TYPE*)m_pData)[nIndex];
- }
-
- FX_BOOL SetAt(int nIndex, TYPE newElement)
- {
- if (nIndex < 0 || nIndex >= m_nSize) {
- return FALSE;
- }
- ((TYPE*)m_pData)[nIndex] = newElement;
- return TRUE;
- }
-
- TYPE& ElementAt(int nIndex)
- {
- if (nIndex < 0 || nIndex >= m_nSize) {
- return *(TYPE*)NULL;
- }
- return ((TYPE*)m_pData)[nIndex];
- }
-
- const TYPE* GetData() const
- {
- return (const TYPE*)m_pData;
- }
-
- TYPE* GetData()
- {
- return (TYPE*)m_pData;
- }
-
- FX_BOOL SetAtGrow(int nIndex, TYPE newElement)
- {
- if (nIndex < 0) {
- return FALSE;
- }
- if (nIndex >= m_nSize)
- if (!SetSize(nIndex + 1, -1)) {
- return FALSE;
- }
- ((TYPE*)m_pData)[nIndex] = newElement;
- return TRUE;
- }
-
- FX_BOOL Add(TYPE newElement)
- {
- if (m_nSize < m_nMaxSize) {
- m_nSize ++;
- } else if (!SetSize(m_nSize + 1, -1)) {
- return FALSE;
- }
- ((TYPE*)m_pData)[m_nSize - 1] = newElement;
- return TRUE;
- }
-
- FX_BOOL Append(const CFX_ArrayTemplate& src)
- {
- return CFX_BasicArray::Append(src);
- }
-
- FX_BOOL Copy(const CFX_ArrayTemplate& src)
- {
- return CFX_BasicArray::Copy(src);
- }
-
- TYPE* GetDataPtr(int index)
- {
- return (TYPE*)CFX_BasicArray::GetDataPtr(index);
- }
-
- TYPE* AddSpace()
- {
- return (TYPE*)CFX_BasicArray::InsertSpaceAt(m_nSize, 1);
- }
-
- TYPE* InsertSpaceAt(int nIndex, int nCount)
- {
- return (TYPE*)CFX_BasicArray::InsertSpaceAt(nIndex, nCount);
- }
-
- const TYPE operator[](int nIndex) const
- {
- if (nIndex < 0 || nIndex >= m_nSize) {
- *(volatile char*)0 = '\0';
- }
- return ((const TYPE*)m_pData)[nIndex];
- }
-
- TYPE& operator[](int nIndex)
- {
- if (nIndex < 0 || nIndex >= m_nSize) {
- *(volatile char*)0 = '\0';
- }
- return ((TYPE*)m_pData)[nIndex];
- }
-
- FX_BOOL InsertAt(int nIndex, TYPE newElement, int nCount = 1)
- {
- if (!InsertSpaceAt(nIndex, nCount)) {
- return FALSE;
- }
- while (nCount--) {
- ((TYPE*)m_pData)[nIndex++] = newElement;
- }
- return TRUE;
- }
-
- FX_BOOL RemoveAt(int nIndex, int nCount = 1)
- {
- return CFX_BasicArray::RemoveAt(nIndex, nCount);
- }
-
- FX_BOOL InsertAt(int nStartIndex, const CFX_BasicArray* pNewArray)
- {
- return CFX_BasicArray::InsertAt(nStartIndex, pNewArray);
- }
-
- int Find(TYPE data, int iStart = 0) const
- {
- if (iStart < 0) {
- return -1;
- }
- for (; iStart < (int)m_nSize; iStart ++)
- if (((TYPE*)m_pData)[iStart] == data) {
- return iStart;
- }
- return -1;
- }
-};
-typedef CFX_ArrayTemplate<FX_BYTE> CFX_ByteArray;
-typedef CFX_ArrayTemplate<FX_WORD> CFX_WordArray;
-typedef CFX_ArrayTemplate<FX_DWORD> CFX_DWordArray;
-typedef CFX_ArrayTemplate<void*> CFX_PtrArray;
-typedef CFX_ArrayTemplate<FX_FILESIZE> CFX_FileSizeArray;
-typedef CFX_ArrayTemplate<FX_FLOAT> CFX_FloatArray;
-typedef CFX_ArrayTemplate<FX_INT32> CFX_Int32Array;
-template <class ObjectClass>
-class CFX_ObjectArray : public CFX_BasicArray
-{
-public:
-
- CFX_ObjectArray(IFX_Allocator* pAllocator = NULL) : CFX_BasicArray(sizeof(ObjectClass), pAllocator) {}
-
- ~CFX_ObjectArray()
- {
- RemoveAll();
- }
-
- void Add(const ObjectClass& data)
- {
- new ((void*)InsertSpaceAt(m_nSize, 1)) ObjectClass(data);
- }
-
- ObjectClass& Add()
- {
- return *(ObjectClass*) new ((void*)InsertSpaceAt(m_nSize, 1)) ObjectClass();
- }
-
- void* AddSpace()
- {
- return InsertSpaceAt(m_nSize, 1);
- }
-
- FX_INT32 Append(const CFX_ObjectArray& src, FX_INT32 nStart = 0, FX_INT32 nCount = -1)
- {
- if (nCount == 0) {
- return 0;
- }
- FX_INT32 nSize = src.GetSize();
- if (!nSize) {
- return 0;
- }
- FXSYS_assert(nStart > -1 && nStart < nSize);
- if (nCount < 0) {
- nCount = nSize;
- }
- if (nStart + nCount > nSize) {
- nCount = nSize - nStart;
- }
- if (nCount < 1) {
- return 0;
- }
- nSize = m_nSize;
- InsertSpaceAt(m_nSize, nCount);
- ObjectClass* pStartObj = (ObjectClass*)GetDataPtr(nSize);
- nSize = nStart + nCount;
- for (FX_INT32 i = nStart; i < nSize; i ++, pStartObj++) {
- new ((void*)pStartObj) ObjectClass(src[i]);
- }
- return nCount;
- }
-
- FX_INT32 Copy(const CFX_ObjectArray& src, FX_INT32 nStart = 0, FX_INT32 nCount = -1)
- {
- if (nCount == 0) {
- return 0;
- }
- FX_INT32 nSize = src.GetSize();
- if (!nSize) {
- return 0;
- }
- FXSYS_assert(nStart > -1 && nStart < nSize);
- if (nCount < 0) {
- nCount = nSize;
- }
- if (nStart + nCount > nSize) {
- nCount = nSize - nStart;
- }
- if (nCount < 1) {
- return 0;
- }
- RemoveAll();
- SetSize(nCount, -1);
- ObjectClass* pStartObj = (ObjectClass*)m_pData;
- nSize = nStart + nCount;
- for (FX_INT32 i = nStart; i < nSize; i ++, pStartObj++) {
- new ((void*)pStartObj) ObjectClass(src[i]);
- }
- return nCount;
- }
-
- int GetSize() const
- {
- return m_nSize;
- }
-
- ObjectClass& operator[] (int index) const
- {
- FXSYS_assert(index < m_nSize);
- return *(ObjectClass*)CFX_BasicArray::GetDataPtr(index);
- }
-
- ObjectClass* GetDataPtr(int index)
- {
- return (ObjectClass*)CFX_BasicArray::GetDataPtr(index);
- }
-
- void RemoveAt(int index)
- {
- FXSYS_assert(index < m_nSize);
- ((ObjectClass*)GetDataPtr(index))->~ObjectClass();
- CFX_BasicArray::RemoveAt(index, 1);
- }
-
- void RemoveAll()
- {
- for (int i = 0; i < m_nSize; i ++) {
- ((ObjectClass*)GetDataPtr(i))->~ObjectClass();
- }
- CFX_BasicArray::SetSize(0, -1);
- }
-};
-typedef CFX_ObjectArray<CFX_ByteString> CFX_ByteStringArray;
-typedef CFX_ObjectArray<CFX_WideString> CFX_WideStringArray;
-class CFX_BaseSegmentedArray : public CFX_Object
-{
-public:
-
- CFX_BaseSegmentedArray(int unit_size = 1, int segment_units = 512, int index_size = 8, IFX_Allocator* pAllocator = NULL);
-
- ~CFX_BaseSegmentedArray();
-
- void SetUnitSize(int unit_size, int segment_units, int index_size = 8);
-
- void* Add();
-
- void* GetAt(int index) const;
-
- void RemoveAll();
-
- void Delete(int index, int count = 1);
-
- int GetSize() const
- {
- return m_DataSize;
- }
-
- int GetSegmentSize() const
- {
- return m_SegmentSize;
- }
-
- int GetUnitSize() const
- {
- return m_UnitSize;
- }
-
- void* Iterate(FX_BOOL (*callback)(void* param, void* pData), void* param) const;
-
- IFX_Allocator* m_pAllocator;
-private:
-
- int m_UnitSize;
-
- short m_SegmentSize;
-
- FX_BYTE m_IndexSize;
-
- FX_BYTE m_IndexDepth;
-
- int m_DataSize;
-
- void* m_pIndex;
- void** GetIndex(int seg_index) const;
- void* IterateIndex(int level, int& start, void** pIndex, FX_BOOL (*callback)(void* param, void* pData), void* param) const;
- void* IterateSegment(FX_LPCBYTE pSegment, int count, FX_BOOL (*callback)(void* param, void* pData), void* param) const;
-};
-template <class ElementType>
-class CFX_SegmentedArray : public CFX_BaseSegmentedArray
-{
-public:
-
- CFX_SegmentedArray(int segment_units, int index_size = 8, IFX_Allocator* pAllocator = NULL)
- : CFX_BaseSegmentedArray(sizeof(ElementType), segment_units, index_size, pAllocator)
- {}
-
- void Add(ElementType data)
- {
- *(ElementType*)CFX_BaseSegmentedArray::Add() = data;
- }
-
- ElementType& operator [] (int index)
- {
- return *(ElementType*)CFX_BaseSegmentedArray::GetAt(index);
- }
-};
-template <class DataType, int FixedSize>
-class CFX_FixedBufGrow : public CFX_Object
-{
-public:
- CFX_FixedBufGrow(IFX_Allocator* pAllocator = NULL)
- : m_pAllocator(pAllocator)
- , m_pData(NULL)
- {}
- CFX_FixedBufGrow(int data_size, IFX_Allocator* pAllocator = NULL)
- : m_pAllocator(pAllocator)
- , m_pData(NULL)
- {
- if (data_size > FixedSize) {
- m_pData = FX_Allocator_Alloc(m_pAllocator, DataType, data_size);
- } else {
- FXSYS_memset32(m_Data, 0, sizeof(DataType)*FixedSize);
- }
- }
- void SetDataSize(int data_size)
- {
- if (m_pData) {
- FX_Allocator_Free(m_pAllocator, m_pData);
- }
- m_pData = NULL;
- if (data_size > FixedSize) {
- m_pData = FX_Allocator_Alloc(m_pAllocator, DataType, data_size);
- } else {
- FXSYS_memset32(m_Data, 0, sizeof(DataType)*FixedSize);
- }
- }
- ~CFX_FixedBufGrow()
- {
- if (m_pData) {
- FX_Allocator_Free(m_pAllocator, m_pData);
- }
- }
- operator DataType*()
- {
- return m_pData ? m_pData : m_Data;
- }
-private:
- IFX_Allocator* m_pAllocator;
- DataType m_Data[FixedSize];
- DataType* m_pData;
-};
-template <class DataType>
-class CFX_TempBuf
-{
-public:
- CFX_TempBuf(int size, IFX_Allocator* pAllocator = NULL) : m_pAllocator(pAllocator)
- {
- m_pData = FX_Allocator_Alloc(m_pAllocator, DataType, size);
- }
- ~CFX_TempBuf()
- {
- if (m_pData) {
- FX_Allocator_Free(m_pAllocator, m_pData);
- }
- }
- DataType& operator[](int i)
- {
- FXSYS_assert(m_pData != NULL);
- return m_pData[i];
- }
- operator DataType*()
- {
- return m_pData;
- }
-private:
- IFX_Allocator* m_pAllocator;
- DataType* m_pData;
-};
-class CFX_MapPtrToPtr : public CFX_Object
-{
-protected:
-
- struct CAssoc {
-
- CAssoc* pNext;
-
- void* key;
-
- void* value;
- };
-public:
-
- CFX_MapPtrToPtr(int nBlockSize = 10, IFX_Allocator* pAllocator = NULL);
-
- ~CFX_MapPtrToPtr();
-
- int GetCount() const
- {
- return m_nCount;
- }
-
- FX_BOOL IsEmpty() const
- {
- return m_nCount == 0;
- }
-
- FX_BOOL Lookup(void* key, void*& rValue) const;
-
- void* GetValueAt(void* key) const;
-
- void*& operator[](void* key);
-
- void SetAt(void* key, void* newValue)
- {
- (*this)[key] = newValue;
- }
-
- FX_BOOL RemoveKey(void* key);
-
- void RemoveAll();
-
- FX_POSITION GetStartPosition() const
- {
- return (m_nCount == 0) ? NULL : (FX_POSITION) - 1;
- }
-
- void GetNextAssoc(FX_POSITION& rNextPosition, void*& rKey, void*& rValue) const;
-
- FX_DWORD GetHashTableSize() const
- {
- return m_nHashTableSize;
- }
-
- void InitHashTable(FX_DWORD hashSize, FX_BOOL bAllocNow = TRUE);
-protected:
-
- IFX_Allocator* m_pAllocator;
-
- CAssoc** m_pHashTable;
-
- FX_DWORD m_nHashTableSize;
-
- int m_nCount;
-
- CAssoc* m_pFreeList;
-
- struct CFX_Plex* m_pBlocks;
-
- int m_nBlockSize;
-
- FX_DWORD HashKey(void* key) const;
-
- CAssoc* NewAssoc();
-
- void FreeAssoc(CAssoc* pAssoc);
-
- CAssoc* GetAssocAt(void* key, FX_DWORD& hash) const;
-};
-template <class KeyType, class ValueType>
-class CFX_MapPtrTemplate : public CFX_MapPtrToPtr
-{
-public:
-
- CFX_MapPtrTemplate(IFX_Allocator* pAllocator = NULL) : CFX_MapPtrToPtr(10, pAllocator) {}
-
- FX_BOOL Lookup(KeyType key, ValueType& rValue) const
- {
- FX_LPVOID pValue = NULL;
- if (!CFX_MapPtrToPtr::Lookup((void*)(FX_UINTPTR)key, pValue)) {
- return FALSE;
- }
- rValue = (ValueType)(FX_UINTPTR)pValue;
- return TRUE;
- }
-
- ValueType& operator[](KeyType key)
- {
- return (ValueType&)CFX_MapPtrToPtr::operator []((void*)(FX_UINTPTR)key);
- }
-
- void SetAt(KeyType key, ValueType newValue)
- {
- CFX_MapPtrToPtr::SetAt((void*)(FX_UINTPTR)key, (void*)(FX_UINTPTR)newValue);
- }
-
- FX_BOOL RemoveKey(KeyType key)
- {
- return CFX_MapPtrToPtr::RemoveKey((void*)(FX_UINTPTR)key);
- }
-
- void GetNextAssoc(FX_POSITION& rNextPosition, KeyType& rKey, ValueType& rValue) const
- {
- void* pKey = NULL;
- void* pValue = NULL;
- CFX_MapPtrToPtr::GetNextAssoc(rNextPosition, pKey, pValue);
- rKey = (KeyType)(FX_UINTPTR)pKey;
- rValue = (ValueType)(FX_UINTPTR)pValue;
- }
-};
-class CFX_CMapDWordToDWord : public CFX_Object
-{
-public:
-
- CFX_CMapDWordToDWord(IFX_Allocator* pAllocator = NULL) : m_Buffer(pAllocator) {}
-
- FX_BOOL Lookup(FX_DWORD key, FX_DWORD& value) const;
-
- void SetAt(FX_DWORD key, FX_DWORD value);
-
- void EstimateSize(FX_DWORD size, FX_DWORD grow_by);
-
- FX_POSITION GetStartPosition() const;
-
- void GetNextAssoc(FX_POSITION& pos, FX_DWORD& key, FX_DWORD& value) const;
-protected:
-
- CFX_BinaryBuf m_Buffer;
-};
-class CFX_MapByteStringToPtr : public CFX_Object
-{
-protected:
-
- struct CAssoc {
-
- CAssoc* pNext;
-
- FX_DWORD nHashValue;
-
- CFX_ByteString key;
-
- void* value;
- };
-public:
-
- CFX_MapByteStringToPtr(int nBlockSize = 10, IFX_Allocator* pAllocator = NULL);
-
- int GetCount() const
- {
- return m_nCount;
- }
-
- FX_BOOL IsEmpty() const
- {
- return m_nCount == 0;
- }
-
- FX_BOOL Lookup(FX_BSTR key, void*& rValue) const;
-
- void*& operator[](FX_BSTR key);
-
- void SetAt(FX_BSTR key, void* newValue)
- {
- (*this)[key] = newValue;
- }
-
- FX_BOOL RemoveKey(FX_BSTR key);
-
- void RemoveAll();
-
- FX_POSITION GetStartPosition() const
- {
- return (m_nCount == 0) ? NULL : (FX_POSITION) - 1;
- }
-
- void GetNextAssoc(FX_POSITION& rNextPosition, CFX_ByteString& rKey, void*& rValue) const;
-
- FX_LPVOID GetNextValue(FX_POSITION& rNextPosition) const;
-
- FX_DWORD GetHashTableSize() const
- {
- return m_nHashTableSize;
- }
-
- void InitHashTable(FX_DWORD hashSize, FX_BOOL bAllocNow = TRUE);
-
- FX_DWORD HashKey(FX_BSTR key) const;
-protected:
-
- IFX_Allocator* m_pAllocator;
-
- CAssoc** m_pHashTable;
-
- FX_DWORD m_nHashTableSize;
-
- int m_nCount;
-
- CAssoc* m_pFreeList;
-
- struct CFX_Plex* m_pBlocks;
-
- int m_nBlockSize;
-
- CAssoc* NewAssoc();
-
- void FreeAssoc(CAssoc* pAssoc);
-
- CAssoc* GetAssocAt(FX_BSTR key, FX_DWORD& hash) const;
-public:
-
- ~CFX_MapByteStringToPtr();
-};
-class CFX_CMapByteStringToPtr : public CFX_Object
-{
-public:
-
- CFX_CMapByteStringToPtr(IFX_Allocator* pAllocator = NULL);
-
- ~CFX_CMapByteStringToPtr();
-
- void RemoveAll();
-
- FX_POSITION GetStartPosition() const;
-
- void GetNextAssoc(FX_POSITION& rNextPosition, CFX_ByteString& rKey, void*& rValue) const;
-
- FX_LPVOID GetNextValue(FX_POSITION& rNextPosition) const;
-
- FX_BOOL Lookup(FX_BSTR key, void*& rValue) const;
-
- void SetAt(FX_BSTR key, void* value);
-
- void RemoveKey(FX_BSTR key);
-
- int GetCount() const;
-
- void AddValue(FX_BSTR key, void* pValue);
-private:
-
- CFX_BaseSegmentedArray m_Buffer;
-};
-class CFX_PtrList : public CFX_Object
-{
-protected:
-
- struct CNode {
-
- CNode* pNext;
-
- CNode* pPrev;
-
- void* data;
- };
-public:
-
- CFX_PtrList(int nBlockSize = 10, IFX_Allocator* pAllocator = NULL);
-
- FX_POSITION GetHeadPosition() const
- {
- return (FX_POSITION)m_pNodeHead;
- }
-
- FX_POSITION GetTailPosition() const
- {
- return (FX_POSITION)m_pNodeTail;
- }
-
- void* GetNext(FX_POSITION& rPosition) const
- {
- CNode* pNode = (CNode*) rPosition;
- rPosition = (FX_POSITION) pNode->pNext;
- return pNode->data;
- }
-
- void* GetPrev(FX_POSITION& rPosition) const
- {
- CNode* pNode = (CNode*) rPosition;
- rPosition = (FX_POSITION) pNode->pPrev;
- return pNode->data;
- }
-
- FX_POSITION GetNextPosition(FX_POSITION pos) const
- {
- return ((CNode*)pos)->pNext;
- }
-
- FX_POSITION GetPrevPosition(FX_POSITION pos) const
- {
- return ((CNode*)pos)->pPrev;
- }
-
- void* GetAt(FX_POSITION rPosition) const
- {
- CNode* pNode = (CNode*) rPosition;
- return pNode->data;
- }
-
- int GetCount() const
- {
- return m_nCount;
- }
-
- FX_POSITION AddTail(void* newElement);
-
- FX_POSITION AddHead(void* newElement);
-
- void SetAt(FX_POSITION pos, void* newElement)
- {
- CNode* pNode = (CNode*) pos;
- pNode->data = newElement;
- }
-
- FX_POSITION InsertAfter(FX_POSITION pos, void* newElement);
-
- FX_POSITION Find(void* searchValue, FX_POSITION startAfter = NULL ) const;
-
- FX_POSITION FindIndex(int index) const;
-
- void RemoveAt(FX_POSITION pos);
-
- void RemoveAll();
-protected:
-
- IFX_Allocator* m_pAllocator;
-
- CNode* m_pNodeHead;
-
- CNode* m_pNodeTail;
-
- int m_nCount;
-
- CNode* m_pNodeFree;
-
- struct CFX_Plex* m_pBlocks;
-
- int m_nBlockSize;
-
- CNode* NewNode(CNode* pPrev, CNode* pNext);
-
- void FreeNode(CNode* pNode);
-public:
-
- ~CFX_PtrList();
-};
-typedef void (*PD_CALLBACK_FREEDATA)(FX_LPVOID pData);
-struct FX_PRIVATEDATA {
-
- void FreeData();
-
- FX_LPVOID m_pModuleId;
-
- FX_LPVOID m_pData;
-
- PD_CALLBACK_FREEDATA m_pCallback;
-
- FX_BOOL m_bSelfDestruct;
-};
-class CFX_PrivateData
-{
-public:
-
- CFX_PrivateData(IFX_Allocator* pAllocator = NULL) : m_DataList(pAllocator) {}
-
- ~CFX_PrivateData();
-
- void ClearAll();
-
- void SetPrivateData(FX_LPVOID module_id, FX_LPVOID pData, PD_CALLBACK_FREEDATA callback);
-
- void SetPrivateObj(FX_LPVOID module_id, CFX_DestructObject* pObj);
-
- FX_LPVOID GetPrivateData(FX_LPVOID module_id);
-
- FX_BOOL LookupPrivateData(FX_LPVOID module_id, FX_LPVOID &pData) const
- {
- if (!module_id) {
- return FALSE;
- }
- FX_DWORD nCount = m_DataList.GetSize();
- for (FX_DWORD n = 0; n < nCount; n ++) {
- if (m_DataList[n].m_pModuleId == module_id) {
- pData = m_DataList[n].m_pData;
- return TRUE;
- }
- }
- return FALSE;
- }
-
- FX_BOOL RemovePrivateData(FX_LPVOID module_id);
-protected:
-
- CFX_ArrayTemplate<FX_PRIVATEDATA> m_DataList;
-
- void AddData(FX_LPVOID module_id, FX_LPVOID pData, PD_CALLBACK_FREEDATA callback, FX_BOOL bSelfDestruct);
-};
-class CFX_BitStream : public CFX_Object
-{
-public:
-
- void Init(FX_LPCBYTE pData, FX_DWORD dwSize);
-
-
- FX_DWORD GetBits(FX_DWORD nBits);
-
- void ByteAlign();
-
- FX_BOOL IsEOF()
- {
- return m_BitPos >= m_BitSize;
- }
-
- void SkipBits(FX_DWORD nBits)
- {
- m_BitPos += nBits;
- }
-
- void Rewind()
- {
- m_BitPos = 0;
- }
-protected:
-
- FX_DWORD m_BitPos;
-
- FX_DWORD m_BitSize;
-
- FX_LPCBYTE m_pData;
-};
-template <class ObjClass> class CFX_CountRef : public CFX_Object
-{
-public:
-
- typedef CFX_CountRef<ObjClass> Ref;
-
- class CountedObj : public ObjClass
- {
- public:
-
- CountedObj() {}
-
- CountedObj(const CountedObj& src) : ObjClass(src) {}
-
- int m_RefCount;
- };
-
- CFX_CountRef()
- {
- m_pObject = NULL;
- }
-
- CFX_CountRef(const Ref& ref)
- {
- m_pObject = ref.m_pObject;
- if (m_pObject) {
- m_pObject->m_RefCount ++;
- }
- }
-
- ~CFX_CountRef()
- {
- if (!m_pObject) {
- return;
- }
- m_pObject->m_RefCount --;
- if (m_pObject->m_RefCount <= 0) {
- delete m_pObject;
- }
- }
-
- ObjClass* New()
- {
- if (m_pObject) {
- m_pObject->m_RefCount --;
- if (m_pObject->m_RefCount <= 0) {
- delete m_pObject;
- }
- m_pObject = NULL;
- }
- m_pObject = FX_NEW CountedObj;
- if (!m_pObject) {
- return NULL;
- }
- m_pObject->m_RefCount = 1;
- return m_pObject;
- }
-
- void operator = (const Ref& ref)
- {
- if (ref.m_pObject) {
- ref.m_pObject->m_RefCount ++;
- }
- if (m_pObject) {
- m_pObject->m_RefCount --;
- if (m_pObject->m_RefCount <= 0) {
- delete m_pObject;
- }
- }
- m_pObject = ref.m_pObject;
- }
-
- void operator = (void* p)
- {
- FXSYS_assert(p == 0);
- if (m_pObject == NULL) {
- return;
- }
- m_pObject->m_RefCount --;
- if (m_pObject->m_RefCount <= 0) {
- delete m_pObject;
- }
- m_pObject = NULL;
- }
-
- const ObjClass* GetObject() const
- {
- return m_pObject;
- }
-
- operator const ObjClass*() const
- {
- return m_pObject;
- }
-
- FX_BOOL IsNull() const
- {
- return m_pObject == NULL;
- }
-
- FX_BOOL NotNull() const
- {
- return m_pObject != NULL;
- }
-
- ObjClass* GetModify()
- {
- if (m_pObject == NULL) {
- m_pObject = FX_NEW CountedObj;
- if (m_pObject) {
- m_pObject->m_RefCount = 1;
- }
- } else if (m_pObject->m_RefCount > 1) {
- m_pObject->m_RefCount --;
- CountedObj* pOldObject = m_pObject;
- m_pObject = NULL;
- m_pObject = FX_NEW CountedObj(*pOldObject);
- if (m_pObject) {
- m_pObject->m_RefCount = 1;
- }
- }
- return m_pObject;
- }
-
- void SetNull()
- {
- if (m_pObject == NULL) {
- return;
- }
- m_pObject->m_RefCount --;
- if (m_pObject->m_RefCount <= 0) {
- delete m_pObject;
- }
- m_pObject = NULL;
- }
-
- FX_BOOL operator == (const Ref& ref) const
- {
- return m_pObject == ref.m_pObject;
- }
-protected:
-
- CountedObj* m_pObject;
-};
-class IFX_Pause
-{
-public:
-
- virtual FX_BOOL NeedToPauseNow() = 0;
-};
-class CFX_DataFilter : public CFX_Object
-{
-public:
-
- virtual ~CFX_DataFilter();
-
- void SetDestFilter(CFX_DataFilter* pFilter);
-
- FX_BOOL IsEOF() const
- {
- return m_bEOF;
- }
-
- FX_DWORD GetSrcPos()
- {
- return m_SrcPos;
- }
-
- void FilterIn(FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf);
-
- void FilterFinish(CFX_BinaryBuf& dest_buf);
-protected:
-
- CFX_DataFilter();
- virtual void v_FilterIn(FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf) = 0;
- virtual void v_FilterFinish(CFX_BinaryBuf& dest_buf) = 0;
- void ReportEOF(FX_DWORD left_input);
-
- FX_BOOL m_bEOF;
-
- FX_DWORD m_SrcPos;
-
- CFX_DataFilter* m_pDestFilter;
-};
-template <class T>
-class CFX_SmartPointer
-{
-public:
- CFX_SmartPointer(T *pObj) : m_pObj(pObj) {}
- ~CFX_SmartPointer()
- {
- m_pObj->Release();
- }
- operator T*(void)
- {
- return m_pObj;
- }
- T& operator *(void)
- {
- return *m_pObj;
- }
- T* operator ->(void)
- {
- return m_pObj;
- }
-protected:
- T *m_pObj;
-};
-#define FX_DATALIST_LENGTH 1024
-template<size_t unit>
-class CFX_SortListArray : public CFX_Object
-{
-protected:
-
- struct DataList {
-
- FX_INT32 start;
-
- FX_INT32 count;
- FX_LPBYTE data;
- };
-public:
-
- CFX_SortListArray(IFX_Allocator* pAllocator = NULL) : m_CurList(0), m_DataLists(pAllocator) {}
-
- ~CFX_SortListArray()
- {
- Clear();
- }
-
-
- void Clear()
- {
- IFX_Allocator* pAllocator = m_DataLists.m_pAllocator;
- for (FX_INT32 i = m_DataLists.GetUpperBound(); i >= 0; i--) {
- DataList list = m_DataLists.ElementAt(i);
- if (list.data) {
- FX_Allocator_Free(pAllocator, list.data);
- }
- }
- m_DataLists.RemoveAll();
- m_CurList = 0;
- }
-
- void Append(FX_INT32 nStart, FX_INT32 nCount)
- {
- if (nStart < 0) {
- return;
- }
- IFX_Allocator* pAllocator = m_DataLists.m_pAllocator;
- while (nCount > 0) {
- FX_INT32 temp_count = FX_MIN(nCount, FX_DATALIST_LENGTH);
- DataList list;
- list.data = FX_Allocator_Alloc(pAllocator, FX_BYTE, temp_count * unit);
- if (!list.data) {
- break;
- }
- FXSYS_memset32(list.data, 0, temp_count * unit);
- list.start = nStart;
- list.count = temp_count;
- Append(list);
- nCount -= temp_count;
- nStart += temp_count;
- }
- }
-
- FX_LPBYTE GetAt(FX_INT32 nIndex)
- {
- if (nIndex < 0) {
- return NULL;
- }
- if (m_CurList < 0 || m_CurList >= m_DataLists.GetSize()) {
- return NULL;
- }
- DataList *pCurList = m_DataLists.GetDataPtr(m_CurList);
- if (!pCurList || nIndex < pCurList->start || nIndex >= pCurList->start + pCurList->count) {
- pCurList = NULL;
- FX_INT32 iStart = 0;
- FX_INT32 iEnd = m_DataLists.GetUpperBound();
- FX_INT32 iMid = 0;
- while (iStart <= iEnd) {
- iMid = (iStart + iEnd) / 2;
- DataList* list = m_DataLists.GetDataPtr(iMid);
- if (nIndex < list->start) {
- iEnd = iMid - 1;
- } else if (nIndex >= list->start + list->count) {
- iStart = iMid + 1;
- } else {
- pCurList = list;
- m_CurList = iMid;
- break;
- }
- }
- }
- return pCurList ? pCurList->data + (nIndex - pCurList->start) * unit : NULL;
- }
-protected:
- void Append(const DataList& list)
- {
- FX_INT32 iStart = 0;
- FX_INT32 iEnd = m_DataLists.GetUpperBound();
- FX_INT32 iFind = 0;
- while (iStart <= iEnd) {
- FX_INT32 iMid = (iStart + iEnd) / 2;
- DataList* cur_list = m_DataLists.GetDataPtr(iMid);
- if (list.start < cur_list->start + cur_list->count) {
- iEnd = iMid - 1;
- } else {
- if (iMid == iEnd) {
- iFind = iMid + 1;
- break;
- }
- DataList* next_list = m_DataLists.GetDataPtr(iMid + 1);
- if (list.start < next_list->start) {
- iFind = iMid + 1;
- break;
- } else {
- iStart = iMid + 1;
- }
- }
- }
- m_DataLists.InsertAt(iFind, list);
- }
- FX_INT32 m_CurList;
- CFX_ArrayTemplate<DataList> m_DataLists;
-};
-template<typename T1, typename T2>
-class CFX_ListArrayTemplate : public CFX_Object
-{
-public:
-
- void Clear()
- {
- m_Data.Clear();
- }
-
- void Add(FX_INT32 nStart, FX_INT32 nCount)
- {
- m_Data.Append(nStart, nCount);
- }
-
- T2& operator [] (FX_INT32 nIndex)
- {
- FX_LPBYTE data = m_Data.GetAt(nIndex);
- FXSYS_assert(data != NULL);
- return (T2&)(*(volatile T2*)data);
- }
-
- T2* GetPtrAt(FX_INT32 nIndex)
- {
- return (T2*)m_Data.GetAt(nIndex);
- }
-protected:
- T1 m_Data;
-};
-typedef CFX_ListArrayTemplate<CFX_SortListArray<sizeof(FX_FILESIZE)>, FX_FILESIZE> CFX_FileSizeListArray;
-typedef CFX_ListArrayTemplate<CFX_SortListArray<sizeof(FX_DWORD)>, FX_DWORD> CFX_DWordListArray;
-typedef enum {
- Ready,
- ToBeContinued,
- Found,
- NotFound,
- Failed,
- Done
-} FX_ProgressiveStatus;
-#define ProgressiveStatus FX_ProgressiveStatus
-#define FX_NAMESPACE_DECLARE(namespace, type) namespace::type
-#endif
+// 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 _FX_BASIC_H_
+#define _FX_BASIC_H_
+#ifndef _FX_SYSTEM_H_
+#include "fx_system.h"
+#endif
+#ifndef _FX_MEMORY_H_
+#include "fx_memory.h"
+#endif
+#ifndef _FX_STRING_H_
+#include "fx_string.h"
+#endif
+#ifndef _FX_STREAM_H_
+#include "fx_stream.h"
+#endif
+class CFX_BinaryBuf : public CFX_Object
+{
+public:
+
+ CFX_BinaryBuf(IFX_Allocator* pAllocator = NULL);
+
+ CFX_BinaryBuf(FX_STRSIZE size, IFX_Allocator* pAllocator = NULL);
+
+ ~CFX_BinaryBuf();
+
+ void Clear();
+
+ void EstimateSize(FX_STRSIZE size, FX_STRSIZE alloc_step = 0);
+
+ void AppendBlock(const void* pBuf, FX_STRSIZE size);
+
+ void AppendFill(FX_BYTE byte, FX_STRSIZE count);
+
+ void AppendString(FX_BSTR str)
+ {
+ AppendBlock(str.GetPtr(), str.GetLength());
+ }
+
+ inline void AppendByte(FX_BYTE byte)
+ {
+ if (m_AllocSize <= m_DataSize) {
+ ExpandBuf(1);
+ }
+ m_pBuffer[m_DataSize++] = byte;
+ }
+
+ void InsertBlock(FX_STRSIZE pos, const void* pBuf, FX_STRSIZE size);
+
+ void AttachData(void* pBuf, FX_STRSIZE size);
+
+ void CopyData(const void* pBuf, FX_STRSIZE size);
+
+ void TakeOver(CFX_BinaryBuf& other);
+
+ void Delete(int start_index, int count);
+
+ FX_LPBYTE GetBuffer() const
+ {
+ return m_pBuffer;
+ }
+
+ FX_STRSIZE GetSize() const
+ {
+ return m_DataSize;
+ }
+
+ CFX_ByteStringC GetByteString() const;
+ void GetByteStringL(CFX_ByteStringL &str) const;
+
+ void DetachBuffer();
+
+ IFX_Allocator* m_pAllocator;
+protected:
+
+ FX_STRSIZE m_AllocStep;
+
+ FX_LPBYTE m_pBuffer;
+
+ FX_STRSIZE m_DataSize;
+
+ FX_STRSIZE m_AllocSize;
+
+ void ExpandBuf(FX_STRSIZE size);
+};
+class CFX_ByteTextBuf : public CFX_BinaryBuf
+{
+public:
+
+ CFX_ByteTextBuf(IFX_Allocator* pAllocator = NULL) : CFX_BinaryBuf(pAllocator) {}
+
+ void operator = (FX_BSTR str);
+
+ void AppendChar(int ch)
+ {
+ AppendByte((FX_BYTE)ch);
+ }
+
+ CFX_ByteTextBuf& operator << (int i);
+
+ CFX_ByteTextBuf& operator << (FX_DWORD i);
+
+ CFX_ByteTextBuf& operator << (double f);
+
+ CFX_ByteTextBuf& operator << (FX_BSTR lpsz);
+
+ CFX_ByteTextBuf& operator << (const CFX_ByteTextBuf& buf);
+
+ FX_STRSIZE GetLength() const
+ {
+ return m_DataSize;
+ }
+};
+class CFX_WideTextBuf : public CFX_BinaryBuf
+{
+public:
+
+ CFX_WideTextBuf(IFX_Allocator* pAllocator = NULL) : CFX_BinaryBuf(pAllocator) {}
+
+ void operator = (FX_LPCWSTR lpsz);
+
+ void operator = (FX_WSTR str);
+
+ void AppendChar(FX_WCHAR wch);
+
+ CFX_WideTextBuf& operator << (int i);
+
+ CFX_WideTextBuf& operator << (double f);
+
+ CFX_WideTextBuf& operator << (FX_LPCWSTR lpsz);
+
+ CFX_WideTextBuf& operator << (FX_WSTR str);
+ CFX_WideTextBuf& operator << (const CFX_WideString &str);
+
+ CFX_WideTextBuf& operator << (const CFX_WideTextBuf& buf);
+
+ FX_STRSIZE GetLength() const
+ {
+ return m_DataSize / sizeof(FX_WCHAR);
+ }
+
+ FX_LPWSTR GetBuffer() const
+ {
+ return (FX_LPWSTR)m_pBuffer;
+ }
+
+ void Delete(int start_index, int count)
+ {
+ CFX_BinaryBuf::Delete(start_index * sizeof(FX_WCHAR), count * sizeof(FX_WCHAR));
+ }
+
+ CFX_WideStringC GetWideString() const;
+ void GetWideStringL(CFX_WideStringL& wideText) const;
+};
+class CFX_ArchiveSaver : public CFX_Object
+{
+public:
+
+ CFX_ArchiveSaver(IFX_Allocator* pAllocator = NULL) : m_SavingBuf(pAllocator), m_pStream(NULL) {}
+
+ CFX_ArchiveSaver& operator << (FX_BYTE i);
+
+ CFX_ArchiveSaver& operator << (int i);
+
+ CFX_ArchiveSaver& operator << (FX_DWORD i);
+
+ CFX_ArchiveSaver& operator << (FX_FLOAT i);
+
+ CFX_ArchiveSaver& operator << (double i);
+
+ CFX_ArchiveSaver& operator << (FX_BSTR bstr);
+
+ CFX_ArchiveSaver& operator << (FX_LPCWSTR bstr);
+
+ CFX_ArchiveSaver& operator << (const CFX_WideString& wstr);
+
+ void Write(const void* pData, FX_STRSIZE dwSize);
+
+ FX_INTPTR GetLength()
+ {
+ return m_SavingBuf.GetSize();
+ }
+
+ FX_LPCBYTE GetBuffer()
+ {
+ return m_SavingBuf.GetBuffer();
+ }
+
+ void SetStream(IFX_FileStream* pStream)
+ {
+ m_pStream = pStream;
+ }
+protected:
+
+ CFX_BinaryBuf m_SavingBuf;
+
+ IFX_FileStream* m_pStream;
+};
+class CFX_ArchiveLoader : public CFX_Object
+{
+public:
+
+ CFX_ArchiveLoader(FX_LPCBYTE pData, FX_DWORD dwSize);
+
+ CFX_ArchiveLoader& operator >> (FX_BYTE& i);
+
+ CFX_ArchiveLoader& operator >> (int& i);
+
+ CFX_ArchiveLoader& operator >> (FX_DWORD& i);
+
+ CFX_ArchiveLoader& operator >> (FX_FLOAT& i);
+
+ CFX_ArchiveLoader& operator >> (double& i);
+
+ CFX_ArchiveLoader& operator >> (CFX_ByteString& bstr);
+
+ CFX_ArchiveLoader& operator >> (CFX_WideString& wstr);
+
+ FX_BOOL IsEOF();
+
+ FX_BOOL Read(void* pBuf, FX_DWORD dwSize);
+protected:
+
+ FX_DWORD m_LoadingPos;
+
+ FX_LPCBYTE m_pLoadingBuf;
+
+ FX_DWORD m_LoadingSize;
+};
+class IFX_BufferArchive
+{
+public:
+
+ IFX_BufferArchive(FX_STRSIZE size, IFX_Allocator* pAllocator = NULL);
+
+
+ virtual void Clear();
+
+
+ FX_BOOL Flush();
+
+
+ FX_INT32 AppendBlock(const void* pBuf, size_t size);
+
+ FX_INT32 AppendByte(FX_BYTE byte);
+
+ FX_INT32 AppendDWord(FX_DWORD i);
+
+
+ FX_INT32 AppendString(FX_BSTR lpsz);
+
+protected:
+
+ virtual FX_BOOL DoWork(const void* pBuf, size_t size) = 0;
+
+
+ IFX_Allocator* m_pAllocator;
+
+ FX_STRSIZE m_BufSize;
+
+ FX_LPBYTE m_pBuffer;
+
+ FX_STRSIZE m_Length;
+};
+class CFX_FileBufferArchive : public IFX_BufferArchive, public CFX_Object
+{
+public:
+ CFX_FileBufferArchive(FX_STRSIZE size = 32768, IFX_Allocator* pAllocator = NULL);
+ ~CFX_FileBufferArchive();
+ virtual void Clear();
+
+ FX_BOOL AttachFile(IFX_StreamWrite *pFile, FX_BOOL bTakeover = FALSE);
+
+ FX_BOOL AttachFile(FX_LPCWSTR filename);
+
+ FX_BOOL AttachFile(FX_LPCSTR filename);
+private:
+
+ virtual FX_BOOL DoWork(const void* pBuf, size_t size);
+
+ IFX_StreamWrite *m_pFile;
+
+ FX_BOOL m_bTakeover;
+};
+struct CFX_CharMap {
+
+ static CFX_CharMap* GetDefaultMapper(FX_INT32 codepage = 0);
+
+
+ CFX_WideString (*m_GetWideString)(CFX_CharMap* pMap, const CFX_ByteString& bstr);
+
+ CFX_ByteString (*m_GetByteString)(CFX_CharMap* pMap, const CFX_WideString& wstr);
+
+ FX_INT32 (*m_GetCodePage)();
+};
+class CFX_UTF8Decoder
+{
+public:
+
+ CFX_UTF8Decoder(IFX_Allocator* pAllocator = NULL) : m_Buffer(pAllocator)
+ {
+ m_PendingBytes = 0;
+ }
+
+ void Clear();
+
+ void Input(FX_BYTE byte);
+
+ void AppendChar(FX_DWORD ch);
+
+ void ClearStatus()
+ {
+ m_PendingBytes = 0;
+ }
+
+ CFX_WideStringC GetResult() const
+ {
+ return m_Buffer.GetWideString();
+ }
+ void GetResult(CFX_WideStringL &result) const
+ {
+ m_Buffer.GetWideStringL(result);
+ }
+protected:
+
+ int m_PendingBytes;
+
+ FX_DWORD m_PendingChar;
+
+ CFX_WideTextBuf m_Buffer;
+};
+class CFX_UTF8Encoder
+{
+public:
+
+ CFX_UTF8Encoder(IFX_Allocator* pAllocator = NULL) : m_Buffer(pAllocator)
+ {
+ m_UTF16First = 0;
+ }
+
+ void Input(FX_WCHAR unicode);
+
+ void AppendStr(FX_BSTR str)
+ {
+ m_UTF16First = 0;
+ m_Buffer << str;
+ }
+
+ CFX_ByteStringC GetResult() const
+ {
+ return m_Buffer.GetByteString();
+ }
+ void GetResult(CFX_ByteStringL &result) const
+ {
+ m_Buffer.GetByteStringL(result);
+ }
+protected:
+
+ CFX_ByteTextBuf m_Buffer;
+
+ FX_DWORD m_UTF16First;
+};
+CFX_ByteString FX_UrlEncode(const CFX_WideString& wsUrl);
+CFX_WideString FX_UrlDecode(const CFX_ByteString& bsUrl);
+CFX_ByteString FX_EncodeURI(const CFX_WideString& wsURI);
+CFX_WideString FX_DecodeURI(const CFX_ByteString& bsURI);
+class CFX_BasicArray : public CFX_Object
+{
+public:
+
+ IFX_Allocator* m_pAllocator;
+protected:
+
+ CFX_BasicArray(int unit_size, IFX_Allocator* pAllocator = NULL);
+
+ ~CFX_BasicArray();
+
+ FX_BOOL SetSize(int nNewSize, int nGrowBy);
+
+ FX_BOOL Append(const CFX_BasicArray& src);
+
+ FX_BOOL Copy(const CFX_BasicArray& src);
+
+ FX_LPBYTE InsertSpaceAt(int nIndex, int nCount);
+
+ FX_BOOL RemoveAt(int nIndex, int nCount);
+
+ FX_BOOL InsertAt(int nStartIndex, const CFX_BasicArray* pNewArray);
+
+ const void* GetDataPtr(int index) const;
+protected:
+
+ FX_LPBYTE m_pData;
+
+ int m_nSize;
+
+ int m_nMaxSize;
+
+ int m_nGrowBy;
+
+ int m_nUnitSize;
+};
+template<class TYPE>
+class CFX_ArrayTemplate : public CFX_BasicArray
+{
+public:
+
+ CFX_ArrayTemplate(IFX_Allocator* pAllocator = NULL) : CFX_BasicArray(sizeof(TYPE), pAllocator) {}
+
+ int GetSize() const
+ {
+ return m_nSize;
+ }
+
+ int GetUpperBound() const
+ {
+ return m_nSize - 1;
+ }
+
+ FX_BOOL SetSize(int nNewSize, int nGrowBy = -1)
+ {
+ return CFX_BasicArray::SetSize(nNewSize, nGrowBy);
+ }
+
+ void RemoveAll()
+ {
+ SetSize(0, -1);
+ }
+
+ const TYPE GetAt(int nIndex) const
+ {
+ if (nIndex < 0 || nIndex >= m_nSize) {
+ return (const TYPE&)(*(volatile const TYPE*)NULL);
+ }
+ return ((const TYPE*)m_pData)[nIndex];
+ }
+
+ FX_BOOL SetAt(int nIndex, TYPE newElement)
+ {
+ if (nIndex < 0 || nIndex >= m_nSize) {
+ return FALSE;
+ }
+ ((TYPE*)m_pData)[nIndex] = newElement;
+ return TRUE;
+ }
+
+ TYPE& ElementAt(int nIndex)
+ {
+ if (nIndex < 0 || nIndex >= m_nSize) {
+ return *(TYPE*)NULL;
+ }
+ return ((TYPE*)m_pData)[nIndex];
+ }
+
+ const TYPE* GetData() const
+ {
+ return (const TYPE*)m_pData;
+ }
+
+ TYPE* GetData()
+ {
+ return (TYPE*)m_pData;
+ }
+
+ FX_BOOL SetAtGrow(int nIndex, TYPE newElement)
+ {
+ if (nIndex < 0) {
+ return FALSE;
+ }
+ if (nIndex >= m_nSize)
+ if (!SetSize(nIndex + 1, -1)) {
+ return FALSE;
+ }
+ ((TYPE*)m_pData)[nIndex] = newElement;
+ return TRUE;
+ }
+
+ FX_BOOL Add(TYPE newElement)
+ {
+ if (m_nSize < m_nMaxSize) {
+ m_nSize ++;
+ } else if (!SetSize(m_nSize + 1, -1)) {
+ return FALSE;
+ }
+ ((TYPE*)m_pData)[m_nSize - 1] = newElement;
+ return TRUE;
+ }
+
+ FX_BOOL Append(const CFX_ArrayTemplate& src)
+ {
+ return CFX_BasicArray::Append(src);
+ }
+
+ FX_BOOL Copy(const CFX_ArrayTemplate& src)
+ {
+ return CFX_BasicArray::Copy(src);
+ }
+
+ TYPE* GetDataPtr(int index)
+ {
+ return (TYPE*)CFX_BasicArray::GetDataPtr(index);
+ }
+
+ TYPE* AddSpace()
+ {
+ return (TYPE*)CFX_BasicArray::InsertSpaceAt(m_nSize, 1);
+ }
+
+ TYPE* InsertSpaceAt(int nIndex, int nCount)
+ {
+ return (TYPE*)CFX_BasicArray::InsertSpaceAt(nIndex, nCount);
+ }
+
+ const TYPE operator[](int nIndex) const
+ {
+ if (nIndex < 0 || nIndex >= m_nSize) {
+ *(volatile char*)0 = '\0';
+ }
+ return ((const TYPE*)m_pData)[nIndex];
+ }
+
+ TYPE& operator[](int nIndex)
+ {
+ if (nIndex < 0 || nIndex >= m_nSize) {
+ *(volatile char*)0 = '\0';
+ }
+ return ((TYPE*)m_pData)[nIndex];
+ }
+
+ FX_BOOL InsertAt(int nIndex, TYPE newElement, int nCount = 1)
+ {
+ if (!InsertSpaceAt(nIndex, nCount)) {
+ return FALSE;
+ }
+ while (nCount--) {
+ ((TYPE*)m_pData)[nIndex++] = newElement;
+ }
+ return TRUE;
+ }
+
+ FX_BOOL RemoveAt(int nIndex, int nCount = 1)
+ {
+ return CFX_BasicArray::RemoveAt(nIndex, nCount);
+ }
+
+ FX_BOOL InsertAt(int nStartIndex, const CFX_BasicArray* pNewArray)
+ {
+ return CFX_BasicArray::InsertAt(nStartIndex, pNewArray);
+ }
+
+ int Find(TYPE data, int iStart = 0) const
+ {
+ if (iStart < 0) {
+ return -1;
+ }
+ for (; iStart < (int)m_nSize; iStart ++)
+ if (((TYPE*)m_pData)[iStart] == data) {
+ return iStart;
+ }
+ return -1;
+ }
+};
+typedef CFX_ArrayTemplate<FX_BYTE> CFX_ByteArray;
+typedef CFX_ArrayTemplate<FX_WORD> CFX_WordArray;
+typedef CFX_ArrayTemplate<FX_DWORD> CFX_DWordArray;
+typedef CFX_ArrayTemplate<void*> CFX_PtrArray;
+typedef CFX_ArrayTemplate<FX_FILESIZE> CFX_FileSizeArray;
+typedef CFX_ArrayTemplate<FX_FLOAT> CFX_FloatArray;
+typedef CFX_ArrayTemplate<FX_INT32> CFX_Int32Array;
+template <class ObjectClass>
+class CFX_ObjectArray : public CFX_BasicArray
+{
+public:
+
+ CFX_ObjectArray(IFX_Allocator* pAllocator = NULL) : CFX_BasicArray(sizeof(ObjectClass), pAllocator) {}
+
+ ~CFX_ObjectArray()
+ {
+ RemoveAll();
+ }
+
+ void Add(const ObjectClass& data)
+ {
+ new ((void*)InsertSpaceAt(m_nSize, 1)) ObjectClass(data);
+ }
+
+ ObjectClass& Add()
+ {
+ return *(ObjectClass*) new ((void*)InsertSpaceAt(m_nSize, 1)) ObjectClass();
+ }
+
+ void* AddSpace()
+ {
+ return InsertSpaceAt(m_nSize, 1);
+ }
+
+ FX_INT32 Append(const CFX_ObjectArray& src, FX_INT32 nStart = 0, FX_INT32 nCount = -1)
+ {
+ if (nCount == 0) {
+ return 0;
+ }
+ FX_INT32 nSize = src.GetSize();
+ if (!nSize) {
+ return 0;
+ }
+ FXSYS_assert(nStart > -1 && nStart < nSize);
+ if (nCount < 0) {
+ nCount = nSize;
+ }
+ if (nStart + nCount > nSize) {
+ nCount = nSize - nStart;
+ }
+ if (nCount < 1) {
+ return 0;
+ }
+ nSize = m_nSize;
+ InsertSpaceAt(m_nSize, nCount);
+ ObjectClass* pStartObj = (ObjectClass*)GetDataPtr(nSize);
+ nSize = nStart + nCount;
+ for (FX_INT32 i = nStart; i < nSize; i ++, pStartObj++) {
+ new ((void*)pStartObj) ObjectClass(src[i]);
+ }
+ return nCount;
+ }
+
+ FX_INT32 Copy(const CFX_ObjectArray& src, FX_INT32 nStart = 0, FX_INT32 nCount = -1)
+ {
+ if (nCount == 0) {
+ return 0;
+ }
+ FX_INT32 nSize = src.GetSize();
+ if (!nSize) {
+ return 0;
+ }
+ FXSYS_assert(nStart > -1 && nStart < nSize);
+ if (nCount < 0) {
+ nCount = nSize;
+ }
+ if (nStart + nCount > nSize) {
+ nCount = nSize - nStart;
+ }
+ if (nCount < 1) {
+ return 0;
+ }
+ RemoveAll();
+ SetSize(nCount, -1);
+ ObjectClass* pStartObj = (ObjectClass*)m_pData;
+ nSize = nStart + nCount;
+ for (FX_INT32 i = nStart; i < nSize; i ++, pStartObj++) {
+ new ((void*)pStartObj) ObjectClass(src[i]);
+ }
+ return nCount;
+ }
+
+ int GetSize() const
+ {
+ return m_nSize;
+ }
+
+ ObjectClass& operator[] (int index) const
+ {
+ FXSYS_assert(index < m_nSize);
+ return *(ObjectClass*)CFX_BasicArray::GetDataPtr(index);
+ }
+
+ ObjectClass* GetDataPtr(int index)
+ {
+ return (ObjectClass*)CFX_BasicArray::GetDataPtr(index);
+ }
+
+ void RemoveAt(int index)
+ {
+ FXSYS_assert(index < m_nSize);
+ ((ObjectClass*)GetDataPtr(index))->~ObjectClass();
+ CFX_BasicArray::RemoveAt(index, 1);
+ }
+
+ void RemoveAll()
+ {
+ for (int i = 0; i < m_nSize; i ++) {
+ ((ObjectClass*)GetDataPtr(i))->~ObjectClass();
+ }
+ CFX_BasicArray::SetSize(0, -1);
+ }
+};
+typedef CFX_ObjectArray<CFX_ByteString> CFX_ByteStringArray;
+typedef CFX_ObjectArray<CFX_WideString> CFX_WideStringArray;
+class CFX_BaseSegmentedArray : public CFX_Object
+{
+public:
+
+ CFX_BaseSegmentedArray(int unit_size = 1, int segment_units = 512, int index_size = 8, IFX_Allocator* pAllocator = NULL);
+
+ ~CFX_BaseSegmentedArray();
+
+ void SetUnitSize(int unit_size, int segment_units, int index_size = 8);
+
+ void* Add();
+
+ void* GetAt(int index) const;
+
+ void RemoveAll();
+
+ void Delete(int index, int count = 1);
+
+ int GetSize() const
+ {
+ return m_DataSize;
+ }
+
+ int GetSegmentSize() const
+ {
+ return m_SegmentSize;
+ }
+
+ int GetUnitSize() const
+ {
+ return m_UnitSize;
+ }
+
+ void* Iterate(FX_BOOL (*callback)(void* param, void* pData), void* param) const;
+
+ IFX_Allocator* m_pAllocator;
+private:
+
+ int m_UnitSize;
+
+ short m_SegmentSize;
+
+ FX_BYTE m_IndexSize;
+
+ FX_BYTE m_IndexDepth;
+
+ int m_DataSize;
+
+ void* m_pIndex;
+ void** GetIndex(int seg_index) const;
+ void* IterateIndex(int level, int& start, void** pIndex, FX_BOOL (*callback)(void* param, void* pData), void* param) const;
+ void* IterateSegment(FX_LPCBYTE pSegment, int count, FX_BOOL (*callback)(void* param, void* pData), void* param) const;
+};
+template <class ElementType>
+class CFX_SegmentedArray : public CFX_BaseSegmentedArray
+{
+public:
+
+ CFX_SegmentedArray(int segment_units, int index_size = 8, IFX_Allocator* pAllocator = NULL)
+ : CFX_BaseSegmentedArray(sizeof(ElementType), segment_units, index_size, pAllocator)
+ {}
+
+ void Add(ElementType data)
+ {
+ *(ElementType*)CFX_BaseSegmentedArray::Add() = data;
+ }
+
+ ElementType& operator [] (int index)
+ {
+ return *(ElementType*)CFX_BaseSegmentedArray::GetAt(index);
+ }
+};
+template <class DataType, int FixedSize>
+class CFX_FixedBufGrow : public CFX_Object
+{
+public:
+ CFX_FixedBufGrow(IFX_Allocator* pAllocator = NULL)
+ : m_pAllocator(pAllocator)
+ , m_pData(NULL)
+ {}
+ CFX_FixedBufGrow(int data_size, IFX_Allocator* pAllocator = NULL)
+ : m_pAllocator(pAllocator)
+ , m_pData(NULL)
+ {
+ if (data_size > FixedSize) {
+ m_pData = FX_Allocator_Alloc(m_pAllocator, DataType, data_size);
+ } else {
+ FXSYS_memset32(m_Data, 0, sizeof(DataType)*FixedSize);
+ }
+ }
+ void SetDataSize(int data_size)
+ {
+ if (m_pData) {
+ FX_Allocator_Free(m_pAllocator, m_pData);
+ }
+ m_pData = NULL;
+ if (data_size > FixedSize) {
+ m_pData = FX_Allocator_Alloc(m_pAllocator, DataType, data_size);
+ } else {
+ FXSYS_memset32(m_Data, 0, sizeof(DataType)*FixedSize);
+ }
+ }
+ ~CFX_FixedBufGrow()
+ {
+ if (m_pData) {
+ FX_Allocator_Free(m_pAllocator, m_pData);
+ }
+ }
+ operator DataType*()
+ {
+ return m_pData ? m_pData : m_Data;
+ }
+private:
+ IFX_Allocator* m_pAllocator;
+ DataType m_Data[FixedSize];
+ DataType* m_pData;
+};
+template <class DataType>
+class CFX_TempBuf
+{
+public:
+ CFX_TempBuf(int size, IFX_Allocator* pAllocator = NULL) : m_pAllocator(pAllocator)
+ {
+ m_pData = FX_Allocator_Alloc(m_pAllocator, DataType, size);
+ }
+ ~CFX_TempBuf()
+ {
+ if (m_pData) {
+ FX_Allocator_Free(m_pAllocator, m_pData);
+ }
+ }
+ DataType& operator[](int i)
+ {
+ FXSYS_assert(m_pData != NULL);
+ return m_pData[i];
+ }
+ operator DataType*()
+ {
+ return m_pData;
+ }
+private:
+ IFX_Allocator* m_pAllocator;
+ DataType* m_pData;
+};
+class CFX_MapPtrToPtr : public CFX_Object
+{
+protected:
+
+ struct CAssoc {
+
+ CAssoc* pNext;
+
+ void* key;
+
+ void* value;
+ };
+public:
+
+ CFX_MapPtrToPtr(int nBlockSize = 10, IFX_Allocator* pAllocator = NULL);
+
+ ~CFX_MapPtrToPtr();
+
+ int GetCount() const
+ {
+ return m_nCount;
+ }
+
+ FX_BOOL IsEmpty() const
+ {
+ return m_nCount == 0;
+ }
+
+ FX_BOOL Lookup(void* key, void*& rValue) const;
+
+ void* GetValueAt(void* key) const;
+
+ void*& operator[](void* key);
+
+ void SetAt(void* key, void* newValue)
+ {
+ (*this)[key] = newValue;
+ }
+
+ FX_BOOL RemoveKey(void* key);
+
+ void RemoveAll();
+
+ FX_POSITION GetStartPosition() const
+ {
+ return (m_nCount == 0) ? NULL : (FX_POSITION) - 1;
+ }
+
+ void GetNextAssoc(FX_POSITION& rNextPosition, void*& rKey, void*& rValue) const;
+
+ FX_DWORD GetHashTableSize() const
+ {
+ return m_nHashTableSize;
+ }
+
+ void InitHashTable(FX_DWORD hashSize, FX_BOOL bAllocNow = TRUE);
+protected:
+
+ IFX_Allocator* m_pAllocator;
+
+ CAssoc** m_pHashTable;
+
+ FX_DWORD m_nHashTableSize;
+
+ int m_nCount;
+
+ CAssoc* m_pFreeList;
+
+ struct CFX_Plex* m_pBlocks;
+
+ int m_nBlockSize;
+
+ FX_DWORD HashKey(void* key) const;
+
+ CAssoc* NewAssoc();
+
+ void FreeAssoc(CAssoc* pAssoc);
+
+ CAssoc* GetAssocAt(void* key, FX_DWORD& hash) const;
+};
+template <class KeyType, class ValueType>
+class CFX_MapPtrTemplate : public CFX_MapPtrToPtr
+{
+public:
+
+ CFX_MapPtrTemplate(IFX_Allocator* pAllocator = NULL) : CFX_MapPtrToPtr(10, pAllocator) {}
+
+ FX_BOOL Lookup(KeyType key, ValueType& rValue) const
+ {
+ FX_LPVOID pValue = NULL;
+ if (!CFX_MapPtrToPtr::Lookup((void*)(FX_UINTPTR)key, pValue)) {
+ return FALSE;
+ }
+ rValue = (ValueType)(FX_UINTPTR)pValue;
+ return TRUE;
+ }
+
+ ValueType& operator[](KeyType key)
+ {
+ return (ValueType&)CFX_MapPtrToPtr::operator []((void*)(FX_UINTPTR)key);
+ }
+
+ void SetAt(KeyType key, ValueType newValue)
+ {
+ CFX_MapPtrToPtr::SetAt((void*)(FX_UINTPTR)key, (void*)(FX_UINTPTR)newValue);
+ }
+
+ FX_BOOL RemoveKey(KeyType key)
+ {
+ return CFX_MapPtrToPtr::RemoveKey((void*)(FX_UINTPTR)key);
+ }
+
+ void GetNextAssoc(FX_POSITION& rNextPosition, KeyType& rKey, ValueType& rValue) const
+ {
+ void* pKey = NULL;
+ void* pValue = NULL;
+ CFX_MapPtrToPtr::GetNextAssoc(rNextPosition, pKey, pValue);
+ rKey = (KeyType)(FX_UINTPTR)pKey;
+ rValue = (ValueType)(FX_UINTPTR)pValue;
+ }
+};
+class CFX_CMapDWordToDWord : public CFX_Object
+{
+public:
+
+ CFX_CMapDWordToDWord(IFX_Allocator* pAllocator = NULL) : m_Buffer(pAllocator) {}
+
+ FX_BOOL Lookup(FX_DWORD key, FX_DWORD& value) const;
+
+ void SetAt(FX_DWORD key, FX_DWORD value);
+
+ void EstimateSize(FX_DWORD size, FX_DWORD grow_by);
+
+ FX_POSITION GetStartPosition() const;
+
+ void GetNextAssoc(FX_POSITION& pos, FX_DWORD& key, FX_DWORD& value) const;
+protected:
+
+ CFX_BinaryBuf m_Buffer;
+};
+class CFX_MapByteStringToPtr : public CFX_Object
+{
+protected:
+
+ struct CAssoc {
+
+ CAssoc* pNext;
+
+ FX_DWORD nHashValue;
+
+ CFX_ByteString key;
+
+ void* value;
+ };
+public:
+
+ CFX_MapByteStringToPtr(int nBlockSize = 10, IFX_Allocator* pAllocator = NULL);
+
+ int GetCount() const
+ {
+ return m_nCount;
+ }
+
+ FX_BOOL IsEmpty() const
+ {
+ return m_nCount == 0;
+ }
+
+ FX_BOOL Lookup(FX_BSTR key, void*& rValue) const;
+
+ void*& operator[](FX_BSTR key);
+
+ void SetAt(FX_BSTR key, void* newValue)
+ {
+ (*this)[key] = newValue;
+ }
+
+ FX_BOOL RemoveKey(FX_BSTR key);
+
+ void RemoveAll();
+
+ FX_POSITION GetStartPosition() const
+ {
+ return (m_nCount == 0) ? NULL : (FX_POSITION) - 1;
+ }
+
+ void GetNextAssoc(FX_POSITION& rNextPosition, CFX_ByteString& rKey, void*& rValue) const;
+
+ FX_LPVOID GetNextValue(FX_POSITION& rNextPosition) const;
+
+ FX_DWORD GetHashTableSize() const
+ {
+ return m_nHashTableSize;
+ }
+
+ void InitHashTable(FX_DWORD hashSize, FX_BOOL bAllocNow = TRUE);
+
+ FX_DWORD HashKey(FX_BSTR key) const;
+protected:
+
+ IFX_Allocator* m_pAllocator;
+
+ CAssoc** m_pHashTable;
+
+ FX_DWORD m_nHashTableSize;
+
+ int m_nCount;
+
+ CAssoc* m_pFreeList;
+
+ struct CFX_Plex* m_pBlocks;
+
+ int m_nBlockSize;
+
+ CAssoc* NewAssoc();
+
+ void FreeAssoc(CAssoc* pAssoc);
+
+ CAssoc* GetAssocAt(FX_BSTR key, FX_DWORD& hash) const;
+public:
+
+ ~CFX_MapByteStringToPtr();
+};
+class CFX_CMapByteStringToPtr : public CFX_Object
+{
+public:
+
+ CFX_CMapByteStringToPtr(IFX_Allocator* pAllocator = NULL);
+
+ ~CFX_CMapByteStringToPtr();
+
+ void RemoveAll();
+
+ FX_POSITION GetStartPosition() const;
+
+ void GetNextAssoc(FX_POSITION& rNextPosition, CFX_ByteString& rKey, void*& rValue) const;
+
+ FX_LPVOID GetNextValue(FX_POSITION& rNextPosition) const;
+
+ FX_BOOL Lookup(FX_BSTR key, void*& rValue) const;
+
+ void SetAt(FX_BSTR key, void* value);
+
+ void RemoveKey(FX_BSTR key);
+
+ int GetCount() const;
+
+ void AddValue(FX_BSTR key, void* pValue);
+private:
+
+ CFX_BaseSegmentedArray m_Buffer;
+};
+class CFX_PtrList : public CFX_Object
+{
+protected:
+
+ struct CNode {
+
+ CNode* pNext;
+
+ CNode* pPrev;
+
+ void* data;
+ };
+public:
+
+ CFX_PtrList(int nBlockSize = 10, IFX_Allocator* pAllocator = NULL);
+
+ FX_POSITION GetHeadPosition() const
+ {
+ return (FX_POSITION)m_pNodeHead;
+ }
+
+ FX_POSITION GetTailPosition() const
+ {
+ return (FX_POSITION)m_pNodeTail;
+ }
+
+ void* GetNext(FX_POSITION& rPosition) const
+ {
+ CNode* pNode = (CNode*) rPosition;
+ rPosition = (FX_POSITION) pNode->pNext;
+ return pNode->data;
+ }
+
+ void* GetPrev(FX_POSITION& rPosition) const
+ {
+ CNode* pNode = (CNode*) rPosition;
+ rPosition = (FX_POSITION) pNode->pPrev;
+ return pNode->data;
+ }
+
+ FX_POSITION GetNextPosition(FX_POSITION pos) const
+ {
+ return ((CNode*)pos)->pNext;
+ }
+
+ FX_POSITION GetPrevPosition(FX_POSITION pos) const
+ {
+ return ((CNode*)pos)->pPrev;
+ }
+
+ void* GetAt(FX_POSITION rPosition) const
+ {
+ CNode* pNode = (CNode*) rPosition;
+ return pNode->data;
+ }
+
+ int GetCount() const
+ {
+ return m_nCount;
+ }
+
+ FX_POSITION AddTail(void* newElement);
+
+ FX_POSITION AddHead(void* newElement);
+
+ void SetAt(FX_POSITION pos, void* newElement)
+ {
+ CNode* pNode = (CNode*) pos;
+ pNode->data = newElement;
+ }
+
+ FX_POSITION InsertAfter(FX_POSITION pos, void* newElement);
+
+ FX_POSITION Find(void* searchValue, FX_POSITION startAfter = NULL ) const;
+
+ FX_POSITION FindIndex(int index) const;
+
+ void RemoveAt(FX_POSITION pos);
+
+ void RemoveAll();
+protected:
+
+ IFX_Allocator* m_pAllocator;
+
+ CNode* m_pNodeHead;
+
+ CNode* m_pNodeTail;
+
+ int m_nCount;
+
+ CNode* m_pNodeFree;
+
+ struct CFX_Plex* m_pBlocks;
+
+ int m_nBlockSize;
+
+ CNode* NewNode(CNode* pPrev, CNode* pNext);
+
+ void FreeNode(CNode* pNode);
+public:
+
+ ~CFX_PtrList();
+};
+typedef void (*PD_CALLBACK_FREEDATA)(FX_LPVOID pData);
+struct FX_PRIVATEDATA {
+
+ void FreeData();
+
+ FX_LPVOID m_pModuleId;
+
+ FX_LPVOID m_pData;
+
+ PD_CALLBACK_FREEDATA m_pCallback;
+
+ FX_BOOL m_bSelfDestruct;
+};
+class CFX_PrivateData
+{
+public:
+
+ CFX_PrivateData(IFX_Allocator* pAllocator = NULL) : m_DataList(pAllocator) {}
+
+ ~CFX_PrivateData();
+
+ void ClearAll();
+
+ void SetPrivateData(FX_LPVOID module_id, FX_LPVOID pData, PD_CALLBACK_FREEDATA callback);
+
+ void SetPrivateObj(FX_LPVOID module_id, CFX_DestructObject* pObj);
+
+ FX_LPVOID GetPrivateData(FX_LPVOID module_id);
+
+ FX_BOOL LookupPrivateData(FX_LPVOID module_id, FX_LPVOID &pData) const
+ {
+ if (!module_id) {
+ return FALSE;
+ }
+ FX_DWORD nCount = m_DataList.GetSize();
+ for (FX_DWORD n = 0; n < nCount; n ++) {
+ if (m_DataList[n].m_pModuleId == module_id) {
+ pData = m_DataList[n].m_pData;
+ return TRUE;
+ }
+ }
+ return FALSE;
+ }
+
+ FX_BOOL RemovePrivateData(FX_LPVOID module_id);
+protected:
+
+ CFX_ArrayTemplate<FX_PRIVATEDATA> m_DataList;
+
+ void AddData(FX_LPVOID module_id, FX_LPVOID pData, PD_CALLBACK_FREEDATA callback, FX_BOOL bSelfDestruct);
+};
+class CFX_BitStream : public CFX_Object
+{
+public:
+
+ void Init(FX_LPCBYTE pData, FX_DWORD dwSize);
+
+
+ FX_DWORD GetBits(FX_DWORD nBits);
+
+ void ByteAlign();
+
+ FX_BOOL IsEOF()
+ {
+ return m_BitPos >= m_BitSize;
+ }
+
+ void SkipBits(FX_DWORD nBits)
+ {
+ m_BitPos += nBits;
+ }
+
+ void Rewind()
+ {
+ m_BitPos = 0;
+ }
+protected:
+
+ FX_DWORD m_BitPos;
+
+ FX_DWORD m_BitSize;
+
+ FX_LPCBYTE m_pData;
+};
+template <class ObjClass> class CFX_CountRef : public CFX_Object
+{
+public:
+
+ typedef CFX_CountRef<ObjClass> Ref;
+
+ class CountedObj : public ObjClass
+ {
+ public:
+
+ CountedObj() {}
+
+ CountedObj(const CountedObj& src) : ObjClass(src) {}
+
+ int m_RefCount;
+ };
+
+ CFX_CountRef()
+ {
+ m_pObject = NULL;
+ }
+
+ CFX_CountRef(const Ref& ref)
+ {
+ m_pObject = ref.m_pObject;
+ if (m_pObject) {
+ m_pObject->m_RefCount ++;
+ }
+ }
+
+ ~CFX_CountRef()
+ {
+ if (!m_pObject) {
+ return;
+ }
+ m_pObject->m_RefCount --;
+ if (m_pObject->m_RefCount <= 0) {
+ delete m_pObject;
+ }
+ }
+
+ ObjClass* New()
+ {
+ if (m_pObject) {
+ m_pObject->m_RefCount --;
+ if (m_pObject->m_RefCount <= 0) {
+ delete m_pObject;
+ }
+ m_pObject = NULL;
+ }
+ m_pObject = FX_NEW CountedObj;
+ if (!m_pObject) {
+ return NULL;
+ }
+ m_pObject->m_RefCount = 1;
+ return m_pObject;
+ }
+
+ void operator = (const Ref& ref)
+ {
+ if (ref.m_pObject) {
+ ref.m_pObject->m_RefCount ++;
+ }
+ if (m_pObject) {
+ m_pObject->m_RefCount --;
+ if (m_pObject->m_RefCount <= 0) {
+ delete m_pObject;
+ }
+ }
+ m_pObject = ref.m_pObject;
+ }
+
+ void operator = (void* p)
+ {
+ FXSYS_assert(p == 0);
+ if (m_pObject == NULL) {
+ return;
+ }
+ m_pObject->m_RefCount --;
+ if (m_pObject->m_RefCount <= 0) {
+ delete m_pObject;
+ }
+ m_pObject = NULL;
+ }
+
+ const ObjClass* GetObject() const
+ {
+ return m_pObject;
+ }
+
+ operator const ObjClass*() const
+ {
+ return m_pObject;
+ }
+
+ FX_BOOL IsNull() const
+ {
+ return m_pObject == NULL;
+ }
+
+ FX_BOOL NotNull() const
+ {
+ return m_pObject != NULL;
+ }
+
+ ObjClass* GetModify()
+ {
+ if (m_pObject == NULL) {
+ m_pObject = FX_NEW CountedObj;
+ if (m_pObject) {
+ m_pObject->m_RefCount = 1;
+ }
+ } else if (m_pObject->m_RefCount > 1) {
+ m_pObject->m_RefCount --;
+ CountedObj* pOldObject = m_pObject;
+ m_pObject = NULL;
+ m_pObject = FX_NEW CountedObj(*pOldObject);
+ if (m_pObject) {
+ m_pObject->m_RefCount = 1;
+ }
+ }
+ return m_pObject;
+ }
+
+ void SetNull()
+ {
+ if (m_pObject == NULL) {
+ return;
+ }
+ m_pObject->m_RefCount --;
+ if (m_pObject->m_RefCount <= 0) {
+ delete m_pObject;
+ }
+ m_pObject = NULL;
+ }
+
+ FX_BOOL operator == (const Ref& ref) const
+ {
+ return m_pObject == ref.m_pObject;
+ }
+protected:
+
+ CountedObj* m_pObject;
+};
+class IFX_Pause
+{
+public:
+
+ virtual FX_BOOL NeedToPauseNow() = 0;
+};
+class CFX_DataFilter : public CFX_Object
+{
+public:
+
+ virtual ~CFX_DataFilter();
+
+ void SetDestFilter(CFX_DataFilter* pFilter);
+
+ FX_BOOL IsEOF() const
+ {
+ return m_bEOF;
+ }
+
+ FX_DWORD GetSrcPos()
+ {
+ return m_SrcPos;
+ }
+
+ void FilterIn(FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf);
+
+ void FilterFinish(CFX_BinaryBuf& dest_buf);
+protected:
+
+ CFX_DataFilter();
+ virtual void v_FilterIn(FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf) = 0;
+ virtual void v_FilterFinish(CFX_BinaryBuf& dest_buf) = 0;
+ void ReportEOF(FX_DWORD left_input);
+
+ FX_BOOL m_bEOF;
+
+ FX_DWORD m_SrcPos;
+
+ CFX_DataFilter* m_pDestFilter;
+};
+template <class T>
+class CFX_SmartPointer
+{
+public:
+ CFX_SmartPointer(T *pObj) : m_pObj(pObj) {}
+ ~CFX_SmartPointer()
+ {
+ m_pObj->Release();
+ }
+ operator T*(void)
+ {
+ return m_pObj;
+ }
+ T& operator *(void)
+ {
+ return *m_pObj;
+ }
+ T* operator ->(void)
+ {
+ return m_pObj;
+ }
+protected:
+ T *m_pObj;
+};
+#define FX_DATALIST_LENGTH 1024
+template<size_t unit>
+class CFX_SortListArray : public CFX_Object
+{
+protected:
+
+ struct DataList {
+
+ FX_INT32 start;
+
+ FX_INT32 count;
+ FX_LPBYTE data;
+ };
+public:
+
+ CFX_SortListArray(IFX_Allocator* pAllocator = NULL) : m_CurList(0), m_DataLists(pAllocator) {}
+
+ ~CFX_SortListArray()
+ {
+ Clear();
+ }
+
+
+ void Clear()
+ {
+ IFX_Allocator* pAllocator = m_DataLists.m_pAllocator;
+ for (FX_INT32 i = m_DataLists.GetUpperBound(); i >= 0; i--) {
+ DataList list = m_DataLists.ElementAt(i);
+ if (list.data) {
+ FX_Allocator_Free(pAllocator, list.data);
+ }
+ }
+ m_DataLists.RemoveAll();
+ m_CurList = 0;
+ }
+
+ void Append(FX_INT32 nStart, FX_INT32 nCount)
+ {
+ if (nStart < 0) {
+ return;
+ }
+ IFX_Allocator* pAllocator = m_DataLists.m_pAllocator;
+ while (nCount > 0) {
+ FX_INT32 temp_count = FX_MIN(nCount, FX_DATALIST_LENGTH);
+ DataList list;
+ list.data = FX_Allocator_Alloc(pAllocator, FX_BYTE, temp_count * unit);
+ if (!list.data) {
+ break;
+ }
+ FXSYS_memset32(list.data, 0, temp_count * unit);
+ list.start = nStart;
+ list.count = temp_count;
+ Append(list);
+ nCount -= temp_count;
+ nStart += temp_count;
+ }
+ }
+
+ FX_LPBYTE GetAt(FX_INT32 nIndex)
+ {
+ if (nIndex < 0) {
+ return NULL;
+ }
+ if (m_CurList < 0 || m_CurList >= m_DataLists.GetSize()) {
+ return NULL;
+ }
+ DataList *pCurList = m_DataLists.GetDataPtr(m_CurList);
+ if (!pCurList || nIndex < pCurList->start || nIndex >= pCurList->start + pCurList->count) {
+ pCurList = NULL;
+ FX_INT32 iStart = 0;
+ FX_INT32 iEnd = m_DataLists.GetUpperBound();
+ FX_INT32 iMid = 0;
+ while (iStart <= iEnd) {
+ iMid = (iStart + iEnd) / 2;
+ DataList* list = m_DataLists.GetDataPtr(iMid);
+ if (nIndex < list->start) {
+ iEnd = iMid - 1;
+ } else if (nIndex >= list->start + list->count) {
+ iStart = iMid + 1;
+ } else {
+ pCurList = list;
+ m_CurList = iMid;
+ break;
+ }
+ }
+ }
+ return pCurList ? pCurList->data + (nIndex - pCurList->start) * unit : NULL;
+ }
+protected:
+ void Append(const DataList& list)
+ {
+ FX_INT32 iStart = 0;
+ FX_INT32 iEnd = m_DataLists.GetUpperBound();
+ FX_INT32 iFind = 0;
+ while (iStart <= iEnd) {
+ FX_INT32 iMid = (iStart + iEnd) / 2;
+ DataList* cur_list = m_DataLists.GetDataPtr(iMid);
+ if (list.start < cur_list->start + cur_list->count) {
+ iEnd = iMid - 1;
+ } else {
+ if (iMid == iEnd) {
+ iFind = iMid + 1;
+ break;
+ }
+ DataList* next_list = m_DataLists.GetDataPtr(iMid + 1);
+ if (list.start < next_list->start) {
+ iFind = iMid + 1;
+ break;
+ } else {
+ iStart = iMid + 1;
+ }
+ }
+ }
+ m_DataLists.InsertAt(iFind, list);
+ }
+ FX_INT32 m_CurList;
+ CFX_ArrayTemplate<DataList> m_DataLists;
+};
+template<typename T1, typename T2>
+class CFX_ListArrayTemplate : public CFX_Object
+{
+public:
+
+ void Clear()
+ {
+ m_Data.Clear();
+ }
+
+ void Add(FX_INT32 nStart, FX_INT32 nCount)
+ {
+ m_Data.Append(nStart, nCount);
+ }
+
+ T2& operator [] (FX_INT32 nIndex)
+ {
+ FX_LPBYTE data = m_Data.GetAt(nIndex);
+ FXSYS_assert(data != NULL);
+ return (T2&)(*(volatile T2*)data);
+ }
+
+ T2* GetPtrAt(FX_INT32 nIndex)
+ {
+ return (T2*)m_Data.GetAt(nIndex);
+ }
+protected:
+ T1 m_Data;
+};
+typedef CFX_ListArrayTemplate<CFX_SortListArray<sizeof(FX_FILESIZE)>, FX_FILESIZE> CFX_FileSizeListArray;
+typedef CFX_ListArrayTemplate<CFX_SortListArray<sizeof(FX_DWORD)>, FX_DWORD> CFX_DWordListArray;
+typedef enum {
+ Ready,
+ ToBeContinued,
+ Found,
+ NotFound,
+ Failed,
+ Done
+} FX_ProgressiveStatus;
+#define ProgressiveStatus FX_ProgressiveStatus
+#define FX_NAMESPACE_DECLARE(namespace, type) namespace::type
+#endif
diff --git a/core/include/fxcrt/fx_coordinates.h b/core/include/fxcrt/fx_coordinates.h
index eee0dfb260..9a63e2a4ad 100644
--- a/core/include/fxcrt/fx_coordinates.h
+++ b/core/include/fxcrt/fx_coordinates.h
@@ -1,900 +1,900 @@
-// 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 _FXCRT_COORDINATES_
-#define _FXCRT_COORDINATES_
-template<class baseType> class CFX_PSVTemplate;
-template<class baseType> class CFX_VTemplate;
-template<class baseType> class CFX_PRLTemplate;
-template<class baseType> class CFX_RTemplate;
-template<class baseType> class CFX_ETemplate;
-template<class baseType> class CFX_ATemplate;
-template<class baseType> class CFX_RRTemplate;
-class CFX_Matrix;
-template<class baseType>
-class CFX_PSVTemplate : public CFX_Object
-{
-public:
- typedef CFX_PSVTemplate<baseType> FXT_PSV;
- typedef CFX_PSVTemplate<baseType> FXT_POINT;
- typedef CFX_PSVTemplate<baseType> FXT_SIZE;
- void Set(baseType x, baseType y)
- {
- FXT_PSV::x = x, FXT_PSV::y = y;
- }
- void Set(const FXT_PSV &psv)
- {
- FXT_PSV::x = psv.x, FXT_PSV::y = psv.y;
- }
- void Add(baseType x, baseType y)
- {
- FXT_PSV::x += x, FXT_PSV::y += y;
- }
- void Subtract(baseType x, baseType y)
- {
- FXT_PSV::x -= x, FXT_PSV::y -= y;
- }
- void Reset()
- {
- FXT_PSV::x = FXT_PSV::y = 0;
- }
- FXT_PSV& operator += (const FXT_PSV &obj)
- {
- x += obj.x;
- y += obj.y;
- return *this;
- }
- FXT_PSV& operator -= (const FXT_PSV &obj)
- {
- x -= obj.x;
- y -= obj.y;
- return *this;
- }
- FXT_PSV& operator *= (baseType lamda)
- {
- x *= lamda;
- y *= lamda;
- return *this;
- }
- FXT_PSV& operator /= (baseType lamda)
- {
- x /= lamda;
- y /= lamda;
- return *this;
- }
- friend FX_BOOL operator == (const FXT_PSV &obj1, const FXT_PSV &obj2)
- {
- return obj1.x == obj2.x && obj1.y == obj2.y;
- }
- friend FX_BOOL operator != (const FXT_PSV &obj1, const FXT_PSV &obj2)
- {
- return obj1.x != obj2.x || obj1.y != obj2.y;
- }
- friend FXT_PSV operator + (const FXT_PSV &obj1, const FXT_PSV &obj2)
- {
- CFX_PSVTemplate obj;
- obj.x = obj1.x + obj2.x;
- obj.y = obj1.y + obj2.y;
- return obj;
- }
- friend FXT_PSV operator - (const FXT_PSV &obj1, const FXT_PSV &obj2)
- {
- CFX_PSVTemplate obj;
- obj.x = obj1.x - obj2.x;
- obj.y = obj1.y - obj2.y;
- return obj;
- }
- friend FXT_PSV operator * (const FXT_PSV &obj, baseType lamda)
- {
- CFX_PSVTemplate t;
- t.x = obj.x * lamda;
- t.y = obj.y * lamda;
- return t;
- }
- friend FXT_PSV operator * (baseType lamda, const FXT_PSV &obj)
- {
- CFX_PSVTemplate t;
- t.x = lamda * obj.x;
- t.y = lamda * obj.y;
- return t;
- }
- friend FXT_PSV operator / (const FXT_PSV &obj, baseType lamda)
- {
- CFX_PSVTemplate t;
- t.x = obj.x / lamda;
- t.y = obj.y / lamda;
- return t;
- }
- baseType x, y;
-};
-typedef CFX_PSVTemplate<FX_INT32> CFX_Point;
-typedef CFX_PSVTemplate<FX_FLOAT> CFX_PointF;
-typedef CFX_PSVTemplate<FX_INT32> CFX_Size;
-typedef CFX_PSVTemplate<FX_FLOAT> CFX_SizeF;
-typedef CFX_ArrayTemplate<CFX_Point> CFX_Points;
-typedef CFX_ArrayTemplate<CFX_PointF> CFX_PointsF;
-typedef CFX_PSVTemplate<FX_INT32> * FX_LPPOINT;
-typedef CFX_PSVTemplate<FX_FLOAT> * FX_LPPOINTF;
-typedef CFX_PSVTemplate<FX_INT32> const * FX_LPCPOINT;
-typedef CFX_PSVTemplate<FX_FLOAT> const * FX_LPCPOINTF;
-#define CFX_FloatPoint CFX_PointF
-template<class baseType>
-class CFX_VTemplate: public CFX_PSVTemplate<baseType>
-{
-public:
- typedef CFX_PSVTemplate<baseType> FXT_PSV;
- typedef CFX_PSVTemplate<baseType> FXT_POINT;
- typedef CFX_PSVTemplate<baseType> FXT_SIZE;
- typedef CFX_VTemplate<baseType> FXT_VECTOR;
- void Set(baseType x, baseType y)
- {
- FXT_PSV::x = x, FXT_PSV::y = y;
- }
- void Set(const FXT_PSV &psv)
- {
- FXT_PSV::x = psv.x, FXT_PSV::y = psv.y;
- }
- void Set(const FXT_POINT &p1, const FXT_POINT &p2)
- {
- FXT_PSV::x = p2.x - p1.x, FXT_PSV::y = p2.y - p1.y;
- }
- void Reset()
- {
- FXT_PSV::x = FXT_PSV::y = 0;
- }
- baseType SquareLength() const
- {
- return FXT_PSV::x * FXT_PSV::x + FXT_PSV::y * FXT_PSV::y;
- }
- baseType Length() const
- {
- return FXSYS_sqrt(FXT_PSV::x * FXT_PSV::x + FXT_PSV::y * FXT_PSV::y);
- }
- void Normalize()
- {
- FX_FLOAT fLen = FXSYS_sqrt(FXT_PSV::x * FXT_PSV::x + FXT_PSV::y * FXT_PSV::y);
- FXSYS_assert(fLen >= 0.0001f);
- FXT_PSV::x = ((baseType)FXT_PSV::x) / fLen;
- FXT_PSV::y = ((baseType)FXT_PSV::y) / fLen;
- }
- baseType DotProduct(baseType x, baseType y) const
- {
- return FXT_PSV::x * x + FXT_PSV::y * y;
- }
- baseType DotProduct(const FXT_VECTOR &v) const
- {
- return FXT_PSV::x * v.x + FXT_PSV::y * v.y;
- }
- FX_BOOL IsParallel(baseType x, baseType y) const
- {
- baseType t = FXT_PSV::x * y - FXT_PSV::y * x;
- return FXSYS_fabs(t) < 0x0001f;
- }
- FX_BOOL IsParallel(const FXT_VECTOR &v) const
- {
- return IsParallel(v.x, v.y);
- }
- FX_BOOL IsPerpendicular(baseType x, baseType y) const
- {
- baseType t = DotProduct(x, y);
- return FXSYS_fabs(t) < 0x0001f;
- }
- FX_BOOL IsPerpendicular(const FXT_VECTOR &v) const
- {
- return IsPerpendicular(v.x, v.y);
- }
- void Translate(baseType dx, baseType dy)
- {
- FXT_PSV::x += dx, FXT_PSV::y += dy;
- }
- void Scale(baseType sx, baseType sy)
- {
- FXT_PSV::x *= sx, FXT_PSV::y *= sy;
- }
- void Rotate(FX_FLOAT fRadian)
- {
- FX_FLOAT xx = (FX_FLOAT)FXT_PSV::x;
- FX_FLOAT yy = (FX_FLOAT)FXT_PSV::y;
- FX_FLOAT cosValue = FXSYS_cos(fRadian);
- FX_FLOAT sinValue = FXSYS_sin(fRadian);
- FXT_PSV::x = xx * cosValue - yy * sinValue;
- FXT_PSV::y = xx * sinValue + yy * cosValue;
- }
- friend FX_FLOAT Cosine(const FXT_VECTOR &v1, const FXT_VECTOR &v2)
- {
- FXSYS_assert(v1.SquareLength() != 0 && v2.SquareLength() != 0);
- FX_FLOAT dotProduct = v1.DotProduct(v2);
- return dotProduct / (FX_FLOAT)FXSYS_sqrt(v1.SquareLength() * v2.SquareLength());
- }
- friend FX_FLOAT ArcCosine(const FXT_VECTOR &v1, const FXT_VECTOR &v2)
- {
- return (FX_FLOAT)FXSYS_acos(Cosine(v1, v2));
- }
- friend FX_FLOAT SlopeAngle(const FXT_VECTOR &v)
- {
- CFX_VTemplate vx;
- vx.Set(1, 0);
- FX_FLOAT fSlope = ArcCosine(v, vx);
- return v.y < 0 ? -fSlope : fSlope;
- }
-};
-typedef CFX_VTemplate<FX_INT32> CFX_Vector;
-typedef CFX_VTemplate<FX_FLOAT> CFX_VectorF;
-template<class baseType>
-class CFX_RTemplate: public CFX_Object
-{
-public:
- typedef CFX_PSVTemplate<baseType> FXT_POINT;
- typedef CFX_PSVTemplate<baseType> FXT_SIZE;
- typedef CFX_VTemplate<baseType> FXT_VECTOR;
- typedef CFX_PRLTemplate<baseType> FXT_PARAL;
- typedef CFX_RTemplate<baseType> FXT_RECT;
- void Set(baseType left, baseType top, baseType width, baseType height)
- {
- FXT_RECT::left = left, FXT_RECT::top = top, FXT_RECT::width = width, FXT_RECT::height = height;
- }
- void Set(baseType left, baseType top, const FXT_SIZE &size)
- {
- FXT_RECT::left = left, FXT_RECT::top = top, FXT_RECT::Size(size);
- }
- void Set(const FXT_POINT &p, baseType width, baseType height)
- {
- TopLeft(p), FXT_RECT::width = width, FXT_RECT::height = height;
- }
- void Set(const FXT_POINT &p1, const FXT_POINT &p2)
- {
- TopLeft(p1), FXT_RECT::width = p2.x - p1.x, FXT_RECT::height = p2.y - p1.y, FXT_RECT::Normalize();
- }
- void Set(const FXT_POINT &p, const FXT_VECTOR &v)
- {
- TopLeft(p), FXT_RECT::width = v.x, FXT_RECT::height = v.y, FXT_RECT::Normalize();
- }
- void Reset()
- {
- FXT_RECT::left = FXT_RECT::top = FXT_RECT::width = FXT_RECT::height = 0;
- }
- FXT_RECT& operator += (const FXT_POINT &p)
- {
- left += p.x, top += p.y;
- return *this;
- }
- FXT_RECT& operator -= (const FXT_POINT &p)
- {
- left -= p.x, top -= p.y;
- return *this;
- }
- baseType right() const
- {
- return left + width;
- }
- baseType bottom() const
- {
- return top + height;
- }
- void Normalize()
- {
- if (width < 0) {
- left += width;
- width = -width;
- }
- if (height < 0) {
- top += height;
- height = -height;
- }
- }
- void Offset(baseType dx, baseType dy)
- {
- left += dx;
- top += dy;
- }
- void Inflate(baseType x, baseType y)
- {
- left -= x;
- width += x * 2;
- top -= y;
- height += y * 2;
- }
- void Inflate(const FXT_POINT &p)
- {
- Inflate(p.x, p.y);
- }
- void Inflate(baseType left, baseType top, baseType right, baseType bottom)
- {
- FXT_RECT::left -= left;
- FXT_RECT::top -= top;
- FXT_RECT::width += left + right;
- FXT_RECT::height += top + bottom;
- }
- void Inflate(const FXT_RECT &rt)
- {
- Inflate(rt.left, rt.top, rt.left + rt.width, rt.top + rt.height);
- }
- void Deflate(baseType x, baseType y)
- {
- left += x;
- width -= x * 2;
- top += y;
- height -= y * 2;
- }
- void Deflate(const FXT_POINT &p)
- {
- Deflate(p.x, p.y);
- }
- void Deflate(baseType left, baseType top, baseType right, baseType bottom)
- {
- FXT_RECT::left += left;
- FXT_RECT::top += top;
- FXT_RECT::width -= left + right;
- FXT_RECT::height -= top + bottom;
- }
- void Deflate(const FXT_RECT &rt)
- {
- Deflate(rt.left, rt.top, rt.top + rt.width, rt.top + rt.height);
- }
- FX_BOOL IsEmpty() const
- {
- return width <= 0 || height <= 0;
- }
- FX_BOOL IsEmpty(FX_FLOAT fEpsilon) const
- {
- return width <= fEpsilon || height <= fEpsilon;
- }
- void Empty()
- {
- width = height = 0;
- }
- FX_BOOL Contains(baseType x, baseType y) const
- {
- return x >= left && x < left + width && y >= top && y < top + height;
- }
- FX_BOOL Contains(const FXT_POINT &p) const
- {
- return Contains(p.x, p.y);
- }
- FX_BOOL Contains(const FXT_RECT &rt) const
- {
- return rt.left >= left && rt.right() <= right() && rt.top >= top && rt.bottom() <= bottom();
- }
- baseType Width() const
- {
- return width;
- }
- baseType Height() const
- {
- return height;
- }
- FXT_SIZE Size() const
- {
- FXT_SIZE size;
- size.Set(width, height);
- return size;
- }
- void Size(FXT_SIZE s)
- {
- width = s.x, height = s.y;
- }
- FXT_POINT TopLeft() const
- {
- FXT_POINT p;
- p.x = left;
- p.y = top;
- return p;
- }
- FXT_POINT TopRight() const
- {
- FXT_POINT p;
- p.x = left + width;
- p.y = top;
- return p;
- }
- FXT_POINT BottomLeft() const
- {
- FXT_POINT p;
- p.x = left;
- p.y = top + height;
- return p;
- }
- FXT_POINT BottomRight() const
- {
- FXT_POINT p;
- p.x = left + width;
- p.y = top + height;
- return p;
- }
- void TopLeft(FXT_POINT tl)
- {
- left = tl.x;
- top = tl.y;
- }
- void TopRight(FXT_POINT tr)
- {
- width = tr.x - left;
- top = tr.y;
- }
- void BottomLeft(FXT_POINT bl)
- {
- left = bl.x;
- height = bl.y - top;
- }
- void BottomRight(FXT_POINT br)
- {
- width = br.x - left;
- height = br.y - top;
- }
- FXT_POINT Center() const
- {
- FXT_POINT p;
- p.x = left + width / 2;
- p.y = top + height / 2;
- return p;
- }
- void GetParallelogram(FXT_PARAL &pg) const
- {
- pg.x = left, pg.y = top;
- pg.x1 = width, pg.y1 = 0;
- pg.x2 = 0, pg.y2 = height;
- }
- void Union(baseType x, baseType y)
- {
- baseType r = right(), b = bottom();
- if (left > x) {
- left = x;
- }
- if (r < x) {
- r = x;
- }
- if (top > y) {
- top = y;
- }
- if (b < y) {
- b = y;
- }
- width = r - left;
- height = b - top;
- }
- void Union(const FXT_POINT &p)
- {
- Union(p.x, p.y);
- }
- void Union(const FXT_RECT &rt)
- {
- baseType r = right(), b = bottom();
- if (left > rt.left) {
- left = rt.left;
- }
- if (r < rt.right()) {
- r = rt.right();
- }
- if (top > rt.top) {
- top = rt.top;
- }
- if (b < rt.bottom()) {
- b = rt.bottom();
- }
- width = r - left;
- height = b - top;
- }
- void Intersect(const FXT_RECT &rt)
- {
- baseType r = right(), b = bottom();
- if (left < rt.left) {
- left = rt.left;
- }
- if (r > rt.right()) {
- r = rt.right();
- }
- if (top < rt.top) {
- top = rt.top;
- }
- if (b > rt.bottom()) {
- b = rt.bottom();
- }
- width = r - left;
- height = b - top;
- }
- FX_BOOL IntersectWith(const FXT_RECT &rt) const
- {
- FXT_RECT rect = rt;
- rect.Intersect(*this);
- return !rect.IsEmpty();
- }
- FX_BOOL IntersectWith(const FXT_RECT &rt, FX_FLOAT fEpsilon) const
- {
- FXT_RECT rect = rt;
- rect.Intersect(*this);
- return !rect.IsEmpty(fEpsilon);
- }
- friend FX_BOOL operator == (const FXT_RECT &rc1, const FXT_RECT &rc2)
- {
- return rc1.left == rc2.left && rc1.top == rc2.top && rc1.width == rc2.width && rc1.height == rc2.height;
- }
- friend FX_BOOL operator != (const FXT_RECT &rc1, const FXT_RECT &rc2)
- {
- return rc1.left != rc2.left || rc1.top != rc2.top || rc1.width != rc2.width || rc1.height != rc2.height;
- }
- baseType left, top;
- baseType width, height;
-};
-typedef CFX_RTemplate<FX_INT32> CFX_Rect;
-typedef CFX_RTemplate<FX_FLOAT> CFX_RectF;
-typedef CFX_RTemplate<FX_INT32> * FX_LPRECT;
-typedef CFX_RTemplate<FX_FLOAT> * FX_LPRECTF;
-typedef CFX_RTemplate<FX_INT32> const * FX_LPCRECT;
-typedef CFX_RTemplate<FX_FLOAT> const * FX_LPCRECTF;
-typedef CFX_ArrayTemplate<CFX_RectF> CFX_RectFArray;
-struct FX_RECT {
-
- int left;
-
- int top;
-
- int right;
-
- int bottom;
-
- FX_RECT() {}
-
- FX_RECT(int left1, int top1, int right1, int bottom1)
- {
- left = left1;
- top = top1;
- right = right1;
- bottom = bottom1;
- }
-
- int Width() const
- {
- return right - left;
- }
-
- int Height() const
- {
- return bottom - top;
- }
-
- FX_BOOL IsEmpty() const
- {
- return right <= left || bottom <= top;
- }
-
- void Normalize();
-
- void Intersect(const FX_RECT& src);
-
- void Intersect(int left1, int top1, int right1, int bottom1)
- {
- Intersect(FX_RECT(left1, top1, right1, bottom1));
- }
-
- void Union(const FX_RECT& other_rect);
-
- FX_BOOL operator == (const FX_RECT& src) const
- {
- return left == src.left && right == src.right && top == src.top && bottom == src.bottom;
- }
-
- void Offset(int dx, int dy)
- {
- left += dx;
- right += dx;
- top += dy;
- bottom += dy;
- }
-
- FX_BOOL Contains(const FX_RECT& other_rect) const
- {
- return other_rect.left >= left && other_rect.right <= right && other_rect.top >= top && other_rect.bottom <= bottom;
- }
-
- FX_BOOL Contains(int x, int y) const
- {
- return x >= left && x < right && y >= top && y < bottom;
- }
-};
-struct FX_SMALL_RECT {
-
- FX_SHORT Left;
-
- FX_SHORT Top;
-
- FX_SHORT Right;
-
- FX_SHORT Bottom;
-};
-class CFX_FloatRect : public CFX_Object
-{
-public:
-
- CFX_FloatRect()
- {
- left = right = bottom = top = 0;
- }
-
- CFX_FloatRect(FX_FLOAT left1, FX_FLOAT bottom1, FX_FLOAT right1, FX_FLOAT top1)
- {
- left = left1;
- bottom = bottom1;
- right = right1;
- top = top1;
- }
-
- CFX_FloatRect(const FX_FLOAT* pArray)
- {
- left = pArray[0];
- bottom = pArray[1];
- right = pArray[2];
- top = pArray[3];
- }
-
- CFX_FloatRect(const FX_RECT& rect);
-
- FX_BOOL IsEmpty() const
- {
- return left >= right || bottom >= top;
- }
-
- void Normalize();
-
- void Reset()
- {
- left = right = bottom = top = 0;
- }
-
- FX_BOOL Contains(const CFX_FloatRect& other_rect) const;
-
- FX_BOOL Contains(FX_FLOAT x, FX_FLOAT y) const;
-
- void Transform(const CFX_Matrix* pMatrix);
-
- void Intersect(const CFX_FloatRect& other_rect);
-
- void Union(const CFX_FloatRect& other_rect);
-
- FX_RECT GetInnerRect() const;
-
- FX_RECT GetOutterRect() const;
-
- FX_RECT GetClosestRect() const;
-
- int Substract4(CFX_FloatRect& substract_rect, CFX_FloatRect* pRects);
-
- void InitRect(FX_FLOAT x, FX_FLOAT y)
- {
- left = right = x;
- bottom = top = y;
- }
-
- void UpdateRect(FX_FLOAT x, FX_FLOAT y);
-
- FX_FLOAT Width() const
- {
- return right - left;
- }
-
- FX_FLOAT Height() const
- {
- return top - bottom;
- }
-
- void Inflate(FX_FLOAT x, FX_FLOAT y)
- {
- Normalize();
- left -= x;
- right += x;
- bottom -= y;
- top += y;
- }
-
- void Inflate(FX_FLOAT left, FX_FLOAT bottom, FX_FLOAT right, FX_FLOAT top)
- {
- Normalize();
- this->left -= left;
- this->bottom -= bottom;
- this->right += right;
- this->top += top;
- }
-
- void Inflate(const CFX_FloatRect &rt)
- {
- Inflate(rt.left, rt.bottom, rt.right, rt.top);
- }
-
- void Deflate(FX_FLOAT x, FX_FLOAT y)
- {
- Normalize();
- left += x;
- right -= x;
- bottom += y;
- top -= y;
- }
-
- void Deflate(FX_FLOAT left, FX_FLOAT bottom, FX_FLOAT right, FX_FLOAT top)
- {
- Normalize();
- this->left += left;
- this->bottom += bottom;
- this->right -= right;
- this->top -= top;
- }
-
- void Deflate(const CFX_FloatRect &rt)
- {
- Deflate(rt.left, rt.bottom, rt.right, rt.top);
- }
-
- void Translate(FX_FLOAT e, FX_FLOAT f)
- {
- left += e;
- right += e;
- top += f;
- bottom += f;
- }
-
- static CFX_FloatRect GetBBox(const CFX_FloatPoint* pPoints, int nPoints);
-
- FX_FLOAT left;
-
- FX_FLOAT right;
-
- FX_FLOAT bottom;
-
- FX_FLOAT top;
-};
-class CFX_Matrix : public CFX_Object
-{
-public:
-
- CFX_Matrix()
- {
- a = d = 1;
- b = c = e = f = 0;
- }
-
- CFX_Matrix(FX_FLOAT a1, FX_FLOAT b1, FX_FLOAT c1, FX_FLOAT d1, FX_FLOAT e1, FX_FLOAT f1)
- {
- a = a1;
- b = b1;
- c = c1;
- d = d1;
- e = e1;
- f = f1;
- }
-
- void Set(FX_FLOAT a, FX_FLOAT b, FX_FLOAT c, FX_FLOAT d, FX_FLOAT e, FX_FLOAT f);
- void Set(const FX_FLOAT n[6]);
-
- void SetIdentity()
- {
- a = d = 1;
- b = c = e = f = 0;
- }
-
- void SetReverse(const CFX_Matrix &m);
-
- void Concat(FX_FLOAT a, FX_FLOAT b, FX_FLOAT c, FX_FLOAT d, FX_FLOAT e, FX_FLOAT f, FX_BOOL bPrepended = FALSE);
-
- void Concat(const CFX_Matrix &m, FX_BOOL bPrepended = FALSE);
-
- void ConcatInverse(const CFX_Matrix& m, FX_BOOL bPrepended = FALSE);
- void Reset()
- {
- SetIdentity();
- }
-
- void Copy(const CFX_Matrix& m)
- {
- *this = m;
- }
-
- FX_BOOL IsIdentity() const
- {
- return a == 1 && b == 0 && c == 0 && d == 1 && e == 0 && f == 0;
- }
- FX_BOOL IsInvertible() const;
-
- FX_BOOL Is90Rotated() const;
-
- FX_BOOL IsScaled() const;
-
- void Translate(FX_FLOAT x, FX_FLOAT y, FX_BOOL bPrepended = FALSE);
-
- void TranslateI(FX_INT32 x, FX_INT32 y, FX_BOOL bPrepended = FALSE)
- {
- Translate((FX_FLOAT)x, (FX_FLOAT)y, bPrepended);
- }
-
- void Scale(FX_FLOAT sx, FX_FLOAT sy, FX_BOOL bPrepended = FALSE);
-
- void Rotate(FX_FLOAT fRadian, FX_BOOL bPrepended = FALSE);
-
- void RotateAt(FX_FLOAT fRadian, FX_FLOAT x, FX_FLOAT y, FX_BOOL bPrepended = FALSE);
-
- void Shear(FX_FLOAT fAlphaRadian, FX_FLOAT fBetaRadian, FX_BOOL bPrepended = FALSE);
-
- void MatchRect(const CFX_FloatRect &dest, const CFX_FloatRect &src);
-
- FX_FLOAT GetXUnit() const;
-
- FX_FLOAT GetYUnit() const;
- void GetUnitRect(CFX_RectF &rect) const;
-
- CFX_FloatRect GetUnitRect() const;
-
- FX_FLOAT GetUnitArea() const;
- FX_FLOAT TransformXDistance(FX_FLOAT dx) const;
- FX_INT32 TransformXDistance(FX_INT32 dx) const;
- FX_FLOAT TransformYDistance(FX_FLOAT dy) const;
- FX_INT32 TransformYDistance(FX_INT32 dy) const;
- FX_FLOAT TransformDistance(FX_FLOAT dx, FX_FLOAT dy) const;
- FX_INT32 TransformDistance(FX_INT32 dx, FX_INT32 dy) const;
-
- FX_FLOAT TransformDistance(FX_FLOAT distance) const;
- void TransformPoint(FX_FLOAT &x, FX_FLOAT &y) const;
- void TransformPoint(FX_INT32 &x, FX_INT32 &y) const;
- void TransformPoints(CFX_PointF *points, FX_INT32 iCount) const;
- void TransformPoints(CFX_Point *points, FX_INT32 iCount) const;
-
- void Transform(FX_FLOAT& x, FX_FLOAT& y) const
- {
- TransformPoint(x, y);
- }
-
- void Transform(FX_FLOAT x, FX_FLOAT y, FX_FLOAT& x1, FX_FLOAT& y1) const
- {
- x1 = x, y1 = y;
- TransformPoint(x1, y1);
- }
- void TransformVector(CFX_VectorF &v) const;
- void TransformVector(CFX_Vector &v) const;
- void TransformRect(CFX_RectF &rect) const;
- void TransformRect(CFX_Rect &rect) const;
-
- void TransformRect(FX_FLOAT& left, FX_FLOAT& right, FX_FLOAT& top, FX_FLOAT& bottom) const;
-
- void TransformRect(CFX_FloatRect& rect) const
- {
- TransformRect(rect.left, rect.right, rect.top, rect.bottom);
- }
-
- FX_FLOAT GetA() const
- {
- return a;
- }
-
- FX_FLOAT GetB() const
- {
- return b;
- }
-
- FX_FLOAT GetC() const
- {
- return c;
- }
-
- FX_FLOAT GetD() const
- {
- return d;
- }
-
- FX_FLOAT GetE() const
- {
- return e;
- }
-
- FX_FLOAT GetF() const
- {
- return f;
- }
-public:
- FX_FLOAT a;
- FX_FLOAT b;
- FX_FLOAT c;
- FX_FLOAT d;
- FX_FLOAT e;
- FX_FLOAT f;
-};
-#define CFX_AffineMatrix CFX_Matrix
-#endif
+// 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 _FXCRT_COORDINATES_
+#define _FXCRT_COORDINATES_
+template<class baseType> class CFX_PSVTemplate;
+template<class baseType> class CFX_VTemplate;
+template<class baseType> class CFX_PRLTemplate;
+template<class baseType> class CFX_RTemplate;
+template<class baseType> class CFX_ETemplate;
+template<class baseType> class CFX_ATemplate;
+template<class baseType> class CFX_RRTemplate;
+class CFX_Matrix;
+template<class baseType>
+class CFX_PSVTemplate : public CFX_Object
+{
+public:
+ typedef CFX_PSVTemplate<baseType> FXT_PSV;
+ typedef CFX_PSVTemplate<baseType> FXT_POINT;
+ typedef CFX_PSVTemplate<baseType> FXT_SIZE;
+ void Set(baseType x, baseType y)
+ {
+ FXT_PSV::x = x, FXT_PSV::y = y;
+ }
+ void Set(const FXT_PSV &psv)
+ {
+ FXT_PSV::x = psv.x, FXT_PSV::y = psv.y;
+ }
+ void Add(baseType x, baseType y)
+ {
+ FXT_PSV::x += x, FXT_PSV::y += y;
+ }
+ void Subtract(baseType x, baseType y)
+ {
+ FXT_PSV::x -= x, FXT_PSV::y -= y;
+ }
+ void Reset()
+ {
+ FXT_PSV::x = FXT_PSV::y = 0;
+ }
+ FXT_PSV& operator += (const FXT_PSV &obj)
+ {
+ x += obj.x;
+ y += obj.y;
+ return *this;
+ }
+ FXT_PSV& operator -= (const FXT_PSV &obj)
+ {
+ x -= obj.x;
+ y -= obj.y;
+ return *this;
+ }
+ FXT_PSV& operator *= (baseType lamda)
+ {
+ x *= lamda;
+ y *= lamda;
+ return *this;
+ }
+ FXT_PSV& operator /= (baseType lamda)
+ {
+ x /= lamda;
+ y /= lamda;
+ return *this;
+ }
+ friend FX_BOOL operator == (const FXT_PSV &obj1, const FXT_PSV &obj2)
+ {
+ return obj1.x == obj2.x && obj1.y == obj2.y;
+ }
+ friend FX_BOOL operator != (const FXT_PSV &obj1, const FXT_PSV &obj2)
+ {
+ return obj1.x != obj2.x || obj1.y != obj2.y;
+ }
+ friend FXT_PSV operator + (const FXT_PSV &obj1, const FXT_PSV &obj2)
+ {
+ CFX_PSVTemplate obj;
+ obj.x = obj1.x + obj2.x;
+ obj.y = obj1.y + obj2.y;
+ return obj;
+ }
+ friend FXT_PSV operator - (const FXT_PSV &obj1, const FXT_PSV &obj2)
+ {
+ CFX_PSVTemplate obj;
+ obj.x = obj1.x - obj2.x;
+ obj.y = obj1.y - obj2.y;
+ return obj;
+ }
+ friend FXT_PSV operator * (const FXT_PSV &obj, baseType lamda)
+ {
+ CFX_PSVTemplate t;
+ t.x = obj.x * lamda;
+ t.y = obj.y * lamda;
+ return t;
+ }
+ friend FXT_PSV operator * (baseType lamda, const FXT_PSV &obj)
+ {
+ CFX_PSVTemplate t;
+ t.x = lamda * obj.x;
+ t.y = lamda * obj.y;
+ return t;
+ }
+ friend FXT_PSV operator / (const FXT_PSV &obj, baseType lamda)
+ {
+ CFX_PSVTemplate t;
+ t.x = obj.x / lamda;
+ t.y = obj.y / lamda;
+ return t;
+ }
+ baseType x, y;
+};
+typedef CFX_PSVTemplate<FX_INT32> CFX_Point;
+typedef CFX_PSVTemplate<FX_FLOAT> CFX_PointF;
+typedef CFX_PSVTemplate<FX_INT32> CFX_Size;
+typedef CFX_PSVTemplate<FX_FLOAT> CFX_SizeF;
+typedef CFX_ArrayTemplate<CFX_Point> CFX_Points;
+typedef CFX_ArrayTemplate<CFX_PointF> CFX_PointsF;
+typedef CFX_PSVTemplate<FX_INT32> * FX_LPPOINT;
+typedef CFX_PSVTemplate<FX_FLOAT> * FX_LPPOINTF;
+typedef CFX_PSVTemplate<FX_INT32> const * FX_LPCPOINT;
+typedef CFX_PSVTemplate<FX_FLOAT> const * FX_LPCPOINTF;
+#define CFX_FloatPoint CFX_PointF
+template<class baseType>
+class CFX_VTemplate: public CFX_PSVTemplate<baseType>
+{
+public:
+ typedef CFX_PSVTemplate<baseType> FXT_PSV;
+ typedef CFX_PSVTemplate<baseType> FXT_POINT;
+ typedef CFX_PSVTemplate<baseType> FXT_SIZE;
+ typedef CFX_VTemplate<baseType> FXT_VECTOR;
+ void Set(baseType x, baseType y)
+ {
+ FXT_PSV::x = x, FXT_PSV::y = y;
+ }
+ void Set(const FXT_PSV &psv)
+ {
+ FXT_PSV::x = psv.x, FXT_PSV::y = psv.y;
+ }
+ void Set(const FXT_POINT &p1, const FXT_POINT &p2)
+ {
+ FXT_PSV::x = p2.x - p1.x, FXT_PSV::y = p2.y - p1.y;
+ }
+ void Reset()
+ {
+ FXT_PSV::x = FXT_PSV::y = 0;
+ }
+ baseType SquareLength() const
+ {
+ return FXT_PSV::x * FXT_PSV::x + FXT_PSV::y * FXT_PSV::y;
+ }
+ baseType Length() const
+ {
+ return FXSYS_sqrt(FXT_PSV::x * FXT_PSV::x + FXT_PSV::y * FXT_PSV::y);
+ }
+ void Normalize()
+ {
+ FX_FLOAT fLen = FXSYS_sqrt(FXT_PSV::x * FXT_PSV::x + FXT_PSV::y * FXT_PSV::y);
+ FXSYS_assert(fLen >= 0.0001f);
+ FXT_PSV::x = ((baseType)FXT_PSV::x) / fLen;
+ FXT_PSV::y = ((baseType)FXT_PSV::y) / fLen;
+ }
+ baseType DotProduct(baseType x, baseType y) const
+ {
+ return FXT_PSV::x * x + FXT_PSV::y * y;
+ }
+ baseType DotProduct(const FXT_VECTOR &v) const
+ {
+ return FXT_PSV::x * v.x + FXT_PSV::y * v.y;
+ }
+ FX_BOOL IsParallel(baseType x, baseType y) const
+ {
+ baseType t = FXT_PSV::x * y - FXT_PSV::y * x;
+ return FXSYS_fabs(t) < 0x0001f;
+ }
+ FX_BOOL IsParallel(const FXT_VECTOR &v) const
+ {
+ return IsParallel(v.x, v.y);
+ }
+ FX_BOOL IsPerpendicular(baseType x, baseType y) const
+ {
+ baseType t = DotProduct(x, y);
+ return FXSYS_fabs(t) < 0x0001f;
+ }
+ FX_BOOL IsPerpendicular(const FXT_VECTOR &v) const
+ {
+ return IsPerpendicular(v.x, v.y);
+ }
+ void Translate(baseType dx, baseType dy)
+ {
+ FXT_PSV::x += dx, FXT_PSV::y += dy;
+ }
+ void Scale(baseType sx, baseType sy)
+ {
+ FXT_PSV::x *= sx, FXT_PSV::y *= sy;
+ }
+ void Rotate(FX_FLOAT fRadian)
+ {
+ FX_FLOAT xx = (FX_FLOAT)FXT_PSV::x;
+ FX_FLOAT yy = (FX_FLOAT)FXT_PSV::y;
+ FX_FLOAT cosValue = FXSYS_cos(fRadian);
+ FX_FLOAT sinValue = FXSYS_sin(fRadian);
+ FXT_PSV::x = xx * cosValue - yy * sinValue;
+ FXT_PSV::y = xx * sinValue + yy * cosValue;
+ }
+ friend FX_FLOAT Cosine(const FXT_VECTOR &v1, const FXT_VECTOR &v2)
+ {
+ FXSYS_assert(v1.SquareLength() != 0 && v2.SquareLength() != 0);
+ FX_FLOAT dotProduct = v1.DotProduct(v2);
+ return dotProduct / (FX_FLOAT)FXSYS_sqrt(v1.SquareLength() * v2.SquareLength());
+ }
+ friend FX_FLOAT ArcCosine(const FXT_VECTOR &v1, const FXT_VECTOR &v2)
+ {
+ return (FX_FLOAT)FXSYS_acos(Cosine(v1, v2));
+ }
+ friend FX_FLOAT SlopeAngle(const FXT_VECTOR &v)
+ {
+ CFX_VTemplate vx;
+ vx.Set(1, 0);
+ FX_FLOAT fSlope = ArcCosine(v, vx);
+ return v.y < 0 ? -fSlope : fSlope;
+ }
+};
+typedef CFX_VTemplate<FX_INT32> CFX_Vector;
+typedef CFX_VTemplate<FX_FLOAT> CFX_VectorF;
+template<class baseType>
+class CFX_RTemplate: public CFX_Object
+{
+public:
+ typedef CFX_PSVTemplate<baseType> FXT_POINT;
+ typedef CFX_PSVTemplate<baseType> FXT_SIZE;
+ typedef CFX_VTemplate<baseType> FXT_VECTOR;
+ typedef CFX_PRLTemplate<baseType> FXT_PARAL;
+ typedef CFX_RTemplate<baseType> FXT_RECT;
+ void Set(baseType left, baseType top, baseType width, baseType height)
+ {
+ FXT_RECT::left = left, FXT_RECT::top = top, FXT_RECT::width = width, FXT_RECT::height = height;
+ }
+ void Set(baseType left, baseType top, const FXT_SIZE &size)
+ {
+ FXT_RECT::left = left, FXT_RECT::top = top, FXT_RECT::Size(size);
+ }
+ void Set(const FXT_POINT &p, baseType width, baseType height)
+ {
+ TopLeft(p), FXT_RECT::width = width, FXT_RECT::height = height;
+ }
+ void Set(const FXT_POINT &p1, const FXT_POINT &p2)
+ {
+ TopLeft(p1), FXT_RECT::width = p2.x - p1.x, FXT_RECT::height = p2.y - p1.y, FXT_RECT::Normalize();
+ }
+ void Set(const FXT_POINT &p, const FXT_VECTOR &v)
+ {
+ TopLeft(p), FXT_RECT::width = v.x, FXT_RECT::height = v.y, FXT_RECT::Normalize();
+ }
+ void Reset()
+ {
+ FXT_RECT::left = FXT_RECT::top = FXT_RECT::width = FXT_RECT::height = 0;
+ }
+ FXT_RECT& operator += (const FXT_POINT &p)
+ {
+ left += p.x, top += p.y;
+ return *this;
+ }
+ FXT_RECT& operator -= (const FXT_POINT &p)
+ {
+ left -= p.x, top -= p.y;
+ return *this;
+ }
+ baseType right() const
+ {
+ return left + width;
+ }
+ baseType bottom() const
+ {
+ return top + height;
+ }
+ void Normalize()
+ {
+ if (width < 0) {
+ left += width;
+ width = -width;
+ }
+ if (height < 0) {
+ top += height;
+ height = -height;
+ }
+ }
+ void Offset(baseType dx, baseType dy)
+ {
+ left += dx;
+ top += dy;
+ }
+ void Inflate(baseType x, baseType y)
+ {
+ left -= x;
+ width += x * 2;
+ top -= y;
+ height += y * 2;
+ }
+ void Inflate(const FXT_POINT &p)
+ {
+ Inflate(p.x, p.y);
+ }
+ void Inflate(baseType left, baseType top, baseType right, baseType bottom)
+ {
+ FXT_RECT::left -= left;
+ FXT_RECT::top -= top;
+ FXT_RECT::width += left + right;
+ FXT_RECT::height += top + bottom;
+ }
+ void Inflate(const FXT_RECT &rt)
+ {
+ Inflate(rt.left, rt.top, rt.left + rt.width, rt.top + rt.height);
+ }
+ void Deflate(baseType x, baseType y)
+ {
+ left += x;
+ width -= x * 2;
+ top += y;
+ height -= y * 2;
+ }
+ void Deflate(const FXT_POINT &p)
+ {
+ Deflate(p.x, p.y);
+ }
+ void Deflate(baseType left, baseType top, baseType right, baseType bottom)
+ {
+ FXT_RECT::left += left;
+ FXT_RECT::top += top;
+ FXT_RECT::width -= left + right;
+ FXT_RECT::height -= top + bottom;
+ }
+ void Deflate(const FXT_RECT &rt)
+ {
+ Deflate(rt.left, rt.top, rt.top + rt.width, rt.top + rt.height);
+ }
+ FX_BOOL IsEmpty() const
+ {
+ return width <= 0 || height <= 0;
+ }
+ FX_BOOL IsEmpty(FX_FLOAT fEpsilon) const
+ {
+ return width <= fEpsilon || height <= fEpsilon;
+ }
+ void Empty()
+ {
+ width = height = 0;
+ }
+ FX_BOOL Contains(baseType x, baseType y) const
+ {
+ return x >= left && x < left + width && y >= top && y < top + height;
+ }
+ FX_BOOL Contains(const FXT_POINT &p) const
+ {
+ return Contains(p.x, p.y);
+ }
+ FX_BOOL Contains(const FXT_RECT &rt) const
+ {
+ return rt.left >= left && rt.right() <= right() && rt.top >= top && rt.bottom() <= bottom();
+ }
+ baseType Width() const
+ {
+ return width;
+ }
+ baseType Height() const
+ {
+ return height;
+ }
+ FXT_SIZE Size() const
+ {
+ FXT_SIZE size;
+ size.Set(width, height);
+ return size;
+ }
+ void Size(FXT_SIZE s)
+ {
+ width = s.x, height = s.y;
+ }
+ FXT_POINT TopLeft() const
+ {
+ FXT_POINT p;
+ p.x = left;
+ p.y = top;
+ return p;
+ }
+ FXT_POINT TopRight() const
+ {
+ FXT_POINT p;
+ p.x = left + width;
+ p.y = top;
+ return p;
+ }
+ FXT_POINT BottomLeft() const
+ {
+ FXT_POINT p;
+ p.x = left;
+ p.y = top + height;
+ return p;
+ }
+ FXT_POINT BottomRight() const
+ {
+ FXT_POINT p;
+ p.x = left + width;
+ p.y = top + height;
+ return p;
+ }
+ void TopLeft(FXT_POINT tl)
+ {
+ left = tl.x;
+ top = tl.y;
+ }
+ void TopRight(FXT_POINT tr)
+ {
+ width = tr.x - left;
+ top = tr.y;
+ }
+ void BottomLeft(FXT_POINT bl)
+ {
+ left = bl.x;
+ height = bl.y - top;
+ }
+ void BottomRight(FXT_POINT br)
+ {
+ width = br.x - left;
+ height = br.y - top;
+ }
+ FXT_POINT Center() const
+ {
+ FXT_POINT p;
+ p.x = left + width / 2;
+ p.y = top + height / 2;
+ return p;
+ }
+ void GetParallelogram(FXT_PARAL &pg) const
+ {
+ pg.x = left, pg.y = top;
+ pg.x1 = width, pg.y1 = 0;
+ pg.x2 = 0, pg.y2 = height;
+ }
+ void Union(baseType x, baseType y)
+ {
+ baseType r = right(), b = bottom();
+ if (left > x) {
+ left = x;
+ }
+ if (r < x) {
+ r = x;
+ }
+ if (top > y) {
+ top = y;
+ }
+ if (b < y) {
+ b = y;
+ }
+ width = r - left;
+ height = b - top;
+ }
+ void Union(const FXT_POINT &p)
+ {
+ Union(p.x, p.y);
+ }
+ void Union(const FXT_RECT &rt)
+ {
+ baseType r = right(), b = bottom();
+ if (left > rt.left) {
+ left = rt.left;
+ }
+ if (r < rt.right()) {
+ r = rt.right();
+ }
+ if (top > rt.top) {
+ top = rt.top;
+ }
+ if (b < rt.bottom()) {
+ b = rt.bottom();
+ }
+ width = r - left;
+ height = b - top;
+ }
+ void Intersect(const FXT_RECT &rt)
+ {
+ baseType r = right(), b = bottom();
+ if (left < rt.left) {
+ left = rt.left;
+ }
+ if (r > rt.right()) {
+ r = rt.right();
+ }
+ if (top < rt.top) {
+ top = rt.top;
+ }
+ if (b > rt.bottom()) {
+ b = rt.bottom();
+ }
+ width = r - left;
+ height = b - top;
+ }
+ FX_BOOL IntersectWith(const FXT_RECT &rt) const
+ {
+ FXT_RECT rect = rt;
+ rect.Intersect(*this);
+ return !rect.IsEmpty();
+ }
+ FX_BOOL IntersectWith(const FXT_RECT &rt, FX_FLOAT fEpsilon) const
+ {
+ FXT_RECT rect = rt;
+ rect.Intersect(*this);
+ return !rect.IsEmpty(fEpsilon);
+ }
+ friend FX_BOOL operator == (const FXT_RECT &rc1, const FXT_RECT &rc2)
+ {
+ return rc1.left == rc2.left && rc1.top == rc2.top && rc1.width == rc2.width && rc1.height == rc2.height;
+ }
+ friend FX_BOOL operator != (const FXT_RECT &rc1, const FXT_RECT &rc2)
+ {
+ return rc1.left != rc2.left || rc1.top != rc2.top || rc1.width != rc2.width || rc1.height != rc2.height;
+ }
+ baseType left, top;
+ baseType width, height;
+};
+typedef CFX_RTemplate<FX_INT32> CFX_Rect;
+typedef CFX_RTemplate<FX_FLOAT> CFX_RectF;
+typedef CFX_RTemplate<FX_INT32> * FX_LPRECT;
+typedef CFX_RTemplate<FX_FLOAT> * FX_LPRECTF;
+typedef CFX_RTemplate<FX_INT32> const * FX_LPCRECT;
+typedef CFX_RTemplate<FX_FLOAT> const * FX_LPCRECTF;
+typedef CFX_ArrayTemplate<CFX_RectF> CFX_RectFArray;
+struct FX_RECT {
+
+ int left;
+
+ int top;
+
+ int right;
+
+ int bottom;
+
+ FX_RECT() {}
+
+ FX_RECT(int left1, int top1, int right1, int bottom1)
+ {
+ left = left1;
+ top = top1;
+ right = right1;
+ bottom = bottom1;
+ }
+
+ int Width() const
+ {
+ return right - left;
+ }
+
+ int Height() const
+ {
+ return bottom - top;
+ }
+
+ FX_BOOL IsEmpty() const
+ {
+ return right <= left || bottom <= top;
+ }
+
+ void Normalize();
+
+ void Intersect(const FX_RECT& src);
+
+ void Intersect(int left1, int top1, int right1, int bottom1)
+ {
+ Intersect(FX_RECT(left1, top1, right1, bottom1));
+ }
+
+ void Union(const FX_RECT& other_rect);
+
+ FX_BOOL operator == (const FX_RECT& src) const
+ {
+ return left == src.left && right == src.right && top == src.top && bottom == src.bottom;
+ }
+
+ void Offset(int dx, int dy)
+ {
+ left += dx;
+ right += dx;
+ top += dy;
+ bottom += dy;
+ }
+
+ FX_BOOL Contains(const FX_RECT& other_rect) const
+ {
+ return other_rect.left >= left && other_rect.right <= right && other_rect.top >= top && other_rect.bottom <= bottom;
+ }
+
+ FX_BOOL Contains(int x, int y) const
+ {
+ return x >= left && x < right && y >= top && y < bottom;
+ }
+};
+struct FX_SMALL_RECT {
+
+ FX_SHORT Left;
+
+ FX_SHORT Top;
+
+ FX_SHORT Right;
+
+ FX_SHORT Bottom;
+};
+class CFX_FloatRect : public CFX_Object
+{
+public:
+
+ CFX_FloatRect()
+ {
+ left = right = bottom = top = 0;
+ }
+
+ CFX_FloatRect(FX_FLOAT left1, FX_FLOAT bottom1, FX_FLOAT right1, FX_FLOAT top1)
+ {
+ left = left1;
+ bottom = bottom1;
+ right = right1;
+ top = top1;
+ }
+
+ CFX_FloatRect(const FX_FLOAT* pArray)
+ {
+ left = pArray[0];
+ bottom = pArray[1];
+ right = pArray[2];
+ top = pArray[3];
+ }
+
+ CFX_FloatRect(const FX_RECT& rect);
+
+ FX_BOOL IsEmpty() const
+ {
+ return left >= right || bottom >= top;
+ }
+
+ void Normalize();
+
+ void Reset()
+ {
+ left = right = bottom = top = 0;
+ }
+
+ FX_BOOL Contains(const CFX_FloatRect& other_rect) const;
+
+ FX_BOOL Contains(FX_FLOAT x, FX_FLOAT y) const;
+
+ void Transform(const CFX_Matrix* pMatrix);
+
+ void Intersect(const CFX_FloatRect& other_rect);
+
+ void Union(const CFX_FloatRect& other_rect);
+
+ FX_RECT GetInnerRect() const;
+
+ FX_RECT GetOutterRect() const;
+
+ FX_RECT GetClosestRect() const;
+
+ int Substract4(CFX_FloatRect& substract_rect, CFX_FloatRect* pRects);
+
+ void InitRect(FX_FLOAT x, FX_FLOAT y)
+ {
+ left = right = x;
+ bottom = top = y;
+ }
+
+ void UpdateRect(FX_FLOAT x, FX_FLOAT y);
+
+ FX_FLOAT Width() const
+ {
+ return right - left;
+ }
+
+ FX_FLOAT Height() const
+ {
+ return top - bottom;
+ }
+
+ void Inflate(FX_FLOAT x, FX_FLOAT y)
+ {
+ Normalize();
+ left -= x;
+ right += x;
+ bottom -= y;
+ top += y;
+ }
+
+ void Inflate(FX_FLOAT left, FX_FLOAT bottom, FX_FLOAT right, FX_FLOAT top)
+ {
+ Normalize();
+ this->left -= left;
+ this->bottom -= bottom;
+ this->right += right;
+ this->top += top;
+ }
+
+ void Inflate(const CFX_FloatRect &rt)
+ {
+ Inflate(rt.left, rt.bottom, rt.right, rt.top);
+ }
+
+ void Deflate(FX_FLOAT x, FX_FLOAT y)
+ {
+ Normalize();
+ left += x;
+ right -= x;
+ bottom += y;
+ top -= y;
+ }
+
+ void Deflate(FX_FLOAT left, FX_FLOAT bottom, FX_FLOAT right, FX_FLOAT top)
+ {
+ Normalize();
+ this->left += left;
+ this->bottom += bottom;
+ this->right -= right;
+ this->top -= top;
+ }
+
+ void Deflate(const CFX_FloatRect &rt)
+ {
+ Deflate(rt.left, rt.bottom, rt.right, rt.top);
+ }
+
+ void Translate(FX_FLOAT e, FX_FLOAT f)
+ {
+ left += e;
+ right += e;
+ top += f;
+ bottom += f;
+ }
+
+ static CFX_FloatRect GetBBox(const CFX_FloatPoint* pPoints, int nPoints);
+
+ FX_FLOAT left;
+
+ FX_FLOAT right;
+
+ FX_FLOAT bottom;
+
+ FX_FLOAT top;
+};
+class CFX_Matrix : public CFX_Object
+{
+public:
+
+ CFX_Matrix()
+ {
+ a = d = 1;
+ b = c = e = f = 0;
+ }
+
+ CFX_Matrix(FX_FLOAT a1, FX_FLOAT b1, FX_FLOAT c1, FX_FLOAT d1, FX_FLOAT e1, FX_FLOAT f1)
+ {
+ a = a1;
+ b = b1;
+ c = c1;
+ d = d1;
+ e = e1;
+ f = f1;
+ }
+
+ void Set(FX_FLOAT a, FX_FLOAT b, FX_FLOAT c, FX_FLOAT d, FX_FLOAT e, FX_FLOAT f);
+ void Set(const FX_FLOAT n[6]);
+
+ void SetIdentity()
+ {
+ a = d = 1;
+ b = c = e = f = 0;
+ }
+
+ void SetReverse(const CFX_Matrix &m);
+
+ void Concat(FX_FLOAT a, FX_FLOAT b, FX_FLOAT c, FX_FLOAT d, FX_FLOAT e, FX_FLOAT f, FX_BOOL bPrepended = FALSE);
+
+ void Concat(const CFX_Matrix &m, FX_BOOL bPrepended = FALSE);
+
+ void ConcatInverse(const CFX_Matrix& m, FX_BOOL bPrepended = FALSE);
+ void Reset()
+ {
+ SetIdentity();
+ }
+
+ void Copy(const CFX_Matrix& m)
+ {
+ *this = m;
+ }
+
+ FX_BOOL IsIdentity() const
+ {
+ return a == 1 && b == 0 && c == 0 && d == 1 && e == 0 && f == 0;
+ }
+ FX_BOOL IsInvertible() const;
+
+ FX_BOOL Is90Rotated() const;
+
+ FX_BOOL IsScaled() const;
+
+ void Translate(FX_FLOAT x, FX_FLOAT y, FX_BOOL bPrepended = FALSE);
+
+ void TranslateI(FX_INT32 x, FX_INT32 y, FX_BOOL bPrepended = FALSE)
+ {
+ Translate((FX_FLOAT)x, (FX_FLOAT)y, bPrepended);
+ }
+
+ void Scale(FX_FLOAT sx, FX_FLOAT sy, FX_BOOL bPrepended = FALSE);
+
+ void Rotate(FX_FLOAT fRadian, FX_BOOL bPrepended = FALSE);
+
+ void RotateAt(FX_FLOAT fRadian, FX_FLOAT x, FX_FLOAT y, FX_BOOL bPrepended = FALSE);
+
+ void Shear(FX_FLOAT fAlphaRadian, FX_FLOAT fBetaRadian, FX_BOOL bPrepended = FALSE);
+
+ void MatchRect(const CFX_FloatRect &dest, const CFX_FloatRect &src);
+
+ FX_FLOAT GetXUnit() const;
+
+ FX_FLOAT GetYUnit() const;
+ void GetUnitRect(CFX_RectF &rect) const;
+
+ CFX_FloatRect GetUnitRect() const;
+
+ FX_FLOAT GetUnitArea() const;
+ FX_FLOAT TransformXDistance(FX_FLOAT dx) const;
+ FX_INT32 TransformXDistance(FX_INT32 dx) const;
+ FX_FLOAT TransformYDistance(FX_FLOAT dy) const;
+ FX_INT32 TransformYDistance(FX_INT32 dy) const;
+ FX_FLOAT TransformDistance(FX_FLOAT dx, FX_FLOAT dy) const;
+ FX_INT32 TransformDistance(FX_INT32 dx, FX_INT32 dy) const;
+
+ FX_FLOAT TransformDistance(FX_FLOAT distance) const;
+ void TransformPoint(FX_FLOAT &x, FX_FLOAT &y) const;
+ void TransformPoint(FX_INT32 &x, FX_INT32 &y) const;
+ void TransformPoints(CFX_PointF *points, FX_INT32 iCount) const;
+ void TransformPoints(CFX_Point *points, FX_INT32 iCount) const;
+
+ void Transform(FX_FLOAT& x, FX_FLOAT& y) const
+ {
+ TransformPoint(x, y);
+ }
+
+ void Transform(FX_FLOAT x, FX_FLOAT y, FX_FLOAT& x1, FX_FLOAT& y1) const
+ {
+ x1 = x, y1 = y;
+ TransformPoint(x1, y1);
+ }
+ void TransformVector(CFX_VectorF &v) const;
+ void TransformVector(CFX_Vector &v) const;
+ void TransformRect(CFX_RectF &rect) const;
+ void TransformRect(CFX_Rect &rect) const;
+
+ void TransformRect(FX_FLOAT& left, FX_FLOAT& right, FX_FLOAT& top, FX_FLOAT& bottom) const;
+
+ void TransformRect(CFX_FloatRect& rect) const
+ {
+ TransformRect(rect.left, rect.right, rect.top, rect.bottom);
+ }
+
+ FX_FLOAT GetA() const
+ {
+ return a;
+ }
+
+ FX_FLOAT GetB() const
+ {
+ return b;
+ }
+
+ FX_FLOAT GetC() const
+ {
+ return c;
+ }
+
+ FX_FLOAT GetD() const
+ {
+ return d;
+ }
+
+ FX_FLOAT GetE() const
+ {
+ return e;
+ }
+
+ FX_FLOAT GetF() const
+ {
+ return f;
+ }
+public:
+ FX_FLOAT a;
+ FX_FLOAT b;
+ FX_FLOAT c;
+ FX_FLOAT d;
+ FX_FLOAT e;
+ FX_FLOAT f;
+};
+#define CFX_AffineMatrix CFX_Matrix
+#endif
diff --git a/core/include/fxcrt/fx_ext.h b/core/include/fxcrt/fx_ext.h
index 7fdbfcd0af..03ec488135 100644
--- a/core/include/fxcrt/fx_ext.h
+++ b/core/include/fxcrt/fx_ext.h
@@ -1,103 +1,103 @@
-// 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 _FXCRT_EXTENSION_
-#define _FXCRT_EXTENSION_
-#ifndef _FX_BASIC_H_
-#include "fx_basic.h"
-#endif
-#ifndef _FXCRT_COORDINATES_
-#include "fx_coordinates.h"
-#endif
-#ifndef _FX_XML_H_
-#include "fx_xml.h"
-#endif
-#ifndef _FX_UNICODE_
-#include "fx_ucd.h"
-#endif
-#ifndef _FX_ARABIC_
-#include "fx_arb.h"
-#endif
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-FX_FLOAT FXSYS_tan(FX_FLOAT a);
-FX_FLOAT FXSYS_logb(FX_FLOAT b, FX_FLOAT x);
-FX_FLOAT FXSYS_strtof(FX_LPCSTR pcsStr, FX_INT32 iLength = -1, FX_INT32 *pUsedLen = NULL);
-FX_FLOAT FXSYS_wcstof(FX_LPCWSTR pwsStr, FX_INT32 iLength = -1, FX_INT32 *pUsedLen = NULL);
-FX_LPWSTR FXSYS_wcsncpy(FX_LPWSTR dstStr, FX_LPCWSTR srcStr, size_t count);
-FX_INT32 FXSYS_wcsnicmp(FX_LPCWSTR s1, FX_LPCWSTR s2, size_t count);
-FX_INT32 FXSYS_strnicmp(FX_LPCSTR s1, FX_LPCSTR s2, size_t count);
-inline FX_BOOL FXSYS_islower(FX_INT32 ch)
-{
- return ch >= 'a' && ch <= 'z';
-}
-inline FX_BOOL FXSYS_isupper(FX_INT32 ch)
-{
- return ch >= 'A' && ch <= 'Z';
-}
-inline FX_INT32 FXSYS_tolower(FX_INT32 ch)
-{
- return ch < 'A' || ch > 'Z' ? ch : (ch + 0x20);
-}
-inline FX_INT32 FXSYS_toupper(FX_INT32 ch)
-{
- return ch < 'a' || ch > 'z' ? ch : (ch - 0x20);
-}
-
-
-
-FX_DWORD FX_HashCode_String_GetA(FX_LPCSTR pStr, FX_INT32 iLength, FX_BOOL bIgnoreCase = FALSE);
-FX_DWORD FX_HashCode_String_GetW(FX_LPCWSTR pStr, FX_INT32 iLength, FX_BOOL bIgnoreCase = FALSE);
-
-#ifdef __cplusplus
-}
-#endif
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-FX_LPVOID FX_Random_MT_Start(FX_DWORD dwSeed);
-
-FX_DWORD FX_Random_MT_Generate(FX_LPVOID pContext);
-
-void FX_Random_MT_Close(FX_LPVOID pContext);
-
-void FX_Random_GenerateBase(FX_LPDWORD pBuffer, FX_INT32 iCount);
-
-void FX_Random_GenerateMT(FX_LPDWORD pBuffer, FX_INT32 iCount);
-
-void FX_Random_GenerateCrypto(FX_LPDWORD pBuffer, FX_INT32 iCount);
-#ifdef __cplusplus
-}
-#endif
-template<class baseType>
-class CFX_SSortTemplate
-{
-public:
- void ShellSort(baseType *pArray, FX_INT32 iCount)
- {
- FXSYS_assert(pArray != NULL && iCount > 0);
- FX_INT32 i, j, gap;
- baseType v1, v2;
- gap = iCount >> 1;
- while (gap > 0) {
- for (i = gap; i < iCount; i ++) {
- j = i - gap;
- v1 = pArray[i];
- while (j > -1 && (v2 = pArray[j]) > v1) {
- pArray[j + gap] = v2;
- j -= gap;
- }
- pArray[j + gap] = v1;
- }
- gap >>= 1;
- }
- }
-};
-#endif
+// 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 _FXCRT_EXTENSION_
+#define _FXCRT_EXTENSION_
+#ifndef _FX_BASIC_H_
+#include "fx_basic.h"
+#endif
+#ifndef _FXCRT_COORDINATES_
+#include "fx_coordinates.h"
+#endif
+#ifndef _FX_XML_H_
+#include "fx_xml.h"
+#endif
+#ifndef _FX_UNICODE_
+#include "fx_ucd.h"
+#endif
+#ifndef _FX_ARABIC_
+#include "fx_arb.h"
+#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+FX_FLOAT FXSYS_tan(FX_FLOAT a);
+FX_FLOAT FXSYS_logb(FX_FLOAT b, FX_FLOAT x);
+FX_FLOAT FXSYS_strtof(FX_LPCSTR pcsStr, FX_INT32 iLength = -1, FX_INT32 *pUsedLen = NULL);
+FX_FLOAT FXSYS_wcstof(FX_LPCWSTR pwsStr, FX_INT32 iLength = -1, FX_INT32 *pUsedLen = NULL);
+FX_LPWSTR FXSYS_wcsncpy(FX_LPWSTR dstStr, FX_LPCWSTR srcStr, size_t count);
+FX_INT32 FXSYS_wcsnicmp(FX_LPCWSTR s1, FX_LPCWSTR s2, size_t count);
+FX_INT32 FXSYS_strnicmp(FX_LPCSTR s1, FX_LPCSTR s2, size_t count);
+inline FX_BOOL FXSYS_islower(FX_INT32 ch)
+{
+ return ch >= 'a' && ch <= 'z';
+}
+inline FX_BOOL FXSYS_isupper(FX_INT32 ch)
+{
+ return ch >= 'A' && ch <= 'Z';
+}
+inline FX_INT32 FXSYS_tolower(FX_INT32 ch)
+{
+ return ch < 'A' || ch > 'Z' ? ch : (ch + 0x20);
+}
+inline FX_INT32 FXSYS_toupper(FX_INT32 ch)
+{
+ return ch < 'a' || ch > 'z' ? ch : (ch - 0x20);
+}
+
+
+
+FX_DWORD FX_HashCode_String_GetA(FX_LPCSTR pStr, FX_INT32 iLength, FX_BOOL bIgnoreCase = FALSE);
+FX_DWORD FX_HashCode_String_GetW(FX_LPCWSTR pStr, FX_INT32 iLength, FX_BOOL bIgnoreCase = FALSE);
+
+#ifdef __cplusplus
+}
+#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+FX_LPVOID FX_Random_MT_Start(FX_DWORD dwSeed);
+
+FX_DWORD FX_Random_MT_Generate(FX_LPVOID pContext);
+
+void FX_Random_MT_Close(FX_LPVOID pContext);
+
+void FX_Random_GenerateBase(FX_LPDWORD pBuffer, FX_INT32 iCount);
+
+void FX_Random_GenerateMT(FX_LPDWORD pBuffer, FX_INT32 iCount);
+
+void FX_Random_GenerateCrypto(FX_LPDWORD pBuffer, FX_INT32 iCount);
+#ifdef __cplusplus
+}
+#endif
+template<class baseType>
+class CFX_SSortTemplate
+{
+public:
+ void ShellSort(baseType *pArray, FX_INT32 iCount)
+ {
+ FXSYS_assert(pArray != NULL && iCount > 0);
+ FX_INT32 i, j, gap;
+ baseType v1, v2;
+ gap = iCount >> 1;
+ while (gap > 0) {
+ for (i = gap; i < iCount; i ++) {
+ j = i - gap;
+ v1 = pArray[i];
+ while (j > -1 && (v2 = pArray[j]) > v1) {
+ pArray[j + gap] = v2;
+ j -= gap;
+ }
+ pArray[j + gap] = v1;
+ }
+ gap >>= 1;
+ }
+ }
+};
+#endif
diff --git a/core/include/fxcrt/fx_memory.h b/core/include/fxcrt/fx_memory.h
index b0c94c4c73..cf795fa869 100644
--- a/core/include/fxcrt/fx_memory.h
+++ b/core/include/fxcrt/fx_memory.h
@@ -1,300 +1,300 @@
-// 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 _FX_MEMORY_H_
-#define _FX_MEMORY_H_
-#ifndef _FX_SYSTEM_H_
-#include "fx_system.h"
-#endif
-#define FXMEM_NONLEAVE 1
-#define FXMEM_MOVABLE 2
-#define FXMEM_DISCARDABLE 4
-#ifdef __cplusplus
-extern "C" {
-#endif
-typedef struct _FXMEM_SystemMgr {
-
- void* (*Alloc)(struct _FXMEM_SystemMgr* pMgr, size_t size, int flags);
-
- void* (*AllocDebug)(struct _FXMEM_SystemMgr* pMgr, size_t size, int flags, FX_LPCSTR file, int line);
-
- void* (*Realloc)(struct _FXMEM_SystemMgr* pMgr, void* pointer, size_t size, int flags);
-
- void* (*ReallocDebug)(struct _FXMEM_SystemMgr* pMgr, void* pointer, size_t size, int flags, FX_LPCSTR file, int line);
-
- void* (*Lock)(struct _FXMEM_SystemMgr* pMgr, void* handle);
-
- void (*Unlock)(struct _FXMEM_SystemMgr* pMgr, void* handle);
-
- void (*Free)(struct _FXMEM_SystemMgr* pMgr, void* pointer, int flags);
-
- void (*Purge)(struct _FXMEM_SystemMgr* pMgr);
-
- void (*CollectAll)(struct _FXMEM_SystemMgr* pMgr);
-
-
- void* user;
-} FXMEM_SystemMgr;
-FX_DEFINEHANDLE(FXMEM_FoxitMgr)
-typedef struct _FXMEM_SystemMgr2 {
-
- FX_BOOL (*More)(struct _FXMEM_SystemMgr2* pMgr, size_t alloc_size, void** new_memory, size_t* new_size);
-
- void (*Free)(struct _FXMEM_SystemMgr2* pMgr, void* memory);
-} FXMEM_SystemMgr2;
-FXMEM_FoxitMgr* FXMEM_CreateMemoryMgr(size_t size, FX_BOOL extensible);
-void FXMEM_DestroyFoxitMgr(FXMEM_FoxitMgr* pFoxitMgr);
-void* FXMEM_DefaultAlloc(size_t byte_size, int flags);
-void* FXMEM_DefaultAlloc2(size_t units, size_t unit_size, int flags);
-void* FXMEM_DefaultRealloc(void* pointer, size_t new_size, int flags);
-void* FXMEM_DefaultRealloc2(void* pointer, size_t units, size_t unit_size, int flags);
-void FXMEM_DefaultFree(void* pointer, int flags);
-#define FX_Alloc(type, size) (type*)FXMEM_DefaultAlloc2(size, sizeof(type), 0)
-#define FX_Realloc(type, ptr, size) (type*)FXMEM_DefaultRealloc2(ptr, size, sizeof(type), 0)
-#define FX_AllocNL(type, size) (type*)FXMEM_DefaultAlloc2(size, sizeof(type), FXMEM_NONLEAVE)
-#define FX_ReallocNL(type, ptr, size) (type*)FXMEM_DefaultRealloc2(ptr, size, sizeof(type), FXMEM_NONLEAVE)
-#define FX_Free(pointer) FXMEM_DefaultFree(pointer, 0)
-#ifdef __cplusplus
-}
-#endif
-#ifdef __cplusplus
-#if defined(_DEBUG)
-#define FX_NEW new(__FILE__, __LINE__)
-#else
-
-#define FX_NEW new
-#endif
-class CFX_Object
-{
-public:
-
- void* operator new (size_t size, FX_LPCSTR file, int line);
-
- void operator delete (void* p, FX_LPCSTR file, int line);
-
- void* operator new (size_t size);
-
- void operator delete (void* p);
-
- void* operator new[] (size_t size, FX_LPCSTR file, int line);
-
- void operator delete[] (void* p, FX_LPCSTR file, int line);
-
- void* operator new[] (size_t size);
-
- void operator delete[] (void* p);
-
- void* operator new (size_t, void* buf)
- {
- return buf;
- }
-
- void operator delete (void*, void*) {}
-};
-#define FX_NEW_VECTOR(Pointer, Class, Count) \
- { \
- Pointer = FX_Alloc(Class, Count); \
- if (Pointer) { \
- for (int i = 0; i < (Count); i ++) new (Pointer + i) Class; \
- } \
- }
-#define FX_DELETE_VECTOR(Pointer, Class, Count) \
- { \
- for (int i = 0; i < (Count); i ++) Pointer[i].~Class(); \
- FX_Free(Pointer); \
- }
-class CFX_DestructObject : public CFX_Object
-{
-public:
-
- virtual ~CFX_DestructObject() {}
-};
-#ifdef __cplusplus
-extern "C" {
-#endif
-typedef struct _IFX_Allocator {
-
- void* (*m_AllocDebug)(struct _IFX_Allocator* pAllocator, size_t size, FX_LPCSTR file, int line);
-
- void* (*m_Alloc)(struct _IFX_Allocator* pAllocator, size_t size);
-
- void* (*m_ReallocDebug)(struct _IFX_Allocator* pAllocator, void* p, size_t size, FX_LPCSTR file, int line);
-
- void* (*m_Realloc)(struct _IFX_Allocator* pAllocator, void* p, size_t size);
-
- void (*m_Free)(struct _IFX_Allocator* pAllocator, void* p);
-} IFX_Allocator;
-IFX_Allocator* FXMEM_GetDefAllocator();
-#ifdef __cplusplus
-}
-#endif
-#ifdef _DEBUG
-
-#define FX_Allocator_Alloc(fxAllocator, type, size) \
- ((fxAllocator) ? (type*)(fxAllocator)->m_AllocDebug((fxAllocator), (size) * sizeof(type), __FILE__, __LINE__) : (FX_Alloc(type, size)))
-
-#define FX_Allocator_Realloc(fxAllocator, type, ptr, new_size) \
- ((fxAllocator) ? (type*)(fxAllocator)->m_ReallocDebug((fxAllocator), (ptr), (new_size) * sizeof(type), __FILE__, __LINE__) : (FX_Realloc(type, ptr, new_size)))
-#else
-
-#define FX_Allocator_Alloc(fxAllocator, type, size) \
- ((fxAllocator) ? (type*)(fxAllocator)->m_Alloc((fxAllocator), (size) * sizeof(type)) : (FX_Alloc(type, size)))
-
-#define FX_Allocator_Realloc(fxAllocator, type, ptr, new_size) \
- ((fxAllocator) ? (type*)(fxAllocator)->m_Realloc((fxAllocator), (ptr), (new_size) * sizeof(type)) : (FX_Realloc(type, ptr, new_size)))
-#endif
-#define FX_Allocator_Free(fxAllocator, ptr) \
- ((fxAllocator) ? (fxAllocator)->m_Free((fxAllocator), (ptr)) : (FX_Free(ptr)))
-inline void* operator new(size_t size, IFX_Allocator* fxAllocator)
-{
- return (void*)FX_Allocator_Alloc(fxAllocator, FX_BYTE, size);
-}
-inline void operator delete(void* ptr, IFX_Allocator* fxAllocator)
-{
-}
-#define FX_NewAtAllocator(fxAllocator) \
- ::new(fxAllocator)
-#define FX_DeleteAtAllocator(pointer, fxAllocator, __class__) \
- (pointer)->~__class__(); \
- FX_Allocator_Free(fxAllocator, pointer)
-class CFX_AllocObject
-{
-public:
-
- void* operator new (size_t size, IFX_Allocator* pAllocator, FX_LPCSTR file, int line);
-#ifndef _FX_NO_EXCEPTION_
-
- void operator delete (void* p, IFX_Allocator* pAllocator, FX_LPCSTR file, int line);
-#endif
-
- void* operator new (size_t size, IFX_Allocator* pAllocator);
-
- void operator delete (void* p);
-#ifndef _FX_NO_EXCEPTION_
-
- void operator delete (void* p, IFX_Allocator* pAllocator);
-#endif
-
- void* operator new (size_t, void* buf)
- {
- return buf;
- }
-#ifndef _FX_NO_EXCEPTION_
-
- void operator delete (void*, void*) {}
-#endif
-
- IFX_Allocator* GetAllocator() const
- {
- return m_pAllocator;
- }
-private:
-
- void* operator new[] (size_t size, IFX_Allocator* pAllocator, FX_LPCSTR file, int line)
- {
- return operator new(size, pAllocator, file, line);
- }
-#ifndef _FX_NO_EXCEPTION_
-
- void operator delete[] (void* p, IFX_Allocator* pAllocator, FX_LPCSTR file, int line) {}
-#endif
-
- void* operator new[] (size_t size, IFX_Allocator* pAllocator)
- {
- return operator new(size, pAllocator);
- }
-
- void operator delete[] (void* p) {}
-#ifndef _FX_NO_EXCEPTION_
-
- void operator delete[] (void* p, IFX_Allocator* pAllocator) {}
-#endif
-protected:
-
- IFX_Allocator* m_pAllocator;
-};
-#if defined(_DEBUG)
-#define FX_NEWAT(pAllocator) new(pAllocator, __FILE__, __LINE__)
-#else
-
-#define FX_NEWAT(pAllocator) new(pAllocator)
-#endif
-class CFX_GrowOnlyPool : public IFX_Allocator, public CFX_Object
-{
-public:
-
- CFX_GrowOnlyPool(IFX_Allocator* pAllocator = NULL, size_t trunk_size = 16384);
-
- ~CFX_GrowOnlyPool();
-
- void SetAllocator(IFX_Allocator* pAllocator);
-
- void SetTrunkSize(size_t trunk_size)
- {
- m_TrunkSize = trunk_size;
- }
-
- void* AllocDebug(size_t size, FX_LPCSTR file, int line)
- {
- return Alloc(size);
- }
-
- void* Alloc(size_t size);
-
- void* ReallocDebug(void* p, size_t new_size, FX_LPCSTR file, int line)
- {
- return NULL;
- }
-
- void* Realloc(void* p, size_t new_size)
- {
- return NULL;
- }
-
- void Free(void*) {}
-
- void FreeAll();
-private:
-
- size_t m_TrunkSize;
-
- void* m_pFirstTrunk;
-
- IFX_Allocator* m_pAllocator;
-};
-#endif
-#ifdef __cplusplus
-extern "C" {
-#endif
-#define FX_FIXEDMEM_PAGESIZE (4096 * 16)
-#define FX_FIXEDMEM_MIDBLOCKSIZE (4096)
-typedef struct _FX_MEMCONFIG {
-
- size_t nPageNum_Init8;
-
- size_t nPageNum_Init16;
-
- size_t nPageNum_Init32;
-
- size_t nPageNum_More16;
-
- size_t nPageNum_More32;
-
- size_t nPageSize_Mid;
-
- size_t nPageNum_InitMid;
-
- size_t nPageNum_MoreMid;
-
- size_t nPageSize_Large;
-
- size_t nPageSize_Alone;
-} FX_MEMCONFIG;
-void FXMEM_SetConfig(const FX_MEMCONFIG* memConfig);
-#ifdef __cplusplus
-}
-#endif
-#endif
+// 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 _FX_MEMORY_H_
+#define _FX_MEMORY_H_
+#ifndef _FX_SYSTEM_H_
+#include "fx_system.h"
+#endif
+#define FXMEM_NONLEAVE 1
+#define FXMEM_MOVABLE 2
+#define FXMEM_DISCARDABLE 4
+#ifdef __cplusplus
+extern "C" {
+#endif
+typedef struct _FXMEM_SystemMgr {
+
+ void* (*Alloc)(struct _FXMEM_SystemMgr* pMgr, size_t size, int flags);
+
+ void* (*AllocDebug)(struct _FXMEM_SystemMgr* pMgr, size_t size, int flags, FX_LPCSTR file, int line);
+
+ void* (*Realloc)(struct _FXMEM_SystemMgr* pMgr, void* pointer, size_t size, int flags);
+
+ void* (*ReallocDebug)(struct _FXMEM_SystemMgr* pMgr, void* pointer, size_t size, int flags, FX_LPCSTR file, int line);
+
+ void* (*Lock)(struct _FXMEM_SystemMgr* pMgr, void* handle);
+
+ void (*Unlock)(struct _FXMEM_SystemMgr* pMgr, void* handle);
+
+ void (*Free)(struct _FXMEM_SystemMgr* pMgr, void* pointer, int flags);
+
+ void (*Purge)(struct _FXMEM_SystemMgr* pMgr);
+
+ void (*CollectAll)(struct _FXMEM_SystemMgr* pMgr);
+
+
+ void* user;
+} FXMEM_SystemMgr;
+FX_DEFINEHANDLE(FXMEM_FoxitMgr)
+typedef struct _FXMEM_SystemMgr2 {
+
+ FX_BOOL (*More)(struct _FXMEM_SystemMgr2* pMgr, size_t alloc_size, void** new_memory, size_t* new_size);
+
+ void (*Free)(struct _FXMEM_SystemMgr2* pMgr, void* memory);
+} FXMEM_SystemMgr2;
+FXMEM_FoxitMgr* FXMEM_CreateMemoryMgr(size_t size, FX_BOOL extensible);
+void FXMEM_DestroyFoxitMgr(FXMEM_FoxitMgr* pFoxitMgr);
+void* FXMEM_DefaultAlloc(size_t byte_size, int flags);
+void* FXMEM_DefaultAlloc2(size_t units, size_t unit_size, int flags);
+void* FXMEM_DefaultRealloc(void* pointer, size_t new_size, int flags);
+void* FXMEM_DefaultRealloc2(void* pointer, size_t units, size_t unit_size, int flags);
+void FXMEM_DefaultFree(void* pointer, int flags);
+#define FX_Alloc(type, size) (type*)FXMEM_DefaultAlloc2(size, sizeof(type), 0)
+#define FX_Realloc(type, ptr, size) (type*)FXMEM_DefaultRealloc2(ptr, size, sizeof(type), 0)
+#define FX_AllocNL(type, size) (type*)FXMEM_DefaultAlloc2(size, sizeof(type), FXMEM_NONLEAVE)
+#define FX_ReallocNL(type, ptr, size) (type*)FXMEM_DefaultRealloc2(ptr, size, sizeof(type), FXMEM_NONLEAVE)
+#define FX_Free(pointer) FXMEM_DefaultFree(pointer, 0)
+#ifdef __cplusplus
+}
+#endif
+#ifdef __cplusplus
+#if defined(_DEBUG)
+#define FX_NEW new(__FILE__, __LINE__)
+#else
+
+#define FX_NEW new
+#endif
+class CFX_Object
+{
+public:
+
+ void* operator new (size_t size, FX_LPCSTR file, int line);
+
+ void operator delete (void* p, FX_LPCSTR file, int line);
+
+ void* operator new (size_t size);
+
+ void operator delete (void* p);
+
+ void* operator new[] (size_t size, FX_LPCSTR file, int line);
+
+ void operator delete[] (void* p, FX_LPCSTR file, int line);
+
+ void* operator new[] (size_t size);
+
+ void operator delete[] (void* p);
+
+ void* operator new (size_t, void* buf)
+ {
+ return buf;
+ }
+
+ void operator delete (void*, void*) {}
+};
+#define FX_NEW_VECTOR(Pointer, Class, Count) \
+ { \
+ Pointer = FX_Alloc(Class, Count); \
+ if (Pointer) { \
+ for (int i = 0; i < (Count); i ++) new (Pointer + i) Class; \
+ } \
+ }
+#define FX_DELETE_VECTOR(Pointer, Class, Count) \
+ { \
+ for (int i = 0; i < (Count); i ++) Pointer[i].~Class(); \
+ FX_Free(Pointer); \
+ }
+class CFX_DestructObject : public CFX_Object
+{
+public:
+
+ virtual ~CFX_DestructObject() {}
+};
+#ifdef __cplusplus
+extern "C" {
+#endif
+typedef struct _IFX_Allocator {
+
+ void* (*m_AllocDebug)(struct _IFX_Allocator* pAllocator, size_t size, FX_LPCSTR file, int line);
+
+ void* (*m_Alloc)(struct _IFX_Allocator* pAllocator, size_t size);
+
+ void* (*m_ReallocDebug)(struct _IFX_Allocator* pAllocator, void* p, size_t size, FX_LPCSTR file, int line);
+
+ void* (*m_Realloc)(struct _IFX_Allocator* pAllocator, void* p, size_t size);
+
+ void (*m_Free)(struct _IFX_Allocator* pAllocator, void* p);
+} IFX_Allocator;
+IFX_Allocator* FXMEM_GetDefAllocator();
+#ifdef __cplusplus
+}
+#endif
+#ifdef _DEBUG
+
+#define FX_Allocator_Alloc(fxAllocator, type, size) \
+ ((fxAllocator) ? (type*)(fxAllocator)->m_AllocDebug((fxAllocator), (size) * sizeof(type), __FILE__, __LINE__) : (FX_Alloc(type, size)))
+
+#define FX_Allocator_Realloc(fxAllocator, type, ptr, new_size) \
+ ((fxAllocator) ? (type*)(fxAllocator)->m_ReallocDebug((fxAllocator), (ptr), (new_size) * sizeof(type), __FILE__, __LINE__) : (FX_Realloc(type, ptr, new_size)))
+#else
+
+#define FX_Allocator_Alloc(fxAllocator, type, size) \
+ ((fxAllocator) ? (type*)(fxAllocator)->m_Alloc((fxAllocator), (size) * sizeof(type)) : (FX_Alloc(type, size)))
+
+#define FX_Allocator_Realloc(fxAllocator, type, ptr, new_size) \
+ ((fxAllocator) ? (type*)(fxAllocator)->m_Realloc((fxAllocator), (ptr), (new_size) * sizeof(type)) : (FX_Realloc(type, ptr, new_size)))
+#endif
+#define FX_Allocator_Free(fxAllocator, ptr) \
+ ((fxAllocator) ? (fxAllocator)->m_Free((fxAllocator), (ptr)) : (FX_Free(ptr)))
+inline void* operator new(size_t size, IFX_Allocator* fxAllocator)
+{
+ return (void*)FX_Allocator_Alloc(fxAllocator, FX_BYTE, size);
+}
+inline void operator delete(void* ptr, IFX_Allocator* fxAllocator)
+{
+}
+#define FX_NewAtAllocator(fxAllocator) \
+ ::new(fxAllocator)
+#define FX_DeleteAtAllocator(pointer, fxAllocator, __class__) \
+ (pointer)->~__class__(); \
+ FX_Allocator_Free(fxAllocator, pointer)
+class CFX_AllocObject
+{
+public:
+
+ void* operator new (size_t size, IFX_Allocator* pAllocator, FX_LPCSTR file, int line);
+#ifndef _FX_NO_EXCEPTION_
+
+ void operator delete (void* p, IFX_Allocator* pAllocator, FX_LPCSTR file, int line);
+#endif
+
+ void* operator new (size_t size, IFX_Allocator* pAllocator);
+
+ void operator delete (void* p);
+#ifndef _FX_NO_EXCEPTION_
+
+ void operator delete (void* p, IFX_Allocator* pAllocator);
+#endif
+
+ void* operator new (size_t, void* buf)
+ {
+ return buf;
+ }
+#ifndef _FX_NO_EXCEPTION_
+
+ void operator delete (void*, void*) {}
+#endif
+
+ IFX_Allocator* GetAllocator() const
+ {
+ return m_pAllocator;
+ }
+private:
+
+ void* operator new[] (size_t size, IFX_Allocator* pAllocator, FX_LPCSTR file, int line)
+ {
+ return operator new(size, pAllocator, file, line);
+ }
+#ifndef _FX_NO_EXCEPTION_
+
+ void operator delete[] (void* p, IFX_Allocator* pAllocator, FX_LPCSTR file, int line) {}
+#endif
+
+ void* operator new[] (size_t size, IFX_Allocator* pAllocator)
+ {
+ return operator new(size, pAllocator);
+ }
+
+ void operator delete[] (void* p) {}
+#ifndef _FX_NO_EXCEPTION_
+
+ void operator delete[] (void* p, IFX_Allocator* pAllocator) {}
+#endif
+protected:
+
+ IFX_Allocator* m_pAllocator;
+};
+#if defined(_DEBUG)
+#define FX_NEWAT(pAllocator) new(pAllocator, __FILE__, __LINE__)
+#else
+
+#define FX_NEWAT(pAllocator) new(pAllocator)
+#endif
+class CFX_GrowOnlyPool : public IFX_Allocator, public CFX_Object
+{
+public:
+
+ CFX_GrowOnlyPool(IFX_Allocator* pAllocator = NULL, size_t trunk_size = 16384);
+
+ ~CFX_GrowOnlyPool();
+
+ void SetAllocator(IFX_Allocator* pAllocator);
+
+ void SetTrunkSize(size_t trunk_size)
+ {
+ m_TrunkSize = trunk_size;
+ }
+
+ void* AllocDebug(size_t size, FX_LPCSTR file, int line)
+ {
+ return Alloc(size);
+ }
+
+ void* Alloc(size_t size);
+
+ void* ReallocDebug(void* p, size_t new_size, FX_LPCSTR file, int line)
+ {
+ return NULL;
+ }
+
+ void* Realloc(void* p, size_t new_size)
+ {
+ return NULL;
+ }
+
+ void Free(void*) {}
+
+ void FreeAll();
+private:
+
+ size_t m_TrunkSize;
+
+ void* m_pFirstTrunk;
+
+ IFX_Allocator* m_pAllocator;
+};
+#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+#define FX_FIXEDMEM_PAGESIZE (4096 * 16)
+#define FX_FIXEDMEM_MIDBLOCKSIZE (4096)
+typedef struct _FX_MEMCONFIG {
+
+ size_t nPageNum_Init8;
+
+ size_t nPageNum_Init16;
+
+ size_t nPageNum_Init32;
+
+ size_t nPageNum_More16;
+
+ size_t nPageNum_More32;
+
+ size_t nPageSize_Mid;
+
+ size_t nPageNum_InitMid;
+
+ size_t nPageNum_MoreMid;
+
+ size_t nPageSize_Large;
+
+ size_t nPageSize_Alone;
+} FX_MEMCONFIG;
+void FXMEM_SetConfig(const FX_MEMCONFIG* memConfig);
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/core/include/fxcrt/fx_stream.h b/core/include/fxcrt/fx_stream.h
index cda5253365..869797f7e9 100644
--- a/core/include/fxcrt/fx_stream.h
+++ b/core/include/fxcrt/fx_stream.h
@@ -1,200 +1,200 @@
-// 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 _FX_STREAM_H_
-#define _FX_STREAM_H_
-#ifndef _FX_MEMORY_H_
-#include "fx_memory.h"
-#endif
-void* FX_OpenFolder(FX_LPCSTR path);
-void* FX_OpenFolder(FX_LPCWSTR path);
-FX_BOOL FX_GetNextFile(void* handle, CFX_ByteString& filename, FX_BOOL& bFolder);
-FX_BOOL FX_GetNextFile(void* handle, CFX_WideString& filename, FX_BOOL& bFolder);
-void FX_CloseFolder(void* handle);
-FX_WCHAR FX_GetFolderSeparator();
-FX_DEFINEHANDLE(FX_HFILE)
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
-#define FX_FILESIZE FX_INT32
-#else
-#include <fcntl.h>
-#include <unistd.h>
-#include <sys/stat.h>
-#ifndef O_BINARY
-#define O_BINARY 0
-#endif
-#ifndef O_LARGEFILE
-#define O_LARGEFILE 0
-#endif
-#define FX_FILESIZE off_t
-#endif
-#define FX_GETBYTEOFFSET32(a) 0
-#define FX_GETBYTEOFFSET40(a) 0
-#define FX_GETBYTEOFFSET48(a) 0
-#define FX_GETBYTEOFFSET56(a) 0
-#define FX_GETBYTEOFFSET24(a) ((FX_BYTE)(a>>24))
-#define FX_GETBYTEOFFSET16(a) ((FX_BYTE)(a>>16))
-#define FX_GETBYTEOFFSET8(a) ((FX_BYTE)(a>>8))
-#define FX_GETBYTEOFFSET0(a) ((FX_BYTE)(a))
-#define FX_FILEMODE_Write 0
-#define FX_FILEMODE_ReadOnly 1
-#define FX_FILEMODE_Truncate 2
-FX_HFILE FX_File_Open(FX_BSTR fileName, FX_DWORD dwMode, IFX_Allocator* pAllocator = NULL);
-FX_HFILE FX_File_Open(FX_WSTR fileName, FX_DWORD dwMode, IFX_Allocator* pAllocator = NULL);
-void FX_File_Close(FX_HFILE hFile, IFX_Allocator* pAllocator = NULL);
-FX_FILESIZE FX_File_GetSize(FX_HFILE hFile);
-FX_FILESIZE FX_File_GetPosition(FX_HFILE hFile);
-FX_FILESIZE FX_File_SetPosition(FX_HFILE hFile, FX_FILESIZE pos);
-size_t FX_File_Read(FX_HFILE hFile, void* pBuffer, size_t szBuffer);
-size_t FX_File_ReadPos(FX_HFILE hFile, void* pBuffer, size_t szBuffer, FX_FILESIZE pos);
-size_t FX_File_Write(FX_HFILE hFile, const void* pBuffer, size_t szBuffer);
-size_t FX_File_WritePos(FX_HFILE hFile, const void* pBuffer, size_t szBuffer, FX_FILESIZE pos);
-FX_BOOL FX_File_Flush(FX_HFILE hFile);
-FX_BOOL FX_File_Truncate(FX_HFILE hFile, FX_FILESIZE szFile);
-FX_BOOL FX_File_Exist(FX_BSTR fileName);
-FX_BOOL FX_File_Exist(FX_WSTR fileName);
-FX_BOOL FX_File_Delete(FX_BSTR fileName);
-FX_BOOL FX_File_Delete(FX_WSTR fileName);
-FX_BOOL FX_File_Copy(FX_BSTR fileNameSrc, FX_BSTR fileNameDst);
-FX_BOOL FX_File_Copy(FX_WSTR fileNameSrc, FX_WSTR fileNameDst);
-FX_BOOL FX_File_Move(FX_BSTR fileNameSrc, FX_BSTR fileNameDst);
-FX_BOOL FX_File_Move(FX_WSTR fileNameSrc, FX_WSTR fileNameDst);
-class IFX_StreamWrite
-{
-public:
-
- virtual void Release() = 0;
-
- virtual FX_BOOL WriteBlock(const void* pData, size_t size) = 0;
-};
-class IFX_FileWrite : public IFX_StreamWrite
-{
-public:
-
- virtual void Release() = 0;
-
- virtual FX_FILESIZE GetSize() = 0;
-
- virtual FX_BOOL Flush() = 0;
-
- virtual FX_BOOL WriteBlock(const void* pData, FX_FILESIZE offset, size_t size) = 0;
- virtual FX_BOOL WriteBlock(const void* pData, size_t size)
- {
- return WriteBlock(pData, GetSize(), size);
- }
-};
-IFX_FileWrite* FX_CreateFileWrite(FX_LPCSTR filename, IFX_Allocator* pAllocator = NULL);
-IFX_FileWrite* FX_CreateFileWrite(FX_LPCWSTR filename, IFX_Allocator* pAllocator = NULL);
-class IFX_StreamRead
-{
-public:
-
- virtual void Release() = 0;
-
- virtual FX_BOOL IsEOF() = 0;
-
- virtual FX_FILESIZE GetPosition() = 0;
-
- virtual size_t ReadBlock(void* buffer, size_t size) = 0;
-};
-class IFX_FileRead : IFX_StreamRead
-{
-public:
-
- virtual void Release() = 0;
-
- virtual FX_FILESIZE GetSize() = 0;
-
- virtual FX_BOOL IsEOF()
- {
- return FALSE;
- }
-
- virtual FX_FILESIZE GetPosition()
- {
- return 0;
- }
-
- virtual FX_BOOL SetRange(FX_FILESIZE offset, FX_FILESIZE size)
- {
- return FALSE;
- }
-
- virtual void ClearRange() {}
-
- virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) = 0;
-
- virtual size_t ReadBlock(void* buffer, size_t size)
- {
- return 0;
- }
-};
-IFX_FileRead* FX_CreateFileRead(FX_LPCSTR filename, IFX_Allocator* pAllocator = NULL);
-IFX_FileRead* FX_CreateFileRead(FX_LPCWSTR filename, IFX_Allocator* pAllocator = NULL);
-class IFX_FileStream : public IFX_FileRead, public IFX_FileWrite
-{
-public:
-
- virtual IFX_FileStream* Retain() = 0;
-
- virtual void Release() = 0;
-
- virtual FX_FILESIZE GetSize() = 0;
-
- virtual FX_BOOL IsEOF() = 0;
-
- virtual FX_FILESIZE GetPosition() = 0;
-
- virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) = 0;
-
- virtual size_t ReadBlock(void* buffer, size_t size) = 0;
-
- virtual FX_BOOL WriteBlock(const void* buffer, FX_FILESIZE offset, size_t size) = 0;
- virtual FX_BOOL WriteBlock(const void* buffer, size_t size)
- {
- return WriteBlock(buffer, GetSize(), size);
- }
-
- virtual FX_BOOL Flush() = 0;
-};
-IFX_FileStream* FX_CreateFileStream(FX_LPCSTR filename, FX_DWORD dwModes, IFX_Allocator* pAllocator = NULL);
-IFX_FileStream* FX_CreateFileStream(FX_LPCWSTR filename, FX_DWORD dwModes, IFX_Allocator* pAllocator = NULL);
-class IFX_MemoryStream : public IFX_FileStream
-{
-public:
-
- virtual FX_BOOL IsConsecutive() const = 0;
-
- virtual void EstimateSize(size_t nInitSize, size_t nGrowSize) = 0;
-
- virtual FX_LPBYTE GetBuffer() const = 0;
-
- virtual void AttachBuffer(FX_LPBYTE pBuffer, size_t nSize, FX_BOOL bTakeOver = FALSE) = 0;
-
- virtual void DetachBuffer() = 0;
-};
-IFX_MemoryStream* FX_CreateMemoryStream(FX_LPBYTE pBuffer, size_t nSize, FX_BOOL bTakeOver = FALSE, IFX_Allocator* pAllocator = NULL);
-IFX_MemoryStream* FX_CreateMemoryStream(FX_BOOL bConsecutive = FALSE, IFX_Allocator* pAllocator = NULL);
-class IFX_BufferRead : public IFX_StreamRead
-{
-public:
-
- virtual void Release() = 0;
-
- virtual FX_BOOL IsEOF() = 0;
-
- virtual FX_FILESIZE GetPosition() = 0;
-
- virtual size_t ReadBlock(void* buffer, size_t size) = 0;
-
- virtual FX_BOOL ReadNextBlock(FX_BOOL bRestart = FALSE) = 0;
-
- virtual FX_LPCBYTE GetBlockBuffer() = 0;
-
- virtual size_t GetBlockSize() = 0;
-
- virtual FX_FILESIZE GetBlockOffset() = 0;
-};
-#endif
+// 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 _FX_STREAM_H_
+#define _FX_STREAM_H_
+#ifndef _FX_MEMORY_H_
+#include "fx_memory.h"
+#endif
+void* FX_OpenFolder(FX_LPCSTR path);
+void* FX_OpenFolder(FX_LPCWSTR path);
+FX_BOOL FX_GetNextFile(void* handle, CFX_ByteString& filename, FX_BOOL& bFolder);
+FX_BOOL FX_GetNextFile(void* handle, CFX_WideString& filename, FX_BOOL& bFolder);
+void FX_CloseFolder(void* handle);
+FX_WCHAR FX_GetFolderSeparator();
+FX_DEFINEHANDLE(FX_HFILE)
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
+#define FX_FILESIZE FX_INT32
+#else
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/stat.h>
+#ifndef O_BINARY
+#define O_BINARY 0
+#endif
+#ifndef O_LARGEFILE
+#define O_LARGEFILE 0
+#endif
+#define FX_FILESIZE off_t
+#endif
+#define FX_GETBYTEOFFSET32(a) 0
+#define FX_GETBYTEOFFSET40(a) 0
+#define FX_GETBYTEOFFSET48(a) 0
+#define FX_GETBYTEOFFSET56(a) 0
+#define FX_GETBYTEOFFSET24(a) ((FX_BYTE)(a>>24))
+#define FX_GETBYTEOFFSET16(a) ((FX_BYTE)(a>>16))
+#define FX_GETBYTEOFFSET8(a) ((FX_BYTE)(a>>8))
+#define FX_GETBYTEOFFSET0(a) ((FX_BYTE)(a))
+#define FX_FILEMODE_Write 0
+#define FX_FILEMODE_ReadOnly 1
+#define FX_FILEMODE_Truncate 2
+FX_HFILE FX_File_Open(FX_BSTR fileName, FX_DWORD dwMode, IFX_Allocator* pAllocator = NULL);
+FX_HFILE FX_File_Open(FX_WSTR fileName, FX_DWORD dwMode, IFX_Allocator* pAllocator = NULL);
+void FX_File_Close(FX_HFILE hFile, IFX_Allocator* pAllocator = NULL);
+FX_FILESIZE FX_File_GetSize(FX_HFILE hFile);
+FX_FILESIZE FX_File_GetPosition(FX_HFILE hFile);
+FX_FILESIZE FX_File_SetPosition(FX_HFILE hFile, FX_FILESIZE pos);
+size_t FX_File_Read(FX_HFILE hFile, void* pBuffer, size_t szBuffer);
+size_t FX_File_ReadPos(FX_HFILE hFile, void* pBuffer, size_t szBuffer, FX_FILESIZE pos);
+size_t FX_File_Write(FX_HFILE hFile, const void* pBuffer, size_t szBuffer);
+size_t FX_File_WritePos(FX_HFILE hFile, const void* pBuffer, size_t szBuffer, FX_FILESIZE pos);
+FX_BOOL FX_File_Flush(FX_HFILE hFile);
+FX_BOOL FX_File_Truncate(FX_HFILE hFile, FX_FILESIZE szFile);
+FX_BOOL FX_File_Exist(FX_BSTR fileName);
+FX_BOOL FX_File_Exist(FX_WSTR fileName);
+FX_BOOL FX_File_Delete(FX_BSTR fileName);
+FX_BOOL FX_File_Delete(FX_WSTR fileName);
+FX_BOOL FX_File_Copy(FX_BSTR fileNameSrc, FX_BSTR fileNameDst);
+FX_BOOL FX_File_Copy(FX_WSTR fileNameSrc, FX_WSTR fileNameDst);
+FX_BOOL FX_File_Move(FX_BSTR fileNameSrc, FX_BSTR fileNameDst);
+FX_BOOL FX_File_Move(FX_WSTR fileNameSrc, FX_WSTR fileNameDst);
+class IFX_StreamWrite
+{
+public:
+
+ virtual void Release() = 0;
+
+ virtual FX_BOOL WriteBlock(const void* pData, size_t size) = 0;
+};
+class IFX_FileWrite : public IFX_StreamWrite
+{
+public:
+
+ virtual void Release() = 0;
+
+ virtual FX_FILESIZE GetSize() = 0;
+
+ virtual FX_BOOL Flush() = 0;
+
+ virtual FX_BOOL WriteBlock(const void* pData, FX_FILESIZE offset, size_t size) = 0;
+ virtual FX_BOOL WriteBlock(const void* pData, size_t size)
+ {
+ return WriteBlock(pData, GetSize(), size);
+ }
+};
+IFX_FileWrite* FX_CreateFileWrite(FX_LPCSTR filename, IFX_Allocator* pAllocator = NULL);
+IFX_FileWrite* FX_CreateFileWrite(FX_LPCWSTR filename, IFX_Allocator* pAllocator = NULL);
+class IFX_StreamRead
+{
+public:
+
+ virtual void Release() = 0;
+
+ virtual FX_BOOL IsEOF() = 0;
+
+ virtual FX_FILESIZE GetPosition() = 0;
+
+ virtual size_t ReadBlock(void* buffer, size_t size) = 0;
+};
+class IFX_FileRead : IFX_StreamRead
+{
+public:
+
+ virtual void Release() = 0;
+
+ virtual FX_FILESIZE GetSize() = 0;
+
+ virtual FX_BOOL IsEOF()
+ {
+ return FALSE;
+ }
+
+ virtual FX_FILESIZE GetPosition()
+ {
+ return 0;
+ }
+
+ virtual FX_BOOL SetRange(FX_FILESIZE offset, FX_FILESIZE size)
+ {
+ return FALSE;
+ }
+
+ virtual void ClearRange() {}
+
+ virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) = 0;
+
+ virtual size_t ReadBlock(void* buffer, size_t size)
+ {
+ return 0;
+ }
+};
+IFX_FileRead* FX_CreateFileRead(FX_LPCSTR filename, IFX_Allocator* pAllocator = NULL);
+IFX_FileRead* FX_CreateFileRead(FX_LPCWSTR filename, IFX_Allocator* pAllocator = NULL);
+class IFX_FileStream : public IFX_FileRead, public IFX_FileWrite
+{
+public:
+
+ virtual IFX_FileStream* Retain() = 0;
+
+ virtual void Release() = 0;
+
+ virtual FX_FILESIZE GetSize() = 0;
+
+ virtual FX_BOOL IsEOF() = 0;
+
+ virtual FX_FILESIZE GetPosition() = 0;
+
+ virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) = 0;
+
+ virtual size_t ReadBlock(void* buffer, size_t size) = 0;
+
+ virtual FX_BOOL WriteBlock(const void* buffer, FX_FILESIZE offset, size_t size) = 0;
+ virtual FX_BOOL WriteBlock(const void* buffer, size_t size)
+ {
+ return WriteBlock(buffer, GetSize(), size);
+ }
+
+ virtual FX_BOOL Flush() = 0;
+};
+IFX_FileStream* FX_CreateFileStream(FX_LPCSTR filename, FX_DWORD dwModes, IFX_Allocator* pAllocator = NULL);
+IFX_FileStream* FX_CreateFileStream(FX_LPCWSTR filename, FX_DWORD dwModes, IFX_Allocator* pAllocator = NULL);
+class IFX_MemoryStream : public IFX_FileStream
+{
+public:
+
+ virtual FX_BOOL IsConsecutive() const = 0;
+
+ virtual void EstimateSize(size_t nInitSize, size_t nGrowSize) = 0;
+
+ virtual FX_LPBYTE GetBuffer() const = 0;
+
+ virtual void AttachBuffer(FX_LPBYTE pBuffer, size_t nSize, FX_BOOL bTakeOver = FALSE) = 0;
+
+ virtual void DetachBuffer() = 0;
+};
+IFX_MemoryStream* FX_CreateMemoryStream(FX_LPBYTE pBuffer, size_t nSize, FX_BOOL bTakeOver = FALSE, IFX_Allocator* pAllocator = NULL);
+IFX_MemoryStream* FX_CreateMemoryStream(FX_BOOL bConsecutive = FALSE, IFX_Allocator* pAllocator = NULL);
+class IFX_BufferRead : public IFX_StreamRead
+{
+public:
+
+ virtual void Release() = 0;
+
+ virtual FX_BOOL IsEOF() = 0;
+
+ virtual FX_FILESIZE GetPosition() = 0;
+
+ virtual size_t ReadBlock(void* buffer, size_t size) = 0;
+
+ virtual FX_BOOL ReadNextBlock(FX_BOOL bRestart = FALSE) = 0;
+
+ virtual FX_LPCBYTE GetBlockBuffer() = 0;
+
+ virtual size_t GetBlockSize() = 0;
+
+ virtual FX_FILESIZE GetBlockOffset() = 0;
+};
+#endif
diff --git a/core/include/fxcrt/fx_string.h b/core/include/fxcrt/fx_string.h
index 563964cdf7..08fb83cfd7 100644
--- a/core/include/fxcrt/fx_string.h
+++ b/core/include/fxcrt/fx_string.h
@@ -1,870 +1,870 @@
-// 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 _FX_STRING_H_
-#define _FX_STRING_H_
-class CFX_ByteStringC;
-class CFX_ByteString;
-class CFX_WideStringC;
-class CFX_WideString;
-struct CFX_CharMap;
-class CFX_BinaryBuf;
-typedef int FX_STRSIZE;
-class CFX_ByteStringL;
-class CFX_WideStringL;
-class CFX_ByteStringC : public CFX_Object
-{
-public:
-
- CFX_ByteStringC()
- {
- m_Ptr = NULL;
- m_Length = 0;
- }
-
- CFX_ByteStringC(FX_LPCBYTE ptr, FX_STRSIZE size)
- {
- m_Ptr = ptr;
- m_Length = size;
- }
-
- CFX_ByteStringC(FX_LPCSTR ptr)
- {
- m_Ptr = (FX_LPCBYTE)ptr;
- m_Length = ptr ? (FX_STRSIZE)FXSYS_strlen(ptr) : 0;
- }
-
- CFX_ByteStringC(FX_CHAR& ch)
- {
- m_Ptr = (FX_LPCBYTE)&ch;
- m_Length = 1;
- }
-
- CFX_ByteStringC(FX_LPCSTR ptr, FX_STRSIZE len)
- {
- m_Ptr = (FX_LPCBYTE)ptr;
- if (len == -1) {
- m_Length = (FX_STRSIZE)FXSYS_strlen(ptr);
- } else {
- m_Length = len;
- }
- }
-
- CFX_ByteStringC(const CFX_ByteStringC& src)
- {
- m_Ptr = src.m_Ptr;
- m_Length = src.m_Length;
- }
-
- CFX_ByteStringC(const CFX_ByteString& src);
-
- CFX_ByteStringC& operator = (FX_LPCSTR src)
- {
- m_Ptr = (FX_LPCBYTE)src;
- m_Length = (FX_STRSIZE)FXSYS_strlen(src);
- return *this;
- }
-
- CFX_ByteStringC& operator = (const CFX_ByteStringC& src)
- {
- m_Ptr = src.m_Ptr;
- m_Length = src.m_Length;
- return *this;
- }
-
- CFX_ByteStringC& operator = (const CFX_ByteString& src);
-
- bool operator == (const CFX_ByteStringC& str) const
- {
- return str.m_Length == m_Length && FXSYS_memcmp32(str.m_Ptr, m_Ptr, m_Length) == 0;
- }
-
- bool operator != (const CFX_ByteStringC& str) const
- {
- return str.m_Length != m_Length || FXSYS_memcmp32(str.m_Ptr, m_Ptr, m_Length) != 0;
- }
-#define FXBSTR_ID(c1, c2, c3, c4) ((c1 << 24) | (c2 << 16) | (c3 << 8) | (c4))
-
- FX_DWORD GetID(FX_STRSIZE start_pos = 0) const;
-
- FX_LPCBYTE GetPtr() const
- {
- return m_Ptr;
- }
-
- FX_LPCSTR GetCStr() const
- {
- return (FX_LPCSTR)m_Ptr;
- }
-
- FX_STRSIZE GetLength() const
- {
- return m_Length;
- }
-
- bool IsEmpty() const
- {
- return m_Length == 0;
- }
-
- operator FX_LPCBYTE() const
- {
- return m_Ptr;
- }
-
- FX_BYTE GetAt(FX_STRSIZE index) const
- {
- return m_Ptr[index];
- }
-
- CFX_ByteStringC Mid(FX_STRSIZE index, FX_STRSIZE count = -1) const
- {
- if (index < 0) {
- index = 0;
- }
- if (index > m_Length) {
- return CFX_ByteStringC();
- }
- if (count < 0 || count > m_Length - index) {
- count = m_Length - index;
- }
- return CFX_ByteStringC(m_Ptr + index, count);
- }
-protected:
-
- FX_LPCBYTE m_Ptr;
-
- FX_STRSIZE m_Length;
-private:
-
- void* operator new (size_t) throw()
- {
- return NULL;
- }
-};
-typedef const CFX_ByteStringC& FX_BSTR;
-#define FX_BSTRC(str) CFX_ByteStringC(str, sizeof str-1)
-struct CFX_StringData {
-
- long m_nRefs;
-
- FX_STRSIZE m_nDataLength;
-
- FX_STRSIZE m_nAllocLength;
-
- FX_CHAR m_String[1];
-};
-class CFX_ByteString : public CFX_Object
-{
-public:
-
- CFX_ByteString()
- {
- m_pData = NULL;
- }
-
- CFX_ByteString(const CFX_ByteString& str);
-
- CFX_ByteString(char ch);
-
- CFX_ByteString(FX_LPCSTR ptr, FX_STRSIZE len = -1);
-
- CFX_ByteString(FX_LPCBYTE ptr, FX_STRSIZE len);
-
- CFX_ByteString(FX_BSTR bstrc);
-
- CFX_ByteString(FX_BSTR bstrc1, FX_BSTR bstrc2);
-
- ~CFX_ByteString();
-
- static CFX_ByteString FromUnicode(FX_LPCWSTR ptr, FX_STRSIZE len = -1);
-
- static CFX_ByteString FromUnicode(const CFX_WideString& str);
-
- operator FX_LPCSTR() const
- {
- return m_pData ? m_pData->m_String : "";
- }
-
- operator FX_LPCBYTE() const
- {
- return m_pData ? (FX_LPCBYTE)m_pData->m_String : NULL;
- }
-
- FX_STRSIZE GetLength() const
- {
- return m_pData ? m_pData->m_nDataLength : 0;
- }
-
- bool IsEmpty() const
- {
- return !GetLength();
- }
-
- int Compare(FX_BSTR str) const;
-
-
- bool Equal(FX_BSTR str) const;
-
-
- bool EqualNoCase(FX_BSTR str) const;
-
- bool operator == (FX_LPCSTR str) const
- {
- return Equal(str);
- }
-
- bool operator == (FX_BSTR str) const
- {
- return Equal(str);
- }
-
- bool operator == (const CFX_ByteString& str) const;
-
- bool operator != (FX_LPCSTR str) const
- {
- return !Equal(str);
- }
-
- bool operator != (FX_BSTR str) const
- {
- return !Equal(str);
- }
-
- bool operator != (const CFX_ByteString& str) const
- {
- return !operator==(str);
- }
-
- void Empty();
-
- const CFX_ByteString& operator = (FX_LPCSTR str);
-
- const CFX_ByteString& operator = (FX_BSTR bstrc);
-
- const CFX_ByteString& operator = (const CFX_ByteString& stringSrc);
-
- const CFX_ByteString& operator = (const CFX_BinaryBuf& buf);
-
- void Load(FX_LPCBYTE str, FX_STRSIZE len);
-
- const CFX_ByteString& operator += (FX_CHAR ch);
-
- const CFX_ByteString& operator += (FX_LPCSTR str);
-
- const CFX_ByteString& operator += (const CFX_ByteString& str);
-
- const CFX_ByteString& operator += (FX_BSTR bstrc);
-
- FX_BYTE GetAt(FX_STRSIZE nIndex) const
- {
- return m_pData ? m_pData->m_String[nIndex] : 0;
- }
-
- FX_BYTE operator[](FX_STRSIZE nIndex) const
- {
- return m_pData ? m_pData->m_String[nIndex] : 0;
- }
-
- void SetAt(FX_STRSIZE nIndex, FX_CHAR ch);
-
- FX_STRSIZE Insert(FX_STRSIZE index, FX_CHAR ch);
-
- FX_STRSIZE Delete(FX_STRSIZE index, FX_STRSIZE count = 1);
-
-
- void Format(FX_LPCSTR lpszFormat, ... );
-
- void FormatV(FX_LPCSTR lpszFormat, va_list argList);
-
-
- void Reserve(FX_STRSIZE len);
-
- FX_LPSTR GetBuffer(FX_STRSIZE len);
-
- FX_LPSTR LockBuffer();
-
- void ReleaseBuffer(FX_STRSIZE len = -1);
-
- CFX_ByteString Mid(FX_STRSIZE first) const;
-
- CFX_ByteString Mid(FX_STRSIZE first, FX_STRSIZE count) const;
-
- CFX_ByteString Left(FX_STRSIZE count) const;
-
- CFX_ByteString Right(FX_STRSIZE count) const;
-
- FX_STRSIZE Find(FX_BSTR lpszSub, FX_STRSIZE start = 0) const;
-
- FX_STRSIZE Find(FX_CHAR ch, FX_STRSIZE start = 0) const;
-
- FX_STRSIZE ReverseFind(FX_CHAR ch) const;
-
- void MakeLower();
-
- void MakeUpper();
-
- void TrimRight();
-
- void TrimRight(FX_CHAR chTarget);
-
- void TrimRight(FX_BSTR lpszTargets);
-
- void TrimLeft();
-
- void TrimLeft(FX_CHAR chTarget);
-
- void TrimLeft(FX_BSTR lpszTargets);
-
- FX_STRSIZE Replace(FX_BSTR lpszOld, FX_BSTR lpszNew);
-
- FX_STRSIZE Remove(FX_CHAR ch);
-
- CFX_WideString UTF8Decode() const;
-
- void ConvertFrom(const CFX_WideString& str, CFX_CharMap* pCharMap = NULL);
-
- FX_DWORD GetID(FX_STRSIZE start_pos = 0) const;
-
- static CFX_ByteString LoadFromFile(FX_BSTR file_path);
-#define FXFORMAT_SIGNED 1
-#define FXFORMAT_HEX 2
-#define FXFORMAT_CAPITAL 4
-
- static CFX_ByteString FormatInteger(int i, FX_DWORD flags = 0);
-
- static CFX_ByteString FormatFloat(FX_FLOAT f, int precision = 0);
-protected:
-
- struct CFX_StringData* m_pData;
- void AllocCopy(CFX_ByteString& dest, FX_STRSIZE nCopyLen, FX_STRSIZE nCopyIndex, FX_STRSIZE nExtraLen) const;
- void AssignCopy(FX_STRSIZE nSrcLen, FX_LPCSTR lpszSrcData);
- void ConcatCopy(FX_STRSIZE nSrc1Len, FX_LPCSTR lpszSrc1Data, FX_STRSIZE nSrc2Len, FX_LPCSTR lpszSrc2Data);
- void ConcatInPlace(FX_STRSIZE nSrcLen, FX_LPCSTR lpszSrcData);
- void CopyBeforeWrite();
- void AllocBeforeWrite(FX_STRSIZE nLen);
-};
-inline CFX_ByteStringC::CFX_ByteStringC(const CFX_ByteString& src)
-{
- m_Ptr = (FX_LPCBYTE)src;
- m_Length = src.GetLength();
-}
-inline CFX_ByteStringC& CFX_ByteStringC::operator = (const CFX_ByteString& src)
-{
- m_Ptr = (FX_LPCBYTE)src;
- m_Length = src.GetLength();
- return *this;
-}
-
-inline CFX_ByteString operator + (FX_BSTR str1, FX_BSTR str2)
-{
- return CFX_ByteString(str1, str2);
-}
-inline CFX_ByteString operator + (FX_BSTR str1, FX_LPCSTR str2)
-{
- return CFX_ByteString(str1, str2);
-}
-inline CFX_ByteString operator + (FX_LPCSTR str1, FX_BSTR str2)
-{
- return CFX_ByteString(str1, str2);
-}
-inline CFX_ByteString operator + (FX_BSTR str1, FX_CHAR ch)
-{
- return CFX_ByteString(str1, CFX_ByteStringC(ch));
-}
-inline CFX_ByteString operator + (FX_CHAR ch, FX_BSTR str2)
-{
- return CFX_ByteString(ch, str2);
-}
-inline CFX_ByteString operator + (const CFX_ByteString& str1, const CFX_ByteString& str2)
-{
- return CFX_ByteString(str1, str2);
-}
-inline CFX_ByteString operator + (const CFX_ByteString& str1, FX_CHAR ch)
-{
- return CFX_ByteString(str1, CFX_ByteStringC(ch));
-}
-inline CFX_ByteString operator + (FX_CHAR ch, const CFX_ByteString& str2)
-{
- return CFX_ByteString(ch, str2);
-}
-inline CFX_ByteString operator + (const CFX_ByteString& str1, FX_LPCSTR str2)
-{
- return CFX_ByteString(str1, str2);
-}
-inline CFX_ByteString operator + (FX_LPCSTR str1, const CFX_ByteString& str2)
-{
- return CFX_ByteString(str1, str2);
-}
-inline CFX_ByteString operator + (const CFX_ByteString& str1, FX_BSTR str2)
-{
- return CFX_ByteString(str1, str2);
-}
-inline CFX_ByteString operator + (FX_BSTR str1, const CFX_ByteString& str2)
-{
- return CFX_ByteString(str1, str2);
-}
-class CFX_StringBufBase : public CFX_Object
-{
-public:
-
- CFX_StringBufBase(FX_STRSIZE limit)
- {
- m_Size = 0;
- m_Limit = limit;
- }
-
- FX_CHAR* GetPtr() const
- {
- return (FX_CHAR*)(this + 1);
- }
-
- FX_STRSIZE GetSize() const
- {
- return m_Size;
- }
-
- void Empty()
- {
- m_Size = 0;
- }
-
- void Copy(FX_BSTR str);
-
- void Append(FX_BSTR str);
-
- void Append(int i, FX_DWORD flags = 0);
-
- CFX_ByteStringC GetStringC() const
- {
- return CFX_ByteStringC((FX_CHAR*)(this + 1), m_Size);
- }
-
- CFX_ByteString GetString() const
- {
- return CFX_ByteString((FX_CHAR*)(this + 1), m_Size);
- }
-protected:
-
- FX_STRSIZE m_Limit;
-
- FX_STRSIZE m_Size;
-};
-template<FX_STRSIZE limit>
-class CFX_StringBufTemplate : public CFX_StringBufBase
-{
-public:
-
- CFX_StringBufTemplate() : CFX_StringBufBase(limit) {}
-
- FX_CHAR m_Buffer[limit];
-};
-typedef CFX_StringBufTemplate<256> CFX_StringBuf256;
-class CFX_WideStringC : public CFX_Object
-{
-public:
-
- CFX_WideStringC()
- {
- m_Ptr = NULL;
- m_Length = 0;
- }
-
- CFX_WideStringC(FX_LPCWSTR ptr)
- {
- m_Ptr = ptr;
- m_Length = ptr ? (FX_STRSIZE)FXSYS_wcslen(ptr) : 0;
- }
-
- CFX_WideStringC(FX_WCHAR& ch)
- {
- m_Ptr = &ch;
- m_Length = 1;
- }
-
- CFX_WideStringC(FX_LPCWSTR ptr, FX_STRSIZE len)
- {
- m_Ptr = ptr;
- if (len == -1) {
- m_Length = (FX_STRSIZE)FXSYS_wcslen(ptr);
- } else {
- m_Length = len;
- }
- }
-
- CFX_WideStringC(const CFX_WideStringC& src)
- {
- m_Ptr = src.m_Ptr;
- m_Length = src.m_Length;
- }
-
- CFX_WideStringC(const CFX_WideString& src);
-
- CFX_WideStringC& operator = (FX_LPCWSTR src)
- {
- m_Ptr = src;
- m_Length = (FX_STRSIZE)FXSYS_wcslen(src);
- return *this;
- }
-
- CFX_WideStringC& operator = (const CFX_WideStringC& src)
- {
- m_Ptr = src.m_Ptr;
- m_Length = src.m_Length;
- return *this;
- }
-
- CFX_WideStringC& operator = (const CFX_WideString& src);
-
- bool operator == (const CFX_WideStringC& str) const
- {
- return str.m_Length == m_Length && FXSYS_memcmp32(str.m_Ptr, m_Ptr, m_Length * sizeof(FX_WCHAR)) == 0;
- }
-
- bool operator != (const CFX_WideStringC& str) const
- {
- return str.m_Length != m_Length || FXSYS_memcmp32(str.m_Ptr, m_Ptr, m_Length * sizeof(FX_WCHAR)) != 0;
- }
-
- FX_LPCWSTR GetPtr() const
- {
- return m_Ptr;
- }
-
- FX_STRSIZE GetLength() const
- {
- return m_Length;
- }
-
- bool IsEmpty() const
- {
- return m_Length == 0;
- }
-
- FX_WCHAR GetAt(FX_STRSIZE index) const
- {
- return m_Ptr[index];
- }
-
- CFX_WideStringC Left(FX_STRSIZE count) const
- {
- if (count < 1) {
- return CFX_WideStringC();
- }
- if (count > m_Length) {
- count = m_Length;
- }
- return CFX_WideStringC(m_Ptr, count);
- }
-
- CFX_WideStringC Mid(FX_STRSIZE index, FX_STRSIZE count = -1) const
- {
- if (index < 0) {
- index = 0;
- }
- if (index > m_Length) {
- return CFX_WideStringC();
- }
- if (count < 0 || count > m_Length - index) {
- count = m_Length - index;
- }
- return CFX_WideStringC(m_Ptr + index, count);
- }
-
- CFX_WideStringC Right(FX_STRSIZE count) const
- {
- if (count < 1) {
- return CFX_WideStringC();
- }
- if (count > m_Length) {
- count = m_Length;
- }
- return CFX_WideStringC(m_Ptr + m_Length - count, count);
- }
-protected:
-
- FX_LPCWSTR m_Ptr;
-
- FX_STRSIZE m_Length;
-private:
-
- void* operator new (size_t) throw()
- {
- return NULL;
- }
-};
-typedef const CFX_WideStringC& FX_WSTR;
-#define FX_WSTRC(wstr) CFX_WideStringC((FX_LPCWSTR)wstr, sizeof(wstr) / sizeof(FX_WCHAR) - 1)
-struct CFX_StringDataW {
-
- long m_nRefs;
-
- FX_STRSIZE m_nDataLength;
-
- FX_STRSIZE m_nAllocLength;
-
- FX_WCHAR m_String[1];
-};
-class CFX_WideString : public CFX_Object
-{
-public:
-
- CFX_WideString()
- {
- m_pData = NULL;
- }
-
- CFX_WideString(const CFX_WideString& str);
-
- CFX_WideString(FX_LPCWSTR ptr, FX_STRSIZE len = -1)
- {
- InitStr(ptr, len);
- }
-
- CFX_WideString(FX_WCHAR ch);
-
- CFX_WideString(const CFX_WideStringC& str);
-
- CFX_WideString(const CFX_WideStringC& str1, const CFX_WideStringC& str2);
-
- ~CFX_WideString();
-
- static CFX_WideString FromLocal(const char* str, FX_STRSIZE len = -1);
-
- static CFX_WideString FromUTF8(const char* str, FX_STRSIZE len = -1);
-
- static CFX_WideString FromUTF16LE(const unsigned short* str, FX_STRSIZE len = -1);
-
- operator FX_LPCWSTR() const
- {
- return m_pData ? m_pData->m_String : (FX_WCHAR*)L"";
- }
-
- void Empty();
-
-
- FX_BOOL IsEmpty() const
- {
- return !GetLength();
- }
-
- FX_STRSIZE GetLength() const
- {
- return m_pData ? m_pData->m_nDataLength : 0;
- }
-
- const CFX_WideString& operator = (FX_LPCWSTR str);
-
- const CFX_WideString& operator =(const CFX_WideString& stringSrc);
-
- const CFX_WideString& operator =(const CFX_WideStringC& stringSrc);
-
- const CFX_WideString& operator += (FX_LPCWSTR str);
-
- const CFX_WideString& operator += (FX_WCHAR ch);
-
- const CFX_WideString& operator += (const CFX_WideString& str);
-
- const CFX_WideString& operator += (const CFX_WideStringC& str);
-
- FX_WCHAR GetAt(FX_STRSIZE nIndex) const
- {
- return m_pData ? m_pData->m_String[nIndex] : 0;
- }
-
- FX_WCHAR operator[](FX_STRSIZE nIndex) const
- {
- return m_pData ? m_pData->m_String[nIndex] : 0;
- }
-
- void SetAt(FX_STRSIZE nIndex, FX_WCHAR ch);
-
- int Compare(FX_LPCWSTR str) const;
-
- int Compare(const CFX_WideString& str) const;
-
- int CompareNoCase(FX_LPCWSTR str) const;
-
- bool Equal(const CFX_WideStringC& str) const;
-
- CFX_WideString Mid(FX_STRSIZE first) const;
-
- CFX_WideString Mid(FX_STRSIZE first, FX_STRSIZE count) const;
-
- CFX_WideString Left(FX_STRSIZE count) const;
-
- CFX_WideString Right(FX_STRSIZE count) const;
-
- FX_STRSIZE Insert(FX_STRSIZE index, FX_WCHAR ch);
-
- FX_STRSIZE Delete(FX_STRSIZE index, FX_STRSIZE count = 1);
-
- void Format(FX_LPCWSTR lpszFormat, ... );
-
- void FormatV(FX_LPCWSTR lpszFormat, va_list argList);
-
- void MakeLower();
-
- void MakeUpper();
-
- void TrimRight();
-
- void TrimRight(FX_WCHAR chTarget);
-
- void TrimRight(FX_LPCWSTR lpszTargets);
-
- void TrimLeft();
-
- void TrimLeft(FX_WCHAR chTarget);
-
- void TrimLeft(FX_LPCWSTR lpszTargets);
-
- void Reserve(FX_STRSIZE len);
-
- FX_LPWSTR GetBuffer(FX_STRSIZE len);
-
- FX_LPWSTR LockBuffer();
-
- void ReleaseBuffer(FX_STRSIZE len = -1);
-
- int GetInteger() const;
-
- FX_FLOAT GetFloat() const;
-
- FX_STRSIZE Find(FX_LPCWSTR lpszSub, FX_STRSIZE start = 0) const;
-
- FX_STRSIZE Find(FX_WCHAR ch, FX_STRSIZE start = 0) const;
-
- FX_STRSIZE Replace(FX_LPCWSTR lpszOld, FX_LPCWSTR lpszNew);
-
- FX_STRSIZE Remove(FX_WCHAR ch);
-
- CFX_ByteString UTF8Encode() const;
-
- CFX_ByteString UTF16LE_Encode(FX_BOOL bTerminate = TRUE) const;
-
- void ConvertFrom(const CFX_ByteString& str, CFX_CharMap* pCharMap = NULL);
-protected:
- void InitStr(FX_LPCWSTR ptr, int len);
-
- CFX_StringDataW* m_pData;
- void CopyBeforeWrite();
- void AllocBeforeWrite(FX_STRSIZE nLen);
- void ConcatInPlace(FX_STRSIZE nSrcLen, FX_LPCWSTR lpszSrcData);
- void ConcatCopy(FX_STRSIZE nSrc1Len, FX_LPCWSTR lpszSrc1Data, FX_STRSIZE nSrc2Len, FX_LPCWSTR lpszSrc2Data);
- void AssignCopy(FX_STRSIZE nSrcLen, FX_LPCWSTR lpszSrcData);
- void AllocCopy(CFX_WideString& dest, FX_STRSIZE nCopyLen, FX_STRSIZE nCopyIndex, FX_STRSIZE nExtraLen) const;
-};
-inline CFX_WideStringC::CFX_WideStringC(const CFX_WideString& src)
-{
- m_Ptr = (FX_LPCWSTR)src;
- m_Length = src.GetLength();
-}
-inline CFX_WideStringC& CFX_WideStringC::operator = (const CFX_WideString& src)
-{
- m_Ptr = (FX_LPCWSTR)src;
- m_Length = src.GetLength();
- return *this;
-}
-
-inline CFX_WideString operator + (const CFX_WideStringC& str1, const CFX_WideStringC& str2)
-{
- return CFX_WideString(str1, str2);
-}
-inline CFX_WideString operator + (const CFX_WideStringC& str1, FX_LPCWSTR str2)
-{
- return CFX_WideString(str1, str2);
-}
-inline CFX_WideString operator + (FX_LPCWSTR str1, const CFX_WideStringC& str2)
-{
- return CFX_WideString(str1, str2);
-}
-inline CFX_WideString operator + (const CFX_WideStringC& str1, FX_WCHAR ch)
-{
- return CFX_WideString(str1, CFX_WideStringC(ch));
-}
-inline CFX_WideString operator + (FX_WCHAR ch, const CFX_WideStringC& str2)
-{
- return CFX_WideString(ch, str2);
-}
-inline CFX_WideString operator + (const CFX_WideString& str1, const CFX_WideString& str2)
-{
- return CFX_WideString(str1, str2);
-}
-inline CFX_WideString operator + (const CFX_WideString& str1, FX_WCHAR ch)
-{
- return CFX_WideString(str1, CFX_WideStringC(ch));
-}
-inline CFX_WideString operator + (FX_WCHAR ch, const CFX_WideString& str2)
-{
- return CFX_WideString(ch, str2);
-}
-inline CFX_WideString operator + (const CFX_WideString& str1, FX_LPCWSTR str2)
-{
- return CFX_WideString(str1, str2);
-}
-inline CFX_WideString operator + (FX_LPCWSTR str1, const CFX_WideString& str2)
-{
- return CFX_WideString(str1, str2);
-}
-inline CFX_WideString operator + (const CFX_WideString& str1, const CFX_WideStringC& str2)
-{
- return CFX_WideString(str1, str2);
-}
-inline CFX_WideString operator + (const CFX_WideStringC& str1, const CFX_WideString& str2)
-{
- return CFX_WideString(str1, str2);
-}
-
-bool operator==(const CFX_WideString& s1, const CFX_WideString& s2);
-bool operator==(const CFX_WideString& s1, const CFX_WideStringC& s2);
-bool operator==(const CFX_WideStringC& s1, const CFX_WideString& s2);
-bool operator== (const CFX_WideString& s1, FX_LPCWSTR s2);
-bool operator==(FX_LPCWSTR s1, const CFX_WideString& s2);
-bool operator!=(const CFX_WideString& s1, const CFX_WideString& s2);
-bool operator!=(const CFX_WideString& s1, const CFX_WideStringC& s2);
-bool operator!=(const CFX_WideStringC& s1, const CFX_WideString& s2);
-bool operator!= (const CFX_WideString& s1, FX_LPCWSTR s2);
-bool operator!=(FX_LPCWSTR s1, const CFX_WideString& s2);
-FX_FLOAT FX_atof(FX_BSTR str);
-void FX_atonum(FX_BSTR str, FX_BOOL& bInteger, void* pData);
-FX_STRSIZE FX_ftoa(FX_FLOAT f, FX_LPSTR buf);
-CFX_ByteString FX_UTF8Encode(FX_LPCWSTR pwsStr, FX_STRSIZE len);
-inline CFX_ByteString FX_UTF8Encode(FX_WSTR wsStr)
-{
- return FX_UTF8Encode(wsStr.GetPtr(), wsStr.GetLength());
-}
-inline CFX_ByteString FX_UTF8Encode(const CFX_WideString &wsStr)
-{
- return FX_UTF8Encode((FX_LPCWSTR)wsStr, wsStr.GetLength());
-}
-class CFX_ByteStringL : public CFX_ByteStringC
-{
-public:
- CFX_ByteStringL() : CFX_ByteStringC() {}
- ~CFX_ByteStringL() {}
-
- void Empty(IFX_Allocator* pAllocator);
- FX_LPSTR AllocBuffer(FX_STRSIZE length, IFX_Allocator* pAllocator);
-
- void Set(FX_BSTR src, IFX_Allocator* pAllocator);
-};
-class CFX_WideStringL : public CFX_WideStringC
-{
-public:
- CFX_WideStringL() : CFX_WideStringC() {}
- ~CFX_WideStringL() {}
-
- void Empty(IFX_Allocator* pAllocator);
- void Set(FX_WSTR src, IFX_Allocator* pAllocator);
-
- int GetInteger() const;
- FX_FLOAT GetFloat() const;
-
- void TrimRight(FX_LPCWSTR lpszTargets);
-};
-void FX_UTF8Encode(FX_LPCWSTR pwsStr, FX_STRSIZE len, CFX_ByteStringL &utf8Str, IFX_Allocator* pAllocator = NULL);
-#endif
+// 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 _FX_STRING_H_
+#define _FX_STRING_H_
+class CFX_ByteStringC;
+class CFX_ByteString;
+class CFX_WideStringC;
+class CFX_WideString;
+struct CFX_CharMap;
+class CFX_BinaryBuf;
+typedef int FX_STRSIZE;
+class CFX_ByteStringL;
+class CFX_WideStringL;
+class CFX_ByteStringC : public CFX_Object
+{
+public:
+
+ CFX_ByteStringC()
+ {
+ m_Ptr = NULL;
+ m_Length = 0;
+ }
+
+ CFX_ByteStringC(FX_LPCBYTE ptr, FX_STRSIZE size)
+ {
+ m_Ptr = ptr;
+ m_Length = size;
+ }
+
+ CFX_ByteStringC(FX_LPCSTR ptr)
+ {
+ m_Ptr = (FX_LPCBYTE)ptr;
+ m_Length = ptr ? (FX_STRSIZE)FXSYS_strlen(ptr) : 0;
+ }
+
+ CFX_ByteStringC(FX_CHAR& ch)
+ {
+ m_Ptr = (FX_LPCBYTE)&ch;
+ m_Length = 1;
+ }
+
+ CFX_ByteStringC(FX_LPCSTR ptr, FX_STRSIZE len)
+ {
+ m_Ptr = (FX_LPCBYTE)ptr;
+ if (len == -1) {
+ m_Length = (FX_STRSIZE)FXSYS_strlen(ptr);
+ } else {
+ m_Length = len;
+ }
+ }
+
+ CFX_ByteStringC(const CFX_ByteStringC& src)
+ {
+ m_Ptr = src.m_Ptr;
+ m_Length = src.m_Length;
+ }
+
+ CFX_ByteStringC(const CFX_ByteString& src);
+
+ CFX_ByteStringC& operator = (FX_LPCSTR src)
+ {
+ m_Ptr = (FX_LPCBYTE)src;
+ m_Length = (FX_STRSIZE)FXSYS_strlen(src);
+ return *this;
+ }
+
+ CFX_ByteStringC& operator = (const CFX_ByteStringC& src)
+ {
+ m_Ptr = src.m_Ptr;
+ m_Length = src.m_Length;
+ return *this;
+ }
+
+ CFX_ByteStringC& operator = (const CFX_ByteString& src);
+
+ bool operator == (const CFX_ByteStringC& str) const
+ {
+ return str.m_Length == m_Length && FXSYS_memcmp32(str.m_Ptr, m_Ptr, m_Length) == 0;
+ }
+
+ bool operator != (const CFX_ByteStringC& str) const
+ {
+ return str.m_Length != m_Length || FXSYS_memcmp32(str.m_Ptr, m_Ptr, m_Length) != 0;
+ }
+#define FXBSTR_ID(c1, c2, c3, c4) ((c1 << 24) | (c2 << 16) | (c3 << 8) | (c4))
+
+ FX_DWORD GetID(FX_STRSIZE start_pos = 0) const;
+
+ FX_LPCBYTE GetPtr() const
+ {
+ return m_Ptr;
+ }
+
+ FX_LPCSTR GetCStr() const
+ {
+ return (FX_LPCSTR)m_Ptr;
+ }
+
+ FX_STRSIZE GetLength() const
+ {
+ return m_Length;
+ }
+
+ bool IsEmpty() const
+ {
+ return m_Length == 0;
+ }
+
+ operator FX_LPCBYTE() const
+ {
+ return m_Ptr;
+ }
+
+ FX_BYTE GetAt(FX_STRSIZE index) const
+ {
+ return m_Ptr[index];
+ }
+
+ CFX_ByteStringC Mid(FX_STRSIZE index, FX_STRSIZE count = -1) const
+ {
+ if (index < 0) {
+ index = 0;
+ }
+ if (index > m_Length) {
+ return CFX_ByteStringC();
+ }
+ if (count < 0 || count > m_Length - index) {
+ count = m_Length - index;
+ }
+ return CFX_ByteStringC(m_Ptr + index, count);
+ }
+protected:
+
+ FX_LPCBYTE m_Ptr;
+
+ FX_STRSIZE m_Length;
+private:
+
+ void* operator new (size_t) throw()
+ {
+ return NULL;
+ }
+};
+typedef const CFX_ByteStringC& FX_BSTR;
+#define FX_BSTRC(str) CFX_ByteStringC(str, sizeof str-1)
+struct CFX_StringData {
+
+ long m_nRefs;
+
+ FX_STRSIZE m_nDataLength;
+
+ FX_STRSIZE m_nAllocLength;
+
+ FX_CHAR m_String[1];
+};
+class CFX_ByteString : public CFX_Object
+{
+public:
+
+ CFX_ByteString()
+ {
+ m_pData = NULL;
+ }
+
+ CFX_ByteString(const CFX_ByteString& str);
+
+ CFX_ByteString(char ch);
+
+ CFX_ByteString(FX_LPCSTR ptr, FX_STRSIZE len = -1);
+
+ CFX_ByteString(FX_LPCBYTE ptr, FX_STRSIZE len);
+
+ CFX_ByteString(FX_BSTR bstrc);
+
+ CFX_ByteString(FX_BSTR bstrc1, FX_BSTR bstrc2);
+
+ ~CFX_ByteString();
+
+ static CFX_ByteString FromUnicode(FX_LPCWSTR ptr, FX_STRSIZE len = -1);
+
+ static CFX_ByteString FromUnicode(const CFX_WideString& str);
+
+ operator FX_LPCSTR() const
+ {
+ return m_pData ? m_pData->m_String : "";
+ }
+
+ operator FX_LPCBYTE() const
+ {
+ return m_pData ? (FX_LPCBYTE)m_pData->m_String : NULL;
+ }
+
+ FX_STRSIZE GetLength() const
+ {
+ return m_pData ? m_pData->m_nDataLength : 0;
+ }
+
+ bool IsEmpty() const
+ {
+ return !GetLength();
+ }
+
+ int Compare(FX_BSTR str) const;
+
+
+ bool Equal(FX_BSTR str) const;
+
+
+ bool EqualNoCase(FX_BSTR str) const;
+
+ bool operator == (FX_LPCSTR str) const
+ {
+ return Equal(str);
+ }
+
+ bool operator == (FX_BSTR str) const
+ {
+ return Equal(str);
+ }
+
+ bool operator == (const CFX_ByteString& str) const;
+
+ bool operator != (FX_LPCSTR str) const
+ {
+ return !Equal(str);
+ }
+
+ bool operator != (FX_BSTR str) const
+ {
+ return !Equal(str);
+ }
+
+ bool operator != (const CFX_ByteString& str) const
+ {
+ return !operator==(str);
+ }
+
+ void Empty();
+
+ const CFX_ByteString& operator = (FX_LPCSTR str);
+
+ const CFX_ByteString& operator = (FX_BSTR bstrc);
+
+ const CFX_ByteString& operator = (const CFX_ByteString& stringSrc);
+
+ const CFX_ByteString& operator = (const CFX_BinaryBuf& buf);
+
+ void Load(FX_LPCBYTE str, FX_STRSIZE len);
+
+ const CFX_ByteString& operator += (FX_CHAR ch);
+
+ const CFX_ByteString& operator += (FX_LPCSTR str);
+
+ const CFX_ByteString& operator += (const CFX_ByteString& str);
+
+ const CFX_ByteString& operator += (FX_BSTR bstrc);
+
+ FX_BYTE GetAt(FX_STRSIZE nIndex) const
+ {
+ return m_pData ? m_pData->m_String[nIndex] : 0;
+ }
+
+ FX_BYTE operator[](FX_STRSIZE nIndex) const
+ {
+ return m_pData ? m_pData->m_String[nIndex] : 0;
+ }
+
+ void SetAt(FX_STRSIZE nIndex, FX_CHAR ch);
+
+ FX_STRSIZE Insert(FX_STRSIZE index, FX_CHAR ch);
+
+ FX_STRSIZE Delete(FX_STRSIZE index, FX_STRSIZE count = 1);
+
+
+ void Format(FX_LPCSTR lpszFormat, ... );
+
+ void FormatV(FX_LPCSTR lpszFormat, va_list argList);
+
+
+ void Reserve(FX_STRSIZE len);
+
+ FX_LPSTR GetBuffer(FX_STRSIZE len);
+
+ FX_LPSTR LockBuffer();
+
+ void ReleaseBuffer(FX_STRSIZE len = -1);
+
+ CFX_ByteString Mid(FX_STRSIZE first) const;
+
+ CFX_ByteString Mid(FX_STRSIZE first, FX_STRSIZE count) const;
+
+ CFX_ByteString Left(FX_STRSIZE count) const;
+
+ CFX_ByteString Right(FX_STRSIZE count) const;
+
+ FX_STRSIZE Find(FX_BSTR lpszSub, FX_STRSIZE start = 0) const;
+
+ FX_STRSIZE Find(FX_CHAR ch, FX_STRSIZE start = 0) const;
+
+ FX_STRSIZE ReverseFind(FX_CHAR ch) const;
+
+ void MakeLower();
+
+ void MakeUpper();
+
+ void TrimRight();
+
+ void TrimRight(FX_CHAR chTarget);
+
+ void TrimRight(FX_BSTR lpszTargets);
+
+ void TrimLeft();
+
+ void TrimLeft(FX_CHAR chTarget);
+
+ void TrimLeft(FX_BSTR lpszTargets);
+
+ FX_STRSIZE Replace(FX_BSTR lpszOld, FX_BSTR lpszNew);
+
+ FX_STRSIZE Remove(FX_CHAR ch);
+
+ CFX_WideString UTF8Decode() const;
+
+ void ConvertFrom(const CFX_WideString& str, CFX_CharMap* pCharMap = NULL);
+
+ FX_DWORD GetID(FX_STRSIZE start_pos = 0) const;
+
+ static CFX_ByteString LoadFromFile(FX_BSTR file_path);
+#define FXFORMAT_SIGNED 1
+#define FXFORMAT_HEX 2
+#define FXFORMAT_CAPITAL 4
+
+ static CFX_ByteString FormatInteger(int i, FX_DWORD flags = 0);
+
+ static CFX_ByteString FormatFloat(FX_FLOAT f, int precision = 0);
+protected:
+
+ struct CFX_StringData* m_pData;
+ void AllocCopy(CFX_ByteString& dest, FX_STRSIZE nCopyLen, FX_STRSIZE nCopyIndex, FX_STRSIZE nExtraLen) const;
+ void AssignCopy(FX_STRSIZE nSrcLen, FX_LPCSTR lpszSrcData);
+ void ConcatCopy(FX_STRSIZE nSrc1Len, FX_LPCSTR lpszSrc1Data, FX_STRSIZE nSrc2Len, FX_LPCSTR lpszSrc2Data);
+ void ConcatInPlace(FX_STRSIZE nSrcLen, FX_LPCSTR lpszSrcData);
+ void CopyBeforeWrite();
+ void AllocBeforeWrite(FX_STRSIZE nLen);
+};
+inline CFX_ByteStringC::CFX_ByteStringC(const CFX_ByteString& src)
+{
+ m_Ptr = (FX_LPCBYTE)src;
+ m_Length = src.GetLength();
+}
+inline CFX_ByteStringC& CFX_ByteStringC::operator = (const CFX_ByteString& src)
+{
+ m_Ptr = (FX_LPCBYTE)src;
+ m_Length = src.GetLength();
+ return *this;
+}
+
+inline CFX_ByteString operator + (FX_BSTR str1, FX_BSTR str2)
+{
+ return CFX_ByteString(str1, str2);
+}
+inline CFX_ByteString operator + (FX_BSTR str1, FX_LPCSTR str2)
+{
+ return CFX_ByteString(str1, str2);
+}
+inline CFX_ByteString operator + (FX_LPCSTR str1, FX_BSTR str2)
+{
+ return CFX_ByteString(str1, str2);
+}
+inline CFX_ByteString operator + (FX_BSTR str1, FX_CHAR ch)
+{
+ return CFX_ByteString(str1, CFX_ByteStringC(ch));
+}
+inline CFX_ByteString operator + (FX_CHAR ch, FX_BSTR str2)
+{
+ return CFX_ByteString(ch, str2);
+}
+inline CFX_ByteString operator + (const CFX_ByteString& str1, const CFX_ByteString& str2)
+{
+ return CFX_ByteString(str1, str2);
+}
+inline CFX_ByteString operator + (const CFX_ByteString& str1, FX_CHAR ch)
+{
+ return CFX_ByteString(str1, CFX_ByteStringC(ch));
+}
+inline CFX_ByteString operator + (FX_CHAR ch, const CFX_ByteString& str2)
+{
+ return CFX_ByteString(ch, str2);
+}
+inline CFX_ByteString operator + (const CFX_ByteString& str1, FX_LPCSTR str2)
+{
+ return CFX_ByteString(str1, str2);
+}
+inline CFX_ByteString operator + (FX_LPCSTR str1, const CFX_ByteString& str2)
+{
+ return CFX_ByteString(str1, str2);
+}
+inline CFX_ByteString operator + (const CFX_ByteString& str1, FX_BSTR str2)
+{
+ return CFX_ByteString(str1, str2);
+}
+inline CFX_ByteString operator + (FX_BSTR str1, const CFX_ByteString& str2)
+{
+ return CFX_ByteString(str1, str2);
+}
+class CFX_StringBufBase : public CFX_Object
+{
+public:
+
+ CFX_StringBufBase(FX_STRSIZE limit)
+ {
+ m_Size = 0;
+ m_Limit = limit;
+ }
+
+ FX_CHAR* GetPtr() const
+ {
+ return (FX_CHAR*)(this + 1);
+ }
+
+ FX_STRSIZE GetSize() const
+ {
+ return m_Size;
+ }
+
+ void Empty()
+ {
+ m_Size = 0;
+ }
+
+ void Copy(FX_BSTR str);
+
+ void Append(FX_BSTR str);
+
+ void Append(int i, FX_DWORD flags = 0);
+
+ CFX_ByteStringC GetStringC() const
+ {
+ return CFX_ByteStringC((FX_CHAR*)(this + 1), m_Size);
+ }
+
+ CFX_ByteString GetString() const
+ {
+ return CFX_ByteString((FX_CHAR*)(this + 1), m_Size);
+ }
+protected:
+
+ FX_STRSIZE m_Limit;
+
+ FX_STRSIZE m_Size;
+};
+template<FX_STRSIZE limit>
+class CFX_StringBufTemplate : public CFX_StringBufBase
+{
+public:
+
+ CFX_StringBufTemplate() : CFX_StringBufBase(limit) {}
+
+ FX_CHAR m_Buffer[limit];
+};
+typedef CFX_StringBufTemplate<256> CFX_StringBuf256;
+class CFX_WideStringC : public CFX_Object
+{
+public:
+
+ CFX_WideStringC()
+ {
+ m_Ptr = NULL;
+ m_Length = 0;
+ }
+
+ CFX_WideStringC(FX_LPCWSTR ptr)
+ {
+ m_Ptr = ptr;
+ m_Length = ptr ? (FX_STRSIZE)FXSYS_wcslen(ptr) : 0;
+ }
+
+ CFX_WideStringC(FX_WCHAR& ch)
+ {
+ m_Ptr = &ch;
+ m_Length = 1;
+ }
+
+ CFX_WideStringC(FX_LPCWSTR ptr, FX_STRSIZE len)
+ {
+ m_Ptr = ptr;
+ if (len == -1) {
+ m_Length = (FX_STRSIZE)FXSYS_wcslen(ptr);
+ } else {
+ m_Length = len;
+ }
+ }
+
+ CFX_WideStringC(const CFX_WideStringC& src)
+ {
+ m_Ptr = src.m_Ptr;
+ m_Length = src.m_Length;
+ }
+
+ CFX_WideStringC(const CFX_WideString& src);
+
+ CFX_WideStringC& operator = (FX_LPCWSTR src)
+ {
+ m_Ptr = src;
+ m_Length = (FX_STRSIZE)FXSYS_wcslen(src);
+ return *this;
+ }
+
+ CFX_WideStringC& operator = (const CFX_WideStringC& src)
+ {
+ m_Ptr = src.m_Ptr;
+ m_Length = src.m_Length;
+ return *this;
+ }
+
+ CFX_WideStringC& operator = (const CFX_WideString& src);
+
+ bool operator == (const CFX_WideStringC& str) const
+ {
+ return str.m_Length == m_Length && FXSYS_memcmp32(str.m_Ptr, m_Ptr, m_Length * sizeof(FX_WCHAR)) == 0;
+ }
+
+ bool operator != (const CFX_WideStringC& str) const
+ {
+ return str.m_Length != m_Length || FXSYS_memcmp32(str.m_Ptr, m_Ptr, m_Length * sizeof(FX_WCHAR)) != 0;
+ }
+
+ FX_LPCWSTR GetPtr() const
+ {
+ return m_Ptr;
+ }
+
+ FX_STRSIZE GetLength() const
+ {
+ return m_Length;
+ }
+
+ bool IsEmpty() const
+ {
+ return m_Length == 0;
+ }
+
+ FX_WCHAR GetAt(FX_STRSIZE index) const
+ {
+ return m_Ptr[index];
+ }
+
+ CFX_WideStringC Left(FX_STRSIZE count) const
+ {
+ if (count < 1) {
+ return CFX_WideStringC();
+ }
+ if (count > m_Length) {
+ count = m_Length;
+ }
+ return CFX_WideStringC(m_Ptr, count);
+ }
+
+ CFX_WideStringC Mid(FX_STRSIZE index, FX_STRSIZE count = -1) const
+ {
+ if (index < 0) {
+ index = 0;
+ }
+ if (index > m_Length) {
+ return CFX_WideStringC();
+ }
+ if (count < 0 || count > m_Length - index) {
+ count = m_Length - index;
+ }
+ return CFX_WideStringC(m_Ptr + index, count);
+ }
+
+ CFX_WideStringC Right(FX_STRSIZE count) const
+ {
+ if (count < 1) {
+ return CFX_WideStringC();
+ }
+ if (count > m_Length) {
+ count = m_Length;
+ }
+ return CFX_WideStringC(m_Ptr + m_Length - count, count);
+ }
+protected:
+
+ FX_LPCWSTR m_Ptr;
+
+ FX_STRSIZE m_Length;
+private:
+
+ void* operator new (size_t) throw()
+ {
+ return NULL;
+ }
+};
+typedef const CFX_WideStringC& FX_WSTR;
+#define FX_WSTRC(wstr) CFX_WideStringC((FX_LPCWSTR)wstr, sizeof(wstr) / sizeof(FX_WCHAR) - 1)
+struct CFX_StringDataW {
+
+ long m_nRefs;
+
+ FX_STRSIZE m_nDataLength;
+
+ FX_STRSIZE m_nAllocLength;
+
+ FX_WCHAR m_String[1];
+};
+class CFX_WideString : public CFX_Object
+{
+public:
+
+ CFX_WideString()
+ {
+ m_pData = NULL;
+ }
+
+ CFX_WideString(const CFX_WideString& str);
+
+ CFX_WideString(FX_LPCWSTR ptr, FX_STRSIZE len = -1)
+ {
+ InitStr(ptr, len);
+ }
+
+ CFX_WideString(FX_WCHAR ch);
+
+ CFX_WideString(const CFX_WideStringC& str);
+
+ CFX_WideString(const CFX_WideStringC& str1, const CFX_WideStringC& str2);
+
+ ~CFX_WideString();
+
+ static CFX_WideString FromLocal(const char* str, FX_STRSIZE len = -1);
+
+ static CFX_WideString FromUTF8(const char* str, FX_STRSIZE len = -1);
+
+ static CFX_WideString FromUTF16LE(const unsigned short* str, FX_STRSIZE len = -1);
+
+ operator FX_LPCWSTR() const
+ {
+ return m_pData ? m_pData->m_String : (FX_WCHAR*)L"";
+ }
+
+ void Empty();
+
+
+ FX_BOOL IsEmpty() const
+ {
+ return !GetLength();
+ }
+
+ FX_STRSIZE GetLength() const
+ {
+ return m_pData ? m_pData->m_nDataLength : 0;
+ }
+
+ const CFX_WideString& operator = (FX_LPCWSTR str);
+
+ const CFX_WideString& operator =(const CFX_WideString& stringSrc);
+
+ const CFX_WideString& operator =(const CFX_WideStringC& stringSrc);
+
+ const CFX_WideString& operator += (FX_LPCWSTR str);
+
+ const CFX_WideString& operator += (FX_WCHAR ch);
+
+ const CFX_WideString& operator += (const CFX_WideString& str);
+
+ const CFX_WideString& operator += (const CFX_WideStringC& str);
+
+ FX_WCHAR GetAt(FX_STRSIZE nIndex) const
+ {
+ return m_pData ? m_pData->m_String[nIndex] : 0;
+ }
+
+ FX_WCHAR operator[](FX_STRSIZE nIndex) const
+ {
+ return m_pData ? m_pData->m_String[nIndex] : 0;
+ }
+
+ void SetAt(FX_STRSIZE nIndex, FX_WCHAR ch);
+
+ int Compare(FX_LPCWSTR str) const;
+
+ int Compare(const CFX_WideString& str) const;
+
+ int CompareNoCase(FX_LPCWSTR str) const;
+
+ bool Equal(const CFX_WideStringC& str) const;
+
+ CFX_WideString Mid(FX_STRSIZE first) const;
+
+ CFX_WideString Mid(FX_STRSIZE first, FX_STRSIZE count) const;
+
+ CFX_WideString Left(FX_STRSIZE count) const;
+
+ CFX_WideString Right(FX_STRSIZE count) const;
+
+ FX_STRSIZE Insert(FX_STRSIZE index, FX_WCHAR ch);
+
+ FX_STRSIZE Delete(FX_STRSIZE index, FX_STRSIZE count = 1);
+
+ void Format(FX_LPCWSTR lpszFormat, ... );
+
+ void FormatV(FX_LPCWSTR lpszFormat, va_list argList);
+
+ void MakeLower();
+
+ void MakeUpper();
+
+ void TrimRight();
+
+ void TrimRight(FX_WCHAR chTarget);
+
+ void TrimRight(FX_LPCWSTR lpszTargets);
+
+ void TrimLeft();
+
+ void TrimLeft(FX_WCHAR chTarget);
+
+ void TrimLeft(FX_LPCWSTR lpszTargets);
+
+ void Reserve(FX_STRSIZE len);
+
+ FX_LPWSTR GetBuffer(FX_STRSIZE len);
+
+ FX_LPWSTR LockBuffer();
+
+ void ReleaseBuffer(FX_STRSIZE len = -1);
+
+ int GetInteger() const;
+
+ FX_FLOAT GetFloat() const;
+
+ FX_STRSIZE Find(FX_LPCWSTR lpszSub, FX_STRSIZE start = 0) const;
+
+ FX_STRSIZE Find(FX_WCHAR ch, FX_STRSIZE start = 0) const;
+
+ FX_STRSIZE Replace(FX_LPCWSTR lpszOld, FX_LPCWSTR lpszNew);
+
+ FX_STRSIZE Remove(FX_WCHAR ch);
+
+ CFX_ByteString UTF8Encode() const;
+
+ CFX_ByteString UTF16LE_Encode(FX_BOOL bTerminate = TRUE) const;
+
+ void ConvertFrom(const CFX_ByteString& str, CFX_CharMap* pCharMap = NULL);
+protected:
+ void InitStr(FX_LPCWSTR ptr, int len);
+
+ CFX_StringDataW* m_pData;
+ void CopyBeforeWrite();
+ void AllocBeforeWrite(FX_STRSIZE nLen);
+ void ConcatInPlace(FX_STRSIZE nSrcLen, FX_LPCWSTR lpszSrcData);
+ void ConcatCopy(FX_STRSIZE nSrc1Len, FX_LPCWSTR lpszSrc1Data, FX_STRSIZE nSrc2Len, FX_LPCWSTR lpszSrc2Data);
+ void AssignCopy(FX_STRSIZE nSrcLen, FX_LPCWSTR lpszSrcData);
+ void AllocCopy(CFX_WideString& dest, FX_STRSIZE nCopyLen, FX_STRSIZE nCopyIndex, FX_STRSIZE nExtraLen) const;
+};
+inline CFX_WideStringC::CFX_WideStringC(const CFX_WideString& src)
+{
+ m_Ptr = (FX_LPCWSTR)src;
+ m_Length = src.GetLength();
+}
+inline CFX_WideStringC& CFX_WideStringC::operator = (const CFX_WideString& src)
+{
+ m_Ptr = (FX_LPCWSTR)src;
+ m_Length = src.GetLength();
+ return *this;
+}
+
+inline CFX_WideString operator + (const CFX_WideStringC& str1, const CFX_WideStringC& str2)
+{
+ return CFX_WideString(str1, str2);
+}
+inline CFX_WideString operator + (const CFX_WideStringC& str1, FX_LPCWSTR str2)
+{
+ return CFX_WideString(str1, str2);
+}
+inline CFX_WideString operator + (FX_LPCWSTR str1, const CFX_WideStringC& str2)
+{
+ return CFX_WideString(str1, str2);
+}
+inline CFX_WideString operator + (const CFX_WideStringC& str1, FX_WCHAR ch)
+{
+ return CFX_WideString(str1, CFX_WideStringC(ch));
+}
+inline CFX_WideString operator + (FX_WCHAR ch, const CFX_WideStringC& str2)
+{
+ return CFX_WideString(ch, str2);
+}
+inline CFX_WideString operator + (const CFX_WideString& str1, const CFX_WideString& str2)
+{
+ return CFX_WideString(str1, str2);
+}
+inline CFX_WideString operator + (const CFX_WideString& str1, FX_WCHAR ch)
+{
+ return CFX_WideString(str1, CFX_WideStringC(ch));
+}
+inline CFX_WideString operator + (FX_WCHAR ch, const CFX_WideString& str2)
+{
+ return CFX_WideString(ch, str2);
+}
+inline CFX_WideString operator + (const CFX_WideString& str1, FX_LPCWSTR str2)
+{
+ return CFX_WideString(str1, str2);
+}
+inline CFX_WideString operator + (FX_LPCWSTR str1, const CFX_WideString& str2)
+{
+ return CFX_WideString(str1, str2);
+}
+inline CFX_WideString operator + (const CFX_WideString& str1, const CFX_WideStringC& str2)
+{
+ return CFX_WideString(str1, str2);
+}
+inline CFX_WideString operator + (const CFX_WideStringC& str1, const CFX_WideString& str2)
+{
+ return CFX_WideString(str1, str2);
+}
+
+bool operator==(const CFX_WideString& s1, const CFX_WideString& s2);
+bool operator==(const CFX_WideString& s1, const CFX_WideStringC& s2);
+bool operator==(const CFX_WideStringC& s1, const CFX_WideString& s2);
+bool operator== (const CFX_WideString& s1, FX_LPCWSTR s2);
+bool operator==(FX_LPCWSTR s1, const CFX_WideString& s2);
+bool operator!=(const CFX_WideString& s1, const CFX_WideString& s2);
+bool operator!=(const CFX_WideString& s1, const CFX_WideStringC& s2);
+bool operator!=(const CFX_WideStringC& s1, const CFX_WideString& s2);
+bool operator!= (const CFX_WideString& s1, FX_LPCWSTR s2);
+bool operator!=(FX_LPCWSTR s1, const CFX_WideString& s2);
+FX_FLOAT FX_atof(FX_BSTR str);
+void FX_atonum(FX_BSTR str, FX_BOOL& bInteger, void* pData);
+FX_STRSIZE FX_ftoa(FX_FLOAT f, FX_LPSTR buf);
+CFX_ByteString FX_UTF8Encode(FX_LPCWSTR pwsStr, FX_STRSIZE len);
+inline CFX_ByteString FX_UTF8Encode(FX_WSTR wsStr)
+{
+ return FX_UTF8Encode(wsStr.GetPtr(), wsStr.GetLength());
+}
+inline CFX_ByteString FX_UTF8Encode(const CFX_WideString &wsStr)
+{
+ return FX_UTF8Encode((FX_LPCWSTR)wsStr, wsStr.GetLength());
+}
+class CFX_ByteStringL : public CFX_ByteStringC
+{
+public:
+ CFX_ByteStringL() : CFX_ByteStringC() {}
+ ~CFX_ByteStringL() {}
+
+ void Empty(IFX_Allocator* pAllocator);
+ FX_LPSTR AllocBuffer(FX_STRSIZE length, IFX_Allocator* pAllocator);
+
+ void Set(FX_BSTR src, IFX_Allocator* pAllocator);
+};
+class CFX_WideStringL : public CFX_WideStringC
+{
+public:
+ CFX_WideStringL() : CFX_WideStringC() {}
+ ~CFX_WideStringL() {}
+
+ void Empty(IFX_Allocator* pAllocator);
+ void Set(FX_WSTR src, IFX_Allocator* pAllocator);
+
+ int GetInteger() const;
+ FX_FLOAT GetFloat() const;
+
+ void TrimRight(FX_LPCWSTR lpszTargets);
+};
+void FX_UTF8Encode(FX_LPCWSTR pwsStr, FX_STRSIZE len, CFX_ByteStringL &utf8Str, IFX_Allocator* pAllocator = NULL);
+#endif
diff --git a/core/include/fxcrt/fx_system.h b/core/include/fxcrt/fx_system.h
index f72be0ffcb..0021c1437d 100644
--- a/core/include/fxcrt/fx_system.h
+++ b/core/include/fxcrt/fx_system.h
@@ -1,279 +1,279 @@
-// 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 _FX_SYSTEM_H_
-#define _FX_SYSTEM_H_
-#define _FX_WIN32_DESKTOP_ 1
-#define _FX_LINUX_DESKTOP_ 4
-#define _FX_MACOSX_ 7
-#define _FX_ANDROID_ 12
-#define _FXM_PLATFORM_WINDOWS_ 1
-#define _FXM_PLATFORM_LINUX_ 2
-#define _FXM_PLATFORM_APPLE_ 3
-#define _FXM_PLATFORM_ANDROID_ 4
-#ifndef _FX_OS_
-#if defined(__ANDROID__)
-#define _FX_OS_ _FX_ANDROID_
-#define _FXM_PLATFORM_ _FXM_PLATFORM_ANDROID_
-#elif defined(_WIN32) || defined(_WIN64)
-#define _FX_OS_ _FX_WIN32_DESKTOP_
-#define _FXM_PLATFORM_ _FXM_PLATFORM_WINDOWS_
-#elif defined(__linux__)
-#define _FX_OS_ _FX_LINUX_DESKTOP_
-#define _FXM_PLATFORM_ _FXM_PLATFORM_LINUX_
-#elif defined(__APPLE__)
-#define _FX_OS_ _FX_MACOSX_
-#define _FXM_PLATFORM_ _FXM_PLATFORM_APPLE_
-#endif
-#endif
-#if !defined(_FX_OS_) || _FX_OS_ == 0
-#error Sorry, can not figure out what OS you are targeting to. Please specify _FX_OS_ macro.
-#endif
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
-#define _CRT_SECURE_NO_WARNINGS
-#include <windows.h>
-#endif
-#define _FX_W32_ 1
-#define _FX_W64_ 2
-#ifndef _FX_WORDSIZE_
-#if defined(_WIN64) || defined(__arm64) || defined(__arm64__) || defined(_M_AMD64) || defined(_M_X64) || defined(_M_IA64) || defined(__powerpc64__) || defined(__x86_64__) || __WORDSIZE == 64
-#define _FX_WORDSIZE_ _FX_W64_
-#else
-#define _FX_WORDSIZE_ _FX_W32_
-#endif
-#endif
-#include <stddef.h>
-#include <stdarg.h>
-#include <setjmp.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-#include <wchar.h>
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
-#include <libkern/OSAtomic.h>
-#if _FX_OS_ == _FX_MACOSX_
-#include <Carbon/Carbon.h>
-#elif _FX_OS_ == _FX_IOS_
-#include <CoreText/CoreText.h>
-#include <CoreGraphics/CoreGraphics.h>
-#endif
-#endif
-#ifdef __cplusplus
-extern "C" {
-#endif
-typedef void* FX_LPVOID;
-typedef void const* FX_LPCVOID;
-typedef void* FX_POSITION;
-typedef signed char FX_INT8;
-typedef unsigned char FX_UINT8;
-typedef unsigned char FX_BYTE;
-typedef unsigned char* FX_LPBYTE;
-typedef unsigned char const* FX_LPCBYTE;
-typedef short FX_INT16;
-typedef unsigned short FX_UINT16;
-typedef short FX_SHORT;
-typedef unsigned short FX_WORD;
-typedef unsigned short* FX_LPWORD;
-typedef unsigned short const* FX_LPCWORD;
-typedef int FX_INT32;
-typedef float FX_FLOAT;
-typedef int FX_BOOL;
-typedef int FX_ERR;
-#define FX_SUCCEEDED(Status) ((FX_ERR)(Status) >= 0)
-#define FX_FAILED(Status) ((FX_ERR)(Status) < 0)
-typedef char FX_CHAR;
-typedef char* FX_LPSTR;
-typedef char const* FX_LPCSTR;
-typedef unsigned int FX_DWORD;
-typedef unsigned int* FX_LPDWORD;
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
-typedef __int64 FX_INT64;
-typedef unsigned __int64 FX_UINT64;
-#else
-typedef long long int FX_INT64;
-typedef unsigned long long FX_UINT64;
-#endif
-#if _FX_WORDSIZE_ == _FX_W64_
-typedef FX_INT64 FX_INTPTR;
-typedef FX_UINT64 FX_UINTPTR;
-#else
-typedef int FX_INTPTR;
-typedef unsigned int FX_UINTPTR;
-#endif
-typedef wchar_t FX_WCHAR;
-typedef wchar_t* FX_LPWSTR;
-typedef wchar_t const* FX_LPCWSTR;
-typedef FX_DWORD FX_UINT32;
-typedef FX_UINT64 FX_QWORD;
-#define FX_DEFINEHANDLE(name) typedef struct _##name {FX_LPVOID pData;} * name;
-#if defined(DEBUG) && !defined(_DEBUG)
-#define _DEBUG
-#endif
-#ifndef TRUE
-
-#define TRUE 1
-#endif
-#ifndef FALSE
-
-#define FALSE 0
-#endif
-#ifndef NULL
-
-#define NULL 0
-#endif
-#define FXSYS_assert assert
-#ifndef ASSERT
-#ifdef _DEBUG
-#define ASSERT FXSYS_assert
-#else
-
-#define ASSERT(a)
-#endif
-#endif
-#define FX_MAX(a, b) (((a) > (b)) ? (a) : (b))
-#define FX_MIN(a, b) (((a) < (b)) ? (a) : (b))
-#define FX_PI 3.1415926535897932384626433832795f
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
-#define FXSYS_snprintf _snprintf
-#else
-#define FXSYS_snprintf snprintf
-#endif
-#define FXSYS_sprintf sprintf
-#define FXSYS_vsprintf vsprintf
-#define FXSYS_strchr strchr
-#define FXSYS_strlen strlen
-#define FXSYS_strncmp strncmp
-#define FXSYS_strcmp strcmp
-#define FXSYS_strcpy strcpy
-#define FXSYS_strncpy strncpy
-#define FXSYS_strstr strstr
-#define FXSYS_FILE FILE
-#define FXSYS_fopen fopen
-#define FXSYS_fclose fclose
-#define FXSYS_SEEK_END SEEK_END
-#define FXSYS_SEEK_SET SEEK_SET
-#define FXSYS_fseek fseek
-#define FXSYS_ftell ftell
-#define FXSYS_fread fread
-#define FXSYS_fwrite fwrite
-#define FXSYS_fprintf fprintf
-#define FXSYS_fflush fflush
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
-#ifdef _NATIVE_WCHAR_T_DEFINED
-#define FXSYS_wfopen(f, m) _wfopen((const wchar_t*)(f), (const wchar_t*)(m))
-#else
-#define FXSYS_wfopen _wfopen
-#endif
-#else
-FXSYS_FILE* FXSYS_wfopen(FX_LPCWSTR filename, FX_LPCWSTR mode);
-#endif
-
-#define FXSYS_wcslen wcslen
-#define FXSYS_wcscmp wcscmp
-#define FXSYS_wcschr wcschr
-#define FXSYS_wcsstr wcsstr
-#define FXSYS_wcsncmp wcsncmp
-#define FXSYS_vswprintf vswprintf
-#define FXSYS_mbstowcs mbstowcs
-#define FXSYS_wcstombs wcstombs
-#define FXSYS_memcmp memcmp
-#define FXSYS_memcpy memcpy
-#define FXSYS_memmove memmove
-#define FXSYS_memset memset
-#define FXSYS_memchr memchr
-#define FXSYS_qsort qsort
-#define FXSYS_bsearch bsearch
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
-#define FXSYS_GetACP GetACP
-#define FXSYS_itoa _itoa
-#define FXSYS_strlwr _strlwr
-#define FXSYS_strupr _strupr
-#define FXSYS_stricmp _stricmp
-#ifdef _NATIVE_WCHAR_T_DEFINED
-#define FXSYS_wcsicmp(str1, str2) _wcsicmp((wchar_t*)(str1), (wchar_t*)(str2))
-#define FXSYS_WideCharToMultiByte(p1, p2, p3, p4, p5, p6, p7, p8) WideCharToMultiByte(p1, p2, (const wchar_t*)(p3), p4, p5, p6, p7, p8)
-#define FXSYS_MultiByteToWideChar(p1, p2, p3, p4, p5, p6) MultiByteToWideChar(p1, p2, p3, p4, (wchar_t*)(p5), p6)
-#define FXSYS_wcslwr(str) _wcslwr((wchar_t*)(str))
-#define FXSYS_wcsupr(str) _wcsupr((wchar_t*)(str))
-#else
-#define FXSYS_wcsicmp _wcsicmp
-#define FXSYS_WideCharToMultiByte WideCharToMultiByte
-#define FXSYS_MultiByteToWideChar MultiByteToWideChar
-#define FXSYS_wcslwr _wcslwr
-#define FXSYS_wcsupr _wcsupr
-#endif
-#define FXSYS_GetFullPathName GetFullPathName
-#define FXSYS_GetModuleFileName GetModuleFileName
-#else
-int FXSYS_GetACP(void);
-char* FXSYS_itoa(int value, char* string, int radix);
-int FXSYS_WideCharToMultiByte(FX_DWORD codepage, FX_DWORD dwFlags, const wchar_t* wstr, int wlen,
- char* buf, int buflen, const char* default_str, int* pUseDefault);
-int FXSYS_MultiByteToWideChar(FX_DWORD codepage, FX_DWORD dwFlags, const char* bstr, int blen,
- wchar_t* buf, int buflen);
-FX_DWORD FXSYS_GetFullPathName(const char* filename, FX_DWORD buflen, char* buf, char** filepart);
-FX_DWORD FXSYS_GetModuleFileName(void* hModule, char* buf, FX_DWORD bufsize);
-char* FXSYS_strlwr(char* str);
-char* FXSYS_strupr(char* str);
-int FXSYS_stricmp(const char*, const char*);
-int FXSYS_wcsicmp(const wchar_t *string1, const wchar_t *string2);
-wchar_t* FXSYS_wcslwr(wchar_t* str);
-wchar_t* FXSYS_wcsupr(wchar_t* str);
-#endif
-#define FXSYS_memcpy32 FXSYS_memcpy
-#define FXSYS_memcmp32 FXSYS_memcmp
-#define FXSYS_memset32 FXSYS_memset
-#define FXSYS_memset8 FXSYS_memset
-#define FXSYS_memmove32 FXSYS_memmove
-#ifdef __cplusplus
-}
-#endif
-#include <math.h>
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
-#define FXSYS_pow(a, b) (FX_FLOAT)powf(a, b)
-#else
-#define FXSYS_pow(a, b) (FX_FLOAT)pow(a, b)
-#endif
-#define FXSYS_sqrt(a) (FX_FLOAT)sqrt(a)
-#define FXSYS_fabs(a) (FX_FLOAT)fabs(a)
-#define FXSYS_atan2(a, b) (FX_FLOAT)atan2(a, b)
-#define FXSYS_ceil(a) (FX_FLOAT)ceil(a)
-#define FXSYS_floor(a) (FX_FLOAT)floor(a)
-#define FXSYS_cos(a) (FX_FLOAT)cos(a)
-#define FXSYS_acos(a) (FX_FLOAT)acos(a)
-#define FXSYS_sin(a) (FX_FLOAT)sin(a)
-#define FXSYS_log(a) (FX_FLOAT)log(a)
-#define FXSYS_log10(a) (FX_FLOAT)log10(a)
-#define FXSYS_fmod(a, b) (FX_FLOAT)fmod(a, b)
-#define FXSYS_abs abs
-#ifdef __cplusplus
-extern "C" {
-#endif
-#define _FX_LSB_FIRST_
-#define FXDWORD_FROM_LSBFIRST(i) (i)
-#define FXDWORD_FROM_MSBFIRST(i) (((FX_BYTE)(i) << 24) | ((FX_BYTE)((i) >> 8) << 16) | ((FX_BYTE)((i) >> 16) << 8) | (FX_BYTE)((i) >> 24))
-#define FXDWORD_GET_LSBFIRST(p) ((((FX_LPBYTE)(p))[3] << 24) | (((FX_LPBYTE)(p))[2] << 16) | (((FX_LPBYTE)(p))[1] << 8) | (((FX_LPBYTE)(p))[0]))
-#define FXDWORD_GET_MSBFIRST(p) ((((FX_LPBYTE)(p))[0] << 24) | (((FX_LPBYTE)(p))[1] << 16) | (((FX_LPBYTE)(p))[2] << 8) | (((FX_LPBYTE)(p))[3]))
-#define FXSYS_HIBYTE(word) ((FX_BYTE)((word) >> 8))
-#define FXSYS_LOBYTE(word) ((FX_BYTE)(word))
-#define FXSYS_HIWORD(dword) ((FX_WORD)((dword) >> 16))
-#define FXSYS_LOWORD(dword) ((FX_WORD)(dword))
-FX_INT32 FXSYS_atoi(FX_LPCSTR str);
-FX_INT32 FXSYS_wtoi(FX_LPCWSTR str);
-FX_INT64 FXSYS_atoi64(FX_LPCSTR str);
-FX_INT64 FXSYS_wtoi64(FX_LPCWSTR str);
-FX_LPCSTR FXSYS_i64toa(FX_INT64 value, FX_LPSTR str, int radix);
-FX_LPCWSTR FXSYS_i64tow(FX_INT64 value, FX_LPWSTR str, int radix);
-int FXSYS_round(FX_FLOAT f);
-#define FXSYS_Mul(a, b) ((a) * (b))
-#define FXSYS_Div(a, b) ((a) / (b))
-#define FXSYS_MulDiv(a, b, c) ((a) * (b) / (c))
-#define FXSYS_sqrt2(a, b) (FX_FLOAT)FXSYS_sqrt((a)*(a) + (b)*(b))
-#ifdef __cplusplus
-};
-#endif
-#endif
+// 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 _FX_SYSTEM_H_
+#define _FX_SYSTEM_H_
+#define _FX_WIN32_DESKTOP_ 1
+#define _FX_LINUX_DESKTOP_ 4
+#define _FX_MACOSX_ 7
+#define _FX_ANDROID_ 12
+#define _FXM_PLATFORM_WINDOWS_ 1
+#define _FXM_PLATFORM_LINUX_ 2
+#define _FXM_PLATFORM_APPLE_ 3
+#define _FXM_PLATFORM_ANDROID_ 4
+#ifndef _FX_OS_
+#if defined(__ANDROID__)
+#define _FX_OS_ _FX_ANDROID_
+#define _FXM_PLATFORM_ _FXM_PLATFORM_ANDROID_
+#elif defined(_WIN32) || defined(_WIN64)
+#define _FX_OS_ _FX_WIN32_DESKTOP_
+#define _FXM_PLATFORM_ _FXM_PLATFORM_WINDOWS_
+#elif defined(__linux__)
+#define _FX_OS_ _FX_LINUX_DESKTOP_
+#define _FXM_PLATFORM_ _FXM_PLATFORM_LINUX_
+#elif defined(__APPLE__)
+#define _FX_OS_ _FX_MACOSX_
+#define _FXM_PLATFORM_ _FXM_PLATFORM_APPLE_
+#endif
+#endif
+#if !defined(_FX_OS_) || _FX_OS_ == 0
+#error Sorry, can not figure out what OS you are targeting to. Please specify _FX_OS_ macro.
+#endif
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
+#define _CRT_SECURE_NO_WARNINGS
+#include <windows.h>
+#endif
+#define _FX_W32_ 1
+#define _FX_W64_ 2
+#ifndef _FX_WORDSIZE_
+#if defined(_WIN64) || defined(__arm64) || defined(__arm64__) || defined(_M_AMD64) || defined(_M_X64) || defined(_M_IA64) || defined(__powerpc64__) || defined(__x86_64__) || __WORDSIZE == 64
+#define _FX_WORDSIZE_ _FX_W64_
+#else
+#define _FX_WORDSIZE_ _FX_W32_
+#endif
+#endif
+#include <stddef.h>
+#include <stdarg.h>
+#include <setjmp.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+#include <wchar.h>
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
+#include <libkern/OSAtomic.h>
+#if _FX_OS_ == _FX_MACOSX_
+#include <Carbon/Carbon.h>
+#elif _FX_OS_ == _FX_IOS_
+#include <CoreText/CoreText.h>
+#include <CoreGraphics/CoreGraphics.h>
+#endif
+#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+typedef void* FX_LPVOID;
+typedef void const* FX_LPCVOID;
+typedef void* FX_POSITION;
+typedef signed char FX_INT8;
+typedef unsigned char FX_UINT8;
+typedef unsigned char FX_BYTE;
+typedef unsigned char* FX_LPBYTE;
+typedef unsigned char const* FX_LPCBYTE;
+typedef short FX_INT16;
+typedef unsigned short FX_UINT16;
+typedef short FX_SHORT;
+typedef unsigned short FX_WORD;
+typedef unsigned short* FX_LPWORD;
+typedef unsigned short const* FX_LPCWORD;
+typedef int FX_INT32;
+typedef float FX_FLOAT;
+typedef int FX_BOOL;
+typedef int FX_ERR;
+#define FX_SUCCEEDED(Status) ((FX_ERR)(Status) >= 0)
+#define FX_FAILED(Status) ((FX_ERR)(Status) < 0)
+typedef char FX_CHAR;
+typedef char* FX_LPSTR;
+typedef char const* FX_LPCSTR;
+typedef unsigned int FX_DWORD;
+typedef unsigned int* FX_LPDWORD;
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
+typedef __int64 FX_INT64;
+typedef unsigned __int64 FX_UINT64;
+#else
+typedef long long int FX_INT64;
+typedef unsigned long long FX_UINT64;
+#endif
+#if _FX_WORDSIZE_ == _FX_W64_
+typedef FX_INT64 FX_INTPTR;
+typedef FX_UINT64 FX_UINTPTR;
+#else
+typedef int FX_INTPTR;
+typedef unsigned int FX_UINTPTR;
+#endif
+typedef wchar_t FX_WCHAR;
+typedef wchar_t* FX_LPWSTR;
+typedef wchar_t const* FX_LPCWSTR;
+typedef FX_DWORD FX_UINT32;
+typedef FX_UINT64 FX_QWORD;
+#define FX_DEFINEHANDLE(name) typedef struct _##name {FX_LPVOID pData;} * name;
+#if defined(DEBUG) && !defined(_DEBUG)
+#define _DEBUG
+#endif
+#ifndef TRUE
+
+#define TRUE 1
+#endif
+#ifndef FALSE
+
+#define FALSE 0
+#endif
+#ifndef NULL
+
+#define NULL 0
+#endif
+#define FXSYS_assert assert
+#ifndef ASSERT
+#ifdef _DEBUG
+#define ASSERT FXSYS_assert
+#else
+
+#define ASSERT(a)
+#endif
+#endif
+#define FX_MAX(a, b) (((a) > (b)) ? (a) : (b))
+#define FX_MIN(a, b) (((a) < (b)) ? (a) : (b))
+#define FX_PI 3.1415926535897932384626433832795f
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
+#define FXSYS_snprintf _snprintf
+#else
+#define FXSYS_snprintf snprintf
+#endif
+#define FXSYS_sprintf sprintf
+#define FXSYS_vsprintf vsprintf
+#define FXSYS_strchr strchr
+#define FXSYS_strlen strlen
+#define FXSYS_strncmp strncmp
+#define FXSYS_strcmp strcmp
+#define FXSYS_strcpy strcpy
+#define FXSYS_strncpy strncpy
+#define FXSYS_strstr strstr
+#define FXSYS_FILE FILE
+#define FXSYS_fopen fopen
+#define FXSYS_fclose fclose
+#define FXSYS_SEEK_END SEEK_END
+#define FXSYS_SEEK_SET SEEK_SET
+#define FXSYS_fseek fseek
+#define FXSYS_ftell ftell
+#define FXSYS_fread fread
+#define FXSYS_fwrite fwrite
+#define FXSYS_fprintf fprintf
+#define FXSYS_fflush fflush
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
+#ifdef _NATIVE_WCHAR_T_DEFINED
+#define FXSYS_wfopen(f, m) _wfopen((const wchar_t*)(f), (const wchar_t*)(m))
+#else
+#define FXSYS_wfopen _wfopen
+#endif
+#else
+FXSYS_FILE* FXSYS_wfopen(FX_LPCWSTR filename, FX_LPCWSTR mode);
+#endif
+
+#define FXSYS_wcslen wcslen
+#define FXSYS_wcscmp wcscmp
+#define FXSYS_wcschr wcschr
+#define FXSYS_wcsstr wcsstr
+#define FXSYS_wcsncmp wcsncmp
+#define FXSYS_vswprintf vswprintf
+#define FXSYS_mbstowcs mbstowcs
+#define FXSYS_wcstombs wcstombs
+#define FXSYS_memcmp memcmp
+#define FXSYS_memcpy memcpy
+#define FXSYS_memmove memmove
+#define FXSYS_memset memset
+#define FXSYS_memchr memchr
+#define FXSYS_qsort qsort
+#define FXSYS_bsearch bsearch
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
+#define FXSYS_GetACP GetACP
+#define FXSYS_itoa _itoa
+#define FXSYS_strlwr _strlwr
+#define FXSYS_strupr _strupr
+#define FXSYS_stricmp _stricmp
+#ifdef _NATIVE_WCHAR_T_DEFINED
+#define FXSYS_wcsicmp(str1, str2) _wcsicmp((wchar_t*)(str1), (wchar_t*)(str2))
+#define FXSYS_WideCharToMultiByte(p1, p2, p3, p4, p5, p6, p7, p8) WideCharToMultiByte(p1, p2, (const wchar_t*)(p3), p4, p5, p6, p7, p8)
+#define FXSYS_MultiByteToWideChar(p1, p2, p3, p4, p5, p6) MultiByteToWideChar(p1, p2, p3, p4, (wchar_t*)(p5), p6)
+#define FXSYS_wcslwr(str) _wcslwr((wchar_t*)(str))
+#define FXSYS_wcsupr(str) _wcsupr((wchar_t*)(str))
+#else
+#define FXSYS_wcsicmp _wcsicmp
+#define FXSYS_WideCharToMultiByte WideCharToMultiByte
+#define FXSYS_MultiByteToWideChar MultiByteToWideChar
+#define FXSYS_wcslwr _wcslwr
+#define FXSYS_wcsupr _wcsupr
+#endif
+#define FXSYS_GetFullPathName GetFullPathName
+#define FXSYS_GetModuleFileName GetModuleFileName
+#else
+int FXSYS_GetACP(void);
+char* FXSYS_itoa(int value, char* string, int radix);
+int FXSYS_WideCharToMultiByte(FX_DWORD codepage, FX_DWORD dwFlags, const wchar_t* wstr, int wlen,
+ char* buf, int buflen, const char* default_str, int* pUseDefault);
+int FXSYS_MultiByteToWideChar(FX_DWORD codepage, FX_DWORD dwFlags, const char* bstr, int blen,
+ wchar_t* buf, int buflen);
+FX_DWORD FXSYS_GetFullPathName(const char* filename, FX_DWORD buflen, char* buf, char** filepart);
+FX_DWORD FXSYS_GetModuleFileName(void* hModule, char* buf, FX_DWORD bufsize);
+char* FXSYS_strlwr(char* str);
+char* FXSYS_strupr(char* str);
+int FXSYS_stricmp(const char*, const char*);
+int FXSYS_wcsicmp(const wchar_t *string1, const wchar_t *string2);
+wchar_t* FXSYS_wcslwr(wchar_t* str);
+wchar_t* FXSYS_wcsupr(wchar_t* str);
+#endif
+#define FXSYS_memcpy32 FXSYS_memcpy
+#define FXSYS_memcmp32 FXSYS_memcmp
+#define FXSYS_memset32 FXSYS_memset
+#define FXSYS_memset8 FXSYS_memset
+#define FXSYS_memmove32 FXSYS_memmove
+#ifdef __cplusplus
+}
+#endif
+#include <math.h>
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
+#define FXSYS_pow(a, b) (FX_FLOAT)powf(a, b)
+#else
+#define FXSYS_pow(a, b) (FX_FLOAT)pow(a, b)
+#endif
+#define FXSYS_sqrt(a) (FX_FLOAT)sqrt(a)
+#define FXSYS_fabs(a) (FX_FLOAT)fabs(a)
+#define FXSYS_atan2(a, b) (FX_FLOAT)atan2(a, b)
+#define FXSYS_ceil(a) (FX_FLOAT)ceil(a)
+#define FXSYS_floor(a) (FX_FLOAT)floor(a)
+#define FXSYS_cos(a) (FX_FLOAT)cos(a)
+#define FXSYS_acos(a) (FX_FLOAT)acos(a)
+#define FXSYS_sin(a) (FX_FLOAT)sin(a)
+#define FXSYS_log(a) (FX_FLOAT)log(a)
+#define FXSYS_log10(a) (FX_FLOAT)log10(a)
+#define FXSYS_fmod(a, b) (FX_FLOAT)fmod(a, b)
+#define FXSYS_abs abs
+#ifdef __cplusplus
+extern "C" {
+#endif
+#define _FX_LSB_FIRST_
+#define FXDWORD_FROM_LSBFIRST(i) (i)
+#define FXDWORD_FROM_MSBFIRST(i) (((FX_BYTE)(i) << 24) | ((FX_BYTE)((i) >> 8) << 16) | ((FX_BYTE)((i) >> 16) << 8) | (FX_BYTE)((i) >> 24))
+#define FXDWORD_GET_LSBFIRST(p) ((((FX_LPBYTE)(p))[3] << 24) | (((FX_LPBYTE)(p))[2] << 16) | (((FX_LPBYTE)(p))[1] << 8) | (((FX_LPBYTE)(p))[0]))
+#define FXDWORD_GET_MSBFIRST(p) ((((FX_LPBYTE)(p))[0] << 24) | (((FX_LPBYTE)(p))[1] << 16) | (((FX_LPBYTE)(p))[2] << 8) | (((FX_LPBYTE)(p))[3]))
+#define FXSYS_HIBYTE(word) ((FX_BYTE)((word) >> 8))
+#define FXSYS_LOBYTE(word) ((FX_BYTE)(word))
+#define FXSYS_HIWORD(dword) ((FX_WORD)((dword) >> 16))
+#define FXSYS_LOWORD(dword) ((FX_WORD)(dword))
+FX_INT32 FXSYS_atoi(FX_LPCSTR str);
+FX_INT32 FXSYS_wtoi(FX_LPCWSTR str);
+FX_INT64 FXSYS_atoi64(FX_LPCSTR str);
+FX_INT64 FXSYS_wtoi64(FX_LPCWSTR str);
+FX_LPCSTR FXSYS_i64toa(FX_INT64 value, FX_LPSTR str, int radix);
+FX_LPCWSTR FXSYS_i64tow(FX_INT64 value, FX_LPWSTR str, int radix);
+int FXSYS_round(FX_FLOAT f);
+#define FXSYS_Mul(a, b) ((a) * (b))
+#define FXSYS_Div(a, b) ((a) / (b))
+#define FXSYS_MulDiv(a, b, c) ((a) * (b) / (c))
+#define FXSYS_sqrt2(a, b) (FX_FLOAT)FXSYS_sqrt((a)*(a) + (b)*(b))
+#ifdef __cplusplus
+};
+#endif
+#endif
diff --git a/core/include/fxcrt/fx_xml.h b/core/include/fxcrt/fx_xml.h
index 1217677740..19a49cde12 100644
--- a/core/include/fxcrt/fx_xml.h
+++ b/core/include/fxcrt/fx_xml.h
@@ -1,209 +1,209 @@
-// 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 _FX_XML_H_
-#define _FX_XML_H_
-#ifndef _FX_BASIC_H_
-#include "fx_basic.h"
-#endif
-class CXML_AttrItem : public CFX_Object
-{
-public:
- CFX_ByteStringL m_QSpaceName;
- CFX_ByteStringL m_AttrName;
- CFX_WideStringL m_Value;
-
- void Empty(IFX_Allocator* pAllocator = NULL)
- {
- m_QSpaceName.Empty(pAllocator);
- m_AttrName.Empty(pAllocator);
- m_Value.Empty(pAllocator);
- }
-};
-class CXML_AttrMap : public CFX_Object
-{
-public:
- CXML_AttrMap()
- {
- m_pMap = NULL;
- }
- ~CXML_AttrMap()
- {
- RemoveAll(NULL);
- }
- const CFX_WideStringL* Lookup(FX_BSTR space, FX_BSTR name) const;
- void SetAt(FX_BSTR space, FX_BSTR name, FX_WSTR value, IFX_Allocator* pAllocator = NULL);
- void RemoveAt(FX_BSTR space, FX_BSTR name, IFX_Allocator* pAllocator = NULL);
- void RemoveAll(IFX_Allocator* pAllocator = NULL);
- int GetSize() const;
- CXML_AttrItem& GetAt(int index) const;
- CFX_ObjectArray<CXML_AttrItem>* m_pMap;
-};
-class CXML_Content : public CFX_Object
-{
-public:
- CXML_Content() : m_bCDATA(FALSE), m_Content() {}
- ~CXML_Content()
- {
- Empty(NULL);
- }
- void Empty(IFX_Allocator* pAllocator = NULL)
- {
- m_Content.Empty(pAllocator);
- }
- void Set(FX_BOOL bCDATA, FX_WSTR content, IFX_Allocator* pAllocator = NULL)
- {
- m_bCDATA = bCDATA;
- m_Content.Set(content, pAllocator);
- }
- FX_BOOL m_bCDATA;
- CFX_WideStringL m_Content;
-};
-class CXML_Element : public CFX_Object
-{
-public:
-
- static CXML_Element* Parse(const void* pBuffer, size_t size, FX_BOOL bSaveSpaceChars = FALSE, FX_FILESIZE* pParsedSize = NULL, IFX_Allocator* pAllocator = NULL);
-
- static CXML_Element* Parse(IFX_FileRead *pFile, FX_BOOL bSaveSpaceChars = FALSE, FX_FILESIZE* pParsedSize = NULL, IFX_Allocator* pAllocator = NULL);
-
- static CXML_Element* Parse(IFX_BufferRead *pBuffer, FX_BOOL bSaveSpaceChars = FALSE, FX_FILESIZE* pParsedSize = NULL, IFX_Allocator* pAllocator = NULL);
-
- CXML_Element(FX_BSTR qSpace, FX_BSTR tagName, IFX_Allocator* pAllocator = NULL);
-
- CXML_Element(FX_BSTR qTagName, IFX_Allocator* pAllocator = NULL);
-
- CXML_Element(IFX_Allocator* pAllocator = NULL);
-
- ~CXML_Element();
-
- void Empty();
-
-
-
- CFX_ByteString GetTagName(FX_BOOL bQualified = FALSE) const;
- void GetTagName(CFX_ByteStringL &tagName, FX_BOOL bQualified = FALSE) const;
-
- CFX_ByteString GetNamespace(FX_BOOL bQualified = FALSE) const;
- void GetNamespace(CFX_ByteStringL &nameSpace, FX_BOOL bQualified = FALSE) const;
-
- CFX_ByteString GetNamespaceURI(FX_BSTR qName) const;
- void GetNamespaceURI(FX_BSTR qName, CFX_ByteStringL &uri) const;
-
- CXML_Element* GetParent() const
- {
- return m_pParent;
- }
-
- FX_DWORD CountAttrs() const
- {
- return m_AttrMap.GetSize();
- }
-
- void GetAttrByIndex(int index, CFX_ByteString &space, CFX_ByteString &name, CFX_WideString &value) const;
- void GetAttrByIndex(int index, CFX_ByteStringL &space, CFX_ByteStringL &name, CFX_WideStringL &value) const;
-
- FX_BOOL HasAttr(FX_BSTR qName) const;
-
- FX_BOOL GetAttrValue(FX_BSTR name, CFX_WideString& attribute) const;
- CFX_WideString GetAttrValue(FX_BSTR name) const
- {
- CFX_WideString attr;
- GetAttrValue(name, attr);
- return attr;
- }
- const CFX_WideStringL* GetAttrValuePtr(FX_BSTR name) const;
-
- FX_BOOL GetAttrValue(FX_BSTR space, FX_BSTR name, CFX_WideString& attribute) const;
- CFX_WideString GetAttrValue(FX_BSTR space, FX_BSTR name) const
- {
- CFX_WideString attr;
- GetAttrValue(space, name, attr);
- return attr;
- }
- const CFX_WideStringL* GetAttrValuePtr(FX_BSTR space, FX_BSTR name) const;
-
- FX_BOOL GetAttrInteger(FX_BSTR name, int& attribute) const;
- int GetAttrInteger(FX_BSTR name) const
- {
- int attr = 0;
- GetAttrInteger(name, attr);
- return attr;
- }
-
- FX_BOOL GetAttrInteger(FX_BSTR space, FX_BSTR name, int& attribute) const;
- int GetAttrInteger(FX_BSTR space, FX_BSTR name) const
- {
- int attr = 0;
- GetAttrInteger(space, name, attr);
- return attr;
- }
-
- FX_BOOL GetAttrFloat(FX_BSTR name, FX_FLOAT& attribute) const;
- FX_FLOAT GetAttrFloat(FX_BSTR name) const
- {
- FX_FLOAT attr = 0;
- GetAttrFloat(name, attr);
- return attr;
- }
-
- FX_BOOL GetAttrFloat(FX_BSTR space, FX_BSTR name, FX_FLOAT& attribute) const;
- FX_FLOAT GetAttrFloat(FX_BSTR space, FX_BSTR name) const
- {
- FX_FLOAT attr = 0;
- GetAttrFloat(space, name, attr);
- return attr;
- }
-
- FX_DWORD CountChildren() const;
-
- enum ChildType { Invalid, Element, Content};
-
- ChildType GetChildType(FX_DWORD index) const;
-
- CFX_WideString GetContent(FX_DWORD index) const;
- const CFX_WideStringL* GetContentPtr(FX_DWORD index) const;
-
- CXML_Element* GetElement(FX_DWORD index) const;
-
- CXML_Element* GetElement(FX_BSTR space, FX_BSTR tag) const
- {
- return GetElement(space, tag, 0);
- }
-
- FX_DWORD CountElements(FX_BSTR space, FX_BSTR tag) const;
-
- CXML_Element* GetElement(FX_BSTR space, FX_BSTR tag, int index) const;
-
- FX_DWORD FindElement(CXML_Element *pChild) const;
-
-
-
-
- void SetTag(FX_BSTR qSpace, FX_BSTR tagname);
-
- void SetTag(FX_BSTR qTagName);
-
- void RemoveChildren();
-
- void RemoveChild(FX_DWORD index);
-
-
-protected:
-
- CXML_Element* m_pParent;
-
- CFX_ByteStringL m_QSpaceName;
-
- CFX_ByteStringL m_TagName;
-
- CXML_AttrMap m_AttrMap;
-
- CFX_PtrArray m_Children;
- friend class CXML_Parser;
- friend class CXML_Composer;
-};
-#endif
+// 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 _FX_XML_H_
+#define _FX_XML_H_
+#ifndef _FX_BASIC_H_
+#include "fx_basic.h"
+#endif
+class CXML_AttrItem : public CFX_Object
+{
+public:
+ CFX_ByteStringL m_QSpaceName;
+ CFX_ByteStringL m_AttrName;
+ CFX_WideStringL m_Value;
+
+ void Empty(IFX_Allocator* pAllocator = NULL)
+ {
+ m_QSpaceName.Empty(pAllocator);
+ m_AttrName.Empty(pAllocator);
+ m_Value.Empty(pAllocator);
+ }
+};
+class CXML_AttrMap : public CFX_Object
+{
+public:
+ CXML_AttrMap()
+ {
+ m_pMap = NULL;
+ }
+ ~CXML_AttrMap()
+ {
+ RemoveAll(NULL);
+ }
+ const CFX_WideStringL* Lookup(FX_BSTR space, FX_BSTR name) const;
+ void SetAt(FX_BSTR space, FX_BSTR name, FX_WSTR value, IFX_Allocator* pAllocator = NULL);
+ void RemoveAt(FX_BSTR space, FX_BSTR name, IFX_Allocator* pAllocator = NULL);
+ void RemoveAll(IFX_Allocator* pAllocator = NULL);
+ int GetSize() const;
+ CXML_AttrItem& GetAt(int index) const;
+ CFX_ObjectArray<CXML_AttrItem>* m_pMap;
+};
+class CXML_Content : public CFX_Object
+{
+public:
+ CXML_Content() : m_bCDATA(FALSE), m_Content() {}
+ ~CXML_Content()
+ {
+ Empty(NULL);
+ }
+ void Empty(IFX_Allocator* pAllocator = NULL)
+ {
+ m_Content.Empty(pAllocator);
+ }
+ void Set(FX_BOOL bCDATA, FX_WSTR content, IFX_Allocator* pAllocator = NULL)
+ {
+ m_bCDATA = bCDATA;
+ m_Content.Set(content, pAllocator);
+ }
+ FX_BOOL m_bCDATA;
+ CFX_WideStringL m_Content;
+};
+class CXML_Element : public CFX_Object
+{
+public:
+
+ static CXML_Element* Parse(const void* pBuffer, size_t size, FX_BOOL bSaveSpaceChars = FALSE, FX_FILESIZE* pParsedSize = NULL, IFX_Allocator* pAllocator = NULL);
+
+ static CXML_Element* Parse(IFX_FileRead *pFile, FX_BOOL bSaveSpaceChars = FALSE, FX_FILESIZE* pParsedSize = NULL, IFX_Allocator* pAllocator = NULL);
+
+ static CXML_Element* Parse(IFX_BufferRead *pBuffer, FX_BOOL bSaveSpaceChars = FALSE, FX_FILESIZE* pParsedSize = NULL, IFX_Allocator* pAllocator = NULL);
+
+ CXML_Element(FX_BSTR qSpace, FX_BSTR tagName, IFX_Allocator* pAllocator = NULL);
+
+ CXML_Element(FX_BSTR qTagName, IFX_Allocator* pAllocator = NULL);
+
+ CXML_Element(IFX_Allocator* pAllocator = NULL);
+
+ ~CXML_Element();
+
+ void Empty();
+
+
+
+ CFX_ByteString GetTagName(FX_BOOL bQualified = FALSE) const;
+ void GetTagName(CFX_ByteStringL &tagName, FX_BOOL bQualified = FALSE) const;
+
+ CFX_ByteString GetNamespace(FX_BOOL bQualified = FALSE) const;
+ void GetNamespace(CFX_ByteStringL &nameSpace, FX_BOOL bQualified = FALSE) const;
+
+ CFX_ByteString GetNamespaceURI(FX_BSTR qName) const;
+ void GetNamespaceURI(FX_BSTR qName, CFX_ByteStringL &uri) const;
+
+ CXML_Element* GetParent() const
+ {
+ return m_pParent;
+ }
+
+ FX_DWORD CountAttrs() const
+ {
+ return m_AttrMap.GetSize();
+ }
+
+ void GetAttrByIndex(int index, CFX_ByteString &space, CFX_ByteString &name, CFX_WideString &value) const;
+ void GetAttrByIndex(int index, CFX_ByteStringL &space, CFX_ByteStringL &name, CFX_WideStringL &value) const;
+
+ FX_BOOL HasAttr(FX_BSTR qName) const;
+
+ FX_BOOL GetAttrValue(FX_BSTR name, CFX_WideString& attribute) const;
+ CFX_WideString GetAttrValue(FX_BSTR name) const
+ {
+ CFX_WideString attr;
+ GetAttrValue(name, attr);
+ return attr;
+ }
+ const CFX_WideStringL* GetAttrValuePtr(FX_BSTR name) const;
+
+ FX_BOOL GetAttrValue(FX_BSTR space, FX_BSTR name, CFX_WideString& attribute) const;
+ CFX_WideString GetAttrValue(FX_BSTR space, FX_BSTR name) const
+ {
+ CFX_WideString attr;
+ GetAttrValue(space, name, attr);
+ return attr;
+ }
+ const CFX_WideStringL* GetAttrValuePtr(FX_BSTR space, FX_BSTR name) const;
+
+ FX_BOOL GetAttrInteger(FX_BSTR name, int& attribute) const;
+ int GetAttrInteger(FX_BSTR name) const
+ {
+ int attr = 0;
+ GetAttrInteger(name, attr);
+ return attr;
+ }
+
+ FX_BOOL GetAttrInteger(FX_BSTR space, FX_BSTR name, int& attribute) const;
+ int GetAttrInteger(FX_BSTR space, FX_BSTR name) const
+ {
+ int attr = 0;
+ GetAttrInteger(space, name, attr);
+ return attr;
+ }
+
+ FX_BOOL GetAttrFloat(FX_BSTR name, FX_FLOAT& attribute) const;
+ FX_FLOAT GetAttrFloat(FX_BSTR name) const
+ {
+ FX_FLOAT attr = 0;
+ GetAttrFloat(name, attr);
+ return attr;
+ }
+
+ FX_BOOL GetAttrFloat(FX_BSTR space, FX_BSTR name, FX_FLOAT& attribute) const;
+ FX_FLOAT GetAttrFloat(FX_BSTR space, FX_BSTR name) const
+ {
+ FX_FLOAT attr = 0;
+ GetAttrFloat(space, name, attr);
+ return attr;
+ }
+
+ FX_DWORD CountChildren() const;
+
+ enum ChildType { Invalid, Element, Content};
+
+ ChildType GetChildType(FX_DWORD index) const;
+
+ CFX_WideString GetContent(FX_DWORD index) const;
+ const CFX_WideStringL* GetContentPtr(FX_DWORD index) const;
+
+ CXML_Element* GetElement(FX_DWORD index) const;
+
+ CXML_Element* GetElement(FX_BSTR space, FX_BSTR tag) const
+ {
+ return GetElement(space, tag, 0);
+ }
+
+ FX_DWORD CountElements(FX_BSTR space, FX_BSTR tag) const;
+
+ CXML_Element* GetElement(FX_BSTR space, FX_BSTR tag, int index) const;
+
+ FX_DWORD FindElement(CXML_Element *pChild) const;
+
+
+
+
+ void SetTag(FX_BSTR qSpace, FX_BSTR tagname);
+
+ void SetTag(FX_BSTR qTagName);
+
+ void RemoveChildren();
+
+ void RemoveChild(FX_DWORD index);
+
+
+protected:
+
+ CXML_Element* m_pParent;
+
+ CFX_ByteStringL m_QSpaceName;
+
+ CFX_ByteStringL m_TagName;
+
+ CXML_AttrMap m_AttrMap;
+
+ CFX_PtrArray m_Children;
+ friend class CXML_Parser;
+ friend class CXML_Composer;
+};
+#endif
diff --git a/core/include/fxge/fx_dib.h b/core/include/fxge/fx_dib.h
index 7aa3bf8d10..957a957043 100644
--- a/core/include/fxge/fx_dib.h
+++ b/core/include/fxge/fx_dib.h
@@ -1,606 +1,606 @@
-// 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 _FPDF_DIB_H_
-#define _FPDF_DIB_H_
-#ifndef _FXCRT_EXTENSION_
-#include "../fxcrt/fx_ext.h"
-#endif
-enum FXDIB_Format {
- FXDIB_Invalid = 0,
- FXDIB_1bppMask = 0x101,
- FXDIB_1bppRgb = 0x001,
- FXDIB_1bppCmyk = 0x401,
- FXDIB_8bppMask = 0x108,
- FXDIB_8bppRgb = 0x008,
- FXDIB_8bppRgba = 0x208,
- FXDIB_8bppCmyk = 0x408,
- FXDIB_8bppCmyka = 0x608,
- FXDIB_Rgb = 0x018,
- FXDIB_Rgba = 0x218,
- FXDIB_Rgb32 = 0x020,
- FXDIB_Argb = 0x220,
- FXDIB_Cmyk = 0x420,
- FXDIB_Cmyka = 0x620,
-};
-enum FXDIB_Channel {
- FXDIB_Red = 1,
- FXDIB_Green,
- FXDIB_Blue,
- FXDIB_Cyan,
- FXDIB_Magenta,
- FXDIB_Yellow,
- FXDIB_Black,
- FXDIB_Alpha
-};
-#define FXDIB_DOWNSAMPLE 0x04
-#define FXDIB_INTERPOL 0x20
-#define FXDIB_BICUBIC_INTERPOL 0x80
-#define FXDIB_NOSMOOTH 0x100
-#define FXDIB_PALETTE_LOC 0x01
-#define FXDIB_PALETTE_WIN 0x02
-#define FXDIB_PALETTE_MAC 0x04
-#define FXDIB_BLEND_NORMAL 0
-#define FXDIB_BLEND_MULTIPLY 1
-#define FXDIB_BLEND_SCREEN 2
-#define FXDIB_BLEND_OVERLAY 3
-#define FXDIB_BLEND_DARKEN 4
-#define FXDIB_BLEND_LIGHTEN 5
-
-#define FXDIB_BLEND_COLORDODGE 6
-#define FXDIB_BLEND_COLORBURN 7
-#define FXDIB_BLEND_HARDLIGHT 8
-#define FXDIB_BLEND_SOFTLIGHT 9
-#define FXDIB_BLEND_DIFFERENCE 10
-#define FXDIB_BLEND_EXCLUSION 11
-#define FXDIB_BLEND_NONSEPARABLE 21
-#define FXDIB_BLEND_HUE 21
-#define FXDIB_BLEND_SATURATION 22
-#define FXDIB_BLEND_COLOR 23
-#define FXDIB_BLEND_LUMINOSITY 24
-#define FXDIB_BLEND_UNSUPPORTED -1
-typedef FX_DWORD FX_ARGB;
-typedef FX_DWORD FX_COLORREF;
-typedef FX_DWORD FX_CMYK;
-class CFX_ClipRgn;
-class CFX_DIBSource;
-class CFX_DIBitmap;
-#define FXSYS_RGB(r, g, b) ((r) | ((g) << 8) | ((b) << 16))
-#define FXSYS_GetRValue(rgb) ((rgb) & 0xff)
-#define FXSYS_GetGValue(rgb) (((rgb) >> 8) & 0xff)
-#define FXSYS_GetBValue(rgb) (((rgb) >> 16) & 0xff)
-#define FX_CCOLOR(val) (255-(val))
-#define FXSYS_CMYK(c, m, y, k) (((c) << 24) | ((m) << 16) | ((y) << 8) | (k))
-#define FXSYS_GetCValue(cmyk) ((FX_BYTE)((cmyk) >> 24) & 0xff)
-#define FXSYS_GetMValue(cmyk) ((FX_BYTE)((cmyk) >> 16) & 0xff)
-#define FXSYS_GetYValue(cmyk) ((FX_BYTE)((cmyk) >> 8) & 0xff)
-#define FXSYS_GetKValue(cmyk) ((FX_BYTE)(cmyk) & 0xff)
-void CmykDecode(FX_CMYK cmyk, int& c, int& m, int& y, int& k);
-inline FX_CMYK CmykEncode(int c, int m, int y, int k)
-{
- return (c << 24) | (m << 16) | (y << 8) | k;
-}
-void ArgbDecode(FX_ARGB argb, int& a, int& r, int&g, int& b);
-void ArgbDecode(FX_ARGB argb, int& a, FX_COLORREF& rgb);
-inline FX_ARGB ArgbEncode(int a, int r, int g, int b)
-{
- return (a << 24) | (r << 16) | (g << 8) | b;
-}
-FX_ARGB ArgbEncode(int a, FX_COLORREF rgb);
-#define FXARGB_A(argb) ((FX_BYTE)((argb) >> 24))
-#define FXARGB_R(argb) ((FX_BYTE)((argb) >> 16))
-#define FXARGB_G(argb) ((FX_BYTE)((argb) >> 8))
-#define FXARGB_B(argb) ((FX_BYTE)(argb))
-#define FXARGB_MAKE(a,r,g,b) (((FX_DWORD)(a) << 24) | ((r) << 16) | ((g) << 8) | (b))
-#define FXARGB_MUL_ALPHA(argb, alpha) (((((argb) >> 24) * (alpha) / 255) << 24) | ((argb) & 0xffffff))
-#define FXRGB2GRAY(r,g,b) (((b) * 11 + (g) * 59 + (r) * 30) / 100)
-#define FXCMYK2GRAY(c,m,y,k) (((255-(c)) * (255-(k)) * 30 + (255-(m)) * (255-(k)) * 59 + (255-(y)) * (255-(k)) * 11) / 25500)
-#define FXDIB_ALPHA_MERGE(backdrop, source, source_alpha) (((backdrop) * (255-(source_alpha)) + (source)*(source_alpha))/255)
-#define FXDIB_ALPHA_UNION(dest, src) ((dest) + (src) - (dest)*(src)/255)
-#define FXCMYK_GETDIB(p) ((((FX_LPBYTE)(p))[0] << 24 | (((FX_LPBYTE)(p))[1] << 16) | (((FX_LPBYTE)(p))[2] << 8) | ((FX_LPBYTE)(p))[3]))
-#define FXCMYK_SETDIB(p, cmyk) ((FX_LPBYTE)(p))[0] = (FX_BYTE)((cmyk) >> 24), \
- ((FX_LPBYTE)(p))[1] = (FX_BYTE)((cmyk) >> 16), \
- ((FX_LPBYTE)(p))[2] = (FX_BYTE)((cmyk) >> 8), \
- ((FX_LPBYTE)(p))[3] = (FX_BYTE)(cmyk))
-#define FXARGB_GETDIB(p) (((FX_LPBYTE)(p))[0]) | (((FX_LPBYTE)(p))[1] << 8) | (((FX_LPBYTE)(p))[2] << 16) | (((FX_LPBYTE)(p))[3] << 24)
-#define FXARGB_SETDIB(p, argb) ((FX_LPBYTE)(p))[0] = (FX_BYTE)(argb), \
- ((FX_LPBYTE)(p))[1] = (FX_BYTE)((argb) >> 8), \
- ((FX_LPBYTE)(p))[2] = (FX_BYTE)((argb) >> 16), \
- ((FX_LPBYTE)(p))[3] = (FX_BYTE)((argb) >> 24)
-#define FXARGB_COPY(dest, src) *(FX_LPBYTE)(dest) = *(FX_LPBYTE)(src), \
- *((FX_LPBYTE)(dest)+1) = *((FX_LPBYTE)(src)+1), \
- *((FX_LPBYTE)(dest)+2) = *((FX_LPBYTE)(src)+2), \
- *((FX_LPBYTE)(dest)+3) = *((FX_LPBYTE)(src)+3)
-#define FXCMYK_COPY(dest, src) *(FX_LPBYTE)(dest) = *(FX_LPBYTE)(src), \
- *((FX_LPBYTE)(dest)+1) = *((FX_LPBYTE)(src)+1), \
- *((FX_LPBYTE)(dest)+2) = *((FX_LPBYTE)(src)+2), \
- *((FX_LPBYTE)(dest)+3) = *((FX_LPBYTE)(src)+3)
-#define FXARGB_SETRGBORDERDIB(p, argb) ((FX_LPBYTE)(p))[3] = (FX_BYTE)(argb>>24), \
- ((FX_LPBYTE)(p))[0] = (FX_BYTE)((argb) >> 16), \
- ((FX_LPBYTE)(p))[1] = (FX_BYTE)((argb) >> 8), \
- ((FX_LPBYTE)(p))[2] = (FX_BYTE)(argb)
-#define FXARGB_GETRGBORDERDIB(p) (((FX_LPBYTE)(p))[2]) | (((FX_LPBYTE)(p))[1] << 8) | (((FX_LPBYTE)(p))[0] << 16) | (((FX_LPBYTE)(p))[3] << 24)
-#define FXARGB_RGBORDERCOPY(dest, src) *((FX_LPBYTE)(dest)+3) = *((FX_LPBYTE)(src)+3), \
- *(FX_LPBYTE)(dest) = *((FX_LPBYTE)(src)+2), \
- *((FX_LPBYTE)(dest)+1) = *((FX_LPBYTE)(src)+1), \
- *((FX_LPBYTE)(dest)+2) = *((FX_LPBYTE)(src))
-#define FXARGB_TODIB(argb) (argb)
-#define FXCMYK_TODIB(cmyk) ((FX_BYTE)((cmyk) >> 24) | ((FX_BYTE)((cmyk) >> 16)) << 8 | ((FX_BYTE)((cmyk) >> 8)) << 16 | ((FX_BYTE)(cmyk) << 24))
-#define FXARGB_TOBGRORDERDIB(argb) ((FX_BYTE)(argb>>16) | ((FX_BYTE)(argb>>8)) << 8 | ((FX_BYTE)(argb)) << 16 | ((FX_BYTE)(argb>>24) << 24))
-#define FXGETFLAG_COLORTYPE(flag) (FX_BYTE)((flag)>>8)
-#define FXGETFLAG_ALPHA_FILL(flag) (FX_BYTE)(flag)
-#define FXGETFLAG_ALPHA_STROKE(flag) (FX_BYTE)((flag)>>16)
-#define FXSETFLAG_COLORTYPE(flag, val) flag = (((val)<<8)|(flag&0xffff00ff))
-#define FXSETFLAG_ALPHA_FILL(flag, val) flag = ((val)|(flag&0xffffff00))
-#define FXSETFLAG_ALPHA_STROKE(flag, val) flag = (((val)<<16)|(flag&0xff00ffff))
-class CFX_DIBSource : public CFX_Object
-{
-public:
-
- virtual ~CFX_DIBSource();
-
-
-
- int GetWidth() const
- {
- return m_Width;
- }
-
- int GetHeight() const
- {
- return m_Height;
- }
-
- FXDIB_Format GetFormat() const
- {
- return (FXDIB_Format)(m_AlphaFlag * 0x100 + m_bpp);
- }
-
- FX_DWORD GetPitch() const
- {
- return m_Pitch;
- }
-
- FX_DWORD* GetPalette() const
- {
- return m_pPalette;
- }
-
-
-
- virtual FX_LPBYTE GetBuffer() const
- {
- return NULL;
- }
-
- virtual FX_LPCBYTE GetScanline(int line) const = 0;
-
- virtual FX_BOOL SkipToScanline(int line, IFX_Pause* pPause) const
- {
- return FALSE;
- }
-
- virtual void DownSampleScanline(int line, FX_LPBYTE dest_scan, int dest_bpp,
- int dest_width, FX_BOOL bFlipX, int clip_left, int clip_width) const = 0;
-
- virtual void SetDownSampleSize(int width, int height) const {}
-
- int GetBPP() const
- {
- return m_bpp;
- }
-
- FX_BOOL IsAlphaMask() const
- {
- return m_AlphaFlag == 1;
- }
-
- FX_BOOL HasAlpha() const
- {
- return m_AlphaFlag & 2 ? TRUE : FALSE;
- }
-
- FX_BOOL IsOpaqueImage() const
- {
- return !(m_AlphaFlag & 3);
- }
-
- FX_BOOL IsCmykImage() const
- {
- return m_AlphaFlag & 4 ? TRUE : FALSE;
- }
-
-
-
- int GetPaletteSize() const
- {
- return IsAlphaMask() ? 0 : (m_bpp == 1 ? 2 : (m_bpp == 8 ? 256 : 0));
- }
-
- FX_DWORD GetPaletteEntry(int index) const;
-
- void SetPaletteEntry(int index, FX_DWORD color);
- FX_DWORD GetPaletteArgb(int index) const
- {
- return GetPaletteEntry(index);
- }
- void SetPaletteArgb(int index, FX_DWORD color)
- {
- SetPaletteEntry(index, color);
- }
-
- void CopyPalette(const FX_DWORD* pSrcPal, FX_DWORD size = 256);
-
-
- CFX_DIBitmap* Clone(const FX_RECT* pClip = NULL) const;
-
- CFX_DIBitmap* CloneConvert(FXDIB_Format format, const FX_RECT* pClip = NULL, void* pIccTransform = NULL) const;
-
- CFX_DIBitmap* StretchTo(int dest_width, int dest_height, FX_DWORD flags = 0, const FX_RECT* pClip = NULL) const;
-
-
- CFX_DIBitmap* TransformTo(const CFX_AffineMatrix* pMatrix, int& left, int &top,
- FX_DWORD flags = 0, const FX_RECT* pClip = NULL) const;
-
- CFX_DIBitmap* GetAlphaMask(const FX_RECT* pClip = NULL) const;
-
- FX_BOOL CopyAlphaMask(const CFX_DIBSource* pAlphaMask, const FX_RECT* pClip = NULL);
-
- CFX_DIBitmap* SwapXY(FX_BOOL bXFlip, FX_BOOL bYFlip, const FX_RECT* pClip = NULL) const;
-
- CFX_DIBitmap* FlipImage(FX_BOOL bXFlip, FX_BOOL bYFlip) const;
-
- void GetOverlapRect(int& dest_left, int& dest_top, int& width, int& height, int src_width,
- int src_height, int& src_left, int& src_top, const CFX_ClipRgn* pClipRgn);
-
- CFX_DIBitmap* m_pAlphaMask;
-protected:
-
- CFX_DIBSource();
-
- int m_Width;
-
- int m_Height;
-
- int m_bpp;
-
- FX_DWORD m_AlphaFlag;
-
- FX_DWORD m_Pitch;
-
- FX_DWORD* m_pPalette;
-
- void BuildPalette();
-
- FX_BOOL BuildAlphaMask();
-
- int FindPalette(FX_DWORD color) const;
-
- void GetPalette(FX_DWORD* pal, int alpha) const;
-};
-class CFX_DIBitmap : public CFX_DIBSource
-{
-public:
-
- virtual ~CFX_DIBitmap();
-
- CFX_DIBitmap();
-
- CFX_DIBitmap(const CFX_DIBitmap& src);
-
- FX_BOOL Create(int width, int height, FXDIB_Format format, FX_LPBYTE pBuffer = NULL, int pitch = 0);
-
- FX_BOOL Copy(const CFX_DIBSource* pSrc);
-
- virtual FX_LPBYTE GetBuffer() const
- {
- return m_pBuffer;
- }
-
- virtual FX_LPCBYTE GetScanline(int line) const
- {
- return m_pBuffer ? m_pBuffer + line * m_Pitch : NULL;
- }
-
- virtual void DownSampleScanline(int line, FX_LPBYTE dest_scan, int dest_bpp,
- int dest_width, FX_BOOL bFlipX, int clip_left, int clip_width) const;
-
- void TakeOver(CFX_DIBitmap* pSrcBitmap);
-
- FX_BOOL ConvertFormat(FXDIB_Format format, void* pIccTransform = NULL);
-
- void Clear(FX_DWORD color);
-
- FX_DWORD GetPixel(int x, int y) const;
-
- void SetPixel(int x, int y, FX_DWORD color);
-
- FX_BOOL LoadChannel(FXDIB_Channel destChannel, const CFX_DIBSource* pSrcBitmap, FXDIB_Channel srcChannel);
-
- FX_BOOL LoadChannel(FXDIB_Channel destChannel, int value);
-
- FX_BOOL MultiplyAlpha(int alpha);
-
- FX_BOOL MultiplyAlpha(const CFX_DIBSource* pAlphaMask);
-
- FX_BOOL TransferBitmap(int dest_left, int dest_top, int width, int height,
- const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform = NULL);
-
- FX_BOOL CompositeBitmap(int dest_left, int dest_top, int width, int height,
- const CFX_DIBSource* pSrcBitmap, int src_left, int src_top,
- int blend_type = FXDIB_BLEND_NORMAL, const CFX_ClipRgn* pClipRgn = NULL, FX_BOOL bRgbByteOrder = FALSE, void* pIccTransform = NULL);
-
- FX_BOOL TransferMask(int dest_left, int dest_top, int width, int height,
- const CFX_DIBSource* pMask, FX_DWORD color, int src_left, int src_top, int alpha_flag = 0, void* pIccTransform = NULL);
-
- FX_BOOL CompositeMask(int dest_left, int dest_top, int width, int height,
- const CFX_DIBSource* pMask, FX_DWORD color, int src_left, int src_top,
- int blend_type = FXDIB_BLEND_NORMAL, const CFX_ClipRgn* pClipRgn = NULL, FX_BOOL bRgbByteOrder = FALSE, int alpha_flag = 0, void* pIccTransform = NULL);
-
- FX_BOOL CompositeRect(int dest_left, int dest_top, int width, int height, FX_DWORD color, int alpha_flag = 0, void* pIccTransform = NULL);
-
- FX_BOOL ConvertColorScale(FX_DWORD forecolor, FX_DWORD backcolor);
-
- FX_BOOL DitherFS(const FX_DWORD* pPalette, int pal_size, const FX_RECT* pRect = NULL);
-protected:
-
- FX_LPBYTE m_pBuffer;
-
- FX_BOOL m_bExtBuf;
-
- FX_BOOL GetGrayData(void* pIccTransform = NULL);
-};
-class CFX_DIBExtractor : public CFX_Object
-{
-public:
-
- CFX_DIBExtractor(const CFX_DIBSource* pSrc);
-
- ~CFX_DIBExtractor();
-
- operator CFX_DIBitmap*()
- {
- return m_pBitmap;
- }
-private:
-
- CFX_DIBitmap* m_pBitmap;
-};
-typedef CFX_CountRef<CFX_DIBitmap> CFX_DIBitmapRef;
-class CFX_FilteredDIB : public CFX_DIBSource
-{
-public:
-
- CFX_FilteredDIB();
-
- ~CFX_FilteredDIB();
-
- void LoadSrc(const CFX_DIBSource* pSrc, FX_BOOL bAutoDropSrc = FALSE);
-
- virtual FXDIB_Format GetDestFormat() = 0;
-
- virtual FX_DWORD* GetDestPalette() = 0;
-
-
- virtual void TranslateScanline(FX_LPBYTE dest_buf, FX_LPCBYTE src_buf) const = 0;
-
- virtual void TranslateDownSamples(FX_LPBYTE dest_buf, FX_LPCBYTE src_buf, int pixels, int Bpp) const = 0;
-protected:
- virtual FX_LPCBYTE GetScanline(int line) const;
- virtual void DownSampleScanline(int line, FX_LPBYTE dest_scan, int dest_bpp,
- int dest_width, FX_BOOL bFlipX, int clip_left, int clip_width) const;
-
- const CFX_DIBSource* m_pSrc;
-
- FX_BOOL m_bAutoDropSrc;
-
- FX_LPBYTE m_pScanline;
-};
-class IFX_ScanlineComposer
-{
-public:
-
- virtual void ComposeScanline(int line, FX_LPCBYTE scanline, FX_LPCBYTE scan_extra_alpha = NULL) = 0;
-
-
- virtual FX_BOOL SetInfo(int width, int height, FXDIB_Format src_format, FX_DWORD* pSrcPalette) = 0;
-};
-class CFX_ScanlineCompositor : public CFX_Object
-{
-public:
-
- CFX_ScanlineCompositor();
-
- ~CFX_ScanlineCompositor();
-
- FX_BOOL Init(FXDIB_Format dest_format, FXDIB_Format src_format, FX_INT32 width, FX_DWORD* pSrcPalette,
- FX_DWORD mask_color, int blend_type, FX_BOOL bClip, FX_BOOL bRgbByteOrder = FALSE, int alpha_flag = 0, void* pIccTransform = NULL);
-
-
- void CompositeRgbBitmapLine(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, FX_LPCBYTE clip_scan,
- FX_LPCBYTE src_extra_alpha = NULL, FX_LPBYTE dst_extra_alpha = NULL);
-
-
- void CompositePalBitmapLine(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int src_left, int width, FX_LPCBYTE clip_scan,
- FX_LPCBYTE src_extra_alpha = NULL, FX_LPBYTE dst_extra_alpha = NULL);
-
-
- void CompositeByteMaskLine(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, FX_LPCBYTE clip_scan,
- FX_LPBYTE dst_extra_alpha = NULL);
-
-
- void CompositeBitMaskLine(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int src_left, int width, FX_LPCBYTE clip_scan,
- FX_LPBYTE dst_extra_alpha = NULL);
-protected:
- int m_Transparency;
- FXDIB_Format m_SrcFormat,
- m_DestFormat;
- FX_DWORD* m_pSrcPalette;
-
- int m_MaskAlpha,
- m_MaskRed,
- m_MaskGreen,
- m_MaskBlue,
- m_MaskBlack;
- int m_BlendType;
- void* m_pIccTransform;
- FX_LPBYTE m_pCacheScanline;
- int m_CacheSize;
- FX_BOOL m_bRgbByteOrder;
-};
-class CFX_BitmapComposer : public IFX_ScanlineComposer, public CFX_Object
-{
-public:
-
- CFX_BitmapComposer();
-
- ~CFX_BitmapComposer();
-
-
- void Compose(CFX_DIBitmap* pDest, const CFX_ClipRgn* pClipRgn, int bitmap_alpha,
- FX_DWORD mask_color, FX_RECT& dest_rect, FX_BOOL bVertical,
- FX_BOOL bFlipX, FX_BOOL bFlipY, FX_BOOL bRgbByteOrder = FALSE,
- int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL);
-
- virtual FX_BOOL SetInfo(int width, int height, FXDIB_Format src_format, FX_DWORD* pSrcPalette);
-
-
- virtual void ComposeScanline(int line, FX_LPCBYTE scanline, FX_LPCBYTE scan_extra_alpha);
-protected:
-
- void DoCompose(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int dest_width, FX_LPCBYTE clip_scan,
- FX_LPCBYTE src_extra_alpha = NULL, FX_LPBYTE dst_extra_alpha = NULL);
- CFX_DIBitmap* m_pBitmap;
- const CFX_ClipRgn* m_pClipRgn;
- FXDIB_Format m_SrcFormat;
- int m_DestLeft, m_DestTop, m_DestWidth, m_DestHeight, m_BitmapAlpha;
- FX_DWORD m_MaskColor;
- const CFX_DIBitmap* m_pClipMask;
- CFX_ScanlineCompositor m_Compositor;
- FX_BOOL m_bVertical, m_bFlipX, m_bFlipY;
- int m_AlphaFlag;
- void* m_pIccTransform;
- FX_BOOL m_bRgbByteOrder;
- int m_BlendType;
- void ComposeScanlineV(int line, FX_LPCBYTE scanline, FX_LPCBYTE scan_extra_alpha = NULL);
- FX_LPBYTE m_pScanlineV, m_pClipScanV, m_pAddClipScan, m_pScanlineAlphaV;
-};
-class CFX_BitmapStorer : public IFX_ScanlineComposer, public CFX_Object
-{
-public:
-
- CFX_BitmapStorer();
-
- ~CFX_BitmapStorer();
-
- virtual void ComposeScanline(int line, FX_LPCBYTE scanline, FX_LPCBYTE scan_extra_alpha);
-
- virtual FX_BOOL SetInfo(int width, int height, FXDIB_Format src_format, FX_DWORD* pSrcPalette);
-
- CFX_DIBitmap* GetBitmap()
- {
- return m_pBitmap;
- }
-
- CFX_DIBitmap* Detach();
-
- void Replace(CFX_DIBitmap* pBitmap);
-private:
- CFX_DIBitmap* m_pBitmap;
-};
-class CStretchEngine;
-class CFX_ImageStretcher : public CFX_Object
-{
-public:
-
- CFX_ImageStretcher();
-
- ~CFX_ImageStretcher();
-
- FX_INT32 Start(IFX_ScanlineComposer* pDest, const CFX_DIBSource* pBitmap,
- int dest_width, int dest_height, const FX_RECT& bitmap_rect, FX_DWORD flags);
-
-
- FX_INT32 Continue(IFX_Pause* pPause);
- IFX_ScanlineComposer* m_pDest;
- const CFX_DIBSource* m_pSource;
- CStretchEngine* m_pStretchEngine;
- FX_DWORD m_Flags;
- FX_BOOL m_bFlipX,
- m_bFlipY;
- int m_DestWidth,
- m_DestHeight;
- FX_RECT m_ClipRect;
- int m_LineIndex;
- int m_DestBPP;
- FX_LPBYTE m_pScanline;
- FX_LPBYTE m_pMaskScanline;
- FXDIB_Format m_DestFormat;
- FX_INT32 m_Status;
-
- FX_INT32 StartQuickStretch();
-
- FX_INT32 StartStretch();
-
- FX_INT32 ContinueQuickStretch(IFX_Pause* pPause);
-
- FX_INT32 ContinueStretch(IFX_Pause* pPause);
-};
-class CFX_ImageTransformer : public CFX_Object
-{
-public:
-
- CFX_ImageTransformer();
-
- ~CFX_ImageTransformer();
-
- FX_INT32 Start(const CFX_DIBSource* pSrc, const CFX_AffineMatrix* pMatrix, int flags, const FX_RECT* pClip);
-
-
- FX_INT32 Continue(IFX_Pause* pPause);
- CFX_AffineMatrix* m_pMatrix;
- FX_RECT m_StretchClip;
- int m_ResultLeft, m_ResultTop, m_ResultWidth, m_ResultHeight;
- CFX_AffineMatrix m_dest2stretch;
- CFX_ImageStretcher m_Stretcher;
- CFX_BitmapStorer m_Storer;
- FX_DWORD m_Flags;
- int m_Status;
-};
-class CFX_ImageRenderer : public CFX_Object
-{
-public:
-
- CFX_ImageRenderer();
-
- ~CFX_ImageRenderer();
-
- FX_INT32 Start(CFX_DIBitmap* pDevice, const CFX_ClipRgn* pClipRgn,
- const CFX_DIBSource* pSource, int bitmap_alpha,
- FX_DWORD mask_color, const CFX_AffineMatrix* pMatrix, FX_DWORD dib_flags,
- FX_BOOL bRgbByteOrder = FALSE, int alpha_flag = 0, void* pIccTransform = NULL,
- int blend_type = FXDIB_BLEND_NORMAL);
-
- FX_INT32 Continue(IFX_Pause* pPause);
-protected:
- CFX_DIBitmap* m_pDevice;
- const CFX_ClipRgn* m_pClipRgn;
- int m_BitmapAlpha;
- FX_DWORD m_MaskColor;
- CFX_AffineMatrix m_Matrix;
- CFX_ImageTransformer* m_pTransformer;
- CFX_ImageStretcher m_Stretcher;
- CFX_BitmapComposer m_Composer;
- int m_Status;
- int m_DestLeft, m_DestTop;
- FX_RECT m_ClipBox;
- FX_DWORD m_Flags;
- int m_AlphaFlag;
- void* m_pIccTransform;
- FX_BOOL m_bRgbByteOrder;
- int m_BlendType;
-};
-#endif
+// 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 _FPDF_DIB_H_
+#define _FPDF_DIB_H_
+#ifndef _FXCRT_EXTENSION_
+#include "../fxcrt/fx_ext.h"
+#endif
+enum FXDIB_Format {
+ FXDIB_Invalid = 0,
+ FXDIB_1bppMask = 0x101,
+ FXDIB_1bppRgb = 0x001,
+ FXDIB_1bppCmyk = 0x401,
+ FXDIB_8bppMask = 0x108,
+ FXDIB_8bppRgb = 0x008,
+ FXDIB_8bppRgba = 0x208,
+ FXDIB_8bppCmyk = 0x408,
+ FXDIB_8bppCmyka = 0x608,
+ FXDIB_Rgb = 0x018,
+ FXDIB_Rgba = 0x218,
+ FXDIB_Rgb32 = 0x020,
+ FXDIB_Argb = 0x220,
+ FXDIB_Cmyk = 0x420,
+ FXDIB_Cmyka = 0x620,
+};
+enum FXDIB_Channel {
+ FXDIB_Red = 1,
+ FXDIB_Green,
+ FXDIB_Blue,
+ FXDIB_Cyan,
+ FXDIB_Magenta,
+ FXDIB_Yellow,
+ FXDIB_Black,
+ FXDIB_Alpha
+};
+#define FXDIB_DOWNSAMPLE 0x04
+#define FXDIB_INTERPOL 0x20
+#define FXDIB_BICUBIC_INTERPOL 0x80
+#define FXDIB_NOSMOOTH 0x100
+#define FXDIB_PALETTE_LOC 0x01
+#define FXDIB_PALETTE_WIN 0x02
+#define FXDIB_PALETTE_MAC 0x04
+#define FXDIB_BLEND_NORMAL 0
+#define FXDIB_BLEND_MULTIPLY 1
+#define FXDIB_BLEND_SCREEN 2
+#define FXDIB_BLEND_OVERLAY 3
+#define FXDIB_BLEND_DARKEN 4
+#define FXDIB_BLEND_LIGHTEN 5
+
+#define FXDIB_BLEND_COLORDODGE 6
+#define FXDIB_BLEND_COLORBURN 7
+#define FXDIB_BLEND_HARDLIGHT 8
+#define FXDIB_BLEND_SOFTLIGHT 9
+#define FXDIB_BLEND_DIFFERENCE 10
+#define FXDIB_BLEND_EXCLUSION 11
+#define FXDIB_BLEND_NONSEPARABLE 21
+#define FXDIB_BLEND_HUE 21
+#define FXDIB_BLEND_SATURATION 22
+#define FXDIB_BLEND_COLOR 23
+#define FXDIB_BLEND_LUMINOSITY 24
+#define FXDIB_BLEND_UNSUPPORTED -1
+typedef FX_DWORD FX_ARGB;
+typedef FX_DWORD FX_COLORREF;
+typedef FX_DWORD FX_CMYK;
+class CFX_ClipRgn;
+class CFX_DIBSource;
+class CFX_DIBitmap;
+#define FXSYS_RGB(r, g, b) ((r) | ((g) << 8) | ((b) << 16))
+#define FXSYS_GetRValue(rgb) ((rgb) & 0xff)
+#define FXSYS_GetGValue(rgb) (((rgb) >> 8) & 0xff)
+#define FXSYS_GetBValue(rgb) (((rgb) >> 16) & 0xff)
+#define FX_CCOLOR(val) (255-(val))
+#define FXSYS_CMYK(c, m, y, k) (((c) << 24) | ((m) << 16) | ((y) << 8) | (k))
+#define FXSYS_GetCValue(cmyk) ((FX_BYTE)((cmyk) >> 24) & 0xff)
+#define FXSYS_GetMValue(cmyk) ((FX_BYTE)((cmyk) >> 16) & 0xff)
+#define FXSYS_GetYValue(cmyk) ((FX_BYTE)((cmyk) >> 8) & 0xff)
+#define FXSYS_GetKValue(cmyk) ((FX_BYTE)(cmyk) & 0xff)
+void CmykDecode(FX_CMYK cmyk, int& c, int& m, int& y, int& k);
+inline FX_CMYK CmykEncode(int c, int m, int y, int k)
+{
+ return (c << 24) | (m << 16) | (y << 8) | k;
+}
+void ArgbDecode(FX_ARGB argb, int& a, int& r, int&g, int& b);
+void ArgbDecode(FX_ARGB argb, int& a, FX_COLORREF& rgb);
+inline FX_ARGB ArgbEncode(int a, int r, int g, int b)
+{
+ return (a << 24) | (r << 16) | (g << 8) | b;
+}
+FX_ARGB ArgbEncode(int a, FX_COLORREF rgb);
+#define FXARGB_A(argb) ((FX_BYTE)((argb) >> 24))
+#define FXARGB_R(argb) ((FX_BYTE)((argb) >> 16))
+#define FXARGB_G(argb) ((FX_BYTE)((argb) >> 8))
+#define FXARGB_B(argb) ((FX_BYTE)(argb))
+#define FXARGB_MAKE(a,r,g,b) (((FX_DWORD)(a) << 24) | ((r) << 16) | ((g) << 8) | (b))
+#define FXARGB_MUL_ALPHA(argb, alpha) (((((argb) >> 24) * (alpha) / 255) << 24) | ((argb) & 0xffffff))
+#define FXRGB2GRAY(r,g,b) (((b) * 11 + (g) * 59 + (r) * 30) / 100)
+#define FXCMYK2GRAY(c,m,y,k) (((255-(c)) * (255-(k)) * 30 + (255-(m)) * (255-(k)) * 59 + (255-(y)) * (255-(k)) * 11) / 25500)
+#define FXDIB_ALPHA_MERGE(backdrop, source, source_alpha) (((backdrop) * (255-(source_alpha)) + (source)*(source_alpha))/255)
+#define FXDIB_ALPHA_UNION(dest, src) ((dest) + (src) - (dest)*(src)/255)
+#define FXCMYK_GETDIB(p) ((((FX_LPBYTE)(p))[0] << 24 | (((FX_LPBYTE)(p))[1] << 16) | (((FX_LPBYTE)(p))[2] << 8) | ((FX_LPBYTE)(p))[3]))
+#define FXCMYK_SETDIB(p, cmyk) ((FX_LPBYTE)(p))[0] = (FX_BYTE)((cmyk) >> 24), \
+ ((FX_LPBYTE)(p))[1] = (FX_BYTE)((cmyk) >> 16), \
+ ((FX_LPBYTE)(p))[2] = (FX_BYTE)((cmyk) >> 8), \
+ ((FX_LPBYTE)(p))[3] = (FX_BYTE)(cmyk))
+#define FXARGB_GETDIB(p) (((FX_LPBYTE)(p))[0]) | (((FX_LPBYTE)(p))[1] << 8) | (((FX_LPBYTE)(p))[2] << 16) | (((FX_LPBYTE)(p))[3] << 24)
+#define FXARGB_SETDIB(p, argb) ((FX_LPBYTE)(p))[0] = (FX_BYTE)(argb), \
+ ((FX_LPBYTE)(p))[1] = (FX_BYTE)((argb) >> 8), \
+ ((FX_LPBYTE)(p))[2] = (FX_BYTE)((argb) >> 16), \
+ ((FX_LPBYTE)(p))[3] = (FX_BYTE)((argb) >> 24)
+#define FXARGB_COPY(dest, src) *(FX_LPBYTE)(dest) = *(FX_LPBYTE)(src), \
+ *((FX_LPBYTE)(dest)+1) = *((FX_LPBYTE)(src)+1), \
+ *((FX_LPBYTE)(dest)+2) = *((FX_LPBYTE)(src)+2), \
+ *((FX_LPBYTE)(dest)+3) = *((FX_LPBYTE)(src)+3)
+#define FXCMYK_COPY(dest, src) *(FX_LPBYTE)(dest) = *(FX_LPBYTE)(src), \
+ *((FX_LPBYTE)(dest)+1) = *((FX_LPBYTE)(src)+1), \
+ *((FX_LPBYTE)(dest)+2) = *((FX_LPBYTE)(src)+2), \
+ *((FX_LPBYTE)(dest)+3) = *((FX_LPBYTE)(src)+3)
+#define FXARGB_SETRGBORDERDIB(p, argb) ((FX_LPBYTE)(p))[3] = (FX_BYTE)(argb>>24), \
+ ((FX_LPBYTE)(p))[0] = (FX_BYTE)((argb) >> 16), \
+ ((FX_LPBYTE)(p))[1] = (FX_BYTE)((argb) >> 8), \
+ ((FX_LPBYTE)(p))[2] = (FX_BYTE)(argb)
+#define FXARGB_GETRGBORDERDIB(p) (((FX_LPBYTE)(p))[2]) | (((FX_LPBYTE)(p))[1] << 8) | (((FX_LPBYTE)(p))[0] << 16) | (((FX_LPBYTE)(p))[3] << 24)
+#define FXARGB_RGBORDERCOPY(dest, src) *((FX_LPBYTE)(dest)+3) = *((FX_LPBYTE)(src)+3), \
+ *(FX_LPBYTE)(dest) = *((FX_LPBYTE)(src)+2), \
+ *((FX_LPBYTE)(dest)+1) = *((FX_LPBYTE)(src)+1), \
+ *((FX_LPBYTE)(dest)+2) = *((FX_LPBYTE)(src))
+#define FXARGB_TODIB(argb) (argb)
+#define FXCMYK_TODIB(cmyk) ((FX_BYTE)((cmyk) >> 24) | ((FX_BYTE)((cmyk) >> 16)) << 8 | ((FX_BYTE)((cmyk) >> 8)) << 16 | ((FX_BYTE)(cmyk) << 24))
+#define FXARGB_TOBGRORDERDIB(argb) ((FX_BYTE)(argb>>16) | ((FX_BYTE)(argb>>8)) << 8 | ((FX_BYTE)(argb)) << 16 | ((FX_BYTE)(argb>>24) << 24))
+#define FXGETFLAG_COLORTYPE(flag) (FX_BYTE)((flag)>>8)
+#define FXGETFLAG_ALPHA_FILL(flag) (FX_BYTE)(flag)
+#define FXGETFLAG_ALPHA_STROKE(flag) (FX_BYTE)((flag)>>16)
+#define FXSETFLAG_COLORTYPE(flag, val) flag = (((val)<<8)|(flag&0xffff00ff))
+#define FXSETFLAG_ALPHA_FILL(flag, val) flag = ((val)|(flag&0xffffff00))
+#define FXSETFLAG_ALPHA_STROKE(flag, val) flag = (((val)<<16)|(flag&0xff00ffff))
+class CFX_DIBSource : public CFX_Object
+{
+public:
+
+ virtual ~CFX_DIBSource();
+
+
+
+ int GetWidth() const
+ {
+ return m_Width;
+ }
+
+ int GetHeight() const
+ {
+ return m_Height;
+ }
+
+ FXDIB_Format GetFormat() const
+ {
+ return (FXDIB_Format)(m_AlphaFlag * 0x100 + m_bpp);
+ }
+
+ FX_DWORD GetPitch() const
+ {
+ return m_Pitch;
+ }
+
+ FX_DWORD* GetPalette() const
+ {
+ return m_pPalette;
+ }
+
+
+
+ virtual FX_LPBYTE GetBuffer() const
+ {
+ return NULL;
+ }
+
+ virtual FX_LPCBYTE GetScanline(int line) const = 0;
+
+ virtual FX_BOOL SkipToScanline(int line, IFX_Pause* pPause) const
+ {
+ return FALSE;
+ }
+
+ virtual void DownSampleScanline(int line, FX_LPBYTE dest_scan, int dest_bpp,
+ int dest_width, FX_BOOL bFlipX, int clip_left, int clip_width) const = 0;
+
+ virtual void SetDownSampleSize(int width, int height) const {}
+
+ int GetBPP() const
+ {
+ return m_bpp;
+ }
+
+ FX_BOOL IsAlphaMask() const
+ {
+ return m_AlphaFlag == 1;
+ }
+
+ FX_BOOL HasAlpha() const
+ {
+ return m_AlphaFlag & 2 ? TRUE : FALSE;
+ }
+
+ FX_BOOL IsOpaqueImage() const
+ {
+ return !(m_AlphaFlag & 3);
+ }
+
+ FX_BOOL IsCmykImage() const
+ {
+ return m_AlphaFlag & 4 ? TRUE : FALSE;
+ }
+
+
+
+ int GetPaletteSize() const
+ {
+ return IsAlphaMask() ? 0 : (m_bpp == 1 ? 2 : (m_bpp == 8 ? 256 : 0));
+ }
+
+ FX_DWORD GetPaletteEntry(int index) const;
+
+ void SetPaletteEntry(int index, FX_DWORD color);
+ FX_DWORD GetPaletteArgb(int index) const
+ {
+ return GetPaletteEntry(index);
+ }
+ void SetPaletteArgb(int index, FX_DWORD color)
+ {
+ SetPaletteEntry(index, color);
+ }
+
+ void CopyPalette(const FX_DWORD* pSrcPal, FX_DWORD size = 256);
+
+
+ CFX_DIBitmap* Clone(const FX_RECT* pClip = NULL) const;
+
+ CFX_DIBitmap* CloneConvert(FXDIB_Format format, const FX_RECT* pClip = NULL, void* pIccTransform = NULL) const;
+
+ CFX_DIBitmap* StretchTo(int dest_width, int dest_height, FX_DWORD flags = 0, const FX_RECT* pClip = NULL) const;
+
+
+ CFX_DIBitmap* TransformTo(const CFX_AffineMatrix* pMatrix, int& left, int &top,
+ FX_DWORD flags = 0, const FX_RECT* pClip = NULL) const;
+
+ CFX_DIBitmap* GetAlphaMask(const FX_RECT* pClip = NULL) const;
+
+ FX_BOOL CopyAlphaMask(const CFX_DIBSource* pAlphaMask, const FX_RECT* pClip = NULL);
+
+ CFX_DIBitmap* SwapXY(FX_BOOL bXFlip, FX_BOOL bYFlip, const FX_RECT* pClip = NULL) const;
+
+ CFX_DIBitmap* FlipImage(FX_BOOL bXFlip, FX_BOOL bYFlip) const;
+
+ void GetOverlapRect(int& dest_left, int& dest_top, int& width, int& height, int src_width,
+ int src_height, int& src_left, int& src_top, const CFX_ClipRgn* pClipRgn);
+
+ CFX_DIBitmap* m_pAlphaMask;
+protected:
+
+ CFX_DIBSource();
+
+ int m_Width;
+
+ int m_Height;
+
+ int m_bpp;
+
+ FX_DWORD m_AlphaFlag;
+
+ FX_DWORD m_Pitch;
+
+ FX_DWORD* m_pPalette;
+
+ void BuildPalette();
+
+ FX_BOOL BuildAlphaMask();
+
+ int FindPalette(FX_DWORD color) const;
+
+ void GetPalette(FX_DWORD* pal, int alpha) const;
+};
+class CFX_DIBitmap : public CFX_DIBSource
+{
+public:
+
+ virtual ~CFX_DIBitmap();
+
+ CFX_DIBitmap();
+
+ CFX_DIBitmap(const CFX_DIBitmap& src);
+
+ FX_BOOL Create(int width, int height, FXDIB_Format format, FX_LPBYTE pBuffer = NULL, int pitch = 0);
+
+ FX_BOOL Copy(const CFX_DIBSource* pSrc);
+
+ virtual FX_LPBYTE GetBuffer() const
+ {
+ return m_pBuffer;
+ }
+
+ virtual FX_LPCBYTE GetScanline(int line) const
+ {
+ return m_pBuffer ? m_pBuffer + line * m_Pitch : NULL;
+ }
+
+ virtual void DownSampleScanline(int line, FX_LPBYTE dest_scan, int dest_bpp,
+ int dest_width, FX_BOOL bFlipX, int clip_left, int clip_width) const;
+
+ void TakeOver(CFX_DIBitmap* pSrcBitmap);
+
+ FX_BOOL ConvertFormat(FXDIB_Format format, void* pIccTransform = NULL);
+
+ void Clear(FX_DWORD color);
+
+ FX_DWORD GetPixel(int x, int y) const;
+
+ void SetPixel(int x, int y, FX_DWORD color);
+
+ FX_BOOL LoadChannel(FXDIB_Channel destChannel, const CFX_DIBSource* pSrcBitmap, FXDIB_Channel srcChannel);
+
+ FX_BOOL LoadChannel(FXDIB_Channel destChannel, int value);
+
+ FX_BOOL MultiplyAlpha(int alpha);
+
+ FX_BOOL MultiplyAlpha(const CFX_DIBSource* pAlphaMask);
+
+ FX_BOOL TransferBitmap(int dest_left, int dest_top, int width, int height,
+ const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform = NULL);
+
+ FX_BOOL CompositeBitmap(int dest_left, int dest_top, int width, int height,
+ const CFX_DIBSource* pSrcBitmap, int src_left, int src_top,
+ int blend_type = FXDIB_BLEND_NORMAL, const CFX_ClipRgn* pClipRgn = NULL, FX_BOOL bRgbByteOrder = FALSE, void* pIccTransform = NULL);
+
+ FX_BOOL TransferMask(int dest_left, int dest_top, int width, int height,
+ const CFX_DIBSource* pMask, FX_DWORD color, int src_left, int src_top, int alpha_flag = 0, void* pIccTransform = NULL);
+
+ FX_BOOL CompositeMask(int dest_left, int dest_top, int width, int height,
+ const CFX_DIBSource* pMask, FX_DWORD color, int src_left, int src_top,
+ int blend_type = FXDIB_BLEND_NORMAL, const CFX_ClipRgn* pClipRgn = NULL, FX_BOOL bRgbByteOrder = FALSE, int alpha_flag = 0, void* pIccTransform = NULL);
+
+ FX_BOOL CompositeRect(int dest_left, int dest_top, int width, int height, FX_DWORD color, int alpha_flag = 0, void* pIccTransform = NULL);
+
+ FX_BOOL ConvertColorScale(FX_DWORD forecolor, FX_DWORD backcolor);
+
+ FX_BOOL DitherFS(const FX_DWORD* pPalette, int pal_size, const FX_RECT* pRect = NULL);
+protected:
+
+ FX_LPBYTE m_pBuffer;
+
+ FX_BOOL m_bExtBuf;
+
+ FX_BOOL GetGrayData(void* pIccTransform = NULL);
+};
+class CFX_DIBExtractor : public CFX_Object
+{
+public:
+
+ CFX_DIBExtractor(const CFX_DIBSource* pSrc);
+
+ ~CFX_DIBExtractor();
+
+ operator CFX_DIBitmap*()
+ {
+ return m_pBitmap;
+ }
+private:
+
+ CFX_DIBitmap* m_pBitmap;
+};
+typedef CFX_CountRef<CFX_DIBitmap> CFX_DIBitmapRef;
+class CFX_FilteredDIB : public CFX_DIBSource
+{
+public:
+
+ CFX_FilteredDIB();
+
+ ~CFX_FilteredDIB();
+
+ void LoadSrc(const CFX_DIBSource* pSrc, FX_BOOL bAutoDropSrc = FALSE);
+
+ virtual FXDIB_Format GetDestFormat() = 0;
+
+ virtual FX_DWORD* GetDestPalette() = 0;
+
+
+ virtual void TranslateScanline(FX_LPBYTE dest_buf, FX_LPCBYTE src_buf) const = 0;
+
+ virtual void TranslateDownSamples(FX_LPBYTE dest_buf, FX_LPCBYTE src_buf, int pixels, int Bpp) const = 0;
+protected:
+ virtual FX_LPCBYTE GetScanline(int line) const;
+ virtual void DownSampleScanline(int line, FX_LPBYTE dest_scan, int dest_bpp,
+ int dest_width, FX_BOOL bFlipX, int clip_left, int clip_width) const;
+
+ const CFX_DIBSource* m_pSrc;
+
+ FX_BOOL m_bAutoDropSrc;
+
+ FX_LPBYTE m_pScanline;
+};
+class IFX_ScanlineComposer
+{
+public:
+
+ virtual void ComposeScanline(int line, FX_LPCBYTE scanline, FX_LPCBYTE scan_extra_alpha = NULL) = 0;
+
+
+ virtual FX_BOOL SetInfo(int width, int height, FXDIB_Format src_format, FX_DWORD* pSrcPalette) = 0;
+};
+class CFX_ScanlineCompositor : public CFX_Object
+{
+public:
+
+ CFX_ScanlineCompositor();
+
+ ~CFX_ScanlineCompositor();
+
+ FX_BOOL Init(FXDIB_Format dest_format, FXDIB_Format src_format, FX_INT32 width, FX_DWORD* pSrcPalette,
+ FX_DWORD mask_color, int blend_type, FX_BOOL bClip, FX_BOOL bRgbByteOrder = FALSE, int alpha_flag = 0, void* pIccTransform = NULL);
+
+
+ void CompositeRgbBitmapLine(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, FX_LPCBYTE clip_scan,
+ FX_LPCBYTE src_extra_alpha = NULL, FX_LPBYTE dst_extra_alpha = NULL);
+
+
+ void CompositePalBitmapLine(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int src_left, int width, FX_LPCBYTE clip_scan,
+ FX_LPCBYTE src_extra_alpha = NULL, FX_LPBYTE dst_extra_alpha = NULL);
+
+
+ void CompositeByteMaskLine(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, FX_LPCBYTE clip_scan,
+ FX_LPBYTE dst_extra_alpha = NULL);
+
+
+ void CompositeBitMaskLine(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int src_left, int width, FX_LPCBYTE clip_scan,
+ FX_LPBYTE dst_extra_alpha = NULL);
+protected:
+ int m_Transparency;
+ FXDIB_Format m_SrcFormat,
+ m_DestFormat;
+ FX_DWORD* m_pSrcPalette;
+
+ int m_MaskAlpha,
+ m_MaskRed,
+ m_MaskGreen,
+ m_MaskBlue,
+ m_MaskBlack;
+ int m_BlendType;
+ void* m_pIccTransform;
+ FX_LPBYTE m_pCacheScanline;
+ int m_CacheSize;
+ FX_BOOL m_bRgbByteOrder;
+};
+class CFX_BitmapComposer : public IFX_ScanlineComposer, public CFX_Object
+{
+public:
+
+ CFX_BitmapComposer();
+
+ ~CFX_BitmapComposer();
+
+
+ void Compose(CFX_DIBitmap* pDest, const CFX_ClipRgn* pClipRgn, int bitmap_alpha,
+ FX_DWORD mask_color, FX_RECT& dest_rect, FX_BOOL bVertical,
+ FX_BOOL bFlipX, FX_BOOL bFlipY, FX_BOOL bRgbByteOrder = FALSE,
+ int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL);
+
+ virtual FX_BOOL SetInfo(int width, int height, FXDIB_Format src_format, FX_DWORD* pSrcPalette);
+
+
+ virtual void ComposeScanline(int line, FX_LPCBYTE scanline, FX_LPCBYTE scan_extra_alpha);
+protected:
+
+ void DoCompose(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int dest_width, FX_LPCBYTE clip_scan,
+ FX_LPCBYTE src_extra_alpha = NULL, FX_LPBYTE dst_extra_alpha = NULL);
+ CFX_DIBitmap* m_pBitmap;
+ const CFX_ClipRgn* m_pClipRgn;
+ FXDIB_Format m_SrcFormat;
+ int m_DestLeft, m_DestTop, m_DestWidth, m_DestHeight, m_BitmapAlpha;
+ FX_DWORD m_MaskColor;
+ const CFX_DIBitmap* m_pClipMask;
+ CFX_ScanlineCompositor m_Compositor;
+ FX_BOOL m_bVertical, m_bFlipX, m_bFlipY;
+ int m_AlphaFlag;
+ void* m_pIccTransform;
+ FX_BOOL m_bRgbByteOrder;
+ int m_BlendType;
+ void ComposeScanlineV(int line, FX_LPCBYTE scanline, FX_LPCBYTE scan_extra_alpha = NULL);
+ FX_LPBYTE m_pScanlineV, m_pClipScanV, m_pAddClipScan, m_pScanlineAlphaV;
+};
+class CFX_BitmapStorer : public IFX_ScanlineComposer, public CFX_Object
+{
+public:
+
+ CFX_BitmapStorer();
+
+ ~CFX_BitmapStorer();
+
+ virtual void ComposeScanline(int line, FX_LPCBYTE scanline, FX_LPCBYTE scan_extra_alpha);
+
+ virtual FX_BOOL SetInfo(int width, int height, FXDIB_Format src_format, FX_DWORD* pSrcPalette);
+
+ CFX_DIBitmap* GetBitmap()
+ {
+ return m_pBitmap;
+ }
+
+ CFX_DIBitmap* Detach();
+
+ void Replace(CFX_DIBitmap* pBitmap);
+private:
+ CFX_DIBitmap* m_pBitmap;
+};
+class CStretchEngine;
+class CFX_ImageStretcher : public CFX_Object
+{
+public:
+
+ CFX_ImageStretcher();
+
+ ~CFX_ImageStretcher();
+
+ FX_INT32 Start(IFX_ScanlineComposer* pDest, const CFX_DIBSource* pBitmap,
+ int dest_width, int dest_height, const FX_RECT& bitmap_rect, FX_DWORD flags);
+
+
+ FX_INT32 Continue(IFX_Pause* pPause);
+ IFX_ScanlineComposer* m_pDest;
+ const CFX_DIBSource* m_pSource;
+ CStretchEngine* m_pStretchEngine;
+ FX_DWORD m_Flags;
+ FX_BOOL m_bFlipX,
+ m_bFlipY;
+ int m_DestWidth,
+ m_DestHeight;
+ FX_RECT m_ClipRect;
+ int m_LineIndex;
+ int m_DestBPP;
+ FX_LPBYTE m_pScanline;
+ FX_LPBYTE m_pMaskScanline;
+ FXDIB_Format m_DestFormat;
+ FX_INT32 m_Status;
+
+ FX_INT32 StartQuickStretch();
+
+ FX_INT32 StartStretch();
+
+ FX_INT32 ContinueQuickStretch(IFX_Pause* pPause);
+
+ FX_INT32 ContinueStretch(IFX_Pause* pPause);
+};
+class CFX_ImageTransformer : public CFX_Object
+{
+public:
+
+ CFX_ImageTransformer();
+
+ ~CFX_ImageTransformer();
+
+ FX_INT32 Start(const CFX_DIBSource* pSrc, const CFX_AffineMatrix* pMatrix, int flags, const FX_RECT* pClip);
+
+
+ FX_INT32 Continue(IFX_Pause* pPause);
+ CFX_AffineMatrix* m_pMatrix;
+ FX_RECT m_StretchClip;
+ int m_ResultLeft, m_ResultTop, m_ResultWidth, m_ResultHeight;
+ CFX_AffineMatrix m_dest2stretch;
+ CFX_ImageStretcher m_Stretcher;
+ CFX_BitmapStorer m_Storer;
+ FX_DWORD m_Flags;
+ int m_Status;
+};
+class CFX_ImageRenderer : public CFX_Object
+{
+public:
+
+ CFX_ImageRenderer();
+
+ ~CFX_ImageRenderer();
+
+ FX_INT32 Start(CFX_DIBitmap* pDevice, const CFX_ClipRgn* pClipRgn,
+ const CFX_DIBSource* pSource, int bitmap_alpha,
+ FX_DWORD mask_color, const CFX_AffineMatrix* pMatrix, FX_DWORD dib_flags,
+ FX_BOOL bRgbByteOrder = FALSE, int alpha_flag = 0, void* pIccTransform = NULL,
+ int blend_type = FXDIB_BLEND_NORMAL);
+
+ FX_INT32 Continue(IFX_Pause* pPause);
+protected:
+ CFX_DIBitmap* m_pDevice;
+ const CFX_ClipRgn* m_pClipRgn;
+ int m_BitmapAlpha;
+ FX_DWORD m_MaskColor;
+ CFX_AffineMatrix m_Matrix;
+ CFX_ImageTransformer* m_pTransformer;
+ CFX_ImageStretcher m_Stretcher;
+ CFX_BitmapComposer m_Composer;
+ int m_Status;
+ int m_DestLeft, m_DestTop;
+ FX_RECT m_ClipBox;
+ FX_DWORD m_Flags;
+ int m_AlphaFlag;
+ void* m_pIccTransform;
+ FX_BOOL m_bRgbByteOrder;
+ int m_BlendType;
+};
+#endif
diff --git a/core/include/fxge/fx_font.h b/core/include/fxge/fx_font.h
index abfa9b8b5d..dc96debeb6 100644
--- a/core/include/fxge/fx_font.h
+++ b/core/include/fxge/fx_font.h
@@ -1,428 +1,428 @@
-// 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 _FX_FONT_H_
-#define _FX_FONT_H_
-#ifndef _FXCRT_EXTENSION_
-#include "../../include/fxcrt/fx_ext.h"
-#endif
-#ifndef _FX_DIB_H_
-#include "fx_dib.h"
-#endif
-typedef struct FT_FaceRec_* FXFT_Face;
-typedef void* FXFT_Library;
-class IFX_FontEncoding;
-class CFX_PathData;
-class CFX_SubstFont;
-class CFX_FaceCache;
-class IFX_FontMapper;
-class CFX_FontMapper;
-class IFX_SystemFontInfo;
-class CFontFileFaceInfo;
-#define FXFONT_FIXED_PITCH 0x01
-#define FXFONT_SERIF 0x02
-#define FXFONT_SYMBOLIC 0x04
-#define FXFONT_SCRIPT 0x08
-#define FXFONT_ITALIC 0x40
-#define FXFONT_BOLD 0x40000
-#define FXFONT_USEEXTERNATTR 0x80000
-#define FXFONT_CIDFONT 0x100000
-#define FXFONT_ANSI_CHARSET 0
-#define FXFONT_DEFAULT_CHARSET 1
-#define FXFONT_SYMBOL_CHARSET 2
-#define FXFONT_SHIFTJIS_CHARSET 128
-#define FXFONT_HANGEUL_CHARSET 129
-#define FXFONT_GB2312_CHARSET 134
-#define FXFONT_CHINESEBIG5_CHARSET 136
-#define FXFONT_THAI_CHARSET 222
-#define FXFONT_EASTEUROPE_CHARSET 238
-#define FXFONT_RUSSIAN_CHARSET 204
-#define FXFONT_GREEK_CHARSET 161
-#define FXFONT_TURKISH_CHARSET 162
-#define FXFONT_HEBREW_CHARSET 177
-#define FXFONT_ARABIC_CHARSET 178
-#define FXFONT_BALTIC_CHARSET 186
-#define FXFONT_FF_FIXEDPITCH 1
-#define FXFONT_FF_ROMAN (1<<4)
-#define FXFONT_FF_SCRIPT (4<<4)
-#define FXFONT_FW_NORMAL 400
-#define FXFONT_FW_BOLD 700
-class CFX_Font : public CFX_Object
-{
-public:
- CFX_Font();
- ~CFX_Font();
-
- FX_BOOL LoadSubst(const CFX_ByteString& face_name, FX_BOOL bTrueType, FX_DWORD flags,
- int weight, int italic_angle, int CharsetCP, FX_BOOL bVertical = FALSE);
-
- FX_BOOL LoadEmbedded(FX_LPCBYTE data, FX_DWORD size);
-
- FX_BOOL LoadFile(IFX_FileRead* pFile);
-
- FXFT_Face GetFace() const
- {
- return m_Face;
- }
-
-
- const CFX_SubstFont* GetSubstFont() const
- {
- return m_pSubstFont;
- }
-
- CFX_PathData* LoadGlyphPath(FX_DWORD glyph_index, int dest_width = 0);
-
- int GetGlyphWidth(FX_DWORD glyph_index);
-
- int GetAscent() const;
-
- int GetDescent() const;
-
- FX_BOOL GetGlyphBBox(FX_DWORD glyph_index, FX_RECT &bbox);
-
- FX_BOOL IsItalic();
-
- FX_BOOL IsBold();
-
- FX_BOOL IsFixedWidth();
-
- FX_BOOL IsVertical() const
- {
- return m_bVertical;
- }
-
- CFX_WideString GetPsName() const;
-
-
- CFX_ByteString GetFamilyName() const;
-
- CFX_ByteString GetFaceName() const;
-
-
- FX_BOOL IsTTFont();
-
- FX_BOOL GetBBox(FX_RECT &bbox);
-
- int GetHeight();
-
- int GetULPos();
-
- int GetULthickness();
-
- int GetMaxAdvanceWidth();
-
- FXFT_Face m_Face;
-
- CFX_SubstFont* m_pSubstFont;
- FX_BOOL IsEmbedded()
- {
- return m_bEmbedded;
- }
-
- void AdjustMMParams(int glyph_index, int width, int weight);
- FX_LPBYTE m_pFontDataAllocation;
- FX_LPBYTE m_pFontData;
- FX_LPBYTE m_pGsubData;
- FX_DWORD m_dwSize;
- CFX_BinaryBuf m_OtfFontData;
- void* m_hHandle;
- void* m_pPlatformFont;
- void* m_pPlatformFontCollection;
- void* m_pDwFont;
- FX_BOOL m_bDwLoaded;
- void ReleasePlatformResource();
-
- void DeleteFace();
-protected:
-
- FX_BOOL m_bEmbedded;
- FX_BOOL m_bVertical;
- void* m_pOwnedStream;
-};
-#define ENCODING_INTERNAL 0
-#define ENCODING_UNICODE 1
-class IFX_FontEncoding : public CFX_Object
-{
-public:
- virtual ~IFX_FontEncoding() {}
-
- virtual FX_DWORD GlyphFromCharCode(FX_DWORD charcode) = 0;
-
- virtual CFX_WideString UnicodeFromCharCode(FX_DWORD charcode) const = 0;
-
- virtual FX_DWORD CharCodeFromUnicode(FX_WCHAR Unicode) const = 0;
-};
-IFX_FontEncoding* FXGE_CreateUnicodeEncoding(CFX_Font* pFont);
-#define FXFONT_SUBST_MM 0x01
-#define FXFONT_SUBST_GLYPHPATH 0x04
-#define FXFONT_SUBST_CLEARTYPE 0x08
-#define FXFONT_SUBST_TRANSFORM 0x10
-#define FXFONT_SUBST_NONSYMBOL 0x20
-#define FXFONT_SUBST_EXACT 0x40
-#define FXFONT_SUBST_STANDARD 0x80
-class CFX_SubstFont : public CFX_Object
-{
-public:
-
- CFX_SubstFont();
-
- FX_LPVOID m_ExtHandle;
-
- CFX_ByteString m_Family;
-
- int m_Charset;
-
- FX_DWORD m_SubstFlags;
-
- int m_Weight;
-
- int m_ItalicAngle;
-
- FX_BOOL m_bSubstOfCJK;
-
- int m_WeightCJK;
-
- FX_BOOL m_bItlicCJK;
-};
-#define FX_FONT_FLAG_SERIF 0x01
-#define FX_FONT_FLAG_FIXEDPITCH 0x02
-#define FX_FONT_FLAG_ITALIC 0x04
-#define FX_FONT_FLAG_BOLD 0x08
-#define FX_FONT_FLAG_SYMBOLIC_SYMBOL 0x10
-#define FX_FONT_FLAG_SYMBOLIC_DINGBATS 0x20
-#define FX_FONT_FLAG_MULTIPLEMASTER 0x40
-typedef struct {
- FX_LPCBYTE m_pFontData;
- FX_DWORD m_dwSize;
-} FoxitFonts;
-class CFX_FontMgr : public CFX_Object
-{
-public:
- CFX_FontMgr();
- ~CFX_FontMgr();
- void InitFTLibrary();
- FXFT_Face GetCachedFace(const CFX_ByteString& face_name,
- int weight, FX_BOOL bItalic, FX_LPBYTE& pFontData);
- FXFT_Face AddCachedFace(const CFX_ByteString& face_name,
- int weight, FX_BOOL bItalic, FX_LPBYTE pData, FX_DWORD size, int face_index);
- FXFT_Face GetCachedTTCFace(int ttc_size, FX_DWORD checksum,
- int font_offset, FX_LPBYTE& pFontData);
- FXFT_Face AddCachedTTCFace(int ttc_size, FX_DWORD checksum,
- FX_LPBYTE pData, FX_DWORD size, int font_offset);
- FXFT_Face GetFileFace(FX_LPCSTR filename, int face_index);
- FXFT_Face GetFixedFace(FX_LPCBYTE pData, FX_DWORD size, int face_index);
- void ReleaseFace(FXFT_Face face);
- void SetSystemFontInfo(IFX_SystemFontInfo* pFontInfo);
- FXFT_Face FindSubstFont(const CFX_ByteString& face_name, FX_BOOL bTrueType, FX_DWORD flags,
- int weight, int italic_angle, int CharsetCP, CFX_SubstFont* pSubstFont);
-
- void FreeCache();
-
- FX_BOOL GetStandardFont(FX_LPCBYTE& pFontData, FX_DWORD& size, int index);
- CFX_FontMapper* m_pBuiltinMapper;
- IFX_FontMapper* m_pExtMapper;
- CFX_MapByteStringToPtr m_FaceMap;
- FXFT_Library m_FTLibrary;
- FoxitFonts m_ExternalFonts[16];
-};
-class IFX_FontMapper : public CFX_Object
-{
-public:
-
- virtual ~IFX_FontMapper() {}
-
- virtual FXFT_Face FindSubstFont(const CFX_ByteString& face_name, FX_BOOL bTrueType, FX_DWORD flags,
- int weight, int italic_angle, int CharsetCP, CFX_SubstFont* pSubstFont) = 0;
-
- CFX_FontMgr* m_pFontMgr;
-};
-class IFX_FontEnumerator
-{
-public:
-
- virtual void HitFont() = 0;
-
- virtual void Finish() = 0;
-};
-class IFX_AdditionalFontEnum
-{
-public:
- virtual int CountFiles() = 0;
- virtual IFX_FileStream* GetFontFile(int index) = 0;
-};
-class CFX_FontMapper : public IFX_FontMapper
-{
-public:
- CFX_FontMapper();
- virtual ~CFX_FontMapper();
- void SetSystemFontInfo(IFX_SystemFontInfo* pFontInfo);
- IFX_SystemFontInfo* GetSystemFontInfo()
- {
- return m_pFontInfo;
- }
- void AddInstalledFont(const CFX_ByteString& name, int charset);
- void LoadInstalledFonts();
- CFX_ByteStringArray m_InstalledTTFonts;
- void SetFontEnumerator(IFX_FontEnumerator* pFontEnumerator)
- {
- m_pFontEnumerator = pFontEnumerator;
- }
- IFX_FontEnumerator* GetFontEnumerator() const
- {
- return m_pFontEnumerator;
- }
- virtual FXFT_Face FindSubstFont(const CFX_ByteString& face_name, FX_BOOL bTrueType, FX_DWORD flags,
- int weight, int italic_angle, int CharsetCP, CFX_SubstFont* pSubstFont);
-private:
- CFX_ByteString GetPSNameFromTT(void* hFont);
- CFX_ByteString MatchInstalledFonts(const CFX_ByteString& norm_name);
- FXFT_Face UseInternalSubst(CFX_SubstFont* pSubstFont, int iBaseFont, int italic_angle, int weight, int picthfamily);
-
- FX_BOOL m_bListLoaded;
- FXFT_Face m_MMFaces[2];
- CFX_ByteString m_LastFamily;
- CFX_DWordArray m_CharsetArray;
- CFX_ByteStringArray m_FaceArray;
- IFX_SystemFontInfo* m_pFontInfo;
- FXFT_Face m_FoxitFaces[14];
- IFX_FontEnumerator* m_pFontEnumerator;
-};
-class IFX_SystemFontInfo : public CFX_Object
-{
-public:
- static IFX_SystemFontInfo* CreateDefault();
- virtual void Release() = 0;
- virtual FX_BOOL EnumFontList(CFX_FontMapper* pMapper) = 0;
- virtual void* MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, FX_LPCSTR face, FX_BOOL& bExact) = 0;
- virtual void* GetFont(FX_LPCSTR face) = 0;
- virtual FX_DWORD GetFontData(void* hFont, FX_DWORD table, FX_LPBYTE buffer, FX_DWORD size) = 0;
- virtual FX_BOOL GetFaceName(void* hFont, CFX_ByteString& name) = 0;
- virtual FX_BOOL GetFontCharset(void* hFont, int& charset) = 0;
- virtual int GetFaceIndex(void* hFont)
- {
- return 0;
- }
- virtual void DeleteFont(void* hFont) = 0;
- virtual void* RetainFont(void* hFont)
- {
- return NULL;
- }
-};
-class CFX_FolderFontInfo : public IFX_SystemFontInfo
-{
-public:
- CFX_FolderFontInfo();
- ~CFX_FolderFontInfo();
- void AddPath(FX_BSTR path);
- virtual void Release();
- virtual FX_BOOL EnumFontList(CFX_FontMapper* pMapper);
- virtual void* MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, FX_LPCSTR face, FX_BOOL& bExact);
- virtual void* GetFont(FX_LPCSTR face);
- virtual FX_DWORD GetFontData(void* hFont, FX_DWORD table, FX_LPBYTE buffer, FX_DWORD size);
- virtual void DeleteFont(void* hFont);
- virtual FX_BOOL GetFaceName(void* hFont, CFX_ByteString& name);
- virtual FX_BOOL GetFontCharset(void* hFont, int& charset);
-protected:
- CFX_MapByteStringToPtr m_FontList;
- CFX_ByteStringArray m_PathList;
- CFX_FontMapper* m_pMapper;
- void ScanPath(CFX_ByteString& path);
- void ScanFile(CFX_ByteString& path);
- void ReportFace(CFX_ByteString& path, FXSYS_FILE* pFile, FX_DWORD filesize, FX_DWORD offset);
-};
-class CFX_CountedFaceCache : public CFX_Object
-{
-public:
- CFX_FaceCache* m_Obj;
- FX_DWORD m_nCount;
-};
-typedef CFX_MapPtrTemplate<FXFT_Face, CFX_CountedFaceCache*> CFX_FTCacheMap;
-class CFX_FontCache : public CFX_Object
-{
-public:
- ~CFX_FontCache();
- CFX_FaceCache* GetCachedFace(CFX_Font* pFont);
- void ReleaseCachedFace(CFX_Font* pFont);
- void FreeCache(FX_BOOL bRelease = FALSE);
-
-private:
- CFX_FTCacheMap m_FTFaceMap;
- CFX_FTCacheMap m_ExtFaceMap;
-};
-class CFX_AutoFontCache
-{
-public:
- CFX_AutoFontCache(CFX_FontCache* pFontCache, CFX_Font* pFont)
- : m_pFontCache(pFontCache)
- , m_pFont(pFont)
- {
- }
- ~CFX_AutoFontCache()
- {
- m_pFontCache->ReleaseCachedFace(m_pFont);
- }
- CFX_FontCache* m_pFontCache;
- CFX_Font* m_pFont;
-};
-#define FX_FONTCACHE_DEFINE(pFontCache, pFont) CFX_AutoFontCache autoFontCache((pFontCache), (pFont))
-class CFX_GlyphBitmap : public CFX_Object
-{
-public:
- int m_Top;
- int m_Left;
- CFX_DIBitmap m_Bitmap;
-};
-class CFX_FaceCache : public CFX_Object
-{
-public:
- ~CFX_FaceCache();
- const CFX_GlyphBitmap* LoadGlyphBitmap(CFX_Font* pFont, FX_DWORD glyph_index, FX_BOOL bFontStyle, const CFX_AffineMatrix* pMatrix,
- int dest_width, int anti_alias, int& text_flags);
- const CFX_PathData* LoadGlyphPath(CFX_Font* pFont, FX_DWORD glyph_index, int dest_width);
-
-
- CFX_FaceCache(FXFT_Face face);
-private:
- FXFT_Face m_Face;
- CFX_GlyphBitmap* RenderGlyph(CFX_Font* pFont, FX_DWORD glyph_index, FX_BOOL bFontStyle,
- const CFX_AffineMatrix* pMatrix, int dest_width, int anti_alias);
- CFX_GlyphBitmap* RenderGlyph_Nativetext(CFX_Font* pFont, FX_DWORD glyph_index,
- const CFX_AffineMatrix* pMatrix, int dest_width, int anti_alias);
- CFX_GlyphBitmap* LookUpGlyphBitmap(CFX_Font* pFont, const CFX_AffineMatrix* pMatrix, CFX_ByteStringC& FaceGlyphsKey,
- FX_DWORD glyph_index, FX_BOOL bFontStyle, int dest_width, int anti_alias);
- CFX_MapByteStringToPtr m_SizeMap;
- CFX_MapPtrToPtr m_PathMap;
- CFX_DIBitmap* m_pBitmap;
- void* m_pPlatformGraphics;
- void* m_pPlatformBitmap;
- void* m_hDC;
- void* m_hBitmap;
- void* m_hOldBitmap;
- void* m_hGdiFont;
- void* m_hOldGdiFont;
-
- void InitPlatform();
- void DestroyPlatform();
-};
-typedef struct {
- const CFX_GlyphBitmap* m_pGlyph;
- int m_OriginX, m_OriginY;
- FX_FLOAT m_fOriginX, m_fOriginY;
-} FXTEXT_GLYPHPOS;
-FX_RECT FXGE_GetGlyphsBBox(FXTEXT_GLYPHPOS* pGlyphAndPos, int nChars, int anti_alias, FX_FLOAT retinaScaleX = 1.0f, FX_FLOAT retinaScaleY = 1.0f);
-FX_BOOL OutputGlyph(void* dib, int x, int y, CFX_Font* pFont, double font_size,
- CFX_AffineMatrix* pMatrix, unsigned long glyph_index, unsigned long argb);
-FX_BOOL OutputText(void* dib, int x, int y, CFX_Font* pFont, double font_size,
- CFX_AffineMatrix* pText_matrix, unsigned short const* text, unsigned long argb);
-class IFX_GSUBTable
-{
-public:
- virtual void Release() = 0;
- virtual FX_BOOL GetVerticalGlyph(FX_DWORD glyphnum, FX_DWORD* vglyphnum) = 0;
-};
-IFX_GSUBTable* FXGE_CreateGSUBTable(CFX_Font* pFont);
-#endif
+// 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 _FX_FONT_H_
+#define _FX_FONT_H_
+#ifndef _FXCRT_EXTENSION_
+#include "../../include/fxcrt/fx_ext.h"
+#endif
+#ifndef _FX_DIB_H_
+#include "fx_dib.h"
+#endif
+typedef struct FT_FaceRec_* FXFT_Face;
+typedef void* FXFT_Library;
+class IFX_FontEncoding;
+class CFX_PathData;
+class CFX_SubstFont;
+class CFX_FaceCache;
+class IFX_FontMapper;
+class CFX_FontMapper;
+class IFX_SystemFontInfo;
+class CFontFileFaceInfo;
+#define FXFONT_FIXED_PITCH 0x01
+#define FXFONT_SERIF 0x02
+#define FXFONT_SYMBOLIC 0x04
+#define FXFONT_SCRIPT 0x08
+#define FXFONT_ITALIC 0x40
+#define FXFONT_BOLD 0x40000
+#define FXFONT_USEEXTERNATTR 0x80000
+#define FXFONT_CIDFONT 0x100000
+#define FXFONT_ANSI_CHARSET 0
+#define FXFONT_DEFAULT_CHARSET 1
+#define FXFONT_SYMBOL_CHARSET 2
+#define FXFONT_SHIFTJIS_CHARSET 128
+#define FXFONT_HANGEUL_CHARSET 129
+#define FXFONT_GB2312_CHARSET 134
+#define FXFONT_CHINESEBIG5_CHARSET 136
+#define FXFONT_THAI_CHARSET 222
+#define FXFONT_EASTEUROPE_CHARSET 238
+#define FXFONT_RUSSIAN_CHARSET 204
+#define FXFONT_GREEK_CHARSET 161
+#define FXFONT_TURKISH_CHARSET 162
+#define FXFONT_HEBREW_CHARSET 177
+#define FXFONT_ARABIC_CHARSET 178
+#define FXFONT_BALTIC_CHARSET 186
+#define FXFONT_FF_FIXEDPITCH 1
+#define FXFONT_FF_ROMAN (1<<4)
+#define FXFONT_FF_SCRIPT (4<<4)
+#define FXFONT_FW_NORMAL 400
+#define FXFONT_FW_BOLD 700
+class CFX_Font : public CFX_Object
+{
+public:
+ CFX_Font();
+ ~CFX_Font();
+
+ FX_BOOL LoadSubst(const CFX_ByteString& face_name, FX_BOOL bTrueType, FX_DWORD flags,
+ int weight, int italic_angle, int CharsetCP, FX_BOOL bVertical = FALSE);
+
+ FX_BOOL LoadEmbedded(FX_LPCBYTE data, FX_DWORD size);
+
+ FX_BOOL LoadFile(IFX_FileRead* pFile);
+
+ FXFT_Face GetFace() const
+ {
+ return m_Face;
+ }
+
+
+ const CFX_SubstFont* GetSubstFont() const
+ {
+ return m_pSubstFont;
+ }
+
+ CFX_PathData* LoadGlyphPath(FX_DWORD glyph_index, int dest_width = 0);
+
+ int GetGlyphWidth(FX_DWORD glyph_index);
+
+ int GetAscent() const;
+
+ int GetDescent() const;
+
+ FX_BOOL GetGlyphBBox(FX_DWORD glyph_index, FX_RECT &bbox);
+
+ FX_BOOL IsItalic();
+
+ FX_BOOL IsBold();
+
+ FX_BOOL IsFixedWidth();
+
+ FX_BOOL IsVertical() const
+ {
+ return m_bVertical;
+ }
+
+ CFX_WideString GetPsName() const;
+
+
+ CFX_ByteString GetFamilyName() const;
+
+ CFX_ByteString GetFaceName() const;
+
+
+ FX_BOOL IsTTFont();
+
+ FX_BOOL GetBBox(FX_RECT &bbox);
+
+ int GetHeight();
+
+ int GetULPos();
+
+ int GetULthickness();
+
+ int GetMaxAdvanceWidth();
+
+ FXFT_Face m_Face;
+
+ CFX_SubstFont* m_pSubstFont;
+ FX_BOOL IsEmbedded()
+ {
+ return m_bEmbedded;
+ }
+
+ void AdjustMMParams(int glyph_index, int width, int weight);
+ FX_LPBYTE m_pFontDataAllocation;
+ FX_LPBYTE m_pFontData;
+ FX_LPBYTE m_pGsubData;
+ FX_DWORD m_dwSize;
+ CFX_BinaryBuf m_OtfFontData;
+ void* m_hHandle;
+ void* m_pPlatformFont;
+ void* m_pPlatformFontCollection;
+ void* m_pDwFont;
+ FX_BOOL m_bDwLoaded;
+ void ReleasePlatformResource();
+
+ void DeleteFace();
+protected:
+
+ FX_BOOL m_bEmbedded;
+ FX_BOOL m_bVertical;
+ void* m_pOwnedStream;
+};
+#define ENCODING_INTERNAL 0
+#define ENCODING_UNICODE 1
+class IFX_FontEncoding : public CFX_Object
+{
+public:
+ virtual ~IFX_FontEncoding() {}
+
+ virtual FX_DWORD GlyphFromCharCode(FX_DWORD charcode) = 0;
+
+ virtual CFX_WideString UnicodeFromCharCode(FX_DWORD charcode) const = 0;
+
+ virtual FX_DWORD CharCodeFromUnicode(FX_WCHAR Unicode) const = 0;
+};
+IFX_FontEncoding* FXGE_CreateUnicodeEncoding(CFX_Font* pFont);
+#define FXFONT_SUBST_MM 0x01
+#define FXFONT_SUBST_GLYPHPATH 0x04
+#define FXFONT_SUBST_CLEARTYPE 0x08
+#define FXFONT_SUBST_TRANSFORM 0x10
+#define FXFONT_SUBST_NONSYMBOL 0x20
+#define FXFONT_SUBST_EXACT 0x40
+#define FXFONT_SUBST_STANDARD 0x80
+class CFX_SubstFont : public CFX_Object
+{
+public:
+
+ CFX_SubstFont();
+
+ FX_LPVOID m_ExtHandle;
+
+ CFX_ByteString m_Family;
+
+ int m_Charset;
+
+ FX_DWORD m_SubstFlags;
+
+ int m_Weight;
+
+ int m_ItalicAngle;
+
+ FX_BOOL m_bSubstOfCJK;
+
+ int m_WeightCJK;
+
+ FX_BOOL m_bItlicCJK;
+};
+#define FX_FONT_FLAG_SERIF 0x01
+#define FX_FONT_FLAG_FIXEDPITCH 0x02
+#define FX_FONT_FLAG_ITALIC 0x04
+#define FX_FONT_FLAG_BOLD 0x08
+#define FX_FONT_FLAG_SYMBOLIC_SYMBOL 0x10
+#define FX_FONT_FLAG_SYMBOLIC_DINGBATS 0x20
+#define FX_FONT_FLAG_MULTIPLEMASTER 0x40
+typedef struct {
+ FX_LPCBYTE m_pFontData;
+ FX_DWORD m_dwSize;
+} FoxitFonts;
+class CFX_FontMgr : public CFX_Object
+{
+public:
+ CFX_FontMgr();
+ ~CFX_FontMgr();
+ void InitFTLibrary();
+ FXFT_Face GetCachedFace(const CFX_ByteString& face_name,
+ int weight, FX_BOOL bItalic, FX_LPBYTE& pFontData);
+ FXFT_Face AddCachedFace(const CFX_ByteString& face_name,
+ int weight, FX_BOOL bItalic, FX_LPBYTE pData, FX_DWORD size, int face_index);
+ FXFT_Face GetCachedTTCFace(int ttc_size, FX_DWORD checksum,
+ int font_offset, FX_LPBYTE& pFontData);
+ FXFT_Face AddCachedTTCFace(int ttc_size, FX_DWORD checksum,
+ FX_LPBYTE pData, FX_DWORD size, int font_offset);
+ FXFT_Face GetFileFace(FX_LPCSTR filename, int face_index);
+ FXFT_Face GetFixedFace(FX_LPCBYTE pData, FX_DWORD size, int face_index);
+ void ReleaseFace(FXFT_Face face);
+ void SetSystemFontInfo(IFX_SystemFontInfo* pFontInfo);
+ FXFT_Face FindSubstFont(const CFX_ByteString& face_name, FX_BOOL bTrueType, FX_DWORD flags,
+ int weight, int italic_angle, int CharsetCP, CFX_SubstFont* pSubstFont);
+
+ void FreeCache();
+
+ FX_BOOL GetStandardFont(FX_LPCBYTE& pFontData, FX_DWORD& size, int index);
+ CFX_FontMapper* m_pBuiltinMapper;
+ IFX_FontMapper* m_pExtMapper;
+ CFX_MapByteStringToPtr m_FaceMap;
+ FXFT_Library m_FTLibrary;
+ FoxitFonts m_ExternalFonts[16];
+};
+class IFX_FontMapper : public CFX_Object
+{
+public:
+
+ virtual ~IFX_FontMapper() {}
+
+ virtual FXFT_Face FindSubstFont(const CFX_ByteString& face_name, FX_BOOL bTrueType, FX_DWORD flags,
+ int weight, int italic_angle, int CharsetCP, CFX_SubstFont* pSubstFont) = 0;
+
+ CFX_FontMgr* m_pFontMgr;
+};
+class IFX_FontEnumerator
+{
+public:
+
+ virtual void HitFont() = 0;
+
+ virtual void Finish() = 0;
+};
+class IFX_AdditionalFontEnum
+{
+public:
+ virtual int CountFiles() = 0;
+ virtual IFX_FileStream* GetFontFile(int index) = 0;
+};
+class CFX_FontMapper : public IFX_FontMapper
+{
+public:
+ CFX_FontMapper();
+ virtual ~CFX_FontMapper();
+ void SetSystemFontInfo(IFX_SystemFontInfo* pFontInfo);
+ IFX_SystemFontInfo* GetSystemFontInfo()
+ {
+ return m_pFontInfo;
+ }
+ void AddInstalledFont(const CFX_ByteString& name, int charset);
+ void LoadInstalledFonts();
+ CFX_ByteStringArray m_InstalledTTFonts;
+ void SetFontEnumerator(IFX_FontEnumerator* pFontEnumerator)
+ {
+ m_pFontEnumerator = pFontEnumerator;
+ }
+ IFX_FontEnumerator* GetFontEnumerator() const
+ {
+ return m_pFontEnumerator;
+ }
+ virtual FXFT_Face FindSubstFont(const CFX_ByteString& face_name, FX_BOOL bTrueType, FX_DWORD flags,
+ int weight, int italic_angle, int CharsetCP, CFX_SubstFont* pSubstFont);
+private:
+ CFX_ByteString GetPSNameFromTT(void* hFont);
+ CFX_ByteString MatchInstalledFonts(const CFX_ByteString& norm_name);
+ FXFT_Face UseInternalSubst(CFX_SubstFont* pSubstFont, int iBaseFont, int italic_angle, int weight, int picthfamily);
+
+ FX_BOOL m_bListLoaded;
+ FXFT_Face m_MMFaces[2];
+ CFX_ByteString m_LastFamily;
+ CFX_DWordArray m_CharsetArray;
+ CFX_ByteStringArray m_FaceArray;
+ IFX_SystemFontInfo* m_pFontInfo;
+ FXFT_Face m_FoxitFaces[14];
+ IFX_FontEnumerator* m_pFontEnumerator;
+};
+class IFX_SystemFontInfo : public CFX_Object
+{
+public:
+ static IFX_SystemFontInfo* CreateDefault();
+ virtual void Release() = 0;
+ virtual FX_BOOL EnumFontList(CFX_FontMapper* pMapper) = 0;
+ virtual void* MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, FX_LPCSTR face, FX_BOOL& bExact) = 0;
+ virtual void* GetFont(FX_LPCSTR face) = 0;
+ virtual FX_DWORD GetFontData(void* hFont, FX_DWORD table, FX_LPBYTE buffer, FX_DWORD size) = 0;
+ virtual FX_BOOL GetFaceName(void* hFont, CFX_ByteString& name) = 0;
+ virtual FX_BOOL GetFontCharset(void* hFont, int& charset) = 0;
+ virtual int GetFaceIndex(void* hFont)
+ {
+ return 0;
+ }
+ virtual void DeleteFont(void* hFont) = 0;
+ virtual void* RetainFont(void* hFont)
+ {
+ return NULL;
+ }
+};
+class CFX_FolderFontInfo : public IFX_SystemFontInfo
+{
+public:
+ CFX_FolderFontInfo();
+ ~CFX_FolderFontInfo();
+ void AddPath(FX_BSTR path);
+ virtual void Release();
+ virtual FX_BOOL EnumFontList(CFX_FontMapper* pMapper);
+ virtual void* MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, FX_LPCSTR face, FX_BOOL& bExact);
+ virtual void* GetFont(FX_LPCSTR face);
+ virtual FX_DWORD GetFontData(void* hFont, FX_DWORD table, FX_LPBYTE buffer, FX_DWORD size);
+ virtual void DeleteFont(void* hFont);
+ virtual FX_BOOL GetFaceName(void* hFont, CFX_ByteString& name);
+ virtual FX_BOOL GetFontCharset(void* hFont, int& charset);
+protected:
+ CFX_MapByteStringToPtr m_FontList;
+ CFX_ByteStringArray m_PathList;
+ CFX_FontMapper* m_pMapper;
+ void ScanPath(CFX_ByteString& path);
+ void ScanFile(CFX_ByteString& path);
+ void ReportFace(CFX_ByteString& path, FXSYS_FILE* pFile, FX_DWORD filesize, FX_DWORD offset);
+};
+class CFX_CountedFaceCache : public CFX_Object
+{
+public:
+ CFX_FaceCache* m_Obj;
+ FX_DWORD m_nCount;
+};
+typedef CFX_MapPtrTemplate<FXFT_Face, CFX_CountedFaceCache*> CFX_FTCacheMap;
+class CFX_FontCache : public CFX_Object
+{
+public:
+ ~CFX_FontCache();
+ CFX_FaceCache* GetCachedFace(CFX_Font* pFont);
+ void ReleaseCachedFace(CFX_Font* pFont);
+ void FreeCache(FX_BOOL bRelease = FALSE);
+
+private:
+ CFX_FTCacheMap m_FTFaceMap;
+ CFX_FTCacheMap m_ExtFaceMap;
+};
+class CFX_AutoFontCache
+{
+public:
+ CFX_AutoFontCache(CFX_FontCache* pFontCache, CFX_Font* pFont)
+ : m_pFontCache(pFontCache)
+ , m_pFont(pFont)
+ {
+ }
+ ~CFX_AutoFontCache()
+ {
+ m_pFontCache->ReleaseCachedFace(m_pFont);
+ }
+ CFX_FontCache* m_pFontCache;
+ CFX_Font* m_pFont;
+};
+#define FX_FONTCACHE_DEFINE(pFontCache, pFont) CFX_AutoFontCache autoFontCache((pFontCache), (pFont))
+class CFX_GlyphBitmap : public CFX_Object
+{
+public:
+ int m_Top;
+ int m_Left;
+ CFX_DIBitmap m_Bitmap;
+};
+class CFX_FaceCache : public CFX_Object
+{
+public:
+ ~CFX_FaceCache();
+ const CFX_GlyphBitmap* LoadGlyphBitmap(CFX_Font* pFont, FX_DWORD glyph_index, FX_BOOL bFontStyle, const CFX_AffineMatrix* pMatrix,
+ int dest_width, int anti_alias, int& text_flags);
+ const CFX_PathData* LoadGlyphPath(CFX_Font* pFont, FX_DWORD glyph_index, int dest_width);
+
+
+ CFX_FaceCache(FXFT_Face face);
+private:
+ FXFT_Face m_Face;
+ CFX_GlyphBitmap* RenderGlyph(CFX_Font* pFont, FX_DWORD glyph_index, FX_BOOL bFontStyle,
+ const CFX_AffineMatrix* pMatrix, int dest_width, int anti_alias);
+ CFX_GlyphBitmap* RenderGlyph_Nativetext(CFX_Font* pFont, FX_DWORD glyph_index,
+ const CFX_AffineMatrix* pMatrix, int dest_width, int anti_alias);
+ CFX_GlyphBitmap* LookUpGlyphBitmap(CFX_Font* pFont, const CFX_AffineMatrix* pMatrix, CFX_ByteStringC& FaceGlyphsKey,
+ FX_DWORD glyph_index, FX_BOOL bFontStyle, int dest_width, int anti_alias);
+ CFX_MapByteStringToPtr m_SizeMap;
+ CFX_MapPtrToPtr m_PathMap;
+ CFX_DIBitmap* m_pBitmap;
+ void* m_pPlatformGraphics;
+ void* m_pPlatformBitmap;
+ void* m_hDC;
+ void* m_hBitmap;
+ void* m_hOldBitmap;
+ void* m_hGdiFont;
+ void* m_hOldGdiFont;
+
+ void InitPlatform();
+ void DestroyPlatform();
+};
+typedef struct {
+ const CFX_GlyphBitmap* m_pGlyph;
+ int m_OriginX, m_OriginY;
+ FX_FLOAT m_fOriginX, m_fOriginY;
+} FXTEXT_GLYPHPOS;
+FX_RECT FXGE_GetGlyphsBBox(FXTEXT_GLYPHPOS* pGlyphAndPos, int nChars, int anti_alias, FX_FLOAT retinaScaleX = 1.0f, FX_FLOAT retinaScaleY = 1.0f);
+FX_BOOL OutputGlyph(void* dib, int x, int y, CFX_Font* pFont, double font_size,
+ CFX_AffineMatrix* pMatrix, unsigned long glyph_index, unsigned long argb);
+FX_BOOL OutputText(void* dib, int x, int y, CFX_Font* pFont, double font_size,
+ CFX_AffineMatrix* pText_matrix, unsigned short const* text, unsigned long argb);
+class IFX_GSUBTable
+{
+public:
+ virtual void Release() = 0;
+ virtual FX_BOOL GetVerticalGlyph(FX_DWORD glyphnum, FX_DWORD* vglyphnum) = 0;
+};
+IFX_GSUBTable* FXGE_CreateGSUBTable(CFX_Font* pFont);
+#endif
diff --git a/core/include/fxge/fx_freetype.h b/core/include/fxge/fx_freetype.h
index 397c3eea9b..6a2190b2fc 100644
--- a/core/include/fxge/fx_freetype.h
+++ b/core/include/fxge/fx_freetype.h
@@ -1,144 +1,144 @@
-// 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
-
-#include "../thirdparties/freetype/ft2build.h"
-#include "../thirdparties/freetype/freetype/freetype.h"
-#include "../thirdparties/freetype/freetype/ftoutln.h"
-#include "../thirdparties/freetype/freetype/ftmm.h"
-#include "../thirdparties/freetype/freetype/internal/ftobjs.h"
-#include "../thirdparties/freetype/freetype/tttables.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
-#define FXFT_ENCODING_UNICODE FT_ENCODING_UNICODE
-#define FXFT_ENCODING_ADOBE_STANDARD FT_ENCODING_ADOBE_STANDARD
-#define FXFT_ENCODING_ADOBE_EXPERT FT_ENCODING_ADOBE_EXPERT
-#define FXFT_ENCODING_ADOBE_LATIN_1 FT_ENCODING_ADOBE_LATIN_1
-#define FXFT_ENCODING_APPLE_ROMAN FT_ENCODING_APPLE_ROMAN
-#define FXFT_ENCODING_ADOBE_CUSTOM FT_ENCODING_ADOBE_CUSTOM
-#define FXFT_ENCODING_MS_SYMBOL FT_ENCODING_MS_SYMBOL
-#define FXFT_ENCODING_GB2312 FT_ENCODING_GB2312
-#define FXFT_ENCODING_BIG5 FT_ENCODING_BIG5
-#define FXFT_ENCODING_SJIS FT_ENCODING_SJIS
-#define FXFT_ENCODING_JOHAB FT_ENCODING_JOHAB
-#define FXFT_ENCODING_WANSUNG FT_ENCODING_WANSUNG
-#define FXFT_LOAD_NO_SCALE FT_LOAD_NO_SCALE
-#define FXFT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH
-#define FXFT_RENDER_MODE_LCD FT_RENDER_MODE_LCD
-#define FXFT_RENDER_MODE_MONO FT_RENDER_MODE_MONO
-#define FXFT_RENDER_MODE_NORMAL FT_RENDER_MODE_NORMAL
-#define FXFT_LOAD_IGNORE_TRANSFORM FT_LOAD_IGNORE_TRANSFORM
-#define FXFT_LOAD_NO_BITMAP FT_LOAD_NO_BITMAP
-#define FXFT_LOAD_NO_HINTING FT_LOAD_NO_HINTING
-#define FXFT_PIXEL_MODE_MONO FT_PIXEL_MODE_MONO
-#define FXFT_STYLE_FLAG_ITALIC FT_STYLE_FLAG_ITALIC
-#define FXFT_STYLE_FLAG_BOLD FT_STYLE_FLAG_BOLD
-#define FXFT_FACE_FLAG_SFNT FT_FACE_FLAG_SFNT
-#define FXFT_FACE_FLAG_TRICKY ( 1L << 13 )
-typedef FT_MM_Var* FXFT_MM_Var;
-typedef FT_Bitmap* FXFT_Bitmap;
-#define FXFT_Matrix FT_Matrix
-#define FXFT_Vector FT_Vector
-#define FXFT_Outline_Funcs FT_Outline_Funcs
-typedef FT_Open_Args FXFT_Open_Args;
-typedef FT_StreamRec FXFT_StreamRec;
-typedef FT_StreamRec* FXFT_Stream;
-typedef FT_BBox FXFT_BBox;
-typedef FT_Glyph FXFT_Glyph;
-typedef FT_CharMap FXFT_CharMap;
-#define FXFT_GLYPH_BBOX_PIXELS FT_GLYPH_BBOX_PIXELS
-#define FXFT_Open_Face(library, args, index, face) \
- FT_Open_Face((FT_Library)(library), args, index, (FT_Face*)(face))
-#define FXFT_Done_Face(face) FT_Done_Face((FT_Face)(face))
-#define FXFT_Done_FreeType(library) FT_Done_FreeType((FT_Library)(library))
-#define FXFT_Init_FreeType(library) FT_Init_FreeType((FT_Library*)(library))
-#define FXFT_New_Memory_Face(library, base, size, index, face) \
- FT_New_Memory_Face((FT_Library)(library), base, size, index, (FT_Face*)(face))
-#define FXFT_New_Face(library, filename, index, face) \
- FT_New_Face((FT_Library)(library), filename, index, (FT_Face*)(face))
-#define FXFT_Get_Face_FreeType(face) ((FT_Face)face)->driver->root.library
-#define FXFT_Select_Charmap(face, encoding) FT_Select_Charmap((FT_Face)face, (FT_Encoding)encoding)
-#define FXFT_Set_Charmap(face, charmap) FT_Set_Charmap((FT_Face)face, (FT_CharMap)charmap)
-#define FXFT_Load_Glyph(face, glyph_index, flags) FT_Load_Glyph((FT_Face)face, glyph_index, flags)
-#define FXFT_Get_Char_Index(face, code) FT_Get_Char_Index((FT_Face)face, code)
-#define FXFT_Get_Glyph_Name(face, index, buffer, size) FT_Get_Glyph_Name((FT_Face)face, index, buffer, size)
-#define FXFT_Get_Name_Index(face, name) FT_Get_Name_Index((FT_Face)face, name)
-#define FXFT_Has_Glyph_Names(face) (((FT_Face)face)->face_flags & FT_FACE_FLAG_GLYPH_NAMES)
-#define FXFT_Get_Postscript_Name(face) FT_Get_Postscript_Name((FT_Face)face)
-#define FXFT_Load_Sfnt_Table(face, tag, offset, buffer, length) \
- FT_Load_Sfnt_Table((FT_Face)face, tag, offset, buffer, length)
-#define FXFT_Get_First_Char(face, glyph_index) FT_Get_First_Char((FT_Face)face, glyph_index)
-#define FXFT_Get_Next_Char(face, code, glyph_index) FT_Get_Next_Char((FT_Face)face, code, glyph_index)
-#define FXFT_Clear_Face_External_Stream(face) (((FT_Face)face)->face_flags&=~FT_FACE_FLAG_EXTERNAL_STREAM)
-#define FXFT_Get_Face_External_Stream(face) (((FT_Face)face)->face_flags&FT_FACE_FLAG_EXTERNAL_STREAM)
-#define FXFT_Is_Face_TT_OT(face) (((FT_Face)face)->face_flags&FT_FACE_FLAG_SFNT)
-#define FXFT_Is_Face_Tricky(face) (((FT_Face)face)->face_flags&FXFT_FACE_FLAG_TRICKY)
-#define FXFT_Is_Face_fixedwidth(face) (((FT_Face)face)->face_flags & FT_FACE_FLAG_FIXED_WIDTH)
-#define FXFT_Get_Face_Stream_Base(face) ((FT_Face)face)->stream->base
-#define FXFT_Get_Face_Stream_Size(face) ((FT_Face)face)->stream->size
-#define FXFT_Get_Face_Family_Name(face) ((FT_Face)face)->family_name
-#define FXFT_Get_Face_Style_Name(face) ((FT_Face)face)->style_name
-#define FXFT_Get_Face_Numfaces(face) ((FT_Face)face)->num_faces
-#define FXFT_Get_Face_Faceindex(face) ((FT_Face)face)->face_index
-#define FXFT_Is_Face_Italic(face) (((FT_Face)face)->style_flags&FT_STYLE_FLAG_ITALIC)
-#define FXFT_Is_Face_Bold(face) (((FT_Face)face)->style_flags&FT_STYLE_FLAG_BOLD)
-#define FXFT_Get_Face_Charmaps(face) ((FT_Face)face)->charmaps
-#define FXFT_Get_Glyph_HoriBearingX(face) ((FT_Face)face)->glyph->metrics.horiBearingX
-#define FXFT_Get_Glyph_HoriBearingY(face) ((FT_Face)face)->glyph->metrics.horiBearingY
-#define FXFT_Get_Glyph_Width(face) ((FT_Face)face)->glyph->metrics.width
-#define FXFT_Get_Glyph_Height(face) ((FT_Face)face)->glyph->metrics.height
-#define FXFT_Get_Face_CharmapCount(face) ((FT_Face)face)->num_charmaps
-#define FXFT_Get_Charmap_Encoding(charmap) ((FT_CharMap)charmap)->encoding
-#define FXFT_Get_Face_Charmap(face) ((FT_Face)face)->charmap
-#define FXFT_Get_Charmap_PlatformID(charmap) ((FT_CharMap)charmap)->platform_id
-#define FXFT_Get_Charmap_EncodingID(charmap) ((FT_CharMap)charmap)->encoding_id
-#define FXFT_Get_Face_UnitsPerEM(face) ((FT_Face)face)->units_per_EM
-#define FXFT_Get_Face_xMin(face) ((FT_Face)face)->bbox.xMin
-#define FXFT_Get_Face_xMax(face) ((FT_Face)face)->bbox.xMax
-#define FXFT_Get_Face_yMin(face) ((FT_Face)face)->bbox.yMin
-#define FXFT_Get_Face_yMax(face) ((FT_Face)face)->bbox.yMax
-#define FXFT_Get_Face_Height(face) ((FT_Face)face)->height
-#define FXFT_Get_Face_UnderLineThickness(face) ((FT_Face)face)->underline_thickness
-#define FXFT_Get_Face_UnderLinePosition(face) ((FT_Face)face)->underline_position
-#define FXFT_Get_Face_MaxAdvanceWidth(face) ((FT_Face)face)->max_advance_width
-#define FXFT_Get_Face_Ascender(face) ((FT_Face)face)->ascender
-#define FXFT_Get_Face_Descender(face) ((FT_Face)face)->descender
-#define FXFT_Get_Glyph_HoriAdvance(face) ((FT_Face)face)->glyph->metrics.horiAdvance
-#define FXFT_Get_MM_Axis(var, index) &((FT_MM_Var*)var)->axis[index]
-#define FXFT_Get_MM_Axis_Min(axis) ((FT_Var_Axis*)axis)->minimum
-#define FXFT_Get_MM_Axis_Max(axis) ((FT_Var_Axis*)axis)->maximum
-#define FXFT_Get_MM_Axis_Def(axis) ((FT_Var_Axis*)axis)->def
-#define FXFT_Get_Face_Internal_Flag(face) ((FT_Face)face)->internal->transform_flags
-#define FXFT_Set_Face_Internal_Flag(face, flag) (((FT_Face)face)->internal->transform_flags = flag)
-#define FXFT_Alloc(library, size) ((FT_Library)library)->memory->alloc(((FT_Library)library)->memory, size)
-#define FXFT_Free(face, p) ((FT_Face)face)->memory->free(((FT_Face)face)->memory, p)
-#define FXFT_Get_Glyph_Outline(face) &((FT_Face)face)->glyph->outline
-#define FXFT_Get_Outline_Bbox(outline, cbox) FT_Outline_Get_CBox(outline, cbox)
-#define FXFT_Render_Glyph(face, mode) FT_Render_Glyph(((FT_Face)face)->glyph, (enum FT_Render_Mode_)mode)
-#define FXFT_Get_MM_Var(face, p) FT_Get_MM_Var((FT_Face)face, p)
-#define FXFT_Set_MM_Design_Coordinates(face, n, p) FT_Set_MM_Design_Coordinates((FT_Face)face, n, p)
-#define FXFT_Set_Pixel_Sizes(face, w, h) FT_Set_Pixel_Sizes((FT_Face)face, w, h)
-#define FXFT_Set_Transform(face, m, d) FT_Set_Transform((FT_Face)face, m, d)
-#define FXFT_Outline_Embolden(outline, s) FT_Outline_Embolden(outline, s)
-#define FXFT_Get_Glyph_Bitmap(face) &((FT_Face)face)->glyph->bitmap
-#define FXFT_Get_Bitmap_Width(bitmap) ((FT_Bitmap*)bitmap)->width
-#define FXFT_Get_Bitmap_Rows(bitmap) ((FT_Bitmap*)bitmap)->rows
-#define FXFT_Get_Bitmap_PixelMode(bitmap) ((FT_Bitmap*)bitmap)->pixel_mode
-#define FXFT_Get_Bitmap_Pitch(bitmap) ((FT_Bitmap*)bitmap)->pitch
-#define FXFT_Get_Bitmap_Buffer(bitmap) ((FT_Bitmap*)bitmap)->buffer
-#define FXFT_Get_Glyph_BitmapLeft(face) ((FT_Face)face)->glyph->bitmap_left
-#define FXFT_Get_Glyph_BitmapTop(face) ((FT_Face)face)->glyph->bitmap_top
-#define FXFT_Outline_Decompose(outline, funcs, params) FT_Outline_Decompose(outline, funcs, params)
-#define FXFT_Set_Char_Size(face, char_width, char_height, horz_resolution, vert_resolution) FT_Set_Char_Size(face, char_width, char_height, horz_resolution, vert_resolution)
-#define FXFT_Get_Glyph(slot, aglyph) FT_Get_Glyph(slot, aglyph)
-#define FXFT_Glyph_Get_CBox(glyph, bbox_mode, acbox) FT_Glyph_Get_CBox(glyph, bbox_mode, acbox)
-#define FXFT_Done_Glyph(glyph) FT_Done_Glyph(glyph)
-#define FXFT_Library_SetLcdFilter(library, filter) FT_Library_SetLcdFilter((FT_Library)(library), filter)
-int FXFT_unicode_from_adobe_name(const char* name);
-void FXFT_adobe_name_from_unicode(char* name, unsigned int unicode);
-#ifdef __cplusplus
-};
-#endif
+// 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
+
+#include "../thirdparties/freetype/ft2build.h"
+#include "../thirdparties/freetype/freetype/freetype.h"
+#include "../thirdparties/freetype/freetype/ftoutln.h"
+#include "../thirdparties/freetype/freetype/ftmm.h"
+#include "../thirdparties/freetype/freetype/internal/ftobjs.h"
+#include "../thirdparties/freetype/freetype/tttables.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+#define FXFT_ENCODING_UNICODE FT_ENCODING_UNICODE
+#define FXFT_ENCODING_ADOBE_STANDARD FT_ENCODING_ADOBE_STANDARD
+#define FXFT_ENCODING_ADOBE_EXPERT FT_ENCODING_ADOBE_EXPERT
+#define FXFT_ENCODING_ADOBE_LATIN_1 FT_ENCODING_ADOBE_LATIN_1
+#define FXFT_ENCODING_APPLE_ROMAN FT_ENCODING_APPLE_ROMAN
+#define FXFT_ENCODING_ADOBE_CUSTOM FT_ENCODING_ADOBE_CUSTOM
+#define FXFT_ENCODING_MS_SYMBOL FT_ENCODING_MS_SYMBOL
+#define FXFT_ENCODING_GB2312 FT_ENCODING_GB2312
+#define FXFT_ENCODING_BIG5 FT_ENCODING_BIG5
+#define FXFT_ENCODING_SJIS FT_ENCODING_SJIS
+#define FXFT_ENCODING_JOHAB FT_ENCODING_JOHAB
+#define FXFT_ENCODING_WANSUNG FT_ENCODING_WANSUNG
+#define FXFT_LOAD_NO_SCALE FT_LOAD_NO_SCALE
+#define FXFT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH
+#define FXFT_RENDER_MODE_LCD FT_RENDER_MODE_LCD
+#define FXFT_RENDER_MODE_MONO FT_RENDER_MODE_MONO
+#define FXFT_RENDER_MODE_NORMAL FT_RENDER_MODE_NORMAL
+#define FXFT_LOAD_IGNORE_TRANSFORM FT_LOAD_IGNORE_TRANSFORM
+#define FXFT_LOAD_NO_BITMAP FT_LOAD_NO_BITMAP
+#define FXFT_LOAD_NO_HINTING FT_LOAD_NO_HINTING
+#define FXFT_PIXEL_MODE_MONO FT_PIXEL_MODE_MONO
+#define FXFT_STYLE_FLAG_ITALIC FT_STYLE_FLAG_ITALIC
+#define FXFT_STYLE_FLAG_BOLD FT_STYLE_FLAG_BOLD
+#define FXFT_FACE_FLAG_SFNT FT_FACE_FLAG_SFNT
+#define FXFT_FACE_FLAG_TRICKY ( 1L << 13 )
+typedef FT_MM_Var* FXFT_MM_Var;
+typedef FT_Bitmap* FXFT_Bitmap;
+#define FXFT_Matrix FT_Matrix
+#define FXFT_Vector FT_Vector
+#define FXFT_Outline_Funcs FT_Outline_Funcs
+typedef FT_Open_Args FXFT_Open_Args;
+typedef FT_StreamRec FXFT_StreamRec;
+typedef FT_StreamRec* FXFT_Stream;
+typedef FT_BBox FXFT_BBox;
+typedef FT_Glyph FXFT_Glyph;
+typedef FT_CharMap FXFT_CharMap;
+#define FXFT_GLYPH_BBOX_PIXELS FT_GLYPH_BBOX_PIXELS
+#define FXFT_Open_Face(library, args, index, face) \
+ FT_Open_Face((FT_Library)(library), args, index, (FT_Face*)(face))
+#define FXFT_Done_Face(face) FT_Done_Face((FT_Face)(face))
+#define FXFT_Done_FreeType(library) FT_Done_FreeType((FT_Library)(library))
+#define FXFT_Init_FreeType(library) FT_Init_FreeType((FT_Library*)(library))
+#define FXFT_New_Memory_Face(library, base, size, index, face) \
+ FT_New_Memory_Face((FT_Library)(library), base, size, index, (FT_Face*)(face))
+#define FXFT_New_Face(library, filename, index, face) \
+ FT_New_Face((FT_Library)(library), filename, index, (FT_Face*)(face))
+#define FXFT_Get_Face_FreeType(face) ((FT_Face)face)->driver->root.library
+#define FXFT_Select_Charmap(face, encoding) FT_Select_Charmap((FT_Face)face, (FT_Encoding)encoding)
+#define FXFT_Set_Charmap(face, charmap) FT_Set_Charmap((FT_Face)face, (FT_CharMap)charmap)
+#define FXFT_Load_Glyph(face, glyph_index, flags) FT_Load_Glyph((FT_Face)face, glyph_index, flags)
+#define FXFT_Get_Char_Index(face, code) FT_Get_Char_Index((FT_Face)face, code)
+#define FXFT_Get_Glyph_Name(face, index, buffer, size) FT_Get_Glyph_Name((FT_Face)face, index, buffer, size)
+#define FXFT_Get_Name_Index(face, name) FT_Get_Name_Index((FT_Face)face, name)
+#define FXFT_Has_Glyph_Names(face) (((FT_Face)face)->face_flags & FT_FACE_FLAG_GLYPH_NAMES)
+#define FXFT_Get_Postscript_Name(face) FT_Get_Postscript_Name((FT_Face)face)
+#define FXFT_Load_Sfnt_Table(face, tag, offset, buffer, length) \
+ FT_Load_Sfnt_Table((FT_Face)face, tag, offset, buffer, length)
+#define FXFT_Get_First_Char(face, glyph_index) FT_Get_First_Char((FT_Face)face, glyph_index)
+#define FXFT_Get_Next_Char(face, code, glyph_index) FT_Get_Next_Char((FT_Face)face, code, glyph_index)
+#define FXFT_Clear_Face_External_Stream(face) (((FT_Face)face)->face_flags&=~FT_FACE_FLAG_EXTERNAL_STREAM)
+#define FXFT_Get_Face_External_Stream(face) (((FT_Face)face)->face_flags&FT_FACE_FLAG_EXTERNAL_STREAM)
+#define FXFT_Is_Face_TT_OT(face) (((FT_Face)face)->face_flags&FT_FACE_FLAG_SFNT)
+#define FXFT_Is_Face_Tricky(face) (((FT_Face)face)->face_flags&FXFT_FACE_FLAG_TRICKY)
+#define FXFT_Is_Face_fixedwidth(face) (((FT_Face)face)->face_flags & FT_FACE_FLAG_FIXED_WIDTH)
+#define FXFT_Get_Face_Stream_Base(face) ((FT_Face)face)->stream->base
+#define FXFT_Get_Face_Stream_Size(face) ((FT_Face)face)->stream->size
+#define FXFT_Get_Face_Family_Name(face) ((FT_Face)face)->family_name
+#define FXFT_Get_Face_Style_Name(face) ((FT_Face)face)->style_name
+#define FXFT_Get_Face_Numfaces(face) ((FT_Face)face)->num_faces
+#define FXFT_Get_Face_Faceindex(face) ((FT_Face)face)->face_index
+#define FXFT_Is_Face_Italic(face) (((FT_Face)face)->style_flags&FT_STYLE_FLAG_ITALIC)
+#define FXFT_Is_Face_Bold(face) (((FT_Face)face)->style_flags&FT_STYLE_FLAG_BOLD)
+#define FXFT_Get_Face_Charmaps(face) ((FT_Face)face)->charmaps
+#define FXFT_Get_Glyph_HoriBearingX(face) ((FT_Face)face)->glyph->metrics.horiBearingX
+#define FXFT_Get_Glyph_HoriBearingY(face) ((FT_Face)face)->glyph->metrics.horiBearingY
+#define FXFT_Get_Glyph_Width(face) ((FT_Face)face)->glyph->metrics.width
+#define FXFT_Get_Glyph_Height(face) ((FT_Face)face)->glyph->metrics.height
+#define FXFT_Get_Face_CharmapCount(face) ((FT_Face)face)->num_charmaps
+#define FXFT_Get_Charmap_Encoding(charmap) ((FT_CharMap)charmap)->encoding
+#define FXFT_Get_Face_Charmap(face) ((FT_Face)face)->charmap
+#define FXFT_Get_Charmap_PlatformID(charmap) ((FT_CharMap)charmap)->platform_id
+#define FXFT_Get_Charmap_EncodingID(charmap) ((FT_CharMap)charmap)->encoding_id
+#define FXFT_Get_Face_UnitsPerEM(face) ((FT_Face)face)->units_per_EM
+#define FXFT_Get_Face_xMin(face) ((FT_Face)face)->bbox.xMin
+#define FXFT_Get_Face_xMax(face) ((FT_Face)face)->bbox.xMax
+#define FXFT_Get_Face_yMin(face) ((FT_Face)face)->bbox.yMin
+#define FXFT_Get_Face_yMax(face) ((FT_Face)face)->bbox.yMax
+#define FXFT_Get_Face_Height(face) ((FT_Face)face)->height
+#define FXFT_Get_Face_UnderLineThickness(face) ((FT_Face)face)->underline_thickness
+#define FXFT_Get_Face_UnderLinePosition(face) ((FT_Face)face)->underline_position
+#define FXFT_Get_Face_MaxAdvanceWidth(face) ((FT_Face)face)->max_advance_width
+#define FXFT_Get_Face_Ascender(face) ((FT_Face)face)->ascender
+#define FXFT_Get_Face_Descender(face) ((FT_Face)face)->descender
+#define FXFT_Get_Glyph_HoriAdvance(face) ((FT_Face)face)->glyph->metrics.horiAdvance
+#define FXFT_Get_MM_Axis(var, index) &((FT_MM_Var*)var)->axis[index]
+#define FXFT_Get_MM_Axis_Min(axis) ((FT_Var_Axis*)axis)->minimum
+#define FXFT_Get_MM_Axis_Max(axis) ((FT_Var_Axis*)axis)->maximum
+#define FXFT_Get_MM_Axis_Def(axis) ((FT_Var_Axis*)axis)->def
+#define FXFT_Get_Face_Internal_Flag(face) ((FT_Face)face)->internal->transform_flags
+#define FXFT_Set_Face_Internal_Flag(face, flag) (((FT_Face)face)->internal->transform_flags = flag)
+#define FXFT_Alloc(library, size) ((FT_Library)library)->memory->alloc(((FT_Library)library)->memory, size)
+#define FXFT_Free(face, p) ((FT_Face)face)->memory->free(((FT_Face)face)->memory, p)
+#define FXFT_Get_Glyph_Outline(face) &((FT_Face)face)->glyph->outline
+#define FXFT_Get_Outline_Bbox(outline, cbox) FT_Outline_Get_CBox(outline, cbox)
+#define FXFT_Render_Glyph(face, mode) FT_Render_Glyph(((FT_Face)face)->glyph, (enum FT_Render_Mode_)mode)
+#define FXFT_Get_MM_Var(face, p) FT_Get_MM_Var((FT_Face)face, p)
+#define FXFT_Set_MM_Design_Coordinates(face, n, p) FT_Set_MM_Design_Coordinates((FT_Face)face, n, p)
+#define FXFT_Set_Pixel_Sizes(face, w, h) FT_Set_Pixel_Sizes((FT_Face)face, w, h)
+#define FXFT_Set_Transform(face, m, d) FT_Set_Transform((FT_Face)face, m, d)
+#define FXFT_Outline_Embolden(outline, s) FT_Outline_Embolden(outline, s)
+#define FXFT_Get_Glyph_Bitmap(face) &((FT_Face)face)->glyph->bitmap
+#define FXFT_Get_Bitmap_Width(bitmap) ((FT_Bitmap*)bitmap)->width
+#define FXFT_Get_Bitmap_Rows(bitmap) ((FT_Bitmap*)bitmap)->rows
+#define FXFT_Get_Bitmap_PixelMode(bitmap) ((FT_Bitmap*)bitmap)->pixel_mode
+#define FXFT_Get_Bitmap_Pitch(bitmap) ((FT_Bitmap*)bitmap)->pitch
+#define FXFT_Get_Bitmap_Buffer(bitmap) ((FT_Bitmap*)bitmap)->buffer
+#define FXFT_Get_Glyph_BitmapLeft(face) ((FT_Face)face)->glyph->bitmap_left
+#define FXFT_Get_Glyph_BitmapTop(face) ((FT_Face)face)->glyph->bitmap_top
+#define FXFT_Outline_Decompose(outline, funcs, params) FT_Outline_Decompose(outline, funcs, params)
+#define FXFT_Set_Char_Size(face, char_width, char_height, horz_resolution, vert_resolution) FT_Set_Char_Size(face, char_width, char_height, horz_resolution, vert_resolution)
+#define FXFT_Get_Glyph(slot, aglyph) FT_Get_Glyph(slot, aglyph)
+#define FXFT_Glyph_Get_CBox(glyph, bbox_mode, acbox) FT_Glyph_Get_CBox(glyph, bbox_mode, acbox)
+#define FXFT_Done_Glyph(glyph) FT_Done_Glyph(glyph)
+#define FXFT_Library_SetLcdFilter(library, filter) FT_Library_SetLcdFilter((FT_Library)(library), filter)
+int FXFT_unicode_from_adobe_name(const char* name);
+void FXFT_adobe_name_from_unicode(char* name, unsigned int unicode);
+#ifdef __cplusplus
+};
+#endif
diff --git a/core/include/fxge/fx_ge.h b/core/include/fxge/fx_ge.h
index ab0bf3572a..82719ffda6 100644
--- a/core/include/fxge/fx_ge.h
+++ b/core/include/fxge/fx_ge.h
@@ -1,733 +1,733 @@
-// 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 _FX_GE_H_
-#define _FX_GE_H_
-#ifndef _FX_DIB_H_
-#include "fx_dib.h"
-#endif
-#ifndef _FX_FONT_H_
-#include "fx_font.h"
-#endif
-class CFX_ClipRgn;
-class CFX_PathData;
-class CFX_GraphStateData;
-class CFX_Font;
-class CFX_FontMgr;
-class CFX_FontCache;
-class CFX_FaceCache;
-class CFX_RenderDevice;
-class IFX_RenderDeviceDriver;
-class CCodec_ModuleMgr;
-class IFXG_PaintModuleMgr;
-class CFX_GEModule : public CFX_Object
-{
-public:
-
- static void Create();
-
- static void Use(CFX_GEModule* pMgr);
-
- static CFX_GEModule* Get();
-
- static void Destroy();
-public:
-
- CFX_FontCache* GetFontCache();
- CFX_FontMgr* GetFontMgr()
- {
- return m_pFontMgr;
- }
- void SetTextGamma(FX_FLOAT gammaValue);
- FX_LPCBYTE GetTextGammaTable();
- void SetExtFontMapper(IFX_FontMapper* pFontMapper);
-
- void SetCodecModule(CCodec_ModuleMgr* pCodecModule)
- {
- m_pCodecModule = pCodecModule;
- }
- CCodec_ModuleMgr* GetCodecModule()
- {
- return m_pCodecModule;
- }
- FXFT_Library m_FTLibrary;
- void* GetPlatformData()
- {
- return m_pPlatformData;
- }
-protected:
-
- CFX_GEModule();
-
- ~CFX_GEModule();
- void InitPlatform();
- void DestroyPlatform();
-private:
- FX_BYTE m_GammaValue[256];
- CFX_FontCache* m_pFontCache;
- CFX_FontMgr* m_pFontMgr;
- CCodec_ModuleMgr* m_pCodecModule;
- void* m_pPlatformData;
-};
-typedef struct {
-
- FX_FLOAT m_PointX;
-
- FX_FLOAT m_PointY;
-
- int m_Flag;
-} FX_PATHPOINT;
-#define FXPT_CLOSEFIGURE 0x01
-#define FXPT_LINETO 0x02
-#define FXPT_BEZIERTO 0x04
-#define FXPT_MOVETO 0x06
-#define FXPT_TYPE 0x06
-#define FXFILL_ALTERNATE 1
-#define FXFILL_WINDING 2
-class CFX_ClipRgn : public CFX_Object
-{
-public:
-
- CFX_ClipRgn(int device_width, int device_height);
-
- CFX_ClipRgn(const FX_RECT& rect);
-
- CFX_ClipRgn(const CFX_ClipRgn& src);
-
- ~CFX_ClipRgn();
-
- typedef enum {
- RectI,
- MaskF
- } ClipType;
-
- void Reset(const FX_RECT& rect);
-
- ClipType GetType() const
- {
- return m_Type;
- }
-
- const FX_RECT& GetBox() const
- {
- return m_Box;
- }
-
- CFX_DIBitmapRef GetMask() const
- {
- return m_Mask;
- }
-
- void IntersectRect(const FX_RECT& rect);
-
- void IntersectMaskF(int left, int top, CFX_DIBitmapRef Mask);
-protected:
-
- ClipType m_Type;
-
- FX_RECT m_Box;
-
- CFX_DIBitmapRef m_Mask;
-
- void IntersectMaskRect(FX_RECT rect, FX_RECT mask_box, CFX_DIBitmapRef Mask);
-};
-extern const FX_BYTE g_GammaRamp[256];
-extern const FX_BYTE g_GammaInverse[256];
-#define FX_GAMMA(value) (value)
-#define FX_GAMMA_INVERSE(value) (value)
-inline FX_ARGB ArgbGamma(FX_ARGB argb)
-{
- return argb;
-}
-inline FX_ARGB ArgbGammaInverse(FX_ARGB argb)
-{
- return argb;
-}
-class CFX_PathData : public CFX_Object
-{
-public:
-
- CFX_PathData();
-
- CFX_PathData(const CFX_PathData& src);
-
- ~CFX_PathData();
-
-
-
-
- int GetPointCount() const
- {
- return m_PointCount;
- }
-
- int GetFlag(int index) const
- {
- return m_pPoints[index].m_Flag;
- }
-
- FX_FLOAT GetPointX(int index) const
- {
- return m_pPoints[index].m_PointX;
- }
-
- FX_FLOAT GetPointY(int index) const
- {
- return m_pPoints[index].m_PointY;
- }
-
-
-
- FX_PATHPOINT* GetPoints() const
- {
- return m_pPoints;
- }
-
- FX_BOOL SetPointCount(int nPoints);
-
- FX_BOOL AllocPointCount(int nPoints);
-
- FX_BOOL AddPointCount(int addPoints);
-
- CFX_FloatRect GetBoundingBox() const;
-
- CFX_FloatRect GetBoundingBox(FX_FLOAT line_width, FX_FLOAT miter_limit) const;
-
- void Transform(const CFX_AffineMatrix* pMatrix);
-
- FX_BOOL IsRect() const;
-
- FX_BOOL GetZeroAreaPath(CFX_PathData& NewPath, CFX_AffineMatrix* pMatrix, FX_BOOL&bThin, FX_BOOL bAdjust) const;
-
- FX_BOOL IsRect(const CFX_AffineMatrix* pMatrix, CFX_FloatRect* rect) const;
-
- FX_BOOL Append(const CFX_PathData* pSrc, const CFX_AffineMatrix* pMatrix);
-
- FX_BOOL AppendRect(FX_FLOAT left, FX_FLOAT bottom, FX_FLOAT right, FX_FLOAT top);
-
- void SetPoint(int index, FX_FLOAT x, FX_FLOAT y, int flag);
-
- void TrimPoints(int nPoints);
-
- FX_BOOL Copy(const CFX_PathData &src);
-protected:
- friend class CPDF_Path;
-
- int m_PointCount;
-
- FX_PATHPOINT* m_pPoints;
-
- int m_AllocCount;
-};
-class CFX_GraphStateData : public CFX_Object
-{
-public:
-
- CFX_GraphStateData();
-
- CFX_GraphStateData(const CFX_GraphStateData& src);
-
- ~CFX_GraphStateData();
-
- void Copy(const CFX_GraphStateData& src);
-
- void SetDashCount(int count);
-
-
-
- typedef enum {
- LineCapButt = 0,
- LineCapRound = 1,
- LineCapSquare = 2
- } LineCap;
- LineCap m_LineCap;
- int m_DashCount;
- FX_FLOAT* m_DashArray;
- FX_FLOAT m_DashPhase;
-
- typedef enum {
- LineJoinMiter = 0,
- LineJoinRound = 1,
- LineJoinBevel = 2,
- } LineJoin;
- LineJoin m_LineJoin;
- FX_FLOAT m_MiterLimit;
- FX_FLOAT m_LineWidth;
-
-};
-#define FXDC_DEVICE_CLASS 1
-#define FXDC_PIXEL_WIDTH 2
-#define FXDC_PIXEL_HEIGHT 3
-#define FXDC_BITS_PIXEL 4
-#define FXDC_HORZ_SIZE 5
-#define FXDC_VERT_SIZE 6
-#define FXDC_RENDER_CAPS 7
-#define FXDC_DITHER_BITS 8
-#define FXDC_DISPLAY 1
-#define FXDC_PRINTER 2
-#define FXRC_GET_BITS 0x01
-#define FXRC_BIT_MASK 0x02
-#define FXRC_ALPHA_MASK 0x04
-#define FXRC_ALPHA_PATH 0x10
-#define FXRC_ALPHA_IMAGE 0x20
-#define FXRC_ALPHA_OUTPUT 0x40
-#define FXRC_BLEND_MODE 0x80
-#define FXRC_SOFT_CLIP 0x100
-#define FXRC_CMYK_OUTPUT 0x200
-#define FXRC_BITMASK_OUTPUT 0x400
-#define FXRC_BYTEMASK_OUTPUT 0x800
-#define FXRENDER_IMAGE_LOSSY 0x1000
-#define FXFILL_ALTERNATE 1
-#define FXFILL_WINDING 2
-#define FXFILL_FULLCOVER 4
-#define FXFILL_RECT_AA 8
-#define FX_FILL_STROKE 16
-#define FX_STROKE_ADJUST 32
-#define FX_STROKE_TEXT_MODE 64
-#define FX_FILL_TEXT_MODE 128
-#define FX_ZEROAREA_FILL 256
-#define FXFILL_NOPATHSMOOTH 512
-#define FXTEXT_CLEARTYPE 0x01
-#define FXTEXT_BGR_STRIPE 0x02
-#define FXTEXT_PRINTGRAPHICTEXT 0x04
-#define FXTEXT_NO_NATIVETEXT 0x08
-#define FXTEXT_PRINTIMAGETEXT 0x10
-#define FXTEXT_NOSMOOTH 0x20
-typedef struct {
- FX_DWORD m_GlyphIndex;
- FX_FLOAT m_OriginX, m_OriginY;
- int m_FontCharWidth;
- FX_BOOL m_bGlyphAdjust;
- FX_FLOAT m_AdjustMatrix[4];
- FX_DWORD m_ExtGID;
- FX_BOOL m_bFontStyle;
-} FXTEXT_CHARPOS;
-class CFX_RenderDevice : public CFX_Object
-{
-public:
- CFX_RenderDevice();
-
- virtual ~CFX_RenderDevice();
-
- void SetDeviceDriver(IFX_RenderDeviceDriver* pDriver);
-
- IFX_RenderDeviceDriver* GetDeviceDriver() const
- {
- return m_pDeviceDriver;
- }
-
- FX_BOOL StartRendering();
-
- void EndRendering();
-
-
-
- void SaveState();
-
- void RestoreState(FX_BOOL bKeepSaved = FALSE);
-
-
-
-
- int GetWidth() const
- {
- return m_Width;
- }
-
- int GetHeight() const
- {
- return m_Height;
- }
-
- int GetDeviceClass() const
- {
- return m_DeviceClass;
- }
-
- int GetBPP() const
- {
- return m_bpp;
- }
-
- int GetRenderCaps() const
- {
- return m_RenderCaps;
- }
-
- int GetDeviceCaps(int id) const;
-
- CFX_Matrix GetCTM() const;
-
-
- CFX_DIBitmap* GetBitmap() const
- {
- return m_pBitmap;
- }
- void SetBitmap(CFX_DIBitmap* pBitmap)
- {
- m_pBitmap = pBitmap;
- }
-
- FX_BOOL CreateCompatibleBitmap(CFX_DIBitmap* pDIB, int width, int height) const;
-
- const FX_RECT& GetClipBox() const
- {
- return m_ClipBox;
- }
-
- FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData,
- const CFX_AffineMatrix* pObject2Device,
- int fill_mode
- );
-
- FX_BOOL SetClip_Rect(const FX_RECT* pRect);
-
- FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData,
- const CFX_AffineMatrix* pObject2Device,
- const CFX_GraphStateData* pGraphState
- );
-
- FX_BOOL DrawPath(const CFX_PathData* pPathData,
- const CFX_AffineMatrix* pObject2Device,
- const CFX_GraphStateData* pGraphState,
- FX_DWORD fill_color,
- FX_DWORD stroke_color,
- int fill_mode,
- int alpha_flag = 0,
- void* pIccTransform = NULL,
- int blend_type = FXDIB_BLEND_NORMAL
- );
-
- FX_BOOL SetPixel(int x, int y, FX_DWORD color,
- int alpha_flag = 0, void* pIccTransform = NULL);
-
- FX_BOOL FillRect(const FX_RECT* pRect, FX_DWORD color,
- int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL);
-
- FX_BOOL DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, FX_DWORD color,
- int fill_mode = 0, int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL);
-
- FX_BOOL GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform = NULL);
-
- CFX_DIBitmap* GetBackDrop();
-
- FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, int left, int top, int blend_type = FXDIB_BLEND_NORMAL,
- void* pIccTransform = NULL);
-
- FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, int left, int top, int dest_width, int dest_height,
- FX_DWORD flags = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL);
-
- FX_BOOL SetBitMask(const CFX_DIBSource* pBitmap, int left, int top, FX_DWORD color,
- int alpha_flag = 0, void* pIccTransform = NULL);
-
- FX_BOOL StretchBitMask(const CFX_DIBSource* pBitmap, int left, int top, int dest_width, int dest_height,
- FX_DWORD color, FX_DWORD flags = 0, int alpha_flag = 0, void* pIccTransform = NULL);
-
- FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD color,
- const CFX_AffineMatrix* pMatrix, FX_DWORD flags, FX_LPVOID& handle,
- int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL);
-
- FX_BOOL ContinueDIBits(FX_LPVOID handle, IFX_Pause* pPause);
-
- void CancelDIBits(FX_LPVOID handle);
-
- FX_BOOL DrawNormalText(int nChars, const FXTEXT_CHARPOS* pCharPos,
- CFX_Font* pFont, CFX_FontCache* pCache,
- FX_FLOAT font_size, const CFX_AffineMatrix* pText2Device,
- FX_DWORD fill_color, FX_DWORD text_flags,
- int alpha_flag = 0, void* pIccTransform = NULL);
-
- FX_BOOL DrawTextPath(int nChars, const FXTEXT_CHARPOS* pCharPos,
- CFX_Font* pFont, CFX_FontCache* pCache,
- FX_FLOAT font_size, const CFX_AffineMatrix* pText2User,
- const CFX_AffineMatrix* pUser2Device, const CFX_GraphStateData* pGraphState,
- FX_DWORD fill_color, FX_DWORD stroke_color, CFX_PathData* pClippingPath, int nFlag = 0,
- int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL);
- virtual void Begin() {}
- virtual void End() {}
-private:
-
- CFX_DIBitmap* m_pBitmap;
-
-
-
- int m_Width;
-
- int m_Height;
-
- int m_bpp;
-
- int m_RenderCaps;
-
- int m_DeviceClass;
-
- FX_RECT m_ClipBox;
-
-protected:
-
- IFX_RenderDeviceDriver* m_pDeviceDriver;
-private:
-
- void InitDeviceInfo();
-
- void UpdateClipBox();
-};
-class CFX_FxgeDevice : public CFX_RenderDevice
-{
-public:
-
- CFX_FxgeDevice();
-
- ~CFX_FxgeDevice();
-
- FX_BOOL Attach(CFX_DIBitmap* pBitmap, int dither_bits = 0, FX_BOOL bRgbByteOrder = FALSE, CFX_DIBitmap* pOriDevice = NULL, FX_BOOL bGroupKnockout = FALSE);
-
- FX_BOOL Create(int width, int height, FXDIB_Format format, int dither_bits = 0, CFX_DIBitmap* pOriDevice = NULL);
-protected:
-
- FX_BOOL m_bOwnedBitmap;
-};
-class CFX_SkiaDevice : public CFX_RenderDevice
-{
-public:
-
- CFX_SkiaDevice();
-
- ~CFX_SkiaDevice();
-
- FX_BOOL Attach(CFX_DIBitmap* pBitmap, int dither_bits = 0, FX_BOOL bRgbByteOrder = FALSE, CFX_DIBitmap* pOriDevice = NULL, FX_BOOL bGroupKnockout = FALSE);
-
- FX_BOOL Create(int width, int height, FXDIB_Format format, int dither_bits = 0, CFX_DIBitmap* pOriDevice = NULL);
-protected:
-
- FX_BOOL m_bOwnedBitmap;
-};
-class IFX_RenderDeviceDriver : public CFX_Object
-{
-public:
-
- static IFX_RenderDeviceDriver* CreateFxgeDriver(CFX_DIBitmap* pBitmap, FX_BOOL bRgbByteOrder = FALSE,
- CFX_DIBitmap* pOriDevice = NULL, FX_BOOL bGroupKnockout = FALSE);
-
- virtual ~IFX_RenderDeviceDriver() {}
- virtual void Begin() { }
- virtual void End() { }
-
- virtual int GetDeviceCaps(int caps_id) = 0;
-
- virtual CFX_Matrix GetCTM() const
- {
- return CFX_Matrix();
- }
-
- virtual FX_BOOL IsPSPrintDriver()
- {
- return FALSE;
- }
-
- virtual FX_BOOL StartRendering()
- {
- return TRUE;
- }
-
- virtual void EndRendering() {}
-
-
-
-
- virtual void SaveState() = 0;
-
- virtual void RestoreState(FX_BOOL bKeepSaved = FALSE) = 0;
-
-
- virtual FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData,
- const CFX_AffineMatrix* pObject2Device,
- int fill_mode
- ) = 0;
-
- virtual FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData,
- const CFX_AffineMatrix* pObject2Device,
- const CFX_GraphStateData* pGraphState
- )
- {
- return FALSE;
- }
-
- virtual FX_BOOL DrawPath(const CFX_PathData* pPathData,
- const CFX_AffineMatrix* pObject2Device,
- const CFX_GraphStateData* pGraphState,
- FX_DWORD fill_color,
- FX_DWORD stroke_color,
- int fill_mode,
- int alpha_flag = 0,
- void* pIccTransform = NULL,
- int blend_type = FXDIB_BLEND_NORMAL
- ) = 0;
-
- virtual FX_BOOL SetPixel(int x, int y, FX_DWORD color,
- int alpha_flag = 0, void* pIccTransform = NULL)
- {
- return FALSE;
- }
-
- virtual FX_BOOL FillRect(const FX_RECT* pRect, FX_DWORD fill_color,
- int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL)
- {
- return FALSE;
- }
-
- virtual FX_BOOL DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, FX_DWORD color,
- int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL)
- {
- return FALSE;
- }
-
- virtual FX_BOOL GetClipBox(FX_RECT* pRect) = 0;
-
- virtual FX_BOOL GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform = NULL, FX_BOOL bDEdge = FALSE)
- {
- return FALSE;
- }
- virtual CFX_DIBitmap* GetBackDrop()
- {
- return NULL;
- }
-
- virtual FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, const FX_RECT* pSrcRect,
- int dest_left, int dest_top, int blend_type,
- int alpha_flag = 0, void* pIccTransform = NULL) = 0;
-
- virtual FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, int dest_left, int dest_top,
- int dest_width, int dest_height, const FX_RECT* pClipRect, FX_DWORD flags,
- int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL) = 0;
-
- virtual FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD color,
- const CFX_AffineMatrix* pMatrix, FX_DWORD flags, FX_LPVOID& handle,
- int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL) = 0;
-
- virtual FX_BOOL ContinueDIBits(FX_LPVOID handle, IFX_Pause* pPause)
- {
- return FALSE;
- }
-
- virtual void CancelDIBits(FX_LPVOID handle) {}
-
- virtual FX_BOOL DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont,
- CFX_FontCache* pCache, const CFX_AffineMatrix* pObject2Device, FX_FLOAT font_size, FX_DWORD color,
- int alpha_flag = 0, void* pIccTransform = NULL)
- {
- return FALSE;
- }
-
- virtual void* GetPlatformSurface()
- {
- return NULL;
- }
-
- virtual int GetDriverType()
- {
- return 0;
- }
-
- virtual void ClearDriver() {}
-};
-class IFX_PSOutput
-{
-public:
-
- virtual void OutputPS(FX_LPCSTR string, int len) = 0;
- virtual void Release() = 0;
-};
-class CPSFont;
-class CFX_PSRenderer : public CFX_Object
-{
-public:
-
- CFX_PSRenderer();
-
- ~CFX_PSRenderer();
-
- void Init(IFX_PSOutput* pOutput, int ps_level, int width, int height, FX_BOOL bCmykOutput);
- FX_BOOL StartRendering();
- void EndRendering();
-
- void SaveState();
-
- void RestoreState(FX_BOOL bKeepSaved = FALSE);
-
- void SetClip_PathFill(const CFX_PathData* pPathData,
- const CFX_AffineMatrix* pObject2Device,
- int fill_mode
- );
-
- void SetClip_PathStroke(const CFX_PathData* pPathData,
- const CFX_AffineMatrix* pObject2Device,
- const CFX_GraphStateData* pGraphState
- );
-
- FX_RECT GetClipBox()
- {
- return m_ClipBox;
- }
-
- FX_BOOL DrawPath(const CFX_PathData* pPathData,
- const CFX_AffineMatrix* pObject2Device,
- const CFX_GraphStateData* pGraphState,
- FX_DWORD fill_color,
- FX_DWORD stroke_color,
- int fill_mode,
- int alpha_flag = 0,
- void* pIccTransform = NULL
- );
-
- FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, int dest_left, int dest_top,
- int alpha_flag = 0, void* pIccTransform = NULL);
-
- FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, int dest_left, int dest_top,
- int dest_width, int dest_height, FX_DWORD flags,
- int alpha_flag = 0, void* pIccTransform = NULL);
-
- FX_BOOL DrawDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color,
- const CFX_AffineMatrix* pMatrix, FX_DWORD flags,
- int alpha_flag = 0, void* pIccTransform = NULL);
-
- FX_BOOL DrawText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont, CFX_FontCache* pCache,
- const CFX_AffineMatrix* pObject2Device, FX_FLOAT font_size, FX_DWORD color,
- int alpha_flag = 0, void* pIccTransform = NULL);
-private:
-
- IFX_PSOutput* m_pOutput;
-
- int m_PSLevel;
-
- CFX_GraphStateData m_CurGraphState;
-
- FX_BOOL m_bGraphStateSet;
-
- FX_BOOL m_bCmykOutput;
-
- FX_BOOL m_bColorSet;
-
- FX_DWORD m_LastColor;
-
- FX_RECT m_ClipBox;
-
- CFX_ArrayTemplate<CPSFont*> m_PSFontList;
-
- CFX_ArrayTemplate<FX_RECT> m_ClipBoxStack;
- FX_BOOL m_bInited;
-
- void OutputPath(const CFX_PathData* pPathData, const CFX_AffineMatrix* pObject2Device);
-
- void SetGraphState(const CFX_GraphStateData* pGraphState);
-
- void SetColor(FX_DWORD color, int alpha_flag, void* pIccTransform);
-
- void FindPSFontGlyph(CFX_FaceCache* pFaceCache, CFX_Font* pFont, const FXTEXT_CHARPOS& charpos, int& ps_fontnum, int &ps_glyphindex);
-
- void WritePSBinary(FX_LPCBYTE data, int len);
-};
-#endif
+// 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 _FX_GE_H_
+#define _FX_GE_H_
+#ifndef _FX_DIB_H_
+#include "fx_dib.h"
+#endif
+#ifndef _FX_FONT_H_
+#include "fx_font.h"
+#endif
+class CFX_ClipRgn;
+class CFX_PathData;
+class CFX_GraphStateData;
+class CFX_Font;
+class CFX_FontMgr;
+class CFX_FontCache;
+class CFX_FaceCache;
+class CFX_RenderDevice;
+class IFX_RenderDeviceDriver;
+class CCodec_ModuleMgr;
+class IFXG_PaintModuleMgr;
+class CFX_GEModule : public CFX_Object
+{
+public:
+
+ static void Create();
+
+ static void Use(CFX_GEModule* pMgr);
+
+ static CFX_GEModule* Get();
+
+ static void Destroy();
+public:
+
+ CFX_FontCache* GetFontCache();
+ CFX_FontMgr* GetFontMgr()
+ {
+ return m_pFontMgr;
+ }
+ void SetTextGamma(FX_FLOAT gammaValue);
+ FX_LPCBYTE GetTextGammaTable();
+ void SetExtFontMapper(IFX_FontMapper* pFontMapper);
+
+ void SetCodecModule(CCodec_ModuleMgr* pCodecModule)
+ {
+ m_pCodecModule = pCodecModule;
+ }
+ CCodec_ModuleMgr* GetCodecModule()
+ {
+ return m_pCodecModule;
+ }
+ FXFT_Library m_FTLibrary;
+ void* GetPlatformData()
+ {
+ return m_pPlatformData;
+ }
+protected:
+
+ CFX_GEModule();
+
+ ~CFX_GEModule();
+ void InitPlatform();
+ void DestroyPlatform();
+private:
+ FX_BYTE m_GammaValue[256];
+ CFX_FontCache* m_pFontCache;
+ CFX_FontMgr* m_pFontMgr;
+ CCodec_ModuleMgr* m_pCodecModule;
+ void* m_pPlatformData;
+};
+typedef struct {
+
+ FX_FLOAT m_PointX;
+
+ FX_FLOAT m_PointY;
+
+ int m_Flag;
+} FX_PATHPOINT;
+#define FXPT_CLOSEFIGURE 0x01
+#define FXPT_LINETO 0x02
+#define FXPT_BEZIERTO 0x04
+#define FXPT_MOVETO 0x06
+#define FXPT_TYPE 0x06
+#define FXFILL_ALTERNATE 1
+#define FXFILL_WINDING 2
+class CFX_ClipRgn : public CFX_Object
+{
+public:
+
+ CFX_ClipRgn(int device_width, int device_height);
+
+ CFX_ClipRgn(const FX_RECT& rect);
+
+ CFX_ClipRgn(const CFX_ClipRgn& src);
+
+ ~CFX_ClipRgn();
+
+ typedef enum {
+ RectI,
+ MaskF
+ } ClipType;
+
+ void Reset(const FX_RECT& rect);
+
+ ClipType GetType() const
+ {
+ return m_Type;
+ }
+
+ const FX_RECT& GetBox() const
+ {
+ return m_Box;
+ }
+
+ CFX_DIBitmapRef GetMask() const
+ {
+ return m_Mask;
+ }
+
+ void IntersectRect(const FX_RECT& rect);
+
+ void IntersectMaskF(int left, int top, CFX_DIBitmapRef Mask);
+protected:
+
+ ClipType m_Type;
+
+ FX_RECT m_Box;
+
+ CFX_DIBitmapRef m_Mask;
+
+ void IntersectMaskRect(FX_RECT rect, FX_RECT mask_box, CFX_DIBitmapRef Mask);
+};
+extern const FX_BYTE g_GammaRamp[256];
+extern const FX_BYTE g_GammaInverse[256];
+#define FX_GAMMA(value) (value)
+#define FX_GAMMA_INVERSE(value) (value)
+inline FX_ARGB ArgbGamma(FX_ARGB argb)
+{
+ return argb;
+}
+inline FX_ARGB ArgbGammaInverse(FX_ARGB argb)
+{
+ return argb;
+}
+class CFX_PathData : public CFX_Object
+{
+public:
+
+ CFX_PathData();
+
+ CFX_PathData(const CFX_PathData& src);
+
+ ~CFX_PathData();
+
+
+
+
+ int GetPointCount() const
+ {
+ return m_PointCount;
+ }
+
+ int GetFlag(int index) const
+ {
+ return m_pPoints[index].m_Flag;
+ }
+
+ FX_FLOAT GetPointX(int index) const
+ {
+ return m_pPoints[index].m_PointX;
+ }
+
+ FX_FLOAT GetPointY(int index) const
+ {
+ return m_pPoints[index].m_PointY;
+ }
+
+
+
+ FX_PATHPOINT* GetPoints() const
+ {
+ return m_pPoints;
+ }
+
+ FX_BOOL SetPointCount(int nPoints);
+
+ FX_BOOL AllocPointCount(int nPoints);
+
+ FX_BOOL AddPointCount(int addPoints);
+
+ CFX_FloatRect GetBoundingBox() const;
+
+ CFX_FloatRect GetBoundingBox(FX_FLOAT line_width, FX_FLOAT miter_limit) const;
+
+ void Transform(const CFX_AffineMatrix* pMatrix);
+
+ FX_BOOL IsRect() const;
+
+ FX_BOOL GetZeroAreaPath(CFX_PathData& NewPath, CFX_AffineMatrix* pMatrix, FX_BOOL&bThin, FX_BOOL bAdjust) const;
+
+ FX_BOOL IsRect(const CFX_AffineMatrix* pMatrix, CFX_FloatRect* rect) const;
+
+ FX_BOOL Append(const CFX_PathData* pSrc, const CFX_AffineMatrix* pMatrix);
+
+ FX_BOOL AppendRect(FX_FLOAT left, FX_FLOAT bottom, FX_FLOAT right, FX_FLOAT top);
+
+ void SetPoint(int index, FX_FLOAT x, FX_FLOAT y, int flag);
+
+ void TrimPoints(int nPoints);
+
+ FX_BOOL Copy(const CFX_PathData &src);
+protected:
+ friend class CPDF_Path;
+
+ int m_PointCount;
+
+ FX_PATHPOINT* m_pPoints;
+
+ int m_AllocCount;
+};
+class CFX_GraphStateData : public CFX_Object
+{
+public:
+
+ CFX_GraphStateData();
+
+ CFX_GraphStateData(const CFX_GraphStateData& src);
+
+ ~CFX_GraphStateData();
+
+ void Copy(const CFX_GraphStateData& src);
+
+ void SetDashCount(int count);
+
+
+
+ typedef enum {
+ LineCapButt = 0,
+ LineCapRound = 1,
+ LineCapSquare = 2
+ } LineCap;
+ LineCap m_LineCap;
+ int m_DashCount;
+ FX_FLOAT* m_DashArray;
+ FX_FLOAT m_DashPhase;
+
+ typedef enum {
+ LineJoinMiter = 0,
+ LineJoinRound = 1,
+ LineJoinBevel = 2,
+ } LineJoin;
+ LineJoin m_LineJoin;
+ FX_FLOAT m_MiterLimit;
+ FX_FLOAT m_LineWidth;
+
+};
+#define FXDC_DEVICE_CLASS 1
+#define FXDC_PIXEL_WIDTH 2
+#define FXDC_PIXEL_HEIGHT 3
+#define FXDC_BITS_PIXEL 4
+#define FXDC_HORZ_SIZE 5
+#define FXDC_VERT_SIZE 6
+#define FXDC_RENDER_CAPS 7
+#define FXDC_DITHER_BITS 8
+#define FXDC_DISPLAY 1
+#define FXDC_PRINTER 2
+#define FXRC_GET_BITS 0x01
+#define FXRC_BIT_MASK 0x02
+#define FXRC_ALPHA_MASK 0x04
+#define FXRC_ALPHA_PATH 0x10
+#define FXRC_ALPHA_IMAGE 0x20
+#define FXRC_ALPHA_OUTPUT 0x40
+#define FXRC_BLEND_MODE 0x80
+#define FXRC_SOFT_CLIP 0x100
+#define FXRC_CMYK_OUTPUT 0x200
+#define FXRC_BITMASK_OUTPUT 0x400
+#define FXRC_BYTEMASK_OUTPUT 0x800
+#define FXRENDER_IMAGE_LOSSY 0x1000
+#define FXFILL_ALTERNATE 1
+#define FXFILL_WINDING 2
+#define FXFILL_FULLCOVER 4
+#define FXFILL_RECT_AA 8
+#define FX_FILL_STROKE 16
+#define FX_STROKE_ADJUST 32
+#define FX_STROKE_TEXT_MODE 64
+#define FX_FILL_TEXT_MODE 128
+#define FX_ZEROAREA_FILL 256
+#define FXFILL_NOPATHSMOOTH 512
+#define FXTEXT_CLEARTYPE 0x01
+#define FXTEXT_BGR_STRIPE 0x02
+#define FXTEXT_PRINTGRAPHICTEXT 0x04
+#define FXTEXT_NO_NATIVETEXT 0x08
+#define FXTEXT_PRINTIMAGETEXT 0x10
+#define FXTEXT_NOSMOOTH 0x20
+typedef struct {
+ FX_DWORD m_GlyphIndex;
+ FX_FLOAT m_OriginX, m_OriginY;
+ int m_FontCharWidth;
+ FX_BOOL m_bGlyphAdjust;
+ FX_FLOAT m_AdjustMatrix[4];
+ FX_DWORD m_ExtGID;
+ FX_BOOL m_bFontStyle;
+} FXTEXT_CHARPOS;
+class CFX_RenderDevice : public CFX_Object
+{
+public:
+ CFX_RenderDevice();
+
+ virtual ~CFX_RenderDevice();
+
+ void SetDeviceDriver(IFX_RenderDeviceDriver* pDriver);
+
+ IFX_RenderDeviceDriver* GetDeviceDriver() const
+ {
+ return m_pDeviceDriver;
+ }
+
+ FX_BOOL StartRendering();
+
+ void EndRendering();
+
+
+
+ void SaveState();
+
+ void RestoreState(FX_BOOL bKeepSaved = FALSE);
+
+
+
+
+ int GetWidth() const
+ {
+ return m_Width;
+ }
+
+ int GetHeight() const
+ {
+ return m_Height;
+ }
+
+ int GetDeviceClass() const
+ {
+ return m_DeviceClass;
+ }
+
+ int GetBPP() const
+ {
+ return m_bpp;
+ }
+
+ int GetRenderCaps() const
+ {
+ return m_RenderCaps;
+ }
+
+ int GetDeviceCaps(int id) const;
+
+ CFX_Matrix GetCTM() const;
+
+
+ CFX_DIBitmap* GetBitmap() const
+ {
+ return m_pBitmap;
+ }
+ void SetBitmap(CFX_DIBitmap* pBitmap)
+ {
+ m_pBitmap = pBitmap;
+ }
+
+ FX_BOOL CreateCompatibleBitmap(CFX_DIBitmap* pDIB, int width, int height) const;
+
+ const FX_RECT& GetClipBox() const
+ {
+ return m_ClipBox;
+ }
+
+ FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData,
+ const CFX_AffineMatrix* pObject2Device,
+ int fill_mode
+ );
+
+ FX_BOOL SetClip_Rect(const FX_RECT* pRect);
+
+ FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData,
+ const CFX_AffineMatrix* pObject2Device,
+ const CFX_GraphStateData* pGraphState
+ );
+
+ FX_BOOL DrawPath(const CFX_PathData* pPathData,
+ const CFX_AffineMatrix* pObject2Device,
+ const CFX_GraphStateData* pGraphState,
+ FX_DWORD fill_color,
+ FX_DWORD stroke_color,
+ int fill_mode,
+ int alpha_flag = 0,
+ void* pIccTransform = NULL,
+ int blend_type = FXDIB_BLEND_NORMAL
+ );
+
+ FX_BOOL SetPixel(int x, int y, FX_DWORD color,
+ int alpha_flag = 0, void* pIccTransform = NULL);
+
+ FX_BOOL FillRect(const FX_RECT* pRect, FX_DWORD color,
+ int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL);
+
+ FX_BOOL DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, FX_DWORD color,
+ int fill_mode = 0, int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL);
+
+ FX_BOOL GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform = NULL);
+
+ CFX_DIBitmap* GetBackDrop();
+
+ FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, int left, int top, int blend_type = FXDIB_BLEND_NORMAL,
+ void* pIccTransform = NULL);
+
+ FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, int left, int top, int dest_width, int dest_height,
+ FX_DWORD flags = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL);
+
+ FX_BOOL SetBitMask(const CFX_DIBSource* pBitmap, int left, int top, FX_DWORD color,
+ int alpha_flag = 0, void* pIccTransform = NULL);
+
+ FX_BOOL StretchBitMask(const CFX_DIBSource* pBitmap, int left, int top, int dest_width, int dest_height,
+ FX_DWORD color, FX_DWORD flags = 0, int alpha_flag = 0, void* pIccTransform = NULL);
+
+ FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD color,
+ const CFX_AffineMatrix* pMatrix, FX_DWORD flags, FX_LPVOID& handle,
+ int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL);
+
+ FX_BOOL ContinueDIBits(FX_LPVOID handle, IFX_Pause* pPause);
+
+ void CancelDIBits(FX_LPVOID handle);
+
+ FX_BOOL DrawNormalText(int nChars, const FXTEXT_CHARPOS* pCharPos,
+ CFX_Font* pFont, CFX_FontCache* pCache,
+ FX_FLOAT font_size, const CFX_AffineMatrix* pText2Device,
+ FX_DWORD fill_color, FX_DWORD text_flags,
+ int alpha_flag = 0, void* pIccTransform = NULL);
+
+ FX_BOOL DrawTextPath(int nChars, const FXTEXT_CHARPOS* pCharPos,
+ CFX_Font* pFont, CFX_FontCache* pCache,
+ FX_FLOAT font_size, const CFX_AffineMatrix* pText2User,
+ const CFX_AffineMatrix* pUser2Device, const CFX_GraphStateData* pGraphState,
+ FX_DWORD fill_color, FX_DWORD stroke_color, CFX_PathData* pClippingPath, int nFlag = 0,
+ int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL);
+ virtual void Begin() {}
+ virtual void End() {}
+private:
+
+ CFX_DIBitmap* m_pBitmap;
+
+
+
+ int m_Width;
+
+ int m_Height;
+
+ int m_bpp;
+
+ int m_RenderCaps;
+
+ int m_DeviceClass;
+
+ FX_RECT m_ClipBox;
+
+protected:
+
+ IFX_RenderDeviceDriver* m_pDeviceDriver;
+private:
+
+ void InitDeviceInfo();
+
+ void UpdateClipBox();
+};
+class CFX_FxgeDevice : public CFX_RenderDevice
+{
+public:
+
+ CFX_FxgeDevice();
+
+ ~CFX_FxgeDevice();
+
+ FX_BOOL Attach(CFX_DIBitmap* pBitmap, int dither_bits = 0, FX_BOOL bRgbByteOrder = FALSE, CFX_DIBitmap* pOriDevice = NULL, FX_BOOL bGroupKnockout = FALSE);
+
+ FX_BOOL Create(int width, int height, FXDIB_Format format, int dither_bits = 0, CFX_DIBitmap* pOriDevice = NULL);
+protected:
+
+ FX_BOOL m_bOwnedBitmap;
+};
+class CFX_SkiaDevice : public CFX_RenderDevice
+{
+public:
+
+ CFX_SkiaDevice();
+
+ ~CFX_SkiaDevice();
+
+ FX_BOOL Attach(CFX_DIBitmap* pBitmap, int dither_bits = 0, FX_BOOL bRgbByteOrder = FALSE, CFX_DIBitmap* pOriDevice = NULL, FX_BOOL bGroupKnockout = FALSE);
+
+ FX_BOOL Create(int width, int height, FXDIB_Format format, int dither_bits = 0, CFX_DIBitmap* pOriDevice = NULL);
+protected:
+
+ FX_BOOL m_bOwnedBitmap;
+};
+class IFX_RenderDeviceDriver : public CFX_Object
+{
+public:
+
+ static IFX_RenderDeviceDriver* CreateFxgeDriver(CFX_DIBitmap* pBitmap, FX_BOOL bRgbByteOrder = FALSE,
+ CFX_DIBitmap* pOriDevice = NULL, FX_BOOL bGroupKnockout = FALSE);
+
+ virtual ~IFX_RenderDeviceDriver() {}
+ virtual void Begin() { }
+ virtual void End() { }
+
+ virtual int GetDeviceCaps(int caps_id) = 0;
+
+ virtual CFX_Matrix GetCTM() const
+ {
+ return CFX_Matrix();
+ }
+
+ virtual FX_BOOL IsPSPrintDriver()
+ {
+ return FALSE;
+ }
+
+ virtual FX_BOOL StartRendering()
+ {
+ return TRUE;
+ }
+
+ virtual void EndRendering() {}
+
+
+
+
+ virtual void SaveState() = 0;
+
+ virtual void RestoreState(FX_BOOL bKeepSaved = FALSE) = 0;
+
+
+ virtual FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData,
+ const CFX_AffineMatrix* pObject2Device,
+ int fill_mode
+ ) = 0;
+
+ virtual FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData,
+ const CFX_AffineMatrix* pObject2Device,
+ const CFX_GraphStateData* pGraphState
+ )
+ {
+ return FALSE;
+ }
+
+ virtual FX_BOOL DrawPath(const CFX_PathData* pPathData,
+ const CFX_AffineMatrix* pObject2Device,
+ const CFX_GraphStateData* pGraphState,
+ FX_DWORD fill_color,
+ FX_DWORD stroke_color,
+ int fill_mode,
+ int alpha_flag = 0,
+ void* pIccTransform = NULL,
+ int blend_type = FXDIB_BLEND_NORMAL
+ ) = 0;
+
+ virtual FX_BOOL SetPixel(int x, int y, FX_DWORD color,
+ int alpha_flag = 0, void* pIccTransform = NULL)
+ {
+ return FALSE;
+ }
+
+ virtual FX_BOOL FillRect(const FX_RECT* pRect, FX_DWORD fill_color,
+ int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL)
+ {
+ return FALSE;
+ }
+
+ virtual FX_BOOL DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, FX_DWORD color,
+ int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL)
+ {
+ return FALSE;
+ }
+
+ virtual FX_BOOL GetClipBox(FX_RECT* pRect) = 0;
+
+ virtual FX_BOOL GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform = NULL, FX_BOOL bDEdge = FALSE)
+ {
+ return FALSE;
+ }
+ virtual CFX_DIBitmap* GetBackDrop()
+ {
+ return NULL;
+ }
+
+ virtual FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, const FX_RECT* pSrcRect,
+ int dest_left, int dest_top, int blend_type,
+ int alpha_flag = 0, void* pIccTransform = NULL) = 0;
+
+ virtual FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, int dest_left, int dest_top,
+ int dest_width, int dest_height, const FX_RECT* pClipRect, FX_DWORD flags,
+ int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL) = 0;
+
+ virtual FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD color,
+ const CFX_AffineMatrix* pMatrix, FX_DWORD flags, FX_LPVOID& handle,
+ int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL) = 0;
+
+ virtual FX_BOOL ContinueDIBits(FX_LPVOID handle, IFX_Pause* pPause)
+ {
+ return FALSE;
+ }
+
+ virtual void CancelDIBits(FX_LPVOID handle) {}
+
+ virtual FX_BOOL DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont,
+ CFX_FontCache* pCache, const CFX_AffineMatrix* pObject2Device, FX_FLOAT font_size, FX_DWORD color,
+ int alpha_flag = 0, void* pIccTransform = NULL)
+ {
+ return FALSE;
+ }
+
+ virtual void* GetPlatformSurface()
+ {
+ return NULL;
+ }
+
+ virtual int GetDriverType()
+ {
+ return 0;
+ }
+
+ virtual void ClearDriver() {}
+};
+class IFX_PSOutput
+{
+public:
+
+ virtual void OutputPS(FX_LPCSTR string, int len) = 0;
+ virtual void Release() = 0;
+};
+class CPSFont;
+class CFX_PSRenderer : public CFX_Object
+{
+public:
+
+ CFX_PSRenderer();
+
+ ~CFX_PSRenderer();
+
+ void Init(IFX_PSOutput* pOutput, int ps_level, int width, int height, FX_BOOL bCmykOutput);
+ FX_BOOL StartRendering();
+ void EndRendering();
+
+ void SaveState();
+
+ void RestoreState(FX_BOOL bKeepSaved = FALSE);
+
+ void SetClip_PathFill(const CFX_PathData* pPathData,
+ const CFX_AffineMatrix* pObject2Device,
+ int fill_mode
+ );
+
+ void SetClip_PathStroke(const CFX_PathData* pPathData,
+ const CFX_AffineMatrix* pObject2Device,
+ const CFX_GraphStateData* pGraphState
+ );
+
+ FX_RECT GetClipBox()
+ {
+ return m_ClipBox;
+ }
+
+ FX_BOOL DrawPath(const CFX_PathData* pPathData,
+ const CFX_AffineMatrix* pObject2Device,
+ const CFX_GraphStateData* pGraphState,
+ FX_DWORD fill_color,
+ FX_DWORD stroke_color,
+ int fill_mode,
+ int alpha_flag = 0,
+ void* pIccTransform = NULL
+ );
+
+ FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, int dest_left, int dest_top,
+ int alpha_flag = 0, void* pIccTransform = NULL);
+
+ FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, int dest_left, int dest_top,
+ int dest_width, int dest_height, FX_DWORD flags,
+ int alpha_flag = 0, void* pIccTransform = NULL);
+
+ FX_BOOL DrawDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color,
+ const CFX_AffineMatrix* pMatrix, FX_DWORD flags,
+ int alpha_flag = 0, void* pIccTransform = NULL);
+
+ FX_BOOL DrawText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont, CFX_FontCache* pCache,
+ const CFX_AffineMatrix* pObject2Device, FX_FLOAT font_size, FX_DWORD color,
+ int alpha_flag = 0, void* pIccTransform = NULL);
+private:
+
+ IFX_PSOutput* m_pOutput;
+
+ int m_PSLevel;
+
+ CFX_GraphStateData m_CurGraphState;
+
+ FX_BOOL m_bGraphStateSet;
+
+ FX_BOOL m_bCmykOutput;
+
+ FX_BOOL m_bColorSet;
+
+ FX_DWORD m_LastColor;
+
+ FX_RECT m_ClipBox;
+
+ CFX_ArrayTemplate<CPSFont*> m_PSFontList;
+
+ CFX_ArrayTemplate<FX_RECT> m_ClipBoxStack;
+ FX_BOOL m_bInited;
+
+ void OutputPath(const CFX_PathData* pPathData, const CFX_AffineMatrix* pObject2Device);
+
+ void SetGraphState(const CFX_GraphStateData* pGraphState);
+
+ void SetColor(FX_DWORD color, int alpha_flag, void* pIccTransform);
+
+ void FindPSFontGlyph(CFX_FaceCache* pFaceCache, CFX_Font* pFont, const FXTEXT_CHARPOS& charpos, int& ps_fontnum, int &ps_glyphindex);
+
+ void WritePSBinary(FX_LPCBYTE data, int len);
+};
+#endif
diff --git a/core/include/fxge/fx_ge_apple.h b/core/include/fxge/fx_ge_apple.h
index f13a1b38be..44bf2a028a 100644
--- a/core/include/fxge/fx_ge_apple.h
+++ b/core/include/fxge/fx_ge_apple.h
@@ -1,26 +1,26 @@
-// 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 _FX_GE_APPLE_H_
-#define _FX_GE_APPLE_H_
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
-class CFX_QuartzDevice : public CFX_RenderDevice
-{
-public:
- CFX_QuartzDevice();
- ~CFX_QuartzDevice();
- FX_BOOL Attach(CGContextRef context, FX_INT32 nDeviceClass = FXDC_DISPLAY);
- FX_BOOL Attach(CFX_DIBitmap* pBitmap);
- FX_BOOL Create(FX_INT32 width, FX_INT32 height, FXDIB_Format format);
-
- CGContextRef GetContext();
-
-protected:
- CGContextRef m_pContext;
- FX_BOOL m_bOwnedBitmap;
-};
-#endif
-#endif
+// 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 _FX_GE_APPLE_H_
+#define _FX_GE_APPLE_H_
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
+class CFX_QuartzDevice : public CFX_RenderDevice
+{
+public:
+ CFX_QuartzDevice();
+ ~CFX_QuartzDevice();
+ FX_BOOL Attach(CGContextRef context, FX_INT32 nDeviceClass = FXDC_DISPLAY);
+ FX_BOOL Attach(CFX_DIBitmap* pBitmap);
+ FX_BOOL Create(FX_INT32 width, FX_INT32 height, FXDIB_Format format);
+
+ CGContextRef GetContext();
+
+protected:
+ CGContextRef m_pContext;
+ FX_BOOL m_bOwnedBitmap;
+};
+#endif
+#endif
diff --git a/core/include/fxge/fx_ge_win32.h b/core/include/fxge/fx_ge_win32.h
index 0b421db788..311d355ef7 100644
--- a/core/include/fxge/fx_ge_win32.h
+++ b/core/include/fxge/fx_ge_win32.h
@@ -1,105 +1,105 @@
-// 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 _FX_GE_WIN32_H_
-#define _FX_GE_WIN32_H_
-#ifdef _WIN32
-#ifndef _WINDOWS_
-#include <windows.h>
-#endif
-#define WINDIB_OPEN_MEMORY 0x1
-#define WINDIB_OPEN_PATHNAME 0x2
-typedef struct WINDIB_Open_Args_ {
-
- int flags;
-
- const FX_BYTE* memory_base;
-
- size_t memory_size;
-
- FX_LPCWSTR path_name;
-} WINDIB_Open_Args_;
-class CFX_WindowsDIB : public CFX_DIBitmap
-{
-public:
-
- static CFX_ByteString GetBitmapInfo(const CFX_DIBitmap* pBitmap);
-
- static CFX_DIBitmap* LoadFromBuf(BITMAPINFO* pbmi, void* pData);
-
- static HBITMAP GetDDBitmap(const CFX_DIBitmap* pBitmap, HDC hDC);
-
- static CFX_DIBitmap* LoadFromDDB(HDC hDC, HBITMAP hBitmap, FX_DWORD* pPalette = NULL, FX_DWORD size = 256);
-
- static CFX_DIBitmap* LoadFromFile(FX_LPCWSTR filename);
-
- static CFX_DIBitmap* LoadFromFile(FX_LPCSTR filename)
- {
- return LoadFromFile(CFX_WideString::FromLocal(filename));
- }
-
- static CFX_DIBitmap* LoadDIBitmap(WINDIB_Open_Args_ args);
-
- CFX_WindowsDIB(HDC hDC, int width, int height);
-
- ~CFX_WindowsDIB();
-
- HDC GetDC() const
- {
- return m_hMemDC;
- }
-
- HBITMAP GetWindowsBitmap() const
- {
- return m_hBitmap;
- }
-
- void LoadFromDevice(HDC hDC, int left, int top);
-
- void SetToDevice(HDC hDC, int left, int top);
-protected:
-
- HDC m_hMemDC;
-
- HBITMAP m_hBitmap;
-
- HBITMAP m_hOldBitmap;
-};
-class CFX_WindowsDevice : public CFX_RenderDevice
-{
-public:
- static IFX_RenderDeviceDriver* CreateDriver(HDC hDC, FX_BOOL bCmykOutput = FALSE);
-
- CFX_WindowsDevice(HDC hDC, FX_BOOL bCmykOutput = FALSE, FX_BOOL bForcePSOutput = FALSE, int psLevel = 2);
-
- HDC GetDC() const;
-
- FX_BOOL m_bForcePSOutput;
-
- static int m_psLevel;
-};
-class CFX_WinBitmapDevice : public CFX_RenderDevice
-{
-public:
-
- CFX_WinBitmapDevice(int width, int height, FXDIB_Format format);
-
- ~CFX_WinBitmapDevice();
-
- HDC GetDC()
- {
- return m_hDC;
- }
-protected:
-
- HBITMAP m_hBitmap;
-
- HBITMAP m_hOldBitmap;
-
- HDC m_hDC;
-};
-#endif
-#endif
+// 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 _FX_GE_WIN32_H_
+#define _FX_GE_WIN32_H_
+#ifdef _WIN32
+#ifndef _WINDOWS_
+#include <windows.h>
+#endif
+#define WINDIB_OPEN_MEMORY 0x1
+#define WINDIB_OPEN_PATHNAME 0x2
+typedef struct WINDIB_Open_Args_ {
+
+ int flags;
+
+ const FX_BYTE* memory_base;
+
+ size_t memory_size;
+
+ FX_LPCWSTR path_name;
+} WINDIB_Open_Args_;
+class CFX_WindowsDIB : public CFX_DIBitmap
+{
+public:
+
+ static CFX_ByteString GetBitmapInfo(const CFX_DIBitmap* pBitmap);
+
+ static CFX_DIBitmap* LoadFromBuf(BITMAPINFO* pbmi, void* pData);
+
+ static HBITMAP GetDDBitmap(const CFX_DIBitmap* pBitmap, HDC hDC);
+
+ static CFX_DIBitmap* LoadFromDDB(HDC hDC, HBITMAP hBitmap, FX_DWORD* pPalette = NULL, FX_DWORD size = 256);
+
+ static CFX_DIBitmap* LoadFromFile(FX_LPCWSTR filename);
+
+ static CFX_DIBitmap* LoadFromFile(FX_LPCSTR filename)
+ {
+ return LoadFromFile(CFX_WideString::FromLocal(filename));
+ }
+
+ static CFX_DIBitmap* LoadDIBitmap(WINDIB_Open_Args_ args);
+
+ CFX_WindowsDIB(HDC hDC, int width, int height);
+
+ ~CFX_WindowsDIB();
+
+ HDC GetDC() const
+ {
+ return m_hMemDC;
+ }
+
+ HBITMAP GetWindowsBitmap() const
+ {
+ return m_hBitmap;
+ }
+
+ void LoadFromDevice(HDC hDC, int left, int top);
+
+ void SetToDevice(HDC hDC, int left, int top);
+protected:
+
+ HDC m_hMemDC;
+
+ HBITMAP m_hBitmap;
+
+ HBITMAP m_hOldBitmap;
+};
+class CFX_WindowsDevice : public CFX_RenderDevice
+{
+public:
+ static IFX_RenderDeviceDriver* CreateDriver(HDC hDC, FX_BOOL bCmykOutput = FALSE);
+
+ CFX_WindowsDevice(HDC hDC, FX_BOOL bCmykOutput = FALSE, FX_BOOL bForcePSOutput = FALSE, int psLevel = 2);
+
+ HDC GetDC() const;
+
+ FX_BOOL m_bForcePSOutput;
+
+ static int m_psLevel;
+};
+class CFX_WinBitmapDevice : public CFX_RenderDevice
+{
+public:
+
+ CFX_WinBitmapDevice(int width, int height, FXDIB_Format format);
+
+ ~CFX_WinBitmapDevice();
+
+ HDC GetDC()
+ {
+ return m_hDC;
+ }
+protected:
+
+ HBITMAP m_hBitmap;
+
+ HBITMAP m_hOldBitmap;
+
+ HDC m_hDC;
+};
+#endif
+#endif
diff --git a/core/include/thirdparties/freetype/foxitnames.h b/core/include/thirdparties/freetype/foxitnames.h
index 5749f9b6b3..e163fb86f0 100644
--- a/core/include/thirdparties/freetype/foxitnames.h
+++ b/core/include/thirdparties/freetype/foxitnames.h
@@ -1,283 +1,283 @@
-#ifndef _FX_FREETYPE_DONT_RENAME_
-// To avoid any possible linking confliction, we rename all FreeType exported names
-
-#define FT_Init_FreeType FPDFAPI_FT_Init_FreeType
-#define FT_Done_FreeType FPDFAPI_FT_Done_FreeType
-#define FT_New_Face FPDFAPI_FT_New_Face
-#define FT_Select_Charmap FPDFAPI_FT_Select_Charmap
-#define FT_Done_Face FPDFAPI_FT_Done_Face
-#define FT_Get_Charmap_Index FPDFAPI_FT_Get_Charmap_Index
-#define FT_New_Memory_Face FPDFAPI_FT_New_Memory_Face
-#define FT_MulDiv FPDFAPI_FT_MulDiv
-#define FT_Vector_Transform FPDFAPI_FT_Vector_Transform
-#define FT_Cos FPDFAPI_FT_Cos
-#define FT_Sin FPDFAPI_FT_Sin
-#define FT_Load_Glyph FPDFAPI_FT_Load_Glyph
-#define FT_DivFix FPDFAPI_FT_DivFix
-#define FT_Realloc FPDFAPI_FT_Realloc
-#define FT_Alloc FPDFAPI_FT_Alloc
-#define FT_Get_Char_Index FPDFAPI_FT_Get_Char_Index
-#define FT_GlyphLoader_CheckPoints FPDFAPI_FT_GlyphLoader_CheckPoints
-#define FT_GlyphLoader_Add FPDFAPI_FT_GlyphLoader_Add
-#define FT_GlyphLoader_CheckSubGlyphs FPDFAPI_FT_GlyphLoader_CheckSubGlyphs
-#define FT_Outline_Translate FPDFAPI_FT_Outline_Translate
-#define FT_Outline_Transform FPDFAPI_FT_Outline_Transform
-#define FT_Outline_Get_CBox FPDFAPI_FT_Outline_Get_CBox
-#define FT_GlyphLoader_Rewind FPDFAPI_FT_GlyphLoader_Rewind
-#define FT_GlyphLoader_CopyPoints FPDFAPI_FT_GlyphLoader_CopyPoints
-#define FT_GlyphLoader_New FPDFAPI_FT_GlyphLoader_New
-#define FT_GlyphLoader_CreateExtra FPDFAPI_FT_GlyphLoader_CreateExtra
-#define FT_Free FPDFAPI_FT_Free
-#define FT_Set_Charmap FPDFAPI_FT_Set_Charmap
-#define FT_GlyphLoader_Done FPDFAPI_FT_GlyphLoader_Done
-#define _debug_mem_dummy FPDFAPI__debug_mem_dummy
-#define _debug_mem_dummy FPDFAPI__debug_mem_dummy
-#define FT_QAlloc FPDFAPI_FT_QAlloc
-#define FT_QRealloc FPDFAPI_FT_QRealloc
-#define FT_List_Find FPDFAPI_FT_List_Find
-#define FT_List_Add FPDFAPI_FT_List_Add
-#define FT_List_Insert FPDFAPI_FT_List_Insert
-#define FT_List_Remove FPDFAPI_FT_List_Remove
-#define FT_List_Up FPDFAPI_FT_List_Up
-#define FT_List_Iterate FPDFAPI_FT_List_Iterate
-#define FT_List_Finalize FPDFAPI_FT_List_Finalize
-#define ft_highpow2 FPDFAPI_ft_highpow2
-#define FT_Stream_OpenMemory FPDFAPI_FT_Stream_OpenMemory
-#define FT_Stream_Close FPDFAPI_FT_Stream_Close
-#define FT_Stream_Seek FPDFAPI_FT_Stream_Seek
-#define FT_Stream_Skip FPDFAPI_FT_Stream_Skip
-#define FT_Stream_Pos FPDFAPI_FT_Stream_Pos
-#define FT_Stream_ReadAt FPDFAPI_FT_Stream_ReadAt
-#define FT_Stream_Read FPDFAPI_FT_Stream_Read
-#define FT_Stream_TryRead FPDFAPI_FT_Stream_TryRead
-#define FT_Stream_EnterFrame FPDFAPI_FT_Stream_EnterFrame
-#define FT_Stream_ExtractFrame FPDFAPI_FT_Stream_ExtractFrame
-#define FT_Stream_ReleaseFrame FPDFAPI_FT_Stream_ReleaseFrame
-#define FT_Stream_ExitFrame FPDFAPI_FT_Stream_ExitFrame
-#define FT_Stream_GetChar FPDFAPI_FT_Stream_GetChar
-#define FT_Stream_GetShort FPDFAPI_FT_Stream_GetShort
-#define FT_Stream_GetShortLE FPDFAPI_FT_Stream_GetShortLE
-#define FT_Stream_GetOffset FPDFAPI_FT_Stream_GetOffset
-#define FT_Stream_GetLong FPDFAPI_FT_Stream_GetLong
-#define FT_Stream_GetLongLE FPDFAPI_FT_Stream_GetLongLE
-#define FT_Stream_ReadChar FPDFAPI_FT_Stream_ReadChar
-#define FT_Stream_ReadShort FPDFAPI_FT_Stream_ReadShort
-#define FT_Stream_ReadShortLE FPDFAPI_FT_Stream_ReadShortLE
-#define FT_Stream_ReadOffset FPDFAPI_FT_Stream_ReadOffset
-#define FT_Stream_ReadLong FPDFAPI_FT_Stream_ReadLong
-#define FT_Stream_ReadLongLE FPDFAPI_FT_Stream_ReadLongLE
-#define FT_Stream_ReadFields FPDFAPI_FT_Stream_ReadFields
-#define FT_RoundFix FPDFAPI_FT_RoundFix
-#define FT_CeilFix FPDFAPI_FT_CeilFix
-#define FT_FloorFix FPDFAPI_FT_FloorFix
-#define FT_Sqrt32 FPDFAPI_FT_Sqrt32
-#define FT_SqrtFixed FPDFAPI_FT_SqrtFixed
-#define FT_Tan FPDFAPI_FT_Tan
-#define FT_Atan2 FPDFAPI_FT_Atan2
-#define FT_Vector_Unit FPDFAPI_FT_Vector_Unit
-#define FT_Vector_Rotate FPDFAPI_FT_Vector_Rotate
-#define FT_Vector_Length FPDFAPI_FT_Vector_Length
-#define FT_Vector_Polarize FPDFAPI_FT_Vector_Polarize
-#define FT_Vector_From_Polar FPDFAPI_FT_Vector_From_Polar
-#define FT_Angle_Diff FPDFAPI_FT_Angle_Diff
-#define FT_Outline_Decompose FPDFAPI_FT_Outline_Decompose
-#define FT_Outline_Done_Internal FPDFAPI_FT_Outline_Done_Internal
-#define FT_Outline_New_Internal FPDFAPI_FT_Outline_New_Internal
-#define FT_Outline_New FPDFAPI_FT_Outline_New
-#define FT_Outline_Check FPDFAPI_FT_Outline_Check
-#define FT_Outline_Copy FPDFAPI_FT_Outline_Copy
-#define FT_Outline_Done FPDFAPI_FT_Outline_Done
-#define FT_Outline_Reverse FPDFAPI_FT_Outline_Reverse
-#define FT_Set_Renderer FPDFAPI_FT_Set_Renderer
-#define FT_Lookup_Renderer FPDFAPI_FT_Lookup_Renderer
-#define FT_Outline_Render FPDFAPI_FT_Outline_Render
-#define FT_Outline_Get_Bitmap FPDFAPI_FT_Outline_Get_Bitmap
-#define FT_Outline_Get_Orientation FPDFAPI_FT_Outline_Get_Orientation
-#define FT_Outline_Embolden FPDFAPI_FT_Outline_Embolden
-#define FT_GlyphLoader_Reset FPDFAPI_FT_GlyphLoader_Reset
-#define FT_GlyphLoader_Prepare FPDFAPI_FT_GlyphLoader_Prepare
-#define ft_service_list_lookup FPDFAPI_ft_service_list_lookup
-#define ft_validator_init FPDFAPI_ft_validator_init
-#define ft_validator_run FPDFAPI_ft_validator_run
-#define ft_validator_error FPDFAPI_ft_validator_error
-#define FT_Stream_New FPDFAPI_FT_Stream_New
-#define FT_Stream_Free FPDFAPI_FT_Stream_Free
-#define ft_glyphslot_free_bitmap FPDFAPI_ft_glyphslot_free_bitmap
-#define ft_glyphslot_set_bitmap FPDFAPI_ft_glyphslot_set_bitmap
-#define FT_GlyphSlot_Own_Bitmap FPDFAPI_FT_GlyphSlot_Own_Bitmap
-#define ft_glyphslot_alloc_bitmap FPDFAPI_ft_glyphslot_alloc_bitmap
-#define FT_New_GlyphSlot FPDFAPI_FT_New_GlyphSlot
-#define FT_Done_GlyphSlot FPDFAPI_FT_Done_GlyphSlot
-#define FT_Set_Transform FPDFAPI_FT_Set_Transform
-#define FT_Render_Glyph_Internal FPDFAPI_FT_Render_Glyph_Internal
-#define FT_Render_Glyph FPDFAPI_FT_Render_Glyph
-#define FT_Load_Char FPDFAPI_FT_Load_Char
-#define FT_New_Size FPDFAPI_FT_New_Size
-#define FT_Open_Face FPDFAPI_FT_Open_Face
-#define FT_Attach_Stream FPDFAPI_FT_Attach_Stream
-#define FT_Attach_File FPDFAPI_FT_Attach_File
-#define FT_Done_Size FPDFAPI_FT_Done_Size
-#define FT_Set_Char_Size FPDFAPI_FT_Set_Char_Size
-#define FT_Set_Pixel_Sizes FPDFAPI_FT_Set_Pixel_Sizes
-#define FT_Get_Kerning FPDFAPI_FT_Get_Kerning
-#define FT_CMap_Done FPDFAPI_FT_CMap_Done
-#define FT_CMap_New FPDFAPI_FT_CMap_New
-#define FT_Get_Next_Char FPDFAPI_FT_Get_Next_Char
-#define FT_Get_First_Char FPDFAPI_FT_Get_First_Char
-#define FT_Get_Name_Index FPDFAPI_FT_Get_Name_Index
-#define FT_Get_Glyph_Name FPDFAPI_FT_Get_Glyph_Name
-#define FT_Get_Postscript_Name FPDFAPI_FT_Get_Postscript_Name
-#define FT_Get_Sfnt_Table FPDFAPI_FT_Get_Sfnt_Table
-#define FT_Load_Sfnt_Table FPDFAPI_FT_Load_Sfnt_Table
-#define FT_Sfnt_Table_Info FPDFAPI_FT_Sfnt_Table_Info
-#define FT_Get_CMap_Language_ID FPDFAPI_FT_Get_CMap_Language_ID
-#define FT_Activate_Size FPDFAPI_FT_Activate_Size
-#define FT_Get_Renderer FPDFAPI_FT_Get_Renderer
-#define FT_Remove_Module FPDFAPI_FT_Remove_Module
-#define FT_Add_Module FPDFAPI_FT_Add_Module
-#define FT_Get_Module FPDFAPI_FT_Get_Module
-#define FT_Get_Module_Interface FPDFAPI_FT_Get_Module_Interface
-#define ft_module_get_service FPDFAPI_ft_module_get_service
-#define FT_New_Library FPDFAPI_FT_New_Library
-#define FT_Library_Version FPDFAPI_FT_Library_Version
-#define FT_Done_Library FPDFAPI_FT_Done_Library
-#define FT_Set_Debug_Hook FPDFAPI_FT_Set_Debug_Hook
-#define FT_Raccess_Get_HeaderInfo FPDFAPI_FT_Raccess_Get_HeaderInfo
-#define FT_Raccess_Get_DataOffsets FPDFAPI_FT_Raccess_Get_DataOffsets
-#define FT_Raccess_Guess FPDFAPI_FT_Raccess_Guess
-#define af_dummy_script_class FPDFAPI_af_dummy_script_class
-#define af_latin_script_class FPDFAPI_af_latin_script_class
-#define af_cjk_script_class FPDFAPI_af_cjk_script_class
-#define af_autofitter_service FPDFAPI_af_autofitter_service
-#define autofit_module_class FPDFAPI_autofit_module_class
-#define cff_cmap_encoding_class_rec FPDFAPI_cff_cmap_encoding_class_rec
-#define cff_cmap_unicode_class_rec FPDFAPI_cff_cmap_unicode_class_rec
-#define cff_driver_class FPDFAPI_cff_driver_class
-#define FT_Stream_Open FPDFAPI_FT_Stream_Open
-#define FT_New_Memory FPDFAPI_FT_New_Memory
-#define FT_Done_Memory FPDFAPI_FT_Done_Memory
-#define ft_mem_qalloc FPDFAPI_ft_mem_qalloc
-#define ft_mem_alloc FPDFAPI_ft_mem_alloc
-#define ft_mem_free FPDFAPI_ft_mem_free
-#define ft_mem_qrealloc FPDFAPI_ft_mem_qrealloc
-#define ft_mem_realloc FPDFAPI_ft_mem_realloc
-#define FT_Get_TrueType_Engine_Type FPDFAPI_FT_Get_TrueType_Engine_Type
-#define ft_stub_set_char_sizes FPDFAPI_ft_stub_set_char_sizes
-#define ft_stub_set_pixel_sizes FPDFAPI_ft_stub_set_pixel_sizes
-#define FT_Get_SubGlyph_Info FPDFAPI_FT_Get_SubGlyph_Info
-#define FT_Get_Sfnt_Name_Count FPDFAPI_FT_Get_Sfnt_Name_Count
-#define FT_Get_Sfnt_Name FPDFAPI_FT_Get_Sfnt_Name
-#define FT_Bitmap_New FPDFAPI_FT_Bitmap_New
-#define FT_Bitmap_Copy FPDFAPI_FT_Bitmap_Copy
-#define FT_Bitmap_Done FPDFAPI_FT_Bitmap_Done
-#define FT_Bitmap_Convert FPDFAPI_FT_Bitmap_Convert
-#define FT_Bitmap_Embolden FPDFAPI_FT_Bitmap_Embolden
-#define ft_bitmap_glyph_class FPDFAPI_ft_bitmap_glyph_class
-#define ft_outline_glyph_class FPDFAPI_ft_outline_glyph_class
-#define FT_Matrix_Multiply FPDFAPI_FT_Matrix_Multiply
-#define FT_Matrix_Invert FPDFAPI_FT_Matrix_Invert
-#define FT_Done_Glyph FPDFAPI_FT_Done_Glyph
-#define FT_Glyph_Copy FPDFAPI_FT_Glyph_Copy
-#define FT_Get_Glyph FPDFAPI_FT_Get_Glyph
-#define FT_Glyph_Transform FPDFAPI_FT_Glyph_Transform
-#define FT_Glyph_Get_CBox FPDFAPI_FT_Glyph_Get_CBox
-#define FT_Glyph_To_Bitmap FPDFAPI_FT_Glyph_To_Bitmap
-#define FT_Add_Default_Modules FPDFAPI_FT_Add_Default_Modules
-#define FT_Get_Multi_Master FPDFAPI_FT_Get_Multi_Master
-#define FT_Get_MM_Var FPDFAPI_FT_Get_MM_Var
-#define FT_Set_MM_Design_Coordinates FPDFAPI_FT_Set_MM_Design_Coordinates
-#define FT_Set_Var_Design_Coordinates FPDFAPI_FT_Set_Var_Design_Coordinates
-#define FT_Set_MM_Blend_Coordinates FPDFAPI_FT_Set_MM_Blend_Coordinates
-#define FT_Set_Var_Blend_Coordinates FPDFAPI_FT_Set_Var_Blend_Coordinates
-#define ps_table_funcs FPDFAPI_ps_table_funcs
-#define ps_parser_funcs FPDFAPI_ps_parser_funcs
-#define t1_builder_funcs FPDFAPI_t1_builder_funcs
-#define t1_decoder_funcs FPDFAPI_t1_decoder_funcs
-#define afm_parser_funcs FPDFAPI_afm_parser_funcs
-#define t1_cmap_classes FPDFAPI_t1_cmap_classes
-#define t1_cmap_standard_class_rec FPDFAPI_t1_cmap_standard_class_rec
-#define t1_cmap_expert_class_rec FPDFAPI_t1_cmap_expert_class_rec
-#define t1_cmap_custom_class_rec FPDFAPI_t1_cmap_custom_class_rec
-#define t1_cmap_unicode_class_rec FPDFAPI_t1_cmap_unicode_class_rec
-#define psaux_module_class FPDFAPI_psaux_module_class
-#define pshinter_module_class FPDFAPI_pshinter_module_class
-#define ps_hints_apply FPDFAPI_ps_hints_apply
-#define psnames_module_class FPDFAPI_psnames_module_class
-#define ft_raster1_renderer_class FPDFAPI_ft_raster1_renderer_class
-#define ft_standard_raster FPDFAPI_ft_standard_raster
-#define ft_raster5_renderer_class FPDFAPI_ft_raster5_renderer_class
-#define tt_cmap0_class_rec FPDFAPI_tt_cmap0_class_rec
-#define tt_cmap2_class_rec FPDFAPI_tt_cmap2_class_rec
-#define tt_cmap4_class_rec FPDFAPI_tt_cmap4_class_rec
-#define tt_cmap6_class_rec FPDFAPI_tt_cmap6_class_rec
-#define tt_cmap8_class_rec FPDFAPI_tt_cmap8_class_rec
-#define tt_cmap10_class_rec FPDFAPI_tt_cmap10_class_rec
-#define tt_cmap12_class_rec FPDFAPI_tt_cmap12_class_rec
-#define tt_cmap13_class_rec FPDFAPI_tt_cmap13_class_rec
-#define tt_cmap14_class_rec FPDFAPI_tt_cmap14_class_rec
-#define sfnt_module_class FPDFAPI_sfnt_module_class
-#define ft_grays_raster FPDFAPI_ft_grays_raster
-#define ft_smooth_renderer_class FPDFAPI_ft_smooth_renderer_class
-#define ft_smooth_lcd_renderer_class FPDFAPI_ft_smooth_lcd_renderer_class
-#define ft_smooth_lcdv_renderer_class FPDFAPI_ft_smooth_lcdv_renderer_class
-#define tt_default_graphics_state FPDFAPI_tt_default_graphics_state
-#define tt_driver_class FPDFAPI_tt_driver_class
-#define TT_RunIns FPDFAPI_TT_RunIns
-#define TT_New_Context FPDFAPI_TT_New_Context
-#define t1_driver_class FPDFAPI_t1_driver_class
-#define t1cid_driver_class FPDFAPI_t1cid_driver_class
-#define FT_Get_Track_Kerning FPDFAPI_FT_Get_Track_Kerning
-#define FT_Match_Size FPDFAPI_FT_Match_Size
-#define FT_MulDiv_No_Round FPDFAPI_FT_MulDiv_No_Round
-#define FT_Request_Metrics FPDFAPI_FT_Request_Metrics
-#define FT_Request_Size FPDFAPI_FT_Request_Size
-#define FT_Select_Metrics FPDFAPI_FT_Select_Metrics
-#define FT_Select_Size FPDFAPI_FT_Select_Size
-#define ft_synthesize_vertical_metrics FPDFAPI_ft_synthesize_vertical_metrics
-#define New_Profile FPDFAPI_New_Profile
-#define End_Profile FPDFAPI_End_Profile
-#define Insert_Y_Turn FPDFAPI_Insert_Y_Turn
-#define Split_Conic FPDFAPI_Split_Conic
-#define Split_Cubic FPDFAPI_Split_Cubic
-#define Line_Up FPDFAPI_Line_Up
-#define Bezier_Up FPDFAPI_Bezier_Up
-#define Bezier_Down FPDFAPI_Bezier_Down
-#define Line_To FPDFAPI_Line_To
-#define Conic_To FPDFAPI_Conic_To
-#define Cubic_To FPDFAPI_Cubic_To
-#define Decompose_Curve FPDFAPI_Decompose_Curve
-#define Convert_Glyph FPDFAPI_Convert_Glyph
-#define Sort FPDFAPI_Sort
-#define Vertical_Sweep_Init FPDFAPI_Vertical_Sweep_Init
-#define Vertical_Sweep_Span FPDFAPI_Vertical_Sweep_Span
-#define Vertical_Sweep_Drop FPDFAPI_Vertical_Sweep_Drop
-#define Vertical_Sweep_Step FPDFAPI_Vertical_Sweep_Step
-#define Horizontal_Sweep_Init FPDFAPI_Horizontal_Sweep_Init
-#define Horizontal_Sweep_Span FPDFAPI_Horizontal_Sweep_Span
-#define Horizontal_Sweep_Drop FPDFAPI_Horizontal_Sweep_Drop
-#define Horizontal_Sweep_Step FPDFAPI_Horizontal_Sweep_Step
-#define Draw_Sweep FPDFAPI_Draw_Sweep
-#define Render_Single_Pass FPDFAPI_Render_Single_Pass
-#define Render_Glyph FPDFAPI_Render_Glyph
-#define Finalize_Profile_Table FPDFAPI_Finalize_Profile_Table
-#define InsNew FPDFAPI_InsNew
-#define DelOld FPDFAPI_DelOld
-#define FT_MulFix FPDFAPI_FT_MulFix
-#define FT_Matrix_Multiply_Scaled FPDFAPI_FT_Matrix_Multiply_Scaled
-#define FT_Vector_Transform_Scaled FPDFAPI_FT_Vector_Transform_Scaled
-#define ft_corner_orientation FPDFAPI_ft_corner_orientation
-#define ft_corner_is_flat FPDFAPI_ft_corner_is_flat
-#define FT_Get_CMap_Format FPDFAPI_FT_Get_CMap_Format
-#define ft_mem_strcpyn FPDFAPI_ft_mem_strcpyn
-#define ft_mem_dup FPDFAPI_ft_mem_dup
-#define ft_mem_strdup FPDFAPI_ft_mem_strdup
-#define FT_Face_GetCharVariantIsDefault FPDFAPI_FT_Face_GetCharVariantIsDefault
-#define FT_Face_GetCharsOfVariant FPDFAPI_FT_Face_GetCharsOfVariant
-#define FT_Face_GetVariantsOfChar FPDFAPI_FT_Face_GetVariantsOfChar
-#define FT_Face_GetVariantSelectors FPDFAPI_FT_Face_GetVariantSelectors
-#define FT_Face_GetCharVariantIndex FPDFAPI_FT_Face_GetCharVariantIndex
-#define FT_Get_Advances FPDFAPI_FT_Get_Advances
-#define FT_Get_Advance FPDFAPI_FT_Get_Advance
-#define FT_Library_SetLcdFilter FPDFAPI_FT_Library_SetLcdFilter
-
-#endif // !_FX_FREETYPE_DONT_RENAME_
+#ifndef _FX_FREETYPE_DONT_RENAME_
+// To avoid any possible linking confliction, we rename all FreeType exported names
+
+#define FT_Init_FreeType FPDFAPI_FT_Init_FreeType
+#define FT_Done_FreeType FPDFAPI_FT_Done_FreeType
+#define FT_New_Face FPDFAPI_FT_New_Face
+#define FT_Select_Charmap FPDFAPI_FT_Select_Charmap
+#define FT_Done_Face FPDFAPI_FT_Done_Face
+#define FT_Get_Charmap_Index FPDFAPI_FT_Get_Charmap_Index
+#define FT_New_Memory_Face FPDFAPI_FT_New_Memory_Face
+#define FT_MulDiv FPDFAPI_FT_MulDiv
+#define FT_Vector_Transform FPDFAPI_FT_Vector_Transform
+#define FT_Cos FPDFAPI_FT_Cos
+#define FT_Sin FPDFAPI_FT_Sin
+#define FT_Load_Glyph FPDFAPI_FT_Load_Glyph
+#define FT_DivFix FPDFAPI_FT_DivFix
+#define FT_Realloc FPDFAPI_FT_Realloc
+#define FT_Alloc FPDFAPI_FT_Alloc
+#define FT_Get_Char_Index FPDFAPI_FT_Get_Char_Index
+#define FT_GlyphLoader_CheckPoints FPDFAPI_FT_GlyphLoader_CheckPoints
+#define FT_GlyphLoader_Add FPDFAPI_FT_GlyphLoader_Add
+#define FT_GlyphLoader_CheckSubGlyphs FPDFAPI_FT_GlyphLoader_CheckSubGlyphs
+#define FT_Outline_Translate FPDFAPI_FT_Outline_Translate
+#define FT_Outline_Transform FPDFAPI_FT_Outline_Transform
+#define FT_Outline_Get_CBox FPDFAPI_FT_Outline_Get_CBox
+#define FT_GlyphLoader_Rewind FPDFAPI_FT_GlyphLoader_Rewind
+#define FT_GlyphLoader_CopyPoints FPDFAPI_FT_GlyphLoader_CopyPoints
+#define FT_GlyphLoader_New FPDFAPI_FT_GlyphLoader_New
+#define FT_GlyphLoader_CreateExtra FPDFAPI_FT_GlyphLoader_CreateExtra
+#define FT_Free FPDFAPI_FT_Free
+#define FT_Set_Charmap FPDFAPI_FT_Set_Charmap
+#define FT_GlyphLoader_Done FPDFAPI_FT_GlyphLoader_Done
+#define _debug_mem_dummy FPDFAPI__debug_mem_dummy
+#define _debug_mem_dummy FPDFAPI__debug_mem_dummy
+#define FT_QAlloc FPDFAPI_FT_QAlloc
+#define FT_QRealloc FPDFAPI_FT_QRealloc
+#define FT_List_Find FPDFAPI_FT_List_Find
+#define FT_List_Add FPDFAPI_FT_List_Add
+#define FT_List_Insert FPDFAPI_FT_List_Insert
+#define FT_List_Remove FPDFAPI_FT_List_Remove
+#define FT_List_Up FPDFAPI_FT_List_Up
+#define FT_List_Iterate FPDFAPI_FT_List_Iterate
+#define FT_List_Finalize FPDFAPI_FT_List_Finalize
+#define ft_highpow2 FPDFAPI_ft_highpow2
+#define FT_Stream_OpenMemory FPDFAPI_FT_Stream_OpenMemory
+#define FT_Stream_Close FPDFAPI_FT_Stream_Close
+#define FT_Stream_Seek FPDFAPI_FT_Stream_Seek
+#define FT_Stream_Skip FPDFAPI_FT_Stream_Skip
+#define FT_Stream_Pos FPDFAPI_FT_Stream_Pos
+#define FT_Stream_ReadAt FPDFAPI_FT_Stream_ReadAt
+#define FT_Stream_Read FPDFAPI_FT_Stream_Read
+#define FT_Stream_TryRead FPDFAPI_FT_Stream_TryRead
+#define FT_Stream_EnterFrame FPDFAPI_FT_Stream_EnterFrame
+#define FT_Stream_ExtractFrame FPDFAPI_FT_Stream_ExtractFrame
+#define FT_Stream_ReleaseFrame FPDFAPI_FT_Stream_ReleaseFrame
+#define FT_Stream_ExitFrame FPDFAPI_FT_Stream_ExitFrame
+#define FT_Stream_GetChar FPDFAPI_FT_Stream_GetChar
+#define FT_Stream_GetShort FPDFAPI_FT_Stream_GetShort
+#define FT_Stream_GetShortLE FPDFAPI_FT_Stream_GetShortLE
+#define FT_Stream_GetOffset FPDFAPI_FT_Stream_GetOffset
+#define FT_Stream_GetLong FPDFAPI_FT_Stream_GetLong
+#define FT_Stream_GetLongLE FPDFAPI_FT_Stream_GetLongLE
+#define FT_Stream_ReadChar FPDFAPI_FT_Stream_ReadChar
+#define FT_Stream_ReadShort FPDFAPI_FT_Stream_ReadShort
+#define FT_Stream_ReadShortLE FPDFAPI_FT_Stream_ReadShortLE
+#define FT_Stream_ReadOffset FPDFAPI_FT_Stream_ReadOffset
+#define FT_Stream_ReadLong FPDFAPI_FT_Stream_ReadLong
+#define FT_Stream_ReadLongLE FPDFAPI_FT_Stream_ReadLongLE
+#define FT_Stream_ReadFields FPDFAPI_FT_Stream_ReadFields
+#define FT_RoundFix FPDFAPI_FT_RoundFix
+#define FT_CeilFix FPDFAPI_FT_CeilFix
+#define FT_FloorFix FPDFAPI_FT_FloorFix
+#define FT_Sqrt32 FPDFAPI_FT_Sqrt32
+#define FT_SqrtFixed FPDFAPI_FT_SqrtFixed
+#define FT_Tan FPDFAPI_FT_Tan
+#define FT_Atan2 FPDFAPI_FT_Atan2
+#define FT_Vector_Unit FPDFAPI_FT_Vector_Unit
+#define FT_Vector_Rotate FPDFAPI_FT_Vector_Rotate
+#define FT_Vector_Length FPDFAPI_FT_Vector_Length
+#define FT_Vector_Polarize FPDFAPI_FT_Vector_Polarize
+#define FT_Vector_From_Polar FPDFAPI_FT_Vector_From_Polar
+#define FT_Angle_Diff FPDFAPI_FT_Angle_Diff
+#define FT_Outline_Decompose FPDFAPI_FT_Outline_Decompose
+#define FT_Outline_Done_Internal FPDFAPI_FT_Outline_Done_Internal
+#define FT_Outline_New_Internal FPDFAPI_FT_Outline_New_Internal
+#define FT_Outline_New FPDFAPI_FT_Outline_New
+#define FT_Outline_Check FPDFAPI_FT_Outline_Check
+#define FT_Outline_Copy FPDFAPI_FT_Outline_Copy
+#define FT_Outline_Done FPDFAPI_FT_Outline_Done
+#define FT_Outline_Reverse FPDFAPI_FT_Outline_Reverse
+#define FT_Set_Renderer FPDFAPI_FT_Set_Renderer
+#define FT_Lookup_Renderer FPDFAPI_FT_Lookup_Renderer
+#define FT_Outline_Render FPDFAPI_FT_Outline_Render
+#define FT_Outline_Get_Bitmap FPDFAPI_FT_Outline_Get_Bitmap
+#define FT_Outline_Get_Orientation FPDFAPI_FT_Outline_Get_Orientation
+#define FT_Outline_Embolden FPDFAPI_FT_Outline_Embolden
+#define FT_GlyphLoader_Reset FPDFAPI_FT_GlyphLoader_Reset
+#define FT_GlyphLoader_Prepare FPDFAPI_FT_GlyphLoader_Prepare
+#define ft_service_list_lookup FPDFAPI_ft_service_list_lookup
+#define ft_validator_init FPDFAPI_ft_validator_init
+#define ft_validator_run FPDFAPI_ft_validator_run
+#define ft_validator_error FPDFAPI_ft_validator_error
+#define FT_Stream_New FPDFAPI_FT_Stream_New
+#define FT_Stream_Free FPDFAPI_FT_Stream_Free
+#define ft_glyphslot_free_bitmap FPDFAPI_ft_glyphslot_free_bitmap
+#define ft_glyphslot_set_bitmap FPDFAPI_ft_glyphslot_set_bitmap
+#define FT_GlyphSlot_Own_Bitmap FPDFAPI_FT_GlyphSlot_Own_Bitmap
+#define ft_glyphslot_alloc_bitmap FPDFAPI_ft_glyphslot_alloc_bitmap
+#define FT_New_GlyphSlot FPDFAPI_FT_New_GlyphSlot
+#define FT_Done_GlyphSlot FPDFAPI_FT_Done_GlyphSlot
+#define FT_Set_Transform FPDFAPI_FT_Set_Transform
+#define FT_Render_Glyph_Internal FPDFAPI_FT_Render_Glyph_Internal
+#define FT_Render_Glyph FPDFAPI_FT_Render_Glyph
+#define FT_Load_Char FPDFAPI_FT_Load_Char
+#define FT_New_Size FPDFAPI_FT_New_Size
+#define FT_Open_Face FPDFAPI_FT_Open_Face
+#define FT_Attach_Stream FPDFAPI_FT_Attach_Stream
+#define FT_Attach_File FPDFAPI_FT_Attach_File
+#define FT_Done_Size FPDFAPI_FT_Done_Size
+#define FT_Set_Char_Size FPDFAPI_FT_Set_Char_Size
+#define FT_Set_Pixel_Sizes FPDFAPI_FT_Set_Pixel_Sizes
+#define FT_Get_Kerning FPDFAPI_FT_Get_Kerning
+#define FT_CMap_Done FPDFAPI_FT_CMap_Done
+#define FT_CMap_New FPDFAPI_FT_CMap_New
+#define FT_Get_Next_Char FPDFAPI_FT_Get_Next_Char
+#define FT_Get_First_Char FPDFAPI_FT_Get_First_Char
+#define FT_Get_Name_Index FPDFAPI_FT_Get_Name_Index
+#define FT_Get_Glyph_Name FPDFAPI_FT_Get_Glyph_Name
+#define FT_Get_Postscript_Name FPDFAPI_FT_Get_Postscript_Name
+#define FT_Get_Sfnt_Table FPDFAPI_FT_Get_Sfnt_Table
+#define FT_Load_Sfnt_Table FPDFAPI_FT_Load_Sfnt_Table
+#define FT_Sfnt_Table_Info FPDFAPI_FT_Sfnt_Table_Info
+#define FT_Get_CMap_Language_ID FPDFAPI_FT_Get_CMap_Language_ID
+#define FT_Activate_Size FPDFAPI_FT_Activate_Size
+#define FT_Get_Renderer FPDFAPI_FT_Get_Renderer
+#define FT_Remove_Module FPDFAPI_FT_Remove_Module
+#define FT_Add_Module FPDFAPI_FT_Add_Module
+#define FT_Get_Module FPDFAPI_FT_Get_Module
+#define FT_Get_Module_Interface FPDFAPI_FT_Get_Module_Interface
+#define ft_module_get_service FPDFAPI_ft_module_get_service
+#define FT_New_Library FPDFAPI_FT_New_Library
+#define FT_Library_Version FPDFAPI_FT_Library_Version
+#define FT_Done_Library FPDFAPI_FT_Done_Library
+#define FT_Set_Debug_Hook FPDFAPI_FT_Set_Debug_Hook
+#define FT_Raccess_Get_HeaderInfo FPDFAPI_FT_Raccess_Get_HeaderInfo
+#define FT_Raccess_Get_DataOffsets FPDFAPI_FT_Raccess_Get_DataOffsets
+#define FT_Raccess_Guess FPDFAPI_FT_Raccess_Guess
+#define af_dummy_script_class FPDFAPI_af_dummy_script_class
+#define af_latin_script_class FPDFAPI_af_latin_script_class
+#define af_cjk_script_class FPDFAPI_af_cjk_script_class
+#define af_autofitter_service FPDFAPI_af_autofitter_service
+#define autofit_module_class FPDFAPI_autofit_module_class
+#define cff_cmap_encoding_class_rec FPDFAPI_cff_cmap_encoding_class_rec
+#define cff_cmap_unicode_class_rec FPDFAPI_cff_cmap_unicode_class_rec
+#define cff_driver_class FPDFAPI_cff_driver_class
+#define FT_Stream_Open FPDFAPI_FT_Stream_Open
+#define FT_New_Memory FPDFAPI_FT_New_Memory
+#define FT_Done_Memory FPDFAPI_FT_Done_Memory
+#define ft_mem_qalloc FPDFAPI_ft_mem_qalloc
+#define ft_mem_alloc FPDFAPI_ft_mem_alloc
+#define ft_mem_free FPDFAPI_ft_mem_free
+#define ft_mem_qrealloc FPDFAPI_ft_mem_qrealloc
+#define ft_mem_realloc FPDFAPI_ft_mem_realloc
+#define FT_Get_TrueType_Engine_Type FPDFAPI_FT_Get_TrueType_Engine_Type
+#define ft_stub_set_char_sizes FPDFAPI_ft_stub_set_char_sizes
+#define ft_stub_set_pixel_sizes FPDFAPI_ft_stub_set_pixel_sizes
+#define FT_Get_SubGlyph_Info FPDFAPI_FT_Get_SubGlyph_Info
+#define FT_Get_Sfnt_Name_Count FPDFAPI_FT_Get_Sfnt_Name_Count
+#define FT_Get_Sfnt_Name FPDFAPI_FT_Get_Sfnt_Name
+#define FT_Bitmap_New FPDFAPI_FT_Bitmap_New
+#define FT_Bitmap_Copy FPDFAPI_FT_Bitmap_Copy
+#define FT_Bitmap_Done FPDFAPI_FT_Bitmap_Done
+#define FT_Bitmap_Convert FPDFAPI_FT_Bitmap_Convert
+#define FT_Bitmap_Embolden FPDFAPI_FT_Bitmap_Embolden
+#define ft_bitmap_glyph_class FPDFAPI_ft_bitmap_glyph_class
+#define ft_outline_glyph_class FPDFAPI_ft_outline_glyph_class
+#define FT_Matrix_Multiply FPDFAPI_FT_Matrix_Multiply
+#define FT_Matrix_Invert FPDFAPI_FT_Matrix_Invert
+#define FT_Done_Glyph FPDFAPI_FT_Done_Glyph
+#define FT_Glyph_Copy FPDFAPI_FT_Glyph_Copy
+#define FT_Get_Glyph FPDFAPI_FT_Get_Glyph
+#define FT_Glyph_Transform FPDFAPI_FT_Glyph_Transform
+#define FT_Glyph_Get_CBox FPDFAPI_FT_Glyph_Get_CBox
+#define FT_Glyph_To_Bitmap FPDFAPI_FT_Glyph_To_Bitmap
+#define FT_Add_Default_Modules FPDFAPI_FT_Add_Default_Modules
+#define FT_Get_Multi_Master FPDFAPI_FT_Get_Multi_Master
+#define FT_Get_MM_Var FPDFAPI_FT_Get_MM_Var
+#define FT_Set_MM_Design_Coordinates FPDFAPI_FT_Set_MM_Design_Coordinates
+#define FT_Set_Var_Design_Coordinates FPDFAPI_FT_Set_Var_Design_Coordinates
+#define FT_Set_MM_Blend_Coordinates FPDFAPI_FT_Set_MM_Blend_Coordinates
+#define FT_Set_Var_Blend_Coordinates FPDFAPI_FT_Set_Var_Blend_Coordinates
+#define ps_table_funcs FPDFAPI_ps_table_funcs
+#define ps_parser_funcs FPDFAPI_ps_parser_funcs
+#define t1_builder_funcs FPDFAPI_t1_builder_funcs
+#define t1_decoder_funcs FPDFAPI_t1_decoder_funcs
+#define afm_parser_funcs FPDFAPI_afm_parser_funcs
+#define t1_cmap_classes FPDFAPI_t1_cmap_classes
+#define t1_cmap_standard_class_rec FPDFAPI_t1_cmap_standard_class_rec
+#define t1_cmap_expert_class_rec FPDFAPI_t1_cmap_expert_class_rec
+#define t1_cmap_custom_class_rec FPDFAPI_t1_cmap_custom_class_rec
+#define t1_cmap_unicode_class_rec FPDFAPI_t1_cmap_unicode_class_rec
+#define psaux_module_class FPDFAPI_psaux_module_class
+#define pshinter_module_class FPDFAPI_pshinter_module_class
+#define ps_hints_apply FPDFAPI_ps_hints_apply
+#define psnames_module_class FPDFAPI_psnames_module_class
+#define ft_raster1_renderer_class FPDFAPI_ft_raster1_renderer_class
+#define ft_standard_raster FPDFAPI_ft_standard_raster
+#define ft_raster5_renderer_class FPDFAPI_ft_raster5_renderer_class
+#define tt_cmap0_class_rec FPDFAPI_tt_cmap0_class_rec
+#define tt_cmap2_class_rec FPDFAPI_tt_cmap2_class_rec
+#define tt_cmap4_class_rec FPDFAPI_tt_cmap4_class_rec
+#define tt_cmap6_class_rec FPDFAPI_tt_cmap6_class_rec
+#define tt_cmap8_class_rec FPDFAPI_tt_cmap8_class_rec
+#define tt_cmap10_class_rec FPDFAPI_tt_cmap10_class_rec
+#define tt_cmap12_class_rec FPDFAPI_tt_cmap12_class_rec
+#define tt_cmap13_class_rec FPDFAPI_tt_cmap13_class_rec
+#define tt_cmap14_class_rec FPDFAPI_tt_cmap14_class_rec
+#define sfnt_module_class FPDFAPI_sfnt_module_class
+#define ft_grays_raster FPDFAPI_ft_grays_raster
+#define ft_smooth_renderer_class FPDFAPI_ft_smooth_renderer_class
+#define ft_smooth_lcd_renderer_class FPDFAPI_ft_smooth_lcd_renderer_class
+#define ft_smooth_lcdv_renderer_class FPDFAPI_ft_smooth_lcdv_renderer_class
+#define tt_default_graphics_state FPDFAPI_tt_default_graphics_state
+#define tt_driver_class FPDFAPI_tt_driver_class
+#define TT_RunIns FPDFAPI_TT_RunIns
+#define TT_New_Context FPDFAPI_TT_New_Context
+#define t1_driver_class FPDFAPI_t1_driver_class
+#define t1cid_driver_class FPDFAPI_t1cid_driver_class
+#define FT_Get_Track_Kerning FPDFAPI_FT_Get_Track_Kerning
+#define FT_Match_Size FPDFAPI_FT_Match_Size
+#define FT_MulDiv_No_Round FPDFAPI_FT_MulDiv_No_Round
+#define FT_Request_Metrics FPDFAPI_FT_Request_Metrics
+#define FT_Request_Size FPDFAPI_FT_Request_Size
+#define FT_Select_Metrics FPDFAPI_FT_Select_Metrics
+#define FT_Select_Size FPDFAPI_FT_Select_Size
+#define ft_synthesize_vertical_metrics FPDFAPI_ft_synthesize_vertical_metrics
+#define New_Profile FPDFAPI_New_Profile
+#define End_Profile FPDFAPI_End_Profile
+#define Insert_Y_Turn FPDFAPI_Insert_Y_Turn
+#define Split_Conic FPDFAPI_Split_Conic
+#define Split_Cubic FPDFAPI_Split_Cubic
+#define Line_Up FPDFAPI_Line_Up
+#define Bezier_Up FPDFAPI_Bezier_Up
+#define Bezier_Down FPDFAPI_Bezier_Down
+#define Line_To FPDFAPI_Line_To
+#define Conic_To FPDFAPI_Conic_To
+#define Cubic_To FPDFAPI_Cubic_To
+#define Decompose_Curve FPDFAPI_Decompose_Curve
+#define Convert_Glyph FPDFAPI_Convert_Glyph
+#define Sort FPDFAPI_Sort
+#define Vertical_Sweep_Init FPDFAPI_Vertical_Sweep_Init
+#define Vertical_Sweep_Span FPDFAPI_Vertical_Sweep_Span
+#define Vertical_Sweep_Drop FPDFAPI_Vertical_Sweep_Drop
+#define Vertical_Sweep_Step FPDFAPI_Vertical_Sweep_Step
+#define Horizontal_Sweep_Init FPDFAPI_Horizontal_Sweep_Init
+#define Horizontal_Sweep_Span FPDFAPI_Horizontal_Sweep_Span
+#define Horizontal_Sweep_Drop FPDFAPI_Horizontal_Sweep_Drop
+#define Horizontal_Sweep_Step FPDFAPI_Horizontal_Sweep_Step
+#define Draw_Sweep FPDFAPI_Draw_Sweep
+#define Render_Single_Pass FPDFAPI_Render_Single_Pass
+#define Render_Glyph FPDFAPI_Render_Glyph
+#define Finalize_Profile_Table FPDFAPI_Finalize_Profile_Table
+#define InsNew FPDFAPI_InsNew
+#define DelOld FPDFAPI_DelOld
+#define FT_MulFix FPDFAPI_FT_MulFix
+#define FT_Matrix_Multiply_Scaled FPDFAPI_FT_Matrix_Multiply_Scaled
+#define FT_Vector_Transform_Scaled FPDFAPI_FT_Vector_Transform_Scaled
+#define ft_corner_orientation FPDFAPI_ft_corner_orientation
+#define ft_corner_is_flat FPDFAPI_ft_corner_is_flat
+#define FT_Get_CMap_Format FPDFAPI_FT_Get_CMap_Format
+#define ft_mem_strcpyn FPDFAPI_ft_mem_strcpyn
+#define ft_mem_dup FPDFAPI_ft_mem_dup
+#define ft_mem_strdup FPDFAPI_ft_mem_strdup
+#define FT_Face_GetCharVariantIsDefault FPDFAPI_FT_Face_GetCharVariantIsDefault
+#define FT_Face_GetCharsOfVariant FPDFAPI_FT_Face_GetCharsOfVariant
+#define FT_Face_GetVariantsOfChar FPDFAPI_FT_Face_GetVariantsOfChar
+#define FT_Face_GetVariantSelectors FPDFAPI_FT_Face_GetVariantSelectors
+#define FT_Face_GetCharVariantIndex FPDFAPI_FT_Face_GetCharVariantIndex
+#define FT_Get_Advances FPDFAPI_FT_Get_Advances
+#define FT_Get_Advance FPDFAPI_FT_Get_Advance
+#define FT_Library_SetLcdFilter FPDFAPI_FT_Library_SetLcdFilter
+
+#endif // !_FX_FREETYPE_DONT_RENAME_
diff --git a/core/include/thirdparties/freetype/freetype/config/ftconfig.h b/core/include/thirdparties/freetype/freetype/config/ftconfig.h
index e4eb4dcba2..b971d146ed 100644
--- a/core/include/thirdparties/freetype/freetype/config/ftconfig.h
+++ b/core/include/thirdparties/freetype/freetype/config/ftconfig.h
@@ -337,7 +337,7 @@ FT_BEGIN_HEADER
/* Provide assembler fragments for performance-critical functions. */
/* These must be defined `static __inline__' with GCC. */
- /**Johnson add !defined( __thumb__ )*/
+ /**Johnson add !defined( __thumb__ )*/
#if (defined( __CC_ARM ) || defined( __ARMCC__ ))&& !defined( __thumb__ ) /* RVCT */
#define FT_MULFIX_ASSEMBLER FT_MulFix_arm
diff --git a/core/include/thirdparties/freetype/freetype/freetype.h b/core/include/thirdparties/freetype/freetype/freetype.h
index 7a31923dd3..b6c77153a9 100644
--- a/core/include/thirdparties/freetype/freetype/freetype.h
+++ b/core/include/thirdparties/freetype/freetype/freetype.h
@@ -1,4016 +1,4016 @@
-/***************************************************************************/
-/* */
-/* freetype.h */
-/* */
-/* FreeType high-level API and common types (specification only). */
-/* */
-/* Copyright 1996-2013 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __FREETYPE_H__
-#define __FREETYPE_H__
-
-
-#ifndef FT_FREETYPE_H
-#error "`ft2build.h' hasn't been included yet!"
-#error "Please always use macros to include FreeType header files."
-#error "Example:"
-#error " #include <ft2build.h>"
-#error " #include FT_FREETYPE_H"
-#endif
-
-
-#include "../ft2build.h"
-#include "config/ftconfig.h"
-#include "fttypes.h"
-#include "fterrors.h"
-
-
-FT_BEGIN_HEADER
-
-
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* user_allocation */
- /* */
- /* <Title> */
- /* User allocation */
- /* */
- /* <Abstract> */
- /* How client applications should allocate FreeType data structures. */
- /* */
- /* <Description> */
- /* FreeType assumes that structures allocated by the user and passed */
- /* as arguments are zeroed out except for the actual data. In other */
- /* words, it is recommended to use `calloc' (or variants of it) */
- /* instead of `malloc' for allocation. */
- /* */
- /*************************************************************************/
-
-
-
- /*************************************************************************/
- /*************************************************************************/
- /* */
- /* B A S I C T Y P E S */
- /* */
- /*************************************************************************/
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* base_interface */
- /* */
- /* <Title> */
- /* Base Interface */
- /* */
- /* <Abstract> */
- /* The FreeType~2 base font interface. */
- /* */
- /* <Description> */
- /* This section describes the public high-level API of FreeType~2. */
- /* */
- /* <Order> */
- /* FT_Library */
- /* FT_Face */
- /* FT_Size */
- /* FT_GlyphSlot */
- /* FT_CharMap */
- /* FT_Encoding */
- /* */
- /* FT_FaceRec */
- /* */
- /* FT_FACE_FLAG_SCALABLE */
- /* FT_FACE_FLAG_FIXED_SIZES */
- /* FT_FACE_FLAG_FIXED_WIDTH */
- /* FT_FACE_FLAG_HORIZONTAL */
- /* FT_FACE_FLAG_VERTICAL */
- /* FT_FACE_FLAG_SFNT */
- /* FT_FACE_FLAG_KERNING */
- /* FT_FACE_FLAG_MULTIPLE_MASTERS */
- /* FT_FACE_FLAG_GLYPH_NAMES */
- /* FT_FACE_FLAG_EXTERNAL_STREAM */
- /* FT_FACE_FLAG_FAST_GLYPHS */
- /* FT_FACE_FLAG_HINTER */
- /* */
- /* FT_STYLE_FLAG_BOLD */
- /* FT_STYLE_FLAG_ITALIC */
- /* */
- /* FT_SizeRec */
- /* FT_Size_Metrics */
- /* */
- /* FT_GlyphSlotRec */
- /* FT_Glyph_Metrics */
- /* FT_SubGlyph */
- /* */
- /* FT_Bitmap_Size */
- /* */
- /* FT_Init_FreeType */
- /* FT_Done_FreeType */
- /* */
- /* FT_New_Face */
- /* FT_Done_Face */
- /* FT_New_Memory_Face */
- /* FT_Open_Face */
- /* FT_Open_Args */
- /* FT_Parameter */
- /* FT_Attach_File */
- /* FT_Attach_Stream */
- /* */
- /* FT_Set_Char_Size */
- /* FT_Set_Pixel_Sizes */
- /* FT_Request_Size */
- /* FT_Select_Size */
- /* FT_Size_Request_Type */
- /* FT_Size_Request */
- /* FT_Set_Transform */
- /* FT_Load_Glyph */
- /* FT_Get_Char_Index */
- /* FT_Get_Name_Index */
- /* FT_Load_Char */
- /* */
- /* FT_OPEN_MEMORY */
- /* FT_OPEN_STREAM */
- /* FT_OPEN_PATHNAME */
- /* FT_OPEN_DRIVER */
- /* FT_OPEN_PARAMS */
- /* */
- /* FT_LOAD_DEFAULT */
- /* FT_LOAD_RENDER */
- /* FT_LOAD_MONOCHROME */
- /* FT_LOAD_LINEAR_DESIGN */
- /* FT_LOAD_NO_SCALE */
- /* FT_LOAD_NO_HINTING */
- /* FT_LOAD_NO_BITMAP */
- /* FT_LOAD_CROP_BITMAP */
- /* */
- /* FT_LOAD_VERTICAL_LAYOUT */
- /* FT_LOAD_IGNORE_TRANSFORM */
- /* FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH */
- /* FT_LOAD_FORCE_AUTOHINT */
- /* FT_LOAD_NO_RECURSE */
- /* FT_LOAD_PEDANTIC */
- /* */
- /* FT_LOAD_TARGET_NORMAL */
- /* FT_LOAD_TARGET_LIGHT */
- /* FT_LOAD_TARGET_MONO */
- /* FT_LOAD_TARGET_LCD */
- /* FT_LOAD_TARGET_LCD_V */
- /* */
- /* FT_Render_Glyph */
- /* FT_Render_Mode */
- /* FT_Get_Kerning */
- /* FT_Kerning_Mode */
- /* FT_Get_Track_Kerning */
- /* FT_Get_Glyph_Name */
- /* FT_Get_Postscript_Name */
- /* */
- /* FT_CharMapRec */
- /* FT_Select_Charmap */
- /* FT_Set_Charmap */
- /* FT_Get_Charmap_Index */
- /* */
- /* FT_FSTYPE_INSTALLABLE_EMBEDDING */
- /* FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING */
- /* FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING */
- /* FT_FSTYPE_EDITABLE_EMBEDDING */
- /* FT_FSTYPE_NO_SUBSETTING */
- /* FT_FSTYPE_BITMAP_EMBEDDING_ONLY */
- /* */
- /* FT_Get_FSType_Flags */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Glyph_Metrics */
- /* */
- /* <Description> */
- /* A structure used to model the metrics of a single glyph. The */
- /* values are expressed in 26.6 fractional pixel format; if the flag */
- /* @FT_LOAD_NO_SCALE has been used while loading the glyph, values */
- /* are expressed in font units instead. */
- /* */
- /* <Fields> */
- /* width :: */
- /* The glyph's width. */
- /* */
- /* height :: */
- /* The glyph's height. */
- /* */
- /* horiBearingX :: */
- /* Left side bearing for horizontal layout. */
- /* */
- /* horiBearingY :: */
- /* Top side bearing for horizontal layout. */
- /* */
- /* horiAdvance :: */
- /* Advance width for horizontal layout. */
- /* */
- /* vertBearingX :: */
- /* Left side bearing for vertical layout. */
- /* */
- /* vertBearingY :: */
- /* Top side bearing for vertical layout. Larger positive values */
- /* mean further below the vertical glyph origin. */
- /* */
- /* vertAdvance :: */
- /* Advance height for vertical layout. Positive values mean the */
- /* glyph has a positive advance downward. */
- /* */
- /* <Note> */
- /* If not disabled with @FT_LOAD_NO_HINTING, the values represent */
- /* dimensions of the hinted glyph (in case hinting is applicable). */
- /* */
- /* Stroking a glyph with an outside border does not increase */
- /* `horiAdvance' or `vertAdvance'; you have to manually adjust these */
- /* values to account for the added width and height. */
- /* */
- typedef struct FT_Glyph_Metrics_
- {
- FT_Pos width;
- FT_Pos height;
-
- FT_Pos horiBearingX;
- FT_Pos horiBearingY;
- FT_Pos horiAdvance;
-
- FT_Pos vertBearingX;
- FT_Pos vertBearingY;
- FT_Pos vertAdvance;
-
- } FT_Glyph_Metrics;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Bitmap_Size */
- /* */
- /* <Description> */
- /* This structure models the metrics of a bitmap strike (i.e., a set */
- /* of glyphs for a given point size and resolution) in a bitmap font. */
- /* It is used for the `available_sizes' field of @FT_Face. */
- /* */
- /* <Fields> */
- /* height :: The vertical distance, in pixels, between two */
- /* consecutive baselines. It is always positive. */
- /* */
- /* width :: The average width, in pixels, of all glyphs in the */
- /* strike. */
- /* */
- /* size :: The nominal size of the strike in 26.6 fractional */
- /* points. This field is not very useful. */
- /* */
- /* x_ppem :: The horizontal ppem (nominal width) in 26.6 fractional */
- /* pixels. */
- /* */
- /* y_ppem :: The vertical ppem (nominal height) in 26.6 fractional */
- /* pixels. */
- /* */
- /* <Note> */
- /* Windows FNT: */
- /* The nominal size given in a FNT font is not reliable. Thus when */
- /* the driver finds it incorrect, it sets `size' to some calculated */
- /* values and sets `x_ppem' and `y_ppem' to the pixel width and */
- /* height given in the font, respectively. */
- /* */
- /* TrueType embedded bitmaps: */
- /* `size', `width', and `height' values are not contained in the */
- /* bitmap strike itself. They are computed from the global font */
- /* parameters. */
- /* */
- typedef struct FT_Bitmap_Size_
- {
- FT_Short height;
- FT_Short width;
-
- FT_Pos size;
-
- FT_Pos x_ppem;
- FT_Pos y_ppem;
-
- } FT_Bitmap_Size;
-
-
- /*************************************************************************/
- /*************************************************************************/
- /* */
- /* O B J E C T C L A S S E S */
- /* */
- /*************************************************************************/
- /*************************************************************************/
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Library */
- /* */
- /* <Description> */
- /* A handle to a FreeType library instance. Each `library' is */
- /* completely independent from the others; it is the `root' of a set */
- /* of objects like fonts, faces, sizes, etc. */
- /* */
- /* It also embeds a memory manager (see @FT_Memory), as well as a */
- /* scan-line converter object (see @FT_Raster). */
- /* */
- /* In multi-threaded applications, make sure that the same FT_Library */
- /* object or any of its children doesn't get accessed in parallel. */
- /* */
- /* <Note> */
- /* Library objects are normally created by @FT_Init_FreeType, and */
- /* destroyed with @FT_Done_FreeType. If you need reference-counting */
- /* (cf. @FT_Reference_Library), use @FT_New_Library and */
- /* @FT_Done_Library. */
- /* */
- typedef struct FT_LibraryRec_ *FT_Library;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Module */
- /* */
- /* <Description> */
- /* A handle to a given FreeType module object. Each module can be a */
- /* font driver, a renderer, or anything else that provides services */
- /* to the formers. */
- /* */
- typedef struct FT_ModuleRec_* FT_Module;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Driver */
- /* */
- /* <Description> */
- /* A handle to a given FreeType font driver object. Each font driver */
- /* is a special module capable of creating faces from font files. */
- /* */
- typedef struct FT_DriverRec_* FT_Driver;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Renderer */
- /* */
- /* <Description> */
- /* A handle to a given FreeType renderer. A renderer is a special */
- /* module in charge of converting a glyph image to a bitmap, when */
- /* necessary. Each renderer supports a given glyph image format, and */
- /* one or more target surface depths. */
- /* */
- typedef struct FT_RendererRec_* FT_Renderer;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Face */
- /* */
- /* <Description> */
- /* A handle to a given typographic face object. A face object models */
- /* a given typeface, in a given style. */
- /* */
- /* <Note> */
- /* Each face object also owns a single @FT_GlyphSlot object, as well */
- /* as one or more @FT_Size objects. */
- /* */
- /* Use @FT_New_Face or @FT_Open_Face to create a new face object from */
- /* a given filepathname or a custom input stream. */
- /* */
- /* Use @FT_Done_Face to destroy it (along with its slot and sizes). */
- /* */
- /* <Also> */
- /* See @FT_FaceRec for the publicly accessible fields of a given face */
- /* object. */
- /* */
- typedef struct FT_FaceRec_* FT_Face;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Size */
- /* */
- /* <Description> */
- /* A handle to an object used to model a face scaled to a given */
- /* character size. */
- /* */
- /* <Note> */
- /* Each @FT_Face has an _active_ @FT_Size object that is used by */
- /* functions like @FT_Load_Glyph to determine the scaling */
- /* transformation which is used to load and hint glyphs and metrics. */
- /* */
- /* You can use @FT_Set_Char_Size, @FT_Set_Pixel_Sizes, */
- /* @FT_Request_Size or even @FT_Select_Size to change the content */
- /* (i.e., the scaling values) of the active @FT_Size. */
- /* */
- /* You can use @FT_New_Size to create additional size objects for a */
- /* given @FT_Face, but they won't be used by other functions until */
- /* you activate it through @FT_Activate_Size. Only one size can be */
- /* activated at any given time per face. */
- /* */
- /* <Also> */
- /* See @FT_SizeRec for the publicly accessible fields of a given size */
- /* object. */
- /* */
- typedef struct FT_SizeRec_* FT_Size;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_GlyphSlot */
- /* */
- /* <Description> */
- /* A handle to a given `glyph slot'. A slot is a container where it */
- /* is possible to load any of the glyphs contained in its parent */
- /* face. */
- /* */
- /* In other words, each time you call @FT_Load_Glyph or */
- /* @FT_Load_Char, the slot's content is erased by the new glyph data, */
- /* i.e., the glyph's metrics, its image (bitmap or outline), and */
- /* other control information. */
- /* */
- /* <Also> */
- /* See @FT_GlyphSlotRec for the publicly accessible glyph fields. */
- /* */
- typedef struct FT_GlyphSlotRec_* FT_GlyphSlot;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_CharMap */
- /* */
- /* <Description> */
- /* A handle to a given character map. A charmap is used to translate */
- /* character codes in a given encoding into glyph indexes for its */
- /* parent's face. Some font formats may provide several charmaps per */
- /* font. */
- /* */
- /* Each face object owns zero or more charmaps, but only one of them */
- /* can be `active' and used by @FT_Get_Char_Index or @FT_Load_Char. */
- /* */
- /* The list of available charmaps in a face is available through the */
- /* `face->num_charmaps' and `face->charmaps' fields of @FT_FaceRec. */
- /* */
- /* The currently active charmap is available as `face->charmap'. */
- /* You should call @FT_Set_Charmap to change it. */
- /* */
- /* <Note> */
- /* When a new face is created (either through @FT_New_Face or */
- /* @FT_Open_Face), the library looks for a Unicode charmap within */
- /* the list and automatically activates it. */
- /* */
- /* <Also> */
- /* See @FT_CharMapRec for the publicly accessible fields of a given */
- /* character map. */
- /* */
- typedef struct FT_CharMapRec_* FT_CharMap;
-
-
- /*************************************************************************/
- /* */
- /* <Macro> */
- /* FT_ENC_TAG */
- /* */
- /* <Description> */
- /* This macro converts four-letter tags into an unsigned long. It is */
- /* used to define `encoding' identifiers (see @FT_Encoding). */
- /* */
- /* <Note> */
- /* Since many 16-bit compilers don't like 32-bit enumerations, you */
- /* should redefine this macro in case of problems to something like */
- /* this: */
- /* */
- /* { */
- /* #define FT_ENC_TAG( value, a, b, c, d ) value */
- /* } */
- /* */
- /* to get a simple enumeration without assigning special numbers. */
- /* */
-
-#ifndef FT_ENC_TAG
-#define FT_ENC_TAG( value, a, b, c, d ) \
- value = ( ( (FT_UInt32)(a) << 24 ) | \
- ( (FT_UInt32)(b) << 16 ) | \
- ( (FT_UInt32)(c) << 8 ) | \
- (FT_UInt32)(d) )
-
-#endif /* FT_ENC_TAG */
-
-
- /*************************************************************************/
- /* */
- /* <Enum> */
- /* FT_Encoding */
- /* */
- /* <Description> */
- /* An enumeration used to specify character sets supported by */
- /* charmaps. Used in the @FT_Select_Charmap API function. */
- /* */
- /* <Note> */
- /* Despite the name, this enumeration lists specific character */
- /* repertories (i.e., charsets), and not text encoding methods (e.g., */
- /* UTF-8, UTF-16, etc.). */
- /* */
- /* Other encodings might be defined in the future. */
- /* */
- /* <Values> */
- /* FT_ENCODING_NONE :: */
- /* The encoding value~0 is reserved. */
- /* */
- /* FT_ENCODING_UNICODE :: */
- /* Corresponds to the Unicode character set. This value covers */
- /* all versions of the Unicode repertoire, including ASCII and */
- /* Latin-1. Most fonts include a Unicode charmap, but not all */
- /* of them. */
- /* */
- /* For example, if you want to access Unicode value U+1F028 (and */
- /* the font contains it), use value 0x1F028 as the input value for */
- /* @FT_Get_Char_Index. */
- /* */
- /* FT_ENCODING_MS_SYMBOL :: */
- /* Corresponds to the Microsoft Symbol encoding, used to encode */
- /* mathematical symbols in the 32..255 character code range. For */
- /* more information, see `http://www.ceviz.net/symbol.htm'. */
- /* */
- /* FT_ENCODING_SJIS :: */
- /* Corresponds to Japanese SJIS encoding. More info at */
- /* at `http://langsupport.japanreference.com/encoding.shtml'. */
- /* See note on multi-byte encodings below. */
- /* */
- /* FT_ENCODING_GB2312 :: */
- /* Corresponds to an encoding system for Simplified Chinese as used */
- /* used in mainland China. */
- /* */
- /* FT_ENCODING_BIG5 :: */
- /* Corresponds to an encoding system for Traditional Chinese as */
- /* used in Taiwan and Hong Kong. */
- /* */
- /* FT_ENCODING_WANSUNG :: */
- /* Corresponds to the Korean encoding system known as Wansung. */
- /* For more information see */
- /* `http://www.microsoft.com/typography/unicode/949.txt'. */
- /* */
- /* FT_ENCODING_JOHAB :: */
- /* The Korean standard character set (KS~C 5601-1992), which */
- /* corresponds to MS Windows code page 1361. This character set */
- /* includes all possible Hangeul character combinations. */
- /* */
- /* FT_ENCODING_ADOBE_LATIN_1 :: */
- /* Corresponds to a Latin-1 encoding as defined in a Type~1 */
- /* PostScript font. It is limited to 256 character codes. */
- /* */
- /* FT_ENCODING_ADOBE_STANDARD :: */
- /* Corresponds to the Adobe Standard encoding, as found in Type~1, */
- /* CFF, and OpenType/CFF fonts. It is limited to 256 character */
- /* codes. */
- /* */
- /* FT_ENCODING_ADOBE_EXPERT :: */
- /* Corresponds to the Adobe Expert encoding, as found in Type~1, */
- /* CFF, and OpenType/CFF fonts. It is limited to 256 character */
- /* codes. */
- /* */
- /* FT_ENCODING_ADOBE_CUSTOM :: */
- /* Corresponds to a custom encoding, as found in Type~1, CFF, and */
- /* OpenType/CFF fonts. It is limited to 256 character codes. */
- /* */
- /* FT_ENCODING_APPLE_ROMAN :: */
- /* Corresponds to the 8-bit Apple roman encoding. Many TrueType */
- /* and OpenType fonts contain a charmap for this encoding, since */
- /* older versions of Mac OS are able to use it. */
- /* */
- /* FT_ENCODING_OLD_LATIN_2 :: */
- /* This value is deprecated and was never used nor reported by */
- /* FreeType. Don't use or test for it. */
- /* */
- /* FT_ENCODING_MS_SJIS :: */
- /* Same as FT_ENCODING_SJIS. Deprecated. */
- /* */
- /* FT_ENCODING_MS_GB2312 :: */
- /* Same as FT_ENCODING_GB2312. Deprecated. */
- /* */
- /* FT_ENCODING_MS_BIG5 :: */
- /* Same as FT_ENCODING_BIG5. Deprecated. */
- /* */
- /* FT_ENCODING_MS_WANSUNG :: */
- /* Same as FT_ENCODING_WANSUNG. Deprecated. */
- /* */
- /* FT_ENCODING_MS_JOHAB :: */
- /* Same as FT_ENCODING_JOHAB. Deprecated. */
- /* */
- /* <Note> */
- /* By default, FreeType automatically synthesizes a Unicode charmap */
- /* for PostScript fonts, using their glyph names dictionaries. */
- /* However, it also reports the encodings defined explicitly in the */
- /* font file, for the cases when they are needed, with the Adobe */
- /* values as well. */
- /* */
- /* FT_ENCODING_NONE is set by the BDF and PCF drivers if the charmap */
- /* is neither Unicode nor ISO-8859-1 (otherwise it is set to */
- /* FT_ENCODING_UNICODE). Use @FT_Get_BDF_Charset_ID to find out */
- /* which encoding is really present. If, for example, the */
- /* `cs_registry' field is `KOI8' and the `cs_encoding' field is `R', */
- /* the font is encoded in KOI8-R. */
- /* */
- /* FT_ENCODING_NONE is always set (with a single exception) by the */
- /* winfonts driver. Use @FT_Get_WinFNT_Header and examine the */
- /* `charset' field of the @FT_WinFNT_HeaderRec structure to find out */
- /* which encoding is really present. For example, */
- /* @FT_WinFNT_ID_CP1251 (204) means Windows code page 1251 (for */
- /* Russian). */
- /* */
- /* FT_ENCODING_NONE is set if `platform_id' is @TT_PLATFORM_MACINTOSH */
- /* and `encoding_id' is not @TT_MAC_ID_ROMAN (otherwise it is set to */
- /* FT_ENCODING_APPLE_ROMAN). */
- /* */
- /* If `platform_id' is @TT_PLATFORM_MACINTOSH, use the function */
- /* @FT_Get_CMap_Language_ID to query the Mac language ID which may */
- /* be needed to be able to distinguish Apple encoding variants. See */
- /* */
- /* http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/README.TXT */
- /* */
- /* to get an idea how to do that. Basically, if the language ID */
- /* is~0, don't use it, otherwise subtract 1 from the language ID. */
- /* Then examine `encoding_id'. If, for example, `encoding_id' is */
- /* @TT_MAC_ID_ROMAN and the language ID (minus~1) is */
- /* `TT_MAC_LANGID_GREEK', it is the Greek encoding, not Roman. */
- /* @TT_MAC_ID_ARABIC with `TT_MAC_LANGID_FARSI' means the Farsi */
- /* variant the Arabic encoding. */
- /* */
- typedef enum FT_Encoding_
- {
- FT_ENC_TAG( FT_ENCODING_NONE, 0, 0, 0, 0 ),
-
- FT_ENC_TAG( FT_ENCODING_MS_SYMBOL, 's', 'y', 'm', 'b' ),
- FT_ENC_TAG( FT_ENCODING_UNICODE, 'u', 'n', 'i', 'c' ),
-
- FT_ENC_TAG( FT_ENCODING_SJIS, 's', 'j', 'i', 's' ),
- FT_ENC_TAG( FT_ENCODING_GB2312, 'g', 'b', ' ', ' ' ),
- FT_ENC_TAG( FT_ENCODING_BIG5, 'b', 'i', 'g', '5' ),
- FT_ENC_TAG( FT_ENCODING_WANSUNG, 'w', 'a', 'n', 's' ),
- FT_ENC_TAG( FT_ENCODING_JOHAB, 'j', 'o', 'h', 'a' ),
-
- /* for backwards compatibility */
- FT_ENCODING_MS_SJIS = FT_ENCODING_SJIS,
- FT_ENCODING_MS_GB2312 = FT_ENCODING_GB2312,
- FT_ENCODING_MS_BIG5 = FT_ENCODING_BIG5,
- FT_ENCODING_MS_WANSUNG = FT_ENCODING_WANSUNG,
- FT_ENCODING_MS_JOHAB = FT_ENCODING_JOHAB,
-
- FT_ENC_TAG( FT_ENCODING_ADOBE_STANDARD, 'A', 'D', 'O', 'B' ),
- FT_ENC_TAG( FT_ENCODING_ADOBE_EXPERT, 'A', 'D', 'B', 'E' ),
- FT_ENC_TAG( FT_ENCODING_ADOBE_CUSTOM, 'A', 'D', 'B', 'C' ),
- FT_ENC_TAG( FT_ENCODING_ADOBE_LATIN_1, 'l', 'a', 't', '1' ),
-
- FT_ENC_TAG( FT_ENCODING_OLD_LATIN_2, 'l', 'a', 't', '2' ),
-
- FT_ENC_TAG( FT_ENCODING_APPLE_ROMAN, 'a', 'r', 'm', 'n' )
-
- } FT_Encoding;
-
-
- /*************************************************************************/
- /* */
- /* <Enum> */
- /* ft_encoding_xxx */
- /* */
- /* <Description> */
- /* These constants are deprecated; use the corresponding @FT_Encoding */
- /* values instead. */
- /* */
-#define ft_encoding_none FT_ENCODING_NONE
-#define ft_encoding_unicode FT_ENCODING_UNICODE
-#define ft_encoding_symbol FT_ENCODING_MS_SYMBOL
-#define ft_encoding_latin_1 FT_ENCODING_ADOBE_LATIN_1
-#define ft_encoding_latin_2 FT_ENCODING_OLD_LATIN_2
-#define ft_encoding_sjis FT_ENCODING_SJIS
-#define ft_encoding_gb2312 FT_ENCODING_GB2312
-#define ft_encoding_big5 FT_ENCODING_BIG5
-#define ft_encoding_wansung FT_ENCODING_WANSUNG
-#define ft_encoding_johab FT_ENCODING_JOHAB
-
-#define ft_encoding_adobe_standard FT_ENCODING_ADOBE_STANDARD
-#define ft_encoding_adobe_expert FT_ENCODING_ADOBE_EXPERT
-#define ft_encoding_adobe_custom FT_ENCODING_ADOBE_CUSTOM
-#define ft_encoding_apple_roman FT_ENCODING_APPLE_ROMAN
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_CharMapRec */
- /* */
- /* <Description> */
- /* The base charmap structure. */
- /* */
- /* <Fields> */
- /* face :: A handle to the parent face object. */
- /* */
- /* encoding :: An @FT_Encoding tag identifying the charmap. Use */
- /* this with @FT_Select_Charmap. */
- /* */
- /* platform_id :: An ID number describing the platform for the */
- /* following encoding ID. This comes directly from */
- /* the TrueType specification and should be emulated */
- /* for other formats. */
- /* */
- /* encoding_id :: A platform specific encoding number. This also */
- /* comes from the TrueType specification and should be */
- /* emulated similarly. */
- /* */
- typedef struct FT_CharMapRec_
- {
- FT_Face face;
- FT_Encoding encoding;
- FT_UShort platform_id;
- FT_UShort encoding_id;
-
- } FT_CharMapRec;
-
-
- /*************************************************************************/
- /*************************************************************************/
- /* */
- /* B A S E O B J E C T C L A S S E S */
- /* */
- /*************************************************************************/
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Face_Internal */
- /* */
- /* <Description> */
- /* An opaque handle to an `FT_Face_InternalRec' structure, used to */
- /* model private data of a given @FT_Face object. */
- /* */
- /* This structure might change between releases of FreeType~2 and is */
- /* not generally available to client applications. */
- /* */
- typedef struct FT_Face_InternalRec_* FT_Face_Internal;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_FaceRec */
- /* */
- /* <Description> */
- /* FreeType root face class structure. A face object models a */
- /* typeface in a font file. */
- /* */
- /* <Fields> */
- /* num_faces :: The number of faces in the font file. Some */
- /* font formats can have multiple faces in */
- /* a font file. */
- /* */
- /* face_index :: The index of the face in the font file. It */
- /* is set to~0 if there is only one face in */
- /* the font file. */
- /* */
- /* face_flags :: A set of bit flags that give important */
- /* information about the face; see */
- /* @FT_FACE_FLAG_XXX for the details. */
- /* */
- /* style_flags :: A set of bit flags indicating the style of */
- /* the face; see @FT_STYLE_FLAG_XXX for the */
- /* details. */
- /* */
- /* num_glyphs :: The number of glyphs in the face. If the */
- /* face is scalable and has sbits (see */
- /* `num_fixed_sizes'), it is set to the number */
- /* of outline glyphs. */
- /* */
- /* For CID-keyed fonts, this value gives the */
- /* highest CID used in the font. */
- /* */
- /* family_name :: The face's family name. This is an ASCII */
- /* string, usually in English, which describes */
- /* the typeface's family (like `Times New */
- /* Roman', `Bodoni', `Garamond', etc). This */
- /* is a least common denominator used to list */
- /* fonts. Some formats (TrueType & OpenType) */
- /* provide localized and Unicode versions of */
- /* this string. Applications should use the */
- /* format specific interface to access them. */
- /* Can be NULL (e.g., in fonts embedded in a */
- /* PDF file). */
- /* */
- /* style_name :: The face's style name. This is an ASCII */
- /* string, usually in English, which describes */
- /* the typeface's style (like `Italic', */
- /* `Bold', `Condensed', etc). Not all font */
- /* formats provide a style name, so this field */
- /* is optional, and can be set to NULL. As */
- /* for `family_name', some formats provide */
- /* localized and Unicode versions of this */
- /* string. Applications should use the format */
- /* specific interface to access them. */
- /* */
- /* num_fixed_sizes :: The number of bitmap strikes in the face. */
- /* Even if the face is scalable, there might */
- /* still be bitmap strikes, which are called */
- /* `sbits' in that case. */
- /* */
- /* available_sizes :: An array of @FT_Bitmap_Size for all bitmap */
- /* strikes in the face. It is set to NULL if */
- /* there is no bitmap strike. */
- /* */
- /* num_charmaps :: The number of charmaps in the face. */
- /* */
- /* charmaps :: An array of the charmaps of the face. */
- /* */
- /* generic :: A field reserved for client uses. See the */
- /* @FT_Generic type description. */
- /* */
- /* bbox :: The font bounding box. Coordinates are */
- /* expressed in font units (see */
- /* `units_per_EM'). The box is large enough */
- /* to contain any glyph from the font. Thus, */
- /* `bbox.yMax' can be seen as the `maximum */
- /* ascender', and `bbox.yMin' as the `minimum */
- /* descender'. Only relevant for scalable */
- /* formats. */
- /* */
- /* Note that the bounding box might be off by */
- /* (at least) one pixel for hinted fonts. See */
- /* @FT_Size_Metrics for further discussion. */
- /* */
- /* units_per_EM :: The number of font units per EM square for */
- /* this face. This is typically 2048 for */
- /* TrueType fonts, and 1000 for Type~1 fonts. */
- /* Only relevant for scalable formats. */
- /* */
- /* ascender :: The typographic ascender of the face, */
- /* expressed in font units. For font formats */
- /* not having this information, it is set to */
- /* `bbox.yMax'. Only relevant for scalable */
- /* formats. */
- /* */
- /* descender :: The typographic descender of the face, */
- /* expressed in font units. For font formats */
- /* not having this information, it is set to */
- /* `bbox.yMin'. Note that this field is */
- /* usually negative. Only relevant for */
- /* scalable formats. */
- /* */
- /* height :: This value is the vertical distance */
- /* between two consecutive baselines, */
- /* expressed in font units. It is always */
- /* positive. Only relevant for scalable */
- /* formats. */
- /* */
- /* If you want the global glyph height, use */
- /* `ascender - descender'. */
- /* */
- /* max_advance_width :: The maximum advance width, in font units, */
- /* for all glyphs in this face. This can be */
- /* used to make word wrapping computations */
- /* faster. Only relevant for scalable */
- /* formats. */
- /* */
- /* max_advance_height :: The maximum advance height, in font units, */
- /* for all glyphs in this face. This is only */
- /* relevant for vertical layouts, and is set */
- /* to `height' for fonts that do not provide */
- /* vertical metrics. Only relevant for */
- /* scalable formats. */
- /* */
- /* underline_position :: The position, in font units, of the */
- /* underline line for this face. It is the */
- /* center of the underlining stem. Only */
- /* relevant for scalable formats. */
- /* */
- /* underline_thickness :: The thickness, in font units, of the */
- /* underline for this face. Only relevant for */
- /* scalable formats. */
- /* */
- /* glyph :: The face's associated glyph slot(s). */
- /* */
- /* size :: The current active size for this face. */
- /* */
- /* charmap :: The current active charmap for this face. */
- /* */
- /* <Note> */
- /* Fields may be changed after a call to @FT_Attach_File or */
- /* @FT_Attach_Stream. */
- /* */
- typedef struct FT_FaceRec_
- {
- FT_Long num_faces;
- FT_Long face_index;
-
- FT_Long face_flags;
- FT_Long style_flags;
-
- FT_Long num_glyphs;
-
- FT_String* family_name;
- FT_String* style_name;
-
- FT_Int num_fixed_sizes;
- FT_Bitmap_Size* available_sizes;
-
- FT_Int num_charmaps;
- FT_CharMap* charmaps;
-
-#ifdef _FX_MANAGED_CODE_
-#define generic generic_data
-#endif
-
- FT_Generic generic;
-
- /*# The following member variables (down to `underline_thickness') */
- /*# are only relevant to scalable outlines; cf. @FT_Bitmap_Size */
- /*# for bitmap fonts. */
- FT_BBox bbox;
-
- FT_UShort units_per_EM;
- FT_Short ascender;
- FT_Short descender;
- FT_Short height;
-
- FT_Short max_advance_width;
- FT_Short max_advance_height;
-
- FT_Short underline_position;
- FT_Short underline_thickness;
-
- FT_GlyphSlot glyph;
- FT_Size size;
- FT_CharMap charmap;
-
- /*@private begin */
-
- FT_Driver driver;
- FT_Memory memory;
- FT_Stream stream;
-
- FT_ListRec sizes_list;
-
- FT_Generic autohint; /* face-specific auto-hinter data */
- void* extensions; /* unused */
-
- FT_Face_Internal internal;
-
- /*@private end */
-
- } FT_FaceRec;
-
-
- /*************************************************************************/
- /* */
- /* <Enum> */
- /* FT_FACE_FLAG_XXX */
- /* */
- /* <Description> */
- /* A list of bit flags used in the `face_flags' field of the */
- /* @FT_FaceRec structure. They inform client applications of */
- /* properties of the corresponding face. */
- /* */
- /* <Values> */
- /* FT_FACE_FLAG_SCALABLE :: */
- /* Indicates that the face contains outline glyphs. This doesn't */
- /* prevent bitmap strikes, i.e., a face can have both this and */
- /* and @FT_FACE_FLAG_FIXED_SIZES set. */
- /* */
- /* FT_FACE_FLAG_FIXED_SIZES :: */
- /* Indicates that the face contains bitmap strikes. See also the */
- /* `num_fixed_sizes' and `available_sizes' fields of @FT_FaceRec. */
- /* */
- /* FT_FACE_FLAG_FIXED_WIDTH :: */
- /* Indicates that the face contains fixed-width characters (like */
- /* Courier, Lucido, MonoType, etc.). */
- /* */
- /* FT_FACE_FLAG_SFNT :: */
- /* Indicates that the face uses the `sfnt' storage scheme. For */
- /* now, this means TrueType and OpenType. */
- /* */
- /* FT_FACE_FLAG_HORIZONTAL :: */
- /* Indicates that the face contains horizontal glyph metrics. This */
- /* should be set for all common formats. */
- /* */
- /* FT_FACE_FLAG_VERTICAL :: */
- /* Indicates that the face contains vertical glyph metrics. This */
- /* is only available in some formats, not all of them. */
- /* */
- /* FT_FACE_FLAG_KERNING :: */
- /* Indicates that the face contains kerning information. If set, */
- /* the kerning distance can be retrieved through the function */
- /* @FT_Get_Kerning. Otherwise the function always return the */
- /* vector (0,0). Note that FreeType doesn't handle kerning data */
- /* from the `GPOS' table (as present in some OpenType fonts). */
- /* */
- /* FT_FACE_FLAG_FAST_GLYPHS :: */
- /* THIS FLAG IS DEPRECATED. DO NOT USE OR TEST IT. */
- /* */
- /* FT_FACE_FLAG_MULTIPLE_MASTERS :: */
- /* Indicates that the font contains multiple masters and is capable */
- /* of interpolating between them. See the multiple-masters */
- /* specific API for details. */
- /* */
- /* FT_FACE_FLAG_GLYPH_NAMES :: */
- /* Indicates that the font contains glyph names that can be */
- /* retrieved through @FT_Get_Glyph_Name. Note that some TrueType */
- /* fonts contain broken glyph name tables. Use the function */
- /* @FT_Has_PS_Glyph_Names when needed. */
- /* */
- /* FT_FACE_FLAG_EXTERNAL_STREAM :: */
- /* Used internally by FreeType to indicate that a face's stream was */
- /* provided by the client application and should not be destroyed */
- /* when @FT_Done_Face is called. Don't read or test this flag. */
- /* */
- /* FT_FACE_FLAG_HINTER :: */
- /* Set if the font driver has a hinting machine of its own. For */
- /* example, with TrueType fonts, it makes sense to use data from */
- /* the SFNT `gasp' table only if the native TrueType hinting engine */
- /* (with the bytecode interpreter) is available and active. */
- /* */
- /* FT_FACE_FLAG_CID_KEYED :: */
- /* Set if the font is CID-keyed. In that case, the font is not */
- /* accessed by glyph indices but by CID values. For subsetted */
- /* CID-keyed fonts this has the consequence that not all index */
- /* values are a valid argument to FT_Load_Glyph. Only the CID */
- /* values for which corresponding glyphs in the subsetted font */
- /* exist make FT_Load_Glyph return successfully; in all other cases */
- /* you get an `FT_Err_Invalid_Argument' error. */
- /* */
- /* Note that CID-keyed fonts which are in an SFNT wrapper don't */
- /* have this flag set since the glyphs are accessed in the normal */
- /* way (using contiguous indices); the `CID-ness' isn't visible to */
- /* the application. */
- /* */
- /* FT_FACE_FLAG_TRICKY :: */
- /* Set if the font is `tricky', this is, it always needs the */
- /* font format's native hinting engine to get a reasonable result. */
- /* A typical example is the Chinese font `mingli.ttf' which uses */
- /* TrueType bytecode instructions to move and scale all of its */
- /* subglyphs. */
- /* */
- /* It is not possible to autohint such fonts using */
- /* @FT_LOAD_FORCE_AUTOHINT; it will also ignore */
- /* @FT_LOAD_NO_HINTING. You have to set both @FT_LOAD_NO_HINTING */
- /* and @FT_LOAD_NO_AUTOHINT to really disable hinting; however, you */
- /* probably never want this except for demonstration purposes. */
- /* */
- /* Currently, there are about a dozen TrueType fonts in the list of */
- /* tricky fonts; they are hard-coded in file `ttobjs.c'. */
- /* */
-#define FT_FACE_FLAG_SCALABLE ( 1L << 0 )
-#define FT_FACE_FLAG_FIXED_SIZES ( 1L << 1 )
-#define FT_FACE_FLAG_FIXED_WIDTH ( 1L << 2 )
-#define FT_FACE_FLAG_SFNT ( 1L << 3 )
-#define FT_FACE_FLAG_HORIZONTAL ( 1L << 4 )
-#define FT_FACE_FLAG_VERTICAL ( 1L << 5 )
-#define FT_FACE_FLAG_KERNING ( 1L << 6 )
-#define FT_FACE_FLAG_FAST_GLYPHS ( 1L << 7 )
-#define FT_FACE_FLAG_MULTIPLE_MASTERS ( 1L << 8 )
-#define FT_FACE_FLAG_GLYPH_NAMES ( 1L << 9 )
-#define FT_FACE_FLAG_EXTERNAL_STREAM ( 1L << 10 )
-#define FT_FACE_FLAG_HINTER ( 1L << 11 )
-#define FT_FACE_FLAG_CID_KEYED ( 1L << 12 )
-#define FT_FACE_FLAG_TRICKY ( 1L << 13 )
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_HAS_HORIZONTAL( face )
- *
- * @description:
- * A macro that returns true whenever a face object contains
- * horizontal metrics (this is true for all font formats though).
- *
- * @also:
- * @FT_HAS_VERTICAL can be used to check for vertical metrics.
- *
- */
-#define FT_HAS_HORIZONTAL( face ) \
- ( face->face_flags & FT_FACE_FLAG_HORIZONTAL )
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_HAS_VERTICAL( face )
- *
- * @description:
- * A macro that returns true whenever a face object contains real
- * vertical metrics (and not only synthesized ones).
- *
- */
-#define FT_HAS_VERTICAL( face ) \
- ( face->face_flags & FT_FACE_FLAG_VERTICAL )
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_HAS_KERNING( face )
- *
- * @description:
- * A macro that returns true whenever a face object contains kerning
- * data that can be accessed with @FT_Get_Kerning.
- *
- */
-#define FT_HAS_KERNING( face ) \
- ( face->face_flags & FT_FACE_FLAG_KERNING )
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_IS_SCALABLE( face )
- *
- * @description:
- * A macro that returns true whenever a face object contains a scalable
- * font face (true for TrueType, Type~1, Type~42, CID, OpenType/CFF,
- * and PFR font formats.
- *
- */
-#define FT_IS_SCALABLE( face ) \
- ( face->face_flags & FT_FACE_FLAG_SCALABLE )
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_IS_SFNT( face )
- *
- * @description:
- * A macro that returns true whenever a face object contains a font
- * whose format is based on the SFNT storage scheme. This usually
- * means: TrueType fonts, OpenType fonts, as well as SFNT-based embedded
- * bitmap fonts.
- *
- * If this macro is true, all functions defined in @FT_SFNT_NAMES_H and
- * @FT_TRUETYPE_TABLES_H are available.
- *
- */
-#define FT_IS_SFNT( face ) \
- ( face->face_flags & FT_FACE_FLAG_SFNT )
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_IS_FIXED_WIDTH( face )
- *
- * @description:
- * A macro that returns true whenever a face object contains a font face
- * that contains fixed-width (or `monospace', `fixed-pitch', etc.)
- * glyphs.
- *
- */
-#define FT_IS_FIXED_WIDTH( face ) \
- ( face->face_flags & FT_FACE_FLAG_FIXED_WIDTH )
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_HAS_FIXED_SIZES( face )
- *
- * @description:
- * A macro that returns true whenever a face object contains some
- * embedded bitmaps. See the `available_sizes' field of the
- * @FT_FaceRec structure.
- *
- */
-#define FT_HAS_FIXED_SIZES( face ) \
- ( face->face_flags & FT_FACE_FLAG_FIXED_SIZES )
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_HAS_FAST_GLYPHS( face )
- *
- * @description:
- * Deprecated.
- *
- */
-#define FT_HAS_FAST_GLYPHS( face ) 0
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_HAS_GLYPH_NAMES( face )
- *
- * @description:
- * A macro that returns true whenever a face object contains some glyph
- * names that can be accessed through @FT_Get_Glyph_Name.
- *
- */
-#define FT_HAS_GLYPH_NAMES( face ) \
- ( face->face_flags & FT_FACE_FLAG_GLYPH_NAMES )
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_HAS_MULTIPLE_MASTERS( face )
- *
- * @description:
- * A macro that returns true whenever a face object contains some
- * multiple masters. The functions provided by @FT_MULTIPLE_MASTERS_H
- * are then available to choose the exact design you want.
- *
- */
-#define FT_HAS_MULTIPLE_MASTERS( face ) \
- ( face->face_flags & FT_FACE_FLAG_MULTIPLE_MASTERS )
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_IS_CID_KEYED( face )
- *
- * @description:
- * A macro that returns true whenever a face object contains a CID-keyed
- * font. See the discussion of @FT_FACE_FLAG_CID_KEYED for more
- * details.
- *
- * If this macro is true, all functions defined in @FT_CID_H are
- * available.
- *
- */
-#define FT_IS_CID_KEYED( face ) \
- ( face->face_flags & FT_FACE_FLAG_CID_KEYED )
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_IS_TRICKY( face )
- *
- * @description:
- * A macro that returns true whenever a face represents a `tricky' font.
- * See the discussion of @FT_FACE_FLAG_TRICKY for more details.
- *
- */
-#define FT_IS_TRICKY( face ) \
- ( face->face_flags & FT_FACE_FLAG_TRICKY )
-
-
- /*************************************************************************/
- /* */
- /* <Const> */
- /* FT_STYLE_FLAG_XXX */
- /* */
- /* <Description> */
- /* A list of bit-flags used to indicate the style of a given face. */
- /* These are used in the `style_flags' field of @FT_FaceRec. */
- /* */
- /* <Values> */
- /* FT_STYLE_FLAG_ITALIC :: */
- /* Indicates that a given face style is italic or oblique. */
- /* */
- /* FT_STYLE_FLAG_BOLD :: */
- /* Indicates that a given face is bold. */
- /* */
- /* <Note> */
- /* The style information as provided by FreeType is very basic. More */
- /* details are beyond the scope and should be done on a higher level */
- /* (for example, by analyzing various fields of the `OS/2' table in */
- /* SFNT based fonts). */
- /* */
-#define FT_STYLE_FLAG_ITALIC ( 1 << 0 )
-#define FT_STYLE_FLAG_BOLD ( 1 << 1 )
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Size_Internal */
- /* */
- /* <Description> */
- /* An opaque handle to an `FT_Size_InternalRec' structure, used to */
- /* model private data of a given @FT_Size object. */
- /* */
- typedef struct FT_Size_InternalRec_* FT_Size_Internal;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Size_Metrics */
- /* */
- /* <Description> */
- /* The size metrics structure gives the metrics of a size object. */
- /* */
- /* <Fields> */
- /* x_ppem :: The width of the scaled EM square in pixels, hence */
- /* the term `ppem' (pixels per EM). It is also */
- /* referred to as `nominal width'. */
- /* */
- /* y_ppem :: The height of the scaled EM square in pixels, */
- /* hence the term `ppem' (pixels per EM). It is also */
- /* referred to as `nominal height'. */
- /* */
- /* x_scale :: A 16.16 fractional scaling value used to convert */
- /* horizontal metrics from font units to 26.6 */
- /* fractional pixels. Only relevant for scalable */
- /* font formats. */
- /* */
- /* y_scale :: A 16.16 fractional scaling value used to convert */
- /* vertical metrics from font units to 26.6 */
- /* fractional pixels. Only relevant for scalable */
- /* font formats. */
- /* */
- /* ascender :: The ascender in 26.6 fractional pixels. See */
- /* @FT_FaceRec for the details. */
- /* */
- /* descender :: The descender in 26.6 fractional pixels. See */
- /* @FT_FaceRec for the details. */
- /* */
- /* height :: The height in 26.6 fractional pixels. See */
- /* @FT_FaceRec for the details. */
- /* */
- /* max_advance :: The maximum advance width in 26.6 fractional */
- /* pixels. See @FT_FaceRec for the details. */
- /* */
- /* <Note> */
- /* The scaling values, if relevant, are determined first during a */
- /* size changing operation. The remaining fields are then set by the */
- /* driver. For scalable formats, they are usually set to scaled */
- /* values of the corresponding fields in @FT_FaceRec. */
- /* */
- /* Note that due to glyph hinting, these values might not be exact */
- /* for certain fonts. Thus they must be treated as unreliable */
- /* with an error margin of at least one pixel! */
- /* */
- /* Indeed, the only way to get the exact metrics is to render _all_ */
- /* glyphs. As this would be a definite performance hit, it is up to */
- /* client applications to perform such computations. */
- /* */
- /* The FT_Size_Metrics structure is valid for bitmap fonts also. */
- /* */
- typedef struct FT_Size_Metrics_
- {
- FT_UShort x_ppem; /* horizontal pixels per EM */
- FT_UShort y_ppem; /* vertical pixels per EM */
-
- FT_Fixed x_scale; /* scaling values used to convert font */
- FT_Fixed y_scale; /* units to 26.6 fractional pixels */
-
- FT_Pos ascender; /* ascender in 26.6 frac. pixels */
- FT_Pos descender; /* descender in 26.6 frac. pixels */
- FT_Pos height; /* text height in 26.6 frac. pixels */
- FT_Pos max_advance; /* max horizontal advance, in 26.6 pixels */
-
- } FT_Size_Metrics;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_SizeRec */
- /* */
- /* <Description> */
- /* FreeType root size class structure. A size object models a face */
- /* object at a given size. */
- /* */
- /* <Fields> */
- /* face :: Handle to the parent face object. */
- /* */
- /* generic :: A typeless pointer, which is unused by the FreeType */
- /* library or any of its drivers. It can be used by */
- /* client applications to link their own data to each size */
- /* object. */
- /* */
- /* metrics :: Metrics for this size object. This field is read-only. */
- /* */
- typedef struct FT_SizeRec_
- {
- FT_Face face; /* parent face object */
- FT_Generic generic; /* generic pointer for client uses */
- FT_Size_Metrics metrics; /* size metrics */
- FT_Size_Internal internal;
-
- } FT_SizeRec;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_SubGlyph */
- /* */
- /* <Description> */
- /* The subglyph structure is an internal object used to describe */
- /* subglyphs (for example, in the case of composites). */
- /* */
- /* <Note> */
- /* The subglyph implementation is not part of the high-level API, */
- /* hence the forward structure declaration. */
- /* */
- /* You can however retrieve subglyph information with */
- /* @FT_Get_SubGlyph_Info. */
- /* */
- typedef struct FT_SubGlyphRec_* FT_SubGlyph;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* FT_Slot_Internal */
- /* */
- /* <Description> */
- /* An opaque handle to an `FT_Slot_InternalRec' structure, used to */
- /* model private data of a given @FT_GlyphSlot object. */
- /* */
- typedef struct FT_Slot_InternalRec_* FT_Slot_Internal;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_GlyphSlotRec */
- /* */
- /* <Description> */
- /* FreeType root glyph slot class structure. A glyph slot is a */
- /* container where individual glyphs can be loaded, be they in */
- /* outline or bitmap format. */
- /* */
- /* <Fields> */
- /* library :: A handle to the FreeType library instance */
- /* this slot belongs to. */
- /* */
- /* face :: A handle to the parent face object. */
- /* */
- /* next :: In some cases (like some font tools), several */
- /* glyph slots per face object can be a good */
- /* thing. As this is rare, the glyph slots are */
- /* listed through a direct, single-linked list */
- /* using its `next' field. */
- /* */
- /* generic :: A typeless pointer which is unused by the */
- /* FreeType library or any of its drivers. It */
- /* can be used by client applications to link */
- /* their own data to each glyph slot object. */
- /* */
- /* metrics :: The metrics of the last loaded glyph in the */
- /* slot. The returned values depend on the last */
- /* load flags (see the @FT_Load_Glyph API */
- /* function) and can be expressed either in 26.6 */
- /* fractional pixels or font units. */
- /* */
- /* Note that even when the glyph image is */
- /* transformed, the metrics are not. */
- /* */
- /* linearHoriAdvance :: The advance width of the unhinted glyph. */
- /* Its value is expressed in 16.16 fractional */
- /* pixels, unless @FT_LOAD_LINEAR_DESIGN is set */
- /* when loading the glyph. This field can be */
- /* important to perform correct WYSIWYG layout. */
- /* Only relevant for outline glyphs. */
- /* */
- /* linearVertAdvance :: The advance height of the unhinted glyph. */
- /* Its value is expressed in 16.16 fractional */
- /* pixels, unless @FT_LOAD_LINEAR_DESIGN is set */
- /* when loading the glyph. This field can be */
- /* important to perform correct WYSIWYG layout. */
- /* Only relevant for outline glyphs. */
- /* */
- /* advance :: This shorthand is, depending on */
- /* @FT_LOAD_IGNORE_TRANSFORM, the transformed */
- /* advance width for the glyph (in 26.6 */
- /* fractional pixel format). As specified with */
- /* @FT_LOAD_VERTICAL_LAYOUT, it uses either the */
- /* `horiAdvance' or the `vertAdvance' value of */
- /* `metrics' field. */
- /* */
- /* format :: This field indicates the format of the image */
- /* contained in the glyph slot. Typically */
- /* @FT_GLYPH_FORMAT_BITMAP, */
- /* @FT_GLYPH_FORMAT_OUTLINE, or */
- /* @FT_GLYPH_FORMAT_COMPOSITE, but others are */
- /* possible. */
- /* */
- /* bitmap :: This field is used as a bitmap descriptor */
- /* when the slot format is */
- /* @FT_GLYPH_FORMAT_BITMAP. Note that the */
- /* address and content of the bitmap buffer can */
- /* change between calls of @FT_Load_Glyph and a */
- /* few other functions. */
- /* */
- /* bitmap_left :: This is the bitmap's left bearing expressed */
- /* in integer pixels. Of course, this is only */
- /* valid if the format is */
- /* @FT_GLYPH_FORMAT_BITMAP. */
- /* */
- /* bitmap_top :: This is the bitmap's top bearing expressed in */
- /* integer pixels. Remember that this is the */
- /* distance from the baseline to the top-most */
- /* glyph scanline, upwards y~coordinates being */
- /* *positive*. */
- /* */
- /* outline :: The outline descriptor for the current glyph */
- /* image if its format is */
- /* @FT_GLYPH_FORMAT_OUTLINE. Once a glyph is */
- /* loaded, `outline' can be transformed, */
- /* distorted, embolded, etc. However, it must */
- /* not be freed. */
- /* */
- /* num_subglyphs :: The number of subglyphs in a composite glyph. */
- /* This field is only valid for the composite */
- /* glyph format that should normally only be */
- /* loaded with the @FT_LOAD_NO_RECURSE flag. */
- /* For now this is internal to FreeType. */
- /* */
- /* subglyphs :: An array of subglyph descriptors for */
- /* composite glyphs. There are `num_subglyphs' */
- /* elements in there. Currently internal to */
- /* FreeType. */
- /* */
- /* control_data :: Certain font drivers can also return the */
- /* control data for a given glyph image (e.g. */
- /* TrueType bytecode, Type~1 charstrings, etc.). */
- /* This field is a pointer to such data. */
- /* */
- /* control_len :: This is the length in bytes of the control */
- /* data. */
- /* */
- /* other :: Really wicked formats can use this pointer to */
- /* present their own glyph image to client */
- /* applications. Note that the application */
- /* needs to know about the image format. */
- /* */
- /* lsb_delta :: The difference between hinted and unhinted */
- /* left side bearing while autohinting is */
- /* active. Zero otherwise. */
- /* */
- /* rsb_delta :: The difference between hinted and unhinted */
- /* right side bearing while autohinting is */
- /* active. Zero otherwise. */
- /* */
- /* <Note> */
- /* If @FT_Load_Glyph is called with default flags (see */
- /* @FT_LOAD_DEFAULT) the glyph image is loaded in the glyph slot in */
- /* its native format (e.g., an outline glyph for TrueType and Type~1 */
- /* formats). */
- /* */
- /* This image can later be converted into a bitmap by calling */
- /* @FT_Render_Glyph. This function finds the current renderer for */
- /* the native image's format, then invokes it. */
- /* */
- /* The renderer is in charge of transforming the native image through */
- /* the slot's face transformation fields, then converting it into a */
- /* bitmap that is returned in `slot->bitmap'. */
- /* */
- /* Note that `slot->bitmap_left' and `slot->bitmap_top' are also used */
- /* to specify the position of the bitmap relative to the current pen */
- /* position (e.g., coordinates (0,0) on the baseline). Of course, */
- /* `slot->format' is also changed to @FT_GLYPH_FORMAT_BITMAP. */
- /* */
- /* <Note> */
- /* Here a small pseudo code fragment which shows how to use */
- /* `lsb_delta' and `rsb_delta': */
- /* */
- /* { */
- /* FT_Pos origin_x = 0; */
- /* FT_Pos prev_rsb_delta = 0; */
- /* */
- /* */
- /* for all glyphs do */
- /* <compute kern between current and previous glyph and add it to */
- /* `origin_x'> */
- /* */
- /* <load glyph with `FT_Load_Glyph'> */
- /* */
- /* if ( prev_rsb_delta - face->glyph->lsb_delta >= 32 ) */
- /* origin_x -= 64; */
- /* else if ( prev_rsb_delta - face->glyph->lsb_delta < -32 ) */
- /* origin_x += 64; */
- /* */
- /* prev_rsb_delta = face->glyph->rsb_delta; */
- /* */
- /* <save glyph image, or render glyph, or ...> */
- /* */
- /* origin_x += face->glyph->advance.x; */
- /* endfor */
- /* } */
- /* */
- typedef struct FT_GlyphSlotRec_
- {
- FT_Library library;
- FT_Face face;
- FT_GlyphSlot next;
- FT_UInt reserved; /* retained for binary compatibility */
- FT_Generic generic;
-
- FT_Glyph_Metrics metrics;
- FT_Fixed linearHoriAdvance;
- FT_Fixed linearVertAdvance;
- FT_Vector advance;
-
- FT_Glyph_Format format;
-
- FT_Bitmap bitmap;
- FT_Int bitmap_left;
- FT_Int bitmap_top;
-
- FT_Outline outline;
-
- FT_UInt num_subglyphs;
- FT_SubGlyph subglyphs;
-
- void* control_data;
- long control_len;
-
- FT_Pos lsb_delta;
- FT_Pos rsb_delta;
-
- void* other;
-
- FT_Slot_Internal internal;
-
- } FT_GlyphSlotRec;
-
-
- /*************************************************************************/
- /*************************************************************************/
- /* */
- /* F U N C T I O N S */
- /* */
- /*************************************************************************/
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Init_FreeType */
- /* */
- /* <Description> */
- /* Initialize a new FreeType library object. The set of modules */
- /* that are registered by this function is determined at build time. */
- /* */
- /* <Output> */
- /* alibrary :: A handle to a new library object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* In case you want to provide your own memory allocating routines, */
- /* use @FT_New_Library instead, followed by a call to */
- /* @FT_Add_Default_Modules (or a series of calls to @FT_Add_Module). */
- /* */
- /* For multi-threading applications each thread should have its own */
- /* FT_Library object. */
- /* */
- /* If you need reference-counting (cf. @FT_Reference_Library), use */
- /* @FT_New_Library and @FT_Done_Library. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Init_FreeType( FT_Library *alibrary );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Done_FreeType */
- /* */
- /* <Description> */
- /* Destroy a given FreeType library object and all of its children, */
- /* including resources, drivers, faces, sizes, etc. */
- /* */
- /* <Input> */
- /* library :: A handle to the target library object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Done_FreeType( FT_Library library );
-
-
- /*************************************************************************/
- /* */
- /* <Enum> */
- /* FT_OPEN_XXX */
- /* */
- /* <Description> */
- /* A list of bit-field constants used within the `flags' field of the */
- /* @FT_Open_Args structure. */
- /* */
- /* <Values> */
- /* FT_OPEN_MEMORY :: This is a memory-based stream. */
- /* */
- /* FT_OPEN_STREAM :: Copy the stream from the `stream' field. */
- /* */
- /* FT_OPEN_PATHNAME :: Create a new input stream from a C~path */
- /* name. */
- /* */
- /* FT_OPEN_DRIVER :: Use the `driver' field. */
- /* */
- /* FT_OPEN_PARAMS :: Use the `num_params' and `params' fields. */
- /* */
- /* ft_open_memory :: Deprecated; use @FT_OPEN_MEMORY instead. */
- /* */
- /* ft_open_stream :: Deprecated; use @FT_OPEN_STREAM instead. */
- /* */
- /* ft_open_pathname :: Deprecated; use @FT_OPEN_PATHNAME instead. */
- /* */
- /* ft_open_driver :: Deprecated; use @FT_OPEN_DRIVER instead. */
- /* */
- /* ft_open_params :: Deprecated; use @FT_OPEN_PARAMS instead. */
- /* */
- /* <Note> */
- /* The `FT_OPEN_MEMORY', `FT_OPEN_STREAM', and `FT_OPEN_PATHNAME' */
- /* flags are mutually exclusive. */
- /* */
-#define FT_OPEN_MEMORY 0x1
-#define FT_OPEN_STREAM 0x2
-#define FT_OPEN_PATHNAME 0x4
-#define FT_OPEN_DRIVER 0x8
-#define FT_OPEN_PARAMS 0x10
-
-#define ft_open_memory FT_OPEN_MEMORY /* deprecated */
-#define ft_open_stream FT_OPEN_STREAM /* deprecated */
-#define ft_open_pathname FT_OPEN_PATHNAME /* deprecated */
-#define ft_open_driver FT_OPEN_DRIVER /* deprecated */
-#define ft_open_params FT_OPEN_PARAMS /* deprecated */
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Parameter */
- /* */
- /* <Description> */
- /* A simple structure used to pass more or less generic parameters to */
- /* @FT_Open_Face. */
- /* */
- /* <Fields> */
- /* tag :: A four-byte identification tag. */
- /* */
- /* data :: A pointer to the parameter data. */
- /* */
- /* <Note> */
- /* The ID and function of parameters are driver-specific. See the */
- /* various FT_PARAM_TAG_XXX flags for more information. */
- /* */
- typedef struct FT_Parameter_
- {
- FT_ULong tag;
- FT_Pointer data;
-
- } FT_Parameter;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Open_Args */
- /* */
- /* <Description> */
- /* A structure used to indicate how to open a new font file or */
- /* stream. A pointer to such a structure can be used as a parameter */
- /* for the functions @FT_Open_Face and @FT_Attach_Stream. */
- /* */
- /* <Fields> */
- /* flags :: A set of bit flags indicating how to use the */
- /* structure. */
- /* */
- /* memory_base :: The first byte of the file in memory. */
- /* */
- /* memory_size :: The size in bytes of the file in memory. */
- /* */
- /* pathname :: A pointer to an 8-bit file pathname. */
- /* */
- /* stream :: A handle to a source stream object. */
- /* */
- /* driver :: This field is exclusively used by @FT_Open_Face; */
- /* it simply specifies the font driver to use to open */
- /* the face. If set to~0, FreeType tries to load the */
- /* face with each one of the drivers in its list. */
- /* */
- /* num_params :: The number of extra parameters. */
- /* */
- /* params :: Extra parameters passed to the font driver when */
- /* opening a new face. */
- /* */
- /* <Note> */
- /* The stream type is determined by the contents of `flags' which */
- /* are tested in the following order by @FT_Open_Face: */
- /* */
- /* If the `FT_OPEN_MEMORY' bit is set, assume that this is a */
- /* memory file of `memory_size' bytes, located at `memory_address'. */
- /* The data are are not copied, and the client is responsible for */
- /* releasing and destroying them _after_ the corresponding call to */
- /* @FT_Done_Face. */
- /* */
- /* Otherwise, if the `FT_OPEN_STREAM' bit is set, assume that a */
- /* custom input stream `stream' is used. */
- /* */
- /* Otherwise, if the `FT_OPEN_PATHNAME' bit is set, assume that this */
- /* is a normal file and use `pathname' to open it. */
- /* */
- /* If the `FT_OPEN_DRIVER' bit is set, @FT_Open_Face only tries to */
- /* open the file with the driver whose handler is in `driver'. */
- /* */
- /* If the `FT_OPEN_PARAMS' bit is set, the parameters given by */
- /* `num_params' and `params' is used. They are ignored otherwise. */
- /* */
- /* Ideally, both the `pathname' and `params' fields should be tagged */
- /* as `const'; this is missing for API backwards compatibility. In */
- /* other words, applications should treat them as read-only. */
- /* */
- typedef struct FT_Open_Args_
- {
- FT_UInt flags;
- const FT_Byte* memory_base;
- FT_Long memory_size;
- FT_String* pathname;
- FT_Stream stream;
- FT_Module driver;
- FT_Int num_params;
- FT_Parameter* params;
-
- } FT_Open_Args;
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_New_Face */
- /* */
- /* <Description> */
- /* This function calls @FT_Open_Face to open a font by its pathname. */
- /* */
- /* <InOut> */
- /* library :: A handle to the library resource. */
- /* */
- /* <Input> */
- /* pathname :: A path to the font file. */
- /* */
- /* face_index :: The index of the face within the font. The first */
- /* face has index~0. */
- /* */
- /* <Output> */
- /* aface :: A handle to a new face object. If `face_index' is */
- /* greater than or equal to zero, it must be non-NULL. */
- /* See @FT_Open_Face for more details. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* Use @FT_Done_Face to destroy the created @FT_Face object (along */
- /* with its slot and sizes). */
- /* */
- FT_EXPORT( FT_Error )
- FT_New_Face( FT_Library library,
- const char* filepathname,
- FT_Long face_index,
- FT_Face *aface );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_New_Memory_Face */
- /* */
- /* <Description> */
- /* This function calls @FT_Open_Face to open a font which has been */
- /* loaded into memory. */
- /* */
- /* <InOut> */
- /* library :: A handle to the library resource. */
- /* */
- /* <Input> */
- /* file_base :: A pointer to the beginning of the font data. */
- /* */
- /* file_size :: The size of the memory chunk used by the font data. */
- /* */
- /* face_index :: The index of the face within the font. The first */
- /* face has index~0. */
- /* */
- /* <Output> */
- /* aface :: A handle to a new face object. If `face_index' is */
- /* greater than or equal to zero, it must be non-NULL. */
- /* See @FT_Open_Face for more details. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* You must not deallocate the memory before calling @FT_Done_Face. */
- /* */
- FT_EXPORT( FT_Error )
- FT_New_Memory_Face( FT_Library library,
- const FT_Byte* file_base,
- FT_Long file_size,
- FT_Long face_index,
- FT_Face *aface );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Open_Face */
- /* */
- /* <Description> */
- /* Create a face object from a given resource described by */
- /* @FT_Open_Args. */
- /* */
- /* <InOut> */
- /* library :: A handle to the library resource. */
- /* */
- /* <Input> */
- /* args :: A pointer to an `FT_Open_Args' structure which must */
- /* be filled by the caller. */
- /* */
- /* face_index :: The index of the face within the font. The first */
- /* face has index~0. */
- /* */
- /* <Output> */
- /* aface :: A handle to a new face object. If `face_index' is */
- /* greater than or equal to zero, it must be non-NULL. */
- /* See note below. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* Unlike FreeType 1.x, this function automatically creates a glyph */
- /* slot for the face object which can be accessed directly through */
- /* `face->glyph'. */
- /* */
- /* FT_Open_Face can be used to quickly check whether the font */
- /* format of a given font resource is supported by FreeType. If the */
- /* `face_index' field is negative, the function's return value is~0 */
- /* if the font format is recognized, or non-zero otherwise; */
- /* the function returns a more or less empty face handle in `*aface' */
- /* (if `aface' isn't NULL). The only useful field in this special */
- /* case is `face->num_faces' which gives the number of faces within */
- /* the font file. After examination, the returned @FT_Face structure */
- /* should be deallocated with a call to @FT_Done_Face. */
- /* */
- /* Each new face object created with this function also owns a */
- /* default @FT_Size object, accessible as `face->size'. */
- /* */
- /* One @FT_Library instance can have multiple face objects, this is, */
- /* @FT_Open_Face and its siblings can be called multiple times using */
- /* the same `library' argument. */
- /* */
- /* See the discussion of reference counters in the description of */
- /* @FT_Reference_Face. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Open_Face( FT_Library library,
- const FT_Open_Args* args,
- FT_Long face_index,
- FT_Face *aface );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Attach_File */
- /* */
- /* <Description> */
- /* This function calls @FT_Attach_Stream to attach a file. */
- /* */
- /* <InOut> */
- /* face :: The target face object. */
- /* */
- /* <Input> */
- /* filepathname :: The pathname. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Attach_File( FT_Face face,
- const char* filepathname );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Attach_Stream */
- /* */
- /* <Description> */
- /* `Attach' data to a face object. Normally, this is used to read */
- /* additional information for the face object. For example, you can */
- /* attach an AFM file that comes with a Type~1 font to get the */
- /* kerning values and other metrics. */
- /* */
- /* <InOut> */
- /* face :: The target face object. */
- /* */
- /* <Input> */
- /* parameters :: A pointer to @FT_Open_Args which must be filled by */
- /* the caller. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* The meaning of the `attach' (i.e., what really happens when the */
- /* new file is read) is not fixed by FreeType itself. It really */
- /* depends on the font format (and thus the font driver). */
- /* */
- /* Client applications are expected to know what they are doing */
- /* when invoking this function. Most drivers simply do not implement */
- /* file attachments. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Attach_Stream( FT_Face face,
- FT_Open_Args* parameters );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Reference_Face */
- /* */
- /* <Description> */
- /* A counter gets initialized to~1 at the time an @FT_Face structure */
- /* is created. This function increments the counter. @FT_Done_Face */
- /* then only destroys a face if the counter is~1, otherwise it simply */
- /* decrements the counter. */
- /* */
- /* This function helps in managing life-cycles of structures which */
- /* reference @FT_Face objects. */
- /* */
- /* <Input> */
- /* face :: A handle to a target face object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Since> */
- /* 2.4.2 */
- /* */
- FT_EXPORT( FT_Error )
- FT_Reference_Face( FT_Face face );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Done_Face */
- /* */
- /* <Description> */
- /* Discard a given face object, as well as all of its child slots and */
- /* sizes. */
- /* */
- /* <Input> */
- /* face :: A handle to a target face object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* See the discussion of reference counters in the description of */
- /* @FT_Reference_Face. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Done_Face( FT_Face face );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Select_Size */
- /* */
- /* <Description> */
- /* Select a bitmap strike. */
- /* */
- /* <InOut> */
- /* face :: A handle to a target face object. */
- /* */
- /* <Input> */
- /* strike_index :: The index of the bitmap strike in the */
- /* `available_sizes' field of @FT_FaceRec structure. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Select_Size( FT_Face face,
- FT_Int strike_index );
-
-
- /*************************************************************************/
- /* */
- /* <Enum> */
- /* FT_Size_Request_Type */
- /* */
- /* <Description> */
- /* An enumeration type that lists the supported size request types. */
- /* */
- /* <Values> */
- /* FT_SIZE_REQUEST_TYPE_NOMINAL :: */
- /* The nominal size. The `units_per_EM' field of @FT_FaceRec is */
- /* used to determine both scaling values. */
- /* */
- /* FT_SIZE_REQUEST_TYPE_REAL_DIM :: */
- /* The real dimension. The sum of the the `ascender' and (minus */
- /* of) the `descender' fields of @FT_FaceRec are used to determine */
- /* both scaling values. */
- /* */
- /* FT_SIZE_REQUEST_TYPE_BBOX :: */
- /* The font bounding box. The width and height of the `bbox' field */
- /* of @FT_FaceRec are used to determine the horizontal and vertical */
- /* scaling value, respectively. */
- /* */
- /* FT_SIZE_REQUEST_TYPE_CELL :: */
- /* The `max_advance_width' field of @FT_FaceRec is used to */
- /* determine the horizontal scaling value; the vertical scaling */
- /* value is determined the same way as */
- /* @FT_SIZE_REQUEST_TYPE_REAL_DIM does. Finally, both scaling */
- /* values are set to the smaller one. This type is useful if you */
- /* want to specify the font size for, say, a window of a given */
- /* dimension and 80x24 cells. */
- /* */
- /* FT_SIZE_REQUEST_TYPE_SCALES :: */
- /* Specify the scaling values directly. */
- /* */
- /* <Note> */
- /* The above descriptions only apply to scalable formats. For bitmap */
- /* formats, the behaviour is up to the driver. */
- /* */
- /* See the note section of @FT_Size_Metrics if you wonder how size */
- /* requesting relates to scaling values. */
- /* */
- typedef enum FT_Size_Request_Type_
- {
- FT_SIZE_REQUEST_TYPE_NOMINAL,
- FT_SIZE_REQUEST_TYPE_REAL_DIM,
- FT_SIZE_REQUEST_TYPE_BBOX,
- FT_SIZE_REQUEST_TYPE_CELL,
- FT_SIZE_REQUEST_TYPE_SCALES,
-
- FT_SIZE_REQUEST_TYPE_MAX
-
- } FT_Size_Request_Type;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Size_RequestRec */
- /* */
- /* <Description> */
- /* A structure used to model a size request. */
- /* */
- /* <Fields> */
- /* type :: See @FT_Size_Request_Type. */
- /* */
- /* width :: The desired width. */
- /* */
- /* height :: The desired height. */
- /* */
- /* horiResolution :: The horizontal resolution. If set to zero, */
- /* `width' is treated as a 26.6 fractional pixel */
- /* value. */
- /* */
- /* vertResolution :: The vertical resolution. If set to zero, */
- /* `height' is treated as a 26.6 fractional pixel */
- /* value. */
- /* */
- /* <Note> */
- /* If `width' is zero, then the horizontal scaling value is set equal */
- /* to the vertical scaling value, and vice versa. */
- /* */
- typedef struct FT_Size_RequestRec_
- {
- FT_Size_Request_Type type;
- FT_Long width;
- FT_Long height;
- FT_UInt horiResolution;
- FT_UInt vertResolution;
-
- } FT_Size_RequestRec;
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* FT_Size_Request */
- /* */
- /* <Description> */
- /* A handle to a size request structure. */
- /* */
- typedef struct FT_Size_RequestRec_ *FT_Size_Request;
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Request_Size */
- /* */
- /* <Description> */
- /* Resize the scale of the active @FT_Size object in a face. */
- /* */
- /* <InOut> */
- /* face :: A handle to a target face object. */
- /* */
- /* <Input> */
- /* req :: A pointer to a @FT_Size_RequestRec. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* Although drivers may select the bitmap strike matching the */
- /* request, you should not rely on this if you intend to select a */
- /* particular bitmap strike. Use @FT_Select_Size instead in that */
- /* case. */
- /* */
- /* The relation between the requested size and the resulting glyph */
- /* size is dependent entirely on how the size is defined in the */
- /* source face. The font designer chooses the final size of each */
- /* glyph relative to this size. For more information refer to */
- /* `http://www.freetype.org/freetype2/docs/glyphs/glyphs-2.html' */
- /* */
- FT_EXPORT( FT_Error )
- FT_Request_Size( FT_Face face,
- FT_Size_Request req );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Set_Char_Size */
- /* */
- /* <Description> */
- /* This function calls @FT_Request_Size to request the nominal size */
- /* (in points). */
- /* */
- /* <InOut> */
- /* face :: A handle to a target face object. */
- /* */
- /* <Input> */
- /* char_width :: The nominal width, in 26.6 fractional points. */
- /* */
- /* char_height :: The nominal height, in 26.6 fractional points. */
- /* */
- /* horz_resolution :: The horizontal resolution in dpi. */
- /* */
- /* vert_resolution :: The vertical resolution in dpi. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* If either the character width or height is zero, it is set equal */
- /* to the other value. */
- /* */
- /* If either the horizontal or vertical resolution is zero, it is set */
- /* equal to the other value. */
- /* */
- /* A character width or height smaller than 1pt is set to 1pt; if */
- /* both resolution values are zero, they are set to 72dpi. */
- /* */
- /* Don't use this function if you are using the FreeType cache API. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Set_Char_Size( FT_Face face,
- FT_F26Dot6 char_width,
- FT_F26Dot6 char_height,
- FT_UInt horz_resolution,
- FT_UInt vert_resolution );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Set_Pixel_Sizes */
- /* */
- /* <Description> */
- /* This function calls @FT_Request_Size to request the nominal size */
- /* (in pixels). */
- /* */
- /* <InOut> */
- /* face :: A handle to the target face object. */
- /* */
- /* <Input> */
- /* pixel_width :: The nominal width, in pixels. */
- /* */
- /* pixel_height :: The nominal height, in pixels. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* You should not rely on the resulting glyphs matching, or being */
- /* constrained, to this pixel size. Refer to @FT_Request_Size to */
- /* understand how requested sizes relate to actual sizes. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Set_Pixel_Sizes( FT_Face face,
- FT_UInt pixel_width,
- FT_UInt pixel_height );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Load_Glyph */
- /* */
- /* <Description> */
- /* A function used to load a single glyph into the glyph slot of a */
- /* face object. */
- /* */
- /* <InOut> */
- /* face :: A handle to the target face object where the glyph */
- /* is loaded. */
- /* */
- /* <Input> */
- /* glyph_index :: The index of the glyph in the font file. For */
- /* CID-keyed fonts (either in PS or in CFF format) */
- /* this argument specifies the CID value. */
- /* */
- /* load_flags :: A flag indicating what to load for this glyph. The */
- /* @FT_LOAD_XXX constants can be used to control the */
- /* glyph loading process (e.g., whether the outline */
- /* should be scaled, whether to load bitmaps or not, */
- /* whether to hint the outline, etc). */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* The loaded glyph may be transformed. See @FT_Set_Transform for */
- /* the details. */
- /* */
- /* For subsetted CID-keyed fonts, `FT_Err_Invalid_Argument' is */
- /* returned for invalid CID values (this is, for CID values which */
- /* don't have a corresponding glyph in the font). See the discussion */
- /* of the @FT_FACE_FLAG_CID_KEYED flag for more details. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Load_Glyph( FT_Face face,
- FT_UInt glyph_index,
- FT_Int32 load_flags );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Load_Char */
- /* */
- /* <Description> */
- /* A function used to load a single glyph into the glyph slot of a */
- /* face object, according to its character code. */
- /* */
- /* <InOut> */
- /* face :: A handle to a target face object where the glyph */
- /* is loaded. */
- /* */
- /* <Input> */
- /* char_code :: The glyph's character code, according to the */
- /* current charmap used in the face. */
- /* */
- /* load_flags :: A flag indicating what to load for this glyph. The */
- /* @FT_LOAD_XXX constants can be used to control the */
- /* glyph loading process (e.g., whether the outline */
- /* should be scaled, whether to load bitmaps or not, */
- /* whether to hint the outline, etc). */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* This function simply calls @FT_Get_Char_Index and @FT_Load_Glyph. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Load_Char( FT_Face face,
- FT_ULong char_code,
- FT_Int32 load_flags );
-
-
- /*************************************************************************
- *
- * @enum:
- * FT_LOAD_XXX
- *
- * @description:
- * A list of bit-field constants used with @FT_Load_Glyph to indicate
- * what kind of operations to perform during glyph loading.
- *
- * @values:
- * FT_LOAD_DEFAULT ::
- * Corresponding to~0, this value is used as the default glyph load
- * operation. In this case, the following happens:
- *
- * 1. FreeType looks for a bitmap for the glyph corresponding to the
- * face's current size. If one is found, the function returns.
- * The bitmap data can be accessed from the glyph slot (see note
- * below).
- *
- * 2. If no embedded bitmap is searched or found, FreeType looks for a
- * scalable outline. If one is found, it is loaded from the font
- * file, scaled to device pixels, then `hinted' to the pixel grid
- * in order to optimize it. The outline data can be accessed from
- * the glyph slot (see note below).
- *
- * Note that by default, the glyph loader doesn't render outlines into
- * bitmaps. The following flags are used to modify this default
- * behaviour to more specific and useful cases.
- *
- * FT_LOAD_NO_SCALE ::
- * Don't scale the loaded outline glyph but keep it in font units.
- *
- * This flag implies @FT_LOAD_NO_HINTING and @FT_LOAD_NO_BITMAP, and
- * unsets @FT_LOAD_RENDER.
- *
- * If the font is `tricky' (see @FT_FACE_FLAG_TRICKY for more), using
- * FT_LOAD_NO_SCALE usually yields meaningless outlines because the
- * subglyphs must be scaled and positioned with hinting instructions.
- * This can be solved by loading the font without FT_LOAD_NO_SCALE and
- * setting the character size to `font->units_per_EM'.
- *
- * FT_LOAD_NO_HINTING ::
- * Disable hinting. This generally generates `blurrier' bitmap glyphs
- * when the glyph are rendered in any of the anti-aliased modes. See
- * also the note below.
- *
- * This flag is implied by @FT_LOAD_NO_SCALE.
- *
- * FT_LOAD_RENDER ::
- * Call @FT_Render_Glyph after the glyph is loaded. By default, the
- * glyph is rendered in @FT_RENDER_MODE_NORMAL mode. This can be
- * overridden by @FT_LOAD_TARGET_XXX or @FT_LOAD_MONOCHROME.
- *
- * This flag is unset by @FT_LOAD_NO_SCALE.
- *
- * FT_LOAD_NO_BITMAP ::
- * Ignore bitmap strikes when loading. Bitmap-only fonts ignore this
- * flag.
- *
- * @FT_LOAD_NO_SCALE always sets this flag.
- *
- * FT_LOAD_VERTICAL_LAYOUT ::
- * Load the glyph for vertical text layout. In particular, the
- * `advance' value in the @FT_GlyphSlotRec structure is set to the
- * `vertAdvance' value of the `metrics' field.
- *
- * In case @FT_HAS_VERTICAL doesn't return true, you shouldn't use
- * this flag currently. Reason is that in this case vertical metrics
- * get synthesized, and those values are not always consistent across
- * various font formats.
- *
- * FT_LOAD_FORCE_AUTOHINT ::
- * Indicates that the auto-hinter is preferred over the font's native
- * hinter. See also the note below.
- *
- * FT_LOAD_CROP_BITMAP ::
- * Indicates that the font driver should crop the loaded bitmap glyph
- * (i.e., remove all space around its black bits). Not all drivers
- * implement this.
- *
- * FT_LOAD_PEDANTIC ::
- * Indicates that the font driver should perform pedantic verifications
- * during glyph loading. This is mostly used to detect broken glyphs
- * in fonts. By default, FreeType tries to handle broken fonts also.
- *
- * In particular, errors from the TrueType bytecode engine are not
- * passed to the application if this flag is not set; this might
- * result in partially hinted or distorted glyphs in case a glyph's
- * bytecode is buggy.
- *
- * FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ::
- * Ignored. Deprecated.
- *
- * FT_LOAD_NO_RECURSE ::
- * This flag is only used internally. It merely indicates that the
- * font driver should not load composite glyphs recursively. Instead,
- * it should set the `num_subglyph' and `subglyphs' values of the
- * glyph slot accordingly, and set `glyph->format' to
- * @FT_GLYPH_FORMAT_COMPOSITE.
- *
- * The description of sub-glyphs is not available to client
- * applications for now.
- *
- * This flag implies @FT_LOAD_NO_SCALE and @FT_LOAD_IGNORE_TRANSFORM.
- *
- * FT_LOAD_IGNORE_TRANSFORM ::
- * Indicates that the transform matrix set by @FT_Set_Transform should
- * be ignored.
- *
- * FT_LOAD_MONOCHROME ::
- * This flag is used with @FT_LOAD_RENDER to indicate that you want to
- * render an outline glyph to a 1-bit monochrome bitmap glyph, with
- * 8~pixels packed into each byte of the bitmap data.
- *
- * Note that this has no effect on the hinting algorithm used. You
- * should rather use @FT_LOAD_TARGET_MONO so that the
- * monochrome-optimized hinting algorithm is used.
- *
- * FT_LOAD_LINEAR_DESIGN ::
- * Indicates that the `linearHoriAdvance' and `linearVertAdvance'
- * fields of @FT_GlyphSlotRec should be kept in font units. See
- * @FT_GlyphSlotRec for details.
- *
- * FT_LOAD_NO_AUTOHINT ::
- * Disable auto-hinter. See also the note below.
- *
- * FT_LOAD_COLOR ::
- * This flag is used to request loading of color embedded-bitmap
- * images. The resulting color bitmaps, if available, will have the
- * @FT_PIXEL_MODE_BGRA format. When the flag is not used and color
- * bitmaps are found, they will be converted to 256-level gray
- * bitmaps transparently. Those bitmaps will be in the
- * @FT_PIXEL_MODE_GRAY format.
- *
- * @note:
- * By default, hinting is enabled and the font's native hinter (see
- * @FT_FACE_FLAG_HINTER) is preferred over the auto-hinter. You can
- * disable hinting by setting @FT_LOAD_NO_HINTING or change the
- * precedence by setting @FT_LOAD_FORCE_AUTOHINT. You can also set
- * @FT_LOAD_NO_AUTOHINT in case you don't want the auto-hinter to be
- * used at all.
- *
- * See the description of @FT_FACE_FLAG_TRICKY for a special exception
- * (affecting only a handful of Asian fonts).
- *
- * Besides deciding which hinter to use, you can also decide which
- * hinting algorithm to use. See @FT_LOAD_TARGET_XXX for details.
- *
- * Note that the auto-hinter needs a valid Unicode cmap (either a native
- * one or synthesized by FreeType) for producing correct results. If a
- * font provides an incorrect mapping (for example, assigning the
- * character code U+005A, LATIN CAPITAL LETTER Z, to a glyph depicting a
- * mathematical integral sign), the auto-hinter might produce useless
- * results.
- *
- */
-#define FT_LOAD_DEFAULT 0x0
-#define FT_LOAD_NO_SCALE ( 1L << 0 )
-#define FT_LOAD_NO_HINTING ( 1L << 1 )
-#define FT_LOAD_RENDER ( 1L << 2 )
-#define FT_LOAD_NO_BITMAP ( 1L << 3 )
-#define FT_LOAD_VERTICAL_LAYOUT ( 1L << 4 )
-#define FT_LOAD_FORCE_AUTOHINT ( 1L << 5 )
-#define FT_LOAD_CROP_BITMAP ( 1L << 6 )
-#define FT_LOAD_PEDANTIC ( 1L << 7 )
-#define FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ( 1L << 9 )
-#define FT_LOAD_NO_RECURSE ( 1L << 10 )
-#define FT_LOAD_IGNORE_TRANSFORM ( 1L << 11 )
-#define FT_LOAD_MONOCHROME ( 1L << 12 )
-#define FT_LOAD_LINEAR_DESIGN ( 1L << 13 )
-#define FT_LOAD_NO_AUTOHINT ( 1L << 15 )
- /* Bits 16..19 are used by `FT_LOAD_TARGET_' */
-#define FT_LOAD_COLOR ( 1L << 20 )
-
- /* */
-
- /* used internally only by certain font drivers! */
-#define FT_LOAD_ADVANCE_ONLY ( 1L << 8 )
-#define FT_LOAD_SBITS_ONLY ( 1L << 14 )
-
-
- /**************************************************************************
- *
- * @enum:
- * FT_LOAD_TARGET_XXX
- *
- * @description:
- * A list of values that are used to select a specific hinting algorithm
- * to use by the hinter. You should OR one of these values to your
- * `load_flags' when calling @FT_Load_Glyph.
- *
- * Note that font's native hinters may ignore the hinting algorithm you
- * have specified (e.g., the TrueType bytecode interpreter). You can set
- * @FT_LOAD_FORCE_AUTOHINT to ensure that the auto-hinter is used.
- *
- * Also note that @FT_LOAD_TARGET_LIGHT is an exception, in that it
- * always implies @FT_LOAD_FORCE_AUTOHINT.
- *
- * @values:
- * FT_LOAD_TARGET_NORMAL ::
- * This corresponds to the default hinting algorithm, optimized for
- * standard gray-level rendering. For monochrome output, use
- * @FT_LOAD_TARGET_MONO instead.
- *
- * FT_LOAD_TARGET_LIGHT ::
- * A lighter hinting algorithm for non-monochrome modes. Many
- * generated glyphs are more fuzzy but better resemble its original
- * shape. A bit like rendering on Mac OS~X.
- *
- * As a special exception, this target implies @FT_LOAD_FORCE_AUTOHINT.
- *
- * FT_LOAD_TARGET_MONO ::
- * Strong hinting algorithm that should only be used for monochrome
- * output. The result is probably unpleasant if the glyph is rendered
- * in non-monochrome modes.
- *
- * FT_LOAD_TARGET_LCD ::
- * A variant of @FT_LOAD_TARGET_NORMAL optimized for horizontally
- * decimated LCD displays.
- *
- * FT_LOAD_TARGET_LCD_V ::
- * A variant of @FT_LOAD_TARGET_NORMAL optimized for vertically
- * decimated LCD displays.
- *
- * @note:
- * You should use only _one_ of the FT_LOAD_TARGET_XXX values in your
- * `load_flags'. They can't be ORed.
- *
- * If @FT_LOAD_RENDER is also set, the glyph is rendered in the
- * corresponding mode (i.e., the mode which matches the used algorithm
- * best). An exeption is FT_LOAD_TARGET_MONO since it implies
- * @FT_LOAD_MONOCHROME.
- *
- * You can use a hinting algorithm that doesn't correspond to the same
- * rendering mode. As an example, it is possible to use the `light'
- * hinting algorithm and have the results rendered in horizontal LCD
- * pixel mode, with code like
- *
- * {
- * FT_Load_Glyph( face, glyph_index,
- * load_flags | FT_LOAD_TARGET_LIGHT );
- *
- * FT_Render_Glyph( face->glyph, FT_RENDER_MODE_LCD );
- * }
- *
- */
-#define FT_LOAD_TARGET_( x ) ( (FT_Int32)( (x) & 15 ) << 16 )
-
-#define FT_LOAD_TARGET_NORMAL FT_LOAD_TARGET_( FT_RENDER_MODE_NORMAL )
-#define FT_LOAD_TARGET_LIGHT FT_LOAD_TARGET_( FT_RENDER_MODE_LIGHT )
-#define FT_LOAD_TARGET_MONO FT_LOAD_TARGET_( FT_RENDER_MODE_MONO )
-#define FT_LOAD_TARGET_LCD FT_LOAD_TARGET_( FT_RENDER_MODE_LCD )
-#define FT_LOAD_TARGET_LCD_V FT_LOAD_TARGET_( FT_RENDER_MODE_LCD_V )
-
-
- /**************************************************************************
- *
- * @macro:
- * FT_LOAD_TARGET_MODE
- *
- * @description:
- * Return the @FT_Render_Mode corresponding to a given
- * @FT_LOAD_TARGET_XXX value.
- *
- */
-#define FT_LOAD_TARGET_MODE( x ) ( (FT_Render_Mode)( ( (x) >> 16 ) & 15 ) )
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Set_Transform */
- /* */
- /* <Description> */
- /* A function used to set the transformation that is applied to glyph */
- /* images when they are loaded into a glyph slot through */
- /* @FT_Load_Glyph. */
- /* */
- /* <InOut> */
- /* face :: A handle to the source face object. */
- /* */
- /* <Input> */
- /* matrix :: A pointer to the transformation's 2x2 matrix. Use~0 for */
- /* the identity matrix. */
- /* delta :: A pointer to the translation vector. Use~0 for the null */
- /* vector. */
- /* */
- /* <Note> */
- /* The transformation is only applied to scalable image formats after */
- /* the glyph has been loaded. It means that hinting is unaltered by */
- /* the transformation and is performed on the character size given in */
- /* the last call to @FT_Set_Char_Size or @FT_Set_Pixel_Sizes. */
- /* */
- /* Note that this also transforms the `face.glyph.advance' field, but */
- /* *not* the values in `face.glyph.metrics'. */
- /* */
- FT_EXPORT( void )
- FT_Set_Transform( FT_Face face,
- FT_Matrix* matrix,
- FT_Vector* delta );
-
-
- /*************************************************************************/
- /* */
- /* <Enum> */
- /* FT_Render_Mode */
- /* */
- /* <Description> */
- /* An enumeration type that lists the render modes supported by */
- /* FreeType~2. Each mode corresponds to a specific type of scanline */
- /* conversion performed on the outline. */
- /* */
- /* For bitmap fonts and embedded bitmaps the `bitmap->pixel_mode' */
- /* field in the @FT_GlyphSlotRec structure gives the format of the */
- /* returned bitmap. */
- /* */
- /* All modes except @FT_RENDER_MODE_MONO use 256 levels of opacity. */
- /* */
- /* <Values> */
- /* FT_RENDER_MODE_NORMAL :: */
- /* This is the default render mode; it corresponds to 8-bit */
- /* anti-aliased bitmaps. */
- /* */
- /* FT_RENDER_MODE_LIGHT :: */
- /* This is equivalent to @FT_RENDER_MODE_NORMAL. It is only */
- /* defined as a separate value because render modes are also used */
- /* indirectly to define hinting algorithm selectors. See */
- /* @FT_LOAD_TARGET_XXX for details. */
- /* */
- /* FT_RENDER_MODE_MONO :: */
- /* This mode corresponds to 1-bit bitmaps (with 2~levels of */
- /* opacity). */
- /* */
- /* FT_RENDER_MODE_LCD :: */
- /* This mode corresponds to horizontal RGB and BGR sub-pixel */
- /* displays like LCD screens. It produces 8-bit bitmaps that are */
- /* 3~times the width of the original glyph outline in pixels, and */
- /* which use the @FT_PIXEL_MODE_LCD mode. */
- /* */
- /* FT_RENDER_MODE_LCD_V :: */
- /* This mode corresponds to vertical RGB and BGR sub-pixel displays */
- /* (like PDA screens, rotated LCD displays, etc.). It produces */
- /* 8-bit bitmaps that are 3~times the height of the original */
- /* glyph outline in pixels and use the @FT_PIXEL_MODE_LCD_V mode. */
- /* */
- /* <Note> */
- /* The LCD-optimized glyph bitmaps produced by FT_Render_Glyph can be */
- /* filtered to reduce color-fringes by using @FT_Library_SetLcdFilter */
- /* (not active in the default builds). It is up to the caller to */
- /* either call @FT_Library_SetLcdFilter (if available) or do the */
- /* filtering itself. */
- /* */
- /* The selected render mode only affects vector glyphs of a font. */
- /* Embedded bitmaps often have a different pixel mode like */
- /* @FT_PIXEL_MODE_MONO. You can use @FT_Bitmap_Convert to transform */
- /* them into 8-bit pixmaps. */
- /* */
- typedef enum FT_Render_Mode_
- {
- FT_RENDER_MODE_NORMAL = 0,
- FT_RENDER_MODE_LIGHT,
- FT_RENDER_MODE_MONO,
- FT_RENDER_MODE_LCD,
- FT_RENDER_MODE_LCD_V,
-
- FT_RENDER_MODE_MAX
-
- } FT_Render_Mode;
-
-
- /*************************************************************************/
- /* */
- /* <Enum> */
- /* ft_render_mode_xxx */
- /* */
- /* <Description> */
- /* These constants are deprecated. Use the corresponding */
- /* @FT_Render_Mode values instead. */
- /* */
- /* <Values> */
- /* ft_render_mode_normal :: see @FT_RENDER_MODE_NORMAL */
- /* ft_render_mode_mono :: see @FT_RENDER_MODE_MONO */
- /* */
-#define ft_render_mode_normal FT_RENDER_MODE_NORMAL
-#define ft_render_mode_mono FT_RENDER_MODE_MONO
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Render_Glyph */
- /* */
- /* <Description> */
- /* Convert a given glyph image to a bitmap. It does so by inspecting */
- /* the glyph image format, finding the relevant renderer, and */
- /* invoking it. */
- /* */
- /* <InOut> */
- /* slot :: A handle to the glyph slot containing the image to */
- /* convert. */
- /* */
- /* <Input> */
- /* render_mode :: This is the render mode used to render the glyph */
- /* image into a bitmap. See @FT_Render_Mode for a */
- /* list of possible values. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Render_Glyph( FT_GlyphSlot slot,
- FT_Render_Mode render_mode );
-
-
- /*************************************************************************/
- /* */
- /* <Enum> */
- /* FT_Kerning_Mode */
- /* */
- /* <Description> */
- /* An enumeration used to specify which kerning values to return in */
- /* @FT_Get_Kerning. */
- /* */
- /* <Values> */
- /* FT_KERNING_DEFAULT :: Return scaled and grid-fitted kerning */
- /* distances (value is~0). */
- /* */
- /* FT_KERNING_UNFITTED :: Return scaled but un-grid-fitted kerning */
- /* distances. */
- /* */
- /* FT_KERNING_UNSCALED :: Return the kerning vector in original font */
- /* units. */
- /* */
- typedef enum FT_Kerning_Mode_
- {
- FT_KERNING_DEFAULT = 0,
- FT_KERNING_UNFITTED,
- FT_KERNING_UNSCALED
-
- } FT_Kerning_Mode;
-
-
- /*************************************************************************/
- /* */
- /* <Const> */
- /* ft_kerning_default */
- /* */
- /* <Description> */
- /* This constant is deprecated. Please use @FT_KERNING_DEFAULT */
- /* instead. */
- /* */
-#define ft_kerning_default FT_KERNING_DEFAULT
-
-
- /*************************************************************************/
- /* */
- /* <Const> */
- /* ft_kerning_unfitted */
- /* */
- /* <Description> */
- /* This constant is deprecated. Please use @FT_KERNING_UNFITTED */
- /* instead. */
- /* */
-#define ft_kerning_unfitted FT_KERNING_UNFITTED
-
-
- /*************************************************************************/
- /* */
- /* <Const> */
- /* ft_kerning_unscaled */
- /* */
- /* <Description> */
- /* This constant is deprecated. Please use @FT_KERNING_UNSCALED */
- /* instead. */
- /* */
-#define ft_kerning_unscaled FT_KERNING_UNSCALED
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_Kerning */
- /* */
- /* <Description> */
- /* Return the kerning vector between two glyphs of a same face. */
- /* */
- /* <Input> */
- /* face :: A handle to a source face object. */
- /* */
- /* left_glyph :: The index of the left glyph in the kern pair. */
- /* */
- /* right_glyph :: The index of the right glyph in the kern pair. */
- /* */
- /* kern_mode :: See @FT_Kerning_Mode for more information. */
- /* Determines the scale and dimension of the returned */
- /* kerning vector. */
- /* */
- /* <Output> */
- /* akerning :: The kerning vector. This is either in font units */
- /* or in pixels (26.6 format) for scalable formats, */
- /* and in pixels for fixed-sizes formats. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* Only horizontal layouts (left-to-right & right-to-left) are */
- /* supported by this method. Other layouts, or more sophisticated */
- /* kernings, are out of the scope of this API function -- they can be */
- /* implemented through format-specific interfaces. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Get_Kerning( FT_Face face,
- FT_UInt left_glyph,
- FT_UInt right_glyph,
- FT_UInt kern_mode,
- FT_Vector *akerning );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_Track_Kerning */
- /* */
- /* <Description> */
- /* Return the track kerning for a given face object at a given size. */
- /* */
- /* <Input> */
- /* face :: A handle to a source face object. */
- /* */
- /* point_size :: The point size in 16.16 fractional points. */
- /* */
- /* degree :: The degree of tightness. Increasingly negative */
- /* values represent tighter track kerning, while */
- /* increasingly positive values represent looser track */
- /* kerning. Value zero means no track kerning. */
- /* */
- /* <Output> */
- /* akerning :: The kerning in 16.16 fractional points, to be */
- /* uniformly applied between all glyphs. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* Currently, only the Type~1 font driver supports track kerning, */
- /* using data from AFM files (if attached with @FT_Attach_File or */
- /* @FT_Attach_Stream). */
- /* */
- /* Only very few AFM files come with track kerning data; please refer */
- /* to the Adobe's AFM specification for more details. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Get_Track_Kerning( FT_Face face,
- FT_Fixed point_size,
- FT_Int degree,
- FT_Fixed* akerning );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_Glyph_Name */
- /* */
- /* <Description> */
- /* Retrieve the ASCII name of a given glyph in a face. This only */
- /* works for those faces where @FT_HAS_GLYPH_NAMES(face) returns~1. */
- /* */
- /* <Input> */
- /* face :: A handle to a source face object. */
- /* */
- /* glyph_index :: The glyph index. */
- /* */
- /* buffer_max :: The maximum number of bytes available in the */
- /* buffer. */
- /* */
- /* <Output> */
- /* buffer :: A pointer to a target buffer where the name is */
- /* copied to. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* An error is returned if the face doesn't provide glyph names or if */
- /* the glyph index is invalid. In all cases of failure, the first */
- /* byte of `buffer' is set to~0 to indicate an empty name. */
- /* */
- /* The glyph name is truncated to fit within the buffer if it is too */
- /* long. The returned string is always zero-terminated. */
- /* */
- /* Be aware that FreeType reorders glyph indices internally so that */
- /* glyph index~0 always corresponds to the `missing glyph' (called */
- /* `.notdef'). */
- /* */
- /* This function is not compiled within the library if the config */
- /* macro `FT_CONFIG_OPTION_NO_GLYPH_NAMES' is defined in */
- /* `include/freetype/config/ftoptions.h'. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Get_Glyph_Name( FT_Face face,
- FT_UInt glyph_index,
- FT_Pointer buffer,
- FT_UInt buffer_max );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_Postscript_Name */
- /* */
- /* <Description> */
- /* Retrieve the ASCII PostScript name of a given face, if available. */
- /* This only works with PostScript and TrueType fonts. */
- /* */
- /* <Input> */
- /* face :: A handle to the source face object. */
- /* */
- /* <Return> */
- /* A pointer to the face's PostScript name. NULL if unavailable. */
- /* */
- /* <Note> */
- /* The returned pointer is owned by the face and is destroyed with */
- /* it. */
- /* */
- FT_EXPORT( const char* )
- FT_Get_Postscript_Name( FT_Face face );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Select_Charmap */
- /* */
- /* <Description> */
- /* Select a given charmap by its encoding tag (as listed in */
- /* `freetype.h'). */
- /* */
- /* <InOut> */
- /* face :: A handle to the source face object. */
- /* */
- /* <Input> */
- /* encoding :: A handle to the selected encoding. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* This function returns an error if no charmap in the face */
- /* corresponds to the encoding queried here. */
- /* */
- /* Because many fonts contain more than a single cmap for Unicode */
- /* encoding, this function has some special code to select the one */
- /* which covers Unicode best (`best' in the sense that a UCS-4 cmap */
- /* is preferred to a UCS-2 cmap). It is thus preferable to */
- /* @FT_Set_Charmap in this case. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Select_Charmap( FT_Face face,
- FT_Encoding encoding );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Set_Charmap */
- /* */
- /* <Description> */
- /* Select a given charmap for character code to glyph index mapping. */
- /* */
- /* <InOut> */
- /* face :: A handle to the source face object. */
- /* */
- /* <Input> */
- /* charmap :: A handle to the selected charmap. */
- /* */
- /* <Return> */
- /* FreeType error code. 0~means success. */
- /* */
- /* <Note> */
- /* This function returns an error if the charmap is not part of */
- /* the face (i.e., if it is not listed in the `face->charmaps' */
- /* table). */
- /* */
- /* It also fails if a type~14 charmap is selected. */
- /* */
- FT_EXPORT( FT_Error )
- FT_Set_Charmap( FT_Face face,
- FT_CharMap charmap );
-
-
- /*************************************************************************
- *
- * @function:
- * FT_Get_Charmap_Index
- *
- * @description:
- * Retrieve index of a given charmap.
- *
- * @input:
- * charmap ::
- * A handle to a charmap.
- *
- * @return:
- * The index into the array of character maps within the face to which
- * `charmap' belongs. If an error occurs, -1 is returned.
- *
- */
- FT_EXPORT( FT_Int )
- FT_Get_Charmap_Index( FT_CharMap charmap );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_Char_Index */
- /* */
- /* <Description> */
- /* Return the glyph index of a given character code. This function */
- /* uses a charmap object to do the mapping. */
- /* */
- /* <Input> */
- /* face :: A handle to the source face object. */
- /* */
- /* charcode :: The character code. */
- /* */
- /* <Return> */
- /* The glyph index. 0~means `undefined character code'. */
- /* */
- /* <Note> */
- /* If you use FreeType to manipulate the contents of font files */
- /* directly, be aware that the glyph index returned by this function */
- /* doesn't always correspond to the internal indices used within the */
- /* file. This is done to ensure that value~0 always corresponds to */
- /* the `missing glyph'. If the first glyph is not named `.notdef', */
- /* then for Type~1 and Type~42 fonts, `.notdef' will be moved into */
- /* the glyph ID~0 position, and whatever was there will be moved to */
- /* the position `.notdef' had. For Type~1 fonts, if there is no */
- /* `.notdef' glyph at all, then one will be created at index~0 and */
- /* whatever was there will be moved to the last index -- Type~42 */
- /* fonts are considered invalid under this condition. */
- /* */
- FT_EXPORT( FT_UInt )
- FT_Get_Char_Index( FT_Face face,
- FT_ULong charcode );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_First_Char */
- /* */
- /* <Description> */
- /* This function is used to return the first character code in the */
- /* current charmap of a given face. It also returns the */
- /* corresponding glyph index. */
- /* */
- /* <Input> */
- /* face :: A handle to the source face object. */
- /* */
- /* <Output> */
- /* agindex :: Glyph index of first character code. 0~if charmap is */
- /* empty. */
- /* */
- /* <Return> */
- /* The charmap's first character code. */
- /* */
- /* <Note> */
- /* You should use this function with @FT_Get_Next_Char to be able to */
- /* parse all character codes available in a given charmap. The code */
- /* should look like this: */
- /* */
- /* { */
- /* FT_ULong charcode; */
- /* FT_UInt gindex; */
- /* */
- /* */
- /* charcode = FT_Get_First_Char( face, &gindex ); */
- /* while ( gindex != 0 ) */
- /* { */
- /* ... do something with (charcode,gindex) pair ... */
- /* */
- /* charcode = FT_Get_Next_Char( face, charcode, &gindex ); */
- /* } */
- /* } */
- /* */
- /* Note that `*agindex' is set to~0 if the charmap is empty. The */
- /* result itself can be~0 in two cases: if the charmap is empty or */
- /* if the value~0 is the first valid character code. */
- /* */
- FT_EXPORT( FT_ULong )
- FT_Get_First_Char( FT_Face face,
- FT_UInt *agindex );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_Next_Char */
- /* */
- /* <Description> */
- /* This function is used to return the next character code in the */
- /* current charmap of a given face following the value `char_code', */
- /* as well as the corresponding glyph index. */
- /* */
- /* <Input> */
- /* face :: A handle to the source face object. */
- /* char_code :: The starting character code. */
- /* */
- /* <Output> */
- /* agindex :: Glyph index of next character code. 0~if charmap */
- /* is empty. */
- /* */
- /* <Return> */
- /* The charmap's next character code. */
- /* */
- /* <Note> */
- /* You should use this function with @FT_Get_First_Char to walk */
- /* over all character codes available in a given charmap. See the */
- /* note for this function for a simple code example. */
- /* */
- /* Note that `*agindex' is set to~0 when there are no more codes in */
- /* the charmap. */
- /* */
- FT_EXPORT( FT_ULong )
- FT_Get_Next_Char( FT_Face face,
- FT_ULong char_code,
- FT_UInt *agindex );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_Name_Index */
- /* */
- /* <Description> */
- /* Return the glyph index of a given glyph name. This function uses */
- /* driver specific objects to do the translation. */
- /* */
- /* <Input> */
- /* face :: A handle to the source face object. */
- /* */
- /* glyph_name :: The glyph name. */
- /* */
- /* <Return> */
- /* The glyph index. 0~means `undefined character code'. */
- /* */
- FT_EXPORT( FT_UInt )
- FT_Get_Name_Index( FT_Face face,
- FT_String* glyph_name );
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_SUBGLYPH_FLAG_XXX
- *
- * @description:
- * A list of constants used to describe subglyphs. Please refer to the
- * TrueType specification for the meaning of the various flags.
- *
- * @values:
- * FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS ::
- * FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES ::
- * FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID ::
- * FT_SUBGLYPH_FLAG_SCALE ::
- * FT_SUBGLYPH_FLAG_XY_SCALE ::
- * FT_SUBGLYPH_FLAG_2X2 ::
- * FT_SUBGLYPH_FLAG_USE_MY_METRICS ::
- *
- */
-#define FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS 1
-#define FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES 2
-#define FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID 4
-#define FT_SUBGLYPH_FLAG_SCALE 8
-#define FT_SUBGLYPH_FLAG_XY_SCALE 0x40
-#define FT_SUBGLYPH_FLAG_2X2 0x80
-#define FT_SUBGLYPH_FLAG_USE_MY_METRICS 0x200
-
-
- /*************************************************************************
- *
- * @func:
- * FT_Get_SubGlyph_Info
- *
- * @description:
- * Retrieve a description of a given subglyph. Only use it if
- * `glyph->format' is @FT_GLYPH_FORMAT_COMPOSITE; an error is
- * returned otherwise.
- *
- * @input:
- * glyph ::
- * The source glyph slot.
- *
- * sub_index ::
- * The index of the subglyph. Must be less than
- * `glyph->num_subglyphs'.
- *
- * @output:
- * p_index ::
- * The glyph index of the subglyph.
- *
- * p_flags ::
- * The subglyph flags, see @FT_SUBGLYPH_FLAG_XXX.
- *
- * p_arg1 ::
- * The subglyph's first argument (if any).
- *
- * p_arg2 ::
- * The subglyph's second argument (if any).
- *
- * p_transform ::
- * The subglyph transformation (if any).
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * The values of `*p_arg1', `*p_arg2', and `*p_transform' must be
- * interpreted depending on the flags returned in `*p_flags'. See the
- * TrueType specification for details.
- *
- */
- FT_EXPORT( FT_Error )
- FT_Get_SubGlyph_Info( FT_GlyphSlot glyph,
- FT_UInt sub_index,
- FT_Int *p_index,
- FT_UInt *p_flags,
- FT_Int *p_arg1,
- FT_Int *p_arg2,
- FT_Matrix *p_transform );
-
-
- /*************************************************************************/
- /* */
- /* <Enum> */
- /* FT_FSTYPE_XXX */
- /* */
- /* <Description> */
- /* A list of bit flags used in the `fsType' field of the OS/2 table */
- /* in a TrueType or OpenType font and the `FSType' entry in a */
- /* PostScript font. These bit flags are returned by */
- /* @FT_Get_FSType_Flags; they inform client applications of embedding */
- /* and subsetting restrictions associated with a font. */
- /* */
- /* See http://www.adobe.com/devnet/acrobat/pdfs/FontPolicies.pdf for */
- /* more details. */
- /* */
- /* <Values> */
- /* FT_FSTYPE_INSTALLABLE_EMBEDDING :: */
- /* Fonts with no fsType bit set may be embedded and permanently */
- /* installed on the remote system by an application. */
- /* */
- /* FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING :: */
- /* Fonts that have only this bit set must not be modified, embedded */
- /* or exchanged in any manner without first obtaining permission of */
- /* the font software copyright owner. */
- /* */
- /* FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING :: */
- /* If this bit is set, the font may be embedded and temporarily */
- /* loaded on the remote system. Documents containing Preview & */
- /* Print fonts must be opened `read-only'; no edits can be applied */
- /* to the document. */
- /* */
- /* FT_FSTYPE_EDITABLE_EMBEDDING :: */
- /* If this bit is set, the font may be embedded but must only be */
- /* installed temporarily on other systems. In contrast to Preview */
- /* & Print fonts, documents containing editable fonts may be opened */
- /* for reading, editing is permitted, and changes may be saved. */
- /* */
- /* FT_FSTYPE_NO_SUBSETTING :: */
- /* If this bit is set, the font may not be subsetted prior to */
- /* embedding. */
- /* */
- /* FT_FSTYPE_BITMAP_EMBEDDING_ONLY :: */
- /* If this bit is set, only bitmaps contained in the font may be */
- /* embedded; no outline data may be embedded. If there are no */
- /* bitmaps available in the font, then the font is unembeddable. */
- /* */
- /* <Note> */
- /* While the fsType flags can indicate that a font may be embedded, a */
- /* license with the font vendor may be separately required to use the */
- /* font in this way. */
- /* */
-#define FT_FSTYPE_INSTALLABLE_EMBEDDING 0x0000
-#define FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING 0x0002
-#define FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING 0x0004
-#define FT_FSTYPE_EDITABLE_EMBEDDING 0x0008
-#define FT_FSTYPE_NO_SUBSETTING 0x0100
-#define FT_FSTYPE_BITMAP_EMBEDDING_ONLY 0x0200
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_FSType_Flags */
- /* */
- /* <Description> */
- /* Return the fsType flags for a font. */
- /* */
- /* <Input> */
- /* face :: A handle to the source face object. */
- /* */
- /* <Return> */
- /* The fsType flags, @FT_FSTYPE_XXX. */
- /* */
- /* <Note> */
- /* Use this function rather than directly reading the `fs_type' field */
- /* in the @PS_FontInfoRec structure which is only guaranteed to */
- /* return the correct results for Type~1 fonts. */
- /* */
- /* <Since> */
- /* 2.3.8 */
- /* */
- FT_EXPORT( FT_UShort )
- FT_Get_FSType_Flags( FT_Face face );
-
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* glyph_variants */
- /* */
- /* <Title> */
- /* Glyph Variants */
- /* */
- /* <Abstract> */
- /* The FreeType~2 interface to Unicode Ideographic Variation */
- /* Sequences (IVS), using the SFNT cmap format~14. */
- /* */
- /* <Description> */
- /* Many CJK characters have variant forms. They are a sort of grey */
- /* area somewhere between being totally irrelevant and semantically */
- /* distinct; for this reason, the Unicode consortium decided to */
- /* introduce Ideographic Variation Sequences (IVS), consisting of a */
- /* Unicode base character and one of 240 variant selectors */
- /* (U+E0100-U+E01EF), instead of further extending the already huge */
- /* code range for CJK characters. */
- /* */
- /* An IVS is registered and unique; for further details please refer */
- /* to Unicode Technical Standard #37, the Ideographic Variation */
- /* Database: */
- /* */
- /* http://www.unicode.org/reports/tr37/ */
- /* */
- /* To date (November 2012), the character with the most variants is */
- /* U+9089, having 31 such IVS. */
- /* */
- /* Adobe and MS decided to support IVS with a new cmap subtable */
- /* (format~14). It is an odd subtable because it is not a mapping of */
- /* input code points to glyphs, but contains lists of all variants */
- /* supported by the font. */
- /* */
- /* A variant may be either `default' or `non-default'. A default */
- /* variant is the one you will get for that code point if you look it */
- /* up in the standard Unicode cmap. A non-default variant is a */
- /* different glyph. */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Face_GetCharVariantIndex */
- /* */
- /* <Description> */
- /* Return the glyph index of a given character code as modified by */
- /* the variation selector. */
- /* */
- /* <Input> */
- /* face :: */
- /* A handle to the source face object. */
- /* */
- /* charcode :: */
- /* The character code point in Unicode. */
- /* */
- /* variantSelector :: */
- /* The Unicode code point of the variation selector. */
- /* */
- /* <Return> */
- /* The glyph index. 0~means either `undefined character code', or */
- /* `undefined selector code', or `no variation selector cmap */
- /* subtable', or `current CharMap is not Unicode'. */
- /* */
- /* <Note> */
- /* If you use FreeType to manipulate the contents of font files */
- /* directly, be aware that the glyph index returned by this function */
- /* doesn't always correspond to the internal indices used within */
- /* the file. This is done to ensure that value~0 always corresponds */
- /* to the `missing glyph'. */
- /* */
- /* This function is only meaningful if */
- /* a) the font has a variation selector cmap sub table, */
- /* and */
- /* b) the current charmap has a Unicode encoding. */
- /* */
- /* <Since> */
- /* 2.3.6 */
- /* */
- FT_EXPORT( FT_UInt )
- FT_Face_GetCharVariantIndex( FT_Face face,
- FT_ULong charcode,
- FT_ULong variantSelector );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Face_GetCharVariantIsDefault */
- /* */
- /* <Description> */
- /* Check whether this variant of this Unicode character is the one to */
- /* be found in the `cmap'. */
- /* */
- /* <Input> */
- /* face :: */
- /* A handle to the source face object. */
- /* */
- /* charcode :: */
- /* The character codepoint in Unicode. */
- /* */
- /* variantSelector :: */
- /* The Unicode codepoint of the variation selector. */
- /* */
- /* <Return> */
- /* 1~if found in the standard (Unicode) cmap, 0~if found in the */
- /* variation selector cmap, or -1 if it is not a variant. */
- /* */
- /* <Note> */
- /* This function is only meaningful if the font has a variation */
- /* selector cmap subtable. */
- /* */
- /* <Since> */
- /* 2.3.6 */
- /* */
- FT_EXPORT( FT_Int )
- FT_Face_GetCharVariantIsDefault( FT_Face face,
- FT_ULong charcode,
- FT_ULong variantSelector );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Face_GetVariantSelectors */
- /* */
- /* <Description> */
- /* Return a zero-terminated list of Unicode variant selectors found */
- /* in the font. */
- /* */
- /* <Input> */
- /* face :: */
- /* A handle to the source face object. */
- /* */
- /* <Return> */
- /* A pointer to an array of selector code points, or NULL if there is */
- /* no valid variant selector cmap subtable. */
- /* */
- /* <Note> */
- /* The last item in the array is~0; the array is owned by the */
- /* @FT_Face object but can be overwritten or released on the next */
- /* call to a FreeType function. */
- /* */
- /* <Since> */
- /* 2.3.6 */
- /* */
- FT_EXPORT( FT_UInt32* )
- FT_Face_GetVariantSelectors( FT_Face face );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Face_GetVariantsOfChar */
- /* */
- /* <Description> */
- /* Return a zero-terminated list of Unicode variant selectors found */
- /* for the specified character code. */
- /* */
- /* <Input> */
- /* face :: */
- /* A handle to the source face object. */
- /* */
- /* charcode :: */
- /* The character codepoint in Unicode. */
- /* */
- /* <Return> */
- /* A pointer to an array of variant selector code points which are */
- /* active for the given character, or NULL if the corresponding list */
- /* is empty. */
- /* */
- /* <Note> */
- /* The last item in the array is~0; the array is owned by the */
- /* @FT_Face object but can be overwritten or released on the next */
- /* call to a FreeType function. */
- /* */
- /* <Since> */
- /* 2.3.6 */
- /* */
- FT_EXPORT( FT_UInt32* )
- FT_Face_GetVariantsOfChar( FT_Face face,
- FT_ULong charcode );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Face_GetCharsOfVariant */
- /* */
- /* <Description> */
- /* Return a zero-terminated list of Unicode character codes found for */
- /* the specified variant selector. */
- /* */
- /* <Input> */
- /* face :: */
- /* A handle to the source face object. */
- /* */
- /* variantSelector :: */
- /* The variant selector code point in Unicode. */
- /* */
- /* <Return> */
- /* A list of all the code points which are specified by this selector */
- /* (both default and non-default codes are returned) or NULL if there */
- /* is no valid cmap or the variant selector is invalid. */
- /* */
- /* <Note> */
- /* The last item in the array is~0; the array is owned by the */
- /* @FT_Face object but can be overwritten or released on the next */
- /* call to a FreeType function. */
- /* */
- /* <Since> */
- /* 2.3.6 */
- /* */
- FT_EXPORT( FT_UInt32* )
- FT_Face_GetCharsOfVariant( FT_Face face,
- FT_ULong variantSelector );
-
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* computations */
- /* */
- /* <Title> */
- /* Computations */
- /* */
- /* <Abstract> */
- /* Crunching fixed numbers and vectors. */
- /* */
- /* <Description> */
- /* This section contains various functions used to perform */
- /* computations on 16.16 fixed-float numbers or 2d vectors. */
- /* */
- /* <Order> */
- /* FT_MulDiv */
- /* FT_MulFix */
- /* FT_DivFix */
- /* FT_RoundFix */
- /* FT_CeilFix */
- /* FT_FloorFix */
- /* FT_Vector_Transform */
- /* FT_Matrix_Multiply */
- /* FT_Matrix_Invert */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_MulDiv */
- /* */
- /* <Description> */
- /* A very simple function used to perform the computation `(a*b)/c' */
- /* with maximum accuracy (it uses a 64-bit intermediate integer */
- /* whenever necessary). */
- /* */
- /* This function isn't necessarily as fast as some processor specific */
- /* operations, but is at least completely portable. */
- /* */
- /* <Input> */
- /* a :: The first multiplier. */
- /* b :: The second multiplier. */
- /* c :: The divisor. */
- /* */
- /* <Return> */
- /* The result of `(a*b)/c'. This function never traps when trying to */
- /* divide by zero; it simply returns `MaxInt' or `MinInt' depending */
- /* on the signs of `a' and `b'. */
- /* */
- FT_EXPORT( FT_Long )
- FT_MulDiv( FT_Long a,
- FT_Long b,
- FT_Long c );
-
-
- /* */
-
- /* The following #if 0 ... #endif is for the documentation formatter, */
- /* hiding the internal `FT_MULFIX_INLINED' macro. */
-
-#if 0
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_MulFix */
- /* */
- /* <Description> */
- /* A very simple function used to perform the computation */
- /* `(a*b)/0x10000' with maximum accuracy. Most of the time this is */
- /* used to multiply a given value by a 16.16 fixed-point factor. */
- /* */
- /* <Input> */
- /* a :: The first multiplier. */
- /* b :: The second multiplier. Use a 16.16 factor here whenever */
- /* possible (see note below). */
- /* */
- /* <Return> */
- /* The result of `(a*b)/0x10000'. */
- /* */
- /* <Note> */
- /* This function has been optimized for the case where the absolute */
- /* value of `a' is less than 2048, and `b' is a 16.16 scaling factor. */
- /* As this happens mainly when scaling from notional units to */
- /* fractional pixels in FreeType, it resulted in noticeable speed */
- /* improvements between versions 2.x and 1.x. */
- /* */
- /* As a conclusion, always try to place a 16.16 factor as the */
- /* _second_ argument of this function; this can make a great */
- /* difference. */
- /* */
- FT_EXPORT( FT_Long )
- FT_MulFix( FT_Long a,
- FT_Long b );
-
- /* */
-#endif
-
-#ifdef FT_MULFIX_INLINED
-#define FPDFAPI_FT_MulFix( a, b ) FT_MULFIX_INLINED( a, b )
-#else
- FT_EXPORT( FT_Long )
- FT_MulFix( FT_Long a,
- FT_Long b );
-#endif
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_DivFix */
- /* */
- /* <Description> */
- /* A very simple function used to perform the computation */
- /* `(a*0x10000)/b' with maximum accuracy. Most of the time, this is */
- /* used to divide a given value by a 16.16 fixed-point factor. */
- /* */
- /* <Input> */
- /* a :: The first multiplier. */
- /* b :: The second multiplier. Use a 16.16 factor here whenever */
- /* possible (see note below). */
- /* */
- /* <Return> */
- /* The result of `(a*0x10000)/b'. */
- /* */
- /* <Note> */
- /* The optimization for FT_DivFix() is simple: If (a~<<~16) fits in */
- /* 32~bits, then the division is computed directly. Otherwise, we */
- /* use a specialized version of @FT_MulDiv. */
- /* */
- FT_EXPORT( FT_Long )
- FT_DivFix( FT_Long a,
- FT_Long b );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_RoundFix */
- /* */
- /* <Description> */
- /* A very simple function used to round a 16.16 fixed number. */
- /* */
- /* <Input> */
- /* a :: The number to be rounded. */
- /* */
- /* <Return> */
- /* The result of `(a + 0x8000) & -0x10000'. */
- /* */
- FT_EXPORT( FT_Fixed )
- FT_RoundFix( FT_Fixed a );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_CeilFix */
- /* */
- /* <Description> */
- /* A very simple function used to compute the ceiling function of a */
- /* 16.16 fixed number. */
- /* */
- /* <Input> */
- /* a :: The number for which the ceiling function is to be computed. */
- /* */
- /* <Return> */
- /* The result of `(a + 0x10000 - 1) & -0x10000'. */
- /* */
- FT_EXPORT( FT_Fixed )
- FT_CeilFix( FT_Fixed a );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_FloorFix */
- /* */
- /* <Description> */
- /* A very simple function used to compute the floor function of a */
- /* 16.16 fixed number. */
- /* */
- /* <Input> */
- /* a :: The number for which the floor function is to be computed. */
- /* */
- /* <Return> */
- /* The result of `a & -0x10000'. */
- /* */
- FT_EXPORT( FT_Fixed )
- FT_FloorFix( FT_Fixed a );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Vector_Transform */
- /* */
- /* <Description> */
- /* Transform a single vector through a 2x2 matrix. */
- /* */
- /* <InOut> */
- /* vector :: The target vector to transform. */
- /* */
- /* <Input> */
- /* matrix :: A pointer to the source 2x2 matrix. */
- /* */
- /* <Note> */
- /* The result is undefined if either `vector' or `matrix' is invalid. */
- /* */
- FT_EXPORT( void )
- FT_Vector_Transform( FT_Vector* vec,
- const FT_Matrix* matrix );
-
-
- /*************************************************************************/
- /* */
- /* <Section> */
- /* version */
- /* */
- /* <Title> */
- /* FreeType Version */
- /* */
- /* <Abstract> */
- /* Functions and macros related to FreeType versions. */
- /* */
- /* <Description> */
- /* Note that those functions and macros are of limited use because */
- /* even a new release of FreeType with only documentation changes */
- /* increases the version number. */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************
- *
- * @enum:
- * FREETYPE_XXX
- *
- * @description:
- * These three macros identify the FreeType source code version.
- * Use @FT_Library_Version to access them at runtime.
- *
- * @values:
- * FREETYPE_MAJOR :: The major version number.
- * FREETYPE_MINOR :: The minor version number.
- * FREETYPE_PATCH :: The patch level.
- *
- * @note:
- * The version number of FreeType if built as a dynamic link library
- * with the `libtool' package is _not_ controlled by these three
- * macros.
- *
- */
-#define FREETYPE_MAJOR 2
-#define FREETYPE_MINOR 5
-#define FREETYPE_PATCH 0
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Library_Version */
- /* */
- /* <Description> */
- /* Return the version of the FreeType library being used. This is */
- /* useful when dynamically linking to the library, since one cannot */
- /* use the macros @FREETYPE_MAJOR, @FREETYPE_MINOR, and */
- /* @FREETYPE_PATCH. */
- /* */
- /* <Input> */
- /* library :: A source library handle. */
- /* */
- /* <Output> */
- /* amajor :: The major version number. */
- /* */
- /* aminor :: The minor version number. */
- /* */
- /* apatch :: The patch version number. */
- /* */
- /* <Note> */
- /* The reason why this function takes a `library' argument is because */
- /* certain programs implement library initialization in a custom way */
- /* that doesn't use @FT_Init_FreeType. */
- /* */
- /* In such cases, the library version might not be available before */
- /* the library object has been created. */
- /* */
- FT_EXPORT( void )
- FT_Library_Version( FT_Library library,
- FT_Int *amajor,
- FT_Int *aminor,
- FT_Int *apatch );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Face_CheckTrueTypePatents */
- /* */
- /* <Description> */
- /* Parse all bytecode instructions of a TrueType font file to check */
- /* whether any of the patented opcodes are used. This is only useful */
- /* if you want to be able to use the unpatented hinter with */
- /* fonts that do *not* use these opcodes. */
- /* */
- /* Note that this function parses *all* glyph instructions in the */
- /* font file, which may be slow. */
- /* */
- /* <Input> */
- /* face :: A face handle. */
- /* */
- /* <Return> */
- /* 1~if this is a TrueType font that uses one of the patented */
- /* opcodes, 0~otherwise. */
- /* */
- /* <Note> */
- /* Since May 2010, TrueType hinting is no longer patented. */
- /* */
- /* <Since> */
- /* 2.3.5 */
- /* */
- FT_EXPORT( FT_Bool )
- FT_Face_CheckTrueTypePatents( FT_Face face );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Face_SetUnpatentedHinting */
- /* */
- /* <Description> */
- /* Enable or disable the unpatented hinter for a given face. */
- /* Only enable it if you have determined that the face doesn't */
- /* use any patented opcodes (see @FT_Face_CheckTrueTypePatents). */
- /* */
- /* <Input> */
- /* face :: A face handle. */
- /* */
- /* value :: New boolean setting. */
- /* */
- /* <Return> */
- /* The old setting value. This will always be false if this is not */
- /* an SFNT font, or if the unpatented hinter is not compiled in this */
- /* instance of the library. */
- /* */
- /* <Note> */
- /* Since May 2010, TrueType hinting is no longer patented. */
- /* */
- /* <Since> */
- /* 2.3.5 */
- /* */
- FT_EXPORT( FT_Bool )
- FT_Face_SetUnpatentedHinting( FT_Face face,
- FT_Bool value );
-
- /* */
-
-
-FT_END_HEADER
-
-#endif /* __FREETYPE_H__ */
-
-
-/* END */
+/***************************************************************************/
+/* */
+/* freetype.h */
+/* */
+/* FreeType high-level API and common types (specification only). */
+/* */
+/* Copyright 1996-2013 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __FREETYPE_H__
+#define __FREETYPE_H__
+
+
+#ifndef FT_FREETYPE_H
+#error "`ft2build.h' hasn't been included yet!"
+#error "Please always use macros to include FreeType header files."
+#error "Example:"
+#error " #include <ft2build.h>"
+#error " #include FT_FREETYPE_H"
+#endif
+
+
+#include "../ft2build.h"
+#include "config/ftconfig.h"
+#include "fttypes.h"
+#include "fterrors.h"
+
+
+FT_BEGIN_HEADER
+
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* user_allocation */
+ /* */
+ /* <Title> */
+ /* User allocation */
+ /* */
+ /* <Abstract> */
+ /* How client applications should allocate FreeType data structures. */
+ /* */
+ /* <Description> */
+ /* FreeType assumes that structures allocated by the user and passed */
+ /* as arguments are zeroed out except for the actual data. In other */
+ /* words, it is recommended to use `calloc' (or variants of it) */
+ /* instead of `malloc' for allocation. */
+ /* */
+ /*************************************************************************/
+
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /* */
+ /* B A S I C T Y P E S */
+ /* */
+ /*************************************************************************/
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* base_interface */
+ /* */
+ /* <Title> */
+ /* Base Interface */
+ /* */
+ /* <Abstract> */
+ /* The FreeType~2 base font interface. */
+ /* */
+ /* <Description> */
+ /* This section describes the public high-level API of FreeType~2. */
+ /* */
+ /* <Order> */
+ /* FT_Library */
+ /* FT_Face */
+ /* FT_Size */
+ /* FT_GlyphSlot */
+ /* FT_CharMap */
+ /* FT_Encoding */
+ /* */
+ /* FT_FaceRec */
+ /* */
+ /* FT_FACE_FLAG_SCALABLE */
+ /* FT_FACE_FLAG_FIXED_SIZES */
+ /* FT_FACE_FLAG_FIXED_WIDTH */
+ /* FT_FACE_FLAG_HORIZONTAL */
+ /* FT_FACE_FLAG_VERTICAL */
+ /* FT_FACE_FLAG_SFNT */
+ /* FT_FACE_FLAG_KERNING */
+ /* FT_FACE_FLAG_MULTIPLE_MASTERS */
+ /* FT_FACE_FLAG_GLYPH_NAMES */
+ /* FT_FACE_FLAG_EXTERNAL_STREAM */
+ /* FT_FACE_FLAG_FAST_GLYPHS */
+ /* FT_FACE_FLAG_HINTER */
+ /* */
+ /* FT_STYLE_FLAG_BOLD */
+ /* FT_STYLE_FLAG_ITALIC */
+ /* */
+ /* FT_SizeRec */
+ /* FT_Size_Metrics */
+ /* */
+ /* FT_GlyphSlotRec */
+ /* FT_Glyph_Metrics */
+ /* FT_SubGlyph */
+ /* */
+ /* FT_Bitmap_Size */
+ /* */
+ /* FT_Init_FreeType */
+ /* FT_Done_FreeType */
+ /* */
+ /* FT_New_Face */
+ /* FT_Done_Face */
+ /* FT_New_Memory_Face */
+ /* FT_Open_Face */
+ /* FT_Open_Args */
+ /* FT_Parameter */
+ /* FT_Attach_File */
+ /* FT_Attach_Stream */
+ /* */
+ /* FT_Set_Char_Size */
+ /* FT_Set_Pixel_Sizes */
+ /* FT_Request_Size */
+ /* FT_Select_Size */
+ /* FT_Size_Request_Type */
+ /* FT_Size_Request */
+ /* FT_Set_Transform */
+ /* FT_Load_Glyph */
+ /* FT_Get_Char_Index */
+ /* FT_Get_Name_Index */
+ /* FT_Load_Char */
+ /* */
+ /* FT_OPEN_MEMORY */
+ /* FT_OPEN_STREAM */
+ /* FT_OPEN_PATHNAME */
+ /* FT_OPEN_DRIVER */
+ /* FT_OPEN_PARAMS */
+ /* */
+ /* FT_LOAD_DEFAULT */
+ /* FT_LOAD_RENDER */
+ /* FT_LOAD_MONOCHROME */
+ /* FT_LOAD_LINEAR_DESIGN */
+ /* FT_LOAD_NO_SCALE */
+ /* FT_LOAD_NO_HINTING */
+ /* FT_LOAD_NO_BITMAP */
+ /* FT_LOAD_CROP_BITMAP */
+ /* */
+ /* FT_LOAD_VERTICAL_LAYOUT */
+ /* FT_LOAD_IGNORE_TRANSFORM */
+ /* FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH */
+ /* FT_LOAD_FORCE_AUTOHINT */
+ /* FT_LOAD_NO_RECURSE */
+ /* FT_LOAD_PEDANTIC */
+ /* */
+ /* FT_LOAD_TARGET_NORMAL */
+ /* FT_LOAD_TARGET_LIGHT */
+ /* FT_LOAD_TARGET_MONO */
+ /* FT_LOAD_TARGET_LCD */
+ /* FT_LOAD_TARGET_LCD_V */
+ /* */
+ /* FT_Render_Glyph */
+ /* FT_Render_Mode */
+ /* FT_Get_Kerning */
+ /* FT_Kerning_Mode */
+ /* FT_Get_Track_Kerning */
+ /* FT_Get_Glyph_Name */
+ /* FT_Get_Postscript_Name */
+ /* */
+ /* FT_CharMapRec */
+ /* FT_Select_Charmap */
+ /* FT_Set_Charmap */
+ /* FT_Get_Charmap_Index */
+ /* */
+ /* FT_FSTYPE_INSTALLABLE_EMBEDDING */
+ /* FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING */
+ /* FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING */
+ /* FT_FSTYPE_EDITABLE_EMBEDDING */
+ /* FT_FSTYPE_NO_SUBSETTING */
+ /* FT_FSTYPE_BITMAP_EMBEDDING_ONLY */
+ /* */
+ /* FT_Get_FSType_Flags */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Glyph_Metrics */
+ /* */
+ /* <Description> */
+ /* A structure used to model the metrics of a single glyph. The */
+ /* values are expressed in 26.6 fractional pixel format; if the flag */
+ /* @FT_LOAD_NO_SCALE has been used while loading the glyph, values */
+ /* are expressed in font units instead. */
+ /* */
+ /* <Fields> */
+ /* width :: */
+ /* The glyph's width. */
+ /* */
+ /* height :: */
+ /* The glyph's height. */
+ /* */
+ /* horiBearingX :: */
+ /* Left side bearing for horizontal layout. */
+ /* */
+ /* horiBearingY :: */
+ /* Top side bearing for horizontal layout. */
+ /* */
+ /* horiAdvance :: */
+ /* Advance width for horizontal layout. */
+ /* */
+ /* vertBearingX :: */
+ /* Left side bearing for vertical layout. */
+ /* */
+ /* vertBearingY :: */
+ /* Top side bearing for vertical layout. Larger positive values */
+ /* mean further below the vertical glyph origin. */
+ /* */
+ /* vertAdvance :: */
+ /* Advance height for vertical layout. Positive values mean the */
+ /* glyph has a positive advance downward. */
+ /* */
+ /* <Note> */
+ /* If not disabled with @FT_LOAD_NO_HINTING, the values represent */
+ /* dimensions of the hinted glyph (in case hinting is applicable). */
+ /* */
+ /* Stroking a glyph with an outside border does not increase */
+ /* `horiAdvance' or `vertAdvance'; you have to manually adjust these */
+ /* values to account for the added width and height. */
+ /* */
+ typedef struct FT_Glyph_Metrics_
+ {
+ FT_Pos width;
+ FT_Pos height;
+
+ FT_Pos horiBearingX;
+ FT_Pos horiBearingY;
+ FT_Pos horiAdvance;
+
+ FT_Pos vertBearingX;
+ FT_Pos vertBearingY;
+ FT_Pos vertAdvance;
+
+ } FT_Glyph_Metrics;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Bitmap_Size */
+ /* */
+ /* <Description> */
+ /* This structure models the metrics of a bitmap strike (i.e., a set */
+ /* of glyphs for a given point size and resolution) in a bitmap font. */
+ /* It is used for the `available_sizes' field of @FT_Face. */
+ /* */
+ /* <Fields> */
+ /* height :: The vertical distance, in pixels, between two */
+ /* consecutive baselines. It is always positive. */
+ /* */
+ /* width :: The average width, in pixels, of all glyphs in the */
+ /* strike. */
+ /* */
+ /* size :: The nominal size of the strike in 26.6 fractional */
+ /* points. This field is not very useful. */
+ /* */
+ /* x_ppem :: The horizontal ppem (nominal width) in 26.6 fractional */
+ /* pixels. */
+ /* */
+ /* y_ppem :: The vertical ppem (nominal height) in 26.6 fractional */
+ /* pixels. */
+ /* */
+ /* <Note> */
+ /* Windows FNT: */
+ /* The nominal size given in a FNT font is not reliable. Thus when */
+ /* the driver finds it incorrect, it sets `size' to some calculated */
+ /* values and sets `x_ppem' and `y_ppem' to the pixel width and */
+ /* height given in the font, respectively. */
+ /* */
+ /* TrueType embedded bitmaps: */
+ /* `size', `width', and `height' values are not contained in the */
+ /* bitmap strike itself. They are computed from the global font */
+ /* parameters. */
+ /* */
+ typedef struct FT_Bitmap_Size_
+ {
+ FT_Short height;
+ FT_Short width;
+
+ FT_Pos size;
+
+ FT_Pos x_ppem;
+ FT_Pos y_ppem;
+
+ } FT_Bitmap_Size;
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /* */
+ /* O B J E C T C L A S S E S */
+ /* */
+ /*************************************************************************/
+ /*************************************************************************/
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Library */
+ /* */
+ /* <Description> */
+ /* A handle to a FreeType library instance. Each `library' is */
+ /* completely independent from the others; it is the `root' of a set */
+ /* of objects like fonts, faces, sizes, etc. */
+ /* */
+ /* It also embeds a memory manager (see @FT_Memory), as well as a */
+ /* scan-line converter object (see @FT_Raster). */
+ /* */
+ /* In multi-threaded applications, make sure that the same FT_Library */
+ /* object or any of its children doesn't get accessed in parallel. */
+ /* */
+ /* <Note> */
+ /* Library objects are normally created by @FT_Init_FreeType, and */
+ /* destroyed with @FT_Done_FreeType. If you need reference-counting */
+ /* (cf. @FT_Reference_Library), use @FT_New_Library and */
+ /* @FT_Done_Library. */
+ /* */
+ typedef struct FT_LibraryRec_ *FT_Library;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Module */
+ /* */
+ /* <Description> */
+ /* A handle to a given FreeType module object. Each module can be a */
+ /* font driver, a renderer, or anything else that provides services */
+ /* to the formers. */
+ /* */
+ typedef struct FT_ModuleRec_* FT_Module;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Driver */
+ /* */
+ /* <Description> */
+ /* A handle to a given FreeType font driver object. Each font driver */
+ /* is a special module capable of creating faces from font files. */
+ /* */
+ typedef struct FT_DriverRec_* FT_Driver;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Renderer */
+ /* */
+ /* <Description> */
+ /* A handle to a given FreeType renderer. A renderer is a special */
+ /* module in charge of converting a glyph image to a bitmap, when */
+ /* necessary. Each renderer supports a given glyph image format, and */
+ /* one or more target surface depths. */
+ /* */
+ typedef struct FT_RendererRec_* FT_Renderer;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Face */
+ /* */
+ /* <Description> */
+ /* A handle to a given typographic face object. A face object models */
+ /* a given typeface, in a given style. */
+ /* */
+ /* <Note> */
+ /* Each face object also owns a single @FT_GlyphSlot object, as well */
+ /* as one or more @FT_Size objects. */
+ /* */
+ /* Use @FT_New_Face or @FT_Open_Face to create a new face object from */
+ /* a given filepathname or a custom input stream. */
+ /* */
+ /* Use @FT_Done_Face to destroy it (along with its slot and sizes). */
+ /* */
+ /* <Also> */
+ /* See @FT_FaceRec for the publicly accessible fields of a given face */
+ /* object. */
+ /* */
+ typedef struct FT_FaceRec_* FT_Face;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Size */
+ /* */
+ /* <Description> */
+ /* A handle to an object used to model a face scaled to a given */
+ /* character size. */
+ /* */
+ /* <Note> */
+ /* Each @FT_Face has an _active_ @FT_Size object that is used by */
+ /* functions like @FT_Load_Glyph to determine the scaling */
+ /* transformation which is used to load and hint glyphs and metrics. */
+ /* */
+ /* You can use @FT_Set_Char_Size, @FT_Set_Pixel_Sizes, */
+ /* @FT_Request_Size or even @FT_Select_Size to change the content */
+ /* (i.e., the scaling values) of the active @FT_Size. */
+ /* */
+ /* You can use @FT_New_Size to create additional size objects for a */
+ /* given @FT_Face, but they won't be used by other functions until */
+ /* you activate it through @FT_Activate_Size. Only one size can be */
+ /* activated at any given time per face. */
+ /* */
+ /* <Also> */
+ /* See @FT_SizeRec for the publicly accessible fields of a given size */
+ /* object. */
+ /* */
+ typedef struct FT_SizeRec_* FT_Size;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_GlyphSlot */
+ /* */
+ /* <Description> */
+ /* A handle to a given `glyph slot'. A slot is a container where it */
+ /* is possible to load any of the glyphs contained in its parent */
+ /* face. */
+ /* */
+ /* In other words, each time you call @FT_Load_Glyph or */
+ /* @FT_Load_Char, the slot's content is erased by the new glyph data, */
+ /* i.e., the glyph's metrics, its image (bitmap or outline), and */
+ /* other control information. */
+ /* */
+ /* <Also> */
+ /* See @FT_GlyphSlotRec for the publicly accessible glyph fields. */
+ /* */
+ typedef struct FT_GlyphSlotRec_* FT_GlyphSlot;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_CharMap */
+ /* */
+ /* <Description> */
+ /* A handle to a given character map. A charmap is used to translate */
+ /* character codes in a given encoding into glyph indexes for its */
+ /* parent's face. Some font formats may provide several charmaps per */
+ /* font. */
+ /* */
+ /* Each face object owns zero or more charmaps, but only one of them */
+ /* can be `active' and used by @FT_Get_Char_Index or @FT_Load_Char. */
+ /* */
+ /* The list of available charmaps in a face is available through the */
+ /* `face->num_charmaps' and `face->charmaps' fields of @FT_FaceRec. */
+ /* */
+ /* The currently active charmap is available as `face->charmap'. */
+ /* You should call @FT_Set_Charmap to change it. */
+ /* */
+ /* <Note> */
+ /* When a new face is created (either through @FT_New_Face or */
+ /* @FT_Open_Face), the library looks for a Unicode charmap within */
+ /* the list and automatically activates it. */
+ /* */
+ /* <Also> */
+ /* See @FT_CharMapRec for the publicly accessible fields of a given */
+ /* character map. */
+ /* */
+ typedef struct FT_CharMapRec_* FT_CharMap;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Macro> */
+ /* FT_ENC_TAG */
+ /* */
+ /* <Description> */
+ /* This macro converts four-letter tags into an unsigned long. It is */
+ /* used to define `encoding' identifiers (see @FT_Encoding). */
+ /* */
+ /* <Note> */
+ /* Since many 16-bit compilers don't like 32-bit enumerations, you */
+ /* should redefine this macro in case of problems to something like */
+ /* this: */
+ /* */
+ /* { */
+ /* #define FT_ENC_TAG( value, a, b, c, d ) value */
+ /* } */
+ /* */
+ /* to get a simple enumeration without assigning special numbers. */
+ /* */
+
+#ifndef FT_ENC_TAG
+#define FT_ENC_TAG( value, a, b, c, d ) \
+ value = ( ( (FT_UInt32)(a) << 24 ) | \
+ ( (FT_UInt32)(b) << 16 ) | \
+ ( (FT_UInt32)(c) << 8 ) | \
+ (FT_UInt32)(d) )
+
+#endif /* FT_ENC_TAG */
+
+
+ /*************************************************************************/
+ /* */
+ /* <Enum> */
+ /* FT_Encoding */
+ /* */
+ /* <Description> */
+ /* An enumeration used to specify character sets supported by */
+ /* charmaps. Used in the @FT_Select_Charmap API function. */
+ /* */
+ /* <Note> */
+ /* Despite the name, this enumeration lists specific character */
+ /* repertories (i.e., charsets), and not text encoding methods (e.g., */
+ /* UTF-8, UTF-16, etc.). */
+ /* */
+ /* Other encodings might be defined in the future. */
+ /* */
+ /* <Values> */
+ /* FT_ENCODING_NONE :: */
+ /* The encoding value~0 is reserved. */
+ /* */
+ /* FT_ENCODING_UNICODE :: */
+ /* Corresponds to the Unicode character set. This value covers */
+ /* all versions of the Unicode repertoire, including ASCII and */
+ /* Latin-1. Most fonts include a Unicode charmap, but not all */
+ /* of them. */
+ /* */
+ /* For example, if you want to access Unicode value U+1F028 (and */
+ /* the font contains it), use value 0x1F028 as the input value for */
+ /* @FT_Get_Char_Index. */
+ /* */
+ /* FT_ENCODING_MS_SYMBOL :: */
+ /* Corresponds to the Microsoft Symbol encoding, used to encode */
+ /* mathematical symbols in the 32..255 character code range. For */
+ /* more information, see `http://www.ceviz.net/symbol.htm'. */
+ /* */
+ /* FT_ENCODING_SJIS :: */
+ /* Corresponds to Japanese SJIS encoding. More info at */
+ /* at `http://langsupport.japanreference.com/encoding.shtml'. */
+ /* See note on multi-byte encodings below. */
+ /* */
+ /* FT_ENCODING_GB2312 :: */
+ /* Corresponds to an encoding system for Simplified Chinese as used */
+ /* used in mainland China. */
+ /* */
+ /* FT_ENCODING_BIG5 :: */
+ /* Corresponds to an encoding system for Traditional Chinese as */
+ /* used in Taiwan and Hong Kong. */
+ /* */
+ /* FT_ENCODING_WANSUNG :: */
+ /* Corresponds to the Korean encoding system known as Wansung. */
+ /* For more information see */
+ /* `http://www.microsoft.com/typography/unicode/949.txt'. */
+ /* */
+ /* FT_ENCODING_JOHAB :: */
+ /* The Korean standard character set (KS~C 5601-1992), which */
+ /* corresponds to MS Windows code page 1361. This character set */
+ /* includes all possible Hangeul character combinations. */
+ /* */
+ /* FT_ENCODING_ADOBE_LATIN_1 :: */
+ /* Corresponds to a Latin-1 encoding as defined in a Type~1 */
+ /* PostScript font. It is limited to 256 character codes. */
+ /* */
+ /* FT_ENCODING_ADOBE_STANDARD :: */
+ /* Corresponds to the Adobe Standard encoding, as found in Type~1, */
+ /* CFF, and OpenType/CFF fonts. It is limited to 256 character */
+ /* codes. */
+ /* */
+ /* FT_ENCODING_ADOBE_EXPERT :: */
+ /* Corresponds to the Adobe Expert encoding, as found in Type~1, */
+ /* CFF, and OpenType/CFF fonts. It is limited to 256 character */
+ /* codes. */
+ /* */
+ /* FT_ENCODING_ADOBE_CUSTOM :: */
+ /* Corresponds to a custom encoding, as found in Type~1, CFF, and */
+ /* OpenType/CFF fonts. It is limited to 256 character codes. */
+ /* */
+ /* FT_ENCODING_APPLE_ROMAN :: */
+ /* Corresponds to the 8-bit Apple roman encoding. Many TrueType */
+ /* and OpenType fonts contain a charmap for this encoding, since */
+ /* older versions of Mac OS are able to use it. */
+ /* */
+ /* FT_ENCODING_OLD_LATIN_2 :: */
+ /* This value is deprecated and was never used nor reported by */
+ /* FreeType. Don't use or test for it. */
+ /* */
+ /* FT_ENCODING_MS_SJIS :: */
+ /* Same as FT_ENCODING_SJIS. Deprecated. */
+ /* */
+ /* FT_ENCODING_MS_GB2312 :: */
+ /* Same as FT_ENCODING_GB2312. Deprecated. */
+ /* */
+ /* FT_ENCODING_MS_BIG5 :: */
+ /* Same as FT_ENCODING_BIG5. Deprecated. */
+ /* */
+ /* FT_ENCODING_MS_WANSUNG :: */
+ /* Same as FT_ENCODING_WANSUNG. Deprecated. */
+ /* */
+ /* FT_ENCODING_MS_JOHAB :: */
+ /* Same as FT_ENCODING_JOHAB. Deprecated. */
+ /* */
+ /* <Note> */
+ /* By default, FreeType automatically synthesizes a Unicode charmap */
+ /* for PostScript fonts, using their glyph names dictionaries. */
+ /* However, it also reports the encodings defined explicitly in the */
+ /* font file, for the cases when they are needed, with the Adobe */
+ /* values as well. */
+ /* */
+ /* FT_ENCODING_NONE is set by the BDF and PCF drivers if the charmap */
+ /* is neither Unicode nor ISO-8859-1 (otherwise it is set to */
+ /* FT_ENCODING_UNICODE). Use @FT_Get_BDF_Charset_ID to find out */
+ /* which encoding is really present. If, for example, the */
+ /* `cs_registry' field is `KOI8' and the `cs_encoding' field is `R', */
+ /* the font is encoded in KOI8-R. */
+ /* */
+ /* FT_ENCODING_NONE is always set (with a single exception) by the */
+ /* winfonts driver. Use @FT_Get_WinFNT_Header and examine the */
+ /* `charset' field of the @FT_WinFNT_HeaderRec structure to find out */
+ /* which encoding is really present. For example, */
+ /* @FT_WinFNT_ID_CP1251 (204) means Windows code page 1251 (for */
+ /* Russian). */
+ /* */
+ /* FT_ENCODING_NONE is set if `platform_id' is @TT_PLATFORM_MACINTOSH */
+ /* and `encoding_id' is not @TT_MAC_ID_ROMAN (otherwise it is set to */
+ /* FT_ENCODING_APPLE_ROMAN). */
+ /* */
+ /* If `platform_id' is @TT_PLATFORM_MACINTOSH, use the function */
+ /* @FT_Get_CMap_Language_ID to query the Mac language ID which may */
+ /* be needed to be able to distinguish Apple encoding variants. See */
+ /* */
+ /* http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/README.TXT */
+ /* */
+ /* to get an idea how to do that. Basically, if the language ID */
+ /* is~0, don't use it, otherwise subtract 1 from the language ID. */
+ /* Then examine `encoding_id'. If, for example, `encoding_id' is */
+ /* @TT_MAC_ID_ROMAN and the language ID (minus~1) is */
+ /* `TT_MAC_LANGID_GREEK', it is the Greek encoding, not Roman. */
+ /* @TT_MAC_ID_ARABIC with `TT_MAC_LANGID_FARSI' means the Farsi */
+ /* variant the Arabic encoding. */
+ /* */
+ typedef enum FT_Encoding_
+ {
+ FT_ENC_TAG( FT_ENCODING_NONE, 0, 0, 0, 0 ),
+
+ FT_ENC_TAG( FT_ENCODING_MS_SYMBOL, 's', 'y', 'm', 'b' ),
+ FT_ENC_TAG( FT_ENCODING_UNICODE, 'u', 'n', 'i', 'c' ),
+
+ FT_ENC_TAG( FT_ENCODING_SJIS, 's', 'j', 'i', 's' ),
+ FT_ENC_TAG( FT_ENCODING_GB2312, 'g', 'b', ' ', ' ' ),
+ FT_ENC_TAG( FT_ENCODING_BIG5, 'b', 'i', 'g', '5' ),
+ FT_ENC_TAG( FT_ENCODING_WANSUNG, 'w', 'a', 'n', 's' ),
+ FT_ENC_TAG( FT_ENCODING_JOHAB, 'j', 'o', 'h', 'a' ),
+
+ /* for backwards compatibility */
+ FT_ENCODING_MS_SJIS = FT_ENCODING_SJIS,
+ FT_ENCODING_MS_GB2312 = FT_ENCODING_GB2312,
+ FT_ENCODING_MS_BIG5 = FT_ENCODING_BIG5,
+ FT_ENCODING_MS_WANSUNG = FT_ENCODING_WANSUNG,
+ FT_ENCODING_MS_JOHAB = FT_ENCODING_JOHAB,
+
+ FT_ENC_TAG( FT_ENCODING_ADOBE_STANDARD, 'A', 'D', 'O', 'B' ),
+ FT_ENC_TAG( FT_ENCODING_ADOBE_EXPERT, 'A', 'D', 'B', 'E' ),
+ FT_ENC_TAG( FT_ENCODING_ADOBE_CUSTOM, 'A', 'D', 'B', 'C' ),
+ FT_ENC_TAG( FT_ENCODING_ADOBE_LATIN_1, 'l', 'a', 't', '1' ),
+
+ FT_ENC_TAG( FT_ENCODING_OLD_LATIN_2, 'l', 'a', 't', '2' ),
+
+ FT_ENC_TAG( FT_ENCODING_APPLE_ROMAN, 'a', 'r', 'm', 'n' )
+
+ } FT_Encoding;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Enum> */
+ /* ft_encoding_xxx */
+ /* */
+ /* <Description> */
+ /* These constants are deprecated; use the corresponding @FT_Encoding */
+ /* values instead. */
+ /* */
+#define ft_encoding_none FT_ENCODING_NONE
+#define ft_encoding_unicode FT_ENCODING_UNICODE
+#define ft_encoding_symbol FT_ENCODING_MS_SYMBOL
+#define ft_encoding_latin_1 FT_ENCODING_ADOBE_LATIN_1
+#define ft_encoding_latin_2 FT_ENCODING_OLD_LATIN_2
+#define ft_encoding_sjis FT_ENCODING_SJIS
+#define ft_encoding_gb2312 FT_ENCODING_GB2312
+#define ft_encoding_big5 FT_ENCODING_BIG5
+#define ft_encoding_wansung FT_ENCODING_WANSUNG
+#define ft_encoding_johab FT_ENCODING_JOHAB
+
+#define ft_encoding_adobe_standard FT_ENCODING_ADOBE_STANDARD
+#define ft_encoding_adobe_expert FT_ENCODING_ADOBE_EXPERT
+#define ft_encoding_adobe_custom FT_ENCODING_ADOBE_CUSTOM
+#define ft_encoding_apple_roman FT_ENCODING_APPLE_ROMAN
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_CharMapRec */
+ /* */
+ /* <Description> */
+ /* The base charmap structure. */
+ /* */
+ /* <Fields> */
+ /* face :: A handle to the parent face object. */
+ /* */
+ /* encoding :: An @FT_Encoding tag identifying the charmap. Use */
+ /* this with @FT_Select_Charmap. */
+ /* */
+ /* platform_id :: An ID number describing the platform for the */
+ /* following encoding ID. This comes directly from */
+ /* the TrueType specification and should be emulated */
+ /* for other formats. */
+ /* */
+ /* encoding_id :: A platform specific encoding number. This also */
+ /* comes from the TrueType specification and should be */
+ /* emulated similarly. */
+ /* */
+ typedef struct FT_CharMapRec_
+ {
+ FT_Face face;
+ FT_Encoding encoding;
+ FT_UShort platform_id;
+ FT_UShort encoding_id;
+
+ } FT_CharMapRec;
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /* */
+ /* B A S E O B J E C T C L A S S E S */
+ /* */
+ /*************************************************************************/
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Face_Internal */
+ /* */
+ /* <Description> */
+ /* An opaque handle to an `FT_Face_InternalRec' structure, used to */
+ /* model private data of a given @FT_Face object. */
+ /* */
+ /* This structure might change between releases of FreeType~2 and is */
+ /* not generally available to client applications. */
+ /* */
+ typedef struct FT_Face_InternalRec_* FT_Face_Internal;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_FaceRec */
+ /* */
+ /* <Description> */
+ /* FreeType root face class structure. A face object models a */
+ /* typeface in a font file. */
+ /* */
+ /* <Fields> */
+ /* num_faces :: The number of faces in the font file. Some */
+ /* font formats can have multiple faces in */
+ /* a font file. */
+ /* */
+ /* face_index :: The index of the face in the font file. It */
+ /* is set to~0 if there is only one face in */
+ /* the font file. */
+ /* */
+ /* face_flags :: A set of bit flags that give important */
+ /* information about the face; see */
+ /* @FT_FACE_FLAG_XXX for the details. */
+ /* */
+ /* style_flags :: A set of bit flags indicating the style of */
+ /* the face; see @FT_STYLE_FLAG_XXX for the */
+ /* details. */
+ /* */
+ /* num_glyphs :: The number of glyphs in the face. If the */
+ /* face is scalable and has sbits (see */
+ /* `num_fixed_sizes'), it is set to the number */
+ /* of outline glyphs. */
+ /* */
+ /* For CID-keyed fonts, this value gives the */
+ /* highest CID used in the font. */
+ /* */
+ /* family_name :: The face's family name. This is an ASCII */
+ /* string, usually in English, which describes */
+ /* the typeface's family (like `Times New */
+ /* Roman', `Bodoni', `Garamond', etc). This */
+ /* is a least common denominator used to list */
+ /* fonts. Some formats (TrueType & OpenType) */
+ /* provide localized and Unicode versions of */
+ /* this string. Applications should use the */
+ /* format specific interface to access them. */
+ /* Can be NULL (e.g., in fonts embedded in a */
+ /* PDF file). */
+ /* */
+ /* style_name :: The face's style name. This is an ASCII */
+ /* string, usually in English, which describes */
+ /* the typeface's style (like `Italic', */
+ /* `Bold', `Condensed', etc). Not all font */
+ /* formats provide a style name, so this field */
+ /* is optional, and can be set to NULL. As */
+ /* for `family_name', some formats provide */
+ /* localized and Unicode versions of this */
+ /* string. Applications should use the format */
+ /* specific interface to access them. */
+ /* */
+ /* num_fixed_sizes :: The number of bitmap strikes in the face. */
+ /* Even if the face is scalable, there might */
+ /* still be bitmap strikes, which are called */
+ /* `sbits' in that case. */
+ /* */
+ /* available_sizes :: An array of @FT_Bitmap_Size for all bitmap */
+ /* strikes in the face. It is set to NULL if */
+ /* there is no bitmap strike. */
+ /* */
+ /* num_charmaps :: The number of charmaps in the face. */
+ /* */
+ /* charmaps :: An array of the charmaps of the face. */
+ /* */
+ /* generic :: A field reserved for client uses. See the */
+ /* @FT_Generic type description. */
+ /* */
+ /* bbox :: The font bounding box. Coordinates are */
+ /* expressed in font units (see */
+ /* `units_per_EM'). The box is large enough */
+ /* to contain any glyph from the font. Thus, */
+ /* `bbox.yMax' can be seen as the `maximum */
+ /* ascender', and `bbox.yMin' as the `minimum */
+ /* descender'. Only relevant for scalable */
+ /* formats. */
+ /* */
+ /* Note that the bounding box might be off by */
+ /* (at least) one pixel for hinted fonts. See */
+ /* @FT_Size_Metrics for further discussion. */
+ /* */
+ /* units_per_EM :: The number of font units per EM square for */
+ /* this face. This is typically 2048 for */
+ /* TrueType fonts, and 1000 for Type~1 fonts. */
+ /* Only relevant for scalable formats. */
+ /* */
+ /* ascender :: The typographic ascender of the face, */
+ /* expressed in font units. For font formats */
+ /* not having this information, it is set to */
+ /* `bbox.yMax'. Only relevant for scalable */
+ /* formats. */
+ /* */
+ /* descender :: The typographic descender of the face, */
+ /* expressed in font units. For font formats */
+ /* not having this information, it is set to */
+ /* `bbox.yMin'. Note that this field is */
+ /* usually negative. Only relevant for */
+ /* scalable formats. */
+ /* */
+ /* height :: This value is the vertical distance */
+ /* between two consecutive baselines, */
+ /* expressed in font units. It is always */
+ /* positive. Only relevant for scalable */
+ /* formats. */
+ /* */
+ /* If you want the global glyph height, use */
+ /* `ascender - descender'. */
+ /* */
+ /* max_advance_width :: The maximum advance width, in font units, */
+ /* for all glyphs in this face. This can be */
+ /* used to make word wrapping computations */
+ /* faster. Only relevant for scalable */
+ /* formats. */
+ /* */
+ /* max_advance_height :: The maximum advance height, in font units, */
+ /* for all glyphs in this face. This is only */
+ /* relevant for vertical layouts, and is set */
+ /* to `height' for fonts that do not provide */
+ /* vertical metrics. Only relevant for */
+ /* scalable formats. */
+ /* */
+ /* underline_position :: The position, in font units, of the */
+ /* underline line for this face. It is the */
+ /* center of the underlining stem. Only */
+ /* relevant for scalable formats. */
+ /* */
+ /* underline_thickness :: The thickness, in font units, of the */
+ /* underline for this face. Only relevant for */
+ /* scalable formats. */
+ /* */
+ /* glyph :: The face's associated glyph slot(s). */
+ /* */
+ /* size :: The current active size for this face. */
+ /* */
+ /* charmap :: The current active charmap for this face. */
+ /* */
+ /* <Note> */
+ /* Fields may be changed after a call to @FT_Attach_File or */
+ /* @FT_Attach_Stream. */
+ /* */
+ typedef struct FT_FaceRec_
+ {
+ FT_Long num_faces;
+ FT_Long face_index;
+
+ FT_Long face_flags;
+ FT_Long style_flags;
+
+ FT_Long num_glyphs;
+
+ FT_String* family_name;
+ FT_String* style_name;
+
+ FT_Int num_fixed_sizes;
+ FT_Bitmap_Size* available_sizes;
+
+ FT_Int num_charmaps;
+ FT_CharMap* charmaps;
+
+#ifdef _FX_MANAGED_CODE_
+#define generic generic_data
+#endif
+
+ FT_Generic generic;
+
+ /*# The following member variables (down to `underline_thickness') */
+ /*# are only relevant to scalable outlines; cf. @FT_Bitmap_Size */
+ /*# for bitmap fonts. */
+ FT_BBox bbox;
+
+ FT_UShort units_per_EM;
+ FT_Short ascender;
+ FT_Short descender;
+ FT_Short height;
+
+ FT_Short max_advance_width;
+ FT_Short max_advance_height;
+
+ FT_Short underline_position;
+ FT_Short underline_thickness;
+
+ FT_GlyphSlot glyph;
+ FT_Size size;
+ FT_CharMap charmap;
+
+ /*@private begin */
+
+ FT_Driver driver;
+ FT_Memory memory;
+ FT_Stream stream;
+
+ FT_ListRec sizes_list;
+
+ FT_Generic autohint; /* face-specific auto-hinter data */
+ void* extensions; /* unused */
+
+ FT_Face_Internal internal;
+
+ /*@private end */
+
+ } FT_FaceRec;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Enum> */
+ /* FT_FACE_FLAG_XXX */
+ /* */
+ /* <Description> */
+ /* A list of bit flags used in the `face_flags' field of the */
+ /* @FT_FaceRec structure. They inform client applications of */
+ /* properties of the corresponding face. */
+ /* */
+ /* <Values> */
+ /* FT_FACE_FLAG_SCALABLE :: */
+ /* Indicates that the face contains outline glyphs. This doesn't */
+ /* prevent bitmap strikes, i.e., a face can have both this and */
+ /* and @FT_FACE_FLAG_FIXED_SIZES set. */
+ /* */
+ /* FT_FACE_FLAG_FIXED_SIZES :: */
+ /* Indicates that the face contains bitmap strikes. See also the */
+ /* `num_fixed_sizes' and `available_sizes' fields of @FT_FaceRec. */
+ /* */
+ /* FT_FACE_FLAG_FIXED_WIDTH :: */
+ /* Indicates that the face contains fixed-width characters (like */
+ /* Courier, Lucido, MonoType, etc.). */
+ /* */
+ /* FT_FACE_FLAG_SFNT :: */
+ /* Indicates that the face uses the `sfnt' storage scheme. For */
+ /* now, this means TrueType and OpenType. */
+ /* */
+ /* FT_FACE_FLAG_HORIZONTAL :: */
+ /* Indicates that the face contains horizontal glyph metrics. This */
+ /* should be set for all common formats. */
+ /* */
+ /* FT_FACE_FLAG_VERTICAL :: */
+ /* Indicates that the face contains vertical glyph metrics. This */
+ /* is only available in some formats, not all of them. */
+ /* */
+ /* FT_FACE_FLAG_KERNING :: */
+ /* Indicates that the face contains kerning information. If set, */
+ /* the kerning distance can be retrieved through the function */
+ /* @FT_Get_Kerning. Otherwise the function always return the */
+ /* vector (0,0). Note that FreeType doesn't handle kerning data */
+ /* from the `GPOS' table (as present in some OpenType fonts). */
+ /* */
+ /* FT_FACE_FLAG_FAST_GLYPHS :: */
+ /* THIS FLAG IS DEPRECATED. DO NOT USE OR TEST IT. */
+ /* */
+ /* FT_FACE_FLAG_MULTIPLE_MASTERS :: */
+ /* Indicates that the font contains multiple masters and is capable */
+ /* of interpolating between them. See the multiple-masters */
+ /* specific API for details. */
+ /* */
+ /* FT_FACE_FLAG_GLYPH_NAMES :: */
+ /* Indicates that the font contains glyph names that can be */
+ /* retrieved through @FT_Get_Glyph_Name. Note that some TrueType */
+ /* fonts contain broken glyph name tables. Use the function */
+ /* @FT_Has_PS_Glyph_Names when needed. */
+ /* */
+ /* FT_FACE_FLAG_EXTERNAL_STREAM :: */
+ /* Used internally by FreeType to indicate that a face's stream was */
+ /* provided by the client application and should not be destroyed */
+ /* when @FT_Done_Face is called. Don't read or test this flag. */
+ /* */
+ /* FT_FACE_FLAG_HINTER :: */
+ /* Set if the font driver has a hinting machine of its own. For */
+ /* example, with TrueType fonts, it makes sense to use data from */
+ /* the SFNT `gasp' table only if the native TrueType hinting engine */
+ /* (with the bytecode interpreter) is available and active. */
+ /* */
+ /* FT_FACE_FLAG_CID_KEYED :: */
+ /* Set if the font is CID-keyed. In that case, the font is not */
+ /* accessed by glyph indices but by CID values. For subsetted */
+ /* CID-keyed fonts this has the consequence that not all index */
+ /* values are a valid argument to FT_Load_Glyph. Only the CID */
+ /* values for which corresponding glyphs in the subsetted font */
+ /* exist make FT_Load_Glyph return successfully; in all other cases */
+ /* you get an `FT_Err_Invalid_Argument' error. */
+ /* */
+ /* Note that CID-keyed fonts which are in an SFNT wrapper don't */
+ /* have this flag set since the glyphs are accessed in the normal */
+ /* way (using contiguous indices); the `CID-ness' isn't visible to */
+ /* the application. */
+ /* */
+ /* FT_FACE_FLAG_TRICKY :: */
+ /* Set if the font is `tricky', this is, it always needs the */
+ /* font format's native hinting engine to get a reasonable result. */
+ /* A typical example is the Chinese font `mingli.ttf' which uses */
+ /* TrueType bytecode instructions to move and scale all of its */
+ /* subglyphs. */
+ /* */
+ /* It is not possible to autohint such fonts using */
+ /* @FT_LOAD_FORCE_AUTOHINT; it will also ignore */
+ /* @FT_LOAD_NO_HINTING. You have to set both @FT_LOAD_NO_HINTING */
+ /* and @FT_LOAD_NO_AUTOHINT to really disable hinting; however, you */
+ /* probably never want this except for demonstration purposes. */
+ /* */
+ /* Currently, there are about a dozen TrueType fonts in the list of */
+ /* tricky fonts; they are hard-coded in file `ttobjs.c'. */
+ /* */
+#define FT_FACE_FLAG_SCALABLE ( 1L << 0 )
+#define FT_FACE_FLAG_FIXED_SIZES ( 1L << 1 )
+#define FT_FACE_FLAG_FIXED_WIDTH ( 1L << 2 )
+#define FT_FACE_FLAG_SFNT ( 1L << 3 )
+#define FT_FACE_FLAG_HORIZONTAL ( 1L << 4 )
+#define FT_FACE_FLAG_VERTICAL ( 1L << 5 )
+#define FT_FACE_FLAG_KERNING ( 1L << 6 )
+#define FT_FACE_FLAG_FAST_GLYPHS ( 1L << 7 )
+#define FT_FACE_FLAG_MULTIPLE_MASTERS ( 1L << 8 )
+#define FT_FACE_FLAG_GLYPH_NAMES ( 1L << 9 )
+#define FT_FACE_FLAG_EXTERNAL_STREAM ( 1L << 10 )
+#define FT_FACE_FLAG_HINTER ( 1L << 11 )
+#define FT_FACE_FLAG_CID_KEYED ( 1L << 12 )
+#define FT_FACE_FLAG_TRICKY ( 1L << 13 )
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_HAS_HORIZONTAL( face )
+ *
+ * @description:
+ * A macro that returns true whenever a face object contains
+ * horizontal metrics (this is true for all font formats though).
+ *
+ * @also:
+ * @FT_HAS_VERTICAL can be used to check for vertical metrics.
+ *
+ */
+#define FT_HAS_HORIZONTAL( face ) \
+ ( face->face_flags & FT_FACE_FLAG_HORIZONTAL )
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_HAS_VERTICAL( face )
+ *
+ * @description:
+ * A macro that returns true whenever a face object contains real
+ * vertical metrics (and not only synthesized ones).
+ *
+ */
+#define FT_HAS_VERTICAL( face ) \
+ ( face->face_flags & FT_FACE_FLAG_VERTICAL )
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_HAS_KERNING( face )
+ *
+ * @description:
+ * A macro that returns true whenever a face object contains kerning
+ * data that can be accessed with @FT_Get_Kerning.
+ *
+ */
+#define FT_HAS_KERNING( face ) \
+ ( face->face_flags & FT_FACE_FLAG_KERNING )
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_IS_SCALABLE( face )
+ *
+ * @description:
+ * A macro that returns true whenever a face object contains a scalable
+ * font face (true for TrueType, Type~1, Type~42, CID, OpenType/CFF,
+ * and PFR font formats.
+ *
+ */
+#define FT_IS_SCALABLE( face ) \
+ ( face->face_flags & FT_FACE_FLAG_SCALABLE )
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_IS_SFNT( face )
+ *
+ * @description:
+ * A macro that returns true whenever a face object contains a font
+ * whose format is based on the SFNT storage scheme. This usually
+ * means: TrueType fonts, OpenType fonts, as well as SFNT-based embedded
+ * bitmap fonts.
+ *
+ * If this macro is true, all functions defined in @FT_SFNT_NAMES_H and
+ * @FT_TRUETYPE_TABLES_H are available.
+ *
+ */
+#define FT_IS_SFNT( face ) \
+ ( face->face_flags & FT_FACE_FLAG_SFNT )
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_IS_FIXED_WIDTH( face )
+ *
+ * @description:
+ * A macro that returns true whenever a face object contains a font face
+ * that contains fixed-width (or `monospace', `fixed-pitch', etc.)
+ * glyphs.
+ *
+ */
+#define FT_IS_FIXED_WIDTH( face ) \
+ ( face->face_flags & FT_FACE_FLAG_FIXED_WIDTH )
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_HAS_FIXED_SIZES( face )
+ *
+ * @description:
+ * A macro that returns true whenever a face object contains some
+ * embedded bitmaps. See the `available_sizes' field of the
+ * @FT_FaceRec structure.
+ *
+ */
+#define FT_HAS_FIXED_SIZES( face ) \
+ ( face->face_flags & FT_FACE_FLAG_FIXED_SIZES )
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_HAS_FAST_GLYPHS( face )
+ *
+ * @description:
+ * Deprecated.
+ *
+ */
+#define FT_HAS_FAST_GLYPHS( face ) 0
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_HAS_GLYPH_NAMES( face )
+ *
+ * @description:
+ * A macro that returns true whenever a face object contains some glyph
+ * names that can be accessed through @FT_Get_Glyph_Name.
+ *
+ */
+#define FT_HAS_GLYPH_NAMES( face ) \
+ ( face->face_flags & FT_FACE_FLAG_GLYPH_NAMES )
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_HAS_MULTIPLE_MASTERS( face )
+ *
+ * @description:
+ * A macro that returns true whenever a face object contains some
+ * multiple masters. The functions provided by @FT_MULTIPLE_MASTERS_H
+ * are then available to choose the exact design you want.
+ *
+ */
+#define FT_HAS_MULTIPLE_MASTERS( face ) \
+ ( face->face_flags & FT_FACE_FLAG_MULTIPLE_MASTERS )
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_IS_CID_KEYED( face )
+ *
+ * @description:
+ * A macro that returns true whenever a face object contains a CID-keyed
+ * font. See the discussion of @FT_FACE_FLAG_CID_KEYED for more
+ * details.
+ *
+ * If this macro is true, all functions defined in @FT_CID_H are
+ * available.
+ *
+ */
+#define FT_IS_CID_KEYED( face ) \
+ ( face->face_flags & FT_FACE_FLAG_CID_KEYED )
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_IS_TRICKY( face )
+ *
+ * @description:
+ * A macro that returns true whenever a face represents a `tricky' font.
+ * See the discussion of @FT_FACE_FLAG_TRICKY for more details.
+ *
+ */
+#define FT_IS_TRICKY( face ) \
+ ( face->face_flags & FT_FACE_FLAG_TRICKY )
+
+
+ /*************************************************************************/
+ /* */
+ /* <Const> */
+ /* FT_STYLE_FLAG_XXX */
+ /* */
+ /* <Description> */
+ /* A list of bit-flags used to indicate the style of a given face. */
+ /* These are used in the `style_flags' field of @FT_FaceRec. */
+ /* */
+ /* <Values> */
+ /* FT_STYLE_FLAG_ITALIC :: */
+ /* Indicates that a given face style is italic or oblique. */
+ /* */
+ /* FT_STYLE_FLAG_BOLD :: */
+ /* Indicates that a given face is bold. */
+ /* */
+ /* <Note> */
+ /* The style information as provided by FreeType is very basic. More */
+ /* details are beyond the scope and should be done on a higher level */
+ /* (for example, by analyzing various fields of the `OS/2' table in */
+ /* SFNT based fonts). */
+ /* */
+#define FT_STYLE_FLAG_ITALIC ( 1 << 0 )
+#define FT_STYLE_FLAG_BOLD ( 1 << 1 )
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Size_Internal */
+ /* */
+ /* <Description> */
+ /* An opaque handle to an `FT_Size_InternalRec' structure, used to */
+ /* model private data of a given @FT_Size object. */
+ /* */
+ typedef struct FT_Size_InternalRec_* FT_Size_Internal;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Size_Metrics */
+ /* */
+ /* <Description> */
+ /* The size metrics structure gives the metrics of a size object. */
+ /* */
+ /* <Fields> */
+ /* x_ppem :: The width of the scaled EM square in pixels, hence */
+ /* the term `ppem' (pixels per EM). It is also */
+ /* referred to as `nominal width'. */
+ /* */
+ /* y_ppem :: The height of the scaled EM square in pixels, */
+ /* hence the term `ppem' (pixels per EM). It is also */
+ /* referred to as `nominal height'. */
+ /* */
+ /* x_scale :: A 16.16 fractional scaling value used to convert */
+ /* horizontal metrics from font units to 26.6 */
+ /* fractional pixels. Only relevant for scalable */
+ /* font formats. */
+ /* */
+ /* y_scale :: A 16.16 fractional scaling value used to convert */
+ /* vertical metrics from font units to 26.6 */
+ /* fractional pixels. Only relevant for scalable */
+ /* font formats. */
+ /* */
+ /* ascender :: The ascender in 26.6 fractional pixels. See */
+ /* @FT_FaceRec for the details. */
+ /* */
+ /* descender :: The descender in 26.6 fractional pixels. See */
+ /* @FT_FaceRec for the details. */
+ /* */
+ /* height :: The height in 26.6 fractional pixels. See */
+ /* @FT_FaceRec for the details. */
+ /* */
+ /* max_advance :: The maximum advance width in 26.6 fractional */
+ /* pixels. See @FT_FaceRec for the details. */
+ /* */
+ /* <Note> */
+ /* The scaling values, if relevant, are determined first during a */
+ /* size changing operation. The remaining fields are then set by the */
+ /* driver. For scalable formats, they are usually set to scaled */
+ /* values of the corresponding fields in @FT_FaceRec. */
+ /* */
+ /* Note that due to glyph hinting, these values might not be exact */
+ /* for certain fonts. Thus they must be treated as unreliable */
+ /* with an error margin of at least one pixel! */
+ /* */
+ /* Indeed, the only way to get the exact metrics is to render _all_ */
+ /* glyphs. As this would be a definite performance hit, it is up to */
+ /* client applications to perform such computations. */
+ /* */
+ /* The FT_Size_Metrics structure is valid for bitmap fonts also. */
+ /* */
+ typedef struct FT_Size_Metrics_
+ {
+ FT_UShort x_ppem; /* horizontal pixels per EM */
+ FT_UShort y_ppem; /* vertical pixels per EM */
+
+ FT_Fixed x_scale; /* scaling values used to convert font */
+ FT_Fixed y_scale; /* units to 26.6 fractional pixels */
+
+ FT_Pos ascender; /* ascender in 26.6 frac. pixels */
+ FT_Pos descender; /* descender in 26.6 frac. pixels */
+ FT_Pos height; /* text height in 26.6 frac. pixels */
+ FT_Pos max_advance; /* max horizontal advance, in 26.6 pixels */
+
+ } FT_Size_Metrics;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_SizeRec */
+ /* */
+ /* <Description> */
+ /* FreeType root size class structure. A size object models a face */
+ /* object at a given size. */
+ /* */
+ /* <Fields> */
+ /* face :: Handle to the parent face object. */
+ /* */
+ /* generic :: A typeless pointer, which is unused by the FreeType */
+ /* library or any of its drivers. It can be used by */
+ /* client applications to link their own data to each size */
+ /* object. */
+ /* */
+ /* metrics :: Metrics for this size object. This field is read-only. */
+ /* */
+ typedef struct FT_SizeRec_
+ {
+ FT_Face face; /* parent face object */
+ FT_Generic generic; /* generic pointer for client uses */
+ FT_Size_Metrics metrics; /* size metrics */
+ FT_Size_Internal internal;
+
+ } FT_SizeRec;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_SubGlyph */
+ /* */
+ /* <Description> */
+ /* The subglyph structure is an internal object used to describe */
+ /* subglyphs (for example, in the case of composites). */
+ /* */
+ /* <Note> */
+ /* The subglyph implementation is not part of the high-level API, */
+ /* hence the forward structure declaration. */
+ /* */
+ /* You can however retrieve subglyph information with */
+ /* @FT_Get_SubGlyph_Info. */
+ /* */
+ typedef struct FT_SubGlyphRec_* FT_SubGlyph;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Slot_Internal */
+ /* */
+ /* <Description> */
+ /* An opaque handle to an `FT_Slot_InternalRec' structure, used to */
+ /* model private data of a given @FT_GlyphSlot object. */
+ /* */
+ typedef struct FT_Slot_InternalRec_* FT_Slot_Internal;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_GlyphSlotRec */
+ /* */
+ /* <Description> */
+ /* FreeType root glyph slot class structure. A glyph slot is a */
+ /* container where individual glyphs can be loaded, be they in */
+ /* outline or bitmap format. */
+ /* */
+ /* <Fields> */
+ /* library :: A handle to the FreeType library instance */
+ /* this slot belongs to. */
+ /* */
+ /* face :: A handle to the parent face object. */
+ /* */
+ /* next :: In some cases (like some font tools), several */
+ /* glyph slots per face object can be a good */
+ /* thing. As this is rare, the glyph slots are */
+ /* listed through a direct, single-linked list */
+ /* using its `next' field. */
+ /* */
+ /* generic :: A typeless pointer which is unused by the */
+ /* FreeType library or any of its drivers. It */
+ /* can be used by client applications to link */
+ /* their own data to each glyph slot object. */
+ /* */
+ /* metrics :: The metrics of the last loaded glyph in the */
+ /* slot. The returned values depend on the last */
+ /* load flags (see the @FT_Load_Glyph API */
+ /* function) and can be expressed either in 26.6 */
+ /* fractional pixels or font units. */
+ /* */
+ /* Note that even when the glyph image is */
+ /* transformed, the metrics are not. */
+ /* */
+ /* linearHoriAdvance :: The advance width of the unhinted glyph. */
+ /* Its value is expressed in 16.16 fractional */
+ /* pixels, unless @FT_LOAD_LINEAR_DESIGN is set */
+ /* when loading the glyph. This field can be */
+ /* important to perform correct WYSIWYG layout. */
+ /* Only relevant for outline glyphs. */
+ /* */
+ /* linearVertAdvance :: The advance height of the unhinted glyph. */
+ /* Its value is expressed in 16.16 fractional */
+ /* pixels, unless @FT_LOAD_LINEAR_DESIGN is set */
+ /* when loading the glyph. This field can be */
+ /* important to perform correct WYSIWYG layout. */
+ /* Only relevant for outline glyphs. */
+ /* */
+ /* advance :: This shorthand is, depending on */
+ /* @FT_LOAD_IGNORE_TRANSFORM, the transformed */
+ /* advance width for the glyph (in 26.6 */
+ /* fractional pixel format). As specified with */
+ /* @FT_LOAD_VERTICAL_LAYOUT, it uses either the */
+ /* `horiAdvance' or the `vertAdvance' value of */
+ /* `metrics' field. */
+ /* */
+ /* format :: This field indicates the format of the image */
+ /* contained in the glyph slot. Typically */
+ /* @FT_GLYPH_FORMAT_BITMAP, */
+ /* @FT_GLYPH_FORMAT_OUTLINE, or */
+ /* @FT_GLYPH_FORMAT_COMPOSITE, but others are */
+ /* possible. */
+ /* */
+ /* bitmap :: This field is used as a bitmap descriptor */
+ /* when the slot format is */
+ /* @FT_GLYPH_FORMAT_BITMAP. Note that the */
+ /* address and content of the bitmap buffer can */
+ /* change between calls of @FT_Load_Glyph and a */
+ /* few other functions. */
+ /* */
+ /* bitmap_left :: This is the bitmap's left bearing expressed */
+ /* in integer pixels. Of course, this is only */
+ /* valid if the format is */
+ /* @FT_GLYPH_FORMAT_BITMAP. */
+ /* */
+ /* bitmap_top :: This is the bitmap's top bearing expressed in */
+ /* integer pixels. Remember that this is the */
+ /* distance from the baseline to the top-most */
+ /* glyph scanline, upwards y~coordinates being */
+ /* *positive*. */
+ /* */
+ /* outline :: The outline descriptor for the current glyph */
+ /* image if its format is */
+ /* @FT_GLYPH_FORMAT_OUTLINE. Once a glyph is */
+ /* loaded, `outline' can be transformed, */
+ /* distorted, embolded, etc. However, it must */
+ /* not be freed. */
+ /* */
+ /* num_subglyphs :: The number of subglyphs in a composite glyph. */
+ /* This field is only valid for the composite */
+ /* glyph format that should normally only be */
+ /* loaded with the @FT_LOAD_NO_RECURSE flag. */
+ /* For now this is internal to FreeType. */
+ /* */
+ /* subglyphs :: An array of subglyph descriptors for */
+ /* composite glyphs. There are `num_subglyphs' */
+ /* elements in there. Currently internal to */
+ /* FreeType. */
+ /* */
+ /* control_data :: Certain font drivers can also return the */
+ /* control data for a given glyph image (e.g. */
+ /* TrueType bytecode, Type~1 charstrings, etc.). */
+ /* This field is a pointer to such data. */
+ /* */
+ /* control_len :: This is the length in bytes of the control */
+ /* data. */
+ /* */
+ /* other :: Really wicked formats can use this pointer to */
+ /* present their own glyph image to client */
+ /* applications. Note that the application */
+ /* needs to know about the image format. */
+ /* */
+ /* lsb_delta :: The difference between hinted and unhinted */
+ /* left side bearing while autohinting is */
+ /* active. Zero otherwise. */
+ /* */
+ /* rsb_delta :: The difference between hinted and unhinted */
+ /* right side bearing while autohinting is */
+ /* active. Zero otherwise. */
+ /* */
+ /* <Note> */
+ /* If @FT_Load_Glyph is called with default flags (see */
+ /* @FT_LOAD_DEFAULT) the glyph image is loaded in the glyph slot in */
+ /* its native format (e.g., an outline glyph for TrueType and Type~1 */
+ /* formats). */
+ /* */
+ /* This image can later be converted into a bitmap by calling */
+ /* @FT_Render_Glyph. This function finds the current renderer for */
+ /* the native image's format, then invokes it. */
+ /* */
+ /* The renderer is in charge of transforming the native image through */
+ /* the slot's face transformation fields, then converting it into a */
+ /* bitmap that is returned in `slot->bitmap'. */
+ /* */
+ /* Note that `slot->bitmap_left' and `slot->bitmap_top' are also used */
+ /* to specify the position of the bitmap relative to the current pen */
+ /* position (e.g., coordinates (0,0) on the baseline). Of course, */
+ /* `slot->format' is also changed to @FT_GLYPH_FORMAT_BITMAP. */
+ /* */
+ /* <Note> */
+ /* Here a small pseudo code fragment which shows how to use */
+ /* `lsb_delta' and `rsb_delta': */
+ /* */
+ /* { */
+ /* FT_Pos origin_x = 0; */
+ /* FT_Pos prev_rsb_delta = 0; */
+ /* */
+ /* */
+ /* for all glyphs do */
+ /* <compute kern between current and previous glyph and add it to */
+ /* `origin_x'> */
+ /* */
+ /* <load glyph with `FT_Load_Glyph'> */
+ /* */
+ /* if ( prev_rsb_delta - face->glyph->lsb_delta >= 32 ) */
+ /* origin_x -= 64; */
+ /* else if ( prev_rsb_delta - face->glyph->lsb_delta < -32 ) */
+ /* origin_x += 64; */
+ /* */
+ /* prev_rsb_delta = face->glyph->rsb_delta; */
+ /* */
+ /* <save glyph image, or render glyph, or ...> */
+ /* */
+ /* origin_x += face->glyph->advance.x; */
+ /* endfor */
+ /* } */
+ /* */
+ typedef struct FT_GlyphSlotRec_
+ {
+ FT_Library library;
+ FT_Face face;
+ FT_GlyphSlot next;
+ FT_UInt reserved; /* retained for binary compatibility */
+ FT_Generic generic;
+
+ FT_Glyph_Metrics metrics;
+ FT_Fixed linearHoriAdvance;
+ FT_Fixed linearVertAdvance;
+ FT_Vector advance;
+
+ FT_Glyph_Format format;
+
+ FT_Bitmap bitmap;
+ FT_Int bitmap_left;
+ FT_Int bitmap_top;
+
+ FT_Outline outline;
+
+ FT_UInt num_subglyphs;
+ FT_SubGlyph subglyphs;
+
+ void* control_data;
+ long control_len;
+
+ FT_Pos lsb_delta;
+ FT_Pos rsb_delta;
+
+ void* other;
+
+ FT_Slot_Internal internal;
+
+ } FT_GlyphSlotRec;
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /* */
+ /* F U N C T I O N S */
+ /* */
+ /*************************************************************************/
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Init_FreeType */
+ /* */
+ /* <Description> */
+ /* Initialize a new FreeType library object. The set of modules */
+ /* that are registered by this function is determined at build time. */
+ /* */
+ /* <Output> */
+ /* alibrary :: A handle to a new library object. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* In case you want to provide your own memory allocating routines, */
+ /* use @FT_New_Library instead, followed by a call to */
+ /* @FT_Add_Default_Modules (or a series of calls to @FT_Add_Module). */
+ /* */
+ /* For multi-threading applications each thread should have its own */
+ /* FT_Library object. */
+ /* */
+ /* If you need reference-counting (cf. @FT_Reference_Library), use */
+ /* @FT_New_Library and @FT_Done_Library. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Init_FreeType( FT_Library *alibrary );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Done_FreeType */
+ /* */
+ /* <Description> */
+ /* Destroy a given FreeType library object and all of its children, */
+ /* including resources, drivers, faces, sizes, etc. */
+ /* */
+ /* <Input> */
+ /* library :: A handle to the target library object. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Done_FreeType( FT_Library library );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Enum> */
+ /* FT_OPEN_XXX */
+ /* */
+ /* <Description> */
+ /* A list of bit-field constants used within the `flags' field of the */
+ /* @FT_Open_Args structure. */
+ /* */
+ /* <Values> */
+ /* FT_OPEN_MEMORY :: This is a memory-based stream. */
+ /* */
+ /* FT_OPEN_STREAM :: Copy the stream from the `stream' field. */
+ /* */
+ /* FT_OPEN_PATHNAME :: Create a new input stream from a C~path */
+ /* name. */
+ /* */
+ /* FT_OPEN_DRIVER :: Use the `driver' field. */
+ /* */
+ /* FT_OPEN_PARAMS :: Use the `num_params' and `params' fields. */
+ /* */
+ /* ft_open_memory :: Deprecated; use @FT_OPEN_MEMORY instead. */
+ /* */
+ /* ft_open_stream :: Deprecated; use @FT_OPEN_STREAM instead. */
+ /* */
+ /* ft_open_pathname :: Deprecated; use @FT_OPEN_PATHNAME instead. */
+ /* */
+ /* ft_open_driver :: Deprecated; use @FT_OPEN_DRIVER instead. */
+ /* */
+ /* ft_open_params :: Deprecated; use @FT_OPEN_PARAMS instead. */
+ /* */
+ /* <Note> */
+ /* The `FT_OPEN_MEMORY', `FT_OPEN_STREAM', and `FT_OPEN_PATHNAME' */
+ /* flags are mutually exclusive. */
+ /* */
+#define FT_OPEN_MEMORY 0x1
+#define FT_OPEN_STREAM 0x2
+#define FT_OPEN_PATHNAME 0x4
+#define FT_OPEN_DRIVER 0x8
+#define FT_OPEN_PARAMS 0x10
+
+#define ft_open_memory FT_OPEN_MEMORY /* deprecated */
+#define ft_open_stream FT_OPEN_STREAM /* deprecated */
+#define ft_open_pathname FT_OPEN_PATHNAME /* deprecated */
+#define ft_open_driver FT_OPEN_DRIVER /* deprecated */
+#define ft_open_params FT_OPEN_PARAMS /* deprecated */
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Parameter */
+ /* */
+ /* <Description> */
+ /* A simple structure used to pass more or less generic parameters to */
+ /* @FT_Open_Face. */
+ /* */
+ /* <Fields> */
+ /* tag :: A four-byte identification tag. */
+ /* */
+ /* data :: A pointer to the parameter data. */
+ /* */
+ /* <Note> */
+ /* The ID and function of parameters are driver-specific. See the */
+ /* various FT_PARAM_TAG_XXX flags for more information. */
+ /* */
+ typedef struct FT_Parameter_
+ {
+ FT_ULong tag;
+ FT_Pointer data;
+
+ } FT_Parameter;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Open_Args */
+ /* */
+ /* <Description> */
+ /* A structure used to indicate how to open a new font file or */
+ /* stream. A pointer to such a structure can be used as a parameter */
+ /* for the functions @FT_Open_Face and @FT_Attach_Stream. */
+ /* */
+ /* <Fields> */
+ /* flags :: A set of bit flags indicating how to use the */
+ /* structure. */
+ /* */
+ /* memory_base :: The first byte of the file in memory. */
+ /* */
+ /* memory_size :: The size in bytes of the file in memory. */
+ /* */
+ /* pathname :: A pointer to an 8-bit file pathname. */
+ /* */
+ /* stream :: A handle to a source stream object. */
+ /* */
+ /* driver :: This field is exclusively used by @FT_Open_Face; */
+ /* it simply specifies the font driver to use to open */
+ /* the face. If set to~0, FreeType tries to load the */
+ /* face with each one of the drivers in its list. */
+ /* */
+ /* num_params :: The number of extra parameters. */
+ /* */
+ /* params :: Extra parameters passed to the font driver when */
+ /* opening a new face. */
+ /* */
+ /* <Note> */
+ /* The stream type is determined by the contents of `flags' which */
+ /* are tested in the following order by @FT_Open_Face: */
+ /* */
+ /* If the `FT_OPEN_MEMORY' bit is set, assume that this is a */
+ /* memory file of `memory_size' bytes, located at `memory_address'. */
+ /* The data are are not copied, and the client is responsible for */
+ /* releasing and destroying them _after_ the corresponding call to */
+ /* @FT_Done_Face. */
+ /* */
+ /* Otherwise, if the `FT_OPEN_STREAM' bit is set, assume that a */
+ /* custom input stream `stream' is used. */
+ /* */
+ /* Otherwise, if the `FT_OPEN_PATHNAME' bit is set, assume that this */
+ /* is a normal file and use `pathname' to open it. */
+ /* */
+ /* If the `FT_OPEN_DRIVER' bit is set, @FT_Open_Face only tries to */
+ /* open the file with the driver whose handler is in `driver'. */
+ /* */
+ /* If the `FT_OPEN_PARAMS' bit is set, the parameters given by */
+ /* `num_params' and `params' is used. They are ignored otherwise. */
+ /* */
+ /* Ideally, both the `pathname' and `params' fields should be tagged */
+ /* as `const'; this is missing for API backwards compatibility. In */
+ /* other words, applications should treat them as read-only. */
+ /* */
+ typedef struct FT_Open_Args_
+ {
+ FT_UInt flags;
+ const FT_Byte* memory_base;
+ FT_Long memory_size;
+ FT_String* pathname;
+ FT_Stream stream;
+ FT_Module driver;
+ FT_Int num_params;
+ FT_Parameter* params;
+
+ } FT_Open_Args;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_New_Face */
+ /* */
+ /* <Description> */
+ /* This function calls @FT_Open_Face to open a font by its pathname. */
+ /* */
+ /* <InOut> */
+ /* library :: A handle to the library resource. */
+ /* */
+ /* <Input> */
+ /* pathname :: A path to the font file. */
+ /* */
+ /* face_index :: The index of the face within the font. The first */
+ /* face has index~0. */
+ /* */
+ /* <Output> */
+ /* aface :: A handle to a new face object. If `face_index' is */
+ /* greater than or equal to zero, it must be non-NULL. */
+ /* See @FT_Open_Face for more details. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* Use @FT_Done_Face to destroy the created @FT_Face object (along */
+ /* with its slot and sizes). */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_New_Face( FT_Library library,
+ const char* filepathname,
+ FT_Long face_index,
+ FT_Face *aface );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_New_Memory_Face */
+ /* */
+ /* <Description> */
+ /* This function calls @FT_Open_Face to open a font which has been */
+ /* loaded into memory. */
+ /* */
+ /* <InOut> */
+ /* library :: A handle to the library resource. */
+ /* */
+ /* <Input> */
+ /* file_base :: A pointer to the beginning of the font data. */
+ /* */
+ /* file_size :: The size of the memory chunk used by the font data. */
+ /* */
+ /* face_index :: The index of the face within the font. The first */
+ /* face has index~0. */
+ /* */
+ /* <Output> */
+ /* aface :: A handle to a new face object. If `face_index' is */
+ /* greater than or equal to zero, it must be non-NULL. */
+ /* See @FT_Open_Face for more details. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* You must not deallocate the memory before calling @FT_Done_Face. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_New_Memory_Face( FT_Library library,
+ const FT_Byte* file_base,
+ FT_Long file_size,
+ FT_Long face_index,
+ FT_Face *aface );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Open_Face */
+ /* */
+ /* <Description> */
+ /* Create a face object from a given resource described by */
+ /* @FT_Open_Args. */
+ /* */
+ /* <InOut> */
+ /* library :: A handle to the library resource. */
+ /* */
+ /* <Input> */
+ /* args :: A pointer to an `FT_Open_Args' structure which must */
+ /* be filled by the caller. */
+ /* */
+ /* face_index :: The index of the face within the font. The first */
+ /* face has index~0. */
+ /* */
+ /* <Output> */
+ /* aface :: A handle to a new face object. If `face_index' is */
+ /* greater than or equal to zero, it must be non-NULL. */
+ /* See note below. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* Unlike FreeType 1.x, this function automatically creates a glyph */
+ /* slot for the face object which can be accessed directly through */
+ /* `face->glyph'. */
+ /* */
+ /* FT_Open_Face can be used to quickly check whether the font */
+ /* format of a given font resource is supported by FreeType. If the */
+ /* `face_index' field is negative, the function's return value is~0 */
+ /* if the font format is recognized, or non-zero otherwise; */
+ /* the function returns a more or less empty face handle in `*aface' */
+ /* (if `aface' isn't NULL). The only useful field in this special */
+ /* case is `face->num_faces' which gives the number of faces within */
+ /* the font file. After examination, the returned @FT_Face structure */
+ /* should be deallocated with a call to @FT_Done_Face. */
+ /* */
+ /* Each new face object created with this function also owns a */
+ /* default @FT_Size object, accessible as `face->size'. */
+ /* */
+ /* One @FT_Library instance can have multiple face objects, this is, */
+ /* @FT_Open_Face and its siblings can be called multiple times using */
+ /* the same `library' argument. */
+ /* */
+ /* See the discussion of reference counters in the description of */
+ /* @FT_Reference_Face. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Open_Face( FT_Library library,
+ const FT_Open_Args* args,
+ FT_Long face_index,
+ FT_Face *aface );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Attach_File */
+ /* */
+ /* <Description> */
+ /* This function calls @FT_Attach_Stream to attach a file. */
+ /* */
+ /* <InOut> */
+ /* face :: The target face object. */
+ /* */
+ /* <Input> */
+ /* filepathname :: The pathname. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Attach_File( FT_Face face,
+ const char* filepathname );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Attach_Stream */
+ /* */
+ /* <Description> */
+ /* `Attach' data to a face object. Normally, this is used to read */
+ /* additional information for the face object. For example, you can */
+ /* attach an AFM file that comes with a Type~1 font to get the */
+ /* kerning values and other metrics. */
+ /* */
+ /* <InOut> */
+ /* face :: The target face object. */
+ /* */
+ /* <Input> */
+ /* parameters :: A pointer to @FT_Open_Args which must be filled by */
+ /* the caller. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* The meaning of the `attach' (i.e., what really happens when the */
+ /* new file is read) is not fixed by FreeType itself. It really */
+ /* depends on the font format (and thus the font driver). */
+ /* */
+ /* Client applications are expected to know what they are doing */
+ /* when invoking this function. Most drivers simply do not implement */
+ /* file attachments. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Attach_Stream( FT_Face face,
+ FT_Open_Args* parameters );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Reference_Face */
+ /* */
+ /* <Description> */
+ /* A counter gets initialized to~1 at the time an @FT_Face structure */
+ /* is created. This function increments the counter. @FT_Done_Face */
+ /* then only destroys a face if the counter is~1, otherwise it simply */
+ /* decrements the counter. */
+ /* */
+ /* This function helps in managing life-cycles of structures which */
+ /* reference @FT_Face objects. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to a target face object. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Since> */
+ /* 2.4.2 */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Reference_Face( FT_Face face );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Done_Face */
+ /* */
+ /* <Description> */
+ /* Discard a given face object, as well as all of its child slots and */
+ /* sizes. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to a target face object. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* See the discussion of reference counters in the description of */
+ /* @FT_Reference_Face. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Done_Face( FT_Face face );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Select_Size */
+ /* */
+ /* <Description> */
+ /* Select a bitmap strike. */
+ /* */
+ /* <InOut> */
+ /* face :: A handle to a target face object. */
+ /* */
+ /* <Input> */
+ /* strike_index :: The index of the bitmap strike in the */
+ /* `available_sizes' field of @FT_FaceRec structure. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Select_Size( FT_Face face,
+ FT_Int strike_index );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Enum> */
+ /* FT_Size_Request_Type */
+ /* */
+ /* <Description> */
+ /* An enumeration type that lists the supported size request types. */
+ /* */
+ /* <Values> */
+ /* FT_SIZE_REQUEST_TYPE_NOMINAL :: */
+ /* The nominal size. The `units_per_EM' field of @FT_FaceRec is */
+ /* used to determine both scaling values. */
+ /* */
+ /* FT_SIZE_REQUEST_TYPE_REAL_DIM :: */
+ /* The real dimension. The sum of the the `ascender' and (minus */
+ /* of) the `descender' fields of @FT_FaceRec are used to determine */
+ /* both scaling values. */
+ /* */
+ /* FT_SIZE_REQUEST_TYPE_BBOX :: */
+ /* The font bounding box. The width and height of the `bbox' field */
+ /* of @FT_FaceRec are used to determine the horizontal and vertical */
+ /* scaling value, respectively. */
+ /* */
+ /* FT_SIZE_REQUEST_TYPE_CELL :: */
+ /* The `max_advance_width' field of @FT_FaceRec is used to */
+ /* determine the horizontal scaling value; the vertical scaling */
+ /* value is determined the same way as */
+ /* @FT_SIZE_REQUEST_TYPE_REAL_DIM does. Finally, both scaling */
+ /* values are set to the smaller one. This type is useful if you */
+ /* want to specify the font size for, say, a window of a given */
+ /* dimension and 80x24 cells. */
+ /* */
+ /* FT_SIZE_REQUEST_TYPE_SCALES :: */
+ /* Specify the scaling values directly. */
+ /* */
+ /* <Note> */
+ /* The above descriptions only apply to scalable formats. For bitmap */
+ /* formats, the behaviour is up to the driver. */
+ /* */
+ /* See the note section of @FT_Size_Metrics if you wonder how size */
+ /* requesting relates to scaling values. */
+ /* */
+ typedef enum FT_Size_Request_Type_
+ {
+ FT_SIZE_REQUEST_TYPE_NOMINAL,
+ FT_SIZE_REQUEST_TYPE_REAL_DIM,
+ FT_SIZE_REQUEST_TYPE_BBOX,
+ FT_SIZE_REQUEST_TYPE_CELL,
+ FT_SIZE_REQUEST_TYPE_SCALES,
+
+ FT_SIZE_REQUEST_TYPE_MAX
+
+ } FT_Size_Request_Type;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Size_RequestRec */
+ /* */
+ /* <Description> */
+ /* A structure used to model a size request. */
+ /* */
+ /* <Fields> */
+ /* type :: See @FT_Size_Request_Type. */
+ /* */
+ /* width :: The desired width. */
+ /* */
+ /* height :: The desired height. */
+ /* */
+ /* horiResolution :: The horizontal resolution. If set to zero, */
+ /* `width' is treated as a 26.6 fractional pixel */
+ /* value. */
+ /* */
+ /* vertResolution :: The vertical resolution. If set to zero, */
+ /* `height' is treated as a 26.6 fractional pixel */
+ /* value. */
+ /* */
+ /* <Note> */
+ /* If `width' is zero, then the horizontal scaling value is set equal */
+ /* to the vertical scaling value, and vice versa. */
+ /* */
+ typedef struct FT_Size_RequestRec_
+ {
+ FT_Size_Request_Type type;
+ FT_Long width;
+ FT_Long height;
+ FT_UInt horiResolution;
+ FT_UInt vertResolution;
+
+ } FT_Size_RequestRec;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Size_Request */
+ /* */
+ /* <Description> */
+ /* A handle to a size request structure. */
+ /* */
+ typedef struct FT_Size_RequestRec_ *FT_Size_Request;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Request_Size */
+ /* */
+ /* <Description> */
+ /* Resize the scale of the active @FT_Size object in a face. */
+ /* */
+ /* <InOut> */
+ /* face :: A handle to a target face object. */
+ /* */
+ /* <Input> */
+ /* req :: A pointer to a @FT_Size_RequestRec. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* Although drivers may select the bitmap strike matching the */
+ /* request, you should not rely on this if you intend to select a */
+ /* particular bitmap strike. Use @FT_Select_Size instead in that */
+ /* case. */
+ /* */
+ /* The relation between the requested size and the resulting glyph */
+ /* size is dependent entirely on how the size is defined in the */
+ /* source face. The font designer chooses the final size of each */
+ /* glyph relative to this size. For more information refer to */
+ /* `http://www.freetype.org/freetype2/docs/glyphs/glyphs-2.html' */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Request_Size( FT_Face face,
+ FT_Size_Request req );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Set_Char_Size */
+ /* */
+ /* <Description> */
+ /* This function calls @FT_Request_Size to request the nominal size */
+ /* (in points). */
+ /* */
+ /* <InOut> */
+ /* face :: A handle to a target face object. */
+ /* */
+ /* <Input> */
+ /* char_width :: The nominal width, in 26.6 fractional points. */
+ /* */
+ /* char_height :: The nominal height, in 26.6 fractional points. */
+ /* */
+ /* horz_resolution :: The horizontal resolution in dpi. */
+ /* */
+ /* vert_resolution :: The vertical resolution in dpi. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* If either the character width or height is zero, it is set equal */
+ /* to the other value. */
+ /* */
+ /* If either the horizontal or vertical resolution is zero, it is set */
+ /* equal to the other value. */
+ /* */
+ /* A character width or height smaller than 1pt is set to 1pt; if */
+ /* both resolution values are zero, they are set to 72dpi. */
+ /* */
+ /* Don't use this function if you are using the FreeType cache API. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Set_Char_Size( FT_Face face,
+ FT_F26Dot6 char_width,
+ FT_F26Dot6 char_height,
+ FT_UInt horz_resolution,
+ FT_UInt vert_resolution );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Set_Pixel_Sizes */
+ /* */
+ /* <Description> */
+ /* This function calls @FT_Request_Size to request the nominal size */
+ /* (in pixels). */
+ /* */
+ /* <InOut> */
+ /* face :: A handle to the target face object. */
+ /* */
+ /* <Input> */
+ /* pixel_width :: The nominal width, in pixels. */
+ /* */
+ /* pixel_height :: The nominal height, in pixels. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* You should not rely on the resulting glyphs matching, or being */
+ /* constrained, to this pixel size. Refer to @FT_Request_Size to */
+ /* understand how requested sizes relate to actual sizes. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Set_Pixel_Sizes( FT_Face face,
+ FT_UInt pixel_width,
+ FT_UInt pixel_height );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Load_Glyph */
+ /* */
+ /* <Description> */
+ /* A function used to load a single glyph into the glyph slot of a */
+ /* face object. */
+ /* */
+ /* <InOut> */
+ /* face :: A handle to the target face object where the glyph */
+ /* is loaded. */
+ /* */
+ /* <Input> */
+ /* glyph_index :: The index of the glyph in the font file. For */
+ /* CID-keyed fonts (either in PS or in CFF format) */
+ /* this argument specifies the CID value. */
+ /* */
+ /* load_flags :: A flag indicating what to load for this glyph. The */
+ /* @FT_LOAD_XXX constants can be used to control the */
+ /* glyph loading process (e.g., whether the outline */
+ /* should be scaled, whether to load bitmaps or not, */
+ /* whether to hint the outline, etc). */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* The loaded glyph may be transformed. See @FT_Set_Transform for */
+ /* the details. */
+ /* */
+ /* For subsetted CID-keyed fonts, `FT_Err_Invalid_Argument' is */
+ /* returned for invalid CID values (this is, for CID values which */
+ /* don't have a corresponding glyph in the font). See the discussion */
+ /* of the @FT_FACE_FLAG_CID_KEYED flag for more details. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Load_Glyph( FT_Face face,
+ FT_UInt glyph_index,
+ FT_Int32 load_flags );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Load_Char */
+ /* */
+ /* <Description> */
+ /* A function used to load a single glyph into the glyph slot of a */
+ /* face object, according to its character code. */
+ /* */
+ /* <InOut> */
+ /* face :: A handle to a target face object where the glyph */
+ /* is loaded. */
+ /* */
+ /* <Input> */
+ /* char_code :: The glyph's character code, according to the */
+ /* current charmap used in the face. */
+ /* */
+ /* load_flags :: A flag indicating what to load for this glyph. The */
+ /* @FT_LOAD_XXX constants can be used to control the */
+ /* glyph loading process (e.g., whether the outline */
+ /* should be scaled, whether to load bitmaps or not, */
+ /* whether to hint the outline, etc). */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* This function simply calls @FT_Get_Char_Index and @FT_Load_Glyph. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Load_Char( FT_Face face,
+ FT_ULong char_code,
+ FT_Int32 load_flags );
+
+
+ /*************************************************************************
+ *
+ * @enum:
+ * FT_LOAD_XXX
+ *
+ * @description:
+ * A list of bit-field constants used with @FT_Load_Glyph to indicate
+ * what kind of operations to perform during glyph loading.
+ *
+ * @values:
+ * FT_LOAD_DEFAULT ::
+ * Corresponding to~0, this value is used as the default glyph load
+ * operation. In this case, the following happens:
+ *
+ * 1. FreeType looks for a bitmap for the glyph corresponding to the
+ * face's current size. If one is found, the function returns.
+ * The bitmap data can be accessed from the glyph slot (see note
+ * below).
+ *
+ * 2. If no embedded bitmap is searched or found, FreeType looks for a
+ * scalable outline. If one is found, it is loaded from the font
+ * file, scaled to device pixels, then `hinted' to the pixel grid
+ * in order to optimize it. The outline data can be accessed from
+ * the glyph slot (see note below).
+ *
+ * Note that by default, the glyph loader doesn't render outlines into
+ * bitmaps. The following flags are used to modify this default
+ * behaviour to more specific and useful cases.
+ *
+ * FT_LOAD_NO_SCALE ::
+ * Don't scale the loaded outline glyph but keep it in font units.
+ *
+ * This flag implies @FT_LOAD_NO_HINTING and @FT_LOAD_NO_BITMAP, and
+ * unsets @FT_LOAD_RENDER.
+ *
+ * If the font is `tricky' (see @FT_FACE_FLAG_TRICKY for more), using
+ * FT_LOAD_NO_SCALE usually yields meaningless outlines because the
+ * subglyphs must be scaled and positioned with hinting instructions.
+ * This can be solved by loading the font without FT_LOAD_NO_SCALE and
+ * setting the character size to `font->units_per_EM'.
+ *
+ * FT_LOAD_NO_HINTING ::
+ * Disable hinting. This generally generates `blurrier' bitmap glyphs
+ * when the glyph are rendered in any of the anti-aliased modes. See
+ * also the note below.
+ *
+ * This flag is implied by @FT_LOAD_NO_SCALE.
+ *
+ * FT_LOAD_RENDER ::
+ * Call @FT_Render_Glyph after the glyph is loaded. By default, the
+ * glyph is rendered in @FT_RENDER_MODE_NORMAL mode. This can be
+ * overridden by @FT_LOAD_TARGET_XXX or @FT_LOAD_MONOCHROME.
+ *
+ * This flag is unset by @FT_LOAD_NO_SCALE.
+ *
+ * FT_LOAD_NO_BITMAP ::
+ * Ignore bitmap strikes when loading. Bitmap-only fonts ignore this
+ * flag.
+ *
+ * @FT_LOAD_NO_SCALE always sets this flag.
+ *
+ * FT_LOAD_VERTICAL_LAYOUT ::
+ * Load the glyph for vertical text layout. In particular, the
+ * `advance' value in the @FT_GlyphSlotRec structure is set to the
+ * `vertAdvance' value of the `metrics' field.
+ *
+ * In case @FT_HAS_VERTICAL doesn't return true, you shouldn't use
+ * this flag currently. Reason is that in this case vertical metrics
+ * get synthesized, and those values are not always consistent across
+ * various font formats.
+ *
+ * FT_LOAD_FORCE_AUTOHINT ::
+ * Indicates that the auto-hinter is preferred over the font's native
+ * hinter. See also the note below.
+ *
+ * FT_LOAD_CROP_BITMAP ::
+ * Indicates that the font driver should crop the loaded bitmap glyph
+ * (i.e., remove all space around its black bits). Not all drivers
+ * implement this.
+ *
+ * FT_LOAD_PEDANTIC ::
+ * Indicates that the font driver should perform pedantic verifications
+ * during glyph loading. This is mostly used to detect broken glyphs
+ * in fonts. By default, FreeType tries to handle broken fonts also.
+ *
+ * In particular, errors from the TrueType bytecode engine are not
+ * passed to the application if this flag is not set; this might
+ * result in partially hinted or distorted glyphs in case a glyph's
+ * bytecode is buggy.
+ *
+ * FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ::
+ * Ignored. Deprecated.
+ *
+ * FT_LOAD_NO_RECURSE ::
+ * This flag is only used internally. It merely indicates that the
+ * font driver should not load composite glyphs recursively. Instead,
+ * it should set the `num_subglyph' and `subglyphs' values of the
+ * glyph slot accordingly, and set `glyph->format' to
+ * @FT_GLYPH_FORMAT_COMPOSITE.
+ *
+ * The description of sub-glyphs is not available to client
+ * applications for now.
+ *
+ * This flag implies @FT_LOAD_NO_SCALE and @FT_LOAD_IGNORE_TRANSFORM.
+ *
+ * FT_LOAD_IGNORE_TRANSFORM ::
+ * Indicates that the transform matrix set by @FT_Set_Transform should
+ * be ignored.
+ *
+ * FT_LOAD_MONOCHROME ::
+ * This flag is used with @FT_LOAD_RENDER to indicate that you want to
+ * render an outline glyph to a 1-bit monochrome bitmap glyph, with
+ * 8~pixels packed into each byte of the bitmap data.
+ *
+ * Note that this has no effect on the hinting algorithm used. You
+ * should rather use @FT_LOAD_TARGET_MONO so that the
+ * monochrome-optimized hinting algorithm is used.
+ *
+ * FT_LOAD_LINEAR_DESIGN ::
+ * Indicates that the `linearHoriAdvance' and `linearVertAdvance'
+ * fields of @FT_GlyphSlotRec should be kept in font units. See
+ * @FT_GlyphSlotRec for details.
+ *
+ * FT_LOAD_NO_AUTOHINT ::
+ * Disable auto-hinter. See also the note below.
+ *
+ * FT_LOAD_COLOR ::
+ * This flag is used to request loading of color embedded-bitmap
+ * images. The resulting color bitmaps, if available, will have the
+ * @FT_PIXEL_MODE_BGRA format. When the flag is not used and color
+ * bitmaps are found, they will be converted to 256-level gray
+ * bitmaps transparently. Those bitmaps will be in the
+ * @FT_PIXEL_MODE_GRAY format.
+ *
+ * @note:
+ * By default, hinting is enabled and the font's native hinter (see
+ * @FT_FACE_FLAG_HINTER) is preferred over the auto-hinter. You can
+ * disable hinting by setting @FT_LOAD_NO_HINTING or change the
+ * precedence by setting @FT_LOAD_FORCE_AUTOHINT. You can also set
+ * @FT_LOAD_NO_AUTOHINT in case you don't want the auto-hinter to be
+ * used at all.
+ *
+ * See the description of @FT_FACE_FLAG_TRICKY for a special exception
+ * (affecting only a handful of Asian fonts).
+ *
+ * Besides deciding which hinter to use, you can also decide which
+ * hinting algorithm to use. See @FT_LOAD_TARGET_XXX for details.
+ *
+ * Note that the auto-hinter needs a valid Unicode cmap (either a native
+ * one or synthesized by FreeType) for producing correct results. If a
+ * font provides an incorrect mapping (for example, assigning the
+ * character code U+005A, LATIN CAPITAL LETTER Z, to a glyph depicting a
+ * mathematical integral sign), the auto-hinter might produce useless
+ * results.
+ *
+ */
+#define FT_LOAD_DEFAULT 0x0
+#define FT_LOAD_NO_SCALE ( 1L << 0 )
+#define FT_LOAD_NO_HINTING ( 1L << 1 )
+#define FT_LOAD_RENDER ( 1L << 2 )
+#define FT_LOAD_NO_BITMAP ( 1L << 3 )
+#define FT_LOAD_VERTICAL_LAYOUT ( 1L << 4 )
+#define FT_LOAD_FORCE_AUTOHINT ( 1L << 5 )
+#define FT_LOAD_CROP_BITMAP ( 1L << 6 )
+#define FT_LOAD_PEDANTIC ( 1L << 7 )
+#define FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ( 1L << 9 )
+#define FT_LOAD_NO_RECURSE ( 1L << 10 )
+#define FT_LOAD_IGNORE_TRANSFORM ( 1L << 11 )
+#define FT_LOAD_MONOCHROME ( 1L << 12 )
+#define FT_LOAD_LINEAR_DESIGN ( 1L << 13 )
+#define FT_LOAD_NO_AUTOHINT ( 1L << 15 )
+ /* Bits 16..19 are used by `FT_LOAD_TARGET_' */
+#define FT_LOAD_COLOR ( 1L << 20 )
+
+ /* */
+
+ /* used internally only by certain font drivers! */
+#define FT_LOAD_ADVANCE_ONLY ( 1L << 8 )
+#define FT_LOAD_SBITS_ONLY ( 1L << 14 )
+
+
+ /**************************************************************************
+ *
+ * @enum:
+ * FT_LOAD_TARGET_XXX
+ *
+ * @description:
+ * A list of values that are used to select a specific hinting algorithm
+ * to use by the hinter. You should OR one of these values to your
+ * `load_flags' when calling @FT_Load_Glyph.
+ *
+ * Note that font's native hinters may ignore the hinting algorithm you
+ * have specified (e.g., the TrueType bytecode interpreter). You can set
+ * @FT_LOAD_FORCE_AUTOHINT to ensure that the auto-hinter is used.
+ *
+ * Also note that @FT_LOAD_TARGET_LIGHT is an exception, in that it
+ * always implies @FT_LOAD_FORCE_AUTOHINT.
+ *
+ * @values:
+ * FT_LOAD_TARGET_NORMAL ::
+ * This corresponds to the default hinting algorithm, optimized for
+ * standard gray-level rendering. For monochrome output, use
+ * @FT_LOAD_TARGET_MONO instead.
+ *
+ * FT_LOAD_TARGET_LIGHT ::
+ * A lighter hinting algorithm for non-monochrome modes. Many
+ * generated glyphs are more fuzzy but better resemble its original
+ * shape. A bit like rendering on Mac OS~X.
+ *
+ * As a special exception, this target implies @FT_LOAD_FORCE_AUTOHINT.
+ *
+ * FT_LOAD_TARGET_MONO ::
+ * Strong hinting algorithm that should only be used for monochrome
+ * output. The result is probably unpleasant if the glyph is rendered
+ * in non-monochrome modes.
+ *
+ * FT_LOAD_TARGET_LCD ::
+ * A variant of @FT_LOAD_TARGET_NORMAL optimized for horizontally
+ * decimated LCD displays.
+ *
+ * FT_LOAD_TARGET_LCD_V ::
+ * A variant of @FT_LOAD_TARGET_NORMAL optimized for vertically
+ * decimated LCD displays.
+ *
+ * @note:
+ * You should use only _one_ of the FT_LOAD_TARGET_XXX values in your
+ * `load_flags'. They can't be ORed.
+ *
+ * If @FT_LOAD_RENDER is also set, the glyph is rendered in the
+ * corresponding mode (i.e., the mode which matches the used algorithm
+ * best). An exeption is FT_LOAD_TARGET_MONO since it implies
+ * @FT_LOAD_MONOCHROME.
+ *
+ * You can use a hinting algorithm that doesn't correspond to the same
+ * rendering mode. As an example, it is possible to use the `light'
+ * hinting algorithm and have the results rendered in horizontal LCD
+ * pixel mode, with code like
+ *
+ * {
+ * FT_Load_Glyph( face, glyph_index,
+ * load_flags | FT_LOAD_TARGET_LIGHT );
+ *
+ * FT_Render_Glyph( face->glyph, FT_RENDER_MODE_LCD );
+ * }
+ *
+ */
+#define FT_LOAD_TARGET_( x ) ( (FT_Int32)( (x) & 15 ) << 16 )
+
+#define FT_LOAD_TARGET_NORMAL FT_LOAD_TARGET_( FT_RENDER_MODE_NORMAL )
+#define FT_LOAD_TARGET_LIGHT FT_LOAD_TARGET_( FT_RENDER_MODE_LIGHT )
+#define FT_LOAD_TARGET_MONO FT_LOAD_TARGET_( FT_RENDER_MODE_MONO )
+#define FT_LOAD_TARGET_LCD FT_LOAD_TARGET_( FT_RENDER_MODE_LCD )
+#define FT_LOAD_TARGET_LCD_V FT_LOAD_TARGET_( FT_RENDER_MODE_LCD_V )
+
+
+ /**************************************************************************
+ *
+ * @macro:
+ * FT_LOAD_TARGET_MODE
+ *
+ * @description:
+ * Return the @FT_Render_Mode corresponding to a given
+ * @FT_LOAD_TARGET_XXX value.
+ *
+ */
+#define FT_LOAD_TARGET_MODE( x ) ( (FT_Render_Mode)( ( (x) >> 16 ) & 15 ) )
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Set_Transform */
+ /* */
+ /* <Description> */
+ /* A function used to set the transformation that is applied to glyph */
+ /* images when they are loaded into a glyph slot through */
+ /* @FT_Load_Glyph. */
+ /* */
+ /* <InOut> */
+ /* face :: A handle to the source face object. */
+ /* */
+ /* <Input> */
+ /* matrix :: A pointer to the transformation's 2x2 matrix. Use~0 for */
+ /* the identity matrix. */
+ /* delta :: A pointer to the translation vector. Use~0 for the null */
+ /* vector. */
+ /* */
+ /* <Note> */
+ /* The transformation is only applied to scalable image formats after */
+ /* the glyph has been loaded. It means that hinting is unaltered by */
+ /* the transformation and is performed on the character size given in */
+ /* the last call to @FT_Set_Char_Size or @FT_Set_Pixel_Sizes. */
+ /* */
+ /* Note that this also transforms the `face.glyph.advance' field, but */
+ /* *not* the values in `face.glyph.metrics'. */
+ /* */
+ FT_EXPORT( void )
+ FT_Set_Transform( FT_Face face,
+ FT_Matrix* matrix,
+ FT_Vector* delta );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Enum> */
+ /* FT_Render_Mode */
+ /* */
+ /* <Description> */
+ /* An enumeration type that lists the render modes supported by */
+ /* FreeType~2. Each mode corresponds to a specific type of scanline */
+ /* conversion performed on the outline. */
+ /* */
+ /* For bitmap fonts and embedded bitmaps the `bitmap->pixel_mode' */
+ /* field in the @FT_GlyphSlotRec structure gives the format of the */
+ /* returned bitmap. */
+ /* */
+ /* All modes except @FT_RENDER_MODE_MONO use 256 levels of opacity. */
+ /* */
+ /* <Values> */
+ /* FT_RENDER_MODE_NORMAL :: */
+ /* This is the default render mode; it corresponds to 8-bit */
+ /* anti-aliased bitmaps. */
+ /* */
+ /* FT_RENDER_MODE_LIGHT :: */
+ /* This is equivalent to @FT_RENDER_MODE_NORMAL. It is only */
+ /* defined as a separate value because render modes are also used */
+ /* indirectly to define hinting algorithm selectors. See */
+ /* @FT_LOAD_TARGET_XXX for details. */
+ /* */
+ /* FT_RENDER_MODE_MONO :: */
+ /* This mode corresponds to 1-bit bitmaps (with 2~levels of */
+ /* opacity). */
+ /* */
+ /* FT_RENDER_MODE_LCD :: */
+ /* This mode corresponds to horizontal RGB and BGR sub-pixel */
+ /* displays like LCD screens. It produces 8-bit bitmaps that are */
+ /* 3~times the width of the original glyph outline in pixels, and */
+ /* which use the @FT_PIXEL_MODE_LCD mode. */
+ /* */
+ /* FT_RENDER_MODE_LCD_V :: */
+ /* This mode corresponds to vertical RGB and BGR sub-pixel displays */
+ /* (like PDA screens, rotated LCD displays, etc.). It produces */
+ /* 8-bit bitmaps that are 3~times the height of the original */
+ /* glyph outline in pixels and use the @FT_PIXEL_MODE_LCD_V mode. */
+ /* */
+ /* <Note> */
+ /* The LCD-optimized glyph bitmaps produced by FT_Render_Glyph can be */
+ /* filtered to reduce color-fringes by using @FT_Library_SetLcdFilter */
+ /* (not active in the default builds). It is up to the caller to */
+ /* either call @FT_Library_SetLcdFilter (if available) or do the */
+ /* filtering itself. */
+ /* */
+ /* The selected render mode only affects vector glyphs of a font. */
+ /* Embedded bitmaps often have a different pixel mode like */
+ /* @FT_PIXEL_MODE_MONO. You can use @FT_Bitmap_Convert to transform */
+ /* them into 8-bit pixmaps. */
+ /* */
+ typedef enum FT_Render_Mode_
+ {
+ FT_RENDER_MODE_NORMAL = 0,
+ FT_RENDER_MODE_LIGHT,
+ FT_RENDER_MODE_MONO,
+ FT_RENDER_MODE_LCD,
+ FT_RENDER_MODE_LCD_V,
+
+ FT_RENDER_MODE_MAX
+
+ } FT_Render_Mode;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Enum> */
+ /* ft_render_mode_xxx */
+ /* */
+ /* <Description> */
+ /* These constants are deprecated. Use the corresponding */
+ /* @FT_Render_Mode values instead. */
+ /* */
+ /* <Values> */
+ /* ft_render_mode_normal :: see @FT_RENDER_MODE_NORMAL */
+ /* ft_render_mode_mono :: see @FT_RENDER_MODE_MONO */
+ /* */
+#define ft_render_mode_normal FT_RENDER_MODE_NORMAL
+#define ft_render_mode_mono FT_RENDER_MODE_MONO
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Render_Glyph */
+ /* */
+ /* <Description> */
+ /* Convert a given glyph image to a bitmap. It does so by inspecting */
+ /* the glyph image format, finding the relevant renderer, and */
+ /* invoking it. */
+ /* */
+ /* <InOut> */
+ /* slot :: A handle to the glyph slot containing the image to */
+ /* convert. */
+ /* */
+ /* <Input> */
+ /* render_mode :: This is the render mode used to render the glyph */
+ /* image into a bitmap. See @FT_Render_Mode for a */
+ /* list of possible values. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Render_Glyph( FT_GlyphSlot slot,
+ FT_Render_Mode render_mode );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Enum> */
+ /* FT_Kerning_Mode */
+ /* */
+ /* <Description> */
+ /* An enumeration used to specify which kerning values to return in */
+ /* @FT_Get_Kerning. */
+ /* */
+ /* <Values> */
+ /* FT_KERNING_DEFAULT :: Return scaled and grid-fitted kerning */
+ /* distances (value is~0). */
+ /* */
+ /* FT_KERNING_UNFITTED :: Return scaled but un-grid-fitted kerning */
+ /* distances. */
+ /* */
+ /* FT_KERNING_UNSCALED :: Return the kerning vector in original font */
+ /* units. */
+ /* */
+ typedef enum FT_Kerning_Mode_
+ {
+ FT_KERNING_DEFAULT = 0,
+ FT_KERNING_UNFITTED,
+ FT_KERNING_UNSCALED
+
+ } FT_Kerning_Mode;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Const> */
+ /* ft_kerning_default */
+ /* */
+ /* <Description> */
+ /* This constant is deprecated. Please use @FT_KERNING_DEFAULT */
+ /* instead. */
+ /* */
+#define ft_kerning_default FT_KERNING_DEFAULT
+
+
+ /*************************************************************************/
+ /* */
+ /* <Const> */
+ /* ft_kerning_unfitted */
+ /* */
+ /* <Description> */
+ /* This constant is deprecated. Please use @FT_KERNING_UNFITTED */
+ /* instead. */
+ /* */
+#define ft_kerning_unfitted FT_KERNING_UNFITTED
+
+
+ /*************************************************************************/
+ /* */
+ /* <Const> */
+ /* ft_kerning_unscaled */
+ /* */
+ /* <Description> */
+ /* This constant is deprecated. Please use @FT_KERNING_UNSCALED */
+ /* instead. */
+ /* */
+#define ft_kerning_unscaled FT_KERNING_UNSCALED
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Get_Kerning */
+ /* */
+ /* <Description> */
+ /* Return the kerning vector between two glyphs of a same face. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to a source face object. */
+ /* */
+ /* left_glyph :: The index of the left glyph in the kern pair. */
+ /* */
+ /* right_glyph :: The index of the right glyph in the kern pair. */
+ /* */
+ /* kern_mode :: See @FT_Kerning_Mode for more information. */
+ /* Determines the scale and dimension of the returned */
+ /* kerning vector. */
+ /* */
+ /* <Output> */
+ /* akerning :: The kerning vector. This is either in font units */
+ /* or in pixels (26.6 format) for scalable formats, */
+ /* and in pixels for fixed-sizes formats. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* Only horizontal layouts (left-to-right & right-to-left) are */
+ /* supported by this method. Other layouts, or more sophisticated */
+ /* kernings, are out of the scope of this API function -- they can be */
+ /* implemented through format-specific interfaces. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Get_Kerning( FT_Face face,
+ FT_UInt left_glyph,
+ FT_UInt right_glyph,
+ FT_UInt kern_mode,
+ FT_Vector *akerning );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Get_Track_Kerning */
+ /* */
+ /* <Description> */
+ /* Return the track kerning for a given face object at a given size. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to a source face object. */
+ /* */
+ /* point_size :: The point size in 16.16 fractional points. */
+ /* */
+ /* degree :: The degree of tightness. Increasingly negative */
+ /* values represent tighter track kerning, while */
+ /* increasingly positive values represent looser track */
+ /* kerning. Value zero means no track kerning. */
+ /* */
+ /* <Output> */
+ /* akerning :: The kerning in 16.16 fractional points, to be */
+ /* uniformly applied between all glyphs. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* Currently, only the Type~1 font driver supports track kerning, */
+ /* using data from AFM files (if attached with @FT_Attach_File or */
+ /* @FT_Attach_Stream). */
+ /* */
+ /* Only very few AFM files come with track kerning data; please refer */
+ /* to the Adobe's AFM specification for more details. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Get_Track_Kerning( FT_Face face,
+ FT_Fixed point_size,
+ FT_Int degree,
+ FT_Fixed* akerning );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Get_Glyph_Name */
+ /* */
+ /* <Description> */
+ /* Retrieve the ASCII name of a given glyph in a face. This only */
+ /* works for those faces where @FT_HAS_GLYPH_NAMES(face) returns~1. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to a source face object. */
+ /* */
+ /* glyph_index :: The glyph index. */
+ /* */
+ /* buffer_max :: The maximum number of bytes available in the */
+ /* buffer. */
+ /* */
+ /* <Output> */
+ /* buffer :: A pointer to a target buffer where the name is */
+ /* copied to. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* An error is returned if the face doesn't provide glyph names or if */
+ /* the glyph index is invalid. In all cases of failure, the first */
+ /* byte of `buffer' is set to~0 to indicate an empty name. */
+ /* */
+ /* The glyph name is truncated to fit within the buffer if it is too */
+ /* long. The returned string is always zero-terminated. */
+ /* */
+ /* Be aware that FreeType reorders glyph indices internally so that */
+ /* glyph index~0 always corresponds to the `missing glyph' (called */
+ /* `.notdef'). */
+ /* */
+ /* This function is not compiled within the library if the config */
+ /* macro `FT_CONFIG_OPTION_NO_GLYPH_NAMES' is defined in */
+ /* `include/freetype/config/ftoptions.h'. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Get_Glyph_Name( FT_Face face,
+ FT_UInt glyph_index,
+ FT_Pointer buffer,
+ FT_UInt buffer_max );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Get_Postscript_Name */
+ /* */
+ /* <Description> */
+ /* Retrieve the ASCII PostScript name of a given face, if available. */
+ /* This only works with PostScript and TrueType fonts. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to the source face object. */
+ /* */
+ /* <Return> */
+ /* A pointer to the face's PostScript name. NULL if unavailable. */
+ /* */
+ /* <Note> */
+ /* The returned pointer is owned by the face and is destroyed with */
+ /* it. */
+ /* */
+ FT_EXPORT( const char* )
+ FT_Get_Postscript_Name( FT_Face face );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Select_Charmap */
+ /* */
+ /* <Description> */
+ /* Select a given charmap by its encoding tag (as listed in */
+ /* `freetype.h'). */
+ /* */
+ /* <InOut> */
+ /* face :: A handle to the source face object. */
+ /* */
+ /* <Input> */
+ /* encoding :: A handle to the selected encoding. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* This function returns an error if no charmap in the face */
+ /* corresponds to the encoding queried here. */
+ /* */
+ /* Because many fonts contain more than a single cmap for Unicode */
+ /* encoding, this function has some special code to select the one */
+ /* which covers Unicode best (`best' in the sense that a UCS-4 cmap */
+ /* is preferred to a UCS-2 cmap). It is thus preferable to */
+ /* @FT_Set_Charmap in this case. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Select_Charmap( FT_Face face,
+ FT_Encoding encoding );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Set_Charmap */
+ /* */
+ /* <Description> */
+ /* Select a given charmap for character code to glyph index mapping. */
+ /* */
+ /* <InOut> */
+ /* face :: A handle to the source face object. */
+ /* */
+ /* <Input> */
+ /* charmap :: A handle to the selected charmap. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* This function returns an error if the charmap is not part of */
+ /* the face (i.e., if it is not listed in the `face->charmaps' */
+ /* table). */
+ /* */
+ /* It also fails if a type~14 charmap is selected. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Set_Charmap( FT_Face face,
+ FT_CharMap charmap );
+
+
+ /*************************************************************************
+ *
+ * @function:
+ * FT_Get_Charmap_Index
+ *
+ * @description:
+ * Retrieve index of a given charmap.
+ *
+ * @input:
+ * charmap ::
+ * A handle to a charmap.
+ *
+ * @return:
+ * The index into the array of character maps within the face to which
+ * `charmap' belongs. If an error occurs, -1 is returned.
+ *
+ */
+ FT_EXPORT( FT_Int )
+ FT_Get_Charmap_Index( FT_CharMap charmap );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Get_Char_Index */
+ /* */
+ /* <Description> */
+ /* Return the glyph index of a given character code. This function */
+ /* uses a charmap object to do the mapping. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to the source face object. */
+ /* */
+ /* charcode :: The character code. */
+ /* */
+ /* <Return> */
+ /* The glyph index. 0~means `undefined character code'. */
+ /* */
+ /* <Note> */
+ /* If you use FreeType to manipulate the contents of font files */
+ /* directly, be aware that the glyph index returned by this function */
+ /* doesn't always correspond to the internal indices used within the */
+ /* file. This is done to ensure that value~0 always corresponds to */
+ /* the `missing glyph'. If the first glyph is not named `.notdef', */
+ /* then for Type~1 and Type~42 fonts, `.notdef' will be moved into */
+ /* the glyph ID~0 position, and whatever was there will be moved to */
+ /* the position `.notdef' had. For Type~1 fonts, if there is no */
+ /* `.notdef' glyph at all, then one will be created at index~0 and */
+ /* whatever was there will be moved to the last index -- Type~42 */
+ /* fonts are considered invalid under this condition. */
+ /* */
+ FT_EXPORT( FT_UInt )
+ FT_Get_Char_Index( FT_Face face,
+ FT_ULong charcode );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Get_First_Char */
+ /* */
+ /* <Description> */
+ /* This function is used to return the first character code in the */
+ /* current charmap of a given face. It also returns the */
+ /* corresponding glyph index. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to the source face object. */
+ /* */
+ /* <Output> */
+ /* agindex :: Glyph index of first character code. 0~if charmap is */
+ /* empty. */
+ /* */
+ /* <Return> */
+ /* The charmap's first character code. */
+ /* */
+ /* <Note> */
+ /* You should use this function with @FT_Get_Next_Char to be able to */
+ /* parse all character codes available in a given charmap. The code */
+ /* should look like this: */
+ /* */
+ /* { */
+ /* FT_ULong charcode; */
+ /* FT_UInt gindex; */
+ /* */
+ /* */
+ /* charcode = FT_Get_First_Char( face, &gindex ); */
+ /* while ( gindex != 0 ) */
+ /* { */
+ /* ... do something with (charcode,gindex) pair ... */
+ /* */
+ /* charcode = FT_Get_Next_Char( face, charcode, &gindex ); */
+ /* } */
+ /* } */
+ /* */
+ /* Note that `*agindex' is set to~0 if the charmap is empty. The */
+ /* result itself can be~0 in two cases: if the charmap is empty or */
+ /* if the value~0 is the first valid character code. */
+ /* */
+ FT_EXPORT( FT_ULong )
+ FT_Get_First_Char( FT_Face face,
+ FT_UInt *agindex );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Get_Next_Char */
+ /* */
+ /* <Description> */
+ /* This function is used to return the next character code in the */
+ /* current charmap of a given face following the value `char_code', */
+ /* as well as the corresponding glyph index. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to the source face object. */
+ /* char_code :: The starting character code. */
+ /* */
+ /* <Output> */
+ /* agindex :: Glyph index of next character code. 0~if charmap */
+ /* is empty. */
+ /* */
+ /* <Return> */
+ /* The charmap's next character code. */
+ /* */
+ /* <Note> */
+ /* You should use this function with @FT_Get_First_Char to walk */
+ /* over all character codes available in a given charmap. See the */
+ /* note for this function for a simple code example. */
+ /* */
+ /* Note that `*agindex' is set to~0 when there are no more codes in */
+ /* the charmap. */
+ /* */
+ FT_EXPORT( FT_ULong )
+ FT_Get_Next_Char( FT_Face face,
+ FT_ULong char_code,
+ FT_UInt *agindex );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Get_Name_Index */
+ /* */
+ /* <Description> */
+ /* Return the glyph index of a given glyph name. This function uses */
+ /* driver specific objects to do the translation. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to the source face object. */
+ /* */
+ /* glyph_name :: The glyph name. */
+ /* */
+ /* <Return> */
+ /* The glyph index. 0~means `undefined character code'. */
+ /* */
+ FT_EXPORT( FT_UInt )
+ FT_Get_Name_Index( FT_Face face,
+ FT_String* glyph_name );
+
+
+ /*************************************************************************
+ *
+ * @macro:
+ * FT_SUBGLYPH_FLAG_XXX
+ *
+ * @description:
+ * A list of constants used to describe subglyphs. Please refer to the
+ * TrueType specification for the meaning of the various flags.
+ *
+ * @values:
+ * FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS ::
+ * FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES ::
+ * FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID ::
+ * FT_SUBGLYPH_FLAG_SCALE ::
+ * FT_SUBGLYPH_FLAG_XY_SCALE ::
+ * FT_SUBGLYPH_FLAG_2X2 ::
+ * FT_SUBGLYPH_FLAG_USE_MY_METRICS ::
+ *
+ */
+#define FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS 1
+#define FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES 2
+#define FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID 4
+#define FT_SUBGLYPH_FLAG_SCALE 8
+#define FT_SUBGLYPH_FLAG_XY_SCALE 0x40
+#define FT_SUBGLYPH_FLAG_2X2 0x80
+#define FT_SUBGLYPH_FLAG_USE_MY_METRICS 0x200
+
+
+ /*************************************************************************
+ *
+ * @func:
+ * FT_Get_SubGlyph_Info
+ *
+ * @description:
+ * Retrieve a description of a given subglyph. Only use it if
+ * `glyph->format' is @FT_GLYPH_FORMAT_COMPOSITE; an error is
+ * returned otherwise.
+ *
+ * @input:
+ * glyph ::
+ * The source glyph slot.
+ *
+ * sub_index ::
+ * The index of the subglyph. Must be less than
+ * `glyph->num_subglyphs'.
+ *
+ * @output:
+ * p_index ::
+ * The glyph index of the subglyph.
+ *
+ * p_flags ::
+ * The subglyph flags, see @FT_SUBGLYPH_FLAG_XXX.
+ *
+ * p_arg1 ::
+ * The subglyph's first argument (if any).
+ *
+ * p_arg2 ::
+ * The subglyph's second argument (if any).
+ *
+ * p_transform ::
+ * The subglyph transformation (if any).
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * The values of `*p_arg1', `*p_arg2', and `*p_transform' must be
+ * interpreted depending on the flags returned in `*p_flags'. See the
+ * TrueType specification for details.
+ *
+ */
+ FT_EXPORT( FT_Error )
+ FT_Get_SubGlyph_Info( FT_GlyphSlot glyph,
+ FT_UInt sub_index,
+ FT_Int *p_index,
+ FT_UInt *p_flags,
+ FT_Int *p_arg1,
+ FT_Int *p_arg2,
+ FT_Matrix *p_transform );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Enum> */
+ /* FT_FSTYPE_XXX */
+ /* */
+ /* <Description> */
+ /* A list of bit flags used in the `fsType' field of the OS/2 table */
+ /* in a TrueType or OpenType font and the `FSType' entry in a */
+ /* PostScript font. These bit flags are returned by */
+ /* @FT_Get_FSType_Flags; they inform client applications of embedding */
+ /* and subsetting restrictions associated with a font. */
+ /* */
+ /* See http://www.adobe.com/devnet/acrobat/pdfs/FontPolicies.pdf for */
+ /* more details. */
+ /* */
+ /* <Values> */
+ /* FT_FSTYPE_INSTALLABLE_EMBEDDING :: */
+ /* Fonts with no fsType bit set may be embedded and permanently */
+ /* installed on the remote system by an application. */
+ /* */
+ /* FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING :: */
+ /* Fonts that have only this bit set must not be modified, embedded */
+ /* or exchanged in any manner without first obtaining permission of */
+ /* the font software copyright owner. */
+ /* */
+ /* FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING :: */
+ /* If this bit is set, the font may be embedded and temporarily */
+ /* loaded on the remote system. Documents containing Preview & */
+ /* Print fonts must be opened `read-only'; no edits can be applied */
+ /* to the document. */
+ /* */
+ /* FT_FSTYPE_EDITABLE_EMBEDDING :: */
+ /* If this bit is set, the font may be embedded but must only be */
+ /* installed temporarily on other systems. In contrast to Preview */
+ /* & Print fonts, documents containing editable fonts may be opened */
+ /* for reading, editing is permitted, and changes may be saved. */
+ /* */
+ /* FT_FSTYPE_NO_SUBSETTING :: */
+ /* If this bit is set, the font may not be subsetted prior to */
+ /* embedding. */
+ /* */
+ /* FT_FSTYPE_BITMAP_EMBEDDING_ONLY :: */
+ /* If this bit is set, only bitmaps contained in the font may be */
+ /* embedded; no outline data may be embedded. If there are no */
+ /* bitmaps available in the font, then the font is unembeddable. */
+ /* */
+ /* <Note> */
+ /* While the fsType flags can indicate that a font may be embedded, a */
+ /* license with the font vendor may be separately required to use the */
+ /* font in this way. */
+ /* */
+#define FT_FSTYPE_INSTALLABLE_EMBEDDING 0x0000
+#define FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING 0x0002
+#define FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING 0x0004
+#define FT_FSTYPE_EDITABLE_EMBEDDING 0x0008
+#define FT_FSTYPE_NO_SUBSETTING 0x0100
+#define FT_FSTYPE_BITMAP_EMBEDDING_ONLY 0x0200
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Get_FSType_Flags */
+ /* */
+ /* <Description> */
+ /* Return the fsType flags for a font. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to the source face object. */
+ /* */
+ /* <Return> */
+ /* The fsType flags, @FT_FSTYPE_XXX. */
+ /* */
+ /* <Note> */
+ /* Use this function rather than directly reading the `fs_type' field */
+ /* in the @PS_FontInfoRec structure which is only guaranteed to */
+ /* return the correct results for Type~1 fonts. */
+ /* */
+ /* <Since> */
+ /* 2.3.8 */
+ /* */
+ FT_EXPORT( FT_UShort )
+ FT_Get_FSType_Flags( FT_Face face );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* glyph_variants */
+ /* */
+ /* <Title> */
+ /* Glyph Variants */
+ /* */
+ /* <Abstract> */
+ /* The FreeType~2 interface to Unicode Ideographic Variation */
+ /* Sequences (IVS), using the SFNT cmap format~14. */
+ /* */
+ /* <Description> */
+ /* Many CJK characters have variant forms. They are a sort of grey */
+ /* area somewhere between being totally irrelevant and semantically */
+ /* distinct; for this reason, the Unicode consortium decided to */
+ /* introduce Ideographic Variation Sequences (IVS), consisting of a */
+ /* Unicode base character and one of 240 variant selectors */
+ /* (U+E0100-U+E01EF), instead of further extending the already huge */
+ /* code range for CJK characters. */
+ /* */
+ /* An IVS is registered and unique; for further details please refer */
+ /* to Unicode Technical Standard #37, the Ideographic Variation */
+ /* Database: */
+ /* */
+ /* http://www.unicode.org/reports/tr37/ */
+ /* */
+ /* To date (November 2012), the character with the most variants is */
+ /* U+9089, having 31 such IVS. */
+ /* */
+ /* Adobe and MS decided to support IVS with a new cmap subtable */
+ /* (format~14). It is an odd subtable because it is not a mapping of */
+ /* input code points to glyphs, but contains lists of all variants */
+ /* supported by the font. */
+ /* */
+ /* A variant may be either `default' or `non-default'. A default */
+ /* variant is the one you will get for that code point if you look it */
+ /* up in the standard Unicode cmap. A non-default variant is a */
+ /* different glyph. */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Face_GetCharVariantIndex */
+ /* */
+ /* <Description> */
+ /* Return the glyph index of a given character code as modified by */
+ /* the variation selector. */
+ /* */
+ /* <Input> */
+ /* face :: */
+ /* A handle to the source face object. */
+ /* */
+ /* charcode :: */
+ /* The character code point in Unicode. */
+ /* */
+ /* variantSelector :: */
+ /* The Unicode code point of the variation selector. */
+ /* */
+ /* <Return> */
+ /* The glyph index. 0~means either `undefined character code', or */
+ /* `undefined selector code', or `no variation selector cmap */
+ /* subtable', or `current CharMap is not Unicode'. */
+ /* */
+ /* <Note> */
+ /* If you use FreeType to manipulate the contents of font files */
+ /* directly, be aware that the glyph index returned by this function */
+ /* doesn't always correspond to the internal indices used within */
+ /* the file. This is done to ensure that value~0 always corresponds */
+ /* to the `missing glyph'. */
+ /* */
+ /* This function is only meaningful if */
+ /* a) the font has a variation selector cmap sub table, */
+ /* and */
+ /* b) the current charmap has a Unicode encoding. */
+ /* */
+ /* <Since> */
+ /* 2.3.6 */
+ /* */
+ FT_EXPORT( FT_UInt )
+ FT_Face_GetCharVariantIndex( FT_Face face,
+ FT_ULong charcode,
+ FT_ULong variantSelector );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Face_GetCharVariantIsDefault */
+ /* */
+ /* <Description> */
+ /* Check whether this variant of this Unicode character is the one to */
+ /* be found in the `cmap'. */
+ /* */
+ /* <Input> */
+ /* face :: */
+ /* A handle to the source face object. */
+ /* */
+ /* charcode :: */
+ /* The character codepoint in Unicode. */
+ /* */
+ /* variantSelector :: */
+ /* The Unicode codepoint of the variation selector. */
+ /* */
+ /* <Return> */
+ /* 1~if found in the standard (Unicode) cmap, 0~if found in the */
+ /* variation selector cmap, or -1 if it is not a variant. */
+ /* */
+ /* <Note> */
+ /* This function is only meaningful if the font has a variation */
+ /* selector cmap subtable. */
+ /* */
+ /* <Since> */
+ /* 2.3.6 */
+ /* */
+ FT_EXPORT( FT_Int )
+ FT_Face_GetCharVariantIsDefault( FT_Face face,
+ FT_ULong charcode,
+ FT_ULong variantSelector );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Face_GetVariantSelectors */
+ /* */
+ /* <Description> */
+ /* Return a zero-terminated list of Unicode variant selectors found */
+ /* in the font. */
+ /* */
+ /* <Input> */
+ /* face :: */
+ /* A handle to the source face object. */
+ /* */
+ /* <Return> */
+ /* A pointer to an array of selector code points, or NULL if there is */
+ /* no valid variant selector cmap subtable. */
+ /* */
+ /* <Note> */
+ /* The last item in the array is~0; the array is owned by the */
+ /* @FT_Face object but can be overwritten or released on the next */
+ /* call to a FreeType function. */
+ /* */
+ /* <Since> */
+ /* 2.3.6 */
+ /* */
+ FT_EXPORT( FT_UInt32* )
+ FT_Face_GetVariantSelectors( FT_Face face );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Face_GetVariantsOfChar */
+ /* */
+ /* <Description> */
+ /* Return a zero-terminated list of Unicode variant selectors found */
+ /* for the specified character code. */
+ /* */
+ /* <Input> */
+ /* face :: */
+ /* A handle to the source face object. */
+ /* */
+ /* charcode :: */
+ /* The character codepoint in Unicode. */
+ /* */
+ /* <Return> */
+ /* A pointer to an array of variant selector code points which are */
+ /* active for the given character, or NULL if the corresponding list */
+ /* is empty. */
+ /* */
+ /* <Note> */
+ /* The last item in the array is~0; the array is owned by the */
+ /* @FT_Face object but can be overwritten or released on the next */
+ /* call to a FreeType function. */
+ /* */
+ /* <Since> */
+ /* 2.3.6 */
+ /* */
+ FT_EXPORT( FT_UInt32* )
+ FT_Face_GetVariantsOfChar( FT_Face face,
+ FT_ULong charcode );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Face_GetCharsOfVariant */
+ /* */
+ /* <Description> */
+ /* Return a zero-terminated list of Unicode character codes found for */
+ /* the specified variant selector. */
+ /* */
+ /* <Input> */
+ /* face :: */
+ /* A handle to the source face object. */
+ /* */
+ /* variantSelector :: */
+ /* The variant selector code point in Unicode. */
+ /* */
+ /* <Return> */
+ /* A list of all the code points which are specified by this selector */
+ /* (both default and non-default codes are returned) or NULL if there */
+ /* is no valid cmap or the variant selector is invalid. */
+ /* */
+ /* <Note> */
+ /* The last item in the array is~0; the array is owned by the */
+ /* @FT_Face object but can be overwritten or released on the next */
+ /* call to a FreeType function. */
+ /* */
+ /* <Since> */
+ /* 2.3.6 */
+ /* */
+ FT_EXPORT( FT_UInt32* )
+ FT_Face_GetCharsOfVariant( FT_Face face,
+ FT_ULong variantSelector );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* computations */
+ /* */
+ /* <Title> */
+ /* Computations */
+ /* */
+ /* <Abstract> */
+ /* Crunching fixed numbers and vectors. */
+ /* */
+ /* <Description> */
+ /* This section contains various functions used to perform */
+ /* computations on 16.16 fixed-float numbers or 2d vectors. */
+ /* */
+ /* <Order> */
+ /* FT_MulDiv */
+ /* FT_MulFix */
+ /* FT_DivFix */
+ /* FT_RoundFix */
+ /* FT_CeilFix */
+ /* FT_FloorFix */
+ /* FT_Vector_Transform */
+ /* FT_Matrix_Multiply */
+ /* FT_Matrix_Invert */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_MulDiv */
+ /* */
+ /* <Description> */
+ /* A very simple function used to perform the computation `(a*b)/c' */
+ /* with maximum accuracy (it uses a 64-bit intermediate integer */
+ /* whenever necessary). */
+ /* */
+ /* This function isn't necessarily as fast as some processor specific */
+ /* operations, but is at least completely portable. */
+ /* */
+ /* <Input> */
+ /* a :: The first multiplier. */
+ /* b :: The second multiplier. */
+ /* c :: The divisor. */
+ /* */
+ /* <Return> */
+ /* The result of `(a*b)/c'. This function never traps when trying to */
+ /* divide by zero; it simply returns `MaxInt' or `MinInt' depending */
+ /* on the signs of `a' and `b'. */
+ /* */
+ FT_EXPORT( FT_Long )
+ FT_MulDiv( FT_Long a,
+ FT_Long b,
+ FT_Long c );
+
+
+ /* */
+
+ /* The following #if 0 ... #endif is for the documentation formatter, */
+ /* hiding the internal `FT_MULFIX_INLINED' macro. */
+
+#if 0
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_MulFix */
+ /* */
+ /* <Description> */
+ /* A very simple function used to perform the computation */
+ /* `(a*b)/0x10000' with maximum accuracy. Most of the time this is */
+ /* used to multiply a given value by a 16.16 fixed-point factor. */
+ /* */
+ /* <Input> */
+ /* a :: The first multiplier. */
+ /* b :: The second multiplier. Use a 16.16 factor here whenever */
+ /* possible (see note below). */
+ /* */
+ /* <Return> */
+ /* The result of `(a*b)/0x10000'. */
+ /* */
+ /* <Note> */
+ /* This function has been optimized for the case where the absolute */
+ /* value of `a' is less than 2048, and `b' is a 16.16 scaling factor. */
+ /* As this happens mainly when scaling from notional units to */
+ /* fractional pixels in FreeType, it resulted in noticeable speed */
+ /* improvements between versions 2.x and 1.x. */
+ /* */
+ /* As a conclusion, always try to place a 16.16 factor as the */
+ /* _second_ argument of this function; this can make a great */
+ /* difference. */
+ /* */
+ FT_EXPORT( FT_Long )
+ FT_MulFix( FT_Long a,
+ FT_Long b );
+
+ /* */
+#endif
+
+#ifdef FT_MULFIX_INLINED
+#define FPDFAPI_FT_MulFix( a, b ) FT_MULFIX_INLINED( a, b )
+#else
+ FT_EXPORT( FT_Long )
+ FT_MulFix( FT_Long a,
+ FT_Long b );
+#endif
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_DivFix */
+ /* */
+ /* <Description> */
+ /* A very simple function used to perform the computation */
+ /* `(a*0x10000)/b' with maximum accuracy. Most of the time, this is */
+ /* used to divide a given value by a 16.16 fixed-point factor. */
+ /* */
+ /* <Input> */
+ /* a :: The first multiplier. */
+ /* b :: The second multiplier. Use a 16.16 factor here whenever */
+ /* possible (see note below). */
+ /* */
+ /* <Return> */
+ /* The result of `(a*0x10000)/b'. */
+ /* */
+ /* <Note> */
+ /* The optimization for FT_DivFix() is simple: If (a~<<~16) fits in */
+ /* 32~bits, then the division is computed directly. Otherwise, we */
+ /* use a specialized version of @FT_MulDiv. */
+ /* */
+ FT_EXPORT( FT_Long )
+ FT_DivFix( FT_Long a,
+ FT_Long b );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_RoundFix */
+ /* */
+ /* <Description> */
+ /* A very simple function used to round a 16.16 fixed number. */
+ /* */
+ /* <Input> */
+ /* a :: The number to be rounded. */
+ /* */
+ /* <Return> */
+ /* The result of `(a + 0x8000) & -0x10000'. */
+ /* */
+ FT_EXPORT( FT_Fixed )
+ FT_RoundFix( FT_Fixed a );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_CeilFix */
+ /* */
+ /* <Description> */
+ /* A very simple function used to compute the ceiling function of a */
+ /* 16.16 fixed number. */
+ /* */
+ /* <Input> */
+ /* a :: The number for which the ceiling function is to be computed. */
+ /* */
+ /* <Return> */
+ /* The result of `(a + 0x10000 - 1) & -0x10000'. */
+ /* */
+ FT_EXPORT( FT_Fixed )
+ FT_CeilFix( FT_Fixed a );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_FloorFix */
+ /* */
+ /* <Description> */
+ /* A very simple function used to compute the floor function of a */
+ /* 16.16 fixed number. */
+ /* */
+ /* <Input> */
+ /* a :: The number for which the floor function is to be computed. */
+ /* */
+ /* <Return> */
+ /* The result of `a & -0x10000'. */
+ /* */
+ FT_EXPORT( FT_Fixed )
+ FT_FloorFix( FT_Fixed a );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Vector_Transform */
+ /* */
+ /* <Description> */
+ /* Transform a single vector through a 2x2 matrix. */
+ /* */
+ /* <InOut> */
+ /* vector :: The target vector to transform. */
+ /* */
+ /* <Input> */
+ /* matrix :: A pointer to the source 2x2 matrix. */
+ /* */
+ /* <Note> */
+ /* The result is undefined if either `vector' or `matrix' is invalid. */
+ /* */
+ FT_EXPORT( void )
+ FT_Vector_Transform( FT_Vector* vec,
+ const FT_Matrix* matrix );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* version */
+ /* */
+ /* <Title> */
+ /* FreeType Version */
+ /* */
+ /* <Abstract> */
+ /* Functions and macros related to FreeType versions. */
+ /* */
+ /* <Description> */
+ /* Note that those functions and macros are of limited use because */
+ /* even a new release of FreeType with only documentation changes */
+ /* increases the version number. */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************
+ *
+ * @enum:
+ * FREETYPE_XXX
+ *
+ * @description:
+ * These three macros identify the FreeType source code version.
+ * Use @FT_Library_Version to access them at runtime.
+ *
+ * @values:
+ * FREETYPE_MAJOR :: The major version number.
+ * FREETYPE_MINOR :: The minor version number.
+ * FREETYPE_PATCH :: The patch level.
+ *
+ * @note:
+ * The version number of FreeType if built as a dynamic link library
+ * with the `libtool' package is _not_ controlled by these three
+ * macros.
+ *
+ */
+#define FREETYPE_MAJOR 2
+#define FREETYPE_MINOR 5
+#define FREETYPE_PATCH 0
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Library_Version */
+ /* */
+ /* <Description> */
+ /* Return the version of the FreeType library being used. This is */
+ /* useful when dynamically linking to the library, since one cannot */
+ /* use the macros @FREETYPE_MAJOR, @FREETYPE_MINOR, and */
+ /* @FREETYPE_PATCH. */
+ /* */
+ /* <Input> */
+ /* library :: A source library handle. */
+ /* */
+ /* <Output> */
+ /* amajor :: The major version number. */
+ /* */
+ /* aminor :: The minor version number. */
+ /* */
+ /* apatch :: The patch version number. */
+ /* */
+ /* <Note> */
+ /* The reason why this function takes a `library' argument is because */
+ /* certain programs implement library initialization in a custom way */
+ /* that doesn't use @FT_Init_FreeType. */
+ /* */
+ /* In such cases, the library version might not be available before */
+ /* the library object has been created. */
+ /* */
+ FT_EXPORT( void )
+ FT_Library_Version( FT_Library library,
+ FT_Int *amajor,
+ FT_Int *aminor,
+ FT_Int *apatch );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Face_CheckTrueTypePatents */
+ /* */
+ /* <Description> */
+ /* Parse all bytecode instructions of a TrueType font file to check */
+ /* whether any of the patented opcodes are used. This is only useful */
+ /* if you want to be able to use the unpatented hinter with */
+ /* fonts that do *not* use these opcodes. */
+ /* */
+ /* Note that this function parses *all* glyph instructions in the */
+ /* font file, which may be slow. */
+ /* */
+ /* <Input> */
+ /* face :: A face handle. */
+ /* */
+ /* <Return> */
+ /* 1~if this is a TrueType font that uses one of the patented */
+ /* opcodes, 0~otherwise. */
+ /* */
+ /* <Note> */
+ /* Since May 2010, TrueType hinting is no longer patented. */
+ /* */
+ /* <Since> */
+ /* 2.3.5 */
+ /* */
+ FT_EXPORT( FT_Bool )
+ FT_Face_CheckTrueTypePatents( FT_Face face );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Face_SetUnpatentedHinting */
+ /* */
+ /* <Description> */
+ /* Enable or disable the unpatented hinter for a given face. */
+ /* Only enable it if you have determined that the face doesn't */
+ /* use any patented opcodes (see @FT_Face_CheckTrueTypePatents). */
+ /* */
+ /* <Input> */
+ /* face :: A face handle. */
+ /* */
+ /* value :: New boolean setting. */
+ /* */
+ /* <Return> */
+ /* The old setting value. This will always be false if this is not */
+ /* an SFNT font, or if the unpatented hinter is not compiled in this */
+ /* instance of the library. */
+ /* */
+ /* <Note> */
+ /* Since May 2010, TrueType hinting is no longer patented. */
+ /* */
+ /* <Since> */
+ /* 2.3.5 */
+ /* */
+ FT_EXPORT( FT_Bool )
+ FT_Face_SetUnpatentedHinting( FT_Face face,
+ FT_Bool value );
+
+ /* */
+
+
+FT_END_HEADER
+
+#endif /* __FREETYPE_H__ */
+
+
+/* END */
diff --git a/core/include/thirdparties/freetype/freetype/ftsystem.h b/core/include/thirdparties/freetype/freetype/ftsystem.h
index 6b41320aa8..1e92390aca 100644
--- a/core/include/thirdparties/freetype/freetype/ftsystem.h
+++ b/core/include/thirdparties/freetype/freetype/ftsystem.h
@@ -89,10 +89,10 @@ FT_BEGIN_HEADER
(*FT_Alloc_Func)( FT_Memory memory,
long size );
- /* Sunliang.Liu 20100915 sync 221's revison. */
- typedef void*
- (*FT_AllocDebug_Func)( FT_Memory memory,
- long size, const char* filename, int line);
+ /* Sunliang.Liu 20100915 sync 221's revison. */
+ typedef void*
+ (*FT_AllocDebug_Func)( FT_Memory memory,
+ long size, const char* filename, int line);
diff --git a/core/include/thirdparties/freetype/freetype/internal/ftmemory.h b/core/include/thirdparties/freetype/freetype/internal/ftmemory.h
index 67cbf43308..432a9ba6d8 100644
--- a/core/include/thirdparties/freetype/freetype/internal/ftmemory.h
+++ b/core/include/thirdparties/freetype/freetype/internal/ftmemory.h
@@ -135,37 +135,37 @@ FT_BEGIN_HEADER
FT_Long new_count,
void* block,
FT_Error *p_error );
-#ifdef _DEBUG
-//#define _XYQ_MEM_DEBUG
-#endif
-
-#ifdef _XYQ_MEM_DEBUG /* XYQ */
- FT_BASE( FT_Pointer )
- ft_mem_allocdebug( FT_Memory memory,
- FT_Long size, const char* filename, int line,
- FT_Error *p_error );
-
- FT_BASE( FT_Pointer )
- ft_mem_qallocdebug( FT_Memory memory,
- FT_Long size, const char* filename, int line,
- FT_Error *p_error );
-
- FT_BASE( FT_Pointer )
- ft_mem_reallocdebug( FT_Memory memory,
- FT_Long item_size,
- FT_Long cur_count,
- FT_Long new_count,
- void* block, const char* filename, int line,
- FT_Error *p_error );
-
- FT_BASE( FT_Pointer )
- ft_mem_qreallocdebug( FT_Memory memory,
- FT_Long item_size,
- FT_Long cur_count,
- FT_Long new_count,
- void* block, const char* filename, int line,
- FT_Error *p_error );
-#endif
+#ifdef _DEBUG
+//#define _XYQ_MEM_DEBUG
+#endif
+
+#ifdef _XYQ_MEM_DEBUG /* XYQ */
+ FT_BASE( FT_Pointer )
+ ft_mem_allocdebug( FT_Memory memory,
+ FT_Long size, const char* filename, int line,
+ FT_Error *p_error );
+
+ FT_BASE( FT_Pointer )
+ ft_mem_qallocdebug( FT_Memory memory,
+ FT_Long size, const char* filename, int line,
+ FT_Error *p_error );
+
+ FT_BASE( FT_Pointer )
+ ft_mem_reallocdebug( FT_Memory memory,
+ FT_Long item_size,
+ FT_Long cur_count,
+ FT_Long new_count,
+ void* block, const char* filename, int line,
+ FT_Error *p_error );
+
+ FT_BASE( FT_Pointer )
+ ft_mem_qreallocdebug( FT_Memory memory,
+ FT_Long item_size,
+ FT_Long cur_count,
+ FT_Long new_count,
+ void* block, const char* filename, int line,
+ FT_Error *p_error );
+#endif
FT_BASE( void )
@@ -178,8 +178,8 @@ FT_BEGIN_HEADER
ft_mem_free( memory, (ptr) ); \
(ptr) = NULL; \
FT_END_STMNT
-#ifndef _XYQ_MEM_DEBUG
-#define FT_MEM_ALLOC( ptr, size ) \
+#ifndef _XYQ_MEM_DEBUG
+#define FT_MEM_ALLOC( ptr, size ) \
FT_ASSIGNP_INNER( ptr, ft_mem_alloc( memory, (size), &error ) )
@@ -235,94 +235,94 @@ FT_BEGIN_HEADER
(FT_Long)(newcnt), \
(ptr), \
&error ) )
-#define FT_MEM_NEW_ARRAY( ptr, count ) \
- FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, sizeof ( *(ptr) ), \
- 0, (count), \
- NULL, &error ) )
-
-#define FT_MEM_RENEW_ARRAY( ptr, cursz, newsz ) \
- FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, sizeof ( *(ptr) ), \
- (cursz), (newsz), \
- (ptr), &error ) )
-
-#define FT_MEM_QNEW_ARRAY( ptr, count ) \
- FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, sizeof ( *(ptr) ), \
- 0, (count), \
- NULL, &error ) )
-
-#define FT_MEM_QRENEW_ARRAY( ptr, cursz, newsz ) \
- FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, sizeof ( *(ptr) ), \
- (cursz), (newsz), \
- (ptr), &error ) )
-
-#else
-#define FT_MEM_ALLOC( ptr, size ) \
- FT_ASSIGNP_INNER( ptr, ft_mem_allocdebug( memory, (size), __FILE__, __LINE__, &error ) )
-
-#define FT_MEM_REALLOC( ptr, cursz, newsz ) \
- FT_ASSIGNP_INNER( ptr, ft_mem_reallocdebug( memory, 1, \
- (cursz), (newsz), \
- (ptr), __FILE__, __LINE__, &error ) )
-
-#define FT_MEM_QALLOC( ptr, size ) \
- FT_ASSIGNP_INNER( ptr, ft_mem_qallocdebug( memory, (size), __FILE__, __LINE__, &error ) )
-
-#define FT_MEM_QREALLOC( ptr, cursz, newsz ) \
- FT_ASSIGNP_INNER( ptr, ft_mem_qreallocdebug( memory, 1, \
- (cursz), (newsz), \
- (ptr), __FILE__, __LINE__, &error ) )
-
-#define FT_MEM_ALLOC_MULT( ptr, count, item_size ) \
- FT_ASSIGNP_INNER( ptr, ft_mem_reallocdebug( memory, (item_size), \
- 0, (count), \
- NULL, __FILE__, __LINE__, &error ) )
-
-#define FT_MEM_REALLOC_MULT( ptr, oldcnt, newcnt, itmsz ) \
- FT_ASSIGNP_INNER( ptr, ft_mem_reallocdebug( memory, (itmsz), \
- (oldcnt), (newcnt), \
+#define FT_MEM_NEW_ARRAY( ptr, count ) \
+ FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, sizeof ( *(ptr) ), \
+ 0, (count), \
+ NULL, &error ) )
+
+#define FT_MEM_RENEW_ARRAY( ptr, cursz, newsz ) \
+ FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, sizeof ( *(ptr) ), \
+ (cursz), (newsz), \
+ (ptr), &error ) )
+
+#define FT_MEM_QNEW_ARRAY( ptr, count ) \
+ FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, sizeof ( *(ptr) ), \
+ 0, (count), \
+ NULL, &error ) )
+
+#define FT_MEM_QRENEW_ARRAY( ptr, cursz, newsz ) \
+ FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, sizeof ( *(ptr) ), \
+ (cursz), (newsz), \
+ (ptr), &error ) )
+
+#else
+#define FT_MEM_ALLOC( ptr, size ) \
+ FT_ASSIGNP_INNER( ptr, ft_mem_allocdebug( memory, (size), __FILE__, __LINE__, &error ) )
+
+#define FT_MEM_REALLOC( ptr, cursz, newsz ) \
+ FT_ASSIGNP_INNER( ptr, ft_mem_reallocdebug( memory, 1, \
+ (cursz), (newsz), \
+ (ptr), __FILE__, __LINE__, &error ) )
+
+#define FT_MEM_QALLOC( ptr, size ) \
+ FT_ASSIGNP_INNER( ptr, ft_mem_qallocdebug( memory, (size), __FILE__, __LINE__, &error ) )
+
+#define FT_MEM_QREALLOC( ptr, cursz, newsz ) \
+ FT_ASSIGNP_INNER( ptr, ft_mem_qreallocdebug( memory, 1, \
+ (cursz), (newsz), \
+ (ptr), __FILE__, __LINE__, &error ) )
+
+#define FT_MEM_ALLOC_MULT( ptr, count, item_size ) \
+ FT_ASSIGNP_INNER( ptr, ft_mem_reallocdebug( memory, (item_size), \
+ 0, (count), \
+ NULL, __FILE__, __LINE__, &error ) )
+
+#define FT_MEM_REALLOC_MULT( ptr, oldcnt, newcnt, itmsz ) \
+ FT_ASSIGNP_INNER( ptr, ft_mem_reallocdebug( memory, (itmsz), \
+ (oldcnt), (newcnt), \
+ (ptr), __FILE__, __LINE__, &error ) )
+
+#define FT_MEM_QALLOC_MULT( ptr, count, item_size ) \
+ FT_ASSIGNP_INNER( ptr, ft_mem_qreallocdebug( memory, (item_size), \
+ 0, (count), \
+ NULL, __FILE__, __LINE__, &error ) )
+
+#define FT_MEM_QREALLOC_MULT( ptr, oldcnt, newcnt, itmsz) \
+ FT_ASSIGNP_INNER( ptr, ft_mem_qreallocdebug( memory, (itmsz), \
+ (oldcnt), (newcnt), \
+ (ptr), __FILE__, __LINE__, &error ) )
+ /*************************************************************************/
+ /* */
+ /* The following functions macros expect that their pointer argument is */
+ /* _typed_ in order to automatically compute array element sizes. */
+ /* */
+
+#define FT_MEM_NEW_ARRAY( ptr, count ) \
+ FT_ASSIGNP_INNER( ptr, ft_mem_reallocdebug( memory, sizeof ( *(ptr) ), \
+ 0, (count), \
+ NULL, __FILE__, __LINE__, &error ) )
+
+#define FT_MEM_RENEW_ARRAY( ptr, cursz, newsz ) \
+ FT_ASSIGNP_INNER( ptr, ft_mem_reallocdebug( memory, sizeof ( *(ptr) ), \
+ (cursz), (newsz), \
(ptr), __FILE__, __LINE__, &error ) )
-#define FT_MEM_QALLOC_MULT( ptr, count, item_size ) \
- FT_ASSIGNP_INNER( ptr, ft_mem_qreallocdebug( memory, (item_size), \
- 0, (count), \
- NULL, __FILE__, __LINE__, &error ) )
-
-#define FT_MEM_QREALLOC_MULT( ptr, oldcnt, newcnt, itmsz) \
- FT_ASSIGNP_INNER( ptr, ft_mem_qreallocdebug( memory, (itmsz), \
- (oldcnt), (newcnt), \
- (ptr), __FILE__, __LINE__, &error ) )
- /*************************************************************************/
- /* */
- /* The following functions macros expect that their pointer argument is */
- /* _typed_ in order to automatically compute array element sizes. */
- /* */
-
-#define FT_MEM_NEW_ARRAY( ptr, count ) \
- FT_ASSIGNP_INNER( ptr, ft_mem_reallocdebug( memory, sizeof ( *(ptr) ), \
- 0, (count), \
- NULL, __FILE__, __LINE__, &error ) )
-
-#define FT_MEM_RENEW_ARRAY( ptr, cursz, newsz ) \
- FT_ASSIGNP_INNER( ptr, ft_mem_reallocdebug( memory, sizeof ( *(ptr) ), \
- (cursz), (newsz), \
- (ptr), __FILE__, __LINE__, &error ) )
-
-#define FT_MEM_QNEW_ARRAY( ptr, count ) \
- FT_ASSIGNP_INNER( ptr, ft_mem_qreallocdebug( memory, sizeof ( *(ptr) ), \
- 0, (count), \
- NULL, __FILE__, __LINE__, &error ) )
-
-#define FT_MEM_QRENEW_ARRAY( ptr, cursz, newsz ) \
- FT_ASSIGNP_INNER( ptr, ft_mem_qreallocdebug( memory, sizeof ( *(ptr) ), \
- (cursz), (newsz), \
- (ptr), __FILE__, __LINE__, &error ) )
-
-#endif
-
-#define FT_MEM_NEW( ptr ) \
- FT_MEM_ALLOC( ptr, sizeof ( *(ptr) ) )
-
-#define FT_MEM_QNEW( ptr ) \
+#define FT_MEM_QNEW_ARRAY( ptr, count ) \
+ FT_ASSIGNP_INNER( ptr, ft_mem_qreallocdebug( memory, sizeof ( *(ptr) ), \
+ 0, (count), \
+ NULL, __FILE__, __LINE__, &error ) )
+
+#define FT_MEM_QRENEW_ARRAY( ptr, cursz, newsz ) \
+ FT_ASSIGNP_INNER( ptr, ft_mem_qreallocdebug( memory, sizeof ( *(ptr) ), \
+ (cursz), (newsz), \
+ (ptr), __FILE__, __LINE__, &error ) )
+
+#endif
+
+#define FT_MEM_NEW( ptr ) \
+ FT_MEM_ALLOC( ptr, sizeof ( *(ptr) ) )
+
+#define FT_MEM_QNEW( ptr ) \
FT_MEM_QALLOC( ptr, sizeof ( *(ptr) ) )
#define FT_MEM_SET_ERROR( cond ) ( (cond), error != 0 )
diff --git a/core/include/thirdparties/freetype/ft2build.h b/core/include/thirdparties/freetype/ft2build.h
index 134007d86f..1fc812153f 100644
--- a/core/include/thirdparties/freetype/ft2build.h
+++ b/core/include/thirdparties/freetype/ft2build.h
@@ -31,7 +31,7 @@
#ifndef __FT2_BUILD_GENERIC_H__
#define __FT2_BUILD_GENERIC_H__
-#include "foxitnames.h"
+#include "foxitnames.h"
#include "freetype/config/ftheader.h"
#endif /* __FT2_BUILD_GENERIC_H__ */
diff --git a/core/include/thirdparties/libjpeg/jconfig.h b/core/include/thirdparties/libjpeg/jconfig.h
index 2f4da14c54..7e291c75bd 100644
--- a/core/include/thirdparties/libjpeg/jconfig.h
+++ b/core/include/thirdparties/libjpeg/jconfig.h
@@ -1,45 +1,45 @@
-/* jconfig.vc --- jconfig.h for Microsoft Visual C++ on Windows 95 or NT. */
-/* see jconfig.doc for explanations */
-
-#define HAVE_PROTOTYPES
-#define HAVE_UNSIGNED_CHAR
-#define HAVE_UNSIGNED_SHORT
-/* #define void char */
-/* #define const */
-#undef CHAR_IS_UNSIGNED
-#define HAVE_STDDEF_H
-#define HAVE_STDLIB_H
-#undef NEED_BSD_STRINGS
-#undef NEED_SYS_TYPES_H
-#undef NEED_FAR_POINTERS /* we presume a 32-bit flat memory model */
-#undef NEED_SHORT_EXTERNAL_NAMES
-#undef INCOMPLETE_TYPES_BROKEN
-
-/* Define "boolean" as unsigned char, not int, per Windows custom */
-#ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */
-typedef unsigned char boolean;
-#endif
-#define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */
-
-
-#ifdef JPEG_INTERNALS
-
-#undef RIGHT_SHIFT_IS_UNSIGNED
-
-#endif /* JPEG_INTERNALS */
-
-#ifdef JPEG_CJPEG_DJPEG
-
-#define BMP_SUPPORTED /* BMP image file format */
-#define GIF_SUPPORTED /* GIF image file format */
-#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */
-#undef RLE_SUPPORTED /* Utah RLE image file format */
-#define TARGA_SUPPORTED /* Targa image file format */
-
-#define TWO_FILE_COMMANDLINE /* optional */
-#define USE_SETMODE /* Microsoft has setmode() */
-#undef NEED_SIGNAL_CATCHER
-#undef DONT_USE_B_MODE
-#undef PROGRESS_REPORT /* optional */
-
-#endif /* JPEG_CJPEG_DJPEG */
+/* jconfig.vc --- jconfig.h for Microsoft Visual C++ on Windows 95 or NT. */
+/* see jconfig.doc for explanations */
+
+#define HAVE_PROTOTYPES
+#define HAVE_UNSIGNED_CHAR
+#define HAVE_UNSIGNED_SHORT
+/* #define void char */
+/* #define const */
+#undef CHAR_IS_UNSIGNED
+#define HAVE_STDDEF_H
+#define HAVE_STDLIB_H
+#undef NEED_BSD_STRINGS
+#undef NEED_SYS_TYPES_H
+#undef NEED_FAR_POINTERS /* we presume a 32-bit flat memory model */
+#undef NEED_SHORT_EXTERNAL_NAMES
+#undef INCOMPLETE_TYPES_BROKEN
+
+/* Define "boolean" as unsigned char, not int, per Windows custom */
+#ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */
+typedef unsigned char boolean;
+#endif
+#define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */
+
+
+#ifdef JPEG_INTERNALS
+
+#undef RIGHT_SHIFT_IS_UNSIGNED
+
+#endif /* JPEG_INTERNALS */
+
+#ifdef JPEG_CJPEG_DJPEG
+
+#define BMP_SUPPORTED /* BMP image file format */
+#define GIF_SUPPORTED /* GIF image file format */
+#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */
+#undef RLE_SUPPORTED /* Utah RLE image file format */
+#define TARGA_SUPPORTED /* Targa image file format */
+
+#define TWO_FILE_COMMANDLINE /* optional */
+#define USE_SETMODE /* Microsoft has setmode() */
+#undef NEED_SIGNAL_CATCHER
+#undef DONT_USE_B_MODE
+#undef PROGRESS_REPORT /* optional */
+
+#endif /* JPEG_CJPEG_DJPEG */
diff --git a/core/include/thirdparties/libjpeg/jerror.h b/core/include/thirdparties/libjpeg/jerror.h
index a2b8f96f8f..06d344067a 100644
--- a/core/include/thirdparties/libjpeg/jerror.h
+++ b/core/include/thirdparties/libjpeg/jerror.h
@@ -1,291 +1,291 @@
-/*
- * jerror.h
- *
- * Copyright (C) 1994-1997, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- * For conditions of distribution and use, see the accompanying README file.
- *
- * This file defines the error and message codes for the JPEG library.
- * Edit this file to add new codes, or to translate the message strings to
- * some other language.
- * A set of error-reporting macros are defined too. Some applications using
- * the JPEG library may wish to include this file to get the error codes
- * and/or the macros.
- */
-
-/*
- * To define the enum list of message codes, include this file without
- * defining macro JMESSAGE. To create a message string table, include it
- * again with a suitable JMESSAGE definition (see jerror.c for an example).
- */
-#ifndef JMESSAGE
-#ifndef JERROR_H
-/* First time through, define the enum list */
-#define JMAKE_ENUM_LIST
-#else
-/* Repeated inclusions of this file are no-ops unless JMESSAGE is defined */
-#define JMESSAGE(code,string)
-#endif /* JERROR_H */
-#endif /* JMESSAGE */
-
-#ifdef JMAKE_ENUM_LIST
-
-typedef enum {
-
-#define JMESSAGE(code,string) code ,
-
-#endif /* JMAKE_ENUM_LIST */
-
-JMESSAGE(JMSG_NOMESSAGE, "Bogus message code %d") /* Must be first entry! */
-
-/* For maintenance convenience, list is alphabetical by message code name */
-JMESSAGE(JERR_ARITH_NOTIMPL,
- "Sorry, there are legal restrictions on arithmetic coding")
-JMESSAGE(JERR_BAD_ALIGN_TYPE, "ALIGN_TYPE is wrong, please fix")
-JMESSAGE(JERR_BAD_ALLOC_CHUNK, "MAX_ALLOC_CHUNK is wrong, please fix")
-JMESSAGE(JERR_BAD_BUFFER_MODE, "Bogus buffer control mode")
-JMESSAGE(JERR_BAD_COMPONENT_ID, "Invalid component ID %d in SOS")
-JMESSAGE(JERR_BAD_DCT_COEF, "DCT coefficient out of range")
-JMESSAGE(JERR_BAD_DCTSIZE, "IDCT output block size %d not supported")
-JMESSAGE(JERR_BAD_HUFF_TABLE, "Bogus Huffman table definition")
-JMESSAGE(JERR_BAD_IN_COLORSPACE, "Bogus input colorspace")
-JMESSAGE(JERR_BAD_J_COLORSPACE, "Bogus JPEG colorspace")
-JMESSAGE(JERR_BAD_LENGTH, "Bogus marker length")
-JMESSAGE(JERR_BAD_LIB_VERSION,
- "Wrong JPEG library version: library is %d, caller expects %d")
-JMESSAGE(JERR_BAD_MCU_SIZE, "Sampling factors too large for interleaved scan")
-JMESSAGE(JERR_BAD_POOL_ID, "Invalid memory pool code %d")
-JMESSAGE(JERR_BAD_PRECISION, "Unsupported JPEG data precision %d")
-JMESSAGE(JERR_BAD_PROGRESSION,
- "Invalid progressive parameters Ss=%d Se=%d Ah=%d Al=%d")
-JMESSAGE(JERR_BAD_PROG_SCRIPT,
- "Invalid progressive parameters at scan script entry %d")
-JMESSAGE(JERR_BAD_SAMPLING, "Bogus sampling factors")
-JMESSAGE(JERR_BAD_SCAN_SCRIPT, "Invalid scan script at entry %d")
-JMESSAGE(JERR_BAD_STATE, "Improper call to JPEG library in state %d")
-JMESSAGE(JERR_BAD_STRUCT_SIZE,
- "JPEG parameter struct mismatch: library thinks size is %u, caller expects %u")
-JMESSAGE(JERR_BAD_VIRTUAL_ACCESS, "Bogus virtual array access")
-JMESSAGE(JERR_BUFFER_SIZE, "Buffer passed to JPEG library is too small")
-JMESSAGE(JERR_CANT_SUSPEND, "Suspension not allowed here")
-JMESSAGE(JERR_CCIR601_NOTIMPL, "CCIR601 sampling not implemented yet")
-JMESSAGE(JERR_COMPONENT_COUNT, "Too many color components: %d, max %d")
-JMESSAGE(JERR_CONVERSION_NOTIMPL, "Unsupported color conversion request")
-JMESSAGE(JERR_DAC_INDEX, "Bogus DAC index %d")
-JMESSAGE(JERR_DAC_VALUE, "Bogus DAC value 0x%x")
-JMESSAGE(JERR_DHT_INDEX, "Bogus DHT index %d")
-JMESSAGE(JERR_DQT_INDEX, "Bogus DQT index %d")
-JMESSAGE(JERR_EMPTY_IMAGE, "Empty JPEG image (DNL not supported)")
-JMESSAGE(JERR_EMS_READ, "Read from EMS failed")
-JMESSAGE(JERR_EMS_WRITE, "Write to EMS failed")
-JMESSAGE(JERR_EOI_EXPECTED, "Didn't expect more than one scan")
-JMESSAGE(JERR_FILE_READ, "Input file read error")
-JMESSAGE(JERR_FILE_WRITE, "Output file write error --- out of disk space?")
-JMESSAGE(JERR_FRACT_SAMPLE_NOTIMPL, "Fractional sampling not implemented yet")
-JMESSAGE(JERR_HUFF_CLEN_OVERFLOW, "Huffman code size table overflow")
-JMESSAGE(JERR_HUFF_MISSING_CODE, "Missing Huffman code table entry")
-JMESSAGE(JERR_IMAGE_TOO_BIG, "Maximum supported image dimension is %u pixels")
-JMESSAGE(JERR_INPUT_EMPTY, "Empty input file")
-JMESSAGE(JERR_INPUT_EOF, "Premature end of input file")
-JMESSAGE(JERR_MISMATCHED_QUANT_TABLE,
- "Cannot transcode due to multiple use of quantization table %d")
-JMESSAGE(JERR_MISSING_DATA, "Scan script does not transmit all data")
-JMESSAGE(JERR_MODE_CHANGE, "Invalid color quantization mode change")
-JMESSAGE(JERR_NOTIMPL, "Not implemented yet")
-JMESSAGE(JERR_NOT_COMPILED, "Requested feature was omitted at compile time")
-JMESSAGE(JERR_NO_BACKING_STORE, "Backing store not supported")
-JMESSAGE(JERR_NO_HUFF_TABLE, "Huffman table 0x%02x was not defined")
-JMESSAGE(JERR_NO_IMAGE, "JPEG datastream contains no image")
-JMESSAGE(JERR_NO_QUANT_TABLE, "Quantization table 0x%02x was not defined")
-JMESSAGE(JERR_NO_SOI, "Not a JPEG file: starts with 0x%02x 0x%02x")
-JMESSAGE(JERR_OUT_OF_MEMORY, "Insufficient memory (case %d)")
-JMESSAGE(JERR_QUANT_COMPONENTS,
- "Cannot quantize more than %d color components")
-JMESSAGE(JERR_QUANT_FEW_COLORS, "Cannot quantize to fewer than %d colors")
-JMESSAGE(JERR_QUANT_MANY_COLORS, "Cannot quantize to more than %d colors")
-JMESSAGE(JERR_SOF_DUPLICATE, "Invalid JPEG file structure: two SOF markers")
-JMESSAGE(JERR_SOF_NO_SOS, "Invalid JPEG file structure: missing SOS marker")
-JMESSAGE(JERR_SOF_UNSUPPORTED, "Unsupported JPEG process: SOF type 0x%02x")
-JMESSAGE(JERR_SOI_DUPLICATE, "Invalid JPEG file structure: two SOI markers")
-JMESSAGE(JERR_SOS_NO_SOF, "Invalid JPEG file structure: SOS before SOF")
-JMESSAGE(JERR_TFILE_CREATE, "Failed to create temporary file %s")
-JMESSAGE(JERR_TFILE_READ, "Read failed on temporary file")
-JMESSAGE(JERR_TFILE_SEEK, "Seek failed on temporary file")
-JMESSAGE(JERR_TFILE_WRITE,
- "Write failed on temporary file --- out of disk space?")
-JMESSAGE(JERR_TOO_LITTLE_DATA, "Application transferred too few scanlines")
-JMESSAGE(JERR_UNKNOWN_MARKER, "Unsupported marker type 0x%02x")
-JMESSAGE(JERR_VIRTUAL_BUG, "Virtual array controller messed up")
-JMESSAGE(JERR_WIDTH_OVERFLOW, "Image too wide for this implementation")
-JMESSAGE(JERR_XMS_READ, "Read from XMS failed")
-JMESSAGE(JERR_XMS_WRITE, "Write to XMS failed")
-JMESSAGE(JMSG_COPYRIGHT, JCOPYRIGHT)
-JMESSAGE(JMSG_VERSION, JVERSION)
-JMESSAGE(JTRC_16BIT_TABLES,
- "Caution: quantization tables are too coarse for baseline JPEG")
-JMESSAGE(JTRC_ADOBE,
- "Adobe APP14 marker: version %d, flags 0x%04x 0x%04x, transform %d")
-JMESSAGE(JTRC_APP0, "Unknown APP0 marker (not JFIF), length %u")
-JMESSAGE(JTRC_APP14, "Unknown APP14 marker (not Adobe), length %u")
-JMESSAGE(JTRC_DAC, "Define Arithmetic Table 0x%02x: 0x%02x")
-JMESSAGE(JTRC_DHT, "Define Huffman Table 0x%02x")
-JMESSAGE(JTRC_DQT, "Define Quantization Table %d precision %d")
-JMESSAGE(JTRC_DRI, "Define Restart Interval %u")
-JMESSAGE(JTRC_EMS_CLOSE, "Freed EMS handle %u")
-JMESSAGE(JTRC_EMS_OPEN, "Obtained EMS handle %u")
-JMESSAGE(JTRC_EOI, "End Of Image")
-JMESSAGE(JTRC_HUFFBITS, " %3d %3d %3d %3d %3d %3d %3d %3d")
-JMESSAGE(JTRC_JFIF, "JFIF APP0 marker: version %d.%02d, density %dx%d %d")
-JMESSAGE(JTRC_JFIF_BADTHUMBNAILSIZE,
- "Warning: thumbnail image size does not match data length %u")
-JMESSAGE(JTRC_JFIF_EXTENSION,
- "JFIF extension marker: type 0x%02x, length %u")
-JMESSAGE(JTRC_JFIF_THUMBNAIL, " with %d x %d thumbnail image")
-JMESSAGE(JTRC_MISC_MARKER, "Miscellaneous marker 0x%02x, length %u")
-JMESSAGE(JTRC_PARMLESS_MARKER, "Unexpected marker 0x%02x")
-JMESSAGE(JTRC_QUANTVALS, " %4u %4u %4u %4u %4u %4u %4u %4u")
-JMESSAGE(JTRC_QUANT_3_NCOLORS, "Quantizing to %d = %d*%d*%d colors")
-JMESSAGE(JTRC_QUANT_NCOLORS, "Quantizing to %d colors")
-JMESSAGE(JTRC_QUANT_SELECTED, "Selected %d colors for quantization")
-JMESSAGE(JTRC_RECOVERY_ACTION, "At marker 0x%02x, recovery action %d")
-JMESSAGE(JTRC_RST, "RST%d")
-JMESSAGE(JTRC_SMOOTH_NOTIMPL,
- "Smoothing not supported with nonstandard sampling ratios")
-JMESSAGE(JTRC_SOF, "Start Of Frame 0x%02x: width=%u, height=%u, components=%d")
-JMESSAGE(JTRC_SOF_COMPONENT, " Component %d: %dhx%dv q=%d")
-JMESSAGE(JTRC_SOI, "Start of Image")
-JMESSAGE(JTRC_SOS, "Start Of Scan: %d components")
-JMESSAGE(JTRC_SOS_COMPONENT, " Component %d: dc=%d ac=%d")
-JMESSAGE(JTRC_SOS_PARAMS, " Ss=%d, Se=%d, Ah=%d, Al=%d")
-JMESSAGE(JTRC_TFILE_CLOSE, "Closed temporary file %s")
-JMESSAGE(JTRC_TFILE_OPEN, "Opened temporary file %s")
-JMESSAGE(JTRC_THUMB_JPEG,
- "JFIF extension marker: JPEG-compressed thumbnail image, length %u")
-JMESSAGE(JTRC_THUMB_PALETTE,
- "JFIF extension marker: palette thumbnail image, length %u")
-JMESSAGE(JTRC_THUMB_RGB,
- "JFIF extension marker: RGB thumbnail image, length %u")
-JMESSAGE(JTRC_UNKNOWN_IDS,
- "Unrecognized component IDs %d %d %d, assuming YCbCr")
-JMESSAGE(JTRC_XMS_CLOSE, "Freed XMS handle %u")
-JMESSAGE(JTRC_XMS_OPEN, "Obtained XMS handle %u")
-JMESSAGE(JWRN_ADOBE_XFORM, "Unknown Adobe color transform code %d")
-JMESSAGE(JWRN_BOGUS_PROGRESSION,
- "Inconsistent progression sequence for component %d coefficient %d")
-JMESSAGE(JWRN_EXTRANEOUS_DATA,
- "Corrupt JPEG data: %u extraneous bytes before marker 0x%02x")
-JMESSAGE(JWRN_HIT_MARKER, "Corrupt JPEG data: premature end of data segment")
-JMESSAGE(JWRN_HUFF_BAD_CODE, "Corrupt JPEG data: bad Huffman code")
-JMESSAGE(JWRN_JFIF_MAJOR, "Warning: unknown JFIF revision number %d.%02d")
-JMESSAGE(JWRN_JPEG_EOF, "Premature end of JPEG file")
-JMESSAGE(JWRN_MUST_RESYNC,
- "Corrupt JPEG data: found marker 0x%02x instead of RST%d")
-JMESSAGE(JWRN_NOT_SEQUENTIAL, "Invalid SOS parameters for sequential JPEG")
-JMESSAGE(JWRN_TOO_MUCH_DATA, "Application transferred too many scanlines")
-
-#ifdef JMAKE_ENUM_LIST
-
- JMSG_LASTMSGCODE
-} J_MESSAGE_CODE;
-
-#undef JMAKE_ENUM_LIST
-#endif /* JMAKE_ENUM_LIST */
-
-/* Zap JMESSAGE macro so that future re-inclusions do nothing by default */
-#undef JMESSAGE
-
-
-#ifndef JERROR_H
-#define JERROR_H
-
-/* Macros to simplify using the error and trace message stuff */
-/* The first parameter is either type of cinfo pointer */
-
-/* Fatal errors (print message and exit) */
-#define ERREXIT(cinfo,code) \
- ((cinfo)->err->msg_code = (code), \
- (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
-#define ERREXIT1(cinfo,code,p1) \
- ((cinfo)->err->msg_code = (code), \
- (cinfo)->err->msg_parm.i[0] = (p1), \
- (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
-#define ERREXIT2(cinfo,code,p1,p2) \
- ((cinfo)->err->msg_code = (code), \
- (cinfo)->err->msg_parm.i[0] = (p1), \
- (cinfo)->err->msg_parm.i[1] = (p2), \
- (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
-#define ERREXIT3(cinfo,code,p1,p2,p3) \
- ((cinfo)->err->msg_code = (code), \
- (cinfo)->err->msg_parm.i[0] = (p1), \
- (cinfo)->err->msg_parm.i[1] = (p2), \
- (cinfo)->err->msg_parm.i[2] = (p3), \
- (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
-#define ERREXIT4(cinfo,code,p1,p2,p3,p4) \
- ((cinfo)->err->msg_code = (code), \
- (cinfo)->err->msg_parm.i[0] = (p1), \
- (cinfo)->err->msg_parm.i[1] = (p2), \
- (cinfo)->err->msg_parm.i[2] = (p3), \
- (cinfo)->err->msg_parm.i[3] = (p4), \
- (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
-#define ERREXITS(cinfo,code,str) \
- ((cinfo)->err->msg_code = (code), \
- FXSYS_strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \
- (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
-
-#define MAKESTMT(stuff) do { stuff } while (0)
-
-/* Nonfatal errors (we can keep going, but the data is probably corrupt) */
-#define WARNMS(cinfo,code) \
- ((cinfo)->err->msg_code = (code), \
- (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1))
-#define WARNMS1(cinfo,code,p1) \
- ((cinfo)->err->msg_code = (code), \
- (cinfo)->err->msg_parm.i[0] = (p1), \
- (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1))
-#define WARNMS2(cinfo,code,p1,p2) \
- ((cinfo)->err->msg_code = (code), \
- (cinfo)->err->msg_parm.i[0] = (p1), \
- (cinfo)->err->msg_parm.i[1] = (p2), \
- (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1))
-
-/* Informational/debugging messages */
-#define TRACEMS(cinfo,lvl,code) \
- ((cinfo)->err->msg_code = (code), \
- (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))
-#define TRACEMS1(cinfo,lvl,code,p1) \
- ((cinfo)->err->msg_code = (code), \
- (cinfo)->err->msg_parm.i[0] = (p1), \
- (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))
-#define TRACEMS2(cinfo,lvl,code,p1,p2) \
- ((cinfo)->err->msg_code = (code), \
- (cinfo)->err->msg_parm.i[0] = (p1), \
- (cinfo)->err->msg_parm.i[1] = (p2), \
- (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))
-#define TRACEMS3(cinfo,lvl,code,p1,p2,p3) \
- MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \
- _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); \
- (cinfo)->err->msg_code = (code); \
- (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )
-#define TRACEMS4(cinfo,lvl,code,p1,p2,p3,p4) \
- MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \
- _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \
- (cinfo)->err->msg_code = (code); \
- (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )
-#define TRACEMS5(cinfo,lvl,code,p1,p2,p3,p4,p5) \
- MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \
- _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \
- _mp[4] = (p5); \
- (cinfo)->err->msg_code = (code); \
- (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )
-#define TRACEMS8(cinfo,lvl,code,p1,p2,p3,p4,p5,p6,p7,p8) \
- MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \
- _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \
- _mp[4] = (p5); _mp[5] = (p6); _mp[6] = (p7); _mp[7] = (p8); \
- (cinfo)->err->msg_code = (code); \
- (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )
-#define TRACEMSS(cinfo,lvl,code,str) \
- ((cinfo)->err->msg_code = (code), \
- FXSYS_strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \
- (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))
-
-#endif /* JERROR_H */
+/*
+ * jerror.h
+ *
+ * Copyright (C) 1994-1997, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file defines the error and message codes for the JPEG library.
+ * Edit this file to add new codes, or to translate the message strings to
+ * some other language.
+ * A set of error-reporting macros are defined too. Some applications using
+ * the JPEG library may wish to include this file to get the error codes
+ * and/or the macros.
+ */
+
+/*
+ * To define the enum list of message codes, include this file without
+ * defining macro JMESSAGE. To create a message string table, include it
+ * again with a suitable JMESSAGE definition (see jerror.c for an example).
+ */
+#ifndef JMESSAGE
+#ifndef JERROR_H
+/* First time through, define the enum list */
+#define JMAKE_ENUM_LIST
+#else
+/* Repeated inclusions of this file are no-ops unless JMESSAGE is defined */
+#define JMESSAGE(code,string)
+#endif /* JERROR_H */
+#endif /* JMESSAGE */
+
+#ifdef JMAKE_ENUM_LIST
+
+typedef enum {
+
+#define JMESSAGE(code,string) code ,
+
+#endif /* JMAKE_ENUM_LIST */
+
+JMESSAGE(JMSG_NOMESSAGE, "Bogus message code %d") /* Must be first entry! */
+
+/* For maintenance convenience, list is alphabetical by message code name */
+JMESSAGE(JERR_ARITH_NOTIMPL,
+ "Sorry, there are legal restrictions on arithmetic coding")
+JMESSAGE(JERR_BAD_ALIGN_TYPE, "ALIGN_TYPE is wrong, please fix")
+JMESSAGE(JERR_BAD_ALLOC_CHUNK, "MAX_ALLOC_CHUNK is wrong, please fix")
+JMESSAGE(JERR_BAD_BUFFER_MODE, "Bogus buffer control mode")
+JMESSAGE(JERR_BAD_COMPONENT_ID, "Invalid component ID %d in SOS")
+JMESSAGE(JERR_BAD_DCT_COEF, "DCT coefficient out of range")
+JMESSAGE(JERR_BAD_DCTSIZE, "IDCT output block size %d not supported")
+JMESSAGE(JERR_BAD_HUFF_TABLE, "Bogus Huffman table definition")
+JMESSAGE(JERR_BAD_IN_COLORSPACE, "Bogus input colorspace")
+JMESSAGE(JERR_BAD_J_COLORSPACE, "Bogus JPEG colorspace")
+JMESSAGE(JERR_BAD_LENGTH, "Bogus marker length")
+JMESSAGE(JERR_BAD_LIB_VERSION,
+ "Wrong JPEG library version: library is %d, caller expects %d")
+JMESSAGE(JERR_BAD_MCU_SIZE, "Sampling factors too large for interleaved scan")
+JMESSAGE(JERR_BAD_POOL_ID, "Invalid memory pool code %d")
+JMESSAGE(JERR_BAD_PRECISION, "Unsupported JPEG data precision %d")
+JMESSAGE(JERR_BAD_PROGRESSION,
+ "Invalid progressive parameters Ss=%d Se=%d Ah=%d Al=%d")
+JMESSAGE(JERR_BAD_PROG_SCRIPT,
+ "Invalid progressive parameters at scan script entry %d")
+JMESSAGE(JERR_BAD_SAMPLING, "Bogus sampling factors")
+JMESSAGE(JERR_BAD_SCAN_SCRIPT, "Invalid scan script at entry %d")
+JMESSAGE(JERR_BAD_STATE, "Improper call to JPEG library in state %d")
+JMESSAGE(JERR_BAD_STRUCT_SIZE,
+ "JPEG parameter struct mismatch: library thinks size is %u, caller expects %u")
+JMESSAGE(JERR_BAD_VIRTUAL_ACCESS, "Bogus virtual array access")
+JMESSAGE(JERR_BUFFER_SIZE, "Buffer passed to JPEG library is too small")
+JMESSAGE(JERR_CANT_SUSPEND, "Suspension not allowed here")
+JMESSAGE(JERR_CCIR601_NOTIMPL, "CCIR601 sampling not implemented yet")
+JMESSAGE(JERR_COMPONENT_COUNT, "Too many color components: %d, max %d")
+JMESSAGE(JERR_CONVERSION_NOTIMPL, "Unsupported color conversion request")
+JMESSAGE(JERR_DAC_INDEX, "Bogus DAC index %d")
+JMESSAGE(JERR_DAC_VALUE, "Bogus DAC value 0x%x")
+JMESSAGE(JERR_DHT_INDEX, "Bogus DHT index %d")
+JMESSAGE(JERR_DQT_INDEX, "Bogus DQT index %d")
+JMESSAGE(JERR_EMPTY_IMAGE, "Empty JPEG image (DNL not supported)")
+JMESSAGE(JERR_EMS_READ, "Read from EMS failed")
+JMESSAGE(JERR_EMS_WRITE, "Write to EMS failed")
+JMESSAGE(JERR_EOI_EXPECTED, "Didn't expect more than one scan")
+JMESSAGE(JERR_FILE_READ, "Input file read error")
+JMESSAGE(JERR_FILE_WRITE, "Output file write error --- out of disk space?")
+JMESSAGE(JERR_FRACT_SAMPLE_NOTIMPL, "Fractional sampling not implemented yet")
+JMESSAGE(JERR_HUFF_CLEN_OVERFLOW, "Huffman code size table overflow")
+JMESSAGE(JERR_HUFF_MISSING_CODE, "Missing Huffman code table entry")
+JMESSAGE(JERR_IMAGE_TOO_BIG, "Maximum supported image dimension is %u pixels")
+JMESSAGE(JERR_INPUT_EMPTY, "Empty input file")
+JMESSAGE(JERR_INPUT_EOF, "Premature end of input file")
+JMESSAGE(JERR_MISMATCHED_QUANT_TABLE,
+ "Cannot transcode due to multiple use of quantization table %d")
+JMESSAGE(JERR_MISSING_DATA, "Scan script does not transmit all data")
+JMESSAGE(JERR_MODE_CHANGE, "Invalid color quantization mode change")
+JMESSAGE(JERR_NOTIMPL, "Not implemented yet")
+JMESSAGE(JERR_NOT_COMPILED, "Requested feature was omitted at compile time")
+JMESSAGE(JERR_NO_BACKING_STORE, "Backing store not supported")
+JMESSAGE(JERR_NO_HUFF_TABLE, "Huffman table 0x%02x was not defined")
+JMESSAGE(JERR_NO_IMAGE, "JPEG datastream contains no image")
+JMESSAGE(JERR_NO_QUANT_TABLE, "Quantization table 0x%02x was not defined")
+JMESSAGE(JERR_NO_SOI, "Not a JPEG file: starts with 0x%02x 0x%02x")
+JMESSAGE(JERR_OUT_OF_MEMORY, "Insufficient memory (case %d)")
+JMESSAGE(JERR_QUANT_COMPONENTS,
+ "Cannot quantize more than %d color components")
+JMESSAGE(JERR_QUANT_FEW_COLORS, "Cannot quantize to fewer than %d colors")
+JMESSAGE(JERR_QUANT_MANY_COLORS, "Cannot quantize to more than %d colors")
+JMESSAGE(JERR_SOF_DUPLICATE, "Invalid JPEG file structure: two SOF markers")
+JMESSAGE(JERR_SOF_NO_SOS, "Invalid JPEG file structure: missing SOS marker")
+JMESSAGE(JERR_SOF_UNSUPPORTED, "Unsupported JPEG process: SOF type 0x%02x")
+JMESSAGE(JERR_SOI_DUPLICATE, "Invalid JPEG file structure: two SOI markers")
+JMESSAGE(JERR_SOS_NO_SOF, "Invalid JPEG file structure: SOS before SOF")
+JMESSAGE(JERR_TFILE_CREATE, "Failed to create temporary file %s")
+JMESSAGE(JERR_TFILE_READ, "Read failed on temporary file")
+JMESSAGE(JERR_TFILE_SEEK, "Seek failed on temporary file")
+JMESSAGE(JERR_TFILE_WRITE,
+ "Write failed on temporary file --- out of disk space?")
+JMESSAGE(JERR_TOO_LITTLE_DATA, "Application transferred too few scanlines")
+JMESSAGE(JERR_UNKNOWN_MARKER, "Unsupported marker type 0x%02x")
+JMESSAGE(JERR_VIRTUAL_BUG, "Virtual array controller messed up")
+JMESSAGE(JERR_WIDTH_OVERFLOW, "Image too wide for this implementation")
+JMESSAGE(JERR_XMS_READ, "Read from XMS failed")
+JMESSAGE(JERR_XMS_WRITE, "Write to XMS failed")
+JMESSAGE(JMSG_COPYRIGHT, JCOPYRIGHT)
+JMESSAGE(JMSG_VERSION, JVERSION)
+JMESSAGE(JTRC_16BIT_TABLES,
+ "Caution: quantization tables are too coarse for baseline JPEG")
+JMESSAGE(JTRC_ADOBE,
+ "Adobe APP14 marker: version %d, flags 0x%04x 0x%04x, transform %d")
+JMESSAGE(JTRC_APP0, "Unknown APP0 marker (not JFIF), length %u")
+JMESSAGE(JTRC_APP14, "Unknown APP14 marker (not Adobe), length %u")
+JMESSAGE(JTRC_DAC, "Define Arithmetic Table 0x%02x: 0x%02x")
+JMESSAGE(JTRC_DHT, "Define Huffman Table 0x%02x")
+JMESSAGE(JTRC_DQT, "Define Quantization Table %d precision %d")
+JMESSAGE(JTRC_DRI, "Define Restart Interval %u")
+JMESSAGE(JTRC_EMS_CLOSE, "Freed EMS handle %u")
+JMESSAGE(JTRC_EMS_OPEN, "Obtained EMS handle %u")
+JMESSAGE(JTRC_EOI, "End Of Image")
+JMESSAGE(JTRC_HUFFBITS, " %3d %3d %3d %3d %3d %3d %3d %3d")
+JMESSAGE(JTRC_JFIF, "JFIF APP0 marker: version %d.%02d, density %dx%d %d")
+JMESSAGE(JTRC_JFIF_BADTHUMBNAILSIZE,
+ "Warning: thumbnail image size does not match data length %u")
+JMESSAGE(JTRC_JFIF_EXTENSION,
+ "JFIF extension marker: type 0x%02x, length %u")
+JMESSAGE(JTRC_JFIF_THUMBNAIL, " with %d x %d thumbnail image")
+JMESSAGE(JTRC_MISC_MARKER, "Miscellaneous marker 0x%02x, length %u")
+JMESSAGE(JTRC_PARMLESS_MARKER, "Unexpected marker 0x%02x")
+JMESSAGE(JTRC_QUANTVALS, " %4u %4u %4u %4u %4u %4u %4u %4u")
+JMESSAGE(JTRC_QUANT_3_NCOLORS, "Quantizing to %d = %d*%d*%d colors")
+JMESSAGE(JTRC_QUANT_NCOLORS, "Quantizing to %d colors")
+JMESSAGE(JTRC_QUANT_SELECTED, "Selected %d colors for quantization")
+JMESSAGE(JTRC_RECOVERY_ACTION, "At marker 0x%02x, recovery action %d")
+JMESSAGE(JTRC_RST, "RST%d")
+JMESSAGE(JTRC_SMOOTH_NOTIMPL,
+ "Smoothing not supported with nonstandard sampling ratios")
+JMESSAGE(JTRC_SOF, "Start Of Frame 0x%02x: width=%u, height=%u, components=%d")
+JMESSAGE(JTRC_SOF_COMPONENT, " Component %d: %dhx%dv q=%d")
+JMESSAGE(JTRC_SOI, "Start of Image")
+JMESSAGE(JTRC_SOS, "Start Of Scan: %d components")
+JMESSAGE(JTRC_SOS_COMPONENT, " Component %d: dc=%d ac=%d")
+JMESSAGE(JTRC_SOS_PARAMS, " Ss=%d, Se=%d, Ah=%d, Al=%d")
+JMESSAGE(JTRC_TFILE_CLOSE, "Closed temporary file %s")
+JMESSAGE(JTRC_TFILE_OPEN, "Opened temporary file %s")
+JMESSAGE(JTRC_THUMB_JPEG,
+ "JFIF extension marker: JPEG-compressed thumbnail image, length %u")
+JMESSAGE(JTRC_THUMB_PALETTE,
+ "JFIF extension marker: palette thumbnail image, length %u")
+JMESSAGE(JTRC_THUMB_RGB,
+ "JFIF extension marker: RGB thumbnail image, length %u")
+JMESSAGE(JTRC_UNKNOWN_IDS,
+ "Unrecognized component IDs %d %d %d, assuming YCbCr")
+JMESSAGE(JTRC_XMS_CLOSE, "Freed XMS handle %u")
+JMESSAGE(JTRC_XMS_OPEN, "Obtained XMS handle %u")
+JMESSAGE(JWRN_ADOBE_XFORM, "Unknown Adobe color transform code %d")
+JMESSAGE(JWRN_BOGUS_PROGRESSION,
+ "Inconsistent progression sequence for component %d coefficient %d")
+JMESSAGE(JWRN_EXTRANEOUS_DATA,
+ "Corrupt JPEG data: %u extraneous bytes before marker 0x%02x")
+JMESSAGE(JWRN_HIT_MARKER, "Corrupt JPEG data: premature end of data segment")
+JMESSAGE(JWRN_HUFF_BAD_CODE, "Corrupt JPEG data: bad Huffman code")
+JMESSAGE(JWRN_JFIF_MAJOR, "Warning: unknown JFIF revision number %d.%02d")
+JMESSAGE(JWRN_JPEG_EOF, "Premature end of JPEG file")
+JMESSAGE(JWRN_MUST_RESYNC,
+ "Corrupt JPEG data: found marker 0x%02x instead of RST%d")
+JMESSAGE(JWRN_NOT_SEQUENTIAL, "Invalid SOS parameters for sequential JPEG")
+JMESSAGE(JWRN_TOO_MUCH_DATA, "Application transferred too many scanlines")
+
+#ifdef JMAKE_ENUM_LIST
+
+ JMSG_LASTMSGCODE
+} J_MESSAGE_CODE;
+
+#undef JMAKE_ENUM_LIST
+#endif /* JMAKE_ENUM_LIST */
+
+/* Zap JMESSAGE macro so that future re-inclusions do nothing by default */
+#undef JMESSAGE
+
+
+#ifndef JERROR_H
+#define JERROR_H
+
+/* Macros to simplify using the error and trace message stuff */
+/* The first parameter is either type of cinfo pointer */
+
+/* Fatal errors (print message and exit) */
+#define ERREXIT(cinfo,code) \
+ ((cinfo)->err->msg_code = (code), \
+ (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
+#define ERREXIT1(cinfo,code,p1) \
+ ((cinfo)->err->msg_code = (code), \
+ (cinfo)->err->msg_parm.i[0] = (p1), \
+ (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
+#define ERREXIT2(cinfo,code,p1,p2) \
+ ((cinfo)->err->msg_code = (code), \
+ (cinfo)->err->msg_parm.i[0] = (p1), \
+ (cinfo)->err->msg_parm.i[1] = (p2), \
+ (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
+#define ERREXIT3(cinfo,code,p1,p2,p3) \
+ ((cinfo)->err->msg_code = (code), \
+ (cinfo)->err->msg_parm.i[0] = (p1), \
+ (cinfo)->err->msg_parm.i[1] = (p2), \
+ (cinfo)->err->msg_parm.i[2] = (p3), \
+ (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
+#define ERREXIT4(cinfo,code,p1,p2,p3,p4) \
+ ((cinfo)->err->msg_code = (code), \
+ (cinfo)->err->msg_parm.i[0] = (p1), \
+ (cinfo)->err->msg_parm.i[1] = (p2), \
+ (cinfo)->err->msg_parm.i[2] = (p3), \
+ (cinfo)->err->msg_parm.i[3] = (p4), \
+ (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
+#define ERREXITS(cinfo,code,str) \
+ ((cinfo)->err->msg_code = (code), \
+ FXSYS_strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \
+ (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
+
+#define MAKESTMT(stuff) do { stuff } while (0)
+
+/* Nonfatal errors (we can keep going, but the data is probably corrupt) */
+#define WARNMS(cinfo,code) \
+ ((cinfo)->err->msg_code = (code), \
+ (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1))
+#define WARNMS1(cinfo,code,p1) \
+ ((cinfo)->err->msg_code = (code), \
+ (cinfo)->err->msg_parm.i[0] = (p1), \
+ (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1))
+#define WARNMS2(cinfo,code,p1,p2) \
+ ((cinfo)->err->msg_code = (code), \
+ (cinfo)->err->msg_parm.i[0] = (p1), \
+ (cinfo)->err->msg_parm.i[1] = (p2), \
+ (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1))
+
+/* Informational/debugging messages */
+#define TRACEMS(cinfo,lvl,code) \
+ ((cinfo)->err->msg_code = (code), \
+ (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))
+#define TRACEMS1(cinfo,lvl,code,p1) \
+ ((cinfo)->err->msg_code = (code), \
+ (cinfo)->err->msg_parm.i[0] = (p1), \
+ (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))
+#define TRACEMS2(cinfo,lvl,code,p1,p2) \
+ ((cinfo)->err->msg_code = (code), \
+ (cinfo)->err->msg_parm.i[0] = (p1), \
+ (cinfo)->err->msg_parm.i[1] = (p2), \
+ (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))
+#define TRACEMS3(cinfo,lvl,code,p1,p2,p3) \
+ MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \
+ _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); \
+ (cinfo)->err->msg_code = (code); \
+ (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )
+#define TRACEMS4(cinfo,lvl,code,p1,p2,p3,p4) \
+ MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \
+ _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \
+ (cinfo)->err->msg_code = (code); \
+ (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )
+#define TRACEMS5(cinfo,lvl,code,p1,p2,p3,p4,p5) \
+ MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \
+ _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \
+ _mp[4] = (p5); \
+ (cinfo)->err->msg_code = (code); \
+ (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )
+#define TRACEMS8(cinfo,lvl,code,p1,p2,p3,p4,p5,p6,p7,p8) \
+ MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \
+ _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \
+ _mp[4] = (p5); _mp[5] = (p6); _mp[6] = (p7); _mp[7] = (p8); \
+ (cinfo)->err->msg_code = (code); \
+ (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )
+#define TRACEMSS(cinfo,lvl,code,str) \
+ ((cinfo)->err->msg_code = (code), \
+ FXSYS_strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \
+ (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))
+
+#endif /* JERROR_H */
diff --git a/core/include/thirdparties/libjpeg/jmorecfg.h b/core/include/thirdparties/libjpeg/jmorecfg.h
index 3602114a5c..88d210954c 100644
--- a/core/include/thirdparties/libjpeg/jmorecfg.h
+++ b/core/include/thirdparties/libjpeg/jmorecfg.h
@@ -1,376 +1,376 @@
-/*
- * jmorecfg.h
- *
- * Copyright (C) 1991-1997, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- * For conditions of distribution and use, see the accompanying README file.
- *
- * This file contains additional configuration options that customize the
- * JPEG software for special applications or support machine-dependent
- * optimizations. Most users will not need to touch this file.
- */
-
-#ifdef _MSC_VER
-#pragma warning (disable : 4142)
-#endif
-
-/*
- * Define BITS_IN_JSAMPLE as either
- * 8 for 8-bit sample values (the usual setting)
- * 12 for 12-bit sample values
- * Only 8 and 12 are legal data precisions for lossy JPEG according to the
- * JPEG standard, and the IJG code does not support anything else!
- * We do not support run-time selection of data precision, sorry.
- */
-
-#define BITS_IN_JSAMPLE 8 /* use 8 or 12 */
-
-
-/*
- * Maximum number of components (color channels) allowed in JPEG image.
- * To meet the letter of the JPEG spec, set this to 255. However, darn
- * few applications need more than 4 channels (maybe 5 for CMYK + alpha
- * mask). We recommend 10 as a reasonable compromise; use 4 if you are
- * really short on memory. (Each allowed component costs a hundred or so
- * bytes of storage, whether actually used in an image or not.)
- */
-
-#define MAX_COMPONENTS 10 /* maximum number of image components */
-
-
-/*
- * Basic data types.
- * You may need to change these if you have a machine with unusual data
- * type sizes; for example, "char" not 8 bits, "short" not 16 bits,
- * or "long" not 32 bits. We don't care whether "int" is 16 or 32 bits,
- * but it had better be at least 16.
- */
-
-/* Representation of a single sample (pixel element value).
- * We frequently allocate large arrays of these, so it's important to keep
- * them small. But if you have memory to burn and access to char or short
- * arrays is very slow on your hardware, you might want to change these.
- */
-
-#if BITS_IN_JSAMPLE == 8
-/* JSAMPLE should be the smallest type that will hold the values 0..255.
- * You can use a signed char by having GETJSAMPLE mask it with 0xFF.
- */
-
-#ifdef HAVE_UNSIGNED_CHAR
-
-typedef unsigned char JSAMPLE;
-#define GETJSAMPLE(value) ((int) (value))
-
-#else /* not HAVE_UNSIGNED_CHAR */
-
-typedef char JSAMPLE;
-#ifdef CHAR_IS_UNSIGNED
-#define GETJSAMPLE(value) ((int) (value))
-#else
-#define GETJSAMPLE(value) ((int) (value) & 0xFF)
-#endif /* CHAR_IS_UNSIGNED */
-
-#endif /* HAVE_UNSIGNED_CHAR */
-
-#define MAXJSAMPLE 255
-#define CENTERJSAMPLE 128
-
-#endif /* BITS_IN_JSAMPLE == 8 */
-
-
-#if BITS_IN_JSAMPLE == 12
-/* JSAMPLE should be the smallest type that will hold the values 0..4095.
- * On nearly all machines "short" will do nicely.
- */
-
-typedef short JSAMPLE;
-#define GETJSAMPLE(value) ((int) (value))
-
-#define MAXJSAMPLE 4095
-#define CENTERJSAMPLE 2048
-
-#endif /* BITS_IN_JSAMPLE == 12 */
-
-
-/* Representation of a DCT frequency coefficient.
- * This should be a signed value of at least 16 bits; "short" is usually OK.
- * Again, we allocate large arrays of these, but you can change to int
- * if you have memory to burn and "short" is really slow.
- */
-
-typedef short JCOEF;
-
-
-/* Compressed datastreams are represented as arrays of JOCTET.
- * These must be EXACTLY 8 bits wide, at least once they are written to
- * external storage. Note that when using the stdio data source/destination
- * managers, this is also the data type passed to fread/fwrite.
- */
-
-#ifdef HAVE_UNSIGNED_CHAR
-
-typedef unsigned char JOCTET;
-#define GETJOCTET(value) (value)
-
-#else /* not HAVE_UNSIGNED_CHAR */
-
-typedef char JOCTET;
-#ifdef CHAR_IS_UNSIGNED
-#define GETJOCTET(value) (value)
-#else
-#define GETJOCTET(value) ((value) & 0xFF)
-#endif /* CHAR_IS_UNSIGNED */
-
-#endif /* HAVE_UNSIGNED_CHAR */
-
-
-/* These typedefs are used for various table entries and so forth.
- * They must be at least as wide as specified; but making them too big
- * won't cost a huge amount of memory, so we don't provide special
- * extraction code like we did for JSAMPLE. (In other words, these
- * typedefs live at a different point on the speed/space tradeoff curve.)
- */
-
-#if _FX_OS_ != _FX_VXWORKS_
-
-/* UINT8 must hold at least the values 0..255. */
-
-#ifdef HAVE_UNSIGNED_CHAR
-typedef unsigned char UINT8;
-#else /* not HAVE_UNSIGNED_CHAR */
-#ifdef CHAR_IS_UNSIGNED
-typedef char UINT8;
-#else /* not CHAR_IS_UNSIGNED */
-typedef short UINT8;
-#endif /* CHAR_IS_UNSIGNED */
-#endif /* HAVE_UNSIGNED_CHAR */
-
-
-/* UINT16 must hold at least the values 0..65535. */
-
-#ifdef HAVE_UNSIGNED_SHORT
-typedef unsigned short UINT16;
-#else /* not HAVE_UNSIGNED_SHORT */
-typedef unsigned int UINT16;
-#endif /* HAVE_UNSIGNED_SHORT */
-
-/* INT16 must hold at least the values -32768..32767. */
-
-#ifndef XMD_H /* X11/xmd.h correctly defines INT16 */
-typedef short INT16;
-#endif
-
-/* INT32 must hold at least signed 32-bit values. */
-
-#ifndef XMD_H /* X11/xmd.h correctly defines INT32 */
-typedef int INT32;
-#endif
-
-#endif
-
-/* Datatype used for image dimensions. The JPEG standard only supports
- * images up to 64K*64K due to 16-bit fields in SOF markers. Therefore
- * "unsigned int" is sufficient on all machines. However, if you need to
- * handle larger images and you don't mind deviating from the spec, you
- * can change this datatype.
- */
-
-typedef unsigned int JDIMENSION;
-
-#define JPEG_MAX_DIMENSION 65500L /* a tad under 64K to prevent overflows */
-
-
-/* These macros are used in all function definitions and extern declarations.
- * You could modify them if you need to change function linkage conventions;
- * in particular, you'll need to do that to make the library a Windows DLL.
- * Another application is to make all functions global for use with debuggers
- * or code profilers that require it.
- */
-
-/* a function called through method pointers: */
-#define METHODDEF(type) static type
-/* a function used only in its module: */
-#define LOCAL(type) static type
-/* a function referenced thru EXTERNs: */
-#define GLOBAL(type) type
-
-#ifdef _FX_MANAGED_CODE_
-#define EXTERN(type) extern "C" type
-#else
-/* a reference to a GLOBAL function: */
-#define EXTERN(type) extern type
-#endif
-
-
-/* This macro is used to declare a "method", that is, a function pointer.
- * We want to supply prototype parameters if the compiler can cope.
- * Note that the arglist parameter must be parenthesized!
- * Again, you can customize this if you need special linkage keywords.
- */
-
-#ifdef HAVE_PROTOTYPES
-#define JMETHOD(type,methodname,arglist) type (*methodname) arglist
-#else
-#define JMETHOD(type,methodname,arglist) type (*methodname) ()
-#endif
-
-
-/* Here is the pseudo-keyword for declaring pointers that must be "far"
- * on 80x86 machines. Most of the specialized coding for 80x86 is handled
- * by just saying "FAR *" where such a pointer is needed. In a few places
- * explicit coding is needed; see uses of the NEED_FAR_POINTERS symbol.
- */
-
-#ifdef NEED_FAR_POINTERS
-#define FAR far
-#else
-//#define FAR
-#endif
-
-
-/*
- * On a few systems, type boolean and/or its values FALSE, TRUE may appear
- * in standard header files. Or you may have conflicts with application-
- * specific header files that you want to include together with these files.
- * Defining HAVE_BOOLEAN before including jpeglib.h should make it work.
- */
-
-#ifndef HAVE_BOOLEAN
-typedef int boolean;
-#endif
-#ifndef FALSE /* in case these macros already exist */
-#define FALSE 0 /* values of boolean */
-#endif
-#ifndef TRUE
-#define TRUE 1
-#endif
-
-
-/*
- * The remaining options affect code selection within the JPEG library,
- * but they don't need to be visible to most applications using the library.
- * To minimize application namespace pollution, the symbols won't be
- * defined unless JPEG_INTERNALS or JPEG_INTERNAL_OPTIONS has been defined.
- */
-
-#ifdef JPEG_INTERNALS
-#define JPEG_INTERNAL_OPTIONS
-#endif
-
-#ifdef JPEG_INTERNAL_OPTIONS
-
-
-/*
- * These defines indicate whether to include various optional functions.
- * Undefining some of these symbols will produce a smaller but less capable
- * library. Note that you can leave certain source files out of the
- * compilation/linking process if you've #undef'd the corresponding symbols.
- * (You may HAVE to do that if your compiler doesn't like null source files.)
- */
-
-/* Arithmetic coding is unsupported for legal reasons. Complaints to IBM. */
-
-/* Capability options common to encoder and decoder: */
-
-#define DCT_ISLOW_SUPPORTED /* slow but accurate integer algorithm */
-#define DCT_IFAST_SUPPORTED /* faster, less accurate integer method */
-#undef DCT_FLOAT_SUPPORTED /* floating-point: accurate, fast on fast HW */
-
-/* Encoder capability options: */
-
-#undef C_ARITH_CODING_SUPPORTED /* Arithmetic coding back end? */
-#define C_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */
-#define C_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/
-#define ENTROPY_OPT_SUPPORTED /* Optimization of entropy coding parms? */
-/* Note: if you selected 12-bit data precision, it is dangerous to turn off
- * ENTROPY_OPT_SUPPORTED. The standard Huffman tables are only good for 8-bit
- * precision, so jchuff.c normally uses entropy optimization to compute
- * usable tables for higher precision. If you don't want to do optimization,
- * you'll have to supply different default Huffman tables.
- * The exact same statements apply for progressive JPEG: the default tables
- * don't work for progressive mode. (This may get fixed, however.)
- */
-#define INPUT_SMOOTHING_SUPPORTED /* Input image smoothing option? */
-
-/* Decoder capability options: */
-
-#undef D_ARITH_CODING_SUPPORTED /* Arithmetic coding back end? */
-#define D_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */
-#define D_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/
-#define SAVE_MARKERS_SUPPORTED /* jpeg_save_markers() needed? */
-#define BLOCK_SMOOTHING_SUPPORTED /* Block smoothing? (Progressive only) */
-#define IDCT_SCALING_SUPPORTED /* Output rescaling via IDCT? */
-#undef UPSAMPLE_SCALING_SUPPORTED /* Output rescaling at upsample stage? */
-#define UPSAMPLE_MERGING_SUPPORTED /* Fast path for sloppy upsampling? */
-#undef QUANT_1PASS_SUPPORTED /* 1-pass color quantization? */
-#undef QUANT_2PASS_SUPPORTED /* 2-pass color quantization? */
-
-/* more capability options later, no doubt */
-
-
-/*
- * Ordering of RGB data in scanlines passed to or from the application.
- * If your application wants to deal with data in the order B,G,R, just
- * change these macros. You can also deal with formats such as R,G,B,X
- * (one extra byte per pixel) by changing RGB_PIXELSIZE. Note that changing
- * the offsets will also change the order in which colormap data is organized.
- * RESTRICTIONS:
- * 1. The sample applications cjpeg,djpeg do NOT support modified RGB formats.
- * 2. These macros only affect RGB<=>YCbCr color conversion, so they are not
- * useful if you are using JPEG color spaces other than YCbCr or grayscale.
- * 3. The color quantizer modules will not behave desirably if RGB_PIXELSIZE
- * is not 3 (they don't understand about dummy color components!). So you
- * can't use color quantization if you change that value.
- */
-
-#define RGB_RED 0 /* Offset of Red in an RGB scanline element */
-#define RGB_GREEN 1 /* Offset of Green */
-#define RGB_BLUE 2 /* Offset of Blue */
-#define RGB_PIXELSIZE 3 /* JSAMPLEs per RGB scanline element */
-
-
-/* Definitions for speed-related optimizations. */
-
-
-/* If your compiler supports inline functions, define INLINE
- * as the inline keyword; otherwise define it as empty.
- */
-
-#ifndef INLINE
-#ifdef __GNUC__ /* for instance, GNU C knows about inline */
-#define INLINE __inline__
-#endif
-#ifndef INLINE
-#define INLINE /* default is to define it as empty */
-#endif
-#endif
-
-
-/* On some machines (notably 68000 series) "int" is 32 bits, but multiplying
- * two 16-bit shorts is faster than multiplying two ints. Define MULTIPLIER
- * as short on such a machine. MULTIPLIER must be at least 16 bits wide.
- */
-
-#ifndef MULTIPLIER
-#define MULTIPLIER int /* type for fastest integer multiply */
-#endif
-
-
-/* FAST_FLOAT should be either float or double, whichever is done faster
- * by your compiler. (Note that this type is only used in the floating point
- * DCT routines, so it only matters if you've defined DCT_FLOAT_SUPPORTED.)
- * Typically, float is faster in ANSI C compilers, while double is faster in
- * pre-ANSI compilers (because they insist on converting to double anyway).
- * The code below therefore chooses float if we have ANSI-style prototypes.
- */
-
-#ifndef FAST_FLOAT
-#ifdef HAVE_PROTOTYPES
-#define FAST_FLOAT float
-#else
-#define FAST_FLOAT double
-#endif
-#endif
-
-#endif /* JPEG_INTERNAL_OPTIONS */
+/*
+ * jmorecfg.h
+ *
+ * Copyright (C) 1991-1997, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains additional configuration options that customize the
+ * JPEG software for special applications or support machine-dependent
+ * optimizations. Most users will not need to touch this file.
+ */
+
+#ifdef _MSC_VER
+#pragma warning (disable : 4142)
+#endif
+
+/*
+ * Define BITS_IN_JSAMPLE as either
+ * 8 for 8-bit sample values (the usual setting)
+ * 12 for 12-bit sample values
+ * Only 8 and 12 are legal data precisions for lossy JPEG according to the
+ * JPEG standard, and the IJG code does not support anything else!
+ * We do not support run-time selection of data precision, sorry.
+ */
+
+#define BITS_IN_JSAMPLE 8 /* use 8 or 12 */
+
+
+/*
+ * Maximum number of components (color channels) allowed in JPEG image.
+ * To meet the letter of the JPEG spec, set this to 255. However, darn
+ * few applications need more than 4 channels (maybe 5 for CMYK + alpha
+ * mask). We recommend 10 as a reasonable compromise; use 4 if you are
+ * really short on memory. (Each allowed component costs a hundred or so
+ * bytes of storage, whether actually used in an image or not.)
+ */
+
+#define MAX_COMPONENTS 10 /* maximum number of image components */
+
+
+/*
+ * Basic data types.
+ * You may need to change these if you have a machine with unusual data
+ * type sizes; for example, "char" not 8 bits, "short" not 16 bits,
+ * or "long" not 32 bits. We don't care whether "int" is 16 or 32 bits,
+ * but it had better be at least 16.
+ */
+
+/* Representation of a single sample (pixel element value).
+ * We frequently allocate large arrays of these, so it's important to keep
+ * them small. But if you have memory to burn and access to char or short
+ * arrays is very slow on your hardware, you might want to change these.
+ */
+
+#if BITS_IN_JSAMPLE == 8
+/* JSAMPLE should be the smallest type that will hold the values 0..255.
+ * You can use a signed char by having GETJSAMPLE mask it with 0xFF.
+ */
+
+#ifdef HAVE_UNSIGNED_CHAR
+
+typedef unsigned char JSAMPLE;
+#define GETJSAMPLE(value) ((int) (value))
+
+#else /* not HAVE_UNSIGNED_CHAR */
+
+typedef char JSAMPLE;
+#ifdef CHAR_IS_UNSIGNED
+#define GETJSAMPLE(value) ((int) (value))
+#else
+#define GETJSAMPLE(value) ((int) (value) & 0xFF)
+#endif /* CHAR_IS_UNSIGNED */
+
+#endif /* HAVE_UNSIGNED_CHAR */
+
+#define MAXJSAMPLE 255
+#define CENTERJSAMPLE 128
+
+#endif /* BITS_IN_JSAMPLE == 8 */
+
+
+#if BITS_IN_JSAMPLE == 12
+/* JSAMPLE should be the smallest type that will hold the values 0..4095.
+ * On nearly all machines "short" will do nicely.
+ */
+
+typedef short JSAMPLE;
+#define GETJSAMPLE(value) ((int) (value))
+
+#define MAXJSAMPLE 4095
+#define CENTERJSAMPLE 2048
+
+#endif /* BITS_IN_JSAMPLE == 12 */
+
+
+/* Representation of a DCT frequency coefficient.
+ * This should be a signed value of at least 16 bits; "short" is usually OK.
+ * Again, we allocate large arrays of these, but you can change to int
+ * if you have memory to burn and "short" is really slow.
+ */
+
+typedef short JCOEF;
+
+
+/* Compressed datastreams are represented as arrays of JOCTET.
+ * These must be EXACTLY 8 bits wide, at least once they are written to
+ * external storage. Note that when using the stdio data source/destination
+ * managers, this is also the data type passed to fread/fwrite.
+ */
+
+#ifdef HAVE_UNSIGNED_CHAR
+
+typedef unsigned char JOCTET;
+#define GETJOCTET(value) (value)
+
+#else /* not HAVE_UNSIGNED_CHAR */
+
+typedef char JOCTET;
+#ifdef CHAR_IS_UNSIGNED
+#define GETJOCTET(value) (value)
+#else
+#define GETJOCTET(value) ((value) & 0xFF)
+#endif /* CHAR_IS_UNSIGNED */
+
+#endif /* HAVE_UNSIGNED_CHAR */
+
+
+/* These typedefs are used for various table entries and so forth.
+ * They must be at least as wide as specified; but making them too big
+ * won't cost a huge amount of memory, so we don't provide special
+ * extraction code like we did for JSAMPLE. (In other words, these
+ * typedefs live at a different point on the speed/space tradeoff curve.)
+ */
+
+#if _FX_OS_ != _FX_VXWORKS_
+
+/* UINT8 must hold at least the values 0..255. */
+
+#ifdef HAVE_UNSIGNED_CHAR
+typedef unsigned char UINT8;
+#else /* not HAVE_UNSIGNED_CHAR */
+#ifdef CHAR_IS_UNSIGNED
+typedef char UINT8;
+#else /* not CHAR_IS_UNSIGNED */
+typedef short UINT8;
+#endif /* CHAR_IS_UNSIGNED */
+#endif /* HAVE_UNSIGNED_CHAR */
+
+
+/* UINT16 must hold at least the values 0..65535. */
+
+#ifdef HAVE_UNSIGNED_SHORT
+typedef unsigned short UINT16;
+#else /* not HAVE_UNSIGNED_SHORT */
+typedef unsigned int UINT16;
+#endif /* HAVE_UNSIGNED_SHORT */
+
+/* INT16 must hold at least the values -32768..32767. */
+
+#ifndef XMD_H /* X11/xmd.h correctly defines INT16 */
+typedef short INT16;
+#endif
+
+/* INT32 must hold at least signed 32-bit values. */
+
+#ifndef XMD_H /* X11/xmd.h correctly defines INT32 */
+typedef int INT32;
+#endif
+
+#endif
+
+/* Datatype used for image dimensions. The JPEG standard only supports
+ * images up to 64K*64K due to 16-bit fields in SOF markers. Therefore
+ * "unsigned int" is sufficient on all machines. However, if you need to
+ * handle larger images and you don't mind deviating from the spec, you
+ * can change this datatype.
+ */
+
+typedef unsigned int JDIMENSION;
+
+#define JPEG_MAX_DIMENSION 65500L /* a tad under 64K to prevent overflows */
+
+
+/* These macros are used in all function definitions and extern declarations.
+ * You could modify them if you need to change function linkage conventions;
+ * in particular, you'll need to do that to make the library a Windows DLL.
+ * Another application is to make all functions global for use with debuggers
+ * or code profilers that require it.
+ */
+
+/* a function called through method pointers: */
+#define METHODDEF(type) static type
+/* a function used only in its module: */
+#define LOCAL(type) static type
+/* a function referenced thru EXTERNs: */
+#define GLOBAL(type) type
+
+#ifdef _FX_MANAGED_CODE_
+#define EXTERN(type) extern "C" type
+#else
+/* a reference to a GLOBAL function: */
+#define EXTERN(type) extern type
+#endif
+
+
+/* This macro is used to declare a "method", that is, a function pointer.
+ * We want to supply prototype parameters if the compiler can cope.
+ * Note that the arglist parameter must be parenthesized!
+ * Again, you can customize this if you need special linkage keywords.
+ */
+
+#ifdef HAVE_PROTOTYPES
+#define JMETHOD(type,methodname,arglist) type (*methodname) arglist
+#else
+#define JMETHOD(type,methodname,arglist) type (*methodname) ()
+#endif
+
+
+/* Here is the pseudo-keyword for declaring pointers that must be "far"
+ * on 80x86 machines. Most of the specialized coding for 80x86 is handled
+ * by just saying "FAR *" where such a pointer is needed. In a few places
+ * explicit coding is needed; see uses of the NEED_FAR_POINTERS symbol.
+ */
+
+#ifdef NEED_FAR_POINTERS
+#define FAR far
+#else
+//#define FAR
+#endif
+
+
+/*
+ * On a few systems, type boolean and/or its values FALSE, TRUE may appear
+ * in standard header files. Or you may have conflicts with application-
+ * specific header files that you want to include together with these files.
+ * Defining HAVE_BOOLEAN before including jpeglib.h should make it work.
+ */
+
+#ifndef HAVE_BOOLEAN
+typedef int boolean;
+#endif
+#ifndef FALSE /* in case these macros already exist */
+#define FALSE 0 /* values of boolean */
+#endif
+#ifndef TRUE
+#define TRUE 1
+#endif
+
+
+/*
+ * The remaining options affect code selection within the JPEG library,
+ * but they don't need to be visible to most applications using the library.
+ * To minimize application namespace pollution, the symbols won't be
+ * defined unless JPEG_INTERNALS or JPEG_INTERNAL_OPTIONS has been defined.
+ */
+
+#ifdef JPEG_INTERNALS
+#define JPEG_INTERNAL_OPTIONS
+#endif
+
+#ifdef JPEG_INTERNAL_OPTIONS
+
+
+/*
+ * These defines indicate whether to include various optional functions.
+ * Undefining some of these symbols will produce a smaller but less capable
+ * library. Note that you can leave certain source files out of the
+ * compilation/linking process if you've #undef'd the corresponding symbols.
+ * (You may HAVE to do that if your compiler doesn't like null source files.)
+ */
+
+/* Arithmetic coding is unsupported for legal reasons. Complaints to IBM. */
+
+/* Capability options common to encoder and decoder: */
+
+#define DCT_ISLOW_SUPPORTED /* slow but accurate integer algorithm */
+#define DCT_IFAST_SUPPORTED /* faster, less accurate integer method */
+#undef DCT_FLOAT_SUPPORTED /* floating-point: accurate, fast on fast HW */
+
+/* Encoder capability options: */
+
+#undef C_ARITH_CODING_SUPPORTED /* Arithmetic coding back end? */
+#define C_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */
+#define C_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/
+#define ENTROPY_OPT_SUPPORTED /* Optimization of entropy coding parms? */
+/* Note: if you selected 12-bit data precision, it is dangerous to turn off
+ * ENTROPY_OPT_SUPPORTED. The standard Huffman tables are only good for 8-bit
+ * precision, so jchuff.c normally uses entropy optimization to compute
+ * usable tables for higher precision. If you don't want to do optimization,
+ * you'll have to supply different default Huffman tables.
+ * The exact same statements apply for progressive JPEG: the default tables
+ * don't work for progressive mode. (This may get fixed, however.)
+ */
+#define INPUT_SMOOTHING_SUPPORTED /* Input image smoothing option? */
+
+/* Decoder capability options: */
+
+#undef D_ARITH_CODING_SUPPORTED /* Arithmetic coding back end? */
+#define D_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */
+#define D_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/
+#define SAVE_MARKERS_SUPPORTED /* jpeg_save_markers() needed? */
+#define BLOCK_SMOOTHING_SUPPORTED /* Block smoothing? (Progressive only) */
+#define IDCT_SCALING_SUPPORTED /* Output rescaling via IDCT? */
+#undef UPSAMPLE_SCALING_SUPPORTED /* Output rescaling at upsample stage? */
+#define UPSAMPLE_MERGING_SUPPORTED /* Fast path for sloppy upsampling? */
+#undef QUANT_1PASS_SUPPORTED /* 1-pass color quantization? */
+#undef QUANT_2PASS_SUPPORTED /* 2-pass color quantization? */
+
+/* more capability options later, no doubt */
+
+
+/*
+ * Ordering of RGB data in scanlines passed to or from the application.
+ * If your application wants to deal with data in the order B,G,R, just
+ * change these macros. You can also deal with formats such as R,G,B,X
+ * (one extra byte per pixel) by changing RGB_PIXELSIZE. Note that changing
+ * the offsets will also change the order in which colormap data is organized.
+ * RESTRICTIONS:
+ * 1. The sample applications cjpeg,djpeg do NOT support modified RGB formats.
+ * 2. These macros only affect RGB<=>YCbCr color conversion, so they are not
+ * useful if you are using JPEG color spaces other than YCbCr or grayscale.
+ * 3. The color quantizer modules will not behave desirably if RGB_PIXELSIZE
+ * is not 3 (they don't understand about dummy color components!). So you
+ * can't use color quantization if you change that value.
+ */
+
+#define RGB_RED 0 /* Offset of Red in an RGB scanline element */
+#define RGB_GREEN 1 /* Offset of Green */
+#define RGB_BLUE 2 /* Offset of Blue */
+#define RGB_PIXELSIZE 3 /* JSAMPLEs per RGB scanline element */
+
+
+/* Definitions for speed-related optimizations. */
+
+
+/* If your compiler supports inline functions, define INLINE
+ * as the inline keyword; otherwise define it as empty.
+ */
+
+#ifndef INLINE
+#ifdef __GNUC__ /* for instance, GNU C knows about inline */
+#define INLINE __inline__
+#endif
+#ifndef INLINE
+#define INLINE /* default is to define it as empty */
+#endif
+#endif
+
+
+/* On some machines (notably 68000 series) "int" is 32 bits, but multiplying
+ * two 16-bit shorts is faster than multiplying two ints. Define MULTIPLIER
+ * as short on such a machine. MULTIPLIER must be at least 16 bits wide.
+ */
+
+#ifndef MULTIPLIER
+#define MULTIPLIER int /* type for fastest integer multiply */
+#endif
+
+
+/* FAST_FLOAT should be either float or double, whichever is done faster
+ * by your compiler. (Note that this type is only used in the floating point
+ * DCT routines, so it only matters if you've defined DCT_FLOAT_SUPPORTED.)
+ * Typically, float is faster in ANSI C compilers, while double is faster in
+ * pre-ANSI compilers (because they insist on converting to double anyway).
+ * The code below therefore chooses float if we have ANSI-style prototypes.
+ */
+
+#ifndef FAST_FLOAT
+#ifdef HAVE_PROTOTYPES
+#define FAST_FLOAT float
+#else
+#define FAST_FLOAT double
+#endif
+#endif
+
+#endif /* JPEG_INTERNAL_OPTIONS */
diff --git a/core/include/thirdparties/libjpeg/jpegint.h b/core/include/thirdparties/libjpeg/jpegint.h
index 685a3610b2..95b00d405c 100644
--- a/core/include/thirdparties/libjpeg/jpegint.h
+++ b/core/include/thirdparties/libjpeg/jpegint.h
@@ -1,392 +1,392 @@
-/*
- * jpegint.h
- *
- * Copyright (C) 1991-1997, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- * For conditions of distribution and use, see the accompanying README file.
- *
- * This file provides common declarations for the various JPEG modules.
- * These declarations are considered internal to the JPEG library; most
- * applications using the library shouldn't need to include this file.
- */
-
-
-/* Declarations for both compression & decompression */
-
-typedef enum { /* Operating modes for buffer controllers */
- JBUF_PASS_THRU, /* Plain stripwise operation */
- /* Remaining modes require a full-image buffer to have been created */
- JBUF_SAVE_SOURCE, /* Run source subobject only, save output */
- JBUF_CRANK_DEST, /* Run dest subobject only, using saved data */
- JBUF_SAVE_AND_PASS /* Run both subobjects, save output */
-} J_BUF_MODE;
-
-/* Values of global_state field (jdapi.c has some dependencies on ordering!) */
-#define CSTATE_START 100 /* after create_compress */
-#define CSTATE_SCANNING 101 /* start_compress done, write_scanlines OK */
-#define CSTATE_RAW_OK 102 /* start_compress done, write_raw_data OK */
-#define CSTATE_WRCOEFS 103 /* jpeg_write_coefficients done */
-#define DSTATE_START 200 /* after create_decompress */
-#define DSTATE_INHEADER 201 /* reading header markers, no SOS yet */
-#define DSTATE_READY 202 /* found SOS, ready for start_decompress */
-#define DSTATE_PRELOAD 203 /* reading multiscan file in start_decompress*/
-#define DSTATE_PRESCAN 204 /* performing dummy pass for 2-pass quant */
-#define DSTATE_SCANNING 205 /* start_decompress done, read_scanlines OK */
-#define DSTATE_RAW_OK 206 /* start_decompress done, read_raw_data OK */
-#define DSTATE_BUFIMAGE 207 /* expecting jpeg_start_output */
-#define DSTATE_BUFPOST 208 /* looking for SOS/EOI in jpeg_finish_output */
-#define DSTATE_RDCOEFS 209 /* reading file in jpeg_read_coefficients */
-#define DSTATE_STOPPING 210 /* looking for EOI in jpeg_finish_decompress */
-
-
-/* Declarations for compression modules */
-
-/* Master control module */
-struct jpeg_comp_master {
- JMETHOD(void, prepare_for_pass, (j_compress_ptr cinfo));
- JMETHOD(void, pass_startup, (j_compress_ptr cinfo));
- JMETHOD(void, finish_pass, (j_compress_ptr cinfo));
-
- /* State variables made visible to other modules */
- boolean call_pass_startup; /* True if pass_startup must be called */
- boolean is_last_pass; /* True during last pass */
-};
-
-/* Main buffer control (downsampled-data buffer) */
-struct jpeg_c_main_controller {
- JMETHOD(void, start_pass, (j_compress_ptr cinfo, J_BUF_MODE pass_mode));
- JMETHOD(void, process_data, (j_compress_ptr cinfo,
- JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,
- JDIMENSION in_rows_avail));
-};
-
-/* Compression preprocessing (downsampling input buffer control) */
-struct jpeg_c_prep_controller {
- JMETHOD(void, start_pass, (j_compress_ptr cinfo, J_BUF_MODE pass_mode));
- JMETHOD(void, pre_process_data, (j_compress_ptr cinfo,
- JSAMPARRAY input_buf,
- JDIMENSION *in_row_ctr,
- JDIMENSION in_rows_avail,
- JSAMPIMAGE output_buf,
- JDIMENSION *out_row_group_ctr,
- JDIMENSION out_row_groups_avail));
-};
-
-/* Coefficient buffer control */
-struct jpeg_c_coef_controller {
- JMETHOD(void, start_pass, (j_compress_ptr cinfo, J_BUF_MODE pass_mode));
- JMETHOD(boolean, compress_data, (j_compress_ptr cinfo,
- JSAMPIMAGE input_buf));
-};
-
-/* Colorspace conversion */
-struct jpeg_color_converter {
- JMETHOD(void, start_pass, (j_compress_ptr cinfo));
- JMETHOD(void, color_convert, (j_compress_ptr cinfo,
- JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
- JDIMENSION output_row, int num_rows));
-};
-
-/* Downsampling */
-struct jpeg_downsampler {
- JMETHOD(void, start_pass, (j_compress_ptr cinfo));
- JMETHOD(void, downsample, (j_compress_ptr cinfo,
- JSAMPIMAGE input_buf, JDIMENSION in_row_index,
- JSAMPIMAGE output_buf,
- JDIMENSION out_row_group_index));
-
- boolean need_context_rows; /* TRUE if need rows above & below */
-};
-
-/* Forward DCT (also controls coefficient quantization) */
-struct jpeg_forward_dct {
- JMETHOD(void, start_pass, (j_compress_ptr cinfo));
- /* perhaps this should be an array??? */
- JMETHOD(void, forward_DCT, (j_compress_ptr cinfo,
- jpeg_component_info * compptr,
- JSAMPARRAY sample_data, JBLOCKROW coef_blocks,
- JDIMENSION start_row, JDIMENSION start_col,
- JDIMENSION num_blocks));
-};
-
-/* Entropy encoding */
-struct jpeg_entropy_encoder {
- JMETHOD(void, start_pass, (j_compress_ptr cinfo, boolean gather_statistics));
- JMETHOD(boolean, encode_mcu, (j_compress_ptr cinfo, JBLOCKROW *MCU_data));
- JMETHOD(void, finish_pass, (j_compress_ptr cinfo));
-};
-
-/* Marker writing */
-struct jpeg_marker_writer {
- JMETHOD(void, write_file_header, (j_compress_ptr cinfo));
- JMETHOD(void, write_frame_header, (j_compress_ptr cinfo));
- JMETHOD(void, write_scan_header, (j_compress_ptr cinfo));
- JMETHOD(void, write_file_trailer, (j_compress_ptr cinfo));
- JMETHOD(void, write_tables_only, (j_compress_ptr cinfo));
- /* These routines are exported to allow insertion of extra markers */
- /* Probably only COM and APPn markers should be written this way */
- JMETHOD(void, write_marker_header, (j_compress_ptr cinfo, int marker,
- unsigned int datalen));
- JMETHOD(void, write_marker_byte, (j_compress_ptr cinfo, int val));
-};
-
-
-/* Declarations for decompression modules */
-
-/* Master control module */
-struct jpeg_decomp_master {
- JMETHOD(void, prepare_for_output_pass, (j_decompress_ptr cinfo));
- JMETHOD(void, finish_output_pass, (j_decompress_ptr cinfo));
-
- /* State variables made visible to other modules */
- boolean is_dummy_pass; /* True during 1st pass for 2-pass quant */
-};
-
-/* Input control module */
-struct jpeg_input_controller {
- JMETHOD(int, consume_input, (j_decompress_ptr cinfo));
- JMETHOD(void, reset_input_controller, (j_decompress_ptr cinfo));
- JMETHOD(void, start_input_pass, (j_decompress_ptr cinfo));
- JMETHOD(void, finish_input_pass, (j_decompress_ptr cinfo));
-
- /* State variables made visible to other modules */
- boolean has_multiple_scans; /* True if file has multiple scans */
- boolean eoi_reached; /* True when EOI has been consumed */
-};
-
-/* Main buffer control (downsampled-data buffer) */
-struct jpeg_d_main_controller {
- JMETHOD(void, start_pass, (j_decompress_ptr cinfo, J_BUF_MODE pass_mode));
- JMETHOD(void, process_data, (j_decompress_ptr cinfo,
- JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
- JDIMENSION out_rows_avail));
-};
-
-/* Coefficient buffer control */
-struct jpeg_d_coef_controller {
- JMETHOD(void, start_input_pass, (j_decompress_ptr cinfo));
- JMETHOD(int, consume_data, (j_decompress_ptr cinfo));
- JMETHOD(void, start_output_pass, (j_decompress_ptr cinfo));
- JMETHOD(int, decompress_data, (j_decompress_ptr cinfo,
- JSAMPIMAGE output_buf));
- /* Pointer to array of coefficient virtual arrays, or NULL if none */
- jvirt_barray_ptr *coef_arrays;
-};
-
-/* Decompression postprocessing (color quantization buffer control) */
-struct jpeg_d_post_controller {
- JMETHOD(void, start_pass, (j_decompress_ptr cinfo, J_BUF_MODE pass_mode));
- JMETHOD(void, post_process_data, (j_decompress_ptr cinfo,
- JSAMPIMAGE input_buf,
- JDIMENSION *in_row_group_ctr,
- JDIMENSION in_row_groups_avail,
- JSAMPARRAY output_buf,
- JDIMENSION *out_row_ctr,
- JDIMENSION out_rows_avail));
-};
-
-/* Marker reading & parsing */
-struct jpeg_marker_reader {
- JMETHOD(void, reset_marker_reader, (j_decompress_ptr cinfo));
- /* Read markers until SOS or EOI.
- * Returns same codes as are defined for jpeg_consume_input:
- * JPEG_SUSPENDED, JPEG_REACHED_SOS, or JPEG_REACHED_EOI.
- */
- JMETHOD(int, read_markers, (j_decompress_ptr cinfo));
- /* Read a restart marker --- exported for use by entropy decoder only */
- jpeg_marker_parser_method read_restart_marker;
-
- /* State of marker reader --- nominally internal, but applications
- * supplying COM or APPn handlers might like to know the state.
- */
- boolean saw_SOI; /* found SOI? */
- boolean saw_SOF; /* found SOF? */
- int next_restart_num; /* next restart number expected (0-7) */
- unsigned int discarded_bytes; /* # of bytes skipped looking for a marker */
-};
-
-/* Entropy decoding */
-struct jpeg_entropy_decoder {
- JMETHOD(void, start_pass, (j_decompress_ptr cinfo));
- JMETHOD(boolean, decode_mcu, (j_decompress_ptr cinfo,
- JBLOCKROW *MCU_data));
-
- /* This is here to share code between baseline and progressive decoders; */
- /* other modules probably should not use it */
- boolean insufficient_data; /* set TRUE after emitting warning */
-};
-
-/* Inverse DCT (also performs dequantization) */
-typedef JMETHOD(void, inverse_DCT_method_ptr,
- (j_decompress_ptr cinfo, jpeg_component_info * compptr,
- JCOEFPTR coef_block,
- JSAMPARRAY output_buf, JDIMENSION output_col));
-
-struct jpeg_inverse_dct {
- JMETHOD(void, start_pass, (j_decompress_ptr cinfo));
- /* It is useful to allow each component to have a separate IDCT method. */
- inverse_DCT_method_ptr inverse_DCT[MAX_COMPONENTS];
-};
-
-/* Upsampling (note that upsampler must also call color converter) */
-struct jpeg_upsampler {
- JMETHOD(void, start_pass, (j_decompress_ptr cinfo));
- JMETHOD(void, upsample, (j_decompress_ptr cinfo,
- JSAMPIMAGE input_buf,
- JDIMENSION *in_row_group_ctr,
- JDIMENSION in_row_groups_avail,
- JSAMPARRAY output_buf,
- JDIMENSION *out_row_ctr,
- JDIMENSION out_rows_avail));
-
- boolean need_context_rows; /* TRUE if need rows above & below */
-};
-
-/* Colorspace conversion */
-struct jpeg_color_deconverter {
- JMETHOD(void, start_pass, (j_decompress_ptr cinfo));
- JMETHOD(void, color_convert, (j_decompress_ptr cinfo,
- JSAMPIMAGE input_buf, JDIMENSION input_row,
- JSAMPARRAY output_buf, int num_rows));
-};
-
-/* Color quantization or color precision reduction */
-struct jpeg_color_quantizer {
- JMETHOD(void, start_pass, (j_decompress_ptr cinfo, boolean is_pre_scan));
- JMETHOD(void, color_quantize, (j_decompress_ptr cinfo,
- JSAMPARRAY input_buf, JSAMPARRAY output_buf,
- int num_rows));
- JMETHOD(void, finish_pass, (j_decompress_ptr cinfo));
- JMETHOD(void, new_color_map, (j_decompress_ptr cinfo));
-};
-
-
-/* Miscellaneous useful macros */
-
-#undef MAX
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-#undef MIN
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-
-
-/* We assume that right shift corresponds to signed division by 2 with
- * rounding towards minus infinity. This is correct for typical "arithmetic
- * shift" instructions that shift in copies of the sign bit. But some
- * C compilers implement >> with an unsigned shift. For these machines you
- * must define RIGHT_SHIFT_IS_UNSIGNED.
- * RIGHT_SHIFT provides a proper signed right shift of an INT32 quantity.
- * It is only applied with constant shift counts. SHIFT_TEMPS must be
- * included in the variables of any routine using RIGHT_SHIFT.
- */
-
-#ifdef RIGHT_SHIFT_IS_UNSIGNED
-#define SHIFT_TEMPS INT32 shift_temp;
-#define RIGHT_SHIFT(x,shft) \
- ((shift_temp = (x)) < 0 ? \
- (shift_temp >> (shft)) | ((~((INT32) 0)) << (32-(shft))) : \
- (shift_temp >> (shft)))
-#else
-#define SHIFT_TEMPS
-#define RIGHT_SHIFT(x,shft) ((x) >> (shft))
-#endif
-
-
-/* Short forms of external names for systems with brain-damaged linkers. */
-
-#ifdef NEED_SHORT_EXTERNAL_NAMES
-#define jinit_compress_master jICompress
-#define jinit_c_master_control jICMaster
-#define jinit_c_main_controller jICMainC
-#define jinit_c_prep_controller jICPrepC
-#define jinit_c_coef_controller jICCoefC
-#define jinit_color_converter jICColor
-#define jinit_downsampler jIDownsampler
-#define jinit_forward_dct jIFDCT
-#define jinit_huff_encoder jIHEncoder
-#define jinit_phuff_encoder jIPHEncoder
-#define jinit_marker_writer jIMWriter
-#define jinit_master_decompress jIDMaster
-#define jinit_d_main_controller jIDMainC
-#define jinit_d_coef_controller jIDCoefC
-#define jinit_d_post_controller jIDPostC
-#define jinit_input_controller jIInCtlr
-#define jinit_marker_reader jIMReader
-#define jinit_huff_decoder jIHDecoder
-#define jinit_phuff_decoder jIPHDecoder
-#define jinit_inverse_dct jIIDCT
-#define jinit_upsampler jIUpsampler
-#define jinit_color_deconverter jIDColor
-#define jinit_1pass_quantizer jI1Quant
-#define jinit_2pass_quantizer jI2Quant
-#define jinit_merged_upsampler jIMUpsampler
-#define jinit_memory_mgr jIMemMgr
-#define jdiv_round_up jDivRound
-#define jround_up jRound
-#define jcopy_sample_rows jCopySamples
-#define jcopy_block_row jCopyBlocks
-#define jzero_far jZeroFar
-#define jpeg_zigzag_order jZIGTable
-#define jpeg_natural_order jZAGTable
-#endif /* NEED_SHORT_EXTERNAL_NAMES */
-
-
-/* Compression module initialization routines */
-EXTERN(void) jinit_compress_master JPP((j_compress_ptr cinfo));
-EXTERN(void) jinit_c_master_control JPP((j_compress_ptr cinfo,
- boolean transcode_only));
-EXTERN(void) jinit_c_main_controller JPP((j_compress_ptr cinfo,
- boolean need_full_buffer));
-EXTERN(void) jinit_c_prep_controller JPP((j_compress_ptr cinfo,
- boolean need_full_buffer));
-EXTERN(void) jinit_c_coef_controller JPP((j_compress_ptr cinfo,
- boolean need_full_buffer));
-EXTERN(void) jinit_color_converter JPP((j_compress_ptr cinfo));
-EXTERN(void) jinit_downsampler JPP((j_compress_ptr cinfo));
-EXTERN(void) jinit_forward_dct JPP((j_compress_ptr cinfo));
-EXTERN(void) jinit_huff_encoder JPP((j_compress_ptr cinfo));
-EXTERN(void) jinit_phuff_encoder JPP((j_compress_ptr cinfo));
-EXTERN(void) jinit_marker_writer JPP((j_compress_ptr cinfo));
-/* Decompression module initialization routines */
-EXTERN(void) jinit_master_decompress JPP((j_decompress_ptr cinfo));
-EXTERN(void) jinit_d_main_controller JPP((j_decompress_ptr cinfo,
- boolean need_full_buffer));
-EXTERN(void) jinit_d_coef_controller JPP((j_decompress_ptr cinfo,
- boolean need_full_buffer));
-EXTERN(void) jinit_d_post_controller JPP((j_decompress_ptr cinfo,
- boolean need_full_buffer));
-EXTERN(void) jinit_input_controller JPP((j_decompress_ptr cinfo));
-EXTERN(void) jinit_marker_reader JPP((j_decompress_ptr cinfo));
-EXTERN(void) jinit_huff_decoder JPP((j_decompress_ptr cinfo));
-EXTERN(void) jinit_phuff_decoder JPP((j_decompress_ptr cinfo));
-EXTERN(void) jinit_inverse_dct JPP((j_decompress_ptr cinfo));
-EXTERN(void) jinit_upsampler JPP((j_decompress_ptr cinfo));
-EXTERN(void) jinit_color_deconverter JPP((j_decompress_ptr cinfo));
-EXTERN(void) jinit_1pass_quantizer JPP((j_decompress_ptr cinfo));
-EXTERN(void) jinit_2pass_quantizer JPP((j_decompress_ptr cinfo));
-EXTERN(void) jinit_merged_upsampler JPP((j_decompress_ptr cinfo));
-/* Memory manager initialization */
-EXTERN(void) jinit_memory_mgr JPP((j_common_ptr cinfo));
-
-/* Utility routines in jutils.c */
-EXTERN(long) jdiv_round_up JPP((long a, long b));
-EXTERN(long) jround_up JPP((long a, long b));
-EXTERN(void) jcopy_sample_rows JPP((JSAMPARRAY input_array, int source_row,
- JSAMPARRAY output_array, int dest_row,
- int num_rows, JDIMENSION num_cols));
-EXTERN(void) jcopy_block_row JPP((JBLOCKROW input_row, JBLOCKROW output_row,
- JDIMENSION num_blocks));
-EXTERN(void) jzero_far JPP((void FAR * target, size_t bytestozero));
-/* Constant tables in jutils.c */
-#if 0 /* This table is not actually needed in v6a */
-extern const int jpeg_zigzag_order[]; /* natural coef order to zigzag order */
-#endif
-extern const int jpeg_natural_order[]; /* zigzag coef order to natural order */
-
-/* Suppress undefined-structure complaints if necessary. */
-
-#ifdef INCOMPLETE_TYPES_BROKEN
-#ifndef AM_MEMORY_MANAGER /* only jmemmgr.c defines these */
-struct jvirt_sarray_control { long dummy; };
-struct jvirt_barray_control { long dummy; };
-#endif
-#endif /* INCOMPLETE_TYPES_BROKEN */
+/*
+ * jpegint.h
+ *
+ * Copyright (C) 1991-1997, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file provides common declarations for the various JPEG modules.
+ * These declarations are considered internal to the JPEG library; most
+ * applications using the library shouldn't need to include this file.
+ */
+
+
+/* Declarations for both compression & decompression */
+
+typedef enum { /* Operating modes for buffer controllers */
+ JBUF_PASS_THRU, /* Plain stripwise operation */
+ /* Remaining modes require a full-image buffer to have been created */
+ JBUF_SAVE_SOURCE, /* Run source subobject only, save output */
+ JBUF_CRANK_DEST, /* Run dest subobject only, using saved data */
+ JBUF_SAVE_AND_PASS /* Run both subobjects, save output */
+} J_BUF_MODE;
+
+/* Values of global_state field (jdapi.c has some dependencies on ordering!) */
+#define CSTATE_START 100 /* after create_compress */
+#define CSTATE_SCANNING 101 /* start_compress done, write_scanlines OK */
+#define CSTATE_RAW_OK 102 /* start_compress done, write_raw_data OK */
+#define CSTATE_WRCOEFS 103 /* jpeg_write_coefficients done */
+#define DSTATE_START 200 /* after create_decompress */
+#define DSTATE_INHEADER 201 /* reading header markers, no SOS yet */
+#define DSTATE_READY 202 /* found SOS, ready for start_decompress */
+#define DSTATE_PRELOAD 203 /* reading multiscan file in start_decompress*/
+#define DSTATE_PRESCAN 204 /* performing dummy pass for 2-pass quant */
+#define DSTATE_SCANNING 205 /* start_decompress done, read_scanlines OK */
+#define DSTATE_RAW_OK 206 /* start_decompress done, read_raw_data OK */
+#define DSTATE_BUFIMAGE 207 /* expecting jpeg_start_output */
+#define DSTATE_BUFPOST 208 /* looking for SOS/EOI in jpeg_finish_output */
+#define DSTATE_RDCOEFS 209 /* reading file in jpeg_read_coefficients */
+#define DSTATE_STOPPING 210 /* looking for EOI in jpeg_finish_decompress */
+
+
+/* Declarations for compression modules */
+
+/* Master control module */
+struct jpeg_comp_master {
+ JMETHOD(void, prepare_for_pass, (j_compress_ptr cinfo));
+ JMETHOD(void, pass_startup, (j_compress_ptr cinfo));
+ JMETHOD(void, finish_pass, (j_compress_ptr cinfo));
+
+ /* State variables made visible to other modules */
+ boolean call_pass_startup; /* True if pass_startup must be called */
+ boolean is_last_pass; /* True during last pass */
+};
+
+/* Main buffer control (downsampled-data buffer) */
+struct jpeg_c_main_controller {
+ JMETHOD(void, start_pass, (j_compress_ptr cinfo, J_BUF_MODE pass_mode));
+ JMETHOD(void, process_data, (j_compress_ptr cinfo,
+ JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,
+ JDIMENSION in_rows_avail));
+};
+
+/* Compression preprocessing (downsampling input buffer control) */
+struct jpeg_c_prep_controller {
+ JMETHOD(void, start_pass, (j_compress_ptr cinfo, J_BUF_MODE pass_mode));
+ JMETHOD(void, pre_process_data, (j_compress_ptr cinfo,
+ JSAMPARRAY input_buf,
+ JDIMENSION *in_row_ctr,
+ JDIMENSION in_rows_avail,
+ JSAMPIMAGE output_buf,
+ JDIMENSION *out_row_group_ctr,
+ JDIMENSION out_row_groups_avail));
+};
+
+/* Coefficient buffer control */
+struct jpeg_c_coef_controller {
+ JMETHOD(void, start_pass, (j_compress_ptr cinfo, J_BUF_MODE pass_mode));
+ JMETHOD(boolean, compress_data, (j_compress_ptr cinfo,
+ JSAMPIMAGE input_buf));
+};
+
+/* Colorspace conversion */
+struct jpeg_color_converter {
+ JMETHOD(void, start_pass, (j_compress_ptr cinfo));
+ JMETHOD(void, color_convert, (j_compress_ptr cinfo,
+ JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
+ JDIMENSION output_row, int num_rows));
+};
+
+/* Downsampling */
+struct jpeg_downsampler {
+ JMETHOD(void, start_pass, (j_compress_ptr cinfo));
+ JMETHOD(void, downsample, (j_compress_ptr cinfo,
+ JSAMPIMAGE input_buf, JDIMENSION in_row_index,
+ JSAMPIMAGE output_buf,
+ JDIMENSION out_row_group_index));
+
+ boolean need_context_rows; /* TRUE if need rows above & below */
+};
+
+/* Forward DCT (also controls coefficient quantization) */
+struct jpeg_forward_dct {
+ JMETHOD(void, start_pass, (j_compress_ptr cinfo));
+ /* perhaps this should be an array??? */
+ JMETHOD(void, forward_DCT, (j_compress_ptr cinfo,
+ jpeg_component_info * compptr,
+ JSAMPARRAY sample_data, JBLOCKROW coef_blocks,
+ JDIMENSION start_row, JDIMENSION start_col,
+ JDIMENSION num_blocks));
+};
+
+/* Entropy encoding */
+struct jpeg_entropy_encoder {
+ JMETHOD(void, start_pass, (j_compress_ptr cinfo, boolean gather_statistics));
+ JMETHOD(boolean, encode_mcu, (j_compress_ptr cinfo, JBLOCKROW *MCU_data));
+ JMETHOD(void, finish_pass, (j_compress_ptr cinfo));
+};
+
+/* Marker writing */
+struct jpeg_marker_writer {
+ JMETHOD(void, write_file_header, (j_compress_ptr cinfo));
+ JMETHOD(void, write_frame_header, (j_compress_ptr cinfo));
+ JMETHOD(void, write_scan_header, (j_compress_ptr cinfo));
+ JMETHOD(void, write_file_trailer, (j_compress_ptr cinfo));
+ JMETHOD(void, write_tables_only, (j_compress_ptr cinfo));
+ /* These routines are exported to allow insertion of extra markers */
+ /* Probably only COM and APPn markers should be written this way */
+ JMETHOD(void, write_marker_header, (j_compress_ptr cinfo, int marker,
+ unsigned int datalen));
+ JMETHOD(void, write_marker_byte, (j_compress_ptr cinfo, int val));
+};
+
+
+/* Declarations for decompression modules */
+
+/* Master control module */
+struct jpeg_decomp_master {
+ JMETHOD(void, prepare_for_output_pass, (j_decompress_ptr cinfo));
+ JMETHOD(void, finish_output_pass, (j_decompress_ptr cinfo));
+
+ /* State variables made visible to other modules */
+ boolean is_dummy_pass; /* True during 1st pass for 2-pass quant */
+};
+
+/* Input control module */
+struct jpeg_input_controller {
+ JMETHOD(int, consume_input, (j_decompress_ptr cinfo));
+ JMETHOD(void, reset_input_controller, (j_decompress_ptr cinfo));
+ JMETHOD(void, start_input_pass, (j_decompress_ptr cinfo));
+ JMETHOD(void, finish_input_pass, (j_decompress_ptr cinfo));
+
+ /* State variables made visible to other modules */
+ boolean has_multiple_scans; /* True if file has multiple scans */
+ boolean eoi_reached; /* True when EOI has been consumed */
+};
+
+/* Main buffer control (downsampled-data buffer) */
+struct jpeg_d_main_controller {
+ JMETHOD(void, start_pass, (j_decompress_ptr cinfo, J_BUF_MODE pass_mode));
+ JMETHOD(void, process_data, (j_decompress_ptr cinfo,
+ JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
+ JDIMENSION out_rows_avail));
+};
+
+/* Coefficient buffer control */
+struct jpeg_d_coef_controller {
+ JMETHOD(void, start_input_pass, (j_decompress_ptr cinfo));
+ JMETHOD(int, consume_data, (j_decompress_ptr cinfo));
+ JMETHOD(void, start_output_pass, (j_decompress_ptr cinfo));
+ JMETHOD(int, decompress_data, (j_decompress_ptr cinfo,
+ JSAMPIMAGE output_buf));
+ /* Pointer to array of coefficient virtual arrays, or NULL if none */
+ jvirt_barray_ptr *coef_arrays;
+};
+
+/* Decompression postprocessing (color quantization buffer control) */
+struct jpeg_d_post_controller {
+ JMETHOD(void, start_pass, (j_decompress_ptr cinfo, J_BUF_MODE pass_mode));
+ JMETHOD(void, post_process_data, (j_decompress_ptr cinfo,
+ JSAMPIMAGE input_buf,
+ JDIMENSION *in_row_group_ctr,
+ JDIMENSION in_row_groups_avail,
+ JSAMPARRAY output_buf,
+ JDIMENSION *out_row_ctr,
+ JDIMENSION out_rows_avail));
+};
+
+/* Marker reading & parsing */
+struct jpeg_marker_reader {
+ JMETHOD(void, reset_marker_reader, (j_decompress_ptr cinfo));
+ /* Read markers until SOS or EOI.
+ * Returns same codes as are defined for jpeg_consume_input:
+ * JPEG_SUSPENDED, JPEG_REACHED_SOS, or JPEG_REACHED_EOI.
+ */
+ JMETHOD(int, read_markers, (j_decompress_ptr cinfo));
+ /* Read a restart marker --- exported for use by entropy decoder only */
+ jpeg_marker_parser_method read_restart_marker;
+
+ /* State of marker reader --- nominally internal, but applications
+ * supplying COM or APPn handlers might like to know the state.
+ */
+ boolean saw_SOI; /* found SOI? */
+ boolean saw_SOF; /* found SOF? */
+ int next_restart_num; /* next restart number expected (0-7) */
+ unsigned int discarded_bytes; /* # of bytes skipped looking for a marker */
+};
+
+/* Entropy decoding */
+struct jpeg_entropy_decoder {
+ JMETHOD(void, start_pass, (j_decompress_ptr cinfo));
+ JMETHOD(boolean, decode_mcu, (j_decompress_ptr cinfo,
+ JBLOCKROW *MCU_data));
+
+ /* This is here to share code between baseline and progressive decoders; */
+ /* other modules probably should not use it */
+ boolean insufficient_data; /* set TRUE after emitting warning */
+};
+
+/* Inverse DCT (also performs dequantization) */
+typedef JMETHOD(void, inverse_DCT_method_ptr,
+ (j_decompress_ptr cinfo, jpeg_component_info * compptr,
+ JCOEFPTR coef_block,
+ JSAMPARRAY output_buf, JDIMENSION output_col));
+
+struct jpeg_inverse_dct {
+ JMETHOD(void, start_pass, (j_decompress_ptr cinfo));
+ /* It is useful to allow each component to have a separate IDCT method. */
+ inverse_DCT_method_ptr inverse_DCT[MAX_COMPONENTS];
+};
+
+/* Upsampling (note that upsampler must also call color converter) */
+struct jpeg_upsampler {
+ JMETHOD(void, start_pass, (j_decompress_ptr cinfo));
+ JMETHOD(void, upsample, (j_decompress_ptr cinfo,
+ JSAMPIMAGE input_buf,
+ JDIMENSION *in_row_group_ctr,
+ JDIMENSION in_row_groups_avail,
+ JSAMPARRAY output_buf,
+ JDIMENSION *out_row_ctr,
+ JDIMENSION out_rows_avail));
+
+ boolean need_context_rows; /* TRUE if need rows above & below */
+};
+
+/* Colorspace conversion */
+struct jpeg_color_deconverter {
+ JMETHOD(void, start_pass, (j_decompress_ptr cinfo));
+ JMETHOD(void, color_convert, (j_decompress_ptr cinfo,
+ JSAMPIMAGE input_buf, JDIMENSION input_row,
+ JSAMPARRAY output_buf, int num_rows));
+};
+
+/* Color quantization or color precision reduction */
+struct jpeg_color_quantizer {
+ JMETHOD(void, start_pass, (j_decompress_ptr cinfo, boolean is_pre_scan));
+ JMETHOD(void, color_quantize, (j_decompress_ptr cinfo,
+ JSAMPARRAY input_buf, JSAMPARRAY output_buf,
+ int num_rows));
+ JMETHOD(void, finish_pass, (j_decompress_ptr cinfo));
+ JMETHOD(void, new_color_map, (j_decompress_ptr cinfo));
+};
+
+
+/* Miscellaneous useful macros */
+
+#undef MAX
+#define MAX(a,b) ((a) > (b) ? (a) : (b))
+#undef MIN
+#define MIN(a,b) ((a) < (b) ? (a) : (b))
+
+
+/* We assume that right shift corresponds to signed division by 2 with
+ * rounding towards minus infinity. This is correct for typical "arithmetic
+ * shift" instructions that shift in copies of the sign bit. But some
+ * C compilers implement >> with an unsigned shift. For these machines you
+ * must define RIGHT_SHIFT_IS_UNSIGNED.
+ * RIGHT_SHIFT provides a proper signed right shift of an INT32 quantity.
+ * It is only applied with constant shift counts. SHIFT_TEMPS must be
+ * included in the variables of any routine using RIGHT_SHIFT.
+ */
+
+#ifdef RIGHT_SHIFT_IS_UNSIGNED
+#define SHIFT_TEMPS INT32 shift_temp;
+#define RIGHT_SHIFT(x,shft) \
+ ((shift_temp = (x)) < 0 ? \
+ (shift_temp >> (shft)) | ((~((INT32) 0)) << (32-(shft))) : \
+ (shift_temp >> (shft)))
+#else
+#define SHIFT_TEMPS
+#define RIGHT_SHIFT(x,shft) ((x) >> (shft))
+#endif
+
+
+/* Short forms of external names for systems with brain-damaged linkers. */
+
+#ifdef NEED_SHORT_EXTERNAL_NAMES
+#define jinit_compress_master jICompress
+#define jinit_c_master_control jICMaster
+#define jinit_c_main_controller jICMainC
+#define jinit_c_prep_controller jICPrepC
+#define jinit_c_coef_controller jICCoefC
+#define jinit_color_converter jICColor
+#define jinit_downsampler jIDownsampler
+#define jinit_forward_dct jIFDCT
+#define jinit_huff_encoder jIHEncoder
+#define jinit_phuff_encoder jIPHEncoder
+#define jinit_marker_writer jIMWriter
+#define jinit_master_decompress jIDMaster
+#define jinit_d_main_controller jIDMainC
+#define jinit_d_coef_controller jIDCoefC
+#define jinit_d_post_controller jIDPostC
+#define jinit_input_controller jIInCtlr
+#define jinit_marker_reader jIMReader
+#define jinit_huff_decoder jIHDecoder
+#define jinit_phuff_decoder jIPHDecoder
+#define jinit_inverse_dct jIIDCT
+#define jinit_upsampler jIUpsampler
+#define jinit_color_deconverter jIDColor
+#define jinit_1pass_quantizer jI1Quant
+#define jinit_2pass_quantizer jI2Quant
+#define jinit_merged_upsampler jIMUpsampler
+#define jinit_memory_mgr jIMemMgr
+#define jdiv_round_up jDivRound
+#define jround_up jRound
+#define jcopy_sample_rows jCopySamples
+#define jcopy_block_row jCopyBlocks
+#define jzero_far jZeroFar
+#define jpeg_zigzag_order jZIGTable
+#define jpeg_natural_order jZAGTable
+#endif /* NEED_SHORT_EXTERNAL_NAMES */
+
+
+/* Compression module initialization routines */
+EXTERN(void) jinit_compress_master JPP((j_compress_ptr cinfo));
+EXTERN(void) jinit_c_master_control JPP((j_compress_ptr cinfo,
+ boolean transcode_only));
+EXTERN(void) jinit_c_main_controller JPP((j_compress_ptr cinfo,
+ boolean need_full_buffer));
+EXTERN(void) jinit_c_prep_controller JPP((j_compress_ptr cinfo,
+ boolean need_full_buffer));
+EXTERN(void) jinit_c_coef_controller JPP((j_compress_ptr cinfo,
+ boolean need_full_buffer));
+EXTERN(void) jinit_color_converter JPP((j_compress_ptr cinfo));
+EXTERN(void) jinit_downsampler JPP((j_compress_ptr cinfo));
+EXTERN(void) jinit_forward_dct JPP((j_compress_ptr cinfo));
+EXTERN(void) jinit_huff_encoder JPP((j_compress_ptr cinfo));
+EXTERN(void) jinit_phuff_encoder JPP((j_compress_ptr cinfo));
+EXTERN(void) jinit_marker_writer JPP((j_compress_ptr cinfo));
+/* Decompression module initialization routines */
+EXTERN(void) jinit_master_decompress JPP((j_decompress_ptr cinfo));
+EXTERN(void) jinit_d_main_controller JPP((j_decompress_ptr cinfo,
+ boolean need_full_buffer));
+EXTERN(void) jinit_d_coef_controller JPP((j_decompress_ptr cinfo,
+ boolean need_full_buffer));
+EXTERN(void) jinit_d_post_controller JPP((j_decompress_ptr cinfo,
+ boolean need_full_buffer));
+EXTERN(void) jinit_input_controller JPP((j_decompress_ptr cinfo));
+EXTERN(void) jinit_marker_reader JPP((j_decompress_ptr cinfo));
+EXTERN(void) jinit_huff_decoder JPP((j_decompress_ptr cinfo));
+EXTERN(void) jinit_phuff_decoder JPP((j_decompress_ptr cinfo));
+EXTERN(void) jinit_inverse_dct JPP((j_decompress_ptr cinfo));
+EXTERN(void) jinit_upsampler JPP((j_decompress_ptr cinfo));
+EXTERN(void) jinit_color_deconverter JPP((j_decompress_ptr cinfo));
+EXTERN(void) jinit_1pass_quantizer JPP((j_decompress_ptr cinfo));
+EXTERN(void) jinit_2pass_quantizer JPP((j_decompress_ptr cinfo));
+EXTERN(void) jinit_merged_upsampler JPP((j_decompress_ptr cinfo));
+/* Memory manager initialization */
+EXTERN(void) jinit_memory_mgr JPP((j_common_ptr cinfo));
+
+/* Utility routines in jutils.c */
+EXTERN(long) jdiv_round_up JPP((long a, long b));
+EXTERN(long) jround_up JPP((long a, long b));
+EXTERN(void) jcopy_sample_rows JPP((JSAMPARRAY input_array, int source_row,
+ JSAMPARRAY output_array, int dest_row,
+ int num_rows, JDIMENSION num_cols));
+EXTERN(void) jcopy_block_row JPP((JBLOCKROW input_row, JBLOCKROW output_row,
+ JDIMENSION num_blocks));
+EXTERN(void) jzero_far JPP((void FAR * target, size_t bytestozero));
+/* Constant tables in jutils.c */
+#if 0 /* This table is not actually needed in v6a */
+extern const int jpeg_zigzag_order[]; /* natural coef order to zigzag order */
+#endif
+extern const int jpeg_natural_order[]; /* zigzag coef order to natural order */
+
+/* Suppress undefined-structure complaints if necessary. */
+
+#ifdef INCOMPLETE_TYPES_BROKEN
+#ifndef AM_MEMORY_MANAGER /* only jmemmgr.c defines these */
+struct jvirt_sarray_control { long dummy; };
+struct jvirt_barray_control { long dummy; };
+#endif
+#endif /* INCOMPLETE_TYPES_BROKEN */
diff --git a/core/include/thirdparties/libjpeg/jpeglib.h b/core/include/thirdparties/libjpeg/jpeglib.h
index ac2aff90fd..7de5ab726e 100644
--- a/core/include/thirdparties/libjpeg/jpeglib.h
+++ b/core/include/thirdparties/libjpeg/jpeglib.h
@@ -1,1165 +1,1165 @@
-/*
- * jpeglib.h
- *
- * Copyright (C) 1991-1998, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- * For conditions of distribution and use, see the accompanying README file.
- *
- * This file defines the application interface for the JPEG library.
- * Most applications using the library need only include this file,
- * and perhaps jerror.h if they want to know the exact error codes.
- */
-
-#ifndef JPEGLIB_H
-#define JPEGLIB_H
-
-#define FOXIT_PREFIX(origName) FPDFAPIJPEG_##origName
-
-#define jcopy_block_row FOXIT_PREFIX(jcopy_block_row)
-#define jcopy_sample_rows FOXIT_PREFIX(jcopy_sample_rows)
-#define jdiv_round_up FOXIT_PREFIX(jdiv_round_up)
-#define jinit_1pass_quantizer FOXIT_PREFIX(jinit_1pass_quantizer)
-#define jinit_2pass_quantizer FOXIT_PREFIX(jinit_2pass_quantizer)
-#define jinit_color_deconverter FOXIT_PREFIX(jinit_color_deconverter)
-#define jinit_d_coef_controller FOXIT_PREFIX(jinit_d_coef_controller)
-#define jinit_d_main_controller FOXIT_PREFIX(jinit_d_main_controller)
-#define jinit_d_post_controller FOXIT_PREFIX(jinit_d_post_controller)
-#define jinit_huff_decoder FOXIT_PREFIX(jinit_huff_decoder)
-#define jinit_input_controller FOXIT_PREFIX(jinit_input_controller)
-#define jinit_inverse_dct FOXIT_PREFIX(jinit_inverse_dct)
-#define jinit_marker_reader FOXIT_PREFIX(jinit_marker_reader)
-#define jinit_master_decompress FOXIT_PREFIX(jinit_master_decompress)
-#define jinit_memory_mgr FOXIT_PREFIX(jinit_memory_mgr)
-#define jinit_merged_upsampler FOXIT_PREFIX(jinit_merged_upsampler)
-#define jinit_phuff_decoder FOXIT_PREFIX(jinit_phuff_decoder)
-#define jinit_upsampler FOXIT_PREFIX(jinit_upsampler)
-#define jpeg_CreateDecompress FOXIT_PREFIX(jpeg_CreateDecompress)
-#define jpeg_abort FOXIT_PREFIX(jpeg_abort)
-#define jpeg_abort_decompress FOXIT_PREFIX(jpeg_abort_decompress)
-#define jpeg_alloc_huff_table FOXIT_PREFIX(jpeg_alloc_huff_table)
-#define jpeg_alloc_quant_table FOXIT_PREFIX(jpeg_alloc_quant_table)
-#define jpeg_calc_output_dimensions FOXIT_PREFIX(jpeg_calc_output_dimensions)
-#define jpeg_consume_input FOXIT_PREFIX(jpeg_consume_input)
-#define jpeg_destroy FOXIT_PREFIX(jpeg_destroy)
-#define jpeg_destroy_decompress FOXIT_PREFIX(jpeg_destroy_decompress)
-#define jpeg_fill_bit_buffer FOXIT_PREFIX(jpeg_fill_bit_buffer)
-#define jpeg_finish_decompress FOXIT_PREFIX(jpeg_finish_decompress)
-#define jpeg_finish_output FOXIT_PREFIX(jpeg_finish_output)
-#define jpeg_free_large FOXIT_PREFIX(jpeg_free_large)
-#define jpeg_free_small FOXIT_PREFIX(jpeg_free_small)
-#define jpeg_get_large FOXIT_PREFIX(jpeg_get_large)
-#define jpeg_get_small FOXIT_PREFIX(jpeg_get_small)
-#define jpeg_has_multiple_scans FOXIT_PREFIX(jpeg_has_multiple_scans)
-#define jpeg_huff_decode FOXIT_PREFIX(jpeg_huff_decode)
-#define jpeg_idct_1x1 FOXIT_PREFIX(jpeg_idct_1x1)
-#define jpeg_idct_2x2 FOXIT_PREFIX(jpeg_idct_2x2)
-#define jpeg_idct_4x4 FOXIT_PREFIX(jpeg_idct_4x4)
-#define jpeg_idct_float FOXIT_PREFIX(jpeg_idct_float)
-#define jpeg_idct_ifast FOXIT_PREFIX(jpeg_idct_ifast)
-#define jpeg_idct_islow FOXIT_PREFIX(jpeg_idct_islow)
-#define jpeg_input_complete FOXIT_PREFIX(jpeg_input_complete)
-#define jpeg_make_d_derived_tbl FOXIT_PREFIX(jpeg_make_d_derived_tbl)
-#define jpeg_mem_available FOXIT_PREFIX(jpeg_mem_available)
-#define jpeg_mem_init FOXIT_PREFIX(jpeg_mem_init)
-#define jpeg_mem_term FOXIT_PREFIX(jpeg_mem_term)
-#define jpeg_natural_order FOXIT_PREFIX(jpeg_natural_order)
-#define jpeg_new_colormap FOXIT_PREFIX(jpeg_new_colormap)
-#define jpeg_open_backing_store FOXIT_PREFIX(jpeg_open_backing_store)
-#define jpeg_read_coefficients FOXIT_PREFIX(jpeg_read_coefficients)
-#define jpeg_read_header FOXIT_PREFIX(jpeg_read_header)
-#define jpeg_read_raw_data FOXIT_PREFIX(jpeg_read_raw_data)
-#define jpeg_read_scanlines FOXIT_PREFIX(jpeg_read_scanlines)
-#define jpeg_resync_to_restart FOXIT_PREFIX(jpeg_resync_to_restart)
-#define jpeg_save_markers FOXIT_PREFIX(jpeg_save_markers)
-#define jpeg_set_marker_processor FOXIT_PREFIX(jpeg_set_marker_processor)
-#define jpeg_start_decompress FOXIT_PREFIX(jpeg_start_decompress)
-#define jpeg_start_output FOXIT_PREFIX(jpeg_start_output)
-#define jpeg_std_error FOXIT_PREFIX(jpeg_std_error)
-#define jpeg_std_message_table FOXIT_PREFIX(jpeg_std_message_table)
-#define jpeg_stdio_src FOXIT_PREFIX(jpeg_stdio_src)
-#define jround_up FOXIT_PREFIX(jround_up)
-#define jzero_far FOXIT_PREFIX(jzero_far)
-
- /*
- * First we include the configuration files that record how this
- * installation of the JPEG library is set up. jconfig.h can be
- * generated automatically for many systems. jmorecfg.h contains
- * manual configuration options that most people need not worry about.
- */
-
-#ifndef JCONFIG_INCLUDED /* in case jinclude.h already did */
-#include "jconfig.h" /* widely used configuration options */
-#endif
-#include "jmorecfg.h" /* seldom changed options */
-
-
-/* Version ID for the JPEG library.
- * Might be useful for tests like "#if JPEG_LIB_VERSION >= 60".
- */
-
-#define JPEG_LIB_VERSION 62 /* Version 6b */
-
-
-/* Various constants determining the sizes of things.
- * All of these are specified by the JPEG standard, so don't change them
- * if you want to be compatible.
- */
-
-#define DCTSIZE 8 /* The basic DCT block is 8x8 samples */
-#define DCTSIZE2 64 /* DCTSIZE squared; # of elements in a block */
-#define NUM_QUANT_TBLS 4 /* Quantization tables are numbered 0..3 */
-#define NUM_HUFF_TBLS 4 /* Huffman tables are numbered 0..3 */
-#define NUM_ARITH_TBLS 16 /* Arith-coding tables are numbered 0..15 */
-#define MAX_COMPS_IN_SCAN 4 /* JPEG limit on # of components in one scan */
-#define MAX_SAMP_FACTOR 4 /* JPEG limit on sampling factors */
-/* Unfortunately, some bozo at Adobe saw no reason to be bound by the standard;
- * the PostScript DCT filter can emit files with many more than 10 blocks/MCU.
- * If you happen to run across such a file, you can up D_MAX_BLOCKS_IN_MCU
- * to handle it. We even let you do this from the jconfig.h file. However,
- * we strongly discourage changing C_MAX_BLOCKS_IN_MCU; just because Adobe
- * sometimes emits noncompliant files doesn't mean you should too.
- */
-#define C_MAX_BLOCKS_IN_MCU 10 /* compressor's limit on blocks per MCU */
-#ifndef D_MAX_BLOCKS_IN_MCU
-#define D_MAX_BLOCKS_IN_MCU 10 /* decompressor's limit on blocks per MCU */
-#endif
-
-
-/* Data structures for images (arrays of samples and of DCT coefficients).
- * On 80x86 machines, the image arrays are too big for near pointers,
- * but the pointer arrays can fit in near memory.
- */
-
-typedef JSAMPLE *JSAMPROW; /* ptr to one image row of pixel samples. */
-typedef JSAMPROW *JSAMPARRAY; /* ptr to some rows (a 2-D sample array) */
-typedef JSAMPARRAY *JSAMPIMAGE; /* a 3-D sample array: top index is color */
-
-typedef JCOEF JBLOCK[DCTSIZE2]; /* one block of coefficients */
-typedef JBLOCK *JBLOCKROW; /* pointer to one row of coefficient blocks */
-typedef JBLOCKROW *JBLOCKARRAY; /* a 2-D array of coefficient blocks */
-typedef JBLOCKARRAY *JBLOCKIMAGE; /* a 3-D array of coefficient blocks */
-
-typedef JCOEF *JCOEFPTR; /* useful in a couple of places */
-
-
-/* Types for JPEG compression parameters and working tables. */
-
-
-/* DCT coefficient quantization tables. */
-
-typedef struct {
- /* This array gives the coefficient quantizers in natural array order
- * (not the zigzag order in which they are stored in a JPEG DQT marker).
- * CAUTION: IJG versions prior to v6a kept this array in zigzag order.
- */
- UINT16 quantval[DCTSIZE2]; /* quantization step for each coefficient */
- /* This field is used only during compression. It's initialized FALSE when
- * the table is created, and set TRUE when it's been output to the file.
- * You could suppress output of a table by setting this to TRUE.
- * (See jpeg_suppress_tables for an example.)
- */
- boolean sent_table; /* TRUE when table has been output */
-} JQUANT_TBL;
-
-
-/* Huffman coding tables. */
-
-typedef struct {
- /* These two fields directly represent the contents of a JPEG DHT marker */
- UINT8 bits[17]; /* bits[k] = # of symbols with codes of */
- /* length k bits; bits[0] is unused */
- UINT8 huffval[256]; /* The symbols, in order of incr code length */
- /* This field is used only during compression. It's initialized FALSE when
- * the table is created, and set TRUE when it's been output to the file.
- * You could suppress output of a table by setting this to TRUE.
- * (See jpeg_suppress_tables for an example.)
- */
- boolean sent_table; /* TRUE when table has been output */
-} JHUFF_TBL;
-
-
-/* Basic info about one component (color channel). */
-
-typedef struct {
- /* These values are fixed over the whole image. */
- /* For compression, they must be supplied by parameter setup; */
- /* for decompression, they are read from the SOF marker. */
- int component_id; /* identifier for this component (0..255) */
- int component_index; /* its index in SOF or cinfo->comp_info[] */
- int h_samp_factor; /* horizontal sampling factor (1..4) */
- int v_samp_factor; /* vertical sampling factor (1..4) */
- int quant_tbl_no; /* quantization table selector (0..3) */
- /* These values may vary between scans. */
- /* For compression, they must be supplied by parameter setup; */
- /* for decompression, they are read from the SOS marker. */
- /* The decompressor output side may not use these variables. */
- int dc_tbl_no; /* DC entropy table selector (0..3) */
- int ac_tbl_no; /* AC entropy table selector (0..3) */
-
- /* Remaining fields should be treated as private by applications. */
-
- /* These values are computed during compression or decompression startup: */
- /* Component's size in DCT blocks.
- * Any dummy blocks added to complete an MCU are not counted; therefore
- * these values do not depend on whether a scan is interleaved or not.
- */
- JDIMENSION width_in_blocks;
- JDIMENSION height_in_blocks;
- /* Size of a DCT block in samples. Always DCTSIZE for compression.
- * For decompression this is the size of the output from one DCT block,
- * reflecting any scaling we choose to apply during the IDCT step.
- * Values of 1,2,4,8 are likely to be supported. Note that different
- * components may receive different IDCT scalings.
- */
- int DCT_scaled_size;
- /* The downsampled dimensions are the component's actual, unpadded number
- * of samples at the main buffer (preprocessing/compression interface), thus
- * downsampled_width = ceil(image_width * Hi/Hmax)
- * and similarly for height. For decompression, IDCT scaling is included, so
- * downsampled_width = ceil(image_width * Hi/Hmax * DCT_scaled_size/DCTSIZE)
- */
- JDIMENSION downsampled_width; /* actual width in samples */
- JDIMENSION downsampled_height; /* actual height in samples */
- /* This flag is used only for decompression. In cases where some of the
- * components will be ignored (eg grayscale output from YCbCr image),
- * we can skip most computations for the unused components.
- */
- boolean component_needed; /* do we need the value of this component? */
-
- /* These values are computed before starting a scan of the component. */
- /* The decompressor output side may not use these variables. */
- int MCU_width; /* number of blocks per MCU, horizontally */
- int MCU_height; /* number of blocks per MCU, vertically */
- int MCU_blocks; /* MCU_width * MCU_height */
- int MCU_sample_width; /* MCU width in samples, MCU_width*DCT_scaled_size */
- int last_col_width; /* # of non-dummy blocks across in last MCU */
- int last_row_height; /* # of non-dummy blocks down in last MCU */
-
- /* Saved quantization table for component; NULL if none yet saved.
- * See jdinput.c comments about the need for this information.
- * This field is currently used only for decompression.
- */
- JQUANT_TBL * quant_table;
-
- /* Private per-component storage for DCT or IDCT subsystem. */
- void * dct_table;
-} jpeg_component_info;
-
-
-/* The script for encoding a multiple-scan file is an array of these: */
-
-typedef struct {
- int comps_in_scan; /* number of components encoded in this scan */
- int component_index[MAX_COMPS_IN_SCAN]; /* their SOF/comp_info[] indexes */
- int Ss, Se; /* progressive JPEG spectral selection parms */
- int Ah, Al; /* progressive JPEG successive approx. parms */
-} jpeg_scan_info;
-
-/* The decompressor can save APPn and COM markers in a list of these: */
-
-typedef struct jpeg_marker_struct * jpeg_saved_marker_ptr;
-
-struct jpeg_marker_struct {
- jpeg_saved_marker_ptr next; /* next in list, or NULL */
- UINT8 marker; /* marker code: JPEG_COM, or JPEG_APP0+n */
- unsigned int original_length; /* # bytes of data in the file */
- unsigned int data_length; /* # bytes of data saved at data[] */
- JOCTET * data; /* the data contained in the marker */
- /* the marker length word is not counted in data_length or original_length */
-};
-
-/* Known color spaces. */
-
-typedef enum {
- JCS_UNKNOWN, /* error/unspecified */
- JCS_GRAYSCALE, /* monochrome */
- JCS_RGB, /* red/green/blue */
- JCS_YCbCr, /* Y/Cb/Cr (also known as YUV) */
- JCS_CMYK, /* C/M/Y/K */
- JCS_YCCK /* Y/Cb/Cr/K */
-} J_COLOR_SPACE;
-
-/* DCT/IDCT algorithm options. */
-
-typedef enum {
- JDCT_ISLOW, /* slow but accurate integer algorithm */
- JDCT_IFAST, /* faster, less accurate integer method */
- JDCT_FLOAT /* floating-point: accurate, fast on fast HW */
-} J_DCT_METHOD;
-
-#ifndef JDCT_DEFAULT /* may be overridden in jconfig.h */
-#define JDCT_DEFAULT JDCT_ISLOW
-#endif
-#ifndef JDCT_FASTEST /* may be overridden in jconfig.h */
-#define JDCT_FASTEST JDCT_IFAST
-#endif
-
-/* Dithering options for decompression. */
-
-typedef enum {
- JDITHER_NONE, /* no dithering */
- JDITHER_ORDERED, /* simple ordered dither */
- JDITHER_FS /* Floyd-Steinberg error diffusion dither */
-} J_DITHER_MODE;
-
-
-/* Common fields between JPEG compression and decompression master structs. */
-
-#define jpeg_common_fields \
- struct jpeg_error_mgr * err; /* Error handler module */\
- struct jpeg_memory_mgr * mem; /* Memory manager module */\
- struct jpeg_progress_mgr * progress; /* Progress monitor, or NULL if none */\
- void * client_data; /* Available for use by application */\
- boolean is_decompressor; /* So common code can tell which is which */\
- int global_state /* For checking call sequence validity */
-
-/* Routines that are to be used by both halves of the library are declared
- * to receive a pointer to this structure. There are no actual instances of
- * jpeg_common_struct, only of jpeg_compress_struct and jpeg_decompress_struct.
- */
-struct jpeg_common_struct {
- jpeg_common_fields; /* Fields common to both master struct types */
- /* Additional fields follow in an actual jpeg_compress_struct or
- * jpeg_decompress_struct. All three structs must agree on these
- * initial fields! (This would be a lot cleaner in C++.)
- */
-};
-
-typedef struct jpeg_common_struct * j_common_ptr;
-typedef struct jpeg_compress_struct * j_compress_ptr;
-typedef struct jpeg_decompress_struct * j_decompress_ptr;
-
-
-/* Master record for a compression instance */
-
-struct jpeg_compress_struct {
- jpeg_common_fields; /* Fields shared with jpeg_decompress_struct */
-
- /* Destination for compressed data */
- struct jpeg_destination_mgr * dest;
-
- /* Description of source image --- these fields must be filled in by
- * outer application before starting compression. in_color_space must
- * be correct before you can even call jpeg_set_defaults().
- */
-
- JDIMENSION image_width; /* input image width */
- JDIMENSION image_height; /* input image height */
- int input_components; /* # of color components in input image */
- J_COLOR_SPACE in_color_space; /* colorspace of input image */
-
- double input_gamma; /* image gamma of input image */
-
- /* Compression parameters --- these fields must be set before calling
- * jpeg_start_compress(). We recommend calling jpeg_set_defaults() to
- * initialize everything to reasonable defaults, then changing anything
- * the application specifically wants to change. That way you won't get
- * burnt when new parameters are added. Also note that there are several
- * helper routines to simplify changing parameters.
- */
-
- int data_precision; /* bits of precision in image data */
-
- int num_components; /* # of color components in JPEG image */
- J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */
-
- jpeg_component_info * comp_info;
- /* comp_info[i] describes component that appears i'th in SOF */
-
- JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS];
- /* ptrs to coefficient quantization tables, or NULL if not defined */
-
- JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS];
- JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS];
- /* ptrs to Huffman coding tables, or NULL if not defined */
-
- UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */
- UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */
- UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */
-
- int num_scans; /* # of entries in scan_info array */
- const jpeg_scan_info * scan_info; /* script for multi-scan file, or NULL */
- /* The default value of scan_info is NULL, which causes a single-scan
- * sequential JPEG file to be emitted. To create a multi-scan file,
- * set num_scans and scan_info to point to an array of scan definitions.
- */
-
- boolean raw_data_in; /* TRUE=caller supplies downsampled data */
- boolean arith_code; /* TRUE=arithmetic coding, FALSE=Huffman */
- boolean optimize_coding; /* TRUE=optimize entropy encoding parms */
- boolean CCIR601_sampling; /* TRUE=first samples are cosited */
- int smoothing_factor; /* 1..100, or 0 for no input smoothing */
- J_DCT_METHOD dct_method; /* DCT algorithm selector */
-
- /* The restart interval can be specified in absolute MCUs by setting
- * restart_interval, or in MCU rows by setting restart_in_rows
- * (in which case the correct restart_interval will be figured
- * for each scan).
- */
- unsigned int restart_interval; /* MCUs per restart, or 0 for no restart */
- int restart_in_rows; /* if > 0, MCU rows per restart interval */
-
- /* Parameters controlling emission of special markers. */
-
- boolean write_JFIF_header; /* should a JFIF marker be written? */
- UINT8 JFIF_major_version; /* What to write for the JFIF version number */
- UINT8 JFIF_minor_version;
- /* These three values are not used by the JPEG code, merely copied */
- /* into the JFIF APP0 marker. density_unit can be 0 for unknown, */
- /* 1 for dots/inch, or 2 for dots/cm. Note that the pixel aspect */
- /* ratio is defined by X_density/Y_density even when density_unit=0. */
- UINT8 density_unit; /* JFIF code for pixel size units */
- UINT16 X_density; /* Horizontal pixel density */
- UINT16 Y_density; /* Vertical pixel density */
- boolean write_Adobe_marker; /* should an Adobe marker be written? */
-
- /* State variable: index of next scanline to be written to
- * jpeg_write_scanlines(). Application may use this to control its
- * processing loop, e.g., "while (next_scanline < image_height)".
- */
-
- JDIMENSION next_scanline; /* 0 .. image_height-1 */
-
- /* Remaining fields are known throughout compressor, but generally
- * should not be touched by a surrounding application.
- */
-
- /*
- * These fields are computed during compression startup
- */
- boolean progressive_mode; /* TRUE if scan script uses progressive mode */
- int max_h_samp_factor; /* largest h_samp_factor */
- int max_v_samp_factor; /* largest v_samp_factor */
-
- JDIMENSION total_iMCU_rows; /* # of iMCU rows to be input to coef ctlr */
- /* The coefficient controller receives data in units of MCU rows as defined
- * for fully interleaved scans (whether the JPEG file is interleaved or not).
- * There are v_samp_factor * DCTSIZE sample rows of each component in an
- * "iMCU" (interleaved MCU) row.
- */
-
- /*
- * These fields are valid during any one scan.
- * They describe the components and MCUs actually appearing in the scan.
- */
- int comps_in_scan; /* # of JPEG components in this scan */
- jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN];
- /* *cur_comp_info[i] describes component that appears i'th in SOS */
-
- JDIMENSION MCUs_per_row; /* # of MCUs across the image */
- JDIMENSION MCU_rows_in_scan; /* # of MCU rows in the image */
-
- int blocks_in_MCU; /* # of DCT blocks per MCU */
- int MCU_membership[C_MAX_BLOCKS_IN_MCU];
- /* MCU_membership[i] is index in cur_comp_info of component owning */
- /* i'th block in an MCU */
-
- int Ss, Se, Ah, Al; /* progressive JPEG parameters for scan */
-
- /*
- * Links to compression subobjects (methods and private variables of modules)
- */
- struct jpeg_comp_master * master;
- struct jpeg_c_main_controller * main;
- struct jpeg_c_prep_controller * prep;
- struct jpeg_c_coef_controller * coef;
- struct jpeg_marker_writer * marker;
- struct jpeg_color_converter * cconvert;
- struct jpeg_downsampler * downsample;
- struct jpeg_forward_dct * fdct;
- struct jpeg_entropy_encoder * entropy;
- jpeg_scan_info * script_space; /* workspace for jpeg_simple_progression */
- int script_space_size;
-};
-
-
-/* Master record for a decompression instance */
-
-struct jpeg_decompress_struct {
- jpeg_common_fields; /* Fields shared with jpeg_compress_struct */
-
- /* Source of compressed data */
- struct jpeg_source_mgr * src;
-
- /* Basic description of image --- filled in by jpeg_read_header(). */
- /* Application may inspect these values to decide how to process image. */
-
- JDIMENSION image_width; /* nominal image width (from SOF marker) */
- JDIMENSION image_height; /* nominal image height */
- int num_components; /* # of color components in JPEG image */
- J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */
-
- /* Decompression processing parameters --- these fields must be set before
- * calling jpeg_start_decompress(). Note that jpeg_read_header() initializes
- * them to default values.
- */
-
- J_COLOR_SPACE out_color_space; /* colorspace for output */
-
- unsigned int scale_num, scale_denom; /* fraction by which to scale image */
-
- double output_gamma; /* image gamma wanted in output */
-
- boolean buffered_image; /* TRUE=multiple output passes */
- boolean raw_data_out; /* TRUE=downsampled data wanted */
-
- J_DCT_METHOD dct_method; /* IDCT algorithm selector */
- boolean do_fancy_upsampling; /* TRUE=apply fancy upsampling */
- boolean do_block_smoothing; /* TRUE=apply interblock smoothing */
-
- boolean quantize_colors; /* TRUE=colormapped output wanted */
- /* the following are ignored if not quantize_colors: */
- J_DITHER_MODE dither_mode; /* type of color dithering to use */
- boolean two_pass_quantize; /* TRUE=use two-pass color quantization */
- int desired_number_of_colors; /* max # colors to use in created colormap */
- /* these are significant only in buffered-image mode: */
- boolean enable_1pass_quant; /* enable future use of 1-pass quantizer */
- boolean enable_external_quant;/* enable future use of external colormap */
- boolean enable_2pass_quant; /* enable future use of 2-pass quantizer */
-
- /* Description of actual output image that will be returned to application.
- * These fields are computed by jpeg_start_decompress().
- * You can also use jpeg_calc_output_dimensions() to determine these values
- * in advance of calling jpeg_start_decompress().
- */
-
- JDIMENSION output_width; /* scaled image width */
- JDIMENSION output_height; /* scaled image height */
- int out_color_components; /* # of color components in out_color_space */
- int output_components; /* # of color components returned */
- /* output_components is 1 (a colormap index) when quantizing colors;
- * otherwise it equals out_color_components.
- */
- int rec_outbuf_height; /* min recommended height of scanline buffer */
- /* If the buffer passed to jpeg_read_scanlines() is less than this many rows
- * high, space and time will be wasted due to unnecessary data copying.
- * Usually rec_outbuf_height will be 1 or 2, at most 4.
- */
-
- /* When quantizing colors, the output colormap is described by these fields.
- * The application can supply a colormap by setting colormap non-NULL before
- * calling jpeg_start_decompress; otherwise a colormap is created during
- * jpeg_start_decompress or jpeg_start_output.
- * The map has out_color_components rows and actual_number_of_colors columns.
- */
- int actual_number_of_colors; /* number of entries in use */
- JSAMPARRAY colormap; /* The color map as a 2-D pixel array */
-
- /* State variables: these variables indicate the progress of decompression.
- * The application may examine these but must not modify them.
- */
-
- /* Row index of next scanline to be read from jpeg_read_scanlines().
- * Application may use this to control its processing loop, e.g.,
- * "while (output_scanline < output_height)".
- */
- JDIMENSION output_scanline; /* 0 .. output_height-1 */
-
- /* Current input scan number and number of iMCU rows completed in scan.
- * These indicate the progress of the decompressor input side.
- */
- int input_scan_number; /* Number of SOS markers seen so far */
- JDIMENSION input_iMCU_row; /* Number of iMCU rows completed */
-
- /* The "output scan number" is the notional scan being displayed by the
- * output side. The decompressor will not allow output scan/row number
- * to get ahead of input scan/row, but it can fall arbitrarily far behind.
- */
- int output_scan_number; /* Nominal scan number being displayed */
- JDIMENSION output_iMCU_row; /* Number of iMCU rows read */
-
- /* Current progression status. coef_bits[c][i] indicates the precision
- * with which component c's DCT coefficient i (in zigzag order) is known.
- * It is -1 when no data has yet been received, otherwise it is the point
- * transform (shift) value for the most recent scan of the coefficient
- * (thus, 0 at completion of the progression).
- * This pointer is NULL when reading a non-progressive file.
- */
- int (*coef_bits)[DCTSIZE2]; /* -1 or current Al value for each coef */
-
- /* Internal JPEG parameters --- the application usually need not look at
- * these fields. Note that the decompressor output side may not use
- * any parameters that can change between scans.
- */
-
- /* Quantization and Huffman tables are carried forward across input
- * datastreams when processing abbreviated JPEG datastreams.
- */
-
- JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS];
- /* ptrs to coefficient quantization tables, or NULL if not defined */
-
- JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS];
- JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS];
- /* ptrs to Huffman coding tables, or NULL if not defined */
-
- /* These parameters are never carried across datastreams, since they
- * are given in SOF/SOS markers or defined to be reset by SOI.
- */
-
- int data_precision; /* bits of precision in image data */
-
- jpeg_component_info * comp_info;
- /* comp_info[i] describes component that appears i'th in SOF */
-
- boolean progressive_mode; /* TRUE if SOFn specifies progressive mode */
- boolean arith_code; /* TRUE=arithmetic coding, FALSE=Huffman */
-
- UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */
- UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */
- UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */
-
- unsigned int restart_interval; /* MCUs per restart interval, or 0 for no restart */
-
- /* These fields record data obtained from optional markers recognized by
- * the JPEG library.
- */
- boolean saw_JFIF_marker; /* TRUE iff a JFIF APP0 marker was found */
- /* Data copied from JFIF marker; only valid if saw_JFIF_marker is TRUE: */
- UINT8 JFIF_major_version; /* JFIF version number */
- UINT8 JFIF_minor_version;
- UINT8 density_unit; /* JFIF code for pixel size units */
- UINT16 X_density; /* Horizontal pixel density */
- UINT16 Y_density; /* Vertical pixel density */
- boolean saw_Adobe_marker; /* TRUE iff an Adobe APP14 marker was found */
- UINT8 Adobe_transform; /* Color transform code from Adobe marker */
-
- boolean CCIR601_sampling; /* TRUE=first samples are cosited */
-
- /* Aside from the specific data retained from APPn markers known to the
- * library, the uninterpreted contents of any or all APPn and COM markers
- * can be saved in a list for examination by the application.
- */
- jpeg_saved_marker_ptr marker_list; /* Head of list of saved markers */
-
- /* Remaining fields are known throughout decompressor, but generally
- * should not be touched by a surrounding application.
- */
-
- /*
- * These fields are computed during decompression startup
- */
- int max_h_samp_factor; /* largest h_samp_factor */
- int max_v_samp_factor; /* largest v_samp_factor */
-
- int min_DCT_scaled_size; /* smallest DCT_scaled_size of any component */
-
- JDIMENSION total_iMCU_rows; /* # of iMCU rows in image */
- /* The coefficient controller's input and output progress is measured in
- * units of "iMCU" (interleaved MCU) rows. These are the same as MCU rows
- * in fully interleaved JPEG scans, but are used whether the scan is
- * interleaved or not. We define an iMCU row as v_samp_factor DCT block
- * rows of each component. Therefore, the IDCT output contains
- * v_samp_factor*DCT_scaled_size sample rows of a component per iMCU row.
- */
-
- JSAMPLE * sample_range_limit; /* table for fast range-limiting */
-
- /*
- * These fields are valid during any one scan.
- * They describe the components and MCUs actually appearing in the scan.
- * Note that the decompressor output side must not use these fields.
- */
- int comps_in_scan; /* # of JPEG components in this scan */
- jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN];
- /* *cur_comp_info[i] describes component that appears i'th in SOS */
-
- JDIMENSION MCUs_per_row; /* # of MCUs across the image */
- JDIMENSION MCU_rows_in_scan; /* # of MCU rows in the image */
-
- int blocks_in_MCU; /* # of DCT blocks per MCU */
- int MCU_membership[D_MAX_BLOCKS_IN_MCU];
- /* MCU_membership[i] is index in cur_comp_info of component owning */
- /* i'th block in an MCU */
-
- int Ss, Se, Ah, Al; /* progressive JPEG parameters for scan */
-
- /* This field is shared between entropy decoder and marker parser.
- * It is either zero or the code of a JPEG marker that has been
- * read from the data source, but has not yet been processed.
- */
- int unread_marker;
-
- /*
- * Links to decompression subobjects (methods, private variables of modules)
- */
- struct jpeg_decomp_master * master;
- struct jpeg_d_main_controller * main;
- struct jpeg_d_coef_controller * coef;
- struct jpeg_d_post_controller * post;
- struct jpeg_input_controller * inputctl;
- struct jpeg_marker_reader * marker;
- struct jpeg_entropy_decoder * entropy;
- struct jpeg_inverse_dct * idct;
- struct jpeg_upsampler * upsample;
- struct jpeg_color_deconverter * cconvert;
- struct jpeg_color_quantizer * cquantize;
-};
-
-
-/* "Object" declarations for JPEG modules that may be supplied or called
- * directly by the surrounding application.
- * As with all objects in the JPEG library, these structs only define the
- * publicly visible methods and state variables of a module. Additional
- * private fields may exist after the public ones.
- */
-
-
-/* Error handler object */
-
-struct jpeg_error_mgr {
- /* Error exit handler: does not return to caller */
- JMETHOD(void, error_exit, (j_common_ptr cinfo));
- /* Conditionally emit a trace or warning message */
- JMETHOD(void, emit_message, (j_common_ptr cinfo, int msg_level));
- /* Routine that actually outputs a trace or error message */
- JMETHOD(void, output_message, (j_common_ptr cinfo));
- /* Format a message string for the most recent JPEG error or message */
- JMETHOD(void, format_message, (j_common_ptr cinfo, char * buffer));
-#define JMSG_LENGTH_MAX 200 /* recommended size of format_message buffer */
- /* Reset error state variables at start of a new image */
- JMETHOD(void, reset_error_mgr, (j_common_ptr cinfo));
-
- /* The message ID code and any parameters are saved here.
- * A message can have one string parameter or up to 8 int parameters.
- */
- int msg_code;
-#define JMSG_STR_PARM_MAX 80
- union {
- int i[8];
- char s[JMSG_STR_PARM_MAX];
- } msg_parm;
-
- /* Standard state variables for error facility */
-
- int trace_level; /* max msg_level that will be displayed */
-
- /* For recoverable corrupt-data errors, we emit a warning message,
- * but keep going unless emit_message chooses to abort. emit_message
- * should count warnings in num_warnings. The surrounding application
- * can check for bad data by seeing if num_warnings is nonzero at the
- * end of processing.
- */
- long num_warnings; /* number of corrupt-data warnings */
-
- /* These fields point to the table(s) of error message strings.
- * An application can change the table pointer to switch to a different
- * message list (typically, to change the language in which errors are
- * reported). Some applications may wish to add additional error codes
- * that will be handled by the JPEG library error mechanism; the second
- * table pointer is used for this purpose.
- *
- * First table includes all errors generated by JPEG library itself.
- * Error code 0 is reserved for a "no such error string" message.
- */
- const char * const * jpeg_message_table; /* Library errors */
- int last_jpeg_message; /* Table contains strings 0..last_jpeg_message */
- /* Second table can be added by application (see cjpeg/djpeg for example).
- * It contains strings numbered first_addon_message..last_addon_message.
- */
- const char * const * addon_message_table; /* Non-library errors */
- int first_addon_message; /* code for first string in addon table */
- int last_addon_message; /* code for last string in addon table */
-};
-
-
-/* Progress monitor object */
-
-struct jpeg_progress_mgr {
- JMETHOD(void, progress_monitor, (j_common_ptr cinfo));
-
- long pass_counter; /* work units completed in this pass */
- long pass_limit; /* total number of work units in this pass */
- int completed_passes; /* passes completed so far */
- int total_passes; /* total number of passes expected */
-};
-
-
-/* Data destination object for compression */
-
-struct jpeg_destination_mgr {
- JOCTET * next_output_byte; /* => next byte to write in buffer */
- size_t free_in_buffer; /* # of byte spaces remaining in buffer */
-
- JMETHOD(void, init_destination, (j_compress_ptr cinfo));
- JMETHOD(boolean, empty_output_buffer, (j_compress_ptr cinfo));
- JMETHOD(void, term_destination, (j_compress_ptr cinfo));
-};
-
-
-/* Data source object for decompression */
-
-struct jpeg_source_mgr {
- const JOCTET * next_input_byte; /* => next byte to read from buffer */
- size_t bytes_in_buffer; /* # of bytes remaining in buffer */
-
- JMETHOD(void, init_source, (j_decompress_ptr cinfo));
- JMETHOD(boolean, fill_input_buffer, (j_decompress_ptr cinfo));
- JMETHOD(void, skip_input_data, (j_decompress_ptr cinfo, long num_bytes));
- JMETHOD(boolean, resync_to_restart, (j_decompress_ptr cinfo, int desired));
- JMETHOD(void, term_source, (j_decompress_ptr cinfo));
-};
-
-
-/* Memory manager object.
- * Allocates "small" objects (a few K total), "large" objects (tens of K),
- * and "really big" objects (virtual arrays with backing store if needed).
- * The memory manager does not allow individual objects to be freed; rather,
- * each created object is assigned to a pool, and whole pools can be freed
- * at once. This is faster and more convenient than remembering exactly what
- * to free, especially where malloc()/free() are not too speedy.
- * NB: alloc routines never return NULL. They exit to error_exit if not
- * successful.
- */
-
-#define JPOOL_PERMANENT 0 /* lasts until master record is destroyed */
-#define JPOOL_IMAGE 1 /* lasts until done with image/datastream */
-#define JPOOL_NUMPOOLS 2
-
-typedef struct jvirt_sarray_control * jvirt_sarray_ptr;
-typedef struct jvirt_barray_control * jvirt_barray_ptr;
-
-
-struct jpeg_memory_mgr {
- /* Method pointers */
- JMETHOD(void *, alloc_small, (j_common_ptr cinfo, int pool_id,
- size_t sizeofobject));
- JMETHOD(void *, alloc_large, (j_common_ptr cinfo, int pool_id,
- size_t sizeofobject));
- JMETHOD(JSAMPARRAY, alloc_sarray, (j_common_ptr cinfo, int pool_id,
- JDIMENSION samplesperrow,
- JDIMENSION numrows));
- JMETHOD(JBLOCKARRAY, alloc_barray, (j_common_ptr cinfo, int pool_id,
- JDIMENSION blocksperrow,
- JDIMENSION numrows));
- JMETHOD(jvirt_sarray_ptr, request_virt_sarray, (j_common_ptr cinfo,
- int pool_id,
- boolean pre_zero,
- JDIMENSION samplesperrow,
- JDIMENSION numrows,
- JDIMENSION maxaccess));
- JMETHOD(jvirt_barray_ptr, request_virt_barray, (j_common_ptr cinfo,
- int pool_id,
- boolean pre_zero,
- JDIMENSION blocksperrow,
- JDIMENSION numrows,
- JDIMENSION maxaccess));
- JMETHOD(void, realize_virt_arrays, (j_common_ptr cinfo));
- JMETHOD(JSAMPARRAY, access_virt_sarray, (j_common_ptr cinfo,
- jvirt_sarray_ptr ptr,
- JDIMENSION start_row,
- JDIMENSION num_rows,
- boolean writable));
- JMETHOD(JBLOCKARRAY, access_virt_barray, (j_common_ptr cinfo,
- jvirt_barray_ptr ptr,
- JDIMENSION start_row,
- JDIMENSION num_rows,
- boolean writable));
- JMETHOD(void, free_pool, (j_common_ptr cinfo, int pool_id));
- JMETHOD(void, self_destruct, (j_common_ptr cinfo));
-
- /* Limit on memory allocation for this JPEG object. (Note that this is
- * merely advisory, not a guaranteed maximum; it only affects the space
- * used for virtual-array buffers.) May be changed by outer application
- * after creating the JPEG object.
- */
- long max_memory_to_use;
-
- /* Maximum allocation request accepted by alloc_large. */
- long max_alloc_chunk;
-};
-
-
-/* Routine signature for application-supplied marker processing methods.
- * Need not pass marker code since it is stored in cinfo->unread_marker.
- */
-typedef JMETHOD(boolean, jpeg_marker_parser_method, (j_decompress_ptr cinfo));
-
-
-/* Declarations for routines called by application.
- * The JPP macro hides prototype parameters from compilers that can't cope.
- * Note JPP requires double parentheses.
- */
-
-#ifdef HAVE_PROTOTYPES
-#define JPP(arglist) arglist
-#else
-#define JPP(arglist) ()
-#endif
-
-
-/* Short forms of external names for systems with brain-damaged linkers.
- * We shorten external names to be unique in the first six letters, which
- * is good enough for all known systems.
- * (If your compiler itself needs names to be unique in less than 15
- * characters, you are out of luck. Get a better compiler.)
- */
-
-#ifdef NEED_SHORT_EXTERNAL_NAMES
-#define jpeg_std_error jStdError
-#define jpeg_CreateCompress jCreaCompress
-#define jpeg_CreateDecompress jCreaDecompress
-#define jpeg_destroy_compress jDestCompress
-#define jpeg_destroy_decompress jDestDecompress
-#define jpeg_stdio_dest jStdDest
-#define jpeg_stdio_src jStdSrc
-#define jpeg_set_defaults jSetDefaults
-#define jpeg_set_colorspace jSetColorspace
-#define jpeg_default_colorspace jDefColorspace
-#define jpeg_set_quality jSetQuality
-#define jpeg_set_linear_quality jSetLQuality
-#define jpeg_add_quant_table jAddQuantTable
-#define jpeg_quality_scaling jQualityScaling
-#define jpeg_simple_progression jSimProgress
-#define jpeg_suppress_tables jSuppressTables
-#define jpeg_alloc_quant_table jAlcQTable
-#define jpeg_alloc_huff_table jAlcHTable
-#define jpeg_start_compress jStrtCompress
-#define jpeg_write_scanlines jWrtScanlines
-#define jpeg_finish_compress jFinCompress
-#define jpeg_write_raw_data jWrtRawData
-#define jpeg_write_marker jWrtMarker
-#define jpeg_write_m_header jWrtMHeader
-#define jpeg_write_m_byte jWrtMByte
-#define jpeg_write_tables jWrtTables
-#define jpeg_read_header jReadHeader
-#define jpeg_start_decompress jStrtDecompress
-#define jpeg_read_scanlines jReadScanlines
-#define jpeg_finish_decompress jFinDecompress
-#define jpeg_read_raw_data jReadRawData
-#define jpeg_has_multiple_scans jHasMultScn
-#define jpeg_start_output jStrtOutput
-#define jpeg_finish_output jFinOutput
-#define jpeg_input_complete jInComplete
-#define jpeg_new_colormap jNewCMap
-#define jpeg_consume_input jConsumeInput
-#define jpeg_calc_output_dimensions jCalcDimensions
-#define jpeg_save_markers jSaveMarkers
-#define jpeg_set_marker_processor jSetMarker
-#define jpeg_read_coefficients jReadCoefs
-#define jpeg_write_coefficients jWrtCoefs
-#define jpeg_copy_critical_parameters jCopyCrit
-#define jpeg_abort_compress jAbrtCompress
-#define jpeg_abort_decompress jAbrtDecompress
-#define jpeg_abort jAbort
-#define jpeg_destroy jDestroy
-#define jpeg_resync_to_restart jResyncRestart
-#endif /* NEED_SHORT_EXTERNAL_NAMES */
-
-
-/* Default error-management setup */
-EXTERN(struct jpeg_error_mgr *) jpeg_std_error
- JPP((struct jpeg_error_mgr * err));
-
-/* Initialization of JPEG compression objects.
- * jpeg_create_compress() and jpeg_create_decompress() are the exported
- * names that applications should call. These expand to calls on
- * jpeg_CreateCompress and jpeg_CreateDecompress with additional information
- * passed for version mismatch checking.
- * NB: you must set up the error-manager BEFORE calling jpeg_create_xxx.
- */
-#define jpeg_create_compress(cinfo) \
- jpeg_CreateCompress((cinfo), JPEG_LIB_VERSION, \
- (size_t) sizeof(struct jpeg_compress_struct))
-#define jpeg_create_decompress(cinfo) \
- jpeg_CreateDecompress((cinfo), JPEG_LIB_VERSION, \
- (size_t) sizeof(struct jpeg_decompress_struct))
-EXTERN(void) jpeg_CreateCompress JPP((j_compress_ptr cinfo,
- int version, size_t structsize));
-EXTERN(void) jpeg_CreateDecompress JPP((j_decompress_ptr cinfo,
- int version, size_t structsize));
-/* Destruction of JPEG compression objects */
-EXTERN(void) jpeg_destroy_compress JPP((j_compress_ptr cinfo));
-EXTERN(void) jpeg_destroy_decompress JPP((j_decompress_ptr cinfo));
-
-#if 0
-/* Standard data source and destination managers: stdio streams. */
-/* Caller is responsible for opening the file before and closing after. */
-EXTERN(void) jpeg_stdio_dest JPP((j_compress_ptr cinfo, FXSYS_FILE * outfile));
-EXTERN(void) jpeg_stdio_src JPP((j_decompress_ptr cinfo, FXSYS_FILE * infile));
-#endif
-
-/* Default parameter setup for compression */
-EXTERN(void) jpeg_set_defaults JPP((j_compress_ptr cinfo));
-/* Compression parameter setup aids */
-EXTERN(void) jpeg_set_colorspace JPP((j_compress_ptr cinfo,
- J_COLOR_SPACE colorspace));
-EXTERN(void) jpeg_default_colorspace JPP((j_compress_ptr cinfo));
-EXTERN(void) jpeg_set_quality JPP((j_compress_ptr cinfo, int quality,
- boolean force_baseline));
-EXTERN(void) jpeg_set_linear_quality JPP((j_compress_ptr cinfo,
- int scale_factor,
- boolean force_baseline));
-EXTERN(void) jpeg_add_quant_table JPP((j_compress_ptr cinfo, int which_tbl,
- const unsigned int *basic_table,
- int scale_factor,
- boolean force_baseline));
-EXTERN(int) jpeg_quality_scaling JPP((int quality));
-EXTERN(void) jpeg_simple_progression JPP((j_compress_ptr cinfo));
-EXTERN(void) jpeg_suppress_tables JPP((j_compress_ptr cinfo,
- boolean suppress));
-EXTERN(JQUANT_TBL *) jpeg_alloc_quant_table JPP((j_common_ptr cinfo));
-EXTERN(JHUFF_TBL *) jpeg_alloc_huff_table JPP((j_common_ptr cinfo));
-
-/* Main entry points for compression */
-EXTERN(void) jpeg_start_compress JPP((j_compress_ptr cinfo,
- boolean write_all_tables));
-EXTERN(JDIMENSION) jpeg_write_scanlines JPP((j_compress_ptr cinfo,
- JSAMPARRAY scanlines,
- JDIMENSION num_lines));
-EXTERN(void) jpeg_finish_compress JPP((j_compress_ptr cinfo));
-
-/* Replaces jpeg_write_scanlines when writing raw downsampled data. */
-EXTERN(JDIMENSION) jpeg_write_raw_data JPP((j_compress_ptr cinfo,
- JSAMPIMAGE data,
- JDIMENSION num_lines));
-
-/* Write a special marker. See libjpeg.doc concerning safe usage. */
-EXTERN(void) jpeg_write_marker
- JPP((j_compress_ptr cinfo, int marker,
- const JOCTET * dataptr, unsigned int datalen));
-/* Same, but piecemeal. */
-EXTERN(void) jpeg_write_m_header
- JPP((j_compress_ptr cinfo, int marker, unsigned int datalen));
-EXTERN(void) jpeg_write_m_byte
- JPP((j_compress_ptr cinfo, int val));
-
-/* Alternate compression function: just write an abbreviated table file */
-EXTERN(void) jpeg_write_tables JPP((j_compress_ptr cinfo));
-
-/* Decompression startup: read start of JPEG datastream to see what's there */
-EXTERN(int) jpeg_read_header JPP((j_decompress_ptr cinfo,
- boolean require_image));
-/* Return value is one of: */
-#define JPEG_SUSPENDED 0 /* Suspended due to lack of input data */
-#define JPEG_HEADER_OK 1 /* Found valid image datastream */
-#define JPEG_HEADER_TABLES_ONLY 2 /* Found valid table-specs-only datastream */
-/* If you pass require_image = TRUE (normal case), you need not check for
- * a TABLES_ONLY return code; an abbreviated file will cause an error exit.
- * JPEG_SUSPENDED is only possible if you use a data source module that can
- * give a suspension return (the stdio source module doesn't).
- */
-
-/* Main entry points for decompression */
-EXTERN(boolean) jpeg_start_decompress JPP((j_decompress_ptr cinfo));
-EXTERN(JDIMENSION) jpeg_read_scanlines JPP((j_decompress_ptr cinfo,
- JSAMPARRAY scanlines,
- JDIMENSION max_lines));
-EXTERN(boolean) jpeg_finish_decompress JPP((j_decompress_ptr cinfo));
-
-/* Replaces jpeg_read_scanlines when reading raw downsampled data. */
-EXTERN(JDIMENSION) jpeg_read_raw_data JPP((j_decompress_ptr cinfo,
- JSAMPIMAGE data,
- JDIMENSION max_lines));
-
-/* Additional entry points for buffered-image mode. */
-EXTERN(boolean) jpeg_has_multiple_scans JPP((j_decompress_ptr cinfo));
-EXTERN(boolean) jpeg_start_output JPP((j_decompress_ptr cinfo,
- int scan_number));
-EXTERN(boolean) jpeg_finish_output JPP((j_decompress_ptr cinfo));
-EXTERN(boolean) jpeg_input_complete JPP((j_decompress_ptr cinfo));
-EXTERN(void) jpeg_new_colormap JPP((j_decompress_ptr cinfo));
-EXTERN(int) jpeg_consume_input JPP((j_decompress_ptr cinfo));
-/* Return value is one of: */
-/* #define JPEG_SUSPENDED 0 Suspended due to lack of input data */
-#define JPEG_REACHED_SOS 1 /* Reached start of new scan */
-#define JPEG_REACHED_EOI 2 /* Reached end of image */
-#define JPEG_ROW_COMPLETED 3 /* Completed one iMCU row */
-#define JPEG_SCAN_COMPLETED 4 /* Completed last iMCU row of a scan */
-
-/* Precalculate output dimensions for current decompression parameters. */
-EXTERN(void) jpeg_calc_output_dimensions JPP((j_decompress_ptr cinfo));
-
-/* Control saving of COM and APPn markers into marker_list. */
-EXTERN(void) jpeg_save_markers
- JPP((j_decompress_ptr cinfo, int marker_code,
- unsigned int length_limit));
-
-/* Install a special processing method for COM or APPn markers. */
-EXTERN(void) jpeg_set_marker_processor
- JPP((j_decompress_ptr cinfo, int marker_code,
- jpeg_marker_parser_method routine));
-
-/* Read or write raw DCT coefficients --- useful for lossless transcoding. */
-EXTERN(jvirt_barray_ptr *) jpeg_read_coefficients JPP((j_decompress_ptr cinfo));
-EXTERN(void) jpeg_write_coefficients JPP((j_compress_ptr cinfo,
- jvirt_barray_ptr * coef_arrays));
-EXTERN(void) jpeg_copy_critical_parameters JPP((j_decompress_ptr srcinfo,
- j_compress_ptr dstinfo));
-
-/* If you choose to abort compression or decompression before completing
- * jpeg_finish_(de)compress, then you need to clean up to release memory,
- * temporary files, etc. You can just call jpeg_destroy_(de)compress
- * if you're done with the JPEG object, but if you want to clean it up and
- * reuse it, call this:
- */
-EXTERN(void) jpeg_abort_compress JPP((j_compress_ptr cinfo));
-EXTERN(void) jpeg_abort_decompress JPP((j_decompress_ptr cinfo));
-
-/* Generic versions of jpeg_abort and jpeg_destroy that work on either
- * flavor of JPEG object. These may be more convenient in some places.
- */
-EXTERN(void) jpeg_abort JPP((j_common_ptr cinfo));
-EXTERN(void) jpeg_destroy JPP((j_common_ptr cinfo));
-
-/* Default restart-marker-resync procedure for use by data source modules */
-EXTERN(boolean) jpeg_resync_to_restart JPP((j_decompress_ptr cinfo,
- int desired));
-
-
-/* These marker codes are exported since applications and data source modules
- * are likely to want to use them.
- */
-
-#define JPEG_RST0 0xD0 /* RST0 marker code */
-#define JPEG_EOI 0xD9 /* EOI marker code */
-#define JPEG_APP0 0xE0 /* APP0 marker code */
-#define JPEG_COM 0xFE /* COM marker code */
-
-
-/* If we have a brain-damaged compiler that emits warnings (or worse, errors)
- * for structure definitions that are never filled in, keep it quiet by
- * supplying dummy definitions for the various substructures.
- */
-
-#ifdef INCOMPLETE_TYPES_BROKEN
-#ifndef JPEG_INTERNALS /* will be defined in jpegint.h */
-struct jvirt_sarray_control { long dummy; };
-struct jvirt_barray_control { long dummy; };
-struct jpeg_comp_master { long dummy; };
-struct jpeg_c_main_controller { long dummy; };
-struct jpeg_c_prep_controller { long dummy; };
-struct jpeg_c_coef_controller { long dummy; };
-struct jpeg_marker_writer { long dummy; };
-struct jpeg_color_converter { long dummy; };
-struct jpeg_downsampler { long dummy; };
-struct jpeg_forward_dct { long dummy; };
-struct jpeg_entropy_encoder { long dummy; };
-struct jpeg_decomp_master { long dummy; };
-struct jpeg_d_main_controller { long dummy; };
-struct jpeg_d_coef_controller { long dummy; };
-struct jpeg_d_post_controller { long dummy; };
-struct jpeg_input_controller { long dummy; };
-struct jpeg_marker_reader { long dummy; };
-struct jpeg_entropy_decoder { long dummy; };
-struct jpeg_inverse_dct { long dummy; };
-struct jpeg_upsampler { long dummy; };
-struct jpeg_color_deconverter { long dummy; };
-struct jpeg_color_quantizer { long dummy; };
-#endif /* JPEG_INTERNALS */
-#endif /* INCOMPLETE_TYPES_BROKEN */
-
-
-/*
- * The JPEG library modules define JPEG_INTERNALS before including this file.
- * The internal structure declarations are read only when that is true.
- * Applications using the library should not include jpegint.h, but may wish
- * to include jerror.h.
- */
-
-#ifdef JPEG_INTERNALS
-#include "jpegint.h" /* fetch private declarations */
-#include "jerror.h" /* fetch error codes too */
-#endif
-
-#endif /* JPEGLIB_H */
+/*
+ * jpeglib.h
+ *
+ * Copyright (C) 1991-1998, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file defines the application interface for the JPEG library.
+ * Most applications using the library need only include this file,
+ * and perhaps jerror.h if they want to know the exact error codes.
+ */
+
+#ifndef JPEGLIB_H
+#define JPEGLIB_H
+
+#define FOXIT_PREFIX(origName) FPDFAPIJPEG_##origName
+
+#define jcopy_block_row FOXIT_PREFIX(jcopy_block_row)
+#define jcopy_sample_rows FOXIT_PREFIX(jcopy_sample_rows)
+#define jdiv_round_up FOXIT_PREFIX(jdiv_round_up)
+#define jinit_1pass_quantizer FOXIT_PREFIX(jinit_1pass_quantizer)
+#define jinit_2pass_quantizer FOXIT_PREFIX(jinit_2pass_quantizer)
+#define jinit_color_deconverter FOXIT_PREFIX(jinit_color_deconverter)
+#define jinit_d_coef_controller FOXIT_PREFIX(jinit_d_coef_controller)
+#define jinit_d_main_controller FOXIT_PREFIX(jinit_d_main_controller)
+#define jinit_d_post_controller FOXIT_PREFIX(jinit_d_post_controller)
+#define jinit_huff_decoder FOXIT_PREFIX(jinit_huff_decoder)
+#define jinit_input_controller FOXIT_PREFIX(jinit_input_controller)
+#define jinit_inverse_dct FOXIT_PREFIX(jinit_inverse_dct)
+#define jinit_marker_reader FOXIT_PREFIX(jinit_marker_reader)
+#define jinit_master_decompress FOXIT_PREFIX(jinit_master_decompress)
+#define jinit_memory_mgr FOXIT_PREFIX(jinit_memory_mgr)
+#define jinit_merged_upsampler FOXIT_PREFIX(jinit_merged_upsampler)
+#define jinit_phuff_decoder FOXIT_PREFIX(jinit_phuff_decoder)
+#define jinit_upsampler FOXIT_PREFIX(jinit_upsampler)
+#define jpeg_CreateDecompress FOXIT_PREFIX(jpeg_CreateDecompress)
+#define jpeg_abort FOXIT_PREFIX(jpeg_abort)
+#define jpeg_abort_decompress FOXIT_PREFIX(jpeg_abort_decompress)
+#define jpeg_alloc_huff_table FOXIT_PREFIX(jpeg_alloc_huff_table)
+#define jpeg_alloc_quant_table FOXIT_PREFIX(jpeg_alloc_quant_table)
+#define jpeg_calc_output_dimensions FOXIT_PREFIX(jpeg_calc_output_dimensions)
+#define jpeg_consume_input FOXIT_PREFIX(jpeg_consume_input)
+#define jpeg_destroy FOXIT_PREFIX(jpeg_destroy)
+#define jpeg_destroy_decompress FOXIT_PREFIX(jpeg_destroy_decompress)
+#define jpeg_fill_bit_buffer FOXIT_PREFIX(jpeg_fill_bit_buffer)
+#define jpeg_finish_decompress FOXIT_PREFIX(jpeg_finish_decompress)
+#define jpeg_finish_output FOXIT_PREFIX(jpeg_finish_output)
+#define jpeg_free_large FOXIT_PREFIX(jpeg_free_large)
+#define jpeg_free_small FOXIT_PREFIX(jpeg_free_small)
+#define jpeg_get_large FOXIT_PREFIX(jpeg_get_large)
+#define jpeg_get_small FOXIT_PREFIX(jpeg_get_small)
+#define jpeg_has_multiple_scans FOXIT_PREFIX(jpeg_has_multiple_scans)
+#define jpeg_huff_decode FOXIT_PREFIX(jpeg_huff_decode)
+#define jpeg_idct_1x1 FOXIT_PREFIX(jpeg_idct_1x1)
+#define jpeg_idct_2x2 FOXIT_PREFIX(jpeg_idct_2x2)
+#define jpeg_idct_4x4 FOXIT_PREFIX(jpeg_idct_4x4)
+#define jpeg_idct_float FOXIT_PREFIX(jpeg_idct_float)
+#define jpeg_idct_ifast FOXIT_PREFIX(jpeg_idct_ifast)
+#define jpeg_idct_islow FOXIT_PREFIX(jpeg_idct_islow)
+#define jpeg_input_complete FOXIT_PREFIX(jpeg_input_complete)
+#define jpeg_make_d_derived_tbl FOXIT_PREFIX(jpeg_make_d_derived_tbl)
+#define jpeg_mem_available FOXIT_PREFIX(jpeg_mem_available)
+#define jpeg_mem_init FOXIT_PREFIX(jpeg_mem_init)
+#define jpeg_mem_term FOXIT_PREFIX(jpeg_mem_term)
+#define jpeg_natural_order FOXIT_PREFIX(jpeg_natural_order)
+#define jpeg_new_colormap FOXIT_PREFIX(jpeg_new_colormap)
+#define jpeg_open_backing_store FOXIT_PREFIX(jpeg_open_backing_store)
+#define jpeg_read_coefficients FOXIT_PREFIX(jpeg_read_coefficients)
+#define jpeg_read_header FOXIT_PREFIX(jpeg_read_header)
+#define jpeg_read_raw_data FOXIT_PREFIX(jpeg_read_raw_data)
+#define jpeg_read_scanlines FOXIT_PREFIX(jpeg_read_scanlines)
+#define jpeg_resync_to_restart FOXIT_PREFIX(jpeg_resync_to_restart)
+#define jpeg_save_markers FOXIT_PREFIX(jpeg_save_markers)
+#define jpeg_set_marker_processor FOXIT_PREFIX(jpeg_set_marker_processor)
+#define jpeg_start_decompress FOXIT_PREFIX(jpeg_start_decompress)
+#define jpeg_start_output FOXIT_PREFIX(jpeg_start_output)
+#define jpeg_std_error FOXIT_PREFIX(jpeg_std_error)
+#define jpeg_std_message_table FOXIT_PREFIX(jpeg_std_message_table)
+#define jpeg_stdio_src FOXIT_PREFIX(jpeg_stdio_src)
+#define jround_up FOXIT_PREFIX(jround_up)
+#define jzero_far FOXIT_PREFIX(jzero_far)
+
+ /*
+ * First we include the configuration files that record how this
+ * installation of the JPEG library is set up. jconfig.h can be
+ * generated automatically for many systems. jmorecfg.h contains
+ * manual configuration options that most people need not worry about.
+ */
+
+#ifndef JCONFIG_INCLUDED /* in case jinclude.h already did */
+#include "jconfig.h" /* widely used configuration options */
+#endif
+#include "jmorecfg.h" /* seldom changed options */
+
+
+/* Version ID for the JPEG library.
+ * Might be useful for tests like "#if JPEG_LIB_VERSION >= 60".
+ */
+
+#define JPEG_LIB_VERSION 62 /* Version 6b */
+
+
+/* Various constants determining the sizes of things.
+ * All of these are specified by the JPEG standard, so don't change them
+ * if you want to be compatible.
+ */
+
+#define DCTSIZE 8 /* The basic DCT block is 8x8 samples */
+#define DCTSIZE2 64 /* DCTSIZE squared; # of elements in a block */
+#define NUM_QUANT_TBLS 4 /* Quantization tables are numbered 0..3 */
+#define NUM_HUFF_TBLS 4 /* Huffman tables are numbered 0..3 */
+#define NUM_ARITH_TBLS 16 /* Arith-coding tables are numbered 0..15 */
+#define MAX_COMPS_IN_SCAN 4 /* JPEG limit on # of components in one scan */
+#define MAX_SAMP_FACTOR 4 /* JPEG limit on sampling factors */
+/* Unfortunately, some bozo at Adobe saw no reason to be bound by the standard;
+ * the PostScript DCT filter can emit files with many more than 10 blocks/MCU.
+ * If you happen to run across such a file, you can up D_MAX_BLOCKS_IN_MCU
+ * to handle it. We even let you do this from the jconfig.h file. However,
+ * we strongly discourage changing C_MAX_BLOCKS_IN_MCU; just because Adobe
+ * sometimes emits noncompliant files doesn't mean you should too.
+ */
+#define C_MAX_BLOCKS_IN_MCU 10 /* compressor's limit on blocks per MCU */
+#ifndef D_MAX_BLOCKS_IN_MCU
+#define D_MAX_BLOCKS_IN_MCU 10 /* decompressor's limit on blocks per MCU */
+#endif
+
+
+/* Data structures for images (arrays of samples and of DCT coefficients).
+ * On 80x86 machines, the image arrays are too big for near pointers,
+ * but the pointer arrays can fit in near memory.
+ */
+
+typedef JSAMPLE *JSAMPROW; /* ptr to one image row of pixel samples. */
+typedef JSAMPROW *JSAMPARRAY; /* ptr to some rows (a 2-D sample array) */
+typedef JSAMPARRAY *JSAMPIMAGE; /* a 3-D sample array: top index is color */
+
+typedef JCOEF JBLOCK[DCTSIZE2]; /* one block of coefficients */
+typedef JBLOCK *JBLOCKROW; /* pointer to one row of coefficient blocks */
+typedef JBLOCKROW *JBLOCKARRAY; /* a 2-D array of coefficient blocks */
+typedef JBLOCKARRAY *JBLOCKIMAGE; /* a 3-D array of coefficient blocks */
+
+typedef JCOEF *JCOEFPTR; /* useful in a couple of places */
+
+
+/* Types for JPEG compression parameters and working tables. */
+
+
+/* DCT coefficient quantization tables. */
+
+typedef struct {
+ /* This array gives the coefficient quantizers in natural array order
+ * (not the zigzag order in which they are stored in a JPEG DQT marker).
+ * CAUTION: IJG versions prior to v6a kept this array in zigzag order.
+ */
+ UINT16 quantval[DCTSIZE2]; /* quantization step for each coefficient */
+ /* This field is used only during compression. It's initialized FALSE when
+ * the table is created, and set TRUE when it's been output to the file.
+ * You could suppress output of a table by setting this to TRUE.
+ * (See jpeg_suppress_tables for an example.)
+ */
+ boolean sent_table; /* TRUE when table has been output */
+} JQUANT_TBL;
+
+
+/* Huffman coding tables. */
+
+typedef struct {
+ /* These two fields directly represent the contents of a JPEG DHT marker */
+ UINT8 bits[17]; /* bits[k] = # of symbols with codes of */
+ /* length k bits; bits[0] is unused */
+ UINT8 huffval[256]; /* The symbols, in order of incr code length */
+ /* This field is used only during compression. It's initialized FALSE when
+ * the table is created, and set TRUE when it's been output to the file.
+ * You could suppress output of a table by setting this to TRUE.
+ * (See jpeg_suppress_tables for an example.)
+ */
+ boolean sent_table; /* TRUE when table has been output */
+} JHUFF_TBL;
+
+
+/* Basic info about one component (color channel). */
+
+typedef struct {
+ /* These values are fixed over the whole image. */
+ /* For compression, they must be supplied by parameter setup; */
+ /* for decompression, they are read from the SOF marker. */
+ int component_id; /* identifier for this component (0..255) */
+ int component_index; /* its index in SOF or cinfo->comp_info[] */
+ int h_samp_factor; /* horizontal sampling factor (1..4) */
+ int v_samp_factor; /* vertical sampling factor (1..4) */
+ int quant_tbl_no; /* quantization table selector (0..3) */
+ /* These values may vary between scans. */
+ /* For compression, they must be supplied by parameter setup; */
+ /* for decompression, they are read from the SOS marker. */
+ /* The decompressor output side may not use these variables. */
+ int dc_tbl_no; /* DC entropy table selector (0..3) */
+ int ac_tbl_no; /* AC entropy table selector (0..3) */
+
+ /* Remaining fields should be treated as private by applications. */
+
+ /* These values are computed during compression or decompression startup: */
+ /* Component's size in DCT blocks.
+ * Any dummy blocks added to complete an MCU are not counted; therefore
+ * these values do not depend on whether a scan is interleaved or not.
+ */
+ JDIMENSION width_in_blocks;
+ JDIMENSION height_in_blocks;
+ /* Size of a DCT block in samples. Always DCTSIZE for compression.
+ * For decompression this is the size of the output from one DCT block,
+ * reflecting any scaling we choose to apply during the IDCT step.
+ * Values of 1,2,4,8 are likely to be supported. Note that different
+ * components may receive different IDCT scalings.
+ */
+ int DCT_scaled_size;
+ /* The downsampled dimensions are the component's actual, unpadded number
+ * of samples at the main buffer (preprocessing/compression interface), thus
+ * downsampled_width = ceil(image_width * Hi/Hmax)
+ * and similarly for height. For decompression, IDCT scaling is included, so
+ * downsampled_width = ceil(image_width * Hi/Hmax * DCT_scaled_size/DCTSIZE)
+ */
+ JDIMENSION downsampled_width; /* actual width in samples */
+ JDIMENSION downsampled_height; /* actual height in samples */
+ /* This flag is used only for decompression. In cases where some of the
+ * components will be ignored (eg grayscale output from YCbCr image),
+ * we can skip most computations for the unused components.
+ */
+ boolean component_needed; /* do we need the value of this component? */
+
+ /* These values are computed before starting a scan of the component. */
+ /* The decompressor output side may not use these variables. */
+ int MCU_width; /* number of blocks per MCU, horizontally */
+ int MCU_height; /* number of blocks per MCU, vertically */
+ int MCU_blocks; /* MCU_width * MCU_height */
+ int MCU_sample_width; /* MCU width in samples, MCU_width*DCT_scaled_size */
+ int last_col_width; /* # of non-dummy blocks across in last MCU */
+ int last_row_height; /* # of non-dummy blocks down in last MCU */
+
+ /* Saved quantization table for component; NULL if none yet saved.
+ * See jdinput.c comments about the need for this information.
+ * This field is currently used only for decompression.
+ */
+ JQUANT_TBL * quant_table;
+
+ /* Private per-component storage for DCT or IDCT subsystem. */
+ void * dct_table;
+} jpeg_component_info;
+
+
+/* The script for encoding a multiple-scan file is an array of these: */
+
+typedef struct {
+ int comps_in_scan; /* number of components encoded in this scan */
+ int component_index[MAX_COMPS_IN_SCAN]; /* their SOF/comp_info[] indexes */
+ int Ss, Se; /* progressive JPEG spectral selection parms */
+ int Ah, Al; /* progressive JPEG successive approx. parms */
+} jpeg_scan_info;
+
+/* The decompressor can save APPn and COM markers in a list of these: */
+
+typedef struct jpeg_marker_struct * jpeg_saved_marker_ptr;
+
+struct jpeg_marker_struct {
+ jpeg_saved_marker_ptr next; /* next in list, or NULL */
+ UINT8 marker; /* marker code: JPEG_COM, or JPEG_APP0+n */
+ unsigned int original_length; /* # bytes of data in the file */
+ unsigned int data_length; /* # bytes of data saved at data[] */
+ JOCTET * data; /* the data contained in the marker */
+ /* the marker length word is not counted in data_length or original_length */
+};
+
+/* Known color spaces. */
+
+typedef enum {
+ JCS_UNKNOWN, /* error/unspecified */
+ JCS_GRAYSCALE, /* monochrome */
+ JCS_RGB, /* red/green/blue */
+ JCS_YCbCr, /* Y/Cb/Cr (also known as YUV) */
+ JCS_CMYK, /* C/M/Y/K */
+ JCS_YCCK /* Y/Cb/Cr/K */
+} J_COLOR_SPACE;
+
+/* DCT/IDCT algorithm options. */
+
+typedef enum {
+ JDCT_ISLOW, /* slow but accurate integer algorithm */
+ JDCT_IFAST, /* faster, less accurate integer method */
+ JDCT_FLOAT /* floating-point: accurate, fast on fast HW */
+} J_DCT_METHOD;
+
+#ifndef JDCT_DEFAULT /* may be overridden in jconfig.h */
+#define JDCT_DEFAULT JDCT_ISLOW
+#endif
+#ifndef JDCT_FASTEST /* may be overridden in jconfig.h */
+#define JDCT_FASTEST JDCT_IFAST
+#endif
+
+/* Dithering options for decompression. */
+
+typedef enum {
+ JDITHER_NONE, /* no dithering */
+ JDITHER_ORDERED, /* simple ordered dither */
+ JDITHER_FS /* Floyd-Steinberg error diffusion dither */
+} J_DITHER_MODE;
+
+
+/* Common fields between JPEG compression and decompression master structs. */
+
+#define jpeg_common_fields \
+ struct jpeg_error_mgr * err; /* Error handler module */\
+ struct jpeg_memory_mgr * mem; /* Memory manager module */\
+ struct jpeg_progress_mgr * progress; /* Progress monitor, or NULL if none */\
+ void * client_data; /* Available for use by application */\
+ boolean is_decompressor; /* So common code can tell which is which */\
+ int global_state /* For checking call sequence validity */
+
+/* Routines that are to be used by both halves of the library are declared
+ * to receive a pointer to this structure. There are no actual instances of
+ * jpeg_common_struct, only of jpeg_compress_struct and jpeg_decompress_struct.
+ */
+struct jpeg_common_struct {
+ jpeg_common_fields; /* Fields common to both master struct types */
+ /* Additional fields follow in an actual jpeg_compress_struct or
+ * jpeg_decompress_struct. All three structs must agree on these
+ * initial fields! (This would be a lot cleaner in C++.)
+ */
+};
+
+typedef struct jpeg_common_struct * j_common_ptr;
+typedef struct jpeg_compress_struct * j_compress_ptr;
+typedef struct jpeg_decompress_struct * j_decompress_ptr;
+
+
+/* Master record for a compression instance */
+
+struct jpeg_compress_struct {
+ jpeg_common_fields; /* Fields shared with jpeg_decompress_struct */
+
+ /* Destination for compressed data */
+ struct jpeg_destination_mgr * dest;
+
+ /* Description of source image --- these fields must be filled in by
+ * outer application before starting compression. in_color_space must
+ * be correct before you can even call jpeg_set_defaults().
+ */
+
+ JDIMENSION image_width; /* input image width */
+ JDIMENSION image_height; /* input image height */
+ int input_components; /* # of color components in input image */
+ J_COLOR_SPACE in_color_space; /* colorspace of input image */
+
+ double input_gamma; /* image gamma of input image */
+
+ /* Compression parameters --- these fields must be set before calling
+ * jpeg_start_compress(). We recommend calling jpeg_set_defaults() to
+ * initialize everything to reasonable defaults, then changing anything
+ * the application specifically wants to change. That way you won't get
+ * burnt when new parameters are added. Also note that there are several
+ * helper routines to simplify changing parameters.
+ */
+
+ int data_precision; /* bits of precision in image data */
+
+ int num_components; /* # of color components in JPEG image */
+ J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */
+
+ jpeg_component_info * comp_info;
+ /* comp_info[i] describes component that appears i'th in SOF */
+
+ JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS];
+ /* ptrs to coefficient quantization tables, or NULL if not defined */
+
+ JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS];
+ JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS];
+ /* ptrs to Huffman coding tables, or NULL if not defined */
+
+ UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */
+ UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */
+ UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */
+
+ int num_scans; /* # of entries in scan_info array */
+ const jpeg_scan_info * scan_info; /* script for multi-scan file, or NULL */
+ /* The default value of scan_info is NULL, which causes a single-scan
+ * sequential JPEG file to be emitted. To create a multi-scan file,
+ * set num_scans and scan_info to point to an array of scan definitions.
+ */
+
+ boolean raw_data_in; /* TRUE=caller supplies downsampled data */
+ boolean arith_code; /* TRUE=arithmetic coding, FALSE=Huffman */
+ boolean optimize_coding; /* TRUE=optimize entropy encoding parms */
+ boolean CCIR601_sampling; /* TRUE=first samples are cosited */
+ int smoothing_factor; /* 1..100, or 0 for no input smoothing */
+ J_DCT_METHOD dct_method; /* DCT algorithm selector */
+
+ /* The restart interval can be specified in absolute MCUs by setting
+ * restart_interval, or in MCU rows by setting restart_in_rows
+ * (in which case the correct restart_interval will be figured
+ * for each scan).
+ */
+ unsigned int restart_interval; /* MCUs per restart, or 0 for no restart */
+ int restart_in_rows; /* if > 0, MCU rows per restart interval */
+
+ /* Parameters controlling emission of special markers. */
+
+ boolean write_JFIF_header; /* should a JFIF marker be written? */
+ UINT8 JFIF_major_version; /* What to write for the JFIF version number */
+ UINT8 JFIF_minor_version;
+ /* These three values are not used by the JPEG code, merely copied */
+ /* into the JFIF APP0 marker. density_unit can be 0 for unknown, */
+ /* 1 for dots/inch, or 2 for dots/cm. Note that the pixel aspect */
+ /* ratio is defined by X_density/Y_density even when density_unit=0. */
+ UINT8 density_unit; /* JFIF code for pixel size units */
+ UINT16 X_density; /* Horizontal pixel density */
+ UINT16 Y_density; /* Vertical pixel density */
+ boolean write_Adobe_marker; /* should an Adobe marker be written? */
+
+ /* State variable: index of next scanline to be written to
+ * jpeg_write_scanlines(). Application may use this to control its
+ * processing loop, e.g., "while (next_scanline < image_height)".
+ */
+
+ JDIMENSION next_scanline; /* 0 .. image_height-1 */
+
+ /* Remaining fields are known throughout compressor, but generally
+ * should not be touched by a surrounding application.
+ */
+
+ /*
+ * These fields are computed during compression startup
+ */
+ boolean progressive_mode; /* TRUE if scan script uses progressive mode */
+ int max_h_samp_factor; /* largest h_samp_factor */
+ int max_v_samp_factor; /* largest v_samp_factor */
+
+ JDIMENSION total_iMCU_rows; /* # of iMCU rows to be input to coef ctlr */
+ /* The coefficient controller receives data in units of MCU rows as defined
+ * for fully interleaved scans (whether the JPEG file is interleaved or not).
+ * There are v_samp_factor * DCTSIZE sample rows of each component in an
+ * "iMCU" (interleaved MCU) row.
+ */
+
+ /*
+ * These fields are valid during any one scan.
+ * They describe the components and MCUs actually appearing in the scan.
+ */
+ int comps_in_scan; /* # of JPEG components in this scan */
+ jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN];
+ /* *cur_comp_info[i] describes component that appears i'th in SOS */
+
+ JDIMENSION MCUs_per_row; /* # of MCUs across the image */
+ JDIMENSION MCU_rows_in_scan; /* # of MCU rows in the image */
+
+ int blocks_in_MCU; /* # of DCT blocks per MCU */
+ int MCU_membership[C_MAX_BLOCKS_IN_MCU];
+ /* MCU_membership[i] is index in cur_comp_info of component owning */
+ /* i'th block in an MCU */
+
+ int Ss, Se, Ah, Al; /* progressive JPEG parameters for scan */
+
+ /*
+ * Links to compression subobjects (methods and private variables of modules)
+ */
+ struct jpeg_comp_master * master;
+ struct jpeg_c_main_controller * main;
+ struct jpeg_c_prep_controller * prep;
+ struct jpeg_c_coef_controller * coef;
+ struct jpeg_marker_writer * marker;
+ struct jpeg_color_converter * cconvert;
+ struct jpeg_downsampler * downsample;
+ struct jpeg_forward_dct * fdct;
+ struct jpeg_entropy_encoder * entropy;
+ jpeg_scan_info * script_space; /* workspace for jpeg_simple_progression */
+ int script_space_size;
+};
+
+
+/* Master record for a decompression instance */
+
+struct jpeg_decompress_struct {
+ jpeg_common_fields; /* Fields shared with jpeg_compress_struct */
+
+ /* Source of compressed data */
+ struct jpeg_source_mgr * src;
+
+ /* Basic description of image --- filled in by jpeg_read_header(). */
+ /* Application may inspect these values to decide how to process image. */
+
+ JDIMENSION image_width; /* nominal image width (from SOF marker) */
+ JDIMENSION image_height; /* nominal image height */
+ int num_components; /* # of color components in JPEG image */
+ J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */
+
+ /* Decompression processing parameters --- these fields must be set before
+ * calling jpeg_start_decompress(). Note that jpeg_read_header() initializes
+ * them to default values.
+ */
+
+ J_COLOR_SPACE out_color_space; /* colorspace for output */
+
+ unsigned int scale_num, scale_denom; /* fraction by which to scale image */
+
+ double output_gamma; /* image gamma wanted in output */
+
+ boolean buffered_image; /* TRUE=multiple output passes */
+ boolean raw_data_out; /* TRUE=downsampled data wanted */
+
+ J_DCT_METHOD dct_method; /* IDCT algorithm selector */
+ boolean do_fancy_upsampling; /* TRUE=apply fancy upsampling */
+ boolean do_block_smoothing; /* TRUE=apply interblock smoothing */
+
+ boolean quantize_colors; /* TRUE=colormapped output wanted */
+ /* the following are ignored if not quantize_colors: */
+ J_DITHER_MODE dither_mode; /* type of color dithering to use */
+ boolean two_pass_quantize; /* TRUE=use two-pass color quantization */
+ int desired_number_of_colors; /* max # colors to use in created colormap */
+ /* these are significant only in buffered-image mode: */
+ boolean enable_1pass_quant; /* enable future use of 1-pass quantizer */
+ boolean enable_external_quant;/* enable future use of external colormap */
+ boolean enable_2pass_quant; /* enable future use of 2-pass quantizer */
+
+ /* Description of actual output image that will be returned to application.
+ * These fields are computed by jpeg_start_decompress().
+ * You can also use jpeg_calc_output_dimensions() to determine these values
+ * in advance of calling jpeg_start_decompress().
+ */
+
+ JDIMENSION output_width; /* scaled image width */
+ JDIMENSION output_height; /* scaled image height */
+ int out_color_components; /* # of color components in out_color_space */
+ int output_components; /* # of color components returned */
+ /* output_components is 1 (a colormap index) when quantizing colors;
+ * otherwise it equals out_color_components.
+ */
+ int rec_outbuf_height; /* min recommended height of scanline buffer */
+ /* If the buffer passed to jpeg_read_scanlines() is less than this many rows
+ * high, space and time will be wasted due to unnecessary data copying.
+ * Usually rec_outbuf_height will be 1 or 2, at most 4.
+ */
+
+ /* When quantizing colors, the output colormap is described by these fields.
+ * The application can supply a colormap by setting colormap non-NULL before
+ * calling jpeg_start_decompress; otherwise a colormap is created during
+ * jpeg_start_decompress or jpeg_start_output.
+ * The map has out_color_components rows and actual_number_of_colors columns.
+ */
+ int actual_number_of_colors; /* number of entries in use */
+ JSAMPARRAY colormap; /* The color map as a 2-D pixel array */
+
+ /* State variables: these variables indicate the progress of decompression.
+ * The application may examine these but must not modify them.
+ */
+
+ /* Row index of next scanline to be read from jpeg_read_scanlines().
+ * Application may use this to control its processing loop, e.g.,
+ * "while (output_scanline < output_height)".
+ */
+ JDIMENSION output_scanline; /* 0 .. output_height-1 */
+
+ /* Current input scan number and number of iMCU rows completed in scan.
+ * These indicate the progress of the decompressor input side.
+ */
+ int input_scan_number; /* Number of SOS markers seen so far */
+ JDIMENSION input_iMCU_row; /* Number of iMCU rows completed */
+
+ /* The "output scan number" is the notional scan being displayed by the
+ * output side. The decompressor will not allow output scan/row number
+ * to get ahead of input scan/row, but it can fall arbitrarily far behind.
+ */
+ int output_scan_number; /* Nominal scan number being displayed */
+ JDIMENSION output_iMCU_row; /* Number of iMCU rows read */
+
+ /* Current progression status. coef_bits[c][i] indicates the precision
+ * with which component c's DCT coefficient i (in zigzag order) is known.
+ * It is -1 when no data has yet been received, otherwise it is the point
+ * transform (shift) value for the most recent scan of the coefficient
+ * (thus, 0 at completion of the progression).
+ * This pointer is NULL when reading a non-progressive file.
+ */
+ int (*coef_bits)[DCTSIZE2]; /* -1 or current Al value for each coef */
+
+ /* Internal JPEG parameters --- the application usually need not look at
+ * these fields. Note that the decompressor output side may not use
+ * any parameters that can change between scans.
+ */
+
+ /* Quantization and Huffman tables are carried forward across input
+ * datastreams when processing abbreviated JPEG datastreams.
+ */
+
+ JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS];
+ /* ptrs to coefficient quantization tables, or NULL if not defined */
+
+ JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS];
+ JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS];
+ /* ptrs to Huffman coding tables, or NULL if not defined */
+
+ /* These parameters are never carried across datastreams, since they
+ * are given in SOF/SOS markers or defined to be reset by SOI.
+ */
+
+ int data_precision; /* bits of precision in image data */
+
+ jpeg_component_info * comp_info;
+ /* comp_info[i] describes component that appears i'th in SOF */
+
+ boolean progressive_mode; /* TRUE if SOFn specifies progressive mode */
+ boolean arith_code; /* TRUE=arithmetic coding, FALSE=Huffman */
+
+ UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */
+ UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */
+ UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */
+
+ unsigned int restart_interval; /* MCUs per restart interval, or 0 for no restart */
+
+ /* These fields record data obtained from optional markers recognized by
+ * the JPEG library.
+ */
+ boolean saw_JFIF_marker; /* TRUE iff a JFIF APP0 marker was found */
+ /* Data copied from JFIF marker; only valid if saw_JFIF_marker is TRUE: */
+ UINT8 JFIF_major_version; /* JFIF version number */
+ UINT8 JFIF_minor_version;
+ UINT8 density_unit; /* JFIF code for pixel size units */
+ UINT16 X_density; /* Horizontal pixel density */
+ UINT16 Y_density; /* Vertical pixel density */
+ boolean saw_Adobe_marker; /* TRUE iff an Adobe APP14 marker was found */
+ UINT8 Adobe_transform; /* Color transform code from Adobe marker */
+
+ boolean CCIR601_sampling; /* TRUE=first samples are cosited */
+
+ /* Aside from the specific data retained from APPn markers known to the
+ * library, the uninterpreted contents of any or all APPn and COM markers
+ * can be saved in a list for examination by the application.
+ */
+ jpeg_saved_marker_ptr marker_list; /* Head of list of saved markers */
+
+ /* Remaining fields are known throughout decompressor, but generally
+ * should not be touched by a surrounding application.
+ */
+
+ /*
+ * These fields are computed during decompression startup
+ */
+ int max_h_samp_factor; /* largest h_samp_factor */
+ int max_v_samp_factor; /* largest v_samp_factor */
+
+ int min_DCT_scaled_size; /* smallest DCT_scaled_size of any component */
+
+ JDIMENSION total_iMCU_rows; /* # of iMCU rows in image */
+ /* The coefficient controller's input and output progress is measured in
+ * units of "iMCU" (interleaved MCU) rows. These are the same as MCU rows
+ * in fully interleaved JPEG scans, but are used whether the scan is
+ * interleaved or not. We define an iMCU row as v_samp_factor DCT block
+ * rows of each component. Therefore, the IDCT output contains
+ * v_samp_factor*DCT_scaled_size sample rows of a component per iMCU row.
+ */
+
+ JSAMPLE * sample_range_limit; /* table for fast range-limiting */
+
+ /*
+ * These fields are valid during any one scan.
+ * They describe the components and MCUs actually appearing in the scan.
+ * Note that the decompressor output side must not use these fields.
+ */
+ int comps_in_scan; /* # of JPEG components in this scan */
+ jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN];
+ /* *cur_comp_info[i] describes component that appears i'th in SOS */
+
+ JDIMENSION MCUs_per_row; /* # of MCUs across the image */
+ JDIMENSION MCU_rows_in_scan; /* # of MCU rows in the image */
+
+ int blocks_in_MCU; /* # of DCT blocks per MCU */
+ int MCU_membership[D_MAX_BLOCKS_IN_MCU];
+ /* MCU_membership[i] is index in cur_comp_info of component owning */
+ /* i'th block in an MCU */
+
+ int Ss, Se, Ah, Al; /* progressive JPEG parameters for scan */
+
+ /* This field is shared between entropy decoder and marker parser.
+ * It is either zero or the code of a JPEG marker that has been
+ * read from the data source, but has not yet been processed.
+ */
+ int unread_marker;
+
+ /*
+ * Links to decompression subobjects (methods, private variables of modules)
+ */
+ struct jpeg_decomp_master * master;
+ struct jpeg_d_main_controller * main;
+ struct jpeg_d_coef_controller * coef;
+ struct jpeg_d_post_controller * post;
+ struct jpeg_input_controller * inputctl;
+ struct jpeg_marker_reader * marker;
+ struct jpeg_entropy_decoder * entropy;
+ struct jpeg_inverse_dct * idct;
+ struct jpeg_upsampler * upsample;
+ struct jpeg_color_deconverter * cconvert;
+ struct jpeg_color_quantizer * cquantize;
+};
+
+
+/* "Object" declarations for JPEG modules that may be supplied or called
+ * directly by the surrounding application.
+ * As with all objects in the JPEG library, these structs only define the
+ * publicly visible methods and state variables of a module. Additional
+ * private fields may exist after the public ones.
+ */
+
+
+/* Error handler object */
+
+struct jpeg_error_mgr {
+ /* Error exit handler: does not return to caller */
+ JMETHOD(void, error_exit, (j_common_ptr cinfo));
+ /* Conditionally emit a trace or warning message */
+ JMETHOD(void, emit_message, (j_common_ptr cinfo, int msg_level));
+ /* Routine that actually outputs a trace or error message */
+ JMETHOD(void, output_message, (j_common_ptr cinfo));
+ /* Format a message string for the most recent JPEG error or message */
+ JMETHOD(void, format_message, (j_common_ptr cinfo, char * buffer));
+#define JMSG_LENGTH_MAX 200 /* recommended size of format_message buffer */
+ /* Reset error state variables at start of a new image */
+ JMETHOD(void, reset_error_mgr, (j_common_ptr cinfo));
+
+ /* The message ID code and any parameters are saved here.
+ * A message can have one string parameter or up to 8 int parameters.
+ */
+ int msg_code;
+#define JMSG_STR_PARM_MAX 80
+ union {
+ int i[8];
+ char s[JMSG_STR_PARM_MAX];
+ } msg_parm;
+
+ /* Standard state variables for error facility */
+
+ int trace_level; /* max msg_level that will be displayed */
+
+ /* For recoverable corrupt-data errors, we emit a warning message,
+ * but keep going unless emit_message chooses to abort. emit_message
+ * should count warnings in num_warnings. The surrounding application
+ * can check for bad data by seeing if num_warnings is nonzero at the
+ * end of processing.
+ */
+ long num_warnings; /* number of corrupt-data warnings */
+
+ /* These fields point to the table(s) of error message strings.
+ * An application can change the table pointer to switch to a different
+ * message list (typically, to change the language in which errors are
+ * reported). Some applications may wish to add additional error codes
+ * that will be handled by the JPEG library error mechanism; the second
+ * table pointer is used for this purpose.
+ *
+ * First table includes all errors generated by JPEG library itself.
+ * Error code 0 is reserved for a "no such error string" message.
+ */
+ const char * const * jpeg_message_table; /* Library errors */
+ int last_jpeg_message; /* Table contains strings 0..last_jpeg_message */
+ /* Second table can be added by application (see cjpeg/djpeg for example).
+ * It contains strings numbered first_addon_message..last_addon_message.
+ */
+ const char * const * addon_message_table; /* Non-library errors */
+ int first_addon_message; /* code for first string in addon table */
+ int last_addon_message; /* code for last string in addon table */
+};
+
+
+/* Progress monitor object */
+
+struct jpeg_progress_mgr {
+ JMETHOD(void, progress_monitor, (j_common_ptr cinfo));
+
+ long pass_counter; /* work units completed in this pass */
+ long pass_limit; /* total number of work units in this pass */
+ int completed_passes; /* passes completed so far */
+ int total_passes; /* total number of passes expected */
+};
+
+
+/* Data destination object for compression */
+
+struct jpeg_destination_mgr {
+ JOCTET * next_output_byte; /* => next byte to write in buffer */
+ size_t free_in_buffer; /* # of byte spaces remaining in buffer */
+
+ JMETHOD(void, init_destination, (j_compress_ptr cinfo));
+ JMETHOD(boolean, empty_output_buffer, (j_compress_ptr cinfo));
+ JMETHOD(void, term_destination, (j_compress_ptr cinfo));
+};
+
+
+/* Data source object for decompression */
+
+struct jpeg_source_mgr {
+ const JOCTET * next_input_byte; /* => next byte to read from buffer */
+ size_t bytes_in_buffer; /* # of bytes remaining in buffer */
+
+ JMETHOD(void, init_source, (j_decompress_ptr cinfo));
+ JMETHOD(boolean, fill_input_buffer, (j_decompress_ptr cinfo));
+ JMETHOD(void, skip_input_data, (j_decompress_ptr cinfo, long num_bytes));
+ JMETHOD(boolean, resync_to_restart, (j_decompress_ptr cinfo, int desired));
+ JMETHOD(void, term_source, (j_decompress_ptr cinfo));
+};
+
+
+/* Memory manager object.
+ * Allocates "small" objects (a few K total), "large" objects (tens of K),
+ * and "really big" objects (virtual arrays with backing store if needed).
+ * The memory manager does not allow individual objects to be freed; rather,
+ * each created object is assigned to a pool, and whole pools can be freed
+ * at once. This is faster and more convenient than remembering exactly what
+ * to free, especially where malloc()/free() are not too speedy.
+ * NB: alloc routines never return NULL. They exit to error_exit if not
+ * successful.
+ */
+
+#define JPOOL_PERMANENT 0 /* lasts until master record is destroyed */
+#define JPOOL_IMAGE 1 /* lasts until done with image/datastream */
+#define JPOOL_NUMPOOLS 2
+
+typedef struct jvirt_sarray_control * jvirt_sarray_ptr;
+typedef struct jvirt_barray_control * jvirt_barray_ptr;
+
+
+struct jpeg_memory_mgr {
+ /* Method pointers */
+ JMETHOD(void *, alloc_small, (j_common_ptr cinfo, int pool_id,
+ size_t sizeofobject));
+ JMETHOD(void *, alloc_large, (j_common_ptr cinfo, int pool_id,
+ size_t sizeofobject));
+ JMETHOD(JSAMPARRAY, alloc_sarray, (j_common_ptr cinfo, int pool_id,
+ JDIMENSION samplesperrow,
+ JDIMENSION numrows));
+ JMETHOD(JBLOCKARRAY, alloc_barray, (j_common_ptr cinfo, int pool_id,
+ JDIMENSION blocksperrow,
+ JDIMENSION numrows));
+ JMETHOD(jvirt_sarray_ptr, request_virt_sarray, (j_common_ptr cinfo,
+ int pool_id,
+ boolean pre_zero,
+ JDIMENSION samplesperrow,
+ JDIMENSION numrows,
+ JDIMENSION maxaccess));
+ JMETHOD(jvirt_barray_ptr, request_virt_barray, (j_common_ptr cinfo,
+ int pool_id,
+ boolean pre_zero,
+ JDIMENSION blocksperrow,
+ JDIMENSION numrows,
+ JDIMENSION maxaccess));
+ JMETHOD(void, realize_virt_arrays, (j_common_ptr cinfo));
+ JMETHOD(JSAMPARRAY, access_virt_sarray, (j_common_ptr cinfo,
+ jvirt_sarray_ptr ptr,
+ JDIMENSION start_row,
+ JDIMENSION num_rows,
+ boolean writable));
+ JMETHOD(JBLOCKARRAY, access_virt_barray, (j_common_ptr cinfo,
+ jvirt_barray_ptr ptr,
+ JDIMENSION start_row,
+ JDIMENSION num_rows,
+ boolean writable));
+ JMETHOD(void, free_pool, (j_common_ptr cinfo, int pool_id));
+ JMETHOD(void, self_destruct, (j_common_ptr cinfo));
+
+ /* Limit on memory allocation for this JPEG object. (Note that this is
+ * merely advisory, not a guaranteed maximum; it only affects the space
+ * used for virtual-array buffers.) May be changed by outer application
+ * after creating the JPEG object.
+ */
+ long max_memory_to_use;
+
+ /* Maximum allocation request accepted by alloc_large. */
+ long max_alloc_chunk;
+};
+
+
+/* Routine signature for application-supplied marker processing methods.
+ * Need not pass marker code since it is stored in cinfo->unread_marker.
+ */
+typedef JMETHOD(boolean, jpeg_marker_parser_method, (j_decompress_ptr cinfo));
+
+
+/* Declarations for routines called by application.
+ * The JPP macro hides prototype parameters from compilers that can't cope.
+ * Note JPP requires double parentheses.
+ */
+
+#ifdef HAVE_PROTOTYPES
+#define JPP(arglist) arglist
+#else
+#define JPP(arglist) ()
+#endif
+
+
+/* Short forms of external names for systems with brain-damaged linkers.
+ * We shorten external names to be unique in the first six letters, which
+ * is good enough for all known systems.
+ * (If your compiler itself needs names to be unique in less than 15
+ * characters, you are out of luck. Get a better compiler.)
+ */
+
+#ifdef NEED_SHORT_EXTERNAL_NAMES
+#define jpeg_std_error jStdError
+#define jpeg_CreateCompress jCreaCompress
+#define jpeg_CreateDecompress jCreaDecompress
+#define jpeg_destroy_compress jDestCompress
+#define jpeg_destroy_decompress jDestDecompress
+#define jpeg_stdio_dest jStdDest
+#define jpeg_stdio_src jStdSrc
+#define jpeg_set_defaults jSetDefaults
+#define jpeg_set_colorspace jSetColorspace
+#define jpeg_default_colorspace jDefColorspace
+#define jpeg_set_quality jSetQuality
+#define jpeg_set_linear_quality jSetLQuality
+#define jpeg_add_quant_table jAddQuantTable
+#define jpeg_quality_scaling jQualityScaling
+#define jpeg_simple_progression jSimProgress
+#define jpeg_suppress_tables jSuppressTables
+#define jpeg_alloc_quant_table jAlcQTable
+#define jpeg_alloc_huff_table jAlcHTable
+#define jpeg_start_compress jStrtCompress
+#define jpeg_write_scanlines jWrtScanlines
+#define jpeg_finish_compress jFinCompress
+#define jpeg_write_raw_data jWrtRawData
+#define jpeg_write_marker jWrtMarker
+#define jpeg_write_m_header jWrtMHeader
+#define jpeg_write_m_byte jWrtMByte
+#define jpeg_write_tables jWrtTables
+#define jpeg_read_header jReadHeader
+#define jpeg_start_decompress jStrtDecompress
+#define jpeg_read_scanlines jReadScanlines
+#define jpeg_finish_decompress jFinDecompress
+#define jpeg_read_raw_data jReadRawData
+#define jpeg_has_multiple_scans jHasMultScn
+#define jpeg_start_output jStrtOutput
+#define jpeg_finish_output jFinOutput
+#define jpeg_input_complete jInComplete
+#define jpeg_new_colormap jNewCMap
+#define jpeg_consume_input jConsumeInput
+#define jpeg_calc_output_dimensions jCalcDimensions
+#define jpeg_save_markers jSaveMarkers
+#define jpeg_set_marker_processor jSetMarker
+#define jpeg_read_coefficients jReadCoefs
+#define jpeg_write_coefficients jWrtCoefs
+#define jpeg_copy_critical_parameters jCopyCrit
+#define jpeg_abort_compress jAbrtCompress
+#define jpeg_abort_decompress jAbrtDecompress
+#define jpeg_abort jAbort
+#define jpeg_destroy jDestroy
+#define jpeg_resync_to_restart jResyncRestart
+#endif /* NEED_SHORT_EXTERNAL_NAMES */
+
+
+/* Default error-management setup */
+EXTERN(struct jpeg_error_mgr *) jpeg_std_error
+ JPP((struct jpeg_error_mgr * err));
+
+/* Initialization of JPEG compression objects.
+ * jpeg_create_compress() and jpeg_create_decompress() are the exported
+ * names that applications should call. These expand to calls on
+ * jpeg_CreateCompress and jpeg_CreateDecompress with additional information
+ * passed for version mismatch checking.
+ * NB: you must set up the error-manager BEFORE calling jpeg_create_xxx.
+ */
+#define jpeg_create_compress(cinfo) \
+ jpeg_CreateCompress((cinfo), JPEG_LIB_VERSION, \
+ (size_t) sizeof(struct jpeg_compress_struct))
+#define jpeg_create_decompress(cinfo) \
+ jpeg_CreateDecompress((cinfo), JPEG_LIB_VERSION, \
+ (size_t) sizeof(struct jpeg_decompress_struct))
+EXTERN(void) jpeg_CreateCompress JPP((j_compress_ptr cinfo,
+ int version, size_t structsize));
+EXTERN(void) jpeg_CreateDecompress JPP((j_decompress_ptr cinfo,
+ int version, size_t structsize));
+/* Destruction of JPEG compression objects */
+EXTERN(void) jpeg_destroy_compress JPP((j_compress_ptr cinfo));
+EXTERN(void) jpeg_destroy_decompress JPP((j_decompress_ptr cinfo));
+
+#if 0
+/* Standard data source and destination managers: stdio streams. */
+/* Caller is responsible for opening the file before and closing after. */
+EXTERN(void) jpeg_stdio_dest JPP((j_compress_ptr cinfo, FXSYS_FILE * outfile));
+EXTERN(void) jpeg_stdio_src JPP((j_decompress_ptr cinfo, FXSYS_FILE * infile));
+#endif
+
+/* Default parameter setup for compression */
+EXTERN(void) jpeg_set_defaults JPP((j_compress_ptr cinfo));
+/* Compression parameter setup aids */
+EXTERN(void) jpeg_set_colorspace JPP((j_compress_ptr cinfo,
+ J_COLOR_SPACE colorspace));
+EXTERN(void) jpeg_default_colorspace JPP((j_compress_ptr cinfo));
+EXTERN(void) jpeg_set_quality JPP((j_compress_ptr cinfo, int quality,
+ boolean force_baseline));
+EXTERN(void) jpeg_set_linear_quality JPP((j_compress_ptr cinfo,
+ int scale_factor,
+ boolean force_baseline));
+EXTERN(void) jpeg_add_quant_table JPP((j_compress_ptr cinfo, int which_tbl,
+ const unsigned int *basic_table,
+ int scale_factor,
+ boolean force_baseline));
+EXTERN(int) jpeg_quality_scaling JPP((int quality));
+EXTERN(void) jpeg_simple_progression JPP((j_compress_ptr cinfo));
+EXTERN(void) jpeg_suppress_tables JPP((j_compress_ptr cinfo,
+ boolean suppress));
+EXTERN(JQUANT_TBL *) jpeg_alloc_quant_table JPP((j_common_ptr cinfo));
+EXTERN(JHUFF_TBL *) jpeg_alloc_huff_table JPP((j_common_ptr cinfo));
+
+/* Main entry points for compression */
+EXTERN(void) jpeg_start_compress JPP((j_compress_ptr cinfo,
+ boolean write_all_tables));
+EXTERN(JDIMENSION) jpeg_write_scanlines JPP((j_compress_ptr cinfo,
+ JSAMPARRAY scanlines,
+ JDIMENSION num_lines));
+EXTERN(void) jpeg_finish_compress JPP((j_compress_ptr cinfo));
+
+/* Replaces jpeg_write_scanlines when writing raw downsampled data. */
+EXTERN(JDIMENSION) jpeg_write_raw_data JPP((j_compress_ptr cinfo,
+ JSAMPIMAGE data,
+ JDIMENSION num_lines));
+
+/* Write a special marker. See libjpeg.doc concerning safe usage. */
+EXTERN(void) jpeg_write_marker
+ JPP((j_compress_ptr cinfo, int marker,
+ const JOCTET * dataptr, unsigned int datalen));
+/* Same, but piecemeal. */
+EXTERN(void) jpeg_write_m_header
+ JPP((j_compress_ptr cinfo, int marker, unsigned int datalen));
+EXTERN(void) jpeg_write_m_byte
+ JPP((j_compress_ptr cinfo, int val));
+
+/* Alternate compression function: just write an abbreviated table file */
+EXTERN(void) jpeg_write_tables JPP((j_compress_ptr cinfo));
+
+/* Decompression startup: read start of JPEG datastream to see what's there */
+EXTERN(int) jpeg_read_header JPP((j_decompress_ptr cinfo,
+ boolean require_image));
+/* Return value is one of: */
+#define JPEG_SUSPENDED 0 /* Suspended due to lack of input data */
+#define JPEG_HEADER_OK 1 /* Found valid image datastream */
+#define JPEG_HEADER_TABLES_ONLY 2 /* Found valid table-specs-only datastream */
+/* If you pass require_image = TRUE (normal case), you need not check for
+ * a TABLES_ONLY return code; an abbreviated file will cause an error exit.
+ * JPEG_SUSPENDED is only possible if you use a data source module that can
+ * give a suspension return (the stdio source module doesn't).
+ */
+
+/* Main entry points for decompression */
+EXTERN(boolean) jpeg_start_decompress JPP((j_decompress_ptr cinfo));
+EXTERN(JDIMENSION) jpeg_read_scanlines JPP((j_decompress_ptr cinfo,
+ JSAMPARRAY scanlines,
+ JDIMENSION max_lines));
+EXTERN(boolean) jpeg_finish_decompress JPP((j_decompress_ptr cinfo));
+
+/* Replaces jpeg_read_scanlines when reading raw downsampled data. */
+EXTERN(JDIMENSION) jpeg_read_raw_data JPP((j_decompress_ptr cinfo,
+ JSAMPIMAGE data,
+ JDIMENSION max_lines));
+
+/* Additional entry points for buffered-image mode. */
+EXTERN(boolean) jpeg_has_multiple_scans JPP((j_decompress_ptr cinfo));
+EXTERN(boolean) jpeg_start_output JPP((j_decompress_ptr cinfo,
+ int scan_number));
+EXTERN(boolean) jpeg_finish_output JPP((j_decompress_ptr cinfo));
+EXTERN(boolean) jpeg_input_complete JPP((j_decompress_ptr cinfo));
+EXTERN(void) jpeg_new_colormap JPP((j_decompress_ptr cinfo));
+EXTERN(int) jpeg_consume_input JPP((j_decompress_ptr cinfo));
+/* Return value is one of: */
+/* #define JPEG_SUSPENDED 0 Suspended due to lack of input data */
+#define JPEG_REACHED_SOS 1 /* Reached start of new scan */
+#define JPEG_REACHED_EOI 2 /* Reached end of image */
+#define JPEG_ROW_COMPLETED 3 /* Completed one iMCU row */
+#define JPEG_SCAN_COMPLETED 4 /* Completed last iMCU row of a scan */
+
+/* Precalculate output dimensions for current decompression parameters. */
+EXTERN(void) jpeg_calc_output_dimensions JPP((j_decompress_ptr cinfo));
+
+/* Control saving of COM and APPn markers into marker_list. */
+EXTERN(void) jpeg_save_markers
+ JPP((j_decompress_ptr cinfo, int marker_code,
+ unsigned int length_limit));
+
+/* Install a special processing method for COM or APPn markers. */
+EXTERN(void) jpeg_set_marker_processor
+ JPP((j_decompress_ptr cinfo, int marker_code,
+ jpeg_marker_parser_method routine));
+
+/* Read or write raw DCT coefficients --- useful for lossless transcoding. */
+EXTERN(jvirt_barray_ptr *) jpeg_read_coefficients JPP((j_decompress_ptr cinfo));
+EXTERN(void) jpeg_write_coefficients JPP((j_compress_ptr cinfo,
+ jvirt_barray_ptr * coef_arrays));
+EXTERN(void) jpeg_copy_critical_parameters JPP((j_decompress_ptr srcinfo,
+ j_compress_ptr dstinfo));
+
+/* If you choose to abort compression or decompression before completing
+ * jpeg_finish_(de)compress, then you need to clean up to release memory,
+ * temporary files, etc. You can just call jpeg_destroy_(de)compress
+ * if you're done with the JPEG object, but if you want to clean it up and
+ * reuse it, call this:
+ */
+EXTERN(void) jpeg_abort_compress JPP((j_compress_ptr cinfo));
+EXTERN(void) jpeg_abort_decompress JPP((j_decompress_ptr cinfo));
+
+/* Generic versions of jpeg_abort and jpeg_destroy that work on either
+ * flavor of JPEG object. These may be more convenient in some places.
+ */
+EXTERN(void) jpeg_abort JPP((j_common_ptr cinfo));
+EXTERN(void) jpeg_destroy JPP((j_common_ptr cinfo));
+
+/* Default restart-marker-resync procedure for use by data source modules */
+EXTERN(boolean) jpeg_resync_to_restart JPP((j_decompress_ptr cinfo,
+ int desired));
+
+
+/* These marker codes are exported since applications and data source modules
+ * are likely to want to use them.
+ */
+
+#define JPEG_RST0 0xD0 /* RST0 marker code */
+#define JPEG_EOI 0xD9 /* EOI marker code */
+#define JPEG_APP0 0xE0 /* APP0 marker code */
+#define JPEG_COM 0xFE /* COM marker code */
+
+
+/* If we have a brain-damaged compiler that emits warnings (or worse, errors)
+ * for structure definitions that are never filled in, keep it quiet by
+ * supplying dummy definitions for the various substructures.
+ */
+
+#ifdef INCOMPLETE_TYPES_BROKEN
+#ifndef JPEG_INTERNALS /* will be defined in jpegint.h */
+struct jvirt_sarray_control { long dummy; };
+struct jvirt_barray_control { long dummy; };
+struct jpeg_comp_master { long dummy; };
+struct jpeg_c_main_controller { long dummy; };
+struct jpeg_c_prep_controller { long dummy; };
+struct jpeg_c_coef_controller { long dummy; };
+struct jpeg_marker_writer { long dummy; };
+struct jpeg_color_converter { long dummy; };
+struct jpeg_downsampler { long dummy; };
+struct jpeg_forward_dct { long dummy; };
+struct jpeg_entropy_encoder { long dummy; };
+struct jpeg_decomp_master { long dummy; };
+struct jpeg_d_main_controller { long dummy; };
+struct jpeg_d_coef_controller { long dummy; };
+struct jpeg_d_post_controller { long dummy; };
+struct jpeg_input_controller { long dummy; };
+struct jpeg_marker_reader { long dummy; };
+struct jpeg_entropy_decoder { long dummy; };
+struct jpeg_inverse_dct { long dummy; };
+struct jpeg_upsampler { long dummy; };
+struct jpeg_color_deconverter { long dummy; };
+struct jpeg_color_quantizer { long dummy; };
+#endif /* JPEG_INTERNALS */
+#endif /* INCOMPLETE_TYPES_BROKEN */
+
+
+/*
+ * The JPEG library modules define JPEG_INTERNALS before including this file.
+ * The internal structure declarations are read only when that is true.
+ * Applications using the library should not include jpegint.h, but may wish
+ * to include jerror.h.
+ */
+
+#ifdef JPEG_INTERNALS
+#include "jpegint.h" /* fetch private declarations */
+#include "jerror.h" /* fetch error codes too */
+#endif
+
+#endif /* JPEGLIB_H */
diff --git a/core/include/thirdparties/zlib/zconf.h b/core/include/thirdparties/zlib/zconf.h
index 3a1f9696fc..5708a377e0 100644
--- a/core/include/thirdparties/zlib/zconf.h
+++ b/core/include/thirdparties/zlib/zconf.h
@@ -1,519 +1,519 @@
-/* zconf.h -- configuration of the zlib compression library
- * Copyright (C) 1995-2013 Jean-loup Gailly.
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* @(#) $Id$ */
-
-#ifndef ZCONF_H
-#define ZCONF_H
-
-/*
- * If you *really* need a unique prefix for all types and library functions,
- * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
- * Even better than compiling with -DZ_PREFIX would be to use configure to set
- * this permanently in zconf.h using "./configure --zprefix".
- */
-#ifdef Z_PREFIX /* may be set to #if 1 by ./configure */
-# define Z_PREFIX_SET
-
-/* all linked symbols */
-# define _dist_code z__dist_code
-# define _length_code z__length_code
-# define _tr_align z__tr_align
-# define _tr_flush_bits z__tr_flush_bits
-# define _tr_flush_block z__tr_flush_block
-# define _tr_init z__tr_init
-# define _tr_stored_block z__tr_stored_block
-# define _tr_tally z__tr_tally
-# define adler32 z_adler32
-# define adler32_combine z_adler32_combine
-# define adler32_combine64 z_adler32_combine64
-# ifndef Z_SOLO
-# define compress z_compress
-# define compress2 z_compress2
-# define compressBound z_compressBound
-# endif
-# define crc32 z_crc32
-# define crc32_combine z_crc32_combine
-# define crc32_combine64 z_crc32_combine64
-# define deflate z_deflate
-# define deflateBound z_deflateBound
-# define deflateCopy z_deflateCopy
-# define deflateEnd z_deflateEnd
-# define deflateInit2_ z_deflateInit2_
-# define deflateInit_ z_deflateInit_
-# define deflateParams z_deflateParams
-# define deflatePending z_deflatePending
-# define deflatePrime z_deflatePrime
-# define deflateReset z_deflateReset
-# define deflateResetKeep z_deflateResetKeep
-# define deflateSetDictionary z_deflateSetDictionary
-# define deflateSetHeader z_deflateSetHeader
-# define deflateTune z_deflateTune
-# define deflate_copyright z_deflate_copyright
-# define get_crc_table z_get_crc_table
-# ifndef Z_SOLO
-# define gz_error z_gz_error
-# define gz_intmax z_gz_intmax
-# define gz_strwinerror z_gz_strwinerror
-# define gzbuffer z_gzbuffer
-# define gzclearerr z_gzclearerr
-# define gzclose z_gzclose
-# define gzclose_r z_gzclose_r
-# define gzclose_w z_gzclose_w
-# define gzdirect z_gzdirect
-# define gzdopen z_gzdopen
-# define gzeof z_gzeof
-# define gzerror z_gzerror
-# define gzflush z_gzflush
-# define gzgetc z_gzgetc
-# define gzgetc_ z_gzgetc_
-# define gzgets z_gzgets
-# define gzoffset z_gzoffset
-# define gzoffset64 z_gzoffset64
-# define gzopen z_gzopen
-# define gzopen64 z_gzopen64
-# ifdef _WIN32
-# define gzopen_w z_gzopen_w
-# endif
-# define gzprintf z_gzprintf
-# define gzvprintf z_gzvprintf
-# define gzputc z_gzputc
-# define gzputs z_gzputs
-# define gzread z_gzread
-# define gzrewind z_gzrewind
-# define gzseek z_gzseek
-# define gzseek64 z_gzseek64
-# define gzsetparams z_gzsetparams
-# define gztell z_gztell
-# define gztell64 z_gztell64
-# define gzungetc z_gzungetc
-# define gzwrite z_gzwrite
-# endif
-# define inflate z_inflate
-# define inflateBack z_inflateBack
-# define inflateBackEnd z_inflateBackEnd
-# define inflateBackInit_ z_inflateBackInit_
-# define inflateCopy z_inflateCopy
-# define inflateEnd z_inflateEnd
-# define inflateGetHeader z_inflateGetHeader
-# define inflateInit2_ z_inflateInit2_
-# define inflateInit_ z_inflateInit_
-# define inflateMark z_inflateMark
-# define inflatePrime z_inflatePrime
-# define inflateReset z_inflateReset
-# define inflateReset2 z_inflateReset2
-# define inflateSetDictionary z_inflateSetDictionary
-# define inflateGetDictionary z_inflateGetDictionary
-# define inflateSync z_inflateSync
-# define inflateSyncPoint z_inflateSyncPoint
-# define inflateUndermine z_inflateUndermine
-# define inflateResetKeep z_inflateResetKeep
-# define inflate_copyright z_inflate_copyright
-# define inflate_fast z_inflate_fast
-# define inflate_table z_inflate_table
-# ifndef Z_SOLO
-# define uncompress z_uncompress
-# endif
-# define zError z_zError
-# ifndef Z_SOLO
-# define zcalloc z_zcalloc
-# define zcfree z_zcfree
-# endif
-# define zlibCompileFlags z_zlibCompileFlags
-# define zlibVersion z_zlibVersion
-
-/* all zlib typedefs in zlib.h and zconf.h */
-# define Byte z_Byte
-# define Bytef z_Bytef
-# define alloc_func z_alloc_func
-# define charf z_charf
-# define free_func z_free_func
-# ifndef Z_SOLO
-# define gzFile z_gzFile
-# endif
-# define gz_header z_gz_header
-# define gz_headerp z_gz_headerp
-# define in_func z_in_func
-# define intf z_intf
-# define out_func z_out_func
-# define uInt z_uInt
-# define uIntf z_uIntf
-# define uLong z_uLong
-# define uLongf z_uLongf
-# define voidp z_voidp
-# define voidpc z_voidpc
-# define voidpf z_voidpf
-
-/* all zlib structs in zlib.h and zconf.h */
-# define gz_header_s z_gz_header_s
-# define internal_state z_internal_state
-
-#endif
-
-#if defined(__MSDOS__) && !defined(MSDOS)
-# define MSDOS
-#endif
-#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
-# define OS2
-#endif
-#if defined(_WINDOWS) && !defined(WINDOWS)
-# define WINDOWS
-#endif
-#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
-# ifndef WIN32
-# define WIN32
-# endif
-#endif
-#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
-# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
-# ifndef SYS16BIT
-# define SYS16BIT
-# endif
-# endif
-#endif
-
-/*
- * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
- * than 64k bytes at a time (needed on systems with 16-bit int).
- */
-#ifdef SYS16BIT
-# define MAXSEG_64K
-#endif
-#ifdef MSDOS
-# define UNALIGNED_OK
-#endif
-
-#ifdef __STDC_VERSION__
-# ifndef STDC
-# define STDC
-# endif
-# if __STDC_VERSION__ >= 199901L
-# ifndef STDC99
-# define STDC99
-# endif
-# endif
-#endif
-#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
-# define STDC
-#endif
-#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
-# define STDC
-#endif
-#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
-# define STDC
-#endif
-#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
-# define STDC
-#endif
-
-#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
-# define STDC
-#endif
-
-#ifndef STDC
-# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
-# define const /* note: need a more gentle solution here */
-# endif
-#endif
-
-#if defined(ZLIB_CONST) && !defined(z_const)
-# define z_const const
-#else
-# define z_const
-#endif
-
-/* Some Mac compilers merge all .h files incorrectly: */
-#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
-# define NO_DUMMY_DECL
-#endif
-
-/* Maximum value for memLevel in deflateInit2 */
-#ifndef MAX_MEM_LEVEL
-# ifdef MAXSEG_64K
-# define MAX_MEM_LEVEL 8
-# else
-# define MAX_MEM_LEVEL 9
-# endif
-#endif
-
-/* Maximum value for windowBits in deflateInit2 and inflateInit2.
- * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
- * created by gzip. (Files created by minigzip can still be extracted by
- * gzip.)
- */
-#ifndef MAX_WBITS
-# define MAX_WBITS 15 /* 32K LZ77 window */
-#endif
-
-/* The memory requirements for deflate are (in bytes):
- (1 << (windowBits+2)) + (1 << (memLevel+9))
- that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
- plus a few kilobytes for small objects. For example, if you want to reduce
- the default memory requirements from 256K to 128K, compile with
- make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
- Of course this will generally degrade compression (there's no free lunch).
-
- The memory requirements for inflate are (in bytes) 1 << windowBits
- that is, 32K for windowBits=15 (default value) plus a few kilobytes
- for small objects.
-*/
-
- /* Type declarations */
-
-#ifndef OF /* function prototypes */
-# ifdef STDC
-# define OF(args) args
-# else
-# define OF(args) ()
-# endif
-#endif
-
-#ifndef Z_ARG /* function prototypes for stdarg */
-# if defined(STDC) || defined(Z_HAVE_STDARG_H)
-# define Z_ARG(args) args
-# else
-# define Z_ARG(args) ()
-# endif
-#endif
-
-/* The following definitions for FAR are needed only for MSDOS mixed
- * model programming (small or medium model with some far allocations).
- * This was tested only with MSC; for other MSDOS compilers you may have
- * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
- * just define FAR to be empty.
- */
-#ifdef SYS16BIT
-# if defined(M_I86SM) || defined(M_I86MM)
- /* MSC small or medium model */
-# define SMALL_MEDIUM
-# ifdef _MSC_VER
-# define FAR _far
-# else
-# define FAR far
-# endif
-# endif
-# if (defined(__SMALL__) || defined(__MEDIUM__))
- /* Turbo C small or medium model */
-# define SMALL_MEDIUM
-# ifdef __BORLANDC__
-# define FAR _far
-# else
-# define FAR far
-# endif
-# endif
-#endif
-
-#if defined(WINDOWS) || defined(WIN32)
- /* If building or using zlib as a DLL, define ZLIB_DLL.
- * This is not mandatory, but it offers a little performance increase.
- */
-# ifdef ZLIB_DLL
-# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
-# ifdef ZLIB_INTERNAL
-# define ZEXTERN extern __declspec(dllexport)
-# else
-# define ZEXTERN extern __declspec(dllimport)
-# endif
-# endif
-# endif /* ZLIB_DLL */
- /* If building or using zlib with the WINAPI/WINAPIV calling convention,
- * define ZLIB_WINAPI.
- * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
- */
-# ifdef ZLIB_WINAPI
-# ifdef FAR
-# undef FAR
-# endif
-# include <windows.h>
- /* No need for _export, use ZLIB.DEF instead. */
- /* For complete Windows compatibility, use WINAPI, not __stdcall. */
-# define ZEXPORT WINAPI
-# ifdef WIN32
-# define ZEXPORTVA WINAPIV
-# else
-# define ZEXPORTVA FAR CDECL
-# endif
-# endif
-#endif
-
-#if defined (__BEOS__)
-# ifdef ZLIB_DLL
-# ifdef ZLIB_INTERNAL
-# define ZEXPORT __declspec(dllexport)
-# define ZEXPORTVA __declspec(dllexport)
-# else
-# define ZEXPORT __declspec(dllimport)
-# define ZEXPORTVA __declspec(dllimport)
-# endif
-# endif
-#endif
-
-#ifndef ZEXTERN
-# define ZEXTERN extern
-#endif
-#ifndef ZEXPORT
-# define ZEXPORT
-#endif
-#ifndef ZEXPORTVA
-# define ZEXPORTVA
-#endif
-
-#ifndef FAR
-# define FAR
-#endif
-
-#if !defined(__MACTYPES__)
-typedef unsigned char Byte; /* 8 bits */
-#endif
-typedef unsigned int uInt; /* 16 bits or more */
-typedef unsigned long uLong; /* 32 bits or more */
-
-#ifdef SMALL_MEDIUM
- /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
-# define Bytef Byte FAR
-#else
- typedef Byte FAR Bytef;
-#endif
-typedef char FAR charf;
-typedef int FAR intf;
-typedef uInt FAR uIntf;
-typedef uLong FAR uLongf;
-
-#ifdef STDC
- typedef void const *voidpc;
- typedef void FAR *voidpf;
- typedef void *voidp;
-#else
- typedef Byte const *voidpc;
- typedef Byte FAR *voidpf;
- typedef Byte *voidp;
-#endif
-
-#if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC)
-# include <limits.h>
-# if (UINT_MAX == 0xffffffffUL)
-# define Z_U4 unsigned
-# elif (ULONG_MAX == 0xffffffffUL)
-# define Z_U4 unsigned long
-# elif (USHRT_MAX == 0xffffffffUL)
-# define Z_U4 unsigned short
-# endif
-#endif
-
-#ifdef Z_U4
- typedef Z_U4 z_crc_t;
-#else
- typedef unsigned long z_crc_t;
-#endif
-
-#if 0 /* Sunliang.Liu 20100908 sync the config to the old revision, otherwise, evc compile failed. */
-#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
-# define Z_HAVE_UNISTD_H
-#endif
-#endif /* 0 */
-
-#ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */
-# define Z_HAVE_STDARG_H
-#endif
-
-#if 0 /* Sunliang.Liu 20100908 sync the config to the old revision, otherwise, evc compile failed. */
-#ifdef STDC
-# ifndef Z_SOLO
-# include <sys/types.h> /* for off_t */
-# endif
-#endif
-#endif /* 0 */
-
-#if defined(STDC) || defined(Z_HAVE_STDARG_H)
-# ifndef Z_SOLO
-# include <stdarg.h> /* for va_list */
-# endif
-#endif
-
-#ifdef _WIN32
-# ifndef Z_SOLO
-# include <stddef.h> /* for wchar_t */
-# endif
-#endif
-
-#if 0 /* Sunliang.Liu 20100908 sync the config to the old revision, otherwise, evc compile failed. */
-/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
- * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
- * though the former does not conform to the LFS document), but considering
- * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
- * equivalently requesting no 64-bit operations
- */
-#if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1
-# undef _LARGEFILE64_SOURCE
-#endif
-#endif /* 0 */
-
-#if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H)
-# define Z_HAVE_UNISTD_H
-#endif
-#ifndef Z_SOLO
-#if 0 /* Sunliang.Liu 20100908 sync the config to the old revision, otherwise, evc compile failed. */
-# if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
-# include <unistd.h> /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
-# ifdef VMS
-# include <unixio.h> /* for off_t */
-# endif
-# ifndef z_off_t
-# define z_off_t off_t
-# endif
-# endif
-#endif /* 0 */
-#endif
-
-#if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0
-# define Z_LFS64
-#endif
-
-#if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64)
-# define Z_LARGE64
-#endif
-
-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64)
-# define Z_WANT64
-#endif
-
-#if !defined(SEEK_SET) && !defined(Z_SOLO)
-# define SEEK_SET 0 /* Seek from beginning of file. */
-# define SEEK_CUR 1 /* Seek from current position. */
-# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
-#endif
-
-#ifndef z_off_t
-# define z_off_t long
-#endif
-
-#if !defined(_WIN32) && defined(Z_LARGE64)
-# define z_off64_t off64_t
-#else
-# if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO)
-# define z_off64_t __int64
-# else
-# define z_off64_t z_off_t
-# endif
-#endif
-
-/* MVS linker does not support external names larger than 8 bytes */
-#if defined(__MVS__)
- #pragma map(deflateInit_,"DEIN")
- #pragma map(deflateInit2_,"DEIN2")
- #pragma map(deflateEnd,"DEEND")
- #pragma map(deflateBound,"DEBND")
- #pragma map(inflateInit_,"ININ")
- #pragma map(inflateInit2_,"ININ2")
- #pragma map(inflateEnd,"INEND")
- #pragma map(inflateSync,"INSY")
- #pragma map(inflateSetDictionary,"INSEDI")
- #pragma map(compressBound,"CMBND")
- #pragma map(inflate_table,"INTABL")
- #pragma map(inflate_fast,"INFA")
- #pragma map(inflate_copyright,"INCOPY")
-#endif
-
-#endif /* ZCONF_H */
+/* zconf.h -- configuration of the zlib compression library
+ * Copyright (C) 1995-2013 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* @(#) $Id$ */
+
+#ifndef ZCONF_H
+#define ZCONF_H
+
+/*
+ * If you *really* need a unique prefix for all types and library functions,
+ * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
+ * Even better than compiling with -DZ_PREFIX would be to use configure to set
+ * this permanently in zconf.h using "./configure --zprefix".
+ */
+#ifdef Z_PREFIX /* may be set to #if 1 by ./configure */
+# define Z_PREFIX_SET
+
+/* all linked symbols */
+# define _dist_code z__dist_code
+# define _length_code z__length_code
+# define _tr_align z__tr_align
+# define _tr_flush_bits z__tr_flush_bits
+# define _tr_flush_block z__tr_flush_block
+# define _tr_init z__tr_init
+# define _tr_stored_block z__tr_stored_block
+# define _tr_tally z__tr_tally
+# define adler32 z_adler32
+# define adler32_combine z_adler32_combine
+# define adler32_combine64 z_adler32_combine64
+# ifndef Z_SOLO
+# define compress z_compress
+# define compress2 z_compress2
+# define compressBound z_compressBound
+# endif
+# define crc32 z_crc32
+# define crc32_combine z_crc32_combine
+# define crc32_combine64 z_crc32_combine64
+# define deflate z_deflate
+# define deflateBound z_deflateBound
+# define deflateCopy z_deflateCopy
+# define deflateEnd z_deflateEnd
+# define deflateInit2_ z_deflateInit2_
+# define deflateInit_ z_deflateInit_
+# define deflateParams z_deflateParams
+# define deflatePending z_deflatePending
+# define deflatePrime z_deflatePrime
+# define deflateReset z_deflateReset
+# define deflateResetKeep z_deflateResetKeep
+# define deflateSetDictionary z_deflateSetDictionary
+# define deflateSetHeader z_deflateSetHeader
+# define deflateTune z_deflateTune
+# define deflate_copyright z_deflate_copyright
+# define get_crc_table z_get_crc_table
+# ifndef Z_SOLO
+# define gz_error z_gz_error
+# define gz_intmax z_gz_intmax
+# define gz_strwinerror z_gz_strwinerror
+# define gzbuffer z_gzbuffer
+# define gzclearerr z_gzclearerr
+# define gzclose z_gzclose
+# define gzclose_r z_gzclose_r
+# define gzclose_w z_gzclose_w
+# define gzdirect z_gzdirect
+# define gzdopen z_gzdopen
+# define gzeof z_gzeof
+# define gzerror z_gzerror
+# define gzflush z_gzflush
+# define gzgetc z_gzgetc
+# define gzgetc_ z_gzgetc_
+# define gzgets z_gzgets
+# define gzoffset z_gzoffset
+# define gzoffset64 z_gzoffset64
+# define gzopen z_gzopen
+# define gzopen64 z_gzopen64
+# ifdef _WIN32
+# define gzopen_w z_gzopen_w
+# endif
+# define gzprintf z_gzprintf
+# define gzvprintf z_gzvprintf
+# define gzputc z_gzputc
+# define gzputs z_gzputs
+# define gzread z_gzread
+# define gzrewind z_gzrewind
+# define gzseek z_gzseek
+# define gzseek64 z_gzseek64
+# define gzsetparams z_gzsetparams
+# define gztell z_gztell
+# define gztell64 z_gztell64
+# define gzungetc z_gzungetc
+# define gzwrite z_gzwrite
+# endif
+# define inflate z_inflate
+# define inflateBack z_inflateBack
+# define inflateBackEnd z_inflateBackEnd
+# define inflateBackInit_ z_inflateBackInit_
+# define inflateCopy z_inflateCopy
+# define inflateEnd z_inflateEnd
+# define inflateGetHeader z_inflateGetHeader
+# define inflateInit2_ z_inflateInit2_
+# define inflateInit_ z_inflateInit_
+# define inflateMark z_inflateMark
+# define inflatePrime z_inflatePrime
+# define inflateReset z_inflateReset
+# define inflateReset2 z_inflateReset2
+# define inflateSetDictionary z_inflateSetDictionary
+# define inflateGetDictionary z_inflateGetDictionary
+# define inflateSync z_inflateSync
+# define inflateSyncPoint z_inflateSyncPoint
+# define inflateUndermine z_inflateUndermine
+# define inflateResetKeep z_inflateResetKeep
+# define inflate_copyright z_inflate_copyright
+# define inflate_fast z_inflate_fast
+# define inflate_table z_inflate_table
+# ifndef Z_SOLO
+# define uncompress z_uncompress
+# endif
+# define zError z_zError
+# ifndef Z_SOLO
+# define zcalloc z_zcalloc
+# define zcfree z_zcfree
+# endif
+# define zlibCompileFlags z_zlibCompileFlags
+# define zlibVersion z_zlibVersion
+
+/* all zlib typedefs in zlib.h and zconf.h */
+# define Byte z_Byte
+# define Bytef z_Bytef
+# define alloc_func z_alloc_func
+# define charf z_charf
+# define free_func z_free_func
+# ifndef Z_SOLO
+# define gzFile z_gzFile
+# endif
+# define gz_header z_gz_header
+# define gz_headerp z_gz_headerp
+# define in_func z_in_func
+# define intf z_intf
+# define out_func z_out_func
+# define uInt z_uInt
+# define uIntf z_uIntf
+# define uLong z_uLong
+# define uLongf z_uLongf
+# define voidp z_voidp
+# define voidpc z_voidpc
+# define voidpf z_voidpf
+
+/* all zlib structs in zlib.h and zconf.h */
+# define gz_header_s z_gz_header_s
+# define internal_state z_internal_state
+
+#endif
+
+#if defined(__MSDOS__) && !defined(MSDOS)
+# define MSDOS
+#endif
+#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
+# define OS2
+#endif
+#if defined(_WINDOWS) && !defined(WINDOWS)
+# define WINDOWS
+#endif
+#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
+# ifndef WIN32
+# define WIN32
+# endif
+#endif
+#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
+# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
+# ifndef SYS16BIT
+# define SYS16BIT
+# endif
+# endif
+#endif
+
+/*
+ * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
+ * than 64k bytes at a time (needed on systems with 16-bit int).
+ */
+#ifdef SYS16BIT
+# define MAXSEG_64K
+#endif
+#ifdef MSDOS
+# define UNALIGNED_OK
+#endif
+
+#ifdef __STDC_VERSION__
+# ifndef STDC
+# define STDC
+# endif
+# if __STDC_VERSION__ >= 199901L
+# ifndef STDC99
+# define STDC99
+# endif
+# endif
+#endif
+#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
+# define STDC
+#endif
+#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
+# define STDC
+#endif
+#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
+# define STDC
+#endif
+#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
+# define STDC
+#endif
+
+#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
+# define STDC
+#endif
+
+#ifndef STDC
+# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
+# define const /* note: need a more gentle solution here */
+# endif
+#endif
+
+#if defined(ZLIB_CONST) && !defined(z_const)
+# define z_const const
+#else
+# define z_const
+#endif
+
+/* Some Mac compilers merge all .h files incorrectly: */
+#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
+# define NO_DUMMY_DECL
+#endif
+
+/* Maximum value for memLevel in deflateInit2 */
+#ifndef MAX_MEM_LEVEL
+# ifdef MAXSEG_64K
+# define MAX_MEM_LEVEL 8
+# else
+# define MAX_MEM_LEVEL 9
+# endif
+#endif
+
+/* Maximum value for windowBits in deflateInit2 and inflateInit2.
+ * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
+ * created by gzip. (Files created by minigzip can still be extracted by
+ * gzip.)
+ */
+#ifndef MAX_WBITS
+# define MAX_WBITS 15 /* 32K LZ77 window */
+#endif
+
+/* The memory requirements for deflate are (in bytes):
+ (1 << (windowBits+2)) + (1 << (memLevel+9))
+ that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
+ plus a few kilobytes for small objects. For example, if you want to reduce
+ the default memory requirements from 256K to 128K, compile with
+ make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
+ Of course this will generally degrade compression (there's no free lunch).
+
+ The memory requirements for inflate are (in bytes) 1 << windowBits
+ that is, 32K for windowBits=15 (default value) plus a few kilobytes
+ for small objects.
+*/
+
+ /* Type declarations */
+
+#ifndef OF /* function prototypes */
+# ifdef STDC
+# define OF(args) args
+# else
+# define OF(args) ()
+# endif
+#endif
+
+#ifndef Z_ARG /* function prototypes for stdarg */
+# if defined(STDC) || defined(Z_HAVE_STDARG_H)
+# define Z_ARG(args) args
+# else
+# define Z_ARG(args) ()
+# endif
+#endif
+
+/* The following definitions for FAR are needed only for MSDOS mixed
+ * model programming (small or medium model with some far allocations).
+ * This was tested only with MSC; for other MSDOS compilers you may have
+ * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
+ * just define FAR to be empty.
+ */
+#ifdef SYS16BIT
+# if defined(M_I86SM) || defined(M_I86MM)
+ /* MSC small or medium model */
+# define SMALL_MEDIUM
+# ifdef _MSC_VER
+# define FAR _far
+# else
+# define FAR far
+# endif
+# endif
+# if (defined(__SMALL__) || defined(__MEDIUM__))
+ /* Turbo C small or medium model */
+# define SMALL_MEDIUM
+# ifdef __BORLANDC__
+# define FAR _far
+# else
+# define FAR far
+# endif
+# endif
+#endif
+
+#if defined(WINDOWS) || defined(WIN32)
+ /* If building or using zlib as a DLL, define ZLIB_DLL.
+ * This is not mandatory, but it offers a little performance increase.
+ */
+# ifdef ZLIB_DLL
+# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
+# ifdef ZLIB_INTERNAL
+# define ZEXTERN extern __declspec(dllexport)
+# else
+# define ZEXTERN extern __declspec(dllimport)
+# endif
+# endif
+# endif /* ZLIB_DLL */
+ /* If building or using zlib with the WINAPI/WINAPIV calling convention,
+ * define ZLIB_WINAPI.
+ * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
+ */
+# ifdef ZLIB_WINAPI
+# ifdef FAR
+# undef FAR
+# endif
+# include <windows.h>
+ /* No need for _export, use ZLIB.DEF instead. */
+ /* For complete Windows compatibility, use WINAPI, not __stdcall. */
+# define ZEXPORT WINAPI
+# ifdef WIN32
+# define ZEXPORTVA WINAPIV
+# else
+# define ZEXPORTVA FAR CDECL
+# endif
+# endif
+#endif
+
+#if defined (__BEOS__)
+# ifdef ZLIB_DLL
+# ifdef ZLIB_INTERNAL
+# define ZEXPORT __declspec(dllexport)
+# define ZEXPORTVA __declspec(dllexport)
+# else
+# define ZEXPORT __declspec(dllimport)
+# define ZEXPORTVA __declspec(dllimport)
+# endif
+# endif
+#endif
+
+#ifndef ZEXTERN
+# define ZEXTERN extern
+#endif
+#ifndef ZEXPORT
+# define ZEXPORT
+#endif
+#ifndef ZEXPORTVA
+# define ZEXPORTVA
+#endif
+
+#ifndef FAR
+# define FAR
+#endif
+
+#if !defined(__MACTYPES__)
+typedef unsigned char Byte; /* 8 bits */
+#endif
+typedef unsigned int uInt; /* 16 bits or more */
+typedef unsigned long uLong; /* 32 bits or more */
+
+#ifdef SMALL_MEDIUM
+ /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
+# define Bytef Byte FAR
+#else
+ typedef Byte FAR Bytef;
+#endif
+typedef char FAR charf;
+typedef int FAR intf;
+typedef uInt FAR uIntf;
+typedef uLong FAR uLongf;
+
+#ifdef STDC
+ typedef void const *voidpc;
+ typedef void FAR *voidpf;
+ typedef void *voidp;
+#else
+ typedef Byte const *voidpc;
+ typedef Byte FAR *voidpf;
+ typedef Byte *voidp;
+#endif
+
+#if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC)
+# include <limits.h>
+# if (UINT_MAX == 0xffffffffUL)
+# define Z_U4 unsigned
+# elif (ULONG_MAX == 0xffffffffUL)
+# define Z_U4 unsigned long
+# elif (USHRT_MAX == 0xffffffffUL)
+# define Z_U4 unsigned short
+# endif
+#endif
+
+#ifdef Z_U4
+ typedef Z_U4 z_crc_t;
+#else
+ typedef unsigned long z_crc_t;
+#endif
+
+#if 0 /* Sunliang.Liu 20100908 sync the config to the old revision, otherwise, evc compile failed. */
+#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
+# define Z_HAVE_UNISTD_H
+#endif
+#endif /* 0 */
+
+#ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */
+# define Z_HAVE_STDARG_H
+#endif
+
+#if 0 /* Sunliang.Liu 20100908 sync the config to the old revision, otherwise, evc compile failed. */
+#ifdef STDC
+# ifndef Z_SOLO
+# include <sys/types.h> /* for off_t */
+# endif
+#endif
+#endif /* 0 */
+
+#if defined(STDC) || defined(Z_HAVE_STDARG_H)
+# ifndef Z_SOLO
+# include <stdarg.h> /* for va_list */
+# endif
+#endif
+
+#ifdef _WIN32
+# ifndef Z_SOLO
+# include <stddef.h> /* for wchar_t */
+# endif
+#endif
+
+#if 0 /* Sunliang.Liu 20100908 sync the config to the old revision, otherwise, evc compile failed. */
+/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
+ * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
+ * though the former does not conform to the LFS document), but considering
+ * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
+ * equivalently requesting no 64-bit operations
+ */
+#if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1
+# undef _LARGEFILE64_SOURCE
+#endif
+#endif /* 0 */
+
+#if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H)
+# define Z_HAVE_UNISTD_H
+#endif
+#ifndef Z_SOLO
+#if 0 /* Sunliang.Liu 20100908 sync the config to the old revision, otherwise, evc compile failed. */
+# if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
+# include <unistd.h> /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
+# ifdef VMS
+# include <unixio.h> /* for off_t */
+# endif
+# ifndef z_off_t
+# define z_off_t off_t
+# endif
+# endif
+#endif /* 0 */
+#endif
+
+#if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0
+# define Z_LFS64
+#endif
+
+#if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64)
+# define Z_LARGE64
+#endif
+
+#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64)
+# define Z_WANT64
+#endif
+
+#if !defined(SEEK_SET) && !defined(Z_SOLO)
+# define SEEK_SET 0 /* Seek from beginning of file. */
+# define SEEK_CUR 1 /* Seek from current position. */
+# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
+#endif
+
+#ifndef z_off_t
+# define z_off_t long
+#endif
+
+#if !defined(_WIN32) && defined(Z_LARGE64)
+# define z_off64_t off64_t
+#else
+# if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO)
+# define z_off64_t __int64
+# else
+# define z_off64_t z_off_t
+# endif
+#endif
+
+/* MVS linker does not support external names larger than 8 bytes */
+#if defined(__MVS__)
+ #pragma map(deflateInit_,"DEIN")
+ #pragma map(deflateInit2_,"DEIN2")
+ #pragma map(deflateEnd,"DEEND")
+ #pragma map(deflateBound,"DEBND")
+ #pragma map(inflateInit_,"ININ")
+ #pragma map(inflateInit2_,"ININ2")
+ #pragma map(inflateEnd,"INEND")
+ #pragma map(inflateSync,"INSY")
+ #pragma map(inflateSetDictionary,"INSEDI")
+ #pragma map(compressBound,"CMBND")
+ #pragma map(inflate_table,"INTABL")
+ #pragma map(inflate_fast,"INFA")
+ #pragma map(inflate_copyright,"INCOPY")
+#endif
+
+#endif /* ZCONF_H */
diff --git a/core/include/thirdparties/zlib/zlib.h b/core/include/thirdparties/zlib/zlib.h
index 5e068c4a37..5850070baf 100644
--- a/core/include/thirdparties/zlib/zlib.h
+++ b/core/include/thirdparties/zlib/zlib.h
@@ -1,1828 +1,1828 @@
-/* zlib.h -- interface of the 'zlib' general purpose compression library
- version 1.2.8, April 28th, 2013
-
- Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-
- Jean-loup Gailly Mark Adler
- jloup@gzip.org madler@alumni.caltech.edu
-
-
- The data format used by the zlib library is described by RFCs (Request for
- Comments) 1950 to 1952 in the files http://tools.ietf.org/html/rfc1950
- (zlib format), rfc1951 (deflate format) and rfc1952 (gzip format).
-*/
-
-#ifndef ZLIB_H
-#define ZLIB_H
-
-#define deflate_copyright FPDFAPI_deflate_copyright
-#define adler32 FPDFAPI_adler32
-#define compress2 FPDFAPI_compress2
-#define compress FPDFAPI_compress
-#define compressBound FPDFAPI_compressBound
-#define get_crc_table FPDFAPI_get_crc_table
-#define crc32 FPDFAPI_crc32
-#define deflateInit_ FPDFAPI_deflateInit_
-#define deflateInit2_ FPDFAPI_deflateInit2_
-#define deflateSetDictionary FPDFAPI_deflateSetDictionary
-#define deflateReset FPDFAPI_deflateReset
-#define deflatePrime FPDFAPI_deflatePrime
-#define deflateParams FPDFAPI_deflateParams
-#define deflateBound FPDFAPI_deflateBound
-#define deflateSetHeader FPDFAPI_deflateSetHeader
-#define deflateTune FPDFAPI_deflateTune
-#define deflate FPDFAPI_deflate
-#define deflateEnd FPDFAPI_deflateEnd
-#define deflateCopy FPDFAPI_deflateCopy
-#define inflateBackInit_ FPDFAPI_inflateBackInit_
-#define inflateBack FPDFAPI_inflateBack
-#define inflateBackEnd FPDFAPI_inflateBackEnd
-#define inflateReset FPDFAPI_inflateReset
-#define inflateInit2_ FPDFAPI_inflateInit2_
-#define inflateInit_ FPDFAPI_inflateInit_
-#define inflate FPDFAPI_inflate
-#define inflateEnd FPDFAPI_inflateEnd
-#define inflateSetDictionary FPDFAPI_inflateSetDictionary
-#define inflateSync FPDFAPI_inflateSync
-#define inflateSyncPoint FPDFAPI_inflateSyncPoint
-#define inflateCopy FPDFAPI_inflateCopy
-#define uncompress FPDFAPI_uncompress
-#define zlibVersion FPDFAPI_zlibVersion
-#define zlibCompileFlags FPDFAPI_zlibCompileFlags
-#define zError FPDFAPI_zError
-#define z_errmsg FPDFAPI_z_errmsg
-#define zcfree FPDFAPI_zcfree
-#define zcalloc FPDFAPI_zcalloc
-#define inflate_fast FPDFAPI_inflate_fast
-#define inflate_table FPDFAPI_inflate_table
-#define inflate_copyright FPDFAPI_inflate_copyright
-#define _length_code FPDFAPI_length_code
-#define _tr_flush_block FPDFAPI_tr_flush_block
-#define _dist_code FPDFAPI_dist_code
-#define _tr_stored_block FPDFAPI_tr_stored_block
-#define _tr_init FPDFAPI_tr_init
-#define _tr_align FPDFAPI_tr_align
-#define _tr_tally FPDFAPI_tr_tally
-#define adler32_combine FPDFAPI_adler32_combine
-#define inflatePrime FPDFAPI_inflatePrime
-#define inflateGetHeader FPDFAPI_inflateGetHeader
-#define crc32_combine FPDFAPI_crc32_combine
-#define inflateReset2 FPDFAPI_inflateReset2
-#define inflateUndermine FPDFAPI_inflateUndermine
-#define inflateMark FPDFAPI_inflateMark
-#define adler32_combine64 FPDFAPI_adler32_combine64
-
-#include "zconf.h"
-
-/* Sunliang.Liu 20100908 sync the config to the old revision. NO_GZIP */
-#define NO_GZIP /* XYQ */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define ZLIB_VERSION "1.2.8"
-#define ZLIB_VERNUM 0x1280
-#define ZLIB_VER_MAJOR 1
-#define ZLIB_VER_MINOR 2
-#define ZLIB_VER_REVISION 8
-#define ZLIB_VER_SUBREVISION 0
-
-/*
- The 'zlib' compression library provides in-memory compression and
- decompression functions, including integrity checks of the uncompressed data.
- This version of the library supports only one compression method (deflation)
- but other algorithms will be added later and will have the same stream
- interface.
-
- Compression can be done in a single step if the buffers are large enough,
- or can be done by repeated calls of the compression function. In the latter
- case, the application must provide more input and/or consume the output
- (providing more output space) before each call.
-
- The compressed data format used by default by the in-memory functions is
- the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped
- around a deflate stream, which is itself documented in RFC 1951.
-
- The library also supports reading and writing files in gzip (.gz) format
- with an interface similar to that of stdio using the functions that start
- with "gz". The gzip format is different from the zlib format. gzip is a
- gzip wrapper, documented in RFC 1952, wrapped around a deflate stream.
-
- This library can optionally read and write gzip streams in memory as well.
-
- The zlib format was designed to be compact and fast for use in memory
- and on communications channels. The gzip format was designed for single-
- file compression on file systems, has a larger header than zlib to maintain
- directory information, and uses a different, slower check method than zlib.
-
- The library does not install any signal handler. The decoder checks
- the consistency of the compressed data, so the library should never crash
- even in case of corrupted input.
-*/
-
-typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size));
-typedef void (*free_func) OF((voidpf opaque, voidpf address));
-
-struct internal_state;
-
-typedef struct z_stream_s {
- z_const Bytef *next_in; /* next input byte */
- uInt avail_in; /* number of bytes available at next_in */
- uLong total_in; /* total number of input bytes read so far */
-
- Bytef *next_out; /* next output byte should be put there */
- uInt avail_out; /* remaining free space at next_out */
- uLong total_out; /* total number of bytes output so far */
-
- z_const char *msg; /* last error message, NULL if no error */
- struct internal_state FAR *state; /* not visible by applications */
-
- alloc_func zalloc; /* used to allocate the internal state */
- free_func zfree; /* used to free the internal state */
- voidpf opaque; /* private data object passed to zalloc and zfree */
-
- int data_type; /* best guess about the data type: binary or text */
- uLong adler; /* adler32 value of the uncompressed data */
- uLong reserved; /* reserved for future use */
-} z_stream;
-
-typedef z_stream FAR *z_streamp;
-
-/*
- gzip header information passed to and from zlib routines. See RFC 1952
- for more details on the meanings of these fields.
-*/
-typedef struct gz_header_s {
- int text; /* true if compressed data believed to be text */
- uLong time; /* modification time */
- int xflags; /* extra flags (not used when writing a gzip file) */
- int os; /* operating system */
- Bytef *extra; /* pointer to extra field or Z_NULL if none */
- uInt extra_len; /* extra field length (valid if extra != Z_NULL) */
- uInt extra_max; /* space at extra (only when reading header) */
- Bytef *name; /* pointer to zero-terminated file name or Z_NULL */
- uInt name_max; /* space at name (only when reading header) */
- Bytef *comment; /* pointer to zero-terminated comment or Z_NULL */
- uInt comm_max; /* space at comment (only when reading header) */
- int hcrc; /* true if there was or will be a header crc */
- int done; /* true when done reading gzip header (not used
- when writing a gzip file) */
-} gz_header;
-
-typedef gz_header FAR *gz_headerp;
-
-/*
- The application must update next_in and avail_in when avail_in has dropped
- to zero. It must update next_out and avail_out when avail_out has dropped
- to zero. The application must initialize zalloc, zfree and opaque before
- calling the init function. All other fields are set by the compression
- library and must not be updated by the application.
-
- The opaque value provided by the application will be passed as the first
- parameter for calls of zalloc and zfree. This can be useful for custom
- memory management. The compression library attaches no meaning to the
- opaque value.
-
- zalloc must return Z_NULL if there is not enough memory for the object.
- If zlib is used in a multi-threaded application, zalloc and zfree must be
- thread safe.
-
- On 16-bit systems, the functions zalloc and zfree must be able to allocate
- exactly 65536 bytes, but will not be required to allocate more than this if
- the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS, pointers
- returned by zalloc for objects of exactly 65536 bytes *must* have their
- offset normalized to zero. The default allocation function provided by this
- library ensures this (see zutil.c). To reduce memory requirements and avoid
- any allocation of 64K objects, at the expense of compression ratio, compile
- the library with -DMAX_WBITS=14 (see zconf.h).
-
- The fields total_in and total_out can be used for statistics or progress
- reports. After compression, total_in holds the total size of the
- uncompressed data and may be saved for use in the decompressor (particularly
- if the decompressor wants to decompress everything in a single step).
-*/
-
- /* constants */
-
-#define Z_NO_FLUSH 0
-#define Z_PARTIAL_FLUSH 1
-#define Z_SYNC_FLUSH 2
-#define Z_FULL_FLUSH 3
-#define Z_FINISH 4
-#define Z_BLOCK 5
-#define Z_TREES 6
-/* Allowed flush values; see deflate() and inflate() below for details */
-
-#define Z_OK 0
-#define Z_STREAM_END 1
-#define Z_NEED_DICT 2
-#define Z_ERRNO (-1)
-#define Z_STREAM_ERROR (-2)
-#define Z_DATA_ERROR (-3)
-#define Z_MEM_ERROR (-4)
-#define Z_BUF_ERROR (-5)
-#define Z_VERSION_ERROR (-6)
-/* Return codes for the compression/decompression functions. Negative values
- * are errors, positive values are used for special but normal events.
- */
-
-#define Z_NO_COMPRESSION 0
-#define Z_BEST_SPEED 1
-#define Z_BEST_COMPRESSION 9
-#define Z_DEFAULT_COMPRESSION (-1)
-/* compression levels */
-
-#define Z_FILTERED 1
-#define Z_HUFFMAN_ONLY 2
-#define Z_RLE 3
-#define Z_FIXED 4
-#define Z_DEFAULT_STRATEGY 0
-/* compression strategy; see deflateInit2() below for details */
-
-#define Z_BINARY 0
-#define Z_TEXT 1
-#define Z_ASCII Z_TEXT /* for compatibility with 1.2.2 and earlier */
-#define Z_UNKNOWN 2
-/* Possible values of the data_type field (though see inflate()) */
-
-#define Z_DEFLATED 8
-/* The deflate compression method (the only one supported in this version) */
-
-#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */
-
-#define zlib_version zlibVersion()
-/* for compatibility with versions < 1.0.2 */
-
-
- /* basic functions */
-
-ZEXTERN const char * ZEXPORT zlibVersion OF((void));
-/* The application can compare zlibVersion and ZLIB_VERSION for consistency.
- If the first character differs, the library code actually used is not
- compatible with the zlib.h header file used by the application. This check
- is automatically made by deflateInit and inflateInit.
- */
-
-/*
-ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level));
-
- Initializes the internal stream state for compression. The fields
- zalloc, zfree and opaque must be initialized before by the caller. If
- zalloc and zfree are set to Z_NULL, deflateInit updates them to use default
- allocation functions.
-
- The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9:
- 1 gives best speed, 9 gives best compression, 0 gives no compression at all
- (the input data is simply copied a block at a time). Z_DEFAULT_COMPRESSION
- requests a default compromise between speed and compression (currently
- equivalent to level 6).
-
- deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
- memory, Z_STREAM_ERROR if level is not a valid compression level, or
- Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible
- with the version assumed by the caller (ZLIB_VERSION). msg is set to null
- if there is no error message. deflateInit does not perform any compression:
- this will be done by deflate().
-*/
-
-
-ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
-/*
- deflate compresses as much data as possible, and stops when the input
- buffer becomes empty or the output buffer becomes full. It may introduce
- some output latency (reading input without producing any output) except when
- forced to flush.
-
- The detailed semantics are as follows. deflate performs one or both of the
- following actions:
-
- - Compress more input starting at next_in and update next_in and avail_in
- accordingly. If not all input can be processed (because there is not
- enough room in the output buffer), next_in and avail_in are updated and
- processing will resume at this point for the next call of deflate().
-
- - Provide more output starting at next_out and update next_out and avail_out
- accordingly. This action is forced if the parameter flush is non zero.
- Forcing flush frequently degrades the compression ratio, so this parameter
- should be set only when necessary (in interactive applications). Some
- output may be provided even if flush is not set.
-
- Before the call of deflate(), the application should ensure that at least
- one of the actions is possible, by providing more input and/or consuming more
- output, and updating avail_in or avail_out accordingly; avail_out should
- never be zero before the call. The application can consume the compressed
- output when it wants, for example when the output buffer is full (avail_out
- == 0), or after each call of deflate(). If deflate returns Z_OK and with
- zero avail_out, it must be called again after making room in the output
- buffer because there might be more output pending.
-
- Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to
- decide how much data to accumulate before producing output, in order to
- maximize compression.
-
- If the parameter flush is set to Z_SYNC_FLUSH, all pending output is
- flushed to the output buffer and the output is aligned on a byte boundary, so
- that the decompressor can get all input data available so far. (In
- particular avail_in is zero after the call if enough output space has been
- provided before the call.) Flushing may degrade compression for some
- compression algorithms and so it should be used only when necessary. This
- completes the current deflate block and follows it with an empty stored block
- that is three bits plus filler bits to the next byte, followed by four bytes
- (00 00 ff ff).
-
- If flush is set to Z_PARTIAL_FLUSH, all pending output is flushed to the
- output buffer, but the output is not aligned to a byte boundary. All of the
- input data so far will be available to the decompressor, as for Z_SYNC_FLUSH.
- This completes the current deflate block and follows it with an empty fixed
- codes block that is 10 bits long. This assures that enough bytes are output
- in order for the decompressor to finish the block before the empty fixed code
- block.
-
- If flush is set to Z_BLOCK, a deflate block is completed and emitted, as
- for Z_SYNC_FLUSH, but the output is not aligned on a byte boundary, and up to
- seven bits of the current block are held to be written as the next byte after
- the next deflate block is completed. In this case, the decompressor may not
- be provided enough bits at this point in order to complete decompression of
- the data provided so far to the compressor. It may need to wait for the next
- block to be emitted. This is for advanced applications that need to control
- the emission of deflate blocks.
-
- If flush is set to Z_FULL_FLUSH, all output is flushed as with
- Z_SYNC_FLUSH, and the compression state is reset so that decompression can
- restart from this point if previous compressed data has been damaged or if
- random access is desired. Using Z_FULL_FLUSH too often can seriously degrade
- compression.
-
- If deflate returns with avail_out == 0, this function must be called again
- with the same value of the flush parameter and more output space (updated
- avail_out), until the flush is complete (deflate returns with non-zero
- avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that
- avail_out is greater than six to avoid repeated flush markers due to
- avail_out == 0 on return.
-
- If the parameter flush is set to Z_FINISH, pending input is processed,
- pending output is flushed and deflate returns with Z_STREAM_END if there was
- enough output space; if deflate returns with Z_OK, this function must be
- called again with Z_FINISH and more output space (updated avail_out) but no
- more input data, until it returns with Z_STREAM_END or an error. After
- deflate has returned Z_STREAM_END, the only possible operations on the stream
- are deflateReset or deflateEnd.
-
- Z_FINISH can be used immediately after deflateInit if all the compression
- is to be done in a single step. In this case, avail_out must be at least the
- value returned by deflateBound (see below). Then deflate is guaranteed to
- return Z_STREAM_END. If not enough output space is provided, deflate will
- not return Z_STREAM_END, and it must be called again as described above.
-
- deflate() sets strm->adler to the adler32 checksum of all input read
- so far (that is, total_in bytes).
-
- deflate() may update strm->data_type if it can make a good guess about
- the input data type (Z_BINARY or Z_TEXT). In doubt, the data is considered
- binary. This field is only for information purposes and does not affect the
- compression algorithm in any manner.
-
- deflate() returns Z_OK if some progress has been made (more input
- processed or more output produced), Z_STREAM_END if all input has been
- consumed and all output has been produced (only when flush is set to
- Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example
- if next_in or next_out was Z_NULL), Z_BUF_ERROR if no progress is possible
- (for example avail_in or avail_out was zero). Note that Z_BUF_ERROR is not
- fatal, and deflate() can be called again with more input and more output
- space to continue compressing.
-*/
-
-
-ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm));
-/*
- All dynamically allocated data structures for this stream are freed.
- This function discards any unprocessed input and does not flush any pending
- output.
-
- deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the
- stream state was inconsistent, Z_DATA_ERROR if the stream was freed
- prematurely (some input or output was discarded). In the error case, msg
- may be set but then points to a static string (which must not be
- deallocated).
-*/
-
-
-/*
-ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));
-
- Initializes the internal stream state for decompression. The fields
- next_in, avail_in, zalloc, zfree and opaque must be initialized before by
- the caller. If next_in is not Z_NULL and avail_in is large enough (the
- exact value depends on the compression method), inflateInit determines the
- compression method from the zlib header and allocates all data structures
- accordingly; otherwise the allocation will be deferred to the first call of
- inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to
- use default allocation functions.
-
- inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
- memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
- version assumed by the caller, or Z_STREAM_ERROR if the parameters are
- invalid, such as a null pointer to the structure. msg is set to null if
- there is no error message. inflateInit does not perform any decompression
- apart from possibly reading the zlib header if present: actual decompression
- will be done by inflate(). (So next_in and avail_in may be modified, but
- next_out and avail_out are unused and unchanged.) The current implementation
- of inflateInit() does not process any header information -- that is deferred
- until inflate() is called.
-*/
-
-
-ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
-/*
- inflate decompresses as much data as possible, and stops when the input
- buffer becomes empty or the output buffer becomes full. It may introduce
- some output latency (reading input without producing any output) except when
- forced to flush.
-
- The detailed semantics are as follows. inflate performs one or both of the
- following actions:
-
- - Decompress more input starting at next_in and update next_in and avail_in
- accordingly. If not all input can be processed (because there is not
- enough room in the output buffer), next_in is updated and processing will
- resume at this point for the next call of inflate().
-
- - Provide more output starting at next_out and update next_out and avail_out
- accordingly. inflate() provides as much output as possible, until there is
- no more input data or no more space in the output buffer (see below about
- the flush parameter).
-
- Before the call of inflate(), the application should ensure that at least
- one of the actions is possible, by providing more input and/or consuming more
- output, and updating the next_* and avail_* values accordingly. The
- application can consume the uncompressed output when it wants, for example
- when the output buffer is full (avail_out == 0), or after each call of
- inflate(). If inflate returns Z_OK and with zero avail_out, it must be
- called again after making room in the output buffer because there might be
- more output pending.
-
- The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FINISH,
- Z_BLOCK, or Z_TREES. Z_SYNC_FLUSH requests that inflate() flush as much
- output as possible to the output buffer. Z_BLOCK requests that inflate()
- stop if and when it gets to the next deflate block boundary. When decoding
- the zlib or gzip format, this will cause inflate() to return immediately
- after the header and before the first block. When doing a raw inflate,
- inflate() will go ahead and process the first block, and will return when it
- gets to the end of that block, or when it runs out of data.
-
- The Z_BLOCK option assists in appending to or combining deflate streams.
- Also to assist in this, on return inflate() will set strm->data_type to the
- number of unused bits in the last byte taken from strm->next_in, plus 64 if
- inflate() is currently decoding the last block in the deflate stream, plus
- 128 if inflate() returned immediately after decoding an end-of-block code or
- decoding the complete header up to just before the first byte of the deflate
- stream. The end-of-block will not be indicated until all of the uncompressed
- data from that block has been written to strm->next_out. The number of
- unused bits may in general be greater than seven, except when bit 7 of
- data_type is set, in which case the number of unused bits will be less than
- eight. data_type is set as noted here every time inflate() returns for all
- flush options, and so can be used to determine the amount of currently
- consumed input in bits.
-
- The Z_TREES option behaves as Z_BLOCK does, but it also returns when the
- end of each deflate block header is reached, before any actual data in that
- block is decoded. This allows the caller to determine the length of the
- deflate block header for later use in random access within a deflate block.
- 256 is added to the value of strm->data_type when inflate() returns
- immediately after reaching the end of the deflate block header.
-
- inflate() should normally be called until it returns Z_STREAM_END or an
- error. However if all decompression is to be performed in a single step (a
- single call of inflate), the parameter flush should be set to Z_FINISH. In
- this case all pending input is processed and all pending output is flushed;
- avail_out must be large enough to hold all of the uncompressed data for the
- operation to complete. (The size of the uncompressed data may have been
- saved by the compressor for this purpose.) The use of Z_FINISH is not
- required to perform an inflation in one step. However it may be used to
- inform inflate that a faster approach can be used for the single inflate()
- call. Z_FINISH also informs inflate to not maintain a sliding window if the
- stream completes, which reduces inflate's memory footprint. If the stream
- does not complete, either because not all of the stream is provided or not
- enough output space is provided, then a sliding window will be allocated and
- inflate() can be called again to continue the operation as if Z_NO_FLUSH had
- been used.
-
- In this implementation, inflate() always flushes as much output as
- possible to the output buffer, and always uses the faster approach on the
- first call. So the effects of the flush parameter in this implementation are
- on the return value of inflate() as noted below, when inflate() returns early
- when Z_BLOCK or Z_TREES is used, and when inflate() avoids the allocation of
- memory for a sliding window when Z_FINISH is used.
-
- If a preset dictionary is needed after this call (see inflateSetDictionary
- below), inflate sets strm->adler to the Adler-32 checksum of the dictionary
- chosen by the compressor and returns Z_NEED_DICT; otherwise it sets
- strm->adler to the Adler-32 checksum of all output produced so far (that is,
- total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described
- below. At the end of the stream, inflate() checks that its computed adler32
- checksum is equal to that saved by the compressor and returns Z_STREAM_END
- only if the checksum is correct.
-
- inflate() can decompress and check either zlib-wrapped or gzip-wrapped
- deflate data. The header type is detected automatically, if requested when
- initializing with inflateInit2(). Any information contained in the gzip
- header is not retained, so applications that need that information should
- instead use raw inflate, see inflateInit2() below, or inflateBack() and
- perform their own processing of the gzip header and trailer. When processing
- gzip-wrapped deflate data, strm->adler32 is set to the CRC-32 of the output
- producted so far. The CRC-32 is checked against the gzip trailer.
-
- inflate() returns Z_OK if some progress has been made (more input processed
- or more output produced), Z_STREAM_END if the end of the compressed data has
- been reached and all uncompressed output has been produced, Z_NEED_DICT if a
- preset dictionary is needed at this point, Z_DATA_ERROR if the input data was
- corrupted (input stream not conforming to the zlib format or incorrect check
- value), Z_STREAM_ERROR if the stream structure was inconsistent (for example
- next_in or next_out was Z_NULL), Z_MEM_ERROR if there was not enough memory,
- Z_BUF_ERROR if no progress is possible or if there was not enough room in the
- output buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and
- inflate() can be called again with more input and more output space to
- continue decompressing. If Z_DATA_ERROR is returned, the application may
- then call inflateSync() to look for a good compression block if a partial
- recovery of the data is desired.
-*/
-
-
-ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));
-/*
- All dynamically allocated data structures for this stream are freed.
- This function discards any unprocessed input and does not flush any pending
- output.
-
- inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state
- was inconsistent. In the error case, msg may be set but then points to a
- static string (which must not be deallocated).
-*/
-
-
- /* Advanced functions */
-
-/*
- The following functions are needed only in some special applications.
-*/
-
-/*
-ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
- int level,
- int method,
- int windowBits,
- int memLevel,
- int strategy));
-
- This is another version of deflateInit with more compression options. The
- fields next_in, zalloc, zfree and opaque must be initialized before by the
- caller.
-
- The method parameter is the compression method. It must be Z_DEFLATED in
- this version of the library.
-
- The windowBits parameter is the base two logarithm of the window size
- (the size of the history buffer). It should be in the range 8..15 for this
- version of the library. Larger values of this parameter result in better
- compression at the expense of memory usage. The default value is 15 if
- deflateInit is used instead.
-
- windowBits can also be -8..-15 for raw deflate. In this case, -windowBits
- determines the window size. deflate() will then generate raw deflate data
- with no zlib header or trailer, and will not compute an adler32 check value.
-
- windowBits can also be greater than 15 for optional gzip encoding. Add
- 16 to windowBits to write a simple gzip header and trailer around the
- compressed data instead of a zlib wrapper. The gzip header will have no
- file name, no extra data, no comment, no modification time (set to zero), no
- header crc, and the operating system will be set to 255 (unknown). If a
- gzip stream is being written, strm->adler is a crc32 instead of an adler32.
-
- The memLevel parameter specifies how much memory should be allocated
- for the internal compression state. memLevel=1 uses minimum memory but is
- slow and reduces compression ratio; memLevel=9 uses maximum memory for
- optimal speed. The default value is 8. See zconf.h for total memory usage
- as a function of windowBits and memLevel.
-
- The strategy parameter is used to tune the compression algorithm. Use the
- value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a
- filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no
- string match), or Z_RLE to limit match distances to one (run-length
- encoding). Filtered data consists mostly of small values with a somewhat
- random distribution. In this case, the compression algorithm is tuned to
- compress them better. The effect of Z_FILTERED is to force more Huffman
- coding and less string matching; it is somewhat intermediate between
- Z_DEFAULT_STRATEGY and Z_HUFFMAN_ONLY. Z_RLE is designed to be almost as
- fast as Z_HUFFMAN_ONLY, but give better compression for PNG image data. The
- strategy parameter only affects the compression ratio but not the
- correctness of the compressed output even if it is not set appropriately.
- Z_FIXED prevents the use of dynamic Huffman codes, allowing for a simpler
- decoder for special applications.
-
- deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
- memory, Z_STREAM_ERROR if any parameter is invalid (such as an invalid
- method), or Z_VERSION_ERROR if the zlib library version (zlib_version) is
- incompatible with the version assumed by the caller (ZLIB_VERSION). msg is
- set to null if there is no error message. deflateInit2 does not perform any
- compression: this will be done by deflate().
-*/
-
-ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
- const Bytef *dictionary,
- uInt dictLength));
-/*
- Initializes the compression dictionary from the given byte sequence
- without producing any compressed output. When using the zlib format, this
- function must be called immediately after deflateInit, deflateInit2 or
- deflateReset, and before any call of deflate. When doing raw deflate, this
- function must be called either before any call of deflate, or immediately
- after the completion of a deflate block, i.e. after all input has been
- consumed and all output has been delivered when using any of the flush
- options Z_BLOCK, Z_PARTIAL_FLUSH, Z_SYNC_FLUSH, or Z_FULL_FLUSH. The
- compressor and decompressor must use exactly the same dictionary (see
- inflateSetDictionary).
-
- The dictionary should consist of strings (byte sequences) that are likely
- to be encountered later in the data to be compressed, with the most commonly
- used strings preferably put towards the end of the dictionary. Using a
- dictionary is most useful when the data to be compressed is short and can be
- predicted with good accuracy; the data can then be compressed better than
- with the default empty dictionary.
-
- Depending on the size of the compression data structures selected by
- deflateInit or deflateInit2, a part of the dictionary may in effect be
- discarded, for example if the dictionary is larger than the window size
- provided in deflateInit or deflateInit2. Thus the strings most likely to be
- useful should be put at the end of the dictionary, not at the front. In
- addition, the current implementation of deflate will use at most the window
- size minus 262 bytes of the provided dictionary.
-
- Upon return of this function, strm->adler is set to the adler32 value
- of the dictionary; the decompressor may later use this value to determine
- which dictionary has been used by the compressor. (The adler32 value
- applies to the whole dictionary even if only a subset of the dictionary is
- actually used by the compressor.) If a raw deflate was requested, then the
- adler32 value is not computed and strm->adler is not set.
-
- deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a
- parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is
- inconsistent (for example if deflate has already been called for this stream
- or if not at a block boundary for raw deflate). deflateSetDictionary does
- not perform any compression: this will be done by deflate().
-*/
-
-ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest,
- z_streamp source));
-/*
- Sets the destination stream as a complete copy of the source stream.
-
- This function can be useful when several compression strategies will be
- tried, for example when there are several ways of pre-processing the input
- data with a filter. The streams that will be discarded should then be freed
- by calling deflateEnd. Note that deflateCopy duplicates the internal
- compression state which can be quite large, so this strategy is slow and can
- consume lots of memory.
-
- deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
- enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
- (such as zalloc being Z_NULL). msg is left unchanged in both source and
- destination.
-*/
-
-ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm));
-/*
- This function is equivalent to deflateEnd followed by deflateInit,
- but does not free and reallocate all the internal compression state. The
- stream will keep the same compression level and any other attributes that
- may have been set by deflateInit2.
-
- deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
- stream state was inconsistent (such as zalloc or state being Z_NULL).
-*/
-
-ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
- int level,
- int strategy));
-/*
- Dynamically update the compression level and compression strategy. The
- interpretation of level and strategy is as in deflateInit2. This can be
- used to switch between compression and straight copy of the input data, or
- to switch to a different kind of input data requiring a different strategy.
- If the compression level is changed, the input available so far is
- compressed with the old level (and may be flushed); the new level will take
- effect only at the next call of deflate().
-
- Before the call of deflateParams, the stream state must be set as for
- a call of deflate(), since the currently available input may have to be
- compressed and flushed. In particular, strm->avail_out must be non-zero.
-
- deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source
- stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR if
- strm->avail_out was zero.
-*/
-
-ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm,
- int good_length,
- int max_lazy,
- int nice_length,
- int max_chain));
-/*
- Fine tune deflate's internal compression parameters. This should only be
- used by someone who understands the algorithm used by zlib's deflate for
- searching for the best matching string, and even then only by the most
- fanatic optimizer trying to squeeze out the last compressed bit for their
- specific input data. Read the deflate.c source code for the meaning of the
- max_lazy, good_length, nice_length, and max_chain parameters.
-
- deflateTune() can be called after deflateInit() or deflateInit2(), and
- returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream.
- */
-
-ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm,
- uLong sourceLen));
-/*
- deflateBound() returns an upper bound on the compressed size after
- deflation of sourceLen bytes. It must be called after deflateInit() or
- deflateInit2(), and after deflateSetHeader(), if used. This would be used
- to allocate an output buffer for deflation in a single pass, and so would be
- called before deflate(). If that first deflate() call is provided the
- sourceLen input bytes, an output buffer allocated to the size returned by
- deflateBound(), and the flush value Z_FINISH, then deflate() is guaranteed
- to return Z_STREAM_END. Note that it is possible for the compressed size to
- be larger than the value returned by deflateBound() if flush options other
- than Z_FINISH or Z_NO_FLUSH are used.
-*/
-
-ZEXTERN int ZEXPORT deflatePending OF((z_streamp strm,
- unsigned *pending,
- int *bits));
-/*
- deflatePending() returns the number of bytes and bits of output that have
- been generated, but not yet provided in the available output. The bytes not
- provided would be due to the available output space having being consumed.
- The number of bits of output not provided are between 0 and 7, where they
- await more bits to join them in order to fill out a full byte. If pending
- or bits are Z_NULL, then those values are not set.
-
- deflatePending returns Z_OK if success, or Z_STREAM_ERROR if the source
- stream state was inconsistent.
- */
-
-ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm,
- int bits,
- int value));
-/*
- deflatePrime() inserts bits in the deflate output stream. The intent
- is that this function is used to start off the deflate output with the bits
- leftover from a previous deflate stream when appending to it. As such, this
- function can only be used for raw deflate, and must be used before the first
- deflate() call after a deflateInit2() or deflateReset(). bits must be less
- than or equal to 16, and that many of the least significant bits of value
- will be inserted in the output.
-
- deflatePrime returns Z_OK if success, Z_BUF_ERROR if there was not enough
- room in the internal buffer to insert the bits, or Z_STREAM_ERROR if the
- source stream state was inconsistent.
-*/
-
-ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm,
- gz_headerp head));
-/*
- deflateSetHeader() provides gzip header information for when a gzip
- stream is requested by deflateInit2(). deflateSetHeader() may be called
- after deflateInit2() or deflateReset() and before the first call of
- deflate(). The text, time, os, extra field, name, and comment information
- in the provided gz_header structure are written to the gzip header (xflag is
- ignored -- the extra flags are set according to the compression level). The
- caller must assure that, if not Z_NULL, name and comment are terminated with
- a zero byte, and that if extra is not Z_NULL, that extra_len bytes are
- available there. If hcrc is true, a gzip header crc is included. Note that
- the current versions of the command-line version of gzip (up through version
- 1.3.x) do not support header crc's, and will report that it is a "multi-part
- gzip file" and give up.
-
- If deflateSetHeader is not used, the default gzip header has text false,
- the time set to zero, and os set to 255, with no extra, name, or comment
- fields. The gzip header is returned to the default state by deflateReset().
-
- deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source
- stream state was inconsistent.
-*/
-
-/*
-ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
- int windowBits));
-
- This is another version of inflateInit with an extra parameter. The
- fields next_in, avail_in, zalloc, zfree and opaque must be initialized
- before by the caller.
-
- The windowBits parameter is the base two logarithm of the maximum window
- size (the size of the history buffer). It should be in the range 8..15 for
- this version of the library. The default value is 15 if inflateInit is used
- instead. windowBits must be greater than or equal to the windowBits value
- provided to deflateInit2() while compressing, or it must be equal to 15 if
- deflateInit2() was not used. If a compressed stream with a larger window
- size is given as input, inflate() will return with the error code
- Z_DATA_ERROR instead of trying to allocate a larger window.
-
- windowBits can also be zero to request that inflate use the window size in
- the zlib header of the compressed stream.
-
- windowBits can also be -8..-15 for raw inflate. In this case, -windowBits
- determines the window size. inflate() will then process raw deflate data,
- not looking for a zlib or gzip header, not generating a check value, and not
- looking for any check values for comparison at the end of the stream. This
- is for use with other formats that use the deflate compressed data format
- such as zip. Those formats provide their own check values. If a custom
- format is developed using the raw deflate format for compressed data, it is
- recommended that a check value such as an adler32 or a crc32 be applied to
- the uncompressed data as is done in the zlib, gzip, and zip formats. For
- most applications, the zlib format should be used as is. Note that comments
- above on the use in deflateInit2() applies to the magnitude of windowBits.
-
- windowBits can also be greater than 15 for optional gzip decoding. Add
- 32 to windowBits to enable zlib and gzip decoding with automatic header
- detection, or add 16 to decode only the gzip format (the zlib format will
- return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is a
- crc32 instead of an adler32.
-
- inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
- memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
- version assumed by the caller, or Z_STREAM_ERROR if the parameters are
- invalid, such as a null pointer to the structure. msg is set to null if
- there is no error message. inflateInit2 does not perform any decompression
- apart from possibly reading the zlib header if present: actual decompression
- will be done by inflate(). (So next_in and avail_in may be modified, but
- next_out and avail_out are unused and unchanged.) The current implementation
- of inflateInit2() does not process any header information -- that is
- deferred until inflate() is called.
-*/
-
-ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
- const Bytef *dictionary,
- uInt dictLength));
-/*
- Initializes the decompression dictionary from the given uncompressed byte
- sequence. This function must be called immediately after a call of inflate,
- if that call returned Z_NEED_DICT. The dictionary chosen by the compressor
- can be determined from the adler32 value returned by that call of inflate.
- The compressor and decompressor must use exactly the same dictionary (see
- deflateSetDictionary). For raw inflate, this function can be called at any
- time to set the dictionary. If the provided dictionary is smaller than the
- window and there is already data in the window, then the provided dictionary
- will amend what's there. The application must insure that the dictionary
- that was used for compression is provided.
-
- inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a
- parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is
- inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the
- expected one (incorrect adler32 value). inflateSetDictionary does not
- perform any decompression: this will be done by subsequent calls of
- inflate().
-*/
-
-ZEXTERN int ZEXPORT inflateGetDictionary OF((z_streamp strm,
- Bytef *dictionary,
- uInt *dictLength));
-/*
- Returns the sliding dictionary being maintained by inflate. dictLength is
- set to the number of bytes in the dictionary, and that many bytes are copied
- to dictionary. dictionary must have enough space, where 32768 bytes is
- always enough. If inflateGetDictionary() is called with dictionary equal to
- Z_NULL, then only the dictionary length is returned, and nothing is copied.
- Similary, if dictLength is Z_NULL, then it is not set.
-
- inflateGetDictionary returns Z_OK on success, or Z_STREAM_ERROR if the
- stream state is inconsistent.
-*/
-
-ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm));
-/*
- Skips invalid compressed data until a possible full flush point (see above
- for the description of deflate with Z_FULL_FLUSH) can be found, or until all
- available input is skipped. No output is provided.
-
- inflateSync searches for a 00 00 FF FF pattern in the compressed data.
- All full flush points have this pattern, but not all occurrences of this
- pattern are full flush points.
-
- inflateSync returns Z_OK if a possible full flush point has been found,
- Z_BUF_ERROR if no more input was provided, Z_DATA_ERROR if no flush point
- has been found, or Z_STREAM_ERROR if the stream structure was inconsistent.
- In the success case, the application may save the current current value of
- total_in which indicates where valid compressed data was found. In the
- error case, the application may repeatedly call inflateSync, providing more
- input each time, until success or end of the input data.
-*/
-
-ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest,
- z_streamp source));
-/*
- Sets the destination stream as a complete copy of the source stream.
-
- This function can be useful when randomly accessing a large stream. The
- first pass through the stream can periodically record the inflate state,
- allowing restarting inflate at those points when randomly accessing the
- stream.
-
- inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
- enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
- (such as zalloc being Z_NULL). msg is left unchanged in both source and
- destination.
-*/
-
-ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm));
-/*
- This function is equivalent to inflateEnd followed by inflateInit,
- but does not free and reallocate all the internal decompression state. The
- stream will keep attributes that may have been set by inflateInit2.
-
- inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
- stream state was inconsistent (such as zalloc or state being Z_NULL).
-*/
-
-ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm,
- int windowBits));
-/*
- This function is the same as inflateReset, but it also permits changing
- the wrap and window size requests. The windowBits parameter is interpreted
- the same as it is for inflateInit2.
-
- inflateReset2 returns Z_OK if success, or Z_STREAM_ERROR if the source
- stream state was inconsistent (such as zalloc or state being Z_NULL), or if
- the windowBits parameter is invalid.
-*/
-
-ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm,
- int bits,
- int value));
-/*
- This function inserts bits in the inflate input stream. The intent is
- that this function is used to start inflating at a bit position in the
- middle of a byte. The provided bits will be used before any bytes are used
- from next_in. This function should only be used with raw inflate, and
- should be used before the first inflate() call after inflateInit2() or
- inflateReset(). bits must be less than or equal to 16, and that many of the
- least significant bits of value will be inserted in the input.
-
- If bits is negative, then the input stream bit buffer is emptied. Then
- inflatePrime() can be called again to put bits in the buffer. This is used
- to clear out bits leftover after feeding inflate a block description prior
- to feeding inflate codes.
-
- inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source
- stream state was inconsistent.
-*/
-
-ZEXTERN long ZEXPORT inflateMark OF((z_streamp strm));
-/*
- This function returns two values, one in the lower 16 bits of the return
- value, and the other in the remaining upper bits, obtained by shifting the
- return value down 16 bits. If the upper value is -1 and the lower value is
- zero, then inflate() is currently decoding information outside of a block.
- If the upper value is -1 and the lower value is non-zero, then inflate is in
- the middle of a stored block, with the lower value equaling the number of
- bytes from the input remaining to copy. If the upper value is not -1, then
- it is the number of bits back from the current bit position in the input of
- the code (literal or length/distance pair) currently being processed. In
- that case the lower value is the number of bytes already emitted for that
- code.
-
- A code is being processed if inflate is waiting for more input to complete
- decoding of the code, or if it has completed decoding but is waiting for
- more output space to write the literal or match data.
-
- inflateMark() is used to mark locations in the input data for random
- access, which may be at bit positions, and to note those cases where the
- output of a code may span boundaries of random access blocks. The current
- location in the input stream can be determined from avail_in and data_type
- as noted in the description for the Z_BLOCK flush parameter for inflate.
-
- inflateMark returns the value noted above or -1 << 16 if the provided
- source stream state was inconsistent.
-*/
-
-ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm,
- gz_headerp head));
-/*
- inflateGetHeader() requests that gzip header information be stored in the
- provided gz_header structure. inflateGetHeader() may be called after
- inflateInit2() or inflateReset(), and before the first call of inflate().
- As inflate() processes the gzip stream, head->done is zero until the header
- is completed, at which time head->done is set to one. If a zlib stream is
- being decoded, then head->done is set to -1 to indicate that there will be
- no gzip header information forthcoming. Note that Z_BLOCK or Z_TREES can be
- used to force inflate() to return immediately after header processing is
- complete and before any actual data is decompressed.
-
- The text, time, xflags, and os fields are filled in with the gzip header
- contents. hcrc is set to true if there is a header CRC. (The header CRC
- was valid if done is set to one.) If extra is not Z_NULL, then extra_max
- contains the maximum number of bytes to write to extra. Once done is true,
- extra_len contains the actual extra field length, and extra contains the
- extra field, or that field truncated if extra_max is less than extra_len.
- If name is not Z_NULL, then up to name_max characters are written there,
- terminated with a zero unless the length is greater than name_max. If
- comment is not Z_NULL, then up to comm_max characters are written there,
- terminated with a zero unless the length is greater than comm_max. When any
- of extra, name, or comment are not Z_NULL and the respective field is not
- present in the header, then that field is set to Z_NULL to signal its
- absence. This allows the use of deflateSetHeader() with the returned
- structure to duplicate the header. However if those fields are set to
- allocated memory, then the application will need to save those pointers
- elsewhere so that they can be eventually freed.
-
- If inflateGetHeader is not used, then the header information is simply
- discarded. The header is always checked for validity, including the header
- CRC if present. inflateReset() will reset the process to discard the header
- information. The application would need to call inflateGetHeader() again to
- retrieve the header from the next gzip stream.
-
- inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source
- stream state was inconsistent.
-*/
-
-/*
-ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits,
- unsigned char FAR *window));
-
- Initialize the internal stream state for decompression using inflateBack()
- calls. The fields zalloc, zfree and opaque in strm must be initialized
- before the call. If zalloc and zfree are Z_NULL, then the default library-
- derived memory allocation routines are used. windowBits is the base two
- logarithm of the window size, in the range 8..15. window is a caller
- supplied buffer of that size. Except for special applications where it is
- assured that deflate was used with small window sizes, windowBits must be 15
- and a 32K byte window must be supplied to be able to decompress general
- deflate streams.
-
- See inflateBack() for the usage of these routines.
-
- inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of
- the parameters are invalid, Z_MEM_ERROR if the internal state could not be
- allocated, or Z_VERSION_ERROR if the version of the library does not match
- the version of the header file.
-*/
-
-typedef unsigned (*in_func) OF((void FAR *,
- z_const unsigned char FAR * FAR *));
-typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned));
-
-ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm,
- in_func in, void FAR *in_desc,
- out_func out, void FAR *out_desc));
-/*
- inflateBack() does a raw inflate with a single call using a call-back
- interface for input and output. This is potentially more efficient than
- inflate() for file i/o applications, in that it avoids copying between the
- output and the sliding window by simply making the window itself the output
- buffer. inflate() can be faster on modern CPUs when used with large
- buffers. inflateBack() trusts the application to not change the output
- buffer passed by the output function, at least until inflateBack() returns.
-
- inflateBackInit() must be called first to allocate the internal state
- and to initialize the state with the user-provided window buffer.
- inflateBack() may then be used multiple times to inflate a complete, raw
- deflate stream with each call. inflateBackEnd() is then called to free the
- allocated state.
-
- A raw deflate stream is one with no zlib or gzip header or trailer.
- This routine would normally be used in a utility that reads zip or gzip
- files and writes out uncompressed files. The utility would decode the
- header and process the trailer on its own, hence this routine expects only
- the raw deflate stream to decompress. This is different from the normal
- behavior of inflate(), which expects either a zlib or gzip header and
- trailer around the deflate stream.
-
- inflateBack() uses two subroutines supplied by the caller that are then
- called by inflateBack() for input and output. inflateBack() calls those
- routines until it reads a complete deflate stream and writes out all of the
- uncompressed data, or until it encounters an error. The function's
- parameters and return types are defined above in the in_func and out_func
- typedefs. inflateBack() will call in(in_desc, &buf) which should return the
- number of bytes of provided input, and a pointer to that input in buf. If
- there is no input available, in() must return zero--buf is ignored in that
- case--and inflateBack() will return a buffer error. inflateBack() will call
- out(out_desc, buf, len) to write the uncompressed data buf[0..len-1]. out()
- should return zero on success, or non-zero on failure. If out() returns
- non-zero, inflateBack() will return with an error. Neither in() nor out()
- are permitted to change the contents of the window provided to
- inflateBackInit(), which is also the buffer that out() uses to write from.
- The length written by out() will be at most the window size. Any non-zero
- amount of input may be provided by in().
-
- For convenience, inflateBack() can be provided input on the first call by
- setting strm->next_in and strm->avail_in. If that input is exhausted, then
- in() will be called. Therefore strm->next_in must be initialized before
- calling inflateBack(). If strm->next_in is Z_NULL, then in() will be called
- immediately for input. If strm->next_in is not Z_NULL, then strm->avail_in
- must also be initialized, and then if strm->avail_in is not zero, input will
- initially be taken from strm->next_in[0 .. strm->avail_in - 1].
-
- The in_desc and out_desc parameters of inflateBack() is passed as the
- first parameter of in() and out() respectively when they are called. These
- descriptors can be optionally used to pass any information that the caller-
- supplied in() and out() functions need to do their job.
-
- On return, inflateBack() will set strm->next_in and strm->avail_in to
- pass back any unused input that was provided by the last in() call. The
- return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR
- if in() or out() returned an error, Z_DATA_ERROR if there was a format error
- in the deflate stream (in which case strm->msg is set to indicate the nature
- of the error), or Z_STREAM_ERROR if the stream was not properly initialized.
- In the case of Z_BUF_ERROR, an input or output error can be distinguished
- using strm->next_in which will be Z_NULL only if in() returned an error. If
- strm->next_in is not Z_NULL, then the Z_BUF_ERROR was due to out() returning
- non-zero. (in() will always be called before out(), so strm->next_in is
- assured to be defined if out() returns non-zero.) Note that inflateBack()
- cannot return Z_OK.
-*/
-
-ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm));
-/*
- All memory allocated by inflateBackInit() is freed.
-
- inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the stream
- state was inconsistent.
-*/
-
-ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void));
-/* Return flags indicating compile-time options.
-
- Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other:
- 1.0: size of uInt
- 3.2: size of uLong
- 5.4: size of voidpf (pointer)
- 7.6: size of z_off_t
-
- Compiler, assembler, and debug options:
- 8: DEBUG
- 9: ASMV or ASMINF -- use ASM code
- 10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention
- 11: 0 (reserved)
-
- One-time table building (smaller code, but not thread-safe if true):
- 12: BUILDFIXED -- build static block decoding tables when needed
- 13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed
- 14,15: 0 (reserved)
-
- Library content (indicates missing functionality):
- 16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking
- deflate code when not needed)
- 17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect
- and decode gzip streams (to avoid linking crc code)
- 18-19: 0 (reserved)
-
- Operation variations (changes in library functionality):
- 20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate
- 21: FASTEST -- deflate algorithm with only one, lowest compression level
- 22,23: 0 (reserved)
-
- The sprintf variant used by gzprintf (zero is best):
- 24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format
- 25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure!
- 26: 0 = returns value, 1 = void -- 1 means inferred string length returned
-
- Remainder:
- 27-31: 0 (reserved)
- */
-
-#ifndef Z_SOLO
-
- /* utility functions */
-
-/*
- The following utility functions are implemented on top of the basic
- stream-oriented functions. To simplify the interface, some default options
- are assumed (compression level and memory usage, standard memory allocation
- functions). The source code of these utility functions can be modified if
- you need special options.
-*/
-
-ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen,
- const Bytef *source, uLong sourceLen));
-/*
- Compresses the source buffer into the destination buffer. sourceLen is
- the byte length of the source buffer. Upon entry, destLen is the total size
- of the destination buffer, which must be at least the value returned by
- compressBound(sourceLen). Upon exit, destLen is the actual size of the
- compressed buffer.
-
- compress returns Z_OK if success, Z_MEM_ERROR if there was not
- enough memory, Z_BUF_ERROR if there was not enough room in the output
- buffer.
-*/
-
-ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen,
- const Bytef *source, uLong sourceLen,
- int level));
-/*
- Compresses the source buffer into the destination buffer. The level
- parameter has the same meaning as in deflateInit. sourceLen is the byte
- length of the source buffer. Upon entry, destLen is the total size of the
- destination buffer, which must be at least the value returned by
- compressBound(sourceLen). Upon exit, destLen is the actual size of the
- compressed buffer.
-
- compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
- memory, Z_BUF_ERROR if there was not enough room in the output buffer,
- Z_STREAM_ERROR if the level parameter is invalid.
-*/
-
-ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen));
-/*
- compressBound() returns an upper bound on the compressed size after
- compress() or compress2() on sourceLen bytes. It would be used before a
- compress() or compress2() call to allocate the destination buffer.
-*/
-
-ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen,
- const Bytef *source, uLong sourceLen));
-/*
- Decompresses the source buffer into the destination buffer. sourceLen is
- the byte length of the source buffer. Upon entry, destLen is the total size
- of the destination buffer, which must be large enough to hold the entire
- uncompressed data. (The size of the uncompressed data must have been saved
- previously by the compressor and transmitted to the decompressor by some
- mechanism outside the scope of this compression library.) Upon exit, destLen
- is the actual size of the uncompressed buffer.
-
- uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
- enough memory, Z_BUF_ERROR if there was not enough room in the output
- buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete. In
- the case where there is not enough room, uncompress() will fill the output
- buffer with the uncompressed data up to that point.
-*/
-
- /* gzip file access functions */
-
-/*
- This library supports reading and writing files in gzip (.gz) format with
- an interface similar to that of stdio, using the functions that start with
- "gz". The gzip format is different from the zlib format. gzip is a gzip
- wrapper, documented in RFC 1952, wrapped around a deflate stream.
-*/
-
-typedef struct gzFile_s *gzFile; /* semi-opaque gzip file descriptor */
-
-/*
-ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
-
- Opens a gzip (.gz) file for reading or writing. The mode parameter is as
- in fopen ("rb" or "wb") but can also include a compression level ("wb9") or
- a strategy: 'f' for filtered data as in "wb6f", 'h' for Huffman-only
- compression as in "wb1h", 'R' for run-length encoding as in "wb1R", or 'F'
- for fixed code compression as in "wb9F". (See the description of
- deflateInit2 for more information about the strategy parameter.) 'T' will
- request transparent writing or appending with no compression and not using
- the gzip format.
-
- "a" can be used instead of "w" to request that the gzip stream that will
- be written be appended to the file. "+" will result in an error, since
- reading and writing to the same gzip file is not supported. The addition of
- "x" when writing will create the file exclusively, which fails if the file
- already exists. On systems that support it, the addition of "e" when
- reading or writing will set the flag to close the file on an execve() call.
-
- These functions, as well as gzip, will read and decode a sequence of gzip
- streams in a file. The append function of gzopen() can be used to create
- such a file. (Also see gzflush() for another way to do this.) When
- appending, gzopen does not test whether the file begins with a gzip stream,
- nor does it look for the end of the gzip streams to begin appending. gzopen
- will simply append a gzip stream to the existing file.
-
- gzopen can be used to read a file which is not in gzip format; in this
- case gzread will directly read from the file without decompression. When
- reading, this will be detected automatically by looking for the magic two-
- byte gzip header.
-
- gzopen returns NULL if the file could not be opened, if there was
- insufficient memory to allocate the gzFile state, or if an invalid mode was
- specified (an 'r', 'w', or 'a' was not provided, or '+' was provided).
- errno can be checked to determine if the reason gzopen failed was that the
- file could not be opened.
-*/
-
-ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
-/*
- gzdopen associates a gzFile with the file descriptor fd. File descriptors
- are obtained from calls like open, dup, creat, pipe or fileno (if the file
- has been previously opened with fopen). The mode parameter is as in gzopen.
-
- The next call of gzclose on the returned gzFile will also close the file
- descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor
- fd. If you want to keep fd open, use fd = dup(fd_keep); gz = gzdopen(fd,
- mode);. The duplicated descriptor should be saved to avoid a leak, since
- gzdopen does not close fd if it fails. If you are using fileno() to get the
- file descriptor from a FILE *, then you will have to use dup() to avoid
- double-close()ing the file descriptor. Both gzclose() and fclose() will
- close the associated file descriptor, so they need to have different file
- descriptors.
-
- gzdopen returns NULL if there was insufficient memory to allocate the
- gzFile state, if an invalid mode was specified (an 'r', 'w', or 'a' was not
- provided, or '+' was provided), or if fd is -1. The file descriptor is not
- used until the next gz* read, write, seek, or close operation, so gzdopen
- will not detect if fd is invalid (unless fd is -1).
-*/
-
-ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size));
-/*
- Set the internal buffer size used by this library's functions. The
- default buffer size is 8192 bytes. This function must be called after
- gzopen() or gzdopen(), and before any other calls that read or write the
- file. The buffer memory allocation is always deferred to the first read or
- write. Two buffers are allocated, either both of the specified size when
- writing, or one of the specified size and the other twice that size when
- reading. A larger buffer size of, for example, 64K or 128K bytes will
- noticeably increase the speed of decompression (reading).
-
- The new buffer size also affects the maximum length for gzprintf().
-
- gzbuffer() returns 0 on success, or -1 on failure, such as being called
- too late.
-*/
-
-ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
-/*
- Dynamically update the compression level or strategy. See the description
- of deflateInit2 for the meaning of these parameters.
-
- gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not
- opened for writing.
-*/
-
-ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
-/*
- Reads the given number of uncompressed bytes from the compressed file. If
- the input file is not in gzip format, gzread copies the given number of
- bytes into the buffer directly from the file.
-
- After reaching the end of a gzip stream in the input, gzread will continue
- to read, looking for another gzip stream. Any number of gzip streams may be
- concatenated in the input file, and will all be decompressed by gzread().
- If something other than a gzip stream is encountered after a gzip stream,
- that remaining trailing garbage is ignored (and no error is returned).
-
- gzread can be used to read a gzip file that is being concurrently written.
- Upon reaching the end of the input, gzread will return with the available
- data. If the error code returned by gzerror is Z_OK or Z_BUF_ERROR, then
- gzclearerr can be used to clear the end of file indicator in order to permit
- gzread to be tried again. Z_OK indicates that a gzip stream was completed
- on the last gzread. Z_BUF_ERROR indicates that the input file ended in the
- middle of a gzip stream. Note that gzread does not return -1 in the event
- of an incomplete gzip stream. This error is deferred until gzclose(), which
- will return Z_BUF_ERROR if the last gzread ended in the middle of a gzip
- stream. Alternatively, gzerror can be used before gzclose to detect this
- case.
-
- gzread returns the number of uncompressed bytes actually read, less than
- len for end of file, or -1 for error.
-*/
-
-ZEXTERN int ZEXPORT gzwrite OF((gzFile file,
- voidpc buf, unsigned len));
-/*
- Writes the given number of uncompressed bytes into the compressed file.
- gzwrite returns the number of uncompressed bytes written or 0 in case of
- error.
-*/
-
-ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...));
-/*
- Converts, formats, and writes the arguments to the compressed file under
- control of the format string, as in fprintf. gzprintf returns the number of
- uncompressed bytes actually written, or 0 in case of error. The number of
- uncompressed bytes written is limited to 8191, or one less than the buffer
- size given to gzbuffer(). The caller should assure that this limit is not
- exceeded. If it is exceeded, then gzprintf() will return an error (0) with
- nothing written. In this case, there may also be a buffer overflow with
- unpredictable consequences, which is possible only if zlib was compiled with
- the insecure functions sprintf() or vsprintf() because the secure snprintf()
- or vsnprintf() functions were not available. This can be determined using
- zlibCompileFlags().
-*/
-
-ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
-/*
- Writes the given null-terminated string to the compressed file, excluding
- the terminating null character.
-
- gzputs returns the number of characters written, or -1 in case of error.
-*/
-
-ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
-/*
- Reads bytes from the compressed file until len-1 characters are read, or a
- newline character is read and transferred to buf, or an end-of-file
- condition is encountered. If any characters are read or if len == 1, the
- string is terminated with a null character. If no characters are read due
- to an end-of-file or len < 1, then the buffer is left untouched.
-
- gzgets returns buf which is a null-terminated string, or it returns NULL
- for end-of-file or in case of error. If there was an error, the contents at
- buf are indeterminate.
-*/
-
-ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));
-/*
- Writes c, converted to an unsigned char, into the compressed file. gzputc
- returns the value that was written, or -1 in case of error.
-*/
-
-ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
-/*
- Reads one byte from the compressed file. gzgetc returns this byte or -1
- in case of end of file or error. This is implemented as a macro for speed.
- As such, it does not do all of the checking the other functions do. I.e.
- it does not check to see if file is NULL, nor whether the structure file
- points to has been clobbered or not.
-*/
-
-ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));
-/*
- Push one character back onto the stream to be read as the first character
- on the next read. At least one character of push-back is allowed.
- gzungetc() returns the character pushed, or -1 on failure. gzungetc() will
- fail if c is -1, and may fail if a character has been pushed but not read
- yet. If gzungetc is used immediately after gzopen or gzdopen, at least the
- output buffer size of pushed characters is allowed. (See gzbuffer above.)
- The pushed character will be discarded if the stream is repositioned with
- gzseek() or gzrewind().
-*/
-
-ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
-/*
- Flushes all pending output into the compressed file. The parameter flush
- is as in the deflate() function. The return value is the zlib error number
- (see function gzerror below). gzflush is only permitted when writing.
-
- If the flush parameter is Z_FINISH, the remaining data is written and the
- gzip stream is completed in the output. If gzwrite() is called again, a new
- gzip stream will be started in the output. gzread() is able to read such
- concatented gzip streams.
-
- gzflush should be called only when strictly necessary because it will
- degrade compression if called too often.
-*/
-
-/*
-ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
- z_off_t offset, int whence));
-
- Sets the starting position for the next gzread or gzwrite on the given
- compressed file. The offset represents a number of bytes in the
- uncompressed data stream. The whence parameter is defined as in lseek(2);
- the value SEEK_END is not supported.
-
- If the file is opened for reading, this function is emulated but can be
- extremely slow. If the file is opened for writing, only forward seeks are
- supported; gzseek then compresses a sequence of zeroes up to the new
- starting position.
-
- gzseek returns the resulting offset location as measured in bytes from
- the beginning of the uncompressed stream, or -1 in case of error, in
- particular if the file is opened for writing and the new starting position
- would be before the current position.
-*/
-
-ZEXTERN int ZEXPORT gzrewind OF((gzFile file));
-/*
- Rewinds the given file. This function is supported only for reading.
-
- gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET)
-*/
-
-/*
-ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file));
-
- Returns the starting position for the next gzread or gzwrite on the given
- compressed file. This position represents a number of bytes in the
- uncompressed data stream, and is zero when starting, even if appending or
- reading a gzip stream from the middle of a file using gzdopen().
-
- gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
-*/
-
-/*
-ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file));
-
- Returns the current offset in the file being read or written. This offset
- includes the count of bytes that precede the gzip stream, for example when
- appending or when using gzdopen() for reading. When reading, the offset
- does not include as yet unused buffered input. This information can be used
- for a progress indicator. On error, gzoffset() returns -1.
-*/
-
-ZEXTERN int ZEXPORT gzeof OF((gzFile file));
-/*
- Returns true (1) if the end-of-file indicator has been set while reading,
- false (0) otherwise. Note that the end-of-file indicator is set only if the
- read tried to go past the end of the input, but came up short. Therefore,
- just like feof(), gzeof() may return false even if there is no more data to
- read, in the event that the last read request was for the exact number of
- bytes remaining in the input file. This will happen if the input file size
- is an exact multiple of the buffer size.
-
- If gzeof() returns true, then the read functions will return no more data,
- unless the end-of-file indicator is reset by gzclearerr() and the input file
- has grown since the previous end of file was detected.
-*/
-
-ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
-/*
- Returns true (1) if file is being copied directly while reading, or false
- (0) if file is a gzip stream being decompressed.
-
- If the input file is empty, gzdirect() will return true, since the input
- does not contain a gzip stream.
-
- If gzdirect() is used immediately after gzopen() or gzdopen() it will
- cause buffers to be allocated to allow reading the file to determine if it
- is a gzip file. Therefore if gzbuffer() is used, it should be called before
- gzdirect().
-
- When writing, gzdirect() returns true (1) if transparent writing was
- requested ("wT" for the gzopen() mode), or false (0) otherwise. (Note:
- gzdirect() is not needed when writing. Transparent writing must be
- explicitly requested, so the application already knows the answer. When
- linking statically, using gzdirect() will include all of the zlib code for
- gzip file reading and decompression, which may not be desired.)
-*/
-
-ZEXTERN int ZEXPORT gzclose OF((gzFile file));
-/*
- Flushes all pending output if necessary, closes the compressed file and
- deallocates the (de)compression state. Note that once file is closed, you
- cannot call gzerror with file, since its structures have been deallocated.
- gzclose must not be called more than once on the same file, just as free
- must not be called more than once on the same allocation.
-
- gzclose will return Z_STREAM_ERROR if file is not valid, Z_ERRNO on a
- file operation error, Z_MEM_ERROR if out of memory, Z_BUF_ERROR if the
- last read ended in the middle of a gzip stream, or Z_OK on success.
-*/
-
-ZEXTERN int ZEXPORT gzclose_r OF((gzFile file));
-ZEXTERN int ZEXPORT gzclose_w OF((gzFile file));
-/*
- Same as gzclose(), but gzclose_r() is only for use when reading, and
- gzclose_w() is only for use when writing or appending. The advantage to
- using these instead of gzclose() is that they avoid linking in zlib
- compression or decompression code that is not used when only reading or only
- writing respectively. If gzclose() is used, then both compression and
- decompression code will be included the application when linking to a static
- zlib library.
-*/
-
-ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
-/*
- Returns the error message for the last error which occurred on the given
- compressed file. errnum is set to zlib error number. If an error occurred
- in the file system and not in the compression library, errnum is set to
- Z_ERRNO and the application may consult errno to get the exact error code.
-
- The application must not modify the returned string. Future calls to
- this function may invalidate the previously returned string. If file is
- closed, then the string previously returned by gzerror will no longer be
- available.
-
- gzerror() should be used to distinguish errors from end-of-file for those
- functions above that do not distinguish those cases in their return values.
-*/
-
-ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
-/*
- Clears the error and end-of-file flags for file. This is analogous to the
- clearerr() function in stdio. This is useful for continuing to read a gzip
- file that is being written concurrently.
-*/
-
-#endif /* !Z_SOLO */
-
- /* checksum functions */
-
-/*
- These functions are not related to compression but are exported
- anyway because they might be useful in applications using the compression
- library.
-*/
-
-ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
-/*
- Update a running Adler-32 checksum with the bytes buf[0..len-1] and
- return the updated checksum. If buf is Z_NULL, this function returns the
- required initial value for the checksum.
-
- An Adler-32 checksum is almost as reliable as a CRC32 but can be computed
- much faster.
-
- Usage example:
-
- uLong adler = adler32(0L, Z_NULL, 0);
-
- while (read_buffer(buffer, length) != EOF) {
- adler = adler32(adler, buffer, length);
- }
- if (adler != original_adler) error();
-*/
-
-/*
-ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2,
- z_off_t len2));
-
- Combine two Adler-32 checksums into one. For two sequences of bytes, seq1
- and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for
- each, adler1 and adler2. adler32_combine() returns the Adler-32 checksum of
- seq1 and seq2 concatenated, requiring only adler1, adler2, and len2. Note
- that the z_off_t type (like off_t) is a signed integer. If len2 is
- negative, the result has no meaning or utility.
-*/
-
-ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
-/*
- Update a running CRC-32 with the bytes buf[0..len-1] and return the
- updated CRC-32. If buf is Z_NULL, this function returns the required
- initial value for the crc. Pre- and post-conditioning (one's complement) is
- performed within this function so it shouldn't be done by the application.
-
- Usage example:
-
- uLong crc = crc32(0L, Z_NULL, 0);
-
- while (read_buffer(buffer, length) != EOF) {
- crc = crc32(crc, buffer, length);
- }
- if (crc != original_crc) error();
-*/
-
-/*
-ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2));
-
- Combine two CRC-32 check values into one. For two sequences of bytes,
- seq1 and seq2 with lengths len1 and len2, CRC-32 check values were
- calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32
- check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and
- len2.
-*/
-
-
- /* various hacks, don't look :) */
-
-/* deflateInit and inflateInit are macros to allow checking the zlib version
- * and the compiler's view of z_stream:
- */
-ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level,
- const char *version, int stream_size));
-ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm,
- const char *version, int stream_size));
-ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method,
- int windowBits, int memLevel,
- int strategy, const char *version,
- int stream_size));
-ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits,
- const char *version, int stream_size));
-ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
- unsigned char FAR *window,
- const char *version,
- int stream_size));
-#define deflateInit(strm, level) \
- deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream))
-#define inflateInit(strm) \
- inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream))
-#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
- deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
- (strategy), ZLIB_VERSION, (int)sizeof(z_stream))
-#define inflateInit2(strm, windowBits) \
- inflateInit2_((strm), (windowBits), ZLIB_VERSION, \
- (int)sizeof(z_stream))
-#define inflateBackInit(strm, windowBits, window) \
- inflateBackInit_((strm), (windowBits), (window), \
- ZLIB_VERSION, (int)sizeof(z_stream))
-
-#ifndef Z_SOLO
-
-/* gzgetc() macro and its supporting function and exposed data structure. Note
- * that the real internal state is much larger than the exposed structure.
- * This abbreviated structure exposes just enough for the gzgetc() macro. The
- * user should not mess with these exposed elements, since their names or
- * behavior could change in the future, perhaps even capriciously. They can
- * only be used by the gzgetc() macro. You have been warned.
- */
-struct gzFile_s {
- unsigned have;
- unsigned char *next;
- z_off64_t pos;
-};
-ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
-#ifdef Z_PREFIX_SET
-# undef z_gzgetc
-# define z_gzgetc(g) \
- ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : gzgetc(g))
-#else
-# define gzgetc(g) \
- ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : gzgetc(g))
-#endif
-
-/* provide 64-bit offset functions if _LARGEFILE64_SOURCE defined, and/or
- * change the regular functions to 64 bits if _FILE_OFFSET_BITS is 64 (if
- * both are true, the application gets the *64 functions, and the regular
- * functions are changed to 64 bits) -- in case these are set on systems
- * without large file support, _LFS64_LARGEFILE must also be true
- */
-#ifdef Z_LARGE64
- ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
- ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int));
- ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile));
- ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile));
- ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off64_t));
- ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t));
-#endif
-
-#if !defined(ZLIB_INTERNAL) && defined(Z_WANT64)
-# ifdef Z_PREFIX_SET
-# define z_gzopen z_gzopen64
-# define z_gzseek z_gzseek64
-# define z_gztell z_gztell64
-# define z_gzoffset z_gzoffset64
-# define z_adler32_combine z_adler32_combine64
-# define z_crc32_combine z_crc32_combine64
-# else
-# define gzopen gzopen64
-# define gzseek gzseek64
-# define gztell gztell64
-# define gzoffset gzoffset64
-# define adler32_combine adler32_combine64
-# define crc32_combine crc32_combine64
-# endif
-# ifndef Z_LARGE64
- ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
- ZEXTERN off64_t ZEXPORT gzseek64 OF((gzFile, off64_t, int));
- ZEXTERN off64_t ZEXPORT gztell64 OF((gzFile));
- ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile));
- ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, off64_t));
- ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, off64_t));
-# endif
-#else
- ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *));
- ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile, z_off_t, int));
- ZEXTERN z_off_t ZEXPORT gztell OF((gzFile));
- ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile));
- ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
- ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
-#endif
-
-#else /* Z_SOLO */
-
- ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
- ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
-
-#endif /* !Z_SOLO */
-
-/* hack for buggy compilers */
-#if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL)
- struct internal_state {int dummy;};
-#endif
-
-/* undocumented functions */
-ZEXTERN const char * ZEXPORT zError OF((int));
-ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp));
-ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table OF((void));
-ZEXTERN int ZEXPORT inflateUndermine OF((z_streamp, int));
-ZEXTERN int ZEXPORT inflateResetKeep OF((z_streamp));
-ZEXTERN int ZEXPORT deflateResetKeep OF((z_streamp));
-#if defined(_WIN32) && !defined(Z_SOLO)
-ZEXTERN gzFile ZEXPORT gzopen_w OF((const wchar_t *path,
- const char *mode));
-#endif
-#if defined(STDC) || defined(Z_HAVE_STDARG_H)
-# ifndef Z_SOLO
-ZEXTERN int ZEXPORTVA gzvprintf Z_ARG((gzFile file,
- const char *format,
- va_list va));
-# endif
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* ZLIB_H */
+/* zlib.h -- interface of the 'zlib' general purpose compression library
+ version 1.2.8, April 28th, 2013
+
+ Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler
+
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any damages
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+
+ Jean-loup Gailly Mark Adler
+ jloup@gzip.org madler@alumni.caltech.edu
+
+
+ The data format used by the zlib library is described by RFCs (Request for
+ Comments) 1950 to 1952 in the files http://tools.ietf.org/html/rfc1950
+ (zlib format), rfc1951 (deflate format) and rfc1952 (gzip format).
+*/
+
+#ifndef ZLIB_H
+#define ZLIB_H
+
+#define deflate_copyright FPDFAPI_deflate_copyright
+#define adler32 FPDFAPI_adler32
+#define compress2 FPDFAPI_compress2
+#define compress FPDFAPI_compress
+#define compressBound FPDFAPI_compressBound
+#define get_crc_table FPDFAPI_get_crc_table
+#define crc32 FPDFAPI_crc32
+#define deflateInit_ FPDFAPI_deflateInit_
+#define deflateInit2_ FPDFAPI_deflateInit2_
+#define deflateSetDictionary FPDFAPI_deflateSetDictionary
+#define deflateReset FPDFAPI_deflateReset
+#define deflatePrime FPDFAPI_deflatePrime
+#define deflateParams FPDFAPI_deflateParams
+#define deflateBound FPDFAPI_deflateBound
+#define deflateSetHeader FPDFAPI_deflateSetHeader
+#define deflateTune FPDFAPI_deflateTune
+#define deflate FPDFAPI_deflate
+#define deflateEnd FPDFAPI_deflateEnd
+#define deflateCopy FPDFAPI_deflateCopy
+#define inflateBackInit_ FPDFAPI_inflateBackInit_
+#define inflateBack FPDFAPI_inflateBack
+#define inflateBackEnd FPDFAPI_inflateBackEnd
+#define inflateReset FPDFAPI_inflateReset
+#define inflateInit2_ FPDFAPI_inflateInit2_
+#define inflateInit_ FPDFAPI_inflateInit_
+#define inflate FPDFAPI_inflate
+#define inflateEnd FPDFAPI_inflateEnd
+#define inflateSetDictionary FPDFAPI_inflateSetDictionary
+#define inflateSync FPDFAPI_inflateSync
+#define inflateSyncPoint FPDFAPI_inflateSyncPoint
+#define inflateCopy FPDFAPI_inflateCopy
+#define uncompress FPDFAPI_uncompress
+#define zlibVersion FPDFAPI_zlibVersion
+#define zlibCompileFlags FPDFAPI_zlibCompileFlags
+#define zError FPDFAPI_zError
+#define z_errmsg FPDFAPI_z_errmsg
+#define zcfree FPDFAPI_zcfree
+#define zcalloc FPDFAPI_zcalloc
+#define inflate_fast FPDFAPI_inflate_fast
+#define inflate_table FPDFAPI_inflate_table
+#define inflate_copyright FPDFAPI_inflate_copyright
+#define _length_code FPDFAPI_length_code
+#define _tr_flush_block FPDFAPI_tr_flush_block
+#define _dist_code FPDFAPI_dist_code
+#define _tr_stored_block FPDFAPI_tr_stored_block
+#define _tr_init FPDFAPI_tr_init
+#define _tr_align FPDFAPI_tr_align
+#define _tr_tally FPDFAPI_tr_tally
+#define adler32_combine FPDFAPI_adler32_combine
+#define inflatePrime FPDFAPI_inflatePrime
+#define inflateGetHeader FPDFAPI_inflateGetHeader
+#define crc32_combine FPDFAPI_crc32_combine
+#define inflateReset2 FPDFAPI_inflateReset2
+#define inflateUndermine FPDFAPI_inflateUndermine
+#define inflateMark FPDFAPI_inflateMark
+#define adler32_combine64 FPDFAPI_adler32_combine64
+
+#include "zconf.h"
+
+/* Sunliang.Liu 20100908 sync the config to the old revision. NO_GZIP */
+#define NO_GZIP /* XYQ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define ZLIB_VERSION "1.2.8"
+#define ZLIB_VERNUM 0x1280
+#define ZLIB_VER_MAJOR 1
+#define ZLIB_VER_MINOR 2
+#define ZLIB_VER_REVISION 8
+#define ZLIB_VER_SUBREVISION 0
+
+/*
+ The 'zlib' compression library provides in-memory compression and
+ decompression functions, including integrity checks of the uncompressed data.
+ This version of the library supports only one compression method (deflation)
+ but other algorithms will be added later and will have the same stream
+ interface.
+
+ Compression can be done in a single step if the buffers are large enough,
+ or can be done by repeated calls of the compression function. In the latter
+ case, the application must provide more input and/or consume the output
+ (providing more output space) before each call.
+
+ The compressed data format used by default by the in-memory functions is
+ the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped
+ around a deflate stream, which is itself documented in RFC 1951.
+
+ The library also supports reading and writing files in gzip (.gz) format
+ with an interface similar to that of stdio using the functions that start
+ with "gz". The gzip format is different from the zlib format. gzip is a
+ gzip wrapper, documented in RFC 1952, wrapped around a deflate stream.
+
+ This library can optionally read and write gzip streams in memory as well.
+
+ The zlib format was designed to be compact and fast for use in memory
+ and on communications channels. The gzip format was designed for single-
+ file compression on file systems, has a larger header than zlib to maintain
+ directory information, and uses a different, slower check method than zlib.
+
+ The library does not install any signal handler. The decoder checks
+ the consistency of the compressed data, so the library should never crash
+ even in case of corrupted input.
+*/
+
+typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size));
+typedef void (*free_func) OF((voidpf opaque, voidpf address));
+
+struct internal_state;
+
+typedef struct z_stream_s {
+ z_const Bytef *next_in; /* next input byte */
+ uInt avail_in; /* number of bytes available at next_in */
+ uLong total_in; /* total number of input bytes read so far */
+
+ Bytef *next_out; /* next output byte should be put there */
+ uInt avail_out; /* remaining free space at next_out */
+ uLong total_out; /* total number of bytes output so far */
+
+ z_const char *msg; /* last error message, NULL if no error */
+ struct internal_state FAR *state; /* not visible by applications */
+
+ alloc_func zalloc; /* used to allocate the internal state */
+ free_func zfree; /* used to free the internal state */
+ voidpf opaque; /* private data object passed to zalloc and zfree */
+
+ int data_type; /* best guess about the data type: binary or text */
+ uLong adler; /* adler32 value of the uncompressed data */
+ uLong reserved; /* reserved for future use */
+} z_stream;
+
+typedef z_stream FAR *z_streamp;
+
+/*
+ gzip header information passed to and from zlib routines. See RFC 1952
+ for more details on the meanings of these fields.
+*/
+typedef struct gz_header_s {
+ int text; /* true if compressed data believed to be text */
+ uLong time; /* modification time */
+ int xflags; /* extra flags (not used when writing a gzip file) */
+ int os; /* operating system */
+ Bytef *extra; /* pointer to extra field or Z_NULL if none */
+ uInt extra_len; /* extra field length (valid if extra != Z_NULL) */
+ uInt extra_max; /* space at extra (only when reading header) */
+ Bytef *name; /* pointer to zero-terminated file name or Z_NULL */
+ uInt name_max; /* space at name (only when reading header) */
+ Bytef *comment; /* pointer to zero-terminated comment or Z_NULL */
+ uInt comm_max; /* space at comment (only when reading header) */
+ int hcrc; /* true if there was or will be a header crc */
+ int done; /* true when done reading gzip header (not used
+ when writing a gzip file) */
+} gz_header;
+
+typedef gz_header FAR *gz_headerp;
+
+/*
+ The application must update next_in and avail_in when avail_in has dropped
+ to zero. It must update next_out and avail_out when avail_out has dropped
+ to zero. The application must initialize zalloc, zfree and opaque before
+ calling the init function. All other fields are set by the compression
+ library and must not be updated by the application.
+
+ The opaque value provided by the application will be passed as the first
+ parameter for calls of zalloc and zfree. This can be useful for custom
+ memory management. The compression library attaches no meaning to the
+ opaque value.
+
+ zalloc must return Z_NULL if there is not enough memory for the object.
+ If zlib is used in a multi-threaded application, zalloc and zfree must be
+ thread safe.
+
+ On 16-bit systems, the functions zalloc and zfree must be able to allocate
+ exactly 65536 bytes, but will not be required to allocate more than this if
+ the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS, pointers
+ returned by zalloc for objects of exactly 65536 bytes *must* have their
+ offset normalized to zero. The default allocation function provided by this
+ library ensures this (see zutil.c). To reduce memory requirements and avoid
+ any allocation of 64K objects, at the expense of compression ratio, compile
+ the library with -DMAX_WBITS=14 (see zconf.h).
+
+ The fields total_in and total_out can be used for statistics or progress
+ reports. After compression, total_in holds the total size of the
+ uncompressed data and may be saved for use in the decompressor (particularly
+ if the decompressor wants to decompress everything in a single step).
+*/
+
+ /* constants */
+
+#define Z_NO_FLUSH 0
+#define Z_PARTIAL_FLUSH 1
+#define Z_SYNC_FLUSH 2
+#define Z_FULL_FLUSH 3
+#define Z_FINISH 4
+#define Z_BLOCK 5
+#define Z_TREES 6
+/* Allowed flush values; see deflate() and inflate() below for details */
+
+#define Z_OK 0
+#define Z_STREAM_END 1
+#define Z_NEED_DICT 2
+#define Z_ERRNO (-1)
+#define Z_STREAM_ERROR (-2)
+#define Z_DATA_ERROR (-3)
+#define Z_MEM_ERROR (-4)
+#define Z_BUF_ERROR (-5)
+#define Z_VERSION_ERROR (-6)
+/* Return codes for the compression/decompression functions. Negative values
+ * are errors, positive values are used for special but normal events.
+ */
+
+#define Z_NO_COMPRESSION 0
+#define Z_BEST_SPEED 1
+#define Z_BEST_COMPRESSION 9
+#define Z_DEFAULT_COMPRESSION (-1)
+/* compression levels */
+
+#define Z_FILTERED 1
+#define Z_HUFFMAN_ONLY 2
+#define Z_RLE 3
+#define Z_FIXED 4
+#define Z_DEFAULT_STRATEGY 0
+/* compression strategy; see deflateInit2() below for details */
+
+#define Z_BINARY 0
+#define Z_TEXT 1
+#define Z_ASCII Z_TEXT /* for compatibility with 1.2.2 and earlier */
+#define Z_UNKNOWN 2
+/* Possible values of the data_type field (though see inflate()) */
+
+#define Z_DEFLATED 8
+/* The deflate compression method (the only one supported in this version) */
+
+#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */
+
+#define zlib_version zlibVersion()
+/* for compatibility with versions < 1.0.2 */
+
+
+ /* basic functions */
+
+ZEXTERN const char * ZEXPORT zlibVersion OF((void));
+/* The application can compare zlibVersion and ZLIB_VERSION for consistency.
+ If the first character differs, the library code actually used is not
+ compatible with the zlib.h header file used by the application. This check
+ is automatically made by deflateInit and inflateInit.
+ */
+
+/*
+ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level));
+
+ Initializes the internal stream state for compression. The fields
+ zalloc, zfree and opaque must be initialized before by the caller. If
+ zalloc and zfree are set to Z_NULL, deflateInit updates them to use default
+ allocation functions.
+
+ The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9:
+ 1 gives best speed, 9 gives best compression, 0 gives no compression at all
+ (the input data is simply copied a block at a time). Z_DEFAULT_COMPRESSION
+ requests a default compromise between speed and compression (currently
+ equivalent to level 6).
+
+ deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
+ memory, Z_STREAM_ERROR if level is not a valid compression level, or
+ Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible
+ with the version assumed by the caller (ZLIB_VERSION). msg is set to null
+ if there is no error message. deflateInit does not perform any compression:
+ this will be done by deflate().
+*/
+
+
+ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
+/*
+ deflate compresses as much data as possible, and stops when the input
+ buffer becomes empty or the output buffer becomes full. It may introduce
+ some output latency (reading input without producing any output) except when
+ forced to flush.
+
+ The detailed semantics are as follows. deflate performs one or both of the
+ following actions:
+
+ - Compress more input starting at next_in and update next_in and avail_in
+ accordingly. If not all input can be processed (because there is not
+ enough room in the output buffer), next_in and avail_in are updated and
+ processing will resume at this point for the next call of deflate().
+
+ - Provide more output starting at next_out and update next_out and avail_out
+ accordingly. This action is forced if the parameter flush is non zero.
+ Forcing flush frequently degrades the compression ratio, so this parameter
+ should be set only when necessary (in interactive applications). Some
+ output may be provided even if flush is not set.
+
+ Before the call of deflate(), the application should ensure that at least
+ one of the actions is possible, by providing more input and/or consuming more
+ output, and updating avail_in or avail_out accordingly; avail_out should
+ never be zero before the call. The application can consume the compressed
+ output when it wants, for example when the output buffer is full (avail_out
+ == 0), or after each call of deflate(). If deflate returns Z_OK and with
+ zero avail_out, it must be called again after making room in the output
+ buffer because there might be more output pending.
+
+ Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to
+ decide how much data to accumulate before producing output, in order to
+ maximize compression.
+
+ If the parameter flush is set to Z_SYNC_FLUSH, all pending output is
+ flushed to the output buffer and the output is aligned on a byte boundary, so
+ that the decompressor can get all input data available so far. (In
+ particular avail_in is zero after the call if enough output space has been
+ provided before the call.) Flushing may degrade compression for some
+ compression algorithms and so it should be used only when necessary. This
+ completes the current deflate block and follows it with an empty stored block
+ that is three bits plus filler bits to the next byte, followed by four bytes
+ (00 00 ff ff).
+
+ If flush is set to Z_PARTIAL_FLUSH, all pending output is flushed to the
+ output buffer, but the output is not aligned to a byte boundary. All of the
+ input data so far will be available to the decompressor, as for Z_SYNC_FLUSH.
+ This completes the current deflate block and follows it with an empty fixed
+ codes block that is 10 bits long. This assures that enough bytes are output
+ in order for the decompressor to finish the block before the empty fixed code
+ block.
+
+ If flush is set to Z_BLOCK, a deflate block is completed and emitted, as
+ for Z_SYNC_FLUSH, but the output is not aligned on a byte boundary, and up to
+ seven bits of the current block are held to be written as the next byte after
+ the next deflate block is completed. In this case, the decompressor may not
+ be provided enough bits at this point in order to complete decompression of
+ the data provided so far to the compressor. It may need to wait for the next
+ block to be emitted. This is for advanced applications that need to control
+ the emission of deflate blocks.
+
+ If flush is set to Z_FULL_FLUSH, all output is flushed as with
+ Z_SYNC_FLUSH, and the compression state is reset so that decompression can
+ restart from this point if previous compressed data has been damaged or if
+ random access is desired. Using Z_FULL_FLUSH too often can seriously degrade
+ compression.
+
+ If deflate returns with avail_out == 0, this function must be called again
+ with the same value of the flush parameter and more output space (updated
+ avail_out), until the flush is complete (deflate returns with non-zero
+ avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that
+ avail_out is greater than six to avoid repeated flush markers due to
+ avail_out == 0 on return.
+
+ If the parameter flush is set to Z_FINISH, pending input is processed,
+ pending output is flushed and deflate returns with Z_STREAM_END if there was
+ enough output space; if deflate returns with Z_OK, this function must be
+ called again with Z_FINISH and more output space (updated avail_out) but no
+ more input data, until it returns with Z_STREAM_END or an error. After
+ deflate has returned Z_STREAM_END, the only possible operations on the stream
+ are deflateReset or deflateEnd.
+
+ Z_FINISH can be used immediately after deflateInit if all the compression
+ is to be done in a single step. In this case, avail_out must be at least the
+ value returned by deflateBound (see below). Then deflate is guaranteed to
+ return Z_STREAM_END. If not enough output space is provided, deflate will
+ not return Z_STREAM_END, and it must be called again as described above.
+
+ deflate() sets strm->adler to the adler32 checksum of all input read
+ so far (that is, total_in bytes).
+
+ deflate() may update strm->data_type if it can make a good guess about
+ the input data type (Z_BINARY or Z_TEXT). In doubt, the data is considered
+ binary. This field is only for information purposes and does not affect the
+ compression algorithm in any manner.
+
+ deflate() returns Z_OK if some progress has been made (more input
+ processed or more output produced), Z_STREAM_END if all input has been
+ consumed and all output has been produced (only when flush is set to
+ Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example
+ if next_in or next_out was Z_NULL), Z_BUF_ERROR if no progress is possible
+ (for example avail_in or avail_out was zero). Note that Z_BUF_ERROR is not
+ fatal, and deflate() can be called again with more input and more output
+ space to continue compressing.
+*/
+
+
+ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm));
+/*
+ All dynamically allocated data structures for this stream are freed.
+ This function discards any unprocessed input and does not flush any pending
+ output.
+
+ deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the
+ stream state was inconsistent, Z_DATA_ERROR if the stream was freed
+ prematurely (some input or output was discarded). In the error case, msg
+ may be set but then points to a static string (which must not be
+ deallocated).
+*/
+
+
+/*
+ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));
+
+ Initializes the internal stream state for decompression. The fields
+ next_in, avail_in, zalloc, zfree and opaque must be initialized before by
+ the caller. If next_in is not Z_NULL and avail_in is large enough (the
+ exact value depends on the compression method), inflateInit determines the
+ compression method from the zlib header and allocates all data structures
+ accordingly; otherwise the allocation will be deferred to the first call of
+ inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to
+ use default allocation functions.
+
+ inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
+ memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
+ version assumed by the caller, or Z_STREAM_ERROR if the parameters are
+ invalid, such as a null pointer to the structure. msg is set to null if
+ there is no error message. inflateInit does not perform any decompression
+ apart from possibly reading the zlib header if present: actual decompression
+ will be done by inflate(). (So next_in and avail_in may be modified, but
+ next_out and avail_out are unused and unchanged.) The current implementation
+ of inflateInit() does not process any header information -- that is deferred
+ until inflate() is called.
+*/
+
+
+ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
+/*
+ inflate decompresses as much data as possible, and stops when the input
+ buffer becomes empty or the output buffer becomes full. It may introduce
+ some output latency (reading input without producing any output) except when
+ forced to flush.
+
+ The detailed semantics are as follows. inflate performs one or both of the
+ following actions:
+
+ - Decompress more input starting at next_in and update next_in and avail_in
+ accordingly. If not all input can be processed (because there is not
+ enough room in the output buffer), next_in is updated and processing will
+ resume at this point for the next call of inflate().
+
+ - Provide more output starting at next_out and update next_out and avail_out
+ accordingly. inflate() provides as much output as possible, until there is
+ no more input data or no more space in the output buffer (see below about
+ the flush parameter).
+
+ Before the call of inflate(), the application should ensure that at least
+ one of the actions is possible, by providing more input and/or consuming more
+ output, and updating the next_* and avail_* values accordingly. The
+ application can consume the uncompressed output when it wants, for example
+ when the output buffer is full (avail_out == 0), or after each call of
+ inflate(). If inflate returns Z_OK and with zero avail_out, it must be
+ called again after making room in the output buffer because there might be
+ more output pending.
+
+ The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FINISH,
+ Z_BLOCK, or Z_TREES. Z_SYNC_FLUSH requests that inflate() flush as much
+ output as possible to the output buffer. Z_BLOCK requests that inflate()
+ stop if and when it gets to the next deflate block boundary. When decoding
+ the zlib or gzip format, this will cause inflate() to return immediately
+ after the header and before the first block. When doing a raw inflate,
+ inflate() will go ahead and process the first block, and will return when it
+ gets to the end of that block, or when it runs out of data.
+
+ The Z_BLOCK option assists in appending to or combining deflate streams.
+ Also to assist in this, on return inflate() will set strm->data_type to the
+ number of unused bits in the last byte taken from strm->next_in, plus 64 if
+ inflate() is currently decoding the last block in the deflate stream, plus
+ 128 if inflate() returned immediately after decoding an end-of-block code or
+ decoding the complete header up to just before the first byte of the deflate
+ stream. The end-of-block will not be indicated until all of the uncompressed
+ data from that block has been written to strm->next_out. The number of
+ unused bits may in general be greater than seven, except when bit 7 of
+ data_type is set, in which case the number of unused bits will be less than
+ eight. data_type is set as noted here every time inflate() returns for all
+ flush options, and so can be used to determine the amount of currently
+ consumed input in bits.
+
+ The Z_TREES option behaves as Z_BLOCK does, but it also returns when the
+ end of each deflate block header is reached, before any actual data in that
+ block is decoded. This allows the caller to determine the length of the
+ deflate block header for later use in random access within a deflate block.
+ 256 is added to the value of strm->data_type when inflate() returns
+ immediately after reaching the end of the deflate block header.
+
+ inflate() should normally be called until it returns Z_STREAM_END or an
+ error. However if all decompression is to be performed in a single step (a
+ single call of inflate), the parameter flush should be set to Z_FINISH. In
+ this case all pending input is processed and all pending output is flushed;
+ avail_out must be large enough to hold all of the uncompressed data for the
+ operation to complete. (The size of the uncompressed data may have been
+ saved by the compressor for this purpose.) The use of Z_FINISH is not
+ required to perform an inflation in one step. However it may be used to
+ inform inflate that a faster approach can be used for the single inflate()
+ call. Z_FINISH also informs inflate to not maintain a sliding window if the
+ stream completes, which reduces inflate's memory footprint. If the stream
+ does not complete, either because not all of the stream is provided or not
+ enough output space is provided, then a sliding window will be allocated and
+ inflate() can be called again to continue the operation as if Z_NO_FLUSH had
+ been used.
+
+ In this implementation, inflate() always flushes as much output as
+ possible to the output buffer, and always uses the faster approach on the
+ first call. So the effects of the flush parameter in this implementation are
+ on the return value of inflate() as noted below, when inflate() returns early
+ when Z_BLOCK or Z_TREES is used, and when inflate() avoids the allocation of
+ memory for a sliding window when Z_FINISH is used.
+
+ If a preset dictionary is needed after this call (see inflateSetDictionary
+ below), inflate sets strm->adler to the Adler-32 checksum of the dictionary
+ chosen by the compressor and returns Z_NEED_DICT; otherwise it sets
+ strm->adler to the Adler-32 checksum of all output produced so far (that is,
+ total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described
+ below. At the end of the stream, inflate() checks that its computed adler32
+ checksum is equal to that saved by the compressor and returns Z_STREAM_END
+ only if the checksum is correct.
+
+ inflate() can decompress and check either zlib-wrapped or gzip-wrapped
+ deflate data. The header type is detected automatically, if requested when
+ initializing with inflateInit2(). Any information contained in the gzip
+ header is not retained, so applications that need that information should
+ instead use raw inflate, see inflateInit2() below, or inflateBack() and
+ perform their own processing of the gzip header and trailer. When processing
+ gzip-wrapped deflate data, strm->adler32 is set to the CRC-32 of the output
+ producted so far. The CRC-32 is checked against the gzip trailer.
+
+ inflate() returns Z_OK if some progress has been made (more input processed
+ or more output produced), Z_STREAM_END if the end of the compressed data has
+ been reached and all uncompressed output has been produced, Z_NEED_DICT if a
+ preset dictionary is needed at this point, Z_DATA_ERROR if the input data was
+ corrupted (input stream not conforming to the zlib format or incorrect check
+ value), Z_STREAM_ERROR if the stream structure was inconsistent (for example
+ next_in or next_out was Z_NULL), Z_MEM_ERROR if there was not enough memory,
+ Z_BUF_ERROR if no progress is possible or if there was not enough room in the
+ output buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and
+ inflate() can be called again with more input and more output space to
+ continue decompressing. If Z_DATA_ERROR is returned, the application may
+ then call inflateSync() to look for a good compression block if a partial
+ recovery of the data is desired.
+*/
+
+
+ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));
+/*
+ All dynamically allocated data structures for this stream are freed.
+ This function discards any unprocessed input and does not flush any pending
+ output.
+
+ inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state
+ was inconsistent. In the error case, msg may be set but then points to a
+ static string (which must not be deallocated).
+*/
+
+
+ /* Advanced functions */
+
+/*
+ The following functions are needed only in some special applications.
+*/
+
+/*
+ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
+ int level,
+ int method,
+ int windowBits,
+ int memLevel,
+ int strategy));
+
+ This is another version of deflateInit with more compression options. The
+ fields next_in, zalloc, zfree and opaque must be initialized before by the
+ caller.
+
+ The method parameter is the compression method. It must be Z_DEFLATED in
+ this version of the library.
+
+ The windowBits parameter is the base two logarithm of the window size
+ (the size of the history buffer). It should be in the range 8..15 for this
+ version of the library. Larger values of this parameter result in better
+ compression at the expense of memory usage. The default value is 15 if
+ deflateInit is used instead.
+
+ windowBits can also be -8..-15 for raw deflate. In this case, -windowBits
+ determines the window size. deflate() will then generate raw deflate data
+ with no zlib header or trailer, and will not compute an adler32 check value.
+
+ windowBits can also be greater than 15 for optional gzip encoding. Add
+ 16 to windowBits to write a simple gzip header and trailer around the
+ compressed data instead of a zlib wrapper. The gzip header will have no
+ file name, no extra data, no comment, no modification time (set to zero), no
+ header crc, and the operating system will be set to 255 (unknown). If a
+ gzip stream is being written, strm->adler is a crc32 instead of an adler32.
+
+ The memLevel parameter specifies how much memory should be allocated
+ for the internal compression state. memLevel=1 uses minimum memory but is
+ slow and reduces compression ratio; memLevel=9 uses maximum memory for
+ optimal speed. The default value is 8. See zconf.h for total memory usage
+ as a function of windowBits and memLevel.
+
+ The strategy parameter is used to tune the compression algorithm. Use the
+ value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a
+ filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no
+ string match), or Z_RLE to limit match distances to one (run-length
+ encoding). Filtered data consists mostly of small values with a somewhat
+ random distribution. In this case, the compression algorithm is tuned to
+ compress them better. The effect of Z_FILTERED is to force more Huffman
+ coding and less string matching; it is somewhat intermediate between
+ Z_DEFAULT_STRATEGY and Z_HUFFMAN_ONLY. Z_RLE is designed to be almost as
+ fast as Z_HUFFMAN_ONLY, but give better compression for PNG image data. The
+ strategy parameter only affects the compression ratio but not the
+ correctness of the compressed output even if it is not set appropriately.
+ Z_FIXED prevents the use of dynamic Huffman codes, allowing for a simpler
+ decoder for special applications.
+
+ deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+ memory, Z_STREAM_ERROR if any parameter is invalid (such as an invalid
+ method), or Z_VERSION_ERROR if the zlib library version (zlib_version) is
+ incompatible with the version assumed by the caller (ZLIB_VERSION). msg is
+ set to null if there is no error message. deflateInit2 does not perform any
+ compression: this will be done by deflate().
+*/
+
+ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
+ const Bytef *dictionary,
+ uInt dictLength));
+/*
+ Initializes the compression dictionary from the given byte sequence
+ without producing any compressed output. When using the zlib format, this
+ function must be called immediately after deflateInit, deflateInit2 or
+ deflateReset, and before any call of deflate. When doing raw deflate, this
+ function must be called either before any call of deflate, or immediately
+ after the completion of a deflate block, i.e. after all input has been
+ consumed and all output has been delivered when using any of the flush
+ options Z_BLOCK, Z_PARTIAL_FLUSH, Z_SYNC_FLUSH, or Z_FULL_FLUSH. The
+ compressor and decompressor must use exactly the same dictionary (see
+ inflateSetDictionary).
+
+ The dictionary should consist of strings (byte sequences) that are likely
+ to be encountered later in the data to be compressed, with the most commonly
+ used strings preferably put towards the end of the dictionary. Using a
+ dictionary is most useful when the data to be compressed is short and can be
+ predicted with good accuracy; the data can then be compressed better than
+ with the default empty dictionary.
+
+ Depending on the size of the compression data structures selected by
+ deflateInit or deflateInit2, a part of the dictionary may in effect be
+ discarded, for example if the dictionary is larger than the window size
+ provided in deflateInit or deflateInit2. Thus the strings most likely to be
+ useful should be put at the end of the dictionary, not at the front. In
+ addition, the current implementation of deflate will use at most the window
+ size minus 262 bytes of the provided dictionary.
+
+ Upon return of this function, strm->adler is set to the adler32 value
+ of the dictionary; the decompressor may later use this value to determine
+ which dictionary has been used by the compressor. (The adler32 value
+ applies to the whole dictionary even if only a subset of the dictionary is
+ actually used by the compressor.) If a raw deflate was requested, then the
+ adler32 value is not computed and strm->adler is not set.
+
+ deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a
+ parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is
+ inconsistent (for example if deflate has already been called for this stream
+ or if not at a block boundary for raw deflate). deflateSetDictionary does
+ not perform any compression: this will be done by deflate().
+*/
+
+ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest,
+ z_streamp source));
+/*
+ Sets the destination stream as a complete copy of the source stream.
+
+ This function can be useful when several compression strategies will be
+ tried, for example when there are several ways of pre-processing the input
+ data with a filter. The streams that will be discarded should then be freed
+ by calling deflateEnd. Note that deflateCopy duplicates the internal
+ compression state which can be quite large, so this strategy is slow and can
+ consume lots of memory.
+
+ deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
+ enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
+ (such as zalloc being Z_NULL). msg is left unchanged in both source and
+ destination.
+*/
+
+ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm));
+/*
+ This function is equivalent to deflateEnd followed by deflateInit,
+ but does not free and reallocate all the internal compression state. The
+ stream will keep the same compression level and any other attributes that
+ may have been set by deflateInit2.
+
+ deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
+ stream state was inconsistent (such as zalloc or state being Z_NULL).
+*/
+
+ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
+ int level,
+ int strategy));
+/*
+ Dynamically update the compression level and compression strategy. The
+ interpretation of level and strategy is as in deflateInit2. This can be
+ used to switch between compression and straight copy of the input data, or
+ to switch to a different kind of input data requiring a different strategy.
+ If the compression level is changed, the input available so far is
+ compressed with the old level (and may be flushed); the new level will take
+ effect only at the next call of deflate().
+
+ Before the call of deflateParams, the stream state must be set as for
+ a call of deflate(), since the currently available input may have to be
+ compressed and flushed. In particular, strm->avail_out must be non-zero.
+
+ deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source
+ stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR if
+ strm->avail_out was zero.
+*/
+
+ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm,
+ int good_length,
+ int max_lazy,
+ int nice_length,
+ int max_chain));
+/*
+ Fine tune deflate's internal compression parameters. This should only be
+ used by someone who understands the algorithm used by zlib's deflate for
+ searching for the best matching string, and even then only by the most
+ fanatic optimizer trying to squeeze out the last compressed bit for their
+ specific input data. Read the deflate.c source code for the meaning of the
+ max_lazy, good_length, nice_length, and max_chain parameters.
+
+ deflateTune() can be called after deflateInit() or deflateInit2(), and
+ returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream.
+ */
+
+ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm,
+ uLong sourceLen));
+/*
+ deflateBound() returns an upper bound on the compressed size after
+ deflation of sourceLen bytes. It must be called after deflateInit() or
+ deflateInit2(), and after deflateSetHeader(), if used. This would be used
+ to allocate an output buffer for deflation in a single pass, and so would be
+ called before deflate(). If that first deflate() call is provided the
+ sourceLen input bytes, an output buffer allocated to the size returned by
+ deflateBound(), and the flush value Z_FINISH, then deflate() is guaranteed
+ to return Z_STREAM_END. Note that it is possible for the compressed size to
+ be larger than the value returned by deflateBound() if flush options other
+ than Z_FINISH or Z_NO_FLUSH are used.
+*/
+
+ZEXTERN int ZEXPORT deflatePending OF((z_streamp strm,
+ unsigned *pending,
+ int *bits));
+/*
+ deflatePending() returns the number of bytes and bits of output that have
+ been generated, but not yet provided in the available output. The bytes not
+ provided would be due to the available output space having being consumed.
+ The number of bits of output not provided are between 0 and 7, where they
+ await more bits to join them in order to fill out a full byte. If pending
+ or bits are Z_NULL, then those values are not set.
+
+ deflatePending returns Z_OK if success, or Z_STREAM_ERROR if the source
+ stream state was inconsistent.
+ */
+
+ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm,
+ int bits,
+ int value));
+/*
+ deflatePrime() inserts bits in the deflate output stream. The intent
+ is that this function is used to start off the deflate output with the bits
+ leftover from a previous deflate stream when appending to it. As such, this
+ function can only be used for raw deflate, and must be used before the first
+ deflate() call after a deflateInit2() or deflateReset(). bits must be less
+ than or equal to 16, and that many of the least significant bits of value
+ will be inserted in the output.
+
+ deflatePrime returns Z_OK if success, Z_BUF_ERROR if there was not enough
+ room in the internal buffer to insert the bits, or Z_STREAM_ERROR if the
+ source stream state was inconsistent.
+*/
+
+ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm,
+ gz_headerp head));
+/*
+ deflateSetHeader() provides gzip header information for when a gzip
+ stream is requested by deflateInit2(). deflateSetHeader() may be called
+ after deflateInit2() or deflateReset() and before the first call of
+ deflate(). The text, time, os, extra field, name, and comment information
+ in the provided gz_header structure are written to the gzip header (xflag is
+ ignored -- the extra flags are set according to the compression level). The
+ caller must assure that, if not Z_NULL, name and comment are terminated with
+ a zero byte, and that if extra is not Z_NULL, that extra_len bytes are
+ available there. If hcrc is true, a gzip header crc is included. Note that
+ the current versions of the command-line version of gzip (up through version
+ 1.3.x) do not support header crc's, and will report that it is a "multi-part
+ gzip file" and give up.
+
+ If deflateSetHeader is not used, the default gzip header has text false,
+ the time set to zero, and os set to 255, with no extra, name, or comment
+ fields. The gzip header is returned to the default state by deflateReset().
+
+ deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source
+ stream state was inconsistent.
+*/
+
+/*
+ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
+ int windowBits));
+
+ This is another version of inflateInit with an extra parameter. The
+ fields next_in, avail_in, zalloc, zfree and opaque must be initialized
+ before by the caller.
+
+ The windowBits parameter is the base two logarithm of the maximum window
+ size (the size of the history buffer). It should be in the range 8..15 for
+ this version of the library. The default value is 15 if inflateInit is used
+ instead. windowBits must be greater than or equal to the windowBits value
+ provided to deflateInit2() while compressing, or it must be equal to 15 if
+ deflateInit2() was not used. If a compressed stream with a larger window
+ size is given as input, inflate() will return with the error code
+ Z_DATA_ERROR instead of trying to allocate a larger window.
+
+ windowBits can also be zero to request that inflate use the window size in
+ the zlib header of the compressed stream.
+
+ windowBits can also be -8..-15 for raw inflate. In this case, -windowBits
+ determines the window size. inflate() will then process raw deflate data,
+ not looking for a zlib or gzip header, not generating a check value, and not
+ looking for any check values for comparison at the end of the stream. This
+ is for use with other formats that use the deflate compressed data format
+ such as zip. Those formats provide their own check values. If a custom
+ format is developed using the raw deflate format for compressed data, it is
+ recommended that a check value such as an adler32 or a crc32 be applied to
+ the uncompressed data as is done in the zlib, gzip, and zip formats. For
+ most applications, the zlib format should be used as is. Note that comments
+ above on the use in deflateInit2() applies to the magnitude of windowBits.
+
+ windowBits can also be greater than 15 for optional gzip decoding. Add
+ 32 to windowBits to enable zlib and gzip decoding with automatic header
+ detection, or add 16 to decode only the gzip format (the zlib format will
+ return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is a
+ crc32 instead of an adler32.
+
+ inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+ memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
+ version assumed by the caller, or Z_STREAM_ERROR if the parameters are
+ invalid, such as a null pointer to the structure. msg is set to null if
+ there is no error message. inflateInit2 does not perform any decompression
+ apart from possibly reading the zlib header if present: actual decompression
+ will be done by inflate(). (So next_in and avail_in may be modified, but
+ next_out and avail_out are unused and unchanged.) The current implementation
+ of inflateInit2() does not process any header information -- that is
+ deferred until inflate() is called.
+*/
+
+ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
+ const Bytef *dictionary,
+ uInt dictLength));
+/*
+ Initializes the decompression dictionary from the given uncompressed byte
+ sequence. This function must be called immediately after a call of inflate,
+ if that call returned Z_NEED_DICT. The dictionary chosen by the compressor
+ can be determined from the adler32 value returned by that call of inflate.
+ The compressor and decompressor must use exactly the same dictionary (see
+ deflateSetDictionary). For raw inflate, this function can be called at any
+ time to set the dictionary. If the provided dictionary is smaller than the
+ window and there is already data in the window, then the provided dictionary
+ will amend what's there. The application must insure that the dictionary
+ that was used for compression is provided.
+
+ inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a
+ parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is
+ inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the
+ expected one (incorrect adler32 value). inflateSetDictionary does not
+ perform any decompression: this will be done by subsequent calls of
+ inflate().
+*/
+
+ZEXTERN int ZEXPORT inflateGetDictionary OF((z_streamp strm,
+ Bytef *dictionary,
+ uInt *dictLength));
+/*
+ Returns the sliding dictionary being maintained by inflate. dictLength is
+ set to the number of bytes in the dictionary, and that many bytes are copied
+ to dictionary. dictionary must have enough space, where 32768 bytes is
+ always enough. If inflateGetDictionary() is called with dictionary equal to
+ Z_NULL, then only the dictionary length is returned, and nothing is copied.
+ Similary, if dictLength is Z_NULL, then it is not set.
+
+ inflateGetDictionary returns Z_OK on success, or Z_STREAM_ERROR if the
+ stream state is inconsistent.
+*/
+
+ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm));
+/*
+ Skips invalid compressed data until a possible full flush point (see above
+ for the description of deflate with Z_FULL_FLUSH) can be found, or until all
+ available input is skipped. No output is provided.
+
+ inflateSync searches for a 00 00 FF FF pattern in the compressed data.
+ All full flush points have this pattern, but not all occurrences of this
+ pattern are full flush points.
+
+ inflateSync returns Z_OK if a possible full flush point has been found,
+ Z_BUF_ERROR if no more input was provided, Z_DATA_ERROR if no flush point
+ has been found, or Z_STREAM_ERROR if the stream structure was inconsistent.
+ In the success case, the application may save the current current value of
+ total_in which indicates where valid compressed data was found. In the
+ error case, the application may repeatedly call inflateSync, providing more
+ input each time, until success or end of the input data.
+*/
+
+ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest,
+ z_streamp source));
+/*
+ Sets the destination stream as a complete copy of the source stream.
+
+ This function can be useful when randomly accessing a large stream. The
+ first pass through the stream can periodically record the inflate state,
+ allowing restarting inflate at those points when randomly accessing the
+ stream.
+
+ inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
+ enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
+ (such as zalloc being Z_NULL). msg is left unchanged in both source and
+ destination.
+*/
+
+ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm));
+/*
+ This function is equivalent to inflateEnd followed by inflateInit,
+ but does not free and reallocate all the internal decompression state. The
+ stream will keep attributes that may have been set by inflateInit2.
+
+ inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
+ stream state was inconsistent (such as zalloc or state being Z_NULL).
+*/
+
+ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm,
+ int windowBits));
+/*
+ This function is the same as inflateReset, but it also permits changing
+ the wrap and window size requests. The windowBits parameter is interpreted
+ the same as it is for inflateInit2.
+
+ inflateReset2 returns Z_OK if success, or Z_STREAM_ERROR if the source
+ stream state was inconsistent (such as zalloc or state being Z_NULL), or if
+ the windowBits parameter is invalid.
+*/
+
+ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm,
+ int bits,
+ int value));
+/*
+ This function inserts bits in the inflate input stream. The intent is
+ that this function is used to start inflating at a bit position in the
+ middle of a byte. The provided bits will be used before any bytes are used
+ from next_in. This function should only be used with raw inflate, and
+ should be used before the first inflate() call after inflateInit2() or
+ inflateReset(). bits must be less than or equal to 16, and that many of the
+ least significant bits of value will be inserted in the input.
+
+ If bits is negative, then the input stream bit buffer is emptied. Then
+ inflatePrime() can be called again to put bits in the buffer. This is used
+ to clear out bits leftover after feeding inflate a block description prior
+ to feeding inflate codes.
+
+ inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source
+ stream state was inconsistent.
+*/
+
+ZEXTERN long ZEXPORT inflateMark OF((z_streamp strm));
+/*
+ This function returns two values, one in the lower 16 bits of the return
+ value, and the other in the remaining upper bits, obtained by shifting the
+ return value down 16 bits. If the upper value is -1 and the lower value is
+ zero, then inflate() is currently decoding information outside of a block.
+ If the upper value is -1 and the lower value is non-zero, then inflate is in
+ the middle of a stored block, with the lower value equaling the number of
+ bytes from the input remaining to copy. If the upper value is not -1, then
+ it is the number of bits back from the current bit position in the input of
+ the code (literal or length/distance pair) currently being processed. In
+ that case the lower value is the number of bytes already emitted for that
+ code.
+
+ A code is being processed if inflate is waiting for more input to complete
+ decoding of the code, or if it has completed decoding but is waiting for
+ more output space to write the literal or match data.
+
+ inflateMark() is used to mark locations in the input data for random
+ access, which may be at bit positions, and to note those cases where the
+ output of a code may span boundaries of random access blocks. The current
+ location in the input stream can be determined from avail_in and data_type
+ as noted in the description for the Z_BLOCK flush parameter for inflate.
+
+ inflateMark returns the value noted above or -1 << 16 if the provided
+ source stream state was inconsistent.
+*/
+
+ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm,
+ gz_headerp head));
+/*
+ inflateGetHeader() requests that gzip header information be stored in the
+ provided gz_header structure. inflateGetHeader() may be called after
+ inflateInit2() or inflateReset(), and before the first call of inflate().
+ As inflate() processes the gzip stream, head->done is zero until the header
+ is completed, at which time head->done is set to one. If a zlib stream is
+ being decoded, then head->done is set to -1 to indicate that there will be
+ no gzip header information forthcoming. Note that Z_BLOCK or Z_TREES can be
+ used to force inflate() to return immediately after header processing is
+ complete and before any actual data is decompressed.
+
+ The text, time, xflags, and os fields are filled in with the gzip header
+ contents. hcrc is set to true if there is a header CRC. (The header CRC
+ was valid if done is set to one.) If extra is not Z_NULL, then extra_max
+ contains the maximum number of bytes to write to extra. Once done is true,
+ extra_len contains the actual extra field length, and extra contains the
+ extra field, or that field truncated if extra_max is less than extra_len.
+ If name is not Z_NULL, then up to name_max characters are written there,
+ terminated with a zero unless the length is greater than name_max. If
+ comment is not Z_NULL, then up to comm_max characters are written there,
+ terminated with a zero unless the length is greater than comm_max. When any
+ of extra, name, or comment are not Z_NULL and the respective field is not
+ present in the header, then that field is set to Z_NULL to signal its
+ absence. This allows the use of deflateSetHeader() with the returned
+ structure to duplicate the header. However if those fields are set to
+ allocated memory, then the application will need to save those pointers
+ elsewhere so that they can be eventually freed.
+
+ If inflateGetHeader is not used, then the header information is simply
+ discarded. The header is always checked for validity, including the header
+ CRC if present. inflateReset() will reset the process to discard the header
+ information. The application would need to call inflateGetHeader() again to
+ retrieve the header from the next gzip stream.
+
+ inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source
+ stream state was inconsistent.
+*/
+
+/*
+ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits,
+ unsigned char FAR *window));
+
+ Initialize the internal stream state for decompression using inflateBack()
+ calls. The fields zalloc, zfree and opaque in strm must be initialized
+ before the call. If zalloc and zfree are Z_NULL, then the default library-
+ derived memory allocation routines are used. windowBits is the base two
+ logarithm of the window size, in the range 8..15. window is a caller
+ supplied buffer of that size. Except for special applications where it is
+ assured that deflate was used with small window sizes, windowBits must be 15
+ and a 32K byte window must be supplied to be able to decompress general
+ deflate streams.
+
+ See inflateBack() for the usage of these routines.
+
+ inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of
+ the parameters are invalid, Z_MEM_ERROR if the internal state could not be
+ allocated, or Z_VERSION_ERROR if the version of the library does not match
+ the version of the header file.
+*/
+
+typedef unsigned (*in_func) OF((void FAR *,
+ z_const unsigned char FAR * FAR *));
+typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned));
+
+ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm,
+ in_func in, void FAR *in_desc,
+ out_func out, void FAR *out_desc));
+/*
+ inflateBack() does a raw inflate with a single call using a call-back
+ interface for input and output. This is potentially more efficient than
+ inflate() for file i/o applications, in that it avoids copying between the
+ output and the sliding window by simply making the window itself the output
+ buffer. inflate() can be faster on modern CPUs when used with large
+ buffers. inflateBack() trusts the application to not change the output
+ buffer passed by the output function, at least until inflateBack() returns.
+
+ inflateBackInit() must be called first to allocate the internal state
+ and to initialize the state with the user-provided window buffer.
+ inflateBack() may then be used multiple times to inflate a complete, raw
+ deflate stream with each call. inflateBackEnd() is then called to free the
+ allocated state.
+
+ A raw deflate stream is one with no zlib or gzip header or trailer.
+ This routine would normally be used in a utility that reads zip or gzip
+ files and writes out uncompressed files. The utility would decode the
+ header and process the trailer on its own, hence this routine expects only
+ the raw deflate stream to decompress. This is different from the normal
+ behavior of inflate(), which expects either a zlib or gzip header and
+ trailer around the deflate stream.
+
+ inflateBack() uses two subroutines supplied by the caller that are then
+ called by inflateBack() for input and output. inflateBack() calls those
+ routines until it reads a complete deflate stream and writes out all of the
+ uncompressed data, or until it encounters an error. The function's
+ parameters and return types are defined above in the in_func and out_func
+ typedefs. inflateBack() will call in(in_desc, &buf) which should return the
+ number of bytes of provided input, and a pointer to that input in buf. If
+ there is no input available, in() must return zero--buf is ignored in that
+ case--and inflateBack() will return a buffer error. inflateBack() will call
+ out(out_desc, buf, len) to write the uncompressed data buf[0..len-1]. out()
+ should return zero on success, or non-zero on failure. If out() returns
+ non-zero, inflateBack() will return with an error. Neither in() nor out()
+ are permitted to change the contents of the window provided to
+ inflateBackInit(), which is also the buffer that out() uses to write from.
+ The length written by out() will be at most the window size. Any non-zero
+ amount of input may be provided by in().
+
+ For convenience, inflateBack() can be provided input on the first call by
+ setting strm->next_in and strm->avail_in. If that input is exhausted, then
+ in() will be called. Therefore strm->next_in must be initialized before
+ calling inflateBack(). If strm->next_in is Z_NULL, then in() will be called
+ immediately for input. If strm->next_in is not Z_NULL, then strm->avail_in
+ must also be initialized, and then if strm->avail_in is not zero, input will
+ initially be taken from strm->next_in[0 .. strm->avail_in - 1].
+
+ The in_desc and out_desc parameters of inflateBack() is passed as the
+ first parameter of in() and out() respectively when they are called. These
+ descriptors can be optionally used to pass any information that the caller-
+ supplied in() and out() functions need to do their job.
+
+ On return, inflateBack() will set strm->next_in and strm->avail_in to
+ pass back any unused input that was provided by the last in() call. The
+ return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR
+ if in() or out() returned an error, Z_DATA_ERROR if there was a format error
+ in the deflate stream (in which case strm->msg is set to indicate the nature
+ of the error), or Z_STREAM_ERROR if the stream was not properly initialized.
+ In the case of Z_BUF_ERROR, an input or output error can be distinguished
+ using strm->next_in which will be Z_NULL only if in() returned an error. If
+ strm->next_in is not Z_NULL, then the Z_BUF_ERROR was due to out() returning
+ non-zero. (in() will always be called before out(), so strm->next_in is
+ assured to be defined if out() returns non-zero.) Note that inflateBack()
+ cannot return Z_OK.
+*/
+
+ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm));
+/*
+ All memory allocated by inflateBackInit() is freed.
+
+ inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the stream
+ state was inconsistent.
+*/
+
+ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void));
+/* Return flags indicating compile-time options.
+
+ Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other:
+ 1.0: size of uInt
+ 3.2: size of uLong
+ 5.4: size of voidpf (pointer)
+ 7.6: size of z_off_t
+
+ Compiler, assembler, and debug options:
+ 8: DEBUG
+ 9: ASMV or ASMINF -- use ASM code
+ 10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention
+ 11: 0 (reserved)
+
+ One-time table building (smaller code, but not thread-safe if true):
+ 12: BUILDFIXED -- build static block decoding tables when needed
+ 13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed
+ 14,15: 0 (reserved)
+
+ Library content (indicates missing functionality):
+ 16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking
+ deflate code when not needed)
+ 17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect
+ and decode gzip streams (to avoid linking crc code)
+ 18-19: 0 (reserved)
+
+ Operation variations (changes in library functionality):
+ 20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate
+ 21: FASTEST -- deflate algorithm with only one, lowest compression level
+ 22,23: 0 (reserved)
+
+ The sprintf variant used by gzprintf (zero is best):
+ 24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format
+ 25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure!
+ 26: 0 = returns value, 1 = void -- 1 means inferred string length returned
+
+ Remainder:
+ 27-31: 0 (reserved)
+ */
+
+#ifndef Z_SOLO
+
+ /* utility functions */
+
+/*
+ The following utility functions are implemented on top of the basic
+ stream-oriented functions. To simplify the interface, some default options
+ are assumed (compression level and memory usage, standard memory allocation
+ functions). The source code of these utility functions can be modified if
+ you need special options.
+*/
+
+ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen,
+ const Bytef *source, uLong sourceLen));
+/*
+ Compresses the source buffer into the destination buffer. sourceLen is
+ the byte length of the source buffer. Upon entry, destLen is the total size
+ of the destination buffer, which must be at least the value returned by
+ compressBound(sourceLen). Upon exit, destLen is the actual size of the
+ compressed buffer.
+
+ compress returns Z_OK if success, Z_MEM_ERROR if there was not
+ enough memory, Z_BUF_ERROR if there was not enough room in the output
+ buffer.
+*/
+
+ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen,
+ const Bytef *source, uLong sourceLen,
+ int level));
+/*
+ Compresses the source buffer into the destination buffer. The level
+ parameter has the same meaning as in deflateInit. sourceLen is the byte
+ length of the source buffer. Upon entry, destLen is the total size of the
+ destination buffer, which must be at least the value returned by
+ compressBound(sourceLen). Upon exit, destLen is the actual size of the
+ compressed buffer.
+
+ compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+ memory, Z_BUF_ERROR if there was not enough room in the output buffer,
+ Z_STREAM_ERROR if the level parameter is invalid.
+*/
+
+ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen));
+/*
+ compressBound() returns an upper bound on the compressed size after
+ compress() or compress2() on sourceLen bytes. It would be used before a
+ compress() or compress2() call to allocate the destination buffer.
+*/
+
+ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen,
+ const Bytef *source, uLong sourceLen));
+/*
+ Decompresses the source buffer into the destination buffer. sourceLen is
+ the byte length of the source buffer. Upon entry, destLen is the total size
+ of the destination buffer, which must be large enough to hold the entire
+ uncompressed data. (The size of the uncompressed data must have been saved
+ previously by the compressor and transmitted to the decompressor by some
+ mechanism outside the scope of this compression library.) Upon exit, destLen
+ is the actual size of the uncompressed buffer.
+
+ uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
+ enough memory, Z_BUF_ERROR if there was not enough room in the output
+ buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete. In
+ the case where there is not enough room, uncompress() will fill the output
+ buffer with the uncompressed data up to that point.
+*/
+
+ /* gzip file access functions */
+
+/*
+ This library supports reading and writing files in gzip (.gz) format with
+ an interface similar to that of stdio, using the functions that start with
+ "gz". The gzip format is different from the zlib format. gzip is a gzip
+ wrapper, documented in RFC 1952, wrapped around a deflate stream.
+*/
+
+typedef struct gzFile_s *gzFile; /* semi-opaque gzip file descriptor */
+
+/*
+ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
+
+ Opens a gzip (.gz) file for reading or writing. The mode parameter is as
+ in fopen ("rb" or "wb") but can also include a compression level ("wb9") or
+ a strategy: 'f' for filtered data as in "wb6f", 'h' for Huffman-only
+ compression as in "wb1h", 'R' for run-length encoding as in "wb1R", or 'F'
+ for fixed code compression as in "wb9F". (See the description of
+ deflateInit2 for more information about the strategy parameter.) 'T' will
+ request transparent writing or appending with no compression and not using
+ the gzip format.
+
+ "a" can be used instead of "w" to request that the gzip stream that will
+ be written be appended to the file. "+" will result in an error, since
+ reading and writing to the same gzip file is not supported. The addition of
+ "x" when writing will create the file exclusively, which fails if the file
+ already exists. On systems that support it, the addition of "e" when
+ reading or writing will set the flag to close the file on an execve() call.
+
+ These functions, as well as gzip, will read and decode a sequence of gzip
+ streams in a file. The append function of gzopen() can be used to create
+ such a file. (Also see gzflush() for another way to do this.) When
+ appending, gzopen does not test whether the file begins with a gzip stream,
+ nor does it look for the end of the gzip streams to begin appending. gzopen
+ will simply append a gzip stream to the existing file.
+
+ gzopen can be used to read a file which is not in gzip format; in this
+ case gzread will directly read from the file without decompression. When
+ reading, this will be detected automatically by looking for the magic two-
+ byte gzip header.
+
+ gzopen returns NULL if the file could not be opened, if there was
+ insufficient memory to allocate the gzFile state, or if an invalid mode was
+ specified (an 'r', 'w', or 'a' was not provided, or '+' was provided).
+ errno can be checked to determine if the reason gzopen failed was that the
+ file could not be opened.
+*/
+
+ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
+/*
+ gzdopen associates a gzFile with the file descriptor fd. File descriptors
+ are obtained from calls like open, dup, creat, pipe or fileno (if the file
+ has been previously opened with fopen). The mode parameter is as in gzopen.
+
+ The next call of gzclose on the returned gzFile will also close the file
+ descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor
+ fd. If you want to keep fd open, use fd = dup(fd_keep); gz = gzdopen(fd,
+ mode);. The duplicated descriptor should be saved to avoid a leak, since
+ gzdopen does not close fd if it fails. If you are using fileno() to get the
+ file descriptor from a FILE *, then you will have to use dup() to avoid
+ double-close()ing the file descriptor. Both gzclose() and fclose() will
+ close the associated file descriptor, so they need to have different file
+ descriptors.
+
+ gzdopen returns NULL if there was insufficient memory to allocate the
+ gzFile state, if an invalid mode was specified (an 'r', 'w', or 'a' was not
+ provided, or '+' was provided), or if fd is -1. The file descriptor is not
+ used until the next gz* read, write, seek, or close operation, so gzdopen
+ will not detect if fd is invalid (unless fd is -1).
+*/
+
+ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size));
+/*
+ Set the internal buffer size used by this library's functions. The
+ default buffer size is 8192 bytes. This function must be called after
+ gzopen() or gzdopen(), and before any other calls that read or write the
+ file. The buffer memory allocation is always deferred to the first read or
+ write. Two buffers are allocated, either both of the specified size when
+ writing, or one of the specified size and the other twice that size when
+ reading. A larger buffer size of, for example, 64K or 128K bytes will
+ noticeably increase the speed of decompression (reading).
+
+ The new buffer size also affects the maximum length for gzprintf().
+
+ gzbuffer() returns 0 on success, or -1 on failure, such as being called
+ too late.
+*/
+
+ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
+/*
+ Dynamically update the compression level or strategy. See the description
+ of deflateInit2 for the meaning of these parameters.
+
+ gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not
+ opened for writing.
+*/
+
+ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
+/*
+ Reads the given number of uncompressed bytes from the compressed file. If
+ the input file is not in gzip format, gzread copies the given number of
+ bytes into the buffer directly from the file.
+
+ After reaching the end of a gzip stream in the input, gzread will continue
+ to read, looking for another gzip stream. Any number of gzip streams may be
+ concatenated in the input file, and will all be decompressed by gzread().
+ If something other than a gzip stream is encountered after a gzip stream,
+ that remaining trailing garbage is ignored (and no error is returned).
+
+ gzread can be used to read a gzip file that is being concurrently written.
+ Upon reaching the end of the input, gzread will return with the available
+ data. If the error code returned by gzerror is Z_OK or Z_BUF_ERROR, then
+ gzclearerr can be used to clear the end of file indicator in order to permit
+ gzread to be tried again. Z_OK indicates that a gzip stream was completed
+ on the last gzread. Z_BUF_ERROR indicates that the input file ended in the
+ middle of a gzip stream. Note that gzread does not return -1 in the event
+ of an incomplete gzip stream. This error is deferred until gzclose(), which
+ will return Z_BUF_ERROR if the last gzread ended in the middle of a gzip
+ stream. Alternatively, gzerror can be used before gzclose to detect this
+ case.
+
+ gzread returns the number of uncompressed bytes actually read, less than
+ len for end of file, or -1 for error.
+*/
+
+ZEXTERN int ZEXPORT gzwrite OF((gzFile file,
+ voidpc buf, unsigned len));
+/*
+ Writes the given number of uncompressed bytes into the compressed file.
+ gzwrite returns the number of uncompressed bytes written or 0 in case of
+ error.
+*/
+
+ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...));
+/*
+ Converts, formats, and writes the arguments to the compressed file under
+ control of the format string, as in fprintf. gzprintf returns the number of
+ uncompressed bytes actually written, or 0 in case of error. The number of
+ uncompressed bytes written is limited to 8191, or one less than the buffer
+ size given to gzbuffer(). The caller should assure that this limit is not
+ exceeded. If it is exceeded, then gzprintf() will return an error (0) with
+ nothing written. In this case, there may also be a buffer overflow with
+ unpredictable consequences, which is possible only if zlib was compiled with
+ the insecure functions sprintf() or vsprintf() because the secure snprintf()
+ or vsnprintf() functions were not available. This can be determined using
+ zlibCompileFlags().
+*/
+
+ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
+/*
+ Writes the given null-terminated string to the compressed file, excluding
+ the terminating null character.
+
+ gzputs returns the number of characters written, or -1 in case of error.
+*/
+
+ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
+/*
+ Reads bytes from the compressed file until len-1 characters are read, or a
+ newline character is read and transferred to buf, or an end-of-file
+ condition is encountered. If any characters are read or if len == 1, the
+ string is terminated with a null character. If no characters are read due
+ to an end-of-file or len < 1, then the buffer is left untouched.
+
+ gzgets returns buf which is a null-terminated string, or it returns NULL
+ for end-of-file or in case of error. If there was an error, the contents at
+ buf are indeterminate.
+*/
+
+ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));
+/*
+ Writes c, converted to an unsigned char, into the compressed file. gzputc
+ returns the value that was written, or -1 in case of error.
+*/
+
+ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
+/*
+ Reads one byte from the compressed file. gzgetc returns this byte or -1
+ in case of end of file or error. This is implemented as a macro for speed.
+ As such, it does not do all of the checking the other functions do. I.e.
+ it does not check to see if file is NULL, nor whether the structure file
+ points to has been clobbered or not.
+*/
+
+ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));
+/*
+ Push one character back onto the stream to be read as the first character
+ on the next read. At least one character of push-back is allowed.
+ gzungetc() returns the character pushed, or -1 on failure. gzungetc() will
+ fail if c is -1, and may fail if a character has been pushed but not read
+ yet. If gzungetc is used immediately after gzopen or gzdopen, at least the
+ output buffer size of pushed characters is allowed. (See gzbuffer above.)
+ The pushed character will be discarded if the stream is repositioned with
+ gzseek() or gzrewind().
+*/
+
+ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
+/*
+ Flushes all pending output into the compressed file. The parameter flush
+ is as in the deflate() function. The return value is the zlib error number
+ (see function gzerror below). gzflush is only permitted when writing.
+
+ If the flush parameter is Z_FINISH, the remaining data is written and the
+ gzip stream is completed in the output. If gzwrite() is called again, a new
+ gzip stream will be started in the output. gzread() is able to read such
+ concatented gzip streams.
+
+ gzflush should be called only when strictly necessary because it will
+ degrade compression if called too often.
+*/
+
+/*
+ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
+ z_off_t offset, int whence));
+
+ Sets the starting position for the next gzread or gzwrite on the given
+ compressed file. The offset represents a number of bytes in the
+ uncompressed data stream. The whence parameter is defined as in lseek(2);
+ the value SEEK_END is not supported.
+
+ If the file is opened for reading, this function is emulated but can be
+ extremely slow. If the file is opened for writing, only forward seeks are
+ supported; gzseek then compresses a sequence of zeroes up to the new
+ starting position.
+
+ gzseek returns the resulting offset location as measured in bytes from
+ the beginning of the uncompressed stream, or -1 in case of error, in
+ particular if the file is opened for writing and the new starting position
+ would be before the current position.
+*/
+
+ZEXTERN int ZEXPORT gzrewind OF((gzFile file));
+/*
+ Rewinds the given file. This function is supported only for reading.
+
+ gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET)
+*/
+
+/*
+ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file));
+
+ Returns the starting position for the next gzread or gzwrite on the given
+ compressed file. This position represents a number of bytes in the
+ uncompressed data stream, and is zero when starting, even if appending or
+ reading a gzip stream from the middle of a file using gzdopen().
+
+ gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
+*/
+
+/*
+ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file));
+
+ Returns the current offset in the file being read or written. This offset
+ includes the count of bytes that precede the gzip stream, for example when
+ appending or when using gzdopen() for reading. When reading, the offset
+ does not include as yet unused buffered input. This information can be used
+ for a progress indicator. On error, gzoffset() returns -1.
+*/
+
+ZEXTERN int ZEXPORT gzeof OF((gzFile file));
+/*
+ Returns true (1) if the end-of-file indicator has been set while reading,
+ false (0) otherwise. Note that the end-of-file indicator is set only if the
+ read tried to go past the end of the input, but came up short. Therefore,
+ just like feof(), gzeof() may return false even if there is no more data to
+ read, in the event that the last read request was for the exact number of
+ bytes remaining in the input file. This will happen if the input file size
+ is an exact multiple of the buffer size.
+
+ If gzeof() returns true, then the read functions will return no more data,
+ unless the end-of-file indicator is reset by gzclearerr() and the input file
+ has grown since the previous end of file was detected.
+*/
+
+ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
+/*
+ Returns true (1) if file is being copied directly while reading, or false
+ (0) if file is a gzip stream being decompressed.
+
+ If the input file is empty, gzdirect() will return true, since the input
+ does not contain a gzip stream.
+
+ If gzdirect() is used immediately after gzopen() or gzdopen() it will
+ cause buffers to be allocated to allow reading the file to determine if it
+ is a gzip file. Therefore if gzbuffer() is used, it should be called before
+ gzdirect().
+
+ When writing, gzdirect() returns true (1) if transparent writing was
+ requested ("wT" for the gzopen() mode), or false (0) otherwise. (Note:
+ gzdirect() is not needed when writing. Transparent writing must be
+ explicitly requested, so the application already knows the answer. When
+ linking statically, using gzdirect() will include all of the zlib code for
+ gzip file reading and decompression, which may not be desired.)
+*/
+
+ZEXTERN int ZEXPORT gzclose OF((gzFile file));
+/*
+ Flushes all pending output if necessary, closes the compressed file and
+ deallocates the (de)compression state. Note that once file is closed, you
+ cannot call gzerror with file, since its structures have been deallocated.
+ gzclose must not be called more than once on the same file, just as free
+ must not be called more than once on the same allocation.
+
+ gzclose will return Z_STREAM_ERROR if file is not valid, Z_ERRNO on a
+ file operation error, Z_MEM_ERROR if out of memory, Z_BUF_ERROR if the
+ last read ended in the middle of a gzip stream, or Z_OK on success.
+*/
+
+ZEXTERN int ZEXPORT gzclose_r OF((gzFile file));
+ZEXTERN int ZEXPORT gzclose_w OF((gzFile file));
+/*
+ Same as gzclose(), but gzclose_r() is only for use when reading, and
+ gzclose_w() is only for use when writing or appending. The advantage to
+ using these instead of gzclose() is that they avoid linking in zlib
+ compression or decompression code that is not used when only reading or only
+ writing respectively. If gzclose() is used, then both compression and
+ decompression code will be included the application when linking to a static
+ zlib library.
+*/
+
+ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
+/*
+ Returns the error message for the last error which occurred on the given
+ compressed file. errnum is set to zlib error number. If an error occurred
+ in the file system and not in the compression library, errnum is set to
+ Z_ERRNO and the application may consult errno to get the exact error code.
+
+ The application must not modify the returned string. Future calls to
+ this function may invalidate the previously returned string. If file is
+ closed, then the string previously returned by gzerror will no longer be
+ available.
+
+ gzerror() should be used to distinguish errors from end-of-file for those
+ functions above that do not distinguish those cases in their return values.
+*/
+
+ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
+/*
+ Clears the error and end-of-file flags for file. This is analogous to the
+ clearerr() function in stdio. This is useful for continuing to read a gzip
+ file that is being written concurrently.
+*/
+
+#endif /* !Z_SOLO */
+
+ /* checksum functions */
+
+/*
+ These functions are not related to compression but are exported
+ anyway because they might be useful in applications using the compression
+ library.
+*/
+
+ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
+/*
+ Update a running Adler-32 checksum with the bytes buf[0..len-1] and
+ return the updated checksum. If buf is Z_NULL, this function returns the
+ required initial value for the checksum.
+
+ An Adler-32 checksum is almost as reliable as a CRC32 but can be computed
+ much faster.
+
+ Usage example:
+
+ uLong adler = adler32(0L, Z_NULL, 0);
+
+ while (read_buffer(buffer, length) != EOF) {
+ adler = adler32(adler, buffer, length);
+ }
+ if (adler != original_adler) error();
+*/
+
+/*
+ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2,
+ z_off_t len2));
+
+ Combine two Adler-32 checksums into one. For two sequences of bytes, seq1
+ and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for
+ each, adler1 and adler2. adler32_combine() returns the Adler-32 checksum of
+ seq1 and seq2 concatenated, requiring only adler1, adler2, and len2. Note
+ that the z_off_t type (like off_t) is a signed integer. If len2 is
+ negative, the result has no meaning or utility.
+*/
+
+ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
+/*
+ Update a running CRC-32 with the bytes buf[0..len-1] and return the
+ updated CRC-32. If buf is Z_NULL, this function returns the required
+ initial value for the crc. Pre- and post-conditioning (one's complement) is
+ performed within this function so it shouldn't be done by the application.
+
+ Usage example:
+
+ uLong crc = crc32(0L, Z_NULL, 0);
+
+ while (read_buffer(buffer, length) != EOF) {
+ crc = crc32(crc, buffer, length);
+ }
+ if (crc != original_crc) error();
+*/
+
+/*
+ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2));
+
+ Combine two CRC-32 check values into one. For two sequences of bytes,
+ seq1 and seq2 with lengths len1 and len2, CRC-32 check values were
+ calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32
+ check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and
+ len2.
+*/
+
+
+ /* various hacks, don't look :) */
+
+/* deflateInit and inflateInit are macros to allow checking the zlib version
+ * and the compiler's view of z_stream:
+ */
+ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level,
+ const char *version, int stream_size));
+ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm,
+ const char *version, int stream_size));
+ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method,
+ int windowBits, int memLevel,
+ int strategy, const char *version,
+ int stream_size));
+ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits,
+ const char *version, int stream_size));
+ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
+ unsigned char FAR *window,
+ const char *version,
+ int stream_size));
+#define deflateInit(strm, level) \
+ deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream))
+#define inflateInit(strm) \
+ inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream))
+#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
+ deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
+ (strategy), ZLIB_VERSION, (int)sizeof(z_stream))
+#define inflateInit2(strm, windowBits) \
+ inflateInit2_((strm), (windowBits), ZLIB_VERSION, \
+ (int)sizeof(z_stream))
+#define inflateBackInit(strm, windowBits, window) \
+ inflateBackInit_((strm), (windowBits), (window), \
+ ZLIB_VERSION, (int)sizeof(z_stream))
+
+#ifndef Z_SOLO
+
+/* gzgetc() macro and its supporting function and exposed data structure. Note
+ * that the real internal state is much larger than the exposed structure.
+ * This abbreviated structure exposes just enough for the gzgetc() macro. The
+ * user should not mess with these exposed elements, since their names or
+ * behavior could change in the future, perhaps even capriciously. They can
+ * only be used by the gzgetc() macro. You have been warned.
+ */
+struct gzFile_s {
+ unsigned have;
+ unsigned char *next;
+ z_off64_t pos;
+};
+ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
+#ifdef Z_PREFIX_SET
+# undef z_gzgetc
+# define z_gzgetc(g) \
+ ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : gzgetc(g))
+#else
+# define gzgetc(g) \
+ ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : gzgetc(g))
+#endif
+
+/* provide 64-bit offset functions if _LARGEFILE64_SOURCE defined, and/or
+ * change the regular functions to 64 bits if _FILE_OFFSET_BITS is 64 (if
+ * both are true, the application gets the *64 functions, and the regular
+ * functions are changed to 64 bits) -- in case these are set on systems
+ * without large file support, _LFS64_LARGEFILE must also be true
+ */
+#ifdef Z_LARGE64
+ ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
+ ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int));
+ ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile));
+ ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile));
+ ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off64_t));
+ ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t));
+#endif
+
+#if !defined(ZLIB_INTERNAL) && defined(Z_WANT64)
+# ifdef Z_PREFIX_SET
+# define z_gzopen z_gzopen64
+# define z_gzseek z_gzseek64
+# define z_gztell z_gztell64
+# define z_gzoffset z_gzoffset64
+# define z_adler32_combine z_adler32_combine64
+# define z_crc32_combine z_crc32_combine64
+# else
+# define gzopen gzopen64
+# define gzseek gzseek64
+# define gztell gztell64
+# define gzoffset gzoffset64
+# define adler32_combine adler32_combine64
+# define crc32_combine crc32_combine64
+# endif
+# ifndef Z_LARGE64
+ ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
+ ZEXTERN off64_t ZEXPORT gzseek64 OF((gzFile, off64_t, int));
+ ZEXTERN off64_t ZEXPORT gztell64 OF((gzFile));
+ ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile));
+ ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, off64_t));
+ ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, off64_t));
+# endif
+#else
+ ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *));
+ ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile, z_off_t, int));
+ ZEXTERN z_off_t ZEXPORT gztell OF((gzFile));
+ ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile));
+ ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
+ ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
+#endif
+
+#else /* Z_SOLO */
+
+ ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
+ ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
+
+#endif /* !Z_SOLO */
+
+/* hack for buggy compilers */
+#if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL)
+ struct internal_state {int dummy;};
+#endif
+
+/* undocumented functions */
+ZEXTERN const char * ZEXPORT zError OF((int));
+ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp));
+ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table OF((void));
+ZEXTERN int ZEXPORT inflateUndermine OF((z_streamp, int));
+ZEXTERN int ZEXPORT inflateResetKeep OF((z_streamp));
+ZEXTERN int ZEXPORT deflateResetKeep OF((z_streamp));
+#if defined(_WIN32) && !defined(Z_SOLO)
+ZEXTERN gzFile ZEXPORT gzopen_w OF((const wchar_t *path,
+ const char *mode));
+#endif
+#if defined(STDC) || defined(Z_HAVE_STDARG_H)
+# ifndef Z_SOLO
+ZEXTERN int ZEXPORTVA gzvprintf Z_ARG((gzFile file,
+ const char *format,
+ va_list va));
+# endif
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* ZLIB_H */
diff --git a/core/src/fdrm/crypto/fx_crypt.cpp b/core/src/fdrm/crypto/fx_crypt.cpp
index 0f1bf5f997..8128f91f89 100644
--- a/core/src/fdrm/crypto/fx_crypt.cpp
+++ b/core/src/fdrm/crypto/fx_crypt.cpp
@@ -1,259 +1,259 @@
-// 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
-
-#include "../../../include/fxcrt/fx_basic.h"
-#include "../../../include/fdrm/fx_crypt.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
-struct rc4_state {
- int x, y, m[256];
-};
-void CRYPT_ArcFourSetup(void* context, FX_LPCBYTE key, FX_DWORD length )
-{
- rc4_state *s = (rc4_state*)context;
- int i, j, k, *m, a;
- s->x = 0;
- s->y = 0;
- m = s->m;
- for( i = 0; i < 256; i++ ) {
- m[i] = i;
- }
- j = k = 0;
- for( i = 0; i < 256; i++ ) {
- a = m[i];
- j = ( j + a + key[k] ) & 0xFF;
- m[i] = m[j];
- m[j] = a;
- if( ++k >= (int)length ) {
- k = 0;
- }
- }
-}
-void CRYPT_ArcFourCrypt(void* context, unsigned char *data, FX_DWORD length )
-{
- struct rc4_state* s = (struct rc4_state*)context;
- int i, x, y, *m, a, b;
- x = s->x;
- y = s->y;
- m = s->m;
- for( i = 0; i < (int)length; i++ ) {
- x = ( x + 1 ) & 0xFF;
- a = m[x];
- y = ( y + a ) & 0xFF;
- m[x] = b = m[y];
- m[y] = a;
- data[i] ^= m[( a + b ) & 0xFF];
- }
- s->x = x;
- s->y = y;
-}
-void CRYPT_ArcFourCryptBlock(FX_LPBYTE pData, FX_DWORD size, FX_LPCBYTE key, FX_DWORD keylen)
-{
- rc4_state s;
- CRYPT_ArcFourSetup(&s, key, keylen);
- CRYPT_ArcFourCrypt(&s, pData, size);
-}
-struct md5_context {
- FX_DWORD total[2];
- FX_DWORD state[4];
- FX_BYTE buffer[64];
-};
-#define GET_FX_DWORD(n,b,i) \
- { \
- (n) = (FX_DWORD) ((FX_BYTE *) b)[(i)] \
- | (((FX_DWORD) ((FX_BYTE *) b)[(i)+1]) << 8) \
- | (((FX_DWORD) ((FX_BYTE *) b)[(i)+2]) << 16) \
- | (((FX_DWORD) ((FX_BYTE *) b)[(i)+3]) << 24); \
- }
-#define PUT_FX_DWORD(n,b,i) \
- { \
- (((FX_BYTE *) b)[(i)] ) = (FX_BYTE) (((n) ) & 0xFF); \
- (((FX_BYTE *) b)[(i)+1]) = (FX_BYTE) (((n) >> 8) & 0xFF); \
- (((FX_BYTE *) b)[(i)+2]) = (FX_BYTE) (((n) >> 16) & 0xFF); \
- (((FX_BYTE *) b)[(i)+3]) = (FX_BYTE) (((n) >> 24) & 0xFF); \
- }
-void md5_process( struct md5_context *ctx, const FX_BYTE data[64] )
-{
- FX_DWORD A, B, C, D, X[16];
- GET_FX_DWORD( X[0], data, 0 );
- GET_FX_DWORD( X[1], data, 4 );
- GET_FX_DWORD( X[2], data, 8 );
- GET_FX_DWORD( X[3], data, 12 );
- GET_FX_DWORD( X[4], data, 16 );
- GET_FX_DWORD( X[5], data, 20 );
- GET_FX_DWORD( X[6], data, 24 );
- GET_FX_DWORD( X[7], data, 28 );
- GET_FX_DWORD( X[8], data, 32 );
- GET_FX_DWORD( X[9], data, 36 );
- GET_FX_DWORD( X[10], data, 40 );
- GET_FX_DWORD( X[11], data, 44 );
- GET_FX_DWORD( X[12], data, 48 );
- GET_FX_DWORD( X[13], data, 52 );
- GET_FX_DWORD( X[14], data, 56 );
- GET_FX_DWORD( X[15], data, 60 );
-#define S(x,n) ((x << n) | ((x & 0xFFFFFFFF) >> (32 - n)))
-#define P(a,b,c,d,k,s,t) \
- { \
- a += F(b,c,d) + X[k] + t; a = S(a,s) + b; \
- }
- A = ctx->state[0];
- B = ctx->state[1];
- C = ctx->state[2];
- D = ctx->state[3];
-#define F(x,y,z) (z ^ (x & (y ^ z)))
- P( A, B, C, D, 0, 7, 0xD76AA478 );
- P( D, A, B, C, 1, 12, 0xE8C7B756 );
- P( C, D, A, B, 2, 17, 0x242070DB );
- P( B, C, D, A, 3, 22, 0xC1BDCEEE );
- P( A, B, C, D, 4, 7, 0xF57C0FAF );
- P( D, A, B, C, 5, 12, 0x4787C62A );
- P( C, D, A, B, 6, 17, 0xA8304613 );
- P( B, C, D, A, 7, 22, 0xFD469501 );
- P( A, B, C, D, 8, 7, 0x698098D8 );
- P( D, A, B, C, 9, 12, 0x8B44F7AF );
- P( C, D, A, B, 10, 17, 0xFFFF5BB1 );
- P( B, C, D, A, 11, 22, 0x895CD7BE );
- P( A, B, C, D, 12, 7, 0x6B901122 );
- P( D, A, B, C, 13, 12, 0xFD987193 );
- P( C, D, A, B, 14, 17, 0xA679438E );
- P( B, C, D, A, 15, 22, 0x49B40821 );
-#undef F
-#define F(x,y,z) (y ^ (z & (x ^ y)))
- P( A, B, C, D, 1, 5, 0xF61E2562 );
- P( D, A, B, C, 6, 9, 0xC040B340 );
- P( C, D, A, B, 11, 14, 0x265E5A51 );
- P( B, C, D, A, 0, 20, 0xE9B6C7AA );
- P( A, B, C, D, 5, 5, 0xD62F105D );
- P( D, A, B, C, 10, 9, 0x02441453 );
- P( C, D, A, B, 15, 14, 0xD8A1E681 );
- P( B, C, D, A, 4, 20, 0xE7D3FBC8 );
- P( A, B, C, D, 9, 5, 0x21E1CDE6 );
- P( D, A, B, C, 14, 9, 0xC33707D6 );
- P( C, D, A, B, 3, 14, 0xF4D50D87 );
- P( B, C, D, A, 8, 20, 0x455A14ED );
- P( A, B, C, D, 13, 5, 0xA9E3E905 );
- P( D, A, B, C, 2, 9, 0xFCEFA3F8 );
- P( C, D, A, B, 7, 14, 0x676F02D9 );
- P( B, C, D, A, 12, 20, 0x8D2A4C8A );
-#undef F
-#define F(x,y,z) (x ^ y ^ z)
- P( A, B, C, D, 5, 4, 0xFFFA3942 );
- P( D, A, B, C, 8, 11, 0x8771F681 );
- P( C, D, A, B, 11, 16, 0x6D9D6122 );
- P( B, C, D, A, 14, 23, 0xFDE5380C );
- P( A, B, C, D, 1, 4, 0xA4BEEA44 );
- P( D, A, B, C, 4, 11, 0x4BDECFA9 );
- P( C, D, A, B, 7, 16, 0xF6BB4B60 );
- P( B, C, D, A, 10, 23, 0xBEBFBC70 );
- P( A, B, C, D, 13, 4, 0x289B7EC6 );
- P( D, A, B, C, 0, 11, 0xEAA127FA );
- P( C, D, A, B, 3, 16, 0xD4EF3085 );
- P( B, C, D, A, 6, 23, 0x04881D05 );
- P( A, B, C, D, 9, 4, 0xD9D4D039 );
- P( D, A, B, C, 12, 11, 0xE6DB99E5 );
- P( C, D, A, B, 15, 16, 0x1FA27CF8 );
- P( B, C, D, A, 2, 23, 0xC4AC5665 );
-#undef F
-#define F(x,y,z) (y ^ (x | ~z))
- P( A, B, C, D, 0, 6, 0xF4292244 );
- P( D, A, B, C, 7, 10, 0x432AFF97 );
- P( C, D, A, B, 14, 15, 0xAB9423A7 );
- P( B, C, D, A, 5, 21, 0xFC93A039 );
- P( A, B, C, D, 12, 6, 0x655B59C3 );
- P( D, A, B, C, 3, 10, 0x8F0CCC92 );
- P( C, D, A, B, 10, 15, 0xFFEFF47D );
- P( B, C, D, A, 1, 21, 0x85845DD1 );
- P( A, B, C, D, 8, 6, 0x6FA87E4F );
- P( D, A, B, C, 15, 10, 0xFE2CE6E0 );
- P( C, D, A, B, 6, 15, 0xA3014314 );
- P( B, C, D, A, 13, 21, 0x4E0811A1 );
- P( A, B, C, D, 4, 6, 0xF7537E82 );
- P( D, A, B, C, 11, 10, 0xBD3AF235 );
- P( C, D, A, B, 2, 15, 0x2AD7D2BB );
- P( B, C, D, A, 9, 21, 0xEB86D391 );
-#undef F
- ctx->state[0] += A;
- ctx->state[1] += B;
- ctx->state[2] += C;
- ctx->state[3] += D;
-}
-void CRYPT_MD5Start(void* context)
-{
- struct md5_context *ctx = (struct md5_context*)context;
- ctx->total[0] = 0;
- ctx->total[1] = 0;
- ctx->state[0] = 0x67452301;
- ctx->state[1] = 0xEFCDAB89;
- ctx->state[2] = 0x98BADCFE;
- ctx->state[3] = 0x10325476;
-}
-void CRYPT_MD5Update(FX_LPVOID pctx, FX_LPCBYTE input, FX_DWORD length )
-{
- struct md5_context *ctx = (struct md5_context *)pctx;
- FX_DWORD left, fill;
- if( ! length ) {
- return;
- }
- left = ( ctx->total[0] >> 3 ) & 0x3F;
- fill = 64 - left;
- ctx->total[0] += length << 3;
- ctx->total[1] += length >> 29;
- ctx->total[0] &= 0xFFFFFFFF;
- ctx->total[1] += ctx->total[0] < length << 3;
- if( left && length >= fill ) {
- FXSYS_memcpy32( (void *) (ctx->buffer + left), (void *) input, fill );
- md5_process( ctx, ctx->buffer );
- length -= fill;
- input += fill;
- left = 0;
- }
- while( length >= 64 ) {
- md5_process( ctx, input );
- length -= 64;
- input += 64;
- }
- if( length ) {
- FXSYS_memcpy32( (void *) (ctx->buffer + left), (void *) input, length );
- }
-}
-const FX_BYTE md5_padding[64] = {
- 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-};
-void CRYPT_MD5Finish(FX_LPVOID pctx, FX_BYTE digest[16] )
-{
- struct md5_context *ctx = (struct md5_context *)pctx;
- FX_DWORD last, padn;
- FX_BYTE msglen[8];
- PUT_FX_DWORD( ctx->total[0], msglen, 0 );
- PUT_FX_DWORD( ctx->total[1], msglen, 4 );
- last = ( ctx->total[0] >> 3 ) & 0x3F;
- padn = ( last < 56 ) ? ( 56 - last ) : ( 120 - last );
- CRYPT_MD5Update( ctx, md5_padding, padn );
- CRYPT_MD5Update( ctx, msglen, 8 );
- PUT_FX_DWORD( ctx->state[0], digest, 0 );
- PUT_FX_DWORD( ctx->state[1], digest, 4 );
- PUT_FX_DWORD( ctx->state[2], digest, 8 );
- PUT_FX_DWORD( ctx->state[3], digest, 12 );
-}
-void CRYPT_MD5Generate(FX_LPCBYTE input, FX_DWORD length, FX_BYTE digest[16])
-{
- md5_context ctx;
- CRYPT_MD5Start(&ctx);
- CRYPT_MD5Update(&ctx, input, length);
- CRYPT_MD5Finish(&ctx, digest);
-}
-static FX_BOOL (*g_PubKeyDecryptor)(FX_LPCBYTE pData, FX_DWORD size, FX_LPBYTE data_buf, FX_DWORD& data_len) = NULL;
-void CRYPT_SetPubKeyDecryptor(FX_BOOL (*func)(FX_LPCBYTE pData, FX_DWORD size, FX_LPBYTE data_buf, FX_DWORD& data_len))
-{
- g_PubKeyDecryptor = func;
-}
-#ifdef __cplusplus
-};
-#endif
+// 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
+
+#include "../../../include/fxcrt/fx_basic.h"
+#include "../../../include/fdrm/fx_crypt.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+struct rc4_state {
+ int x, y, m[256];
+};
+void CRYPT_ArcFourSetup(void* context, FX_LPCBYTE key, FX_DWORD length )
+{
+ rc4_state *s = (rc4_state*)context;
+ int i, j, k, *m, a;
+ s->x = 0;
+ s->y = 0;
+ m = s->m;
+ for( i = 0; i < 256; i++ ) {
+ m[i] = i;
+ }
+ j = k = 0;
+ for( i = 0; i < 256; i++ ) {
+ a = m[i];
+ j = ( j + a + key[k] ) & 0xFF;
+ m[i] = m[j];
+ m[j] = a;
+ if( ++k >= (int)length ) {
+ k = 0;
+ }
+ }
+}
+void CRYPT_ArcFourCrypt(void* context, unsigned char *data, FX_DWORD length )
+{
+ struct rc4_state* s = (struct rc4_state*)context;
+ int i, x, y, *m, a, b;
+ x = s->x;
+ y = s->y;
+ m = s->m;
+ for( i = 0; i < (int)length; i++ ) {
+ x = ( x + 1 ) & 0xFF;
+ a = m[x];
+ y = ( y + a ) & 0xFF;
+ m[x] = b = m[y];
+ m[y] = a;
+ data[i] ^= m[( a + b ) & 0xFF];
+ }
+ s->x = x;
+ s->y = y;
+}
+void CRYPT_ArcFourCryptBlock(FX_LPBYTE pData, FX_DWORD size, FX_LPCBYTE key, FX_DWORD keylen)
+{
+ rc4_state s;
+ CRYPT_ArcFourSetup(&s, key, keylen);
+ CRYPT_ArcFourCrypt(&s, pData, size);
+}
+struct md5_context {
+ FX_DWORD total[2];
+ FX_DWORD state[4];
+ FX_BYTE buffer[64];
+};
+#define GET_FX_DWORD(n,b,i) \
+ { \
+ (n) = (FX_DWORD) ((FX_BYTE *) b)[(i)] \
+ | (((FX_DWORD) ((FX_BYTE *) b)[(i)+1]) << 8) \
+ | (((FX_DWORD) ((FX_BYTE *) b)[(i)+2]) << 16) \
+ | (((FX_DWORD) ((FX_BYTE *) b)[(i)+3]) << 24); \
+ }
+#define PUT_FX_DWORD(n,b,i) \
+ { \
+ (((FX_BYTE *) b)[(i)] ) = (FX_BYTE) (((n) ) & 0xFF); \
+ (((FX_BYTE *) b)[(i)+1]) = (FX_BYTE) (((n) >> 8) & 0xFF); \
+ (((FX_BYTE *) b)[(i)+2]) = (FX_BYTE) (((n) >> 16) & 0xFF); \
+ (((FX_BYTE *) b)[(i)+3]) = (FX_BYTE) (((n) >> 24) & 0xFF); \
+ }
+void md5_process( struct md5_context *ctx, const FX_BYTE data[64] )
+{
+ FX_DWORD A, B, C, D, X[16];
+ GET_FX_DWORD( X[0], data, 0 );
+ GET_FX_DWORD( X[1], data, 4 );
+ GET_FX_DWORD( X[2], data, 8 );
+ GET_FX_DWORD( X[3], data, 12 );
+ GET_FX_DWORD( X[4], data, 16 );
+ GET_FX_DWORD( X[5], data, 20 );
+ GET_FX_DWORD( X[6], data, 24 );
+ GET_FX_DWORD( X[7], data, 28 );
+ GET_FX_DWORD( X[8], data, 32 );
+ GET_FX_DWORD( X[9], data, 36 );
+ GET_FX_DWORD( X[10], data, 40 );
+ GET_FX_DWORD( X[11], data, 44 );
+ GET_FX_DWORD( X[12], data, 48 );
+ GET_FX_DWORD( X[13], data, 52 );
+ GET_FX_DWORD( X[14], data, 56 );
+ GET_FX_DWORD( X[15], data, 60 );
+#define S(x,n) ((x << n) | ((x & 0xFFFFFFFF) >> (32 - n)))
+#define P(a,b,c,d,k,s,t) \
+ { \
+ a += F(b,c,d) + X[k] + t; a = S(a,s) + b; \
+ }
+ A = ctx->state[0];
+ B = ctx->state[1];
+ C = ctx->state[2];
+ D = ctx->state[3];
+#define F(x,y,z) (z ^ (x & (y ^ z)))
+ P( A, B, C, D, 0, 7, 0xD76AA478 );
+ P( D, A, B, C, 1, 12, 0xE8C7B756 );
+ P( C, D, A, B, 2, 17, 0x242070DB );
+ P( B, C, D, A, 3, 22, 0xC1BDCEEE );
+ P( A, B, C, D, 4, 7, 0xF57C0FAF );
+ P( D, A, B, C, 5, 12, 0x4787C62A );
+ P( C, D, A, B, 6, 17, 0xA8304613 );
+ P( B, C, D, A, 7, 22, 0xFD469501 );
+ P( A, B, C, D, 8, 7, 0x698098D8 );
+ P( D, A, B, C, 9, 12, 0x8B44F7AF );
+ P( C, D, A, B, 10, 17, 0xFFFF5BB1 );
+ P( B, C, D, A, 11, 22, 0x895CD7BE );
+ P( A, B, C, D, 12, 7, 0x6B901122 );
+ P( D, A, B, C, 13, 12, 0xFD987193 );
+ P( C, D, A, B, 14, 17, 0xA679438E );
+ P( B, C, D, A, 15, 22, 0x49B40821 );
+#undef F
+#define F(x,y,z) (y ^ (z & (x ^ y)))
+ P( A, B, C, D, 1, 5, 0xF61E2562 );
+ P( D, A, B, C, 6, 9, 0xC040B340 );
+ P( C, D, A, B, 11, 14, 0x265E5A51 );
+ P( B, C, D, A, 0, 20, 0xE9B6C7AA );
+ P( A, B, C, D, 5, 5, 0xD62F105D );
+ P( D, A, B, C, 10, 9, 0x02441453 );
+ P( C, D, A, B, 15, 14, 0xD8A1E681 );
+ P( B, C, D, A, 4, 20, 0xE7D3FBC8 );
+ P( A, B, C, D, 9, 5, 0x21E1CDE6 );
+ P( D, A, B, C, 14, 9, 0xC33707D6 );
+ P( C, D, A, B, 3, 14, 0xF4D50D87 );
+ P( B, C, D, A, 8, 20, 0x455A14ED );
+ P( A, B, C, D, 13, 5, 0xA9E3E905 );
+ P( D, A, B, C, 2, 9, 0xFCEFA3F8 );
+ P( C, D, A, B, 7, 14, 0x676F02D9 );
+ P( B, C, D, A, 12, 20, 0x8D2A4C8A );
+#undef F
+#define F(x,y,z) (x ^ y ^ z)
+ P( A, B, C, D, 5, 4, 0xFFFA3942 );
+ P( D, A, B, C, 8, 11, 0x8771F681 );
+ P( C, D, A, B, 11, 16, 0x6D9D6122 );
+ P( B, C, D, A, 14, 23, 0xFDE5380C );
+ P( A, B, C, D, 1, 4, 0xA4BEEA44 );
+ P( D, A, B, C, 4, 11, 0x4BDECFA9 );
+ P( C, D, A, B, 7, 16, 0xF6BB4B60 );
+ P( B, C, D, A, 10, 23, 0xBEBFBC70 );
+ P( A, B, C, D, 13, 4, 0x289B7EC6 );
+ P( D, A, B, C, 0, 11, 0xEAA127FA );
+ P( C, D, A, B, 3, 16, 0xD4EF3085 );
+ P( B, C, D, A, 6, 23, 0x04881D05 );
+ P( A, B, C, D, 9, 4, 0xD9D4D039 );
+ P( D, A, B, C, 12, 11, 0xE6DB99E5 );
+ P( C, D, A, B, 15, 16, 0x1FA27CF8 );
+ P( B, C, D, A, 2, 23, 0xC4AC5665 );
+#undef F
+#define F(x,y,z) (y ^ (x | ~z))
+ P( A, B, C, D, 0, 6, 0xF4292244 );
+ P( D, A, B, C, 7, 10, 0x432AFF97 );
+ P( C, D, A, B, 14, 15, 0xAB9423A7 );
+ P( B, C, D, A, 5, 21, 0xFC93A039 );
+ P( A, B, C, D, 12, 6, 0x655B59C3 );
+ P( D, A, B, C, 3, 10, 0x8F0CCC92 );
+ P( C, D, A, B, 10, 15, 0xFFEFF47D );
+ P( B, C, D, A, 1, 21, 0x85845DD1 );
+ P( A, B, C, D, 8, 6, 0x6FA87E4F );
+ P( D, A, B, C, 15, 10, 0xFE2CE6E0 );
+ P( C, D, A, B, 6, 15, 0xA3014314 );
+ P( B, C, D, A, 13, 21, 0x4E0811A1 );
+ P( A, B, C, D, 4, 6, 0xF7537E82 );
+ P( D, A, B, C, 11, 10, 0xBD3AF235 );
+ P( C, D, A, B, 2, 15, 0x2AD7D2BB );
+ P( B, C, D, A, 9, 21, 0xEB86D391 );
+#undef F
+ ctx->state[0] += A;
+ ctx->state[1] += B;
+ ctx->state[2] += C;
+ ctx->state[3] += D;
+}
+void CRYPT_MD5Start(void* context)
+{
+ struct md5_context *ctx = (struct md5_context*)context;
+ ctx->total[0] = 0;
+ ctx->total[1] = 0;
+ ctx->state[0] = 0x67452301;
+ ctx->state[1] = 0xEFCDAB89;
+ ctx->state[2] = 0x98BADCFE;
+ ctx->state[3] = 0x10325476;
+}
+void CRYPT_MD5Update(FX_LPVOID pctx, FX_LPCBYTE input, FX_DWORD length )
+{
+ struct md5_context *ctx = (struct md5_context *)pctx;
+ FX_DWORD left, fill;
+ if( ! length ) {
+ return;
+ }
+ left = ( ctx->total[0] >> 3 ) & 0x3F;
+ fill = 64 - left;
+ ctx->total[0] += length << 3;
+ ctx->total[1] += length >> 29;
+ ctx->total[0] &= 0xFFFFFFFF;
+ ctx->total[1] += ctx->total[0] < length << 3;
+ if( left && length >= fill ) {
+ FXSYS_memcpy32( (void *) (ctx->buffer + left), (void *) input, fill );
+ md5_process( ctx, ctx->buffer );
+ length -= fill;
+ input += fill;
+ left = 0;
+ }
+ while( length >= 64 ) {
+ md5_process( ctx, input );
+ length -= 64;
+ input += 64;
+ }
+ if( length ) {
+ FXSYS_memcpy32( (void *) (ctx->buffer + left), (void *) input, length );
+ }
+}
+const FX_BYTE md5_padding[64] = {
+ 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+};
+void CRYPT_MD5Finish(FX_LPVOID pctx, FX_BYTE digest[16] )
+{
+ struct md5_context *ctx = (struct md5_context *)pctx;
+ FX_DWORD last, padn;
+ FX_BYTE msglen[8];
+ PUT_FX_DWORD( ctx->total[0], msglen, 0 );
+ PUT_FX_DWORD( ctx->total[1], msglen, 4 );
+ last = ( ctx->total[0] >> 3 ) & 0x3F;
+ padn = ( last < 56 ) ? ( 56 - last ) : ( 120 - last );
+ CRYPT_MD5Update( ctx, md5_padding, padn );
+ CRYPT_MD5Update( ctx, msglen, 8 );
+ PUT_FX_DWORD( ctx->state[0], digest, 0 );
+ PUT_FX_DWORD( ctx->state[1], digest, 4 );
+ PUT_FX_DWORD( ctx->state[2], digest, 8 );
+ PUT_FX_DWORD( ctx->state[3], digest, 12 );
+}
+void CRYPT_MD5Generate(FX_LPCBYTE input, FX_DWORD length, FX_BYTE digest[16])
+{
+ md5_context ctx;
+ CRYPT_MD5Start(&ctx);
+ CRYPT_MD5Update(&ctx, input, length);
+ CRYPT_MD5Finish(&ctx, digest);
+}
+static FX_BOOL (*g_PubKeyDecryptor)(FX_LPCBYTE pData, FX_DWORD size, FX_LPBYTE data_buf, FX_DWORD& data_len) = NULL;
+void CRYPT_SetPubKeyDecryptor(FX_BOOL (*func)(FX_LPCBYTE pData, FX_DWORD size, FX_LPBYTE data_buf, FX_DWORD& data_len))
+{
+ g_PubKeyDecryptor = func;
+}
+#ifdef __cplusplus
+};
+#endif
diff --git a/core/src/fdrm/crypto/fx_crypt_aes.cpp b/core/src/fdrm/crypto/fx_crypt_aes.cpp
index b8644d141b..6efa935be3 100644
--- a/core/src/fdrm/crypto/fx_crypt_aes.cpp
+++ b/core/src/fdrm/crypto/fx_crypt_aes.cpp
@@ -1,1013 +1,1013 @@
-// 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
-
-#include "../../../include/fxcrt/fx_basic.h"
-#include "../../../include/fdrm/fx_crypt.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
-#define MAX_NR 14
-#define MAX_NK 8
-#define MAX_NB 8
-#define mulby2(x) ( ((x&0x7F) << 1) ^ (x & 0x80 ? 0x1B : 0) )
-#define GET_32BIT_MSB_FIRST(cp) \
- (((unsigned long)(unsigned char)(cp)[3]) | \
- ((unsigned long)(unsigned char)(cp)[2] << 8) | \
- ((unsigned long)(unsigned char)(cp)[1] << 16) | \
- ((unsigned long)(unsigned char)(cp)[0] << 24))
-#define PUT_32BIT_MSB_FIRST(cp, value) do { \
- (cp)[3] = (value); \
- (cp)[2] = (value) >> 8; \
- (cp)[1] = (value) >> 16; \
- (cp)[0] = (value) >> 24; } while (0)
-struct AESContext {
- unsigned int keysched[(MAX_NR + 1) * MAX_NB];
- unsigned int invkeysched[(MAX_NR + 1) * MAX_NB];
- void (*encrypt) (AESContext * ctx, unsigned int * block);
- void (*decrypt) (AESContext * ctx, unsigned int * block);
- unsigned int iv[MAX_NB];
- int Nb, Nr;
-};
-static const unsigned char Sbox[256] = {
- 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5,
- 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76,
- 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0,
- 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0,
- 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc,
- 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15,
- 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a,
- 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75,
- 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0,
- 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84,
- 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b,
- 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf,
- 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85,
- 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8,
- 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5,
- 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2,
- 0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17,
- 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73,
- 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88,
- 0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb,
- 0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c,
- 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79,
- 0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9,
- 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08,
- 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6,
- 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a,
- 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e,
- 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e,
- 0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94,
- 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf,
- 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68,
- 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16
-};
-static const unsigned char Sboxinv[256] = {
- 0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38,
- 0xbf, 0x40, 0xa3, 0x9e, 0x81, 0xf3, 0xd7, 0xfb,
- 0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87,
- 0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb,
- 0x54, 0x7b, 0x94, 0x32, 0xa6, 0xc2, 0x23, 0x3d,
- 0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e,
- 0x08, 0x2e, 0xa1, 0x66, 0x28, 0xd9, 0x24, 0xb2,
- 0x76, 0x5b, 0xa2, 0x49, 0x6d, 0x8b, 0xd1, 0x25,
- 0x72, 0xf8, 0xf6, 0x64, 0x86, 0x68, 0x98, 0x16,
- 0xd4, 0xa4, 0x5c, 0xcc, 0x5d, 0x65, 0xb6, 0x92,
- 0x6c, 0x70, 0x48, 0x50, 0xfd, 0xed, 0xb9, 0xda,
- 0x5e, 0x15, 0x46, 0x57, 0xa7, 0x8d, 0x9d, 0x84,
- 0x90, 0xd8, 0xab, 0x00, 0x8c, 0xbc, 0xd3, 0x0a,
- 0xf7, 0xe4, 0x58, 0x05, 0xb8, 0xb3, 0x45, 0x06,
- 0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02,
- 0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b,
- 0x3a, 0x91, 0x11, 0x41, 0x4f, 0x67, 0xdc, 0xea,
- 0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73,
- 0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85,
- 0xe2, 0xf9, 0x37, 0xe8, 0x1c, 0x75, 0xdf, 0x6e,
- 0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89,
- 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b,
- 0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20,
- 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4,
- 0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31,
- 0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f,
- 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d,
- 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef,
- 0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0,
- 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61,
- 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26,
- 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d
-};
-static const unsigned int E0[256] = {
- 0xc66363a5, 0xf87c7c84, 0xee777799, 0xf67b7b8d,
- 0xfff2f20d, 0xd66b6bbd, 0xde6f6fb1, 0x91c5c554,
- 0x60303050, 0x02010103, 0xce6767a9, 0x562b2b7d,
- 0xe7fefe19, 0xb5d7d762, 0x4dababe6, 0xec76769a,
- 0x8fcaca45, 0x1f82829d, 0x89c9c940, 0xfa7d7d87,
- 0xeffafa15, 0xb25959eb, 0x8e4747c9, 0xfbf0f00b,
- 0x41adadec, 0xb3d4d467, 0x5fa2a2fd, 0x45afafea,
- 0x239c9cbf, 0x53a4a4f7, 0xe4727296, 0x9bc0c05b,
- 0x75b7b7c2, 0xe1fdfd1c, 0x3d9393ae, 0x4c26266a,
- 0x6c36365a, 0x7e3f3f41, 0xf5f7f702, 0x83cccc4f,
- 0x6834345c, 0x51a5a5f4, 0xd1e5e534, 0xf9f1f108,
- 0xe2717193, 0xabd8d873, 0x62313153, 0x2a15153f,
- 0x0804040c, 0x95c7c752, 0x46232365, 0x9dc3c35e,
- 0x30181828, 0x379696a1, 0x0a05050f, 0x2f9a9ab5,
- 0x0e070709, 0x24121236, 0x1b80809b, 0xdfe2e23d,
- 0xcdebeb26, 0x4e272769, 0x7fb2b2cd, 0xea75759f,
- 0x1209091b, 0x1d83839e, 0x582c2c74, 0x341a1a2e,
- 0x361b1b2d, 0xdc6e6eb2, 0xb45a5aee, 0x5ba0a0fb,
- 0xa45252f6, 0x763b3b4d, 0xb7d6d661, 0x7db3b3ce,
- 0x5229297b, 0xdde3e33e, 0x5e2f2f71, 0x13848497,
- 0xa65353f5, 0xb9d1d168, 0x00000000, 0xc1eded2c,
- 0x40202060, 0xe3fcfc1f, 0x79b1b1c8, 0xb65b5bed,
- 0xd46a6abe, 0x8dcbcb46, 0x67bebed9, 0x7239394b,
- 0x944a4ade, 0x984c4cd4, 0xb05858e8, 0x85cfcf4a,
- 0xbbd0d06b, 0xc5efef2a, 0x4faaaae5, 0xedfbfb16,
- 0x864343c5, 0x9a4d4dd7, 0x66333355, 0x11858594,
- 0x8a4545cf, 0xe9f9f910, 0x04020206, 0xfe7f7f81,
- 0xa05050f0, 0x783c3c44, 0x259f9fba, 0x4ba8a8e3,
- 0xa25151f3, 0x5da3a3fe, 0x804040c0, 0x058f8f8a,
- 0x3f9292ad, 0x219d9dbc, 0x70383848, 0xf1f5f504,
- 0x63bcbcdf, 0x77b6b6c1, 0xafdada75, 0x42212163,
- 0x20101030, 0xe5ffff1a, 0xfdf3f30e, 0xbfd2d26d,
- 0x81cdcd4c, 0x180c0c14, 0x26131335, 0xc3ecec2f,
- 0xbe5f5fe1, 0x359797a2, 0x884444cc, 0x2e171739,
- 0x93c4c457, 0x55a7a7f2, 0xfc7e7e82, 0x7a3d3d47,
- 0xc86464ac, 0xba5d5de7, 0x3219192b, 0xe6737395,
- 0xc06060a0, 0x19818198, 0x9e4f4fd1, 0xa3dcdc7f,
- 0x44222266, 0x542a2a7e, 0x3b9090ab, 0x0b888883,
- 0x8c4646ca, 0xc7eeee29, 0x6bb8b8d3, 0x2814143c,
- 0xa7dede79, 0xbc5e5ee2, 0x160b0b1d, 0xaddbdb76,
- 0xdbe0e03b, 0x64323256, 0x743a3a4e, 0x140a0a1e,
- 0x924949db, 0x0c06060a, 0x4824246c, 0xb85c5ce4,
- 0x9fc2c25d, 0xbdd3d36e, 0x43acacef, 0xc46262a6,
- 0x399191a8, 0x319595a4, 0xd3e4e437, 0xf279798b,
- 0xd5e7e732, 0x8bc8c843, 0x6e373759, 0xda6d6db7,
- 0x018d8d8c, 0xb1d5d564, 0x9c4e4ed2, 0x49a9a9e0,
- 0xd86c6cb4, 0xac5656fa, 0xf3f4f407, 0xcfeaea25,
- 0xca6565af, 0xf47a7a8e, 0x47aeaee9, 0x10080818,
- 0x6fbabad5, 0xf0787888, 0x4a25256f, 0x5c2e2e72,
- 0x381c1c24, 0x57a6a6f1, 0x73b4b4c7, 0x97c6c651,
- 0xcbe8e823, 0xa1dddd7c, 0xe874749c, 0x3e1f1f21,
- 0x964b4bdd, 0x61bdbddc, 0x0d8b8b86, 0x0f8a8a85,
- 0xe0707090, 0x7c3e3e42, 0x71b5b5c4, 0xcc6666aa,
- 0x904848d8, 0x06030305, 0xf7f6f601, 0x1c0e0e12,
- 0xc26161a3, 0x6a35355f, 0xae5757f9, 0x69b9b9d0,
- 0x17868691, 0x99c1c158, 0x3a1d1d27, 0x279e9eb9,
- 0xd9e1e138, 0xebf8f813, 0x2b9898b3, 0x22111133,
- 0xd26969bb, 0xa9d9d970, 0x078e8e89, 0x339494a7,
- 0x2d9b9bb6, 0x3c1e1e22, 0x15878792, 0xc9e9e920,
- 0x87cece49, 0xaa5555ff, 0x50282878, 0xa5dfdf7a,
- 0x038c8c8f, 0x59a1a1f8, 0x09898980, 0x1a0d0d17,
- 0x65bfbfda, 0xd7e6e631, 0x844242c6, 0xd06868b8,
- 0x824141c3, 0x299999b0, 0x5a2d2d77, 0x1e0f0f11,
- 0x7bb0b0cb, 0xa85454fc, 0x6dbbbbd6, 0x2c16163a,
-};
-static const unsigned int E1[256] = {
- 0xa5c66363, 0x84f87c7c, 0x99ee7777, 0x8df67b7b,
- 0x0dfff2f2, 0xbdd66b6b, 0xb1de6f6f, 0x5491c5c5,
- 0x50603030, 0x03020101, 0xa9ce6767, 0x7d562b2b,
- 0x19e7fefe, 0x62b5d7d7, 0xe64dabab, 0x9aec7676,
- 0x458fcaca, 0x9d1f8282, 0x4089c9c9, 0x87fa7d7d,
- 0x15effafa, 0xebb25959, 0xc98e4747, 0x0bfbf0f0,
- 0xec41adad, 0x67b3d4d4, 0xfd5fa2a2, 0xea45afaf,
- 0xbf239c9c, 0xf753a4a4, 0x96e47272, 0x5b9bc0c0,
- 0xc275b7b7, 0x1ce1fdfd, 0xae3d9393, 0x6a4c2626,
- 0x5a6c3636, 0x417e3f3f, 0x02f5f7f7, 0x4f83cccc,
- 0x5c683434, 0xf451a5a5, 0x34d1e5e5, 0x08f9f1f1,
- 0x93e27171, 0x73abd8d8, 0x53623131, 0x3f2a1515,
- 0x0c080404, 0x5295c7c7, 0x65462323, 0x5e9dc3c3,
- 0x28301818, 0xa1379696, 0x0f0a0505, 0xb52f9a9a,
- 0x090e0707, 0x36241212, 0x9b1b8080, 0x3ddfe2e2,
- 0x26cdebeb, 0x694e2727, 0xcd7fb2b2, 0x9fea7575,
- 0x1b120909, 0x9e1d8383, 0x74582c2c, 0x2e341a1a,
- 0x2d361b1b, 0xb2dc6e6e, 0xeeb45a5a, 0xfb5ba0a0,
- 0xf6a45252, 0x4d763b3b, 0x61b7d6d6, 0xce7db3b3,
- 0x7b522929, 0x3edde3e3, 0x715e2f2f, 0x97138484,
- 0xf5a65353, 0x68b9d1d1, 0x00000000, 0x2cc1eded,
- 0x60402020, 0x1fe3fcfc, 0xc879b1b1, 0xedb65b5b,
- 0xbed46a6a, 0x468dcbcb, 0xd967bebe, 0x4b723939,
- 0xde944a4a, 0xd4984c4c, 0xe8b05858, 0x4a85cfcf,
- 0x6bbbd0d0, 0x2ac5efef, 0xe54faaaa, 0x16edfbfb,
- 0xc5864343, 0xd79a4d4d, 0x55663333, 0x94118585,
- 0xcf8a4545, 0x10e9f9f9, 0x06040202, 0x81fe7f7f,
- 0xf0a05050, 0x44783c3c, 0xba259f9f, 0xe34ba8a8,
- 0xf3a25151, 0xfe5da3a3, 0xc0804040, 0x8a058f8f,
- 0xad3f9292, 0xbc219d9d, 0x48703838, 0x04f1f5f5,
- 0xdf63bcbc, 0xc177b6b6, 0x75afdada, 0x63422121,
- 0x30201010, 0x1ae5ffff, 0x0efdf3f3, 0x6dbfd2d2,
- 0x4c81cdcd, 0x14180c0c, 0x35261313, 0x2fc3ecec,
- 0xe1be5f5f, 0xa2359797, 0xcc884444, 0x392e1717,
- 0x5793c4c4, 0xf255a7a7, 0x82fc7e7e, 0x477a3d3d,
- 0xacc86464, 0xe7ba5d5d, 0x2b321919, 0x95e67373,
- 0xa0c06060, 0x98198181, 0xd19e4f4f, 0x7fa3dcdc,
- 0x66442222, 0x7e542a2a, 0xab3b9090, 0x830b8888,
- 0xca8c4646, 0x29c7eeee, 0xd36bb8b8, 0x3c281414,
- 0x79a7dede, 0xe2bc5e5e, 0x1d160b0b, 0x76addbdb,
- 0x3bdbe0e0, 0x56643232, 0x4e743a3a, 0x1e140a0a,
- 0xdb924949, 0x0a0c0606, 0x6c482424, 0xe4b85c5c,
- 0x5d9fc2c2, 0x6ebdd3d3, 0xef43acac, 0xa6c46262,
- 0xa8399191, 0xa4319595, 0x37d3e4e4, 0x8bf27979,
- 0x32d5e7e7, 0x438bc8c8, 0x596e3737, 0xb7da6d6d,
- 0x8c018d8d, 0x64b1d5d5, 0xd29c4e4e, 0xe049a9a9,
- 0xb4d86c6c, 0xfaac5656, 0x07f3f4f4, 0x25cfeaea,
- 0xafca6565, 0x8ef47a7a, 0xe947aeae, 0x18100808,
- 0xd56fbaba, 0x88f07878, 0x6f4a2525, 0x725c2e2e,
- 0x24381c1c, 0xf157a6a6, 0xc773b4b4, 0x5197c6c6,
- 0x23cbe8e8, 0x7ca1dddd, 0x9ce87474, 0x213e1f1f,
- 0xdd964b4b, 0xdc61bdbd, 0x860d8b8b, 0x850f8a8a,
- 0x90e07070, 0x427c3e3e, 0xc471b5b5, 0xaacc6666,
- 0xd8904848, 0x05060303, 0x01f7f6f6, 0x121c0e0e,
- 0xa3c26161, 0x5f6a3535, 0xf9ae5757, 0xd069b9b9,
- 0x91178686, 0x5899c1c1, 0x273a1d1d, 0xb9279e9e,
- 0x38d9e1e1, 0x13ebf8f8, 0xb32b9898, 0x33221111,
- 0xbbd26969, 0x70a9d9d9, 0x89078e8e, 0xa7339494,
- 0xb62d9b9b, 0x223c1e1e, 0x92158787, 0x20c9e9e9,
- 0x4987cece, 0xffaa5555, 0x78502828, 0x7aa5dfdf,
- 0x8f038c8c, 0xf859a1a1, 0x80098989, 0x171a0d0d,
- 0xda65bfbf, 0x31d7e6e6, 0xc6844242, 0xb8d06868,
- 0xc3824141, 0xb0299999, 0x775a2d2d, 0x111e0f0f,
- 0xcb7bb0b0, 0xfca85454, 0xd66dbbbb, 0x3a2c1616,
-};
-static const unsigned int E2[256] = {
- 0x63a5c663, 0x7c84f87c, 0x7799ee77, 0x7b8df67b,
- 0xf20dfff2, 0x6bbdd66b, 0x6fb1de6f, 0xc55491c5,
- 0x30506030, 0x01030201, 0x67a9ce67, 0x2b7d562b,
- 0xfe19e7fe, 0xd762b5d7, 0xabe64dab, 0x769aec76,
- 0xca458fca, 0x829d1f82, 0xc94089c9, 0x7d87fa7d,
- 0xfa15effa, 0x59ebb259, 0x47c98e47, 0xf00bfbf0,
- 0xadec41ad, 0xd467b3d4, 0xa2fd5fa2, 0xafea45af,
- 0x9cbf239c, 0xa4f753a4, 0x7296e472, 0xc05b9bc0,
- 0xb7c275b7, 0xfd1ce1fd, 0x93ae3d93, 0x266a4c26,
- 0x365a6c36, 0x3f417e3f, 0xf702f5f7, 0xcc4f83cc,
- 0x345c6834, 0xa5f451a5, 0xe534d1e5, 0xf108f9f1,
- 0x7193e271, 0xd873abd8, 0x31536231, 0x153f2a15,
- 0x040c0804, 0xc75295c7, 0x23654623, 0xc35e9dc3,
- 0x18283018, 0x96a13796, 0x050f0a05, 0x9ab52f9a,
- 0x07090e07, 0x12362412, 0x809b1b80, 0xe23ddfe2,
- 0xeb26cdeb, 0x27694e27, 0xb2cd7fb2, 0x759fea75,
- 0x091b1209, 0x839e1d83, 0x2c74582c, 0x1a2e341a,
- 0x1b2d361b, 0x6eb2dc6e, 0x5aeeb45a, 0xa0fb5ba0,
- 0x52f6a452, 0x3b4d763b, 0xd661b7d6, 0xb3ce7db3,
- 0x297b5229, 0xe33edde3, 0x2f715e2f, 0x84971384,
- 0x53f5a653, 0xd168b9d1, 0x00000000, 0xed2cc1ed,
- 0x20604020, 0xfc1fe3fc, 0xb1c879b1, 0x5bedb65b,
- 0x6abed46a, 0xcb468dcb, 0xbed967be, 0x394b7239,
- 0x4ade944a, 0x4cd4984c, 0x58e8b058, 0xcf4a85cf,
- 0xd06bbbd0, 0xef2ac5ef, 0xaae54faa, 0xfb16edfb,
- 0x43c58643, 0x4dd79a4d, 0x33556633, 0x85941185,
- 0x45cf8a45, 0xf910e9f9, 0x02060402, 0x7f81fe7f,
- 0x50f0a050, 0x3c44783c, 0x9fba259f, 0xa8e34ba8,
- 0x51f3a251, 0xa3fe5da3, 0x40c08040, 0x8f8a058f,
- 0x92ad3f92, 0x9dbc219d, 0x38487038, 0xf504f1f5,
- 0xbcdf63bc, 0xb6c177b6, 0xda75afda, 0x21634221,
- 0x10302010, 0xff1ae5ff, 0xf30efdf3, 0xd26dbfd2,
- 0xcd4c81cd, 0x0c14180c, 0x13352613, 0xec2fc3ec,
- 0x5fe1be5f, 0x97a23597, 0x44cc8844, 0x17392e17,
- 0xc45793c4, 0xa7f255a7, 0x7e82fc7e, 0x3d477a3d,
- 0x64acc864, 0x5de7ba5d, 0x192b3219, 0x7395e673,
- 0x60a0c060, 0x81981981, 0x4fd19e4f, 0xdc7fa3dc,
- 0x22664422, 0x2a7e542a, 0x90ab3b90, 0x88830b88,
- 0x46ca8c46, 0xee29c7ee, 0xb8d36bb8, 0x143c2814,
- 0xde79a7de, 0x5ee2bc5e, 0x0b1d160b, 0xdb76addb,
- 0xe03bdbe0, 0x32566432, 0x3a4e743a, 0x0a1e140a,
- 0x49db9249, 0x060a0c06, 0x246c4824, 0x5ce4b85c,
- 0xc25d9fc2, 0xd36ebdd3, 0xacef43ac, 0x62a6c462,
- 0x91a83991, 0x95a43195, 0xe437d3e4, 0x798bf279,
- 0xe732d5e7, 0xc8438bc8, 0x37596e37, 0x6db7da6d,
- 0x8d8c018d, 0xd564b1d5, 0x4ed29c4e, 0xa9e049a9,
- 0x6cb4d86c, 0x56faac56, 0xf407f3f4, 0xea25cfea,
- 0x65afca65, 0x7a8ef47a, 0xaee947ae, 0x08181008,
- 0xbad56fba, 0x7888f078, 0x256f4a25, 0x2e725c2e,
- 0x1c24381c, 0xa6f157a6, 0xb4c773b4, 0xc65197c6,
- 0xe823cbe8, 0xdd7ca1dd, 0x749ce874, 0x1f213e1f,
- 0x4bdd964b, 0xbddc61bd, 0x8b860d8b, 0x8a850f8a,
- 0x7090e070, 0x3e427c3e, 0xb5c471b5, 0x66aacc66,
- 0x48d89048, 0x03050603, 0xf601f7f6, 0x0e121c0e,
- 0x61a3c261, 0x355f6a35, 0x57f9ae57, 0xb9d069b9,
- 0x86911786, 0xc15899c1, 0x1d273a1d, 0x9eb9279e,
- 0xe138d9e1, 0xf813ebf8, 0x98b32b98, 0x11332211,
- 0x69bbd269, 0xd970a9d9, 0x8e89078e, 0x94a73394,
- 0x9bb62d9b, 0x1e223c1e, 0x87921587, 0xe920c9e9,
- 0xce4987ce, 0x55ffaa55, 0x28785028, 0xdf7aa5df,
- 0x8c8f038c, 0xa1f859a1, 0x89800989, 0x0d171a0d,
- 0xbfda65bf, 0xe631d7e6, 0x42c68442, 0x68b8d068,
- 0x41c38241, 0x99b02999, 0x2d775a2d, 0x0f111e0f,
- 0xb0cb7bb0, 0x54fca854, 0xbbd66dbb, 0x163a2c16,
-};
-static const unsigned int E3[256] = {
- 0x6363a5c6, 0x7c7c84f8, 0x777799ee, 0x7b7b8df6,
- 0xf2f20dff, 0x6b6bbdd6, 0x6f6fb1de, 0xc5c55491,
- 0x30305060, 0x01010302, 0x6767a9ce, 0x2b2b7d56,
- 0xfefe19e7, 0xd7d762b5, 0xababe64d, 0x76769aec,
- 0xcaca458f, 0x82829d1f, 0xc9c94089, 0x7d7d87fa,
- 0xfafa15ef, 0x5959ebb2, 0x4747c98e, 0xf0f00bfb,
- 0xadadec41, 0xd4d467b3, 0xa2a2fd5f, 0xafafea45,
- 0x9c9cbf23, 0xa4a4f753, 0x727296e4, 0xc0c05b9b,
- 0xb7b7c275, 0xfdfd1ce1, 0x9393ae3d, 0x26266a4c,
- 0x36365a6c, 0x3f3f417e, 0xf7f702f5, 0xcccc4f83,
- 0x34345c68, 0xa5a5f451, 0xe5e534d1, 0xf1f108f9,
- 0x717193e2, 0xd8d873ab, 0x31315362, 0x15153f2a,
- 0x04040c08, 0xc7c75295, 0x23236546, 0xc3c35e9d,
- 0x18182830, 0x9696a137, 0x05050f0a, 0x9a9ab52f,
- 0x0707090e, 0x12123624, 0x80809b1b, 0xe2e23ddf,
- 0xebeb26cd, 0x2727694e, 0xb2b2cd7f, 0x75759fea,
- 0x09091b12, 0x83839e1d, 0x2c2c7458, 0x1a1a2e34,
- 0x1b1b2d36, 0x6e6eb2dc, 0x5a5aeeb4, 0xa0a0fb5b,
- 0x5252f6a4, 0x3b3b4d76, 0xd6d661b7, 0xb3b3ce7d,
- 0x29297b52, 0xe3e33edd, 0x2f2f715e, 0x84849713,
- 0x5353f5a6, 0xd1d168b9, 0x00000000, 0xeded2cc1,
- 0x20206040, 0xfcfc1fe3, 0xb1b1c879, 0x5b5bedb6,
- 0x6a6abed4, 0xcbcb468d, 0xbebed967, 0x39394b72,
- 0x4a4ade94, 0x4c4cd498, 0x5858e8b0, 0xcfcf4a85,
- 0xd0d06bbb, 0xefef2ac5, 0xaaaae54f, 0xfbfb16ed,
- 0x4343c586, 0x4d4dd79a, 0x33335566, 0x85859411,
- 0x4545cf8a, 0xf9f910e9, 0x02020604, 0x7f7f81fe,
- 0x5050f0a0, 0x3c3c4478, 0x9f9fba25, 0xa8a8e34b,
- 0x5151f3a2, 0xa3a3fe5d, 0x4040c080, 0x8f8f8a05,
- 0x9292ad3f, 0x9d9dbc21, 0x38384870, 0xf5f504f1,
- 0xbcbcdf63, 0xb6b6c177, 0xdada75af, 0x21216342,
- 0x10103020, 0xffff1ae5, 0xf3f30efd, 0xd2d26dbf,
- 0xcdcd4c81, 0x0c0c1418, 0x13133526, 0xecec2fc3,
- 0x5f5fe1be, 0x9797a235, 0x4444cc88, 0x1717392e,
- 0xc4c45793, 0xa7a7f255, 0x7e7e82fc, 0x3d3d477a,
- 0x6464acc8, 0x5d5de7ba, 0x19192b32, 0x737395e6,
- 0x6060a0c0, 0x81819819, 0x4f4fd19e, 0xdcdc7fa3,
- 0x22226644, 0x2a2a7e54, 0x9090ab3b, 0x8888830b,
- 0x4646ca8c, 0xeeee29c7, 0xb8b8d36b, 0x14143c28,
- 0xdede79a7, 0x5e5ee2bc, 0x0b0b1d16, 0xdbdb76ad,
- 0xe0e03bdb, 0x32325664, 0x3a3a4e74, 0x0a0a1e14,
- 0x4949db92, 0x06060a0c, 0x24246c48, 0x5c5ce4b8,
- 0xc2c25d9f, 0xd3d36ebd, 0xacacef43, 0x6262a6c4,
- 0x9191a839, 0x9595a431, 0xe4e437d3, 0x79798bf2,
- 0xe7e732d5, 0xc8c8438b, 0x3737596e, 0x6d6db7da,
- 0x8d8d8c01, 0xd5d564b1, 0x4e4ed29c, 0xa9a9e049,
- 0x6c6cb4d8, 0x5656faac, 0xf4f407f3, 0xeaea25cf,
- 0x6565afca, 0x7a7a8ef4, 0xaeaee947, 0x08081810,
- 0xbabad56f, 0x787888f0, 0x25256f4a, 0x2e2e725c,
- 0x1c1c2438, 0xa6a6f157, 0xb4b4c773, 0xc6c65197,
- 0xe8e823cb, 0xdddd7ca1, 0x74749ce8, 0x1f1f213e,
- 0x4b4bdd96, 0xbdbddc61, 0x8b8b860d, 0x8a8a850f,
- 0x707090e0, 0x3e3e427c, 0xb5b5c471, 0x6666aacc,
- 0x4848d890, 0x03030506, 0xf6f601f7, 0x0e0e121c,
- 0x6161a3c2, 0x35355f6a, 0x5757f9ae, 0xb9b9d069,
- 0x86869117, 0xc1c15899, 0x1d1d273a, 0x9e9eb927,
- 0xe1e138d9, 0xf8f813eb, 0x9898b32b, 0x11113322,
- 0x6969bbd2, 0xd9d970a9, 0x8e8e8907, 0x9494a733,
- 0x9b9bb62d, 0x1e1e223c, 0x87879215, 0xe9e920c9,
- 0xcece4987, 0x5555ffaa, 0x28287850, 0xdfdf7aa5,
- 0x8c8c8f03, 0xa1a1f859, 0x89898009, 0x0d0d171a,
- 0xbfbfda65, 0xe6e631d7, 0x4242c684, 0x6868b8d0,
- 0x4141c382, 0x9999b029, 0x2d2d775a, 0x0f0f111e,
- 0xb0b0cb7b, 0x5454fca8, 0xbbbbd66d, 0x16163a2c,
-};
-static const unsigned int D0[256] = {
- 0x51f4a750, 0x7e416553, 0x1a17a4c3, 0x3a275e96,
- 0x3bab6bcb, 0x1f9d45f1, 0xacfa58ab, 0x4be30393,
- 0x2030fa55, 0xad766df6, 0x88cc7691, 0xf5024c25,
- 0x4fe5d7fc, 0xc52acbd7, 0x26354480, 0xb562a38f,
- 0xdeb15a49, 0x25ba1b67, 0x45ea0e98, 0x5dfec0e1,
- 0xc32f7502, 0x814cf012, 0x8d4697a3, 0x6bd3f9c6,
- 0x038f5fe7, 0x15929c95, 0xbf6d7aeb, 0x955259da,
- 0xd4be832d, 0x587421d3, 0x49e06929, 0x8ec9c844,
- 0x75c2896a, 0xf48e7978, 0x99583e6b, 0x27b971dd,
- 0xbee14fb6, 0xf088ad17, 0xc920ac66, 0x7dce3ab4,
- 0x63df4a18, 0xe51a3182, 0x97513360, 0x62537f45,
- 0xb16477e0, 0xbb6bae84, 0xfe81a01c, 0xf9082b94,
- 0x70486858, 0x8f45fd19, 0x94de6c87, 0x527bf8b7,
- 0xab73d323, 0x724b02e2, 0xe31f8f57, 0x6655ab2a,
- 0xb2eb2807, 0x2fb5c203, 0x86c57b9a, 0xd33708a5,
- 0x302887f2, 0x23bfa5b2, 0x02036aba, 0xed16825c,
- 0x8acf1c2b, 0xa779b492, 0xf307f2f0, 0x4e69e2a1,
- 0x65daf4cd, 0x0605bed5, 0xd134621f, 0xc4a6fe8a,
- 0x342e539d, 0xa2f355a0, 0x058ae132, 0xa4f6eb75,
- 0x0b83ec39, 0x4060efaa, 0x5e719f06, 0xbd6e1051,
- 0x3e218af9, 0x96dd063d, 0xdd3e05ae, 0x4de6bd46,
- 0x91548db5, 0x71c45d05, 0x0406d46f, 0x605015ff,
- 0x1998fb24, 0xd6bde997, 0x894043cc, 0x67d99e77,
- 0xb0e842bd, 0x07898b88, 0xe7195b38, 0x79c8eedb,
- 0xa17c0a47, 0x7c420fe9, 0xf8841ec9, 0x00000000,
- 0x09808683, 0x322bed48, 0x1e1170ac, 0x6c5a724e,
- 0xfd0efffb, 0x0f853856, 0x3daed51e, 0x362d3927,
- 0x0a0fd964, 0x685ca621, 0x9b5b54d1, 0x24362e3a,
- 0x0c0a67b1, 0x9357e70f, 0xb4ee96d2, 0x1b9b919e,
- 0x80c0c54f, 0x61dc20a2, 0x5a774b69, 0x1c121a16,
- 0xe293ba0a, 0xc0a02ae5, 0x3c22e043, 0x121b171d,
- 0x0e090d0b, 0xf28bc7ad, 0x2db6a8b9, 0x141ea9c8,
- 0x57f11985, 0xaf75074c, 0xee99ddbb, 0xa37f60fd,
- 0xf701269f, 0x5c72f5bc, 0x44663bc5, 0x5bfb7e34,
- 0x8b432976, 0xcb23c6dc, 0xb6edfc68, 0xb8e4f163,
- 0xd731dcca, 0x42638510, 0x13972240, 0x84c61120,
- 0x854a247d, 0xd2bb3df8, 0xaef93211, 0xc729a16d,
- 0x1d9e2f4b, 0xdcb230f3, 0x0d8652ec, 0x77c1e3d0,
- 0x2bb3166c, 0xa970b999, 0x119448fa, 0x47e96422,
- 0xa8fc8cc4, 0xa0f03f1a, 0x567d2cd8, 0x223390ef,
- 0x87494ec7, 0xd938d1c1, 0x8ccaa2fe, 0x98d40b36,
- 0xa6f581cf, 0xa57ade28, 0xdab78e26, 0x3fadbfa4,
- 0x2c3a9de4, 0x5078920d, 0x6a5fcc9b, 0x547e4662,
- 0xf68d13c2, 0x90d8b8e8, 0x2e39f75e, 0x82c3aff5,
- 0x9f5d80be, 0x69d0937c, 0x6fd52da9, 0xcf2512b3,
- 0xc8ac993b, 0x10187da7, 0xe89c636e, 0xdb3bbb7b,
- 0xcd267809, 0x6e5918f4, 0xec9ab701, 0x834f9aa8,
- 0xe6956e65, 0xaaffe67e, 0x21bccf08, 0xef15e8e6,
- 0xbae79bd9, 0x4a6f36ce, 0xea9f09d4, 0x29b07cd6,
- 0x31a4b2af, 0x2a3f2331, 0xc6a59430, 0x35a266c0,
- 0x744ebc37, 0xfc82caa6, 0xe090d0b0, 0x33a7d815,
- 0xf104984a, 0x41ecdaf7, 0x7fcd500e, 0x1791f62f,
- 0x764dd68d, 0x43efb04d, 0xccaa4d54, 0xe49604df,
- 0x9ed1b5e3, 0x4c6a881b, 0xc12c1fb8, 0x4665517f,
- 0x9d5eea04, 0x018c355d, 0xfa877473, 0xfb0b412e,
- 0xb3671d5a, 0x92dbd252, 0xe9105633, 0x6dd64713,
- 0x9ad7618c, 0x37a10c7a, 0x59f8148e, 0xeb133c89,
- 0xcea927ee, 0xb761c935, 0xe11ce5ed, 0x7a47b13c,
- 0x9cd2df59, 0x55f2733f, 0x1814ce79, 0x73c737bf,
- 0x53f7cdea, 0x5ffdaa5b, 0xdf3d6f14, 0x7844db86,
- 0xcaaff381, 0xb968c43e, 0x3824342c, 0xc2a3405f,
- 0x161dc372, 0xbce2250c, 0x283c498b, 0xff0d9541,
- 0x39a80171, 0x080cb3de, 0xd8b4e49c, 0x6456c190,
- 0x7bcb8461, 0xd532b670, 0x486c5c74, 0xd0b85742,
-};
-static const unsigned int D1[256] = {
- 0x5051f4a7, 0x537e4165, 0xc31a17a4, 0x963a275e,
- 0xcb3bab6b, 0xf11f9d45, 0xabacfa58, 0x934be303,
- 0x552030fa, 0xf6ad766d, 0x9188cc76, 0x25f5024c,
- 0xfc4fe5d7, 0xd7c52acb, 0x80263544, 0x8fb562a3,
- 0x49deb15a, 0x6725ba1b, 0x9845ea0e, 0xe15dfec0,
- 0x02c32f75, 0x12814cf0, 0xa38d4697, 0xc66bd3f9,
- 0xe7038f5f, 0x9515929c, 0xebbf6d7a, 0xda955259,
- 0x2dd4be83, 0xd3587421, 0x2949e069, 0x448ec9c8,
- 0x6a75c289, 0x78f48e79, 0x6b99583e, 0xdd27b971,
- 0xb6bee14f, 0x17f088ad, 0x66c920ac, 0xb47dce3a,
- 0x1863df4a, 0x82e51a31, 0x60975133, 0x4562537f,
- 0xe0b16477, 0x84bb6bae, 0x1cfe81a0, 0x94f9082b,
- 0x58704868, 0x198f45fd, 0x8794de6c, 0xb7527bf8,
- 0x23ab73d3, 0xe2724b02, 0x57e31f8f, 0x2a6655ab,
- 0x07b2eb28, 0x032fb5c2, 0x9a86c57b, 0xa5d33708,
- 0xf2302887, 0xb223bfa5, 0xba02036a, 0x5ced1682,
- 0x2b8acf1c, 0x92a779b4, 0xf0f307f2, 0xa14e69e2,
- 0xcd65daf4, 0xd50605be, 0x1fd13462, 0x8ac4a6fe,
- 0x9d342e53, 0xa0a2f355, 0x32058ae1, 0x75a4f6eb,
- 0x390b83ec, 0xaa4060ef, 0x065e719f, 0x51bd6e10,
- 0xf93e218a, 0x3d96dd06, 0xaedd3e05, 0x464de6bd,
- 0xb591548d, 0x0571c45d, 0x6f0406d4, 0xff605015,
- 0x241998fb, 0x97d6bde9, 0xcc894043, 0x7767d99e,
- 0xbdb0e842, 0x8807898b, 0x38e7195b, 0xdb79c8ee,
- 0x47a17c0a, 0xe97c420f, 0xc9f8841e, 0x00000000,
- 0x83098086, 0x48322bed, 0xac1e1170, 0x4e6c5a72,
- 0xfbfd0eff, 0x560f8538, 0x1e3daed5, 0x27362d39,
- 0x640a0fd9, 0x21685ca6, 0xd19b5b54, 0x3a24362e,
- 0xb10c0a67, 0x0f9357e7, 0xd2b4ee96, 0x9e1b9b91,
- 0x4f80c0c5, 0xa261dc20, 0x695a774b, 0x161c121a,
- 0x0ae293ba, 0xe5c0a02a, 0x433c22e0, 0x1d121b17,
- 0x0b0e090d, 0xadf28bc7, 0xb92db6a8, 0xc8141ea9,
- 0x8557f119, 0x4caf7507, 0xbbee99dd, 0xfda37f60,
- 0x9ff70126, 0xbc5c72f5, 0xc544663b, 0x345bfb7e,
- 0x768b4329, 0xdccb23c6, 0x68b6edfc, 0x63b8e4f1,
- 0xcad731dc, 0x10426385, 0x40139722, 0x2084c611,
- 0x7d854a24, 0xf8d2bb3d, 0x11aef932, 0x6dc729a1,
- 0x4b1d9e2f, 0xf3dcb230, 0xec0d8652, 0xd077c1e3,
- 0x6c2bb316, 0x99a970b9, 0xfa119448, 0x2247e964,
- 0xc4a8fc8c, 0x1aa0f03f, 0xd8567d2c, 0xef223390,
- 0xc787494e, 0xc1d938d1, 0xfe8ccaa2, 0x3698d40b,
- 0xcfa6f581, 0x28a57ade, 0x26dab78e, 0xa43fadbf,
- 0xe42c3a9d, 0x0d507892, 0x9b6a5fcc, 0x62547e46,
- 0xc2f68d13, 0xe890d8b8, 0x5e2e39f7, 0xf582c3af,
- 0xbe9f5d80, 0x7c69d093, 0xa96fd52d, 0xb3cf2512,
- 0x3bc8ac99, 0xa710187d, 0x6ee89c63, 0x7bdb3bbb,
- 0x09cd2678, 0xf46e5918, 0x01ec9ab7, 0xa8834f9a,
- 0x65e6956e, 0x7eaaffe6, 0x0821bccf, 0xe6ef15e8,
- 0xd9bae79b, 0xce4a6f36, 0xd4ea9f09, 0xd629b07c,
- 0xaf31a4b2, 0x312a3f23, 0x30c6a594, 0xc035a266,
- 0x37744ebc, 0xa6fc82ca, 0xb0e090d0, 0x1533a7d8,
- 0x4af10498, 0xf741ecda, 0x0e7fcd50, 0x2f1791f6,
- 0x8d764dd6, 0x4d43efb0, 0x54ccaa4d, 0xdfe49604,
- 0xe39ed1b5, 0x1b4c6a88, 0xb8c12c1f, 0x7f466551,
- 0x049d5eea, 0x5d018c35, 0x73fa8774, 0x2efb0b41,
- 0x5ab3671d, 0x5292dbd2, 0x33e91056, 0x136dd647,
- 0x8c9ad761, 0x7a37a10c, 0x8e59f814, 0x89eb133c,
- 0xeecea927, 0x35b761c9, 0xede11ce5, 0x3c7a47b1,
- 0x599cd2df, 0x3f55f273, 0x791814ce, 0xbf73c737,
- 0xea53f7cd, 0x5b5ffdaa, 0x14df3d6f, 0x867844db,
- 0x81caaff3, 0x3eb968c4, 0x2c382434, 0x5fc2a340,
- 0x72161dc3, 0x0cbce225, 0x8b283c49, 0x41ff0d95,
- 0x7139a801, 0xde080cb3, 0x9cd8b4e4, 0x906456c1,
- 0x617bcb84, 0x70d532b6, 0x74486c5c, 0x42d0b857,
-};
-static const unsigned int D2[256] = {
- 0xa75051f4, 0x65537e41, 0xa4c31a17, 0x5e963a27,
- 0x6bcb3bab, 0x45f11f9d, 0x58abacfa, 0x03934be3,
- 0xfa552030, 0x6df6ad76, 0x769188cc, 0x4c25f502,
- 0xd7fc4fe5, 0xcbd7c52a, 0x44802635, 0xa38fb562,
- 0x5a49deb1, 0x1b6725ba, 0x0e9845ea, 0xc0e15dfe,
- 0x7502c32f, 0xf012814c, 0x97a38d46, 0xf9c66bd3,
- 0x5fe7038f, 0x9c951592, 0x7aebbf6d, 0x59da9552,
- 0x832dd4be, 0x21d35874, 0x692949e0, 0xc8448ec9,
- 0x896a75c2, 0x7978f48e, 0x3e6b9958, 0x71dd27b9,
- 0x4fb6bee1, 0xad17f088, 0xac66c920, 0x3ab47dce,
- 0x4a1863df, 0x3182e51a, 0x33609751, 0x7f456253,
- 0x77e0b164, 0xae84bb6b, 0xa01cfe81, 0x2b94f908,
- 0x68587048, 0xfd198f45, 0x6c8794de, 0xf8b7527b,
- 0xd323ab73, 0x02e2724b, 0x8f57e31f, 0xab2a6655,
- 0x2807b2eb, 0xc2032fb5, 0x7b9a86c5, 0x08a5d337,
- 0x87f23028, 0xa5b223bf, 0x6aba0203, 0x825ced16,
- 0x1c2b8acf, 0xb492a779, 0xf2f0f307, 0xe2a14e69,
- 0xf4cd65da, 0xbed50605, 0x621fd134, 0xfe8ac4a6,
- 0x539d342e, 0x55a0a2f3, 0xe132058a, 0xeb75a4f6,
- 0xec390b83, 0xefaa4060, 0x9f065e71, 0x1051bd6e,
- 0x8af93e21, 0x063d96dd, 0x05aedd3e, 0xbd464de6,
- 0x8db59154, 0x5d0571c4, 0xd46f0406, 0x15ff6050,
- 0xfb241998, 0xe997d6bd, 0x43cc8940, 0x9e7767d9,
- 0x42bdb0e8, 0x8b880789, 0x5b38e719, 0xeedb79c8,
- 0x0a47a17c, 0x0fe97c42, 0x1ec9f884, 0x00000000,
- 0x86830980, 0xed48322b, 0x70ac1e11, 0x724e6c5a,
- 0xfffbfd0e, 0x38560f85, 0xd51e3dae, 0x3927362d,
- 0xd9640a0f, 0xa621685c, 0x54d19b5b, 0x2e3a2436,
- 0x67b10c0a, 0xe70f9357, 0x96d2b4ee, 0x919e1b9b,
- 0xc54f80c0, 0x20a261dc, 0x4b695a77, 0x1a161c12,
- 0xba0ae293, 0x2ae5c0a0, 0xe0433c22, 0x171d121b,
- 0x0d0b0e09, 0xc7adf28b, 0xa8b92db6, 0xa9c8141e,
- 0x198557f1, 0x074caf75, 0xddbbee99, 0x60fda37f,
- 0x269ff701, 0xf5bc5c72, 0x3bc54466, 0x7e345bfb,
- 0x29768b43, 0xc6dccb23, 0xfc68b6ed, 0xf163b8e4,
- 0xdccad731, 0x85104263, 0x22401397, 0x112084c6,
- 0x247d854a, 0x3df8d2bb, 0x3211aef9, 0xa16dc729,
- 0x2f4b1d9e, 0x30f3dcb2, 0x52ec0d86, 0xe3d077c1,
- 0x166c2bb3, 0xb999a970, 0x48fa1194, 0x642247e9,
- 0x8cc4a8fc, 0x3f1aa0f0, 0x2cd8567d, 0x90ef2233,
- 0x4ec78749, 0xd1c1d938, 0xa2fe8cca, 0x0b3698d4,
- 0x81cfa6f5, 0xde28a57a, 0x8e26dab7, 0xbfa43fad,
- 0x9de42c3a, 0x920d5078, 0xcc9b6a5f, 0x4662547e,
- 0x13c2f68d, 0xb8e890d8, 0xf75e2e39, 0xaff582c3,
- 0x80be9f5d, 0x937c69d0, 0x2da96fd5, 0x12b3cf25,
- 0x993bc8ac, 0x7da71018, 0x636ee89c, 0xbb7bdb3b,
- 0x7809cd26, 0x18f46e59, 0xb701ec9a, 0x9aa8834f,
- 0x6e65e695, 0xe67eaaff, 0xcf0821bc, 0xe8e6ef15,
- 0x9bd9bae7, 0x36ce4a6f, 0x09d4ea9f, 0x7cd629b0,
- 0xb2af31a4, 0x23312a3f, 0x9430c6a5, 0x66c035a2,
- 0xbc37744e, 0xcaa6fc82, 0xd0b0e090, 0xd81533a7,
- 0x984af104, 0xdaf741ec, 0x500e7fcd, 0xf62f1791,
- 0xd68d764d, 0xb04d43ef, 0x4d54ccaa, 0x04dfe496,
- 0xb5e39ed1, 0x881b4c6a, 0x1fb8c12c, 0x517f4665,
- 0xea049d5e, 0x355d018c, 0x7473fa87, 0x412efb0b,
- 0x1d5ab367, 0xd25292db, 0x5633e910, 0x47136dd6,
- 0x618c9ad7, 0x0c7a37a1, 0x148e59f8, 0x3c89eb13,
- 0x27eecea9, 0xc935b761, 0xe5ede11c, 0xb13c7a47,
- 0xdf599cd2, 0x733f55f2, 0xce791814, 0x37bf73c7,
- 0xcdea53f7, 0xaa5b5ffd, 0x6f14df3d, 0xdb867844,
- 0xf381caaf, 0xc43eb968, 0x342c3824, 0x405fc2a3,
- 0xc372161d, 0x250cbce2, 0x498b283c, 0x9541ff0d,
- 0x017139a8, 0xb3de080c, 0xe49cd8b4, 0xc1906456,
- 0x84617bcb, 0xb670d532, 0x5c74486c, 0x5742d0b8,
-};
-static const unsigned int D3[256] = {
- 0xf4a75051, 0x4165537e, 0x17a4c31a, 0x275e963a,
- 0xab6bcb3b, 0x9d45f11f, 0xfa58abac, 0xe303934b,
- 0x30fa5520, 0x766df6ad, 0xcc769188, 0x024c25f5,
- 0xe5d7fc4f, 0x2acbd7c5, 0x35448026, 0x62a38fb5,
- 0xb15a49de, 0xba1b6725, 0xea0e9845, 0xfec0e15d,
- 0x2f7502c3, 0x4cf01281, 0x4697a38d, 0xd3f9c66b,
- 0x8f5fe703, 0x929c9515, 0x6d7aebbf, 0x5259da95,
- 0xbe832dd4, 0x7421d358, 0xe0692949, 0xc9c8448e,
- 0xc2896a75, 0x8e7978f4, 0x583e6b99, 0xb971dd27,
- 0xe14fb6be, 0x88ad17f0, 0x20ac66c9, 0xce3ab47d,
- 0xdf4a1863, 0x1a3182e5, 0x51336097, 0x537f4562,
- 0x6477e0b1, 0x6bae84bb, 0x81a01cfe, 0x082b94f9,
- 0x48685870, 0x45fd198f, 0xde6c8794, 0x7bf8b752,
- 0x73d323ab, 0x4b02e272, 0x1f8f57e3, 0x55ab2a66,
- 0xeb2807b2, 0xb5c2032f, 0xc57b9a86, 0x3708a5d3,
- 0x2887f230, 0xbfa5b223, 0x036aba02, 0x16825ced,
- 0xcf1c2b8a, 0x79b492a7, 0x07f2f0f3, 0x69e2a14e,
- 0xdaf4cd65, 0x05bed506, 0x34621fd1, 0xa6fe8ac4,
- 0x2e539d34, 0xf355a0a2, 0x8ae13205, 0xf6eb75a4,
- 0x83ec390b, 0x60efaa40, 0x719f065e, 0x6e1051bd,
- 0x218af93e, 0xdd063d96, 0x3e05aedd, 0xe6bd464d,
- 0x548db591, 0xc45d0571, 0x06d46f04, 0x5015ff60,
- 0x98fb2419, 0xbde997d6, 0x4043cc89, 0xd99e7767,
- 0xe842bdb0, 0x898b8807, 0x195b38e7, 0xc8eedb79,
- 0x7c0a47a1, 0x420fe97c, 0x841ec9f8, 0x00000000,
- 0x80868309, 0x2bed4832, 0x1170ac1e, 0x5a724e6c,
- 0x0efffbfd, 0x8538560f, 0xaed51e3d, 0x2d392736,
- 0x0fd9640a, 0x5ca62168, 0x5b54d19b, 0x362e3a24,
- 0x0a67b10c, 0x57e70f93, 0xee96d2b4, 0x9b919e1b,
- 0xc0c54f80, 0xdc20a261, 0x774b695a, 0x121a161c,
- 0x93ba0ae2, 0xa02ae5c0, 0x22e0433c, 0x1b171d12,
- 0x090d0b0e, 0x8bc7adf2, 0xb6a8b92d, 0x1ea9c814,
- 0xf1198557, 0x75074caf, 0x99ddbbee, 0x7f60fda3,
- 0x01269ff7, 0x72f5bc5c, 0x663bc544, 0xfb7e345b,
- 0x4329768b, 0x23c6dccb, 0xedfc68b6, 0xe4f163b8,
- 0x31dccad7, 0x63851042, 0x97224013, 0xc6112084,
- 0x4a247d85, 0xbb3df8d2, 0xf93211ae, 0x29a16dc7,
- 0x9e2f4b1d, 0xb230f3dc, 0x8652ec0d, 0xc1e3d077,
- 0xb3166c2b, 0x70b999a9, 0x9448fa11, 0xe9642247,
- 0xfc8cc4a8, 0xf03f1aa0, 0x7d2cd856, 0x3390ef22,
- 0x494ec787, 0x38d1c1d9, 0xcaa2fe8c, 0xd40b3698,
- 0xf581cfa6, 0x7ade28a5, 0xb78e26da, 0xadbfa43f,
- 0x3a9de42c, 0x78920d50, 0x5fcc9b6a, 0x7e466254,
- 0x8d13c2f6, 0xd8b8e890, 0x39f75e2e, 0xc3aff582,
- 0x5d80be9f, 0xd0937c69, 0xd52da96f, 0x2512b3cf,
- 0xac993bc8, 0x187da710, 0x9c636ee8, 0x3bbb7bdb,
- 0x267809cd, 0x5918f46e, 0x9ab701ec, 0x4f9aa883,
- 0x956e65e6, 0xffe67eaa, 0xbccf0821, 0x15e8e6ef,
- 0xe79bd9ba, 0x6f36ce4a, 0x9f09d4ea, 0xb07cd629,
- 0xa4b2af31, 0x3f23312a, 0xa59430c6, 0xa266c035,
- 0x4ebc3774, 0x82caa6fc, 0x90d0b0e0, 0xa7d81533,
- 0x04984af1, 0xecdaf741, 0xcd500e7f, 0x91f62f17,
- 0x4dd68d76, 0xefb04d43, 0xaa4d54cc, 0x9604dfe4,
- 0xd1b5e39e, 0x6a881b4c, 0x2c1fb8c1, 0x65517f46,
- 0x5eea049d, 0x8c355d01, 0x877473fa, 0x0b412efb,
- 0x671d5ab3, 0xdbd25292, 0x105633e9, 0xd647136d,
- 0xd7618c9a, 0xa10c7a37, 0xf8148e59, 0x133c89eb,
- 0xa927eece, 0x61c935b7, 0x1ce5ede1, 0x47b13c7a,
- 0xd2df599c, 0xf2733f55, 0x14ce7918, 0xc737bf73,
- 0xf7cdea53, 0xfdaa5b5f, 0x3d6f14df, 0x44db8678,
- 0xaff381ca, 0x68c43eb9, 0x24342c38, 0xa3405fc2,
- 0x1dc37216, 0xe2250cbc, 0x3c498b28, 0x0d9541ff,
- 0xa8017139, 0x0cb3de08, 0xb4e49cd8, 0x56c19064,
- 0xcb84617b, 0x32b670d5, 0x6c5c7448, 0xb85742d0,
-};
-#define ADD_ROUND_KEY_4 (block[0]^=*keysched++, block[1]^=*keysched++, \
- block[2]^=*keysched++, block[3]^=*keysched++)
-#define ADD_ROUND_KEY_6 (block[0]^=*keysched++, block[1]^=*keysched++, \
- block[2]^=*keysched++, block[3]^=*keysched++, \
- block[4]^=*keysched++, block[5]^=*keysched++)
-#define ADD_ROUND_KEY_8 (block[0]^=*keysched++, block[1]^=*keysched++, \
- block[2]^=*keysched++, block[3]^=*keysched++, \
- block[4]^=*keysched++, block[5]^=*keysched++, \
- block[6]^=*keysched++, block[7]^=*keysched++)
-#define MOVEWORD(i) ( block[i] = newstate[i] )
-#undef MAKEWORD
-#define MAKEWORD(i) ( newstate[i] = (E0[(block[i] >> 24) & 0xFF] ^ \
- E1[(block[(i+C1)%Nb] >> 16) & 0xFF] ^ \
- E2[(block[(i+C2)%Nb] >> 8) & 0xFF] ^ \
- E3[block[(i+C3)%Nb] & 0xFF]) )
-#define LASTWORD(i) ( newstate[i] = (Sbox[(block[i] >> 24) & 0xFF] << 24) | \
- (Sbox[(block[(i+C1)%Nb] >> 16) & 0xFF] << 16) | \
- (Sbox[(block[(i+C2)%Nb] >> 8) & 0xFF] << 8) | \
- (Sbox[(block[(i+C3)%Nb] ) & 0xFF] ) )
-static void aes_encrypt_nb_4(AESContext * ctx, unsigned int * block)
-{
- int i;
- static const int C1 = 1, C2 = 2, C3 = 3, Nb = 4;
- unsigned int *keysched = ctx->keysched;
- unsigned int newstate[4];
- for (i = 0; i < ctx->Nr - 1; i++) {
- ADD_ROUND_KEY_4;
- MAKEWORD(0);
- MAKEWORD(1);
- MAKEWORD(2);
- MAKEWORD(3);
- MOVEWORD(0);
- MOVEWORD(1);
- MOVEWORD(2);
- MOVEWORD(3);
- }
- ADD_ROUND_KEY_4;
- LASTWORD(0);
- LASTWORD(1);
- LASTWORD(2);
- LASTWORD(3);
- MOVEWORD(0);
- MOVEWORD(1);
- MOVEWORD(2);
- MOVEWORD(3);
- ADD_ROUND_KEY_4;
-}
-static void aes_encrypt_nb_6(AESContext * ctx, unsigned int * block)
-{
- int i;
- static const int C1 = 1, C2 = 2, C3 = 3, Nb = 6;
- unsigned int *keysched = ctx->keysched;
- unsigned int newstate[6];
- for (i = 0; i < ctx->Nr - 1; i++) {
- ADD_ROUND_KEY_6;
- MAKEWORD(0);
- MAKEWORD(1);
- MAKEWORD(2);
- MAKEWORD(3);
- MAKEWORD(4);
- MAKEWORD(5);
- MOVEWORD(0);
- MOVEWORD(1);
- MOVEWORD(2);
- MOVEWORD(3);
- MOVEWORD(4);
- MOVEWORD(5);
- }
- ADD_ROUND_KEY_6;
- LASTWORD(0);
- LASTWORD(1);
- LASTWORD(2);
- LASTWORD(3);
- LASTWORD(4);
- LASTWORD(5);
- MOVEWORD(0);
- MOVEWORD(1);
- MOVEWORD(2);
- MOVEWORD(3);
- MOVEWORD(4);
- MOVEWORD(5);
- ADD_ROUND_KEY_6;
-}
-static void aes_encrypt_nb_8(AESContext * ctx, unsigned int * block)
-{
- int i;
- static const int C1 = 1, C2 = 3, C3 = 4, Nb = 8;
- unsigned int *keysched = ctx->keysched;
- unsigned int newstate[8];
- for (i = 0; i < ctx->Nr - 1; i++) {
- ADD_ROUND_KEY_8;
- MAKEWORD(0);
- MAKEWORD(1);
- MAKEWORD(2);
- MAKEWORD(3);
- MAKEWORD(4);
- MAKEWORD(5);
- MAKEWORD(6);
- MAKEWORD(7);
- MOVEWORD(0);
- MOVEWORD(1);
- MOVEWORD(2);
- MOVEWORD(3);
- MOVEWORD(4);
- MOVEWORD(5);
- MOVEWORD(6);
- MOVEWORD(7);
- }
- ADD_ROUND_KEY_8;
- LASTWORD(0);
- LASTWORD(1);
- LASTWORD(2);
- LASTWORD(3);
- LASTWORD(4);
- LASTWORD(5);
- LASTWORD(6);
- LASTWORD(7);
- MOVEWORD(0);
- MOVEWORD(1);
- MOVEWORD(2);
- MOVEWORD(3);
- MOVEWORD(4);
- MOVEWORD(5);
- MOVEWORD(6);
- MOVEWORD(7);
- ADD_ROUND_KEY_8;
-}
-#undef MAKEWORD
-#undef LASTWORD
-#define MAKEWORD(i) ( newstate[i] = (D0[(block[i] >> 24) & 0xFF] ^ \
- D1[(block[(i+C1)%Nb] >> 16) & 0xFF] ^ \
- D2[(block[(i+C2)%Nb] >> 8) & 0xFF] ^ \
- D3[block[(i+C3)%Nb] & 0xFF]) )
-#define LASTWORD(i) (newstate[i] = (Sboxinv[(block[i] >> 24) & 0xFF] << 24) | \
- (Sboxinv[(block[(i+C1)%Nb] >> 16) & 0xFF] << 16) | \
- (Sboxinv[(block[(i+C2)%Nb] >> 8) & 0xFF] << 8) | \
- (Sboxinv[(block[(i+C3)%Nb] ) & 0xFF] ) )
-static void aes_decrypt_nb_4(AESContext * ctx, unsigned int * block)
-{
- int i;
- static const int C1 = 4 - 1, C2 = 4 - 2, C3 = 4 - 3, Nb = 4;
- unsigned int *keysched = ctx->invkeysched;
- unsigned int newstate[4];
- for (i = 0; i < ctx->Nr - 1; i++) {
- ADD_ROUND_KEY_4;
- MAKEWORD(0);
- MAKEWORD(1);
- MAKEWORD(2);
- MAKEWORD(3);
- MOVEWORD(0);
- MOVEWORD(1);
- MOVEWORD(2);
- MOVEWORD(3);
- }
- ADD_ROUND_KEY_4;
- LASTWORD(0);
- LASTWORD(1);
- LASTWORD(2);
- LASTWORD(3);
- MOVEWORD(0);
- MOVEWORD(1);
- MOVEWORD(2);
- MOVEWORD(3);
- ADD_ROUND_KEY_4;
-}
-static void aes_decrypt_nb_6(AESContext * ctx, unsigned int * block)
-{
- int i;
- static const int C1 = 6 - 1, C2 = 6 - 2, C3 = 6 - 3, Nb = 6;
- unsigned int *keysched = ctx->invkeysched;
- unsigned int newstate[6];
- for (i = 0; i < ctx->Nr - 1; i++) {
- ADD_ROUND_KEY_6;
- MAKEWORD(0);
- MAKEWORD(1);
- MAKEWORD(2);
- MAKEWORD(3);
- MAKEWORD(4);
- MAKEWORD(5);
- MOVEWORD(0);
- MOVEWORD(1);
- MOVEWORD(2);
- MOVEWORD(3);
- MOVEWORD(4);
- MOVEWORD(5);
- }
- ADD_ROUND_KEY_6;
- LASTWORD(0);
- LASTWORD(1);
- LASTWORD(2);
- LASTWORD(3);
- LASTWORD(4);
- LASTWORD(5);
- MOVEWORD(0);
- MOVEWORD(1);
- MOVEWORD(2);
- MOVEWORD(3);
- MOVEWORD(4);
- MOVEWORD(5);
- ADD_ROUND_KEY_6;
-}
-static void aes_decrypt_nb_8(AESContext * ctx, unsigned int * block)
-{
- int i;
- static const int C1 = 8 - 1, C2 = 8 - 3, C3 = 8 - 4, Nb = 8;
- unsigned int *keysched = ctx->invkeysched;
- unsigned int newstate[8];
- for (i = 0; i < ctx->Nr - 1; i++) {
- ADD_ROUND_KEY_8;
- MAKEWORD(0);
- MAKEWORD(1);
- MAKEWORD(2);
- MAKEWORD(3);
- MAKEWORD(4);
- MAKEWORD(5);
- MAKEWORD(6);
- MAKEWORD(7);
- MOVEWORD(0);
- MOVEWORD(1);
- MOVEWORD(2);
- MOVEWORD(3);
- MOVEWORD(4);
- MOVEWORD(5);
- MOVEWORD(6);
- MOVEWORD(7);
- }
- ADD_ROUND_KEY_8;
- LASTWORD(0);
- LASTWORD(1);
- LASTWORD(2);
- LASTWORD(3);
- LASTWORD(4);
- LASTWORD(5);
- LASTWORD(6);
- LASTWORD(7);
- MOVEWORD(0);
- MOVEWORD(1);
- MOVEWORD(2);
- MOVEWORD(3);
- MOVEWORD(4);
- MOVEWORD(5);
- MOVEWORD(6);
- MOVEWORD(7);
- ADD_ROUND_KEY_8;
-}
-#undef MAKEWORD
-#undef LASTWORD
-static void aes_setup(AESContext * ctx, int blocklen,
- const unsigned char *key, int keylen)
-{
- int i, j, Nk, rconst;
- ASSERT(blocklen == 16 || blocklen == 24 || blocklen == 32);
- ASSERT(keylen == 16 || keylen == 24 || keylen == 32);
- Nk = keylen / 4;
- ctx->Nb = blocklen / 4;
- ctx->Nr = 6 + (ctx->Nb > Nk ? ctx->Nb : Nk);
- if (ctx->Nb == 8) {
- ctx->encrypt = aes_encrypt_nb_8, ctx->decrypt = aes_decrypt_nb_8;
- } else if (ctx->Nb == 6) {
- ctx->encrypt = aes_encrypt_nb_6, ctx->decrypt = aes_decrypt_nb_6;
- } else if (ctx->Nb == 4) {
- ctx->encrypt = aes_encrypt_nb_4, ctx->decrypt = aes_decrypt_nb_4;
- }
- rconst = 1;
- for (i = 0; i < (ctx->Nr + 1) * ctx->Nb; i++) {
- if (i < Nk) {
- ctx->keysched[i] = GET_32BIT_MSB_FIRST(key + 4 * i);
- } else {
- unsigned int temp = ctx->keysched[i - 1];
- if (i % Nk == 0) {
- int a, b, c, d;
- a = (temp >> 16) & 0xFF;
- b = (temp >> 8) & 0xFF;
- c = (temp >> 0) & 0xFF;
- d = (temp >> 24) & 0xFF;
- temp = Sbox[a] ^ rconst;
- temp = (temp << 8) | Sbox[b];
- temp = (temp << 8) | Sbox[c];
- temp = (temp << 8) | Sbox[d];
- rconst = mulby2(rconst);
- } else if (i % Nk == 4 && Nk > 6) {
- int a, b, c, d;
- a = (temp >> 24) & 0xFF;
- b = (temp >> 16) & 0xFF;
- c = (temp >> 8) & 0xFF;
- d = (temp >> 0) & 0xFF;
- temp = Sbox[a];
- temp = (temp << 8) | Sbox[b];
- temp = (temp << 8) | Sbox[c];
- temp = (temp << 8) | Sbox[d];
- }
- ctx->keysched[i] = ctx->keysched[i - Nk] ^ temp;
- }
- }
- for (i = 0; i <= ctx->Nr; i++) {
- for (j = 0; j < ctx->Nb; j++) {
- unsigned int temp;
- temp = ctx->keysched[(ctx->Nr - i) * ctx->Nb + j];
- if (i != 0 && i != ctx->Nr) {
- int a, b, c, d;
- a = (temp >> 24) & 0xFF;
- b = (temp >> 16) & 0xFF;
- c = (temp >> 8) & 0xFF;
- d = (temp >> 0) & 0xFF;
- temp = D0[Sbox[a]];
- temp ^= D1[Sbox[b]];
- temp ^= D2[Sbox[c]];
- temp ^= D3[Sbox[d]];
- }
- ctx->invkeysched[i * ctx->Nb + j] = temp;
- }
- }
-}
-static void aes_decrypt(AESContext * ctx, unsigned int * block)
-{
- ctx->decrypt(ctx, block);
-}
-static void aes_decrypt_cbc(unsigned char *dest, const unsigned char *src, int len, AESContext * ctx)
-{
- unsigned int iv[4], x[4], ct[4];
- int i;
- ASSERT((len & 15) == 0);
- FXSYS_memcpy32(iv, ctx->iv, sizeof(iv));
- while (len > 0) {
- for (i = 0; i < 4; i++) {
- x[i] = ct[i] = GET_32BIT_MSB_FIRST(src + 4 * i);
- }
- aes_decrypt(ctx, x);
- for (i = 0; i < 4; i++) {
- PUT_32BIT_MSB_FIRST(dest + 4 * i, iv[i] ^ x[i]);
- iv[i] = ct[i];
- }
- dest += 16;
- src += 16;
- len -= 16;
- }
- FXSYS_memcpy32(ctx->iv, iv, sizeof(iv));
-}
-static void aes_encrypt(AESContext * ctx, unsigned int * block)
-{
- ctx->encrypt(ctx, block);
-}
-static void aes_encrypt_cbc(unsigned char *dest, const unsigned char *src, int len, AESContext * ctx)
-{
- unsigned int iv[4];
- int i;
- ASSERT((len & 15) == 0);
- FXSYS_memcpy32(iv, ctx->iv, sizeof(iv));
- while (len > 0) {
- for (i = 0; i < 4; i++) {
- iv[i] ^= GET_32BIT_MSB_FIRST(src + 4 * i);
- }
- aes_encrypt(ctx, iv);
- for (i = 0; i < 4; i++) {
- PUT_32BIT_MSB_FIRST(dest + 4 * i, iv[i]);
- }
- dest += 16;
- src += 16;
- len -= 16;
- }
- FXSYS_memcpy32(ctx->iv, iv, sizeof(iv));
-}
-void CRYPT_AESSetKey(FX_LPVOID context, FX_DWORD blocklen, FX_LPCBYTE key, FX_DWORD keylen, FX_BOOL bEncrypt)
-{
- aes_setup((AESContext*)context, blocklen, key, keylen);
-}
-void CRYPT_AESSetIV(FX_LPVOID context, FX_LPCBYTE iv)
-{
- int i;
- for (i = 0; i < ((AESContext*)context)->Nb; i++) {
- ((AESContext*)context)->iv[i] = GET_32BIT_MSB_FIRST(iv + 4 * i);
- }
-}
-void CRYPT_AESDecrypt(FX_LPVOID context, FX_LPBYTE dest, FX_LPCBYTE src, FX_DWORD len)
-{
- aes_decrypt_cbc(dest, src, len, (AESContext*)context);
-}
-void CRYPT_AESEncrypt(FX_LPVOID context, FX_LPBYTE dest, FX_LPCBYTE src, FX_DWORD len)
-{
- aes_encrypt_cbc(dest, src, len, (AESContext*)context);
-}
-#ifdef __cplusplus
-};
-#endif
+// 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
+
+#include "../../../include/fxcrt/fx_basic.h"
+#include "../../../include/fdrm/fx_crypt.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+#define MAX_NR 14
+#define MAX_NK 8
+#define MAX_NB 8
+#define mulby2(x) ( ((x&0x7F) << 1) ^ (x & 0x80 ? 0x1B : 0) )
+#define GET_32BIT_MSB_FIRST(cp) \
+ (((unsigned long)(unsigned char)(cp)[3]) | \
+ ((unsigned long)(unsigned char)(cp)[2] << 8) | \
+ ((unsigned long)(unsigned char)(cp)[1] << 16) | \
+ ((unsigned long)(unsigned char)(cp)[0] << 24))
+#define PUT_32BIT_MSB_FIRST(cp, value) do { \
+ (cp)[3] = (value); \
+ (cp)[2] = (value) >> 8; \
+ (cp)[1] = (value) >> 16; \
+ (cp)[0] = (value) >> 24; } while (0)
+struct AESContext {
+ unsigned int keysched[(MAX_NR + 1) * MAX_NB];
+ unsigned int invkeysched[(MAX_NR + 1) * MAX_NB];
+ void (*encrypt) (AESContext * ctx, unsigned int * block);
+ void (*decrypt) (AESContext * ctx, unsigned int * block);
+ unsigned int iv[MAX_NB];
+ int Nb, Nr;
+};
+static const unsigned char Sbox[256] = {
+ 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5,
+ 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76,
+ 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0,
+ 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0,
+ 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc,
+ 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15,
+ 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a,
+ 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75,
+ 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0,
+ 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84,
+ 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b,
+ 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf,
+ 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85,
+ 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8,
+ 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5,
+ 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2,
+ 0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17,
+ 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73,
+ 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88,
+ 0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb,
+ 0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c,
+ 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79,
+ 0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9,
+ 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08,
+ 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6,
+ 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a,
+ 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e,
+ 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e,
+ 0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94,
+ 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf,
+ 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68,
+ 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16
+};
+static const unsigned char Sboxinv[256] = {
+ 0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38,
+ 0xbf, 0x40, 0xa3, 0x9e, 0x81, 0xf3, 0xd7, 0xfb,
+ 0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87,
+ 0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb,
+ 0x54, 0x7b, 0x94, 0x32, 0xa6, 0xc2, 0x23, 0x3d,
+ 0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e,
+ 0x08, 0x2e, 0xa1, 0x66, 0x28, 0xd9, 0x24, 0xb2,
+ 0x76, 0x5b, 0xa2, 0x49, 0x6d, 0x8b, 0xd1, 0x25,
+ 0x72, 0xf8, 0xf6, 0x64, 0x86, 0x68, 0x98, 0x16,
+ 0xd4, 0xa4, 0x5c, 0xcc, 0x5d, 0x65, 0xb6, 0x92,
+ 0x6c, 0x70, 0x48, 0x50, 0xfd, 0xed, 0xb9, 0xda,
+ 0x5e, 0x15, 0x46, 0x57, 0xa7, 0x8d, 0x9d, 0x84,
+ 0x90, 0xd8, 0xab, 0x00, 0x8c, 0xbc, 0xd3, 0x0a,
+ 0xf7, 0xe4, 0x58, 0x05, 0xb8, 0xb3, 0x45, 0x06,
+ 0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02,
+ 0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b,
+ 0x3a, 0x91, 0x11, 0x41, 0x4f, 0x67, 0xdc, 0xea,
+ 0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73,
+ 0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85,
+ 0xe2, 0xf9, 0x37, 0xe8, 0x1c, 0x75, 0xdf, 0x6e,
+ 0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89,
+ 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b,
+ 0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20,
+ 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4,
+ 0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31,
+ 0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f,
+ 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d,
+ 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef,
+ 0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0,
+ 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61,
+ 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26,
+ 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d
+};
+static const unsigned int E0[256] = {
+ 0xc66363a5, 0xf87c7c84, 0xee777799, 0xf67b7b8d,
+ 0xfff2f20d, 0xd66b6bbd, 0xde6f6fb1, 0x91c5c554,
+ 0x60303050, 0x02010103, 0xce6767a9, 0x562b2b7d,
+ 0xe7fefe19, 0xb5d7d762, 0x4dababe6, 0xec76769a,
+ 0x8fcaca45, 0x1f82829d, 0x89c9c940, 0xfa7d7d87,
+ 0xeffafa15, 0xb25959eb, 0x8e4747c9, 0xfbf0f00b,
+ 0x41adadec, 0xb3d4d467, 0x5fa2a2fd, 0x45afafea,
+ 0x239c9cbf, 0x53a4a4f7, 0xe4727296, 0x9bc0c05b,
+ 0x75b7b7c2, 0xe1fdfd1c, 0x3d9393ae, 0x4c26266a,
+ 0x6c36365a, 0x7e3f3f41, 0xf5f7f702, 0x83cccc4f,
+ 0x6834345c, 0x51a5a5f4, 0xd1e5e534, 0xf9f1f108,
+ 0xe2717193, 0xabd8d873, 0x62313153, 0x2a15153f,
+ 0x0804040c, 0x95c7c752, 0x46232365, 0x9dc3c35e,
+ 0x30181828, 0x379696a1, 0x0a05050f, 0x2f9a9ab5,
+ 0x0e070709, 0x24121236, 0x1b80809b, 0xdfe2e23d,
+ 0xcdebeb26, 0x4e272769, 0x7fb2b2cd, 0xea75759f,
+ 0x1209091b, 0x1d83839e, 0x582c2c74, 0x341a1a2e,
+ 0x361b1b2d, 0xdc6e6eb2, 0xb45a5aee, 0x5ba0a0fb,
+ 0xa45252f6, 0x763b3b4d, 0xb7d6d661, 0x7db3b3ce,
+ 0x5229297b, 0xdde3e33e, 0x5e2f2f71, 0x13848497,
+ 0xa65353f5, 0xb9d1d168, 0x00000000, 0xc1eded2c,
+ 0x40202060, 0xe3fcfc1f, 0x79b1b1c8, 0xb65b5bed,
+ 0xd46a6abe, 0x8dcbcb46, 0x67bebed9, 0x7239394b,
+ 0x944a4ade, 0x984c4cd4, 0xb05858e8, 0x85cfcf4a,
+ 0xbbd0d06b, 0xc5efef2a, 0x4faaaae5, 0xedfbfb16,
+ 0x864343c5, 0x9a4d4dd7, 0x66333355, 0x11858594,
+ 0x8a4545cf, 0xe9f9f910, 0x04020206, 0xfe7f7f81,
+ 0xa05050f0, 0x783c3c44, 0x259f9fba, 0x4ba8a8e3,
+ 0xa25151f3, 0x5da3a3fe, 0x804040c0, 0x058f8f8a,
+ 0x3f9292ad, 0x219d9dbc, 0x70383848, 0xf1f5f504,
+ 0x63bcbcdf, 0x77b6b6c1, 0xafdada75, 0x42212163,
+ 0x20101030, 0xe5ffff1a, 0xfdf3f30e, 0xbfd2d26d,
+ 0x81cdcd4c, 0x180c0c14, 0x26131335, 0xc3ecec2f,
+ 0xbe5f5fe1, 0x359797a2, 0x884444cc, 0x2e171739,
+ 0x93c4c457, 0x55a7a7f2, 0xfc7e7e82, 0x7a3d3d47,
+ 0xc86464ac, 0xba5d5de7, 0x3219192b, 0xe6737395,
+ 0xc06060a0, 0x19818198, 0x9e4f4fd1, 0xa3dcdc7f,
+ 0x44222266, 0x542a2a7e, 0x3b9090ab, 0x0b888883,
+ 0x8c4646ca, 0xc7eeee29, 0x6bb8b8d3, 0x2814143c,
+ 0xa7dede79, 0xbc5e5ee2, 0x160b0b1d, 0xaddbdb76,
+ 0xdbe0e03b, 0x64323256, 0x743a3a4e, 0x140a0a1e,
+ 0x924949db, 0x0c06060a, 0x4824246c, 0xb85c5ce4,
+ 0x9fc2c25d, 0xbdd3d36e, 0x43acacef, 0xc46262a6,
+ 0x399191a8, 0x319595a4, 0xd3e4e437, 0xf279798b,
+ 0xd5e7e732, 0x8bc8c843, 0x6e373759, 0xda6d6db7,
+ 0x018d8d8c, 0xb1d5d564, 0x9c4e4ed2, 0x49a9a9e0,
+ 0xd86c6cb4, 0xac5656fa, 0xf3f4f407, 0xcfeaea25,
+ 0xca6565af, 0xf47a7a8e, 0x47aeaee9, 0x10080818,
+ 0x6fbabad5, 0xf0787888, 0x4a25256f, 0x5c2e2e72,
+ 0x381c1c24, 0x57a6a6f1, 0x73b4b4c7, 0x97c6c651,
+ 0xcbe8e823, 0xa1dddd7c, 0xe874749c, 0x3e1f1f21,
+ 0x964b4bdd, 0x61bdbddc, 0x0d8b8b86, 0x0f8a8a85,
+ 0xe0707090, 0x7c3e3e42, 0x71b5b5c4, 0xcc6666aa,
+ 0x904848d8, 0x06030305, 0xf7f6f601, 0x1c0e0e12,
+ 0xc26161a3, 0x6a35355f, 0xae5757f9, 0x69b9b9d0,
+ 0x17868691, 0x99c1c158, 0x3a1d1d27, 0x279e9eb9,
+ 0xd9e1e138, 0xebf8f813, 0x2b9898b3, 0x22111133,
+ 0xd26969bb, 0xa9d9d970, 0x078e8e89, 0x339494a7,
+ 0x2d9b9bb6, 0x3c1e1e22, 0x15878792, 0xc9e9e920,
+ 0x87cece49, 0xaa5555ff, 0x50282878, 0xa5dfdf7a,
+ 0x038c8c8f, 0x59a1a1f8, 0x09898980, 0x1a0d0d17,
+ 0x65bfbfda, 0xd7e6e631, 0x844242c6, 0xd06868b8,
+ 0x824141c3, 0x299999b0, 0x5a2d2d77, 0x1e0f0f11,
+ 0x7bb0b0cb, 0xa85454fc, 0x6dbbbbd6, 0x2c16163a,
+};
+static const unsigned int E1[256] = {
+ 0xa5c66363, 0x84f87c7c, 0x99ee7777, 0x8df67b7b,
+ 0x0dfff2f2, 0xbdd66b6b, 0xb1de6f6f, 0x5491c5c5,
+ 0x50603030, 0x03020101, 0xa9ce6767, 0x7d562b2b,
+ 0x19e7fefe, 0x62b5d7d7, 0xe64dabab, 0x9aec7676,
+ 0x458fcaca, 0x9d1f8282, 0x4089c9c9, 0x87fa7d7d,
+ 0x15effafa, 0xebb25959, 0xc98e4747, 0x0bfbf0f0,
+ 0xec41adad, 0x67b3d4d4, 0xfd5fa2a2, 0xea45afaf,
+ 0xbf239c9c, 0xf753a4a4, 0x96e47272, 0x5b9bc0c0,
+ 0xc275b7b7, 0x1ce1fdfd, 0xae3d9393, 0x6a4c2626,
+ 0x5a6c3636, 0x417e3f3f, 0x02f5f7f7, 0x4f83cccc,
+ 0x5c683434, 0xf451a5a5, 0x34d1e5e5, 0x08f9f1f1,
+ 0x93e27171, 0x73abd8d8, 0x53623131, 0x3f2a1515,
+ 0x0c080404, 0x5295c7c7, 0x65462323, 0x5e9dc3c3,
+ 0x28301818, 0xa1379696, 0x0f0a0505, 0xb52f9a9a,
+ 0x090e0707, 0x36241212, 0x9b1b8080, 0x3ddfe2e2,
+ 0x26cdebeb, 0x694e2727, 0xcd7fb2b2, 0x9fea7575,
+ 0x1b120909, 0x9e1d8383, 0x74582c2c, 0x2e341a1a,
+ 0x2d361b1b, 0xb2dc6e6e, 0xeeb45a5a, 0xfb5ba0a0,
+ 0xf6a45252, 0x4d763b3b, 0x61b7d6d6, 0xce7db3b3,
+ 0x7b522929, 0x3edde3e3, 0x715e2f2f, 0x97138484,
+ 0xf5a65353, 0x68b9d1d1, 0x00000000, 0x2cc1eded,
+ 0x60402020, 0x1fe3fcfc, 0xc879b1b1, 0xedb65b5b,
+ 0xbed46a6a, 0x468dcbcb, 0xd967bebe, 0x4b723939,
+ 0xde944a4a, 0xd4984c4c, 0xe8b05858, 0x4a85cfcf,
+ 0x6bbbd0d0, 0x2ac5efef, 0xe54faaaa, 0x16edfbfb,
+ 0xc5864343, 0xd79a4d4d, 0x55663333, 0x94118585,
+ 0xcf8a4545, 0x10e9f9f9, 0x06040202, 0x81fe7f7f,
+ 0xf0a05050, 0x44783c3c, 0xba259f9f, 0xe34ba8a8,
+ 0xf3a25151, 0xfe5da3a3, 0xc0804040, 0x8a058f8f,
+ 0xad3f9292, 0xbc219d9d, 0x48703838, 0x04f1f5f5,
+ 0xdf63bcbc, 0xc177b6b6, 0x75afdada, 0x63422121,
+ 0x30201010, 0x1ae5ffff, 0x0efdf3f3, 0x6dbfd2d2,
+ 0x4c81cdcd, 0x14180c0c, 0x35261313, 0x2fc3ecec,
+ 0xe1be5f5f, 0xa2359797, 0xcc884444, 0x392e1717,
+ 0x5793c4c4, 0xf255a7a7, 0x82fc7e7e, 0x477a3d3d,
+ 0xacc86464, 0xe7ba5d5d, 0x2b321919, 0x95e67373,
+ 0xa0c06060, 0x98198181, 0xd19e4f4f, 0x7fa3dcdc,
+ 0x66442222, 0x7e542a2a, 0xab3b9090, 0x830b8888,
+ 0xca8c4646, 0x29c7eeee, 0xd36bb8b8, 0x3c281414,
+ 0x79a7dede, 0xe2bc5e5e, 0x1d160b0b, 0x76addbdb,
+ 0x3bdbe0e0, 0x56643232, 0x4e743a3a, 0x1e140a0a,
+ 0xdb924949, 0x0a0c0606, 0x6c482424, 0xe4b85c5c,
+ 0x5d9fc2c2, 0x6ebdd3d3, 0xef43acac, 0xa6c46262,
+ 0xa8399191, 0xa4319595, 0x37d3e4e4, 0x8bf27979,
+ 0x32d5e7e7, 0x438bc8c8, 0x596e3737, 0xb7da6d6d,
+ 0x8c018d8d, 0x64b1d5d5, 0xd29c4e4e, 0xe049a9a9,
+ 0xb4d86c6c, 0xfaac5656, 0x07f3f4f4, 0x25cfeaea,
+ 0xafca6565, 0x8ef47a7a, 0xe947aeae, 0x18100808,
+ 0xd56fbaba, 0x88f07878, 0x6f4a2525, 0x725c2e2e,
+ 0x24381c1c, 0xf157a6a6, 0xc773b4b4, 0x5197c6c6,
+ 0x23cbe8e8, 0x7ca1dddd, 0x9ce87474, 0x213e1f1f,
+ 0xdd964b4b, 0xdc61bdbd, 0x860d8b8b, 0x850f8a8a,
+ 0x90e07070, 0x427c3e3e, 0xc471b5b5, 0xaacc6666,
+ 0xd8904848, 0x05060303, 0x01f7f6f6, 0x121c0e0e,
+ 0xa3c26161, 0x5f6a3535, 0xf9ae5757, 0xd069b9b9,
+ 0x91178686, 0x5899c1c1, 0x273a1d1d, 0xb9279e9e,
+ 0x38d9e1e1, 0x13ebf8f8, 0xb32b9898, 0x33221111,
+ 0xbbd26969, 0x70a9d9d9, 0x89078e8e, 0xa7339494,
+ 0xb62d9b9b, 0x223c1e1e, 0x92158787, 0x20c9e9e9,
+ 0x4987cece, 0xffaa5555, 0x78502828, 0x7aa5dfdf,
+ 0x8f038c8c, 0xf859a1a1, 0x80098989, 0x171a0d0d,
+ 0xda65bfbf, 0x31d7e6e6, 0xc6844242, 0xb8d06868,
+ 0xc3824141, 0xb0299999, 0x775a2d2d, 0x111e0f0f,
+ 0xcb7bb0b0, 0xfca85454, 0xd66dbbbb, 0x3a2c1616,
+};
+static const unsigned int E2[256] = {
+ 0x63a5c663, 0x7c84f87c, 0x7799ee77, 0x7b8df67b,
+ 0xf20dfff2, 0x6bbdd66b, 0x6fb1de6f, 0xc55491c5,
+ 0x30506030, 0x01030201, 0x67a9ce67, 0x2b7d562b,
+ 0xfe19e7fe, 0xd762b5d7, 0xabe64dab, 0x769aec76,
+ 0xca458fca, 0x829d1f82, 0xc94089c9, 0x7d87fa7d,
+ 0xfa15effa, 0x59ebb259, 0x47c98e47, 0xf00bfbf0,
+ 0xadec41ad, 0xd467b3d4, 0xa2fd5fa2, 0xafea45af,
+ 0x9cbf239c, 0xa4f753a4, 0x7296e472, 0xc05b9bc0,
+ 0xb7c275b7, 0xfd1ce1fd, 0x93ae3d93, 0x266a4c26,
+ 0x365a6c36, 0x3f417e3f, 0xf702f5f7, 0xcc4f83cc,
+ 0x345c6834, 0xa5f451a5, 0xe534d1e5, 0xf108f9f1,
+ 0x7193e271, 0xd873abd8, 0x31536231, 0x153f2a15,
+ 0x040c0804, 0xc75295c7, 0x23654623, 0xc35e9dc3,
+ 0x18283018, 0x96a13796, 0x050f0a05, 0x9ab52f9a,
+ 0x07090e07, 0x12362412, 0x809b1b80, 0xe23ddfe2,
+ 0xeb26cdeb, 0x27694e27, 0xb2cd7fb2, 0x759fea75,
+ 0x091b1209, 0x839e1d83, 0x2c74582c, 0x1a2e341a,
+ 0x1b2d361b, 0x6eb2dc6e, 0x5aeeb45a, 0xa0fb5ba0,
+ 0x52f6a452, 0x3b4d763b, 0xd661b7d6, 0xb3ce7db3,
+ 0x297b5229, 0xe33edde3, 0x2f715e2f, 0x84971384,
+ 0x53f5a653, 0xd168b9d1, 0x00000000, 0xed2cc1ed,
+ 0x20604020, 0xfc1fe3fc, 0xb1c879b1, 0x5bedb65b,
+ 0x6abed46a, 0xcb468dcb, 0xbed967be, 0x394b7239,
+ 0x4ade944a, 0x4cd4984c, 0x58e8b058, 0xcf4a85cf,
+ 0xd06bbbd0, 0xef2ac5ef, 0xaae54faa, 0xfb16edfb,
+ 0x43c58643, 0x4dd79a4d, 0x33556633, 0x85941185,
+ 0x45cf8a45, 0xf910e9f9, 0x02060402, 0x7f81fe7f,
+ 0x50f0a050, 0x3c44783c, 0x9fba259f, 0xa8e34ba8,
+ 0x51f3a251, 0xa3fe5da3, 0x40c08040, 0x8f8a058f,
+ 0x92ad3f92, 0x9dbc219d, 0x38487038, 0xf504f1f5,
+ 0xbcdf63bc, 0xb6c177b6, 0xda75afda, 0x21634221,
+ 0x10302010, 0xff1ae5ff, 0xf30efdf3, 0xd26dbfd2,
+ 0xcd4c81cd, 0x0c14180c, 0x13352613, 0xec2fc3ec,
+ 0x5fe1be5f, 0x97a23597, 0x44cc8844, 0x17392e17,
+ 0xc45793c4, 0xa7f255a7, 0x7e82fc7e, 0x3d477a3d,
+ 0x64acc864, 0x5de7ba5d, 0x192b3219, 0x7395e673,
+ 0x60a0c060, 0x81981981, 0x4fd19e4f, 0xdc7fa3dc,
+ 0x22664422, 0x2a7e542a, 0x90ab3b90, 0x88830b88,
+ 0x46ca8c46, 0xee29c7ee, 0xb8d36bb8, 0x143c2814,
+ 0xde79a7de, 0x5ee2bc5e, 0x0b1d160b, 0xdb76addb,
+ 0xe03bdbe0, 0x32566432, 0x3a4e743a, 0x0a1e140a,
+ 0x49db9249, 0x060a0c06, 0x246c4824, 0x5ce4b85c,
+ 0xc25d9fc2, 0xd36ebdd3, 0xacef43ac, 0x62a6c462,
+ 0x91a83991, 0x95a43195, 0xe437d3e4, 0x798bf279,
+ 0xe732d5e7, 0xc8438bc8, 0x37596e37, 0x6db7da6d,
+ 0x8d8c018d, 0xd564b1d5, 0x4ed29c4e, 0xa9e049a9,
+ 0x6cb4d86c, 0x56faac56, 0xf407f3f4, 0xea25cfea,
+ 0x65afca65, 0x7a8ef47a, 0xaee947ae, 0x08181008,
+ 0xbad56fba, 0x7888f078, 0x256f4a25, 0x2e725c2e,
+ 0x1c24381c, 0xa6f157a6, 0xb4c773b4, 0xc65197c6,
+ 0xe823cbe8, 0xdd7ca1dd, 0x749ce874, 0x1f213e1f,
+ 0x4bdd964b, 0xbddc61bd, 0x8b860d8b, 0x8a850f8a,
+ 0x7090e070, 0x3e427c3e, 0xb5c471b5, 0x66aacc66,
+ 0x48d89048, 0x03050603, 0xf601f7f6, 0x0e121c0e,
+ 0x61a3c261, 0x355f6a35, 0x57f9ae57, 0xb9d069b9,
+ 0x86911786, 0xc15899c1, 0x1d273a1d, 0x9eb9279e,
+ 0xe138d9e1, 0xf813ebf8, 0x98b32b98, 0x11332211,
+ 0x69bbd269, 0xd970a9d9, 0x8e89078e, 0x94a73394,
+ 0x9bb62d9b, 0x1e223c1e, 0x87921587, 0xe920c9e9,
+ 0xce4987ce, 0x55ffaa55, 0x28785028, 0xdf7aa5df,
+ 0x8c8f038c, 0xa1f859a1, 0x89800989, 0x0d171a0d,
+ 0xbfda65bf, 0xe631d7e6, 0x42c68442, 0x68b8d068,
+ 0x41c38241, 0x99b02999, 0x2d775a2d, 0x0f111e0f,
+ 0xb0cb7bb0, 0x54fca854, 0xbbd66dbb, 0x163a2c16,
+};
+static const unsigned int E3[256] = {
+ 0x6363a5c6, 0x7c7c84f8, 0x777799ee, 0x7b7b8df6,
+ 0xf2f20dff, 0x6b6bbdd6, 0x6f6fb1de, 0xc5c55491,
+ 0x30305060, 0x01010302, 0x6767a9ce, 0x2b2b7d56,
+ 0xfefe19e7, 0xd7d762b5, 0xababe64d, 0x76769aec,
+ 0xcaca458f, 0x82829d1f, 0xc9c94089, 0x7d7d87fa,
+ 0xfafa15ef, 0x5959ebb2, 0x4747c98e, 0xf0f00bfb,
+ 0xadadec41, 0xd4d467b3, 0xa2a2fd5f, 0xafafea45,
+ 0x9c9cbf23, 0xa4a4f753, 0x727296e4, 0xc0c05b9b,
+ 0xb7b7c275, 0xfdfd1ce1, 0x9393ae3d, 0x26266a4c,
+ 0x36365a6c, 0x3f3f417e, 0xf7f702f5, 0xcccc4f83,
+ 0x34345c68, 0xa5a5f451, 0xe5e534d1, 0xf1f108f9,
+ 0x717193e2, 0xd8d873ab, 0x31315362, 0x15153f2a,
+ 0x04040c08, 0xc7c75295, 0x23236546, 0xc3c35e9d,
+ 0x18182830, 0x9696a137, 0x05050f0a, 0x9a9ab52f,
+ 0x0707090e, 0x12123624, 0x80809b1b, 0xe2e23ddf,
+ 0xebeb26cd, 0x2727694e, 0xb2b2cd7f, 0x75759fea,
+ 0x09091b12, 0x83839e1d, 0x2c2c7458, 0x1a1a2e34,
+ 0x1b1b2d36, 0x6e6eb2dc, 0x5a5aeeb4, 0xa0a0fb5b,
+ 0x5252f6a4, 0x3b3b4d76, 0xd6d661b7, 0xb3b3ce7d,
+ 0x29297b52, 0xe3e33edd, 0x2f2f715e, 0x84849713,
+ 0x5353f5a6, 0xd1d168b9, 0x00000000, 0xeded2cc1,
+ 0x20206040, 0xfcfc1fe3, 0xb1b1c879, 0x5b5bedb6,
+ 0x6a6abed4, 0xcbcb468d, 0xbebed967, 0x39394b72,
+ 0x4a4ade94, 0x4c4cd498, 0x5858e8b0, 0xcfcf4a85,
+ 0xd0d06bbb, 0xefef2ac5, 0xaaaae54f, 0xfbfb16ed,
+ 0x4343c586, 0x4d4dd79a, 0x33335566, 0x85859411,
+ 0x4545cf8a, 0xf9f910e9, 0x02020604, 0x7f7f81fe,
+ 0x5050f0a0, 0x3c3c4478, 0x9f9fba25, 0xa8a8e34b,
+ 0x5151f3a2, 0xa3a3fe5d, 0x4040c080, 0x8f8f8a05,
+ 0x9292ad3f, 0x9d9dbc21, 0x38384870, 0xf5f504f1,
+ 0xbcbcdf63, 0xb6b6c177, 0xdada75af, 0x21216342,
+ 0x10103020, 0xffff1ae5, 0xf3f30efd, 0xd2d26dbf,
+ 0xcdcd4c81, 0x0c0c1418, 0x13133526, 0xecec2fc3,
+ 0x5f5fe1be, 0x9797a235, 0x4444cc88, 0x1717392e,
+ 0xc4c45793, 0xa7a7f255, 0x7e7e82fc, 0x3d3d477a,
+ 0x6464acc8, 0x5d5de7ba, 0x19192b32, 0x737395e6,
+ 0x6060a0c0, 0x81819819, 0x4f4fd19e, 0xdcdc7fa3,
+ 0x22226644, 0x2a2a7e54, 0x9090ab3b, 0x8888830b,
+ 0x4646ca8c, 0xeeee29c7, 0xb8b8d36b, 0x14143c28,
+ 0xdede79a7, 0x5e5ee2bc, 0x0b0b1d16, 0xdbdb76ad,
+ 0xe0e03bdb, 0x32325664, 0x3a3a4e74, 0x0a0a1e14,
+ 0x4949db92, 0x06060a0c, 0x24246c48, 0x5c5ce4b8,
+ 0xc2c25d9f, 0xd3d36ebd, 0xacacef43, 0x6262a6c4,
+ 0x9191a839, 0x9595a431, 0xe4e437d3, 0x79798bf2,
+ 0xe7e732d5, 0xc8c8438b, 0x3737596e, 0x6d6db7da,
+ 0x8d8d8c01, 0xd5d564b1, 0x4e4ed29c, 0xa9a9e049,
+ 0x6c6cb4d8, 0x5656faac, 0xf4f407f3, 0xeaea25cf,
+ 0x6565afca, 0x7a7a8ef4, 0xaeaee947, 0x08081810,
+ 0xbabad56f, 0x787888f0, 0x25256f4a, 0x2e2e725c,
+ 0x1c1c2438, 0xa6a6f157, 0xb4b4c773, 0xc6c65197,
+ 0xe8e823cb, 0xdddd7ca1, 0x74749ce8, 0x1f1f213e,
+ 0x4b4bdd96, 0xbdbddc61, 0x8b8b860d, 0x8a8a850f,
+ 0x707090e0, 0x3e3e427c, 0xb5b5c471, 0x6666aacc,
+ 0x4848d890, 0x03030506, 0xf6f601f7, 0x0e0e121c,
+ 0x6161a3c2, 0x35355f6a, 0x5757f9ae, 0xb9b9d069,
+ 0x86869117, 0xc1c15899, 0x1d1d273a, 0x9e9eb927,
+ 0xe1e138d9, 0xf8f813eb, 0x9898b32b, 0x11113322,
+ 0x6969bbd2, 0xd9d970a9, 0x8e8e8907, 0x9494a733,
+ 0x9b9bb62d, 0x1e1e223c, 0x87879215, 0xe9e920c9,
+ 0xcece4987, 0x5555ffaa, 0x28287850, 0xdfdf7aa5,
+ 0x8c8c8f03, 0xa1a1f859, 0x89898009, 0x0d0d171a,
+ 0xbfbfda65, 0xe6e631d7, 0x4242c684, 0x6868b8d0,
+ 0x4141c382, 0x9999b029, 0x2d2d775a, 0x0f0f111e,
+ 0xb0b0cb7b, 0x5454fca8, 0xbbbbd66d, 0x16163a2c,
+};
+static const unsigned int D0[256] = {
+ 0x51f4a750, 0x7e416553, 0x1a17a4c3, 0x3a275e96,
+ 0x3bab6bcb, 0x1f9d45f1, 0xacfa58ab, 0x4be30393,
+ 0x2030fa55, 0xad766df6, 0x88cc7691, 0xf5024c25,
+ 0x4fe5d7fc, 0xc52acbd7, 0x26354480, 0xb562a38f,
+ 0xdeb15a49, 0x25ba1b67, 0x45ea0e98, 0x5dfec0e1,
+ 0xc32f7502, 0x814cf012, 0x8d4697a3, 0x6bd3f9c6,
+ 0x038f5fe7, 0x15929c95, 0xbf6d7aeb, 0x955259da,
+ 0xd4be832d, 0x587421d3, 0x49e06929, 0x8ec9c844,
+ 0x75c2896a, 0xf48e7978, 0x99583e6b, 0x27b971dd,
+ 0xbee14fb6, 0xf088ad17, 0xc920ac66, 0x7dce3ab4,
+ 0x63df4a18, 0xe51a3182, 0x97513360, 0x62537f45,
+ 0xb16477e0, 0xbb6bae84, 0xfe81a01c, 0xf9082b94,
+ 0x70486858, 0x8f45fd19, 0x94de6c87, 0x527bf8b7,
+ 0xab73d323, 0x724b02e2, 0xe31f8f57, 0x6655ab2a,
+ 0xb2eb2807, 0x2fb5c203, 0x86c57b9a, 0xd33708a5,
+ 0x302887f2, 0x23bfa5b2, 0x02036aba, 0xed16825c,
+ 0x8acf1c2b, 0xa779b492, 0xf307f2f0, 0x4e69e2a1,
+ 0x65daf4cd, 0x0605bed5, 0xd134621f, 0xc4a6fe8a,
+ 0x342e539d, 0xa2f355a0, 0x058ae132, 0xa4f6eb75,
+ 0x0b83ec39, 0x4060efaa, 0x5e719f06, 0xbd6e1051,
+ 0x3e218af9, 0x96dd063d, 0xdd3e05ae, 0x4de6bd46,
+ 0x91548db5, 0x71c45d05, 0x0406d46f, 0x605015ff,
+ 0x1998fb24, 0xd6bde997, 0x894043cc, 0x67d99e77,
+ 0xb0e842bd, 0x07898b88, 0xe7195b38, 0x79c8eedb,
+ 0xa17c0a47, 0x7c420fe9, 0xf8841ec9, 0x00000000,
+ 0x09808683, 0x322bed48, 0x1e1170ac, 0x6c5a724e,
+ 0xfd0efffb, 0x0f853856, 0x3daed51e, 0x362d3927,
+ 0x0a0fd964, 0x685ca621, 0x9b5b54d1, 0x24362e3a,
+ 0x0c0a67b1, 0x9357e70f, 0xb4ee96d2, 0x1b9b919e,
+ 0x80c0c54f, 0x61dc20a2, 0x5a774b69, 0x1c121a16,
+ 0xe293ba0a, 0xc0a02ae5, 0x3c22e043, 0x121b171d,
+ 0x0e090d0b, 0xf28bc7ad, 0x2db6a8b9, 0x141ea9c8,
+ 0x57f11985, 0xaf75074c, 0xee99ddbb, 0xa37f60fd,
+ 0xf701269f, 0x5c72f5bc, 0x44663bc5, 0x5bfb7e34,
+ 0x8b432976, 0xcb23c6dc, 0xb6edfc68, 0xb8e4f163,
+ 0xd731dcca, 0x42638510, 0x13972240, 0x84c61120,
+ 0x854a247d, 0xd2bb3df8, 0xaef93211, 0xc729a16d,
+ 0x1d9e2f4b, 0xdcb230f3, 0x0d8652ec, 0x77c1e3d0,
+ 0x2bb3166c, 0xa970b999, 0x119448fa, 0x47e96422,
+ 0xa8fc8cc4, 0xa0f03f1a, 0x567d2cd8, 0x223390ef,
+ 0x87494ec7, 0xd938d1c1, 0x8ccaa2fe, 0x98d40b36,
+ 0xa6f581cf, 0xa57ade28, 0xdab78e26, 0x3fadbfa4,
+ 0x2c3a9de4, 0x5078920d, 0x6a5fcc9b, 0x547e4662,
+ 0xf68d13c2, 0x90d8b8e8, 0x2e39f75e, 0x82c3aff5,
+ 0x9f5d80be, 0x69d0937c, 0x6fd52da9, 0xcf2512b3,
+ 0xc8ac993b, 0x10187da7, 0xe89c636e, 0xdb3bbb7b,
+ 0xcd267809, 0x6e5918f4, 0xec9ab701, 0x834f9aa8,
+ 0xe6956e65, 0xaaffe67e, 0x21bccf08, 0xef15e8e6,
+ 0xbae79bd9, 0x4a6f36ce, 0xea9f09d4, 0x29b07cd6,
+ 0x31a4b2af, 0x2a3f2331, 0xc6a59430, 0x35a266c0,
+ 0x744ebc37, 0xfc82caa6, 0xe090d0b0, 0x33a7d815,
+ 0xf104984a, 0x41ecdaf7, 0x7fcd500e, 0x1791f62f,
+ 0x764dd68d, 0x43efb04d, 0xccaa4d54, 0xe49604df,
+ 0x9ed1b5e3, 0x4c6a881b, 0xc12c1fb8, 0x4665517f,
+ 0x9d5eea04, 0x018c355d, 0xfa877473, 0xfb0b412e,
+ 0xb3671d5a, 0x92dbd252, 0xe9105633, 0x6dd64713,
+ 0x9ad7618c, 0x37a10c7a, 0x59f8148e, 0xeb133c89,
+ 0xcea927ee, 0xb761c935, 0xe11ce5ed, 0x7a47b13c,
+ 0x9cd2df59, 0x55f2733f, 0x1814ce79, 0x73c737bf,
+ 0x53f7cdea, 0x5ffdaa5b, 0xdf3d6f14, 0x7844db86,
+ 0xcaaff381, 0xb968c43e, 0x3824342c, 0xc2a3405f,
+ 0x161dc372, 0xbce2250c, 0x283c498b, 0xff0d9541,
+ 0x39a80171, 0x080cb3de, 0xd8b4e49c, 0x6456c190,
+ 0x7bcb8461, 0xd532b670, 0x486c5c74, 0xd0b85742,
+};
+static const unsigned int D1[256] = {
+ 0x5051f4a7, 0x537e4165, 0xc31a17a4, 0x963a275e,
+ 0xcb3bab6b, 0xf11f9d45, 0xabacfa58, 0x934be303,
+ 0x552030fa, 0xf6ad766d, 0x9188cc76, 0x25f5024c,
+ 0xfc4fe5d7, 0xd7c52acb, 0x80263544, 0x8fb562a3,
+ 0x49deb15a, 0x6725ba1b, 0x9845ea0e, 0xe15dfec0,
+ 0x02c32f75, 0x12814cf0, 0xa38d4697, 0xc66bd3f9,
+ 0xe7038f5f, 0x9515929c, 0xebbf6d7a, 0xda955259,
+ 0x2dd4be83, 0xd3587421, 0x2949e069, 0x448ec9c8,
+ 0x6a75c289, 0x78f48e79, 0x6b99583e, 0xdd27b971,
+ 0xb6bee14f, 0x17f088ad, 0x66c920ac, 0xb47dce3a,
+ 0x1863df4a, 0x82e51a31, 0x60975133, 0x4562537f,
+ 0xe0b16477, 0x84bb6bae, 0x1cfe81a0, 0x94f9082b,
+ 0x58704868, 0x198f45fd, 0x8794de6c, 0xb7527bf8,
+ 0x23ab73d3, 0xe2724b02, 0x57e31f8f, 0x2a6655ab,
+ 0x07b2eb28, 0x032fb5c2, 0x9a86c57b, 0xa5d33708,
+ 0xf2302887, 0xb223bfa5, 0xba02036a, 0x5ced1682,
+ 0x2b8acf1c, 0x92a779b4, 0xf0f307f2, 0xa14e69e2,
+ 0xcd65daf4, 0xd50605be, 0x1fd13462, 0x8ac4a6fe,
+ 0x9d342e53, 0xa0a2f355, 0x32058ae1, 0x75a4f6eb,
+ 0x390b83ec, 0xaa4060ef, 0x065e719f, 0x51bd6e10,
+ 0xf93e218a, 0x3d96dd06, 0xaedd3e05, 0x464de6bd,
+ 0xb591548d, 0x0571c45d, 0x6f0406d4, 0xff605015,
+ 0x241998fb, 0x97d6bde9, 0xcc894043, 0x7767d99e,
+ 0xbdb0e842, 0x8807898b, 0x38e7195b, 0xdb79c8ee,
+ 0x47a17c0a, 0xe97c420f, 0xc9f8841e, 0x00000000,
+ 0x83098086, 0x48322bed, 0xac1e1170, 0x4e6c5a72,
+ 0xfbfd0eff, 0x560f8538, 0x1e3daed5, 0x27362d39,
+ 0x640a0fd9, 0x21685ca6, 0xd19b5b54, 0x3a24362e,
+ 0xb10c0a67, 0x0f9357e7, 0xd2b4ee96, 0x9e1b9b91,
+ 0x4f80c0c5, 0xa261dc20, 0x695a774b, 0x161c121a,
+ 0x0ae293ba, 0xe5c0a02a, 0x433c22e0, 0x1d121b17,
+ 0x0b0e090d, 0xadf28bc7, 0xb92db6a8, 0xc8141ea9,
+ 0x8557f119, 0x4caf7507, 0xbbee99dd, 0xfda37f60,
+ 0x9ff70126, 0xbc5c72f5, 0xc544663b, 0x345bfb7e,
+ 0x768b4329, 0xdccb23c6, 0x68b6edfc, 0x63b8e4f1,
+ 0xcad731dc, 0x10426385, 0x40139722, 0x2084c611,
+ 0x7d854a24, 0xf8d2bb3d, 0x11aef932, 0x6dc729a1,
+ 0x4b1d9e2f, 0xf3dcb230, 0xec0d8652, 0xd077c1e3,
+ 0x6c2bb316, 0x99a970b9, 0xfa119448, 0x2247e964,
+ 0xc4a8fc8c, 0x1aa0f03f, 0xd8567d2c, 0xef223390,
+ 0xc787494e, 0xc1d938d1, 0xfe8ccaa2, 0x3698d40b,
+ 0xcfa6f581, 0x28a57ade, 0x26dab78e, 0xa43fadbf,
+ 0xe42c3a9d, 0x0d507892, 0x9b6a5fcc, 0x62547e46,
+ 0xc2f68d13, 0xe890d8b8, 0x5e2e39f7, 0xf582c3af,
+ 0xbe9f5d80, 0x7c69d093, 0xa96fd52d, 0xb3cf2512,
+ 0x3bc8ac99, 0xa710187d, 0x6ee89c63, 0x7bdb3bbb,
+ 0x09cd2678, 0xf46e5918, 0x01ec9ab7, 0xa8834f9a,
+ 0x65e6956e, 0x7eaaffe6, 0x0821bccf, 0xe6ef15e8,
+ 0xd9bae79b, 0xce4a6f36, 0xd4ea9f09, 0xd629b07c,
+ 0xaf31a4b2, 0x312a3f23, 0x30c6a594, 0xc035a266,
+ 0x37744ebc, 0xa6fc82ca, 0xb0e090d0, 0x1533a7d8,
+ 0x4af10498, 0xf741ecda, 0x0e7fcd50, 0x2f1791f6,
+ 0x8d764dd6, 0x4d43efb0, 0x54ccaa4d, 0xdfe49604,
+ 0xe39ed1b5, 0x1b4c6a88, 0xb8c12c1f, 0x7f466551,
+ 0x049d5eea, 0x5d018c35, 0x73fa8774, 0x2efb0b41,
+ 0x5ab3671d, 0x5292dbd2, 0x33e91056, 0x136dd647,
+ 0x8c9ad761, 0x7a37a10c, 0x8e59f814, 0x89eb133c,
+ 0xeecea927, 0x35b761c9, 0xede11ce5, 0x3c7a47b1,
+ 0x599cd2df, 0x3f55f273, 0x791814ce, 0xbf73c737,
+ 0xea53f7cd, 0x5b5ffdaa, 0x14df3d6f, 0x867844db,
+ 0x81caaff3, 0x3eb968c4, 0x2c382434, 0x5fc2a340,
+ 0x72161dc3, 0x0cbce225, 0x8b283c49, 0x41ff0d95,
+ 0x7139a801, 0xde080cb3, 0x9cd8b4e4, 0x906456c1,
+ 0x617bcb84, 0x70d532b6, 0x74486c5c, 0x42d0b857,
+};
+static const unsigned int D2[256] = {
+ 0xa75051f4, 0x65537e41, 0xa4c31a17, 0x5e963a27,
+ 0x6bcb3bab, 0x45f11f9d, 0x58abacfa, 0x03934be3,
+ 0xfa552030, 0x6df6ad76, 0x769188cc, 0x4c25f502,
+ 0xd7fc4fe5, 0xcbd7c52a, 0x44802635, 0xa38fb562,
+ 0x5a49deb1, 0x1b6725ba, 0x0e9845ea, 0xc0e15dfe,
+ 0x7502c32f, 0xf012814c, 0x97a38d46, 0xf9c66bd3,
+ 0x5fe7038f, 0x9c951592, 0x7aebbf6d, 0x59da9552,
+ 0x832dd4be, 0x21d35874, 0x692949e0, 0xc8448ec9,
+ 0x896a75c2, 0x7978f48e, 0x3e6b9958, 0x71dd27b9,
+ 0x4fb6bee1, 0xad17f088, 0xac66c920, 0x3ab47dce,
+ 0x4a1863df, 0x3182e51a, 0x33609751, 0x7f456253,
+ 0x77e0b164, 0xae84bb6b, 0xa01cfe81, 0x2b94f908,
+ 0x68587048, 0xfd198f45, 0x6c8794de, 0xf8b7527b,
+ 0xd323ab73, 0x02e2724b, 0x8f57e31f, 0xab2a6655,
+ 0x2807b2eb, 0xc2032fb5, 0x7b9a86c5, 0x08a5d337,
+ 0x87f23028, 0xa5b223bf, 0x6aba0203, 0x825ced16,
+ 0x1c2b8acf, 0xb492a779, 0xf2f0f307, 0xe2a14e69,
+ 0xf4cd65da, 0xbed50605, 0x621fd134, 0xfe8ac4a6,
+ 0x539d342e, 0x55a0a2f3, 0xe132058a, 0xeb75a4f6,
+ 0xec390b83, 0xefaa4060, 0x9f065e71, 0x1051bd6e,
+ 0x8af93e21, 0x063d96dd, 0x05aedd3e, 0xbd464de6,
+ 0x8db59154, 0x5d0571c4, 0xd46f0406, 0x15ff6050,
+ 0xfb241998, 0xe997d6bd, 0x43cc8940, 0x9e7767d9,
+ 0x42bdb0e8, 0x8b880789, 0x5b38e719, 0xeedb79c8,
+ 0x0a47a17c, 0x0fe97c42, 0x1ec9f884, 0x00000000,
+ 0x86830980, 0xed48322b, 0x70ac1e11, 0x724e6c5a,
+ 0xfffbfd0e, 0x38560f85, 0xd51e3dae, 0x3927362d,
+ 0xd9640a0f, 0xa621685c, 0x54d19b5b, 0x2e3a2436,
+ 0x67b10c0a, 0xe70f9357, 0x96d2b4ee, 0x919e1b9b,
+ 0xc54f80c0, 0x20a261dc, 0x4b695a77, 0x1a161c12,
+ 0xba0ae293, 0x2ae5c0a0, 0xe0433c22, 0x171d121b,
+ 0x0d0b0e09, 0xc7adf28b, 0xa8b92db6, 0xa9c8141e,
+ 0x198557f1, 0x074caf75, 0xddbbee99, 0x60fda37f,
+ 0x269ff701, 0xf5bc5c72, 0x3bc54466, 0x7e345bfb,
+ 0x29768b43, 0xc6dccb23, 0xfc68b6ed, 0xf163b8e4,
+ 0xdccad731, 0x85104263, 0x22401397, 0x112084c6,
+ 0x247d854a, 0x3df8d2bb, 0x3211aef9, 0xa16dc729,
+ 0x2f4b1d9e, 0x30f3dcb2, 0x52ec0d86, 0xe3d077c1,
+ 0x166c2bb3, 0xb999a970, 0x48fa1194, 0x642247e9,
+ 0x8cc4a8fc, 0x3f1aa0f0, 0x2cd8567d, 0x90ef2233,
+ 0x4ec78749, 0xd1c1d938, 0xa2fe8cca, 0x0b3698d4,
+ 0x81cfa6f5, 0xde28a57a, 0x8e26dab7, 0xbfa43fad,
+ 0x9de42c3a, 0x920d5078, 0xcc9b6a5f, 0x4662547e,
+ 0x13c2f68d, 0xb8e890d8, 0xf75e2e39, 0xaff582c3,
+ 0x80be9f5d, 0x937c69d0, 0x2da96fd5, 0x12b3cf25,
+ 0x993bc8ac, 0x7da71018, 0x636ee89c, 0xbb7bdb3b,
+ 0x7809cd26, 0x18f46e59, 0xb701ec9a, 0x9aa8834f,
+ 0x6e65e695, 0xe67eaaff, 0xcf0821bc, 0xe8e6ef15,
+ 0x9bd9bae7, 0x36ce4a6f, 0x09d4ea9f, 0x7cd629b0,
+ 0xb2af31a4, 0x23312a3f, 0x9430c6a5, 0x66c035a2,
+ 0xbc37744e, 0xcaa6fc82, 0xd0b0e090, 0xd81533a7,
+ 0x984af104, 0xdaf741ec, 0x500e7fcd, 0xf62f1791,
+ 0xd68d764d, 0xb04d43ef, 0x4d54ccaa, 0x04dfe496,
+ 0xb5e39ed1, 0x881b4c6a, 0x1fb8c12c, 0x517f4665,
+ 0xea049d5e, 0x355d018c, 0x7473fa87, 0x412efb0b,
+ 0x1d5ab367, 0xd25292db, 0x5633e910, 0x47136dd6,
+ 0x618c9ad7, 0x0c7a37a1, 0x148e59f8, 0x3c89eb13,
+ 0x27eecea9, 0xc935b761, 0xe5ede11c, 0xb13c7a47,
+ 0xdf599cd2, 0x733f55f2, 0xce791814, 0x37bf73c7,
+ 0xcdea53f7, 0xaa5b5ffd, 0x6f14df3d, 0xdb867844,
+ 0xf381caaf, 0xc43eb968, 0x342c3824, 0x405fc2a3,
+ 0xc372161d, 0x250cbce2, 0x498b283c, 0x9541ff0d,
+ 0x017139a8, 0xb3de080c, 0xe49cd8b4, 0xc1906456,
+ 0x84617bcb, 0xb670d532, 0x5c74486c, 0x5742d0b8,
+};
+static const unsigned int D3[256] = {
+ 0xf4a75051, 0x4165537e, 0x17a4c31a, 0x275e963a,
+ 0xab6bcb3b, 0x9d45f11f, 0xfa58abac, 0xe303934b,
+ 0x30fa5520, 0x766df6ad, 0xcc769188, 0x024c25f5,
+ 0xe5d7fc4f, 0x2acbd7c5, 0x35448026, 0x62a38fb5,
+ 0xb15a49de, 0xba1b6725, 0xea0e9845, 0xfec0e15d,
+ 0x2f7502c3, 0x4cf01281, 0x4697a38d, 0xd3f9c66b,
+ 0x8f5fe703, 0x929c9515, 0x6d7aebbf, 0x5259da95,
+ 0xbe832dd4, 0x7421d358, 0xe0692949, 0xc9c8448e,
+ 0xc2896a75, 0x8e7978f4, 0x583e6b99, 0xb971dd27,
+ 0xe14fb6be, 0x88ad17f0, 0x20ac66c9, 0xce3ab47d,
+ 0xdf4a1863, 0x1a3182e5, 0x51336097, 0x537f4562,
+ 0x6477e0b1, 0x6bae84bb, 0x81a01cfe, 0x082b94f9,
+ 0x48685870, 0x45fd198f, 0xde6c8794, 0x7bf8b752,
+ 0x73d323ab, 0x4b02e272, 0x1f8f57e3, 0x55ab2a66,
+ 0xeb2807b2, 0xb5c2032f, 0xc57b9a86, 0x3708a5d3,
+ 0x2887f230, 0xbfa5b223, 0x036aba02, 0x16825ced,
+ 0xcf1c2b8a, 0x79b492a7, 0x07f2f0f3, 0x69e2a14e,
+ 0xdaf4cd65, 0x05bed506, 0x34621fd1, 0xa6fe8ac4,
+ 0x2e539d34, 0xf355a0a2, 0x8ae13205, 0xf6eb75a4,
+ 0x83ec390b, 0x60efaa40, 0x719f065e, 0x6e1051bd,
+ 0x218af93e, 0xdd063d96, 0x3e05aedd, 0xe6bd464d,
+ 0x548db591, 0xc45d0571, 0x06d46f04, 0x5015ff60,
+ 0x98fb2419, 0xbde997d6, 0x4043cc89, 0xd99e7767,
+ 0xe842bdb0, 0x898b8807, 0x195b38e7, 0xc8eedb79,
+ 0x7c0a47a1, 0x420fe97c, 0x841ec9f8, 0x00000000,
+ 0x80868309, 0x2bed4832, 0x1170ac1e, 0x5a724e6c,
+ 0x0efffbfd, 0x8538560f, 0xaed51e3d, 0x2d392736,
+ 0x0fd9640a, 0x5ca62168, 0x5b54d19b, 0x362e3a24,
+ 0x0a67b10c, 0x57e70f93, 0xee96d2b4, 0x9b919e1b,
+ 0xc0c54f80, 0xdc20a261, 0x774b695a, 0x121a161c,
+ 0x93ba0ae2, 0xa02ae5c0, 0x22e0433c, 0x1b171d12,
+ 0x090d0b0e, 0x8bc7adf2, 0xb6a8b92d, 0x1ea9c814,
+ 0xf1198557, 0x75074caf, 0x99ddbbee, 0x7f60fda3,
+ 0x01269ff7, 0x72f5bc5c, 0x663bc544, 0xfb7e345b,
+ 0x4329768b, 0x23c6dccb, 0xedfc68b6, 0xe4f163b8,
+ 0x31dccad7, 0x63851042, 0x97224013, 0xc6112084,
+ 0x4a247d85, 0xbb3df8d2, 0xf93211ae, 0x29a16dc7,
+ 0x9e2f4b1d, 0xb230f3dc, 0x8652ec0d, 0xc1e3d077,
+ 0xb3166c2b, 0x70b999a9, 0x9448fa11, 0xe9642247,
+ 0xfc8cc4a8, 0xf03f1aa0, 0x7d2cd856, 0x3390ef22,
+ 0x494ec787, 0x38d1c1d9, 0xcaa2fe8c, 0xd40b3698,
+ 0xf581cfa6, 0x7ade28a5, 0xb78e26da, 0xadbfa43f,
+ 0x3a9de42c, 0x78920d50, 0x5fcc9b6a, 0x7e466254,
+ 0x8d13c2f6, 0xd8b8e890, 0x39f75e2e, 0xc3aff582,
+ 0x5d80be9f, 0xd0937c69, 0xd52da96f, 0x2512b3cf,
+ 0xac993bc8, 0x187da710, 0x9c636ee8, 0x3bbb7bdb,
+ 0x267809cd, 0x5918f46e, 0x9ab701ec, 0x4f9aa883,
+ 0x956e65e6, 0xffe67eaa, 0xbccf0821, 0x15e8e6ef,
+ 0xe79bd9ba, 0x6f36ce4a, 0x9f09d4ea, 0xb07cd629,
+ 0xa4b2af31, 0x3f23312a, 0xa59430c6, 0xa266c035,
+ 0x4ebc3774, 0x82caa6fc, 0x90d0b0e0, 0xa7d81533,
+ 0x04984af1, 0xecdaf741, 0xcd500e7f, 0x91f62f17,
+ 0x4dd68d76, 0xefb04d43, 0xaa4d54cc, 0x9604dfe4,
+ 0xd1b5e39e, 0x6a881b4c, 0x2c1fb8c1, 0x65517f46,
+ 0x5eea049d, 0x8c355d01, 0x877473fa, 0x0b412efb,
+ 0x671d5ab3, 0xdbd25292, 0x105633e9, 0xd647136d,
+ 0xd7618c9a, 0xa10c7a37, 0xf8148e59, 0x133c89eb,
+ 0xa927eece, 0x61c935b7, 0x1ce5ede1, 0x47b13c7a,
+ 0xd2df599c, 0xf2733f55, 0x14ce7918, 0xc737bf73,
+ 0xf7cdea53, 0xfdaa5b5f, 0x3d6f14df, 0x44db8678,
+ 0xaff381ca, 0x68c43eb9, 0x24342c38, 0xa3405fc2,
+ 0x1dc37216, 0xe2250cbc, 0x3c498b28, 0x0d9541ff,
+ 0xa8017139, 0x0cb3de08, 0xb4e49cd8, 0x56c19064,
+ 0xcb84617b, 0x32b670d5, 0x6c5c7448, 0xb85742d0,
+};
+#define ADD_ROUND_KEY_4 (block[0]^=*keysched++, block[1]^=*keysched++, \
+ block[2]^=*keysched++, block[3]^=*keysched++)
+#define ADD_ROUND_KEY_6 (block[0]^=*keysched++, block[1]^=*keysched++, \
+ block[2]^=*keysched++, block[3]^=*keysched++, \
+ block[4]^=*keysched++, block[5]^=*keysched++)
+#define ADD_ROUND_KEY_8 (block[0]^=*keysched++, block[1]^=*keysched++, \
+ block[2]^=*keysched++, block[3]^=*keysched++, \
+ block[4]^=*keysched++, block[5]^=*keysched++, \
+ block[6]^=*keysched++, block[7]^=*keysched++)
+#define MOVEWORD(i) ( block[i] = newstate[i] )
+#undef MAKEWORD
+#define MAKEWORD(i) ( newstate[i] = (E0[(block[i] >> 24) & 0xFF] ^ \
+ E1[(block[(i+C1)%Nb] >> 16) & 0xFF] ^ \
+ E2[(block[(i+C2)%Nb] >> 8) & 0xFF] ^ \
+ E3[block[(i+C3)%Nb] & 0xFF]) )
+#define LASTWORD(i) ( newstate[i] = (Sbox[(block[i] >> 24) & 0xFF] << 24) | \
+ (Sbox[(block[(i+C1)%Nb] >> 16) & 0xFF] << 16) | \
+ (Sbox[(block[(i+C2)%Nb] >> 8) & 0xFF] << 8) | \
+ (Sbox[(block[(i+C3)%Nb] ) & 0xFF] ) )
+static void aes_encrypt_nb_4(AESContext * ctx, unsigned int * block)
+{
+ int i;
+ static const int C1 = 1, C2 = 2, C3 = 3, Nb = 4;
+ unsigned int *keysched = ctx->keysched;
+ unsigned int newstate[4];
+ for (i = 0; i < ctx->Nr - 1; i++) {
+ ADD_ROUND_KEY_4;
+ MAKEWORD(0);
+ MAKEWORD(1);
+ MAKEWORD(2);
+ MAKEWORD(3);
+ MOVEWORD(0);
+ MOVEWORD(1);
+ MOVEWORD(2);
+ MOVEWORD(3);
+ }
+ ADD_ROUND_KEY_4;
+ LASTWORD(0);
+ LASTWORD(1);
+ LASTWORD(2);
+ LASTWORD(3);
+ MOVEWORD(0);
+ MOVEWORD(1);
+ MOVEWORD(2);
+ MOVEWORD(3);
+ ADD_ROUND_KEY_4;
+}
+static void aes_encrypt_nb_6(AESContext * ctx, unsigned int * block)
+{
+ int i;
+ static const int C1 = 1, C2 = 2, C3 = 3, Nb = 6;
+ unsigned int *keysched = ctx->keysched;
+ unsigned int newstate[6];
+ for (i = 0; i < ctx->Nr - 1; i++) {
+ ADD_ROUND_KEY_6;
+ MAKEWORD(0);
+ MAKEWORD(1);
+ MAKEWORD(2);
+ MAKEWORD(3);
+ MAKEWORD(4);
+ MAKEWORD(5);
+ MOVEWORD(0);
+ MOVEWORD(1);
+ MOVEWORD(2);
+ MOVEWORD(3);
+ MOVEWORD(4);
+ MOVEWORD(5);
+ }
+ ADD_ROUND_KEY_6;
+ LASTWORD(0);
+ LASTWORD(1);
+ LASTWORD(2);
+ LASTWORD(3);
+ LASTWORD(4);
+ LASTWORD(5);
+ MOVEWORD(0);
+ MOVEWORD(1);
+ MOVEWORD(2);
+ MOVEWORD(3);
+ MOVEWORD(4);
+ MOVEWORD(5);
+ ADD_ROUND_KEY_6;
+}
+static void aes_encrypt_nb_8(AESContext * ctx, unsigned int * block)
+{
+ int i;
+ static const int C1 = 1, C2 = 3, C3 = 4, Nb = 8;
+ unsigned int *keysched = ctx->keysched;
+ unsigned int newstate[8];
+ for (i = 0; i < ctx->Nr - 1; i++) {
+ ADD_ROUND_KEY_8;
+ MAKEWORD(0);
+ MAKEWORD(1);
+ MAKEWORD(2);
+ MAKEWORD(3);
+ MAKEWORD(4);
+ MAKEWORD(5);
+ MAKEWORD(6);
+ MAKEWORD(7);
+ MOVEWORD(0);
+ MOVEWORD(1);
+ MOVEWORD(2);
+ MOVEWORD(3);
+ MOVEWORD(4);
+ MOVEWORD(5);
+ MOVEWORD(6);
+ MOVEWORD(7);
+ }
+ ADD_ROUND_KEY_8;
+ LASTWORD(0);
+ LASTWORD(1);
+ LASTWORD(2);
+ LASTWORD(3);
+ LASTWORD(4);
+ LASTWORD(5);
+ LASTWORD(6);
+ LASTWORD(7);
+ MOVEWORD(0);
+ MOVEWORD(1);
+ MOVEWORD(2);
+ MOVEWORD(3);
+ MOVEWORD(4);
+ MOVEWORD(5);
+ MOVEWORD(6);
+ MOVEWORD(7);
+ ADD_ROUND_KEY_8;
+}
+#undef MAKEWORD
+#undef LASTWORD
+#define MAKEWORD(i) ( newstate[i] = (D0[(block[i] >> 24) & 0xFF] ^ \
+ D1[(block[(i+C1)%Nb] >> 16) & 0xFF] ^ \
+ D2[(block[(i+C2)%Nb] >> 8) & 0xFF] ^ \
+ D3[block[(i+C3)%Nb] & 0xFF]) )
+#define LASTWORD(i) (newstate[i] = (Sboxinv[(block[i] >> 24) & 0xFF] << 24) | \
+ (Sboxinv[(block[(i+C1)%Nb] >> 16) & 0xFF] << 16) | \
+ (Sboxinv[(block[(i+C2)%Nb] >> 8) & 0xFF] << 8) | \
+ (Sboxinv[(block[(i+C3)%Nb] ) & 0xFF] ) )
+static void aes_decrypt_nb_4(AESContext * ctx, unsigned int * block)
+{
+ int i;
+ static const int C1 = 4 - 1, C2 = 4 - 2, C3 = 4 - 3, Nb = 4;
+ unsigned int *keysched = ctx->invkeysched;
+ unsigned int newstate[4];
+ for (i = 0; i < ctx->Nr - 1; i++) {
+ ADD_ROUND_KEY_4;
+ MAKEWORD(0);
+ MAKEWORD(1);
+ MAKEWORD(2);
+ MAKEWORD(3);
+ MOVEWORD(0);
+ MOVEWORD(1);
+ MOVEWORD(2);
+ MOVEWORD(3);
+ }
+ ADD_ROUND_KEY_4;
+ LASTWORD(0);
+ LASTWORD(1);
+ LASTWORD(2);
+ LASTWORD(3);
+ MOVEWORD(0);
+ MOVEWORD(1);
+ MOVEWORD(2);
+ MOVEWORD(3);
+ ADD_ROUND_KEY_4;
+}
+static void aes_decrypt_nb_6(AESContext * ctx, unsigned int * block)
+{
+ int i;
+ static const int C1 = 6 - 1, C2 = 6 - 2, C3 = 6 - 3, Nb = 6;
+ unsigned int *keysched = ctx->invkeysched;
+ unsigned int newstate[6];
+ for (i = 0; i < ctx->Nr - 1; i++) {
+ ADD_ROUND_KEY_6;
+ MAKEWORD(0);
+ MAKEWORD(1);
+ MAKEWORD(2);
+ MAKEWORD(3);
+ MAKEWORD(4);
+ MAKEWORD(5);
+ MOVEWORD(0);
+ MOVEWORD(1);
+ MOVEWORD(2);
+ MOVEWORD(3);
+ MOVEWORD(4);
+ MOVEWORD(5);
+ }
+ ADD_ROUND_KEY_6;
+ LASTWORD(0);
+ LASTWORD(1);
+ LASTWORD(2);
+ LASTWORD(3);
+ LASTWORD(4);
+ LASTWORD(5);
+ MOVEWORD(0);
+ MOVEWORD(1);
+ MOVEWORD(2);
+ MOVEWORD(3);
+ MOVEWORD(4);
+ MOVEWORD(5);
+ ADD_ROUND_KEY_6;
+}
+static void aes_decrypt_nb_8(AESContext * ctx, unsigned int * block)
+{
+ int i;
+ static const int C1 = 8 - 1, C2 = 8 - 3, C3 = 8 - 4, Nb = 8;
+ unsigned int *keysched = ctx->invkeysched;
+ unsigned int newstate[8];
+ for (i = 0; i < ctx->Nr - 1; i++) {
+ ADD_ROUND_KEY_8;
+ MAKEWORD(0);
+ MAKEWORD(1);
+ MAKEWORD(2);
+ MAKEWORD(3);
+ MAKEWORD(4);
+ MAKEWORD(5);
+ MAKEWORD(6);
+ MAKEWORD(7);
+ MOVEWORD(0);
+ MOVEWORD(1);
+ MOVEWORD(2);
+ MOVEWORD(3);
+ MOVEWORD(4);
+ MOVEWORD(5);
+ MOVEWORD(6);
+ MOVEWORD(7);
+ }
+ ADD_ROUND_KEY_8;
+ LASTWORD(0);
+ LASTWORD(1);
+ LASTWORD(2);
+ LASTWORD(3);
+ LASTWORD(4);
+ LASTWORD(5);
+ LASTWORD(6);
+ LASTWORD(7);
+ MOVEWORD(0);
+ MOVEWORD(1);
+ MOVEWORD(2);
+ MOVEWORD(3);
+ MOVEWORD(4);
+ MOVEWORD(5);
+ MOVEWORD(6);
+ MOVEWORD(7);
+ ADD_ROUND_KEY_8;
+}
+#undef MAKEWORD
+#undef LASTWORD
+static void aes_setup(AESContext * ctx, int blocklen,
+ const unsigned char *key, int keylen)
+{
+ int i, j, Nk, rconst;
+ ASSERT(blocklen == 16 || blocklen == 24 || blocklen == 32);
+ ASSERT(keylen == 16 || keylen == 24 || keylen == 32);
+ Nk = keylen / 4;
+ ctx->Nb = blocklen / 4;
+ ctx->Nr = 6 + (ctx->Nb > Nk ? ctx->Nb : Nk);
+ if (ctx->Nb == 8) {
+ ctx->encrypt = aes_encrypt_nb_8, ctx->decrypt = aes_decrypt_nb_8;
+ } else if (ctx->Nb == 6) {
+ ctx->encrypt = aes_encrypt_nb_6, ctx->decrypt = aes_decrypt_nb_6;
+ } else if (ctx->Nb == 4) {
+ ctx->encrypt = aes_encrypt_nb_4, ctx->decrypt = aes_decrypt_nb_4;
+ }
+ rconst = 1;
+ for (i = 0; i < (ctx->Nr + 1) * ctx->Nb; i++) {
+ if (i < Nk) {
+ ctx->keysched[i] = GET_32BIT_MSB_FIRST(key + 4 * i);
+ } else {
+ unsigned int temp = ctx->keysched[i - 1];
+ if (i % Nk == 0) {
+ int a, b, c, d;
+ a = (temp >> 16) & 0xFF;
+ b = (temp >> 8) & 0xFF;
+ c = (temp >> 0) & 0xFF;
+ d = (temp >> 24) & 0xFF;
+ temp = Sbox[a] ^ rconst;
+ temp = (temp << 8) | Sbox[b];
+ temp = (temp << 8) | Sbox[c];
+ temp = (temp << 8) | Sbox[d];
+ rconst = mulby2(rconst);
+ } else if (i % Nk == 4 && Nk > 6) {
+ int a, b, c, d;
+ a = (temp >> 24) & 0xFF;
+ b = (temp >> 16) & 0xFF;
+ c = (temp >> 8) & 0xFF;
+ d = (temp >> 0) & 0xFF;
+ temp = Sbox[a];
+ temp = (temp << 8) | Sbox[b];
+ temp = (temp << 8) | Sbox[c];
+ temp = (temp << 8) | Sbox[d];
+ }
+ ctx->keysched[i] = ctx->keysched[i - Nk] ^ temp;
+ }
+ }
+ for (i = 0; i <= ctx->Nr; i++) {
+ for (j = 0; j < ctx->Nb; j++) {
+ unsigned int temp;
+ temp = ctx->keysched[(ctx->Nr - i) * ctx->Nb + j];
+ if (i != 0 && i != ctx->Nr) {
+ int a, b, c, d;
+ a = (temp >> 24) & 0xFF;
+ b = (temp >> 16) & 0xFF;
+ c = (temp >> 8) & 0xFF;
+ d = (temp >> 0) & 0xFF;
+ temp = D0[Sbox[a]];
+ temp ^= D1[Sbox[b]];
+ temp ^= D2[Sbox[c]];
+ temp ^= D3[Sbox[d]];
+ }
+ ctx->invkeysched[i * ctx->Nb + j] = temp;
+ }
+ }
+}
+static void aes_decrypt(AESContext * ctx, unsigned int * block)
+{
+ ctx->decrypt(ctx, block);
+}
+static void aes_decrypt_cbc(unsigned char *dest, const unsigned char *src, int len, AESContext * ctx)
+{
+ unsigned int iv[4], x[4], ct[4];
+ int i;
+ ASSERT((len & 15) == 0);
+ FXSYS_memcpy32(iv, ctx->iv, sizeof(iv));
+ while (len > 0) {
+ for (i = 0; i < 4; i++) {
+ x[i] = ct[i] = GET_32BIT_MSB_FIRST(src + 4 * i);
+ }
+ aes_decrypt(ctx, x);
+ for (i = 0; i < 4; i++) {
+ PUT_32BIT_MSB_FIRST(dest + 4 * i, iv[i] ^ x[i]);
+ iv[i] = ct[i];
+ }
+ dest += 16;
+ src += 16;
+ len -= 16;
+ }
+ FXSYS_memcpy32(ctx->iv, iv, sizeof(iv));
+}
+static void aes_encrypt(AESContext * ctx, unsigned int * block)
+{
+ ctx->encrypt(ctx, block);
+}
+static void aes_encrypt_cbc(unsigned char *dest, const unsigned char *src, int len, AESContext * ctx)
+{
+ unsigned int iv[4];
+ int i;
+ ASSERT((len & 15) == 0);
+ FXSYS_memcpy32(iv, ctx->iv, sizeof(iv));
+ while (len > 0) {
+ for (i = 0; i < 4; i++) {
+ iv[i] ^= GET_32BIT_MSB_FIRST(src + 4 * i);
+ }
+ aes_encrypt(ctx, iv);
+ for (i = 0; i < 4; i++) {
+ PUT_32BIT_MSB_FIRST(dest + 4 * i, iv[i]);
+ }
+ dest += 16;
+ src += 16;
+ len -= 16;
+ }
+ FXSYS_memcpy32(ctx->iv, iv, sizeof(iv));
+}
+void CRYPT_AESSetKey(FX_LPVOID context, FX_DWORD blocklen, FX_LPCBYTE key, FX_DWORD keylen, FX_BOOL bEncrypt)
+{
+ aes_setup((AESContext*)context, blocklen, key, keylen);
+}
+void CRYPT_AESSetIV(FX_LPVOID context, FX_LPCBYTE iv)
+{
+ int i;
+ for (i = 0; i < ((AESContext*)context)->Nb; i++) {
+ ((AESContext*)context)->iv[i] = GET_32BIT_MSB_FIRST(iv + 4 * i);
+ }
+}
+void CRYPT_AESDecrypt(FX_LPVOID context, FX_LPBYTE dest, FX_LPCBYTE src, FX_DWORD len)
+{
+ aes_decrypt_cbc(dest, src, len, (AESContext*)context);
+}
+void CRYPT_AESEncrypt(FX_LPVOID context, FX_LPBYTE dest, FX_LPCBYTE src, FX_DWORD len)
+{
+ aes_encrypt_cbc(dest, src, len, (AESContext*)context);
+}
+#ifdef __cplusplus
+};
+#endif
diff --git a/core/src/fdrm/crypto/fx_crypt_sha.cpp b/core/src/fdrm/crypto/fx_crypt_sha.cpp
index acabcb7ba4..4e931b2d03 100644
--- a/core/src/fdrm/crypto/fx_crypt_sha.cpp
+++ b/core/src/fdrm/crypto/fx_crypt_sha.cpp
@@ -1,742 +1,742 @@
-// 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
-
-#include "../../../include/fxcrt/fx_basic.h"
-#include "../../../include/fdrm/fx_crypt.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
-typedef struct {
- unsigned int h[5];
- unsigned char block[64];
- int blkused;
- unsigned int lenhi, lenlo;
-} SHA_State;
-#define rol(x,y) ( ((x) << (y)) | (((unsigned int)x) >> (32-y)) )
-static void SHA_Core_Init(unsigned int h[5])
-{
- h[0] = 0x67452301;
- h[1] = 0xefcdab89;
- h[2] = 0x98badcfe;
- h[3] = 0x10325476;
- h[4] = 0xc3d2e1f0;
-}
-static void SHATransform(unsigned int * digest, unsigned int * block)
-{
- unsigned int w[80];
- unsigned int a, b, c, d, e;
- int t;
- for (t = 0; t < 16; t++) {
- w[t] = block[t];
- }
- for (t = 16; t < 80; t++) {
- unsigned int tmp = w[t - 3] ^ w[t - 8] ^ w[t - 14] ^ w[t - 16];
- w[t] = rol(tmp, 1);
- }
- a = digest[0];
- b = digest[1];
- c = digest[2];
- d = digest[3];
- e = digest[4];
- for (t = 0; t < 20; t++) {
- unsigned int tmp =
- rol(a, 5) + ((b & c) | (d & ~b)) + e + w[t] + 0x5a827999;
- e = d;
- d = c;
- c = rol(b, 30);
- b = a;
- a = tmp;
- }
- for (t = 20; t < 40; t++) {
- unsigned int tmp = rol(a, 5) + (b ^ c ^ d) + e + w[t] + 0x6ed9eba1;
- e = d;
- d = c;
- c = rol(b, 30);
- b = a;
- a = tmp;
- }
- for (t = 40; t < 60; t++) {
- unsigned int tmp = rol(a,
- 5) + ((b & c) | (b & d) | (c & d)) + e + w[t] +
- 0x8f1bbcdc;
- e = d;
- d = c;
- c = rol(b, 30);
- b = a;
- a = tmp;
- }
- for (t = 60; t < 80; t++) {
- unsigned int tmp = rol(a, 5) + (b ^ c ^ d) + e + w[t] + 0xca62c1d6;
- e = d;
- d = c;
- c = rol(b, 30);
- b = a;
- a = tmp;
- }
- digest[0] += a;
- digest[1] += b;
- digest[2] += c;
- digest[3] += d;
- digest[4] += e;
-}
-void CRYPT_SHA1Start(FX_LPVOID context)
-{
- SHA_State * s = (SHA_State*)context;
- SHA_Core_Init(s->h);
- s->blkused = 0;
- s->lenhi = s->lenlo = 0;
-}
-void CRYPT_SHA1Update(FX_LPVOID context, FX_LPCBYTE data, FX_DWORD size)
-{
- SHA_State * s = (SHA_State*)context;
- unsigned char *q = (unsigned char *)data;
- unsigned int wordblock[16];
- int len = size;
- unsigned int lenw = len;
- int i;
- s->lenlo += lenw;
- s->lenhi += (s->lenlo < lenw);
- if (s->blkused && s->blkused + len < 64) {
- FXSYS_memcpy32(s->block + s->blkused, q, len);
- s->blkused += len;
- } else {
- while (s->blkused + len >= 64) {
- FXSYS_memcpy32(s->block + s->blkused, q, 64 - s->blkused);
- q += 64 - s->blkused;
- len -= 64 - s->blkused;
- for (i = 0; i < 16; i++) {
- wordblock[i] =
- (((unsigned int) s->block[i * 4 + 0]) << 24) |
- (((unsigned int) s->block[i * 4 + 1]) << 16) |
- (((unsigned int) s->block[i * 4 + 2]) << 8) |
- (((unsigned int) s->block[i * 4 + 3]) << 0);
- }
- SHATransform(s->h, wordblock);
- s->blkused = 0;
- }
- FXSYS_memcpy32(s->block, q, len);
- s->blkused = len;
- }
-}
-void CRYPT_SHA1Finish(FX_LPVOID context, FX_BYTE digest[20])
-{
- SHA_State * s = (SHA_State*)context;
- int i;
- int pad;
- unsigned char c[64];
- unsigned int lenhi, lenlo;
- if (s->blkused >= 56) {
- pad = 56 + 64 - s->blkused;
- } else {
- pad = 56 - s->blkused;
- }
- lenhi = (s->lenhi << 3) | (s->lenlo >> (32 - 3));
- lenlo = (s->lenlo << 3);
- FXSYS_memset32(c, 0, pad);
- c[0] = 0x80;
- CRYPT_SHA1Update(s, c, pad);
- c[0] = (lenhi >> 24) & 0xFF;
- c[1] = (lenhi >> 16) & 0xFF;
- c[2] = (lenhi >> 8) & 0xFF;
- c[3] = (lenhi >> 0) & 0xFF;
- c[4] = (lenlo >> 24) & 0xFF;
- c[5] = (lenlo >> 16) & 0xFF;
- c[6] = (lenlo >> 8) & 0xFF;
- c[7] = (lenlo >> 0) & 0xFF;
- CRYPT_SHA1Update(s, c, 8);
- for (i = 0; i < 5; i++) {
- digest[i * 4] = (s->h[i] >> 24) & 0xFF;
- digest[i * 4 + 1] = (s->h[i] >> 16) & 0xFF;
- digest[i * 4 + 2] = (s->h[i] >> 8) & 0xFF;
- digest[i * 4 + 3] = (s->h[i]) & 0xFF;
- }
-}
-void CRYPT_SHA1Generate(FX_LPCBYTE data, FX_DWORD size, FX_BYTE digest[20])
-{
- SHA_State s;
- CRYPT_SHA1Start(&s);
- CRYPT_SHA1Update(&s, data, size);
- CRYPT_SHA1Finish(&s, digest);
-}
-typedef struct {
- FX_DWORD total[2];
- FX_DWORD state[8];
- FX_BYTE buffer[64];
-}
-sha256_context;
-#define GET_FX_DWORD(n,b,i) \
- { \
- (n) = ( (FX_DWORD) (b)[(i) ] << 24 ) \
- | ( (FX_DWORD) (b)[(i) + 1] << 16 ) \
- | ( (FX_DWORD) (b)[(i) + 2] << 8 ) \
- | ( (FX_DWORD) (b)[(i) + 3] ); \
- }
-#define PUT_FX_DWORD(n,b,i) \
- { \
- (b)[(i) ] = (FX_BYTE) ( (n) >> 24 ); \
- (b)[(i) + 1] = (FX_BYTE) ( (n) >> 16 ); \
- (b)[(i) + 2] = (FX_BYTE) ( (n) >> 8 ); \
- (b)[(i) + 3] = (FX_BYTE) ( (n) ); \
- }
-void CRYPT_SHA256Start( FX_LPVOID context )
-{
- sha256_context *ctx = (sha256_context *)context;
- ctx->total[0] = 0;
- ctx->total[1] = 0;
- ctx->state[0] = 0x6A09E667;
- ctx->state[1] = 0xBB67AE85;
- ctx->state[2] = 0x3C6EF372;
- ctx->state[3] = 0xA54FF53A;
- ctx->state[4] = 0x510E527F;
- ctx->state[5] = 0x9B05688C;
- ctx->state[6] = 0x1F83D9AB;
- ctx->state[7] = 0x5BE0CD19;
-}
-static void sha256_process( sha256_context *ctx, const FX_BYTE data[64] )
-{
- FX_DWORD temp1, temp2, W[64];
- FX_DWORD A, B, C, D, E, F, G, H;
- GET_FX_DWORD( W[0], data, 0 );
- GET_FX_DWORD( W[1], data, 4 );
- GET_FX_DWORD( W[2], data, 8 );
- GET_FX_DWORD( W[3], data, 12 );
- GET_FX_DWORD( W[4], data, 16 );
- GET_FX_DWORD( W[5], data, 20 );
- GET_FX_DWORD( W[6], data, 24 );
- GET_FX_DWORD( W[7], data, 28 );
- GET_FX_DWORD( W[8], data, 32 );
- GET_FX_DWORD( W[9], data, 36 );
- GET_FX_DWORD( W[10], data, 40 );
- GET_FX_DWORD( W[11], data, 44 );
- GET_FX_DWORD( W[12], data, 48 );
- GET_FX_DWORD( W[13], data, 52 );
- GET_FX_DWORD( W[14], data, 56 );
- GET_FX_DWORD( W[15], data, 60 );
-#define SHR(x,n) ((x & 0xFFFFFFFF) >> n)
-#define ROTR(x,n) (SHR(x,n) | (x << (32 - n)))
-#define S0(x) (ROTR(x, 7) ^ ROTR(x,18) ^ SHR(x, 3))
-#define S1(x) (ROTR(x,17) ^ ROTR(x,19) ^ SHR(x,10))
-#define S2(x) (ROTR(x, 2) ^ ROTR(x,13) ^ ROTR(x,22))
-#define S3(x) (ROTR(x, 6) ^ ROTR(x,11) ^ ROTR(x,25))
-#define F0(x,y,z) ((x & y) | (z & (x | y)))
-#define F1(x,y,z) (z ^ (x & (y ^ z)))
-#define R(t) \
- ( \
- W[t] = S1(W[t - 2]) + W[t - 7] + \
- S0(W[t - 15]) + W[t - 16] \
- )
-#define P(a,b,c,d,e,f,g,h,x,K) \
- { \
- temp1 = h + S3(e) + F1(e,f,g) + K + x; \
- temp2 = S2(a) + F0(a,b,c); \
- d += temp1; h = temp1 + temp2; \
- }
- A = ctx->state[0];
- B = ctx->state[1];
- C = ctx->state[2];
- D = ctx->state[3];
- E = ctx->state[4];
- F = ctx->state[5];
- G = ctx->state[6];
- H = ctx->state[7];
- P( A, B, C, D, E, F, G, H, W[ 0], 0x428A2F98 );
- P( H, A, B, C, D, E, F, G, W[ 1], 0x71374491 );
- P( G, H, A, B, C, D, E, F, W[ 2], 0xB5C0FBCF );
- P( F, G, H, A, B, C, D, E, W[ 3], 0xE9B5DBA5 );
- P( E, F, G, H, A, B, C, D, W[ 4], 0x3956C25B );
- P( D, E, F, G, H, A, B, C, W[ 5], 0x59F111F1 );
- P( C, D, E, F, G, H, A, B, W[ 6], 0x923F82A4 );
- P( B, C, D, E, F, G, H, A, W[ 7], 0xAB1C5ED5 );
- P( A, B, C, D, E, F, G, H, W[ 8], 0xD807AA98 );
- P( H, A, B, C, D, E, F, G, W[ 9], 0x12835B01 );
- P( G, H, A, B, C, D, E, F, W[10], 0x243185BE );
- P( F, G, H, A, B, C, D, E, W[11], 0x550C7DC3 );
- P( E, F, G, H, A, B, C, D, W[12], 0x72BE5D74 );
- P( D, E, F, G, H, A, B, C, W[13], 0x80DEB1FE );
- P( C, D, E, F, G, H, A, B, W[14], 0x9BDC06A7 );
- P( B, C, D, E, F, G, H, A, W[15], 0xC19BF174 );
- P( A, B, C, D, E, F, G, H, R(16), 0xE49B69C1 );
- P( H, A, B, C, D, E, F, G, R(17), 0xEFBE4786 );
- P( G, H, A, B, C, D, E, F, R(18), 0x0FC19DC6 );
- P( F, G, H, A, B, C, D, E, R(19), 0x240CA1CC );
- P( E, F, G, H, A, B, C, D, R(20), 0x2DE92C6F );
- P( D, E, F, G, H, A, B, C, R(21), 0x4A7484AA );
- P( C, D, E, F, G, H, A, B, R(22), 0x5CB0A9DC );
- P( B, C, D, E, F, G, H, A, R(23), 0x76F988DA );
- P( A, B, C, D, E, F, G, H, R(24), 0x983E5152 );
- P( H, A, B, C, D, E, F, G, R(25), 0xA831C66D );
- P( G, H, A, B, C, D, E, F, R(26), 0xB00327C8 );
- P( F, G, H, A, B, C, D, E, R(27), 0xBF597FC7 );
- P( E, F, G, H, A, B, C, D, R(28), 0xC6E00BF3 );
- P( D, E, F, G, H, A, B, C, R(29), 0xD5A79147 );
- P( C, D, E, F, G, H, A, B, R(30), 0x06CA6351 );
- P( B, C, D, E, F, G, H, A, R(31), 0x14292967 );
- P( A, B, C, D, E, F, G, H, R(32), 0x27B70A85 );
- P( H, A, B, C, D, E, F, G, R(33), 0x2E1B2138 );
- P( G, H, A, B, C, D, E, F, R(34), 0x4D2C6DFC );
- P( F, G, H, A, B, C, D, E, R(35), 0x53380D13 );
- P( E, F, G, H, A, B, C, D, R(36), 0x650A7354 );
- P( D, E, F, G, H, A, B, C, R(37), 0x766A0ABB );
- P( C, D, E, F, G, H, A, B, R(38), 0x81C2C92E );
- P( B, C, D, E, F, G, H, A, R(39), 0x92722C85 );
- P( A, B, C, D, E, F, G, H, R(40), 0xA2BFE8A1 );
- P( H, A, B, C, D, E, F, G, R(41), 0xA81A664B );
- P( G, H, A, B, C, D, E, F, R(42), 0xC24B8B70 );
- P( F, G, H, A, B, C, D, E, R(43), 0xC76C51A3 );
- P( E, F, G, H, A, B, C, D, R(44), 0xD192E819 );
- P( D, E, F, G, H, A, B, C, R(45), 0xD6990624 );
- P( C, D, E, F, G, H, A, B, R(46), 0xF40E3585 );
- P( B, C, D, E, F, G, H, A, R(47), 0x106AA070 );
- P( A, B, C, D, E, F, G, H, R(48), 0x19A4C116 );
- P( H, A, B, C, D, E, F, G, R(49), 0x1E376C08 );
- P( G, H, A, B, C, D, E, F, R(50), 0x2748774C );
- P( F, G, H, A, B, C, D, E, R(51), 0x34B0BCB5 );
- P( E, F, G, H, A, B, C, D, R(52), 0x391C0CB3 );
- P( D, E, F, G, H, A, B, C, R(53), 0x4ED8AA4A );
- P( C, D, E, F, G, H, A, B, R(54), 0x5B9CCA4F );
- P( B, C, D, E, F, G, H, A, R(55), 0x682E6FF3 );
- P( A, B, C, D, E, F, G, H, R(56), 0x748F82EE );
- P( H, A, B, C, D, E, F, G, R(57), 0x78A5636F );
- P( G, H, A, B, C, D, E, F, R(58), 0x84C87814 );
- P( F, G, H, A, B, C, D, E, R(59), 0x8CC70208 );
- P( E, F, G, H, A, B, C, D, R(60), 0x90BEFFFA );
- P( D, E, F, G, H, A, B, C, R(61), 0xA4506CEB );
- P( C, D, E, F, G, H, A, B, R(62), 0xBEF9A3F7 );
- P( B, C, D, E, F, G, H, A, R(63), 0xC67178F2 );
- ctx->state[0] += A;
- ctx->state[1] += B;
- ctx->state[2] += C;
- ctx->state[3] += D;
- ctx->state[4] += E;
- ctx->state[5] += F;
- ctx->state[6] += G;
- ctx->state[7] += H;
-}
-void CRYPT_SHA256Update( void* context, FX_LPCBYTE input, FX_DWORD length )
-{
- sha256_context *ctx = (sha256_context *)context;
- FX_DWORD left, fill;
- if( ! length ) {
- return;
- }
- left = ctx->total[0] & 0x3F;
- fill = 64 - left;
- ctx->total[0] += length;
- ctx->total[0] &= 0xFFFFFFFF;
- if( ctx->total[0] < length ) {
- ctx->total[1]++;
- }
- if( left && length >= fill ) {
- FXSYS_memcpy32( (void *) (ctx->buffer + left),
- (void *) input, fill );
- sha256_process( ctx, ctx->buffer );
- length -= fill;
- input += fill;
- left = 0;
- }
- while( length >= 64 ) {
- sha256_process( ctx, input );
- length -= 64;
- input += 64;
- }
- if( length ) {
- FXSYS_memcpy32( (void *) (ctx->buffer + left),
- (void *) input, length );
- }
-}
-static const FX_BYTE sha256_padding[64] = {
- 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-};
-void CRYPT_SHA256Finish( FX_LPVOID context, FX_BYTE digest[32] )
-{
- sha256_context *ctx = (sha256_context *)context;
- FX_DWORD last, padn;
- FX_DWORD high, low;
- FX_BYTE msglen[8];
- high = ( ctx->total[0] >> 29 )
- | ( ctx->total[1] << 3 );
- low = ( ctx->total[0] << 3 );
- PUT_FX_DWORD( high, msglen, 0 );
- PUT_FX_DWORD( low, msglen, 4 );
- last = ctx->total[0] & 0x3F;
- padn = ( last < 56 ) ? ( 56 - last ) : ( 120 - last );
- CRYPT_SHA256Update( ctx, sha256_padding, padn );
- CRYPT_SHA256Update( ctx, msglen, 8 );
- PUT_FX_DWORD( ctx->state[0], digest, 0 );
- PUT_FX_DWORD( ctx->state[1], digest, 4 );
- PUT_FX_DWORD( ctx->state[2], digest, 8 );
- PUT_FX_DWORD( ctx->state[3], digest, 12 );
- PUT_FX_DWORD( ctx->state[4], digest, 16 );
- PUT_FX_DWORD( ctx->state[5], digest, 20 );
- PUT_FX_DWORD( ctx->state[6], digest, 24 );
- PUT_FX_DWORD( ctx->state[7], digest, 28 );
-}
-void CRYPT_SHA256Generate(FX_LPCBYTE data, FX_DWORD size, FX_BYTE digest[32])
-{
- sha256_context ctx;
- CRYPT_SHA256Start(&ctx);
- CRYPT_SHA256Update(&ctx, data, size);
- CRYPT_SHA256Finish(&ctx, digest);
-}
-typedef struct {
- FX_UINT64 total[2];
- FX_UINT64 state[8];
- FX_BYTE buffer[128];
-} sha384_context;
-FX_UINT64 FX_ato64i(FX_LPCSTR str)
-{
- FXSYS_assert(str != NULL);
- FX_UINT64 ret = 0;
- int len = (int)FXSYS_strlen(str);
- len = len > 16 ? 16 : len;
- for (int i = 0; i < len; ++i) {
- if (i) {
- ret <<= 4;
- }
- if (str[i] >= '0' && str[i] <= '9') {
- ret |= (str[i] - '0') & 0xFF;
- } else if (str[i] >= 'a' && str[i] <= 'f') {
- ret |= (str[i] - 'a' + 10) & 0xFF;
- } else if (str[i] >= 'A' && str[i] <= 'F') {
- ret |= (str[i] - 'A' + 10) & 0xFF;
- } else {
- FXSYS_assert(FALSE);
- }
- }
- return ret;
-}
-void CRYPT_SHA384Start(FX_LPVOID context)
-{
- if (context == NULL) {
- return;
- }
- sha384_context *ctx = (sha384_context *)context;
- FXSYS_memset32(ctx, 0, sizeof(sha384_context));
- ctx->state[0] = FX_ato64i("cbbb9d5dc1059ed8");
- ctx->state[1] = FX_ato64i("629a292a367cd507");
- ctx->state[2] = FX_ato64i("9159015a3070dd17");
- ctx->state[3] = FX_ato64i("152fecd8f70e5939");
- ctx->state[4] = FX_ato64i("67332667ffc00b31");
- ctx->state[5] = FX_ato64i("8eb44a8768581511");
- ctx->state[6] = FX_ato64i("db0c2e0d64f98fa7");
- ctx->state[7] = FX_ato64i("47b5481dbefa4fa4");
-}
-#define SHA384_F0(x,y,z) ((x & y) | (z & (x | y)))
-#define SHA384_F1(x,y,z) (z ^ (x & (y ^ z)))
-#define SHA384_SHR(x,n) (x >> n)
-#define SHA384_ROTR(x,n) (SHA384_SHR(x, n) | x << (64 - n))
-#define SHA384_S0(x) (SHA384_ROTR(x, 1) ^ SHA384_ROTR(x, 8) ^ SHA384_SHR(x, 7))
-#define SHA384_S1(x) (SHA384_ROTR(x,19) ^ SHA384_ROTR(x, 61) ^ SHA384_SHR(x, 6))
-#define SHA384_S2(x) (SHA384_ROTR(x, 28) ^ SHA384_ROTR(x, 34) ^ SHA384_ROTR(x, 39))
-#define SHA384_S3(x) (SHA384_ROTR(x, 14) ^ SHA384_ROTR(x,18) ^ SHA384_ROTR(x, 41))
-#define SHA384_P(a,b,c,d,e,f,g,h,x,K) \
- { \
- temp1 = h + SHA384_S3(e) + SHA384_F1(e,f,g) + K + x; \
- temp2 = SHA384_S2(a) + SHA384_F0(a,b,c); \
- d += temp1; h = temp1 + temp2; \
- }
-static const FX_BYTE sha384_padding[128] = {
- 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-};
-#define SHA384_R(t) (W[t] = SHA384_S1(W[t - 2]) + W[t - 7] + SHA384_S0(W[t - 15]) + W[t - 16])
-static FX_LPCSTR constants[] = {
- "428a2f98d728ae22",
- "7137449123ef65cd",
- "b5c0fbcfec4d3b2f",
- "e9b5dba58189dbbc",
- "3956c25bf348b538",
- "59f111f1b605d019",
- "923f82a4af194f9b",
- "ab1c5ed5da6d8118",
- "d807aa98a3030242",
- "12835b0145706fbe",
- "243185be4ee4b28c",
- "550c7dc3d5ffb4e2",
- "72be5d74f27b896f",
- "80deb1fe3b1696b1",
- "9bdc06a725c71235",
- "c19bf174cf692694",
- "e49b69c19ef14ad2",
- "efbe4786384f25e3",
- "0fc19dc68b8cd5b5",
- "240ca1cc77ac9c65",
- "2de92c6f592b0275",
- "4a7484aa6ea6e483",
- "5cb0a9dcbd41fbd4",
- "76f988da831153b5",
- "983e5152ee66dfab",
- "a831c66d2db43210",
- "b00327c898fb213f",
- "bf597fc7beef0ee4",
- "c6e00bf33da88fc2",
- "d5a79147930aa725",
- "06ca6351e003826f",
- "142929670a0e6e70",
- "27b70a8546d22ffc",
- "2e1b21385c26c926",
- "4d2c6dfc5ac42aed",
- "53380d139d95b3df",
- "650a73548baf63de",
- "766a0abb3c77b2a8",
- "81c2c92e47edaee6",
- "92722c851482353b",
- "a2bfe8a14cf10364",
- "a81a664bbc423001",
- "c24b8b70d0f89791",
- "c76c51a30654be30",
- "d192e819d6ef5218",
- "d69906245565a910",
- "f40e35855771202a",
- "106aa07032bbd1b8",
- "19a4c116b8d2d0c8",
- "1e376c085141ab53",
- "2748774cdf8eeb99",
- "34b0bcb5e19b48a8",
- "391c0cb3c5c95a63",
- "4ed8aa4ae3418acb",
- "5b9cca4f7763e373",
- "682e6ff3d6b2b8a3",
- "748f82ee5defb2fc",
- "78a5636f43172f60",
- "84c87814a1f0ab72",
- "8cc702081a6439ec",
- "90befffa23631e28",
- "a4506cebde82bde9",
- "bef9a3f7b2c67915",
- "c67178f2e372532b",
- "ca273eceea26619c",
- "d186b8c721c0c207",
- "eada7dd6cde0eb1e",
- "f57d4f7fee6ed178",
- "06f067aa72176fba",
- "0a637dc5a2c898a6",
- "113f9804bef90dae",
- "1b710b35131c471b",
- "28db77f523047d84",
- "32caab7b40c72493",
- "3c9ebe0a15c9bebc",
- "431d67c49c100d4c",
- "4cc5d4becb3e42b6",
- "597f299cfc657e2a",
- "5fcb6fab3ad6faec",
- "6c44198c4a475817",
-};
-#define GET_FX_64WORD(n,b,i) \
- { \
- (n) = ( (FX_UINT64) (b)[(i) ] << 56 ) \
- | ( (FX_UINT64) (b)[(i) + 1] << 48 ) \
- | ( (FX_UINT64) (b)[(i) + 2] << 40 ) \
- | ( (FX_UINT64) (b)[(i) + 3] << 32 ) \
- | ( (FX_UINT64) (b)[(i) + 4] << 24 ) \
- | ( (FX_UINT64) (b)[(i) + 5] << 16 ) \
- | ( (FX_UINT64) (b)[(i) + 6] << 8 ) \
- | ( (FX_UINT64) (b)[(i) + 7] ); \
- }
-#define PUT_FX_64DWORD(n,b,i) \
- { \
- (b)[(i) ] = (FX_BYTE) ( (n) >> 56 ); \
- (b)[(i) + 1] = (FX_BYTE) ( (n) >> 48 ); \
- (b)[(i) + 2] = (FX_BYTE) ( (n) >> 40 ); \
- (b)[(i) + 3] = (FX_BYTE) ( (n) >> 32 ); \
- (b)[(i) + 4] = (FX_BYTE) ( (n) >> 24 ); \
- (b)[(i) + 5] = (FX_BYTE) ( (n) >> 16 ); \
- (b)[(i) + 6] = (FX_BYTE) ( (n) >> 8 ); \
- (b)[(i) + 7] = (FX_BYTE) ( (n) ); \
- }
-static void sha384_process( sha384_context *ctx, const FX_BYTE data[128] )
-{
- FX_UINT64 temp1, temp2;
- FX_UINT64 A, B, C, D, E, F, G, H;
- FX_UINT64 W[80];
- GET_FX_64WORD(W[0], data, 0);
- GET_FX_64WORD(W[1], data, 8);
- GET_FX_64WORD(W[2], data, 16);
- GET_FX_64WORD(W[3], data, 24);
- GET_FX_64WORD(W[4], data, 32);
- GET_FX_64WORD(W[5], data, 40);
- GET_FX_64WORD(W[6], data, 48);
- GET_FX_64WORD(W[7], data, 56);
- GET_FX_64WORD(W[8], data, 64);
- GET_FX_64WORD(W[9], data, 72);
- GET_FX_64WORD(W[10], data, 80);
- GET_FX_64WORD(W[11], data, 88);
- GET_FX_64WORD(W[12], data, 96);
- GET_FX_64WORD(W[13], data, 104);
- GET_FX_64WORD(W[14], data, 112);
- GET_FX_64WORD(W[15], data, 120);
- A = ctx->state[0];
- B = ctx->state[1];
- C = ctx->state[2];
- D = ctx->state[3];
- E = ctx->state[4];
- F = ctx->state[5];
- G = ctx->state[6];
- H = ctx->state[7];
- for (int i = 0; i < 10; ++i) {
- FX_UINT64 temp[8];
- if (i < 2) {
- temp[0] = W[i * 8];
- temp[1] = W[i * 8 + 1];
- temp[2] = W[i * 8 + 2];
- temp[3] = W[i * 8 + 3];
- temp[4] = W[i * 8 + 4];
- temp[5] = W[i * 8 + 5];
- temp[6] = W[i * 8 + 6];
- temp[7] = W[i * 8 + 7];
- } else {
- temp[0] = SHA384_R(i * 8);
- temp[1] = SHA384_R(i * 8 + 1);
- temp[2] = SHA384_R(i * 8 + 2);
- temp[3] = SHA384_R(i * 8 + 3);
- temp[4] = SHA384_R(i * 8 + 4);
- temp[5] = SHA384_R(i * 8 + 5);
- temp[6] = SHA384_R(i * 8 + 6);
- temp[7] = SHA384_R(i * 8 + 7);
- }
- SHA384_P( A, B, C, D, E, F, G, H, temp[ 0], FX_ato64i(constants[i * 8 ]) );
- SHA384_P( H, A, B, C, D, E, F, G, temp[ 1], FX_ato64i(constants[i * 8 + 1]) );
- SHA384_P( G, H, A, B, C, D, E, F, temp[ 2], FX_ato64i(constants[i * 8 + 2]) );
- SHA384_P( F, G, H, A, B, C, D, E, temp[ 3], FX_ato64i(constants[i * 8 + 3]) );
- SHA384_P( E, F, G, H, A, B, C, D, temp[ 4], FX_ato64i(constants[i * 8 + 4]) );
- SHA384_P( D, E, F, G, H, A, B, C, temp[ 5], FX_ato64i(constants[i * 8 + 5]) );
- SHA384_P( C, D, E, F, G, H, A, B, temp[ 6], FX_ato64i(constants[i * 8 + 6]) );
- SHA384_P( B, C, D, E, F, G, H, A, temp[ 7], FX_ato64i(constants[i * 8 + 7]) );
- }
- ctx->state[0] += A;
- ctx->state[1] += B;
- ctx->state[2] += C;
- ctx->state[3] += D;
- ctx->state[4] += E;
- ctx->state[5] += F;
- ctx->state[6] += G;
- ctx->state[7] += H;
-}
-void CRYPT_SHA384Update(FX_LPVOID context, FX_LPCBYTE input, FX_DWORD length)
-{
- sha384_context *ctx = (sha384_context *)context;
- FX_DWORD left, fill;
- if( ! length ) {
- return;
- }
- left = (FX_DWORD)ctx->total[0] & 0x7F;
- fill = 128 - left;
- ctx->total[0] += length;
- if( ctx->total[0] < length ) {
- ctx->total[1]++;
- }
- if( left && length >= fill ) {
- FXSYS_memcpy32( (void *) (ctx->buffer + left),
- (void *) input, fill );
- sha384_process( ctx, ctx->buffer );
- length -= fill;
- input += fill;
- left = 0;
- }
- while( length >= 128 ) {
- sha384_process( ctx, input );
- length -= 128;
- input += 128;
- }
- if( length ) {
- FXSYS_memcpy32( (void *) (ctx->buffer + left),
- (void *) input, length );
- }
-}
-void CRYPT_SHA384Finish(FX_LPVOID context, FX_BYTE digest[48])
-{
- sha384_context *ctx = (sha384_context *)context;
- FX_DWORD last, padn;
- FX_BYTE msglen[16];
- FXSYS_memset32(msglen, 0, 16);
- FX_UINT64 high, low;
- high = ( ctx->total[0] >> 29 )
- | ( ctx->total[1] << 3 );
- low = ( ctx->total[0] << 3 );
- PUT_FX_64DWORD( high, msglen, 0 );
- PUT_FX_64DWORD( low, msglen, 8 );
- last = (FX_DWORD)ctx->total[0] & 0x7F;
- padn = ( last < 112 ) ? ( 112 - last ) : ( 240 - last );
- CRYPT_SHA384Update( ctx, sha384_padding, padn );
- CRYPT_SHA384Update( ctx, msglen, 16 );
- PUT_FX_64DWORD(ctx->state[0], digest, 0);
- PUT_FX_64DWORD(ctx->state[1], digest, 8);
- PUT_FX_64DWORD(ctx->state[2], digest, 16);
- PUT_FX_64DWORD(ctx->state[3], digest, 24);
- PUT_FX_64DWORD(ctx->state[4], digest, 32);
- PUT_FX_64DWORD(ctx->state[5], digest, 40);
-}
-void CRYPT_SHA384Generate(FX_LPCBYTE data, FX_DWORD size, FX_BYTE digest[64])
-{
- sha384_context context;
- CRYPT_SHA384Start(&context);
- CRYPT_SHA384Update(&context, data, size);
- CRYPT_SHA384Finish(&context, digest);
-}
-void CRYPT_SHA512Start(FX_LPVOID context)
-{
- if (context == NULL) {
- return;
- }
- sha384_context *ctx = (sha384_context *)context;
- FXSYS_memset32(ctx, 0, sizeof(sha384_context));
- ctx->state[0] = FX_ato64i("6a09e667f3bcc908");
- ctx->state[1] = FX_ato64i("bb67ae8584caa73b");
- ctx->state[2] = FX_ato64i("3c6ef372fe94f82b");
- ctx->state[3] = FX_ato64i("a54ff53a5f1d36f1");
- ctx->state[4] = FX_ato64i("510e527fade682d1");
- ctx->state[5] = FX_ato64i("9b05688c2b3e6c1f");
- ctx->state[6] = FX_ato64i("1f83d9abfb41bd6b");
- ctx->state[7] = FX_ato64i("5be0cd19137e2179");
-}
-void CRYPT_SHA512Update(FX_LPVOID context, FX_LPCBYTE data, FX_DWORD size)
-{
- CRYPT_SHA384Update(context, data, size);
-}
-void CRYPT_SHA512Finish(FX_LPVOID context, FX_BYTE digest[64])
-{
- sha384_context *ctx = (sha384_context *)context;
- FX_DWORD last, padn;
- FX_BYTE msglen[16];
- FXSYS_memset32(msglen, 0, 16);
- FX_UINT64 high, low;
- high = ( ctx->total[0] >> 29 )
- | ( ctx->total[1] << 3 );
- low = ( ctx->total[0] << 3 );
- PUT_FX_64DWORD( high, msglen, 0 );
- PUT_FX_64DWORD( low, msglen, 8 );
- last = (FX_DWORD)ctx->total[0] & 0x7F;
- padn = ( last < 112 ) ? ( 112 - last ) : ( 240 - last );
- CRYPT_SHA512Update( ctx, sha384_padding, padn );
- CRYPT_SHA512Update( ctx, msglen, 16 );
- PUT_FX_64DWORD(ctx->state[0], digest, 0);
- PUT_FX_64DWORD(ctx->state[1], digest, 8);
- PUT_FX_64DWORD(ctx->state[2], digest, 16);
- PUT_FX_64DWORD(ctx->state[3], digest, 24);
- PUT_FX_64DWORD(ctx->state[4], digest, 32);
- PUT_FX_64DWORD(ctx->state[5], digest, 40);
- PUT_FX_64DWORD(ctx->state[6], digest, 48);
- PUT_FX_64DWORD(ctx->state[7], digest, 56);
-}
-void CRYPT_SHA512Generate(FX_LPCBYTE data, FX_DWORD size, FX_BYTE digest[64])
-{
- sha384_context context;
- CRYPT_SHA512Start(&context);
- CRYPT_SHA512Update(&context, data, size);
- CRYPT_SHA512Finish(&context, digest);
-}
-#ifdef __cplusplus
-};
-#endif
+// 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
+
+#include "../../../include/fxcrt/fx_basic.h"
+#include "../../../include/fdrm/fx_crypt.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+typedef struct {
+ unsigned int h[5];
+ unsigned char block[64];
+ int blkused;
+ unsigned int lenhi, lenlo;
+} SHA_State;
+#define rol(x,y) ( ((x) << (y)) | (((unsigned int)x) >> (32-y)) )
+static void SHA_Core_Init(unsigned int h[5])
+{
+ h[0] = 0x67452301;
+ h[1] = 0xefcdab89;
+ h[2] = 0x98badcfe;
+ h[3] = 0x10325476;
+ h[4] = 0xc3d2e1f0;
+}
+static void SHATransform(unsigned int * digest, unsigned int * block)
+{
+ unsigned int w[80];
+ unsigned int a, b, c, d, e;
+ int t;
+ for (t = 0; t < 16; t++) {
+ w[t] = block[t];
+ }
+ for (t = 16; t < 80; t++) {
+ unsigned int tmp = w[t - 3] ^ w[t - 8] ^ w[t - 14] ^ w[t - 16];
+ w[t] = rol(tmp, 1);
+ }
+ a = digest[0];
+ b = digest[1];
+ c = digest[2];
+ d = digest[3];
+ e = digest[4];
+ for (t = 0; t < 20; t++) {
+ unsigned int tmp =
+ rol(a, 5) + ((b & c) | (d & ~b)) + e + w[t] + 0x5a827999;
+ e = d;
+ d = c;
+ c = rol(b, 30);
+ b = a;
+ a = tmp;
+ }
+ for (t = 20; t < 40; t++) {
+ unsigned int tmp = rol(a, 5) + (b ^ c ^ d) + e + w[t] + 0x6ed9eba1;
+ e = d;
+ d = c;
+ c = rol(b, 30);
+ b = a;
+ a = tmp;
+ }
+ for (t = 40; t < 60; t++) {
+ unsigned int tmp = rol(a,
+ 5) + ((b & c) | (b & d) | (c & d)) + e + w[t] +
+ 0x8f1bbcdc;
+ e = d;
+ d = c;
+ c = rol(b, 30);
+ b = a;
+ a = tmp;
+ }
+ for (t = 60; t < 80; t++) {
+ unsigned int tmp = rol(a, 5) + (b ^ c ^ d) + e + w[t] + 0xca62c1d6;
+ e = d;
+ d = c;
+ c = rol(b, 30);
+ b = a;
+ a = tmp;
+ }
+ digest[0] += a;
+ digest[1] += b;
+ digest[2] += c;
+ digest[3] += d;
+ digest[4] += e;
+}
+void CRYPT_SHA1Start(FX_LPVOID context)
+{
+ SHA_State * s = (SHA_State*)context;
+ SHA_Core_Init(s->h);
+ s->blkused = 0;
+ s->lenhi = s->lenlo = 0;
+}
+void CRYPT_SHA1Update(FX_LPVOID context, FX_LPCBYTE data, FX_DWORD size)
+{
+ SHA_State * s = (SHA_State*)context;
+ unsigned char *q = (unsigned char *)data;
+ unsigned int wordblock[16];
+ int len = size;
+ unsigned int lenw = len;
+ int i;
+ s->lenlo += lenw;
+ s->lenhi += (s->lenlo < lenw);
+ if (s->blkused && s->blkused + len < 64) {
+ FXSYS_memcpy32(s->block + s->blkused, q, len);
+ s->blkused += len;
+ } else {
+ while (s->blkused + len >= 64) {
+ FXSYS_memcpy32(s->block + s->blkused, q, 64 - s->blkused);
+ q += 64 - s->blkused;
+ len -= 64 - s->blkused;
+ for (i = 0; i < 16; i++) {
+ wordblock[i] =
+ (((unsigned int) s->block[i * 4 + 0]) << 24) |
+ (((unsigned int) s->block[i * 4 + 1]) << 16) |
+ (((unsigned int) s->block[i * 4 + 2]) << 8) |
+ (((unsigned int) s->block[i * 4 + 3]) << 0);
+ }
+ SHATransform(s->h, wordblock);
+ s->blkused = 0;
+ }
+ FXSYS_memcpy32(s->block, q, len);
+ s->blkused = len;
+ }
+}
+void CRYPT_SHA1Finish(FX_LPVOID context, FX_BYTE digest[20])
+{
+ SHA_State * s = (SHA_State*)context;
+ int i;
+ int pad;
+ unsigned char c[64];
+ unsigned int lenhi, lenlo;
+ if (s->blkused >= 56) {
+ pad = 56 + 64 - s->blkused;
+ } else {
+ pad = 56 - s->blkused;
+ }
+ lenhi = (s->lenhi << 3) | (s->lenlo >> (32 - 3));
+ lenlo = (s->lenlo << 3);
+ FXSYS_memset32(c, 0, pad);
+ c[0] = 0x80;
+ CRYPT_SHA1Update(s, c, pad);
+ c[0] = (lenhi >> 24) & 0xFF;
+ c[1] = (lenhi >> 16) & 0xFF;
+ c[2] = (lenhi >> 8) & 0xFF;
+ c[3] = (lenhi >> 0) & 0xFF;
+ c[4] = (lenlo >> 24) & 0xFF;
+ c[5] = (lenlo >> 16) & 0xFF;
+ c[6] = (lenlo >> 8) & 0xFF;
+ c[7] = (lenlo >> 0) & 0xFF;
+ CRYPT_SHA1Update(s, c, 8);
+ for (i = 0; i < 5; i++) {
+ digest[i * 4] = (s->h[i] >> 24) & 0xFF;
+ digest[i * 4 + 1] = (s->h[i] >> 16) & 0xFF;
+ digest[i * 4 + 2] = (s->h[i] >> 8) & 0xFF;
+ digest[i * 4 + 3] = (s->h[i]) & 0xFF;
+ }
+}
+void CRYPT_SHA1Generate(FX_LPCBYTE data, FX_DWORD size, FX_BYTE digest[20])
+{
+ SHA_State s;
+ CRYPT_SHA1Start(&s);
+ CRYPT_SHA1Update(&s, data, size);
+ CRYPT_SHA1Finish(&s, digest);
+}
+typedef struct {
+ FX_DWORD total[2];
+ FX_DWORD state[8];
+ FX_BYTE buffer[64];
+}
+sha256_context;
+#define GET_FX_DWORD(n,b,i) \
+ { \
+ (n) = ( (FX_DWORD) (b)[(i) ] << 24 ) \
+ | ( (FX_DWORD) (b)[(i) + 1] << 16 ) \
+ | ( (FX_DWORD) (b)[(i) + 2] << 8 ) \
+ | ( (FX_DWORD) (b)[(i) + 3] ); \
+ }
+#define PUT_FX_DWORD(n,b,i) \
+ { \
+ (b)[(i) ] = (FX_BYTE) ( (n) >> 24 ); \
+ (b)[(i) + 1] = (FX_BYTE) ( (n) >> 16 ); \
+ (b)[(i) + 2] = (FX_BYTE) ( (n) >> 8 ); \
+ (b)[(i) + 3] = (FX_BYTE) ( (n) ); \
+ }
+void CRYPT_SHA256Start( FX_LPVOID context )
+{
+ sha256_context *ctx = (sha256_context *)context;
+ ctx->total[0] = 0;
+ ctx->total[1] = 0;
+ ctx->state[0] = 0x6A09E667;
+ ctx->state[1] = 0xBB67AE85;
+ ctx->state[2] = 0x3C6EF372;
+ ctx->state[3] = 0xA54FF53A;
+ ctx->state[4] = 0x510E527F;
+ ctx->state[5] = 0x9B05688C;
+ ctx->state[6] = 0x1F83D9AB;
+ ctx->state[7] = 0x5BE0CD19;
+}
+static void sha256_process( sha256_context *ctx, const FX_BYTE data[64] )
+{
+ FX_DWORD temp1, temp2, W[64];
+ FX_DWORD A, B, C, D, E, F, G, H;
+ GET_FX_DWORD( W[0], data, 0 );
+ GET_FX_DWORD( W[1], data, 4 );
+ GET_FX_DWORD( W[2], data, 8 );
+ GET_FX_DWORD( W[3], data, 12 );
+ GET_FX_DWORD( W[4], data, 16 );
+ GET_FX_DWORD( W[5], data, 20 );
+ GET_FX_DWORD( W[6], data, 24 );
+ GET_FX_DWORD( W[7], data, 28 );
+ GET_FX_DWORD( W[8], data, 32 );
+ GET_FX_DWORD( W[9], data, 36 );
+ GET_FX_DWORD( W[10], data, 40 );
+ GET_FX_DWORD( W[11], data, 44 );
+ GET_FX_DWORD( W[12], data, 48 );
+ GET_FX_DWORD( W[13], data, 52 );
+ GET_FX_DWORD( W[14], data, 56 );
+ GET_FX_DWORD( W[15], data, 60 );
+#define SHR(x,n) ((x & 0xFFFFFFFF) >> n)
+#define ROTR(x,n) (SHR(x,n) | (x << (32 - n)))
+#define S0(x) (ROTR(x, 7) ^ ROTR(x,18) ^ SHR(x, 3))
+#define S1(x) (ROTR(x,17) ^ ROTR(x,19) ^ SHR(x,10))
+#define S2(x) (ROTR(x, 2) ^ ROTR(x,13) ^ ROTR(x,22))
+#define S3(x) (ROTR(x, 6) ^ ROTR(x,11) ^ ROTR(x,25))
+#define F0(x,y,z) ((x & y) | (z & (x | y)))
+#define F1(x,y,z) (z ^ (x & (y ^ z)))
+#define R(t) \
+ ( \
+ W[t] = S1(W[t - 2]) + W[t - 7] + \
+ S0(W[t - 15]) + W[t - 16] \
+ )
+#define P(a,b,c,d,e,f,g,h,x,K) \
+ { \
+ temp1 = h + S3(e) + F1(e,f,g) + K + x; \
+ temp2 = S2(a) + F0(a,b,c); \
+ d += temp1; h = temp1 + temp2; \
+ }
+ A = ctx->state[0];
+ B = ctx->state[1];
+ C = ctx->state[2];
+ D = ctx->state[3];
+ E = ctx->state[4];
+ F = ctx->state[5];
+ G = ctx->state[6];
+ H = ctx->state[7];
+ P( A, B, C, D, E, F, G, H, W[ 0], 0x428A2F98 );
+ P( H, A, B, C, D, E, F, G, W[ 1], 0x71374491 );
+ P( G, H, A, B, C, D, E, F, W[ 2], 0xB5C0FBCF );
+ P( F, G, H, A, B, C, D, E, W[ 3], 0xE9B5DBA5 );
+ P( E, F, G, H, A, B, C, D, W[ 4], 0x3956C25B );
+ P( D, E, F, G, H, A, B, C, W[ 5], 0x59F111F1 );
+ P( C, D, E, F, G, H, A, B, W[ 6], 0x923F82A4 );
+ P( B, C, D, E, F, G, H, A, W[ 7], 0xAB1C5ED5 );
+ P( A, B, C, D, E, F, G, H, W[ 8], 0xD807AA98 );
+ P( H, A, B, C, D, E, F, G, W[ 9], 0x12835B01 );
+ P( G, H, A, B, C, D, E, F, W[10], 0x243185BE );
+ P( F, G, H, A, B, C, D, E, W[11], 0x550C7DC3 );
+ P( E, F, G, H, A, B, C, D, W[12], 0x72BE5D74 );
+ P( D, E, F, G, H, A, B, C, W[13], 0x80DEB1FE );
+ P( C, D, E, F, G, H, A, B, W[14], 0x9BDC06A7 );
+ P( B, C, D, E, F, G, H, A, W[15], 0xC19BF174 );
+ P( A, B, C, D, E, F, G, H, R(16), 0xE49B69C1 );
+ P( H, A, B, C, D, E, F, G, R(17), 0xEFBE4786 );
+ P( G, H, A, B, C, D, E, F, R(18), 0x0FC19DC6 );
+ P( F, G, H, A, B, C, D, E, R(19), 0x240CA1CC );
+ P( E, F, G, H, A, B, C, D, R(20), 0x2DE92C6F );
+ P( D, E, F, G, H, A, B, C, R(21), 0x4A7484AA );
+ P( C, D, E, F, G, H, A, B, R(22), 0x5CB0A9DC );
+ P( B, C, D, E, F, G, H, A, R(23), 0x76F988DA );
+ P( A, B, C, D, E, F, G, H, R(24), 0x983E5152 );
+ P( H, A, B, C, D, E, F, G, R(25), 0xA831C66D );
+ P( G, H, A, B, C, D, E, F, R(26), 0xB00327C8 );
+ P( F, G, H, A, B, C, D, E, R(27), 0xBF597FC7 );
+ P( E, F, G, H, A, B, C, D, R(28), 0xC6E00BF3 );
+ P( D, E, F, G, H, A, B, C, R(29), 0xD5A79147 );
+ P( C, D, E, F, G, H, A, B, R(30), 0x06CA6351 );
+ P( B, C, D, E, F, G, H, A, R(31), 0x14292967 );
+ P( A, B, C, D, E, F, G, H, R(32), 0x27B70A85 );
+ P( H, A, B, C, D, E, F, G, R(33), 0x2E1B2138 );
+ P( G, H, A, B, C, D, E, F, R(34), 0x4D2C6DFC );
+ P( F, G, H, A, B, C, D, E, R(35), 0x53380D13 );
+ P( E, F, G, H, A, B, C, D, R(36), 0x650A7354 );
+ P( D, E, F, G, H, A, B, C, R(37), 0x766A0ABB );
+ P( C, D, E, F, G, H, A, B, R(38), 0x81C2C92E );
+ P( B, C, D, E, F, G, H, A, R(39), 0x92722C85 );
+ P( A, B, C, D, E, F, G, H, R(40), 0xA2BFE8A1 );
+ P( H, A, B, C, D, E, F, G, R(41), 0xA81A664B );
+ P( G, H, A, B, C, D, E, F, R(42), 0xC24B8B70 );
+ P( F, G, H, A, B, C, D, E, R(43), 0xC76C51A3 );
+ P( E, F, G, H, A, B, C, D, R(44), 0xD192E819 );
+ P( D, E, F, G, H, A, B, C, R(45), 0xD6990624 );
+ P( C, D, E, F, G, H, A, B, R(46), 0xF40E3585 );
+ P( B, C, D, E, F, G, H, A, R(47), 0x106AA070 );
+ P( A, B, C, D, E, F, G, H, R(48), 0x19A4C116 );
+ P( H, A, B, C, D, E, F, G, R(49), 0x1E376C08 );
+ P( G, H, A, B, C, D, E, F, R(50), 0x2748774C );
+ P( F, G, H, A, B, C, D, E, R(51), 0x34B0BCB5 );
+ P( E, F, G, H, A, B, C, D, R(52), 0x391C0CB3 );
+ P( D, E, F, G, H, A, B, C, R(53), 0x4ED8AA4A );
+ P( C, D, E, F, G, H, A, B, R(54), 0x5B9CCA4F );
+ P( B, C, D, E, F, G, H, A, R(55), 0x682E6FF3 );
+ P( A, B, C, D, E, F, G, H, R(56), 0x748F82EE );
+ P( H, A, B, C, D, E, F, G, R(57), 0x78A5636F );
+ P( G, H, A, B, C, D, E, F, R(58), 0x84C87814 );
+ P( F, G, H, A, B, C, D, E, R(59), 0x8CC70208 );
+ P( E, F, G, H, A, B, C, D, R(60), 0x90BEFFFA );
+ P( D, E, F, G, H, A, B, C, R(61), 0xA4506CEB );
+ P( C, D, E, F, G, H, A, B, R(62), 0xBEF9A3F7 );
+ P( B, C, D, E, F, G, H, A, R(63), 0xC67178F2 );
+ ctx->state[0] += A;
+ ctx->state[1] += B;
+ ctx->state[2] += C;
+ ctx->state[3] += D;
+ ctx->state[4] += E;
+ ctx->state[5] += F;
+ ctx->state[6] += G;
+ ctx->state[7] += H;
+}
+void CRYPT_SHA256Update( void* context, FX_LPCBYTE input, FX_DWORD length )
+{
+ sha256_context *ctx = (sha256_context *)context;
+ FX_DWORD left, fill;
+ if( ! length ) {
+ return;
+ }
+ left = ctx->total[0] & 0x3F;
+ fill = 64 - left;
+ ctx->total[0] += length;
+ ctx->total[0] &= 0xFFFFFFFF;
+ if( ctx->total[0] < length ) {
+ ctx->total[1]++;
+ }
+ if( left && length >= fill ) {
+ FXSYS_memcpy32( (void *) (ctx->buffer + left),
+ (void *) input, fill );
+ sha256_process( ctx, ctx->buffer );
+ length -= fill;
+ input += fill;
+ left = 0;
+ }
+ while( length >= 64 ) {
+ sha256_process( ctx, input );
+ length -= 64;
+ input += 64;
+ }
+ if( length ) {
+ FXSYS_memcpy32( (void *) (ctx->buffer + left),
+ (void *) input, length );
+ }
+}
+static const FX_BYTE sha256_padding[64] = {
+ 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+};
+void CRYPT_SHA256Finish( FX_LPVOID context, FX_BYTE digest[32] )
+{
+ sha256_context *ctx = (sha256_context *)context;
+ FX_DWORD last, padn;
+ FX_DWORD high, low;
+ FX_BYTE msglen[8];
+ high = ( ctx->total[0] >> 29 )
+ | ( ctx->total[1] << 3 );
+ low = ( ctx->total[0] << 3 );
+ PUT_FX_DWORD( high, msglen, 0 );
+ PUT_FX_DWORD( low, msglen, 4 );
+ last = ctx->total[0] & 0x3F;
+ padn = ( last < 56 ) ? ( 56 - last ) : ( 120 - last );
+ CRYPT_SHA256Update( ctx, sha256_padding, padn );
+ CRYPT_SHA256Update( ctx, msglen, 8 );
+ PUT_FX_DWORD( ctx->state[0], digest, 0 );
+ PUT_FX_DWORD( ctx->state[1], digest, 4 );
+ PUT_FX_DWORD( ctx->state[2], digest, 8 );
+ PUT_FX_DWORD( ctx->state[3], digest, 12 );
+ PUT_FX_DWORD( ctx->state[4], digest, 16 );
+ PUT_FX_DWORD( ctx->state[5], digest, 20 );
+ PUT_FX_DWORD( ctx->state[6], digest, 24 );
+ PUT_FX_DWORD( ctx->state[7], digest, 28 );
+}
+void CRYPT_SHA256Generate(FX_LPCBYTE data, FX_DWORD size, FX_BYTE digest[32])
+{
+ sha256_context ctx;
+ CRYPT_SHA256Start(&ctx);
+ CRYPT_SHA256Update(&ctx, data, size);
+ CRYPT_SHA256Finish(&ctx, digest);
+}
+typedef struct {
+ FX_UINT64 total[2];
+ FX_UINT64 state[8];
+ FX_BYTE buffer[128];
+} sha384_context;
+FX_UINT64 FX_ato64i(FX_LPCSTR str)
+{
+ FXSYS_assert(str != NULL);
+ FX_UINT64 ret = 0;
+ int len = (int)FXSYS_strlen(str);
+ len = len > 16 ? 16 : len;
+ for (int i = 0; i < len; ++i) {
+ if (i) {
+ ret <<= 4;
+ }
+ if (str[i] >= '0' && str[i] <= '9') {
+ ret |= (str[i] - '0') & 0xFF;
+ } else if (str[i] >= 'a' && str[i] <= 'f') {
+ ret |= (str[i] - 'a' + 10) & 0xFF;
+ } else if (str[i] >= 'A' && str[i] <= 'F') {
+ ret |= (str[i] - 'A' + 10) & 0xFF;
+ } else {
+ FXSYS_assert(FALSE);
+ }
+ }
+ return ret;
+}
+void CRYPT_SHA384Start(FX_LPVOID context)
+{
+ if (context == NULL) {
+ return;
+ }
+ sha384_context *ctx = (sha384_context *)context;
+ FXSYS_memset32(ctx, 0, sizeof(sha384_context));
+ ctx->state[0] = FX_ato64i("cbbb9d5dc1059ed8");
+ ctx->state[1] = FX_ato64i("629a292a367cd507");
+ ctx->state[2] = FX_ato64i("9159015a3070dd17");
+ ctx->state[3] = FX_ato64i("152fecd8f70e5939");
+ ctx->state[4] = FX_ato64i("67332667ffc00b31");
+ ctx->state[5] = FX_ato64i("8eb44a8768581511");
+ ctx->state[6] = FX_ato64i("db0c2e0d64f98fa7");
+ ctx->state[7] = FX_ato64i("47b5481dbefa4fa4");
+}
+#define SHA384_F0(x,y,z) ((x & y) | (z & (x | y)))
+#define SHA384_F1(x,y,z) (z ^ (x & (y ^ z)))
+#define SHA384_SHR(x,n) (x >> n)
+#define SHA384_ROTR(x,n) (SHA384_SHR(x, n) | x << (64 - n))
+#define SHA384_S0(x) (SHA384_ROTR(x, 1) ^ SHA384_ROTR(x, 8) ^ SHA384_SHR(x, 7))
+#define SHA384_S1(x) (SHA384_ROTR(x,19) ^ SHA384_ROTR(x, 61) ^ SHA384_SHR(x, 6))
+#define SHA384_S2(x) (SHA384_ROTR(x, 28) ^ SHA384_ROTR(x, 34) ^ SHA384_ROTR(x, 39))
+#define SHA384_S3(x) (SHA384_ROTR(x, 14) ^ SHA384_ROTR(x,18) ^ SHA384_ROTR(x, 41))
+#define SHA384_P(a,b,c,d,e,f,g,h,x,K) \
+ { \
+ temp1 = h + SHA384_S3(e) + SHA384_F1(e,f,g) + K + x; \
+ temp2 = SHA384_S2(a) + SHA384_F0(a,b,c); \
+ d += temp1; h = temp1 + temp2; \
+ }
+static const FX_BYTE sha384_padding[128] = {
+ 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+};
+#define SHA384_R(t) (W[t] = SHA384_S1(W[t - 2]) + W[t - 7] + SHA384_S0(W[t - 15]) + W[t - 16])
+static FX_LPCSTR constants[] = {
+ "428a2f98d728ae22",
+ "7137449123ef65cd",
+ "b5c0fbcfec4d3b2f",
+ "e9b5dba58189dbbc",
+ "3956c25bf348b538",
+ "59f111f1b605d019",
+ "923f82a4af194f9b",
+ "ab1c5ed5da6d8118",
+ "d807aa98a3030242",
+ "12835b0145706fbe",
+ "243185be4ee4b28c",
+ "550c7dc3d5ffb4e2",
+ "72be5d74f27b896f",
+ "80deb1fe3b1696b1",
+ "9bdc06a725c71235",
+ "c19bf174cf692694",
+ "e49b69c19ef14ad2",
+ "efbe4786384f25e3",
+ "0fc19dc68b8cd5b5",
+ "240ca1cc77ac9c65",
+ "2de92c6f592b0275",
+ "4a7484aa6ea6e483",
+ "5cb0a9dcbd41fbd4",
+ "76f988da831153b5",
+ "983e5152ee66dfab",
+ "a831c66d2db43210",
+ "b00327c898fb213f",
+ "bf597fc7beef0ee4",
+ "c6e00bf33da88fc2",
+ "d5a79147930aa725",
+ "06ca6351e003826f",
+ "142929670a0e6e70",
+ "27b70a8546d22ffc",
+ "2e1b21385c26c926",
+ "4d2c6dfc5ac42aed",
+ "53380d139d95b3df",
+ "650a73548baf63de",
+ "766a0abb3c77b2a8",
+ "81c2c92e47edaee6",
+ "92722c851482353b",
+ "a2bfe8a14cf10364",
+ "a81a664bbc423001",
+ "c24b8b70d0f89791",
+ "c76c51a30654be30",
+ "d192e819d6ef5218",
+ "d69906245565a910",
+ "f40e35855771202a",
+ "106aa07032bbd1b8",
+ "19a4c116b8d2d0c8",
+ "1e376c085141ab53",
+ "2748774cdf8eeb99",
+ "34b0bcb5e19b48a8",
+ "391c0cb3c5c95a63",
+ "4ed8aa4ae3418acb",
+ "5b9cca4f7763e373",
+ "682e6ff3d6b2b8a3",
+ "748f82ee5defb2fc",
+ "78a5636f43172f60",
+ "84c87814a1f0ab72",
+ "8cc702081a6439ec",
+ "90befffa23631e28",
+ "a4506cebde82bde9",
+ "bef9a3f7b2c67915",
+ "c67178f2e372532b",
+ "ca273eceea26619c",
+ "d186b8c721c0c207",
+ "eada7dd6cde0eb1e",
+ "f57d4f7fee6ed178",
+ "06f067aa72176fba",
+ "0a637dc5a2c898a6",
+ "113f9804bef90dae",
+ "1b710b35131c471b",
+ "28db77f523047d84",
+ "32caab7b40c72493",
+ "3c9ebe0a15c9bebc",
+ "431d67c49c100d4c",
+ "4cc5d4becb3e42b6",
+ "597f299cfc657e2a",
+ "5fcb6fab3ad6faec",
+ "6c44198c4a475817",
+};
+#define GET_FX_64WORD(n,b,i) \
+ { \
+ (n) = ( (FX_UINT64) (b)[(i) ] << 56 ) \
+ | ( (FX_UINT64) (b)[(i) + 1] << 48 ) \
+ | ( (FX_UINT64) (b)[(i) + 2] << 40 ) \
+ | ( (FX_UINT64) (b)[(i) + 3] << 32 ) \
+ | ( (FX_UINT64) (b)[(i) + 4] << 24 ) \
+ | ( (FX_UINT64) (b)[(i) + 5] << 16 ) \
+ | ( (FX_UINT64) (b)[(i) + 6] << 8 ) \
+ | ( (FX_UINT64) (b)[(i) + 7] ); \
+ }
+#define PUT_FX_64DWORD(n,b,i) \
+ { \
+ (b)[(i) ] = (FX_BYTE) ( (n) >> 56 ); \
+ (b)[(i) + 1] = (FX_BYTE) ( (n) >> 48 ); \
+ (b)[(i) + 2] = (FX_BYTE) ( (n) >> 40 ); \
+ (b)[(i) + 3] = (FX_BYTE) ( (n) >> 32 ); \
+ (b)[(i) + 4] = (FX_BYTE) ( (n) >> 24 ); \
+ (b)[(i) + 5] = (FX_BYTE) ( (n) >> 16 ); \
+ (b)[(i) + 6] = (FX_BYTE) ( (n) >> 8 ); \
+ (b)[(i) + 7] = (FX_BYTE) ( (n) ); \
+ }
+static void sha384_process( sha384_context *ctx, const FX_BYTE data[128] )
+{
+ FX_UINT64 temp1, temp2;
+ FX_UINT64 A, B, C, D, E, F, G, H;
+ FX_UINT64 W[80];
+ GET_FX_64WORD(W[0], data, 0);
+ GET_FX_64WORD(W[1], data, 8);
+ GET_FX_64WORD(W[2], data, 16);
+ GET_FX_64WORD(W[3], data, 24);
+ GET_FX_64WORD(W[4], data, 32);
+ GET_FX_64WORD(W[5], data, 40);
+ GET_FX_64WORD(W[6], data, 48);
+ GET_FX_64WORD(W[7], data, 56);
+ GET_FX_64WORD(W[8], data, 64);
+ GET_FX_64WORD(W[9], data, 72);
+ GET_FX_64WORD(W[10], data, 80);
+ GET_FX_64WORD(W[11], data, 88);
+ GET_FX_64WORD(W[12], data, 96);
+ GET_FX_64WORD(W[13], data, 104);
+ GET_FX_64WORD(W[14], data, 112);
+ GET_FX_64WORD(W[15], data, 120);
+ A = ctx->state[0];
+ B = ctx->state[1];
+ C = ctx->state[2];
+ D = ctx->state[3];
+ E = ctx->state[4];
+ F = ctx->state[5];
+ G = ctx->state[6];
+ H = ctx->state[7];
+ for (int i = 0; i < 10; ++i) {
+ FX_UINT64 temp[8];
+ if (i < 2) {
+ temp[0] = W[i * 8];
+ temp[1] = W[i * 8 + 1];
+ temp[2] = W[i * 8 + 2];
+ temp[3] = W[i * 8 + 3];
+ temp[4] = W[i * 8 + 4];
+ temp[5] = W[i * 8 + 5];
+ temp[6] = W[i * 8 + 6];
+ temp[7] = W[i * 8 + 7];
+ } else {
+ temp[0] = SHA384_R(i * 8);
+ temp[1] = SHA384_R(i * 8 + 1);
+ temp[2] = SHA384_R(i * 8 + 2);
+ temp[3] = SHA384_R(i * 8 + 3);
+ temp[4] = SHA384_R(i * 8 + 4);
+ temp[5] = SHA384_R(i * 8 + 5);
+ temp[6] = SHA384_R(i * 8 + 6);
+ temp[7] = SHA384_R(i * 8 + 7);
+ }
+ SHA384_P( A, B, C, D, E, F, G, H, temp[ 0], FX_ato64i(constants[i * 8 ]) );
+ SHA384_P( H, A, B, C, D, E, F, G, temp[ 1], FX_ato64i(constants[i * 8 + 1]) );
+ SHA384_P( G, H, A, B, C, D, E, F, temp[ 2], FX_ato64i(constants[i * 8 + 2]) );
+ SHA384_P( F, G, H, A, B, C, D, E, temp[ 3], FX_ato64i(constants[i * 8 + 3]) );
+ SHA384_P( E, F, G, H, A, B, C, D, temp[ 4], FX_ato64i(constants[i * 8 + 4]) );
+ SHA384_P( D, E, F, G, H, A, B, C, temp[ 5], FX_ato64i(constants[i * 8 + 5]) );
+ SHA384_P( C, D, E, F, G, H, A, B, temp[ 6], FX_ato64i(constants[i * 8 + 6]) );
+ SHA384_P( B, C, D, E, F, G, H, A, temp[ 7], FX_ato64i(constants[i * 8 + 7]) );
+ }
+ ctx->state[0] += A;
+ ctx->state[1] += B;
+ ctx->state[2] += C;
+ ctx->state[3] += D;
+ ctx->state[4] += E;
+ ctx->state[5] += F;
+ ctx->state[6] += G;
+ ctx->state[7] += H;
+}
+void CRYPT_SHA384Update(FX_LPVOID context, FX_LPCBYTE input, FX_DWORD length)
+{
+ sha384_context *ctx = (sha384_context *)context;
+ FX_DWORD left, fill;
+ if( ! length ) {
+ return;
+ }
+ left = (FX_DWORD)ctx->total[0] & 0x7F;
+ fill = 128 - left;
+ ctx->total[0] += length;
+ if( ctx->total[0] < length ) {
+ ctx->total[1]++;
+ }
+ if( left && length >= fill ) {
+ FXSYS_memcpy32( (void *) (ctx->buffer + left),
+ (void *) input, fill );
+ sha384_process( ctx, ctx->buffer );
+ length -= fill;
+ input += fill;
+ left = 0;
+ }
+ while( length >= 128 ) {
+ sha384_process( ctx, input );
+ length -= 128;
+ input += 128;
+ }
+ if( length ) {
+ FXSYS_memcpy32( (void *) (ctx->buffer + left),
+ (void *) input, length );
+ }
+}
+void CRYPT_SHA384Finish(FX_LPVOID context, FX_BYTE digest[48])
+{
+ sha384_context *ctx = (sha384_context *)context;
+ FX_DWORD last, padn;
+ FX_BYTE msglen[16];
+ FXSYS_memset32(msglen, 0, 16);
+ FX_UINT64 high, low;
+ high = ( ctx->total[0] >> 29 )
+ | ( ctx->total[1] << 3 );
+ low = ( ctx->total[0] << 3 );
+ PUT_FX_64DWORD( high, msglen, 0 );
+ PUT_FX_64DWORD( low, msglen, 8 );
+ last = (FX_DWORD)ctx->total[0] & 0x7F;
+ padn = ( last < 112 ) ? ( 112 - last ) : ( 240 - last );
+ CRYPT_SHA384Update( ctx, sha384_padding, padn );
+ CRYPT_SHA384Update( ctx, msglen, 16 );
+ PUT_FX_64DWORD(ctx->state[0], digest, 0);
+ PUT_FX_64DWORD(ctx->state[1], digest, 8);
+ PUT_FX_64DWORD(ctx->state[2], digest, 16);
+ PUT_FX_64DWORD(ctx->state[3], digest, 24);
+ PUT_FX_64DWORD(ctx->state[4], digest, 32);
+ PUT_FX_64DWORD(ctx->state[5], digest, 40);
+}
+void CRYPT_SHA384Generate(FX_LPCBYTE data, FX_DWORD size, FX_BYTE digest[64])
+{
+ sha384_context context;
+ CRYPT_SHA384Start(&context);
+ CRYPT_SHA384Update(&context, data, size);
+ CRYPT_SHA384Finish(&context, digest);
+}
+void CRYPT_SHA512Start(FX_LPVOID context)
+{
+ if (context == NULL) {
+ return;
+ }
+ sha384_context *ctx = (sha384_context *)context;
+ FXSYS_memset32(ctx, 0, sizeof(sha384_context));
+ ctx->state[0] = FX_ato64i("6a09e667f3bcc908");
+ ctx->state[1] = FX_ato64i("bb67ae8584caa73b");
+ ctx->state[2] = FX_ato64i("3c6ef372fe94f82b");
+ ctx->state[3] = FX_ato64i("a54ff53a5f1d36f1");
+ ctx->state[4] = FX_ato64i("510e527fade682d1");
+ ctx->state[5] = FX_ato64i("9b05688c2b3e6c1f");
+ ctx->state[6] = FX_ato64i("1f83d9abfb41bd6b");
+ ctx->state[7] = FX_ato64i("5be0cd19137e2179");
+}
+void CRYPT_SHA512Update(FX_LPVOID context, FX_LPCBYTE data, FX_DWORD size)
+{
+ CRYPT_SHA384Update(context, data, size);
+}
+void CRYPT_SHA512Finish(FX_LPVOID context, FX_BYTE digest[64])
+{
+ sha384_context *ctx = (sha384_context *)context;
+ FX_DWORD last, padn;
+ FX_BYTE msglen[16];
+ FXSYS_memset32(msglen, 0, 16);
+ FX_UINT64 high, low;
+ high = ( ctx->total[0] >> 29 )
+ | ( ctx->total[1] << 3 );
+ low = ( ctx->total[0] << 3 );
+ PUT_FX_64DWORD( high, msglen, 0 );
+ PUT_FX_64DWORD( low, msglen, 8 );
+ last = (FX_DWORD)ctx->total[0] & 0x7F;
+ padn = ( last < 112 ) ? ( 112 - last ) : ( 240 - last );
+ CRYPT_SHA512Update( ctx, sha384_padding, padn );
+ CRYPT_SHA512Update( ctx, msglen, 16 );
+ PUT_FX_64DWORD(ctx->state[0], digest, 0);
+ PUT_FX_64DWORD(ctx->state[1], digest, 8);
+ PUT_FX_64DWORD(ctx->state[2], digest, 16);
+ PUT_FX_64DWORD(ctx->state[3], digest, 24);
+ PUT_FX_64DWORD(ctx->state[4], digest, 32);
+ PUT_FX_64DWORD(ctx->state[5], digest, 40);
+ PUT_FX_64DWORD(ctx->state[6], digest, 48);
+ PUT_FX_64DWORD(ctx->state[7], digest, 56);
+}
+void CRYPT_SHA512Generate(FX_LPCBYTE data, FX_DWORD size, FX_BYTE digest[64])
+{
+ sha384_context context;
+ CRYPT_SHA512Start(&context);
+ CRYPT_SHA512Update(&context, data, size);
+ CRYPT_SHA512Finish(&context, digest);
+}
+#ifdef __cplusplus
+};
+#endif
diff --git a/core/src/fpdfapi/fpdf_basic_module.cpp b/core/src/fpdfapi/fpdf_basic_module.cpp
index 4c648b4d4e..a446aa5d21 100644
--- a/core/src/fpdfapi/fpdf_basic_module.cpp
+++ b/core/src/fpdfapi/fpdf_basic_module.cpp
@@ -1,178 +1,178 @@
-// 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
-
-#include "../../include/fxcodec/fx_codec.h"
-#include "../../include/fpdfapi/fpdf_module.h"
-static CPDF_ModuleMgr* g_FPDFAPI_pDefaultMgr = NULL;
-CPDF_ModuleMgr* CPDF_ModuleMgr::Get()
-{
- return g_FPDFAPI_pDefaultMgr;
-}
-void CPDF_ModuleMgr::Create()
-{
- g_FPDFAPI_pDefaultMgr = FX_NEW CPDF_ModuleMgr;
- g_FPDFAPI_pDefaultMgr->Initialize();
-}
-void CPDF_ModuleMgr::Destroy()
-{
- if (g_FPDFAPI_pDefaultMgr) {
- delete g_FPDFAPI_pDefaultMgr;
- }
- g_FPDFAPI_pDefaultMgr = NULL;
-}
-CPDF_ModuleMgr::CPDF_ModuleMgr()
-{
- m_pCodecModule = NULL;
- m_pPageModule = NULL;
- m_pRenderModule = NULL;
- m_FileBufSize = 512;
-}
-void CPDF_ModuleMgr::Initialize()
-{
- InitModules();
- m_FileBufSize = 512;
-}
-void CPDF_ModuleMgr::InitModules()
-{
- m_pCodecModule = NULL;
- m_pPageModule = FX_NEW CPDF_PageModuleDef;
- m_pRenderModule = FX_NEW CPDF_RenderModuleDef;
-}
-CPDF_ModuleMgr::~CPDF_ModuleMgr()
-{
- if (m_pPageModule) {
- delete m_pPageModule;
- }
- if (m_pRenderModule) {
- delete m_pRenderModule;
- }
-}
-void CPDF_ModuleMgr::SetDownloadCallback(FX_BOOL (*callback)(FX_LPCSTR module_name))
-{
- m_pDownloadCallback = callback;
-}
-FX_BOOL CPDF_ModuleMgr::DownloadModule(FX_LPCSTR module_name)
-{
- if (m_pDownloadCallback == NULL) {
- return FALSE;
- }
- return m_pDownloadCallback(module_name);
-}
-static CFX_ByteString _GetPath(const CFX_ByteString& folder, FX_LPCSTR name)
-{
- FX_STRSIZE folder_len = folder.GetLength();
-#if _FX_OS_ == _FX_SYMBIAN_ || _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
- if (folder[folder_len - 1] == '\\') {
- return folder + name;
- } else {
- return (folder + "\\") + name;
- }
-#else
- if (folder[folder_len - 1] == '/') {
- return folder + name;
- } else {
- return (folder + "/") + name;
- }
-#endif
-}
-void CPDF_ModuleMgr::SetModulePath(FX_LPCSTR module_name, FX_LPCSTR path)
-{
- if (module_name == NULL || module_name[0] == 0) {
- m_DefaultModulePath = path;
- } else {
- m_ModulePathList.SetAt(module_name, FX_NEW CFX_ByteString(path, -1));
- }
-}
-CFX_ByteString CPDF_ModuleMgr::GetModuleFilePath(FX_LPCSTR module_name, FX_LPCSTR name)
-{
- CFX_ByteString* pPath = NULL;
- if (m_ModulePathList.Lookup(module_name, (FX_LPVOID&)pPath)) {
- return _GetPath(*pPath, name);
- }
- if (!m_DefaultModulePath.IsEmpty()) {
- return _GetPath(m_DefaultModulePath, name);
- }
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
- FX_WCHAR app_path[260];
- ::GetModuleFileNameW(NULL, (LPWSTR)app_path, 260);
- FX_INTPTR len = FXSYS_wcslen(app_path);
- for (FX_INTPTR i = len; i >= 0; i --)
- if (app_path[i] == '\\') {
- app_path[i] = 0;
- break;
- }
- CFX_ByteString path = CFX_ByteString::FromUnicode(app_path);
- path += '\\';
- path += name;
- return path;
-#else
- return name;
-#endif
-}
-void CPDF_ModuleMgr::NotifyModuleAvailable(FX_LPCSTR module_name)
-{
- if (FXSYS_strcmp(module_name, ADDIN_NAME_CJK) == 0) {
- m_pPageModule->NotifyCJKAvailable();
- } else if (FXSYS_strcmp(module_name, ADDIN_NAME_DECODER) == 0) {
- m_pRenderModule->NotifyDecoderAvailable();
- }
-}
-void CPDF_ModuleMgr::RegisterSecurityHandler(FX_LPCSTR filter, CPDF_SecurityHandler * (*CreateHandler)(void* param), void* param)
-{
- if (CreateHandler == NULL) {
- m_SecurityHandlerMap.RemoveKey(filter);
- } else {
- m_SecurityHandlerMap.SetAt(filter, (void*)CreateHandler);
- }
- if (param) {
- m_SecurityHandlerMap.SetAt(FX_BSTRC("_param_") + filter, param);
- }
-}
-void CPDF_ModuleMgr::SetPrivateData(FX_LPVOID module_id, FX_LPVOID pData, PD_CALLBACK_FREEDATA callback)
-{
- m_privateData.SetPrivateData(module_id, pData, callback);
-}
-FX_LPVOID CPDF_ModuleMgr::GetPrivateData(FX_LPVOID module_id)
-{
- return m_privateData.GetPrivateData(module_id);
-}
-CPDF_SecurityHandler* CPDF_ModuleMgr::CreateSecurityHandler(FX_LPCSTR filter)
-{
- CPDF_SecurityHandler* (*CreateHandler)(void*) = NULL;
- if (!m_SecurityHandlerMap.Lookup(filter, (void*&)CreateHandler)) {
- return NULL;
- }
- if (CreateHandler == NULL) {
- return NULL;
- }
- void* param = NULL;
- m_SecurityHandlerMap.Lookup(FX_BSTRC("_param_") + filter, param);
- return CreateHandler(param);
-}
-ICodec_FaxModule* CPDF_ModuleMgr::GetFaxModule()
-{
- return m_pCodecModule ? m_pCodecModule->GetFaxModule() : NULL;
-}
-ICodec_JpegModule* CPDF_ModuleMgr::GetJpegModule()
-{
- return m_pCodecModule ? m_pCodecModule->GetJpegModule() : NULL;
-}
-ICodec_JpxModule* CPDF_ModuleMgr::GetJpxModule()
-{
- return m_pCodecModule ? m_pCodecModule->GetJpxModule() : NULL;
-}
-ICodec_Jbig2Module* CPDF_ModuleMgr::GetJbig2Module()
-{
- return m_pCodecModule ? m_pCodecModule->GetJbig2Module() : NULL;
-}
-ICodec_IccModule* CPDF_ModuleMgr::GetIccModule()
-{
- return m_pCodecModule ? m_pCodecModule->GetIccModule() : NULL;
-}
-ICodec_FlateModule* CPDF_ModuleMgr::GetFlateModule()
-{
- return m_pCodecModule ? m_pCodecModule->GetFlateModule() : NULL;
-}
+// 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
+
+#include "../../include/fxcodec/fx_codec.h"
+#include "../../include/fpdfapi/fpdf_module.h"
+static CPDF_ModuleMgr* g_FPDFAPI_pDefaultMgr = NULL;
+CPDF_ModuleMgr* CPDF_ModuleMgr::Get()
+{
+ return g_FPDFAPI_pDefaultMgr;
+}
+void CPDF_ModuleMgr::Create()
+{
+ g_FPDFAPI_pDefaultMgr = FX_NEW CPDF_ModuleMgr;
+ g_FPDFAPI_pDefaultMgr->Initialize();
+}
+void CPDF_ModuleMgr::Destroy()
+{
+ if (g_FPDFAPI_pDefaultMgr) {
+ delete g_FPDFAPI_pDefaultMgr;
+ }
+ g_FPDFAPI_pDefaultMgr = NULL;
+}
+CPDF_ModuleMgr::CPDF_ModuleMgr()
+{
+ m_pCodecModule = NULL;
+ m_pPageModule = NULL;
+ m_pRenderModule = NULL;
+ m_FileBufSize = 512;
+}
+void CPDF_ModuleMgr::Initialize()
+{
+ InitModules();
+ m_FileBufSize = 512;
+}
+void CPDF_ModuleMgr::InitModules()
+{
+ m_pCodecModule = NULL;
+ m_pPageModule = FX_NEW CPDF_PageModuleDef;
+ m_pRenderModule = FX_NEW CPDF_RenderModuleDef;
+}
+CPDF_ModuleMgr::~CPDF_ModuleMgr()
+{
+ if (m_pPageModule) {
+ delete m_pPageModule;
+ }
+ if (m_pRenderModule) {
+ delete m_pRenderModule;
+ }
+}
+void CPDF_ModuleMgr::SetDownloadCallback(FX_BOOL (*callback)(FX_LPCSTR module_name))
+{
+ m_pDownloadCallback = callback;
+}
+FX_BOOL CPDF_ModuleMgr::DownloadModule(FX_LPCSTR module_name)
+{
+ if (m_pDownloadCallback == NULL) {
+ return FALSE;
+ }
+ return m_pDownloadCallback(module_name);
+}
+static CFX_ByteString _GetPath(const CFX_ByteString& folder, FX_LPCSTR name)
+{
+ FX_STRSIZE folder_len = folder.GetLength();
+#if _FX_OS_ == _FX_SYMBIAN_ || _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
+ if (folder[folder_len - 1] == '\\') {
+ return folder + name;
+ } else {
+ return (folder + "\\") + name;
+ }
+#else
+ if (folder[folder_len - 1] == '/') {
+ return folder + name;
+ } else {
+ return (folder + "/") + name;
+ }
+#endif
+}
+void CPDF_ModuleMgr::SetModulePath(FX_LPCSTR module_name, FX_LPCSTR path)
+{
+ if (module_name == NULL || module_name[0] == 0) {
+ m_DefaultModulePath = path;
+ } else {
+ m_ModulePathList.SetAt(module_name, FX_NEW CFX_ByteString(path, -1));
+ }
+}
+CFX_ByteString CPDF_ModuleMgr::GetModuleFilePath(FX_LPCSTR module_name, FX_LPCSTR name)
+{
+ CFX_ByteString* pPath = NULL;
+ if (m_ModulePathList.Lookup(module_name, (FX_LPVOID&)pPath)) {
+ return _GetPath(*pPath, name);
+ }
+ if (!m_DefaultModulePath.IsEmpty()) {
+ return _GetPath(m_DefaultModulePath, name);
+ }
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
+ FX_WCHAR app_path[260];
+ ::GetModuleFileNameW(NULL, (LPWSTR)app_path, 260);
+ FX_INTPTR len = FXSYS_wcslen(app_path);
+ for (FX_INTPTR i = len; i >= 0; i --)
+ if (app_path[i] == '\\') {
+ app_path[i] = 0;
+ break;
+ }
+ CFX_ByteString path = CFX_ByteString::FromUnicode(app_path);
+ path += '\\';
+ path += name;
+ return path;
+#else
+ return name;
+#endif
+}
+void CPDF_ModuleMgr::NotifyModuleAvailable(FX_LPCSTR module_name)
+{
+ if (FXSYS_strcmp(module_name, ADDIN_NAME_CJK) == 0) {
+ m_pPageModule->NotifyCJKAvailable();
+ } else if (FXSYS_strcmp(module_name, ADDIN_NAME_DECODER) == 0) {
+ m_pRenderModule->NotifyDecoderAvailable();
+ }
+}
+void CPDF_ModuleMgr::RegisterSecurityHandler(FX_LPCSTR filter, CPDF_SecurityHandler * (*CreateHandler)(void* param), void* param)
+{
+ if (CreateHandler == NULL) {
+ m_SecurityHandlerMap.RemoveKey(filter);
+ } else {
+ m_SecurityHandlerMap.SetAt(filter, (void*)CreateHandler);
+ }
+ if (param) {
+ m_SecurityHandlerMap.SetAt(FX_BSTRC("_param_") + filter, param);
+ }
+}
+void CPDF_ModuleMgr::SetPrivateData(FX_LPVOID module_id, FX_LPVOID pData, PD_CALLBACK_FREEDATA callback)
+{
+ m_privateData.SetPrivateData(module_id, pData, callback);
+}
+FX_LPVOID CPDF_ModuleMgr::GetPrivateData(FX_LPVOID module_id)
+{
+ return m_privateData.GetPrivateData(module_id);
+}
+CPDF_SecurityHandler* CPDF_ModuleMgr::CreateSecurityHandler(FX_LPCSTR filter)
+{
+ CPDF_SecurityHandler* (*CreateHandler)(void*) = NULL;
+ if (!m_SecurityHandlerMap.Lookup(filter, (void*&)CreateHandler)) {
+ return NULL;
+ }
+ if (CreateHandler == NULL) {
+ return NULL;
+ }
+ void* param = NULL;
+ m_SecurityHandlerMap.Lookup(FX_BSTRC("_param_") + filter, param);
+ return CreateHandler(param);
+}
+ICodec_FaxModule* CPDF_ModuleMgr::GetFaxModule()
+{
+ return m_pCodecModule ? m_pCodecModule->GetFaxModule() : NULL;
+}
+ICodec_JpegModule* CPDF_ModuleMgr::GetJpegModule()
+{
+ return m_pCodecModule ? m_pCodecModule->GetJpegModule() : NULL;
+}
+ICodec_JpxModule* CPDF_ModuleMgr::GetJpxModule()
+{
+ return m_pCodecModule ? m_pCodecModule->GetJpxModule() : NULL;
+}
+ICodec_Jbig2Module* CPDF_ModuleMgr::GetJbig2Module()
+{
+ return m_pCodecModule ? m_pCodecModule->GetJbig2Module() : NULL;
+}
+ICodec_IccModule* CPDF_ModuleMgr::GetIccModule()
+{
+ return m_pCodecModule ? m_pCodecModule->GetIccModule() : NULL;
+}
+ICodec_FlateModule* CPDF_ModuleMgr::GetFlateModule()
+{
+ return m_pCodecModule ? m_pCodecModule->GetFlateModule() : NULL;
+}
diff --git a/core/src/fpdfapi/fpdf_cmaps/CNS1/B5pc-H_0.cpp b/core/src/fpdfapi/fpdf_cmaps/CNS1/B5pc-H_0.cpp
index e12a8597ed..d70e3611c3 100644
--- a/core/src/fpdfapi/fpdf_cmaps/CNS1/B5pc-H_0.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/CNS1/B5pc-H_0.cpp
@@ -1,91 +1,91 @@
-// 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
-
-extern const unsigned short g_FXCMAP_B5pc_H_0[247 * 3] = {
- 0x0020, 0x007E, 0x0001, 0x0080, 0x0080, 0x003D, 0x00FD, 0x00FF, 0x0060,
- 0xA140, 0xA158, 0x0063, 0xA159, 0xA15C, 0x35AF, 0xA15D, 0xA17E, 0x0080,
- 0xA1A1, 0xA1F5, 0x00A2, 0xA1F6, 0xA1F6, 0x00F8, 0xA1F7, 0xA1F7, 0x00F7,
- 0xA1F8, 0xA1FE, 0x00F9, 0xA240, 0xA27E, 0x0100, 0xA2A1, 0xA2FE, 0x013F,
- 0xA340, 0xA37E, 0x019D, 0xA3A1, 0xA3BB, 0x01DC, 0xA3BD, 0xA3BF, 0x01F7,
- 0xA3C0, 0xA3E0, 0x0232, 0xA440, 0xA47E, 0x0253, 0xA4A1, 0xA4FE, 0x0292,
- 0xA540, 0xA57E, 0x02F0, 0xA5A1, 0xA5FE, 0x032F, 0xA640, 0xA67E, 0x038D,
- 0xA6A1, 0xA6FE, 0x03CC, 0xA740, 0xA77E, 0x042A, 0xA7A1, 0xA7FE, 0x0469,
- 0xA840, 0xA87E, 0x04C7, 0xA8A1, 0xA8FE, 0x0506, 0xA940, 0xA97E, 0x0564,
- 0xA9A1, 0xA9FE, 0x05A3, 0xAA40, 0xAA7E, 0x0601, 0xAAA1, 0xAAFE, 0x0640,
- 0xAB40, 0xAB7E, 0x069E, 0xABA1, 0xABFE, 0x06DD, 0xAC40, 0xAC7E, 0x073B,
- 0xACA1, 0xACFD, 0x077A, 0xACFE, 0xACFE, 0x097F, 0xAD40, 0xAD7E, 0x07D7,
- 0xADA1, 0xADFE, 0x0816, 0xAE40, 0xAE7E, 0x0874, 0xAEA1, 0xAEFE, 0x08B3,
- 0xAF40, 0xAF7E, 0x0911, 0xAFA1, 0xAFCF, 0x0950, 0xAFD0, 0xAFFE, 0x0980,
- 0xB040, 0xB07E, 0x09AF, 0xB0A1, 0xB0FE, 0x09EE, 0xB140, 0xB17E, 0x0A4C,
- 0xB1A1, 0xB1FE, 0x0A8B, 0xB240, 0xB27E, 0x0AE9, 0xB2A1, 0xB2FE, 0x0B28,
- 0xB340, 0xB37E, 0x0B86, 0xB3A1, 0xB3FE, 0x0BC5, 0xB440, 0xB47E, 0x0C23,
- 0xB4A1, 0xB4FE, 0x0C62, 0xB540, 0xB57E, 0x0CC0, 0xB5A1, 0xB5FE, 0x0CFF,
- 0xB640, 0xB67E, 0x0D5D, 0xB6A1, 0xB6FE, 0x0D9C, 0xB740, 0xB77E, 0x0DFA,
- 0xB7A1, 0xB7FE, 0x0E39, 0xB840, 0xB87E, 0x0E97, 0xB8A1, 0xB8FE, 0x0ED6,
- 0xB940, 0xB97E, 0x0F34, 0xB9A1, 0xB9FE, 0x0F73, 0xBA40, 0xBA7E, 0x0FD1,
- 0xBAA1, 0xBAFE, 0x1010, 0xBB40, 0xBB7E, 0x106E, 0xBBA1, 0xBBC7, 0x10AD,
- 0xBBC8, 0xBBFE, 0x10D5, 0xBC40, 0xBC7E, 0x110C, 0xBCA1, 0xBCFE, 0x114B,
- 0xBD40, 0xBD7E, 0x11A9, 0xBDA1, 0xBDFE, 0x11E8, 0xBE40, 0xBE51, 0x1246,
- 0xBE52, 0xBE52, 0x10D4, 0xBE53, 0xBE7E, 0x1258, 0xBEA1, 0xBEFE, 0x1284,
- 0xBF40, 0xBF7E, 0x12E2, 0xBFA1, 0xBFFE, 0x1321, 0xC040, 0xC07E, 0x137F,
- 0xC0A1, 0xC0FE, 0x13BE, 0xC140, 0xC17E, 0x141C, 0xC1A1, 0xC1AA, 0x145B,
- 0xC1AB, 0xC1FE, 0x1466, 0xC240, 0xC27E, 0x14BA, 0xC2A1, 0xC2CA, 0x14F9,
- 0xC2CB, 0xC2CB, 0x1465, 0xC2CC, 0xC2FE, 0x1523, 0xC340, 0xC360, 0x1556,
- 0xC361, 0xC37E, 0x1578, 0xC3A1, 0xC3B8, 0x1596, 0xC3B9, 0xC3B9, 0x15AF,
- 0xC3BA, 0xC3BA, 0x15AE, 0xC3BB, 0xC3FE, 0x15B0, 0xC440, 0xC455, 0x15F4,
- 0xC456, 0xC456, 0x1577, 0xC457, 0xC47E, 0x160A, 0xC4A1, 0xC4FE, 0x1632,
- 0xC540, 0xC57E, 0x1690, 0xC5A1, 0xC5FE, 0x16CF, 0xC640, 0xC67E, 0x172D,
- 0xC940, 0xC949, 0x176C, 0xC94A, 0xC94A, 0x0274, 0xC94B, 0xC96B, 0x1776,
- 0xC96C, 0xC97E, 0x1798, 0xC9A1, 0xC9BD, 0x17AB, 0xC9BE, 0xC9BE, 0x1797,
- 0xC9BF, 0xC9EC, 0x17C8, 0xC9ED, 0xC9FE, 0x17F7, 0xCA40, 0xCA7E, 0x1809,
- 0xCAA1, 0xCAF6, 0x1848, 0xCAF7, 0xCAF7, 0x17F6, 0xCAF8, 0xCAFE, 0x189E,
- 0xCB40, 0xCB7E, 0x18A5, 0xCBA1, 0xCBFE, 0x18E4, 0xCC40, 0xCC7E, 0x1942,
- 0xCCA1, 0xCCFE, 0x1981, 0xCD40, 0xCD7E, 0x19DF, 0xCDA1, 0xCDFE, 0x1A1E,
- 0xCE40, 0xCE7E, 0x1A7C, 0xCEA1, 0xCEFE, 0x1ABB, 0xCF40, 0xCF7E, 0x1B19,
- 0xCFA1, 0xCFFE, 0x1B58, 0xD040, 0xD07E, 0x1BB6, 0xD0A1, 0xD0FE, 0x1BF5,
- 0xD140, 0xD17E, 0x1C53, 0xD1A1, 0xD1FE, 0x1C92, 0xD240, 0xD27E, 0x1CF0,
- 0xD2A1, 0xD2FE, 0x1D2F, 0xD340, 0xD37E, 0x1D8D, 0xD3A1, 0xD3FE, 0x1DCC,
- 0xD440, 0xD47E, 0x1E2A, 0xD4A1, 0xD4FE, 0x1E69, 0xD540, 0xD57E, 0x1EC7,
- 0xD5A1, 0xD5FE, 0x1F06, 0xD640, 0xD67E, 0x1F64, 0xD6A1, 0xD6CB, 0x1FA3,
- 0xD6CC, 0xD6CC, 0x2254, 0xD6CD, 0xD6FE, 0x1FCF, 0xD740, 0xD779, 0x2001,
- 0xD77A, 0xD77A, 0x22B9, 0xD77B, 0xD77E, 0x203B, 0xD7A1, 0xD7FE, 0x203F,
- 0xD840, 0xD87E, 0x209D, 0xD8A1, 0xD8FE, 0x20DC, 0xD940, 0xD97E, 0x213A,
- 0xD9A1, 0xD9FE, 0x2179, 0xDA40, 0xDA7E, 0x21D7, 0xDAA1, 0xDADE, 0x2216,
- 0xDADF, 0xDADF, 0x1FCE, 0xDAE0, 0xDAFE, 0x2255, 0xDB40, 0xDB7E, 0x2274,
- 0xDBA1, 0xDBA6, 0x22B3, 0xDBA7, 0xDBFE, 0x22BA, 0xDC40, 0xDC7E, 0x2312,
- 0xDCA1, 0xDCFE, 0x2351, 0xDD40, 0xDD7E, 0x23AF, 0xDDA1, 0xDDFB, 0x23EE,
- 0xDDFC, 0xDDFC, 0x2381, 0xDDFD, 0xDDFE, 0x2449, 0xDE40, 0xDE7E, 0x244B,
- 0xDEA1, 0xDEFE, 0x248A, 0xDF40, 0xDF7E, 0x24E8, 0xDFA1, 0xDFFE, 0x2527,
- 0xE040, 0xE07E, 0x2585, 0xE0A1, 0xE0FE, 0x25C4, 0xE140, 0xE17E, 0x2622,
- 0xE1A1, 0xE1FE, 0x2661, 0xE240, 0xE27E, 0x26BF, 0xE2A1, 0xE2FE, 0x26FE,
- 0xE340, 0xE37E, 0x275C, 0xE3A1, 0xE3FE, 0x279B, 0xE440, 0xE47E, 0x27F9,
- 0xE4A1, 0xE4FE, 0x2838, 0xE540, 0xE57E, 0x2896, 0xE5A1, 0xE5FE, 0x28D5,
- 0xE640, 0xE67E, 0x2933, 0xE6A1, 0xE6FE, 0x2972, 0xE740, 0xE77E, 0x29D0,
- 0xE7A1, 0xE7FE, 0x2A0F, 0xE840, 0xE87E, 0x2A6D, 0xE8A1, 0xE8A2, 0x2AAC,
- 0xE8A3, 0xE8FE, 0x2AAF, 0xE940, 0xE975, 0x2B0B, 0xE976, 0xE97E, 0x2B42,
- 0xE9A1, 0xE9FE, 0x2B4B, 0xEA40, 0xEA7E, 0x2BA9, 0xEAA1, 0xEAFE, 0x2BE8,
- 0xEB40, 0xEB5A, 0x2C46, 0xEB5B, 0xEB7E, 0x2C62, 0xEBA1, 0xEBF0, 0x2C86,
- 0xEBF1, 0xEBF1, 0x2AAE, 0xEBF2, 0xEBFE, 0x2CD6, 0xEC40, 0xEC7E, 0x2CE3,
- 0xECA1, 0xECDD, 0x2D22, 0xECDE, 0xECDE, 0x2B41, 0xECDF, 0xECFE, 0x2D5F,
- 0xED40, 0xED7E, 0x2D7F, 0xEDA1, 0xEDA9, 0x2DBE, 0xEDAA, 0xEDFE, 0x2DC8,
- 0xEE40, 0xEE7E, 0x2E1D, 0xEEA1, 0xEEEA, 0x2E5C, 0xEEEB, 0xEEEB, 0x3014,
- 0xEEEC, 0xEEFE, 0x2EA6, 0xEF40, 0xEF7E, 0x2EB9, 0xEFA1, 0xEFFE, 0x2EF8,
- 0xF040, 0xF055, 0x2F56, 0xF056, 0xF056, 0x2DC7, 0xF057, 0xF07E, 0x2F6C,
- 0xF0A1, 0xF0CA, 0x2F94, 0xF0CB, 0xF0CB, 0x2C61, 0xF0CC, 0xF0FE, 0x2FBE,
- 0xF140, 0xF162, 0x2FF1, 0xF163, 0xF16A, 0x3015, 0xF16B, 0xF16B, 0x3160,
- 0xF16C, 0xF17E, 0x301D, 0xF1A1, 0xF1FE, 0x3030, 0xF240, 0xF267, 0x308E,
- 0xF268, 0xF268, 0x31EF, 0xF269, 0xF27E, 0x30B6, 0xF2A1, 0xF2C2, 0x30CC,
- 0xF2C3, 0xF2FE, 0x30EF, 0xF340, 0xF374, 0x312B, 0xF375, 0xF37E, 0x3161,
- 0xF3A1, 0xF3FE, 0x316B, 0xF440, 0xF465, 0x31C9, 0xF466, 0xF47E, 0x31F0,
- 0xF4A1, 0xF4B4, 0x3209, 0xF4B5, 0xF4B5, 0x30EE, 0xF4B6, 0xF4FC, 0x321D,
- 0xF4FD, 0xF4FE, 0x3265, 0xF540, 0xF57E, 0x3267, 0xF5A1, 0xF5FE, 0x32A6,
- 0xF640, 0xF662, 0x3304, 0xF663, 0xF663, 0x3264, 0xF664, 0xF67E, 0x3327,
- 0xF6A1, 0xF6FE, 0x3342, 0xF740, 0xF77E, 0x33A0, 0xF7A1, 0xF7FE, 0x33DF,
- 0xF840, 0xF87E, 0x343D, 0xF8A1, 0xF8FE, 0x347C, 0xF940, 0xF976, 0x34DA,
- 0xF977, 0xF97E, 0x3512, 0xF9A1, 0xF9C3, 0x351A, 0xF9C4, 0xF9C4, 0x3511,
- 0xF9C5, 0xF9C5, 0x353D, 0xF9C6, 0xF9C6, 0x3549, 0xF9C7, 0xF9D1, 0x353E,
- 0xF9D2, 0xF9D5, 0x354A,
-};
+// 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
+
+extern const unsigned short g_FXCMAP_B5pc_H_0[247 * 3] = {
+ 0x0020, 0x007E, 0x0001, 0x0080, 0x0080, 0x003D, 0x00FD, 0x00FF, 0x0060,
+ 0xA140, 0xA158, 0x0063, 0xA159, 0xA15C, 0x35AF, 0xA15D, 0xA17E, 0x0080,
+ 0xA1A1, 0xA1F5, 0x00A2, 0xA1F6, 0xA1F6, 0x00F8, 0xA1F7, 0xA1F7, 0x00F7,
+ 0xA1F8, 0xA1FE, 0x00F9, 0xA240, 0xA27E, 0x0100, 0xA2A1, 0xA2FE, 0x013F,
+ 0xA340, 0xA37E, 0x019D, 0xA3A1, 0xA3BB, 0x01DC, 0xA3BD, 0xA3BF, 0x01F7,
+ 0xA3C0, 0xA3E0, 0x0232, 0xA440, 0xA47E, 0x0253, 0xA4A1, 0xA4FE, 0x0292,
+ 0xA540, 0xA57E, 0x02F0, 0xA5A1, 0xA5FE, 0x032F, 0xA640, 0xA67E, 0x038D,
+ 0xA6A1, 0xA6FE, 0x03CC, 0xA740, 0xA77E, 0x042A, 0xA7A1, 0xA7FE, 0x0469,
+ 0xA840, 0xA87E, 0x04C7, 0xA8A1, 0xA8FE, 0x0506, 0xA940, 0xA97E, 0x0564,
+ 0xA9A1, 0xA9FE, 0x05A3, 0xAA40, 0xAA7E, 0x0601, 0xAAA1, 0xAAFE, 0x0640,
+ 0xAB40, 0xAB7E, 0x069E, 0xABA1, 0xABFE, 0x06DD, 0xAC40, 0xAC7E, 0x073B,
+ 0xACA1, 0xACFD, 0x077A, 0xACFE, 0xACFE, 0x097F, 0xAD40, 0xAD7E, 0x07D7,
+ 0xADA1, 0xADFE, 0x0816, 0xAE40, 0xAE7E, 0x0874, 0xAEA1, 0xAEFE, 0x08B3,
+ 0xAF40, 0xAF7E, 0x0911, 0xAFA1, 0xAFCF, 0x0950, 0xAFD0, 0xAFFE, 0x0980,
+ 0xB040, 0xB07E, 0x09AF, 0xB0A1, 0xB0FE, 0x09EE, 0xB140, 0xB17E, 0x0A4C,
+ 0xB1A1, 0xB1FE, 0x0A8B, 0xB240, 0xB27E, 0x0AE9, 0xB2A1, 0xB2FE, 0x0B28,
+ 0xB340, 0xB37E, 0x0B86, 0xB3A1, 0xB3FE, 0x0BC5, 0xB440, 0xB47E, 0x0C23,
+ 0xB4A1, 0xB4FE, 0x0C62, 0xB540, 0xB57E, 0x0CC0, 0xB5A1, 0xB5FE, 0x0CFF,
+ 0xB640, 0xB67E, 0x0D5D, 0xB6A1, 0xB6FE, 0x0D9C, 0xB740, 0xB77E, 0x0DFA,
+ 0xB7A1, 0xB7FE, 0x0E39, 0xB840, 0xB87E, 0x0E97, 0xB8A1, 0xB8FE, 0x0ED6,
+ 0xB940, 0xB97E, 0x0F34, 0xB9A1, 0xB9FE, 0x0F73, 0xBA40, 0xBA7E, 0x0FD1,
+ 0xBAA1, 0xBAFE, 0x1010, 0xBB40, 0xBB7E, 0x106E, 0xBBA1, 0xBBC7, 0x10AD,
+ 0xBBC8, 0xBBFE, 0x10D5, 0xBC40, 0xBC7E, 0x110C, 0xBCA1, 0xBCFE, 0x114B,
+ 0xBD40, 0xBD7E, 0x11A9, 0xBDA1, 0xBDFE, 0x11E8, 0xBE40, 0xBE51, 0x1246,
+ 0xBE52, 0xBE52, 0x10D4, 0xBE53, 0xBE7E, 0x1258, 0xBEA1, 0xBEFE, 0x1284,
+ 0xBF40, 0xBF7E, 0x12E2, 0xBFA1, 0xBFFE, 0x1321, 0xC040, 0xC07E, 0x137F,
+ 0xC0A1, 0xC0FE, 0x13BE, 0xC140, 0xC17E, 0x141C, 0xC1A1, 0xC1AA, 0x145B,
+ 0xC1AB, 0xC1FE, 0x1466, 0xC240, 0xC27E, 0x14BA, 0xC2A1, 0xC2CA, 0x14F9,
+ 0xC2CB, 0xC2CB, 0x1465, 0xC2CC, 0xC2FE, 0x1523, 0xC340, 0xC360, 0x1556,
+ 0xC361, 0xC37E, 0x1578, 0xC3A1, 0xC3B8, 0x1596, 0xC3B9, 0xC3B9, 0x15AF,
+ 0xC3BA, 0xC3BA, 0x15AE, 0xC3BB, 0xC3FE, 0x15B0, 0xC440, 0xC455, 0x15F4,
+ 0xC456, 0xC456, 0x1577, 0xC457, 0xC47E, 0x160A, 0xC4A1, 0xC4FE, 0x1632,
+ 0xC540, 0xC57E, 0x1690, 0xC5A1, 0xC5FE, 0x16CF, 0xC640, 0xC67E, 0x172D,
+ 0xC940, 0xC949, 0x176C, 0xC94A, 0xC94A, 0x0274, 0xC94B, 0xC96B, 0x1776,
+ 0xC96C, 0xC97E, 0x1798, 0xC9A1, 0xC9BD, 0x17AB, 0xC9BE, 0xC9BE, 0x1797,
+ 0xC9BF, 0xC9EC, 0x17C8, 0xC9ED, 0xC9FE, 0x17F7, 0xCA40, 0xCA7E, 0x1809,
+ 0xCAA1, 0xCAF6, 0x1848, 0xCAF7, 0xCAF7, 0x17F6, 0xCAF8, 0xCAFE, 0x189E,
+ 0xCB40, 0xCB7E, 0x18A5, 0xCBA1, 0xCBFE, 0x18E4, 0xCC40, 0xCC7E, 0x1942,
+ 0xCCA1, 0xCCFE, 0x1981, 0xCD40, 0xCD7E, 0x19DF, 0xCDA1, 0xCDFE, 0x1A1E,
+ 0xCE40, 0xCE7E, 0x1A7C, 0xCEA1, 0xCEFE, 0x1ABB, 0xCF40, 0xCF7E, 0x1B19,
+ 0xCFA1, 0xCFFE, 0x1B58, 0xD040, 0xD07E, 0x1BB6, 0xD0A1, 0xD0FE, 0x1BF5,
+ 0xD140, 0xD17E, 0x1C53, 0xD1A1, 0xD1FE, 0x1C92, 0xD240, 0xD27E, 0x1CF0,
+ 0xD2A1, 0xD2FE, 0x1D2F, 0xD340, 0xD37E, 0x1D8D, 0xD3A1, 0xD3FE, 0x1DCC,
+ 0xD440, 0xD47E, 0x1E2A, 0xD4A1, 0xD4FE, 0x1E69, 0xD540, 0xD57E, 0x1EC7,
+ 0xD5A1, 0xD5FE, 0x1F06, 0xD640, 0xD67E, 0x1F64, 0xD6A1, 0xD6CB, 0x1FA3,
+ 0xD6CC, 0xD6CC, 0x2254, 0xD6CD, 0xD6FE, 0x1FCF, 0xD740, 0xD779, 0x2001,
+ 0xD77A, 0xD77A, 0x22B9, 0xD77B, 0xD77E, 0x203B, 0xD7A1, 0xD7FE, 0x203F,
+ 0xD840, 0xD87E, 0x209D, 0xD8A1, 0xD8FE, 0x20DC, 0xD940, 0xD97E, 0x213A,
+ 0xD9A1, 0xD9FE, 0x2179, 0xDA40, 0xDA7E, 0x21D7, 0xDAA1, 0xDADE, 0x2216,
+ 0xDADF, 0xDADF, 0x1FCE, 0xDAE0, 0xDAFE, 0x2255, 0xDB40, 0xDB7E, 0x2274,
+ 0xDBA1, 0xDBA6, 0x22B3, 0xDBA7, 0xDBFE, 0x22BA, 0xDC40, 0xDC7E, 0x2312,
+ 0xDCA1, 0xDCFE, 0x2351, 0xDD40, 0xDD7E, 0x23AF, 0xDDA1, 0xDDFB, 0x23EE,
+ 0xDDFC, 0xDDFC, 0x2381, 0xDDFD, 0xDDFE, 0x2449, 0xDE40, 0xDE7E, 0x244B,
+ 0xDEA1, 0xDEFE, 0x248A, 0xDF40, 0xDF7E, 0x24E8, 0xDFA1, 0xDFFE, 0x2527,
+ 0xE040, 0xE07E, 0x2585, 0xE0A1, 0xE0FE, 0x25C4, 0xE140, 0xE17E, 0x2622,
+ 0xE1A1, 0xE1FE, 0x2661, 0xE240, 0xE27E, 0x26BF, 0xE2A1, 0xE2FE, 0x26FE,
+ 0xE340, 0xE37E, 0x275C, 0xE3A1, 0xE3FE, 0x279B, 0xE440, 0xE47E, 0x27F9,
+ 0xE4A1, 0xE4FE, 0x2838, 0xE540, 0xE57E, 0x2896, 0xE5A1, 0xE5FE, 0x28D5,
+ 0xE640, 0xE67E, 0x2933, 0xE6A1, 0xE6FE, 0x2972, 0xE740, 0xE77E, 0x29D0,
+ 0xE7A1, 0xE7FE, 0x2A0F, 0xE840, 0xE87E, 0x2A6D, 0xE8A1, 0xE8A2, 0x2AAC,
+ 0xE8A3, 0xE8FE, 0x2AAF, 0xE940, 0xE975, 0x2B0B, 0xE976, 0xE97E, 0x2B42,
+ 0xE9A1, 0xE9FE, 0x2B4B, 0xEA40, 0xEA7E, 0x2BA9, 0xEAA1, 0xEAFE, 0x2BE8,
+ 0xEB40, 0xEB5A, 0x2C46, 0xEB5B, 0xEB7E, 0x2C62, 0xEBA1, 0xEBF0, 0x2C86,
+ 0xEBF1, 0xEBF1, 0x2AAE, 0xEBF2, 0xEBFE, 0x2CD6, 0xEC40, 0xEC7E, 0x2CE3,
+ 0xECA1, 0xECDD, 0x2D22, 0xECDE, 0xECDE, 0x2B41, 0xECDF, 0xECFE, 0x2D5F,
+ 0xED40, 0xED7E, 0x2D7F, 0xEDA1, 0xEDA9, 0x2DBE, 0xEDAA, 0xEDFE, 0x2DC8,
+ 0xEE40, 0xEE7E, 0x2E1D, 0xEEA1, 0xEEEA, 0x2E5C, 0xEEEB, 0xEEEB, 0x3014,
+ 0xEEEC, 0xEEFE, 0x2EA6, 0xEF40, 0xEF7E, 0x2EB9, 0xEFA1, 0xEFFE, 0x2EF8,
+ 0xF040, 0xF055, 0x2F56, 0xF056, 0xF056, 0x2DC7, 0xF057, 0xF07E, 0x2F6C,
+ 0xF0A1, 0xF0CA, 0x2F94, 0xF0CB, 0xF0CB, 0x2C61, 0xF0CC, 0xF0FE, 0x2FBE,
+ 0xF140, 0xF162, 0x2FF1, 0xF163, 0xF16A, 0x3015, 0xF16B, 0xF16B, 0x3160,
+ 0xF16C, 0xF17E, 0x301D, 0xF1A1, 0xF1FE, 0x3030, 0xF240, 0xF267, 0x308E,
+ 0xF268, 0xF268, 0x31EF, 0xF269, 0xF27E, 0x30B6, 0xF2A1, 0xF2C2, 0x30CC,
+ 0xF2C3, 0xF2FE, 0x30EF, 0xF340, 0xF374, 0x312B, 0xF375, 0xF37E, 0x3161,
+ 0xF3A1, 0xF3FE, 0x316B, 0xF440, 0xF465, 0x31C9, 0xF466, 0xF47E, 0x31F0,
+ 0xF4A1, 0xF4B4, 0x3209, 0xF4B5, 0xF4B5, 0x30EE, 0xF4B6, 0xF4FC, 0x321D,
+ 0xF4FD, 0xF4FE, 0x3265, 0xF540, 0xF57E, 0x3267, 0xF5A1, 0xF5FE, 0x32A6,
+ 0xF640, 0xF662, 0x3304, 0xF663, 0xF663, 0x3264, 0xF664, 0xF67E, 0x3327,
+ 0xF6A1, 0xF6FE, 0x3342, 0xF740, 0xF77E, 0x33A0, 0xF7A1, 0xF7FE, 0x33DF,
+ 0xF840, 0xF87E, 0x343D, 0xF8A1, 0xF8FE, 0x347C, 0xF940, 0xF976, 0x34DA,
+ 0xF977, 0xF97E, 0x3512, 0xF9A1, 0xF9C3, 0x351A, 0xF9C4, 0xF9C4, 0x3511,
+ 0xF9C5, 0xF9C5, 0x353D, 0xF9C6, 0xF9C6, 0x3549, 0xF9C7, 0xF9D1, 0x353E,
+ 0xF9D2, 0xF9D5, 0x354A,
+};
diff --git a/core/src/fpdfapi/fpdf_cmaps/CNS1/B5pc-V_0.cpp b/core/src/fpdfapi/fpdf_cmaps/CNS1/B5pc-V_0.cpp
index 188aefc458..65a016efc8 100644
--- a/core/src/fpdfapi/fpdf_cmaps/CNS1/B5pc-V_0.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/CNS1/B5pc-V_0.cpp
@@ -1,12 +1,12 @@
-// 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
-
-extern const unsigned short g_FXCMAP_B5pc_V_0[12 * 3] = {
- 0xA14B, 0xA14B, 0x354E, 0xA15A, 0xA15A, 0x35AF, 0xA15C, 0xA15C, 0x35B1,
- 0xA15D, 0xA15E, 0x0082, 0xA161, 0xA162, 0x0086, 0xA165, 0xA166, 0x008A,
- 0xA169, 0xA16A, 0x008E, 0xA16D, 0xA16E, 0x0092, 0xA171, 0xA172, 0x0096,
- 0xA175, 0xA176, 0x009A, 0xA179, 0xA17A, 0x009E, 0xA1E3, 0xA1E3, 0x354F,
-};
+// 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
+
+extern const unsigned short g_FXCMAP_B5pc_V_0[12 * 3] = {
+ 0xA14B, 0xA14B, 0x354E, 0xA15A, 0xA15A, 0x35AF, 0xA15C, 0xA15C, 0x35B1,
+ 0xA15D, 0xA15E, 0x0082, 0xA161, 0xA162, 0x0086, 0xA165, 0xA166, 0x008A,
+ 0xA169, 0xA16A, 0x008E, 0xA16D, 0xA16E, 0x0092, 0xA171, 0xA172, 0x0096,
+ 0xA175, 0xA176, 0x009A, 0xA179, 0xA17A, 0x009E, 0xA1E3, 0xA1E3, 0x354F,
+};
diff --git a/core/src/fpdfapi/fpdf_cmaps/CNS1/CNS-EUC-H_0.cpp b/core/src/fpdfapi/fpdf_cmaps/CNS1/CNS-EUC-H_0.cpp
index 57ae87ce24..6041f34ec9 100644
--- a/core/src/fpdfapi/fpdf_cmaps/CNS1/CNS-EUC-H_0.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/CNS1/CNS-EUC-H_0.cpp
@@ -1,182 +1,182 @@
-// 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
-
-extern const unsigned short g_FXCMAP_CNS_EUC_H_0[157 * 3] = {
- 0x0020, 0x007E, 0x3550, 0xA1A1, 0xA1FE, 0x0063, 0xA2A1, 0xA2FE, 0x00C1,
- 0xA3A1, 0xA3CE, 0x011F, 0xA4A1, 0xA4FE, 0x014D, 0xA5A1, 0xA5EC, 0x01AB,
- 0xA5EE, 0xA5F0, 0x01F7, 0xA6A1, 0xA6BE, 0x01FA, 0xA7A1, 0xA7A1, 0x0253,
- 0xA7A2, 0xA7A4, 0x0218, 0xA7A5, 0xA7A5, 0x0254, 0xA7A6, 0xA7A6, 0x021B,
- 0xA7A7, 0xA7A7, 0x025A, 0xA7A8, 0xA7A8, 0x021C, 0xA7A9, 0xA7AC, 0x025B,
- 0xA7AD, 0xA7AF, 0x021D, 0xA7B0, 0xA7B0, 0x025F, 0xA7B1, 0xA7B1, 0x176E,
- 0xA7B2, 0xA7B2, 0x0260, 0xA7B3, 0xA7B3, 0x0262, 0xA7B4, 0xA7B4, 0x0220,
- 0xA7B5, 0xA7B5, 0x0263, 0xA7B6, 0xA7B6, 0x176F, 0xA7B7, 0xA7B7, 0x0221,
- 0xA7B8, 0xA7B9, 0x0264, 0xA7BA, 0xA7BA, 0x0222, 0xA7BB, 0xA7BB, 0x1770,
- 0xA7BC, 0xA7BC, 0x0223, 0xA7BD, 0xA7BD, 0x0266, 0xA7BE, 0xA7BE, 0x0279,
- 0xA7BF, 0xA7BF, 0x1775, 0xA7C0, 0xA7C1, 0x027A, 0xA7C2, 0xA7C2, 0x0224,
- 0xA7C3, 0xA7C6, 0x027C, 0xA7C7, 0xA7C7, 0x0225, 0xA7C8, 0xA7CB, 0x0282,
- 0xA7CC, 0xA7CC, 0x1776, 0xA7CD, 0xA7CD, 0x0286, 0xA7CE, 0xA7CE, 0x0226,
- 0xA7CF, 0xA7D0, 0x0288, 0xA7D1, 0xA7D2, 0x028C, 0xA7D3, 0xA7D5, 0x0227,
- 0xA7D6, 0xA7D8, 0x028E, 0xA7D9, 0xA7DA, 0x022A, 0xA7DB, 0xA7DB, 0x1777,
- 0xA7DC, 0xA7DF, 0x02D0, 0xA7E0, 0xA7E0, 0x02D5, 0xA7E1, 0xA7E1, 0x022C,
- 0xA7E2, 0xA7E5, 0x02D6, 0xA7E6, 0xA7E6, 0x022D, 0xA7E7, 0xA7ED, 0x02DA,
- 0xA7EE, 0xA7EE, 0x178A, 0xA7EF, 0xA7F2, 0x02E1, 0xA7F3, 0xA7F3, 0x178C,
- 0xA7F4, 0xA7F8, 0x02E5, 0xA7F9, 0xA7F9, 0x178D, 0xA7FA, 0xA7FD, 0x02EA,
- 0xA7FE, 0xA7FE, 0x0356, 0xA8A1, 0xA8A6, 0x0357, 0xA8A7, 0xA8A7, 0x035E,
- 0xA8A8, 0xA8A8, 0x0362, 0xA8A9, 0xA8AA, 0x022E, 0xA8AB, 0xA8B2, 0x0363,
- 0xA8B3, 0xA8B3, 0x17B2, 0xA8B4, 0xA8B6, 0x036B, 0xA8B7, 0xA8BA, 0x03F6,
- 0xA8BB, 0xA8BB, 0x1812, 0xA8BC, 0xA8BE, 0x03FA, 0xA8BF, 0xA8C3, 0x03FE,
- 0xA8C4, 0xA8CC, 0x0405, 0xA8CD, 0xA8CD, 0x1813, 0xA8CE, 0xA8CE, 0x1818,
- 0xA8CF, 0xA8D2, 0x040F, 0xA8D3, 0xA8D3, 0x1819, 0xA8D4, 0xA8D9, 0x0508,
- 0xA8DA, 0xA8DA, 0x18E7, 0xA8DB, 0xA8E2, 0x050E, 0xA8E3, 0xA8E3, 0x0230,
- 0xA8E4, 0xA8E4, 0x051B, 0xA8E5, 0xA8E7, 0x0520, 0xA8E8, 0xA8EB, 0x0696,
- 0xA8EC, 0xA8EC, 0x0231, 0xA8ED, 0xA8F0, 0x069F, 0xA8F1, 0xA8FB, 0x0826,
- 0xA8FC, 0xA8FE, 0x09F5, 0xA9A1, 0xA9A1, 0x1E33, 0xA9A2, 0xA9A2, 0x09F8,
- 0xA9A3, 0xA9A3, 0x1E34, 0xA9A4, 0xA9A5, 0x09F9, 0xA9A6, 0xA9AB, 0x0BE1,
- 0xA9AC, 0xA9AE, 0x0DBB, 0xA9AF, 0xA9AF, 0x2360, 0xA9B0, 0xA9B0, 0x2612,
- 0xA9B1, 0xA9B3, 0x0F7B, 0xA9B4, 0xA9B5, 0x1100, 0xA9B6, 0xA9B6, 0x1289,
- 0xA9B7, 0xA9B8, 0x13B2, 0xA9B9, 0xA9B9, 0x2F0D, 0xC2A1, 0xC2C1, 0x0232,
- 0xC4A1, 0xC4FE, 0x0253, 0xC5A1, 0xC5FE, 0x02B1, 0xC6A1, 0xC6FE, 0x030F,
- 0xC7A1, 0xC7FE, 0x036D, 0xC8A1, 0xC8FE, 0x03CB, 0xC9A1, 0xC9FE, 0x0429,
- 0xCAA1, 0xCAFE, 0x0487, 0xCBA1, 0xCBFE, 0x04E5, 0xCCA1, 0xCCFE, 0x0543,
- 0xCDA1, 0xCDFE, 0x05A1, 0xCEA1, 0xCEFE, 0x05FF, 0xCFA1, 0xCFFE, 0x065D,
- 0xD0A1, 0xD0FE, 0x06BB, 0xD1A1, 0xD1FE, 0x0719, 0xD2A1, 0xD2FE, 0x0777,
- 0xD3A1, 0xD3FE, 0x07D5, 0xD4A1, 0xD4FE, 0x0833, 0xD5A1, 0xD5FE, 0x0891,
- 0xD6A1, 0xD6FE, 0x08EF, 0xD7A1, 0xD7FE, 0x094D, 0xD8A1, 0xD8FE, 0x09AB,
- 0xD9A1, 0xD9FE, 0x0A09, 0xDAA1, 0xDAFE, 0x0A67, 0xDBA1, 0xDBFE, 0x0AC5,
- 0xDCA1, 0xDCFE, 0x0B23, 0xDDA1, 0xDDFE, 0x0B81, 0xDEA1, 0xDEFE, 0x0BDF,
- 0xDFA1, 0xDFFE, 0x0C3D, 0xE0A1, 0xE0FE, 0x0C9B, 0xE1A1, 0xE1FE, 0x0CF9,
- 0xE2A1, 0xE2FE, 0x0D57, 0xE3A1, 0xE3FE, 0x0DB5, 0xE4A1, 0xE4FE, 0x0E13,
- 0xE5A1, 0xE5FE, 0x0E71, 0xE6A1, 0xE6FE, 0x0ECF, 0xE7A1, 0xE7FE, 0x0F2D,
- 0xE8A1, 0xE8FE, 0x0F8B, 0xE9A1, 0xE9FE, 0x0FE9, 0xEAA1, 0xEAFE, 0x1047,
- 0xEBA1, 0xEBFE, 0x10A5, 0xECA1, 0xECFE, 0x1103, 0xEDA1, 0xEDFE, 0x1161,
- 0xEEA1, 0xEEFE, 0x11BF, 0xEFA1, 0xEFFE, 0x121D, 0xF0A1, 0xF0FE, 0x127B,
- 0xF1A1, 0xF1FE, 0x12D9, 0xF2A1, 0xF2FE, 0x1337, 0xF3A1, 0xF3FE, 0x1395,
- 0xF4A1, 0xF4FE, 0x13F3, 0xF5A1, 0xF5FE, 0x1451, 0xF6A1, 0xF6FE, 0x14AF,
- 0xF7A1, 0xF7FE, 0x150D, 0xF8A1, 0xF8FE, 0x156B, 0xF9A1, 0xF9FE, 0x15C9,
- 0xFAA1, 0xFAFE, 0x1627, 0xFBA1, 0xFBFE, 0x1685, 0xFCA1, 0xFCFE, 0x16E3,
- 0xFDA1, 0xFDCB, 0x1741,
-};
-extern const unsigned short g_FXCMAP_CNS_EUC_H_0_DWord[238 * 4] = {
- 0x8EA1, 0xA1A1, 0xA1FE, 0x0063, 0x8EA1, 0xA2A1, 0xA2FE, 0x00C1,
- 0x8EA1, 0xA3A1, 0xA3CE, 0x011F, 0x8EA1, 0xA4A1, 0xA4FE, 0x014D,
- 0x8EA1, 0xA5A1, 0xA5EC, 0x01AB, 0x8EA1, 0xA5EE, 0xA5F0, 0x01F7,
- 0x8EA1, 0xA6A1, 0xA6BE, 0x01FA, 0x8EA1, 0xA7A1, 0xA7A1, 0x0253,
- 0x8EA1, 0xA7A2, 0xA7A4, 0x0218, 0x8EA1, 0xA7A5, 0xA7A5, 0x0254,
- 0x8EA1, 0xA7A6, 0xA7A6, 0x021B, 0x8EA1, 0xA7A7, 0xA7A7, 0x025A,
- 0x8EA1, 0xA7A8, 0xA7A8, 0x021C, 0x8EA1, 0xA7A9, 0xA7AC, 0x025B,
- 0x8EA1, 0xA7AD, 0xA7AF, 0x021D, 0x8EA1, 0xA7B0, 0xA7B0, 0x025F,
- 0x8EA1, 0xA7B1, 0xA7B1, 0x176E, 0x8EA1, 0xA7B2, 0xA7B2, 0x0260,
- 0x8EA1, 0xA7B3, 0xA7B3, 0x0262, 0x8EA1, 0xA7B4, 0xA7B4, 0x0220,
- 0x8EA1, 0xA7B5, 0xA7B5, 0x0263, 0x8EA1, 0xA7B6, 0xA7B6, 0x176F,
- 0x8EA1, 0xA7B7, 0xA7B7, 0x0221, 0x8EA1, 0xA7B8, 0xA7B9, 0x0264,
- 0x8EA1, 0xA7BA, 0xA7BA, 0x0222, 0x8EA1, 0xA7BB, 0xA7BB, 0x1770,
- 0x8EA1, 0xA7BC, 0xA7BC, 0x0223, 0x8EA1, 0xA7BD, 0xA7BD, 0x0266,
- 0x8EA1, 0xA7BE, 0xA7BE, 0x0279, 0x8EA1, 0xA7BF, 0xA7BF, 0x1775,
- 0x8EA1, 0xA7C0, 0xA7C1, 0x027A, 0x8EA1, 0xA7C2, 0xA7C2, 0x0224,
- 0x8EA1, 0xA7C3, 0xA7C6, 0x027C, 0x8EA1, 0xA7C7, 0xA7C7, 0x0225,
- 0x8EA1, 0xA7C8, 0xA7CB, 0x0282, 0x8EA1, 0xA7CC, 0xA7CC, 0x1776,
- 0x8EA1, 0xA7CD, 0xA7CD, 0x0286, 0x8EA1, 0xA7CE, 0xA7CE, 0x0226,
- 0x8EA1, 0xA7CF, 0xA7D0, 0x0288, 0x8EA1, 0xA7D1, 0xA7D2, 0x028C,
- 0x8EA1, 0xA7D3, 0xA7D5, 0x0227, 0x8EA1, 0xA7D6, 0xA7D8, 0x028E,
- 0x8EA1, 0xA7D9, 0xA7DA, 0x022A, 0x8EA1, 0xA7DB, 0xA7DB, 0x1777,
- 0x8EA1, 0xA7DC, 0xA7DF, 0x02D0, 0x8EA1, 0xA7E0, 0xA7E0, 0x02D5,
- 0x8EA1, 0xA7E1, 0xA7E1, 0x022C, 0x8EA1, 0xA7E2, 0xA7E5, 0x02D6,
- 0x8EA1, 0xA7E6, 0xA7E6, 0x022D, 0x8EA1, 0xA7E7, 0xA7ED, 0x02DA,
- 0x8EA1, 0xA7EE, 0xA7EE, 0x178A, 0x8EA1, 0xA7EF, 0xA7F2, 0x02E1,
- 0x8EA1, 0xA7F3, 0xA7F3, 0x178C, 0x8EA1, 0xA7F4, 0xA7F8, 0x02E5,
- 0x8EA1, 0xA7F9, 0xA7F9, 0x178D, 0x8EA1, 0xA7FA, 0xA7FD, 0x02EA,
- 0x8EA1, 0xA7FE, 0xA7FE, 0x0356, 0x8EA1, 0xA8A1, 0xA8A6, 0x0357,
- 0x8EA1, 0xA8A7, 0xA8A7, 0x035E, 0x8EA1, 0xA8A8, 0xA8A8, 0x0362,
- 0x8EA1, 0xA8A9, 0xA8AA, 0x022E, 0x8EA1, 0xA8AB, 0xA8B2, 0x0363,
- 0x8EA1, 0xA8B3, 0xA8B3, 0x17B2, 0x8EA1, 0xA8B4, 0xA8B6, 0x036B,
- 0x8EA1, 0xA8B7, 0xA8BA, 0x03F6, 0x8EA1, 0xA8BB, 0xA8BB, 0x1812,
- 0x8EA1, 0xA8BC, 0xA8BE, 0x03FA, 0x8EA1, 0xA8BF, 0xA8C3, 0x03FE,
- 0x8EA1, 0xA8C4, 0xA8CC, 0x0405, 0x8EA1, 0xA8CD, 0xA8CD, 0x1813,
- 0x8EA1, 0xA8CE, 0xA8CE, 0x1818, 0x8EA1, 0xA8CF, 0xA8D2, 0x040F,
- 0x8EA1, 0xA8D3, 0xA8D3, 0x1819, 0x8EA1, 0xA8D4, 0xA8D9, 0x0508,
- 0x8EA1, 0xA8DA, 0xA8DA, 0x18E7, 0x8EA1, 0xA8DB, 0xA8E2, 0x050E,
- 0x8EA1, 0xA8E3, 0xA8E3, 0x0230, 0x8EA1, 0xA8E4, 0xA8E4, 0x051B,
- 0x8EA1, 0xA8E5, 0xA8E7, 0x0520, 0x8EA1, 0xA8E8, 0xA8EB, 0x0696,
- 0x8EA1, 0xA8EC, 0xA8EC, 0x0231, 0x8EA1, 0xA8ED, 0xA8F0, 0x069F,
- 0x8EA1, 0xA8F1, 0xA8FB, 0x0826, 0x8EA1, 0xA8FC, 0xA8FE, 0x09F5,
- 0x8EA1, 0xA9A1, 0xA9A1, 0x1E33, 0x8EA1, 0xA9A2, 0xA9A2, 0x09F8,
- 0x8EA1, 0xA9A3, 0xA9A3, 0x1E34, 0x8EA1, 0xA9A4, 0xA9A5, 0x09F9,
- 0x8EA1, 0xA9A6, 0xA9AB, 0x0BE1, 0x8EA1, 0xA9AC, 0xA9AE, 0x0DBB,
- 0x8EA1, 0xA9AF, 0xA9AF, 0x2360, 0x8EA1, 0xA9B0, 0xA9B0, 0x2612,
- 0x8EA1, 0xA9B1, 0xA9B3, 0x0F7B, 0x8EA1, 0xA9B4, 0xA9B5, 0x1100,
- 0x8EA1, 0xA9B6, 0xA9B6, 0x1289, 0x8EA1, 0xA9B7, 0xA9B8, 0x13B2,
- 0x8EA1, 0xA9B9, 0xA9B9, 0x2F0D, 0x8EA1, 0xC2A1, 0xC2C1, 0x0232,
- 0x8EA1, 0xC4A1, 0xC4FE, 0x0253, 0x8EA1, 0xC5A1, 0xC5FE, 0x02B1,
- 0x8EA1, 0xC6A1, 0xC6FE, 0x030F, 0x8EA1, 0xC7A1, 0xC7FE, 0x036D,
- 0x8EA1, 0xC8A1, 0xC8FE, 0x03CB, 0x8EA1, 0xC9A1, 0xC9FE, 0x0429,
- 0x8EA1, 0xCAA1, 0xCAFE, 0x0487, 0x8EA1, 0xCBA1, 0xCBFE, 0x04E5,
- 0x8EA1, 0xCCA1, 0xCCFE, 0x0543, 0x8EA1, 0xCDA1, 0xCDFE, 0x05A1,
- 0x8EA1, 0xCEA1, 0xCEFE, 0x05FF, 0x8EA1, 0xCFA1, 0xCFFE, 0x065D,
- 0x8EA1, 0xD0A1, 0xD0FE, 0x06BB, 0x8EA1, 0xD1A1, 0xD1FE, 0x0719,
- 0x8EA1, 0xD2A1, 0xD2FE, 0x0777, 0x8EA1, 0xD3A1, 0xD3FE, 0x07D5,
- 0x8EA1, 0xD4A1, 0xD4FE, 0x0833, 0x8EA1, 0xD5A1, 0xD5FE, 0x0891,
- 0x8EA1, 0xD6A1, 0xD6FE, 0x08EF, 0x8EA1, 0xD7A1, 0xD7FE, 0x094D,
- 0x8EA1, 0xD8A1, 0xD8FE, 0x09AB, 0x8EA1, 0xD9A1, 0xD9FE, 0x0A09,
- 0x8EA1, 0xDAA1, 0xDAFE, 0x0A67, 0x8EA1, 0xDBA1, 0xDBFE, 0x0AC5,
- 0x8EA1, 0xDCA1, 0xDCFE, 0x0B23, 0x8EA1, 0xDDA1, 0xDDFE, 0x0B81,
- 0x8EA1, 0xDEA1, 0xDEFE, 0x0BDF, 0x8EA1, 0xDFA1, 0xDFFE, 0x0C3D,
- 0x8EA1, 0xE0A1, 0xE0FE, 0x0C9B, 0x8EA1, 0xE1A1, 0xE1FE, 0x0CF9,
- 0x8EA1, 0xE2A1, 0xE2FE, 0x0D57, 0x8EA1, 0xE3A1, 0xE3FE, 0x0DB5,
- 0x8EA1, 0xE4A1, 0xE4FE, 0x0E13, 0x8EA1, 0xE5A1, 0xE5FE, 0x0E71,
- 0x8EA1, 0xE6A1, 0xE6FE, 0x0ECF, 0x8EA1, 0xE7A1, 0xE7FE, 0x0F2D,
- 0x8EA1, 0xE8A1, 0xE8FE, 0x0F8B, 0x8EA1, 0xE9A1, 0xE9FE, 0x0FE9,
- 0x8EA1, 0xEAA1, 0xEAFE, 0x1047, 0x8EA1, 0xEBA1, 0xEBFE, 0x10A5,
- 0x8EA1, 0xECA1, 0xECFE, 0x1103, 0x8EA1, 0xEDA1, 0xEDFE, 0x1161,
- 0x8EA1, 0xEEA1, 0xEEFE, 0x11BF, 0x8EA1, 0xEFA1, 0xEFFE, 0x121D,
- 0x8EA1, 0xF0A1, 0xF0FE, 0x127B, 0x8EA1, 0xF1A1, 0xF1FE, 0x12D9,
- 0x8EA1, 0xF2A1, 0xF2FE, 0x1337, 0x8EA1, 0xF3A1, 0xF3FE, 0x1395,
- 0x8EA1, 0xF4A1, 0xF4FE, 0x13F3, 0x8EA1, 0xF5A1, 0xF5FE, 0x1451,
- 0x8EA1, 0xF6A1, 0xF6FE, 0x14AF, 0x8EA1, 0xF7A1, 0xF7FE, 0x150D,
- 0x8EA1, 0xF8A1, 0xF8FE, 0x156B, 0x8EA1, 0xF9A1, 0xF9FE, 0x15C9,
- 0x8EA1, 0xFAA1, 0xFAFE, 0x1627, 0x8EA1, 0xFBA1, 0xFBFE, 0x1685,
- 0x8EA1, 0xFCA1, 0xFCFE, 0x16E3, 0x8EA1, 0xFDA1, 0xFDCB, 0x1741,
- 0x8EA2, 0xA1A1, 0xA1FE, 0x176C, 0x8EA2, 0xA2A1, 0xA2FE, 0x17CA,
- 0x8EA2, 0xA3A1, 0xA3FE, 0x1828, 0x8EA2, 0xA4A1, 0xA4FE, 0x1886,
- 0x8EA2, 0xA5A1, 0xA5FE, 0x18E4, 0x8EA2, 0xA6A1, 0xA6FE, 0x1942,
- 0x8EA2, 0xA7A1, 0xA7FE, 0x19A0, 0x8EA2, 0xA8A1, 0xA8FE, 0x19FE,
- 0x8EA2, 0xA9A1, 0xA9FE, 0x1A5C, 0x8EA2, 0xAAA1, 0xAAFE, 0x1ABA,
- 0x8EA2, 0xABA1, 0xABFE, 0x1B18, 0x8EA2, 0xACA1, 0xACFE, 0x1B76,
- 0x8EA2, 0xADA1, 0xADFE, 0x1BD4, 0x8EA2, 0xAEA1, 0xAEFE, 0x1C32,
- 0x8EA2, 0xAFA1, 0xAFFE, 0x1C90, 0x8EA2, 0xB0A1, 0xB0FE, 0x1CEE,
- 0x8EA2, 0xB1A1, 0xB1FE, 0x1D4C, 0x8EA2, 0xB2A1, 0xB2FE, 0x1DAA,
- 0x8EA2, 0xB3A1, 0xB3FE, 0x1E08, 0x8EA2, 0xB4A1, 0xB4FE, 0x1E66,
- 0x8EA2, 0xB5A1, 0xB5FE, 0x1EC4, 0x8EA2, 0xB6A1, 0xB6FE, 0x1F22,
- 0x8EA2, 0xB7A1, 0xB7FE, 0x1F80, 0x8EA2, 0xB8A1, 0xB8FE, 0x1FDE,
- 0x8EA2, 0xB9A1, 0xB9FE, 0x203C, 0x8EA2, 0xBAA1, 0xBAFE, 0x209A,
- 0x8EA2, 0xBBA1, 0xBBFE, 0x20F8, 0x8EA2, 0xBCA1, 0xBCFE, 0x2156,
- 0x8EA2, 0xBDA1, 0xBDFE, 0x21B4, 0x8EA2, 0xBEA1, 0xBEFE, 0x2212,
- 0x8EA2, 0xBFA1, 0xBFFE, 0x2270, 0x8EA2, 0xC0A1, 0xC0FE, 0x22CE,
- 0x8EA2, 0xC1A1, 0xC1FE, 0x232C, 0x8EA2, 0xC2A1, 0xC2FE, 0x238A,
- 0x8EA2, 0xC3A1, 0xC3FE, 0x23E8, 0x8EA2, 0xC4A1, 0xC4FE, 0x2446,
- 0x8EA2, 0xC5A1, 0xC5FE, 0x24A4, 0x8EA2, 0xC6A1, 0xC6FE, 0x2502,
- 0x8EA2, 0xC7A1, 0xC7FE, 0x2560, 0x8EA2, 0xC8A1, 0xC8FE, 0x25BE,
- 0x8EA2, 0xC9A1, 0xC9FE, 0x261C, 0x8EA2, 0xCAA1, 0xCAFE, 0x267A,
- 0x8EA2, 0xCBA1, 0xCBFE, 0x26D8, 0x8EA2, 0xCCA1, 0xCCFE, 0x2736,
- 0x8EA2, 0xCDA1, 0xCDFE, 0x2794, 0x8EA2, 0xCEA1, 0xCEFE, 0x27F2,
- 0x8EA2, 0xCFA1, 0xCFFE, 0x2850, 0x8EA2, 0xD0A1, 0xD0FE, 0x28AE,
- 0x8EA2, 0xD1A1, 0xD1FE, 0x290C, 0x8EA2, 0xD2A1, 0xD2FE, 0x296A,
- 0x8EA2, 0xD3A1, 0xD3FE, 0x29C8, 0x8EA2, 0xD4A1, 0xD4FE, 0x2A26,
- 0x8EA2, 0xD5A1, 0xD5FE, 0x2A84, 0x8EA2, 0xD6A1, 0xD6FE, 0x2AE2,
- 0x8EA2, 0xD7A1, 0xD7FE, 0x2B40, 0x8EA2, 0xD8A1, 0xD8FE, 0x2B9E,
- 0x8EA2, 0xD9A1, 0xD9FE, 0x2BFC, 0x8EA2, 0xDAA1, 0xDAFE, 0x2C5A,
- 0x8EA2, 0xDBA1, 0xDBFE, 0x2CB8, 0x8EA2, 0xDCA1, 0xDCFE, 0x2D16,
- 0x8EA2, 0xDDA1, 0xDDFE, 0x2D74, 0x8EA2, 0xDEA1, 0xDEFE, 0x2DD2,
- 0x8EA2, 0xDFA1, 0xDFFE, 0x2E30, 0x8EA2, 0xE0A1, 0xE0FE, 0x2E8E,
- 0x8EA2, 0xE1A1, 0xE1FE, 0x2EEC, 0x8EA2, 0xE2A1, 0xE2FE, 0x2F4A,
- 0x8EA2, 0xE3A1, 0xE3FE, 0x2FA8, 0x8EA2, 0xE4A1, 0xE4FE, 0x3006,
- 0x8EA2, 0xE5A1, 0xE5FE, 0x3064, 0x8EA2, 0xE6A1, 0xE6FE, 0x30C2,
- 0x8EA2, 0xE7A1, 0xE7FE, 0x3120, 0x8EA2, 0xE8A1, 0xE8FE, 0x317E,
- 0x8EA2, 0xE9A1, 0xE9FE, 0x31DC, 0x8EA2, 0xEAA1, 0xEAFE, 0x323A,
- 0x8EA2, 0xEBA1, 0xEBFE, 0x3298, 0x8EA2, 0xECA1, 0xECFE, 0x32F6,
- 0x8EA2, 0xEDA1, 0xEDFE, 0x3354, 0x8EA2, 0xEEA1, 0xEEFE, 0x33B2,
- 0x8EA2, 0xEFA1, 0xEFFE, 0x3410, 0x8EA2, 0xF0A1, 0xF0FE, 0x346E,
- 0x8EA2, 0xF1A1, 0xF1FE, 0x34CC, 0x8EA2, 0xF2A1, 0xF2C4, 0x352A,
-};
+// 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
+
+extern const unsigned short g_FXCMAP_CNS_EUC_H_0[157 * 3] = {
+ 0x0020, 0x007E, 0x3550, 0xA1A1, 0xA1FE, 0x0063, 0xA2A1, 0xA2FE, 0x00C1,
+ 0xA3A1, 0xA3CE, 0x011F, 0xA4A1, 0xA4FE, 0x014D, 0xA5A1, 0xA5EC, 0x01AB,
+ 0xA5EE, 0xA5F0, 0x01F7, 0xA6A1, 0xA6BE, 0x01FA, 0xA7A1, 0xA7A1, 0x0253,
+ 0xA7A2, 0xA7A4, 0x0218, 0xA7A5, 0xA7A5, 0x0254, 0xA7A6, 0xA7A6, 0x021B,
+ 0xA7A7, 0xA7A7, 0x025A, 0xA7A8, 0xA7A8, 0x021C, 0xA7A9, 0xA7AC, 0x025B,
+ 0xA7AD, 0xA7AF, 0x021D, 0xA7B0, 0xA7B0, 0x025F, 0xA7B1, 0xA7B1, 0x176E,
+ 0xA7B2, 0xA7B2, 0x0260, 0xA7B3, 0xA7B3, 0x0262, 0xA7B4, 0xA7B4, 0x0220,
+ 0xA7B5, 0xA7B5, 0x0263, 0xA7B6, 0xA7B6, 0x176F, 0xA7B7, 0xA7B7, 0x0221,
+ 0xA7B8, 0xA7B9, 0x0264, 0xA7BA, 0xA7BA, 0x0222, 0xA7BB, 0xA7BB, 0x1770,
+ 0xA7BC, 0xA7BC, 0x0223, 0xA7BD, 0xA7BD, 0x0266, 0xA7BE, 0xA7BE, 0x0279,
+ 0xA7BF, 0xA7BF, 0x1775, 0xA7C0, 0xA7C1, 0x027A, 0xA7C2, 0xA7C2, 0x0224,
+ 0xA7C3, 0xA7C6, 0x027C, 0xA7C7, 0xA7C7, 0x0225, 0xA7C8, 0xA7CB, 0x0282,
+ 0xA7CC, 0xA7CC, 0x1776, 0xA7CD, 0xA7CD, 0x0286, 0xA7CE, 0xA7CE, 0x0226,
+ 0xA7CF, 0xA7D0, 0x0288, 0xA7D1, 0xA7D2, 0x028C, 0xA7D3, 0xA7D5, 0x0227,
+ 0xA7D6, 0xA7D8, 0x028E, 0xA7D9, 0xA7DA, 0x022A, 0xA7DB, 0xA7DB, 0x1777,
+ 0xA7DC, 0xA7DF, 0x02D0, 0xA7E0, 0xA7E0, 0x02D5, 0xA7E1, 0xA7E1, 0x022C,
+ 0xA7E2, 0xA7E5, 0x02D6, 0xA7E6, 0xA7E6, 0x022D, 0xA7E7, 0xA7ED, 0x02DA,
+ 0xA7EE, 0xA7EE, 0x178A, 0xA7EF, 0xA7F2, 0x02E1, 0xA7F3, 0xA7F3, 0x178C,
+ 0xA7F4, 0xA7F8, 0x02E5, 0xA7F9, 0xA7F9, 0x178D, 0xA7FA, 0xA7FD, 0x02EA,
+ 0xA7FE, 0xA7FE, 0x0356, 0xA8A1, 0xA8A6, 0x0357, 0xA8A7, 0xA8A7, 0x035E,
+ 0xA8A8, 0xA8A8, 0x0362, 0xA8A9, 0xA8AA, 0x022E, 0xA8AB, 0xA8B2, 0x0363,
+ 0xA8B3, 0xA8B3, 0x17B2, 0xA8B4, 0xA8B6, 0x036B, 0xA8B7, 0xA8BA, 0x03F6,
+ 0xA8BB, 0xA8BB, 0x1812, 0xA8BC, 0xA8BE, 0x03FA, 0xA8BF, 0xA8C3, 0x03FE,
+ 0xA8C4, 0xA8CC, 0x0405, 0xA8CD, 0xA8CD, 0x1813, 0xA8CE, 0xA8CE, 0x1818,
+ 0xA8CF, 0xA8D2, 0x040F, 0xA8D3, 0xA8D3, 0x1819, 0xA8D4, 0xA8D9, 0x0508,
+ 0xA8DA, 0xA8DA, 0x18E7, 0xA8DB, 0xA8E2, 0x050E, 0xA8E3, 0xA8E3, 0x0230,
+ 0xA8E4, 0xA8E4, 0x051B, 0xA8E5, 0xA8E7, 0x0520, 0xA8E8, 0xA8EB, 0x0696,
+ 0xA8EC, 0xA8EC, 0x0231, 0xA8ED, 0xA8F0, 0x069F, 0xA8F1, 0xA8FB, 0x0826,
+ 0xA8FC, 0xA8FE, 0x09F5, 0xA9A1, 0xA9A1, 0x1E33, 0xA9A2, 0xA9A2, 0x09F8,
+ 0xA9A3, 0xA9A3, 0x1E34, 0xA9A4, 0xA9A5, 0x09F9, 0xA9A6, 0xA9AB, 0x0BE1,
+ 0xA9AC, 0xA9AE, 0x0DBB, 0xA9AF, 0xA9AF, 0x2360, 0xA9B0, 0xA9B0, 0x2612,
+ 0xA9B1, 0xA9B3, 0x0F7B, 0xA9B4, 0xA9B5, 0x1100, 0xA9B6, 0xA9B6, 0x1289,
+ 0xA9B7, 0xA9B8, 0x13B2, 0xA9B9, 0xA9B9, 0x2F0D, 0xC2A1, 0xC2C1, 0x0232,
+ 0xC4A1, 0xC4FE, 0x0253, 0xC5A1, 0xC5FE, 0x02B1, 0xC6A1, 0xC6FE, 0x030F,
+ 0xC7A1, 0xC7FE, 0x036D, 0xC8A1, 0xC8FE, 0x03CB, 0xC9A1, 0xC9FE, 0x0429,
+ 0xCAA1, 0xCAFE, 0x0487, 0xCBA1, 0xCBFE, 0x04E5, 0xCCA1, 0xCCFE, 0x0543,
+ 0xCDA1, 0xCDFE, 0x05A1, 0xCEA1, 0xCEFE, 0x05FF, 0xCFA1, 0xCFFE, 0x065D,
+ 0xD0A1, 0xD0FE, 0x06BB, 0xD1A1, 0xD1FE, 0x0719, 0xD2A1, 0xD2FE, 0x0777,
+ 0xD3A1, 0xD3FE, 0x07D5, 0xD4A1, 0xD4FE, 0x0833, 0xD5A1, 0xD5FE, 0x0891,
+ 0xD6A1, 0xD6FE, 0x08EF, 0xD7A1, 0xD7FE, 0x094D, 0xD8A1, 0xD8FE, 0x09AB,
+ 0xD9A1, 0xD9FE, 0x0A09, 0xDAA1, 0xDAFE, 0x0A67, 0xDBA1, 0xDBFE, 0x0AC5,
+ 0xDCA1, 0xDCFE, 0x0B23, 0xDDA1, 0xDDFE, 0x0B81, 0xDEA1, 0xDEFE, 0x0BDF,
+ 0xDFA1, 0xDFFE, 0x0C3D, 0xE0A1, 0xE0FE, 0x0C9B, 0xE1A1, 0xE1FE, 0x0CF9,
+ 0xE2A1, 0xE2FE, 0x0D57, 0xE3A1, 0xE3FE, 0x0DB5, 0xE4A1, 0xE4FE, 0x0E13,
+ 0xE5A1, 0xE5FE, 0x0E71, 0xE6A1, 0xE6FE, 0x0ECF, 0xE7A1, 0xE7FE, 0x0F2D,
+ 0xE8A1, 0xE8FE, 0x0F8B, 0xE9A1, 0xE9FE, 0x0FE9, 0xEAA1, 0xEAFE, 0x1047,
+ 0xEBA1, 0xEBFE, 0x10A5, 0xECA1, 0xECFE, 0x1103, 0xEDA1, 0xEDFE, 0x1161,
+ 0xEEA1, 0xEEFE, 0x11BF, 0xEFA1, 0xEFFE, 0x121D, 0xF0A1, 0xF0FE, 0x127B,
+ 0xF1A1, 0xF1FE, 0x12D9, 0xF2A1, 0xF2FE, 0x1337, 0xF3A1, 0xF3FE, 0x1395,
+ 0xF4A1, 0xF4FE, 0x13F3, 0xF5A1, 0xF5FE, 0x1451, 0xF6A1, 0xF6FE, 0x14AF,
+ 0xF7A1, 0xF7FE, 0x150D, 0xF8A1, 0xF8FE, 0x156B, 0xF9A1, 0xF9FE, 0x15C9,
+ 0xFAA1, 0xFAFE, 0x1627, 0xFBA1, 0xFBFE, 0x1685, 0xFCA1, 0xFCFE, 0x16E3,
+ 0xFDA1, 0xFDCB, 0x1741,
+};
+extern const unsigned short g_FXCMAP_CNS_EUC_H_0_DWord[238 * 4] = {
+ 0x8EA1, 0xA1A1, 0xA1FE, 0x0063, 0x8EA1, 0xA2A1, 0xA2FE, 0x00C1,
+ 0x8EA1, 0xA3A1, 0xA3CE, 0x011F, 0x8EA1, 0xA4A1, 0xA4FE, 0x014D,
+ 0x8EA1, 0xA5A1, 0xA5EC, 0x01AB, 0x8EA1, 0xA5EE, 0xA5F0, 0x01F7,
+ 0x8EA1, 0xA6A1, 0xA6BE, 0x01FA, 0x8EA1, 0xA7A1, 0xA7A1, 0x0253,
+ 0x8EA1, 0xA7A2, 0xA7A4, 0x0218, 0x8EA1, 0xA7A5, 0xA7A5, 0x0254,
+ 0x8EA1, 0xA7A6, 0xA7A6, 0x021B, 0x8EA1, 0xA7A7, 0xA7A7, 0x025A,
+ 0x8EA1, 0xA7A8, 0xA7A8, 0x021C, 0x8EA1, 0xA7A9, 0xA7AC, 0x025B,
+ 0x8EA1, 0xA7AD, 0xA7AF, 0x021D, 0x8EA1, 0xA7B0, 0xA7B0, 0x025F,
+ 0x8EA1, 0xA7B1, 0xA7B1, 0x176E, 0x8EA1, 0xA7B2, 0xA7B2, 0x0260,
+ 0x8EA1, 0xA7B3, 0xA7B3, 0x0262, 0x8EA1, 0xA7B4, 0xA7B4, 0x0220,
+ 0x8EA1, 0xA7B5, 0xA7B5, 0x0263, 0x8EA1, 0xA7B6, 0xA7B6, 0x176F,
+ 0x8EA1, 0xA7B7, 0xA7B7, 0x0221, 0x8EA1, 0xA7B8, 0xA7B9, 0x0264,
+ 0x8EA1, 0xA7BA, 0xA7BA, 0x0222, 0x8EA1, 0xA7BB, 0xA7BB, 0x1770,
+ 0x8EA1, 0xA7BC, 0xA7BC, 0x0223, 0x8EA1, 0xA7BD, 0xA7BD, 0x0266,
+ 0x8EA1, 0xA7BE, 0xA7BE, 0x0279, 0x8EA1, 0xA7BF, 0xA7BF, 0x1775,
+ 0x8EA1, 0xA7C0, 0xA7C1, 0x027A, 0x8EA1, 0xA7C2, 0xA7C2, 0x0224,
+ 0x8EA1, 0xA7C3, 0xA7C6, 0x027C, 0x8EA1, 0xA7C7, 0xA7C7, 0x0225,
+ 0x8EA1, 0xA7C8, 0xA7CB, 0x0282, 0x8EA1, 0xA7CC, 0xA7CC, 0x1776,
+ 0x8EA1, 0xA7CD, 0xA7CD, 0x0286, 0x8EA1, 0xA7CE, 0xA7CE, 0x0226,
+ 0x8EA1, 0xA7CF, 0xA7D0, 0x0288, 0x8EA1, 0xA7D1, 0xA7D2, 0x028C,
+ 0x8EA1, 0xA7D3, 0xA7D5, 0x0227, 0x8EA1, 0xA7D6, 0xA7D8, 0x028E,
+ 0x8EA1, 0xA7D9, 0xA7DA, 0x022A, 0x8EA1, 0xA7DB, 0xA7DB, 0x1777,
+ 0x8EA1, 0xA7DC, 0xA7DF, 0x02D0, 0x8EA1, 0xA7E0, 0xA7E0, 0x02D5,
+ 0x8EA1, 0xA7E1, 0xA7E1, 0x022C, 0x8EA1, 0xA7E2, 0xA7E5, 0x02D6,
+ 0x8EA1, 0xA7E6, 0xA7E6, 0x022D, 0x8EA1, 0xA7E7, 0xA7ED, 0x02DA,
+ 0x8EA1, 0xA7EE, 0xA7EE, 0x178A, 0x8EA1, 0xA7EF, 0xA7F2, 0x02E1,
+ 0x8EA1, 0xA7F3, 0xA7F3, 0x178C, 0x8EA1, 0xA7F4, 0xA7F8, 0x02E5,
+ 0x8EA1, 0xA7F9, 0xA7F9, 0x178D, 0x8EA1, 0xA7FA, 0xA7FD, 0x02EA,
+ 0x8EA1, 0xA7FE, 0xA7FE, 0x0356, 0x8EA1, 0xA8A1, 0xA8A6, 0x0357,
+ 0x8EA1, 0xA8A7, 0xA8A7, 0x035E, 0x8EA1, 0xA8A8, 0xA8A8, 0x0362,
+ 0x8EA1, 0xA8A9, 0xA8AA, 0x022E, 0x8EA1, 0xA8AB, 0xA8B2, 0x0363,
+ 0x8EA1, 0xA8B3, 0xA8B3, 0x17B2, 0x8EA1, 0xA8B4, 0xA8B6, 0x036B,
+ 0x8EA1, 0xA8B7, 0xA8BA, 0x03F6, 0x8EA1, 0xA8BB, 0xA8BB, 0x1812,
+ 0x8EA1, 0xA8BC, 0xA8BE, 0x03FA, 0x8EA1, 0xA8BF, 0xA8C3, 0x03FE,
+ 0x8EA1, 0xA8C4, 0xA8CC, 0x0405, 0x8EA1, 0xA8CD, 0xA8CD, 0x1813,
+ 0x8EA1, 0xA8CE, 0xA8CE, 0x1818, 0x8EA1, 0xA8CF, 0xA8D2, 0x040F,
+ 0x8EA1, 0xA8D3, 0xA8D3, 0x1819, 0x8EA1, 0xA8D4, 0xA8D9, 0x0508,
+ 0x8EA1, 0xA8DA, 0xA8DA, 0x18E7, 0x8EA1, 0xA8DB, 0xA8E2, 0x050E,
+ 0x8EA1, 0xA8E3, 0xA8E3, 0x0230, 0x8EA1, 0xA8E4, 0xA8E4, 0x051B,
+ 0x8EA1, 0xA8E5, 0xA8E7, 0x0520, 0x8EA1, 0xA8E8, 0xA8EB, 0x0696,
+ 0x8EA1, 0xA8EC, 0xA8EC, 0x0231, 0x8EA1, 0xA8ED, 0xA8F0, 0x069F,
+ 0x8EA1, 0xA8F1, 0xA8FB, 0x0826, 0x8EA1, 0xA8FC, 0xA8FE, 0x09F5,
+ 0x8EA1, 0xA9A1, 0xA9A1, 0x1E33, 0x8EA1, 0xA9A2, 0xA9A2, 0x09F8,
+ 0x8EA1, 0xA9A3, 0xA9A3, 0x1E34, 0x8EA1, 0xA9A4, 0xA9A5, 0x09F9,
+ 0x8EA1, 0xA9A6, 0xA9AB, 0x0BE1, 0x8EA1, 0xA9AC, 0xA9AE, 0x0DBB,
+ 0x8EA1, 0xA9AF, 0xA9AF, 0x2360, 0x8EA1, 0xA9B0, 0xA9B0, 0x2612,
+ 0x8EA1, 0xA9B1, 0xA9B3, 0x0F7B, 0x8EA1, 0xA9B4, 0xA9B5, 0x1100,
+ 0x8EA1, 0xA9B6, 0xA9B6, 0x1289, 0x8EA1, 0xA9B7, 0xA9B8, 0x13B2,
+ 0x8EA1, 0xA9B9, 0xA9B9, 0x2F0D, 0x8EA1, 0xC2A1, 0xC2C1, 0x0232,
+ 0x8EA1, 0xC4A1, 0xC4FE, 0x0253, 0x8EA1, 0xC5A1, 0xC5FE, 0x02B1,
+ 0x8EA1, 0xC6A1, 0xC6FE, 0x030F, 0x8EA1, 0xC7A1, 0xC7FE, 0x036D,
+ 0x8EA1, 0xC8A1, 0xC8FE, 0x03CB, 0x8EA1, 0xC9A1, 0xC9FE, 0x0429,
+ 0x8EA1, 0xCAA1, 0xCAFE, 0x0487, 0x8EA1, 0xCBA1, 0xCBFE, 0x04E5,
+ 0x8EA1, 0xCCA1, 0xCCFE, 0x0543, 0x8EA1, 0xCDA1, 0xCDFE, 0x05A1,
+ 0x8EA1, 0xCEA1, 0xCEFE, 0x05FF, 0x8EA1, 0xCFA1, 0xCFFE, 0x065D,
+ 0x8EA1, 0xD0A1, 0xD0FE, 0x06BB, 0x8EA1, 0xD1A1, 0xD1FE, 0x0719,
+ 0x8EA1, 0xD2A1, 0xD2FE, 0x0777, 0x8EA1, 0xD3A1, 0xD3FE, 0x07D5,
+ 0x8EA1, 0xD4A1, 0xD4FE, 0x0833, 0x8EA1, 0xD5A1, 0xD5FE, 0x0891,
+ 0x8EA1, 0xD6A1, 0xD6FE, 0x08EF, 0x8EA1, 0xD7A1, 0xD7FE, 0x094D,
+ 0x8EA1, 0xD8A1, 0xD8FE, 0x09AB, 0x8EA1, 0xD9A1, 0xD9FE, 0x0A09,
+ 0x8EA1, 0xDAA1, 0xDAFE, 0x0A67, 0x8EA1, 0xDBA1, 0xDBFE, 0x0AC5,
+ 0x8EA1, 0xDCA1, 0xDCFE, 0x0B23, 0x8EA1, 0xDDA1, 0xDDFE, 0x0B81,
+ 0x8EA1, 0xDEA1, 0xDEFE, 0x0BDF, 0x8EA1, 0xDFA1, 0xDFFE, 0x0C3D,
+ 0x8EA1, 0xE0A1, 0xE0FE, 0x0C9B, 0x8EA1, 0xE1A1, 0xE1FE, 0x0CF9,
+ 0x8EA1, 0xE2A1, 0xE2FE, 0x0D57, 0x8EA1, 0xE3A1, 0xE3FE, 0x0DB5,
+ 0x8EA1, 0xE4A1, 0xE4FE, 0x0E13, 0x8EA1, 0xE5A1, 0xE5FE, 0x0E71,
+ 0x8EA1, 0xE6A1, 0xE6FE, 0x0ECF, 0x8EA1, 0xE7A1, 0xE7FE, 0x0F2D,
+ 0x8EA1, 0xE8A1, 0xE8FE, 0x0F8B, 0x8EA1, 0xE9A1, 0xE9FE, 0x0FE9,
+ 0x8EA1, 0xEAA1, 0xEAFE, 0x1047, 0x8EA1, 0xEBA1, 0xEBFE, 0x10A5,
+ 0x8EA1, 0xECA1, 0xECFE, 0x1103, 0x8EA1, 0xEDA1, 0xEDFE, 0x1161,
+ 0x8EA1, 0xEEA1, 0xEEFE, 0x11BF, 0x8EA1, 0xEFA1, 0xEFFE, 0x121D,
+ 0x8EA1, 0xF0A1, 0xF0FE, 0x127B, 0x8EA1, 0xF1A1, 0xF1FE, 0x12D9,
+ 0x8EA1, 0xF2A1, 0xF2FE, 0x1337, 0x8EA1, 0xF3A1, 0xF3FE, 0x1395,
+ 0x8EA1, 0xF4A1, 0xF4FE, 0x13F3, 0x8EA1, 0xF5A1, 0xF5FE, 0x1451,
+ 0x8EA1, 0xF6A1, 0xF6FE, 0x14AF, 0x8EA1, 0xF7A1, 0xF7FE, 0x150D,
+ 0x8EA1, 0xF8A1, 0xF8FE, 0x156B, 0x8EA1, 0xF9A1, 0xF9FE, 0x15C9,
+ 0x8EA1, 0xFAA1, 0xFAFE, 0x1627, 0x8EA1, 0xFBA1, 0xFBFE, 0x1685,
+ 0x8EA1, 0xFCA1, 0xFCFE, 0x16E3, 0x8EA1, 0xFDA1, 0xFDCB, 0x1741,
+ 0x8EA2, 0xA1A1, 0xA1FE, 0x176C, 0x8EA2, 0xA2A1, 0xA2FE, 0x17CA,
+ 0x8EA2, 0xA3A1, 0xA3FE, 0x1828, 0x8EA2, 0xA4A1, 0xA4FE, 0x1886,
+ 0x8EA2, 0xA5A1, 0xA5FE, 0x18E4, 0x8EA2, 0xA6A1, 0xA6FE, 0x1942,
+ 0x8EA2, 0xA7A1, 0xA7FE, 0x19A0, 0x8EA2, 0xA8A1, 0xA8FE, 0x19FE,
+ 0x8EA2, 0xA9A1, 0xA9FE, 0x1A5C, 0x8EA2, 0xAAA1, 0xAAFE, 0x1ABA,
+ 0x8EA2, 0xABA1, 0xABFE, 0x1B18, 0x8EA2, 0xACA1, 0xACFE, 0x1B76,
+ 0x8EA2, 0xADA1, 0xADFE, 0x1BD4, 0x8EA2, 0xAEA1, 0xAEFE, 0x1C32,
+ 0x8EA2, 0xAFA1, 0xAFFE, 0x1C90, 0x8EA2, 0xB0A1, 0xB0FE, 0x1CEE,
+ 0x8EA2, 0xB1A1, 0xB1FE, 0x1D4C, 0x8EA2, 0xB2A1, 0xB2FE, 0x1DAA,
+ 0x8EA2, 0xB3A1, 0xB3FE, 0x1E08, 0x8EA2, 0xB4A1, 0xB4FE, 0x1E66,
+ 0x8EA2, 0xB5A1, 0xB5FE, 0x1EC4, 0x8EA2, 0xB6A1, 0xB6FE, 0x1F22,
+ 0x8EA2, 0xB7A1, 0xB7FE, 0x1F80, 0x8EA2, 0xB8A1, 0xB8FE, 0x1FDE,
+ 0x8EA2, 0xB9A1, 0xB9FE, 0x203C, 0x8EA2, 0xBAA1, 0xBAFE, 0x209A,
+ 0x8EA2, 0xBBA1, 0xBBFE, 0x20F8, 0x8EA2, 0xBCA1, 0xBCFE, 0x2156,
+ 0x8EA2, 0xBDA1, 0xBDFE, 0x21B4, 0x8EA2, 0xBEA1, 0xBEFE, 0x2212,
+ 0x8EA2, 0xBFA1, 0xBFFE, 0x2270, 0x8EA2, 0xC0A1, 0xC0FE, 0x22CE,
+ 0x8EA2, 0xC1A1, 0xC1FE, 0x232C, 0x8EA2, 0xC2A1, 0xC2FE, 0x238A,
+ 0x8EA2, 0xC3A1, 0xC3FE, 0x23E8, 0x8EA2, 0xC4A1, 0xC4FE, 0x2446,
+ 0x8EA2, 0xC5A1, 0xC5FE, 0x24A4, 0x8EA2, 0xC6A1, 0xC6FE, 0x2502,
+ 0x8EA2, 0xC7A1, 0xC7FE, 0x2560, 0x8EA2, 0xC8A1, 0xC8FE, 0x25BE,
+ 0x8EA2, 0xC9A1, 0xC9FE, 0x261C, 0x8EA2, 0xCAA1, 0xCAFE, 0x267A,
+ 0x8EA2, 0xCBA1, 0xCBFE, 0x26D8, 0x8EA2, 0xCCA1, 0xCCFE, 0x2736,
+ 0x8EA2, 0xCDA1, 0xCDFE, 0x2794, 0x8EA2, 0xCEA1, 0xCEFE, 0x27F2,
+ 0x8EA2, 0xCFA1, 0xCFFE, 0x2850, 0x8EA2, 0xD0A1, 0xD0FE, 0x28AE,
+ 0x8EA2, 0xD1A1, 0xD1FE, 0x290C, 0x8EA2, 0xD2A1, 0xD2FE, 0x296A,
+ 0x8EA2, 0xD3A1, 0xD3FE, 0x29C8, 0x8EA2, 0xD4A1, 0xD4FE, 0x2A26,
+ 0x8EA2, 0xD5A1, 0xD5FE, 0x2A84, 0x8EA2, 0xD6A1, 0xD6FE, 0x2AE2,
+ 0x8EA2, 0xD7A1, 0xD7FE, 0x2B40, 0x8EA2, 0xD8A1, 0xD8FE, 0x2B9E,
+ 0x8EA2, 0xD9A1, 0xD9FE, 0x2BFC, 0x8EA2, 0xDAA1, 0xDAFE, 0x2C5A,
+ 0x8EA2, 0xDBA1, 0xDBFE, 0x2CB8, 0x8EA2, 0xDCA1, 0xDCFE, 0x2D16,
+ 0x8EA2, 0xDDA1, 0xDDFE, 0x2D74, 0x8EA2, 0xDEA1, 0xDEFE, 0x2DD2,
+ 0x8EA2, 0xDFA1, 0xDFFE, 0x2E30, 0x8EA2, 0xE0A1, 0xE0FE, 0x2E8E,
+ 0x8EA2, 0xE1A1, 0xE1FE, 0x2EEC, 0x8EA2, 0xE2A1, 0xE2FE, 0x2F4A,
+ 0x8EA2, 0xE3A1, 0xE3FE, 0x2FA8, 0x8EA2, 0xE4A1, 0xE4FE, 0x3006,
+ 0x8EA2, 0xE5A1, 0xE5FE, 0x3064, 0x8EA2, 0xE6A1, 0xE6FE, 0x30C2,
+ 0x8EA2, 0xE7A1, 0xE7FE, 0x3120, 0x8EA2, 0xE8A1, 0xE8FE, 0x317E,
+ 0x8EA2, 0xE9A1, 0xE9FE, 0x31DC, 0x8EA2, 0xEAA1, 0xEAFE, 0x323A,
+ 0x8EA2, 0xEBA1, 0xEBFE, 0x3298, 0x8EA2, 0xECA1, 0xECFE, 0x32F6,
+ 0x8EA2, 0xEDA1, 0xEDFE, 0x3354, 0x8EA2, 0xEEA1, 0xEEFE, 0x33B2,
+ 0x8EA2, 0xEFA1, 0xEFFE, 0x3410, 0x8EA2, 0xF0A1, 0xF0FE, 0x346E,
+ 0x8EA2, 0xF1A1, 0xF1FE, 0x34CC, 0x8EA2, 0xF2A1, 0xF2C4, 0x352A,
+};
diff --git a/core/src/fpdfapi/fpdf_cmaps/CNS1/CNS-EUC-V_0.cpp b/core/src/fpdfapi/fpdf_cmaps/CNS1/CNS-EUC-V_0.cpp
index 8737cf4c90..eb773a7a93 100644
--- a/core/src/fpdfapi/fpdf_cmaps/CNS1/CNS-EUC-V_0.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/CNS1/CNS-EUC-V_0.cpp
@@ -1,201 +1,201 @@
-// 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
-
-extern const unsigned short g_FXCMAP_CNS_EUC_V_0[180 * 3] = {
- 0x0020, 0x007E, 0x3550, 0xA1A1, 0xA1AB, 0x0063, 0xA1AC, 0xA1AC, 0x354E,
- 0xA1AD, 0xA1BA, 0x006F, 0xA1BB, 0xA1BB, 0x007C, 0xA1BC, 0xA1BC, 0x007E,
- 0xA1BD, 0xA1BD, 0x007E, 0xA1BE, 0xA1BF, 0x0082, 0xA1C0, 0xA1C1, 0x0082,
- 0xA1C2, 0xA1C3, 0x0086, 0xA1C4, 0xA1C5, 0x0086, 0xA1C6, 0xA1C7, 0x008A,
- 0xA1C8, 0xA1C9, 0x008A, 0xA1CA, 0xA1CB, 0x008E, 0xA1CC, 0xA1CD, 0x008E,
- 0xA1CE, 0xA1CF, 0x0092, 0xA1D0, 0xA1D1, 0x0092, 0xA1D2, 0xA1D3, 0x0096,
- 0xA1D4, 0xA1D5, 0x0096, 0xA1D6, 0xA1D7, 0x009A, 0xA1D8, 0xA1D9, 0x009A,
- 0xA1DA, 0xA1DB, 0x009E, 0xA1DC, 0xA1FE, 0x009E, 0xA2A1, 0xA2C3, 0x00C1,
- 0xA2C4, 0xA2C4, 0x354F, 0xA2C5, 0xA2FE, 0x00E5, 0xA3A1, 0xA3CE, 0x011F,
- 0xA4A1, 0xA4FE, 0x014D, 0xA5A1, 0xA5EC, 0x01AB, 0xA5EE, 0xA5F0, 0x01F7,
- 0xA6A1, 0xA6BE, 0x01FA, 0xA7A1, 0xA7A1, 0x0253, 0xA7A2, 0xA7A4, 0x0218,
- 0xA7A5, 0xA7A5, 0x0254, 0xA7A6, 0xA7A6, 0x021B, 0xA7A7, 0xA7A7, 0x025A,
- 0xA7A8, 0xA7A8, 0x021C, 0xA7A9, 0xA7AC, 0x025B, 0xA7AD, 0xA7AF, 0x021D,
- 0xA7B0, 0xA7B0, 0x025F, 0xA7B1, 0xA7B1, 0x176E, 0xA7B2, 0xA7B2, 0x0260,
- 0xA7B3, 0xA7B3, 0x0262, 0xA7B4, 0xA7B4, 0x0220, 0xA7B5, 0xA7B5, 0x0263,
- 0xA7B6, 0xA7B6, 0x176F, 0xA7B7, 0xA7B7, 0x0221, 0xA7B8, 0xA7B9, 0x0264,
- 0xA7BA, 0xA7BA, 0x0222, 0xA7BB, 0xA7BB, 0x1770, 0xA7BC, 0xA7BC, 0x0223,
- 0xA7BD, 0xA7BD, 0x0266, 0xA7BE, 0xA7BE, 0x0279, 0xA7BF, 0xA7BF, 0x1775,
- 0xA7C0, 0xA7C1, 0x027A, 0xA7C2, 0xA7C2, 0x0224, 0xA7C3, 0xA7C6, 0x027C,
- 0xA7C7, 0xA7C7, 0x0225, 0xA7C8, 0xA7CB, 0x0282, 0xA7CC, 0xA7CC, 0x1776,
- 0xA7CD, 0xA7CD, 0x0286, 0xA7CE, 0xA7CE, 0x0226, 0xA7CF, 0xA7D0, 0x0288,
- 0xA7D1, 0xA7D2, 0x028C, 0xA7D3, 0xA7D5, 0x0227, 0xA7D6, 0xA7D8, 0x028E,
- 0xA7D9, 0xA7DA, 0x022A, 0xA7DB, 0xA7DB, 0x1777, 0xA7DC, 0xA7DF, 0x02D0,
- 0xA7E0, 0xA7E0, 0x02D5, 0xA7E1, 0xA7E1, 0x022C, 0xA7E2, 0xA7E5, 0x02D6,
- 0xA7E6, 0xA7E6, 0x022D, 0xA7E7, 0xA7ED, 0x02DA, 0xA7EE, 0xA7EE, 0x178A,
- 0xA7EF, 0xA7F2, 0x02E1, 0xA7F3, 0xA7F3, 0x178C, 0xA7F4, 0xA7F8, 0x02E5,
- 0xA7F9, 0xA7F9, 0x178D, 0xA7FA, 0xA7FD, 0x02EA, 0xA7FE, 0xA7FE, 0x0356,
- 0xA8A1, 0xA8A6, 0x0357, 0xA8A7, 0xA8A7, 0x035E, 0xA8A8, 0xA8A8, 0x0362,
- 0xA8A9, 0xA8AA, 0x022E, 0xA8AB, 0xA8B2, 0x0363, 0xA8B3, 0xA8B3, 0x17B2,
- 0xA8B4, 0xA8B6, 0x036B, 0xA8B7, 0xA8BA, 0x03F6, 0xA8BB, 0xA8BB, 0x1812,
- 0xA8BC, 0xA8BE, 0x03FA, 0xA8BF, 0xA8C3, 0x03FE, 0xA8C4, 0xA8CC, 0x0405,
- 0xA8CD, 0xA8CD, 0x1813, 0xA8CE, 0xA8CE, 0x1818, 0xA8CF, 0xA8D2, 0x040F,
- 0xA8D3, 0xA8D3, 0x1819, 0xA8D4, 0xA8D9, 0x0508, 0xA8DA, 0xA8DA, 0x18E7,
- 0xA8DB, 0xA8E2, 0x050E, 0xA8E3, 0xA8E3, 0x0230, 0xA8E4, 0xA8E4, 0x051B,
- 0xA8E5, 0xA8E7, 0x0520, 0xA8E8, 0xA8EB, 0x0696, 0xA8EC, 0xA8EC, 0x0231,
- 0xA8ED, 0xA8F0, 0x069F, 0xA8F1, 0xA8FB, 0x0826, 0xA8FC, 0xA8FE, 0x09F5,
- 0xA9A1, 0xA9A1, 0x1E33, 0xA9A2, 0xA9A2, 0x09F8, 0xA9A3, 0xA9A3, 0x1E34,
- 0xA9A4, 0xA9A5, 0x09F9, 0xA9A6, 0xA9AB, 0x0BE1, 0xA9AC, 0xA9AE, 0x0DBB,
- 0xA9AF, 0xA9AF, 0x2360, 0xA9B0, 0xA9B0, 0x2612, 0xA9B1, 0xA9B3, 0x0F7B,
- 0xA9B4, 0xA9B5, 0x1100, 0xA9B6, 0xA9B6, 0x1289, 0xA9B7, 0xA9B8, 0x13B2,
- 0xA9B9, 0xA9B9, 0x2F0D, 0xC2A1, 0xC2C1, 0x0232, 0xC4A1, 0xC4FE, 0x0253,
- 0xC5A1, 0xC5FE, 0x02B1, 0xC6A1, 0xC6FE, 0x030F, 0xC7A1, 0xC7FE, 0x036D,
- 0xC8A1, 0xC8FE, 0x03CB, 0xC9A1, 0xC9FE, 0x0429, 0xCAA1, 0xCAFE, 0x0487,
- 0xCBA1, 0xCBFE, 0x04E5, 0xCCA1, 0xCCFE, 0x0543, 0xCDA1, 0xCDFE, 0x05A1,
- 0xCEA1, 0xCEFE, 0x05FF, 0xCFA1, 0xCFFE, 0x065D, 0xD0A1, 0xD0FE, 0x06BB,
- 0xD1A1, 0xD1FE, 0x0719, 0xD2A1, 0xD2FE, 0x0777, 0xD3A1, 0xD3FE, 0x07D5,
- 0xD4A1, 0xD4FE, 0x0833, 0xD5A1, 0xD5FE, 0x0891, 0xD6A1, 0xD6FE, 0x08EF,
- 0xD7A1, 0xD7FE, 0x094D, 0xD8A1, 0xD8FE, 0x09AB, 0xD9A1, 0xD9FE, 0x0A09,
- 0xDAA1, 0xDAFE, 0x0A67, 0xDBA1, 0xDBFE, 0x0AC5, 0xDCA1, 0xDCFE, 0x0B23,
- 0xDDA1, 0xDDFE, 0x0B81, 0xDEA1, 0xDEFE, 0x0BDF, 0xDFA1, 0xDFFE, 0x0C3D,
- 0xE0A1, 0xE0FE, 0x0C9B, 0xE1A1, 0xE1FE, 0x0CF9, 0xE2A1, 0xE2FE, 0x0D57,
- 0xE3A1, 0xE3FE, 0x0DB5, 0xE4A1, 0xE4FE, 0x0E13, 0xE5A1, 0xE5FE, 0x0E71,
- 0xE6A1, 0xE6FE, 0x0ECF, 0xE7A1, 0xE7FE, 0x0F2D, 0xE8A1, 0xE8FE, 0x0F8B,
- 0xE9A1, 0xE9FE, 0x0FE9, 0xEAA1, 0xEAFE, 0x1047, 0xEBA1, 0xEBFE, 0x10A5,
- 0xECA1, 0xECFE, 0x1103, 0xEDA1, 0xEDFE, 0x1161, 0xEEA1, 0xEEFE, 0x11BF,
- 0xEFA1, 0xEFFE, 0x121D, 0xF0A1, 0xF0FE, 0x127B, 0xF1A1, 0xF1FE, 0x12D9,
- 0xF2A1, 0xF2FE, 0x1337, 0xF3A1, 0xF3FE, 0x1395, 0xF4A1, 0xF4FE, 0x13F3,
- 0xF5A1, 0xF5FE, 0x1451, 0xF6A1, 0xF6FE, 0x14AF, 0xF7A1, 0xF7FE, 0x150D,
- 0xF8A1, 0xF8FE, 0x156B, 0xF9A1, 0xF9FE, 0x15C9, 0xFAA1, 0xFAFE, 0x1627,
- 0xFBA1, 0xFBFE, 0x1685, 0xFCA1, 0xFCFE, 0x16E3, 0xFDA1, 0xFDCB, 0x1741,
-};
-extern const unsigned short g_FXCMAP_CNS_EUC_V_0_DWord[261 * 4] = {
- 0x8EA1, 0xA1A1, 0xA1AB, 0x0063, 0x8EA1, 0xA1AC, 0xA1AC, 0x354E,
- 0x8EA1, 0xA1AD, 0xA1BA, 0x006F, 0x8EA1, 0xA1BB, 0xA1BB, 0x007C,
- 0x8EA1, 0xA1BC, 0xA1BC, 0x007E, 0x8EA1, 0xA1BD, 0xA1BD, 0x007E,
- 0x8EA1, 0xA1BE, 0xA1BF, 0x0082, 0x8EA1, 0xA1C0, 0xA1C1, 0x0082,
- 0x8EA1, 0xA1C2, 0xA1C3, 0x0086, 0x8EA1, 0xA1C4, 0xA1C5, 0x0086,
- 0x8EA1, 0xA1C6, 0xA1C7, 0x008A, 0x8EA1, 0xA1C8, 0xA1C9, 0x008A,
- 0x8EA1, 0xA1CA, 0xA1CB, 0x008E, 0x8EA1, 0xA1CC, 0xA1CD, 0x008E,
- 0x8EA1, 0xA1CE, 0xA1CF, 0x0092, 0x8EA1, 0xA1D0, 0xA1D1, 0x0092,
- 0x8EA1, 0xA1D2, 0xA1D3, 0x0096, 0x8EA1, 0xA1D4, 0xA1D5, 0x0096,
- 0x8EA1, 0xA1D6, 0xA1D7, 0x009A, 0x8EA1, 0xA1D8, 0xA1D9, 0x009A,
- 0x8EA1, 0xA1DA, 0xA1DB, 0x009E, 0x8EA1, 0xA1DC, 0xA1FE, 0x009E,
- 0x8EA1, 0xA2A1, 0xA2C3, 0x00C1, 0x8EA1, 0xA2C4, 0xA2C4, 0x354F,
- 0x8EA1, 0xA2C5, 0xA2FE, 0x00E5, 0x8EA1, 0xA3A1, 0xA3CE, 0x011F,
- 0x8EA1, 0xA4A1, 0xA4FE, 0x014D, 0x8EA1, 0xA5A1, 0xA5EC, 0x01AB,
- 0x8EA1, 0xA5EE, 0xA5F0, 0x01F7, 0x8EA1, 0xA6A1, 0xA6BE, 0x01FA,
- 0x8EA1, 0xA7A1, 0xA7A1, 0x0253, 0x8EA1, 0xA7A2, 0xA7A4, 0x0218,
- 0x8EA1, 0xA7A5, 0xA7A5, 0x0254, 0x8EA1, 0xA7A6, 0xA7A6, 0x021B,
- 0x8EA1, 0xA7A7, 0xA7A7, 0x025A, 0x8EA1, 0xA7A8, 0xA7A8, 0x021C,
- 0x8EA1, 0xA7A9, 0xA7AC, 0x025B, 0x8EA1, 0xA7AD, 0xA7AF, 0x021D,
- 0x8EA1, 0xA7B0, 0xA7B0, 0x025F, 0x8EA1, 0xA7B1, 0xA7B1, 0x176E,
- 0x8EA1, 0xA7B2, 0xA7B2, 0x0260, 0x8EA1, 0xA7B3, 0xA7B3, 0x0262,
- 0x8EA1, 0xA7B4, 0xA7B4, 0x0220, 0x8EA1, 0xA7B5, 0xA7B5, 0x0263,
- 0x8EA1, 0xA7B6, 0xA7B6, 0x176F, 0x8EA1, 0xA7B7, 0xA7B7, 0x0221,
- 0x8EA1, 0xA7B8, 0xA7B9, 0x0264, 0x8EA1, 0xA7BA, 0xA7BA, 0x0222,
- 0x8EA1, 0xA7BB, 0xA7BB, 0x1770, 0x8EA1, 0xA7BC, 0xA7BC, 0x0223,
- 0x8EA1, 0xA7BD, 0xA7BD, 0x0266, 0x8EA1, 0xA7BE, 0xA7BE, 0x0279,
- 0x8EA1, 0xA7BF, 0xA7BF, 0x1775, 0x8EA1, 0xA7C0, 0xA7C1, 0x027A,
- 0x8EA1, 0xA7C2, 0xA7C2, 0x0224, 0x8EA1, 0xA7C3, 0xA7C6, 0x027C,
- 0x8EA1, 0xA7C7, 0xA7C7, 0x0225, 0x8EA1, 0xA7C8, 0xA7CB, 0x0282,
- 0x8EA1, 0xA7CC, 0xA7CC, 0x1776, 0x8EA1, 0xA7CD, 0xA7CD, 0x0286,
- 0x8EA1, 0xA7CE, 0xA7CE, 0x0226, 0x8EA1, 0xA7CF, 0xA7D0, 0x0288,
- 0x8EA1, 0xA7D1, 0xA7D2, 0x028C, 0x8EA1, 0xA7D3, 0xA7D5, 0x0227,
- 0x8EA1, 0xA7D6, 0xA7D8, 0x028E, 0x8EA1, 0xA7D9, 0xA7DA, 0x022A,
- 0x8EA1, 0xA7DB, 0xA7DB, 0x1777, 0x8EA1, 0xA7DC, 0xA7DF, 0x02D0,
- 0x8EA1, 0xA7E0, 0xA7E0, 0x02D5, 0x8EA1, 0xA7E1, 0xA7E1, 0x022C,
- 0x8EA1, 0xA7E2, 0xA7E5, 0x02D6, 0x8EA1, 0xA7E6, 0xA7E6, 0x022D,
- 0x8EA1, 0xA7E7, 0xA7ED, 0x02DA, 0x8EA1, 0xA7EE, 0xA7EE, 0x178A,
- 0x8EA1, 0xA7EF, 0xA7F2, 0x02E1, 0x8EA1, 0xA7F3, 0xA7F3, 0x178C,
- 0x8EA1, 0xA7F4, 0xA7F8, 0x02E5, 0x8EA1, 0xA7F9, 0xA7F9, 0x178D,
- 0x8EA1, 0xA7FA, 0xA7FD, 0x02EA, 0x8EA1, 0xA7FE, 0xA7FE, 0x0356,
- 0x8EA1, 0xA8A1, 0xA8A6, 0x0357, 0x8EA1, 0xA8A7, 0xA8A7, 0x035E,
- 0x8EA1, 0xA8A8, 0xA8A8, 0x0362, 0x8EA1, 0xA8A9, 0xA8AA, 0x022E,
- 0x8EA1, 0xA8AB, 0xA8B2, 0x0363, 0x8EA1, 0xA8B3, 0xA8B3, 0x17B2,
- 0x8EA1, 0xA8B4, 0xA8B6, 0x036B, 0x8EA1, 0xA8B7, 0xA8BA, 0x03F6,
- 0x8EA1, 0xA8BB, 0xA8BB, 0x1812, 0x8EA1, 0xA8BC, 0xA8BE, 0x03FA,
- 0x8EA1, 0xA8BF, 0xA8C3, 0x03FE, 0x8EA1, 0xA8C4, 0xA8CC, 0x0405,
- 0x8EA1, 0xA8CD, 0xA8CD, 0x1813, 0x8EA1, 0xA8CE, 0xA8CE, 0x1818,
- 0x8EA1, 0xA8CF, 0xA8D2, 0x040F, 0x8EA1, 0xA8D3, 0xA8D3, 0x1819,
- 0x8EA1, 0xA8D4, 0xA8D9, 0x0508, 0x8EA1, 0xA8DA, 0xA8DA, 0x18E7,
- 0x8EA1, 0xA8DB, 0xA8E2, 0x050E, 0x8EA1, 0xA8E3, 0xA8E3, 0x0230,
- 0x8EA1, 0xA8E4, 0xA8E4, 0x051B, 0x8EA1, 0xA8E5, 0xA8E7, 0x0520,
- 0x8EA1, 0xA8E8, 0xA8EB, 0x0696, 0x8EA1, 0xA8EC, 0xA8EC, 0x0231,
- 0x8EA1, 0xA8ED, 0xA8F0, 0x069F, 0x8EA1, 0xA8F1, 0xA8FB, 0x0826,
- 0x8EA1, 0xA8FC, 0xA8FE, 0x09F5, 0x8EA1, 0xA9A1, 0xA9A1, 0x1E33,
- 0x8EA1, 0xA9A2, 0xA9A2, 0x09F8, 0x8EA1, 0xA9A3, 0xA9A3, 0x1E34,
- 0x8EA1, 0xA9A4, 0xA9A5, 0x09F9, 0x8EA1, 0xA9A6, 0xA9AB, 0x0BE1,
- 0x8EA1, 0xA9AC, 0xA9AE, 0x0DBB, 0x8EA1, 0xA9AF, 0xA9AF, 0x2360,
- 0x8EA1, 0xA9B0, 0xA9B0, 0x2612, 0x8EA1, 0xA9B1, 0xA9B3, 0x0F7B,
- 0x8EA1, 0xA9B4, 0xA9B5, 0x1100, 0x8EA1, 0xA9B6, 0xA9B6, 0x1289,
- 0x8EA1, 0xA9B7, 0xA9B8, 0x13B2, 0x8EA1, 0xA9B9, 0xA9B9, 0x2F0D,
- 0x8EA1, 0xC2A1, 0xC2C1, 0x0232, 0x8EA1, 0xC4A1, 0xC4FE, 0x0253,
- 0x8EA1, 0xC5A1, 0xC5FE, 0x02B1, 0x8EA1, 0xC6A1, 0xC6FE, 0x030F,
- 0x8EA1, 0xC7A1, 0xC7FE, 0x036D, 0x8EA1, 0xC8A1, 0xC8FE, 0x03CB,
- 0x8EA1, 0xC9A1, 0xC9FE, 0x0429, 0x8EA1, 0xCAA1, 0xCAFE, 0x0487,
- 0x8EA1, 0xCBA1, 0xCBFE, 0x04E5, 0x8EA1, 0xCCA1, 0xCCFE, 0x0543,
- 0x8EA1, 0xCDA1, 0xCDFE, 0x05A1, 0x8EA1, 0xCEA1, 0xCEFE, 0x05FF,
- 0x8EA1, 0xCFA1, 0xCFFE, 0x065D, 0x8EA1, 0xD0A1, 0xD0FE, 0x06BB,
- 0x8EA1, 0xD1A1, 0xD1FE, 0x0719, 0x8EA1, 0xD2A1, 0xD2FE, 0x0777,
- 0x8EA1, 0xD3A1, 0xD3FE, 0x07D5, 0x8EA1, 0xD4A1, 0xD4FE, 0x0833,
- 0x8EA1, 0xD5A1, 0xD5FE, 0x0891, 0x8EA1, 0xD6A1, 0xD6FE, 0x08EF,
- 0x8EA1, 0xD7A1, 0xD7FE, 0x094D, 0x8EA1, 0xD8A1, 0xD8FE, 0x09AB,
- 0x8EA1, 0xD9A1, 0xD9FE, 0x0A09, 0x8EA1, 0xDAA1, 0xDAFE, 0x0A67,
- 0x8EA1, 0xDBA1, 0xDBFE, 0x0AC5, 0x8EA1, 0xDCA1, 0xDCFE, 0x0B23,
- 0x8EA1, 0xDDA1, 0xDDFE, 0x0B81, 0x8EA1, 0xDEA1, 0xDEFE, 0x0BDF,
- 0x8EA1, 0xDFA1, 0xDFFE, 0x0C3D, 0x8EA1, 0xE0A1, 0xE0FE, 0x0C9B,
- 0x8EA1, 0xE1A1, 0xE1FE, 0x0CF9, 0x8EA1, 0xE2A1, 0xE2FE, 0x0D57,
- 0x8EA1, 0xE3A1, 0xE3FE, 0x0DB5, 0x8EA1, 0xE4A1, 0xE4FE, 0x0E13,
- 0x8EA1, 0xE5A1, 0xE5FE, 0x0E71, 0x8EA1, 0xE6A1, 0xE6FE, 0x0ECF,
- 0x8EA1, 0xE7A1, 0xE7FE, 0x0F2D, 0x8EA1, 0xE8A1, 0xE8FE, 0x0F8B,
- 0x8EA1, 0xE9A1, 0xE9FE, 0x0FE9, 0x8EA1, 0xEAA1, 0xEAFE, 0x1047,
- 0x8EA1, 0xEBA1, 0xEBFE, 0x10A5, 0x8EA1, 0xECA1, 0xECFE, 0x1103,
- 0x8EA1, 0xEDA1, 0xEDFE, 0x1161, 0x8EA1, 0xEEA1, 0xEEFE, 0x11BF,
- 0x8EA1, 0xEFA1, 0xEFFE, 0x121D, 0x8EA1, 0xF0A1, 0xF0FE, 0x127B,
- 0x8EA1, 0xF1A1, 0xF1FE, 0x12D9, 0x8EA1, 0xF2A1, 0xF2FE, 0x1337,
- 0x8EA1, 0xF3A1, 0xF3FE, 0x1395, 0x8EA1, 0xF4A1, 0xF4FE, 0x13F3,
- 0x8EA1, 0xF5A1, 0xF5FE, 0x1451, 0x8EA1, 0xF6A1, 0xF6FE, 0x14AF,
- 0x8EA1, 0xF7A1, 0xF7FE, 0x150D, 0x8EA1, 0xF8A1, 0xF8FE, 0x156B,
- 0x8EA1, 0xF9A1, 0xF9FE, 0x15C9, 0x8EA1, 0xFAA1, 0xFAFE, 0x1627,
- 0x8EA1, 0xFBA1, 0xFBFE, 0x1685, 0x8EA1, 0xFCA1, 0xFCFE, 0x16E3,
- 0x8EA1, 0xFDA1, 0xFDCB, 0x1741, 0x8EA2, 0xA1A1, 0xA1FE, 0x176C,
- 0x8EA2, 0xA2A1, 0xA2FE, 0x17CA, 0x8EA2, 0xA3A1, 0xA3FE, 0x1828,
- 0x8EA2, 0xA4A1, 0xA4FE, 0x1886, 0x8EA2, 0xA5A1, 0xA5FE, 0x18E4,
- 0x8EA2, 0xA6A1, 0xA6FE, 0x1942, 0x8EA2, 0xA7A1, 0xA7FE, 0x19A0,
- 0x8EA2, 0xA8A1, 0xA8FE, 0x19FE, 0x8EA2, 0xA9A1, 0xA9FE, 0x1A5C,
- 0x8EA2, 0xAAA1, 0xAAFE, 0x1ABA, 0x8EA2, 0xABA1, 0xABFE, 0x1B18,
- 0x8EA2, 0xACA1, 0xACFE, 0x1B76, 0x8EA2, 0xADA1, 0xADFE, 0x1BD4,
- 0x8EA2, 0xAEA1, 0xAEFE, 0x1C32, 0x8EA2, 0xAFA1, 0xAFFE, 0x1C90,
- 0x8EA2, 0xB0A1, 0xB0FE, 0x1CEE, 0x8EA2, 0xB1A1, 0xB1FE, 0x1D4C,
- 0x8EA2, 0xB2A1, 0xB2FE, 0x1DAA, 0x8EA2, 0xB3A1, 0xB3FE, 0x1E08,
- 0x8EA2, 0xB4A1, 0xB4FE, 0x1E66, 0x8EA2, 0xB5A1, 0xB5FE, 0x1EC4,
- 0x8EA2, 0xB6A1, 0xB6FE, 0x1F22, 0x8EA2, 0xB7A1, 0xB7FE, 0x1F80,
- 0x8EA2, 0xB8A1, 0xB8FE, 0x1FDE, 0x8EA2, 0xB9A1, 0xB9FE, 0x203C,
- 0x8EA2, 0xBAA1, 0xBAFE, 0x209A, 0x8EA2, 0xBBA1, 0xBBFE, 0x20F8,
- 0x8EA2, 0xBCA1, 0xBCFE, 0x2156, 0x8EA2, 0xBDA1, 0xBDFE, 0x21B4,
- 0x8EA2, 0xBEA1, 0xBEFE, 0x2212, 0x8EA2, 0xBFA1, 0xBFFE, 0x2270,
- 0x8EA2, 0xC0A1, 0xC0FE, 0x22CE, 0x8EA2, 0xC1A1, 0xC1FE, 0x232C,
- 0x8EA2, 0xC2A1, 0xC2FE, 0x238A, 0x8EA2, 0xC3A1, 0xC3FE, 0x23E8,
- 0x8EA2, 0xC4A1, 0xC4FE, 0x2446, 0x8EA2, 0xC5A1, 0xC5FE, 0x24A4,
- 0x8EA2, 0xC6A1, 0xC6FE, 0x2502, 0x8EA2, 0xC7A1, 0xC7FE, 0x2560,
- 0x8EA2, 0xC8A1, 0xC8FE, 0x25BE, 0x8EA2, 0xC9A1, 0xC9FE, 0x261C,
- 0x8EA2, 0xCAA1, 0xCAFE, 0x267A, 0x8EA2, 0xCBA1, 0xCBFE, 0x26D8,
- 0x8EA2, 0xCCA1, 0xCCFE, 0x2736, 0x8EA2, 0xCDA1, 0xCDFE, 0x2794,
- 0x8EA2, 0xCEA1, 0xCEFE, 0x27F2, 0x8EA2, 0xCFA1, 0xCFFE, 0x2850,
- 0x8EA2, 0xD0A1, 0xD0FE, 0x28AE, 0x8EA2, 0xD1A1, 0xD1FE, 0x290C,
- 0x8EA2, 0xD2A1, 0xD2FE, 0x296A, 0x8EA2, 0xD3A1, 0xD3FE, 0x29C8,
- 0x8EA2, 0xD4A1, 0xD4FE, 0x2A26, 0x8EA2, 0xD5A1, 0xD5FE, 0x2A84,
- 0x8EA2, 0xD6A1, 0xD6FE, 0x2AE2, 0x8EA2, 0xD7A1, 0xD7FE, 0x2B40,
- 0x8EA2, 0xD8A1, 0xD8FE, 0x2B9E, 0x8EA2, 0xD9A1, 0xD9FE, 0x2BFC,
- 0x8EA2, 0xDAA1, 0xDAFE, 0x2C5A, 0x8EA2, 0xDBA1, 0xDBFE, 0x2CB8,
- 0x8EA2, 0xDCA1, 0xDCFE, 0x2D16, 0x8EA2, 0xDDA1, 0xDDFE, 0x2D74,
- 0x8EA2, 0xDEA1, 0xDEFE, 0x2DD2, 0x8EA2, 0xDFA1, 0xDFFE, 0x2E30,
- 0x8EA2, 0xE0A1, 0xE0FE, 0x2E8E, 0x8EA2, 0xE1A1, 0xE1FE, 0x2EEC,
- 0x8EA2, 0xE2A1, 0xE2FE, 0x2F4A, 0x8EA2, 0xE3A1, 0xE3FE, 0x2FA8,
- 0x8EA2, 0xE4A1, 0xE4FE, 0x3006, 0x8EA2, 0xE5A1, 0xE5FE, 0x3064,
- 0x8EA2, 0xE6A1, 0xE6FE, 0x30C2, 0x8EA2, 0xE7A1, 0xE7FE, 0x3120,
- 0x8EA2, 0xE8A1, 0xE8FE, 0x317E, 0x8EA2, 0xE9A1, 0xE9FE, 0x31DC,
- 0x8EA2, 0xEAA1, 0xEAFE, 0x323A, 0x8EA2, 0xEBA1, 0xEBFE, 0x3298,
- 0x8EA2, 0xECA1, 0xECFE, 0x32F6, 0x8EA2, 0xEDA1, 0xEDFE, 0x3354,
- 0x8EA2, 0xEEA1, 0xEEFE, 0x33B2, 0x8EA2, 0xEFA1, 0xEFFE, 0x3410,
- 0x8EA2, 0xF0A1, 0xF0FE, 0x346E, 0x8EA2, 0xF1A1, 0xF1FE, 0x34CC,
- 0x8EA2, 0xF2A1, 0xF2C4, 0x352A,
-};
+// 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
+
+extern const unsigned short g_FXCMAP_CNS_EUC_V_0[180 * 3] = {
+ 0x0020, 0x007E, 0x3550, 0xA1A1, 0xA1AB, 0x0063, 0xA1AC, 0xA1AC, 0x354E,
+ 0xA1AD, 0xA1BA, 0x006F, 0xA1BB, 0xA1BB, 0x007C, 0xA1BC, 0xA1BC, 0x007E,
+ 0xA1BD, 0xA1BD, 0x007E, 0xA1BE, 0xA1BF, 0x0082, 0xA1C0, 0xA1C1, 0x0082,
+ 0xA1C2, 0xA1C3, 0x0086, 0xA1C4, 0xA1C5, 0x0086, 0xA1C6, 0xA1C7, 0x008A,
+ 0xA1C8, 0xA1C9, 0x008A, 0xA1CA, 0xA1CB, 0x008E, 0xA1CC, 0xA1CD, 0x008E,
+ 0xA1CE, 0xA1CF, 0x0092, 0xA1D0, 0xA1D1, 0x0092, 0xA1D2, 0xA1D3, 0x0096,
+ 0xA1D4, 0xA1D5, 0x0096, 0xA1D6, 0xA1D7, 0x009A, 0xA1D8, 0xA1D9, 0x009A,
+ 0xA1DA, 0xA1DB, 0x009E, 0xA1DC, 0xA1FE, 0x009E, 0xA2A1, 0xA2C3, 0x00C1,
+ 0xA2C4, 0xA2C4, 0x354F, 0xA2C5, 0xA2FE, 0x00E5, 0xA3A1, 0xA3CE, 0x011F,
+ 0xA4A1, 0xA4FE, 0x014D, 0xA5A1, 0xA5EC, 0x01AB, 0xA5EE, 0xA5F0, 0x01F7,
+ 0xA6A1, 0xA6BE, 0x01FA, 0xA7A1, 0xA7A1, 0x0253, 0xA7A2, 0xA7A4, 0x0218,
+ 0xA7A5, 0xA7A5, 0x0254, 0xA7A6, 0xA7A6, 0x021B, 0xA7A7, 0xA7A7, 0x025A,
+ 0xA7A8, 0xA7A8, 0x021C, 0xA7A9, 0xA7AC, 0x025B, 0xA7AD, 0xA7AF, 0x021D,
+ 0xA7B0, 0xA7B0, 0x025F, 0xA7B1, 0xA7B1, 0x176E, 0xA7B2, 0xA7B2, 0x0260,
+ 0xA7B3, 0xA7B3, 0x0262, 0xA7B4, 0xA7B4, 0x0220, 0xA7B5, 0xA7B5, 0x0263,
+ 0xA7B6, 0xA7B6, 0x176F, 0xA7B7, 0xA7B7, 0x0221, 0xA7B8, 0xA7B9, 0x0264,
+ 0xA7BA, 0xA7BA, 0x0222, 0xA7BB, 0xA7BB, 0x1770, 0xA7BC, 0xA7BC, 0x0223,
+ 0xA7BD, 0xA7BD, 0x0266, 0xA7BE, 0xA7BE, 0x0279, 0xA7BF, 0xA7BF, 0x1775,
+ 0xA7C0, 0xA7C1, 0x027A, 0xA7C2, 0xA7C2, 0x0224, 0xA7C3, 0xA7C6, 0x027C,
+ 0xA7C7, 0xA7C7, 0x0225, 0xA7C8, 0xA7CB, 0x0282, 0xA7CC, 0xA7CC, 0x1776,
+ 0xA7CD, 0xA7CD, 0x0286, 0xA7CE, 0xA7CE, 0x0226, 0xA7CF, 0xA7D0, 0x0288,
+ 0xA7D1, 0xA7D2, 0x028C, 0xA7D3, 0xA7D5, 0x0227, 0xA7D6, 0xA7D8, 0x028E,
+ 0xA7D9, 0xA7DA, 0x022A, 0xA7DB, 0xA7DB, 0x1777, 0xA7DC, 0xA7DF, 0x02D0,
+ 0xA7E0, 0xA7E0, 0x02D5, 0xA7E1, 0xA7E1, 0x022C, 0xA7E2, 0xA7E5, 0x02D6,
+ 0xA7E6, 0xA7E6, 0x022D, 0xA7E7, 0xA7ED, 0x02DA, 0xA7EE, 0xA7EE, 0x178A,
+ 0xA7EF, 0xA7F2, 0x02E1, 0xA7F3, 0xA7F3, 0x178C, 0xA7F4, 0xA7F8, 0x02E5,
+ 0xA7F9, 0xA7F9, 0x178D, 0xA7FA, 0xA7FD, 0x02EA, 0xA7FE, 0xA7FE, 0x0356,
+ 0xA8A1, 0xA8A6, 0x0357, 0xA8A7, 0xA8A7, 0x035E, 0xA8A8, 0xA8A8, 0x0362,
+ 0xA8A9, 0xA8AA, 0x022E, 0xA8AB, 0xA8B2, 0x0363, 0xA8B3, 0xA8B3, 0x17B2,
+ 0xA8B4, 0xA8B6, 0x036B, 0xA8B7, 0xA8BA, 0x03F6, 0xA8BB, 0xA8BB, 0x1812,
+ 0xA8BC, 0xA8BE, 0x03FA, 0xA8BF, 0xA8C3, 0x03FE, 0xA8C4, 0xA8CC, 0x0405,
+ 0xA8CD, 0xA8CD, 0x1813, 0xA8CE, 0xA8CE, 0x1818, 0xA8CF, 0xA8D2, 0x040F,
+ 0xA8D3, 0xA8D3, 0x1819, 0xA8D4, 0xA8D9, 0x0508, 0xA8DA, 0xA8DA, 0x18E7,
+ 0xA8DB, 0xA8E2, 0x050E, 0xA8E3, 0xA8E3, 0x0230, 0xA8E4, 0xA8E4, 0x051B,
+ 0xA8E5, 0xA8E7, 0x0520, 0xA8E8, 0xA8EB, 0x0696, 0xA8EC, 0xA8EC, 0x0231,
+ 0xA8ED, 0xA8F0, 0x069F, 0xA8F1, 0xA8FB, 0x0826, 0xA8FC, 0xA8FE, 0x09F5,
+ 0xA9A1, 0xA9A1, 0x1E33, 0xA9A2, 0xA9A2, 0x09F8, 0xA9A3, 0xA9A3, 0x1E34,
+ 0xA9A4, 0xA9A5, 0x09F9, 0xA9A6, 0xA9AB, 0x0BE1, 0xA9AC, 0xA9AE, 0x0DBB,
+ 0xA9AF, 0xA9AF, 0x2360, 0xA9B0, 0xA9B0, 0x2612, 0xA9B1, 0xA9B3, 0x0F7B,
+ 0xA9B4, 0xA9B5, 0x1100, 0xA9B6, 0xA9B6, 0x1289, 0xA9B7, 0xA9B8, 0x13B2,
+ 0xA9B9, 0xA9B9, 0x2F0D, 0xC2A1, 0xC2C1, 0x0232, 0xC4A1, 0xC4FE, 0x0253,
+ 0xC5A1, 0xC5FE, 0x02B1, 0xC6A1, 0xC6FE, 0x030F, 0xC7A1, 0xC7FE, 0x036D,
+ 0xC8A1, 0xC8FE, 0x03CB, 0xC9A1, 0xC9FE, 0x0429, 0xCAA1, 0xCAFE, 0x0487,
+ 0xCBA1, 0xCBFE, 0x04E5, 0xCCA1, 0xCCFE, 0x0543, 0xCDA1, 0xCDFE, 0x05A1,
+ 0xCEA1, 0xCEFE, 0x05FF, 0xCFA1, 0xCFFE, 0x065D, 0xD0A1, 0xD0FE, 0x06BB,
+ 0xD1A1, 0xD1FE, 0x0719, 0xD2A1, 0xD2FE, 0x0777, 0xD3A1, 0xD3FE, 0x07D5,
+ 0xD4A1, 0xD4FE, 0x0833, 0xD5A1, 0xD5FE, 0x0891, 0xD6A1, 0xD6FE, 0x08EF,
+ 0xD7A1, 0xD7FE, 0x094D, 0xD8A1, 0xD8FE, 0x09AB, 0xD9A1, 0xD9FE, 0x0A09,
+ 0xDAA1, 0xDAFE, 0x0A67, 0xDBA1, 0xDBFE, 0x0AC5, 0xDCA1, 0xDCFE, 0x0B23,
+ 0xDDA1, 0xDDFE, 0x0B81, 0xDEA1, 0xDEFE, 0x0BDF, 0xDFA1, 0xDFFE, 0x0C3D,
+ 0xE0A1, 0xE0FE, 0x0C9B, 0xE1A1, 0xE1FE, 0x0CF9, 0xE2A1, 0xE2FE, 0x0D57,
+ 0xE3A1, 0xE3FE, 0x0DB5, 0xE4A1, 0xE4FE, 0x0E13, 0xE5A1, 0xE5FE, 0x0E71,
+ 0xE6A1, 0xE6FE, 0x0ECF, 0xE7A1, 0xE7FE, 0x0F2D, 0xE8A1, 0xE8FE, 0x0F8B,
+ 0xE9A1, 0xE9FE, 0x0FE9, 0xEAA1, 0xEAFE, 0x1047, 0xEBA1, 0xEBFE, 0x10A5,
+ 0xECA1, 0xECFE, 0x1103, 0xEDA1, 0xEDFE, 0x1161, 0xEEA1, 0xEEFE, 0x11BF,
+ 0xEFA1, 0xEFFE, 0x121D, 0xF0A1, 0xF0FE, 0x127B, 0xF1A1, 0xF1FE, 0x12D9,
+ 0xF2A1, 0xF2FE, 0x1337, 0xF3A1, 0xF3FE, 0x1395, 0xF4A1, 0xF4FE, 0x13F3,
+ 0xF5A1, 0xF5FE, 0x1451, 0xF6A1, 0xF6FE, 0x14AF, 0xF7A1, 0xF7FE, 0x150D,
+ 0xF8A1, 0xF8FE, 0x156B, 0xF9A1, 0xF9FE, 0x15C9, 0xFAA1, 0xFAFE, 0x1627,
+ 0xFBA1, 0xFBFE, 0x1685, 0xFCA1, 0xFCFE, 0x16E3, 0xFDA1, 0xFDCB, 0x1741,
+};
+extern const unsigned short g_FXCMAP_CNS_EUC_V_0_DWord[261 * 4] = {
+ 0x8EA1, 0xA1A1, 0xA1AB, 0x0063, 0x8EA1, 0xA1AC, 0xA1AC, 0x354E,
+ 0x8EA1, 0xA1AD, 0xA1BA, 0x006F, 0x8EA1, 0xA1BB, 0xA1BB, 0x007C,
+ 0x8EA1, 0xA1BC, 0xA1BC, 0x007E, 0x8EA1, 0xA1BD, 0xA1BD, 0x007E,
+ 0x8EA1, 0xA1BE, 0xA1BF, 0x0082, 0x8EA1, 0xA1C0, 0xA1C1, 0x0082,
+ 0x8EA1, 0xA1C2, 0xA1C3, 0x0086, 0x8EA1, 0xA1C4, 0xA1C5, 0x0086,
+ 0x8EA1, 0xA1C6, 0xA1C7, 0x008A, 0x8EA1, 0xA1C8, 0xA1C9, 0x008A,
+ 0x8EA1, 0xA1CA, 0xA1CB, 0x008E, 0x8EA1, 0xA1CC, 0xA1CD, 0x008E,
+ 0x8EA1, 0xA1CE, 0xA1CF, 0x0092, 0x8EA1, 0xA1D0, 0xA1D1, 0x0092,
+ 0x8EA1, 0xA1D2, 0xA1D3, 0x0096, 0x8EA1, 0xA1D4, 0xA1D5, 0x0096,
+ 0x8EA1, 0xA1D6, 0xA1D7, 0x009A, 0x8EA1, 0xA1D8, 0xA1D9, 0x009A,
+ 0x8EA1, 0xA1DA, 0xA1DB, 0x009E, 0x8EA1, 0xA1DC, 0xA1FE, 0x009E,
+ 0x8EA1, 0xA2A1, 0xA2C3, 0x00C1, 0x8EA1, 0xA2C4, 0xA2C4, 0x354F,
+ 0x8EA1, 0xA2C5, 0xA2FE, 0x00E5, 0x8EA1, 0xA3A1, 0xA3CE, 0x011F,
+ 0x8EA1, 0xA4A1, 0xA4FE, 0x014D, 0x8EA1, 0xA5A1, 0xA5EC, 0x01AB,
+ 0x8EA1, 0xA5EE, 0xA5F0, 0x01F7, 0x8EA1, 0xA6A1, 0xA6BE, 0x01FA,
+ 0x8EA1, 0xA7A1, 0xA7A1, 0x0253, 0x8EA1, 0xA7A2, 0xA7A4, 0x0218,
+ 0x8EA1, 0xA7A5, 0xA7A5, 0x0254, 0x8EA1, 0xA7A6, 0xA7A6, 0x021B,
+ 0x8EA1, 0xA7A7, 0xA7A7, 0x025A, 0x8EA1, 0xA7A8, 0xA7A8, 0x021C,
+ 0x8EA1, 0xA7A9, 0xA7AC, 0x025B, 0x8EA1, 0xA7AD, 0xA7AF, 0x021D,
+ 0x8EA1, 0xA7B0, 0xA7B0, 0x025F, 0x8EA1, 0xA7B1, 0xA7B1, 0x176E,
+ 0x8EA1, 0xA7B2, 0xA7B2, 0x0260, 0x8EA1, 0xA7B3, 0xA7B3, 0x0262,
+ 0x8EA1, 0xA7B4, 0xA7B4, 0x0220, 0x8EA1, 0xA7B5, 0xA7B5, 0x0263,
+ 0x8EA1, 0xA7B6, 0xA7B6, 0x176F, 0x8EA1, 0xA7B7, 0xA7B7, 0x0221,
+ 0x8EA1, 0xA7B8, 0xA7B9, 0x0264, 0x8EA1, 0xA7BA, 0xA7BA, 0x0222,
+ 0x8EA1, 0xA7BB, 0xA7BB, 0x1770, 0x8EA1, 0xA7BC, 0xA7BC, 0x0223,
+ 0x8EA1, 0xA7BD, 0xA7BD, 0x0266, 0x8EA1, 0xA7BE, 0xA7BE, 0x0279,
+ 0x8EA1, 0xA7BF, 0xA7BF, 0x1775, 0x8EA1, 0xA7C0, 0xA7C1, 0x027A,
+ 0x8EA1, 0xA7C2, 0xA7C2, 0x0224, 0x8EA1, 0xA7C3, 0xA7C6, 0x027C,
+ 0x8EA1, 0xA7C7, 0xA7C7, 0x0225, 0x8EA1, 0xA7C8, 0xA7CB, 0x0282,
+ 0x8EA1, 0xA7CC, 0xA7CC, 0x1776, 0x8EA1, 0xA7CD, 0xA7CD, 0x0286,
+ 0x8EA1, 0xA7CE, 0xA7CE, 0x0226, 0x8EA1, 0xA7CF, 0xA7D0, 0x0288,
+ 0x8EA1, 0xA7D1, 0xA7D2, 0x028C, 0x8EA1, 0xA7D3, 0xA7D5, 0x0227,
+ 0x8EA1, 0xA7D6, 0xA7D8, 0x028E, 0x8EA1, 0xA7D9, 0xA7DA, 0x022A,
+ 0x8EA1, 0xA7DB, 0xA7DB, 0x1777, 0x8EA1, 0xA7DC, 0xA7DF, 0x02D0,
+ 0x8EA1, 0xA7E0, 0xA7E0, 0x02D5, 0x8EA1, 0xA7E1, 0xA7E1, 0x022C,
+ 0x8EA1, 0xA7E2, 0xA7E5, 0x02D6, 0x8EA1, 0xA7E6, 0xA7E6, 0x022D,
+ 0x8EA1, 0xA7E7, 0xA7ED, 0x02DA, 0x8EA1, 0xA7EE, 0xA7EE, 0x178A,
+ 0x8EA1, 0xA7EF, 0xA7F2, 0x02E1, 0x8EA1, 0xA7F3, 0xA7F3, 0x178C,
+ 0x8EA1, 0xA7F4, 0xA7F8, 0x02E5, 0x8EA1, 0xA7F9, 0xA7F9, 0x178D,
+ 0x8EA1, 0xA7FA, 0xA7FD, 0x02EA, 0x8EA1, 0xA7FE, 0xA7FE, 0x0356,
+ 0x8EA1, 0xA8A1, 0xA8A6, 0x0357, 0x8EA1, 0xA8A7, 0xA8A7, 0x035E,
+ 0x8EA1, 0xA8A8, 0xA8A8, 0x0362, 0x8EA1, 0xA8A9, 0xA8AA, 0x022E,
+ 0x8EA1, 0xA8AB, 0xA8B2, 0x0363, 0x8EA1, 0xA8B3, 0xA8B3, 0x17B2,
+ 0x8EA1, 0xA8B4, 0xA8B6, 0x036B, 0x8EA1, 0xA8B7, 0xA8BA, 0x03F6,
+ 0x8EA1, 0xA8BB, 0xA8BB, 0x1812, 0x8EA1, 0xA8BC, 0xA8BE, 0x03FA,
+ 0x8EA1, 0xA8BF, 0xA8C3, 0x03FE, 0x8EA1, 0xA8C4, 0xA8CC, 0x0405,
+ 0x8EA1, 0xA8CD, 0xA8CD, 0x1813, 0x8EA1, 0xA8CE, 0xA8CE, 0x1818,
+ 0x8EA1, 0xA8CF, 0xA8D2, 0x040F, 0x8EA1, 0xA8D3, 0xA8D3, 0x1819,
+ 0x8EA1, 0xA8D4, 0xA8D9, 0x0508, 0x8EA1, 0xA8DA, 0xA8DA, 0x18E7,
+ 0x8EA1, 0xA8DB, 0xA8E2, 0x050E, 0x8EA1, 0xA8E3, 0xA8E3, 0x0230,
+ 0x8EA1, 0xA8E4, 0xA8E4, 0x051B, 0x8EA1, 0xA8E5, 0xA8E7, 0x0520,
+ 0x8EA1, 0xA8E8, 0xA8EB, 0x0696, 0x8EA1, 0xA8EC, 0xA8EC, 0x0231,
+ 0x8EA1, 0xA8ED, 0xA8F0, 0x069F, 0x8EA1, 0xA8F1, 0xA8FB, 0x0826,
+ 0x8EA1, 0xA8FC, 0xA8FE, 0x09F5, 0x8EA1, 0xA9A1, 0xA9A1, 0x1E33,
+ 0x8EA1, 0xA9A2, 0xA9A2, 0x09F8, 0x8EA1, 0xA9A3, 0xA9A3, 0x1E34,
+ 0x8EA1, 0xA9A4, 0xA9A5, 0x09F9, 0x8EA1, 0xA9A6, 0xA9AB, 0x0BE1,
+ 0x8EA1, 0xA9AC, 0xA9AE, 0x0DBB, 0x8EA1, 0xA9AF, 0xA9AF, 0x2360,
+ 0x8EA1, 0xA9B0, 0xA9B0, 0x2612, 0x8EA1, 0xA9B1, 0xA9B3, 0x0F7B,
+ 0x8EA1, 0xA9B4, 0xA9B5, 0x1100, 0x8EA1, 0xA9B6, 0xA9B6, 0x1289,
+ 0x8EA1, 0xA9B7, 0xA9B8, 0x13B2, 0x8EA1, 0xA9B9, 0xA9B9, 0x2F0D,
+ 0x8EA1, 0xC2A1, 0xC2C1, 0x0232, 0x8EA1, 0xC4A1, 0xC4FE, 0x0253,
+ 0x8EA1, 0xC5A1, 0xC5FE, 0x02B1, 0x8EA1, 0xC6A1, 0xC6FE, 0x030F,
+ 0x8EA1, 0xC7A1, 0xC7FE, 0x036D, 0x8EA1, 0xC8A1, 0xC8FE, 0x03CB,
+ 0x8EA1, 0xC9A1, 0xC9FE, 0x0429, 0x8EA1, 0xCAA1, 0xCAFE, 0x0487,
+ 0x8EA1, 0xCBA1, 0xCBFE, 0x04E5, 0x8EA1, 0xCCA1, 0xCCFE, 0x0543,
+ 0x8EA1, 0xCDA1, 0xCDFE, 0x05A1, 0x8EA1, 0xCEA1, 0xCEFE, 0x05FF,
+ 0x8EA1, 0xCFA1, 0xCFFE, 0x065D, 0x8EA1, 0xD0A1, 0xD0FE, 0x06BB,
+ 0x8EA1, 0xD1A1, 0xD1FE, 0x0719, 0x8EA1, 0xD2A1, 0xD2FE, 0x0777,
+ 0x8EA1, 0xD3A1, 0xD3FE, 0x07D5, 0x8EA1, 0xD4A1, 0xD4FE, 0x0833,
+ 0x8EA1, 0xD5A1, 0xD5FE, 0x0891, 0x8EA1, 0xD6A1, 0xD6FE, 0x08EF,
+ 0x8EA1, 0xD7A1, 0xD7FE, 0x094D, 0x8EA1, 0xD8A1, 0xD8FE, 0x09AB,
+ 0x8EA1, 0xD9A1, 0xD9FE, 0x0A09, 0x8EA1, 0xDAA1, 0xDAFE, 0x0A67,
+ 0x8EA1, 0xDBA1, 0xDBFE, 0x0AC5, 0x8EA1, 0xDCA1, 0xDCFE, 0x0B23,
+ 0x8EA1, 0xDDA1, 0xDDFE, 0x0B81, 0x8EA1, 0xDEA1, 0xDEFE, 0x0BDF,
+ 0x8EA1, 0xDFA1, 0xDFFE, 0x0C3D, 0x8EA1, 0xE0A1, 0xE0FE, 0x0C9B,
+ 0x8EA1, 0xE1A1, 0xE1FE, 0x0CF9, 0x8EA1, 0xE2A1, 0xE2FE, 0x0D57,
+ 0x8EA1, 0xE3A1, 0xE3FE, 0x0DB5, 0x8EA1, 0xE4A1, 0xE4FE, 0x0E13,
+ 0x8EA1, 0xE5A1, 0xE5FE, 0x0E71, 0x8EA1, 0xE6A1, 0xE6FE, 0x0ECF,
+ 0x8EA1, 0xE7A1, 0xE7FE, 0x0F2D, 0x8EA1, 0xE8A1, 0xE8FE, 0x0F8B,
+ 0x8EA1, 0xE9A1, 0xE9FE, 0x0FE9, 0x8EA1, 0xEAA1, 0xEAFE, 0x1047,
+ 0x8EA1, 0xEBA1, 0xEBFE, 0x10A5, 0x8EA1, 0xECA1, 0xECFE, 0x1103,
+ 0x8EA1, 0xEDA1, 0xEDFE, 0x1161, 0x8EA1, 0xEEA1, 0xEEFE, 0x11BF,
+ 0x8EA1, 0xEFA1, 0xEFFE, 0x121D, 0x8EA1, 0xF0A1, 0xF0FE, 0x127B,
+ 0x8EA1, 0xF1A1, 0xF1FE, 0x12D9, 0x8EA1, 0xF2A1, 0xF2FE, 0x1337,
+ 0x8EA1, 0xF3A1, 0xF3FE, 0x1395, 0x8EA1, 0xF4A1, 0xF4FE, 0x13F3,
+ 0x8EA1, 0xF5A1, 0xF5FE, 0x1451, 0x8EA1, 0xF6A1, 0xF6FE, 0x14AF,
+ 0x8EA1, 0xF7A1, 0xF7FE, 0x150D, 0x8EA1, 0xF8A1, 0xF8FE, 0x156B,
+ 0x8EA1, 0xF9A1, 0xF9FE, 0x15C9, 0x8EA1, 0xFAA1, 0xFAFE, 0x1627,
+ 0x8EA1, 0xFBA1, 0xFBFE, 0x1685, 0x8EA1, 0xFCA1, 0xFCFE, 0x16E3,
+ 0x8EA1, 0xFDA1, 0xFDCB, 0x1741, 0x8EA2, 0xA1A1, 0xA1FE, 0x176C,
+ 0x8EA2, 0xA2A1, 0xA2FE, 0x17CA, 0x8EA2, 0xA3A1, 0xA3FE, 0x1828,
+ 0x8EA2, 0xA4A1, 0xA4FE, 0x1886, 0x8EA2, 0xA5A1, 0xA5FE, 0x18E4,
+ 0x8EA2, 0xA6A1, 0xA6FE, 0x1942, 0x8EA2, 0xA7A1, 0xA7FE, 0x19A0,
+ 0x8EA2, 0xA8A1, 0xA8FE, 0x19FE, 0x8EA2, 0xA9A1, 0xA9FE, 0x1A5C,
+ 0x8EA2, 0xAAA1, 0xAAFE, 0x1ABA, 0x8EA2, 0xABA1, 0xABFE, 0x1B18,
+ 0x8EA2, 0xACA1, 0xACFE, 0x1B76, 0x8EA2, 0xADA1, 0xADFE, 0x1BD4,
+ 0x8EA2, 0xAEA1, 0xAEFE, 0x1C32, 0x8EA2, 0xAFA1, 0xAFFE, 0x1C90,
+ 0x8EA2, 0xB0A1, 0xB0FE, 0x1CEE, 0x8EA2, 0xB1A1, 0xB1FE, 0x1D4C,
+ 0x8EA2, 0xB2A1, 0xB2FE, 0x1DAA, 0x8EA2, 0xB3A1, 0xB3FE, 0x1E08,
+ 0x8EA2, 0xB4A1, 0xB4FE, 0x1E66, 0x8EA2, 0xB5A1, 0xB5FE, 0x1EC4,
+ 0x8EA2, 0xB6A1, 0xB6FE, 0x1F22, 0x8EA2, 0xB7A1, 0xB7FE, 0x1F80,
+ 0x8EA2, 0xB8A1, 0xB8FE, 0x1FDE, 0x8EA2, 0xB9A1, 0xB9FE, 0x203C,
+ 0x8EA2, 0xBAA1, 0xBAFE, 0x209A, 0x8EA2, 0xBBA1, 0xBBFE, 0x20F8,
+ 0x8EA2, 0xBCA1, 0xBCFE, 0x2156, 0x8EA2, 0xBDA1, 0xBDFE, 0x21B4,
+ 0x8EA2, 0xBEA1, 0xBEFE, 0x2212, 0x8EA2, 0xBFA1, 0xBFFE, 0x2270,
+ 0x8EA2, 0xC0A1, 0xC0FE, 0x22CE, 0x8EA2, 0xC1A1, 0xC1FE, 0x232C,
+ 0x8EA2, 0xC2A1, 0xC2FE, 0x238A, 0x8EA2, 0xC3A1, 0xC3FE, 0x23E8,
+ 0x8EA2, 0xC4A1, 0xC4FE, 0x2446, 0x8EA2, 0xC5A1, 0xC5FE, 0x24A4,
+ 0x8EA2, 0xC6A1, 0xC6FE, 0x2502, 0x8EA2, 0xC7A1, 0xC7FE, 0x2560,
+ 0x8EA2, 0xC8A1, 0xC8FE, 0x25BE, 0x8EA2, 0xC9A1, 0xC9FE, 0x261C,
+ 0x8EA2, 0xCAA1, 0xCAFE, 0x267A, 0x8EA2, 0xCBA1, 0xCBFE, 0x26D8,
+ 0x8EA2, 0xCCA1, 0xCCFE, 0x2736, 0x8EA2, 0xCDA1, 0xCDFE, 0x2794,
+ 0x8EA2, 0xCEA1, 0xCEFE, 0x27F2, 0x8EA2, 0xCFA1, 0xCFFE, 0x2850,
+ 0x8EA2, 0xD0A1, 0xD0FE, 0x28AE, 0x8EA2, 0xD1A1, 0xD1FE, 0x290C,
+ 0x8EA2, 0xD2A1, 0xD2FE, 0x296A, 0x8EA2, 0xD3A1, 0xD3FE, 0x29C8,
+ 0x8EA2, 0xD4A1, 0xD4FE, 0x2A26, 0x8EA2, 0xD5A1, 0xD5FE, 0x2A84,
+ 0x8EA2, 0xD6A1, 0xD6FE, 0x2AE2, 0x8EA2, 0xD7A1, 0xD7FE, 0x2B40,
+ 0x8EA2, 0xD8A1, 0xD8FE, 0x2B9E, 0x8EA2, 0xD9A1, 0xD9FE, 0x2BFC,
+ 0x8EA2, 0xDAA1, 0xDAFE, 0x2C5A, 0x8EA2, 0xDBA1, 0xDBFE, 0x2CB8,
+ 0x8EA2, 0xDCA1, 0xDCFE, 0x2D16, 0x8EA2, 0xDDA1, 0xDDFE, 0x2D74,
+ 0x8EA2, 0xDEA1, 0xDEFE, 0x2DD2, 0x8EA2, 0xDFA1, 0xDFFE, 0x2E30,
+ 0x8EA2, 0xE0A1, 0xE0FE, 0x2E8E, 0x8EA2, 0xE1A1, 0xE1FE, 0x2EEC,
+ 0x8EA2, 0xE2A1, 0xE2FE, 0x2F4A, 0x8EA2, 0xE3A1, 0xE3FE, 0x2FA8,
+ 0x8EA2, 0xE4A1, 0xE4FE, 0x3006, 0x8EA2, 0xE5A1, 0xE5FE, 0x3064,
+ 0x8EA2, 0xE6A1, 0xE6FE, 0x30C2, 0x8EA2, 0xE7A1, 0xE7FE, 0x3120,
+ 0x8EA2, 0xE8A1, 0xE8FE, 0x317E, 0x8EA2, 0xE9A1, 0xE9FE, 0x31DC,
+ 0x8EA2, 0xEAA1, 0xEAFE, 0x323A, 0x8EA2, 0xEBA1, 0xEBFE, 0x3298,
+ 0x8EA2, 0xECA1, 0xECFE, 0x32F6, 0x8EA2, 0xEDA1, 0xEDFE, 0x3354,
+ 0x8EA2, 0xEEA1, 0xEEFE, 0x33B2, 0x8EA2, 0xEFA1, 0xEFFE, 0x3410,
+ 0x8EA2, 0xF0A1, 0xF0FE, 0x346E, 0x8EA2, 0xF1A1, 0xF1FE, 0x34CC,
+ 0x8EA2, 0xF2A1, 0xF2C4, 0x352A,
+};
diff --git a/core/src/fpdfapi/fpdf_cmaps/CNS1/ETen-B5-H_0.cpp b/core/src/fpdfapi/fpdf_cmaps/CNS1/ETen-B5-H_0.cpp
index f1c9483239..2e09a50afa 100644
--- a/core/src/fpdfapi/fpdf_cmaps/CNS1/ETen-B5-H_0.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/CNS1/ETen-B5-H_0.cpp
@@ -1,93 +1,93 @@
-// Copyright 2014 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-extern const unsigned short g_FXCMAP_ETen_B5_H_0[254 * 3] = {
- 0x0020, 0x007E, 0x3550, 0xA140, 0xA158, 0x0063, 0xA159, 0xA15C, 0x35AF,
- 0xA15D, 0xA17E, 0x0080, 0xA1A1, 0xA1F5, 0x00A2, 0xA1F6, 0xA1F6, 0x00F8,
- 0xA1F7, 0xA1F7, 0x00F7, 0xA1F8, 0xA1FE, 0x00F9, 0xA240, 0xA27E, 0x0100,
- 0xA2A1, 0xA2FE, 0x013F, 0xA340, 0xA37E, 0x019D, 0xA3A1, 0xA3BB, 0x01DC,
- 0xA3BD, 0xA3BF, 0x01F7, 0xA440, 0xA47E, 0x0253, 0xA4A1, 0xA4FE, 0x0292,
- 0xA540, 0xA57E, 0x02F0, 0xA5A1, 0xA5FE, 0x032F, 0xA640, 0xA67E, 0x038D,
- 0xA6A1, 0xA6FE, 0x03CC, 0xA740, 0xA77E, 0x042A, 0xA7A1, 0xA7FE, 0x0469,
- 0xA840, 0xA87E, 0x04C7, 0xA8A1, 0xA8FE, 0x0506, 0xA940, 0xA97E, 0x0564,
- 0xA9A1, 0xA9FE, 0x05A3, 0xAA40, 0xAA7E, 0x0601, 0xAAA1, 0xAAFE, 0x0640,
- 0xAB40, 0xAB7E, 0x069E, 0xABA1, 0xABFE, 0x06DD, 0xAC40, 0xAC7E, 0x073B,
- 0xACA1, 0xACFD, 0x077A, 0xACFE, 0xACFE, 0x097F, 0xAD40, 0xAD7E, 0x07D7,
- 0xADA1, 0xADFE, 0x0816, 0xAE40, 0xAE7E, 0x0874, 0xAEA1, 0xAEFE, 0x08B3,
- 0xAF40, 0xAF7E, 0x0911, 0xAFA1, 0xAFCF, 0x0950, 0xAFD0, 0xAFFE, 0x0980,
- 0xB040, 0xB07E, 0x09AF, 0xB0A1, 0xB0FE, 0x09EE, 0xB140, 0xB17E, 0x0A4C,
- 0xB1A1, 0xB1FE, 0x0A8B, 0xB240, 0xB27E, 0x0AE9, 0xB2A1, 0xB2FE, 0x0B28,
- 0xB340, 0xB37E, 0x0B86, 0xB3A1, 0xB3FE, 0x0BC5, 0xB440, 0xB47E, 0x0C23,
- 0xB4A1, 0xB4FE, 0x0C62, 0xB540, 0xB57E, 0x0CC0, 0xB5A1, 0xB5FE, 0x0CFF,
- 0xB640, 0xB67E, 0x0D5D, 0xB6A1, 0xB6FE, 0x0D9C, 0xB740, 0xB77E, 0x0DFA,
- 0xB7A1, 0xB7FE, 0x0E39, 0xB840, 0xB87E, 0x0E97, 0xB8A1, 0xB8FE, 0x0ED6,
- 0xB940, 0xB97E, 0x0F34, 0xB9A1, 0xB9FE, 0x0F73, 0xBA40, 0xBA7E, 0x0FD1,
- 0xBAA1, 0xBAFE, 0x1010, 0xBB40, 0xBB7E, 0x106E, 0xBBA1, 0xBBC7, 0x10AD,
- 0xBBC8, 0xBBFE, 0x10D5, 0xBC40, 0xBC7E, 0x110C, 0xBCA1, 0xBCFE, 0x114B,
- 0xBD40, 0xBD7E, 0x11A9, 0xBDA1, 0xBDFE, 0x11E8, 0xBE40, 0xBE51, 0x1246,
- 0xBE52, 0xBE52, 0x10D4, 0xBE53, 0xBE7E, 0x1258, 0xBEA1, 0xBEFE, 0x1284,
- 0xBF40, 0xBF7E, 0x12E2, 0xBFA1, 0xBFFE, 0x1321, 0xC040, 0xC07E, 0x137F,
- 0xC0A1, 0xC0FE, 0x13BE, 0xC140, 0xC17E, 0x141C, 0xC1A1, 0xC1AA, 0x145B,
- 0xC1AB, 0xC1FE, 0x1466, 0xC240, 0xC27E, 0x14BA, 0xC2A1, 0xC2CA, 0x14F9,
- 0xC2CB, 0xC2CB, 0x1465, 0xC2CC, 0xC2FE, 0x1523, 0xC340, 0xC360, 0x1556,
- 0xC361, 0xC37E, 0x1578, 0xC3A1, 0xC3B8, 0x1596, 0xC3B9, 0xC3B9, 0x15AF,
- 0xC3BA, 0xC3BA, 0x15AE, 0xC3BB, 0xC3FE, 0x15B0, 0xC440, 0xC455, 0x15F4,
- 0xC456, 0xC456, 0x1577, 0xC457, 0xC47E, 0x160A, 0xC4A1, 0xC4FE, 0x1632,
- 0xC540, 0xC57E, 0x1690, 0xC5A1, 0xC5FE, 0x16CF, 0xC640, 0xC67E, 0x172D,
- 0xC6A1, 0xC6BE, 0x01FA, 0xC6BF, 0xC6D7, 0x0219, 0xC6D8, 0xC6DE, 0x35B3,
- 0xC6DF, 0xC6DF, 0x1794, 0xC6E0, 0xC6FE, 0x35BA, 0xC740, 0xC77E, 0x35D9,
- 0xC7A1, 0xC7FE, 0x3618, 0xC840, 0xC87E, 0x3676, 0xC8A1, 0xC8D3, 0x36B5,
- 0xC940, 0xC949, 0x176C, 0xC94A, 0xC94A, 0x0274, 0xC94B, 0xC96B, 0x1776,
- 0xC96C, 0xC97E, 0x1798, 0xC9A1, 0xC9BD, 0x17AB, 0xC9BE, 0xC9BE, 0x1797,
- 0xC9BF, 0xC9EC, 0x17C8, 0xC9ED, 0xC9FE, 0x17F7, 0xCA40, 0xCA7E, 0x1809,
- 0xCAA1, 0xCAF6, 0x1848, 0xCAF7, 0xCAF7, 0x17F6, 0xCAF8, 0xCAFE, 0x189E,
- 0xCB40, 0xCB7E, 0x18A5, 0xCBA1, 0xCBFE, 0x18E4, 0xCC40, 0xCC7E, 0x1942,
- 0xCCA1, 0xCCFE, 0x1981, 0xCD40, 0xCD7E, 0x19DF, 0xCDA1, 0xCDFE, 0x1A1E,
- 0xCE40, 0xCE7E, 0x1A7C, 0xCEA1, 0xCEFE, 0x1ABB, 0xCF40, 0xCF7E, 0x1B19,
- 0xCFA1, 0xCFFE, 0x1B58, 0xD040, 0xD07E, 0x1BB6, 0xD0A1, 0xD0FE, 0x1BF5,
- 0xD140, 0xD17E, 0x1C53, 0xD1A1, 0xD1FE, 0x1C92, 0xD240, 0xD27E, 0x1CF0,
- 0xD2A1, 0xD2FE, 0x1D2F, 0xD340, 0xD37E, 0x1D8D, 0xD3A1, 0xD3FE, 0x1DCC,
- 0xD440, 0xD47E, 0x1E2A, 0xD4A1, 0xD4FE, 0x1E69, 0xD540, 0xD57E, 0x1EC7,
- 0xD5A1, 0xD5FE, 0x1F06, 0xD640, 0xD67E, 0x1F64, 0xD6A1, 0xD6CB, 0x1FA3,
- 0xD6CC, 0xD6CC, 0x2254, 0xD6CD, 0xD6FE, 0x1FCF, 0xD740, 0xD779, 0x2001,
- 0xD77A, 0xD77A, 0x22B9, 0xD77B, 0xD77E, 0x203B, 0xD7A1, 0xD7FE, 0x203F,
- 0xD840, 0xD87E, 0x209D, 0xD8A1, 0xD8FE, 0x20DC, 0xD940, 0xD97E, 0x213A,
- 0xD9A1, 0xD9FE, 0x2179, 0xDA40, 0xDA7E, 0x21D7, 0xDAA1, 0xDADE, 0x2216,
- 0xDADF, 0xDADF, 0x1FCE, 0xDAE0, 0xDAFE, 0x2255, 0xDB40, 0xDB7E, 0x2274,
- 0xDBA1, 0xDBA6, 0x22B3, 0xDBA7, 0xDBFE, 0x22BA, 0xDC40, 0xDC7E, 0x2312,
- 0xDCA1, 0xDCFE, 0x2351, 0xDD40, 0xDD7E, 0x23AF, 0xDDA1, 0xDDFB, 0x23EE,
- 0xDDFC, 0xDDFC, 0x2381, 0xDDFD, 0xDDFE, 0x2449, 0xDE40, 0xDE7E, 0x244B,
- 0xDEA1, 0xDEFE, 0x248A, 0xDF40, 0xDF7E, 0x24E8, 0xDFA1, 0xDFFE, 0x2527,
- 0xE040, 0xE07E, 0x2585, 0xE0A1, 0xE0FE, 0x25C4, 0xE140, 0xE17E, 0x2622,
- 0xE1A1, 0xE1FE, 0x2661, 0xE240, 0xE27E, 0x26BF, 0xE2A1, 0xE2FE, 0x26FE,
- 0xE340, 0xE37E, 0x275C, 0xE3A1, 0xE3FE, 0x279B, 0xE440, 0xE47E, 0x27F9,
- 0xE4A1, 0xE4FE, 0x2838, 0xE540, 0xE57E, 0x2896, 0xE5A1, 0xE5FE, 0x28D5,
- 0xE640, 0xE67E, 0x2933, 0xE6A1, 0xE6FE, 0x2972, 0xE740, 0xE77E, 0x29D0,
- 0xE7A1, 0xE7FE, 0x2A0F, 0xE840, 0xE87E, 0x2A6D, 0xE8A1, 0xE8A2, 0x2AAC,
- 0xE8A3, 0xE8FE, 0x2AAF, 0xE940, 0xE975, 0x2B0B, 0xE976, 0xE97E, 0x2B42,
- 0xE9A1, 0xE9FE, 0x2B4B, 0xEA40, 0xEA7E, 0x2BA9, 0xEAA1, 0xEAFE, 0x2BE8,
- 0xEB40, 0xEB5A, 0x2C46, 0xEB5B, 0xEB7E, 0x2C62, 0xEBA1, 0xEBF0, 0x2C86,
- 0xEBF1, 0xEBF1, 0x2AAE, 0xEBF2, 0xEBFE, 0x2CD6, 0xEC40, 0xEC7E, 0x2CE3,
- 0xECA1, 0xECDD, 0x2D22, 0xECDE, 0xECDE, 0x2B41, 0xECDF, 0xECFE, 0x2D5F,
- 0xED40, 0xED7E, 0x2D7F, 0xEDA1, 0xEDA9, 0x2DBE, 0xEDAA, 0xEDFE, 0x2DC8,
- 0xEE40, 0xEE7E, 0x2E1D, 0xEEA1, 0xEEEA, 0x2E5C, 0xEEEB, 0xEEEB, 0x3014,
- 0xEEEC, 0xEEFE, 0x2EA6, 0xEF40, 0xEF7E, 0x2EB9, 0xEFA1, 0xEFFE, 0x2EF8,
- 0xF040, 0xF055, 0x2F56, 0xF056, 0xF056, 0x2DC7, 0xF057, 0xF07E, 0x2F6C,
- 0xF0A1, 0xF0CA, 0x2F94, 0xF0CB, 0xF0CB, 0x2C61, 0xF0CC, 0xF0FE, 0x2FBE,
- 0xF140, 0xF162, 0x2FF1, 0xF163, 0xF16A, 0x3015, 0xF16B, 0xF16B, 0x3160,
- 0xF16C, 0xF17E, 0x301D, 0xF1A1, 0xF1FE, 0x3030, 0xF240, 0xF267, 0x308E,
- 0xF268, 0xF268, 0x31EF, 0xF269, 0xF27E, 0x30B6, 0xF2A1, 0xF2C2, 0x30CC,
- 0xF2C3, 0xF2FE, 0x30EF, 0xF340, 0xF374, 0x312B, 0xF375, 0xF37E, 0x3161,
- 0xF3A1, 0xF3FE, 0x316B, 0xF440, 0xF465, 0x31C9, 0xF466, 0xF47E, 0x31F0,
- 0xF4A1, 0xF4B4, 0x3209, 0xF4B5, 0xF4B5, 0x30EE, 0xF4B6, 0xF4FC, 0x321D,
- 0xF4FD, 0xF4FE, 0x3265, 0xF540, 0xF57E, 0x3267, 0xF5A1, 0xF5FE, 0x32A6,
- 0xF640, 0xF662, 0x3304, 0xF663, 0xF663, 0x3264, 0xF664, 0xF67E, 0x3327,
- 0xF6A1, 0xF6FE, 0x3342, 0xF740, 0xF77E, 0x33A0, 0xF7A1, 0xF7FE, 0x33DF,
- 0xF840, 0xF87E, 0x343D, 0xF8A1, 0xF8FE, 0x347C, 0xF940, 0xF976, 0x34DA,
- 0xF977, 0xF97E, 0x3512, 0xF9A1, 0xF9C3, 0x351A, 0xF9C4, 0xF9C4, 0x3511,
- 0xF9C5, 0xF9C5, 0x353D, 0xF9C6, 0xF9C6, 0x3549, 0xF9C7, 0xF9D1, 0x353E,
- 0xF9D2, 0xF9D5, 0x354A, 0xF9D6, 0xF9FE, 0x36E8,
-};
+// 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
+
+extern const unsigned short g_FXCMAP_ETen_B5_H_0[254 * 3] = {
+ 0x0020, 0x007E, 0x3550, 0xA140, 0xA158, 0x0063, 0xA159, 0xA15C, 0x35AF,
+ 0xA15D, 0xA17E, 0x0080, 0xA1A1, 0xA1F5, 0x00A2, 0xA1F6, 0xA1F6, 0x00F8,
+ 0xA1F7, 0xA1F7, 0x00F7, 0xA1F8, 0xA1FE, 0x00F9, 0xA240, 0xA27E, 0x0100,
+ 0xA2A1, 0xA2FE, 0x013F, 0xA340, 0xA37E, 0x019D, 0xA3A1, 0xA3BB, 0x01DC,
+ 0xA3BD, 0xA3BF, 0x01F7, 0xA440, 0xA47E, 0x0253, 0xA4A1, 0xA4FE, 0x0292,
+ 0xA540, 0xA57E, 0x02F0, 0xA5A1, 0xA5FE, 0x032F, 0xA640, 0xA67E, 0x038D,
+ 0xA6A1, 0xA6FE, 0x03CC, 0xA740, 0xA77E, 0x042A, 0xA7A1, 0xA7FE, 0x0469,
+ 0xA840, 0xA87E, 0x04C7, 0xA8A1, 0xA8FE, 0x0506, 0xA940, 0xA97E, 0x0564,
+ 0xA9A1, 0xA9FE, 0x05A3, 0xAA40, 0xAA7E, 0x0601, 0xAAA1, 0xAAFE, 0x0640,
+ 0xAB40, 0xAB7E, 0x069E, 0xABA1, 0xABFE, 0x06DD, 0xAC40, 0xAC7E, 0x073B,
+ 0xACA1, 0xACFD, 0x077A, 0xACFE, 0xACFE, 0x097F, 0xAD40, 0xAD7E, 0x07D7,
+ 0xADA1, 0xADFE, 0x0816, 0xAE40, 0xAE7E, 0x0874, 0xAEA1, 0xAEFE, 0x08B3,
+ 0xAF40, 0xAF7E, 0x0911, 0xAFA1, 0xAFCF, 0x0950, 0xAFD0, 0xAFFE, 0x0980,
+ 0xB040, 0xB07E, 0x09AF, 0xB0A1, 0xB0FE, 0x09EE, 0xB140, 0xB17E, 0x0A4C,
+ 0xB1A1, 0xB1FE, 0x0A8B, 0xB240, 0xB27E, 0x0AE9, 0xB2A1, 0xB2FE, 0x0B28,
+ 0xB340, 0xB37E, 0x0B86, 0xB3A1, 0xB3FE, 0x0BC5, 0xB440, 0xB47E, 0x0C23,
+ 0xB4A1, 0xB4FE, 0x0C62, 0xB540, 0xB57E, 0x0CC0, 0xB5A1, 0xB5FE, 0x0CFF,
+ 0xB640, 0xB67E, 0x0D5D, 0xB6A1, 0xB6FE, 0x0D9C, 0xB740, 0xB77E, 0x0DFA,
+ 0xB7A1, 0xB7FE, 0x0E39, 0xB840, 0xB87E, 0x0E97, 0xB8A1, 0xB8FE, 0x0ED6,
+ 0xB940, 0xB97E, 0x0F34, 0xB9A1, 0xB9FE, 0x0F73, 0xBA40, 0xBA7E, 0x0FD1,
+ 0xBAA1, 0xBAFE, 0x1010, 0xBB40, 0xBB7E, 0x106E, 0xBBA1, 0xBBC7, 0x10AD,
+ 0xBBC8, 0xBBFE, 0x10D5, 0xBC40, 0xBC7E, 0x110C, 0xBCA1, 0xBCFE, 0x114B,
+ 0xBD40, 0xBD7E, 0x11A9, 0xBDA1, 0xBDFE, 0x11E8, 0xBE40, 0xBE51, 0x1246,
+ 0xBE52, 0xBE52, 0x10D4, 0xBE53, 0xBE7E, 0x1258, 0xBEA1, 0xBEFE, 0x1284,
+ 0xBF40, 0xBF7E, 0x12E2, 0xBFA1, 0xBFFE, 0x1321, 0xC040, 0xC07E, 0x137F,
+ 0xC0A1, 0xC0FE, 0x13BE, 0xC140, 0xC17E, 0x141C, 0xC1A1, 0xC1AA, 0x145B,
+ 0xC1AB, 0xC1FE, 0x1466, 0xC240, 0xC27E, 0x14BA, 0xC2A1, 0xC2CA, 0x14F9,
+ 0xC2CB, 0xC2CB, 0x1465, 0xC2CC, 0xC2FE, 0x1523, 0xC340, 0xC360, 0x1556,
+ 0xC361, 0xC37E, 0x1578, 0xC3A1, 0xC3B8, 0x1596, 0xC3B9, 0xC3B9, 0x15AF,
+ 0xC3BA, 0xC3BA, 0x15AE, 0xC3BB, 0xC3FE, 0x15B0, 0xC440, 0xC455, 0x15F4,
+ 0xC456, 0xC456, 0x1577, 0xC457, 0xC47E, 0x160A, 0xC4A1, 0xC4FE, 0x1632,
+ 0xC540, 0xC57E, 0x1690, 0xC5A1, 0xC5FE, 0x16CF, 0xC640, 0xC67E, 0x172D,
+ 0xC6A1, 0xC6BE, 0x01FA, 0xC6BF, 0xC6D7, 0x0219, 0xC6D8, 0xC6DE, 0x35B3,
+ 0xC6DF, 0xC6DF, 0x1794, 0xC6E0, 0xC6FE, 0x35BA, 0xC740, 0xC77E, 0x35D9,
+ 0xC7A1, 0xC7FE, 0x3618, 0xC840, 0xC87E, 0x3676, 0xC8A1, 0xC8D3, 0x36B5,
+ 0xC940, 0xC949, 0x176C, 0xC94A, 0xC94A, 0x0274, 0xC94B, 0xC96B, 0x1776,
+ 0xC96C, 0xC97E, 0x1798, 0xC9A1, 0xC9BD, 0x17AB, 0xC9BE, 0xC9BE, 0x1797,
+ 0xC9BF, 0xC9EC, 0x17C8, 0xC9ED, 0xC9FE, 0x17F7, 0xCA40, 0xCA7E, 0x1809,
+ 0xCAA1, 0xCAF6, 0x1848, 0xCAF7, 0xCAF7, 0x17F6, 0xCAF8, 0xCAFE, 0x189E,
+ 0xCB40, 0xCB7E, 0x18A5, 0xCBA1, 0xCBFE, 0x18E4, 0xCC40, 0xCC7E, 0x1942,
+ 0xCCA1, 0xCCFE, 0x1981, 0xCD40, 0xCD7E, 0x19DF, 0xCDA1, 0xCDFE, 0x1A1E,
+ 0xCE40, 0xCE7E, 0x1A7C, 0xCEA1, 0xCEFE, 0x1ABB, 0xCF40, 0xCF7E, 0x1B19,
+ 0xCFA1, 0xCFFE, 0x1B58, 0xD040, 0xD07E, 0x1BB6, 0xD0A1, 0xD0FE, 0x1BF5,
+ 0xD140, 0xD17E, 0x1C53, 0xD1A1, 0xD1FE, 0x1C92, 0xD240, 0xD27E, 0x1CF0,
+ 0xD2A1, 0xD2FE, 0x1D2F, 0xD340, 0xD37E, 0x1D8D, 0xD3A1, 0xD3FE, 0x1DCC,
+ 0xD440, 0xD47E, 0x1E2A, 0xD4A1, 0xD4FE, 0x1E69, 0xD540, 0xD57E, 0x1EC7,
+ 0xD5A1, 0xD5FE, 0x1F06, 0xD640, 0xD67E, 0x1F64, 0xD6A1, 0xD6CB, 0x1FA3,
+ 0xD6CC, 0xD6CC, 0x2254, 0xD6CD, 0xD6FE, 0x1FCF, 0xD740, 0xD779, 0x2001,
+ 0xD77A, 0xD77A, 0x22B9, 0xD77B, 0xD77E, 0x203B, 0xD7A1, 0xD7FE, 0x203F,
+ 0xD840, 0xD87E, 0x209D, 0xD8A1, 0xD8FE, 0x20DC, 0xD940, 0xD97E, 0x213A,
+ 0xD9A1, 0xD9FE, 0x2179, 0xDA40, 0xDA7E, 0x21D7, 0xDAA1, 0xDADE, 0x2216,
+ 0xDADF, 0xDADF, 0x1FCE, 0xDAE0, 0xDAFE, 0x2255, 0xDB40, 0xDB7E, 0x2274,
+ 0xDBA1, 0xDBA6, 0x22B3, 0xDBA7, 0xDBFE, 0x22BA, 0xDC40, 0xDC7E, 0x2312,
+ 0xDCA1, 0xDCFE, 0x2351, 0xDD40, 0xDD7E, 0x23AF, 0xDDA1, 0xDDFB, 0x23EE,
+ 0xDDFC, 0xDDFC, 0x2381, 0xDDFD, 0xDDFE, 0x2449, 0xDE40, 0xDE7E, 0x244B,
+ 0xDEA1, 0xDEFE, 0x248A, 0xDF40, 0xDF7E, 0x24E8, 0xDFA1, 0xDFFE, 0x2527,
+ 0xE040, 0xE07E, 0x2585, 0xE0A1, 0xE0FE, 0x25C4, 0xE140, 0xE17E, 0x2622,
+ 0xE1A1, 0xE1FE, 0x2661, 0xE240, 0xE27E, 0x26BF, 0xE2A1, 0xE2FE, 0x26FE,
+ 0xE340, 0xE37E, 0x275C, 0xE3A1, 0xE3FE, 0x279B, 0xE440, 0xE47E, 0x27F9,
+ 0xE4A1, 0xE4FE, 0x2838, 0xE540, 0xE57E, 0x2896, 0xE5A1, 0xE5FE, 0x28D5,
+ 0xE640, 0xE67E, 0x2933, 0xE6A1, 0xE6FE, 0x2972, 0xE740, 0xE77E, 0x29D0,
+ 0xE7A1, 0xE7FE, 0x2A0F, 0xE840, 0xE87E, 0x2A6D, 0xE8A1, 0xE8A2, 0x2AAC,
+ 0xE8A3, 0xE8FE, 0x2AAF, 0xE940, 0xE975, 0x2B0B, 0xE976, 0xE97E, 0x2B42,
+ 0xE9A1, 0xE9FE, 0x2B4B, 0xEA40, 0xEA7E, 0x2BA9, 0xEAA1, 0xEAFE, 0x2BE8,
+ 0xEB40, 0xEB5A, 0x2C46, 0xEB5B, 0xEB7E, 0x2C62, 0xEBA1, 0xEBF0, 0x2C86,
+ 0xEBF1, 0xEBF1, 0x2AAE, 0xEBF2, 0xEBFE, 0x2CD6, 0xEC40, 0xEC7E, 0x2CE3,
+ 0xECA1, 0xECDD, 0x2D22, 0xECDE, 0xECDE, 0x2B41, 0xECDF, 0xECFE, 0x2D5F,
+ 0xED40, 0xED7E, 0x2D7F, 0xEDA1, 0xEDA9, 0x2DBE, 0xEDAA, 0xEDFE, 0x2DC8,
+ 0xEE40, 0xEE7E, 0x2E1D, 0xEEA1, 0xEEEA, 0x2E5C, 0xEEEB, 0xEEEB, 0x3014,
+ 0xEEEC, 0xEEFE, 0x2EA6, 0xEF40, 0xEF7E, 0x2EB9, 0xEFA1, 0xEFFE, 0x2EF8,
+ 0xF040, 0xF055, 0x2F56, 0xF056, 0xF056, 0x2DC7, 0xF057, 0xF07E, 0x2F6C,
+ 0xF0A1, 0xF0CA, 0x2F94, 0xF0CB, 0xF0CB, 0x2C61, 0xF0CC, 0xF0FE, 0x2FBE,
+ 0xF140, 0xF162, 0x2FF1, 0xF163, 0xF16A, 0x3015, 0xF16B, 0xF16B, 0x3160,
+ 0xF16C, 0xF17E, 0x301D, 0xF1A1, 0xF1FE, 0x3030, 0xF240, 0xF267, 0x308E,
+ 0xF268, 0xF268, 0x31EF, 0xF269, 0xF27E, 0x30B6, 0xF2A1, 0xF2C2, 0x30CC,
+ 0xF2C3, 0xF2FE, 0x30EF, 0xF340, 0xF374, 0x312B, 0xF375, 0xF37E, 0x3161,
+ 0xF3A1, 0xF3FE, 0x316B, 0xF440, 0xF465, 0x31C9, 0xF466, 0xF47E, 0x31F0,
+ 0xF4A1, 0xF4B4, 0x3209, 0xF4B5, 0xF4B5, 0x30EE, 0xF4B6, 0xF4FC, 0x321D,
+ 0xF4FD, 0xF4FE, 0x3265, 0xF540, 0xF57E, 0x3267, 0xF5A1, 0xF5FE, 0x32A6,
+ 0xF640, 0xF662, 0x3304, 0xF663, 0xF663, 0x3264, 0xF664, 0xF67E, 0x3327,
+ 0xF6A1, 0xF6FE, 0x3342, 0xF740, 0xF77E, 0x33A0, 0xF7A1, 0xF7FE, 0x33DF,
+ 0xF840, 0xF87E, 0x343D, 0xF8A1, 0xF8FE, 0x347C, 0xF940, 0xF976, 0x34DA,
+ 0xF977, 0xF97E, 0x3512, 0xF9A1, 0xF9C3, 0x351A, 0xF9C4, 0xF9C4, 0x3511,
+ 0xF9C5, 0xF9C5, 0x353D, 0xF9C6, 0xF9C6, 0x3549, 0xF9C7, 0xF9D1, 0x353E,
+ 0xF9D2, 0xF9D5, 0x354A, 0xF9D6, 0xF9FE, 0x36E8,
+};
diff --git a/core/src/fpdfapi/fpdf_cmaps/CNS1/ETen-B5-V_0.cpp b/core/src/fpdfapi/fpdf_cmaps/CNS1/ETen-B5-V_0.cpp
index e1d9e238f8..941c1f2b9a 100644
--- a/core/src/fpdfapi/fpdf_cmaps/CNS1/ETen-B5-V_0.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/CNS1/ETen-B5-V_0.cpp
@@ -1,13 +1,13 @@
-// 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
-
-extern const unsigned short g_FXCMAP_ETen_B5_V_0[13 * 3] = {
- 0xA14B, 0xA14B, 0x354E, 0xA15A, 0xA15A, 0x35AF, 0xA15C, 0xA15C, 0x35B1,
- 0xA15D, 0xA15E, 0x0082, 0xA161, 0xA162, 0x0086, 0xA165, 0xA166, 0x008A,
- 0xA169, 0xA16A, 0x008E, 0xA16D, 0xA16E, 0x0092, 0xA171, 0xA172, 0x0096,
- 0xA175, 0xA176, 0x009A, 0xA179, 0xA17A, 0x009E, 0xA1E3, 0xA1E3, 0x354F,
- 0xC6E4, 0xC6E5, 0x3711,
-};
+// 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
+
+extern const unsigned short g_FXCMAP_ETen_B5_V_0[13 * 3] = {
+ 0xA14B, 0xA14B, 0x354E, 0xA15A, 0xA15A, 0x35AF, 0xA15C, 0xA15C, 0x35B1,
+ 0xA15D, 0xA15E, 0x0082, 0xA161, 0xA162, 0x0086, 0xA165, 0xA166, 0x008A,
+ 0xA169, 0xA16A, 0x008E, 0xA16D, 0xA16E, 0x0092, 0xA171, 0xA172, 0x0096,
+ 0xA175, 0xA176, 0x009A, 0xA179, 0xA17A, 0x009E, 0xA1E3, 0xA1E3, 0x354F,
+ 0xC6E4, 0xC6E5, 0x3711,
+};
diff --git a/core/src/fpdfapi/fpdf_cmaps/CNS1/ETenms-B5-H_0.cpp b/core/src/fpdfapi/fpdf_cmaps/CNS1/ETenms-B5-H_0.cpp
index 1b5136e2ba..fae2633452 100644
--- a/core/src/fpdfapi/fpdf_cmaps/CNS1/ETenms-B5-H_0.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/CNS1/ETenms-B5-H_0.cpp
@@ -1,9 +1,9 @@
-// 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
-
-extern const unsigned short g_FXCMAP_ETenms_B5_H_0[1 * 3] = {
- 0x0020, 0x007E, 0x0001,
-};
+// 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
+
+extern const unsigned short g_FXCMAP_ETenms_B5_H_0[1 * 3] = {
+ 0x0020, 0x007E, 0x0001,
+};
diff --git a/core/src/fpdfapi/fpdf_cmaps/CNS1/ETenms-B5-V_0.cpp b/core/src/fpdfapi/fpdf_cmaps/CNS1/ETenms-B5-V_0.cpp
index 1b8ad0eb87..79b8a34053 100644
--- a/core/src/fpdfapi/fpdf_cmaps/CNS1/ETenms-B5-V_0.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/CNS1/ETenms-B5-V_0.cpp
@@ -1,14 +1,14 @@
-// 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
-
-extern const unsigned short g_FXCMAP_ETenms_B5_V_0[18 * 3] = {
- 0xA14B, 0xA14B, 0x354E, 0xA14C, 0xA14C, 0x006D, 0xA156, 0xA156, 0x0138,
- 0xA158, 0xA158, 0x007A, 0xA15A, 0xA15A, 0x35AF, 0xA15C, 0xA15C, 0x35B1,
- 0xA15D, 0xA15E, 0x0082, 0xA161, 0xA162, 0x0086, 0xA165, 0xA166, 0x008A,
- 0xA169, 0xA16A, 0x008E, 0xA16D, 0xA16E, 0x0092, 0xA171, 0xA172, 0x0096,
- 0xA175, 0xA176, 0x009A, 0xA179, 0xA17A, 0x009E, 0xA17D, 0xA17E, 0x0082,
- 0xA1A1, 0xA1A2, 0x0086, 0xA1A3, 0xA1A4, 0x008A, 0xC6E4, 0xC6E5, 0x3711,
-};
+// 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
+
+extern const unsigned short g_FXCMAP_ETenms_B5_V_0[18 * 3] = {
+ 0xA14B, 0xA14B, 0x354E, 0xA14C, 0xA14C, 0x006D, 0xA156, 0xA156, 0x0138,
+ 0xA158, 0xA158, 0x007A, 0xA15A, 0xA15A, 0x35AF, 0xA15C, 0xA15C, 0x35B1,
+ 0xA15D, 0xA15E, 0x0082, 0xA161, 0xA162, 0x0086, 0xA165, 0xA166, 0x008A,
+ 0xA169, 0xA16A, 0x008E, 0xA16D, 0xA16E, 0x0092, 0xA171, 0xA172, 0x0096,
+ 0xA175, 0xA176, 0x009A, 0xA179, 0xA17A, 0x009E, 0xA17D, 0xA17E, 0x0082,
+ 0xA1A1, 0xA1A2, 0x0086, 0xA1A3, 0xA1A4, 0x008A, 0xC6E4, 0xC6E5, 0x3711,
+};
diff --git a/core/src/fpdfapi/fpdf_cmaps/CNS1/UniCNS-UTF16-H_0.cpp b/core/src/fpdfapi/fpdf_cmaps/CNS1/UniCNS-UTF16-H_0.cpp
index d29a725fb6..ea7f118386 100644
--- a/core/src/fpdfapi/fpdf_cmaps/CNS1/UniCNS-UTF16-H_0.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/CNS1/UniCNS-UTF16-H_0.cpp
@@ -1,3651 +1,3651 @@
-// 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
-
-extern const unsigned short g_FXCMAP_UniCNS_UTF16_H_0[14557 * 2] = {
- 0x0020, 0x0001, 0x0021, 0x0002, 0x0022, 0x0003, 0x0023, 0x0004,
- 0x0024, 0x0005, 0x0025, 0x0006, 0x0026, 0x0007, 0x0027, 0x0008,
- 0x0028, 0x0009, 0x0029, 0x000A, 0x002A, 0x000B, 0x002B, 0x000C,
- 0x002C, 0x000D, 0x002D, 0x000E, 0x002E, 0x000F, 0x002F, 0x0010,
- 0x0030, 0x0011, 0x0031, 0x0012, 0x0032, 0x0013, 0x0033, 0x0014,
- 0x0034, 0x0015, 0x0035, 0x0016, 0x0036, 0x0017, 0x0037, 0x0018,
- 0x0038, 0x0019, 0x0039, 0x001A, 0x003A, 0x001B, 0x003B, 0x001C,
- 0x003C, 0x001D, 0x003D, 0x001E, 0x003E, 0x001F, 0x003F, 0x0020,
- 0x0040, 0x0021, 0x0041, 0x0022, 0x0042, 0x0023, 0x0043, 0x0024,
- 0x0044, 0x0025, 0x0045, 0x0026, 0x0046, 0x0027, 0x0047, 0x0028,
- 0x0048, 0x0029, 0x0049, 0x002A, 0x004A, 0x002B, 0x004B, 0x002C,
- 0x004C, 0x002D, 0x004D, 0x002E, 0x004E, 0x002F, 0x004F, 0x0030,
- 0x0050, 0x0031, 0x0051, 0x0032, 0x0052, 0x0033, 0x0053, 0x0034,
- 0x0054, 0x0035, 0x0055, 0x0036, 0x0056, 0x0037, 0x0057, 0x0038,
- 0x0058, 0x0039, 0x0059, 0x003A, 0x005A, 0x003B, 0x005B, 0x003C,
- 0x005C, 0x003D, 0x005D, 0x003E, 0x005E, 0x003F, 0x005F, 0x0040,
- 0x0060, 0x0041, 0x0061, 0x0042, 0x0062, 0x0043, 0x0063, 0x0044,
- 0x0064, 0x0045, 0x0065, 0x0046, 0x0066, 0x0047, 0x0067, 0x0048,
- 0x0068, 0x0049, 0x0069, 0x004A, 0x006A, 0x004B, 0x006B, 0x004C,
- 0x006C, 0x004D, 0x006D, 0x004E, 0x006E, 0x004F, 0x006F, 0x0050,
- 0x0070, 0x0051, 0x0071, 0x0052, 0x0072, 0x0053, 0x0073, 0x0054,
- 0x0074, 0x0055, 0x0075, 0x0056, 0x0076, 0x0057, 0x0077, 0x0058,
- 0x0078, 0x0059, 0x0079, 0x005A, 0x007A, 0x005B, 0x007B, 0x005C,
- 0x007C, 0x005D, 0x007D, 0x005E, 0x007E, 0x005F, 0x00A2, 0x0106,
- 0x00A3, 0x0107, 0x00A5, 0x0104, 0x00A7, 0x00B2, 0x00A8, 0x35B3,
- 0x00AC, 0x36E1, 0x00AF, 0x00C3, 0x00B0, 0x0118, 0x00B1, 0x00D4,
- 0x00B7, 0x0073, 0x00D7, 0x00D2, 0x00F7, 0x00D3, 0x02C6, 0x35B4,
- 0x02C7, 0x01F8, 0x02CA, 0x01F7, 0x02CB, 0x01F9, 0x02CD, 0x00C6,
- 0x02D9, 0x01F6, 0x0308, 0x35B3, 0x0391, 0x01A1, 0x0392, 0x01A2,
- 0x0393, 0x01A3, 0x0394, 0x01A4, 0x0395, 0x01A5, 0x0396, 0x01A6,
- 0x0397, 0x01A7, 0x0398, 0x01A8, 0x0399, 0x01A9, 0x039A, 0x01AA,
- 0x039B, 0x01AB, 0x039C, 0x01AC, 0x039D, 0x01AD, 0x039E, 0x01AE,
- 0x039F, 0x01AF, 0x03A0, 0x01B0, 0x03A1, 0x01B1, 0x03A3, 0x01B2,
- 0x03A4, 0x01B3, 0x03A5, 0x01B4, 0x03A6, 0x01B5, 0x03A7, 0x01B6,
- 0x03A8, 0x01B7, 0x03A9, 0x01B8, 0x03B1, 0x01B9, 0x03B2, 0x01BA,
- 0x03B3, 0x01BB, 0x03B4, 0x01BC, 0x03B5, 0x01BD, 0x03B6, 0x01BE,
- 0x03B7, 0x01BF, 0x03B8, 0x01C0, 0x03B9, 0x01C1, 0x03BA, 0x01C2,
- 0x03BB, 0x01C3, 0x03BC, 0x01C4, 0x03BD, 0x01C5, 0x03BE, 0x01C6,
- 0x03BF, 0x01C7, 0x03C0, 0x01C8, 0x03C1, 0x01C9, 0x03C3, 0x01CA,
- 0x03C4, 0x01CB, 0x03C5, 0x01CC, 0x03C6, 0x01CD, 0x03C7, 0x01CE,
- 0x03C8, 0x01CF, 0x03C9, 0x01D0, 0x0401, 0x3670, 0x0410, 0x366A,
- 0x0411, 0x366B, 0x0412, 0x366C, 0x0413, 0x366D, 0x0414, 0x366E,
- 0x0415, 0x366F, 0x0416, 0x3671, 0x0417, 0x3672, 0x0418, 0x3673,
- 0x0419, 0x3674, 0x041A, 0x3675, 0x041B, 0x3676, 0x041C, 0x3677,
- 0x041D, 0x3678, 0x041E, 0x3679, 0x041F, 0x367A, 0x0420, 0x367B,
- 0x0421, 0x367C, 0x0422, 0x367D, 0x0423, 0x367E, 0x0424, 0x367F,
- 0x0425, 0x3680, 0x0426, 0x3681, 0x0427, 0x3682, 0x0428, 0x3683,
- 0x0429, 0x3684, 0x042A, 0x3685, 0x042B, 0x3686, 0x042C, 0x3687,
- 0x042D, 0x3688, 0x042E, 0x3689, 0x042F, 0x368A, 0x0430, 0x368B,
- 0x0431, 0x368C, 0x0432, 0x368D, 0x0433, 0x368E, 0x0434, 0x368F,
- 0x0435, 0x3690, 0x0436, 0x3692, 0x0437, 0x3693, 0x0438, 0x3694,
- 0x0439, 0x3695, 0x043A, 0x3696, 0x043B, 0x3697, 0x043C, 0x3698,
- 0x043D, 0x3699, 0x043E, 0x369A, 0x043F, 0x369B, 0x0440, 0x369C,
- 0x0441, 0x369D, 0x0442, 0x369E, 0x0443, 0x369F, 0x0444, 0x36A0,
- 0x0445, 0x36A1, 0x0446, 0x36A2, 0x0447, 0x36A3, 0x0448, 0x36A4,
- 0x0449, 0x36A5, 0x044A, 0x36A6, 0x044B, 0x36A7, 0x044C, 0x36A8,
- 0x044D, 0x36A9, 0x044E, 0x36AA, 0x044F, 0x36AB, 0x0451, 0x3691,
- 0x2013, 0x0079, 0x2014, 0x007B, 0x2018, 0x00A6, 0x2019, 0x00A7,
- 0x201C, 0x00A8, 0x201D, 0x00A9, 0x2022, 0x0068, 0x2025, 0x006F,
- 0x2026, 0x006E, 0x2027, 0x0068, 0x2032, 0x00AD, 0x2035, 0x00AC,
- 0x203B, 0x00B1, 0x203E, 0x00C3, 0x2103, 0x010A, 0x2105, 0x00C2,
- 0x2109, 0x010B, 0x2116, 0x36E6, 0x2121, 0x36E7, 0x2160, 0x0157,
- 0x2161, 0x0158, 0x2162, 0x0159, 0x2163, 0x015A, 0x2164, 0x015B,
- 0x2165, 0x015C, 0x2166, 0x015D, 0x2167, 0x015E, 0x2168, 0x015F,
- 0x2169, 0x0160, 0x2170, 0x020E, 0x2171, 0x020F, 0x2172, 0x0210,
- 0x2173, 0x0211, 0x2174, 0x0212, 0x2175, 0x0213, 0x2176, 0x0214,
- 0x2177, 0x0215, 0x2178, 0x0216, 0x2179, 0x0217, 0x2190, 0x00F8,
- 0x2191, 0x00F5, 0x2192, 0x00F7, 0x2193, 0x00F6, 0x2196, 0x00F9,
- 0x2197, 0x00FA, 0x2198, 0x00FC, 0x2199, 0x00FB, 0x21B8, 0x36AD,
- 0x21B9, 0x36AE, 0x21E7, 0x36AC, 0x2215, 0x0101, 0x221A, 0x00D5,
- 0x221E, 0x00DC, 0x221F, 0x00E9, 0x2220, 0x00E8, 0x2223, 0x00FE,
- 0x2225, 0x00FD, 0x2229, 0x00E5, 0x222A, 0x00E6, 0x222B, 0x00ED,
- 0x222E, 0x00EE, 0x2234, 0x00F0, 0x2235, 0x00EF, 0x223C, 0x00E4,
- 0x2252, 0x00DD, 0x2260, 0x00DB, 0x2261, 0x00DE, 0x2266, 0x00D9,
- 0x2267, 0x00DA, 0x2295, 0x00F3, 0x2299, 0x00F4, 0x22A5, 0x00E7,
- 0x22BF, 0x00EA, 0x22EF, 0x006E, 0x2400, 0x0232, 0x2401, 0x0233,
- 0x2402, 0x0234, 0x2403, 0x0235, 0x2404, 0x0236, 0x2405, 0x0237,
- 0x2406, 0x0238, 0x2407, 0x0239, 0x2408, 0x023A, 0x2409, 0x023B,
- 0x240A, 0x023C, 0x240B, 0x023D, 0x240C, 0x023E, 0x240D, 0x023F,
- 0x240E, 0x0240, 0x240F, 0x0241, 0x2410, 0x0242, 0x2411, 0x0243,
- 0x2412, 0x0244, 0x2413, 0x0245, 0x2414, 0x0246, 0x2415, 0x0247,
- 0x2416, 0x0248, 0x2417, 0x0249, 0x2418, 0x024A, 0x2419, 0x024B,
- 0x241A, 0x024C, 0x241B, 0x024D, 0x241C, 0x024E, 0x241D, 0x024F,
- 0x241E, 0x0250, 0x241F, 0x0251, 0x2421, 0x0252, 0x2460, 0x01FA,
- 0x2461, 0x01FB, 0x2462, 0x01FC, 0x2463, 0x01FD, 0x2464, 0x01FE,
- 0x2465, 0x01FF, 0x2466, 0x0200, 0x2467, 0x0201, 0x2468, 0x0202,
- 0x2469, 0x0203, 0x2474, 0x0204, 0x2475, 0x0205, 0x2476, 0x0206,
- 0x2477, 0x0207, 0x2478, 0x0208, 0x2479, 0x0209, 0x247A, 0x020A,
- 0x247B, 0x020B, 0x247C, 0x020C, 0x247D, 0x020D, 0x2500, 0x0137,
- 0x2502, 0x0138, 0x250C, 0x013A, 0x2510, 0x013B, 0x2514, 0x013C,
- 0x2518, 0x013D, 0x251C, 0x0135, 0x2524, 0x0134, 0x252C, 0x0133,
- 0x2534, 0x0132, 0x253C, 0x0131, 0x2550, 0x0142, 0x2551, 0x370A,
- 0x2552, 0x36F8, 0x2553, 0x3701, 0x2554, 0x36EF, 0x2555, 0x36FA,
- 0x2556, 0x3703, 0x2557, 0x36F1, 0x2558, 0x36FE, 0x2559, 0x3707,
- 0x255A, 0x36F5, 0x255B, 0x3700, 0x255C, 0x3709, 0x255D, 0x36F7,
- 0x255E, 0x0143, 0x255F, 0x3704, 0x2560, 0x36F2, 0x2561, 0x0145,
- 0x2562, 0x3706, 0x2563, 0x36F4, 0x2564, 0x36F9, 0x2565, 0x3702,
- 0x2566, 0x36F0, 0x2567, 0x36FF, 0x2568, 0x3708, 0x2569, 0x36F6,
- 0x256A, 0x0144, 0x256B, 0x3705, 0x256C, 0x36F3, 0x256D, 0x013E,
- 0x256E, 0x013F, 0x256F, 0x0141, 0x2570, 0x0140, 0x2571, 0x014A,
- 0x2572, 0x014B, 0x2573, 0x014C, 0x2574, 0x35B0, 0x2581, 0x0122,
- 0x2582, 0x0123, 0x2583, 0x0124, 0x2584, 0x0125, 0x2585, 0x0126,
- 0x2586, 0x0127, 0x2587, 0x0128, 0x2588, 0x0129, 0x2589, 0x0130,
- 0x258A, 0x012F, 0x258B, 0x012E, 0x258C, 0x012D, 0x258D, 0x012C,
- 0x258E, 0x012B, 0x258F, 0x012A, 0x2593, 0x3710, 0x2594, 0x0136,
- 0x2595, 0x0139, 0x25A0, 0x00BE, 0x25A1, 0x00BD, 0x25B2, 0x00B7,
- 0x25B3, 0x00B6, 0x25BC, 0x00C0, 0x25BD, 0x00BF, 0x25C6, 0x00BC,
- 0x25C7, 0x00BB, 0x25CB, 0x00B4, 0x25CE, 0x00B8, 0x25CF, 0x00B5,
- 0x25E2, 0x0146, 0x25E3, 0x0147, 0x25E4, 0x0149, 0x25E5, 0x0148,
- 0x2605, 0x00BA, 0x2606, 0x00B9, 0x2609, 0x00F4, 0x2640, 0x00F1,
- 0x2641, 0x00F3, 0x2642, 0x00F2, 0x273D, 0x35C0, 0x2F00, 0x0253,
- 0x2F01, 0x0218, 0x2F02, 0x0219, 0x2F03, 0x021A, 0x2F04, 0x0254,
- 0x2F05, 0x021B, 0x2F06, 0x025A, 0x2F07, 0x021C, 0x2F08, 0x025B,
- 0x2F09, 0x025C, 0x2F0A, 0x025D, 0x2F0B, 0x025E, 0x2F0C, 0x021D,
- 0x2F0D, 0x021E, 0x2F0E, 0x021F, 0x2F0F, 0x025F, 0x2F10, 0x176E,
- 0x2F11, 0x0260, 0x2F12, 0x0262, 0x2F13, 0x0220, 0x2F14, 0x0263,
- 0x2F15, 0x176F, 0x2F16, 0x0221, 0x2F17, 0x0264, 0x2F18, 0x0265,
- 0x2F19, 0x0222, 0x2F1A, 0x1770, 0x2F1B, 0x0223, 0x2F1C, 0x0266,
- 0x2F1D, 0x0279, 0x2F1E, 0x1775, 0x2F1F, 0x027A, 0x2F20, 0x027B,
- 0x2F21, 0x0224, 0x2F22, 0x0224, 0x2F23, 0x027C, 0x2F24, 0x027D,
- 0x2F25, 0x027E, 0x2F26, 0x027F, 0x2F27, 0x0225, 0x2F28, 0x0282,
- 0x2F29, 0x0283, 0x2F2A, 0x0284, 0x2F2B, 0x0285, 0x2F2C, 0x1776,
- 0x2F2D, 0x0286, 0x2F2E, 0x0226, 0x2F2F, 0x0288, 0x2F30, 0x0289,
- 0x2F31, 0x028C, 0x2F32, 0x028D, 0x2F33, 0x0227, 0x2F34, 0x0228,
- 0x2F35, 0x0229, 0x2F36, 0x028E, 0x2F37, 0x028F, 0x2F38, 0x0290,
- 0x2F39, 0x022A, 0x2F3A, 0x022B, 0x2F3B, 0x1777, 0x2F3C, 0x02D0,
- 0x2F3D, 0x02D1, 0x2F3E, 0x02D2, 0x2F3F, 0x02D3, 0x2F40, 0x02D5,
- 0x2F41, 0x022C, 0x2F42, 0x02D6, 0x2F43, 0x02D7, 0x2F44, 0x02D8,
- 0x2F45, 0x02D9, 0x2F46, 0x022D, 0x2F47, 0x02DA, 0x2F48, 0x02DB,
- 0x2F49, 0x02DC, 0x2F4A, 0x02DD, 0x2F4B, 0x02DE, 0x2F4C, 0x02DF,
- 0x2F4D, 0x02E0, 0x2F4E, 0x178A, 0x2F4F, 0x02E1, 0x2F50, 0x02E2,
- 0x2F51, 0x02E3, 0x2F52, 0x02E4, 0x2F53, 0x178C, 0x2F54, 0x02E5,
- 0x2F55, 0x02E6, 0x2F56, 0x02E7, 0x2F57, 0x02E8, 0x2F58, 0x02E9,
- 0x2F59, 0x178D, 0x2F5A, 0x02EA, 0x2F5B, 0x02EB, 0x2F5C, 0x02EC,
- 0x2F5D, 0x02ED, 0x2F5E, 0x0356, 0x2F5F, 0x0357, 0x2F60, 0x0358,
- 0x2F61, 0x0359, 0x2F62, 0x035A, 0x2F63, 0x035B, 0x2F64, 0x035C,
- 0x2F65, 0x035E, 0x2F66, 0x0362, 0x2F67, 0x022E, 0x2F68, 0x022F,
- 0x2F69, 0x0363, 0x2F6A, 0x0364, 0x2F6B, 0x0365, 0x2F6C, 0x0366,
- 0x2F6D, 0x0367, 0x2F6E, 0x0368, 0x2F6F, 0x0369, 0x2F70, 0x036A,
- 0x2F71, 0x17B2, 0x2F72, 0x036B, 0x2F73, 0x036C, 0x2F74, 0x036D,
- 0x2F75, 0x03F6, 0x2F76, 0x03F7, 0x2F77, 0x03F8, 0x2F78, 0x03F9,
- 0x2F79, 0x1812, 0x2F7A, 0x03FA, 0x2F7B, 0x03FB, 0x2F7C, 0x03FC,
- 0x2F7D, 0x03FE, 0x2F7E, 0x03FF, 0x2F7F, 0x0400, 0x2F80, 0x0401,
- 0x2F81, 0x0402, 0x2F82, 0x0405, 0x2F83, 0x0406, 0x2F84, 0x0407,
- 0x2F85, 0x0408, 0x2F86, 0x0409, 0x2F87, 0x040A, 0x2F88, 0x040B,
- 0x2F89, 0x040C, 0x2F8A, 0x040D, 0x2F8B, 0x1813, 0x2F8C, 0x1818,
- 0x2F8D, 0x040F, 0x2F8E, 0x0410, 0x2F8F, 0x0411, 0x2F90, 0x0412,
- 0x2F91, 0x1819, 0x2F92, 0x0508, 0x2F93, 0x0509, 0x2F94, 0x050A,
- 0x2F95, 0x050B, 0x2F96, 0x050C, 0x2F97, 0x050D, 0x2F98, 0x18E7,
- 0x2F99, 0x050E, 0x2F9A, 0x050F, 0x2F9B, 0x0510, 0x2F9C, 0x0511,
- 0x2F9D, 0x0512, 0x2F9E, 0x0513, 0x2F9F, 0x0514, 0x2FA0, 0x0515,
- 0x2FA1, 0x0230, 0x2FA2, 0x051B, 0x2FA3, 0x0520, 0x2FA4, 0x0521,
- 0x2FA5, 0x0522, 0x2FA6, 0x0696, 0x2FA7, 0x0697, 0x2FA8, 0x0698,
- 0x2FA9, 0x0699, 0x2FAA, 0x0231, 0x2FAB, 0x069F, 0x2FAC, 0x06A0,
- 0x2FAE, 0x06A2, 0x2FAF, 0x0826, 0x2FB0, 0x0827, 0x2FB1, 0x0828,
- 0x2FB2, 0x0829, 0x2FB3, 0x082A, 0x2FB4, 0x082B, 0x2FB5, 0x082C,
- 0x2FB6, 0x082D, 0x2FB7, 0x082E, 0x2FB8, 0x082F, 0x2FB9, 0x0830,
- 0x2FBA, 0x09F5, 0x2FBB, 0x09F6, 0x2FBC, 0x09F7, 0x2FBD, 0x1E33,
- 0x2FBE, 0x09F8, 0x2FBF, 0x1E34, 0x2FC0, 0x09F9, 0x2FC1, 0x09FA,
- 0x2FC2, 0x0BE1, 0x2FC3, 0x0BE2, 0x2FC4, 0x0BE3, 0x2FC5, 0x0BE4,
- 0x2FC6, 0x0BE5, 0x2FC7, 0x0BE6, 0x2FC8, 0x0DBB, 0x2FC9, 0x0DBC,
- 0x2FCA, 0x0DBD, 0x2FCB, 0x2360, 0x2FCC, 0x2612, 0x2FCD, 0x0F7B,
- 0x2FCE, 0x0F7C, 0x2FCF, 0x0F7D, 0x2FD0, 0x1100, 0x2FD1, 0x1101,
- 0x2FD2, 0x1289, 0x2FD3, 0x13B2, 0x2FD4, 0x13B3, 0x2FD5, 0x2F0D,
- 0x3000, 0x0063, 0x3001, 0x0065, 0x3002, 0x0066, 0x3003, 0x00B3,
- 0x3005, 0x35BA, 0x3006, 0x35BB, 0x3007, 0x35BC, 0x3008, 0x0094,
- 0x3009, 0x0095, 0x300A, 0x0090, 0x300B, 0x0091, 0x300C, 0x0098,
- 0x300D, 0x0099, 0x300E, 0x009C, 0x300F, 0x009D, 0x3010, 0x008C,
- 0x3011, 0x008D, 0x3012, 0x0105, 0x3014, 0x0088, 0x3015, 0x0089,
- 0x301D, 0x00AA, 0x301E, 0x00AB, 0x3021, 0x0161, 0x3022, 0x0162,
- 0x3023, 0x0163, 0x3024, 0x0164, 0x3025, 0x0165, 0x3026, 0x0166,
- 0x3027, 0x0167, 0x3028, 0x0168, 0x3029, 0x0169, 0x3038, 0x016A,
- 0x3039, 0x016B, 0x303A, 0x016C, 0x3041, 0x35C1, 0x3042, 0x35C2,
- 0x3043, 0x35C3, 0x3044, 0x35C4, 0x3045, 0x35C5, 0x3046, 0x35C6,
- 0x3047, 0x35C7, 0x3048, 0x35C8, 0x3049, 0x35C9, 0x304A, 0x35CA,
- 0x304B, 0x35CB, 0x304C, 0x35CC, 0x304D, 0x35CD, 0x304E, 0x35CE,
- 0x304F, 0x35CF, 0x3050, 0x35D0, 0x3051, 0x35D1, 0x3052, 0x35D2,
- 0x3053, 0x35D3, 0x3054, 0x35D4, 0x3055, 0x35D5, 0x3056, 0x35D6,
- 0x3057, 0x35D7, 0x3058, 0x35D8, 0x3059, 0x35D9, 0x305A, 0x35DA,
- 0x305B, 0x35DB, 0x305C, 0x35DC, 0x305D, 0x35DD, 0x305E, 0x35DE,
- 0x305F, 0x35DF, 0x3060, 0x35E0, 0x3061, 0x35E1, 0x3062, 0x35E2,
- 0x3063, 0x35E3, 0x3064, 0x35E4, 0x3065, 0x35E5, 0x3066, 0x35E6,
- 0x3067, 0x35E7, 0x3068, 0x35E8, 0x3069, 0x35E9, 0x306A, 0x35EA,
- 0x306B, 0x35EB, 0x306C, 0x35EC, 0x306D, 0x35ED, 0x306E, 0x35EE,
- 0x306F, 0x35EF, 0x3070, 0x35F0, 0x3071, 0x35F1, 0x3072, 0x35F2,
- 0x3073, 0x35F3, 0x3074, 0x35F4, 0x3075, 0x35F5, 0x3076, 0x35F6,
- 0x3077, 0x35F7, 0x3078, 0x35F8, 0x3079, 0x35F9, 0x307A, 0x35FA,
- 0x307B, 0x35FB, 0x307C, 0x35FC, 0x307D, 0x35FD, 0x307E, 0x35FE,
- 0x307F, 0x35FF, 0x3080, 0x3600, 0x3081, 0x3601, 0x3082, 0x3602,
- 0x3083, 0x3603, 0x3084, 0x3604, 0x3085, 0x3605, 0x3086, 0x3606,
- 0x3087, 0x3607, 0x3088, 0x3608, 0x3089, 0x3609, 0x308A, 0x360A,
- 0x308B, 0x360B, 0x308C, 0x360C, 0x308D, 0x360D, 0x308E, 0x360E,
- 0x308F, 0x360F, 0x3090, 0x3610, 0x3091, 0x3611, 0x3092, 0x3612,
- 0x3093, 0x3613, 0x309D, 0x35B7, 0x309E, 0x35B8, 0x30A1, 0x3614,
- 0x30A2, 0x3615, 0x30A3, 0x3616, 0x30A4, 0x3617, 0x30A5, 0x3618,
- 0x30A6, 0x3619, 0x30A7, 0x361A, 0x30A8, 0x361B, 0x30A9, 0x361C,
- 0x30AA, 0x361D, 0x30AB, 0x361E, 0x30AC, 0x361F, 0x30AD, 0x3620,
- 0x30AE, 0x3621, 0x30AF, 0x3622, 0x30B0, 0x3623, 0x30B1, 0x3624,
- 0x30B2, 0x3625, 0x30B3, 0x3626, 0x30B4, 0x3627, 0x30B5, 0x3628,
- 0x30B6, 0x3629, 0x30B7, 0x362A, 0x30B8, 0x362B, 0x30B9, 0x362C,
- 0x30BA, 0x362D, 0x30BB, 0x362E, 0x30BC, 0x362F, 0x30BD, 0x3630,
- 0x30BE, 0x3631, 0x30BF, 0x3632, 0x30C0, 0x3633, 0x30C1, 0x3634,
- 0x30C2, 0x3635, 0x30C3, 0x3636, 0x30C4, 0x3637, 0x30C5, 0x3638,
- 0x30C6, 0x3639, 0x30C7, 0x363A, 0x30C8, 0x363B, 0x30C9, 0x363C,
- 0x30CA, 0x363D, 0x30CB, 0x363E, 0x30CC, 0x363F, 0x30CD, 0x3640,
- 0x30CE, 0x3641, 0x30CF, 0x3642, 0x30D0, 0x3643, 0x30D1, 0x3644,
- 0x30D2, 0x3645, 0x30D3, 0x3646, 0x30D4, 0x3647, 0x30D5, 0x3648,
- 0x30D6, 0x3649, 0x30D7, 0x364A, 0x30D8, 0x364B, 0x30D9, 0x364C,
- 0x30DA, 0x364D, 0x30DB, 0x364E, 0x30DC, 0x364F, 0x30DD, 0x3650,
- 0x30DE, 0x3651, 0x30DF, 0x3652, 0x30E0, 0x3653, 0x30E1, 0x3654,
- 0x30E2, 0x3655, 0x30E3, 0x3656, 0x30E4, 0x3657, 0x30E5, 0x3658,
- 0x30E6, 0x3659, 0x30E7, 0x365A, 0x30E8, 0x365B, 0x30E9, 0x365C,
- 0x30EA, 0x365D, 0x30EB, 0x365E, 0x30EC, 0x365F, 0x30ED, 0x3660,
- 0x30EE, 0x3661, 0x30EF, 0x3662, 0x30F0, 0x3663, 0x30F1, 0x3664,
- 0x30F2, 0x3665, 0x30F3, 0x3666, 0x30F4, 0x3667, 0x30F5, 0x3668,
- 0x30F6, 0x3669, 0x30FC, 0x35BD, 0x30FD, 0x35B5, 0x30FE, 0x35B6,
- 0x3105, 0x01D1, 0x3106, 0x01D2, 0x3107, 0x01D3, 0x3108, 0x01D4,
- 0x3109, 0x01D5, 0x310A, 0x01D6, 0x310B, 0x01D7, 0x310C, 0x01D8,
- 0x310D, 0x01D9, 0x310E, 0x01DA, 0x310F, 0x01DB, 0x3110, 0x01DC,
- 0x3111, 0x01DD, 0x3112, 0x01DE, 0x3113, 0x01DF, 0x3114, 0x01E0,
- 0x3115, 0x01E1, 0x3116, 0x01E2, 0x3117, 0x01E3, 0x3118, 0x01E4,
- 0x3119, 0x01E5, 0x311A, 0x01E6, 0x311B, 0x01E7, 0x311C, 0x01E8,
- 0x311D, 0x01E9, 0x311E, 0x01EA, 0x311F, 0x01EB, 0x3120, 0x01EC,
- 0x3121, 0x01ED, 0x3122, 0x01EE, 0x3123, 0x01EF, 0x3124, 0x01F0,
- 0x3125, 0x01F1, 0x3126, 0x01F2, 0x3127, 0x01F3, 0x3128, 0x01F4,
- 0x3129, 0x01F5, 0x3231, 0x36E5, 0x32A3, 0x00C1, 0x338E, 0x0115,
- 0x338F, 0x0116, 0x339C, 0x0110, 0x339D, 0x0111, 0x339E, 0x0112,
- 0x33A1, 0x0114, 0x33C4, 0x0117, 0x33CE, 0x0113, 0x33D1, 0x00EC,
- 0x33D2, 0x00EB, 0x33D5, 0x010F, 0x361D, 0x36B7, 0x4491, 0x36B4,
- 0x4E00, 0x0253, 0x4E01, 0x0255, 0x4E03, 0x0256, 0x4E07, 0x1771,
- 0x4E08, 0x0269, 0x4E09, 0x0267, 0x4E0A, 0x026A, 0x4E0B, 0x0268,
- 0x4E0C, 0x1772, 0x4E0D, 0x0294, 0x4E0E, 0x177A, 0x4E0F, 0x1778,
- 0x4E10, 0x0293, 0x4E11, 0x0292, 0x4E14, 0x02F2, 0x4E15, 0x02F1,
- 0x4E16, 0x02F0, 0x4E18, 0x02F3, 0x4E19, 0x02EF, 0x4E1E, 0x036E,
- 0x4E1F, 0x036F, 0x4E26, 0x0528, 0x4E28, 0x0218, 0x4E2B, 0x026B,
- 0x4E2D, 0x0295, 0x4E2E, 0x177B, 0x4E30, 0x0296, 0x4E31, 0x178E,
- 0x4E32, 0x0415, 0x4E33, 0x18F4, 0x4E36, 0x0219, 0x4E38, 0x026C,
- 0x4E39, 0x0297, 0x4E3B, 0x02F4, 0x4E3C, 0x178F, 0x4E3F, 0x021A,
- 0x4E41, 0x36AF, 0x4E42, 0x176C, 0x4E43, 0x0257, 0x4E45, 0x026E,
- 0x4E47, 0x1773, 0x4E48, 0x026F, 0x4E4B, 0x0298, 0x4E4D, 0x02F5,
- 0x4E4E, 0x02F7, 0x4E4F, 0x02F6, 0x4E52, 0x0370, 0x4E53, 0x0371,
- 0x4E56, 0x0529, 0x4E58, 0x0831, 0x4E59, 0x0254, 0x4E5A, 0x36B1,
- 0x4E5C, 0x176D, 0x4E5D, 0x0258, 0x4E5E, 0x0271, 0x4E5F, 0x0270,
- 0x4E69, 0x0372, 0x4E73, 0x052A, 0x4E7E, 0x09FB, 0x4E7F, 0x1E35,
- 0x4E82, 0x0DBE, 0x4E83, 0x2361, 0x4E84, 0x2362, 0x4E85, 0x021B,
- 0x4E86, 0x0259, 0x4E88, 0x029A, 0x4E8B, 0x052B, 0x4E8C, 0x025A,
- 0x4E8D, 0x1774, 0x4E8E, 0x0272, 0x4E91, 0x029B, 0x4E92, 0x029D,
- 0x4E93, 0x177C, 0x4E94, 0x029E, 0x4E95, 0x029C, 0x4E99, 0x0373,
- 0x4E9B, 0x052C, 0x4E9E, 0x052D, 0x4E9F, 0x06A3, 0x4EA0, 0x021C,
- 0x4EA1, 0x0273, 0x4EA2, 0x029F, 0x4EA4, 0x0374, 0x4EA5, 0x0376,
- 0x4EA6, 0x0375, 0x4EA8, 0x0416, 0x4EAB, 0x052E, 0x4EAC, 0x052F,
- 0x4EAD, 0x06A4, 0x4EAE, 0x06A5, 0x4EB3, 0x0832, 0x4EB6, 0x2363,
- 0x4EB9, 0x3377, 0x4EBA, 0x025B, 0x4EC0, 0x02A1, 0x4EC1, 0x02A0,
- 0x4EC2, 0x177D, 0x4EC3, 0x02A2, 0x4EC4, 0x02A8, 0x4EC6, 0x02A3,
- 0x4EC7, 0x02A4, 0x4EC8, 0x177F, 0x4EC9, 0x177E, 0x4ECA, 0x02A6,
- 0x4ECB, 0x02A7, 0x4ECD, 0x02A5, 0x4ED4, 0x02FA, 0x4ED5, 0x02FB,
- 0x4ED6, 0x02FC, 0x4ED7, 0x02FD, 0x4ED8, 0x02F9, 0x4ED9, 0x0300,
- 0x4EDA, 0x1795, 0x4EDC, 0x1791, 0x4EDD, 0x1794, 0x4EDE, 0x0301,
- 0x4EDF, 0x0311, 0x4EE1, 0x1793, 0x4EE3, 0x02FE, 0x4EE4, 0x02FF,
- 0x4EE5, 0x02F8, 0x4EE8, 0x1790, 0x4EE9, 0x1792, 0x4EF0, 0x0383,
- 0x4EF1, 0x17BA, 0x4EF2, 0x0380, 0x4EF3, 0x0384, 0x4EF4, 0x17C4,
- 0x4EF5, 0x17B8, 0x4EF6, 0x0381, 0x4EF7, 0x17BC, 0x4EFB, 0x0382,
- 0x4EFD, 0x0385, 0x4EFF, 0x0377, 0x4F00, 0x17BB, 0x4F01, 0x0386,
- 0x4F02, 0x17BF, 0x4F04, 0x17C3, 0x4F05, 0x17C0, 0x4F08, 0x17BD,
- 0x4F09, 0x0378, 0x4F0A, 0x037A, 0x4F0B, 0x0387, 0x4F0D, 0x037C,
- 0x4F0E, 0x17B5, 0x4F0F, 0x037F, 0x4F10, 0x037D, 0x4F11, 0x037E,
- 0x4F12, 0x17C5, 0x4F13, 0x17C2, 0x4F14, 0x17B9, 0x4F15, 0x037B,
- 0x4F18, 0x17B6, 0x4F19, 0x0379, 0x4F1D, 0x17BE, 0x4F22, 0x17C1,
- 0x4F2C, 0x17B7, 0x4F2D, 0x182F, 0x4F2F, 0x042C, 0x4F30, 0x041F,
- 0x4F33, 0x1830, 0x4F34, 0x041C, 0x4F36, 0x042E, 0x4F38, 0x0424,
- 0x4F3A, 0x0423, 0x4F3B, 0x1824, 0x4F3C, 0x0427, 0x4F3D, 0x0422,
- 0x4F3E, 0x1829, 0x4F3F, 0x1831, 0x4F41, 0x182D, 0x4F43, 0x0425,
- 0x4F46, 0x0428, 0x4F47, 0x0419, 0x4F48, 0x0431, 0x4F49, 0x1826,
- 0x4F4C, 0x1900, 0x4F4D, 0x0417, 0x4F4E, 0x042D, 0x4F4F, 0x0418,
- 0x4F50, 0x0420, 0x4F51, 0x0421, 0x4F52, 0x182B, 0x4F53, 0x1827,
- 0x4F54, 0x0426, 0x4F55, 0x041E, 0x4F56, 0x1823, 0x4F57, 0x041A,
- 0x4F58, 0x182E, 0x4F59, 0x042F, 0x4F5A, 0x0432, 0x4F5B, 0x041D,
- 0x4F5C, 0x042A, 0x4F5D, 0x0430, 0x4F5E, 0x041B, 0x4F5F, 0x182C,
- 0x4F60, 0x042B, 0x4F61, 0x1832, 0x4F62, 0x1825, 0x4F63, 0x0429,
- 0x4F64, 0x1828, 0x4F67, 0x182A, 0x4F69, 0x053D, 0x4F6A, 0x1902,
- 0x4F6B, 0x190E, 0x4F6C, 0x0535, 0x4F6E, 0x190F, 0x4F6F, 0x0530,
- 0x4F70, 0x053A, 0x4F73, 0x0533, 0x4F74, 0x18FC, 0x4F75, 0x053B,
- 0x4F76, 0x18FB, 0x4F77, 0x18FF, 0x4F78, 0x1906, 0x4F79, 0x1904,
- 0x4F7A, 0x0543, 0x4F7B, 0x053E, 0x4F7C, 0x18F6, 0x4F7D, 0x18F8,
- 0x4F7E, 0x0540, 0x4F7F, 0x0534, 0x4F80, 0x18F9, 0x4F81, 0x1905,
- 0x4F82, 0x190C, 0x4F83, 0x0539, 0x4F84, 0x18FE, 0x4F85, 0x18F7,
- 0x4F86, 0x0538, 0x4F87, 0x18FA, 0x4F88, 0x053C, 0x4F89, 0x18FD,
- 0x4F8B, 0x0537, 0x4F8D, 0x0532, 0x4F8F, 0x0541, 0x4F90, 0x1907,
- 0x4F91, 0x0542, 0x4F92, 0x190B, 0x4F94, 0x1909, 0x4F95, 0x190D,
- 0x4F96, 0x053F, 0x4F97, 0x1901, 0x4F98, 0x18F5, 0x4F9A, 0x1903,
- 0x4F9B, 0x0536, 0x4F9C, 0x1908, 0x4F9D, 0x0531, 0x4F9E, 0x190A,
- 0x4FAE, 0x06B4, 0x4FAF, 0x06A8, 0x4FB2, 0x1A5D, 0x4FB3, 0x1A65,
- 0x4FB5, 0x06A7, 0x4FB6, 0x06AF, 0x4FB7, 0x06BB, 0x4FB9, 0x1A6B,
- 0x4FBA, 0x1A69, 0x4FBB, 0x1A64, 0x4FBF, 0x06A9, 0x4FC0, 0x1A6A,
- 0x4FC1, 0x1A60, 0x4FC2, 0x06B7, 0x4FC3, 0x06AE, 0x4FC4, 0x06B6,
- 0x4FC5, 0x1A5B, 0x4FC7, 0x1A67, 0x4FC9, 0x1A5E, 0x4FCA, 0x06B2,
- 0x4FCB, 0x1A5F, 0x4FCD, 0x1A5A, 0x4FCE, 0x06B9, 0x4FCF, 0x06AC,
- 0x4FD0, 0x06B5, 0x4FD1, 0x06AB, 0x4FD3, 0x1A5C, 0x4FD4, 0x1A61,
- 0x4FD6, 0x1A68, 0x4FD7, 0x06B3, 0x4FD8, 0x06B0, 0x4FD9, 0x1A63,
- 0x4FDA, 0x06B8, 0x4FDB, 0x1A66, 0x4FDC, 0x1A62, 0x4FDD, 0x06AD,
- 0x4FDE, 0x06BA, 0x4FDF, 0x06B1, 0x4FE0, 0x06AA, 0x4FE1, 0x06A6,
- 0x4FEC, 0x1A6C, 0x4FEE, 0x084C, 0x4FEF, 0x0836, 0x4FF1, 0x0846,
- 0x4FF3, 0x084B, 0x4FF4, 0x1C24, 0x4FF5, 0x1C23, 0x4FF6, 0x1C28,
- 0x4FF7, 0x1C29, 0x4FF8, 0x0839, 0x4FFA, 0x0842, 0x4FFE, 0x084F,
- 0x5000, 0x0843, 0x5005, 0x1C1D, 0x5006, 0x083C, 0x5007, 0x1C1E,
- 0x5009, 0x0851, 0x500B, 0x0848, 0x500C, 0x0833, 0x500D, 0x0834,
- 0x500E, 0x1C31, 0x500F, 0x0A0C, 0x5011, 0x0841, 0x5012, 0x0840,
- 0x5013, 0x1C1F, 0x5014, 0x0844, 0x5015, 0x1E45, 0x5016, 0x083B,
- 0x5017, 0x1C2A, 0x5018, 0x084A, 0x5019, 0x0849, 0x501A, 0x083F,
- 0x501B, 0x1C22, 0x501C, 0x1C2B, 0x501E, 0x1C1C, 0x501F, 0x083E,
- 0x5020, 0x1C2C, 0x5021, 0x0847, 0x5022, 0x1C20, 0x5023, 0x0835,
- 0x5025, 0x0838, 0x5026, 0x0837, 0x5027, 0x1C2D, 0x5028, 0x0845,
- 0x5029, 0x083A, 0x502A, 0x084E, 0x502B, 0x0850, 0x502C, 0x1C27,
- 0x502D, 0x084D, 0x502F, 0x1C2F, 0x5030, 0x1C21, 0x5031, 0x1C30,
- 0x5033, 0x1C25, 0x5035, 0x1C2E, 0x5037, 0x1C26, 0x503C, 0x083D,
- 0x5040, 0x1E4D, 0x5041, 0x1E41, 0x5043, 0x0A00, 0x5045, 0x1E46,
- 0x5046, 0x1E4C, 0x5047, 0x09FF, 0x5048, 0x1E3F, 0x5049, 0x0A03,
- 0x504A, 0x1E43, 0x504B, 0x1E3C, 0x504C, 0x0A01, 0x504D, 0x1E40,
- 0x504E, 0x0A06, 0x504F, 0x0A0B, 0x5051, 0x1E51, 0x5053, 0x1E3B,
- 0x5055, 0x0A07, 0x5057, 0x1E50, 0x505A, 0x0A02, 0x505B, 0x1E42,
- 0x505C, 0x09FE, 0x505D, 0x1E3D, 0x505E, 0x1E39, 0x505F, 0x1E47,
- 0x5060, 0x1E3A, 0x5061, 0x1E38, 0x5062, 0x1E44, 0x5063, 0x1E4A,
- 0x5064, 0x1E4B, 0x5065, 0x0A04, 0x5068, 0x20B8, 0x5069, 0x1E48,
- 0x506A, 0x1E37, 0x506B, 0x1E49, 0x506D, 0x0A0E, 0x506E, 0x1E4E,
- 0x506F, 0x0A0D, 0x5070, 0x1E36, 0x5072, 0x1E3E, 0x5073, 0x1E4F,
- 0x5074, 0x0A09, 0x5075, 0x0A08, 0x5076, 0x0A05, 0x5077, 0x0A0A,
- 0x507A, 0x09FC, 0x507D, 0x09FD, 0x5080, 0x0BEC, 0x5082, 0x20BB,
- 0x5083, 0x20B4, 0x5085, 0x0BE9, 0x5087, 0x20BC, 0x508B, 0x20B2,
- 0x508C, 0x20B5, 0x508D, 0x0BE8, 0x508E, 0x20B6, 0x5091, 0x0BEB,
- 0x5092, 0x20BA, 0x5094, 0x20B0, 0x5095, 0x20AF, 0x5096, 0x0BED,
- 0x5098, 0x0BEE, 0x5099, 0x0BEA, 0x509A, 0x0BEF, 0x509B, 0x20AE,
- 0x509C, 0x20B9, 0x509D, 0x20B7, 0x509E, 0x20B1, 0x50A2, 0x0BE7,
- 0x50A3, 0x20B3, 0x50AC, 0x0DC5, 0x50AD, 0x0DBF, 0x50AE, 0x2367,
- 0x50AF, 0x0DC8, 0x50B0, 0x236D, 0x50B1, 0x2370, 0x50B2, 0x0DC1,
- 0x50B3, 0x0DC2, 0x50B4, 0x236A, 0x50B5, 0x0DC0, 0x50B6, 0x2373,
- 0x50B7, 0x0DC6, 0x50B8, 0x2374, 0x50BA, 0x236F, 0x50BB, 0x0DC7,
- 0x50BD, 0x2364, 0x50BE, 0x0DC4, 0x50BF, 0x2365, 0x50C1, 0x236E,
- 0x50C2, 0x236C, 0x50C4, 0x2368, 0x50C5, 0x0DC3, 0x50C6, 0x2366,
- 0x50C7, 0x0DC9, 0x50C8, 0x236B, 0x50C9, 0x2372, 0x50CA, 0x2369,
- 0x50CB, 0x2371, 0x50CE, 0x0F88, 0x50CF, 0x0F85, 0x50D1, 0x0F86,
- 0x50D3, 0x261C, 0x50D4, 0x2614, 0x50D5, 0x0F84, 0x50D6, 0x0F81,
- 0x50D7, 0x2615, 0x50DA, 0x0F83, 0x50DB, 0x2618, 0x50DD, 0x261A,
- 0x50E0, 0x2621, 0x50E3, 0x2620, 0x50E4, 0x261B, 0x50E5, 0x0F80,
- 0x50E6, 0x2613, 0x50E7, 0x0F7E, 0x50E8, 0x2616, 0x50E9, 0x0F89,
- 0x50EA, 0x2619, 0x50EC, 0x261D, 0x50ED, 0x0F82, 0x50EE, 0x0F7F,
- 0x50EF, 0x261F, 0x50F0, 0x261E, 0x50F1, 0x0F87, 0x50F3, 0x2617,
- 0x50F5, 0x1105, 0x50F6, 0x2883, 0x50F8, 0x2880, 0x50F9, 0x1106,
- 0x50FB, 0x1104, 0x50FD, 0x2887, 0x50FE, 0x2884, 0x50FF, 0x287D,
- 0x5100, 0x1103, 0x5102, 0x1107, 0x5103, 0x287E, 0x5104, 0x1102,
- 0x5105, 0x110A, 0x5106, 0x2881, 0x5107, 0x2882, 0x5108, 0x1108,
- 0x5109, 0x1109, 0x510A, 0x2888, 0x510B, 0x2885, 0x510C, 0x2886,
- 0x5110, 0x128D, 0x5111, 0x2B04, 0x5112, 0x128A, 0x5113, 0x2B01,
- 0x5114, 0x128C, 0x5115, 0x128E, 0x5117, 0x2B02, 0x5118, 0x128B,
- 0x511A, 0x2B03, 0x511C, 0x2B00, 0x511F, 0x13B5, 0x5120, 0x2D3E,
- 0x5121, 0x13B6, 0x5122, 0x2D3C, 0x5124, 0x2D3D, 0x5125, 0x2D3B,
- 0x5126, 0x2D3A, 0x5129, 0x2D3F, 0x512A, 0x13B4, 0x512D, 0x2F0F,
- 0x512E, 0x2F10, 0x5130, 0x287F, 0x5131, 0x2F0E, 0x5132, 0x13B7,
- 0x5133, 0x1575, 0x5134, 0x307A, 0x5135, 0x307B, 0x5137, 0x1668,
- 0x5138, 0x1669, 0x5139, 0x32C6, 0x513A, 0x32C5, 0x513B, 0x16BC,
- 0x513C, 0x16BB, 0x513D, 0x340E, 0x513F, 0x025C, 0x5140, 0x0274,
- 0x5141, 0x02AA, 0x5143, 0x02A9, 0x5144, 0x0303, 0x5145, 0x0302,
- 0x5146, 0x038A, 0x5147, 0x0389, 0x5148, 0x038B, 0x5149, 0x0388,
- 0x514B, 0x0434, 0x514C, 0x0433, 0x514D, 0x0435, 0x5152, 0x0545,
- 0x5154, 0x0544, 0x5155, 0x0546, 0x5157, 0x06BC, 0x5159, 0x0119,
- 0x515A, 0x1C32, 0x515B, 0x011A, 0x515C, 0x0A0F, 0x515D, 0x011C,
- 0x515E, 0x011B, 0x515F, 0x20BD, 0x5161, 0x011D, 0x5162, 0x0F8A,
- 0x5163, 0x011E, 0x5165, 0x025D, 0x5167, 0x02AB, 0x5168, 0x038C,
- 0x5169, 0x0547, 0x516B, 0x025E, 0x516C, 0x02AE, 0x516D, 0x02AC,
- 0x516E, 0x02AD, 0x5171, 0x038D, 0x5175, 0x0436, 0x5176, 0x0549,
- 0x5177, 0x0548, 0x5178, 0x054A, 0x517C, 0x0852, 0x5180, 0x128F,
- 0x5182, 0x021D, 0x5187, 0x1779, 0x5188, 0x36B6, 0x5189, 0x0304,
- 0x518A, 0x0305, 0x518D, 0x038E, 0x518F, 0x1833, 0x5191, 0x06BE,
- 0x5192, 0x06BD, 0x5193, 0x1C34, 0x5194, 0x1C33, 0x5195, 0x0A10,
- 0x5196, 0x021E, 0x5197, 0x02AF, 0x5198, 0x1780, 0x519E, 0x1910,
- 0x51A0, 0x06BF, 0x51A2, 0x0855, 0x51A4, 0x0853, 0x51A5, 0x0854,
- 0x51AA, 0x1290, 0x51AB, 0x021F, 0x51AC, 0x0306, 0x51B0, 0x038F,
- 0x51B1, 0x17C6, 0x51B6, 0x0437, 0x51B7, 0x0438, 0x51B9, 0x1834,
- 0x51BC, 0x1911, 0x51BD, 0x054B, 0x51BE, 0x1912, 0x51C4, 0x1C36,
- 0x51C5, 0x1C37, 0x51C6, 0x0858, 0x51C8, 0x1C38, 0x51CA, 0x1C35,
- 0x51CB, 0x0859, 0x51CC, 0x0857, 0x51CD, 0x0856, 0x51CE, 0x1C39,
- 0x51D0, 0x1E52, 0x51D4, 0x20BE, 0x51D7, 0x2375, 0x51D8, 0x2622,
- 0x51DC, 0x110B, 0x51DD, 0x1291, 0x51DE, 0x2B05, 0x51E0, 0x025F,
- 0x51E1, 0x026D, 0x51F0, 0x0A11, 0x51F1, 0x0BF1, 0x51F3, 0x0F8B,
- 0x51F5, 0x176E, 0x51F6, 0x02B0, 0x51F8, 0x0309, 0x51F9, 0x0307,
- 0x51FA, 0x0308, 0x51FD, 0x054C, 0x5200, 0x0260, 0x5201, 0x0261,
- 0x5202, 0x36B3, 0x5203, 0x0275, 0x5206, 0x02B1, 0x5207, 0x02B2,
- 0x5208, 0x02B3, 0x5209, 0x1797, 0x520A, 0x030A, 0x520C, 0x1796,
- 0x520E, 0x0393, 0x5210, 0x17C8, 0x5211, 0x0391, 0x5212, 0x0392,
- 0x5213, 0x17C7, 0x5216, 0x0394, 0x5217, 0x0390, 0x521C, 0x1835,
- 0x521D, 0x068B, 0x521E, 0x1836, 0x5221, 0x1837, 0x5224, 0x043A,
- 0x5225, 0x0439, 0x5228, 0x043D, 0x5229, 0x043B, 0x522A, 0x043C,
- 0x522E, 0x0552, 0x5230, 0x0551, 0x5231, 0x1917, 0x5232, 0x1914,
- 0x5233, 0x1915, 0x5235, 0x1913, 0x5236, 0x0553, 0x5237, 0x054F,
- 0x5238, 0x054E, 0x523A, 0x0550, 0x523B, 0x054D, 0x5241, 0x0554,
- 0x5243, 0x06C1, 0x5244, 0x1A6D, 0x5246, 0x1916, 0x5247, 0x06C6,
- 0x5249, 0x1A6E, 0x524A, 0x06C2, 0x524B, 0x06C5, 0x524C, 0x06C4,
- 0x524D, 0x06C3, 0x524E, 0x06C0, 0x5252, 0x1C3C, 0x5254, 0x085C,
- 0x5255, 0x1C3F, 0x5256, 0x085A, 0x525A, 0x1C3B, 0x525B, 0x085D,
- 0x525C, 0x085B, 0x525D, 0x085E, 0x525E, 0x1C3D, 0x525F, 0x1C3E,
- 0x5261, 0x1C3A, 0x5262, 0x1C40, 0x5269, 0x0BF5, 0x526A, 0x0A12,
- 0x526B, 0x1E53, 0x526C, 0x1E55, 0x526D, 0x1E54, 0x526E, 0x1E56,
- 0x526F, 0x0A13, 0x5272, 0x0BF2, 0x5274, 0x0BF3, 0x5275, 0x0BF4,
- 0x5277, 0x0DCB, 0x5278, 0x2377, 0x527A, 0x2376, 0x527B, 0x2378,
- 0x527C, 0x2379, 0x527D, 0x0DCC, 0x527F, 0x0DCA, 0x5280, 0x2623,
- 0x5281, 0x2624, 0x5282, 0x0F8D, 0x5283, 0x0F8C, 0x5284, 0x2776,
- 0x5287, 0x110C, 0x5288, 0x110D, 0x5289, 0x110E, 0x528A, 0x1110,
- 0x528B, 0x2889, 0x528C, 0x288A, 0x528D, 0x110F, 0x5291, 0x1292,
- 0x5293, 0x1293, 0x5296, 0x307C, 0x5297, 0x32C8, 0x5298, 0x32C7,
- 0x5299, 0x340F, 0x529B, 0x0262, 0x529F, 0x030C, 0x52A0, 0x030B,
- 0x52A3, 0x0395, 0x52A6, 0x17C9, 0x52A9, 0x043F, 0x52AA, 0x0440,
- 0x52AB, 0x043E, 0x52AC, 0x0441, 0x52AD, 0x1838, 0x52AE, 0x1839,
- 0x52BB, 0x0556, 0x52BC, 0x1918, 0x52BE, 0x0555, 0x52C0, 0x1A6F,
- 0x52C1, 0x06CA, 0x52C2, 0x1A70, 0x52C3, 0x06C9, 0x52C7, 0x06C7,
- 0x52C9, 0x06C8, 0x52CD, 0x1C41, 0x52D2, 0x0A14, 0x52D3, 0x1E58,
- 0x52D5, 0x0A17, 0x52D6, 0x1E57, 0x52D7, 0x0ACF, 0x52D8, 0x0A16,
- 0x52D9, 0x0A15, 0x52DB, 0x0BF8, 0x52DD, 0x0BF7, 0x52DE, 0x0BF6,
- 0x52DF, 0x0DCD, 0x52E2, 0x0DD0, 0x52E3, 0x0DD1, 0x52E4, 0x0DCF,
- 0x52E6, 0x0DCE, 0x52E9, 0x2625, 0x52EB, 0x2626, 0x52EF, 0x288C,
- 0x52F0, 0x1111, 0x52F1, 0x288B, 0x52F3, 0x1294, 0x52F4, 0x2D40,
- 0x52F5, 0x13B8, 0x52F7, 0x307D, 0x52F8, 0x1609, 0x52F9, 0x0220,
- 0x52FA, 0x0276, 0x52FB, 0x02B4, 0x52FC, 0x1781, 0x52FE, 0x02B5,
- 0x52FF, 0x02B6, 0x5305, 0x030D, 0x5306, 0x030E, 0x5308, 0x0396,
- 0x5309, 0x183A, 0x530A, 0x1919, 0x530B, 0x191A, 0x530D, 0x06CB,
- 0x530E, 0x1C42, 0x530F, 0x0A19, 0x5310, 0x0A18, 0x5311, 0x20C0,
- 0x5312, 0x20BF, 0x5315, 0x0263, 0x5316, 0x02B7, 0x5317, 0x030F,
- 0x5319, 0x0A1A, 0x531A, 0x176F, 0x531C, 0x1798, 0x531D, 0x0310,
- 0x531F, 0x17CB, 0x5320, 0x0398, 0x5321, 0x0397, 0x5322, 0x17CA,
- 0x5323, 0x0442, 0x532A, 0x085F, 0x532D, 0x1E59, 0x532F, 0x0DD2,
- 0x5330, 0x2627, 0x5331, 0x0F8E, 0x5334, 0x2B06, 0x5337, 0x31C7,
- 0x5338, 0x0221, 0x5339, 0x02B8, 0x533C, 0x191B, 0x533D, 0x1A71,
- 0x533E, 0x0A1D, 0x533F, 0x0A1B, 0x5340, 0x0A1C, 0x5341, 0x0264,
- 0x5343, 0x0277, 0x5344, 0x016B, 0x5345, 0x02BB, 0x5347, 0x02BA,
- 0x5348, 0x02B9, 0x5349, 0x0313, 0x534A, 0x0312, 0x534C, 0x1799,
- 0x534D, 0x17CC, 0x5351, 0x055A, 0x5352, 0x0557, 0x5353, 0x0559,
- 0x5354, 0x0558, 0x5357, 0x06CC, 0x535A, 0x0BF9, 0x535C, 0x0265,
- 0x535E, 0x02BC, 0x5360, 0x0315, 0x5361, 0x0314, 0x5363, 0x183B,
- 0x5366, 0x055B, 0x5369, 0x0222, 0x536C, 0x1782, 0x536E, 0x0317,
- 0x536F, 0x0316, 0x5370, 0x0399, 0x5371, 0x039A, 0x5372, 0x183C,
- 0x5373, 0x0443, 0x5375, 0x0444, 0x5377, 0x055C, 0x5378, 0x055D,
- 0x5379, 0x055E, 0x537B, 0x06CD, 0x537C, 0x1A72, 0x537F, 0x0860,
- 0x5382, 0x1770, 0x5384, 0x02BD, 0x538A, 0x17CD, 0x538E, 0x183D,
- 0x538F, 0x183E, 0x5392, 0x191C, 0x5394, 0x191D, 0x5396, 0x1A74,
- 0x5397, 0x1A73, 0x5398, 0x1A76, 0x5399, 0x1A75, 0x539A, 0x06CE,
- 0x539C, 0x1E5A, 0x539D, 0x0862, 0x539E, 0x1C43, 0x539F, 0x0861,
- 0x53A4, 0x20C1, 0x53A5, 0x0BFA, 0x53A7, 0x20C2, 0x53AC, 0x2628,
- 0x53AD, 0x0F8F, 0x53B2, 0x1112, 0x53B4, 0x307E, 0x53B6, 0x0223,
- 0x53B9, 0x1783, 0x53BB, 0x0318, 0x53C3, 0x0A1E, 0x53C8, 0x0266,
- 0x53C9, 0x0278, 0x53CA, 0x02BF, 0x53CB, 0x02BE, 0x53CD, 0x02C0,
- 0x53D4, 0x0560, 0x53D6, 0x055F, 0x53D7, 0x0561, 0x53DB, 0x06CF,
- 0x53DF, 0x0863, 0x53E1, 0x2B07, 0x53E2, 0x14C9, 0x53E3, 0x0279,
- 0x53E4, 0x031A, 0x53E5, 0x0329, 0x53E6, 0x0324, 0x53E8, 0x031F,
- 0x53E9, 0x031E, 0x53EA, 0x0325, 0x53EB, 0x0323, 0x53EC, 0x031C,
- 0x53ED, 0x032A, 0x53EE, 0x031D, 0x53EF, 0x0319, 0x53F0, 0x0328,
- 0x53F1, 0x0327, 0x53F2, 0x0326, 0x53F3, 0x031B, 0x53F5, 0x0322,
- 0x53F8, 0x0321, 0x53FB, 0x032B, 0x53FC, 0x0320, 0x5401, 0x03A0,
- 0x5403, 0x03A6, 0x5404, 0x03A2, 0x5406, 0x03A8, 0x5407, 0x17CE,
- 0x5408, 0x03A5, 0x5409, 0x039B, 0x540A, 0x039E, 0x540B, 0x03A1,
- 0x540C, 0x039D, 0x540D, 0x03A4, 0x540E, 0x03A7, 0x540F, 0x039C,
- 0x5410, 0x039F, 0x5411, 0x03A3, 0x5412, 0x03A9, 0x5418, 0x1847,
- 0x5419, 0x1844, 0x541B, 0x0451, 0x541C, 0x1845, 0x541D, 0x0445,
- 0x541E, 0x0447, 0x541F, 0x045F, 0x5420, 0x045A, 0x5424, 0x184C,
- 0x5425, 0x1846, 0x5426, 0x0449, 0x5427, 0x044B, 0x5428, 0x184B,
- 0x5429, 0x0452, 0x542A, 0x1841, 0x542B, 0x045E, 0x542C, 0x0460,
- 0x542D, 0x0446, 0x542E, 0x0457, 0x5430, 0x183F, 0x5431, 0x045D,
- 0x5433, 0x044E, 0x5435, 0x0458, 0x5436, 0x0459, 0x5437, 0x1840,
- 0x5438, 0x0456, 0x5439, 0x0454, 0x543B, 0x0455, 0x543C, 0x045B,
- 0x543D, 0x1848, 0x543E, 0x0448, 0x5440, 0x045C, 0x5441, 0x184A,
- 0x5442, 0x0450, 0x5443, 0x044D, 0x5445, 0x1843, 0x5446, 0x044C,
- 0x5447, 0x184D, 0x5448, 0x044F, 0x544A, 0x0453, 0x544E, 0x044A,
- 0x544F, 0x1849, 0x5454, 0x1842, 0x5460, 0x192E, 0x5461, 0x192D,
- 0x5462, 0x0573, 0x5463, 0x1930, 0x5464, 0x1932, 0x5465, 0x1927,
- 0x5466, 0x192A, 0x5467, 0x1931, 0x5468, 0x0574, 0x546B, 0x1924,
- 0x546C, 0x1928, 0x546F, 0x192C, 0x5470, 0x1A85, 0x5471, 0x056F,
- 0x5472, 0x1A89, 0x5473, 0x0562, 0x5474, 0x1929, 0x5475, 0x0563,
- 0x5476, 0x0570, 0x5477, 0x0569, 0x5478, 0x0565, 0x547A, 0x1925,
- 0x547B, 0x0568, 0x547C, 0x056D, 0x547D, 0x0576, 0x547E, 0x1926,
- 0x547F, 0x191F, 0x5480, 0x0567, 0x5481, 0x1920, 0x5482, 0x1922,
- 0x5484, 0x056A, 0x5486, 0x056C, 0x5487, 0x191E, 0x5488, 0x1923,
- 0x548B, 0x0575, 0x548C, 0x0571, 0x548D, 0x192B, 0x548E, 0x0577,
- 0x5490, 0x056E, 0x5491, 0x1921, 0x5492, 0x056B, 0x5495, 0x0566,
- 0x5496, 0x0564, 0x5498, 0x192F, 0x549A, 0x0572, 0x54A0, 0x1A84,
- 0x54A1, 0x1A78, 0x54A2, 0x1A87, 0x54A5, 0x1A7A, 0x54A6, 0x06D6,
- 0x54A7, 0x06E4, 0x54A8, 0x06D2, 0x54A9, 0x06E3, 0x54AA, 0x06DB,
- 0x54AB, 0x06E0, 0x54AC, 0x06D0, 0x54AD, 0x1A79, 0x54AE, 0x1A7F,
- 0x54AF, 0x06DF, 0x54B0, 0x1A8B, 0x54B1, 0x06E1, 0x54B3, 0x06D7,
- 0x54B6, 0x1A81, 0x54B7, 0x1A7E, 0x54B8, 0x06D5, 0x54BA, 0x1A77,
- 0x54BB, 0x06E2, 0x54BC, 0x1A86, 0x54BD, 0x06DA, 0x54BE, 0x1A88,
- 0x54BF, 0x06E5, 0x54C0, 0x06D1, 0x54C1, 0x06DC, 0x54C2, 0x06D9,
- 0x54C3, 0x1A7C, 0x54C4, 0x06DD, 0x54C5, 0x1A82, 0x54C6, 0x1A83,
- 0x54C7, 0x06D8, 0x54C8, 0x06DE, 0x54C9, 0x06D4, 0x54CE, 0x06D3,
- 0x54CF, 0x1A7B, 0x54D6, 0x1A80, 0x54DE, 0x1A8A, 0x54E0, 0x1C57,
- 0x54E1, 0x0870, 0x54E2, 0x1C45, 0x54E4, 0x1C4A, 0x54E5, 0x0869,
- 0x54E6, 0x0874, 0x54E7, 0x1C48, 0x54E8, 0x0864, 0x54E9, 0x086E,
- 0x54EA, 0x0873, 0x54EB, 0x1C4F, 0x54ED, 0x086F, 0x54EE, 0x0872,
- 0x54F1, 0x1C52, 0x54F2, 0x086A, 0x54F3, 0x1C49, 0x54F7, 0x1C55,
- 0x54F8, 0x1C56, 0x54FA, 0x086C, 0x54FB, 0x1C54, 0x54FC, 0x0868,
- 0x54FD, 0x0877, 0x54FF, 0x1C4C, 0x5501, 0x0866, 0x5503, 0x1C59,
- 0x5504, 0x1C4D, 0x5505, 0x1C51, 0x5506, 0x086B, 0x5507, 0x0876,
- 0x5508, 0x1C4E, 0x5509, 0x0871, 0x550A, 0x1C53, 0x550B, 0x1C5A,
- 0x550C, 0x1E69, 0x550E, 0x1C58, 0x550F, 0x0878, 0x5510, 0x0865,
- 0x5511, 0x1C50, 0x5512, 0x1C47, 0x5514, 0x086D, 0x5517, 0x1C46,
- 0x551A, 0x1C4B, 0x5526, 0x1C44, 0x5527, 0x0875, 0x552A, 0x1E61,
- 0x552C, 0x0A31, 0x552D, 0x1E6F, 0x552E, 0x0A2F, 0x552F, 0x0A2C,
- 0x5530, 0x1E66, 0x5531, 0x0A28, 0x5532, 0x1E6A, 0x5533, 0x0A33,
- 0x5534, 0x1E60, 0x5535, 0x1E65, 0x5536, 0x1E64, 0x5537, 0x0867,
- 0x5538, 0x0A2E, 0x5539, 0x1E6D, 0x553B, 0x1E70, 0x553C, 0x1E5D,
- 0x553E, 0x0C0C, 0x5540, 0x1E71, 0x5541, 0x0A34, 0x5543, 0x0A26,
- 0x5544, 0x0A23, 0x5545, 0x1E68, 0x5546, 0x0A20, 0x5548, 0x1E6E,
- 0x554A, 0x0A27, 0x554B, 0x1E72, 0x554D, 0x1E5E, 0x554E, 0x1E6C,
- 0x554F, 0x0A2A, 0x5550, 0x1E5F, 0x5551, 0x1E62, 0x5552, 0x1E67,
- 0x5555, 0x0A2B, 0x5556, 0x0A29, 0x5557, 0x0A35, 0x555C, 0x0A30,
- 0x555E, 0x0A24, 0x555F, 0x0ABC, 0x5561, 0x0A25, 0x5562, 0x1E63,
- 0x5563, 0x0A32, 0x5564, 0x0A2D, 0x5565, 0x1E6B, 0x5566, 0x0A22,
- 0x556A, 0x0A21, 0x5575, 0x1E5B, 0x5576, 0x1E5C, 0x5577, 0x20C7,
- 0x557B, 0x0BFB, 0x557C, 0x0BFE, 0x557D, 0x20D2, 0x557E, 0x0C12,
- 0x557F, 0x20D5, 0x5580, 0x0BFC, 0x5581, 0x20CE, 0x5582, 0x0C02,
- 0x5583, 0x0C08, 0x5584, 0x0D1B, 0x5587, 0x0C06, 0x5588, 0x20CB,
- 0x5589, 0x0C13, 0x558A, 0x0BFF, 0x558B, 0x0C07, 0x558C, 0x20D3,
- 0x558D, 0x2387, 0x558E, 0x20D8, 0x558F, 0x20CC, 0x5591, 0x20C3,
- 0x5592, 0x20D0, 0x5593, 0x20CA, 0x5594, 0x0C05, 0x5595, 0x20D6,
- 0x5598, 0x0C01, 0x5599, 0x0C15, 0x559A, 0x0C0E, 0x559C, 0x0C03,
- 0x559D, 0x0C00, 0x559F, 0x0C0B, 0x55A1, 0x20D7, 0x55A2, 0x20C9,
- 0x55A3, 0x20CF, 0x55A4, 0x20D1, 0x55A5, 0x20C5, 0x55A6, 0x20D4,
- 0x55A7, 0x0BFD, 0x55A8, 0x20C4, 0x55AA, 0x0C04, 0x55AB, 0x0C14,
- 0x55AC, 0x0C10, 0x55AD, 0x20C6, 0x55AE, 0x0C0A, 0x55B1, 0x0C11,
- 0x55B2, 0x0C0D, 0x55B3, 0x0C09, 0x55B5, 0x20CD, 0x55BB, 0x0C0F,
- 0x55BF, 0x2385, 0x55C0, 0x2381, 0x55C2, 0x2390, 0x55C3, 0x237A,
- 0x55C4, 0x2383, 0x55C5, 0x0DE0, 0x55C6, 0x0DE1, 0x55C7, 0x0DD9,
- 0x55C8, 0x238C, 0x55C9, 0x0DE3, 0x55CA, 0x237F, 0x55CB, 0x237E,
- 0x55CC, 0x237C, 0x55CD, 0x238E, 0x55CE, 0x0DD7, 0x55CF, 0x2388,
- 0x55D0, 0x237D, 0x55D1, 0x0DDA, 0x55D2, 0x2386, 0x55D3, 0x0DD5,
- 0x55D4, 0x2382, 0x55D5, 0x2389, 0x55D6, 0x238B, 0x55D9, 0x238F,
- 0x55DA, 0x0DDE, 0x55DB, 0x237B, 0x55DC, 0x0DD8, 0x55DD, 0x2380,
- 0x55DF, 0x0DD3, 0x55E1, 0x0DDF, 0x55E2, 0x238A, 0x55E3, 0x0DDB,
- 0x55E4, 0x0DDC, 0x55E5, 0x0DE2, 0x55E6, 0x0DD6, 0x55E7, 0x011F,
- 0x55E8, 0x0DD4, 0x55E9, 0x2384, 0x55EF, 0x0DDD, 0x55F2, 0x238D,
- 0x55F6, 0x0F9F, 0x55F7, 0x0F9A, 0x55F9, 0x2637, 0x55FA, 0x2633,
- 0x55FC, 0x262D, 0x55FD, 0x0F94, 0x55FE, 0x0F90, 0x55FF, 0x2636,
- 0x5600, 0x0F91, 0x5601, 0x2630, 0x5602, 0x2632, 0x5604, 0x2635,
- 0x5606, 0x0F96, 0x5608, 0x0F9D, 0x5609, 0x0F97, 0x560C, 0x262B,
- 0x560D, 0x0F98, 0x560E, 0x0F99, 0x560F, 0x262E, 0x5610, 0x0F9E,
- 0x5612, 0x262C, 0x5613, 0x2631, 0x5614, 0x0F95, 0x5615, 0x262A,
- 0x5616, 0x0F9B, 0x5617, 0x0F93, 0x561B, 0x0F92, 0x561C, 0x262F,
- 0x561D, 0x2634, 0x561F, 0x0F9C, 0x5627, 0x2629, 0x5629, 0x1119,
- 0x562A, 0x289D, 0x562C, 0x289A, 0x562E, 0x1113, 0x562F, 0x111F,
- 0x5630, 0x1120, 0x5632, 0x1116, 0x5633, 0x2898, 0x5634, 0x1118,
- 0x5635, 0x2890, 0x5636, 0x111E, 0x5638, 0x289C, 0x5639, 0x1115,
- 0x563A, 0x289E, 0x563B, 0x1114, 0x563D, 0x2899, 0x563E, 0x289B,
- 0x563F, 0x1117, 0x5640, 0x2897, 0x5641, 0x2891, 0x5642, 0x288E,
- 0x5645, 0x20C8, 0x5646, 0x2894, 0x5648, 0x288D, 0x5649, 0x2893,
- 0x564A, 0x2892, 0x564C, 0x288F, 0x564E, 0x111B, 0x5653, 0x111A,
- 0x5657, 0x111C, 0x5658, 0x2895, 0x5659, 0x1295, 0x565A, 0x2896,
- 0x565E, 0x2B10, 0x5660, 0x2B09, 0x5662, 0x12A1, 0x5663, 0x2B0D,
- 0x5664, 0x1299, 0x5665, 0x129D, 0x5666, 0x2B0C, 0x5668, 0x129C,
- 0x5669, 0x1298, 0x566A, 0x129B, 0x566B, 0x1296, 0x566C, 0x12A0,
- 0x566D, 0x2B0E, 0x566E, 0x2B0A, 0x566F, 0x129F, 0x5670, 0x2B08,
- 0x5671, 0x129E, 0x5672, 0x2B0F, 0x5673, 0x2B0B, 0x5674, 0x111D,
- 0x5676, 0x12A2, 0x5677, 0x2B11, 0x5678, 0x129A, 0x5679, 0x1297,
- 0x567E, 0x2D47, 0x567F, 0x2D49, 0x5680, 0x13BA, 0x5681, 0x2D4A,
- 0x5682, 0x2D48, 0x5683, 0x2D46, 0x5684, 0x2D45, 0x5685, 0x13BC,
- 0x5686, 0x2D44, 0x5687, 0x13BD, 0x568C, 0x2D42, 0x568D, 0x2D43,
- 0x568E, 0x13B9, 0x568F, 0x13BE, 0x5690, 0x13BB, 0x5693, 0x2D41,
- 0x5695, 0x14CA, 0x5697, 0x2F13, 0x5698, 0x2F11, 0x5699, 0x2F16,
- 0x569A, 0x2F14, 0x569C, 0x2F12, 0x569D, 0x2F15, 0x56A5, 0x1576,
- 0x56A6, 0x3081, 0x56A7, 0x3082, 0x56A8, 0x1577, 0x56AA, 0x3083,
- 0x56AB, 0x307F, 0x56AC, 0x3084, 0x56AD, 0x3080, 0x56AE, 0x14CB,
- 0x56B2, 0x31C8, 0x56B3, 0x31CA, 0x56B4, 0x160C, 0x56B5, 0x31C9,
- 0x56B6, 0x160B, 0x56B7, 0x160A, 0x56BC, 0x160D, 0x56BD, 0x32CA,
- 0x56BE, 0x32CB, 0x56C0, 0x166B, 0x56C1, 0x166A, 0x56C2, 0x166C,
- 0x56C3, 0x32C9, 0x56C5, 0x3379, 0x56C6, 0x3378, 0x56C8, 0x16BD,
- 0x56C9, 0x16BF, 0x56CA, 0x16BE, 0x56CB, 0x337A, 0x56CC, 0x16F6,
- 0x56CD, 0x3481, 0x56D1, 0x171F, 0x56D3, 0x3480, 0x56D4, 0x34C9,
- 0x56D7, 0x1775, 0x56DA, 0x032D, 0x56DB, 0x032C, 0x56DD, 0x03AC,
- 0x56DE, 0x03AB, 0x56DF, 0x17D0, 0x56E0, 0x03AA, 0x56E1, 0x17CF,
- 0x56E4, 0x0463, 0x56E5, 0x1850, 0x56E7, 0x184F, 0x56EA, 0x0461,
- 0x56EB, 0x0464, 0x56EE, 0x184E, 0x56F0, 0x0462, 0x56F7, 0x1933,
- 0x56F9, 0x1934, 0x56FA, 0x0578, 0x56FF, 0x06E6, 0x5701, 0x1C5B,
- 0x5702, 0x1C5C, 0x5703, 0x0879, 0x5704, 0x087A, 0x5707, 0x1E74,
- 0x5708, 0x0A36, 0x5709, 0x0A38, 0x570A, 0x1E73, 0x570B, 0x0A37,
- 0x570C, 0x20D9, 0x570D, 0x0C16, 0x5712, 0x0DE4, 0x5713, 0x0DE5,
- 0x5714, 0x2391, 0x5716, 0x0FA1, 0x5718, 0x0FA0, 0x571A, 0x289F,
- 0x571B, 0x2B13, 0x571C, 0x2B12, 0x571E, 0x3505, 0x571F, 0x027A,
- 0x5720, 0x1784, 0x5722, 0x179A, 0x5723, 0x179B, 0x5728, 0x03AF,
- 0x5729, 0x03B3, 0x572A, 0x17D2, 0x572C, 0x03B1, 0x572D, 0x03B0,
- 0x572E, 0x17D1, 0x572F, 0x03B2, 0x5730, 0x03AE, 0x5733, 0x03AD,
- 0x5734, 0x17D3, 0x573B, 0x046E, 0x573E, 0x046B, 0x5740, 0x0467,
- 0x5741, 0x1851, 0x5745, 0x1852, 0x5747, 0x0469, 0x5749, 0x1854,
- 0x574A, 0x0465, 0x574B, 0x1855, 0x574C, 0x1853, 0x574D, 0x0468,
- 0x574E, 0x046A, 0x574F, 0x046D, 0x5750, 0x046C, 0x5751, 0x0466,
- 0x5752, 0x1856, 0x5761, 0x057D, 0x5762, 0x1941, 0x5764, 0x057F,
- 0x5766, 0x057E, 0x5768, 0x1942, 0x5769, 0x057C, 0x576A, 0x057B,
- 0x576B, 0x1938, 0x576D, 0x1937, 0x576F, 0x1935, 0x5770, 0x193A,
- 0x5771, 0x1939, 0x5772, 0x1936, 0x5773, 0x193F, 0x5774, 0x1940,
- 0x5775, 0x193D, 0x5776, 0x193B, 0x5777, 0x057A, 0x577B, 0x193E,
- 0x577C, 0x0580, 0x577D, 0x1943, 0x5780, 0x193C, 0x5782, 0x06E7,
- 0x5783, 0x0579, 0x578B, 0x06E8, 0x578C, 0x1A90, 0x578F, 0x1A96,
- 0x5793, 0x06EE, 0x5794, 0x1A94, 0x5795, 0x1A9A, 0x5797, 0x1A91,
- 0x5798, 0x1A95, 0x5799, 0x1A97, 0x579A, 0x1A99, 0x579B, 0x1A93,
- 0x579D, 0x1A92, 0x579E, 0x1A8D, 0x579F, 0x1A8E, 0x57A0, 0x06E9,
- 0x57A2, 0x06EB, 0x57A3, 0x06EA, 0x57A4, 0x1A8F, 0x57A5, 0x1A98,
- 0x57AE, 0x06ED, 0x57B5, 0x1A8C, 0x57B6, 0x1C66, 0x57B8, 0x1C65,
- 0x57B9, 0x1C6A, 0x57BA, 0x1C61, 0x57BC, 0x1C64, 0x57BD, 0x1C63,
- 0x57BF, 0x1C67, 0x57C1, 0x1C6B, 0x57C2, 0x087B, 0x57C3, 0x087E,
- 0x57C6, 0x1C62, 0x57C7, 0x1C68, 0x57CB, 0x087D, 0x57CC, 0x1C5D,
- 0x57CE, 0x06EC, 0x57CF, 0x1E82, 0x57D0, 0x1C69, 0x57D2, 0x1C60,
- 0x57D4, 0x087C, 0x57D5, 0x1C5F, 0x57DC, 0x1E79, 0x57DF, 0x0A39,
- 0x57E0, 0x0A3D, 0x57E1, 0x1E89, 0x57E2, 0x1E77, 0x57E3, 0x1E85,
- 0x57E4, 0x0A3E, 0x57E5, 0x1E87, 0x57E7, 0x1E8D, 0x57E9, 0x1E91,
- 0x57EC, 0x1E88, 0x57ED, 0x1E7C, 0x57EE, 0x1E84, 0x57F0, 0x1E92,
- 0x57F1, 0x1E90, 0x57F2, 0x1E86, 0x57F3, 0x1E81, 0x57F4, 0x1E7A,
- 0x57F5, 0x20E1, 0x57F6, 0x1E78, 0x57F7, 0x0A42, 0x57F8, 0x1E7F,
- 0x57F9, 0x0A43, 0x57FA, 0x0A3F, 0x57FB, 0x1E75, 0x57FC, 0x1E8B,
- 0x57FD, 0x1E7D, 0x5800, 0x1E7B, 0x5801, 0x1E8E, 0x5802, 0x0A40,
- 0x5804, 0x1E94, 0x5805, 0x0A3A, 0x5806, 0x0A3C, 0x5807, 0x1E83,
- 0x5808, 0x1E7E, 0x5809, 0x087F, 0x580A, 0x0A3B, 0x580B, 0x1E80,
- 0x580C, 0x1E8F, 0x580D, 0x1E93, 0x580E, 0x1E8A, 0x5810, 0x1E8C,
- 0x5814, 0x1E76, 0x5819, 0x20DC, 0x581B, 0x20E5, 0x581C, 0x20E4,
- 0x581D, 0x0C1E, 0x581E, 0x20DD, 0x5820, 0x0C1F, 0x5821, 0x0C1D,
- 0x5823, 0x20DF, 0x5824, 0x0C1A, 0x5825, 0x20E3, 0x5827, 0x20DE,
- 0x5828, 0x20E0, 0x5829, 0x20DA, 0x582A, 0x0C18, 0x582C, 0x20ED,
- 0x582D, 0x20EC, 0x582E, 0x20E9, 0x582F, 0x0C17, 0x5830, 0x0C1B,
- 0x5831, 0x0C1C, 0x5832, 0x1C5E, 0x5833, 0x20E6, 0x5834, 0x0C19,
- 0x5835, 0x0A41, 0x5836, 0x20E8, 0x5837, 0x20DB, 0x5838, 0x20EB,
- 0x5839, 0x20EA, 0x583B, 0x20EE, 0x583D, 0x239F, 0x583F, 0x20E7,
- 0x5848, 0x20E2, 0x5849, 0x2397, 0x584A, 0x0DEF, 0x584B, 0x0DF2,
- 0x584C, 0x0DED, 0x584D, 0x2396, 0x584E, 0x239A, 0x584F, 0x2395,
- 0x5851, 0x0DE7, 0x5852, 0x0DF1, 0x5853, 0x2392, 0x5854, 0x0DEB,
- 0x5855, 0x2399, 0x5857, 0x0DE9, 0x5858, 0x0DE8, 0x5859, 0x239C,
- 0x585A, 0x0DEA, 0x585B, 0x239E, 0x585D, 0x239B, 0x585E, 0x0DE6,
- 0x5862, 0x0DF0, 0x5863, 0x23A0, 0x5864, 0x2394, 0x5865, 0x239D,
- 0x5868, 0x2393, 0x586B, 0x0DEC, 0x586D, 0x0DEE, 0x586F, 0x2398,
- 0x5871, 0x23A1, 0x5874, 0x263F, 0x5875, 0x0FA2, 0x5876, 0x2645,
- 0x5879, 0x0FA7, 0x587A, 0x2641, 0x587B, 0x2648, 0x587C, 0x2639,
- 0x587D, 0x0FA9, 0x587E, 0x0FA3, 0x587F, 0x263E, 0x5880, 0x1121,
- 0x5881, 0x263D, 0x5882, 0x2646, 0x5883, 0x0FA4, 0x5885, 0x0FA8,
- 0x5886, 0x263C, 0x5887, 0x2642, 0x5888, 0x2647, 0x5889, 0x2638,
- 0x588A, 0x0FA6, 0x588B, 0x2640, 0x588E, 0x2644, 0x588F, 0x264A,
- 0x5890, 0x263A, 0x5891, 0x2643, 0x5893, 0x0FA5, 0x5894, 0x2649,
- 0x5898, 0x263B, 0x589C, 0x1125, 0x589D, 0x28A1, 0x589E, 0x1123,
- 0x589F, 0x1122, 0x58A0, 0x28A3, 0x58A1, 0x28A8, 0x58A3, 0x28A4,
- 0x58A5, 0x28A7, 0x58A6, 0x1128, 0x58A8, 0x1288, 0x58A9, 0x1127,
- 0x58AB, 0x28A0, 0x58AC, 0x28A6, 0x58AE, 0x1126, 0x58AF, 0x28A5,
- 0x58B1, 0x28A2, 0x58B3, 0x1124, 0x58BA, 0x2B18, 0x58BB, 0x36EB,
- 0x58BC, 0x2B1A, 0x58BD, 0x2B15, 0x58BE, 0x12A4, 0x58BF, 0x2B17,
- 0x58C1, 0x12A3, 0x58C2, 0x2B19, 0x58C5, 0x12A6, 0x58C6, 0x2B1B,
- 0x58C7, 0x12A5, 0x58C8, 0x2B14, 0x58C9, 0x2B16, 0x58CE, 0x13C2,
- 0x58CF, 0x2D4D, 0x58D1, 0x13C1, 0x58D2, 0x2D4E, 0x58D3, 0x13C0,
- 0x58D4, 0x2D4C, 0x58D5, 0x13BF, 0x58D6, 0x2D4B, 0x58D8, 0x14CD,
- 0x58D9, 0x14CC, 0x58DA, 0x3085, 0x58DB, 0x3087, 0x58DD, 0x3086,
- 0x58DE, 0x1578, 0x58DF, 0x1579, 0x58E2, 0x157A, 0x58E3, 0x31CB,
- 0x58E4, 0x160E, 0x58E7, 0x3411, 0x58E8, 0x3410, 0x58E9, 0x1720,
- 0x58EB, 0x027B, 0x58EC, 0x02C1, 0x58EF, 0x046F, 0x58F4, 0x1A9B,
- 0x58F9, 0x0C20, 0x58FA, 0x0C21, 0x58FC, 0x23A2, 0x58FD, 0x0FAA,
- 0x58FE, 0x264B, 0x58FF, 0x28A9, 0x5902, 0x0224, 0x5903, 0x1785,
- 0x5906, 0x1857, 0x590A, 0x0224, 0x590C, 0x1944, 0x590D, 0x1A9C,
- 0x590E, 0x1C6C, 0x590F, 0x0880, 0x5912, 0x3088, 0x5914, 0x166D,
- 0x5915, 0x027C, 0x5916, 0x032E, 0x5917, 0x179C, 0x5919, 0x03B4,
- 0x591A, 0x03B5, 0x591C, 0x0581, 0x5920, 0x0A44, 0x5922, 0x0FAC,
- 0x5924, 0x0FAD, 0x5925, 0x0FAB, 0x5927, 0x027D, 0x5929, 0x02C2,
- 0x592A, 0x02C4, 0x592B, 0x02C3, 0x592C, 0x1786, 0x592D, 0x02C5,
- 0x592E, 0x032F, 0x592F, 0x179D, 0x5931, 0x0330, 0x5937, 0x03B6,
- 0x5938, 0x03B7, 0x593C, 0x17D4, 0x593E, 0x0470, 0x5940, 0x1858,
- 0x5944, 0x0585, 0x5945, 0x1945, 0x5947, 0x0583, 0x5948, 0x0584,
- 0x5949, 0x0582, 0x594A, 0x1C6D, 0x594E, 0x06F2, 0x594F, 0x06F1,
- 0x5950, 0x06F3, 0x5951, 0x06F0, 0x5953, 0x1A9D, 0x5954, 0x0586,
- 0x5955, 0x06EF, 0x5957, 0x0881, 0x5958, 0x0882, 0x595A, 0x0883,
- 0x595C, 0x1E95, 0x5960, 0x0C22, 0x5961, 0x20EF, 0x5962, 0x0A45,
- 0x5967, 0x0DF3, 0x5969, 0x0FAF, 0x596A, 0x0FAE, 0x596B, 0x264C,
- 0x596D, 0x1129, 0x596E, 0x12A7, 0x5970, 0x2F17, 0x5971, 0x337B,
- 0x5972, 0x3412, 0x5973, 0x027E, 0x5974, 0x0331, 0x5976, 0x0332,
- 0x5977, 0x17DA, 0x5978, 0x03B9, 0x5979, 0x03BC, 0x597B, 0x17D8,
- 0x597C, 0x17D6, 0x597D, 0x03BB, 0x597E, 0x17D9, 0x597F, 0x17DB,
- 0x5980, 0x17D5, 0x5981, 0x03BE, 0x5982, 0x03BD, 0x5983, 0x03BA,
- 0x5984, 0x03B8, 0x5985, 0x17D7, 0x598A, 0x047B, 0x598D, 0x0478,
- 0x598E, 0x185D, 0x598F, 0x1860, 0x5990, 0x185F, 0x5992, 0x0472,
- 0x5993, 0x047A, 0x5996, 0x0477, 0x5997, 0x185C, 0x5998, 0x185A,
- 0x5999, 0x0476, 0x599D, 0x0471, 0x599E, 0x0474, 0x59A0, 0x185B,
- 0x59A1, 0x1862, 0x59A2, 0x185E, 0x59A3, 0x0475, 0x59A4, 0x0479,
- 0x59A5, 0x047C, 0x59A6, 0x1859, 0x59A7, 0x1861, 0x59A8, 0x0473,
- 0x59AE, 0x058B, 0x59AF, 0x0593, 0x59B1, 0x1951, 0x59B2, 0x194A,
- 0x59B3, 0x0594, 0x59B4, 0x1955, 0x59B5, 0x1946, 0x59B6, 0x194D,
- 0x59B9, 0x058A, 0x59BA, 0x1947, 0x59BB, 0x0588, 0x59BC, 0x194E,
- 0x59BD, 0x1952, 0x59BE, 0x0587, 0x59C0, 0x1953, 0x59C1, 0x194C,
- 0x59C3, 0x194F, 0x59C5, 0x0596, 0x59C6, 0x058D, 0x59C7, 0x1956,
- 0x59C8, 0x1954, 0x59CA, 0x0592, 0x59CB, 0x0590, 0x59CC, 0x194B,
- 0x59CD, 0x058F, 0x59CE, 0x1949, 0x59CF, 0x1948, 0x59D0, 0x058E,
- 0x59D1, 0x058C, 0x59D2, 0x0595, 0x59D3, 0x0591, 0x59D4, 0x0589,
- 0x59D6, 0x1950, 0x59D8, 0x06F5, 0x59DA, 0x06FC, 0x59DB, 0x1AAB,
- 0x59DC, 0x06F4, 0x59DD, 0x1AA3, 0x59DE, 0x1A9F, 0x59E0, 0x1AAF,
- 0x59E1, 0x1A9E, 0x59E3, 0x06F7, 0x59E4, 0x1AA8, 0x59E5, 0x06FA,
- 0x59E6, 0x06FD, 0x59E8, 0x06F8, 0x59E9, 0x1AAC, 0x59EA, 0x06FB,
- 0x59EC, 0x088A, 0x59ED, 0x1AB2, 0x59EE, 0x1AA0, 0x59F1, 0x1AA2,
- 0x59F2, 0x1AA9, 0x59F3, 0x1AAD, 0x59F4, 0x1AB1, 0x59F5, 0x1AAE,
- 0x59F6, 0x1AA7, 0x59F7, 0x1AAA, 0x59FA, 0x1AA4, 0x59FB, 0x06FF,
- 0x59FC, 0x1AA6, 0x59FD, 0x1AA5, 0x59FE, 0x1AB0, 0x59FF, 0x06F6,
- 0x5A00, 0x1AA1, 0x5A01, 0x06FE, 0x5A03, 0x06F9, 0x5A09, 0x0890,
- 0x5A0A, 0x1C75, 0x5A0C, 0x088F, 0x5A0F, 0x1C73, 0x5A11, 0x0884,
- 0x5A13, 0x0889, 0x5A15, 0x1C72, 0x5A16, 0x1C6F, 0x5A17, 0x1C74,
- 0x5A18, 0x0885, 0x5A19, 0x1C6E, 0x5A1B, 0x0888, 0x5A1C, 0x0886,
- 0x5A1E, 0x1C76, 0x5A1F, 0x0887, 0x5A20, 0x088B, 0x5A23, 0x088C,
- 0x5A25, 0x088E, 0x5A29, 0x088D, 0x5A2D, 0x1C70, 0x5A2E, 0x1C71,
- 0x5A33, 0x1C77, 0x5A35, 0x1E9C, 0x5A36, 0x0A46, 0x5A37, 0x20FD,
- 0x5A38, 0x1E9B, 0x5A39, 0x1EAE, 0x5A3C, 0x0A4C, 0x5A3E, 0x1EAC,
- 0x5A40, 0x0A4B, 0x5A41, 0x0A47, 0x5A42, 0x1EB5, 0x5A43, 0x1EA5,
- 0x5A44, 0x1EA8, 0x5A46, 0x0A4F, 0x5A47, 0x1EB2, 0x5A48, 0x1EAA,
- 0x5A49, 0x0A48, 0x5A4A, 0x0A50, 0x5A4C, 0x1EAF, 0x5A4D, 0x1EAD,
- 0x5A50, 0x1E9E, 0x5A51, 0x1EB3, 0x5A52, 0x1EA7, 0x5A53, 0x1EA2,
- 0x5A55, 0x1E98, 0x5A56, 0x1EB4, 0x5A57, 0x1EA4, 0x5A58, 0x1E97,
- 0x5A5A, 0x0A4E, 0x5A5B, 0x1EA9, 0x5A5C, 0x1EB6, 0x5A5D, 0x1EA6,
- 0x5A5E, 0x1E9A, 0x5A5F, 0x1E9F, 0x5A60, 0x1E96, 0x5A62, 0x0A4D,
- 0x5A64, 0x1EA3, 0x5A65, 0x1EA0, 0x5A66, 0x0A49, 0x5A67, 0x1E99,
- 0x5A69, 0x1EB1, 0x5A6A, 0x0A4A, 0x5A6C, 0x1EA1, 0x5A6D, 0x1E9D,
- 0x5A70, 0x1EB0, 0x5A77, 0x0C23, 0x5A78, 0x20F6, 0x5A7A, 0x20F3,
- 0x5A7B, 0x2104, 0x5A7C, 0x20F8, 0x5A7D, 0x2105, 0x5A7F, 0x0C25,
- 0x5A83, 0x2101, 0x5A84, 0x20FE, 0x5A8A, 0x20FF, 0x5A8B, 0x2102,
- 0x5A8C, 0x2106, 0x5A8E, 0x1EAB, 0x5A8F, 0x2108, 0x5A90, 0x23B6,
- 0x5A92, 0x0C26, 0x5A93, 0x2109, 0x5A94, 0x20F1, 0x5A95, 0x20FB,
- 0x5A97, 0x2100, 0x5A9A, 0x0C24, 0x5A9B, 0x0C27, 0x5A9C, 0x2107,
- 0x5A9D, 0x210A, 0x5A9E, 0x20F5, 0x5A9F, 0x20F2, 0x5AA2, 0x20F4,
- 0x5AA5, 0x20F9, 0x5AA6, 0x20F7, 0x5AA7, 0x0C28, 0x5AA9, 0x2103,
- 0x5AAC, 0x20FA, 0x5AAE, 0x20FC, 0x5AAF, 0x20F0, 0x5AB0, 0x23AA,
- 0x5AB1, 0x23A8, 0x5AB2, 0x0DFC, 0x5AB3, 0x0DFA, 0x5AB4, 0x23B2,
- 0x5AB5, 0x23A9, 0x5AB6, 0x23B3, 0x5AB7, 0x23AF, 0x5AB8, 0x23A7,
- 0x5AB9, 0x23B5, 0x5ABA, 0x23A6, 0x5ABB, 0x23AD, 0x5ABC, 0x0DF9,
- 0x5ABD, 0x0DF8, 0x5ABE, 0x0DF7, 0x5ABF, 0x23AB, 0x5AC0, 0x23B0,
- 0x5AC1, 0x0DF4, 0x5AC2, 0x0DFB, 0x5AC4, 0x23A4, 0x5AC6, 0x23AE,
- 0x5AC7, 0x23A3, 0x5AC8, 0x23AC, 0x5AC9, 0x0DF5, 0x5ACA, 0x23B1,
- 0x5ACB, 0x23A5, 0x5ACC, 0x0DF6, 0x5ACD, 0x23B4, 0x5AD5, 0x2650,
- 0x5AD6, 0x0FB4, 0x5AD7, 0x0FB3, 0x5AD8, 0x0FB5, 0x5AD9, 0x265C,
- 0x5ADA, 0x2652, 0x5ADB, 0x2658, 0x5ADC, 0x264D, 0x5ADD, 0x265B,
- 0x5ADE, 0x265A, 0x5ADF, 0x265E, 0x5AE0, 0x2657, 0x5AE1, 0x0FB0,
- 0x5AE2, 0x2656, 0x5AE3, 0x0FB6, 0x5AE5, 0x264F, 0x5AE6, 0x0FB1,
- 0x5AE8, 0x265D, 0x5AE9, 0x0FB2, 0x5AEA, 0x2651, 0x5AEB, 0x2654,
- 0x5AEC, 0x2659, 0x5AED, 0x2653, 0x5AEE, 0x264E, 0x5AF3, 0x2655,
- 0x5AF4, 0x28AB, 0x5AF5, 0x112D, 0x5AF6, 0x28AE, 0x5AF7, 0x28AD,
- 0x5AF8, 0x28B0, 0x5AF9, 0x28B2, 0x5AFA, 0x36EE, 0x5AFB, 0x112B,
- 0x5AFD, 0x28AC, 0x5AFF, 0x28AA, 0x5B01, 0x28B3, 0x5B02, 0x28B1,
- 0x5B03, 0x28AF, 0x5B05, 0x28B5, 0x5B07, 0x28B4, 0x5B08, 0x112F,
- 0x5B09, 0x112A, 0x5B0B, 0x112C, 0x5B0C, 0x112E, 0x5B0F, 0x28B6,
- 0x5B10, 0x2B22, 0x5B13, 0x2B21, 0x5B14, 0x2B20, 0x5B16, 0x2B23,
- 0x5B17, 0x2B1C, 0x5B19, 0x2B1D, 0x5B1A, 0x2B25, 0x5B1B, 0x2B1E,
- 0x5B1D, 0x12A8, 0x5B1E, 0x2B27, 0x5B20, 0x2B26, 0x5B21, 0x2B1F,
- 0x5B23, 0x2D52, 0x5B24, 0x13C5, 0x5B25, 0x2D50, 0x5B26, 0x2D55,
- 0x5B27, 0x2D54, 0x5B28, 0x2B24, 0x5B2A, 0x13C4, 0x5B2C, 0x2D53,
- 0x5B2D, 0x2D4F, 0x5B2E, 0x2D57, 0x5B2F, 0x2D56, 0x5B30, 0x13C3,
- 0x5B32, 0x2D51, 0x5B34, 0x12A9, 0x5B38, 0x14CE, 0x5B3C, 0x2F18,
- 0x5B3D, 0x3089, 0x5B3E, 0x308A, 0x5B3F, 0x308B, 0x5B40, 0x160F,
- 0x5B43, 0x1610, 0x5B45, 0x31CC, 0x5B47, 0x32CD, 0x5B48, 0x32CC,
- 0x5B4B, 0x337C, 0x5B4C, 0x337D, 0x5B4D, 0x3413, 0x5B4E, 0x3482,
- 0x5B50, 0x027F, 0x5B51, 0x0280, 0x5B53, 0x0281, 0x5B54, 0x02C6,
- 0x5B55, 0x0333, 0x5B56, 0x17DC, 0x5B57, 0x03BF, 0x5B58, 0x03C0,
- 0x5B5A, 0x047F, 0x5B5B, 0x0480, 0x5B5C, 0x047E, 0x5B5D, 0x047D,
- 0x5B5F, 0x0597, 0x5B62, 0x1957, 0x5B63, 0x0599, 0x5B64, 0x0598,
- 0x5B65, 0x1958, 0x5B69, 0x0700, 0x5B6B, 0x0891, 0x5B6C, 0x1C78,
- 0x5B6E, 0x1EB8, 0x5B70, 0x0A51, 0x5B71, 0x0C2A, 0x5B72, 0x1EB7,
- 0x5B73, 0x0C29, 0x5B75, 0x0FB7, 0x5B77, 0x265F, 0x5B78, 0x12AA,
- 0x5B7A, 0x13C6, 0x5B7B, 0x2D58, 0x5B7D, 0x1611, 0x5B7F, 0x16C0,
- 0x5B80, 0x0225, 0x5B81, 0x179E, 0x5B83, 0x0334, 0x5B84, 0x179F,
- 0x5B85, 0x03C3, 0x5B87, 0x03C1, 0x5B88, 0x03C2, 0x5B89, 0x03C4,
- 0x5B8B, 0x0482, 0x5B8C, 0x0481, 0x5B8E, 0x1863, 0x5B8F, 0x0483,
- 0x5B92, 0x1864, 0x5B93, 0x1959, 0x5B95, 0x195A, 0x5B97, 0x059A,
- 0x5B98, 0x059C, 0x5B99, 0x059E, 0x5B9A, 0x059B, 0x5B9B, 0x059F,
- 0x5B9C, 0x059D, 0x5BA2, 0x0704, 0x5BA3, 0x0701, 0x5BA4, 0x0703,
- 0x5BA5, 0x0705, 0x5BA6, 0x0702, 0x5BA7, 0x1C79, 0x5BA8, 0x1AB3,
- 0x5BAC, 0x1C7B, 0x5BAD, 0x1C7A, 0x5BAE, 0x0897, 0x5BB0, 0x0893,
- 0x5BB3, 0x0894, 0x5BB4, 0x0896, 0x5BB5, 0x0898, 0x5BB6, 0x0895,
- 0x5BB8, 0x089A, 0x5BB9, 0x0899, 0x5BBF, 0x0A56, 0x5BC0, 0x1EBA,
- 0x5BC1, 0x1EB9, 0x5BC2, 0x0A55, 0x5BC4, 0x0A54, 0x5BC5, 0x0A53,
- 0x5BC6, 0x0A57, 0x5BC7, 0x0A52, 0x5BCA, 0x2110, 0x5BCB, 0x210D,
- 0x5BCC, 0x0C2C, 0x5BCD, 0x210C, 0x5BCE, 0x2111, 0x5BD0, 0x0C2E,
- 0x5BD1, 0x210F, 0x5BD2, 0x0C2B, 0x5BD3, 0x0C2D, 0x5BD4, 0x210E,
- 0x5BD6, 0x23B7, 0x5BD8, 0x23B8, 0x5BD9, 0x23B9, 0x5BDE, 0x0FB8,
- 0x5BDF, 0x0FC0, 0x5BE0, 0x2660, 0x5BE1, 0x0FBA, 0x5BE2, 0x0FBE,
- 0x5BE3, 0x2661, 0x5BE4, 0x0FBF, 0x5BE5, 0x0FBB, 0x5BE6, 0x0FBC,
- 0x5BE7, 0x0FB9, 0x5BE8, 0x0FBD, 0x5BE9, 0x1132, 0x5BEA, 0x210B,
- 0x5BEB, 0x1133, 0x5BEC, 0x1131, 0x5BEE, 0x1130, 0x5BEF, 0x2B28,
- 0x5BF0, 0x12AB, 0x5BF1, 0x2D59, 0x5BF2, 0x2D5A, 0x5BF5, 0x157B,
- 0x5BF6, 0x1612, 0x5BF8, 0x0282, 0x5BFA, 0x03C5, 0x5C01, 0x0706,
- 0x5C03, 0x1C7C, 0x5C04, 0x089B, 0x5C07, 0x0A5A, 0x5C08, 0x0A59,
- 0x5C09, 0x0A58, 0x5C0A, 0x0C2F, 0x5C0B, 0x0C30, 0x5C0C, 0x2112,
- 0x5C0D, 0x0FC1, 0x5C0E, 0x12AC, 0x5C0F, 0x0283, 0x5C10, 0x1787,
- 0x5C11, 0x02C7, 0x5C12, 0x17A0, 0x5C15, 0x17DD, 0x5C16, 0x03C6,
- 0x5C1A, 0x05A0, 0x5C1F, 0x23BA, 0x5C22, 0x0284, 0x5C24, 0x02C8,
- 0x5C25, 0x17DE, 0x5C28, 0x1865, 0x5C2A, 0x1866, 0x5C2C, 0x0484,
- 0x5C30, 0x2113, 0x5C31, 0x0C31, 0x5C33, 0x23BB, 0x5C37, 0x13C7,
- 0x5C38, 0x0285, 0x5C39, 0x0299, 0x5C3A, 0x02C9, 0x5C3B, 0x17A1,
- 0x5C3C, 0x0335, 0x5C3E, 0x0488, 0x5C3F, 0x0487, 0x5C40, 0x0485,
- 0x5C41, 0x0486, 0x5C44, 0x195B, 0x5C45, 0x05A2, 0x5C46, 0x05A3,
- 0x5C47, 0x195C, 0x5C48, 0x05A1, 0x5C4B, 0x070A, 0x5C4C, 0x1AB4,
- 0x5C4D, 0x0709, 0x5C4E, 0x0707, 0x5C4F, 0x0708, 0x5C50, 0x089E,
- 0x5C51, 0x089C, 0x5C54, 0x1C7E, 0x5C55, 0x089D, 0x5C56, 0x1C7D,
- 0x5C58, 0x0892, 0x5C59, 0x1EBB, 0x5C5C, 0x0A5C, 0x5C5D, 0x0A5D,
- 0x5C60, 0x0A5B, 0x5C62, 0x0FC2, 0x5C63, 0x2662, 0x5C64, 0x1134,
- 0x5C65, 0x1135, 0x5C67, 0x28B7, 0x5C68, 0x13C8, 0x5C69, 0x2F19,
- 0x5C6A, 0x2F1A, 0x5C6C, 0x166E, 0x5C6D, 0x3483, 0x5C6E, 0x1776,
- 0x5C6F, 0x02CA, 0x5C71, 0x0286, 0x5C73, 0x17A3, 0x5C74, 0x17A2,
- 0x5C79, 0x03C7, 0x5C7A, 0x17E0, 0x5C7B, 0x17E1, 0x5C7C, 0x17DF,
- 0x5C7E, 0x17E2, 0x5C86, 0x186E, 0x5C88, 0x1869, 0x5C89, 0x186B,
- 0x5C8A, 0x186D, 0x5C8B, 0x186A, 0x5C8C, 0x048C, 0x5C8D, 0x1867,
- 0x5C8F, 0x1868, 0x5C90, 0x0489, 0x5C91, 0x048A, 0x5C92, 0x186C,
- 0x5C93, 0x186F, 0x5C94, 0x048B, 0x5C95, 0x1870, 0x5C9D, 0x196A,
- 0x5C9F, 0x1964, 0x5CA0, 0x195F, 0x5CA1, 0x05A5, 0x5CA2, 0x1967,
- 0x5CA3, 0x1965, 0x5CA4, 0x195E, 0x5CA5, 0x196B, 0x5CA6, 0x196E,
- 0x5CA7, 0x1969, 0x5CA8, 0x1962, 0x5CA9, 0x05A7, 0x5CAA, 0x1968,
- 0x5CAB, 0x05A8, 0x5CAC, 0x1963, 0x5CAD, 0x1966, 0x5CAE, 0x195D,
- 0x5CAF, 0x1961, 0x5CB0, 0x196D, 0x5CB1, 0x05A9, 0x5CB3, 0x05AA,
- 0x5CB5, 0x1960, 0x5CB6, 0x196C, 0x5CB7, 0x05A4, 0x5CB8, 0x05A6,
- 0x5CC6, 0x1AC5, 0x5CC7, 0x1ABE, 0x5CC8, 0x1AC4, 0x5CC9, 0x1ABD,
- 0x5CCA, 0x1ABF, 0x5CCB, 0x1AB9, 0x5CCC, 0x1AB7, 0x5CCE, 0x1AC6,
- 0x5CCF, 0x1AC3, 0x5CD0, 0x1AB5, 0x5CD2, 0x070C, 0x5CD3, 0x1AC1,
- 0x5CD4, 0x1AC2, 0x5CD6, 0x1AC0, 0x5CD7, 0x1AB8, 0x5CD8, 0x1AB6,
- 0x5CD9, 0x070B, 0x5CDA, 0x1ABC, 0x5CDB, 0x1ABA, 0x5CDE, 0x1ABB,
- 0x5CDF, 0x1AC7, 0x5CE8, 0x08A3, 0x5CEA, 0x08A2, 0x5CEC, 0x1C7F,
- 0x5CED, 0x089F, 0x5CEE, 0x1C81, 0x5CF0, 0x08A4, 0x5CF1, 0x1C82,
- 0x5CF4, 0x08A7, 0x5CF6, 0x08A5, 0x5CF7, 0x1C83, 0x5CF8, 0x1AC8,
- 0x5CF9, 0x1C85, 0x5CFB, 0x08A1, 0x5CFD, 0x08A0, 0x5CFF, 0x1C80,
- 0x5D00, 0x1C84, 0x5D01, 0x08A6, 0x5D06, 0x0A5F, 0x5D07, 0x0A5E,
- 0x5D0B, 0x1EBD, 0x5D0C, 0x1EC1, 0x5D0D, 0x1EC3, 0x5D0E, 0x0A60,
- 0x5D0F, 0x1EC6, 0x5D11, 0x0A64, 0x5D12, 0x1EC8, 0x5D14, 0x0A66,
- 0x5D16, 0x0A62, 0x5D17, 0x0A6A, 0x5D19, 0x0A67, 0x5D1A, 0x1EBF,
- 0x5D1B, 0x0A61, 0x5D1D, 0x1EBE, 0x5D1E, 0x1EBC, 0x5D1F, 0x1ECA,
- 0x5D20, 0x1EC0, 0x5D22, 0x0A63, 0x5D23, 0x1EC9, 0x5D24, 0x0A68,
- 0x5D25, 0x1EC5, 0x5D26, 0x1EC4, 0x5D27, 0x0A69, 0x5D28, 0x1EC2,
- 0x5D29, 0x0A65, 0x5D2E, 0x1ECB, 0x5D30, 0x1EC7, 0x5D31, 0x2122,
- 0x5D32, 0x2129, 0x5D33, 0x211E, 0x5D34, 0x0C34, 0x5D35, 0x211A,
- 0x5D36, 0x212A, 0x5D37, 0x2114, 0x5D38, 0x2127, 0x5D39, 0x2125,
- 0x5D3A, 0x211F, 0x5D3C, 0x2128, 0x5D3D, 0x2121, 0x5D3F, 0x2119,
- 0x5D40, 0x212B, 0x5D41, 0x2117, 0x5D42, 0x2124, 0x5D43, 0x2115,
- 0x5D45, 0x212C, 0x5D47, 0x0C35, 0x5D49, 0x2126, 0x5D4A, 0x23BE,
- 0x5D4B, 0x2118, 0x5D4C, 0x0C32, 0x5D4E, 0x211C, 0x5D50, 0x0C33,
- 0x5D51, 0x211B, 0x5D52, 0x2120, 0x5D55, 0x211D, 0x5D59, 0x2123,
- 0x5D5E, 0x23C2, 0x5D62, 0x23C5, 0x5D63, 0x23BD, 0x5D65, 0x23BF,
- 0x5D67, 0x23C4, 0x5D68, 0x23C3, 0x5D69, 0x0DFD, 0x5D6B, 0x2116,
- 0x5D6C, 0x23C1, 0x5D6F, 0x0DFE, 0x5D71, 0x23BC, 0x5D72, 0x23C0,
- 0x5D77, 0x2669, 0x5D79, 0x2670, 0x5D7A, 0x2667, 0x5D7C, 0x266E,
- 0x5D7D, 0x2665, 0x5D7E, 0x266D, 0x5D7F, 0x2671, 0x5D80, 0x2664,
- 0x5D81, 0x2668, 0x5D82, 0x2663, 0x5D84, 0x0FC3, 0x5D86, 0x2666,
- 0x5D87, 0x0FC4, 0x5D88, 0x266C, 0x5D89, 0x266B, 0x5D8A, 0x266A,
- 0x5D8D, 0x266F, 0x5D92, 0x28BB, 0x5D93, 0x28BD, 0x5D94, 0x1137,
- 0x5D95, 0x28BE, 0x5D97, 0x28B9, 0x5D99, 0x28B8, 0x5D9A, 0x28C2,
- 0x5D9C, 0x28C0, 0x5D9D, 0x1136, 0x5D9E, 0x28C3, 0x5D9F, 0x28BA,
- 0x5DA0, 0x28BF, 0x5DA1, 0x28C1, 0x5DA2, 0x28BC, 0x5DA7, 0x2B2C,
- 0x5DA8, 0x2B31, 0x5DA9, 0x2B2B, 0x5DAA, 0x2B30, 0x5DAC, 0x2B29,
- 0x5DAD, 0x2B33, 0x5DAE, 0x2B2F, 0x5DAF, 0x2B34, 0x5DB0, 0x2B2E,
- 0x5DB1, 0x2B2A, 0x5DB2, 0x2B32, 0x5DB4, 0x2B35, 0x5DB5, 0x2B2D,
- 0x5DB7, 0x2D5B, 0x5DB8, 0x13CC, 0x5DBA, 0x13CA, 0x5DBC, 0x13C9,
- 0x5DBD, 0x13CB, 0x5DC0, 0x2F1B, 0x5DC2, 0x3023, 0x5DC3, 0x308C,
- 0x5DC6, 0x31CD, 0x5DC7, 0x31CE, 0x5DC9, 0x1613, 0x5DCB, 0x32CE,
- 0x5DCD, 0x166F, 0x5DCF, 0x32CF, 0x5DD1, 0x337F, 0x5DD2, 0x16C2,
- 0x5DD4, 0x16C1, 0x5DD5, 0x337E, 0x5DD6, 0x16F7, 0x5DD8, 0x3414,
- 0x5DDB, 0x0226, 0x5DDD, 0x0287, 0x5DDE, 0x03C8, 0x5DDF, 0x17E3,
- 0x5DE0, 0x1871, 0x5DE1, 0x051A, 0x5DE2, 0x0A6B, 0x5DE5, 0x0288,
- 0x5DE6, 0x0338, 0x5DE7, 0x0337, 0x5DE8, 0x0336, 0x5DEB, 0x048D,
- 0x5DEE, 0x08A8, 0x5DF0, 0x23C6, 0x5DF1, 0x0289, 0x5DF2, 0x028A,
- 0x5DF3, 0x028B, 0x5DF4, 0x02CB, 0x5DF7, 0x070D, 0x5DF9, 0x1AC9,
- 0x5DFD, 0x0C36, 0x5DFE, 0x028C, 0x5DFF, 0x1788, 0x5E02, 0x0339,
- 0x5E03, 0x033A, 0x5E04, 0x17A4, 0x5E06, 0x03C9, 0x5E0A, 0x1872,
- 0x5E0C, 0x048E, 0x5E0E, 0x1873, 0x5E11, 0x05B0, 0x5E14, 0x1970,
- 0x5E15, 0x05AE, 0x5E16, 0x05AD, 0x5E17, 0x196F, 0x5E18, 0x05AB,
- 0x5E19, 0x1971, 0x5E1A, 0x05AC, 0x5E1B, 0x05AF, 0x5E1D, 0x070E,
- 0x5E1F, 0x0710, 0x5E20, 0x1ACD, 0x5E21, 0x1ACA, 0x5E22, 0x1ACB,
- 0x5E23, 0x1ACC, 0x5E24, 0x1ACE, 0x5E25, 0x070F, 0x5E28, 0x1C87,
- 0x5E29, 0x1C86, 0x5E2B, 0x08AA, 0x5E2D, 0x08A9, 0x5E33, 0x0A6E,
- 0x5E34, 0x1ECD, 0x5E36, 0x0A6D, 0x5E37, 0x0A6F, 0x5E38, 0x0A6C,
- 0x5E3D, 0x0C38, 0x5E3E, 0x1ECC, 0x5E40, 0x0C39, 0x5E41, 0x212E,
- 0x5E43, 0x0C3A, 0x5E44, 0x212D, 0x5E45, 0x0C37, 0x5E4A, 0x23C9,
- 0x5E4B, 0x23CB, 0x5E4C, 0x0DFF, 0x5E4D, 0x23CA, 0x5E4E, 0x23C8,
- 0x5E4F, 0x23C7, 0x5E53, 0x2674, 0x5E54, 0x0FC9, 0x5E55, 0x0FC7,
- 0x5E57, 0x0FC8, 0x5E58, 0x2672, 0x5E59, 0x2673, 0x5E5B, 0x0FC5,
- 0x5E5C, 0x28C7, 0x5E5D, 0x28C5, 0x5E5F, 0x1139, 0x5E60, 0x28C6,
- 0x5E61, 0x113A, 0x5E62, 0x1138, 0x5E63, 0x0FC6, 0x5E66, 0x2B38,
- 0x5E67, 0x2B36, 0x5E68, 0x2B37, 0x5E69, 0x28C4, 0x5E6A, 0x2D5D,
- 0x5E6B, 0x13CD, 0x5E6C, 0x2D5C, 0x5E6D, 0x2F1C, 0x5E6E, 0x2F1D,
- 0x5E6F, 0x2B39, 0x5E70, 0x308D, 0x5E72, 0x028D, 0x5E73, 0x033B,
- 0x5E74, 0x03CB, 0x5E75, 0x17E4, 0x5E76, 0x03CA, 0x5E78, 0x05B1,
- 0x5E79, 0x0E00, 0x5E7A, 0x0227, 0x5E7B, 0x02CC, 0x5E7C, 0x033C,
- 0x5E7D, 0x0711, 0x5E7E, 0x0C3B, 0x5E7F, 0x0228, 0x5E80, 0x17A5,
- 0x5E82, 0x17A6, 0x5E84, 0x17E5, 0x5E87, 0x0490, 0x5E88, 0x1877,
- 0x5E89, 0x1875, 0x5E8A, 0x0491, 0x5E8B, 0x1874, 0x5E8C, 0x1876,
- 0x5E8D, 0x1878, 0x5E8F, 0x048F, 0x5E95, 0x05B5, 0x5E96, 0x05B6,
- 0x5E97, 0x05B3, 0x5E9A, 0x05B2, 0x5E9B, 0x1AD2, 0x5E9C, 0x05B4,
- 0x5EA0, 0x0712, 0x5EA2, 0x1AD1, 0x5EA3, 0x1AD3, 0x5EA4, 0x1AD0,
- 0x5EA5, 0x1AD4, 0x5EA6, 0x0713, 0x5EA7, 0x08AD, 0x5EA8, 0x1C88,
- 0x5EAA, 0x1C8A, 0x5EAB, 0x08AB, 0x5EAC, 0x1C8B, 0x5EAD, 0x08AC,
- 0x5EAE, 0x1C89, 0x5EB0, 0x1ACF, 0x5EB1, 0x1ECE, 0x5EB2, 0x1ED1,
- 0x5EB3, 0x1ED2, 0x5EB4, 0x1ECF, 0x5EB5, 0x0A73, 0x5EB6, 0x0A72,
- 0x5EB7, 0x0A70, 0x5EB8, 0x0A71, 0x5EB9, 0x1ED0, 0x5EBE, 0x0A74,
- 0x5EC1, 0x0C3D, 0x5EC2, 0x0C3E, 0x5EC4, 0x0C3F, 0x5EC5, 0x23CC,
- 0x5EC6, 0x23CE, 0x5EC7, 0x23D0, 0x5EC8, 0x0E02, 0x5EC9, 0x0E01,
- 0x5ECA, 0x0C3C, 0x5ECB, 0x23CF, 0x5ECC, 0x23CD, 0x5ECE, 0x2678,
- 0x5ED1, 0x2676, 0x5ED2, 0x267C, 0x5ED3, 0x0FCA, 0x5ED4, 0x267D,
- 0x5ED5, 0x267A, 0x5ED6, 0x0FCB, 0x5ED7, 0x2677, 0x5ED8, 0x2675,
- 0x5ED9, 0x267B, 0x5EDA, 0x113C, 0x5EDB, 0x28C9, 0x5EDC, 0x2679,
- 0x5EDD, 0x113E, 0x5EDE, 0x28CA, 0x5EDF, 0x113D, 0x5EE0, 0x1140,
- 0x5EE1, 0x28CB, 0x5EE2, 0x113B, 0x5EE3, 0x113F, 0x5EE5, 0x2B3E,
- 0x5EE6, 0x2B3C, 0x5EE7, 0x2B3B, 0x5EE8, 0x2B3D, 0x5EE9, 0x2B3A,
- 0x5EEC, 0x157D, 0x5EEE, 0x31CF, 0x5EEF, 0x31D0, 0x5EF1, 0x32D0,
- 0x5EF2, 0x3380, 0x5EF3, 0x1742, 0x5EF4, 0x0229, 0x5EF6, 0x05B7,
- 0x5EF7, 0x0492, 0x5EFA, 0x0714, 0x5EFE, 0x028E, 0x5EFF, 0x02CD,
- 0x5F01, 0x033D, 0x5F02, 0x17E6, 0x5F04, 0x0493, 0x5F05, 0x1879,
- 0x5F07, 0x1AD5, 0x5F08, 0x0715, 0x5F0A, 0x0FCC, 0x5F0B, 0x028F,
- 0x5F0F, 0x03CC, 0x5F12, 0x0E03, 0x5F13, 0x0290, 0x5F14, 0x02CE,
- 0x5F15, 0x02CF, 0x5F17, 0x033F, 0x5F18, 0x033E, 0x5F1A, 0x17E7,
- 0x5F1B, 0x03CD, 0x5F1D, 0x187A, 0x5F1F, 0x0494, 0x5F22, 0x1973,
- 0x5F23, 0x1974, 0x5F24, 0x1975, 0x5F26, 0x05B8, 0x5F27, 0x05B9,
- 0x5F28, 0x1972, 0x5F29, 0x05BA, 0x5F2D, 0x0716, 0x5F2E, 0x1AD6,
- 0x5F30, 0x1C8D, 0x5F31, 0x08AE, 0x5F33, 0x1C8C, 0x5F35, 0x0A75,
- 0x5F36, 0x1ED3, 0x5F37, 0x0A76, 0x5F38, 0x1ED4, 0x5F3C, 0x0C40,
- 0x5F40, 0x23D1, 0x5F43, 0x267F, 0x5F44, 0x267E, 0x5F46, 0x0FCD,
- 0x5F48, 0x1141, 0x5F49, 0x28CC, 0x5F4A, 0x12AD, 0x5F4B, 0x2B3F,
- 0x5F4C, 0x13CE, 0x5F4E, 0x16C3, 0x5F4F, 0x3416, 0x5F50, 0x022A,
- 0x5F54, 0x1976, 0x5F56, 0x1AD7, 0x5F57, 0x0A77, 0x5F58, 0x212F,
- 0x5F59, 0x0E04, 0x5F5D, 0x14CF, 0x5F61, 0x022B, 0x5F62, 0x0496,
- 0x5F64, 0x0495, 0x5F65, 0x0717, 0x5F67, 0x1C8E, 0x5F69, 0x0A79,
- 0x5F6A, 0x0B89, 0x5F6B, 0x0A7A, 0x5F6C, 0x0A78, 0x5F6D, 0x0C41,
- 0x5F6F, 0x2680, 0x5F70, 0x0FCE, 0x5F71, 0x1142, 0x5F73, 0x1777,
- 0x5F74, 0x17E8, 0x5F76, 0x187C, 0x5F77, 0x0497, 0x5F78, 0x187B,
- 0x5F79, 0x0498, 0x5F7C, 0x05BE, 0x5F7D, 0x1979, 0x5F7E, 0x1978,
- 0x5F7F, 0x05BD, 0x5F80, 0x05BB, 0x5F81, 0x05BC, 0x5F82, 0x1977,
- 0x5F85, 0x0719, 0x5F86, 0x1AD8, 0x5F87, 0x071C, 0x5F88, 0x0718,
- 0x5F89, 0x071E, 0x5F8A, 0x071A, 0x5F8B, 0x071B, 0x5F8C, 0x071D,
- 0x5F90, 0x08B1, 0x5F91, 0x08B0, 0x5F92, 0x08AF, 0x5F96, 0x1ED6,
- 0x5F97, 0x0A7B, 0x5F98, 0x0A7E, 0x5F99, 0x0A7C, 0x5F9B, 0x1ED5,
- 0x5F9C, 0x0A81, 0x5F9E, 0x0A7D, 0x5F9F, 0x1ED7, 0x5FA0, 0x0A80,
- 0x5FA1, 0x0A7F, 0x5FA5, 0x2131, 0x5FA6, 0x2130, 0x5FA8, 0x0C44,
- 0x5FA9, 0x0C42, 0x5FAA, 0x0C43, 0x5FAB, 0x2132, 0x5FAC, 0x0E05,
- 0x5FAD, 0x23D3, 0x5FAE, 0x0E06, 0x5FAF, 0x23D2, 0x5FB2, 0x28CD,
- 0x5FB5, 0x1144, 0x5FB6, 0x2681, 0x5FB7, 0x1143, 0x5FB9, 0x0FCF,
- 0x5FBB, 0x2B41, 0x5FBC, 0x2B40, 0x5FBD, 0x13CF, 0x5FBE, 0x2D5E,
- 0x5FBF, 0x308E, 0x5FC0, 0x31D1, 0x5FC1, 0x31D2, 0x5FC3, 0x02D0,
- 0x5FC5, 0x0340, 0x5FC9, 0x17A7, 0x5FCC, 0x049A, 0x5FCD, 0x049C,
- 0x5FCF, 0x17EB, 0x5FD0, 0x187F, 0x5FD1, 0x187E, 0x5FD2, 0x187D,
- 0x5FD4, 0x17EA, 0x5FD5, 0x17E9, 0x5FD6, 0x03CF, 0x5FD7, 0x049B,
- 0x5FD8, 0x0499, 0x5FD9, 0x03CE, 0x5FDD, 0x05BF, 0x5FDE, 0x197A,
- 0x5FE0, 0x05C0, 0x5FE1, 0x1884, 0x5FE3, 0x1886, 0x5FE4, 0x1885,
- 0x5FE5, 0x197B, 0x5FE8, 0x1881, 0x5FEA, 0x04A0, 0x5FEB, 0x049E,
- 0x5FED, 0x1880, 0x5FEE, 0x1882, 0x5FEF, 0x1888, 0x5FF1, 0x049D,
- 0x5FF3, 0x1883, 0x5FF4, 0x188C, 0x5FF5, 0x05C2, 0x5FF7, 0x1889,
- 0x5FF8, 0x049F, 0x5FFA, 0x1887, 0x5FFB, 0x188A, 0x5FFD, 0x05C1,
- 0x5FFF, 0x05C3, 0x6000, 0x188B, 0x6009, 0x198F, 0x600A, 0x1982,
- 0x600B, 0x1980, 0x600C, 0x198E, 0x600D, 0x1989, 0x600E, 0x0723,
- 0x600F, 0x05C4, 0x6010, 0x198A, 0x6011, 0x198D, 0x6012, 0x071F,
- 0x6013, 0x198C, 0x6014, 0x05C5, 0x6015, 0x05CA, 0x6016, 0x05C8,
- 0x6017, 0x1983, 0x6019, 0x197E, 0x601A, 0x1985, 0x601B, 0x05CF,
- 0x601C, 0x1990, 0x601D, 0x0720, 0x601E, 0x1986, 0x6020, 0x0721,
- 0x6021, 0x05CB, 0x6022, 0x1988, 0x6024, 0x1AE7, 0x6025, 0x0722,
- 0x6026, 0x197D, 0x6027, 0x05CC, 0x6028, 0x0724, 0x6029, 0x05CD,
- 0x602A, 0x05C9, 0x602B, 0x05CE, 0x602C, 0x1987, 0x602D, 0x197C,
- 0x602E, 0x198B, 0x602F, 0x05C6, 0x6032, 0x197F, 0x6033, 0x1984,
- 0x6034, 0x1981, 0x6035, 0x05C7, 0x6037, 0x1AD9, 0x6039, 0x1ADA,
- 0x6040, 0x1AE4, 0x6041, 0x1C92, 0x6042, 0x1AE5, 0x6043, 0x072A,
- 0x6044, 0x1AE8, 0x6045, 0x1ADE, 0x6046, 0x0729, 0x6047, 0x1AE0,
- 0x6049, 0x1AE1, 0x604C, 0x1AE3, 0x604D, 0x0725, 0x6050, 0x08B5,
- 0x6052, 0x36EC, 0x6053, 0x1ADF, 0x6054, 0x1ADB, 0x6055, 0x08B6,
- 0x6058, 0x1AE9, 0x6059, 0x08B2, 0x605A, 0x1C90, 0x605B, 0x1AE2,
- 0x605D, 0x1C8F, 0x605E, 0x1ADD, 0x605F, 0x1AE6, 0x6062, 0x0728,
- 0x6063, 0x08B3, 0x6064, 0x072E, 0x6065, 0x08B4, 0x6066, 0x1AEA,
- 0x6067, 0x1C91, 0x6068, 0x0727, 0x6069, 0x08B8, 0x606A, 0x072D,
- 0x606B, 0x072C, 0x606C, 0x072B, 0x606D, 0x08B7, 0x606E, 0x1AEB,
- 0x606F, 0x08B9, 0x6070, 0x0726, 0x6072, 0x1ADC, 0x607F, 0x0A82,
- 0x6080, 0x1C95, 0x6081, 0x1C97, 0x6083, 0x1C99, 0x6084, 0x08BA,
- 0x6085, 0x08C0, 0x6086, 0x1EDA, 0x6087, 0x1C9D, 0x6088, 0x1C94,
- 0x6089, 0x0A84, 0x608A, 0x1ED8, 0x608C, 0x08BF, 0x608D, 0x08BD,
- 0x608E, 0x1C9F, 0x6090, 0x1ED9, 0x6092, 0x1C96, 0x6094, 0x08BE,
- 0x6095, 0x1C9A, 0x6096, 0x08C1, 0x6097, 0x1C9C, 0x609A, 0x08BC,
- 0x609B, 0x1C9B, 0x609C, 0x1C9E, 0x609D, 0x1C98, 0x609F, 0x08BB,
- 0x60A0, 0x0A85, 0x60A2, 0x1C93, 0x60A3, 0x0A83, 0x60A8, 0x0A86,
- 0x60B0, 0x1EDC, 0x60B1, 0x1EE5, 0x60B2, 0x0C47, 0x60B4, 0x0A88,
- 0x60B5, 0x0A8D, 0x60B6, 0x0C48, 0x60B7, 0x1EE7, 0x60B8, 0x0A94,
- 0x60B9, 0x2134, 0x60BA, 0x1EDD, 0x60BB, 0x0A8C, 0x60BC, 0x0A8F,
- 0x60BD, 0x0A8A, 0x60BE, 0x1EDB, 0x60BF, 0x1EE9, 0x60C0, 0x1EEC,
- 0x60C1, 0x2143, 0x60C3, 0x1EEA, 0x60C4, 0x2138, 0x60C5, 0x0A8B,
- 0x60C6, 0x0A92, 0x60C7, 0x0A96, 0x60C8, 0x1EE4, 0x60C9, 0x2133,
- 0x60CA, 0x1EE8, 0x60CB, 0x0A87, 0x60CC, 0x2135, 0x60CD, 0x1EEB,
- 0x60CE, 0x2137, 0x60CF, 0x1EE0, 0x60D1, 0x0C45, 0x60D3, 0x1EDE,
- 0x60D4, 0x1EDF, 0x60D5, 0x0A91, 0x60D8, 0x0A90, 0x60D9, 0x1EE2,
- 0x60DA, 0x0A95, 0x60DB, 0x1EE6, 0x60DC, 0x0A8E, 0x60DD, 0x1EE3,
- 0x60DF, 0x0A93, 0x60E0, 0x0C49, 0x60E1, 0x0C46, 0x60E2, 0x2136,
- 0x60E4, 0x1EE1, 0x60E6, 0x0A89, 0x60F0, 0x0C4E, 0x60F1, 0x0C52,
- 0x60F2, 0x213A, 0x60F3, 0x0E0B, 0x60F4, 0x0C50, 0x60F5, 0x213E,
- 0x60F6, 0x0C54, 0x60F7, 0x23D4, 0x60F8, 0x2140, 0x60F9, 0x0E0D,
- 0x60FA, 0x0C4C, 0x60FB, 0x0C4F, 0x60FC, 0x2141, 0x60FE, 0x2142,
- 0x60FF, 0x2148, 0x6100, 0x0C56, 0x6101, 0x0E0E, 0x6103, 0x2144,
- 0x6104, 0x2149, 0x6105, 0x213D, 0x6106, 0x0E18, 0x6108, 0x0E0F,
- 0x6109, 0x0C55, 0x610A, 0x213B, 0x610B, 0x214A, 0x610D, 0x0E17,
- 0x610E, 0x0C53, 0x610F, 0x0E08, 0x6110, 0x2147, 0x6112, 0x0C57,
- 0x6113, 0x213F, 0x6114, 0x2139, 0x6115, 0x0C4D, 0x6116, 0x213C,
- 0x6118, 0x2145, 0x611A, 0x0E07, 0x611B, 0x0E0C, 0x611C, 0x0C4A,
- 0x611D, 0x2146, 0x611F, 0x0E0A, 0x6123, 0x0C4B, 0x6127, 0x0E16,
- 0x6128, 0x2683, 0x6129, 0x23DF, 0x612B, 0x23D7, 0x612C, 0x2682,
- 0x612E, 0x23DB, 0x612F, 0x23DD, 0x6132, 0x23DA, 0x6134, 0x0E15,
- 0x6136, 0x23D9, 0x6137, 0x0E19, 0x613B, 0x2692, 0x613E, 0x0E14,
- 0x613F, 0x0FD1, 0x6140, 0x23E0, 0x6141, 0x2684, 0x6144, 0x0E12,
- 0x6145, 0x23D8, 0x6146, 0x23DC, 0x6147, 0x0FD0, 0x6148, 0x0E09,
- 0x6149, 0x23D5, 0x614A, 0x23D6, 0x614B, 0x0FD2, 0x614C, 0x0E11,
- 0x614D, 0x0E13, 0x614E, 0x0E10, 0x614F, 0x23DE, 0x6152, 0x2688,
- 0x6153, 0x2689, 0x6154, 0x268E, 0x6155, 0x1149, 0x6156, 0x2695,
- 0x6158, 0x0FD8, 0x615A, 0x0FD7, 0x615B, 0x2690, 0x615D, 0x1148,
- 0x615E, 0x2685, 0x615F, 0x0FD6, 0x6161, 0x2694, 0x6162, 0x0FD4,
- 0x6163, 0x0FD5, 0x6165, 0x2691, 0x6166, 0x28DE, 0x6167, 0x1146,
- 0x6168, 0x0C51, 0x616A, 0x2693, 0x616B, 0x114D, 0x616C, 0x268B,
- 0x616E, 0x1147, 0x6170, 0x114C, 0x6171, 0x2686, 0x6172, 0x268A,
- 0x6173, 0x2687, 0x6174, 0x268D, 0x6175, 0x0FD9, 0x6176, 0x1145,
- 0x6177, 0x0FD3, 0x6179, 0x28D0, 0x617A, 0x268F, 0x617C, 0x114B,
- 0x617E, 0x114E, 0x6180, 0x268C, 0x6182, 0x114A, 0x6183, 0x28CF,
- 0x6189, 0x28D4, 0x618A, 0x12B1, 0x618B, 0x28CE, 0x618C, 0x2B4D,
- 0x618D, 0x28DD, 0x618E, 0x1152, 0x6190, 0x1150, 0x6191, 0x12AF,
- 0x6192, 0x28DA, 0x6193, 0x28D6, 0x6194, 0x1156, 0x6196, 0x2B44,
- 0x619A, 0x1154, 0x619B, 0x28D5, 0x619D, 0x2B42, 0x619F, 0x28D9,
- 0x61A1, 0x28DC, 0x61A2, 0x28D3, 0x61A4, 0x1155, 0x61A7, 0x114F,
- 0x61A8, 0x2B43, 0x61A9, 0x12B0, 0x61AA, 0x28DB, 0x61AB, 0x1151,
- 0x61AC, 0x1153, 0x61AD, 0x28D8, 0x61AE, 0x1157, 0x61AF, 0x28D7,
- 0x61B0, 0x28D2, 0x61B1, 0x28D1, 0x61B2, 0x12AE, 0x61B3, 0x28DF,
- 0x61B4, 0x2B46, 0x61B5, 0x2D60, 0x61B6, 0x12B3, 0x61B8, 0x2B4C,
- 0x61BA, 0x2B4A, 0x61BC, 0x2D61, 0x61BE, 0x12B4, 0x61BF, 0x2B4B,
- 0x61C1, 0x2B48, 0x61C2, 0x13D1, 0x61C3, 0x2D5F, 0x61C5, 0x2B45,
- 0x61C6, 0x2B47, 0x61C7, 0x13D2, 0x61C8, 0x12B6, 0x61C9, 0x13D0,
- 0x61CA, 0x12B5, 0x61CB, 0x13D4, 0x61CC, 0x2B49, 0x61CD, 0x12B2,
- 0x61D6, 0x2F26, 0x61D8, 0x2F1E, 0x61DE, 0x2D67, 0x61DF, 0x2F1F,
- 0x61E0, 0x2D63, 0x61E3, 0x14D0, 0x61E4, 0x2D65, 0x61E5, 0x2D64,
- 0x61E6, 0x13D3, 0x61E7, 0x2D62, 0x61E8, 0x2D66, 0x61E9, 0x2F27,
- 0x61EA, 0x2F23, 0x61EB, 0x2F25, 0x61ED, 0x2F20, 0x61EE, 0x2F21,
- 0x61F0, 0x2F24, 0x61F1, 0x2F22, 0x61F2, 0x157E, 0x61F5, 0x1581,
- 0x61F6, 0x1580, 0x61F7, 0x157F, 0x61F8, 0x1614, 0x61F9, 0x31D3,
- 0x61FA, 0x1615, 0x61FB, 0x308F, 0x61FC, 0x1670, 0x61FD, 0x32D1,
- 0x61FE, 0x1671, 0x61FF, 0x16C4, 0x6200, 0x16F8, 0x6201, 0x3417,
- 0x6203, 0x3418, 0x6204, 0x3419, 0x6207, 0x3533, 0x6208, 0x02D1,
- 0x6209, 0x17A8, 0x620A, 0x0341, 0x620C, 0x03D1, 0x620D, 0x03D2,
- 0x620E, 0x03D0, 0x6210, 0x03D3, 0x6211, 0x04A2, 0x6212, 0x04A1,
- 0x6214, 0x1991, 0x6215, 0x05D1, 0x6216, 0x05D0, 0x6219, 0x1CA0,
- 0x621A, 0x0A97, 0x621B, 0x0A98, 0x621F, 0x0C58, 0x6220, 0x23E1,
- 0x6221, 0x0E1A, 0x6222, 0x0E1B, 0x6223, 0x23E3, 0x6224, 0x23E5,
- 0x6225, 0x23E4, 0x6227, 0x2697, 0x6229, 0x2696, 0x622A, 0x0FDA,
- 0x622B, 0x2698, 0x622D, 0x28E0, 0x622E, 0x1158, 0x6230, 0x12B7,
- 0x6232, 0x13D5, 0x6233, 0x14D1, 0x6234, 0x13D6, 0x6236, 0x02D2,
- 0x623A, 0x188D, 0x623D, 0x1992, 0x623E, 0x05D3, 0x623F, 0x05D2,
- 0x6240, 0x05D4, 0x6241, 0x072F, 0x6242, 0x1AEC, 0x6243, 0x1AED,
- 0x6246, 0x1CA1, 0x6247, 0x08C2, 0x6248, 0x0A99, 0x6249, 0x0C59,
- 0x624A, 0x214B, 0x624B, 0x02D3, 0x624D, 0x0291, 0x624E, 0x02D4,
- 0x6250, 0x17A9, 0x6251, 0x0345, 0x6252, 0x0344, 0x6253, 0x0342,
- 0x6254, 0x0343, 0x6258, 0x03D6, 0x6259, 0x17F2, 0x625A, 0x17F4,
- 0x625B, 0x03D5, 0x625C, 0x17EC, 0x625E, 0x17ED, 0x6260, 0x17F3,
- 0x6261, 0x17EF, 0x6262, 0x17F1, 0x6263, 0x03D4, 0x6264, 0x17EE,
- 0x6265, 0x17F5, 0x6266, 0x17F0, 0x626D, 0x04A9, 0x626E, 0x04B2,
- 0x626F, 0x04B0, 0x6270, 0x1897, 0x6271, 0x1894, 0x6272, 0x189C,
- 0x6273, 0x04AE, 0x6274, 0x189D, 0x6276, 0x04A7, 0x6277, 0x189A,
- 0x6279, 0x04AD, 0x627A, 0x1896, 0x627B, 0x1895, 0x627C, 0x04AB,
- 0x627D, 0x189B, 0x627E, 0x04AC, 0x627F, 0x05D5, 0x6280, 0x04A6,
- 0x6281, 0x1898, 0x6283, 0x188E, 0x6284, 0x04A3, 0x6286, 0x04B6,
- 0x6287, 0x1893, 0x6288, 0x1899, 0x6289, 0x04A8, 0x628A, 0x04AA,
- 0x628C, 0x188F, 0x628E, 0x1890, 0x628F, 0x1891, 0x6291, 0x04B5,
- 0x6292, 0x04AF, 0x6293, 0x04B4, 0x6294, 0x1892, 0x6295, 0x04B3,
- 0x6296, 0x04A5, 0x6297, 0x04A4, 0x6298, 0x04B1, 0x62A8, 0x05E3,
- 0x62A9, 0x199E, 0x62AA, 0x1997, 0x62AB, 0x05DE, 0x62AC, 0x05F1,
- 0x62AD, 0x1993, 0x62AE, 0x199A, 0x62AF, 0x199C, 0x62B0, 0x199F,
- 0x62B1, 0x05EC, 0x62B3, 0x199B, 0x62B4, 0x1994, 0x62B5, 0x05EA,
- 0x62B6, 0x1998, 0x62B8, 0x19A0, 0x62B9, 0x05DB, 0x62BB, 0x199D,
- 0x62BC, 0x05E5, 0x62BD, 0x05E4, 0x62BE, 0x1996, 0x62BF, 0x05D9,
- 0x62C2, 0x05DA, 0x62C4, 0x05D8, 0x62C6, 0x05F0, 0x62C7, 0x05E8,
- 0x62C8, 0x05E2, 0x62C9, 0x05D6, 0x62CA, 0x1999, 0x62CB, 0x05E1,
- 0x62CC, 0x05D7, 0x62CD, 0x05E9, 0x62CE, 0x05F2, 0x62CF, 0x1AEE,
- 0x62D0, 0x05E6, 0x62D1, 0x1995, 0x62D2, 0x05DC, 0x62D3, 0x05DF,
- 0x62D4, 0x05E0, 0x62D6, 0x05EE, 0x62D7, 0x05EF, 0x62D8, 0x05ED,
- 0x62D9, 0x05E7, 0x62DA, 0x05EB, 0x62DB, 0x05DD, 0x62DC, 0x0730,
- 0x62EB, 0x1AF4, 0x62EC, 0x073C, 0x62ED, 0x0734, 0x62EE, 0x0736,
- 0x62EF, 0x073B, 0x62F0, 0x1B00, 0x62F1, 0x0739, 0x62F2, 0x1CA2,
- 0x62F3, 0x08C3, 0x62F4, 0x073E, 0x62F5, 0x1AF1, 0x62F6, 0x1AF9,
- 0x62F7, 0x073A, 0x62F8, 0x1AF8, 0x62F9, 0x1AF5, 0x62FA, 0x1AFD,
- 0x62FB, 0x1AFF, 0x62FC, 0x0733, 0x62FD, 0x0737, 0x62FE, 0x073D,
- 0x62FF, 0x08C5, 0x6300, 0x1AFA, 0x6301, 0x0735, 0x6302, 0x0740,
- 0x6303, 0x1AF3, 0x6307, 0x0738, 0x6308, 0x08C4, 0x6309, 0x0732,
- 0x630B, 0x1AF0, 0x630C, 0x1AF7, 0x630D, 0x1AEF, 0x630E, 0x1AF2,
- 0x630F, 0x1AF6, 0x6310, 0x1CA3, 0x6311, 0x073F, 0x6313, 0x1AFB,
- 0x6314, 0x1AFC, 0x6315, 0x1AFE, 0x6316, 0x0731, 0x6328, 0x08D3,
- 0x6329, 0x1CAF, 0x632A, 0x08D1, 0x632B, 0x08D2, 0x632C, 0x1CA5,
- 0x632D, 0x1CB5, 0x632F, 0x08C8, 0x6332, 0x1EED, 0x6333, 0x1CB7,
- 0x6334, 0x1CB1, 0x6336, 0x1CA8, 0x6338, 0x1CBA, 0x6339, 0x1CAB,
- 0x633A, 0x08CE, 0x633B, 0x1F04, 0x633C, 0x1CAE, 0x633D, 0x08D0,
- 0x633E, 0x08C7, 0x6340, 0x1CBC, 0x6341, 0x1CB0, 0x6342, 0x08CA,
- 0x6343, 0x1CA9, 0x6344, 0x1CA6, 0x6345, 0x1CA7, 0x6346, 0x08CB,
- 0x6347, 0x1CB6, 0x6348, 0x1CBD, 0x6349, 0x08CD, 0x634A, 0x1CAD,
- 0x634B, 0x1CAC, 0x634C, 0x08D5, 0x634D, 0x08D4, 0x634E, 0x08C6,
- 0x634F, 0x08CC, 0x6350, 0x08CF, 0x6351, 0x1CB9, 0x6354, 0x1CB3,
- 0x6355, 0x08C9, 0x6356, 0x1CA4, 0x6357, 0x1CBB, 0x6358, 0x1CB2,
- 0x6359, 0x1CB4, 0x635A, 0x1CB8, 0x6365, 0x1EEE, 0x6367, 0x0AA1,
- 0x6368, 0x0AB5, 0x6369, 0x0AB4, 0x636B, 0x0AA9, 0x636D, 0x1F00,
- 0x636E, 0x1EFC, 0x636F, 0x1EF9, 0x6370, 0x1F0B, 0x6371, 0x0AA4,
- 0x6372, 0x0A9C, 0x6375, 0x1EFE, 0x6376, 0x0C69, 0x6377, 0x0AA0,
- 0x6378, 0x1F06, 0x637A, 0x0AB6, 0x637B, 0x0AB3, 0x637C, 0x1F02,
- 0x637D, 0x1EF1, 0x6380, 0x0AB2, 0x6381, 0x1F08, 0x6382, 0x1EF0,
- 0x6383, 0x0AA7, 0x6384, 0x0AAB, 0x6385, 0x1F07, 0x6387, 0x1EFA,
- 0x6388, 0x0AAC, 0x6389, 0x0AA6, 0x638A, 0x1EEF, 0x638C, 0x0C5B,
- 0x638D, 0x1F0A, 0x638E, 0x1EF8, 0x638F, 0x0AB1, 0x6390, 0x1EFB,
- 0x6391, 0x1F09, 0x6392, 0x0AB0, 0x6394, 0x214C, 0x6396, 0x0A9D,
- 0x6397, 0x1EF6, 0x6398, 0x0AA2, 0x6399, 0x0AAD, 0x639B, 0x0AA8,
- 0x639C, 0x1EFF, 0x639D, 0x1EF5, 0x639E, 0x1EF3, 0x639F, 0x1F05,
- 0x63A0, 0x0A9A, 0x63A1, 0x0AAE, 0x63A2, 0x0A9E, 0x63A3, 0x0C5A,
- 0x63A4, 0x1F03, 0x63A5, 0x0A9F, 0x63A7, 0x0A9B, 0x63A8, 0x0AAA,
- 0x63A9, 0x0AA5, 0x63AA, 0x0AA3, 0x63AB, 0x1EF7, 0x63AC, 0x0AAF,
- 0x63AD, 0x1EF4, 0x63AE, 0x1F01, 0x63AF, 0x1EFD, 0x63B0, 0x214E,
- 0x63B1, 0x214D, 0x63BD, 0x1EF2, 0x63BE, 0x215E, 0x63C0, 0x0C5D,
- 0x63C2, 0x2164, 0x63C3, 0x2153, 0x63C4, 0x2161, 0x63C5, 0x23E6,
- 0x63C6, 0x0C60, 0x63C7, 0x2165, 0x63C8, 0x2168, 0x63C9, 0x0C5F,
- 0x63CA, 0x2156, 0x63CB, 0x2167, 0x63CC, 0x2166, 0x63CD, 0x0C61,
- 0x63CE, 0x214F, 0x63CF, 0x0C5C, 0x63D0, 0x0C64, 0x63D2, 0x0C62,
- 0x63D3, 0x2163, 0x63D5, 0x2159, 0x63D6, 0x0C66, 0x63D7, 0x216A,
- 0x63D8, 0x2162, 0x63D9, 0x216B, 0x63DA, 0x0C6E, 0x63DB, 0x0C6C,
- 0x63DC, 0x2160, 0x63DD, 0x215F, 0x63DF, 0x215D, 0x63E0, 0x2157,
- 0x63E1, 0x0C65, 0x63E3, 0x0C63, 0x63E4, 0x1CAA, 0x63E5, 0x2150,
- 0x63E7, 0x2404, 0x63E8, 0x2151, 0x63E9, 0x0C5E, 0x63EA, 0x0C6B,
- 0x63EB, 0x23E8, 0x63ED, 0x0C67, 0x63EE, 0x0C68, 0x63EF, 0x2152,
- 0x63F0, 0x2169, 0x63F1, 0x23E7, 0x63F2, 0x215A, 0x63F3, 0x2155,
- 0x63F4, 0x0C6A, 0x63F5, 0x215B, 0x63F6, 0x2158, 0x63F9, 0x0C6F,
- 0x6406, 0x0E2A, 0x6409, 0x23EB, 0x640A, 0x23FE, 0x640B, 0x2403,
- 0x640C, 0x23F7, 0x640D, 0x0E26, 0x640E, 0x2408, 0x640F, 0x0E23,
- 0x6410, 0x23E9, 0x6412, 0x23EA, 0x6413, 0x0E1C, 0x6414, 0x0E25,
- 0x6415, 0x23F1, 0x6416, 0x0E28, 0x6417, 0x0E29, 0x6418, 0x23F2,
- 0x641A, 0x23FF, 0x641B, 0x2405, 0x641C, 0x0E24, 0x641E, 0x0E1E,
- 0x641F, 0x23F0, 0x6420, 0x23EC, 0x6421, 0x2407, 0x6422, 0x23F5,
- 0x6423, 0x23F6, 0x6424, 0x23ED, 0x6425, 0x2401, 0x6426, 0x23F8,
- 0x6427, 0x2402, 0x6428, 0x23FA, 0x642A, 0x0E1F, 0x642B, 0x2699,
- 0x642C, 0x0E22, 0x642D, 0x0E20, 0x642E, 0x2406, 0x642F, 0x23FD,
- 0x6430, 0x23F9, 0x6433, 0x23EE, 0x6434, 0x0FE4, 0x6435, 0x23FC,
- 0x6436, 0x0E27, 0x6437, 0x23F4, 0x6439, 0x23F3, 0x643D, 0x0E21,
- 0x643E, 0x0E1D, 0x643F, 0x26AE, 0x6440, 0x2400, 0x6441, 0x23FB,
- 0x6443, 0x23EF, 0x644B, 0x26A9, 0x644D, 0x269A, 0x644E, 0x26A5,
- 0x6450, 0x26AC, 0x6451, 0x0FE2, 0x6452, 0x0C6D, 0x6453, 0x26AA,
- 0x6454, 0x0FDD, 0x6458, 0x0FDC, 0x6459, 0x26B1, 0x645B, 0x269B,
- 0x645C, 0x26A8, 0x645D, 0x269C, 0x645E, 0x26A7, 0x645F, 0x0FE0,
- 0x6460, 0x26AB, 0x6461, 0x215C, 0x6465, 0x26B2, 0x6466, 0x26A3,
- 0x6467, 0x0FE3, 0x6468, 0x28EE, 0x6469, 0x1159, 0x646B, 0x26B0,
- 0x646C, 0x26AF, 0x646D, 0x0FE5, 0x646E, 0x28E1, 0x646F, 0x115A,
- 0x6470, 0x28E2, 0x6472, 0x269F, 0x6473, 0x26A0, 0x6474, 0x269D,
- 0x6475, 0x26A2, 0x6476, 0x269E, 0x6477, 0x26B3, 0x6478, 0x0FDF,
- 0x6479, 0x115B, 0x647A, 0x0FE1, 0x647B, 0x0FE6, 0x647D, 0x26A1,
- 0x647F, 0x26AD, 0x6482, 0x26A6, 0x6485, 0x28E5, 0x6487, 0x0FDB,
- 0x6488, 0x115E, 0x6489, 0x2B54, 0x648A, 0x28EA, 0x648B, 0x28E9,
- 0x648C, 0x28EB, 0x648F, 0x28E8, 0x6490, 0x115F, 0x6492, 0x1165,
- 0x6493, 0x1162, 0x6495, 0x1163, 0x6496, 0x28E3, 0x6497, 0x28E6,
- 0x6498, 0x28F0, 0x6499, 0x116B, 0x649A, 0x1169, 0x649C, 0x28E7,
- 0x649D, 0x2154, 0x649E, 0x115C, 0x649F, 0x28ED, 0x64A0, 0x28E4,
- 0x64A2, 0x116C, 0x64A3, 0x28EC, 0x64A4, 0x0FDE, 0x64A5, 0x1161,
- 0x64A6, 0x26A4, 0x64A9, 0x1164, 0x64AB, 0x1168, 0x64AC, 0x116A,
- 0x64AD, 0x1167, 0x64AE, 0x1166, 0x64B0, 0x1160, 0x64B1, 0x28EF,
- 0x64B2, 0x115D, 0x64B3, 0x116D, 0x64BB, 0x12BB, 0x64BC, 0x12BC,
- 0x64BD, 0x2B53, 0x64BE, 0x12C5, 0x64BF, 0x12C2, 0x64C1, 0x12B9,
- 0x64C2, 0x12C0, 0x64C3, 0x2B55, 0x64C4, 0x12BE, 0x64C5, 0x12B8,
- 0x64C7, 0x12BF, 0x64C9, 0x2B52, 0x64CA, 0x13D8, 0x64CB, 0x12BA,
- 0x64CD, 0x12C1, 0x64CE, 0x13D7, 0x64CF, 0x2B51, 0x64D0, 0x2B50,
- 0x64D2, 0x12C3, 0x64D4, 0x12C4, 0x64D6, 0x2B4F, 0x64D7, 0x2B4E,
- 0x64D8, 0x13D9, 0x64D9, 0x2B58, 0x64DA, 0x12BD, 0x64DB, 0x2B56,
- 0x64E0, 0x13DA, 0x64E2, 0x13DF, 0x64E3, 0x2D6A, 0x64E4, 0x2D6C,
- 0x64E6, 0x13DC, 0x64E8, 0x2D6D, 0x64E9, 0x2D69, 0x64EB, 0x2D6B,
- 0x64EC, 0x13DD, 0x64ED, 0x13E0, 0x64EF, 0x2D68, 0x64F0, 0x13DB,
- 0x64F1, 0x13DE, 0x64F2, 0x14D3, 0x64F3, 0x2B57, 0x64F4, 0x14D2,
- 0x64F7, 0x14D8, 0x64F8, 0x2F2B, 0x64FA, 0x14D6, 0x64FB, 0x14D7,
- 0x64FC, 0x2F2E, 0x64FD, 0x2F2A, 0x64FE, 0x14D4, 0x64FF, 0x2F28,
- 0x6500, 0x1582, 0x6501, 0x2F2C, 0x6503, 0x2F2D, 0x6504, 0x2F29,
- 0x6506, 0x14D5, 0x6507, 0x3090, 0x6509, 0x3093, 0x650C, 0x3094,
- 0x650D, 0x3092, 0x650E, 0x3095, 0x650F, 0x1583, 0x6510, 0x3091,
- 0x6513, 0x31D7, 0x6514, 0x1617, 0x6515, 0x31D6, 0x6516, 0x31D5,
- 0x6517, 0x31D4, 0x6518, 0x1616, 0x6519, 0x1618, 0x651B, 0x32D2,
- 0x651C, 0x1673, 0x651D, 0x1672, 0x6520, 0x3382, 0x6521, 0x3381,
- 0x6522, 0x3384, 0x6523, 0x16F9, 0x6524, 0x16C5, 0x6525, 0x341B,
- 0x6526, 0x3383, 0x6529, 0x341A, 0x652A, 0x16FB, 0x652B, 0x16FA,
- 0x652C, 0x1721, 0x652D, 0x3484, 0x652E, 0x34CA, 0x652F, 0x02D5,
- 0x6532, 0x216C, 0x6533, 0x2B59, 0x6534, 0x022C, 0x6536, 0x03D7,
- 0x6537, 0x17F6, 0x6538, 0x04B9, 0x6539, 0x04B7, 0x653B, 0x04B8,
- 0x653D, 0x19A1, 0x653E, 0x05F3, 0x653F, 0x0741, 0x6541, 0x1B01,
- 0x6543, 0x1B02, 0x6545, 0x0742, 0x6546, 0x1CBF, 0x6548, 0x08D6,
- 0x6549, 0x08D7, 0x654A, 0x1CBE, 0x654F, 0x0ABD, 0x6551, 0x0AB9,
- 0x6553, 0x1F0C, 0x6554, 0x0AC0, 0x6555, 0x0ABF, 0x6556, 0x0AB8,
- 0x6557, 0x0ABB, 0x6558, 0x0ABE, 0x6559, 0x0ABA, 0x655C, 0x2170,
- 0x655D, 0x0AB7, 0x655E, 0x0C70, 0x6562, 0x0C72, 0x6563, 0x0C73,
- 0x6564, 0x216F, 0x6565, 0x2172, 0x6566, 0x0C71, 0x6567, 0x216D,
- 0x6568, 0x2171, 0x656A, 0x216E, 0x656C, 0x0E2B, 0x656F, 0x2409,
- 0x6572, 0x0FE7, 0x6573, 0x26B4, 0x6574, 0x12C6, 0x6575, 0x116E,
- 0x6576, 0x28F1, 0x6577, 0x116F, 0x6578, 0x1170, 0x6579, 0x28F3,
- 0x657A, 0x28F2, 0x657B, 0x28F4, 0x657C, 0x2B5B, 0x657F, 0x2B5A,
- 0x6580, 0x2D6F, 0x6581, 0x2D6E, 0x6582, 0x13E1, 0x6583, 0x13E2,
- 0x6584, 0x3096, 0x6587, 0x02D6, 0x658C, 0x2173, 0x6590, 0x0C75,
- 0x6591, 0x0C74, 0x6592, 0x240A, 0x6594, 0x2F2F, 0x6595, 0x1674,
- 0x6596, 0x341C, 0x6597, 0x02D7, 0x6599, 0x08D8, 0x659B, 0x0AC2,
- 0x659C, 0x0AC1, 0x659D, 0x2174, 0x659E, 0x2175, 0x659F, 0x0E2C,
- 0x65A0, 0x26B5, 0x65A1, 0x0FE8, 0x65A2, 0x2B5C, 0x65A4, 0x02D8,
- 0x65A5, 0x0346, 0x65A7, 0x05F4, 0x65A8, 0x19A2, 0x65AA, 0x1B03,
- 0x65AB, 0x0743, 0x65AC, 0x0AC3, 0x65AE, 0x2176, 0x65AF, 0x0C76,
- 0x65B0, 0x0E2D, 0x65B2, 0x28F5, 0x65B3, 0x28F6, 0x65B6, 0x2D70,
- 0x65B7, 0x14D9, 0x65B8, 0x34CB, 0x65B9, 0x02D9, 0x65BB, 0x19A3,
- 0x65BC, 0x05F5, 0x65BD, 0x0744, 0x65BF, 0x1B04, 0x65C1, 0x08D9,
- 0x65C2, 0x1CC3, 0x65C3, 0x1CC1, 0x65C4, 0x1CC2, 0x65C5, 0x08DA,
- 0x65C6, 0x1CC0, 0x65CB, 0x0AC5, 0x65CC, 0x0AC6, 0x65CD, 0x1F0D,
- 0x65CE, 0x0AC7, 0x65CF, 0x0AC4, 0x65D0, 0x2177, 0x65D2, 0x2178,
- 0x65D3, 0x240B, 0x65D6, 0x0FEA, 0x65D7, 0x0FE9, 0x65DA, 0x2D71,
- 0x65DB, 0x2F30, 0x65DD, 0x3098, 0x65DE, 0x3097, 0x65DF, 0x31D8,
- 0x65E0, 0x022D, 0x65E1, 0x1789, 0x65E2, 0x0745, 0x65E5, 0x02DA,
- 0x65E6, 0x0347, 0x65E8, 0x03D9, 0x65E9, 0x03D8, 0x65EC, 0x03DA,
- 0x65ED, 0x03DB, 0x65EE, 0x17F8, 0x65EF, 0x17F7, 0x65F0, 0x189E,
- 0x65F1, 0x04BA, 0x65F2, 0x18A1, 0x65F3, 0x18A0, 0x65F4, 0x189F,
- 0x65F5, 0x18A2, 0x65FA, 0x05F6, 0x65FB, 0x19A9, 0x65FC, 0x19A5,
- 0x65FD, 0x19AE, 0x6600, 0x05FD, 0x6602, 0x05FB, 0x6603, 0x19AA,
- 0x6604, 0x19A6, 0x6605, 0x19AD, 0x6606, 0x05FA, 0x6607, 0x0601,
- 0x6608, 0x19A8, 0x6609, 0x19A4, 0x660A, 0x0600, 0x660B, 0x19AB,
- 0x660C, 0x05F9, 0x660D, 0x19AC, 0x660E, 0x05FC, 0x660F, 0x05FE,
- 0x6610, 0x19B0, 0x6611, 0x19AF, 0x6612, 0x19A7, 0x6613, 0x05F8,
- 0x6614, 0x05F7, 0x6615, 0x05FF, 0x661C, 0x1B09, 0x661D, 0x1B0F,
- 0x661F, 0x074B, 0x6620, 0x0748, 0x6621, 0x1B06, 0x6622, 0x1B0B,
- 0x6624, 0x074E, 0x6625, 0x0746, 0x6626, 0x1B0A, 0x6627, 0x0749,
- 0x6628, 0x074C, 0x662B, 0x1B0D, 0x662D, 0x0747, 0x662E, 0x1B12,
- 0x662F, 0x074A, 0x6631, 0x074D, 0x6632, 0x1B07, 0x6633, 0x1B0C,
- 0x6634, 0x1B10, 0x6635, 0x1B08, 0x6636, 0x1B05, 0x6639, 0x1B11,
- 0x663A, 0x1B0E, 0x6641, 0x08E2, 0x6642, 0x08DB, 0x6643, 0x08DE,
- 0x6645, 0x08E1, 0x6647, 0x1CC6, 0x6649, 0x08DC, 0x664A, 0x1CC4,
- 0x664C, 0x08E0, 0x664F, 0x08DD, 0x6651, 0x1CC7, 0x6652, 0x08DF,
- 0x6659, 0x1F11, 0x665A, 0x0AC9, 0x665B, 0x1F10, 0x665C, 0x1F12,
- 0x665D, 0x0AC8, 0x665E, 0x0ACD, 0x665F, 0x1CC5, 0x6661, 0x1F0F,
- 0x6662, 0x1F13, 0x6664, 0x0ACA, 0x6665, 0x1F0E, 0x6666, 0x0ACC,
- 0x6668, 0x0ACB, 0x666A, 0x217F, 0x666C, 0x217A, 0x666E, 0x0C77,
- 0x666F, 0x0C7B, 0x6670, 0x0C78, 0x6671, 0x217D, 0x6672, 0x2180,
- 0x6674, 0x0C79, 0x6676, 0x0C7A, 0x6677, 0x0C7F, 0x6678, 0x2414,
- 0x6679, 0x217E, 0x667A, 0x0C7D, 0x667B, 0x217B, 0x667C, 0x2179,
- 0x667E, 0x0C7E, 0x6680, 0x217C, 0x6684, 0x0E33, 0x6686, 0x240C,
- 0x6687, 0x0E30, 0x6688, 0x0E31, 0x6689, 0x0E2F, 0x668A, 0x2411,
- 0x668B, 0x2410, 0x668C, 0x240D, 0x668D, 0x0E35, 0x6690, 0x240F,
- 0x6691, 0x0C7C, 0x6694, 0x2413, 0x6695, 0x240E, 0x6696, 0x0E32,
- 0x6697, 0x0E2E, 0x6698, 0x0E34, 0x6699, 0x2412, 0x669D, 0x0FED,
- 0x669F, 0x26B8, 0x66A0, 0x26B7, 0x66A1, 0x26B6, 0x66A2, 0x0FEB,
- 0x66A8, 0x0FEC, 0x66A9, 0x28F9, 0x66AA, 0x28FC, 0x66AB, 0x1172,
- 0x66AE, 0x1171, 0x66AF, 0x28FD, 0x66B0, 0x28F8, 0x66B1, 0x1174,
- 0x66B2, 0x28FA, 0x66B4, 0x1173, 0x66B5, 0x28F7, 0x66B7, 0x28FB,
- 0x66B8, 0x12CC, 0x66B9, 0x12C9, 0x66BA, 0x2B65, 0x66BB, 0x2B64,
- 0x66BD, 0x2B63, 0x66BE, 0x2B5E, 0x66C0, 0x2B5F, 0x66C4, 0x12CA,
- 0x66C6, 0x12C7, 0x66C7, 0x12CB, 0x66C8, 0x2B5D, 0x66C9, 0x12C8,
- 0x66CA, 0x2B60, 0x66CB, 0x2B61, 0x66CC, 0x2B66, 0x66CF, 0x2B62,
- 0x66D2, 0x2D72, 0x66D6, 0x13E4, 0x66D8, 0x2F33, 0x66D9, 0x13E3,
- 0x66DA, 0x2F31, 0x66DB, 0x2F32, 0x66DC, 0x14DA, 0x66DD, 0x1585,
- 0x66DE, 0x3099, 0x66E0, 0x1584, 0x66E3, 0x31DA, 0x66E4, 0x31DB,
- 0x66E6, 0x1619, 0x66E8, 0x31D9, 0x66E9, 0x1675, 0x66EB, 0x341D,
- 0x66EC, 0x16FC, 0x66ED, 0x3485, 0x66EE, 0x3486, 0x66F0, 0x02DB,
- 0x66F2, 0x03DC, 0x66F3, 0x03DD, 0x66F4, 0x04BB, 0x66F6, 0x19B1,
- 0x66F7, 0x074F, 0x66F8, 0x08E3, 0x66F9, 0x0ACE, 0x66FC, 0x0A1F,
- 0x66FE, 0x0C80, 0x66FF, 0x0C81, 0x6700, 0x0BF0, 0x6701, 0x2181,
- 0x6703, 0x0E36, 0x6704, 0x26BA, 0x6705, 0x26B9, 0x6708, 0x02DC,
- 0x6709, 0x03DE, 0x670A, 0x19B2, 0x670B, 0x0603, 0x670D, 0x0602,
- 0x670F, 0x1B13, 0x6710, 0x1B14, 0x6712, 0x1CC8, 0x6713, 0x1CC9,
- 0x6714, 0x08E4, 0x6715, 0x08E5, 0x6717, 0x08E6, 0x6718, 0x1F14,
- 0x671B, 0x0AD0, 0x671D, 0x0C83, 0x671F, 0x0C82, 0x6720, 0x2415,
- 0x6721, 0x2522, 0x6722, 0x26BB, 0x6723, 0x2B67, 0x6726, 0x14DB,
- 0x6727, 0x161A, 0x6728, 0x02DD, 0x672A, 0x034A, 0x672B, 0x034B,
- 0x672C, 0x0349, 0x672D, 0x034C, 0x672E, 0x0348, 0x6731, 0x03E1,
- 0x6733, 0x1800, 0x6734, 0x03E0, 0x6735, 0x03E2, 0x6738, 0x17FB,
- 0x6739, 0x17FA, 0x673A, 0x17FD, 0x673B, 0x17FC, 0x673C, 0x17FF,
- 0x673D, 0x03DF, 0x673E, 0x17F9, 0x673F, 0x17FE, 0x6745, 0x18A3,
- 0x6746, 0x04C5, 0x6747, 0x18A4, 0x6748, 0x18A8, 0x6749, 0x04C4,
- 0x674B, 0x18AC, 0x674C, 0x18A7, 0x674D, 0x18AA, 0x674E, 0x04BD,
- 0x674F, 0x04BE, 0x6750, 0x04BF, 0x6751, 0x04C0, 0x6753, 0x04C7,
- 0x6755, 0x18A6, 0x6756, 0x04C2, 0x6757, 0x04C8, 0x6759, 0x18A5,
- 0x675A, 0x18AB, 0x675C, 0x04C1, 0x675D, 0x18A9, 0x675E, 0x04C3,
- 0x675F, 0x04BC, 0x6760, 0x04C6, 0x676A, 0x0618, 0x676C, 0x19B4,
- 0x676D, 0x0604, 0x676F, 0x060E, 0x6770, 0x060F, 0x6771, 0x0607,
- 0x6772, 0x0619, 0x6773, 0x0609, 0x6774, 0x19BC, 0x6775, 0x0614,
- 0x6776, 0x19B7, 0x6777, 0x060A, 0x6778, 0x19C6, 0x6779, 0x19C7,
- 0x677A, 0x19BF, 0x677B, 0x19B8, 0x677C, 0x0617, 0x677D, 0x19C4,
- 0x677E, 0x0612, 0x677F, 0x0610, 0x6781, 0x19C5, 0x6783, 0x19C3,
- 0x6784, 0x19BB, 0x6785, 0x19B3, 0x6786, 0x19BA, 0x6787, 0x060B,
- 0x6789, 0x0611, 0x678B, 0x0605, 0x678C, 0x19BE, 0x678D, 0x19BD,
- 0x678E, 0x19B5, 0x6790, 0x0613, 0x6791, 0x19C1, 0x6792, 0x19B6,
- 0x6793, 0x0616, 0x6794, 0x19C8, 0x6795, 0x0606, 0x6797, 0x060D,
- 0x6798, 0x19B9, 0x6799, 0x19C2, 0x679A, 0x0615, 0x679C, 0x0608,
- 0x679D, 0x060C, 0x679F, 0x19C0, 0x67AE, 0x1B34, 0x67AF, 0x0757,
- 0x67B0, 0x0764, 0x67B2, 0x1B2F, 0x67B3, 0x1B25, 0x67B4, 0x075D,
- 0x67B5, 0x1B23, 0x67B6, 0x0756, 0x67B7, 0x1B1E, 0x67B8, 0x0760,
- 0x67B9, 0x1B2B, 0x67BA, 0x1B18, 0x67BB, 0x1B1A, 0x67C0, 0x1B1D,
- 0x67C1, 0x1B15, 0x67C2, 0x1B2A, 0x67C3, 0x1B3A, 0x67C4, 0x075B,
- 0x67C5, 0x1B1F, 0x67C6, 0x1B31, 0x67C8, 0x1B17, 0x67C9, 0x1B38,
- 0x67CA, 0x1B39, 0x67CB, 0x1B3C, 0x67CC, 0x1B33, 0x67CD, 0x1B24,
- 0x67CE, 0x1B2C, 0x67CF, 0x0761, 0x67D0, 0x0754, 0x67D1, 0x075C,
- 0x67D2, 0x0768, 0x67D3, 0x0751, 0x67D4, 0x0753, 0x67D8, 0x1B1C,
- 0x67D9, 0x0765, 0x67DA, 0x075E, 0x67DB, 0x1B36, 0x67DC, 0x1B19,
- 0x67DD, 0x0767, 0x67DE, 0x0762, 0x67DF, 0x1B22, 0x67E2, 0x0766,
- 0x67E3, 0x1B29, 0x67E4, 0x1B21, 0x67E5, 0x075F, 0x67E6, 0x1B35,
- 0x67E7, 0x1B2D, 0x67E9, 0x0759, 0x67EA, 0x1B3B, 0x67EB, 0x1B20,
- 0x67EC, 0x0755, 0x67ED, 0x1B32, 0x67EE, 0x1B28, 0x67EF, 0x075A,
- 0x67F0, 0x1B2E, 0x67F1, 0x0752, 0x67F2, 0x1B16, 0x67F3, 0x0763,
- 0x67F4, 0x08F5, 0x67F5, 0x0758, 0x67F6, 0x1B27, 0x67F7, 0x1B26,
- 0x67F8, 0x1B1B, 0x67FA, 0x1B37, 0x67FC, 0x1B30, 0x67FF, 0x0750,
- 0x6812, 0x1CDD, 0x6813, 0x08FC, 0x6814, 0x1CDE, 0x6816, 0x1CD2,
- 0x6817, 0x08F1, 0x6818, 0x08FD, 0x681A, 0x1CCB, 0x681C, 0x1CD4,
- 0x681D, 0x1CDC, 0x681F, 0x1CCA, 0x6820, 0x1CE5, 0x6821, 0x08E7,
- 0x6825, 0x1CE4, 0x6826, 0x1CDF, 0x6828, 0x1CE0, 0x6829, 0x08EF,
- 0x682A, 0x08FA, 0x682B, 0x1CD6, 0x682D, 0x1CD7, 0x682E, 0x1CE1,
- 0x682F, 0x1CD8, 0x6831, 0x1CD3, 0x6832, 0x1CCD, 0x6833, 0x1CCE,
- 0x6834, 0x1CDB, 0x6835, 0x1CD5, 0x6838, 0x08E8, 0x6839, 0x08EC,
- 0x683A, 0x1CE3, 0x683B, 0x1CCF, 0x683C, 0x08F8, 0x683D, 0x08F4,
- 0x6840, 0x08F7, 0x6841, 0x08FE, 0x6842, 0x08ED, 0x6843, 0x08F9,
- 0x6844, 0x1CDA, 0x6845, 0x08FB, 0x6846, 0x08EA, 0x6848, 0x08E9,
- 0x6849, 0x1CCC, 0x684B, 0x1CD0, 0x684C, 0x08F2, 0x684D, 0x1CE2,
- 0x684E, 0x1CD9, 0x684F, 0x1CD1, 0x6850, 0x08F6, 0x6851, 0x08F3,
- 0x6853, 0x08EB, 0x6854, 0x08EE, 0x686B, 0x1F29, 0x686D, 0x1F19,
- 0x686E, 0x1F1A, 0x686F, 0x1F1E, 0x6871, 0x1F2D, 0x6872, 0x1F2A,
- 0x6874, 0x1F23, 0x6875, 0x1F22, 0x6876, 0x0AD7, 0x6877, 0x1F26,
- 0x6878, 0x1F35, 0x6879, 0x1F15, 0x687B, 0x1F36, 0x687C, 0x1F28,
- 0x687D, 0x1F3A, 0x687E, 0x1F2E, 0x687F, 0x0AD6, 0x6880, 0x1F2C,
- 0x6881, 0x0AD1, 0x6882, 0x0AE6, 0x6883, 0x0ADC, 0x6885, 0x0AE0,
- 0x6886, 0x0ADF, 0x6887, 0x1F16, 0x6889, 0x1F33, 0x688A, 0x1F39,
- 0x688B, 0x1F31, 0x688C, 0x1F38, 0x688F, 0x1F25, 0x6890, 0x1F17,
- 0x6891, 0x1F37, 0x6892, 0x1F27, 0x6893, 0x0AD4, 0x6894, 0x0AE1,
- 0x6896, 0x1F30, 0x6897, 0x0ADA, 0x689B, 0x1F2F, 0x689C, 0x1F18,
- 0x689D, 0x0AE2, 0x689F, 0x0AE4, 0x68A0, 0x1F32, 0x68A1, 0x0AE5,
- 0x68A2, 0x0AD3, 0x68A3, 0x1F1F, 0x68A4, 0x1F34, 0x68A7, 0x0AD9,
- 0x68A8, 0x0AE3, 0x68A9, 0x1F21, 0x68AA, 0x1F2B, 0x68AB, 0x1F1C,
- 0x68AC, 0x1F20, 0x68AD, 0x0ADE, 0x68AE, 0x1F1B, 0x68AF, 0x0AD2,
- 0x68B0, 0x0ADB, 0x68B1, 0x0AD8, 0x68B2, 0x1F24, 0x68B3, 0x08F0,
- 0x68B4, 0x2198, 0x68B5, 0x0AD5, 0x68C4, 0x0ADD, 0x68C6, 0x219B,
- 0x68C7, 0x21B1, 0x68C8, 0x21A6, 0x68C9, 0x0C97, 0x68CB, 0x0C92,
- 0x68CC, 0x2195, 0x68CD, 0x0C93, 0x68CE, 0x21A5, 0x68D0, 0x219E,
- 0x68D1, 0x21AB, 0x68D2, 0x0C8F, 0x68D3, 0x2183, 0x68D4, 0x21AD,
- 0x68D5, 0x0C85, 0x68D6, 0x218B, 0x68D7, 0x0C88, 0x68D8, 0x0C87,
- 0x68DA, 0x0C98, 0x68DC, 0x2185, 0x68DD, 0x21A7, 0x68DE, 0x21A8,
- 0x68DF, 0x0C8A, 0x68E0, 0x0C86, 0x68E1, 0x2193, 0x68E3, 0x0C91,
- 0x68E4, 0x218E, 0x68E6, 0x21A9, 0x68E7, 0x0C8D, 0x68E8, 0x21A1,
- 0x68E9, 0x21AE, 0x68EA, 0x2188, 0x68EB, 0x218D, 0x68EC, 0x2187,
- 0x68EE, 0x0C8C, 0x68EF, 0x219A, 0x68F0, 0x242B, 0x68F1, 0x2189,
- 0x68F2, 0x0C90, 0x68F3, 0x2192, 0x68F4, 0x21AA, 0x68F5, 0x0C8B,
- 0x68F6, 0x218F, 0x68F7, 0x218C, 0x68F8, 0x219D, 0x68F9, 0x0C8E,
- 0x68FA, 0x0C84, 0x68FB, 0x0C9A, 0x68FC, 0x21A0, 0x68FD, 0x219F,
- 0x6904, 0x2184, 0x6905, 0x0C89, 0x6906, 0x21AC, 0x6907, 0x2194,
- 0x6908, 0x2196, 0x690A, 0x21A3, 0x690B, 0x21A2, 0x690C, 0x2182,
- 0x690D, 0x0C94, 0x690E, 0x0C96, 0x690F, 0x218A, 0x6910, 0x2191,
- 0x6911, 0x2199, 0x6912, 0x0C95, 0x6913, 0x2190, 0x6914, 0x219C,
- 0x6915, 0x21AF, 0x6917, 0x21A4, 0x6925, 0x21B0, 0x692A, 0x2186,
- 0x692F, 0x243F, 0x6930, 0x0E3E, 0x6932, 0x243D, 0x6933, 0x2428,
- 0x6934, 0x242D, 0x6935, 0x2426, 0x6937, 0x2439, 0x6938, 0x2418,
- 0x6939, 0x241F, 0x693B, 0x2437, 0x693C, 0x2441, 0x693D, 0x2429,
- 0x693F, 0x241C, 0x6940, 0x242F, 0x6941, 0x2434, 0x6942, 0x2420,
- 0x6944, 0x2431, 0x6945, 0x241D, 0x6948, 0x2424, 0x6949, 0x2425,
- 0x694A, 0x0E40, 0x694B, 0x2438, 0x694C, 0x2436, 0x694E, 0x2419,
- 0x694F, 0x243B, 0x6951, 0x243C, 0x6952, 0x243E, 0x6953, 0x0E44,
- 0x6954, 0x0E3C, 0x6956, 0x1F1D, 0x6957, 0x2421, 0x6958, 0x2433,
- 0x6959, 0x2422, 0x695A, 0x0E39, 0x695B, 0x0E49, 0x695C, 0x243A,
- 0x695D, 0x0E47, 0x695E, 0x0E43, 0x695F, 0x2417, 0x6960, 0x0E3B,
- 0x6962, 0x241A, 0x6963, 0x0E48, 0x6965, 0x242A, 0x6966, 0x2416,
- 0x6968, 0x0E41, 0x6969, 0x242E, 0x696A, 0x241E, 0x696B, 0x0E42,
- 0x696C, 0x2427, 0x696D, 0x0E38, 0x696E, 0x0C99, 0x696F, 0x2430,
- 0x6970, 0x2197, 0x6971, 0x241B, 0x6974, 0x2435, 0x6975, 0x0E3D,
- 0x6976, 0x2432, 0x6977, 0x0E3A, 0x6978, 0x242C, 0x6979, 0x0E45,
- 0x697A, 0x2423, 0x697B, 0x2440, 0x6982, 0x0E3F, 0x6983, 0x24AF,
- 0x6986, 0x0E46, 0x698D, 0x26C9, 0x698E, 0x26C7, 0x6990, 0x26DD,
- 0x6991, 0x26C5, 0x6993, 0x26D7, 0x6994, 0x0E37, 0x6995, 0x0FF0,
- 0x6996, 0x26C1, 0x6997, 0x26DC, 0x6999, 0x26C6, 0x699A, 0x26D4,
- 0x699B, 0x0FF5, 0x699C, 0x0FEE, 0x699E, 0x26DA, 0x69A0, 0x26BF,
- 0x69A1, 0x26D9, 0x69A3, 0x1000, 0x69A4, 0x26D0, 0x69A5, 0x26E0,
- 0x69A6, 0x0FFE, 0x69A7, 0x26C8, 0x69A8, 0x0FEF, 0x69A9, 0x26CA,
- 0x69AA, 0x26D8, 0x69AB, 0x0FF8, 0x69AC, 0x26C3, 0x69AD, 0x0FFC,
- 0x69AE, 0x0FF2, 0x69AF, 0x26CC, 0x69B0, 0x26C2, 0x69B1, 0x26BC,
- 0x69B3, 0x26D6, 0x69B4, 0x0FF9, 0x69B5, 0x26DF, 0x69B6, 0x26BD,
- 0x69B7, 0x0FF6, 0x69B9, 0x26D2, 0x69BB, 0x0FF7, 0x69BC, 0x26C4,
- 0x69BD, 0x26CF, 0x69BE, 0x26CB, 0x69BF, 0x26CD, 0x69C1, 0x0FF1,
- 0x69C2, 0x26DE, 0x69C3, 0x0FFF, 0x69C4, 0x26CE, 0x69C6, 0x26E1,
- 0x69C9, 0x26BE, 0x69CA, 0x26D3, 0x69CB, 0x0FF4, 0x69CC, 0x0FFD,
- 0x69CD, 0x0FFB, 0x69CE, 0x26C0, 0x69CF, 0x26D5, 0x69D0, 0x0FFA,
- 0x69D3, 0x0FF3, 0x69D4, 0x26D1, 0x69D9, 0x26DB, 0x69E2, 0x2909,
- 0x69E4, 0x2905, 0x69E5, 0x2901, 0x69E6, 0x2915, 0x69E7, 0x2912,
- 0x69E8, 0x1177, 0x69EB, 0x2919, 0x69EC, 0x2908, 0x69ED, 0x1182,
- 0x69EE, 0x290F, 0x69F1, 0x2904, 0x69F2, 0x290E, 0x69F3, 0x117F,
- 0x69F4, 0x2922, 0x69F6, 0x291F, 0x69F7, 0x2911, 0x69F8, 0x2902,
- 0x69FB, 0x2916, 0x69FC, 0x2918, 0x69FD, 0x117B, 0x69FE, 0x290C,
- 0x69FF, 0x2907, 0x6A00, 0x28FE, 0x6A01, 0x1178, 0x6A02, 0x1180,
- 0x6A04, 0x291B, 0x6A05, 0x1181, 0x6A06, 0x28FF, 0x6A07, 0x2921,
- 0x6A08, 0x2914, 0x6A09, 0x291A, 0x6A0A, 0x117E, 0x6A0D, 0x2917,
- 0x6A0F, 0x291E, 0x6A11, 0x1183, 0x6A13, 0x117D, 0x6A14, 0x2910,
- 0x6A15, 0x2903, 0x6A16, 0x2923, 0x6A17, 0x2900, 0x6A18, 0x291C,
- 0x6A19, 0x117A, 0x6A1B, 0x290A, 0x6A1D, 0x290B, 0x6A1E, 0x1179,
- 0x6A1F, 0x1176, 0x6A20, 0x2906, 0x6A21, 0x117C, 0x6A23, 0x1175,
- 0x6A25, 0x291D, 0x6A26, 0x2920, 0x6A27, 0x290D, 0x6A28, 0x2B74,
- 0x6A32, 0x2B6C, 0x6A34, 0x2B68, 0x6A35, 0x12D9, 0x6A38, 0x12CE,
- 0x6A39, 0x12D3, 0x6A3A, 0x12CF, 0x6A3B, 0x2B76, 0x6A3C, 0x2B81,
- 0x6A3D, 0x12CD, 0x6A3E, 0x2B6E, 0x6A3F, 0x2B77, 0x6A40, 0x2913,
- 0x6A41, 0x2B78, 0x6A44, 0x12D4, 0x6A46, 0x2B87, 0x6A47, 0x12D8,
- 0x6A48, 0x12DB, 0x6A49, 0x2B6A, 0x6A4B, 0x12D7, 0x6A4D, 0x2B85,
- 0x6A4E, 0x2B86, 0x6A4F, 0x2B7C, 0x6A50, 0x2B7B, 0x6A51, 0x2B73,
- 0x6A54, 0x2B7D, 0x6A55, 0x2B84, 0x6A56, 0x2B83, 0x6A58, 0x12D2,
- 0x6A59, 0x12D0, 0x6A5A, 0x2B75, 0x6A5B, 0x2B72, 0x6A5D, 0x2B6F,
- 0x6A5E, 0x2B82, 0x6A5F, 0x12DA, 0x6A60, 0x2B80, 0x6A61, 0x12D6,
- 0x6A62, 0x12D5, 0x6A64, 0x2B7A, 0x6A66, 0x2B69, 0x6A67, 0x2B6B,
- 0x6A68, 0x2B6D, 0x6A69, 0x2B7F, 0x6A6A, 0x2B79, 0x6A6B, 0x12D1,
- 0x6A6D, 0x2B70, 0x6A6F, 0x2B7E, 0x6A76, 0x2B71, 0x6A7E, 0x13EC,
- 0x6A7F, 0x2D84, 0x6A80, 0x13E5, 0x6A81, 0x2D75, 0x6A83, 0x2D80,
- 0x6A84, 0x13E7, 0x6A85, 0x2D87, 0x6A87, 0x2D7C, 0x6A89, 0x2D77,
- 0x6A8C, 0x2D88, 0x6A8D, 0x2D73, 0x6A8E, 0x2D7E, 0x6A90, 0x13EE,
- 0x6A91, 0x2D83, 0x6A92, 0x2D89, 0x6A93, 0x2D7D, 0x6A94, 0x13E6,
- 0x6A95, 0x2D7F, 0x6A96, 0x2D74, 0x6A97, 0x13ED, 0x6A9A, 0x2D86,
- 0x6A9B, 0x2D79, 0x6A9C, 0x13E9, 0x6A9E, 0x2D7B, 0x6A9F, 0x2D78,
- 0x6AA0, 0x13EF, 0x6AA1, 0x2D7A, 0x6AA2, 0x13E8, 0x6AA3, 0x13EB,
- 0x6AA4, 0x2D82, 0x6AA5, 0x2D76, 0x6AA6, 0x2D85, 0x6AA8, 0x2D81,
- 0x6AAC, 0x14DD, 0x6AAD, 0x2F3E, 0x6AAE, 0x14E2, 0x6AAF, 0x14E3,
- 0x6AB3, 0x14DC, 0x6AB4, 0x2F3D, 0x6AB6, 0x2F3A, 0x6AB7, 0x2F3B,
- 0x6AB8, 0x14E0, 0x6AB9, 0x2F35, 0x6ABA, 0x2F39, 0x6ABB, 0x14DF,
- 0x6ABD, 0x2F36, 0x6AC2, 0x14E1, 0x6AC3, 0x14DE, 0x6AC5, 0x2F34,
- 0x6AC6, 0x2F38, 0x6AC7, 0x2F3C, 0x6ACB, 0x309F, 0x6ACC, 0x309C,
- 0x6ACD, 0x30A5, 0x6ACF, 0x30A4, 0x6AD0, 0x30A2, 0x6AD1, 0x309D,
- 0x6AD3, 0x1589, 0x6AD9, 0x309E, 0x6ADA, 0x1588, 0x6ADB, 0x13EA,
- 0x6ADC, 0x30A1, 0x6ADD, 0x1587, 0x6ADE, 0x30A6, 0x6ADF, 0x30A0,
- 0x6AE0, 0x309B, 0x6AE1, 0x2F37, 0x6AE5, 0x1586, 0x6AE7, 0x309A,
- 0x6AE8, 0x31DF, 0x6AEA, 0x31DE, 0x6AEB, 0x30A3, 0x6AEC, 0x161B,
- 0x6AEE, 0x31E2, 0x6AEF, 0x31E3, 0x6AF0, 0x31DD, 0x6AF1, 0x31E1,
- 0x6AF3, 0x31DC, 0x6AF8, 0x32D6, 0x6AF9, 0x31E0, 0x6AFA, 0x1678,
- 0x6AFB, 0x1676, 0x6AFC, 0x32D4, 0x6B00, 0x32D7, 0x6B02, 0x32D3,
- 0x6B03, 0x32D5, 0x6B04, 0x1677, 0x6B08, 0x3386, 0x6B09, 0x3387,
- 0x6B0A, 0x16C6, 0x6B0B, 0x3385, 0x6B0F, 0x3420, 0x6B10, 0x16FD,
- 0x6B11, 0x341E, 0x6B12, 0x341F, 0x6B13, 0x3487, 0x6B16, 0x1743,
- 0x6B17, 0x34CE, 0x6B18, 0x34CC, 0x6B19, 0x34CD, 0x6B1A, 0x34CF,
- 0x6B1E, 0x3534, 0x6B20, 0x02DE, 0x6B21, 0x03E3, 0x6B23, 0x061A,
- 0x6B25, 0x19C9, 0x6B28, 0x1B3D, 0x6B2C, 0x1CE6, 0x6B2D, 0x1CE8,
- 0x6B2F, 0x1CE7, 0x6B31, 0x1CE9, 0x6B32, 0x0AE7, 0x6B33, 0x1F3C,
- 0x6B34, 0x1CEA, 0x6B36, 0x1F3B, 0x6B37, 0x1F3D, 0x6B38, 0x1F3E,
- 0x6B39, 0x21B2, 0x6B3A, 0x0C9C, 0x6B3B, 0x21B3, 0x6B3C, 0x21B5,
- 0x6B3D, 0x0C9D, 0x6B3E, 0x0C9B, 0x6B3F, 0x21B4, 0x6B41, 0x2447,
- 0x6B42, 0x2445, 0x6B43, 0x2444, 0x6B45, 0x2443, 0x6B46, 0x2442,
- 0x6B47, 0x0E4A, 0x6B48, 0x2446, 0x6B49, 0x1001, 0x6B4A, 0x26E2,
- 0x6B4B, 0x26E4, 0x6B4C, 0x1002, 0x6B4D, 0x26E3, 0x6B4E, 0x1185,
- 0x6B50, 0x1184, 0x6B51, 0x2924, 0x6B54, 0x2B89, 0x6B55, 0x2B88,
- 0x6B56, 0x2B8A, 0x6B59, 0x12DC, 0x6B5B, 0x2D8A, 0x6B5C, 0x13F0,
- 0x6B5E, 0x2F3F, 0x6B5F, 0x14E4, 0x6B60, 0x30A7, 0x6B61, 0x16C7,
- 0x6B62, 0x02DF, 0x6B63, 0x034D, 0x6B64, 0x03E4, 0x6B65, 0x04C9,
- 0x6B66, 0x061B, 0x6B67, 0x061C, 0x6B6A, 0x0769, 0x6B6D, 0x1CEB,
- 0x6B72, 0x0E4B, 0x6B76, 0x29A2, 0x6B77, 0x12DD, 0x6B78, 0x14E5,
- 0x6B79, 0x02E0, 0x6B7B, 0x03E5, 0x6B7E, 0x19CB, 0x6B7F, 0x061D,
- 0x6B80, 0x19CA, 0x6B82, 0x1B3E, 0x6B83, 0x076A, 0x6B84, 0x1B3F,
- 0x6B86, 0x076B, 0x6B88, 0x1CED, 0x6B89, 0x0900, 0x6B8A, 0x08FF,
- 0x6B8C, 0x1F43, 0x6B8D, 0x1F41, 0x6B8E, 0x1F42, 0x6B8F, 0x1F40,
- 0x6B91, 0x1F3F, 0x6B94, 0x21B6, 0x6B95, 0x21B9, 0x6B96, 0x0C9F,
- 0x6B97, 0x21B7, 0x6B98, 0x0C9E, 0x6B99, 0x21B8, 0x6B9B, 0x2448,
- 0x6B9E, 0x26E5, 0x6B9F, 0x26E6, 0x6BA0, 0x26E7, 0x6BA2, 0x2927,
- 0x6BA3, 0x2926, 0x6BA4, 0x1186, 0x6BA5, 0x2925, 0x6BA6, 0x2928,
- 0x6BA7, 0x2B8B, 0x6BAA, 0x2B8C, 0x6BAB, 0x2B8D, 0x6BAD, 0x2D8B,
- 0x6BAE, 0x13F1, 0x6BAF, 0x14E6, 0x6BB0, 0x30A8, 0x6BB2, 0x1679,
- 0x6BB3, 0x178A, 0x6BB5, 0x076C, 0x6BB6, 0x1B40, 0x6BB7, 0x0901,
- 0x6BBA, 0x0AE8, 0x6BBC, 0x0CA0, 0x6BBD, 0x21BA, 0x6BBF, 0x0E4D,
- 0x6BC0, 0x0E4C, 0x6BC3, 0x26E8, 0x6BC4, 0x26E9, 0x6BC5, 0x1187,
- 0x6BC6, 0x1188, 0x6BC7, 0x2B8F, 0x6BC8, 0x2B8E, 0x6BC9, 0x2F40,
- 0x6BCA, 0x3421, 0x6BCB, 0x02E1, 0x6BCC, 0x178B, 0x6BCD, 0x034E,
- 0x6BCF, 0x04CA, 0x6BD0, 0x18AD, 0x6BD2, 0x076D, 0x6BD3, 0x0E4E,
- 0x6BD4, 0x02E2, 0x6BD6, 0x1B41, 0x6BD7, 0x076E, 0x6BD8, 0x1B42,
- 0x6BDA, 0x13F2, 0x6BDB, 0x02E3, 0x6BDE, 0x19CC, 0x6BE0, 0x1B43,
- 0x6BE2, 0x1CF2, 0x6BE3, 0x1CF1, 0x6BE4, 0x1CEF, 0x6BE6, 0x1CEE,
- 0x6BE7, 0x1CF3, 0x6BE8, 0x1CF0, 0x6BEB, 0x0AE9, 0x6BEC, 0x0AEA,
- 0x6BEF, 0x0CA1, 0x6BF0, 0x21BB, 0x6BF2, 0x21BC, 0x6BF3, 0x21BD,
- 0x6BF7, 0x244C, 0x6BF8, 0x244D, 0x6BF9, 0x244B, 0x6BFB, 0x2449,
- 0x6BFC, 0x244A, 0x6BFD, 0x0E4F, 0x6BFE, 0x26EA, 0x6BFF, 0x292B,
- 0x6C00, 0x292A, 0x6C01, 0x2929, 0x6C02, 0x292C, 0x6C03, 0x2B91,
- 0x6C04, 0x2B90, 0x6C05, 0x12DE, 0x6C06, 0x2B92, 0x6C08, 0x13F3,
- 0x6C09, 0x2D8C, 0x6C0B, 0x2F41, 0x6C0C, 0x30A9, 0x6C0D, 0x3388,
- 0x6C0F, 0x02E4, 0x6C10, 0x0350, 0x6C11, 0x034F, 0x6C13, 0x061E,
- 0x6C14, 0x178C, 0x6C15, 0x17AA, 0x6C16, 0x03E6, 0x6C18, 0x1801,
- 0x6C19, 0x18AE, 0x6C1A, 0x18AF, 0x6C1B, 0x061F, 0x6C1D, 0x19CD,
- 0x6C1F, 0x076F, 0x6C20, 0x1B44, 0x6C21, 0x1B45, 0x6C23, 0x0902,
- 0x6C24, 0x0906, 0x6C25, 0x1CF4, 0x6C26, 0x0905, 0x6C27, 0x0903,
- 0x6C28, 0x0904, 0x6C2A, 0x1F44, 0x6C2B, 0x0AEB, 0x6C2C, 0x0CA4,
- 0x6C2E, 0x0CA2, 0x6C2F, 0x0CA3, 0x6C30, 0x21BE, 0x6C33, 0x1003,
- 0x6C34, 0x02E5, 0x6C36, 0x17AB, 0x6C38, 0x0351, 0x6C3B, 0x17AE,
- 0x6C3E, 0x0354, 0x6C3F, 0x17AD, 0x6C40, 0x0353, 0x6C41, 0x0352,
- 0x6C42, 0x04CB, 0x6C43, 0x17AC, 0x6C46, 0x1802, 0x6C4A, 0x1806,
- 0x6C4B, 0x1808, 0x6C4C, 0x1809, 0x6C4D, 0x03F0, 0x6C4E, 0x03F1,
- 0x6C4F, 0x1805, 0x6C50, 0x03EC, 0x6C52, 0x1803, 0x6C54, 0x1807,
- 0x6C55, 0x03ED, 0x6C57, 0x03E8, 0x6C59, 0x03E9, 0x6C5B, 0x03EF,
- 0x6C5C, 0x1804, 0x6C5D, 0x03E7, 0x6C5E, 0x04CC, 0x6C5F, 0x03EA,
- 0x6C60, 0x03EB, 0x6C61, 0x03EE, 0x6C65, 0x18C0, 0x6C66, 0x18BE,
- 0x6C67, 0x18B1, 0x6C68, 0x04D8, 0x6C69, 0x18B8, 0x6C6A, 0x04D3,
- 0x6C6B, 0x18B2, 0x6C6D, 0x18BA, 0x6C6F, 0x18B7, 0x6C70, 0x04D6,
- 0x6C71, 0x18B6, 0x6C72, 0x04DD, 0x6C73, 0x18BF, 0x6C74, 0x04DF,
- 0x6C76, 0x04E1, 0x6C78, 0x18B0, 0x6C7A, 0x04D4, 0x6C7B, 0x18C1,
- 0x6C7D, 0x04DB, 0x6C7E, 0x04DE, 0x6C80, 0x19E4, 0x6C81, 0x04CE,
- 0x6C82, 0x04E5, 0x6C83, 0x04DC, 0x6C84, 0x18B3, 0x6C85, 0x04D1,
- 0x6C86, 0x04E0, 0x6C87, 0x18BB, 0x6C88, 0x04CF, 0x6C89, 0x04D0,
- 0x6C8A, 0x19E2, 0x6C8B, 0x18B4, 0x6C8C, 0x04D7, 0x6C8D, 0x04E2,
- 0x6C8E, 0x18C2, 0x6C8F, 0x18B5, 0x6C90, 0x04D5, 0x6C92, 0x04DA,
- 0x6C93, 0x19CE, 0x6C94, 0x04E3, 0x6C95, 0x18BC, 0x6C96, 0x04D9,
- 0x6C98, 0x04E4, 0x6C99, 0x04CD, 0x6C9A, 0x18B9, 0x6C9B, 0x04D2,
- 0x6C9C, 0x18BD, 0x6C9D, 0x19E3, 0x6CAB, 0x062B, 0x6CAC, 0x063B,
- 0x6CAD, 0x19D5, 0x6CAE, 0x0632, 0x6CB0, 0x19EA, 0x6CB1, 0x0623,
- 0x6CB3, 0x0626, 0x6CB4, 0x19E1, 0x6CB6, 0x19D3, 0x6CB7, 0x19D7,
- 0x6CB8, 0x062E, 0x6CB9, 0x0630, 0x6CBA, 0x19DA, 0x6CBB, 0x0637,
- 0x6CBC, 0x0629, 0x6CBD, 0x0627, 0x6CBE, 0x0628, 0x6CBF, 0x0636,
- 0x6CC0, 0x19E6, 0x6CC1, 0x0631, 0x6CC2, 0x19D9, 0x6CC3, 0x19DB,
- 0x6CC4, 0x062F, 0x6CC5, 0x0634, 0x6CC6, 0x19DC, 0x6CC7, 0x19E9,
- 0x6CC9, 0x0770, 0x6CCA, 0x063A, 0x6CCC, 0x0624, 0x6CCD, 0x19E8,
- 0x6CCF, 0x19EC, 0x6CD0, 0x19D8, 0x6CD1, 0x19EE, 0x6CD2, 0x19DF,
- 0x6CD3, 0x062D, 0x6CD4, 0x19D4, 0x6CD5, 0x062C, 0x6CD6, 0x063E,
- 0x6CD7, 0x0633, 0x6CD9, 0x19D2, 0x6CDA, 0x1B4E, 0x6CDB, 0x0639,
- 0x6CDC, 0x063D, 0x6CDD, 0x19E0, 0x6CDE, 0x19E5, 0x6CE0, 0x063F,
- 0x6CE1, 0x0638, 0x6CE2, 0x062A, 0x6CE3, 0x0620, 0x6CE5, 0x0625,
- 0x6CE7, 0x19D6, 0x6CE8, 0x0621, 0x6CE9, 0x19ED, 0x6CEB, 0x19D0,
- 0x6CEC, 0x19CF, 0x6CED, 0x19DD, 0x6CEE, 0x19D1, 0x6CEF, 0x063C,
- 0x6CF0, 0x0907, 0x6CF1, 0x0635, 0x6CF2, 0x19DE, 0x6CF3, 0x0622,
- 0x6CF5, 0x077F, 0x6CF9, 0x19EB, 0x6D00, 0x1B55, 0x6D01, 0x1B58,
- 0x6D03, 0x1B5B, 0x6D04, 0x1B50, 0x6D07, 0x1B5E, 0x6D08, 0x1B61,
- 0x6D09, 0x1B63, 0x6D0A, 0x1B4D, 0x6D0B, 0x0771, 0x6D0C, 0x0776,
- 0x6D0D, 0x1CF9, 0x6D0E, 0x0786, 0x6D0F, 0x1B5C, 0x6D10, 0x1B64,
- 0x6D11, 0x1B54, 0x6D12, 0x1B4C, 0x6D16, 0x1D14, 0x6D17, 0x0779,
- 0x6D18, 0x1B59, 0x6D19, 0x1B51, 0x6D1A, 0x1B53, 0x6D1B, 0x077E,
- 0x6D1D, 0x1B56, 0x6D1E, 0x0778, 0x6D1F, 0x1B49, 0x6D20, 0x1B5F,
- 0x6D22, 0x1B62, 0x6D25, 0x0775, 0x6D27, 0x0781, 0x6D28, 0x1B46,
- 0x6D29, 0x0783, 0x6D2A, 0x0773, 0x6D2B, 0x0787, 0x6D2C, 0x1B60,
- 0x6D2D, 0x1B48, 0x6D2E, 0x0784, 0x6D2F, 0x1D0E, 0x6D30, 0x19E7,
- 0x6D31, 0x0777, 0x6D32, 0x0772, 0x6D33, 0x1B4F, 0x6D34, 0x1B47,
- 0x6D35, 0x0785, 0x6D36, 0x077D, 0x6D37, 0x1B5A, 0x6D38, 0x0782,
- 0x6D39, 0x0780, 0x6D3A, 0x1B52, 0x6D3B, 0x077A, 0x6D3C, 0x1B4A,
- 0x6D3D, 0x077B, 0x6D3E, 0x077C, 0x6D3F, 0x1B4B, 0x6D40, 0x1B5D,
- 0x6D41, 0x0774, 0x6D42, 0x1B57, 0x6D58, 0x1CFC, 0x6D59, 0x090F,
- 0x6D5A, 0x0914, 0x6D5E, 0x1D05, 0x6D5F, 0x1D0B, 0x6D60, 0x1D07,
- 0x6D61, 0x1CFA, 0x6D62, 0x1CFD, 0x6D63, 0x1CF6, 0x6D64, 0x1CF7,
- 0x6D65, 0x091B, 0x6D66, 0x090C, 0x6D67, 0x1D06, 0x6D68, 0x1D0F,
- 0x6D69, 0x0916, 0x6D6A, 0x0908, 0x6D6C, 0x0911, 0x6D6D, 0x1CFE,
- 0x6D6E, 0x0913, 0x6D6F, 0x1CFF, 0x6D70, 0x1D09, 0x6D74, 0x0915,
- 0x6D75, 0x1D18, 0x6D76, 0x1CF8, 0x6D77, 0x090E, 0x6D78, 0x090D,
- 0x6D79, 0x0919, 0x6D7A, 0x1CF5, 0x6D7B, 0x1D16, 0x6D7C, 0x1D0A,
- 0x6D7D, 0x1D17, 0x6D7E, 0x1D11, 0x6D7F, 0x1D03, 0x6D80, 0x1D12,
- 0x6D82, 0x1D0C, 0x6D83, 0x1D15, 0x6D84, 0x1D13, 0x6D85, 0x091A,
- 0x6D86, 0x1D04, 0x6D87, 0x090B, 0x6D88, 0x090A, 0x6D89, 0x0912,
- 0x6D8A, 0x0918, 0x6D8B, 0x1D10, 0x6D8C, 0x0917, 0x6D8D, 0x1D01,
- 0x6D8E, 0x0AEC, 0x6D90, 0x1D19, 0x6D91, 0x1D00, 0x6D92, 0x1CFB,
- 0x6D93, 0x0910, 0x6D94, 0x091C, 0x6D95, 0x0909, 0x6D97, 0x1D08,
- 0x6D98, 0x1D0D, 0x6DAA, 0x0B0E, 0x6DAB, 0x1F46, 0x6DAC, 0x1F4A,
- 0x6DAE, 0x0AFB, 0x6DAF, 0x0AF9, 0x6DB2, 0x0AF0, 0x6DB3, 0x1F48,
- 0x6DB4, 0x1F47, 0x6DB5, 0x0B04, 0x6DB7, 0x1F4D, 0x6DB8, 0x0AFE,
- 0x6DBA, 0x1F5F, 0x6DBB, 0x1F6B, 0x6DBC, 0x0AED, 0x6DBD, 0x1F5C,
- 0x6DBE, 0x1F55, 0x6DBF, 0x0B10, 0x6DC0, 0x1F45, 0x6DC2, 0x1F61,
- 0x6DC4, 0x0B0D, 0x6DC5, 0x0B01, 0x6DC6, 0x0B0C, 0x6DC7, 0x0AF7,
- 0x6DC8, 0x1F51, 0x6DC9, 0x1F63, 0x6DCA, 0x1F5B, 0x6DCB, 0x0AF8,
- 0x6DCC, 0x0AF2, 0x6DCD, 0x1F69, 0x6DCF, 0x1F62, 0x6DD0, 0x1F64,
- 0x6DD1, 0x0AFA, 0x6DD2, 0x0B02, 0x6DD3, 0x1F66, 0x6DD4, 0x1F4F,
- 0x6DD5, 0x1F60, 0x6DD6, 0x1F54, 0x6DD7, 0x1F68, 0x6DD8, 0x0B07,
- 0x6DD9, 0x0AEF, 0x6DDA, 0x0B05, 0x6DDB, 0x1F59, 0x6DDC, 0x1F57,
- 0x6DDD, 0x1F58, 0x6DDE, 0x0AFC, 0x6DDF, 0x1F53, 0x6DE0, 0x1F52,
- 0x6DE1, 0x0AF1, 0x6DE2, 0x1F4C, 0x6DE3, 0x1F6A, 0x6DE4, 0x0AF3,
- 0x6DE5, 0x1F56, 0x6DE6, 0x0B11, 0x6DE8, 0x0B0B, 0x6DE9, 0x1F4B,
- 0x6DEA, 0x0B08, 0x6DEB, 0x0B06, 0x6DEC, 0x0B0F, 0x6DED, 0x1F5D,
- 0x6DEE, 0x0B0A, 0x6DEF, 0x1D02, 0x6DF0, 0x1F5E, 0x6DF1, 0x0B09,
- 0x6DF2, 0x1F65, 0x6DF3, 0x0AEE, 0x6DF4, 0x1F5A, 0x6DF5, 0x0B00,
- 0x6DF6, 0x1F4E, 0x6DF7, 0x0AFF, 0x6DF9, 0x0AFD, 0x6DFA, 0x0AF5,
- 0x6DFB, 0x0AF4, 0x6DFC, 0x21BF, 0x6DFD, 0x1F67, 0x6E00, 0x1F50,
- 0x6E03, 0x21D4, 0x6E05, 0x0AF6, 0x6E19, 0x0CC1, 0x6E1A, 0x0B03,
- 0x6E1B, 0x0CAF, 0x6E1C, 0x21CE, 0x6E1D, 0x0CBD, 0x6E1F, 0x21C2,
- 0x6E20, 0x0CAC, 0x6E21, 0x0CA8, 0x6E22, 0x21E0, 0x6E23, 0x0CAE,
- 0x6E24, 0x0CB2, 0x6E25, 0x0CAD, 0x6E26, 0x0CB6, 0x6E27, 0x21E4,
- 0x6E28, 0x21DB, 0x6E2B, 0x21C9, 0x6E2C, 0x0CBB, 0x6E2D, 0x0CB5,
- 0x6E2E, 0x21D5, 0x6E2F, 0x0CA5, 0x6E30, 0x21E1, 0x6E31, 0x21DA,
- 0x6E32, 0x0CA9, 0x6E33, 0x21CF, 0x6E34, 0x0CB8, 0x6E35, 0x21EC,
- 0x6E36, 0x21ED, 0x6E38, 0x0CA6, 0x6E39, 0x21DF, 0x6E3A, 0x0CBA,
- 0x6E3B, 0x21D3, 0x6E3C, 0x21C5, 0x6E3D, 0x21C6, 0x6E3E, 0x0CBE,
- 0x6E3F, 0x21CA, 0x6E40, 0x21D1, 0x6E41, 0x21CB, 0x6E43, 0x0CBC,
- 0x6E44, 0x0CC4, 0x6E45, 0x21C7, 0x6E46, 0x21C0, 0x6E47, 0x21C1,
- 0x6E49, 0x21C3, 0x6E4A, 0x0CAB, 0x6E4B, 0x21D0, 0x6E4D, 0x0CB9,
- 0x6E4E, 0x0CC2, 0x6E51, 0x21D2, 0x6E52, 0x21EA, 0x6E53, 0x21E2,
- 0x6E54, 0x0CA7, 0x6E55, 0x21E8, 0x6E56, 0x0CB3, 0x6E58, 0x0CB1,
- 0x6E5A, 0x21EE, 0x6E5B, 0x0CB0, 0x6E5C, 0x21D8, 0x6E5D, 0x21CC,
- 0x6E5E, 0x21D6, 0x6E5F, 0x0CC7, 0x6E60, 0x21DC, 0x6E61, 0x21D9,
- 0x6E62, 0x21C8, 0x6E63, 0x0CC3, 0x6E64, 0x21E6, 0x6E65, 0x21E3,
- 0x6E66, 0x21EB, 0x6E67, 0x0CAA, 0x6E68, 0x21D7, 0x6E69, 0x0CC6,
- 0x6E6B, 0x21DE, 0x6E6E, 0x0CB4, 0x6E6F, 0x0CB7, 0x6E71, 0x21DD,
- 0x6E72, 0x0CC5, 0x6E73, 0x21CD, 0x6E74, 0x1F49, 0x6E77, 0x21E7,
- 0x6E78, 0x21E5, 0x6E79, 0x21E9, 0x6E88, 0x21C4, 0x6E89, 0x0CC0,
- 0x6E8D, 0x246C, 0x6E8E, 0x246B, 0x6E8F, 0x2451, 0x6E90, 0x0E55,
- 0x6E92, 0x246A, 0x6E93, 0x2454, 0x6E94, 0x2455, 0x6E96, 0x0E5F,
- 0x6E97, 0x2473, 0x6E98, 0x0E5A, 0x6E99, 0x2469, 0x6E9B, 0x244E,
- 0x6E9C, 0x0E60, 0x6E9D, 0x0E56, 0x6E9E, 0x245D, 0x6E9F, 0x2453,
- 0x6EA0, 0x2456, 0x6EA1, 0x246E, 0x6EA2, 0x0E50, 0x6EA3, 0x2475,
- 0x6EA4, 0x246D, 0x6EA5, 0x0E59, 0x6EA6, 0x2462, 0x6EA7, 0x0E64,
- 0x6EAA, 0x0E63, 0x6EAB, 0x0E5D, 0x6EAE, 0x2474, 0x6EAF, 0x0E51,
- 0x6EB0, 0x2460, 0x6EB1, 0x2457, 0x6EB2, 0x2464, 0x6EB3, 0x2470,
- 0x6EB4, 0x0E65, 0x6EB6, 0x0E53, 0x6EB7, 0x245F, 0x6EB9, 0x2458,
- 0x6EBA, 0x0E5C, 0x6EBC, 0x0E5B, 0x6EBD, 0x245B, 0x6EBE, 0x2465,
- 0x6EBF, 0x246F, 0x6EC0, 0x2452, 0x6EC1, 0x245C, 0x6EC2, 0x0E54,
- 0x6EC3, 0x2466, 0x6EC4, 0x0E61, 0x6EC5, 0x0E58, 0x6EC6, 0x2459,
- 0x6EC7, 0x0E57, 0x6EC8, 0x2450, 0x6EC9, 0x245E, 0x6ECA, 0x2472,
- 0x6ECB, 0x0CBF, 0x6ECC, 0x101F, 0x6ECD, 0x2461, 0x6ECE, 0x26EB,
- 0x6ECF, 0x2463, 0x6ED0, 0x2471, 0x6ED1, 0x0E5E, 0x6ED2, 0x245A,
- 0x6ED3, 0x0E52, 0x6ED4, 0x0E62, 0x6ED5, 0x119A, 0x6ED6, 0x244F,
- 0x6ED8, 0x2468, 0x6EDC, 0x2467, 0x6EEB, 0x2707, 0x6EEC, 0x101C,
- 0x6EED, 0x26FC, 0x6EEE, 0x2701, 0x6EEF, 0x1011, 0x6EF1, 0x26ED,
- 0x6EF2, 0x101E, 0x6EF4, 0x1008, 0x6EF5, 0x26EC, 0x6EF6, 0x270D,
- 0x6EF7, 0x1020, 0x6EF8, 0x26F0, 0x6EF9, 0x2700, 0x6EFB, 0x26F2,
- 0x6EFC, 0x2710, 0x6EFD, 0x270C, 0x6EFE, 0x1006, 0x6EFF, 0x1010,
- 0x6F00, 0x2946, 0x6F01, 0x101D, 0x6F02, 0x100E, 0x6F03, 0x26EE,
- 0x6F05, 0x270B, 0x6F06, 0x1012, 0x6F07, 0x2708, 0x6F08, 0x2715,
- 0x6F09, 0x26F4, 0x6F0A, 0x26FD, 0x6F0D, 0x2713, 0x6F0E, 0x2709,
- 0x6F0F, 0x100D, 0x6F12, 0x26FB, 0x6F13, 0x1007, 0x6F14, 0x1005,
- 0x6F15, 0x1017, 0x6F18, 0x26F9, 0x6F19, 0x26F6, 0x6F1A, 0x26F7,
- 0x6F1C, 0x270F, 0x6F1E, 0x2714, 0x6F1F, 0x2712, 0x6F20, 0x100B,
- 0x6F21, 0x2716, 0x6F22, 0x100F, 0x6F23, 0x1016, 0x6F25, 0x26EF,
- 0x6F26, 0x292E, 0x6F27, 0x26F8, 0x6F29, 0x1009, 0x6F2A, 0x101B,
- 0x6F2B, 0x1018, 0x6F2C, 0x100C, 0x6F2D, 0x2702, 0x6F2E, 0x26F3,
- 0x6F2F, 0x1019, 0x6F30, 0x2704, 0x6F31, 0x1013, 0x6F32, 0x1015,
- 0x6F33, 0x1004, 0x6F35, 0x2706, 0x6F36, 0x26FE, 0x6F37, 0x26F1,
- 0x6F38, 0x1014, 0x6F39, 0x270E, 0x6F3A, 0x2711, 0x6F3B, 0x26FA,
- 0x6F3C, 0x2705, 0x6F3E, 0x100A, 0x6F3F, 0x1189, 0x6F40, 0x2703,
- 0x6F41, 0x292D, 0x6F43, 0x270A, 0x6F4E, 0x26F5, 0x6F4F, 0x2937,
- 0x6F50, 0x2941, 0x6F51, 0x118C, 0x6F52, 0x2940, 0x6F53, 0x294C,
- 0x6F54, 0x118E, 0x6F55, 0x293E, 0x6F57, 0x2942, 0x6F58, 0x1199,
- 0x6F5A, 0x2939, 0x6F5B, 0x1191, 0x6F5D, 0x2945, 0x6F5E, 0x2B9A,
- 0x6F5F, 0x119D, 0x6F60, 0x119C, 0x6F61, 0x2947, 0x6F62, 0x2936,
- 0x6F63, 0x2951, 0x6F64, 0x1197, 0x6F66, 0x118D, 0x6F67, 0x294A,
- 0x6F69, 0x294E, 0x6F6A, 0x2953, 0x6F6B, 0x2948, 0x6F6C, 0x293C,
- 0x6F6D, 0x1190, 0x6F6E, 0x1193, 0x6F6F, 0x119B, 0x6F70, 0x1196,
- 0x6F72, 0x293F, 0x6F73, 0x26FF, 0x6F76, 0x293B, 0x6F77, 0x2952,
- 0x6F78, 0x1192, 0x6F7A, 0x1195, 0x6F7B, 0x2954, 0x6F7C, 0x118A,
- 0x6F7D, 0x2949, 0x6F7E, 0x292F, 0x6F7F, 0x294F, 0x6F80, 0x13FC,
- 0x6F82, 0x293D, 0x6F84, 0x118B, 0x6F85, 0x2938, 0x6F86, 0x118F,
- 0x6F87, 0x2930, 0x6F88, 0x101A, 0x6F89, 0x2934, 0x6F8B, 0x294D,
- 0x6F8C, 0x2935, 0x6F8D, 0x2933, 0x6F8E, 0x1194, 0x6F90, 0x294B,
- 0x6F92, 0x2932, 0x6F93, 0x2944, 0x6F94, 0x2943, 0x6F95, 0x2950,
- 0x6F96, 0x293A, 0x6F97, 0x1198, 0x6F9E, 0x2B9D, 0x6FA0, 0x12EB,
- 0x6FA1, 0x12E1, 0x6FA2, 0x2BA9, 0x6FA3, 0x2B95, 0x6FA4, 0x12E3,
- 0x6FA5, 0x2BA1, 0x6FA6, 0x12EA, 0x6FA7, 0x12E5, 0x6FA8, 0x2B9F,
- 0x6FA9, 0x2D8E, 0x6FAA, 0x2BA5, 0x6FAB, 0x2BAB, 0x6FAC, 0x2BA4,
- 0x6FAD, 0x2B93, 0x6FAE, 0x2BA2, 0x6FAF, 0x2BAD, 0x6FB0, 0x2BAF,
- 0x6FB1, 0x12E0, 0x6FB2, 0x2BAE, 0x6FB3, 0x12E6, 0x6FB4, 0x12EC,
- 0x6FB6, 0x12E9, 0x6FB8, 0x2BA8, 0x6FB9, 0x12E8, 0x6FBA, 0x2BA3,
- 0x6FBC, 0x2B97, 0x6FBD, 0x2B9C, 0x6FBF, 0x2BA7, 0x6FC0, 0x12E7,
- 0x6FC1, 0x12E4, 0x6FC2, 0x12DF, 0x6FC3, 0x12E2, 0x6FC4, 0x2B9B,
- 0x6FC6, 0x2931, 0x6FC7, 0x2B96, 0x6FC8, 0x2B99, 0x6FC9, 0x2BAA,
- 0x6FCA, 0x2B9E, 0x6FCB, 0x2B94, 0x6FCC, 0x2D8D, 0x6FCD, 0x2BAC,
- 0x6FCE, 0x2B98, 0x6FCF, 0x2BA6, 0x6FD4, 0x2D90, 0x6FD5, 0x1400,
- 0x6FD8, 0x13F4, 0x6FDB, 0x13F8, 0x6FDC, 0x2D92, 0x6FDD, 0x2D98,
- 0x6FDE, 0x2D96, 0x6FDF, 0x13F6, 0x6FE0, 0x13F7, 0x6FE1, 0x13FE,
- 0x6FE2, 0x2D99, 0x6FE3, 0x2D91, 0x6FE4, 0x13F9, 0x6FE6, 0x2D95,
- 0x6FE7, 0x2D94, 0x6FE8, 0x2D9A, 0x6FE9, 0x13FF, 0x6FEB, 0x13FA,
- 0x6FEC, 0x13FD, 0x6FED, 0x2D93, 0x6FEE, 0x1401, 0x6FEF, 0x13FB,
- 0x6FF0, 0x1402, 0x6FF1, 0x13F5, 0x6FF2, 0x2D97, 0x6FF4, 0x2D8F,
- 0x6FF7, 0x2F4E, 0x6FFA, 0x14EB, 0x6FFB, 0x2F4B, 0x6FFC, 0x2F4D,
- 0x6FFE, 0x14E9, 0x6FFF, 0x2F49, 0x7000, 0x2F4A, 0x7001, 0x2F45,
- 0x7004, 0x2BA0, 0x7005, 0x2F46, 0x7006, 0x14EA, 0x7007, 0x2F42,
- 0x7009, 0x14E7, 0x700A, 0x2F4F, 0x700B, 0x14E8, 0x700C, 0x2F43,
- 0x700D, 0x2F44, 0x700E, 0x2F48, 0x700F, 0x14ED, 0x7011, 0x14EC,
- 0x7014, 0x2F47, 0x7015, 0x158F, 0x7016, 0x30AD, 0x7017, 0x30B3,
- 0x7018, 0x1590, 0x7019, 0x30AA, 0x701A, 0x158D, 0x701B, 0x158A,
- 0x701C, 0x30B5, 0x701D, 0x158E, 0x701F, 0x158B, 0x7020, 0x30AC,
- 0x7021, 0x30AF, 0x7022, 0x30B0, 0x7023, 0x30B1, 0x7024, 0x30B4,
- 0x7026, 0x2F4C, 0x7027, 0x30AB, 0x7028, 0x158C, 0x7029, 0x30B2,
- 0x702A, 0x31EF, 0x702B, 0x30AE, 0x702F, 0x31E6, 0x7030, 0x161D,
- 0x7031, 0x31E9, 0x7032, 0x161E, 0x7033, 0x31F2, 0x7034, 0x31E8,
- 0x7035, 0x31E5, 0x7037, 0x31E7, 0x7038, 0x31EB, 0x7039, 0x31EE,
- 0x703A, 0x31ED, 0x703B, 0x31F1, 0x703C, 0x31E4, 0x703E, 0x161C,
- 0x703F, 0x31EC, 0x7040, 0x31F0, 0x7041, 0x31F3, 0x7042, 0x31EA,
- 0x7043, 0x32D8, 0x7044, 0x32D9, 0x7045, 0x32DD, 0x7046, 0x32DE,
- 0x7048, 0x32DB, 0x7049, 0x32DC, 0x704A, 0x32DA, 0x704C, 0x167A,
- 0x7051, 0x16C8, 0x7052, 0x338C, 0x7055, 0x3389, 0x7056, 0x338A,
- 0x7057, 0x338B, 0x7058, 0x16C9, 0x705A, 0x3423, 0x705B, 0x3422,
- 0x705D, 0x348A, 0x705E, 0x1722, 0x705F, 0x3488, 0x7060, 0x348B,
- 0x7061, 0x3489, 0x7062, 0x34D0, 0x7063, 0x1744, 0x7064, 0x1752,
- 0x7065, 0x351C, 0x7066, 0x3506, 0x7068, 0x351B, 0x7069, 0x3547,
- 0x706A, 0x3548, 0x706B, 0x02E6, 0x7070, 0x03F2, 0x7071, 0x180A,
- 0x7074, 0x18C3, 0x7076, 0x04E6, 0x7078, 0x04E9, 0x707A, 0x18C4,
- 0x707C, 0x04E7, 0x707D, 0x04E8, 0x7082, 0x19F7, 0x7083, 0x19F9,
- 0x7084, 0x19F4, 0x7085, 0x19F1, 0x7086, 0x19F3, 0x708A, 0x0643,
- 0x708E, 0x0641, 0x7091, 0x19F5, 0x7092, 0x0642, 0x7093, 0x19F2,
- 0x7094, 0x19EF, 0x7095, 0x0640, 0x7096, 0x19F6, 0x7098, 0x19F0,
- 0x7099, 0x0644, 0x709A, 0x19F8, 0x709F, 0x1B66, 0x70A1, 0x1B6A,
- 0x70A4, 0x0790, 0x70A9, 0x1B6D, 0x70AB, 0x0788, 0x70AC, 0x078B,
- 0x70AD, 0x078D, 0x70AE, 0x078F, 0x70AF, 0x078C, 0x70B0, 0x1B69,
- 0x70B1, 0x1B68, 0x70B3, 0x078A, 0x70B4, 0x1B6B, 0x70B5, 0x1B6C,
- 0x70B7, 0x1B65, 0x70B8, 0x078E, 0x70BA, 0x0789, 0x70BE, 0x1B67,
- 0x70C5, 0x1D27, 0x70C6, 0x1D28, 0x70C7, 0x1D29, 0x70C8, 0x0921,
- 0x70CA, 0x091D, 0x70CB, 0x1D1E, 0x70CD, 0x1D26, 0x70CE, 0x1D2B,
- 0x70CF, 0x0922, 0x70D1, 0x1D1C, 0x70D2, 0x1D22, 0x70D3, 0x1D1B,
- 0x70D4, 0x1D25, 0x70D7, 0x1D21, 0x70D8, 0x091E, 0x70D9, 0x0920,
- 0x70DA, 0x1D2A, 0x70DC, 0x1D1A, 0x70DD, 0x1D1D, 0x70DE, 0x1D23,
- 0x70E0, 0x1D24, 0x70E1, 0x1D2C, 0x70E2, 0x1D20, 0x70E4, 0x091F,
- 0x70EF, 0x0B16, 0x70F0, 0x1F72, 0x70F3, 0x1F74, 0x70F4, 0x1F70,
- 0x70F6, 0x1F7C, 0x70F7, 0x1F6E, 0x70F8, 0x1F7B, 0x70F9, 0x0B12,
- 0x70FA, 0x1F6C, 0x70FB, 0x21F2, 0x70FC, 0x1F76, 0x70FD, 0x0B15,
- 0x70FF, 0x1F77, 0x7100, 0x1F7A, 0x7102, 0x1F7E, 0x7104, 0x1F73,
- 0x7106, 0x1F78, 0x7109, 0x0B13, 0x710A, 0x0B14, 0x710B, 0x1F7D,
- 0x710C, 0x1F71, 0x710D, 0x1F6D, 0x710E, 0x1F7F, 0x7110, 0x1F75,
- 0x7113, 0x1F79, 0x7117, 0x1F6F, 0x7119, 0x0CC8, 0x711A, 0x0CC9,
- 0x711B, 0x21FC, 0x711C, 0x0CCF, 0x711E, 0x21F0, 0x711F, 0x21F9,
- 0x7120, 0x21EF, 0x7121, 0x0CCC, 0x7122, 0x21F7, 0x7123, 0x21F5,
- 0x7125, 0x21F6, 0x7126, 0x0CCA, 0x7128, 0x21FA, 0x712E, 0x21F3,
- 0x712F, 0x21F1, 0x7130, 0x0CCB, 0x7131, 0x21F4, 0x7132, 0x21F8,
- 0x7136, 0x0CCD, 0x713A, 0x21FB, 0x7141, 0x247B, 0x7142, 0x2482,
- 0x7143, 0x2484, 0x7144, 0x248A, 0x7146, 0x0E72, 0x7147, 0x2476,
- 0x7149, 0x0E6A, 0x714B, 0x2485, 0x714C, 0x0E6F, 0x714D, 0x248B,
- 0x714E, 0x0E66, 0x7150, 0x2488, 0x7152, 0x2478, 0x7153, 0x2489,
- 0x7154, 0x2477, 0x7156, 0x0E74, 0x7158, 0x2483, 0x7159, 0x0E67,
- 0x715A, 0x248C, 0x715C, 0x0E6C, 0x715D, 0x247C, 0x715E, 0x0E71,
- 0x715F, 0x2487, 0x7160, 0x247A, 0x7161, 0x2481, 0x7162, 0x247D,
- 0x7163, 0x2479, 0x7164, 0x0E69, 0x7165, 0x0E70, 0x7166, 0x0E6E,
- 0x7167, 0x0E6B, 0x7168, 0x0E73, 0x7169, 0x0E68, 0x716A, 0x2480,
- 0x716C, 0x0E6D, 0x716E, 0x0CCE, 0x7170, 0x2486, 0x7172, 0x247E,
- 0x7178, 0x247F, 0x717B, 0x271E, 0x717D, 0x1023, 0x7180, 0x271A,
- 0x7181, 0x2720, 0x7182, 0x271C, 0x7184, 0x1025, 0x7185, 0x271B,
- 0x7186, 0x271F, 0x7187, 0x2717, 0x7189, 0x2719, 0x718A, 0x1024,
- 0x718F, 0x271D, 0x7190, 0x2718, 0x7192, 0x1026, 0x7194, 0x1021,
- 0x7197, 0x2721, 0x7199, 0x1022, 0x719A, 0x295A, 0x719B, 0x2957,
- 0x719C, 0x2963, 0x719D, 0x295D, 0x719E, 0x295F, 0x719F, 0x119E,
- 0x71A0, 0x2959, 0x71A1, 0x2961, 0x71A4, 0x2960, 0x71A5, 0x295E,
- 0x71A7, 0x2964, 0x71A8, 0x11A1, 0x71A9, 0x295B, 0x71AA, 0x2962,
- 0x71AC, 0x119F, 0x71AF, 0x2956, 0x71B0, 0x2958, 0x71B1, 0x11A0,
- 0x71B2, 0x2955, 0x71B3, 0x2965, 0x71B5, 0x295C, 0x71B8, 0x2BB3,
- 0x71B9, 0x12F3, 0x71BC, 0x2BBE, 0x71BD, 0x2BBC, 0x71BE, 0x12ED,
- 0x71BF, 0x2BB2, 0x71C0, 0x2BB5, 0x71C1, 0x2BB6, 0x71C2, 0x2BB1,
- 0x71C3, 0x12F7, 0x71C4, 0x12F8, 0x71C5, 0x2BB0, 0x71C6, 0x2BBF,
- 0x71C7, 0x2BBA, 0x71C8, 0x12F1, 0x71C9, 0x12EE, 0x71CA, 0x2BB9,
- 0x71CB, 0x2BB7, 0x71CE, 0x12F4, 0x71CF, 0x2BBB, 0x71D0, 0x12EF,
- 0x71D2, 0x12F0, 0x71D4, 0x2BB8, 0x71D5, 0x12F2, 0x71D6, 0x2BB4,
- 0x71D8, 0x2BBD, 0x71D9, 0x12F5, 0x71DA, 0x2BC0, 0x71DB, 0x2BC1,
- 0x71DC, 0x12F6, 0x71DF, 0x1404, 0x71E0, 0x140B, 0x71E1, 0x2D9B,
- 0x71E2, 0x2DA1, 0x71E4, 0x2D9F, 0x71E5, 0x1407, 0x71E6, 0x1406,
- 0x71E7, 0x1403, 0x71E8, 0x2D9D, 0x71EC, 0x1409, 0x71ED, 0x1408,
- 0x71EE, 0x1405, 0x71F0, 0x2DA0, 0x71F1, 0x2D9C, 0x71F2, 0x2D9E,
- 0x71F4, 0x140A, 0x71F8, 0x14F1, 0x71F9, 0x2F52, 0x71FB, 0x14EE,
- 0x71FC, 0x14EF, 0x71FD, 0x2F54, 0x71FE, 0x14F0, 0x71FF, 0x2F51,
- 0x7201, 0x2F50, 0x7202, 0x30B9, 0x7203, 0x2F53, 0x7205, 0x30BA,
- 0x7206, 0x1591, 0x7207, 0x30B8, 0x720A, 0x30B7, 0x720C, 0x30B6,
- 0x720D, 0x1592, 0x7210, 0x161F, 0x7213, 0x31F4, 0x7214, 0x31F5,
- 0x7219, 0x32E1, 0x721A, 0x32E0, 0x721B, 0x167B, 0x721D, 0x32DF,
- 0x721E, 0x338D, 0x721F, 0x338E, 0x7222, 0x3424, 0x7223, 0x348C,
- 0x7226, 0x34D1, 0x7227, 0x3535, 0x7228, 0x1766, 0x7229, 0x3549,
- 0x722A, 0x02E7, 0x722C, 0x0645, 0x722D, 0x0646, 0x7230, 0x0791,
- 0x7235, 0x140C, 0x7236, 0x02E8, 0x7238, 0x0647, 0x7239, 0x0923,
- 0x723A, 0x0E75, 0x723B, 0x02E9, 0x723D, 0x0B17, 0x723E, 0x1027,
- 0x723F, 0x178D, 0x7241, 0x1B6E, 0x7242, 0x1D2D, 0x7244, 0x2722,
- 0x7246, 0x140D, 0x7247, 0x02EA, 0x7248, 0x0648, 0x7249, 0x1B6F,
- 0x724A, 0x1B70, 0x724B, 0x21FD, 0x724C, 0x0CD0, 0x724F, 0x248D,
- 0x7252, 0x0E76, 0x7253, 0x2723, 0x7256, 0x11A2, 0x7258, 0x1593,
- 0x7259, 0x02EB, 0x725A, 0x21FE, 0x725B, 0x02EC, 0x725D, 0x03F4,
- 0x725E, 0x180B, 0x725F, 0x03F3, 0x7260, 0x04EC, 0x7261, 0x04EB,
- 0x7262, 0x04EA, 0x7263, 0x18C5, 0x7267, 0x0649, 0x7269, 0x064A,
- 0x726A, 0x19FA, 0x726C, 0x1B71, 0x726E, 0x1B74, 0x726F, 0x0793,
- 0x7270, 0x1B72, 0x7272, 0x0792, 0x7273, 0x1B73, 0x7274, 0x0794,
- 0x7276, 0x1D30, 0x7277, 0x1D2F, 0x7278, 0x1D2E, 0x7279, 0x0924,
- 0x727B, 0x1F81, 0x727C, 0x1F82, 0x727D, 0x0B18, 0x727E, 0x1F80,
- 0x727F, 0x1F83, 0x7280, 0x0CD2, 0x7281, 0x0B19, 0x7284, 0x0CD1,
- 0x7285, 0x2202, 0x7286, 0x2201, 0x7288, 0x21FF, 0x7289, 0x2200,
- 0x728B, 0x2203, 0x728C, 0x248F, 0x728D, 0x248E, 0x728E, 0x2492,
- 0x7290, 0x2491, 0x7291, 0x2490, 0x7292, 0x1028, 0x7293, 0x2726,
- 0x7295, 0x2725, 0x7296, 0x1029, 0x7297, 0x2724, 0x7298, 0x2966,
- 0x729A, 0x2967, 0x729B, 0x11A3, 0x729D, 0x2BC2, 0x729E, 0x2BC3,
- 0x72A1, 0x30BF, 0x72A2, 0x1594, 0x72A3, 0x30BE, 0x72A4, 0x30BD,
- 0x72A5, 0x30BB, 0x72A6, 0x30BC, 0x72A7, 0x167C, 0x72A8, 0x31F6,
- 0x72A9, 0x338F, 0x72AA, 0x34D2, 0x72AC, 0x02ED, 0x72AE, 0x17AF,
- 0x72AF, 0x0355, 0x72B0, 0x17B0, 0x72B4, 0x180C, 0x72B5, 0x180D,
- 0x72BA, 0x18CB, 0x72BD, 0x18C7, 0x72BF, 0x18C6, 0x72C0, 0x064B,
- 0x72C1, 0x18CA, 0x72C2, 0x04EE, 0x72C3, 0x18C8, 0x72C4, 0x04ED,
- 0x72C5, 0x18CC, 0x72C6, 0x18C9, 0x72C9, 0x19FE, 0x72CA, 0x1B75,
- 0x72CB, 0x19FC, 0x72CC, 0x1A03, 0x72CE, 0x064C, 0x72D0, 0x064F,
- 0x72D1, 0x1A04, 0x72D2, 0x1A00, 0x72D4, 0x1A01, 0x72D6, 0x19FB,
- 0x72D7, 0x064E, 0x72D8, 0x19FD, 0x72D9, 0x064D, 0x72DA, 0x1A02,
- 0x72DC, 0x19FF, 0x72DF, 0x1B79, 0x72E0, 0x0796, 0x72E1, 0x0797,
- 0x72E3, 0x1B7C, 0x72E4, 0x1B76, 0x72E6, 0x1B7B, 0x72E8, 0x1B77,
- 0x72E9, 0x0795, 0x72EA, 0x1B7A, 0x72EB, 0x1B78, 0x72F3, 0x1D36,
- 0x72F4, 0x1D33, 0x72F6, 0x1D35, 0x72F7, 0x0929, 0x72F8, 0x0928,
- 0x72F9, 0x0926, 0x72FA, 0x1D32, 0x72FB, 0x1D37, 0x72FC, 0x0925,
- 0x72FD, 0x0927, 0x72FE, 0x1D34, 0x72FF, 0x1F8B, 0x7300, 0x1D31,
- 0x7301, 0x1D38, 0x7307, 0x1F86, 0x7308, 0x1F8A, 0x730A, 0x1F89,
- 0x730B, 0x2205, 0x730C, 0x2210, 0x730F, 0x1F8C, 0x7311, 0x1F87,
- 0x7312, 0x2204, 0x7313, 0x0B1D, 0x7316, 0x0B1C, 0x7317, 0x1F85,
- 0x7318, 0x1F88, 0x7319, 0x0B1E, 0x731B, 0x0B1B, 0x731C, 0x0B1A,
- 0x731D, 0x1F84, 0x731E, 0x1F8D, 0x7322, 0x2207, 0x7323, 0x220E,
- 0x7325, 0x0CD4, 0x7326, 0x220D, 0x7327, 0x220A, 0x7329, 0x0CD6,
- 0x732D, 0x220C, 0x7330, 0x2206, 0x7331, 0x2208, 0x7332, 0x220B,
- 0x7333, 0x2209, 0x7334, 0x0CD5, 0x7335, 0x220F, 0x7336, 0x0CD3,
- 0x7337, 0x0E77, 0x733A, 0x2496, 0x733B, 0x2495, 0x733C, 0x2493,
- 0x733E, 0x0E7A, 0x733F, 0x0E79, 0x7340, 0x2497, 0x7342, 0x2494,
- 0x7343, 0x2727, 0x7344, 0x102A, 0x7345, 0x0E78, 0x7349, 0x2499,
- 0x734A, 0x2498, 0x734C, 0x272A, 0x734D, 0x2728, 0x734E, 0x11A4,
- 0x7350, 0x102B, 0x7351, 0x2729, 0x7352, 0x2969, 0x7357, 0x11A5,
- 0x7358, 0x2968, 0x7359, 0x2971, 0x735A, 0x2970, 0x735B, 0x296E,
- 0x735D, 0x296D, 0x735E, 0x296A, 0x735F, 0x296B, 0x7360, 0x296C,
- 0x7361, 0x296F, 0x7362, 0x2972, 0x7365, 0x2BC8, 0x7366, 0x2BC5,
- 0x7367, 0x2BC6, 0x7368, 0x12F9, 0x7369, 0x2BC4, 0x736A, 0x2BCA,
- 0x736B, 0x2BC9, 0x736C, 0x2BC7, 0x736E, 0x2DA3, 0x736F, 0x2DA4,
- 0x7370, 0x140E, 0x7372, 0x140F, 0x7373, 0x2DA2, 0x7375, 0x14F3,
- 0x7376, 0x2F55, 0x7377, 0x14F2, 0x7378, 0x1595, 0x737A, 0x1596,
- 0x737B, 0x1620, 0x737C, 0x31F8, 0x737D, 0x31F7, 0x737E, 0x32E2,
- 0x737F, 0x3390, 0x7380, 0x16CA, 0x7381, 0x3426, 0x7382, 0x3425,
- 0x7383, 0x3427, 0x7384, 0x0356, 0x7385, 0x1B7D, 0x7386, 0x092A,
- 0x7387, 0x0B1F, 0x7388, 0x1F8E, 0x7389, 0x0357, 0x738A, 0x17B1,
- 0x738B, 0x02EE, 0x738E, 0x180E, 0x7392, 0x18D1, 0x7393, 0x18CF,
- 0x7394, 0x18D0, 0x7395, 0x18CD, 0x7396, 0x04EF, 0x7397, 0x18CE,
- 0x739D, 0x1A0C, 0x739F, 0x0652, 0x73A0, 0x1A0A, 0x73A1, 0x1A06,
- 0x73A2, 0x1A09, 0x73A4, 0x1A05, 0x73A5, 0x0654, 0x73A6, 0x1A08,
- 0x73A8, 0x0651, 0x73A9, 0x0650, 0x73AB, 0x0653, 0x73AC, 0x1A0B,
- 0x73AD, 0x1A07, 0x73B2, 0x079B, 0x73B3, 0x079E, 0x73B4, 0x1B85,
- 0x73B5, 0x1B84, 0x73B6, 0x1B83, 0x73B7, 0x0798, 0x73B8, 0x1B8C,
- 0x73B9, 0x1B82, 0x73BB, 0x079A, 0x73BC, 0x1D3D, 0x73BE, 0x1B89,
- 0x73BF, 0x1B87, 0x73C0, 0x079D, 0x73C2, 0x1B7F, 0x73C3, 0x1B8A,
- 0x73C5, 0x1B81, 0x73C6, 0x1B8B, 0x73C7, 0x1B88, 0x73C8, 0x1B80,
- 0x73CA, 0x0799, 0x73CB, 0x1B8D, 0x73CC, 0x1B7E, 0x73CD, 0x079C,
- 0x73D2, 0x1D42, 0x73D3, 0x1D39, 0x73D4, 0x1D44, 0x73D6, 0x1D3C,
- 0x73D7, 0x1D47, 0x73D8, 0x1D48, 0x73D9, 0x1D3A, 0x73DA, 0x1D46,
- 0x73DB, 0x1D43, 0x73DC, 0x1D41, 0x73DD, 0x1D45, 0x73DE, 0x0930,
- 0x73E0, 0x092E, 0x73E3, 0x1D3F, 0x73E5, 0x1D3B, 0x73E7, 0x1D3E,
- 0x73E8, 0x1D49, 0x73E9, 0x1D40, 0x73EA, 0x092F, 0x73EB, 0x1B86,
- 0x73ED, 0x092B, 0x73EE, 0x092D, 0x73F4, 0x1F9C, 0x73F5, 0x1F91,
- 0x73F6, 0x1F8F, 0x73F8, 0x1F90, 0x73FA, 0x1F97, 0x73FC, 0x1F98,
- 0x73FD, 0x1F94, 0x73FE, 0x0B24, 0x73FF, 0x1F99, 0x7400, 0x1F96,
- 0x7401, 0x1F93, 0x7403, 0x0B22, 0x7404, 0x1F92, 0x7405, 0x0B20,
- 0x7406, 0x0B23, 0x7407, 0x1F95, 0x7408, 0x1F9D, 0x7409, 0x092C,
- 0x740A, 0x0B21, 0x740B, 0x1F9B, 0x740C, 0x1F9A, 0x740D, 0x0B25,
- 0x7416, 0x2215, 0x741A, 0x2216, 0x741B, 0x0CE0, 0x741D, 0x221C,
- 0x7420, 0x221E, 0x7421, 0x2217, 0x7422, 0x0CDA, 0x7423, 0x221B,
- 0x7424, 0x221A, 0x7425, 0x0CDB, 0x7426, 0x0CE1, 0x7428, 0x0CE2,
- 0x7429, 0x221D, 0x742A, 0x0CD8, 0x742B, 0x2214, 0x742C, 0x2212,
- 0x742D, 0x2218, 0x742E, 0x2211, 0x742F, 0x0CDF, 0x7430, 0x2213,
- 0x7431, 0x2219, 0x7432, 0x221F, 0x7433, 0x0CD9, 0x7434, 0x0CDE,
- 0x7435, 0x0CDC, 0x7436, 0x0CDD, 0x743A, 0x0CD7, 0x743F, 0x0E81,
- 0x7440, 0x24A0, 0x7441, 0x0E80, 0x7442, 0x24A4, 0x7444, 0x249A,
- 0x7446, 0x24A5, 0x744A, 0x249B, 0x744B, 0x249C, 0x744D, 0x24A6,
- 0x744E, 0x24A3, 0x744F, 0x24A1, 0x7450, 0x24A2, 0x7451, 0x249E,
- 0x7452, 0x249D, 0x7454, 0x24A7, 0x7455, 0x0E7D, 0x7457, 0x249F,
- 0x7459, 0x0E82, 0x745A, 0x0E7C, 0x745B, 0x0E83, 0x745C, 0x0E84,
- 0x745E, 0x0E7F, 0x745F, 0x0E7E, 0x7462, 0x272B, 0x7463, 0x102D,
- 0x7464, 0x102C, 0x7467, 0x2730, 0x7469, 0x11A6, 0x746A, 0x102E,
- 0x746D, 0x1030, 0x746E, 0x2731, 0x746F, 0x0E7B, 0x7470, 0x102F,
- 0x7471, 0x272D, 0x7472, 0x272F, 0x7473, 0x272C, 0x7475, 0x272E,
- 0x7479, 0x297C, 0x747C, 0x297B, 0x747D, 0x2978, 0x747E, 0x11A9,
- 0x747F, 0x2BCB, 0x7480, 0x11AA, 0x7481, 0x2977, 0x7483, 0x11A8,
- 0x7485, 0x2979, 0x7486, 0x2976, 0x7487, 0x2973, 0x7488, 0x297A,
- 0x7489, 0x2974, 0x748A, 0x2975, 0x748B, 0x11A7, 0x7490, 0x2DA8,
- 0x7492, 0x2BCF, 0x7494, 0x2BCE, 0x7495, 0x2BD0, 0x7497, 0x2DA5,
- 0x7498, 0x12FC, 0x749A, 0x2BCC, 0x749C, 0x12FA, 0x749E, 0x12FE,
- 0x749F, 0x12FD, 0x74A0, 0x2BCD, 0x74A1, 0x2BD1, 0x74A3, 0x12FB,
- 0x74A5, 0x2DAC, 0x74A6, 0x1412, 0x74A7, 0x14F4, 0x74A8, 0x1413,
- 0x74A9, 0x1410, 0x74AA, 0x2DA9, 0x74AB, 0x2DA7, 0x74AD, 0x2DAA,
- 0x74AF, 0x2DAD, 0x74B0, 0x1411, 0x74B1, 0x2DAB, 0x74B2, 0x2DA6,
- 0x74B5, 0x2F58, 0x74B6, 0x2F5B, 0x74B7, 0x30C2, 0x74B8, 0x2F56,
- 0x74BA, 0x31F9, 0x74BB, 0x2F5C, 0x74BD, 0x1597, 0x74BE, 0x2F5A,
- 0x74BF, 0x14F5, 0x74C0, 0x2F57, 0x74C1, 0x2F59, 0x74C2, 0x2F5D,
- 0x74C3, 0x30C3, 0x74C5, 0x30C1, 0x74CA, 0x1598, 0x74CB, 0x30C0,
- 0x74CF, 0x1621, 0x74D4, 0x167E, 0x74D5, 0x3392, 0x74D6, 0x167D,
- 0x74D7, 0x3394, 0x74D8, 0x3391, 0x74D9, 0x3393, 0x74DA, 0x16FE,
- 0x74DB, 0x348D, 0x74DC, 0x0358, 0x74DD, 0x1A0D, 0x74DE, 0x1D4A,
- 0x74DF, 0x1D4B, 0x74E0, 0x0B26, 0x74E1, 0x24A8, 0x74E2, 0x12FF,
- 0x74E3, 0x1599, 0x74E4, 0x16CB, 0x74E5, 0x348E, 0x74E6, 0x0359,
- 0x74E8, 0x1A0E, 0x74E9, 0x0120, 0x74EC, 0x1B8E, 0x74EE, 0x1B8F,
- 0x74F4, 0x1D4C, 0x74F5, 0x1D4D, 0x74F6, 0x0B27, 0x74F7, 0x0B28,
- 0x74FB, 0x2220, 0x74FD, 0x24AB, 0x74FE, 0x24AA, 0x74FF, 0x24A9,
- 0x7500, 0x2732, 0x7502, 0x2733, 0x7503, 0x2734, 0x7504, 0x1031,
- 0x7507, 0x297E, 0x7508, 0x297D, 0x750B, 0x2BD2, 0x750C, 0x1300,
- 0x750D, 0x1301, 0x750F, 0x2DB1, 0x7510, 0x2DAE, 0x7511, 0x2DAF,
- 0x7512, 0x2DB0, 0x7513, 0x2F5F, 0x7514, 0x2F5E, 0x7515, 0x14F6,
- 0x7516, 0x30C4, 0x7517, 0x32E3, 0x7518, 0x035A, 0x751A, 0x079F,
- 0x751C, 0x0B29, 0x751D, 0x24AC, 0x751F, 0x035B, 0x7521, 0x1D4E,
- 0x7522, 0x0B2A, 0x7525, 0x0CE3, 0x7526, 0x0CE4, 0x7528, 0x035C,
- 0x7529, 0x035D, 0x752A, 0x180F, 0x752B, 0x04F1, 0x752C, 0x04F0,
- 0x752D, 0x07A0, 0x752E, 0x1B90, 0x752F, 0x2221, 0x7530, 0x035E,
- 0x7531, 0x035F, 0x7532, 0x0360, 0x7533, 0x0361, 0x7537, 0x04F2,
- 0x7538, 0x04F3, 0x7539, 0x18D3, 0x753A, 0x18D2, 0x753D, 0x0655,
- 0x753E, 0x1A11, 0x753F, 0x1A0F, 0x7540, 0x1A10, 0x7547, 0x1B91,
- 0x7548, 0x1B92, 0x754B, 0x07A4, 0x754C, 0x07A2, 0x754E, 0x07A3,
- 0x754F, 0x07A1, 0x7554, 0x0931, 0x7559, 0x0935, 0x755A, 0x0934,
- 0x755B, 0x1D4F, 0x755C, 0x0933, 0x755D, 0x0932, 0x755F, 0x1D50,
- 0x7562, 0x0B2D, 0x7563, 0x1F9F, 0x7564, 0x1F9E, 0x7565, 0x0B2B,
- 0x7566, 0x0B2C, 0x756A, 0x0CE6, 0x756B, 0x0CE5, 0x756C, 0x2223,
- 0x756F, 0x2222, 0x7570, 0x0B2E, 0x7576, 0x0E85, 0x7577, 0x24AE,
- 0x7578, 0x0E86, 0x7579, 0x24AD, 0x757D, 0x2735, 0x757E, 0x297F,
- 0x757F, 0x11AB, 0x7580, 0x2BD3, 0x7584, 0x2DB2, 0x7586, 0x159B,
- 0x7587, 0x159A, 0x758A, 0x16CC, 0x758B, 0x0362, 0x758C, 0x1A12,
- 0x758F, 0x0B2F, 0x7590, 0x2736, 0x7591, 0x1032, 0x7592, 0x022E,
- 0x7594, 0x18D4, 0x7595, 0x18D5, 0x7598, 0x1A13, 0x7599, 0x0657,
- 0x759A, 0x0658, 0x759D, 0x0656, 0x75A2, 0x07A8, 0x75A3, 0x07A9,
- 0x75A4, 0x07A6, 0x75A5, 0x07A7, 0x75A7, 0x1B93, 0x75AA, 0x1B94,
- 0x75AB, 0x07A5, 0x75B0, 0x1D51, 0x75B2, 0x0939, 0x75B3, 0x093A,
- 0x75B5, 0x0B32, 0x75B6, 0x1D57, 0x75B8, 0x093F, 0x75B9, 0x093D,
- 0x75BA, 0x1D58, 0x75BB, 0x1D53, 0x75BC, 0x093C, 0x75BD, 0x093B,
- 0x75BE, 0x0936, 0x75BF, 0x1D56, 0x75C0, 0x1D55, 0x75C1, 0x1D52,
- 0x75C2, 0x093E, 0x75C4, 0x1D54, 0x75C5, 0x0937, 0x75C7, 0x0938,
- 0x75CA, 0x0B33, 0x75CB, 0x1FA3, 0x75CC, 0x1FA4, 0x75CD, 0x0B34,
- 0x75CE, 0x1FA0, 0x75CF, 0x1FA2, 0x75D0, 0x1FA6, 0x75D1, 0x1FA5,
- 0x75D2, 0x1FA1, 0x75D4, 0x0B30, 0x75D5, 0x0B31, 0x75D7, 0x222B,
- 0x75D8, 0x0CEB, 0x75D9, 0x0CEA, 0x75DA, 0x2225, 0x75DB, 0x0CE8,
- 0x75DD, 0x2228, 0x75DE, 0x0CEC, 0x75DF, 0x2229, 0x75E0, 0x0CED,
- 0x75E1, 0x2226, 0x75E2, 0x0CE7, 0x75E3, 0x0CE9, 0x75E4, 0x222A,
- 0x75E6, 0x2227, 0x75E7, 0x2224, 0x75ED, 0x24BB, 0x75EF, 0x24B0,
- 0x75F0, 0x0E88, 0x75F1, 0x0E8B, 0x75F2, 0x0E8A, 0x75F3, 0x0E8F,
- 0x75F4, 0x0E8E, 0x75F5, 0x24BC, 0x75F6, 0x24BA, 0x75F7, 0x24B3,
- 0x75F8, 0x24B7, 0x75F9, 0x24B6, 0x75FA, 0x0E8C, 0x75FB, 0x24B9,
- 0x75FC, 0x24B5, 0x75FD, 0x24BD, 0x75FE, 0x24B4, 0x75FF, 0x0E8D,
- 0x7600, 0x0E87, 0x7601, 0x0E89, 0x7603, 0x24B2, 0x7608, 0x2738,
- 0x7609, 0x1036, 0x760A, 0x273C, 0x760B, 0x1035, 0x760C, 0x2739,
- 0x760D, 0x1034, 0x760F, 0x24B1, 0x7610, 0x24B8, 0x7611, 0x273B,
- 0x7613, 0x1037, 0x7614, 0x273D, 0x7615, 0x273A, 0x7616, 0x2737,
- 0x7619, 0x2982, 0x761A, 0x2986, 0x761B, 0x2988, 0x761C, 0x2984,
- 0x761D, 0x2983, 0x761E, 0x2981, 0x761F, 0x11AE, 0x7620, 0x11AC,
- 0x7621, 0x11B1, 0x7622, 0x11B2, 0x7623, 0x2985, 0x7624, 0x11AF,
- 0x7625, 0x2980, 0x7626, 0x11B0, 0x7627, 0x1033, 0x7628, 0x2987,
- 0x7629, 0x11AD, 0x762D, 0x2BD5, 0x762F, 0x2BD4, 0x7630, 0x2BDC,
- 0x7631, 0x2BD6, 0x7632, 0x2BDB, 0x7633, 0x2BD8, 0x7634, 0x1302,
- 0x7635, 0x2BDA, 0x7638, 0x1303, 0x763A, 0x1304, 0x763C, 0x2BD9,
- 0x763D, 0x2BD7, 0x7642, 0x1415, 0x7643, 0x2DB3, 0x7646, 0x1414,
- 0x7647, 0x2DB6, 0x7648, 0x2DB4, 0x7649, 0x2DB5, 0x764C, 0x1416,
- 0x7650, 0x2F63, 0x7652, 0x14F9, 0x7653, 0x2F64, 0x7656, 0x14F7,
- 0x7657, 0x2F65, 0x7658, 0x14F8, 0x7659, 0x2F62, 0x765A, 0x2F66,
- 0x765C, 0x2F60, 0x765F, 0x159C, 0x7660, 0x30C5, 0x7661, 0x159D,
- 0x7662, 0x1622, 0x7664, 0x2F61, 0x7665, 0x1623, 0x7669, 0x167F,
- 0x766A, 0x32E4, 0x766C, 0x16CE, 0x766D, 0x3395, 0x766E, 0x16CD,
- 0x7670, 0x3428, 0x7671, 0x1723, 0x7672, 0x1724, 0x7675, 0x3543,
- 0x7676, 0x022F, 0x7678, 0x07AA, 0x7679, 0x1B95, 0x767B, 0x0CEE,
- 0x767C, 0x0CEF, 0x767D, 0x0363, 0x767E, 0x03F5, 0x767F, 0x1810,
- 0x7681, 0x18D6, 0x7682, 0x04F4, 0x7684, 0x0659, 0x7686, 0x07AB,
- 0x7687, 0x07AC, 0x7688, 0x07AD, 0x7689, 0x1FA8, 0x768A, 0x1D59,
- 0x768B, 0x0940, 0x768E, 0x0B35, 0x768F, 0x1FA7, 0x7692, 0x222D,
- 0x7693, 0x0CF1, 0x7695, 0x222C, 0x7696, 0x0CF0, 0x7699, 0x24BE,
- 0x769A, 0x11B3, 0x769B, 0x298C, 0x769C, 0x2989, 0x769D, 0x298A,
- 0x769E, 0x298B, 0x76A4, 0x2DB7, 0x76A6, 0x2F67, 0x76AA, 0x31FB,
- 0x76AB, 0x31FA, 0x76AD, 0x3396, 0x76AE, 0x0364, 0x76AF, 0x1A14,
- 0x76B0, 0x0941, 0x76B4, 0x0CF2, 0x76B5, 0x24BF, 0x76B8, 0x273E,
- 0x76BA, 0x11B4, 0x76BB, 0x2BDD, 0x76BD, 0x2F68, 0x76BE, 0x31FC,
- 0x76BF, 0x0365, 0x76C2, 0x065A, 0x76C3, 0x07B0, 0x76C4, 0x1B96,
- 0x76C5, 0x07B1, 0x76C6, 0x07AF, 0x76C8, 0x07AE, 0x76C9, 0x1D5A,
- 0x76CA, 0x0942, 0x76CD, 0x0943, 0x76CE, 0x0944, 0x76D2, 0x0B37,
- 0x76D3, 0x1FA9, 0x76D4, 0x0B36, 0x76DA, 0x222E, 0x76DB, 0x0B38,
- 0x76DC, 0x0CF3, 0x76DD, 0x24C0, 0x76DE, 0x0E90, 0x76DF, 0x0E91,
- 0x76E1, 0x1038, 0x76E3, 0x1039, 0x76E4, 0x11B5, 0x76E5, 0x1306,
- 0x76E6, 0x2BDE, 0x76E7, 0x1305, 0x76E9, 0x2DB8, 0x76EA, 0x1417,
- 0x76EC, 0x2F69, 0x76ED, 0x31FD, 0x76EE, 0x0366, 0x76EF, 0x04F5,
- 0x76F0, 0x1A17, 0x76F1, 0x1A16, 0x76F2, 0x065B, 0x76F3, 0x1A15,
- 0x76F4, 0x065C, 0x76F5, 0x1A18, 0x76F7, 0x1B9C, 0x76F8, 0x07B4,
- 0x76F9, 0x07B3, 0x76FA, 0x1B9E, 0x76FB, 0x1B9D, 0x76FC, 0x07B8,
- 0x76FE, 0x07B7, 0x7701, 0x07B2, 0x7703, 0x1B98, 0x7704, 0x1B99,
- 0x7705, 0x1B9A, 0x7707, 0x07B9, 0x7708, 0x1B97, 0x7709, 0x07B5,
- 0x770A, 0x1B9B, 0x770B, 0x07B6, 0x7710, 0x1D5D, 0x7711, 0x1D61,
- 0x7712, 0x1D5F, 0x7713, 0x1D5E, 0x7715, 0x1D62, 0x7719, 0x1D63,
- 0x771A, 0x1D64, 0x771B, 0x1D5C, 0x771D, 0x1D5B, 0x771F, 0x0946,
- 0x7720, 0x0947, 0x7722, 0x1D65, 0x7723, 0x1D60, 0x7725, 0x1FB2,
- 0x7727, 0x1D66, 0x7728, 0x0948, 0x7729, 0x0945, 0x772D, 0x1FAC,
- 0x772F, 0x1FAB, 0x7731, 0x1FAD, 0x7732, 0x1FAE, 0x7733, 0x1FB0,
- 0x7734, 0x1FAF, 0x7735, 0x1FB4, 0x7736, 0x0B3C, 0x7737, 0x0B39,
- 0x7738, 0x0B3D, 0x7739, 0x1FAA, 0x773A, 0x0B3E, 0x773B, 0x1FB3,
- 0x773C, 0x0B3B, 0x773D, 0x1FB1, 0x773E, 0x0B3A, 0x7744, 0x2231,
- 0x7745, 0x2233, 0x7746, 0x222F, 0x7747, 0x2230, 0x774A, 0x2234,
- 0x774B, 0x2236, 0x774C, 0x2237, 0x774D, 0x2232, 0x774E, 0x2235,
- 0x774F, 0x0CF4, 0x7752, 0x24C4, 0x7754, 0x24C9, 0x7755, 0x24C1,
- 0x7756, 0x24C5, 0x7759, 0x24CA, 0x775A, 0x24C6, 0x775B, 0x0E92,
- 0x775C, 0x0E9A, 0x775E, 0x0E95, 0x775F, 0x24C2, 0x7760, 0x24C3,
- 0x7761, 0x103D, 0x7762, 0x0E9D, 0x7763, 0x0E96, 0x7765, 0x0E9B,
- 0x7766, 0x0E94, 0x7767, 0x24C8, 0x7768, 0x0E9C, 0x7769, 0x24C7,
- 0x776A, 0x0E98, 0x776B, 0x0E93, 0x776C, 0x0E99, 0x776D, 0x24CB,
- 0x776E, 0x2743, 0x776F, 0x2745, 0x7779, 0x0E97, 0x777C, 0x2740,
- 0x777D, 0x103B, 0x777E, 0x2746, 0x777F, 0x103C, 0x7780, 0x2744,
- 0x7781, 0x273F, 0x7782, 0x2742, 0x7783, 0x2747, 0x7784, 0x103A,
- 0x7785, 0x2741, 0x7787, 0x11B7, 0x7788, 0x2990, 0x7789, 0x298F,
- 0x778B, 0x11BA, 0x778C, 0x11B8, 0x778D, 0x298D, 0x778E, 0x11B6,
- 0x778F, 0x298E, 0x7791, 0x11B9, 0x7795, 0x2BE6, 0x7797, 0x2BE8,
- 0x7799, 0x2BE7, 0x779A, 0x2BDF, 0x779B, 0x2BE3, 0x779C, 0x2BE2,
- 0x779D, 0x2BE0, 0x779E, 0x1308, 0x779F, 0x1309, 0x77A0, 0x1307,
- 0x77A1, 0x2BE1, 0x77A2, 0x2BE4, 0x77A3, 0x2BE5, 0x77A5, 0x130A,
- 0x77A7, 0x141C, 0x77A8, 0x2DC0, 0x77AA, 0x1419, 0x77AB, 0x2DBA,
- 0x77AC, 0x141B, 0x77AD, 0x141D, 0x77B0, 0x141A, 0x77B1, 0x2DBF,
- 0x77B2, 0x2DBB, 0x77B3, 0x1418, 0x77B4, 0x2DBE, 0x77B5, 0x2DB9,
- 0x77B6, 0x2DBD, 0x77B7, 0x2DBC, 0x77BA, 0x2F6B, 0x77BB, 0x14FC,
- 0x77BC, 0x14FD, 0x77BD, 0x14FA, 0x77BF, 0x14FB, 0x77C2, 0x2F6A,
- 0x77C4, 0x30C8, 0x77C7, 0x159E, 0x77C9, 0x30C6, 0x77CA, 0x30C7,
- 0x77CC, 0x31FE, 0x77CD, 0x3201, 0x77CE, 0x31FF, 0x77CF, 0x3200,
- 0x77D0, 0x32E5, 0x77D3, 0x1680, 0x77D4, 0x3429, 0x77D5, 0x348F,
- 0x77D7, 0x1725, 0x77D8, 0x34D3, 0x77D9, 0x34D4, 0x77DA, 0x1753,
- 0x77DB, 0x0367, 0x77DC, 0x07BA, 0x77DE, 0x2238, 0x77E0, 0x24CC,
- 0x77E2, 0x0368, 0x77E3, 0x04F6, 0x77E5, 0x065D, 0x77E7, 0x1B9F,
- 0x77E8, 0x1BA0, 0x77E9, 0x0949, 0x77EC, 0x2239, 0x77ED, 0x0CF5,
- 0x77EE, 0x0E9E, 0x77EF, 0x141E, 0x77F0, 0x2DC1, 0x77F1, 0x30C9,
- 0x77F2, 0x3202, 0x77F3, 0x0369, 0x77F7, 0x1A1E, 0x77F8, 0x1A19,
- 0x77F9, 0x1A1B, 0x77FA, 0x1A1D, 0x77FB, 0x1A1C, 0x77FC, 0x1A1A,
- 0x77FD, 0x065E, 0x7802, 0x07BB, 0x7803, 0x1BA9, 0x7805, 0x1BA4,
- 0x7806, 0x1BA1, 0x7809, 0x1BA8, 0x780C, 0x07BD, 0x780D, 0x07BE,
- 0x780E, 0x1BA7, 0x780F, 0x1BA6, 0x7810, 0x1BA5, 0x7811, 0x1BA2,
- 0x7812, 0x1BA3, 0x7813, 0x1BAA, 0x7814, 0x07BC, 0x781D, 0x094D,
- 0x781F, 0x0953, 0x7820, 0x0952, 0x7821, 0x1D6F, 0x7822, 0x1D69,
- 0x7823, 0x1D67, 0x7825, 0x0950, 0x7826, 0x1FBB, 0x7827, 0x094B,
- 0x7828, 0x1D6C, 0x7829, 0x1D70, 0x782A, 0x1D72, 0x782B, 0x1D6E,
- 0x782C, 0x1D68, 0x782D, 0x0951, 0x782E, 0x1D6D, 0x782F, 0x1D6B,
- 0x7830, 0x094A, 0x7831, 0x1D73, 0x7832, 0x0954, 0x7833, 0x1D71,
- 0x7834, 0x094E, 0x7835, 0x1D6A, 0x7837, 0x094F, 0x7838, 0x094C,
- 0x7843, 0x0B40, 0x7845, 0x1FBC, 0x7848, 0x1FB5, 0x7849, 0x1FB7,
- 0x784A, 0x1FB9, 0x784C, 0x1FBA, 0x784D, 0x1FB8, 0x784E, 0x0B41,
- 0x7850, 0x1FBD, 0x7852, 0x1FB6, 0x785C, 0x223D, 0x785D, 0x0CF6,
- 0x785E, 0x2245, 0x7860, 0x223A, 0x7862, 0x2246, 0x7864, 0x223B,
- 0x7865, 0x223C, 0x7868, 0x2244, 0x7869, 0x2243, 0x786A, 0x2240,
- 0x786B, 0x0B3F, 0x786C, 0x0CF7, 0x786D, 0x223E, 0x786E, 0x2241,
- 0x786F, 0x0CF8, 0x7870, 0x2242, 0x7871, 0x223F, 0x7879, 0x24D7,
- 0x787B, 0x24DB, 0x787C, 0x0EA5, 0x787E, 0x274D, 0x787F, 0x0EA8,
- 0x7880, 0x24D9, 0x7881, 0x36E8, 0x7883, 0x24D6, 0x7884, 0x24D1,
- 0x7885, 0x24D3, 0x7886, 0x24D4, 0x7887, 0x24CD, 0x7889, 0x0EA4,
- 0x788C, 0x0EA3, 0x788E, 0x0E9F, 0x788F, 0x24D0, 0x7891, 0x0EA6,
- 0x7893, 0x0EA7, 0x7894, 0x24CF, 0x7895, 0x24D2, 0x7896, 0x24DA,
- 0x7897, 0x0EA1, 0x7898, 0x0EA2, 0x7899, 0x24D8, 0x789A, 0x24CE,
- 0x789E, 0x274F, 0x789F, 0x103F, 0x78A0, 0x2751, 0x78A1, 0x24D5,
- 0x78A2, 0x2753, 0x78A3, 0x1043, 0x78A4, 0x2754, 0x78A5, 0x2750,
- 0x78A7, 0x1040, 0x78A8, 0x274C, 0x78A9, 0x1042, 0x78AA, 0x2749,
- 0x78AB, 0x274E, 0x78AC, 0x2752, 0x78AD, 0x274B, 0x78B0, 0x0EA0,
- 0x78B2, 0x2748, 0x78B3, 0x1041, 0x78B4, 0x274A, 0x78BA, 0x11BD,
- 0x78BB, 0x2992, 0x78BC, 0x11C1, 0x78BE, 0x11BF, 0x78C1, 0x103E,
- 0x78C3, 0x2999, 0x78C4, 0x299A, 0x78C5, 0x11BC, 0x78C8, 0x2998,
- 0x78C9, 0x299B, 0x78CA, 0x11BE, 0x78CB, 0x11BB, 0x78CC, 0x2994,
- 0x78CD, 0x2991, 0x78CE, 0x2996, 0x78CF, 0x2993, 0x78D0, 0x11C2,
- 0x78D1, 0x2995, 0x78D4, 0x2997, 0x78D5, 0x11C0, 0x78DA, 0x130C,
- 0x78DB, 0x2BEF, 0x78DD, 0x2BE9, 0x78DE, 0x2BED, 0x78DF, 0x2BF3,
- 0x78E0, 0x2BF4, 0x78E1, 0x2BF0, 0x78E2, 0x2BF1, 0x78E3, 0x2BEE,
- 0x78E5, 0x2BEB, 0x78E7, 0x130E, 0x78E8, 0x130B, 0x78E9, 0x2BEA,
- 0x78EA, 0x2BEC, 0x78EC, 0x130D, 0x78ED, 0x2BF2, 0x78EF, 0x1422,
- 0x78F2, 0x2DC8, 0x78F3, 0x2DC2, 0x78F4, 0x1421, 0x78F7, 0x141F,
- 0x78F9, 0x2DCA, 0x78FA, 0x1420, 0x78FB, 0x2DC5, 0x78FC, 0x2DC6,
- 0x78FD, 0x2DC3, 0x78FE, 0x2DCB, 0x78FF, 0x2DC7, 0x7901, 0x1423,
- 0x7902, 0x2DC4, 0x7904, 0x2DCC, 0x7905, 0x2DC9, 0x7909, 0x2F6F,
- 0x790C, 0x2F6C, 0x790E, 0x14FE, 0x7910, 0x2F70, 0x7911, 0x2F72,
- 0x7912, 0x2F71, 0x7913, 0x2F6D, 0x7914, 0x2F6E, 0x7917, 0x30CE,
- 0x7919, 0x159F, 0x791B, 0x30CB, 0x791C, 0x30CD, 0x791D, 0x30CA,
- 0x791E, 0x30CF, 0x7921, 0x30CC, 0x7923, 0x3204, 0x7924, 0x3207,
- 0x7925, 0x3203, 0x7926, 0x1624, 0x7927, 0x3205, 0x7928, 0x3206,
- 0x7929, 0x3208, 0x792A, 0x1625, 0x792B, 0x1627, 0x792C, 0x1626,
- 0x792D, 0x32E6, 0x792F, 0x32E8, 0x7931, 0x32E7, 0x7935, 0x3397,
- 0x7938, 0x3490, 0x7939, 0x34D5, 0x793A, 0x036A, 0x793D, 0x18D7,
- 0x793E, 0x065F, 0x793F, 0x1A20, 0x7940, 0x0660, 0x7941, 0x0661,
- 0x7942, 0x1A1F, 0x7944, 0x1BAF, 0x7945, 0x1BAE, 0x7946, 0x07BF,
- 0x7947, 0x07C2, 0x7948, 0x07C1, 0x7949, 0x07C0, 0x794A, 0x1BAB,
- 0x794B, 0x1BAD, 0x794C, 0x1BAC, 0x794F, 0x1D76, 0x7950, 0x0956,
- 0x7951, 0x1D7A, 0x7952, 0x1D79, 0x7953, 0x1D78, 0x7954, 0x1D74,
- 0x7955, 0x0955, 0x7956, 0x0959, 0x7957, 0x095C, 0x795A, 0x095D,
- 0x795B, 0x1D75, 0x795C, 0x1D77, 0x795D, 0x095B, 0x795E, 0x095A,
- 0x795F, 0x0958, 0x7960, 0x0957, 0x7961, 0x1FC4, 0x7963, 0x1FC2,
- 0x7964, 0x1FBE, 0x7965, 0x0B42, 0x7967, 0x1FBF, 0x7968, 0x0B43,
- 0x7969, 0x1FC0, 0x796A, 0x1FC1, 0x796B, 0x1FC3, 0x796D, 0x0B44,
- 0x7970, 0x224A, 0x7972, 0x2249, 0x7973, 0x2248, 0x7974, 0x2247,
- 0x7979, 0x24DF, 0x797A, 0x0EA9, 0x797C, 0x24DC, 0x797D, 0x24DE,
- 0x797F, 0x0EAA, 0x7981, 0x0EAB, 0x7982, 0x24DD, 0x7988, 0x275D,
- 0x798A, 0x2756, 0x798B, 0x2757, 0x798D, 0x1046, 0x798E, 0x1044,
- 0x798F, 0x1045, 0x7990, 0x275F, 0x7992, 0x275E, 0x7993, 0x275B,
- 0x7994, 0x275A, 0x7995, 0x2759, 0x7996, 0x2758, 0x7997, 0x275C,
- 0x7998, 0x2755, 0x799A, 0x299C, 0x799B, 0x29A1, 0x799C, 0x299F,
- 0x79A0, 0x299E, 0x79A1, 0x299D, 0x79A2, 0x29A0, 0x79A4, 0x2BF5,
- 0x79A6, 0x130F, 0x79A7, 0x1424, 0x79A8, 0x2DCE, 0x79AA, 0x1425,
- 0x79AB, 0x2DCD, 0x79AC, 0x2F74, 0x79AD, 0x2F73, 0x79AE, 0x14FF,
- 0x79B0, 0x30D0, 0x79B1, 0x15A0, 0x79B2, 0x3209, 0x79B3, 0x16CF,
- 0x79B4, 0x3398, 0x79B6, 0x3492, 0x79B7, 0x3491, 0x79B8, 0x17B2,
- 0x79B9, 0x07C3, 0x79BA, 0x07C4, 0x79BB, 0x1FC5, 0x79BD, 0x0EAD,
- 0x79BE, 0x036B, 0x79BF, 0x04F9, 0x79C0, 0x04F8, 0x79C1, 0x04F7,
- 0x79C5, 0x1A21, 0x79C8, 0x0663, 0x79C9, 0x0662, 0x79CB, 0x07C7,
- 0x79CD, 0x1BB1, 0x79CE, 0x1BB4, 0x79CF, 0x1BB2, 0x79D1, 0x07C5,
- 0x79D2, 0x07C6, 0x79D5, 0x1BB0, 0x79D6, 0x1BB3, 0x79D8, 0x0964,
- 0x79DC, 0x1D81, 0x79DD, 0x1D83, 0x79DE, 0x1D82, 0x79DF, 0x0961,
- 0x79E0, 0x1D7D, 0x79E3, 0x095F, 0x79E4, 0x095E, 0x79E6, 0x0962,
- 0x79E7, 0x0960, 0x79E9, 0x0963, 0x79EA, 0x1D80, 0x79EB, 0x1D7B,
- 0x79EC, 0x1D7C, 0x79ED, 0x1D7F, 0x79EE, 0x1D7E, 0x79F6, 0x1FC8,
- 0x79F7, 0x1FC9, 0x79F8, 0x1FC7, 0x79FA, 0x1FC6, 0x79FB, 0x0B45,
- 0x7A00, 0x0CFD, 0x7A02, 0x224B, 0x7A03, 0x224D, 0x7A04, 0x224F,
- 0x7A05, 0x0CFC, 0x7A08, 0x0CFA, 0x7A0A, 0x224C, 0x7A0B, 0x0CFB,
- 0x7A0C, 0x224E, 0x7A0D, 0x0CF9, 0x7A10, 0x24E9, 0x7A11, 0x24E0,
- 0x7A12, 0x24E3, 0x7A13, 0x24E7, 0x7A14, 0x0EB1, 0x7A15, 0x24E5,
- 0x7A17, 0x24E4, 0x7A18, 0x24E1, 0x7A19, 0x24E2, 0x7A1A, 0x0EAF,
- 0x7A1B, 0x24E8, 0x7A1C, 0x0EAE, 0x7A1E, 0x0EB3, 0x7A1F, 0x0EB2,
- 0x7A20, 0x0EB0, 0x7A22, 0x24E6, 0x7A26, 0x2765, 0x7A28, 0x2764,
- 0x7A2B, 0x2760, 0x7A2E, 0x1047, 0x7A2F, 0x2763, 0x7A30, 0x2762,
- 0x7A31, 0x1048, 0x7A37, 0x11C7, 0x7A39, 0x29A3, 0x7A3B, 0x11C8,
- 0x7A3C, 0x11C4, 0x7A3D, 0x11C6, 0x7A3F, 0x11C3, 0x7A40, 0x11C5,
- 0x7A44, 0x2BF6, 0x7A46, 0x1312, 0x7A47, 0x2BF8, 0x7A48, 0x2BF7,
- 0x7A4A, 0x2761, 0x7A4B, 0x1314, 0x7A4C, 0x1313, 0x7A4D, 0x1310,
- 0x7A4E, 0x1311, 0x7A54, 0x2DD3, 0x7A56, 0x2DD1, 0x7A57, 0x1426,
- 0x7A58, 0x2DD2, 0x7A5A, 0x2DD4, 0x7A5B, 0x2DD0, 0x7A5C, 0x2DCF,
- 0x7A5F, 0x2F75, 0x7A60, 0x1502, 0x7A61, 0x1500, 0x7A62, 0x1501,
- 0x7A67, 0x30D1, 0x7A68, 0x30D2, 0x7A69, 0x15A2, 0x7A6B, 0x15A1,
- 0x7A6C, 0x320B, 0x7A6D, 0x320C, 0x7A6E, 0x320A, 0x7A70, 0x3399,
- 0x7A71, 0x339A, 0x7A74, 0x036C, 0x7A75, 0x1811, 0x7A76, 0x04FA,
- 0x7A78, 0x1A22, 0x7A79, 0x0665, 0x7A7A, 0x0664, 0x7A7B, 0x1A23,
- 0x7A7E, 0x1BB6, 0x7A7F, 0x07C8, 0x7A80, 0x1BB5, 0x7A81, 0x07C9,
- 0x7A84, 0x0965, 0x7A85, 0x1D86, 0x7A86, 0x1D84, 0x7A87, 0x1D8A,
- 0x7A88, 0x0966, 0x7A89, 0x1D85, 0x7A8A, 0x1D89, 0x7A8B, 0x1D87,
- 0x7A8C, 0x1D88, 0x7A8F, 0x1FCA, 0x7A90, 0x1FCC, 0x7A92, 0x0B46,
- 0x7A94, 0x1FCB, 0x7A95, 0x0B47, 0x7A96, 0x0D00, 0x7A97, 0x0CFF,
- 0x7A98, 0x0CFE, 0x7A99, 0x2250, 0x7A9E, 0x24EC, 0x7A9F, 0x0EB4,
- 0x7AA0, 0x0EB5, 0x7AA2, 0x24EB, 0x7AA3, 0x24EA, 0x7AA8, 0x2766,
- 0x7AA9, 0x104A, 0x7AAA, 0x1049, 0x7AAB, 0x2767, 0x7AAC, 0x2768,
- 0x7AAE, 0x11CA, 0x7AAF, 0x11C9, 0x7AB1, 0x2BFC, 0x7AB2, 0x29A4,
- 0x7AB3, 0x29A6, 0x7AB4, 0x29A5, 0x7AB5, 0x2BFB, 0x7AB6, 0x2BF9,
- 0x7AB7, 0x2BFD, 0x7AB8, 0x2BFA, 0x7ABA, 0x1315, 0x7ABE, 0x2DD5,
- 0x7ABF, 0x1427, 0x7AC0, 0x2DD6, 0x7AC1, 0x2DD7, 0x7AC4, 0x1503,
- 0x7AC5, 0x1504, 0x7AC7, 0x1628, 0x7ACA, 0x16FF, 0x7ACB, 0x036D,
- 0x7AD1, 0x1BB7, 0x7AD8, 0x1D8B, 0x7AD9, 0x0967, 0x7ADF, 0x0BDE,
- 0x7AE0, 0x0BDD, 0x7AE3, 0x0D02, 0x7AE4, 0x2252, 0x7AE5, 0x0D01,
- 0x7AE6, 0x2251, 0x7AEB, 0x24ED, 0x7AED, 0x104B, 0x7AEE, 0x2769,
- 0x7AEF, 0x104C, 0x7AF6, 0x1629, 0x7AF7, 0x320D, 0x7AF9, 0x03F6,
- 0x7AFA, 0x0666, 0x7AFB, 0x1A24, 0x7AFD, 0x07CB, 0x7AFF, 0x07CA,
- 0x7B00, 0x1BB8, 0x7B01, 0x1BB9, 0x7B04, 0x1D8D, 0x7B05, 0x1D8F,
- 0x7B06, 0x0968, 0x7B08, 0x1D91, 0x7B09, 0x1D94, 0x7B0A, 0x1D92,
- 0x7B0E, 0x1D93, 0x7B0F, 0x1D90, 0x7B10, 0x1D8C, 0x7B11, 0x0969,
- 0x7B12, 0x1D95, 0x7B13, 0x1D8E, 0x7B18, 0x1FD5, 0x7B19, 0x0B4D,
- 0x7B1A, 0x1FDE, 0x7B1B, 0x0B4A, 0x7B1D, 0x1FD7, 0x7B1E, 0x0B4E,
- 0x7B20, 0x0B48, 0x7B22, 0x1FD2, 0x7B23, 0x1FDF, 0x7B24, 0x1FD3,
- 0x7B25, 0x1FD0, 0x7B26, 0x0B4C, 0x7B28, 0x0B49, 0x7B2A, 0x1FD6,
- 0x7B2B, 0x1FD9, 0x7B2C, 0x0B4B, 0x7B2D, 0x1FDA, 0x7B2E, 0x0B4F,
- 0x7B2F, 0x1FDB, 0x7B30, 0x1FD1, 0x7B31, 0x1FD8, 0x7B32, 0x1FDC,
- 0x7B33, 0x1FD4, 0x7B34, 0x1FCF, 0x7B35, 0x1FCD, 0x7B38, 0x1FDD,
- 0x7B3B, 0x1FCE, 0x7B40, 0x2259, 0x7B44, 0x2255, 0x7B45, 0x225B,
- 0x7B46, 0x0D05, 0x7B47, 0x2254, 0x7B48, 0x2256, 0x7B49, 0x0D03,
- 0x7B4A, 0x2253, 0x7B4B, 0x0D0A, 0x7B4C, 0x2257, 0x7B4D, 0x0D09,
- 0x7B4E, 0x2258, 0x7B4F, 0x0D0B, 0x7B50, 0x0D06, 0x7B51, 0x0D0C,
- 0x7B52, 0x0D07, 0x7B54, 0x0D08, 0x7B56, 0x0D04, 0x7B58, 0x225A,
- 0x7B60, 0x0EB8, 0x7B61, 0x24F8, 0x7B63, 0x24FB, 0x7B64, 0x24EF,
- 0x7B65, 0x24F4, 0x7B66, 0x24EE, 0x7B67, 0x0EBA, 0x7B69, 0x24F2,
- 0x7B6D, 0x24F0, 0x7B6E, 0x0EB9, 0x7B70, 0x24F7, 0x7B71, 0x24F6,
- 0x7B72, 0x24F3, 0x7B73, 0x24F5, 0x7B74, 0x24F1, 0x7B75, 0x1050,
- 0x7B76, 0x24FA, 0x7B77, 0x0EB6, 0x7B78, 0x24F9, 0x7B82, 0x2779,
- 0x7B84, 0x1057, 0x7B85, 0x2774, 0x7B87, 0x1056, 0x7B88, 0x276A,
- 0x7B8A, 0x276C, 0x7B8B, 0x104F, 0x7B8C, 0x2771, 0x7B8D, 0x2770,
- 0x7B8E, 0x2773, 0x7B8F, 0x1054, 0x7B90, 0x276E, 0x7B91, 0x276D,
- 0x7B94, 0x1053, 0x7B95, 0x104E, 0x7B96, 0x276F, 0x7B97, 0x1051,
- 0x7B98, 0x2775, 0x7B99, 0x2777, 0x7B9B, 0x2772, 0x7B9C, 0x276B,
- 0x7B9D, 0x1052, 0x7BA0, 0x11D2, 0x7BA1, 0x104D, 0x7BA4, 0x2778,
- 0x7BAC, 0x29AA, 0x7BAD, 0x11CB, 0x7BAF, 0x29AC, 0x7BB1, 0x11CC,
- 0x7BB4, 0x11CE, 0x7BB5, 0x29AF, 0x7BB7, 0x29A7, 0x7BB8, 0x1055,
- 0x7BB9, 0x29AD, 0x7BBE, 0x29A9, 0x7BC0, 0x0EB7, 0x7BC1, 0x11D1,
- 0x7BC4, 0x11CD, 0x7BC6, 0x11CF, 0x7BC7, 0x11D0, 0x7BC9, 0x1318,
- 0x7BCA, 0x29AE, 0x7BCB, 0x29A8, 0x7BCC, 0x11D3, 0x7BCE, 0x29AB,
- 0x7BD4, 0x2C07, 0x7BD5, 0x2C02, 0x7BD8, 0x2C0C, 0x7BD9, 0x1316,
- 0x7BDA, 0x2C04, 0x7BDB, 0x131A, 0x7BDC, 0x2C0A, 0x7BDD, 0x2C01,
- 0x7BDE, 0x2BFE, 0x7BDF, 0x2C0D, 0x7BE0, 0x142D, 0x7BE1, 0x131B,
- 0x7BE2, 0x2C09, 0x7BE3, 0x2BFF, 0x7BE4, 0x1319, 0x7BE5, 0x2C03,
- 0x7BE6, 0x131D, 0x7BE7, 0x2C00, 0x7BE8, 0x2C05, 0x7BE9, 0x131C,
- 0x7BEA, 0x2C08, 0x7BEB, 0x2C0B, 0x7BF0, 0x2DE9, 0x7BF1, 0x2DEA,
- 0x7BF2, 0x2DDA, 0x7BF3, 0x2DE1, 0x7BF4, 0x2DDF, 0x7BF7, 0x142B,
- 0x7BF8, 0x2DE6, 0x7BF9, 0x2C06, 0x7BFB, 0x2DDD, 0x7BFD, 0x2DE7,
- 0x7BFE, 0x142A, 0x7BFF, 0x2DDC, 0x7C00, 0x2DDB, 0x7C01, 0x2DE5,
- 0x7C02, 0x2DE2, 0x7C03, 0x2DE4, 0x7C05, 0x2DD8, 0x7C06, 0x2DE8,
- 0x7C07, 0x1428, 0x7C09, 0x2DE3, 0x7C0A, 0x2DEC, 0x7C0B, 0x2DE0,
- 0x7C0C, 0x142C, 0x7C0D, 0x1429, 0x7C0E, 0x2DDE, 0x7C0F, 0x2DD9,
- 0x7C10, 0x2DEB, 0x7C11, 0x1317, 0x7C19, 0x2F78, 0x7C1C, 0x2F76,
- 0x7C1D, 0x2F7C, 0x7C1E, 0x1508, 0x7C1F, 0x2F7A, 0x7C20, 0x2F79,
- 0x7C21, 0x150A, 0x7C22, 0x2F7F, 0x7C23, 0x1509, 0x7C25, 0x2F80,
- 0x7C26, 0x2F7D, 0x7C27, 0x1506, 0x7C28, 0x2F7E, 0x7C29, 0x2F77,
- 0x7C2A, 0x1507, 0x7C2B, 0x1505, 0x7C2C, 0x30D6, 0x7C2D, 0x2F7B,
- 0x7C30, 0x2F81, 0x7C33, 0x30D3, 0x7C37, 0x15A7, 0x7C38, 0x15A5,
- 0x7C39, 0x30D5, 0x7C3B, 0x30D7, 0x7C3C, 0x30D4, 0x7C3D, 0x15A6,
- 0x7C3E, 0x15A3, 0x7C3F, 0x15A4, 0x7C40, 0x15A8, 0x7C43, 0x162B,
- 0x7C45, 0x3212, 0x7C47, 0x3211, 0x7C48, 0x320F, 0x7C49, 0x320E,
- 0x7C4A, 0x3210, 0x7C4C, 0x162A, 0x7C4D, 0x162C, 0x7C50, 0x1681,
- 0x7C53, 0x32EA, 0x7C54, 0x32E9, 0x7C57, 0x339B, 0x7C59, 0x339D,
- 0x7C5A, 0x339F, 0x7C5B, 0x339E, 0x7C5C, 0x339C, 0x7C5F, 0x16D1,
- 0x7C60, 0x16D0, 0x7C63, 0x1701, 0x7C64, 0x1700, 0x7C65, 0x1702,
- 0x7C66, 0x342B, 0x7C67, 0x342A, 0x7C69, 0x34D6, 0x7C6A, 0x3493,
- 0x7C6B, 0x34D7, 0x7C6C, 0x1745, 0x7C6E, 0x1746, 0x7C6F, 0x3507,
- 0x7C72, 0x176B, 0x7C73, 0x03F7, 0x7C75, 0x1A25, 0x7C78, 0x1BBB,
- 0x7C79, 0x1BBC, 0x7C7A, 0x1BBA, 0x7C7D, 0x07CC, 0x7C7F, 0x1BBD,
- 0x7C80, 0x1BBE, 0x7C81, 0x1BBF, 0x7C84, 0x1D96, 0x7C85, 0x1D9C,
- 0x7C88, 0x1D9A, 0x7C89, 0x096A, 0x7C8A, 0x1D98, 0x7C8C, 0x1D99,
- 0x7C8D, 0x1D9B, 0x7C91, 0x1D97, 0x7C92, 0x0B50, 0x7C94, 0x1FE0,
- 0x7C95, 0x0B52, 0x7C96, 0x1FE2, 0x7C97, 0x0B51, 0x7C98, 0x1FE1,
- 0x7C9E, 0x225D, 0x7C9F, 0x0D0D, 0x7CA1, 0x225F, 0x7CA2, 0x225C,
- 0x7CA3, 0x1FE3, 0x7CA5, 0x0D0E, 0x7CA7, 0x36ED, 0x7CA8, 0x225E,
- 0x7CAF, 0x24FE, 0x7CB1, 0x0EBB, 0x7CB2, 0x24FC, 0x7CB3, 0x0EBC,
- 0x7CB4, 0x24FD, 0x7CB5, 0x0EBD, 0x7CB9, 0x1058, 0x7CBA, 0x277D,
- 0x7CBB, 0x277A, 0x7CBC, 0x277C, 0x7CBD, 0x1059, 0x7CBE, 0x105A,
- 0x7CBF, 0x277B, 0x7CC5, 0x29B0, 0x7CC8, 0x29B1, 0x7CCA, 0x11D4,
- 0x7CCB, 0x29B3, 0x7CCC, 0x29B2, 0x7CCE, 0x0121, 0x7CD0, 0x2C11,
- 0x7CD1, 0x2C12, 0x7CD2, 0x2C0E, 0x7CD4, 0x2C0F, 0x7CD5, 0x131E,
- 0x7CD6, 0x131F, 0x7CD7, 0x2C10, 0x7CD9, 0x1433, 0x7CDC, 0x142F,
- 0x7CDD, 0x1434, 0x7CDE, 0x1430, 0x7CDF, 0x1432, 0x7CE0, 0x142E,
- 0x7CE2, 0x1431, 0x7CE7, 0x150B, 0x7CE8, 0x2DED, 0x7CEA, 0x30D9,
- 0x7CEC, 0x30D8, 0x7CEE, 0x3213, 0x7CEF, 0x162D, 0x7CF0, 0x162E,
- 0x7CF1, 0x33A1, 0x7CF2, 0x32EB, 0x7CF4, 0x33A0, 0x7CF6, 0x34D8,
- 0x7CF7, 0x351D, 0x7CF8, 0x03F8, 0x7CFB, 0x04FB, 0x7CFD, 0x1A26,
- 0x7CFE, 0x0667, 0x7D00, 0x07CF, 0x7D01, 0x1BC2, 0x7D02, 0x07CD,
- 0x7D03, 0x1BC0, 0x7D04, 0x07D2, 0x7D05, 0x07CE, 0x7D06, 0x07D3,
- 0x7D07, 0x07D1, 0x7D08, 0x1BC1, 0x7D09, 0x07D0, 0x7D0A, 0x096E,
- 0x7D0B, 0x096D, 0x7D0C, 0x1DA7, 0x7D0D, 0x0976, 0x7D0E, 0x1DA0,
- 0x7D0F, 0x1DA6, 0x7D10, 0x0972, 0x7D11, 0x1D9F, 0x7D12, 0x1DA5,
- 0x7D13, 0x1DA3, 0x7D14, 0x0971, 0x7D15, 0x0973, 0x7D16, 0x1DA2,
- 0x7D17, 0x096C, 0x7D18, 0x1DA1, 0x7D19, 0x0977, 0x7D1A, 0x0974,
- 0x7D1B, 0x0978, 0x7D1C, 0x0975, 0x7D1D, 0x1D9E, 0x7D1E, 0x1D9D,
- 0x7D1F, 0x1DA4, 0x7D20, 0x096F, 0x7D21, 0x096B, 0x7D22, 0x0970,
- 0x7D28, 0x1FF2, 0x7D29, 0x1FEB, 0x7D2B, 0x0D13, 0x7D2C, 0x1FEA,
- 0x7D2E, 0x0B56, 0x7D2F, 0x0B5D, 0x7D30, 0x0B5A, 0x7D31, 0x0B60,
- 0x7D32, 0x0B5F, 0x7D33, 0x0B5B, 0x7D35, 0x1FE4, 0x7D36, 0x1FE7,
- 0x7D38, 0x1FE6, 0x7D39, 0x0B57, 0x7D3A, 0x1FE8, 0x7D3B, 0x1FF1,
- 0x7D3C, 0x0B58, 0x7D3D, 0x1FE5, 0x7D3E, 0x1FEE, 0x7D3F, 0x1FEF,
- 0x7D40, 0x0B59, 0x7D41, 0x1FEC, 0x7D42, 0x0B5E, 0x7D43, 0x0B54,
- 0x7D44, 0x0B5C, 0x7D45, 0x1FE9, 0x7D46, 0x0B53, 0x7D47, 0x1FED,
- 0x7D4A, 0x1FF0, 0x7D4E, 0x2270, 0x7D4F, 0x2267, 0x7D50, 0x0D10,
- 0x7D51, 0x226E, 0x7D52, 0x226B, 0x7D53, 0x2263, 0x7D54, 0x226C,
- 0x7D55, 0x0D12, 0x7D56, 0x2264, 0x7D58, 0x2260, 0x7D5B, 0x0EC3,
- 0x7D5C, 0x2269, 0x7D5E, 0x0D0F, 0x7D5F, 0x226F, 0x7D61, 0x0D16,
- 0x7D62, 0x0D18, 0x7D63, 0x2262, 0x7D66, 0x0D17, 0x7D67, 0x2265,
- 0x7D68, 0x0D11, 0x7D69, 0x226D, 0x7D6A, 0x2266, 0x7D6B, 0x226A,
- 0x7D6D, 0x2268, 0x7D6E, 0x0D14, 0x7D6F, 0x2261, 0x7D70, 0x0D19,
- 0x7D71, 0x0B55, 0x7D72, 0x0D15, 0x7D73, 0x0D1A, 0x7D79, 0x0EBF,
- 0x7D7A, 0x2505, 0x7D7B, 0x2507, 0x7D7C, 0x2509, 0x7D7D, 0x250D,
- 0x7D7F, 0x2503, 0x7D80, 0x2501, 0x7D81, 0x0EC1, 0x7D83, 0x2508,
- 0x7D84, 0x250C, 0x7D85, 0x2504, 0x7D86, 0x2500, 0x7D88, 0x24FF,
- 0x7D8C, 0x250A, 0x7D8D, 0x2502, 0x7D8E, 0x2506, 0x7D8F, 0x0EC2,
- 0x7D91, 0x0EC0, 0x7D92, 0x250E, 0x7D93, 0x0EBE, 0x7D94, 0x250B,
- 0x7D96, 0x278E, 0x7D9C, 0x105D, 0x7D9D, 0x2786, 0x7D9E, 0x11E1,
- 0x7D9F, 0x2790, 0x7DA0, 0x1060, 0x7DA1, 0x2794, 0x7DA2, 0x1066,
- 0x7DA3, 0x2781, 0x7DA6, 0x2791, 0x7DA7, 0x277E, 0x7DA9, 0x2793,
- 0x7DAA, 0x2782, 0x7DAC, 0x106D, 0x7DAD, 0x106A, 0x7DAE, 0x2792,
- 0x7DAF, 0x278C, 0x7DB0, 0x105C, 0x7DB1, 0x1064, 0x7DB2, 0x1063,
- 0x7DB4, 0x1062, 0x7DB5, 0x1068, 0x7DB7, 0x277F, 0x7DB8, 0x1069,
- 0x7DB9, 0x278D, 0x7DBA, 0x1065, 0x7DBB, 0x105B, 0x7DBC, 0x278F,
- 0x7DBD, 0x105E, 0x7DBE, 0x105F, 0x7DBF, 0x1067, 0x7DC0, 0x2784,
- 0x7DC1, 0x2783, 0x7DC2, 0x2780, 0x7DC4, 0x2788, 0x7DC5, 0x2785,
- 0x7DC6, 0x2789, 0x7DC7, 0x106C, 0x7DC9, 0x2795, 0x7DCA, 0x1061,
- 0x7DCB, 0x278A, 0x7DCC, 0x278B, 0x7DCE, 0x2787, 0x7DD2, 0x106B,
- 0x7DD7, 0x29B8, 0x7DD8, 0x11D9, 0x7DD9, 0x11E2, 0x7DDA, 0x11DE,
- 0x7DDB, 0x29B5, 0x7DDD, 0x11DB, 0x7DDE, 0x11DF, 0x7DDF, 0x29C1,
- 0x7DE0, 0x11D5, 0x7DE1, 0x29B9, 0x7DE3, 0x11DD, 0x7DE6, 0x29BC,
- 0x7DE7, 0x29B7, 0x7DE8, 0x11DC, 0x7DE9, 0x11E0, 0x7DEA, 0x29B6,
- 0x7DEC, 0x11DA, 0x7DEE, 0x29C0, 0x7DEF, 0x11D7, 0x7DF0, 0x29BF,
- 0x7DF1, 0x29BE, 0x7DF2, 0x11E3, 0x7DF3, 0x28C8, 0x7DF4, 0x11D6,
- 0x7DF6, 0x29BD, 0x7DF7, 0x29B4, 0x7DF9, 0x11E4, 0x7DFA, 0x29BB,
- 0x7DFB, 0x11D8, 0x7E03, 0x29BA, 0x7E08, 0x1322, 0x7E09, 0x1327,
- 0x7E0A, 0x1320, 0x7E0B, 0x2C1F, 0x7E0C, 0x2C16, 0x7E0D, 0x2C22,
- 0x7E0E, 0x2C1A, 0x7E0F, 0x2C20, 0x7E10, 0x1328, 0x7E11, 0x1321,
- 0x7E12, 0x2C13, 0x7E13, 0x2C19, 0x7E14, 0x2C23, 0x7E15, 0x2C1C,
- 0x7E16, 0x2C21, 0x7E17, 0x2C15, 0x7E1A, 0x2C1D, 0x7E1B, 0x1323,
- 0x7E1C, 0x2C1B, 0x7E1D, 0x1326, 0x7E1E, 0x1325, 0x7E1F, 0x2C17,
- 0x7E20, 0x2C18, 0x7E21, 0x2C14, 0x7E22, 0x2C1E, 0x7E23, 0x1324,
- 0x7E24, 0x2C25, 0x7E25, 0x2C24, 0x7E29, 0x2DF8, 0x7E2A, 0x2DF4,
- 0x7E2B, 0x143B, 0x7E2D, 0x2DEE, 0x7E2E, 0x1435, 0x7E2F, 0x1445,
- 0x7E30, 0x2DFA, 0x7E31, 0x143D, 0x7E32, 0x1439, 0x7E33, 0x2DF1,
- 0x7E34, 0x1440, 0x7E35, 0x1443, 0x7E36, 0x2DFC, 0x7E37, 0x1438,
- 0x7E38, 0x2DF3, 0x7E39, 0x1441, 0x7E3A, 0x2DFE, 0x7E3B, 0x2DFB,
- 0x7E3C, 0x2DEF, 0x7E3D, 0x143C, 0x7E3E, 0x1436, 0x7E3F, 0x1444,
- 0x7E40, 0x2DF6, 0x7E41, 0x143F, 0x7E42, 0x2DF0, 0x7E43, 0x143A,
- 0x7E44, 0x2DFD, 0x7E45, 0x143E, 0x7E46, 0x1437, 0x7E47, 0x2DF7,
- 0x7E48, 0x1442, 0x7E49, 0x2DF5, 0x7E4C, 0x2DF9, 0x7E50, 0x2F83,
- 0x7E51, 0x2F89, 0x7E52, 0x1511, 0x7E53, 0x2F8C, 0x7E54, 0x150C,
- 0x7E55, 0x150D, 0x7E56, 0x2F84, 0x7E57, 0x2F8B, 0x7E58, 0x2F86,
- 0x7E59, 0x1512, 0x7E5A, 0x150F, 0x7E5C, 0x2F82, 0x7E5E, 0x150E,
- 0x7E5F, 0x2F88, 0x7E60, 0x2F8A, 0x7E61, 0x1510, 0x7E62, 0x2F87,
- 0x7E63, 0x2F85, 0x7E68, 0x30E3, 0x7E69, 0x15AC, 0x7E6A, 0x15AD,
- 0x7E6B, 0x15A9, 0x7E6D, 0x15AA, 0x7E6F, 0x30DF, 0x7E70, 0x30DD,
- 0x7E72, 0x30E1, 0x7E73, 0x15AE, 0x7E74, 0x30E2, 0x7E75, 0x30DB,
- 0x7E76, 0x30DA, 0x7E77, 0x30DE, 0x7E78, 0x30DC, 0x7E79, 0x15AB,
- 0x7E7A, 0x30E0, 0x7E7B, 0x3214, 0x7E7C, 0x1631, 0x7E7D, 0x1630,
- 0x7E7E, 0x3215, 0x7E80, 0x3217, 0x7E81, 0x3216, 0x7E82, 0x1632,
- 0x7E86, 0x32F0, 0x7E87, 0x32ED, 0x7E88, 0x32EE, 0x7E8A, 0x32EC,
- 0x7E8B, 0x32EF, 0x7E8C, 0x1683, 0x7E8D, 0x32F1, 0x7E8F, 0x1682,
- 0x7E91, 0x33A2, 0x7E93, 0x1703, 0x7E94, 0x1705, 0x7E95, 0x342C,
- 0x7E96, 0x1704, 0x7E97, 0x3494, 0x7E98, 0x34DA, 0x7E99, 0x34DC,
- 0x7E9A, 0x34D9, 0x7E9B, 0x34DB, 0x7E9C, 0x1759, 0x7F36, 0x03F9,
- 0x7F38, 0x07D4, 0x7F39, 0x1D1F, 0x7F3A, 0x0979, 0x7F3D, 0x0B61,
- 0x7F3E, 0x2271, 0x7F3F, 0x2272, 0x7F43, 0x2C26, 0x7F44, 0x1446,
- 0x7F45, 0x2DFF, 0x7F48, 0x1513, 0x7F4A, 0x30E5, 0x7F4B, 0x30E4,
- 0x7F4C, 0x1633, 0x7F4D, 0x32F2, 0x7F4F, 0x33A3, 0x7F50, 0x1726,
- 0x7F51, 0x1812, 0x7F54, 0x0668, 0x7F55, 0x04FC, 0x7F58, 0x1BC3,
- 0x7F5B, 0x1DAD, 0x7F5C, 0x1DA8, 0x7F5D, 0x1DAC, 0x7F5E, 0x1DAA,
- 0x7F5F, 0x097A, 0x7F60, 0x1DAB, 0x7F61, 0x1DA9, 0x7F63, 0x1FF3,
- 0x7F65, 0x2273, 0x7F66, 0x2274, 0x7F67, 0x2511, 0x7F68, 0x2512,
- 0x7F69, 0x0EC5, 0x7F6A, 0x0EC6, 0x7F6B, 0x2510, 0x7F6C, 0x2513,
- 0x7F6D, 0x250F, 0x7F6E, 0x0EC4, 0x7F70, 0x106E, 0x7F72, 0x0EC7,
- 0x7F73, 0x2796, 0x7F75, 0x11E5, 0x7F76, 0x29C2, 0x7F77, 0x11E6,
- 0x7F79, 0x1329, 0x7F7A, 0x2C29, 0x7F7B, 0x2C27, 0x7F7C, 0x2C28,
- 0x7F7D, 0x2E02, 0x7F7E, 0x2E01, 0x7F7F, 0x2E00, 0x7F83, 0x30E6,
- 0x7F85, 0x15AF, 0x7F86, 0x30E7, 0x7F87, 0x33A4, 0x7F88, 0x1727,
- 0x7F89, 0x3495, 0x7F8A, 0x03FA, 0x7F8B, 0x066A, 0x7F8C, 0x0669,
- 0x7F8D, 0x1BC5, 0x7F8E, 0x07D5, 0x7F91, 0x1BC4, 0x7F92, 0x1DAF,
- 0x7F94, 0x097B, 0x7F95, 0x1FF4, 0x7F96, 0x1DAE, 0x7F9A, 0x0B63,
- 0x7F9B, 0x1FF7, 0x7F9C, 0x1FF5, 0x7F9D, 0x1FF6, 0x7F9E, 0x0B62,
- 0x7FA0, 0x2276, 0x7FA1, 0x2277, 0x7FA2, 0x2275, 0x7FA4, 0x0ECA,
- 0x7FA5, 0x2515, 0x7FA6, 0x2514, 0x7FA7, 0x2516, 0x7FA8, 0x0EC9,
- 0x7FA9, 0x0EC8, 0x7FAC, 0x29C3, 0x7FAD, 0x29C5, 0x7FAF, 0x11E7,
- 0x7FB0, 0x29C4, 0x7FB1, 0x2C2A, 0x7FB2, 0x132A, 0x7FB3, 0x2F8E,
- 0x7FB5, 0x2F8D, 0x7FB6, 0x15B0, 0x7FB7, 0x30E8, 0x7FB8, 0x15B2,
- 0x7FB9, 0x15B1, 0x7FBA, 0x3218, 0x7FBB, 0x32F3, 0x7FBC, 0x1684,
- 0x7FBD, 0x03FB, 0x7FBE, 0x1BC6, 0x7FBF, 0x07D6, 0x7FC0, 0x1DB2,
- 0x7FC1, 0x097D, 0x7FC2, 0x1DB1, 0x7FC3, 0x1DB0, 0x7FC5, 0x097C,
- 0x7FC7, 0x1FFD, 0x7FC9, 0x1FFF, 0x7FCA, 0x1FF8, 0x7FCB, 0x1FF9,
- 0x7FCC, 0x0B64, 0x7FCD, 0x1FFA, 0x7FCE, 0x0B65, 0x7FCF, 0x1FFE,
- 0x7FD0, 0x1FFB, 0x7FD1, 0x1FFC, 0x7FD2, 0x0B66, 0x7FD4, 0x0D1C,
- 0x7FD5, 0x0D1D, 0x7FD7, 0x2278, 0x7FDB, 0x2517, 0x7FDC, 0x2518,
- 0x7FDE, 0x279A, 0x7FDF, 0x1071, 0x7FE0, 0x106F, 0x7FE1, 0x1070,
- 0x7FE2, 0x2797, 0x7FE3, 0x2798, 0x7FE5, 0x2799, 0x7FE6, 0x29CA,
- 0x7FE8, 0x29CB, 0x7FE9, 0x11E8, 0x7FEA, 0x29C8, 0x7FEB, 0x29C7,
- 0x7FEC, 0x29C9, 0x7FED, 0x29C6, 0x7FEE, 0x132D, 0x7FEF, 0x2C2B,
- 0x7FF0, 0x132B, 0x7FF1, 0x132C, 0x7FF2, 0x2E04, 0x7FF3, 0x1447,
- 0x7FF4, 0x2E03, 0x7FF5, 0x2EFF, 0x7FF7, 0x2F8F, 0x7FF8, 0x2F90,
- 0x7FF9, 0x1514, 0x7FFB, 0x1515, 0x7FFC, 0x1448, 0x7FFD, 0x30E9,
- 0x7FFE, 0x30EA, 0x7FFF, 0x3219, 0x8000, 0x1634, 0x8001, 0x03FC,
- 0x8003, 0x03FD, 0x8004, 0x097F, 0x8005, 0x066B, 0x8006, 0x097E,
- 0x8007, 0x1BC7, 0x800B, 0x0D1E, 0x800C, 0x03FE, 0x800D, 0x07D8,
- 0x800E, 0x1BC8, 0x800F, 0x1BC9, 0x8010, 0x07D7, 0x8011, 0x07D9,
- 0x8012, 0x03FF, 0x8014, 0x1BCA, 0x8015, 0x0981, 0x8016, 0x1DB3,
- 0x8017, 0x0983, 0x8018, 0x0980, 0x8019, 0x0982, 0x801B, 0x2002,
- 0x801C, 0x0B67, 0x801E, 0x2001, 0x801F, 0x2000, 0x8021, 0x2519,
- 0x8024, 0x279B, 0x8026, 0x11E9, 0x8028, 0x132E, 0x8029, 0x2C2D,
- 0x802A, 0x2C2C, 0x802C, 0x2E05, 0x8030, 0x32F4, 0x8033, 0x0400,
- 0x8034, 0x18D8, 0x8035, 0x1A27, 0x8036, 0x07DA, 0x8037, 0x1BCB,
- 0x8039, 0x1DB5, 0x803D, 0x0984, 0x803E, 0x1DB4, 0x803F, 0x0985,
- 0x8043, 0x2004, 0x8046, 0x0B69, 0x8047, 0x2003, 0x8048, 0x2005,
- 0x804A, 0x0B68, 0x804F, 0x227A, 0x8050, 0x227B, 0x8051, 0x2279,
- 0x8052, 0x0D1F, 0x8056, 0x0ECB, 0x8058, 0x0ECC, 0x805A, 0x1073,
- 0x805C, 0x279D, 0x805D, 0x279C, 0x805E, 0x1072, 0x8064, 0x29CC,
- 0x8067, 0x29CD, 0x806C, 0x2C2E, 0x806F, 0x144C, 0x8070, 0x144B,
- 0x8071, 0x1449, 0x8072, 0x144A, 0x8073, 0x144D, 0x8075, 0x2F91,
- 0x8076, 0x1517, 0x8077, 0x1516, 0x8078, 0x30EB, 0x8079, 0x321A,
- 0x807D, 0x16D3, 0x807E, 0x16D2, 0x807F, 0x0401, 0x8082, 0x1CEC,
- 0x8084, 0x0ECE, 0x8085, 0x0D20, 0x8086, 0x0ECD, 0x8087, 0x1074,
- 0x8089, 0x0402, 0x808A, 0x17B3, 0x808B, 0x0403, 0x808C, 0x0404,
- 0x808F, 0x1A28, 0x8090, 0x18DB, 0x8092, 0x18DC, 0x8093, 0x04FE,
- 0x8095, 0x18D9, 0x8096, 0x04FD, 0x8098, 0x0500, 0x8099, 0x18DA,
- 0x809A, 0x0502, 0x809B, 0x0501, 0x809C, 0x18DD, 0x809D, 0x04FF,
- 0x80A1, 0x0670, 0x80A2, 0x066E, 0x80A3, 0x1A2A, 0x80A5, 0x066D,
- 0x80A9, 0x0672, 0x80AA, 0x0674, 0x80AB, 0x0671, 0x80AD, 0x1A2D,
- 0x80AE, 0x1A29, 0x80AF, 0x0675, 0x80B1, 0x066F, 0x80B2, 0x0503,
- 0x80B4, 0x0673, 0x80B5, 0x1A2C, 0x80B8, 0x1A2B, 0x80BA, 0x066C,
- 0x80C2, 0x1BD1, 0x80C3, 0x07DE, 0x80C4, 0x07DF, 0x80C5, 0x1BD3,
- 0x80C7, 0x1BCD, 0x80C8, 0x1BD0, 0x80C9, 0x1BD9, 0x80CA, 0x1BD7,
- 0x80CC, 0x07E0, 0x80CD, 0x1BDD, 0x80CE, 0x07E3, 0x80CF, 0x1BDA,
- 0x80D0, 0x1BD2, 0x80D1, 0x1BCF, 0x80D4, 0x227D, 0x80D5, 0x1BD8,
- 0x80D6, 0x07DB, 0x80D7, 0x1BDB, 0x80D8, 0x1BCC, 0x80D9, 0x1BD5,
- 0x80DA, 0x07DD, 0x80DB, 0x07E2, 0x80DC, 0x1BD6, 0x80DD, 0x07E6,
- 0x80DE, 0x07E4, 0x80E0, 0x1BCE, 0x80E1, 0x07E1, 0x80E3, 0x1BD4,
- 0x80E4, 0x07E5, 0x80E5, 0x07DC, 0x80E6, 0x1BDC, 0x80ED, 0x098A,
- 0x80EF, 0x0993, 0x80F0, 0x0988, 0x80F1, 0x0986, 0x80F2, 0x1DB7,
- 0x80F3, 0x098E, 0x80F4, 0x098B, 0x80F5, 0x1DB9, 0x80F8, 0x098D,
- 0x80F9, 0x1DB8, 0x80FA, 0x1DB6, 0x80FB, 0x1DBB, 0x80FC, 0x0992,
- 0x80FD, 0x0990, 0x80FE, 0x227C, 0x8100, 0x1DBC, 0x8101, 0x1DBA,
- 0x8102, 0x0987, 0x8105, 0x0989, 0x8106, 0x098C, 0x8108, 0x098F,
- 0x810A, 0x0991, 0x8115, 0x200F, 0x8116, 0x0B6B, 0x8118, 0x2006,
- 0x8119, 0x2008, 0x811B, 0x2009, 0x811D, 0x2011, 0x811E, 0x200D,
- 0x811F, 0x200B, 0x8121, 0x200E, 0x8122, 0x2012, 0x8123, 0x0B6C,
- 0x8124, 0x0B70, 0x8125, 0x2007, 0x8127, 0x2010, 0x8129, 0x0B6E,
- 0x812B, 0x0B6D, 0x812C, 0x200C, 0x812D, 0x200A, 0x812F, 0x0B6A,
- 0x8130, 0x0B6F, 0x8139, 0x0D26, 0x813A, 0x2285, 0x813D, 0x2283,
- 0x813E, 0x0D28, 0x8143, 0x227E, 0x8144, 0x2527, 0x8146, 0x0D27,
- 0x8147, 0x2282, 0x814A, 0x227F, 0x814B, 0x0D23, 0x814C, 0x0D29,
- 0x814D, 0x2284, 0x814E, 0x0D25, 0x814F, 0x2281, 0x8150, 0x1075,
- 0x8151, 0x0D24, 0x8152, 0x2280, 0x8153, 0x0D2A, 0x8154, 0x0D22,
- 0x8155, 0x0D21, 0x815B, 0x251F, 0x815C, 0x251D, 0x815E, 0x2523,
- 0x8160, 0x251B, 0x8161, 0x2528, 0x8162, 0x2520, 0x8164, 0x251A,
- 0x8165, 0x0ED2, 0x8166, 0x0ED8, 0x8167, 0x2525, 0x8169, 0x251E,
- 0x816B, 0x0ED5, 0x816E, 0x0ED3, 0x816F, 0x2526, 0x8170, 0x0ED0,
- 0x8171, 0x0ECF, 0x8172, 0x2521, 0x8173, 0x0ED4, 0x8174, 0x0D2B,
- 0x8176, 0x2524, 0x8177, 0x251C, 0x8178, 0x0ED1, 0x8179, 0x0ED6,
- 0x817A, 0x0ED7, 0x817F, 0x107A, 0x8180, 0x1076, 0x8182, 0x107B,
- 0x8183, 0x27A0, 0x8186, 0x279F, 0x8187, 0x27A1, 0x8188, 0x1078,
- 0x8189, 0x279E, 0x818A, 0x1079, 0x818B, 0x27A4, 0x818C, 0x27A3,
- 0x818D, 0x27A2, 0x818F, 0x1077, 0x8195, 0x29D1, 0x8197, 0x29D4,
- 0x8198, 0x11EF, 0x8199, 0x29D3, 0x819A, 0x11EE, 0x819B, 0x11EA,
- 0x819C, 0x11EB, 0x819D, 0x11EC, 0x819E, 0x29D0, 0x819F, 0x29CF,
- 0x81A0, 0x11ED, 0x81A2, 0x29D2, 0x81A3, 0x29CE, 0x81A6, 0x2C30,
- 0x81A7, 0x2C3A, 0x81A8, 0x1331, 0x81A9, 0x1330, 0x81AB, 0x2C34,
- 0x81AC, 0x2C36, 0x81AE, 0x2C31, 0x81B0, 0x2C35, 0x81B1, 0x2C2F,
- 0x81B2, 0x2C38, 0x81B3, 0x132F, 0x81B4, 0x2C37, 0x81B5, 0x2C33,
- 0x81B7, 0x2C39, 0x81B9, 0x2C32, 0x81BA, 0x1450, 0x81BB, 0x2E06,
- 0x81BC, 0x2E0C, 0x81BD, 0x1454, 0x81BE, 0x1456, 0x81BF, 0x1453,
- 0x81C0, 0x1452, 0x81C2, 0x1451, 0x81C3, 0x144F, 0x81C4, 0x2E07,
- 0x81C5, 0x2E0A, 0x81C6, 0x144E, 0x81C7, 0x2E0B, 0x81C9, 0x1455,
- 0x81CA, 0x2E09, 0x81CC, 0x2E08, 0x81CD, 0x1518, 0x81CF, 0x1519,
- 0x81D0, 0x2F94, 0x81D1, 0x2F92, 0x81D2, 0x2F93, 0x81D5, 0x30ED,
- 0x81D7, 0x30EC, 0x81D8, 0x15B3, 0x81D9, 0x321C, 0x81DA, 0x1635,
- 0x81DB, 0x321B, 0x81DD, 0x32F5, 0x81DE, 0x33A5, 0x81DF, 0x16D4,
- 0x81E0, 0x34DD, 0x81E1, 0x34DE, 0x81E2, 0x1706, 0x81E3, 0x0405,
- 0x81E5, 0x0676, 0x81E6, 0x2286, 0x81E7, 0x107C, 0x81E8, 0x1457,
- 0x81E9, 0x2E0D, 0x81EA, 0x0406, 0x81EC, 0x0995, 0x81ED, 0x0994,
- 0x81EE, 0x2287, 0x81F2, 0x2C3B, 0x81F3, 0x0407, 0x81F4, 0x07E7,
- 0x81F7, 0x2288, 0x81F8, 0x2289, 0x81F9, 0x228A, 0x81FA, 0x107D,
- 0x81FB, 0x1332, 0x81FC, 0x0408, 0x81FE, 0x0677, 0x81FF, 0x1BDE,
- 0x8200, 0x0996, 0x8201, 0x1DBD, 0x8202, 0x0B71, 0x8204, 0x228B,
- 0x8205, 0x0ED9, 0x8207, 0x107E, 0x8208, 0x1333, 0x8209, 0x1458,
- 0x820A, 0x151A, 0x820B, 0x30EE, 0x820C, 0x0409, 0x820D, 0x0678,
- 0x8210, 0x0997, 0x8211, 0x2013, 0x8212, 0x0D2C, 0x8214, 0x107F,
- 0x8215, 0x27A5, 0x8216, 0x29D5, 0x821B, 0x040A, 0x821C, 0x0D2D,
- 0x821D, 0x2529, 0x821E, 0x1080, 0x821F, 0x040B, 0x8220, 0x1A2E,
- 0x8221, 0x1BDF, 0x8222, 0x07E8, 0x8225, 0x1DBF, 0x8228, 0x099A,
- 0x822A, 0x0998, 0x822B, 0x0999, 0x822C, 0x099B, 0x822F, 0x1DBE,
- 0x8232, 0x2018, 0x8233, 0x2015, 0x8234, 0x2017, 0x8235, 0x0B72,
- 0x8236, 0x0B74, 0x8237, 0x0B73, 0x8238, 0x2014, 0x8239, 0x0B75,
- 0x823A, 0x2016, 0x823C, 0x228C, 0x823D, 0x228D, 0x823F, 0x228E,
- 0x8240, 0x252C, 0x8242, 0x252D, 0x8244, 0x252B, 0x8245, 0x252E,
- 0x8247, 0x0EDA, 0x8249, 0x252A, 0x824B, 0x1081, 0x824E, 0x29DA,
- 0x824F, 0x29D6, 0x8250, 0x29D9, 0x8251, 0x29DB, 0x8252, 0x29D8,
- 0x8253, 0x29D7, 0x8255, 0x2C3C, 0x8256, 0x2C3D, 0x8257, 0x2C3E,
- 0x8258, 0x1334, 0x8259, 0x1335, 0x825A, 0x2E0F, 0x825B, 0x2E0E,
- 0x825C, 0x2E10, 0x825E, 0x2F96, 0x825F, 0x2F95, 0x8261, 0x30F0,
- 0x8263, 0x30F1, 0x8264, 0x30EF, 0x8266, 0x1636, 0x8268, 0x321D,
- 0x8269, 0x321E, 0x826B, 0x33A6, 0x826C, 0x342D, 0x826D, 0x3496,
- 0x826E, 0x040C, 0x826F, 0x0504, 0x8271, 0x1459, 0x8272, 0x040D,
- 0x8274, 0x2019, 0x8275, 0x228F, 0x8277, 0x172E, 0x8278, 0x1813,
- 0x827C, 0x1814, 0x827D, 0x1816, 0x827E, 0x040E, 0x827F, 0x1817,
- 0x8280, 0x1815, 0x8283, 0x18E5, 0x8284, 0x18E6, 0x8285, 0x18E0,
- 0x828A, 0x18E4, 0x828B, 0x0506, 0x828D, 0x0507, 0x828E, 0x18E1,
- 0x828F, 0x18DF, 0x8290, 0x18DE, 0x8291, 0x18E2, 0x8292, 0x0505,
- 0x8293, 0x18E3, 0x8294, 0x1BE0, 0x8298, 0x1A33, 0x8299, 0x067B,
- 0x829A, 0x1A32, 0x829B, 0x1A34, 0x829D, 0x067A, 0x829E, 0x1A39,
- 0x829F, 0x067E, 0x82A0, 0x1A2F, 0x82A1, 0x1A3D, 0x82A2, 0x1A43,
- 0x82A3, 0x0685, 0x82A4, 0x1A40, 0x82A5, 0x0682, 0x82A7, 0x1A36,
- 0x82A8, 0x1A3C, 0x82A9, 0x1A3E, 0x82AB, 0x1A31, 0x82AC, 0x0681,
- 0x82AD, 0x067C, 0x82AE, 0x1A37, 0x82AF, 0x0683, 0x82B0, 0x0686,
- 0x82B1, 0x0680, 0x82B3, 0x0679, 0x82B4, 0x1A3B, 0x82B5, 0x1A35,
- 0x82B6, 0x1A42, 0x82B7, 0x0688, 0x82B8, 0x0684, 0x82B9, 0x067F,
- 0x82BA, 0x1A3A, 0x82BB, 0x099C, 0x82BC, 0x1A38, 0x82BD, 0x067D,
- 0x82BE, 0x0687, 0x82C0, 0x1A30, 0x82C2, 0x1A3F, 0x82C3, 0x1A41,
- 0x82D1, 0x07F9, 0x82D2, 0x07F3, 0x82D3, 0x07FB, 0x82D4, 0x07F8,
- 0x82D5, 0x1BE7, 0x82D6, 0x1BEA, 0x82D7, 0x07F4, 0x82D9, 0x1BE1,
- 0x82DB, 0x07ED, 0x82DC, 0x07F7, 0x82DE, 0x07FA, 0x82DF, 0x07FC,
- 0x82E0, 0x1BF6, 0x82E1, 0x1BED, 0x82E3, 0x07EC, 0x82E4, 0x1BF5,
- 0x82E5, 0x07F0, 0x82E6, 0x07EE, 0x82E7, 0x07E9, 0x82E8, 0x1BE5,
- 0x82EA, 0x1BF4, 0x82EB, 0x1BE9, 0x82EC, 0x1BEC, 0x82ED, 0x1BF9,
- 0x82EF, 0x07FD, 0x82F0, 0x1BF3, 0x82F1, 0x07F5, 0x82F2, 0x1BEE,
- 0x82F3, 0x1BF8, 0x82F4, 0x1BEB, 0x82F5, 0x1BEF, 0x82F6, 0x1BF2,
- 0x82F9, 0x1BE3, 0x82FA, 0x1BF7, 0x82FB, 0x1BF1, 0x82FE, 0x1BE2,
- 0x8300, 0x1BE6, 0x8301, 0x07F6, 0x8302, 0x07F1, 0x8303, 0x07EA,
- 0x8304, 0x07EF, 0x8305, 0x07EB, 0x8306, 0x07FE, 0x8307, 0x1BE4,
- 0x8308, 0x1DD0, 0x8309, 0x07F2, 0x830C, 0x1BF0, 0x830D, 0x1A7D,
- 0x8316, 0x1DD3, 0x8317, 0x09AA, 0x8319, 0x1DC3, 0x831B, 0x1DCE,
- 0x831C, 0x1DCA, 0x831E, 0x1DDD, 0x8320, 0x1DD5, 0x8322, 0x1DCB,
- 0x8324, 0x1DD4, 0x8325, 0x1DC5, 0x8326, 0x1DC9, 0x8327, 0x1DE0,
- 0x8328, 0x09AD, 0x8329, 0x1DD8, 0x832A, 0x1DCF, 0x832B, 0x099D,
- 0x832C, 0x1DDE, 0x832D, 0x1DC1, 0x832F, 0x1DD7, 0x8331, 0x09AC,
- 0x8332, 0x09A7, 0x8333, 0x1DC0, 0x8334, 0x09A5, 0x8335, 0x09A4,
- 0x8336, 0x09A9, 0x8337, 0x1DD6, 0x8338, 0x09A1, 0x8339, 0x09A8,
- 0x833A, 0x1BE8, 0x833B, 0x2290, 0x833C, 0x1DD1, 0x833F, 0x1DC7,
- 0x8340, 0x09AB, 0x8341, 0x1DC8, 0x8342, 0x1DCC, 0x8343, 0x09AE,
- 0x8344, 0x1DC2, 0x8345, 0x1DDA, 0x8347, 0x1DD9, 0x8348, 0x1DE1,
- 0x8349, 0x09A3, 0x834A, 0x09A0, 0x834B, 0x1DDF, 0x834C, 0x1DDB,
- 0x834D, 0x1DD2, 0x834E, 0x1DCD, 0x834F, 0x09A6, 0x8350, 0x09A2,
- 0x8351, 0x1DC4, 0x8352, 0x099E, 0x8353, 0x1DDC, 0x8354, 0x099F,
- 0x8356, 0x1DC6, 0x8373, 0x201F, 0x8374, 0x2021, 0x8375, 0x2026,
- 0x8376, 0x203A, 0x8377, 0x0B83, 0x8378, 0x0B79, 0x837A, 0x201E,
- 0x837B, 0x0B84, 0x837C, 0x0B85, 0x837D, 0x2029, 0x837E, 0x2030,
- 0x837F, 0x2036, 0x8381, 0x2023, 0x8383, 0x202A, 0x8386, 0x0B86,
- 0x8387, 0x2038, 0x8388, 0x2033, 0x8389, 0x0B81, 0x838A, 0x0B7F,
- 0x838B, 0x202F, 0x838C, 0x202B, 0x838D, 0x201D, 0x838E, 0x0B76,
- 0x838F, 0x2022, 0x8390, 0x201A, 0x8392, 0x0B7E, 0x8393, 0x0B80,
- 0x8394, 0x2027, 0x8395, 0x2024, 0x8396, 0x0B7B, 0x8397, 0x2034,
- 0x8398, 0x0B78, 0x8399, 0x2025, 0x839A, 0x22B9, 0x839B, 0x202D,
- 0x839D, 0x202C, 0x839E, 0x0B77, 0x83A0, 0x0B82, 0x83A2, 0x0B7A,
- 0x83A3, 0x201B, 0x83A4, 0x2020, 0x83A5, 0x2031, 0x83A6, 0x2037,
- 0x83A7, 0x0B87, 0x83A8, 0x201C, 0x83A9, 0x2028, 0x83AA, 0x202E,
- 0x83AB, 0x0B7D, 0x83AE, 0x2039, 0x83AF, 0x2032, 0x83B0, 0x2035,
- 0x83BD, 0x0B7C, 0x83BF, 0x22A0, 0x83C0, 0x2294, 0x83C1, 0x0D35,
- 0x83C2, 0x22B1, 0x83C3, 0x22BA, 0x83C4, 0x22BD, 0x83C5, 0x0D33,
- 0x83C6, 0x229C, 0x83C7, 0x22B5, 0x83C8, 0x229D, 0x83C9, 0x22AB,
- 0x83CA, 0x0D40, 0x83CB, 0x22A7, 0x83CC, 0x0D3D, 0x83CE, 0x22A8,
- 0x83CF, 0x2291, 0x83D1, 0x22B6, 0x83D4, 0x0D46, 0x83D5, 0x22B3,
- 0x83D6, 0x22A9, 0x83D7, 0x22BF, 0x83D8, 0x22A4, 0x83D9, 0x254E,
- 0x83DB, 0x22C2, 0x83DC, 0x0D44, 0x83DD, 0x22A2, 0x83DE, 0x22AE,
- 0x83DF, 0x0D47, 0x83E0, 0x0D32, 0x83E1, 0x22A6, 0x83E2, 0x22C0,
- 0x83E3, 0x229F, 0x83E4, 0x2298, 0x83E5, 0x22A3, 0x83E7, 0x2297,
- 0x83E8, 0x2295, 0x83E9, 0x0D2E, 0x83EA, 0x22B7, 0x83EB, 0x229E,
- 0x83EC, 0x22BB, 0x83EE, 0x22BC, 0x83EF, 0x0D36, 0x83F0, 0x0D3B,
- 0x83F1, 0x0D37, 0x83F2, 0x0D3F, 0x83F3, 0x22B2, 0x83F4, 0x0D38,
- 0x83F5, 0x22AA, 0x83F6, 0x229A, 0x83F8, 0x0D30, 0x83F9, 0x2292,
- 0x83FA, 0x22B4, 0x83FB, 0x22BE, 0x83FC, 0x2299, 0x83FD, 0x0D3E,
- 0x83FE, 0x22C3, 0x83FF, 0x22A5, 0x8401, 0x22A1, 0x8403, 0x0D2F,
- 0x8404, 0x0D43, 0x8406, 0x22B0, 0x8407, 0x0D45, 0x8409, 0x22AC,
- 0x840A, 0x0D3A, 0x840B, 0x0D34, 0x840C, 0x0D3C, 0x840D, 0x0D31,
- 0x840E, 0x0D42, 0x840F, 0x22AD, 0x8410, 0x229B, 0x8411, 0x22AF,
- 0x8412, 0x2296, 0x8413, 0x22B8, 0x841B, 0x22C1, 0x8423, 0x2293,
- 0x8429, 0x254D, 0x842B, 0x2563, 0x842C, 0x0EAC, 0x842D, 0x2552,
- 0x842F, 0x2550, 0x8430, 0x253B, 0x8431, 0x0EDE, 0x8432, 0x254B,
- 0x8433, 0x255F, 0x8434, 0x2547, 0x8435, 0x0EE6, 0x8436, 0x255E,
- 0x8437, 0x2545, 0x8438, 0x0D41, 0x8439, 0x2555, 0x843A, 0x2546,
- 0x843B, 0x255C, 0x843C, 0x0EE5, 0x843D, 0x0EDD, 0x843F, 0x2530,
- 0x8440, 0x2538, 0x8442, 0x2551, 0x8443, 0x2549, 0x8444, 0x2562,
- 0x8445, 0x254C, 0x8446, 0x0EEB, 0x8447, 0x255D, 0x8449, 0x0EE2,
- 0x844B, 0x254F, 0x844C, 0x2557, 0x844D, 0x253C, 0x844E, 0x2556,
- 0x8450, 0x2567, 0x8451, 0x2537, 0x8452, 0x2558, 0x8454, 0x2565,
- 0x8456, 0x2531, 0x8457, 0x0D39, 0x8459, 0x253F, 0x845A, 0x253E,
- 0x845B, 0x0EE4, 0x845D, 0x2542, 0x845E, 0x2544, 0x845F, 0x2553,
- 0x8460, 0x2564, 0x8461, 0x0EE7, 0x8463, 0x0EE8, 0x8465, 0x2536,
- 0x8466, 0x0EE0, 0x8467, 0x253A, 0x8468, 0x2560, 0x8469, 0x0EE9,
- 0x846B, 0x0EE1, 0x846C, 0x0EE3, 0x846D, 0x0EEA, 0x846E, 0x2566,
- 0x846F, 0x2559, 0x8470, 0x2554, 0x8473, 0x2541, 0x8474, 0x2540,
- 0x8475, 0x0EDF, 0x8476, 0x2532, 0x8477, 0x0EDC, 0x8478, 0x254A,
- 0x8479, 0x2533, 0x847A, 0x2548, 0x847D, 0x253D, 0x847E, 0x2561,
- 0x8482, 0x0EDB, 0x8486, 0x2539, 0x848D, 0x2535, 0x848E, 0x255B,
- 0x848F, 0x2534, 0x8490, 0x108E, 0x8491, 0x27CD, 0x8494, 0x27BC,
- 0x8497, 0x27A6, 0x8498, 0x27C4, 0x8499, 0x1086, 0x849A, 0x27B5,
- 0x849B, 0x27BF, 0x849C, 0x1089, 0x849D, 0x27B8, 0x849E, 0x1087,
- 0x849F, 0x27A9, 0x84A0, 0x27C7, 0x84A1, 0x27A8, 0x84A2, 0x27BB,
- 0x84A4, 0x27A7, 0x84A7, 0x27B9, 0x84A8, 0x27C2, 0x84A9, 0x27C0,
- 0x84AA, 0x27B4, 0x84AB, 0x27AF, 0x84AC, 0x27AD, 0x84AE, 0x27AE,
- 0x84AF, 0x27C1, 0x84B0, 0x27CC, 0x84B1, 0x27B6, 0x84B2, 0x1088,
- 0x84B4, 0x27B1, 0x84B6, 0x27C5, 0x84B8, 0x108B, 0x84B9, 0x27B0,
- 0x84BA, 0x27AA, 0x84BB, 0x27BA, 0x84BC, 0x108F, 0x84BF, 0x1083,
- 0x84C0, 0x108C, 0x84C1, 0x27B2, 0x84C2, 0x27AC, 0x84C4, 0x1085,
- 0x84C5, 0x255A, 0x84C6, 0x1084, 0x84C7, 0x27BD, 0x84C9, 0x1082,
- 0x84CA, 0x1091, 0x84CB, 0x108A, 0x84CC, 0x27BE, 0x84CD, 0x27B3,
- 0x84CE, 0x27AB, 0x84CF, 0x27C6, 0x84D0, 0x27B7, 0x84D1, 0x1090,
- 0x84D2, 0x27CA, 0x84D3, 0x108D, 0x84D4, 0x27C9, 0x84D6, 0x27C3,
- 0x84D7, 0x27C8, 0x84DB, 0x27CB, 0x84E7, 0x2A03, 0x84E8, 0x2A04,
- 0x84E9, 0x29F7, 0x84EA, 0x29F6, 0x84EB, 0x29F2, 0x84EC, 0x11FB,
- 0x84EE, 0x11F3, 0x84EF, 0x2A06, 0x84F0, 0x2A05, 0x84F1, 0x252F,
- 0x84F2, 0x29EF, 0x84F3, 0x29F3, 0x84F4, 0x29ED, 0x84F6, 0x2A00,
- 0x84F7, 0x29F1, 0x84F9, 0x2A07, 0x84FA, 0x29EA, 0x84FB, 0x29E8,
- 0x84FC, 0x29F4, 0x84FD, 0x29FE, 0x84FE, 0x29F9, 0x84FF, 0x11FD,
- 0x8500, 0x29DF, 0x8502, 0x29FD, 0x8506, 0x11FE, 0x8507, 0x2543,
- 0x8508, 0x29EB, 0x8509, 0x29E2, 0x850A, 0x29E5, 0x850B, 0x2A0B,
- 0x850C, 0x29EC, 0x850D, 0x29E3, 0x850E, 0x29E1, 0x850F, 0x29DE,
- 0x8511, 0x11F7, 0x8512, 0x29F5, 0x8513, 0x11F6, 0x8514, 0x11FA,
- 0x8515, 0x29F0, 0x8516, 0x29F8, 0x8517, 0x11F0, 0x8518, 0x2A08,
- 0x8519, 0x2A0C, 0x851A, 0x11F2, 0x851C, 0x29E7, 0x851D, 0x29FB,
- 0x851E, 0x29FF, 0x851F, 0x29E4, 0x8520, 0x2A09, 0x8521, 0x11F9,
- 0x8523, 0x11F8, 0x8524, 0x29DC, 0x8525, 0x11FC, 0x8526, 0x2A02,
- 0x8527, 0x29E6, 0x8528, 0x29FA, 0x8529, 0x29E0, 0x852A, 0x29EE,
- 0x852B, 0x29E9, 0x852C, 0x11F4, 0x852D, 0x11F5, 0x852E, 0x29FC,
- 0x852F, 0x2A0D, 0x8530, 0x2A0A, 0x8531, 0x2A01, 0x853B, 0x29DD,
- 0x853D, 0x11F1, 0x853E, 0x2C4F, 0x8540, 0x2C46, 0x8541, 0x2C49,
- 0x8543, 0x133B, 0x8544, 0x2C4B, 0x8545, 0x2C40, 0x8546, 0x2C47,
- 0x8547, 0x2C4D, 0x8548, 0x1338, 0x8549, 0x133C, 0x854A, 0x1336,
- 0x854D, 0x2C42, 0x854E, 0x2C52, 0x8551, 0x2C4C, 0x8553, 0x2C43,
- 0x8554, 0x2C5B, 0x8555, 0x2C55, 0x8556, 0x2C3F, 0x8557, 0x2E23,
- 0x8558, 0x2C45, 0x8559, 0x1337, 0x855B, 0x2C50, 0x855D, 0x2C5A,
- 0x855E, 0x133F, 0x8560, 0x2C57, 0x8561, 0x2C44, 0x8562, 0x2C4A,
- 0x8563, 0x2C4E, 0x8564, 0x2C48, 0x8565, 0x2C5C, 0x8566, 0x2C59,
- 0x8567, 0x2C56, 0x8568, 0x1339, 0x8569, 0x133A, 0x856A, 0x133E,
- 0x856B, 0x2C41, 0x856C, 0x2C5D, 0x856D, 0x133D, 0x856E, 0x2C53,
- 0x8571, 0x2C51, 0x8575, 0x2C54, 0x8576, 0x2E30, 0x8577, 0x2E1D,
- 0x8578, 0x2E22, 0x8579, 0x2E2F, 0x857A, 0x2E21, 0x857B, 0x2E19,
- 0x857C, 0x2E1E, 0x857E, 0x145C, 0x8580, 0x2E12, 0x8581, 0x2E2A,
- 0x8582, 0x2E2C, 0x8583, 0x2E11, 0x8584, 0x145B, 0x8585, 0x2E2E,
- 0x8586, 0x2E26, 0x8587, 0x1462, 0x8588, 0x2E2D, 0x8589, 0x2E1F,
- 0x858A, 0x1464, 0x858B, 0x2E17, 0x858C, 0x2C58, 0x858D, 0x2E27,
- 0x858E, 0x2E24, 0x858F, 0x2E13, 0x8590, 0x2E32, 0x8591, 0x145E,
- 0x8594, 0x145F, 0x8595, 0x2E15, 0x8596, 0x2E25, 0x8598, 0x2E31,
- 0x8599, 0x2E28, 0x859A, 0x2E1B, 0x859B, 0x1461, 0x859C, 0x145D,
- 0x859D, 0x2E29, 0x859E, 0x2E1C, 0x859F, 0x2E33, 0x85A0, 0x2E16,
- 0x85A1, 0x2E20, 0x85A2, 0x2E2B, 0x85A3, 0x2E18, 0x85A4, 0x2E1A,
- 0x85A6, 0x1465, 0x85A7, 0x2E14, 0x85A8, 0x1463, 0x85A9, 0x151C,
- 0x85AA, 0x145A, 0x85AF, 0x1460, 0x85B0, 0x1520, 0x85B1, 0x2FA6,
- 0x85B3, 0x2F9C, 0x85B4, 0x2F97, 0x85B5, 0x2F9D, 0x85B6, 0x2FA7,
- 0x85B7, 0x2FAB, 0x85B8, 0x2FAA, 0x85B9, 0x1522, 0x85BA, 0x1521,
- 0x85BD, 0x2F9E, 0x85BE, 0x2FAC, 0x85BF, 0x2FA1, 0x85C0, 0x2F99,
- 0x85C2, 0x2F9B, 0x85C3, 0x2F9A, 0x85C4, 0x2FA0, 0x85C5, 0x2FA5,
- 0x85C6, 0x2F98, 0x85C7, 0x2F9F, 0x85C8, 0x2FA4, 0x85C9, 0x151F,
- 0x85CB, 0x2FA2, 0x85CD, 0x151D, 0x85CE, 0x2FA3, 0x85CF, 0x151B,
- 0x85D0, 0x151E, 0x85D1, 0x3101, 0x85D2, 0x2FA8, 0x85D5, 0x15B7,
- 0x85D7, 0x30F9, 0x85D8, 0x30FD, 0x85D9, 0x30F5, 0x85DA, 0x30F8,
- 0x85DC, 0x3100, 0x85DD, 0x15B5, 0x85DE, 0x3105, 0x85DF, 0x30FE,
- 0x85E1, 0x30F6, 0x85E2, 0x3106, 0x85E3, 0x30FF, 0x85E4, 0x15B8,
- 0x85E5, 0x15B9, 0x85E6, 0x3103, 0x85E8, 0x30F7, 0x85E9, 0x15B4,
- 0x85EA, 0x15B6, 0x85EB, 0x30F2, 0x85EC, 0x30FA, 0x85ED, 0x30F4,
- 0x85EF, 0x3104, 0x85F0, 0x3102, 0x85F1, 0x30F3, 0x85F2, 0x30FB,
- 0x85F6, 0x3225, 0x85F7, 0x15BA, 0x85F8, 0x30FC, 0x85F9, 0x1638,
- 0x85FA, 0x163A, 0x85FB, 0x1637, 0x85FD, 0x322A, 0x85FE, 0x3222,
- 0x85FF, 0x3220, 0x8600, 0x3224, 0x8601, 0x3221, 0x8604, 0x3226,
- 0x8605, 0x3228, 0x8606, 0x163B, 0x8607, 0x163D, 0x8609, 0x3227,
- 0x860A, 0x163E, 0x860B, 0x163C, 0x860C, 0x3229, 0x8611, 0x1639,
- 0x8617, 0x1685, 0x8618, 0x32F6, 0x8619, 0x32FC, 0x861A, 0x1687,
- 0x861B, 0x3223, 0x861C, 0x32FB, 0x861E, 0x3302, 0x861F, 0x32F9,
- 0x8620, 0x3300, 0x8621, 0x32FF, 0x8622, 0x321F, 0x8623, 0x32FA,
- 0x8624, 0x2FA9, 0x8625, 0x3303, 0x8626, 0x32F8, 0x8627, 0x32FD,
- 0x8629, 0x3301, 0x862A, 0x32F7, 0x862C, 0x33AA, 0x862D, 0x1686,
- 0x862E, 0x32FE, 0x8631, 0x3432, 0x8632, 0x33AB, 0x8633, 0x33A9,
- 0x8634, 0x33A7, 0x8635, 0x33A8, 0x8636, 0x33AC, 0x8638, 0x1707,
- 0x8639, 0x3430, 0x863A, 0x342E, 0x863B, 0x3433, 0x863C, 0x3431,
- 0x863E, 0x3434, 0x863F, 0x1708, 0x8640, 0x342F, 0x8643, 0x3497,
- 0x8646, 0x34DF, 0x8647, 0x34E0, 0x8648, 0x34E1, 0x864B, 0x353E,
- 0x864C, 0x3536, 0x864D, 0x1818, 0x864E, 0x0689, 0x8650, 0x07FF,
- 0x8652, 0x1DE3, 0x8653, 0x1DE2, 0x8654, 0x09AF, 0x8655, 0x0B88,
- 0x8656, 0x203C, 0x8659, 0x203B, 0x865B, 0x0D48, 0x865C, 0x0EED,
- 0x865E, 0x0EEC, 0x865F, 0x0EEE, 0x8661, 0x27CE, 0x8662, 0x2A0E,
- 0x8663, 0x2C5E, 0x8664, 0x2C60, 0x8665, 0x2C5F, 0x8667, 0x1466,
- 0x8668, 0x2E34, 0x8669, 0x2FAD, 0x866A, 0x351E, 0x866B, 0x040F,
- 0x866D, 0x1A46, 0x866E, 0x1A47, 0x866F, 0x1A45, 0x8670, 0x1A44,
- 0x8671, 0x068A, 0x8673, 0x1BFD, 0x8674, 0x1BFB, 0x8677, 0x1BFA,
- 0x8679, 0x0800, 0x867A, 0x0802, 0x867B, 0x0801, 0x867C, 0x1BFC,
- 0x8685, 0x1DEF, 0x8686, 0x1DEC, 0x8687, 0x1DEA, 0x868A, 0x09B0,
- 0x868B, 0x1DED, 0x868C, 0x09B5, 0x868D, 0x1DE7, 0x868E, 0x1DF6,
- 0x8690, 0x1DF8, 0x8691, 0x1DE8, 0x8693, 0x09B2, 0x8694, 0x1DF9,
- 0x8695, 0x1DF4, 0x8696, 0x1DE6, 0x8697, 0x1DEB, 0x8698, 0x1DF5,
- 0x8699, 0x1DF1, 0x869A, 0x1DEE, 0x869C, 0x09B7, 0x869D, 0x1DF7,
- 0x869E, 0x1DE9, 0x86A1, 0x1DF2, 0x86A2, 0x1DE4, 0x86A3, 0x09B6,
- 0x86A4, 0x09B3, 0x86A5, 0x1DF0, 0x86A7, 0x1DF3, 0x86A8, 0x1DE5,
- 0x86A9, 0x09B4, 0x86AA, 0x09B1, 0x86AF, 0x0B92, 0x86B0, 0x2043,
- 0x86B1, 0x0B91, 0x86B3, 0x2046, 0x86B4, 0x2049, 0x86B5, 0x0B8E,
- 0x86B6, 0x0B8C, 0x86B7, 0x203E, 0x86B8, 0x2047, 0x86B9, 0x2045,
- 0x86BA, 0x2042, 0x86BB, 0x204A, 0x86BC, 0x204B, 0x86BD, 0x204D,
- 0x86BE, 0x204E, 0x86BF, 0x203D, 0x86C0, 0x0B8B, 0x86C1, 0x2040,
- 0x86C2, 0x203F, 0x86C3, 0x204C, 0x86C4, 0x0B8D, 0x86C5, 0x2041,
- 0x86C6, 0x0B8F, 0x86C7, 0x0B8A, 0x86C8, 0x2044, 0x86C9, 0x0B93,
- 0x86CB, 0x0B90, 0x86CC, 0x2048, 0x86D0, 0x0D4F, 0x86D1, 0x22D2,
- 0x86D3, 0x22C7, 0x86D4, 0x0D4C, 0x86D6, 0x256D, 0x86D7, 0x22D0,
- 0x86D8, 0x22C4, 0x86D9, 0x0D4A, 0x86DA, 0x22C9, 0x86DB, 0x0D4D,
- 0x86DC, 0x22CD, 0x86DD, 0x22CB, 0x86DE, 0x0D50, 0x86DF, 0x0D49,
- 0x86E2, 0x22C5, 0x86E3, 0x22C8, 0x86E4, 0x0D4E, 0x86E6, 0x22C6,
- 0x86E8, 0x22D1, 0x86E9, 0x22CF, 0x86EA, 0x22CA, 0x86EB, 0x22CC,
- 0x86EC, 0x22CE, 0x86ED, 0x0D4B, 0x86F5, 0x256E, 0x86F6, 0x2574,
- 0x86F7, 0x256A, 0x86F8, 0x2570, 0x86F9, 0x0EEF, 0x86FA, 0x256C,
- 0x86FB, 0x0EF5, 0x86FE, 0x0EF4, 0x8700, 0x0EF3, 0x8701, 0x2573,
- 0x8702, 0x0EF6, 0x8703, 0x0EF7, 0x8704, 0x2569, 0x8705, 0x2576,
- 0x8706, 0x0EF8, 0x8707, 0x0EF2, 0x8708, 0x0EF1, 0x8709, 0x2572,
- 0x870A, 0x0EF9, 0x870B, 0x2568, 0x870C, 0x256B, 0x870D, 0x2575,
- 0x870E, 0x2571, 0x8711, 0x27EE, 0x8712, 0x27E3, 0x8713, 0x0EF0,
- 0x8718, 0x1098, 0x8719, 0x27D7, 0x871A, 0x27EC, 0x871B, 0x27D8,
- 0x871C, 0x1093, 0x871E, 0x27D5, 0x8720, 0x27DE, 0x8721, 0x27D6,
- 0x8722, 0x1095, 0x8723, 0x27D0, 0x8724, 0x27EB, 0x8725, 0x1096,
- 0x8726, 0x27E8, 0x8727, 0x27E9, 0x8728, 0x27D1, 0x8729, 0x109B,
- 0x872A, 0x27E0, 0x872C, 0x27DA, 0x872D, 0x27E1, 0x872E, 0x27D4,
- 0x8730, 0x27ED, 0x8731, 0x27E5, 0x8732, 0x27DF, 0x8733, 0x27CF,
- 0x8734, 0x1097, 0x8735, 0x27E6, 0x8737, 0x109A, 0x8738, 0x27EA,
- 0x873A, 0x27E4, 0x873B, 0x1094, 0x873C, 0x27E2, 0x873E, 0x27DC,
- 0x873F, 0x1092, 0x8740, 0x27D3, 0x8741, 0x27DB, 0x8742, 0x27E7,
- 0x8743, 0x27D9, 0x8746, 0x27DD, 0x874C, 0x1208, 0x874D, 0x256F,
- 0x874E, 0x2A20, 0x874F, 0x2A29, 0x8750, 0x2A1F, 0x8751, 0x2A1B,
- 0x8752, 0x2A18, 0x8753, 0x1209, 0x8754, 0x2A16, 0x8755, 0x1099,
- 0x8756, 0x2A0F, 0x8757, 0x1207, 0x8758, 0x2A15, 0x8759, 0x1206,
- 0x875A, 0x2A1A, 0x875B, 0x2A17, 0x875C, 0x2A27, 0x875D, 0x2A22,
- 0x875E, 0x2A1C, 0x875F, 0x2A21, 0x8760, 0x1202, 0x8761, 0x2A19,
- 0x8762, 0x2A2C, 0x8763, 0x2A10, 0x8764, 0x2A11, 0x8765, 0x2A28,
- 0x8766, 0x1203, 0x8767, 0x2A2D, 0x8768, 0x1205, 0x8769, 0x2A2E,
- 0x876A, 0x2A1E, 0x876B, 0x27D2, 0x876C, 0x2A24, 0x876D, 0x2A1D,
- 0x876E, 0x2A26, 0x876F, 0x2A23, 0x8773, 0x2A14, 0x8774, 0x1200,
- 0x8775, 0x2A2B, 0x8776, 0x1201, 0x8777, 0x2A12, 0x8778, 0x1204,
- 0x8779, 0x2C6B, 0x877A, 0x2A25, 0x877B, 0x2A2A, 0x8781, 0x2C68,
- 0x8782, 0x11FF, 0x8783, 0x1340, 0x8784, 0x2C72, 0x8785, 0x2C6E,
- 0x8787, 0x2C6C, 0x8788, 0x2C67, 0x8789, 0x2C76, 0x878D, 0x1344,
- 0x878F, 0x2C63, 0x8790, 0x2C6F, 0x8791, 0x2C70, 0x8792, 0x2C66,
- 0x8793, 0x2C65, 0x8794, 0x2C73, 0x8796, 0x2C69, 0x8797, 0x2C64,
- 0x8798, 0x2C6A, 0x879A, 0x2C75, 0x879B, 0x2C62, 0x879C, 0x2C74,
- 0x879D, 0x2C71, 0x879E, 0x1342, 0x879F, 0x1341, 0x87A2, 0x1343,
- 0x87A3, 0x2C6D, 0x87A4, 0x2C61, 0x87AA, 0x2E36, 0x87AB, 0x146C,
- 0x87AC, 0x2E3A, 0x87AD, 0x2E37, 0x87AE, 0x2E3E, 0x87AF, 0x2E44,
- 0x87B0, 0x2E39, 0x87B2, 0x2E4D, 0x87B3, 0x1469, 0x87B4, 0x2E47,
- 0x87B5, 0x2E3C, 0x87B6, 0x2E48, 0x87B7, 0x2E43, 0x87B8, 0x2E4A,
- 0x87B9, 0x2E3B, 0x87BA, 0x146E, 0x87BB, 0x146D, 0x87BC, 0x2E3D,
- 0x87BD, 0x2E4B, 0x87BE, 0x2E35, 0x87BF, 0x2E49, 0x87C0, 0x1467,
- 0x87C2, 0x2E41, 0x87C3, 0x2E40, 0x87C4, 0x2E45, 0x87C5, 0x2E38,
- 0x87C6, 0x146B, 0x87C8, 0x146F, 0x87C9, 0x2E3F, 0x87CA, 0x2E46,
- 0x87CB, 0x1470, 0x87CC, 0x2E42, 0x87D1, 0x1468, 0x87D2, 0x146A,
- 0x87D3, 0x2FBA, 0x87D4, 0x2FB8, 0x87D7, 0x2FBE, 0x87D8, 0x2FBC,
- 0x87D9, 0x2FBF, 0x87DB, 0x2FB1, 0x87DC, 0x2FB9, 0x87DD, 0x2FC3,
- 0x87DE, 0x2E4C, 0x87DF, 0x2FB5, 0x87E0, 0x1526, 0x87E1, 0x2A13,
- 0x87E2, 0x2FB0, 0x87E3, 0x2FBD, 0x87E4, 0x2FB7, 0x87E5, 0x2FB4,
- 0x87E6, 0x2FAF, 0x87E7, 0x2FAE, 0x87E8, 0x2FC2, 0x87EA, 0x2FB3,
- 0x87EB, 0x2FB2, 0x87EC, 0x1524, 0x87ED, 0x2FBB, 0x87EF, 0x1523,
- 0x87F2, 0x1525, 0x87F3, 0x2FB6, 0x87F4, 0x2FC1, 0x87F6, 0x310A,
- 0x87F7, 0x310B, 0x87F9, 0x15BE, 0x87FA, 0x3108, 0x87FB, 0x15BB,
- 0x87FC, 0x3110, 0x87FE, 0x15BF, 0x87FF, 0x3112, 0x8800, 0x3107,
- 0x8801, 0x2FC0, 0x8802, 0x3114, 0x8803, 0x3109, 0x8805, 0x15BC,
- 0x8806, 0x310F, 0x8808, 0x3111, 0x8809, 0x310C, 0x880A, 0x3113,
- 0x880B, 0x310E, 0x880C, 0x310D, 0x880D, 0x15BD, 0x8810, 0x322C,
- 0x8811, 0x322D, 0x8813, 0x322F, 0x8814, 0x163F, 0x8815, 0x1640,
- 0x8816, 0x3230, 0x8817, 0x322E, 0x8819, 0x322B, 0x881B, 0x3306,
- 0x881C, 0x3309, 0x881D, 0x3305, 0x881F, 0x168B, 0x8820, 0x3307,
- 0x8821, 0x168A, 0x8822, 0x1689, 0x8823, 0x1688, 0x8824, 0x3308,
- 0x8825, 0x33B1, 0x8826, 0x33AF, 0x8828, 0x33AE, 0x8829, 0x3304,
- 0x882A, 0x33B0, 0x882B, 0x330A, 0x882C, 0x33AD, 0x882E, 0x3437,
- 0x882F, 0x3415, 0x8830, 0x3435, 0x8831, 0x1709, 0x8832, 0x3436,
- 0x8833, 0x3438, 0x8835, 0x349A, 0x8836, 0x1728, 0x8837, 0x3499,
- 0x8838, 0x3498, 0x8839, 0x1729, 0x883B, 0x1747, 0x883C, 0x3508,
- 0x883D, 0x3520, 0x883E, 0x351F, 0x883F, 0x3521, 0x8840, 0x0410,
- 0x8841, 0x1BFE, 0x8843, 0x1DFA, 0x8844, 0x1DFB, 0x8848, 0x22D3,
- 0x884A, 0x330B, 0x884B, 0x349B, 0x884C, 0x0411, 0x884D, 0x0803,
- 0x884E, 0x1BFF, 0x8852, 0x204F, 0x8853, 0x0B94, 0x8855, 0x22D5,
- 0x8856, 0x22D4, 0x8857, 0x0D51, 0x8859, 0x0EFA, 0x885A, 0x2A2F,
- 0x885B, 0x120A, 0x885D, 0x120B, 0x8861, 0x1345, 0x8862, 0x172A,
- 0x8863, 0x0412, 0x8867, 0x1C00, 0x8868, 0x068C, 0x8869, 0x1C02,
- 0x886A, 0x1C01, 0x886B, 0x0804, 0x886D, 0x1DFC, 0x886F, 0x1E03,
- 0x8870, 0x09B8, 0x8871, 0x1E01, 0x8872, 0x1DFF, 0x8874, 0x1E06,
- 0x8875, 0x1DFD, 0x8876, 0x1DFE, 0x8877, 0x09B9, 0x8879, 0x09BD,
- 0x887C, 0x1E07, 0x887D, 0x09BC, 0x887E, 0x1E05, 0x887F, 0x1E02,
- 0x8880, 0x1E00, 0x8881, 0x09BA, 0x8882, 0x09BB, 0x8883, 0x1E04,
- 0x8888, 0x0B96, 0x8889, 0x2050, 0x888B, 0x0B9B, 0x888C, 0x2060,
- 0x888D, 0x0B9A, 0x888E, 0x2062, 0x8891, 0x2056, 0x8892, 0x0B98,
- 0x8893, 0x2061, 0x8895, 0x2051, 0x8896, 0x0B99, 0x8897, 0x205D,
- 0x8898, 0x2059, 0x8899, 0x205B, 0x889A, 0x2055, 0x889B, 0x205C,
- 0x889E, 0x0B95, 0x889F, 0x2058, 0x88A1, 0x2057, 0x88A2, 0x2053,
- 0x88A4, 0x205E, 0x88A7, 0x205A, 0x88A8, 0x2052, 0x88AA, 0x2054,
- 0x88AB, 0x0B97, 0x88AC, 0x205F, 0x88B1, 0x0D54, 0x88B2, 0x22E0,
- 0x88B6, 0x22DC, 0x88B7, 0x22DE, 0x88B8, 0x22D9, 0x88B9, 0x22D8,
- 0x88BA, 0x22D6, 0x88BC, 0x22DD, 0x88BD, 0x22DF, 0x88BE, 0x22DB,
- 0x88C0, 0x22DA, 0x88C1, 0x0D52, 0x88C2, 0x0D53, 0x88C9, 0x22E2,
- 0x88CA, 0x0F02, 0x88CB, 0x2578, 0x88CC, 0x257E, 0x88CD, 0x2579,
- 0x88CE, 0x257A, 0x88CF, 0x36EA, 0x88D0, 0x257F, 0x88D2, 0x0F04,
- 0x88D4, 0x0EFC, 0x88D5, 0x0F03, 0x88D6, 0x2577, 0x88D7, 0x22D7,
- 0x88D8, 0x0EFF, 0x88D9, 0x0EFD, 0x88DA, 0x257D, 0x88DB, 0x257C,
- 0x88DC, 0x0EFE, 0x88DD, 0x0F00, 0x88DE, 0x257B, 0x88DF, 0x0EFB,
- 0x88E1, 0x0F01, 0x88E7, 0x27F0, 0x88E8, 0x10A2, 0x88EB, 0x27FB,
- 0x88EC, 0x27FA, 0x88EE, 0x27F5, 0x88EF, 0x10A4, 0x88F0, 0x27F9,
- 0x88F1, 0x27F1, 0x88F2, 0x27F2, 0x88F3, 0x109C, 0x88F4, 0x109E,
- 0x88F6, 0x27F7, 0x88F7, 0x27EF, 0x88F8, 0x10A0, 0x88F9, 0x109F,
- 0x88FA, 0x27F3, 0x88FB, 0x27F8, 0x88FC, 0x27F6, 0x88FD, 0x10A1,
- 0x88FE, 0x27F4, 0x8901, 0x22E1, 0x8902, 0x109D, 0x8905, 0x2A30,
- 0x8906, 0x2A37, 0x8907, 0x120D, 0x8909, 0x2A3B, 0x890A, 0x1211,
- 0x890B, 0x2A33, 0x890C, 0x2A31, 0x890E, 0x2A3A, 0x8910, 0x120C,
- 0x8911, 0x2A39, 0x8912, 0x120E, 0x8913, 0x120F, 0x8914, 0x2A32,
- 0x8915, 0x1210, 0x8916, 0x2A38, 0x8917, 0x2A34, 0x8918, 0x2A35,
- 0x8919, 0x2A36, 0x891A, 0x10A3, 0x891E, 0x2C77, 0x891F, 0x2C83,
- 0x8921, 0x134A, 0x8922, 0x2C7E, 0x8923, 0x2C80, 0x8925, 0x1348,
- 0x8926, 0x2C78, 0x8927, 0x2C7C, 0x8929, 0x2C7F, 0x892A, 0x1346,
- 0x892B, 0x1349, 0x892C, 0x2C82, 0x892D, 0x2C7A, 0x892E, 0x2C7B,
- 0x892F, 0x2C81, 0x8930, 0x2C79, 0x8931, 0x2C7D, 0x8932, 0x1347,
- 0x8933, 0x2E4F, 0x8935, 0x2E4E, 0x8936, 0x1472, 0x8937, 0x2E54,
- 0x8938, 0x1474, 0x893B, 0x1471, 0x893C, 0x2E50, 0x893D, 0x1475,
- 0x893E, 0x2E51, 0x8941, 0x2E52, 0x8942, 0x2E55, 0x8944, 0x1473,
- 0x8946, 0x2FC8, 0x8949, 0x2FCB, 0x894B, 0x2FC5, 0x894C, 0x2FC7,
- 0x894F, 0x2FC6, 0x8950, 0x2FC9, 0x8951, 0x2FCA, 0x8952, 0x2E53,
- 0x8953, 0x2FC4, 0x8956, 0x15C2, 0x8957, 0x3118, 0x8958, 0x311B,
- 0x8959, 0x311D, 0x895A, 0x3116, 0x895B, 0x3117, 0x895C, 0x311A,
- 0x895D, 0x311C, 0x895E, 0x15C3, 0x895F, 0x15C1, 0x8960, 0x15C0,
- 0x8961, 0x3119, 0x8962, 0x3115, 0x8963, 0x3231, 0x8964, 0x1641,
- 0x8966, 0x3232, 0x8969, 0x330D, 0x896A, 0x168C, 0x896B, 0x330F,
- 0x896C, 0x168D, 0x896D, 0x330C, 0x896E, 0x330E, 0x896F, 0x16D6,
- 0x8971, 0x33B2, 0x8972, 0x16D5, 0x8973, 0x343B, 0x8974, 0x343A,
- 0x8976, 0x3439, 0x8979, 0x34E2, 0x897A, 0x34E3, 0x897B, 0x34E5,
- 0x897C, 0x34E4, 0x897E, 0x1819, 0x897F, 0x0413, 0x8981, 0x0805,
- 0x8982, 0x2063, 0x8983, 0x0D55, 0x8985, 0x2580, 0x8986, 0x1527,
- 0x8988, 0x311E, 0x898B, 0x0508, 0x898F, 0x0B9D, 0x8993, 0x0B9C,
- 0x8995, 0x22E3, 0x8996, 0x0D56, 0x8997, 0x22E5, 0x8998, 0x22E4,
- 0x899B, 0x2581, 0x899C, 0x0F05, 0x899D, 0x27FC, 0x899E, 0x27FF,
- 0x899F, 0x27FE, 0x89A1, 0x27FD, 0x89A2, 0x2A3C, 0x89A3, 0x2A3E,
- 0x89A4, 0x2A3D, 0x89A6, 0x134C, 0x89AA, 0x134B, 0x89AC, 0x1476,
- 0x89AD, 0x2E56, 0x89AE, 0x2E58, 0x89AF, 0x2E57, 0x89B2, 0x1528,
- 0x89B6, 0x3120, 0x89B7, 0x311F, 0x89B9, 0x3233, 0x89BA, 0x1642,
- 0x89BD, 0x168E, 0x89BE, 0x33B4, 0x89BF, 0x33B3, 0x89C0, 0x1748,
- 0x89D2, 0x0509, 0x89D3, 0x1C03, 0x89D4, 0x0806, 0x89D5, 0x2066,
- 0x89D6, 0x2064, 0x89D9, 0x2065, 0x89DA, 0x22E7, 0x89DB, 0x22E8,
- 0x89DC, 0x2588, 0x89DD, 0x22E6, 0x89DF, 0x2582, 0x89E0, 0x2586,
- 0x89E1, 0x2585, 0x89E2, 0x2587, 0x89E3, 0x0F06, 0x89E4, 0x2584,
- 0x89E5, 0x2583, 0x89E6, 0x2589, 0x89E8, 0x2802, 0x89E9, 0x2800,
- 0x89EB, 0x2801, 0x89EC, 0x2A41, 0x89ED, 0x2A3F, 0x89F0, 0x2A40,
- 0x89F1, 0x2C84, 0x89F2, 0x2E59, 0x89F3, 0x2E5A, 0x89F4, 0x1529,
- 0x89F6, 0x3121, 0x89F7, 0x3234, 0x89F8, 0x1643, 0x89FA, 0x3310,
- 0x89FB, 0x33B5, 0x89FC, 0x16D7, 0x89FE, 0x343C, 0x89FF, 0x34E6,
- 0x8A00, 0x050A, 0x8A02, 0x0808, 0x8A03, 0x0809, 0x8A04, 0x1C04,
- 0x8A07, 0x1C05, 0x8A08, 0x0807, 0x8A0A, 0x09C3, 0x8A0C, 0x09C1,
- 0x8A0E, 0x09C0, 0x8A0F, 0x09C7, 0x8A10, 0x09BF, 0x8A11, 0x09C8,
- 0x8A12, 0x1E08, 0x8A13, 0x09C5, 0x8A15, 0x09C2, 0x8A16, 0x09C6,
- 0x8A17, 0x09C4, 0x8A18, 0x09BE, 0x8A1B, 0x0BA5, 0x8A1D, 0x0B9F,
- 0x8A1E, 0x206A, 0x8A1F, 0x0BA4, 0x8A22, 0x0BA6, 0x8A23, 0x0BA0,
- 0x8A25, 0x0BA1, 0x8A27, 0x2068, 0x8A2A, 0x0B9E, 0x8A2C, 0x2069,
- 0x8A2D, 0x0BA3, 0x8A30, 0x2067, 0x8A31, 0x0BA2, 0x8A34, 0x0D61,
- 0x8A36, 0x0D63, 0x8A39, 0x22EB, 0x8A3A, 0x0D62, 0x8A3B, 0x0D57,
- 0x8A3C, 0x0D5B, 0x8A3E, 0x0F19, 0x8A3F, 0x258E, 0x8A40, 0x22ED,
- 0x8A41, 0x0D5C, 0x8A44, 0x22F0, 0x8A45, 0x22F1, 0x8A46, 0x0D60,
- 0x8A48, 0x22F3, 0x8A4A, 0x22F5, 0x8A4C, 0x22F6, 0x8A4D, 0x22EA,
- 0x8A4E, 0x22E9, 0x8A4F, 0x22F7, 0x8A50, 0x0D5F, 0x8A51, 0x22F4,
- 0x8A52, 0x22F2, 0x8A54, 0x0D5D, 0x8A55, 0x0D59, 0x8A56, 0x0D64,
- 0x8A57, 0x22EE, 0x8A58, 0x22EF, 0x8A59, 0x22EC, 0x8A5B, 0x0D5E,
- 0x8A5E, 0x0D5A, 0x8A60, 0x0D58, 0x8A61, 0x258D, 0x8A62, 0x0F14,
- 0x8A63, 0x0F0F, 0x8A66, 0x0F0A, 0x8A68, 0x0F1A, 0x8A69, 0x0F0B,
- 0x8A6B, 0x0F07, 0x8A6C, 0x0F16, 0x8A6D, 0x0F13, 0x8A6E, 0x0F15,
- 0x8A70, 0x0F0C, 0x8A71, 0x0F11, 0x8A72, 0x0F08, 0x8A73, 0x0F09,
- 0x8A74, 0x2595, 0x8A75, 0x2592, 0x8A76, 0x258A, 0x8A77, 0x258F,
- 0x8A79, 0x0F17, 0x8A7A, 0x2596, 0x8A7B, 0x0F18, 0x8A7C, 0x0F0E,
- 0x8A7F, 0x258C, 0x8A81, 0x2594, 0x8A82, 0x2590, 0x8A83, 0x2593,
- 0x8A84, 0x2591, 0x8A85, 0x0F12, 0x8A86, 0x258B, 0x8A87, 0x0F0D,
- 0x8A8B, 0x2805, 0x8A8C, 0x10A6, 0x8A8D, 0x10A9, 0x8A8F, 0x2807,
- 0x8A91, 0x10B1, 0x8A92, 0x2806, 0x8A93, 0x10AB, 0x8A95, 0x1216,
- 0x8A96, 0x2808, 0x8A98, 0x10B0, 0x8A99, 0x2804, 0x8A9A, 0x10B2,
- 0x8A9E, 0x10A7, 0x8AA0, 0x0F10, 0x8AA1, 0x10AA, 0x8AA3, 0x10A8,
- 0x8AA4, 0x10AC, 0x8AA5, 0x10AE, 0x8AA6, 0x10A5, 0x8AA7, 0x10B3,
- 0x8AA8, 0x10AF, 0x8AAA, 0x10AD, 0x8AAB, 0x2803, 0x8AB0, 0x121D,
- 0x8AB2, 0x1219, 0x8AB6, 0x1220, 0x8AB8, 0x2A44, 0x8AB9, 0x1221,
- 0x8ABA, 0x2A50, 0x8ABB, 0x2A49, 0x8ABC, 0x1212, 0x8ABD, 0x2A51,
- 0x8ABE, 0x2A4B, 0x8ABF, 0x121C, 0x8AC0, 0x2A4C, 0x8AC2, 0x121B,
- 0x8AC3, 0x2A4F, 0x8AC4, 0x1215, 0x8AC5, 0x2A4D, 0x8AC6, 0x2A43,
- 0x8AC7, 0x1214, 0x8AC8, 0x2C8F, 0x8AC9, 0x121A, 0x8ACB, 0x1217,
- 0x8ACD, 0x121F, 0x8ACF, 0x2A42, 0x8AD1, 0x2A46, 0x8AD2, 0x1213,
- 0x8AD3, 0x2A45, 0x8AD4, 0x2A47, 0x8AD5, 0x2A48, 0x8AD6, 0x121E,
- 0x8AD7, 0x2A4A, 0x8AD8, 0x2A4E, 0x8AD9, 0x2A52, 0x8ADB, 0x1222,
- 0x8ADC, 0x1352, 0x8ADD, 0x2C8A, 0x8ADE, 0x2C90, 0x8ADF, 0x2C8D,
- 0x8AE0, 0x2C85, 0x8AE1, 0x2C91, 0x8AE2, 0x2C86, 0x8AE4, 0x2C8C,
- 0x8AE6, 0x134D, 0x8AE7, 0x1353, 0x8AE8, 0x2C92, 0x8AEB, 0x134F,
- 0x8AED, 0x1359, 0x8AEE, 0x1354, 0x8AEF, 0x2C94, 0x8AF0, 0x2C8E,
- 0x8AF1, 0x1350, 0x8AF2, 0x2C87, 0x8AF3, 0x135A, 0x8AF4, 0x2C88,
- 0x8AF5, 0x2C89, 0x8AF6, 0x135B, 0x8AF7, 0x1358, 0x8AF8, 0x1218,
- 0x8AFA, 0x134E, 0x8AFB, 0x2C95, 0x8AFC, 0x135C, 0x8AFE, 0x1355,
- 0x8AFF, 0x2C93, 0x8B00, 0x1351, 0x8B01, 0x1356, 0x8B02, 0x1357,
- 0x8B04, 0x147E, 0x8B05, 0x2E5F, 0x8B06, 0x2E68, 0x8B07, 0x2E65,
- 0x8B08, 0x2E67, 0x8B0A, 0x147B, 0x8B0B, 0x2E60, 0x8B0D, 0x2E66,
- 0x8B0E, 0x1477, 0x8B0F, 0x2E62, 0x8B10, 0x147F, 0x8B11, 0x2E5E,
- 0x8B12, 0x2E63, 0x8B13, 0x2E6A, 0x8B14, 0x2C8B, 0x8B15, 0x2E64,
- 0x8B16, 0x2E5D, 0x8B17, 0x1478, 0x8B18, 0x2E5C, 0x8B19, 0x1479,
- 0x8B1A, 0x2E6B, 0x8B1B, 0x147A, 0x8B1C, 0x2E69, 0x8B1D, 0x147D,
- 0x8B1E, 0x2E5B, 0x8B20, 0x147C, 0x8B22, 0x2E61, 0x8B23, 0x2FCE,
- 0x8B24, 0x2FDC, 0x8B25, 0x2FD7, 0x8B26, 0x2FD9, 0x8B27, 0x2FCD,
- 0x8B28, 0x152A, 0x8B2A, 0x2FCC, 0x8B2B, 0x152D, 0x8B2C, 0x152C,
- 0x8B2E, 0x2FDB, 0x8B2F, 0x2FD3, 0x8B30, 0x2FD0, 0x8B31, 0x2FD6,
- 0x8B33, 0x2FCF, 0x8B35, 0x2FD1, 0x8B36, 0x2FDA, 0x8B37, 0x2FD8,
- 0x8B39, 0x152B, 0x8B3A, 0x2FDF, 0x8B3B, 0x2FDD, 0x8B3C, 0x2FD4,
- 0x8B3D, 0x2FDE, 0x8B3E, 0x2FD5, 0x8B40, 0x3125, 0x8B41, 0x15C4,
- 0x8B42, 0x312C, 0x8B45, 0x3313, 0x8B46, 0x15CB, 0x8B47, 0x2FD2,
- 0x8B48, 0x3123, 0x8B49, 0x15C7, 0x8B4A, 0x3124, 0x8B4B, 0x3129,
- 0x8B4E, 0x15C9, 0x8B4F, 0x15CA, 0x8B50, 0x3122, 0x8B51, 0x312B,
- 0x8B52, 0x312D, 0x8B53, 0x3126, 0x8B54, 0x3128, 0x8B55, 0x312A,
- 0x8B56, 0x3127, 0x8B57, 0x312E, 0x8B58, 0x15C6, 0x8B59, 0x15CC,
- 0x8B5A, 0x15C8, 0x8B5C, 0x15C5, 0x8B5D, 0x3237, 0x8B5F, 0x1648,
- 0x8B60, 0x3235, 0x8B63, 0x3239, 0x8B65, 0x323A, 0x8B66, 0x1646,
- 0x8B67, 0x323B, 0x8B68, 0x3238, 0x8B6A, 0x3236, 0x8B6B, 0x1649,
- 0x8B6C, 0x1645, 0x8B6D, 0x323C, 0x8B6F, 0x1647, 0x8B70, 0x1644,
- 0x8B74, 0x168F, 0x8B77, 0x1690, 0x8B78, 0x3312, 0x8B79, 0x3311,
- 0x8B7A, 0x3314, 0x8B7B, 0x3315, 0x8B7D, 0x1691, 0x8B7E, 0x33B6,
- 0x8B7F, 0x33BB, 0x8B80, 0x16D8, 0x8B82, 0x33B8, 0x8B84, 0x33B7,
- 0x8B85, 0x33BA, 0x8B86, 0x33B9, 0x8B88, 0x3440, 0x8B8A, 0x170A,
- 0x8B8B, 0x343F, 0x8B8C, 0x343D, 0x8B8E, 0x343E, 0x8B92, 0x172C,
- 0x8B93, 0x172B, 0x8B94, 0x349C, 0x8B95, 0x349D, 0x8B96, 0x172D,
- 0x8B98, 0x34E7, 0x8B99, 0x34E8, 0x8B9A, 0x1754, 0x8B9C, 0x175A,
- 0x8B9E, 0x3522, 0x8B9F, 0x353F, 0x8C37, 0x050B, 0x8C39, 0x206B,
- 0x8C3B, 0x206C, 0x8C3C, 0x2597, 0x8C3D, 0x2809, 0x8C3E, 0x2A53,
- 0x8C3F, 0x1481, 0x8C41, 0x1480, 0x8C42, 0x2FE0, 0x8C43, 0x312F,
- 0x8C45, 0x3441, 0x8C46, 0x050C, 0x8C47, 0x1E09, 0x8C48, 0x09C9,
- 0x8C49, 0x0BA7, 0x8C4A, 0x2599, 0x8C4B, 0x2598, 0x8C4C, 0x1223,
- 0x8C4D, 0x2A54, 0x8C4E, 0x1224, 0x8C4F, 0x2E6C, 0x8C50, 0x152E,
- 0x8C54, 0x1763, 0x8C55, 0x050D, 0x8C56, 0x1A48, 0x8C57, 0x1E0A,
- 0x8C5A, 0x0BA8, 0x8C5C, 0x206D, 0x8C5D, 0x206E, 0x8C5F, 0x22F8,
- 0x8C61, 0x0D65, 0x8C62, 0x0F1B, 0x8C64, 0x259B, 0x8C65, 0x259A,
- 0x8C66, 0x259C, 0x8C68, 0x280A, 0x8C69, 0x280B, 0x8C6A, 0x10B4,
- 0x8C6B, 0x135D, 0x8C6C, 0x1225, 0x8C6D, 0x135E, 0x8C6F, 0x2E70,
- 0x8C70, 0x2E6D, 0x8C71, 0x2E6F, 0x8C72, 0x2E6E, 0x8C73, 0x1482,
- 0x8C75, 0x2FE1, 0x8C76, 0x3131, 0x8C77, 0x3130, 0x8C78, 0x18E7,
- 0x8C79, 0x09CB, 0x8C7A, 0x09CA, 0x8C7B, 0x1E0B, 0x8C7D, 0x206F,
- 0x8C80, 0x22FA, 0x8C81, 0x22F9, 0x8C82, 0x0D66, 0x8C84, 0x259E,
- 0x8C85, 0x259F, 0x8C86, 0x259D, 0x8C89, 0x0F1D, 0x8C8A, 0x0F1C,
- 0x8C8C, 0x10B6, 0x8C8D, 0x10B5, 0x8C8F, 0x2A55, 0x8C90, 0x2C98,
- 0x8C91, 0x2C96, 0x8C92, 0x2C97, 0x8C93, 0x135F, 0x8C94, 0x2E72,
- 0x8C95, 0x2E71, 0x8C97, 0x2FE4, 0x8C98, 0x2FE3, 0x8C99, 0x2FE2,
- 0x8C9A, 0x3132, 0x8C9C, 0x3523, 0x8C9D, 0x050E, 0x8C9E, 0x080A,
- 0x8CA0, 0x080B, 0x8CA1, 0x09CC, 0x8CA2, 0x09CD, 0x8CA3, 0x1E0D,
- 0x8CA4, 0x1E0C, 0x8CA5, 0x2070, 0x8CA7, 0x0BAE, 0x8CA8, 0x0BAC,
- 0x8CA9, 0x0BA9, 0x8CAA, 0x0BAD, 0x8CAB, 0x0BAB, 0x8CAC, 0x0BAA,
- 0x8CAF, 0x0D67, 0x8CB0, 0x22FD, 0x8CB2, 0x0F22, 0x8CB3, 0x0D69,
- 0x8CB4, 0x0D6E, 0x8CB5, 0x22FF, 0x8CB6, 0x0D70, 0x8CB7, 0x0D6F,
- 0x8CB8, 0x0D72, 0x8CB9, 0x22FE, 0x8CBA, 0x22FB, 0x8CBB, 0x0D6C,
- 0x8CBC, 0x0D68, 0x8CBD, 0x0D6A, 0x8CBE, 0x22FC, 0x8CBF, 0x0D71,
- 0x8CC0, 0x0D6D, 0x8CC1, 0x0D6B, 0x8CC2, 0x0F24, 0x8CC3, 0x0F23,
- 0x8CC4, 0x0F21, 0x8CC5, 0x0F25, 0x8CC7, 0x0F1F, 0x8CC8, 0x0F20,
- 0x8CCA, 0x0F1E, 0x8CCC, 0x25A0, 0x8CCF, 0x280D, 0x8CD1, 0x10B8,
- 0x8CD2, 0x10B9, 0x8CD3, 0x10B7, 0x8CD5, 0x280C, 0x8CD7, 0x280E,
- 0x8CD9, 0x2A58, 0x8CDA, 0x2A5A, 0x8CDC, 0x122E, 0x8CDD, 0x2A5B,
- 0x8CDE, 0x1227, 0x8CDF, 0x2A57, 0x8CE0, 0x1226, 0x8CE1, 0x1230,
- 0x8CE2, 0x122C, 0x8CE3, 0x122D, 0x8CE4, 0x1229, 0x8CE5, 0x2A56,
- 0x8CE6, 0x1228, 0x8CE7, 0x2A5C, 0x8CE8, 0x2A59, 0x8CEA, 0x122F,
- 0x8CEC, 0x122A, 0x8CED, 0x122B, 0x8CEE, 0x2C9A, 0x8CF0, 0x2C9C,
- 0x8CF1, 0x2C9B, 0x8CF3, 0x2C9D, 0x8CF4, 0x1360, 0x8CF5, 0x2C99,
- 0x8CF8, 0x1486, 0x8CF9, 0x2E73, 0x8CFA, 0x1483, 0x8CFB, 0x1487,
- 0x8CFC, 0x1485, 0x8CFD, 0x1484, 0x8CFE, 0x2FE5, 0x8D00, 0x2FE8,
- 0x8D02, 0x2FE7, 0x8D04, 0x2FE6, 0x8D05, 0x152F, 0x8D06, 0x3133,
- 0x8D07, 0x3134, 0x8D08, 0x15CD, 0x8D09, 0x3135, 0x8D0A, 0x15CE,
- 0x8D0D, 0x164B, 0x8D0F, 0x164A, 0x8D10, 0x3316, 0x8D13, 0x1692,
- 0x8D14, 0x3317, 0x8D15, 0x33BC, 0x8D16, 0x16D9, 0x8D17, 0x16DA,
- 0x8D19, 0x3442, 0x8D1B, 0x172F, 0x8D64, 0x050F, 0x8D66, 0x0BB0,
- 0x8D67, 0x0BAF, 0x8D68, 0x25A1, 0x8D69, 0x25A2, 0x8D6B, 0x10BA,
- 0x8D6C, 0x2C9E, 0x8D6D, 0x1231, 0x8D6E, 0x2C9F, 0x8D6F, 0x2E74,
- 0x8D70, 0x0510, 0x8D72, 0x1C06, 0x8D73, 0x080D, 0x8D74, 0x080C,
- 0x8D76, 0x1E0E, 0x8D77, 0x09CE, 0x8D78, 0x1E0F, 0x8D79, 0x2073,
- 0x8D7B, 0x2072, 0x8D7D, 0x2071, 0x8D80, 0x2301, 0x8D81, 0x0D75,
- 0x8D84, 0x2300, 0x8D85, 0x0D74, 0x8D89, 0x2302, 0x8D8A, 0x0D73,
- 0x8D8C, 0x25A4, 0x8D8D, 0x25A7, 0x8D8E, 0x25A5, 0x8D8F, 0x25A6,
- 0x8D90, 0x25AA, 0x8D91, 0x25A3, 0x8D92, 0x25AB, 0x8D93, 0x25A8,
- 0x8D94, 0x25A9, 0x8D95, 0x10BC, 0x8D96, 0x280F, 0x8D99, 0x10BB,
- 0x8D9B, 0x2A60, 0x8D9C, 0x2A5E, 0x8D9F, 0x1232, 0x8DA0, 0x2A5D,
- 0x8DA1, 0x2A5F, 0x8DA3, 0x1233, 0x8DA5, 0x2CA0, 0x8DA7, 0x2CA1,
- 0x8DA8, 0x1488, 0x8DAA, 0x3137, 0x8DAB, 0x3139, 0x8DAC, 0x3136,
- 0x8DAD, 0x3138, 0x8DAE, 0x323D, 0x8DAF, 0x3318, 0x8DB2, 0x3509,
- 0x8DB3, 0x0511, 0x8DB4, 0x080E, 0x8DB5, 0x1E10, 0x8DB6, 0x1E12,
- 0x8DB7, 0x1E11, 0x8DB9, 0x2076, 0x8DBA, 0x0BB2, 0x8DBC, 0x2074,
- 0x8DBE, 0x0BB1, 0x8DBF, 0x2077, 0x8DC1, 0x2078, 0x8DC2, 0x2075,
- 0x8DC5, 0x230E, 0x8DC6, 0x0D7D, 0x8DC7, 0x2306, 0x8DC8, 0x230C,
- 0x8DCB, 0x0D78, 0x8DCC, 0x0D7B, 0x8DCD, 0x2305, 0x8DCE, 0x0D76,
- 0x8DCF, 0x2309, 0x8DD0, 0x25B1, 0x8DD1, 0x0D7A, 0x8DD3, 0x2304,
- 0x8DD5, 0x230A, 0x8DD6, 0x2307, 0x8DD7, 0x230D, 0x8DD8, 0x2303,
- 0x8DD9, 0x230B, 0x8DDA, 0x0D79, 0x8DDB, 0x0D7C, 0x8DDC, 0x2308,
- 0x8DDD, 0x0D77, 0x8DDF, 0x0F27, 0x8DE0, 0x25AD, 0x8DE1, 0x0F26,
- 0x8DE2, 0x25B4, 0x8DE3, 0x25B3, 0x8DE4, 0x0F2D, 0x8DE6, 0x0F2E,
- 0x8DE7, 0x25B5, 0x8DE8, 0x0F28, 0x8DE9, 0x25B2, 0x8DEA, 0x0F2C,
- 0x8DEB, 0x25B7, 0x8DEC, 0x25AE, 0x8DEE, 0x25B0, 0x8DEF, 0x0F29,
- 0x8DF0, 0x25AC, 0x8DF1, 0x25AF, 0x8DF2, 0x25B6, 0x8DF3, 0x0F2A,
- 0x8DF4, 0x25B8, 0x8DFA, 0x0F2B, 0x8DFC, 0x10BD, 0x8DFD, 0x2814,
- 0x8DFE, 0x281A, 0x8DFF, 0x2812, 0x8E00, 0x281B, 0x8E02, 0x2811,
- 0x8E03, 0x2816, 0x8E04, 0x281C, 0x8E05, 0x2819, 0x8E06, 0x2818,
- 0x8E07, 0x2817, 0x8E09, 0x2810, 0x8E0A, 0x2815, 0x8E0D, 0x2813,
- 0x8E0F, 0x1238, 0x8E10, 0x1235, 0x8E11, 0x2A69, 0x8E12, 0x2A6E,
- 0x8E13, 0x2A70, 0x8E14, 0x2A6D, 0x8E15, 0x2A66, 0x8E16, 0x2A68,
- 0x8E17, 0x2A72, 0x8E18, 0x2A6F, 0x8E19, 0x2A6A, 0x8E1A, 0x2A73,
- 0x8E1B, 0x2A67, 0x8E1C, 0x2A71, 0x8E1D, 0x1236, 0x8E1E, 0x123C,
- 0x8E1F, 0x123A, 0x8E20, 0x2A61, 0x8E21, 0x123B, 0x8E22, 0x1237,
- 0x8E23, 0x2A62, 0x8E24, 0x2A64, 0x8E25, 0x2A63, 0x8E26, 0x2A6B,
- 0x8E27, 0x2A6C, 0x8E29, 0x1239, 0x8E2B, 0x1234, 0x8E2E, 0x2A65,
- 0x8E30, 0x2CAB, 0x8E31, 0x1362, 0x8E33, 0x2CA2, 0x8E34, 0x1363,
- 0x8E35, 0x1366, 0x8E36, 0x2CA7, 0x8E38, 0x2CA4, 0x8E39, 0x1365,
- 0x8E3C, 0x2CA8, 0x8E3D, 0x2CA9, 0x8E3E, 0x2CA3, 0x8E3F, 0x2CAC,
- 0x8E40, 0x2CA5, 0x8E41, 0x2CAA, 0x8E42, 0x1364, 0x8E44, 0x1361,
- 0x8E45, 0x2CA6, 0x8E47, 0x2E7A, 0x8E48, 0x148B, 0x8E49, 0x1489,
- 0x8E4A, 0x148C, 0x8E4B, 0x148A, 0x8E4C, 0x2E79, 0x8E4D, 0x2E76,
- 0x8E4E, 0x2E75, 0x8E50, 0x2E78, 0x8E53, 0x2E77, 0x8E54, 0x2FF6,
- 0x8E55, 0x1535, 0x8E56, 0x2FED, 0x8E57, 0x2FEC, 0x8E59, 0x1530,
- 0x8E5A, 0x2FF2, 0x8E5B, 0x2FF1, 0x8E5C, 0x2FE9, 0x8E5D, 0x2FF4,
- 0x8E5E, 0x2FEE, 0x8E5F, 0x1534, 0x8E60, 0x2FEB, 0x8E61, 0x2FF3,
- 0x8E62, 0x2FEA, 0x8E63, 0x1531, 0x8E64, 0x1533, 0x8E65, 0x2FEF,
- 0x8E66, 0x1532, 0x8E67, 0x2FF0, 0x8E69, 0x2FF5, 0x8E6A, 0x313D,
- 0x8E6C, 0x15D3, 0x8E6D, 0x313A, 0x8E6F, 0x313E, 0x8E72, 0x15D0,
- 0x8E73, 0x313C, 0x8E74, 0x15D5, 0x8E76, 0x15D2, 0x8E78, 0x313B,
- 0x8E7A, 0x15D4, 0x8E7B, 0x313F, 0x8E7C, 0x15CF, 0x8E81, 0x164D,
- 0x8E82, 0x164F, 0x8E84, 0x3240, 0x8E85, 0x164E, 0x8E86, 0x323E,
- 0x8E87, 0x15D1, 0x8E88, 0x323F, 0x8E89, 0x164C, 0x8E8A, 0x1693,
- 0x8E8B, 0x1695, 0x8E8C, 0x331A, 0x8E8D, 0x1694, 0x8E8E, 0x3319,
- 0x8E90, 0x33C1, 0x8E91, 0x16DB, 0x8E92, 0x33C0, 0x8E93, 0x16DC,
- 0x8E94, 0x33BE, 0x8E95, 0x33BD, 0x8E96, 0x33C2, 0x8E97, 0x33C3,
- 0x8E98, 0x3443, 0x8E9A, 0x33BF, 0x8E9D, 0x34A1, 0x8E9E, 0x349E,
- 0x8E9F, 0x349F, 0x8EA0, 0x34A0, 0x8EA1, 0x1749, 0x8EA3, 0x34EB,
- 0x8EA4, 0x34EA, 0x8EA5, 0x34E9, 0x8EA6, 0x350A, 0x8EA8, 0x3537,
- 0x8EA9, 0x3524, 0x8EAA, 0x175B, 0x8EAB, 0x0512, 0x8EAC, 0x09CF,
- 0x8EB2, 0x0F2F, 0x8EBA, 0x123D, 0x8EBD, 0x2CAD, 0x8EC0, 0x1536,
- 0x8EC2, 0x3140, 0x8EC9, 0x3525, 0x8ECA, 0x0513, 0x8ECB, 0x068D,
- 0x8ECC, 0x0810, 0x8ECD, 0x080F, 0x8ECF, 0x09D2, 0x8ED1, 0x1E13,
- 0x8ED2, 0x09D0, 0x8ED3, 0x1E14, 0x8ED4, 0x09D1, 0x8ED7, 0x207D,
- 0x8ED8, 0x2079, 0x8EDB, 0x0BB3, 0x8EDC, 0x207C, 0x8EDD, 0x207B,
- 0x8EDE, 0x207A, 0x8EDF, 0x0BB4, 0x8EE0, 0x207E, 0x8EE1, 0x207F,
- 0x8EE5, 0x2315, 0x8EE6, 0x2313, 0x8EE7, 0x2317, 0x8EE8, 0x2318,
- 0x8EE9, 0x231E, 0x8EEB, 0x231A, 0x8EEC, 0x231C, 0x8EEE, 0x2314,
- 0x8EEF, 0x230F, 0x8EF1, 0x231B, 0x8EF4, 0x231D, 0x8EF5, 0x2316,
- 0x8EF6, 0x2319, 0x8EF7, 0x2310, 0x8EF8, 0x0D7F, 0x8EF9, 0x2312,
- 0x8EFA, 0x2311, 0x8EFB, 0x0D7E, 0x8EFC, 0x0D80, 0x8EFE, 0x0F32,
- 0x8EFF, 0x25BA, 0x8F00, 0x25BC, 0x8F01, 0x25BB, 0x8F02, 0x25C0,
- 0x8F03, 0x0F30, 0x8F05, 0x25BD, 0x8F06, 0x25B9, 0x8F07, 0x25BE,
- 0x8F08, 0x25BF, 0x8F09, 0x0F31, 0x8F0A, 0x0F33, 0x8F0B, 0x25C1,
- 0x8F0D, 0x2820, 0x8F0E, 0x281F, 0x8F10, 0x281D, 0x8F11, 0x281E,
- 0x8F12, 0x10BF, 0x8F13, 0x10C1, 0x8F14, 0x10BE, 0x8F15, 0x10C0,
- 0x8F16, 0x2A7A, 0x8F17, 0x2A7B, 0x8F18, 0x2A76, 0x8F1A, 0x2A77,
- 0x8F1B, 0x123F, 0x8F1C, 0x1244, 0x8F1D, 0x123E, 0x8F1E, 0x1245,
- 0x8F1F, 0x1240, 0x8F20, 0x2A78, 0x8F23, 0x2A79, 0x8F24, 0x2A75,
- 0x8F25, 0x1246, 0x8F26, 0x1242, 0x8F29, 0x1241, 0x8F2A, 0x1243,
- 0x8F2C, 0x2A74, 0x8F2E, 0x2CAF, 0x8F2F, 0x1368, 0x8F32, 0x2CB1,
- 0x8F33, 0x136A, 0x8F34, 0x2CB4, 0x8F35, 0x2CB0, 0x8F36, 0x2CAE,
- 0x8F37, 0x2CB3, 0x8F38, 0x1369, 0x8F39, 0x2CB2, 0x8F3B, 0x1367,
- 0x8F3E, 0x148E, 0x8F3F, 0x1491, 0x8F40, 0x2E7C, 0x8F42, 0x148F,
- 0x8F43, 0x2E7B, 0x8F44, 0x148D, 0x8F45, 0x1490, 0x8F46, 0x2FF7,
- 0x8F47, 0x2FF8, 0x8F48, 0x2FF9, 0x8F49, 0x1537, 0x8F4B, 0x2FFA,
- 0x8F4D, 0x1538, 0x8F4E, 0x15D7, 0x8F4F, 0x3143, 0x8F50, 0x3144,
- 0x8F51, 0x3142, 0x8F52, 0x3141, 0x8F53, 0x3145, 0x8F54, 0x15D6,
- 0x8F55, 0x3244, 0x8F56, 0x3242, 0x8F57, 0x3243, 0x8F58, 0x3245,
- 0x8F59, 0x3241, 0x8F5A, 0x3246, 0x8F5B, 0x331C, 0x8F5D, 0x331D,
- 0x8F5E, 0x331B, 0x8F5F, 0x1696, 0x8F60, 0x33C4, 0x8F61, 0x16DD,
- 0x8F62, 0x33C5, 0x8F63, 0x3445, 0x8F64, 0x3444, 0x8F9B, 0x0514,
- 0x8F9C, 0x0D81, 0x8F9F, 0x0F34, 0x8FA3, 0x10C2, 0x8FA6, 0x136C,
- 0x8FA8, 0x136B, 0x8FAD, 0x15D8, 0x8FAE, 0x162F, 0x8FAF, 0x1697,
- 0x8FB0, 0x0515, 0x8FB1, 0x09D3, 0x8FB2, 0x0F35, 0x8FB4, 0x3146,
- 0x8FB5, 0x0230, 0x8FBF, 0x18E9, 0x8FC2, 0x0516, 0x8FC4, 0x0519,
- 0x8FC5, 0x0518, 0x8FC6, 0x0517, 0x8FC9, 0x18E8, 0x8FCB, 0x1A4A,
- 0x8FCD, 0x1A4C, 0x8FCE, 0x068E, 0x8FD1, 0x0690, 0x8FD2, 0x1A49,
- 0x8FD3, 0x1A4B, 0x8FD4, 0x068F, 0x8FD5, 0x1A4E, 0x8FD6, 0x1A4D,
- 0x8FD7, 0x1A4F, 0x8FE0, 0x1C0A, 0x8FE1, 0x1C08, 0x8FE2, 0x0813,
- 0x8FE3, 0x1C07, 0x8FE4, 0x0818, 0x8FE5, 0x0815, 0x8FE6, 0x0812,
- 0x8FE8, 0x0819, 0x8FEA, 0x0814, 0x8FEB, 0x0817, 0x8FED, 0x0816,
- 0x8FEE, 0x1C09, 0x8FF0, 0x0811, 0x8FF4, 0x09D9, 0x8FF5, 0x1E16,
- 0x8FF6, 0x1E1C, 0x8FF7, 0x09D6, 0x8FF8, 0x09DD, 0x8FFA, 0x09D8,
- 0x8FFB, 0x1E19, 0x8FFC, 0x1E1B, 0x8FFD, 0x09DB, 0x8FFE, 0x1E15,
- 0x8FFF, 0x1E18, 0x9000, 0x09D7, 0x9001, 0x09D4, 0x9002, 0x1E17,
- 0x9003, 0x09DA, 0x9004, 0x1E1A, 0x9005, 0x09DC, 0x9006, 0x09D5,
- 0x900B, 0x2081, 0x900C, 0x2084, 0x900D, 0x0BB6, 0x900F, 0x0BC0,
- 0x9010, 0x0BBC, 0x9011, 0x2082, 0x9014, 0x0BC4, 0x9015, 0x0BBD,
- 0x9016, 0x0BC2, 0x9017, 0x0BB8, 0x9019, 0x0BB5, 0x901A, 0x0BB7,
- 0x901B, 0x0BC3, 0x901C, 0x2083, 0x901D, 0x0BBB, 0x901E, 0x0BBE,
- 0x901F, 0x0BBA, 0x9020, 0x0BBF, 0x9021, 0x2085, 0x9022, 0x0BC1,
- 0x9023, 0x0BB9, 0x9024, 0x2080, 0x902D, 0x231F, 0x902E, 0x0D82,
- 0x902F, 0x2321, 0x9031, 0x0D84, 0x9032, 0x0D86, 0x9034, 0x2320,
- 0x9035, 0x0D83, 0x9036, 0x0D87, 0x9038, 0x0D85, 0x903C, 0x0F3B,
- 0x903D, 0x25C6, 0x903E, 0x0F43, 0x903F, 0x25C3, 0x9041, 0x0F44,
- 0x9042, 0x0F39, 0x9044, 0x25C4, 0x9047, 0x0F3E, 0x9049, 0x25C5,
- 0x904A, 0x0F37, 0x904B, 0x0F36, 0x904D, 0x0F41, 0x904E, 0x0F40,
- 0x904F, 0x0F3F, 0x9050, 0x0F3D, 0x9051, 0x0F42, 0x9052, 0x25C2,
- 0x9053, 0x0F38, 0x9054, 0x0F3A, 0x9055, 0x0F3C, 0x9058, 0x10C4,
- 0x9059, 0x10C7, 0x905B, 0x10CB, 0x905C, 0x10C5, 0x905D, 0x10CA,
- 0x905E, 0x10C8, 0x9060, 0x10C3, 0x9062, 0x10C9, 0x9063, 0x10C6,
- 0x9067, 0x2A7F, 0x9068, 0x1249, 0x9069, 0x1247, 0x906B, 0x2A80,
- 0x906D, 0x124A, 0x906E, 0x1248, 0x906F, 0x2A7E, 0x9070, 0x2A7D,
- 0x9072, 0x1370, 0x9073, 0x2A7C, 0x9074, 0x136E, 0x9075, 0x136D,
- 0x9076, 0x2CB5, 0x9077, 0x124B, 0x9078, 0x136F, 0x9079, 0x2CB6,
- 0x907A, 0x1372, 0x907B, 0x2CB7, 0x907C, 0x1371, 0x907D, 0x1493,
- 0x907E, 0x2E7E, 0x907F, 0x1492, 0x9080, 0x1497, 0x9081, 0x1495,
- 0x9082, 0x1496, 0x9083, 0x153A, 0x9084, 0x1494, 0x9085, 0x2E7D,
- 0x9086, 0x2CB8, 0x9087, 0x1539, 0x9088, 0x153B, 0x908A, 0x15D9,
- 0x908B, 0x15DA, 0x908D, 0x3247, 0x908F, 0x170C, 0x9090, 0x170B,
- 0x9091, 0x051B, 0x9094, 0x181E, 0x9095, 0x09DE, 0x9097, 0x181B,
- 0x9098, 0x181C, 0x9099, 0x181A, 0x909B, 0x181D, 0x909E, 0x18ED,
- 0x909F, 0x18EA, 0x90A0, 0x18EF, 0x90A1, 0x18EB, 0x90A2, 0x051C,
- 0x90A3, 0x051F, 0x90A5, 0x18EC, 0x90A6, 0x051E, 0x90A7, 0x18EE,
- 0x90AA, 0x051D, 0x90AF, 0x1A52, 0x90B0, 0x1A54, 0x90B1, 0x0693,
- 0x90B2, 0x1A50, 0x90B3, 0x1A53, 0x90B4, 0x1A51, 0x90B5, 0x0691,
- 0x90B6, 0x0694, 0x90B8, 0x0692, 0x90BD, 0x1C0C, 0x90BE, 0x1C10,
- 0x90BF, 0x1C0D, 0x90C1, 0x081C, 0x90C3, 0x081D, 0x90C5, 0x1C0F,
- 0x90C7, 0x1C11, 0x90C8, 0x1C13, 0x90CA, 0x081A, 0x90CB, 0x1C12,
- 0x90CE, 0x081B, 0x90D4, 0x208C, 0x90D5, 0x1C0E, 0x90D6, 0x1E1D,
- 0x90D7, 0x1E26, 0x90D8, 0x1E24, 0x90D9, 0x1E1F, 0x90DA, 0x1E20,
- 0x90DB, 0x1E25, 0x90DC, 0x1E27, 0x90DD, 0x09E0, 0x90DF, 0x1E22,
- 0x90E0, 0x1E1E, 0x90E1, 0x09DF, 0x90E2, 0x09E1, 0x90E3, 0x1E21,
- 0x90E4, 0x1E28, 0x90E5, 0x1E23, 0x90E8, 0x0BC5, 0x90E9, 0x208F,
- 0x90EA, 0x2087, 0x90EB, 0x208D, 0x90EC, 0x208E, 0x90ED, 0x0BC6,
- 0x90EF, 0x2086, 0x90F0, 0x2088, 0x90F1, 0x1C0B, 0x90F2, 0x208A,
- 0x90F3, 0x208B, 0x90F4, 0x2089, 0x90F5, 0x0D89, 0x90F9, 0x2328,
- 0x90FA, 0x2CB9, 0x90FB, 0x2329, 0x90FC, 0x2326, 0x90FD, 0x0BC7,
- 0x90FE, 0x0D8B, 0x90FF, 0x2325, 0x9100, 0x232B, 0x9101, 0x232A,
- 0x9102, 0x0D88, 0x9103, 0x232E, 0x9104, 0x2324, 0x9105, 0x232D,
- 0x9106, 0x2322, 0x9107, 0x232C, 0x9108, 0x2327, 0x9109, 0x0D8A,
- 0x910B, 0x25CD, 0x910D, 0x25C8, 0x910E, 0x25CE, 0x910F, 0x25C9,
- 0x9110, 0x25C7, 0x9111, 0x25CA, 0x9112, 0x0F45, 0x9114, 0x25CC,
- 0x9116, 0x25CB, 0x9117, 0x0F46, 0x9118, 0x10CD, 0x9119, 0x10CC,
- 0x911A, 0x2827, 0x911B, 0x282A, 0x911C, 0x2822, 0x911D, 0x2826,
- 0x911E, 0x10CE, 0x911F, 0x2825, 0x9120, 0x2823, 0x9121, 0x2829,
- 0x9122, 0x2824, 0x9123, 0x2821, 0x9124, 0x2828, 0x9126, 0x2A86,
- 0x9127, 0x124E, 0x9128, 0x2FFB, 0x9129, 0x2A83, 0x912A, 0x2A84,
- 0x912B, 0x2A82, 0x912C, 0x2323, 0x912D, 0x124D, 0x912E, 0x2A87,
- 0x912F, 0x2A81, 0x9130, 0x124C, 0x9131, 0x124F, 0x9132, 0x2A85,
- 0x9133, 0x2CBA, 0x9134, 0x1373, 0x9135, 0x2CBB, 0x9136, 0x2CBC,
- 0x9138, 0x2E7F, 0x9139, 0x1498, 0x913A, 0x2FFC, 0x913B, 0x2FFD,
- 0x913E, 0x2FFE, 0x913F, 0x3148, 0x9140, 0x3147, 0x9141, 0x3249,
- 0x9143, 0x3248, 0x9144, 0x331F, 0x9145, 0x3320, 0x9146, 0x331E,
- 0x9147, 0x33C6, 0x9148, 0x16DE, 0x9149, 0x0520, 0x914A, 0x081F,
- 0x914B, 0x081E, 0x914C, 0x09E4, 0x914D, 0x09E3, 0x914E, 0x1E2A,
- 0x914F, 0x1E2B, 0x9150, 0x1E29, 0x9152, 0x09E2, 0x9153, 0x2093,
- 0x9155, 0x2094, 0x9156, 0x2090, 0x9157, 0x0BC8, 0x9158, 0x2091,
- 0x915A, 0x2092, 0x915F, 0x2331, 0x9160, 0x2333, 0x9161, 0x232F,
- 0x9162, 0x2332, 0x9163, 0x0D8C, 0x9164, 0x2330, 0x9165, 0x0D8D,
- 0x9168, 0x23E2, 0x9169, 0x0F49, 0x916A, 0x0F48, 0x916C, 0x0F47,
- 0x916E, 0x25CF, 0x916F, 0x25D0, 0x9172, 0x282C, 0x9173, 0x282E,
- 0x9174, 0x10D2, 0x9175, 0x10CF, 0x9177, 0x10D1, 0x9178, 0x10D0,
- 0x9179, 0x282D, 0x917A, 0x282B, 0x9180, 0x2A8E, 0x9181, 0x2A8B,
- 0x9182, 0x2A8C, 0x9183, 0x1253, 0x9184, 0x2A8D, 0x9185, 0x2A88,
- 0x9186, 0x2A89, 0x9187, 0x1250, 0x9189, 0x1251, 0x918A, 0x2A8A,
- 0x918B, 0x1252, 0x918D, 0x2CC0, 0x918F, 0x2CC1, 0x9190, 0x2CBE,
- 0x9191, 0x2CBF, 0x9192, 0x1374, 0x9193, 0x2CBD, 0x9199, 0x2E83,
- 0x919A, 0x2E80, 0x919B, 0x2E82, 0x919C, 0x149B, 0x919D, 0x2E86,
- 0x919E, 0x149A, 0x919F, 0x2E84, 0x91A0, 0x2E87, 0x91A1, 0x2E85,
- 0x91A2, 0x2E81, 0x91A3, 0x1499, 0x91A5, 0x3000, 0x91A7, 0x3001,
- 0x91A8, 0x2FFF, 0x91AA, 0x3003, 0x91AB, 0x153C, 0x91AC, 0x153D,
- 0x91AD, 0x314A, 0x91AE, 0x15DC, 0x91AF, 0x3002, 0x91B0, 0x3149,
- 0x91B1, 0x15DB, 0x91B2, 0x324C, 0x91B3, 0x324D, 0x91B4, 0x1650,
- 0x91B5, 0x324B, 0x91B7, 0x324A, 0x91B9, 0x3321, 0x91BA, 0x1698,
- 0x91BC, 0x3446, 0x91BD, 0x34A3, 0x91BE, 0x34A2, 0x91C0, 0x1730,
- 0x91C1, 0x174A, 0x91C2, 0x34A4, 0x91C3, 0x350B, 0x91C5, 0x175C,
- 0x91C6, 0x0521, 0x91C7, 0x0695, 0x91C9, 0x0F4A, 0x91CB, 0x1651,
- 0x91CC, 0x0522, 0x91CD, 0x0820, 0x91CE, 0x0BC9, 0x91CF, 0x0D8E,
- 0x91D0, 0x153E, 0x91D1, 0x0696, 0x91D3, 0x1C15, 0x91D4, 0x1C14,
- 0x91D5, 0x1E2C, 0x91D7, 0x09E7, 0x91D8, 0x09E5, 0x91D9, 0x09E9,
- 0x91DA, 0x1E2E, 0x91DC, 0x09E8, 0x91DD, 0x09E6, 0x91E2, 0x1E2D,
- 0x91E3, 0x0BCC, 0x91E4, 0x209A, 0x91E6, 0x0BCB, 0x91E7, 0x0BCD,
- 0x91E8, 0x209F, 0x91E9, 0x0BCF, 0x91EA, 0x209C, 0x91EB, 0x209D,
- 0x91EC, 0x2095, 0x91ED, 0x0BCE, 0x91EE, 0x20A0, 0x91F1, 0x2097,
- 0x91F3, 0x2098, 0x91F4, 0x2096, 0x91F5, 0x0BCA, 0x91F7, 0x209E,
- 0x91F8, 0x2099, 0x91F9, 0x209B, 0x91FD, 0x233F, 0x91FF, 0x233E,
- 0x9200, 0x233C, 0x9201, 0x2334, 0x9202, 0x2343, 0x9203, 0x2337,
- 0x9204, 0x2341, 0x9205, 0x2348, 0x9206, 0x2340, 0x9207, 0x0D96,
- 0x9209, 0x0D92, 0x920A, 0x2335, 0x920C, 0x233B, 0x920D, 0x0D94,
- 0x920F, 0x233A, 0x9210, 0x0D95, 0x9211, 0x0D97, 0x9212, 0x233D,
- 0x9214, 0x0D8F, 0x9215, 0x0D90, 0x9216, 0x2349, 0x9217, 0x2347,
- 0x9219, 0x2346, 0x921A, 0x2338, 0x921C, 0x2344, 0x921E, 0x0D93,
- 0x9223, 0x0D91, 0x9224, 0x2345, 0x9225, 0x2336, 0x9226, 0x2339,
- 0x9227, 0x2342, 0x922D, 0x2851, 0x922E, 0x25DA, 0x9230, 0x25D3,
- 0x9231, 0x25E6, 0x9232, 0x25EF, 0x9233, 0x25D6, 0x9234, 0x0F55,
- 0x9236, 0x25E3, 0x9237, 0x0F4B, 0x9238, 0x0F4D, 0x9239, 0x0F59,
- 0x923A, 0x25D4, 0x923D, 0x0F4E, 0x923E, 0x0F50, 0x923F, 0x0F5A,
- 0x9240, 0x0F4F, 0x9245, 0x0F58, 0x9246, 0x25DC, 0x9248, 0x25D1,
- 0x9249, 0x0F56, 0x924A, 0x25DB, 0x924B, 0x0F52, 0x924C, 0x25ED,
- 0x924D, 0x0F57, 0x924E, 0x25EB, 0x924F, 0x25DF, 0x9250, 0x25E9,
- 0x9251, 0x0F54, 0x9252, 0x25D2, 0x9253, 0x25EC, 0x9254, 0x25E7,
- 0x9256, 0x25EE, 0x9257, 0x0F4C, 0x925A, 0x0F5B, 0x925B, 0x0F51,
- 0x925E, 0x25D8, 0x9260, 0x25E0, 0x9261, 0x25E4, 0x9263, 0x25E8,
- 0x9264, 0x0F53, 0x9265, 0x25D7, 0x9266, 0x25D5, 0x9267, 0x25E1,
- 0x926C, 0x25DE, 0x926D, 0x25DD, 0x926F, 0x25E2, 0x9270, 0x25E5,
- 0x9272, 0x25EA, 0x9276, 0x2831, 0x9278, 0x10D3, 0x9279, 0x283B,
- 0x927A, 0x2833, 0x927B, 0x10D9, 0x927C, 0x10DD, 0x927D, 0x2844,
- 0x927E, 0x284C, 0x927F, 0x283D, 0x9280, 0x10D5, 0x9282, 0x2841,
- 0x9283, 0x25D9, 0x9285, 0x10D6, 0x9286, 0x2848, 0x9287, 0x284D,
- 0x9288, 0x2845, 0x928A, 0x2847, 0x928B, 0x2850, 0x928C, 0x2849,
- 0x928D, 0x2837, 0x928E, 0x2840, 0x9291, 0x10DE, 0x9293, 0x10DA,
- 0x9294, 0x2835, 0x9295, 0x2842, 0x9296, 0x10D8, 0x9297, 0x283C,
- 0x9298, 0x10D7, 0x9299, 0x284A, 0x929A, 0x2839, 0x929B, 0x2832,
- 0x929C, 0x10DB, 0x929D, 0x284F, 0x92A0, 0x2834, 0x92A1, 0x2846,
- 0x92A2, 0x2843, 0x92A3, 0x283E, 0x92A4, 0x2830, 0x92A5, 0x282F,
- 0x92A6, 0x2838, 0x92A7, 0x284B, 0x92A8, 0x10DC, 0x92A9, 0x284E,
- 0x92AA, 0x2836, 0x92AB, 0x283A, 0x92AC, 0x10D4, 0x92B2, 0x125F,
- 0x92B3, 0x125A, 0x92B4, 0x2AB0, 0x92B5, 0x2AAC, 0x92B6, 0x2A94,
- 0x92B7, 0x1256, 0x92B9, 0x36E9, 0x92BB, 0x1255, 0x92BC, 0x125B,
- 0x92C0, 0x2A92, 0x92C1, 0x1259, 0x92C2, 0x2A9E, 0x92C3, 0x2A90,
- 0x92C4, 0x2A91, 0x92C5, 0x1254, 0x92C6, 0x2AAF, 0x92C7, 0x125D,
- 0x92C8, 0x2AA1, 0x92C9, 0x2AA6, 0x92CA, 0x2AA0, 0x92CB, 0x2CD3,
- 0x92CC, 0x2A9C, 0x92CD, 0x2AA4, 0x92CE, 0x2AA2, 0x92CF, 0x2A95,
- 0x92D0, 0x2A8F, 0x92D1, 0x2AAA, 0x92D2, 0x125C, 0x92D3, 0x2AAB,
- 0x92D5, 0x2AA5, 0x92D7, 0x2A9A, 0x92D8, 0x2A98, 0x92D9, 0x2A93,
- 0x92DD, 0x2A9B, 0x92DE, 0x2AA8, 0x92DF, 0x2A97, 0x92E0, 0x2AA7,
- 0x92E1, 0x2AAD, 0x92E4, 0x1258, 0x92E6, 0x2AA3, 0x92E7, 0x2AA9,
- 0x92E8, 0x2A9F, 0x92E9, 0x2A99, 0x92EA, 0x1257, 0x92EE, 0x283F,
- 0x92EF, 0x2A9D, 0x92F0, 0x125E, 0x92F1, 0x2A96, 0x92F7, 0x2CD8,
- 0x92F8, 0x1377, 0x92F9, 0x2CD7, 0x92FA, 0x2CD5, 0x92FB, 0x2CE7,
- 0x92FC, 0x137B, 0x92FE, 0x2CE4, 0x92FF, 0x2CDC, 0x9300, 0x2CE6,
- 0x9301, 0x2CCE, 0x9302, 0x2CDA, 0x9304, 0x137D, 0x9306, 0x2CC6,
- 0x9308, 0x2CC4, 0x9309, 0x2CE5, 0x930B, 0x2CE3, 0x930C, 0x2CE2,
- 0x930D, 0x2CD2, 0x930E, 0x2CD1, 0x930F, 0x2CC7, 0x9310, 0x137F,
- 0x9312, 0x2CCD, 0x9313, 0x2CD6, 0x9314, 0x2CE1, 0x9315, 0x1382,
- 0x9316, 0x2CE8, 0x9318, 0x14A3, 0x9319, 0x1384, 0x931A, 0x137E,
- 0x931B, 0x2CCB, 0x931D, 0x2CD4, 0x931E, 0x2CC3, 0x931F, 0x2CC5,
- 0x9320, 0x1375, 0x9321, 0x1381, 0x9322, 0x137A, 0x9323, 0x2CCC,
- 0x9324, 0x2CDB, 0x9325, 0x2AAE, 0x9326, 0x1380, 0x9327, 0x2CC2,
- 0x9328, 0x149E, 0x9329, 0x2CDD, 0x932A, 0x2CE0, 0x932B, 0x137C,
- 0x932D, 0x2CD0, 0x932E, 0x1383, 0x932F, 0x1379, 0x9333, 0x1378,
- 0x9334, 0x2CD9, 0x9335, 0x2CDF, 0x9336, 0x1376, 0x9338, 0x2CC9,
- 0x9339, 0x2CDE, 0x933C, 0x2CCA, 0x9346, 0x2CCF, 0x9347, 0x2E8D,
- 0x9349, 0x2E92, 0x934A, 0x14A0, 0x934B, 0x14A2, 0x934C, 0x2E98,
- 0x934D, 0x149C, 0x934E, 0x2EA6, 0x934F, 0x2E9E, 0x9350, 0x2E93,
- 0x9351, 0x2E94, 0x9352, 0x2E9D, 0x9354, 0x14A9, 0x9355, 0x2E9C,
- 0x9356, 0x2E8C, 0x9357, 0x2E9B, 0x9358, 0x2E8F, 0x9359, 0x2EA7,
- 0x935A, 0x14A8, 0x935B, 0x14A6, 0x935C, 0x2E90, 0x935E, 0x2EA3,
- 0x9360, 0x2E95, 0x9361, 0x2EA2, 0x9363, 0x2EA4, 0x9364, 0x2E8B,
- 0x9365, 0x14A1, 0x9367, 0x2EA5, 0x936A, 0x2E99, 0x936C, 0x14A5,
- 0x936D, 0x2E96, 0x9370, 0x14A7, 0x9371, 0x2E9F, 0x9375, 0x149F,
- 0x9376, 0x2E91, 0x9377, 0x2EA0, 0x9379, 0x2E9A, 0x937A, 0x2CC8,
- 0x937B, 0x2EA1, 0x937C, 0x2E8E, 0x937E, 0x14A4, 0x9380, 0x3014,
- 0x9382, 0x149D, 0x9383, 0x2E89, 0x9388, 0x3011, 0x9389, 0x300A,
- 0x938A, 0x1540, 0x938C, 0x3005, 0x938D, 0x3015, 0x938E, 0x300C,
- 0x938F, 0x2E97, 0x9391, 0x3017, 0x9392, 0x3006, 0x9394, 0x153F,
- 0x9395, 0x3010, 0x9396, 0x1541, 0x9397, 0x1549, 0x9398, 0x1547,
- 0x9399, 0x3012, 0x939A, 0x1548, 0x939B, 0x3008, 0x939D, 0x3009,
- 0x939E, 0x300E, 0x939F, 0x3013, 0x93A1, 0x2E88, 0x93A2, 0x1542,
- 0x93A3, 0x301C, 0x93A4, 0x3019, 0x93A5, 0x3160, 0x93A6, 0x300F,
- 0x93A7, 0x300B, 0x93A8, 0x301A, 0x93A9, 0x3155, 0x93AA, 0x300D,
- 0x93AC, 0x1545, 0x93AE, 0x1544, 0x93AF, 0x2E8A, 0x93B0, 0x1546,
- 0x93B1, 0x3016, 0x93B2, 0x3018, 0x93B3, 0x1543, 0x93B4, 0x301B,
- 0x93B5, 0x3004, 0x93B7, 0x3007, 0x93C0, 0x315E, 0x93C2, 0x314E,
- 0x93C3, 0x15E0, 0x93C4, 0x315C, 0x93C7, 0x314C, 0x93C8, 0x15E1,
- 0x93CA, 0x3157, 0x93CC, 0x3153, 0x93CD, 0x15E6, 0x93CE, 0x315D,
- 0x93CF, 0x314D, 0x93D0, 0x3150, 0x93D1, 0x15DE, 0x93D2, 0x315F,
- 0x93D4, 0x3158, 0x93D5, 0x315B, 0x93D6, 0x15E4, 0x93D7, 0x15E9,
- 0x93D8, 0x15E7, 0x93D9, 0x3154, 0x93DA, 0x314F, 0x93DC, 0x15E2,
- 0x93DD, 0x15E3, 0x93DE, 0x314B, 0x93DF, 0x15DF, 0x93E1, 0x15DD,
- 0x93E2, 0x15E5, 0x93E3, 0x315A, 0x93E4, 0x15E8, 0x93E6, 0x3156,
- 0x93E7, 0x3161, 0x93E8, 0x15EA, 0x93EC, 0x3152, 0x93EE, 0x3159,
- 0x93F5, 0x325A, 0x93F6, 0x3269, 0x93F7, 0x325C, 0x93F8, 0x3263,
- 0x93F9, 0x3151, 0x93FA, 0x3261, 0x93FB, 0x3250, 0x93FC, 0x3267,
- 0x93FD, 0x1654, 0x93FE, 0x3254, 0x93FF, 0x3266, 0x9400, 0x325B,
- 0x9403, 0x1653, 0x9406, 0x326B, 0x9407, 0x325D, 0x9409, 0x3262,
- 0x940A, 0x3265, 0x940B, 0x324E, 0x940C, 0x3268, 0x940D, 0x3259,
- 0x940E, 0x325E, 0x940F, 0x3252, 0x9410, 0x3256, 0x9411, 0x326A,
- 0x9412, 0x3260, 0x9413, 0x324F, 0x9414, 0x3253, 0x9415, 0x3255,
- 0x9416, 0x325F, 0x9418, 0x1652, 0x9419, 0x3258, 0x9420, 0x3251,
- 0x9428, 0x3257, 0x9429, 0x3325, 0x942A, 0x3329, 0x942B, 0x169F,
- 0x942C, 0x332B, 0x942E, 0x1699, 0x9430, 0x3327, 0x9431, 0x332D,
- 0x9432, 0x169E, 0x9433, 0x169A, 0x9435, 0x169B, 0x9436, 0x3324,
- 0x9437, 0x332A, 0x9438, 0x169D, 0x9439, 0x3328, 0x943A, 0x169C,
- 0x943B, 0x3323, 0x943C, 0x3264, 0x943D, 0x3326, 0x943F, 0x3322,
- 0x9440, 0x332C, 0x9444, 0x16DF, 0x9445, 0x33CD, 0x9446, 0x33D0,
- 0x9447, 0x33CC, 0x9448, 0x33CE, 0x9449, 0x33CF, 0x944A, 0x33C9,
- 0x944B, 0x33CA, 0x944C, 0x33C7, 0x944F, 0x33CB, 0x9450, 0x33C8,
- 0x9451, 0x16E0, 0x9452, 0x16E1, 0x9455, 0x3448, 0x9457, 0x344A,
- 0x945D, 0x3449, 0x945E, 0x344B, 0x9460, 0x170E, 0x9462, 0x3447,
- 0x9463, 0x170D, 0x9464, 0x170F, 0x9468, 0x34A6, 0x9469, 0x34A7,
- 0x946A, 0x1731, 0x946B, 0x34A5, 0x946D, 0x34ED, 0x946E, 0x34EC,
- 0x946F, 0x34EE, 0x9470, 0x174C, 0x9471, 0x34EF, 0x9472, 0x174B,
- 0x9473, 0x34F0, 0x9474, 0x350C, 0x9475, 0x350F, 0x9476, 0x350E,
- 0x9477, 0x1755, 0x9478, 0x350D, 0x947C, 0x175F, 0x947D, 0x175D,
- 0x947E, 0x175E, 0x947F, 0x1764, 0x9480, 0x3539, 0x9481, 0x353A,
- 0x9482, 0x3538, 0x9483, 0x3540, 0x9577, 0x0697, 0x957A, 0x20A1,
- 0x957B, 0x234A, 0x957C, 0x2AB1, 0x957D, 0x3162, 0x9580, 0x0698,
- 0x9582, 0x0821, 0x9583, 0x09EA, 0x9586, 0x20A2, 0x9588, 0x20A3,
- 0x9589, 0x0BD0, 0x958B, 0x0D9A, 0x958C, 0x234C, 0x958D, 0x234B,
- 0x958E, 0x0D9E, 0x958F, 0x0D99, 0x9590, 0x234D, 0x9591, 0x0D9B,
- 0x9592, 0x0D9D, 0x9593, 0x0D9C, 0x9594, 0x0D98, 0x9598, 0x0F5C,
- 0x959B, 0x25F3, 0x959C, 0x25F1, 0x959E, 0x25F2, 0x959F, 0x25F0,
- 0x95A1, 0x10DF, 0x95A3, 0x10E2, 0x95A4, 0x10E4, 0x95A5, 0x10E3,
- 0x95A8, 0x10E0, 0x95A9, 0x10E1, 0x95AB, 0x2AB3, 0x95AC, 0x2AB2,
- 0x95AD, 0x1260, 0x95AE, 0x2AB4, 0x95B0, 0x2AB5, 0x95B1, 0x1261,
- 0x95B5, 0x2CF0, 0x95B6, 0x2CEE, 0x95B7, 0x2EAD, 0x95B9, 0x2CEC,
- 0x95BA, 0x2CED, 0x95BB, 0x1385, 0x95BC, 0x2CE9, 0x95BD, 0x2CF1,
- 0x95BE, 0x2CEB, 0x95BF, 0x2CEF, 0x95C0, 0x2EA9, 0x95C3, 0x2EAB,
- 0x95C5, 0x2EAC, 0x95C6, 0x14AE, 0x95C7, 0x2EA8, 0x95C8, 0x14AD,
- 0x95C9, 0x2EAA, 0x95CA, 0x14AA, 0x95CB, 0x14AB, 0x95CC, 0x14AC,
- 0x95CD, 0x2CEA, 0x95D0, 0x154C, 0x95D1, 0x301F, 0x95D2, 0x301D,
- 0x95D3, 0x301E, 0x95D4, 0x154A, 0x95D5, 0x154D, 0x95D6, 0x154B,
- 0x95DA, 0x3163, 0x95DB, 0x3164, 0x95DC, 0x15EB, 0x95DE, 0x326C,
- 0x95DF, 0x326E, 0x95E0, 0x326D, 0x95E1, 0x1655, 0x95E2, 0x16A0,
- 0x95E3, 0x3330, 0x95E4, 0x332F, 0x95E5, 0x332E, 0x961C, 0x0699,
- 0x961E, 0x17B4, 0x9620, 0x1821, 0x9621, 0x0414, 0x9622, 0x181F,
- 0x9623, 0x1822, 0x9624, 0x1820, 0x9628, 0x18F1, 0x962A, 0x0526,
- 0x962C, 0x0527, 0x962D, 0x18F3, 0x962E, 0x0524, 0x962F, 0x18F2,
- 0x9630, 0x18F0, 0x9631, 0x0525, 0x9632, 0x0523, 0x9639, 0x1A55,
- 0x963A, 0x1A58, 0x963B, 0x069C, 0x963C, 0x1A57, 0x963D, 0x1A56,
- 0x963F, 0x069B, 0x9640, 0x069A, 0x9642, 0x069E, 0x9643, 0x1A59,
- 0x9644, 0x069D, 0x964A, 0x1C1A, 0x964B, 0x0823, 0x964C, 0x0824,
- 0x964D, 0x0825, 0x964E, 0x1C1B, 0x964F, 0x1C17, 0x9650, 0x0822,
- 0x9651, 0x1C18, 0x9653, 0x1C19, 0x9654, 0x1C16, 0x9658, 0x09F1,
- 0x965B, 0x09EE, 0x965C, 0x1E2F, 0x965D, 0x09EF, 0x965E, 0x09F2,
- 0x965F, 0x1E30, 0x9661, 0x09ED, 0x9662, 0x09EB, 0x9663, 0x09EC,
- 0x9664, 0x09F0, 0x966A, 0x0BD1, 0x966B, 0x20A6, 0x966C, 0x0BD9,
- 0x966D, 0x20A5, 0x966F, 0x20A8, 0x9670, 0x0BD5, 0x9671, 0x20A7,
- 0x9672, 0x0DA6, 0x9673, 0x0BD3, 0x9674, 0x0BD6, 0x9675, 0x0BD2,
- 0x9676, 0x0BD7, 0x9677, 0x0BD8, 0x9678, 0x0BD4, 0x967C, 0x20A4,
- 0x967D, 0x0DA2, 0x967E, 0x234F, 0x9680, 0x2353, 0x9683, 0x2352,
- 0x9684, 0x0DA7, 0x9685, 0x0DA3, 0x9686, 0x0DA4, 0x9687, 0x234E,
- 0x9688, 0x2350, 0x9689, 0x2351, 0x968A, 0x0D9F, 0x968B, 0x0DA1,
- 0x968D, 0x0DA5, 0x968E, 0x0DA0, 0x9691, 0x25F6, 0x9692, 0x25F4,
- 0x9693, 0x25F5, 0x9694, 0x0F5E, 0x9695, 0x0F5F, 0x9697, 0x25F7,
- 0x9698, 0x0F5D, 0x9699, 0x10E5, 0x969B, 0x10E7, 0x969C, 0x10E6,
- 0x969E, 0x2852, 0x96A1, 0x2853, 0x96A2, 0x2AB7, 0x96A4, 0x2AB6,
- 0x96A7, 0x1386, 0x96A8, 0x1387, 0x96A9, 0x2CF2, 0x96AA, 0x1388,
- 0x96AC, 0x2EB0, 0x96AE, 0x2EAE, 0x96B0, 0x2EAF, 0x96B1, 0x14AF,
- 0x96B3, 0x3020, 0x96B4, 0x15EC, 0x96B6, 0x0231, 0x96B8, 0x14B0,
- 0x96B9, 0x069F, 0x96BB, 0x09F3, 0x96BC, 0x1E31, 0x96BF, 0x20A9,
- 0x96C0, 0x0BDA, 0x96C1, 0x0DA8, 0x96C2, 0x2354, 0x96C3, 0x2356,
- 0x96C4, 0x0DAA, 0x96C5, 0x0DA9, 0x96C6, 0x0DAB, 0x96C7, 0x0DAC,
- 0x96C8, 0x2355, 0x96C9, 0x0F62, 0x96CA, 0x0F63, 0x96CB, 0x0F61,
- 0x96CC, 0x10E8, 0x96CD, 0x0F60, 0x96CE, 0x25F8, 0x96D2, 0x10E9,
- 0x96D3, 0x2AB8, 0x96D4, 0x2CF3, 0x96D5, 0x1389, 0x96D6, 0x14B1,
- 0x96D7, 0x3021, 0x96D8, 0x3025, 0x96D9, 0x1550, 0x96DA, 0x3022,
- 0x96DB, 0x1551, 0x96DC, 0x154F, 0x96DD, 0x3026, 0x96DE, 0x1552,
- 0x96DF, 0x3024, 0x96E1, 0x3165, 0x96E2, 0x154E, 0x96E3, 0x15ED,
- 0x96E5, 0x34A8, 0x96E8, 0x06A0, 0x96E9, 0x0BDC, 0x96EA, 0x0BDB,
- 0x96EF, 0x0DAD, 0x96F0, 0x2358, 0x96F1, 0x2357, 0x96F2, 0x0DAE,
- 0x96F5, 0x25FC, 0x96F6, 0x0F67, 0x96F7, 0x0F64, 0x96F8, 0x25FB,
- 0x96F9, 0x0F66, 0x96FA, 0x25F9, 0x96FB, 0x0F65, 0x96FD, 0x25FA,
- 0x96FF, 0x2854, 0x9700, 0x10EA, 0x9702, 0x2ABB, 0x9704, 0x1262,
- 0x9705, 0x2AB9, 0x9706, 0x1263, 0x9707, 0x1264, 0x9708, 0x2ABA,
- 0x9709, 0x1265, 0x970B, 0x2CF4, 0x970D, 0x138D, 0x970E, 0x138A,
- 0x970F, 0x138F, 0x9710, 0x2CF6, 0x9711, 0x138B, 0x9712, 0x2CF5,
- 0x9713, 0x138E, 0x9716, 0x138C, 0x9718, 0x2EB3, 0x9719, 0x2EB5,
- 0x971C, 0x14B2, 0x971D, 0x2EB4, 0x971E, 0x14B3, 0x971F, 0x2EB2,
- 0x9720, 0x2EB1, 0x9722, 0x3028, 0x9723, 0x3027, 0x9724, 0x1553,
- 0x9725, 0x3029, 0x9726, 0x316A, 0x9727, 0x15EF, 0x9728, 0x3169,
- 0x9729, 0x3166, 0x972A, 0x15EE, 0x972B, 0x3167, 0x972C, 0x3168,
- 0x972E, 0x326F, 0x972F, 0x3270, 0x9730, 0x1656, 0x9732, 0x16A3,
- 0x9735, 0x3331, 0x9738, 0x16A1, 0x9739, 0x16A2, 0x973A, 0x3332,
- 0x973D, 0x16E2, 0x973E, 0x16E3, 0x973F, 0x33D1, 0x9742, 0x1732,
- 0x9743, 0x34AA, 0x9744, 0x1734, 0x9746, 0x34A9, 0x9747, 0x34AB,
- 0x9748, 0x1733, 0x9749, 0x34F1, 0x974B, 0x3526, 0x9752, 0x06A1,
- 0x9756, 0x0F68, 0x9758, 0x2855, 0x975A, 0x2ABC, 0x975B, 0x1390,
- 0x975C, 0x1391, 0x975E, 0x06A2, 0x9760, 0x1266, 0x9761, 0x15F0,
- 0x9762, 0x0826, 0x9766, 0x1392, 0x9768, 0x1710, 0x9769, 0x0827,
- 0x976A, 0x20AA, 0x976C, 0x2359, 0x976E, 0x235B, 0x9770, 0x235A,
- 0x9772, 0x2600, 0x9773, 0x25FD, 0x9774, 0x0F69, 0x9776, 0x0F6A,
- 0x9777, 0x25FE, 0x9778, 0x25FF, 0x977A, 0x2857, 0x977B, 0x285C,
- 0x977C, 0x10EB, 0x977D, 0x2856, 0x977E, 0x2858, 0x977F, 0x285F,
- 0x9780, 0x285A, 0x9781, 0x285E, 0x9782, 0x285B, 0x9783, 0x2859,
- 0x9784, 0x285D, 0x9785, 0x10EC, 0x9788, 0x2ABF, 0x978A, 0x2ABD,
- 0x978B, 0x1268, 0x978D, 0x1267, 0x978E, 0x2ABE, 0x978F, 0x1269,
- 0x9794, 0x2CF9, 0x9797, 0x2CF8, 0x9798, 0x1393, 0x9799, 0x2CF7,
- 0x979A, 0x2EB6, 0x979C, 0x2EB8, 0x979D, 0x2EBA, 0x979E, 0x2EB9,
- 0x97A0, 0x14B4, 0x97A1, 0x2EB7, 0x97A2, 0x3030, 0x97A3, 0x1554,
- 0x97A4, 0x302E, 0x97A5, 0x3031, 0x97A6, 0x1555, 0x97A8, 0x302C,
- 0x97AA, 0x302F, 0x97AB, 0x302D, 0x97AC, 0x302A, 0x97AD, 0x1556,
- 0x97AE, 0x302B, 0x97B3, 0x316B, 0x97B6, 0x316D, 0x97B7, 0x316C,
- 0x97B9, 0x3271, 0x97BB, 0x3272, 0x97BF, 0x3333, 0x97C1, 0x16E5,
- 0x97C3, 0x16E4, 0x97C4, 0x344C, 0x97C5, 0x344D, 0x97C6, 0x1735,
- 0x97C7, 0x34AC, 0x97C9, 0x1756, 0x97CB, 0x0828, 0x97CC, 0x0DAF,
- 0x97CD, 0x2861, 0x97CE, 0x2860, 0x97CF, 0x2AC1, 0x97D0, 0x2AC0,
- 0x97D3, 0x14B5, 0x97D4, 0x2EBC, 0x97D5, 0x2EBB, 0x97D6, 0x3034,
- 0x97D7, 0x3032, 0x97D8, 0x3035, 0x97D9, 0x3033, 0x97DC, 0x15F1,
- 0x97DD, 0x316E, 0x97DE, 0x316F, 0x97DF, 0x3170, 0x97E1, 0x3334,
- 0x97E3, 0x33D2, 0x97E5, 0x34AD, 0x97ED, 0x0829, 0x97F0, 0x2CFA,
- 0x97F1, 0x2EBD, 0x97F3, 0x082A, 0x97F6, 0x10ED, 0x97F8, 0x2CFB,
- 0x97F9, 0x1557, 0x97FA, 0x3036, 0x97FB, 0x15F2, 0x97FD, 0x3273,
- 0x97FE, 0x3274, 0x97FF, 0x16A4, 0x9800, 0x344E, 0x9801, 0x082B,
- 0x9802, 0x0BDF, 0x9803, 0x0BE0, 0x9804, 0x20AB, 0x9805, 0x0DB0,
- 0x9806, 0x0DB1, 0x9807, 0x235C, 0x9808, 0x0DB2, 0x980A, 0x0F6E,
- 0x980C, 0x0F70, 0x980D, 0x2602, 0x980E, 0x2603, 0x980F, 0x2601,
- 0x9810, 0x0F6B, 0x9811, 0x0F6C, 0x9812, 0x0F6F, 0x9813, 0x0F6D,
- 0x9816, 0x2862, 0x9817, 0x10EE, 0x9818, 0x10EF, 0x981B, 0x2AC8,
- 0x981C, 0x126C, 0x981D, 0x2AC3, 0x981E, 0x2AC2, 0x9820, 0x2AC7,
- 0x9821, 0x126A, 0x9824, 0x139A, 0x9826, 0x2AC4, 0x9827, 0x2AC9,
- 0x9828, 0x2AC6, 0x9829, 0x2AC5, 0x982B, 0x126B, 0x982D, 0x1398,
- 0x982F, 0x2CFD, 0x9830, 0x1394, 0x9832, 0x2CFE, 0x9835, 0x2CFC,
- 0x9837, 0x1397, 0x9838, 0x1395, 0x9839, 0x1399, 0x983B, 0x1396,
- 0x9841, 0x2EBE, 0x9843, 0x2EC3, 0x9844, 0x2EBF, 0x9845, 0x2EC2,
- 0x9846, 0x14B6, 0x9848, 0x2DF2, 0x9849, 0x2EC1, 0x984A, 0x2EC0,
- 0x984C, 0x155A, 0x984D, 0x1558, 0x984E, 0x155B, 0x984F, 0x1559,
- 0x9850, 0x3037, 0x9851, 0x3038, 0x9852, 0x3039, 0x9853, 0x155C,
- 0x9857, 0x3174, 0x9858, 0x15F4, 0x9859, 0x3172, 0x985B, 0x15F5,
- 0x985C, 0x3171, 0x985D, 0x3173, 0x985E, 0x15F3, 0x985F, 0x3278,
- 0x9860, 0x3275, 0x9862, 0x3276, 0x9863, 0x3277, 0x9864, 0x3335,
- 0x9865, 0x16A6, 0x9867, 0x16A5, 0x9869, 0x33D4, 0x986A, 0x33D3,
- 0x986B, 0x16E6, 0x986F, 0x1711, 0x9870, 0x1736, 0x9871, 0x174D,
- 0x9872, 0x34F2, 0x9873, 0x3527, 0x9874, 0x3528, 0x98A8, 0x082C,
- 0x98A9, 0x235D, 0x98AC, 0x2604, 0x98AD, 0x2863, 0x98AE, 0x2864,
- 0x98AF, 0x10F0, 0x98B1, 0x10F1, 0x98B2, 0x2ACA, 0x98B3, 0x126D,
- 0x98B6, 0x14B7, 0x98B8, 0x303A, 0x98BA, 0x155D, 0x98BB, 0x3177,
- 0x98BC, 0x15F6, 0x98BD, 0x3176, 0x98BE, 0x3178, 0x98BF, 0x3175,
- 0x98C0, 0x3338, 0x98C1, 0x3279, 0x98C2, 0x327A, 0x98C4, 0x1657,
- 0x98C6, 0x3337, 0x98C9, 0x3336, 0x98CB, 0x33D5, 0x98CC, 0x3529,
- 0x98DB, 0x082D, 0x98DF, 0x082E, 0x98E2, 0x09F4, 0x98E3, 0x1E32,
- 0x98E5, 0x20AC, 0x98E7, 0x0DB3, 0x98E9, 0x0DB6, 0x98EA, 0x0DB4,
- 0x98EB, 0x235E, 0x98ED, 0x0DB8, 0x98EF, 0x0DB5, 0x98F2, 0x0DB7,
- 0x98F4, 0x0F72, 0x98F6, 0x2605, 0x98F9, 0x2606, 0x98FA, 0x2ACC,
- 0x98FC, 0x0F71, 0x98FD, 0x0F73, 0x98FE, 0x0F74, 0x9900, 0x2866,
- 0x9902, 0x2865, 0x9903, 0x10F2, 0x9905, 0x10F3, 0x9907, 0x2867,
- 0x9908, 0x2ACB, 0x9909, 0x10F5, 0x990A, 0x126E, 0x990C, 0x10F4,
- 0x9910, 0x139B, 0x9911, 0x2ACD, 0x9912, 0x1270, 0x9913, 0x126F,
- 0x9914, 0x2ACE, 0x9915, 0x2AD1, 0x9916, 0x2ACF, 0x9917, 0x2AD0,
- 0x9918, 0x1271, 0x991A, 0x13A0, 0x991B, 0x139E, 0x991E, 0x139D,
- 0x991F, 0x2D00, 0x9921, 0x139F, 0x9924, 0x2CFF, 0x9925, 0x2EC4,
- 0x9927, 0x2D01, 0x9928, 0x139C, 0x9929, 0x2D02, 0x992A, 0x2EC7,
- 0x992B, 0x2EC5, 0x992C, 0x2EC6, 0x992D, 0x2ECB, 0x992E, 0x1561,
- 0x992F, 0x2ECA, 0x9930, 0x2ECD, 0x9931, 0x2ECC, 0x9932, 0x2EC9,
- 0x9933, 0x2EC8, 0x9935, 0x14B8, 0x993A, 0x303D, 0x993C, 0x303C,
- 0x993D, 0x1560, 0x993E, 0x155E, 0x993F, 0x155F, 0x9941, 0x303B,
- 0x9943, 0x317B, 0x9945, 0x15F7, 0x9947, 0x317A, 0x9948, 0x3179,
- 0x9949, 0x15F8, 0x994B, 0x327F, 0x994C, 0x327E, 0x994E, 0x327C,
- 0x9950, 0x327B, 0x9951, 0x1659, 0x9952, 0x1658, 0x9953, 0x3280,
- 0x9954, 0x33D6, 0x9955, 0x16E7, 0x9956, 0x333A, 0x9957, 0x16A7,
- 0x9958, 0x3339, 0x9959, 0x327D, 0x995B, 0x33D7, 0x995C, 0x1712,
- 0x995E, 0x174E, 0x995F, 0x34F3, 0x9961, 0x352A, 0x9996, 0x082F,
- 0x9997, 0x20AD, 0x9998, 0x2ECE, 0x9999, 0x0830, 0x999C, 0x2869,
- 0x999D, 0x2868, 0x999E, 0x2D03, 0x99A1, 0x2ED0, 0x99A3, 0x2ECF,
- 0x99A5, 0x1562, 0x99A6, 0x317C, 0x99A7, 0x317D, 0x99A8, 0x165A,
- 0x99AB, 0x352B, 0x99AC, 0x09F5, 0x99AD, 0x0DBA, 0x99AE, 0x0DB9,
- 0x99AF, 0x2607, 0x99B0, 0x2609, 0x99B1, 0x0F76, 0x99B2, 0x2608,
- 0x99B3, 0x0F75, 0x99B4, 0x0F77, 0x99B5, 0x260A, 0x99B9, 0x286B,
- 0x99BA, 0x286D, 0x99BB, 0x286C, 0x99BD, 0x286F, 0x99C1, 0x10F6,
- 0x99C2, 0x286E, 0x99C3, 0x286A, 0x99C7, 0x2870, 0x99C9, 0x2AD8,
- 0x99CB, 0x2ADB, 0x99CC, 0x2ADD, 0x99CD, 0x2AD3, 0x99CE, 0x2AD7,
- 0x99CF, 0x2AD4, 0x99D0, 0x1273, 0x99D1, 0x1276, 0x99D2, 0x1278,
- 0x99D3, 0x2AD5, 0x99D4, 0x2AD6, 0x99D5, 0x1277, 0x99D6, 0x2AD9,
- 0x99D7, 0x2ADC, 0x99D8, 0x2ADA, 0x99D9, 0x1279, 0x99DB, 0x1275,
- 0x99DC, 0x2AD2, 0x99DD, 0x1272, 0x99DF, 0x1274, 0x99E2, 0x13A2,
- 0x99E3, 0x2D09, 0x99E4, 0x2D07, 0x99E5, 0x2D06, 0x99E7, 0x2D0C,
- 0x99E9, 0x2D0B, 0x99EA, 0x2D0A, 0x99EC, 0x2D05, 0x99ED, 0x13A1,
- 0x99EE, 0x2D04, 0x99F0, 0x2D08, 0x99F1, 0x13A3, 0x99F4, 0x2ED3,
- 0x99F6, 0x2ED7, 0x99F7, 0x2ED4, 0x99F8, 0x2ED6, 0x99F9, 0x2ED5,
- 0x99FA, 0x2ED2, 0x99FB, 0x2ED8, 0x99FC, 0x2EDB, 0x99FD, 0x2ED9,
- 0x99FE, 0x2EDA, 0x99FF, 0x14BA, 0x9A01, 0x14B9, 0x9A02, 0x2ED1,
- 0x9A03, 0x2EDC, 0x9A04, 0x3042, 0x9A05, 0x3045, 0x9A06, 0x3047,
- 0x9A07, 0x3046, 0x9A09, 0x3040, 0x9A0A, 0x3044, 0x9A0B, 0x303F,
- 0x9A0D, 0x3041, 0x9A0E, 0x1563, 0x9A0F, 0x303E, 0x9A11, 0x3043,
- 0x9A14, 0x318A, 0x9A15, 0x317F, 0x9A16, 0x15F9, 0x9A19, 0x15FA,
- 0x9A1A, 0x317E, 0x9A1B, 0x3183, 0x9A1C, 0x3189, 0x9A1D, 0x3181,
- 0x9A1E, 0x3188, 0x9A20, 0x3185, 0x9A22, 0x3184, 0x9A23, 0x3187,
- 0x9A24, 0x3182, 0x9A25, 0x3180, 0x9A27, 0x3186, 0x9A29, 0x3287,
- 0x9A2A, 0x3285, 0x9A2B, 0x165B, 0x9A2C, 0x3284, 0x9A2D, 0x328A,
- 0x9A2E, 0x3288, 0x9A30, 0x165C, 0x9A31, 0x3283, 0x9A32, 0x3281,
- 0x9A34, 0x3282, 0x9A35, 0x165E, 0x9A36, 0x3286, 0x9A37, 0x165D,
- 0x9A38, 0x3289, 0x9A39, 0x333B, 0x9A3A, 0x3341, 0x9A3D, 0x333C,
- 0x9A3E, 0x16AB, 0x9A3F, 0x3342, 0x9A40, 0x16AA, 0x9A41, 0x3340,
- 0x9A42, 0x333F, 0x9A43, 0x16A9, 0x9A44, 0x333E, 0x9A45, 0x16A8,
- 0x9A46, 0x333D, 0x9A48, 0x33DD, 0x9A49, 0x33DF, 0x9A4A, 0x33DE,
- 0x9A4C, 0x33DB, 0x9A4D, 0x16E9, 0x9A4E, 0x33D8, 0x9A4F, 0x33DC,
- 0x9A50, 0x33E1, 0x9A52, 0x33E0, 0x9A53, 0x33D9, 0x9A54, 0x33DA,
- 0x9A55, 0x16E8, 0x9A56, 0x344F, 0x9A57, 0x1715, 0x9A59, 0x3450,
- 0x9A5A, 0x1713, 0x9A5B, 0x1714, 0x9A5E, 0x34AE, 0x9A5F, 0x1737,
- 0x9A60, 0x3510, 0x9A62, 0x1757, 0x9A64, 0x352C, 0x9A65, 0x1758,
- 0x9A66, 0x352D, 0x9A67, 0x352E, 0x9A68, 0x353C, 0x9A69, 0x353B,
- 0x9A6A, 0x1767, 0x9A6B, 0x3544, 0x9AA8, 0x09F6, 0x9AAB, 0x260C,
- 0x9AAD, 0x260B, 0x9AAF, 0x10F7, 0x9AB0, 0x10F8, 0x9AB1, 0x2871,
- 0x9AB3, 0x2ADE, 0x9AB4, 0x2D0F, 0x9AB7, 0x127A, 0x9AB8, 0x13A4,
- 0x9AB9, 0x2D0D, 0x9ABB, 0x2D10, 0x9ABC, 0x13A5, 0x9ABE, 0x2EDD,
- 0x9ABF, 0x2D0E, 0x9AC0, 0x3048, 0x9AC1, 0x1564, 0x9AC2, 0x318B,
- 0x9AC6, 0x328D, 0x9AC7, 0x328B, 0x9ACA, 0x328C, 0x9ACD, 0x3343,
- 0x9ACF, 0x16AC, 0x9AD0, 0x33E2, 0x9AD1, 0x1718, 0x9AD2, 0x16EA,
- 0x9AD3, 0x1716, 0x9AD4, 0x1717, 0x9AD5, 0x34AF, 0x9AD6, 0x174F,
- 0x9AD8, 0x09F7, 0x9ADC, 0x3049, 0x9ADF, 0x1E33, 0x9AE1, 0x0F78,
- 0x9AE3, 0x2872, 0x9AE6, 0x10F9, 0x9AE7, 0x2873, 0x9AEB, 0x2AE0,
- 0x9AEC, 0x2ADF, 0x9AED, 0x13A7, 0x9AEE, 0x127B, 0x9AEF, 0x127C,
- 0x9AF1, 0x2AE3, 0x9AF2, 0x2AE2, 0x9AF3, 0x2AE1, 0x9AF6, 0x2D11,
- 0x9AF7, 0x2D14, 0x9AF9, 0x2D13, 0x9AFA, 0x2D12, 0x9AFB, 0x13A6,
- 0x9AFC, 0x2EE1, 0x9AFD, 0x2EDF, 0x9AFE, 0x2EDE, 0x9B01, 0x2EE0,
- 0x9B03, 0x1565, 0x9B04, 0x304B, 0x9B05, 0x304C, 0x9B06, 0x1566,
- 0x9B08, 0x304A, 0x9B0A, 0x318D, 0x9B0B, 0x318C, 0x9B0C, 0x318F,
- 0x9B0D, 0x15FB, 0x9B0E, 0x318E, 0x9B10, 0x328E, 0x9B11, 0x3290,
- 0x9B12, 0x328F, 0x9B15, 0x3344, 0x9B16, 0x3347, 0x9B17, 0x3345,
- 0x9B18, 0x3346, 0x9B19, 0x33E3, 0x9B1A, 0x16EB, 0x9B1E, 0x3451,
- 0x9B1F, 0x3452, 0x9B20, 0x3453, 0x9B22, 0x1738, 0x9B23, 0x1750,
- 0x9B24, 0x352F, 0x9B25, 0x09F8, 0x9B27, 0x127D, 0x9B28, 0x13A8,
- 0x9B29, 0x304D, 0x9B2B, 0x33E4, 0x9B2E, 0x3511, 0x9B2F, 0x1E34,
- 0x9B31, 0x1768, 0x9B32, 0x09F9, 0x9B33, 0x2D15, 0x9B35, 0x304E,
- 0x9B37, 0x3190, 0x9B3A, 0x3348, 0x9B3B, 0x33E5, 0x9B3C, 0x09FA,
- 0x9B3E, 0x2874, 0x9B3F, 0x2875, 0x9B41, 0x10FA, 0x9B42, 0x10FB,
- 0x9B43, 0x2AE5, 0x9B44, 0x127F, 0x9B45, 0x127E, 0x9B46, 0x2AE4,
- 0x9B48, 0x2EE2, 0x9B4A, 0x304F, 0x9B4B, 0x3051, 0x9B4C, 0x3050,
- 0x9B4D, 0x1569, 0x9B4E, 0x1568, 0x9B4F, 0x1567, 0x9B51, 0x16AE,
- 0x9B52, 0x3349, 0x9B54, 0x16AD, 0x9B55, 0x33E7, 0x9B56, 0x33E6,
- 0x9B58, 0x1739, 0x9B59, 0x34B0, 0x9B5A, 0x0BE1, 0x9B5B, 0x260D,
- 0x9B5F, 0x2878, 0x9B60, 0x2876, 0x9B61, 0x2877, 0x9B64, 0x2AEE,
- 0x9B66, 0x2AE9, 0x9B67, 0x2AE6, 0x9B68, 0x2AED, 0x9B6C, 0x2AEF,
- 0x9B6F, 0x1281, 0x9B70, 0x2AEC, 0x9B71, 0x2AE8, 0x9B74, 0x2AE7,
- 0x9B75, 0x2AEB, 0x9B76, 0x2AEA, 0x9B77, 0x1280, 0x9B7A, 0x2D20,
- 0x9B7B, 0x2D1B, 0x9B7C, 0x2D19, 0x9B7D, 0x2D22, 0x9B7E, 0x2D1A,
- 0x9B80, 0x2D16, 0x9B82, 0x2D1C, 0x9B85, 0x2D17, 0x9B86, 0x2EEB,
- 0x9B87, 0x2D18, 0x9B88, 0x2D23, 0x9B90, 0x2D1F, 0x9B91, 0x13A9,
- 0x9B92, 0x2D1E, 0x9B93, 0x2D1D, 0x9B95, 0x2D21, 0x9B9A, 0x2EE3,
- 0x9B9B, 0x2EE6, 0x9B9E, 0x2EE5, 0x9BA0, 0x2EED, 0x9BA1, 0x2EE8,
- 0x9BA2, 0x2EEC, 0x9BA4, 0x2EEA, 0x9BA5, 0x2EE9, 0x9BA6, 0x2EE7,
- 0x9BA8, 0x2EE4, 0x9BAA, 0x14BD, 0x9BAB, 0x14BC, 0x9BAD, 0x14BE,
- 0x9BAE, 0x14BB, 0x9BAF, 0x2EEE, 0x9BB5, 0x3057, 0x9BB6, 0x305A,
- 0x9BB8, 0x3058, 0x9BB9, 0x305C, 0x9BBD, 0x305D, 0x9BBF, 0x3055,
- 0x9BC0, 0x156E, 0x9BC1, 0x3056, 0x9BC3, 0x3054, 0x9BC4, 0x305B,
- 0x9BC6, 0x3053, 0x9BC7, 0x3052, 0x9BC8, 0x156D, 0x9BC9, 0x156B,
- 0x9BCA, 0x156A, 0x9BD3, 0x3059, 0x9BD4, 0x3199, 0x9BD5, 0x319F,
- 0x9BD6, 0x15FE, 0x9BD7, 0x319A, 0x9BD9, 0x319D, 0x9BDA, 0x31A1,
- 0x9BDB, 0x15FF, 0x9BDC, 0x319C, 0x9BDE, 0x3194, 0x9BE0, 0x3193,
- 0x9BE1, 0x31A0, 0x9BE2, 0x3197, 0x9BE4, 0x3195, 0x9BE5, 0x319E,
- 0x9BE6, 0x3196, 0x9BE7, 0x15FD, 0x9BE8, 0x15FC, 0x9BEA, 0x3191,
- 0x9BEB, 0x3192, 0x9BEC, 0x319B, 0x9BF0, 0x3198, 0x9BF7, 0x3293,
- 0x9BF8, 0x3296, 0x9BFD, 0x156C, 0x9C05, 0x3294, 0x9C06, 0x329A,
- 0x9C07, 0x3298, 0x9C08, 0x3292, 0x9C09, 0x329D, 0x9C0B, 0x3291,
- 0x9C0D, 0x1660, 0x9C0E, 0x3299, 0x9C12, 0x3295, 0x9C13, 0x165F,
- 0x9C14, 0x329C, 0x9C17, 0x329B, 0x9C1C, 0x334C, 0x9C1D, 0x334B,
- 0x9C21, 0x3352, 0x9C23, 0x334E, 0x9C24, 0x3351, 0x9C25, 0x16B0,
- 0x9C28, 0x334F, 0x9C29, 0x3350, 0x9C2B, 0x334A, 0x9C2C, 0x334D,
- 0x9C2D, 0x16AF, 0x9C31, 0x16ED, 0x9C32, 0x33F2, 0x9C33, 0x33ED,
- 0x9C34, 0x33F1, 0x9C36, 0x33F4, 0x9C37, 0x33F0, 0x9C39, 0x33EC,
- 0x9C3B, 0x16EF, 0x9C3C, 0x33EF, 0x9C3D, 0x33F3, 0x9C3E, 0x16EE,
- 0x9C3F, 0x33EA, 0x9C40, 0x3297, 0x9C41, 0x33EE, 0x9C44, 0x33EB,
- 0x9C46, 0x33E8, 0x9C48, 0x33E9, 0x9C49, 0x16EC, 0x9C4A, 0x3457,
- 0x9C4B, 0x3459, 0x9C4C, 0x345C, 0x9C4D, 0x3458, 0x9C4E, 0x345D,
- 0x9C50, 0x3456, 0x9C52, 0x3454, 0x9C54, 0x1719, 0x9C55, 0x345A,
- 0x9C56, 0x171B, 0x9C57, 0x171A, 0x9C58, 0x3455, 0x9C59, 0x345B,
- 0x9C5E, 0x34B5, 0x9C5F, 0x173A, 0x9C60, 0x34B6, 0x9C62, 0x34B4,
- 0x9C63, 0x34B1, 0x9C66, 0x34B3, 0x9C67, 0x34B2, 0x9C68, 0x34F4,
- 0x9C6D, 0x34F6, 0x9C6E, 0x34F5, 0x9C71, 0x3514, 0x9C73, 0x3513,
- 0x9C74, 0x3512, 0x9C75, 0x3515, 0x9C77, 0x1760, 0x9C78, 0x1761,
- 0x9C79, 0x3541, 0x9C7A, 0x3545, 0x9CE5, 0x0BE2, 0x9CE6, 0x235F,
- 0x9CE7, 0x2610, 0x9CE9, 0x0F79, 0x9CEA, 0x260E, 0x9CED, 0x260F,
- 0x9CF1, 0x2879, 0x9CF2, 0x287A, 0x9CF3, 0x10FE, 0x9CF4, 0x10FC,
- 0x9CF5, 0x287B, 0x9CF6, 0x10FD, 0x9CF7, 0x2AF4, 0x9CF9, 0x2AF7,
- 0x9CFA, 0x2AF1, 0x9CFB, 0x2AF8, 0x9CFC, 0x2AF0, 0x9CFD, 0x2AF2,
- 0x9CFF, 0x2AF3, 0x9D00, 0x2AF6, 0x9D03, 0x1284, 0x9D04, 0x2AFB,
- 0x9D05, 0x2AFA, 0x9D06, 0x1282, 0x9D07, 0x2AF5, 0x9D08, 0x2AF9,
- 0x9D09, 0x1283, 0x9D10, 0x2D2D, 0x9D12, 0x13AE, 0x9D14, 0x2D28,
- 0x9D15, 0x13AA, 0x9D17, 0x2D25, 0x9D18, 0x2D2B, 0x9D19, 0x2D2E,
- 0x9D1B, 0x13AF, 0x9D1D, 0x2D2A, 0x9D1E, 0x2D27, 0x9D1F, 0x2D2F,
- 0x9D20, 0x2D26, 0x9D22, 0x2D2C, 0x9D23, 0x13AB, 0x9D25, 0x2D24,
- 0x9D26, 0x13AC, 0x9D28, 0x13AD, 0x9D29, 0x2D29, 0x9D2D, 0x2F00,
- 0x9D2E, 0x2EF3, 0x9D2F, 0x2EF4, 0x9D30, 0x2EF7, 0x9D31, 0x2EF5,
- 0x9D33, 0x2EEF, 0x9D36, 0x2EF2, 0x9D37, 0x2EFC, 0x9D38, 0x2EF6,
- 0x9D3B, 0x14BF, 0x9D3D, 0x2EFE, 0x9D3E, 0x2EFB, 0x9D3F, 0x14C0,
- 0x9D40, 0x2EFD, 0x9D41, 0x2EF0, 0x9D42, 0x2EF9, 0x9D43, 0x2EFA,
- 0x9D45, 0x2EF8, 0x9D4A, 0x3061, 0x9D4B, 0x3063, 0x9D4C, 0x3066,
- 0x9D4F, 0x3060, 0x9D51, 0x156F, 0x9D52, 0x3068, 0x9D53, 0x305F,
- 0x9D54, 0x3069, 0x9D56, 0x3065, 0x9D57, 0x3067, 0x9D58, 0x306B,
- 0x9D59, 0x3064, 0x9D5A, 0x306C, 0x9D5B, 0x3062, 0x9D5C, 0x305E,
- 0x9D5D, 0x1570, 0x9D5F, 0x306A, 0x9D60, 0x1571, 0x9D61, 0x1601,
- 0x9D67, 0x2EF1, 0x9D68, 0x31BB, 0x9D69, 0x31B2, 0x9D6A, 0x1603,
- 0x9D6B, 0x31AE, 0x9D6C, 0x1604, 0x9D6F, 0x31B7, 0x9D70, 0x31B1,
- 0x9D71, 0x31A7, 0x9D72, 0x1602, 0x9D73, 0x31B4, 0x9D74, 0x31AF,
- 0x9D75, 0x31B0, 0x9D77, 0x31A2, 0x9D78, 0x31A9, 0x9D79, 0x31B8,
- 0x9D7B, 0x31B5, 0x9D7D, 0x31AD, 0x9D7F, 0x31B9, 0x9D80, 0x31A8,
- 0x9D81, 0x31A3, 0x9D82, 0x31B6, 0x9D84, 0x31A5, 0x9D85, 0x31B3,
- 0x9D86, 0x31AA, 0x9D87, 0x31BA, 0x9D88, 0x31A6, 0x9D89, 0x1600,
- 0x9D8A, 0x31A4, 0x9D8B, 0x31AB, 0x9D8C, 0x31AC, 0x9D90, 0x32A4,
- 0x9D92, 0x32A2, 0x9D94, 0x32A7, 0x9D96, 0x32B3, 0x9D97, 0x32AA,
- 0x9D98, 0x32A3, 0x9D99, 0x329F, 0x9D9A, 0x32AC, 0x9D9B, 0x32A5,
- 0x9D9C, 0x32A8, 0x9D9D, 0x32A1, 0x9D9E, 0x32AF, 0x9D9F, 0x329E,
- 0x9DA0, 0x32A6, 0x9DA1, 0x32AB, 0x9DA2, 0x32AD, 0x9DA3, 0x32B0,
- 0x9DA4, 0x32A0, 0x9DA6, 0x32B4, 0x9DA7, 0x32B5, 0x9DA8, 0x32AE,
- 0x9DA9, 0x32B2, 0x9DAA, 0x32A9, 0x9DAC, 0x3362, 0x9DAD, 0x3365,
- 0x9DAF, 0x16B1, 0x9DB1, 0x3364, 0x9DB2, 0x3369, 0x9DB3, 0x3367,
- 0x9DB4, 0x16B2, 0x9DB5, 0x335E, 0x9DB6, 0x3354, 0x9DB7, 0x3353,
- 0x9DB8, 0x16B4, 0x9DB9, 0x3360, 0x9DBA, 0x3361, 0x9DBB, 0x335D,
- 0x9DBC, 0x3355, 0x9DBE, 0x335A, 0x9DBF, 0x32B1, 0x9DC1, 0x3356,
- 0x9DC2, 0x16B3, 0x9DC3, 0x335C, 0x9DC5, 0x335B, 0x9DC7, 0x3357,
- 0x9DC8, 0x3363, 0x9DCA, 0x3358, 0x9DCB, 0x33F9, 0x9DCC, 0x3366,
- 0x9DCD, 0x3368, 0x9DCE, 0x335F, 0x9DCF, 0x3359, 0x9DD0, 0x33FA,
- 0x9DD1, 0x33FC, 0x9DD2, 0x33F6, 0x9DD3, 0x16F0, 0x9DD5, 0x3403,
- 0x9DD6, 0x3401, 0x9DD7, 0x16F1, 0x9DD8, 0x3400, 0x9DD9, 0x33FF,
- 0x9DDA, 0x33F8, 0x9DDB, 0x33F5, 0x9DDC, 0x33FB, 0x9DDD, 0x3404,
- 0x9DDE, 0x33F7, 0x9DDF, 0x33FD, 0x9DE1, 0x3466, 0x9DE2, 0x346B,
- 0x9DE3, 0x3461, 0x9DE4, 0x3464, 0x9DE5, 0x171C, 0x9DE6, 0x3468,
- 0x9DE8, 0x346F, 0x9DE9, 0x33FE, 0x9DEB, 0x3462, 0x9DEC, 0x346C,
- 0x9DED, 0x3470, 0x9DEE, 0x3467, 0x9DEF, 0x3460, 0x9DF0, 0x346A,
- 0x9DF2, 0x3469, 0x9DF3, 0x346E, 0x9DF4, 0x346D, 0x9DF5, 0x3402,
- 0x9DF6, 0x3465, 0x9DF7, 0x345F, 0x9DF8, 0x3463, 0x9DF9, 0x173B,
- 0x9DFA, 0x173C, 0x9DFB, 0x345E, 0x9DFD, 0x34C1, 0x9DFE, 0x34B8,
- 0x9DFF, 0x34C0, 0x9E00, 0x34BD, 0x9E01, 0x34BE, 0x9E02, 0x34B7,
- 0x9E03, 0x34BA, 0x9E04, 0x34C2, 0x9E05, 0x34BC, 0x9E06, 0x34BB,
- 0x9E07, 0x34B9, 0x9E09, 0x34BF, 0x9E0B, 0x34F7, 0x9E0D, 0x34F8,
- 0x9E0F, 0x34FA, 0x9E10, 0x34F9, 0x9E11, 0x34FC, 0x9E12, 0x34FB,
- 0x9E13, 0x3517, 0x9E14, 0x3516, 0x9E15, 0x3530, 0x9E17, 0x3531,
- 0x9E19, 0x353D, 0x9E1A, 0x1765, 0x9E1B, 0x1769, 0x9E1D, 0x3546,
- 0x9E1E, 0x176A, 0x9E75, 0x0BE3, 0x9E79, 0x1661, 0x9E7A, 0x336A,
- 0x9E7C, 0x173D, 0x9E7D, 0x173E, 0x9E7F, 0x0BE4, 0x9E80, 0x2611,
- 0x9E82, 0x0F7A, 0x9E83, 0x2AFC, 0x9E86, 0x2D31, 0x9E87, 0x2D32,
- 0x9E88, 0x2D30, 0x9E89, 0x2F02, 0x9E8A, 0x2F01, 0x9E8B, 0x14C1,
- 0x9E8C, 0x306E, 0x9E8D, 0x2F03, 0x9E8E, 0x306D, 0x9E91, 0x31BD,
- 0x9E92, 0x1605, 0x9E93, 0x1607, 0x9E94, 0x31BC, 0x9E97, 0x1606,
- 0x9E99, 0x32B6, 0x9E9A, 0x32B8, 0x9E9B, 0x32B7, 0x9E9C, 0x336B,
- 0x9E9D, 0x16B5, 0x9E9F, 0x171D, 0x9EA0, 0x34C3, 0x9EA1, 0x34FD,
- 0x9EA4, 0x354A, 0x9EA5, 0x0BE5, 0x9EA7, 0x287C, 0x9EA9, 0x1285,
- 0x9EAD, 0x2D34, 0x9EAE, 0x2D33, 0x9EB0, 0x2F04, 0x9EB4, 0x1608,
- 0x9EB5, 0x1662, 0x9EB6, 0x3405, 0x9EB7, 0x3542, 0x9EBB, 0x0BE6,
- 0x9EBC, 0x10FF, 0x9EBE, 0x1286, 0x9EC0, 0x31BE, 0x9EC2, 0x3471,
- 0x9EC3, 0x0DBB, 0x9EC8, 0x2F05, 0x9ECC, 0x1751, 0x9ECD, 0x0DBC,
- 0x9ECE, 0x1287, 0x9ECF, 0x14C2, 0x9ED0, 0x3472, 0x9ED1, 0x0DBD,
- 0x9ED3, 0x2AFD, 0x9ED4, 0x13B1, 0x9ED5, 0x2D35, 0x9ED6, 0x2D36,
- 0x9ED8, 0x13B0, 0x9EDA, 0x2F06, 0x9EDB, 0x14C6, 0x9EDC, 0x14C4,
- 0x9EDD, 0x14C5, 0x9EDE, 0x14C3, 0x9EDF, 0x306F, 0x9EE0, 0x1572,
- 0x9EE4, 0x32BA, 0x9EE5, 0x32B9, 0x9EE6, 0x32BC, 0x9EE7, 0x32BB,
- 0x9EE8, 0x1663, 0x9EEB, 0x336C, 0x9EED, 0x336E, 0x9EEE, 0x336D,
- 0x9EEF, 0x16B6, 0x9EF0, 0x3406, 0x9EF2, 0x3473, 0x9EF3, 0x3474,
- 0x9EF4, 0x171E, 0x9EF5, 0x34FE, 0x9EF6, 0x3518, 0x9EF7, 0x1762,
- 0x9EF9, 0x2360, 0x9EFA, 0x2D37, 0x9EFB, 0x2F07, 0x9EFC, 0x31BF,
- 0x9EFD, 0x2612, 0x9EFF, 0x2F08, 0x9F00, 0x3071, 0x9F01, 0x3070,
- 0x9F06, 0x3475, 0x9F07, 0x173F, 0x9F09, 0x34FF, 0x9F0A, 0x3519,
- 0x9F0E, 0x0F7B, 0x9F0F, 0x2AFE, 0x9F10, 0x2AFF, 0x9F12, 0x2D38,
- 0x9F13, 0x0F7C, 0x9F15, 0x1573, 0x9F16, 0x3072, 0x9F18, 0x3370,
- 0x9F19, 0x16B7, 0x9F1A, 0x3371, 0x9F1B, 0x336F, 0x9F1C, 0x3476,
- 0x9F1E, 0x34C4, 0x9F20, 0x0F7D, 0x9F22, 0x2F0B, 0x9F23, 0x2F0A,
- 0x9F24, 0x2F09, 0x9F25, 0x3073, 0x9F28, 0x3077, 0x9F29, 0x3076,
- 0x9F2A, 0x3075, 0x9F2B, 0x3074, 0x9F2C, 0x1574, 0x9F2D, 0x31C0,
- 0x9F2E, 0x32BE, 0x9F2F, 0x1664, 0x9F30, 0x32BD, 0x9F31, 0x3372,
- 0x9F32, 0x3409, 0x9F33, 0x3408, 0x9F34, 0x16F2, 0x9F35, 0x3407,
- 0x9F36, 0x3479, 0x9F37, 0x3478, 0x9F38, 0x3477, 0x9F3B, 0x1100,
- 0x9F3D, 0x2D39, 0x9F3E, 0x14C7, 0x9F40, 0x31C1, 0x9F41, 0x31C2,
- 0x9F42, 0x340A, 0x9F43, 0x347A, 0x9F46, 0x34C5, 0x9F47, 0x3500,
- 0x9F48, 0x3532, 0x9F49, 0x354C, 0x9F4A, 0x1101, 0x9F4B, 0x14C8,
- 0x9F4C, 0x3078, 0x9F4D, 0x31C3, 0x9F4E, 0x3373, 0x9F4F, 0x347B,
- 0x9F52, 0x1289, 0x9F54, 0x2F0C, 0x9F55, 0x3079, 0x9F56, 0x31C4,
- 0x9F57, 0x31C5, 0x9F58, 0x31C6, 0x9F59, 0x32C3, 0x9F5B, 0x32BF,
- 0x9F5C, 0x16B8, 0x9F5D, 0x32C2, 0x9F5E, 0x32C1, 0x9F5F, 0x1665,
- 0x9F60, 0x32C0, 0x9F61, 0x1667, 0x9F63, 0x1666, 0x9F64, 0x3375,
- 0x9F65, 0x3374, 0x9F66, 0x16B9, 0x9F67, 0x16BA, 0x9F6A, 0x16F4,
- 0x9F6B, 0x340B, 0x9F6C, 0x16F3, 0x9F6E, 0x347E, 0x9F6F, 0x347F,
- 0x9F70, 0x347D, 0x9F71, 0x347C, 0x9F72, 0x1741, 0x9F74, 0x34C6,
- 0x9F75, 0x34C7, 0x9F76, 0x34C8, 0x9F77, 0x1740, 0x9F78, 0x3501,
- 0x9F79, 0x3504, 0x9F7A, 0x3503, 0x9F7B, 0x3502, 0x9F7E, 0x354B,
- 0x9F8D, 0x13B2, 0x9F90, 0x157C, 0x9F91, 0x32C4, 0x9F92, 0x3376,
- 0x9F94, 0x16F5, 0x9F95, 0x340C, 0x9F98, 0x354D, 0x9F9C, 0x13B3,
- 0x9FA0, 0x2F0D, 0x9FA2, 0x340D, 0x9FA4, 0x351A, 0xE01F, 0x083A,
- 0xE026, 0x09FD, 0xE05B, 0x030D, 0xE063, 0x016B, 0xE073, 0x0860,
- 0xE0F3, 0x0C23, 0xE12E, 0x17E4, 0xE149, 0x212F, 0xE191, 0x115F,
- 0xE1BA, 0x0C79, 0xE1C9, 0x04C3, 0xE22C, 0x18BD, 0xE22D, 0x0CBD,
- 0xE230, 0x0CA5, 0xE266, 0x0CCE, 0xE2A3, 0x0E84, 0xE2BC, 0x0120,
- 0xE2EF, 0x1BA8, 0xE33A, 0x1055, 0xE340, 0x2DE8, 0xE34F, 0x0121,
- 0xE35A, 0x106B, 0xE363, 0x1326, 0xE37C, 0x066B, 0xE37F, 0x132E,
- 0xE3C5, 0x0D35, 0xE3D7, 0x27C2, 0xE3DC, 0x22AD, 0xE417, 0x134C,
- 0xE44A, 0x09CE, 0xE478, 0x0BC7, 0xE485, 0x36E9, 0xE4C5, 0x1391,
- 0xE4DA, 0x16A4, 0xE545, 0x3072, 0xE5D2, 0x0119, 0xE5D3, 0x011A,
- 0xE5D4, 0x011C, 0xE5D5, 0x011B, 0xE5F4, 0x297C, 0xE6C6, 0x1D06,
- 0xE727, 0x29A1, 0xE7D3, 0x181B, 0xE893, 0x2B24, 0xEB40, 0x2F50,
- 0xEB42, 0x1725, 0xEB45, 0x32ED, 0xEB6E, 0x2AD9, 0xEB86, 0x1C14,
- 0xEB9E, 0x12E9, 0xEBA9, 0x2CAE, 0xEBBA, 0x1A64, 0xEBC9, 0x1404,
- 0xEBCF, 0x2324, 0xEBD2, 0x346A, 0xEBDE, 0x2291, 0xEC01, 0x1787,
- 0xEC02, 0x095F, 0xEC15, 0x1E99, 0xEC5B, 0x25C1, 0xEC5E, 0x0D0C,
- 0xECA6, 0x05E6, 0xED28, 0x0728, 0xED6E, 0x24B6, 0xED7C, 0x1806,
- 0xED9E, 0x3511, 0xEDE7, 0x0F82, 0xEE52, 0x05F2, 0xEE98, 0x247D,
- 0xF6B1, 0x01FA, 0xF6B2, 0x01FB, 0xF6B3, 0x01FC, 0xF6B4, 0x01FD,
- 0xF6B5, 0x01FE, 0xF6B6, 0x01FF, 0xF6B7, 0x0200, 0xF6B8, 0x0201,
- 0xF6B9, 0x0202, 0xF6BA, 0x0203, 0xF6BB, 0x0204, 0xF6BC, 0x0205,
- 0xF6BD, 0x0206, 0xF6BE, 0x0207, 0xF6BF, 0x0208, 0xF6C0, 0x0209,
- 0xF6C1, 0x020A, 0xF6C2, 0x020B, 0xF6C3, 0x020C, 0xF6C4, 0x020D,
- 0xF6C5, 0x020E, 0xF6C6, 0x020F, 0xF6C7, 0x0210, 0xF6C8, 0x0211,
- 0xF6C9, 0x0212, 0xF6CA, 0x0213, 0xF6CB, 0x0214, 0xF6CC, 0x0215,
- 0xF6CD, 0x0216, 0xF6CE, 0x0217, 0xF6CF, 0x0219, 0xF6D0, 0x021A,
- 0xF6D1, 0x021B, 0xF6D2, 0x021C, 0xF6D3, 0x021D, 0xF6D4, 0x021E,
- 0xF6D5, 0x021F, 0xF6D6, 0x0220, 0xF6D7, 0x0221, 0xF6D8, 0x0222,
- 0xF6D9, 0x0223, 0xF6DA, 0x0224, 0xF6DB, 0x0225, 0xF6DC, 0x0226,
- 0xF6DD, 0x0227, 0xF6DE, 0x0228, 0xF6E0, 0x022A, 0xF6E1, 0x022B,
- 0xF6E2, 0x022C, 0xF6E4, 0x022E, 0xF6E6, 0x0230, 0xF6E8, 0x35B3,
- 0xF6E9, 0x35B4, 0xF6EA, 0x35B5, 0xF6EB, 0x35B6, 0xF6EC, 0x35B7,
- 0xF6ED, 0x35B8, 0xF6F0, 0x35BA, 0xF6F1, 0x35BB, 0xF6F2, 0x35BC,
- 0xF6F3, 0x35BD, 0xF6F4, 0x35BE, 0xF6F5, 0x35BF, 0xF6F6, 0x35C0,
- 0xF6F7, 0x35C1, 0xF6F8, 0x35C2, 0xF6F9, 0x35C3, 0xF6FA, 0x35C4,
- 0xF6FB, 0x35C5, 0xF6FC, 0x35C6, 0xF6FD, 0x35C7, 0xF6FE, 0x35C8,
- 0xF6FF, 0x35C9, 0xF700, 0x35CA, 0xF701, 0x35CB, 0xF702, 0x35CC,
- 0xF703, 0x35CD, 0xF704, 0x35CE, 0xF705, 0x35CF, 0xF706, 0x35D0,
- 0xF707, 0x35D1, 0xF708, 0x35D2, 0xF709, 0x35D3, 0xF70A, 0x35D4,
- 0xF70B, 0x35D5, 0xF70C, 0x35D6, 0xF70D, 0x35D7, 0xF70E, 0x35D8,
- 0xF70F, 0x35D9, 0xF710, 0x35DA, 0xF711, 0x35DB, 0xF712, 0x35DC,
- 0xF713, 0x35DD, 0xF714, 0x35DE, 0xF715, 0x35DF, 0xF716, 0x35E0,
- 0xF717, 0x35E1, 0xF718, 0x35E2, 0xF719, 0x35E3, 0xF71A, 0x35E4,
- 0xF71B, 0x35E5, 0xF71C, 0x35E6, 0xF71D, 0x35E7, 0xF71E, 0x35E8,
- 0xF71F, 0x35E9, 0xF720, 0x35EA, 0xF721, 0x35EB, 0xF722, 0x35EC,
- 0xF723, 0x35ED, 0xF724, 0x35EE, 0xF725, 0x35EF, 0xF726, 0x35F0,
- 0xF727, 0x35F1, 0xF728, 0x35F2, 0xF729, 0x35F3, 0xF72A, 0x35F4,
- 0xF72B, 0x35F5, 0xF72C, 0x35F6, 0xF72D, 0x35F7, 0xF72E, 0x35F8,
- 0xF72F, 0x35F9, 0xF730, 0x35FA, 0xF731, 0x35FB, 0xF732, 0x35FC,
- 0xF733, 0x35FD, 0xF734, 0x35FE, 0xF735, 0x35FF, 0xF736, 0x3600,
- 0xF737, 0x3601, 0xF738, 0x3602, 0xF739, 0x3603, 0xF73A, 0x3604,
- 0xF73B, 0x3605, 0xF73C, 0x3606, 0xF73D, 0x3607, 0xF73E, 0x3608,
- 0xF73F, 0x3609, 0xF740, 0x360A, 0xF741, 0x360B, 0xF742, 0x360C,
- 0xF743, 0x360D, 0xF744, 0x360E, 0xF745, 0x360F, 0xF746, 0x3610,
- 0xF747, 0x3611, 0xF748, 0x3612, 0xF749, 0x3613, 0xF74A, 0x3614,
- 0xF74B, 0x3615, 0xF74C, 0x3616, 0xF74D, 0x3617, 0xF74E, 0x3618,
- 0xF74F, 0x3619, 0xF750, 0x361A, 0xF751, 0x361B, 0xF752, 0x361C,
- 0xF753, 0x361D, 0xF754, 0x361E, 0xF755, 0x361F, 0xF756, 0x3620,
- 0xF757, 0x3621, 0xF758, 0x3622, 0xF759, 0x3623, 0xF75A, 0x3624,
- 0xF75B, 0x3625, 0xF75C, 0x3626, 0xF75D, 0x3627, 0xF75E, 0x3628,
- 0xF75F, 0x3629, 0xF760, 0x362A, 0xF761, 0x362B, 0xF762, 0x362C,
- 0xF763, 0x362D, 0xF764, 0x362E, 0xF765, 0x362F, 0xF766, 0x3630,
- 0xF767, 0x3631, 0xF768, 0x3632, 0xF769, 0x3633, 0xF76A, 0x3634,
- 0xF76B, 0x3635, 0xF76C, 0x3636, 0xF76D, 0x3637, 0xF76E, 0x3638,
- 0xF76F, 0x3639, 0xF770, 0x363A, 0xF771, 0x363B, 0xF772, 0x363C,
- 0xF773, 0x363D, 0xF774, 0x363E, 0xF775, 0x363F, 0xF776, 0x3640,
- 0xF777, 0x3641, 0xF778, 0x3642, 0xF779, 0x3643, 0xF77A, 0x3644,
- 0xF77B, 0x3645, 0xF77C, 0x3646, 0xF77D, 0x3647, 0xF77E, 0x3648,
- 0xF77F, 0x3649, 0xF780, 0x364A, 0xF781, 0x364B, 0xF782, 0x364C,
- 0xF783, 0x364D, 0xF784, 0x364E, 0xF785, 0x364F, 0xF786, 0x3650,
- 0xF787, 0x3651, 0xF788, 0x3652, 0xF789, 0x3653, 0xF78A, 0x3654,
- 0xF78B, 0x3655, 0xF78C, 0x3656, 0xF78D, 0x3657, 0xF78E, 0x3658,
- 0xF78F, 0x3659, 0xF790, 0x365A, 0xF791, 0x365B, 0xF792, 0x365C,
- 0xF793, 0x365D, 0xF794, 0x365E, 0xF795, 0x365F, 0xF796, 0x3660,
- 0xF797, 0x3661, 0xF798, 0x3662, 0xF799, 0x3663, 0xF79A, 0x3664,
- 0xF79B, 0x3665, 0xF79C, 0x3666, 0xF79D, 0x3667, 0xF79E, 0x3668,
- 0xF79F, 0x3669, 0xF7A0, 0x366A, 0xF7A1, 0x366B, 0xF7A2, 0x366C,
- 0xF7A3, 0x366D, 0xF7A4, 0x366E, 0xF7A5, 0x366F, 0xF7A6, 0x3670,
- 0xF7A7, 0x3671, 0xF7A8, 0x3672, 0xF7A9, 0x3673, 0xF7AA, 0x3674,
- 0xF7AB, 0x3675, 0xF7AC, 0x3676, 0xF7AD, 0x3677, 0xF7AE, 0x3678,
- 0xF7AF, 0x3679, 0xF7B0, 0x367A, 0xF7B1, 0x367B, 0xF7B2, 0x367C,
- 0xF7B3, 0x367D, 0xF7B4, 0x367E, 0xF7B5, 0x367F, 0xF7B6, 0x3680,
- 0xF7B7, 0x3681, 0xF7B8, 0x3682, 0xF7B9, 0x3683, 0xF7BA, 0x3684,
- 0xF7BB, 0x3685, 0xF7BC, 0x3686, 0xF7BD, 0x3687, 0xF7BE, 0x3688,
- 0xF7BF, 0x3689, 0xF7C0, 0x368A, 0xF7C1, 0x368B, 0xF7C2, 0x368C,
- 0xF7C3, 0x368D, 0xF7C4, 0x368E, 0xF7C5, 0x368F, 0xF7C6, 0x3690,
- 0xF7C7, 0x3691, 0xF7C8, 0x3692, 0xF7C9, 0x3693, 0xF7CA, 0x3694,
- 0xF7CB, 0x3695, 0xF7CC, 0x3696, 0xF7CD, 0x3697, 0xF7CE, 0x3698,
- 0xF7CF, 0x3699, 0xF7D0, 0x369A, 0xF7D1, 0x369B, 0xF7D2, 0x369C,
- 0xF7D3, 0x369D, 0xF7D4, 0x369E, 0xF7D5, 0x369F, 0xF7D6, 0x36A0,
- 0xF7D7, 0x36A1, 0xF7D8, 0x36A2, 0xF7D9, 0x36A3, 0xF7DA, 0x36A4,
- 0xF7DB, 0x36A5, 0xF7DC, 0x36A6, 0xF7DD, 0x36A7, 0xF7DE, 0x36A8,
- 0xF7DF, 0x36A9, 0xF7E0, 0x36AA, 0xF7E1, 0x36AB, 0xF7E2, 0x36AC,
- 0xF7E3, 0x36AD, 0xF7E4, 0x36AE, 0xF7E5, 0x36AF, 0xF7E6, 0x36B0,
- 0xF7E7, 0x36B1, 0xF7E8, 0x36B2, 0xF7E9, 0x36B3, 0xF7EA, 0x36B4,
- 0xF7EB, 0x36B5, 0xF7EC, 0x36B6, 0xF7ED, 0x36B7, 0xF7EE, 0x36B8,
- 0xF817, 0x36E1, 0xF818, 0x36E2, 0xF819, 0x36E3, 0xF81A, 0x36E4,
- 0xF81B, 0x36E5, 0xF81C, 0x36E6, 0xF81D, 0x36E7, 0xFA0C, 0x0274,
- 0xFA0D, 0x2381, 0xFE30, 0x006D, 0xFE31, 0x007A, 0xFE33, 0x35AF,
- 0xFE34, 0x35B1, 0xFE35, 0x0082, 0xFE36, 0x0083, 0xFE37, 0x0086,
- 0xFE38, 0x0087, 0xFE39, 0x008A, 0xFE3A, 0x008B, 0xFE3B, 0x008E,
- 0xFE3C, 0x008F, 0xFE3D, 0x0092, 0xFE3E, 0x0093, 0xFE3F, 0x0096,
- 0xFE40, 0x0097, 0xFE41, 0x009A, 0xFE42, 0x009B, 0xFE43, 0x009E,
- 0xFE44, 0x009F, 0xFE49, 0x00C7, 0xFE4A, 0x00C8, 0xFE4B, 0x00CB,
- 0xFE4C, 0x00CC, 0xFE4D, 0x00C9, 0xFE4E, 0x00CA, 0xFE4F, 0x35B2,
- 0xFE50, 0x0070, 0xFE51, 0x0071, 0xFE52, 0x0072, 0xFE54, 0x0074,
- 0xFE55, 0x0075, 0xFE56, 0x0076, 0xFE57, 0x0077, 0xFE59, 0x00A0,
- 0xFE5A, 0x00A1, 0xFE5B, 0x00A2, 0xFE5C, 0x00A3, 0xFE5D, 0x00A4,
- 0xFE5E, 0x00A5, 0xFE5F, 0x00CD, 0xFE60, 0x00CE, 0xFE61, 0x00CF,
- 0xFE62, 0x00DF, 0xFE63, 0x00E0, 0xFE64, 0x00E1, 0xFE65, 0x00E2,
- 0xFE66, 0x00E3, 0xFE68, 0x0102, 0xFE69, 0x010C, 0xFE6A, 0x010D,
- 0xFE6B, 0x010E, 0xFF01, 0x006C, 0xFF02, 0x36E4, 0xFF03, 0x00AE,
- 0xFF04, 0x0103, 0xFF05, 0x0108, 0xFF06, 0x00AF, 0xFF07, 0x36E3,
- 0xFF08, 0x0080, 0xFF09, 0x0081, 0xFF0A, 0x00B0, 0xFF0B, 0x00D0,
- 0xFF0C, 0x0064, 0xFF0D, 0x00D1, 0xFF0E, 0x0067, 0xFF0F, 0x0101,
- 0xFF10, 0x014D, 0xFF11, 0x014E, 0xFF12, 0x014F, 0xFF13, 0x0150,
- 0xFF14, 0x0151, 0xFF15, 0x0152, 0xFF16, 0x0153, 0xFF17, 0x0154,
- 0xFF18, 0x0155, 0xFF19, 0x0156, 0xFF1A, 0x006A, 0xFF1B, 0x0069,
- 0xFF1C, 0x00D6, 0xFF1D, 0x00D8, 0xFF1E, 0x00D7, 0xFF1F, 0x006B,
- 0xFF20, 0x0109, 0xFF21, 0x016D, 0xFF22, 0x016E, 0xFF23, 0x016F,
- 0xFF24, 0x0170, 0xFF25, 0x0171, 0xFF26, 0x0172, 0xFF27, 0x0173,
- 0xFF28, 0x0174, 0xFF29, 0x0175, 0xFF2A, 0x0176, 0xFF2B, 0x0177,
- 0xFF2C, 0x0178, 0xFF2D, 0x0179, 0xFF2E, 0x017A, 0xFF2F, 0x017B,
- 0xFF30, 0x017C, 0xFF31, 0x017D, 0xFF32, 0x017E, 0xFF33, 0x017F,
- 0xFF34, 0x0180, 0xFF35, 0x0181, 0xFF36, 0x0182, 0xFF37, 0x0183,
- 0xFF38, 0x0184, 0xFF39, 0x0185, 0xFF3A, 0x0186, 0xFF3B, 0x35BE,
- 0xFF3C, 0x0102, 0xFF3D, 0x35BF, 0xFF3E, 0x35B4, 0xFF3F, 0x00C5,
- 0xFF41, 0x0187, 0xFF42, 0x0188, 0xFF43, 0x0189, 0xFF44, 0x018A,
- 0xFF45, 0x018B, 0xFF46, 0x018C, 0xFF47, 0x018D, 0xFF48, 0x018E,
- 0xFF49, 0x018F, 0xFF4A, 0x0190, 0xFF4B, 0x0191, 0xFF4C, 0x0192,
- 0xFF4D, 0x0193, 0xFF4E, 0x0194, 0xFF4F, 0x0195, 0xFF50, 0x0196,
- 0xFF51, 0x0197, 0xFF52, 0x0198, 0xFF53, 0x0199, 0xFF54, 0x019A,
- 0xFF55, 0x019B, 0xFF56, 0x019C, 0xFF57, 0x019D, 0xFF58, 0x019E,
- 0xFF59, 0x019F, 0xFF5A, 0x01A0, 0xFF5B, 0x0084, 0xFF5C, 0x0078,
- 0xFF5D, 0x0085, 0xFF5E, 0x00E4, 0xFF64, 0x0071, 0xFFE0, 0x0106,
- 0xFFE1, 0x0107, 0xFFE2, 0x36E1, 0xFFE3, 0x00C4, 0xFFE4, 0x36E2,
- 0xFFE5, 0x0104,
-};
-extern const unsigned short g_FXCMAP_UniCNS_UTF16_H_0_DWord[3 * 3] = {
- 0xD840, 0xDC8A, 0x36B2, 0xD840, 0xDCCC, 0x36B0, 0xD85D, 0xDE07, 0x36B8,
-};
+// 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
+
+extern const unsigned short g_FXCMAP_UniCNS_UTF16_H_0[14557 * 2] = {
+ 0x0020, 0x0001, 0x0021, 0x0002, 0x0022, 0x0003, 0x0023, 0x0004,
+ 0x0024, 0x0005, 0x0025, 0x0006, 0x0026, 0x0007, 0x0027, 0x0008,
+ 0x0028, 0x0009, 0x0029, 0x000A, 0x002A, 0x000B, 0x002B, 0x000C,
+ 0x002C, 0x000D, 0x002D, 0x000E, 0x002E, 0x000F, 0x002F, 0x0010,
+ 0x0030, 0x0011, 0x0031, 0x0012, 0x0032, 0x0013, 0x0033, 0x0014,
+ 0x0034, 0x0015, 0x0035, 0x0016, 0x0036, 0x0017, 0x0037, 0x0018,
+ 0x0038, 0x0019, 0x0039, 0x001A, 0x003A, 0x001B, 0x003B, 0x001C,
+ 0x003C, 0x001D, 0x003D, 0x001E, 0x003E, 0x001F, 0x003F, 0x0020,
+ 0x0040, 0x0021, 0x0041, 0x0022, 0x0042, 0x0023, 0x0043, 0x0024,
+ 0x0044, 0x0025, 0x0045, 0x0026, 0x0046, 0x0027, 0x0047, 0x0028,
+ 0x0048, 0x0029, 0x0049, 0x002A, 0x004A, 0x002B, 0x004B, 0x002C,
+ 0x004C, 0x002D, 0x004D, 0x002E, 0x004E, 0x002F, 0x004F, 0x0030,
+ 0x0050, 0x0031, 0x0051, 0x0032, 0x0052, 0x0033, 0x0053, 0x0034,
+ 0x0054, 0x0035, 0x0055, 0x0036, 0x0056, 0x0037, 0x0057, 0x0038,
+ 0x0058, 0x0039, 0x0059, 0x003A, 0x005A, 0x003B, 0x005B, 0x003C,
+ 0x005C, 0x003D, 0x005D, 0x003E, 0x005E, 0x003F, 0x005F, 0x0040,
+ 0x0060, 0x0041, 0x0061, 0x0042, 0x0062, 0x0043, 0x0063, 0x0044,
+ 0x0064, 0x0045, 0x0065, 0x0046, 0x0066, 0x0047, 0x0067, 0x0048,
+ 0x0068, 0x0049, 0x0069, 0x004A, 0x006A, 0x004B, 0x006B, 0x004C,
+ 0x006C, 0x004D, 0x006D, 0x004E, 0x006E, 0x004F, 0x006F, 0x0050,
+ 0x0070, 0x0051, 0x0071, 0x0052, 0x0072, 0x0053, 0x0073, 0x0054,
+ 0x0074, 0x0055, 0x0075, 0x0056, 0x0076, 0x0057, 0x0077, 0x0058,
+ 0x0078, 0x0059, 0x0079, 0x005A, 0x007A, 0x005B, 0x007B, 0x005C,
+ 0x007C, 0x005D, 0x007D, 0x005E, 0x007E, 0x005F, 0x00A2, 0x0106,
+ 0x00A3, 0x0107, 0x00A5, 0x0104, 0x00A7, 0x00B2, 0x00A8, 0x35B3,
+ 0x00AC, 0x36E1, 0x00AF, 0x00C3, 0x00B0, 0x0118, 0x00B1, 0x00D4,
+ 0x00B7, 0x0073, 0x00D7, 0x00D2, 0x00F7, 0x00D3, 0x02C6, 0x35B4,
+ 0x02C7, 0x01F8, 0x02CA, 0x01F7, 0x02CB, 0x01F9, 0x02CD, 0x00C6,
+ 0x02D9, 0x01F6, 0x0308, 0x35B3, 0x0391, 0x01A1, 0x0392, 0x01A2,
+ 0x0393, 0x01A3, 0x0394, 0x01A4, 0x0395, 0x01A5, 0x0396, 0x01A6,
+ 0x0397, 0x01A7, 0x0398, 0x01A8, 0x0399, 0x01A9, 0x039A, 0x01AA,
+ 0x039B, 0x01AB, 0x039C, 0x01AC, 0x039D, 0x01AD, 0x039E, 0x01AE,
+ 0x039F, 0x01AF, 0x03A0, 0x01B0, 0x03A1, 0x01B1, 0x03A3, 0x01B2,
+ 0x03A4, 0x01B3, 0x03A5, 0x01B4, 0x03A6, 0x01B5, 0x03A7, 0x01B6,
+ 0x03A8, 0x01B7, 0x03A9, 0x01B8, 0x03B1, 0x01B9, 0x03B2, 0x01BA,
+ 0x03B3, 0x01BB, 0x03B4, 0x01BC, 0x03B5, 0x01BD, 0x03B6, 0x01BE,
+ 0x03B7, 0x01BF, 0x03B8, 0x01C0, 0x03B9, 0x01C1, 0x03BA, 0x01C2,
+ 0x03BB, 0x01C3, 0x03BC, 0x01C4, 0x03BD, 0x01C5, 0x03BE, 0x01C6,
+ 0x03BF, 0x01C7, 0x03C0, 0x01C8, 0x03C1, 0x01C9, 0x03C3, 0x01CA,
+ 0x03C4, 0x01CB, 0x03C5, 0x01CC, 0x03C6, 0x01CD, 0x03C7, 0x01CE,
+ 0x03C8, 0x01CF, 0x03C9, 0x01D0, 0x0401, 0x3670, 0x0410, 0x366A,
+ 0x0411, 0x366B, 0x0412, 0x366C, 0x0413, 0x366D, 0x0414, 0x366E,
+ 0x0415, 0x366F, 0x0416, 0x3671, 0x0417, 0x3672, 0x0418, 0x3673,
+ 0x0419, 0x3674, 0x041A, 0x3675, 0x041B, 0x3676, 0x041C, 0x3677,
+ 0x041D, 0x3678, 0x041E, 0x3679, 0x041F, 0x367A, 0x0420, 0x367B,
+ 0x0421, 0x367C, 0x0422, 0x367D, 0x0423, 0x367E, 0x0424, 0x367F,
+ 0x0425, 0x3680, 0x0426, 0x3681, 0x0427, 0x3682, 0x0428, 0x3683,
+ 0x0429, 0x3684, 0x042A, 0x3685, 0x042B, 0x3686, 0x042C, 0x3687,
+ 0x042D, 0x3688, 0x042E, 0x3689, 0x042F, 0x368A, 0x0430, 0x368B,
+ 0x0431, 0x368C, 0x0432, 0x368D, 0x0433, 0x368E, 0x0434, 0x368F,
+ 0x0435, 0x3690, 0x0436, 0x3692, 0x0437, 0x3693, 0x0438, 0x3694,
+ 0x0439, 0x3695, 0x043A, 0x3696, 0x043B, 0x3697, 0x043C, 0x3698,
+ 0x043D, 0x3699, 0x043E, 0x369A, 0x043F, 0x369B, 0x0440, 0x369C,
+ 0x0441, 0x369D, 0x0442, 0x369E, 0x0443, 0x369F, 0x0444, 0x36A0,
+ 0x0445, 0x36A1, 0x0446, 0x36A2, 0x0447, 0x36A3, 0x0448, 0x36A4,
+ 0x0449, 0x36A5, 0x044A, 0x36A6, 0x044B, 0x36A7, 0x044C, 0x36A8,
+ 0x044D, 0x36A9, 0x044E, 0x36AA, 0x044F, 0x36AB, 0x0451, 0x3691,
+ 0x2013, 0x0079, 0x2014, 0x007B, 0x2018, 0x00A6, 0x2019, 0x00A7,
+ 0x201C, 0x00A8, 0x201D, 0x00A9, 0x2022, 0x0068, 0x2025, 0x006F,
+ 0x2026, 0x006E, 0x2027, 0x0068, 0x2032, 0x00AD, 0x2035, 0x00AC,
+ 0x203B, 0x00B1, 0x203E, 0x00C3, 0x2103, 0x010A, 0x2105, 0x00C2,
+ 0x2109, 0x010B, 0x2116, 0x36E6, 0x2121, 0x36E7, 0x2160, 0x0157,
+ 0x2161, 0x0158, 0x2162, 0x0159, 0x2163, 0x015A, 0x2164, 0x015B,
+ 0x2165, 0x015C, 0x2166, 0x015D, 0x2167, 0x015E, 0x2168, 0x015F,
+ 0x2169, 0x0160, 0x2170, 0x020E, 0x2171, 0x020F, 0x2172, 0x0210,
+ 0x2173, 0x0211, 0x2174, 0x0212, 0x2175, 0x0213, 0x2176, 0x0214,
+ 0x2177, 0x0215, 0x2178, 0x0216, 0x2179, 0x0217, 0x2190, 0x00F8,
+ 0x2191, 0x00F5, 0x2192, 0x00F7, 0x2193, 0x00F6, 0x2196, 0x00F9,
+ 0x2197, 0x00FA, 0x2198, 0x00FC, 0x2199, 0x00FB, 0x21B8, 0x36AD,
+ 0x21B9, 0x36AE, 0x21E7, 0x36AC, 0x2215, 0x0101, 0x221A, 0x00D5,
+ 0x221E, 0x00DC, 0x221F, 0x00E9, 0x2220, 0x00E8, 0x2223, 0x00FE,
+ 0x2225, 0x00FD, 0x2229, 0x00E5, 0x222A, 0x00E6, 0x222B, 0x00ED,
+ 0x222E, 0x00EE, 0x2234, 0x00F0, 0x2235, 0x00EF, 0x223C, 0x00E4,
+ 0x2252, 0x00DD, 0x2260, 0x00DB, 0x2261, 0x00DE, 0x2266, 0x00D9,
+ 0x2267, 0x00DA, 0x2295, 0x00F3, 0x2299, 0x00F4, 0x22A5, 0x00E7,
+ 0x22BF, 0x00EA, 0x22EF, 0x006E, 0x2400, 0x0232, 0x2401, 0x0233,
+ 0x2402, 0x0234, 0x2403, 0x0235, 0x2404, 0x0236, 0x2405, 0x0237,
+ 0x2406, 0x0238, 0x2407, 0x0239, 0x2408, 0x023A, 0x2409, 0x023B,
+ 0x240A, 0x023C, 0x240B, 0x023D, 0x240C, 0x023E, 0x240D, 0x023F,
+ 0x240E, 0x0240, 0x240F, 0x0241, 0x2410, 0x0242, 0x2411, 0x0243,
+ 0x2412, 0x0244, 0x2413, 0x0245, 0x2414, 0x0246, 0x2415, 0x0247,
+ 0x2416, 0x0248, 0x2417, 0x0249, 0x2418, 0x024A, 0x2419, 0x024B,
+ 0x241A, 0x024C, 0x241B, 0x024D, 0x241C, 0x024E, 0x241D, 0x024F,
+ 0x241E, 0x0250, 0x241F, 0x0251, 0x2421, 0x0252, 0x2460, 0x01FA,
+ 0x2461, 0x01FB, 0x2462, 0x01FC, 0x2463, 0x01FD, 0x2464, 0x01FE,
+ 0x2465, 0x01FF, 0x2466, 0x0200, 0x2467, 0x0201, 0x2468, 0x0202,
+ 0x2469, 0x0203, 0x2474, 0x0204, 0x2475, 0x0205, 0x2476, 0x0206,
+ 0x2477, 0x0207, 0x2478, 0x0208, 0x2479, 0x0209, 0x247A, 0x020A,
+ 0x247B, 0x020B, 0x247C, 0x020C, 0x247D, 0x020D, 0x2500, 0x0137,
+ 0x2502, 0x0138, 0x250C, 0x013A, 0x2510, 0x013B, 0x2514, 0x013C,
+ 0x2518, 0x013D, 0x251C, 0x0135, 0x2524, 0x0134, 0x252C, 0x0133,
+ 0x2534, 0x0132, 0x253C, 0x0131, 0x2550, 0x0142, 0x2551, 0x370A,
+ 0x2552, 0x36F8, 0x2553, 0x3701, 0x2554, 0x36EF, 0x2555, 0x36FA,
+ 0x2556, 0x3703, 0x2557, 0x36F1, 0x2558, 0x36FE, 0x2559, 0x3707,
+ 0x255A, 0x36F5, 0x255B, 0x3700, 0x255C, 0x3709, 0x255D, 0x36F7,
+ 0x255E, 0x0143, 0x255F, 0x3704, 0x2560, 0x36F2, 0x2561, 0x0145,
+ 0x2562, 0x3706, 0x2563, 0x36F4, 0x2564, 0x36F9, 0x2565, 0x3702,
+ 0x2566, 0x36F0, 0x2567, 0x36FF, 0x2568, 0x3708, 0x2569, 0x36F6,
+ 0x256A, 0x0144, 0x256B, 0x3705, 0x256C, 0x36F3, 0x256D, 0x013E,
+ 0x256E, 0x013F, 0x256F, 0x0141, 0x2570, 0x0140, 0x2571, 0x014A,
+ 0x2572, 0x014B, 0x2573, 0x014C, 0x2574, 0x35B0, 0x2581, 0x0122,
+ 0x2582, 0x0123, 0x2583, 0x0124, 0x2584, 0x0125, 0x2585, 0x0126,
+ 0x2586, 0x0127, 0x2587, 0x0128, 0x2588, 0x0129, 0x2589, 0x0130,
+ 0x258A, 0x012F, 0x258B, 0x012E, 0x258C, 0x012D, 0x258D, 0x012C,
+ 0x258E, 0x012B, 0x258F, 0x012A, 0x2593, 0x3710, 0x2594, 0x0136,
+ 0x2595, 0x0139, 0x25A0, 0x00BE, 0x25A1, 0x00BD, 0x25B2, 0x00B7,
+ 0x25B3, 0x00B6, 0x25BC, 0x00C0, 0x25BD, 0x00BF, 0x25C6, 0x00BC,
+ 0x25C7, 0x00BB, 0x25CB, 0x00B4, 0x25CE, 0x00B8, 0x25CF, 0x00B5,
+ 0x25E2, 0x0146, 0x25E3, 0x0147, 0x25E4, 0x0149, 0x25E5, 0x0148,
+ 0x2605, 0x00BA, 0x2606, 0x00B9, 0x2609, 0x00F4, 0x2640, 0x00F1,
+ 0x2641, 0x00F3, 0x2642, 0x00F2, 0x273D, 0x35C0, 0x2F00, 0x0253,
+ 0x2F01, 0x0218, 0x2F02, 0x0219, 0x2F03, 0x021A, 0x2F04, 0x0254,
+ 0x2F05, 0x021B, 0x2F06, 0x025A, 0x2F07, 0x021C, 0x2F08, 0x025B,
+ 0x2F09, 0x025C, 0x2F0A, 0x025D, 0x2F0B, 0x025E, 0x2F0C, 0x021D,
+ 0x2F0D, 0x021E, 0x2F0E, 0x021F, 0x2F0F, 0x025F, 0x2F10, 0x176E,
+ 0x2F11, 0x0260, 0x2F12, 0x0262, 0x2F13, 0x0220, 0x2F14, 0x0263,
+ 0x2F15, 0x176F, 0x2F16, 0x0221, 0x2F17, 0x0264, 0x2F18, 0x0265,
+ 0x2F19, 0x0222, 0x2F1A, 0x1770, 0x2F1B, 0x0223, 0x2F1C, 0x0266,
+ 0x2F1D, 0x0279, 0x2F1E, 0x1775, 0x2F1F, 0x027A, 0x2F20, 0x027B,
+ 0x2F21, 0x0224, 0x2F22, 0x0224, 0x2F23, 0x027C, 0x2F24, 0x027D,
+ 0x2F25, 0x027E, 0x2F26, 0x027F, 0x2F27, 0x0225, 0x2F28, 0x0282,
+ 0x2F29, 0x0283, 0x2F2A, 0x0284, 0x2F2B, 0x0285, 0x2F2C, 0x1776,
+ 0x2F2D, 0x0286, 0x2F2E, 0x0226, 0x2F2F, 0x0288, 0x2F30, 0x0289,
+ 0x2F31, 0x028C, 0x2F32, 0x028D, 0x2F33, 0x0227, 0x2F34, 0x0228,
+ 0x2F35, 0x0229, 0x2F36, 0x028E, 0x2F37, 0x028F, 0x2F38, 0x0290,
+ 0x2F39, 0x022A, 0x2F3A, 0x022B, 0x2F3B, 0x1777, 0x2F3C, 0x02D0,
+ 0x2F3D, 0x02D1, 0x2F3E, 0x02D2, 0x2F3F, 0x02D3, 0x2F40, 0x02D5,
+ 0x2F41, 0x022C, 0x2F42, 0x02D6, 0x2F43, 0x02D7, 0x2F44, 0x02D8,
+ 0x2F45, 0x02D9, 0x2F46, 0x022D, 0x2F47, 0x02DA, 0x2F48, 0x02DB,
+ 0x2F49, 0x02DC, 0x2F4A, 0x02DD, 0x2F4B, 0x02DE, 0x2F4C, 0x02DF,
+ 0x2F4D, 0x02E0, 0x2F4E, 0x178A, 0x2F4F, 0x02E1, 0x2F50, 0x02E2,
+ 0x2F51, 0x02E3, 0x2F52, 0x02E4, 0x2F53, 0x178C, 0x2F54, 0x02E5,
+ 0x2F55, 0x02E6, 0x2F56, 0x02E7, 0x2F57, 0x02E8, 0x2F58, 0x02E9,
+ 0x2F59, 0x178D, 0x2F5A, 0x02EA, 0x2F5B, 0x02EB, 0x2F5C, 0x02EC,
+ 0x2F5D, 0x02ED, 0x2F5E, 0x0356, 0x2F5F, 0x0357, 0x2F60, 0x0358,
+ 0x2F61, 0x0359, 0x2F62, 0x035A, 0x2F63, 0x035B, 0x2F64, 0x035C,
+ 0x2F65, 0x035E, 0x2F66, 0x0362, 0x2F67, 0x022E, 0x2F68, 0x022F,
+ 0x2F69, 0x0363, 0x2F6A, 0x0364, 0x2F6B, 0x0365, 0x2F6C, 0x0366,
+ 0x2F6D, 0x0367, 0x2F6E, 0x0368, 0x2F6F, 0x0369, 0x2F70, 0x036A,
+ 0x2F71, 0x17B2, 0x2F72, 0x036B, 0x2F73, 0x036C, 0x2F74, 0x036D,
+ 0x2F75, 0x03F6, 0x2F76, 0x03F7, 0x2F77, 0x03F8, 0x2F78, 0x03F9,
+ 0x2F79, 0x1812, 0x2F7A, 0x03FA, 0x2F7B, 0x03FB, 0x2F7C, 0x03FC,
+ 0x2F7D, 0x03FE, 0x2F7E, 0x03FF, 0x2F7F, 0x0400, 0x2F80, 0x0401,
+ 0x2F81, 0x0402, 0x2F82, 0x0405, 0x2F83, 0x0406, 0x2F84, 0x0407,
+ 0x2F85, 0x0408, 0x2F86, 0x0409, 0x2F87, 0x040A, 0x2F88, 0x040B,
+ 0x2F89, 0x040C, 0x2F8A, 0x040D, 0x2F8B, 0x1813, 0x2F8C, 0x1818,
+ 0x2F8D, 0x040F, 0x2F8E, 0x0410, 0x2F8F, 0x0411, 0x2F90, 0x0412,
+ 0x2F91, 0x1819, 0x2F92, 0x0508, 0x2F93, 0x0509, 0x2F94, 0x050A,
+ 0x2F95, 0x050B, 0x2F96, 0x050C, 0x2F97, 0x050D, 0x2F98, 0x18E7,
+ 0x2F99, 0x050E, 0x2F9A, 0x050F, 0x2F9B, 0x0510, 0x2F9C, 0x0511,
+ 0x2F9D, 0x0512, 0x2F9E, 0x0513, 0x2F9F, 0x0514, 0x2FA0, 0x0515,
+ 0x2FA1, 0x0230, 0x2FA2, 0x051B, 0x2FA3, 0x0520, 0x2FA4, 0x0521,
+ 0x2FA5, 0x0522, 0x2FA6, 0x0696, 0x2FA7, 0x0697, 0x2FA8, 0x0698,
+ 0x2FA9, 0x0699, 0x2FAA, 0x0231, 0x2FAB, 0x069F, 0x2FAC, 0x06A0,
+ 0x2FAE, 0x06A2, 0x2FAF, 0x0826, 0x2FB0, 0x0827, 0x2FB1, 0x0828,
+ 0x2FB2, 0x0829, 0x2FB3, 0x082A, 0x2FB4, 0x082B, 0x2FB5, 0x082C,
+ 0x2FB6, 0x082D, 0x2FB7, 0x082E, 0x2FB8, 0x082F, 0x2FB9, 0x0830,
+ 0x2FBA, 0x09F5, 0x2FBB, 0x09F6, 0x2FBC, 0x09F7, 0x2FBD, 0x1E33,
+ 0x2FBE, 0x09F8, 0x2FBF, 0x1E34, 0x2FC0, 0x09F9, 0x2FC1, 0x09FA,
+ 0x2FC2, 0x0BE1, 0x2FC3, 0x0BE2, 0x2FC4, 0x0BE3, 0x2FC5, 0x0BE4,
+ 0x2FC6, 0x0BE5, 0x2FC7, 0x0BE6, 0x2FC8, 0x0DBB, 0x2FC9, 0x0DBC,
+ 0x2FCA, 0x0DBD, 0x2FCB, 0x2360, 0x2FCC, 0x2612, 0x2FCD, 0x0F7B,
+ 0x2FCE, 0x0F7C, 0x2FCF, 0x0F7D, 0x2FD0, 0x1100, 0x2FD1, 0x1101,
+ 0x2FD2, 0x1289, 0x2FD3, 0x13B2, 0x2FD4, 0x13B3, 0x2FD5, 0x2F0D,
+ 0x3000, 0x0063, 0x3001, 0x0065, 0x3002, 0x0066, 0x3003, 0x00B3,
+ 0x3005, 0x35BA, 0x3006, 0x35BB, 0x3007, 0x35BC, 0x3008, 0x0094,
+ 0x3009, 0x0095, 0x300A, 0x0090, 0x300B, 0x0091, 0x300C, 0x0098,
+ 0x300D, 0x0099, 0x300E, 0x009C, 0x300F, 0x009D, 0x3010, 0x008C,
+ 0x3011, 0x008D, 0x3012, 0x0105, 0x3014, 0x0088, 0x3015, 0x0089,
+ 0x301D, 0x00AA, 0x301E, 0x00AB, 0x3021, 0x0161, 0x3022, 0x0162,
+ 0x3023, 0x0163, 0x3024, 0x0164, 0x3025, 0x0165, 0x3026, 0x0166,
+ 0x3027, 0x0167, 0x3028, 0x0168, 0x3029, 0x0169, 0x3038, 0x016A,
+ 0x3039, 0x016B, 0x303A, 0x016C, 0x3041, 0x35C1, 0x3042, 0x35C2,
+ 0x3043, 0x35C3, 0x3044, 0x35C4, 0x3045, 0x35C5, 0x3046, 0x35C6,
+ 0x3047, 0x35C7, 0x3048, 0x35C8, 0x3049, 0x35C9, 0x304A, 0x35CA,
+ 0x304B, 0x35CB, 0x304C, 0x35CC, 0x304D, 0x35CD, 0x304E, 0x35CE,
+ 0x304F, 0x35CF, 0x3050, 0x35D0, 0x3051, 0x35D1, 0x3052, 0x35D2,
+ 0x3053, 0x35D3, 0x3054, 0x35D4, 0x3055, 0x35D5, 0x3056, 0x35D6,
+ 0x3057, 0x35D7, 0x3058, 0x35D8, 0x3059, 0x35D9, 0x305A, 0x35DA,
+ 0x305B, 0x35DB, 0x305C, 0x35DC, 0x305D, 0x35DD, 0x305E, 0x35DE,
+ 0x305F, 0x35DF, 0x3060, 0x35E0, 0x3061, 0x35E1, 0x3062, 0x35E2,
+ 0x3063, 0x35E3, 0x3064, 0x35E4, 0x3065, 0x35E5, 0x3066, 0x35E6,
+ 0x3067, 0x35E7, 0x3068, 0x35E8, 0x3069, 0x35E9, 0x306A, 0x35EA,
+ 0x306B, 0x35EB, 0x306C, 0x35EC, 0x306D, 0x35ED, 0x306E, 0x35EE,
+ 0x306F, 0x35EF, 0x3070, 0x35F0, 0x3071, 0x35F1, 0x3072, 0x35F2,
+ 0x3073, 0x35F3, 0x3074, 0x35F4, 0x3075, 0x35F5, 0x3076, 0x35F6,
+ 0x3077, 0x35F7, 0x3078, 0x35F8, 0x3079, 0x35F9, 0x307A, 0x35FA,
+ 0x307B, 0x35FB, 0x307C, 0x35FC, 0x307D, 0x35FD, 0x307E, 0x35FE,
+ 0x307F, 0x35FF, 0x3080, 0x3600, 0x3081, 0x3601, 0x3082, 0x3602,
+ 0x3083, 0x3603, 0x3084, 0x3604, 0x3085, 0x3605, 0x3086, 0x3606,
+ 0x3087, 0x3607, 0x3088, 0x3608, 0x3089, 0x3609, 0x308A, 0x360A,
+ 0x308B, 0x360B, 0x308C, 0x360C, 0x308D, 0x360D, 0x308E, 0x360E,
+ 0x308F, 0x360F, 0x3090, 0x3610, 0x3091, 0x3611, 0x3092, 0x3612,
+ 0x3093, 0x3613, 0x309D, 0x35B7, 0x309E, 0x35B8, 0x30A1, 0x3614,
+ 0x30A2, 0x3615, 0x30A3, 0x3616, 0x30A4, 0x3617, 0x30A5, 0x3618,
+ 0x30A6, 0x3619, 0x30A7, 0x361A, 0x30A8, 0x361B, 0x30A9, 0x361C,
+ 0x30AA, 0x361D, 0x30AB, 0x361E, 0x30AC, 0x361F, 0x30AD, 0x3620,
+ 0x30AE, 0x3621, 0x30AF, 0x3622, 0x30B0, 0x3623, 0x30B1, 0x3624,
+ 0x30B2, 0x3625, 0x30B3, 0x3626, 0x30B4, 0x3627, 0x30B5, 0x3628,
+ 0x30B6, 0x3629, 0x30B7, 0x362A, 0x30B8, 0x362B, 0x30B9, 0x362C,
+ 0x30BA, 0x362D, 0x30BB, 0x362E, 0x30BC, 0x362F, 0x30BD, 0x3630,
+ 0x30BE, 0x3631, 0x30BF, 0x3632, 0x30C0, 0x3633, 0x30C1, 0x3634,
+ 0x30C2, 0x3635, 0x30C3, 0x3636, 0x30C4, 0x3637, 0x30C5, 0x3638,
+ 0x30C6, 0x3639, 0x30C7, 0x363A, 0x30C8, 0x363B, 0x30C9, 0x363C,
+ 0x30CA, 0x363D, 0x30CB, 0x363E, 0x30CC, 0x363F, 0x30CD, 0x3640,
+ 0x30CE, 0x3641, 0x30CF, 0x3642, 0x30D0, 0x3643, 0x30D1, 0x3644,
+ 0x30D2, 0x3645, 0x30D3, 0x3646, 0x30D4, 0x3647, 0x30D5, 0x3648,
+ 0x30D6, 0x3649, 0x30D7, 0x364A, 0x30D8, 0x364B, 0x30D9, 0x364C,
+ 0x30DA, 0x364D, 0x30DB, 0x364E, 0x30DC, 0x364F, 0x30DD, 0x3650,
+ 0x30DE, 0x3651, 0x30DF, 0x3652, 0x30E0, 0x3653, 0x30E1, 0x3654,
+ 0x30E2, 0x3655, 0x30E3, 0x3656, 0x30E4, 0x3657, 0x30E5, 0x3658,
+ 0x30E6, 0x3659, 0x30E7, 0x365A, 0x30E8, 0x365B, 0x30E9, 0x365C,
+ 0x30EA, 0x365D, 0x30EB, 0x365E, 0x30EC, 0x365F, 0x30ED, 0x3660,
+ 0x30EE, 0x3661, 0x30EF, 0x3662, 0x30F0, 0x3663, 0x30F1, 0x3664,
+ 0x30F2, 0x3665, 0x30F3, 0x3666, 0x30F4, 0x3667, 0x30F5, 0x3668,
+ 0x30F6, 0x3669, 0x30FC, 0x35BD, 0x30FD, 0x35B5, 0x30FE, 0x35B6,
+ 0x3105, 0x01D1, 0x3106, 0x01D2, 0x3107, 0x01D3, 0x3108, 0x01D4,
+ 0x3109, 0x01D5, 0x310A, 0x01D6, 0x310B, 0x01D7, 0x310C, 0x01D8,
+ 0x310D, 0x01D9, 0x310E, 0x01DA, 0x310F, 0x01DB, 0x3110, 0x01DC,
+ 0x3111, 0x01DD, 0x3112, 0x01DE, 0x3113, 0x01DF, 0x3114, 0x01E0,
+ 0x3115, 0x01E1, 0x3116, 0x01E2, 0x3117, 0x01E3, 0x3118, 0x01E4,
+ 0x3119, 0x01E5, 0x311A, 0x01E6, 0x311B, 0x01E7, 0x311C, 0x01E8,
+ 0x311D, 0x01E9, 0x311E, 0x01EA, 0x311F, 0x01EB, 0x3120, 0x01EC,
+ 0x3121, 0x01ED, 0x3122, 0x01EE, 0x3123, 0x01EF, 0x3124, 0x01F0,
+ 0x3125, 0x01F1, 0x3126, 0x01F2, 0x3127, 0x01F3, 0x3128, 0x01F4,
+ 0x3129, 0x01F5, 0x3231, 0x36E5, 0x32A3, 0x00C1, 0x338E, 0x0115,
+ 0x338F, 0x0116, 0x339C, 0x0110, 0x339D, 0x0111, 0x339E, 0x0112,
+ 0x33A1, 0x0114, 0x33C4, 0x0117, 0x33CE, 0x0113, 0x33D1, 0x00EC,
+ 0x33D2, 0x00EB, 0x33D5, 0x010F, 0x361D, 0x36B7, 0x4491, 0x36B4,
+ 0x4E00, 0x0253, 0x4E01, 0x0255, 0x4E03, 0x0256, 0x4E07, 0x1771,
+ 0x4E08, 0x0269, 0x4E09, 0x0267, 0x4E0A, 0x026A, 0x4E0B, 0x0268,
+ 0x4E0C, 0x1772, 0x4E0D, 0x0294, 0x4E0E, 0x177A, 0x4E0F, 0x1778,
+ 0x4E10, 0x0293, 0x4E11, 0x0292, 0x4E14, 0x02F2, 0x4E15, 0x02F1,
+ 0x4E16, 0x02F0, 0x4E18, 0x02F3, 0x4E19, 0x02EF, 0x4E1E, 0x036E,
+ 0x4E1F, 0x036F, 0x4E26, 0x0528, 0x4E28, 0x0218, 0x4E2B, 0x026B,
+ 0x4E2D, 0x0295, 0x4E2E, 0x177B, 0x4E30, 0x0296, 0x4E31, 0x178E,
+ 0x4E32, 0x0415, 0x4E33, 0x18F4, 0x4E36, 0x0219, 0x4E38, 0x026C,
+ 0x4E39, 0x0297, 0x4E3B, 0x02F4, 0x4E3C, 0x178F, 0x4E3F, 0x021A,
+ 0x4E41, 0x36AF, 0x4E42, 0x176C, 0x4E43, 0x0257, 0x4E45, 0x026E,
+ 0x4E47, 0x1773, 0x4E48, 0x026F, 0x4E4B, 0x0298, 0x4E4D, 0x02F5,
+ 0x4E4E, 0x02F7, 0x4E4F, 0x02F6, 0x4E52, 0x0370, 0x4E53, 0x0371,
+ 0x4E56, 0x0529, 0x4E58, 0x0831, 0x4E59, 0x0254, 0x4E5A, 0x36B1,
+ 0x4E5C, 0x176D, 0x4E5D, 0x0258, 0x4E5E, 0x0271, 0x4E5F, 0x0270,
+ 0x4E69, 0x0372, 0x4E73, 0x052A, 0x4E7E, 0x09FB, 0x4E7F, 0x1E35,
+ 0x4E82, 0x0DBE, 0x4E83, 0x2361, 0x4E84, 0x2362, 0x4E85, 0x021B,
+ 0x4E86, 0x0259, 0x4E88, 0x029A, 0x4E8B, 0x052B, 0x4E8C, 0x025A,
+ 0x4E8D, 0x1774, 0x4E8E, 0x0272, 0x4E91, 0x029B, 0x4E92, 0x029D,
+ 0x4E93, 0x177C, 0x4E94, 0x029E, 0x4E95, 0x029C, 0x4E99, 0x0373,
+ 0x4E9B, 0x052C, 0x4E9E, 0x052D, 0x4E9F, 0x06A3, 0x4EA0, 0x021C,
+ 0x4EA1, 0x0273, 0x4EA2, 0x029F, 0x4EA4, 0x0374, 0x4EA5, 0x0376,
+ 0x4EA6, 0x0375, 0x4EA8, 0x0416, 0x4EAB, 0x052E, 0x4EAC, 0x052F,
+ 0x4EAD, 0x06A4, 0x4EAE, 0x06A5, 0x4EB3, 0x0832, 0x4EB6, 0x2363,
+ 0x4EB9, 0x3377, 0x4EBA, 0x025B, 0x4EC0, 0x02A1, 0x4EC1, 0x02A0,
+ 0x4EC2, 0x177D, 0x4EC3, 0x02A2, 0x4EC4, 0x02A8, 0x4EC6, 0x02A3,
+ 0x4EC7, 0x02A4, 0x4EC8, 0x177F, 0x4EC9, 0x177E, 0x4ECA, 0x02A6,
+ 0x4ECB, 0x02A7, 0x4ECD, 0x02A5, 0x4ED4, 0x02FA, 0x4ED5, 0x02FB,
+ 0x4ED6, 0x02FC, 0x4ED7, 0x02FD, 0x4ED8, 0x02F9, 0x4ED9, 0x0300,
+ 0x4EDA, 0x1795, 0x4EDC, 0x1791, 0x4EDD, 0x1794, 0x4EDE, 0x0301,
+ 0x4EDF, 0x0311, 0x4EE1, 0x1793, 0x4EE3, 0x02FE, 0x4EE4, 0x02FF,
+ 0x4EE5, 0x02F8, 0x4EE8, 0x1790, 0x4EE9, 0x1792, 0x4EF0, 0x0383,
+ 0x4EF1, 0x17BA, 0x4EF2, 0x0380, 0x4EF3, 0x0384, 0x4EF4, 0x17C4,
+ 0x4EF5, 0x17B8, 0x4EF6, 0x0381, 0x4EF7, 0x17BC, 0x4EFB, 0x0382,
+ 0x4EFD, 0x0385, 0x4EFF, 0x0377, 0x4F00, 0x17BB, 0x4F01, 0x0386,
+ 0x4F02, 0x17BF, 0x4F04, 0x17C3, 0x4F05, 0x17C0, 0x4F08, 0x17BD,
+ 0x4F09, 0x0378, 0x4F0A, 0x037A, 0x4F0B, 0x0387, 0x4F0D, 0x037C,
+ 0x4F0E, 0x17B5, 0x4F0F, 0x037F, 0x4F10, 0x037D, 0x4F11, 0x037E,
+ 0x4F12, 0x17C5, 0x4F13, 0x17C2, 0x4F14, 0x17B9, 0x4F15, 0x037B,
+ 0x4F18, 0x17B6, 0x4F19, 0x0379, 0x4F1D, 0x17BE, 0x4F22, 0x17C1,
+ 0x4F2C, 0x17B7, 0x4F2D, 0x182F, 0x4F2F, 0x042C, 0x4F30, 0x041F,
+ 0x4F33, 0x1830, 0x4F34, 0x041C, 0x4F36, 0x042E, 0x4F38, 0x0424,
+ 0x4F3A, 0x0423, 0x4F3B, 0x1824, 0x4F3C, 0x0427, 0x4F3D, 0x0422,
+ 0x4F3E, 0x1829, 0x4F3F, 0x1831, 0x4F41, 0x182D, 0x4F43, 0x0425,
+ 0x4F46, 0x0428, 0x4F47, 0x0419, 0x4F48, 0x0431, 0x4F49, 0x1826,
+ 0x4F4C, 0x1900, 0x4F4D, 0x0417, 0x4F4E, 0x042D, 0x4F4F, 0x0418,
+ 0x4F50, 0x0420, 0x4F51, 0x0421, 0x4F52, 0x182B, 0x4F53, 0x1827,
+ 0x4F54, 0x0426, 0x4F55, 0x041E, 0x4F56, 0x1823, 0x4F57, 0x041A,
+ 0x4F58, 0x182E, 0x4F59, 0x042F, 0x4F5A, 0x0432, 0x4F5B, 0x041D,
+ 0x4F5C, 0x042A, 0x4F5D, 0x0430, 0x4F5E, 0x041B, 0x4F5F, 0x182C,
+ 0x4F60, 0x042B, 0x4F61, 0x1832, 0x4F62, 0x1825, 0x4F63, 0x0429,
+ 0x4F64, 0x1828, 0x4F67, 0x182A, 0x4F69, 0x053D, 0x4F6A, 0x1902,
+ 0x4F6B, 0x190E, 0x4F6C, 0x0535, 0x4F6E, 0x190F, 0x4F6F, 0x0530,
+ 0x4F70, 0x053A, 0x4F73, 0x0533, 0x4F74, 0x18FC, 0x4F75, 0x053B,
+ 0x4F76, 0x18FB, 0x4F77, 0x18FF, 0x4F78, 0x1906, 0x4F79, 0x1904,
+ 0x4F7A, 0x0543, 0x4F7B, 0x053E, 0x4F7C, 0x18F6, 0x4F7D, 0x18F8,
+ 0x4F7E, 0x0540, 0x4F7F, 0x0534, 0x4F80, 0x18F9, 0x4F81, 0x1905,
+ 0x4F82, 0x190C, 0x4F83, 0x0539, 0x4F84, 0x18FE, 0x4F85, 0x18F7,
+ 0x4F86, 0x0538, 0x4F87, 0x18FA, 0x4F88, 0x053C, 0x4F89, 0x18FD,
+ 0x4F8B, 0x0537, 0x4F8D, 0x0532, 0x4F8F, 0x0541, 0x4F90, 0x1907,
+ 0x4F91, 0x0542, 0x4F92, 0x190B, 0x4F94, 0x1909, 0x4F95, 0x190D,
+ 0x4F96, 0x053F, 0x4F97, 0x1901, 0x4F98, 0x18F5, 0x4F9A, 0x1903,
+ 0x4F9B, 0x0536, 0x4F9C, 0x1908, 0x4F9D, 0x0531, 0x4F9E, 0x190A,
+ 0x4FAE, 0x06B4, 0x4FAF, 0x06A8, 0x4FB2, 0x1A5D, 0x4FB3, 0x1A65,
+ 0x4FB5, 0x06A7, 0x4FB6, 0x06AF, 0x4FB7, 0x06BB, 0x4FB9, 0x1A6B,
+ 0x4FBA, 0x1A69, 0x4FBB, 0x1A64, 0x4FBF, 0x06A9, 0x4FC0, 0x1A6A,
+ 0x4FC1, 0x1A60, 0x4FC2, 0x06B7, 0x4FC3, 0x06AE, 0x4FC4, 0x06B6,
+ 0x4FC5, 0x1A5B, 0x4FC7, 0x1A67, 0x4FC9, 0x1A5E, 0x4FCA, 0x06B2,
+ 0x4FCB, 0x1A5F, 0x4FCD, 0x1A5A, 0x4FCE, 0x06B9, 0x4FCF, 0x06AC,
+ 0x4FD0, 0x06B5, 0x4FD1, 0x06AB, 0x4FD3, 0x1A5C, 0x4FD4, 0x1A61,
+ 0x4FD6, 0x1A68, 0x4FD7, 0x06B3, 0x4FD8, 0x06B0, 0x4FD9, 0x1A63,
+ 0x4FDA, 0x06B8, 0x4FDB, 0x1A66, 0x4FDC, 0x1A62, 0x4FDD, 0x06AD,
+ 0x4FDE, 0x06BA, 0x4FDF, 0x06B1, 0x4FE0, 0x06AA, 0x4FE1, 0x06A6,
+ 0x4FEC, 0x1A6C, 0x4FEE, 0x084C, 0x4FEF, 0x0836, 0x4FF1, 0x0846,
+ 0x4FF3, 0x084B, 0x4FF4, 0x1C24, 0x4FF5, 0x1C23, 0x4FF6, 0x1C28,
+ 0x4FF7, 0x1C29, 0x4FF8, 0x0839, 0x4FFA, 0x0842, 0x4FFE, 0x084F,
+ 0x5000, 0x0843, 0x5005, 0x1C1D, 0x5006, 0x083C, 0x5007, 0x1C1E,
+ 0x5009, 0x0851, 0x500B, 0x0848, 0x500C, 0x0833, 0x500D, 0x0834,
+ 0x500E, 0x1C31, 0x500F, 0x0A0C, 0x5011, 0x0841, 0x5012, 0x0840,
+ 0x5013, 0x1C1F, 0x5014, 0x0844, 0x5015, 0x1E45, 0x5016, 0x083B,
+ 0x5017, 0x1C2A, 0x5018, 0x084A, 0x5019, 0x0849, 0x501A, 0x083F,
+ 0x501B, 0x1C22, 0x501C, 0x1C2B, 0x501E, 0x1C1C, 0x501F, 0x083E,
+ 0x5020, 0x1C2C, 0x5021, 0x0847, 0x5022, 0x1C20, 0x5023, 0x0835,
+ 0x5025, 0x0838, 0x5026, 0x0837, 0x5027, 0x1C2D, 0x5028, 0x0845,
+ 0x5029, 0x083A, 0x502A, 0x084E, 0x502B, 0x0850, 0x502C, 0x1C27,
+ 0x502D, 0x084D, 0x502F, 0x1C2F, 0x5030, 0x1C21, 0x5031, 0x1C30,
+ 0x5033, 0x1C25, 0x5035, 0x1C2E, 0x5037, 0x1C26, 0x503C, 0x083D,
+ 0x5040, 0x1E4D, 0x5041, 0x1E41, 0x5043, 0x0A00, 0x5045, 0x1E46,
+ 0x5046, 0x1E4C, 0x5047, 0x09FF, 0x5048, 0x1E3F, 0x5049, 0x0A03,
+ 0x504A, 0x1E43, 0x504B, 0x1E3C, 0x504C, 0x0A01, 0x504D, 0x1E40,
+ 0x504E, 0x0A06, 0x504F, 0x0A0B, 0x5051, 0x1E51, 0x5053, 0x1E3B,
+ 0x5055, 0x0A07, 0x5057, 0x1E50, 0x505A, 0x0A02, 0x505B, 0x1E42,
+ 0x505C, 0x09FE, 0x505D, 0x1E3D, 0x505E, 0x1E39, 0x505F, 0x1E47,
+ 0x5060, 0x1E3A, 0x5061, 0x1E38, 0x5062, 0x1E44, 0x5063, 0x1E4A,
+ 0x5064, 0x1E4B, 0x5065, 0x0A04, 0x5068, 0x20B8, 0x5069, 0x1E48,
+ 0x506A, 0x1E37, 0x506B, 0x1E49, 0x506D, 0x0A0E, 0x506E, 0x1E4E,
+ 0x506F, 0x0A0D, 0x5070, 0x1E36, 0x5072, 0x1E3E, 0x5073, 0x1E4F,
+ 0x5074, 0x0A09, 0x5075, 0x0A08, 0x5076, 0x0A05, 0x5077, 0x0A0A,
+ 0x507A, 0x09FC, 0x507D, 0x09FD, 0x5080, 0x0BEC, 0x5082, 0x20BB,
+ 0x5083, 0x20B4, 0x5085, 0x0BE9, 0x5087, 0x20BC, 0x508B, 0x20B2,
+ 0x508C, 0x20B5, 0x508D, 0x0BE8, 0x508E, 0x20B6, 0x5091, 0x0BEB,
+ 0x5092, 0x20BA, 0x5094, 0x20B0, 0x5095, 0x20AF, 0x5096, 0x0BED,
+ 0x5098, 0x0BEE, 0x5099, 0x0BEA, 0x509A, 0x0BEF, 0x509B, 0x20AE,
+ 0x509C, 0x20B9, 0x509D, 0x20B7, 0x509E, 0x20B1, 0x50A2, 0x0BE7,
+ 0x50A3, 0x20B3, 0x50AC, 0x0DC5, 0x50AD, 0x0DBF, 0x50AE, 0x2367,
+ 0x50AF, 0x0DC8, 0x50B0, 0x236D, 0x50B1, 0x2370, 0x50B2, 0x0DC1,
+ 0x50B3, 0x0DC2, 0x50B4, 0x236A, 0x50B5, 0x0DC0, 0x50B6, 0x2373,
+ 0x50B7, 0x0DC6, 0x50B8, 0x2374, 0x50BA, 0x236F, 0x50BB, 0x0DC7,
+ 0x50BD, 0x2364, 0x50BE, 0x0DC4, 0x50BF, 0x2365, 0x50C1, 0x236E,
+ 0x50C2, 0x236C, 0x50C4, 0x2368, 0x50C5, 0x0DC3, 0x50C6, 0x2366,
+ 0x50C7, 0x0DC9, 0x50C8, 0x236B, 0x50C9, 0x2372, 0x50CA, 0x2369,
+ 0x50CB, 0x2371, 0x50CE, 0x0F88, 0x50CF, 0x0F85, 0x50D1, 0x0F86,
+ 0x50D3, 0x261C, 0x50D4, 0x2614, 0x50D5, 0x0F84, 0x50D6, 0x0F81,
+ 0x50D7, 0x2615, 0x50DA, 0x0F83, 0x50DB, 0x2618, 0x50DD, 0x261A,
+ 0x50E0, 0x2621, 0x50E3, 0x2620, 0x50E4, 0x261B, 0x50E5, 0x0F80,
+ 0x50E6, 0x2613, 0x50E7, 0x0F7E, 0x50E8, 0x2616, 0x50E9, 0x0F89,
+ 0x50EA, 0x2619, 0x50EC, 0x261D, 0x50ED, 0x0F82, 0x50EE, 0x0F7F,
+ 0x50EF, 0x261F, 0x50F0, 0x261E, 0x50F1, 0x0F87, 0x50F3, 0x2617,
+ 0x50F5, 0x1105, 0x50F6, 0x2883, 0x50F8, 0x2880, 0x50F9, 0x1106,
+ 0x50FB, 0x1104, 0x50FD, 0x2887, 0x50FE, 0x2884, 0x50FF, 0x287D,
+ 0x5100, 0x1103, 0x5102, 0x1107, 0x5103, 0x287E, 0x5104, 0x1102,
+ 0x5105, 0x110A, 0x5106, 0x2881, 0x5107, 0x2882, 0x5108, 0x1108,
+ 0x5109, 0x1109, 0x510A, 0x2888, 0x510B, 0x2885, 0x510C, 0x2886,
+ 0x5110, 0x128D, 0x5111, 0x2B04, 0x5112, 0x128A, 0x5113, 0x2B01,
+ 0x5114, 0x128C, 0x5115, 0x128E, 0x5117, 0x2B02, 0x5118, 0x128B,
+ 0x511A, 0x2B03, 0x511C, 0x2B00, 0x511F, 0x13B5, 0x5120, 0x2D3E,
+ 0x5121, 0x13B6, 0x5122, 0x2D3C, 0x5124, 0x2D3D, 0x5125, 0x2D3B,
+ 0x5126, 0x2D3A, 0x5129, 0x2D3F, 0x512A, 0x13B4, 0x512D, 0x2F0F,
+ 0x512E, 0x2F10, 0x5130, 0x287F, 0x5131, 0x2F0E, 0x5132, 0x13B7,
+ 0x5133, 0x1575, 0x5134, 0x307A, 0x5135, 0x307B, 0x5137, 0x1668,
+ 0x5138, 0x1669, 0x5139, 0x32C6, 0x513A, 0x32C5, 0x513B, 0x16BC,
+ 0x513C, 0x16BB, 0x513D, 0x340E, 0x513F, 0x025C, 0x5140, 0x0274,
+ 0x5141, 0x02AA, 0x5143, 0x02A9, 0x5144, 0x0303, 0x5145, 0x0302,
+ 0x5146, 0x038A, 0x5147, 0x0389, 0x5148, 0x038B, 0x5149, 0x0388,
+ 0x514B, 0x0434, 0x514C, 0x0433, 0x514D, 0x0435, 0x5152, 0x0545,
+ 0x5154, 0x0544, 0x5155, 0x0546, 0x5157, 0x06BC, 0x5159, 0x0119,
+ 0x515A, 0x1C32, 0x515B, 0x011A, 0x515C, 0x0A0F, 0x515D, 0x011C,
+ 0x515E, 0x011B, 0x515F, 0x20BD, 0x5161, 0x011D, 0x5162, 0x0F8A,
+ 0x5163, 0x011E, 0x5165, 0x025D, 0x5167, 0x02AB, 0x5168, 0x038C,
+ 0x5169, 0x0547, 0x516B, 0x025E, 0x516C, 0x02AE, 0x516D, 0x02AC,
+ 0x516E, 0x02AD, 0x5171, 0x038D, 0x5175, 0x0436, 0x5176, 0x0549,
+ 0x5177, 0x0548, 0x5178, 0x054A, 0x517C, 0x0852, 0x5180, 0x128F,
+ 0x5182, 0x021D, 0x5187, 0x1779, 0x5188, 0x36B6, 0x5189, 0x0304,
+ 0x518A, 0x0305, 0x518D, 0x038E, 0x518F, 0x1833, 0x5191, 0x06BE,
+ 0x5192, 0x06BD, 0x5193, 0x1C34, 0x5194, 0x1C33, 0x5195, 0x0A10,
+ 0x5196, 0x021E, 0x5197, 0x02AF, 0x5198, 0x1780, 0x519E, 0x1910,
+ 0x51A0, 0x06BF, 0x51A2, 0x0855, 0x51A4, 0x0853, 0x51A5, 0x0854,
+ 0x51AA, 0x1290, 0x51AB, 0x021F, 0x51AC, 0x0306, 0x51B0, 0x038F,
+ 0x51B1, 0x17C6, 0x51B6, 0x0437, 0x51B7, 0x0438, 0x51B9, 0x1834,
+ 0x51BC, 0x1911, 0x51BD, 0x054B, 0x51BE, 0x1912, 0x51C4, 0x1C36,
+ 0x51C5, 0x1C37, 0x51C6, 0x0858, 0x51C8, 0x1C38, 0x51CA, 0x1C35,
+ 0x51CB, 0x0859, 0x51CC, 0x0857, 0x51CD, 0x0856, 0x51CE, 0x1C39,
+ 0x51D0, 0x1E52, 0x51D4, 0x20BE, 0x51D7, 0x2375, 0x51D8, 0x2622,
+ 0x51DC, 0x110B, 0x51DD, 0x1291, 0x51DE, 0x2B05, 0x51E0, 0x025F,
+ 0x51E1, 0x026D, 0x51F0, 0x0A11, 0x51F1, 0x0BF1, 0x51F3, 0x0F8B,
+ 0x51F5, 0x176E, 0x51F6, 0x02B0, 0x51F8, 0x0309, 0x51F9, 0x0307,
+ 0x51FA, 0x0308, 0x51FD, 0x054C, 0x5200, 0x0260, 0x5201, 0x0261,
+ 0x5202, 0x36B3, 0x5203, 0x0275, 0x5206, 0x02B1, 0x5207, 0x02B2,
+ 0x5208, 0x02B3, 0x5209, 0x1797, 0x520A, 0x030A, 0x520C, 0x1796,
+ 0x520E, 0x0393, 0x5210, 0x17C8, 0x5211, 0x0391, 0x5212, 0x0392,
+ 0x5213, 0x17C7, 0x5216, 0x0394, 0x5217, 0x0390, 0x521C, 0x1835,
+ 0x521D, 0x068B, 0x521E, 0x1836, 0x5221, 0x1837, 0x5224, 0x043A,
+ 0x5225, 0x0439, 0x5228, 0x043D, 0x5229, 0x043B, 0x522A, 0x043C,
+ 0x522E, 0x0552, 0x5230, 0x0551, 0x5231, 0x1917, 0x5232, 0x1914,
+ 0x5233, 0x1915, 0x5235, 0x1913, 0x5236, 0x0553, 0x5237, 0x054F,
+ 0x5238, 0x054E, 0x523A, 0x0550, 0x523B, 0x054D, 0x5241, 0x0554,
+ 0x5243, 0x06C1, 0x5244, 0x1A6D, 0x5246, 0x1916, 0x5247, 0x06C6,
+ 0x5249, 0x1A6E, 0x524A, 0x06C2, 0x524B, 0x06C5, 0x524C, 0x06C4,
+ 0x524D, 0x06C3, 0x524E, 0x06C0, 0x5252, 0x1C3C, 0x5254, 0x085C,
+ 0x5255, 0x1C3F, 0x5256, 0x085A, 0x525A, 0x1C3B, 0x525B, 0x085D,
+ 0x525C, 0x085B, 0x525D, 0x085E, 0x525E, 0x1C3D, 0x525F, 0x1C3E,
+ 0x5261, 0x1C3A, 0x5262, 0x1C40, 0x5269, 0x0BF5, 0x526A, 0x0A12,
+ 0x526B, 0x1E53, 0x526C, 0x1E55, 0x526D, 0x1E54, 0x526E, 0x1E56,
+ 0x526F, 0x0A13, 0x5272, 0x0BF2, 0x5274, 0x0BF3, 0x5275, 0x0BF4,
+ 0x5277, 0x0DCB, 0x5278, 0x2377, 0x527A, 0x2376, 0x527B, 0x2378,
+ 0x527C, 0x2379, 0x527D, 0x0DCC, 0x527F, 0x0DCA, 0x5280, 0x2623,
+ 0x5281, 0x2624, 0x5282, 0x0F8D, 0x5283, 0x0F8C, 0x5284, 0x2776,
+ 0x5287, 0x110C, 0x5288, 0x110D, 0x5289, 0x110E, 0x528A, 0x1110,
+ 0x528B, 0x2889, 0x528C, 0x288A, 0x528D, 0x110F, 0x5291, 0x1292,
+ 0x5293, 0x1293, 0x5296, 0x307C, 0x5297, 0x32C8, 0x5298, 0x32C7,
+ 0x5299, 0x340F, 0x529B, 0x0262, 0x529F, 0x030C, 0x52A0, 0x030B,
+ 0x52A3, 0x0395, 0x52A6, 0x17C9, 0x52A9, 0x043F, 0x52AA, 0x0440,
+ 0x52AB, 0x043E, 0x52AC, 0x0441, 0x52AD, 0x1838, 0x52AE, 0x1839,
+ 0x52BB, 0x0556, 0x52BC, 0x1918, 0x52BE, 0x0555, 0x52C0, 0x1A6F,
+ 0x52C1, 0x06CA, 0x52C2, 0x1A70, 0x52C3, 0x06C9, 0x52C7, 0x06C7,
+ 0x52C9, 0x06C8, 0x52CD, 0x1C41, 0x52D2, 0x0A14, 0x52D3, 0x1E58,
+ 0x52D5, 0x0A17, 0x52D6, 0x1E57, 0x52D7, 0x0ACF, 0x52D8, 0x0A16,
+ 0x52D9, 0x0A15, 0x52DB, 0x0BF8, 0x52DD, 0x0BF7, 0x52DE, 0x0BF6,
+ 0x52DF, 0x0DCD, 0x52E2, 0x0DD0, 0x52E3, 0x0DD1, 0x52E4, 0x0DCF,
+ 0x52E6, 0x0DCE, 0x52E9, 0x2625, 0x52EB, 0x2626, 0x52EF, 0x288C,
+ 0x52F0, 0x1111, 0x52F1, 0x288B, 0x52F3, 0x1294, 0x52F4, 0x2D40,
+ 0x52F5, 0x13B8, 0x52F7, 0x307D, 0x52F8, 0x1609, 0x52F9, 0x0220,
+ 0x52FA, 0x0276, 0x52FB, 0x02B4, 0x52FC, 0x1781, 0x52FE, 0x02B5,
+ 0x52FF, 0x02B6, 0x5305, 0x030D, 0x5306, 0x030E, 0x5308, 0x0396,
+ 0x5309, 0x183A, 0x530A, 0x1919, 0x530B, 0x191A, 0x530D, 0x06CB,
+ 0x530E, 0x1C42, 0x530F, 0x0A19, 0x5310, 0x0A18, 0x5311, 0x20C0,
+ 0x5312, 0x20BF, 0x5315, 0x0263, 0x5316, 0x02B7, 0x5317, 0x030F,
+ 0x5319, 0x0A1A, 0x531A, 0x176F, 0x531C, 0x1798, 0x531D, 0x0310,
+ 0x531F, 0x17CB, 0x5320, 0x0398, 0x5321, 0x0397, 0x5322, 0x17CA,
+ 0x5323, 0x0442, 0x532A, 0x085F, 0x532D, 0x1E59, 0x532F, 0x0DD2,
+ 0x5330, 0x2627, 0x5331, 0x0F8E, 0x5334, 0x2B06, 0x5337, 0x31C7,
+ 0x5338, 0x0221, 0x5339, 0x02B8, 0x533C, 0x191B, 0x533D, 0x1A71,
+ 0x533E, 0x0A1D, 0x533F, 0x0A1B, 0x5340, 0x0A1C, 0x5341, 0x0264,
+ 0x5343, 0x0277, 0x5344, 0x016B, 0x5345, 0x02BB, 0x5347, 0x02BA,
+ 0x5348, 0x02B9, 0x5349, 0x0313, 0x534A, 0x0312, 0x534C, 0x1799,
+ 0x534D, 0x17CC, 0x5351, 0x055A, 0x5352, 0x0557, 0x5353, 0x0559,
+ 0x5354, 0x0558, 0x5357, 0x06CC, 0x535A, 0x0BF9, 0x535C, 0x0265,
+ 0x535E, 0x02BC, 0x5360, 0x0315, 0x5361, 0x0314, 0x5363, 0x183B,
+ 0x5366, 0x055B, 0x5369, 0x0222, 0x536C, 0x1782, 0x536E, 0x0317,
+ 0x536F, 0x0316, 0x5370, 0x0399, 0x5371, 0x039A, 0x5372, 0x183C,
+ 0x5373, 0x0443, 0x5375, 0x0444, 0x5377, 0x055C, 0x5378, 0x055D,
+ 0x5379, 0x055E, 0x537B, 0x06CD, 0x537C, 0x1A72, 0x537F, 0x0860,
+ 0x5382, 0x1770, 0x5384, 0x02BD, 0x538A, 0x17CD, 0x538E, 0x183D,
+ 0x538F, 0x183E, 0x5392, 0x191C, 0x5394, 0x191D, 0x5396, 0x1A74,
+ 0x5397, 0x1A73, 0x5398, 0x1A76, 0x5399, 0x1A75, 0x539A, 0x06CE,
+ 0x539C, 0x1E5A, 0x539D, 0x0862, 0x539E, 0x1C43, 0x539F, 0x0861,
+ 0x53A4, 0x20C1, 0x53A5, 0x0BFA, 0x53A7, 0x20C2, 0x53AC, 0x2628,
+ 0x53AD, 0x0F8F, 0x53B2, 0x1112, 0x53B4, 0x307E, 0x53B6, 0x0223,
+ 0x53B9, 0x1783, 0x53BB, 0x0318, 0x53C3, 0x0A1E, 0x53C8, 0x0266,
+ 0x53C9, 0x0278, 0x53CA, 0x02BF, 0x53CB, 0x02BE, 0x53CD, 0x02C0,
+ 0x53D4, 0x0560, 0x53D6, 0x055F, 0x53D7, 0x0561, 0x53DB, 0x06CF,
+ 0x53DF, 0x0863, 0x53E1, 0x2B07, 0x53E2, 0x14C9, 0x53E3, 0x0279,
+ 0x53E4, 0x031A, 0x53E5, 0x0329, 0x53E6, 0x0324, 0x53E8, 0x031F,
+ 0x53E9, 0x031E, 0x53EA, 0x0325, 0x53EB, 0x0323, 0x53EC, 0x031C,
+ 0x53ED, 0x032A, 0x53EE, 0x031D, 0x53EF, 0x0319, 0x53F0, 0x0328,
+ 0x53F1, 0x0327, 0x53F2, 0x0326, 0x53F3, 0x031B, 0x53F5, 0x0322,
+ 0x53F8, 0x0321, 0x53FB, 0x032B, 0x53FC, 0x0320, 0x5401, 0x03A0,
+ 0x5403, 0x03A6, 0x5404, 0x03A2, 0x5406, 0x03A8, 0x5407, 0x17CE,
+ 0x5408, 0x03A5, 0x5409, 0x039B, 0x540A, 0x039E, 0x540B, 0x03A1,
+ 0x540C, 0x039D, 0x540D, 0x03A4, 0x540E, 0x03A7, 0x540F, 0x039C,
+ 0x5410, 0x039F, 0x5411, 0x03A3, 0x5412, 0x03A9, 0x5418, 0x1847,
+ 0x5419, 0x1844, 0x541B, 0x0451, 0x541C, 0x1845, 0x541D, 0x0445,
+ 0x541E, 0x0447, 0x541F, 0x045F, 0x5420, 0x045A, 0x5424, 0x184C,
+ 0x5425, 0x1846, 0x5426, 0x0449, 0x5427, 0x044B, 0x5428, 0x184B,
+ 0x5429, 0x0452, 0x542A, 0x1841, 0x542B, 0x045E, 0x542C, 0x0460,
+ 0x542D, 0x0446, 0x542E, 0x0457, 0x5430, 0x183F, 0x5431, 0x045D,
+ 0x5433, 0x044E, 0x5435, 0x0458, 0x5436, 0x0459, 0x5437, 0x1840,
+ 0x5438, 0x0456, 0x5439, 0x0454, 0x543B, 0x0455, 0x543C, 0x045B,
+ 0x543D, 0x1848, 0x543E, 0x0448, 0x5440, 0x045C, 0x5441, 0x184A,
+ 0x5442, 0x0450, 0x5443, 0x044D, 0x5445, 0x1843, 0x5446, 0x044C,
+ 0x5447, 0x184D, 0x5448, 0x044F, 0x544A, 0x0453, 0x544E, 0x044A,
+ 0x544F, 0x1849, 0x5454, 0x1842, 0x5460, 0x192E, 0x5461, 0x192D,
+ 0x5462, 0x0573, 0x5463, 0x1930, 0x5464, 0x1932, 0x5465, 0x1927,
+ 0x5466, 0x192A, 0x5467, 0x1931, 0x5468, 0x0574, 0x546B, 0x1924,
+ 0x546C, 0x1928, 0x546F, 0x192C, 0x5470, 0x1A85, 0x5471, 0x056F,
+ 0x5472, 0x1A89, 0x5473, 0x0562, 0x5474, 0x1929, 0x5475, 0x0563,
+ 0x5476, 0x0570, 0x5477, 0x0569, 0x5478, 0x0565, 0x547A, 0x1925,
+ 0x547B, 0x0568, 0x547C, 0x056D, 0x547D, 0x0576, 0x547E, 0x1926,
+ 0x547F, 0x191F, 0x5480, 0x0567, 0x5481, 0x1920, 0x5482, 0x1922,
+ 0x5484, 0x056A, 0x5486, 0x056C, 0x5487, 0x191E, 0x5488, 0x1923,
+ 0x548B, 0x0575, 0x548C, 0x0571, 0x548D, 0x192B, 0x548E, 0x0577,
+ 0x5490, 0x056E, 0x5491, 0x1921, 0x5492, 0x056B, 0x5495, 0x0566,
+ 0x5496, 0x0564, 0x5498, 0x192F, 0x549A, 0x0572, 0x54A0, 0x1A84,
+ 0x54A1, 0x1A78, 0x54A2, 0x1A87, 0x54A5, 0x1A7A, 0x54A6, 0x06D6,
+ 0x54A7, 0x06E4, 0x54A8, 0x06D2, 0x54A9, 0x06E3, 0x54AA, 0x06DB,
+ 0x54AB, 0x06E0, 0x54AC, 0x06D0, 0x54AD, 0x1A79, 0x54AE, 0x1A7F,
+ 0x54AF, 0x06DF, 0x54B0, 0x1A8B, 0x54B1, 0x06E1, 0x54B3, 0x06D7,
+ 0x54B6, 0x1A81, 0x54B7, 0x1A7E, 0x54B8, 0x06D5, 0x54BA, 0x1A77,
+ 0x54BB, 0x06E2, 0x54BC, 0x1A86, 0x54BD, 0x06DA, 0x54BE, 0x1A88,
+ 0x54BF, 0x06E5, 0x54C0, 0x06D1, 0x54C1, 0x06DC, 0x54C2, 0x06D9,
+ 0x54C3, 0x1A7C, 0x54C4, 0x06DD, 0x54C5, 0x1A82, 0x54C6, 0x1A83,
+ 0x54C7, 0x06D8, 0x54C8, 0x06DE, 0x54C9, 0x06D4, 0x54CE, 0x06D3,
+ 0x54CF, 0x1A7B, 0x54D6, 0x1A80, 0x54DE, 0x1A8A, 0x54E0, 0x1C57,
+ 0x54E1, 0x0870, 0x54E2, 0x1C45, 0x54E4, 0x1C4A, 0x54E5, 0x0869,
+ 0x54E6, 0x0874, 0x54E7, 0x1C48, 0x54E8, 0x0864, 0x54E9, 0x086E,
+ 0x54EA, 0x0873, 0x54EB, 0x1C4F, 0x54ED, 0x086F, 0x54EE, 0x0872,
+ 0x54F1, 0x1C52, 0x54F2, 0x086A, 0x54F3, 0x1C49, 0x54F7, 0x1C55,
+ 0x54F8, 0x1C56, 0x54FA, 0x086C, 0x54FB, 0x1C54, 0x54FC, 0x0868,
+ 0x54FD, 0x0877, 0x54FF, 0x1C4C, 0x5501, 0x0866, 0x5503, 0x1C59,
+ 0x5504, 0x1C4D, 0x5505, 0x1C51, 0x5506, 0x086B, 0x5507, 0x0876,
+ 0x5508, 0x1C4E, 0x5509, 0x0871, 0x550A, 0x1C53, 0x550B, 0x1C5A,
+ 0x550C, 0x1E69, 0x550E, 0x1C58, 0x550F, 0x0878, 0x5510, 0x0865,
+ 0x5511, 0x1C50, 0x5512, 0x1C47, 0x5514, 0x086D, 0x5517, 0x1C46,
+ 0x551A, 0x1C4B, 0x5526, 0x1C44, 0x5527, 0x0875, 0x552A, 0x1E61,
+ 0x552C, 0x0A31, 0x552D, 0x1E6F, 0x552E, 0x0A2F, 0x552F, 0x0A2C,
+ 0x5530, 0x1E66, 0x5531, 0x0A28, 0x5532, 0x1E6A, 0x5533, 0x0A33,
+ 0x5534, 0x1E60, 0x5535, 0x1E65, 0x5536, 0x1E64, 0x5537, 0x0867,
+ 0x5538, 0x0A2E, 0x5539, 0x1E6D, 0x553B, 0x1E70, 0x553C, 0x1E5D,
+ 0x553E, 0x0C0C, 0x5540, 0x1E71, 0x5541, 0x0A34, 0x5543, 0x0A26,
+ 0x5544, 0x0A23, 0x5545, 0x1E68, 0x5546, 0x0A20, 0x5548, 0x1E6E,
+ 0x554A, 0x0A27, 0x554B, 0x1E72, 0x554D, 0x1E5E, 0x554E, 0x1E6C,
+ 0x554F, 0x0A2A, 0x5550, 0x1E5F, 0x5551, 0x1E62, 0x5552, 0x1E67,
+ 0x5555, 0x0A2B, 0x5556, 0x0A29, 0x5557, 0x0A35, 0x555C, 0x0A30,
+ 0x555E, 0x0A24, 0x555F, 0x0ABC, 0x5561, 0x0A25, 0x5562, 0x1E63,
+ 0x5563, 0x0A32, 0x5564, 0x0A2D, 0x5565, 0x1E6B, 0x5566, 0x0A22,
+ 0x556A, 0x0A21, 0x5575, 0x1E5B, 0x5576, 0x1E5C, 0x5577, 0x20C7,
+ 0x557B, 0x0BFB, 0x557C, 0x0BFE, 0x557D, 0x20D2, 0x557E, 0x0C12,
+ 0x557F, 0x20D5, 0x5580, 0x0BFC, 0x5581, 0x20CE, 0x5582, 0x0C02,
+ 0x5583, 0x0C08, 0x5584, 0x0D1B, 0x5587, 0x0C06, 0x5588, 0x20CB,
+ 0x5589, 0x0C13, 0x558A, 0x0BFF, 0x558B, 0x0C07, 0x558C, 0x20D3,
+ 0x558D, 0x2387, 0x558E, 0x20D8, 0x558F, 0x20CC, 0x5591, 0x20C3,
+ 0x5592, 0x20D0, 0x5593, 0x20CA, 0x5594, 0x0C05, 0x5595, 0x20D6,
+ 0x5598, 0x0C01, 0x5599, 0x0C15, 0x559A, 0x0C0E, 0x559C, 0x0C03,
+ 0x559D, 0x0C00, 0x559F, 0x0C0B, 0x55A1, 0x20D7, 0x55A2, 0x20C9,
+ 0x55A3, 0x20CF, 0x55A4, 0x20D1, 0x55A5, 0x20C5, 0x55A6, 0x20D4,
+ 0x55A7, 0x0BFD, 0x55A8, 0x20C4, 0x55AA, 0x0C04, 0x55AB, 0x0C14,
+ 0x55AC, 0x0C10, 0x55AD, 0x20C6, 0x55AE, 0x0C0A, 0x55B1, 0x0C11,
+ 0x55B2, 0x0C0D, 0x55B3, 0x0C09, 0x55B5, 0x20CD, 0x55BB, 0x0C0F,
+ 0x55BF, 0x2385, 0x55C0, 0x2381, 0x55C2, 0x2390, 0x55C3, 0x237A,
+ 0x55C4, 0x2383, 0x55C5, 0x0DE0, 0x55C6, 0x0DE1, 0x55C7, 0x0DD9,
+ 0x55C8, 0x238C, 0x55C9, 0x0DE3, 0x55CA, 0x237F, 0x55CB, 0x237E,
+ 0x55CC, 0x237C, 0x55CD, 0x238E, 0x55CE, 0x0DD7, 0x55CF, 0x2388,
+ 0x55D0, 0x237D, 0x55D1, 0x0DDA, 0x55D2, 0x2386, 0x55D3, 0x0DD5,
+ 0x55D4, 0x2382, 0x55D5, 0x2389, 0x55D6, 0x238B, 0x55D9, 0x238F,
+ 0x55DA, 0x0DDE, 0x55DB, 0x237B, 0x55DC, 0x0DD8, 0x55DD, 0x2380,
+ 0x55DF, 0x0DD3, 0x55E1, 0x0DDF, 0x55E2, 0x238A, 0x55E3, 0x0DDB,
+ 0x55E4, 0x0DDC, 0x55E5, 0x0DE2, 0x55E6, 0x0DD6, 0x55E7, 0x011F,
+ 0x55E8, 0x0DD4, 0x55E9, 0x2384, 0x55EF, 0x0DDD, 0x55F2, 0x238D,
+ 0x55F6, 0x0F9F, 0x55F7, 0x0F9A, 0x55F9, 0x2637, 0x55FA, 0x2633,
+ 0x55FC, 0x262D, 0x55FD, 0x0F94, 0x55FE, 0x0F90, 0x55FF, 0x2636,
+ 0x5600, 0x0F91, 0x5601, 0x2630, 0x5602, 0x2632, 0x5604, 0x2635,
+ 0x5606, 0x0F96, 0x5608, 0x0F9D, 0x5609, 0x0F97, 0x560C, 0x262B,
+ 0x560D, 0x0F98, 0x560E, 0x0F99, 0x560F, 0x262E, 0x5610, 0x0F9E,
+ 0x5612, 0x262C, 0x5613, 0x2631, 0x5614, 0x0F95, 0x5615, 0x262A,
+ 0x5616, 0x0F9B, 0x5617, 0x0F93, 0x561B, 0x0F92, 0x561C, 0x262F,
+ 0x561D, 0x2634, 0x561F, 0x0F9C, 0x5627, 0x2629, 0x5629, 0x1119,
+ 0x562A, 0x289D, 0x562C, 0x289A, 0x562E, 0x1113, 0x562F, 0x111F,
+ 0x5630, 0x1120, 0x5632, 0x1116, 0x5633, 0x2898, 0x5634, 0x1118,
+ 0x5635, 0x2890, 0x5636, 0x111E, 0x5638, 0x289C, 0x5639, 0x1115,
+ 0x563A, 0x289E, 0x563B, 0x1114, 0x563D, 0x2899, 0x563E, 0x289B,
+ 0x563F, 0x1117, 0x5640, 0x2897, 0x5641, 0x2891, 0x5642, 0x288E,
+ 0x5645, 0x20C8, 0x5646, 0x2894, 0x5648, 0x288D, 0x5649, 0x2893,
+ 0x564A, 0x2892, 0x564C, 0x288F, 0x564E, 0x111B, 0x5653, 0x111A,
+ 0x5657, 0x111C, 0x5658, 0x2895, 0x5659, 0x1295, 0x565A, 0x2896,
+ 0x565E, 0x2B10, 0x5660, 0x2B09, 0x5662, 0x12A1, 0x5663, 0x2B0D,
+ 0x5664, 0x1299, 0x5665, 0x129D, 0x5666, 0x2B0C, 0x5668, 0x129C,
+ 0x5669, 0x1298, 0x566A, 0x129B, 0x566B, 0x1296, 0x566C, 0x12A0,
+ 0x566D, 0x2B0E, 0x566E, 0x2B0A, 0x566F, 0x129F, 0x5670, 0x2B08,
+ 0x5671, 0x129E, 0x5672, 0x2B0F, 0x5673, 0x2B0B, 0x5674, 0x111D,
+ 0x5676, 0x12A2, 0x5677, 0x2B11, 0x5678, 0x129A, 0x5679, 0x1297,
+ 0x567E, 0x2D47, 0x567F, 0x2D49, 0x5680, 0x13BA, 0x5681, 0x2D4A,
+ 0x5682, 0x2D48, 0x5683, 0x2D46, 0x5684, 0x2D45, 0x5685, 0x13BC,
+ 0x5686, 0x2D44, 0x5687, 0x13BD, 0x568C, 0x2D42, 0x568D, 0x2D43,
+ 0x568E, 0x13B9, 0x568F, 0x13BE, 0x5690, 0x13BB, 0x5693, 0x2D41,
+ 0x5695, 0x14CA, 0x5697, 0x2F13, 0x5698, 0x2F11, 0x5699, 0x2F16,
+ 0x569A, 0x2F14, 0x569C, 0x2F12, 0x569D, 0x2F15, 0x56A5, 0x1576,
+ 0x56A6, 0x3081, 0x56A7, 0x3082, 0x56A8, 0x1577, 0x56AA, 0x3083,
+ 0x56AB, 0x307F, 0x56AC, 0x3084, 0x56AD, 0x3080, 0x56AE, 0x14CB,
+ 0x56B2, 0x31C8, 0x56B3, 0x31CA, 0x56B4, 0x160C, 0x56B5, 0x31C9,
+ 0x56B6, 0x160B, 0x56B7, 0x160A, 0x56BC, 0x160D, 0x56BD, 0x32CA,
+ 0x56BE, 0x32CB, 0x56C0, 0x166B, 0x56C1, 0x166A, 0x56C2, 0x166C,
+ 0x56C3, 0x32C9, 0x56C5, 0x3379, 0x56C6, 0x3378, 0x56C8, 0x16BD,
+ 0x56C9, 0x16BF, 0x56CA, 0x16BE, 0x56CB, 0x337A, 0x56CC, 0x16F6,
+ 0x56CD, 0x3481, 0x56D1, 0x171F, 0x56D3, 0x3480, 0x56D4, 0x34C9,
+ 0x56D7, 0x1775, 0x56DA, 0x032D, 0x56DB, 0x032C, 0x56DD, 0x03AC,
+ 0x56DE, 0x03AB, 0x56DF, 0x17D0, 0x56E0, 0x03AA, 0x56E1, 0x17CF,
+ 0x56E4, 0x0463, 0x56E5, 0x1850, 0x56E7, 0x184F, 0x56EA, 0x0461,
+ 0x56EB, 0x0464, 0x56EE, 0x184E, 0x56F0, 0x0462, 0x56F7, 0x1933,
+ 0x56F9, 0x1934, 0x56FA, 0x0578, 0x56FF, 0x06E6, 0x5701, 0x1C5B,
+ 0x5702, 0x1C5C, 0x5703, 0x0879, 0x5704, 0x087A, 0x5707, 0x1E74,
+ 0x5708, 0x0A36, 0x5709, 0x0A38, 0x570A, 0x1E73, 0x570B, 0x0A37,
+ 0x570C, 0x20D9, 0x570D, 0x0C16, 0x5712, 0x0DE4, 0x5713, 0x0DE5,
+ 0x5714, 0x2391, 0x5716, 0x0FA1, 0x5718, 0x0FA0, 0x571A, 0x289F,
+ 0x571B, 0x2B13, 0x571C, 0x2B12, 0x571E, 0x3505, 0x571F, 0x027A,
+ 0x5720, 0x1784, 0x5722, 0x179A, 0x5723, 0x179B, 0x5728, 0x03AF,
+ 0x5729, 0x03B3, 0x572A, 0x17D2, 0x572C, 0x03B1, 0x572D, 0x03B0,
+ 0x572E, 0x17D1, 0x572F, 0x03B2, 0x5730, 0x03AE, 0x5733, 0x03AD,
+ 0x5734, 0x17D3, 0x573B, 0x046E, 0x573E, 0x046B, 0x5740, 0x0467,
+ 0x5741, 0x1851, 0x5745, 0x1852, 0x5747, 0x0469, 0x5749, 0x1854,
+ 0x574A, 0x0465, 0x574B, 0x1855, 0x574C, 0x1853, 0x574D, 0x0468,
+ 0x574E, 0x046A, 0x574F, 0x046D, 0x5750, 0x046C, 0x5751, 0x0466,
+ 0x5752, 0x1856, 0x5761, 0x057D, 0x5762, 0x1941, 0x5764, 0x057F,
+ 0x5766, 0x057E, 0x5768, 0x1942, 0x5769, 0x057C, 0x576A, 0x057B,
+ 0x576B, 0x1938, 0x576D, 0x1937, 0x576F, 0x1935, 0x5770, 0x193A,
+ 0x5771, 0x1939, 0x5772, 0x1936, 0x5773, 0x193F, 0x5774, 0x1940,
+ 0x5775, 0x193D, 0x5776, 0x193B, 0x5777, 0x057A, 0x577B, 0x193E,
+ 0x577C, 0x0580, 0x577D, 0x1943, 0x5780, 0x193C, 0x5782, 0x06E7,
+ 0x5783, 0x0579, 0x578B, 0x06E8, 0x578C, 0x1A90, 0x578F, 0x1A96,
+ 0x5793, 0x06EE, 0x5794, 0x1A94, 0x5795, 0x1A9A, 0x5797, 0x1A91,
+ 0x5798, 0x1A95, 0x5799, 0x1A97, 0x579A, 0x1A99, 0x579B, 0x1A93,
+ 0x579D, 0x1A92, 0x579E, 0x1A8D, 0x579F, 0x1A8E, 0x57A0, 0x06E9,
+ 0x57A2, 0x06EB, 0x57A3, 0x06EA, 0x57A4, 0x1A8F, 0x57A5, 0x1A98,
+ 0x57AE, 0x06ED, 0x57B5, 0x1A8C, 0x57B6, 0x1C66, 0x57B8, 0x1C65,
+ 0x57B9, 0x1C6A, 0x57BA, 0x1C61, 0x57BC, 0x1C64, 0x57BD, 0x1C63,
+ 0x57BF, 0x1C67, 0x57C1, 0x1C6B, 0x57C2, 0x087B, 0x57C3, 0x087E,
+ 0x57C6, 0x1C62, 0x57C7, 0x1C68, 0x57CB, 0x087D, 0x57CC, 0x1C5D,
+ 0x57CE, 0x06EC, 0x57CF, 0x1E82, 0x57D0, 0x1C69, 0x57D2, 0x1C60,
+ 0x57D4, 0x087C, 0x57D5, 0x1C5F, 0x57DC, 0x1E79, 0x57DF, 0x0A39,
+ 0x57E0, 0x0A3D, 0x57E1, 0x1E89, 0x57E2, 0x1E77, 0x57E3, 0x1E85,
+ 0x57E4, 0x0A3E, 0x57E5, 0x1E87, 0x57E7, 0x1E8D, 0x57E9, 0x1E91,
+ 0x57EC, 0x1E88, 0x57ED, 0x1E7C, 0x57EE, 0x1E84, 0x57F0, 0x1E92,
+ 0x57F1, 0x1E90, 0x57F2, 0x1E86, 0x57F3, 0x1E81, 0x57F4, 0x1E7A,
+ 0x57F5, 0x20E1, 0x57F6, 0x1E78, 0x57F7, 0x0A42, 0x57F8, 0x1E7F,
+ 0x57F9, 0x0A43, 0x57FA, 0x0A3F, 0x57FB, 0x1E75, 0x57FC, 0x1E8B,
+ 0x57FD, 0x1E7D, 0x5800, 0x1E7B, 0x5801, 0x1E8E, 0x5802, 0x0A40,
+ 0x5804, 0x1E94, 0x5805, 0x0A3A, 0x5806, 0x0A3C, 0x5807, 0x1E83,
+ 0x5808, 0x1E7E, 0x5809, 0x087F, 0x580A, 0x0A3B, 0x580B, 0x1E80,
+ 0x580C, 0x1E8F, 0x580D, 0x1E93, 0x580E, 0x1E8A, 0x5810, 0x1E8C,
+ 0x5814, 0x1E76, 0x5819, 0x20DC, 0x581B, 0x20E5, 0x581C, 0x20E4,
+ 0x581D, 0x0C1E, 0x581E, 0x20DD, 0x5820, 0x0C1F, 0x5821, 0x0C1D,
+ 0x5823, 0x20DF, 0x5824, 0x0C1A, 0x5825, 0x20E3, 0x5827, 0x20DE,
+ 0x5828, 0x20E0, 0x5829, 0x20DA, 0x582A, 0x0C18, 0x582C, 0x20ED,
+ 0x582D, 0x20EC, 0x582E, 0x20E9, 0x582F, 0x0C17, 0x5830, 0x0C1B,
+ 0x5831, 0x0C1C, 0x5832, 0x1C5E, 0x5833, 0x20E6, 0x5834, 0x0C19,
+ 0x5835, 0x0A41, 0x5836, 0x20E8, 0x5837, 0x20DB, 0x5838, 0x20EB,
+ 0x5839, 0x20EA, 0x583B, 0x20EE, 0x583D, 0x239F, 0x583F, 0x20E7,
+ 0x5848, 0x20E2, 0x5849, 0x2397, 0x584A, 0x0DEF, 0x584B, 0x0DF2,
+ 0x584C, 0x0DED, 0x584D, 0x2396, 0x584E, 0x239A, 0x584F, 0x2395,
+ 0x5851, 0x0DE7, 0x5852, 0x0DF1, 0x5853, 0x2392, 0x5854, 0x0DEB,
+ 0x5855, 0x2399, 0x5857, 0x0DE9, 0x5858, 0x0DE8, 0x5859, 0x239C,
+ 0x585A, 0x0DEA, 0x585B, 0x239E, 0x585D, 0x239B, 0x585E, 0x0DE6,
+ 0x5862, 0x0DF0, 0x5863, 0x23A0, 0x5864, 0x2394, 0x5865, 0x239D,
+ 0x5868, 0x2393, 0x586B, 0x0DEC, 0x586D, 0x0DEE, 0x586F, 0x2398,
+ 0x5871, 0x23A1, 0x5874, 0x263F, 0x5875, 0x0FA2, 0x5876, 0x2645,
+ 0x5879, 0x0FA7, 0x587A, 0x2641, 0x587B, 0x2648, 0x587C, 0x2639,
+ 0x587D, 0x0FA9, 0x587E, 0x0FA3, 0x587F, 0x263E, 0x5880, 0x1121,
+ 0x5881, 0x263D, 0x5882, 0x2646, 0x5883, 0x0FA4, 0x5885, 0x0FA8,
+ 0x5886, 0x263C, 0x5887, 0x2642, 0x5888, 0x2647, 0x5889, 0x2638,
+ 0x588A, 0x0FA6, 0x588B, 0x2640, 0x588E, 0x2644, 0x588F, 0x264A,
+ 0x5890, 0x263A, 0x5891, 0x2643, 0x5893, 0x0FA5, 0x5894, 0x2649,
+ 0x5898, 0x263B, 0x589C, 0x1125, 0x589D, 0x28A1, 0x589E, 0x1123,
+ 0x589F, 0x1122, 0x58A0, 0x28A3, 0x58A1, 0x28A8, 0x58A3, 0x28A4,
+ 0x58A5, 0x28A7, 0x58A6, 0x1128, 0x58A8, 0x1288, 0x58A9, 0x1127,
+ 0x58AB, 0x28A0, 0x58AC, 0x28A6, 0x58AE, 0x1126, 0x58AF, 0x28A5,
+ 0x58B1, 0x28A2, 0x58B3, 0x1124, 0x58BA, 0x2B18, 0x58BB, 0x36EB,
+ 0x58BC, 0x2B1A, 0x58BD, 0x2B15, 0x58BE, 0x12A4, 0x58BF, 0x2B17,
+ 0x58C1, 0x12A3, 0x58C2, 0x2B19, 0x58C5, 0x12A6, 0x58C6, 0x2B1B,
+ 0x58C7, 0x12A5, 0x58C8, 0x2B14, 0x58C9, 0x2B16, 0x58CE, 0x13C2,
+ 0x58CF, 0x2D4D, 0x58D1, 0x13C1, 0x58D2, 0x2D4E, 0x58D3, 0x13C0,
+ 0x58D4, 0x2D4C, 0x58D5, 0x13BF, 0x58D6, 0x2D4B, 0x58D8, 0x14CD,
+ 0x58D9, 0x14CC, 0x58DA, 0x3085, 0x58DB, 0x3087, 0x58DD, 0x3086,
+ 0x58DE, 0x1578, 0x58DF, 0x1579, 0x58E2, 0x157A, 0x58E3, 0x31CB,
+ 0x58E4, 0x160E, 0x58E7, 0x3411, 0x58E8, 0x3410, 0x58E9, 0x1720,
+ 0x58EB, 0x027B, 0x58EC, 0x02C1, 0x58EF, 0x046F, 0x58F4, 0x1A9B,
+ 0x58F9, 0x0C20, 0x58FA, 0x0C21, 0x58FC, 0x23A2, 0x58FD, 0x0FAA,
+ 0x58FE, 0x264B, 0x58FF, 0x28A9, 0x5902, 0x0224, 0x5903, 0x1785,
+ 0x5906, 0x1857, 0x590A, 0x0224, 0x590C, 0x1944, 0x590D, 0x1A9C,
+ 0x590E, 0x1C6C, 0x590F, 0x0880, 0x5912, 0x3088, 0x5914, 0x166D,
+ 0x5915, 0x027C, 0x5916, 0x032E, 0x5917, 0x179C, 0x5919, 0x03B4,
+ 0x591A, 0x03B5, 0x591C, 0x0581, 0x5920, 0x0A44, 0x5922, 0x0FAC,
+ 0x5924, 0x0FAD, 0x5925, 0x0FAB, 0x5927, 0x027D, 0x5929, 0x02C2,
+ 0x592A, 0x02C4, 0x592B, 0x02C3, 0x592C, 0x1786, 0x592D, 0x02C5,
+ 0x592E, 0x032F, 0x592F, 0x179D, 0x5931, 0x0330, 0x5937, 0x03B6,
+ 0x5938, 0x03B7, 0x593C, 0x17D4, 0x593E, 0x0470, 0x5940, 0x1858,
+ 0x5944, 0x0585, 0x5945, 0x1945, 0x5947, 0x0583, 0x5948, 0x0584,
+ 0x5949, 0x0582, 0x594A, 0x1C6D, 0x594E, 0x06F2, 0x594F, 0x06F1,
+ 0x5950, 0x06F3, 0x5951, 0x06F0, 0x5953, 0x1A9D, 0x5954, 0x0586,
+ 0x5955, 0x06EF, 0x5957, 0x0881, 0x5958, 0x0882, 0x595A, 0x0883,
+ 0x595C, 0x1E95, 0x5960, 0x0C22, 0x5961, 0x20EF, 0x5962, 0x0A45,
+ 0x5967, 0x0DF3, 0x5969, 0x0FAF, 0x596A, 0x0FAE, 0x596B, 0x264C,
+ 0x596D, 0x1129, 0x596E, 0x12A7, 0x5970, 0x2F17, 0x5971, 0x337B,
+ 0x5972, 0x3412, 0x5973, 0x027E, 0x5974, 0x0331, 0x5976, 0x0332,
+ 0x5977, 0x17DA, 0x5978, 0x03B9, 0x5979, 0x03BC, 0x597B, 0x17D8,
+ 0x597C, 0x17D6, 0x597D, 0x03BB, 0x597E, 0x17D9, 0x597F, 0x17DB,
+ 0x5980, 0x17D5, 0x5981, 0x03BE, 0x5982, 0x03BD, 0x5983, 0x03BA,
+ 0x5984, 0x03B8, 0x5985, 0x17D7, 0x598A, 0x047B, 0x598D, 0x0478,
+ 0x598E, 0x185D, 0x598F, 0x1860, 0x5990, 0x185F, 0x5992, 0x0472,
+ 0x5993, 0x047A, 0x5996, 0x0477, 0x5997, 0x185C, 0x5998, 0x185A,
+ 0x5999, 0x0476, 0x599D, 0x0471, 0x599E, 0x0474, 0x59A0, 0x185B,
+ 0x59A1, 0x1862, 0x59A2, 0x185E, 0x59A3, 0x0475, 0x59A4, 0x0479,
+ 0x59A5, 0x047C, 0x59A6, 0x1859, 0x59A7, 0x1861, 0x59A8, 0x0473,
+ 0x59AE, 0x058B, 0x59AF, 0x0593, 0x59B1, 0x1951, 0x59B2, 0x194A,
+ 0x59B3, 0x0594, 0x59B4, 0x1955, 0x59B5, 0x1946, 0x59B6, 0x194D,
+ 0x59B9, 0x058A, 0x59BA, 0x1947, 0x59BB, 0x0588, 0x59BC, 0x194E,
+ 0x59BD, 0x1952, 0x59BE, 0x0587, 0x59C0, 0x1953, 0x59C1, 0x194C,
+ 0x59C3, 0x194F, 0x59C5, 0x0596, 0x59C6, 0x058D, 0x59C7, 0x1956,
+ 0x59C8, 0x1954, 0x59CA, 0x0592, 0x59CB, 0x0590, 0x59CC, 0x194B,
+ 0x59CD, 0x058F, 0x59CE, 0x1949, 0x59CF, 0x1948, 0x59D0, 0x058E,
+ 0x59D1, 0x058C, 0x59D2, 0x0595, 0x59D3, 0x0591, 0x59D4, 0x0589,
+ 0x59D6, 0x1950, 0x59D8, 0x06F5, 0x59DA, 0x06FC, 0x59DB, 0x1AAB,
+ 0x59DC, 0x06F4, 0x59DD, 0x1AA3, 0x59DE, 0x1A9F, 0x59E0, 0x1AAF,
+ 0x59E1, 0x1A9E, 0x59E3, 0x06F7, 0x59E4, 0x1AA8, 0x59E5, 0x06FA,
+ 0x59E6, 0x06FD, 0x59E8, 0x06F8, 0x59E9, 0x1AAC, 0x59EA, 0x06FB,
+ 0x59EC, 0x088A, 0x59ED, 0x1AB2, 0x59EE, 0x1AA0, 0x59F1, 0x1AA2,
+ 0x59F2, 0x1AA9, 0x59F3, 0x1AAD, 0x59F4, 0x1AB1, 0x59F5, 0x1AAE,
+ 0x59F6, 0x1AA7, 0x59F7, 0x1AAA, 0x59FA, 0x1AA4, 0x59FB, 0x06FF,
+ 0x59FC, 0x1AA6, 0x59FD, 0x1AA5, 0x59FE, 0x1AB0, 0x59FF, 0x06F6,
+ 0x5A00, 0x1AA1, 0x5A01, 0x06FE, 0x5A03, 0x06F9, 0x5A09, 0x0890,
+ 0x5A0A, 0x1C75, 0x5A0C, 0x088F, 0x5A0F, 0x1C73, 0x5A11, 0x0884,
+ 0x5A13, 0x0889, 0x5A15, 0x1C72, 0x5A16, 0x1C6F, 0x5A17, 0x1C74,
+ 0x5A18, 0x0885, 0x5A19, 0x1C6E, 0x5A1B, 0x0888, 0x5A1C, 0x0886,
+ 0x5A1E, 0x1C76, 0x5A1F, 0x0887, 0x5A20, 0x088B, 0x5A23, 0x088C,
+ 0x5A25, 0x088E, 0x5A29, 0x088D, 0x5A2D, 0x1C70, 0x5A2E, 0x1C71,
+ 0x5A33, 0x1C77, 0x5A35, 0x1E9C, 0x5A36, 0x0A46, 0x5A37, 0x20FD,
+ 0x5A38, 0x1E9B, 0x5A39, 0x1EAE, 0x5A3C, 0x0A4C, 0x5A3E, 0x1EAC,
+ 0x5A40, 0x0A4B, 0x5A41, 0x0A47, 0x5A42, 0x1EB5, 0x5A43, 0x1EA5,
+ 0x5A44, 0x1EA8, 0x5A46, 0x0A4F, 0x5A47, 0x1EB2, 0x5A48, 0x1EAA,
+ 0x5A49, 0x0A48, 0x5A4A, 0x0A50, 0x5A4C, 0x1EAF, 0x5A4D, 0x1EAD,
+ 0x5A50, 0x1E9E, 0x5A51, 0x1EB3, 0x5A52, 0x1EA7, 0x5A53, 0x1EA2,
+ 0x5A55, 0x1E98, 0x5A56, 0x1EB4, 0x5A57, 0x1EA4, 0x5A58, 0x1E97,
+ 0x5A5A, 0x0A4E, 0x5A5B, 0x1EA9, 0x5A5C, 0x1EB6, 0x5A5D, 0x1EA6,
+ 0x5A5E, 0x1E9A, 0x5A5F, 0x1E9F, 0x5A60, 0x1E96, 0x5A62, 0x0A4D,
+ 0x5A64, 0x1EA3, 0x5A65, 0x1EA0, 0x5A66, 0x0A49, 0x5A67, 0x1E99,
+ 0x5A69, 0x1EB1, 0x5A6A, 0x0A4A, 0x5A6C, 0x1EA1, 0x5A6D, 0x1E9D,
+ 0x5A70, 0x1EB0, 0x5A77, 0x0C23, 0x5A78, 0x20F6, 0x5A7A, 0x20F3,
+ 0x5A7B, 0x2104, 0x5A7C, 0x20F8, 0x5A7D, 0x2105, 0x5A7F, 0x0C25,
+ 0x5A83, 0x2101, 0x5A84, 0x20FE, 0x5A8A, 0x20FF, 0x5A8B, 0x2102,
+ 0x5A8C, 0x2106, 0x5A8E, 0x1EAB, 0x5A8F, 0x2108, 0x5A90, 0x23B6,
+ 0x5A92, 0x0C26, 0x5A93, 0x2109, 0x5A94, 0x20F1, 0x5A95, 0x20FB,
+ 0x5A97, 0x2100, 0x5A9A, 0x0C24, 0x5A9B, 0x0C27, 0x5A9C, 0x2107,
+ 0x5A9D, 0x210A, 0x5A9E, 0x20F5, 0x5A9F, 0x20F2, 0x5AA2, 0x20F4,
+ 0x5AA5, 0x20F9, 0x5AA6, 0x20F7, 0x5AA7, 0x0C28, 0x5AA9, 0x2103,
+ 0x5AAC, 0x20FA, 0x5AAE, 0x20FC, 0x5AAF, 0x20F0, 0x5AB0, 0x23AA,
+ 0x5AB1, 0x23A8, 0x5AB2, 0x0DFC, 0x5AB3, 0x0DFA, 0x5AB4, 0x23B2,
+ 0x5AB5, 0x23A9, 0x5AB6, 0x23B3, 0x5AB7, 0x23AF, 0x5AB8, 0x23A7,
+ 0x5AB9, 0x23B5, 0x5ABA, 0x23A6, 0x5ABB, 0x23AD, 0x5ABC, 0x0DF9,
+ 0x5ABD, 0x0DF8, 0x5ABE, 0x0DF7, 0x5ABF, 0x23AB, 0x5AC0, 0x23B0,
+ 0x5AC1, 0x0DF4, 0x5AC2, 0x0DFB, 0x5AC4, 0x23A4, 0x5AC6, 0x23AE,
+ 0x5AC7, 0x23A3, 0x5AC8, 0x23AC, 0x5AC9, 0x0DF5, 0x5ACA, 0x23B1,
+ 0x5ACB, 0x23A5, 0x5ACC, 0x0DF6, 0x5ACD, 0x23B4, 0x5AD5, 0x2650,
+ 0x5AD6, 0x0FB4, 0x5AD7, 0x0FB3, 0x5AD8, 0x0FB5, 0x5AD9, 0x265C,
+ 0x5ADA, 0x2652, 0x5ADB, 0x2658, 0x5ADC, 0x264D, 0x5ADD, 0x265B,
+ 0x5ADE, 0x265A, 0x5ADF, 0x265E, 0x5AE0, 0x2657, 0x5AE1, 0x0FB0,
+ 0x5AE2, 0x2656, 0x5AE3, 0x0FB6, 0x5AE5, 0x264F, 0x5AE6, 0x0FB1,
+ 0x5AE8, 0x265D, 0x5AE9, 0x0FB2, 0x5AEA, 0x2651, 0x5AEB, 0x2654,
+ 0x5AEC, 0x2659, 0x5AED, 0x2653, 0x5AEE, 0x264E, 0x5AF3, 0x2655,
+ 0x5AF4, 0x28AB, 0x5AF5, 0x112D, 0x5AF6, 0x28AE, 0x5AF7, 0x28AD,
+ 0x5AF8, 0x28B0, 0x5AF9, 0x28B2, 0x5AFA, 0x36EE, 0x5AFB, 0x112B,
+ 0x5AFD, 0x28AC, 0x5AFF, 0x28AA, 0x5B01, 0x28B3, 0x5B02, 0x28B1,
+ 0x5B03, 0x28AF, 0x5B05, 0x28B5, 0x5B07, 0x28B4, 0x5B08, 0x112F,
+ 0x5B09, 0x112A, 0x5B0B, 0x112C, 0x5B0C, 0x112E, 0x5B0F, 0x28B6,
+ 0x5B10, 0x2B22, 0x5B13, 0x2B21, 0x5B14, 0x2B20, 0x5B16, 0x2B23,
+ 0x5B17, 0x2B1C, 0x5B19, 0x2B1D, 0x5B1A, 0x2B25, 0x5B1B, 0x2B1E,
+ 0x5B1D, 0x12A8, 0x5B1E, 0x2B27, 0x5B20, 0x2B26, 0x5B21, 0x2B1F,
+ 0x5B23, 0x2D52, 0x5B24, 0x13C5, 0x5B25, 0x2D50, 0x5B26, 0x2D55,
+ 0x5B27, 0x2D54, 0x5B28, 0x2B24, 0x5B2A, 0x13C4, 0x5B2C, 0x2D53,
+ 0x5B2D, 0x2D4F, 0x5B2E, 0x2D57, 0x5B2F, 0x2D56, 0x5B30, 0x13C3,
+ 0x5B32, 0x2D51, 0x5B34, 0x12A9, 0x5B38, 0x14CE, 0x5B3C, 0x2F18,
+ 0x5B3D, 0x3089, 0x5B3E, 0x308A, 0x5B3F, 0x308B, 0x5B40, 0x160F,
+ 0x5B43, 0x1610, 0x5B45, 0x31CC, 0x5B47, 0x32CD, 0x5B48, 0x32CC,
+ 0x5B4B, 0x337C, 0x5B4C, 0x337D, 0x5B4D, 0x3413, 0x5B4E, 0x3482,
+ 0x5B50, 0x027F, 0x5B51, 0x0280, 0x5B53, 0x0281, 0x5B54, 0x02C6,
+ 0x5B55, 0x0333, 0x5B56, 0x17DC, 0x5B57, 0x03BF, 0x5B58, 0x03C0,
+ 0x5B5A, 0x047F, 0x5B5B, 0x0480, 0x5B5C, 0x047E, 0x5B5D, 0x047D,
+ 0x5B5F, 0x0597, 0x5B62, 0x1957, 0x5B63, 0x0599, 0x5B64, 0x0598,
+ 0x5B65, 0x1958, 0x5B69, 0x0700, 0x5B6B, 0x0891, 0x5B6C, 0x1C78,
+ 0x5B6E, 0x1EB8, 0x5B70, 0x0A51, 0x5B71, 0x0C2A, 0x5B72, 0x1EB7,
+ 0x5B73, 0x0C29, 0x5B75, 0x0FB7, 0x5B77, 0x265F, 0x5B78, 0x12AA,
+ 0x5B7A, 0x13C6, 0x5B7B, 0x2D58, 0x5B7D, 0x1611, 0x5B7F, 0x16C0,
+ 0x5B80, 0x0225, 0x5B81, 0x179E, 0x5B83, 0x0334, 0x5B84, 0x179F,
+ 0x5B85, 0x03C3, 0x5B87, 0x03C1, 0x5B88, 0x03C2, 0x5B89, 0x03C4,
+ 0x5B8B, 0x0482, 0x5B8C, 0x0481, 0x5B8E, 0x1863, 0x5B8F, 0x0483,
+ 0x5B92, 0x1864, 0x5B93, 0x1959, 0x5B95, 0x195A, 0x5B97, 0x059A,
+ 0x5B98, 0x059C, 0x5B99, 0x059E, 0x5B9A, 0x059B, 0x5B9B, 0x059F,
+ 0x5B9C, 0x059D, 0x5BA2, 0x0704, 0x5BA3, 0x0701, 0x5BA4, 0x0703,
+ 0x5BA5, 0x0705, 0x5BA6, 0x0702, 0x5BA7, 0x1C79, 0x5BA8, 0x1AB3,
+ 0x5BAC, 0x1C7B, 0x5BAD, 0x1C7A, 0x5BAE, 0x0897, 0x5BB0, 0x0893,
+ 0x5BB3, 0x0894, 0x5BB4, 0x0896, 0x5BB5, 0x0898, 0x5BB6, 0x0895,
+ 0x5BB8, 0x089A, 0x5BB9, 0x0899, 0x5BBF, 0x0A56, 0x5BC0, 0x1EBA,
+ 0x5BC1, 0x1EB9, 0x5BC2, 0x0A55, 0x5BC4, 0x0A54, 0x5BC5, 0x0A53,
+ 0x5BC6, 0x0A57, 0x5BC7, 0x0A52, 0x5BCA, 0x2110, 0x5BCB, 0x210D,
+ 0x5BCC, 0x0C2C, 0x5BCD, 0x210C, 0x5BCE, 0x2111, 0x5BD0, 0x0C2E,
+ 0x5BD1, 0x210F, 0x5BD2, 0x0C2B, 0x5BD3, 0x0C2D, 0x5BD4, 0x210E,
+ 0x5BD6, 0x23B7, 0x5BD8, 0x23B8, 0x5BD9, 0x23B9, 0x5BDE, 0x0FB8,
+ 0x5BDF, 0x0FC0, 0x5BE0, 0x2660, 0x5BE1, 0x0FBA, 0x5BE2, 0x0FBE,
+ 0x5BE3, 0x2661, 0x5BE4, 0x0FBF, 0x5BE5, 0x0FBB, 0x5BE6, 0x0FBC,
+ 0x5BE7, 0x0FB9, 0x5BE8, 0x0FBD, 0x5BE9, 0x1132, 0x5BEA, 0x210B,
+ 0x5BEB, 0x1133, 0x5BEC, 0x1131, 0x5BEE, 0x1130, 0x5BEF, 0x2B28,
+ 0x5BF0, 0x12AB, 0x5BF1, 0x2D59, 0x5BF2, 0x2D5A, 0x5BF5, 0x157B,
+ 0x5BF6, 0x1612, 0x5BF8, 0x0282, 0x5BFA, 0x03C5, 0x5C01, 0x0706,
+ 0x5C03, 0x1C7C, 0x5C04, 0x089B, 0x5C07, 0x0A5A, 0x5C08, 0x0A59,
+ 0x5C09, 0x0A58, 0x5C0A, 0x0C2F, 0x5C0B, 0x0C30, 0x5C0C, 0x2112,
+ 0x5C0D, 0x0FC1, 0x5C0E, 0x12AC, 0x5C0F, 0x0283, 0x5C10, 0x1787,
+ 0x5C11, 0x02C7, 0x5C12, 0x17A0, 0x5C15, 0x17DD, 0x5C16, 0x03C6,
+ 0x5C1A, 0x05A0, 0x5C1F, 0x23BA, 0x5C22, 0x0284, 0x5C24, 0x02C8,
+ 0x5C25, 0x17DE, 0x5C28, 0x1865, 0x5C2A, 0x1866, 0x5C2C, 0x0484,
+ 0x5C30, 0x2113, 0x5C31, 0x0C31, 0x5C33, 0x23BB, 0x5C37, 0x13C7,
+ 0x5C38, 0x0285, 0x5C39, 0x0299, 0x5C3A, 0x02C9, 0x5C3B, 0x17A1,
+ 0x5C3C, 0x0335, 0x5C3E, 0x0488, 0x5C3F, 0x0487, 0x5C40, 0x0485,
+ 0x5C41, 0x0486, 0x5C44, 0x195B, 0x5C45, 0x05A2, 0x5C46, 0x05A3,
+ 0x5C47, 0x195C, 0x5C48, 0x05A1, 0x5C4B, 0x070A, 0x5C4C, 0x1AB4,
+ 0x5C4D, 0x0709, 0x5C4E, 0x0707, 0x5C4F, 0x0708, 0x5C50, 0x089E,
+ 0x5C51, 0x089C, 0x5C54, 0x1C7E, 0x5C55, 0x089D, 0x5C56, 0x1C7D,
+ 0x5C58, 0x0892, 0x5C59, 0x1EBB, 0x5C5C, 0x0A5C, 0x5C5D, 0x0A5D,
+ 0x5C60, 0x0A5B, 0x5C62, 0x0FC2, 0x5C63, 0x2662, 0x5C64, 0x1134,
+ 0x5C65, 0x1135, 0x5C67, 0x28B7, 0x5C68, 0x13C8, 0x5C69, 0x2F19,
+ 0x5C6A, 0x2F1A, 0x5C6C, 0x166E, 0x5C6D, 0x3483, 0x5C6E, 0x1776,
+ 0x5C6F, 0x02CA, 0x5C71, 0x0286, 0x5C73, 0x17A3, 0x5C74, 0x17A2,
+ 0x5C79, 0x03C7, 0x5C7A, 0x17E0, 0x5C7B, 0x17E1, 0x5C7C, 0x17DF,
+ 0x5C7E, 0x17E2, 0x5C86, 0x186E, 0x5C88, 0x1869, 0x5C89, 0x186B,
+ 0x5C8A, 0x186D, 0x5C8B, 0x186A, 0x5C8C, 0x048C, 0x5C8D, 0x1867,
+ 0x5C8F, 0x1868, 0x5C90, 0x0489, 0x5C91, 0x048A, 0x5C92, 0x186C,
+ 0x5C93, 0x186F, 0x5C94, 0x048B, 0x5C95, 0x1870, 0x5C9D, 0x196A,
+ 0x5C9F, 0x1964, 0x5CA0, 0x195F, 0x5CA1, 0x05A5, 0x5CA2, 0x1967,
+ 0x5CA3, 0x1965, 0x5CA4, 0x195E, 0x5CA5, 0x196B, 0x5CA6, 0x196E,
+ 0x5CA7, 0x1969, 0x5CA8, 0x1962, 0x5CA9, 0x05A7, 0x5CAA, 0x1968,
+ 0x5CAB, 0x05A8, 0x5CAC, 0x1963, 0x5CAD, 0x1966, 0x5CAE, 0x195D,
+ 0x5CAF, 0x1961, 0x5CB0, 0x196D, 0x5CB1, 0x05A9, 0x5CB3, 0x05AA,
+ 0x5CB5, 0x1960, 0x5CB6, 0x196C, 0x5CB7, 0x05A4, 0x5CB8, 0x05A6,
+ 0x5CC6, 0x1AC5, 0x5CC7, 0x1ABE, 0x5CC8, 0x1AC4, 0x5CC9, 0x1ABD,
+ 0x5CCA, 0x1ABF, 0x5CCB, 0x1AB9, 0x5CCC, 0x1AB7, 0x5CCE, 0x1AC6,
+ 0x5CCF, 0x1AC3, 0x5CD0, 0x1AB5, 0x5CD2, 0x070C, 0x5CD3, 0x1AC1,
+ 0x5CD4, 0x1AC2, 0x5CD6, 0x1AC0, 0x5CD7, 0x1AB8, 0x5CD8, 0x1AB6,
+ 0x5CD9, 0x070B, 0x5CDA, 0x1ABC, 0x5CDB, 0x1ABA, 0x5CDE, 0x1ABB,
+ 0x5CDF, 0x1AC7, 0x5CE8, 0x08A3, 0x5CEA, 0x08A2, 0x5CEC, 0x1C7F,
+ 0x5CED, 0x089F, 0x5CEE, 0x1C81, 0x5CF0, 0x08A4, 0x5CF1, 0x1C82,
+ 0x5CF4, 0x08A7, 0x5CF6, 0x08A5, 0x5CF7, 0x1C83, 0x5CF8, 0x1AC8,
+ 0x5CF9, 0x1C85, 0x5CFB, 0x08A1, 0x5CFD, 0x08A0, 0x5CFF, 0x1C80,
+ 0x5D00, 0x1C84, 0x5D01, 0x08A6, 0x5D06, 0x0A5F, 0x5D07, 0x0A5E,
+ 0x5D0B, 0x1EBD, 0x5D0C, 0x1EC1, 0x5D0D, 0x1EC3, 0x5D0E, 0x0A60,
+ 0x5D0F, 0x1EC6, 0x5D11, 0x0A64, 0x5D12, 0x1EC8, 0x5D14, 0x0A66,
+ 0x5D16, 0x0A62, 0x5D17, 0x0A6A, 0x5D19, 0x0A67, 0x5D1A, 0x1EBF,
+ 0x5D1B, 0x0A61, 0x5D1D, 0x1EBE, 0x5D1E, 0x1EBC, 0x5D1F, 0x1ECA,
+ 0x5D20, 0x1EC0, 0x5D22, 0x0A63, 0x5D23, 0x1EC9, 0x5D24, 0x0A68,
+ 0x5D25, 0x1EC5, 0x5D26, 0x1EC4, 0x5D27, 0x0A69, 0x5D28, 0x1EC2,
+ 0x5D29, 0x0A65, 0x5D2E, 0x1ECB, 0x5D30, 0x1EC7, 0x5D31, 0x2122,
+ 0x5D32, 0x2129, 0x5D33, 0x211E, 0x5D34, 0x0C34, 0x5D35, 0x211A,
+ 0x5D36, 0x212A, 0x5D37, 0x2114, 0x5D38, 0x2127, 0x5D39, 0x2125,
+ 0x5D3A, 0x211F, 0x5D3C, 0x2128, 0x5D3D, 0x2121, 0x5D3F, 0x2119,
+ 0x5D40, 0x212B, 0x5D41, 0x2117, 0x5D42, 0x2124, 0x5D43, 0x2115,
+ 0x5D45, 0x212C, 0x5D47, 0x0C35, 0x5D49, 0x2126, 0x5D4A, 0x23BE,
+ 0x5D4B, 0x2118, 0x5D4C, 0x0C32, 0x5D4E, 0x211C, 0x5D50, 0x0C33,
+ 0x5D51, 0x211B, 0x5D52, 0x2120, 0x5D55, 0x211D, 0x5D59, 0x2123,
+ 0x5D5E, 0x23C2, 0x5D62, 0x23C5, 0x5D63, 0x23BD, 0x5D65, 0x23BF,
+ 0x5D67, 0x23C4, 0x5D68, 0x23C3, 0x5D69, 0x0DFD, 0x5D6B, 0x2116,
+ 0x5D6C, 0x23C1, 0x5D6F, 0x0DFE, 0x5D71, 0x23BC, 0x5D72, 0x23C0,
+ 0x5D77, 0x2669, 0x5D79, 0x2670, 0x5D7A, 0x2667, 0x5D7C, 0x266E,
+ 0x5D7D, 0x2665, 0x5D7E, 0x266D, 0x5D7F, 0x2671, 0x5D80, 0x2664,
+ 0x5D81, 0x2668, 0x5D82, 0x2663, 0x5D84, 0x0FC3, 0x5D86, 0x2666,
+ 0x5D87, 0x0FC4, 0x5D88, 0x266C, 0x5D89, 0x266B, 0x5D8A, 0x266A,
+ 0x5D8D, 0x266F, 0x5D92, 0x28BB, 0x5D93, 0x28BD, 0x5D94, 0x1137,
+ 0x5D95, 0x28BE, 0x5D97, 0x28B9, 0x5D99, 0x28B8, 0x5D9A, 0x28C2,
+ 0x5D9C, 0x28C0, 0x5D9D, 0x1136, 0x5D9E, 0x28C3, 0x5D9F, 0x28BA,
+ 0x5DA0, 0x28BF, 0x5DA1, 0x28C1, 0x5DA2, 0x28BC, 0x5DA7, 0x2B2C,
+ 0x5DA8, 0x2B31, 0x5DA9, 0x2B2B, 0x5DAA, 0x2B30, 0x5DAC, 0x2B29,
+ 0x5DAD, 0x2B33, 0x5DAE, 0x2B2F, 0x5DAF, 0x2B34, 0x5DB0, 0x2B2E,
+ 0x5DB1, 0x2B2A, 0x5DB2, 0x2B32, 0x5DB4, 0x2B35, 0x5DB5, 0x2B2D,
+ 0x5DB7, 0x2D5B, 0x5DB8, 0x13CC, 0x5DBA, 0x13CA, 0x5DBC, 0x13C9,
+ 0x5DBD, 0x13CB, 0x5DC0, 0x2F1B, 0x5DC2, 0x3023, 0x5DC3, 0x308C,
+ 0x5DC6, 0x31CD, 0x5DC7, 0x31CE, 0x5DC9, 0x1613, 0x5DCB, 0x32CE,
+ 0x5DCD, 0x166F, 0x5DCF, 0x32CF, 0x5DD1, 0x337F, 0x5DD2, 0x16C2,
+ 0x5DD4, 0x16C1, 0x5DD5, 0x337E, 0x5DD6, 0x16F7, 0x5DD8, 0x3414,
+ 0x5DDB, 0x0226, 0x5DDD, 0x0287, 0x5DDE, 0x03C8, 0x5DDF, 0x17E3,
+ 0x5DE0, 0x1871, 0x5DE1, 0x051A, 0x5DE2, 0x0A6B, 0x5DE5, 0x0288,
+ 0x5DE6, 0x0338, 0x5DE7, 0x0337, 0x5DE8, 0x0336, 0x5DEB, 0x048D,
+ 0x5DEE, 0x08A8, 0x5DF0, 0x23C6, 0x5DF1, 0x0289, 0x5DF2, 0x028A,
+ 0x5DF3, 0x028B, 0x5DF4, 0x02CB, 0x5DF7, 0x070D, 0x5DF9, 0x1AC9,
+ 0x5DFD, 0x0C36, 0x5DFE, 0x028C, 0x5DFF, 0x1788, 0x5E02, 0x0339,
+ 0x5E03, 0x033A, 0x5E04, 0x17A4, 0x5E06, 0x03C9, 0x5E0A, 0x1872,
+ 0x5E0C, 0x048E, 0x5E0E, 0x1873, 0x5E11, 0x05B0, 0x5E14, 0x1970,
+ 0x5E15, 0x05AE, 0x5E16, 0x05AD, 0x5E17, 0x196F, 0x5E18, 0x05AB,
+ 0x5E19, 0x1971, 0x5E1A, 0x05AC, 0x5E1B, 0x05AF, 0x5E1D, 0x070E,
+ 0x5E1F, 0x0710, 0x5E20, 0x1ACD, 0x5E21, 0x1ACA, 0x5E22, 0x1ACB,
+ 0x5E23, 0x1ACC, 0x5E24, 0x1ACE, 0x5E25, 0x070F, 0x5E28, 0x1C87,
+ 0x5E29, 0x1C86, 0x5E2B, 0x08AA, 0x5E2D, 0x08A9, 0x5E33, 0x0A6E,
+ 0x5E34, 0x1ECD, 0x5E36, 0x0A6D, 0x5E37, 0x0A6F, 0x5E38, 0x0A6C,
+ 0x5E3D, 0x0C38, 0x5E3E, 0x1ECC, 0x5E40, 0x0C39, 0x5E41, 0x212E,
+ 0x5E43, 0x0C3A, 0x5E44, 0x212D, 0x5E45, 0x0C37, 0x5E4A, 0x23C9,
+ 0x5E4B, 0x23CB, 0x5E4C, 0x0DFF, 0x5E4D, 0x23CA, 0x5E4E, 0x23C8,
+ 0x5E4F, 0x23C7, 0x5E53, 0x2674, 0x5E54, 0x0FC9, 0x5E55, 0x0FC7,
+ 0x5E57, 0x0FC8, 0x5E58, 0x2672, 0x5E59, 0x2673, 0x5E5B, 0x0FC5,
+ 0x5E5C, 0x28C7, 0x5E5D, 0x28C5, 0x5E5F, 0x1139, 0x5E60, 0x28C6,
+ 0x5E61, 0x113A, 0x5E62, 0x1138, 0x5E63, 0x0FC6, 0x5E66, 0x2B38,
+ 0x5E67, 0x2B36, 0x5E68, 0x2B37, 0x5E69, 0x28C4, 0x5E6A, 0x2D5D,
+ 0x5E6B, 0x13CD, 0x5E6C, 0x2D5C, 0x5E6D, 0x2F1C, 0x5E6E, 0x2F1D,
+ 0x5E6F, 0x2B39, 0x5E70, 0x308D, 0x5E72, 0x028D, 0x5E73, 0x033B,
+ 0x5E74, 0x03CB, 0x5E75, 0x17E4, 0x5E76, 0x03CA, 0x5E78, 0x05B1,
+ 0x5E79, 0x0E00, 0x5E7A, 0x0227, 0x5E7B, 0x02CC, 0x5E7C, 0x033C,
+ 0x5E7D, 0x0711, 0x5E7E, 0x0C3B, 0x5E7F, 0x0228, 0x5E80, 0x17A5,
+ 0x5E82, 0x17A6, 0x5E84, 0x17E5, 0x5E87, 0x0490, 0x5E88, 0x1877,
+ 0x5E89, 0x1875, 0x5E8A, 0x0491, 0x5E8B, 0x1874, 0x5E8C, 0x1876,
+ 0x5E8D, 0x1878, 0x5E8F, 0x048F, 0x5E95, 0x05B5, 0x5E96, 0x05B6,
+ 0x5E97, 0x05B3, 0x5E9A, 0x05B2, 0x5E9B, 0x1AD2, 0x5E9C, 0x05B4,
+ 0x5EA0, 0x0712, 0x5EA2, 0x1AD1, 0x5EA3, 0x1AD3, 0x5EA4, 0x1AD0,
+ 0x5EA5, 0x1AD4, 0x5EA6, 0x0713, 0x5EA7, 0x08AD, 0x5EA8, 0x1C88,
+ 0x5EAA, 0x1C8A, 0x5EAB, 0x08AB, 0x5EAC, 0x1C8B, 0x5EAD, 0x08AC,
+ 0x5EAE, 0x1C89, 0x5EB0, 0x1ACF, 0x5EB1, 0x1ECE, 0x5EB2, 0x1ED1,
+ 0x5EB3, 0x1ED2, 0x5EB4, 0x1ECF, 0x5EB5, 0x0A73, 0x5EB6, 0x0A72,
+ 0x5EB7, 0x0A70, 0x5EB8, 0x0A71, 0x5EB9, 0x1ED0, 0x5EBE, 0x0A74,
+ 0x5EC1, 0x0C3D, 0x5EC2, 0x0C3E, 0x5EC4, 0x0C3F, 0x5EC5, 0x23CC,
+ 0x5EC6, 0x23CE, 0x5EC7, 0x23D0, 0x5EC8, 0x0E02, 0x5EC9, 0x0E01,
+ 0x5ECA, 0x0C3C, 0x5ECB, 0x23CF, 0x5ECC, 0x23CD, 0x5ECE, 0x2678,
+ 0x5ED1, 0x2676, 0x5ED2, 0x267C, 0x5ED3, 0x0FCA, 0x5ED4, 0x267D,
+ 0x5ED5, 0x267A, 0x5ED6, 0x0FCB, 0x5ED7, 0x2677, 0x5ED8, 0x2675,
+ 0x5ED9, 0x267B, 0x5EDA, 0x113C, 0x5EDB, 0x28C9, 0x5EDC, 0x2679,
+ 0x5EDD, 0x113E, 0x5EDE, 0x28CA, 0x5EDF, 0x113D, 0x5EE0, 0x1140,
+ 0x5EE1, 0x28CB, 0x5EE2, 0x113B, 0x5EE3, 0x113F, 0x5EE5, 0x2B3E,
+ 0x5EE6, 0x2B3C, 0x5EE7, 0x2B3B, 0x5EE8, 0x2B3D, 0x5EE9, 0x2B3A,
+ 0x5EEC, 0x157D, 0x5EEE, 0x31CF, 0x5EEF, 0x31D0, 0x5EF1, 0x32D0,
+ 0x5EF2, 0x3380, 0x5EF3, 0x1742, 0x5EF4, 0x0229, 0x5EF6, 0x05B7,
+ 0x5EF7, 0x0492, 0x5EFA, 0x0714, 0x5EFE, 0x028E, 0x5EFF, 0x02CD,
+ 0x5F01, 0x033D, 0x5F02, 0x17E6, 0x5F04, 0x0493, 0x5F05, 0x1879,
+ 0x5F07, 0x1AD5, 0x5F08, 0x0715, 0x5F0A, 0x0FCC, 0x5F0B, 0x028F,
+ 0x5F0F, 0x03CC, 0x5F12, 0x0E03, 0x5F13, 0x0290, 0x5F14, 0x02CE,
+ 0x5F15, 0x02CF, 0x5F17, 0x033F, 0x5F18, 0x033E, 0x5F1A, 0x17E7,
+ 0x5F1B, 0x03CD, 0x5F1D, 0x187A, 0x5F1F, 0x0494, 0x5F22, 0x1973,
+ 0x5F23, 0x1974, 0x5F24, 0x1975, 0x5F26, 0x05B8, 0x5F27, 0x05B9,
+ 0x5F28, 0x1972, 0x5F29, 0x05BA, 0x5F2D, 0x0716, 0x5F2E, 0x1AD6,
+ 0x5F30, 0x1C8D, 0x5F31, 0x08AE, 0x5F33, 0x1C8C, 0x5F35, 0x0A75,
+ 0x5F36, 0x1ED3, 0x5F37, 0x0A76, 0x5F38, 0x1ED4, 0x5F3C, 0x0C40,
+ 0x5F40, 0x23D1, 0x5F43, 0x267F, 0x5F44, 0x267E, 0x5F46, 0x0FCD,
+ 0x5F48, 0x1141, 0x5F49, 0x28CC, 0x5F4A, 0x12AD, 0x5F4B, 0x2B3F,
+ 0x5F4C, 0x13CE, 0x5F4E, 0x16C3, 0x5F4F, 0x3416, 0x5F50, 0x022A,
+ 0x5F54, 0x1976, 0x5F56, 0x1AD7, 0x5F57, 0x0A77, 0x5F58, 0x212F,
+ 0x5F59, 0x0E04, 0x5F5D, 0x14CF, 0x5F61, 0x022B, 0x5F62, 0x0496,
+ 0x5F64, 0x0495, 0x5F65, 0x0717, 0x5F67, 0x1C8E, 0x5F69, 0x0A79,
+ 0x5F6A, 0x0B89, 0x5F6B, 0x0A7A, 0x5F6C, 0x0A78, 0x5F6D, 0x0C41,
+ 0x5F6F, 0x2680, 0x5F70, 0x0FCE, 0x5F71, 0x1142, 0x5F73, 0x1777,
+ 0x5F74, 0x17E8, 0x5F76, 0x187C, 0x5F77, 0x0497, 0x5F78, 0x187B,
+ 0x5F79, 0x0498, 0x5F7C, 0x05BE, 0x5F7D, 0x1979, 0x5F7E, 0x1978,
+ 0x5F7F, 0x05BD, 0x5F80, 0x05BB, 0x5F81, 0x05BC, 0x5F82, 0x1977,
+ 0x5F85, 0x0719, 0x5F86, 0x1AD8, 0x5F87, 0x071C, 0x5F88, 0x0718,
+ 0x5F89, 0x071E, 0x5F8A, 0x071A, 0x5F8B, 0x071B, 0x5F8C, 0x071D,
+ 0x5F90, 0x08B1, 0x5F91, 0x08B0, 0x5F92, 0x08AF, 0x5F96, 0x1ED6,
+ 0x5F97, 0x0A7B, 0x5F98, 0x0A7E, 0x5F99, 0x0A7C, 0x5F9B, 0x1ED5,
+ 0x5F9C, 0x0A81, 0x5F9E, 0x0A7D, 0x5F9F, 0x1ED7, 0x5FA0, 0x0A80,
+ 0x5FA1, 0x0A7F, 0x5FA5, 0x2131, 0x5FA6, 0x2130, 0x5FA8, 0x0C44,
+ 0x5FA9, 0x0C42, 0x5FAA, 0x0C43, 0x5FAB, 0x2132, 0x5FAC, 0x0E05,
+ 0x5FAD, 0x23D3, 0x5FAE, 0x0E06, 0x5FAF, 0x23D2, 0x5FB2, 0x28CD,
+ 0x5FB5, 0x1144, 0x5FB6, 0x2681, 0x5FB7, 0x1143, 0x5FB9, 0x0FCF,
+ 0x5FBB, 0x2B41, 0x5FBC, 0x2B40, 0x5FBD, 0x13CF, 0x5FBE, 0x2D5E,
+ 0x5FBF, 0x308E, 0x5FC0, 0x31D1, 0x5FC1, 0x31D2, 0x5FC3, 0x02D0,
+ 0x5FC5, 0x0340, 0x5FC9, 0x17A7, 0x5FCC, 0x049A, 0x5FCD, 0x049C,
+ 0x5FCF, 0x17EB, 0x5FD0, 0x187F, 0x5FD1, 0x187E, 0x5FD2, 0x187D,
+ 0x5FD4, 0x17EA, 0x5FD5, 0x17E9, 0x5FD6, 0x03CF, 0x5FD7, 0x049B,
+ 0x5FD8, 0x0499, 0x5FD9, 0x03CE, 0x5FDD, 0x05BF, 0x5FDE, 0x197A,
+ 0x5FE0, 0x05C0, 0x5FE1, 0x1884, 0x5FE3, 0x1886, 0x5FE4, 0x1885,
+ 0x5FE5, 0x197B, 0x5FE8, 0x1881, 0x5FEA, 0x04A0, 0x5FEB, 0x049E,
+ 0x5FED, 0x1880, 0x5FEE, 0x1882, 0x5FEF, 0x1888, 0x5FF1, 0x049D,
+ 0x5FF3, 0x1883, 0x5FF4, 0x188C, 0x5FF5, 0x05C2, 0x5FF7, 0x1889,
+ 0x5FF8, 0x049F, 0x5FFA, 0x1887, 0x5FFB, 0x188A, 0x5FFD, 0x05C1,
+ 0x5FFF, 0x05C3, 0x6000, 0x188B, 0x6009, 0x198F, 0x600A, 0x1982,
+ 0x600B, 0x1980, 0x600C, 0x198E, 0x600D, 0x1989, 0x600E, 0x0723,
+ 0x600F, 0x05C4, 0x6010, 0x198A, 0x6011, 0x198D, 0x6012, 0x071F,
+ 0x6013, 0x198C, 0x6014, 0x05C5, 0x6015, 0x05CA, 0x6016, 0x05C8,
+ 0x6017, 0x1983, 0x6019, 0x197E, 0x601A, 0x1985, 0x601B, 0x05CF,
+ 0x601C, 0x1990, 0x601D, 0x0720, 0x601E, 0x1986, 0x6020, 0x0721,
+ 0x6021, 0x05CB, 0x6022, 0x1988, 0x6024, 0x1AE7, 0x6025, 0x0722,
+ 0x6026, 0x197D, 0x6027, 0x05CC, 0x6028, 0x0724, 0x6029, 0x05CD,
+ 0x602A, 0x05C9, 0x602B, 0x05CE, 0x602C, 0x1987, 0x602D, 0x197C,
+ 0x602E, 0x198B, 0x602F, 0x05C6, 0x6032, 0x197F, 0x6033, 0x1984,
+ 0x6034, 0x1981, 0x6035, 0x05C7, 0x6037, 0x1AD9, 0x6039, 0x1ADA,
+ 0x6040, 0x1AE4, 0x6041, 0x1C92, 0x6042, 0x1AE5, 0x6043, 0x072A,
+ 0x6044, 0x1AE8, 0x6045, 0x1ADE, 0x6046, 0x0729, 0x6047, 0x1AE0,
+ 0x6049, 0x1AE1, 0x604C, 0x1AE3, 0x604D, 0x0725, 0x6050, 0x08B5,
+ 0x6052, 0x36EC, 0x6053, 0x1ADF, 0x6054, 0x1ADB, 0x6055, 0x08B6,
+ 0x6058, 0x1AE9, 0x6059, 0x08B2, 0x605A, 0x1C90, 0x605B, 0x1AE2,
+ 0x605D, 0x1C8F, 0x605E, 0x1ADD, 0x605F, 0x1AE6, 0x6062, 0x0728,
+ 0x6063, 0x08B3, 0x6064, 0x072E, 0x6065, 0x08B4, 0x6066, 0x1AEA,
+ 0x6067, 0x1C91, 0x6068, 0x0727, 0x6069, 0x08B8, 0x606A, 0x072D,
+ 0x606B, 0x072C, 0x606C, 0x072B, 0x606D, 0x08B7, 0x606E, 0x1AEB,
+ 0x606F, 0x08B9, 0x6070, 0x0726, 0x6072, 0x1ADC, 0x607F, 0x0A82,
+ 0x6080, 0x1C95, 0x6081, 0x1C97, 0x6083, 0x1C99, 0x6084, 0x08BA,
+ 0x6085, 0x08C0, 0x6086, 0x1EDA, 0x6087, 0x1C9D, 0x6088, 0x1C94,
+ 0x6089, 0x0A84, 0x608A, 0x1ED8, 0x608C, 0x08BF, 0x608D, 0x08BD,
+ 0x608E, 0x1C9F, 0x6090, 0x1ED9, 0x6092, 0x1C96, 0x6094, 0x08BE,
+ 0x6095, 0x1C9A, 0x6096, 0x08C1, 0x6097, 0x1C9C, 0x609A, 0x08BC,
+ 0x609B, 0x1C9B, 0x609C, 0x1C9E, 0x609D, 0x1C98, 0x609F, 0x08BB,
+ 0x60A0, 0x0A85, 0x60A2, 0x1C93, 0x60A3, 0x0A83, 0x60A8, 0x0A86,
+ 0x60B0, 0x1EDC, 0x60B1, 0x1EE5, 0x60B2, 0x0C47, 0x60B4, 0x0A88,
+ 0x60B5, 0x0A8D, 0x60B6, 0x0C48, 0x60B7, 0x1EE7, 0x60B8, 0x0A94,
+ 0x60B9, 0x2134, 0x60BA, 0x1EDD, 0x60BB, 0x0A8C, 0x60BC, 0x0A8F,
+ 0x60BD, 0x0A8A, 0x60BE, 0x1EDB, 0x60BF, 0x1EE9, 0x60C0, 0x1EEC,
+ 0x60C1, 0x2143, 0x60C3, 0x1EEA, 0x60C4, 0x2138, 0x60C5, 0x0A8B,
+ 0x60C6, 0x0A92, 0x60C7, 0x0A96, 0x60C8, 0x1EE4, 0x60C9, 0x2133,
+ 0x60CA, 0x1EE8, 0x60CB, 0x0A87, 0x60CC, 0x2135, 0x60CD, 0x1EEB,
+ 0x60CE, 0x2137, 0x60CF, 0x1EE0, 0x60D1, 0x0C45, 0x60D3, 0x1EDE,
+ 0x60D4, 0x1EDF, 0x60D5, 0x0A91, 0x60D8, 0x0A90, 0x60D9, 0x1EE2,
+ 0x60DA, 0x0A95, 0x60DB, 0x1EE6, 0x60DC, 0x0A8E, 0x60DD, 0x1EE3,
+ 0x60DF, 0x0A93, 0x60E0, 0x0C49, 0x60E1, 0x0C46, 0x60E2, 0x2136,
+ 0x60E4, 0x1EE1, 0x60E6, 0x0A89, 0x60F0, 0x0C4E, 0x60F1, 0x0C52,
+ 0x60F2, 0x213A, 0x60F3, 0x0E0B, 0x60F4, 0x0C50, 0x60F5, 0x213E,
+ 0x60F6, 0x0C54, 0x60F7, 0x23D4, 0x60F8, 0x2140, 0x60F9, 0x0E0D,
+ 0x60FA, 0x0C4C, 0x60FB, 0x0C4F, 0x60FC, 0x2141, 0x60FE, 0x2142,
+ 0x60FF, 0x2148, 0x6100, 0x0C56, 0x6101, 0x0E0E, 0x6103, 0x2144,
+ 0x6104, 0x2149, 0x6105, 0x213D, 0x6106, 0x0E18, 0x6108, 0x0E0F,
+ 0x6109, 0x0C55, 0x610A, 0x213B, 0x610B, 0x214A, 0x610D, 0x0E17,
+ 0x610E, 0x0C53, 0x610F, 0x0E08, 0x6110, 0x2147, 0x6112, 0x0C57,
+ 0x6113, 0x213F, 0x6114, 0x2139, 0x6115, 0x0C4D, 0x6116, 0x213C,
+ 0x6118, 0x2145, 0x611A, 0x0E07, 0x611B, 0x0E0C, 0x611C, 0x0C4A,
+ 0x611D, 0x2146, 0x611F, 0x0E0A, 0x6123, 0x0C4B, 0x6127, 0x0E16,
+ 0x6128, 0x2683, 0x6129, 0x23DF, 0x612B, 0x23D7, 0x612C, 0x2682,
+ 0x612E, 0x23DB, 0x612F, 0x23DD, 0x6132, 0x23DA, 0x6134, 0x0E15,
+ 0x6136, 0x23D9, 0x6137, 0x0E19, 0x613B, 0x2692, 0x613E, 0x0E14,
+ 0x613F, 0x0FD1, 0x6140, 0x23E0, 0x6141, 0x2684, 0x6144, 0x0E12,
+ 0x6145, 0x23D8, 0x6146, 0x23DC, 0x6147, 0x0FD0, 0x6148, 0x0E09,
+ 0x6149, 0x23D5, 0x614A, 0x23D6, 0x614B, 0x0FD2, 0x614C, 0x0E11,
+ 0x614D, 0x0E13, 0x614E, 0x0E10, 0x614F, 0x23DE, 0x6152, 0x2688,
+ 0x6153, 0x2689, 0x6154, 0x268E, 0x6155, 0x1149, 0x6156, 0x2695,
+ 0x6158, 0x0FD8, 0x615A, 0x0FD7, 0x615B, 0x2690, 0x615D, 0x1148,
+ 0x615E, 0x2685, 0x615F, 0x0FD6, 0x6161, 0x2694, 0x6162, 0x0FD4,
+ 0x6163, 0x0FD5, 0x6165, 0x2691, 0x6166, 0x28DE, 0x6167, 0x1146,
+ 0x6168, 0x0C51, 0x616A, 0x2693, 0x616B, 0x114D, 0x616C, 0x268B,
+ 0x616E, 0x1147, 0x6170, 0x114C, 0x6171, 0x2686, 0x6172, 0x268A,
+ 0x6173, 0x2687, 0x6174, 0x268D, 0x6175, 0x0FD9, 0x6176, 0x1145,
+ 0x6177, 0x0FD3, 0x6179, 0x28D0, 0x617A, 0x268F, 0x617C, 0x114B,
+ 0x617E, 0x114E, 0x6180, 0x268C, 0x6182, 0x114A, 0x6183, 0x28CF,
+ 0x6189, 0x28D4, 0x618A, 0x12B1, 0x618B, 0x28CE, 0x618C, 0x2B4D,
+ 0x618D, 0x28DD, 0x618E, 0x1152, 0x6190, 0x1150, 0x6191, 0x12AF,
+ 0x6192, 0x28DA, 0x6193, 0x28D6, 0x6194, 0x1156, 0x6196, 0x2B44,
+ 0x619A, 0x1154, 0x619B, 0x28D5, 0x619D, 0x2B42, 0x619F, 0x28D9,
+ 0x61A1, 0x28DC, 0x61A2, 0x28D3, 0x61A4, 0x1155, 0x61A7, 0x114F,
+ 0x61A8, 0x2B43, 0x61A9, 0x12B0, 0x61AA, 0x28DB, 0x61AB, 0x1151,
+ 0x61AC, 0x1153, 0x61AD, 0x28D8, 0x61AE, 0x1157, 0x61AF, 0x28D7,
+ 0x61B0, 0x28D2, 0x61B1, 0x28D1, 0x61B2, 0x12AE, 0x61B3, 0x28DF,
+ 0x61B4, 0x2B46, 0x61B5, 0x2D60, 0x61B6, 0x12B3, 0x61B8, 0x2B4C,
+ 0x61BA, 0x2B4A, 0x61BC, 0x2D61, 0x61BE, 0x12B4, 0x61BF, 0x2B4B,
+ 0x61C1, 0x2B48, 0x61C2, 0x13D1, 0x61C3, 0x2D5F, 0x61C5, 0x2B45,
+ 0x61C6, 0x2B47, 0x61C7, 0x13D2, 0x61C8, 0x12B6, 0x61C9, 0x13D0,
+ 0x61CA, 0x12B5, 0x61CB, 0x13D4, 0x61CC, 0x2B49, 0x61CD, 0x12B2,
+ 0x61D6, 0x2F26, 0x61D8, 0x2F1E, 0x61DE, 0x2D67, 0x61DF, 0x2F1F,
+ 0x61E0, 0x2D63, 0x61E3, 0x14D0, 0x61E4, 0x2D65, 0x61E5, 0x2D64,
+ 0x61E6, 0x13D3, 0x61E7, 0x2D62, 0x61E8, 0x2D66, 0x61E9, 0x2F27,
+ 0x61EA, 0x2F23, 0x61EB, 0x2F25, 0x61ED, 0x2F20, 0x61EE, 0x2F21,
+ 0x61F0, 0x2F24, 0x61F1, 0x2F22, 0x61F2, 0x157E, 0x61F5, 0x1581,
+ 0x61F6, 0x1580, 0x61F7, 0x157F, 0x61F8, 0x1614, 0x61F9, 0x31D3,
+ 0x61FA, 0x1615, 0x61FB, 0x308F, 0x61FC, 0x1670, 0x61FD, 0x32D1,
+ 0x61FE, 0x1671, 0x61FF, 0x16C4, 0x6200, 0x16F8, 0x6201, 0x3417,
+ 0x6203, 0x3418, 0x6204, 0x3419, 0x6207, 0x3533, 0x6208, 0x02D1,
+ 0x6209, 0x17A8, 0x620A, 0x0341, 0x620C, 0x03D1, 0x620D, 0x03D2,
+ 0x620E, 0x03D0, 0x6210, 0x03D3, 0x6211, 0x04A2, 0x6212, 0x04A1,
+ 0x6214, 0x1991, 0x6215, 0x05D1, 0x6216, 0x05D0, 0x6219, 0x1CA0,
+ 0x621A, 0x0A97, 0x621B, 0x0A98, 0x621F, 0x0C58, 0x6220, 0x23E1,
+ 0x6221, 0x0E1A, 0x6222, 0x0E1B, 0x6223, 0x23E3, 0x6224, 0x23E5,
+ 0x6225, 0x23E4, 0x6227, 0x2697, 0x6229, 0x2696, 0x622A, 0x0FDA,
+ 0x622B, 0x2698, 0x622D, 0x28E0, 0x622E, 0x1158, 0x6230, 0x12B7,
+ 0x6232, 0x13D5, 0x6233, 0x14D1, 0x6234, 0x13D6, 0x6236, 0x02D2,
+ 0x623A, 0x188D, 0x623D, 0x1992, 0x623E, 0x05D3, 0x623F, 0x05D2,
+ 0x6240, 0x05D4, 0x6241, 0x072F, 0x6242, 0x1AEC, 0x6243, 0x1AED,
+ 0x6246, 0x1CA1, 0x6247, 0x08C2, 0x6248, 0x0A99, 0x6249, 0x0C59,
+ 0x624A, 0x214B, 0x624B, 0x02D3, 0x624D, 0x0291, 0x624E, 0x02D4,
+ 0x6250, 0x17A9, 0x6251, 0x0345, 0x6252, 0x0344, 0x6253, 0x0342,
+ 0x6254, 0x0343, 0x6258, 0x03D6, 0x6259, 0x17F2, 0x625A, 0x17F4,
+ 0x625B, 0x03D5, 0x625C, 0x17EC, 0x625E, 0x17ED, 0x6260, 0x17F3,
+ 0x6261, 0x17EF, 0x6262, 0x17F1, 0x6263, 0x03D4, 0x6264, 0x17EE,
+ 0x6265, 0x17F5, 0x6266, 0x17F0, 0x626D, 0x04A9, 0x626E, 0x04B2,
+ 0x626F, 0x04B0, 0x6270, 0x1897, 0x6271, 0x1894, 0x6272, 0x189C,
+ 0x6273, 0x04AE, 0x6274, 0x189D, 0x6276, 0x04A7, 0x6277, 0x189A,
+ 0x6279, 0x04AD, 0x627A, 0x1896, 0x627B, 0x1895, 0x627C, 0x04AB,
+ 0x627D, 0x189B, 0x627E, 0x04AC, 0x627F, 0x05D5, 0x6280, 0x04A6,
+ 0x6281, 0x1898, 0x6283, 0x188E, 0x6284, 0x04A3, 0x6286, 0x04B6,
+ 0x6287, 0x1893, 0x6288, 0x1899, 0x6289, 0x04A8, 0x628A, 0x04AA,
+ 0x628C, 0x188F, 0x628E, 0x1890, 0x628F, 0x1891, 0x6291, 0x04B5,
+ 0x6292, 0x04AF, 0x6293, 0x04B4, 0x6294, 0x1892, 0x6295, 0x04B3,
+ 0x6296, 0x04A5, 0x6297, 0x04A4, 0x6298, 0x04B1, 0x62A8, 0x05E3,
+ 0x62A9, 0x199E, 0x62AA, 0x1997, 0x62AB, 0x05DE, 0x62AC, 0x05F1,
+ 0x62AD, 0x1993, 0x62AE, 0x199A, 0x62AF, 0x199C, 0x62B0, 0x199F,
+ 0x62B1, 0x05EC, 0x62B3, 0x199B, 0x62B4, 0x1994, 0x62B5, 0x05EA,
+ 0x62B6, 0x1998, 0x62B8, 0x19A0, 0x62B9, 0x05DB, 0x62BB, 0x199D,
+ 0x62BC, 0x05E5, 0x62BD, 0x05E4, 0x62BE, 0x1996, 0x62BF, 0x05D9,
+ 0x62C2, 0x05DA, 0x62C4, 0x05D8, 0x62C6, 0x05F0, 0x62C7, 0x05E8,
+ 0x62C8, 0x05E2, 0x62C9, 0x05D6, 0x62CA, 0x1999, 0x62CB, 0x05E1,
+ 0x62CC, 0x05D7, 0x62CD, 0x05E9, 0x62CE, 0x05F2, 0x62CF, 0x1AEE,
+ 0x62D0, 0x05E6, 0x62D1, 0x1995, 0x62D2, 0x05DC, 0x62D3, 0x05DF,
+ 0x62D4, 0x05E0, 0x62D6, 0x05EE, 0x62D7, 0x05EF, 0x62D8, 0x05ED,
+ 0x62D9, 0x05E7, 0x62DA, 0x05EB, 0x62DB, 0x05DD, 0x62DC, 0x0730,
+ 0x62EB, 0x1AF4, 0x62EC, 0x073C, 0x62ED, 0x0734, 0x62EE, 0x0736,
+ 0x62EF, 0x073B, 0x62F0, 0x1B00, 0x62F1, 0x0739, 0x62F2, 0x1CA2,
+ 0x62F3, 0x08C3, 0x62F4, 0x073E, 0x62F5, 0x1AF1, 0x62F6, 0x1AF9,
+ 0x62F7, 0x073A, 0x62F8, 0x1AF8, 0x62F9, 0x1AF5, 0x62FA, 0x1AFD,
+ 0x62FB, 0x1AFF, 0x62FC, 0x0733, 0x62FD, 0x0737, 0x62FE, 0x073D,
+ 0x62FF, 0x08C5, 0x6300, 0x1AFA, 0x6301, 0x0735, 0x6302, 0x0740,
+ 0x6303, 0x1AF3, 0x6307, 0x0738, 0x6308, 0x08C4, 0x6309, 0x0732,
+ 0x630B, 0x1AF0, 0x630C, 0x1AF7, 0x630D, 0x1AEF, 0x630E, 0x1AF2,
+ 0x630F, 0x1AF6, 0x6310, 0x1CA3, 0x6311, 0x073F, 0x6313, 0x1AFB,
+ 0x6314, 0x1AFC, 0x6315, 0x1AFE, 0x6316, 0x0731, 0x6328, 0x08D3,
+ 0x6329, 0x1CAF, 0x632A, 0x08D1, 0x632B, 0x08D2, 0x632C, 0x1CA5,
+ 0x632D, 0x1CB5, 0x632F, 0x08C8, 0x6332, 0x1EED, 0x6333, 0x1CB7,
+ 0x6334, 0x1CB1, 0x6336, 0x1CA8, 0x6338, 0x1CBA, 0x6339, 0x1CAB,
+ 0x633A, 0x08CE, 0x633B, 0x1F04, 0x633C, 0x1CAE, 0x633D, 0x08D0,
+ 0x633E, 0x08C7, 0x6340, 0x1CBC, 0x6341, 0x1CB0, 0x6342, 0x08CA,
+ 0x6343, 0x1CA9, 0x6344, 0x1CA6, 0x6345, 0x1CA7, 0x6346, 0x08CB,
+ 0x6347, 0x1CB6, 0x6348, 0x1CBD, 0x6349, 0x08CD, 0x634A, 0x1CAD,
+ 0x634B, 0x1CAC, 0x634C, 0x08D5, 0x634D, 0x08D4, 0x634E, 0x08C6,
+ 0x634F, 0x08CC, 0x6350, 0x08CF, 0x6351, 0x1CB9, 0x6354, 0x1CB3,
+ 0x6355, 0x08C9, 0x6356, 0x1CA4, 0x6357, 0x1CBB, 0x6358, 0x1CB2,
+ 0x6359, 0x1CB4, 0x635A, 0x1CB8, 0x6365, 0x1EEE, 0x6367, 0x0AA1,
+ 0x6368, 0x0AB5, 0x6369, 0x0AB4, 0x636B, 0x0AA9, 0x636D, 0x1F00,
+ 0x636E, 0x1EFC, 0x636F, 0x1EF9, 0x6370, 0x1F0B, 0x6371, 0x0AA4,
+ 0x6372, 0x0A9C, 0x6375, 0x1EFE, 0x6376, 0x0C69, 0x6377, 0x0AA0,
+ 0x6378, 0x1F06, 0x637A, 0x0AB6, 0x637B, 0x0AB3, 0x637C, 0x1F02,
+ 0x637D, 0x1EF1, 0x6380, 0x0AB2, 0x6381, 0x1F08, 0x6382, 0x1EF0,
+ 0x6383, 0x0AA7, 0x6384, 0x0AAB, 0x6385, 0x1F07, 0x6387, 0x1EFA,
+ 0x6388, 0x0AAC, 0x6389, 0x0AA6, 0x638A, 0x1EEF, 0x638C, 0x0C5B,
+ 0x638D, 0x1F0A, 0x638E, 0x1EF8, 0x638F, 0x0AB1, 0x6390, 0x1EFB,
+ 0x6391, 0x1F09, 0x6392, 0x0AB0, 0x6394, 0x214C, 0x6396, 0x0A9D,
+ 0x6397, 0x1EF6, 0x6398, 0x0AA2, 0x6399, 0x0AAD, 0x639B, 0x0AA8,
+ 0x639C, 0x1EFF, 0x639D, 0x1EF5, 0x639E, 0x1EF3, 0x639F, 0x1F05,
+ 0x63A0, 0x0A9A, 0x63A1, 0x0AAE, 0x63A2, 0x0A9E, 0x63A3, 0x0C5A,
+ 0x63A4, 0x1F03, 0x63A5, 0x0A9F, 0x63A7, 0x0A9B, 0x63A8, 0x0AAA,
+ 0x63A9, 0x0AA5, 0x63AA, 0x0AA3, 0x63AB, 0x1EF7, 0x63AC, 0x0AAF,
+ 0x63AD, 0x1EF4, 0x63AE, 0x1F01, 0x63AF, 0x1EFD, 0x63B0, 0x214E,
+ 0x63B1, 0x214D, 0x63BD, 0x1EF2, 0x63BE, 0x215E, 0x63C0, 0x0C5D,
+ 0x63C2, 0x2164, 0x63C3, 0x2153, 0x63C4, 0x2161, 0x63C5, 0x23E6,
+ 0x63C6, 0x0C60, 0x63C7, 0x2165, 0x63C8, 0x2168, 0x63C9, 0x0C5F,
+ 0x63CA, 0x2156, 0x63CB, 0x2167, 0x63CC, 0x2166, 0x63CD, 0x0C61,
+ 0x63CE, 0x214F, 0x63CF, 0x0C5C, 0x63D0, 0x0C64, 0x63D2, 0x0C62,
+ 0x63D3, 0x2163, 0x63D5, 0x2159, 0x63D6, 0x0C66, 0x63D7, 0x216A,
+ 0x63D8, 0x2162, 0x63D9, 0x216B, 0x63DA, 0x0C6E, 0x63DB, 0x0C6C,
+ 0x63DC, 0x2160, 0x63DD, 0x215F, 0x63DF, 0x215D, 0x63E0, 0x2157,
+ 0x63E1, 0x0C65, 0x63E3, 0x0C63, 0x63E4, 0x1CAA, 0x63E5, 0x2150,
+ 0x63E7, 0x2404, 0x63E8, 0x2151, 0x63E9, 0x0C5E, 0x63EA, 0x0C6B,
+ 0x63EB, 0x23E8, 0x63ED, 0x0C67, 0x63EE, 0x0C68, 0x63EF, 0x2152,
+ 0x63F0, 0x2169, 0x63F1, 0x23E7, 0x63F2, 0x215A, 0x63F3, 0x2155,
+ 0x63F4, 0x0C6A, 0x63F5, 0x215B, 0x63F6, 0x2158, 0x63F9, 0x0C6F,
+ 0x6406, 0x0E2A, 0x6409, 0x23EB, 0x640A, 0x23FE, 0x640B, 0x2403,
+ 0x640C, 0x23F7, 0x640D, 0x0E26, 0x640E, 0x2408, 0x640F, 0x0E23,
+ 0x6410, 0x23E9, 0x6412, 0x23EA, 0x6413, 0x0E1C, 0x6414, 0x0E25,
+ 0x6415, 0x23F1, 0x6416, 0x0E28, 0x6417, 0x0E29, 0x6418, 0x23F2,
+ 0x641A, 0x23FF, 0x641B, 0x2405, 0x641C, 0x0E24, 0x641E, 0x0E1E,
+ 0x641F, 0x23F0, 0x6420, 0x23EC, 0x6421, 0x2407, 0x6422, 0x23F5,
+ 0x6423, 0x23F6, 0x6424, 0x23ED, 0x6425, 0x2401, 0x6426, 0x23F8,
+ 0x6427, 0x2402, 0x6428, 0x23FA, 0x642A, 0x0E1F, 0x642B, 0x2699,
+ 0x642C, 0x0E22, 0x642D, 0x0E20, 0x642E, 0x2406, 0x642F, 0x23FD,
+ 0x6430, 0x23F9, 0x6433, 0x23EE, 0x6434, 0x0FE4, 0x6435, 0x23FC,
+ 0x6436, 0x0E27, 0x6437, 0x23F4, 0x6439, 0x23F3, 0x643D, 0x0E21,
+ 0x643E, 0x0E1D, 0x643F, 0x26AE, 0x6440, 0x2400, 0x6441, 0x23FB,
+ 0x6443, 0x23EF, 0x644B, 0x26A9, 0x644D, 0x269A, 0x644E, 0x26A5,
+ 0x6450, 0x26AC, 0x6451, 0x0FE2, 0x6452, 0x0C6D, 0x6453, 0x26AA,
+ 0x6454, 0x0FDD, 0x6458, 0x0FDC, 0x6459, 0x26B1, 0x645B, 0x269B,
+ 0x645C, 0x26A8, 0x645D, 0x269C, 0x645E, 0x26A7, 0x645F, 0x0FE0,
+ 0x6460, 0x26AB, 0x6461, 0x215C, 0x6465, 0x26B2, 0x6466, 0x26A3,
+ 0x6467, 0x0FE3, 0x6468, 0x28EE, 0x6469, 0x1159, 0x646B, 0x26B0,
+ 0x646C, 0x26AF, 0x646D, 0x0FE5, 0x646E, 0x28E1, 0x646F, 0x115A,
+ 0x6470, 0x28E2, 0x6472, 0x269F, 0x6473, 0x26A0, 0x6474, 0x269D,
+ 0x6475, 0x26A2, 0x6476, 0x269E, 0x6477, 0x26B3, 0x6478, 0x0FDF,
+ 0x6479, 0x115B, 0x647A, 0x0FE1, 0x647B, 0x0FE6, 0x647D, 0x26A1,
+ 0x647F, 0x26AD, 0x6482, 0x26A6, 0x6485, 0x28E5, 0x6487, 0x0FDB,
+ 0x6488, 0x115E, 0x6489, 0x2B54, 0x648A, 0x28EA, 0x648B, 0x28E9,
+ 0x648C, 0x28EB, 0x648F, 0x28E8, 0x6490, 0x115F, 0x6492, 0x1165,
+ 0x6493, 0x1162, 0x6495, 0x1163, 0x6496, 0x28E3, 0x6497, 0x28E6,
+ 0x6498, 0x28F0, 0x6499, 0x116B, 0x649A, 0x1169, 0x649C, 0x28E7,
+ 0x649D, 0x2154, 0x649E, 0x115C, 0x649F, 0x28ED, 0x64A0, 0x28E4,
+ 0x64A2, 0x116C, 0x64A3, 0x28EC, 0x64A4, 0x0FDE, 0x64A5, 0x1161,
+ 0x64A6, 0x26A4, 0x64A9, 0x1164, 0x64AB, 0x1168, 0x64AC, 0x116A,
+ 0x64AD, 0x1167, 0x64AE, 0x1166, 0x64B0, 0x1160, 0x64B1, 0x28EF,
+ 0x64B2, 0x115D, 0x64B3, 0x116D, 0x64BB, 0x12BB, 0x64BC, 0x12BC,
+ 0x64BD, 0x2B53, 0x64BE, 0x12C5, 0x64BF, 0x12C2, 0x64C1, 0x12B9,
+ 0x64C2, 0x12C0, 0x64C3, 0x2B55, 0x64C4, 0x12BE, 0x64C5, 0x12B8,
+ 0x64C7, 0x12BF, 0x64C9, 0x2B52, 0x64CA, 0x13D8, 0x64CB, 0x12BA,
+ 0x64CD, 0x12C1, 0x64CE, 0x13D7, 0x64CF, 0x2B51, 0x64D0, 0x2B50,
+ 0x64D2, 0x12C3, 0x64D4, 0x12C4, 0x64D6, 0x2B4F, 0x64D7, 0x2B4E,
+ 0x64D8, 0x13D9, 0x64D9, 0x2B58, 0x64DA, 0x12BD, 0x64DB, 0x2B56,
+ 0x64E0, 0x13DA, 0x64E2, 0x13DF, 0x64E3, 0x2D6A, 0x64E4, 0x2D6C,
+ 0x64E6, 0x13DC, 0x64E8, 0x2D6D, 0x64E9, 0x2D69, 0x64EB, 0x2D6B,
+ 0x64EC, 0x13DD, 0x64ED, 0x13E0, 0x64EF, 0x2D68, 0x64F0, 0x13DB,
+ 0x64F1, 0x13DE, 0x64F2, 0x14D3, 0x64F3, 0x2B57, 0x64F4, 0x14D2,
+ 0x64F7, 0x14D8, 0x64F8, 0x2F2B, 0x64FA, 0x14D6, 0x64FB, 0x14D7,
+ 0x64FC, 0x2F2E, 0x64FD, 0x2F2A, 0x64FE, 0x14D4, 0x64FF, 0x2F28,
+ 0x6500, 0x1582, 0x6501, 0x2F2C, 0x6503, 0x2F2D, 0x6504, 0x2F29,
+ 0x6506, 0x14D5, 0x6507, 0x3090, 0x6509, 0x3093, 0x650C, 0x3094,
+ 0x650D, 0x3092, 0x650E, 0x3095, 0x650F, 0x1583, 0x6510, 0x3091,
+ 0x6513, 0x31D7, 0x6514, 0x1617, 0x6515, 0x31D6, 0x6516, 0x31D5,
+ 0x6517, 0x31D4, 0x6518, 0x1616, 0x6519, 0x1618, 0x651B, 0x32D2,
+ 0x651C, 0x1673, 0x651D, 0x1672, 0x6520, 0x3382, 0x6521, 0x3381,
+ 0x6522, 0x3384, 0x6523, 0x16F9, 0x6524, 0x16C5, 0x6525, 0x341B,
+ 0x6526, 0x3383, 0x6529, 0x341A, 0x652A, 0x16FB, 0x652B, 0x16FA,
+ 0x652C, 0x1721, 0x652D, 0x3484, 0x652E, 0x34CA, 0x652F, 0x02D5,
+ 0x6532, 0x216C, 0x6533, 0x2B59, 0x6534, 0x022C, 0x6536, 0x03D7,
+ 0x6537, 0x17F6, 0x6538, 0x04B9, 0x6539, 0x04B7, 0x653B, 0x04B8,
+ 0x653D, 0x19A1, 0x653E, 0x05F3, 0x653F, 0x0741, 0x6541, 0x1B01,
+ 0x6543, 0x1B02, 0x6545, 0x0742, 0x6546, 0x1CBF, 0x6548, 0x08D6,
+ 0x6549, 0x08D7, 0x654A, 0x1CBE, 0x654F, 0x0ABD, 0x6551, 0x0AB9,
+ 0x6553, 0x1F0C, 0x6554, 0x0AC0, 0x6555, 0x0ABF, 0x6556, 0x0AB8,
+ 0x6557, 0x0ABB, 0x6558, 0x0ABE, 0x6559, 0x0ABA, 0x655C, 0x2170,
+ 0x655D, 0x0AB7, 0x655E, 0x0C70, 0x6562, 0x0C72, 0x6563, 0x0C73,
+ 0x6564, 0x216F, 0x6565, 0x2172, 0x6566, 0x0C71, 0x6567, 0x216D,
+ 0x6568, 0x2171, 0x656A, 0x216E, 0x656C, 0x0E2B, 0x656F, 0x2409,
+ 0x6572, 0x0FE7, 0x6573, 0x26B4, 0x6574, 0x12C6, 0x6575, 0x116E,
+ 0x6576, 0x28F1, 0x6577, 0x116F, 0x6578, 0x1170, 0x6579, 0x28F3,
+ 0x657A, 0x28F2, 0x657B, 0x28F4, 0x657C, 0x2B5B, 0x657F, 0x2B5A,
+ 0x6580, 0x2D6F, 0x6581, 0x2D6E, 0x6582, 0x13E1, 0x6583, 0x13E2,
+ 0x6584, 0x3096, 0x6587, 0x02D6, 0x658C, 0x2173, 0x6590, 0x0C75,
+ 0x6591, 0x0C74, 0x6592, 0x240A, 0x6594, 0x2F2F, 0x6595, 0x1674,
+ 0x6596, 0x341C, 0x6597, 0x02D7, 0x6599, 0x08D8, 0x659B, 0x0AC2,
+ 0x659C, 0x0AC1, 0x659D, 0x2174, 0x659E, 0x2175, 0x659F, 0x0E2C,
+ 0x65A0, 0x26B5, 0x65A1, 0x0FE8, 0x65A2, 0x2B5C, 0x65A4, 0x02D8,
+ 0x65A5, 0x0346, 0x65A7, 0x05F4, 0x65A8, 0x19A2, 0x65AA, 0x1B03,
+ 0x65AB, 0x0743, 0x65AC, 0x0AC3, 0x65AE, 0x2176, 0x65AF, 0x0C76,
+ 0x65B0, 0x0E2D, 0x65B2, 0x28F5, 0x65B3, 0x28F6, 0x65B6, 0x2D70,
+ 0x65B7, 0x14D9, 0x65B8, 0x34CB, 0x65B9, 0x02D9, 0x65BB, 0x19A3,
+ 0x65BC, 0x05F5, 0x65BD, 0x0744, 0x65BF, 0x1B04, 0x65C1, 0x08D9,
+ 0x65C2, 0x1CC3, 0x65C3, 0x1CC1, 0x65C4, 0x1CC2, 0x65C5, 0x08DA,
+ 0x65C6, 0x1CC0, 0x65CB, 0x0AC5, 0x65CC, 0x0AC6, 0x65CD, 0x1F0D,
+ 0x65CE, 0x0AC7, 0x65CF, 0x0AC4, 0x65D0, 0x2177, 0x65D2, 0x2178,
+ 0x65D3, 0x240B, 0x65D6, 0x0FEA, 0x65D7, 0x0FE9, 0x65DA, 0x2D71,
+ 0x65DB, 0x2F30, 0x65DD, 0x3098, 0x65DE, 0x3097, 0x65DF, 0x31D8,
+ 0x65E0, 0x022D, 0x65E1, 0x1789, 0x65E2, 0x0745, 0x65E5, 0x02DA,
+ 0x65E6, 0x0347, 0x65E8, 0x03D9, 0x65E9, 0x03D8, 0x65EC, 0x03DA,
+ 0x65ED, 0x03DB, 0x65EE, 0x17F8, 0x65EF, 0x17F7, 0x65F0, 0x189E,
+ 0x65F1, 0x04BA, 0x65F2, 0x18A1, 0x65F3, 0x18A0, 0x65F4, 0x189F,
+ 0x65F5, 0x18A2, 0x65FA, 0x05F6, 0x65FB, 0x19A9, 0x65FC, 0x19A5,
+ 0x65FD, 0x19AE, 0x6600, 0x05FD, 0x6602, 0x05FB, 0x6603, 0x19AA,
+ 0x6604, 0x19A6, 0x6605, 0x19AD, 0x6606, 0x05FA, 0x6607, 0x0601,
+ 0x6608, 0x19A8, 0x6609, 0x19A4, 0x660A, 0x0600, 0x660B, 0x19AB,
+ 0x660C, 0x05F9, 0x660D, 0x19AC, 0x660E, 0x05FC, 0x660F, 0x05FE,
+ 0x6610, 0x19B0, 0x6611, 0x19AF, 0x6612, 0x19A7, 0x6613, 0x05F8,
+ 0x6614, 0x05F7, 0x6615, 0x05FF, 0x661C, 0x1B09, 0x661D, 0x1B0F,
+ 0x661F, 0x074B, 0x6620, 0x0748, 0x6621, 0x1B06, 0x6622, 0x1B0B,
+ 0x6624, 0x074E, 0x6625, 0x0746, 0x6626, 0x1B0A, 0x6627, 0x0749,
+ 0x6628, 0x074C, 0x662B, 0x1B0D, 0x662D, 0x0747, 0x662E, 0x1B12,
+ 0x662F, 0x074A, 0x6631, 0x074D, 0x6632, 0x1B07, 0x6633, 0x1B0C,
+ 0x6634, 0x1B10, 0x6635, 0x1B08, 0x6636, 0x1B05, 0x6639, 0x1B11,
+ 0x663A, 0x1B0E, 0x6641, 0x08E2, 0x6642, 0x08DB, 0x6643, 0x08DE,
+ 0x6645, 0x08E1, 0x6647, 0x1CC6, 0x6649, 0x08DC, 0x664A, 0x1CC4,
+ 0x664C, 0x08E0, 0x664F, 0x08DD, 0x6651, 0x1CC7, 0x6652, 0x08DF,
+ 0x6659, 0x1F11, 0x665A, 0x0AC9, 0x665B, 0x1F10, 0x665C, 0x1F12,
+ 0x665D, 0x0AC8, 0x665E, 0x0ACD, 0x665F, 0x1CC5, 0x6661, 0x1F0F,
+ 0x6662, 0x1F13, 0x6664, 0x0ACA, 0x6665, 0x1F0E, 0x6666, 0x0ACC,
+ 0x6668, 0x0ACB, 0x666A, 0x217F, 0x666C, 0x217A, 0x666E, 0x0C77,
+ 0x666F, 0x0C7B, 0x6670, 0x0C78, 0x6671, 0x217D, 0x6672, 0x2180,
+ 0x6674, 0x0C79, 0x6676, 0x0C7A, 0x6677, 0x0C7F, 0x6678, 0x2414,
+ 0x6679, 0x217E, 0x667A, 0x0C7D, 0x667B, 0x217B, 0x667C, 0x2179,
+ 0x667E, 0x0C7E, 0x6680, 0x217C, 0x6684, 0x0E33, 0x6686, 0x240C,
+ 0x6687, 0x0E30, 0x6688, 0x0E31, 0x6689, 0x0E2F, 0x668A, 0x2411,
+ 0x668B, 0x2410, 0x668C, 0x240D, 0x668D, 0x0E35, 0x6690, 0x240F,
+ 0x6691, 0x0C7C, 0x6694, 0x2413, 0x6695, 0x240E, 0x6696, 0x0E32,
+ 0x6697, 0x0E2E, 0x6698, 0x0E34, 0x6699, 0x2412, 0x669D, 0x0FED,
+ 0x669F, 0x26B8, 0x66A0, 0x26B7, 0x66A1, 0x26B6, 0x66A2, 0x0FEB,
+ 0x66A8, 0x0FEC, 0x66A9, 0x28F9, 0x66AA, 0x28FC, 0x66AB, 0x1172,
+ 0x66AE, 0x1171, 0x66AF, 0x28FD, 0x66B0, 0x28F8, 0x66B1, 0x1174,
+ 0x66B2, 0x28FA, 0x66B4, 0x1173, 0x66B5, 0x28F7, 0x66B7, 0x28FB,
+ 0x66B8, 0x12CC, 0x66B9, 0x12C9, 0x66BA, 0x2B65, 0x66BB, 0x2B64,
+ 0x66BD, 0x2B63, 0x66BE, 0x2B5E, 0x66C0, 0x2B5F, 0x66C4, 0x12CA,
+ 0x66C6, 0x12C7, 0x66C7, 0x12CB, 0x66C8, 0x2B5D, 0x66C9, 0x12C8,
+ 0x66CA, 0x2B60, 0x66CB, 0x2B61, 0x66CC, 0x2B66, 0x66CF, 0x2B62,
+ 0x66D2, 0x2D72, 0x66D6, 0x13E4, 0x66D8, 0x2F33, 0x66D9, 0x13E3,
+ 0x66DA, 0x2F31, 0x66DB, 0x2F32, 0x66DC, 0x14DA, 0x66DD, 0x1585,
+ 0x66DE, 0x3099, 0x66E0, 0x1584, 0x66E3, 0x31DA, 0x66E4, 0x31DB,
+ 0x66E6, 0x1619, 0x66E8, 0x31D9, 0x66E9, 0x1675, 0x66EB, 0x341D,
+ 0x66EC, 0x16FC, 0x66ED, 0x3485, 0x66EE, 0x3486, 0x66F0, 0x02DB,
+ 0x66F2, 0x03DC, 0x66F3, 0x03DD, 0x66F4, 0x04BB, 0x66F6, 0x19B1,
+ 0x66F7, 0x074F, 0x66F8, 0x08E3, 0x66F9, 0x0ACE, 0x66FC, 0x0A1F,
+ 0x66FE, 0x0C80, 0x66FF, 0x0C81, 0x6700, 0x0BF0, 0x6701, 0x2181,
+ 0x6703, 0x0E36, 0x6704, 0x26BA, 0x6705, 0x26B9, 0x6708, 0x02DC,
+ 0x6709, 0x03DE, 0x670A, 0x19B2, 0x670B, 0x0603, 0x670D, 0x0602,
+ 0x670F, 0x1B13, 0x6710, 0x1B14, 0x6712, 0x1CC8, 0x6713, 0x1CC9,
+ 0x6714, 0x08E4, 0x6715, 0x08E5, 0x6717, 0x08E6, 0x6718, 0x1F14,
+ 0x671B, 0x0AD0, 0x671D, 0x0C83, 0x671F, 0x0C82, 0x6720, 0x2415,
+ 0x6721, 0x2522, 0x6722, 0x26BB, 0x6723, 0x2B67, 0x6726, 0x14DB,
+ 0x6727, 0x161A, 0x6728, 0x02DD, 0x672A, 0x034A, 0x672B, 0x034B,
+ 0x672C, 0x0349, 0x672D, 0x034C, 0x672E, 0x0348, 0x6731, 0x03E1,
+ 0x6733, 0x1800, 0x6734, 0x03E0, 0x6735, 0x03E2, 0x6738, 0x17FB,
+ 0x6739, 0x17FA, 0x673A, 0x17FD, 0x673B, 0x17FC, 0x673C, 0x17FF,
+ 0x673D, 0x03DF, 0x673E, 0x17F9, 0x673F, 0x17FE, 0x6745, 0x18A3,
+ 0x6746, 0x04C5, 0x6747, 0x18A4, 0x6748, 0x18A8, 0x6749, 0x04C4,
+ 0x674B, 0x18AC, 0x674C, 0x18A7, 0x674D, 0x18AA, 0x674E, 0x04BD,
+ 0x674F, 0x04BE, 0x6750, 0x04BF, 0x6751, 0x04C0, 0x6753, 0x04C7,
+ 0x6755, 0x18A6, 0x6756, 0x04C2, 0x6757, 0x04C8, 0x6759, 0x18A5,
+ 0x675A, 0x18AB, 0x675C, 0x04C1, 0x675D, 0x18A9, 0x675E, 0x04C3,
+ 0x675F, 0x04BC, 0x6760, 0x04C6, 0x676A, 0x0618, 0x676C, 0x19B4,
+ 0x676D, 0x0604, 0x676F, 0x060E, 0x6770, 0x060F, 0x6771, 0x0607,
+ 0x6772, 0x0619, 0x6773, 0x0609, 0x6774, 0x19BC, 0x6775, 0x0614,
+ 0x6776, 0x19B7, 0x6777, 0x060A, 0x6778, 0x19C6, 0x6779, 0x19C7,
+ 0x677A, 0x19BF, 0x677B, 0x19B8, 0x677C, 0x0617, 0x677D, 0x19C4,
+ 0x677E, 0x0612, 0x677F, 0x0610, 0x6781, 0x19C5, 0x6783, 0x19C3,
+ 0x6784, 0x19BB, 0x6785, 0x19B3, 0x6786, 0x19BA, 0x6787, 0x060B,
+ 0x6789, 0x0611, 0x678B, 0x0605, 0x678C, 0x19BE, 0x678D, 0x19BD,
+ 0x678E, 0x19B5, 0x6790, 0x0613, 0x6791, 0x19C1, 0x6792, 0x19B6,
+ 0x6793, 0x0616, 0x6794, 0x19C8, 0x6795, 0x0606, 0x6797, 0x060D,
+ 0x6798, 0x19B9, 0x6799, 0x19C2, 0x679A, 0x0615, 0x679C, 0x0608,
+ 0x679D, 0x060C, 0x679F, 0x19C0, 0x67AE, 0x1B34, 0x67AF, 0x0757,
+ 0x67B0, 0x0764, 0x67B2, 0x1B2F, 0x67B3, 0x1B25, 0x67B4, 0x075D,
+ 0x67B5, 0x1B23, 0x67B6, 0x0756, 0x67B7, 0x1B1E, 0x67B8, 0x0760,
+ 0x67B9, 0x1B2B, 0x67BA, 0x1B18, 0x67BB, 0x1B1A, 0x67C0, 0x1B1D,
+ 0x67C1, 0x1B15, 0x67C2, 0x1B2A, 0x67C3, 0x1B3A, 0x67C4, 0x075B,
+ 0x67C5, 0x1B1F, 0x67C6, 0x1B31, 0x67C8, 0x1B17, 0x67C9, 0x1B38,
+ 0x67CA, 0x1B39, 0x67CB, 0x1B3C, 0x67CC, 0x1B33, 0x67CD, 0x1B24,
+ 0x67CE, 0x1B2C, 0x67CF, 0x0761, 0x67D0, 0x0754, 0x67D1, 0x075C,
+ 0x67D2, 0x0768, 0x67D3, 0x0751, 0x67D4, 0x0753, 0x67D8, 0x1B1C,
+ 0x67D9, 0x0765, 0x67DA, 0x075E, 0x67DB, 0x1B36, 0x67DC, 0x1B19,
+ 0x67DD, 0x0767, 0x67DE, 0x0762, 0x67DF, 0x1B22, 0x67E2, 0x0766,
+ 0x67E3, 0x1B29, 0x67E4, 0x1B21, 0x67E5, 0x075F, 0x67E6, 0x1B35,
+ 0x67E7, 0x1B2D, 0x67E9, 0x0759, 0x67EA, 0x1B3B, 0x67EB, 0x1B20,
+ 0x67EC, 0x0755, 0x67ED, 0x1B32, 0x67EE, 0x1B28, 0x67EF, 0x075A,
+ 0x67F0, 0x1B2E, 0x67F1, 0x0752, 0x67F2, 0x1B16, 0x67F3, 0x0763,
+ 0x67F4, 0x08F5, 0x67F5, 0x0758, 0x67F6, 0x1B27, 0x67F7, 0x1B26,
+ 0x67F8, 0x1B1B, 0x67FA, 0x1B37, 0x67FC, 0x1B30, 0x67FF, 0x0750,
+ 0x6812, 0x1CDD, 0x6813, 0x08FC, 0x6814, 0x1CDE, 0x6816, 0x1CD2,
+ 0x6817, 0x08F1, 0x6818, 0x08FD, 0x681A, 0x1CCB, 0x681C, 0x1CD4,
+ 0x681D, 0x1CDC, 0x681F, 0x1CCA, 0x6820, 0x1CE5, 0x6821, 0x08E7,
+ 0x6825, 0x1CE4, 0x6826, 0x1CDF, 0x6828, 0x1CE0, 0x6829, 0x08EF,
+ 0x682A, 0x08FA, 0x682B, 0x1CD6, 0x682D, 0x1CD7, 0x682E, 0x1CE1,
+ 0x682F, 0x1CD8, 0x6831, 0x1CD3, 0x6832, 0x1CCD, 0x6833, 0x1CCE,
+ 0x6834, 0x1CDB, 0x6835, 0x1CD5, 0x6838, 0x08E8, 0x6839, 0x08EC,
+ 0x683A, 0x1CE3, 0x683B, 0x1CCF, 0x683C, 0x08F8, 0x683D, 0x08F4,
+ 0x6840, 0x08F7, 0x6841, 0x08FE, 0x6842, 0x08ED, 0x6843, 0x08F9,
+ 0x6844, 0x1CDA, 0x6845, 0x08FB, 0x6846, 0x08EA, 0x6848, 0x08E9,
+ 0x6849, 0x1CCC, 0x684B, 0x1CD0, 0x684C, 0x08F2, 0x684D, 0x1CE2,
+ 0x684E, 0x1CD9, 0x684F, 0x1CD1, 0x6850, 0x08F6, 0x6851, 0x08F3,
+ 0x6853, 0x08EB, 0x6854, 0x08EE, 0x686B, 0x1F29, 0x686D, 0x1F19,
+ 0x686E, 0x1F1A, 0x686F, 0x1F1E, 0x6871, 0x1F2D, 0x6872, 0x1F2A,
+ 0x6874, 0x1F23, 0x6875, 0x1F22, 0x6876, 0x0AD7, 0x6877, 0x1F26,
+ 0x6878, 0x1F35, 0x6879, 0x1F15, 0x687B, 0x1F36, 0x687C, 0x1F28,
+ 0x687D, 0x1F3A, 0x687E, 0x1F2E, 0x687F, 0x0AD6, 0x6880, 0x1F2C,
+ 0x6881, 0x0AD1, 0x6882, 0x0AE6, 0x6883, 0x0ADC, 0x6885, 0x0AE0,
+ 0x6886, 0x0ADF, 0x6887, 0x1F16, 0x6889, 0x1F33, 0x688A, 0x1F39,
+ 0x688B, 0x1F31, 0x688C, 0x1F38, 0x688F, 0x1F25, 0x6890, 0x1F17,
+ 0x6891, 0x1F37, 0x6892, 0x1F27, 0x6893, 0x0AD4, 0x6894, 0x0AE1,
+ 0x6896, 0x1F30, 0x6897, 0x0ADA, 0x689B, 0x1F2F, 0x689C, 0x1F18,
+ 0x689D, 0x0AE2, 0x689F, 0x0AE4, 0x68A0, 0x1F32, 0x68A1, 0x0AE5,
+ 0x68A2, 0x0AD3, 0x68A3, 0x1F1F, 0x68A4, 0x1F34, 0x68A7, 0x0AD9,
+ 0x68A8, 0x0AE3, 0x68A9, 0x1F21, 0x68AA, 0x1F2B, 0x68AB, 0x1F1C,
+ 0x68AC, 0x1F20, 0x68AD, 0x0ADE, 0x68AE, 0x1F1B, 0x68AF, 0x0AD2,
+ 0x68B0, 0x0ADB, 0x68B1, 0x0AD8, 0x68B2, 0x1F24, 0x68B3, 0x08F0,
+ 0x68B4, 0x2198, 0x68B5, 0x0AD5, 0x68C4, 0x0ADD, 0x68C6, 0x219B,
+ 0x68C7, 0x21B1, 0x68C8, 0x21A6, 0x68C9, 0x0C97, 0x68CB, 0x0C92,
+ 0x68CC, 0x2195, 0x68CD, 0x0C93, 0x68CE, 0x21A5, 0x68D0, 0x219E,
+ 0x68D1, 0x21AB, 0x68D2, 0x0C8F, 0x68D3, 0x2183, 0x68D4, 0x21AD,
+ 0x68D5, 0x0C85, 0x68D6, 0x218B, 0x68D7, 0x0C88, 0x68D8, 0x0C87,
+ 0x68DA, 0x0C98, 0x68DC, 0x2185, 0x68DD, 0x21A7, 0x68DE, 0x21A8,
+ 0x68DF, 0x0C8A, 0x68E0, 0x0C86, 0x68E1, 0x2193, 0x68E3, 0x0C91,
+ 0x68E4, 0x218E, 0x68E6, 0x21A9, 0x68E7, 0x0C8D, 0x68E8, 0x21A1,
+ 0x68E9, 0x21AE, 0x68EA, 0x2188, 0x68EB, 0x218D, 0x68EC, 0x2187,
+ 0x68EE, 0x0C8C, 0x68EF, 0x219A, 0x68F0, 0x242B, 0x68F1, 0x2189,
+ 0x68F2, 0x0C90, 0x68F3, 0x2192, 0x68F4, 0x21AA, 0x68F5, 0x0C8B,
+ 0x68F6, 0x218F, 0x68F7, 0x218C, 0x68F8, 0x219D, 0x68F9, 0x0C8E,
+ 0x68FA, 0x0C84, 0x68FB, 0x0C9A, 0x68FC, 0x21A0, 0x68FD, 0x219F,
+ 0x6904, 0x2184, 0x6905, 0x0C89, 0x6906, 0x21AC, 0x6907, 0x2194,
+ 0x6908, 0x2196, 0x690A, 0x21A3, 0x690B, 0x21A2, 0x690C, 0x2182,
+ 0x690D, 0x0C94, 0x690E, 0x0C96, 0x690F, 0x218A, 0x6910, 0x2191,
+ 0x6911, 0x2199, 0x6912, 0x0C95, 0x6913, 0x2190, 0x6914, 0x219C,
+ 0x6915, 0x21AF, 0x6917, 0x21A4, 0x6925, 0x21B0, 0x692A, 0x2186,
+ 0x692F, 0x243F, 0x6930, 0x0E3E, 0x6932, 0x243D, 0x6933, 0x2428,
+ 0x6934, 0x242D, 0x6935, 0x2426, 0x6937, 0x2439, 0x6938, 0x2418,
+ 0x6939, 0x241F, 0x693B, 0x2437, 0x693C, 0x2441, 0x693D, 0x2429,
+ 0x693F, 0x241C, 0x6940, 0x242F, 0x6941, 0x2434, 0x6942, 0x2420,
+ 0x6944, 0x2431, 0x6945, 0x241D, 0x6948, 0x2424, 0x6949, 0x2425,
+ 0x694A, 0x0E40, 0x694B, 0x2438, 0x694C, 0x2436, 0x694E, 0x2419,
+ 0x694F, 0x243B, 0x6951, 0x243C, 0x6952, 0x243E, 0x6953, 0x0E44,
+ 0x6954, 0x0E3C, 0x6956, 0x1F1D, 0x6957, 0x2421, 0x6958, 0x2433,
+ 0x6959, 0x2422, 0x695A, 0x0E39, 0x695B, 0x0E49, 0x695C, 0x243A,
+ 0x695D, 0x0E47, 0x695E, 0x0E43, 0x695F, 0x2417, 0x6960, 0x0E3B,
+ 0x6962, 0x241A, 0x6963, 0x0E48, 0x6965, 0x242A, 0x6966, 0x2416,
+ 0x6968, 0x0E41, 0x6969, 0x242E, 0x696A, 0x241E, 0x696B, 0x0E42,
+ 0x696C, 0x2427, 0x696D, 0x0E38, 0x696E, 0x0C99, 0x696F, 0x2430,
+ 0x6970, 0x2197, 0x6971, 0x241B, 0x6974, 0x2435, 0x6975, 0x0E3D,
+ 0x6976, 0x2432, 0x6977, 0x0E3A, 0x6978, 0x242C, 0x6979, 0x0E45,
+ 0x697A, 0x2423, 0x697B, 0x2440, 0x6982, 0x0E3F, 0x6983, 0x24AF,
+ 0x6986, 0x0E46, 0x698D, 0x26C9, 0x698E, 0x26C7, 0x6990, 0x26DD,
+ 0x6991, 0x26C5, 0x6993, 0x26D7, 0x6994, 0x0E37, 0x6995, 0x0FF0,
+ 0x6996, 0x26C1, 0x6997, 0x26DC, 0x6999, 0x26C6, 0x699A, 0x26D4,
+ 0x699B, 0x0FF5, 0x699C, 0x0FEE, 0x699E, 0x26DA, 0x69A0, 0x26BF,
+ 0x69A1, 0x26D9, 0x69A3, 0x1000, 0x69A4, 0x26D0, 0x69A5, 0x26E0,
+ 0x69A6, 0x0FFE, 0x69A7, 0x26C8, 0x69A8, 0x0FEF, 0x69A9, 0x26CA,
+ 0x69AA, 0x26D8, 0x69AB, 0x0FF8, 0x69AC, 0x26C3, 0x69AD, 0x0FFC,
+ 0x69AE, 0x0FF2, 0x69AF, 0x26CC, 0x69B0, 0x26C2, 0x69B1, 0x26BC,
+ 0x69B3, 0x26D6, 0x69B4, 0x0FF9, 0x69B5, 0x26DF, 0x69B6, 0x26BD,
+ 0x69B7, 0x0FF6, 0x69B9, 0x26D2, 0x69BB, 0x0FF7, 0x69BC, 0x26C4,
+ 0x69BD, 0x26CF, 0x69BE, 0x26CB, 0x69BF, 0x26CD, 0x69C1, 0x0FF1,
+ 0x69C2, 0x26DE, 0x69C3, 0x0FFF, 0x69C4, 0x26CE, 0x69C6, 0x26E1,
+ 0x69C9, 0x26BE, 0x69CA, 0x26D3, 0x69CB, 0x0FF4, 0x69CC, 0x0FFD,
+ 0x69CD, 0x0FFB, 0x69CE, 0x26C0, 0x69CF, 0x26D5, 0x69D0, 0x0FFA,
+ 0x69D3, 0x0FF3, 0x69D4, 0x26D1, 0x69D9, 0x26DB, 0x69E2, 0x2909,
+ 0x69E4, 0x2905, 0x69E5, 0x2901, 0x69E6, 0x2915, 0x69E7, 0x2912,
+ 0x69E8, 0x1177, 0x69EB, 0x2919, 0x69EC, 0x2908, 0x69ED, 0x1182,
+ 0x69EE, 0x290F, 0x69F1, 0x2904, 0x69F2, 0x290E, 0x69F3, 0x117F,
+ 0x69F4, 0x2922, 0x69F6, 0x291F, 0x69F7, 0x2911, 0x69F8, 0x2902,
+ 0x69FB, 0x2916, 0x69FC, 0x2918, 0x69FD, 0x117B, 0x69FE, 0x290C,
+ 0x69FF, 0x2907, 0x6A00, 0x28FE, 0x6A01, 0x1178, 0x6A02, 0x1180,
+ 0x6A04, 0x291B, 0x6A05, 0x1181, 0x6A06, 0x28FF, 0x6A07, 0x2921,
+ 0x6A08, 0x2914, 0x6A09, 0x291A, 0x6A0A, 0x117E, 0x6A0D, 0x2917,
+ 0x6A0F, 0x291E, 0x6A11, 0x1183, 0x6A13, 0x117D, 0x6A14, 0x2910,
+ 0x6A15, 0x2903, 0x6A16, 0x2923, 0x6A17, 0x2900, 0x6A18, 0x291C,
+ 0x6A19, 0x117A, 0x6A1B, 0x290A, 0x6A1D, 0x290B, 0x6A1E, 0x1179,
+ 0x6A1F, 0x1176, 0x6A20, 0x2906, 0x6A21, 0x117C, 0x6A23, 0x1175,
+ 0x6A25, 0x291D, 0x6A26, 0x2920, 0x6A27, 0x290D, 0x6A28, 0x2B74,
+ 0x6A32, 0x2B6C, 0x6A34, 0x2B68, 0x6A35, 0x12D9, 0x6A38, 0x12CE,
+ 0x6A39, 0x12D3, 0x6A3A, 0x12CF, 0x6A3B, 0x2B76, 0x6A3C, 0x2B81,
+ 0x6A3D, 0x12CD, 0x6A3E, 0x2B6E, 0x6A3F, 0x2B77, 0x6A40, 0x2913,
+ 0x6A41, 0x2B78, 0x6A44, 0x12D4, 0x6A46, 0x2B87, 0x6A47, 0x12D8,
+ 0x6A48, 0x12DB, 0x6A49, 0x2B6A, 0x6A4B, 0x12D7, 0x6A4D, 0x2B85,
+ 0x6A4E, 0x2B86, 0x6A4F, 0x2B7C, 0x6A50, 0x2B7B, 0x6A51, 0x2B73,
+ 0x6A54, 0x2B7D, 0x6A55, 0x2B84, 0x6A56, 0x2B83, 0x6A58, 0x12D2,
+ 0x6A59, 0x12D0, 0x6A5A, 0x2B75, 0x6A5B, 0x2B72, 0x6A5D, 0x2B6F,
+ 0x6A5E, 0x2B82, 0x6A5F, 0x12DA, 0x6A60, 0x2B80, 0x6A61, 0x12D6,
+ 0x6A62, 0x12D5, 0x6A64, 0x2B7A, 0x6A66, 0x2B69, 0x6A67, 0x2B6B,
+ 0x6A68, 0x2B6D, 0x6A69, 0x2B7F, 0x6A6A, 0x2B79, 0x6A6B, 0x12D1,
+ 0x6A6D, 0x2B70, 0x6A6F, 0x2B7E, 0x6A76, 0x2B71, 0x6A7E, 0x13EC,
+ 0x6A7F, 0x2D84, 0x6A80, 0x13E5, 0x6A81, 0x2D75, 0x6A83, 0x2D80,
+ 0x6A84, 0x13E7, 0x6A85, 0x2D87, 0x6A87, 0x2D7C, 0x6A89, 0x2D77,
+ 0x6A8C, 0x2D88, 0x6A8D, 0x2D73, 0x6A8E, 0x2D7E, 0x6A90, 0x13EE,
+ 0x6A91, 0x2D83, 0x6A92, 0x2D89, 0x6A93, 0x2D7D, 0x6A94, 0x13E6,
+ 0x6A95, 0x2D7F, 0x6A96, 0x2D74, 0x6A97, 0x13ED, 0x6A9A, 0x2D86,
+ 0x6A9B, 0x2D79, 0x6A9C, 0x13E9, 0x6A9E, 0x2D7B, 0x6A9F, 0x2D78,
+ 0x6AA0, 0x13EF, 0x6AA1, 0x2D7A, 0x6AA2, 0x13E8, 0x6AA3, 0x13EB,
+ 0x6AA4, 0x2D82, 0x6AA5, 0x2D76, 0x6AA6, 0x2D85, 0x6AA8, 0x2D81,
+ 0x6AAC, 0x14DD, 0x6AAD, 0x2F3E, 0x6AAE, 0x14E2, 0x6AAF, 0x14E3,
+ 0x6AB3, 0x14DC, 0x6AB4, 0x2F3D, 0x6AB6, 0x2F3A, 0x6AB7, 0x2F3B,
+ 0x6AB8, 0x14E0, 0x6AB9, 0x2F35, 0x6ABA, 0x2F39, 0x6ABB, 0x14DF,
+ 0x6ABD, 0x2F36, 0x6AC2, 0x14E1, 0x6AC3, 0x14DE, 0x6AC5, 0x2F34,
+ 0x6AC6, 0x2F38, 0x6AC7, 0x2F3C, 0x6ACB, 0x309F, 0x6ACC, 0x309C,
+ 0x6ACD, 0x30A5, 0x6ACF, 0x30A4, 0x6AD0, 0x30A2, 0x6AD1, 0x309D,
+ 0x6AD3, 0x1589, 0x6AD9, 0x309E, 0x6ADA, 0x1588, 0x6ADB, 0x13EA,
+ 0x6ADC, 0x30A1, 0x6ADD, 0x1587, 0x6ADE, 0x30A6, 0x6ADF, 0x30A0,
+ 0x6AE0, 0x309B, 0x6AE1, 0x2F37, 0x6AE5, 0x1586, 0x6AE7, 0x309A,
+ 0x6AE8, 0x31DF, 0x6AEA, 0x31DE, 0x6AEB, 0x30A3, 0x6AEC, 0x161B,
+ 0x6AEE, 0x31E2, 0x6AEF, 0x31E3, 0x6AF0, 0x31DD, 0x6AF1, 0x31E1,
+ 0x6AF3, 0x31DC, 0x6AF8, 0x32D6, 0x6AF9, 0x31E0, 0x6AFA, 0x1678,
+ 0x6AFB, 0x1676, 0x6AFC, 0x32D4, 0x6B00, 0x32D7, 0x6B02, 0x32D3,
+ 0x6B03, 0x32D5, 0x6B04, 0x1677, 0x6B08, 0x3386, 0x6B09, 0x3387,
+ 0x6B0A, 0x16C6, 0x6B0B, 0x3385, 0x6B0F, 0x3420, 0x6B10, 0x16FD,
+ 0x6B11, 0x341E, 0x6B12, 0x341F, 0x6B13, 0x3487, 0x6B16, 0x1743,
+ 0x6B17, 0x34CE, 0x6B18, 0x34CC, 0x6B19, 0x34CD, 0x6B1A, 0x34CF,
+ 0x6B1E, 0x3534, 0x6B20, 0x02DE, 0x6B21, 0x03E3, 0x6B23, 0x061A,
+ 0x6B25, 0x19C9, 0x6B28, 0x1B3D, 0x6B2C, 0x1CE6, 0x6B2D, 0x1CE8,
+ 0x6B2F, 0x1CE7, 0x6B31, 0x1CE9, 0x6B32, 0x0AE7, 0x6B33, 0x1F3C,
+ 0x6B34, 0x1CEA, 0x6B36, 0x1F3B, 0x6B37, 0x1F3D, 0x6B38, 0x1F3E,
+ 0x6B39, 0x21B2, 0x6B3A, 0x0C9C, 0x6B3B, 0x21B3, 0x6B3C, 0x21B5,
+ 0x6B3D, 0x0C9D, 0x6B3E, 0x0C9B, 0x6B3F, 0x21B4, 0x6B41, 0x2447,
+ 0x6B42, 0x2445, 0x6B43, 0x2444, 0x6B45, 0x2443, 0x6B46, 0x2442,
+ 0x6B47, 0x0E4A, 0x6B48, 0x2446, 0x6B49, 0x1001, 0x6B4A, 0x26E2,
+ 0x6B4B, 0x26E4, 0x6B4C, 0x1002, 0x6B4D, 0x26E3, 0x6B4E, 0x1185,
+ 0x6B50, 0x1184, 0x6B51, 0x2924, 0x6B54, 0x2B89, 0x6B55, 0x2B88,
+ 0x6B56, 0x2B8A, 0x6B59, 0x12DC, 0x6B5B, 0x2D8A, 0x6B5C, 0x13F0,
+ 0x6B5E, 0x2F3F, 0x6B5F, 0x14E4, 0x6B60, 0x30A7, 0x6B61, 0x16C7,
+ 0x6B62, 0x02DF, 0x6B63, 0x034D, 0x6B64, 0x03E4, 0x6B65, 0x04C9,
+ 0x6B66, 0x061B, 0x6B67, 0x061C, 0x6B6A, 0x0769, 0x6B6D, 0x1CEB,
+ 0x6B72, 0x0E4B, 0x6B76, 0x29A2, 0x6B77, 0x12DD, 0x6B78, 0x14E5,
+ 0x6B79, 0x02E0, 0x6B7B, 0x03E5, 0x6B7E, 0x19CB, 0x6B7F, 0x061D,
+ 0x6B80, 0x19CA, 0x6B82, 0x1B3E, 0x6B83, 0x076A, 0x6B84, 0x1B3F,
+ 0x6B86, 0x076B, 0x6B88, 0x1CED, 0x6B89, 0x0900, 0x6B8A, 0x08FF,
+ 0x6B8C, 0x1F43, 0x6B8D, 0x1F41, 0x6B8E, 0x1F42, 0x6B8F, 0x1F40,
+ 0x6B91, 0x1F3F, 0x6B94, 0x21B6, 0x6B95, 0x21B9, 0x6B96, 0x0C9F,
+ 0x6B97, 0x21B7, 0x6B98, 0x0C9E, 0x6B99, 0x21B8, 0x6B9B, 0x2448,
+ 0x6B9E, 0x26E5, 0x6B9F, 0x26E6, 0x6BA0, 0x26E7, 0x6BA2, 0x2927,
+ 0x6BA3, 0x2926, 0x6BA4, 0x1186, 0x6BA5, 0x2925, 0x6BA6, 0x2928,
+ 0x6BA7, 0x2B8B, 0x6BAA, 0x2B8C, 0x6BAB, 0x2B8D, 0x6BAD, 0x2D8B,
+ 0x6BAE, 0x13F1, 0x6BAF, 0x14E6, 0x6BB0, 0x30A8, 0x6BB2, 0x1679,
+ 0x6BB3, 0x178A, 0x6BB5, 0x076C, 0x6BB6, 0x1B40, 0x6BB7, 0x0901,
+ 0x6BBA, 0x0AE8, 0x6BBC, 0x0CA0, 0x6BBD, 0x21BA, 0x6BBF, 0x0E4D,
+ 0x6BC0, 0x0E4C, 0x6BC3, 0x26E8, 0x6BC4, 0x26E9, 0x6BC5, 0x1187,
+ 0x6BC6, 0x1188, 0x6BC7, 0x2B8F, 0x6BC8, 0x2B8E, 0x6BC9, 0x2F40,
+ 0x6BCA, 0x3421, 0x6BCB, 0x02E1, 0x6BCC, 0x178B, 0x6BCD, 0x034E,
+ 0x6BCF, 0x04CA, 0x6BD0, 0x18AD, 0x6BD2, 0x076D, 0x6BD3, 0x0E4E,
+ 0x6BD4, 0x02E2, 0x6BD6, 0x1B41, 0x6BD7, 0x076E, 0x6BD8, 0x1B42,
+ 0x6BDA, 0x13F2, 0x6BDB, 0x02E3, 0x6BDE, 0x19CC, 0x6BE0, 0x1B43,
+ 0x6BE2, 0x1CF2, 0x6BE3, 0x1CF1, 0x6BE4, 0x1CEF, 0x6BE6, 0x1CEE,
+ 0x6BE7, 0x1CF3, 0x6BE8, 0x1CF0, 0x6BEB, 0x0AE9, 0x6BEC, 0x0AEA,
+ 0x6BEF, 0x0CA1, 0x6BF0, 0x21BB, 0x6BF2, 0x21BC, 0x6BF3, 0x21BD,
+ 0x6BF7, 0x244C, 0x6BF8, 0x244D, 0x6BF9, 0x244B, 0x6BFB, 0x2449,
+ 0x6BFC, 0x244A, 0x6BFD, 0x0E4F, 0x6BFE, 0x26EA, 0x6BFF, 0x292B,
+ 0x6C00, 0x292A, 0x6C01, 0x2929, 0x6C02, 0x292C, 0x6C03, 0x2B91,
+ 0x6C04, 0x2B90, 0x6C05, 0x12DE, 0x6C06, 0x2B92, 0x6C08, 0x13F3,
+ 0x6C09, 0x2D8C, 0x6C0B, 0x2F41, 0x6C0C, 0x30A9, 0x6C0D, 0x3388,
+ 0x6C0F, 0x02E4, 0x6C10, 0x0350, 0x6C11, 0x034F, 0x6C13, 0x061E,
+ 0x6C14, 0x178C, 0x6C15, 0x17AA, 0x6C16, 0x03E6, 0x6C18, 0x1801,
+ 0x6C19, 0x18AE, 0x6C1A, 0x18AF, 0x6C1B, 0x061F, 0x6C1D, 0x19CD,
+ 0x6C1F, 0x076F, 0x6C20, 0x1B44, 0x6C21, 0x1B45, 0x6C23, 0x0902,
+ 0x6C24, 0x0906, 0x6C25, 0x1CF4, 0x6C26, 0x0905, 0x6C27, 0x0903,
+ 0x6C28, 0x0904, 0x6C2A, 0x1F44, 0x6C2B, 0x0AEB, 0x6C2C, 0x0CA4,
+ 0x6C2E, 0x0CA2, 0x6C2F, 0x0CA3, 0x6C30, 0x21BE, 0x6C33, 0x1003,
+ 0x6C34, 0x02E5, 0x6C36, 0x17AB, 0x6C38, 0x0351, 0x6C3B, 0x17AE,
+ 0x6C3E, 0x0354, 0x6C3F, 0x17AD, 0x6C40, 0x0353, 0x6C41, 0x0352,
+ 0x6C42, 0x04CB, 0x6C43, 0x17AC, 0x6C46, 0x1802, 0x6C4A, 0x1806,
+ 0x6C4B, 0x1808, 0x6C4C, 0x1809, 0x6C4D, 0x03F0, 0x6C4E, 0x03F1,
+ 0x6C4F, 0x1805, 0x6C50, 0x03EC, 0x6C52, 0x1803, 0x6C54, 0x1807,
+ 0x6C55, 0x03ED, 0x6C57, 0x03E8, 0x6C59, 0x03E9, 0x6C5B, 0x03EF,
+ 0x6C5C, 0x1804, 0x6C5D, 0x03E7, 0x6C5E, 0x04CC, 0x6C5F, 0x03EA,
+ 0x6C60, 0x03EB, 0x6C61, 0x03EE, 0x6C65, 0x18C0, 0x6C66, 0x18BE,
+ 0x6C67, 0x18B1, 0x6C68, 0x04D8, 0x6C69, 0x18B8, 0x6C6A, 0x04D3,
+ 0x6C6B, 0x18B2, 0x6C6D, 0x18BA, 0x6C6F, 0x18B7, 0x6C70, 0x04D6,
+ 0x6C71, 0x18B6, 0x6C72, 0x04DD, 0x6C73, 0x18BF, 0x6C74, 0x04DF,
+ 0x6C76, 0x04E1, 0x6C78, 0x18B0, 0x6C7A, 0x04D4, 0x6C7B, 0x18C1,
+ 0x6C7D, 0x04DB, 0x6C7E, 0x04DE, 0x6C80, 0x19E4, 0x6C81, 0x04CE,
+ 0x6C82, 0x04E5, 0x6C83, 0x04DC, 0x6C84, 0x18B3, 0x6C85, 0x04D1,
+ 0x6C86, 0x04E0, 0x6C87, 0x18BB, 0x6C88, 0x04CF, 0x6C89, 0x04D0,
+ 0x6C8A, 0x19E2, 0x6C8B, 0x18B4, 0x6C8C, 0x04D7, 0x6C8D, 0x04E2,
+ 0x6C8E, 0x18C2, 0x6C8F, 0x18B5, 0x6C90, 0x04D5, 0x6C92, 0x04DA,
+ 0x6C93, 0x19CE, 0x6C94, 0x04E3, 0x6C95, 0x18BC, 0x6C96, 0x04D9,
+ 0x6C98, 0x04E4, 0x6C99, 0x04CD, 0x6C9A, 0x18B9, 0x6C9B, 0x04D2,
+ 0x6C9C, 0x18BD, 0x6C9D, 0x19E3, 0x6CAB, 0x062B, 0x6CAC, 0x063B,
+ 0x6CAD, 0x19D5, 0x6CAE, 0x0632, 0x6CB0, 0x19EA, 0x6CB1, 0x0623,
+ 0x6CB3, 0x0626, 0x6CB4, 0x19E1, 0x6CB6, 0x19D3, 0x6CB7, 0x19D7,
+ 0x6CB8, 0x062E, 0x6CB9, 0x0630, 0x6CBA, 0x19DA, 0x6CBB, 0x0637,
+ 0x6CBC, 0x0629, 0x6CBD, 0x0627, 0x6CBE, 0x0628, 0x6CBF, 0x0636,
+ 0x6CC0, 0x19E6, 0x6CC1, 0x0631, 0x6CC2, 0x19D9, 0x6CC3, 0x19DB,
+ 0x6CC4, 0x062F, 0x6CC5, 0x0634, 0x6CC6, 0x19DC, 0x6CC7, 0x19E9,
+ 0x6CC9, 0x0770, 0x6CCA, 0x063A, 0x6CCC, 0x0624, 0x6CCD, 0x19E8,
+ 0x6CCF, 0x19EC, 0x6CD0, 0x19D8, 0x6CD1, 0x19EE, 0x6CD2, 0x19DF,
+ 0x6CD3, 0x062D, 0x6CD4, 0x19D4, 0x6CD5, 0x062C, 0x6CD6, 0x063E,
+ 0x6CD7, 0x0633, 0x6CD9, 0x19D2, 0x6CDA, 0x1B4E, 0x6CDB, 0x0639,
+ 0x6CDC, 0x063D, 0x6CDD, 0x19E0, 0x6CDE, 0x19E5, 0x6CE0, 0x063F,
+ 0x6CE1, 0x0638, 0x6CE2, 0x062A, 0x6CE3, 0x0620, 0x6CE5, 0x0625,
+ 0x6CE7, 0x19D6, 0x6CE8, 0x0621, 0x6CE9, 0x19ED, 0x6CEB, 0x19D0,
+ 0x6CEC, 0x19CF, 0x6CED, 0x19DD, 0x6CEE, 0x19D1, 0x6CEF, 0x063C,
+ 0x6CF0, 0x0907, 0x6CF1, 0x0635, 0x6CF2, 0x19DE, 0x6CF3, 0x0622,
+ 0x6CF5, 0x077F, 0x6CF9, 0x19EB, 0x6D00, 0x1B55, 0x6D01, 0x1B58,
+ 0x6D03, 0x1B5B, 0x6D04, 0x1B50, 0x6D07, 0x1B5E, 0x6D08, 0x1B61,
+ 0x6D09, 0x1B63, 0x6D0A, 0x1B4D, 0x6D0B, 0x0771, 0x6D0C, 0x0776,
+ 0x6D0D, 0x1CF9, 0x6D0E, 0x0786, 0x6D0F, 0x1B5C, 0x6D10, 0x1B64,
+ 0x6D11, 0x1B54, 0x6D12, 0x1B4C, 0x6D16, 0x1D14, 0x6D17, 0x0779,
+ 0x6D18, 0x1B59, 0x6D19, 0x1B51, 0x6D1A, 0x1B53, 0x6D1B, 0x077E,
+ 0x6D1D, 0x1B56, 0x6D1E, 0x0778, 0x6D1F, 0x1B49, 0x6D20, 0x1B5F,
+ 0x6D22, 0x1B62, 0x6D25, 0x0775, 0x6D27, 0x0781, 0x6D28, 0x1B46,
+ 0x6D29, 0x0783, 0x6D2A, 0x0773, 0x6D2B, 0x0787, 0x6D2C, 0x1B60,
+ 0x6D2D, 0x1B48, 0x6D2E, 0x0784, 0x6D2F, 0x1D0E, 0x6D30, 0x19E7,
+ 0x6D31, 0x0777, 0x6D32, 0x0772, 0x6D33, 0x1B4F, 0x6D34, 0x1B47,
+ 0x6D35, 0x0785, 0x6D36, 0x077D, 0x6D37, 0x1B5A, 0x6D38, 0x0782,
+ 0x6D39, 0x0780, 0x6D3A, 0x1B52, 0x6D3B, 0x077A, 0x6D3C, 0x1B4A,
+ 0x6D3D, 0x077B, 0x6D3E, 0x077C, 0x6D3F, 0x1B4B, 0x6D40, 0x1B5D,
+ 0x6D41, 0x0774, 0x6D42, 0x1B57, 0x6D58, 0x1CFC, 0x6D59, 0x090F,
+ 0x6D5A, 0x0914, 0x6D5E, 0x1D05, 0x6D5F, 0x1D0B, 0x6D60, 0x1D07,
+ 0x6D61, 0x1CFA, 0x6D62, 0x1CFD, 0x6D63, 0x1CF6, 0x6D64, 0x1CF7,
+ 0x6D65, 0x091B, 0x6D66, 0x090C, 0x6D67, 0x1D06, 0x6D68, 0x1D0F,
+ 0x6D69, 0x0916, 0x6D6A, 0x0908, 0x6D6C, 0x0911, 0x6D6D, 0x1CFE,
+ 0x6D6E, 0x0913, 0x6D6F, 0x1CFF, 0x6D70, 0x1D09, 0x6D74, 0x0915,
+ 0x6D75, 0x1D18, 0x6D76, 0x1CF8, 0x6D77, 0x090E, 0x6D78, 0x090D,
+ 0x6D79, 0x0919, 0x6D7A, 0x1CF5, 0x6D7B, 0x1D16, 0x6D7C, 0x1D0A,
+ 0x6D7D, 0x1D17, 0x6D7E, 0x1D11, 0x6D7F, 0x1D03, 0x6D80, 0x1D12,
+ 0x6D82, 0x1D0C, 0x6D83, 0x1D15, 0x6D84, 0x1D13, 0x6D85, 0x091A,
+ 0x6D86, 0x1D04, 0x6D87, 0x090B, 0x6D88, 0x090A, 0x6D89, 0x0912,
+ 0x6D8A, 0x0918, 0x6D8B, 0x1D10, 0x6D8C, 0x0917, 0x6D8D, 0x1D01,
+ 0x6D8E, 0x0AEC, 0x6D90, 0x1D19, 0x6D91, 0x1D00, 0x6D92, 0x1CFB,
+ 0x6D93, 0x0910, 0x6D94, 0x091C, 0x6D95, 0x0909, 0x6D97, 0x1D08,
+ 0x6D98, 0x1D0D, 0x6DAA, 0x0B0E, 0x6DAB, 0x1F46, 0x6DAC, 0x1F4A,
+ 0x6DAE, 0x0AFB, 0x6DAF, 0x0AF9, 0x6DB2, 0x0AF0, 0x6DB3, 0x1F48,
+ 0x6DB4, 0x1F47, 0x6DB5, 0x0B04, 0x6DB7, 0x1F4D, 0x6DB8, 0x0AFE,
+ 0x6DBA, 0x1F5F, 0x6DBB, 0x1F6B, 0x6DBC, 0x0AED, 0x6DBD, 0x1F5C,
+ 0x6DBE, 0x1F55, 0x6DBF, 0x0B10, 0x6DC0, 0x1F45, 0x6DC2, 0x1F61,
+ 0x6DC4, 0x0B0D, 0x6DC5, 0x0B01, 0x6DC6, 0x0B0C, 0x6DC7, 0x0AF7,
+ 0x6DC8, 0x1F51, 0x6DC9, 0x1F63, 0x6DCA, 0x1F5B, 0x6DCB, 0x0AF8,
+ 0x6DCC, 0x0AF2, 0x6DCD, 0x1F69, 0x6DCF, 0x1F62, 0x6DD0, 0x1F64,
+ 0x6DD1, 0x0AFA, 0x6DD2, 0x0B02, 0x6DD3, 0x1F66, 0x6DD4, 0x1F4F,
+ 0x6DD5, 0x1F60, 0x6DD6, 0x1F54, 0x6DD7, 0x1F68, 0x6DD8, 0x0B07,
+ 0x6DD9, 0x0AEF, 0x6DDA, 0x0B05, 0x6DDB, 0x1F59, 0x6DDC, 0x1F57,
+ 0x6DDD, 0x1F58, 0x6DDE, 0x0AFC, 0x6DDF, 0x1F53, 0x6DE0, 0x1F52,
+ 0x6DE1, 0x0AF1, 0x6DE2, 0x1F4C, 0x6DE3, 0x1F6A, 0x6DE4, 0x0AF3,
+ 0x6DE5, 0x1F56, 0x6DE6, 0x0B11, 0x6DE8, 0x0B0B, 0x6DE9, 0x1F4B,
+ 0x6DEA, 0x0B08, 0x6DEB, 0x0B06, 0x6DEC, 0x0B0F, 0x6DED, 0x1F5D,
+ 0x6DEE, 0x0B0A, 0x6DEF, 0x1D02, 0x6DF0, 0x1F5E, 0x6DF1, 0x0B09,
+ 0x6DF2, 0x1F65, 0x6DF3, 0x0AEE, 0x6DF4, 0x1F5A, 0x6DF5, 0x0B00,
+ 0x6DF6, 0x1F4E, 0x6DF7, 0x0AFF, 0x6DF9, 0x0AFD, 0x6DFA, 0x0AF5,
+ 0x6DFB, 0x0AF4, 0x6DFC, 0x21BF, 0x6DFD, 0x1F67, 0x6E00, 0x1F50,
+ 0x6E03, 0x21D4, 0x6E05, 0x0AF6, 0x6E19, 0x0CC1, 0x6E1A, 0x0B03,
+ 0x6E1B, 0x0CAF, 0x6E1C, 0x21CE, 0x6E1D, 0x0CBD, 0x6E1F, 0x21C2,
+ 0x6E20, 0x0CAC, 0x6E21, 0x0CA8, 0x6E22, 0x21E0, 0x6E23, 0x0CAE,
+ 0x6E24, 0x0CB2, 0x6E25, 0x0CAD, 0x6E26, 0x0CB6, 0x6E27, 0x21E4,
+ 0x6E28, 0x21DB, 0x6E2B, 0x21C9, 0x6E2C, 0x0CBB, 0x6E2D, 0x0CB5,
+ 0x6E2E, 0x21D5, 0x6E2F, 0x0CA5, 0x6E30, 0x21E1, 0x6E31, 0x21DA,
+ 0x6E32, 0x0CA9, 0x6E33, 0x21CF, 0x6E34, 0x0CB8, 0x6E35, 0x21EC,
+ 0x6E36, 0x21ED, 0x6E38, 0x0CA6, 0x6E39, 0x21DF, 0x6E3A, 0x0CBA,
+ 0x6E3B, 0x21D3, 0x6E3C, 0x21C5, 0x6E3D, 0x21C6, 0x6E3E, 0x0CBE,
+ 0x6E3F, 0x21CA, 0x6E40, 0x21D1, 0x6E41, 0x21CB, 0x6E43, 0x0CBC,
+ 0x6E44, 0x0CC4, 0x6E45, 0x21C7, 0x6E46, 0x21C0, 0x6E47, 0x21C1,
+ 0x6E49, 0x21C3, 0x6E4A, 0x0CAB, 0x6E4B, 0x21D0, 0x6E4D, 0x0CB9,
+ 0x6E4E, 0x0CC2, 0x6E51, 0x21D2, 0x6E52, 0x21EA, 0x6E53, 0x21E2,
+ 0x6E54, 0x0CA7, 0x6E55, 0x21E8, 0x6E56, 0x0CB3, 0x6E58, 0x0CB1,
+ 0x6E5A, 0x21EE, 0x6E5B, 0x0CB0, 0x6E5C, 0x21D8, 0x6E5D, 0x21CC,
+ 0x6E5E, 0x21D6, 0x6E5F, 0x0CC7, 0x6E60, 0x21DC, 0x6E61, 0x21D9,
+ 0x6E62, 0x21C8, 0x6E63, 0x0CC3, 0x6E64, 0x21E6, 0x6E65, 0x21E3,
+ 0x6E66, 0x21EB, 0x6E67, 0x0CAA, 0x6E68, 0x21D7, 0x6E69, 0x0CC6,
+ 0x6E6B, 0x21DE, 0x6E6E, 0x0CB4, 0x6E6F, 0x0CB7, 0x6E71, 0x21DD,
+ 0x6E72, 0x0CC5, 0x6E73, 0x21CD, 0x6E74, 0x1F49, 0x6E77, 0x21E7,
+ 0x6E78, 0x21E5, 0x6E79, 0x21E9, 0x6E88, 0x21C4, 0x6E89, 0x0CC0,
+ 0x6E8D, 0x246C, 0x6E8E, 0x246B, 0x6E8F, 0x2451, 0x6E90, 0x0E55,
+ 0x6E92, 0x246A, 0x6E93, 0x2454, 0x6E94, 0x2455, 0x6E96, 0x0E5F,
+ 0x6E97, 0x2473, 0x6E98, 0x0E5A, 0x6E99, 0x2469, 0x6E9B, 0x244E,
+ 0x6E9C, 0x0E60, 0x6E9D, 0x0E56, 0x6E9E, 0x245D, 0x6E9F, 0x2453,
+ 0x6EA0, 0x2456, 0x6EA1, 0x246E, 0x6EA2, 0x0E50, 0x6EA3, 0x2475,
+ 0x6EA4, 0x246D, 0x6EA5, 0x0E59, 0x6EA6, 0x2462, 0x6EA7, 0x0E64,
+ 0x6EAA, 0x0E63, 0x6EAB, 0x0E5D, 0x6EAE, 0x2474, 0x6EAF, 0x0E51,
+ 0x6EB0, 0x2460, 0x6EB1, 0x2457, 0x6EB2, 0x2464, 0x6EB3, 0x2470,
+ 0x6EB4, 0x0E65, 0x6EB6, 0x0E53, 0x6EB7, 0x245F, 0x6EB9, 0x2458,
+ 0x6EBA, 0x0E5C, 0x6EBC, 0x0E5B, 0x6EBD, 0x245B, 0x6EBE, 0x2465,
+ 0x6EBF, 0x246F, 0x6EC0, 0x2452, 0x6EC1, 0x245C, 0x6EC2, 0x0E54,
+ 0x6EC3, 0x2466, 0x6EC4, 0x0E61, 0x6EC5, 0x0E58, 0x6EC6, 0x2459,
+ 0x6EC7, 0x0E57, 0x6EC8, 0x2450, 0x6EC9, 0x245E, 0x6ECA, 0x2472,
+ 0x6ECB, 0x0CBF, 0x6ECC, 0x101F, 0x6ECD, 0x2461, 0x6ECE, 0x26EB,
+ 0x6ECF, 0x2463, 0x6ED0, 0x2471, 0x6ED1, 0x0E5E, 0x6ED2, 0x245A,
+ 0x6ED3, 0x0E52, 0x6ED4, 0x0E62, 0x6ED5, 0x119A, 0x6ED6, 0x244F,
+ 0x6ED8, 0x2468, 0x6EDC, 0x2467, 0x6EEB, 0x2707, 0x6EEC, 0x101C,
+ 0x6EED, 0x26FC, 0x6EEE, 0x2701, 0x6EEF, 0x1011, 0x6EF1, 0x26ED,
+ 0x6EF2, 0x101E, 0x6EF4, 0x1008, 0x6EF5, 0x26EC, 0x6EF6, 0x270D,
+ 0x6EF7, 0x1020, 0x6EF8, 0x26F0, 0x6EF9, 0x2700, 0x6EFB, 0x26F2,
+ 0x6EFC, 0x2710, 0x6EFD, 0x270C, 0x6EFE, 0x1006, 0x6EFF, 0x1010,
+ 0x6F00, 0x2946, 0x6F01, 0x101D, 0x6F02, 0x100E, 0x6F03, 0x26EE,
+ 0x6F05, 0x270B, 0x6F06, 0x1012, 0x6F07, 0x2708, 0x6F08, 0x2715,
+ 0x6F09, 0x26F4, 0x6F0A, 0x26FD, 0x6F0D, 0x2713, 0x6F0E, 0x2709,
+ 0x6F0F, 0x100D, 0x6F12, 0x26FB, 0x6F13, 0x1007, 0x6F14, 0x1005,
+ 0x6F15, 0x1017, 0x6F18, 0x26F9, 0x6F19, 0x26F6, 0x6F1A, 0x26F7,
+ 0x6F1C, 0x270F, 0x6F1E, 0x2714, 0x6F1F, 0x2712, 0x6F20, 0x100B,
+ 0x6F21, 0x2716, 0x6F22, 0x100F, 0x6F23, 0x1016, 0x6F25, 0x26EF,
+ 0x6F26, 0x292E, 0x6F27, 0x26F8, 0x6F29, 0x1009, 0x6F2A, 0x101B,
+ 0x6F2B, 0x1018, 0x6F2C, 0x100C, 0x6F2D, 0x2702, 0x6F2E, 0x26F3,
+ 0x6F2F, 0x1019, 0x6F30, 0x2704, 0x6F31, 0x1013, 0x6F32, 0x1015,
+ 0x6F33, 0x1004, 0x6F35, 0x2706, 0x6F36, 0x26FE, 0x6F37, 0x26F1,
+ 0x6F38, 0x1014, 0x6F39, 0x270E, 0x6F3A, 0x2711, 0x6F3B, 0x26FA,
+ 0x6F3C, 0x2705, 0x6F3E, 0x100A, 0x6F3F, 0x1189, 0x6F40, 0x2703,
+ 0x6F41, 0x292D, 0x6F43, 0x270A, 0x6F4E, 0x26F5, 0x6F4F, 0x2937,
+ 0x6F50, 0x2941, 0x6F51, 0x118C, 0x6F52, 0x2940, 0x6F53, 0x294C,
+ 0x6F54, 0x118E, 0x6F55, 0x293E, 0x6F57, 0x2942, 0x6F58, 0x1199,
+ 0x6F5A, 0x2939, 0x6F5B, 0x1191, 0x6F5D, 0x2945, 0x6F5E, 0x2B9A,
+ 0x6F5F, 0x119D, 0x6F60, 0x119C, 0x6F61, 0x2947, 0x6F62, 0x2936,
+ 0x6F63, 0x2951, 0x6F64, 0x1197, 0x6F66, 0x118D, 0x6F67, 0x294A,
+ 0x6F69, 0x294E, 0x6F6A, 0x2953, 0x6F6B, 0x2948, 0x6F6C, 0x293C,
+ 0x6F6D, 0x1190, 0x6F6E, 0x1193, 0x6F6F, 0x119B, 0x6F70, 0x1196,
+ 0x6F72, 0x293F, 0x6F73, 0x26FF, 0x6F76, 0x293B, 0x6F77, 0x2952,
+ 0x6F78, 0x1192, 0x6F7A, 0x1195, 0x6F7B, 0x2954, 0x6F7C, 0x118A,
+ 0x6F7D, 0x2949, 0x6F7E, 0x292F, 0x6F7F, 0x294F, 0x6F80, 0x13FC,
+ 0x6F82, 0x293D, 0x6F84, 0x118B, 0x6F85, 0x2938, 0x6F86, 0x118F,
+ 0x6F87, 0x2930, 0x6F88, 0x101A, 0x6F89, 0x2934, 0x6F8B, 0x294D,
+ 0x6F8C, 0x2935, 0x6F8D, 0x2933, 0x6F8E, 0x1194, 0x6F90, 0x294B,
+ 0x6F92, 0x2932, 0x6F93, 0x2944, 0x6F94, 0x2943, 0x6F95, 0x2950,
+ 0x6F96, 0x293A, 0x6F97, 0x1198, 0x6F9E, 0x2B9D, 0x6FA0, 0x12EB,
+ 0x6FA1, 0x12E1, 0x6FA2, 0x2BA9, 0x6FA3, 0x2B95, 0x6FA4, 0x12E3,
+ 0x6FA5, 0x2BA1, 0x6FA6, 0x12EA, 0x6FA7, 0x12E5, 0x6FA8, 0x2B9F,
+ 0x6FA9, 0x2D8E, 0x6FAA, 0x2BA5, 0x6FAB, 0x2BAB, 0x6FAC, 0x2BA4,
+ 0x6FAD, 0x2B93, 0x6FAE, 0x2BA2, 0x6FAF, 0x2BAD, 0x6FB0, 0x2BAF,
+ 0x6FB1, 0x12E0, 0x6FB2, 0x2BAE, 0x6FB3, 0x12E6, 0x6FB4, 0x12EC,
+ 0x6FB6, 0x12E9, 0x6FB8, 0x2BA8, 0x6FB9, 0x12E8, 0x6FBA, 0x2BA3,
+ 0x6FBC, 0x2B97, 0x6FBD, 0x2B9C, 0x6FBF, 0x2BA7, 0x6FC0, 0x12E7,
+ 0x6FC1, 0x12E4, 0x6FC2, 0x12DF, 0x6FC3, 0x12E2, 0x6FC4, 0x2B9B,
+ 0x6FC6, 0x2931, 0x6FC7, 0x2B96, 0x6FC8, 0x2B99, 0x6FC9, 0x2BAA,
+ 0x6FCA, 0x2B9E, 0x6FCB, 0x2B94, 0x6FCC, 0x2D8D, 0x6FCD, 0x2BAC,
+ 0x6FCE, 0x2B98, 0x6FCF, 0x2BA6, 0x6FD4, 0x2D90, 0x6FD5, 0x1400,
+ 0x6FD8, 0x13F4, 0x6FDB, 0x13F8, 0x6FDC, 0x2D92, 0x6FDD, 0x2D98,
+ 0x6FDE, 0x2D96, 0x6FDF, 0x13F6, 0x6FE0, 0x13F7, 0x6FE1, 0x13FE,
+ 0x6FE2, 0x2D99, 0x6FE3, 0x2D91, 0x6FE4, 0x13F9, 0x6FE6, 0x2D95,
+ 0x6FE7, 0x2D94, 0x6FE8, 0x2D9A, 0x6FE9, 0x13FF, 0x6FEB, 0x13FA,
+ 0x6FEC, 0x13FD, 0x6FED, 0x2D93, 0x6FEE, 0x1401, 0x6FEF, 0x13FB,
+ 0x6FF0, 0x1402, 0x6FF1, 0x13F5, 0x6FF2, 0x2D97, 0x6FF4, 0x2D8F,
+ 0x6FF7, 0x2F4E, 0x6FFA, 0x14EB, 0x6FFB, 0x2F4B, 0x6FFC, 0x2F4D,
+ 0x6FFE, 0x14E9, 0x6FFF, 0x2F49, 0x7000, 0x2F4A, 0x7001, 0x2F45,
+ 0x7004, 0x2BA0, 0x7005, 0x2F46, 0x7006, 0x14EA, 0x7007, 0x2F42,
+ 0x7009, 0x14E7, 0x700A, 0x2F4F, 0x700B, 0x14E8, 0x700C, 0x2F43,
+ 0x700D, 0x2F44, 0x700E, 0x2F48, 0x700F, 0x14ED, 0x7011, 0x14EC,
+ 0x7014, 0x2F47, 0x7015, 0x158F, 0x7016, 0x30AD, 0x7017, 0x30B3,
+ 0x7018, 0x1590, 0x7019, 0x30AA, 0x701A, 0x158D, 0x701B, 0x158A,
+ 0x701C, 0x30B5, 0x701D, 0x158E, 0x701F, 0x158B, 0x7020, 0x30AC,
+ 0x7021, 0x30AF, 0x7022, 0x30B0, 0x7023, 0x30B1, 0x7024, 0x30B4,
+ 0x7026, 0x2F4C, 0x7027, 0x30AB, 0x7028, 0x158C, 0x7029, 0x30B2,
+ 0x702A, 0x31EF, 0x702B, 0x30AE, 0x702F, 0x31E6, 0x7030, 0x161D,
+ 0x7031, 0x31E9, 0x7032, 0x161E, 0x7033, 0x31F2, 0x7034, 0x31E8,
+ 0x7035, 0x31E5, 0x7037, 0x31E7, 0x7038, 0x31EB, 0x7039, 0x31EE,
+ 0x703A, 0x31ED, 0x703B, 0x31F1, 0x703C, 0x31E4, 0x703E, 0x161C,
+ 0x703F, 0x31EC, 0x7040, 0x31F0, 0x7041, 0x31F3, 0x7042, 0x31EA,
+ 0x7043, 0x32D8, 0x7044, 0x32D9, 0x7045, 0x32DD, 0x7046, 0x32DE,
+ 0x7048, 0x32DB, 0x7049, 0x32DC, 0x704A, 0x32DA, 0x704C, 0x167A,
+ 0x7051, 0x16C8, 0x7052, 0x338C, 0x7055, 0x3389, 0x7056, 0x338A,
+ 0x7057, 0x338B, 0x7058, 0x16C9, 0x705A, 0x3423, 0x705B, 0x3422,
+ 0x705D, 0x348A, 0x705E, 0x1722, 0x705F, 0x3488, 0x7060, 0x348B,
+ 0x7061, 0x3489, 0x7062, 0x34D0, 0x7063, 0x1744, 0x7064, 0x1752,
+ 0x7065, 0x351C, 0x7066, 0x3506, 0x7068, 0x351B, 0x7069, 0x3547,
+ 0x706A, 0x3548, 0x706B, 0x02E6, 0x7070, 0x03F2, 0x7071, 0x180A,
+ 0x7074, 0x18C3, 0x7076, 0x04E6, 0x7078, 0x04E9, 0x707A, 0x18C4,
+ 0x707C, 0x04E7, 0x707D, 0x04E8, 0x7082, 0x19F7, 0x7083, 0x19F9,
+ 0x7084, 0x19F4, 0x7085, 0x19F1, 0x7086, 0x19F3, 0x708A, 0x0643,
+ 0x708E, 0x0641, 0x7091, 0x19F5, 0x7092, 0x0642, 0x7093, 0x19F2,
+ 0x7094, 0x19EF, 0x7095, 0x0640, 0x7096, 0x19F6, 0x7098, 0x19F0,
+ 0x7099, 0x0644, 0x709A, 0x19F8, 0x709F, 0x1B66, 0x70A1, 0x1B6A,
+ 0x70A4, 0x0790, 0x70A9, 0x1B6D, 0x70AB, 0x0788, 0x70AC, 0x078B,
+ 0x70AD, 0x078D, 0x70AE, 0x078F, 0x70AF, 0x078C, 0x70B0, 0x1B69,
+ 0x70B1, 0x1B68, 0x70B3, 0x078A, 0x70B4, 0x1B6B, 0x70B5, 0x1B6C,
+ 0x70B7, 0x1B65, 0x70B8, 0x078E, 0x70BA, 0x0789, 0x70BE, 0x1B67,
+ 0x70C5, 0x1D27, 0x70C6, 0x1D28, 0x70C7, 0x1D29, 0x70C8, 0x0921,
+ 0x70CA, 0x091D, 0x70CB, 0x1D1E, 0x70CD, 0x1D26, 0x70CE, 0x1D2B,
+ 0x70CF, 0x0922, 0x70D1, 0x1D1C, 0x70D2, 0x1D22, 0x70D3, 0x1D1B,
+ 0x70D4, 0x1D25, 0x70D7, 0x1D21, 0x70D8, 0x091E, 0x70D9, 0x0920,
+ 0x70DA, 0x1D2A, 0x70DC, 0x1D1A, 0x70DD, 0x1D1D, 0x70DE, 0x1D23,
+ 0x70E0, 0x1D24, 0x70E1, 0x1D2C, 0x70E2, 0x1D20, 0x70E4, 0x091F,
+ 0x70EF, 0x0B16, 0x70F0, 0x1F72, 0x70F3, 0x1F74, 0x70F4, 0x1F70,
+ 0x70F6, 0x1F7C, 0x70F7, 0x1F6E, 0x70F8, 0x1F7B, 0x70F9, 0x0B12,
+ 0x70FA, 0x1F6C, 0x70FB, 0x21F2, 0x70FC, 0x1F76, 0x70FD, 0x0B15,
+ 0x70FF, 0x1F77, 0x7100, 0x1F7A, 0x7102, 0x1F7E, 0x7104, 0x1F73,
+ 0x7106, 0x1F78, 0x7109, 0x0B13, 0x710A, 0x0B14, 0x710B, 0x1F7D,
+ 0x710C, 0x1F71, 0x710D, 0x1F6D, 0x710E, 0x1F7F, 0x7110, 0x1F75,
+ 0x7113, 0x1F79, 0x7117, 0x1F6F, 0x7119, 0x0CC8, 0x711A, 0x0CC9,
+ 0x711B, 0x21FC, 0x711C, 0x0CCF, 0x711E, 0x21F0, 0x711F, 0x21F9,
+ 0x7120, 0x21EF, 0x7121, 0x0CCC, 0x7122, 0x21F7, 0x7123, 0x21F5,
+ 0x7125, 0x21F6, 0x7126, 0x0CCA, 0x7128, 0x21FA, 0x712E, 0x21F3,
+ 0x712F, 0x21F1, 0x7130, 0x0CCB, 0x7131, 0x21F4, 0x7132, 0x21F8,
+ 0x7136, 0x0CCD, 0x713A, 0x21FB, 0x7141, 0x247B, 0x7142, 0x2482,
+ 0x7143, 0x2484, 0x7144, 0x248A, 0x7146, 0x0E72, 0x7147, 0x2476,
+ 0x7149, 0x0E6A, 0x714B, 0x2485, 0x714C, 0x0E6F, 0x714D, 0x248B,
+ 0x714E, 0x0E66, 0x7150, 0x2488, 0x7152, 0x2478, 0x7153, 0x2489,
+ 0x7154, 0x2477, 0x7156, 0x0E74, 0x7158, 0x2483, 0x7159, 0x0E67,
+ 0x715A, 0x248C, 0x715C, 0x0E6C, 0x715D, 0x247C, 0x715E, 0x0E71,
+ 0x715F, 0x2487, 0x7160, 0x247A, 0x7161, 0x2481, 0x7162, 0x247D,
+ 0x7163, 0x2479, 0x7164, 0x0E69, 0x7165, 0x0E70, 0x7166, 0x0E6E,
+ 0x7167, 0x0E6B, 0x7168, 0x0E73, 0x7169, 0x0E68, 0x716A, 0x2480,
+ 0x716C, 0x0E6D, 0x716E, 0x0CCE, 0x7170, 0x2486, 0x7172, 0x247E,
+ 0x7178, 0x247F, 0x717B, 0x271E, 0x717D, 0x1023, 0x7180, 0x271A,
+ 0x7181, 0x2720, 0x7182, 0x271C, 0x7184, 0x1025, 0x7185, 0x271B,
+ 0x7186, 0x271F, 0x7187, 0x2717, 0x7189, 0x2719, 0x718A, 0x1024,
+ 0x718F, 0x271D, 0x7190, 0x2718, 0x7192, 0x1026, 0x7194, 0x1021,
+ 0x7197, 0x2721, 0x7199, 0x1022, 0x719A, 0x295A, 0x719B, 0x2957,
+ 0x719C, 0x2963, 0x719D, 0x295D, 0x719E, 0x295F, 0x719F, 0x119E,
+ 0x71A0, 0x2959, 0x71A1, 0x2961, 0x71A4, 0x2960, 0x71A5, 0x295E,
+ 0x71A7, 0x2964, 0x71A8, 0x11A1, 0x71A9, 0x295B, 0x71AA, 0x2962,
+ 0x71AC, 0x119F, 0x71AF, 0x2956, 0x71B0, 0x2958, 0x71B1, 0x11A0,
+ 0x71B2, 0x2955, 0x71B3, 0x2965, 0x71B5, 0x295C, 0x71B8, 0x2BB3,
+ 0x71B9, 0x12F3, 0x71BC, 0x2BBE, 0x71BD, 0x2BBC, 0x71BE, 0x12ED,
+ 0x71BF, 0x2BB2, 0x71C0, 0x2BB5, 0x71C1, 0x2BB6, 0x71C2, 0x2BB1,
+ 0x71C3, 0x12F7, 0x71C4, 0x12F8, 0x71C5, 0x2BB0, 0x71C6, 0x2BBF,
+ 0x71C7, 0x2BBA, 0x71C8, 0x12F1, 0x71C9, 0x12EE, 0x71CA, 0x2BB9,
+ 0x71CB, 0x2BB7, 0x71CE, 0x12F4, 0x71CF, 0x2BBB, 0x71D0, 0x12EF,
+ 0x71D2, 0x12F0, 0x71D4, 0x2BB8, 0x71D5, 0x12F2, 0x71D6, 0x2BB4,
+ 0x71D8, 0x2BBD, 0x71D9, 0x12F5, 0x71DA, 0x2BC0, 0x71DB, 0x2BC1,
+ 0x71DC, 0x12F6, 0x71DF, 0x1404, 0x71E0, 0x140B, 0x71E1, 0x2D9B,
+ 0x71E2, 0x2DA1, 0x71E4, 0x2D9F, 0x71E5, 0x1407, 0x71E6, 0x1406,
+ 0x71E7, 0x1403, 0x71E8, 0x2D9D, 0x71EC, 0x1409, 0x71ED, 0x1408,
+ 0x71EE, 0x1405, 0x71F0, 0x2DA0, 0x71F1, 0x2D9C, 0x71F2, 0x2D9E,
+ 0x71F4, 0x140A, 0x71F8, 0x14F1, 0x71F9, 0x2F52, 0x71FB, 0x14EE,
+ 0x71FC, 0x14EF, 0x71FD, 0x2F54, 0x71FE, 0x14F0, 0x71FF, 0x2F51,
+ 0x7201, 0x2F50, 0x7202, 0x30B9, 0x7203, 0x2F53, 0x7205, 0x30BA,
+ 0x7206, 0x1591, 0x7207, 0x30B8, 0x720A, 0x30B7, 0x720C, 0x30B6,
+ 0x720D, 0x1592, 0x7210, 0x161F, 0x7213, 0x31F4, 0x7214, 0x31F5,
+ 0x7219, 0x32E1, 0x721A, 0x32E0, 0x721B, 0x167B, 0x721D, 0x32DF,
+ 0x721E, 0x338D, 0x721F, 0x338E, 0x7222, 0x3424, 0x7223, 0x348C,
+ 0x7226, 0x34D1, 0x7227, 0x3535, 0x7228, 0x1766, 0x7229, 0x3549,
+ 0x722A, 0x02E7, 0x722C, 0x0645, 0x722D, 0x0646, 0x7230, 0x0791,
+ 0x7235, 0x140C, 0x7236, 0x02E8, 0x7238, 0x0647, 0x7239, 0x0923,
+ 0x723A, 0x0E75, 0x723B, 0x02E9, 0x723D, 0x0B17, 0x723E, 0x1027,
+ 0x723F, 0x178D, 0x7241, 0x1B6E, 0x7242, 0x1D2D, 0x7244, 0x2722,
+ 0x7246, 0x140D, 0x7247, 0x02EA, 0x7248, 0x0648, 0x7249, 0x1B6F,
+ 0x724A, 0x1B70, 0x724B, 0x21FD, 0x724C, 0x0CD0, 0x724F, 0x248D,
+ 0x7252, 0x0E76, 0x7253, 0x2723, 0x7256, 0x11A2, 0x7258, 0x1593,
+ 0x7259, 0x02EB, 0x725A, 0x21FE, 0x725B, 0x02EC, 0x725D, 0x03F4,
+ 0x725E, 0x180B, 0x725F, 0x03F3, 0x7260, 0x04EC, 0x7261, 0x04EB,
+ 0x7262, 0x04EA, 0x7263, 0x18C5, 0x7267, 0x0649, 0x7269, 0x064A,
+ 0x726A, 0x19FA, 0x726C, 0x1B71, 0x726E, 0x1B74, 0x726F, 0x0793,
+ 0x7270, 0x1B72, 0x7272, 0x0792, 0x7273, 0x1B73, 0x7274, 0x0794,
+ 0x7276, 0x1D30, 0x7277, 0x1D2F, 0x7278, 0x1D2E, 0x7279, 0x0924,
+ 0x727B, 0x1F81, 0x727C, 0x1F82, 0x727D, 0x0B18, 0x727E, 0x1F80,
+ 0x727F, 0x1F83, 0x7280, 0x0CD2, 0x7281, 0x0B19, 0x7284, 0x0CD1,
+ 0x7285, 0x2202, 0x7286, 0x2201, 0x7288, 0x21FF, 0x7289, 0x2200,
+ 0x728B, 0x2203, 0x728C, 0x248F, 0x728D, 0x248E, 0x728E, 0x2492,
+ 0x7290, 0x2491, 0x7291, 0x2490, 0x7292, 0x1028, 0x7293, 0x2726,
+ 0x7295, 0x2725, 0x7296, 0x1029, 0x7297, 0x2724, 0x7298, 0x2966,
+ 0x729A, 0x2967, 0x729B, 0x11A3, 0x729D, 0x2BC2, 0x729E, 0x2BC3,
+ 0x72A1, 0x30BF, 0x72A2, 0x1594, 0x72A3, 0x30BE, 0x72A4, 0x30BD,
+ 0x72A5, 0x30BB, 0x72A6, 0x30BC, 0x72A7, 0x167C, 0x72A8, 0x31F6,
+ 0x72A9, 0x338F, 0x72AA, 0x34D2, 0x72AC, 0x02ED, 0x72AE, 0x17AF,
+ 0x72AF, 0x0355, 0x72B0, 0x17B0, 0x72B4, 0x180C, 0x72B5, 0x180D,
+ 0x72BA, 0x18CB, 0x72BD, 0x18C7, 0x72BF, 0x18C6, 0x72C0, 0x064B,
+ 0x72C1, 0x18CA, 0x72C2, 0x04EE, 0x72C3, 0x18C8, 0x72C4, 0x04ED,
+ 0x72C5, 0x18CC, 0x72C6, 0x18C9, 0x72C9, 0x19FE, 0x72CA, 0x1B75,
+ 0x72CB, 0x19FC, 0x72CC, 0x1A03, 0x72CE, 0x064C, 0x72D0, 0x064F,
+ 0x72D1, 0x1A04, 0x72D2, 0x1A00, 0x72D4, 0x1A01, 0x72D6, 0x19FB,
+ 0x72D7, 0x064E, 0x72D8, 0x19FD, 0x72D9, 0x064D, 0x72DA, 0x1A02,
+ 0x72DC, 0x19FF, 0x72DF, 0x1B79, 0x72E0, 0x0796, 0x72E1, 0x0797,
+ 0x72E3, 0x1B7C, 0x72E4, 0x1B76, 0x72E6, 0x1B7B, 0x72E8, 0x1B77,
+ 0x72E9, 0x0795, 0x72EA, 0x1B7A, 0x72EB, 0x1B78, 0x72F3, 0x1D36,
+ 0x72F4, 0x1D33, 0x72F6, 0x1D35, 0x72F7, 0x0929, 0x72F8, 0x0928,
+ 0x72F9, 0x0926, 0x72FA, 0x1D32, 0x72FB, 0x1D37, 0x72FC, 0x0925,
+ 0x72FD, 0x0927, 0x72FE, 0x1D34, 0x72FF, 0x1F8B, 0x7300, 0x1D31,
+ 0x7301, 0x1D38, 0x7307, 0x1F86, 0x7308, 0x1F8A, 0x730A, 0x1F89,
+ 0x730B, 0x2205, 0x730C, 0x2210, 0x730F, 0x1F8C, 0x7311, 0x1F87,
+ 0x7312, 0x2204, 0x7313, 0x0B1D, 0x7316, 0x0B1C, 0x7317, 0x1F85,
+ 0x7318, 0x1F88, 0x7319, 0x0B1E, 0x731B, 0x0B1B, 0x731C, 0x0B1A,
+ 0x731D, 0x1F84, 0x731E, 0x1F8D, 0x7322, 0x2207, 0x7323, 0x220E,
+ 0x7325, 0x0CD4, 0x7326, 0x220D, 0x7327, 0x220A, 0x7329, 0x0CD6,
+ 0x732D, 0x220C, 0x7330, 0x2206, 0x7331, 0x2208, 0x7332, 0x220B,
+ 0x7333, 0x2209, 0x7334, 0x0CD5, 0x7335, 0x220F, 0x7336, 0x0CD3,
+ 0x7337, 0x0E77, 0x733A, 0x2496, 0x733B, 0x2495, 0x733C, 0x2493,
+ 0x733E, 0x0E7A, 0x733F, 0x0E79, 0x7340, 0x2497, 0x7342, 0x2494,
+ 0x7343, 0x2727, 0x7344, 0x102A, 0x7345, 0x0E78, 0x7349, 0x2499,
+ 0x734A, 0x2498, 0x734C, 0x272A, 0x734D, 0x2728, 0x734E, 0x11A4,
+ 0x7350, 0x102B, 0x7351, 0x2729, 0x7352, 0x2969, 0x7357, 0x11A5,
+ 0x7358, 0x2968, 0x7359, 0x2971, 0x735A, 0x2970, 0x735B, 0x296E,
+ 0x735D, 0x296D, 0x735E, 0x296A, 0x735F, 0x296B, 0x7360, 0x296C,
+ 0x7361, 0x296F, 0x7362, 0x2972, 0x7365, 0x2BC8, 0x7366, 0x2BC5,
+ 0x7367, 0x2BC6, 0x7368, 0x12F9, 0x7369, 0x2BC4, 0x736A, 0x2BCA,
+ 0x736B, 0x2BC9, 0x736C, 0x2BC7, 0x736E, 0x2DA3, 0x736F, 0x2DA4,
+ 0x7370, 0x140E, 0x7372, 0x140F, 0x7373, 0x2DA2, 0x7375, 0x14F3,
+ 0x7376, 0x2F55, 0x7377, 0x14F2, 0x7378, 0x1595, 0x737A, 0x1596,
+ 0x737B, 0x1620, 0x737C, 0x31F8, 0x737D, 0x31F7, 0x737E, 0x32E2,
+ 0x737F, 0x3390, 0x7380, 0x16CA, 0x7381, 0x3426, 0x7382, 0x3425,
+ 0x7383, 0x3427, 0x7384, 0x0356, 0x7385, 0x1B7D, 0x7386, 0x092A,
+ 0x7387, 0x0B1F, 0x7388, 0x1F8E, 0x7389, 0x0357, 0x738A, 0x17B1,
+ 0x738B, 0x02EE, 0x738E, 0x180E, 0x7392, 0x18D1, 0x7393, 0x18CF,
+ 0x7394, 0x18D0, 0x7395, 0x18CD, 0x7396, 0x04EF, 0x7397, 0x18CE,
+ 0x739D, 0x1A0C, 0x739F, 0x0652, 0x73A0, 0x1A0A, 0x73A1, 0x1A06,
+ 0x73A2, 0x1A09, 0x73A4, 0x1A05, 0x73A5, 0x0654, 0x73A6, 0x1A08,
+ 0x73A8, 0x0651, 0x73A9, 0x0650, 0x73AB, 0x0653, 0x73AC, 0x1A0B,
+ 0x73AD, 0x1A07, 0x73B2, 0x079B, 0x73B3, 0x079E, 0x73B4, 0x1B85,
+ 0x73B5, 0x1B84, 0x73B6, 0x1B83, 0x73B7, 0x0798, 0x73B8, 0x1B8C,
+ 0x73B9, 0x1B82, 0x73BB, 0x079A, 0x73BC, 0x1D3D, 0x73BE, 0x1B89,
+ 0x73BF, 0x1B87, 0x73C0, 0x079D, 0x73C2, 0x1B7F, 0x73C3, 0x1B8A,
+ 0x73C5, 0x1B81, 0x73C6, 0x1B8B, 0x73C7, 0x1B88, 0x73C8, 0x1B80,
+ 0x73CA, 0x0799, 0x73CB, 0x1B8D, 0x73CC, 0x1B7E, 0x73CD, 0x079C,
+ 0x73D2, 0x1D42, 0x73D3, 0x1D39, 0x73D4, 0x1D44, 0x73D6, 0x1D3C,
+ 0x73D7, 0x1D47, 0x73D8, 0x1D48, 0x73D9, 0x1D3A, 0x73DA, 0x1D46,
+ 0x73DB, 0x1D43, 0x73DC, 0x1D41, 0x73DD, 0x1D45, 0x73DE, 0x0930,
+ 0x73E0, 0x092E, 0x73E3, 0x1D3F, 0x73E5, 0x1D3B, 0x73E7, 0x1D3E,
+ 0x73E8, 0x1D49, 0x73E9, 0x1D40, 0x73EA, 0x092F, 0x73EB, 0x1B86,
+ 0x73ED, 0x092B, 0x73EE, 0x092D, 0x73F4, 0x1F9C, 0x73F5, 0x1F91,
+ 0x73F6, 0x1F8F, 0x73F8, 0x1F90, 0x73FA, 0x1F97, 0x73FC, 0x1F98,
+ 0x73FD, 0x1F94, 0x73FE, 0x0B24, 0x73FF, 0x1F99, 0x7400, 0x1F96,
+ 0x7401, 0x1F93, 0x7403, 0x0B22, 0x7404, 0x1F92, 0x7405, 0x0B20,
+ 0x7406, 0x0B23, 0x7407, 0x1F95, 0x7408, 0x1F9D, 0x7409, 0x092C,
+ 0x740A, 0x0B21, 0x740B, 0x1F9B, 0x740C, 0x1F9A, 0x740D, 0x0B25,
+ 0x7416, 0x2215, 0x741A, 0x2216, 0x741B, 0x0CE0, 0x741D, 0x221C,
+ 0x7420, 0x221E, 0x7421, 0x2217, 0x7422, 0x0CDA, 0x7423, 0x221B,
+ 0x7424, 0x221A, 0x7425, 0x0CDB, 0x7426, 0x0CE1, 0x7428, 0x0CE2,
+ 0x7429, 0x221D, 0x742A, 0x0CD8, 0x742B, 0x2214, 0x742C, 0x2212,
+ 0x742D, 0x2218, 0x742E, 0x2211, 0x742F, 0x0CDF, 0x7430, 0x2213,
+ 0x7431, 0x2219, 0x7432, 0x221F, 0x7433, 0x0CD9, 0x7434, 0x0CDE,
+ 0x7435, 0x0CDC, 0x7436, 0x0CDD, 0x743A, 0x0CD7, 0x743F, 0x0E81,
+ 0x7440, 0x24A0, 0x7441, 0x0E80, 0x7442, 0x24A4, 0x7444, 0x249A,
+ 0x7446, 0x24A5, 0x744A, 0x249B, 0x744B, 0x249C, 0x744D, 0x24A6,
+ 0x744E, 0x24A3, 0x744F, 0x24A1, 0x7450, 0x24A2, 0x7451, 0x249E,
+ 0x7452, 0x249D, 0x7454, 0x24A7, 0x7455, 0x0E7D, 0x7457, 0x249F,
+ 0x7459, 0x0E82, 0x745A, 0x0E7C, 0x745B, 0x0E83, 0x745C, 0x0E84,
+ 0x745E, 0x0E7F, 0x745F, 0x0E7E, 0x7462, 0x272B, 0x7463, 0x102D,
+ 0x7464, 0x102C, 0x7467, 0x2730, 0x7469, 0x11A6, 0x746A, 0x102E,
+ 0x746D, 0x1030, 0x746E, 0x2731, 0x746F, 0x0E7B, 0x7470, 0x102F,
+ 0x7471, 0x272D, 0x7472, 0x272F, 0x7473, 0x272C, 0x7475, 0x272E,
+ 0x7479, 0x297C, 0x747C, 0x297B, 0x747D, 0x2978, 0x747E, 0x11A9,
+ 0x747F, 0x2BCB, 0x7480, 0x11AA, 0x7481, 0x2977, 0x7483, 0x11A8,
+ 0x7485, 0x2979, 0x7486, 0x2976, 0x7487, 0x2973, 0x7488, 0x297A,
+ 0x7489, 0x2974, 0x748A, 0x2975, 0x748B, 0x11A7, 0x7490, 0x2DA8,
+ 0x7492, 0x2BCF, 0x7494, 0x2BCE, 0x7495, 0x2BD0, 0x7497, 0x2DA5,
+ 0x7498, 0x12FC, 0x749A, 0x2BCC, 0x749C, 0x12FA, 0x749E, 0x12FE,
+ 0x749F, 0x12FD, 0x74A0, 0x2BCD, 0x74A1, 0x2BD1, 0x74A3, 0x12FB,
+ 0x74A5, 0x2DAC, 0x74A6, 0x1412, 0x74A7, 0x14F4, 0x74A8, 0x1413,
+ 0x74A9, 0x1410, 0x74AA, 0x2DA9, 0x74AB, 0x2DA7, 0x74AD, 0x2DAA,
+ 0x74AF, 0x2DAD, 0x74B0, 0x1411, 0x74B1, 0x2DAB, 0x74B2, 0x2DA6,
+ 0x74B5, 0x2F58, 0x74B6, 0x2F5B, 0x74B7, 0x30C2, 0x74B8, 0x2F56,
+ 0x74BA, 0x31F9, 0x74BB, 0x2F5C, 0x74BD, 0x1597, 0x74BE, 0x2F5A,
+ 0x74BF, 0x14F5, 0x74C0, 0x2F57, 0x74C1, 0x2F59, 0x74C2, 0x2F5D,
+ 0x74C3, 0x30C3, 0x74C5, 0x30C1, 0x74CA, 0x1598, 0x74CB, 0x30C0,
+ 0x74CF, 0x1621, 0x74D4, 0x167E, 0x74D5, 0x3392, 0x74D6, 0x167D,
+ 0x74D7, 0x3394, 0x74D8, 0x3391, 0x74D9, 0x3393, 0x74DA, 0x16FE,
+ 0x74DB, 0x348D, 0x74DC, 0x0358, 0x74DD, 0x1A0D, 0x74DE, 0x1D4A,
+ 0x74DF, 0x1D4B, 0x74E0, 0x0B26, 0x74E1, 0x24A8, 0x74E2, 0x12FF,
+ 0x74E3, 0x1599, 0x74E4, 0x16CB, 0x74E5, 0x348E, 0x74E6, 0x0359,
+ 0x74E8, 0x1A0E, 0x74E9, 0x0120, 0x74EC, 0x1B8E, 0x74EE, 0x1B8F,
+ 0x74F4, 0x1D4C, 0x74F5, 0x1D4D, 0x74F6, 0x0B27, 0x74F7, 0x0B28,
+ 0x74FB, 0x2220, 0x74FD, 0x24AB, 0x74FE, 0x24AA, 0x74FF, 0x24A9,
+ 0x7500, 0x2732, 0x7502, 0x2733, 0x7503, 0x2734, 0x7504, 0x1031,
+ 0x7507, 0x297E, 0x7508, 0x297D, 0x750B, 0x2BD2, 0x750C, 0x1300,
+ 0x750D, 0x1301, 0x750F, 0x2DB1, 0x7510, 0x2DAE, 0x7511, 0x2DAF,
+ 0x7512, 0x2DB0, 0x7513, 0x2F5F, 0x7514, 0x2F5E, 0x7515, 0x14F6,
+ 0x7516, 0x30C4, 0x7517, 0x32E3, 0x7518, 0x035A, 0x751A, 0x079F,
+ 0x751C, 0x0B29, 0x751D, 0x24AC, 0x751F, 0x035B, 0x7521, 0x1D4E,
+ 0x7522, 0x0B2A, 0x7525, 0x0CE3, 0x7526, 0x0CE4, 0x7528, 0x035C,
+ 0x7529, 0x035D, 0x752A, 0x180F, 0x752B, 0x04F1, 0x752C, 0x04F0,
+ 0x752D, 0x07A0, 0x752E, 0x1B90, 0x752F, 0x2221, 0x7530, 0x035E,
+ 0x7531, 0x035F, 0x7532, 0x0360, 0x7533, 0x0361, 0x7537, 0x04F2,
+ 0x7538, 0x04F3, 0x7539, 0x18D3, 0x753A, 0x18D2, 0x753D, 0x0655,
+ 0x753E, 0x1A11, 0x753F, 0x1A0F, 0x7540, 0x1A10, 0x7547, 0x1B91,
+ 0x7548, 0x1B92, 0x754B, 0x07A4, 0x754C, 0x07A2, 0x754E, 0x07A3,
+ 0x754F, 0x07A1, 0x7554, 0x0931, 0x7559, 0x0935, 0x755A, 0x0934,
+ 0x755B, 0x1D4F, 0x755C, 0x0933, 0x755D, 0x0932, 0x755F, 0x1D50,
+ 0x7562, 0x0B2D, 0x7563, 0x1F9F, 0x7564, 0x1F9E, 0x7565, 0x0B2B,
+ 0x7566, 0x0B2C, 0x756A, 0x0CE6, 0x756B, 0x0CE5, 0x756C, 0x2223,
+ 0x756F, 0x2222, 0x7570, 0x0B2E, 0x7576, 0x0E85, 0x7577, 0x24AE,
+ 0x7578, 0x0E86, 0x7579, 0x24AD, 0x757D, 0x2735, 0x757E, 0x297F,
+ 0x757F, 0x11AB, 0x7580, 0x2BD3, 0x7584, 0x2DB2, 0x7586, 0x159B,
+ 0x7587, 0x159A, 0x758A, 0x16CC, 0x758B, 0x0362, 0x758C, 0x1A12,
+ 0x758F, 0x0B2F, 0x7590, 0x2736, 0x7591, 0x1032, 0x7592, 0x022E,
+ 0x7594, 0x18D4, 0x7595, 0x18D5, 0x7598, 0x1A13, 0x7599, 0x0657,
+ 0x759A, 0x0658, 0x759D, 0x0656, 0x75A2, 0x07A8, 0x75A3, 0x07A9,
+ 0x75A4, 0x07A6, 0x75A5, 0x07A7, 0x75A7, 0x1B93, 0x75AA, 0x1B94,
+ 0x75AB, 0x07A5, 0x75B0, 0x1D51, 0x75B2, 0x0939, 0x75B3, 0x093A,
+ 0x75B5, 0x0B32, 0x75B6, 0x1D57, 0x75B8, 0x093F, 0x75B9, 0x093D,
+ 0x75BA, 0x1D58, 0x75BB, 0x1D53, 0x75BC, 0x093C, 0x75BD, 0x093B,
+ 0x75BE, 0x0936, 0x75BF, 0x1D56, 0x75C0, 0x1D55, 0x75C1, 0x1D52,
+ 0x75C2, 0x093E, 0x75C4, 0x1D54, 0x75C5, 0x0937, 0x75C7, 0x0938,
+ 0x75CA, 0x0B33, 0x75CB, 0x1FA3, 0x75CC, 0x1FA4, 0x75CD, 0x0B34,
+ 0x75CE, 0x1FA0, 0x75CF, 0x1FA2, 0x75D0, 0x1FA6, 0x75D1, 0x1FA5,
+ 0x75D2, 0x1FA1, 0x75D4, 0x0B30, 0x75D5, 0x0B31, 0x75D7, 0x222B,
+ 0x75D8, 0x0CEB, 0x75D9, 0x0CEA, 0x75DA, 0x2225, 0x75DB, 0x0CE8,
+ 0x75DD, 0x2228, 0x75DE, 0x0CEC, 0x75DF, 0x2229, 0x75E0, 0x0CED,
+ 0x75E1, 0x2226, 0x75E2, 0x0CE7, 0x75E3, 0x0CE9, 0x75E4, 0x222A,
+ 0x75E6, 0x2227, 0x75E7, 0x2224, 0x75ED, 0x24BB, 0x75EF, 0x24B0,
+ 0x75F0, 0x0E88, 0x75F1, 0x0E8B, 0x75F2, 0x0E8A, 0x75F3, 0x0E8F,
+ 0x75F4, 0x0E8E, 0x75F5, 0x24BC, 0x75F6, 0x24BA, 0x75F7, 0x24B3,
+ 0x75F8, 0x24B7, 0x75F9, 0x24B6, 0x75FA, 0x0E8C, 0x75FB, 0x24B9,
+ 0x75FC, 0x24B5, 0x75FD, 0x24BD, 0x75FE, 0x24B4, 0x75FF, 0x0E8D,
+ 0x7600, 0x0E87, 0x7601, 0x0E89, 0x7603, 0x24B2, 0x7608, 0x2738,
+ 0x7609, 0x1036, 0x760A, 0x273C, 0x760B, 0x1035, 0x760C, 0x2739,
+ 0x760D, 0x1034, 0x760F, 0x24B1, 0x7610, 0x24B8, 0x7611, 0x273B,
+ 0x7613, 0x1037, 0x7614, 0x273D, 0x7615, 0x273A, 0x7616, 0x2737,
+ 0x7619, 0x2982, 0x761A, 0x2986, 0x761B, 0x2988, 0x761C, 0x2984,
+ 0x761D, 0x2983, 0x761E, 0x2981, 0x761F, 0x11AE, 0x7620, 0x11AC,
+ 0x7621, 0x11B1, 0x7622, 0x11B2, 0x7623, 0x2985, 0x7624, 0x11AF,
+ 0x7625, 0x2980, 0x7626, 0x11B0, 0x7627, 0x1033, 0x7628, 0x2987,
+ 0x7629, 0x11AD, 0x762D, 0x2BD5, 0x762F, 0x2BD4, 0x7630, 0x2BDC,
+ 0x7631, 0x2BD6, 0x7632, 0x2BDB, 0x7633, 0x2BD8, 0x7634, 0x1302,
+ 0x7635, 0x2BDA, 0x7638, 0x1303, 0x763A, 0x1304, 0x763C, 0x2BD9,
+ 0x763D, 0x2BD7, 0x7642, 0x1415, 0x7643, 0x2DB3, 0x7646, 0x1414,
+ 0x7647, 0x2DB6, 0x7648, 0x2DB4, 0x7649, 0x2DB5, 0x764C, 0x1416,
+ 0x7650, 0x2F63, 0x7652, 0x14F9, 0x7653, 0x2F64, 0x7656, 0x14F7,
+ 0x7657, 0x2F65, 0x7658, 0x14F8, 0x7659, 0x2F62, 0x765A, 0x2F66,
+ 0x765C, 0x2F60, 0x765F, 0x159C, 0x7660, 0x30C5, 0x7661, 0x159D,
+ 0x7662, 0x1622, 0x7664, 0x2F61, 0x7665, 0x1623, 0x7669, 0x167F,
+ 0x766A, 0x32E4, 0x766C, 0x16CE, 0x766D, 0x3395, 0x766E, 0x16CD,
+ 0x7670, 0x3428, 0x7671, 0x1723, 0x7672, 0x1724, 0x7675, 0x3543,
+ 0x7676, 0x022F, 0x7678, 0x07AA, 0x7679, 0x1B95, 0x767B, 0x0CEE,
+ 0x767C, 0x0CEF, 0x767D, 0x0363, 0x767E, 0x03F5, 0x767F, 0x1810,
+ 0x7681, 0x18D6, 0x7682, 0x04F4, 0x7684, 0x0659, 0x7686, 0x07AB,
+ 0x7687, 0x07AC, 0x7688, 0x07AD, 0x7689, 0x1FA8, 0x768A, 0x1D59,
+ 0x768B, 0x0940, 0x768E, 0x0B35, 0x768F, 0x1FA7, 0x7692, 0x222D,
+ 0x7693, 0x0CF1, 0x7695, 0x222C, 0x7696, 0x0CF0, 0x7699, 0x24BE,
+ 0x769A, 0x11B3, 0x769B, 0x298C, 0x769C, 0x2989, 0x769D, 0x298A,
+ 0x769E, 0x298B, 0x76A4, 0x2DB7, 0x76A6, 0x2F67, 0x76AA, 0x31FB,
+ 0x76AB, 0x31FA, 0x76AD, 0x3396, 0x76AE, 0x0364, 0x76AF, 0x1A14,
+ 0x76B0, 0x0941, 0x76B4, 0x0CF2, 0x76B5, 0x24BF, 0x76B8, 0x273E,
+ 0x76BA, 0x11B4, 0x76BB, 0x2BDD, 0x76BD, 0x2F68, 0x76BE, 0x31FC,
+ 0x76BF, 0x0365, 0x76C2, 0x065A, 0x76C3, 0x07B0, 0x76C4, 0x1B96,
+ 0x76C5, 0x07B1, 0x76C6, 0x07AF, 0x76C8, 0x07AE, 0x76C9, 0x1D5A,
+ 0x76CA, 0x0942, 0x76CD, 0x0943, 0x76CE, 0x0944, 0x76D2, 0x0B37,
+ 0x76D3, 0x1FA9, 0x76D4, 0x0B36, 0x76DA, 0x222E, 0x76DB, 0x0B38,
+ 0x76DC, 0x0CF3, 0x76DD, 0x24C0, 0x76DE, 0x0E90, 0x76DF, 0x0E91,
+ 0x76E1, 0x1038, 0x76E3, 0x1039, 0x76E4, 0x11B5, 0x76E5, 0x1306,
+ 0x76E6, 0x2BDE, 0x76E7, 0x1305, 0x76E9, 0x2DB8, 0x76EA, 0x1417,
+ 0x76EC, 0x2F69, 0x76ED, 0x31FD, 0x76EE, 0x0366, 0x76EF, 0x04F5,
+ 0x76F0, 0x1A17, 0x76F1, 0x1A16, 0x76F2, 0x065B, 0x76F3, 0x1A15,
+ 0x76F4, 0x065C, 0x76F5, 0x1A18, 0x76F7, 0x1B9C, 0x76F8, 0x07B4,
+ 0x76F9, 0x07B3, 0x76FA, 0x1B9E, 0x76FB, 0x1B9D, 0x76FC, 0x07B8,
+ 0x76FE, 0x07B7, 0x7701, 0x07B2, 0x7703, 0x1B98, 0x7704, 0x1B99,
+ 0x7705, 0x1B9A, 0x7707, 0x07B9, 0x7708, 0x1B97, 0x7709, 0x07B5,
+ 0x770A, 0x1B9B, 0x770B, 0x07B6, 0x7710, 0x1D5D, 0x7711, 0x1D61,
+ 0x7712, 0x1D5F, 0x7713, 0x1D5E, 0x7715, 0x1D62, 0x7719, 0x1D63,
+ 0x771A, 0x1D64, 0x771B, 0x1D5C, 0x771D, 0x1D5B, 0x771F, 0x0946,
+ 0x7720, 0x0947, 0x7722, 0x1D65, 0x7723, 0x1D60, 0x7725, 0x1FB2,
+ 0x7727, 0x1D66, 0x7728, 0x0948, 0x7729, 0x0945, 0x772D, 0x1FAC,
+ 0x772F, 0x1FAB, 0x7731, 0x1FAD, 0x7732, 0x1FAE, 0x7733, 0x1FB0,
+ 0x7734, 0x1FAF, 0x7735, 0x1FB4, 0x7736, 0x0B3C, 0x7737, 0x0B39,
+ 0x7738, 0x0B3D, 0x7739, 0x1FAA, 0x773A, 0x0B3E, 0x773B, 0x1FB3,
+ 0x773C, 0x0B3B, 0x773D, 0x1FB1, 0x773E, 0x0B3A, 0x7744, 0x2231,
+ 0x7745, 0x2233, 0x7746, 0x222F, 0x7747, 0x2230, 0x774A, 0x2234,
+ 0x774B, 0x2236, 0x774C, 0x2237, 0x774D, 0x2232, 0x774E, 0x2235,
+ 0x774F, 0x0CF4, 0x7752, 0x24C4, 0x7754, 0x24C9, 0x7755, 0x24C1,
+ 0x7756, 0x24C5, 0x7759, 0x24CA, 0x775A, 0x24C6, 0x775B, 0x0E92,
+ 0x775C, 0x0E9A, 0x775E, 0x0E95, 0x775F, 0x24C2, 0x7760, 0x24C3,
+ 0x7761, 0x103D, 0x7762, 0x0E9D, 0x7763, 0x0E96, 0x7765, 0x0E9B,
+ 0x7766, 0x0E94, 0x7767, 0x24C8, 0x7768, 0x0E9C, 0x7769, 0x24C7,
+ 0x776A, 0x0E98, 0x776B, 0x0E93, 0x776C, 0x0E99, 0x776D, 0x24CB,
+ 0x776E, 0x2743, 0x776F, 0x2745, 0x7779, 0x0E97, 0x777C, 0x2740,
+ 0x777D, 0x103B, 0x777E, 0x2746, 0x777F, 0x103C, 0x7780, 0x2744,
+ 0x7781, 0x273F, 0x7782, 0x2742, 0x7783, 0x2747, 0x7784, 0x103A,
+ 0x7785, 0x2741, 0x7787, 0x11B7, 0x7788, 0x2990, 0x7789, 0x298F,
+ 0x778B, 0x11BA, 0x778C, 0x11B8, 0x778D, 0x298D, 0x778E, 0x11B6,
+ 0x778F, 0x298E, 0x7791, 0x11B9, 0x7795, 0x2BE6, 0x7797, 0x2BE8,
+ 0x7799, 0x2BE7, 0x779A, 0x2BDF, 0x779B, 0x2BE3, 0x779C, 0x2BE2,
+ 0x779D, 0x2BE0, 0x779E, 0x1308, 0x779F, 0x1309, 0x77A0, 0x1307,
+ 0x77A1, 0x2BE1, 0x77A2, 0x2BE4, 0x77A3, 0x2BE5, 0x77A5, 0x130A,
+ 0x77A7, 0x141C, 0x77A8, 0x2DC0, 0x77AA, 0x1419, 0x77AB, 0x2DBA,
+ 0x77AC, 0x141B, 0x77AD, 0x141D, 0x77B0, 0x141A, 0x77B1, 0x2DBF,
+ 0x77B2, 0x2DBB, 0x77B3, 0x1418, 0x77B4, 0x2DBE, 0x77B5, 0x2DB9,
+ 0x77B6, 0x2DBD, 0x77B7, 0x2DBC, 0x77BA, 0x2F6B, 0x77BB, 0x14FC,
+ 0x77BC, 0x14FD, 0x77BD, 0x14FA, 0x77BF, 0x14FB, 0x77C2, 0x2F6A,
+ 0x77C4, 0x30C8, 0x77C7, 0x159E, 0x77C9, 0x30C6, 0x77CA, 0x30C7,
+ 0x77CC, 0x31FE, 0x77CD, 0x3201, 0x77CE, 0x31FF, 0x77CF, 0x3200,
+ 0x77D0, 0x32E5, 0x77D3, 0x1680, 0x77D4, 0x3429, 0x77D5, 0x348F,
+ 0x77D7, 0x1725, 0x77D8, 0x34D3, 0x77D9, 0x34D4, 0x77DA, 0x1753,
+ 0x77DB, 0x0367, 0x77DC, 0x07BA, 0x77DE, 0x2238, 0x77E0, 0x24CC,
+ 0x77E2, 0x0368, 0x77E3, 0x04F6, 0x77E5, 0x065D, 0x77E7, 0x1B9F,
+ 0x77E8, 0x1BA0, 0x77E9, 0x0949, 0x77EC, 0x2239, 0x77ED, 0x0CF5,
+ 0x77EE, 0x0E9E, 0x77EF, 0x141E, 0x77F0, 0x2DC1, 0x77F1, 0x30C9,
+ 0x77F2, 0x3202, 0x77F3, 0x0369, 0x77F7, 0x1A1E, 0x77F8, 0x1A19,
+ 0x77F9, 0x1A1B, 0x77FA, 0x1A1D, 0x77FB, 0x1A1C, 0x77FC, 0x1A1A,
+ 0x77FD, 0x065E, 0x7802, 0x07BB, 0x7803, 0x1BA9, 0x7805, 0x1BA4,
+ 0x7806, 0x1BA1, 0x7809, 0x1BA8, 0x780C, 0x07BD, 0x780D, 0x07BE,
+ 0x780E, 0x1BA7, 0x780F, 0x1BA6, 0x7810, 0x1BA5, 0x7811, 0x1BA2,
+ 0x7812, 0x1BA3, 0x7813, 0x1BAA, 0x7814, 0x07BC, 0x781D, 0x094D,
+ 0x781F, 0x0953, 0x7820, 0x0952, 0x7821, 0x1D6F, 0x7822, 0x1D69,
+ 0x7823, 0x1D67, 0x7825, 0x0950, 0x7826, 0x1FBB, 0x7827, 0x094B,
+ 0x7828, 0x1D6C, 0x7829, 0x1D70, 0x782A, 0x1D72, 0x782B, 0x1D6E,
+ 0x782C, 0x1D68, 0x782D, 0x0951, 0x782E, 0x1D6D, 0x782F, 0x1D6B,
+ 0x7830, 0x094A, 0x7831, 0x1D73, 0x7832, 0x0954, 0x7833, 0x1D71,
+ 0x7834, 0x094E, 0x7835, 0x1D6A, 0x7837, 0x094F, 0x7838, 0x094C,
+ 0x7843, 0x0B40, 0x7845, 0x1FBC, 0x7848, 0x1FB5, 0x7849, 0x1FB7,
+ 0x784A, 0x1FB9, 0x784C, 0x1FBA, 0x784D, 0x1FB8, 0x784E, 0x0B41,
+ 0x7850, 0x1FBD, 0x7852, 0x1FB6, 0x785C, 0x223D, 0x785D, 0x0CF6,
+ 0x785E, 0x2245, 0x7860, 0x223A, 0x7862, 0x2246, 0x7864, 0x223B,
+ 0x7865, 0x223C, 0x7868, 0x2244, 0x7869, 0x2243, 0x786A, 0x2240,
+ 0x786B, 0x0B3F, 0x786C, 0x0CF7, 0x786D, 0x223E, 0x786E, 0x2241,
+ 0x786F, 0x0CF8, 0x7870, 0x2242, 0x7871, 0x223F, 0x7879, 0x24D7,
+ 0x787B, 0x24DB, 0x787C, 0x0EA5, 0x787E, 0x274D, 0x787F, 0x0EA8,
+ 0x7880, 0x24D9, 0x7881, 0x36E8, 0x7883, 0x24D6, 0x7884, 0x24D1,
+ 0x7885, 0x24D3, 0x7886, 0x24D4, 0x7887, 0x24CD, 0x7889, 0x0EA4,
+ 0x788C, 0x0EA3, 0x788E, 0x0E9F, 0x788F, 0x24D0, 0x7891, 0x0EA6,
+ 0x7893, 0x0EA7, 0x7894, 0x24CF, 0x7895, 0x24D2, 0x7896, 0x24DA,
+ 0x7897, 0x0EA1, 0x7898, 0x0EA2, 0x7899, 0x24D8, 0x789A, 0x24CE,
+ 0x789E, 0x274F, 0x789F, 0x103F, 0x78A0, 0x2751, 0x78A1, 0x24D5,
+ 0x78A2, 0x2753, 0x78A3, 0x1043, 0x78A4, 0x2754, 0x78A5, 0x2750,
+ 0x78A7, 0x1040, 0x78A8, 0x274C, 0x78A9, 0x1042, 0x78AA, 0x2749,
+ 0x78AB, 0x274E, 0x78AC, 0x2752, 0x78AD, 0x274B, 0x78B0, 0x0EA0,
+ 0x78B2, 0x2748, 0x78B3, 0x1041, 0x78B4, 0x274A, 0x78BA, 0x11BD,
+ 0x78BB, 0x2992, 0x78BC, 0x11C1, 0x78BE, 0x11BF, 0x78C1, 0x103E,
+ 0x78C3, 0x2999, 0x78C4, 0x299A, 0x78C5, 0x11BC, 0x78C8, 0x2998,
+ 0x78C9, 0x299B, 0x78CA, 0x11BE, 0x78CB, 0x11BB, 0x78CC, 0x2994,
+ 0x78CD, 0x2991, 0x78CE, 0x2996, 0x78CF, 0x2993, 0x78D0, 0x11C2,
+ 0x78D1, 0x2995, 0x78D4, 0x2997, 0x78D5, 0x11C0, 0x78DA, 0x130C,
+ 0x78DB, 0x2BEF, 0x78DD, 0x2BE9, 0x78DE, 0x2BED, 0x78DF, 0x2BF3,
+ 0x78E0, 0x2BF4, 0x78E1, 0x2BF0, 0x78E2, 0x2BF1, 0x78E3, 0x2BEE,
+ 0x78E5, 0x2BEB, 0x78E7, 0x130E, 0x78E8, 0x130B, 0x78E9, 0x2BEA,
+ 0x78EA, 0x2BEC, 0x78EC, 0x130D, 0x78ED, 0x2BF2, 0x78EF, 0x1422,
+ 0x78F2, 0x2DC8, 0x78F3, 0x2DC2, 0x78F4, 0x1421, 0x78F7, 0x141F,
+ 0x78F9, 0x2DCA, 0x78FA, 0x1420, 0x78FB, 0x2DC5, 0x78FC, 0x2DC6,
+ 0x78FD, 0x2DC3, 0x78FE, 0x2DCB, 0x78FF, 0x2DC7, 0x7901, 0x1423,
+ 0x7902, 0x2DC4, 0x7904, 0x2DCC, 0x7905, 0x2DC9, 0x7909, 0x2F6F,
+ 0x790C, 0x2F6C, 0x790E, 0x14FE, 0x7910, 0x2F70, 0x7911, 0x2F72,
+ 0x7912, 0x2F71, 0x7913, 0x2F6D, 0x7914, 0x2F6E, 0x7917, 0x30CE,
+ 0x7919, 0x159F, 0x791B, 0x30CB, 0x791C, 0x30CD, 0x791D, 0x30CA,
+ 0x791E, 0x30CF, 0x7921, 0x30CC, 0x7923, 0x3204, 0x7924, 0x3207,
+ 0x7925, 0x3203, 0x7926, 0x1624, 0x7927, 0x3205, 0x7928, 0x3206,
+ 0x7929, 0x3208, 0x792A, 0x1625, 0x792B, 0x1627, 0x792C, 0x1626,
+ 0x792D, 0x32E6, 0x792F, 0x32E8, 0x7931, 0x32E7, 0x7935, 0x3397,
+ 0x7938, 0x3490, 0x7939, 0x34D5, 0x793A, 0x036A, 0x793D, 0x18D7,
+ 0x793E, 0x065F, 0x793F, 0x1A20, 0x7940, 0x0660, 0x7941, 0x0661,
+ 0x7942, 0x1A1F, 0x7944, 0x1BAF, 0x7945, 0x1BAE, 0x7946, 0x07BF,
+ 0x7947, 0x07C2, 0x7948, 0x07C1, 0x7949, 0x07C0, 0x794A, 0x1BAB,
+ 0x794B, 0x1BAD, 0x794C, 0x1BAC, 0x794F, 0x1D76, 0x7950, 0x0956,
+ 0x7951, 0x1D7A, 0x7952, 0x1D79, 0x7953, 0x1D78, 0x7954, 0x1D74,
+ 0x7955, 0x0955, 0x7956, 0x0959, 0x7957, 0x095C, 0x795A, 0x095D,
+ 0x795B, 0x1D75, 0x795C, 0x1D77, 0x795D, 0x095B, 0x795E, 0x095A,
+ 0x795F, 0x0958, 0x7960, 0x0957, 0x7961, 0x1FC4, 0x7963, 0x1FC2,
+ 0x7964, 0x1FBE, 0x7965, 0x0B42, 0x7967, 0x1FBF, 0x7968, 0x0B43,
+ 0x7969, 0x1FC0, 0x796A, 0x1FC1, 0x796B, 0x1FC3, 0x796D, 0x0B44,
+ 0x7970, 0x224A, 0x7972, 0x2249, 0x7973, 0x2248, 0x7974, 0x2247,
+ 0x7979, 0x24DF, 0x797A, 0x0EA9, 0x797C, 0x24DC, 0x797D, 0x24DE,
+ 0x797F, 0x0EAA, 0x7981, 0x0EAB, 0x7982, 0x24DD, 0x7988, 0x275D,
+ 0x798A, 0x2756, 0x798B, 0x2757, 0x798D, 0x1046, 0x798E, 0x1044,
+ 0x798F, 0x1045, 0x7990, 0x275F, 0x7992, 0x275E, 0x7993, 0x275B,
+ 0x7994, 0x275A, 0x7995, 0x2759, 0x7996, 0x2758, 0x7997, 0x275C,
+ 0x7998, 0x2755, 0x799A, 0x299C, 0x799B, 0x29A1, 0x799C, 0x299F,
+ 0x79A0, 0x299E, 0x79A1, 0x299D, 0x79A2, 0x29A0, 0x79A4, 0x2BF5,
+ 0x79A6, 0x130F, 0x79A7, 0x1424, 0x79A8, 0x2DCE, 0x79AA, 0x1425,
+ 0x79AB, 0x2DCD, 0x79AC, 0x2F74, 0x79AD, 0x2F73, 0x79AE, 0x14FF,
+ 0x79B0, 0x30D0, 0x79B1, 0x15A0, 0x79B2, 0x3209, 0x79B3, 0x16CF,
+ 0x79B4, 0x3398, 0x79B6, 0x3492, 0x79B7, 0x3491, 0x79B8, 0x17B2,
+ 0x79B9, 0x07C3, 0x79BA, 0x07C4, 0x79BB, 0x1FC5, 0x79BD, 0x0EAD,
+ 0x79BE, 0x036B, 0x79BF, 0x04F9, 0x79C0, 0x04F8, 0x79C1, 0x04F7,
+ 0x79C5, 0x1A21, 0x79C8, 0x0663, 0x79C9, 0x0662, 0x79CB, 0x07C7,
+ 0x79CD, 0x1BB1, 0x79CE, 0x1BB4, 0x79CF, 0x1BB2, 0x79D1, 0x07C5,
+ 0x79D2, 0x07C6, 0x79D5, 0x1BB0, 0x79D6, 0x1BB3, 0x79D8, 0x0964,
+ 0x79DC, 0x1D81, 0x79DD, 0x1D83, 0x79DE, 0x1D82, 0x79DF, 0x0961,
+ 0x79E0, 0x1D7D, 0x79E3, 0x095F, 0x79E4, 0x095E, 0x79E6, 0x0962,
+ 0x79E7, 0x0960, 0x79E9, 0x0963, 0x79EA, 0x1D80, 0x79EB, 0x1D7B,
+ 0x79EC, 0x1D7C, 0x79ED, 0x1D7F, 0x79EE, 0x1D7E, 0x79F6, 0x1FC8,
+ 0x79F7, 0x1FC9, 0x79F8, 0x1FC7, 0x79FA, 0x1FC6, 0x79FB, 0x0B45,
+ 0x7A00, 0x0CFD, 0x7A02, 0x224B, 0x7A03, 0x224D, 0x7A04, 0x224F,
+ 0x7A05, 0x0CFC, 0x7A08, 0x0CFA, 0x7A0A, 0x224C, 0x7A0B, 0x0CFB,
+ 0x7A0C, 0x224E, 0x7A0D, 0x0CF9, 0x7A10, 0x24E9, 0x7A11, 0x24E0,
+ 0x7A12, 0x24E3, 0x7A13, 0x24E7, 0x7A14, 0x0EB1, 0x7A15, 0x24E5,
+ 0x7A17, 0x24E4, 0x7A18, 0x24E1, 0x7A19, 0x24E2, 0x7A1A, 0x0EAF,
+ 0x7A1B, 0x24E8, 0x7A1C, 0x0EAE, 0x7A1E, 0x0EB3, 0x7A1F, 0x0EB2,
+ 0x7A20, 0x0EB0, 0x7A22, 0x24E6, 0x7A26, 0x2765, 0x7A28, 0x2764,
+ 0x7A2B, 0x2760, 0x7A2E, 0x1047, 0x7A2F, 0x2763, 0x7A30, 0x2762,
+ 0x7A31, 0x1048, 0x7A37, 0x11C7, 0x7A39, 0x29A3, 0x7A3B, 0x11C8,
+ 0x7A3C, 0x11C4, 0x7A3D, 0x11C6, 0x7A3F, 0x11C3, 0x7A40, 0x11C5,
+ 0x7A44, 0x2BF6, 0x7A46, 0x1312, 0x7A47, 0x2BF8, 0x7A48, 0x2BF7,
+ 0x7A4A, 0x2761, 0x7A4B, 0x1314, 0x7A4C, 0x1313, 0x7A4D, 0x1310,
+ 0x7A4E, 0x1311, 0x7A54, 0x2DD3, 0x7A56, 0x2DD1, 0x7A57, 0x1426,
+ 0x7A58, 0x2DD2, 0x7A5A, 0x2DD4, 0x7A5B, 0x2DD0, 0x7A5C, 0x2DCF,
+ 0x7A5F, 0x2F75, 0x7A60, 0x1502, 0x7A61, 0x1500, 0x7A62, 0x1501,
+ 0x7A67, 0x30D1, 0x7A68, 0x30D2, 0x7A69, 0x15A2, 0x7A6B, 0x15A1,
+ 0x7A6C, 0x320B, 0x7A6D, 0x320C, 0x7A6E, 0x320A, 0x7A70, 0x3399,
+ 0x7A71, 0x339A, 0x7A74, 0x036C, 0x7A75, 0x1811, 0x7A76, 0x04FA,
+ 0x7A78, 0x1A22, 0x7A79, 0x0665, 0x7A7A, 0x0664, 0x7A7B, 0x1A23,
+ 0x7A7E, 0x1BB6, 0x7A7F, 0x07C8, 0x7A80, 0x1BB5, 0x7A81, 0x07C9,
+ 0x7A84, 0x0965, 0x7A85, 0x1D86, 0x7A86, 0x1D84, 0x7A87, 0x1D8A,
+ 0x7A88, 0x0966, 0x7A89, 0x1D85, 0x7A8A, 0x1D89, 0x7A8B, 0x1D87,
+ 0x7A8C, 0x1D88, 0x7A8F, 0x1FCA, 0x7A90, 0x1FCC, 0x7A92, 0x0B46,
+ 0x7A94, 0x1FCB, 0x7A95, 0x0B47, 0x7A96, 0x0D00, 0x7A97, 0x0CFF,
+ 0x7A98, 0x0CFE, 0x7A99, 0x2250, 0x7A9E, 0x24EC, 0x7A9F, 0x0EB4,
+ 0x7AA0, 0x0EB5, 0x7AA2, 0x24EB, 0x7AA3, 0x24EA, 0x7AA8, 0x2766,
+ 0x7AA9, 0x104A, 0x7AAA, 0x1049, 0x7AAB, 0x2767, 0x7AAC, 0x2768,
+ 0x7AAE, 0x11CA, 0x7AAF, 0x11C9, 0x7AB1, 0x2BFC, 0x7AB2, 0x29A4,
+ 0x7AB3, 0x29A6, 0x7AB4, 0x29A5, 0x7AB5, 0x2BFB, 0x7AB6, 0x2BF9,
+ 0x7AB7, 0x2BFD, 0x7AB8, 0x2BFA, 0x7ABA, 0x1315, 0x7ABE, 0x2DD5,
+ 0x7ABF, 0x1427, 0x7AC0, 0x2DD6, 0x7AC1, 0x2DD7, 0x7AC4, 0x1503,
+ 0x7AC5, 0x1504, 0x7AC7, 0x1628, 0x7ACA, 0x16FF, 0x7ACB, 0x036D,
+ 0x7AD1, 0x1BB7, 0x7AD8, 0x1D8B, 0x7AD9, 0x0967, 0x7ADF, 0x0BDE,
+ 0x7AE0, 0x0BDD, 0x7AE3, 0x0D02, 0x7AE4, 0x2252, 0x7AE5, 0x0D01,
+ 0x7AE6, 0x2251, 0x7AEB, 0x24ED, 0x7AED, 0x104B, 0x7AEE, 0x2769,
+ 0x7AEF, 0x104C, 0x7AF6, 0x1629, 0x7AF7, 0x320D, 0x7AF9, 0x03F6,
+ 0x7AFA, 0x0666, 0x7AFB, 0x1A24, 0x7AFD, 0x07CB, 0x7AFF, 0x07CA,
+ 0x7B00, 0x1BB8, 0x7B01, 0x1BB9, 0x7B04, 0x1D8D, 0x7B05, 0x1D8F,
+ 0x7B06, 0x0968, 0x7B08, 0x1D91, 0x7B09, 0x1D94, 0x7B0A, 0x1D92,
+ 0x7B0E, 0x1D93, 0x7B0F, 0x1D90, 0x7B10, 0x1D8C, 0x7B11, 0x0969,
+ 0x7B12, 0x1D95, 0x7B13, 0x1D8E, 0x7B18, 0x1FD5, 0x7B19, 0x0B4D,
+ 0x7B1A, 0x1FDE, 0x7B1B, 0x0B4A, 0x7B1D, 0x1FD7, 0x7B1E, 0x0B4E,
+ 0x7B20, 0x0B48, 0x7B22, 0x1FD2, 0x7B23, 0x1FDF, 0x7B24, 0x1FD3,
+ 0x7B25, 0x1FD0, 0x7B26, 0x0B4C, 0x7B28, 0x0B49, 0x7B2A, 0x1FD6,
+ 0x7B2B, 0x1FD9, 0x7B2C, 0x0B4B, 0x7B2D, 0x1FDA, 0x7B2E, 0x0B4F,
+ 0x7B2F, 0x1FDB, 0x7B30, 0x1FD1, 0x7B31, 0x1FD8, 0x7B32, 0x1FDC,
+ 0x7B33, 0x1FD4, 0x7B34, 0x1FCF, 0x7B35, 0x1FCD, 0x7B38, 0x1FDD,
+ 0x7B3B, 0x1FCE, 0x7B40, 0x2259, 0x7B44, 0x2255, 0x7B45, 0x225B,
+ 0x7B46, 0x0D05, 0x7B47, 0x2254, 0x7B48, 0x2256, 0x7B49, 0x0D03,
+ 0x7B4A, 0x2253, 0x7B4B, 0x0D0A, 0x7B4C, 0x2257, 0x7B4D, 0x0D09,
+ 0x7B4E, 0x2258, 0x7B4F, 0x0D0B, 0x7B50, 0x0D06, 0x7B51, 0x0D0C,
+ 0x7B52, 0x0D07, 0x7B54, 0x0D08, 0x7B56, 0x0D04, 0x7B58, 0x225A,
+ 0x7B60, 0x0EB8, 0x7B61, 0x24F8, 0x7B63, 0x24FB, 0x7B64, 0x24EF,
+ 0x7B65, 0x24F4, 0x7B66, 0x24EE, 0x7B67, 0x0EBA, 0x7B69, 0x24F2,
+ 0x7B6D, 0x24F0, 0x7B6E, 0x0EB9, 0x7B70, 0x24F7, 0x7B71, 0x24F6,
+ 0x7B72, 0x24F3, 0x7B73, 0x24F5, 0x7B74, 0x24F1, 0x7B75, 0x1050,
+ 0x7B76, 0x24FA, 0x7B77, 0x0EB6, 0x7B78, 0x24F9, 0x7B82, 0x2779,
+ 0x7B84, 0x1057, 0x7B85, 0x2774, 0x7B87, 0x1056, 0x7B88, 0x276A,
+ 0x7B8A, 0x276C, 0x7B8B, 0x104F, 0x7B8C, 0x2771, 0x7B8D, 0x2770,
+ 0x7B8E, 0x2773, 0x7B8F, 0x1054, 0x7B90, 0x276E, 0x7B91, 0x276D,
+ 0x7B94, 0x1053, 0x7B95, 0x104E, 0x7B96, 0x276F, 0x7B97, 0x1051,
+ 0x7B98, 0x2775, 0x7B99, 0x2777, 0x7B9B, 0x2772, 0x7B9C, 0x276B,
+ 0x7B9D, 0x1052, 0x7BA0, 0x11D2, 0x7BA1, 0x104D, 0x7BA4, 0x2778,
+ 0x7BAC, 0x29AA, 0x7BAD, 0x11CB, 0x7BAF, 0x29AC, 0x7BB1, 0x11CC,
+ 0x7BB4, 0x11CE, 0x7BB5, 0x29AF, 0x7BB7, 0x29A7, 0x7BB8, 0x1055,
+ 0x7BB9, 0x29AD, 0x7BBE, 0x29A9, 0x7BC0, 0x0EB7, 0x7BC1, 0x11D1,
+ 0x7BC4, 0x11CD, 0x7BC6, 0x11CF, 0x7BC7, 0x11D0, 0x7BC9, 0x1318,
+ 0x7BCA, 0x29AE, 0x7BCB, 0x29A8, 0x7BCC, 0x11D3, 0x7BCE, 0x29AB,
+ 0x7BD4, 0x2C07, 0x7BD5, 0x2C02, 0x7BD8, 0x2C0C, 0x7BD9, 0x1316,
+ 0x7BDA, 0x2C04, 0x7BDB, 0x131A, 0x7BDC, 0x2C0A, 0x7BDD, 0x2C01,
+ 0x7BDE, 0x2BFE, 0x7BDF, 0x2C0D, 0x7BE0, 0x142D, 0x7BE1, 0x131B,
+ 0x7BE2, 0x2C09, 0x7BE3, 0x2BFF, 0x7BE4, 0x1319, 0x7BE5, 0x2C03,
+ 0x7BE6, 0x131D, 0x7BE7, 0x2C00, 0x7BE8, 0x2C05, 0x7BE9, 0x131C,
+ 0x7BEA, 0x2C08, 0x7BEB, 0x2C0B, 0x7BF0, 0x2DE9, 0x7BF1, 0x2DEA,
+ 0x7BF2, 0x2DDA, 0x7BF3, 0x2DE1, 0x7BF4, 0x2DDF, 0x7BF7, 0x142B,
+ 0x7BF8, 0x2DE6, 0x7BF9, 0x2C06, 0x7BFB, 0x2DDD, 0x7BFD, 0x2DE7,
+ 0x7BFE, 0x142A, 0x7BFF, 0x2DDC, 0x7C00, 0x2DDB, 0x7C01, 0x2DE5,
+ 0x7C02, 0x2DE2, 0x7C03, 0x2DE4, 0x7C05, 0x2DD8, 0x7C06, 0x2DE8,
+ 0x7C07, 0x1428, 0x7C09, 0x2DE3, 0x7C0A, 0x2DEC, 0x7C0B, 0x2DE0,
+ 0x7C0C, 0x142C, 0x7C0D, 0x1429, 0x7C0E, 0x2DDE, 0x7C0F, 0x2DD9,
+ 0x7C10, 0x2DEB, 0x7C11, 0x1317, 0x7C19, 0x2F78, 0x7C1C, 0x2F76,
+ 0x7C1D, 0x2F7C, 0x7C1E, 0x1508, 0x7C1F, 0x2F7A, 0x7C20, 0x2F79,
+ 0x7C21, 0x150A, 0x7C22, 0x2F7F, 0x7C23, 0x1509, 0x7C25, 0x2F80,
+ 0x7C26, 0x2F7D, 0x7C27, 0x1506, 0x7C28, 0x2F7E, 0x7C29, 0x2F77,
+ 0x7C2A, 0x1507, 0x7C2B, 0x1505, 0x7C2C, 0x30D6, 0x7C2D, 0x2F7B,
+ 0x7C30, 0x2F81, 0x7C33, 0x30D3, 0x7C37, 0x15A7, 0x7C38, 0x15A5,
+ 0x7C39, 0x30D5, 0x7C3B, 0x30D7, 0x7C3C, 0x30D4, 0x7C3D, 0x15A6,
+ 0x7C3E, 0x15A3, 0x7C3F, 0x15A4, 0x7C40, 0x15A8, 0x7C43, 0x162B,
+ 0x7C45, 0x3212, 0x7C47, 0x3211, 0x7C48, 0x320F, 0x7C49, 0x320E,
+ 0x7C4A, 0x3210, 0x7C4C, 0x162A, 0x7C4D, 0x162C, 0x7C50, 0x1681,
+ 0x7C53, 0x32EA, 0x7C54, 0x32E9, 0x7C57, 0x339B, 0x7C59, 0x339D,
+ 0x7C5A, 0x339F, 0x7C5B, 0x339E, 0x7C5C, 0x339C, 0x7C5F, 0x16D1,
+ 0x7C60, 0x16D0, 0x7C63, 0x1701, 0x7C64, 0x1700, 0x7C65, 0x1702,
+ 0x7C66, 0x342B, 0x7C67, 0x342A, 0x7C69, 0x34D6, 0x7C6A, 0x3493,
+ 0x7C6B, 0x34D7, 0x7C6C, 0x1745, 0x7C6E, 0x1746, 0x7C6F, 0x3507,
+ 0x7C72, 0x176B, 0x7C73, 0x03F7, 0x7C75, 0x1A25, 0x7C78, 0x1BBB,
+ 0x7C79, 0x1BBC, 0x7C7A, 0x1BBA, 0x7C7D, 0x07CC, 0x7C7F, 0x1BBD,
+ 0x7C80, 0x1BBE, 0x7C81, 0x1BBF, 0x7C84, 0x1D96, 0x7C85, 0x1D9C,
+ 0x7C88, 0x1D9A, 0x7C89, 0x096A, 0x7C8A, 0x1D98, 0x7C8C, 0x1D99,
+ 0x7C8D, 0x1D9B, 0x7C91, 0x1D97, 0x7C92, 0x0B50, 0x7C94, 0x1FE0,
+ 0x7C95, 0x0B52, 0x7C96, 0x1FE2, 0x7C97, 0x0B51, 0x7C98, 0x1FE1,
+ 0x7C9E, 0x225D, 0x7C9F, 0x0D0D, 0x7CA1, 0x225F, 0x7CA2, 0x225C,
+ 0x7CA3, 0x1FE3, 0x7CA5, 0x0D0E, 0x7CA7, 0x36ED, 0x7CA8, 0x225E,
+ 0x7CAF, 0x24FE, 0x7CB1, 0x0EBB, 0x7CB2, 0x24FC, 0x7CB3, 0x0EBC,
+ 0x7CB4, 0x24FD, 0x7CB5, 0x0EBD, 0x7CB9, 0x1058, 0x7CBA, 0x277D,
+ 0x7CBB, 0x277A, 0x7CBC, 0x277C, 0x7CBD, 0x1059, 0x7CBE, 0x105A,
+ 0x7CBF, 0x277B, 0x7CC5, 0x29B0, 0x7CC8, 0x29B1, 0x7CCA, 0x11D4,
+ 0x7CCB, 0x29B3, 0x7CCC, 0x29B2, 0x7CCE, 0x0121, 0x7CD0, 0x2C11,
+ 0x7CD1, 0x2C12, 0x7CD2, 0x2C0E, 0x7CD4, 0x2C0F, 0x7CD5, 0x131E,
+ 0x7CD6, 0x131F, 0x7CD7, 0x2C10, 0x7CD9, 0x1433, 0x7CDC, 0x142F,
+ 0x7CDD, 0x1434, 0x7CDE, 0x1430, 0x7CDF, 0x1432, 0x7CE0, 0x142E,
+ 0x7CE2, 0x1431, 0x7CE7, 0x150B, 0x7CE8, 0x2DED, 0x7CEA, 0x30D9,
+ 0x7CEC, 0x30D8, 0x7CEE, 0x3213, 0x7CEF, 0x162D, 0x7CF0, 0x162E,
+ 0x7CF1, 0x33A1, 0x7CF2, 0x32EB, 0x7CF4, 0x33A0, 0x7CF6, 0x34D8,
+ 0x7CF7, 0x351D, 0x7CF8, 0x03F8, 0x7CFB, 0x04FB, 0x7CFD, 0x1A26,
+ 0x7CFE, 0x0667, 0x7D00, 0x07CF, 0x7D01, 0x1BC2, 0x7D02, 0x07CD,
+ 0x7D03, 0x1BC0, 0x7D04, 0x07D2, 0x7D05, 0x07CE, 0x7D06, 0x07D3,
+ 0x7D07, 0x07D1, 0x7D08, 0x1BC1, 0x7D09, 0x07D0, 0x7D0A, 0x096E,
+ 0x7D0B, 0x096D, 0x7D0C, 0x1DA7, 0x7D0D, 0x0976, 0x7D0E, 0x1DA0,
+ 0x7D0F, 0x1DA6, 0x7D10, 0x0972, 0x7D11, 0x1D9F, 0x7D12, 0x1DA5,
+ 0x7D13, 0x1DA3, 0x7D14, 0x0971, 0x7D15, 0x0973, 0x7D16, 0x1DA2,
+ 0x7D17, 0x096C, 0x7D18, 0x1DA1, 0x7D19, 0x0977, 0x7D1A, 0x0974,
+ 0x7D1B, 0x0978, 0x7D1C, 0x0975, 0x7D1D, 0x1D9E, 0x7D1E, 0x1D9D,
+ 0x7D1F, 0x1DA4, 0x7D20, 0x096F, 0x7D21, 0x096B, 0x7D22, 0x0970,
+ 0x7D28, 0x1FF2, 0x7D29, 0x1FEB, 0x7D2B, 0x0D13, 0x7D2C, 0x1FEA,
+ 0x7D2E, 0x0B56, 0x7D2F, 0x0B5D, 0x7D30, 0x0B5A, 0x7D31, 0x0B60,
+ 0x7D32, 0x0B5F, 0x7D33, 0x0B5B, 0x7D35, 0x1FE4, 0x7D36, 0x1FE7,
+ 0x7D38, 0x1FE6, 0x7D39, 0x0B57, 0x7D3A, 0x1FE8, 0x7D3B, 0x1FF1,
+ 0x7D3C, 0x0B58, 0x7D3D, 0x1FE5, 0x7D3E, 0x1FEE, 0x7D3F, 0x1FEF,
+ 0x7D40, 0x0B59, 0x7D41, 0x1FEC, 0x7D42, 0x0B5E, 0x7D43, 0x0B54,
+ 0x7D44, 0x0B5C, 0x7D45, 0x1FE9, 0x7D46, 0x0B53, 0x7D47, 0x1FED,
+ 0x7D4A, 0x1FF0, 0x7D4E, 0x2270, 0x7D4F, 0x2267, 0x7D50, 0x0D10,
+ 0x7D51, 0x226E, 0x7D52, 0x226B, 0x7D53, 0x2263, 0x7D54, 0x226C,
+ 0x7D55, 0x0D12, 0x7D56, 0x2264, 0x7D58, 0x2260, 0x7D5B, 0x0EC3,
+ 0x7D5C, 0x2269, 0x7D5E, 0x0D0F, 0x7D5F, 0x226F, 0x7D61, 0x0D16,
+ 0x7D62, 0x0D18, 0x7D63, 0x2262, 0x7D66, 0x0D17, 0x7D67, 0x2265,
+ 0x7D68, 0x0D11, 0x7D69, 0x226D, 0x7D6A, 0x2266, 0x7D6B, 0x226A,
+ 0x7D6D, 0x2268, 0x7D6E, 0x0D14, 0x7D6F, 0x2261, 0x7D70, 0x0D19,
+ 0x7D71, 0x0B55, 0x7D72, 0x0D15, 0x7D73, 0x0D1A, 0x7D79, 0x0EBF,
+ 0x7D7A, 0x2505, 0x7D7B, 0x2507, 0x7D7C, 0x2509, 0x7D7D, 0x250D,
+ 0x7D7F, 0x2503, 0x7D80, 0x2501, 0x7D81, 0x0EC1, 0x7D83, 0x2508,
+ 0x7D84, 0x250C, 0x7D85, 0x2504, 0x7D86, 0x2500, 0x7D88, 0x24FF,
+ 0x7D8C, 0x250A, 0x7D8D, 0x2502, 0x7D8E, 0x2506, 0x7D8F, 0x0EC2,
+ 0x7D91, 0x0EC0, 0x7D92, 0x250E, 0x7D93, 0x0EBE, 0x7D94, 0x250B,
+ 0x7D96, 0x278E, 0x7D9C, 0x105D, 0x7D9D, 0x2786, 0x7D9E, 0x11E1,
+ 0x7D9F, 0x2790, 0x7DA0, 0x1060, 0x7DA1, 0x2794, 0x7DA2, 0x1066,
+ 0x7DA3, 0x2781, 0x7DA6, 0x2791, 0x7DA7, 0x277E, 0x7DA9, 0x2793,
+ 0x7DAA, 0x2782, 0x7DAC, 0x106D, 0x7DAD, 0x106A, 0x7DAE, 0x2792,
+ 0x7DAF, 0x278C, 0x7DB0, 0x105C, 0x7DB1, 0x1064, 0x7DB2, 0x1063,
+ 0x7DB4, 0x1062, 0x7DB5, 0x1068, 0x7DB7, 0x277F, 0x7DB8, 0x1069,
+ 0x7DB9, 0x278D, 0x7DBA, 0x1065, 0x7DBB, 0x105B, 0x7DBC, 0x278F,
+ 0x7DBD, 0x105E, 0x7DBE, 0x105F, 0x7DBF, 0x1067, 0x7DC0, 0x2784,
+ 0x7DC1, 0x2783, 0x7DC2, 0x2780, 0x7DC4, 0x2788, 0x7DC5, 0x2785,
+ 0x7DC6, 0x2789, 0x7DC7, 0x106C, 0x7DC9, 0x2795, 0x7DCA, 0x1061,
+ 0x7DCB, 0x278A, 0x7DCC, 0x278B, 0x7DCE, 0x2787, 0x7DD2, 0x106B,
+ 0x7DD7, 0x29B8, 0x7DD8, 0x11D9, 0x7DD9, 0x11E2, 0x7DDA, 0x11DE,
+ 0x7DDB, 0x29B5, 0x7DDD, 0x11DB, 0x7DDE, 0x11DF, 0x7DDF, 0x29C1,
+ 0x7DE0, 0x11D5, 0x7DE1, 0x29B9, 0x7DE3, 0x11DD, 0x7DE6, 0x29BC,
+ 0x7DE7, 0x29B7, 0x7DE8, 0x11DC, 0x7DE9, 0x11E0, 0x7DEA, 0x29B6,
+ 0x7DEC, 0x11DA, 0x7DEE, 0x29C0, 0x7DEF, 0x11D7, 0x7DF0, 0x29BF,
+ 0x7DF1, 0x29BE, 0x7DF2, 0x11E3, 0x7DF3, 0x28C8, 0x7DF4, 0x11D6,
+ 0x7DF6, 0x29BD, 0x7DF7, 0x29B4, 0x7DF9, 0x11E4, 0x7DFA, 0x29BB,
+ 0x7DFB, 0x11D8, 0x7E03, 0x29BA, 0x7E08, 0x1322, 0x7E09, 0x1327,
+ 0x7E0A, 0x1320, 0x7E0B, 0x2C1F, 0x7E0C, 0x2C16, 0x7E0D, 0x2C22,
+ 0x7E0E, 0x2C1A, 0x7E0F, 0x2C20, 0x7E10, 0x1328, 0x7E11, 0x1321,
+ 0x7E12, 0x2C13, 0x7E13, 0x2C19, 0x7E14, 0x2C23, 0x7E15, 0x2C1C,
+ 0x7E16, 0x2C21, 0x7E17, 0x2C15, 0x7E1A, 0x2C1D, 0x7E1B, 0x1323,
+ 0x7E1C, 0x2C1B, 0x7E1D, 0x1326, 0x7E1E, 0x1325, 0x7E1F, 0x2C17,
+ 0x7E20, 0x2C18, 0x7E21, 0x2C14, 0x7E22, 0x2C1E, 0x7E23, 0x1324,
+ 0x7E24, 0x2C25, 0x7E25, 0x2C24, 0x7E29, 0x2DF8, 0x7E2A, 0x2DF4,
+ 0x7E2B, 0x143B, 0x7E2D, 0x2DEE, 0x7E2E, 0x1435, 0x7E2F, 0x1445,
+ 0x7E30, 0x2DFA, 0x7E31, 0x143D, 0x7E32, 0x1439, 0x7E33, 0x2DF1,
+ 0x7E34, 0x1440, 0x7E35, 0x1443, 0x7E36, 0x2DFC, 0x7E37, 0x1438,
+ 0x7E38, 0x2DF3, 0x7E39, 0x1441, 0x7E3A, 0x2DFE, 0x7E3B, 0x2DFB,
+ 0x7E3C, 0x2DEF, 0x7E3D, 0x143C, 0x7E3E, 0x1436, 0x7E3F, 0x1444,
+ 0x7E40, 0x2DF6, 0x7E41, 0x143F, 0x7E42, 0x2DF0, 0x7E43, 0x143A,
+ 0x7E44, 0x2DFD, 0x7E45, 0x143E, 0x7E46, 0x1437, 0x7E47, 0x2DF7,
+ 0x7E48, 0x1442, 0x7E49, 0x2DF5, 0x7E4C, 0x2DF9, 0x7E50, 0x2F83,
+ 0x7E51, 0x2F89, 0x7E52, 0x1511, 0x7E53, 0x2F8C, 0x7E54, 0x150C,
+ 0x7E55, 0x150D, 0x7E56, 0x2F84, 0x7E57, 0x2F8B, 0x7E58, 0x2F86,
+ 0x7E59, 0x1512, 0x7E5A, 0x150F, 0x7E5C, 0x2F82, 0x7E5E, 0x150E,
+ 0x7E5F, 0x2F88, 0x7E60, 0x2F8A, 0x7E61, 0x1510, 0x7E62, 0x2F87,
+ 0x7E63, 0x2F85, 0x7E68, 0x30E3, 0x7E69, 0x15AC, 0x7E6A, 0x15AD,
+ 0x7E6B, 0x15A9, 0x7E6D, 0x15AA, 0x7E6F, 0x30DF, 0x7E70, 0x30DD,
+ 0x7E72, 0x30E1, 0x7E73, 0x15AE, 0x7E74, 0x30E2, 0x7E75, 0x30DB,
+ 0x7E76, 0x30DA, 0x7E77, 0x30DE, 0x7E78, 0x30DC, 0x7E79, 0x15AB,
+ 0x7E7A, 0x30E0, 0x7E7B, 0x3214, 0x7E7C, 0x1631, 0x7E7D, 0x1630,
+ 0x7E7E, 0x3215, 0x7E80, 0x3217, 0x7E81, 0x3216, 0x7E82, 0x1632,
+ 0x7E86, 0x32F0, 0x7E87, 0x32ED, 0x7E88, 0x32EE, 0x7E8A, 0x32EC,
+ 0x7E8B, 0x32EF, 0x7E8C, 0x1683, 0x7E8D, 0x32F1, 0x7E8F, 0x1682,
+ 0x7E91, 0x33A2, 0x7E93, 0x1703, 0x7E94, 0x1705, 0x7E95, 0x342C,
+ 0x7E96, 0x1704, 0x7E97, 0x3494, 0x7E98, 0x34DA, 0x7E99, 0x34DC,
+ 0x7E9A, 0x34D9, 0x7E9B, 0x34DB, 0x7E9C, 0x1759, 0x7F36, 0x03F9,
+ 0x7F38, 0x07D4, 0x7F39, 0x1D1F, 0x7F3A, 0x0979, 0x7F3D, 0x0B61,
+ 0x7F3E, 0x2271, 0x7F3F, 0x2272, 0x7F43, 0x2C26, 0x7F44, 0x1446,
+ 0x7F45, 0x2DFF, 0x7F48, 0x1513, 0x7F4A, 0x30E5, 0x7F4B, 0x30E4,
+ 0x7F4C, 0x1633, 0x7F4D, 0x32F2, 0x7F4F, 0x33A3, 0x7F50, 0x1726,
+ 0x7F51, 0x1812, 0x7F54, 0x0668, 0x7F55, 0x04FC, 0x7F58, 0x1BC3,
+ 0x7F5B, 0x1DAD, 0x7F5C, 0x1DA8, 0x7F5D, 0x1DAC, 0x7F5E, 0x1DAA,
+ 0x7F5F, 0x097A, 0x7F60, 0x1DAB, 0x7F61, 0x1DA9, 0x7F63, 0x1FF3,
+ 0x7F65, 0x2273, 0x7F66, 0x2274, 0x7F67, 0x2511, 0x7F68, 0x2512,
+ 0x7F69, 0x0EC5, 0x7F6A, 0x0EC6, 0x7F6B, 0x2510, 0x7F6C, 0x2513,
+ 0x7F6D, 0x250F, 0x7F6E, 0x0EC4, 0x7F70, 0x106E, 0x7F72, 0x0EC7,
+ 0x7F73, 0x2796, 0x7F75, 0x11E5, 0x7F76, 0x29C2, 0x7F77, 0x11E6,
+ 0x7F79, 0x1329, 0x7F7A, 0x2C29, 0x7F7B, 0x2C27, 0x7F7C, 0x2C28,
+ 0x7F7D, 0x2E02, 0x7F7E, 0x2E01, 0x7F7F, 0x2E00, 0x7F83, 0x30E6,
+ 0x7F85, 0x15AF, 0x7F86, 0x30E7, 0x7F87, 0x33A4, 0x7F88, 0x1727,
+ 0x7F89, 0x3495, 0x7F8A, 0x03FA, 0x7F8B, 0x066A, 0x7F8C, 0x0669,
+ 0x7F8D, 0x1BC5, 0x7F8E, 0x07D5, 0x7F91, 0x1BC4, 0x7F92, 0x1DAF,
+ 0x7F94, 0x097B, 0x7F95, 0x1FF4, 0x7F96, 0x1DAE, 0x7F9A, 0x0B63,
+ 0x7F9B, 0x1FF7, 0x7F9C, 0x1FF5, 0x7F9D, 0x1FF6, 0x7F9E, 0x0B62,
+ 0x7FA0, 0x2276, 0x7FA1, 0x2277, 0x7FA2, 0x2275, 0x7FA4, 0x0ECA,
+ 0x7FA5, 0x2515, 0x7FA6, 0x2514, 0x7FA7, 0x2516, 0x7FA8, 0x0EC9,
+ 0x7FA9, 0x0EC8, 0x7FAC, 0x29C3, 0x7FAD, 0x29C5, 0x7FAF, 0x11E7,
+ 0x7FB0, 0x29C4, 0x7FB1, 0x2C2A, 0x7FB2, 0x132A, 0x7FB3, 0x2F8E,
+ 0x7FB5, 0x2F8D, 0x7FB6, 0x15B0, 0x7FB7, 0x30E8, 0x7FB8, 0x15B2,
+ 0x7FB9, 0x15B1, 0x7FBA, 0x3218, 0x7FBB, 0x32F3, 0x7FBC, 0x1684,
+ 0x7FBD, 0x03FB, 0x7FBE, 0x1BC6, 0x7FBF, 0x07D6, 0x7FC0, 0x1DB2,
+ 0x7FC1, 0x097D, 0x7FC2, 0x1DB1, 0x7FC3, 0x1DB0, 0x7FC5, 0x097C,
+ 0x7FC7, 0x1FFD, 0x7FC9, 0x1FFF, 0x7FCA, 0x1FF8, 0x7FCB, 0x1FF9,
+ 0x7FCC, 0x0B64, 0x7FCD, 0x1FFA, 0x7FCE, 0x0B65, 0x7FCF, 0x1FFE,
+ 0x7FD0, 0x1FFB, 0x7FD1, 0x1FFC, 0x7FD2, 0x0B66, 0x7FD4, 0x0D1C,
+ 0x7FD5, 0x0D1D, 0x7FD7, 0x2278, 0x7FDB, 0x2517, 0x7FDC, 0x2518,
+ 0x7FDE, 0x279A, 0x7FDF, 0x1071, 0x7FE0, 0x106F, 0x7FE1, 0x1070,
+ 0x7FE2, 0x2797, 0x7FE3, 0x2798, 0x7FE5, 0x2799, 0x7FE6, 0x29CA,
+ 0x7FE8, 0x29CB, 0x7FE9, 0x11E8, 0x7FEA, 0x29C8, 0x7FEB, 0x29C7,
+ 0x7FEC, 0x29C9, 0x7FED, 0x29C6, 0x7FEE, 0x132D, 0x7FEF, 0x2C2B,
+ 0x7FF0, 0x132B, 0x7FF1, 0x132C, 0x7FF2, 0x2E04, 0x7FF3, 0x1447,
+ 0x7FF4, 0x2E03, 0x7FF5, 0x2EFF, 0x7FF7, 0x2F8F, 0x7FF8, 0x2F90,
+ 0x7FF9, 0x1514, 0x7FFB, 0x1515, 0x7FFC, 0x1448, 0x7FFD, 0x30E9,
+ 0x7FFE, 0x30EA, 0x7FFF, 0x3219, 0x8000, 0x1634, 0x8001, 0x03FC,
+ 0x8003, 0x03FD, 0x8004, 0x097F, 0x8005, 0x066B, 0x8006, 0x097E,
+ 0x8007, 0x1BC7, 0x800B, 0x0D1E, 0x800C, 0x03FE, 0x800D, 0x07D8,
+ 0x800E, 0x1BC8, 0x800F, 0x1BC9, 0x8010, 0x07D7, 0x8011, 0x07D9,
+ 0x8012, 0x03FF, 0x8014, 0x1BCA, 0x8015, 0x0981, 0x8016, 0x1DB3,
+ 0x8017, 0x0983, 0x8018, 0x0980, 0x8019, 0x0982, 0x801B, 0x2002,
+ 0x801C, 0x0B67, 0x801E, 0x2001, 0x801F, 0x2000, 0x8021, 0x2519,
+ 0x8024, 0x279B, 0x8026, 0x11E9, 0x8028, 0x132E, 0x8029, 0x2C2D,
+ 0x802A, 0x2C2C, 0x802C, 0x2E05, 0x8030, 0x32F4, 0x8033, 0x0400,
+ 0x8034, 0x18D8, 0x8035, 0x1A27, 0x8036, 0x07DA, 0x8037, 0x1BCB,
+ 0x8039, 0x1DB5, 0x803D, 0x0984, 0x803E, 0x1DB4, 0x803F, 0x0985,
+ 0x8043, 0x2004, 0x8046, 0x0B69, 0x8047, 0x2003, 0x8048, 0x2005,
+ 0x804A, 0x0B68, 0x804F, 0x227A, 0x8050, 0x227B, 0x8051, 0x2279,
+ 0x8052, 0x0D1F, 0x8056, 0x0ECB, 0x8058, 0x0ECC, 0x805A, 0x1073,
+ 0x805C, 0x279D, 0x805D, 0x279C, 0x805E, 0x1072, 0x8064, 0x29CC,
+ 0x8067, 0x29CD, 0x806C, 0x2C2E, 0x806F, 0x144C, 0x8070, 0x144B,
+ 0x8071, 0x1449, 0x8072, 0x144A, 0x8073, 0x144D, 0x8075, 0x2F91,
+ 0x8076, 0x1517, 0x8077, 0x1516, 0x8078, 0x30EB, 0x8079, 0x321A,
+ 0x807D, 0x16D3, 0x807E, 0x16D2, 0x807F, 0x0401, 0x8082, 0x1CEC,
+ 0x8084, 0x0ECE, 0x8085, 0x0D20, 0x8086, 0x0ECD, 0x8087, 0x1074,
+ 0x8089, 0x0402, 0x808A, 0x17B3, 0x808B, 0x0403, 0x808C, 0x0404,
+ 0x808F, 0x1A28, 0x8090, 0x18DB, 0x8092, 0x18DC, 0x8093, 0x04FE,
+ 0x8095, 0x18D9, 0x8096, 0x04FD, 0x8098, 0x0500, 0x8099, 0x18DA,
+ 0x809A, 0x0502, 0x809B, 0x0501, 0x809C, 0x18DD, 0x809D, 0x04FF,
+ 0x80A1, 0x0670, 0x80A2, 0x066E, 0x80A3, 0x1A2A, 0x80A5, 0x066D,
+ 0x80A9, 0x0672, 0x80AA, 0x0674, 0x80AB, 0x0671, 0x80AD, 0x1A2D,
+ 0x80AE, 0x1A29, 0x80AF, 0x0675, 0x80B1, 0x066F, 0x80B2, 0x0503,
+ 0x80B4, 0x0673, 0x80B5, 0x1A2C, 0x80B8, 0x1A2B, 0x80BA, 0x066C,
+ 0x80C2, 0x1BD1, 0x80C3, 0x07DE, 0x80C4, 0x07DF, 0x80C5, 0x1BD3,
+ 0x80C7, 0x1BCD, 0x80C8, 0x1BD0, 0x80C9, 0x1BD9, 0x80CA, 0x1BD7,
+ 0x80CC, 0x07E0, 0x80CD, 0x1BDD, 0x80CE, 0x07E3, 0x80CF, 0x1BDA,
+ 0x80D0, 0x1BD2, 0x80D1, 0x1BCF, 0x80D4, 0x227D, 0x80D5, 0x1BD8,
+ 0x80D6, 0x07DB, 0x80D7, 0x1BDB, 0x80D8, 0x1BCC, 0x80D9, 0x1BD5,
+ 0x80DA, 0x07DD, 0x80DB, 0x07E2, 0x80DC, 0x1BD6, 0x80DD, 0x07E6,
+ 0x80DE, 0x07E4, 0x80E0, 0x1BCE, 0x80E1, 0x07E1, 0x80E3, 0x1BD4,
+ 0x80E4, 0x07E5, 0x80E5, 0x07DC, 0x80E6, 0x1BDC, 0x80ED, 0x098A,
+ 0x80EF, 0x0993, 0x80F0, 0x0988, 0x80F1, 0x0986, 0x80F2, 0x1DB7,
+ 0x80F3, 0x098E, 0x80F4, 0x098B, 0x80F5, 0x1DB9, 0x80F8, 0x098D,
+ 0x80F9, 0x1DB8, 0x80FA, 0x1DB6, 0x80FB, 0x1DBB, 0x80FC, 0x0992,
+ 0x80FD, 0x0990, 0x80FE, 0x227C, 0x8100, 0x1DBC, 0x8101, 0x1DBA,
+ 0x8102, 0x0987, 0x8105, 0x0989, 0x8106, 0x098C, 0x8108, 0x098F,
+ 0x810A, 0x0991, 0x8115, 0x200F, 0x8116, 0x0B6B, 0x8118, 0x2006,
+ 0x8119, 0x2008, 0x811B, 0x2009, 0x811D, 0x2011, 0x811E, 0x200D,
+ 0x811F, 0x200B, 0x8121, 0x200E, 0x8122, 0x2012, 0x8123, 0x0B6C,
+ 0x8124, 0x0B70, 0x8125, 0x2007, 0x8127, 0x2010, 0x8129, 0x0B6E,
+ 0x812B, 0x0B6D, 0x812C, 0x200C, 0x812D, 0x200A, 0x812F, 0x0B6A,
+ 0x8130, 0x0B6F, 0x8139, 0x0D26, 0x813A, 0x2285, 0x813D, 0x2283,
+ 0x813E, 0x0D28, 0x8143, 0x227E, 0x8144, 0x2527, 0x8146, 0x0D27,
+ 0x8147, 0x2282, 0x814A, 0x227F, 0x814B, 0x0D23, 0x814C, 0x0D29,
+ 0x814D, 0x2284, 0x814E, 0x0D25, 0x814F, 0x2281, 0x8150, 0x1075,
+ 0x8151, 0x0D24, 0x8152, 0x2280, 0x8153, 0x0D2A, 0x8154, 0x0D22,
+ 0x8155, 0x0D21, 0x815B, 0x251F, 0x815C, 0x251D, 0x815E, 0x2523,
+ 0x8160, 0x251B, 0x8161, 0x2528, 0x8162, 0x2520, 0x8164, 0x251A,
+ 0x8165, 0x0ED2, 0x8166, 0x0ED8, 0x8167, 0x2525, 0x8169, 0x251E,
+ 0x816B, 0x0ED5, 0x816E, 0x0ED3, 0x816F, 0x2526, 0x8170, 0x0ED0,
+ 0x8171, 0x0ECF, 0x8172, 0x2521, 0x8173, 0x0ED4, 0x8174, 0x0D2B,
+ 0x8176, 0x2524, 0x8177, 0x251C, 0x8178, 0x0ED1, 0x8179, 0x0ED6,
+ 0x817A, 0x0ED7, 0x817F, 0x107A, 0x8180, 0x1076, 0x8182, 0x107B,
+ 0x8183, 0x27A0, 0x8186, 0x279F, 0x8187, 0x27A1, 0x8188, 0x1078,
+ 0x8189, 0x279E, 0x818A, 0x1079, 0x818B, 0x27A4, 0x818C, 0x27A3,
+ 0x818D, 0x27A2, 0x818F, 0x1077, 0x8195, 0x29D1, 0x8197, 0x29D4,
+ 0x8198, 0x11EF, 0x8199, 0x29D3, 0x819A, 0x11EE, 0x819B, 0x11EA,
+ 0x819C, 0x11EB, 0x819D, 0x11EC, 0x819E, 0x29D0, 0x819F, 0x29CF,
+ 0x81A0, 0x11ED, 0x81A2, 0x29D2, 0x81A3, 0x29CE, 0x81A6, 0x2C30,
+ 0x81A7, 0x2C3A, 0x81A8, 0x1331, 0x81A9, 0x1330, 0x81AB, 0x2C34,
+ 0x81AC, 0x2C36, 0x81AE, 0x2C31, 0x81B0, 0x2C35, 0x81B1, 0x2C2F,
+ 0x81B2, 0x2C38, 0x81B3, 0x132F, 0x81B4, 0x2C37, 0x81B5, 0x2C33,
+ 0x81B7, 0x2C39, 0x81B9, 0x2C32, 0x81BA, 0x1450, 0x81BB, 0x2E06,
+ 0x81BC, 0x2E0C, 0x81BD, 0x1454, 0x81BE, 0x1456, 0x81BF, 0x1453,
+ 0x81C0, 0x1452, 0x81C2, 0x1451, 0x81C3, 0x144F, 0x81C4, 0x2E07,
+ 0x81C5, 0x2E0A, 0x81C6, 0x144E, 0x81C7, 0x2E0B, 0x81C9, 0x1455,
+ 0x81CA, 0x2E09, 0x81CC, 0x2E08, 0x81CD, 0x1518, 0x81CF, 0x1519,
+ 0x81D0, 0x2F94, 0x81D1, 0x2F92, 0x81D2, 0x2F93, 0x81D5, 0x30ED,
+ 0x81D7, 0x30EC, 0x81D8, 0x15B3, 0x81D9, 0x321C, 0x81DA, 0x1635,
+ 0x81DB, 0x321B, 0x81DD, 0x32F5, 0x81DE, 0x33A5, 0x81DF, 0x16D4,
+ 0x81E0, 0x34DD, 0x81E1, 0x34DE, 0x81E2, 0x1706, 0x81E3, 0x0405,
+ 0x81E5, 0x0676, 0x81E6, 0x2286, 0x81E7, 0x107C, 0x81E8, 0x1457,
+ 0x81E9, 0x2E0D, 0x81EA, 0x0406, 0x81EC, 0x0995, 0x81ED, 0x0994,
+ 0x81EE, 0x2287, 0x81F2, 0x2C3B, 0x81F3, 0x0407, 0x81F4, 0x07E7,
+ 0x81F7, 0x2288, 0x81F8, 0x2289, 0x81F9, 0x228A, 0x81FA, 0x107D,
+ 0x81FB, 0x1332, 0x81FC, 0x0408, 0x81FE, 0x0677, 0x81FF, 0x1BDE,
+ 0x8200, 0x0996, 0x8201, 0x1DBD, 0x8202, 0x0B71, 0x8204, 0x228B,
+ 0x8205, 0x0ED9, 0x8207, 0x107E, 0x8208, 0x1333, 0x8209, 0x1458,
+ 0x820A, 0x151A, 0x820B, 0x30EE, 0x820C, 0x0409, 0x820D, 0x0678,
+ 0x8210, 0x0997, 0x8211, 0x2013, 0x8212, 0x0D2C, 0x8214, 0x107F,
+ 0x8215, 0x27A5, 0x8216, 0x29D5, 0x821B, 0x040A, 0x821C, 0x0D2D,
+ 0x821D, 0x2529, 0x821E, 0x1080, 0x821F, 0x040B, 0x8220, 0x1A2E,
+ 0x8221, 0x1BDF, 0x8222, 0x07E8, 0x8225, 0x1DBF, 0x8228, 0x099A,
+ 0x822A, 0x0998, 0x822B, 0x0999, 0x822C, 0x099B, 0x822F, 0x1DBE,
+ 0x8232, 0x2018, 0x8233, 0x2015, 0x8234, 0x2017, 0x8235, 0x0B72,
+ 0x8236, 0x0B74, 0x8237, 0x0B73, 0x8238, 0x2014, 0x8239, 0x0B75,
+ 0x823A, 0x2016, 0x823C, 0x228C, 0x823D, 0x228D, 0x823F, 0x228E,
+ 0x8240, 0x252C, 0x8242, 0x252D, 0x8244, 0x252B, 0x8245, 0x252E,
+ 0x8247, 0x0EDA, 0x8249, 0x252A, 0x824B, 0x1081, 0x824E, 0x29DA,
+ 0x824F, 0x29D6, 0x8250, 0x29D9, 0x8251, 0x29DB, 0x8252, 0x29D8,
+ 0x8253, 0x29D7, 0x8255, 0x2C3C, 0x8256, 0x2C3D, 0x8257, 0x2C3E,
+ 0x8258, 0x1334, 0x8259, 0x1335, 0x825A, 0x2E0F, 0x825B, 0x2E0E,
+ 0x825C, 0x2E10, 0x825E, 0x2F96, 0x825F, 0x2F95, 0x8261, 0x30F0,
+ 0x8263, 0x30F1, 0x8264, 0x30EF, 0x8266, 0x1636, 0x8268, 0x321D,
+ 0x8269, 0x321E, 0x826B, 0x33A6, 0x826C, 0x342D, 0x826D, 0x3496,
+ 0x826E, 0x040C, 0x826F, 0x0504, 0x8271, 0x1459, 0x8272, 0x040D,
+ 0x8274, 0x2019, 0x8275, 0x228F, 0x8277, 0x172E, 0x8278, 0x1813,
+ 0x827C, 0x1814, 0x827D, 0x1816, 0x827E, 0x040E, 0x827F, 0x1817,
+ 0x8280, 0x1815, 0x8283, 0x18E5, 0x8284, 0x18E6, 0x8285, 0x18E0,
+ 0x828A, 0x18E4, 0x828B, 0x0506, 0x828D, 0x0507, 0x828E, 0x18E1,
+ 0x828F, 0x18DF, 0x8290, 0x18DE, 0x8291, 0x18E2, 0x8292, 0x0505,
+ 0x8293, 0x18E3, 0x8294, 0x1BE0, 0x8298, 0x1A33, 0x8299, 0x067B,
+ 0x829A, 0x1A32, 0x829B, 0x1A34, 0x829D, 0x067A, 0x829E, 0x1A39,
+ 0x829F, 0x067E, 0x82A0, 0x1A2F, 0x82A1, 0x1A3D, 0x82A2, 0x1A43,
+ 0x82A3, 0x0685, 0x82A4, 0x1A40, 0x82A5, 0x0682, 0x82A7, 0x1A36,
+ 0x82A8, 0x1A3C, 0x82A9, 0x1A3E, 0x82AB, 0x1A31, 0x82AC, 0x0681,
+ 0x82AD, 0x067C, 0x82AE, 0x1A37, 0x82AF, 0x0683, 0x82B0, 0x0686,
+ 0x82B1, 0x0680, 0x82B3, 0x0679, 0x82B4, 0x1A3B, 0x82B5, 0x1A35,
+ 0x82B6, 0x1A42, 0x82B7, 0x0688, 0x82B8, 0x0684, 0x82B9, 0x067F,
+ 0x82BA, 0x1A3A, 0x82BB, 0x099C, 0x82BC, 0x1A38, 0x82BD, 0x067D,
+ 0x82BE, 0x0687, 0x82C0, 0x1A30, 0x82C2, 0x1A3F, 0x82C3, 0x1A41,
+ 0x82D1, 0x07F9, 0x82D2, 0x07F3, 0x82D3, 0x07FB, 0x82D4, 0x07F8,
+ 0x82D5, 0x1BE7, 0x82D6, 0x1BEA, 0x82D7, 0x07F4, 0x82D9, 0x1BE1,
+ 0x82DB, 0x07ED, 0x82DC, 0x07F7, 0x82DE, 0x07FA, 0x82DF, 0x07FC,
+ 0x82E0, 0x1BF6, 0x82E1, 0x1BED, 0x82E3, 0x07EC, 0x82E4, 0x1BF5,
+ 0x82E5, 0x07F0, 0x82E6, 0x07EE, 0x82E7, 0x07E9, 0x82E8, 0x1BE5,
+ 0x82EA, 0x1BF4, 0x82EB, 0x1BE9, 0x82EC, 0x1BEC, 0x82ED, 0x1BF9,
+ 0x82EF, 0x07FD, 0x82F0, 0x1BF3, 0x82F1, 0x07F5, 0x82F2, 0x1BEE,
+ 0x82F3, 0x1BF8, 0x82F4, 0x1BEB, 0x82F5, 0x1BEF, 0x82F6, 0x1BF2,
+ 0x82F9, 0x1BE3, 0x82FA, 0x1BF7, 0x82FB, 0x1BF1, 0x82FE, 0x1BE2,
+ 0x8300, 0x1BE6, 0x8301, 0x07F6, 0x8302, 0x07F1, 0x8303, 0x07EA,
+ 0x8304, 0x07EF, 0x8305, 0x07EB, 0x8306, 0x07FE, 0x8307, 0x1BE4,
+ 0x8308, 0x1DD0, 0x8309, 0x07F2, 0x830C, 0x1BF0, 0x830D, 0x1A7D,
+ 0x8316, 0x1DD3, 0x8317, 0x09AA, 0x8319, 0x1DC3, 0x831B, 0x1DCE,
+ 0x831C, 0x1DCA, 0x831E, 0x1DDD, 0x8320, 0x1DD5, 0x8322, 0x1DCB,
+ 0x8324, 0x1DD4, 0x8325, 0x1DC5, 0x8326, 0x1DC9, 0x8327, 0x1DE0,
+ 0x8328, 0x09AD, 0x8329, 0x1DD8, 0x832A, 0x1DCF, 0x832B, 0x099D,
+ 0x832C, 0x1DDE, 0x832D, 0x1DC1, 0x832F, 0x1DD7, 0x8331, 0x09AC,
+ 0x8332, 0x09A7, 0x8333, 0x1DC0, 0x8334, 0x09A5, 0x8335, 0x09A4,
+ 0x8336, 0x09A9, 0x8337, 0x1DD6, 0x8338, 0x09A1, 0x8339, 0x09A8,
+ 0x833A, 0x1BE8, 0x833B, 0x2290, 0x833C, 0x1DD1, 0x833F, 0x1DC7,
+ 0x8340, 0x09AB, 0x8341, 0x1DC8, 0x8342, 0x1DCC, 0x8343, 0x09AE,
+ 0x8344, 0x1DC2, 0x8345, 0x1DDA, 0x8347, 0x1DD9, 0x8348, 0x1DE1,
+ 0x8349, 0x09A3, 0x834A, 0x09A0, 0x834B, 0x1DDF, 0x834C, 0x1DDB,
+ 0x834D, 0x1DD2, 0x834E, 0x1DCD, 0x834F, 0x09A6, 0x8350, 0x09A2,
+ 0x8351, 0x1DC4, 0x8352, 0x099E, 0x8353, 0x1DDC, 0x8354, 0x099F,
+ 0x8356, 0x1DC6, 0x8373, 0x201F, 0x8374, 0x2021, 0x8375, 0x2026,
+ 0x8376, 0x203A, 0x8377, 0x0B83, 0x8378, 0x0B79, 0x837A, 0x201E,
+ 0x837B, 0x0B84, 0x837C, 0x0B85, 0x837D, 0x2029, 0x837E, 0x2030,
+ 0x837F, 0x2036, 0x8381, 0x2023, 0x8383, 0x202A, 0x8386, 0x0B86,
+ 0x8387, 0x2038, 0x8388, 0x2033, 0x8389, 0x0B81, 0x838A, 0x0B7F,
+ 0x838B, 0x202F, 0x838C, 0x202B, 0x838D, 0x201D, 0x838E, 0x0B76,
+ 0x838F, 0x2022, 0x8390, 0x201A, 0x8392, 0x0B7E, 0x8393, 0x0B80,
+ 0x8394, 0x2027, 0x8395, 0x2024, 0x8396, 0x0B7B, 0x8397, 0x2034,
+ 0x8398, 0x0B78, 0x8399, 0x2025, 0x839A, 0x22B9, 0x839B, 0x202D,
+ 0x839D, 0x202C, 0x839E, 0x0B77, 0x83A0, 0x0B82, 0x83A2, 0x0B7A,
+ 0x83A3, 0x201B, 0x83A4, 0x2020, 0x83A5, 0x2031, 0x83A6, 0x2037,
+ 0x83A7, 0x0B87, 0x83A8, 0x201C, 0x83A9, 0x2028, 0x83AA, 0x202E,
+ 0x83AB, 0x0B7D, 0x83AE, 0x2039, 0x83AF, 0x2032, 0x83B0, 0x2035,
+ 0x83BD, 0x0B7C, 0x83BF, 0x22A0, 0x83C0, 0x2294, 0x83C1, 0x0D35,
+ 0x83C2, 0x22B1, 0x83C3, 0x22BA, 0x83C4, 0x22BD, 0x83C5, 0x0D33,
+ 0x83C6, 0x229C, 0x83C7, 0x22B5, 0x83C8, 0x229D, 0x83C9, 0x22AB,
+ 0x83CA, 0x0D40, 0x83CB, 0x22A7, 0x83CC, 0x0D3D, 0x83CE, 0x22A8,
+ 0x83CF, 0x2291, 0x83D1, 0x22B6, 0x83D4, 0x0D46, 0x83D5, 0x22B3,
+ 0x83D6, 0x22A9, 0x83D7, 0x22BF, 0x83D8, 0x22A4, 0x83D9, 0x254E,
+ 0x83DB, 0x22C2, 0x83DC, 0x0D44, 0x83DD, 0x22A2, 0x83DE, 0x22AE,
+ 0x83DF, 0x0D47, 0x83E0, 0x0D32, 0x83E1, 0x22A6, 0x83E2, 0x22C0,
+ 0x83E3, 0x229F, 0x83E4, 0x2298, 0x83E5, 0x22A3, 0x83E7, 0x2297,
+ 0x83E8, 0x2295, 0x83E9, 0x0D2E, 0x83EA, 0x22B7, 0x83EB, 0x229E,
+ 0x83EC, 0x22BB, 0x83EE, 0x22BC, 0x83EF, 0x0D36, 0x83F0, 0x0D3B,
+ 0x83F1, 0x0D37, 0x83F2, 0x0D3F, 0x83F3, 0x22B2, 0x83F4, 0x0D38,
+ 0x83F5, 0x22AA, 0x83F6, 0x229A, 0x83F8, 0x0D30, 0x83F9, 0x2292,
+ 0x83FA, 0x22B4, 0x83FB, 0x22BE, 0x83FC, 0x2299, 0x83FD, 0x0D3E,
+ 0x83FE, 0x22C3, 0x83FF, 0x22A5, 0x8401, 0x22A1, 0x8403, 0x0D2F,
+ 0x8404, 0x0D43, 0x8406, 0x22B0, 0x8407, 0x0D45, 0x8409, 0x22AC,
+ 0x840A, 0x0D3A, 0x840B, 0x0D34, 0x840C, 0x0D3C, 0x840D, 0x0D31,
+ 0x840E, 0x0D42, 0x840F, 0x22AD, 0x8410, 0x229B, 0x8411, 0x22AF,
+ 0x8412, 0x2296, 0x8413, 0x22B8, 0x841B, 0x22C1, 0x8423, 0x2293,
+ 0x8429, 0x254D, 0x842B, 0x2563, 0x842C, 0x0EAC, 0x842D, 0x2552,
+ 0x842F, 0x2550, 0x8430, 0x253B, 0x8431, 0x0EDE, 0x8432, 0x254B,
+ 0x8433, 0x255F, 0x8434, 0x2547, 0x8435, 0x0EE6, 0x8436, 0x255E,
+ 0x8437, 0x2545, 0x8438, 0x0D41, 0x8439, 0x2555, 0x843A, 0x2546,
+ 0x843B, 0x255C, 0x843C, 0x0EE5, 0x843D, 0x0EDD, 0x843F, 0x2530,
+ 0x8440, 0x2538, 0x8442, 0x2551, 0x8443, 0x2549, 0x8444, 0x2562,
+ 0x8445, 0x254C, 0x8446, 0x0EEB, 0x8447, 0x255D, 0x8449, 0x0EE2,
+ 0x844B, 0x254F, 0x844C, 0x2557, 0x844D, 0x253C, 0x844E, 0x2556,
+ 0x8450, 0x2567, 0x8451, 0x2537, 0x8452, 0x2558, 0x8454, 0x2565,
+ 0x8456, 0x2531, 0x8457, 0x0D39, 0x8459, 0x253F, 0x845A, 0x253E,
+ 0x845B, 0x0EE4, 0x845D, 0x2542, 0x845E, 0x2544, 0x845F, 0x2553,
+ 0x8460, 0x2564, 0x8461, 0x0EE7, 0x8463, 0x0EE8, 0x8465, 0x2536,
+ 0x8466, 0x0EE0, 0x8467, 0x253A, 0x8468, 0x2560, 0x8469, 0x0EE9,
+ 0x846B, 0x0EE1, 0x846C, 0x0EE3, 0x846D, 0x0EEA, 0x846E, 0x2566,
+ 0x846F, 0x2559, 0x8470, 0x2554, 0x8473, 0x2541, 0x8474, 0x2540,
+ 0x8475, 0x0EDF, 0x8476, 0x2532, 0x8477, 0x0EDC, 0x8478, 0x254A,
+ 0x8479, 0x2533, 0x847A, 0x2548, 0x847D, 0x253D, 0x847E, 0x2561,
+ 0x8482, 0x0EDB, 0x8486, 0x2539, 0x848D, 0x2535, 0x848E, 0x255B,
+ 0x848F, 0x2534, 0x8490, 0x108E, 0x8491, 0x27CD, 0x8494, 0x27BC,
+ 0x8497, 0x27A6, 0x8498, 0x27C4, 0x8499, 0x1086, 0x849A, 0x27B5,
+ 0x849B, 0x27BF, 0x849C, 0x1089, 0x849D, 0x27B8, 0x849E, 0x1087,
+ 0x849F, 0x27A9, 0x84A0, 0x27C7, 0x84A1, 0x27A8, 0x84A2, 0x27BB,
+ 0x84A4, 0x27A7, 0x84A7, 0x27B9, 0x84A8, 0x27C2, 0x84A9, 0x27C0,
+ 0x84AA, 0x27B4, 0x84AB, 0x27AF, 0x84AC, 0x27AD, 0x84AE, 0x27AE,
+ 0x84AF, 0x27C1, 0x84B0, 0x27CC, 0x84B1, 0x27B6, 0x84B2, 0x1088,
+ 0x84B4, 0x27B1, 0x84B6, 0x27C5, 0x84B8, 0x108B, 0x84B9, 0x27B0,
+ 0x84BA, 0x27AA, 0x84BB, 0x27BA, 0x84BC, 0x108F, 0x84BF, 0x1083,
+ 0x84C0, 0x108C, 0x84C1, 0x27B2, 0x84C2, 0x27AC, 0x84C4, 0x1085,
+ 0x84C5, 0x255A, 0x84C6, 0x1084, 0x84C7, 0x27BD, 0x84C9, 0x1082,
+ 0x84CA, 0x1091, 0x84CB, 0x108A, 0x84CC, 0x27BE, 0x84CD, 0x27B3,
+ 0x84CE, 0x27AB, 0x84CF, 0x27C6, 0x84D0, 0x27B7, 0x84D1, 0x1090,
+ 0x84D2, 0x27CA, 0x84D3, 0x108D, 0x84D4, 0x27C9, 0x84D6, 0x27C3,
+ 0x84D7, 0x27C8, 0x84DB, 0x27CB, 0x84E7, 0x2A03, 0x84E8, 0x2A04,
+ 0x84E9, 0x29F7, 0x84EA, 0x29F6, 0x84EB, 0x29F2, 0x84EC, 0x11FB,
+ 0x84EE, 0x11F3, 0x84EF, 0x2A06, 0x84F0, 0x2A05, 0x84F1, 0x252F,
+ 0x84F2, 0x29EF, 0x84F3, 0x29F3, 0x84F4, 0x29ED, 0x84F6, 0x2A00,
+ 0x84F7, 0x29F1, 0x84F9, 0x2A07, 0x84FA, 0x29EA, 0x84FB, 0x29E8,
+ 0x84FC, 0x29F4, 0x84FD, 0x29FE, 0x84FE, 0x29F9, 0x84FF, 0x11FD,
+ 0x8500, 0x29DF, 0x8502, 0x29FD, 0x8506, 0x11FE, 0x8507, 0x2543,
+ 0x8508, 0x29EB, 0x8509, 0x29E2, 0x850A, 0x29E5, 0x850B, 0x2A0B,
+ 0x850C, 0x29EC, 0x850D, 0x29E3, 0x850E, 0x29E1, 0x850F, 0x29DE,
+ 0x8511, 0x11F7, 0x8512, 0x29F5, 0x8513, 0x11F6, 0x8514, 0x11FA,
+ 0x8515, 0x29F0, 0x8516, 0x29F8, 0x8517, 0x11F0, 0x8518, 0x2A08,
+ 0x8519, 0x2A0C, 0x851A, 0x11F2, 0x851C, 0x29E7, 0x851D, 0x29FB,
+ 0x851E, 0x29FF, 0x851F, 0x29E4, 0x8520, 0x2A09, 0x8521, 0x11F9,
+ 0x8523, 0x11F8, 0x8524, 0x29DC, 0x8525, 0x11FC, 0x8526, 0x2A02,
+ 0x8527, 0x29E6, 0x8528, 0x29FA, 0x8529, 0x29E0, 0x852A, 0x29EE,
+ 0x852B, 0x29E9, 0x852C, 0x11F4, 0x852D, 0x11F5, 0x852E, 0x29FC,
+ 0x852F, 0x2A0D, 0x8530, 0x2A0A, 0x8531, 0x2A01, 0x853B, 0x29DD,
+ 0x853D, 0x11F1, 0x853E, 0x2C4F, 0x8540, 0x2C46, 0x8541, 0x2C49,
+ 0x8543, 0x133B, 0x8544, 0x2C4B, 0x8545, 0x2C40, 0x8546, 0x2C47,
+ 0x8547, 0x2C4D, 0x8548, 0x1338, 0x8549, 0x133C, 0x854A, 0x1336,
+ 0x854D, 0x2C42, 0x854E, 0x2C52, 0x8551, 0x2C4C, 0x8553, 0x2C43,
+ 0x8554, 0x2C5B, 0x8555, 0x2C55, 0x8556, 0x2C3F, 0x8557, 0x2E23,
+ 0x8558, 0x2C45, 0x8559, 0x1337, 0x855B, 0x2C50, 0x855D, 0x2C5A,
+ 0x855E, 0x133F, 0x8560, 0x2C57, 0x8561, 0x2C44, 0x8562, 0x2C4A,
+ 0x8563, 0x2C4E, 0x8564, 0x2C48, 0x8565, 0x2C5C, 0x8566, 0x2C59,
+ 0x8567, 0x2C56, 0x8568, 0x1339, 0x8569, 0x133A, 0x856A, 0x133E,
+ 0x856B, 0x2C41, 0x856C, 0x2C5D, 0x856D, 0x133D, 0x856E, 0x2C53,
+ 0x8571, 0x2C51, 0x8575, 0x2C54, 0x8576, 0x2E30, 0x8577, 0x2E1D,
+ 0x8578, 0x2E22, 0x8579, 0x2E2F, 0x857A, 0x2E21, 0x857B, 0x2E19,
+ 0x857C, 0x2E1E, 0x857E, 0x145C, 0x8580, 0x2E12, 0x8581, 0x2E2A,
+ 0x8582, 0x2E2C, 0x8583, 0x2E11, 0x8584, 0x145B, 0x8585, 0x2E2E,
+ 0x8586, 0x2E26, 0x8587, 0x1462, 0x8588, 0x2E2D, 0x8589, 0x2E1F,
+ 0x858A, 0x1464, 0x858B, 0x2E17, 0x858C, 0x2C58, 0x858D, 0x2E27,
+ 0x858E, 0x2E24, 0x858F, 0x2E13, 0x8590, 0x2E32, 0x8591, 0x145E,
+ 0x8594, 0x145F, 0x8595, 0x2E15, 0x8596, 0x2E25, 0x8598, 0x2E31,
+ 0x8599, 0x2E28, 0x859A, 0x2E1B, 0x859B, 0x1461, 0x859C, 0x145D,
+ 0x859D, 0x2E29, 0x859E, 0x2E1C, 0x859F, 0x2E33, 0x85A0, 0x2E16,
+ 0x85A1, 0x2E20, 0x85A2, 0x2E2B, 0x85A3, 0x2E18, 0x85A4, 0x2E1A,
+ 0x85A6, 0x1465, 0x85A7, 0x2E14, 0x85A8, 0x1463, 0x85A9, 0x151C,
+ 0x85AA, 0x145A, 0x85AF, 0x1460, 0x85B0, 0x1520, 0x85B1, 0x2FA6,
+ 0x85B3, 0x2F9C, 0x85B4, 0x2F97, 0x85B5, 0x2F9D, 0x85B6, 0x2FA7,
+ 0x85B7, 0x2FAB, 0x85B8, 0x2FAA, 0x85B9, 0x1522, 0x85BA, 0x1521,
+ 0x85BD, 0x2F9E, 0x85BE, 0x2FAC, 0x85BF, 0x2FA1, 0x85C0, 0x2F99,
+ 0x85C2, 0x2F9B, 0x85C3, 0x2F9A, 0x85C4, 0x2FA0, 0x85C5, 0x2FA5,
+ 0x85C6, 0x2F98, 0x85C7, 0x2F9F, 0x85C8, 0x2FA4, 0x85C9, 0x151F,
+ 0x85CB, 0x2FA2, 0x85CD, 0x151D, 0x85CE, 0x2FA3, 0x85CF, 0x151B,
+ 0x85D0, 0x151E, 0x85D1, 0x3101, 0x85D2, 0x2FA8, 0x85D5, 0x15B7,
+ 0x85D7, 0x30F9, 0x85D8, 0x30FD, 0x85D9, 0x30F5, 0x85DA, 0x30F8,
+ 0x85DC, 0x3100, 0x85DD, 0x15B5, 0x85DE, 0x3105, 0x85DF, 0x30FE,
+ 0x85E1, 0x30F6, 0x85E2, 0x3106, 0x85E3, 0x30FF, 0x85E4, 0x15B8,
+ 0x85E5, 0x15B9, 0x85E6, 0x3103, 0x85E8, 0x30F7, 0x85E9, 0x15B4,
+ 0x85EA, 0x15B6, 0x85EB, 0x30F2, 0x85EC, 0x30FA, 0x85ED, 0x30F4,
+ 0x85EF, 0x3104, 0x85F0, 0x3102, 0x85F1, 0x30F3, 0x85F2, 0x30FB,
+ 0x85F6, 0x3225, 0x85F7, 0x15BA, 0x85F8, 0x30FC, 0x85F9, 0x1638,
+ 0x85FA, 0x163A, 0x85FB, 0x1637, 0x85FD, 0x322A, 0x85FE, 0x3222,
+ 0x85FF, 0x3220, 0x8600, 0x3224, 0x8601, 0x3221, 0x8604, 0x3226,
+ 0x8605, 0x3228, 0x8606, 0x163B, 0x8607, 0x163D, 0x8609, 0x3227,
+ 0x860A, 0x163E, 0x860B, 0x163C, 0x860C, 0x3229, 0x8611, 0x1639,
+ 0x8617, 0x1685, 0x8618, 0x32F6, 0x8619, 0x32FC, 0x861A, 0x1687,
+ 0x861B, 0x3223, 0x861C, 0x32FB, 0x861E, 0x3302, 0x861F, 0x32F9,
+ 0x8620, 0x3300, 0x8621, 0x32FF, 0x8622, 0x321F, 0x8623, 0x32FA,
+ 0x8624, 0x2FA9, 0x8625, 0x3303, 0x8626, 0x32F8, 0x8627, 0x32FD,
+ 0x8629, 0x3301, 0x862A, 0x32F7, 0x862C, 0x33AA, 0x862D, 0x1686,
+ 0x862E, 0x32FE, 0x8631, 0x3432, 0x8632, 0x33AB, 0x8633, 0x33A9,
+ 0x8634, 0x33A7, 0x8635, 0x33A8, 0x8636, 0x33AC, 0x8638, 0x1707,
+ 0x8639, 0x3430, 0x863A, 0x342E, 0x863B, 0x3433, 0x863C, 0x3431,
+ 0x863E, 0x3434, 0x863F, 0x1708, 0x8640, 0x342F, 0x8643, 0x3497,
+ 0x8646, 0x34DF, 0x8647, 0x34E0, 0x8648, 0x34E1, 0x864B, 0x353E,
+ 0x864C, 0x3536, 0x864D, 0x1818, 0x864E, 0x0689, 0x8650, 0x07FF,
+ 0x8652, 0x1DE3, 0x8653, 0x1DE2, 0x8654, 0x09AF, 0x8655, 0x0B88,
+ 0x8656, 0x203C, 0x8659, 0x203B, 0x865B, 0x0D48, 0x865C, 0x0EED,
+ 0x865E, 0x0EEC, 0x865F, 0x0EEE, 0x8661, 0x27CE, 0x8662, 0x2A0E,
+ 0x8663, 0x2C5E, 0x8664, 0x2C60, 0x8665, 0x2C5F, 0x8667, 0x1466,
+ 0x8668, 0x2E34, 0x8669, 0x2FAD, 0x866A, 0x351E, 0x866B, 0x040F,
+ 0x866D, 0x1A46, 0x866E, 0x1A47, 0x866F, 0x1A45, 0x8670, 0x1A44,
+ 0x8671, 0x068A, 0x8673, 0x1BFD, 0x8674, 0x1BFB, 0x8677, 0x1BFA,
+ 0x8679, 0x0800, 0x867A, 0x0802, 0x867B, 0x0801, 0x867C, 0x1BFC,
+ 0x8685, 0x1DEF, 0x8686, 0x1DEC, 0x8687, 0x1DEA, 0x868A, 0x09B0,
+ 0x868B, 0x1DED, 0x868C, 0x09B5, 0x868D, 0x1DE7, 0x868E, 0x1DF6,
+ 0x8690, 0x1DF8, 0x8691, 0x1DE8, 0x8693, 0x09B2, 0x8694, 0x1DF9,
+ 0x8695, 0x1DF4, 0x8696, 0x1DE6, 0x8697, 0x1DEB, 0x8698, 0x1DF5,
+ 0x8699, 0x1DF1, 0x869A, 0x1DEE, 0x869C, 0x09B7, 0x869D, 0x1DF7,
+ 0x869E, 0x1DE9, 0x86A1, 0x1DF2, 0x86A2, 0x1DE4, 0x86A3, 0x09B6,
+ 0x86A4, 0x09B3, 0x86A5, 0x1DF0, 0x86A7, 0x1DF3, 0x86A8, 0x1DE5,
+ 0x86A9, 0x09B4, 0x86AA, 0x09B1, 0x86AF, 0x0B92, 0x86B0, 0x2043,
+ 0x86B1, 0x0B91, 0x86B3, 0x2046, 0x86B4, 0x2049, 0x86B5, 0x0B8E,
+ 0x86B6, 0x0B8C, 0x86B7, 0x203E, 0x86B8, 0x2047, 0x86B9, 0x2045,
+ 0x86BA, 0x2042, 0x86BB, 0x204A, 0x86BC, 0x204B, 0x86BD, 0x204D,
+ 0x86BE, 0x204E, 0x86BF, 0x203D, 0x86C0, 0x0B8B, 0x86C1, 0x2040,
+ 0x86C2, 0x203F, 0x86C3, 0x204C, 0x86C4, 0x0B8D, 0x86C5, 0x2041,
+ 0x86C6, 0x0B8F, 0x86C7, 0x0B8A, 0x86C8, 0x2044, 0x86C9, 0x0B93,
+ 0x86CB, 0x0B90, 0x86CC, 0x2048, 0x86D0, 0x0D4F, 0x86D1, 0x22D2,
+ 0x86D3, 0x22C7, 0x86D4, 0x0D4C, 0x86D6, 0x256D, 0x86D7, 0x22D0,
+ 0x86D8, 0x22C4, 0x86D9, 0x0D4A, 0x86DA, 0x22C9, 0x86DB, 0x0D4D,
+ 0x86DC, 0x22CD, 0x86DD, 0x22CB, 0x86DE, 0x0D50, 0x86DF, 0x0D49,
+ 0x86E2, 0x22C5, 0x86E3, 0x22C8, 0x86E4, 0x0D4E, 0x86E6, 0x22C6,
+ 0x86E8, 0x22D1, 0x86E9, 0x22CF, 0x86EA, 0x22CA, 0x86EB, 0x22CC,
+ 0x86EC, 0x22CE, 0x86ED, 0x0D4B, 0x86F5, 0x256E, 0x86F6, 0x2574,
+ 0x86F7, 0x256A, 0x86F8, 0x2570, 0x86F9, 0x0EEF, 0x86FA, 0x256C,
+ 0x86FB, 0x0EF5, 0x86FE, 0x0EF4, 0x8700, 0x0EF3, 0x8701, 0x2573,
+ 0x8702, 0x0EF6, 0x8703, 0x0EF7, 0x8704, 0x2569, 0x8705, 0x2576,
+ 0x8706, 0x0EF8, 0x8707, 0x0EF2, 0x8708, 0x0EF1, 0x8709, 0x2572,
+ 0x870A, 0x0EF9, 0x870B, 0x2568, 0x870C, 0x256B, 0x870D, 0x2575,
+ 0x870E, 0x2571, 0x8711, 0x27EE, 0x8712, 0x27E3, 0x8713, 0x0EF0,
+ 0x8718, 0x1098, 0x8719, 0x27D7, 0x871A, 0x27EC, 0x871B, 0x27D8,
+ 0x871C, 0x1093, 0x871E, 0x27D5, 0x8720, 0x27DE, 0x8721, 0x27D6,
+ 0x8722, 0x1095, 0x8723, 0x27D0, 0x8724, 0x27EB, 0x8725, 0x1096,
+ 0x8726, 0x27E8, 0x8727, 0x27E9, 0x8728, 0x27D1, 0x8729, 0x109B,
+ 0x872A, 0x27E0, 0x872C, 0x27DA, 0x872D, 0x27E1, 0x872E, 0x27D4,
+ 0x8730, 0x27ED, 0x8731, 0x27E5, 0x8732, 0x27DF, 0x8733, 0x27CF,
+ 0x8734, 0x1097, 0x8735, 0x27E6, 0x8737, 0x109A, 0x8738, 0x27EA,
+ 0x873A, 0x27E4, 0x873B, 0x1094, 0x873C, 0x27E2, 0x873E, 0x27DC,
+ 0x873F, 0x1092, 0x8740, 0x27D3, 0x8741, 0x27DB, 0x8742, 0x27E7,
+ 0x8743, 0x27D9, 0x8746, 0x27DD, 0x874C, 0x1208, 0x874D, 0x256F,
+ 0x874E, 0x2A20, 0x874F, 0x2A29, 0x8750, 0x2A1F, 0x8751, 0x2A1B,
+ 0x8752, 0x2A18, 0x8753, 0x1209, 0x8754, 0x2A16, 0x8755, 0x1099,
+ 0x8756, 0x2A0F, 0x8757, 0x1207, 0x8758, 0x2A15, 0x8759, 0x1206,
+ 0x875A, 0x2A1A, 0x875B, 0x2A17, 0x875C, 0x2A27, 0x875D, 0x2A22,
+ 0x875E, 0x2A1C, 0x875F, 0x2A21, 0x8760, 0x1202, 0x8761, 0x2A19,
+ 0x8762, 0x2A2C, 0x8763, 0x2A10, 0x8764, 0x2A11, 0x8765, 0x2A28,
+ 0x8766, 0x1203, 0x8767, 0x2A2D, 0x8768, 0x1205, 0x8769, 0x2A2E,
+ 0x876A, 0x2A1E, 0x876B, 0x27D2, 0x876C, 0x2A24, 0x876D, 0x2A1D,
+ 0x876E, 0x2A26, 0x876F, 0x2A23, 0x8773, 0x2A14, 0x8774, 0x1200,
+ 0x8775, 0x2A2B, 0x8776, 0x1201, 0x8777, 0x2A12, 0x8778, 0x1204,
+ 0x8779, 0x2C6B, 0x877A, 0x2A25, 0x877B, 0x2A2A, 0x8781, 0x2C68,
+ 0x8782, 0x11FF, 0x8783, 0x1340, 0x8784, 0x2C72, 0x8785, 0x2C6E,
+ 0x8787, 0x2C6C, 0x8788, 0x2C67, 0x8789, 0x2C76, 0x878D, 0x1344,
+ 0x878F, 0x2C63, 0x8790, 0x2C6F, 0x8791, 0x2C70, 0x8792, 0x2C66,
+ 0x8793, 0x2C65, 0x8794, 0x2C73, 0x8796, 0x2C69, 0x8797, 0x2C64,
+ 0x8798, 0x2C6A, 0x879A, 0x2C75, 0x879B, 0x2C62, 0x879C, 0x2C74,
+ 0x879D, 0x2C71, 0x879E, 0x1342, 0x879F, 0x1341, 0x87A2, 0x1343,
+ 0x87A3, 0x2C6D, 0x87A4, 0x2C61, 0x87AA, 0x2E36, 0x87AB, 0x146C,
+ 0x87AC, 0x2E3A, 0x87AD, 0x2E37, 0x87AE, 0x2E3E, 0x87AF, 0x2E44,
+ 0x87B0, 0x2E39, 0x87B2, 0x2E4D, 0x87B3, 0x1469, 0x87B4, 0x2E47,
+ 0x87B5, 0x2E3C, 0x87B6, 0x2E48, 0x87B7, 0x2E43, 0x87B8, 0x2E4A,
+ 0x87B9, 0x2E3B, 0x87BA, 0x146E, 0x87BB, 0x146D, 0x87BC, 0x2E3D,
+ 0x87BD, 0x2E4B, 0x87BE, 0x2E35, 0x87BF, 0x2E49, 0x87C0, 0x1467,
+ 0x87C2, 0x2E41, 0x87C3, 0x2E40, 0x87C4, 0x2E45, 0x87C5, 0x2E38,
+ 0x87C6, 0x146B, 0x87C8, 0x146F, 0x87C9, 0x2E3F, 0x87CA, 0x2E46,
+ 0x87CB, 0x1470, 0x87CC, 0x2E42, 0x87D1, 0x1468, 0x87D2, 0x146A,
+ 0x87D3, 0x2FBA, 0x87D4, 0x2FB8, 0x87D7, 0x2FBE, 0x87D8, 0x2FBC,
+ 0x87D9, 0x2FBF, 0x87DB, 0x2FB1, 0x87DC, 0x2FB9, 0x87DD, 0x2FC3,
+ 0x87DE, 0x2E4C, 0x87DF, 0x2FB5, 0x87E0, 0x1526, 0x87E1, 0x2A13,
+ 0x87E2, 0x2FB0, 0x87E3, 0x2FBD, 0x87E4, 0x2FB7, 0x87E5, 0x2FB4,
+ 0x87E6, 0x2FAF, 0x87E7, 0x2FAE, 0x87E8, 0x2FC2, 0x87EA, 0x2FB3,
+ 0x87EB, 0x2FB2, 0x87EC, 0x1524, 0x87ED, 0x2FBB, 0x87EF, 0x1523,
+ 0x87F2, 0x1525, 0x87F3, 0x2FB6, 0x87F4, 0x2FC1, 0x87F6, 0x310A,
+ 0x87F7, 0x310B, 0x87F9, 0x15BE, 0x87FA, 0x3108, 0x87FB, 0x15BB,
+ 0x87FC, 0x3110, 0x87FE, 0x15BF, 0x87FF, 0x3112, 0x8800, 0x3107,
+ 0x8801, 0x2FC0, 0x8802, 0x3114, 0x8803, 0x3109, 0x8805, 0x15BC,
+ 0x8806, 0x310F, 0x8808, 0x3111, 0x8809, 0x310C, 0x880A, 0x3113,
+ 0x880B, 0x310E, 0x880C, 0x310D, 0x880D, 0x15BD, 0x8810, 0x322C,
+ 0x8811, 0x322D, 0x8813, 0x322F, 0x8814, 0x163F, 0x8815, 0x1640,
+ 0x8816, 0x3230, 0x8817, 0x322E, 0x8819, 0x322B, 0x881B, 0x3306,
+ 0x881C, 0x3309, 0x881D, 0x3305, 0x881F, 0x168B, 0x8820, 0x3307,
+ 0x8821, 0x168A, 0x8822, 0x1689, 0x8823, 0x1688, 0x8824, 0x3308,
+ 0x8825, 0x33B1, 0x8826, 0x33AF, 0x8828, 0x33AE, 0x8829, 0x3304,
+ 0x882A, 0x33B0, 0x882B, 0x330A, 0x882C, 0x33AD, 0x882E, 0x3437,
+ 0x882F, 0x3415, 0x8830, 0x3435, 0x8831, 0x1709, 0x8832, 0x3436,
+ 0x8833, 0x3438, 0x8835, 0x349A, 0x8836, 0x1728, 0x8837, 0x3499,
+ 0x8838, 0x3498, 0x8839, 0x1729, 0x883B, 0x1747, 0x883C, 0x3508,
+ 0x883D, 0x3520, 0x883E, 0x351F, 0x883F, 0x3521, 0x8840, 0x0410,
+ 0x8841, 0x1BFE, 0x8843, 0x1DFA, 0x8844, 0x1DFB, 0x8848, 0x22D3,
+ 0x884A, 0x330B, 0x884B, 0x349B, 0x884C, 0x0411, 0x884D, 0x0803,
+ 0x884E, 0x1BFF, 0x8852, 0x204F, 0x8853, 0x0B94, 0x8855, 0x22D5,
+ 0x8856, 0x22D4, 0x8857, 0x0D51, 0x8859, 0x0EFA, 0x885A, 0x2A2F,
+ 0x885B, 0x120A, 0x885D, 0x120B, 0x8861, 0x1345, 0x8862, 0x172A,
+ 0x8863, 0x0412, 0x8867, 0x1C00, 0x8868, 0x068C, 0x8869, 0x1C02,
+ 0x886A, 0x1C01, 0x886B, 0x0804, 0x886D, 0x1DFC, 0x886F, 0x1E03,
+ 0x8870, 0x09B8, 0x8871, 0x1E01, 0x8872, 0x1DFF, 0x8874, 0x1E06,
+ 0x8875, 0x1DFD, 0x8876, 0x1DFE, 0x8877, 0x09B9, 0x8879, 0x09BD,
+ 0x887C, 0x1E07, 0x887D, 0x09BC, 0x887E, 0x1E05, 0x887F, 0x1E02,
+ 0x8880, 0x1E00, 0x8881, 0x09BA, 0x8882, 0x09BB, 0x8883, 0x1E04,
+ 0x8888, 0x0B96, 0x8889, 0x2050, 0x888B, 0x0B9B, 0x888C, 0x2060,
+ 0x888D, 0x0B9A, 0x888E, 0x2062, 0x8891, 0x2056, 0x8892, 0x0B98,
+ 0x8893, 0x2061, 0x8895, 0x2051, 0x8896, 0x0B99, 0x8897, 0x205D,
+ 0x8898, 0x2059, 0x8899, 0x205B, 0x889A, 0x2055, 0x889B, 0x205C,
+ 0x889E, 0x0B95, 0x889F, 0x2058, 0x88A1, 0x2057, 0x88A2, 0x2053,
+ 0x88A4, 0x205E, 0x88A7, 0x205A, 0x88A8, 0x2052, 0x88AA, 0x2054,
+ 0x88AB, 0x0B97, 0x88AC, 0x205F, 0x88B1, 0x0D54, 0x88B2, 0x22E0,
+ 0x88B6, 0x22DC, 0x88B7, 0x22DE, 0x88B8, 0x22D9, 0x88B9, 0x22D8,
+ 0x88BA, 0x22D6, 0x88BC, 0x22DD, 0x88BD, 0x22DF, 0x88BE, 0x22DB,
+ 0x88C0, 0x22DA, 0x88C1, 0x0D52, 0x88C2, 0x0D53, 0x88C9, 0x22E2,
+ 0x88CA, 0x0F02, 0x88CB, 0x2578, 0x88CC, 0x257E, 0x88CD, 0x2579,
+ 0x88CE, 0x257A, 0x88CF, 0x36EA, 0x88D0, 0x257F, 0x88D2, 0x0F04,
+ 0x88D4, 0x0EFC, 0x88D5, 0x0F03, 0x88D6, 0x2577, 0x88D7, 0x22D7,
+ 0x88D8, 0x0EFF, 0x88D9, 0x0EFD, 0x88DA, 0x257D, 0x88DB, 0x257C,
+ 0x88DC, 0x0EFE, 0x88DD, 0x0F00, 0x88DE, 0x257B, 0x88DF, 0x0EFB,
+ 0x88E1, 0x0F01, 0x88E7, 0x27F0, 0x88E8, 0x10A2, 0x88EB, 0x27FB,
+ 0x88EC, 0x27FA, 0x88EE, 0x27F5, 0x88EF, 0x10A4, 0x88F0, 0x27F9,
+ 0x88F1, 0x27F1, 0x88F2, 0x27F2, 0x88F3, 0x109C, 0x88F4, 0x109E,
+ 0x88F6, 0x27F7, 0x88F7, 0x27EF, 0x88F8, 0x10A0, 0x88F9, 0x109F,
+ 0x88FA, 0x27F3, 0x88FB, 0x27F8, 0x88FC, 0x27F6, 0x88FD, 0x10A1,
+ 0x88FE, 0x27F4, 0x8901, 0x22E1, 0x8902, 0x109D, 0x8905, 0x2A30,
+ 0x8906, 0x2A37, 0x8907, 0x120D, 0x8909, 0x2A3B, 0x890A, 0x1211,
+ 0x890B, 0x2A33, 0x890C, 0x2A31, 0x890E, 0x2A3A, 0x8910, 0x120C,
+ 0x8911, 0x2A39, 0x8912, 0x120E, 0x8913, 0x120F, 0x8914, 0x2A32,
+ 0x8915, 0x1210, 0x8916, 0x2A38, 0x8917, 0x2A34, 0x8918, 0x2A35,
+ 0x8919, 0x2A36, 0x891A, 0x10A3, 0x891E, 0x2C77, 0x891F, 0x2C83,
+ 0x8921, 0x134A, 0x8922, 0x2C7E, 0x8923, 0x2C80, 0x8925, 0x1348,
+ 0x8926, 0x2C78, 0x8927, 0x2C7C, 0x8929, 0x2C7F, 0x892A, 0x1346,
+ 0x892B, 0x1349, 0x892C, 0x2C82, 0x892D, 0x2C7A, 0x892E, 0x2C7B,
+ 0x892F, 0x2C81, 0x8930, 0x2C79, 0x8931, 0x2C7D, 0x8932, 0x1347,
+ 0x8933, 0x2E4F, 0x8935, 0x2E4E, 0x8936, 0x1472, 0x8937, 0x2E54,
+ 0x8938, 0x1474, 0x893B, 0x1471, 0x893C, 0x2E50, 0x893D, 0x1475,
+ 0x893E, 0x2E51, 0x8941, 0x2E52, 0x8942, 0x2E55, 0x8944, 0x1473,
+ 0x8946, 0x2FC8, 0x8949, 0x2FCB, 0x894B, 0x2FC5, 0x894C, 0x2FC7,
+ 0x894F, 0x2FC6, 0x8950, 0x2FC9, 0x8951, 0x2FCA, 0x8952, 0x2E53,
+ 0x8953, 0x2FC4, 0x8956, 0x15C2, 0x8957, 0x3118, 0x8958, 0x311B,
+ 0x8959, 0x311D, 0x895A, 0x3116, 0x895B, 0x3117, 0x895C, 0x311A,
+ 0x895D, 0x311C, 0x895E, 0x15C3, 0x895F, 0x15C1, 0x8960, 0x15C0,
+ 0x8961, 0x3119, 0x8962, 0x3115, 0x8963, 0x3231, 0x8964, 0x1641,
+ 0x8966, 0x3232, 0x8969, 0x330D, 0x896A, 0x168C, 0x896B, 0x330F,
+ 0x896C, 0x168D, 0x896D, 0x330C, 0x896E, 0x330E, 0x896F, 0x16D6,
+ 0x8971, 0x33B2, 0x8972, 0x16D5, 0x8973, 0x343B, 0x8974, 0x343A,
+ 0x8976, 0x3439, 0x8979, 0x34E2, 0x897A, 0x34E3, 0x897B, 0x34E5,
+ 0x897C, 0x34E4, 0x897E, 0x1819, 0x897F, 0x0413, 0x8981, 0x0805,
+ 0x8982, 0x2063, 0x8983, 0x0D55, 0x8985, 0x2580, 0x8986, 0x1527,
+ 0x8988, 0x311E, 0x898B, 0x0508, 0x898F, 0x0B9D, 0x8993, 0x0B9C,
+ 0x8995, 0x22E3, 0x8996, 0x0D56, 0x8997, 0x22E5, 0x8998, 0x22E4,
+ 0x899B, 0x2581, 0x899C, 0x0F05, 0x899D, 0x27FC, 0x899E, 0x27FF,
+ 0x899F, 0x27FE, 0x89A1, 0x27FD, 0x89A2, 0x2A3C, 0x89A3, 0x2A3E,
+ 0x89A4, 0x2A3D, 0x89A6, 0x134C, 0x89AA, 0x134B, 0x89AC, 0x1476,
+ 0x89AD, 0x2E56, 0x89AE, 0x2E58, 0x89AF, 0x2E57, 0x89B2, 0x1528,
+ 0x89B6, 0x3120, 0x89B7, 0x311F, 0x89B9, 0x3233, 0x89BA, 0x1642,
+ 0x89BD, 0x168E, 0x89BE, 0x33B4, 0x89BF, 0x33B3, 0x89C0, 0x1748,
+ 0x89D2, 0x0509, 0x89D3, 0x1C03, 0x89D4, 0x0806, 0x89D5, 0x2066,
+ 0x89D6, 0x2064, 0x89D9, 0x2065, 0x89DA, 0x22E7, 0x89DB, 0x22E8,
+ 0x89DC, 0x2588, 0x89DD, 0x22E6, 0x89DF, 0x2582, 0x89E0, 0x2586,
+ 0x89E1, 0x2585, 0x89E2, 0x2587, 0x89E3, 0x0F06, 0x89E4, 0x2584,
+ 0x89E5, 0x2583, 0x89E6, 0x2589, 0x89E8, 0x2802, 0x89E9, 0x2800,
+ 0x89EB, 0x2801, 0x89EC, 0x2A41, 0x89ED, 0x2A3F, 0x89F0, 0x2A40,
+ 0x89F1, 0x2C84, 0x89F2, 0x2E59, 0x89F3, 0x2E5A, 0x89F4, 0x1529,
+ 0x89F6, 0x3121, 0x89F7, 0x3234, 0x89F8, 0x1643, 0x89FA, 0x3310,
+ 0x89FB, 0x33B5, 0x89FC, 0x16D7, 0x89FE, 0x343C, 0x89FF, 0x34E6,
+ 0x8A00, 0x050A, 0x8A02, 0x0808, 0x8A03, 0x0809, 0x8A04, 0x1C04,
+ 0x8A07, 0x1C05, 0x8A08, 0x0807, 0x8A0A, 0x09C3, 0x8A0C, 0x09C1,
+ 0x8A0E, 0x09C0, 0x8A0F, 0x09C7, 0x8A10, 0x09BF, 0x8A11, 0x09C8,
+ 0x8A12, 0x1E08, 0x8A13, 0x09C5, 0x8A15, 0x09C2, 0x8A16, 0x09C6,
+ 0x8A17, 0x09C4, 0x8A18, 0x09BE, 0x8A1B, 0x0BA5, 0x8A1D, 0x0B9F,
+ 0x8A1E, 0x206A, 0x8A1F, 0x0BA4, 0x8A22, 0x0BA6, 0x8A23, 0x0BA0,
+ 0x8A25, 0x0BA1, 0x8A27, 0x2068, 0x8A2A, 0x0B9E, 0x8A2C, 0x2069,
+ 0x8A2D, 0x0BA3, 0x8A30, 0x2067, 0x8A31, 0x0BA2, 0x8A34, 0x0D61,
+ 0x8A36, 0x0D63, 0x8A39, 0x22EB, 0x8A3A, 0x0D62, 0x8A3B, 0x0D57,
+ 0x8A3C, 0x0D5B, 0x8A3E, 0x0F19, 0x8A3F, 0x258E, 0x8A40, 0x22ED,
+ 0x8A41, 0x0D5C, 0x8A44, 0x22F0, 0x8A45, 0x22F1, 0x8A46, 0x0D60,
+ 0x8A48, 0x22F3, 0x8A4A, 0x22F5, 0x8A4C, 0x22F6, 0x8A4D, 0x22EA,
+ 0x8A4E, 0x22E9, 0x8A4F, 0x22F7, 0x8A50, 0x0D5F, 0x8A51, 0x22F4,
+ 0x8A52, 0x22F2, 0x8A54, 0x0D5D, 0x8A55, 0x0D59, 0x8A56, 0x0D64,
+ 0x8A57, 0x22EE, 0x8A58, 0x22EF, 0x8A59, 0x22EC, 0x8A5B, 0x0D5E,
+ 0x8A5E, 0x0D5A, 0x8A60, 0x0D58, 0x8A61, 0x258D, 0x8A62, 0x0F14,
+ 0x8A63, 0x0F0F, 0x8A66, 0x0F0A, 0x8A68, 0x0F1A, 0x8A69, 0x0F0B,
+ 0x8A6B, 0x0F07, 0x8A6C, 0x0F16, 0x8A6D, 0x0F13, 0x8A6E, 0x0F15,
+ 0x8A70, 0x0F0C, 0x8A71, 0x0F11, 0x8A72, 0x0F08, 0x8A73, 0x0F09,
+ 0x8A74, 0x2595, 0x8A75, 0x2592, 0x8A76, 0x258A, 0x8A77, 0x258F,
+ 0x8A79, 0x0F17, 0x8A7A, 0x2596, 0x8A7B, 0x0F18, 0x8A7C, 0x0F0E,
+ 0x8A7F, 0x258C, 0x8A81, 0x2594, 0x8A82, 0x2590, 0x8A83, 0x2593,
+ 0x8A84, 0x2591, 0x8A85, 0x0F12, 0x8A86, 0x258B, 0x8A87, 0x0F0D,
+ 0x8A8B, 0x2805, 0x8A8C, 0x10A6, 0x8A8D, 0x10A9, 0x8A8F, 0x2807,
+ 0x8A91, 0x10B1, 0x8A92, 0x2806, 0x8A93, 0x10AB, 0x8A95, 0x1216,
+ 0x8A96, 0x2808, 0x8A98, 0x10B0, 0x8A99, 0x2804, 0x8A9A, 0x10B2,
+ 0x8A9E, 0x10A7, 0x8AA0, 0x0F10, 0x8AA1, 0x10AA, 0x8AA3, 0x10A8,
+ 0x8AA4, 0x10AC, 0x8AA5, 0x10AE, 0x8AA6, 0x10A5, 0x8AA7, 0x10B3,
+ 0x8AA8, 0x10AF, 0x8AAA, 0x10AD, 0x8AAB, 0x2803, 0x8AB0, 0x121D,
+ 0x8AB2, 0x1219, 0x8AB6, 0x1220, 0x8AB8, 0x2A44, 0x8AB9, 0x1221,
+ 0x8ABA, 0x2A50, 0x8ABB, 0x2A49, 0x8ABC, 0x1212, 0x8ABD, 0x2A51,
+ 0x8ABE, 0x2A4B, 0x8ABF, 0x121C, 0x8AC0, 0x2A4C, 0x8AC2, 0x121B,
+ 0x8AC3, 0x2A4F, 0x8AC4, 0x1215, 0x8AC5, 0x2A4D, 0x8AC6, 0x2A43,
+ 0x8AC7, 0x1214, 0x8AC8, 0x2C8F, 0x8AC9, 0x121A, 0x8ACB, 0x1217,
+ 0x8ACD, 0x121F, 0x8ACF, 0x2A42, 0x8AD1, 0x2A46, 0x8AD2, 0x1213,
+ 0x8AD3, 0x2A45, 0x8AD4, 0x2A47, 0x8AD5, 0x2A48, 0x8AD6, 0x121E,
+ 0x8AD7, 0x2A4A, 0x8AD8, 0x2A4E, 0x8AD9, 0x2A52, 0x8ADB, 0x1222,
+ 0x8ADC, 0x1352, 0x8ADD, 0x2C8A, 0x8ADE, 0x2C90, 0x8ADF, 0x2C8D,
+ 0x8AE0, 0x2C85, 0x8AE1, 0x2C91, 0x8AE2, 0x2C86, 0x8AE4, 0x2C8C,
+ 0x8AE6, 0x134D, 0x8AE7, 0x1353, 0x8AE8, 0x2C92, 0x8AEB, 0x134F,
+ 0x8AED, 0x1359, 0x8AEE, 0x1354, 0x8AEF, 0x2C94, 0x8AF0, 0x2C8E,
+ 0x8AF1, 0x1350, 0x8AF2, 0x2C87, 0x8AF3, 0x135A, 0x8AF4, 0x2C88,
+ 0x8AF5, 0x2C89, 0x8AF6, 0x135B, 0x8AF7, 0x1358, 0x8AF8, 0x1218,
+ 0x8AFA, 0x134E, 0x8AFB, 0x2C95, 0x8AFC, 0x135C, 0x8AFE, 0x1355,
+ 0x8AFF, 0x2C93, 0x8B00, 0x1351, 0x8B01, 0x1356, 0x8B02, 0x1357,
+ 0x8B04, 0x147E, 0x8B05, 0x2E5F, 0x8B06, 0x2E68, 0x8B07, 0x2E65,
+ 0x8B08, 0x2E67, 0x8B0A, 0x147B, 0x8B0B, 0x2E60, 0x8B0D, 0x2E66,
+ 0x8B0E, 0x1477, 0x8B0F, 0x2E62, 0x8B10, 0x147F, 0x8B11, 0x2E5E,
+ 0x8B12, 0x2E63, 0x8B13, 0x2E6A, 0x8B14, 0x2C8B, 0x8B15, 0x2E64,
+ 0x8B16, 0x2E5D, 0x8B17, 0x1478, 0x8B18, 0x2E5C, 0x8B19, 0x1479,
+ 0x8B1A, 0x2E6B, 0x8B1B, 0x147A, 0x8B1C, 0x2E69, 0x8B1D, 0x147D,
+ 0x8B1E, 0x2E5B, 0x8B20, 0x147C, 0x8B22, 0x2E61, 0x8B23, 0x2FCE,
+ 0x8B24, 0x2FDC, 0x8B25, 0x2FD7, 0x8B26, 0x2FD9, 0x8B27, 0x2FCD,
+ 0x8B28, 0x152A, 0x8B2A, 0x2FCC, 0x8B2B, 0x152D, 0x8B2C, 0x152C,
+ 0x8B2E, 0x2FDB, 0x8B2F, 0x2FD3, 0x8B30, 0x2FD0, 0x8B31, 0x2FD6,
+ 0x8B33, 0x2FCF, 0x8B35, 0x2FD1, 0x8B36, 0x2FDA, 0x8B37, 0x2FD8,
+ 0x8B39, 0x152B, 0x8B3A, 0x2FDF, 0x8B3B, 0x2FDD, 0x8B3C, 0x2FD4,
+ 0x8B3D, 0x2FDE, 0x8B3E, 0x2FD5, 0x8B40, 0x3125, 0x8B41, 0x15C4,
+ 0x8B42, 0x312C, 0x8B45, 0x3313, 0x8B46, 0x15CB, 0x8B47, 0x2FD2,
+ 0x8B48, 0x3123, 0x8B49, 0x15C7, 0x8B4A, 0x3124, 0x8B4B, 0x3129,
+ 0x8B4E, 0x15C9, 0x8B4F, 0x15CA, 0x8B50, 0x3122, 0x8B51, 0x312B,
+ 0x8B52, 0x312D, 0x8B53, 0x3126, 0x8B54, 0x3128, 0x8B55, 0x312A,
+ 0x8B56, 0x3127, 0x8B57, 0x312E, 0x8B58, 0x15C6, 0x8B59, 0x15CC,
+ 0x8B5A, 0x15C8, 0x8B5C, 0x15C5, 0x8B5D, 0x3237, 0x8B5F, 0x1648,
+ 0x8B60, 0x3235, 0x8B63, 0x3239, 0x8B65, 0x323A, 0x8B66, 0x1646,
+ 0x8B67, 0x323B, 0x8B68, 0x3238, 0x8B6A, 0x3236, 0x8B6B, 0x1649,
+ 0x8B6C, 0x1645, 0x8B6D, 0x323C, 0x8B6F, 0x1647, 0x8B70, 0x1644,
+ 0x8B74, 0x168F, 0x8B77, 0x1690, 0x8B78, 0x3312, 0x8B79, 0x3311,
+ 0x8B7A, 0x3314, 0x8B7B, 0x3315, 0x8B7D, 0x1691, 0x8B7E, 0x33B6,
+ 0x8B7F, 0x33BB, 0x8B80, 0x16D8, 0x8B82, 0x33B8, 0x8B84, 0x33B7,
+ 0x8B85, 0x33BA, 0x8B86, 0x33B9, 0x8B88, 0x3440, 0x8B8A, 0x170A,
+ 0x8B8B, 0x343F, 0x8B8C, 0x343D, 0x8B8E, 0x343E, 0x8B92, 0x172C,
+ 0x8B93, 0x172B, 0x8B94, 0x349C, 0x8B95, 0x349D, 0x8B96, 0x172D,
+ 0x8B98, 0x34E7, 0x8B99, 0x34E8, 0x8B9A, 0x1754, 0x8B9C, 0x175A,
+ 0x8B9E, 0x3522, 0x8B9F, 0x353F, 0x8C37, 0x050B, 0x8C39, 0x206B,
+ 0x8C3B, 0x206C, 0x8C3C, 0x2597, 0x8C3D, 0x2809, 0x8C3E, 0x2A53,
+ 0x8C3F, 0x1481, 0x8C41, 0x1480, 0x8C42, 0x2FE0, 0x8C43, 0x312F,
+ 0x8C45, 0x3441, 0x8C46, 0x050C, 0x8C47, 0x1E09, 0x8C48, 0x09C9,
+ 0x8C49, 0x0BA7, 0x8C4A, 0x2599, 0x8C4B, 0x2598, 0x8C4C, 0x1223,
+ 0x8C4D, 0x2A54, 0x8C4E, 0x1224, 0x8C4F, 0x2E6C, 0x8C50, 0x152E,
+ 0x8C54, 0x1763, 0x8C55, 0x050D, 0x8C56, 0x1A48, 0x8C57, 0x1E0A,
+ 0x8C5A, 0x0BA8, 0x8C5C, 0x206D, 0x8C5D, 0x206E, 0x8C5F, 0x22F8,
+ 0x8C61, 0x0D65, 0x8C62, 0x0F1B, 0x8C64, 0x259B, 0x8C65, 0x259A,
+ 0x8C66, 0x259C, 0x8C68, 0x280A, 0x8C69, 0x280B, 0x8C6A, 0x10B4,
+ 0x8C6B, 0x135D, 0x8C6C, 0x1225, 0x8C6D, 0x135E, 0x8C6F, 0x2E70,
+ 0x8C70, 0x2E6D, 0x8C71, 0x2E6F, 0x8C72, 0x2E6E, 0x8C73, 0x1482,
+ 0x8C75, 0x2FE1, 0x8C76, 0x3131, 0x8C77, 0x3130, 0x8C78, 0x18E7,
+ 0x8C79, 0x09CB, 0x8C7A, 0x09CA, 0x8C7B, 0x1E0B, 0x8C7D, 0x206F,
+ 0x8C80, 0x22FA, 0x8C81, 0x22F9, 0x8C82, 0x0D66, 0x8C84, 0x259E,
+ 0x8C85, 0x259F, 0x8C86, 0x259D, 0x8C89, 0x0F1D, 0x8C8A, 0x0F1C,
+ 0x8C8C, 0x10B6, 0x8C8D, 0x10B5, 0x8C8F, 0x2A55, 0x8C90, 0x2C98,
+ 0x8C91, 0x2C96, 0x8C92, 0x2C97, 0x8C93, 0x135F, 0x8C94, 0x2E72,
+ 0x8C95, 0x2E71, 0x8C97, 0x2FE4, 0x8C98, 0x2FE3, 0x8C99, 0x2FE2,
+ 0x8C9A, 0x3132, 0x8C9C, 0x3523, 0x8C9D, 0x050E, 0x8C9E, 0x080A,
+ 0x8CA0, 0x080B, 0x8CA1, 0x09CC, 0x8CA2, 0x09CD, 0x8CA3, 0x1E0D,
+ 0x8CA4, 0x1E0C, 0x8CA5, 0x2070, 0x8CA7, 0x0BAE, 0x8CA8, 0x0BAC,
+ 0x8CA9, 0x0BA9, 0x8CAA, 0x0BAD, 0x8CAB, 0x0BAB, 0x8CAC, 0x0BAA,
+ 0x8CAF, 0x0D67, 0x8CB0, 0x22FD, 0x8CB2, 0x0F22, 0x8CB3, 0x0D69,
+ 0x8CB4, 0x0D6E, 0x8CB5, 0x22FF, 0x8CB6, 0x0D70, 0x8CB7, 0x0D6F,
+ 0x8CB8, 0x0D72, 0x8CB9, 0x22FE, 0x8CBA, 0x22FB, 0x8CBB, 0x0D6C,
+ 0x8CBC, 0x0D68, 0x8CBD, 0x0D6A, 0x8CBE, 0x22FC, 0x8CBF, 0x0D71,
+ 0x8CC0, 0x0D6D, 0x8CC1, 0x0D6B, 0x8CC2, 0x0F24, 0x8CC3, 0x0F23,
+ 0x8CC4, 0x0F21, 0x8CC5, 0x0F25, 0x8CC7, 0x0F1F, 0x8CC8, 0x0F20,
+ 0x8CCA, 0x0F1E, 0x8CCC, 0x25A0, 0x8CCF, 0x280D, 0x8CD1, 0x10B8,
+ 0x8CD2, 0x10B9, 0x8CD3, 0x10B7, 0x8CD5, 0x280C, 0x8CD7, 0x280E,
+ 0x8CD9, 0x2A58, 0x8CDA, 0x2A5A, 0x8CDC, 0x122E, 0x8CDD, 0x2A5B,
+ 0x8CDE, 0x1227, 0x8CDF, 0x2A57, 0x8CE0, 0x1226, 0x8CE1, 0x1230,
+ 0x8CE2, 0x122C, 0x8CE3, 0x122D, 0x8CE4, 0x1229, 0x8CE5, 0x2A56,
+ 0x8CE6, 0x1228, 0x8CE7, 0x2A5C, 0x8CE8, 0x2A59, 0x8CEA, 0x122F,
+ 0x8CEC, 0x122A, 0x8CED, 0x122B, 0x8CEE, 0x2C9A, 0x8CF0, 0x2C9C,
+ 0x8CF1, 0x2C9B, 0x8CF3, 0x2C9D, 0x8CF4, 0x1360, 0x8CF5, 0x2C99,
+ 0x8CF8, 0x1486, 0x8CF9, 0x2E73, 0x8CFA, 0x1483, 0x8CFB, 0x1487,
+ 0x8CFC, 0x1485, 0x8CFD, 0x1484, 0x8CFE, 0x2FE5, 0x8D00, 0x2FE8,
+ 0x8D02, 0x2FE7, 0x8D04, 0x2FE6, 0x8D05, 0x152F, 0x8D06, 0x3133,
+ 0x8D07, 0x3134, 0x8D08, 0x15CD, 0x8D09, 0x3135, 0x8D0A, 0x15CE,
+ 0x8D0D, 0x164B, 0x8D0F, 0x164A, 0x8D10, 0x3316, 0x8D13, 0x1692,
+ 0x8D14, 0x3317, 0x8D15, 0x33BC, 0x8D16, 0x16D9, 0x8D17, 0x16DA,
+ 0x8D19, 0x3442, 0x8D1B, 0x172F, 0x8D64, 0x050F, 0x8D66, 0x0BB0,
+ 0x8D67, 0x0BAF, 0x8D68, 0x25A1, 0x8D69, 0x25A2, 0x8D6B, 0x10BA,
+ 0x8D6C, 0x2C9E, 0x8D6D, 0x1231, 0x8D6E, 0x2C9F, 0x8D6F, 0x2E74,
+ 0x8D70, 0x0510, 0x8D72, 0x1C06, 0x8D73, 0x080D, 0x8D74, 0x080C,
+ 0x8D76, 0x1E0E, 0x8D77, 0x09CE, 0x8D78, 0x1E0F, 0x8D79, 0x2073,
+ 0x8D7B, 0x2072, 0x8D7D, 0x2071, 0x8D80, 0x2301, 0x8D81, 0x0D75,
+ 0x8D84, 0x2300, 0x8D85, 0x0D74, 0x8D89, 0x2302, 0x8D8A, 0x0D73,
+ 0x8D8C, 0x25A4, 0x8D8D, 0x25A7, 0x8D8E, 0x25A5, 0x8D8F, 0x25A6,
+ 0x8D90, 0x25AA, 0x8D91, 0x25A3, 0x8D92, 0x25AB, 0x8D93, 0x25A8,
+ 0x8D94, 0x25A9, 0x8D95, 0x10BC, 0x8D96, 0x280F, 0x8D99, 0x10BB,
+ 0x8D9B, 0x2A60, 0x8D9C, 0x2A5E, 0x8D9F, 0x1232, 0x8DA0, 0x2A5D,
+ 0x8DA1, 0x2A5F, 0x8DA3, 0x1233, 0x8DA5, 0x2CA0, 0x8DA7, 0x2CA1,
+ 0x8DA8, 0x1488, 0x8DAA, 0x3137, 0x8DAB, 0x3139, 0x8DAC, 0x3136,
+ 0x8DAD, 0x3138, 0x8DAE, 0x323D, 0x8DAF, 0x3318, 0x8DB2, 0x3509,
+ 0x8DB3, 0x0511, 0x8DB4, 0x080E, 0x8DB5, 0x1E10, 0x8DB6, 0x1E12,
+ 0x8DB7, 0x1E11, 0x8DB9, 0x2076, 0x8DBA, 0x0BB2, 0x8DBC, 0x2074,
+ 0x8DBE, 0x0BB1, 0x8DBF, 0x2077, 0x8DC1, 0x2078, 0x8DC2, 0x2075,
+ 0x8DC5, 0x230E, 0x8DC6, 0x0D7D, 0x8DC7, 0x2306, 0x8DC8, 0x230C,
+ 0x8DCB, 0x0D78, 0x8DCC, 0x0D7B, 0x8DCD, 0x2305, 0x8DCE, 0x0D76,
+ 0x8DCF, 0x2309, 0x8DD0, 0x25B1, 0x8DD1, 0x0D7A, 0x8DD3, 0x2304,
+ 0x8DD5, 0x230A, 0x8DD6, 0x2307, 0x8DD7, 0x230D, 0x8DD8, 0x2303,
+ 0x8DD9, 0x230B, 0x8DDA, 0x0D79, 0x8DDB, 0x0D7C, 0x8DDC, 0x2308,
+ 0x8DDD, 0x0D77, 0x8DDF, 0x0F27, 0x8DE0, 0x25AD, 0x8DE1, 0x0F26,
+ 0x8DE2, 0x25B4, 0x8DE3, 0x25B3, 0x8DE4, 0x0F2D, 0x8DE6, 0x0F2E,
+ 0x8DE7, 0x25B5, 0x8DE8, 0x0F28, 0x8DE9, 0x25B2, 0x8DEA, 0x0F2C,
+ 0x8DEB, 0x25B7, 0x8DEC, 0x25AE, 0x8DEE, 0x25B0, 0x8DEF, 0x0F29,
+ 0x8DF0, 0x25AC, 0x8DF1, 0x25AF, 0x8DF2, 0x25B6, 0x8DF3, 0x0F2A,
+ 0x8DF4, 0x25B8, 0x8DFA, 0x0F2B, 0x8DFC, 0x10BD, 0x8DFD, 0x2814,
+ 0x8DFE, 0x281A, 0x8DFF, 0x2812, 0x8E00, 0x281B, 0x8E02, 0x2811,
+ 0x8E03, 0x2816, 0x8E04, 0x281C, 0x8E05, 0x2819, 0x8E06, 0x2818,
+ 0x8E07, 0x2817, 0x8E09, 0x2810, 0x8E0A, 0x2815, 0x8E0D, 0x2813,
+ 0x8E0F, 0x1238, 0x8E10, 0x1235, 0x8E11, 0x2A69, 0x8E12, 0x2A6E,
+ 0x8E13, 0x2A70, 0x8E14, 0x2A6D, 0x8E15, 0x2A66, 0x8E16, 0x2A68,
+ 0x8E17, 0x2A72, 0x8E18, 0x2A6F, 0x8E19, 0x2A6A, 0x8E1A, 0x2A73,
+ 0x8E1B, 0x2A67, 0x8E1C, 0x2A71, 0x8E1D, 0x1236, 0x8E1E, 0x123C,
+ 0x8E1F, 0x123A, 0x8E20, 0x2A61, 0x8E21, 0x123B, 0x8E22, 0x1237,
+ 0x8E23, 0x2A62, 0x8E24, 0x2A64, 0x8E25, 0x2A63, 0x8E26, 0x2A6B,
+ 0x8E27, 0x2A6C, 0x8E29, 0x1239, 0x8E2B, 0x1234, 0x8E2E, 0x2A65,
+ 0x8E30, 0x2CAB, 0x8E31, 0x1362, 0x8E33, 0x2CA2, 0x8E34, 0x1363,
+ 0x8E35, 0x1366, 0x8E36, 0x2CA7, 0x8E38, 0x2CA4, 0x8E39, 0x1365,
+ 0x8E3C, 0x2CA8, 0x8E3D, 0x2CA9, 0x8E3E, 0x2CA3, 0x8E3F, 0x2CAC,
+ 0x8E40, 0x2CA5, 0x8E41, 0x2CAA, 0x8E42, 0x1364, 0x8E44, 0x1361,
+ 0x8E45, 0x2CA6, 0x8E47, 0x2E7A, 0x8E48, 0x148B, 0x8E49, 0x1489,
+ 0x8E4A, 0x148C, 0x8E4B, 0x148A, 0x8E4C, 0x2E79, 0x8E4D, 0x2E76,
+ 0x8E4E, 0x2E75, 0x8E50, 0x2E78, 0x8E53, 0x2E77, 0x8E54, 0x2FF6,
+ 0x8E55, 0x1535, 0x8E56, 0x2FED, 0x8E57, 0x2FEC, 0x8E59, 0x1530,
+ 0x8E5A, 0x2FF2, 0x8E5B, 0x2FF1, 0x8E5C, 0x2FE9, 0x8E5D, 0x2FF4,
+ 0x8E5E, 0x2FEE, 0x8E5F, 0x1534, 0x8E60, 0x2FEB, 0x8E61, 0x2FF3,
+ 0x8E62, 0x2FEA, 0x8E63, 0x1531, 0x8E64, 0x1533, 0x8E65, 0x2FEF,
+ 0x8E66, 0x1532, 0x8E67, 0x2FF0, 0x8E69, 0x2FF5, 0x8E6A, 0x313D,
+ 0x8E6C, 0x15D3, 0x8E6D, 0x313A, 0x8E6F, 0x313E, 0x8E72, 0x15D0,
+ 0x8E73, 0x313C, 0x8E74, 0x15D5, 0x8E76, 0x15D2, 0x8E78, 0x313B,
+ 0x8E7A, 0x15D4, 0x8E7B, 0x313F, 0x8E7C, 0x15CF, 0x8E81, 0x164D,
+ 0x8E82, 0x164F, 0x8E84, 0x3240, 0x8E85, 0x164E, 0x8E86, 0x323E,
+ 0x8E87, 0x15D1, 0x8E88, 0x323F, 0x8E89, 0x164C, 0x8E8A, 0x1693,
+ 0x8E8B, 0x1695, 0x8E8C, 0x331A, 0x8E8D, 0x1694, 0x8E8E, 0x3319,
+ 0x8E90, 0x33C1, 0x8E91, 0x16DB, 0x8E92, 0x33C0, 0x8E93, 0x16DC,
+ 0x8E94, 0x33BE, 0x8E95, 0x33BD, 0x8E96, 0x33C2, 0x8E97, 0x33C3,
+ 0x8E98, 0x3443, 0x8E9A, 0x33BF, 0x8E9D, 0x34A1, 0x8E9E, 0x349E,
+ 0x8E9F, 0x349F, 0x8EA0, 0x34A0, 0x8EA1, 0x1749, 0x8EA3, 0x34EB,
+ 0x8EA4, 0x34EA, 0x8EA5, 0x34E9, 0x8EA6, 0x350A, 0x8EA8, 0x3537,
+ 0x8EA9, 0x3524, 0x8EAA, 0x175B, 0x8EAB, 0x0512, 0x8EAC, 0x09CF,
+ 0x8EB2, 0x0F2F, 0x8EBA, 0x123D, 0x8EBD, 0x2CAD, 0x8EC0, 0x1536,
+ 0x8EC2, 0x3140, 0x8EC9, 0x3525, 0x8ECA, 0x0513, 0x8ECB, 0x068D,
+ 0x8ECC, 0x0810, 0x8ECD, 0x080F, 0x8ECF, 0x09D2, 0x8ED1, 0x1E13,
+ 0x8ED2, 0x09D0, 0x8ED3, 0x1E14, 0x8ED4, 0x09D1, 0x8ED7, 0x207D,
+ 0x8ED8, 0x2079, 0x8EDB, 0x0BB3, 0x8EDC, 0x207C, 0x8EDD, 0x207B,
+ 0x8EDE, 0x207A, 0x8EDF, 0x0BB4, 0x8EE0, 0x207E, 0x8EE1, 0x207F,
+ 0x8EE5, 0x2315, 0x8EE6, 0x2313, 0x8EE7, 0x2317, 0x8EE8, 0x2318,
+ 0x8EE9, 0x231E, 0x8EEB, 0x231A, 0x8EEC, 0x231C, 0x8EEE, 0x2314,
+ 0x8EEF, 0x230F, 0x8EF1, 0x231B, 0x8EF4, 0x231D, 0x8EF5, 0x2316,
+ 0x8EF6, 0x2319, 0x8EF7, 0x2310, 0x8EF8, 0x0D7F, 0x8EF9, 0x2312,
+ 0x8EFA, 0x2311, 0x8EFB, 0x0D7E, 0x8EFC, 0x0D80, 0x8EFE, 0x0F32,
+ 0x8EFF, 0x25BA, 0x8F00, 0x25BC, 0x8F01, 0x25BB, 0x8F02, 0x25C0,
+ 0x8F03, 0x0F30, 0x8F05, 0x25BD, 0x8F06, 0x25B9, 0x8F07, 0x25BE,
+ 0x8F08, 0x25BF, 0x8F09, 0x0F31, 0x8F0A, 0x0F33, 0x8F0B, 0x25C1,
+ 0x8F0D, 0x2820, 0x8F0E, 0x281F, 0x8F10, 0x281D, 0x8F11, 0x281E,
+ 0x8F12, 0x10BF, 0x8F13, 0x10C1, 0x8F14, 0x10BE, 0x8F15, 0x10C0,
+ 0x8F16, 0x2A7A, 0x8F17, 0x2A7B, 0x8F18, 0x2A76, 0x8F1A, 0x2A77,
+ 0x8F1B, 0x123F, 0x8F1C, 0x1244, 0x8F1D, 0x123E, 0x8F1E, 0x1245,
+ 0x8F1F, 0x1240, 0x8F20, 0x2A78, 0x8F23, 0x2A79, 0x8F24, 0x2A75,
+ 0x8F25, 0x1246, 0x8F26, 0x1242, 0x8F29, 0x1241, 0x8F2A, 0x1243,
+ 0x8F2C, 0x2A74, 0x8F2E, 0x2CAF, 0x8F2F, 0x1368, 0x8F32, 0x2CB1,
+ 0x8F33, 0x136A, 0x8F34, 0x2CB4, 0x8F35, 0x2CB0, 0x8F36, 0x2CAE,
+ 0x8F37, 0x2CB3, 0x8F38, 0x1369, 0x8F39, 0x2CB2, 0x8F3B, 0x1367,
+ 0x8F3E, 0x148E, 0x8F3F, 0x1491, 0x8F40, 0x2E7C, 0x8F42, 0x148F,
+ 0x8F43, 0x2E7B, 0x8F44, 0x148D, 0x8F45, 0x1490, 0x8F46, 0x2FF7,
+ 0x8F47, 0x2FF8, 0x8F48, 0x2FF9, 0x8F49, 0x1537, 0x8F4B, 0x2FFA,
+ 0x8F4D, 0x1538, 0x8F4E, 0x15D7, 0x8F4F, 0x3143, 0x8F50, 0x3144,
+ 0x8F51, 0x3142, 0x8F52, 0x3141, 0x8F53, 0x3145, 0x8F54, 0x15D6,
+ 0x8F55, 0x3244, 0x8F56, 0x3242, 0x8F57, 0x3243, 0x8F58, 0x3245,
+ 0x8F59, 0x3241, 0x8F5A, 0x3246, 0x8F5B, 0x331C, 0x8F5D, 0x331D,
+ 0x8F5E, 0x331B, 0x8F5F, 0x1696, 0x8F60, 0x33C4, 0x8F61, 0x16DD,
+ 0x8F62, 0x33C5, 0x8F63, 0x3445, 0x8F64, 0x3444, 0x8F9B, 0x0514,
+ 0x8F9C, 0x0D81, 0x8F9F, 0x0F34, 0x8FA3, 0x10C2, 0x8FA6, 0x136C,
+ 0x8FA8, 0x136B, 0x8FAD, 0x15D8, 0x8FAE, 0x162F, 0x8FAF, 0x1697,
+ 0x8FB0, 0x0515, 0x8FB1, 0x09D3, 0x8FB2, 0x0F35, 0x8FB4, 0x3146,
+ 0x8FB5, 0x0230, 0x8FBF, 0x18E9, 0x8FC2, 0x0516, 0x8FC4, 0x0519,
+ 0x8FC5, 0x0518, 0x8FC6, 0x0517, 0x8FC9, 0x18E8, 0x8FCB, 0x1A4A,
+ 0x8FCD, 0x1A4C, 0x8FCE, 0x068E, 0x8FD1, 0x0690, 0x8FD2, 0x1A49,
+ 0x8FD3, 0x1A4B, 0x8FD4, 0x068F, 0x8FD5, 0x1A4E, 0x8FD6, 0x1A4D,
+ 0x8FD7, 0x1A4F, 0x8FE0, 0x1C0A, 0x8FE1, 0x1C08, 0x8FE2, 0x0813,
+ 0x8FE3, 0x1C07, 0x8FE4, 0x0818, 0x8FE5, 0x0815, 0x8FE6, 0x0812,
+ 0x8FE8, 0x0819, 0x8FEA, 0x0814, 0x8FEB, 0x0817, 0x8FED, 0x0816,
+ 0x8FEE, 0x1C09, 0x8FF0, 0x0811, 0x8FF4, 0x09D9, 0x8FF5, 0x1E16,
+ 0x8FF6, 0x1E1C, 0x8FF7, 0x09D6, 0x8FF8, 0x09DD, 0x8FFA, 0x09D8,
+ 0x8FFB, 0x1E19, 0x8FFC, 0x1E1B, 0x8FFD, 0x09DB, 0x8FFE, 0x1E15,
+ 0x8FFF, 0x1E18, 0x9000, 0x09D7, 0x9001, 0x09D4, 0x9002, 0x1E17,
+ 0x9003, 0x09DA, 0x9004, 0x1E1A, 0x9005, 0x09DC, 0x9006, 0x09D5,
+ 0x900B, 0x2081, 0x900C, 0x2084, 0x900D, 0x0BB6, 0x900F, 0x0BC0,
+ 0x9010, 0x0BBC, 0x9011, 0x2082, 0x9014, 0x0BC4, 0x9015, 0x0BBD,
+ 0x9016, 0x0BC2, 0x9017, 0x0BB8, 0x9019, 0x0BB5, 0x901A, 0x0BB7,
+ 0x901B, 0x0BC3, 0x901C, 0x2083, 0x901D, 0x0BBB, 0x901E, 0x0BBE,
+ 0x901F, 0x0BBA, 0x9020, 0x0BBF, 0x9021, 0x2085, 0x9022, 0x0BC1,
+ 0x9023, 0x0BB9, 0x9024, 0x2080, 0x902D, 0x231F, 0x902E, 0x0D82,
+ 0x902F, 0x2321, 0x9031, 0x0D84, 0x9032, 0x0D86, 0x9034, 0x2320,
+ 0x9035, 0x0D83, 0x9036, 0x0D87, 0x9038, 0x0D85, 0x903C, 0x0F3B,
+ 0x903D, 0x25C6, 0x903E, 0x0F43, 0x903F, 0x25C3, 0x9041, 0x0F44,
+ 0x9042, 0x0F39, 0x9044, 0x25C4, 0x9047, 0x0F3E, 0x9049, 0x25C5,
+ 0x904A, 0x0F37, 0x904B, 0x0F36, 0x904D, 0x0F41, 0x904E, 0x0F40,
+ 0x904F, 0x0F3F, 0x9050, 0x0F3D, 0x9051, 0x0F42, 0x9052, 0x25C2,
+ 0x9053, 0x0F38, 0x9054, 0x0F3A, 0x9055, 0x0F3C, 0x9058, 0x10C4,
+ 0x9059, 0x10C7, 0x905B, 0x10CB, 0x905C, 0x10C5, 0x905D, 0x10CA,
+ 0x905E, 0x10C8, 0x9060, 0x10C3, 0x9062, 0x10C9, 0x9063, 0x10C6,
+ 0x9067, 0x2A7F, 0x9068, 0x1249, 0x9069, 0x1247, 0x906B, 0x2A80,
+ 0x906D, 0x124A, 0x906E, 0x1248, 0x906F, 0x2A7E, 0x9070, 0x2A7D,
+ 0x9072, 0x1370, 0x9073, 0x2A7C, 0x9074, 0x136E, 0x9075, 0x136D,
+ 0x9076, 0x2CB5, 0x9077, 0x124B, 0x9078, 0x136F, 0x9079, 0x2CB6,
+ 0x907A, 0x1372, 0x907B, 0x2CB7, 0x907C, 0x1371, 0x907D, 0x1493,
+ 0x907E, 0x2E7E, 0x907F, 0x1492, 0x9080, 0x1497, 0x9081, 0x1495,
+ 0x9082, 0x1496, 0x9083, 0x153A, 0x9084, 0x1494, 0x9085, 0x2E7D,
+ 0x9086, 0x2CB8, 0x9087, 0x1539, 0x9088, 0x153B, 0x908A, 0x15D9,
+ 0x908B, 0x15DA, 0x908D, 0x3247, 0x908F, 0x170C, 0x9090, 0x170B,
+ 0x9091, 0x051B, 0x9094, 0x181E, 0x9095, 0x09DE, 0x9097, 0x181B,
+ 0x9098, 0x181C, 0x9099, 0x181A, 0x909B, 0x181D, 0x909E, 0x18ED,
+ 0x909F, 0x18EA, 0x90A0, 0x18EF, 0x90A1, 0x18EB, 0x90A2, 0x051C,
+ 0x90A3, 0x051F, 0x90A5, 0x18EC, 0x90A6, 0x051E, 0x90A7, 0x18EE,
+ 0x90AA, 0x051D, 0x90AF, 0x1A52, 0x90B0, 0x1A54, 0x90B1, 0x0693,
+ 0x90B2, 0x1A50, 0x90B3, 0x1A53, 0x90B4, 0x1A51, 0x90B5, 0x0691,
+ 0x90B6, 0x0694, 0x90B8, 0x0692, 0x90BD, 0x1C0C, 0x90BE, 0x1C10,
+ 0x90BF, 0x1C0D, 0x90C1, 0x081C, 0x90C3, 0x081D, 0x90C5, 0x1C0F,
+ 0x90C7, 0x1C11, 0x90C8, 0x1C13, 0x90CA, 0x081A, 0x90CB, 0x1C12,
+ 0x90CE, 0x081B, 0x90D4, 0x208C, 0x90D5, 0x1C0E, 0x90D6, 0x1E1D,
+ 0x90D7, 0x1E26, 0x90D8, 0x1E24, 0x90D9, 0x1E1F, 0x90DA, 0x1E20,
+ 0x90DB, 0x1E25, 0x90DC, 0x1E27, 0x90DD, 0x09E0, 0x90DF, 0x1E22,
+ 0x90E0, 0x1E1E, 0x90E1, 0x09DF, 0x90E2, 0x09E1, 0x90E3, 0x1E21,
+ 0x90E4, 0x1E28, 0x90E5, 0x1E23, 0x90E8, 0x0BC5, 0x90E9, 0x208F,
+ 0x90EA, 0x2087, 0x90EB, 0x208D, 0x90EC, 0x208E, 0x90ED, 0x0BC6,
+ 0x90EF, 0x2086, 0x90F0, 0x2088, 0x90F1, 0x1C0B, 0x90F2, 0x208A,
+ 0x90F3, 0x208B, 0x90F4, 0x2089, 0x90F5, 0x0D89, 0x90F9, 0x2328,
+ 0x90FA, 0x2CB9, 0x90FB, 0x2329, 0x90FC, 0x2326, 0x90FD, 0x0BC7,
+ 0x90FE, 0x0D8B, 0x90FF, 0x2325, 0x9100, 0x232B, 0x9101, 0x232A,
+ 0x9102, 0x0D88, 0x9103, 0x232E, 0x9104, 0x2324, 0x9105, 0x232D,
+ 0x9106, 0x2322, 0x9107, 0x232C, 0x9108, 0x2327, 0x9109, 0x0D8A,
+ 0x910B, 0x25CD, 0x910D, 0x25C8, 0x910E, 0x25CE, 0x910F, 0x25C9,
+ 0x9110, 0x25C7, 0x9111, 0x25CA, 0x9112, 0x0F45, 0x9114, 0x25CC,
+ 0x9116, 0x25CB, 0x9117, 0x0F46, 0x9118, 0x10CD, 0x9119, 0x10CC,
+ 0x911A, 0x2827, 0x911B, 0x282A, 0x911C, 0x2822, 0x911D, 0x2826,
+ 0x911E, 0x10CE, 0x911F, 0x2825, 0x9120, 0x2823, 0x9121, 0x2829,
+ 0x9122, 0x2824, 0x9123, 0x2821, 0x9124, 0x2828, 0x9126, 0x2A86,
+ 0x9127, 0x124E, 0x9128, 0x2FFB, 0x9129, 0x2A83, 0x912A, 0x2A84,
+ 0x912B, 0x2A82, 0x912C, 0x2323, 0x912D, 0x124D, 0x912E, 0x2A87,
+ 0x912F, 0x2A81, 0x9130, 0x124C, 0x9131, 0x124F, 0x9132, 0x2A85,
+ 0x9133, 0x2CBA, 0x9134, 0x1373, 0x9135, 0x2CBB, 0x9136, 0x2CBC,
+ 0x9138, 0x2E7F, 0x9139, 0x1498, 0x913A, 0x2FFC, 0x913B, 0x2FFD,
+ 0x913E, 0x2FFE, 0x913F, 0x3148, 0x9140, 0x3147, 0x9141, 0x3249,
+ 0x9143, 0x3248, 0x9144, 0x331F, 0x9145, 0x3320, 0x9146, 0x331E,
+ 0x9147, 0x33C6, 0x9148, 0x16DE, 0x9149, 0x0520, 0x914A, 0x081F,
+ 0x914B, 0x081E, 0x914C, 0x09E4, 0x914D, 0x09E3, 0x914E, 0x1E2A,
+ 0x914F, 0x1E2B, 0x9150, 0x1E29, 0x9152, 0x09E2, 0x9153, 0x2093,
+ 0x9155, 0x2094, 0x9156, 0x2090, 0x9157, 0x0BC8, 0x9158, 0x2091,
+ 0x915A, 0x2092, 0x915F, 0x2331, 0x9160, 0x2333, 0x9161, 0x232F,
+ 0x9162, 0x2332, 0x9163, 0x0D8C, 0x9164, 0x2330, 0x9165, 0x0D8D,
+ 0x9168, 0x23E2, 0x9169, 0x0F49, 0x916A, 0x0F48, 0x916C, 0x0F47,
+ 0x916E, 0x25CF, 0x916F, 0x25D0, 0x9172, 0x282C, 0x9173, 0x282E,
+ 0x9174, 0x10D2, 0x9175, 0x10CF, 0x9177, 0x10D1, 0x9178, 0x10D0,
+ 0x9179, 0x282D, 0x917A, 0x282B, 0x9180, 0x2A8E, 0x9181, 0x2A8B,
+ 0x9182, 0x2A8C, 0x9183, 0x1253, 0x9184, 0x2A8D, 0x9185, 0x2A88,
+ 0x9186, 0x2A89, 0x9187, 0x1250, 0x9189, 0x1251, 0x918A, 0x2A8A,
+ 0x918B, 0x1252, 0x918D, 0x2CC0, 0x918F, 0x2CC1, 0x9190, 0x2CBE,
+ 0x9191, 0x2CBF, 0x9192, 0x1374, 0x9193, 0x2CBD, 0x9199, 0x2E83,
+ 0x919A, 0x2E80, 0x919B, 0x2E82, 0x919C, 0x149B, 0x919D, 0x2E86,
+ 0x919E, 0x149A, 0x919F, 0x2E84, 0x91A0, 0x2E87, 0x91A1, 0x2E85,
+ 0x91A2, 0x2E81, 0x91A3, 0x1499, 0x91A5, 0x3000, 0x91A7, 0x3001,
+ 0x91A8, 0x2FFF, 0x91AA, 0x3003, 0x91AB, 0x153C, 0x91AC, 0x153D,
+ 0x91AD, 0x314A, 0x91AE, 0x15DC, 0x91AF, 0x3002, 0x91B0, 0x3149,
+ 0x91B1, 0x15DB, 0x91B2, 0x324C, 0x91B3, 0x324D, 0x91B4, 0x1650,
+ 0x91B5, 0x324B, 0x91B7, 0x324A, 0x91B9, 0x3321, 0x91BA, 0x1698,
+ 0x91BC, 0x3446, 0x91BD, 0x34A3, 0x91BE, 0x34A2, 0x91C0, 0x1730,
+ 0x91C1, 0x174A, 0x91C2, 0x34A4, 0x91C3, 0x350B, 0x91C5, 0x175C,
+ 0x91C6, 0x0521, 0x91C7, 0x0695, 0x91C9, 0x0F4A, 0x91CB, 0x1651,
+ 0x91CC, 0x0522, 0x91CD, 0x0820, 0x91CE, 0x0BC9, 0x91CF, 0x0D8E,
+ 0x91D0, 0x153E, 0x91D1, 0x0696, 0x91D3, 0x1C15, 0x91D4, 0x1C14,
+ 0x91D5, 0x1E2C, 0x91D7, 0x09E7, 0x91D8, 0x09E5, 0x91D9, 0x09E9,
+ 0x91DA, 0x1E2E, 0x91DC, 0x09E8, 0x91DD, 0x09E6, 0x91E2, 0x1E2D,
+ 0x91E3, 0x0BCC, 0x91E4, 0x209A, 0x91E6, 0x0BCB, 0x91E7, 0x0BCD,
+ 0x91E8, 0x209F, 0x91E9, 0x0BCF, 0x91EA, 0x209C, 0x91EB, 0x209D,
+ 0x91EC, 0x2095, 0x91ED, 0x0BCE, 0x91EE, 0x20A0, 0x91F1, 0x2097,
+ 0x91F3, 0x2098, 0x91F4, 0x2096, 0x91F5, 0x0BCA, 0x91F7, 0x209E,
+ 0x91F8, 0x2099, 0x91F9, 0x209B, 0x91FD, 0x233F, 0x91FF, 0x233E,
+ 0x9200, 0x233C, 0x9201, 0x2334, 0x9202, 0x2343, 0x9203, 0x2337,
+ 0x9204, 0x2341, 0x9205, 0x2348, 0x9206, 0x2340, 0x9207, 0x0D96,
+ 0x9209, 0x0D92, 0x920A, 0x2335, 0x920C, 0x233B, 0x920D, 0x0D94,
+ 0x920F, 0x233A, 0x9210, 0x0D95, 0x9211, 0x0D97, 0x9212, 0x233D,
+ 0x9214, 0x0D8F, 0x9215, 0x0D90, 0x9216, 0x2349, 0x9217, 0x2347,
+ 0x9219, 0x2346, 0x921A, 0x2338, 0x921C, 0x2344, 0x921E, 0x0D93,
+ 0x9223, 0x0D91, 0x9224, 0x2345, 0x9225, 0x2336, 0x9226, 0x2339,
+ 0x9227, 0x2342, 0x922D, 0x2851, 0x922E, 0x25DA, 0x9230, 0x25D3,
+ 0x9231, 0x25E6, 0x9232, 0x25EF, 0x9233, 0x25D6, 0x9234, 0x0F55,
+ 0x9236, 0x25E3, 0x9237, 0x0F4B, 0x9238, 0x0F4D, 0x9239, 0x0F59,
+ 0x923A, 0x25D4, 0x923D, 0x0F4E, 0x923E, 0x0F50, 0x923F, 0x0F5A,
+ 0x9240, 0x0F4F, 0x9245, 0x0F58, 0x9246, 0x25DC, 0x9248, 0x25D1,
+ 0x9249, 0x0F56, 0x924A, 0x25DB, 0x924B, 0x0F52, 0x924C, 0x25ED,
+ 0x924D, 0x0F57, 0x924E, 0x25EB, 0x924F, 0x25DF, 0x9250, 0x25E9,
+ 0x9251, 0x0F54, 0x9252, 0x25D2, 0x9253, 0x25EC, 0x9254, 0x25E7,
+ 0x9256, 0x25EE, 0x9257, 0x0F4C, 0x925A, 0x0F5B, 0x925B, 0x0F51,
+ 0x925E, 0x25D8, 0x9260, 0x25E0, 0x9261, 0x25E4, 0x9263, 0x25E8,
+ 0x9264, 0x0F53, 0x9265, 0x25D7, 0x9266, 0x25D5, 0x9267, 0x25E1,
+ 0x926C, 0x25DE, 0x926D, 0x25DD, 0x926F, 0x25E2, 0x9270, 0x25E5,
+ 0x9272, 0x25EA, 0x9276, 0x2831, 0x9278, 0x10D3, 0x9279, 0x283B,
+ 0x927A, 0x2833, 0x927B, 0x10D9, 0x927C, 0x10DD, 0x927D, 0x2844,
+ 0x927E, 0x284C, 0x927F, 0x283D, 0x9280, 0x10D5, 0x9282, 0x2841,
+ 0x9283, 0x25D9, 0x9285, 0x10D6, 0x9286, 0x2848, 0x9287, 0x284D,
+ 0x9288, 0x2845, 0x928A, 0x2847, 0x928B, 0x2850, 0x928C, 0x2849,
+ 0x928D, 0x2837, 0x928E, 0x2840, 0x9291, 0x10DE, 0x9293, 0x10DA,
+ 0x9294, 0x2835, 0x9295, 0x2842, 0x9296, 0x10D8, 0x9297, 0x283C,
+ 0x9298, 0x10D7, 0x9299, 0x284A, 0x929A, 0x2839, 0x929B, 0x2832,
+ 0x929C, 0x10DB, 0x929D, 0x284F, 0x92A0, 0x2834, 0x92A1, 0x2846,
+ 0x92A2, 0x2843, 0x92A3, 0x283E, 0x92A4, 0x2830, 0x92A5, 0x282F,
+ 0x92A6, 0x2838, 0x92A7, 0x284B, 0x92A8, 0x10DC, 0x92A9, 0x284E,
+ 0x92AA, 0x2836, 0x92AB, 0x283A, 0x92AC, 0x10D4, 0x92B2, 0x125F,
+ 0x92B3, 0x125A, 0x92B4, 0x2AB0, 0x92B5, 0x2AAC, 0x92B6, 0x2A94,
+ 0x92B7, 0x1256, 0x92B9, 0x36E9, 0x92BB, 0x1255, 0x92BC, 0x125B,
+ 0x92C0, 0x2A92, 0x92C1, 0x1259, 0x92C2, 0x2A9E, 0x92C3, 0x2A90,
+ 0x92C4, 0x2A91, 0x92C5, 0x1254, 0x92C6, 0x2AAF, 0x92C7, 0x125D,
+ 0x92C8, 0x2AA1, 0x92C9, 0x2AA6, 0x92CA, 0x2AA0, 0x92CB, 0x2CD3,
+ 0x92CC, 0x2A9C, 0x92CD, 0x2AA4, 0x92CE, 0x2AA2, 0x92CF, 0x2A95,
+ 0x92D0, 0x2A8F, 0x92D1, 0x2AAA, 0x92D2, 0x125C, 0x92D3, 0x2AAB,
+ 0x92D5, 0x2AA5, 0x92D7, 0x2A9A, 0x92D8, 0x2A98, 0x92D9, 0x2A93,
+ 0x92DD, 0x2A9B, 0x92DE, 0x2AA8, 0x92DF, 0x2A97, 0x92E0, 0x2AA7,
+ 0x92E1, 0x2AAD, 0x92E4, 0x1258, 0x92E6, 0x2AA3, 0x92E7, 0x2AA9,
+ 0x92E8, 0x2A9F, 0x92E9, 0x2A99, 0x92EA, 0x1257, 0x92EE, 0x283F,
+ 0x92EF, 0x2A9D, 0x92F0, 0x125E, 0x92F1, 0x2A96, 0x92F7, 0x2CD8,
+ 0x92F8, 0x1377, 0x92F9, 0x2CD7, 0x92FA, 0x2CD5, 0x92FB, 0x2CE7,
+ 0x92FC, 0x137B, 0x92FE, 0x2CE4, 0x92FF, 0x2CDC, 0x9300, 0x2CE6,
+ 0x9301, 0x2CCE, 0x9302, 0x2CDA, 0x9304, 0x137D, 0x9306, 0x2CC6,
+ 0x9308, 0x2CC4, 0x9309, 0x2CE5, 0x930B, 0x2CE3, 0x930C, 0x2CE2,
+ 0x930D, 0x2CD2, 0x930E, 0x2CD1, 0x930F, 0x2CC7, 0x9310, 0x137F,
+ 0x9312, 0x2CCD, 0x9313, 0x2CD6, 0x9314, 0x2CE1, 0x9315, 0x1382,
+ 0x9316, 0x2CE8, 0x9318, 0x14A3, 0x9319, 0x1384, 0x931A, 0x137E,
+ 0x931B, 0x2CCB, 0x931D, 0x2CD4, 0x931E, 0x2CC3, 0x931F, 0x2CC5,
+ 0x9320, 0x1375, 0x9321, 0x1381, 0x9322, 0x137A, 0x9323, 0x2CCC,
+ 0x9324, 0x2CDB, 0x9325, 0x2AAE, 0x9326, 0x1380, 0x9327, 0x2CC2,
+ 0x9328, 0x149E, 0x9329, 0x2CDD, 0x932A, 0x2CE0, 0x932B, 0x137C,
+ 0x932D, 0x2CD0, 0x932E, 0x1383, 0x932F, 0x1379, 0x9333, 0x1378,
+ 0x9334, 0x2CD9, 0x9335, 0x2CDF, 0x9336, 0x1376, 0x9338, 0x2CC9,
+ 0x9339, 0x2CDE, 0x933C, 0x2CCA, 0x9346, 0x2CCF, 0x9347, 0x2E8D,
+ 0x9349, 0x2E92, 0x934A, 0x14A0, 0x934B, 0x14A2, 0x934C, 0x2E98,
+ 0x934D, 0x149C, 0x934E, 0x2EA6, 0x934F, 0x2E9E, 0x9350, 0x2E93,
+ 0x9351, 0x2E94, 0x9352, 0x2E9D, 0x9354, 0x14A9, 0x9355, 0x2E9C,
+ 0x9356, 0x2E8C, 0x9357, 0x2E9B, 0x9358, 0x2E8F, 0x9359, 0x2EA7,
+ 0x935A, 0x14A8, 0x935B, 0x14A6, 0x935C, 0x2E90, 0x935E, 0x2EA3,
+ 0x9360, 0x2E95, 0x9361, 0x2EA2, 0x9363, 0x2EA4, 0x9364, 0x2E8B,
+ 0x9365, 0x14A1, 0x9367, 0x2EA5, 0x936A, 0x2E99, 0x936C, 0x14A5,
+ 0x936D, 0x2E96, 0x9370, 0x14A7, 0x9371, 0x2E9F, 0x9375, 0x149F,
+ 0x9376, 0x2E91, 0x9377, 0x2EA0, 0x9379, 0x2E9A, 0x937A, 0x2CC8,
+ 0x937B, 0x2EA1, 0x937C, 0x2E8E, 0x937E, 0x14A4, 0x9380, 0x3014,
+ 0x9382, 0x149D, 0x9383, 0x2E89, 0x9388, 0x3011, 0x9389, 0x300A,
+ 0x938A, 0x1540, 0x938C, 0x3005, 0x938D, 0x3015, 0x938E, 0x300C,
+ 0x938F, 0x2E97, 0x9391, 0x3017, 0x9392, 0x3006, 0x9394, 0x153F,
+ 0x9395, 0x3010, 0x9396, 0x1541, 0x9397, 0x1549, 0x9398, 0x1547,
+ 0x9399, 0x3012, 0x939A, 0x1548, 0x939B, 0x3008, 0x939D, 0x3009,
+ 0x939E, 0x300E, 0x939F, 0x3013, 0x93A1, 0x2E88, 0x93A2, 0x1542,
+ 0x93A3, 0x301C, 0x93A4, 0x3019, 0x93A5, 0x3160, 0x93A6, 0x300F,
+ 0x93A7, 0x300B, 0x93A8, 0x301A, 0x93A9, 0x3155, 0x93AA, 0x300D,
+ 0x93AC, 0x1545, 0x93AE, 0x1544, 0x93AF, 0x2E8A, 0x93B0, 0x1546,
+ 0x93B1, 0x3016, 0x93B2, 0x3018, 0x93B3, 0x1543, 0x93B4, 0x301B,
+ 0x93B5, 0x3004, 0x93B7, 0x3007, 0x93C0, 0x315E, 0x93C2, 0x314E,
+ 0x93C3, 0x15E0, 0x93C4, 0x315C, 0x93C7, 0x314C, 0x93C8, 0x15E1,
+ 0x93CA, 0x3157, 0x93CC, 0x3153, 0x93CD, 0x15E6, 0x93CE, 0x315D,
+ 0x93CF, 0x314D, 0x93D0, 0x3150, 0x93D1, 0x15DE, 0x93D2, 0x315F,
+ 0x93D4, 0x3158, 0x93D5, 0x315B, 0x93D6, 0x15E4, 0x93D7, 0x15E9,
+ 0x93D8, 0x15E7, 0x93D9, 0x3154, 0x93DA, 0x314F, 0x93DC, 0x15E2,
+ 0x93DD, 0x15E3, 0x93DE, 0x314B, 0x93DF, 0x15DF, 0x93E1, 0x15DD,
+ 0x93E2, 0x15E5, 0x93E3, 0x315A, 0x93E4, 0x15E8, 0x93E6, 0x3156,
+ 0x93E7, 0x3161, 0x93E8, 0x15EA, 0x93EC, 0x3152, 0x93EE, 0x3159,
+ 0x93F5, 0x325A, 0x93F6, 0x3269, 0x93F7, 0x325C, 0x93F8, 0x3263,
+ 0x93F9, 0x3151, 0x93FA, 0x3261, 0x93FB, 0x3250, 0x93FC, 0x3267,
+ 0x93FD, 0x1654, 0x93FE, 0x3254, 0x93FF, 0x3266, 0x9400, 0x325B,
+ 0x9403, 0x1653, 0x9406, 0x326B, 0x9407, 0x325D, 0x9409, 0x3262,
+ 0x940A, 0x3265, 0x940B, 0x324E, 0x940C, 0x3268, 0x940D, 0x3259,
+ 0x940E, 0x325E, 0x940F, 0x3252, 0x9410, 0x3256, 0x9411, 0x326A,
+ 0x9412, 0x3260, 0x9413, 0x324F, 0x9414, 0x3253, 0x9415, 0x3255,
+ 0x9416, 0x325F, 0x9418, 0x1652, 0x9419, 0x3258, 0x9420, 0x3251,
+ 0x9428, 0x3257, 0x9429, 0x3325, 0x942A, 0x3329, 0x942B, 0x169F,
+ 0x942C, 0x332B, 0x942E, 0x1699, 0x9430, 0x3327, 0x9431, 0x332D,
+ 0x9432, 0x169E, 0x9433, 0x169A, 0x9435, 0x169B, 0x9436, 0x3324,
+ 0x9437, 0x332A, 0x9438, 0x169D, 0x9439, 0x3328, 0x943A, 0x169C,
+ 0x943B, 0x3323, 0x943C, 0x3264, 0x943D, 0x3326, 0x943F, 0x3322,
+ 0x9440, 0x332C, 0x9444, 0x16DF, 0x9445, 0x33CD, 0x9446, 0x33D0,
+ 0x9447, 0x33CC, 0x9448, 0x33CE, 0x9449, 0x33CF, 0x944A, 0x33C9,
+ 0x944B, 0x33CA, 0x944C, 0x33C7, 0x944F, 0x33CB, 0x9450, 0x33C8,
+ 0x9451, 0x16E0, 0x9452, 0x16E1, 0x9455, 0x3448, 0x9457, 0x344A,
+ 0x945D, 0x3449, 0x945E, 0x344B, 0x9460, 0x170E, 0x9462, 0x3447,
+ 0x9463, 0x170D, 0x9464, 0x170F, 0x9468, 0x34A6, 0x9469, 0x34A7,
+ 0x946A, 0x1731, 0x946B, 0x34A5, 0x946D, 0x34ED, 0x946E, 0x34EC,
+ 0x946F, 0x34EE, 0x9470, 0x174C, 0x9471, 0x34EF, 0x9472, 0x174B,
+ 0x9473, 0x34F0, 0x9474, 0x350C, 0x9475, 0x350F, 0x9476, 0x350E,
+ 0x9477, 0x1755, 0x9478, 0x350D, 0x947C, 0x175F, 0x947D, 0x175D,
+ 0x947E, 0x175E, 0x947F, 0x1764, 0x9480, 0x3539, 0x9481, 0x353A,
+ 0x9482, 0x3538, 0x9483, 0x3540, 0x9577, 0x0697, 0x957A, 0x20A1,
+ 0x957B, 0x234A, 0x957C, 0x2AB1, 0x957D, 0x3162, 0x9580, 0x0698,
+ 0x9582, 0x0821, 0x9583, 0x09EA, 0x9586, 0x20A2, 0x9588, 0x20A3,
+ 0x9589, 0x0BD0, 0x958B, 0x0D9A, 0x958C, 0x234C, 0x958D, 0x234B,
+ 0x958E, 0x0D9E, 0x958F, 0x0D99, 0x9590, 0x234D, 0x9591, 0x0D9B,
+ 0x9592, 0x0D9D, 0x9593, 0x0D9C, 0x9594, 0x0D98, 0x9598, 0x0F5C,
+ 0x959B, 0x25F3, 0x959C, 0x25F1, 0x959E, 0x25F2, 0x959F, 0x25F0,
+ 0x95A1, 0x10DF, 0x95A3, 0x10E2, 0x95A4, 0x10E4, 0x95A5, 0x10E3,
+ 0x95A8, 0x10E0, 0x95A9, 0x10E1, 0x95AB, 0x2AB3, 0x95AC, 0x2AB2,
+ 0x95AD, 0x1260, 0x95AE, 0x2AB4, 0x95B0, 0x2AB5, 0x95B1, 0x1261,
+ 0x95B5, 0x2CF0, 0x95B6, 0x2CEE, 0x95B7, 0x2EAD, 0x95B9, 0x2CEC,
+ 0x95BA, 0x2CED, 0x95BB, 0x1385, 0x95BC, 0x2CE9, 0x95BD, 0x2CF1,
+ 0x95BE, 0x2CEB, 0x95BF, 0x2CEF, 0x95C0, 0x2EA9, 0x95C3, 0x2EAB,
+ 0x95C5, 0x2EAC, 0x95C6, 0x14AE, 0x95C7, 0x2EA8, 0x95C8, 0x14AD,
+ 0x95C9, 0x2EAA, 0x95CA, 0x14AA, 0x95CB, 0x14AB, 0x95CC, 0x14AC,
+ 0x95CD, 0x2CEA, 0x95D0, 0x154C, 0x95D1, 0x301F, 0x95D2, 0x301D,
+ 0x95D3, 0x301E, 0x95D4, 0x154A, 0x95D5, 0x154D, 0x95D6, 0x154B,
+ 0x95DA, 0x3163, 0x95DB, 0x3164, 0x95DC, 0x15EB, 0x95DE, 0x326C,
+ 0x95DF, 0x326E, 0x95E0, 0x326D, 0x95E1, 0x1655, 0x95E2, 0x16A0,
+ 0x95E3, 0x3330, 0x95E4, 0x332F, 0x95E5, 0x332E, 0x961C, 0x0699,
+ 0x961E, 0x17B4, 0x9620, 0x1821, 0x9621, 0x0414, 0x9622, 0x181F,
+ 0x9623, 0x1822, 0x9624, 0x1820, 0x9628, 0x18F1, 0x962A, 0x0526,
+ 0x962C, 0x0527, 0x962D, 0x18F3, 0x962E, 0x0524, 0x962F, 0x18F2,
+ 0x9630, 0x18F0, 0x9631, 0x0525, 0x9632, 0x0523, 0x9639, 0x1A55,
+ 0x963A, 0x1A58, 0x963B, 0x069C, 0x963C, 0x1A57, 0x963D, 0x1A56,
+ 0x963F, 0x069B, 0x9640, 0x069A, 0x9642, 0x069E, 0x9643, 0x1A59,
+ 0x9644, 0x069D, 0x964A, 0x1C1A, 0x964B, 0x0823, 0x964C, 0x0824,
+ 0x964D, 0x0825, 0x964E, 0x1C1B, 0x964F, 0x1C17, 0x9650, 0x0822,
+ 0x9651, 0x1C18, 0x9653, 0x1C19, 0x9654, 0x1C16, 0x9658, 0x09F1,
+ 0x965B, 0x09EE, 0x965C, 0x1E2F, 0x965D, 0x09EF, 0x965E, 0x09F2,
+ 0x965F, 0x1E30, 0x9661, 0x09ED, 0x9662, 0x09EB, 0x9663, 0x09EC,
+ 0x9664, 0x09F0, 0x966A, 0x0BD1, 0x966B, 0x20A6, 0x966C, 0x0BD9,
+ 0x966D, 0x20A5, 0x966F, 0x20A8, 0x9670, 0x0BD5, 0x9671, 0x20A7,
+ 0x9672, 0x0DA6, 0x9673, 0x0BD3, 0x9674, 0x0BD6, 0x9675, 0x0BD2,
+ 0x9676, 0x0BD7, 0x9677, 0x0BD8, 0x9678, 0x0BD4, 0x967C, 0x20A4,
+ 0x967D, 0x0DA2, 0x967E, 0x234F, 0x9680, 0x2353, 0x9683, 0x2352,
+ 0x9684, 0x0DA7, 0x9685, 0x0DA3, 0x9686, 0x0DA4, 0x9687, 0x234E,
+ 0x9688, 0x2350, 0x9689, 0x2351, 0x968A, 0x0D9F, 0x968B, 0x0DA1,
+ 0x968D, 0x0DA5, 0x968E, 0x0DA0, 0x9691, 0x25F6, 0x9692, 0x25F4,
+ 0x9693, 0x25F5, 0x9694, 0x0F5E, 0x9695, 0x0F5F, 0x9697, 0x25F7,
+ 0x9698, 0x0F5D, 0x9699, 0x10E5, 0x969B, 0x10E7, 0x969C, 0x10E6,
+ 0x969E, 0x2852, 0x96A1, 0x2853, 0x96A2, 0x2AB7, 0x96A4, 0x2AB6,
+ 0x96A7, 0x1386, 0x96A8, 0x1387, 0x96A9, 0x2CF2, 0x96AA, 0x1388,
+ 0x96AC, 0x2EB0, 0x96AE, 0x2EAE, 0x96B0, 0x2EAF, 0x96B1, 0x14AF,
+ 0x96B3, 0x3020, 0x96B4, 0x15EC, 0x96B6, 0x0231, 0x96B8, 0x14B0,
+ 0x96B9, 0x069F, 0x96BB, 0x09F3, 0x96BC, 0x1E31, 0x96BF, 0x20A9,
+ 0x96C0, 0x0BDA, 0x96C1, 0x0DA8, 0x96C2, 0x2354, 0x96C3, 0x2356,
+ 0x96C4, 0x0DAA, 0x96C5, 0x0DA9, 0x96C6, 0x0DAB, 0x96C7, 0x0DAC,
+ 0x96C8, 0x2355, 0x96C9, 0x0F62, 0x96CA, 0x0F63, 0x96CB, 0x0F61,
+ 0x96CC, 0x10E8, 0x96CD, 0x0F60, 0x96CE, 0x25F8, 0x96D2, 0x10E9,
+ 0x96D3, 0x2AB8, 0x96D4, 0x2CF3, 0x96D5, 0x1389, 0x96D6, 0x14B1,
+ 0x96D7, 0x3021, 0x96D8, 0x3025, 0x96D9, 0x1550, 0x96DA, 0x3022,
+ 0x96DB, 0x1551, 0x96DC, 0x154F, 0x96DD, 0x3026, 0x96DE, 0x1552,
+ 0x96DF, 0x3024, 0x96E1, 0x3165, 0x96E2, 0x154E, 0x96E3, 0x15ED,
+ 0x96E5, 0x34A8, 0x96E8, 0x06A0, 0x96E9, 0x0BDC, 0x96EA, 0x0BDB,
+ 0x96EF, 0x0DAD, 0x96F0, 0x2358, 0x96F1, 0x2357, 0x96F2, 0x0DAE,
+ 0x96F5, 0x25FC, 0x96F6, 0x0F67, 0x96F7, 0x0F64, 0x96F8, 0x25FB,
+ 0x96F9, 0x0F66, 0x96FA, 0x25F9, 0x96FB, 0x0F65, 0x96FD, 0x25FA,
+ 0x96FF, 0x2854, 0x9700, 0x10EA, 0x9702, 0x2ABB, 0x9704, 0x1262,
+ 0x9705, 0x2AB9, 0x9706, 0x1263, 0x9707, 0x1264, 0x9708, 0x2ABA,
+ 0x9709, 0x1265, 0x970B, 0x2CF4, 0x970D, 0x138D, 0x970E, 0x138A,
+ 0x970F, 0x138F, 0x9710, 0x2CF6, 0x9711, 0x138B, 0x9712, 0x2CF5,
+ 0x9713, 0x138E, 0x9716, 0x138C, 0x9718, 0x2EB3, 0x9719, 0x2EB5,
+ 0x971C, 0x14B2, 0x971D, 0x2EB4, 0x971E, 0x14B3, 0x971F, 0x2EB2,
+ 0x9720, 0x2EB1, 0x9722, 0x3028, 0x9723, 0x3027, 0x9724, 0x1553,
+ 0x9725, 0x3029, 0x9726, 0x316A, 0x9727, 0x15EF, 0x9728, 0x3169,
+ 0x9729, 0x3166, 0x972A, 0x15EE, 0x972B, 0x3167, 0x972C, 0x3168,
+ 0x972E, 0x326F, 0x972F, 0x3270, 0x9730, 0x1656, 0x9732, 0x16A3,
+ 0x9735, 0x3331, 0x9738, 0x16A1, 0x9739, 0x16A2, 0x973A, 0x3332,
+ 0x973D, 0x16E2, 0x973E, 0x16E3, 0x973F, 0x33D1, 0x9742, 0x1732,
+ 0x9743, 0x34AA, 0x9744, 0x1734, 0x9746, 0x34A9, 0x9747, 0x34AB,
+ 0x9748, 0x1733, 0x9749, 0x34F1, 0x974B, 0x3526, 0x9752, 0x06A1,
+ 0x9756, 0x0F68, 0x9758, 0x2855, 0x975A, 0x2ABC, 0x975B, 0x1390,
+ 0x975C, 0x1391, 0x975E, 0x06A2, 0x9760, 0x1266, 0x9761, 0x15F0,
+ 0x9762, 0x0826, 0x9766, 0x1392, 0x9768, 0x1710, 0x9769, 0x0827,
+ 0x976A, 0x20AA, 0x976C, 0x2359, 0x976E, 0x235B, 0x9770, 0x235A,
+ 0x9772, 0x2600, 0x9773, 0x25FD, 0x9774, 0x0F69, 0x9776, 0x0F6A,
+ 0x9777, 0x25FE, 0x9778, 0x25FF, 0x977A, 0x2857, 0x977B, 0x285C,
+ 0x977C, 0x10EB, 0x977D, 0x2856, 0x977E, 0x2858, 0x977F, 0x285F,
+ 0x9780, 0x285A, 0x9781, 0x285E, 0x9782, 0x285B, 0x9783, 0x2859,
+ 0x9784, 0x285D, 0x9785, 0x10EC, 0x9788, 0x2ABF, 0x978A, 0x2ABD,
+ 0x978B, 0x1268, 0x978D, 0x1267, 0x978E, 0x2ABE, 0x978F, 0x1269,
+ 0x9794, 0x2CF9, 0x9797, 0x2CF8, 0x9798, 0x1393, 0x9799, 0x2CF7,
+ 0x979A, 0x2EB6, 0x979C, 0x2EB8, 0x979D, 0x2EBA, 0x979E, 0x2EB9,
+ 0x97A0, 0x14B4, 0x97A1, 0x2EB7, 0x97A2, 0x3030, 0x97A3, 0x1554,
+ 0x97A4, 0x302E, 0x97A5, 0x3031, 0x97A6, 0x1555, 0x97A8, 0x302C,
+ 0x97AA, 0x302F, 0x97AB, 0x302D, 0x97AC, 0x302A, 0x97AD, 0x1556,
+ 0x97AE, 0x302B, 0x97B3, 0x316B, 0x97B6, 0x316D, 0x97B7, 0x316C,
+ 0x97B9, 0x3271, 0x97BB, 0x3272, 0x97BF, 0x3333, 0x97C1, 0x16E5,
+ 0x97C3, 0x16E4, 0x97C4, 0x344C, 0x97C5, 0x344D, 0x97C6, 0x1735,
+ 0x97C7, 0x34AC, 0x97C9, 0x1756, 0x97CB, 0x0828, 0x97CC, 0x0DAF,
+ 0x97CD, 0x2861, 0x97CE, 0x2860, 0x97CF, 0x2AC1, 0x97D0, 0x2AC0,
+ 0x97D3, 0x14B5, 0x97D4, 0x2EBC, 0x97D5, 0x2EBB, 0x97D6, 0x3034,
+ 0x97D7, 0x3032, 0x97D8, 0x3035, 0x97D9, 0x3033, 0x97DC, 0x15F1,
+ 0x97DD, 0x316E, 0x97DE, 0x316F, 0x97DF, 0x3170, 0x97E1, 0x3334,
+ 0x97E3, 0x33D2, 0x97E5, 0x34AD, 0x97ED, 0x0829, 0x97F0, 0x2CFA,
+ 0x97F1, 0x2EBD, 0x97F3, 0x082A, 0x97F6, 0x10ED, 0x97F8, 0x2CFB,
+ 0x97F9, 0x1557, 0x97FA, 0x3036, 0x97FB, 0x15F2, 0x97FD, 0x3273,
+ 0x97FE, 0x3274, 0x97FF, 0x16A4, 0x9800, 0x344E, 0x9801, 0x082B,
+ 0x9802, 0x0BDF, 0x9803, 0x0BE0, 0x9804, 0x20AB, 0x9805, 0x0DB0,
+ 0x9806, 0x0DB1, 0x9807, 0x235C, 0x9808, 0x0DB2, 0x980A, 0x0F6E,
+ 0x980C, 0x0F70, 0x980D, 0x2602, 0x980E, 0x2603, 0x980F, 0x2601,
+ 0x9810, 0x0F6B, 0x9811, 0x0F6C, 0x9812, 0x0F6F, 0x9813, 0x0F6D,
+ 0x9816, 0x2862, 0x9817, 0x10EE, 0x9818, 0x10EF, 0x981B, 0x2AC8,
+ 0x981C, 0x126C, 0x981D, 0x2AC3, 0x981E, 0x2AC2, 0x9820, 0x2AC7,
+ 0x9821, 0x126A, 0x9824, 0x139A, 0x9826, 0x2AC4, 0x9827, 0x2AC9,
+ 0x9828, 0x2AC6, 0x9829, 0x2AC5, 0x982B, 0x126B, 0x982D, 0x1398,
+ 0x982F, 0x2CFD, 0x9830, 0x1394, 0x9832, 0x2CFE, 0x9835, 0x2CFC,
+ 0x9837, 0x1397, 0x9838, 0x1395, 0x9839, 0x1399, 0x983B, 0x1396,
+ 0x9841, 0x2EBE, 0x9843, 0x2EC3, 0x9844, 0x2EBF, 0x9845, 0x2EC2,
+ 0x9846, 0x14B6, 0x9848, 0x2DF2, 0x9849, 0x2EC1, 0x984A, 0x2EC0,
+ 0x984C, 0x155A, 0x984D, 0x1558, 0x984E, 0x155B, 0x984F, 0x1559,
+ 0x9850, 0x3037, 0x9851, 0x3038, 0x9852, 0x3039, 0x9853, 0x155C,
+ 0x9857, 0x3174, 0x9858, 0x15F4, 0x9859, 0x3172, 0x985B, 0x15F5,
+ 0x985C, 0x3171, 0x985D, 0x3173, 0x985E, 0x15F3, 0x985F, 0x3278,
+ 0x9860, 0x3275, 0x9862, 0x3276, 0x9863, 0x3277, 0x9864, 0x3335,
+ 0x9865, 0x16A6, 0x9867, 0x16A5, 0x9869, 0x33D4, 0x986A, 0x33D3,
+ 0x986B, 0x16E6, 0x986F, 0x1711, 0x9870, 0x1736, 0x9871, 0x174D,
+ 0x9872, 0x34F2, 0x9873, 0x3527, 0x9874, 0x3528, 0x98A8, 0x082C,
+ 0x98A9, 0x235D, 0x98AC, 0x2604, 0x98AD, 0x2863, 0x98AE, 0x2864,
+ 0x98AF, 0x10F0, 0x98B1, 0x10F1, 0x98B2, 0x2ACA, 0x98B3, 0x126D,
+ 0x98B6, 0x14B7, 0x98B8, 0x303A, 0x98BA, 0x155D, 0x98BB, 0x3177,
+ 0x98BC, 0x15F6, 0x98BD, 0x3176, 0x98BE, 0x3178, 0x98BF, 0x3175,
+ 0x98C0, 0x3338, 0x98C1, 0x3279, 0x98C2, 0x327A, 0x98C4, 0x1657,
+ 0x98C6, 0x3337, 0x98C9, 0x3336, 0x98CB, 0x33D5, 0x98CC, 0x3529,
+ 0x98DB, 0x082D, 0x98DF, 0x082E, 0x98E2, 0x09F4, 0x98E3, 0x1E32,
+ 0x98E5, 0x20AC, 0x98E7, 0x0DB3, 0x98E9, 0x0DB6, 0x98EA, 0x0DB4,
+ 0x98EB, 0x235E, 0x98ED, 0x0DB8, 0x98EF, 0x0DB5, 0x98F2, 0x0DB7,
+ 0x98F4, 0x0F72, 0x98F6, 0x2605, 0x98F9, 0x2606, 0x98FA, 0x2ACC,
+ 0x98FC, 0x0F71, 0x98FD, 0x0F73, 0x98FE, 0x0F74, 0x9900, 0x2866,
+ 0x9902, 0x2865, 0x9903, 0x10F2, 0x9905, 0x10F3, 0x9907, 0x2867,
+ 0x9908, 0x2ACB, 0x9909, 0x10F5, 0x990A, 0x126E, 0x990C, 0x10F4,
+ 0x9910, 0x139B, 0x9911, 0x2ACD, 0x9912, 0x1270, 0x9913, 0x126F,
+ 0x9914, 0x2ACE, 0x9915, 0x2AD1, 0x9916, 0x2ACF, 0x9917, 0x2AD0,
+ 0x9918, 0x1271, 0x991A, 0x13A0, 0x991B, 0x139E, 0x991E, 0x139D,
+ 0x991F, 0x2D00, 0x9921, 0x139F, 0x9924, 0x2CFF, 0x9925, 0x2EC4,
+ 0x9927, 0x2D01, 0x9928, 0x139C, 0x9929, 0x2D02, 0x992A, 0x2EC7,
+ 0x992B, 0x2EC5, 0x992C, 0x2EC6, 0x992D, 0x2ECB, 0x992E, 0x1561,
+ 0x992F, 0x2ECA, 0x9930, 0x2ECD, 0x9931, 0x2ECC, 0x9932, 0x2EC9,
+ 0x9933, 0x2EC8, 0x9935, 0x14B8, 0x993A, 0x303D, 0x993C, 0x303C,
+ 0x993D, 0x1560, 0x993E, 0x155E, 0x993F, 0x155F, 0x9941, 0x303B,
+ 0x9943, 0x317B, 0x9945, 0x15F7, 0x9947, 0x317A, 0x9948, 0x3179,
+ 0x9949, 0x15F8, 0x994B, 0x327F, 0x994C, 0x327E, 0x994E, 0x327C,
+ 0x9950, 0x327B, 0x9951, 0x1659, 0x9952, 0x1658, 0x9953, 0x3280,
+ 0x9954, 0x33D6, 0x9955, 0x16E7, 0x9956, 0x333A, 0x9957, 0x16A7,
+ 0x9958, 0x3339, 0x9959, 0x327D, 0x995B, 0x33D7, 0x995C, 0x1712,
+ 0x995E, 0x174E, 0x995F, 0x34F3, 0x9961, 0x352A, 0x9996, 0x082F,
+ 0x9997, 0x20AD, 0x9998, 0x2ECE, 0x9999, 0x0830, 0x999C, 0x2869,
+ 0x999D, 0x2868, 0x999E, 0x2D03, 0x99A1, 0x2ED0, 0x99A3, 0x2ECF,
+ 0x99A5, 0x1562, 0x99A6, 0x317C, 0x99A7, 0x317D, 0x99A8, 0x165A,
+ 0x99AB, 0x352B, 0x99AC, 0x09F5, 0x99AD, 0x0DBA, 0x99AE, 0x0DB9,
+ 0x99AF, 0x2607, 0x99B0, 0x2609, 0x99B1, 0x0F76, 0x99B2, 0x2608,
+ 0x99B3, 0x0F75, 0x99B4, 0x0F77, 0x99B5, 0x260A, 0x99B9, 0x286B,
+ 0x99BA, 0x286D, 0x99BB, 0x286C, 0x99BD, 0x286F, 0x99C1, 0x10F6,
+ 0x99C2, 0x286E, 0x99C3, 0x286A, 0x99C7, 0x2870, 0x99C9, 0x2AD8,
+ 0x99CB, 0x2ADB, 0x99CC, 0x2ADD, 0x99CD, 0x2AD3, 0x99CE, 0x2AD7,
+ 0x99CF, 0x2AD4, 0x99D0, 0x1273, 0x99D1, 0x1276, 0x99D2, 0x1278,
+ 0x99D3, 0x2AD5, 0x99D4, 0x2AD6, 0x99D5, 0x1277, 0x99D6, 0x2AD9,
+ 0x99D7, 0x2ADC, 0x99D8, 0x2ADA, 0x99D9, 0x1279, 0x99DB, 0x1275,
+ 0x99DC, 0x2AD2, 0x99DD, 0x1272, 0x99DF, 0x1274, 0x99E2, 0x13A2,
+ 0x99E3, 0x2D09, 0x99E4, 0x2D07, 0x99E5, 0x2D06, 0x99E7, 0x2D0C,
+ 0x99E9, 0x2D0B, 0x99EA, 0x2D0A, 0x99EC, 0x2D05, 0x99ED, 0x13A1,
+ 0x99EE, 0x2D04, 0x99F0, 0x2D08, 0x99F1, 0x13A3, 0x99F4, 0x2ED3,
+ 0x99F6, 0x2ED7, 0x99F7, 0x2ED4, 0x99F8, 0x2ED6, 0x99F9, 0x2ED5,
+ 0x99FA, 0x2ED2, 0x99FB, 0x2ED8, 0x99FC, 0x2EDB, 0x99FD, 0x2ED9,
+ 0x99FE, 0x2EDA, 0x99FF, 0x14BA, 0x9A01, 0x14B9, 0x9A02, 0x2ED1,
+ 0x9A03, 0x2EDC, 0x9A04, 0x3042, 0x9A05, 0x3045, 0x9A06, 0x3047,
+ 0x9A07, 0x3046, 0x9A09, 0x3040, 0x9A0A, 0x3044, 0x9A0B, 0x303F,
+ 0x9A0D, 0x3041, 0x9A0E, 0x1563, 0x9A0F, 0x303E, 0x9A11, 0x3043,
+ 0x9A14, 0x318A, 0x9A15, 0x317F, 0x9A16, 0x15F9, 0x9A19, 0x15FA,
+ 0x9A1A, 0x317E, 0x9A1B, 0x3183, 0x9A1C, 0x3189, 0x9A1D, 0x3181,
+ 0x9A1E, 0x3188, 0x9A20, 0x3185, 0x9A22, 0x3184, 0x9A23, 0x3187,
+ 0x9A24, 0x3182, 0x9A25, 0x3180, 0x9A27, 0x3186, 0x9A29, 0x3287,
+ 0x9A2A, 0x3285, 0x9A2B, 0x165B, 0x9A2C, 0x3284, 0x9A2D, 0x328A,
+ 0x9A2E, 0x3288, 0x9A30, 0x165C, 0x9A31, 0x3283, 0x9A32, 0x3281,
+ 0x9A34, 0x3282, 0x9A35, 0x165E, 0x9A36, 0x3286, 0x9A37, 0x165D,
+ 0x9A38, 0x3289, 0x9A39, 0x333B, 0x9A3A, 0x3341, 0x9A3D, 0x333C,
+ 0x9A3E, 0x16AB, 0x9A3F, 0x3342, 0x9A40, 0x16AA, 0x9A41, 0x3340,
+ 0x9A42, 0x333F, 0x9A43, 0x16A9, 0x9A44, 0x333E, 0x9A45, 0x16A8,
+ 0x9A46, 0x333D, 0x9A48, 0x33DD, 0x9A49, 0x33DF, 0x9A4A, 0x33DE,
+ 0x9A4C, 0x33DB, 0x9A4D, 0x16E9, 0x9A4E, 0x33D8, 0x9A4F, 0x33DC,
+ 0x9A50, 0x33E1, 0x9A52, 0x33E0, 0x9A53, 0x33D9, 0x9A54, 0x33DA,
+ 0x9A55, 0x16E8, 0x9A56, 0x344F, 0x9A57, 0x1715, 0x9A59, 0x3450,
+ 0x9A5A, 0x1713, 0x9A5B, 0x1714, 0x9A5E, 0x34AE, 0x9A5F, 0x1737,
+ 0x9A60, 0x3510, 0x9A62, 0x1757, 0x9A64, 0x352C, 0x9A65, 0x1758,
+ 0x9A66, 0x352D, 0x9A67, 0x352E, 0x9A68, 0x353C, 0x9A69, 0x353B,
+ 0x9A6A, 0x1767, 0x9A6B, 0x3544, 0x9AA8, 0x09F6, 0x9AAB, 0x260C,
+ 0x9AAD, 0x260B, 0x9AAF, 0x10F7, 0x9AB0, 0x10F8, 0x9AB1, 0x2871,
+ 0x9AB3, 0x2ADE, 0x9AB4, 0x2D0F, 0x9AB7, 0x127A, 0x9AB8, 0x13A4,
+ 0x9AB9, 0x2D0D, 0x9ABB, 0x2D10, 0x9ABC, 0x13A5, 0x9ABE, 0x2EDD,
+ 0x9ABF, 0x2D0E, 0x9AC0, 0x3048, 0x9AC1, 0x1564, 0x9AC2, 0x318B,
+ 0x9AC6, 0x328D, 0x9AC7, 0x328B, 0x9ACA, 0x328C, 0x9ACD, 0x3343,
+ 0x9ACF, 0x16AC, 0x9AD0, 0x33E2, 0x9AD1, 0x1718, 0x9AD2, 0x16EA,
+ 0x9AD3, 0x1716, 0x9AD4, 0x1717, 0x9AD5, 0x34AF, 0x9AD6, 0x174F,
+ 0x9AD8, 0x09F7, 0x9ADC, 0x3049, 0x9ADF, 0x1E33, 0x9AE1, 0x0F78,
+ 0x9AE3, 0x2872, 0x9AE6, 0x10F9, 0x9AE7, 0x2873, 0x9AEB, 0x2AE0,
+ 0x9AEC, 0x2ADF, 0x9AED, 0x13A7, 0x9AEE, 0x127B, 0x9AEF, 0x127C,
+ 0x9AF1, 0x2AE3, 0x9AF2, 0x2AE2, 0x9AF3, 0x2AE1, 0x9AF6, 0x2D11,
+ 0x9AF7, 0x2D14, 0x9AF9, 0x2D13, 0x9AFA, 0x2D12, 0x9AFB, 0x13A6,
+ 0x9AFC, 0x2EE1, 0x9AFD, 0x2EDF, 0x9AFE, 0x2EDE, 0x9B01, 0x2EE0,
+ 0x9B03, 0x1565, 0x9B04, 0x304B, 0x9B05, 0x304C, 0x9B06, 0x1566,
+ 0x9B08, 0x304A, 0x9B0A, 0x318D, 0x9B0B, 0x318C, 0x9B0C, 0x318F,
+ 0x9B0D, 0x15FB, 0x9B0E, 0x318E, 0x9B10, 0x328E, 0x9B11, 0x3290,
+ 0x9B12, 0x328F, 0x9B15, 0x3344, 0x9B16, 0x3347, 0x9B17, 0x3345,
+ 0x9B18, 0x3346, 0x9B19, 0x33E3, 0x9B1A, 0x16EB, 0x9B1E, 0x3451,
+ 0x9B1F, 0x3452, 0x9B20, 0x3453, 0x9B22, 0x1738, 0x9B23, 0x1750,
+ 0x9B24, 0x352F, 0x9B25, 0x09F8, 0x9B27, 0x127D, 0x9B28, 0x13A8,
+ 0x9B29, 0x304D, 0x9B2B, 0x33E4, 0x9B2E, 0x3511, 0x9B2F, 0x1E34,
+ 0x9B31, 0x1768, 0x9B32, 0x09F9, 0x9B33, 0x2D15, 0x9B35, 0x304E,
+ 0x9B37, 0x3190, 0x9B3A, 0x3348, 0x9B3B, 0x33E5, 0x9B3C, 0x09FA,
+ 0x9B3E, 0x2874, 0x9B3F, 0x2875, 0x9B41, 0x10FA, 0x9B42, 0x10FB,
+ 0x9B43, 0x2AE5, 0x9B44, 0x127F, 0x9B45, 0x127E, 0x9B46, 0x2AE4,
+ 0x9B48, 0x2EE2, 0x9B4A, 0x304F, 0x9B4B, 0x3051, 0x9B4C, 0x3050,
+ 0x9B4D, 0x1569, 0x9B4E, 0x1568, 0x9B4F, 0x1567, 0x9B51, 0x16AE,
+ 0x9B52, 0x3349, 0x9B54, 0x16AD, 0x9B55, 0x33E7, 0x9B56, 0x33E6,
+ 0x9B58, 0x1739, 0x9B59, 0x34B0, 0x9B5A, 0x0BE1, 0x9B5B, 0x260D,
+ 0x9B5F, 0x2878, 0x9B60, 0x2876, 0x9B61, 0x2877, 0x9B64, 0x2AEE,
+ 0x9B66, 0x2AE9, 0x9B67, 0x2AE6, 0x9B68, 0x2AED, 0x9B6C, 0x2AEF,
+ 0x9B6F, 0x1281, 0x9B70, 0x2AEC, 0x9B71, 0x2AE8, 0x9B74, 0x2AE7,
+ 0x9B75, 0x2AEB, 0x9B76, 0x2AEA, 0x9B77, 0x1280, 0x9B7A, 0x2D20,
+ 0x9B7B, 0x2D1B, 0x9B7C, 0x2D19, 0x9B7D, 0x2D22, 0x9B7E, 0x2D1A,
+ 0x9B80, 0x2D16, 0x9B82, 0x2D1C, 0x9B85, 0x2D17, 0x9B86, 0x2EEB,
+ 0x9B87, 0x2D18, 0x9B88, 0x2D23, 0x9B90, 0x2D1F, 0x9B91, 0x13A9,
+ 0x9B92, 0x2D1E, 0x9B93, 0x2D1D, 0x9B95, 0x2D21, 0x9B9A, 0x2EE3,
+ 0x9B9B, 0x2EE6, 0x9B9E, 0x2EE5, 0x9BA0, 0x2EED, 0x9BA1, 0x2EE8,
+ 0x9BA2, 0x2EEC, 0x9BA4, 0x2EEA, 0x9BA5, 0x2EE9, 0x9BA6, 0x2EE7,
+ 0x9BA8, 0x2EE4, 0x9BAA, 0x14BD, 0x9BAB, 0x14BC, 0x9BAD, 0x14BE,
+ 0x9BAE, 0x14BB, 0x9BAF, 0x2EEE, 0x9BB5, 0x3057, 0x9BB6, 0x305A,
+ 0x9BB8, 0x3058, 0x9BB9, 0x305C, 0x9BBD, 0x305D, 0x9BBF, 0x3055,
+ 0x9BC0, 0x156E, 0x9BC1, 0x3056, 0x9BC3, 0x3054, 0x9BC4, 0x305B,
+ 0x9BC6, 0x3053, 0x9BC7, 0x3052, 0x9BC8, 0x156D, 0x9BC9, 0x156B,
+ 0x9BCA, 0x156A, 0x9BD3, 0x3059, 0x9BD4, 0x3199, 0x9BD5, 0x319F,
+ 0x9BD6, 0x15FE, 0x9BD7, 0x319A, 0x9BD9, 0x319D, 0x9BDA, 0x31A1,
+ 0x9BDB, 0x15FF, 0x9BDC, 0x319C, 0x9BDE, 0x3194, 0x9BE0, 0x3193,
+ 0x9BE1, 0x31A0, 0x9BE2, 0x3197, 0x9BE4, 0x3195, 0x9BE5, 0x319E,
+ 0x9BE6, 0x3196, 0x9BE7, 0x15FD, 0x9BE8, 0x15FC, 0x9BEA, 0x3191,
+ 0x9BEB, 0x3192, 0x9BEC, 0x319B, 0x9BF0, 0x3198, 0x9BF7, 0x3293,
+ 0x9BF8, 0x3296, 0x9BFD, 0x156C, 0x9C05, 0x3294, 0x9C06, 0x329A,
+ 0x9C07, 0x3298, 0x9C08, 0x3292, 0x9C09, 0x329D, 0x9C0B, 0x3291,
+ 0x9C0D, 0x1660, 0x9C0E, 0x3299, 0x9C12, 0x3295, 0x9C13, 0x165F,
+ 0x9C14, 0x329C, 0x9C17, 0x329B, 0x9C1C, 0x334C, 0x9C1D, 0x334B,
+ 0x9C21, 0x3352, 0x9C23, 0x334E, 0x9C24, 0x3351, 0x9C25, 0x16B0,
+ 0x9C28, 0x334F, 0x9C29, 0x3350, 0x9C2B, 0x334A, 0x9C2C, 0x334D,
+ 0x9C2D, 0x16AF, 0x9C31, 0x16ED, 0x9C32, 0x33F2, 0x9C33, 0x33ED,
+ 0x9C34, 0x33F1, 0x9C36, 0x33F4, 0x9C37, 0x33F0, 0x9C39, 0x33EC,
+ 0x9C3B, 0x16EF, 0x9C3C, 0x33EF, 0x9C3D, 0x33F3, 0x9C3E, 0x16EE,
+ 0x9C3F, 0x33EA, 0x9C40, 0x3297, 0x9C41, 0x33EE, 0x9C44, 0x33EB,
+ 0x9C46, 0x33E8, 0x9C48, 0x33E9, 0x9C49, 0x16EC, 0x9C4A, 0x3457,
+ 0x9C4B, 0x3459, 0x9C4C, 0x345C, 0x9C4D, 0x3458, 0x9C4E, 0x345D,
+ 0x9C50, 0x3456, 0x9C52, 0x3454, 0x9C54, 0x1719, 0x9C55, 0x345A,
+ 0x9C56, 0x171B, 0x9C57, 0x171A, 0x9C58, 0x3455, 0x9C59, 0x345B,
+ 0x9C5E, 0x34B5, 0x9C5F, 0x173A, 0x9C60, 0x34B6, 0x9C62, 0x34B4,
+ 0x9C63, 0x34B1, 0x9C66, 0x34B3, 0x9C67, 0x34B2, 0x9C68, 0x34F4,
+ 0x9C6D, 0x34F6, 0x9C6E, 0x34F5, 0x9C71, 0x3514, 0x9C73, 0x3513,
+ 0x9C74, 0x3512, 0x9C75, 0x3515, 0x9C77, 0x1760, 0x9C78, 0x1761,
+ 0x9C79, 0x3541, 0x9C7A, 0x3545, 0x9CE5, 0x0BE2, 0x9CE6, 0x235F,
+ 0x9CE7, 0x2610, 0x9CE9, 0x0F79, 0x9CEA, 0x260E, 0x9CED, 0x260F,
+ 0x9CF1, 0x2879, 0x9CF2, 0x287A, 0x9CF3, 0x10FE, 0x9CF4, 0x10FC,
+ 0x9CF5, 0x287B, 0x9CF6, 0x10FD, 0x9CF7, 0x2AF4, 0x9CF9, 0x2AF7,
+ 0x9CFA, 0x2AF1, 0x9CFB, 0x2AF8, 0x9CFC, 0x2AF0, 0x9CFD, 0x2AF2,
+ 0x9CFF, 0x2AF3, 0x9D00, 0x2AF6, 0x9D03, 0x1284, 0x9D04, 0x2AFB,
+ 0x9D05, 0x2AFA, 0x9D06, 0x1282, 0x9D07, 0x2AF5, 0x9D08, 0x2AF9,
+ 0x9D09, 0x1283, 0x9D10, 0x2D2D, 0x9D12, 0x13AE, 0x9D14, 0x2D28,
+ 0x9D15, 0x13AA, 0x9D17, 0x2D25, 0x9D18, 0x2D2B, 0x9D19, 0x2D2E,
+ 0x9D1B, 0x13AF, 0x9D1D, 0x2D2A, 0x9D1E, 0x2D27, 0x9D1F, 0x2D2F,
+ 0x9D20, 0x2D26, 0x9D22, 0x2D2C, 0x9D23, 0x13AB, 0x9D25, 0x2D24,
+ 0x9D26, 0x13AC, 0x9D28, 0x13AD, 0x9D29, 0x2D29, 0x9D2D, 0x2F00,
+ 0x9D2E, 0x2EF3, 0x9D2F, 0x2EF4, 0x9D30, 0x2EF7, 0x9D31, 0x2EF5,
+ 0x9D33, 0x2EEF, 0x9D36, 0x2EF2, 0x9D37, 0x2EFC, 0x9D38, 0x2EF6,
+ 0x9D3B, 0x14BF, 0x9D3D, 0x2EFE, 0x9D3E, 0x2EFB, 0x9D3F, 0x14C0,
+ 0x9D40, 0x2EFD, 0x9D41, 0x2EF0, 0x9D42, 0x2EF9, 0x9D43, 0x2EFA,
+ 0x9D45, 0x2EF8, 0x9D4A, 0x3061, 0x9D4B, 0x3063, 0x9D4C, 0x3066,
+ 0x9D4F, 0x3060, 0x9D51, 0x156F, 0x9D52, 0x3068, 0x9D53, 0x305F,
+ 0x9D54, 0x3069, 0x9D56, 0x3065, 0x9D57, 0x3067, 0x9D58, 0x306B,
+ 0x9D59, 0x3064, 0x9D5A, 0x306C, 0x9D5B, 0x3062, 0x9D5C, 0x305E,
+ 0x9D5D, 0x1570, 0x9D5F, 0x306A, 0x9D60, 0x1571, 0x9D61, 0x1601,
+ 0x9D67, 0x2EF1, 0x9D68, 0x31BB, 0x9D69, 0x31B2, 0x9D6A, 0x1603,
+ 0x9D6B, 0x31AE, 0x9D6C, 0x1604, 0x9D6F, 0x31B7, 0x9D70, 0x31B1,
+ 0x9D71, 0x31A7, 0x9D72, 0x1602, 0x9D73, 0x31B4, 0x9D74, 0x31AF,
+ 0x9D75, 0x31B0, 0x9D77, 0x31A2, 0x9D78, 0x31A9, 0x9D79, 0x31B8,
+ 0x9D7B, 0x31B5, 0x9D7D, 0x31AD, 0x9D7F, 0x31B9, 0x9D80, 0x31A8,
+ 0x9D81, 0x31A3, 0x9D82, 0x31B6, 0x9D84, 0x31A5, 0x9D85, 0x31B3,
+ 0x9D86, 0x31AA, 0x9D87, 0x31BA, 0x9D88, 0x31A6, 0x9D89, 0x1600,
+ 0x9D8A, 0x31A4, 0x9D8B, 0x31AB, 0x9D8C, 0x31AC, 0x9D90, 0x32A4,
+ 0x9D92, 0x32A2, 0x9D94, 0x32A7, 0x9D96, 0x32B3, 0x9D97, 0x32AA,
+ 0x9D98, 0x32A3, 0x9D99, 0x329F, 0x9D9A, 0x32AC, 0x9D9B, 0x32A5,
+ 0x9D9C, 0x32A8, 0x9D9D, 0x32A1, 0x9D9E, 0x32AF, 0x9D9F, 0x329E,
+ 0x9DA0, 0x32A6, 0x9DA1, 0x32AB, 0x9DA2, 0x32AD, 0x9DA3, 0x32B0,
+ 0x9DA4, 0x32A0, 0x9DA6, 0x32B4, 0x9DA7, 0x32B5, 0x9DA8, 0x32AE,
+ 0x9DA9, 0x32B2, 0x9DAA, 0x32A9, 0x9DAC, 0x3362, 0x9DAD, 0x3365,
+ 0x9DAF, 0x16B1, 0x9DB1, 0x3364, 0x9DB2, 0x3369, 0x9DB3, 0x3367,
+ 0x9DB4, 0x16B2, 0x9DB5, 0x335E, 0x9DB6, 0x3354, 0x9DB7, 0x3353,
+ 0x9DB8, 0x16B4, 0x9DB9, 0x3360, 0x9DBA, 0x3361, 0x9DBB, 0x335D,
+ 0x9DBC, 0x3355, 0x9DBE, 0x335A, 0x9DBF, 0x32B1, 0x9DC1, 0x3356,
+ 0x9DC2, 0x16B3, 0x9DC3, 0x335C, 0x9DC5, 0x335B, 0x9DC7, 0x3357,
+ 0x9DC8, 0x3363, 0x9DCA, 0x3358, 0x9DCB, 0x33F9, 0x9DCC, 0x3366,
+ 0x9DCD, 0x3368, 0x9DCE, 0x335F, 0x9DCF, 0x3359, 0x9DD0, 0x33FA,
+ 0x9DD1, 0x33FC, 0x9DD2, 0x33F6, 0x9DD3, 0x16F0, 0x9DD5, 0x3403,
+ 0x9DD6, 0x3401, 0x9DD7, 0x16F1, 0x9DD8, 0x3400, 0x9DD9, 0x33FF,
+ 0x9DDA, 0x33F8, 0x9DDB, 0x33F5, 0x9DDC, 0x33FB, 0x9DDD, 0x3404,
+ 0x9DDE, 0x33F7, 0x9DDF, 0x33FD, 0x9DE1, 0x3466, 0x9DE2, 0x346B,
+ 0x9DE3, 0x3461, 0x9DE4, 0x3464, 0x9DE5, 0x171C, 0x9DE6, 0x3468,
+ 0x9DE8, 0x346F, 0x9DE9, 0x33FE, 0x9DEB, 0x3462, 0x9DEC, 0x346C,
+ 0x9DED, 0x3470, 0x9DEE, 0x3467, 0x9DEF, 0x3460, 0x9DF0, 0x346A,
+ 0x9DF2, 0x3469, 0x9DF3, 0x346E, 0x9DF4, 0x346D, 0x9DF5, 0x3402,
+ 0x9DF6, 0x3465, 0x9DF7, 0x345F, 0x9DF8, 0x3463, 0x9DF9, 0x173B,
+ 0x9DFA, 0x173C, 0x9DFB, 0x345E, 0x9DFD, 0x34C1, 0x9DFE, 0x34B8,
+ 0x9DFF, 0x34C0, 0x9E00, 0x34BD, 0x9E01, 0x34BE, 0x9E02, 0x34B7,
+ 0x9E03, 0x34BA, 0x9E04, 0x34C2, 0x9E05, 0x34BC, 0x9E06, 0x34BB,
+ 0x9E07, 0x34B9, 0x9E09, 0x34BF, 0x9E0B, 0x34F7, 0x9E0D, 0x34F8,
+ 0x9E0F, 0x34FA, 0x9E10, 0x34F9, 0x9E11, 0x34FC, 0x9E12, 0x34FB,
+ 0x9E13, 0x3517, 0x9E14, 0x3516, 0x9E15, 0x3530, 0x9E17, 0x3531,
+ 0x9E19, 0x353D, 0x9E1A, 0x1765, 0x9E1B, 0x1769, 0x9E1D, 0x3546,
+ 0x9E1E, 0x176A, 0x9E75, 0x0BE3, 0x9E79, 0x1661, 0x9E7A, 0x336A,
+ 0x9E7C, 0x173D, 0x9E7D, 0x173E, 0x9E7F, 0x0BE4, 0x9E80, 0x2611,
+ 0x9E82, 0x0F7A, 0x9E83, 0x2AFC, 0x9E86, 0x2D31, 0x9E87, 0x2D32,
+ 0x9E88, 0x2D30, 0x9E89, 0x2F02, 0x9E8A, 0x2F01, 0x9E8B, 0x14C1,
+ 0x9E8C, 0x306E, 0x9E8D, 0x2F03, 0x9E8E, 0x306D, 0x9E91, 0x31BD,
+ 0x9E92, 0x1605, 0x9E93, 0x1607, 0x9E94, 0x31BC, 0x9E97, 0x1606,
+ 0x9E99, 0x32B6, 0x9E9A, 0x32B8, 0x9E9B, 0x32B7, 0x9E9C, 0x336B,
+ 0x9E9D, 0x16B5, 0x9E9F, 0x171D, 0x9EA0, 0x34C3, 0x9EA1, 0x34FD,
+ 0x9EA4, 0x354A, 0x9EA5, 0x0BE5, 0x9EA7, 0x287C, 0x9EA9, 0x1285,
+ 0x9EAD, 0x2D34, 0x9EAE, 0x2D33, 0x9EB0, 0x2F04, 0x9EB4, 0x1608,
+ 0x9EB5, 0x1662, 0x9EB6, 0x3405, 0x9EB7, 0x3542, 0x9EBB, 0x0BE6,
+ 0x9EBC, 0x10FF, 0x9EBE, 0x1286, 0x9EC0, 0x31BE, 0x9EC2, 0x3471,
+ 0x9EC3, 0x0DBB, 0x9EC8, 0x2F05, 0x9ECC, 0x1751, 0x9ECD, 0x0DBC,
+ 0x9ECE, 0x1287, 0x9ECF, 0x14C2, 0x9ED0, 0x3472, 0x9ED1, 0x0DBD,
+ 0x9ED3, 0x2AFD, 0x9ED4, 0x13B1, 0x9ED5, 0x2D35, 0x9ED6, 0x2D36,
+ 0x9ED8, 0x13B0, 0x9EDA, 0x2F06, 0x9EDB, 0x14C6, 0x9EDC, 0x14C4,
+ 0x9EDD, 0x14C5, 0x9EDE, 0x14C3, 0x9EDF, 0x306F, 0x9EE0, 0x1572,
+ 0x9EE4, 0x32BA, 0x9EE5, 0x32B9, 0x9EE6, 0x32BC, 0x9EE7, 0x32BB,
+ 0x9EE8, 0x1663, 0x9EEB, 0x336C, 0x9EED, 0x336E, 0x9EEE, 0x336D,
+ 0x9EEF, 0x16B6, 0x9EF0, 0x3406, 0x9EF2, 0x3473, 0x9EF3, 0x3474,
+ 0x9EF4, 0x171E, 0x9EF5, 0x34FE, 0x9EF6, 0x3518, 0x9EF7, 0x1762,
+ 0x9EF9, 0x2360, 0x9EFA, 0x2D37, 0x9EFB, 0x2F07, 0x9EFC, 0x31BF,
+ 0x9EFD, 0x2612, 0x9EFF, 0x2F08, 0x9F00, 0x3071, 0x9F01, 0x3070,
+ 0x9F06, 0x3475, 0x9F07, 0x173F, 0x9F09, 0x34FF, 0x9F0A, 0x3519,
+ 0x9F0E, 0x0F7B, 0x9F0F, 0x2AFE, 0x9F10, 0x2AFF, 0x9F12, 0x2D38,
+ 0x9F13, 0x0F7C, 0x9F15, 0x1573, 0x9F16, 0x3072, 0x9F18, 0x3370,
+ 0x9F19, 0x16B7, 0x9F1A, 0x3371, 0x9F1B, 0x336F, 0x9F1C, 0x3476,
+ 0x9F1E, 0x34C4, 0x9F20, 0x0F7D, 0x9F22, 0x2F0B, 0x9F23, 0x2F0A,
+ 0x9F24, 0x2F09, 0x9F25, 0x3073, 0x9F28, 0x3077, 0x9F29, 0x3076,
+ 0x9F2A, 0x3075, 0x9F2B, 0x3074, 0x9F2C, 0x1574, 0x9F2D, 0x31C0,
+ 0x9F2E, 0x32BE, 0x9F2F, 0x1664, 0x9F30, 0x32BD, 0x9F31, 0x3372,
+ 0x9F32, 0x3409, 0x9F33, 0x3408, 0x9F34, 0x16F2, 0x9F35, 0x3407,
+ 0x9F36, 0x3479, 0x9F37, 0x3478, 0x9F38, 0x3477, 0x9F3B, 0x1100,
+ 0x9F3D, 0x2D39, 0x9F3E, 0x14C7, 0x9F40, 0x31C1, 0x9F41, 0x31C2,
+ 0x9F42, 0x340A, 0x9F43, 0x347A, 0x9F46, 0x34C5, 0x9F47, 0x3500,
+ 0x9F48, 0x3532, 0x9F49, 0x354C, 0x9F4A, 0x1101, 0x9F4B, 0x14C8,
+ 0x9F4C, 0x3078, 0x9F4D, 0x31C3, 0x9F4E, 0x3373, 0x9F4F, 0x347B,
+ 0x9F52, 0x1289, 0x9F54, 0x2F0C, 0x9F55, 0x3079, 0x9F56, 0x31C4,
+ 0x9F57, 0x31C5, 0x9F58, 0x31C6, 0x9F59, 0x32C3, 0x9F5B, 0x32BF,
+ 0x9F5C, 0x16B8, 0x9F5D, 0x32C2, 0x9F5E, 0x32C1, 0x9F5F, 0x1665,
+ 0x9F60, 0x32C0, 0x9F61, 0x1667, 0x9F63, 0x1666, 0x9F64, 0x3375,
+ 0x9F65, 0x3374, 0x9F66, 0x16B9, 0x9F67, 0x16BA, 0x9F6A, 0x16F4,
+ 0x9F6B, 0x340B, 0x9F6C, 0x16F3, 0x9F6E, 0x347E, 0x9F6F, 0x347F,
+ 0x9F70, 0x347D, 0x9F71, 0x347C, 0x9F72, 0x1741, 0x9F74, 0x34C6,
+ 0x9F75, 0x34C7, 0x9F76, 0x34C8, 0x9F77, 0x1740, 0x9F78, 0x3501,
+ 0x9F79, 0x3504, 0x9F7A, 0x3503, 0x9F7B, 0x3502, 0x9F7E, 0x354B,
+ 0x9F8D, 0x13B2, 0x9F90, 0x157C, 0x9F91, 0x32C4, 0x9F92, 0x3376,
+ 0x9F94, 0x16F5, 0x9F95, 0x340C, 0x9F98, 0x354D, 0x9F9C, 0x13B3,
+ 0x9FA0, 0x2F0D, 0x9FA2, 0x340D, 0x9FA4, 0x351A, 0xE01F, 0x083A,
+ 0xE026, 0x09FD, 0xE05B, 0x030D, 0xE063, 0x016B, 0xE073, 0x0860,
+ 0xE0F3, 0x0C23, 0xE12E, 0x17E4, 0xE149, 0x212F, 0xE191, 0x115F,
+ 0xE1BA, 0x0C79, 0xE1C9, 0x04C3, 0xE22C, 0x18BD, 0xE22D, 0x0CBD,
+ 0xE230, 0x0CA5, 0xE266, 0x0CCE, 0xE2A3, 0x0E84, 0xE2BC, 0x0120,
+ 0xE2EF, 0x1BA8, 0xE33A, 0x1055, 0xE340, 0x2DE8, 0xE34F, 0x0121,
+ 0xE35A, 0x106B, 0xE363, 0x1326, 0xE37C, 0x066B, 0xE37F, 0x132E,
+ 0xE3C5, 0x0D35, 0xE3D7, 0x27C2, 0xE3DC, 0x22AD, 0xE417, 0x134C,
+ 0xE44A, 0x09CE, 0xE478, 0x0BC7, 0xE485, 0x36E9, 0xE4C5, 0x1391,
+ 0xE4DA, 0x16A4, 0xE545, 0x3072, 0xE5D2, 0x0119, 0xE5D3, 0x011A,
+ 0xE5D4, 0x011C, 0xE5D5, 0x011B, 0xE5F4, 0x297C, 0xE6C6, 0x1D06,
+ 0xE727, 0x29A1, 0xE7D3, 0x181B, 0xE893, 0x2B24, 0xEB40, 0x2F50,
+ 0xEB42, 0x1725, 0xEB45, 0x32ED, 0xEB6E, 0x2AD9, 0xEB86, 0x1C14,
+ 0xEB9E, 0x12E9, 0xEBA9, 0x2CAE, 0xEBBA, 0x1A64, 0xEBC9, 0x1404,
+ 0xEBCF, 0x2324, 0xEBD2, 0x346A, 0xEBDE, 0x2291, 0xEC01, 0x1787,
+ 0xEC02, 0x095F, 0xEC15, 0x1E99, 0xEC5B, 0x25C1, 0xEC5E, 0x0D0C,
+ 0xECA6, 0x05E6, 0xED28, 0x0728, 0xED6E, 0x24B6, 0xED7C, 0x1806,
+ 0xED9E, 0x3511, 0xEDE7, 0x0F82, 0xEE52, 0x05F2, 0xEE98, 0x247D,
+ 0xF6B1, 0x01FA, 0xF6B2, 0x01FB, 0xF6B3, 0x01FC, 0xF6B4, 0x01FD,
+ 0xF6B5, 0x01FE, 0xF6B6, 0x01FF, 0xF6B7, 0x0200, 0xF6B8, 0x0201,
+ 0xF6B9, 0x0202, 0xF6BA, 0x0203, 0xF6BB, 0x0204, 0xF6BC, 0x0205,
+ 0xF6BD, 0x0206, 0xF6BE, 0x0207, 0xF6BF, 0x0208, 0xF6C0, 0x0209,
+ 0xF6C1, 0x020A, 0xF6C2, 0x020B, 0xF6C3, 0x020C, 0xF6C4, 0x020D,
+ 0xF6C5, 0x020E, 0xF6C6, 0x020F, 0xF6C7, 0x0210, 0xF6C8, 0x0211,
+ 0xF6C9, 0x0212, 0xF6CA, 0x0213, 0xF6CB, 0x0214, 0xF6CC, 0x0215,
+ 0xF6CD, 0x0216, 0xF6CE, 0x0217, 0xF6CF, 0x0219, 0xF6D0, 0x021A,
+ 0xF6D1, 0x021B, 0xF6D2, 0x021C, 0xF6D3, 0x021D, 0xF6D4, 0x021E,
+ 0xF6D5, 0x021F, 0xF6D6, 0x0220, 0xF6D7, 0x0221, 0xF6D8, 0x0222,
+ 0xF6D9, 0x0223, 0xF6DA, 0x0224, 0xF6DB, 0x0225, 0xF6DC, 0x0226,
+ 0xF6DD, 0x0227, 0xF6DE, 0x0228, 0xF6E0, 0x022A, 0xF6E1, 0x022B,
+ 0xF6E2, 0x022C, 0xF6E4, 0x022E, 0xF6E6, 0x0230, 0xF6E8, 0x35B3,
+ 0xF6E9, 0x35B4, 0xF6EA, 0x35B5, 0xF6EB, 0x35B6, 0xF6EC, 0x35B7,
+ 0xF6ED, 0x35B8, 0xF6F0, 0x35BA, 0xF6F1, 0x35BB, 0xF6F2, 0x35BC,
+ 0xF6F3, 0x35BD, 0xF6F4, 0x35BE, 0xF6F5, 0x35BF, 0xF6F6, 0x35C0,
+ 0xF6F7, 0x35C1, 0xF6F8, 0x35C2, 0xF6F9, 0x35C3, 0xF6FA, 0x35C4,
+ 0xF6FB, 0x35C5, 0xF6FC, 0x35C6, 0xF6FD, 0x35C7, 0xF6FE, 0x35C8,
+ 0xF6FF, 0x35C9, 0xF700, 0x35CA, 0xF701, 0x35CB, 0xF702, 0x35CC,
+ 0xF703, 0x35CD, 0xF704, 0x35CE, 0xF705, 0x35CF, 0xF706, 0x35D0,
+ 0xF707, 0x35D1, 0xF708, 0x35D2, 0xF709, 0x35D3, 0xF70A, 0x35D4,
+ 0xF70B, 0x35D5, 0xF70C, 0x35D6, 0xF70D, 0x35D7, 0xF70E, 0x35D8,
+ 0xF70F, 0x35D9, 0xF710, 0x35DA, 0xF711, 0x35DB, 0xF712, 0x35DC,
+ 0xF713, 0x35DD, 0xF714, 0x35DE, 0xF715, 0x35DF, 0xF716, 0x35E0,
+ 0xF717, 0x35E1, 0xF718, 0x35E2, 0xF719, 0x35E3, 0xF71A, 0x35E4,
+ 0xF71B, 0x35E5, 0xF71C, 0x35E6, 0xF71D, 0x35E7, 0xF71E, 0x35E8,
+ 0xF71F, 0x35E9, 0xF720, 0x35EA, 0xF721, 0x35EB, 0xF722, 0x35EC,
+ 0xF723, 0x35ED, 0xF724, 0x35EE, 0xF725, 0x35EF, 0xF726, 0x35F0,
+ 0xF727, 0x35F1, 0xF728, 0x35F2, 0xF729, 0x35F3, 0xF72A, 0x35F4,
+ 0xF72B, 0x35F5, 0xF72C, 0x35F6, 0xF72D, 0x35F7, 0xF72E, 0x35F8,
+ 0xF72F, 0x35F9, 0xF730, 0x35FA, 0xF731, 0x35FB, 0xF732, 0x35FC,
+ 0xF733, 0x35FD, 0xF734, 0x35FE, 0xF735, 0x35FF, 0xF736, 0x3600,
+ 0xF737, 0x3601, 0xF738, 0x3602, 0xF739, 0x3603, 0xF73A, 0x3604,
+ 0xF73B, 0x3605, 0xF73C, 0x3606, 0xF73D, 0x3607, 0xF73E, 0x3608,
+ 0xF73F, 0x3609, 0xF740, 0x360A, 0xF741, 0x360B, 0xF742, 0x360C,
+ 0xF743, 0x360D, 0xF744, 0x360E, 0xF745, 0x360F, 0xF746, 0x3610,
+ 0xF747, 0x3611, 0xF748, 0x3612, 0xF749, 0x3613, 0xF74A, 0x3614,
+ 0xF74B, 0x3615, 0xF74C, 0x3616, 0xF74D, 0x3617, 0xF74E, 0x3618,
+ 0xF74F, 0x3619, 0xF750, 0x361A, 0xF751, 0x361B, 0xF752, 0x361C,
+ 0xF753, 0x361D, 0xF754, 0x361E, 0xF755, 0x361F, 0xF756, 0x3620,
+ 0xF757, 0x3621, 0xF758, 0x3622, 0xF759, 0x3623, 0xF75A, 0x3624,
+ 0xF75B, 0x3625, 0xF75C, 0x3626, 0xF75D, 0x3627, 0xF75E, 0x3628,
+ 0xF75F, 0x3629, 0xF760, 0x362A, 0xF761, 0x362B, 0xF762, 0x362C,
+ 0xF763, 0x362D, 0xF764, 0x362E, 0xF765, 0x362F, 0xF766, 0x3630,
+ 0xF767, 0x3631, 0xF768, 0x3632, 0xF769, 0x3633, 0xF76A, 0x3634,
+ 0xF76B, 0x3635, 0xF76C, 0x3636, 0xF76D, 0x3637, 0xF76E, 0x3638,
+ 0xF76F, 0x3639, 0xF770, 0x363A, 0xF771, 0x363B, 0xF772, 0x363C,
+ 0xF773, 0x363D, 0xF774, 0x363E, 0xF775, 0x363F, 0xF776, 0x3640,
+ 0xF777, 0x3641, 0xF778, 0x3642, 0xF779, 0x3643, 0xF77A, 0x3644,
+ 0xF77B, 0x3645, 0xF77C, 0x3646, 0xF77D, 0x3647, 0xF77E, 0x3648,
+ 0xF77F, 0x3649, 0xF780, 0x364A, 0xF781, 0x364B, 0xF782, 0x364C,
+ 0xF783, 0x364D, 0xF784, 0x364E, 0xF785, 0x364F, 0xF786, 0x3650,
+ 0xF787, 0x3651, 0xF788, 0x3652, 0xF789, 0x3653, 0xF78A, 0x3654,
+ 0xF78B, 0x3655, 0xF78C, 0x3656, 0xF78D, 0x3657, 0xF78E, 0x3658,
+ 0xF78F, 0x3659, 0xF790, 0x365A, 0xF791, 0x365B, 0xF792, 0x365C,
+ 0xF793, 0x365D, 0xF794, 0x365E, 0xF795, 0x365F, 0xF796, 0x3660,
+ 0xF797, 0x3661, 0xF798, 0x3662, 0xF799, 0x3663, 0xF79A, 0x3664,
+ 0xF79B, 0x3665, 0xF79C, 0x3666, 0xF79D, 0x3667, 0xF79E, 0x3668,
+ 0xF79F, 0x3669, 0xF7A0, 0x366A, 0xF7A1, 0x366B, 0xF7A2, 0x366C,
+ 0xF7A3, 0x366D, 0xF7A4, 0x366E, 0xF7A5, 0x366F, 0xF7A6, 0x3670,
+ 0xF7A7, 0x3671, 0xF7A8, 0x3672, 0xF7A9, 0x3673, 0xF7AA, 0x3674,
+ 0xF7AB, 0x3675, 0xF7AC, 0x3676, 0xF7AD, 0x3677, 0xF7AE, 0x3678,
+ 0xF7AF, 0x3679, 0xF7B0, 0x367A, 0xF7B1, 0x367B, 0xF7B2, 0x367C,
+ 0xF7B3, 0x367D, 0xF7B4, 0x367E, 0xF7B5, 0x367F, 0xF7B6, 0x3680,
+ 0xF7B7, 0x3681, 0xF7B8, 0x3682, 0xF7B9, 0x3683, 0xF7BA, 0x3684,
+ 0xF7BB, 0x3685, 0xF7BC, 0x3686, 0xF7BD, 0x3687, 0xF7BE, 0x3688,
+ 0xF7BF, 0x3689, 0xF7C0, 0x368A, 0xF7C1, 0x368B, 0xF7C2, 0x368C,
+ 0xF7C3, 0x368D, 0xF7C4, 0x368E, 0xF7C5, 0x368F, 0xF7C6, 0x3690,
+ 0xF7C7, 0x3691, 0xF7C8, 0x3692, 0xF7C9, 0x3693, 0xF7CA, 0x3694,
+ 0xF7CB, 0x3695, 0xF7CC, 0x3696, 0xF7CD, 0x3697, 0xF7CE, 0x3698,
+ 0xF7CF, 0x3699, 0xF7D0, 0x369A, 0xF7D1, 0x369B, 0xF7D2, 0x369C,
+ 0xF7D3, 0x369D, 0xF7D4, 0x369E, 0xF7D5, 0x369F, 0xF7D6, 0x36A0,
+ 0xF7D7, 0x36A1, 0xF7D8, 0x36A2, 0xF7D9, 0x36A3, 0xF7DA, 0x36A4,
+ 0xF7DB, 0x36A5, 0xF7DC, 0x36A6, 0xF7DD, 0x36A7, 0xF7DE, 0x36A8,
+ 0xF7DF, 0x36A9, 0xF7E0, 0x36AA, 0xF7E1, 0x36AB, 0xF7E2, 0x36AC,
+ 0xF7E3, 0x36AD, 0xF7E4, 0x36AE, 0xF7E5, 0x36AF, 0xF7E6, 0x36B0,
+ 0xF7E7, 0x36B1, 0xF7E8, 0x36B2, 0xF7E9, 0x36B3, 0xF7EA, 0x36B4,
+ 0xF7EB, 0x36B5, 0xF7EC, 0x36B6, 0xF7ED, 0x36B7, 0xF7EE, 0x36B8,
+ 0xF817, 0x36E1, 0xF818, 0x36E2, 0xF819, 0x36E3, 0xF81A, 0x36E4,
+ 0xF81B, 0x36E5, 0xF81C, 0x36E6, 0xF81D, 0x36E7, 0xFA0C, 0x0274,
+ 0xFA0D, 0x2381, 0xFE30, 0x006D, 0xFE31, 0x007A, 0xFE33, 0x35AF,
+ 0xFE34, 0x35B1, 0xFE35, 0x0082, 0xFE36, 0x0083, 0xFE37, 0x0086,
+ 0xFE38, 0x0087, 0xFE39, 0x008A, 0xFE3A, 0x008B, 0xFE3B, 0x008E,
+ 0xFE3C, 0x008F, 0xFE3D, 0x0092, 0xFE3E, 0x0093, 0xFE3F, 0x0096,
+ 0xFE40, 0x0097, 0xFE41, 0x009A, 0xFE42, 0x009B, 0xFE43, 0x009E,
+ 0xFE44, 0x009F, 0xFE49, 0x00C7, 0xFE4A, 0x00C8, 0xFE4B, 0x00CB,
+ 0xFE4C, 0x00CC, 0xFE4D, 0x00C9, 0xFE4E, 0x00CA, 0xFE4F, 0x35B2,
+ 0xFE50, 0x0070, 0xFE51, 0x0071, 0xFE52, 0x0072, 0xFE54, 0x0074,
+ 0xFE55, 0x0075, 0xFE56, 0x0076, 0xFE57, 0x0077, 0xFE59, 0x00A0,
+ 0xFE5A, 0x00A1, 0xFE5B, 0x00A2, 0xFE5C, 0x00A3, 0xFE5D, 0x00A4,
+ 0xFE5E, 0x00A5, 0xFE5F, 0x00CD, 0xFE60, 0x00CE, 0xFE61, 0x00CF,
+ 0xFE62, 0x00DF, 0xFE63, 0x00E0, 0xFE64, 0x00E1, 0xFE65, 0x00E2,
+ 0xFE66, 0x00E3, 0xFE68, 0x0102, 0xFE69, 0x010C, 0xFE6A, 0x010D,
+ 0xFE6B, 0x010E, 0xFF01, 0x006C, 0xFF02, 0x36E4, 0xFF03, 0x00AE,
+ 0xFF04, 0x0103, 0xFF05, 0x0108, 0xFF06, 0x00AF, 0xFF07, 0x36E3,
+ 0xFF08, 0x0080, 0xFF09, 0x0081, 0xFF0A, 0x00B0, 0xFF0B, 0x00D0,
+ 0xFF0C, 0x0064, 0xFF0D, 0x00D1, 0xFF0E, 0x0067, 0xFF0F, 0x0101,
+ 0xFF10, 0x014D, 0xFF11, 0x014E, 0xFF12, 0x014F, 0xFF13, 0x0150,
+ 0xFF14, 0x0151, 0xFF15, 0x0152, 0xFF16, 0x0153, 0xFF17, 0x0154,
+ 0xFF18, 0x0155, 0xFF19, 0x0156, 0xFF1A, 0x006A, 0xFF1B, 0x0069,
+ 0xFF1C, 0x00D6, 0xFF1D, 0x00D8, 0xFF1E, 0x00D7, 0xFF1F, 0x006B,
+ 0xFF20, 0x0109, 0xFF21, 0x016D, 0xFF22, 0x016E, 0xFF23, 0x016F,
+ 0xFF24, 0x0170, 0xFF25, 0x0171, 0xFF26, 0x0172, 0xFF27, 0x0173,
+ 0xFF28, 0x0174, 0xFF29, 0x0175, 0xFF2A, 0x0176, 0xFF2B, 0x0177,
+ 0xFF2C, 0x0178, 0xFF2D, 0x0179, 0xFF2E, 0x017A, 0xFF2F, 0x017B,
+ 0xFF30, 0x017C, 0xFF31, 0x017D, 0xFF32, 0x017E, 0xFF33, 0x017F,
+ 0xFF34, 0x0180, 0xFF35, 0x0181, 0xFF36, 0x0182, 0xFF37, 0x0183,
+ 0xFF38, 0x0184, 0xFF39, 0x0185, 0xFF3A, 0x0186, 0xFF3B, 0x35BE,
+ 0xFF3C, 0x0102, 0xFF3D, 0x35BF, 0xFF3E, 0x35B4, 0xFF3F, 0x00C5,
+ 0xFF41, 0x0187, 0xFF42, 0x0188, 0xFF43, 0x0189, 0xFF44, 0x018A,
+ 0xFF45, 0x018B, 0xFF46, 0x018C, 0xFF47, 0x018D, 0xFF48, 0x018E,
+ 0xFF49, 0x018F, 0xFF4A, 0x0190, 0xFF4B, 0x0191, 0xFF4C, 0x0192,
+ 0xFF4D, 0x0193, 0xFF4E, 0x0194, 0xFF4F, 0x0195, 0xFF50, 0x0196,
+ 0xFF51, 0x0197, 0xFF52, 0x0198, 0xFF53, 0x0199, 0xFF54, 0x019A,
+ 0xFF55, 0x019B, 0xFF56, 0x019C, 0xFF57, 0x019D, 0xFF58, 0x019E,
+ 0xFF59, 0x019F, 0xFF5A, 0x01A0, 0xFF5B, 0x0084, 0xFF5C, 0x0078,
+ 0xFF5D, 0x0085, 0xFF5E, 0x00E4, 0xFF64, 0x0071, 0xFFE0, 0x0106,
+ 0xFFE1, 0x0107, 0xFFE2, 0x36E1, 0xFFE3, 0x00C4, 0xFFE4, 0x36E2,
+ 0xFFE5, 0x0104,
+};
+extern const unsigned short g_FXCMAP_UniCNS_UTF16_H_0_DWord[3 * 3] = {
+ 0xD840, 0xDC8A, 0x36B2, 0xD840, 0xDCCC, 0x36B0, 0xD85D, 0xDE07, 0x36B8,
+};
diff --git a/core/src/fpdfapi/fpdf_cmaps/GB1/GB-EUC-H_0.cpp b/core/src/fpdfapi/fpdf_cmaps/GB1/GB-EUC-H_0.cpp
index f216f8a769..d5472f8693 100644
--- a/core/src/fpdfapi/fpdf_cmaps/GB1/GB-EUC-H_0.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/GB1/GB-EUC-H_0.cpp
@@ -1,38 +1,38 @@
-// 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
-
-extern const unsigned short g_FXCMAP_GB_EUC_H_0[90 * 3] = {
- 0x0020, 0x0020, 0x1E24, 0x0021, 0x007E, 0x032E, 0xA1A1, 0xA1FE, 0x0060,
- 0xA2B1, 0xA2E2, 0x00BE, 0xA2E5, 0xA2EE, 0x00F0, 0xA2F1, 0xA2FC, 0x00FA,
- 0xA3A1, 0xA3FE, 0x0106, 0xA4A1, 0xA4F3, 0x0164, 0xA5A1, 0xA5F6, 0x01B7,
- 0xA6A1, 0xA6B8, 0x020D, 0xA6C1, 0xA6F5, 0x0225, 0xA7A1, 0xA7C1, 0x025A,
- 0xA7D1, 0xA7F1, 0x027B, 0xA8A1, 0xA8C0, 0x029C, 0xA8C5, 0xA8EA, 0x02BC,
- 0xA9A4, 0xA9EF, 0x02E2, 0xAAA1, 0xAAFE, 0x032E, 0xABA1, 0xABC0, 0x038C,
- 0xB0A1, 0xB0FE, 0x03AC, 0xB1A1, 0xB1FE, 0x040A, 0xB2A1, 0xB2FE, 0x0468,
- 0xB3A1, 0xB3FE, 0x04C6, 0xB4A1, 0xB4FE, 0x0524, 0xB5A1, 0xB5FE, 0x0582,
- 0xB6A1, 0xB6FE, 0x05E0, 0xB7A1, 0xB7FE, 0x063E, 0xB8A1, 0xB8FE, 0x069C,
- 0xB9A1, 0xB9FE, 0x06FA, 0xBAA1, 0xBAFE, 0x0758, 0xBBA1, 0xBBFE, 0x07B6,
- 0xBCA1, 0xBCFE, 0x0814, 0xBDA1, 0xBDFE, 0x0872, 0xBEA1, 0xBEFE, 0x08D0,
- 0xBFA1, 0xBFFE, 0x092E, 0xC0A1, 0xC0FE, 0x098C, 0xC1A1, 0xC1FE, 0x09EA,
- 0xC2A1, 0xC2FE, 0x0A48, 0xC3A1, 0xC3FE, 0x0AA6, 0xC4A1, 0xC4FE, 0x0B04,
- 0xC5A1, 0xC5FE, 0x0B62, 0xC6A1, 0xC6FE, 0x0BC0, 0xC7A1, 0xC7FE, 0x0C1E,
- 0xC8A1, 0xC8FE, 0x0C7C, 0xC9A1, 0xC9FE, 0x0CDA, 0xCAA1, 0xCAFE, 0x0D38,
- 0xCBA1, 0xCBFE, 0x0D96, 0xCCA1, 0xCCFE, 0x0DF4, 0xCDA1, 0xCDFE, 0x0E52,
- 0xCEA1, 0xCEFE, 0x0EB0, 0xCFA1, 0xCFFE, 0x0F0E, 0xD0A1, 0xD0FE, 0x0F6C,
- 0xD1A1, 0xD1FE, 0x0FCA, 0xD2A1, 0xD2FE, 0x1028, 0xD3A1, 0xD3FE, 0x1086,
- 0xD4A1, 0xD4FE, 0x10E4, 0xD5A1, 0xD5FE, 0x1142, 0xD6A1, 0xD6FE, 0x11A0,
- 0xD7A1, 0xD7F9, 0x11FE, 0xD8A1, 0xD8FE, 0x1257, 0xD9A1, 0xD9FE, 0x12B5,
- 0xDAA1, 0xDAFE, 0x1313, 0xDBA1, 0xDBFE, 0x1371, 0xDCA1, 0xDCFE, 0x13CF,
- 0xDDA1, 0xDDFE, 0x142D, 0xDEA1, 0xDEFE, 0x148B, 0xDFA1, 0xDFFE, 0x14E9,
- 0xE0A1, 0xE0FE, 0x1547, 0xE1A1, 0xE1FE, 0x15A5, 0xE2A1, 0xE2FE, 0x1603,
- 0xE3A1, 0xE3FE, 0x1661, 0xE4A1, 0xE4FE, 0x16BF, 0xE5A1, 0xE5FE, 0x171D,
- 0xE6A1, 0xE6FE, 0x177B, 0xE7A1, 0xE7FE, 0x17D9, 0xE8A1, 0xE8FE, 0x1837,
- 0xE9A1, 0xE9FE, 0x1895, 0xEAA1, 0xEAFE, 0x18F3, 0xEBA1, 0xEBFE, 0x1951,
- 0xECA1, 0xECFE, 0x19AF, 0xEDA1, 0xEDFE, 0x1A0D, 0xEEA1, 0xEEFE, 0x1A6B,
- 0xEFA1, 0xEFFE, 0x1AC9, 0xF0A1, 0xF0FE, 0x1B27, 0xF1A1, 0xF1FE, 0x1B85,
- 0xF2A1, 0xF2FE, 0x1BE3, 0xF3A1, 0xF3FE, 0x1C41, 0xF4A1, 0xF4FE, 0x1C9F,
- 0xF5A1, 0xF5FE, 0x1CFD, 0xF6A1, 0xF6FE, 0x1D5B, 0xF7A1, 0xF7FE, 0x1DB9,
-};
+// 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
+
+extern const unsigned short g_FXCMAP_GB_EUC_H_0[90 * 3] = {
+ 0x0020, 0x0020, 0x1E24, 0x0021, 0x007E, 0x032E, 0xA1A1, 0xA1FE, 0x0060,
+ 0xA2B1, 0xA2E2, 0x00BE, 0xA2E5, 0xA2EE, 0x00F0, 0xA2F1, 0xA2FC, 0x00FA,
+ 0xA3A1, 0xA3FE, 0x0106, 0xA4A1, 0xA4F3, 0x0164, 0xA5A1, 0xA5F6, 0x01B7,
+ 0xA6A1, 0xA6B8, 0x020D, 0xA6C1, 0xA6F5, 0x0225, 0xA7A1, 0xA7C1, 0x025A,
+ 0xA7D1, 0xA7F1, 0x027B, 0xA8A1, 0xA8C0, 0x029C, 0xA8C5, 0xA8EA, 0x02BC,
+ 0xA9A4, 0xA9EF, 0x02E2, 0xAAA1, 0xAAFE, 0x032E, 0xABA1, 0xABC0, 0x038C,
+ 0xB0A1, 0xB0FE, 0x03AC, 0xB1A1, 0xB1FE, 0x040A, 0xB2A1, 0xB2FE, 0x0468,
+ 0xB3A1, 0xB3FE, 0x04C6, 0xB4A1, 0xB4FE, 0x0524, 0xB5A1, 0xB5FE, 0x0582,
+ 0xB6A1, 0xB6FE, 0x05E0, 0xB7A1, 0xB7FE, 0x063E, 0xB8A1, 0xB8FE, 0x069C,
+ 0xB9A1, 0xB9FE, 0x06FA, 0xBAA1, 0xBAFE, 0x0758, 0xBBA1, 0xBBFE, 0x07B6,
+ 0xBCA1, 0xBCFE, 0x0814, 0xBDA1, 0xBDFE, 0x0872, 0xBEA1, 0xBEFE, 0x08D0,
+ 0xBFA1, 0xBFFE, 0x092E, 0xC0A1, 0xC0FE, 0x098C, 0xC1A1, 0xC1FE, 0x09EA,
+ 0xC2A1, 0xC2FE, 0x0A48, 0xC3A1, 0xC3FE, 0x0AA6, 0xC4A1, 0xC4FE, 0x0B04,
+ 0xC5A1, 0xC5FE, 0x0B62, 0xC6A1, 0xC6FE, 0x0BC0, 0xC7A1, 0xC7FE, 0x0C1E,
+ 0xC8A1, 0xC8FE, 0x0C7C, 0xC9A1, 0xC9FE, 0x0CDA, 0xCAA1, 0xCAFE, 0x0D38,
+ 0xCBA1, 0xCBFE, 0x0D96, 0xCCA1, 0xCCFE, 0x0DF4, 0xCDA1, 0xCDFE, 0x0E52,
+ 0xCEA1, 0xCEFE, 0x0EB0, 0xCFA1, 0xCFFE, 0x0F0E, 0xD0A1, 0xD0FE, 0x0F6C,
+ 0xD1A1, 0xD1FE, 0x0FCA, 0xD2A1, 0xD2FE, 0x1028, 0xD3A1, 0xD3FE, 0x1086,
+ 0xD4A1, 0xD4FE, 0x10E4, 0xD5A1, 0xD5FE, 0x1142, 0xD6A1, 0xD6FE, 0x11A0,
+ 0xD7A1, 0xD7F9, 0x11FE, 0xD8A1, 0xD8FE, 0x1257, 0xD9A1, 0xD9FE, 0x12B5,
+ 0xDAA1, 0xDAFE, 0x1313, 0xDBA1, 0xDBFE, 0x1371, 0xDCA1, 0xDCFE, 0x13CF,
+ 0xDDA1, 0xDDFE, 0x142D, 0xDEA1, 0xDEFE, 0x148B, 0xDFA1, 0xDFFE, 0x14E9,
+ 0xE0A1, 0xE0FE, 0x1547, 0xE1A1, 0xE1FE, 0x15A5, 0xE2A1, 0xE2FE, 0x1603,
+ 0xE3A1, 0xE3FE, 0x1661, 0xE4A1, 0xE4FE, 0x16BF, 0xE5A1, 0xE5FE, 0x171D,
+ 0xE6A1, 0xE6FE, 0x177B, 0xE7A1, 0xE7FE, 0x17D9, 0xE8A1, 0xE8FE, 0x1837,
+ 0xE9A1, 0xE9FE, 0x1895, 0xEAA1, 0xEAFE, 0x18F3, 0xEBA1, 0xEBFE, 0x1951,
+ 0xECA1, 0xECFE, 0x19AF, 0xEDA1, 0xEDFE, 0x1A0D, 0xEEA1, 0xEEFE, 0x1A6B,
+ 0xEFA1, 0xEFFE, 0x1AC9, 0xF0A1, 0xF0FE, 0x1B27, 0xF1A1, 0xF1FE, 0x1B85,
+ 0xF2A1, 0xF2FE, 0x1BE3, 0xF3A1, 0xF3FE, 0x1C41, 0xF4A1, 0xF4FE, 0x1C9F,
+ 0xF5A1, 0xF5FE, 0x1CFD, 0xF6A1, 0xF6FE, 0x1D5B, 0xF7A1, 0xF7FE, 0x1DB9,
+};
diff --git a/core/src/fpdfapi/fpdf_cmaps/GB1/GB-EUC-V_0.cpp b/core/src/fpdfapi/fpdf_cmaps/GB1/GB-EUC-V_0.cpp
index d71cd351fb..bf2bd459ec 100644
--- a/core/src/fpdfapi/fpdf_cmaps/GB1/GB-EUC-V_0.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/GB1/GB-EUC-V_0.cpp
@@ -1,15 +1,15 @@
-// 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
-
-extern const unsigned short g_FXCMAP_GB_EUC_V_0[20 * 3] = {
- 0xA1A2, 0xA1A2, 0x023F, 0xA1A3, 0xA1A3, 0x023E, 0xA1AA, 0xA1AA, 0x0256,
- 0xA1AB, 0xA1AC, 0x1E18, 0xA1AD, 0xA1AD, 0x0257, 0xA1B2, 0xA1BF, 0x0246,
- 0xA1FE, 0xA1FE, 0x1E1A, 0xA3A1, 0xA3A1, 0x0242, 0xA3A8, 0xA3A9, 0x0244,
- 0xA3AC, 0xA3AC, 0x023D, 0xA3AE, 0xA3AE, 0x1E1B, 0xA3BA, 0xA3BB, 0x0240,
- 0xA3BD, 0xA3BD, 0x1E1C, 0xA3BF, 0xA3BF, 0x0243, 0xA3DB, 0xA3DB, 0x1E1D,
- 0xA3DD, 0xA3DD, 0x1E1E, 0xA3DF, 0xA3DF, 0x0258, 0xA3FB, 0xA3FB, 0x0254,
- 0xA3FD, 0xA3FD, 0x0255, 0xA3FE, 0xA3FE, 0x1E1F,
-};
+// 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
+
+extern const unsigned short g_FXCMAP_GB_EUC_V_0[20 * 3] = {
+ 0xA1A2, 0xA1A2, 0x023F, 0xA1A3, 0xA1A3, 0x023E, 0xA1AA, 0xA1AA, 0x0256,
+ 0xA1AB, 0xA1AC, 0x1E18, 0xA1AD, 0xA1AD, 0x0257, 0xA1B2, 0xA1BF, 0x0246,
+ 0xA1FE, 0xA1FE, 0x1E1A, 0xA3A1, 0xA3A1, 0x0242, 0xA3A8, 0xA3A9, 0x0244,
+ 0xA3AC, 0xA3AC, 0x023D, 0xA3AE, 0xA3AE, 0x1E1B, 0xA3BA, 0xA3BB, 0x0240,
+ 0xA3BD, 0xA3BD, 0x1E1C, 0xA3BF, 0xA3BF, 0x0243, 0xA3DB, 0xA3DB, 0x1E1D,
+ 0xA3DD, 0xA3DD, 0x1E1E, 0xA3DF, 0xA3DF, 0x0258, 0xA3FB, 0xA3FB, 0x0254,
+ 0xA3FD, 0xA3FD, 0x0255, 0xA3FE, 0xA3FE, 0x1E1F,
+};
diff --git a/core/src/fpdfapi/fpdf_cmaps/GB1/GBK-EUC-H_2.cpp b/core/src/fpdfapi/fpdf_cmaps/GB1/GBK-EUC-H_2.cpp
index c7c486b9a4..3f3874f3a3 100644
--- a/core/src/fpdfapi/fpdf_cmaps/GB1/GBK-EUC-H_2.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/GB1/GBK-EUC-H_2.cpp
@@ -1,1365 +1,1365 @@
-// 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
-
-extern const unsigned short g_FXCMAP_GBK_EUC_H_2[4071 * 3] = {
- 0x0020, 0x0020, 0x1E24, 0x0021, 0x007E, 0x032E, 0x8140, 0x8178, 0x2758,
- 0x8179, 0x8179, 0x2059, 0x817A, 0x817E, 0x2791, 0x8180, 0x8185, 0x2796,
- 0x8186, 0x8186, 0x21F1, 0x8187, 0x81EC, 0x279C, 0x81ED, 0x81ED, 0x1FF2,
- 0x81EE, 0x81F5, 0x2802, 0x81F6, 0x81F6, 0x205D, 0x81F7, 0x81FE, 0x280A,
- 0x8240, 0x8252, 0x2812, 0x8253, 0x8253, 0x269C, 0x8254, 0x8261, 0x2825,
- 0x8262, 0x8262, 0x21B5, 0x8263, 0x8273, 0x2833, 0x8274, 0x8274, 0x22CC,
- 0x8275, 0x8279, 0x2844, 0x827A, 0x827A, 0x2016, 0x827B, 0x827C, 0x2849,
- 0x827D, 0x827D, 0x1E62, 0x827E, 0x827E, 0x284B, 0x8280, 0x8280, 0x1F20,
- 0x8281, 0x8282, 0x284C, 0x8283, 0x8283, 0x207F, 0x8284, 0x828F, 0x284E,
- 0x8290, 0x8290, 0x205C, 0x8291, 0x82A4, 0x285A, 0x82A5, 0x82A5, 0x2194,
- 0x82A6, 0x82C7, 0x286E, 0x82C8, 0x82C8, 0x1E65, 0x82C9, 0x82C9, 0x2281,
- 0x82CA, 0x82E0, 0x2890, 0x82E1, 0x82E1, 0x22CD, 0x82E2, 0x82E2, 0x28A7,
- 0x82E3, 0x82E3, 0x210A, 0x82E4, 0x82E4, 0x1E3E, 0x82E5, 0x82EC, 0x28A8,
- 0x82ED, 0x82ED, 0x267F, 0x82EE, 0x82F1, 0x28B0, 0x82F2, 0x82F2, 0x222E,
- 0x82F3, 0x82F6, 0x28B4, 0x82F7, 0x82F7, 0x1E96, 0x82F8, 0x82F8, 0x22CB,
- 0x82F9, 0x82F9, 0x226C, 0x82FA, 0x82FA, 0x28B8, 0x82FB, 0x82FB, 0x2117,
- 0x82FC, 0x82FE, 0x28B9, 0x8340, 0x8340, 0x28BC, 0x8341, 0x8341, 0x20E8,
- 0x8342, 0x8344, 0x28BD, 0x8345, 0x8345, 0x22D4, 0x8346, 0x8347, 0x28C0,
- 0x8348, 0x8348, 0x1FB9, 0x8349, 0x834B, 0x28C2, 0x834C, 0x834C, 0x22D8,
- 0x834D, 0x8352, 0x28C5, 0x8353, 0x8353, 0x20DF, 0x8354, 0x8356, 0x28CB,
- 0x8357, 0x8357, 0x20C2, 0x8358, 0x835D, 0x28CE, 0x835E, 0x835E, 0x2195,
- 0x835F, 0x8364, 0x28D4, 0x8365, 0x8365, 0x1FAC, 0x8366, 0x8366, 0x22D3,
- 0x8367, 0x8371, 0x28DA, 0x8372, 0x8372, 0x1F81, 0x8373, 0x8377, 0x28E5,
- 0x8378, 0x8378, 0x2210, 0x8379, 0x8379, 0x28EA, 0x837A, 0x837A, 0x22CF,
- 0x837B, 0x837B, 0x28EB, 0x837C, 0x837C, 0x2213, 0x837D, 0x837D, 0x28EC,
- 0x837E, 0x837E, 0x1FE4, 0x8380, 0x8380, 0x1F90, 0x8381, 0x8385, 0x28ED,
- 0x8386, 0x8386, 0x22D6, 0x8387, 0x8388, 0x28F2, 0x8389, 0x8389, 0x22D0,
- 0x838A, 0x838A, 0x22CE, 0x838B, 0x838C, 0x28F4, 0x838D, 0x838D, 0x2681,
- 0x838E, 0x8393, 0x28F6, 0x8394, 0x8394, 0x1E76, 0x8395, 0x839D, 0x28FC,
- 0x839E, 0x839E, 0x2231, 0x839F, 0x83A5, 0x2905, 0x83A6, 0x83A6, 0x1E93,
- 0x83A7, 0x83AA, 0x290C, 0x83AB, 0x83AB, 0x22D2, 0x83AC, 0x83AD, 0x2910,
- 0x83AE, 0x83AE, 0x22D7, 0x83AF, 0x83AF, 0x22D5, 0x83B0, 0x83B0, 0x22D1,
- 0x83B1, 0x83B9, 0x2912, 0x83BA, 0x83BA, 0x1EE5, 0x83BB, 0x83C8, 0x291B,
- 0x83C9, 0x83C9, 0x2025, 0x83CA, 0x83F5, 0x2929, 0x83F6, 0x83F6, 0x1ECF,
- 0x83F7, 0x83FE, 0x2955, 0x8440, 0x844F, 0x295D, 0x8450, 0x8450, 0x1FD9,
- 0x8451, 0x8470, 0x296D, 0x8471, 0x8471, 0x22C8, 0x8472, 0x8473, 0x298D,
- 0x8474, 0x8474, 0x2263, 0x8475, 0x8476, 0x298F, 0x8477, 0x8477, 0x2683,
- 0x8478, 0x847E, 0x2991, 0x8480, 0x8481, 0x2998, 0x8482, 0x8482, 0x1F17,
- 0x8483, 0x848D, 0x299A, 0x848E, 0x848E, 0x1F2B, 0x848F, 0x8491, 0x29A5,
- 0x8492, 0x8492, 0x22CA, 0x8493, 0x8493, 0x1E99, 0x8494, 0x849C, 0x29A8,
- 0x849D, 0x849D, 0x1F4F, 0x849E, 0x84A0, 0x29B1, 0x84A1, 0x84A1, 0x1FCF,
- 0x84A2, 0x84A2, 0x2036, 0x84A3, 0x84A3, 0x1F3A, 0x84A4, 0x84A4, 0x29B4,
- 0x84A5, 0x84A5, 0x22C9, 0x84A6, 0x84A6, 0x1F99, 0x84A7, 0x84A8, 0x29B5,
- 0x84A9, 0x84A9, 0x1F75, 0x84AA, 0x84C4, 0x29B7, 0x84C5, 0x84C5, 0x1FBE,
- 0x84C6, 0x84D2, 0x29D2, 0x84D3, 0x84D3, 0x1ECD, 0x84D4, 0x84D4, 0x29DF,
- 0x84D5, 0x84D5, 0x21A9, 0x84D6, 0x84D6, 0x29E0, 0x84D7, 0x84D7, 0x21E6,
- 0x84D8, 0x84D8, 0x29E1, 0x84D9, 0x84D9, 0x2127, 0x84DA, 0x84DA, 0x2003,
- 0x84DB, 0x84DC, 0x29E2, 0x84DD, 0x84DD, 0x2132, 0x84DE, 0x84E9, 0x29E4,
- 0x84EA, 0x84EA, 0x2323, 0x84EB, 0x84ED, 0x29F0, 0x84EE, 0x84EE, 0x2011,
- 0x84EF, 0x84F0, 0x29F3, 0x84F1, 0x84F1, 0x20F5, 0x84F2, 0x84FE, 0x29F5,
- 0x8540, 0x8550, 0x2A02, 0x8551, 0x8551, 0x22C5, 0x8552, 0x8552, 0x1F5E,
- 0x8553, 0x8553, 0x2A13, 0x8554, 0x8554, 0x22C6, 0x8555, 0x855D, 0x2A14,
- 0x855E, 0x855E, 0x20EF, 0x855F, 0x8565, 0x2A1D, 0x8566, 0x8566, 0x21D0,
- 0x8567, 0x857E, 0x2A24, 0x8580, 0x8586, 0x2A3C, 0x8587, 0x8587, 0x22C1,
- 0x8588, 0x858A, 0x2A43, 0x858B, 0x858B, 0x1E64, 0x858C, 0x8591, 0x2A46,
- 0x8592, 0x8592, 0x21F9, 0x8593, 0x8595, 0x2A4C, 0x8596, 0x8596, 0x2010,
- 0x8597, 0x8597, 0x2A4F, 0x8598, 0x8598, 0x22C2, 0x8599, 0x85A1, 0x2A50,
- 0x85A2, 0x85A2, 0x1E5A, 0x85A3, 0x85B1, 0x2A59, 0x85B2, 0x85B2, 0x1EA2,
- 0x85B3, 0x85FE, 0x2A68, 0x8640, 0x8649, 0x2AB4, 0x864A, 0x864A, 0x236D,
- 0x864B, 0x8653, 0x2ABE, 0x8654, 0x8654, 0x2247, 0x8655, 0x8667, 0x2AC7,
- 0x8668, 0x8668, 0x236C, 0x8669, 0x867E, 0x2ADA, 0x8680, 0x8695, 0x2AF0,
- 0x8696, 0x8696, 0x219C, 0x8697, 0x8698, 0x2B06, 0x8699, 0x8699, 0x20C9,
- 0x869A, 0x86A0, 0x2B08, 0x86A1, 0x86A1, 0x21F0, 0x86A2, 0x86C9, 0x2B0F,
- 0x86CA, 0x86CA, 0x210B, 0x86CB, 0x86CB, 0x2B37, 0x86CC, 0x86CC, 0x20DE,
- 0x86CD, 0x86CD, 0x2B38, 0x86CE, 0x86CE, 0x1EAA, 0x86CF, 0x86D0, 0x2B39,
- 0x86D1, 0x86D1, 0x222C, 0x86D2, 0x86DB, 0x2B3B, 0x86DC, 0x86DC, 0x20D8,
- 0x86DD, 0x86DD, 0x22C0, 0x86DE, 0x86E0, 0x2B45, 0x86E1, 0x86E1, 0x206F,
- 0x86E2, 0x86E7, 0x2B48, 0x86E8, 0x86E8, 0x21A1, 0x86E9, 0x86ED, 0x2B4E,
- 0x86EE, 0x86EE, 0x2379, 0x86EF, 0x86F3, 0x2B53, 0x86F4, 0x86F4, 0x2372,
- 0x86F5, 0x86FE, 0x2B58, 0x8740, 0x8740, 0x216A, 0x8741, 0x8743, 0x2B62,
- 0x8744, 0x8744, 0x237C, 0x8745, 0x8748, 0x2B65, 0x8749, 0x8749, 0x20B0,
- 0x874A, 0x874A, 0x2B69, 0x874B, 0x874B, 0x237A, 0x874C, 0x874C, 0x1E74,
- 0x874D, 0x874E, 0x2B6A, 0x874F, 0x874F, 0x2377, 0x8750, 0x8756, 0x2B6C,
- 0x8757, 0x8757, 0x1F4C, 0x8758, 0x8759, 0x2B73, 0x875A, 0x875A, 0x2378,
- 0x875B, 0x875B, 0x21CF, 0x875C, 0x875C, 0x2368, 0x875D, 0x875D, 0x2B75,
- 0x875E, 0x875E, 0x2371, 0x875F, 0x875F, 0x2B76, 0x8760, 0x8760, 0x2369,
- 0x8761, 0x8765, 0x2B77, 0x8766, 0x8766, 0x2674, 0x8767, 0x8779, 0x2B7C,
- 0x877A, 0x877A, 0x236F, 0x877B, 0x877C, 0x2B8F, 0x877D, 0x877D, 0x2370,
- 0x877E, 0x877E, 0x2B91, 0x8780, 0x8780, 0x2B92, 0x8781, 0x8781, 0x2376,
- 0x8782, 0x8782, 0x2373, 0x8783, 0x8785, 0x2B93, 0x8786, 0x8786, 0x237F,
- 0x8787, 0x8787, 0x2B96, 0x8788, 0x8788, 0x2374, 0x8789, 0x8789, 0x2B97,
- 0x878A, 0x878A, 0x20B5, 0x878B, 0x878C, 0x2B98, 0x878D, 0x878D, 0x1EDB,
- 0x878E, 0x878E, 0x2672, 0x878F, 0x8792, 0x2B9A, 0x8793, 0x8793, 0x236E,
- 0x8794, 0x8797, 0x2B9E, 0x8798, 0x8798, 0x21B7, 0x8799, 0x879C, 0x2BA2,
- 0x879D, 0x879D, 0x2375, 0x879E, 0x87A2, 0x2BA6, 0x87A3, 0x87A3, 0x2382,
- 0x87A4, 0x87A6, 0x2BAB, 0x87A7, 0x87A7, 0x209E, 0x87A8, 0x87B2, 0x2BAE,
- 0x87B3, 0x87B3, 0x236B, 0x87B4, 0x87B4, 0x2BB9, 0x87B5, 0x87B5, 0x2039,
- 0x87B6, 0x87BA, 0x2BBA, 0x87BB, 0x87BB, 0x269F, 0x87BC, 0x87BE, 0x2BBF,
- 0x87BF, 0x87BF, 0x237D, 0x87C0, 0x87C0, 0x21F5, 0x87C1, 0x87C1, 0x2BC2,
- 0x87C2, 0x87C2, 0x2381, 0x87C3, 0x87C9, 0x2BC3, 0x87CA, 0x87CA, 0x237B,
- 0x87CB, 0x87CB, 0x237E, 0x87CC, 0x87CC, 0x21CC, 0x87CD, 0x87CE, 0x2BCA,
- 0x87CF, 0x87CF, 0x22DB, 0x87D0, 0x87D1, 0x2BCC, 0x87D2, 0x87D2, 0x236A,
- 0x87D3, 0x87D3, 0x2689, 0x87D4, 0x87D4, 0x2BCE, 0x87D5, 0x87D5, 0x2697,
- 0x87D6, 0x87D9, 0x2BCF, 0x87DA, 0x87DA, 0x22A1, 0x87DB, 0x87F6, 0x2BD3,
- 0x87F7, 0x87F7, 0x2383, 0x87F8, 0x87F8, 0x1F3D, 0x87F9, 0x87F9, 0x2BEF,
- 0x87FA, 0x87FA, 0x218F, 0x87FB, 0x87FE, 0x2BF0, 0x8840, 0x8840, 0x2246,
- 0x8841, 0x8841, 0x2248, 0x8842, 0x8843, 0x2BF4, 0x8844, 0x8844, 0x217E,
- 0x8845, 0x8845, 0x2BF6, 0x8846, 0x8846, 0x2180, 0x8847, 0x887E, 0x2BF7,
- 0x8880, 0x88B9, 0x2C2F, 0x88BA, 0x88BA, 0x232A, 0x88BB, 0x88CB, 0x2C69,
- 0x88CC, 0x88CC, 0x228B, 0x88CD, 0x88D3, 0x2C7A, 0x88D4, 0x88D4, 0x1F85,
- 0x88D5, 0x88D6, 0x2C81, 0x88D7, 0x88D7, 0x2325, 0x88D8, 0x88DE, 0x2C83,
- 0x88DF, 0x88DF, 0x232C, 0x88E0, 0x88E4, 0x2C8A, 0x88E5, 0x88E5, 0x232E,
- 0x88E6, 0x88F1, 0x2C8F, 0x88F2, 0x88F2, 0x2205, 0x88F3, 0x88F3, 0x1E38,
- 0x88F4, 0x88F5, 0x2C9B, 0x88F6, 0x88F6, 0x1E73, 0x88F7, 0x88FE, 0x2C9D,
- 0x8940, 0x894A, 0x2CA5, 0x894B, 0x894B, 0x1FE3, 0x894C, 0x894C, 0x2339,
- 0x894D, 0x894D, 0x2CB0, 0x894E, 0x894E, 0x232B, 0x894F, 0x894F, 0x2CB1,
- 0x8950, 0x8950, 0x232D, 0x8951, 0x8953, 0x2CB2, 0x8954, 0x8954, 0x217F,
- 0x8955, 0x895C, 0x2CB5, 0x895D, 0x895D, 0x21A7, 0x895E, 0x895E, 0x2CBD,
- 0x895F, 0x895F, 0x232F, 0x8960, 0x896C, 0x2CBE, 0x896D, 0x896D, 0x1E7D,
- 0x896E, 0x8970, 0x2CCB, 0x8971, 0x8971, 0x20D6, 0x8972, 0x897B, 0x2CCE,
- 0x897C, 0x897C, 0x1EC2, 0x897D, 0x897E, 0x2CD8, 0x8980, 0x898A, 0x2CDA,
- 0x898B, 0x898B, 0x22B2, 0x898C, 0x8998, 0x2CE5, 0x8999, 0x8999, 0x1EDF,
- 0x899A, 0x899D, 0x2CF2, 0x899E, 0x899E, 0x1EF9, 0x899F, 0x89A5, 0x2CF6,
- 0x89A6, 0x89A6, 0x20D9, 0x89A7, 0x89A7, 0x2CFD, 0x89A8, 0x89A8, 0x1FDD,
- 0x89A9, 0x89AE, 0x2CFE, 0x89AF, 0x89AF, 0x2167, 0x89B0, 0x89B9, 0x2D04,
- 0x89BA, 0x89BA, 0x21ED, 0x89BB, 0x89BD, 0x2D0E, 0x89BE, 0x89BE, 0x2007,
- 0x89BF, 0x89BF, 0x2326, 0x89C0, 0x89C0, 0x2329, 0x89C1, 0x89C3, 0x2D11,
- 0x89C4, 0x89C4, 0x1F52, 0x89C5, 0x89C5, 0x203B, 0x89C6, 0x89C6, 0x2328,
- 0x89C7, 0x89C7, 0x2D14, 0x89C8, 0x89C8, 0x2327, 0x89C9, 0x89CD, 0x2D15,
- 0x89CE, 0x89CE, 0x1E2B, 0x89CF, 0x89D0, 0x2D1A, 0x89D1, 0x89D1, 0x22AE,
- 0x89D2, 0x89D7, 0x2D1C, 0x89D8, 0x89D8, 0x1F49, 0x89D9, 0x89DA, 0x2D22,
- 0x89DB, 0x89DB, 0x2138, 0x89DC, 0x89F3, 0x2D24, 0x89F4, 0x89F4, 0x2081,
- 0x89F5, 0x89FE, 0x2D3C, 0x8A40, 0x8A40, 0x2D46, 0x8A41, 0x8A41, 0x1F7C,
- 0x8A42, 0x8A58, 0x2D47, 0x8A59, 0x8A59, 0x235B, 0x8A5A, 0x8A5A, 0x1EDE,
- 0x8A5B, 0x8A5B, 0x2D5E, 0x8A5C, 0x8A5C, 0x1FA2, 0x8A5D, 0x8A5D, 0x2D5F,
- 0x8A5E, 0x8A5E, 0x1EFA, 0x8A5F, 0x8A78, 0x2D60, 0x8A79, 0x8A79, 0x22AD,
- 0x8A7A, 0x8A7E, 0x2D7A, 0x8A80, 0x8AE3, 0x2D7F, 0x8AE4, 0x8AE4, 0x203F,
- 0x8AE5, 0x8AFE, 0x2DE3, 0x8B40, 0x8B43, 0x2DFD, 0x8B44, 0x8B44, 0x1F0E,
- 0x8B45, 0x8B48, 0x2E01, 0x8B49, 0x8B49, 0x23F9, 0x8B4A, 0x8B79, 0x2E05,
- 0x8B7A, 0x8B7A, 0x23FC, 0x8B7B, 0x8B7E, 0x2E35, 0x8B80, 0x8B8B, 0x2E39,
- 0x8B8C, 0x8B8C, 0x2069, 0x8B8D, 0x8B9D, 0x2E45, 0x8B9E, 0x8B9E, 0x23F7,
- 0x8B9F, 0x8BB2, 0x2E56, 0x8BB3, 0x8BB3, 0x23F6, 0x8BB4, 0x8BB8, 0x2E6A,
- 0x8BB9, 0x8BB9, 0x23FD, 0x8BBA, 0x8BBD, 0x2E6F, 0x8BBE, 0x8BBE, 0x23F8,
- 0x8BBF, 0x8BC5, 0x2E73, 0x8BC6, 0x8BC6, 0x23FA, 0x8BC7, 0x8BC7, 0x2E7A,
- 0x8BC8, 0x8BC8, 0x23FE, 0x8BC9, 0x8BC9, 0x1FA8, 0x8BCA, 0x8BD3, 0x2E7B,
- 0x8BD4, 0x8BD4, 0x2401, 0x8BD5, 0x8BDB, 0x2E85, 0x8BDC, 0x8BDC, 0x23FF,
- 0x8BDD, 0x8BE4, 0x2E8C, 0x8BE5, 0x8BE5, 0x2400, 0x8BE6, 0x8BEA, 0x2E94,
- 0x8BEB, 0x8BEB, 0x2221, 0x8BEC, 0x8BEF, 0x2E99, 0x8BF0, 0x8BF0, 0x2122,
- 0x8BF1, 0x8BFE, 0x2E9D, 0x8C40, 0x8C43, 0x2EAB, 0x8C44, 0x8C44, 0x23FB,
- 0x8C45, 0x8C4E, 0x2EAF, 0x8C4F, 0x8C4F, 0x215A, 0x8C50, 0x8C56, 0x2EB9,
- 0x8C57, 0x8C57, 0x21E5, 0x8C58, 0x8C5B, 0x2EC0, 0x8C5C, 0x8C5C, 0x2057,
- 0x8C5D, 0x8C7E, 0x2EC4, 0x8C80, 0x8C8A, 0x2EE6, 0x8C8B, 0x8C8B, 0x20E5,
- 0x8C8C, 0x8C8C, 0x2EF1, 0x8C8D, 0x8C8D, 0x212F, 0x8C8E, 0x8C8E, 0x20A3,
- 0x8C8F, 0x8C8F, 0x2121, 0x8C90, 0x8C90, 0x2EF2, 0x8C91, 0x8C91, 0x21D4,
- 0x8C92, 0x8C92, 0x1FE5, 0x8C93, 0x8C98, 0x2EF3, 0x8C99, 0x8C99, 0x1E8A,
- 0x8C9A, 0x8C9A, 0x1E37, 0x8C9B, 0x8CA1, 0x2EF9, 0x8CA2, 0x8CA2, 0x1F9E,
- 0x8CA3, 0x8CA3, 0x22A6, 0x8CA4, 0x8CA4, 0x21E8, 0x8CA5, 0x8CA5, 0x2F00,
- 0x8CA6, 0x8CA6, 0x1EDA, 0x8CA7, 0x8CA7, 0x1EB9, 0x8CA8, 0x8CBF, 0x2F01,
- 0x8CC0, 0x8CC0, 0x235C, 0x8CC1, 0x8CD1, 0x2F19, 0x8CD2, 0x8CD2, 0x2050,
- 0x8CD3, 0x8CD3, 0x1E67, 0x8CD4, 0x8CD4, 0x2F2A, 0x8CD5, 0x8CD5, 0x23F4,
- 0x8CD6, 0x8CD8, 0x2F2B, 0x8CD9, 0x8CD9, 0x213E, 0x8CDA, 0x8CF8, 0x2F2E,
- 0x8CF9, 0x8CF9, 0x1F16, 0x8CFA, 0x8CFE, 0x2F4D, 0x8D40, 0x8D72, 0x2F52,
- 0x8D73, 0x8D73, 0x2389, 0x8D74, 0x8D74, 0x2F85, 0x8D75, 0x8D75, 0x1EB7,
- 0x8D76, 0x8D7A, 0x2F86, 0x8D7B, 0x8D7B, 0x21B4, 0x8D7C, 0x8D7E, 0x2F8B,
- 0x8D80, 0x8D87, 0x2F8E, 0x8D88, 0x8D88, 0x238F, 0x8D89, 0x8D8E, 0x2F96,
- 0x8D8F, 0x8D8F, 0x1F1A, 0x8D90, 0x8D9D, 0x2F9C, 0x8D9E, 0x8D9E, 0x238B,
- 0x8D9F, 0x8DB8, 0x2FAA, 0x8DB9, 0x8DB9, 0x238A, 0x8DBA, 0x8DE1, 0x2FC4,
- 0x8DE2, 0x8DE2, 0x2391, 0x8DE3, 0x8DE3, 0x2FEC, 0x8DE4, 0x8DE4, 0x2271,
- 0x8DE5, 0x8DE6, 0x2FED, 0x8DE7, 0x8DE7, 0x2388, 0x8DE8, 0x8DF6, 0x2FEF,
- 0x8DF7, 0x8DF7, 0x238E, 0x8DF8, 0x8DFD, 0x2FFE, 0x8DFE, 0x8DFE, 0x238D,
- 0x8E40, 0x8E45, 0x3004, 0x8E46, 0x8E46, 0x238C, 0x8E47, 0x8E55, 0x300A,
- 0x8E56, 0x8E56, 0x2390, 0x8E57, 0x8E57, 0x3019, 0x8E58, 0x8E58, 0x2033,
- 0x8E59, 0x8E59, 0x301A, 0x8E5A, 0x8E5A, 0x223C, 0x8E5B, 0x8E67, 0x301B,
- 0x8E68, 0x8E68, 0x1FE9, 0x8E69, 0x8E6D, 0x3028, 0x8E6E, 0x8E6E, 0x2055,
- 0x8E6F, 0x8E6F, 0x302D, 0x8E70, 0x8E70, 0x2392, 0x8E71, 0x8E7E, 0x302E,
- 0x8E80, 0x8E80, 0x2324, 0x8E81, 0x8E9A, 0x303C, 0x8E9B, 0x8E9B, 0x2143,
- 0x8E9C, 0x8E9E, 0x3056, 0x8E9F, 0x8E9F, 0x2129, 0x8EA0, 0x8EA3, 0x3059,
- 0x8EA4, 0x8EA4, 0x2277, 0x8EA5, 0x8EA6, 0x305D, 0x8EA7, 0x8EA7, 0x1EA7,
- 0x8EA8, 0x8EAB, 0x305F, 0x8EAC, 0x8EAC, 0x2285, 0x8EAD, 0x8EAD, 0x3063,
- 0x8EAE, 0x8EAE, 0x2384, 0x8EAF, 0x8EBC, 0x3064, 0x8EBD, 0x8EBD, 0x2387,
- 0x8EBE, 0x8EBE, 0x2386, 0x8EBF, 0x8EC2, 0x3072, 0x8EC3, 0x8EC3, 0x2290,
- 0x8EC4, 0x8EC4, 0x3076, 0x8EC5, 0x8EC5, 0x1E44, 0x8EC6, 0x8ECC, 0x3077,
- 0x8ECD, 0x8ECD, 0x1E32, 0x8ECE, 0x8ECE, 0x2385, 0x8ECF, 0x8ED5, 0x307E,
- 0x8ED6, 0x8ED6, 0x1F13, 0x8ED7, 0x8ED7, 0x1F73, 0x8ED8, 0x8EEB, 0x3085,
- 0x8EEC, 0x8EEC, 0x1FE0, 0x8EED, 0x8EFE, 0x3099, 0x8F40, 0x8F51, 0x30AB,
- 0x8F52, 0x8F52, 0x2087, 0x8F53, 0x8F53, 0x1E78, 0x8F54, 0x8F54, 0x23AE,
- 0x8F55, 0x8F55, 0x1EF6, 0x8F56, 0x8F56, 0x1F31, 0x8F57, 0x8F5C, 0x30BD,
- 0x8F5D, 0x8F5D, 0x2045, 0x8F5E, 0x8F63, 0x30C3, 0x8F64, 0x8F64, 0x2178,
- 0x8F65, 0x8F7E, 0x30C9, 0x8F80, 0x8F85, 0x30E3, 0x8F86, 0x8F86, 0x23F5,
- 0x8F87, 0x8F87, 0x30E9, 0x8F88, 0x8F88, 0x2275, 0x8F89, 0x8F94, 0x30EA,
- 0x8F95, 0x8F95, 0x266E, 0x8F96, 0x8F96, 0x30F6, 0x8F97, 0x8F97, 0x1EB0,
- 0x8F98, 0x8F9A, 0x30F7, 0x8F9B, 0x8F9B, 0x2083, 0x8F9C, 0x8F9C, 0x30FA,
- 0x8F9D, 0x8F9D, 0x2188, 0x8F9E, 0x8FA0, 0x30FB, 0x8FA1, 0x8FA1, 0x267C,
- 0x8FA2, 0x8FBC, 0x30FE, 0x8FBD, 0x8FBD, 0x1FC5, 0x8FBE, 0x8FC3, 0x3119,
- 0x8FC4, 0x8FC4, 0x1EA1, 0x8FC5, 0x8FC5, 0x311F, 0x8FC6, 0x8FC6, 0x2393,
- 0x8FC7, 0x8FCC, 0x3120, 0x8FCD, 0x8FCD, 0x1F0B, 0x8FCE, 0x8FD7, 0x3126,
- 0x8FD8, 0x8FD8, 0x1E7C, 0x8FD9, 0x8FFE, 0x3130, 0x9040, 0x907E, 0x3156,
- 0x9080, 0x909C, 0x3195, 0x909D, 0x909D, 0x23B4, 0x909E, 0x909E, 0x207E,
- 0x909F, 0x90B9, 0x31B2, 0x90BA, 0x90BA, 0x1EE3, 0x90BB, 0x90BF, 0x31CD,
- 0x90C0, 0x90C0, 0x2095, 0x90C1, 0x90C1, 0x23BB, 0x90C2, 0x90C4, 0x31D2,
- 0x90C5, 0x90C5, 0x23B9, 0x90C6, 0x90DA, 0x31D5, 0x90DB, 0x90DB, 0x1E28,
- 0x90DC, 0x90DC, 0x23BD, 0x90DD, 0x90EC, 0x31EA, 0x90ED, 0x90ED, 0x23B5,
- 0x90EE, 0x90EF, 0x31FA, 0x90F0, 0x90F0, 0x23BA, 0x90F1, 0x90F6, 0x31FC,
- 0x90F7, 0x90F7, 0x23B3, 0x90F8, 0x90FE, 0x3202, 0x9140, 0x9141, 0x3209,
- 0x9142, 0x9142, 0x2162, 0x9143, 0x914A, 0x320B, 0x914B, 0x914B, 0x1E5E,
- 0x914C, 0x914C, 0x3213, 0x914D, 0x914D, 0x1E5D, 0x914E, 0x9150, 0x3214,
- 0x9151, 0x9151, 0x23B7, 0x9152, 0x9153, 0x3217, 0x9154, 0x9154, 0x1F2F,
- 0x9155, 0x9155, 0x24DF, 0x9156, 0x9158, 0x3219, 0x9159, 0x9159, 0x23B2,
- 0x915A, 0x915A, 0x214E, 0x915B, 0x915C, 0x321C, 0x915D, 0x915D, 0x2052,
- 0x915E, 0x9160, 0x321E, 0x9161, 0x9161, 0x23BC, 0x9162, 0x9162, 0x3221,
- 0x9163, 0x9163, 0x20EB, 0x9164, 0x916D, 0x3222, 0x916E, 0x916E, 0x2232,
- 0x916F, 0x9175, 0x322C, 0x9176, 0x9176, 0x1E3F, 0x9177, 0x9179, 0x3233,
- 0x917A, 0x917A, 0x201B, 0x917B, 0x917B, 0x20BC, 0x917C, 0x917C, 0x23BE,
- 0x917D, 0x917E, 0x3236, 0x9180, 0x9183, 0x3238, 0x9184, 0x9184, 0x1EAE,
- 0x9185, 0x918C, 0x323C, 0x918D, 0x918D, 0x1EFB, 0x918E, 0x9190, 0x3244,
- 0x9191, 0x9191, 0x2089, 0x9192, 0x9192, 0x3247, 0x9193, 0x9193, 0x23B1,
- 0x9194, 0x9196, 0x3248, 0x9197, 0x9197, 0x21C4, 0x9198, 0x919A, 0x324B,
- 0x919B, 0x919B, 0x2214, 0x919C, 0x91A8, 0x324E, 0x91A9, 0x91A9, 0x1FDE,
- 0x91AA, 0x91AA, 0x2223, 0x91AB, 0x91AB, 0x23B6, 0x91AC, 0x91B9, 0x325B,
- 0x91BA, 0x91BA, 0x268C, 0x91BB, 0x91BB, 0x24DE, 0x91BC, 0x91BE, 0x3269,
- 0x91BF, 0x91BF, 0x24E0, 0x91C0, 0x91C2, 0x326C, 0x91C3, 0x91C3, 0x23B8,
- 0x91C4, 0x91CC, 0x326F, 0x91CD, 0x91CD, 0x1E81, 0x91CE, 0x91CF, 0x3278,
- 0x91D0, 0x91D0, 0x1FFE, 0x91D1, 0x91D1, 0x1F51, 0x91D2, 0x91D2, 0x21E1,
- 0x91D3, 0x91D3, 0x327A, 0x91D4, 0x91D4, 0x23B0, 0x91D5, 0x91D5, 0x327B,
- 0x91D6, 0x91D6, 0x1FCE, 0x91D7, 0x91D7, 0x327C, 0x91D8, 0x91D8, 0x211E,
- 0x91D9, 0x91D9, 0x2021, 0x91DA, 0x91DE, 0x327D, 0x91DF, 0x91DF, 0x24E1,
- 0x91E0, 0x91E1, 0x3282, 0x91E2, 0x91E2, 0x24A3, 0x91E3, 0x91E9, 0x3284,
- 0x91EA, 0x91EA, 0x24A4, 0x91EB, 0x91EF, 0x328B, 0x91F0, 0x91F0, 0x2273,
- 0x91F1, 0x91F1, 0x3290, 0x91F2, 0x91F2, 0x21B0, 0x91F3, 0x91FE, 0x3291,
- 0x9240, 0x927E, 0x329D, 0x9280, 0x92B5, 0x32DC, 0x92B6, 0x92B6, 0x21D1,
- 0x92B7, 0x92CD, 0x3312, 0x92CE, 0x92CE, 0x211C, 0x92CF, 0x92CF, 0x3329,
- 0x92D0, 0x92D0, 0x235D, 0x92D1, 0x92D3, 0x332A, 0x92D4, 0x92D4, 0x2682,
- 0x92D5, 0x92DE, 0x332D, 0x92DF, 0x92DF, 0x210D, 0x92E0, 0x92E0, 0x205A,
- 0x92E1, 0x92FD, 0x3337, 0x92FE, 0x92FE, 0x1F8D, 0x9340, 0x934F, 0x3354,
- 0x9350, 0x9350, 0x21FF, 0x9351, 0x935C, 0x3364, 0x935D, 0x935D, 0x1F58,
- 0x935E, 0x936F, 0x3370, 0x9370, 0x9370, 0x215B, 0x9371, 0x9375, 0x3382,
- 0x9376, 0x9376, 0x1EB6, 0x9377, 0x937E, 0x3387, 0x9380, 0x938B, 0x338F,
- 0x938C, 0x938C, 0x20DB, 0x938D, 0x939C, 0x339B, 0x939D, 0x939D, 0x2360,
- 0x939E, 0x93A4, 0x33AB, 0x93A5, 0x93A5, 0x2361, 0x93A6, 0x93A6, 0x33B2,
- 0x93A7, 0x93A7, 0x2040, 0x93A8, 0x93B3, 0x33B3, 0x93B4, 0x93B4, 0x228E,
- 0x93B5, 0x93B7, 0x33BF, 0x93B8, 0x93B8, 0x1FDF, 0x93B9, 0x93BA, 0x33C2,
- 0x93BB, 0x93BB, 0x235E, 0x93BC, 0x93BC, 0x33C4, 0x93BD, 0x93BD, 0x1E6A,
- 0x93BE, 0x93C5, 0x33C5, 0x93C6, 0x93C6, 0x2002, 0x93C7, 0x93CE, 0x33CD,
- 0x93CF, 0x93CF, 0x2093, 0x93D0, 0x93D6, 0x33D5, 0x93D7, 0x93D7, 0x235F,
- 0x93D8, 0x93DA, 0x33DC, 0x93DB, 0x93DB, 0x1EAC, 0x93DC, 0x93DC, 0x1E54,
- 0x93DD, 0x93E0, 0x33DF, 0x93E1, 0x93E1, 0x1F08, 0x93E2, 0x93E3, 0x33E3,
- 0x93E4, 0x93E4, 0x20C0, 0x93E5, 0x93E5, 0x2362, 0x93E6, 0x93E8, 0x33E5,
- 0x93E9, 0x93E9, 0x2160, 0x93EA, 0x93EA, 0x33E8, 0x93EB, 0x93EB, 0x219D,
- 0x93EC, 0x93EC, 0x1F8E, 0x93ED, 0x93ED, 0x222D, 0x93EE, 0x93EE, 0x33E9,
- 0x93EF, 0x93EF, 0x2047, 0x93F0, 0x93F0, 0x33EA, 0x93F1, 0x93F1, 0x2262,
- 0x93F2, 0x93F3, 0x33EB, 0x93F4, 0x93F4, 0x1F67, 0x93F5, 0x93F5, 0x1EB2,
- 0x93F6, 0x93F9, 0x33ED, 0x93FA, 0x93FA, 0x1EA9, 0x93FB, 0x93FD, 0x33F1,
- 0x93FE, 0x93FE, 0x1FCC, 0x9440, 0x9443, 0x33F4, 0x9444, 0x9444, 0x1F72,
- 0x9445, 0x944C, 0x33F8, 0x944D, 0x944D, 0x2098, 0x944E, 0x944F, 0x3400,
- 0x9450, 0x9450, 0x1E52, 0x9451, 0x9451, 0x20A4, 0x9452, 0x9452, 0x1F1C,
- 0x9453, 0x9453, 0x228F, 0x9454, 0x9454, 0x3402, 0x9455, 0x9455, 0x1FED,
- 0x9456, 0x9457, 0x3403, 0x9458, 0x9458, 0x2365, 0x9459, 0x945A, 0x3405,
- 0x945B, 0x945B, 0x1E2D, 0x945C, 0x945C, 0x2152, 0x945D, 0x945D, 0x2366,
- 0x945E, 0x945E, 0x3407, 0x945F, 0x945F, 0x20FA, 0x9460, 0x9463, 0x3408,
- 0x9464, 0x9464, 0x2363, 0x9465, 0x9465, 0x340C, 0x9466, 0x9466, 0x209A,
- 0x9467, 0x946D, 0x340D, 0x946E, 0x946E, 0x203C, 0x946F, 0x9471, 0x3414,
- 0x9472, 0x9472, 0x1FF6, 0x9473, 0x9473, 0x3417, 0x9474, 0x9474, 0x2364,
- 0x9475, 0x9475, 0x3418, 0x9476, 0x9476, 0x1E69, 0x9477, 0x9477, 0x3419,
- 0x9478, 0x9478, 0x2367, 0x9479, 0x9479, 0x341A, 0x947A, 0x947A, 0x211D,
- 0x947B, 0x947E, 0x341B, 0x9480, 0x9480, 0x2259, 0x9481, 0x9481, 0x2056,
- 0x9482, 0x9482, 0x2163, 0x9483, 0x9486, 0x341F, 0x9487, 0x9487, 0x1FA9,
- 0x9488, 0x9488, 0x1FFC, 0x9489, 0x94A0, 0x3423, 0x94A1, 0x94A1, 0x1E2E,
- 0x94A2, 0x94B2, 0x343B, 0x94B3, 0x94B3, 0x1EBC, 0x94B4, 0x94B4, 0x344C,
- 0x94B5, 0x94B5, 0x2142, 0x94B6, 0x94BE, 0x344D, 0x94BF, 0x94BF, 0x201E,
- 0x94C0, 0x94C0, 0x1E43, 0x94C1, 0x94CB, 0x3456, 0x94CC, 0x94CC, 0x24D4,
- 0x94CD, 0x94D7, 0x3461, 0x94D8, 0x94D8, 0x226F, 0x94D9, 0x94DF, 0x346C,
- 0x94E0, 0x94E0, 0x1ED7, 0x94E1, 0x94FE, 0x3473, 0x9540, 0x9571, 0x3491,
- 0x9572, 0x9572, 0x212D, 0x9573, 0x957E, 0x34C3, 0x9580, 0x9582, 0x34CF,
- 0x9583, 0x9583, 0x229B, 0x9584, 0x959D, 0x34D2, 0x959E, 0x959E, 0x2256,
- 0x959F, 0x959F, 0x24A8, 0x95A0, 0x95B2, 0x34EC, 0x95B3, 0x95B3, 0x1E79,
- 0x95B4, 0x95B9, 0x34FF, 0x95BA, 0x95BA, 0x225A, 0x95BB, 0x95CE, 0x3505,
- 0x95CF, 0x95CF, 0x24A7, 0x95D0, 0x95D0, 0x3519, 0x95D1, 0x95D1, 0x2686,
- 0x95D2, 0x95D2, 0x24A6, 0x95D3, 0x95D3, 0x351A, 0x95D4, 0x95D4, 0x21CE,
- 0x95D5, 0x95E0, 0x351B, 0x95E1, 0x95E1, 0x24A9, 0x95E2, 0x95E6, 0x3527,
- 0x95E7, 0x95E7, 0x1FE7, 0x95E8, 0x95F0, 0x352C, 0x95F1, 0x95F1, 0x2112,
- 0x95F2, 0x95F7, 0x3535, 0x95F8, 0x95F8, 0x213C, 0x95F9, 0x95FD, 0x353B,
- 0x95FE, 0x95FE, 0x1F5C, 0x9640, 0x9655, 0x3540, 0x9656, 0x9656, 0x24C4,
- 0x9657, 0x967B, 0x3556, 0x967C, 0x967C, 0x1ECC, 0x967D, 0x967E, 0x357B,
- 0x9680, 0x96FE, 0x357D, 0x9740, 0x9766, 0x35FC, 0x9767, 0x9767, 0x246A,
- 0x9768, 0x976B, 0x3623, 0x976C, 0x976C, 0x2175, 0x976D, 0x976D, 0x3627,
- 0x976E, 0x976E, 0x246D, 0x976F, 0x977E, 0x3628, 0x9780, 0x9795, 0x3638,
- 0x9796, 0x9796, 0x246B, 0x9797, 0x9797, 0x225F, 0x9798, 0x979C, 0x364E,
- 0x979D, 0x979D, 0x1ECE, 0x979E, 0x97A2, 0x3653, 0x97A3, 0x97A3, 0x2272,
- 0x97A4, 0x97BE, 0x3658, 0x97BF, 0x97BF, 0x2473, 0x97C0, 0x97ED, 0x3673,
- 0x97EE, 0x97EE, 0x21FE, 0x97EF, 0x97F6, 0x36A1, 0x97F7, 0x97F7, 0x1EFE,
- 0x97F8, 0x97FE, 0x36A9, 0x9840, 0x9844, 0x36B0, 0x9845, 0x9845, 0x2475,
- 0x9846, 0x9848, 0x36B5, 0x9849, 0x9849, 0x220A, 0x984A, 0x984E, 0x36B8,
- 0x984F, 0x984F, 0x1F6F, 0x9850, 0x9870, 0x36BD, 0x9871, 0x9871, 0x2468,
- 0x9872, 0x9872, 0x36DE, 0x9873, 0x9873, 0x2100, 0x9874, 0x987E, 0x36DF,
- 0x9880, 0x9880, 0x36EA, 0x9881, 0x9881, 0x2476, 0x9882, 0x988A, 0x36EB,
- 0x988B, 0x988B, 0x1F27, 0x988C, 0x988C, 0x20D7, 0x988D, 0x989F, 0x36F4,
- 0x98A0, 0x98A0, 0x247C, 0x98A1, 0x98A9, 0x3707, 0x98AA, 0x98AA, 0x1FA1,
- 0x98AB, 0x98B5, 0x3710, 0x98B6, 0x98B6, 0x22AA, 0x98B7, 0x98B7, 0x2005,
- 0x98B8, 0x98B9, 0x371B, 0x98BA, 0x98BA, 0x246C, 0x98BB, 0x98C6, 0x371D,
- 0x98C7, 0x98C7, 0x203E, 0x98C8, 0x98CA, 0x3729, 0x98CB, 0x98CB, 0x1E4C,
- 0x98CC, 0x98CF, 0x372C, 0x98D0, 0x98D0, 0x213A, 0x98D1, 0x98D2, 0x3730,
- 0x98D3, 0x98D3, 0x2204, 0x98D4, 0x98E2, 0x3732, 0x98E3, 0x98E3, 0x20C3,
- 0x98E4, 0x98E4, 0x2140, 0x98E5, 0x98E5, 0x2477, 0x98E6, 0x98EE, 0x3741,
- 0x98EF, 0x98EF, 0x2474, 0x98F0, 0x98F1, 0x374A, 0x98F2, 0x98F2, 0x20DD,
- 0x98F3, 0x98FE, 0x374C, 0x9940, 0x9942, 0x3758, 0x9943, 0x9943, 0x1F68,
- 0x9944, 0x9944, 0x375B, 0x9945, 0x9945, 0x2185, 0x9946, 0x9965, 0x375C,
- 0x9966, 0x9966, 0x2472, 0x9967, 0x996D, 0x377C, 0x996E, 0x996E, 0x1EB5,
- 0x996F, 0x9974, 0x3783, 0x9975, 0x9975, 0x2478, 0x9976, 0x9979, 0x3789,
- 0x997A, 0x997A, 0x1F8B, 0x997B, 0x997B, 0x2484, 0x997C, 0x997E, 0x378D,
- 0x9980, 0x9984, 0x3790, 0x9985, 0x9985, 0x2699, 0x9986, 0x9988, 0x3795,
- 0x9989, 0x9989, 0x2482, 0x998A, 0x998D, 0x3798, 0x998E, 0x998E, 0x20A1,
- 0x998F, 0x9990, 0x379C, 0x9991, 0x9991, 0x1F92, 0x9992, 0x9998, 0x379E,
- 0x9999, 0x9999, 0x1F38, 0x999A, 0x99A8, 0x37A5, 0x99A9, 0x99A9, 0x2485,
- 0x99AA, 0x99AF, 0x37B4, 0x99B0, 0x99B0, 0x2480, 0x99B1, 0x99B1, 0x246E,
- 0x99B2, 0x99B2, 0x37BA, 0x99B3, 0x99B3, 0x247B, 0x99B4, 0x99B4, 0x2486,
- 0x99B5, 0x99B5, 0x2471, 0x99B6, 0x99BC, 0x37BB, 0x99BD, 0x99BD, 0x2483,
- 0x99BE, 0x99BE, 0x2470, 0x99BF, 0x99BF, 0x37C2, 0x99C0, 0x99C0, 0x2469,
- 0x99C1, 0x99C1, 0x37C3, 0x99C2, 0x99C2, 0x247F, 0x99C3, 0x99C8, 0x37C4,
- 0x99C9, 0x99C9, 0x246F, 0x99CA, 0x99CD, 0x37CA, 0x99CE, 0x99CE, 0x2481,
- 0x99CF, 0x99D0, 0x37CE, 0x99D1, 0x99D1, 0x2220, 0x99D2, 0x99D9, 0x37D0,
- 0x99DA, 0x99DA, 0x1FF5, 0x99DB, 0x99DF, 0x37D8, 0x99E0, 0x99E0, 0x20F4,
- 0x99E1, 0x99E4, 0x37DD, 0x99E5, 0x99E5, 0x247D, 0x99E6, 0x99E7, 0x37E1,
- 0x99E8, 0x99E8, 0x2479, 0x99E9, 0x99EB, 0x37E3, 0x99EC, 0x99EC, 0x247E,
- 0x99ED, 0x99F3, 0x37E6, 0x99F4, 0x99F4, 0x247A, 0x99F5, 0x99FE, 0x37ED,
- 0x9A40, 0x9A49, 0x37F7, 0x9A4A, 0x9A4A, 0x20E3, 0x9A4B, 0x9A56, 0x3801,
- 0x9A57, 0x9A57, 0x20AD, 0x9A58, 0x9A64, 0x380D, 0x9A65, 0x9A65, 0x24CB,
- 0x9A66, 0x9A66, 0x381A, 0x9A67, 0x9A67, 0x1F53, 0x9A68, 0x9A70, 0x381B,
- 0x9A71, 0x9A71, 0x2159, 0x9A72, 0x9A75, 0x3824, 0x9A76, 0x9A76, 0x2013,
- 0x9A77, 0x9A77, 0x1F33, 0x9A78, 0x9A7E, 0x3828, 0x9A80, 0x9A87, 0x382F,
- 0x9A88, 0x9A88, 0x1E5C, 0x9A89, 0x9A8B, 0x3837, 0x9A8C, 0x9A8C, 0x2488,
- 0x9A8D, 0x9A90, 0x383A, 0x9A91, 0x9A91, 0x2487, 0x9A92, 0x9A96, 0x383E,
- 0x9A97, 0x9A97, 0x248A, 0x9A98, 0x9A99, 0x3843, 0x9A9A, 0x9A9A, 0x2489,
- 0x9A9B, 0x9A9B, 0x248B, 0x9A9C, 0x9A9D, 0x3845, 0x9A9E, 0x9A9E, 0x1F83,
- 0x9A9F, 0x9AA1, 0x3847, 0x9AA2, 0x9AA2, 0x210F, 0x9AA3, 0x9AA3, 0x1FDB,
- 0x9AA4, 0x9AA9, 0x384A, 0x9AAA, 0x9AAA, 0x20AF, 0x9AAB, 0x9ACF, 0x3850,
- 0x9AD0, 0x9AD0, 0x24C0, 0x9AD1, 0x9AD5, 0x3875, 0x9AD6, 0x9AD6, 0x226D,
- 0x9AD7, 0x9AD9, 0x387A, 0x9ADA, 0x9ADA, 0x24C1, 0x9ADB, 0x9AE1, 0x387D,
- 0x9AE2, 0x9AE2, 0x20CA, 0x9AE3, 0x9AE3, 0x3884, 0x9AE4, 0x9AE4, 0x20E7,
- 0x9AE5, 0x9AE5, 0x24C2, 0x9AE6, 0x9AFE, 0x3885, 0x9B40, 0x9B7E, 0x389E,
- 0x9B80, 0x9BD0, 0x38DD, 0x9BD1, 0x9BD1, 0x23DC, 0x9BD2, 0x9BDB, 0x392E,
- 0x9BDC, 0x9BDC, 0x23DB, 0x9BDD, 0x9BFE, 0x3938, 0x9C40, 0x9C52, 0x395A,
- 0x9C53, 0x9C53, 0x205E, 0x9C54, 0x9C58, 0x396D, 0x9C59, 0x9C59, 0x2244,
- 0x9C5A, 0x9C5A, 0x23E2, 0x9C5B, 0x9C5B, 0x3972, 0x9C5C, 0x9C5C, 0x20D4,
- 0x9C5D, 0x9C74, 0x3973, 0x9C75, 0x9C75, 0x219F, 0x9C76, 0x9C78, 0x398B,
- 0x9C79, 0x9C79, 0x1E66, 0x9C7A, 0x9C7E, 0x398E, 0x9C80, 0x9C85, 0x3993,
- 0x9C86, 0x9C86, 0x1F63, 0x9C87, 0x9C9C, 0x3999, 0x9C9D, 0x9C9D, 0x23DD,
- 0x9C9E, 0x9CAA, 0x39AF, 0x9CAB, 0x9CAB, 0x216B, 0x9CAC, 0x9CC9, 0x39BC,
- 0x9CCA, 0x9CCA, 0x22B5, 0x9CCB, 0x9CCE, 0x39DA, 0x9CCF, 0x9CCF, 0x1F26,
- 0x9CD0, 0x9CE5, 0x39DE, 0x9CE6, 0x9CE6, 0x1E63, 0x9CE7, 0x9CE7, 0x2088,
- 0x9CE8, 0x9CEB, 0x39F4, 0x9CEC, 0x9CEC, 0x1EBD, 0x9CED, 0x9CED, 0x39F8,
- 0x9CEE, 0x9CEE, 0x2341, 0x9CEF, 0x9CFA, 0x39F9, 0x9CFB, 0x9CFB, 0x1F4B,
- 0x9CFC, 0x9CFD, 0x3A05, 0x9CFE, 0x9CFE, 0x2292, 0x9D40, 0x9D41, 0x3A07,
- 0x9D42, 0x9D42, 0x2124, 0x9D43, 0x9D45, 0x3A09, 0x9D46, 0x9D46, 0x2048,
- 0x9D47, 0x9D47, 0x23E0, 0x9D48, 0x9D4C, 0x3A0C, 0x9D4D, 0x9D4D, 0x2077,
- 0x9D4E, 0x9D4E, 0x3A11, 0x9D4F, 0x9D4F, 0x223A, 0x9D50, 0x9D60, 0x3A12,
- 0x9D61, 0x9D61, 0x20B1, 0x9D62, 0x9D67, 0x3A23, 0x9D68, 0x9D68, 0x1F41,
- 0x9D69, 0x9D69, 0x201C, 0x9D6A, 0x9D6D, 0x3A29, 0x9D6E, 0x9D6E, 0x22B8,
- 0x9D6F, 0x9D70, 0x3A2D, 0x9D71, 0x9D71, 0x2276, 0x9D72, 0x9D74, 0x3A2F,
- 0x9D75, 0x9D75, 0x1F9B, 0x9D76, 0x9D7A, 0x3A32, 0x9D7B, 0x9D7B, 0x1F9F,
- 0x9D7C, 0x9D7C, 0x3A37, 0x9D7D, 0x9D7D, 0x25CA, 0x9D7E, 0x9D7E, 0x3A38,
- 0x9D80, 0x9D89, 0x3A39, 0x9D8A, 0x9D8A, 0x20BE, 0x9D8B, 0x9D8C, 0x3A43,
- 0x9D8D, 0x9D8D, 0x1FB4, 0x9D8E, 0x9D90, 0x3A45, 0x9D91, 0x9D91, 0x23D7,
- 0x9D92, 0x9D98, 0x3A48, 0x9D99, 0x9D99, 0x2105, 0x9D9A, 0x9DA0, 0x3A4F,
- 0x9DA1, 0x9DA1, 0x23E1, 0x9DA2, 0x9DA2, 0x1FEC, 0x9DA3, 0x9DA6, 0x3A56,
- 0x9DA7, 0x9DA7, 0x23EA, 0x9DA8, 0x9DAB, 0x3A5A, 0x9DAC, 0x9DAC, 0x23E3,
- 0x9DAD, 0x9DAD, 0x210E, 0x9DAE, 0x9DB1, 0x3A5E, 0x9DB2, 0x9DB2, 0x1FA6,
- 0x9DB3, 0x9DB3, 0x2004, 0x9DB4, 0x9DBD, 0x3A62, 0x9DBE, 0x9DBE, 0x1F9D,
- 0x9DBF, 0x9DC5, 0x3A6C, 0x9DC6, 0x9DC6, 0x23E5, 0x9DC7, 0x9DC8, 0x3A73,
- 0x9DC9, 0x9DC9, 0x2264, 0x9DCA, 0x9DCC, 0x3A75, 0x9DCD, 0x9DCD, 0x24E2,
- 0x9DCE, 0x9DD1, 0x3A78, 0x9DD2, 0x9DD2, 0x23DE, 0x9DD3, 0x9DD4, 0x3A7C,
- 0x9DD5, 0x9DD5, 0x1EC4, 0x9DD6, 0x9DE0, 0x3A7E, 0x9DE1, 0x9DE1, 0x22B6,
- 0x9DE2, 0x9DE2, 0x20A9, 0x9DE3, 0x9DF0, 0x3A89, 0x9DF1, 0x9DF1, 0x212B,
- 0x9DF2, 0x9DF3, 0x3A97, 0x9DF4, 0x9DF4, 0x20A5, 0x9DF5, 0x9DF6, 0x3A99,
- 0x9DF7, 0x9DF7, 0x268B, 0x9DF8, 0x9DF9, 0x3A9B, 0x9DFA, 0x9DFA, 0x1F76,
- 0x9DFB, 0x9DFC, 0x3A9D, 0x9DFD, 0x9DFD, 0x216D, 0x9DFE, 0x9DFE, 0x3A9F,
- 0x9E40, 0x9E44, 0x3AA0, 0x9E45, 0x9E45, 0x2001, 0x9E46, 0x9E47, 0x3AA5,
- 0x9E48, 0x9E48, 0x2191, 0x9E49, 0x9E49, 0x1E50, 0x9E4A, 0x9E51, 0x3AA7,
- 0x9E52, 0x9E52, 0x1F9C, 0x9E53, 0x9E53, 0x3AAF, 0x9E54, 0x9E54, 0x23DA,
- 0x9E55, 0x9E55, 0x3AB0, 0x9E56, 0x9E56, 0x2053, 0x9E57, 0x9E5C, 0x3AB1,
- 0x9E5D, 0x9E5D, 0x23E9, 0x9E5E, 0x9E5E, 0x23E4, 0x9E5F, 0x9E60, 0x3AB7,
- 0x9E61, 0x9E61, 0x21D5, 0x9E62, 0x9E62, 0x3AB9, 0x9E63, 0x9E63, 0x23E6,
- 0x9E64, 0x9E66, 0x3ABA, 0x9E67, 0x9E67, 0x23DF, 0x9E68, 0x9E6B, 0x3ABD,
- 0x9E6C, 0x9E6C, 0x1E4F, 0x9E6D, 0x9E6E, 0x3AC1, 0x9E6F, 0x9E6F, 0x23D9,
- 0x9E70, 0x9E71, 0x3AC3, 0x9E72, 0x9E72, 0x2014, 0x9E73, 0x9E73, 0x3AC5,
- 0x9E74, 0x9E74, 0x23EC, 0x9E75, 0x9E75, 0x23EB, 0x9E76, 0x9E7A, 0x3AC6,
- 0x9E7B, 0x9E7B, 0x23D8, 0x9E7C, 0x9E7C, 0x23EE, 0x9E7D, 0x9E7E, 0x3ACB,
- 0x9E80, 0x9E84, 0x3ACD, 0x9E85, 0x9E85, 0x268E, 0x9E86, 0x9E86, 0x3AD2,
- 0x9E87, 0x9E87, 0x23ED, 0x9E88, 0x9E90, 0x3AD3, 0x9E91, 0x9E91, 0x1FFA,
- 0x9E92, 0x9E95, 0x3ADC, 0x9E96, 0x9E96, 0x23D6, 0x9E97, 0x9E97, 0x23E8,
- 0x9E98, 0x9EA1, 0x3AE0, 0x9EA2, 0x9EA2, 0x2106, 0x9EA3, 0x9EA5, 0x3AEA,
- 0x9EA6, 0x9EA6, 0x200B, 0x9EA7, 0x9EA8, 0x3AED, 0x9EA9, 0x9EA9, 0x2166,
- 0x9EAA, 0x9EAD, 0x3AEF, 0x9EAE, 0x9EAE, 0x23EF, 0x9EAF, 0x9EB2, 0x3AF3,
- 0x9EB3, 0x9EB3, 0x2189, 0x9EB4, 0x9EB4, 0x2058, 0x9EB5, 0x9EB6, 0x3AF7,
- 0x9EB7, 0x9EB7, 0x23E7, 0x9EB8, 0x9EF4, 0x3AF9, 0x9EF5, 0x9EF5, 0x21A3,
- 0x9EF6, 0x9EFE, 0x3B36, 0x9F40, 0x9F4D, 0x3B3F, 0x9F4E, 0x9F4E, 0x217A,
- 0x9F4F, 0x9F6E, 0x3B4D, 0x9F6F, 0x9F6F, 0x21A5, 0x9F70, 0x9F7E, 0x3B6D,
- 0x9F80, 0x9F91, 0x3B7C, 0x9F92, 0x9F92, 0x2022, 0x9F93, 0x9F97, 0x3B8E,
- 0x9F98, 0x9F98, 0x24D6, 0x9F99, 0x9FA5, 0x3B93, 0x9FA6, 0x9FA6, 0x233A,
- 0x9FA7, 0x9FA8, 0x3BA0, 0x9FA9, 0x9FA9, 0x1EEE, 0x9FAA, 0x9FAB, 0x3BA2,
- 0x9FAC, 0x9FAC, 0x24D5, 0x9FAD, 0x9FC8, 0x3BA4, 0x9FC9, 0x9FC9, 0x2228,
- 0x9FCA, 0x9FCC, 0x3BC0, 0x9FCD, 0x9FCD, 0x24D7, 0x9FCE, 0x9FE0, 0x3BC3,
- 0x9FE1, 0x9FE1, 0x20FC, 0x9FE2, 0x9FEA, 0x3BD6, 0x9FEB, 0x9FEB, 0x1E87,
- 0x9FEC, 0x9FED, 0x3BDF, 0x9FEE, 0x9FEE, 0x24D8, 0x9FEF, 0x9FF3, 0x3BE1,
- 0x9FF4, 0x9FF4, 0x1EBA, 0x9FF5, 0x9FFC, 0x3BE6, 0x9FFD, 0x9FFD, 0x2119,
- 0x9FFE, 0x9FFE, 0x3BEE, 0xA040, 0xA042, 0x3BEF, 0xA043, 0xA043, 0x216C,
- 0xA044, 0xA045, 0x3BF2, 0xA046, 0xA046, 0x24D9, 0xA047, 0xA048, 0x3BF4,
- 0xA049, 0xA049, 0x2227, 0xA04A, 0xA04D, 0x3BF6, 0xA04E, 0xA04E, 0x1E5F,
- 0xA04F, 0xA053, 0x3BFA, 0xA054, 0xA054, 0x229F, 0xA055, 0xA059, 0x3BFF,
- 0xA05A, 0xA05A, 0x1F5D, 0xA05B, 0xA060, 0x3C04, 0xA061, 0xA061, 0x1FBC,
- 0xA062, 0xA062, 0x3C0A, 0xA063, 0xA063, 0x24DA, 0xA064, 0xA070, 0x3C0B,
- 0xA071, 0xA071, 0x2149, 0xA072, 0xA073, 0x3C18, 0xA074, 0xA074, 0x2046,
- 0xA075, 0xA07E, 0x3C1A, 0xA080, 0xA080, 0x2000, 0xA081, 0xA090, 0x3C24,
- 0xA091, 0xA091, 0x2190, 0xA092, 0xA093, 0x3C34, 0xA094, 0xA094, 0x2208,
- 0xA095, 0xA095, 0x3C36, 0xA096, 0xA096, 0x1EE6, 0xA097, 0xA0A8, 0x3C37,
- 0xA0A9, 0xA0A9, 0x24C3, 0xA0AA, 0xA0BE, 0x3C49, 0xA0BF, 0xA0BF, 0x20CC,
- 0xA0C0, 0xA0CD, 0x3C5E, 0xA0CE, 0xA0CE, 0x2340, 0xA0CF, 0xA0D8, 0x3C6C,
- 0xA0D9, 0xA0D9, 0x1ED1, 0xA0DA, 0xA0DD, 0x3C76, 0xA0DE, 0xA0DE, 0x21AC,
- 0xA0DF, 0xA0ED, 0x3C7A, 0xA0EE, 0xA0EE, 0x22AF, 0xA0EF, 0xA0FE, 0x3C89,
- 0xA1A1, 0xA1FE, 0x0060, 0xA2A1, 0xA2AA, 0x26A9, 0xA2B1, 0xA2E2, 0x00BE,
- 0xA2E5, 0xA2EE, 0x00F0, 0xA2F1, 0xA2FC, 0x00FA, 0xA3A1, 0xA3FE, 0x0106,
- 0xA4A1, 0xA4F3, 0x0164, 0xA5A1, 0xA5F6, 0x01B7, 0xA6A1, 0xA6B8, 0x020D,
- 0xA6C1, 0xA6F5, 0x0225, 0xA7A1, 0xA7C1, 0x025A, 0xA7D1, 0xA7F1, 0x027B,
- 0xA840, 0xA87E, 0x26B3, 0xA880, 0xA895, 0x26F2, 0xA8A1, 0xA8C0, 0x029C,
- 0xA8C5, 0xA8EA, 0x02BC, 0xA940, 0xA957, 0x2708, 0xA959, 0xA95A, 0x2720,
- 0xA95C, 0xA95C, 0x2722, 0xA960, 0xA97E, 0x2723, 0xA980, 0xA995, 0x2742,
- 0xA996, 0xA996, 0x1E17, 0xA9A4, 0xA9EF, 0x02E2, 0xAA40, 0xAA4C, 0x3C99,
- 0xAA4D, 0xAA4D, 0x21B6, 0xAA4E, 0xAA4E, 0x1E3D, 0xAA4F, 0xAA70, 0x3CA6,
- 0xAA71, 0xAA71, 0x2235, 0xAA72, 0xAA72, 0x3CC8, 0xAA73, 0xAA73, 0x2397,
- 0xAA74, 0xAA76, 0x3CC9, 0xAA77, 0xAA77, 0x2395, 0xAA78, 0xAA79, 0x3CCC,
- 0xAA7A, 0xAA7A, 0x223F, 0xAA7B, 0xAA7B, 0x212A, 0xAA7C, 0xAA7E, 0x3CCE,
- 0xAA80, 0xAA99, 0x3CD1, 0xAA9A, 0xAA9A, 0x1ED2, 0xAA9B, 0xAA9B, 0x3CEB,
- 0xAA9C, 0xAA9C, 0x2396, 0xAA9D, 0xAA9D, 0x2398, 0xAA9E, 0xAA9E, 0x3CEC,
- 0xAA9F, 0xAA9F, 0x20A2, 0xAAA0, 0xAAA0, 0x3CED, 0xAAA1, 0xAAFE, 0x032E,
- 0xAB40, 0xAB40, 0x1F64, 0xAB41, 0xAB42, 0x3CEE, 0xAB43, 0xAB43, 0x202B,
- 0xAB44, 0xAB44, 0x3CF0, 0xAB45, 0xAB45, 0x2394, 0xAB46, 0xAB46, 0x2139,
- 0xAB47, 0xAB47, 0x3CF1, 0xAB48, 0xAB48, 0x215F, 0xAB49, 0xAB49, 0x21C1,
- 0xAB4A, 0xAB4A, 0x239A, 0xAB4B, 0xAB4C, 0x3CF2, 0xAB4D, 0xAB4D, 0x2399,
- 0xAB4E, 0xAB7E, 0x3CF4, 0xAB80, 0xABA0, 0x3D25, 0xABA1, 0xABC0, 0x038C,
- 0xAC40, 0xAC45, 0x3D46, 0xAC46, 0xAC46, 0x21C0, 0xAC47, 0xAC70, 0x3D4C,
- 0xAC71, 0xAC71, 0x2460, 0xAC72, 0xAC7B, 0x3D76, 0xAC7C, 0xAC7C, 0x245C,
- 0xAC7D, 0xAC7E, 0x3D80, 0xAC80, 0xAC8C, 0x3D82, 0xAC8D, 0xAC8D, 0x215D,
- 0xAC8E, 0xAC92, 0x3D8F, 0xAC93, 0xAC93, 0x2225, 0xAC94, 0xAC94, 0x206A,
- 0xAC95, 0xACA0, 0x3D94, 0xAD40, 0xAD48, 0x3DA0, 0xAD49, 0xAD49, 0x2461,
- 0xAD4A, 0xAD5D, 0x3DA9, 0xAD5E, 0xAD5E, 0x245B, 0xAD5F, 0xAD60, 0x3DBD,
- 0xAD61, 0xAD61, 0x2462, 0xAD62, 0xAD67, 0x3DBF, 0xAD68, 0xAD68, 0x1F54,
- 0xAD69, 0xAD73, 0x3DC5, 0xAD74, 0xAD74, 0x245F, 0xAD75, 0xAD7E, 0x3DD0,
- 0xAD80, 0xAD81, 0x3DDA, 0xAD82, 0xAD82, 0x20EC, 0xAD83, 0xAD86, 0x3DDC,
- 0xAD87, 0xAD87, 0x245D, 0xAD88, 0xAD8A, 0x3DE0, 0xAD8B, 0xAD8B, 0x2463,
- 0xAD8C, 0xAD90, 0x3DE3, 0xAD91, 0xAD91, 0x2464, 0xAD92, 0xADA0, 0x3DE8,
- 0xAE40, 0xAE53, 0x3DF7, 0xAE54, 0xAE54, 0x24A5, 0xAE55, 0xAE61, 0x3E0B,
- 0xAE62, 0xAE62, 0x1E70, 0xAE63, 0xAE7E, 0x3E18, 0xAE80, 0xAE80, 0x208F,
- 0xAE81, 0xAE84, 0x3E34, 0xAE85, 0xAE85, 0x1E42, 0xAE86, 0xAE8A, 0x3E38,
- 0xAE8B, 0xAE8B, 0x1F4E, 0xAE8C, 0xAE93, 0x3E3D, 0xAE94, 0xAE94, 0x1EB1,
- 0xAE95, 0xAE9F, 0x3E45, 0xAEA0, 0xAEA0, 0x1E8B, 0xAF40, 0xAF63, 0x3E50,
- 0xAF64, 0xAF64, 0x1FC6, 0xAF65, 0xAF7A, 0x3E74, 0xAF7B, 0xAF7B, 0x25AE,
- 0xAF7C, 0xAF7E, 0x3E8A, 0xAF80, 0xAF81, 0x3E8D, 0xAF82, 0xAF82, 0x1F01,
- 0xAF83, 0xAF83, 0x2200, 0xAF84, 0xAF8D, 0x3E8F, 0xAF8E, 0xAF8E, 0x25B2,
- 0xAF8F, 0xAF8F, 0x1E97, 0xAF90, 0xAF90, 0x3E99, 0xAF91, 0xAF91, 0x20AB,
- 0xAF92, 0xAF9B, 0x3E9A, 0xAF9C, 0xAF9C, 0x25B3, 0xAF9D, 0xAF9E, 0x3EA4,
- 0xAF9F, 0xAF9F, 0x2028, 0xAFA0, 0xAFA0, 0x3EA6, 0xB040, 0xB040, 0x3EA7,
- 0xB041, 0xB042, 0x25AF, 0xB043, 0xB043, 0x3EA8, 0xB044, 0xB044, 0x25B1,
- 0xB045, 0xB04E, 0x3EA9, 0xB04F, 0xB04F, 0x25AC, 0xB050, 0xB053, 0x3EB3,
- 0xB054, 0xB054, 0x1E4E, 0xB055, 0xB056, 0x3EB7, 0xB057, 0xB057, 0x2202,
- 0xB058, 0xB058, 0x25AB, 0xB059, 0xB059, 0x2286, 0xB05A, 0xB05A, 0x3EB9,
- 0xB05B, 0xB05B, 0x25AD, 0xB05C, 0xB05C, 0x3EBA, 0xB05D, 0xB05D, 0x25B6,
- 0xB05E, 0xB05E, 0x3EBB, 0xB05F, 0xB05F, 0x21E3, 0xB060, 0xB061, 0x25B4,
- 0xB062, 0xB062, 0x222F, 0xB063, 0xB063, 0x2165, 0xB064, 0xB064, 0x25B7,
- 0xB065, 0xB06B, 0x3EBC, 0xB06C, 0xB06C, 0x1EE9, 0xB06D, 0xB07C, 0x3EC3,
- 0xB07D, 0xB07D, 0x1E25, 0xB07E, 0xB07E, 0x3ED3, 0xB080, 0xB096, 0x3ED4,
- 0xB097, 0xB097, 0x25C0, 0xB098, 0xB098, 0x3EEB, 0xB099, 0xB099, 0x229A,
- 0xB09A, 0xB0A0, 0x3EEC, 0xB0A1, 0xB0FE, 0x03AC, 0xB140, 0xB14A, 0x3EF3,
- 0xB14B, 0xB14B, 0x226E, 0xB14C, 0xB14C, 0x3EFE, 0xB14D, 0xB14D, 0x1FBD,
- 0xB14E, 0xB14E, 0x3EFF, 0xB14F, 0xB14F, 0x1F84, 0xB150, 0xB150, 0x20B2,
- 0xB151, 0xB151, 0x3F00, 0xB152, 0xB152, 0x2043, 0xB153, 0xB17E, 0x3F01,
- 0xB180, 0xB196, 0x3F2D, 0xB197, 0xB197, 0x2684, 0xB198, 0xB1A0, 0x3F44,
- 0xB1A1, 0xB1FE, 0x040A, 0xB240, 0xB240, 0x3F4D, 0xB241, 0xB241, 0x24EF,
- 0xB242, 0xB266, 0x3F4E, 0xB267, 0xB267, 0x24EE, 0xB268, 0xB26C, 0x3F73,
- 0xB26D, 0xB26D, 0x2074, 0xB26E, 0xB273, 0x3F78, 0xB274, 0xB274, 0x2687,
- 0xB275, 0xB27E, 0x3F7E, 0xB280, 0xB280, 0x24F0, 0xB281, 0xB288, 0x3F88,
- 0xB289, 0xB289, 0x268D, 0xB28A, 0xB299, 0x3F90, 0xB29A, 0xB29A, 0x22A0,
- 0xB29B, 0xB2A0, 0x3FA0, 0xB2A1, 0xB2FE, 0x0468, 0xB340, 0xB342, 0x3FA6,
- 0xB343, 0xB343, 0x1FAB, 0xB344, 0xB36F, 0x3FA9, 0xB370, 0xB370, 0x26A8,
- 0xB371, 0xB37E, 0x3FD5, 0xB380, 0xB387, 0x3FE3, 0xB388, 0xB388, 0x24E9,
- 0xB389, 0xB38B, 0x3FEB, 0xB38C, 0xB38C, 0x24E5, 0xB38D, 0xB38D, 0x3FEE,
- 0xB38E, 0xB38E, 0x21FA, 0xB38F, 0xB3A0, 0x3FEF, 0xB3A1, 0xB3FE, 0x04C6,
- 0xB440, 0xB453, 0x4001, 0xB454, 0xB454, 0x2148, 0xB455, 0xB457, 0x4015,
- 0xB458, 0xB458, 0x24E4, 0xB459, 0xB45D, 0x4018, 0xB45E, 0xB45E, 0x24E6,
- 0xB45F, 0xB45F, 0x20F7, 0xB460, 0xB460, 0x401D, 0xB461, 0xB461, 0x206B,
- 0xB462, 0xB474, 0x401E, 0xB475, 0xB475, 0x22A7, 0xB476, 0xB47D, 0x4031,
- 0xB47E, 0xB47E, 0x24EC, 0xB480, 0xB482, 0x4039, 0xB483, 0xB483, 0x24EB,
- 0xB484, 0xB488, 0x403C, 0xB489, 0xB489, 0x24E3, 0xB48A, 0xB492, 0x4041,
- 0xB493, 0xB493, 0x24EA, 0xB494, 0xB4A0, 0x404A, 0xB4A1, 0xB4FE, 0x0524,
- 0xB540, 0xB540, 0x4057, 0xB541, 0xB541, 0x1E92, 0xB542, 0xB54A, 0x4058,
- 0xB54B, 0xB54B, 0x1E27, 0xB54C, 0xB555, 0x4061, 0xB556, 0xB556, 0x1FE6,
- 0xB557, 0xB559, 0x406B, 0xB55A, 0xB55A, 0x24E7, 0xB55B, 0xB55B, 0x2012,
- 0xB55C, 0xB55C, 0x1EEC, 0xB55D, 0xB560, 0x406E, 0xB561, 0xB561, 0x24E8,
- 0xB562, 0xB57E, 0x4072, 0xB580, 0xB59B, 0x408F, 0xB59C, 0xB59C, 0x1F66,
- 0xB59D, 0xB59D, 0x24DC, 0xB59E, 0xB5A0, 0x40AB, 0xB5A1, 0xB5FE, 0x0582,
- 0xB640, 0xB651, 0x40AE, 0xB652, 0xB652, 0x26A2, 0xB653, 0xB654, 0x40C0,
- 0xB655, 0xB655, 0x24DD, 0xB656, 0xB658, 0x40C2, 0xB659, 0xB659, 0x200E,
- 0xB65A, 0xB65A, 0x40C5, 0xB65B, 0xB65B, 0x24DB, 0xB65C, 0xB65C, 0x1EB8,
- 0xB65D, 0xB67E, 0x40C6, 0xB680, 0xB6A0, 0x40E8, 0xB6A1, 0xB6FE, 0x05E0,
- 0xB740, 0xB74D, 0x4109, 0xB74E, 0xB74E, 0x2295, 0xB74F, 0xB750, 0x4117,
- 0xB751, 0xB751, 0x1E80, 0xB752, 0xB758, 0x4119, 0xB759, 0xB759, 0x2677,
- 0xB75A, 0xB763, 0x4120, 0xB764, 0xB764, 0x2624, 0xB765, 0xB765, 0x1F69,
- 0xB766, 0xB766, 0x222B, 0xB767, 0xB776, 0x412A, 0xB777, 0xB777, 0x257F,
- 0xB778, 0xB778, 0x1F5B, 0xB779, 0xB77E, 0x413A, 0xB780, 0xB780, 0x219B,
- 0xB781, 0xB781, 0x4140, 0xB782, 0xB782, 0x267D, 0xB783, 0xB7A0, 0x4141,
- 0xB7A1, 0xB7FE, 0x063E, 0xB840, 0xB842, 0x415F, 0xB843, 0xB843, 0x21A0,
- 0xB844, 0xB844, 0x2186, 0xB845, 0xB845, 0x4162, 0xB846, 0xB846, 0x20ED,
- 0xB847, 0xB84C, 0x4163, 0xB84D, 0xB84D, 0x25B9, 0xB84E, 0xB850, 0x4169,
- 0xB851, 0xB851, 0x1FEA, 0xB852, 0xB859, 0x416C, 0xB85A, 0xB85A, 0x1EA4,
- 0xB85B, 0xB85B, 0x20E1, 0xB85C, 0xB85C, 0x4174, 0xB85D, 0xB85D, 0x25B8,
- 0xB85E, 0xB85E, 0x2260, 0xB85F, 0xB85F, 0x4175, 0xB860, 0xB860, 0x20E2,
- 0xB861, 0xB876, 0x4176, 0xB877, 0xB877, 0x2141, 0xB878, 0xB87E, 0x418C,
- 0xB880, 0xB881, 0x4193, 0xB882, 0xB882, 0x1FC7, 0xB883, 0xB8A0, 0x4195,
- 0xB8A1, 0xB8FE, 0x069C, 0xB940, 0xB94F, 0x41B3, 0xB950, 0xB950, 0x1E41,
- 0xB951, 0xB960, 0x41C3, 0xB961, 0xB961, 0x25E4, 0xB962, 0xB97A, 0x41D3,
- 0xB97B, 0xB97B, 0x1F86, 0xB97C, 0xB97E, 0x41EC, 0xB980, 0xB99C, 0x41EF,
- 0xB99D, 0xB99D, 0x1FB3, 0xB99E, 0xB99F, 0x420C, 0xB9A0, 0xB9A0, 0x1EEF,
- 0xB9A1, 0xB9FE, 0x06FA, 0xBA40, 0xBA41, 0x420E, 0xBA42, 0xBA42, 0x22A4,
- 0xBA43, 0xBA43, 0x4210, 0xBA44, 0xBA44, 0x25E8, 0xBA45, 0xBA55, 0x4211,
- 0xBA56, 0xBA56, 0x25E3, 0xBA57, 0xBA58, 0x4222, 0xBA59, 0xBA59, 0x2111,
- 0xBA5A, 0xBA5F, 0x4224, 0xBA60, 0xBA60, 0x25E6, 0xBA61, 0xBA69, 0x422A,
- 0xBA6A, 0xBA6A, 0x25E7, 0xBA6B, 0xBA73, 0x4233, 0xBA74, 0xBA74, 0x2041,
- 0xBA75, 0xBA7E, 0x423C, 0xBA80, 0xBA83, 0x4246, 0xBA84, 0xBA84, 0x25EA,
- 0xBA85, 0xBA85, 0x424A, 0xBA86, 0xBA86, 0x1F8F, 0xBA87, 0xBA87, 0x424B,
- 0xBA88, 0xBA88, 0x25EC, 0xBA89, 0xBA8C, 0x424C, 0xBA8D, 0xBA8D, 0x25EB,
- 0xBA8E, 0xBA9D, 0x4250, 0xBA9E, 0xBA9E, 0x20D0, 0xBA9F, 0xBA9F, 0x201D,
- 0xBAA0, 0xBAA0, 0x4260, 0xBAA1, 0xBAFE, 0x0758, 0xBB40, 0xBB40, 0x1FF7,
- 0xBB41, 0xBB48, 0x4261, 0xBB49, 0xBB49, 0x1E8D, 0xBB4A, 0xBB57, 0x4269,
- 0xBB58, 0xBB58, 0x25E9, 0xBB59, 0xBB5A, 0x4277, 0xBB5B, 0xBB5B, 0x25EE,
- 0xBB5C, 0xBB5C, 0x203A, 0xBB5D, 0xBB5F, 0x4279, 0xBB60, 0xBB60, 0x2693,
- 0xBB61, 0xBB64, 0x427C, 0xBB65, 0xBB65, 0x25E5, 0xBB66, 0xBB66, 0x25ED,
- 0xBB67, 0xBB67, 0x4280, 0xBB68, 0xBB68, 0x2009, 0xBB69, 0xBB69, 0x4281,
- 0xBB6A, 0xBB6A, 0x2065, 0xBB6B, 0xBB6D, 0x4282, 0xBB6E, 0xBB6E, 0x26A3,
- 0xBB6F, 0xBB7E, 0x4285, 0xBB80, 0xBBA0, 0x4295, 0xBBA1, 0xBBFE, 0x07B6,
- 0xBC40, 0xBC51, 0x42B6, 0xBC52, 0xBC52, 0x25F5, 0xBC53, 0xBC53, 0x1EFC,
- 0xBC54, 0xBC59, 0x42C8, 0xBC5A, 0xBC5A, 0x2024, 0xBC5B, 0xBC60, 0x42CE,
- 0xBC61, 0xBC61, 0x269B, 0xBC62, 0xBC62, 0x42D4, 0xBC63, 0xBC63, 0x25F3,
- 0xBC64, 0xBC64, 0x42D5, 0xBC65, 0xBC65, 0x22D9, 0xBC66, 0xBC66, 0x42D6,
- 0xBC67, 0xBC67, 0x25F4, 0xBC68, 0xBC68, 0x42D7, 0xBC69, 0xBC69, 0x241B,
- 0xBC6A, 0xBC6C, 0x42D8, 0xBC6D, 0xBC6D, 0x1FC8, 0xBC6E, 0xBC6E, 0x42DB,
- 0xBC6F, 0xBC6F, 0x1F7B, 0xBC70, 0xBC70, 0x42DC, 0xBC71, 0xBC71, 0x241D,
- 0xBC72, 0xBC72, 0x42DD, 0xBC73, 0xBC73, 0x224C, 0xBC74, 0xBC74, 0x1F48,
- 0xBC75, 0xBC75, 0x241C, 0xBC76, 0xBC77, 0x241E, 0xBC78, 0xBC78, 0x20FF,
- 0xBC79, 0xBC79, 0x219A, 0xBC7A, 0xBC7A, 0x42DE, 0xBC7B, 0xBC7B, 0x2091,
- 0xBC7C, 0xBC7D, 0x42DF, 0xBC7E, 0xBC7E, 0x20A7, 0xBC80, 0xBC81, 0x42E1,
- 0xBC82, 0xBC82, 0x2423, 0xBC83, 0xBC83, 0x1E9B, 0xBC84, 0xBC84, 0x2422,
- 0xBC85, 0xBC85, 0x42E3, 0xBC86, 0xBC86, 0x2110, 0xBC87, 0xBC87, 0x42E4,
- 0xBC88, 0xBC88, 0x228D, 0xBC89, 0xBC89, 0x1F71, 0xBC8A, 0xBC8A, 0x1EF8,
- 0xBC8B, 0xBC8B, 0x2421, 0xBC8C, 0xBC8E, 0x42E5, 0xBC8F, 0xBC8F, 0x1EF3,
- 0xBC90, 0xBC99, 0x42E8, 0xBC9A, 0xBC9A, 0x21B1, 0xBC9B, 0xBC9B, 0x2426,
- 0xBC9C, 0xBC9C, 0x2425, 0xBC9D, 0xBC9D, 0x2120, 0xBC9E, 0xBCA0, 0x42F2,
- 0xBCA1, 0xBCFE, 0x0814, 0xBD40, 0xBD41, 0x42F5, 0xBD42, 0xBD42, 0x211A,
- 0xBD43, 0xBD43, 0x2424, 0xBD44, 0xBD44, 0x42F7, 0xBD45, 0xBD45, 0x2428,
- 0xBD46, 0xBD47, 0x42F8, 0xBD48, 0xBD48, 0x242A, 0xBD49, 0xBD49, 0x2429,
- 0xBD4A, 0xBD4A, 0x42FA, 0xBD4B, 0xBD4B, 0x2294, 0xBD4C, 0xBD4C, 0x42FB,
- 0xBD4D, 0xBD4D, 0x22BE, 0xBD4E, 0xBD4E, 0x42FC, 0xBD4F, 0xBD4F, 0x1E31,
- 0xBD50, 0xBD56, 0x42FD, 0xBD57, 0xBD57, 0x242C, 0xBD58, 0xBD58, 0x4304,
- 0xBD59, 0xBD59, 0x1FB5, 0xBD5A, 0xBD65, 0x4305, 0xBD66, 0xBD66, 0x242B,
- 0xBD67, 0xBD67, 0x1FAF, 0xBD68, 0xBD69, 0x4311, 0xBD6A, 0xBD6A, 0x2068,
- 0xBD6B, 0xBD6B, 0x21E4, 0xBD6C, 0xBD6E, 0x4313, 0xBD6F, 0xBD6F, 0x1F21,
- 0xBD70, 0xBD70, 0x4316, 0xBD71, 0xBD71, 0x2101, 0xBD72, 0xBD78, 0x4317,
- 0xBD79, 0xBD79, 0x217C, 0xBD7A, 0xBD7A, 0x214A, 0xBD7B, 0xBD7B, 0x242D,
- 0xBD7C, 0xBD7D, 0x431E, 0xBD7E, 0xBD7E, 0x1FD4, 0xBD80, 0xBD80, 0x4320,
- 0xBD81, 0xBD81, 0x1FD1, 0xBD82, 0xBD88, 0x4321, 0xBD89, 0xBD89, 0x1E33,
- 0xBD8A, 0xBD8A, 0x4328, 0xBD8B, 0xBD8B, 0x242F, 0xBD8C, 0xBD8D, 0x4329,
- 0xBD8E, 0xBD8E, 0x242E, 0xBD8F, 0xBD8F, 0x432B, 0xBD90, 0xBD90, 0x2430,
- 0xBD91, 0xBD91, 0x21DB, 0xBD92, 0xBD96, 0x432C, 0xBD97, 0xBD97, 0x2158,
- 0xBD98, 0xBD9A, 0x4331, 0xBD9B, 0xBD9B, 0x1FC2, 0xBD9C, 0xBDA0, 0x4334,
- 0xBDA1, 0xBDFE, 0x0872, 0xBE40, 0xBE42, 0x4339, 0xBE43, 0xBE43, 0x22B9,
- 0xBE44, 0xBE44, 0x433C, 0xBE45, 0xBE45, 0x2436, 0xBE46, 0xBE48, 0x433D,
- 0xBE49, 0xBE49, 0x1E8E, 0xBE4A, 0xBE4A, 0x2439, 0xBE4B, 0xBE50, 0x4340,
- 0xBE51, 0xBE51, 0x21C5, 0xBE52, 0xBE52, 0x2437, 0xBE53, 0xBE53, 0x2192,
- 0xBE54, 0xBE54, 0x4346, 0xBE55, 0xBE55, 0x243A, 0xBE56, 0xBE56, 0x1F19,
- 0xBE57, 0xBE57, 0x218C, 0xBE58, 0xBE58, 0x1E40, 0xBE59, 0xBE59, 0x22B3,
- 0xBE5A, 0xBE5C, 0x4347, 0xBE5D, 0xBE5D, 0x205F, 0xBE5E, 0xBE5E, 0x2438,
- 0xBE5F, 0xBE5F, 0x2432, 0xBE60, 0xBE60, 0x2274, 0xBE61, 0xBE61, 0x434A,
- 0xBE62, 0xBE62, 0x1E9C, 0xBE63, 0xBE63, 0x2431, 0xBE64, 0xBE64, 0x2085,
- 0xBE65, 0xBE68, 0x434B, 0xBE69, 0xBE69, 0x2435, 0xBE6A, 0xBE6B, 0x434F,
- 0xBE6C, 0xBE6C, 0x243B, 0xBE6D, 0xBE6E, 0x4351, 0xBE6F, 0xBE6F, 0x1FB7,
- 0xBE70, 0xBE70, 0x2433, 0xBE71, 0xBE75, 0x4353, 0xBE76, 0xBE76, 0x2054,
- 0xBE77, 0xBE77, 0x21DE, 0xBE78, 0xBE78, 0x4358, 0xBE79, 0xBE79, 0x2434,
- 0xBE7A, 0xBE7B, 0x4359, 0xBE7C, 0xBE7C, 0x243D, 0xBE7D, 0xBE7D, 0x1F89,
- 0xBE7E, 0xBE7E, 0x243C, 0xBE80, 0xBE82, 0x435B, 0xBE83, 0xBE83, 0x1F6E,
- 0xBE84, 0xBE84, 0x1ED8, 0xBE85, 0xBE85, 0x435E, 0xBE86, 0xBE86, 0x1EBF,
- 0xBE87, 0xBE87, 0x2445, 0xBE88, 0xBE88, 0x435F, 0xBE89, 0xBE89, 0x2249,
- 0xBE8A, 0xBE8B, 0x4360, 0xBE8C, 0xBE8C, 0x2441, 0xBE8D, 0xBE8D, 0x4362,
- 0xBE8E, 0xBE8E, 0x1E47, 0xBE8F, 0xBE8F, 0x1F56, 0xBE90, 0xBE91, 0x4363,
- 0xBE92, 0xBE92, 0x2086, 0xBE93, 0xBE94, 0x4365, 0xBE95, 0xBE95, 0x2196,
- 0xBE96, 0xBE96, 0x4367, 0xBE97, 0xBE97, 0x2443, 0xBE98, 0xBE98, 0x243F,
- 0xBE99, 0xBE99, 0x4368, 0xBE9A, 0xBE9A, 0x2023, 0xBE9B, 0xBE9B, 0x4369,
- 0xBE9C, 0xBE9C, 0x2442, 0xBE9D, 0xBE9E, 0x436A, 0xBE9F, 0xBE9F, 0x243E,
- 0xBEA0, 0xBEA0, 0x436C, 0xBEA1, 0xBEFE, 0x08D0, 0xBF40, 0xBF40, 0x26A6,
- 0xBF41, 0xBF4C, 0x436D, 0xBF4D, 0xBF4D, 0x234E, 0xBF4E, 0xBF4E, 0x2446,
- 0xBF4F, 0xBF4F, 0x244B, 0xBF50, 0xBF50, 0x2444, 0xBF51, 0xBF54, 0x4379,
- 0xBF55, 0xBF55, 0x2427, 0xBF56, 0xBF56, 0x244C, 0xBF57, 0xBF5F, 0x437D,
- 0xBF60, 0xBF60, 0x1F0F, 0xBF61, 0xBF61, 0x4386, 0xBF62, 0xBF62, 0x2447,
- 0xBF63, 0xBF63, 0x2449, 0xBF64, 0xBF64, 0x2448, 0xBF65, 0xBF67, 0x4387,
- 0xBF68, 0xBF68, 0x21C2, 0xBF69, 0xBF6B, 0x438A, 0xBF6C, 0xBF6C, 0x216E,
- 0xBF6D, 0xBF6F, 0x438D, 0xBF70, 0xBF70, 0x1F03, 0xBF71, 0xBF71, 0x4390,
- 0xBF72, 0xBF72, 0x244A, 0xBF73, 0xBF73, 0x215C, 0xBF74, 0xBF75, 0x4391,
- 0xBF76, 0xBF76, 0x22BB, 0xBF77, 0xBF77, 0x2450, 0xBF78, 0xBF78, 0x4393,
- 0xBF79, 0xBF79, 0x2694, 0xBF7A, 0xBF7A, 0x244F, 0xBF7B, 0xBF7B, 0x25F6,
- 0xBF7C, 0xBF7C, 0x2051, 0xBF7D, 0xBF7D, 0x4394, 0xBF7E, 0xBF7E, 0x244E,
- 0xBF80, 0xBF81, 0x4395, 0xBF82, 0xBF82, 0x22BA, 0xBF83, 0xBF83, 0x1F6D,
- 0xBF84, 0xBF88, 0x4397, 0xBF89, 0xBF89, 0x2452, 0xBF8A, 0xBF8A, 0x2451,
- 0xBF8B, 0xBF94, 0x439C, 0xBF95, 0xBF95, 0x2455, 0xBF96, 0xBF96, 0x43A6,
- 0xBF97, 0xBF97, 0x2289, 0xBF98, 0xBF98, 0x2116, 0xBF99, 0xBF9C, 0x43A7,
- 0xBF9D, 0xBF9D, 0x2454, 0xBF9E, 0xBFA0, 0x43AB, 0xBFA1, 0xBFFE, 0x092E,
- 0xC040, 0xC040, 0x20FB, 0xC041, 0xC043, 0x43AE, 0xC044, 0xC044, 0x2440,
- 0xC045, 0xC04A, 0x43B1, 0xC04B, 0xC04B, 0x2126, 0xC04C, 0xC04C, 0x1F61,
- 0xC04D, 0xC04D, 0x269D, 0xC04E, 0xC04E, 0x43B7, 0xC04F, 0xC04F, 0x1F8A,
- 0xC050, 0xC050, 0x2456, 0xC051, 0xC051, 0x2459, 0xC052, 0xC052, 0x2458,
- 0xC053, 0xC054, 0x43B8, 0xC055, 0xC055, 0x1FAE, 0xC056, 0xC05A, 0x43BA,
- 0xC05B, 0xC05B, 0x221A, 0xC05C, 0xC05D, 0x43BF, 0xC05E, 0xC05E, 0x1F7A,
- 0xC05F, 0xC05F, 0x244D, 0xC060, 0xC060, 0x2457, 0xC061, 0xC068, 0x43C1,
- 0xC069, 0xC069, 0x2453, 0xC06A, 0xC06A, 0x43C9, 0xC06B, 0xC06B, 0x2420,
- 0xC06C, 0xC06C, 0x43CA, 0xC06D, 0xC06D, 0x21DF, 0xC06E, 0xC06E, 0x2685,
- 0xC06F, 0xC06F, 0x43CB, 0xC070, 0xC070, 0x1E6E, 0xC071, 0xC073, 0x43CC,
- 0xC074, 0xC074, 0x2224, 0xC075, 0xC075, 0x2670, 0xC076, 0xC076, 0x43CF,
- 0xC077, 0xC077, 0x21BA, 0xC078, 0xC078, 0x43D0, 0xC079, 0xC079, 0x245A,
- 0xC07A, 0xC07B, 0x43D1, 0xC07C, 0xC07C, 0x1FFF, 0xC07D, 0xC07E, 0x43D3,
- 0xC080, 0xC09A, 0x43D5, 0xC09B, 0xC09B, 0x25E2, 0xC09C, 0xC09C, 0x43F0,
- 0xC09D, 0xC09D, 0x269A, 0xC09E, 0xC0A0, 0x43F1, 0xC0A1, 0xC0FE, 0x098C,
- 0xC140, 0xC14F, 0x43F4, 0xC150, 0xC150, 0x1EEA, 0xC151, 0xC153, 0x4404,
- 0xC154, 0xC154, 0x1E2C, 0xC155, 0xC15E, 0x4407, 0xC15F, 0xC15F, 0x2062,
- 0xC160, 0xC160, 0x24F1, 0xC161, 0xC161, 0x4411, 0xC162, 0xC162, 0x24F2,
- 0xC163, 0xC174, 0x4412, 0xC175, 0xC175, 0x25F2, 0xC176, 0xC177, 0x4424,
- 0xC178, 0xC178, 0x2215, 0xC179, 0xC17E, 0x4426, 0xC180, 0xC194, 0x442C,
- 0xC195, 0xC195, 0x21AE, 0xC196, 0xC1A0, 0x4441, 0xC1A1, 0xC1FE, 0x09EA,
- 0xC240, 0xC24D, 0x444C, 0xC24E, 0xC24E, 0x20E0, 0xC24F, 0xC264, 0x445A,
- 0xC265, 0xC265, 0x25C2, 0xC266, 0xC266, 0x4470, 0xC267, 0xC267, 0x25C1,
- 0xC268, 0xC27C, 0x4471, 0xC27D, 0xC27D, 0x2128, 0xC27E, 0xC27E, 0x4486,
- 0xC280, 0xC283, 0x4487, 0xC284, 0xC284, 0x2199, 0xC285, 0xC292, 0x448B,
- 0xC293, 0xC293, 0x2017, 0xC294, 0xC294, 0x1EA0, 0xC295, 0xC295, 0x2125,
- 0xC296, 0xC296, 0x214D, 0xC297, 0xC297, 0x4499, 0xC298, 0xC298, 0x25C4,
- 0xC299, 0xC299, 0x209D, 0xC29A, 0xC29A, 0x228A, 0xC29B, 0xC29B, 0x449A,
- 0xC29C, 0xC29C, 0x25C3, 0xC29D, 0xC29F, 0x449B, 0xC2A0, 0xC2A0, 0x2179,
- 0xC2A1, 0xC2FE, 0x0A48, 0xC340, 0xC340, 0x2038, 0xC341, 0xC342, 0x449E,
- 0xC343, 0xC343, 0x2155, 0xC344, 0xC37A, 0x44A0, 0xC37B, 0xC37B, 0x21D2,
- 0xC37C, 0xC37E, 0x44D7, 0xC380, 0xC383, 0x44DA, 0xC384, 0xC384, 0x24C7,
- 0xC385, 0xC39A, 0x44DE, 0xC39B, 0xC39B, 0x2279, 0xC39C, 0xC3A0, 0x44F4,
- 0xC3A1, 0xC3FE, 0x0AA6, 0xC440, 0xC448, 0x44F9, 0xC449, 0xC449, 0x2123,
- 0xC44A, 0xC44B, 0x4502, 0xC44C, 0xC44C, 0x24C5, 0xC44D, 0xC453, 0x4504,
- 0xC454, 0xC454, 0x24C9, 0xC455, 0xC457, 0x450B, 0xC458, 0xC458, 0x2094,
- 0xC459, 0xC45A, 0x450E, 0xC45B, 0xC45B, 0x2296, 0xC45C, 0xC462, 0x4510,
- 0xC463, 0xC463, 0x1E77, 0xC464, 0xC476, 0x4517, 0xC477, 0xC477, 0x1F06,
- 0xC478, 0xC479, 0x452A, 0xC47A, 0xC47A, 0x1FA5, 0xC47B, 0xC47E, 0x452C,
- 0xC480, 0xC480, 0x4530, 0xC481, 0xC481, 0x2099, 0xC482, 0xC490, 0x4531,
- 0xC491, 0xC491, 0x1EAD, 0xC492, 0xC492, 0x24C8, 0xC493, 0xC493, 0x20A8,
- 0xC494, 0xC497, 0x4540, 0xC498, 0xC498, 0x201F, 0xC499, 0xC499, 0x4544,
- 0xC49A, 0xC49A, 0x20C5, 0xC49B, 0xC49B, 0x4545, 0xC49C, 0xC49C, 0x24CA,
- 0xC49D, 0xC4A0, 0x4546, 0xC4A1, 0xC4FE, 0x0B04, 0xC540, 0xC543, 0x454A,
- 0xC544, 0xC544, 0x1FF0, 0xC545, 0xC545, 0x454E, 0xC546, 0xC546, 0x24C6,
- 0xC547, 0xC54A, 0x454F, 0xC54B, 0xC54B, 0x225D, 0xC54C, 0xC54C, 0x22DE,
- 0xC54D, 0xC551, 0x4553, 0xC552, 0xC552, 0x202C, 0xC553, 0xC55E, 0x4558,
- 0xC55F, 0xC55F, 0x2161, 0xC560, 0xC562, 0x4564, 0xC563, 0xC563, 0x223B,
- 0xC564, 0xC564, 0x21D9, 0xC565, 0xC565, 0x1FCB, 0xC566, 0xC566, 0x1FC9,
- 0xC567, 0xC57E, 0x4567, 0xC580, 0xC592, 0x457F, 0xC593, 0xC593, 0x1E61,
- 0xC594, 0xC59B, 0x4592, 0xC59C, 0xC59C, 0x25EF, 0xC59D, 0xC59D, 0x459A,
- 0xC59E, 0xC59E, 0x1F98, 0xC59F, 0xC5A0, 0x459B, 0xC5A1, 0xC5FE, 0x0B62,
- 0xC640, 0xC640, 0x459D, 0xC641, 0xC641, 0x25F0, 0xC642, 0xC643, 0x459E,
- 0xC644, 0xC644, 0x1F88, 0xC645, 0xC646, 0x45A0, 0xC647, 0xC647, 0x21F8,
- 0xC648, 0xC662, 0x45A2, 0xC663, 0xC663, 0x2322, 0xC664, 0xC671, 0x45BD,
- 0xC672, 0xC672, 0x2336, 0xC673, 0xC67E, 0x45CB, 0xC680, 0xC6A0, 0x45D7,
- 0xC6A1, 0xC6FE, 0x0BC0, 0xC740, 0xC765, 0x45F8, 0xC766, 0xC766, 0x22AB,
- 0xC767, 0xC76E, 0x461E, 0xC76F, 0xC76F, 0x1FBF, 0xC770, 0xC775, 0x4626,
- 0xC776, 0xC776, 0x1F7D, 0xC777, 0xC77A, 0x462C, 0xC77B, 0xC77B, 0x2333,
- 0xC77C, 0xC77E, 0x4630, 0xC780, 0xC7A0, 0x4633, 0xC7A1, 0xC7FE, 0x0C1E,
- 0xC840, 0xC840, 0x4654, 0xC841, 0xC841, 0x1F4D, 0xC842, 0xC84E, 0x4655,
- 0xC84F, 0xC84F, 0x2334, 0xC850, 0xC851, 0x4662, 0xC852, 0xC852, 0x1FF1,
- 0xC853, 0xC865, 0x4664, 0xC866, 0xC866, 0x218B, 0xC867, 0xC86D, 0x4677,
- 0xC86E, 0xC86E, 0x2349, 0xC86F, 0xC87D, 0x467E, 0xC87E, 0xC87E, 0x220B,
- 0xC880, 0xC886, 0x468D, 0xC887, 0xC887, 0x2346, 0xC888, 0xC891, 0x4694,
- 0xC892, 0xC892, 0x2347, 0xC893, 0xC893, 0x469E, 0xC894, 0xC894, 0x2193,
- 0xC895, 0xC898, 0x469F, 0xC899, 0xC899, 0x26A1, 0xC89A, 0xC89C, 0x46A3,
- 0xC89D, 0xC89D, 0x1F62, 0xC89E, 0xC8A0, 0x46A6, 0xC8A1, 0xC8FE, 0x0C7C,
- 0xC940, 0xC94E, 0x46A9, 0xC94F, 0xC94F, 0x234D, 0xC950, 0xC950, 0x2348,
- 0xC951, 0xC96D, 0x46B8, 0xC96E, 0xC96E, 0x1E60, 0xC96F, 0xC96F, 0x46D5,
- 0xC970, 0xC970, 0x2345, 0xC971, 0xC976, 0x46D6, 0xC977, 0xC977, 0x1F12,
- 0xC978, 0xC97E, 0x46DC, 0xC980, 0xC98E, 0x46E3, 0xC98F, 0xC98F, 0x2018,
- 0xC990, 0xC990, 0x2335, 0xC991, 0xC99B, 0x46F2, 0xC99C, 0xC99C, 0x233C,
- 0xC99D, 0xC9A0, 0x46FD, 0xC9A1, 0xC9FE, 0x0CDA, 0xCA40, 0xCA4D, 0x4701,
- 0xCA4E, 0xCA4E, 0x266F, 0xCA4F, 0xCA55, 0x470F, 0xCA56, 0xCA56, 0x2351,
- 0xCA57, 0xCA58, 0x4716, 0xCA59, 0xCA59, 0x1FA0, 0xCA5A, 0xCA5B, 0x4718,
- 0xCA5C, 0xCA5C, 0x2338, 0xCA5D, 0xCA60, 0x471A, 0xCA61, 0xCA61, 0x221B,
- 0xCA62, 0xCA6D, 0x471E, 0xCA6E, 0xCA6E, 0x2342, 0xCA6F, 0xCA71, 0x472A,
- 0xCA72, 0xCA72, 0x234F, 0xCA73, 0xCA76, 0x472D, 0xCA77, 0xCA77, 0x233D,
- 0xCA78, 0xCA7A, 0x4731, 0xCA7B, 0xCA7B, 0x2344, 0xCA7C, 0xCA7C, 0x2331,
- 0xCA7D, 0xCA7D, 0x4734, 0xCA7E, 0xCA7E, 0x234B, 0xCA80, 0xCA80, 0x4735,
- 0xCA81, 0xCA81, 0x233B, 0xCA82, 0xCA88, 0x4736, 0xCA89, 0xCA89, 0x2350,
- 0xCA8A, 0xCA8D, 0x473D, 0xCA8E, 0xCA8E, 0x1EB4, 0xCA8F, 0xCA8F, 0x21A6,
- 0xCA90, 0xCA91, 0x4741, 0xCA92, 0xCA92, 0x21CB, 0xCA93, 0xCA99, 0x4743,
- 0xCA9A, 0xCA9A, 0x2355, 0xCA9B, 0xCAA0, 0x474A, 0xCAA1, 0xCAFE, 0x0D38,
- 0xCB40, 0xCB42, 0x4750, 0xCB43, 0xCB43, 0x233E, 0xCB44, 0xCB44, 0x4753,
- 0xCB45, 0xCB45, 0x1F74, 0xCB46, 0xCB46, 0x4754, 0xCB47, 0xCB47, 0x2330,
- 0xCB48, 0xCB4A, 0x4755, 0xCB4B, 0xCB4B, 0x2680, 0xCB4C, 0xCB4D, 0x4758,
- 0xCB4E, 0xCB4E, 0x20DA, 0xCB4F, 0xCB56, 0x475A, 0xCB57, 0xCB57, 0x234A,
- 0xCB58, 0xCB5C, 0x4762, 0xCB5D, 0xCB5D, 0x1F91, 0xCB5E, 0xCB5E, 0x4767,
- 0xCB5F, 0xCB5F, 0x2107, 0xCB60, 0xCB69, 0x4768, 0xCB6A, 0xCB6A, 0x233F,
- 0xCB6B, 0xCB7A, 0x4772, 0xCB7B, 0xCB7B, 0x1FF4, 0xCB7C, 0xCB7C, 0x2343,
- 0xCB7D, 0xCB7E, 0x4782, 0xCB80, 0xCB86, 0x4784, 0xCB87, 0xCB87, 0x2212,
- 0xCB88, 0xCB8D, 0x478B, 0xCB8E, 0xCB8E, 0x2207, 0xCB8F, 0xCB91, 0x4791,
- 0xCB92, 0xCB92, 0x2359, 0xCB93, 0xCB9B, 0x4794, 0xCB9C, 0xCB9C, 0x2254,
- 0xCB9D, 0xCB9D, 0x479D, 0xCB9E, 0xCB9E, 0x2332, 0xCB9F, 0xCBA0, 0x479E,
- 0xCBA1, 0xCBFE, 0x0D96, 0xCC40, 0xCC40, 0x1E26, 0xCC41, 0xCC41, 0x2357,
- 0xCC42, 0xCC48, 0x47A0, 0xCC49, 0xCC49, 0x2358, 0xCC4A, 0xCC4A, 0x2042,
- 0xCC4B, 0xCC4B, 0x2153, 0xCC4C, 0xCC4E, 0x47A7, 0xCC4F, 0xCC4F, 0x20BB,
- 0xCC50, 0xCC5B, 0x47AA, 0xCC5C, 0xCC5C, 0x235A, 0xCC5D, 0xCC5F, 0x47B6,
- 0xCC60, 0xCC60, 0x2356, 0xCC61, 0xCC63, 0x47B9, 0xCC64, 0xCC64, 0x2337,
- 0xCC65, 0xCC6C, 0x47BC, 0xCC6D, 0xCC6D, 0x1FF9, 0xCC6E, 0xCC78, 0x47C4,
- 0xCC79, 0xCC79, 0x2353, 0xCC7A, 0xCC7C, 0x47CF, 0xCC7D, 0xCC7D, 0x2061,
- 0xCC7E, 0xCC7E, 0x47D2, 0xCC80, 0xCC8D, 0x47D3, 0xCC8E, 0xCC8E, 0x1E95,
- 0xCC8F, 0xCC93, 0x47E1, 0xCC94, 0xCC94, 0x2049, 0xCC95, 0xCC95, 0x47E6,
- 0xCC96, 0xCC96, 0x1F42, 0xCC97, 0xCC9C, 0x47E7, 0xCC9D, 0xCC9D, 0x1FE8,
- 0xCC9E, 0xCCA0, 0x47ED, 0xCCA1, 0xCCFE, 0x0DF4, 0xCD40, 0xCD7E, 0x47F0,
- 0xCD80, 0xCD8F, 0x482F, 0xCD90, 0xCD90, 0x25DA, 0xCD91, 0xCD97, 0x483F,
- 0xCD98, 0xCD98, 0x25D7, 0xCD99, 0xCDA0, 0x4846, 0xCDA1, 0xCDFE, 0x0E52,
- 0xCE40, 0xCE66, 0x484E, 0xCE67, 0xCE67, 0x212E, 0xCE68, 0xCE71, 0x4875,
- 0xCE72, 0xCE72, 0x21B2, 0xCE73, 0xCE7E, 0x487F, 0xCE80, 0xCE80, 0x488B,
- 0xCE81, 0xCE81, 0x219E, 0xCE82, 0xCE86, 0x488C, 0xCE87, 0xCE87, 0x25DC,
- 0xCE88, 0xCE9A, 0x4891, 0xCE9B, 0xCE9B, 0x206C, 0xCE9C, 0xCE9D, 0x48A4,
- 0xCE9E, 0xCE9E, 0x2226, 0xCE9F, 0xCEA0, 0x48A6, 0xCEA1, 0xCEFE, 0x0EB0,
- 0xCF40, 0xCF4D, 0x48A8, 0xCF4E, 0xCF4E, 0x25E0, 0xCF4F, 0xCF54, 0x48B6,
- 0xCF55, 0xCF55, 0x227B, 0xCF56, 0xCF57, 0x48BC, 0xCF58, 0xCF58, 0x25DE,
- 0xCF59, 0xCF5B, 0x48BE, 0xCF5C, 0xCF5C, 0x25E1, 0xCF5D, 0xCF6B, 0x48C1,
- 0xCF6C, 0xCF6C, 0x25D5, 0xCF6D, 0xCF72, 0x48D0, 0xCF73, 0xCF73, 0x1E6B,
- 0xCF74, 0xCF74, 0x48D6, 0xCF75, 0xCF75, 0x25DB, 0xCF76, 0xCF77, 0x48D7,
- 0xCF78, 0xCF78, 0x1E89, 0xCF79, 0xCF7B, 0x48D9, 0xCF7C, 0xCF7C, 0x25D9,
- 0xCF7D, 0xCF7E, 0x48DC, 0xCF80, 0xCF80, 0x48DE, 0xCF81, 0xCF81, 0x2211,
- 0xCF82, 0xCF88, 0x48DF, 0xCF89, 0xCF89, 0x2229, 0xCF8A, 0xCF8A, 0x25D6,
- 0xCF8B, 0xCF92, 0x48E6, 0xCF93, 0xCF93, 0x25DD, 0xCF94, 0xCF94, 0x25DF,
- 0xCF95, 0xCF9D, 0x48EE, 0xCF9E, 0xCF9E, 0x1FEF, 0xCF9F, 0xCF9F, 0x48F7,
- 0xCFA0, 0xCFA0, 0x25D8, 0xCFA1, 0xCFFE, 0x0F0E, 0xD040, 0xD04C, 0x48F8,
- 0xD04D, 0xD04D, 0x1F29, 0xD04E, 0xD050, 0x4905, 0xD051, 0xD051, 0x1E5B,
- 0xD052, 0xD054, 0x4908, 0xD055, 0xD055, 0x2076, 0xD056, 0xD05B, 0x490B,
- 0xD05C, 0xD05C, 0x2297, 0xD05D, 0xD05F, 0x4911, 0xD060, 0xD060, 0x2690,
- 0xD061, 0xD066, 0x4914, 0xD067, 0xD067, 0x213F, 0xD068, 0xD06B, 0x491A,
- 0xD06C, 0xD06C, 0x2198, 0xD06D, 0xD06D, 0x491E, 0xD06E, 0xD06E, 0x1E88,
- 0xD06F, 0xD07C, 0x491F, 0xD07D, 0xD07D, 0x228C, 0xD07E, 0xD07E, 0x492D,
- 0xD080, 0xD0A0, 0x492E, 0xD0A1, 0xD0FE, 0x0F6C, 0xD140, 0xD154, 0x494F,
- 0xD155, 0xD155, 0x25F1, 0xD156, 0xD158, 0x4964, 0xD159, 0xD159, 0x200C,
- 0xD15A, 0xD160, 0x4967, 0xD161, 0xD161, 0x1E58, 0xD162, 0xD162, 0x22AC,
- 0xD163, 0xD174, 0x496E, 0xD175, 0xD175, 0x26A7, 0xD176, 0xD17C, 0x4980,
- 0xD17D, 0xD17D, 0x2676, 0xD17E, 0xD17E, 0x4987, 0xD180, 0xD19C, 0x4988,
- 0xD19D, 0xD19D, 0x1FE1, 0xD19E, 0xD19E, 0x25BB, 0xD19F, 0xD1A0, 0x49A5,
- 0xD1A1, 0xD1FE, 0x0FCA, 0xD240, 0xD240, 0x25BE, 0xD241, 0xD242, 0x49A7,
- 0xD243, 0xD243, 0x22DD, 0xD244, 0xD24C, 0x49A9, 0xD24D, 0xD24D, 0x25BD,
- 0xD24E, 0xD25B, 0x49B2, 0xD25C, 0xD25C, 0x1E2A, 0xD25D, 0xD262, 0x49C0,
- 0xD263, 0xD263, 0x25BC, 0xD264, 0xD264, 0x25BA, 0xD265, 0xD267, 0x49C6,
- 0xD268, 0xD268, 0x25BF, 0xD269, 0xD26C, 0x49C9, 0xD26D, 0xD26D, 0x2187,
- 0xD26E, 0xD26E, 0x49CD, 0xD26F, 0xD26F, 0x266B, 0xD270, 0xD271, 0x49CE,
- 0xD272, 0xD272, 0x1E7F, 0xD273, 0xD274, 0x49D0, 0xD275, 0xD275, 0x21AD,
- 0xD276, 0xD27E, 0x49D2, 0xD280, 0xD289, 0x49DB, 0xD28A, 0xD28A, 0x1F96,
- 0xD28B, 0xD28D, 0x49E5, 0xD28E, 0xD28E, 0x1F32, 0xD28F, 0xD291, 0x49E8,
- 0xD292, 0xD292, 0x2084, 0xD293, 0xD294, 0x49EB, 0xD295, 0xD295, 0x2136,
- 0xD296, 0xD296, 0x49ED, 0xD297, 0xD297, 0x24B8, 0xD298, 0xD29F, 0x49EE,
- 0xD2A0, 0xD2A0, 0x24BA, 0xD2A1, 0xD2FE, 0x1028, 0xD340, 0xD343, 0x49F6,
- 0xD344, 0xD344, 0x24BC, 0xD345, 0xD347, 0x49FA, 0xD348, 0xD348, 0x20E4,
- 0xD349, 0xD349, 0x49FD, 0xD34A, 0xD34A, 0x24B9, 0xD34B, 0xD34C, 0x49FE,
- 0xD34D, 0xD34D, 0x24BD, 0xD34E, 0xD34F, 0x4A00, 0xD350, 0xD350, 0x24BE,
- 0xD351, 0xD354, 0x4A02, 0xD355, 0xD355, 0x24BF, 0xD356, 0xD357, 0x4A06,
- 0xD358, 0xD358, 0x1FD2, 0xD359, 0xD35A, 0x4A08, 0xD35B, 0xD35B, 0x1FFD,
- 0xD35C, 0xD35C, 0x4A0A, 0xD35D, 0xD35D, 0x24BB, 0xD35E, 0xD35E, 0x1F2D,
- 0xD35F, 0xD377, 0x4A0B, 0xD378, 0xD378, 0x2609, 0xD379, 0xD379, 0x4A24,
- 0xD37A, 0xD37A, 0x260A, 0xD37B, 0xD37B, 0x4A25, 0xD37C, 0xD37C, 0x1E94,
- 0xD37D, 0xD37E, 0x4A26, 0xD380, 0xD384, 0x4A28, 0xD385, 0xD385, 0x22DF,
- 0xD386, 0xD386, 0x1ECB, 0xD387, 0xD387, 0x1F0D, 0xD388, 0xD38A, 0x4A2D,
- 0xD38B, 0xD38B, 0x1F77, 0xD38C, 0xD38C, 0x4A30, 0xD38D, 0xD38D, 0x21EB,
- 0xD38E, 0xD38E, 0x4A31, 0xD38F, 0xD38F, 0x22E1, 0xD390, 0xD390, 0x4A32,
- 0xD391, 0xD391, 0x216F, 0xD392, 0xD392, 0x4A33, 0xD393, 0xD393, 0x22E0,
- 0xD394, 0xD395, 0x4A34, 0xD396, 0xD396, 0x21EA, 0xD397, 0xD397, 0x4A36,
- 0xD398, 0xD398, 0x22E2, 0xD399, 0xD399, 0x20CB, 0xD39A, 0xD39A, 0x4A37,
- 0xD39B, 0xD39B, 0x1F78, 0xD39C, 0xD39D, 0x4A38, 0xD39E, 0xD39E, 0x1EE2,
- 0xD39F, 0xD39F, 0x4A3A, 0xD3A0, 0xD3A0, 0x21F2, 0xD3A1, 0xD3FE, 0x1086,
- 0xD440, 0xD440, 0x4A3B, 0xD441, 0xD441, 0x2150, 0xD442, 0xD444, 0x4A3C,
- 0xD445, 0xD445, 0x1FD3, 0xD446, 0xD446, 0x4A3F, 0xD447, 0xD447, 0x22E5,
- 0xD448, 0xD44B, 0x4A40, 0xD44C, 0xD44C, 0x1EF2, 0xD44D, 0xD44E, 0x4A44,
- 0xD44F, 0xD44F, 0x211F, 0xD450, 0xD452, 0x4A46, 0xD453, 0xD453, 0x21DD,
- 0xD454, 0xD455, 0x4A49, 0xD456, 0xD456, 0x2154, 0xD457, 0xD457, 0x4A4B,
- 0xD458, 0xD458, 0x22E7, 0xD459, 0xD45B, 0x4A4C, 0xD45C, 0xD45C, 0x2282,
- 0xD45D, 0xD461, 0x4A4F, 0xD462, 0xD462, 0x22E6, 0xD463, 0xD466, 0x4A54,
- 0xD467, 0xD467, 0x22E8, 0xD468, 0xD46D, 0x4A58, 0xD46E, 0xD46E, 0x22E4,
- 0xD46F, 0xD46F, 0x4A5E, 0xD470, 0xD470, 0x226A, 0xD471, 0xD471, 0x4A5F,
- 0xD472, 0xD472, 0x22EB, 0xD473, 0xD473, 0x4A60, 0xD474, 0xD474, 0x22E9,
- 0xD475, 0xD475, 0x20BD, 0xD476, 0xD477, 0x4A61, 0xD478, 0xD478, 0x22EA,
- 0xD479, 0xD47A, 0x4A63, 0xD47B, 0xD47B, 0x22BD, 0xD47C, 0xD47D, 0x4A65,
- 0xD47E, 0xD47E, 0x1E9E, 0xD480, 0xD481, 0x4A67, 0xD482, 0xD482, 0x22F6,
- 0xD483, 0xD483, 0x21E7, 0xD484, 0xD484, 0x2216, 0xD485, 0xD486, 0x4A69,
- 0xD487, 0xD487, 0x2137, 0xD488, 0xD489, 0x4A6B, 0xD48A, 0xD48A, 0x212C,
- 0xD48B, 0xD48B, 0x4A6D, 0xD48C, 0xD48C, 0x1E68, 0xD48D, 0xD48D, 0x22F2,
- 0xD48E, 0xD48E, 0x1F37, 0xD48F, 0xD48F, 0x22F3, 0xD490, 0xD490, 0x4A6E,
- 0xD491, 0xD491, 0x22EF, 0xD492, 0xD492, 0x1F50, 0xD493, 0xD493, 0x1F10,
- 0xD494, 0xD494, 0x21C8, 0xD495, 0xD495, 0x4A6F, 0xD496, 0xD496, 0x22F1,
- 0xD497, 0xD49B, 0x4A70, 0xD49C, 0xD49C, 0x22F0, 0xD49D, 0xD49E, 0x4A75,
- 0xD49F, 0xD49F, 0x22EE, 0xD4A0, 0xD4A0, 0x4A77, 0xD4A1, 0xD4FE, 0x10E4,
- 0xD540, 0xD542, 0x4A78, 0xD543, 0xD543, 0x22ED, 0xD544, 0xD544, 0x229E,
- 0xD545, 0xD545, 0x22EC, 0xD546, 0xD546, 0x1FE2, 0xD547, 0xD549, 0x4A7B,
- 0xD54A, 0xD54A, 0x20FE, 0xD54B, 0xD54D, 0x4A7E, 0xD54E, 0xD54F, 0x22F9,
- 0xD550, 0xD550, 0x4A81, 0xD551, 0xD551, 0x1EAF, 0xD552, 0xD553, 0x4A82,
- 0xD554, 0xD554, 0x2236, 0xD555, 0xD555, 0x4A84, 0xD556, 0xD556, 0x22F7,
- 0xD557, 0xD559, 0x4A85, 0xD55A, 0xD55A, 0x223D, 0xD55B, 0xD55B, 0x4A88,
- 0xD55C, 0xD55C, 0x1E82, 0xD55D, 0xD55D, 0x1FB6, 0xD55E, 0xD55E, 0x4A89,
- 0xD55F, 0xD55F, 0x21A4, 0xD560, 0xD560, 0x21AA, 0xD561, 0xD561, 0x22F8,
- 0xD562, 0xD562, 0x2151, 0xD563, 0xD563, 0x4A8A, 0xD564, 0xD564, 0x1F60,
- 0xD565, 0xD567, 0x4A8B, 0xD568, 0xD568, 0x2147, 0xD569, 0xD56B, 0x4A8E,
- 0xD56C, 0xD56C, 0x2145, 0xD56D, 0xD56D, 0x4A91, 0xD56E, 0xD56E, 0x1FDC,
- 0xD56F, 0xD571, 0x4A92, 0xD572, 0xD572, 0x2301, 0xD573, 0xD574, 0x4A95,
- 0xD575, 0xD575, 0x1EF5, 0xD576, 0xD577, 0x4A97, 0xD578, 0xD578, 0x2218,
- 0xD579, 0xD57A, 0x4A99, 0xD57B, 0xD57B, 0x1EC6, 0xD57C, 0xD57D, 0x4A9B,
- 0xD57E, 0xD57E, 0x2300, 0xD580, 0xD580, 0x4A9D, 0xD581, 0xD581, 0x22B4,
- 0xD582, 0xD583, 0x4A9E, 0xD584, 0xD584, 0x2169, 0xD585, 0xD585, 0x4AA0,
- 0xD586, 0xD586, 0x22FD, 0xD587, 0xD587, 0x4AA1, 0xD588, 0xD588, 0x20EA,
- 0xD589, 0xD589, 0x4AA2, 0xD58A, 0xD58A, 0x22F4, 0xD58B, 0xD58B, 0x4AA3,
- 0xD58C, 0xD58C, 0x22FB, 0xD58D, 0xD58D, 0x4AA4, 0xD58E, 0xD58E, 0x22FC,
- 0xD58F, 0xD58F, 0x2027, 0xD590, 0xD592, 0x4AA5, 0xD593, 0xD593, 0x2060,
- 0xD594, 0xD594, 0x22FF, 0xD595, 0xD597, 0x4AA8, 0xD598, 0xD598, 0x22FE,
- 0xD599, 0xD599, 0x1EC7, 0xD59A, 0xD59A, 0x4AAB, 0xD59B, 0xD59B, 0x230C,
- 0xD59C, 0xD59E, 0x4AAC, 0xD59F, 0xD59F, 0x22F5, 0xD5A0, 0xD5A0, 0x4AAF,
- 0xD5A1, 0xD5FE, 0x1142, 0xD640, 0xD640, 0x2306, 0xD641, 0xD641, 0x4AB0,
- 0xD642, 0xD642, 0x230A, 0xD643, 0xD643, 0x21D3, 0xD644, 0xD646, 0x4AB1,
- 0xD647, 0xD647, 0x2303, 0xD648, 0xD648, 0x4AB4, 0xD649, 0xD649, 0x2307,
- 0xD64A, 0xD64A, 0x230B, 0xD64B, 0xD64C, 0x4AB5, 0xD64D, 0xD64D, 0x1F5F,
- 0xD64E, 0xD64E, 0x4AB7, 0xD64F, 0xD64F, 0x2309, 0xD650, 0xD651, 0x4AB8,
- 0xD652, 0xD652, 0x2302, 0xD653, 0xD653, 0x1F04, 0xD654, 0xD654, 0x229D,
- 0xD655, 0xD655, 0x4ABA, 0xD656, 0xD656, 0x21FB, 0xD657, 0xD657, 0x4ABB,
- 0xD658, 0xD658, 0x2308, 0xD659, 0xD659, 0x4ABC, 0xD65A, 0xD65A, 0x20AC,
- 0xD65B, 0xD65B, 0x4ABD, 0xD65C, 0xD65C, 0x208E, 0xD65D, 0xD65D, 0x2305,
- 0xD65E, 0xD65E, 0x2197, 0xD65F, 0xD65F, 0x4ABE, 0xD660, 0xD660, 0x2171,
- 0xD661, 0xD661, 0x2298, 0xD662, 0xD664, 0x4ABF, 0xD665, 0xD665, 0x1F57,
- 0xD666, 0xD668, 0x4AC2, 0xD669, 0xD669, 0x2082, 0xD66A, 0xD66A, 0x4AC5,
- 0xD66B, 0xD66B, 0x2311, 0xD66C, 0xD66E, 0x4AC6, 0xD66F, 0xD66F, 0x2304,
- 0xD670, 0xD670, 0x4AC9, 0xD671, 0xD671, 0x230F, 0xD672, 0xD672, 0x1E35,
- 0xD673, 0xD673, 0x4ACA, 0xD674, 0xD674, 0x20D1, 0xD675, 0xD675, 0x2310,
- 0xD676, 0xD676, 0x1FA3, 0xD677, 0xD677, 0x4ACB, 0xD678, 0xD678, 0x21D6,
- 0xD679, 0xD67B, 0x4ACC, 0xD67C, 0xD67C, 0x2206, 0xD67D, 0xD67E, 0x4ACF,
- 0xD680, 0xD682, 0x4AD1, 0xD683, 0xD683, 0x230D, 0xD684, 0xD685, 0x4AD4,
- 0xD686, 0xD686, 0x2312, 0xD687, 0xD687, 0x208D, 0xD688, 0xD688, 0x2313,
- 0xD689, 0xD68D, 0x4AD6, 0xD68E, 0xD68E, 0x22E3, 0xD68F, 0xD693, 0x4ADB,
- 0xD694, 0xD694, 0x1FBA, 0xD695, 0xD698, 0x4AE0, 0xD699, 0xD699, 0x2078,
- 0xD69A, 0xD6A0, 0x4AE4, 0xD6A1, 0xD6FE, 0x11A0, 0xD740, 0xD742, 0x4AEB,
- 0xD743, 0xD743, 0x2288, 0xD744, 0xD747, 0x4AEE, 0xD748, 0xD748, 0x2316,
- 0xD749, 0xD749, 0x1F6B, 0xD74A, 0xD74F, 0x4AF2, 0xD750, 0xD750, 0x2314,
- 0xD751, 0xD751, 0x4AF8, 0xD752, 0xD752, 0x2130, 0xD753, 0xD753, 0x2315,
- 0xD754, 0xD754, 0x2168, 0xD755, 0xD755, 0x4AF9, 0xD756, 0xD756, 0x20C4,
- 0xD757, 0xD763, 0x4AFA, 0xD764, 0xD764, 0x2318, 0xD765, 0xD766, 0x4B07,
- 0xD767, 0xD767, 0x2219, 0xD768, 0xD768, 0x2217, 0xD769, 0xD76B, 0x4B09,
- 0xD76C, 0xD76C, 0x20D5, 0xD76D, 0xD76E, 0x4B0C, 0xD76F, 0xD76F, 0x1F4A,
- 0xD770, 0xD774, 0x4B0E, 0xD775, 0xD775, 0x2240, 0xD776, 0xD777, 0x4B13,
- 0xD778, 0xD778, 0x1ED3, 0xD779, 0xD77E, 0x4B15, 0xD780, 0xD782, 0x4B1B,
- 0xD783, 0xD783, 0x1E49, 0xD784, 0xD786, 0x4B1E, 0xD787, 0xD787, 0x261B,
- 0xD788, 0xD78A, 0x4B21, 0xD78B, 0xD78B, 0x1E6D, 0xD78C, 0xD78C, 0x20F8,
- 0xD78D, 0xD78D, 0x4B24, 0xD78E, 0xD78E, 0x1FFB, 0xD78F, 0xD78F, 0x2319,
- 0xD790, 0xD794, 0x4B25, 0xD795, 0xD795, 0x230E, 0xD796, 0xD796, 0x4B2A,
- 0xD797, 0xD797, 0x2317, 0xD798, 0xD7A0, 0x4B2B, 0xD7A1, 0xD7F9, 0x11FE,
- 0xD840, 0xD84C, 0x4B34, 0xD84D, 0xD84D, 0x20C8, 0xD84E, 0xD852, 0x4B41,
- 0xD853, 0xD853, 0x1EFD, 0xD854, 0xD87E, 0x4B46, 0xD880, 0xD88F, 0x4B71,
- 0xD890, 0xD890, 0x1E3B, 0xD891, 0xD891, 0x227F, 0xD892, 0xD892, 0x4B81,
- 0xD893, 0xD893, 0x1F0C, 0xD894, 0xD894, 0x1E59, 0xD895, 0xD895, 0x1F24,
- 0xD896, 0xD899, 0x4B82, 0xD89A, 0xD89A, 0x20BA, 0xD89B, 0xD89B, 0x1F65,
- 0xD89C, 0xD89C, 0x1EF0, 0xD89D, 0xD89D, 0x2164, 0xD89E, 0xD89E, 0x1F30,
- 0xD89F, 0xD89F, 0x2261, 0xD8A0, 0xD8A0, 0x4B86, 0xD8A1, 0xD8FE, 0x1257,
- 0xD940, 0xD940, 0x4B87, 0xD941, 0xD941, 0x22A2, 0xD942, 0xD942, 0x24AB,
- 0xD943, 0xD943, 0x4B88, 0xD944, 0xD944, 0x24AF, 0xD945, 0xD945, 0x1EE8,
- 0xD946, 0xD946, 0x1F39, 0xD947, 0xD947, 0x4B89, 0xD948, 0xD948, 0x1E48,
- 0xD949, 0xD949, 0x2070, 0xD94A, 0xD94A, 0x1EA8, 0xD94B, 0xD94B, 0x4B8A,
- 0xD94C, 0xD94C, 0x24AC, 0xD94D, 0xD94D, 0x1EF7, 0xD94E, 0xD94E, 0x2176,
- 0xD94F, 0xD94F, 0x24AD, 0xD950, 0xD950, 0x4B8B, 0xD951, 0xD951, 0x207B,
- 0xD952, 0xD952, 0x1F45, 0xD953, 0xD953, 0x24AA, 0xD954, 0xD954, 0x204B,
- 0xD955, 0xD955, 0x202F, 0xD956, 0xD956, 0x1F5A, 0xD957, 0xD957, 0x24B0,
- 0xD958, 0xD958, 0x4B8C, 0xD959, 0xD959, 0x22B7, 0xD95A, 0xD95A, 0x1F7F,
- 0xD95B, 0xD95B, 0x4B8D, 0xD95C, 0xD95C, 0x2265, 0xD95D, 0xD962, 0x4B8E,
- 0xD963, 0xD963, 0x24B2, 0xD964, 0xD964, 0x211B, 0xD965, 0xD965, 0x1E51,
- 0xD966, 0xD966, 0x4B94, 0xD967, 0xD967, 0x24B4, 0xD968, 0xD96B, 0x4B95,
- 0xD96C, 0xD96C, 0x24B3, 0xD96D, 0xD96D, 0x4B99, 0xD96E, 0xD96E, 0x1E9F,
- 0xD96F, 0xD96F, 0x4B9A, 0xD970, 0xD970, 0x2118, 0xD971, 0xD971, 0x4B9B,
- 0xD972, 0xD972, 0x20B4, 0xD973, 0xD973, 0x23AF, 0xD974, 0xD974, 0x21BB,
- 0xD975, 0xD975, 0x2072, 0xD976, 0xD976, 0x1F95, 0xD977, 0xD977, 0x4B9C,
- 0xD978, 0xD978, 0x1F0A, 0xD979, 0xD979, 0x24B6, 0xD97A, 0xD97B, 0x4B9D,
- 0xD97C, 0xD97C, 0x2291, 0xD97D, 0xD97D, 0x24B5, 0xD97E, 0xD97E, 0x2278,
- 0xD980, 0xD980, 0x1ED4, 0xD981, 0xD986, 0x4B9F, 0xD987, 0xD987, 0x1FF3,
- 0xD988, 0xD98C, 0x4BA5, 0xD98D, 0xD98D, 0x22A9, 0xD98E, 0xD98E, 0x24B7,
- 0xD98F, 0xD98F, 0x1F28, 0xD990, 0xD990, 0x2109, 0xD991, 0xD991, 0x22C7,
- 0xD992, 0xD996, 0x4BAA, 0xD997, 0xD997, 0x24AE, 0xD998, 0xD998, 0x22B1,
- 0xD999, 0xD99A, 0x4BAF, 0xD99B, 0xD99B, 0x2266, 0xD99C, 0xD99C, 0x4BB1,
- 0xD99D, 0xD99D, 0x225B, 0xD99E, 0xD99E, 0x22C4, 0xD99F, 0xD99F, 0x4BB2,
- 0xD9A0, 0xD9A0, 0x2115, 0xD9A1, 0xD9FE, 0x12B5, 0xDA40, 0xDA40, 0x4BB3,
- 0xDA41, 0xDA41, 0x222A, 0xDA42, 0xDA42, 0x24B1, 0xDA43, 0xDA47, 0x4BB4,
- 0xDA48, 0xDA48, 0x213D, 0xDA49, 0xDA4C, 0x4BB9, 0xDA4D, 0xDA4D, 0x1F15,
- 0xDA4E, 0xDA4E, 0x225C, 0xDA4F, 0xDA72, 0x4BBD, 0xDA73, 0xDA73, 0x1F14,
- 0xDA74, 0xDA76, 0x4BE1, 0xDA77, 0xDA77, 0x227A, 0xDA78, 0xDA7E, 0x4BE4,
- 0xDA80, 0xDA84, 0x4BEB, 0xDA85, 0xDA85, 0x20EE, 0xDA86, 0xDA8D, 0x4BF0,
- 0xDA8E, 0xDA8E, 0x25F8, 0xDA8F, 0xDAA0, 0x4BF8, 0xDAA1, 0xDAFE, 0x1313,
- 0xDB40, 0xDB5F, 0x4C0A, 0xDB60, 0xDB60, 0x1F94, 0xDB61, 0xDB77, 0x4C2A,
- 0xDB78, 0xDB78, 0x2230, 0xDB79, 0xDB7E, 0x4C41, 0xDB80, 0xDB83, 0x4C47,
- 0xDB84, 0xDB84, 0x25FD, 0xDB85, 0xDB8A, 0x4C4B, 0xDB8B, 0xDB8B, 0x2600,
- 0xDB8C, 0xDB97, 0x4C51, 0xDB98, 0xDB98, 0x2606, 0xDB99, 0xDBA0, 0x4C5D,
- 0xDBA1, 0xDBFE, 0x1371, 0xDC40, 0xDC44, 0x4C65, 0xDC45, 0xDC45, 0x25FF,
- 0xDC46, 0xDC4E, 0x4C6A, 0xDC4F, 0xDC4F, 0x25FC, 0xDC50, 0xDC50, 0x1E8C,
- 0xDC51, 0xDC51, 0x2602, 0xDC52, 0xDC52, 0x4C73, 0xDC53, 0xDC53, 0x224D,
- 0xDC54, 0xDC54, 0x4C74, 0xDC55, 0xDC55, 0x2604, 0xDC56, 0xDC56, 0x25FE,
- 0xDC57, 0xDC57, 0x2603, 0xDC58, 0xDC5C, 0x4C75, 0xDC5D, 0xDC5D, 0x2601,
- 0xDC5E, 0xDC61, 0x4C7A, 0xDC62, 0xDC62, 0x2605, 0xDC63, 0xDC65, 0x4C7E,
- 0xDC66, 0xDC66, 0x1EA3, 0xDC67, 0xDC67, 0x2608, 0xDC68, 0xDC6A, 0x4C81,
- 0xDC6B, 0xDC6B, 0x2607, 0xDC6C, 0xDC7B, 0x4C84, 0xDC7C, 0xDC7C, 0x20F0,
- 0xDC7D, 0xDC7E, 0x4C94, 0xDC80, 0xDC86, 0x4C96, 0xDC87, 0xDC87, 0x1E7B,
- 0xDC88, 0xDC88, 0x2267, 0xDC89, 0xDC89, 0x1F36, 0xDC8A, 0xDC8A, 0x1FD6,
- 0xDC8B, 0xDC8D, 0x4C9D, 0xDC8E, 0xDC8E, 0x21E0, 0xDC8F, 0xDC8F, 0x4CA0,
- 0xDC90, 0xDC90, 0x248C, 0xDC91, 0xDC96, 0x4CA1, 0xDC97, 0xDC97, 0x248D,
- 0xDC98, 0xDC9A, 0x4CA7, 0xDC9B, 0xDC9B, 0x2102, 0xDC9C, 0xDC9F, 0x4CAA,
- 0xDCA0, 0xDCA0, 0x2494, 0xDCA1, 0xDCFE, 0x13CF, 0xDD40, 0xDD45, 0x4CAE,
- 0xDD46, 0xDD46, 0x2493, 0xDD47, 0xDD4C, 0x4CB4, 0xDD4D, 0xDD4D, 0x248E,
- 0xDD4E, 0xDD52, 0x4CBA, 0xDD53, 0xDD53, 0x2299, 0xDD54, 0xDD54, 0x2491,
- 0xDD55, 0xDD55, 0x2496, 0xDD56, 0xDD56, 0x248F, 0xDD57, 0xDD57, 0x2492,
- 0xDD58, 0xDD58, 0x4CBF, 0xDD59, 0xDD59, 0x2497, 0xDD5A, 0xDD5D, 0x4CC0,
- 0xDD5E, 0xDD5E, 0x1FB1, 0xDD5F, 0xDD5F, 0x4CC4, 0xDD60, 0xDD60, 0x249A,
- 0xDD61, 0xDD61, 0x4CC5, 0xDD62, 0xDD62, 0x2499, 0xDD63, 0xDD63, 0x4CC6,
- 0xDD64, 0xDD64, 0x2258, 0xDD65, 0xDD65, 0x2498, 0xDD66, 0xDD6C, 0x4CC7,
- 0xDD6D, 0xDD6D, 0x249B, 0xDD6E, 0xDD6E, 0x4CCE, 0xDD6F, 0xDD6F, 0x1F09,
- 0xDD70, 0xDD70, 0x20E6, 0xDD71, 0xDD75, 0x4CCF, 0xDD76, 0xDD76, 0x2026,
- 0xDD77, 0xDD77, 0x249F, 0xDD78, 0xDD78, 0x1F59, 0xDD79, 0xDD7A, 0x249D,
- 0xDD7B, 0xDD7E, 0x4CD4, 0xDD80, 0xDD80, 0x4CD8, 0xDD81, 0xDD81, 0x1F3B,
- 0xDD82, 0xDD82, 0x249C, 0xDD83, 0xDD84, 0x4CD9, 0xDD85, 0xDD85, 0x1E3A,
- 0xDD86, 0xDD86, 0x205B, 0xDD87, 0xDD8A, 0x4CDB, 0xDD8B, 0xDD8B, 0x1F70,
- 0xDD8C, 0xDD8E, 0x4CDF, 0xDD8F, 0xDD8F, 0x24A0, 0xDD90, 0xDD93, 0x4CE2,
- 0xDD94, 0xDD94, 0x213B, 0xDD95, 0xDD96, 0x4CE6, 0xDD97, 0xDD97, 0x1F07,
- 0xDD98, 0xDD99, 0x4CE8, 0xDD9A, 0xDD9A, 0x2270, 0xDD9B, 0xDD9B, 0x2237,
- 0xDD9C, 0xDD9D, 0x4CEA, 0xDD9E, 0xDD9E, 0x24D2, 0xDD9F, 0xDD9F, 0x4CEC,
- 0xDDA0, 0xDDA0, 0x21B3, 0xDDA1, 0xDDFE, 0x142D, 0xDE40, 0xDE40, 0x2245,
- 0xDE41, 0xDE41, 0x24A1, 0xDE42, 0xDE43, 0x4CED, 0xDE44, 0xDE44, 0x22A8,
- 0xDE45, 0xDE47, 0x4CEF, 0xDE48, 0xDE48, 0x227C, 0xDE49, 0xDE49, 0x1FB0,
- 0xDE4A, 0xDE4E, 0x4CF2, 0xDE4F, 0xDE4F, 0x24A2, 0xDE50, 0xDE59, 0x4CF7,
- 0xDE5A, 0xDE5A, 0x1F46, 0xDE5B, 0xDE5B, 0x4D01, 0xDE5C, 0xDE5C, 0x2380,
- 0xDE5D, 0xDE5D, 0x2495, 0xDE5E, 0xDE5E, 0x4D02, 0xDE5F, 0xDE5F, 0x2490,
- 0xDE60, 0xDE6A, 0x4D03, 0xDE6B, 0xDE6B, 0x1E30, 0xDE6C, 0xDE6E, 0x4D0E,
- 0xDE6F, 0xDE6F, 0x1E9D, 0xDE70, 0xDE70, 0x1E4B, 0xDE71, 0xDE71, 0x1E4A,
- 0xDE72, 0xDE72, 0x20AA, 0xDE73, 0xDE7E, 0x4D11, 0xDE80, 0xDE91, 0x4D1D,
- 0xDE92, 0xDE92, 0x267B, 0xDE93, 0xDE9E, 0x4D2F, 0xDE9F, 0xDE9F, 0x23F2,
- 0xDEA0, 0xDEA0, 0x4D3B, 0xDEA1, 0xDEFE, 0x148B, 0xDF40, 0xDF40, 0x227E,
- 0xDF41, 0xDF41, 0x4D3C, 0xDF42, 0xDF42, 0x2019, 0xDF43, 0xDF4C, 0x4D3D,
- 0xDF4D, 0xDF4D, 0x1FBB, 0xDF4E, 0xDF5B, 0x4D47, 0xDF5C, 0xDF5C, 0x2253,
- 0xDF5D, 0xDF5D, 0x4D55, 0xDF5E, 0xDF5E, 0x1F3E, 0xDF5F, 0xDF5F, 0x1EA6,
- 0xDF60, 0xDF60, 0x218E, 0xDF61, 0xDF63, 0x4D56, 0xDF64, 0xDF64, 0x21EC,
- 0xDF65, 0xDF65, 0x4D59, 0xDF66, 0xDF66, 0x1EBE, 0xDF67, 0xDF67, 0x4D5A,
- 0xDF68, 0xDF68, 0x224A, 0xDF69, 0xDF6C, 0x4D5B, 0xDF6D, 0xDF6D, 0x2133,
- 0xDF6E, 0xDF73, 0x4D5F, 0xDF74, 0xDF74, 0x1E84, 0xDF75, 0xDF76, 0x4D65,
- 0xDF77, 0xDF77, 0x20CF, 0xDF78, 0xDF78, 0x21E2, 0xDF79, 0xDF79, 0x4D67,
- 0xDF7A, 0xDF7A, 0x220F, 0xDF7B, 0xDF7B, 0x4D68, 0xDF7C, 0xDF7C, 0x2029,
- 0xDF7D, 0xDF7D, 0x4D69, 0xDF7E, 0xDF7E, 0x2073, 0xDF80, 0xDF80, 0x1F55,
- 0xDF81, 0xDF82, 0x4D6A, 0xDF83, 0xDF83, 0x23F1, 0xDF84, 0xDF84, 0x4D6C,
- 0xDF85, 0xDF85, 0x1E46, 0xDF86, 0xDF88, 0x4D6D, 0xDF89, 0xDF89, 0x2063,
- 0xDF8A, 0xDF8A, 0x23F3, 0xDF8B, 0xDFA0, 0x4D70, 0xDFA1, 0xDFFE, 0x14E9,
- 0xE040, 0xE04F, 0x4D86, 0xE050, 0xE050, 0x231E, 0xE051, 0xE05C, 0x4D96,
- 0xE05D, 0xE05D, 0x2233, 0xE05E, 0xE068, 0x4DA2, 0xE069, 0xE069, 0x2320,
- 0xE06A, 0xE06B, 0x4DAD, 0xE06C, 0xE06C, 0x21C7, 0xE06D, 0xE074, 0x4DAF,
- 0xE075, 0xE075, 0x22BC, 0xE076, 0xE076, 0x4DB7, 0xE077, 0xE077, 0x231C,
- 0xE078, 0xE078, 0x4DB8, 0xE079, 0xE079, 0x2251, 0xE07A, 0xE07E, 0x4DB9,
- 0xE080, 0xE086, 0x4DBE, 0xE087, 0xE087, 0x1EBB, 0xE088, 0xE08C, 0x4DC5,
- 0xE08D, 0xE08D, 0x2287, 0xE08E, 0xE08E, 0x4DCA, 0xE08F, 0xE08F, 0x202D,
- 0xE090, 0xE090, 0x1EAB, 0xE091, 0xE091, 0x4DCB, 0xE092, 0xE092, 0x231D,
- 0xE093, 0xE093, 0x4DCC, 0xE094, 0xE094, 0x231F, 0xE095, 0xE096, 0x4DCD,
- 0xE097, 0xE097, 0x231B, 0xE098, 0xE0A0, 0x4DCF, 0xE0A1, 0xE0FE, 0x1547,
- 0xE140, 0xE141, 0x4DD8, 0xE142, 0xE142, 0x2321, 0xE143, 0xE163, 0x4DDA,
- 0xE164, 0xE164, 0x2255, 0xE165, 0xE167, 0x4DFB, 0xE168, 0xE168, 0x1E8F,
- 0xE169, 0xE173, 0x4DFE, 0xE174, 0xE174, 0x220C, 0xE175, 0xE175, 0x1FA4,
- 0xE176, 0xE17E, 0x4E09, 0xE180, 0xE183, 0x4E12, 0xE184, 0xE184, 0x209B,
- 0xE185, 0xE185, 0x21D8, 0xE186, 0xE186, 0x4E16, 0xE187, 0xE187, 0x25FA,
- 0xE188, 0xE188, 0x4E17, 0xE189, 0xE189, 0x25F9, 0xE18A, 0xE18B, 0x4E18,
- 0xE18C, 0xE18C, 0x2134, 0xE18D, 0xE18D, 0x4E1A, 0xE18E, 0xE190, 0x24F3,
- 0xE191, 0xE191, 0x24F8, 0xE192, 0xE192, 0x4E1B, 0xE193, 0xE193, 0x24F7,
- 0xE194, 0xE194, 0x1EC8, 0xE195, 0xE195, 0x24F6, 0xE196, 0xE197, 0x4E1C,
- 0xE198, 0xE198, 0x2280, 0xE199, 0xE19D, 0x4E1E, 0xE19E, 0xE19E, 0x1EC5,
- 0xE19F, 0xE19F, 0x24FB, 0xE1A0, 0xE1A0, 0x4E23, 0xE1A1, 0xE1FE, 0x15A5,
- 0xE240, 0xE240, 0x4E24, 0xE241, 0xE241, 0x24FA, 0xE242, 0xE242, 0x4E25,
- 0xE243, 0xE243, 0x1EED, 0xE244, 0xE24E, 0x4E26, 0xE24F, 0xE24F, 0x24FD,
- 0xE250, 0xE250, 0x4E31, 0xE251, 0xE251, 0x24F9, 0xE252, 0xE252, 0x4E32,
- 0xE253, 0xE253, 0x24FE, 0xE254, 0xE254, 0x20CD, 0xE255, 0xE259, 0x4E33,
- 0xE25A, 0xE25A, 0x2508, 0xE25B, 0xE25B, 0x2504, 0xE25C, 0xE25D, 0x4E38,
- 0xE25E, 0xE25E, 0x2506, 0xE25F, 0xE261, 0x4E3A, 0xE262, 0xE262, 0x24FF,
- 0xE263, 0xE263, 0x2090, 0xE264, 0xE266, 0x4E3D, 0xE267, 0xE267, 0x1EDD,
- 0xE268, 0xE268, 0x1F25, 0xE269, 0xE269, 0x4E40, 0xE26A, 0xE26A, 0x2503,
- 0xE26B, 0xE26B, 0x2502, 0xE26C, 0xE26D, 0x4E41, 0xE26E, 0xE26E, 0x1E7A,
- 0xE26F, 0xE26F, 0x20A6, 0xE270, 0xE277, 0x4E43, 0xE278, 0xE278, 0x1FD5,
- 0xE279, 0xE27C, 0x4E4B, 0xE27D, 0xE27D, 0x1F11, 0xE27E, 0xE27E, 0x4E4F,
- 0xE280, 0xE280, 0x2507, 0xE281, 0xE281, 0x2500, 0xE282, 0xE282, 0x2505,
- 0xE283, 0xE288, 0x4E50, 0xE289, 0xE289, 0x2519, 0xE28A, 0xE28A, 0x4E56,
- 0xE28B, 0xE28B, 0x2515, 0xE28C, 0xE28D, 0x4E57, 0xE28E, 0xE28E, 0x250C,
- 0xE28F, 0xE28F, 0x2031, 0xE290, 0xE291, 0x4E59, 0xE292, 0xE292, 0x250B,
- 0xE293, 0xE293, 0x250F, 0xE294, 0xE294, 0x251A, 0xE295, 0xE295, 0x2509,
- 0xE296, 0xE297, 0x4E5B, 0xE298, 0xE298, 0x250E, 0xE299, 0xE299, 0x2234,
- 0xE29A, 0xE29A, 0x2513, 0xE29B, 0xE29B, 0x1F80, 0xE29C, 0xE29F, 0x4E5D,
- 0xE2A0, 0xE2A0, 0x2501, 0xE2A1, 0xE2FE, 0x1603, 0xE340, 0xE341, 0x4E61,
- 0xE342, 0xE342, 0x2517, 0xE343, 0xE343, 0x2516, 0xE344, 0xE346, 0x4E63,
- 0xE347, 0xE347, 0x2518, 0xE348, 0xE34A, 0x4E66, 0xE34B, 0xE34B, 0x1E56,
- 0xE34C, 0xE34E, 0x4E69, 0xE34F, 0xE34F, 0x250D, 0xE350, 0xE350, 0x4E6C,
- 0xE351, 0xE351, 0x20D3, 0xE352, 0xE353, 0x4E6D, 0xE354, 0xE354, 0x207A,
- 0xE355, 0xE355, 0x20CE, 0xE356, 0xE357, 0x4E6F, 0xE358, 0xE358, 0x2510,
- 0xE359, 0xE35B, 0x4E71, 0xE35C, 0xE35C, 0x1E55, 0xE35D, 0xE35F, 0x4E74,
- 0xE360, 0xE360, 0x250A, 0xE361, 0xE365, 0x4E77, 0xE366, 0xE367, 0x2511,
- 0xE368, 0xE370, 0x4E7C, 0xE371, 0xE371, 0x1FAA, 0xE372, 0xE372, 0x4E85,
- 0xE373, 0xE373, 0x251E, 0xE374, 0xE374, 0x1F1F, 0xE375, 0xE377, 0x4E86,
- 0xE378, 0xE378, 0x252D, 0xE379, 0xE379, 0x221D, 0xE37A, 0xE37B, 0x4E89,
- 0xE37C, 0xE37C, 0x2532, 0xE37D, 0xE37D, 0x4E8B, 0xE37E, 0xE37E, 0x217B,
- 0xE380, 0xE389, 0x4E8C, 0xE38A, 0xE38A, 0x21AF, 0xE38B, 0xE38B, 0x4E96,
- 0xE38C, 0xE38C, 0x252C, 0xE38D, 0xE38E, 0x4E97, 0xE38F, 0xE38F, 0x2528,
- 0xE390, 0xE390, 0x4E99, 0xE391, 0xE391, 0x208C, 0xE392, 0xE392, 0x4E9A,
- 0xE393, 0xE393, 0x252F, 0xE394, 0xE394, 0x4E9B, 0xE395, 0xE395, 0x21BC,
- 0xE396, 0xE398, 0x4E9C, 0xE399, 0xE399, 0x251D, 0xE39A, 0xE39B, 0x4E9F,
- 0xE39C, 0xE39C, 0x2535, 0xE39D, 0xE39D, 0x4EA1, 0xE39E, 0xE39E, 0x220D,
- 0xE39F, 0xE39F, 0x2526, 0xE3A0, 0xE3A0, 0x4EA2, 0xE3A1, 0xE3FE, 0x1661,
- 0xE440, 0xE440, 0x2534, 0xE441, 0xE441, 0x252A, 0xE442, 0xE442, 0x251F,
- 0xE443, 0xE443, 0x2531, 0xE444, 0xE444, 0x251C, 0xE445, 0xE447, 0x4EA3,
- 0xE448, 0xE448, 0x2525, 0xE449, 0xE44D, 0x4EA6, 0xE44E, 0xE44E, 0x21CD,
- 0xE44F, 0xE44F, 0x4EAB, 0xE450, 0xE450, 0x21DA, 0xE451, 0xE451, 0x4EAC,
- 0xE452, 0xE452, 0x2172, 0xE453, 0xE453, 0x253E, 0xE454, 0xE457, 0x4EAD,
- 0xE458, 0xE458, 0x204F, 0xE459, 0xE459, 0x4EB1, 0xE45A, 0xE45A, 0x2543,
- 0xE45B, 0xE45B, 0x4EB2, 0xE45C, 0xE45C, 0x21D7, 0xE45D, 0xE45D, 0x4EB3,
- 0xE45E, 0xE45E, 0x1E3C, 0xE45F, 0xE461, 0x4EB4, 0xE462, 0xE462, 0x2529,
- 0xE463, 0xE464, 0x4EB7, 0xE465, 0xE465, 0x2521, 0xE466, 0xE467, 0x4EB9,
- 0xE468, 0xE468, 0x1EFF, 0xE469, 0xE472, 0x4EBB, 0xE473, 0xE473, 0x253F,
- 0xE474, 0xE474, 0x4EC5, 0xE475, 0xE475, 0x2544, 0xE476, 0xE478, 0x4EC6,
- 0xE479, 0xE479, 0x2523, 0xE47A, 0xE47A, 0x1E90, 0xE47B, 0xE47B, 0x253A,
- 0xE47C, 0xE47C, 0x2545, 0xE47D, 0xE47D, 0x4EC9, 0xE47E, 0xE47E, 0x253D,
- 0xE480, 0xE480, 0x4ECA, 0xE481, 0xE481, 0x20C1, 0xE482, 0xE483, 0x4ECB,
- 0xE484, 0xE484, 0x2103, 0xE485, 0xE485, 0x2520, 0xE486, 0xE486, 0x253C,
- 0xE487, 0xE487, 0x253B, 0xE488, 0xE488, 0x2538, 0xE489, 0xE48C, 0x4ECD,
- 0xE48D, 0xE48D, 0x2540, 0xE48E, 0xE48E, 0x4ED1, 0xE48F, 0xE48F, 0x1FCD,
- 0xE490, 0xE492, 0x4ED2, 0xE493, 0xE493, 0x1F18, 0xE494, 0xE497, 0x4ED5,
- 0xE498, 0xE498, 0x254B, 0xE499, 0xE49C, 0x4ED9, 0xE49D, 0xE49D, 0x2547,
- 0xE49E, 0xE49F, 0x254F, 0xE4A0, 0xE4A0, 0x4EDD, 0xE4A1, 0xE4FE, 0x16BF,
- 0xE540, 0xE545, 0x4EDE, 0xE546, 0xE546, 0x22B0, 0xE547, 0xE547, 0x4EE4,
- 0xE548, 0xE548, 0x2546, 0xE549, 0xE54A, 0x4EE5, 0xE54B, 0xE54B, 0x254C,
- 0xE54C, 0xE54D, 0x4EE7, 0xE54E, 0xE54E, 0x1E9A, 0xE54F, 0xE54F, 0x2552,
- 0xE550, 0xE550, 0x2530, 0xE551, 0xE551, 0x2549, 0xE552, 0xE554, 0x4EE9,
- 0xE555, 0xE555, 0x2551, 0xE556, 0xE556, 0x1ECA, 0xE557, 0xE557, 0x4EEC,
- 0xE558, 0xE558, 0x20D2, 0xE559, 0xE55B, 0x4EED, 0xE55C, 0xE55C, 0x1FB8,
- 0xE55D, 0xE55D, 0x4EF0, 0xE55E, 0xE55E, 0x2079, 0xE55F, 0xE560, 0x4EF1,
- 0xE561, 0xE561, 0x21AB, 0xE562, 0xE563, 0x4EF3, 0xE564, 0xE564, 0x254D,
- 0xE565, 0xE565, 0x1EA5, 0xE566, 0xE567, 0x4EF5, 0xE568, 0xE568, 0x204C,
- 0xE569, 0xE569, 0x2080, 0xE56A, 0xE56B, 0x4EF7, 0xE56C, 0xE56C, 0x266D,
- 0xE56D, 0xE56D, 0x4EF9, 0xE56E, 0xE56E, 0x2537, 0xE56F, 0xE574, 0x4EFA,
- 0xE575, 0xE575, 0x254A, 0xE576, 0xE576, 0x21B8, 0xE577, 0xE577, 0x4F00,
- 0xE578, 0xE578, 0x254E, 0xE579, 0xE57A, 0x4F01, 0xE57B, 0xE57B, 0x24FC,
- 0xE57C, 0xE57C, 0x2554, 0xE57D, 0xE57E, 0x4F03, 0xE580, 0xE580, 0x4F05,
- 0xE581, 0xE581, 0x1F3C, 0xE582, 0xE582, 0x4F06, 0xE583, 0xE583, 0x1ED5,
- 0xE584, 0xE589, 0x4F07, 0xE58A, 0xE58A, 0x2556, 0xE58B, 0xE58D, 0x4F0D,
- 0xE58E, 0xE58E, 0x2268, 0xE58F, 0xE590, 0x4F10, 0xE591, 0xE591, 0x1ED6,
- 0xE592, 0xE599, 0x4F12, 0xE59A, 0xE59A, 0x2557, 0xE59B, 0xE59B, 0x2553,
- 0xE59C, 0xE59E, 0x4F1A, 0xE59F, 0xE59F, 0x2548, 0xE5A0, 0xE5A0, 0x4F1D,
- 0xE5A1, 0xE5FE, 0x171D, 0xE640, 0xE640, 0x20DC, 0xE641, 0xE643, 0x4F1E,
- 0xE644, 0xE644, 0x2559, 0xE645, 0xE648, 0x4F21, 0xE649, 0xE649, 0x1F97,
- 0xE64A, 0xE64A, 0x2555, 0xE64B, 0xE64D, 0x4F25, 0xE64E, 0xE64E, 0x227D,
- 0xE64F, 0xE651, 0x4F28, 0xE652, 0xE652, 0x257E, 0xE653, 0xE655, 0x4F2B,
- 0xE656, 0xE656, 0x207C, 0xE657, 0xE657, 0x4F2E, 0xE658, 0xE658, 0x255A,
- 0xE659, 0xE65A, 0x4F2F, 0xE65B, 0xE65B, 0x255E, 0xE65C, 0xE65D, 0x4F31,
- 0xE65E, 0xE65E, 0x1E34, 0xE65F, 0xE668, 0x4F33, 0xE669, 0xE669, 0x215E,
- 0xE66A, 0xE66A, 0x4F3D, 0xE66B, 0xE66B, 0x2560, 0xE66C, 0xE674, 0x4F3E,
- 0xE675, 0xE675, 0x21A2, 0xE676, 0xE676, 0x2354, 0xE677, 0xE678, 0x4F47,
- 0xE679, 0xE679, 0x2563, 0xE67A, 0xE67A, 0x2527, 0xE67B, 0xE67B, 0x4F49,
- 0xE67C, 0xE67C, 0x252E, 0xE67D, 0xE67D, 0x2558, 0xE67E, 0xE67E, 0x4F4A,
- 0xE680, 0xE680, 0x1F1B, 0xE681, 0xE681, 0x4F4B, 0xE682, 0xE682, 0x2283,
- 0xE683, 0xE683, 0x4F4C, 0xE684, 0xE684, 0x2564, 0xE685, 0xE686, 0x4F4D,
- 0xE687, 0xE687, 0x20A0, 0xE688, 0xE688, 0x4F4F, 0xE689, 0xE689, 0x2565,
- 0xE68A, 0xE68B, 0x4F50, 0xE68C, 0xE68C, 0x2561, 0xE68D, 0xE692, 0x4F52,
- 0xE693, 0xE693, 0x2562, 0xE694, 0xE696, 0x4F58, 0xE697, 0xE697, 0x256C,
- 0xE698, 0xE69A, 0x4F5B, 0xE69B, 0xE69B, 0x256D, 0xE69C, 0xE69C, 0x2020,
- 0xE69D, 0xE69E, 0x4F5E, 0xE69F, 0xE69F, 0x255F, 0xE6A0, 0xE6A0, 0x256A,
- 0xE6A1, 0xE6FE, 0x177B, 0xE740, 0xE742, 0x4F60, 0xE743, 0xE743, 0x256E,
- 0xE744, 0xE747, 0x4F63, 0xE748, 0xE748, 0x2539, 0xE749, 0xE749, 0x255C,
- 0xE74A, 0xE74C, 0x4F67, 0xE74D, 0xE74E, 0x2568, 0xE74F, 0xE74F, 0x256B,
- 0xE750, 0xE750, 0x1E6F, 0xE751, 0xE751, 0x4F6A, 0xE752, 0xE752, 0x1FC4,
- 0xE753, 0xE753, 0x2567, 0xE754, 0xE754, 0x4F6B, 0xE755, 0xE755, 0x255B,
- 0xE756, 0xE758, 0x4F6C, 0xE759, 0xE759, 0x261D, 0xE75A, 0xE765, 0x4F6F,
- 0xE766, 0xE766, 0x252B, 0xE767, 0xE767, 0x4F7B, 0xE768, 0xE768, 0x2571,
- 0xE769, 0xE769, 0x4F7C, 0xE76A, 0xE76A, 0x2577, 0xE76B, 0xE773, 0x4F7D,
- 0xE774, 0xE774, 0x2522, 0xE775, 0xE77B, 0x4F86, 0xE77C, 0xE77C, 0x2533,
- 0xE77D, 0xE77E, 0x4F8D, 0xE780, 0xE781, 0x4F8F, 0xE782, 0xE782, 0x202A,
- 0xE783, 0xE783, 0x4F91, 0xE784, 0xE784, 0x2536, 0xE785, 0xE785, 0x2573,
- 0xE786, 0xE786, 0x256F, 0xE787, 0xE789, 0x4F92, 0xE78A, 0xE78A, 0x2293,
- 0xE78B, 0xE78B, 0x2578, 0xE78C, 0xE78E, 0x4F95, 0xE78F, 0xE78F, 0x2570,
- 0xE790, 0xE791, 0x4F98, 0xE792, 0xE792, 0x2575, 0xE793, 0xE797, 0x4F9A,
- 0xE798, 0xE799, 0x2541, 0xE79A, 0xE79A, 0x255D, 0xE79B, 0xE79F, 0x4F9F,
- 0xE7A0, 0xE7A0, 0x201A, 0xE7A1, 0xE7FE, 0x17D9, 0xE840, 0xE842, 0x4FA4,
- 0xE843, 0xE843, 0x257A, 0xE844, 0xE844, 0x2006, 0xE845, 0xE845, 0x4FA7,
- 0xE846, 0xE846, 0x2177, 0xE847, 0xE848, 0x4FA8, 0xE849, 0xE849, 0x251B,
- 0xE84A, 0xE84A, 0x4FAA, 0xE84B, 0xE84B, 0x2524, 0xE84C, 0xE84E, 0x4FAB,
- 0xE84F, 0xE84F, 0x257B, 0xE850, 0xE853, 0x4FAE, 0xE854, 0xE854, 0x22A3,
- 0xE855, 0xE859, 0x4FB2, 0xE85A, 0xE85A, 0x2579, 0xE85B, 0xE85B, 0x4FB7,
- 0xE85C, 0xE85C, 0x2566, 0xE85D, 0xE861, 0x4FB8, 0xE862, 0xE862, 0x1F93,
- 0xE863, 0xE863, 0x4FBD, 0xE864, 0xE864, 0x257C, 0xE865, 0xE86F, 0x4FBE,
- 0xE870, 0xE870, 0x2514, 0xE871, 0xE872, 0x4FC9, 0xE873, 0xE873, 0x257D,
- 0xE874, 0xE874, 0x4FCB, 0xE875, 0xE875, 0x2572, 0xE876, 0xE87B, 0x4FCC,
- 0xE87C, 0xE87C, 0x2574, 0xE87D, 0xE87E, 0x4FD2, 0xE880, 0xE880, 0x224E,
- 0xE881, 0xE881, 0x4FD4, 0xE882, 0xE882, 0x21C6, 0xE883, 0xE886, 0x4FD5,
- 0xE887, 0xE887, 0x209F, 0xE888, 0xE888, 0x4FD9, 0xE889, 0xE889, 0x2576,
- 0xE88A, 0xE88B, 0x4FDA, 0xE88C, 0xE88C, 0x2064, 0xE88D, 0xE88D, 0x22BF,
- 0xE88E, 0xE88E, 0x261C, 0xE88F, 0xE88F, 0x225E, 0xE890, 0xE8A0, 0x4FDC,
- 0xE8A1, 0xE8FE, 0x1837, 0xE940, 0xE94B, 0x4FED, 0xE94C, 0xE94C, 0x1E75,
- 0xE94D, 0xE953, 0x4FF9, 0xE954, 0xE954, 0x207D, 0xE955, 0xE955, 0x5000,
- 0xE956, 0xE956, 0x23BF, 0xE957, 0xE957, 0x2113, 0xE958, 0xE959, 0x5001,
- 0xE95A, 0xE95A, 0x23C0, 0xE95B, 0xE95C, 0x5003, 0xE95D, 0xE95D, 0x1E45,
- 0xE95E, 0xE95E, 0x5005, 0xE95F, 0xE95F, 0x1FD8, 0xE960, 0xE960, 0x23C4,
- 0xE961, 0xE961, 0x5006, 0xE962, 0xE962, 0x23C2, 0xE963, 0xE963, 0x2104,
- 0xE964, 0xE964, 0x5007, 0xE965, 0xE965, 0x21BD, 0xE966, 0xE966, 0x5008,
- 0xE967, 0xE967, 0x1F87, 0xE968, 0xE968, 0x23C3, 0xE969, 0xE96B, 0x5009,
- 0xE96C, 0xE96C, 0x2269, 0xE96D, 0xE974, 0x500C, 0xE975, 0xE975, 0x1F43,
- 0xE976, 0xE976, 0x5014, 0xE977, 0xE977, 0x1F1E, 0xE978, 0xE978, 0x2679,
- 0xE979, 0xE979, 0x1EEB, 0xE97A, 0xE97B, 0x5015, 0xE97C, 0xE97C, 0x1F35,
- 0xE97D, 0xE97D, 0x208A, 0xE97E, 0xE97E, 0x5017, 0xE980, 0xE980, 0x23C7,
- 0xE981, 0xE981, 0x23C9, 0xE982, 0xE982, 0x23C6, 0xE983, 0xE986, 0x5018,
- 0xE987, 0xE987, 0x224F, 0xE988, 0xE98A, 0x501C, 0xE98B, 0xE98B, 0x23CB,
- 0xE98C, 0xE98D, 0x501F, 0xE98E, 0xE98E, 0x21F3, 0xE98F, 0xE98F, 0x5021,
- 0xE990, 0xE990, 0x21F7, 0xE991, 0xE991, 0x23CF, 0xE992, 0xE992, 0x23CE,
- 0xE993, 0xE993, 0x23CA, 0xE994, 0xE994, 0x23CD, 0xE995, 0xE997, 0x5022,
- 0xE998, 0xE998, 0x23D0, 0xE999, 0xE99A, 0x5025, 0xE99B, 0xE99B, 0x266C,
- 0xE99C, 0xE99C, 0x5027, 0xE99D, 0xE99D, 0x23C1, 0xE99E, 0xE99E, 0x5028,
- 0xE99F, 0xE99F, 0x1FEE, 0xE9A0, 0xE9A0, 0x23D1, 0xE9A1, 0xE9FE, 0x1895,
- 0xEA40, 0xEA40, 0x1FF8, 0xEA41, 0xEA43, 0x5029, 0xEA44, 0xEA44, 0x23D3,
- 0xEA45, 0xEA47, 0x502C, 0xEA48, 0xEA48, 0x23D2, 0xEA49, 0xEA49, 0x23D4,
- 0xEA4A, 0xEA4A, 0x1E98, 0xEA4B, 0xEA4F, 0x502F, 0xEA50, 0xEA50, 0x1F2C,
- 0xEA51, 0xEA51, 0x5034, 0xEA52, 0xEA52, 0x23D5, 0xEA53, 0xEA54, 0x5035,
- 0xEA55, 0xEA55, 0x1E71, 0xEA56, 0xEA56, 0x2691, 0xEA57, 0xEA58, 0x5037,
- 0xEA59, 0xEA59, 0x23C5, 0xEA5A, 0xEA7E, 0x5039, 0xEA80, 0xEA80, 0x231A,
- 0xEA81, 0xEA83, 0x505E, 0xEA84, 0xEA84, 0x2114, 0xEA85, 0xEA86, 0x5061,
- 0xEA87, 0xEA87, 0x2284, 0xEA88, 0xEA8D, 0x5063, 0xEA8E, 0xEA8E, 0x221C,
- 0xEA8F, 0xEA8F, 0x5069, 0xEA90, 0xEA90, 0x1E7E, 0xEA91, 0xEA91, 0x204D,
- 0xEA92, 0xEA95, 0x506A, 0xEA96, 0xEA96, 0x2201, 0xEA97, 0xEA9F, 0x506E,
- 0xEAA0, 0xEAA0, 0x1ED9, 0xEAA1, 0xEAFE, 0x18F3, 0xEB40, 0xEB40, 0x5077,
- 0xEB41, 0xEB41, 0x1FB2, 0xEB42, 0xEB44, 0x5078, 0xEB45, 0xEB45, 0x2252,
- 0xEB46, 0xEB47, 0x507B, 0xEB48, 0xEB48, 0x1F79, 0xEB49, 0xEB52, 0x507D,
- 0xEB53, 0xEB53, 0x2157, 0xEB54, 0xEB54, 0x5087, 0xEB55, 0xEB55, 0x21BF,
- 0xEB56, 0xEB5A, 0x5088, 0xEB5B, 0xEB5B, 0x221F, 0xEB5C, 0xEB5C, 0x508D,
- 0xEB5D, 0xEB5D, 0x203D, 0xEB5E, 0xEB5F, 0x508E, 0xEB60, 0xEB60, 0x2015,
- 0xEB61, 0xEB61, 0x5090, 0xEB62, 0xEB62, 0x26A5, 0xEB63, 0xEB6C, 0x5091,
- 0xEB6D, 0xEB6D, 0x2156, 0xEB6E, 0xEB6F, 0x509B, 0xEB70, 0xEB70, 0x2144,
- 0xEB71, 0xEB71, 0x509D, 0xEB72, 0xEB72, 0x1E91, 0xEB73, 0xEB73, 0x2257,
- 0xEB74, 0xEB77, 0x509E, 0xEB78, 0xEB78, 0x200A, 0xEB79, 0xEB79, 0x2092,
- 0xEB7A, 0xEB7E, 0x50A2, 0xEB80, 0xEB84, 0x50A7, 0xEB85, 0xEB85, 0x2250,
- 0xEB86, 0xEB89, 0x50AC, 0xEB8A, 0xEB8A, 0x1EC3, 0xEB8B, 0xEBA0, 0x50B0,
- 0xEBA1, 0xEBFE, 0x1951, 0xEC40, 0xEC45, 0x50C6, 0xEC46, 0xEC46, 0x21A8,
- 0xEC47, 0xEC55, 0x50CC, 0xEC56, 0xEC56, 0x260D, 0xEC57, 0xEC59, 0x50DB,
- 0xEC5A, 0xEC5A, 0x260C, 0xEC5B, 0xEC5B, 0x50DE, 0xEC5C, 0xEC5C, 0x260E,
- 0xEC5D, 0xEC5F, 0x50DF, 0xEC60, 0xEC60, 0x2032, 0xEC61, 0xEC6D, 0x50E2,
- 0xEC6E, 0xEC6E, 0x260B, 0xEC6F, 0xEC75, 0x50EF, 0xEC76, 0xEC76, 0x22C3,
- 0xEC77, 0xEC7E, 0x50F6, 0xEC80, 0xEC95, 0x50FE, 0xEC96, 0xEC96, 0x1F23,
- 0xEC97, 0xECA0, 0x5114, 0xECA1, 0xECFE, 0x19AF, 0xED40, 0xED45, 0x511E,
- 0xED46, 0xED46, 0x2695, 0xED47, 0xED57, 0x5124, 0xED58, 0xED58, 0x265E,
- 0xED59, 0xED5D, 0x5135, 0xED5E, 0xED5E, 0x265D, 0xED5F, 0xED60, 0x513A,
- 0xED61, 0xED61, 0x2692, 0xED62, 0xED63, 0x513C, 0xED64, 0xED64, 0x265F,
- 0xED65, 0xED65, 0x513E, 0xED66, 0xED66, 0x218D, 0xED67, 0xED67, 0x20FD,
- 0xED68, 0xED6D, 0x513F, 0xED6E, 0xED6E, 0x1F40, 0xED6F, 0xED73, 0x5145,
- 0xED74, 0xED74, 0x2465, 0xED75, 0xED76, 0x514A, 0xED77, 0xED77, 0x2467,
- 0xED78, 0xED78, 0x514C, 0xED79, 0xED79, 0x2466, 0xED7A, 0xED7E, 0x514D,
- 0xED80, 0xED90, 0x5152, 0xED91, 0xED91, 0x21C9, 0xED92, 0xED92, 0x5163,
- 0xED93, 0xED93, 0x2209, 0xED94, 0xED94, 0x1EC9, 0xED95, 0xED95, 0x20E9,
- 0xED96, 0xED96, 0x5164, 0xED97, 0xED97, 0x21CA, 0xED98, 0xED98, 0x2146,
- 0xED99, 0xED99, 0x25C5, 0xED9A, 0xED9A, 0x21DC, 0xED9B, 0xED9B, 0x5165,
- 0xED9C, 0xED9C, 0x245E, 0xED9D, 0xED9D, 0x5166, 0xED9E, 0xED9E, 0x214F,
- 0xED9F, 0xED9F, 0x5167, 0xEDA0, 0xEDA0, 0x25C6, 0xEDA1, 0xEDFE, 0x1A0D,
- 0xEE40, 0xEE40, 0x25C7, 0xEE41, 0xEE41, 0x2241, 0xEE42, 0xEE42, 0x218A,
- 0xEE43, 0xEE43, 0x1E2F, 0xEE44, 0xEE44, 0x1EDC, 0xEE45, 0xEE47, 0x5168,
- 0xEE48, 0xEE48, 0x20BF, 0xEE49, 0xEE49, 0x2034, 0xEE4A, 0xEE4C, 0x516B,
- 0xEE4D, 0xEE4D, 0x25C9, 0xEE4E, 0xEE51, 0x516E, 0xEE52, 0xEE52, 0x25C8,
- 0xEE53, 0xEE54, 0x5172, 0xEE55, 0xEE55, 0x220E, 0xEE56, 0xEE56, 0x5174,
- 0xEE57, 0xEE57, 0x25CB, 0xEE58, 0xEE5D, 0x5175, 0xEE5E, 0xEE5E, 0x217D,
- 0xEE5F, 0xEE60, 0x517B, 0xEE61, 0xEE61, 0x1F7E, 0xEE62, 0xEE67, 0x517D,
- 0xEE68, 0xEE68, 0x25CC, 0xEE69, 0xEE69, 0x1FC3, 0xEE6A, 0xEE6B, 0x5183,
- 0xEE6C, 0xEE6C, 0x20B9, 0xEE6D, 0xEE6D, 0x5185, 0xEE6E, 0xEE6E, 0x2181,
- 0xEE6F, 0xEE76, 0x5186, 0xEE77, 0xEE77, 0x1FDA, 0xEE78, 0xEE7C, 0x518E,
- 0xEE7D, 0xEE7D, 0x2173, 0xEE7E, 0xEE7E, 0x1EE1, 0xEE80, 0xEE80, 0x25CD,
- 0xEE81, 0xEE84, 0x5193, 0xEE85, 0xEE85, 0x25CE, 0xEE86, 0xEE86, 0x21F6,
- 0xEE87, 0xEE89, 0x5197, 0xEE8A, 0xEE8A, 0x224B, 0xEE8B, 0xEE8B, 0x25D1,
- 0xEE8C, 0xEE8C, 0x519A, 0xEE8D, 0xEE8D, 0x1EC0, 0xEE8E, 0xEE8F, 0x519B,
- 0xEE90, 0xEE90, 0x2008, 0xEE91, 0xEE93, 0x519D, 0xEE94, 0xEE94, 0x25D0,
- 0xEE95, 0xEE96, 0x51A0, 0xEE97, 0xEE97, 0x25D2, 0xEE98, 0xEE98, 0x51A2,
- 0xEE99, 0xEE99, 0x1F2A, 0xEE9A, 0xEE9C, 0x51A3, 0xEE9D, 0xEE9D, 0x1E72,
- 0xEE9E, 0xEE9E, 0x25D3, 0xEE9F, 0xEEA0, 0x51A6, 0xEEA1, 0xEEFE, 0x1A6B,
- 0xEF40, 0xEF40, 0x21BE, 0xEF41, 0xEF41, 0x25D4, 0xEF42, 0xEF42, 0x2044,
- 0xEF43, 0xEF43, 0x51A8, 0xEF44, 0xEF44, 0x25CF, 0xEF45, 0xEF45, 0x20F3,
- 0xEF46, 0xEF4B, 0x51A9, 0xEF4C, 0xEF4C, 0x1F00, 0xEF4D, 0xEF51, 0x51AF,
- 0xEF52, 0xEF53, 0x24CC, 0xEF54, 0xEF54, 0x51B4, 0xEF55, 0xEF55, 0x2698,
- 0xEF56, 0xEF56, 0x51B5, 0xEF57, 0xEF57, 0x2678, 0xEF58, 0xEF59, 0x51B6,
- 0xEF5A, 0xEF5A, 0x24CE, 0xEF5B, 0xEF5F, 0x51B8, 0xEF60, 0xEF60, 0x24CF,
- 0xEF61, 0xEF67, 0x51BD, 0xEF68, 0xEF68, 0x20B8, 0xEF69, 0xEF69, 0x51C4,
- 0xEF6A, 0xEF6A, 0x24D0, 0xEF6B, 0xEF6B, 0x51C5, 0xEF6C, 0xEF6C, 0x24D1,
- 0xEF6D, 0xEF76, 0x51C6, 0xEF77, 0xEF77, 0x1EF4, 0xEF78, 0xEF79, 0x51D0,
- 0xEF7A, 0xEF7A, 0x239B, 0xEF7B, 0xEF7B, 0x51D2, 0xEF7C, 0xEF7C, 0x267E,
- 0xEF7D, 0xEF7E, 0x51D3, 0xEF80, 0xEF81, 0x51D5, 0xEF82, 0xEF82, 0x239D,
- 0xEF83, 0xEF84, 0x239F, 0xEF85, 0xEF85, 0x51D7, 0xEF86, 0xEF86, 0x23A1,
- 0xEF87, 0xEF87, 0x51D8, 0xEF88, 0xEF88, 0x1EF1, 0xEF89, 0xEF8A, 0x51D9,
- 0xEF8B, 0xEF8B, 0x221E, 0xEF8C, 0xEF8C, 0x51DB, 0xEF8D, 0xEF8D, 0x23A2,
- 0xEF8E, 0xEF94, 0x51DC, 0xEF95, 0xEF95, 0x214B, 0xEF96, 0xEF96, 0x1E36,
- 0xEF97, 0xEF97, 0x2135, 0xEF98, 0xEF9B, 0x51E3, 0xEF9C, 0xEF9C, 0x1FAD,
- 0xEF9D, 0xEF9D, 0x51E7, 0xEF9E, 0xEF9E, 0x1E53, 0xEF9F, 0xEFA0, 0x51E8,
- 0xEFA1, 0xEFFE, 0x1AC9, 0xF040, 0xF040, 0x51EA, 0xF041, 0xF041, 0x23A3,
- 0xF042, 0xF042, 0x2203, 0xF043, 0xF043, 0x51EB, 0xF044, 0xF044, 0x1EE7,
- 0xF045, 0xF046, 0x51EC, 0xF047, 0xF047, 0x23A4, 0xF048, 0xF048, 0x2097,
- 0xF049, 0xF049, 0x1EE4, 0xF04A, 0xF04D, 0x51EE, 0xF04E, 0xF04E, 0x2238,
- 0xF04F, 0xF050, 0x51F2, 0xF051, 0xF051, 0x23A5, 0xF052, 0xF053, 0x51F4,
- 0xF054, 0xF054, 0x1F9A, 0xF055, 0xF056, 0x51F6, 0xF057, 0xF057, 0x21C3,
- 0xF058, 0xF05D, 0x51F8, 0xF05E, 0xF05E, 0x1F2E, 0xF05F, 0xF067, 0x51FE,
- 0xF068, 0xF068, 0x239C, 0xF069, 0xF06B, 0x5207, 0xF06C, 0xF06C, 0x23A6,
- 0xF06D, 0xF070, 0x520A, 0xF071, 0xF071, 0x239E, 0xF072, 0xF072, 0x520E,
- 0xF073, 0xF073, 0x2035, 0xF074, 0xF074, 0x23A7, 0xF075, 0xF077, 0x520F,
- 0xF078, 0xF078, 0x23A8, 0xF079, 0xF079, 0x5212, 0xF07A, 0xF07A, 0x2075,
- 0xF07B, 0xF07C, 0x5213, 0xF07D, 0xF07E, 0x23A9, 0xF080, 0xF080, 0x23AB,
- 0xF081, 0xF081, 0x1FEB, 0xF082, 0xF082, 0x23AC, 0xF083, 0xF086, 0x5215,
- 0xF087, 0xF087, 0x1F6A, 0xF088, 0xF088, 0x20F9, 0xF089, 0xF08A, 0x5219,
- 0xF08B, 0xF08B, 0x2666, 0xF08C, 0xF08F, 0x521B, 0xF090, 0xF090, 0x2667,
- 0xF091, 0xF091, 0x521F, 0xF092, 0xF092, 0x1E6C, 0xF093, 0xF095, 0x5220,
- 0xF096, 0xF096, 0x23AD, 0xF097, 0xF0A0, 0x5223, 0xF0A1, 0xF0FE, 0x1B27,
- 0xF140, 0xF151, 0x522D, 0xF152, 0xF152, 0x206D, 0xF153, 0xF153, 0x2242,
- 0xF154, 0xF154, 0x1F02, 0xF155, 0xF156, 0x523F, 0xF157, 0xF157, 0x2183,
- 0xF158, 0xF158, 0x5241, 0xF159, 0xF159, 0x1E85, 0xF15A, 0xF15A, 0x21E9,
- 0xF15B, 0xF166, 0x5242, 0xF167, 0xF167, 0x1E57, 0xF168, 0xF175, 0x524E,
- 0xF176, 0xF176, 0x22A5, 0xF177, 0xF177, 0x2407, 0xF178, 0xF178, 0x1FCA,
- 0xF179, 0xF179, 0x525C, 0xF17A, 0xF17A, 0x2402, 0xF17B, 0xF17B, 0x1F82,
- 0xF17C, 0xF17D, 0x525D, 0xF17E, 0xF17E, 0x2408, 0xF180, 0xF180, 0x2404,
- 0xF181, 0xF181, 0x525F, 0xF182, 0xF182, 0x2131, 0xF183, 0xF183, 0x5260,
- 0xF184, 0xF184, 0x2184, 0xF185, 0xF185, 0x5261, 0xF186, 0xF186, 0x2403,
- 0xF187, 0xF187, 0x5262, 0xF188, 0xF188, 0x206E, 0xF189, 0xF189, 0x240B,
- 0xF18A, 0xF193, 0x5263, 0xF194, 0xF194, 0x1F3F, 0xF195, 0xF197, 0x526D,
- 0xF198, 0xF198, 0x2067, 0xF199, 0xF1A0, 0x5270, 0xF1A1, 0xF1FE, 0x1B85,
- 0xF240, 0xF244, 0x5278, 0xF245, 0xF245, 0x1FD7, 0xF246, 0xF246, 0x527D,
- 0xF247, 0xF247, 0x1E83, 0xF248, 0xF24A, 0x527E, 0xF24B, 0xF24B, 0x240F,
- 0xF24C, 0xF252, 0x5281, 0xF253, 0xF253, 0x240E, 0xF254, 0xF254, 0x20C7,
- 0xF255, 0xF255, 0x240D, 0xF256, 0xF25B, 0x5288, 0xF25C, 0xF25C, 0x2412,
- 0xF25D, 0xF25E, 0x528E, 0xF25F, 0xF25F, 0x20B7, 0xF260, 0xF270, 0x5290,
- 0xF271, 0xF271, 0x23F0, 0xF272, 0xF272, 0x52A1, 0xF273, 0xF273, 0x2411,
- 0xF274, 0xF274, 0x2414, 0xF275, 0xF275, 0x52A2, 0xF276, 0xF276, 0x2170,
- 0xF277, 0xF27B, 0x52A3, 0xF27C, 0xF27C, 0x2405, 0xF27D, 0xF27D, 0x210C,
- 0xF27E, 0xF27E, 0x2415, 0xF280, 0xF284, 0x52A8, 0xF285, 0xF285, 0x2066,
- 0xF286, 0xF286, 0x52AD, 0xF287, 0xF287, 0x2352, 0xF288, 0xF288, 0x2413,
- 0xF289, 0xF289, 0x2410, 0xF28A, 0xF28B, 0x2416, 0xF28C, 0xF28C, 0x20F1,
- 0xF28D, 0xF290, 0x52AE, 0xF291, 0xF291, 0x240A, 0xF292, 0xF293, 0x52B2,
- 0xF294, 0xF294, 0x2409, 0xF295, 0xF295, 0x52B4, 0xF296, 0xF296, 0x2418,
- 0xF297, 0xF29B, 0x52B5, 0xF29C, 0xF29C, 0x1FA7, 0xF29D, 0xF29D, 0x52BA,
- 0xF29E, 0xF29E, 0x21FC, 0xF29F, 0xF2A0, 0x52BB, 0xF2A1, 0xF2FE, 0x1BE3,
- 0xF340, 0xF340, 0x1FC1, 0xF341, 0xF341, 0x2406, 0xF342, 0xF344, 0x52BD,
- 0xF345, 0xF345, 0x229C, 0xF346, 0xF347, 0x52C0, 0xF348, 0xF348, 0x204E,
- 0xF349, 0xF349, 0x52C2, 0xF34A, 0xF34A, 0x241A, 0xF34B, 0xF34B, 0x2419,
- 0xF34C, 0xF34F, 0x52C3, 0xF350, 0xF350, 0x240C, 0xF351, 0xF360, 0x52C7,
- 0xF361, 0xF361, 0x1E29, 0xF362, 0xF373, 0x52D7, 0xF374, 0xF374, 0x2661,
- 0xF375, 0xF375, 0x52E9, 0xF376, 0xF376, 0x26A4, 0xF377, 0xF377, 0x2174,
- 0xF378, 0xF378, 0x2663, 0xF379, 0xF379, 0x2662, 0xF37A, 0xF37E, 0x52EA,
- 0xF380, 0xF38B, 0x52EF, 0xF38C, 0xF38C, 0x2675, 0xF38D, 0xF39F, 0x52FB,
- 0xF3A0, 0xF3A0, 0x214C, 0xF3A1, 0xF3FE, 0x1C41, 0xF440, 0xF444, 0x530E,
- 0xF445, 0xF445, 0x267A, 0xF446, 0xF44F, 0x5313, 0xF450, 0xF450, 0x26A0,
- 0xF451, 0xF456, 0x531D, 0xF457, 0xF457, 0x2668, 0xF458, 0xF458, 0x5323,
- 0xF459, 0xF459, 0x1ED0, 0xF45A, 0xF45A, 0x5324, 0xF45B, 0xF45B, 0x2096,
- 0xF45C, 0xF45C, 0x5325, 0xF45D, 0xF45D, 0x23CC, 0xF45E, 0xF461, 0x5326,
- 0xF462, 0xF462, 0x23C8, 0xF463, 0xF463, 0x532A, 0xF464, 0xF464, 0x223E,
- 0xF465, 0xF474, 0x532B, 0xF475, 0xF475, 0x2665, 0xF476, 0xF47B, 0x533B,
- 0xF47C, 0xF47C, 0x2664, 0xF47D, 0xF47D, 0x5341, 0xF47E, 0xF47E, 0x2239,
- 0xF480, 0xF493, 0x5342, 0xF494, 0xF494, 0x204A, 0xF495, 0xF498, 0x5356,
- 0xF499, 0xF499, 0x261F, 0xF49A, 0xF49B, 0x535A, 0xF49C, 0xF49C, 0x261E,
- 0xF49D, 0xF4A0, 0x535C, 0xF4A1, 0xF4FE, 0x1C9F, 0xF540, 0xF544, 0x5360,
- 0xF545, 0xF545, 0x2620, 0xF546, 0xF546, 0x5365, 0xF547, 0xF547, 0x2621,
- 0xF548, 0xF551, 0x5366, 0xF552, 0xF552, 0x2622, 0xF553, 0xF553, 0x5370,
- 0xF554, 0xF554, 0x2627, 0xF555, 0xF555, 0x1E39, 0xF556, 0xF556, 0x2625,
- 0xF557, 0xF55D, 0x5371, 0xF55E, 0xF55E, 0x2629, 0xF55F, 0xF560, 0x5378,
- 0xF561, 0xF561, 0x262E, 0xF562, 0xF562, 0x262B, 0xF563, 0xF56D, 0x537A,
- 0xF56E, 0xF56E, 0x262A, 0xF56F, 0xF56F, 0x262D, 0xF570, 0xF570, 0x5385,
- 0xF571, 0xF571, 0x2628, 0xF572, 0xF572, 0x21B9, 0xF573, 0xF57E, 0x5386,
- 0xF580, 0xF584, 0x5392, 0xF585, 0xF585, 0x2636, 0xF586, 0xF586, 0x2630,
- 0xF587, 0xF58B, 0x5397, 0xF58C, 0xF58C, 0x2638, 0xF58D, 0xF58D, 0x539C,
- 0xF58E, 0xF58E, 0x200D, 0xF58F, 0xF58F, 0x2637, 0xF590, 0xF598, 0x539D,
- 0xF599, 0xF599, 0x2645, 0xF59A, 0xF59A, 0x53A6, 0xF59B, 0xF59B, 0x263A,
- 0xF59C, 0xF59F, 0x53A7, 0xF5A0, 0xF5A0, 0x2643, 0xF5A1, 0xF5FE, 0x1CFD,
- 0xF640, 0xF640, 0x53AB, 0xF641, 0xF641, 0x2640, 0xF642, 0xF644, 0x53AC,
- 0xF645, 0xF645, 0x263D, 0xF646, 0xF646, 0x2641, 0xF647, 0xF647, 0x53AF,
- 0xF648, 0xF648, 0x263E, 0xF649, 0xF64A, 0x53B0, 0xF64B, 0xF64B, 0x263F,
- 0xF64C, 0xF64C, 0x1FC0, 0xF64D, 0xF64D, 0x53B2, 0xF64E, 0xF64F, 0x263B,
- 0xF650, 0xF653, 0x53B3, 0xF654, 0xF654, 0x2642, 0xF655, 0xF657, 0x53B7,
- 0xF658, 0xF658, 0x2644, 0xF659, 0xF660, 0x53BA, 0xF661, 0xF661, 0x2639,
- 0xF662, 0xF662, 0x53C2, 0xF663, 0xF663, 0x264C, 0xF664, 0xF66B, 0x53C3,
- 0xF66C, 0xF66C, 0x2647, 0xF66D, 0xF66D, 0x264B, 0xF66E, 0xF670, 0x53CB,
- 0xF671, 0xF671, 0x2649, 0xF672, 0xF673, 0x53CE, 0xF674, 0xF674, 0x2648,
- 0xF675, 0xF675, 0x53D0, 0xF676, 0xF676, 0x264A, 0xF677, 0xF677, 0x2108,
- 0xF678, 0xF67E, 0x53D1, 0xF680, 0xF684, 0x53D8, 0xF685, 0xF685, 0x264D,
- 0xF686, 0xF687, 0x53DD, 0xF688, 0xF688, 0x2634, 0xF689, 0xF689, 0x53DF,
- 0xF68A, 0xF68A, 0x2651, 0xF68B, 0xF68C, 0x53E0, 0xF68D, 0xF68D, 0x2650,
- 0xF68E, 0xF68E, 0x2652, 0xF68F, 0xF691, 0x53E2, 0xF692, 0xF692, 0x264F,
- 0xF693, 0xF695, 0x53E5, 0xF696, 0xF696, 0x2632, 0xF697, 0xF697, 0x264E,
- 0xF698, 0xF698, 0x2653, 0xF699, 0xF699, 0x53E8, 0xF69A, 0xF69A, 0x2657,
- 0xF69B, 0xF69B, 0x53E9, 0xF69C, 0xF69C, 0x2635, 0xF69D, 0xF69D, 0x53EA,
- 0xF69E, 0xF69E, 0x2633, 0xF69F, 0xF69F, 0x53EB, 0xF6A0, 0xF6A0, 0x2656,
- 0xF6A1, 0xF6FE, 0x1D5B, 0xF740, 0xF741, 0x53EC, 0xF742, 0xF742, 0x2654,
- 0xF743, 0xF748, 0x53EE, 0xF749, 0xF749, 0x2658, 0xF74A, 0xF74B, 0x53F4,
- 0xF74C, 0xF74C, 0x2655, 0xF74D, 0xF74D, 0x1E4D, 0xF74E, 0xF755, 0x53F6,
- 0xF756, 0xF756, 0x265B, 0xF757, 0xF757, 0x53FE, 0xF758, 0xF758, 0x265A,
- 0xF759, 0xF759, 0x53FF, 0xF75A, 0xF75A, 0x2659, 0xF75B, 0xF75B, 0x202E,
- 0xF75C, 0xF75C, 0x262F, 0xF75D, 0xF760, 0x5400, 0xF761, 0xF761, 0x2646,
- 0xF762, 0xF762, 0x5404, 0xF763, 0xF763, 0x2626, 0xF764, 0xF76A, 0x5405,
- 0xF76B, 0xF76B, 0x265C, 0xF76C, 0xF770, 0x540C, 0xF771, 0xF771, 0x262C,
- 0xF772, 0xF77B, 0x5411, 0xF77C, 0xF77C, 0x2623, 0xF77D, 0xF77D, 0x541B,
- 0xF77E, 0xF77E, 0x2631, 0xF780, 0xF7A0, 0x541C, 0xF7A1, 0xF7FE, 0x1DB9,
- 0xF840, 0xF841, 0x543D, 0xF842, 0xF842, 0x209C, 0xF843, 0xF845, 0x543F,
- 0xF846, 0xF846, 0x2580, 0xF847, 0xF848, 0x5442, 0xF849, 0xF849, 0x22DC,
- 0xF84A, 0xF84F, 0x5444, 0xF850, 0xF850, 0x1F05, 0xF851, 0xF851, 0x208B,
- 0xF852, 0xF852, 0x544A, 0xF853, 0xF853, 0x2581, 0xF854, 0xF862, 0x544B,
- 0xF863, 0xF863, 0x2583, 0xF864, 0xF864, 0x2582, 0xF865, 0xF865, 0x545A,
- 0xF866, 0xF866, 0x21EE, 0xF867, 0xF871, 0x545B, 0xF872, 0xF872, 0x2182,
- 0xF873, 0xF877, 0x5466, 0xF878, 0xF878, 0x2243, 0xF879, 0xF879, 0x546B,
- 0xF87A, 0xF87A, 0x2587, 0xF87B, 0xF87B, 0x546C, 0xF87C, 0xF87C, 0x2588,
- 0xF87D, 0xF87E, 0x546D, 0xF880, 0xF880, 0x546F, 0xF881, 0xF881, 0x2584,
- 0xF882, 0xF883, 0x5470, 0xF884, 0xF884, 0x21FD, 0xF885, 0xF885, 0x5472,
- 0xF886, 0xF886, 0x21EF, 0xF887, 0xF88C, 0x5473, 0xF88D, 0xF88D, 0x258A,
- 0xF88E, 0xF88E, 0x258C, 0xF88F, 0xF898, 0x5479, 0xF899, 0xF899, 0x1F47,
- 0xF89A, 0xF89C, 0x5483, 0xF89D, 0xF89D, 0x1F1D, 0xF89E, 0xF89F, 0x5486,
- 0xF8A0, 0xF8A0, 0x258D, 0xF940, 0xF94D, 0x5488, 0xF94E, 0xF94E, 0x1FD0,
- 0xF94F, 0xF94F, 0x2592, 0xF950, 0xF950, 0x258F, 0xF951, 0xF958, 0x5496,
- 0xF959, 0xF959, 0x2594, 0xF95A, 0xF95A, 0x1EE0, 0xF95B, 0xF95C, 0x549E,
- 0xF95D, 0xF95D, 0x2591, 0xF95E, 0xF95E, 0x2595, 0xF95F, 0xF966, 0x54A0,
- 0xF967, 0xF967, 0x2597, 0xF968, 0xF968, 0x54A8, 0xF969, 0xF969, 0x20B6,
- 0xF96A, 0xF96B, 0x54A9, 0xF96C, 0xF96C, 0x2598, 0xF96D, 0xF96E, 0x54AB,
- 0xF96F, 0xF96F, 0x20F6, 0xF970, 0xF97E, 0x54AD, 0xF980, 0xF984, 0x54BC,
- 0xF985, 0xF985, 0x2585, 0xF986, 0xF986, 0x54C1, 0xF987, 0xF987, 0x2599,
- 0xF988, 0xF990, 0x54C2, 0xF991, 0xF991, 0x2596, 0xF992, 0xF995, 0x54CB,
- 0xF996, 0xF996, 0x259A, 0xF997, 0xF997, 0x54CF, 0xF998, 0xF998, 0x259B,
- 0xF999, 0xF9A0, 0x54D0, 0xFA40, 0xFA41, 0x54D8, 0xFA42, 0xFA42, 0x259D,
- 0xFA43, 0xFA45, 0x54DA, 0xFA46, 0xFA46, 0x259E, 0xFA47, 0xFA4B, 0x54DD,
- 0xFA4C, 0xFA4C, 0x234C, 0xFA4D, 0xFA50, 0x54E2, 0xFA51, 0xFA51, 0x1F44,
- 0xFA52, 0xFA57, 0x54E6, 0xFA58, 0xFA58, 0x2660, 0xFA59, 0xFA59, 0x25A0,
- 0xFA5A, 0xFA5C, 0x54EC, 0xFA5D, 0xFA5D, 0x259C, 0xFA5E, 0xFA5E, 0x54EF,
- 0xFA5F, 0xFA5F, 0x259F, 0xFA60, 0xFA60, 0x54F0, 0xFA61, 0xFA61, 0x1F6C,
- 0xFA62, 0xFA6F, 0x54F1, 0xFA70, 0xFA70, 0x25A2, 0xFA71, 0xFA73, 0x54FF,
- 0xFA74, 0xFA74, 0x20AE, 0xFA75, 0xFA75, 0x5502, 0xFA76, 0xFA76, 0x258B,
- 0xFA77, 0xFA77, 0x25A3, 0xFA78, 0xFA7E, 0x5503, 0xFA80, 0xFA82, 0x550A,
- 0xFA83, 0xFA83, 0x2589, 0xFA84, 0xFA84, 0x25A5, 0xFA85, 0xFA8C, 0x550D,
- 0xFA8D, 0xFA8D, 0x25A4, 0xFA8E, 0xFA8F, 0x5515, 0xFA90, 0xFA90, 0x25A6,
- 0xFA91, 0xFA91, 0x2593, 0xFA92, 0xFA95, 0x5517, 0xFA96, 0xFA96, 0x25A7,
- 0xFA97, 0xFA97, 0x2222, 0xFA98, 0xFA98, 0x25A9, 0xFA99, 0xFAA0, 0x551B,
- 0xFB40, 0xFB48, 0x5523, 0xFB49, 0xFB49, 0x25A8, 0xFB4A, 0xFB51, 0x552C,
- 0xFB52, 0xFB52, 0x2586, 0xFB53, 0xFB56, 0x5534, 0xFB57, 0xFB57, 0x25A1,
- 0xFB58, 0xFB58, 0x25AA, 0xFB59, 0xFB59, 0x5538, 0xFB5A, 0xFB5A, 0x2590,
- 0xFB5B, 0xFB5B, 0x258E, 0xFB5C, 0xFB74, 0x5539, 0xFB75, 0xFB75, 0x2688,
- 0xFB76, 0xFB78, 0x5552, 0xFB79, 0xFB79, 0x269E, 0xFB7A, 0xFB7A, 0x25FB,
- 0xFB7B, 0xFB7B, 0x5555, 0xFB7C, 0xFB7C, 0x1F8C, 0xFB7D, 0xFB7D, 0x21F4,
- 0xFB7E, 0xFB7E, 0x5556, 0xFB80, 0xFB8F, 0x5557, 0xFB90, 0xFB90, 0x200F,
- 0xFB91, 0xFB9B, 0x5567, 0xFB9C, 0xFB9C, 0x2071, 0xFB9D, 0xFB9E, 0x5572,
- 0xFB9F, 0xFB9F, 0x25F7, 0xFBA0, 0xFBA0, 0x5574, 0xFC40, 0xFC43, 0x5575,
- 0xFC44, 0xFC44, 0x2696, 0xFC45, 0xFC48, 0x5579, 0xFC49, 0xFC49, 0x268F,
- 0xFC4A, 0xFC59, 0x557D, 0xFC5A, 0xFC5A, 0x22DA, 0xFC5B, 0xFC62, 0x558D,
- 0xFC63, 0xFC63, 0x1EC1, 0xFC64, 0xFC67, 0x5595, 0xFC68, 0xFC68, 0x1EB3,
- 0xFC69, 0xFC6E, 0x5599, 0xFC6F, 0xFC6F, 0x266A, 0xFC70, 0xFC70, 0x559F,
- 0xFC71, 0xFC71, 0x268A, 0xFC72, 0xFC73, 0x55A0, 0xFC74, 0xFC74, 0x2669,
- 0xFC75, 0xFC76, 0x55A2, 0xFC77, 0xFC78, 0x2618, 0xFC79, 0xFC7E, 0x55A4,
- 0xFC80, 0xFC82, 0x55AA, 0xFC83, 0xFC83, 0x261A, 0xFC84, 0xFC89, 0x55AD,
- 0xFC8A, 0xFC8A, 0x2673, 0xFC8B, 0xFCA0, 0x55B3, 0xFD40, 0xFD51, 0x55C9,
- 0xFD52, 0xFD52, 0x20C6, 0xFD53, 0xFD53, 0x226B, 0xFD54, 0xFD56, 0x55DB,
- 0xFD57, 0xFD57, 0x24D3, 0xFD58, 0xFD58, 0x1E86, 0xFD59, 0xFD59, 0x55DE,
- 0xFD5A, 0xFD5A, 0x260F, 0xFD5B, 0xFD5E, 0x55DF, 0xFD5F, 0xFD5F, 0x2611,
- 0xFD60, 0xFD61, 0x55E3, 0xFD62, 0xFD62, 0x2613, 0xFD63, 0xFD64, 0x55E5,
- 0xFD65, 0xFD65, 0x2610, 0xFD66, 0xFD66, 0x2612, 0xFD67, 0xFD67, 0x2030,
- 0xFD68, 0xFD68, 0x55E7, 0xFD69, 0xFD69, 0x2671, 0xFD6A, 0xFD6B, 0x55E8,
- 0xFD6C, 0xFD6C, 0x2614, 0xFD6D, 0xFD6F, 0x55EA, 0xFD70, 0xFD70, 0x2616,
- 0xFD71, 0xFD71, 0x55ED, 0xFD72, 0xFD72, 0x2615, 0xFD73, 0xFD77, 0x55EE,
- 0xFD78, 0xFD78, 0x20F2, 0xFD79, 0xFD7C, 0x55F3, 0xFD7D, 0xFD7D, 0x2617,
- 0xFD7E, 0xFD7E, 0x55F7, 0xFD80, 0xFD87, 0x55F8, 0xFD88, 0xFD88, 0x2037,
- 0xFD89, 0xFD8A, 0x5600, 0xFD8B, 0xFD8B, 0x20B3, 0xFD8C, 0xFD8E, 0x5602,
- 0xFD8F, 0xFD8F, 0x1F22, 0xFD90, 0xFD90, 0x24ED, 0xFD91, 0xFD93, 0x5605,
- 0xFD94, 0xFD94, 0x1F34, 0xFD95, 0xFD9C, 0x5608, 0xFD9D, 0xFD9D, 0x0A02,
- 0xFD9E, 0xFD9E, 0x40D3, 0xFD9F, 0xFD9F, 0x200C, 0xFDA0, 0xFDA0, 0x5083,
- 0xFE40, 0xFE40, 0x1259, 0xFE41, 0xFE7E, 0x5610, 0xFE80, 0xFEA0, 0x564E,
-};
+// 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
+
+extern const unsigned short g_FXCMAP_GBK_EUC_H_2[4071 * 3] = {
+ 0x0020, 0x0020, 0x1E24, 0x0021, 0x007E, 0x032E, 0x8140, 0x8178, 0x2758,
+ 0x8179, 0x8179, 0x2059, 0x817A, 0x817E, 0x2791, 0x8180, 0x8185, 0x2796,
+ 0x8186, 0x8186, 0x21F1, 0x8187, 0x81EC, 0x279C, 0x81ED, 0x81ED, 0x1FF2,
+ 0x81EE, 0x81F5, 0x2802, 0x81F6, 0x81F6, 0x205D, 0x81F7, 0x81FE, 0x280A,
+ 0x8240, 0x8252, 0x2812, 0x8253, 0x8253, 0x269C, 0x8254, 0x8261, 0x2825,
+ 0x8262, 0x8262, 0x21B5, 0x8263, 0x8273, 0x2833, 0x8274, 0x8274, 0x22CC,
+ 0x8275, 0x8279, 0x2844, 0x827A, 0x827A, 0x2016, 0x827B, 0x827C, 0x2849,
+ 0x827D, 0x827D, 0x1E62, 0x827E, 0x827E, 0x284B, 0x8280, 0x8280, 0x1F20,
+ 0x8281, 0x8282, 0x284C, 0x8283, 0x8283, 0x207F, 0x8284, 0x828F, 0x284E,
+ 0x8290, 0x8290, 0x205C, 0x8291, 0x82A4, 0x285A, 0x82A5, 0x82A5, 0x2194,
+ 0x82A6, 0x82C7, 0x286E, 0x82C8, 0x82C8, 0x1E65, 0x82C9, 0x82C9, 0x2281,
+ 0x82CA, 0x82E0, 0x2890, 0x82E1, 0x82E1, 0x22CD, 0x82E2, 0x82E2, 0x28A7,
+ 0x82E3, 0x82E3, 0x210A, 0x82E4, 0x82E4, 0x1E3E, 0x82E5, 0x82EC, 0x28A8,
+ 0x82ED, 0x82ED, 0x267F, 0x82EE, 0x82F1, 0x28B0, 0x82F2, 0x82F2, 0x222E,
+ 0x82F3, 0x82F6, 0x28B4, 0x82F7, 0x82F7, 0x1E96, 0x82F8, 0x82F8, 0x22CB,
+ 0x82F9, 0x82F9, 0x226C, 0x82FA, 0x82FA, 0x28B8, 0x82FB, 0x82FB, 0x2117,
+ 0x82FC, 0x82FE, 0x28B9, 0x8340, 0x8340, 0x28BC, 0x8341, 0x8341, 0x20E8,
+ 0x8342, 0x8344, 0x28BD, 0x8345, 0x8345, 0x22D4, 0x8346, 0x8347, 0x28C0,
+ 0x8348, 0x8348, 0x1FB9, 0x8349, 0x834B, 0x28C2, 0x834C, 0x834C, 0x22D8,
+ 0x834D, 0x8352, 0x28C5, 0x8353, 0x8353, 0x20DF, 0x8354, 0x8356, 0x28CB,
+ 0x8357, 0x8357, 0x20C2, 0x8358, 0x835D, 0x28CE, 0x835E, 0x835E, 0x2195,
+ 0x835F, 0x8364, 0x28D4, 0x8365, 0x8365, 0x1FAC, 0x8366, 0x8366, 0x22D3,
+ 0x8367, 0x8371, 0x28DA, 0x8372, 0x8372, 0x1F81, 0x8373, 0x8377, 0x28E5,
+ 0x8378, 0x8378, 0x2210, 0x8379, 0x8379, 0x28EA, 0x837A, 0x837A, 0x22CF,
+ 0x837B, 0x837B, 0x28EB, 0x837C, 0x837C, 0x2213, 0x837D, 0x837D, 0x28EC,
+ 0x837E, 0x837E, 0x1FE4, 0x8380, 0x8380, 0x1F90, 0x8381, 0x8385, 0x28ED,
+ 0x8386, 0x8386, 0x22D6, 0x8387, 0x8388, 0x28F2, 0x8389, 0x8389, 0x22D0,
+ 0x838A, 0x838A, 0x22CE, 0x838B, 0x838C, 0x28F4, 0x838D, 0x838D, 0x2681,
+ 0x838E, 0x8393, 0x28F6, 0x8394, 0x8394, 0x1E76, 0x8395, 0x839D, 0x28FC,
+ 0x839E, 0x839E, 0x2231, 0x839F, 0x83A5, 0x2905, 0x83A6, 0x83A6, 0x1E93,
+ 0x83A7, 0x83AA, 0x290C, 0x83AB, 0x83AB, 0x22D2, 0x83AC, 0x83AD, 0x2910,
+ 0x83AE, 0x83AE, 0x22D7, 0x83AF, 0x83AF, 0x22D5, 0x83B0, 0x83B0, 0x22D1,
+ 0x83B1, 0x83B9, 0x2912, 0x83BA, 0x83BA, 0x1EE5, 0x83BB, 0x83C8, 0x291B,
+ 0x83C9, 0x83C9, 0x2025, 0x83CA, 0x83F5, 0x2929, 0x83F6, 0x83F6, 0x1ECF,
+ 0x83F7, 0x83FE, 0x2955, 0x8440, 0x844F, 0x295D, 0x8450, 0x8450, 0x1FD9,
+ 0x8451, 0x8470, 0x296D, 0x8471, 0x8471, 0x22C8, 0x8472, 0x8473, 0x298D,
+ 0x8474, 0x8474, 0x2263, 0x8475, 0x8476, 0x298F, 0x8477, 0x8477, 0x2683,
+ 0x8478, 0x847E, 0x2991, 0x8480, 0x8481, 0x2998, 0x8482, 0x8482, 0x1F17,
+ 0x8483, 0x848D, 0x299A, 0x848E, 0x848E, 0x1F2B, 0x848F, 0x8491, 0x29A5,
+ 0x8492, 0x8492, 0x22CA, 0x8493, 0x8493, 0x1E99, 0x8494, 0x849C, 0x29A8,
+ 0x849D, 0x849D, 0x1F4F, 0x849E, 0x84A0, 0x29B1, 0x84A1, 0x84A1, 0x1FCF,
+ 0x84A2, 0x84A2, 0x2036, 0x84A3, 0x84A3, 0x1F3A, 0x84A4, 0x84A4, 0x29B4,
+ 0x84A5, 0x84A5, 0x22C9, 0x84A6, 0x84A6, 0x1F99, 0x84A7, 0x84A8, 0x29B5,
+ 0x84A9, 0x84A9, 0x1F75, 0x84AA, 0x84C4, 0x29B7, 0x84C5, 0x84C5, 0x1FBE,
+ 0x84C6, 0x84D2, 0x29D2, 0x84D3, 0x84D3, 0x1ECD, 0x84D4, 0x84D4, 0x29DF,
+ 0x84D5, 0x84D5, 0x21A9, 0x84D6, 0x84D6, 0x29E0, 0x84D7, 0x84D7, 0x21E6,
+ 0x84D8, 0x84D8, 0x29E1, 0x84D9, 0x84D9, 0x2127, 0x84DA, 0x84DA, 0x2003,
+ 0x84DB, 0x84DC, 0x29E2, 0x84DD, 0x84DD, 0x2132, 0x84DE, 0x84E9, 0x29E4,
+ 0x84EA, 0x84EA, 0x2323, 0x84EB, 0x84ED, 0x29F0, 0x84EE, 0x84EE, 0x2011,
+ 0x84EF, 0x84F0, 0x29F3, 0x84F1, 0x84F1, 0x20F5, 0x84F2, 0x84FE, 0x29F5,
+ 0x8540, 0x8550, 0x2A02, 0x8551, 0x8551, 0x22C5, 0x8552, 0x8552, 0x1F5E,
+ 0x8553, 0x8553, 0x2A13, 0x8554, 0x8554, 0x22C6, 0x8555, 0x855D, 0x2A14,
+ 0x855E, 0x855E, 0x20EF, 0x855F, 0x8565, 0x2A1D, 0x8566, 0x8566, 0x21D0,
+ 0x8567, 0x857E, 0x2A24, 0x8580, 0x8586, 0x2A3C, 0x8587, 0x8587, 0x22C1,
+ 0x8588, 0x858A, 0x2A43, 0x858B, 0x858B, 0x1E64, 0x858C, 0x8591, 0x2A46,
+ 0x8592, 0x8592, 0x21F9, 0x8593, 0x8595, 0x2A4C, 0x8596, 0x8596, 0x2010,
+ 0x8597, 0x8597, 0x2A4F, 0x8598, 0x8598, 0x22C2, 0x8599, 0x85A1, 0x2A50,
+ 0x85A2, 0x85A2, 0x1E5A, 0x85A3, 0x85B1, 0x2A59, 0x85B2, 0x85B2, 0x1EA2,
+ 0x85B3, 0x85FE, 0x2A68, 0x8640, 0x8649, 0x2AB4, 0x864A, 0x864A, 0x236D,
+ 0x864B, 0x8653, 0x2ABE, 0x8654, 0x8654, 0x2247, 0x8655, 0x8667, 0x2AC7,
+ 0x8668, 0x8668, 0x236C, 0x8669, 0x867E, 0x2ADA, 0x8680, 0x8695, 0x2AF0,
+ 0x8696, 0x8696, 0x219C, 0x8697, 0x8698, 0x2B06, 0x8699, 0x8699, 0x20C9,
+ 0x869A, 0x86A0, 0x2B08, 0x86A1, 0x86A1, 0x21F0, 0x86A2, 0x86C9, 0x2B0F,
+ 0x86CA, 0x86CA, 0x210B, 0x86CB, 0x86CB, 0x2B37, 0x86CC, 0x86CC, 0x20DE,
+ 0x86CD, 0x86CD, 0x2B38, 0x86CE, 0x86CE, 0x1EAA, 0x86CF, 0x86D0, 0x2B39,
+ 0x86D1, 0x86D1, 0x222C, 0x86D2, 0x86DB, 0x2B3B, 0x86DC, 0x86DC, 0x20D8,
+ 0x86DD, 0x86DD, 0x22C0, 0x86DE, 0x86E0, 0x2B45, 0x86E1, 0x86E1, 0x206F,
+ 0x86E2, 0x86E7, 0x2B48, 0x86E8, 0x86E8, 0x21A1, 0x86E9, 0x86ED, 0x2B4E,
+ 0x86EE, 0x86EE, 0x2379, 0x86EF, 0x86F3, 0x2B53, 0x86F4, 0x86F4, 0x2372,
+ 0x86F5, 0x86FE, 0x2B58, 0x8740, 0x8740, 0x216A, 0x8741, 0x8743, 0x2B62,
+ 0x8744, 0x8744, 0x237C, 0x8745, 0x8748, 0x2B65, 0x8749, 0x8749, 0x20B0,
+ 0x874A, 0x874A, 0x2B69, 0x874B, 0x874B, 0x237A, 0x874C, 0x874C, 0x1E74,
+ 0x874D, 0x874E, 0x2B6A, 0x874F, 0x874F, 0x2377, 0x8750, 0x8756, 0x2B6C,
+ 0x8757, 0x8757, 0x1F4C, 0x8758, 0x8759, 0x2B73, 0x875A, 0x875A, 0x2378,
+ 0x875B, 0x875B, 0x21CF, 0x875C, 0x875C, 0x2368, 0x875D, 0x875D, 0x2B75,
+ 0x875E, 0x875E, 0x2371, 0x875F, 0x875F, 0x2B76, 0x8760, 0x8760, 0x2369,
+ 0x8761, 0x8765, 0x2B77, 0x8766, 0x8766, 0x2674, 0x8767, 0x8779, 0x2B7C,
+ 0x877A, 0x877A, 0x236F, 0x877B, 0x877C, 0x2B8F, 0x877D, 0x877D, 0x2370,
+ 0x877E, 0x877E, 0x2B91, 0x8780, 0x8780, 0x2B92, 0x8781, 0x8781, 0x2376,
+ 0x8782, 0x8782, 0x2373, 0x8783, 0x8785, 0x2B93, 0x8786, 0x8786, 0x237F,
+ 0x8787, 0x8787, 0x2B96, 0x8788, 0x8788, 0x2374, 0x8789, 0x8789, 0x2B97,
+ 0x878A, 0x878A, 0x20B5, 0x878B, 0x878C, 0x2B98, 0x878D, 0x878D, 0x1EDB,
+ 0x878E, 0x878E, 0x2672, 0x878F, 0x8792, 0x2B9A, 0x8793, 0x8793, 0x236E,
+ 0x8794, 0x8797, 0x2B9E, 0x8798, 0x8798, 0x21B7, 0x8799, 0x879C, 0x2BA2,
+ 0x879D, 0x879D, 0x2375, 0x879E, 0x87A2, 0x2BA6, 0x87A3, 0x87A3, 0x2382,
+ 0x87A4, 0x87A6, 0x2BAB, 0x87A7, 0x87A7, 0x209E, 0x87A8, 0x87B2, 0x2BAE,
+ 0x87B3, 0x87B3, 0x236B, 0x87B4, 0x87B4, 0x2BB9, 0x87B5, 0x87B5, 0x2039,
+ 0x87B6, 0x87BA, 0x2BBA, 0x87BB, 0x87BB, 0x269F, 0x87BC, 0x87BE, 0x2BBF,
+ 0x87BF, 0x87BF, 0x237D, 0x87C0, 0x87C0, 0x21F5, 0x87C1, 0x87C1, 0x2BC2,
+ 0x87C2, 0x87C2, 0x2381, 0x87C3, 0x87C9, 0x2BC3, 0x87CA, 0x87CA, 0x237B,
+ 0x87CB, 0x87CB, 0x237E, 0x87CC, 0x87CC, 0x21CC, 0x87CD, 0x87CE, 0x2BCA,
+ 0x87CF, 0x87CF, 0x22DB, 0x87D0, 0x87D1, 0x2BCC, 0x87D2, 0x87D2, 0x236A,
+ 0x87D3, 0x87D3, 0x2689, 0x87D4, 0x87D4, 0x2BCE, 0x87D5, 0x87D5, 0x2697,
+ 0x87D6, 0x87D9, 0x2BCF, 0x87DA, 0x87DA, 0x22A1, 0x87DB, 0x87F6, 0x2BD3,
+ 0x87F7, 0x87F7, 0x2383, 0x87F8, 0x87F8, 0x1F3D, 0x87F9, 0x87F9, 0x2BEF,
+ 0x87FA, 0x87FA, 0x218F, 0x87FB, 0x87FE, 0x2BF0, 0x8840, 0x8840, 0x2246,
+ 0x8841, 0x8841, 0x2248, 0x8842, 0x8843, 0x2BF4, 0x8844, 0x8844, 0x217E,
+ 0x8845, 0x8845, 0x2BF6, 0x8846, 0x8846, 0x2180, 0x8847, 0x887E, 0x2BF7,
+ 0x8880, 0x88B9, 0x2C2F, 0x88BA, 0x88BA, 0x232A, 0x88BB, 0x88CB, 0x2C69,
+ 0x88CC, 0x88CC, 0x228B, 0x88CD, 0x88D3, 0x2C7A, 0x88D4, 0x88D4, 0x1F85,
+ 0x88D5, 0x88D6, 0x2C81, 0x88D7, 0x88D7, 0x2325, 0x88D8, 0x88DE, 0x2C83,
+ 0x88DF, 0x88DF, 0x232C, 0x88E0, 0x88E4, 0x2C8A, 0x88E5, 0x88E5, 0x232E,
+ 0x88E6, 0x88F1, 0x2C8F, 0x88F2, 0x88F2, 0x2205, 0x88F3, 0x88F3, 0x1E38,
+ 0x88F4, 0x88F5, 0x2C9B, 0x88F6, 0x88F6, 0x1E73, 0x88F7, 0x88FE, 0x2C9D,
+ 0x8940, 0x894A, 0x2CA5, 0x894B, 0x894B, 0x1FE3, 0x894C, 0x894C, 0x2339,
+ 0x894D, 0x894D, 0x2CB0, 0x894E, 0x894E, 0x232B, 0x894F, 0x894F, 0x2CB1,
+ 0x8950, 0x8950, 0x232D, 0x8951, 0x8953, 0x2CB2, 0x8954, 0x8954, 0x217F,
+ 0x8955, 0x895C, 0x2CB5, 0x895D, 0x895D, 0x21A7, 0x895E, 0x895E, 0x2CBD,
+ 0x895F, 0x895F, 0x232F, 0x8960, 0x896C, 0x2CBE, 0x896D, 0x896D, 0x1E7D,
+ 0x896E, 0x8970, 0x2CCB, 0x8971, 0x8971, 0x20D6, 0x8972, 0x897B, 0x2CCE,
+ 0x897C, 0x897C, 0x1EC2, 0x897D, 0x897E, 0x2CD8, 0x8980, 0x898A, 0x2CDA,
+ 0x898B, 0x898B, 0x22B2, 0x898C, 0x8998, 0x2CE5, 0x8999, 0x8999, 0x1EDF,
+ 0x899A, 0x899D, 0x2CF2, 0x899E, 0x899E, 0x1EF9, 0x899F, 0x89A5, 0x2CF6,
+ 0x89A6, 0x89A6, 0x20D9, 0x89A7, 0x89A7, 0x2CFD, 0x89A8, 0x89A8, 0x1FDD,
+ 0x89A9, 0x89AE, 0x2CFE, 0x89AF, 0x89AF, 0x2167, 0x89B0, 0x89B9, 0x2D04,
+ 0x89BA, 0x89BA, 0x21ED, 0x89BB, 0x89BD, 0x2D0E, 0x89BE, 0x89BE, 0x2007,
+ 0x89BF, 0x89BF, 0x2326, 0x89C0, 0x89C0, 0x2329, 0x89C1, 0x89C3, 0x2D11,
+ 0x89C4, 0x89C4, 0x1F52, 0x89C5, 0x89C5, 0x203B, 0x89C6, 0x89C6, 0x2328,
+ 0x89C7, 0x89C7, 0x2D14, 0x89C8, 0x89C8, 0x2327, 0x89C9, 0x89CD, 0x2D15,
+ 0x89CE, 0x89CE, 0x1E2B, 0x89CF, 0x89D0, 0x2D1A, 0x89D1, 0x89D1, 0x22AE,
+ 0x89D2, 0x89D7, 0x2D1C, 0x89D8, 0x89D8, 0x1F49, 0x89D9, 0x89DA, 0x2D22,
+ 0x89DB, 0x89DB, 0x2138, 0x89DC, 0x89F3, 0x2D24, 0x89F4, 0x89F4, 0x2081,
+ 0x89F5, 0x89FE, 0x2D3C, 0x8A40, 0x8A40, 0x2D46, 0x8A41, 0x8A41, 0x1F7C,
+ 0x8A42, 0x8A58, 0x2D47, 0x8A59, 0x8A59, 0x235B, 0x8A5A, 0x8A5A, 0x1EDE,
+ 0x8A5B, 0x8A5B, 0x2D5E, 0x8A5C, 0x8A5C, 0x1FA2, 0x8A5D, 0x8A5D, 0x2D5F,
+ 0x8A5E, 0x8A5E, 0x1EFA, 0x8A5F, 0x8A78, 0x2D60, 0x8A79, 0x8A79, 0x22AD,
+ 0x8A7A, 0x8A7E, 0x2D7A, 0x8A80, 0x8AE3, 0x2D7F, 0x8AE4, 0x8AE4, 0x203F,
+ 0x8AE5, 0x8AFE, 0x2DE3, 0x8B40, 0x8B43, 0x2DFD, 0x8B44, 0x8B44, 0x1F0E,
+ 0x8B45, 0x8B48, 0x2E01, 0x8B49, 0x8B49, 0x23F9, 0x8B4A, 0x8B79, 0x2E05,
+ 0x8B7A, 0x8B7A, 0x23FC, 0x8B7B, 0x8B7E, 0x2E35, 0x8B80, 0x8B8B, 0x2E39,
+ 0x8B8C, 0x8B8C, 0x2069, 0x8B8D, 0x8B9D, 0x2E45, 0x8B9E, 0x8B9E, 0x23F7,
+ 0x8B9F, 0x8BB2, 0x2E56, 0x8BB3, 0x8BB3, 0x23F6, 0x8BB4, 0x8BB8, 0x2E6A,
+ 0x8BB9, 0x8BB9, 0x23FD, 0x8BBA, 0x8BBD, 0x2E6F, 0x8BBE, 0x8BBE, 0x23F8,
+ 0x8BBF, 0x8BC5, 0x2E73, 0x8BC6, 0x8BC6, 0x23FA, 0x8BC7, 0x8BC7, 0x2E7A,
+ 0x8BC8, 0x8BC8, 0x23FE, 0x8BC9, 0x8BC9, 0x1FA8, 0x8BCA, 0x8BD3, 0x2E7B,
+ 0x8BD4, 0x8BD4, 0x2401, 0x8BD5, 0x8BDB, 0x2E85, 0x8BDC, 0x8BDC, 0x23FF,
+ 0x8BDD, 0x8BE4, 0x2E8C, 0x8BE5, 0x8BE5, 0x2400, 0x8BE6, 0x8BEA, 0x2E94,
+ 0x8BEB, 0x8BEB, 0x2221, 0x8BEC, 0x8BEF, 0x2E99, 0x8BF0, 0x8BF0, 0x2122,
+ 0x8BF1, 0x8BFE, 0x2E9D, 0x8C40, 0x8C43, 0x2EAB, 0x8C44, 0x8C44, 0x23FB,
+ 0x8C45, 0x8C4E, 0x2EAF, 0x8C4F, 0x8C4F, 0x215A, 0x8C50, 0x8C56, 0x2EB9,
+ 0x8C57, 0x8C57, 0x21E5, 0x8C58, 0x8C5B, 0x2EC0, 0x8C5C, 0x8C5C, 0x2057,
+ 0x8C5D, 0x8C7E, 0x2EC4, 0x8C80, 0x8C8A, 0x2EE6, 0x8C8B, 0x8C8B, 0x20E5,
+ 0x8C8C, 0x8C8C, 0x2EF1, 0x8C8D, 0x8C8D, 0x212F, 0x8C8E, 0x8C8E, 0x20A3,
+ 0x8C8F, 0x8C8F, 0x2121, 0x8C90, 0x8C90, 0x2EF2, 0x8C91, 0x8C91, 0x21D4,
+ 0x8C92, 0x8C92, 0x1FE5, 0x8C93, 0x8C98, 0x2EF3, 0x8C99, 0x8C99, 0x1E8A,
+ 0x8C9A, 0x8C9A, 0x1E37, 0x8C9B, 0x8CA1, 0x2EF9, 0x8CA2, 0x8CA2, 0x1F9E,
+ 0x8CA3, 0x8CA3, 0x22A6, 0x8CA4, 0x8CA4, 0x21E8, 0x8CA5, 0x8CA5, 0x2F00,
+ 0x8CA6, 0x8CA6, 0x1EDA, 0x8CA7, 0x8CA7, 0x1EB9, 0x8CA8, 0x8CBF, 0x2F01,
+ 0x8CC0, 0x8CC0, 0x235C, 0x8CC1, 0x8CD1, 0x2F19, 0x8CD2, 0x8CD2, 0x2050,
+ 0x8CD3, 0x8CD3, 0x1E67, 0x8CD4, 0x8CD4, 0x2F2A, 0x8CD5, 0x8CD5, 0x23F4,
+ 0x8CD6, 0x8CD8, 0x2F2B, 0x8CD9, 0x8CD9, 0x213E, 0x8CDA, 0x8CF8, 0x2F2E,
+ 0x8CF9, 0x8CF9, 0x1F16, 0x8CFA, 0x8CFE, 0x2F4D, 0x8D40, 0x8D72, 0x2F52,
+ 0x8D73, 0x8D73, 0x2389, 0x8D74, 0x8D74, 0x2F85, 0x8D75, 0x8D75, 0x1EB7,
+ 0x8D76, 0x8D7A, 0x2F86, 0x8D7B, 0x8D7B, 0x21B4, 0x8D7C, 0x8D7E, 0x2F8B,
+ 0x8D80, 0x8D87, 0x2F8E, 0x8D88, 0x8D88, 0x238F, 0x8D89, 0x8D8E, 0x2F96,
+ 0x8D8F, 0x8D8F, 0x1F1A, 0x8D90, 0x8D9D, 0x2F9C, 0x8D9E, 0x8D9E, 0x238B,
+ 0x8D9F, 0x8DB8, 0x2FAA, 0x8DB9, 0x8DB9, 0x238A, 0x8DBA, 0x8DE1, 0x2FC4,
+ 0x8DE2, 0x8DE2, 0x2391, 0x8DE3, 0x8DE3, 0x2FEC, 0x8DE4, 0x8DE4, 0x2271,
+ 0x8DE5, 0x8DE6, 0x2FED, 0x8DE7, 0x8DE7, 0x2388, 0x8DE8, 0x8DF6, 0x2FEF,
+ 0x8DF7, 0x8DF7, 0x238E, 0x8DF8, 0x8DFD, 0x2FFE, 0x8DFE, 0x8DFE, 0x238D,
+ 0x8E40, 0x8E45, 0x3004, 0x8E46, 0x8E46, 0x238C, 0x8E47, 0x8E55, 0x300A,
+ 0x8E56, 0x8E56, 0x2390, 0x8E57, 0x8E57, 0x3019, 0x8E58, 0x8E58, 0x2033,
+ 0x8E59, 0x8E59, 0x301A, 0x8E5A, 0x8E5A, 0x223C, 0x8E5B, 0x8E67, 0x301B,
+ 0x8E68, 0x8E68, 0x1FE9, 0x8E69, 0x8E6D, 0x3028, 0x8E6E, 0x8E6E, 0x2055,
+ 0x8E6F, 0x8E6F, 0x302D, 0x8E70, 0x8E70, 0x2392, 0x8E71, 0x8E7E, 0x302E,
+ 0x8E80, 0x8E80, 0x2324, 0x8E81, 0x8E9A, 0x303C, 0x8E9B, 0x8E9B, 0x2143,
+ 0x8E9C, 0x8E9E, 0x3056, 0x8E9F, 0x8E9F, 0x2129, 0x8EA0, 0x8EA3, 0x3059,
+ 0x8EA4, 0x8EA4, 0x2277, 0x8EA5, 0x8EA6, 0x305D, 0x8EA7, 0x8EA7, 0x1EA7,
+ 0x8EA8, 0x8EAB, 0x305F, 0x8EAC, 0x8EAC, 0x2285, 0x8EAD, 0x8EAD, 0x3063,
+ 0x8EAE, 0x8EAE, 0x2384, 0x8EAF, 0x8EBC, 0x3064, 0x8EBD, 0x8EBD, 0x2387,
+ 0x8EBE, 0x8EBE, 0x2386, 0x8EBF, 0x8EC2, 0x3072, 0x8EC3, 0x8EC3, 0x2290,
+ 0x8EC4, 0x8EC4, 0x3076, 0x8EC5, 0x8EC5, 0x1E44, 0x8EC6, 0x8ECC, 0x3077,
+ 0x8ECD, 0x8ECD, 0x1E32, 0x8ECE, 0x8ECE, 0x2385, 0x8ECF, 0x8ED5, 0x307E,
+ 0x8ED6, 0x8ED6, 0x1F13, 0x8ED7, 0x8ED7, 0x1F73, 0x8ED8, 0x8EEB, 0x3085,
+ 0x8EEC, 0x8EEC, 0x1FE0, 0x8EED, 0x8EFE, 0x3099, 0x8F40, 0x8F51, 0x30AB,
+ 0x8F52, 0x8F52, 0x2087, 0x8F53, 0x8F53, 0x1E78, 0x8F54, 0x8F54, 0x23AE,
+ 0x8F55, 0x8F55, 0x1EF6, 0x8F56, 0x8F56, 0x1F31, 0x8F57, 0x8F5C, 0x30BD,
+ 0x8F5D, 0x8F5D, 0x2045, 0x8F5E, 0x8F63, 0x30C3, 0x8F64, 0x8F64, 0x2178,
+ 0x8F65, 0x8F7E, 0x30C9, 0x8F80, 0x8F85, 0x30E3, 0x8F86, 0x8F86, 0x23F5,
+ 0x8F87, 0x8F87, 0x30E9, 0x8F88, 0x8F88, 0x2275, 0x8F89, 0x8F94, 0x30EA,
+ 0x8F95, 0x8F95, 0x266E, 0x8F96, 0x8F96, 0x30F6, 0x8F97, 0x8F97, 0x1EB0,
+ 0x8F98, 0x8F9A, 0x30F7, 0x8F9B, 0x8F9B, 0x2083, 0x8F9C, 0x8F9C, 0x30FA,
+ 0x8F9D, 0x8F9D, 0x2188, 0x8F9E, 0x8FA0, 0x30FB, 0x8FA1, 0x8FA1, 0x267C,
+ 0x8FA2, 0x8FBC, 0x30FE, 0x8FBD, 0x8FBD, 0x1FC5, 0x8FBE, 0x8FC3, 0x3119,
+ 0x8FC4, 0x8FC4, 0x1EA1, 0x8FC5, 0x8FC5, 0x311F, 0x8FC6, 0x8FC6, 0x2393,
+ 0x8FC7, 0x8FCC, 0x3120, 0x8FCD, 0x8FCD, 0x1F0B, 0x8FCE, 0x8FD7, 0x3126,
+ 0x8FD8, 0x8FD8, 0x1E7C, 0x8FD9, 0x8FFE, 0x3130, 0x9040, 0x907E, 0x3156,
+ 0x9080, 0x909C, 0x3195, 0x909D, 0x909D, 0x23B4, 0x909E, 0x909E, 0x207E,
+ 0x909F, 0x90B9, 0x31B2, 0x90BA, 0x90BA, 0x1EE3, 0x90BB, 0x90BF, 0x31CD,
+ 0x90C0, 0x90C0, 0x2095, 0x90C1, 0x90C1, 0x23BB, 0x90C2, 0x90C4, 0x31D2,
+ 0x90C5, 0x90C5, 0x23B9, 0x90C6, 0x90DA, 0x31D5, 0x90DB, 0x90DB, 0x1E28,
+ 0x90DC, 0x90DC, 0x23BD, 0x90DD, 0x90EC, 0x31EA, 0x90ED, 0x90ED, 0x23B5,
+ 0x90EE, 0x90EF, 0x31FA, 0x90F0, 0x90F0, 0x23BA, 0x90F1, 0x90F6, 0x31FC,
+ 0x90F7, 0x90F7, 0x23B3, 0x90F8, 0x90FE, 0x3202, 0x9140, 0x9141, 0x3209,
+ 0x9142, 0x9142, 0x2162, 0x9143, 0x914A, 0x320B, 0x914B, 0x914B, 0x1E5E,
+ 0x914C, 0x914C, 0x3213, 0x914D, 0x914D, 0x1E5D, 0x914E, 0x9150, 0x3214,
+ 0x9151, 0x9151, 0x23B7, 0x9152, 0x9153, 0x3217, 0x9154, 0x9154, 0x1F2F,
+ 0x9155, 0x9155, 0x24DF, 0x9156, 0x9158, 0x3219, 0x9159, 0x9159, 0x23B2,
+ 0x915A, 0x915A, 0x214E, 0x915B, 0x915C, 0x321C, 0x915D, 0x915D, 0x2052,
+ 0x915E, 0x9160, 0x321E, 0x9161, 0x9161, 0x23BC, 0x9162, 0x9162, 0x3221,
+ 0x9163, 0x9163, 0x20EB, 0x9164, 0x916D, 0x3222, 0x916E, 0x916E, 0x2232,
+ 0x916F, 0x9175, 0x322C, 0x9176, 0x9176, 0x1E3F, 0x9177, 0x9179, 0x3233,
+ 0x917A, 0x917A, 0x201B, 0x917B, 0x917B, 0x20BC, 0x917C, 0x917C, 0x23BE,
+ 0x917D, 0x917E, 0x3236, 0x9180, 0x9183, 0x3238, 0x9184, 0x9184, 0x1EAE,
+ 0x9185, 0x918C, 0x323C, 0x918D, 0x918D, 0x1EFB, 0x918E, 0x9190, 0x3244,
+ 0x9191, 0x9191, 0x2089, 0x9192, 0x9192, 0x3247, 0x9193, 0x9193, 0x23B1,
+ 0x9194, 0x9196, 0x3248, 0x9197, 0x9197, 0x21C4, 0x9198, 0x919A, 0x324B,
+ 0x919B, 0x919B, 0x2214, 0x919C, 0x91A8, 0x324E, 0x91A9, 0x91A9, 0x1FDE,
+ 0x91AA, 0x91AA, 0x2223, 0x91AB, 0x91AB, 0x23B6, 0x91AC, 0x91B9, 0x325B,
+ 0x91BA, 0x91BA, 0x268C, 0x91BB, 0x91BB, 0x24DE, 0x91BC, 0x91BE, 0x3269,
+ 0x91BF, 0x91BF, 0x24E0, 0x91C0, 0x91C2, 0x326C, 0x91C3, 0x91C3, 0x23B8,
+ 0x91C4, 0x91CC, 0x326F, 0x91CD, 0x91CD, 0x1E81, 0x91CE, 0x91CF, 0x3278,
+ 0x91D0, 0x91D0, 0x1FFE, 0x91D1, 0x91D1, 0x1F51, 0x91D2, 0x91D2, 0x21E1,
+ 0x91D3, 0x91D3, 0x327A, 0x91D4, 0x91D4, 0x23B0, 0x91D5, 0x91D5, 0x327B,
+ 0x91D6, 0x91D6, 0x1FCE, 0x91D7, 0x91D7, 0x327C, 0x91D8, 0x91D8, 0x211E,
+ 0x91D9, 0x91D9, 0x2021, 0x91DA, 0x91DE, 0x327D, 0x91DF, 0x91DF, 0x24E1,
+ 0x91E0, 0x91E1, 0x3282, 0x91E2, 0x91E2, 0x24A3, 0x91E3, 0x91E9, 0x3284,
+ 0x91EA, 0x91EA, 0x24A4, 0x91EB, 0x91EF, 0x328B, 0x91F0, 0x91F0, 0x2273,
+ 0x91F1, 0x91F1, 0x3290, 0x91F2, 0x91F2, 0x21B0, 0x91F3, 0x91FE, 0x3291,
+ 0x9240, 0x927E, 0x329D, 0x9280, 0x92B5, 0x32DC, 0x92B6, 0x92B6, 0x21D1,
+ 0x92B7, 0x92CD, 0x3312, 0x92CE, 0x92CE, 0x211C, 0x92CF, 0x92CF, 0x3329,
+ 0x92D0, 0x92D0, 0x235D, 0x92D1, 0x92D3, 0x332A, 0x92D4, 0x92D4, 0x2682,
+ 0x92D5, 0x92DE, 0x332D, 0x92DF, 0x92DF, 0x210D, 0x92E0, 0x92E0, 0x205A,
+ 0x92E1, 0x92FD, 0x3337, 0x92FE, 0x92FE, 0x1F8D, 0x9340, 0x934F, 0x3354,
+ 0x9350, 0x9350, 0x21FF, 0x9351, 0x935C, 0x3364, 0x935D, 0x935D, 0x1F58,
+ 0x935E, 0x936F, 0x3370, 0x9370, 0x9370, 0x215B, 0x9371, 0x9375, 0x3382,
+ 0x9376, 0x9376, 0x1EB6, 0x9377, 0x937E, 0x3387, 0x9380, 0x938B, 0x338F,
+ 0x938C, 0x938C, 0x20DB, 0x938D, 0x939C, 0x339B, 0x939D, 0x939D, 0x2360,
+ 0x939E, 0x93A4, 0x33AB, 0x93A5, 0x93A5, 0x2361, 0x93A6, 0x93A6, 0x33B2,
+ 0x93A7, 0x93A7, 0x2040, 0x93A8, 0x93B3, 0x33B3, 0x93B4, 0x93B4, 0x228E,
+ 0x93B5, 0x93B7, 0x33BF, 0x93B8, 0x93B8, 0x1FDF, 0x93B9, 0x93BA, 0x33C2,
+ 0x93BB, 0x93BB, 0x235E, 0x93BC, 0x93BC, 0x33C4, 0x93BD, 0x93BD, 0x1E6A,
+ 0x93BE, 0x93C5, 0x33C5, 0x93C6, 0x93C6, 0x2002, 0x93C7, 0x93CE, 0x33CD,
+ 0x93CF, 0x93CF, 0x2093, 0x93D0, 0x93D6, 0x33D5, 0x93D7, 0x93D7, 0x235F,
+ 0x93D8, 0x93DA, 0x33DC, 0x93DB, 0x93DB, 0x1EAC, 0x93DC, 0x93DC, 0x1E54,
+ 0x93DD, 0x93E0, 0x33DF, 0x93E1, 0x93E1, 0x1F08, 0x93E2, 0x93E3, 0x33E3,
+ 0x93E4, 0x93E4, 0x20C0, 0x93E5, 0x93E5, 0x2362, 0x93E6, 0x93E8, 0x33E5,
+ 0x93E9, 0x93E9, 0x2160, 0x93EA, 0x93EA, 0x33E8, 0x93EB, 0x93EB, 0x219D,
+ 0x93EC, 0x93EC, 0x1F8E, 0x93ED, 0x93ED, 0x222D, 0x93EE, 0x93EE, 0x33E9,
+ 0x93EF, 0x93EF, 0x2047, 0x93F0, 0x93F0, 0x33EA, 0x93F1, 0x93F1, 0x2262,
+ 0x93F2, 0x93F3, 0x33EB, 0x93F4, 0x93F4, 0x1F67, 0x93F5, 0x93F5, 0x1EB2,
+ 0x93F6, 0x93F9, 0x33ED, 0x93FA, 0x93FA, 0x1EA9, 0x93FB, 0x93FD, 0x33F1,
+ 0x93FE, 0x93FE, 0x1FCC, 0x9440, 0x9443, 0x33F4, 0x9444, 0x9444, 0x1F72,
+ 0x9445, 0x944C, 0x33F8, 0x944D, 0x944D, 0x2098, 0x944E, 0x944F, 0x3400,
+ 0x9450, 0x9450, 0x1E52, 0x9451, 0x9451, 0x20A4, 0x9452, 0x9452, 0x1F1C,
+ 0x9453, 0x9453, 0x228F, 0x9454, 0x9454, 0x3402, 0x9455, 0x9455, 0x1FED,
+ 0x9456, 0x9457, 0x3403, 0x9458, 0x9458, 0x2365, 0x9459, 0x945A, 0x3405,
+ 0x945B, 0x945B, 0x1E2D, 0x945C, 0x945C, 0x2152, 0x945D, 0x945D, 0x2366,
+ 0x945E, 0x945E, 0x3407, 0x945F, 0x945F, 0x20FA, 0x9460, 0x9463, 0x3408,
+ 0x9464, 0x9464, 0x2363, 0x9465, 0x9465, 0x340C, 0x9466, 0x9466, 0x209A,
+ 0x9467, 0x946D, 0x340D, 0x946E, 0x946E, 0x203C, 0x946F, 0x9471, 0x3414,
+ 0x9472, 0x9472, 0x1FF6, 0x9473, 0x9473, 0x3417, 0x9474, 0x9474, 0x2364,
+ 0x9475, 0x9475, 0x3418, 0x9476, 0x9476, 0x1E69, 0x9477, 0x9477, 0x3419,
+ 0x9478, 0x9478, 0x2367, 0x9479, 0x9479, 0x341A, 0x947A, 0x947A, 0x211D,
+ 0x947B, 0x947E, 0x341B, 0x9480, 0x9480, 0x2259, 0x9481, 0x9481, 0x2056,
+ 0x9482, 0x9482, 0x2163, 0x9483, 0x9486, 0x341F, 0x9487, 0x9487, 0x1FA9,
+ 0x9488, 0x9488, 0x1FFC, 0x9489, 0x94A0, 0x3423, 0x94A1, 0x94A1, 0x1E2E,
+ 0x94A2, 0x94B2, 0x343B, 0x94B3, 0x94B3, 0x1EBC, 0x94B4, 0x94B4, 0x344C,
+ 0x94B5, 0x94B5, 0x2142, 0x94B6, 0x94BE, 0x344D, 0x94BF, 0x94BF, 0x201E,
+ 0x94C0, 0x94C0, 0x1E43, 0x94C1, 0x94CB, 0x3456, 0x94CC, 0x94CC, 0x24D4,
+ 0x94CD, 0x94D7, 0x3461, 0x94D8, 0x94D8, 0x226F, 0x94D9, 0x94DF, 0x346C,
+ 0x94E0, 0x94E0, 0x1ED7, 0x94E1, 0x94FE, 0x3473, 0x9540, 0x9571, 0x3491,
+ 0x9572, 0x9572, 0x212D, 0x9573, 0x957E, 0x34C3, 0x9580, 0x9582, 0x34CF,
+ 0x9583, 0x9583, 0x229B, 0x9584, 0x959D, 0x34D2, 0x959E, 0x959E, 0x2256,
+ 0x959F, 0x959F, 0x24A8, 0x95A0, 0x95B2, 0x34EC, 0x95B3, 0x95B3, 0x1E79,
+ 0x95B4, 0x95B9, 0x34FF, 0x95BA, 0x95BA, 0x225A, 0x95BB, 0x95CE, 0x3505,
+ 0x95CF, 0x95CF, 0x24A7, 0x95D0, 0x95D0, 0x3519, 0x95D1, 0x95D1, 0x2686,
+ 0x95D2, 0x95D2, 0x24A6, 0x95D3, 0x95D3, 0x351A, 0x95D4, 0x95D4, 0x21CE,
+ 0x95D5, 0x95E0, 0x351B, 0x95E1, 0x95E1, 0x24A9, 0x95E2, 0x95E6, 0x3527,
+ 0x95E7, 0x95E7, 0x1FE7, 0x95E8, 0x95F0, 0x352C, 0x95F1, 0x95F1, 0x2112,
+ 0x95F2, 0x95F7, 0x3535, 0x95F8, 0x95F8, 0x213C, 0x95F9, 0x95FD, 0x353B,
+ 0x95FE, 0x95FE, 0x1F5C, 0x9640, 0x9655, 0x3540, 0x9656, 0x9656, 0x24C4,
+ 0x9657, 0x967B, 0x3556, 0x967C, 0x967C, 0x1ECC, 0x967D, 0x967E, 0x357B,
+ 0x9680, 0x96FE, 0x357D, 0x9740, 0x9766, 0x35FC, 0x9767, 0x9767, 0x246A,
+ 0x9768, 0x976B, 0x3623, 0x976C, 0x976C, 0x2175, 0x976D, 0x976D, 0x3627,
+ 0x976E, 0x976E, 0x246D, 0x976F, 0x977E, 0x3628, 0x9780, 0x9795, 0x3638,
+ 0x9796, 0x9796, 0x246B, 0x9797, 0x9797, 0x225F, 0x9798, 0x979C, 0x364E,
+ 0x979D, 0x979D, 0x1ECE, 0x979E, 0x97A2, 0x3653, 0x97A3, 0x97A3, 0x2272,
+ 0x97A4, 0x97BE, 0x3658, 0x97BF, 0x97BF, 0x2473, 0x97C0, 0x97ED, 0x3673,
+ 0x97EE, 0x97EE, 0x21FE, 0x97EF, 0x97F6, 0x36A1, 0x97F7, 0x97F7, 0x1EFE,
+ 0x97F8, 0x97FE, 0x36A9, 0x9840, 0x9844, 0x36B0, 0x9845, 0x9845, 0x2475,
+ 0x9846, 0x9848, 0x36B5, 0x9849, 0x9849, 0x220A, 0x984A, 0x984E, 0x36B8,
+ 0x984F, 0x984F, 0x1F6F, 0x9850, 0x9870, 0x36BD, 0x9871, 0x9871, 0x2468,
+ 0x9872, 0x9872, 0x36DE, 0x9873, 0x9873, 0x2100, 0x9874, 0x987E, 0x36DF,
+ 0x9880, 0x9880, 0x36EA, 0x9881, 0x9881, 0x2476, 0x9882, 0x988A, 0x36EB,
+ 0x988B, 0x988B, 0x1F27, 0x988C, 0x988C, 0x20D7, 0x988D, 0x989F, 0x36F4,
+ 0x98A0, 0x98A0, 0x247C, 0x98A1, 0x98A9, 0x3707, 0x98AA, 0x98AA, 0x1FA1,
+ 0x98AB, 0x98B5, 0x3710, 0x98B6, 0x98B6, 0x22AA, 0x98B7, 0x98B7, 0x2005,
+ 0x98B8, 0x98B9, 0x371B, 0x98BA, 0x98BA, 0x246C, 0x98BB, 0x98C6, 0x371D,
+ 0x98C7, 0x98C7, 0x203E, 0x98C8, 0x98CA, 0x3729, 0x98CB, 0x98CB, 0x1E4C,
+ 0x98CC, 0x98CF, 0x372C, 0x98D0, 0x98D0, 0x213A, 0x98D1, 0x98D2, 0x3730,
+ 0x98D3, 0x98D3, 0x2204, 0x98D4, 0x98E2, 0x3732, 0x98E3, 0x98E3, 0x20C3,
+ 0x98E4, 0x98E4, 0x2140, 0x98E5, 0x98E5, 0x2477, 0x98E6, 0x98EE, 0x3741,
+ 0x98EF, 0x98EF, 0x2474, 0x98F0, 0x98F1, 0x374A, 0x98F2, 0x98F2, 0x20DD,
+ 0x98F3, 0x98FE, 0x374C, 0x9940, 0x9942, 0x3758, 0x9943, 0x9943, 0x1F68,
+ 0x9944, 0x9944, 0x375B, 0x9945, 0x9945, 0x2185, 0x9946, 0x9965, 0x375C,
+ 0x9966, 0x9966, 0x2472, 0x9967, 0x996D, 0x377C, 0x996E, 0x996E, 0x1EB5,
+ 0x996F, 0x9974, 0x3783, 0x9975, 0x9975, 0x2478, 0x9976, 0x9979, 0x3789,
+ 0x997A, 0x997A, 0x1F8B, 0x997B, 0x997B, 0x2484, 0x997C, 0x997E, 0x378D,
+ 0x9980, 0x9984, 0x3790, 0x9985, 0x9985, 0x2699, 0x9986, 0x9988, 0x3795,
+ 0x9989, 0x9989, 0x2482, 0x998A, 0x998D, 0x3798, 0x998E, 0x998E, 0x20A1,
+ 0x998F, 0x9990, 0x379C, 0x9991, 0x9991, 0x1F92, 0x9992, 0x9998, 0x379E,
+ 0x9999, 0x9999, 0x1F38, 0x999A, 0x99A8, 0x37A5, 0x99A9, 0x99A9, 0x2485,
+ 0x99AA, 0x99AF, 0x37B4, 0x99B0, 0x99B0, 0x2480, 0x99B1, 0x99B1, 0x246E,
+ 0x99B2, 0x99B2, 0x37BA, 0x99B3, 0x99B3, 0x247B, 0x99B4, 0x99B4, 0x2486,
+ 0x99B5, 0x99B5, 0x2471, 0x99B6, 0x99BC, 0x37BB, 0x99BD, 0x99BD, 0x2483,
+ 0x99BE, 0x99BE, 0x2470, 0x99BF, 0x99BF, 0x37C2, 0x99C0, 0x99C0, 0x2469,
+ 0x99C1, 0x99C1, 0x37C3, 0x99C2, 0x99C2, 0x247F, 0x99C3, 0x99C8, 0x37C4,
+ 0x99C9, 0x99C9, 0x246F, 0x99CA, 0x99CD, 0x37CA, 0x99CE, 0x99CE, 0x2481,
+ 0x99CF, 0x99D0, 0x37CE, 0x99D1, 0x99D1, 0x2220, 0x99D2, 0x99D9, 0x37D0,
+ 0x99DA, 0x99DA, 0x1FF5, 0x99DB, 0x99DF, 0x37D8, 0x99E0, 0x99E0, 0x20F4,
+ 0x99E1, 0x99E4, 0x37DD, 0x99E5, 0x99E5, 0x247D, 0x99E6, 0x99E7, 0x37E1,
+ 0x99E8, 0x99E8, 0x2479, 0x99E9, 0x99EB, 0x37E3, 0x99EC, 0x99EC, 0x247E,
+ 0x99ED, 0x99F3, 0x37E6, 0x99F4, 0x99F4, 0x247A, 0x99F5, 0x99FE, 0x37ED,
+ 0x9A40, 0x9A49, 0x37F7, 0x9A4A, 0x9A4A, 0x20E3, 0x9A4B, 0x9A56, 0x3801,
+ 0x9A57, 0x9A57, 0x20AD, 0x9A58, 0x9A64, 0x380D, 0x9A65, 0x9A65, 0x24CB,
+ 0x9A66, 0x9A66, 0x381A, 0x9A67, 0x9A67, 0x1F53, 0x9A68, 0x9A70, 0x381B,
+ 0x9A71, 0x9A71, 0x2159, 0x9A72, 0x9A75, 0x3824, 0x9A76, 0x9A76, 0x2013,
+ 0x9A77, 0x9A77, 0x1F33, 0x9A78, 0x9A7E, 0x3828, 0x9A80, 0x9A87, 0x382F,
+ 0x9A88, 0x9A88, 0x1E5C, 0x9A89, 0x9A8B, 0x3837, 0x9A8C, 0x9A8C, 0x2488,
+ 0x9A8D, 0x9A90, 0x383A, 0x9A91, 0x9A91, 0x2487, 0x9A92, 0x9A96, 0x383E,
+ 0x9A97, 0x9A97, 0x248A, 0x9A98, 0x9A99, 0x3843, 0x9A9A, 0x9A9A, 0x2489,
+ 0x9A9B, 0x9A9B, 0x248B, 0x9A9C, 0x9A9D, 0x3845, 0x9A9E, 0x9A9E, 0x1F83,
+ 0x9A9F, 0x9AA1, 0x3847, 0x9AA2, 0x9AA2, 0x210F, 0x9AA3, 0x9AA3, 0x1FDB,
+ 0x9AA4, 0x9AA9, 0x384A, 0x9AAA, 0x9AAA, 0x20AF, 0x9AAB, 0x9ACF, 0x3850,
+ 0x9AD0, 0x9AD0, 0x24C0, 0x9AD1, 0x9AD5, 0x3875, 0x9AD6, 0x9AD6, 0x226D,
+ 0x9AD7, 0x9AD9, 0x387A, 0x9ADA, 0x9ADA, 0x24C1, 0x9ADB, 0x9AE1, 0x387D,
+ 0x9AE2, 0x9AE2, 0x20CA, 0x9AE3, 0x9AE3, 0x3884, 0x9AE4, 0x9AE4, 0x20E7,
+ 0x9AE5, 0x9AE5, 0x24C2, 0x9AE6, 0x9AFE, 0x3885, 0x9B40, 0x9B7E, 0x389E,
+ 0x9B80, 0x9BD0, 0x38DD, 0x9BD1, 0x9BD1, 0x23DC, 0x9BD2, 0x9BDB, 0x392E,
+ 0x9BDC, 0x9BDC, 0x23DB, 0x9BDD, 0x9BFE, 0x3938, 0x9C40, 0x9C52, 0x395A,
+ 0x9C53, 0x9C53, 0x205E, 0x9C54, 0x9C58, 0x396D, 0x9C59, 0x9C59, 0x2244,
+ 0x9C5A, 0x9C5A, 0x23E2, 0x9C5B, 0x9C5B, 0x3972, 0x9C5C, 0x9C5C, 0x20D4,
+ 0x9C5D, 0x9C74, 0x3973, 0x9C75, 0x9C75, 0x219F, 0x9C76, 0x9C78, 0x398B,
+ 0x9C79, 0x9C79, 0x1E66, 0x9C7A, 0x9C7E, 0x398E, 0x9C80, 0x9C85, 0x3993,
+ 0x9C86, 0x9C86, 0x1F63, 0x9C87, 0x9C9C, 0x3999, 0x9C9D, 0x9C9D, 0x23DD,
+ 0x9C9E, 0x9CAA, 0x39AF, 0x9CAB, 0x9CAB, 0x216B, 0x9CAC, 0x9CC9, 0x39BC,
+ 0x9CCA, 0x9CCA, 0x22B5, 0x9CCB, 0x9CCE, 0x39DA, 0x9CCF, 0x9CCF, 0x1F26,
+ 0x9CD0, 0x9CE5, 0x39DE, 0x9CE6, 0x9CE6, 0x1E63, 0x9CE7, 0x9CE7, 0x2088,
+ 0x9CE8, 0x9CEB, 0x39F4, 0x9CEC, 0x9CEC, 0x1EBD, 0x9CED, 0x9CED, 0x39F8,
+ 0x9CEE, 0x9CEE, 0x2341, 0x9CEF, 0x9CFA, 0x39F9, 0x9CFB, 0x9CFB, 0x1F4B,
+ 0x9CFC, 0x9CFD, 0x3A05, 0x9CFE, 0x9CFE, 0x2292, 0x9D40, 0x9D41, 0x3A07,
+ 0x9D42, 0x9D42, 0x2124, 0x9D43, 0x9D45, 0x3A09, 0x9D46, 0x9D46, 0x2048,
+ 0x9D47, 0x9D47, 0x23E0, 0x9D48, 0x9D4C, 0x3A0C, 0x9D4D, 0x9D4D, 0x2077,
+ 0x9D4E, 0x9D4E, 0x3A11, 0x9D4F, 0x9D4F, 0x223A, 0x9D50, 0x9D60, 0x3A12,
+ 0x9D61, 0x9D61, 0x20B1, 0x9D62, 0x9D67, 0x3A23, 0x9D68, 0x9D68, 0x1F41,
+ 0x9D69, 0x9D69, 0x201C, 0x9D6A, 0x9D6D, 0x3A29, 0x9D6E, 0x9D6E, 0x22B8,
+ 0x9D6F, 0x9D70, 0x3A2D, 0x9D71, 0x9D71, 0x2276, 0x9D72, 0x9D74, 0x3A2F,
+ 0x9D75, 0x9D75, 0x1F9B, 0x9D76, 0x9D7A, 0x3A32, 0x9D7B, 0x9D7B, 0x1F9F,
+ 0x9D7C, 0x9D7C, 0x3A37, 0x9D7D, 0x9D7D, 0x25CA, 0x9D7E, 0x9D7E, 0x3A38,
+ 0x9D80, 0x9D89, 0x3A39, 0x9D8A, 0x9D8A, 0x20BE, 0x9D8B, 0x9D8C, 0x3A43,
+ 0x9D8D, 0x9D8D, 0x1FB4, 0x9D8E, 0x9D90, 0x3A45, 0x9D91, 0x9D91, 0x23D7,
+ 0x9D92, 0x9D98, 0x3A48, 0x9D99, 0x9D99, 0x2105, 0x9D9A, 0x9DA0, 0x3A4F,
+ 0x9DA1, 0x9DA1, 0x23E1, 0x9DA2, 0x9DA2, 0x1FEC, 0x9DA3, 0x9DA6, 0x3A56,
+ 0x9DA7, 0x9DA7, 0x23EA, 0x9DA8, 0x9DAB, 0x3A5A, 0x9DAC, 0x9DAC, 0x23E3,
+ 0x9DAD, 0x9DAD, 0x210E, 0x9DAE, 0x9DB1, 0x3A5E, 0x9DB2, 0x9DB2, 0x1FA6,
+ 0x9DB3, 0x9DB3, 0x2004, 0x9DB4, 0x9DBD, 0x3A62, 0x9DBE, 0x9DBE, 0x1F9D,
+ 0x9DBF, 0x9DC5, 0x3A6C, 0x9DC6, 0x9DC6, 0x23E5, 0x9DC7, 0x9DC8, 0x3A73,
+ 0x9DC9, 0x9DC9, 0x2264, 0x9DCA, 0x9DCC, 0x3A75, 0x9DCD, 0x9DCD, 0x24E2,
+ 0x9DCE, 0x9DD1, 0x3A78, 0x9DD2, 0x9DD2, 0x23DE, 0x9DD3, 0x9DD4, 0x3A7C,
+ 0x9DD5, 0x9DD5, 0x1EC4, 0x9DD6, 0x9DE0, 0x3A7E, 0x9DE1, 0x9DE1, 0x22B6,
+ 0x9DE2, 0x9DE2, 0x20A9, 0x9DE3, 0x9DF0, 0x3A89, 0x9DF1, 0x9DF1, 0x212B,
+ 0x9DF2, 0x9DF3, 0x3A97, 0x9DF4, 0x9DF4, 0x20A5, 0x9DF5, 0x9DF6, 0x3A99,
+ 0x9DF7, 0x9DF7, 0x268B, 0x9DF8, 0x9DF9, 0x3A9B, 0x9DFA, 0x9DFA, 0x1F76,
+ 0x9DFB, 0x9DFC, 0x3A9D, 0x9DFD, 0x9DFD, 0x216D, 0x9DFE, 0x9DFE, 0x3A9F,
+ 0x9E40, 0x9E44, 0x3AA0, 0x9E45, 0x9E45, 0x2001, 0x9E46, 0x9E47, 0x3AA5,
+ 0x9E48, 0x9E48, 0x2191, 0x9E49, 0x9E49, 0x1E50, 0x9E4A, 0x9E51, 0x3AA7,
+ 0x9E52, 0x9E52, 0x1F9C, 0x9E53, 0x9E53, 0x3AAF, 0x9E54, 0x9E54, 0x23DA,
+ 0x9E55, 0x9E55, 0x3AB0, 0x9E56, 0x9E56, 0x2053, 0x9E57, 0x9E5C, 0x3AB1,
+ 0x9E5D, 0x9E5D, 0x23E9, 0x9E5E, 0x9E5E, 0x23E4, 0x9E5F, 0x9E60, 0x3AB7,
+ 0x9E61, 0x9E61, 0x21D5, 0x9E62, 0x9E62, 0x3AB9, 0x9E63, 0x9E63, 0x23E6,
+ 0x9E64, 0x9E66, 0x3ABA, 0x9E67, 0x9E67, 0x23DF, 0x9E68, 0x9E6B, 0x3ABD,
+ 0x9E6C, 0x9E6C, 0x1E4F, 0x9E6D, 0x9E6E, 0x3AC1, 0x9E6F, 0x9E6F, 0x23D9,
+ 0x9E70, 0x9E71, 0x3AC3, 0x9E72, 0x9E72, 0x2014, 0x9E73, 0x9E73, 0x3AC5,
+ 0x9E74, 0x9E74, 0x23EC, 0x9E75, 0x9E75, 0x23EB, 0x9E76, 0x9E7A, 0x3AC6,
+ 0x9E7B, 0x9E7B, 0x23D8, 0x9E7C, 0x9E7C, 0x23EE, 0x9E7D, 0x9E7E, 0x3ACB,
+ 0x9E80, 0x9E84, 0x3ACD, 0x9E85, 0x9E85, 0x268E, 0x9E86, 0x9E86, 0x3AD2,
+ 0x9E87, 0x9E87, 0x23ED, 0x9E88, 0x9E90, 0x3AD3, 0x9E91, 0x9E91, 0x1FFA,
+ 0x9E92, 0x9E95, 0x3ADC, 0x9E96, 0x9E96, 0x23D6, 0x9E97, 0x9E97, 0x23E8,
+ 0x9E98, 0x9EA1, 0x3AE0, 0x9EA2, 0x9EA2, 0x2106, 0x9EA3, 0x9EA5, 0x3AEA,
+ 0x9EA6, 0x9EA6, 0x200B, 0x9EA7, 0x9EA8, 0x3AED, 0x9EA9, 0x9EA9, 0x2166,
+ 0x9EAA, 0x9EAD, 0x3AEF, 0x9EAE, 0x9EAE, 0x23EF, 0x9EAF, 0x9EB2, 0x3AF3,
+ 0x9EB3, 0x9EB3, 0x2189, 0x9EB4, 0x9EB4, 0x2058, 0x9EB5, 0x9EB6, 0x3AF7,
+ 0x9EB7, 0x9EB7, 0x23E7, 0x9EB8, 0x9EF4, 0x3AF9, 0x9EF5, 0x9EF5, 0x21A3,
+ 0x9EF6, 0x9EFE, 0x3B36, 0x9F40, 0x9F4D, 0x3B3F, 0x9F4E, 0x9F4E, 0x217A,
+ 0x9F4F, 0x9F6E, 0x3B4D, 0x9F6F, 0x9F6F, 0x21A5, 0x9F70, 0x9F7E, 0x3B6D,
+ 0x9F80, 0x9F91, 0x3B7C, 0x9F92, 0x9F92, 0x2022, 0x9F93, 0x9F97, 0x3B8E,
+ 0x9F98, 0x9F98, 0x24D6, 0x9F99, 0x9FA5, 0x3B93, 0x9FA6, 0x9FA6, 0x233A,
+ 0x9FA7, 0x9FA8, 0x3BA0, 0x9FA9, 0x9FA9, 0x1EEE, 0x9FAA, 0x9FAB, 0x3BA2,
+ 0x9FAC, 0x9FAC, 0x24D5, 0x9FAD, 0x9FC8, 0x3BA4, 0x9FC9, 0x9FC9, 0x2228,
+ 0x9FCA, 0x9FCC, 0x3BC0, 0x9FCD, 0x9FCD, 0x24D7, 0x9FCE, 0x9FE0, 0x3BC3,
+ 0x9FE1, 0x9FE1, 0x20FC, 0x9FE2, 0x9FEA, 0x3BD6, 0x9FEB, 0x9FEB, 0x1E87,
+ 0x9FEC, 0x9FED, 0x3BDF, 0x9FEE, 0x9FEE, 0x24D8, 0x9FEF, 0x9FF3, 0x3BE1,
+ 0x9FF4, 0x9FF4, 0x1EBA, 0x9FF5, 0x9FFC, 0x3BE6, 0x9FFD, 0x9FFD, 0x2119,
+ 0x9FFE, 0x9FFE, 0x3BEE, 0xA040, 0xA042, 0x3BEF, 0xA043, 0xA043, 0x216C,
+ 0xA044, 0xA045, 0x3BF2, 0xA046, 0xA046, 0x24D9, 0xA047, 0xA048, 0x3BF4,
+ 0xA049, 0xA049, 0x2227, 0xA04A, 0xA04D, 0x3BF6, 0xA04E, 0xA04E, 0x1E5F,
+ 0xA04F, 0xA053, 0x3BFA, 0xA054, 0xA054, 0x229F, 0xA055, 0xA059, 0x3BFF,
+ 0xA05A, 0xA05A, 0x1F5D, 0xA05B, 0xA060, 0x3C04, 0xA061, 0xA061, 0x1FBC,
+ 0xA062, 0xA062, 0x3C0A, 0xA063, 0xA063, 0x24DA, 0xA064, 0xA070, 0x3C0B,
+ 0xA071, 0xA071, 0x2149, 0xA072, 0xA073, 0x3C18, 0xA074, 0xA074, 0x2046,
+ 0xA075, 0xA07E, 0x3C1A, 0xA080, 0xA080, 0x2000, 0xA081, 0xA090, 0x3C24,
+ 0xA091, 0xA091, 0x2190, 0xA092, 0xA093, 0x3C34, 0xA094, 0xA094, 0x2208,
+ 0xA095, 0xA095, 0x3C36, 0xA096, 0xA096, 0x1EE6, 0xA097, 0xA0A8, 0x3C37,
+ 0xA0A9, 0xA0A9, 0x24C3, 0xA0AA, 0xA0BE, 0x3C49, 0xA0BF, 0xA0BF, 0x20CC,
+ 0xA0C0, 0xA0CD, 0x3C5E, 0xA0CE, 0xA0CE, 0x2340, 0xA0CF, 0xA0D8, 0x3C6C,
+ 0xA0D9, 0xA0D9, 0x1ED1, 0xA0DA, 0xA0DD, 0x3C76, 0xA0DE, 0xA0DE, 0x21AC,
+ 0xA0DF, 0xA0ED, 0x3C7A, 0xA0EE, 0xA0EE, 0x22AF, 0xA0EF, 0xA0FE, 0x3C89,
+ 0xA1A1, 0xA1FE, 0x0060, 0xA2A1, 0xA2AA, 0x26A9, 0xA2B1, 0xA2E2, 0x00BE,
+ 0xA2E5, 0xA2EE, 0x00F0, 0xA2F1, 0xA2FC, 0x00FA, 0xA3A1, 0xA3FE, 0x0106,
+ 0xA4A1, 0xA4F3, 0x0164, 0xA5A1, 0xA5F6, 0x01B7, 0xA6A1, 0xA6B8, 0x020D,
+ 0xA6C1, 0xA6F5, 0x0225, 0xA7A1, 0xA7C1, 0x025A, 0xA7D1, 0xA7F1, 0x027B,
+ 0xA840, 0xA87E, 0x26B3, 0xA880, 0xA895, 0x26F2, 0xA8A1, 0xA8C0, 0x029C,
+ 0xA8C5, 0xA8EA, 0x02BC, 0xA940, 0xA957, 0x2708, 0xA959, 0xA95A, 0x2720,
+ 0xA95C, 0xA95C, 0x2722, 0xA960, 0xA97E, 0x2723, 0xA980, 0xA995, 0x2742,
+ 0xA996, 0xA996, 0x1E17, 0xA9A4, 0xA9EF, 0x02E2, 0xAA40, 0xAA4C, 0x3C99,
+ 0xAA4D, 0xAA4D, 0x21B6, 0xAA4E, 0xAA4E, 0x1E3D, 0xAA4F, 0xAA70, 0x3CA6,
+ 0xAA71, 0xAA71, 0x2235, 0xAA72, 0xAA72, 0x3CC8, 0xAA73, 0xAA73, 0x2397,
+ 0xAA74, 0xAA76, 0x3CC9, 0xAA77, 0xAA77, 0x2395, 0xAA78, 0xAA79, 0x3CCC,
+ 0xAA7A, 0xAA7A, 0x223F, 0xAA7B, 0xAA7B, 0x212A, 0xAA7C, 0xAA7E, 0x3CCE,
+ 0xAA80, 0xAA99, 0x3CD1, 0xAA9A, 0xAA9A, 0x1ED2, 0xAA9B, 0xAA9B, 0x3CEB,
+ 0xAA9C, 0xAA9C, 0x2396, 0xAA9D, 0xAA9D, 0x2398, 0xAA9E, 0xAA9E, 0x3CEC,
+ 0xAA9F, 0xAA9F, 0x20A2, 0xAAA0, 0xAAA0, 0x3CED, 0xAAA1, 0xAAFE, 0x032E,
+ 0xAB40, 0xAB40, 0x1F64, 0xAB41, 0xAB42, 0x3CEE, 0xAB43, 0xAB43, 0x202B,
+ 0xAB44, 0xAB44, 0x3CF0, 0xAB45, 0xAB45, 0x2394, 0xAB46, 0xAB46, 0x2139,
+ 0xAB47, 0xAB47, 0x3CF1, 0xAB48, 0xAB48, 0x215F, 0xAB49, 0xAB49, 0x21C1,
+ 0xAB4A, 0xAB4A, 0x239A, 0xAB4B, 0xAB4C, 0x3CF2, 0xAB4D, 0xAB4D, 0x2399,
+ 0xAB4E, 0xAB7E, 0x3CF4, 0xAB80, 0xABA0, 0x3D25, 0xABA1, 0xABC0, 0x038C,
+ 0xAC40, 0xAC45, 0x3D46, 0xAC46, 0xAC46, 0x21C0, 0xAC47, 0xAC70, 0x3D4C,
+ 0xAC71, 0xAC71, 0x2460, 0xAC72, 0xAC7B, 0x3D76, 0xAC7C, 0xAC7C, 0x245C,
+ 0xAC7D, 0xAC7E, 0x3D80, 0xAC80, 0xAC8C, 0x3D82, 0xAC8D, 0xAC8D, 0x215D,
+ 0xAC8E, 0xAC92, 0x3D8F, 0xAC93, 0xAC93, 0x2225, 0xAC94, 0xAC94, 0x206A,
+ 0xAC95, 0xACA0, 0x3D94, 0xAD40, 0xAD48, 0x3DA0, 0xAD49, 0xAD49, 0x2461,
+ 0xAD4A, 0xAD5D, 0x3DA9, 0xAD5E, 0xAD5E, 0x245B, 0xAD5F, 0xAD60, 0x3DBD,
+ 0xAD61, 0xAD61, 0x2462, 0xAD62, 0xAD67, 0x3DBF, 0xAD68, 0xAD68, 0x1F54,
+ 0xAD69, 0xAD73, 0x3DC5, 0xAD74, 0xAD74, 0x245F, 0xAD75, 0xAD7E, 0x3DD0,
+ 0xAD80, 0xAD81, 0x3DDA, 0xAD82, 0xAD82, 0x20EC, 0xAD83, 0xAD86, 0x3DDC,
+ 0xAD87, 0xAD87, 0x245D, 0xAD88, 0xAD8A, 0x3DE0, 0xAD8B, 0xAD8B, 0x2463,
+ 0xAD8C, 0xAD90, 0x3DE3, 0xAD91, 0xAD91, 0x2464, 0xAD92, 0xADA0, 0x3DE8,
+ 0xAE40, 0xAE53, 0x3DF7, 0xAE54, 0xAE54, 0x24A5, 0xAE55, 0xAE61, 0x3E0B,
+ 0xAE62, 0xAE62, 0x1E70, 0xAE63, 0xAE7E, 0x3E18, 0xAE80, 0xAE80, 0x208F,
+ 0xAE81, 0xAE84, 0x3E34, 0xAE85, 0xAE85, 0x1E42, 0xAE86, 0xAE8A, 0x3E38,
+ 0xAE8B, 0xAE8B, 0x1F4E, 0xAE8C, 0xAE93, 0x3E3D, 0xAE94, 0xAE94, 0x1EB1,
+ 0xAE95, 0xAE9F, 0x3E45, 0xAEA0, 0xAEA0, 0x1E8B, 0xAF40, 0xAF63, 0x3E50,
+ 0xAF64, 0xAF64, 0x1FC6, 0xAF65, 0xAF7A, 0x3E74, 0xAF7B, 0xAF7B, 0x25AE,
+ 0xAF7C, 0xAF7E, 0x3E8A, 0xAF80, 0xAF81, 0x3E8D, 0xAF82, 0xAF82, 0x1F01,
+ 0xAF83, 0xAF83, 0x2200, 0xAF84, 0xAF8D, 0x3E8F, 0xAF8E, 0xAF8E, 0x25B2,
+ 0xAF8F, 0xAF8F, 0x1E97, 0xAF90, 0xAF90, 0x3E99, 0xAF91, 0xAF91, 0x20AB,
+ 0xAF92, 0xAF9B, 0x3E9A, 0xAF9C, 0xAF9C, 0x25B3, 0xAF9D, 0xAF9E, 0x3EA4,
+ 0xAF9F, 0xAF9F, 0x2028, 0xAFA0, 0xAFA0, 0x3EA6, 0xB040, 0xB040, 0x3EA7,
+ 0xB041, 0xB042, 0x25AF, 0xB043, 0xB043, 0x3EA8, 0xB044, 0xB044, 0x25B1,
+ 0xB045, 0xB04E, 0x3EA9, 0xB04F, 0xB04F, 0x25AC, 0xB050, 0xB053, 0x3EB3,
+ 0xB054, 0xB054, 0x1E4E, 0xB055, 0xB056, 0x3EB7, 0xB057, 0xB057, 0x2202,
+ 0xB058, 0xB058, 0x25AB, 0xB059, 0xB059, 0x2286, 0xB05A, 0xB05A, 0x3EB9,
+ 0xB05B, 0xB05B, 0x25AD, 0xB05C, 0xB05C, 0x3EBA, 0xB05D, 0xB05D, 0x25B6,
+ 0xB05E, 0xB05E, 0x3EBB, 0xB05F, 0xB05F, 0x21E3, 0xB060, 0xB061, 0x25B4,
+ 0xB062, 0xB062, 0x222F, 0xB063, 0xB063, 0x2165, 0xB064, 0xB064, 0x25B7,
+ 0xB065, 0xB06B, 0x3EBC, 0xB06C, 0xB06C, 0x1EE9, 0xB06D, 0xB07C, 0x3EC3,
+ 0xB07D, 0xB07D, 0x1E25, 0xB07E, 0xB07E, 0x3ED3, 0xB080, 0xB096, 0x3ED4,
+ 0xB097, 0xB097, 0x25C0, 0xB098, 0xB098, 0x3EEB, 0xB099, 0xB099, 0x229A,
+ 0xB09A, 0xB0A0, 0x3EEC, 0xB0A1, 0xB0FE, 0x03AC, 0xB140, 0xB14A, 0x3EF3,
+ 0xB14B, 0xB14B, 0x226E, 0xB14C, 0xB14C, 0x3EFE, 0xB14D, 0xB14D, 0x1FBD,
+ 0xB14E, 0xB14E, 0x3EFF, 0xB14F, 0xB14F, 0x1F84, 0xB150, 0xB150, 0x20B2,
+ 0xB151, 0xB151, 0x3F00, 0xB152, 0xB152, 0x2043, 0xB153, 0xB17E, 0x3F01,
+ 0xB180, 0xB196, 0x3F2D, 0xB197, 0xB197, 0x2684, 0xB198, 0xB1A0, 0x3F44,
+ 0xB1A1, 0xB1FE, 0x040A, 0xB240, 0xB240, 0x3F4D, 0xB241, 0xB241, 0x24EF,
+ 0xB242, 0xB266, 0x3F4E, 0xB267, 0xB267, 0x24EE, 0xB268, 0xB26C, 0x3F73,
+ 0xB26D, 0xB26D, 0x2074, 0xB26E, 0xB273, 0x3F78, 0xB274, 0xB274, 0x2687,
+ 0xB275, 0xB27E, 0x3F7E, 0xB280, 0xB280, 0x24F0, 0xB281, 0xB288, 0x3F88,
+ 0xB289, 0xB289, 0x268D, 0xB28A, 0xB299, 0x3F90, 0xB29A, 0xB29A, 0x22A0,
+ 0xB29B, 0xB2A0, 0x3FA0, 0xB2A1, 0xB2FE, 0x0468, 0xB340, 0xB342, 0x3FA6,
+ 0xB343, 0xB343, 0x1FAB, 0xB344, 0xB36F, 0x3FA9, 0xB370, 0xB370, 0x26A8,
+ 0xB371, 0xB37E, 0x3FD5, 0xB380, 0xB387, 0x3FE3, 0xB388, 0xB388, 0x24E9,
+ 0xB389, 0xB38B, 0x3FEB, 0xB38C, 0xB38C, 0x24E5, 0xB38D, 0xB38D, 0x3FEE,
+ 0xB38E, 0xB38E, 0x21FA, 0xB38F, 0xB3A0, 0x3FEF, 0xB3A1, 0xB3FE, 0x04C6,
+ 0xB440, 0xB453, 0x4001, 0xB454, 0xB454, 0x2148, 0xB455, 0xB457, 0x4015,
+ 0xB458, 0xB458, 0x24E4, 0xB459, 0xB45D, 0x4018, 0xB45E, 0xB45E, 0x24E6,
+ 0xB45F, 0xB45F, 0x20F7, 0xB460, 0xB460, 0x401D, 0xB461, 0xB461, 0x206B,
+ 0xB462, 0xB474, 0x401E, 0xB475, 0xB475, 0x22A7, 0xB476, 0xB47D, 0x4031,
+ 0xB47E, 0xB47E, 0x24EC, 0xB480, 0xB482, 0x4039, 0xB483, 0xB483, 0x24EB,
+ 0xB484, 0xB488, 0x403C, 0xB489, 0xB489, 0x24E3, 0xB48A, 0xB492, 0x4041,
+ 0xB493, 0xB493, 0x24EA, 0xB494, 0xB4A0, 0x404A, 0xB4A1, 0xB4FE, 0x0524,
+ 0xB540, 0xB540, 0x4057, 0xB541, 0xB541, 0x1E92, 0xB542, 0xB54A, 0x4058,
+ 0xB54B, 0xB54B, 0x1E27, 0xB54C, 0xB555, 0x4061, 0xB556, 0xB556, 0x1FE6,
+ 0xB557, 0xB559, 0x406B, 0xB55A, 0xB55A, 0x24E7, 0xB55B, 0xB55B, 0x2012,
+ 0xB55C, 0xB55C, 0x1EEC, 0xB55D, 0xB560, 0x406E, 0xB561, 0xB561, 0x24E8,
+ 0xB562, 0xB57E, 0x4072, 0xB580, 0xB59B, 0x408F, 0xB59C, 0xB59C, 0x1F66,
+ 0xB59D, 0xB59D, 0x24DC, 0xB59E, 0xB5A0, 0x40AB, 0xB5A1, 0xB5FE, 0x0582,
+ 0xB640, 0xB651, 0x40AE, 0xB652, 0xB652, 0x26A2, 0xB653, 0xB654, 0x40C0,
+ 0xB655, 0xB655, 0x24DD, 0xB656, 0xB658, 0x40C2, 0xB659, 0xB659, 0x200E,
+ 0xB65A, 0xB65A, 0x40C5, 0xB65B, 0xB65B, 0x24DB, 0xB65C, 0xB65C, 0x1EB8,
+ 0xB65D, 0xB67E, 0x40C6, 0xB680, 0xB6A0, 0x40E8, 0xB6A1, 0xB6FE, 0x05E0,
+ 0xB740, 0xB74D, 0x4109, 0xB74E, 0xB74E, 0x2295, 0xB74F, 0xB750, 0x4117,
+ 0xB751, 0xB751, 0x1E80, 0xB752, 0xB758, 0x4119, 0xB759, 0xB759, 0x2677,
+ 0xB75A, 0xB763, 0x4120, 0xB764, 0xB764, 0x2624, 0xB765, 0xB765, 0x1F69,
+ 0xB766, 0xB766, 0x222B, 0xB767, 0xB776, 0x412A, 0xB777, 0xB777, 0x257F,
+ 0xB778, 0xB778, 0x1F5B, 0xB779, 0xB77E, 0x413A, 0xB780, 0xB780, 0x219B,
+ 0xB781, 0xB781, 0x4140, 0xB782, 0xB782, 0x267D, 0xB783, 0xB7A0, 0x4141,
+ 0xB7A1, 0xB7FE, 0x063E, 0xB840, 0xB842, 0x415F, 0xB843, 0xB843, 0x21A0,
+ 0xB844, 0xB844, 0x2186, 0xB845, 0xB845, 0x4162, 0xB846, 0xB846, 0x20ED,
+ 0xB847, 0xB84C, 0x4163, 0xB84D, 0xB84D, 0x25B9, 0xB84E, 0xB850, 0x4169,
+ 0xB851, 0xB851, 0x1FEA, 0xB852, 0xB859, 0x416C, 0xB85A, 0xB85A, 0x1EA4,
+ 0xB85B, 0xB85B, 0x20E1, 0xB85C, 0xB85C, 0x4174, 0xB85D, 0xB85D, 0x25B8,
+ 0xB85E, 0xB85E, 0x2260, 0xB85F, 0xB85F, 0x4175, 0xB860, 0xB860, 0x20E2,
+ 0xB861, 0xB876, 0x4176, 0xB877, 0xB877, 0x2141, 0xB878, 0xB87E, 0x418C,
+ 0xB880, 0xB881, 0x4193, 0xB882, 0xB882, 0x1FC7, 0xB883, 0xB8A0, 0x4195,
+ 0xB8A1, 0xB8FE, 0x069C, 0xB940, 0xB94F, 0x41B3, 0xB950, 0xB950, 0x1E41,
+ 0xB951, 0xB960, 0x41C3, 0xB961, 0xB961, 0x25E4, 0xB962, 0xB97A, 0x41D3,
+ 0xB97B, 0xB97B, 0x1F86, 0xB97C, 0xB97E, 0x41EC, 0xB980, 0xB99C, 0x41EF,
+ 0xB99D, 0xB99D, 0x1FB3, 0xB99E, 0xB99F, 0x420C, 0xB9A0, 0xB9A0, 0x1EEF,
+ 0xB9A1, 0xB9FE, 0x06FA, 0xBA40, 0xBA41, 0x420E, 0xBA42, 0xBA42, 0x22A4,
+ 0xBA43, 0xBA43, 0x4210, 0xBA44, 0xBA44, 0x25E8, 0xBA45, 0xBA55, 0x4211,
+ 0xBA56, 0xBA56, 0x25E3, 0xBA57, 0xBA58, 0x4222, 0xBA59, 0xBA59, 0x2111,
+ 0xBA5A, 0xBA5F, 0x4224, 0xBA60, 0xBA60, 0x25E6, 0xBA61, 0xBA69, 0x422A,
+ 0xBA6A, 0xBA6A, 0x25E7, 0xBA6B, 0xBA73, 0x4233, 0xBA74, 0xBA74, 0x2041,
+ 0xBA75, 0xBA7E, 0x423C, 0xBA80, 0xBA83, 0x4246, 0xBA84, 0xBA84, 0x25EA,
+ 0xBA85, 0xBA85, 0x424A, 0xBA86, 0xBA86, 0x1F8F, 0xBA87, 0xBA87, 0x424B,
+ 0xBA88, 0xBA88, 0x25EC, 0xBA89, 0xBA8C, 0x424C, 0xBA8D, 0xBA8D, 0x25EB,
+ 0xBA8E, 0xBA9D, 0x4250, 0xBA9E, 0xBA9E, 0x20D0, 0xBA9F, 0xBA9F, 0x201D,
+ 0xBAA0, 0xBAA0, 0x4260, 0xBAA1, 0xBAFE, 0x0758, 0xBB40, 0xBB40, 0x1FF7,
+ 0xBB41, 0xBB48, 0x4261, 0xBB49, 0xBB49, 0x1E8D, 0xBB4A, 0xBB57, 0x4269,
+ 0xBB58, 0xBB58, 0x25E9, 0xBB59, 0xBB5A, 0x4277, 0xBB5B, 0xBB5B, 0x25EE,
+ 0xBB5C, 0xBB5C, 0x203A, 0xBB5D, 0xBB5F, 0x4279, 0xBB60, 0xBB60, 0x2693,
+ 0xBB61, 0xBB64, 0x427C, 0xBB65, 0xBB65, 0x25E5, 0xBB66, 0xBB66, 0x25ED,
+ 0xBB67, 0xBB67, 0x4280, 0xBB68, 0xBB68, 0x2009, 0xBB69, 0xBB69, 0x4281,
+ 0xBB6A, 0xBB6A, 0x2065, 0xBB6B, 0xBB6D, 0x4282, 0xBB6E, 0xBB6E, 0x26A3,
+ 0xBB6F, 0xBB7E, 0x4285, 0xBB80, 0xBBA0, 0x4295, 0xBBA1, 0xBBFE, 0x07B6,
+ 0xBC40, 0xBC51, 0x42B6, 0xBC52, 0xBC52, 0x25F5, 0xBC53, 0xBC53, 0x1EFC,
+ 0xBC54, 0xBC59, 0x42C8, 0xBC5A, 0xBC5A, 0x2024, 0xBC5B, 0xBC60, 0x42CE,
+ 0xBC61, 0xBC61, 0x269B, 0xBC62, 0xBC62, 0x42D4, 0xBC63, 0xBC63, 0x25F3,
+ 0xBC64, 0xBC64, 0x42D5, 0xBC65, 0xBC65, 0x22D9, 0xBC66, 0xBC66, 0x42D6,
+ 0xBC67, 0xBC67, 0x25F4, 0xBC68, 0xBC68, 0x42D7, 0xBC69, 0xBC69, 0x241B,
+ 0xBC6A, 0xBC6C, 0x42D8, 0xBC6D, 0xBC6D, 0x1FC8, 0xBC6E, 0xBC6E, 0x42DB,
+ 0xBC6F, 0xBC6F, 0x1F7B, 0xBC70, 0xBC70, 0x42DC, 0xBC71, 0xBC71, 0x241D,
+ 0xBC72, 0xBC72, 0x42DD, 0xBC73, 0xBC73, 0x224C, 0xBC74, 0xBC74, 0x1F48,
+ 0xBC75, 0xBC75, 0x241C, 0xBC76, 0xBC77, 0x241E, 0xBC78, 0xBC78, 0x20FF,
+ 0xBC79, 0xBC79, 0x219A, 0xBC7A, 0xBC7A, 0x42DE, 0xBC7B, 0xBC7B, 0x2091,
+ 0xBC7C, 0xBC7D, 0x42DF, 0xBC7E, 0xBC7E, 0x20A7, 0xBC80, 0xBC81, 0x42E1,
+ 0xBC82, 0xBC82, 0x2423, 0xBC83, 0xBC83, 0x1E9B, 0xBC84, 0xBC84, 0x2422,
+ 0xBC85, 0xBC85, 0x42E3, 0xBC86, 0xBC86, 0x2110, 0xBC87, 0xBC87, 0x42E4,
+ 0xBC88, 0xBC88, 0x228D, 0xBC89, 0xBC89, 0x1F71, 0xBC8A, 0xBC8A, 0x1EF8,
+ 0xBC8B, 0xBC8B, 0x2421, 0xBC8C, 0xBC8E, 0x42E5, 0xBC8F, 0xBC8F, 0x1EF3,
+ 0xBC90, 0xBC99, 0x42E8, 0xBC9A, 0xBC9A, 0x21B1, 0xBC9B, 0xBC9B, 0x2426,
+ 0xBC9C, 0xBC9C, 0x2425, 0xBC9D, 0xBC9D, 0x2120, 0xBC9E, 0xBCA0, 0x42F2,
+ 0xBCA1, 0xBCFE, 0x0814, 0xBD40, 0xBD41, 0x42F5, 0xBD42, 0xBD42, 0x211A,
+ 0xBD43, 0xBD43, 0x2424, 0xBD44, 0xBD44, 0x42F7, 0xBD45, 0xBD45, 0x2428,
+ 0xBD46, 0xBD47, 0x42F8, 0xBD48, 0xBD48, 0x242A, 0xBD49, 0xBD49, 0x2429,
+ 0xBD4A, 0xBD4A, 0x42FA, 0xBD4B, 0xBD4B, 0x2294, 0xBD4C, 0xBD4C, 0x42FB,
+ 0xBD4D, 0xBD4D, 0x22BE, 0xBD4E, 0xBD4E, 0x42FC, 0xBD4F, 0xBD4F, 0x1E31,
+ 0xBD50, 0xBD56, 0x42FD, 0xBD57, 0xBD57, 0x242C, 0xBD58, 0xBD58, 0x4304,
+ 0xBD59, 0xBD59, 0x1FB5, 0xBD5A, 0xBD65, 0x4305, 0xBD66, 0xBD66, 0x242B,
+ 0xBD67, 0xBD67, 0x1FAF, 0xBD68, 0xBD69, 0x4311, 0xBD6A, 0xBD6A, 0x2068,
+ 0xBD6B, 0xBD6B, 0x21E4, 0xBD6C, 0xBD6E, 0x4313, 0xBD6F, 0xBD6F, 0x1F21,
+ 0xBD70, 0xBD70, 0x4316, 0xBD71, 0xBD71, 0x2101, 0xBD72, 0xBD78, 0x4317,
+ 0xBD79, 0xBD79, 0x217C, 0xBD7A, 0xBD7A, 0x214A, 0xBD7B, 0xBD7B, 0x242D,
+ 0xBD7C, 0xBD7D, 0x431E, 0xBD7E, 0xBD7E, 0x1FD4, 0xBD80, 0xBD80, 0x4320,
+ 0xBD81, 0xBD81, 0x1FD1, 0xBD82, 0xBD88, 0x4321, 0xBD89, 0xBD89, 0x1E33,
+ 0xBD8A, 0xBD8A, 0x4328, 0xBD8B, 0xBD8B, 0x242F, 0xBD8C, 0xBD8D, 0x4329,
+ 0xBD8E, 0xBD8E, 0x242E, 0xBD8F, 0xBD8F, 0x432B, 0xBD90, 0xBD90, 0x2430,
+ 0xBD91, 0xBD91, 0x21DB, 0xBD92, 0xBD96, 0x432C, 0xBD97, 0xBD97, 0x2158,
+ 0xBD98, 0xBD9A, 0x4331, 0xBD9B, 0xBD9B, 0x1FC2, 0xBD9C, 0xBDA0, 0x4334,
+ 0xBDA1, 0xBDFE, 0x0872, 0xBE40, 0xBE42, 0x4339, 0xBE43, 0xBE43, 0x22B9,
+ 0xBE44, 0xBE44, 0x433C, 0xBE45, 0xBE45, 0x2436, 0xBE46, 0xBE48, 0x433D,
+ 0xBE49, 0xBE49, 0x1E8E, 0xBE4A, 0xBE4A, 0x2439, 0xBE4B, 0xBE50, 0x4340,
+ 0xBE51, 0xBE51, 0x21C5, 0xBE52, 0xBE52, 0x2437, 0xBE53, 0xBE53, 0x2192,
+ 0xBE54, 0xBE54, 0x4346, 0xBE55, 0xBE55, 0x243A, 0xBE56, 0xBE56, 0x1F19,
+ 0xBE57, 0xBE57, 0x218C, 0xBE58, 0xBE58, 0x1E40, 0xBE59, 0xBE59, 0x22B3,
+ 0xBE5A, 0xBE5C, 0x4347, 0xBE5D, 0xBE5D, 0x205F, 0xBE5E, 0xBE5E, 0x2438,
+ 0xBE5F, 0xBE5F, 0x2432, 0xBE60, 0xBE60, 0x2274, 0xBE61, 0xBE61, 0x434A,
+ 0xBE62, 0xBE62, 0x1E9C, 0xBE63, 0xBE63, 0x2431, 0xBE64, 0xBE64, 0x2085,
+ 0xBE65, 0xBE68, 0x434B, 0xBE69, 0xBE69, 0x2435, 0xBE6A, 0xBE6B, 0x434F,
+ 0xBE6C, 0xBE6C, 0x243B, 0xBE6D, 0xBE6E, 0x4351, 0xBE6F, 0xBE6F, 0x1FB7,
+ 0xBE70, 0xBE70, 0x2433, 0xBE71, 0xBE75, 0x4353, 0xBE76, 0xBE76, 0x2054,
+ 0xBE77, 0xBE77, 0x21DE, 0xBE78, 0xBE78, 0x4358, 0xBE79, 0xBE79, 0x2434,
+ 0xBE7A, 0xBE7B, 0x4359, 0xBE7C, 0xBE7C, 0x243D, 0xBE7D, 0xBE7D, 0x1F89,
+ 0xBE7E, 0xBE7E, 0x243C, 0xBE80, 0xBE82, 0x435B, 0xBE83, 0xBE83, 0x1F6E,
+ 0xBE84, 0xBE84, 0x1ED8, 0xBE85, 0xBE85, 0x435E, 0xBE86, 0xBE86, 0x1EBF,
+ 0xBE87, 0xBE87, 0x2445, 0xBE88, 0xBE88, 0x435F, 0xBE89, 0xBE89, 0x2249,
+ 0xBE8A, 0xBE8B, 0x4360, 0xBE8C, 0xBE8C, 0x2441, 0xBE8D, 0xBE8D, 0x4362,
+ 0xBE8E, 0xBE8E, 0x1E47, 0xBE8F, 0xBE8F, 0x1F56, 0xBE90, 0xBE91, 0x4363,
+ 0xBE92, 0xBE92, 0x2086, 0xBE93, 0xBE94, 0x4365, 0xBE95, 0xBE95, 0x2196,
+ 0xBE96, 0xBE96, 0x4367, 0xBE97, 0xBE97, 0x2443, 0xBE98, 0xBE98, 0x243F,
+ 0xBE99, 0xBE99, 0x4368, 0xBE9A, 0xBE9A, 0x2023, 0xBE9B, 0xBE9B, 0x4369,
+ 0xBE9C, 0xBE9C, 0x2442, 0xBE9D, 0xBE9E, 0x436A, 0xBE9F, 0xBE9F, 0x243E,
+ 0xBEA0, 0xBEA0, 0x436C, 0xBEA1, 0xBEFE, 0x08D0, 0xBF40, 0xBF40, 0x26A6,
+ 0xBF41, 0xBF4C, 0x436D, 0xBF4D, 0xBF4D, 0x234E, 0xBF4E, 0xBF4E, 0x2446,
+ 0xBF4F, 0xBF4F, 0x244B, 0xBF50, 0xBF50, 0x2444, 0xBF51, 0xBF54, 0x4379,
+ 0xBF55, 0xBF55, 0x2427, 0xBF56, 0xBF56, 0x244C, 0xBF57, 0xBF5F, 0x437D,
+ 0xBF60, 0xBF60, 0x1F0F, 0xBF61, 0xBF61, 0x4386, 0xBF62, 0xBF62, 0x2447,
+ 0xBF63, 0xBF63, 0x2449, 0xBF64, 0xBF64, 0x2448, 0xBF65, 0xBF67, 0x4387,
+ 0xBF68, 0xBF68, 0x21C2, 0xBF69, 0xBF6B, 0x438A, 0xBF6C, 0xBF6C, 0x216E,
+ 0xBF6D, 0xBF6F, 0x438D, 0xBF70, 0xBF70, 0x1F03, 0xBF71, 0xBF71, 0x4390,
+ 0xBF72, 0xBF72, 0x244A, 0xBF73, 0xBF73, 0x215C, 0xBF74, 0xBF75, 0x4391,
+ 0xBF76, 0xBF76, 0x22BB, 0xBF77, 0xBF77, 0x2450, 0xBF78, 0xBF78, 0x4393,
+ 0xBF79, 0xBF79, 0x2694, 0xBF7A, 0xBF7A, 0x244F, 0xBF7B, 0xBF7B, 0x25F6,
+ 0xBF7C, 0xBF7C, 0x2051, 0xBF7D, 0xBF7D, 0x4394, 0xBF7E, 0xBF7E, 0x244E,
+ 0xBF80, 0xBF81, 0x4395, 0xBF82, 0xBF82, 0x22BA, 0xBF83, 0xBF83, 0x1F6D,
+ 0xBF84, 0xBF88, 0x4397, 0xBF89, 0xBF89, 0x2452, 0xBF8A, 0xBF8A, 0x2451,
+ 0xBF8B, 0xBF94, 0x439C, 0xBF95, 0xBF95, 0x2455, 0xBF96, 0xBF96, 0x43A6,
+ 0xBF97, 0xBF97, 0x2289, 0xBF98, 0xBF98, 0x2116, 0xBF99, 0xBF9C, 0x43A7,
+ 0xBF9D, 0xBF9D, 0x2454, 0xBF9E, 0xBFA0, 0x43AB, 0xBFA1, 0xBFFE, 0x092E,
+ 0xC040, 0xC040, 0x20FB, 0xC041, 0xC043, 0x43AE, 0xC044, 0xC044, 0x2440,
+ 0xC045, 0xC04A, 0x43B1, 0xC04B, 0xC04B, 0x2126, 0xC04C, 0xC04C, 0x1F61,
+ 0xC04D, 0xC04D, 0x269D, 0xC04E, 0xC04E, 0x43B7, 0xC04F, 0xC04F, 0x1F8A,
+ 0xC050, 0xC050, 0x2456, 0xC051, 0xC051, 0x2459, 0xC052, 0xC052, 0x2458,
+ 0xC053, 0xC054, 0x43B8, 0xC055, 0xC055, 0x1FAE, 0xC056, 0xC05A, 0x43BA,
+ 0xC05B, 0xC05B, 0x221A, 0xC05C, 0xC05D, 0x43BF, 0xC05E, 0xC05E, 0x1F7A,
+ 0xC05F, 0xC05F, 0x244D, 0xC060, 0xC060, 0x2457, 0xC061, 0xC068, 0x43C1,
+ 0xC069, 0xC069, 0x2453, 0xC06A, 0xC06A, 0x43C9, 0xC06B, 0xC06B, 0x2420,
+ 0xC06C, 0xC06C, 0x43CA, 0xC06D, 0xC06D, 0x21DF, 0xC06E, 0xC06E, 0x2685,
+ 0xC06F, 0xC06F, 0x43CB, 0xC070, 0xC070, 0x1E6E, 0xC071, 0xC073, 0x43CC,
+ 0xC074, 0xC074, 0x2224, 0xC075, 0xC075, 0x2670, 0xC076, 0xC076, 0x43CF,
+ 0xC077, 0xC077, 0x21BA, 0xC078, 0xC078, 0x43D0, 0xC079, 0xC079, 0x245A,
+ 0xC07A, 0xC07B, 0x43D1, 0xC07C, 0xC07C, 0x1FFF, 0xC07D, 0xC07E, 0x43D3,
+ 0xC080, 0xC09A, 0x43D5, 0xC09B, 0xC09B, 0x25E2, 0xC09C, 0xC09C, 0x43F0,
+ 0xC09D, 0xC09D, 0x269A, 0xC09E, 0xC0A0, 0x43F1, 0xC0A1, 0xC0FE, 0x098C,
+ 0xC140, 0xC14F, 0x43F4, 0xC150, 0xC150, 0x1EEA, 0xC151, 0xC153, 0x4404,
+ 0xC154, 0xC154, 0x1E2C, 0xC155, 0xC15E, 0x4407, 0xC15F, 0xC15F, 0x2062,
+ 0xC160, 0xC160, 0x24F1, 0xC161, 0xC161, 0x4411, 0xC162, 0xC162, 0x24F2,
+ 0xC163, 0xC174, 0x4412, 0xC175, 0xC175, 0x25F2, 0xC176, 0xC177, 0x4424,
+ 0xC178, 0xC178, 0x2215, 0xC179, 0xC17E, 0x4426, 0xC180, 0xC194, 0x442C,
+ 0xC195, 0xC195, 0x21AE, 0xC196, 0xC1A0, 0x4441, 0xC1A1, 0xC1FE, 0x09EA,
+ 0xC240, 0xC24D, 0x444C, 0xC24E, 0xC24E, 0x20E0, 0xC24F, 0xC264, 0x445A,
+ 0xC265, 0xC265, 0x25C2, 0xC266, 0xC266, 0x4470, 0xC267, 0xC267, 0x25C1,
+ 0xC268, 0xC27C, 0x4471, 0xC27D, 0xC27D, 0x2128, 0xC27E, 0xC27E, 0x4486,
+ 0xC280, 0xC283, 0x4487, 0xC284, 0xC284, 0x2199, 0xC285, 0xC292, 0x448B,
+ 0xC293, 0xC293, 0x2017, 0xC294, 0xC294, 0x1EA0, 0xC295, 0xC295, 0x2125,
+ 0xC296, 0xC296, 0x214D, 0xC297, 0xC297, 0x4499, 0xC298, 0xC298, 0x25C4,
+ 0xC299, 0xC299, 0x209D, 0xC29A, 0xC29A, 0x228A, 0xC29B, 0xC29B, 0x449A,
+ 0xC29C, 0xC29C, 0x25C3, 0xC29D, 0xC29F, 0x449B, 0xC2A0, 0xC2A0, 0x2179,
+ 0xC2A1, 0xC2FE, 0x0A48, 0xC340, 0xC340, 0x2038, 0xC341, 0xC342, 0x449E,
+ 0xC343, 0xC343, 0x2155, 0xC344, 0xC37A, 0x44A0, 0xC37B, 0xC37B, 0x21D2,
+ 0xC37C, 0xC37E, 0x44D7, 0xC380, 0xC383, 0x44DA, 0xC384, 0xC384, 0x24C7,
+ 0xC385, 0xC39A, 0x44DE, 0xC39B, 0xC39B, 0x2279, 0xC39C, 0xC3A0, 0x44F4,
+ 0xC3A1, 0xC3FE, 0x0AA6, 0xC440, 0xC448, 0x44F9, 0xC449, 0xC449, 0x2123,
+ 0xC44A, 0xC44B, 0x4502, 0xC44C, 0xC44C, 0x24C5, 0xC44D, 0xC453, 0x4504,
+ 0xC454, 0xC454, 0x24C9, 0xC455, 0xC457, 0x450B, 0xC458, 0xC458, 0x2094,
+ 0xC459, 0xC45A, 0x450E, 0xC45B, 0xC45B, 0x2296, 0xC45C, 0xC462, 0x4510,
+ 0xC463, 0xC463, 0x1E77, 0xC464, 0xC476, 0x4517, 0xC477, 0xC477, 0x1F06,
+ 0xC478, 0xC479, 0x452A, 0xC47A, 0xC47A, 0x1FA5, 0xC47B, 0xC47E, 0x452C,
+ 0xC480, 0xC480, 0x4530, 0xC481, 0xC481, 0x2099, 0xC482, 0xC490, 0x4531,
+ 0xC491, 0xC491, 0x1EAD, 0xC492, 0xC492, 0x24C8, 0xC493, 0xC493, 0x20A8,
+ 0xC494, 0xC497, 0x4540, 0xC498, 0xC498, 0x201F, 0xC499, 0xC499, 0x4544,
+ 0xC49A, 0xC49A, 0x20C5, 0xC49B, 0xC49B, 0x4545, 0xC49C, 0xC49C, 0x24CA,
+ 0xC49D, 0xC4A0, 0x4546, 0xC4A1, 0xC4FE, 0x0B04, 0xC540, 0xC543, 0x454A,
+ 0xC544, 0xC544, 0x1FF0, 0xC545, 0xC545, 0x454E, 0xC546, 0xC546, 0x24C6,
+ 0xC547, 0xC54A, 0x454F, 0xC54B, 0xC54B, 0x225D, 0xC54C, 0xC54C, 0x22DE,
+ 0xC54D, 0xC551, 0x4553, 0xC552, 0xC552, 0x202C, 0xC553, 0xC55E, 0x4558,
+ 0xC55F, 0xC55F, 0x2161, 0xC560, 0xC562, 0x4564, 0xC563, 0xC563, 0x223B,
+ 0xC564, 0xC564, 0x21D9, 0xC565, 0xC565, 0x1FCB, 0xC566, 0xC566, 0x1FC9,
+ 0xC567, 0xC57E, 0x4567, 0xC580, 0xC592, 0x457F, 0xC593, 0xC593, 0x1E61,
+ 0xC594, 0xC59B, 0x4592, 0xC59C, 0xC59C, 0x25EF, 0xC59D, 0xC59D, 0x459A,
+ 0xC59E, 0xC59E, 0x1F98, 0xC59F, 0xC5A0, 0x459B, 0xC5A1, 0xC5FE, 0x0B62,
+ 0xC640, 0xC640, 0x459D, 0xC641, 0xC641, 0x25F0, 0xC642, 0xC643, 0x459E,
+ 0xC644, 0xC644, 0x1F88, 0xC645, 0xC646, 0x45A0, 0xC647, 0xC647, 0x21F8,
+ 0xC648, 0xC662, 0x45A2, 0xC663, 0xC663, 0x2322, 0xC664, 0xC671, 0x45BD,
+ 0xC672, 0xC672, 0x2336, 0xC673, 0xC67E, 0x45CB, 0xC680, 0xC6A0, 0x45D7,
+ 0xC6A1, 0xC6FE, 0x0BC0, 0xC740, 0xC765, 0x45F8, 0xC766, 0xC766, 0x22AB,
+ 0xC767, 0xC76E, 0x461E, 0xC76F, 0xC76F, 0x1FBF, 0xC770, 0xC775, 0x4626,
+ 0xC776, 0xC776, 0x1F7D, 0xC777, 0xC77A, 0x462C, 0xC77B, 0xC77B, 0x2333,
+ 0xC77C, 0xC77E, 0x4630, 0xC780, 0xC7A0, 0x4633, 0xC7A1, 0xC7FE, 0x0C1E,
+ 0xC840, 0xC840, 0x4654, 0xC841, 0xC841, 0x1F4D, 0xC842, 0xC84E, 0x4655,
+ 0xC84F, 0xC84F, 0x2334, 0xC850, 0xC851, 0x4662, 0xC852, 0xC852, 0x1FF1,
+ 0xC853, 0xC865, 0x4664, 0xC866, 0xC866, 0x218B, 0xC867, 0xC86D, 0x4677,
+ 0xC86E, 0xC86E, 0x2349, 0xC86F, 0xC87D, 0x467E, 0xC87E, 0xC87E, 0x220B,
+ 0xC880, 0xC886, 0x468D, 0xC887, 0xC887, 0x2346, 0xC888, 0xC891, 0x4694,
+ 0xC892, 0xC892, 0x2347, 0xC893, 0xC893, 0x469E, 0xC894, 0xC894, 0x2193,
+ 0xC895, 0xC898, 0x469F, 0xC899, 0xC899, 0x26A1, 0xC89A, 0xC89C, 0x46A3,
+ 0xC89D, 0xC89D, 0x1F62, 0xC89E, 0xC8A0, 0x46A6, 0xC8A1, 0xC8FE, 0x0C7C,
+ 0xC940, 0xC94E, 0x46A9, 0xC94F, 0xC94F, 0x234D, 0xC950, 0xC950, 0x2348,
+ 0xC951, 0xC96D, 0x46B8, 0xC96E, 0xC96E, 0x1E60, 0xC96F, 0xC96F, 0x46D5,
+ 0xC970, 0xC970, 0x2345, 0xC971, 0xC976, 0x46D6, 0xC977, 0xC977, 0x1F12,
+ 0xC978, 0xC97E, 0x46DC, 0xC980, 0xC98E, 0x46E3, 0xC98F, 0xC98F, 0x2018,
+ 0xC990, 0xC990, 0x2335, 0xC991, 0xC99B, 0x46F2, 0xC99C, 0xC99C, 0x233C,
+ 0xC99D, 0xC9A0, 0x46FD, 0xC9A1, 0xC9FE, 0x0CDA, 0xCA40, 0xCA4D, 0x4701,
+ 0xCA4E, 0xCA4E, 0x266F, 0xCA4F, 0xCA55, 0x470F, 0xCA56, 0xCA56, 0x2351,
+ 0xCA57, 0xCA58, 0x4716, 0xCA59, 0xCA59, 0x1FA0, 0xCA5A, 0xCA5B, 0x4718,
+ 0xCA5C, 0xCA5C, 0x2338, 0xCA5D, 0xCA60, 0x471A, 0xCA61, 0xCA61, 0x221B,
+ 0xCA62, 0xCA6D, 0x471E, 0xCA6E, 0xCA6E, 0x2342, 0xCA6F, 0xCA71, 0x472A,
+ 0xCA72, 0xCA72, 0x234F, 0xCA73, 0xCA76, 0x472D, 0xCA77, 0xCA77, 0x233D,
+ 0xCA78, 0xCA7A, 0x4731, 0xCA7B, 0xCA7B, 0x2344, 0xCA7C, 0xCA7C, 0x2331,
+ 0xCA7D, 0xCA7D, 0x4734, 0xCA7E, 0xCA7E, 0x234B, 0xCA80, 0xCA80, 0x4735,
+ 0xCA81, 0xCA81, 0x233B, 0xCA82, 0xCA88, 0x4736, 0xCA89, 0xCA89, 0x2350,
+ 0xCA8A, 0xCA8D, 0x473D, 0xCA8E, 0xCA8E, 0x1EB4, 0xCA8F, 0xCA8F, 0x21A6,
+ 0xCA90, 0xCA91, 0x4741, 0xCA92, 0xCA92, 0x21CB, 0xCA93, 0xCA99, 0x4743,
+ 0xCA9A, 0xCA9A, 0x2355, 0xCA9B, 0xCAA0, 0x474A, 0xCAA1, 0xCAFE, 0x0D38,
+ 0xCB40, 0xCB42, 0x4750, 0xCB43, 0xCB43, 0x233E, 0xCB44, 0xCB44, 0x4753,
+ 0xCB45, 0xCB45, 0x1F74, 0xCB46, 0xCB46, 0x4754, 0xCB47, 0xCB47, 0x2330,
+ 0xCB48, 0xCB4A, 0x4755, 0xCB4B, 0xCB4B, 0x2680, 0xCB4C, 0xCB4D, 0x4758,
+ 0xCB4E, 0xCB4E, 0x20DA, 0xCB4F, 0xCB56, 0x475A, 0xCB57, 0xCB57, 0x234A,
+ 0xCB58, 0xCB5C, 0x4762, 0xCB5D, 0xCB5D, 0x1F91, 0xCB5E, 0xCB5E, 0x4767,
+ 0xCB5F, 0xCB5F, 0x2107, 0xCB60, 0xCB69, 0x4768, 0xCB6A, 0xCB6A, 0x233F,
+ 0xCB6B, 0xCB7A, 0x4772, 0xCB7B, 0xCB7B, 0x1FF4, 0xCB7C, 0xCB7C, 0x2343,
+ 0xCB7D, 0xCB7E, 0x4782, 0xCB80, 0xCB86, 0x4784, 0xCB87, 0xCB87, 0x2212,
+ 0xCB88, 0xCB8D, 0x478B, 0xCB8E, 0xCB8E, 0x2207, 0xCB8F, 0xCB91, 0x4791,
+ 0xCB92, 0xCB92, 0x2359, 0xCB93, 0xCB9B, 0x4794, 0xCB9C, 0xCB9C, 0x2254,
+ 0xCB9D, 0xCB9D, 0x479D, 0xCB9E, 0xCB9E, 0x2332, 0xCB9F, 0xCBA0, 0x479E,
+ 0xCBA1, 0xCBFE, 0x0D96, 0xCC40, 0xCC40, 0x1E26, 0xCC41, 0xCC41, 0x2357,
+ 0xCC42, 0xCC48, 0x47A0, 0xCC49, 0xCC49, 0x2358, 0xCC4A, 0xCC4A, 0x2042,
+ 0xCC4B, 0xCC4B, 0x2153, 0xCC4C, 0xCC4E, 0x47A7, 0xCC4F, 0xCC4F, 0x20BB,
+ 0xCC50, 0xCC5B, 0x47AA, 0xCC5C, 0xCC5C, 0x235A, 0xCC5D, 0xCC5F, 0x47B6,
+ 0xCC60, 0xCC60, 0x2356, 0xCC61, 0xCC63, 0x47B9, 0xCC64, 0xCC64, 0x2337,
+ 0xCC65, 0xCC6C, 0x47BC, 0xCC6D, 0xCC6D, 0x1FF9, 0xCC6E, 0xCC78, 0x47C4,
+ 0xCC79, 0xCC79, 0x2353, 0xCC7A, 0xCC7C, 0x47CF, 0xCC7D, 0xCC7D, 0x2061,
+ 0xCC7E, 0xCC7E, 0x47D2, 0xCC80, 0xCC8D, 0x47D3, 0xCC8E, 0xCC8E, 0x1E95,
+ 0xCC8F, 0xCC93, 0x47E1, 0xCC94, 0xCC94, 0x2049, 0xCC95, 0xCC95, 0x47E6,
+ 0xCC96, 0xCC96, 0x1F42, 0xCC97, 0xCC9C, 0x47E7, 0xCC9D, 0xCC9D, 0x1FE8,
+ 0xCC9E, 0xCCA0, 0x47ED, 0xCCA1, 0xCCFE, 0x0DF4, 0xCD40, 0xCD7E, 0x47F0,
+ 0xCD80, 0xCD8F, 0x482F, 0xCD90, 0xCD90, 0x25DA, 0xCD91, 0xCD97, 0x483F,
+ 0xCD98, 0xCD98, 0x25D7, 0xCD99, 0xCDA0, 0x4846, 0xCDA1, 0xCDFE, 0x0E52,
+ 0xCE40, 0xCE66, 0x484E, 0xCE67, 0xCE67, 0x212E, 0xCE68, 0xCE71, 0x4875,
+ 0xCE72, 0xCE72, 0x21B2, 0xCE73, 0xCE7E, 0x487F, 0xCE80, 0xCE80, 0x488B,
+ 0xCE81, 0xCE81, 0x219E, 0xCE82, 0xCE86, 0x488C, 0xCE87, 0xCE87, 0x25DC,
+ 0xCE88, 0xCE9A, 0x4891, 0xCE9B, 0xCE9B, 0x206C, 0xCE9C, 0xCE9D, 0x48A4,
+ 0xCE9E, 0xCE9E, 0x2226, 0xCE9F, 0xCEA0, 0x48A6, 0xCEA1, 0xCEFE, 0x0EB0,
+ 0xCF40, 0xCF4D, 0x48A8, 0xCF4E, 0xCF4E, 0x25E0, 0xCF4F, 0xCF54, 0x48B6,
+ 0xCF55, 0xCF55, 0x227B, 0xCF56, 0xCF57, 0x48BC, 0xCF58, 0xCF58, 0x25DE,
+ 0xCF59, 0xCF5B, 0x48BE, 0xCF5C, 0xCF5C, 0x25E1, 0xCF5D, 0xCF6B, 0x48C1,
+ 0xCF6C, 0xCF6C, 0x25D5, 0xCF6D, 0xCF72, 0x48D0, 0xCF73, 0xCF73, 0x1E6B,
+ 0xCF74, 0xCF74, 0x48D6, 0xCF75, 0xCF75, 0x25DB, 0xCF76, 0xCF77, 0x48D7,
+ 0xCF78, 0xCF78, 0x1E89, 0xCF79, 0xCF7B, 0x48D9, 0xCF7C, 0xCF7C, 0x25D9,
+ 0xCF7D, 0xCF7E, 0x48DC, 0xCF80, 0xCF80, 0x48DE, 0xCF81, 0xCF81, 0x2211,
+ 0xCF82, 0xCF88, 0x48DF, 0xCF89, 0xCF89, 0x2229, 0xCF8A, 0xCF8A, 0x25D6,
+ 0xCF8B, 0xCF92, 0x48E6, 0xCF93, 0xCF93, 0x25DD, 0xCF94, 0xCF94, 0x25DF,
+ 0xCF95, 0xCF9D, 0x48EE, 0xCF9E, 0xCF9E, 0x1FEF, 0xCF9F, 0xCF9F, 0x48F7,
+ 0xCFA0, 0xCFA0, 0x25D8, 0xCFA1, 0xCFFE, 0x0F0E, 0xD040, 0xD04C, 0x48F8,
+ 0xD04D, 0xD04D, 0x1F29, 0xD04E, 0xD050, 0x4905, 0xD051, 0xD051, 0x1E5B,
+ 0xD052, 0xD054, 0x4908, 0xD055, 0xD055, 0x2076, 0xD056, 0xD05B, 0x490B,
+ 0xD05C, 0xD05C, 0x2297, 0xD05D, 0xD05F, 0x4911, 0xD060, 0xD060, 0x2690,
+ 0xD061, 0xD066, 0x4914, 0xD067, 0xD067, 0x213F, 0xD068, 0xD06B, 0x491A,
+ 0xD06C, 0xD06C, 0x2198, 0xD06D, 0xD06D, 0x491E, 0xD06E, 0xD06E, 0x1E88,
+ 0xD06F, 0xD07C, 0x491F, 0xD07D, 0xD07D, 0x228C, 0xD07E, 0xD07E, 0x492D,
+ 0xD080, 0xD0A0, 0x492E, 0xD0A1, 0xD0FE, 0x0F6C, 0xD140, 0xD154, 0x494F,
+ 0xD155, 0xD155, 0x25F1, 0xD156, 0xD158, 0x4964, 0xD159, 0xD159, 0x200C,
+ 0xD15A, 0xD160, 0x4967, 0xD161, 0xD161, 0x1E58, 0xD162, 0xD162, 0x22AC,
+ 0xD163, 0xD174, 0x496E, 0xD175, 0xD175, 0x26A7, 0xD176, 0xD17C, 0x4980,
+ 0xD17D, 0xD17D, 0x2676, 0xD17E, 0xD17E, 0x4987, 0xD180, 0xD19C, 0x4988,
+ 0xD19D, 0xD19D, 0x1FE1, 0xD19E, 0xD19E, 0x25BB, 0xD19F, 0xD1A0, 0x49A5,
+ 0xD1A1, 0xD1FE, 0x0FCA, 0xD240, 0xD240, 0x25BE, 0xD241, 0xD242, 0x49A7,
+ 0xD243, 0xD243, 0x22DD, 0xD244, 0xD24C, 0x49A9, 0xD24D, 0xD24D, 0x25BD,
+ 0xD24E, 0xD25B, 0x49B2, 0xD25C, 0xD25C, 0x1E2A, 0xD25D, 0xD262, 0x49C0,
+ 0xD263, 0xD263, 0x25BC, 0xD264, 0xD264, 0x25BA, 0xD265, 0xD267, 0x49C6,
+ 0xD268, 0xD268, 0x25BF, 0xD269, 0xD26C, 0x49C9, 0xD26D, 0xD26D, 0x2187,
+ 0xD26E, 0xD26E, 0x49CD, 0xD26F, 0xD26F, 0x266B, 0xD270, 0xD271, 0x49CE,
+ 0xD272, 0xD272, 0x1E7F, 0xD273, 0xD274, 0x49D0, 0xD275, 0xD275, 0x21AD,
+ 0xD276, 0xD27E, 0x49D2, 0xD280, 0xD289, 0x49DB, 0xD28A, 0xD28A, 0x1F96,
+ 0xD28B, 0xD28D, 0x49E5, 0xD28E, 0xD28E, 0x1F32, 0xD28F, 0xD291, 0x49E8,
+ 0xD292, 0xD292, 0x2084, 0xD293, 0xD294, 0x49EB, 0xD295, 0xD295, 0x2136,
+ 0xD296, 0xD296, 0x49ED, 0xD297, 0xD297, 0x24B8, 0xD298, 0xD29F, 0x49EE,
+ 0xD2A0, 0xD2A0, 0x24BA, 0xD2A1, 0xD2FE, 0x1028, 0xD340, 0xD343, 0x49F6,
+ 0xD344, 0xD344, 0x24BC, 0xD345, 0xD347, 0x49FA, 0xD348, 0xD348, 0x20E4,
+ 0xD349, 0xD349, 0x49FD, 0xD34A, 0xD34A, 0x24B9, 0xD34B, 0xD34C, 0x49FE,
+ 0xD34D, 0xD34D, 0x24BD, 0xD34E, 0xD34F, 0x4A00, 0xD350, 0xD350, 0x24BE,
+ 0xD351, 0xD354, 0x4A02, 0xD355, 0xD355, 0x24BF, 0xD356, 0xD357, 0x4A06,
+ 0xD358, 0xD358, 0x1FD2, 0xD359, 0xD35A, 0x4A08, 0xD35B, 0xD35B, 0x1FFD,
+ 0xD35C, 0xD35C, 0x4A0A, 0xD35D, 0xD35D, 0x24BB, 0xD35E, 0xD35E, 0x1F2D,
+ 0xD35F, 0xD377, 0x4A0B, 0xD378, 0xD378, 0x2609, 0xD379, 0xD379, 0x4A24,
+ 0xD37A, 0xD37A, 0x260A, 0xD37B, 0xD37B, 0x4A25, 0xD37C, 0xD37C, 0x1E94,
+ 0xD37D, 0xD37E, 0x4A26, 0xD380, 0xD384, 0x4A28, 0xD385, 0xD385, 0x22DF,
+ 0xD386, 0xD386, 0x1ECB, 0xD387, 0xD387, 0x1F0D, 0xD388, 0xD38A, 0x4A2D,
+ 0xD38B, 0xD38B, 0x1F77, 0xD38C, 0xD38C, 0x4A30, 0xD38D, 0xD38D, 0x21EB,
+ 0xD38E, 0xD38E, 0x4A31, 0xD38F, 0xD38F, 0x22E1, 0xD390, 0xD390, 0x4A32,
+ 0xD391, 0xD391, 0x216F, 0xD392, 0xD392, 0x4A33, 0xD393, 0xD393, 0x22E0,
+ 0xD394, 0xD395, 0x4A34, 0xD396, 0xD396, 0x21EA, 0xD397, 0xD397, 0x4A36,
+ 0xD398, 0xD398, 0x22E2, 0xD399, 0xD399, 0x20CB, 0xD39A, 0xD39A, 0x4A37,
+ 0xD39B, 0xD39B, 0x1F78, 0xD39C, 0xD39D, 0x4A38, 0xD39E, 0xD39E, 0x1EE2,
+ 0xD39F, 0xD39F, 0x4A3A, 0xD3A0, 0xD3A0, 0x21F2, 0xD3A1, 0xD3FE, 0x1086,
+ 0xD440, 0xD440, 0x4A3B, 0xD441, 0xD441, 0x2150, 0xD442, 0xD444, 0x4A3C,
+ 0xD445, 0xD445, 0x1FD3, 0xD446, 0xD446, 0x4A3F, 0xD447, 0xD447, 0x22E5,
+ 0xD448, 0xD44B, 0x4A40, 0xD44C, 0xD44C, 0x1EF2, 0xD44D, 0xD44E, 0x4A44,
+ 0xD44F, 0xD44F, 0x211F, 0xD450, 0xD452, 0x4A46, 0xD453, 0xD453, 0x21DD,
+ 0xD454, 0xD455, 0x4A49, 0xD456, 0xD456, 0x2154, 0xD457, 0xD457, 0x4A4B,
+ 0xD458, 0xD458, 0x22E7, 0xD459, 0xD45B, 0x4A4C, 0xD45C, 0xD45C, 0x2282,
+ 0xD45D, 0xD461, 0x4A4F, 0xD462, 0xD462, 0x22E6, 0xD463, 0xD466, 0x4A54,
+ 0xD467, 0xD467, 0x22E8, 0xD468, 0xD46D, 0x4A58, 0xD46E, 0xD46E, 0x22E4,
+ 0xD46F, 0xD46F, 0x4A5E, 0xD470, 0xD470, 0x226A, 0xD471, 0xD471, 0x4A5F,
+ 0xD472, 0xD472, 0x22EB, 0xD473, 0xD473, 0x4A60, 0xD474, 0xD474, 0x22E9,
+ 0xD475, 0xD475, 0x20BD, 0xD476, 0xD477, 0x4A61, 0xD478, 0xD478, 0x22EA,
+ 0xD479, 0xD47A, 0x4A63, 0xD47B, 0xD47B, 0x22BD, 0xD47C, 0xD47D, 0x4A65,
+ 0xD47E, 0xD47E, 0x1E9E, 0xD480, 0xD481, 0x4A67, 0xD482, 0xD482, 0x22F6,
+ 0xD483, 0xD483, 0x21E7, 0xD484, 0xD484, 0x2216, 0xD485, 0xD486, 0x4A69,
+ 0xD487, 0xD487, 0x2137, 0xD488, 0xD489, 0x4A6B, 0xD48A, 0xD48A, 0x212C,
+ 0xD48B, 0xD48B, 0x4A6D, 0xD48C, 0xD48C, 0x1E68, 0xD48D, 0xD48D, 0x22F2,
+ 0xD48E, 0xD48E, 0x1F37, 0xD48F, 0xD48F, 0x22F3, 0xD490, 0xD490, 0x4A6E,
+ 0xD491, 0xD491, 0x22EF, 0xD492, 0xD492, 0x1F50, 0xD493, 0xD493, 0x1F10,
+ 0xD494, 0xD494, 0x21C8, 0xD495, 0xD495, 0x4A6F, 0xD496, 0xD496, 0x22F1,
+ 0xD497, 0xD49B, 0x4A70, 0xD49C, 0xD49C, 0x22F0, 0xD49D, 0xD49E, 0x4A75,
+ 0xD49F, 0xD49F, 0x22EE, 0xD4A0, 0xD4A0, 0x4A77, 0xD4A1, 0xD4FE, 0x10E4,
+ 0xD540, 0xD542, 0x4A78, 0xD543, 0xD543, 0x22ED, 0xD544, 0xD544, 0x229E,
+ 0xD545, 0xD545, 0x22EC, 0xD546, 0xD546, 0x1FE2, 0xD547, 0xD549, 0x4A7B,
+ 0xD54A, 0xD54A, 0x20FE, 0xD54B, 0xD54D, 0x4A7E, 0xD54E, 0xD54F, 0x22F9,
+ 0xD550, 0xD550, 0x4A81, 0xD551, 0xD551, 0x1EAF, 0xD552, 0xD553, 0x4A82,
+ 0xD554, 0xD554, 0x2236, 0xD555, 0xD555, 0x4A84, 0xD556, 0xD556, 0x22F7,
+ 0xD557, 0xD559, 0x4A85, 0xD55A, 0xD55A, 0x223D, 0xD55B, 0xD55B, 0x4A88,
+ 0xD55C, 0xD55C, 0x1E82, 0xD55D, 0xD55D, 0x1FB6, 0xD55E, 0xD55E, 0x4A89,
+ 0xD55F, 0xD55F, 0x21A4, 0xD560, 0xD560, 0x21AA, 0xD561, 0xD561, 0x22F8,
+ 0xD562, 0xD562, 0x2151, 0xD563, 0xD563, 0x4A8A, 0xD564, 0xD564, 0x1F60,
+ 0xD565, 0xD567, 0x4A8B, 0xD568, 0xD568, 0x2147, 0xD569, 0xD56B, 0x4A8E,
+ 0xD56C, 0xD56C, 0x2145, 0xD56D, 0xD56D, 0x4A91, 0xD56E, 0xD56E, 0x1FDC,
+ 0xD56F, 0xD571, 0x4A92, 0xD572, 0xD572, 0x2301, 0xD573, 0xD574, 0x4A95,
+ 0xD575, 0xD575, 0x1EF5, 0xD576, 0xD577, 0x4A97, 0xD578, 0xD578, 0x2218,
+ 0xD579, 0xD57A, 0x4A99, 0xD57B, 0xD57B, 0x1EC6, 0xD57C, 0xD57D, 0x4A9B,
+ 0xD57E, 0xD57E, 0x2300, 0xD580, 0xD580, 0x4A9D, 0xD581, 0xD581, 0x22B4,
+ 0xD582, 0xD583, 0x4A9E, 0xD584, 0xD584, 0x2169, 0xD585, 0xD585, 0x4AA0,
+ 0xD586, 0xD586, 0x22FD, 0xD587, 0xD587, 0x4AA1, 0xD588, 0xD588, 0x20EA,
+ 0xD589, 0xD589, 0x4AA2, 0xD58A, 0xD58A, 0x22F4, 0xD58B, 0xD58B, 0x4AA3,
+ 0xD58C, 0xD58C, 0x22FB, 0xD58D, 0xD58D, 0x4AA4, 0xD58E, 0xD58E, 0x22FC,
+ 0xD58F, 0xD58F, 0x2027, 0xD590, 0xD592, 0x4AA5, 0xD593, 0xD593, 0x2060,
+ 0xD594, 0xD594, 0x22FF, 0xD595, 0xD597, 0x4AA8, 0xD598, 0xD598, 0x22FE,
+ 0xD599, 0xD599, 0x1EC7, 0xD59A, 0xD59A, 0x4AAB, 0xD59B, 0xD59B, 0x230C,
+ 0xD59C, 0xD59E, 0x4AAC, 0xD59F, 0xD59F, 0x22F5, 0xD5A0, 0xD5A0, 0x4AAF,
+ 0xD5A1, 0xD5FE, 0x1142, 0xD640, 0xD640, 0x2306, 0xD641, 0xD641, 0x4AB0,
+ 0xD642, 0xD642, 0x230A, 0xD643, 0xD643, 0x21D3, 0xD644, 0xD646, 0x4AB1,
+ 0xD647, 0xD647, 0x2303, 0xD648, 0xD648, 0x4AB4, 0xD649, 0xD649, 0x2307,
+ 0xD64A, 0xD64A, 0x230B, 0xD64B, 0xD64C, 0x4AB5, 0xD64D, 0xD64D, 0x1F5F,
+ 0xD64E, 0xD64E, 0x4AB7, 0xD64F, 0xD64F, 0x2309, 0xD650, 0xD651, 0x4AB8,
+ 0xD652, 0xD652, 0x2302, 0xD653, 0xD653, 0x1F04, 0xD654, 0xD654, 0x229D,
+ 0xD655, 0xD655, 0x4ABA, 0xD656, 0xD656, 0x21FB, 0xD657, 0xD657, 0x4ABB,
+ 0xD658, 0xD658, 0x2308, 0xD659, 0xD659, 0x4ABC, 0xD65A, 0xD65A, 0x20AC,
+ 0xD65B, 0xD65B, 0x4ABD, 0xD65C, 0xD65C, 0x208E, 0xD65D, 0xD65D, 0x2305,
+ 0xD65E, 0xD65E, 0x2197, 0xD65F, 0xD65F, 0x4ABE, 0xD660, 0xD660, 0x2171,
+ 0xD661, 0xD661, 0x2298, 0xD662, 0xD664, 0x4ABF, 0xD665, 0xD665, 0x1F57,
+ 0xD666, 0xD668, 0x4AC2, 0xD669, 0xD669, 0x2082, 0xD66A, 0xD66A, 0x4AC5,
+ 0xD66B, 0xD66B, 0x2311, 0xD66C, 0xD66E, 0x4AC6, 0xD66F, 0xD66F, 0x2304,
+ 0xD670, 0xD670, 0x4AC9, 0xD671, 0xD671, 0x230F, 0xD672, 0xD672, 0x1E35,
+ 0xD673, 0xD673, 0x4ACA, 0xD674, 0xD674, 0x20D1, 0xD675, 0xD675, 0x2310,
+ 0xD676, 0xD676, 0x1FA3, 0xD677, 0xD677, 0x4ACB, 0xD678, 0xD678, 0x21D6,
+ 0xD679, 0xD67B, 0x4ACC, 0xD67C, 0xD67C, 0x2206, 0xD67D, 0xD67E, 0x4ACF,
+ 0xD680, 0xD682, 0x4AD1, 0xD683, 0xD683, 0x230D, 0xD684, 0xD685, 0x4AD4,
+ 0xD686, 0xD686, 0x2312, 0xD687, 0xD687, 0x208D, 0xD688, 0xD688, 0x2313,
+ 0xD689, 0xD68D, 0x4AD6, 0xD68E, 0xD68E, 0x22E3, 0xD68F, 0xD693, 0x4ADB,
+ 0xD694, 0xD694, 0x1FBA, 0xD695, 0xD698, 0x4AE0, 0xD699, 0xD699, 0x2078,
+ 0xD69A, 0xD6A0, 0x4AE4, 0xD6A1, 0xD6FE, 0x11A0, 0xD740, 0xD742, 0x4AEB,
+ 0xD743, 0xD743, 0x2288, 0xD744, 0xD747, 0x4AEE, 0xD748, 0xD748, 0x2316,
+ 0xD749, 0xD749, 0x1F6B, 0xD74A, 0xD74F, 0x4AF2, 0xD750, 0xD750, 0x2314,
+ 0xD751, 0xD751, 0x4AF8, 0xD752, 0xD752, 0x2130, 0xD753, 0xD753, 0x2315,
+ 0xD754, 0xD754, 0x2168, 0xD755, 0xD755, 0x4AF9, 0xD756, 0xD756, 0x20C4,
+ 0xD757, 0xD763, 0x4AFA, 0xD764, 0xD764, 0x2318, 0xD765, 0xD766, 0x4B07,
+ 0xD767, 0xD767, 0x2219, 0xD768, 0xD768, 0x2217, 0xD769, 0xD76B, 0x4B09,
+ 0xD76C, 0xD76C, 0x20D5, 0xD76D, 0xD76E, 0x4B0C, 0xD76F, 0xD76F, 0x1F4A,
+ 0xD770, 0xD774, 0x4B0E, 0xD775, 0xD775, 0x2240, 0xD776, 0xD777, 0x4B13,
+ 0xD778, 0xD778, 0x1ED3, 0xD779, 0xD77E, 0x4B15, 0xD780, 0xD782, 0x4B1B,
+ 0xD783, 0xD783, 0x1E49, 0xD784, 0xD786, 0x4B1E, 0xD787, 0xD787, 0x261B,
+ 0xD788, 0xD78A, 0x4B21, 0xD78B, 0xD78B, 0x1E6D, 0xD78C, 0xD78C, 0x20F8,
+ 0xD78D, 0xD78D, 0x4B24, 0xD78E, 0xD78E, 0x1FFB, 0xD78F, 0xD78F, 0x2319,
+ 0xD790, 0xD794, 0x4B25, 0xD795, 0xD795, 0x230E, 0xD796, 0xD796, 0x4B2A,
+ 0xD797, 0xD797, 0x2317, 0xD798, 0xD7A0, 0x4B2B, 0xD7A1, 0xD7F9, 0x11FE,
+ 0xD840, 0xD84C, 0x4B34, 0xD84D, 0xD84D, 0x20C8, 0xD84E, 0xD852, 0x4B41,
+ 0xD853, 0xD853, 0x1EFD, 0xD854, 0xD87E, 0x4B46, 0xD880, 0xD88F, 0x4B71,
+ 0xD890, 0xD890, 0x1E3B, 0xD891, 0xD891, 0x227F, 0xD892, 0xD892, 0x4B81,
+ 0xD893, 0xD893, 0x1F0C, 0xD894, 0xD894, 0x1E59, 0xD895, 0xD895, 0x1F24,
+ 0xD896, 0xD899, 0x4B82, 0xD89A, 0xD89A, 0x20BA, 0xD89B, 0xD89B, 0x1F65,
+ 0xD89C, 0xD89C, 0x1EF0, 0xD89D, 0xD89D, 0x2164, 0xD89E, 0xD89E, 0x1F30,
+ 0xD89F, 0xD89F, 0x2261, 0xD8A0, 0xD8A0, 0x4B86, 0xD8A1, 0xD8FE, 0x1257,
+ 0xD940, 0xD940, 0x4B87, 0xD941, 0xD941, 0x22A2, 0xD942, 0xD942, 0x24AB,
+ 0xD943, 0xD943, 0x4B88, 0xD944, 0xD944, 0x24AF, 0xD945, 0xD945, 0x1EE8,
+ 0xD946, 0xD946, 0x1F39, 0xD947, 0xD947, 0x4B89, 0xD948, 0xD948, 0x1E48,
+ 0xD949, 0xD949, 0x2070, 0xD94A, 0xD94A, 0x1EA8, 0xD94B, 0xD94B, 0x4B8A,
+ 0xD94C, 0xD94C, 0x24AC, 0xD94D, 0xD94D, 0x1EF7, 0xD94E, 0xD94E, 0x2176,
+ 0xD94F, 0xD94F, 0x24AD, 0xD950, 0xD950, 0x4B8B, 0xD951, 0xD951, 0x207B,
+ 0xD952, 0xD952, 0x1F45, 0xD953, 0xD953, 0x24AA, 0xD954, 0xD954, 0x204B,
+ 0xD955, 0xD955, 0x202F, 0xD956, 0xD956, 0x1F5A, 0xD957, 0xD957, 0x24B0,
+ 0xD958, 0xD958, 0x4B8C, 0xD959, 0xD959, 0x22B7, 0xD95A, 0xD95A, 0x1F7F,
+ 0xD95B, 0xD95B, 0x4B8D, 0xD95C, 0xD95C, 0x2265, 0xD95D, 0xD962, 0x4B8E,
+ 0xD963, 0xD963, 0x24B2, 0xD964, 0xD964, 0x211B, 0xD965, 0xD965, 0x1E51,
+ 0xD966, 0xD966, 0x4B94, 0xD967, 0xD967, 0x24B4, 0xD968, 0xD96B, 0x4B95,
+ 0xD96C, 0xD96C, 0x24B3, 0xD96D, 0xD96D, 0x4B99, 0xD96E, 0xD96E, 0x1E9F,
+ 0xD96F, 0xD96F, 0x4B9A, 0xD970, 0xD970, 0x2118, 0xD971, 0xD971, 0x4B9B,
+ 0xD972, 0xD972, 0x20B4, 0xD973, 0xD973, 0x23AF, 0xD974, 0xD974, 0x21BB,
+ 0xD975, 0xD975, 0x2072, 0xD976, 0xD976, 0x1F95, 0xD977, 0xD977, 0x4B9C,
+ 0xD978, 0xD978, 0x1F0A, 0xD979, 0xD979, 0x24B6, 0xD97A, 0xD97B, 0x4B9D,
+ 0xD97C, 0xD97C, 0x2291, 0xD97D, 0xD97D, 0x24B5, 0xD97E, 0xD97E, 0x2278,
+ 0xD980, 0xD980, 0x1ED4, 0xD981, 0xD986, 0x4B9F, 0xD987, 0xD987, 0x1FF3,
+ 0xD988, 0xD98C, 0x4BA5, 0xD98D, 0xD98D, 0x22A9, 0xD98E, 0xD98E, 0x24B7,
+ 0xD98F, 0xD98F, 0x1F28, 0xD990, 0xD990, 0x2109, 0xD991, 0xD991, 0x22C7,
+ 0xD992, 0xD996, 0x4BAA, 0xD997, 0xD997, 0x24AE, 0xD998, 0xD998, 0x22B1,
+ 0xD999, 0xD99A, 0x4BAF, 0xD99B, 0xD99B, 0x2266, 0xD99C, 0xD99C, 0x4BB1,
+ 0xD99D, 0xD99D, 0x225B, 0xD99E, 0xD99E, 0x22C4, 0xD99F, 0xD99F, 0x4BB2,
+ 0xD9A0, 0xD9A0, 0x2115, 0xD9A1, 0xD9FE, 0x12B5, 0xDA40, 0xDA40, 0x4BB3,
+ 0xDA41, 0xDA41, 0x222A, 0xDA42, 0xDA42, 0x24B1, 0xDA43, 0xDA47, 0x4BB4,
+ 0xDA48, 0xDA48, 0x213D, 0xDA49, 0xDA4C, 0x4BB9, 0xDA4D, 0xDA4D, 0x1F15,
+ 0xDA4E, 0xDA4E, 0x225C, 0xDA4F, 0xDA72, 0x4BBD, 0xDA73, 0xDA73, 0x1F14,
+ 0xDA74, 0xDA76, 0x4BE1, 0xDA77, 0xDA77, 0x227A, 0xDA78, 0xDA7E, 0x4BE4,
+ 0xDA80, 0xDA84, 0x4BEB, 0xDA85, 0xDA85, 0x20EE, 0xDA86, 0xDA8D, 0x4BF0,
+ 0xDA8E, 0xDA8E, 0x25F8, 0xDA8F, 0xDAA0, 0x4BF8, 0xDAA1, 0xDAFE, 0x1313,
+ 0xDB40, 0xDB5F, 0x4C0A, 0xDB60, 0xDB60, 0x1F94, 0xDB61, 0xDB77, 0x4C2A,
+ 0xDB78, 0xDB78, 0x2230, 0xDB79, 0xDB7E, 0x4C41, 0xDB80, 0xDB83, 0x4C47,
+ 0xDB84, 0xDB84, 0x25FD, 0xDB85, 0xDB8A, 0x4C4B, 0xDB8B, 0xDB8B, 0x2600,
+ 0xDB8C, 0xDB97, 0x4C51, 0xDB98, 0xDB98, 0x2606, 0xDB99, 0xDBA0, 0x4C5D,
+ 0xDBA1, 0xDBFE, 0x1371, 0xDC40, 0xDC44, 0x4C65, 0xDC45, 0xDC45, 0x25FF,
+ 0xDC46, 0xDC4E, 0x4C6A, 0xDC4F, 0xDC4F, 0x25FC, 0xDC50, 0xDC50, 0x1E8C,
+ 0xDC51, 0xDC51, 0x2602, 0xDC52, 0xDC52, 0x4C73, 0xDC53, 0xDC53, 0x224D,
+ 0xDC54, 0xDC54, 0x4C74, 0xDC55, 0xDC55, 0x2604, 0xDC56, 0xDC56, 0x25FE,
+ 0xDC57, 0xDC57, 0x2603, 0xDC58, 0xDC5C, 0x4C75, 0xDC5D, 0xDC5D, 0x2601,
+ 0xDC5E, 0xDC61, 0x4C7A, 0xDC62, 0xDC62, 0x2605, 0xDC63, 0xDC65, 0x4C7E,
+ 0xDC66, 0xDC66, 0x1EA3, 0xDC67, 0xDC67, 0x2608, 0xDC68, 0xDC6A, 0x4C81,
+ 0xDC6B, 0xDC6B, 0x2607, 0xDC6C, 0xDC7B, 0x4C84, 0xDC7C, 0xDC7C, 0x20F0,
+ 0xDC7D, 0xDC7E, 0x4C94, 0xDC80, 0xDC86, 0x4C96, 0xDC87, 0xDC87, 0x1E7B,
+ 0xDC88, 0xDC88, 0x2267, 0xDC89, 0xDC89, 0x1F36, 0xDC8A, 0xDC8A, 0x1FD6,
+ 0xDC8B, 0xDC8D, 0x4C9D, 0xDC8E, 0xDC8E, 0x21E0, 0xDC8F, 0xDC8F, 0x4CA0,
+ 0xDC90, 0xDC90, 0x248C, 0xDC91, 0xDC96, 0x4CA1, 0xDC97, 0xDC97, 0x248D,
+ 0xDC98, 0xDC9A, 0x4CA7, 0xDC9B, 0xDC9B, 0x2102, 0xDC9C, 0xDC9F, 0x4CAA,
+ 0xDCA0, 0xDCA0, 0x2494, 0xDCA1, 0xDCFE, 0x13CF, 0xDD40, 0xDD45, 0x4CAE,
+ 0xDD46, 0xDD46, 0x2493, 0xDD47, 0xDD4C, 0x4CB4, 0xDD4D, 0xDD4D, 0x248E,
+ 0xDD4E, 0xDD52, 0x4CBA, 0xDD53, 0xDD53, 0x2299, 0xDD54, 0xDD54, 0x2491,
+ 0xDD55, 0xDD55, 0x2496, 0xDD56, 0xDD56, 0x248F, 0xDD57, 0xDD57, 0x2492,
+ 0xDD58, 0xDD58, 0x4CBF, 0xDD59, 0xDD59, 0x2497, 0xDD5A, 0xDD5D, 0x4CC0,
+ 0xDD5E, 0xDD5E, 0x1FB1, 0xDD5F, 0xDD5F, 0x4CC4, 0xDD60, 0xDD60, 0x249A,
+ 0xDD61, 0xDD61, 0x4CC5, 0xDD62, 0xDD62, 0x2499, 0xDD63, 0xDD63, 0x4CC6,
+ 0xDD64, 0xDD64, 0x2258, 0xDD65, 0xDD65, 0x2498, 0xDD66, 0xDD6C, 0x4CC7,
+ 0xDD6D, 0xDD6D, 0x249B, 0xDD6E, 0xDD6E, 0x4CCE, 0xDD6F, 0xDD6F, 0x1F09,
+ 0xDD70, 0xDD70, 0x20E6, 0xDD71, 0xDD75, 0x4CCF, 0xDD76, 0xDD76, 0x2026,
+ 0xDD77, 0xDD77, 0x249F, 0xDD78, 0xDD78, 0x1F59, 0xDD79, 0xDD7A, 0x249D,
+ 0xDD7B, 0xDD7E, 0x4CD4, 0xDD80, 0xDD80, 0x4CD8, 0xDD81, 0xDD81, 0x1F3B,
+ 0xDD82, 0xDD82, 0x249C, 0xDD83, 0xDD84, 0x4CD9, 0xDD85, 0xDD85, 0x1E3A,
+ 0xDD86, 0xDD86, 0x205B, 0xDD87, 0xDD8A, 0x4CDB, 0xDD8B, 0xDD8B, 0x1F70,
+ 0xDD8C, 0xDD8E, 0x4CDF, 0xDD8F, 0xDD8F, 0x24A0, 0xDD90, 0xDD93, 0x4CE2,
+ 0xDD94, 0xDD94, 0x213B, 0xDD95, 0xDD96, 0x4CE6, 0xDD97, 0xDD97, 0x1F07,
+ 0xDD98, 0xDD99, 0x4CE8, 0xDD9A, 0xDD9A, 0x2270, 0xDD9B, 0xDD9B, 0x2237,
+ 0xDD9C, 0xDD9D, 0x4CEA, 0xDD9E, 0xDD9E, 0x24D2, 0xDD9F, 0xDD9F, 0x4CEC,
+ 0xDDA0, 0xDDA0, 0x21B3, 0xDDA1, 0xDDFE, 0x142D, 0xDE40, 0xDE40, 0x2245,
+ 0xDE41, 0xDE41, 0x24A1, 0xDE42, 0xDE43, 0x4CED, 0xDE44, 0xDE44, 0x22A8,
+ 0xDE45, 0xDE47, 0x4CEF, 0xDE48, 0xDE48, 0x227C, 0xDE49, 0xDE49, 0x1FB0,
+ 0xDE4A, 0xDE4E, 0x4CF2, 0xDE4F, 0xDE4F, 0x24A2, 0xDE50, 0xDE59, 0x4CF7,
+ 0xDE5A, 0xDE5A, 0x1F46, 0xDE5B, 0xDE5B, 0x4D01, 0xDE5C, 0xDE5C, 0x2380,
+ 0xDE5D, 0xDE5D, 0x2495, 0xDE5E, 0xDE5E, 0x4D02, 0xDE5F, 0xDE5F, 0x2490,
+ 0xDE60, 0xDE6A, 0x4D03, 0xDE6B, 0xDE6B, 0x1E30, 0xDE6C, 0xDE6E, 0x4D0E,
+ 0xDE6F, 0xDE6F, 0x1E9D, 0xDE70, 0xDE70, 0x1E4B, 0xDE71, 0xDE71, 0x1E4A,
+ 0xDE72, 0xDE72, 0x20AA, 0xDE73, 0xDE7E, 0x4D11, 0xDE80, 0xDE91, 0x4D1D,
+ 0xDE92, 0xDE92, 0x267B, 0xDE93, 0xDE9E, 0x4D2F, 0xDE9F, 0xDE9F, 0x23F2,
+ 0xDEA0, 0xDEA0, 0x4D3B, 0xDEA1, 0xDEFE, 0x148B, 0xDF40, 0xDF40, 0x227E,
+ 0xDF41, 0xDF41, 0x4D3C, 0xDF42, 0xDF42, 0x2019, 0xDF43, 0xDF4C, 0x4D3D,
+ 0xDF4D, 0xDF4D, 0x1FBB, 0xDF4E, 0xDF5B, 0x4D47, 0xDF5C, 0xDF5C, 0x2253,
+ 0xDF5D, 0xDF5D, 0x4D55, 0xDF5E, 0xDF5E, 0x1F3E, 0xDF5F, 0xDF5F, 0x1EA6,
+ 0xDF60, 0xDF60, 0x218E, 0xDF61, 0xDF63, 0x4D56, 0xDF64, 0xDF64, 0x21EC,
+ 0xDF65, 0xDF65, 0x4D59, 0xDF66, 0xDF66, 0x1EBE, 0xDF67, 0xDF67, 0x4D5A,
+ 0xDF68, 0xDF68, 0x224A, 0xDF69, 0xDF6C, 0x4D5B, 0xDF6D, 0xDF6D, 0x2133,
+ 0xDF6E, 0xDF73, 0x4D5F, 0xDF74, 0xDF74, 0x1E84, 0xDF75, 0xDF76, 0x4D65,
+ 0xDF77, 0xDF77, 0x20CF, 0xDF78, 0xDF78, 0x21E2, 0xDF79, 0xDF79, 0x4D67,
+ 0xDF7A, 0xDF7A, 0x220F, 0xDF7B, 0xDF7B, 0x4D68, 0xDF7C, 0xDF7C, 0x2029,
+ 0xDF7D, 0xDF7D, 0x4D69, 0xDF7E, 0xDF7E, 0x2073, 0xDF80, 0xDF80, 0x1F55,
+ 0xDF81, 0xDF82, 0x4D6A, 0xDF83, 0xDF83, 0x23F1, 0xDF84, 0xDF84, 0x4D6C,
+ 0xDF85, 0xDF85, 0x1E46, 0xDF86, 0xDF88, 0x4D6D, 0xDF89, 0xDF89, 0x2063,
+ 0xDF8A, 0xDF8A, 0x23F3, 0xDF8B, 0xDFA0, 0x4D70, 0xDFA1, 0xDFFE, 0x14E9,
+ 0xE040, 0xE04F, 0x4D86, 0xE050, 0xE050, 0x231E, 0xE051, 0xE05C, 0x4D96,
+ 0xE05D, 0xE05D, 0x2233, 0xE05E, 0xE068, 0x4DA2, 0xE069, 0xE069, 0x2320,
+ 0xE06A, 0xE06B, 0x4DAD, 0xE06C, 0xE06C, 0x21C7, 0xE06D, 0xE074, 0x4DAF,
+ 0xE075, 0xE075, 0x22BC, 0xE076, 0xE076, 0x4DB7, 0xE077, 0xE077, 0x231C,
+ 0xE078, 0xE078, 0x4DB8, 0xE079, 0xE079, 0x2251, 0xE07A, 0xE07E, 0x4DB9,
+ 0xE080, 0xE086, 0x4DBE, 0xE087, 0xE087, 0x1EBB, 0xE088, 0xE08C, 0x4DC5,
+ 0xE08D, 0xE08D, 0x2287, 0xE08E, 0xE08E, 0x4DCA, 0xE08F, 0xE08F, 0x202D,
+ 0xE090, 0xE090, 0x1EAB, 0xE091, 0xE091, 0x4DCB, 0xE092, 0xE092, 0x231D,
+ 0xE093, 0xE093, 0x4DCC, 0xE094, 0xE094, 0x231F, 0xE095, 0xE096, 0x4DCD,
+ 0xE097, 0xE097, 0x231B, 0xE098, 0xE0A0, 0x4DCF, 0xE0A1, 0xE0FE, 0x1547,
+ 0xE140, 0xE141, 0x4DD8, 0xE142, 0xE142, 0x2321, 0xE143, 0xE163, 0x4DDA,
+ 0xE164, 0xE164, 0x2255, 0xE165, 0xE167, 0x4DFB, 0xE168, 0xE168, 0x1E8F,
+ 0xE169, 0xE173, 0x4DFE, 0xE174, 0xE174, 0x220C, 0xE175, 0xE175, 0x1FA4,
+ 0xE176, 0xE17E, 0x4E09, 0xE180, 0xE183, 0x4E12, 0xE184, 0xE184, 0x209B,
+ 0xE185, 0xE185, 0x21D8, 0xE186, 0xE186, 0x4E16, 0xE187, 0xE187, 0x25FA,
+ 0xE188, 0xE188, 0x4E17, 0xE189, 0xE189, 0x25F9, 0xE18A, 0xE18B, 0x4E18,
+ 0xE18C, 0xE18C, 0x2134, 0xE18D, 0xE18D, 0x4E1A, 0xE18E, 0xE190, 0x24F3,
+ 0xE191, 0xE191, 0x24F8, 0xE192, 0xE192, 0x4E1B, 0xE193, 0xE193, 0x24F7,
+ 0xE194, 0xE194, 0x1EC8, 0xE195, 0xE195, 0x24F6, 0xE196, 0xE197, 0x4E1C,
+ 0xE198, 0xE198, 0x2280, 0xE199, 0xE19D, 0x4E1E, 0xE19E, 0xE19E, 0x1EC5,
+ 0xE19F, 0xE19F, 0x24FB, 0xE1A0, 0xE1A0, 0x4E23, 0xE1A1, 0xE1FE, 0x15A5,
+ 0xE240, 0xE240, 0x4E24, 0xE241, 0xE241, 0x24FA, 0xE242, 0xE242, 0x4E25,
+ 0xE243, 0xE243, 0x1EED, 0xE244, 0xE24E, 0x4E26, 0xE24F, 0xE24F, 0x24FD,
+ 0xE250, 0xE250, 0x4E31, 0xE251, 0xE251, 0x24F9, 0xE252, 0xE252, 0x4E32,
+ 0xE253, 0xE253, 0x24FE, 0xE254, 0xE254, 0x20CD, 0xE255, 0xE259, 0x4E33,
+ 0xE25A, 0xE25A, 0x2508, 0xE25B, 0xE25B, 0x2504, 0xE25C, 0xE25D, 0x4E38,
+ 0xE25E, 0xE25E, 0x2506, 0xE25F, 0xE261, 0x4E3A, 0xE262, 0xE262, 0x24FF,
+ 0xE263, 0xE263, 0x2090, 0xE264, 0xE266, 0x4E3D, 0xE267, 0xE267, 0x1EDD,
+ 0xE268, 0xE268, 0x1F25, 0xE269, 0xE269, 0x4E40, 0xE26A, 0xE26A, 0x2503,
+ 0xE26B, 0xE26B, 0x2502, 0xE26C, 0xE26D, 0x4E41, 0xE26E, 0xE26E, 0x1E7A,
+ 0xE26F, 0xE26F, 0x20A6, 0xE270, 0xE277, 0x4E43, 0xE278, 0xE278, 0x1FD5,
+ 0xE279, 0xE27C, 0x4E4B, 0xE27D, 0xE27D, 0x1F11, 0xE27E, 0xE27E, 0x4E4F,
+ 0xE280, 0xE280, 0x2507, 0xE281, 0xE281, 0x2500, 0xE282, 0xE282, 0x2505,
+ 0xE283, 0xE288, 0x4E50, 0xE289, 0xE289, 0x2519, 0xE28A, 0xE28A, 0x4E56,
+ 0xE28B, 0xE28B, 0x2515, 0xE28C, 0xE28D, 0x4E57, 0xE28E, 0xE28E, 0x250C,
+ 0xE28F, 0xE28F, 0x2031, 0xE290, 0xE291, 0x4E59, 0xE292, 0xE292, 0x250B,
+ 0xE293, 0xE293, 0x250F, 0xE294, 0xE294, 0x251A, 0xE295, 0xE295, 0x2509,
+ 0xE296, 0xE297, 0x4E5B, 0xE298, 0xE298, 0x250E, 0xE299, 0xE299, 0x2234,
+ 0xE29A, 0xE29A, 0x2513, 0xE29B, 0xE29B, 0x1F80, 0xE29C, 0xE29F, 0x4E5D,
+ 0xE2A0, 0xE2A0, 0x2501, 0xE2A1, 0xE2FE, 0x1603, 0xE340, 0xE341, 0x4E61,
+ 0xE342, 0xE342, 0x2517, 0xE343, 0xE343, 0x2516, 0xE344, 0xE346, 0x4E63,
+ 0xE347, 0xE347, 0x2518, 0xE348, 0xE34A, 0x4E66, 0xE34B, 0xE34B, 0x1E56,
+ 0xE34C, 0xE34E, 0x4E69, 0xE34F, 0xE34F, 0x250D, 0xE350, 0xE350, 0x4E6C,
+ 0xE351, 0xE351, 0x20D3, 0xE352, 0xE353, 0x4E6D, 0xE354, 0xE354, 0x207A,
+ 0xE355, 0xE355, 0x20CE, 0xE356, 0xE357, 0x4E6F, 0xE358, 0xE358, 0x2510,
+ 0xE359, 0xE35B, 0x4E71, 0xE35C, 0xE35C, 0x1E55, 0xE35D, 0xE35F, 0x4E74,
+ 0xE360, 0xE360, 0x250A, 0xE361, 0xE365, 0x4E77, 0xE366, 0xE367, 0x2511,
+ 0xE368, 0xE370, 0x4E7C, 0xE371, 0xE371, 0x1FAA, 0xE372, 0xE372, 0x4E85,
+ 0xE373, 0xE373, 0x251E, 0xE374, 0xE374, 0x1F1F, 0xE375, 0xE377, 0x4E86,
+ 0xE378, 0xE378, 0x252D, 0xE379, 0xE379, 0x221D, 0xE37A, 0xE37B, 0x4E89,
+ 0xE37C, 0xE37C, 0x2532, 0xE37D, 0xE37D, 0x4E8B, 0xE37E, 0xE37E, 0x217B,
+ 0xE380, 0xE389, 0x4E8C, 0xE38A, 0xE38A, 0x21AF, 0xE38B, 0xE38B, 0x4E96,
+ 0xE38C, 0xE38C, 0x252C, 0xE38D, 0xE38E, 0x4E97, 0xE38F, 0xE38F, 0x2528,
+ 0xE390, 0xE390, 0x4E99, 0xE391, 0xE391, 0x208C, 0xE392, 0xE392, 0x4E9A,
+ 0xE393, 0xE393, 0x252F, 0xE394, 0xE394, 0x4E9B, 0xE395, 0xE395, 0x21BC,
+ 0xE396, 0xE398, 0x4E9C, 0xE399, 0xE399, 0x251D, 0xE39A, 0xE39B, 0x4E9F,
+ 0xE39C, 0xE39C, 0x2535, 0xE39D, 0xE39D, 0x4EA1, 0xE39E, 0xE39E, 0x220D,
+ 0xE39F, 0xE39F, 0x2526, 0xE3A0, 0xE3A0, 0x4EA2, 0xE3A1, 0xE3FE, 0x1661,
+ 0xE440, 0xE440, 0x2534, 0xE441, 0xE441, 0x252A, 0xE442, 0xE442, 0x251F,
+ 0xE443, 0xE443, 0x2531, 0xE444, 0xE444, 0x251C, 0xE445, 0xE447, 0x4EA3,
+ 0xE448, 0xE448, 0x2525, 0xE449, 0xE44D, 0x4EA6, 0xE44E, 0xE44E, 0x21CD,
+ 0xE44F, 0xE44F, 0x4EAB, 0xE450, 0xE450, 0x21DA, 0xE451, 0xE451, 0x4EAC,
+ 0xE452, 0xE452, 0x2172, 0xE453, 0xE453, 0x253E, 0xE454, 0xE457, 0x4EAD,
+ 0xE458, 0xE458, 0x204F, 0xE459, 0xE459, 0x4EB1, 0xE45A, 0xE45A, 0x2543,
+ 0xE45B, 0xE45B, 0x4EB2, 0xE45C, 0xE45C, 0x21D7, 0xE45D, 0xE45D, 0x4EB3,
+ 0xE45E, 0xE45E, 0x1E3C, 0xE45F, 0xE461, 0x4EB4, 0xE462, 0xE462, 0x2529,
+ 0xE463, 0xE464, 0x4EB7, 0xE465, 0xE465, 0x2521, 0xE466, 0xE467, 0x4EB9,
+ 0xE468, 0xE468, 0x1EFF, 0xE469, 0xE472, 0x4EBB, 0xE473, 0xE473, 0x253F,
+ 0xE474, 0xE474, 0x4EC5, 0xE475, 0xE475, 0x2544, 0xE476, 0xE478, 0x4EC6,
+ 0xE479, 0xE479, 0x2523, 0xE47A, 0xE47A, 0x1E90, 0xE47B, 0xE47B, 0x253A,
+ 0xE47C, 0xE47C, 0x2545, 0xE47D, 0xE47D, 0x4EC9, 0xE47E, 0xE47E, 0x253D,
+ 0xE480, 0xE480, 0x4ECA, 0xE481, 0xE481, 0x20C1, 0xE482, 0xE483, 0x4ECB,
+ 0xE484, 0xE484, 0x2103, 0xE485, 0xE485, 0x2520, 0xE486, 0xE486, 0x253C,
+ 0xE487, 0xE487, 0x253B, 0xE488, 0xE488, 0x2538, 0xE489, 0xE48C, 0x4ECD,
+ 0xE48D, 0xE48D, 0x2540, 0xE48E, 0xE48E, 0x4ED1, 0xE48F, 0xE48F, 0x1FCD,
+ 0xE490, 0xE492, 0x4ED2, 0xE493, 0xE493, 0x1F18, 0xE494, 0xE497, 0x4ED5,
+ 0xE498, 0xE498, 0x254B, 0xE499, 0xE49C, 0x4ED9, 0xE49D, 0xE49D, 0x2547,
+ 0xE49E, 0xE49F, 0x254F, 0xE4A0, 0xE4A0, 0x4EDD, 0xE4A1, 0xE4FE, 0x16BF,
+ 0xE540, 0xE545, 0x4EDE, 0xE546, 0xE546, 0x22B0, 0xE547, 0xE547, 0x4EE4,
+ 0xE548, 0xE548, 0x2546, 0xE549, 0xE54A, 0x4EE5, 0xE54B, 0xE54B, 0x254C,
+ 0xE54C, 0xE54D, 0x4EE7, 0xE54E, 0xE54E, 0x1E9A, 0xE54F, 0xE54F, 0x2552,
+ 0xE550, 0xE550, 0x2530, 0xE551, 0xE551, 0x2549, 0xE552, 0xE554, 0x4EE9,
+ 0xE555, 0xE555, 0x2551, 0xE556, 0xE556, 0x1ECA, 0xE557, 0xE557, 0x4EEC,
+ 0xE558, 0xE558, 0x20D2, 0xE559, 0xE55B, 0x4EED, 0xE55C, 0xE55C, 0x1FB8,
+ 0xE55D, 0xE55D, 0x4EF0, 0xE55E, 0xE55E, 0x2079, 0xE55F, 0xE560, 0x4EF1,
+ 0xE561, 0xE561, 0x21AB, 0xE562, 0xE563, 0x4EF3, 0xE564, 0xE564, 0x254D,
+ 0xE565, 0xE565, 0x1EA5, 0xE566, 0xE567, 0x4EF5, 0xE568, 0xE568, 0x204C,
+ 0xE569, 0xE569, 0x2080, 0xE56A, 0xE56B, 0x4EF7, 0xE56C, 0xE56C, 0x266D,
+ 0xE56D, 0xE56D, 0x4EF9, 0xE56E, 0xE56E, 0x2537, 0xE56F, 0xE574, 0x4EFA,
+ 0xE575, 0xE575, 0x254A, 0xE576, 0xE576, 0x21B8, 0xE577, 0xE577, 0x4F00,
+ 0xE578, 0xE578, 0x254E, 0xE579, 0xE57A, 0x4F01, 0xE57B, 0xE57B, 0x24FC,
+ 0xE57C, 0xE57C, 0x2554, 0xE57D, 0xE57E, 0x4F03, 0xE580, 0xE580, 0x4F05,
+ 0xE581, 0xE581, 0x1F3C, 0xE582, 0xE582, 0x4F06, 0xE583, 0xE583, 0x1ED5,
+ 0xE584, 0xE589, 0x4F07, 0xE58A, 0xE58A, 0x2556, 0xE58B, 0xE58D, 0x4F0D,
+ 0xE58E, 0xE58E, 0x2268, 0xE58F, 0xE590, 0x4F10, 0xE591, 0xE591, 0x1ED6,
+ 0xE592, 0xE599, 0x4F12, 0xE59A, 0xE59A, 0x2557, 0xE59B, 0xE59B, 0x2553,
+ 0xE59C, 0xE59E, 0x4F1A, 0xE59F, 0xE59F, 0x2548, 0xE5A0, 0xE5A0, 0x4F1D,
+ 0xE5A1, 0xE5FE, 0x171D, 0xE640, 0xE640, 0x20DC, 0xE641, 0xE643, 0x4F1E,
+ 0xE644, 0xE644, 0x2559, 0xE645, 0xE648, 0x4F21, 0xE649, 0xE649, 0x1F97,
+ 0xE64A, 0xE64A, 0x2555, 0xE64B, 0xE64D, 0x4F25, 0xE64E, 0xE64E, 0x227D,
+ 0xE64F, 0xE651, 0x4F28, 0xE652, 0xE652, 0x257E, 0xE653, 0xE655, 0x4F2B,
+ 0xE656, 0xE656, 0x207C, 0xE657, 0xE657, 0x4F2E, 0xE658, 0xE658, 0x255A,
+ 0xE659, 0xE65A, 0x4F2F, 0xE65B, 0xE65B, 0x255E, 0xE65C, 0xE65D, 0x4F31,
+ 0xE65E, 0xE65E, 0x1E34, 0xE65F, 0xE668, 0x4F33, 0xE669, 0xE669, 0x215E,
+ 0xE66A, 0xE66A, 0x4F3D, 0xE66B, 0xE66B, 0x2560, 0xE66C, 0xE674, 0x4F3E,
+ 0xE675, 0xE675, 0x21A2, 0xE676, 0xE676, 0x2354, 0xE677, 0xE678, 0x4F47,
+ 0xE679, 0xE679, 0x2563, 0xE67A, 0xE67A, 0x2527, 0xE67B, 0xE67B, 0x4F49,
+ 0xE67C, 0xE67C, 0x252E, 0xE67D, 0xE67D, 0x2558, 0xE67E, 0xE67E, 0x4F4A,
+ 0xE680, 0xE680, 0x1F1B, 0xE681, 0xE681, 0x4F4B, 0xE682, 0xE682, 0x2283,
+ 0xE683, 0xE683, 0x4F4C, 0xE684, 0xE684, 0x2564, 0xE685, 0xE686, 0x4F4D,
+ 0xE687, 0xE687, 0x20A0, 0xE688, 0xE688, 0x4F4F, 0xE689, 0xE689, 0x2565,
+ 0xE68A, 0xE68B, 0x4F50, 0xE68C, 0xE68C, 0x2561, 0xE68D, 0xE692, 0x4F52,
+ 0xE693, 0xE693, 0x2562, 0xE694, 0xE696, 0x4F58, 0xE697, 0xE697, 0x256C,
+ 0xE698, 0xE69A, 0x4F5B, 0xE69B, 0xE69B, 0x256D, 0xE69C, 0xE69C, 0x2020,
+ 0xE69D, 0xE69E, 0x4F5E, 0xE69F, 0xE69F, 0x255F, 0xE6A0, 0xE6A0, 0x256A,
+ 0xE6A1, 0xE6FE, 0x177B, 0xE740, 0xE742, 0x4F60, 0xE743, 0xE743, 0x256E,
+ 0xE744, 0xE747, 0x4F63, 0xE748, 0xE748, 0x2539, 0xE749, 0xE749, 0x255C,
+ 0xE74A, 0xE74C, 0x4F67, 0xE74D, 0xE74E, 0x2568, 0xE74F, 0xE74F, 0x256B,
+ 0xE750, 0xE750, 0x1E6F, 0xE751, 0xE751, 0x4F6A, 0xE752, 0xE752, 0x1FC4,
+ 0xE753, 0xE753, 0x2567, 0xE754, 0xE754, 0x4F6B, 0xE755, 0xE755, 0x255B,
+ 0xE756, 0xE758, 0x4F6C, 0xE759, 0xE759, 0x261D, 0xE75A, 0xE765, 0x4F6F,
+ 0xE766, 0xE766, 0x252B, 0xE767, 0xE767, 0x4F7B, 0xE768, 0xE768, 0x2571,
+ 0xE769, 0xE769, 0x4F7C, 0xE76A, 0xE76A, 0x2577, 0xE76B, 0xE773, 0x4F7D,
+ 0xE774, 0xE774, 0x2522, 0xE775, 0xE77B, 0x4F86, 0xE77C, 0xE77C, 0x2533,
+ 0xE77D, 0xE77E, 0x4F8D, 0xE780, 0xE781, 0x4F8F, 0xE782, 0xE782, 0x202A,
+ 0xE783, 0xE783, 0x4F91, 0xE784, 0xE784, 0x2536, 0xE785, 0xE785, 0x2573,
+ 0xE786, 0xE786, 0x256F, 0xE787, 0xE789, 0x4F92, 0xE78A, 0xE78A, 0x2293,
+ 0xE78B, 0xE78B, 0x2578, 0xE78C, 0xE78E, 0x4F95, 0xE78F, 0xE78F, 0x2570,
+ 0xE790, 0xE791, 0x4F98, 0xE792, 0xE792, 0x2575, 0xE793, 0xE797, 0x4F9A,
+ 0xE798, 0xE799, 0x2541, 0xE79A, 0xE79A, 0x255D, 0xE79B, 0xE79F, 0x4F9F,
+ 0xE7A0, 0xE7A0, 0x201A, 0xE7A1, 0xE7FE, 0x17D9, 0xE840, 0xE842, 0x4FA4,
+ 0xE843, 0xE843, 0x257A, 0xE844, 0xE844, 0x2006, 0xE845, 0xE845, 0x4FA7,
+ 0xE846, 0xE846, 0x2177, 0xE847, 0xE848, 0x4FA8, 0xE849, 0xE849, 0x251B,
+ 0xE84A, 0xE84A, 0x4FAA, 0xE84B, 0xE84B, 0x2524, 0xE84C, 0xE84E, 0x4FAB,
+ 0xE84F, 0xE84F, 0x257B, 0xE850, 0xE853, 0x4FAE, 0xE854, 0xE854, 0x22A3,
+ 0xE855, 0xE859, 0x4FB2, 0xE85A, 0xE85A, 0x2579, 0xE85B, 0xE85B, 0x4FB7,
+ 0xE85C, 0xE85C, 0x2566, 0xE85D, 0xE861, 0x4FB8, 0xE862, 0xE862, 0x1F93,
+ 0xE863, 0xE863, 0x4FBD, 0xE864, 0xE864, 0x257C, 0xE865, 0xE86F, 0x4FBE,
+ 0xE870, 0xE870, 0x2514, 0xE871, 0xE872, 0x4FC9, 0xE873, 0xE873, 0x257D,
+ 0xE874, 0xE874, 0x4FCB, 0xE875, 0xE875, 0x2572, 0xE876, 0xE87B, 0x4FCC,
+ 0xE87C, 0xE87C, 0x2574, 0xE87D, 0xE87E, 0x4FD2, 0xE880, 0xE880, 0x224E,
+ 0xE881, 0xE881, 0x4FD4, 0xE882, 0xE882, 0x21C6, 0xE883, 0xE886, 0x4FD5,
+ 0xE887, 0xE887, 0x209F, 0xE888, 0xE888, 0x4FD9, 0xE889, 0xE889, 0x2576,
+ 0xE88A, 0xE88B, 0x4FDA, 0xE88C, 0xE88C, 0x2064, 0xE88D, 0xE88D, 0x22BF,
+ 0xE88E, 0xE88E, 0x261C, 0xE88F, 0xE88F, 0x225E, 0xE890, 0xE8A0, 0x4FDC,
+ 0xE8A1, 0xE8FE, 0x1837, 0xE940, 0xE94B, 0x4FED, 0xE94C, 0xE94C, 0x1E75,
+ 0xE94D, 0xE953, 0x4FF9, 0xE954, 0xE954, 0x207D, 0xE955, 0xE955, 0x5000,
+ 0xE956, 0xE956, 0x23BF, 0xE957, 0xE957, 0x2113, 0xE958, 0xE959, 0x5001,
+ 0xE95A, 0xE95A, 0x23C0, 0xE95B, 0xE95C, 0x5003, 0xE95D, 0xE95D, 0x1E45,
+ 0xE95E, 0xE95E, 0x5005, 0xE95F, 0xE95F, 0x1FD8, 0xE960, 0xE960, 0x23C4,
+ 0xE961, 0xE961, 0x5006, 0xE962, 0xE962, 0x23C2, 0xE963, 0xE963, 0x2104,
+ 0xE964, 0xE964, 0x5007, 0xE965, 0xE965, 0x21BD, 0xE966, 0xE966, 0x5008,
+ 0xE967, 0xE967, 0x1F87, 0xE968, 0xE968, 0x23C3, 0xE969, 0xE96B, 0x5009,
+ 0xE96C, 0xE96C, 0x2269, 0xE96D, 0xE974, 0x500C, 0xE975, 0xE975, 0x1F43,
+ 0xE976, 0xE976, 0x5014, 0xE977, 0xE977, 0x1F1E, 0xE978, 0xE978, 0x2679,
+ 0xE979, 0xE979, 0x1EEB, 0xE97A, 0xE97B, 0x5015, 0xE97C, 0xE97C, 0x1F35,
+ 0xE97D, 0xE97D, 0x208A, 0xE97E, 0xE97E, 0x5017, 0xE980, 0xE980, 0x23C7,
+ 0xE981, 0xE981, 0x23C9, 0xE982, 0xE982, 0x23C6, 0xE983, 0xE986, 0x5018,
+ 0xE987, 0xE987, 0x224F, 0xE988, 0xE98A, 0x501C, 0xE98B, 0xE98B, 0x23CB,
+ 0xE98C, 0xE98D, 0x501F, 0xE98E, 0xE98E, 0x21F3, 0xE98F, 0xE98F, 0x5021,
+ 0xE990, 0xE990, 0x21F7, 0xE991, 0xE991, 0x23CF, 0xE992, 0xE992, 0x23CE,
+ 0xE993, 0xE993, 0x23CA, 0xE994, 0xE994, 0x23CD, 0xE995, 0xE997, 0x5022,
+ 0xE998, 0xE998, 0x23D0, 0xE999, 0xE99A, 0x5025, 0xE99B, 0xE99B, 0x266C,
+ 0xE99C, 0xE99C, 0x5027, 0xE99D, 0xE99D, 0x23C1, 0xE99E, 0xE99E, 0x5028,
+ 0xE99F, 0xE99F, 0x1FEE, 0xE9A0, 0xE9A0, 0x23D1, 0xE9A1, 0xE9FE, 0x1895,
+ 0xEA40, 0xEA40, 0x1FF8, 0xEA41, 0xEA43, 0x5029, 0xEA44, 0xEA44, 0x23D3,
+ 0xEA45, 0xEA47, 0x502C, 0xEA48, 0xEA48, 0x23D2, 0xEA49, 0xEA49, 0x23D4,
+ 0xEA4A, 0xEA4A, 0x1E98, 0xEA4B, 0xEA4F, 0x502F, 0xEA50, 0xEA50, 0x1F2C,
+ 0xEA51, 0xEA51, 0x5034, 0xEA52, 0xEA52, 0x23D5, 0xEA53, 0xEA54, 0x5035,
+ 0xEA55, 0xEA55, 0x1E71, 0xEA56, 0xEA56, 0x2691, 0xEA57, 0xEA58, 0x5037,
+ 0xEA59, 0xEA59, 0x23C5, 0xEA5A, 0xEA7E, 0x5039, 0xEA80, 0xEA80, 0x231A,
+ 0xEA81, 0xEA83, 0x505E, 0xEA84, 0xEA84, 0x2114, 0xEA85, 0xEA86, 0x5061,
+ 0xEA87, 0xEA87, 0x2284, 0xEA88, 0xEA8D, 0x5063, 0xEA8E, 0xEA8E, 0x221C,
+ 0xEA8F, 0xEA8F, 0x5069, 0xEA90, 0xEA90, 0x1E7E, 0xEA91, 0xEA91, 0x204D,
+ 0xEA92, 0xEA95, 0x506A, 0xEA96, 0xEA96, 0x2201, 0xEA97, 0xEA9F, 0x506E,
+ 0xEAA0, 0xEAA0, 0x1ED9, 0xEAA1, 0xEAFE, 0x18F3, 0xEB40, 0xEB40, 0x5077,
+ 0xEB41, 0xEB41, 0x1FB2, 0xEB42, 0xEB44, 0x5078, 0xEB45, 0xEB45, 0x2252,
+ 0xEB46, 0xEB47, 0x507B, 0xEB48, 0xEB48, 0x1F79, 0xEB49, 0xEB52, 0x507D,
+ 0xEB53, 0xEB53, 0x2157, 0xEB54, 0xEB54, 0x5087, 0xEB55, 0xEB55, 0x21BF,
+ 0xEB56, 0xEB5A, 0x5088, 0xEB5B, 0xEB5B, 0x221F, 0xEB5C, 0xEB5C, 0x508D,
+ 0xEB5D, 0xEB5D, 0x203D, 0xEB5E, 0xEB5F, 0x508E, 0xEB60, 0xEB60, 0x2015,
+ 0xEB61, 0xEB61, 0x5090, 0xEB62, 0xEB62, 0x26A5, 0xEB63, 0xEB6C, 0x5091,
+ 0xEB6D, 0xEB6D, 0x2156, 0xEB6E, 0xEB6F, 0x509B, 0xEB70, 0xEB70, 0x2144,
+ 0xEB71, 0xEB71, 0x509D, 0xEB72, 0xEB72, 0x1E91, 0xEB73, 0xEB73, 0x2257,
+ 0xEB74, 0xEB77, 0x509E, 0xEB78, 0xEB78, 0x200A, 0xEB79, 0xEB79, 0x2092,
+ 0xEB7A, 0xEB7E, 0x50A2, 0xEB80, 0xEB84, 0x50A7, 0xEB85, 0xEB85, 0x2250,
+ 0xEB86, 0xEB89, 0x50AC, 0xEB8A, 0xEB8A, 0x1EC3, 0xEB8B, 0xEBA0, 0x50B0,
+ 0xEBA1, 0xEBFE, 0x1951, 0xEC40, 0xEC45, 0x50C6, 0xEC46, 0xEC46, 0x21A8,
+ 0xEC47, 0xEC55, 0x50CC, 0xEC56, 0xEC56, 0x260D, 0xEC57, 0xEC59, 0x50DB,
+ 0xEC5A, 0xEC5A, 0x260C, 0xEC5B, 0xEC5B, 0x50DE, 0xEC5C, 0xEC5C, 0x260E,
+ 0xEC5D, 0xEC5F, 0x50DF, 0xEC60, 0xEC60, 0x2032, 0xEC61, 0xEC6D, 0x50E2,
+ 0xEC6E, 0xEC6E, 0x260B, 0xEC6F, 0xEC75, 0x50EF, 0xEC76, 0xEC76, 0x22C3,
+ 0xEC77, 0xEC7E, 0x50F6, 0xEC80, 0xEC95, 0x50FE, 0xEC96, 0xEC96, 0x1F23,
+ 0xEC97, 0xECA0, 0x5114, 0xECA1, 0xECFE, 0x19AF, 0xED40, 0xED45, 0x511E,
+ 0xED46, 0xED46, 0x2695, 0xED47, 0xED57, 0x5124, 0xED58, 0xED58, 0x265E,
+ 0xED59, 0xED5D, 0x5135, 0xED5E, 0xED5E, 0x265D, 0xED5F, 0xED60, 0x513A,
+ 0xED61, 0xED61, 0x2692, 0xED62, 0xED63, 0x513C, 0xED64, 0xED64, 0x265F,
+ 0xED65, 0xED65, 0x513E, 0xED66, 0xED66, 0x218D, 0xED67, 0xED67, 0x20FD,
+ 0xED68, 0xED6D, 0x513F, 0xED6E, 0xED6E, 0x1F40, 0xED6F, 0xED73, 0x5145,
+ 0xED74, 0xED74, 0x2465, 0xED75, 0xED76, 0x514A, 0xED77, 0xED77, 0x2467,
+ 0xED78, 0xED78, 0x514C, 0xED79, 0xED79, 0x2466, 0xED7A, 0xED7E, 0x514D,
+ 0xED80, 0xED90, 0x5152, 0xED91, 0xED91, 0x21C9, 0xED92, 0xED92, 0x5163,
+ 0xED93, 0xED93, 0x2209, 0xED94, 0xED94, 0x1EC9, 0xED95, 0xED95, 0x20E9,
+ 0xED96, 0xED96, 0x5164, 0xED97, 0xED97, 0x21CA, 0xED98, 0xED98, 0x2146,
+ 0xED99, 0xED99, 0x25C5, 0xED9A, 0xED9A, 0x21DC, 0xED9B, 0xED9B, 0x5165,
+ 0xED9C, 0xED9C, 0x245E, 0xED9D, 0xED9D, 0x5166, 0xED9E, 0xED9E, 0x214F,
+ 0xED9F, 0xED9F, 0x5167, 0xEDA0, 0xEDA0, 0x25C6, 0xEDA1, 0xEDFE, 0x1A0D,
+ 0xEE40, 0xEE40, 0x25C7, 0xEE41, 0xEE41, 0x2241, 0xEE42, 0xEE42, 0x218A,
+ 0xEE43, 0xEE43, 0x1E2F, 0xEE44, 0xEE44, 0x1EDC, 0xEE45, 0xEE47, 0x5168,
+ 0xEE48, 0xEE48, 0x20BF, 0xEE49, 0xEE49, 0x2034, 0xEE4A, 0xEE4C, 0x516B,
+ 0xEE4D, 0xEE4D, 0x25C9, 0xEE4E, 0xEE51, 0x516E, 0xEE52, 0xEE52, 0x25C8,
+ 0xEE53, 0xEE54, 0x5172, 0xEE55, 0xEE55, 0x220E, 0xEE56, 0xEE56, 0x5174,
+ 0xEE57, 0xEE57, 0x25CB, 0xEE58, 0xEE5D, 0x5175, 0xEE5E, 0xEE5E, 0x217D,
+ 0xEE5F, 0xEE60, 0x517B, 0xEE61, 0xEE61, 0x1F7E, 0xEE62, 0xEE67, 0x517D,
+ 0xEE68, 0xEE68, 0x25CC, 0xEE69, 0xEE69, 0x1FC3, 0xEE6A, 0xEE6B, 0x5183,
+ 0xEE6C, 0xEE6C, 0x20B9, 0xEE6D, 0xEE6D, 0x5185, 0xEE6E, 0xEE6E, 0x2181,
+ 0xEE6F, 0xEE76, 0x5186, 0xEE77, 0xEE77, 0x1FDA, 0xEE78, 0xEE7C, 0x518E,
+ 0xEE7D, 0xEE7D, 0x2173, 0xEE7E, 0xEE7E, 0x1EE1, 0xEE80, 0xEE80, 0x25CD,
+ 0xEE81, 0xEE84, 0x5193, 0xEE85, 0xEE85, 0x25CE, 0xEE86, 0xEE86, 0x21F6,
+ 0xEE87, 0xEE89, 0x5197, 0xEE8A, 0xEE8A, 0x224B, 0xEE8B, 0xEE8B, 0x25D1,
+ 0xEE8C, 0xEE8C, 0x519A, 0xEE8D, 0xEE8D, 0x1EC0, 0xEE8E, 0xEE8F, 0x519B,
+ 0xEE90, 0xEE90, 0x2008, 0xEE91, 0xEE93, 0x519D, 0xEE94, 0xEE94, 0x25D0,
+ 0xEE95, 0xEE96, 0x51A0, 0xEE97, 0xEE97, 0x25D2, 0xEE98, 0xEE98, 0x51A2,
+ 0xEE99, 0xEE99, 0x1F2A, 0xEE9A, 0xEE9C, 0x51A3, 0xEE9D, 0xEE9D, 0x1E72,
+ 0xEE9E, 0xEE9E, 0x25D3, 0xEE9F, 0xEEA0, 0x51A6, 0xEEA1, 0xEEFE, 0x1A6B,
+ 0xEF40, 0xEF40, 0x21BE, 0xEF41, 0xEF41, 0x25D4, 0xEF42, 0xEF42, 0x2044,
+ 0xEF43, 0xEF43, 0x51A8, 0xEF44, 0xEF44, 0x25CF, 0xEF45, 0xEF45, 0x20F3,
+ 0xEF46, 0xEF4B, 0x51A9, 0xEF4C, 0xEF4C, 0x1F00, 0xEF4D, 0xEF51, 0x51AF,
+ 0xEF52, 0xEF53, 0x24CC, 0xEF54, 0xEF54, 0x51B4, 0xEF55, 0xEF55, 0x2698,
+ 0xEF56, 0xEF56, 0x51B5, 0xEF57, 0xEF57, 0x2678, 0xEF58, 0xEF59, 0x51B6,
+ 0xEF5A, 0xEF5A, 0x24CE, 0xEF5B, 0xEF5F, 0x51B8, 0xEF60, 0xEF60, 0x24CF,
+ 0xEF61, 0xEF67, 0x51BD, 0xEF68, 0xEF68, 0x20B8, 0xEF69, 0xEF69, 0x51C4,
+ 0xEF6A, 0xEF6A, 0x24D0, 0xEF6B, 0xEF6B, 0x51C5, 0xEF6C, 0xEF6C, 0x24D1,
+ 0xEF6D, 0xEF76, 0x51C6, 0xEF77, 0xEF77, 0x1EF4, 0xEF78, 0xEF79, 0x51D0,
+ 0xEF7A, 0xEF7A, 0x239B, 0xEF7B, 0xEF7B, 0x51D2, 0xEF7C, 0xEF7C, 0x267E,
+ 0xEF7D, 0xEF7E, 0x51D3, 0xEF80, 0xEF81, 0x51D5, 0xEF82, 0xEF82, 0x239D,
+ 0xEF83, 0xEF84, 0x239F, 0xEF85, 0xEF85, 0x51D7, 0xEF86, 0xEF86, 0x23A1,
+ 0xEF87, 0xEF87, 0x51D8, 0xEF88, 0xEF88, 0x1EF1, 0xEF89, 0xEF8A, 0x51D9,
+ 0xEF8B, 0xEF8B, 0x221E, 0xEF8C, 0xEF8C, 0x51DB, 0xEF8D, 0xEF8D, 0x23A2,
+ 0xEF8E, 0xEF94, 0x51DC, 0xEF95, 0xEF95, 0x214B, 0xEF96, 0xEF96, 0x1E36,
+ 0xEF97, 0xEF97, 0x2135, 0xEF98, 0xEF9B, 0x51E3, 0xEF9C, 0xEF9C, 0x1FAD,
+ 0xEF9D, 0xEF9D, 0x51E7, 0xEF9E, 0xEF9E, 0x1E53, 0xEF9F, 0xEFA0, 0x51E8,
+ 0xEFA1, 0xEFFE, 0x1AC9, 0xF040, 0xF040, 0x51EA, 0xF041, 0xF041, 0x23A3,
+ 0xF042, 0xF042, 0x2203, 0xF043, 0xF043, 0x51EB, 0xF044, 0xF044, 0x1EE7,
+ 0xF045, 0xF046, 0x51EC, 0xF047, 0xF047, 0x23A4, 0xF048, 0xF048, 0x2097,
+ 0xF049, 0xF049, 0x1EE4, 0xF04A, 0xF04D, 0x51EE, 0xF04E, 0xF04E, 0x2238,
+ 0xF04F, 0xF050, 0x51F2, 0xF051, 0xF051, 0x23A5, 0xF052, 0xF053, 0x51F4,
+ 0xF054, 0xF054, 0x1F9A, 0xF055, 0xF056, 0x51F6, 0xF057, 0xF057, 0x21C3,
+ 0xF058, 0xF05D, 0x51F8, 0xF05E, 0xF05E, 0x1F2E, 0xF05F, 0xF067, 0x51FE,
+ 0xF068, 0xF068, 0x239C, 0xF069, 0xF06B, 0x5207, 0xF06C, 0xF06C, 0x23A6,
+ 0xF06D, 0xF070, 0x520A, 0xF071, 0xF071, 0x239E, 0xF072, 0xF072, 0x520E,
+ 0xF073, 0xF073, 0x2035, 0xF074, 0xF074, 0x23A7, 0xF075, 0xF077, 0x520F,
+ 0xF078, 0xF078, 0x23A8, 0xF079, 0xF079, 0x5212, 0xF07A, 0xF07A, 0x2075,
+ 0xF07B, 0xF07C, 0x5213, 0xF07D, 0xF07E, 0x23A9, 0xF080, 0xF080, 0x23AB,
+ 0xF081, 0xF081, 0x1FEB, 0xF082, 0xF082, 0x23AC, 0xF083, 0xF086, 0x5215,
+ 0xF087, 0xF087, 0x1F6A, 0xF088, 0xF088, 0x20F9, 0xF089, 0xF08A, 0x5219,
+ 0xF08B, 0xF08B, 0x2666, 0xF08C, 0xF08F, 0x521B, 0xF090, 0xF090, 0x2667,
+ 0xF091, 0xF091, 0x521F, 0xF092, 0xF092, 0x1E6C, 0xF093, 0xF095, 0x5220,
+ 0xF096, 0xF096, 0x23AD, 0xF097, 0xF0A0, 0x5223, 0xF0A1, 0xF0FE, 0x1B27,
+ 0xF140, 0xF151, 0x522D, 0xF152, 0xF152, 0x206D, 0xF153, 0xF153, 0x2242,
+ 0xF154, 0xF154, 0x1F02, 0xF155, 0xF156, 0x523F, 0xF157, 0xF157, 0x2183,
+ 0xF158, 0xF158, 0x5241, 0xF159, 0xF159, 0x1E85, 0xF15A, 0xF15A, 0x21E9,
+ 0xF15B, 0xF166, 0x5242, 0xF167, 0xF167, 0x1E57, 0xF168, 0xF175, 0x524E,
+ 0xF176, 0xF176, 0x22A5, 0xF177, 0xF177, 0x2407, 0xF178, 0xF178, 0x1FCA,
+ 0xF179, 0xF179, 0x525C, 0xF17A, 0xF17A, 0x2402, 0xF17B, 0xF17B, 0x1F82,
+ 0xF17C, 0xF17D, 0x525D, 0xF17E, 0xF17E, 0x2408, 0xF180, 0xF180, 0x2404,
+ 0xF181, 0xF181, 0x525F, 0xF182, 0xF182, 0x2131, 0xF183, 0xF183, 0x5260,
+ 0xF184, 0xF184, 0x2184, 0xF185, 0xF185, 0x5261, 0xF186, 0xF186, 0x2403,
+ 0xF187, 0xF187, 0x5262, 0xF188, 0xF188, 0x206E, 0xF189, 0xF189, 0x240B,
+ 0xF18A, 0xF193, 0x5263, 0xF194, 0xF194, 0x1F3F, 0xF195, 0xF197, 0x526D,
+ 0xF198, 0xF198, 0x2067, 0xF199, 0xF1A0, 0x5270, 0xF1A1, 0xF1FE, 0x1B85,
+ 0xF240, 0xF244, 0x5278, 0xF245, 0xF245, 0x1FD7, 0xF246, 0xF246, 0x527D,
+ 0xF247, 0xF247, 0x1E83, 0xF248, 0xF24A, 0x527E, 0xF24B, 0xF24B, 0x240F,
+ 0xF24C, 0xF252, 0x5281, 0xF253, 0xF253, 0x240E, 0xF254, 0xF254, 0x20C7,
+ 0xF255, 0xF255, 0x240D, 0xF256, 0xF25B, 0x5288, 0xF25C, 0xF25C, 0x2412,
+ 0xF25D, 0xF25E, 0x528E, 0xF25F, 0xF25F, 0x20B7, 0xF260, 0xF270, 0x5290,
+ 0xF271, 0xF271, 0x23F0, 0xF272, 0xF272, 0x52A1, 0xF273, 0xF273, 0x2411,
+ 0xF274, 0xF274, 0x2414, 0xF275, 0xF275, 0x52A2, 0xF276, 0xF276, 0x2170,
+ 0xF277, 0xF27B, 0x52A3, 0xF27C, 0xF27C, 0x2405, 0xF27D, 0xF27D, 0x210C,
+ 0xF27E, 0xF27E, 0x2415, 0xF280, 0xF284, 0x52A8, 0xF285, 0xF285, 0x2066,
+ 0xF286, 0xF286, 0x52AD, 0xF287, 0xF287, 0x2352, 0xF288, 0xF288, 0x2413,
+ 0xF289, 0xF289, 0x2410, 0xF28A, 0xF28B, 0x2416, 0xF28C, 0xF28C, 0x20F1,
+ 0xF28D, 0xF290, 0x52AE, 0xF291, 0xF291, 0x240A, 0xF292, 0xF293, 0x52B2,
+ 0xF294, 0xF294, 0x2409, 0xF295, 0xF295, 0x52B4, 0xF296, 0xF296, 0x2418,
+ 0xF297, 0xF29B, 0x52B5, 0xF29C, 0xF29C, 0x1FA7, 0xF29D, 0xF29D, 0x52BA,
+ 0xF29E, 0xF29E, 0x21FC, 0xF29F, 0xF2A0, 0x52BB, 0xF2A1, 0xF2FE, 0x1BE3,
+ 0xF340, 0xF340, 0x1FC1, 0xF341, 0xF341, 0x2406, 0xF342, 0xF344, 0x52BD,
+ 0xF345, 0xF345, 0x229C, 0xF346, 0xF347, 0x52C0, 0xF348, 0xF348, 0x204E,
+ 0xF349, 0xF349, 0x52C2, 0xF34A, 0xF34A, 0x241A, 0xF34B, 0xF34B, 0x2419,
+ 0xF34C, 0xF34F, 0x52C3, 0xF350, 0xF350, 0x240C, 0xF351, 0xF360, 0x52C7,
+ 0xF361, 0xF361, 0x1E29, 0xF362, 0xF373, 0x52D7, 0xF374, 0xF374, 0x2661,
+ 0xF375, 0xF375, 0x52E9, 0xF376, 0xF376, 0x26A4, 0xF377, 0xF377, 0x2174,
+ 0xF378, 0xF378, 0x2663, 0xF379, 0xF379, 0x2662, 0xF37A, 0xF37E, 0x52EA,
+ 0xF380, 0xF38B, 0x52EF, 0xF38C, 0xF38C, 0x2675, 0xF38D, 0xF39F, 0x52FB,
+ 0xF3A0, 0xF3A0, 0x214C, 0xF3A1, 0xF3FE, 0x1C41, 0xF440, 0xF444, 0x530E,
+ 0xF445, 0xF445, 0x267A, 0xF446, 0xF44F, 0x5313, 0xF450, 0xF450, 0x26A0,
+ 0xF451, 0xF456, 0x531D, 0xF457, 0xF457, 0x2668, 0xF458, 0xF458, 0x5323,
+ 0xF459, 0xF459, 0x1ED0, 0xF45A, 0xF45A, 0x5324, 0xF45B, 0xF45B, 0x2096,
+ 0xF45C, 0xF45C, 0x5325, 0xF45D, 0xF45D, 0x23CC, 0xF45E, 0xF461, 0x5326,
+ 0xF462, 0xF462, 0x23C8, 0xF463, 0xF463, 0x532A, 0xF464, 0xF464, 0x223E,
+ 0xF465, 0xF474, 0x532B, 0xF475, 0xF475, 0x2665, 0xF476, 0xF47B, 0x533B,
+ 0xF47C, 0xF47C, 0x2664, 0xF47D, 0xF47D, 0x5341, 0xF47E, 0xF47E, 0x2239,
+ 0xF480, 0xF493, 0x5342, 0xF494, 0xF494, 0x204A, 0xF495, 0xF498, 0x5356,
+ 0xF499, 0xF499, 0x261F, 0xF49A, 0xF49B, 0x535A, 0xF49C, 0xF49C, 0x261E,
+ 0xF49D, 0xF4A0, 0x535C, 0xF4A1, 0xF4FE, 0x1C9F, 0xF540, 0xF544, 0x5360,
+ 0xF545, 0xF545, 0x2620, 0xF546, 0xF546, 0x5365, 0xF547, 0xF547, 0x2621,
+ 0xF548, 0xF551, 0x5366, 0xF552, 0xF552, 0x2622, 0xF553, 0xF553, 0x5370,
+ 0xF554, 0xF554, 0x2627, 0xF555, 0xF555, 0x1E39, 0xF556, 0xF556, 0x2625,
+ 0xF557, 0xF55D, 0x5371, 0xF55E, 0xF55E, 0x2629, 0xF55F, 0xF560, 0x5378,
+ 0xF561, 0xF561, 0x262E, 0xF562, 0xF562, 0x262B, 0xF563, 0xF56D, 0x537A,
+ 0xF56E, 0xF56E, 0x262A, 0xF56F, 0xF56F, 0x262D, 0xF570, 0xF570, 0x5385,
+ 0xF571, 0xF571, 0x2628, 0xF572, 0xF572, 0x21B9, 0xF573, 0xF57E, 0x5386,
+ 0xF580, 0xF584, 0x5392, 0xF585, 0xF585, 0x2636, 0xF586, 0xF586, 0x2630,
+ 0xF587, 0xF58B, 0x5397, 0xF58C, 0xF58C, 0x2638, 0xF58D, 0xF58D, 0x539C,
+ 0xF58E, 0xF58E, 0x200D, 0xF58F, 0xF58F, 0x2637, 0xF590, 0xF598, 0x539D,
+ 0xF599, 0xF599, 0x2645, 0xF59A, 0xF59A, 0x53A6, 0xF59B, 0xF59B, 0x263A,
+ 0xF59C, 0xF59F, 0x53A7, 0xF5A0, 0xF5A0, 0x2643, 0xF5A1, 0xF5FE, 0x1CFD,
+ 0xF640, 0xF640, 0x53AB, 0xF641, 0xF641, 0x2640, 0xF642, 0xF644, 0x53AC,
+ 0xF645, 0xF645, 0x263D, 0xF646, 0xF646, 0x2641, 0xF647, 0xF647, 0x53AF,
+ 0xF648, 0xF648, 0x263E, 0xF649, 0xF64A, 0x53B0, 0xF64B, 0xF64B, 0x263F,
+ 0xF64C, 0xF64C, 0x1FC0, 0xF64D, 0xF64D, 0x53B2, 0xF64E, 0xF64F, 0x263B,
+ 0xF650, 0xF653, 0x53B3, 0xF654, 0xF654, 0x2642, 0xF655, 0xF657, 0x53B7,
+ 0xF658, 0xF658, 0x2644, 0xF659, 0xF660, 0x53BA, 0xF661, 0xF661, 0x2639,
+ 0xF662, 0xF662, 0x53C2, 0xF663, 0xF663, 0x264C, 0xF664, 0xF66B, 0x53C3,
+ 0xF66C, 0xF66C, 0x2647, 0xF66D, 0xF66D, 0x264B, 0xF66E, 0xF670, 0x53CB,
+ 0xF671, 0xF671, 0x2649, 0xF672, 0xF673, 0x53CE, 0xF674, 0xF674, 0x2648,
+ 0xF675, 0xF675, 0x53D0, 0xF676, 0xF676, 0x264A, 0xF677, 0xF677, 0x2108,
+ 0xF678, 0xF67E, 0x53D1, 0xF680, 0xF684, 0x53D8, 0xF685, 0xF685, 0x264D,
+ 0xF686, 0xF687, 0x53DD, 0xF688, 0xF688, 0x2634, 0xF689, 0xF689, 0x53DF,
+ 0xF68A, 0xF68A, 0x2651, 0xF68B, 0xF68C, 0x53E0, 0xF68D, 0xF68D, 0x2650,
+ 0xF68E, 0xF68E, 0x2652, 0xF68F, 0xF691, 0x53E2, 0xF692, 0xF692, 0x264F,
+ 0xF693, 0xF695, 0x53E5, 0xF696, 0xF696, 0x2632, 0xF697, 0xF697, 0x264E,
+ 0xF698, 0xF698, 0x2653, 0xF699, 0xF699, 0x53E8, 0xF69A, 0xF69A, 0x2657,
+ 0xF69B, 0xF69B, 0x53E9, 0xF69C, 0xF69C, 0x2635, 0xF69D, 0xF69D, 0x53EA,
+ 0xF69E, 0xF69E, 0x2633, 0xF69F, 0xF69F, 0x53EB, 0xF6A0, 0xF6A0, 0x2656,
+ 0xF6A1, 0xF6FE, 0x1D5B, 0xF740, 0xF741, 0x53EC, 0xF742, 0xF742, 0x2654,
+ 0xF743, 0xF748, 0x53EE, 0xF749, 0xF749, 0x2658, 0xF74A, 0xF74B, 0x53F4,
+ 0xF74C, 0xF74C, 0x2655, 0xF74D, 0xF74D, 0x1E4D, 0xF74E, 0xF755, 0x53F6,
+ 0xF756, 0xF756, 0x265B, 0xF757, 0xF757, 0x53FE, 0xF758, 0xF758, 0x265A,
+ 0xF759, 0xF759, 0x53FF, 0xF75A, 0xF75A, 0x2659, 0xF75B, 0xF75B, 0x202E,
+ 0xF75C, 0xF75C, 0x262F, 0xF75D, 0xF760, 0x5400, 0xF761, 0xF761, 0x2646,
+ 0xF762, 0xF762, 0x5404, 0xF763, 0xF763, 0x2626, 0xF764, 0xF76A, 0x5405,
+ 0xF76B, 0xF76B, 0x265C, 0xF76C, 0xF770, 0x540C, 0xF771, 0xF771, 0x262C,
+ 0xF772, 0xF77B, 0x5411, 0xF77C, 0xF77C, 0x2623, 0xF77D, 0xF77D, 0x541B,
+ 0xF77E, 0xF77E, 0x2631, 0xF780, 0xF7A0, 0x541C, 0xF7A1, 0xF7FE, 0x1DB9,
+ 0xF840, 0xF841, 0x543D, 0xF842, 0xF842, 0x209C, 0xF843, 0xF845, 0x543F,
+ 0xF846, 0xF846, 0x2580, 0xF847, 0xF848, 0x5442, 0xF849, 0xF849, 0x22DC,
+ 0xF84A, 0xF84F, 0x5444, 0xF850, 0xF850, 0x1F05, 0xF851, 0xF851, 0x208B,
+ 0xF852, 0xF852, 0x544A, 0xF853, 0xF853, 0x2581, 0xF854, 0xF862, 0x544B,
+ 0xF863, 0xF863, 0x2583, 0xF864, 0xF864, 0x2582, 0xF865, 0xF865, 0x545A,
+ 0xF866, 0xF866, 0x21EE, 0xF867, 0xF871, 0x545B, 0xF872, 0xF872, 0x2182,
+ 0xF873, 0xF877, 0x5466, 0xF878, 0xF878, 0x2243, 0xF879, 0xF879, 0x546B,
+ 0xF87A, 0xF87A, 0x2587, 0xF87B, 0xF87B, 0x546C, 0xF87C, 0xF87C, 0x2588,
+ 0xF87D, 0xF87E, 0x546D, 0xF880, 0xF880, 0x546F, 0xF881, 0xF881, 0x2584,
+ 0xF882, 0xF883, 0x5470, 0xF884, 0xF884, 0x21FD, 0xF885, 0xF885, 0x5472,
+ 0xF886, 0xF886, 0x21EF, 0xF887, 0xF88C, 0x5473, 0xF88D, 0xF88D, 0x258A,
+ 0xF88E, 0xF88E, 0x258C, 0xF88F, 0xF898, 0x5479, 0xF899, 0xF899, 0x1F47,
+ 0xF89A, 0xF89C, 0x5483, 0xF89D, 0xF89D, 0x1F1D, 0xF89E, 0xF89F, 0x5486,
+ 0xF8A0, 0xF8A0, 0x258D, 0xF940, 0xF94D, 0x5488, 0xF94E, 0xF94E, 0x1FD0,
+ 0xF94F, 0xF94F, 0x2592, 0xF950, 0xF950, 0x258F, 0xF951, 0xF958, 0x5496,
+ 0xF959, 0xF959, 0x2594, 0xF95A, 0xF95A, 0x1EE0, 0xF95B, 0xF95C, 0x549E,
+ 0xF95D, 0xF95D, 0x2591, 0xF95E, 0xF95E, 0x2595, 0xF95F, 0xF966, 0x54A0,
+ 0xF967, 0xF967, 0x2597, 0xF968, 0xF968, 0x54A8, 0xF969, 0xF969, 0x20B6,
+ 0xF96A, 0xF96B, 0x54A9, 0xF96C, 0xF96C, 0x2598, 0xF96D, 0xF96E, 0x54AB,
+ 0xF96F, 0xF96F, 0x20F6, 0xF970, 0xF97E, 0x54AD, 0xF980, 0xF984, 0x54BC,
+ 0xF985, 0xF985, 0x2585, 0xF986, 0xF986, 0x54C1, 0xF987, 0xF987, 0x2599,
+ 0xF988, 0xF990, 0x54C2, 0xF991, 0xF991, 0x2596, 0xF992, 0xF995, 0x54CB,
+ 0xF996, 0xF996, 0x259A, 0xF997, 0xF997, 0x54CF, 0xF998, 0xF998, 0x259B,
+ 0xF999, 0xF9A0, 0x54D0, 0xFA40, 0xFA41, 0x54D8, 0xFA42, 0xFA42, 0x259D,
+ 0xFA43, 0xFA45, 0x54DA, 0xFA46, 0xFA46, 0x259E, 0xFA47, 0xFA4B, 0x54DD,
+ 0xFA4C, 0xFA4C, 0x234C, 0xFA4D, 0xFA50, 0x54E2, 0xFA51, 0xFA51, 0x1F44,
+ 0xFA52, 0xFA57, 0x54E6, 0xFA58, 0xFA58, 0x2660, 0xFA59, 0xFA59, 0x25A0,
+ 0xFA5A, 0xFA5C, 0x54EC, 0xFA5D, 0xFA5D, 0x259C, 0xFA5E, 0xFA5E, 0x54EF,
+ 0xFA5F, 0xFA5F, 0x259F, 0xFA60, 0xFA60, 0x54F0, 0xFA61, 0xFA61, 0x1F6C,
+ 0xFA62, 0xFA6F, 0x54F1, 0xFA70, 0xFA70, 0x25A2, 0xFA71, 0xFA73, 0x54FF,
+ 0xFA74, 0xFA74, 0x20AE, 0xFA75, 0xFA75, 0x5502, 0xFA76, 0xFA76, 0x258B,
+ 0xFA77, 0xFA77, 0x25A3, 0xFA78, 0xFA7E, 0x5503, 0xFA80, 0xFA82, 0x550A,
+ 0xFA83, 0xFA83, 0x2589, 0xFA84, 0xFA84, 0x25A5, 0xFA85, 0xFA8C, 0x550D,
+ 0xFA8D, 0xFA8D, 0x25A4, 0xFA8E, 0xFA8F, 0x5515, 0xFA90, 0xFA90, 0x25A6,
+ 0xFA91, 0xFA91, 0x2593, 0xFA92, 0xFA95, 0x5517, 0xFA96, 0xFA96, 0x25A7,
+ 0xFA97, 0xFA97, 0x2222, 0xFA98, 0xFA98, 0x25A9, 0xFA99, 0xFAA0, 0x551B,
+ 0xFB40, 0xFB48, 0x5523, 0xFB49, 0xFB49, 0x25A8, 0xFB4A, 0xFB51, 0x552C,
+ 0xFB52, 0xFB52, 0x2586, 0xFB53, 0xFB56, 0x5534, 0xFB57, 0xFB57, 0x25A1,
+ 0xFB58, 0xFB58, 0x25AA, 0xFB59, 0xFB59, 0x5538, 0xFB5A, 0xFB5A, 0x2590,
+ 0xFB5B, 0xFB5B, 0x258E, 0xFB5C, 0xFB74, 0x5539, 0xFB75, 0xFB75, 0x2688,
+ 0xFB76, 0xFB78, 0x5552, 0xFB79, 0xFB79, 0x269E, 0xFB7A, 0xFB7A, 0x25FB,
+ 0xFB7B, 0xFB7B, 0x5555, 0xFB7C, 0xFB7C, 0x1F8C, 0xFB7D, 0xFB7D, 0x21F4,
+ 0xFB7E, 0xFB7E, 0x5556, 0xFB80, 0xFB8F, 0x5557, 0xFB90, 0xFB90, 0x200F,
+ 0xFB91, 0xFB9B, 0x5567, 0xFB9C, 0xFB9C, 0x2071, 0xFB9D, 0xFB9E, 0x5572,
+ 0xFB9F, 0xFB9F, 0x25F7, 0xFBA0, 0xFBA0, 0x5574, 0xFC40, 0xFC43, 0x5575,
+ 0xFC44, 0xFC44, 0x2696, 0xFC45, 0xFC48, 0x5579, 0xFC49, 0xFC49, 0x268F,
+ 0xFC4A, 0xFC59, 0x557D, 0xFC5A, 0xFC5A, 0x22DA, 0xFC5B, 0xFC62, 0x558D,
+ 0xFC63, 0xFC63, 0x1EC1, 0xFC64, 0xFC67, 0x5595, 0xFC68, 0xFC68, 0x1EB3,
+ 0xFC69, 0xFC6E, 0x5599, 0xFC6F, 0xFC6F, 0x266A, 0xFC70, 0xFC70, 0x559F,
+ 0xFC71, 0xFC71, 0x268A, 0xFC72, 0xFC73, 0x55A0, 0xFC74, 0xFC74, 0x2669,
+ 0xFC75, 0xFC76, 0x55A2, 0xFC77, 0xFC78, 0x2618, 0xFC79, 0xFC7E, 0x55A4,
+ 0xFC80, 0xFC82, 0x55AA, 0xFC83, 0xFC83, 0x261A, 0xFC84, 0xFC89, 0x55AD,
+ 0xFC8A, 0xFC8A, 0x2673, 0xFC8B, 0xFCA0, 0x55B3, 0xFD40, 0xFD51, 0x55C9,
+ 0xFD52, 0xFD52, 0x20C6, 0xFD53, 0xFD53, 0x226B, 0xFD54, 0xFD56, 0x55DB,
+ 0xFD57, 0xFD57, 0x24D3, 0xFD58, 0xFD58, 0x1E86, 0xFD59, 0xFD59, 0x55DE,
+ 0xFD5A, 0xFD5A, 0x260F, 0xFD5B, 0xFD5E, 0x55DF, 0xFD5F, 0xFD5F, 0x2611,
+ 0xFD60, 0xFD61, 0x55E3, 0xFD62, 0xFD62, 0x2613, 0xFD63, 0xFD64, 0x55E5,
+ 0xFD65, 0xFD65, 0x2610, 0xFD66, 0xFD66, 0x2612, 0xFD67, 0xFD67, 0x2030,
+ 0xFD68, 0xFD68, 0x55E7, 0xFD69, 0xFD69, 0x2671, 0xFD6A, 0xFD6B, 0x55E8,
+ 0xFD6C, 0xFD6C, 0x2614, 0xFD6D, 0xFD6F, 0x55EA, 0xFD70, 0xFD70, 0x2616,
+ 0xFD71, 0xFD71, 0x55ED, 0xFD72, 0xFD72, 0x2615, 0xFD73, 0xFD77, 0x55EE,
+ 0xFD78, 0xFD78, 0x20F2, 0xFD79, 0xFD7C, 0x55F3, 0xFD7D, 0xFD7D, 0x2617,
+ 0xFD7E, 0xFD7E, 0x55F7, 0xFD80, 0xFD87, 0x55F8, 0xFD88, 0xFD88, 0x2037,
+ 0xFD89, 0xFD8A, 0x5600, 0xFD8B, 0xFD8B, 0x20B3, 0xFD8C, 0xFD8E, 0x5602,
+ 0xFD8F, 0xFD8F, 0x1F22, 0xFD90, 0xFD90, 0x24ED, 0xFD91, 0xFD93, 0x5605,
+ 0xFD94, 0xFD94, 0x1F34, 0xFD95, 0xFD9C, 0x5608, 0xFD9D, 0xFD9D, 0x0A02,
+ 0xFD9E, 0xFD9E, 0x40D3, 0xFD9F, 0xFD9F, 0x200C, 0xFDA0, 0xFDA0, 0x5083,
+ 0xFE40, 0xFE40, 0x1259, 0xFE41, 0xFE7E, 0x5610, 0xFE80, 0xFEA0, 0x564E,
+};
diff --git a/core/src/fpdfapi/fpdf_cmaps/GB1/GBKp-EUC-H_2.cpp b/core/src/fpdfapi/fpdf_cmaps/GB1/GBKp-EUC-H_2.cpp
index ebb16594da..226c950240 100644
--- a/core/src/fpdfapi/fpdf_cmaps/GB1/GBKp-EUC-H_2.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/GB1/GBKp-EUC-H_2.cpp
@@ -1,1365 +1,1365 @@
-// 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
-
-extern const unsigned short g_FXCMAP_GBKp_EUC_H_2[4070 * 3] = {
- 0x0020, 0x007E, 0x0001, 0x8140, 0x8178, 0x2758, 0x8179, 0x8179, 0x2059,
- 0x817A, 0x817E, 0x2791, 0x8180, 0x8185, 0x2796, 0x8186, 0x8186, 0x21F1,
- 0x8187, 0x81EC, 0x279C, 0x81ED, 0x81ED, 0x1FF2, 0x81EE, 0x81F5, 0x2802,
- 0x81F6, 0x81F6, 0x205D, 0x81F7, 0x81FE, 0x280A, 0x8240, 0x8252, 0x2812,
- 0x8253, 0x8253, 0x269C, 0x8254, 0x8261, 0x2825, 0x8262, 0x8262, 0x21B5,
- 0x8263, 0x8273, 0x2833, 0x8274, 0x8274, 0x22CC, 0x8275, 0x8279, 0x2844,
- 0x827A, 0x827A, 0x2016, 0x827B, 0x827C, 0x2849, 0x827D, 0x827D, 0x1E62,
- 0x827E, 0x827E, 0x284B, 0x8280, 0x8280, 0x1F20, 0x8281, 0x8282, 0x284C,
- 0x8283, 0x8283, 0x207F, 0x8284, 0x828F, 0x284E, 0x8290, 0x8290, 0x205C,
- 0x8291, 0x82A4, 0x285A, 0x82A5, 0x82A5, 0x2194, 0x82A6, 0x82C7, 0x286E,
- 0x82C8, 0x82C8, 0x1E65, 0x82C9, 0x82C9, 0x2281, 0x82CA, 0x82E0, 0x2890,
- 0x82E1, 0x82E1, 0x22CD, 0x82E2, 0x82E2, 0x28A7, 0x82E3, 0x82E3, 0x210A,
- 0x82E4, 0x82E4, 0x1E3E, 0x82E5, 0x82EC, 0x28A8, 0x82ED, 0x82ED, 0x267F,
- 0x82EE, 0x82F1, 0x28B0, 0x82F2, 0x82F2, 0x222E, 0x82F3, 0x82F6, 0x28B4,
- 0x82F7, 0x82F7, 0x1E96, 0x82F8, 0x82F8, 0x22CB, 0x82F9, 0x82F9, 0x226C,
- 0x82FA, 0x82FA, 0x28B8, 0x82FB, 0x82FB, 0x2117, 0x82FC, 0x82FE, 0x28B9,
- 0x8340, 0x8340, 0x28BC, 0x8341, 0x8341, 0x20E8, 0x8342, 0x8344, 0x28BD,
- 0x8345, 0x8345, 0x22D4, 0x8346, 0x8347, 0x28C0, 0x8348, 0x8348, 0x1FB9,
- 0x8349, 0x834B, 0x28C2, 0x834C, 0x834C, 0x22D8, 0x834D, 0x8352, 0x28C5,
- 0x8353, 0x8353, 0x20DF, 0x8354, 0x8356, 0x28CB, 0x8357, 0x8357, 0x20C2,
- 0x8358, 0x835D, 0x28CE, 0x835E, 0x835E, 0x2195, 0x835F, 0x8364, 0x28D4,
- 0x8365, 0x8365, 0x1FAC, 0x8366, 0x8366, 0x22D3, 0x8367, 0x8371, 0x28DA,
- 0x8372, 0x8372, 0x1F81, 0x8373, 0x8377, 0x28E5, 0x8378, 0x8378, 0x2210,
- 0x8379, 0x8379, 0x28EA, 0x837A, 0x837A, 0x22CF, 0x837B, 0x837B, 0x28EB,
- 0x837C, 0x837C, 0x2213, 0x837D, 0x837D, 0x28EC, 0x837E, 0x837E, 0x1FE4,
- 0x8380, 0x8380, 0x1F90, 0x8381, 0x8385, 0x28ED, 0x8386, 0x8386, 0x22D6,
- 0x8387, 0x8388, 0x28F2, 0x8389, 0x8389, 0x22D0, 0x838A, 0x838A, 0x22CE,
- 0x838B, 0x838C, 0x28F4, 0x838D, 0x838D, 0x2681, 0x838E, 0x8393, 0x28F6,
- 0x8394, 0x8394, 0x1E76, 0x8395, 0x839D, 0x28FC, 0x839E, 0x839E, 0x2231,
- 0x839F, 0x83A5, 0x2905, 0x83A6, 0x83A6, 0x1E93, 0x83A7, 0x83AA, 0x290C,
- 0x83AB, 0x83AB, 0x22D2, 0x83AC, 0x83AD, 0x2910, 0x83AE, 0x83AE, 0x22D7,
- 0x83AF, 0x83AF, 0x22D5, 0x83B0, 0x83B0, 0x22D1, 0x83B1, 0x83B9, 0x2912,
- 0x83BA, 0x83BA, 0x1EE5, 0x83BB, 0x83C8, 0x291B, 0x83C9, 0x83C9, 0x2025,
- 0x83CA, 0x83F5, 0x2929, 0x83F6, 0x83F6, 0x1ECF, 0x83F7, 0x83FE, 0x2955,
- 0x8440, 0x844F, 0x295D, 0x8450, 0x8450, 0x1FD9, 0x8451, 0x8470, 0x296D,
- 0x8471, 0x8471, 0x22C8, 0x8472, 0x8473, 0x298D, 0x8474, 0x8474, 0x2263,
- 0x8475, 0x8476, 0x298F, 0x8477, 0x8477, 0x2683, 0x8478, 0x847E, 0x2991,
- 0x8480, 0x8481, 0x2998, 0x8482, 0x8482, 0x1F17, 0x8483, 0x848D, 0x299A,
- 0x848E, 0x848E, 0x1F2B, 0x848F, 0x8491, 0x29A5, 0x8492, 0x8492, 0x22CA,
- 0x8493, 0x8493, 0x1E99, 0x8494, 0x849C, 0x29A8, 0x849D, 0x849D, 0x1F4F,
- 0x849E, 0x84A0, 0x29B1, 0x84A1, 0x84A1, 0x1FCF, 0x84A2, 0x84A2, 0x2036,
- 0x84A3, 0x84A3, 0x1F3A, 0x84A4, 0x84A4, 0x29B4, 0x84A5, 0x84A5, 0x22C9,
- 0x84A6, 0x84A6, 0x1F99, 0x84A7, 0x84A8, 0x29B5, 0x84A9, 0x84A9, 0x1F75,
- 0x84AA, 0x84C4, 0x29B7, 0x84C5, 0x84C5, 0x1FBE, 0x84C6, 0x84D2, 0x29D2,
- 0x84D3, 0x84D3, 0x1ECD, 0x84D4, 0x84D4, 0x29DF, 0x84D5, 0x84D5, 0x21A9,
- 0x84D6, 0x84D6, 0x29E0, 0x84D7, 0x84D7, 0x21E6, 0x84D8, 0x84D8, 0x29E1,
- 0x84D9, 0x84D9, 0x2127, 0x84DA, 0x84DA, 0x2003, 0x84DB, 0x84DC, 0x29E2,
- 0x84DD, 0x84DD, 0x2132, 0x84DE, 0x84E9, 0x29E4, 0x84EA, 0x84EA, 0x2323,
- 0x84EB, 0x84ED, 0x29F0, 0x84EE, 0x84EE, 0x2011, 0x84EF, 0x84F0, 0x29F3,
- 0x84F1, 0x84F1, 0x20F5, 0x84F2, 0x84FE, 0x29F5, 0x8540, 0x8550, 0x2A02,
- 0x8551, 0x8551, 0x22C5, 0x8552, 0x8552, 0x1F5E, 0x8553, 0x8553, 0x2A13,
- 0x8554, 0x8554, 0x22C6, 0x8555, 0x855D, 0x2A14, 0x855E, 0x855E, 0x20EF,
- 0x855F, 0x8565, 0x2A1D, 0x8566, 0x8566, 0x21D0, 0x8567, 0x857E, 0x2A24,
- 0x8580, 0x8586, 0x2A3C, 0x8587, 0x8587, 0x22C1, 0x8588, 0x858A, 0x2A43,
- 0x858B, 0x858B, 0x1E64, 0x858C, 0x8591, 0x2A46, 0x8592, 0x8592, 0x21F9,
- 0x8593, 0x8595, 0x2A4C, 0x8596, 0x8596, 0x2010, 0x8597, 0x8597, 0x2A4F,
- 0x8598, 0x8598, 0x22C2, 0x8599, 0x85A1, 0x2A50, 0x85A2, 0x85A2, 0x1E5A,
- 0x85A3, 0x85B1, 0x2A59, 0x85B2, 0x85B2, 0x1EA2, 0x85B3, 0x85FE, 0x2A68,
- 0x8640, 0x8649, 0x2AB4, 0x864A, 0x864A, 0x236D, 0x864B, 0x8653, 0x2ABE,
- 0x8654, 0x8654, 0x2247, 0x8655, 0x8667, 0x2AC7, 0x8668, 0x8668, 0x236C,
- 0x8669, 0x867E, 0x2ADA, 0x8680, 0x8695, 0x2AF0, 0x8696, 0x8696, 0x219C,
- 0x8697, 0x8698, 0x2B06, 0x8699, 0x8699, 0x20C9, 0x869A, 0x86A0, 0x2B08,
- 0x86A1, 0x86A1, 0x21F0, 0x86A2, 0x86C9, 0x2B0F, 0x86CA, 0x86CA, 0x210B,
- 0x86CB, 0x86CB, 0x2B37, 0x86CC, 0x86CC, 0x20DE, 0x86CD, 0x86CD, 0x2B38,
- 0x86CE, 0x86CE, 0x1EAA, 0x86CF, 0x86D0, 0x2B39, 0x86D1, 0x86D1, 0x222C,
- 0x86D2, 0x86DB, 0x2B3B, 0x86DC, 0x86DC, 0x20D8, 0x86DD, 0x86DD, 0x22C0,
- 0x86DE, 0x86E0, 0x2B45, 0x86E1, 0x86E1, 0x206F, 0x86E2, 0x86E7, 0x2B48,
- 0x86E8, 0x86E8, 0x21A1, 0x86E9, 0x86ED, 0x2B4E, 0x86EE, 0x86EE, 0x2379,
- 0x86EF, 0x86F3, 0x2B53, 0x86F4, 0x86F4, 0x2372, 0x86F5, 0x86FE, 0x2B58,
- 0x8740, 0x8740, 0x216A, 0x8741, 0x8743, 0x2B62, 0x8744, 0x8744, 0x237C,
- 0x8745, 0x8748, 0x2B65, 0x8749, 0x8749, 0x20B0, 0x874A, 0x874A, 0x2B69,
- 0x874B, 0x874B, 0x237A, 0x874C, 0x874C, 0x1E74, 0x874D, 0x874E, 0x2B6A,
- 0x874F, 0x874F, 0x2377, 0x8750, 0x8756, 0x2B6C, 0x8757, 0x8757, 0x1F4C,
- 0x8758, 0x8759, 0x2B73, 0x875A, 0x875A, 0x2378, 0x875B, 0x875B, 0x21CF,
- 0x875C, 0x875C, 0x2368, 0x875D, 0x875D, 0x2B75, 0x875E, 0x875E, 0x2371,
- 0x875F, 0x875F, 0x2B76, 0x8760, 0x8760, 0x2369, 0x8761, 0x8765, 0x2B77,
- 0x8766, 0x8766, 0x2674, 0x8767, 0x8779, 0x2B7C, 0x877A, 0x877A, 0x236F,
- 0x877B, 0x877C, 0x2B8F, 0x877D, 0x877D, 0x2370, 0x877E, 0x877E, 0x2B91,
- 0x8780, 0x8780, 0x2B92, 0x8781, 0x8781, 0x2376, 0x8782, 0x8782, 0x2373,
- 0x8783, 0x8785, 0x2B93, 0x8786, 0x8786, 0x237F, 0x8787, 0x8787, 0x2B96,
- 0x8788, 0x8788, 0x2374, 0x8789, 0x8789, 0x2B97, 0x878A, 0x878A, 0x20B5,
- 0x878B, 0x878C, 0x2B98, 0x878D, 0x878D, 0x1EDB, 0x878E, 0x878E, 0x2672,
- 0x878F, 0x8792, 0x2B9A, 0x8793, 0x8793, 0x236E, 0x8794, 0x8797, 0x2B9E,
- 0x8798, 0x8798, 0x21B7, 0x8799, 0x879C, 0x2BA2, 0x879D, 0x879D, 0x2375,
- 0x879E, 0x87A2, 0x2BA6, 0x87A3, 0x87A3, 0x2382, 0x87A4, 0x87A6, 0x2BAB,
- 0x87A7, 0x87A7, 0x209E, 0x87A8, 0x87B2, 0x2BAE, 0x87B3, 0x87B3, 0x236B,
- 0x87B4, 0x87B4, 0x2BB9, 0x87B5, 0x87B5, 0x2039, 0x87B6, 0x87BA, 0x2BBA,
- 0x87BB, 0x87BB, 0x269F, 0x87BC, 0x87BE, 0x2BBF, 0x87BF, 0x87BF, 0x237D,
- 0x87C0, 0x87C0, 0x21F5, 0x87C1, 0x87C1, 0x2BC2, 0x87C2, 0x87C2, 0x2381,
- 0x87C3, 0x87C9, 0x2BC3, 0x87CA, 0x87CA, 0x237B, 0x87CB, 0x87CB, 0x237E,
- 0x87CC, 0x87CC, 0x21CC, 0x87CD, 0x87CE, 0x2BCA, 0x87CF, 0x87CF, 0x22DB,
- 0x87D0, 0x87D1, 0x2BCC, 0x87D2, 0x87D2, 0x236A, 0x87D3, 0x87D3, 0x2689,
- 0x87D4, 0x87D4, 0x2BCE, 0x87D5, 0x87D5, 0x2697, 0x87D6, 0x87D9, 0x2BCF,
- 0x87DA, 0x87DA, 0x22A1, 0x87DB, 0x87F6, 0x2BD3, 0x87F7, 0x87F7, 0x2383,
- 0x87F8, 0x87F8, 0x1F3D, 0x87F9, 0x87F9, 0x2BEF, 0x87FA, 0x87FA, 0x218F,
- 0x87FB, 0x87FE, 0x2BF0, 0x8840, 0x8840, 0x2246, 0x8841, 0x8841, 0x2248,
- 0x8842, 0x8843, 0x2BF4, 0x8844, 0x8844, 0x217E, 0x8845, 0x8845, 0x2BF6,
- 0x8846, 0x8846, 0x2180, 0x8847, 0x887E, 0x2BF7, 0x8880, 0x88B9, 0x2C2F,
- 0x88BA, 0x88BA, 0x232A, 0x88BB, 0x88CB, 0x2C69, 0x88CC, 0x88CC, 0x228B,
- 0x88CD, 0x88D3, 0x2C7A, 0x88D4, 0x88D4, 0x1F85, 0x88D5, 0x88D6, 0x2C81,
- 0x88D7, 0x88D7, 0x2325, 0x88D8, 0x88DE, 0x2C83, 0x88DF, 0x88DF, 0x232C,
- 0x88E0, 0x88E4, 0x2C8A, 0x88E5, 0x88E5, 0x232E, 0x88E6, 0x88F1, 0x2C8F,
- 0x88F2, 0x88F2, 0x2205, 0x88F3, 0x88F3, 0x1E38, 0x88F4, 0x88F5, 0x2C9B,
- 0x88F6, 0x88F6, 0x1E73, 0x88F7, 0x88FE, 0x2C9D, 0x8940, 0x894A, 0x2CA5,
- 0x894B, 0x894B, 0x1FE3, 0x894C, 0x894C, 0x2339, 0x894D, 0x894D, 0x2CB0,
- 0x894E, 0x894E, 0x232B, 0x894F, 0x894F, 0x2CB1, 0x8950, 0x8950, 0x232D,
- 0x8951, 0x8953, 0x2CB2, 0x8954, 0x8954, 0x217F, 0x8955, 0x895C, 0x2CB5,
- 0x895D, 0x895D, 0x21A7, 0x895E, 0x895E, 0x2CBD, 0x895F, 0x895F, 0x232F,
- 0x8960, 0x896C, 0x2CBE, 0x896D, 0x896D, 0x1E7D, 0x896E, 0x8970, 0x2CCB,
- 0x8971, 0x8971, 0x20D6, 0x8972, 0x897B, 0x2CCE, 0x897C, 0x897C, 0x1EC2,
- 0x897D, 0x897E, 0x2CD8, 0x8980, 0x898A, 0x2CDA, 0x898B, 0x898B, 0x22B2,
- 0x898C, 0x8998, 0x2CE5, 0x8999, 0x8999, 0x1EDF, 0x899A, 0x899D, 0x2CF2,
- 0x899E, 0x899E, 0x1EF9, 0x899F, 0x89A5, 0x2CF6, 0x89A6, 0x89A6, 0x20D9,
- 0x89A7, 0x89A7, 0x2CFD, 0x89A8, 0x89A8, 0x1FDD, 0x89A9, 0x89AE, 0x2CFE,
- 0x89AF, 0x89AF, 0x2167, 0x89B0, 0x89B9, 0x2D04, 0x89BA, 0x89BA, 0x21ED,
- 0x89BB, 0x89BD, 0x2D0E, 0x89BE, 0x89BE, 0x2007, 0x89BF, 0x89BF, 0x2326,
- 0x89C0, 0x89C0, 0x2329, 0x89C1, 0x89C3, 0x2D11, 0x89C4, 0x89C4, 0x1F52,
- 0x89C5, 0x89C5, 0x203B, 0x89C6, 0x89C6, 0x2328, 0x89C7, 0x89C7, 0x2D14,
- 0x89C8, 0x89C8, 0x2327, 0x89C9, 0x89CD, 0x2D15, 0x89CE, 0x89CE, 0x1E2B,
- 0x89CF, 0x89D0, 0x2D1A, 0x89D1, 0x89D1, 0x22AE, 0x89D2, 0x89D7, 0x2D1C,
- 0x89D8, 0x89D8, 0x1F49, 0x89D9, 0x89DA, 0x2D22, 0x89DB, 0x89DB, 0x2138,
- 0x89DC, 0x89F3, 0x2D24, 0x89F4, 0x89F4, 0x2081, 0x89F5, 0x89FE, 0x2D3C,
- 0x8A40, 0x8A40, 0x2D46, 0x8A41, 0x8A41, 0x1F7C, 0x8A42, 0x8A58, 0x2D47,
- 0x8A59, 0x8A59, 0x235B, 0x8A5A, 0x8A5A, 0x1EDE, 0x8A5B, 0x8A5B, 0x2D5E,
- 0x8A5C, 0x8A5C, 0x1FA2, 0x8A5D, 0x8A5D, 0x2D5F, 0x8A5E, 0x8A5E, 0x1EFA,
- 0x8A5F, 0x8A78, 0x2D60, 0x8A79, 0x8A79, 0x22AD, 0x8A7A, 0x8A7E, 0x2D7A,
- 0x8A80, 0x8AE3, 0x2D7F, 0x8AE4, 0x8AE4, 0x203F, 0x8AE5, 0x8AFE, 0x2DE3,
- 0x8B40, 0x8B43, 0x2DFD, 0x8B44, 0x8B44, 0x1F0E, 0x8B45, 0x8B48, 0x2E01,
- 0x8B49, 0x8B49, 0x23F9, 0x8B4A, 0x8B79, 0x2E05, 0x8B7A, 0x8B7A, 0x23FC,
- 0x8B7B, 0x8B7E, 0x2E35, 0x8B80, 0x8B8B, 0x2E39, 0x8B8C, 0x8B8C, 0x2069,
- 0x8B8D, 0x8B9D, 0x2E45, 0x8B9E, 0x8B9E, 0x23F7, 0x8B9F, 0x8BB2, 0x2E56,
- 0x8BB3, 0x8BB3, 0x23F6, 0x8BB4, 0x8BB8, 0x2E6A, 0x8BB9, 0x8BB9, 0x23FD,
- 0x8BBA, 0x8BBD, 0x2E6F, 0x8BBE, 0x8BBE, 0x23F8, 0x8BBF, 0x8BC5, 0x2E73,
- 0x8BC6, 0x8BC6, 0x23FA, 0x8BC7, 0x8BC7, 0x2E7A, 0x8BC8, 0x8BC8, 0x23FE,
- 0x8BC9, 0x8BC9, 0x1FA8, 0x8BCA, 0x8BD3, 0x2E7B, 0x8BD4, 0x8BD4, 0x2401,
- 0x8BD5, 0x8BDB, 0x2E85, 0x8BDC, 0x8BDC, 0x23FF, 0x8BDD, 0x8BE4, 0x2E8C,
- 0x8BE5, 0x8BE5, 0x2400, 0x8BE6, 0x8BEA, 0x2E94, 0x8BEB, 0x8BEB, 0x2221,
- 0x8BEC, 0x8BEF, 0x2E99, 0x8BF0, 0x8BF0, 0x2122, 0x8BF1, 0x8BFE, 0x2E9D,
- 0x8C40, 0x8C43, 0x2EAB, 0x8C44, 0x8C44, 0x23FB, 0x8C45, 0x8C4E, 0x2EAF,
- 0x8C4F, 0x8C4F, 0x215A, 0x8C50, 0x8C56, 0x2EB9, 0x8C57, 0x8C57, 0x21E5,
- 0x8C58, 0x8C5B, 0x2EC0, 0x8C5C, 0x8C5C, 0x2057, 0x8C5D, 0x8C7E, 0x2EC4,
- 0x8C80, 0x8C8A, 0x2EE6, 0x8C8B, 0x8C8B, 0x20E5, 0x8C8C, 0x8C8C, 0x2EF1,
- 0x8C8D, 0x8C8D, 0x212F, 0x8C8E, 0x8C8E, 0x20A3, 0x8C8F, 0x8C8F, 0x2121,
- 0x8C90, 0x8C90, 0x2EF2, 0x8C91, 0x8C91, 0x21D4, 0x8C92, 0x8C92, 0x1FE5,
- 0x8C93, 0x8C98, 0x2EF3, 0x8C99, 0x8C99, 0x1E8A, 0x8C9A, 0x8C9A, 0x1E37,
- 0x8C9B, 0x8CA1, 0x2EF9, 0x8CA2, 0x8CA2, 0x1F9E, 0x8CA3, 0x8CA3, 0x22A6,
- 0x8CA4, 0x8CA4, 0x21E8, 0x8CA5, 0x8CA5, 0x2F00, 0x8CA6, 0x8CA6, 0x1EDA,
- 0x8CA7, 0x8CA7, 0x1EB9, 0x8CA8, 0x8CBF, 0x2F01, 0x8CC0, 0x8CC0, 0x235C,
- 0x8CC1, 0x8CD1, 0x2F19, 0x8CD2, 0x8CD2, 0x2050, 0x8CD3, 0x8CD3, 0x1E67,
- 0x8CD4, 0x8CD4, 0x2F2A, 0x8CD5, 0x8CD5, 0x23F4, 0x8CD6, 0x8CD8, 0x2F2B,
- 0x8CD9, 0x8CD9, 0x213E, 0x8CDA, 0x8CF8, 0x2F2E, 0x8CF9, 0x8CF9, 0x1F16,
- 0x8CFA, 0x8CFE, 0x2F4D, 0x8D40, 0x8D72, 0x2F52, 0x8D73, 0x8D73, 0x2389,
- 0x8D74, 0x8D74, 0x2F85, 0x8D75, 0x8D75, 0x1EB7, 0x8D76, 0x8D7A, 0x2F86,
- 0x8D7B, 0x8D7B, 0x21B4, 0x8D7C, 0x8D7E, 0x2F8B, 0x8D80, 0x8D87, 0x2F8E,
- 0x8D88, 0x8D88, 0x238F, 0x8D89, 0x8D8E, 0x2F96, 0x8D8F, 0x8D8F, 0x1F1A,
- 0x8D90, 0x8D9D, 0x2F9C, 0x8D9E, 0x8D9E, 0x238B, 0x8D9F, 0x8DB8, 0x2FAA,
- 0x8DB9, 0x8DB9, 0x238A, 0x8DBA, 0x8DE1, 0x2FC4, 0x8DE2, 0x8DE2, 0x2391,
- 0x8DE3, 0x8DE3, 0x2FEC, 0x8DE4, 0x8DE4, 0x2271, 0x8DE5, 0x8DE6, 0x2FED,
- 0x8DE7, 0x8DE7, 0x2388, 0x8DE8, 0x8DF6, 0x2FEF, 0x8DF7, 0x8DF7, 0x238E,
- 0x8DF8, 0x8DFD, 0x2FFE, 0x8DFE, 0x8DFE, 0x238D, 0x8E40, 0x8E45, 0x3004,
- 0x8E46, 0x8E46, 0x238C, 0x8E47, 0x8E55, 0x300A, 0x8E56, 0x8E56, 0x2390,
- 0x8E57, 0x8E57, 0x3019, 0x8E58, 0x8E58, 0x2033, 0x8E59, 0x8E59, 0x301A,
- 0x8E5A, 0x8E5A, 0x223C, 0x8E5B, 0x8E67, 0x301B, 0x8E68, 0x8E68, 0x1FE9,
- 0x8E69, 0x8E6D, 0x3028, 0x8E6E, 0x8E6E, 0x2055, 0x8E6F, 0x8E6F, 0x302D,
- 0x8E70, 0x8E70, 0x2392, 0x8E71, 0x8E7E, 0x302E, 0x8E80, 0x8E80, 0x2324,
- 0x8E81, 0x8E9A, 0x303C, 0x8E9B, 0x8E9B, 0x2143, 0x8E9C, 0x8E9E, 0x3056,
- 0x8E9F, 0x8E9F, 0x2129, 0x8EA0, 0x8EA3, 0x3059, 0x8EA4, 0x8EA4, 0x2277,
- 0x8EA5, 0x8EA6, 0x305D, 0x8EA7, 0x8EA7, 0x1EA7, 0x8EA8, 0x8EAB, 0x305F,
- 0x8EAC, 0x8EAC, 0x2285, 0x8EAD, 0x8EAD, 0x3063, 0x8EAE, 0x8EAE, 0x2384,
- 0x8EAF, 0x8EBC, 0x3064, 0x8EBD, 0x8EBD, 0x2387, 0x8EBE, 0x8EBE, 0x2386,
- 0x8EBF, 0x8EC2, 0x3072, 0x8EC3, 0x8EC3, 0x2290, 0x8EC4, 0x8EC4, 0x3076,
- 0x8EC5, 0x8EC5, 0x1E44, 0x8EC6, 0x8ECC, 0x3077, 0x8ECD, 0x8ECD, 0x1E32,
- 0x8ECE, 0x8ECE, 0x2385, 0x8ECF, 0x8ED5, 0x307E, 0x8ED6, 0x8ED6, 0x1F13,
- 0x8ED7, 0x8ED7, 0x1F73, 0x8ED8, 0x8EEB, 0x3085, 0x8EEC, 0x8EEC, 0x1FE0,
- 0x8EED, 0x8EFE, 0x3099, 0x8F40, 0x8F51, 0x30AB, 0x8F52, 0x8F52, 0x2087,
- 0x8F53, 0x8F53, 0x1E78, 0x8F54, 0x8F54, 0x23AE, 0x8F55, 0x8F55, 0x1EF6,
- 0x8F56, 0x8F56, 0x1F31, 0x8F57, 0x8F5C, 0x30BD, 0x8F5D, 0x8F5D, 0x2045,
- 0x8F5E, 0x8F63, 0x30C3, 0x8F64, 0x8F64, 0x2178, 0x8F65, 0x8F7E, 0x30C9,
- 0x8F80, 0x8F85, 0x30E3, 0x8F86, 0x8F86, 0x23F5, 0x8F87, 0x8F87, 0x30E9,
- 0x8F88, 0x8F88, 0x2275, 0x8F89, 0x8F94, 0x30EA, 0x8F95, 0x8F95, 0x266E,
- 0x8F96, 0x8F96, 0x30F6, 0x8F97, 0x8F97, 0x1EB0, 0x8F98, 0x8F9A, 0x30F7,
- 0x8F9B, 0x8F9B, 0x2083, 0x8F9C, 0x8F9C, 0x30FA, 0x8F9D, 0x8F9D, 0x2188,
- 0x8F9E, 0x8FA0, 0x30FB, 0x8FA1, 0x8FA1, 0x267C, 0x8FA2, 0x8FBC, 0x30FE,
- 0x8FBD, 0x8FBD, 0x1FC5, 0x8FBE, 0x8FC3, 0x3119, 0x8FC4, 0x8FC4, 0x1EA1,
- 0x8FC5, 0x8FC5, 0x311F, 0x8FC6, 0x8FC6, 0x2393, 0x8FC7, 0x8FCC, 0x3120,
- 0x8FCD, 0x8FCD, 0x1F0B, 0x8FCE, 0x8FD7, 0x3126, 0x8FD8, 0x8FD8, 0x1E7C,
- 0x8FD9, 0x8FFE, 0x3130, 0x9040, 0x907E, 0x3156, 0x9080, 0x909C, 0x3195,
- 0x909D, 0x909D, 0x23B4, 0x909E, 0x909E, 0x207E, 0x909F, 0x90B9, 0x31B2,
- 0x90BA, 0x90BA, 0x1EE3, 0x90BB, 0x90BF, 0x31CD, 0x90C0, 0x90C0, 0x2095,
- 0x90C1, 0x90C1, 0x23BB, 0x90C2, 0x90C4, 0x31D2, 0x90C5, 0x90C5, 0x23B9,
- 0x90C6, 0x90DA, 0x31D5, 0x90DB, 0x90DB, 0x1E28, 0x90DC, 0x90DC, 0x23BD,
- 0x90DD, 0x90EC, 0x31EA, 0x90ED, 0x90ED, 0x23B5, 0x90EE, 0x90EF, 0x31FA,
- 0x90F0, 0x90F0, 0x23BA, 0x90F1, 0x90F6, 0x31FC, 0x90F7, 0x90F7, 0x23B3,
- 0x90F8, 0x90FE, 0x3202, 0x9140, 0x9141, 0x3209, 0x9142, 0x9142, 0x2162,
- 0x9143, 0x914A, 0x320B, 0x914B, 0x914B, 0x1E5E, 0x914C, 0x914C, 0x3213,
- 0x914D, 0x914D, 0x1E5D, 0x914E, 0x9150, 0x3214, 0x9151, 0x9151, 0x23B7,
- 0x9152, 0x9153, 0x3217, 0x9154, 0x9154, 0x1F2F, 0x9155, 0x9155, 0x24DF,
- 0x9156, 0x9158, 0x3219, 0x9159, 0x9159, 0x23B2, 0x915A, 0x915A, 0x214E,
- 0x915B, 0x915C, 0x321C, 0x915D, 0x915D, 0x2052, 0x915E, 0x9160, 0x321E,
- 0x9161, 0x9161, 0x23BC, 0x9162, 0x9162, 0x3221, 0x9163, 0x9163, 0x20EB,
- 0x9164, 0x916D, 0x3222, 0x916E, 0x916E, 0x2232, 0x916F, 0x9175, 0x322C,
- 0x9176, 0x9176, 0x1E3F, 0x9177, 0x9179, 0x3233, 0x917A, 0x917A, 0x201B,
- 0x917B, 0x917B, 0x20BC, 0x917C, 0x917C, 0x23BE, 0x917D, 0x917E, 0x3236,
- 0x9180, 0x9183, 0x3238, 0x9184, 0x9184, 0x1EAE, 0x9185, 0x918C, 0x323C,
- 0x918D, 0x918D, 0x1EFB, 0x918E, 0x9190, 0x3244, 0x9191, 0x9191, 0x2089,
- 0x9192, 0x9192, 0x3247, 0x9193, 0x9193, 0x23B1, 0x9194, 0x9196, 0x3248,
- 0x9197, 0x9197, 0x21C4, 0x9198, 0x919A, 0x324B, 0x919B, 0x919B, 0x2214,
- 0x919C, 0x91A8, 0x324E, 0x91A9, 0x91A9, 0x1FDE, 0x91AA, 0x91AA, 0x2223,
- 0x91AB, 0x91AB, 0x23B6, 0x91AC, 0x91B9, 0x325B, 0x91BA, 0x91BA, 0x268C,
- 0x91BB, 0x91BB, 0x24DE, 0x91BC, 0x91BE, 0x3269, 0x91BF, 0x91BF, 0x24E0,
- 0x91C0, 0x91C2, 0x326C, 0x91C3, 0x91C3, 0x23B8, 0x91C4, 0x91CC, 0x326F,
- 0x91CD, 0x91CD, 0x1E81, 0x91CE, 0x91CF, 0x3278, 0x91D0, 0x91D0, 0x1FFE,
- 0x91D1, 0x91D1, 0x1F51, 0x91D2, 0x91D2, 0x21E1, 0x91D3, 0x91D3, 0x327A,
- 0x91D4, 0x91D4, 0x23B0, 0x91D5, 0x91D5, 0x327B, 0x91D6, 0x91D6, 0x1FCE,
- 0x91D7, 0x91D7, 0x327C, 0x91D8, 0x91D8, 0x211E, 0x91D9, 0x91D9, 0x2021,
- 0x91DA, 0x91DE, 0x327D, 0x91DF, 0x91DF, 0x24E1, 0x91E0, 0x91E1, 0x3282,
- 0x91E2, 0x91E2, 0x24A3, 0x91E3, 0x91E9, 0x3284, 0x91EA, 0x91EA, 0x24A4,
- 0x91EB, 0x91EF, 0x328B, 0x91F0, 0x91F0, 0x2273, 0x91F1, 0x91F1, 0x3290,
- 0x91F2, 0x91F2, 0x21B0, 0x91F3, 0x91FE, 0x3291, 0x9240, 0x927E, 0x329D,
- 0x9280, 0x92B5, 0x32DC, 0x92B6, 0x92B6, 0x21D1, 0x92B7, 0x92CD, 0x3312,
- 0x92CE, 0x92CE, 0x211C, 0x92CF, 0x92CF, 0x3329, 0x92D0, 0x92D0, 0x235D,
- 0x92D1, 0x92D3, 0x332A, 0x92D4, 0x92D4, 0x2682, 0x92D5, 0x92DE, 0x332D,
- 0x92DF, 0x92DF, 0x210D, 0x92E0, 0x92E0, 0x205A, 0x92E1, 0x92FD, 0x3337,
- 0x92FE, 0x92FE, 0x1F8D, 0x9340, 0x934F, 0x3354, 0x9350, 0x9350, 0x21FF,
- 0x9351, 0x935C, 0x3364, 0x935D, 0x935D, 0x1F58, 0x935E, 0x936F, 0x3370,
- 0x9370, 0x9370, 0x215B, 0x9371, 0x9375, 0x3382, 0x9376, 0x9376, 0x1EB6,
- 0x9377, 0x937E, 0x3387, 0x9380, 0x938B, 0x338F, 0x938C, 0x938C, 0x20DB,
- 0x938D, 0x939C, 0x339B, 0x939D, 0x939D, 0x2360, 0x939E, 0x93A4, 0x33AB,
- 0x93A5, 0x93A5, 0x2361, 0x93A6, 0x93A6, 0x33B2, 0x93A7, 0x93A7, 0x2040,
- 0x93A8, 0x93B3, 0x33B3, 0x93B4, 0x93B4, 0x228E, 0x93B5, 0x93B7, 0x33BF,
- 0x93B8, 0x93B8, 0x1FDF, 0x93B9, 0x93BA, 0x33C2, 0x93BB, 0x93BB, 0x235E,
- 0x93BC, 0x93BC, 0x33C4, 0x93BD, 0x93BD, 0x1E6A, 0x93BE, 0x93C5, 0x33C5,
- 0x93C6, 0x93C6, 0x2002, 0x93C7, 0x93CE, 0x33CD, 0x93CF, 0x93CF, 0x2093,
- 0x93D0, 0x93D6, 0x33D5, 0x93D7, 0x93D7, 0x235F, 0x93D8, 0x93DA, 0x33DC,
- 0x93DB, 0x93DB, 0x1EAC, 0x93DC, 0x93DC, 0x1E54, 0x93DD, 0x93E0, 0x33DF,
- 0x93E1, 0x93E1, 0x1F08, 0x93E2, 0x93E3, 0x33E3, 0x93E4, 0x93E4, 0x20C0,
- 0x93E5, 0x93E5, 0x2362, 0x93E6, 0x93E8, 0x33E5, 0x93E9, 0x93E9, 0x2160,
- 0x93EA, 0x93EA, 0x33E8, 0x93EB, 0x93EB, 0x219D, 0x93EC, 0x93EC, 0x1F8E,
- 0x93ED, 0x93ED, 0x222D, 0x93EE, 0x93EE, 0x33E9, 0x93EF, 0x93EF, 0x2047,
- 0x93F0, 0x93F0, 0x33EA, 0x93F1, 0x93F1, 0x2262, 0x93F2, 0x93F3, 0x33EB,
- 0x93F4, 0x93F4, 0x1F67, 0x93F5, 0x93F5, 0x1EB2, 0x93F6, 0x93F9, 0x33ED,
- 0x93FA, 0x93FA, 0x1EA9, 0x93FB, 0x93FD, 0x33F1, 0x93FE, 0x93FE, 0x1FCC,
- 0x9440, 0x9443, 0x33F4, 0x9444, 0x9444, 0x1F72, 0x9445, 0x944C, 0x33F8,
- 0x944D, 0x944D, 0x2098, 0x944E, 0x944F, 0x3400, 0x9450, 0x9450, 0x1E52,
- 0x9451, 0x9451, 0x20A4, 0x9452, 0x9452, 0x1F1C, 0x9453, 0x9453, 0x228F,
- 0x9454, 0x9454, 0x3402, 0x9455, 0x9455, 0x1FED, 0x9456, 0x9457, 0x3403,
- 0x9458, 0x9458, 0x2365, 0x9459, 0x945A, 0x3405, 0x945B, 0x945B, 0x1E2D,
- 0x945C, 0x945C, 0x2152, 0x945D, 0x945D, 0x2366, 0x945E, 0x945E, 0x3407,
- 0x945F, 0x945F, 0x20FA, 0x9460, 0x9463, 0x3408, 0x9464, 0x9464, 0x2363,
- 0x9465, 0x9465, 0x340C, 0x9466, 0x9466, 0x209A, 0x9467, 0x946D, 0x340D,
- 0x946E, 0x946E, 0x203C, 0x946F, 0x9471, 0x3414, 0x9472, 0x9472, 0x1FF6,
- 0x9473, 0x9473, 0x3417, 0x9474, 0x9474, 0x2364, 0x9475, 0x9475, 0x3418,
- 0x9476, 0x9476, 0x1E69, 0x9477, 0x9477, 0x3419, 0x9478, 0x9478, 0x2367,
- 0x9479, 0x9479, 0x341A, 0x947A, 0x947A, 0x211D, 0x947B, 0x947E, 0x341B,
- 0x9480, 0x9480, 0x2259, 0x9481, 0x9481, 0x2056, 0x9482, 0x9482, 0x2163,
- 0x9483, 0x9486, 0x341F, 0x9487, 0x9487, 0x1FA9, 0x9488, 0x9488, 0x1FFC,
- 0x9489, 0x94A0, 0x3423, 0x94A1, 0x94A1, 0x1E2E, 0x94A2, 0x94B2, 0x343B,
- 0x94B3, 0x94B3, 0x1EBC, 0x94B4, 0x94B4, 0x344C, 0x94B5, 0x94B5, 0x2142,
- 0x94B6, 0x94BE, 0x344D, 0x94BF, 0x94BF, 0x201E, 0x94C0, 0x94C0, 0x1E43,
- 0x94C1, 0x94CB, 0x3456, 0x94CC, 0x94CC, 0x24D4, 0x94CD, 0x94D7, 0x3461,
- 0x94D8, 0x94D8, 0x226F, 0x94D9, 0x94DF, 0x346C, 0x94E0, 0x94E0, 0x1ED7,
- 0x94E1, 0x94FE, 0x3473, 0x9540, 0x9571, 0x3491, 0x9572, 0x9572, 0x212D,
- 0x9573, 0x957E, 0x34C3, 0x9580, 0x9582, 0x34CF, 0x9583, 0x9583, 0x229B,
- 0x9584, 0x959D, 0x34D2, 0x959E, 0x959E, 0x2256, 0x959F, 0x959F, 0x24A8,
- 0x95A0, 0x95B2, 0x34EC, 0x95B3, 0x95B3, 0x1E79, 0x95B4, 0x95B9, 0x34FF,
- 0x95BA, 0x95BA, 0x225A, 0x95BB, 0x95CE, 0x3505, 0x95CF, 0x95CF, 0x24A7,
- 0x95D0, 0x95D0, 0x3519, 0x95D1, 0x95D1, 0x2686, 0x95D2, 0x95D2, 0x24A6,
- 0x95D3, 0x95D3, 0x351A, 0x95D4, 0x95D4, 0x21CE, 0x95D5, 0x95E0, 0x351B,
- 0x95E1, 0x95E1, 0x24A9, 0x95E2, 0x95E6, 0x3527, 0x95E7, 0x95E7, 0x1FE7,
- 0x95E8, 0x95F0, 0x352C, 0x95F1, 0x95F1, 0x2112, 0x95F2, 0x95F7, 0x3535,
- 0x95F8, 0x95F8, 0x213C, 0x95F9, 0x95FD, 0x353B, 0x95FE, 0x95FE, 0x1F5C,
- 0x9640, 0x9655, 0x3540, 0x9656, 0x9656, 0x24C4, 0x9657, 0x967B, 0x3556,
- 0x967C, 0x967C, 0x1ECC, 0x967D, 0x967E, 0x357B, 0x9680, 0x96FE, 0x357D,
- 0x9740, 0x9766, 0x35FC, 0x9767, 0x9767, 0x246A, 0x9768, 0x976B, 0x3623,
- 0x976C, 0x976C, 0x2175, 0x976D, 0x976D, 0x3627, 0x976E, 0x976E, 0x246D,
- 0x976F, 0x977E, 0x3628, 0x9780, 0x9795, 0x3638, 0x9796, 0x9796, 0x246B,
- 0x9797, 0x9797, 0x225F, 0x9798, 0x979C, 0x364E, 0x979D, 0x979D, 0x1ECE,
- 0x979E, 0x97A2, 0x3653, 0x97A3, 0x97A3, 0x2272, 0x97A4, 0x97BE, 0x3658,
- 0x97BF, 0x97BF, 0x2473, 0x97C0, 0x97ED, 0x3673, 0x97EE, 0x97EE, 0x21FE,
- 0x97EF, 0x97F6, 0x36A1, 0x97F7, 0x97F7, 0x1EFE, 0x97F8, 0x97FE, 0x36A9,
- 0x9840, 0x9844, 0x36B0, 0x9845, 0x9845, 0x2475, 0x9846, 0x9848, 0x36B5,
- 0x9849, 0x9849, 0x220A, 0x984A, 0x984E, 0x36B8, 0x984F, 0x984F, 0x1F6F,
- 0x9850, 0x9870, 0x36BD, 0x9871, 0x9871, 0x2468, 0x9872, 0x9872, 0x36DE,
- 0x9873, 0x9873, 0x2100, 0x9874, 0x987E, 0x36DF, 0x9880, 0x9880, 0x36EA,
- 0x9881, 0x9881, 0x2476, 0x9882, 0x988A, 0x36EB, 0x988B, 0x988B, 0x1F27,
- 0x988C, 0x988C, 0x20D7, 0x988D, 0x989F, 0x36F4, 0x98A0, 0x98A0, 0x247C,
- 0x98A1, 0x98A9, 0x3707, 0x98AA, 0x98AA, 0x1FA1, 0x98AB, 0x98B5, 0x3710,
- 0x98B6, 0x98B6, 0x22AA, 0x98B7, 0x98B7, 0x2005, 0x98B8, 0x98B9, 0x371B,
- 0x98BA, 0x98BA, 0x246C, 0x98BB, 0x98C6, 0x371D, 0x98C7, 0x98C7, 0x203E,
- 0x98C8, 0x98CA, 0x3729, 0x98CB, 0x98CB, 0x1E4C, 0x98CC, 0x98CF, 0x372C,
- 0x98D0, 0x98D0, 0x213A, 0x98D1, 0x98D2, 0x3730, 0x98D3, 0x98D3, 0x2204,
- 0x98D4, 0x98E2, 0x3732, 0x98E3, 0x98E3, 0x20C3, 0x98E4, 0x98E4, 0x2140,
- 0x98E5, 0x98E5, 0x2477, 0x98E6, 0x98EE, 0x3741, 0x98EF, 0x98EF, 0x2474,
- 0x98F0, 0x98F1, 0x374A, 0x98F2, 0x98F2, 0x20DD, 0x98F3, 0x98FE, 0x374C,
- 0x9940, 0x9942, 0x3758, 0x9943, 0x9943, 0x1F68, 0x9944, 0x9944, 0x375B,
- 0x9945, 0x9945, 0x2185, 0x9946, 0x9965, 0x375C, 0x9966, 0x9966, 0x2472,
- 0x9967, 0x996D, 0x377C, 0x996E, 0x996E, 0x1EB5, 0x996F, 0x9974, 0x3783,
- 0x9975, 0x9975, 0x2478, 0x9976, 0x9979, 0x3789, 0x997A, 0x997A, 0x1F8B,
- 0x997B, 0x997B, 0x2484, 0x997C, 0x997E, 0x378D, 0x9980, 0x9984, 0x3790,
- 0x9985, 0x9985, 0x2699, 0x9986, 0x9988, 0x3795, 0x9989, 0x9989, 0x2482,
- 0x998A, 0x998D, 0x3798, 0x998E, 0x998E, 0x20A1, 0x998F, 0x9990, 0x379C,
- 0x9991, 0x9991, 0x1F92, 0x9992, 0x9998, 0x379E, 0x9999, 0x9999, 0x1F38,
- 0x999A, 0x99A8, 0x37A5, 0x99A9, 0x99A9, 0x2485, 0x99AA, 0x99AF, 0x37B4,
- 0x99B0, 0x99B0, 0x2480, 0x99B1, 0x99B1, 0x246E, 0x99B2, 0x99B2, 0x37BA,
- 0x99B3, 0x99B3, 0x247B, 0x99B4, 0x99B4, 0x2486, 0x99B5, 0x99B5, 0x2471,
- 0x99B6, 0x99BC, 0x37BB, 0x99BD, 0x99BD, 0x2483, 0x99BE, 0x99BE, 0x2470,
- 0x99BF, 0x99BF, 0x37C2, 0x99C0, 0x99C0, 0x2469, 0x99C1, 0x99C1, 0x37C3,
- 0x99C2, 0x99C2, 0x247F, 0x99C3, 0x99C8, 0x37C4, 0x99C9, 0x99C9, 0x246F,
- 0x99CA, 0x99CD, 0x37CA, 0x99CE, 0x99CE, 0x2481, 0x99CF, 0x99D0, 0x37CE,
- 0x99D1, 0x99D1, 0x2220, 0x99D2, 0x99D9, 0x37D0, 0x99DA, 0x99DA, 0x1FF5,
- 0x99DB, 0x99DF, 0x37D8, 0x99E0, 0x99E0, 0x20F4, 0x99E1, 0x99E4, 0x37DD,
- 0x99E5, 0x99E5, 0x247D, 0x99E6, 0x99E7, 0x37E1, 0x99E8, 0x99E8, 0x2479,
- 0x99E9, 0x99EB, 0x37E3, 0x99EC, 0x99EC, 0x247E, 0x99ED, 0x99F3, 0x37E6,
- 0x99F4, 0x99F4, 0x247A, 0x99F5, 0x99FE, 0x37ED, 0x9A40, 0x9A49, 0x37F7,
- 0x9A4A, 0x9A4A, 0x20E3, 0x9A4B, 0x9A56, 0x3801, 0x9A57, 0x9A57, 0x20AD,
- 0x9A58, 0x9A64, 0x380D, 0x9A65, 0x9A65, 0x24CB, 0x9A66, 0x9A66, 0x381A,
- 0x9A67, 0x9A67, 0x1F53, 0x9A68, 0x9A70, 0x381B, 0x9A71, 0x9A71, 0x2159,
- 0x9A72, 0x9A75, 0x3824, 0x9A76, 0x9A76, 0x2013, 0x9A77, 0x9A77, 0x1F33,
- 0x9A78, 0x9A7E, 0x3828, 0x9A80, 0x9A87, 0x382F, 0x9A88, 0x9A88, 0x1E5C,
- 0x9A89, 0x9A8B, 0x3837, 0x9A8C, 0x9A8C, 0x2488, 0x9A8D, 0x9A90, 0x383A,
- 0x9A91, 0x9A91, 0x2487, 0x9A92, 0x9A96, 0x383E, 0x9A97, 0x9A97, 0x248A,
- 0x9A98, 0x9A99, 0x3843, 0x9A9A, 0x9A9A, 0x2489, 0x9A9B, 0x9A9B, 0x248B,
- 0x9A9C, 0x9A9D, 0x3845, 0x9A9E, 0x9A9E, 0x1F83, 0x9A9F, 0x9AA1, 0x3847,
- 0x9AA2, 0x9AA2, 0x210F, 0x9AA3, 0x9AA3, 0x1FDB, 0x9AA4, 0x9AA9, 0x384A,
- 0x9AAA, 0x9AAA, 0x20AF, 0x9AAB, 0x9ACF, 0x3850, 0x9AD0, 0x9AD0, 0x24C0,
- 0x9AD1, 0x9AD5, 0x3875, 0x9AD6, 0x9AD6, 0x226D, 0x9AD7, 0x9AD9, 0x387A,
- 0x9ADA, 0x9ADA, 0x24C1, 0x9ADB, 0x9AE1, 0x387D, 0x9AE2, 0x9AE2, 0x20CA,
- 0x9AE3, 0x9AE3, 0x3884, 0x9AE4, 0x9AE4, 0x20E7, 0x9AE5, 0x9AE5, 0x24C2,
- 0x9AE6, 0x9AFE, 0x3885, 0x9B40, 0x9B7E, 0x389E, 0x9B80, 0x9BD0, 0x38DD,
- 0x9BD1, 0x9BD1, 0x23DC, 0x9BD2, 0x9BDB, 0x392E, 0x9BDC, 0x9BDC, 0x23DB,
- 0x9BDD, 0x9BFE, 0x3938, 0x9C40, 0x9C52, 0x395A, 0x9C53, 0x9C53, 0x205E,
- 0x9C54, 0x9C58, 0x396D, 0x9C59, 0x9C59, 0x2244, 0x9C5A, 0x9C5A, 0x23E2,
- 0x9C5B, 0x9C5B, 0x3972, 0x9C5C, 0x9C5C, 0x20D4, 0x9C5D, 0x9C74, 0x3973,
- 0x9C75, 0x9C75, 0x219F, 0x9C76, 0x9C78, 0x398B, 0x9C79, 0x9C79, 0x1E66,
- 0x9C7A, 0x9C7E, 0x398E, 0x9C80, 0x9C85, 0x3993, 0x9C86, 0x9C86, 0x1F63,
- 0x9C87, 0x9C9C, 0x3999, 0x9C9D, 0x9C9D, 0x23DD, 0x9C9E, 0x9CAA, 0x39AF,
- 0x9CAB, 0x9CAB, 0x216B, 0x9CAC, 0x9CC9, 0x39BC, 0x9CCA, 0x9CCA, 0x22B5,
- 0x9CCB, 0x9CCE, 0x39DA, 0x9CCF, 0x9CCF, 0x1F26, 0x9CD0, 0x9CE5, 0x39DE,
- 0x9CE6, 0x9CE6, 0x1E63, 0x9CE7, 0x9CE7, 0x2088, 0x9CE8, 0x9CEB, 0x39F4,
- 0x9CEC, 0x9CEC, 0x1EBD, 0x9CED, 0x9CED, 0x39F8, 0x9CEE, 0x9CEE, 0x2341,
- 0x9CEF, 0x9CFA, 0x39F9, 0x9CFB, 0x9CFB, 0x1F4B, 0x9CFC, 0x9CFD, 0x3A05,
- 0x9CFE, 0x9CFE, 0x2292, 0x9D40, 0x9D41, 0x3A07, 0x9D42, 0x9D42, 0x2124,
- 0x9D43, 0x9D45, 0x3A09, 0x9D46, 0x9D46, 0x2048, 0x9D47, 0x9D47, 0x23E0,
- 0x9D48, 0x9D4C, 0x3A0C, 0x9D4D, 0x9D4D, 0x2077, 0x9D4E, 0x9D4E, 0x3A11,
- 0x9D4F, 0x9D4F, 0x223A, 0x9D50, 0x9D60, 0x3A12, 0x9D61, 0x9D61, 0x20B1,
- 0x9D62, 0x9D67, 0x3A23, 0x9D68, 0x9D68, 0x1F41, 0x9D69, 0x9D69, 0x201C,
- 0x9D6A, 0x9D6D, 0x3A29, 0x9D6E, 0x9D6E, 0x22B8, 0x9D6F, 0x9D70, 0x3A2D,
- 0x9D71, 0x9D71, 0x2276, 0x9D72, 0x9D74, 0x3A2F, 0x9D75, 0x9D75, 0x1F9B,
- 0x9D76, 0x9D7A, 0x3A32, 0x9D7B, 0x9D7B, 0x1F9F, 0x9D7C, 0x9D7C, 0x3A37,
- 0x9D7D, 0x9D7D, 0x25CA, 0x9D7E, 0x9D7E, 0x3A38, 0x9D80, 0x9D89, 0x3A39,
- 0x9D8A, 0x9D8A, 0x20BE, 0x9D8B, 0x9D8C, 0x3A43, 0x9D8D, 0x9D8D, 0x1FB4,
- 0x9D8E, 0x9D90, 0x3A45, 0x9D91, 0x9D91, 0x23D7, 0x9D92, 0x9D98, 0x3A48,
- 0x9D99, 0x9D99, 0x2105, 0x9D9A, 0x9DA0, 0x3A4F, 0x9DA1, 0x9DA1, 0x23E1,
- 0x9DA2, 0x9DA2, 0x1FEC, 0x9DA3, 0x9DA6, 0x3A56, 0x9DA7, 0x9DA7, 0x23EA,
- 0x9DA8, 0x9DAB, 0x3A5A, 0x9DAC, 0x9DAC, 0x23E3, 0x9DAD, 0x9DAD, 0x210E,
- 0x9DAE, 0x9DB1, 0x3A5E, 0x9DB2, 0x9DB2, 0x1FA6, 0x9DB3, 0x9DB3, 0x2004,
- 0x9DB4, 0x9DBD, 0x3A62, 0x9DBE, 0x9DBE, 0x1F9D, 0x9DBF, 0x9DC5, 0x3A6C,
- 0x9DC6, 0x9DC6, 0x23E5, 0x9DC7, 0x9DC8, 0x3A73, 0x9DC9, 0x9DC9, 0x2264,
- 0x9DCA, 0x9DCC, 0x3A75, 0x9DCD, 0x9DCD, 0x24E2, 0x9DCE, 0x9DD1, 0x3A78,
- 0x9DD2, 0x9DD2, 0x23DE, 0x9DD3, 0x9DD4, 0x3A7C, 0x9DD5, 0x9DD5, 0x1EC4,
- 0x9DD6, 0x9DE0, 0x3A7E, 0x9DE1, 0x9DE1, 0x22B6, 0x9DE2, 0x9DE2, 0x20A9,
- 0x9DE3, 0x9DF0, 0x3A89, 0x9DF1, 0x9DF1, 0x212B, 0x9DF2, 0x9DF3, 0x3A97,
- 0x9DF4, 0x9DF4, 0x20A5, 0x9DF5, 0x9DF6, 0x3A99, 0x9DF7, 0x9DF7, 0x268B,
- 0x9DF8, 0x9DF9, 0x3A9B, 0x9DFA, 0x9DFA, 0x1F76, 0x9DFB, 0x9DFC, 0x3A9D,
- 0x9DFD, 0x9DFD, 0x216D, 0x9DFE, 0x9DFE, 0x3A9F, 0x9E40, 0x9E44, 0x3AA0,
- 0x9E45, 0x9E45, 0x2001, 0x9E46, 0x9E47, 0x3AA5, 0x9E48, 0x9E48, 0x2191,
- 0x9E49, 0x9E49, 0x1E50, 0x9E4A, 0x9E51, 0x3AA7, 0x9E52, 0x9E52, 0x1F9C,
- 0x9E53, 0x9E53, 0x3AAF, 0x9E54, 0x9E54, 0x23DA, 0x9E55, 0x9E55, 0x3AB0,
- 0x9E56, 0x9E56, 0x2053, 0x9E57, 0x9E5C, 0x3AB1, 0x9E5D, 0x9E5D, 0x23E9,
- 0x9E5E, 0x9E5E, 0x23E4, 0x9E5F, 0x9E60, 0x3AB7, 0x9E61, 0x9E61, 0x21D5,
- 0x9E62, 0x9E62, 0x3AB9, 0x9E63, 0x9E63, 0x23E6, 0x9E64, 0x9E66, 0x3ABA,
- 0x9E67, 0x9E67, 0x23DF, 0x9E68, 0x9E6B, 0x3ABD, 0x9E6C, 0x9E6C, 0x1E4F,
- 0x9E6D, 0x9E6E, 0x3AC1, 0x9E6F, 0x9E6F, 0x23D9, 0x9E70, 0x9E71, 0x3AC3,
- 0x9E72, 0x9E72, 0x2014, 0x9E73, 0x9E73, 0x3AC5, 0x9E74, 0x9E74, 0x23EC,
- 0x9E75, 0x9E75, 0x23EB, 0x9E76, 0x9E7A, 0x3AC6, 0x9E7B, 0x9E7B, 0x23D8,
- 0x9E7C, 0x9E7C, 0x23EE, 0x9E7D, 0x9E7E, 0x3ACB, 0x9E80, 0x9E84, 0x3ACD,
- 0x9E85, 0x9E85, 0x268E, 0x9E86, 0x9E86, 0x3AD2, 0x9E87, 0x9E87, 0x23ED,
- 0x9E88, 0x9E90, 0x3AD3, 0x9E91, 0x9E91, 0x1FFA, 0x9E92, 0x9E95, 0x3ADC,
- 0x9E96, 0x9E96, 0x23D6, 0x9E97, 0x9E97, 0x23E8, 0x9E98, 0x9EA1, 0x3AE0,
- 0x9EA2, 0x9EA2, 0x2106, 0x9EA3, 0x9EA5, 0x3AEA, 0x9EA6, 0x9EA6, 0x200B,
- 0x9EA7, 0x9EA8, 0x3AED, 0x9EA9, 0x9EA9, 0x2166, 0x9EAA, 0x9EAD, 0x3AEF,
- 0x9EAE, 0x9EAE, 0x23EF, 0x9EAF, 0x9EB2, 0x3AF3, 0x9EB3, 0x9EB3, 0x2189,
- 0x9EB4, 0x9EB4, 0x2058, 0x9EB5, 0x9EB6, 0x3AF7, 0x9EB7, 0x9EB7, 0x23E7,
- 0x9EB8, 0x9EF4, 0x3AF9, 0x9EF5, 0x9EF5, 0x21A3, 0x9EF6, 0x9EFE, 0x3B36,
- 0x9F40, 0x9F4D, 0x3B3F, 0x9F4E, 0x9F4E, 0x217A, 0x9F4F, 0x9F6E, 0x3B4D,
- 0x9F6F, 0x9F6F, 0x21A5, 0x9F70, 0x9F7E, 0x3B6D, 0x9F80, 0x9F91, 0x3B7C,
- 0x9F92, 0x9F92, 0x2022, 0x9F93, 0x9F97, 0x3B8E, 0x9F98, 0x9F98, 0x24D6,
- 0x9F99, 0x9FA5, 0x3B93, 0x9FA6, 0x9FA6, 0x233A, 0x9FA7, 0x9FA8, 0x3BA0,
- 0x9FA9, 0x9FA9, 0x1EEE, 0x9FAA, 0x9FAB, 0x3BA2, 0x9FAC, 0x9FAC, 0x24D5,
- 0x9FAD, 0x9FC8, 0x3BA4, 0x9FC9, 0x9FC9, 0x2228, 0x9FCA, 0x9FCC, 0x3BC0,
- 0x9FCD, 0x9FCD, 0x24D7, 0x9FCE, 0x9FE0, 0x3BC3, 0x9FE1, 0x9FE1, 0x20FC,
- 0x9FE2, 0x9FEA, 0x3BD6, 0x9FEB, 0x9FEB, 0x1E87, 0x9FEC, 0x9FED, 0x3BDF,
- 0x9FEE, 0x9FEE, 0x24D8, 0x9FEF, 0x9FF3, 0x3BE1, 0x9FF4, 0x9FF4, 0x1EBA,
- 0x9FF5, 0x9FFC, 0x3BE6, 0x9FFD, 0x9FFD, 0x2119, 0x9FFE, 0x9FFE, 0x3BEE,
- 0xA040, 0xA042, 0x3BEF, 0xA043, 0xA043, 0x216C, 0xA044, 0xA045, 0x3BF2,
- 0xA046, 0xA046, 0x24D9, 0xA047, 0xA048, 0x3BF4, 0xA049, 0xA049, 0x2227,
- 0xA04A, 0xA04D, 0x3BF6, 0xA04E, 0xA04E, 0x1E5F, 0xA04F, 0xA053, 0x3BFA,
- 0xA054, 0xA054, 0x229F, 0xA055, 0xA059, 0x3BFF, 0xA05A, 0xA05A, 0x1F5D,
- 0xA05B, 0xA060, 0x3C04, 0xA061, 0xA061, 0x1FBC, 0xA062, 0xA062, 0x3C0A,
- 0xA063, 0xA063, 0x24DA, 0xA064, 0xA070, 0x3C0B, 0xA071, 0xA071, 0x2149,
- 0xA072, 0xA073, 0x3C18, 0xA074, 0xA074, 0x2046, 0xA075, 0xA07E, 0x3C1A,
- 0xA080, 0xA080, 0x2000, 0xA081, 0xA090, 0x3C24, 0xA091, 0xA091, 0x2190,
- 0xA092, 0xA093, 0x3C34, 0xA094, 0xA094, 0x2208, 0xA095, 0xA095, 0x3C36,
- 0xA096, 0xA096, 0x1EE6, 0xA097, 0xA0A8, 0x3C37, 0xA0A9, 0xA0A9, 0x24C3,
- 0xA0AA, 0xA0BE, 0x3C49, 0xA0BF, 0xA0BF, 0x20CC, 0xA0C0, 0xA0CD, 0x3C5E,
- 0xA0CE, 0xA0CE, 0x2340, 0xA0CF, 0xA0D8, 0x3C6C, 0xA0D9, 0xA0D9, 0x1ED1,
- 0xA0DA, 0xA0DD, 0x3C76, 0xA0DE, 0xA0DE, 0x21AC, 0xA0DF, 0xA0ED, 0x3C7A,
- 0xA0EE, 0xA0EE, 0x22AF, 0xA0EF, 0xA0FE, 0x3C89, 0xA1A1, 0xA1FE, 0x0060,
- 0xA2A1, 0xA2AA, 0x26A9, 0xA2B1, 0xA2E2, 0x00BE, 0xA2E5, 0xA2EE, 0x00F0,
- 0xA2F1, 0xA2FC, 0x00FA, 0xA3A1, 0xA3FE, 0x0106, 0xA4A1, 0xA4F3, 0x0164,
- 0xA5A1, 0xA5F6, 0x01B7, 0xA6A1, 0xA6B8, 0x020D, 0xA6C1, 0xA6F5, 0x0225,
- 0xA7A1, 0xA7C1, 0x025A, 0xA7D1, 0xA7F1, 0x027B, 0xA840, 0xA87E, 0x26B3,
- 0xA880, 0xA895, 0x26F2, 0xA8A1, 0xA8C0, 0x029C, 0xA8C5, 0xA8EA, 0x02BC,
- 0xA940, 0xA957, 0x2708, 0xA959, 0xA95A, 0x2720, 0xA95C, 0xA95C, 0x2722,
- 0xA960, 0xA97E, 0x2723, 0xA980, 0xA995, 0x2742, 0xA996, 0xA996, 0x1E17,
- 0xA9A4, 0xA9EF, 0x02E2, 0xAA40, 0xAA4C, 0x3C99, 0xAA4D, 0xAA4D, 0x21B6,
- 0xAA4E, 0xAA4E, 0x1E3D, 0xAA4F, 0xAA70, 0x3CA6, 0xAA71, 0xAA71, 0x2235,
- 0xAA72, 0xAA72, 0x3CC8, 0xAA73, 0xAA73, 0x2397, 0xAA74, 0xAA76, 0x3CC9,
- 0xAA77, 0xAA77, 0x2395, 0xAA78, 0xAA79, 0x3CCC, 0xAA7A, 0xAA7A, 0x223F,
- 0xAA7B, 0xAA7B, 0x212A, 0xAA7C, 0xAA7E, 0x3CCE, 0xAA80, 0xAA99, 0x3CD1,
- 0xAA9A, 0xAA9A, 0x1ED2, 0xAA9B, 0xAA9B, 0x3CEB, 0xAA9C, 0xAA9C, 0x2396,
- 0xAA9D, 0xAA9D, 0x2398, 0xAA9E, 0xAA9E, 0x3CEC, 0xAA9F, 0xAA9F, 0x20A2,
- 0xAAA0, 0xAAA0, 0x3CED, 0xAAA1, 0xAAFE, 0x032E, 0xAB40, 0xAB40, 0x1F64,
- 0xAB41, 0xAB42, 0x3CEE, 0xAB43, 0xAB43, 0x202B, 0xAB44, 0xAB44, 0x3CF0,
- 0xAB45, 0xAB45, 0x2394, 0xAB46, 0xAB46, 0x2139, 0xAB47, 0xAB47, 0x3CF1,
- 0xAB48, 0xAB48, 0x215F, 0xAB49, 0xAB49, 0x21C1, 0xAB4A, 0xAB4A, 0x239A,
- 0xAB4B, 0xAB4C, 0x3CF2, 0xAB4D, 0xAB4D, 0x2399, 0xAB4E, 0xAB7E, 0x3CF4,
- 0xAB80, 0xABA0, 0x3D25, 0xABA1, 0xABC0, 0x038C, 0xAC40, 0xAC45, 0x3D46,
- 0xAC46, 0xAC46, 0x21C0, 0xAC47, 0xAC70, 0x3D4C, 0xAC71, 0xAC71, 0x2460,
- 0xAC72, 0xAC7B, 0x3D76, 0xAC7C, 0xAC7C, 0x245C, 0xAC7D, 0xAC7E, 0x3D80,
- 0xAC80, 0xAC8C, 0x3D82, 0xAC8D, 0xAC8D, 0x215D, 0xAC8E, 0xAC92, 0x3D8F,
- 0xAC93, 0xAC93, 0x2225, 0xAC94, 0xAC94, 0x206A, 0xAC95, 0xACA0, 0x3D94,
- 0xAD40, 0xAD48, 0x3DA0, 0xAD49, 0xAD49, 0x2461, 0xAD4A, 0xAD5D, 0x3DA9,
- 0xAD5E, 0xAD5E, 0x245B, 0xAD5F, 0xAD60, 0x3DBD, 0xAD61, 0xAD61, 0x2462,
- 0xAD62, 0xAD67, 0x3DBF, 0xAD68, 0xAD68, 0x1F54, 0xAD69, 0xAD73, 0x3DC5,
- 0xAD74, 0xAD74, 0x245F, 0xAD75, 0xAD7E, 0x3DD0, 0xAD80, 0xAD81, 0x3DDA,
- 0xAD82, 0xAD82, 0x20EC, 0xAD83, 0xAD86, 0x3DDC, 0xAD87, 0xAD87, 0x245D,
- 0xAD88, 0xAD8A, 0x3DE0, 0xAD8B, 0xAD8B, 0x2463, 0xAD8C, 0xAD90, 0x3DE3,
- 0xAD91, 0xAD91, 0x2464, 0xAD92, 0xADA0, 0x3DE8, 0xAE40, 0xAE53, 0x3DF7,
- 0xAE54, 0xAE54, 0x24A5, 0xAE55, 0xAE61, 0x3E0B, 0xAE62, 0xAE62, 0x1E70,
- 0xAE63, 0xAE7E, 0x3E18, 0xAE80, 0xAE80, 0x208F, 0xAE81, 0xAE84, 0x3E34,
- 0xAE85, 0xAE85, 0x1E42, 0xAE86, 0xAE8A, 0x3E38, 0xAE8B, 0xAE8B, 0x1F4E,
- 0xAE8C, 0xAE93, 0x3E3D, 0xAE94, 0xAE94, 0x1EB1, 0xAE95, 0xAE9F, 0x3E45,
- 0xAEA0, 0xAEA0, 0x1E8B, 0xAF40, 0xAF63, 0x3E50, 0xAF64, 0xAF64, 0x1FC6,
- 0xAF65, 0xAF7A, 0x3E74, 0xAF7B, 0xAF7B, 0x25AE, 0xAF7C, 0xAF7E, 0x3E8A,
- 0xAF80, 0xAF81, 0x3E8D, 0xAF82, 0xAF82, 0x1F01, 0xAF83, 0xAF83, 0x2200,
- 0xAF84, 0xAF8D, 0x3E8F, 0xAF8E, 0xAF8E, 0x25B2, 0xAF8F, 0xAF8F, 0x1E97,
- 0xAF90, 0xAF90, 0x3E99, 0xAF91, 0xAF91, 0x20AB, 0xAF92, 0xAF9B, 0x3E9A,
- 0xAF9C, 0xAF9C, 0x25B3, 0xAF9D, 0xAF9E, 0x3EA4, 0xAF9F, 0xAF9F, 0x2028,
- 0xAFA0, 0xAFA0, 0x3EA6, 0xB040, 0xB040, 0x3EA7, 0xB041, 0xB042, 0x25AF,
- 0xB043, 0xB043, 0x3EA8, 0xB044, 0xB044, 0x25B1, 0xB045, 0xB04E, 0x3EA9,
- 0xB04F, 0xB04F, 0x25AC, 0xB050, 0xB053, 0x3EB3, 0xB054, 0xB054, 0x1E4E,
- 0xB055, 0xB056, 0x3EB7, 0xB057, 0xB057, 0x2202, 0xB058, 0xB058, 0x25AB,
- 0xB059, 0xB059, 0x2286, 0xB05A, 0xB05A, 0x3EB9, 0xB05B, 0xB05B, 0x25AD,
- 0xB05C, 0xB05C, 0x3EBA, 0xB05D, 0xB05D, 0x25B6, 0xB05E, 0xB05E, 0x3EBB,
- 0xB05F, 0xB05F, 0x21E3, 0xB060, 0xB061, 0x25B4, 0xB062, 0xB062, 0x222F,
- 0xB063, 0xB063, 0x2165, 0xB064, 0xB064, 0x25B7, 0xB065, 0xB06B, 0x3EBC,
- 0xB06C, 0xB06C, 0x1EE9, 0xB06D, 0xB07C, 0x3EC3, 0xB07D, 0xB07D, 0x1E25,
- 0xB07E, 0xB07E, 0x3ED3, 0xB080, 0xB096, 0x3ED4, 0xB097, 0xB097, 0x25C0,
- 0xB098, 0xB098, 0x3EEB, 0xB099, 0xB099, 0x229A, 0xB09A, 0xB0A0, 0x3EEC,
- 0xB0A1, 0xB0FE, 0x03AC, 0xB140, 0xB14A, 0x3EF3, 0xB14B, 0xB14B, 0x226E,
- 0xB14C, 0xB14C, 0x3EFE, 0xB14D, 0xB14D, 0x1FBD, 0xB14E, 0xB14E, 0x3EFF,
- 0xB14F, 0xB14F, 0x1F84, 0xB150, 0xB150, 0x20B2, 0xB151, 0xB151, 0x3F00,
- 0xB152, 0xB152, 0x2043, 0xB153, 0xB17E, 0x3F01, 0xB180, 0xB196, 0x3F2D,
- 0xB197, 0xB197, 0x2684, 0xB198, 0xB1A0, 0x3F44, 0xB1A1, 0xB1FE, 0x040A,
- 0xB240, 0xB240, 0x3F4D, 0xB241, 0xB241, 0x24EF, 0xB242, 0xB266, 0x3F4E,
- 0xB267, 0xB267, 0x24EE, 0xB268, 0xB26C, 0x3F73, 0xB26D, 0xB26D, 0x2074,
- 0xB26E, 0xB273, 0x3F78, 0xB274, 0xB274, 0x2687, 0xB275, 0xB27E, 0x3F7E,
- 0xB280, 0xB280, 0x24F0, 0xB281, 0xB288, 0x3F88, 0xB289, 0xB289, 0x268D,
- 0xB28A, 0xB299, 0x3F90, 0xB29A, 0xB29A, 0x22A0, 0xB29B, 0xB2A0, 0x3FA0,
- 0xB2A1, 0xB2FE, 0x0468, 0xB340, 0xB342, 0x3FA6, 0xB343, 0xB343, 0x1FAB,
- 0xB344, 0xB36F, 0x3FA9, 0xB370, 0xB370, 0x26A8, 0xB371, 0xB37E, 0x3FD5,
- 0xB380, 0xB387, 0x3FE3, 0xB388, 0xB388, 0x24E9, 0xB389, 0xB38B, 0x3FEB,
- 0xB38C, 0xB38C, 0x24E5, 0xB38D, 0xB38D, 0x3FEE, 0xB38E, 0xB38E, 0x21FA,
- 0xB38F, 0xB3A0, 0x3FEF, 0xB3A1, 0xB3FE, 0x04C6, 0xB440, 0xB453, 0x4001,
- 0xB454, 0xB454, 0x2148, 0xB455, 0xB457, 0x4015, 0xB458, 0xB458, 0x24E4,
- 0xB459, 0xB45D, 0x4018, 0xB45E, 0xB45E, 0x24E6, 0xB45F, 0xB45F, 0x20F7,
- 0xB460, 0xB460, 0x401D, 0xB461, 0xB461, 0x206B, 0xB462, 0xB474, 0x401E,
- 0xB475, 0xB475, 0x22A7, 0xB476, 0xB47D, 0x4031, 0xB47E, 0xB47E, 0x24EC,
- 0xB480, 0xB482, 0x4039, 0xB483, 0xB483, 0x24EB, 0xB484, 0xB488, 0x403C,
- 0xB489, 0xB489, 0x24E3, 0xB48A, 0xB492, 0x4041, 0xB493, 0xB493, 0x24EA,
- 0xB494, 0xB4A0, 0x404A, 0xB4A1, 0xB4FE, 0x0524, 0xB540, 0xB540, 0x4057,
- 0xB541, 0xB541, 0x1E92, 0xB542, 0xB54A, 0x4058, 0xB54B, 0xB54B, 0x1E27,
- 0xB54C, 0xB555, 0x4061, 0xB556, 0xB556, 0x1FE6, 0xB557, 0xB559, 0x406B,
- 0xB55A, 0xB55A, 0x24E7, 0xB55B, 0xB55B, 0x2012, 0xB55C, 0xB55C, 0x1EEC,
- 0xB55D, 0xB560, 0x406E, 0xB561, 0xB561, 0x24E8, 0xB562, 0xB57E, 0x4072,
- 0xB580, 0xB59B, 0x408F, 0xB59C, 0xB59C, 0x1F66, 0xB59D, 0xB59D, 0x24DC,
- 0xB59E, 0xB5A0, 0x40AB, 0xB5A1, 0xB5FE, 0x0582, 0xB640, 0xB651, 0x40AE,
- 0xB652, 0xB652, 0x26A2, 0xB653, 0xB654, 0x40C0, 0xB655, 0xB655, 0x24DD,
- 0xB656, 0xB658, 0x40C2, 0xB659, 0xB659, 0x200E, 0xB65A, 0xB65A, 0x40C5,
- 0xB65B, 0xB65B, 0x24DB, 0xB65C, 0xB65C, 0x1EB8, 0xB65D, 0xB67E, 0x40C6,
- 0xB680, 0xB6A0, 0x40E8, 0xB6A1, 0xB6FE, 0x05E0, 0xB740, 0xB74D, 0x4109,
- 0xB74E, 0xB74E, 0x2295, 0xB74F, 0xB750, 0x4117, 0xB751, 0xB751, 0x1E80,
- 0xB752, 0xB758, 0x4119, 0xB759, 0xB759, 0x2677, 0xB75A, 0xB763, 0x4120,
- 0xB764, 0xB764, 0x2624, 0xB765, 0xB765, 0x1F69, 0xB766, 0xB766, 0x222B,
- 0xB767, 0xB776, 0x412A, 0xB777, 0xB777, 0x257F, 0xB778, 0xB778, 0x1F5B,
- 0xB779, 0xB77E, 0x413A, 0xB780, 0xB780, 0x219B, 0xB781, 0xB781, 0x4140,
- 0xB782, 0xB782, 0x267D, 0xB783, 0xB7A0, 0x4141, 0xB7A1, 0xB7FE, 0x063E,
- 0xB840, 0xB842, 0x415F, 0xB843, 0xB843, 0x21A0, 0xB844, 0xB844, 0x2186,
- 0xB845, 0xB845, 0x4162, 0xB846, 0xB846, 0x20ED, 0xB847, 0xB84C, 0x4163,
- 0xB84D, 0xB84D, 0x25B9, 0xB84E, 0xB850, 0x4169, 0xB851, 0xB851, 0x1FEA,
- 0xB852, 0xB859, 0x416C, 0xB85A, 0xB85A, 0x1EA4, 0xB85B, 0xB85B, 0x20E1,
- 0xB85C, 0xB85C, 0x4174, 0xB85D, 0xB85D, 0x25B8, 0xB85E, 0xB85E, 0x2260,
- 0xB85F, 0xB85F, 0x4175, 0xB860, 0xB860, 0x20E2, 0xB861, 0xB876, 0x4176,
- 0xB877, 0xB877, 0x2141, 0xB878, 0xB87E, 0x418C, 0xB880, 0xB881, 0x4193,
- 0xB882, 0xB882, 0x1FC7, 0xB883, 0xB8A0, 0x4195, 0xB8A1, 0xB8FE, 0x069C,
- 0xB940, 0xB94F, 0x41B3, 0xB950, 0xB950, 0x1E41, 0xB951, 0xB960, 0x41C3,
- 0xB961, 0xB961, 0x25E4, 0xB962, 0xB97A, 0x41D3, 0xB97B, 0xB97B, 0x1F86,
- 0xB97C, 0xB97E, 0x41EC, 0xB980, 0xB99C, 0x41EF, 0xB99D, 0xB99D, 0x1FB3,
- 0xB99E, 0xB99F, 0x420C, 0xB9A0, 0xB9A0, 0x1EEF, 0xB9A1, 0xB9FE, 0x06FA,
- 0xBA40, 0xBA41, 0x420E, 0xBA42, 0xBA42, 0x22A4, 0xBA43, 0xBA43, 0x4210,
- 0xBA44, 0xBA44, 0x25E8, 0xBA45, 0xBA55, 0x4211, 0xBA56, 0xBA56, 0x25E3,
- 0xBA57, 0xBA58, 0x4222, 0xBA59, 0xBA59, 0x2111, 0xBA5A, 0xBA5F, 0x4224,
- 0xBA60, 0xBA60, 0x25E6, 0xBA61, 0xBA69, 0x422A, 0xBA6A, 0xBA6A, 0x25E7,
- 0xBA6B, 0xBA73, 0x4233, 0xBA74, 0xBA74, 0x2041, 0xBA75, 0xBA7E, 0x423C,
- 0xBA80, 0xBA83, 0x4246, 0xBA84, 0xBA84, 0x25EA, 0xBA85, 0xBA85, 0x424A,
- 0xBA86, 0xBA86, 0x1F8F, 0xBA87, 0xBA87, 0x424B, 0xBA88, 0xBA88, 0x25EC,
- 0xBA89, 0xBA8C, 0x424C, 0xBA8D, 0xBA8D, 0x25EB, 0xBA8E, 0xBA9D, 0x4250,
- 0xBA9E, 0xBA9E, 0x20D0, 0xBA9F, 0xBA9F, 0x201D, 0xBAA0, 0xBAA0, 0x4260,
- 0xBAA1, 0xBAFE, 0x0758, 0xBB40, 0xBB40, 0x1FF7, 0xBB41, 0xBB48, 0x4261,
- 0xBB49, 0xBB49, 0x1E8D, 0xBB4A, 0xBB57, 0x4269, 0xBB58, 0xBB58, 0x25E9,
- 0xBB59, 0xBB5A, 0x4277, 0xBB5B, 0xBB5B, 0x25EE, 0xBB5C, 0xBB5C, 0x203A,
- 0xBB5D, 0xBB5F, 0x4279, 0xBB60, 0xBB60, 0x2693, 0xBB61, 0xBB64, 0x427C,
- 0xBB65, 0xBB65, 0x25E5, 0xBB66, 0xBB66, 0x25ED, 0xBB67, 0xBB67, 0x4280,
- 0xBB68, 0xBB68, 0x2009, 0xBB69, 0xBB69, 0x4281, 0xBB6A, 0xBB6A, 0x2065,
- 0xBB6B, 0xBB6D, 0x4282, 0xBB6E, 0xBB6E, 0x26A3, 0xBB6F, 0xBB7E, 0x4285,
- 0xBB80, 0xBBA0, 0x4295, 0xBBA1, 0xBBFE, 0x07B6, 0xBC40, 0xBC51, 0x42B6,
- 0xBC52, 0xBC52, 0x25F5, 0xBC53, 0xBC53, 0x1EFC, 0xBC54, 0xBC59, 0x42C8,
- 0xBC5A, 0xBC5A, 0x2024, 0xBC5B, 0xBC60, 0x42CE, 0xBC61, 0xBC61, 0x269B,
- 0xBC62, 0xBC62, 0x42D4, 0xBC63, 0xBC63, 0x25F3, 0xBC64, 0xBC64, 0x42D5,
- 0xBC65, 0xBC65, 0x22D9, 0xBC66, 0xBC66, 0x42D6, 0xBC67, 0xBC67, 0x25F4,
- 0xBC68, 0xBC68, 0x42D7, 0xBC69, 0xBC69, 0x241B, 0xBC6A, 0xBC6C, 0x42D8,
- 0xBC6D, 0xBC6D, 0x1FC8, 0xBC6E, 0xBC6E, 0x42DB, 0xBC6F, 0xBC6F, 0x1F7B,
- 0xBC70, 0xBC70, 0x42DC, 0xBC71, 0xBC71, 0x241D, 0xBC72, 0xBC72, 0x42DD,
- 0xBC73, 0xBC73, 0x224C, 0xBC74, 0xBC74, 0x1F48, 0xBC75, 0xBC75, 0x241C,
- 0xBC76, 0xBC77, 0x241E, 0xBC78, 0xBC78, 0x20FF, 0xBC79, 0xBC79, 0x219A,
- 0xBC7A, 0xBC7A, 0x42DE, 0xBC7B, 0xBC7B, 0x2091, 0xBC7C, 0xBC7D, 0x42DF,
- 0xBC7E, 0xBC7E, 0x20A7, 0xBC80, 0xBC81, 0x42E1, 0xBC82, 0xBC82, 0x2423,
- 0xBC83, 0xBC83, 0x1E9B, 0xBC84, 0xBC84, 0x2422, 0xBC85, 0xBC85, 0x42E3,
- 0xBC86, 0xBC86, 0x2110, 0xBC87, 0xBC87, 0x42E4, 0xBC88, 0xBC88, 0x228D,
- 0xBC89, 0xBC89, 0x1F71, 0xBC8A, 0xBC8A, 0x1EF8, 0xBC8B, 0xBC8B, 0x2421,
- 0xBC8C, 0xBC8E, 0x42E5, 0xBC8F, 0xBC8F, 0x1EF3, 0xBC90, 0xBC99, 0x42E8,
- 0xBC9A, 0xBC9A, 0x21B1, 0xBC9B, 0xBC9B, 0x2426, 0xBC9C, 0xBC9C, 0x2425,
- 0xBC9D, 0xBC9D, 0x2120, 0xBC9E, 0xBCA0, 0x42F2, 0xBCA1, 0xBCFE, 0x0814,
- 0xBD40, 0xBD41, 0x42F5, 0xBD42, 0xBD42, 0x211A, 0xBD43, 0xBD43, 0x2424,
- 0xBD44, 0xBD44, 0x42F7, 0xBD45, 0xBD45, 0x2428, 0xBD46, 0xBD47, 0x42F8,
- 0xBD48, 0xBD48, 0x242A, 0xBD49, 0xBD49, 0x2429, 0xBD4A, 0xBD4A, 0x42FA,
- 0xBD4B, 0xBD4B, 0x2294, 0xBD4C, 0xBD4C, 0x42FB, 0xBD4D, 0xBD4D, 0x22BE,
- 0xBD4E, 0xBD4E, 0x42FC, 0xBD4F, 0xBD4F, 0x1E31, 0xBD50, 0xBD56, 0x42FD,
- 0xBD57, 0xBD57, 0x242C, 0xBD58, 0xBD58, 0x4304, 0xBD59, 0xBD59, 0x1FB5,
- 0xBD5A, 0xBD65, 0x4305, 0xBD66, 0xBD66, 0x242B, 0xBD67, 0xBD67, 0x1FAF,
- 0xBD68, 0xBD69, 0x4311, 0xBD6A, 0xBD6A, 0x2068, 0xBD6B, 0xBD6B, 0x21E4,
- 0xBD6C, 0xBD6E, 0x4313, 0xBD6F, 0xBD6F, 0x1F21, 0xBD70, 0xBD70, 0x4316,
- 0xBD71, 0xBD71, 0x2101, 0xBD72, 0xBD78, 0x4317, 0xBD79, 0xBD79, 0x217C,
- 0xBD7A, 0xBD7A, 0x214A, 0xBD7B, 0xBD7B, 0x242D, 0xBD7C, 0xBD7D, 0x431E,
- 0xBD7E, 0xBD7E, 0x1FD4, 0xBD80, 0xBD80, 0x4320, 0xBD81, 0xBD81, 0x1FD1,
- 0xBD82, 0xBD88, 0x4321, 0xBD89, 0xBD89, 0x1E33, 0xBD8A, 0xBD8A, 0x4328,
- 0xBD8B, 0xBD8B, 0x242F, 0xBD8C, 0xBD8D, 0x4329, 0xBD8E, 0xBD8E, 0x242E,
- 0xBD8F, 0xBD8F, 0x432B, 0xBD90, 0xBD90, 0x2430, 0xBD91, 0xBD91, 0x21DB,
- 0xBD92, 0xBD96, 0x432C, 0xBD97, 0xBD97, 0x2158, 0xBD98, 0xBD9A, 0x4331,
- 0xBD9B, 0xBD9B, 0x1FC2, 0xBD9C, 0xBDA0, 0x4334, 0xBDA1, 0xBDFE, 0x0872,
- 0xBE40, 0xBE42, 0x4339, 0xBE43, 0xBE43, 0x22B9, 0xBE44, 0xBE44, 0x433C,
- 0xBE45, 0xBE45, 0x2436, 0xBE46, 0xBE48, 0x433D, 0xBE49, 0xBE49, 0x1E8E,
- 0xBE4A, 0xBE4A, 0x2439, 0xBE4B, 0xBE50, 0x4340, 0xBE51, 0xBE51, 0x21C5,
- 0xBE52, 0xBE52, 0x2437, 0xBE53, 0xBE53, 0x2192, 0xBE54, 0xBE54, 0x4346,
- 0xBE55, 0xBE55, 0x243A, 0xBE56, 0xBE56, 0x1F19, 0xBE57, 0xBE57, 0x218C,
- 0xBE58, 0xBE58, 0x1E40, 0xBE59, 0xBE59, 0x22B3, 0xBE5A, 0xBE5C, 0x4347,
- 0xBE5D, 0xBE5D, 0x205F, 0xBE5E, 0xBE5E, 0x2438, 0xBE5F, 0xBE5F, 0x2432,
- 0xBE60, 0xBE60, 0x2274, 0xBE61, 0xBE61, 0x434A, 0xBE62, 0xBE62, 0x1E9C,
- 0xBE63, 0xBE63, 0x2431, 0xBE64, 0xBE64, 0x2085, 0xBE65, 0xBE68, 0x434B,
- 0xBE69, 0xBE69, 0x2435, 0xBE6A, 0xBE6B, 0x434F, 0xBE6C, 0xBE6C, 0x243B,
- 0xBE6D, 0xBE6E, 0x4351, 0xBE6F, 0xBE6F, 0x1FB7, 0xBE70, 0xBE70, 0x2433,
- 0xBE71, 0xBE75, 0x4353, 0xBE76, 0xBE76, 0x2054, 0xBE77, 0xBE77, 0x21DE,
- 0xBE78, 0xBE78, 0x4358, 0xBE79, 0xBE79, 0x2434, 0xBE7A, 0xBE7B, 0x4359,
- 0xBE7C, 0xBE7C, 0x243D, 0xBE7D, 0xBE7D, 0x1F89, 0xBE7E, 0xBE7E, 0x243C,
- 0xBE80, 0xBE82, 0x435B, 0xBE83, 0xBE83, 0x1F6E, 0xBE84, 0xBE84, 0x1ED8,
- 0xBE85, 0xBE85, 0x435E, 0xBE86, 0xBE86, 0x1EBF, 0xBE87, 0xBE87, 0x2445,
- 0xBE88, 0xBE88, 0x435F, 0xBE89, 0xBE89, 0x2249, 0xBE8A, 0xBE8B, 0x4360,
- 0xBE8C, 0xBE8C, 0x2441, 0xBE8D, 0xBE8D, 0x4362, 0xBE8E, 0xBE8E, 0x1E47,
- 0xBE8F, 0xBE8F, 0x1F56, 0xBE90, 0xBE91, 0x4363, 0xBE92, 0xBE92, 0x2086,
- 0xBE93, 0xBE94, 0x4365, 0xBE95, 0xBE95, 0x2196, 0xBE96, 0xBE96, 0x4367,
- 0xBE97, 0xBE97, 0x2443, 0xBE98, 0xBE98, 0x243F, 0xBE99, 0xBE99, 0x4368,
- 0xBE9A, 0xBE9A, 0x2023, 0xBE9B, 0xBE9B, 0x4369, 0xBE9C, 0xBE9C, 0x2442,
- 0xBE9D, 0xBE9E, 0x436A, 0xBE9F, 0xBE9F, 0x243E, 0xBEA0, 0xBEA0, 0x436C,
- 0xBEA1, 0xBEFE, 0x08D0, 0xBF40, 0xBF40, 0x26A6, 0xBF41, 0xBF4C, 0x436D,
- 0xBF4D, 0xBF4D, 0x234E, 0xBF4E, 0xBF4E, 0x2446, 0xBF4F, 0xBF4F, 0x244B,
- 0xBF50, 0xBF50, 0x2444, 0xBF51, 0xBF54, 0x4379, 0xBF55, 0xBF55, 0x2427,
- 0xBF56, 0xBF56, 0x244C, 0xBF57, 0xBF5F, 0x437D, 0xBF60, 0xBF60, 0x1F0F,
- 0xBF61, 0xBF61, 0x4386, 0xBF62, 0xBF62, 0x2447, 0xBF63, 0xBF63, 0x2449,
- 0xBF64, 0xBF64, 0x2448, 0xBF65, 0xBF67, 0x4387, 0xBF68, 0xBF68, 0x21C2,
- 0xBF69, 0xBF6B, 0x438A, 0xBF6C, 0xBF6C, 0x216E, 0xBF6D, 0xBF6F, 0x438D,
- 0xBF70, 0xBF70, 0x1F03, 0xBF71, 0xBF71, 0x4390, 0xBF72, 0xBF72, 0x244A,
- 0xBF73, 0xBF73, 0x215C, 0xBF74, 0xBF75, 0x4391, 0xBF76, 0xBF76, 0x22BB,
- 0xBF77, 0xBF77, 0x2450, 0xBF78, 0xBF78, 0x4393, 0xBF79, 0xBF79, 0x2694,
- 0xBF7A, 0xBF7A, 0x244F, 0xBF7B, 0xBF7B, 0x25F6, 0xBF7C, 0xBF7C, 0x2051,
- 0xBF7D, 0xBF7D, 0x4394, 0xBF7E, 0xBF7E, 0x244E, 0xBF80, 0xBF81, 0x4395,
- 0xBF82, 0xBF82, 0x22BA, 0xBF83, 0xBF83, 0x1F6D, 0xBF84, 0xBF88, 0x4397,
- 0xBF89, 0xBF89, 0x2452, 0xBF8A, 0xBF8A, 0x2451, 0xBF8B, 0xBF94, 0x439C,
- 0xBF95, 0xBF95, 0x2455, 0xBF96, 0xBF96, 0x43A6, 0xBF97, 0xBF97, 0x2289,
- 0xBF98, 0xBF98, 0x2116, 0xBF99, 0xBF9C, 0x43A7, 0xBF9D, 0xBF9D, 0x2454,
- 0xBF9E, 0xBFA0, 0x43AB, 0xBFA1, 0xBFFE, 0x092E, 0xC040, 0xC040, 0x20FB,
- 0xC041, 0xC043, 0x43AE, 0xC044, 0xC044, 0x2440, 0xC045, 0xC04A, 0x43B1,
- 0xC04B, 0xC04B, 0x2126, 0xC04C, 0xC04C, 0x1F61, 0xC04D, 0xC04D, 0x269D,
- 0xC04E, 0xC04E, 0x43B7, 0xC04F, 0xC04F, 0x1F8A, 0xC050, 0xC050, 0x2456,
- 0xC051, 0xC051, 0x2459, 0xC052, 0xC052, 0x2458, 0xC053, 0xC054, 0x43B8,
- 0xC055, 0xC055, 0x1FAE, 0xC056, 0xC05A, 0x43BA, 0xC05B, 0xC05B, 0x221A,
- 0xC05C, 0xC05D, 0x43BF, 0xC05E, 0xC05E, 0x1F7A, 0xC05F, 0xC05F, 0x244D,
- 0xC060, 0xC060, 0x2457, 0xC061, 0xC068, 0x43C1, 0xC069, 0xC069, 0x2453,
- 0xC06A, 0xC06A, 0x43C9, 0xC06B, 0xC06B, 0x2420, 0xC06C, 0xC06C, 0x43CA,
- 0xC06D, 0xC06D, 0x21DF, 0xC06E, 0xC06E, 0x2685, 0xC06F, 0xC06F, 0x43CB,
- 0xC070, 0xC070, 0x1E6E, 0xC071, 0xC073, 0x43CC, 0xC074, 0xC074, 0x2224,
- 0xC075, 0xC075, 0x2670, 0xC076, 0xC076, 0x43CF, 0xC077, 0xC077, 0x21BA,
- 0xC078, 0xC078, 0x43D0, 0xC079, 0xC079, 0x245A, 0xC07A, 0xC07B, 0x43D1,
- 0xC07C, 0xC07C, 0x1FFF, 0xC07D, 0xC07E, 0x43D3, 0xC080, 0xC09A, 0x43D5,
- 0xC09B, 0xC09B, 0x25E2, 0xC09C, 0xC09C, 0x43F0, 0xC09D, 0xC09D, 0x269A,
- 0xC09E, 0xC0A0, 0x43F1, 0xC0A1, 0xC0FE, 0x098C, 0xC140, 0xC14F, 0x43F4,
- 0xC150, 0xC150, 0x1EEA, 0xC151, 0xC153, 0x4404, 0xC154, 0xC154, 0x1E2C,
- 0xC155, 0xC15E, 0x4407, 0xC15F, 0xC15F, 0x2062, 0xC160, 0xC160, 0x24F1,
- 0xC161, 0xC161, 0x4411, 0xC162, 0xC162, 0x24F2, 0xC163, 0xC174, 0x4412,
- 0xC175, 0xC175, 0x25F2, 0xC176, 0xC177, 0x4424, 0xC178, 0xC178, 0x2215,
- 0xC179, 0xC17E, 0x4426, 0xC180, 0xC194, 0x442C, 0xC195, 0xC195, 0x21AE,
- 0xC196, 0xC1A0, 0x4441, 0xC1A1, 0xC1FE, 0x09EA, 0xC240, 0xC24D, 0x444C,
- 0xC24E, 0xC24E, 0x20E0, 0xC24F, 0xC264, 0x445A, 0xC265, 0xC265, 0x25C2,
- 0xC266, 0xC266, 0x4470, 0xC267, 0xC267, 0x25C1, 0xC268, 0xC27C, 0x4471,
- 0xC27D, 0xC27D, 0x2128, 0xC27E, 0xC27E, 0x4486, 0xC280, 0xC283, 0x4487,
- 0xC284, 0xC284, 0x2199, 0xC285, 0xC292, 0x448B, 0xC293, 0xC293, 0x2017,
- 0xC294, 0xC294, 0x1EA0, 0xC295, 0xC295, 0x2125, 0xC296, 0xC296, 0x214D,
- 0xC297, 0xC297, 0x4499, 0xC298, 0xC298, 0x25C4, 0xC299, 0xC299, 0x209D,
- 0xC29A, 0xC29A, 0x228A, 0xC29B, 0xC29B, 0x449A, 0xC29C, 0xC29C, 0x25C3,
- 0xC29D, 0xC29F, 0x449B, 0xC2A0, 0xC2A0, 0x2179, 0xC2A1, 0xC2FE, 0x0A48,
- 0xC340, 0xC340, 0x2038, 0xC341, 0xC342, 0x449E, 0xC343, 0xC343, 0x2155,
- 0xC344, 0xC37A, 0x44A0, 0xC37B, 0xC37B, 0x21D2, 0xC37C, 0xC37E, 0x44D7,
- 0xC380, 0xC383, 0x44DA, 0xC384, 0xC384, 0x24C7, 0xC385, 0xC39A, 0x44DE,
- 0xC39B, 0xC39B, 0x2279, 0xC39C, 0xC3A0, 0x44F4, 0xC3A1, 0xC3FE, 0x0AA6,
- 0xC440, 0xC448, 0x44F9, 0xC449, 0xC449, 0x2123, 0xC44A, 0xC44B, 0x4502,
- 0xC44C, 0xC44C, 0x24C5, 0xC44D, 0xC453, 0x4504, 0xC454, 0xC454, 0x24C9,
- 0xC455, 0xC457, 0x450B, 0xC458, 0xC458, 0x2094, 0xC459, 0xC45A, 0x450E,
- 0xC45B, 0xC45B, 0x2296, 0xC45C, 0xC462, 0x4510, 0xC463, 0xC463, 0x1E77,
- 0xC464, 0xC476, 0x4517, 0xC477, 0xC477, 0x1F06, 0xC478, 0xC479, 0x452A,
- 0xC47A, 0xC47A, 0x1FA5, 0xC47B, 0xC47E, 0x452C, 0xC480, 0xC480, 0x4530,
- 0xC481, 0xC481, 0x2099, 0xC482, 0xC490, 0x4531, 0xC491, 0xC491, 0x1EAD,
- 0xC492, 0xC492, 0x24C8, 0xC493, 0xC493, 0x20A8, 0xC494, 0xC497, 0x4540,
- 0xC498, 0xC498, 0x201F, 0xC499, 0xC499, 0x4544, 0xC49A, 0xC49A, 0x20C5,
- 0xC49B, 0xC49B, 0x4545, 0xC49C, 0xC49C, 0x24CA, 0xC49D, 0xC4A0, 0x4546,
- 0xC4A1, 0xC4FE, 0x0B04, 0xC540, 0xC543, 0x454A, 0xC544, 0xC544, 0x1FF0,
- 0xC545, 0xC545, 0x454E, 0xC546, 0xC546, 0x24C6, 0xC547, 0xC54A, 0x454F,
- 0xC54B, 0xC54B, 0x225D, 0xC54C, 0xC54C, 0x22DE, 0xC54D, 0xC551, 0x4553,
- 0xC552, 0xC552, 0x202C, 0xC553, 0xC55E, 0x4558, 0xC55F, 0xC55F, 0x2161,
- 0xC560, 0xC562, 0x4564, 0xC563, 0xC563, 0x223B, 0xC564, 0xC564, 0x21D9,
- 0xC565, 0xC565, 0x1FCB, 0xC566, 0xC566, 0x1FC9, 0xC567, 0xC57E, 0x4567,
- 0xC580, 0xC592, 0x457F, 0xC593, 0xC593, 0x1E61, 0xC594, 0xC59B, 0x4592,
- 0xC59C, 0xC59C, 0x25EF, 0xC59D, 0xC59D, 0x459A, 0xC59E, 0xC59E, 0x1F98,
- 0xC59F, 0xC5A0, 0x459B, 0xC5A1, 0xC5FE, 0x0B62, 0xC640, 0xC640, 0x459D,
- 0xC641, 0xC641, 0x25F0, 0xC642, 0xC643, 0x459E, 0xC644, 0xC644, 0x1F88,
- 0xC645, 0xC646, 0x45A0, 0xC647, 0xC647, 0x21F8, 0xC648, 0xC662, 0x45A2,
- 0xC663, 0xC663, 0x2322, 0xC664, 0xC671, 0x45BD, 0xC672, 0xC672, 0x2336,
- 0xC673, 0xC67E, 0x45CB, 0xC680, 0xC6A0, 0x45D7, 0xC6A1, 0xC6FE, 0x0BC0,
- 0xC740, 0xC765, 0x45F8, 0xC766, 0xC766, 0x22AB, 0xC767, 0xC76E, 0x461E,
- 0xC76F, 0xC76F, 0x1FBF, 0xC770, 0xC775, 0x4626, 0xC776, 0xC776, 0x1F7D,
- 0xC777, 0xC77A, 0x462C, 0xC77B, 0xC77B, 0x2333, 0xC77C, 0xC77E, 0x4630,
- 0xC780, 0xC7A0, 0x4633, 0xC7A1, 0xC7FE, 0x0C1E, 0xC840, 0xC840, 0x4654,
- 0xC841, 0xC841, 0x1F4D, 0xC842, 0xC84E, 0x4655, 0xC84F, 0xC84F, 0x2334,
- 0xC850, 0xC851, 0x4662, 0xC852, 0xC852, 0x1FF1, 0xC853, 0xC865, 0x4664,
- 0xC866, 0xC866, 0x218B, 0xC867, 0xC86D, 0x4677, 0xC86E, 0xC86E, 0x2349,
- 0xC86F, 0xC87D, 0x467E, 0xC87E, 0xC87E, 0x220B, 0xC880, 0xC886, 0x468D,
- 0xC887, 0xC887, 0x2346, 0xC888, 0xC891, 0x4694, 0xC892, 0xC892, 0x2347,
- 0xC893, 0xC893, 0x469E, 0xC894, 0xC894, 0x2193, 0xC895, 0xC898, 0x469F,
- 0xC899, 0xC899, 0x26A1, 0xC89A, 0xC89C, 0x46A3, 0xC89D, 0xC89D, 0x1F62,
- 0xC89E, 0xC8A0, 0x46A6, 0xC8A1, 0xC8FE, 0x0C7C, 0xC940, 0xC94E, 0x46A9,
- 0xC94F, 0xC94F, 0x234D, 0xC950, 0xC950, 0x2348, 0xC951, 0xC96D, 0x46B8,
- 0xC96E, 0xC96E, 0x1E60, 0xC96F, 0xC96F, 0x46D5, 0xC970, 0xC970, 0x2345,
- 0xC971, 0xC976, 0x46D6, 0xC977, 0xC977, 0x1F12, 0xC978, 0xC97E, 0x46DC,
- 0xC980, 0xC98E, 0x46E3, 0xC98F, 0xC98F, 0x2018, 0xC990, 0xC990, 0x2335,
- 0xC991, 0xC99B, 0x46F2, 0xC99C, 0xC99C, 0x233C, 0xC99D, 0xC9A0, 0x46FD,
- 0xC9A1, 0xC9FE, 0x0CDA, 0xCA40, 0xCA4D, 0x4701, 0xCA4E, 0xCA4E, 0x266F,
- 0xCA4F, 0xCA55, 0x470F, 0xCA56, 0xCA56, 0x2351, 0xCA57, 0xCA58, 0x4716,
- 0xCA59, 0xCA59, 0x1FA0, 0xCA5A, 0xCA5B, 0x4718, 0xCA5C, 0xCA5C, 0x2338,
- 0xCA5D, 0xCA60, 0x471A, 0xCA61, 0xCA61, 0x221B, 0xCA62, 0xCA6D, 0x471E,
- 0xCA6E, 0xCA6E, 0x2342, 0xCA6F, 0xCA71, 0x472A, 0xCA72, 0xCA72, 0x234F,
- 0xCA73, 0xCA76, 0x472D, 0xCA77, 0xCA77, 0x233D, 0xCA78, 0xCA7A, 0x4731,
- 0xCA7B, 0xCA7B, 0x2344, 0xCA7C, 0xCA7C, 0x2331, 0xCA7D, 0xCA7D, 0x4734,
- 0xCA7E, 0xCA7E, 0x234B, 0xCA80, 0xCA80, 0x4735, 0xCA81, 0xCA81, 0x233B,
- 0xCA82, 0xCA88, 0x4736, 0xCA89, 0xCA89, 0x2350, 0xCA8A, 0xCA8D, 0x473D,
- 0xCA8E, 0xCA8E, 0x1EB4, 0xCA8F, 0xCA8F, 0x21A6, 0xCA90, 0xCA91, 0x4741,
- 0xCA92, 0xCA92, 0x21CB, 0xCA93, 0xCA99, 0x4743, 0xCA9A, 0xCA9A, 0x2355,
- 0xCA9B, 0xCAA0, 0x474A, 0xCAA1, 0xCAFE, 0x0D38, 0xCB40, 0xCB42, 0x4750,
- 0xCB43, 0xCB43, 0x233E, 0xCB44, 0xCB44, 0x4753, 0xCB45, 0xCB45, 0x1F74,
- 0xCB46, 0xCB46, 0x4754, 0xCB47, 0xCB47, 0x2330, 0xCB48, 0xCB4A, 0x4755,
- 0xCB4B, 0xCB4B, 0x2680, 0xCB4C, 0xCB4D, 0x4758, 0xCB4E, 0xCB4E, 0x20DA,
- 0xCB4F, 0xCB56, 0x475A, 0xCB57, 0xCB57, 0x234A, 0xCB58, 0xCB5C, 0x4762,
- 0xCB5D, 0xCB5D, 0x1F91, 0xCB5E, 0xCB5E, 0x4767, 0xCB5F, 0xCB5F, 0x2107,
- 0xCB60, 0xCB69, 0x4768, 0xCB6A, 0xCB6A, 0x233F, 0xCB6B, 0xCB7A, 0x4772,
- 0xCB7B, 0xCB7B, 0x1FF4, 0xCB7C, 0xCB7C, 0x2343, 0xCB7D, 0xCB7E, 0x4782,
- 0xCB80, 0xCB86, 0x4784, 0xCB87, 0xCB87, 0x2212, 0xCB88, 0xCB8D, 0x478B,
- 0xCB8E, 0xCB8E, 0x2207, 0xCB8F, 0xCB91, 0x4791, 0xCB92, 0xCB92, 0x2359,
- 0xCB93, 0xCB9B, 0x4794, 0xCB9C, 0xCB9C, 0x2254, 0xCB9D, 0xCB9D, 0x479D,
- 0xCB9E, 0xCB9E, 0x2332, 0xCB9F, 0xCBA0, 0x479E, 0xCBA1, 0xCBFE, 0x0D96,
- 0xCC40, 0xCC40, 0x1E26, 0xCC41, 0xCC41, 0x2357, 0xCC42, 0xCC48, 0x47A0,
- 0xCC49, 0xCC49, 0x2358, 0xCC4A, 0xCC4A, 0x2042, 0xCC4B, 0xCC4B, 0x2153,
- 0xCC4C, 0xCC4E, 0x47A7, 0xCC4F, 0xCC4F, 0x20BB, 0xCC50, 0xCC5B, 0x47AA,
- 0xCC5C, 0xCC5C, 0x235A, 0xCC5D, 0xCC5F, 0x47B6, 0xCC60, 0xCC60, 0x2356,
- 0xCC61, 0xCC63, 0x47B9, 0xCC64, 0xCC64, 0x2337, 0xCC65, 0xCC6C, 0x47BC,
- 0xCC6D, 0xCC6D, 0x1FF9, 0xCC6E, 0xCC78, 0x47C4, 0xCC79, 0xCC79, 0x2353,
- 0xCC7A, 0xCC7C, 0x47CF, 0xCC7D, 0xCC7D, 0x2061, 0xCC7E, 0xCC7E, 0x47D2,
- 0xCC80, 0xCC8D, 0x47D3, 0xCC8E, 0xCC8E, 0x1E95, 0xCC8F, 0xCC93, 0x47E1,
- 0xCC94, 0xCC94, 0x2049, 0xCC95, 0xCC95, 0x47E6, 0xCC96, 0xCC96, 0x1F42,
- 0xCC97, 0xCC9C, 0x47E7, 0xCC9D, 0xCC9D, 0x1FE8, 0xCC9E, 0xCCA0, 0x47ED,
- 0xCCA1, 0xCCFE, 0x0DF4, 0xCD40, 0xCD7E, 0x47F0, 0xCD80, 0xCD8F, 0x482F,
- 0xCD90, 0xCD90, 0x25DA, 0xCD91, 0xCD97, 0x483F, 0xCD98, 0xCD98, 0x25D7,
- 0xCD99, 0xCDA0, 0x4846, 0xCDA1, 0xCDFE, 0x0E52, 0xCE40, 0xCE66, 0x484E,
- 0xCE67, 0xCE67, 0x212E, 0xCE68, 0xCE71, 0x4875, 0xCE72, 0xCE72, 0x21B2,
- 0xCE73, 0xCE7E, 0x487F, 0xCE80, 0xCE80, 0x488B, 0xCE81, 0xCE81, 0x219E,
- 0xCE82, 0xCE86, 0x488C, 0xCE87, 0xCE87, 0x25DC, 0xCE88, 0xCE9A, 0x4891,
- 0xCE9B, 0xCE9B, 0x206C, 0xCE9C, 0xCE9D, 0x48A4, 0xCE9E, 0xCE9E, 0x2226,
- 0xCE9F, 0xCEA0, 0x48A6, 0xCEA1, 0xCEFE, 0x0EB0, 0xCF40, 0xCF4D, 0x48A8,
- 0xCF4E, 0xCF4E, 0x25E0, 0xCF4F, 0xCF54, 0x48B6, 0xCF55, 0xCF55, 0x227B,
- 0xCF56, 0xCF57, 0x48BC, 0xCF58, 0xCF58, 0x25DE, 0xCF59, 0xCF5B, 0x48BE,
- 0xCF5C, 0xCF5C, 0x25E1, 0xCF5D, 0xCF6B, 0x48C1, 0xCF6C, 0xCF6C, 0x25D5,
- 0xCF6D, 0xCF72, 0x48D0, 0xCF73, 0xCF73, 0x1E6B, 0xCF74, 0xCF74, 0x48D6,
- 0xCF75, 0xCF75, 0x25DB, 0xCF76, 0xCF77, 0x48D7, 0xCF78, 0xCF78, 0x1E89,
- 0xCF79, 0xCF7B, 0x48D9, 0xCF7C, 0xCF7C, 0x25D9, 0xCF7D, 0xCF7E, 0x48DC,
- 0xCF80, 0xCF80, 0x48DE, 0xCF81, 0xCF81, 0x2211, 0xCF82, 0xCF88, 0x48DF,
- 0xCF89, 0xCF89, 0x2229, 0xCF8A, 0xCF8A, 0x25D6, 0xCF8B, 0xCF92, 0x48E6,
- 0xCF93, 0xCF93, 0x25DD, 0xCF94, 0xCF94, 0x25DF, 0xCF95, 0xCF9D, 0x48EE,
- 0xCF9E, 0xCF9E, 0x1FEF, 0xCF9F, 0xCF9F, 0x48F7, 0xCFA0, 0xCFA0, 0x25D8,
- 0xCFA1, 0xCFFE, 0x0F0E, 0xD040, 0xD04C, 0x48F8, 0xD04D, 0xD04D, 0x1F29,
- 0xD04E, 0xD050, 0x4905, 0xD051, 0xD051, 0x1E5B, 0xD052, 0xD054, 0x4908,
- 0xD055, 0xD055, 0x2076, 0xD056, 0xD05B, 0x490B, 0xD05C, 0xD05C, 0x2297,
- 0xD05D, 0xD05F, 0x4911, 0xD060, 0xD060, 0x2690, 0xD061, 0xD066, 0x4914,
- 0xD067, 0xD067, 0x213F, 0xD068, 0xD06B, 0x491A, 0xD06C, 0xD06C, 0x2198,
- 0xD06D, 0xD06D, 0x491E, 0xD06E, 0xD06E, 0x1E88, 0xD06F, 0xD07C, 0x491F,
- 0xD07D, 0xD07D, 0x228C, 0xD07E, 0xD07E, 0x492D, 0xD080, 0xD0A0, 0x492E,
- 0xD0A1, 0xD0FE, 0x0F6C, 0xD140, 0xD154, 0x494F, 0xD155, 0xD155, 0x25F1,
- 0xD156, 0xD158, 0x4964, 0xD159, 0xD159, 0x200C, 0xD15A, 0xD160, 0x4967,
- 0xD161, 0xD161, 0x1E58, 0xD162, 0xD162, 0x22AC, 0xD163, 0xD174, 0x496E,
- 0xD175, 0xD175, 0x26A7, 0xD176, 0xD17C, 0x4980, 0xD17D, 0xD17D, 0x2676,
- 0xD17E, 0xD17E, 0x4987, 0xD180, 0xD19C, 0x4988, 0xD19D, 0xD19D, 0x1FE1,
- 0xD19E, 0xD19E, 0x25BB, 0xD19F, 0xD1A0, 0x49A5, 0xD1A1, 0xD1FE, 0x0FCA,
- 0xD240, 0xD240, 0x25BE, 0xD241, 0xD242, 0x49A7, 0xD243, 0xD243, 0x22DD,
- 0xD244, 0xD24C, 0x49A9, 0xD24D, 0xD24D, 0x25BD, 0xD24E, 0xD25B, 0x49B2,
- 0xD25C, 0xD25C, 0x1E2A, 0xD25D, 0xD262, 0x49C0, 0xD263, 0xD263, 0x25BC,
- 0xD264, 0xD264, 0x25BA, 0xD265, 0xD267, 0x49C6, 0xD268, 0xD268, 0x25BF,
- 0xD269, 0xD26C, 0x49C9, 0xD26D, 0xD26D, 0x2187, 0xD26E, 0xD26E, 0x49CD,
- 0xD26F, 0xD26F, 0x266B, 0xD270, 0xD271, 0x49CE, 0xD272, 0xD272, 0x1E7F,
- 0xD273, 0xD274, 0x49D0, 0xD275, 0xD275, 0x21AD, 0xD276, 0xD27E, 0x49D2,
- 0xD280, 0xD289, 0x49DB, 0xD28A, 0xD28A, 0x1F96, 0xD28B, 0xD28D, 0x49E5,
- 0xD28E, 0xD28E, 0x1F32, 0xD28F, 0xD291, 0x49E8, 0xD292, 0xD292, 0x2084,
- 0xD293, 0xD294, 0x49EB, 0xD295, 0xD295, 0x2136, 0xD296, 0xD296, 0x49ED,
- 0xD297, 0xD297, 0x24B8, 0xD298, 0xD29F, 0x49EE, 0xD2A0, 0xD2A0, 0x24BA,
- 0xD2A1, 0xD2FE, 0x1028, 0xD340, 0xD343, 0x49F6, 0xD344, 0xD344, 0x24BC,
- 0xD345, 0xD347, 0x49FA, 0xD348, 0xD348, 0x20E4, 0xD349, 0xD349, 0x49FD,
- 0xD34A, 0xD34A, 0x24B9, 0xD34B, 0xD34C, 0x49FE, 0xD34D, 0xD34D, 0x24BD,
- 0xD34E, 0xD34F, 0x4A00, 0xD350, 0xD350, 0x24BE, 0xD351, 0xD354, 0x4A02,
- 0xD355, 0xD355, 0x24BF, 0xD356, 0xD357, 0x4A06, 0xD358, 0xD358, 0x1FD2,
- 0xD359, 0xD35A, 0x4A08, 0xD35B, 0xD35B, 0x1FFD, 0xD35C, 0xD35C, 0x4A0A,
- 0xD35D, 0xD35D, 0x24BB, 0xD35E, 0xD35E, 0x1F2D, 0xD35F, 0xD377, 0x4A0B,
- 0xD378, 0xD378, 0x2609, 0xD379, 0xD379, 0x4A24, 0xD37A, 0xD37A, 0x260A,
- 0xD37B, 0xD37B, 0x4A25, 0xD37C, 0xD37C, 0x1E94, 0xD37D, 0xD37E, 0x4A26,
- 0xD380, 0xD384, 0x4A28, 0xD385, 0xD385, 0x22DF, 0xD386, 0xD386, 0x1ECB,
- 0xD387, 0xD387, 0x1F0D, 0xD388, 0xD38A, 0x4A2D, 0xD38B, 0xD38B, 0x1F77,
- 0xD38C, 0xD38C, 0x4A30, 0xD38D, 0xD38D, 0x21EB, 0xD38E, 0xD38E, 0x4A31,
- 0xD38F, 0xD38F, 0x22E1, 0xD390, 0xD390, 0x4A32, 0xD391, 0xD391, 0x216F,
- 0xD392, 0xD392, 0x4A33, 0xD393, 0xD393, 0x22E0, 0xD394, 0xD395, 0x4A34,
- 0xD396, 0xD396, 0x21EA, 0xD397, 0xD397, 0x4A36, 0xD398, 0xD398, 0x22E2,
- 0xD399, 0xD399, 0x20CB, 0xD39A, 0xD39A, 0x4A37, 0xD39B, 0xD39B, 0x1F78,
- 0xD39C, 0xD39D, 0x4A38, 0xD39E, 0xD39E, 0x1EE2, 0xD39F, 0xD39F, 0x4A3A,
- 0xD3A0, 0xD3A0, 0x21F2, 0xD3A1, 0xD3FE, 0x1086, 0xD440, 0xD440, 0x4A3B,
- 0xD441, 0xD441, 0x2150, 0xD442, 0xD444, 0x4A3C, 0xD445, 0xD445, 0x1FD3,
- 0xD446, 0xD446, 0x4A3F, 0xD447, 0xD447, 0x22E5, 0xD448, 0xD44B, 0x4A40,
- 0xD44C, 0xD44C, 0x1EF2, 0xD44D, 0xD44E, 0x4A44, 0xD44F, 0xD44F, 0x211F,
- 0xD450, 0xD452, 0x4A46, 0xD453, 0xD453, 0x21DD, 0xD454, 0xD455, 0x4A49,
- 0xD456, 0xD456, 0x2154, 0xD457, 0xD457, 0x4A4B, 0xD458, 0xD458, 0x22E7,
- 0xD459, 0xD45B, 0x4A4C, 0xD45C, 0xD45C, 0x2282, 0xD45D, 0xD461, 0x4A4F,
- 0xD462, 0xD462, 0x22E6, 0xD463, 0xD466, 0x4A54, 0xD467, 0xD467, 0x22E8,
- 0xD468, 0xD46D, 0x4A58, 0xD46E, 0xD46E, 0x22E4, 0xD46F, 0xD46F, 0x4A5E,
- 0xD470, 0xD470, 0x226A, 0xD471, 0xD471, 0x4A5F, 0xD472, 0xD472, 0x22EB,
- 0xD473, 0xD473, 0x4A60, 0xD474, 0xD474, 0x22E9, 0xD475, 0xD475, 0x20BD,
- 0xD476, 0xD477, 0x4A61, 0xD478, 0xD478, 0x22EA, 0xD479, 0xD47A, 0x4A63,
- 0xD47B, 0xD47B, 0x22BD, 0xD47C, 0xD47D, 0x4A65, 0xD47E, 0xD47E, 0x1E9E,
- 0xD480, 0xD481, 0x4A67, 0xD482, 0xD482, 0x22F6, 0xD483, 0xD483, 0x21E7,
- 0xD484, 0xD484, 0x2216, 0xD485, 0xD486, 0x4A69, 0xD487, 0xD487, 0x2137,
- 0xD488, 0xD489, 0x4A6B, 0xD48A, 0xD48A, 0x212C, 0xD48B, 0xD48B, 0x4A6D,
- 0xD48C, 0xD48C, 0x1E68, 0xD48D, 0xD48D, 0x22F2, 0xD48E, 0xD48E, 0x1F37,
- 0xD48F, 0xD48F, 0x22F3, 0xD490, 0xD490, 0x4A6E, 0xD491, 0xD491, 0x22EF,
- 0xD492, 0xD492, 0x1F50, 0xD493, 0xD493, 0x1F10, 0xD494, 0xD494, 0x21C8,
- 0xD495, 0xD495, 0x4A6F, 0xD496, 0xD496, 0x22F1, 0xD497, 0xD49B, 0x4A70,
- 0xD49C, 0xD49C, 0x22F0, 0xD49D, 0xD49E, 0x4A75, 0xD49F, 0xD49F, 0x22EE,
- 0xD4A0, 0xD4A0, 0x4A77, 0xD4A1, 0xD4FE, 0x10E4, 0xD540, 0xD542, 0x4A78,
- 0xD543, 0xD543, 0x22ED, 0xD544, 0xD544, 0x229E, 0xD545, 0xD545, 0x22EC,
- 0xD546, 0xD546, 0x1FE2, 0xD547, 0xD549, 0x4A7B, 0xD54A, 0xD54A, 0x20FE,
- 0xD54B, 0xD54D, 0x4A7E, 0xD54E, 0xD54F, 0x22F9, 0xD550, 0xD550, 0x4A81,
- 0xD551, 0xD551, 0x1EAF, 0xD552, 0xD553, 0x4A82, 0xD554, 0xD554, 0x2236,
- 0xD555, 0xD555, 0x4A84, 0xD556, 0xD556, 0x22F7, 0xD557, 0xD559, 0x4A85,
- 0xD55A, 0xD55A, 0x223D, 0xD55B, 0xD55B, 0x4A88, 0xD55C, 0xD55C, 0x1E82,
- 0xD55D, 0xD55D, 0x1FB6, 0xD55E, 0xD55E, 0x4A89, 0xD55F, 0xD55F, 0x21A4,
- 0xD560, 0xD560, 0x21AA, 0xD561, 0xD561, 0x22F8, 0xD562, 0xD562, 0x2151,
- 0xD563, 0xD563, 0x4A8A, 0xD564, 0xD564, 0x1F60, 0xD565, 0xD567, 0x4A8B,
- 0xD568, 0xD568, 0x2147, 0xD569, 0xD56B, 0x4A8E, 0xD56C, 0xD56C, 0x2145,
- 0xD56D, 0xD56D, 0x4A91, 0xD56E, 0xD56E, 0x1FDC, 0xD56F, 0xD571, 0x4A92,
- 0xD572, 0xD572, 0x2301, 0xD573, 0xD574, 0x4A95, 0xD575, 0xD575, 0x1EF5,
- 0xD576, 0xD577, 0x4A97, 0xD578, 0xD578, 0x2218, 0xD579, 0xD57A, 0x4A99,
- 0xD57B, 0xD57B, 0x1EC6, 0xD57C, 0xD57D, 0x4A9B, 0xD57E, 0xD57E, 0x2300,
- 0xD580, 0xD580, 0x4A9D, 0xD581, 0xD581, 0x22B4, 0xD582, 0xD583, 0x4A9E,
- 0xD584, 0xD584, 0x2169, 0xD585, 0xD585, 0x4AA0, 0xD586, 0xD586, 0x22FD,
- 0xD587, 0xD587, 0x4AA1, 0xD588, 0xD588, 0x20EA, 0xD589, 0xD589, 0x4AA2,
- 0xD58A, 0xD58A, 0x22F4, 0xD58B, 0xD58B, 0x4AA3, 0xD58C, 0xD58C, 0x22FB,
- 0xD58D, 0xD58D, 0x4AA4, 0xD58E, 0xD58E, 0x22FC, 0xD58F, 0xD58F, 0x2027,
- 0xD590, 0xD592, 0x4AA5, 0xD593, 0xD593, 0x2060, 0xD594, 0xD594, 0x22FF,
- 0xD595, 0xD597, 0x4AA8, 0xD598, 0xD598, 0x22FE, 0xD599, 0xD599, 0x1EC7,
- 0xD59A, 0xD59A, 0x4AAB, 0xD59B, 0xD59B, 0x230C, 0xD59C, 0xD59E, 0x4AAC,
- 0xD59F, 0xD59F, 0x22F5, 0xD5A0, 0xD5A0, 0x4AAF, 0xD5A1, 0xD5FE, 0x1142,
- 0xD640, 0xD640, 0x2306, 0xD641, 0xD641, 0x4AB0, 0xD642, 0xD642, 0x230A,
- 0xD643, 0xD643, 0x21D3, 0xD644, 0xD646, 0x4AB1, 0xD647, 0xD647, 0x2303,
- 0xD648, 0xD648, 0x4AB4, 0xD649, 0xD649, 0x2307, 0xD64A, 0xD64A, 0x230B,
- 0xD64B, 0xD64C, 0x4AB5, 0xD64D, 0xD64D, 0x1F5F, 0xD64E, 0xD64E, 0x4AB7,
- 0xD64F, 0xD64F, 0x2309, 0xD650, 0xD651, 0x4AB8, 0xD652, 0xD652, 0x2302,
- 0xD653, 0xD653, 0x1F04, 0xD654, 0xD654, 0x229D, 0xD655, 0xD655, 0x4ABA,
- 0xD656, 0xD656, 0x21FB, 0xD657, 0xD657, 0x4ABB, 0xD658, 0xD658, 0x2308,
- 0xD659, 0xD659, 0x4ABC, 0xD65A, 0xD65A, 0x20AC, 0xD65B, 0xD65B, 0x4ABD,
- 0xD65C, 0xD65C, 0x208E, 0xD65D, 0xD65D, 0x2305, 0xD65E, 0xD65E, 0x2197,
- 0xD65F, 0xD65F, 0x4ABE, 0xD660, 0xD660, 0x2171, 0xD661, 0xD661, 0x2298,
- 0xD662, 0xD664, 0x4ABF, 0xD665, 0xD665, 0x1F57, 0xD666, 0xD668, 0x4AC2,
- 0xD669, 0xD669, 0x2082, 0xD66A, 0xD66A, 0x4AC5, 0xD66B, 0xD66B, 0x2311,
- 0xD66C, 0xD66E, 0x4AC6, 0xD66F, 0xD66F, 0x2304, 0xD670, 0xD670, 0x4AC9,
- 0xD671, 0xD671, 0x230F, 0xD672, 0xD672, 0x1E35, 0xD673, 0xD673, 0x4ACA,
- 0xD674, 0xD674, 0x20D1, 0xD675, 0xD675, 0x2310, 0xD676, 0xD676, 0x1FA3,
- 0xD677, 0xD677, 0x4ACB, 0xD678, 0xD678, 0x21D6, 0xD679, 0xD67B, 0x4ACC,
- 0xD67C, 0xD67C, 0x2206, 0xD67D, 0xD67E, 0x4ACF, 0xD680, 0xD682, 0x4AD1,
- 0xD683, 0xD683, 0x230D, 0xD684, 0xD685, 0x4AD4, 0xD686, 0xD686, 0x2312,
- 0xD687, 0xD687, 0x208D, 0xD688, 0xD688, 0x2313, 0xD689, 0xD68D, 0x4AD6,
- 0xD68E, 0xD68E, 0x22E3, 0xD68F, 0xD693, 0x4ADB, 0xD694, 0xD694, 0x1FBA,
- 0xD695, 0xD698, 0x4AE0, 0xD699, 0xD699, 0x2078, 0xD69A, 0xD6A0, 0x4AE4,
- 0xD6A1, 0xD6FE, 0x11A0, 0xD740, 0xD742, 0x4AEB, 0xD743, 0xD743, 0x2288,
- 0xD744, 0xD747, 0x4AEE, 0xD748, 0xD748, 0x2316, 0xD749, 0xD749, 0x1F6B,
- 0xD74A, 0xD74F, 0x4AF2, 0xD750, 0xD750, 0x2314, 0xD751, 0xD751, 0x4AF8,
- 0xD752, 0xD752, 0x2130, 0xD753, 0xD753, 0x2315, 0xD754, 0xD754, 0x2168,
- 0xD755, 0xD755, 0x4AF9, 0xD756, 0xD756, 0x20C4, 0xD757, 0xD763, 0x4AFA,
- 0xD764, 0xD764, 0x2318, 0xD765, 0xD766, 0x4B07, 0xD767, 0xD767, 0x2219,
- 0xD768, 0xD768, 0x2217, 0xD769, 0xD76B, 0x4B09, 0xD76C, 0xD76C, 0x20D5,
- 0xD76D, 0xD76E, 0x4B0C, 0xD76F, 0xD76F, 0x1F4A, 0xD770, 0xD774, 0x4B0E,
- 0xD775, 0xD775, 0x2240, 0xD776, 0xD777, 0x4B13, 0xD778, 0xD778, 0x1ED3,
- 0xD779, 0xD77E, 0x4B15, 0xD780, 0xD782, 0x4B1B, 0xD783, 0xD783, 0x1E49,
- 0xD784, 0xD786, 0x4B1E, 0xD787, 0xD787, 0x261B, 0xD788, 0xD78A, 0x4B21,
- 0xD78B, 0xD78B, 0x1E6D, 0xD78C, 0xD78C, 0x20F8, 0xD78D, 0xD78D, 0x4B24,
- 0xD78E, 0xD78E, 0x1FFB, 0xD78F, 0xD78F, 0x2319, 0xD790, 0xD794, 0x4B25,
- 0xD795, 0xD795, 0x230E, 0xD796, 0xD796, 0x4B2A, 0xD797, 0xD797, 0x2317,
- 0xD798, 0xD7A0, 0x4B2B, 0xD7A1, 0xD7F9, 0x11FE, 0xD840, 0xD84C, 0x4B34,
- 0xD84D, 0xD84D, 0x20C8, 0xD84E, 0xD852, 0x4B41, 0xD853, 0xD853, 0x1EFD,
- 0xD854, 0xD87E, 0x4B46, 0xD880, 0xD88F, 0x4B71, 0xD890, 0xD890, 0x1E3B,
- 0xD891, 0xD891, 0x227F, 0xD892, 0xD892, 0x4B81, 0xD893, 0xD893, 0x1F0C,
- 0xD894, 0xD894, 0x1E59, 0xD895, 0xD895, 0x1F24, 0xD896, 0xD899, 0x4B82,
- 0xD89A, 0xD89A, 0x20BA, 0xD89B, 0xD89B, 0x1F65, 0xD89C, 0xD89C, 0x1EF0,
- 0xD89D, 0xD89D, 0x2164, 0xD89E, 0xD89E, 0x1F30, 0xD89F, 0xD89F, 0x2261,
- 0xD8A0, 0xD8A0, 0x4B86, 0xD8A1, 0xD8FE, 0x1257, 0xD940, 0xD940, 0x4B87,
- 0xD941, 0xD941, 0x22A2, 0xD942, 0xD942, 0x24AB, 0xD943, 0xD943, 0x4B88,
- 0xD944, 0xD944, 0x24AF, 0xD945, 0xD945, 0x1EE8, 0xD946, 0xD946, 0x1F39,
- 0xD947, 0xD947, 0x4B89, 0xD948, 0xD948, 0x1E48, 0xD949, 0xD949, 0x2070,
- 0xD94A, 0xD94A, 0x1EA8, 0xD94B, 0xD94B, 0x4B8A, 0xD94C, 0xD94C, 0x24AC,
- 0xD94D, 0xD94D, 0x1EF7, 0xD94E, 0xD94E, 0x2176, 0xD94F, 0xD94F, 0x24AD,
- 0xD950, 0xD950, 0x4B8B, 0xD951, 0xD951, 0x207B, 0xD952, 0xD952, 0x1F45,
- 0xD953, 0xD953, 0x24AA, 0xD954, 0xD954, 0x204B, 0xD955, 0xD955, 0x202F,
- 0xD956, 0xD956, 0x1F5A, 0xD957, 0xD957, 0x24B0, 0xD958, 0xD958, 0x4B8C,
- 0xD959, 0xD959, 0x22B7, 0xD95A, 0xD95A, 0x1F7F, 0xD95B, 0xD95B, 0x4B8D,
- 0xD95C, 0xD95C, 0x2265, 0xD95D, 0xD962, 0x4B8E, 0xD963, 0xD963, 0x24B2,
- 0xD964, 0xD964, 0x211B, 0xD965, 0xD965, 0x1E51, 0xD966, 0xD966, 0x4B94,
- 0xD967, 0xD967, 0x24B4, 0xD968, 0xD96B, 0x4B95, 0xD96C, 0xD96C, 0x24B3,
- 0xD96D, 0xD96D, 0x4B99, 0xD96E, 0xD96E, 0x1E9F, 0xD96F, 0xD96F, 0x4B9A,
- 0xD970, 0xD970, 0x2118, 0xD971, 0xD971, 0x4B9B, 0xD972, 0xD972, 0x20B4,
- 0xD973, 0xD973, 0x23AF, 0xD974, 0xD974, 0x21BB, 0xD975, 0xD975, 0x2072,
- 0xD976, 0xD976, 0x1F95, 0xD977, 0xD977, 0x4B9C, 0xD978, 0xD978, 0x1F0A,
- 0xD979, 0xD979, 0x24B6, 0xD97A, 0xD97B, 0x4B9D, 0xD97C, 0xD97C, 0x2291,
- 0xD97D, 0xD97D, 0x24B5, 0xD97E, 0xD97E, 0x2278, 0xD980, 0xD980, 0x1ED4,
- 0xD981, 0xD986, 0x4B9F, 0xD987, 0xD987, 0x1FF3, 0xD988, 0xD98C, 0x4BA5,
- 0xD98D, 0xD98D, 0x22A9, 0xD98E, 0xD98E, 0x24B7, 0xD98F, 0xD98F, 0x1F28,
- 0xD990, 0xD990, 0x2109, 0xD991, 0xD991, 0x22C7, 0xD992, 0xD996, 0x4BAA,
- 0xD997, 0xD997, 0x24AE, 0xD998, 0xD998, 0x22B1, 0xD999, 0xD99A, 0x4BAF,
- 0xD99B, 0xD99B, 0x2266, 0xD99C, 0xD99C, 0x4BB1, 0xD99D, 0xD99D, 0x225B,
- 0xD99E, 0xD99E, 0x22C4, 0xD99F, 0xD99F, 0x4BB2, 0xD9A0, 0xD9A0, 0x2115,
- 0xD9A1, 0xD9FE, 0x12B5, 0xDA40, 0xDA40, 0x4BB3, 0xDA41, 0xDA41, 0x222A,
- 0xDA42, 0xDA42, 0x24B1, 0xDA43, 0xDA47, 0x4BB4, 0xDA48, 0xDA48, 0x213D,
- 0xDA49, 0xDA4C, 0x4BB9, 0xDA4D, 0xDA4D, 0x1F15, 0xDA4E, 0xDA4E, 0x225C,
- 0xDA4F, 0xDA72, 0x4BBD, 0xDA73, 0xDA73, 0x1F14, 0xDA74, 0xDA76, 0x4BE1,
- 0xDA77, 0xDA77, 0x227A, 0xDA78, 0xDA7E, 0x4BE4, 0xDA80, 0xDA84, 0x4BEB,
- 0xDA85, 0xDA85, 0x20EE, 0xDA86, 0xDA8D, 0x4BF0, 0xDA8E, 0xDA8E, 0x25F8,
- 0xDA8F, 0xDAA0, 0x4BF8, 0xDAA1, 0xDAFE, 0x1313, 0xDB40, 0xDB5F, 0x4C0A,
- 0xDB60, 0xDB60, 0x1F94, 0xDB61, 0xDB77, 0x4C2A, 0xDB78, 0xDB78, 0x2230,
- 0xDB79, 0xDB7E, 0x4C41, 0xDB80, 0xDB83, 0x4C47, 0xDB84, 0xDB84, 0x25FD,
- 0xDB85, 0xDB8A, 0x4C4B, 0xDB8B, 0xDB8B, 0x2600, 0xDB8C, 0xDB97, 0x4C51,
- 0xDB98, 0xDB98, 0x2606, 0xDB99, 0xDBA0, 0x4C5D, 0xDBA1, 0xDBFE, 0x1371,
- 0xDC40, 0xDC44, 0x4C65, 0xDC45, 0xDC45, 0x25FF, 0xDC46, 0xDC4E, 0x4C6A,
- 0xDC4F, 0xDC4F, 0x25FC, 0xDC50, 0xDC50, 0x1E8C, 0xDC51, 0xDC51, 0x2602,
- 0xDC52, 0xDC52, 0x4C73, 0xDC53, 0xDC53, 0x224D, 0xDC54, 0xDC54, 0x4C74,
- 0xDC55, 0xDC55, 0x2604, 0xDC56, 0xDC56, 0x25FE, 0xDC57, 0xDC57, 0x2603,
- 0xDC58, 0xDC5C, 0x4C75, 0xDC5D, 0xDC5D, 0x2601, 0xDC5E, 0xDC61, 0x4C7A,
- 0xDC62, 0xDC62, 0x2605, 0xDC63, 0xDC65, 0x4C7E, 0xDC66, 0xDC66, 0x1EA3,
- 0xDC67, 0xDC67, 0x2608, 0xDC68, 0xDC6A, 0x4C81, 0xDC6B, 0xDC6B, 0x2607,
- 0xDC6C, 0xDC7B, 0x4C84, 0xDC7C, 0xDC7C, 0x20F0, 0xDC7D, 0xDC7E, 0x4C94,
- 0xDC80, 0xDC86, 0x4C96, 0xDC87, 0xDC87, 0x1E7B, 0xDC88, 0xDC88, 0x2267,
- 0xDC89, 0xDC89, 0x1F36, 0xDC8A, 0xDC8A, 0x1FD6, 0xDC8B, 0xDC8D, 0x4C9D,
- 0xDC8E, 0xDC8E, 0x21E0, 0xDC8F, 0xDC8F, 0x4CA0, 0xDC90, 0xDC90, 0x248C,
- 0xDC91, 0xDC96, 0x4CA1, 0xDC97, 0xDC97, 0x248D, 0xDC98, 0xDC9A, 0x4CA7,
- 0xDC9B, 0xDC9B, 0x2102, 0xDC9C, 0xDC9F, 0x4CAA, 0xDCA0, 0xDCA0, 0x2494,
- 0xDCA1, 0xDCFE, 0x13CF, 0xDD40, 0xDD45, 0x4CAE, 0xDD46, 0xDD46, 0x2493,
- 0xDD47, 0xDD4C, 0x4CB4, 0xDD4D, 0xDD4D, 0x248E, 0xDD4E, 0xDD52, 0x4CBA,
- 0xDD53, 0xDD53, 0x2299, 0xDD54, 0xDD54, 0x2491, 0xDD55, 0xDD55, 0x2496,
- 0xDD56, 0xDD56, 0x248F, 0xDD57, 0xDD57, 0x2492, 0xDD58, 0xDD58, 0x4CBF,
- 0xDD59, 0xDD59, 0x2497, 0xDD5A, 0xDD5D, 0x4CC0, 0xDD5E, 0xDD5E, 0x1FB1,
- 0xDD5F, 0xDD5F, 0x4CC4, 0xDD60, 0xDD60, 0x249A, 0xDD61, 0xDD61, 0x4CC5,
- 0xDD62, 0xDD62, 0x2499, 0xDD63, 0xDD63, 0x4CC6, 0xDD64, 0xDD64, 0x2258,
- 0xDD65, 0xDD65, 0x2498, 0xDD66, 0xDD6C, 0x4CC7, 0xDD6D, 0xDD6D, 0x249B,
- 0xDD6E, 0xDD6E, 0x4CCE, 0xDD6F, 0xDD6F, 0x1F09, 0xDD70, 0xDD70, 0x20E6,
- 0xDD71, 0xDD75, 0x4CCF, 0xDD76, 0xDD76, 0x2026, 0xDD77, 0xDD77, 0x249F,
- 0xDD78, 0xDD78, 0x1F59, 0xDD79, 0xDD7A, 0x249D, 0xDD7B, 0xDD7E, 0x4CD4,
- 0xDD80, 0xDD80, 0x4CD8, 0xDD81, 0xDD81, 0x1F3B, 0xDD82, 0xDD82, 0x249C,
- 0xDD83, 0xDD84, 0x4CD9, 0xDD85, 0xDD85, 0x1E3A, 0xDD86, 0xDD86, 0x205B,
- 0xDD87, 0xDD8A, 0x4CDB, 0xDD8B, 0xDD8B, 0x1F70, 0xDD8C, 0xDD8E, 0x4CDF,
- 0xDD8F, 0xDD8F, 0x24A0, 0xDD90, 0xDD93, 0x4CE2, 0xDD94, 0xDD94, 0x213B,
- 0xDD95, 0xDD96, 0x4CE6, 0xDD97, 0xDD97, 0x1F07, 0xDD98, 0xDD99, 0x4CE8,
- 0xDD9A, 0xDD9A, 0x2270, 0xDD9B, 0xDD9B, 0x2237, 0xDD9C, 0xDD9D, 0x4CEA,
- 0xDD9E, 0xDD9E, 0x24D2, 0xDD9F, 0xDD9F, 0x4CEC, 0xDDA0, 0xDDA0, 0x21B3,
- 0xDDA1, 0xDDFE, 0x142D, 0xDE40, 0xDE40, 0x2245, 0xDE41, 0xDE41, 0x24A1,
- 0xDE42, 0xDE43, 0x4CED, 0xDE44, 0xDE44, 0x22A8, 0xDE45, 0xDE47, 0x4CEF,
- 0xDE48, 0xDE48, 0x227C, 0xDE49, 0xDE49, 0x1FB0, 0xDE4A, 0xDE4E, 0x4CF2,
- 0xDE4F, 0xDE4F, 0x24A2, 0xDE50, 0xDE59, 0x4CF7, 0xDE5A, 0xDE5A, 0x1F46,
- 0xDE5B, 0xDE5B, 0x4D01, 0xDE5C, 0xDE5C, 0x2380, 0xDE5D, 0xDE5D, 0x2495,
- 0xDE5E, 0xDE5E, 0x4D02, 0xDE5F, 0xDE5F, 0x2490, 0xDE60, 0xDE6A, 0x4D03,
- 0xDE6B, 0xDE6B, 0x1E30, 0xDE6C, 0xDE6E, 0x4D0E, 0xDE6F, 0xDE6F, 0x1E9D,
- 0xDE70, 0xDE70, 0x1E4B, 0xDE71, 0xDE71, 0x1E4A, 0xDE72, 0xDE72, 0x20AA,
- 0xDE73, 0xDE7E, 0x4D11, 0xDE80, 0xDE91, 0x4D1D, 0xDE92, 0xDE92, 0x267B,
- 0xDE93, 0xDE9E, 0x4D2F, 0xDE9F, 0xDE9F, 0x23F2, 0xDEA0, 0xDEA0, 0x4D3B,
- 0xDEA1, 0xDEFE, 0x148B, 0xDF40, 0xDF40, 0x227E, 0xDF41, 0xDF41, 0x4D3C,
- 0xDF42, 0xDF42, 0x2019, 0xDF43, 0xDF4C, 0x4D3D, 0xDF4D, 0xDF4D, 0x1FBB,
- 0xDF4E, 0xDF5B, 0x4D47, 0xDF5C, 0xDF5C, 0x2253, 0xDF5D, 0xDF5D, 0x4D55,
- 0xDF5E, 0xDF5E, 0x1F3E, 0xDF5F, 0xDF5F, 0x1EA6, 0xDF60, 0xDF60, 0x218E,
- 0xDF61, 0xDF63, 0x4D56, 0xDF64, 0xDF64, 0x21EC, 0xDF65, 0xDF65, 0x4D59,
- 0xDF66, 0xDF66, 0x1EBE, 0xDF67, 0xDF67, 0x4D5A, 0xDF68, 0xDF68, 0x224A,
- 0xDF69, 0xDF6C, 0x4D5B, 0xDF6D, 0xDF6D, 0x2133, 0xDF6E, 0xDF73, 0x4D5F,
- 0xDF74, 0xDF74, 0x1E84, 0xDF75, 0xDF76, 0x4D65, 0xDF77, 0xDF77, 0x20CF,
- 0xDF78, 0xDF78, 0x21E2, 0xDF79, 0xDF79, 0x4D67, 0xDF7A, 0xDF7A, 0x220F,
- 0xDF7B, 0xDF7B, 0x4D68, 0xDF7C, 0xDF7C, 0x2029, 0xDF7D, 0xDF7D, 0x4D69,
- 0xDF7E, 0xDF7E, 0x2073, 0xDF80, 0xDF80, 0x1F55, 0xDF81, 0xDF82, 0x4D6A,
- 0xDF83, 0xDF83, 0x23F1, 0xDF84, 0xDF84, 0x4D6C, 0xDF85, 0xDF85, 0x1E46,
- 0xDF86, 0xDF88, 0x4D6D, 0xDF89, 0xDF89, 0x2063, 0xDF8A, 0xDF8A, 0x23F3,
- 0xDF8B, 0xDFA0, 0x4D70, 0xDFA1, 0xDFFE, 0x14E9, 0xE040, 0xE04F, 0x4D86,
- 0xE050, 0xE050, 0x231E, 0xE051, 0xE05C, 0x4D96, 0xE05D, 0xE05D, 0x2233,
- 0xE05E, 0xE068, 0x4DA2, 0xE069, 0xE069, 0x2320, 0xE06A, 0xE06B, 0x4DAD,
- 0xE06C, 0xE06C, 0x21C7, 0xE06D, 0xE074, 0x4DAF, 0xE075, 0xE075, 0x22BC,
- 0xE076, 0xE076, 0x4DB7, 0xE077, 0xE077, 0x231C, 0xE078, 0xE078, 0x4DB8,
- 0xE079, 0xE079, 0x2251, 0xE07A, 0xE07E, 0x4DB9, 0xE080, 0xE086, 0x4DBE,
- 0xE087, 0xE087, 0x1EBB, 0xE088, 0xE08C, 0x4DC5, 0xE08D, 0xE08D, 0x2287,
- 0xE08E, 0xE08E, 0x4DCA, 0xE08F, 0xE08F, 0x202D, 0xE090, 0xE090, 0x1EAB,
- 0xE091, 0xE091, 0x4DCB, 0xE092, 0xE092, 0x231D, 0xE093, 0xE093, 0x4DCC,
- 0xE094, 0xE094, 0x231F, 0xE095, 0xE096, 0x4DCD, 0xE097, 0xE097, 0x231B,
- 0xE098, 0xE0A0, 0x4DCF, 0xE0A1, 0xE0FE, 0x1547, 0xE140, 0xE141, 0x4DD8,
- 0xE142, 0xE142, 0x2321, 0xE143, 0xE163, 0x4DDA, 0xE164, 0xE164, 0x2255,
- 0xE165, 0xE167, 0x4DFB, 0xE168, 0xE168, 0x1E8F, 0xE169, 0xE173, 0x4DFE,
- 0xE174, 0xE174, 0x220C, 0xE175, 0xE175, 0x1FA4, 0xE176, 0xE17E, 0x4E09,
- 0xE180, 0xE183, 0x4E12, 0xE184, 0xE184, 0x209B, 0xE185, 0xE185, 0x21D8,
- 0xE186, 0xE186, 0x4E16, 0xE187, 0xE187, 0x25FA, 0xE188, 0xE188, 0x4E17,
- 0xE189, 0xE189, 0x25F9, 0xE18A, 0xE18B, 0x4E18, 0xE18C, 0xE18C, 0x2134,
- 0xE18D, 0xE18D, 0x4E1A, 0xE18E, 0xE190, 0x24F3, 0xE191, 0xE191, 0x24F8,
- 0xE192, 0xE192, 0x4E1B, 0xE193, 0xE193, 0x24F7, 0xE194, 0xE194, 0x1EC8,
- 0xE195, 0xE195, 0x24F6, 0xE196, 0xE197, 0x4E1C, 0xE198, 0xE198, 0x2280,
- 0xE199, 0xE19D, 0x4E1E, 0xE19E, 0xE19E, 0x1EC5, 0xE19F, 0xE19F, 0x24FB,
- 0xE1A0, 0xE1A0, 0x4E23, 0xE1A1, 0xE1FE, 0x15A5, 0xE240, 0xE240, 0x4E24,
- 0xE241, 0xE241, 0x24FA, 0xE242, 0xE242, 0x4E25, 0xE243, 0xE243, 0x1EED,
- 0xE244, 0xE24E, 0x4E26, 0xE24F, 0xE24F, 0x24FD, 0xE250, 0xE250, 0x4E31,
- 0xE251, 0xE251, 0x24F9, 0xE252, 0xE252, 0x4E32, 0xE253, 0xE253, 0x24FE,
- 0xE254, 0xE254, 0x20CD, 0xE255, 0xE259, 0x4E33, 0xE25A, 0xE25A, 0x2508,
- 0xE25B, 0xE25B, 0x2504, 0xE25C, 0xE25D, 0x4E38, 0xE25E, 0xE25E, 0x2506,
- 0xE25F, 0xE261, 0x4E3A, 0xE262, 0xE262, 0x24FF, 0xE263, 0xE263, 0x2090,
- 0xE264, 0xE266, 0x4E3D, 0xE267, 0xE267, 0x1EDD, 0xE268, 0xE268, 0x1F25,
- 0xE269, 0xE269, 0x4E40, 0xE26A, 0xE26A, 0x2503, 0xE26B, 0xE26B, 0x2502,
- 0xE26C, 0xE26D, 0x4E41, 0xE26E, 0xE26E, 0x1E7A, 0xE26F, 0xE26F, 0x20A6,
- 0xE270, 0xE277, 0x4E43, 0xE278, 0xE278, 0x1FD5, 0xE279, 0xE27C, 0x4E4B,
- 0xE27D, 0xE27D, 0x1F11, 0xE27E, 0xE27E, 0x4E4F, 0xE280, 0xE280, 0x2507,
- 0xE281, 0xE281, 0x2500, 0xE282, 0xE282, 0x2505, 0xE283, 0xE288, 0x4E50,
- 0xE289, 0xE289, 0x2519, 0xE28A, 0xE28A, 0x4E56, 0xE28B, 0xE28B, 0x2515,
- 0xE28C, 0xE28D, 0x4E57, 0xE28E, 0xE28E, 0x250C, 0xE28F, 0xE28F, 0x2031,
- 0xE290, 0xE291, 0x4E59, 0xE292, 0xE292, 0x250B, 0xE293, 0xE293, 0x250F,
- 0xE294, 0xE294, 0x251A, 0xE295, 0xE295, 0x2509, 0xE296, 0xE297, 0x4E5B,
- 0xE298, 0xE298, 0x250E, 0xE299, 0xE299, 0x2234, 0xE29A, 0xE29A, 0x2513,
- 0xE29B, 0xE29B, 0x1F80, 0xE29C, 0xE29F, 0x4E5D, 0xE2A0, 0xE2A0, 0x2501,
- 0xE2A1, 0xE2FE, 0x1603, 0xE340, 0xE341, 0x4E61, 0xE342, 0xE342, 0x2517,
- 0xE343, 0xE343, 0x2516, 0xE344, 0xE346, 0x4E63, 0xE347, 0xE347, 0x2518,
- 0xE348, 0xE34A, 0x4E66, 0xE34B, 0xE34B, 0x1E56, 0xE34C, 0xE34E, 0x4E69,
- 0xE34F, 0xE34F, 0x250D, 0xE350, 0xE350, 0x4E6C, 0xE351, 0xE351, 0x20D3,
- 0xE352, 0xE353, 0x4E6D, 0xE354, 0xE354, 0x207A, 0xE355, 0xE355, 0x20CE,
- 0xE356, 0xE357, 0x4E6F, 0xE358, 0xE358, 0x2510, 0xE359, 0xE35B, 0x4E71,
- 0xE35C, 0xE35C, 0x1E55, 0xE35D, 0xE35F, 0x4E74, 0xE360, 0xE360, 0x250A,
- 0xE361, 0xE365, 0x4E77, 0xE366, 0xE367, 0x2511, 0xE368, 0xE370, 0x4E7C,
- 0xE371, 0xE371, 0x1FAA, 0xE372, 0xE372, 0x4E85, 0xE373, 0xE373, 0x251E,
- 0xE374, 0xE374, 0x1F1F, 0xE375, 0xE377, 0x4E86, 0xE378, 0xE378, 0x252D,
- 0xE379, 0xE379, 0x221D, 0xE37A, 0xE37B, 0x4E89, 0xE37C, 0xE37C, 0x2532,
- 0xE37D, 0xE37D, 0x4E8B, 0xE37E, 0xE37E, 0x217B, 0xE380, 0xE389, 0x4E8C,
- 0xE38A, 0xE38A, 0x21AF, 0xE38B, 0xE38B, 0x4E96, 0xE38C, 0xE38C, 0x252C,
- 0xE38D, 0xE38E, 0x4E97, 0xE38F, 0xE38F, 0x2528, 0xE390, 0xE390, 0x4E99,
- 0xE391, 0xE391, 0x208C, 0xE392, 0xE392, 0x4E9A, 0xE393, 0xE393, 0x252F,
- 0xE394, 0xE394, 0x4E9B, 0xE395, 0xE395, 0x21BC, 0xE396, 0xE398, 0x4E9C,
- 0xE399, 0xE399, 0x251D, 0xE39A, 0xE39B, 0x4E9F, 0xE39C, 0xE39C, 0x2535,
- 0xE39D, 0xE39D, 0x4EA1, 0xE39E, 0xE39E, 0x220D, 0xE39F, 0xE39F, 0x2526,
- 0xE3A0, 0xE3A0, 0x4EA2, 0xE3A1, 0xE3FE, 0x1661, 0xE440, 0xE440, 0x2534,
- 0xE441, 0xE441, 0x252A, 0xE442, 0xE442, 0x251F, 0xE443, 0xE443, 0x2531,
- 0xE444, 0xE444, 0x251C, 0xE445, 0xE447, 0x4EA3, 0xE448, 0xE448, 0x2525,
- 0xE449, 0xE44D, 0x4EA6, 0xE44E, 0xE44E, 0x21CD, 0xE44F, 0xE44F, 0x4EAB,
- 0xE450, 0xE450, 0x21DA, 0xE451, 0xE451, 0x4EAC, 0xE452, 0xE452, 0x2172,
- 0xE453, 0xE453, 0x253E, 0xE454, 0xE457, 0x4EAD, 0xE458, 0xE458, 0x204F,
- 0xE459, 0xE459, 0x4EB1, 0xE45A, 0xE45A, 0x2543, 0xE45B, 0xE45B, 0x4EB2,
- 0xE45C, 0xE45C, 0x21D7, 0xE45D, 0xE45D, 0x4EB3, 0xE45E, 0xE45E, 0x1E3C,
- 0xE45F, 0xE461, 0x4EB4, 0xE462, 0xE462, 0x2529, 0xE463, 0xE464, 0x4EB7,
- 0xE465, 0xE465, 0x2521, 0xE466, 0xE467, 0x4EB9, 0xE468, 0xE468, 0x1EFF,
- 0xE469, 0xE472, 0x4EBB, 0xE473, 0xE473, 0x253F, 0xE474, 0xE474, 0x4EC5,
- 0xE475, 0xE475, 0x2544, 0xE476, 0xE478, 0x4EC6, 0xE479, 0xE479, 0x2523,
- 0xE47A, 0xE47A, 0x1E90, 0xE47B, 0xE47B, 0x253A, 0xE47C, 0xE47C, 0x2545,
- 0xE47D, 0xE47D, 0x4EC9, 0xE47E, 0xE47E, 0x253D, 0xE480, 0xE480, 0x4ECA,
- 0xE481, 0xE481, 0x20C1, 0xE482, 0xE483, 0x4ECB, 0xE484, 0xE484, 0x2103,
- 0xE485, 0xE485, 0x2520, 0xE486, 0xE486, 0x253C, 0xE487, 0xE487, 0x253B,
- 0xE488, 0xE488, 0x2538, 0xE489, 0xE48C, 0x4ECD, 0xE48D, 0xE48D, 0x2540,
- 0xE48E, 0xE48E, 0x4ED1, 0xE48F, 0xE48F, 0x1FCD, 0xE490, 0xE492, 0x4ED2,
- 0xE493, 0xE493, 0x1F18, 0xE494, 0xE497, 0x4ED5, 0xE498, 0xE498, 0x254B,
- 0xE499, 0xE49C, 0x4ED9, 0xE49D, 0xE49D, 0x2547, 0xE49E, 0xE49F, 0x254F,
- 0xE4A0, 0xE4A0, 0x4EDD, 0xE4A1, 0xE4FE, 0x16BF, 0xE540, 0xE545, 0x4EDE,
- 0xE546, 0xE546, 0x22B0, 0xE547, 0xE547, 0x4EE4, 0xE548, 0xE548, 0x2546,
- 0xE549, 0xE54A, 0x4EE5, 0xE54B, 0xE54B, 0x254C, 0xE54C, 0xE54D, 0x4EE7,
- 0xE54E, 0xE54E, 0x1E9A, 0xE54F, 0xE54F, 0x2552, 0xE550, 0xE550, 0x2530,
- 0xE551, 0xE551, 0x2549, 0xE552, 0xE554, 0x4EE9, 0xE555, 0xE555, 0x2551,
- 0xE556, 0xE556, 0x1ECA, 0xE557, 0xE557, 0x4EEC, 0xE558, 0xE558, 0x20D2,
- 0xE559, 0xE55B, 0x4EED, 0xE55C, 0xE55C, 0x1FB8, 0xE55D, 0xE55D, 0x4EF0,
- 0xE55E, 0xE55E, 0x2079, 0xE55F, 0xE560, 0x4EF1, 0xE561, 0xE561, 0x21AB,
- 0xE562, 0xE563, 0x4EF3, 0xE564, 0xE564, 0x254D, 0xE565, 0xE565, 0x1EA5,
- 0xE566, 0xE567, 0x4EF5, 0xE568, 0xE568, 0x204C, 0xE569, 0xE569, 0x2080,
- 0xE56A, 0xE56B, 0x4EF7, 0xE56C, 0xE56C, 0x266D, 0xE56D, 0xE56D, 0x4EF9,
- 0xE56E, 0xE56E, 0x2537, 0xE56F, 0xE574, 0x4EFA, 0xE575, 0xE575, 0x254A,
- 0xE576, 0xE576, 0x21B8, 0xE577, 0xE577, 0x4F00, 0xE578, 0xE578, 0x254E,
- 0xE579, 0xE57A, 0x4F01, 0xE57B, 0xE57B, 0x24FC, 0xE57C, 0xE57C, 0x2554,
- 0xE57D, 0xE57E, 0x4F03, 0xE580, 0xE580, 0x4F05, 0xE581, 0xE581, 0x1F3C,
- 0xE582, 0xE582, 0x4F06, 0xE583, 0xE583, 0x1ED5, 0xE584, 0xE589, 0x4F07,
- 0xE58A, 0xE58A, 0x2556, 0xE58B, 0xE58D, 0x4F0D, 0xE58E, 0xE58E, 0x2268,
- 0xE58F, 0xE590, 0x4F10, 0xE591, 0xE591, 0x1ED6, 0xE592, 0xE599, 0x4F12,
- 0xE59A, 0xE59A, 0x2557, 0xE59B, 0xE59B, 0x2553, 0xE59C, 0xE59E, 0x4F1A,
- 0xE59F, 0xE59F, 0x2548, 0xE5A0, 0xE5A0, 0x4F1D, 0xE5A1, 0xE5FE, 0x171D,
- 0xE640, 0xE640, 0x20DC, 0xE641, 0xE643, 0x4F1E, 0xE644, 0xE644, 0x2559,
- 0xE645, 0xE648, 0x4F21, 0xE649, 0xE649, 0x1F97, 0xE64A, 0xE64A, 0x2555,
- 0xE64B, 0xE64D, 0x4F25, 0xE64E, 0xE64E, 0x227D, 0xE64F, 0xE651, 0x4F28,
- 0xE652, 0xE652, 0x257E, 0xE653, 0xE655, 0x4F2B, 0xE656, 0xE656, 0x207C,
- 0xE657, 0xE657, 0x4F2E, 0xE658, 0xE658, 0x255A, 0xE659, 0xE65A, 0x4F2F,
- 0xE65B, 0xE65B, 0x255E, 0xE65C, 0xE65D, 0x4F31, 0xE65E, 0xE65E, 0x1E34,
- 0xE65F, 0xE668, 0x4F33, 0xE669, 0xE669, 0x215E, 0xE66A, 0xE66A, 0x4F3D,
- 0xE66B, 0xE66B, 0x2560, 0xE66C, 0xE674, 0x4F3E, 0xE675, 0xE675, 0x21A2,
- 0xE676, 0xE676, 0x2354, 0xE677, 0xE678, 0x4F47, 0xE679, 0xE679, 0x2563,
- 0xE67A, 0xE67A, 0x2527, 0xE67B, 0xE67B, 0x4F49, 0xE67C, 0xE67C, 0x252E,
- 0xE67D, 0xE67D, 0x2558, 0xE67E, 0xE67E, 0x4F4A, 0xE680, 0xE680, 0x1F1B,
- 0xE681, 0xE681, 0x4F4B, 0xE682, 0xE682, 0x2283, 0xE683, 0xE683, 0x4F4C,
- 0xE684, 0xE684, 0x2564, 0xE685, 0xE686, 0x4F4D, 0xE687, 0xE687, 0x20A0,
- 0xE688, 0xE688, 0x4F4F, 0xE689, 0xE689, 0x2565, 0xE68A, 0xE68B, 0x4F50,
- 0xE68C, 0xE68C, 0x2561, 0xE68D, 0xE692, 0x4F52, 0xE693, 0xE693, 0x2562,
- 0xE694, 0xE696, 0x4F58, 0xE697, 0xE697, 0x256C, 0xE698, 0xE69A, 0x4F5B,
- 0xE69B, 0xE69B, 0x256D, 0xE69C, 0xE69C, 0x2020, 0xE69D, 0xE69E, 0x4F5E,
- 0xE69F, 0xE69F, 0x255F, 0xE6A0, 0xE6A0, 0x256A, 0xE6A1, 0xE6FE, 0x177B,
- 0xE740, 0xE742, 0x4F60, 0xE743, 0xE743, 0x256E, 0xE744, 0xE747, 0x4F63,
- 0xE748, 0xE748, 0x2539, 0xE749, 0xE749, 0x255C, 0xE74A, 0xE74C, 0x4F67,
- 0xE74D, 0xE74E, 0x2568, 0xE74F, 0xE74F, 0x256B, 0xE750, 0xE750, 0x1E6F,
- 0xE751, 0xE751, 0x4F6A, 0xE752, 0xE752, 0x1FC4, 0xE753, 0xE753, 0x2567,
- 0xE754, 0xE754, 0x4F6B, 0xE755, 0xE755, 0x255B, 0xE756, 0xE758, 0x4F6C,
- 0xE759, 0xE759, 0x261D, 0xE75A, 0xE765, 0x4F6F, 0xE766, 0xE766, 0x252B,
- 0xE767, 0xE767, 0x4F7B, 0xE768, 0xE768, 0x2571, 0xE769, 0xE769, 0x4F7C,
- 0xE76A, 0xE76A, 0x2577, 0xE76B, 0xE773, 0x4F7D, 0xE774, 0xE774, 0x2522,
- 0xE775, 0xE77B, 0x4F86, 0xE77C, 0xE77C, 0x2533, 0xE77D, 0xE77E, 0x4F8D,
- 0xE780, 0xE781, 0x4F8F, 0xE782, 0xE782, 0x202A, 0xE783, 0xE783, 0x4F91,
- 0xE784, 0xE784, 0x2536, 0xE785, 0xE785, 0x2573, 0xE786, 0xE786, 0x256F,
- 0xE787, 0xE789, 0x4F92, 0xE78A, 0xE78A, 0x2293, 0xE78B, 0xE78B, 0x2578,
- 0xE78C, 0xE78E, 0x4F95, 0xE78F, 0xE78F, 0x2570, 0xE790, 0xE791, 0x4F98,
- 0xE792, 0xE792, 0x2575, 0xE793, 0xE797, 0x4F9A, 0xE798, 0xE799, 0x2541,
- 0xE79A, 0xE79A, 0x255D, 0xE79B, 0xE79F, 0x4F9F, 0xE7A0, 0xE7A0, 0x201A,
- 0xE7A1, 0xE7FE, 0x17D9, 0xE840, 0xE842, 0x4FA4, 0xE843, 0xE843, 0x257A,
- 0xE844, 0xE844, 0x2006, 0xE845, 0xE845, 0x4FA7, 0xE846, 0xE846, 0x2177,
- 0xE847, 0xE848, 0x4FA8, 0xE849, 0xE849, 0x251B, 0xE84A, 0xE84A, 0x4FAA,
- 0xE84B, 0xE84B, 0x2524, 0xE84C, 0xE84E, 0x4FAB, 0xE84F, 0xE84F, 0x257B,
- 0xE850, 0xE853, 0x4FAE, 0xE854, 0xE854, 0x22A3, 0xE855, 0xE859, 0x4FB2,
- 0xE85A, 0xE85A, 0x2579, 0xE85B, 0xE85B, 0x4FB7, 0xE85C, 0xE85C, 0x2566,
- 0xE85D, 0xE861, 0x4FB8, 0xE862, 0xE862, 0x1F93, 0xE863, 0xE863, 0x4FBD,
- 0xE864, 0xE864, 0x257C, 0xE865, 0xE86F, 0x4FBE, 0xE870, 0xE870, 0x2514,
- 0xE871, 0xE872, 0x4FC9, 0xE873, 0xE873, 0x257D, 0xE874, 0xE874, 0x4FCB,
- 0xE875, 0xE875, 0x2572, 0xE876, 0xE87B, 0x4FCC, 0xE87C, 0xE87C, 0x2574,
- 0xE87D, 0xE87E, 0x4FD2, 0xE880, 0xE880, 0x224E, 0xE881, 0xE881, 0x4FD4,
- 0xE882, 0xE882, 0x21C6, 0xE883, 0xE886, 0x4FD5, 0xE887, 0xE887, 0x209F,
- 0xE888, 0xE888, 0x4FD9, 0xE889, 0xE889, 0x2576, 0xE88A, 0xE88B, 0x4FDA,
- 0xE88C, 0xE88C, 0x2064, 0xE88D, 0xE88D, 0x22BF, 0xE88E, 0xE88E, 0x261C,
- 0xE88F, 0xE88F, 0x225E, 0xE890, 0xE8A0, 0x4FDC, 0xE8A1, 0xE8FE, 0x1837,
- 0xE940, 0xE94B, 0x4FED, 0xE94C, 0xE94C, 0x1E75, 0xE94D, 0xE953, 0x4FF9,
- 0xE954, 0xE954, 0x207D, 0xE955, 0xE955, 0x5000, 0xE956, 0xE956, 0x23BF,
- 0xE957, 0xE957, 0x2113, 0xE958, 0xE959, 0x5001, 0xE95A, 0xE95A, 0x23C0,
- 0xE95B, 0xE95C, 0x5003, 0xE95D, 0xE95D, 0x1E45, 0xE95E, 0xE95E, 0x5005,
- 0xE95F, 0xE95F, 0x1FD8, 0xE960, 0xE960, 0x23C4, 0xE961, 0xE961, 0x5006,
- 0xE962, 0xE962, 0x23C2, 0xE963, 0xE963, 0x2104, 0xE964, 0xE964, 0x5007,
- 0xE965, 0xE965, 0x21BD, 0xE966, 0xE966, 0x5008, 0xE967, 0xE967, 0x1F87,
- 0xE968, 0xE968, 0x23C3, 0xE969, 0xE96B, 0x5009, 0xE96C, 0xE96C, 0x2269,
- 0xE96D, 0xE974, 0x500C, 0xE975, 0xE975, 0x1F43, 0xE976, 0xE976, 0x5014,
- 0xE977, 0xE977, 0x1F1E, 0xE978, 0xE978, 0x2679, 0xE979, 0xE979, 0x1EEB,
- 0xE97A, 0xE97B, 0x5015, 0xE97C, 0xE97C, 0x1F35, 0xE97D, 0xE97D, 0x208A,
- 0xE97E, 0xE97E, 0x5017, 0xE980, 0xE980, 0x23C7, 0xE981, 0xE981, 0x23C9,
- 0xE982, 0xE982, 0x23C6, 0xE983, 0xE986, 0x5018, 0xE987, 0xE987, 0x224F,
- 0xE988, 0xE98A, 0x501C, 0xE98B, 0xE98B, 0x23CB, 0xE98C, 0xE98D, 0x501F,
- 0xE98E, 0xE98E, 0x21F3, 0xE98F, 0xE98F, 0x5021, 0xE990, 0xE990, 0x21F7,
- 0xE991, 0xE991, 0x23CF, 0xE992, 0xE992, 0x23CE, 0xE993, 0xE993, 0x23CA,
- 0xE994, 0xE994, 0x23CD, 0xE995, 0xE997, 0x5022, 0xE998, 0xE998, 0x23D0,
- 0xE999, 0xE99A, 0x5025, 0xE99B, 0xE99B, 0x266C, 0xE99C, 0xE99C, 0x5027,
- 0xE99D, 0xE99D, 0x23C1, 0xE99E, 0xE99E, 0x5028, 0xE99F, 0xE99F, 0x1FEE,
- 0xE9A0, 0xE9A0, 0x23D1, 0xE9A1, 0xE9FE, 0x1895, 0xEA40, 0xEA40, 0x1FF8,
- 0xEA41, 0xEA43, 0x5029, 0xEA44, 0xEA44, 0x23D3, 0xEA45, 0xEA47, 0x502C,
- 0xEA48, 0xEA48, 0x23D2, 0xEA49, 0xEA49, 0x23D4, 0xEA4A, 0xEA4A, 0x1E98,
- 0xEA4B, 0xEA4F, 0x502F, 0xEA50, 0xEA50, 0x1F2C, 0xEA51, 0xEA51, 0x5034,
- 0xEA52, 0xEA52, 0x23D5, 0xEA53, 0xEA54, 0x5035, 0xEA55, 0xEA55, 0x1E71,
- 0xEA56, 0xEA56, 0x2691, 0xEA57, 0xEA58, 0x5037, 0xEA59, 0xEA59, 0x23C5,
- 0xEA5A, 0xEA7E, 0x5039, 0xEA80, 0xEA80, 0x231A, 0xEA81, 0xEA83, 0x505E,
- 0xEA84, 0xEA84, 0x2114, 0xEA85, 0xEA86, 0x5061, 0xEA87, 0xEA87, 0x2284,
- 0xEA88, 0xEA8D, 0x5063, 0xEA8E, 0xEA8E, 0x221C, 0xEA8F, 0xEA8F, 0x5069,
- 0xEA90, 0xEA90, 0x1E7E, 0xEA91, 0xEA91, 0x204D, 0xEA92, 0xEA95, 0x506A,
- 0xEA96, 0xEA96, 0x2201, 0xEA97, 0xEA9F, 0x506E, 0xEAA0, 0xEAA0, 0x1ED9,
- 0xEAA1, 0xEAFE, 0x18F3, 0xEB40, 0xEB40, 0x5077, 0xEB41, 0xEB41, 0x1FB2,
- 0xEB42, 0xEB44, 0x5078, 0xEB45, 0xEB45, 0x2252, 0xEB46, 0xEB47, 0x507B,
- 0xEB48, 0xEB48, 0x1F79, 0xEB49, 0xEB52, 0x507D, 0xEB53, 0xEB53, 0x2157,
- 0xEB54, 0xEB54, 0x5087, 0xEB55, 0xEB55, 0x21BF, 0xEB56, 0xEB5A, 0x5088,
- 0xEB5B, 0xEB5B, 0x221F, 0xEB5C, 0xEB5C, 0x508D, 0xEB5D, 0xEB5D, 0x203D,
- 0xEB5E, 0xEB5F, 0x508E, 0xEB60, 0xEB60, 0x2015, 0xEB61, 0xEB61, 0x5090,
- 0xEB62, 0xEB62, 0x26A5, 0xEB63, 0xEB6C, 0x5091, 0xEB6D, 0xEB6D, 0x2156,
- 0xEB6E, 0xEB6F, 0x509B, 0xEB70, 0xEB70, 0x2144, 0xEB71, 0xEB71, 0x509D,
- 0xEB72, 0xEB72, 0x1E91, 0xEB73, 0xEB73, 0x2257, 0xEB74, 0xEB77, 0x509E,
- 0xEB78, 0xEB78, 0x200A, 0xEB79, 0xEB79, 0x2092, 0xEB7A, 0xEB7E, 0x50A2,
- 0xEB80, 0xEB84, 0x50A7, 0xEB85, 0xEB85, 0x2250, 0xEB86, 0xEB89, 0x50AC,
- 0xEB8A, 0xEB8A, 0x1EC3, 0xEB8B, 0xEBA0, 0x50B0, 0xEBA1, 0xEBFE, 0x1951,
- 0xEC40, 0xEC45, 0x50C6, 0xEC46, 0xEC46, 0x21A8, 0xEC47, 0xEC55, 0x50CC,
- 0xEC56, 0xEC56, 0x260D, 0xEC57, 0xEC59, 0x50DB, 0xEC5A, 0xEC5A, 0x260C,
- 0xEC5B, 0xEC5B, 0x50DE, 0xEC5C, 0xEC5C, 0x260E, 0xEC5D, 0xEC5F, 0x50DF,
- 0xEC60, 0xEC60, 0x2032, 0xEC61, 0xEC6D, 0x50E2, 0xEC6E, 0xEC6E, 0x260B,
- 0xEC6F, 0xEC75, 0x50EF, 0xEC76, 0xEC76, 0x22C3, 0xEC77, 0xEC7E, 0x50F6,
- 0xEC80, 0xEC95, 0x50FE, 0xEC96, 0xEC96, 0x1F23, 0xEC97, 0xECA0, 0x5114,
- 0xECA1, 0xECFE, 0x19AF, 0xED40, 0xED45, 0x511E, 0xED46, 0xED46, 0x2695,
- 0xED47, 0xED57, 0x5124, 0xED58, 0xED58, 0x265E, 0xED59, 0xED5D, 0x5135,
- 0xED5E, 0xED5E, 0x265D, 0xED5F, 0xED60, 0x513A, 0xED61, 0xED61, 0x2692,
- 0xED62, 0xED63, 0x513C, 0xED64, 0xED64, 0x265F, 0xED65, 0xED65, 0x513E,
- 0xED66, 0xED66, 0x218D, 0xED67, 0xED67, 0x20FD, 0xED68, 0xED6D, 0x513F,
- 0xED6E, 0xED6E, 0x1F40, 0xED6F, 0xED73, 0x5145, 0xED74, 0xED74, 0x2465,
- 0xED75, 0xED76, 0x514A, 0xED77, 0xED77, 0x2467, 0xED78, 0xED78, 0x514C,
- 0xED79, 0xED79, 0x2466, 0xED7A, 0xED7E, 0x514D, 0xED80, 0xED90, 0x5152,
- 0xED91, 0xED91, 0x21C9, 0xED92, 0xED92, 0x5163, 0xED93, 0xED93, 0x2209,
- 0xED94, 0xED94, 0x1EC9, 0xED95, 0xED95, 0x20E9, 0xED96, 0xED96, 0x5164,
- 0xED97, 0xED97, 0x21CA, 0xED98, 0xED98, 0x2146, 0xED99, 0xED99, 0x25C5,
- 0xED9A, 0xED9A, 0x21DC, 0xED9B, 0xED9B, 0x5165, 0xED9C, 0xED9C, 0x245E,
- 0xED9D, 0xED9D, 0x5166, 0xED9E, 0xED9E, 0x214F, 0xED9F, 0xED9F, 0x5167,
- 0xEDA0, 0xEDA0, 0x25C6, 0xEDA1, 0xEDFE, 0x1A0D, 0xEE40, 0xEE40, 0x25C7,
- 0xEE41, 0xEE41, 0x2241, 0xEE42, 0xEE42, 0x218A, 0xEE43, 0xEE43, 0x1E2F,
- 0xEE44, 0xEE44, 0x1EDC, 0xEE45, 0xEE47, 0x5168, 0xEE48, 0xEE48, 0x20BF,
- 0xEE49, 0xEE49, 0x2034, 0xEE4A, 0xEE4C, 0x516B, 0xEE4D, 0xEE4D, 0x25C9,
- 0xEE4E, 0xEE51, 0x516E, 0xEE52, 0xEE52, 0x25C8, 0xEE53, 0xEE54, 0x5172,
- 0xEE55, 0xEE55, 0x220E, 0xEE56, 0xEE56, 0x5174, 0xEE57, 0xEE57, 0x25CB,
- 0xEE58, 0xEE5D, 0x5175, 0xEE5E, 0xEE5E, 0x217D, 0xEE5F, 0xEE60, 0x517B,
- 0xEE61, 0xEE61, 0x1F7E, 0xEE62, 0xEE67, 0x517D, 0xEE68, 0xEE68, 0x25CC,
- 0xEE69, 0xEE69, 0x1FC3, 0xEE6A, 0xEE6B, 0x5183, 0xEE6C, 0xEE6C, 0x20B9,
- 0xEE6D, 0xEE6D, 0x5185, 0xEE6E, 0xEE6E, 0x2181, 0xEE6F, 0xEE76, 0x5186,
- 0xEE77, 0xEE77, 0x1FDA, 0xEE78, 0xEE7C, 0x518E, 0xEE7D, 0xEE7D, 0x2173,
- 0xEE7E, 0xEE7E, 0x1EE1, 0xEE80, 0xEE80, 0x25CD, 0xEE81, 0xEE84, 0x5193,
- 0xEE85, 0xEE85, 0x25CE, 0xEE86, 0xEE86, 0x21F6, 0xEE87, 0xEE89, 0x5197,
- 0xEE8A, 0xEE8A, 0x224B, 0xEE8B, 0xEE8B, 0x25D1, 0xEE8C, 0xEE8C, 0x519A,
- 0xEE8D, 0xEE8D, 0x1EC0, 0xEE8E, 0xEE8F, 0x519B, 0xEE90, 0xEE90, 0x2008,
- 0xEE91, 0xEE93, 0x519D, 0xEE94, 0xEE94, 0x25D0, 0xEE95, 0xEE96, 0x51A0,
- 0xEE97, 0xEE97, 0x25D2, 0xEE98, 0xEE98, 0x51A2, 0xEE99, 0xEE99, 0x1F2A,
- 0xEE9A, 0xEE9C, 0x51A3, 0xEE9D, 0xEE9D, 0x1E72, 0xEE9E, 0xEE9E, 0x25D3,
- 0xEE9F, 0xEEA0, 0x51A6, 0xEEA1, 0xEEFE, 0x1A6B, 0xEF40, 0xEF40, 0x21BE,
- 0xEF41, 0xEF41, 0x25D4, 0xEF42, 0xEF42, 0x2044, 0xEF43, 0xEF43, 0x51A8,
- 0xEF44, 0xEF44, 0x25CF, 0xEF45, 0xEF45, 0x20F3, 0xEF46, 0xEF4B, 0x51A9,
- 0xEF4C, 0xEF4C, 0x1F00, 0xEF4D, 0xEF51, 0x51AF, 0xEF52, 0xEF53, 0x24CC,
- 0xEF54, 0xEF54, 0x51B4, 0xEF55, 0xEF55, 0x2698, 0xEF56, 0xEF56, 0x51B5,
- 0xEF57, 0xEF57, 0x2678, 0xEF58, 0xEF59, 0x51B6, 0xEF5A, 0xEF5A, 0x24CE,
- 0xEF5B, 0xEF5F, 0x51B8, 0xEF60, 0xEF60, 0x24CF, 0xEF61, 0xEF67, 0x51BD,
- 0xEF68, 0xEF68, 0x20B8, 0xEF69, 0xEF69, 0x51C4, 0xEF6A, 0xEF6A, 0x24D0,
- 0xEF6B, 0xEF6B, 0x51C5, 0xEF6C, 0xEF6C, 0x24D1, 0xEF6D, 0xEF76, 0x51C6,
- 0xEF77, 0xEF77, 0x1EF4, 0xEF78, 0xEF79, 0x51D0, 0xEF7A, 0xEF7A, 0x239B,
- 0xEF7B, 0xEF7B, 0x51D2, 0xEF7C, 0xEF7C, 0x267E, 0xEF7D, 0xEF7E, 0x51D3,
- 0xEF80, 0xEF81, 0x51D5, 0xEF82, 0xEF82, 0x239D, 0xEF83, 0xEF84, 0x239F,
- 0xEF85, 0xEF85, 0x51D7, 0xEF86, 0xEF86, 0x23A1, 0xEF87, 0xEF87, 0x51D8,
- 0xEF88, 0xEF88, 0x1EF1, 0xEF89, 0xEF8A, 0x51D9, 0xEF8B, 0xEF8B, 0x221E,
- 0xEF8C, 0xEF8C, 0x51DB, 0xEF8D, 0xEF8D, 0x23A2, 0xEF8E, 0xEF94, 0x51DC,
- 0xEF95, 0xEF95, 0x214B, 0xEF96, 0xEF96, 0x1E36, 0xEF97, 0xEF97, 0x2135,
- 0xEF98, 0xEF9B, 0x51E3, 0xEF9C, 0xEF9C, 0x1FAD, 0xEF9D, 0xEF9D, 0x51E7,
- 0xEF9E, 0xEF9E, 0x1E53, 0xEF9F, 0xEFA0, 0x51E8, 0xEFA1, 0xEFFE, 0x1AC9,
- 0xF040, 0xF040, 0x51EA, 0xF041, 0xF041, 0x23A3, 0xF042, 0xF042, 0x2203,
- 0xF043, 0xF043, 0x51EB, 0xF044, 0xF044, 0x1EE7, 0xF045, 0xF046, 0x51EC,
- 0xF047, 0xF047, 0x23A4, 0xF048, 0xF048, 0x2097, 0xF049, 0xF049, 0x1EE4,
- 0xF04A, 0xF04D, 0x51EE, 0xF04E, 0xF04E, 0x2238, 0xF04F, 0xF050, 0x51F2,
- 0xF051, 0xF051, 0x23A5, 0xF052, 0xF053, 0x51F4, 0xF054, 0xF054, 0x1F9A,
- 0xF055, 0xF056, 0x51F6, 0xF057, 0xF057, 0x21C3, 0xF058, 0xF05D, 0x51F8,
- 0xF05E, 0xF05E, 0x1F2E, 0xF05F, 0xF067, 0x51FE, 0xF068, 0xF068, 0x239C,
- 0xF069, 0xF06B, 0x5207, 0xF06C, 0xF06C, 0x23A6, 0xF06D, 0xF070, 0x520A,
- 0xF071, 0xF071, 0x239E, 0xF072, 0xF072, 0x520E, 0xF073, 0xF073, 0x2035,
- 0xF074, 0xF074, 0x23A7, 0xF075, 0xF077, 0x520F, 0xF078, 0xF078, 0x23A8,
- 0xF079, 0xF079, 0x5212, 0xF07A, 0xF07A, 0x2075, 0xF07B, 0xF07C, 0x5213,
- 0xF07D, 0xF07E, 0x23A9, 0xF080, 0xF080, 0x23AB, 0xF081, 0xF081, 0x1FEB,
- 0xF082, 0xF082, 0x23AC, 0xF083, 0xF086, 0x5215, 0xF087, 0xF087, 0x1F6A,
- 0xF088, 0xF088, 0x20F9, 0xF089, 0xF08A, 0x5219, 0xF08B, 0xF08B, 0x2666,
- 0xF08C, 0xF08F, 0x521B, 0xF090, 0xF090, 0x2667, 0xF091, 0xF091, 0x521F,
- 0xF092, 0xF092, 0x1E6C, 0xF093, 0xF095, 0x5220, 0xF096, 0xF096, 0x23AD,
- 0xF097, 0xF0A0, 0x5223, 0xF0A1, 0xF0FE, 0x1B27, 0xF140, 0xF151, 0x522D,
- 0xF152, 0xF152, 0x206D, 0xF153, 0xF153, 0x2242, 0xF154, 0xF154, 0x1F02,
- 0xF155, 0xF156, 0x523F, 0xF157, 0xF157, 0x2183, 0xF158, 0xF158, 0x5241,
- 0xF159, 0xF159, 0x1E85, 0xF15A, 0xF15A, 0x21E9, 0xF15B, 0xF166, 0x5242,
- 0xF167, 0xF167, 0x1E57, 0xF168, 0xF175, 0x524E, 0xF176, 0xF176, 0x22A5,
- 0xF177, 0xF177, 0x2407, 0xF178, 0xF178, 0x1FCA, 0xF179, 0xF179, 0x525C,
- 0xF17A, 0xF17A, 0x2402, 0xF17B, 0xF17B, 0x1F82, 0xF17C, 0xF17D, 0x525D,
- 0xF17E, 0xF17E, 0x2408, 0xF180, 0xF180, 0x2404, 0xF181, 0xF181, 0x525F,
- 0xF182, 0xF182, 0x2131, 0xF183, 0xF183, 0x5260, 0xF184, 0xF184, 0x2184,
- 0xF185, 0xF185, 0x5261, 0xF186, 0xF186, 0x2403, 0xF187, 0xF187, 0x5262,
- 0xF188, 0xF188, 0x206E, 0xF189, 0xF189, 0x240B, 0xF18A, 0xF193, 0x5263,
- 0xF194, 0xF194, 0x1F3F, 0xF195, 0xF197, 0x526D, 0xF198, 0xF198, 0x2067,
- 0xF199, 0xF1A0, 0x5270, 0xF1A1, 0xF1FE, 0x1B85, 0xF240, 0xF244, 0x5278,
- 0xF245, 0xF245, 0x1FD7, 0xF246, 0xF246, 0x527D, 0xF247, 0xF247, 0x1E83,
- 0xF248, 0xF24A, 0x527E, 0xF24B, 0xF24B, 0x240F, 0xF24C, 0xF252, 0x5281,
- 0xF253, 0xF253, 0x240E, 0xF254, 0xF254, 0x20C7, 0xF255, 0xF255, 0x240D,
- 0xF256, 0xF25B, 0x5288, 0xF25C, 0xF25C, 0x2412, 0xF25D, 0xF25E, 0x528E,
- 0xF25F, 0xF25F, 0x20B7, 0xF260, 0xF270, 0x5290, 0xF271, 0xF271, 0x23F0,
- 0xF272, 0xF272, 0x52A1, 0xF273, 0xF273, 0x2411, 0xF274, 0xF274, 0x2414,
- 0xF275, 0xF275, 0x52A2, 0xF276, 0xF276, 0x2170, 0xF277, 0xF27B, 0x52A3,
- 0xF27C, 0xF27C, 0x2405, 0xF27D, 0xF27D, 0x210C, 0xF27E, 0xF27E, 0x2415,
- 0xF280, 0xF284, 0x52A8, 0xF285, 0xF285, 0x2066, 0xF286, 0xF286, 0x52AD,
- 0xF287, 0xF287, 0x2352, 0xF288, 0xF288, 0x2413, 0xF289, 0xF289, 0x2410,
- 0xF28A, 0xF28B, 0x2416, 0xF28C, 0xF28C, 0x20F1, 0xF28D, 0xF290, 0x52AE,
- 0xF291, 0xF291, 0x240A, 0xF292, 0xF293, 0x52B2, 0xF294, 0xF294, 0x2409,
- 0xF295, 0xF295, 0x52B4, 0xF296, 0xF296, 0x2418, 0xF297, 0xF29B, 0x52B5,
- 0xF29C, 0xF29C, 0x1FA7, 0xF29D, 0xF29D, 0x52BA, 0xF29E, 0xF29E, 0x21FC,
- 0xF29F, 0xF2A0, 0x52BB, 0xF2A1, 0xF2FE, 0x1BE3, 0xF340, 0xF340, 0x1FC1,
- 0xF341, 0xF341, 0x2406, 0xF342, 0xF344, 0x52BD, 0xF345, 0xF345, 0x229C,
- 0xF346, 0xF347, 0x52C0, 0xF348, 0xF348, 0x204E, 0xF349, 0xF349, 0x52C2,
- 0xF34A, 0xF34A, 0x241A, 0xF34B, 0xF34B, 0x2419, 0xF34C, 0xF34F, 0x52C3,
- 0xF350, 0xF350, 0x240C, 0xF351, 0xF360, 0x52C7, 0xF361, 0xF361, 0x1E29,
- 0xF362, 0xF373, 0x52D7, 0xF374, 0xF374, 0x2661, 0xF375, 0xF375, 0x52E9,
- 0xF376, 0xF376, 0x26A4, 0xF377, 0xF377, 0x2174, 0xF378, 0xF378, 0x2663,
- 0xF379, 0xF379, 0x2662, 0xF37A, 0xF37E, 0x52EA, 0xF380, 0xF38B, 0x52EF,
- 0xF38C, 0xF38C, 0x2675, 0xF38D, 0xF39F, 0x52FB, 0xF3A0, 0xF3A0, 0x214C,
- 0xF3A1, 0xF3FE, 0x1C41, 0xF440, 0xF444, 0x530E, 0xF445, 0xF445, 0x267A,
- 0xF446, 0xF44F, 0x5313, 0xF450, 0xF450, 0x26A0, 0xF451, 0xF456, 0x531D,
- 0xF457, 0xF457, 0x2668, 0xF458, 0xF458, 0x5323, 0xF459, 0xF459, 0x1ED0,
- 0xF45A, 0xF45A, 0x5324, 0xF45B, 0xF45B, 0x2096, 0xF45C, 0xF45C, 0x5325,
- 0xF45D, 0xF45D, 0x23CC, 0xF45E, 0xF461, 0x5326, 0xF462, 0xF462, 0x23C8,
- 0xF463, 0xF463, 0x532A, 0xF464, 0xF464, 0x223E, 0xF465, 0xF474, 0x532B,
- 0xF475, 0xF475, 0x2665, 0xF476, 0xF47B, 0x533B, 0xF47C, 0xF47C, 0x2664,
- 0xF47D, 0xF47D, 0x5341, 0xF47E, 0xF47E, 0x2239, 0xF480, 0xF493, 0x5342,
- 0xF494, 0xF494, 0x204A, 0xF495, 0xF498, 0x5356, 0xF499, 0xF499, 0x261F,
- 0xF49A, 0xF49B, 0x535A, 0xF49C, 0xF49C, 0x261E, 0xF49D, 0xF4A0, 0x535C,
- 0xF4A1, 0xF4FE, 0x1C9F, 0xF540, 0xF544, 0x5360, 0xF545, 0xF545, 0x2620,
- 0xF546, 0xF546, 0x5365, 0xF547, 0xF547, 0x2621, 0xF548, 0xF551, 0x5366,
- 0xF552, 0xF552, 0x2622, 0xF553, 0xF553, 0x5370, 0xF554, 0xF554, 0x2627,
- 0xF555, 0xF555, 0x1E39, 0xF556, 0xF556, 0x2625, 0xF557, 0xF55D, 0x5371,
- 0xF55E, 0xF55E, 0x2629, 0xF55F, 0xF560, 0x5378, 0xF561, 0xF561, 0x262E,
- 0xF562, 0xF562, 0x262B, 0xF563, 0xF56D, 0x537A, 0xF56E, 0xF56E, 0x262A,
- 0xF56F, 0xF56F, 0x262D, 0xF570, 0xF570, 0x5385, 0xF571, 0xF571, 0x2628,
- 0xF572, 0xF572, 0x21B9, 0xF573, 0xF57E, 0x5386, 0xF580, 0xF584, 0x5392,
- 0xF585, 0xF585, 0x2636, 0xF586, 0xF586, 0x2630, 0xF587, 0xF58B, 0x5397,
- 0xF58C, 0xF58C, 0x2638, 0xF58D, 0xF58D, 0x539C, 0xF58E, 0xF58E, 0x200D,
- 0xF58F, 0xF58F, 0x2637, 0xF590, 0xF598, 0x539D, 0xF599, 0xF599, 0x2645,
- 0xF59A, 0xF59A, 0x53A6, 0xF59B, 0xF59B, 0x263A, 0xF59C, 0xF59F, 0x53A7,
- 0xF5A0, 0xF5A0, 0x2643, 0xF5A1, 0xF5FE, 0x1CFD, 0xF640, 0xF640, 0x53AB,
- 0xF641, 0xF641, 0x2640, 0xF642, 0xF644, 0x53AC, 0xF645, 0xF645, 0x263D,
- 0xF646, 0xF646, 0x2641, 0xF647, 0xF647, 0x53AF, 0xF648, 0xF648, 0x263E,
- 0xF649, 0xF64A, 0x53B0, 0xF64B, 0xF64B, 0x263F, 0xF64C, 0xF64C, 0x1FC0,
- 0xF64D, 0xF64D, 0x53B2, 0xF64E, 0xF64F, 0x263B, 0xF650, 0xF653, 0x53B3,
- 0xF654, 0xF654, 0x2642, 0xF655, 0xF657, 0x53B7, 0xF658, 0xF658, 0x2644,
- 0xF659, 0xF660, 0x53BA, 0xF661, 0xF661, 0x2639, 0xF662, 0xF662, 0x53C2,
- 0xF663, 0xF663, 0x264C, 0xF664, 0xF66B, 0x53C3, 0xF66C, 0xF66C, 0x2647,
- 0xF66D, 0xF66D, 0x264B, 0xF66E, 0xF670, 0x53CB, 0xF671, 0xF671, 0x2649,
- 0xF672, 0xF673, 0x53CE, 0xF674, 0xF674, 0x2648, 0xF675, 0xF675, 0x53D0,
- 0xF676, 0xF676, 0x264A, 0xF677, 0xF677, 0x2108, 0xF678, 0xF67E, 0x53D1,
- 0xF680, 0xF684, 0x53D8, 0xF685, 0xF685, 0x264D, 0xF686, 0xF687, 0x53DD,
- 0xF688, 0xF688, 0x2634, 0xF689, 0xF689, 0x53DF, 0xF68A, 0xF68A, 0x2651,
- 0xF68B, 0xF68C, 0x53E0, 0xF68D, 0xF68D, 0x2650, 0xF68E, 0xF68E, 0x2652,
- 0xF68F, 0xF691, 0x53E2, 0xF692, 0xF692, 0x264F, 0xF693, 0xF695, 0x53E5,
- 0xF696, 0xF696, 0x2632, 0xF697, 0xF697, 0x264E, 0xF698, 0xF698, 0x2653,
- 0xF699, 0xF699, 0x53E8, 0xF69A, 0xF69A, 0x2657, 0xF69B, 0xF69B, 0x53E9,
- 0xF69C, 0xF69C, 0x2635, 0xF69D, 0xF69D, 0x53EA, 0xF69E, 0xF69E, 0x2633,
- 0xF69F, 0xF69F, 0x53EB, 0xF6A0, 0xF6A0, 0x2656, 0xF6A1, 0xF6FE, 0x1D5B,
- 0xF740, 0xF741, 0x53EC, 0xF742, 0xF742, 0x2654, 0xF743, 0xF748, 0x53EE,
- 0xF749, 0xF749, 0x2658, 0xF74A, 0xF74B, 0x53F4, 0xF74C, 0xF74C, 0x2655,
- 0xF74D, 0xF74D, 0x1E4D, 0xF74E, 0xF755, 0x53F6, 0xF756, 0xF756, 0x265B,
- 0xF757, 0xF757, 0x53FE, 0xF758, 0xF758, 0x265A, 0xF759, 0xF759, 0x53FF,
- 0xF75A, 0xF75A, 0x2659, 0xF75B, 0xF75B, 0x202E, 0xF75C, 0xF75C, 0x262F,
- 0xF75D, 0xF760, 0x5400, 0xF761, 0xF761, 0x2646, 0xF762, 0xF762, 0x5404,
- 0xF763, 0xF763, 0x2626, 0xF764, 0xF76A, 0x5405, 0xF76B, 0xF76B, 0x265C,
- 0xF76C, 0xF770, 0x540C, 0xF771, 0xF771, 0x262C, 0xF772, 0xF77B, 0x5411,
- 0xF77C, 0xF77C, 0x2623, 0xF77D, 0xF77D, 0x541B, 0xF77E, 0xF77E, 0x2631,
- 0xF780, 0xF7A0, 0x541C, 0xF7A1, 0xF7FE, 0x1DB9, 0xF840, 0xF841, 0x543D,
- 0xF842, 0xF842, 0x209C, 0xF843, 0xF845, 0x543F, 0xF846, 0xF846, 0x2580,
- 0xF847, 0xF848, 0x5442, 0xF849, 0xF849, 0x22DC, 0xF84A, 0xF84F, 0x5444,
- 0xF850, 0xF850, 0x1F05, 0xF851, 0xF851, 0x208B, 0xF852, 0xF852, 0x544A,
- 0xF853, 0xF853, 0x2581, 0xF854, 0xF862, 0x544B, 0xF863, 0xF863, 0x2583,
- 0xF864, 0xF864, 0x2582, 0xF865, 0xF865, 0x545A, 0xF866, 0xF866, 0x21EE,
- 0xF867, 0xF871, 0x545B, 0xF872, 0xF872, 0x2182, 0xF873, 0xF877, 0x5466,
- 0xF878, 0xF878, 0x2243, 0xF879, 0xF879, 0x546B, 0xF87A, 0xF87A, 0x2587,
- 0xF87B, 0xF87B, 0x546C, 0xF87C, 0xF87C, 0x2588, 0xF87D, 0xF87E, 0x546D,
- 0xF880, 0xF880, 0x546F, 0xF881, 0xF881, 0x2584, 0xF882, 0xF883, 0x5470,
- 0xF884, 0xF884, 0x21FD, 0xF885, 0xF885, 0x5472, 0xF886, 0xF886, 0x21EF,
- 0xF887, 0xF88C, 0x5473, 0xF88D, 0xF88D, 0x258A, 0xF88E, 0xF88E, 0x258C,
- 0xF88F, 0xF898, 0x5479, 0xF899, 0xF899, 0x1F47, 0xF89A, 0xF89C, 0x5483,
- 0xF89D, 0xF89D, 0x1F1D, 0xF89E, 0xF89F, 0x5486, 0xF8A0, 0xF8A0, 0x258D,
- 0xF940, 0xF94D, 0x5488, 0xF94E, 0xF94E, 0x1FD0, 0xF94F, 0xF94F, 0x2592,
- 0xF950, 0xF950, 0x258F, 0xF951, 0xF958, 0x5496, 0xF959, 0xF959, 0x2594,
- 0xF95A, 0xF95A, 0x1EE0, 0xF95B, 0xF95C, 0x549E, 0xF95D, 0xF95D, 0x2591,
- 0xF95E, 0xF95E, 0x2595, 0xF95F, 0xF966, 0x54A0, 0xF967, 0xF967, 0x2597,
- 0xF968, 0xF968, 0x54A8, 0xF969, 0xF969, 0x20B6, 0xF96A, 0xF96B, 0x54A9,
- 0xF96C, 0xF96C, 0x2598, 0xF96D, 0xF96E, 0x54AB, 0xF96F, 0xF96F, 0x20F6,
- 0xF970, 0xF97E, 0x54AD, 0xF980, 0xF984, 0x54BC, 0xF985, 0xF985, 0x2585,
- 0xF986, 0xF986, 0x54C1, 0xF987, 0xF987, 0x2599, 0xF988, 0xF990, 0x54C2,
- 0xF991, 0xF991, 0x2596, 0xF992, 0xF995, 0x54CB, 0xF996, 0xF996, 0x259A,
- 0xF997, 0xF997, 0x54CF, 0xF998, 0xF998, 0x259B, 0xF999, 0xF9A0, 0x54D0,
- 0xFA40, 0xFA41, 0x54D8, 0xFA42, 0xFA42, 0x259D, 0xFA43, 0xFA45, 0x54DA,
- 0xFA46, 0xFA46, 0x259E, 0xFA47, 0xFA4B, 0x54DD, 0xFA4C, 0xFA4C, 0x234C,
- 0xFA4D, 0xFA50, 0x54E2, 0xFA51, 0xFA51, 0x1F44, 0xFA52, 0xFA57, 0x54E6,
- 0xFA58, 0xFA58, 0x2660, 0xFA59, 0xFA59, 0x25A0, 0xFA5A, 0xFA5C, 0x54EC,
- 0xFA5D, 0xFA5D, 0x259C, 0xFA5E, 0xFA5E, 0x54EF, 0xFA5F, 0xFA5F, 0x259F,
- 0xFA60, 0xFA60, 0x54F0, 0xFA61, 0xFA61, 0x1F6C, 0xFA62, 0xFA6F, 0x54F1,
- 0xFA70, 0xFA70, 0x25A2, 0xFA71, 0xFA73, 0x54FF, 0xFA74, 0xFA74, 0x20AE,
- 0xFA75, 0xFA75, 0x5502, 0xFA76, 0xFA76, 0x258B, 0xFA77, 0xFA77, 0x25A3,
- 0xFA78, 0xFA7E, 0x5503, 0xFA80, 0xFA82, 0x550A, 0xFA83, 0xFA83, 0x2589,
- 0xFA84, 0xFA84, 0x25A5, 0xFA85, 0xFA8C, 0x550D, 0xFA8D, 0xFA8D, 0x25A4,
- 0xFA8E, 0xFA8F, 0x5515, 0xFA90, 0xFA90, 0x25A6, 0xFA91, 0xFA91, 0x2593,
- 0xFA92, 0xFA95, 0x5517, 0xFA96, 0xFA96, 0x25A7, 0xFA97, 0xFA97, 0x2222,
- 0xFA98, 0xFA98, 0x25A9, 0xFA99, 0xFAA0, 0x551B, 0xFB40, 0xFB48, 0x5523,
- 0xFB49, 0xFB49, 0x25A8, 0xFB4A, 0xFB51, 0x552C, 0xFB52, 0xFB52, 0x2586,
- 0xFB53, 0xFB56, 0x5534, 0xFB57, 0xFB57, 0x25A1, 0xFB58, 0xFB58, 0x25AA,
- 0xFB59, 0xFB59, 0x5538, 0xFB5A, 0xFB5A, 0x2590, 0xFB5B, 0xFB5B, 0x258E,
- 0xFB5C, 0xFB74, 0x5539, 0xFB75, 0xFB75, 0x2688, 0xFB76, 0xFB78, 0x5552,
- 0xFB79, 0xFB79, 0x269E, 0xFB7A, 0xFB7A, 0x25FB, 0xFB7B, 0xFB7B, 0x5555,
- 0xFB7C, 0xFB7C, 0x1F8C, 0xFB7D, 0xFB7D, 0x21F4, 0xFB7E, 0xFB7E, 0x5556,
- 0xFB80, 0xFB8F, 0x5557, 0xFB90, 0xFB90, 0x200F, 0xFB91, 0xFB9B, 0x5567,
- 0xFB9C, 0xFB9C, 0x2071, 0xFB9D, 0xFB9E, 0x5572, 0xFB9F, 0xFB9F, 0x25F7,
- 0xFBA0, 0xFBA0, 0x5574, 0xFC40, 0xFC43, 0x5575, 0xFC44, 0xFC44, 0x2696,
- 0xFC45, 0xFC48, 0x5579, 0xFC49, 0xFC49, 0x268F, 0xFC4A, 0xFC59, 0x557D,
- 0xFC5A, 0xFC5A, 0x22DA, 0xFC5B, 0xFC62, 0x558D, 0xFC63, 0xFC63, 0x1EC1,
- 0xFC64, 0xFC67, 0x5595, 0xFC68, 0xFC68, 0x1EB3, 0xFC69, 0xFC6E, 0x5599,
- 0xFC6F, 0xFC6F, 0x266A, 0xFC70, 0xFC70, 0x559F, 0xFC71, 0xFC71, 0x268A,
- 0xFC72, 0xFC73, 0x55A0, 0xFC74, 0xFC74, 0x2669, 0xFC75, 0xFC76, 0x55A2,
- 0xFC77, 0xFC78, 0x2618, 0xFC79, 0xFC7E, 0x55A4, 0xFC80, 0xFC82, 0x55AA,
- 0xFC83, 0xFC83, 0x261A, 0xFC84, 0xFC89, 0x55AD, 0xFC8A, 0xFC8A, 0x2673,
- 0xFC8B, 0xFCA0, 0x55B3, 0xFD40, 0xFD51, 0x55C9, 0xFD52, 0xFD52, 0x20C6,
- 0xFD53, 0xFD53, 0x226B, 0xFD54, 0xFD56, 0x55DB, 0xFD57, 0xFD57, 0x24D3,
- 0xFD58, 0xFD58, 0x1E86, 0xFD59, 0xFD59, 0x55DE, 0xFD5A, 0xFD5A, 0x260F,
- 0xFD5B, 0xFD5E, 0x55DF, 0xFD5F, 0xFD5F, 0x2611, 0xFD60, 0xFD61, 0x55E3,
- 0xFD62, 0xFD62, 0x2613, 0xFD63, 0xFD64, 0x55E5, 0xFD65, 0xFD65, 0x2610,
- 0xFD66, 0xFD66, 0x2612, 0xFD67, 0xFD67, 0x2030, 0xFD68, 0xFD68, 0x55E7,
- 0xFD69, 0xFD69, 0x2671, 0xFD6A, 0xFD6B, 0x55E8, 0xFD6C, 0xFD6C, 0x2614,
- 0xFD6D, 0xFD6F, 0x55EA, 0xFD70, 0xFD70, 0x2616, 0xFD71, 0xFD71, 0x55ED,
- 0xFD72, 0xFD72, 0x2615, 0xFD73, 0xFD77, 0x55EE, 0xFD78, 0xFD78, 0x20F2,
- 0xFD79, 0xFD7C, 0x55F3, 0xFD7D, 0xFD7D, 0x2617, 0xFD7E, 0xFD7E, 0x55F7,
- 0xFD80, 0xFD87, 0x55F8, 0xFD88, 0xFD88, 0x2037, 0xFD89, 0xFD8A, 0x5600,
- 0xFD8B, 0xFD8B, 0x20B3, 0xFD8C, 0xFD8E, 0x5602, 0xFD8F, 0xFD8F, 0x1F22,
- 0xFD90, 0xFD90, 0x24ED, 0xFD91, 0xFD93, 0x5605, 0xFD94, 0xFD94, 0x1F34,
- 0xFD95, 0xFD9C, 0x5608, 0xFD9D, 0xFD9D, 0x0A02, 0xFD9E, 0xFD9E, 0x40D3,
- 0xFD9F, 0xFD9F, 0x200C, 0xFDA0, 0xFDA0, 0x5083, 0xFE40, 0xFE40, 0x1259,
- 0xFE41, 0xFE7E, 0x5610, 0xFE80, 0xFEA0, 0x564E,
-};
+// 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
+
+extern const unsigned short g_FXCMAP_GBKp_EUC_H_2[4070 * 3] = {
+ 0x0020, 0x007E, 0x0001, 0x8140, 0x8178, 0x2758, 0x8179, 0x8179, 0x2059,
+ 0x817A, 0x817E, 0x2791, 0x8180, 0x8185, 0x2796, 0x8186, 0x8186, 0x21F1,
+ 0x8187, 0x81EC, 0x279C, 0x81ED, 0x81ED, 0x1FF2, 0x81EE, 0x81F5, 0x2802,
+ 0x81F6, 0x81F6, 0x205D, 0x81F7, 0x81FE, 0x280A, 0x8240, 0x8252, 0x2812,
+ 0x8253, 0x8253, 0x269C, 0x8254, 0x8261, 0x2825, 0x8262, 0x8262, 0x21B5,
+ 0x8263, 0x8273, 0x2833, 0x8274, 0x8274, 0x22CC, 0x8275, 0x8279, 0x2844,
+ 0x827A, 0x827A, 0x2016, 0x827B, 0x827C, 0x2849, 0x827D, 0x827D, 0x1E62,
+ 0x827E, 0x827E, 0x284B, 0x8280, 0x8280, 0x1F20, 0x8281, 0x8282, 0x284C,
+ 0x8283, 0x8283, 0x207F, 0x8284, 0x828F, 0x284E, 0x8290, 0x8290, 0x205C,
+ 0x8291, 0x82A4, 0x285A, 0x82A5, 0x82A5, 0x2194, 0x82A6, 0x82C7, 0x286E,
+ 0x82C8, 0x82C8, 0x1E65, 0x82C9, 0x82C9, 0x2281, 0x82CA, 0x82E0, 0x2890,
+ 0x82E1, 0x82E1, 0x22CD, 0x82E2, 0x82E2, 0x28A7, 0x82E3, 0x82E3, 0x210A,
+ 0x82E4, 0x82E4, 0x1E3E, 0x82E5, 0x82EC, 0x28A8, 0x82ED, 0x82ED, 0x267F,
+ 0x82EE, 0x82F1, 0x28B0, 0x82F2, 0x82F2, 0x222E, 0x82F3, 0x82F6, 0x28B4,
+ 0x82F7, 0x82F7, 0x1E96, 0x82F8, 0x82F8, 0x22CB, 0x82F9, 0x82F9, 0x226C,
+ 0x82FA, 0x82FA, 0x28B8, 0x82FB, 0x82FB, 0x2117, 0x82FC, 0x82FE, 0x28B9,
+ 0x8340, 0x8340, 0x28BC, 0x8341, 0x8341, 0x20E8, 0x8342, 0x8344, 0x28BD,
+ 0x8345, 0x8345, 0x22D4, 0x8346, 0x8347, 0x28C0, 0x8348, 0x8348, 0x1FB9,
+ 0x8349, 0x834B, 0x28C2, 0x834C, 0x834C, 0x22D8, 0x834D, 0x8352, 0x28C5,
+ 0x8353, 0x8353, 0x20DF, 0x8354, 0x8356, 0x28CB, 0x8357, 0x8357, 0x20C2,
+ 0x8358, 0x835D, 0x28CE, 0x835E, 0x835E, 0x2195, 0x835F, 0x8364, 0x28D4,
+ 0x8365, 0x8365, 0x1FAC, 0x8366, 0x8366, 0x22D3, 0x8367, 0x8371, 0x28DA,
+ 0x8372, 0x8372, 0x1F81, 0x8373, 0x8377, 0x28E5, 0x8378, 0x8378, 0x2210,
+ 0x8379, 0x8379, 0x28EA, 0x837A, 0x837A, 0x22CF, 0x837B, 0x837B, 0x28EB,
+ 0x837C, 0x837C, 0x2213, 0x837D, 0x837D, 0x28EC, 0x837E, 0x837E, 0x1FE4,
+ 0x8380, 0x8380, 0x1F90, 0x8381, 0x8385, 0x28ED, 0x8386, 0x8386, 0x22D6,
+ 0x8387, 0x8388, 0x28F2, 0x8389, 0x8389, 0x22D0, 0x838A, 0x838A, 0x22CE,
+ 0x838B, 0x838C, 0x28F4, 0x838D, 0x838D, 0x2681, 0x838E, 0x8393, 0x28F6,
+ 0x8394, 0x8394, 0x1E76, 0x8395, 0x839D, 0x28FC, 0x839E, 0x839E, 0x2231,
+ 0x839F, 0x83A5, 0x2905, 0x83A6, 0x83A6, 0x1E93, 0x83A7, 0x83AA, 0x290C,
+ 0x83AB, 0x83AB, 0x22D2, 0x83AC, 0x83AD, 0x2910, 0x83AE, 0x83AE, 0x22D7,
+ 0x83AF, 0x83AF, 0x22D5, 0x83B0, 0x83B0, 0x22D1, 0x83B1, 0x83B9, 0x2912,
+ 0x83BA, 0x83BA, 0x1EE5, 0x83BB, 0x83C8, 0x291B, 0x83C9, 0x83C9, 0x2025,
+ 0x83CA, 0x83F5, 0x2929, 0x83F6, 0x83F6, 0x1ECF, 0x83F7, 0x83FE, 0x2955,
+ 0x8440, 0x844F, 0x295D, 0x8450, 0x8450, 0x1FD9, 0x8451, 0x8470, 0x296D,
+ 0x8471, 0x8471, 0x22C8, 0x8472, 0x8473, 0x298D, 0x8474, 0x8474, 0x2263,
+ 0x8475, 0x8476, 0x298F, 0x8477, 0x8477, 0x2683, 0x8478, 0x847E, 0x2991,
+ 0x8480, 0x8481, 0x2998, 0x8482, 0x8482, 0x1F17, 0x8483, 0x848D, 0x299A,
+ 0x848E, 0x848E, 0x1F2B, 0x848F, 0x8491, 0x29A5, 0x8492, 0x8492, 0x22CA,
+ 0x8493, 0x8493, 0x1E99, 0x8494, 0x849C, 0x29A8, 0x849D, 0x849D, 0x1F4F,
+ 0x849E, 0x84A0, 0x29B1, 0x84A1, 0x84A1, 0x1FCF, 0x84A2, 0x84A2, 0x2036,
+ 0x84A3, 0x84A3, 0x1F3A, 0x84A4, 0x84A4, 0x29B4, 0x84A5, 0x84A5, 0x22C9,
+ 0x84A6, 0x84A6, 0x1F99, 0x84A7, 0x84A8, 0x29B5, 0x84A9, 0x84A9, 0x1F75,
+ 0x84AA, 0x84C4, 0x29B7, 0x84C5, 0x84C5, 0x1FBE, 0x84C6, 0x84D2, 0x29D2,
+ 0x84D3, 0x84D3, 0x1ECD, 0x84D4, 0x84D4, 0x29DF, 0x84D5, 0x84D5, 0x21A9,
+ 0x84D6, 0x84D6, 0x29E0, 0x84D7, 0x84D7, 0x21E6, 0x84D8, 0x84D8, 0x29E1,
+ 0x84D9, 0x84D9, 0x2127, 0x84DA, 0x84DA, 0x2003, 0x84DB, 0x84DC, 0x29E2,
+ 0x84DD, 0x84DD, 0x2132, 0x84DE, 0x84E9, 0x29E4, 0x84EA, 0x84EA, 0x2323,
+ 0x84EB, 0x84ED, 0x29F0, 0x84EE, 0x84EE, 0x2011, 0x84EF, 0x84F0, 0x29F3,
+ 0x84F1, 0x84F1, 0x20F5, 0x84F2, 0x84FE, 0x29F5, 0x8540, 0x8550, 0x2A02,
+ 0x8551, 0x8551, 0x22C5, 0x8552, 0x8552, 0x1F5E, 0x8553, 0x8553, 0x2A13,
+ 0x8554, 0x8554, 0x22C6, 0x8555, 0x855D, 0x2A14, 0x855E, 0x855E, 0x20EF,
+ 0x855F, 0x8565, 0x2A1D, 0x8566, 0x8566, 0x21D0, 0x8567, 0x857E, 0x2A24,
+ 0x8580, 0x8586, 0x2A3C, 0x8587, 0x8587, 0x22C1, 0x8588, 0x858A, 0x2A43,
+ 0x858B, 0x858B, 0x1E64, 0x858C, 0x8591, 0x2A46, 0x8592, 0x8592, 0x21F9,
+ 0x8593, 0x8595, 0x2A4C, 0x8596, 0x8596, 0x2010, 0x8597, 0x8597, 0x2A4F,
+ 0x8598, 0x8598, 0x22C2, 0x8599, 0x85A1, 0x2A50, 0x85A2, 0x85A2, 0x1E5A,
+ 0x85A3, 0x85B1, 0x2A59, 0x85B2, 0x85B2, 0x1EA2, 0x85B3, 0x85FE, 0x2A68,
+ 0x8640, 0x8649, 0x2AB4, 0x864A, 0x864A, 0x236D, 0x864B, 0x8653, 0x2ABE,
+ 0x8654, 0x8654, 0x2247, 0x8655, 0x8667, 0x2AC7, 0x8668, 0x8668, 0x236C,
+ 0x8669, 0x867E, 0x2ADA, 0x8680, 0x8695, 0x2AF0, 0x8696, 0x8696, 0x219C,
+ 0x8697, 0x8698, 0x2B06, 0x8699, 0x8699, 0x20C9, 0x869A, 0x86A0, 0x2B08,
+ 0x86A1, 0x86A1, 0x21F0, 0x86A2, 0x86C9, 0x2B0F, 0x86CA, 0x86CA, 0x210B,
+ 0x86CB, 0x86CB, 0x2B37, 0x86CC, 0x86CC, 0x20DE, 0x86CD, 0x86CD, 0x2B38,
+ 0x86CE, 0x86CE, 0x1EAA, 0x86CF, 0x86D0, 0x2B39, 0x86D1, 0x86D1, 0x222C,
+ 0x86D2, 0x86DB, 0x2B3B, 0x86DC, 0x86DC, 0x20D8, 0x86DD, 0x86DD, 0x22C0,
+ 0x86DE, 0x86E0, 0x2B45, 0x86E1, 0x86E1, 0x206F, 0x86E2, 0x86E7, 0x2B48,
+ 0x86E8, 0x86E8, 0x21A1, 0x86E9, 0x86ED, 0x2B4E, 0x86EE, 0x86EE, 0x2379,
+ 0x86EF, 0x86F3, 0x2B53, 0x86F4, 0x86F4, 0x2372, 0x86F5, 0x86FE, 0x2B58,
+ 0x8740, 0x8740, 0x216A, 0x8741, 0x8743, 0x2B62, 0x8744, 0x8744, 0x237C,
+ 0x8745, 0x8748, 0x2B65, 0x8749, 0x8749, 0x20B0, 0x874A, 0x874A, 0x2B69,
+ 0x874B, 0x874B, 0x237A, 0x874C, 0x874C, 0x1E74, 0x874D, 0x874E, 0x2B6A,
+ 0x874F, 0x874F, 0x2377, 0x8750, 0x8756, 0x2B6C, 0x8757, 0x8757, 0x1F4C,
+ 0x8758, 0x8759, 0x2B73, 0x875A, 0x875A, 0x2378, 0x875B, 0x875B, 0x21CF,
+ 0x875C, 0x875C, 0x2368, 0x875D, 0x875D, 0x2B75, 0x875E, 0x875E, 0x2371,
+ 0x875F, 0x875F, 0x2B76, 0x8760, 0x8760, 0x2369, 0x8761, 0x8765, 0x2B77,
+ 0x8766, 0x8766, 0x2674, 0x8767, 0x8779, 0x2B7C, 0x877A, 0x877A, 0x236F,
+ 0x877B, 0x877C, 0x2B8F, 0x877D, 0x877D, 0x2370, 0x877E, 0x877E, 0x2B91,
+ 0x8780, 0x8780, 0x2B92, 0x8781, 0x8781, 0x2376, 0x8782, 0x8782, 0x2373,
+ 0x8783, 0x8785, 0x2B93, 0x8786, 0x8786, 0x237F, 0x8787, 0x8787, 0x2B96,
+ 0x8788, 0x8788, 0x2374, 0x8789, 0x8789, 0x2B97, 0x878A, 0x878A, 0x20B5,
+ 0x878B, 0x878C, 0x2B98, 0x878D, 0x878D, 0x1EDB, 0x878E, 0x878E, 0x2672,
+ 0x878F, 0x8792, 0x2B9A, 0x8793, 0x8793, 0x236E, 0x8794, 0x8797, 0x2B9E,
+ 0x8798, 0x8798, 0x21B7, 0x8799, 0x879C, 0x2BA2, 0x879D, 0x879D, 0x2375,
+ 0x879E, 0x87A2, 0x2BA6, 0x87A3, 0x87A3, 0x2382, 0x87A4, 0x87A6, 0x2BAB,
+ 0x87A7, 0x87A7, 0x209E, 0x87A8, 0x87B2, 0x2BAE, 0x87B3, 0x87B3, 0x236B,
+ 0x87B4, 0x87B4, 0x2BB9, 0x87B5, 0x87B5, 0x2039, 0x87B6, 0x87BA, 0x2BBA,
+ 0x87BB, 0x87BB, 0x269F, 0x87BC, 0x87BE, 0x2BBF, 0x87BF, 0x87BF, 0x237D,
+ 0x87C0, 0x87C0, 0x21F5, 0x87C1, 0x87C1, 0x2BC2, 0x87C2, 0x87C2, 0x2381,
+ 0x87C3, 0x87C9, 0x2BC3, 0x87CA, 0x87CA, 0x237B, 0x87CB, 0x87CB, 0x237E,
+ 0x87CC, 0x87CC, 0x21CC, 0x87CD, 0x87CE, 0x2BCA, 0x87CF, 0x87CF, 0x22DB,
+ 0x87D0, 0x87D1, 0x2BCC, 0x87D2, 0x87D2, 0x236A, 0x87D3, 0x87D3, 0x2689,
+ 0x87D4, 0x87D4, 0x2BCE, 0x87D5, 0x87D5, 0x2697, 0x87D6, 0x87D9, 0x2BCF,
+ 0x87DA, 0x87DA, 0x22A1, 0x87DB, 0x87F6, 0x2BD3, 0x87F7, 0x87F7, 0x2383,
+ 0x87F8, 0x87F8, 0x1F3D, 0x87F9, 0x87F9, 0x2BEF, 0x87FA, 0x87FA, 0x218F,
+ 0x87FB, 0x87FE, 0x2BF0, 0x8840, 0x8840, 0x2246, 0x8841, 0x8841, 0x2248,
+ 0x8842, 0x8843, 0x2BF4, 0x8844, 0x8844, 0x217E, 0x8845, 0x8845, 0x2BF6,
+ 0x8846, 0x8846, 0x2180, 0x8847, 0x887E, 0x2BF7, 0x8880, 0x88B9, 0x2C2F,
+ 0x88BA, 0x88BA, 0x232A, 0x88BB, 0x88CB, 0x2C69, 0x88CC, 0x88CC, 0x228B,
+ 0x88CD, 0x88D3, 0x2C7A, 0x88D4, 0x88D4, 0x1F85, 0x88D5, 0x88D6, 0x2C81,
+ 0x88D7, 0x88D7, 0x2325, 0x88D8, 0x88DE, 0x2C83, 0x88DF, 0x88DF, 0x232C,
+ 0x88E0, 0x88E4, 0x2C8A, 0x88E5, 0x88E5, 0x232E, 0x88E6, 0x88F1, 0x2C8F,
+ 0x88F2, 0x88F2, 0x2205, 0x88F3, 0x88F3, 0x1E38, 0x88F4, 0x88F5, 0x2C9B,
+ 0x88F6, 0x88F6, 0x1E73, 0x88F7, 0x88FE, 0x2C9D, 0x8940, 0x894A, 0x2CA5,
+ 0x894B, 0x894B, 0x1FE3, 0x894C, 0x894C, 0x2339, 0x894D, 0x894D, 0x2CB0,
+ 0x894E, 0x894E, 0x232B, 0x894F, 0x894F, 0x2CB1, 0x8950, 0x8950, 0x232D,
+ 0x8951, 0x8953, 0x2CB2, 0x8954, 0x8954, 0x217F, 0x8955, 0x895C, 0x2CB5,
+ 0x895D, 0x895D, 0x21A7, 0x895E, 0x895E, 0x2CBD, 0x895F, 0x895F, 0x232F,
+ 0x8960, 0x896C, 0x2CBE, 0x896D, 0x896D, 0x1E7D, 0x896E, 0x8970, 0x2CCB,
+ 0x8971, 0x8971, 0x20D6, 0x8972, 0x897B, 0x2CCE, 0x897C, 0x897C, 0x1EC2,
+ 0x897D, 0x897E, 0x2CD8, 0x8980, 0x898A, 0x2CDA, 0x898B, 0x898B, 0x22B2,
+ 0x898C, 0x8998, 0x2CE5, 0x8999, 0x8999, 0x1EDF, 0x899A, 0x899D, 0x2CF2,
+ 0x899E, 0x899E, 0x1EF9, 0x899F, 0x89A5, 0x2CF6, 0x89A6, 0x89A6, 0x20D9,
+ 0x89A7, 0x89A7, 0x2CFD, 0x89A8, 0x89A8, 0x1FDD, 0x89A9, 0x89AE, 0x2CFE,
+ 0x89AF, 0x89AF, 0x2167, 0x89B0, 0x89B9, 0x2D04, 0x89BA, 0x89BA, 0x21ED,
+ 0x89BB, 0x89BD, 0x2D0E, 0x89BE, 0x89BE, 0x2007, 0x89BF, 0x89BF, 0x2326,
+ 0x89C0, 0x89C0, 0x2329, 0x89C1, 0x89C3, 0x2D11, 0x89C4, 0x89C4, 0x1F52,
+ 0x89C5, 0x89C5, 0x203B, 0x89C6, 0x89C6, 0x2328, 0x89C7, 0x89C7, 0x2D14,
+ 0x89C8, 0x89C8, 0x2327, 0x89C9, 0x89CD, 0x2D15, 0x89CE, 0x89CE, 0x1E2B,
+ 0x89CF, 0x89D0, 0x2D1A, 0x89D1, 0x89D1, 0x22AE, 0x89D2, 0x89D7, 0x2D1C,
+ 0x89D8, 0x89D8, 0x1F49, 0x89D9, 0x89DA, 0x2D22, 0x89DB, 0x89DB, 0x2138,
+ 0x89DC, 0x89F3, 0x2D24, 0x89F4, 0x89F4, 0x2081, 0x89F5, 0x89FE, 0x2D3C,
+ 0x8A40, 0x8A40, 0x2D46, 0x8A41, 0x8A41, 0x1F7C, 0x8A42, 0x8A58, 0x2D47,
+ 0x8A59, 0x8A59, 0x235B, 0x8A5A, 0x8A5A, 0x1EDE, 0x8A5B, 0x8A5B, 0x2D5E,
+ 0x8A5C, 0x8A5C, 0x1FA2, 0x8A5D, 0x8A5D, 0x2D5F, 0x8A5E, 0x8A5E, 0x1EFA,
+ 0x8A5F, 0x8A78, 0x2D60, 0x8A79, 0x8A79, 0x22AD, 0x8A7A, 0x8A7E, 0x2D7A,
+ 0x8A80, 0x8AE3, 0x2D7F, 0x8AE4, 0x8AE4, 0x203F, 0x8AE5, 0x8AFE, 0x2DE3,
+ 0x8B40, 0x8B43, 0x2DFD, 0x8B44, 0x8B44, 0x1F0E, 0x8B45, 0x8B48, 0x2E01,
+ 0x8B49, 0x8B49, 0x23F9, 0x8B4A, 0x8B79, 0x2E05, 0x8B7A, 0x8B7A, 0x23FC,
+ 0x8B7B, 0x8B7E, 0x2E35, 0x8B80, 0x8B8B, 0x2E39, 0x8B8C, 0x8B8C, 0x2069,
+ 0x8B8D, 0x8B9D, 0x2E45, 0x8B9E, 0x8B9E, 0x23F7, 0x8B9F, 0x8BB2, 0x2E56,
+ 0x8BB3, 0x8BB3, 0x23F6, 0x8BB4, 0x8BB8, 0x2E6A, 0x8BB9, 0x8BB9, 0x23FD,
+ 0x8BBA, 0x8BBD, 0x2E6F, 0x8BBE, 0x8BBE, 0x23F8, 0x8BBF, 0x8BC5, 0x2E73,
+ 0x8BC6, 0x8BC6, 0x23FA, 0x8BC7, 0x8BC7, 0x2E7A, 0x8BC8, 0x8BC8, 0x23FE,
+ 0x8BC9, 0x8BC9, 0x1FA8, 0x8BCA, 0x8BD3, 0x2E7B, 0x8BD4, 0x8BD4, 0x2401,
+ 0x8BD5, 0x8BDB, 0x2E85, 0x8BDC, 0x8BDC, 0x23FF, 0x8BDD, 0x8BE4, 0x2E8C,
+ 0x8BE5, 0x8BE5, 0x2400, 0x8BE6, 0x8BEA, 0x2E94, 0x8BEB, 0x8BEB, 0x2221,
+ 0x8BEC, 0x8BEF, 0x2E99, 0x8BF0, 0x8BF0, 0x2122, 0x8BF1, 0x8BFE, 0x2E9D,
+ 0x8C40, 0x8C43, 0x2EAB, 0x8C44, 0x8C44, 0x23FB, 0x8C45, 0x8C4E, 0x2EAF,
+ 0x8C4F, 0x8C4F, 0x215A, 0x8C50, 0x8C56, 0x2EB9, 0x8C57, 0x8C57, 0x21E5,
+ 0x8C58, 0x8C5B, 0x2EC0, 0x8C5C, 0x8C5C, 0x2057, 0x8C5D, 0x8C7E, 0x2EC4,
+ 0x8C80, 0x8C8A, 0x2EE6, 0x8C8B, 0x8C8B, 0x20E5, 0x8C8C, 0x8C8C, 0x2EF1,
+ 0x8C8D, 0x8C8D, 0x212F, 0x8C8E, 0x8C8E, 0x20A3, 0x8C8F, 0x8C8F, 0x2121,
+ 0x8C90, 0x8C90, 0x2EF2, 0x8C91, 0x8C91, 0x21D4, 0x8C92, 0x8C92, 0x1FE5,
+ 0x8C93, 0x8C98, 0x2EF3, 0x8C99, 0x8C99, 0x1E8A, 0x8C9A, 0x8C9A, 0x1E37,
+ 0x8C9B, 0x8CA1, 0x2EF9, 0x8CA2, 0x8CA2, 0x1F9E, 0x8CA3, 0x8CA3, 0x22A6,
+ 0x8CA4, 0x8CA4, 0x21E8, 0x8CA5, 0x8CA5, 0x2F00, 0x8CA6, 0x8CA6, 0x1EDA,
+ 0x8CA7, 0x8CA7, 0x1EB9, 0x8CA8, 0x8CBF, 0x2F01, 0x8CC0, 0x8CC0, 0x235C,
+ 0x8CC1, 0x8CD1, 0x2F19, 0x8CD2, 0x8CD2, 0x2050, 0x8CD3, 0x8CD3, 0x1E67,
+ 0x8CD4, 0x8CD4, 0x2F2A, 0x8CD5, 0x8CD5, 0x23F4, 0x8CD6, 0x8CD8, 0x2F2B,
+ 0x8CD9, 0x8CD9, 0x213E, 0x8CDA, 0x8CF8, 0x2F2E, 0x8CF9, 0x8CF9, 0x1F16,
+ 0x8CFA, 0x8CFE, 0x2F4D, 0x8D40, 0x8D72, 0x2F52, 0x8D73, 0x8D73, 0x2389,
+ 0x8D74, 0x8D74, 0x2F85, 0x8D75, 0x8D75, 0x1EB7, 0x8D76, 0x8D7A, 0x2F86,
+ 0x8D7B, 0x8D7B, 0x21B4, 0x8D7C, 0x8D7E, 0x2F8B, 0x8D80, 0x8D87, 0x2F8E,
+ 0x8D88, 0x8D88, 0x238F, 0x8D89, 0x8D8E, 0x2F96, 0x8D8F, 0x8D8F, 0x1F1A,
+ 0x8D90, 0x8D9D, 0x2F9C, 0x8D9E, 0x8D9E, 0x238B, 0x8D9F, 0x8DB8, 0x2FAA,
+ 0x8DB9, 0x8DB9, 0x238A, 0x8DBA, 0x8DE1, 0x2FC4, 0x8DE2, 0x8DE2, 0x2391,
+ 0x8DE3, 0x8DE3, 0x2FEC, 0x8DE4, 0x8DE4, 0x2271, 0x8DE5, 0x8DE6, 0x2FED,
+ 0x8DE7, 0x8DE7, 0x2388, 0x8DE8, 0x8DF6, 0x2FEF, 0x8DF7, 0x8DF7, 0x238E,
+ 0x8DF8, 0x8DFD, 0x2FFE, 0x8DFE, 0x8DFE, 0x238D, 0x8E40, 0x8E45, 0x3004,
+ 0x8E46, 0x8E46, 0x238C, 0x8E47, 0x8E55, 0x300A, 0x8E56, 0x8E56, 0x2390,
+ 0x8E57, 0x8E57, 0x3019, 0x8E58, 0x8E58, 0x2033, 0x8E59, 0x8E59, 0x301A,
+ 0x8E5A, 0x8E5A, 0x223C, 0x8E5B, 0x8E67, 0x301B, 0x8E68, 0x8E68, 0x1FE9,
+ 0x8E69, 0x8E6D, 0x3028, 0x8E6E, 0x8E6E, 0x2055, 0x8E6F, 0x8E6F, 0x302D,
+ 0x8E70, 0x8E70, 0x2392, 0x8E71, 0x8E7E, 0x302E, 0x8E80, 0x8E80, 0x2324,
+ 0x8E81, 0x8E9A, 0x303C, 0x8E9B, 0x8E9B, 0x2143, 0x8E9C, 0x8E9E, 0x3056,
+ 0x8E9F, 0x8E9F, 0x2129, 0x8EA0, 0x8EA3, 0x3059, 0x8EA4, 0x8EA4, 0x2277,
+ 0x8EA5, 0x8EA6, 0x305D, 0x8EA7, 0x8EA7, 0x1EA7, 0x8EA8, 0x8EAB, 0x305F,
+ 0x8EAC, 0x8EAC, 0x2285, 0x8EAD, 0x8EAD, 0x3063, 0x8EAE, 0x8EAE, 0x2384,
+ 0x8EAF, 0x8EBC, 0x3064, 0x8EBD, 0x8EBD, 0x2387, 0x8EBE, 0x8EBE, 0x2386,
+ 0x8EBF, 0x8EC2, 0x3072, 0x8EC3, 0x8EC3, 0x2290, 0x8EC4, 0x8EC4, 0x3076,
+ 0x8EC5, 0x8EC5, 0x1E44, 0x8EC6, 0x8ECC, 0x3077, 0x8ECD, 0x8ECD, 0x1E32,
+ 0x8ECE, 0x8ECE, 0x2385, 0x8ECF, 0x8ED5, 0x307E, 0x8ED6, 0x8ED6, 0x1F13,
+ 0x8ED7, 0x8ED7, 0x1F73, 0x8ED8, 0x8EEB, 0x3085, 0x8EEC, 0x8EEC, 0x1FE0,
+ 0x8EED, 0x8EFE, 0x3099, 0x8F40, 0x8F51, 0x30AB, 0x8F52, 0x8F52, 0x2087,
+ 0x8F53, 0x8F53, 0x1E78, 0x8F54, 0x8F54, 0x23AE, 0x8F55, 0x8F55, 0x1EF6,
+ 0x8F56, 0x8F56, 0x1F31, 0x8F57, 0x8F5C, 0x30BD, 0x8F5D, 0x8F5D, 0x2045,
+ 0x8F5E, 0x8F63, 0x30C3, 0x8F64, 0x8F64, 0x2178, 0x8F65, 0x8F7E, 0x30C9,
+ 0x8F80, 0x8F85, 0x30E3, 0x8F86, 0x8F86, 0x23F5, 0x8F87, 0x8F87, 0x30E9,
+ 0x8F88, 0x8F88, 0x2275, 0x8F89, 0x8F94, 0x30EA, 0x8F95, 0x8F95, 0x266E,
+ 0x8F96, 0x8F96, 0x30F6, 0x8F97, 0x8F97, 0x1EB0, 0x8F98, 0x8F9A, 0x30F7,
+ 0x8F9B, 0x8F9B, 0x2083, 0x8F9C, 0x8F9C, 0x30FA, 0x8F9D, 0x8F9D, 0x2188,
+ 0x8F9E, 0x8FA0, 0x30FB, 0x8FA1, 0x8FA1, 0x267C, 0x8FA2, 0x8FBC, 0x30FE,
+ 0x8FBD, 0x8FBD, 0x1FC5, 0x8FBE, 0x8FC3, 0x3119, 0x8FC4, 0x8FC4, 0x1EA1,
+ 0x8FC5, 0x8FC5, 0x311F, 0x8FC6, 0x8FC6, 0x2393, 0x8FC7, 0x8FCC, 0x3120,
+ 0x8FCD, 0x8FCD, 0x1F0B, 0x8FCE, 0x8FD7, 0x3126, 0x8FD8, 0x8FD8, 0x1E7C,
+ 0x8FD9, 0x8FFE, 0x3130, 0x9040, 0x907E, 0x3156, 0x9080, 0x909C, 0x3195,
+ 0x909D, 0x909D, 0x23B4, 0x909E, 0x909E, 0x207E, 0x909F, 0x90B9, 0x31B2,
+ 0x90BA, 0x90BA, 0x1EE3, 0x90BB, 0x90BF, 0x31CD, 0x90C0, 0x90C0, 0x2095,
+ 0x90C1, 0x90C1, 0x23BB, 0x90C2, 0x90C4, 0x31D2, 0x90C5, 0x90C5, 0x23B9,
+ 0x90C6, 0x90DA, 0x31D5, 0x90DB, 0x90DB, 0x1E28, 0x90DC, 0x90DC, 0x23BD,
+ 0x90DD, 0x90EC, 0x31EA, 0x90ED, 0x90ED, 0x23B5, 0x90EE, 0x90EF, 0x31FA,
+ 0x90F0, 0x90F0, 0x23BA, 0x90F1, 0x90F6, 0x31FC, 0x90F7, 0x90F7, 0x23B3,
+ 0x90F8, 0x90FE, 0x3202, 0x9140, 0x9141, 0x3209, 0x9142, 0x9142, 0x2162,
+ 0x9143, 0x914A, 0x320B, 0x914B, 0x914B, 0x1E5E, 0x914C, 0x914C, 0x3213,
+ 0x914D, 0x914D, 0x1E5D, 0x914E, 0x9150, 0x3214, 0x9151, 0x9151, 0x23B7,
+ 0x9152, 0x9153, 0x3217, 0x9154, 0x9154, 0x1F2F, 0x9155, 0x9155, 0x24DF,
+ 0x9156, 0x9158, 0x3219, 0x9159, 0x9159, 0x23B2, 0x915A, 0x915A, 0x214E,
+ 0x915B, 0x915C, 0x321C, 0x915D, 0x915D, 0x2052, 0x915E, 0x9160, 0x321E,
+ 0x9161, 0x9161, 0x23BC, 0x9162, 0x9162, 0x3221, 0x9163, 0x9163, 0x20EB,
+ 0x9164, 0x916D, 0x3222, 0x916E, 0x916E, 0x2232, 0x916F, 0x9175, 0x322C,
+ 0x9176, 0x9176, 0x1E3F, 0x9177, 0x9179, 0x3233, 0x917A, 0x917A, 0x201B,
+ 0x917B, 0x917B, 0x20BC, 0x917C, 0x917C, 0x23BE, 0x917D, 0x917E, 0x3236,
+ 0x9180, 0x9183, 0x3238, 0x9184, 0x9184, 0x1EAE, 0x9185, 0x918C, 0x323C,
+ 0x918D, 0x918D, 0x1EFB, 0x918E, 0x9190, 0x3244, 0x9191, 0x9191, 0x2089,
+ 0x9192, 0x9192, 0x3247, 0x9193, 0x9193, 0x23B1, 0x9194, 0x9196, 0x3248,
+ 0x9197, 0x9197, 0x21C4, 0x9198, 0x919A, 0x324B, 0x919B, 0x919B, 0x2214,
+ 0x919C, 0x91A8, 0x324E, 0x91A9, 0x91A9, 0x1FDE, 0x91AA, 0x91AA, 0x2223,
+ 0x91AB, 0x91AB, 0x23B6, 0x91AC, 0x91B9, 0x325B, 0x91BA, 0x91BA, 0x268C,
+ 0x91BB, 0x91BB, 0x24DE, 0x91BC, 0x91BE, 0x3269, 0x91BF, 0x91BF, 0x24E0,
+ 0x91C0, 0x91C2, 0x326C, 0x91C3, 0x91C3, 0x23B8, 0x91C4, 0x91CC, 0x326F,
+ 0x91CD, 0x91CD, 0x1E81, 0x91CE, 0x91CF, 0x3278, 0x91D0, 0x91D0, 0x1FFE,
+ 0x91D1, 0x91D1, 0x1F51, 0x91D2, 0x91D2, 0x21E1, 0x91D3, 0x91D3, 0x327A,
+ 0x91D4, 0x91D4, 0x23B0, 0x91D5, 0x91D5, 0x327B, 0x91D6, 0x91D6, 0x1FCE,
+ 0x91D7, 0x91D7, 0x327C, 0x91D8, 0x91D8, 0x211E, 0x91D9, 0x91D9, 0x2021,
+ 0x91DA, 0x91DE, 0x327D, 0x91DF, 0x91DF, 0x24E1, 0x91E0, 0x91E1, 0x3282,
+ 0x91E2, 0x91E2, 0x24A3, 0x91E3, 0x91E9, 0x3284, 0x91EA, 0x91EA, 0x24A4,
+ 0x91EB, 0x91EF, 0x328B, 0x91F0, 0x91F0, 0x2273, 0x91F1, 0x91F1, 0x3290,
+ 0x91F2, 0x91F2, 0x21B0, 0x91F3, 0x91FE, 0x3291, 0x9240, 0x927E, 0x329D,
+ 0x9280, 0x92B5, 0x32DC, 0x92B6, 0x92B6, 0x21D1, 0x92B7, 0x92CD, 0x3312,
+ 0x92CE, 0x92CE, 0x211C, 0x92CF, 0x92CF, 0x3329, 0x92D0, 0x92D0, 0x235D,
+ 0x92D1, 0x92D3, 0x332A, 0x92D4, 0x92D4, 0x2682, 0x92D5, 0x92DE, 0x332D,
+ 0x92DF, 0x92DF, 0x210D, 0x92E0, 0x92E0, 0x205A, 0x92E1, 0x92FD, 0x3337,
+ 0x92FE, 0x92FE, 0x1F8D, 0x9340, 0x934F, 0x3354, 0x9350, 0x9350, 0x21FF,
+ 0x9351, 0x935C, 0x3364, 0x935D, 0x935D, 0x1F58, 0x935E, 0x936F, 0x3370,
+ 0x9370, 0x9370, 0x215B, 0x9371, 0x9375, 0x3382, 0x9376, 0x9376, 0x1EB6,
+ 0x9377, 0x937E, 0x3387, 0x9380, 0x938B, 0x338F, 0x938C, 0x938C, 0x20DB,
+ 0x938D, 0x939C, 0x339B, 0x939D, 0x939D, 0x2360, 0x939E, 0x93A4, 0x33AB,
+ 0x93A5, 0x93A5, 0x2361, 0x93A6, 0x93A6, 0x33B2, 0x93A7, 0x93A7, 0x2040,
+ 0x93A8, 0x93B3, 0x33B3, 0x93B4, 0x93B4, 0x228E, 0x93B5, 0x93B7, 0x33BF,
+ 0x93B8, 0x93B8, 0x1FDF, 0x93B9, 0x93BA, 0x33C2, 0x93BB, 0x93BB, 0x235E,
+ 0x93BC, 0x93BC, 0x33C4, 0x93BD, 0x93BD, 0x1E6A, 0x93BE, 0x93C5, 0x33C5,
+ 0x93C6, 0x93C6, 0x2002, 0x93C7, 0x93CE, 0x33CD, 0x93CF, 0x93CF, 0x2093,
+ 0x93D0, 0x93D6, 0x33D5, 0x93D7, 0x93D7, 0x235F, 0x93D8, 0x93DA, 0x33DC,
+ 0x93DB, 0x93DB, 0x1EAC, 0x93DC, 0x93DC, 0x1E54, 0x93DD, 0x93E0, 0x33DF,
+ 0x93E1, 0x93E1, 0x1F08, 0x93E2, 0x93E3, 0x33E3, 0x93E4, 0x93E4, 0x20C0,
+ 0x93E5, 0x93E5, 0x2362, 0x93E6, 0x93E8, 0x33E5, 0x93E9, 0x93E9, 0x2160,
+ 0x93EA, 0x93EA, 0x33E8, 0x93EB, 0x93EB, 0x219D, 0x93EC, 0x93EC, 0x1F8E,
+ 0x93ED, 0x93ED, 0x222D, 0x93EE, 0x93EE, 0x33E9, 0x93EF, 0x93EF, 0x2047,
+ 0x93F0, 0x93F0, 0x33EA, 0x93F1, 0x93F1, 0x2262, 0x93F2, 0x93F3, 0x33EB,
+ 0x93F4, 0x93F4, 0x1F67, 0x93F5, 0x93F5, 0x1EB2, 0x93F6, 0x93F9, 0x33ED,
+ 0x93FA, 0x93FA, 0x1EA9, 0x93FB, 0x93FD, 0x33F1, 0x93FE, 0x93FE, 0x1FCC,
+ 0x9440, 0x9443, 0x33F4, 0x9444, 0x9444, 0x1F72, 0x9445, 0x944C, 0x33F8,
+ 0x944D, 0x944D, 0x2098, 0x944E, 0x944F, 0x3400, 0x9450, 0x9450, 0x1E52,
+ 0x9451, 0x9451, 0x20A4, 0x9452, 0x9452, 0x1F1C, 0x9453, 0x9453, 0x228F,
+ 0x9454, 0x9454, 0x3402, 0x9455, 0x9455, 0x1FED, 0x9456, 0x9457, 0x3403,
+ 0x9458, 0x9458, 0x2365, 0x9459, 0x945A, 0x3405, 0x945B, 0x945B, 0x1E2D,
+ 0x945C, 0x945C, 0x2152, 0x945D, 0x945D, 0x2366, 0x945E, 0x945E, 0x3407,
+ 0x945F, 0x945F, 0x20FA, 0x9460, 0x9463, 0x3408, 0x9464, 0x9464, 0x2363,
+ 0x9465, 0x9465, 0x340C, 0x9466, 0x9466, 0x209A, 0x9467, 0x946D, 0x340D,
+ 0x946E, 0x946E, 0x203C, 0x946F, 0x9471, 0x3414, 0x9472, 0x9472, 0x1FF6,
+ 0x9473, 0x9473, 0x3417, 0x9474, 0x9474, 0x2364, 0x9475, 0x9475, 0x3418,
+ 0x9476, 0x9476, 0x1E69, 0x9477, 0x9477, 0x3419, 0x9478, 0x9478, 0x2367,
+ 0x9479, 0x9479, 0x341A, 0x947A, 0x947A, 0x211D, 0x947B, 0x947E, 0x341B,
+ 0x9480, 0x9480, 0x2259, 0x9481, 0x9481, 0x2056, 0x9482, 0x9482, 0x2163,
+ 0x9483, 0x9486, 0x341F, 0x9487, 0x9487, 0x1FA9, 0x9488, 0x9488, 0x1FFC,
+ 0x9489, 0x94A0, 0x3423, 0x94A1, 0x94A1, 0x1E2E, 0x94A2, 0x94B2, 0x343B,
+ 0x94B3, 0x94B3, 0x1EBC, 0x94B4, 0x94B4, 0x344C, 0x94B5, 0x94B5, 0x2142,
+ 0x94B6, 0x94BE, 0x344D, 0x94BF, 0x94BF, 0x201E, 0x94C0, 0x94C0, 0x1E43,
+ 0x94C1, 0x94CB, 0x3456, 0x94CC, 0x94CC, 0x24D4, 0x94CD, 0x94D7, 0x3461,
+ 0x94D8, 0x94D8, 0x226F, 0x94D9, 0x94DF, 0x346C, 0x94E0, 0x94E0, 0x1ED7,
+ 0x94E1, 0x94FE, 0x3473, 0x9540, 0x9571, 0x3491, 0x9572, 0x9572, 0x212D,
+ 0x9573, 0x957E, 0x34C3, 0x9580, 0x9582, 0x34CF, 0x9583, 0x9583, 0x229B,
+ 0x9584, 0x959D, 0x34D2, 0x959E, 0x959E, 0x2256, 0x959F, 0x959F, 0x24A8,
+ 0x95A0, 0x95B2, 0x34EC, 0x95B3, 0x95B3, 0x1E79, 0x95B4, 0x95B9, 0x34FF,
+ 0x95BA, 0x95BA, 0x225A, 0x95BB, 0x95CE, 0x3505, 0x95CF, 0x95CF, 0x24A7,
+ 0x95D0, 0x95D0, 0x3519, 0x95D1, 0x95D1, 0x2686, 0x95D2, 0x95D2, 0x24A6,
+ 0x95D3, 0x95D3, 0x351A, 0x95D4, 0x95D4, 0x21CE, 0x95D5, 0x95E0, 0x351B,
+ 0x95E1, 0x95E1, 0x24A9, 0x95E2, 0x95E6, 0x3527, 0x95E7, 0x95E7, 0x1FE7,
+ 0x95E8, 0x95F0, 0x352C, 0x95F1, 0x95F1, 0x2112, 0x95F2, 0x95F7, 0x3535,
+ 0x95F8, 0x95F8, 0x213C, 0x95F9, 0x95FD, 0x353B, 0x95FE, 0x95FE, 0x1F5C,
+ 0x9640, 0x9655, 0x3540, 0x9656, 0x9656, 0x24C4, 0x9657, 0x967B, 0x3556,
+ 0x967C, 0x967C, 0x1ECC, 0x967D, 0x967E, 0x357B, 0x9680, 0x96FE, 0x357D,
+ 0x9740, 0x9766, 0x35FC, 0x9767, 0x9767, 0x246A, 0x9768, 0x976B, 0x3623,
+ 0x976C, 0x976C, 0x2175, 0x976D, 0x976D, 0x3627, 0x976E, 0x976E, 0x246D,
+ 0x976F, 0x977E, 0x3628, 0x9780, 0x9795, 0x3638, 0x9796, 0x9796, 0x246B,
+ 0x9797, 0x9797, 0x225F, 0x9798, 0x979C, 0x364E, 0x979D, 0x979D, 0x1ECE,
+ 0x979E, 0x97A2, 0x3653, 0x97A3, 0x97A3, 0x2272, 0x97A4, 0x97BE, 0x3658,
+ 0x97BF, 0x97BF, 0x2473, 0x97C0, 0x97ED, 0x3673, 0x97EE, 0x97EE, 0x21FE,
+ 0x97EF, 0x97F6, 0x36A1, 0x97F7, 0x97F7, 0x1EFE, 0x97F8, 0x97FE, 0x36A9,
+ 0x9840, 0x9844, 0x36B0, 0x9845, 0x9845, 0x2475, 0x9846, 0x9848, 0x36B5,
+ 0x9849, 0x9849, 0x220A, 0x984A, 0x984E, 0x36B8, 0x984F, 0x984F, 0x1F6F,
+ 0x9850, 0x9870, 0x36BD, 0x9871, 0x9871, 0x2468, 0x9872, 0x9872, 0x36DE,
+ 0x9873, 0x9873, 0x2100, 0x9874, 0x987E, 0x36DF, 0x9880, 0x9880, 0x36EA,
+ 0x9881, 0x9881, 0x2476, 0x9882, 0x988A, 0x36EB, 0x988B, 0x988B, 0x1F27,
+ 0x988C, 0x988C, 0x20D7, 0x988D, 0x989F, 0x36F4, 0x98A0, 0x98A0, 0x247C,
+ 0x98A1, 0x98A9, 0x3707, 0x98AA, 0x98AA, 0x1FA1, 0x98AB, 0x98B5, 0x3710,
+ 0x98B6, 0x98B6, 0x22AA, 0x98B7, 0x98B7, 0x2005, 0x98B8, 0x98B9, 0x371B,
+ 0x98BA, 0x98BA, 0x246C, 0x98BB, 0x98C6, 0x371D, 0x98C7, 0x98C7, 0x203E,
+ 0x98C8, 0x98CA, 0x3729, 0x98CB, 0x98CB, 0x1E4C, 0x98CC, 0x98CF, 0x372C,
+ 0x98D0, 0x98D0, 0x213A, 0x98D1, 0x98D2, 0x3730, 0x98D3, 0x98D3, 0x2204,
+ 0x98D4, 0x98E2, 0x3732, 0x98E3, 0x98E3, 0x20C3, 0x98E4, 0x98E4, 0x2140,
+ 0x98E5, 0x98E5, 0x2477, 0x98E6, 0x98EE, 0x3741, 0x98EF, 0x98EF, 0x2474,
+ 0x98F0, 0x98F1, 0x374A, 0x98F2, 0x98F2, 0x20DD, 0x98F3, 0x98FE, 0x374C,
+ 0x9940, 0x9942, 0x3758, 0x9943, 0x9943, 0x1F68, 0x9944, 0x9944, 0x375B,
+ 0x9945, 0x9945, 0x2185, 0x9946, 0x9965, 0x375C, 0x9966, 0x9966, 0x2472,
+ 0x9967, 0x996D, 0x377C, 0x996E, 0x996E, 0x1EB5, 0x996F, 0x9974, 0x3783,
+ 0x9975, 0x9975, 0x2478, 0x9976, 0x9979, 0x3789, 0x997A, 0x997A, 0x1F8B,
+ 0x997B, 0x997B, 0x2484, 0x997C, 0x997E, 0x378D, 0x9980, 0x9984, 0x3790,
+ 0x9985, 0x9985, 0x2699, 0x9986, 0x9988, 0x3795, 0x9989, 0x9989, 0x2482,
+ 0x998A, 0x998D, 0x3798, 0x998E, 0x998E, 0x20A1, 0x998F, 0x9990, 0x379C,
+ 0x9991, 0x9991, 0x1F92, 0x9992, 0x9998, 0x379E, 0x9999, 0x9999, 0x1F38,
+ 0x999A, 0x99A8, 0x37A5, 0x99A9, 0x99A9, 0x2485, 0x99AA, 0x99AF, 0x37B4,
+ 0x99B0, 0x99B0, 0x2480, 0x99B1, 0x99B1, 0x246E, 0x99B2, 0x99B2, 0x37BA,
+ 0x99B3, 0x99B3, 0x247B, 0x99B4, 0x99B4, 0x2486, 0x99B5, 0x99B5, 0x2471,
+ 0x99B6, 0x99BC, 0x37BB, 0x99BD, 0x99BD, 0x2483, 0x99BE, 0x99BE, 0x2470,
+ 0x99BF, 0x99BF, 0x37C2, 0x99C0, 0x99C0, 0x2469, 0x99C1, 0x99C1, 0x37C3,
+ 0x99C2, 0x99C2, 0x247F, 0x99C3, 0x99C8, 0x37C4, 0x99C9, 0x99C9, 0x246F,
+ 0x99CA, 0x99CD, 0x37CA, 0x99CE, 0x99CE, 0x2481, 0x99CF, 0x99D0, 0x37CE,
+ 0x99D1, 0x99D1, 0x2220, 0x99D2, 0x99D9, 0x37D0, 0x99DA, 0x99DA, 0x1FF5,
+ 0x99DB, 0x99DF, 0x37D8, 0x99E0, 0x99E0, 0x20F4, 0x99E1, 0x99E4, 0x37DD,
+ 0x99E5, 0x99E5, 0x247D, 0x99E6, 0x99E7, 0x37E1, 0x99E8, 0x99E8, 0x2479,
+ 0x99E9, 0x99EB, 0x37E3, 0x99EC, 0x99EC, 0x247E, 0x99ED, 0x99F3, 0x37E6,
+ 0x99F4, 0x99F4, 0x247A, 0x99F5, 0x99FE, 0x37ED, 0x9A40, 0x9A49, 0x37F7,
+ 0x9A4A, 0x9A4A, 0x20E3, 0x9A4B, 0x9A56, 0x3801, 0x9A57, 0x9A57, 0x20AD,
+ 0x9A58, 0x9A64, 0x380D, 0x9A65, 0x9A65, 0x24CB, 0x9A66, 0x9A66, 0x381A,
+ 0x9A67, 0x9A67, 0x1F53, 0x9A68, 0x9A70, 0x381B, 0x9A71, 0x9A71, 0x2159,
+ 0x9A72, 0x9A75, 0x3824, 0x9A76, 0x9A76, 0x2013, 0x9A77, 0x9A77, 0x1F33,
+ 0x9A78, 0x9A7E, 0x3828, 0x9A80, 0x9A87, 0x382F, 0x9A88, 0x9A88, 0x1E5C,
+ 0x9A89, 0x9A8B, 0x3837, 0x9A8C, 0x9A8C, 0x2488, 0x9A8D, 0x9A90, 0x383A,
+ 0x9A91, 0x9A91, 0x2487, 0x9A92, 0x9A96, 0x383E, 0x9A97, 0x9A97, 0x248A,
+ 0x9A98, 0x9A99, 0x3843, 0x9A9A, 0x9A9A, 0x2489, 0x9A9B, 0x9A9B, 0x248B,
+ 0x9A9C, 0x9A9D, 0x3845, 0x9A9E, 0x9A9E, 0x1F83, 0x9A9F, 0x9AA1, 0x3847,
+ 0x9AA2, 0x9AA2, 0x210F, 0x9AA3, 0x9AA3, 0x1FDB, 0x9AA4, 0x9AA9, 0x384A,
+ 0x9AAA, 0x9AAA, 0x20AF, 0x9AAB, 0x9ACF, 0x3850, 0x9AD0, 0x9AD0, 0x24C0,
+ 0x9AD1, 0x9AD5, 0x3875, 0x9AD6, 0x9AD6, 0x226D, 0x9AD7, 0x9AD9, 0x387A,
+ 0x9ADA, 0x9ADA, 0x24C1, 0x9ADB, 0x9AE1, 0x387D, 0x9AE2, 0x9AE2, 0x20CA,
+ 0x9AE3, 0x9AE3, 0x3884, 0x9AE4, 0x9AE4, 0x20E7, 0x9AE5, 0x9AE5, 0x24C2,
+ 0x9AE6, 0x9AFE, 0x3885, 0x9B40, 0x9B7E, 0x389E, 0x9B80, 0x9BD0, 0x38DD,
+ 0x9BD1, 0x9BD1, 0x23DC, 0x9BD2, 0x9BDB, 0x392E, 0x9BDC, 0x9BDC, 0x23DB,
+ 0x9BDD, 0x9BFE, 0x3938, 0x9C40, 0x9C52, 0x395A, 0x9C53, 0x9C53, 0x205E,
+ 0x9C54, 0x9C58, 0x396D, 0x9C59, 0x9C59, 0x2244, 0x9C5A, 0x9C5A, 0x23E2,
+ 0x9C5B, 0x9C5B, 0x3972, 0x9C5C, 0x9C5C, 0x20D4, 0x9C5D, 0x9C74, 0x3973,
+ 0x9C75, 0x9C75, 0x219F, 0x9C76, 0x9C78, 0x398B, 0x9C79, 0x9C79, 0x1E66,
+ 0x9C7A, 0x9C7E, 0x398E, 0x9C80, 0x9C85, 0x3993, 0x9C86, 0x9C86, 0x1F63,
+ 0x9C87, 0x9C9C, 0x3999, 0x9C9D, 0x9C9D, 0x23DD, 0x9C9E, 0x9CAA, 0x39AF,
+ 0x9CAB, 0x9CAB, 0x216B, 0x9CAC, 0x9CC9, 0x39BC, 0x9CCA, 0x9CCA, 0x22B5,
+ 0x9CCB, 0x9CCE, 0x39DA, 0x9CCF, 0x9CCF, 0x1F26, 0x9CD0, 0x9CE5, 0x39DE,
+ 0x9CE6, 0x9CE6, 0x1E63, 0x9CE7, 0x9CE7, 0x2088, 0x9CE8, 0x9CEB, 0x39F4,
+ 0x9CEC, 0x9CEC, 0x1EBD, 0x9CED, 0x9CED, 0x39F8, 0x9CEE, 0x9CEE, 0x2341,
+ 0x9CEF, 0x9CFA, 0x39F9, 0x9CFB, 0x9CFB, 0x1F4B, 0x9CFC, 0x9CFD, 0x3A05,
+ 0x9CFE, 0x9CFE, 0x2292, 0x9D40, 0x9D41, 0x3A07, 0x9D42, 0x9D42, 0x2124,
+ 0x9D43, 0x9D45, 0x3A09, 0x9D46, 0x9D46, 0x2048, 0x9D47, 0x9D47, 0x23E0,
+ 0x9D48, 0x9D4C, 0x3A0C, 0x9D4D, 0x9D4D, 0x2077, 0x9D4E, 0x9D4E, 0x3A11,
+ 0x9D4F, 0x9D4F, 0x223A, 0x9D50, 0x9D60, 0x3A12, 0x9D61, 0x9D61, 0x20B1,
+ 0x9D62, 0x9D67, 0x3A23, 0x9D68, 0x9D68, 0x1F41, 0x9D69, 0x9D69, 0x201C,
+ 0x9D6A, 0x9D6D, 0x3A29, 0x9D6E, 0x9D6E, 0x22B8, 0x9D6F, 0x9D70, 0x3A2D,
+ 0x9D71, 0x9D71, 0x2276, 0x9D72, 0x9D74, 0x3A2F, 0x9D75, 0x9D75, 0x1F9B,
+ 0x9D76, 0x9D7A, 0x3A32, 0x9D7B, 0x9D7B, 0x1F9F, 0x9D7C, 0x9D7C, 0x3A37,
+ 0x9D7D, 0x9D7D, 0x25CA, 0x9D7E, 0x9D7E, 0x3A38, 0x9D80, 0x9D89, 0x3A39,
+ 0x9D8A, 0x9D8A, 0x20BE, 0x9D8B, 0x9D8C, 0x3A43, 0x9D8D, 0x9D8D, 0x1FB4,
+ 0x9D8E, 0x9D90, 0x3A45, 0x9D91, 0x9D91, 0x23D7, 0x9D92, 0x9D98, 0x3A48,
+ 0x9D99, 0x9D99, 0x2105, 0x9D9A, 0x9DA0, 0x3A4F, 0x9DA1, 0x9DA1, 0x23E1,
+ 0x9DA2, 0x9DA2, 0x1FEC, 0x9DA3, 0x9DA6, 0x3A56, 0x9DA7, 0x9DA7, 0x23EA,
+ 0x9DA8, 0x9DAB, 0x3A5A, 0x9DAC, 0x9DAC, 0x23E3, 0x9DAD, 0x9DAD, 0x210E,
+ 0x9DAE, 0x9DB1, 0x3A5E, 0x9DB2, 0x9DB2, 0x1FA6, 0x9DB3, 0x9DB3, 0x2004,
+ 0x9DB4, 0x9DBD, 0x3A62, 0x9DBE, 0x9DBE, 0x1F9D, 0x9DBF, 0x9DC5, 0x3A6C,
+ 0x9DC6, 0x9DC6, 0x23E5, 0x9DC7, 0x9DC8, 0x3A73, 0x9DC9, 0x9DC9, 0x2264,
+ 0x9DCA, 0x9DCC, 0x3A75, 0x9DCD, 0x9DCD, 0x24E2, 0x9DCE, 0x9DD1, 0x3A78,
+ 0x9DD2, 0x9DD2, 0x23DE, 0x9DD3, 0x9DD4, 0x3A7C, 0x9DD5, 0x9DD5, 0x1EC4,
+ 0x9DD6, 0x9DE0, 0x3A7E, 0x9DE1, 0x9DE1, 0x22B6, 0x9DE2, 0x9DE2, 0x20A9,
+ 0x9DE3, 0x9DF0, 0x3A89, 0x9DF1, 0x9DF1, 0x212B, 0x9DF2, 0x9DF3, 0x3A97,
+ 0x9DF4, 0x9DF4, 0x20A5, 0x9DF5, 0x9DF6, 0x3A99, 0x9DF7, 0x9DF7, 0x268B,
+ 0x9DF8, 0x9DF9, 0x3A9B, 0x9DFA, 0x9DFA, 0x1F76, 0x9DFB, 0x9DFC, 0x3A9D,
+ 0x9DFD, 0x9DFD, 0x216D, 0x9DFE, 0x9DFE, 0x3A9F, 0x9E40, 0x9E44, 0x3AA0,
+ 0x9E45, 0x9E45, 0x2001, 0x9E46, 0x9E47, 0x3AA5, 0x9E48, 0x9E48, 0x2191,
+ 0x9E49, 0x9E49, 0x1E50, 0x9E4A, 0x9E51, 0x3AA7, 0x9E52, 0x9E52, 0x1F9C,
+ 0x9E53, 0x9E53, 0x3AAF, 0x9E54, 0x9E54, 0x23DA, 0x9E55, 0x9E55, 0x3AB0,
+ 0x9E56, 0x9E56, 0x2053, 0x9E57, 0x9E5C, 0x3AB1, 0x9E5D, 0x9E5D, 0x23E9,
+ 0x9E5E, 0x9E5E, 0x23E4, 0x9E5F, 0x9E60, 0x3AB7, 0x9E61, 0x9E61, 0x21D5,
+ 0x9E62, 0x9E62, 0x3AB9, 0x9E63, 0x9E63, 0x23E6, 0x9E64, 0x9E66, 0x3ABA,
+ 0x9E67, 0x9E67, 0x23DF, 0x9E68, 0x9E6B, 0x3ABD, 0x9E6C, 0x9E6C, 0x1E4F,
+ 0x9E6D, 0x9E6E, 0x3AC1, 0x9E6F, 0x9E6F, 0x23D9, 0x9E70, 0x9E71, 0x3AC3,
+ 0x9E72, 0x9E72, 0x2014, 0x9E73, 0x9E73, 0x3AC5, 0x9E74, 0x9E74, 0x23EC,
+ 0x9E75, 0x9E75, 0x23EB, 0x9E76, 0x9E7A, 0x3AC6, 0x9E7B, 0x9E7B, 0x23D8,
+ 0x9E7C, 0x9E7C, 0x23EE, 0x9E7D, 0x9E7E, 0x3ACB, 0x9E80, 0x9E84, 0x3ACD,
+ 0x9E85, 0x9E85, 0x268E, 0x9E86, 0x9E86, 0x3AD2, 0x9E87, 0x9E87, 0x23ED,
+ 0x9E88, 0x9E90, 0x3AD3, 0x9E91, 0x9E91, 0x1FFA, 0x9E92, 0x9E95, 0x3ADC,
+ 0x9E96, 0x9E96, 0x23D6, 0x9E97, 0x9E97, 0x23E8, 0x9E98, 0x9EA1, 0x3AE0,
+ 0x9EA2, 0x9EA2, 0x2106, 0x9EA3, 0x9EA5, 0x3AEA, 0x9EA6, 0x9EA6, 0x200B,
+ 0x9EA7, 0x9EA8, 0x3AED, 0x9EA9, 0x9EA9, 0x2166, 0x9EAA, 0x9EAD, 0x3AEF,
+ 0x9EAE, 0x9EAE, 0x23EF, 0x9EAF, 0x9EB2, 0x3AF3, 0x9EB3, 0x9EB3, 0x2189,
+ 0x9EB4, 0x9EB4, 0x2058, 0x9EB5, 0x9EB6, 0x3AF7, 0x9EB7, 0x9EB7, 0x23E7,
+ 0x9EB8, 0x9EF4, 0x3AF9, 0x9EF5, 0x9EF5, 0x21A3, 0x9EF6, 0x9EFE, 0x3B36,
+ 0x9F40, 0x9F4D, 0x3B3F, 0x9F4E, 0x9F4E, 0x217A, 0x9F4F, 0x9F6E, 0x3B4D,
+ 0x9F6F, 0x9F6F, 0x21A5, 0x9F70, 0x9F7E, 0x3B6D, 0x9F80, 0x9F91, 0x3B7C,
+ 0x9F92, 0x9F92, 0x2022, 0x9F93, 0x9F97, 0x3B8E, 0x9F98, 0x9F98, 0x24D6,
+ 0x9F99, 0x9FA5, 0x3B93, 0x9FA6, 0x9FA6, 0x233A, 0x9FA7, 0x9FA8, 0x3BA0,
+ 0x9FA9, 0x9FA9, 0x1EEE, 0x9FAA, 0x9FAB, 0x3BA2, 0x9FAC, 0x9FAC, 0x24D5,
+ 0x9FAD, 0x9FC8, 0x3BA4, 0x9FC9, 0x9FC9, 0x2228, 0x9FCA, 0x9FCC, 0x3BC0,
+ 0x9FCD, 0x9FCD, 0x24D7, 0x9FCE, 0x9FE0, 0x3BC3, 0x9FE1, 0x9FE1, 0x20FC,
+ 0x9FE2, 0x9FEA, 0x3BD6, 0x9FEB, 0x9FEB, 0x1E87, 0x9FEC, 0x9FED, 0x3BDF,
+ 0x9FEE, 0x9FEE, 0x24D8, 0x9FEF, 0x9FF3, 0x3BE1, 0x9FF4, 0x9FF4, 0x1EBA,
+ 0x9FF5, 0x9FFC, 0x3BE6, 0x9FFD, 0x9FFD, 0x2119, 0x9FFE, 0x9FFE, 0x3BEE,
+ 0xA040, 0xA042, 0x3BEF, 0xA043, 0xA043, 0x216C, 0xA044, 0xA045, 0x3BF2,
+ 0xA046, 0xA046, 0x24D9, 0xA047, 0xA048, 0x3BF4, 0xA049, 0xA049, 0x2227,
+ 0xA04A, 0xA04D, 0x3BF6, 0xA04E, 0xA04E, 0x1E5F, 0xA04F, 0xA053, 0x3BFA,
+ 0xA054, 0xA054, 0x229F, 0xA055, 0xA059, 0x3BFF, 0xA05A, 0xA05A, 0x1F5D,
+ 0xA05B, 0xA060, 0x3C04, 0xA061, 0xA061, 0x1FBC, 0xA062, 0xA062, 0x3C0A,
+ 0xA063, 0xA063, 0x24DA, 0xA064, 0xA070, 0x3C0B, 0xA071, 0xA071, 0x2149,
+ 0xA072, 0xA073, 0x3C18, 0xA074, 0xA074, 0x2046, 0xA075, 0xA07E, 0x3C1A,
+ 0xA080, 0xA080, 0x2000, 0xA081, 0xA090, 0x3C24, 0xA091, 0xA091, 0x2190,
+ 0xA092, 0xA093, 0x3C34, 0xA094, 0xA094, 0x2208, 0xA095, 0xA095, 0x3C36,
+ 0xA096, 0xA096, 0x1EE6, 0xA097, 0xA0A8, 0x3C37, 0xA0A9, 0xA0A9, 0x24C3,
+ 0xA0AA, 0xA0BE, 0x3C49, 0xA0BF, 0xA0BF, 0x20CC, 0xA0C0, 0xA0CD, 0x3C5E,
+ 0xA0CE, 0xA0CE, 0x2340, 0xA0CF, 0xA0D8, 0x3C6C, 0xA0D9, 0xA0D9, 0x1ED1,
+ 0xA0DA, 0xA0DD, 0x3C76, 0xA0DE, 0xA0DE, 0x21AC, 0xA0DF, 0xA0ED, 0x3C7A,
+ 0xA0EE, 0xA0EE, 0x22AF, 0xA0EF, 0xA0FE, 0x3C89, 0xA1A1, 0xA1FE, 0x0060,
+ 0xA2A1, 0xA2AA, 0x26A9, 0xA2B1, 0xA2E2, 0x00BE, 0xA2E5, 0xA2EE, 0x00F0,
+ 0xA2F1, 0xA2FC, 0x00FA, 0xA3A1, 0xA3FE, 0x0106, 0xA4A1, 0xA4F3, 0x0164,
+ 0xA5A1, 0xA5F6, 0x01B7, 0xA6A1, 0xA6B8, 0x020D, 0xA6C1, 0xA6F5, 0x0225,
+ 0xA7A1, 0xA7C1, 0x025A, 0xA7D1, 0xA7F1, 0x027B, 0xA840, 0xA87E, 0x26B3,
+ 0xA880, 0xA895, 0x26F2, 0xA8A1, 0xA8C0, 0x029C, 0xA8C5, 0xA8EA, 0x02BC,
+ 0xA940, 0xA957, 0x2708, 0xA959, 0xA95A, 0x2720, 0xA95C, 0xA95C, 0x2722,
+ 0xA960, 0xA97E, 0x2723, 0xA980, 0xA995, 0x2742, 0xA996, 0xA996, 0x1E17,
+ 0xA9A4, 0xA9EF, 0x02E2, 0xAA40, 0xAA4C, 0x3C99, 0xAA4D, 0xAA4D, 0x21B6,
+ 0xAA4E, 0xAA4E, 0x1E3D, 0xAA4F, 0xAA70, 0x3CA6, 0xAA71, 0xAA71, 0x2235,
+ 0xAA72, 0xAA72, 0x3CC8, 0xAA73, 0xAA73, 0x2397, 0xAA74, 0xAA76, 0x3CC9,
+ 0xAA77, 0xAA77, 0x2395, 0xAA78, 0xAA79, 0x3CCC, 0xAA7A, 0xAA7A, 0x223F,
+ 0xAA7B, 0xAA7B, 0x212A, 0xAA7C, 0xAA7E, 0x3CCE, 0xAA80, 0xAA99, 0x3CD1,
+ 0xAA9A, 0xAA9A, 0x1ED2, 0xAA9B, 0xAA9B, 0x3CEB, 0xAA9C, 0xAA9C, 0x2396,
+ 0xAA9D, 0xAA9D, 0x2398, 0xAA9E, 0xAA9E, 0x3CEC, 0xAA9F, 0xAA9F, 0x20A2,
+ 0xAAA0, 0xAAA0, 0x3CED, 0xAAA1, 0xAAFE, 0x032E, 0xAB40, 0xAB40, 0x1F64,
+ 0xAB41, 0xAB42, 0x3CEE, 0xAB43, 0xAB43, 0x202B, 0xAB44, 0xAB44, 0x3CF0,
+ 0xAB45, 0xAB45, 0x2394, 0xAB46, 0xAB46, 0x2139, 0xAB47, 0xAB47, 0x3CF1,
+ 0xAB48, 0xAB48, 0x215F, 0xAB49, 0xAB49, 0x21C1, 0xAB4A, 0xAB4A, 0x239A,
+ 0xAB4B, 0xAB4C, 0x3CF2, 0xAB4D, 0xAB4D, 0x2399, 0xAB4E, 0xAB7E, 0x3CF4,
+ 0xAB80, 0xABA0, 0x3D25, 0xABA1, 0xABC0, 0x038C, 0xAC40, 0xAC45, 0x3D46,
+ 0xAC46, 0xAC46, 0x21C0, 0xAC47, 0xAC70, 0x3D4C, 0xAC71, 0xAC71, 0x2460,
+ 0xAC72, 0xAC7B, 0x3D76, 0xAC7C, 0xAC7C, 0x245C, 0xAC7D, 0xAC7E, 0x3D80,
+ 0xAC80, 0xAC8C, 0x3D82, 0xAC8D, 0xAC8D, 0x215D, 0xAC8E, 0xAC92, 0x3D8F,
+ 0xAC93, 0xAC93, 0x2225, 0xAC94, 0xAC94, 0x206A, 0xAC95, 0xACA0, 0x3D94,
+ 0xAD40, 0xAD48, 0x3DA0, 0xAD49, 0xAD49, 0x2461, 0xAD4A, 0xAD5D, 0x3DA9,
+ 0xAD5E, 0xAD5E, 0x245B, 0xAD5F, 0xAD60, 0x3DBD, 0xAD61, 0xAD61, 0x2462,
+ 0xAD62, 0xAD67, 0x3DBF, 0xAD68, 0xAD68, 0x1F54, 0xAD69, 0xAD73, 0x3DC5,
+ 0xAD74, 0xAD74, 0x245F, 0xAD75, 0xAD7E, 0x3DD0, 0xAD80, 0xAD81, 0x3DDA,
+ 0xAD82, 0xAD82, 0x20EC, 0xAD83, 0xAD86, 0x3DDC, 0xAD87, 0xAD87, 0x245D,
+ 0xAD88, 0xAD8A, 0x3DE0, 0xAD8B, 0xAD8B, 0x2463, 0xAD8C, 0xAD90, 0x3DE3,
+ 0xAD91, 0xAD91, 0x2464, 0xAD92, 0xADA0, 0x3DE8, 0xAE40, 0xAE53, 0x3DF7,
+ 0xAE54, 0xAE54, 0x24A5, 0xAE55, 0xAE61, 0x3E0B, 0xAE62, 0xAE62, 0x1E70,
+ 0xAE63, 0xAE7E, 0x3E18, 0xAE80, 0xAE80, 0x208F, 0xAE81, 0xAE84, 0x3E34,
+ 0xAE85, 0xAE85, 0x1E42, 0xAE86, 0xAE8A, 0x3E38, 0xAE8B, 0xAE8B, 0x1F4E,
+ 0xAE8C, 0xAE93, 0x3E3D, 0xAE94, 0xAE94, 0x1EB1, 0xAE95, 0xAE9F, 0x3E45,
+ 0xAEA0, 0xAEA0, 0x1E8B, 0xAF40, 0xAF63, 0x3E50, 0xAF64, 0xAF64, 0x1FC6,
+ 0xAF65, 0xAF7A, 0x3E74, 0xAF7B, 0xAF7B, 0x25AE, 0xAF7C, 0xAF7E, 0x3E8A,
+ 0xAF80, 0xAF81, 0x3E8D, 0xAF82, 0xAF82, 0x1F01, 0xAF83, 0xAF83, 0x2200,
+ 0xAF84, 0xAF8D, 0x3E8F, 0xAF8E, 0xAF8E, 0x25B2, 0xAF8F, 0xAF8F, 0x1E97,
+ 0xAF90, 0xAF90, 0x3E99, 0xAF91, 0xAF91, 0x20AB, 0xAF92, 0xAF9B, 0x3E9A,
+ 0xAF9C, 0xAF9C, 0x25B3, 0xAF9D, 0xAF9E, 0x3EA4, 0xAF9F, 0xAF9F, 0x2028,
+ 0xAFA0, 0xAFA0, 0x3EA6, 0xB040, 0xB040, 0x3EA7, 0xB041, 0xB042, 0x25AF,
+ 0xB043, 0xB043, 0x3EA8, 0xB044, 0xB044, 0x25B1, 0xB045, 0xB04E, 0x3EA9,
+ 0xB04F, 0xB04F, 0x25AC, 0xB050, 0xB053, 0x3EB3, 0xB054, 0xB054, 0x1E4E,
+ 0xB055, 0xB056, 0x3EB7, 0xB057, 0xB057, 0x2202, 0xB058, 0xB058, 0x25AB,
+ 0xB059, 0xB059, 0x2286, 0xB05A, 0xB05A, 0x3EB9, 0xB05B, 0xB05B, 0x25AD,
+ 0xB05C, 0xB05C, 0x3EBA, 0xB05D, 0xB05D, 0x25B6, 0xB05E, 0xB05E, 0x3EBB,
+ 0xB05F, 0xB05F, 0x21E3, 0xB060, 0xB061, 0x25B4, 0xB062, 0xB062, 0x222F,
+ 0xB063, 0xB063, 0x2165, 0xB064, 0xB064, 0x25B7, 0xB065, 0xB06B, 0x3EBC,
+ 0xB06C, 0xB06C, 0x1EE9, 0xB06D, 0xB07C, 0x3EC3, 0xB07D, 0xB07D, 0x1E25,
+ 0xB07E, 0xB07E, 0x3ED3, 0xB080, 0xB096, 0x3ED4, 0xB097, 0xB097, 0x25C0,
+ 0xB098, 0xB098, 0x3EEB, 0xB099, 0xB099, 0x229A, 0xB09A, 0xB0A0, 0x3EEC,
+ 0xB0A1, 0xB0FE, 0x03AC, 0xB140, 0xB14A, 0x3EF3, 0xB14B, 0xB14B, 0x226E,
+ 0xB14C, 0xB14C, 0x3EFE, 0xB14D, 0xB14D, 0x1FBD, 0xB14E, 0xB14E, 0x3EFF,
+ 0xB14F, 0xB14F, 0x1F84, 0xB150, 0xB150, 0x20B2, 0xB151, 0xB151, 0x3F00,
+ 0xB152, 0xB152, 0x2043, 0xB153, 0xB17E, 0x3F01, 0xB180, 0xB196, 0x3F2D,
+ 0xB197, 0xB197, 0x2684, 0xB198, 0xB1A0, 0x3F44, 0xB1A1, 0xB1FE, 0x040A,
+ 0xB240, 0xB240, 0x3F4D, 0xB241, 0xB241, 0x24EF, 0xB242, 0xB266, 0x3F4E,
+ 0xB267, 0xB267, 0x24EE, 0xB268, 0xB26C, 0x3F73, 0xB26D, 0xB26D, 0x2074,
+ 0xB26E, 0xB273, 0x3F78, 0xB274, 0xB274, 0x2687, 0xB275, 0xB27E, 0x3F7E,
+ 0xB280, 0xB280, 0x24F0, 0xB281, 0xB288, 0x3F88, 0xB289, 0xB289, 0x268D,
+ 0xB28A, 0xB299, 0x3F90, 0xB29A, 0xB29A, 0x22A0, 0xB29B, 0xB2A0, 0x3FA0,
+ 0xB2A1, 0xB2FE, 0x0468, 0xB340, 0xB342, 0x3FA6, 0xB343, 0xB343, 0x1FAB,
+ 0xB344, 0xB36F, 0x3FA9, 0xB370, 0xB370, 0x26A8, 0xB371, 0xB37E, 0x3FD5,
+ 0xB380, 0xB387, 0x3FE3, 0xB388, 0xB388, 0x24E9, 0xB389, 0xB38B, 0x3FEB,
+ 0xB38C, 0xB38C, 0x24E5, 0xB38D, 0xB38D, 0x3FEE, 0xB38E, 0xB38E, 0x21FA,
+ 0xB38F, 0xB3A0, 0x3FEF, 0xB3A1, 0xB3FE, 0x04C6, 0xB440, 0xB453, 0x4001,
+ 0xB454, 0xB454, 0x2148, 0xB455, 0xB457, 0x4015, 0xB458, 0xB458, 0x24E4,
+ 0xB459, 0xB45D, 0x4018, 0xB45E, 0xB45E, 0x24E6, 0xB45F, 0xB45F, 0x20F7,
+ 0xB460, 0xB460, 0x401D, 0xB461, 0xB461, 0x206B, 0xB462, 0xB474, 0x401E,
+ 0xB475, 0xB475, 0x22A7, 0xB476, 0xB47D, 0x4031, 0xB47E, 0xB47E, 0x24EC,
+ 0xB480, 0xB482, 0x4039, 0xB483, 0xB483, 0x24EB, 0xB484, 0xB488, 0x403C,
+ 0xB489, 0xB489, 0x24E3, 0xB48A, 0xB492, 0x4041, 0xB493, 0xB493, 0x24EA,
+ 0xB494, 0xB4A0, 0x404A, 0xB4A1, 0xB4FE, 0x0524, 0xB540, 0xB540, 0x4057,
+ 0xB541, 0xB541, 0x1E92, 0xB542, 0xB54A, 0x4058, 0xB54B, 0xB54B, 0x1E27,
+ 0xB54C, 0xB555, 0x4061, 0xB556, 0xB556, 0x1FE6, 0xB557, 0xB559, 0x406B,
+ 0xB55A, 0xB55A, 0x24E7, 0xB55B, 0xB55B, 0x2012, 0xB55C, 0xB55C, 0x1EEC,
+ 0xB55D, 0xB560, 0x406E, 0xB561, 0xB561, 0x24E8, 0xB562, 0xB57E, 0x4072,
+ 0xB580, 0xB59B, 0x408F, 0xB59C, 0xB59C, 0x1F66, 0xB59D, 0xB59D, 0x24DC,
+ 0xB59E, 0xB5A0, 0x40AB, 0xB5A1, 0xB5FE, 0x0582, 0xB640, 0xB651, 0x40AE,
+ 0xB652, 0xB652, 0x26A2, 0xB653, 0xB654, 0x40C0, 0xB655, 0xB655, 0x24DD,
+ 0xB656, 0xB658, 0x40C2, 0xB659, 0xB659, 0x200E, 0xB65A, 0xB65A, 0x40C5,
+ 0xB65B, 0xB65B, 0x24DB, 0xB65C, 0xB65C, 0x1EB8, 0xB65D, 0xB67E, 0x40C6,
+ 0xB680, 0xB6A0, 0x40E8, 0xB6A1, 0xB6FE, 0x05E0, 0xB740, 0xB74D, 0x4109,
+ 0xB74E, 0xB74E, 0x2295, 0xB74F, 0xB750, 0x4117, 0xB751, 0xB751, 0x1E80,
+ 0xB752, 0xB758, 0x4119, 0xB759, 0xB759, 0x2677, 0xB75A, 0xB763, 0x4120,
+ 0xB764, 0xB764, 0x2624, 0xB765, 0xB765, 0x1F69, 0xB766, 0xB766, 0x222B,
+ 0xB767, 0xB776, 0x412A, 0xB777, 0xB777, 0x257F, 0xB778, 0xB778, 0x1F5B,
+ 0xB779, 0xB77E, 0x413A, 0xB780, 0xB780, 0x219B, 0xB781, 0xB781, 0x4140,
+ 0xB782, 0xB782, 0x267D, 0xB783, 0xB7A0, 0x4141, 0xB7A1, 0xB7FE, 0x063E,
+ 0xB840, 0xB842, 0x415F, 0xB843, 0xB843, 0x21A0, 0xB844, 0xB844, 0x2186,
+ 0xB845, 0xB845, 0x4162, 0xB846, 0xB846, 0x20ED, 0xB847, 0xB84C, 0x4163,
+ 0xB84D, 0xB84D, 0x25B9, 0xB84E, 0xB850, 0x4169, 0xB851, 0xB851, 0x1FEA,
+ 0xB852, 0xB859, 0x416C, 0xB85A, 0xB85A, 0x1EA4, 0xB85B, 0xB85B, 0x20E1,
+ 0xB85C, 0xB85C, 0x4174, 0xB85D, 0xB85D, 0x25B8, 0xB85E, 0xB85E, 0x2260,
+ 0xB85F, 0xB85F, 0x4175, 0xB860, 0xB860, 0x20E2, 0xB861, 0xB876, 0x4176,
+ 0xB877, 0xB877, 0x2141, 0xB878, 0xB87E, 0x418C, 0xB880, 0xB881, 0x4193,
+ 0xB882, 0xB882, 0x1FC7, 0xB883, 0xB8A0, 0x4195, 0xB8A1, 0xB8FE, 0x069C,
+ 0xB940, 0xB94F, 0x41B3, 0xB950, 0xB950, 0x1E41, 0xB951, 0xB960, 0x41C3,
+ 0xB961, 0xB961, 0x25E4, 0xB962, 0xB97A, 0x41D3, 0xB97B, 0xB97B, 0x1F86,
+ 0xB97C, 0xB97E, 0x41EC, 0xB980, 0xB99C, 0x41EF, 0xB99D, 0xB99D, 0x1FB3,
+ 0xB99E, 0xB99F, 0x420C, 0xB9A0, 0xB9A0, 0x1EEF, 0xB9A1, 0xB9FE, 0x06FA,
+ 0xBA40, 0xBA41, 0x420E, 0xBA42, 0xBA42, 0x22A4, 0xBA43, 0xBA43, 0x4210,
+ 0xBA44, 0xBA44, 0x25E8, 0xBA45, 0xBA55, 0x4211, 0xBA56, 0xBA56, 0x25E3,
+ 0xBA57, 0xBA58, 0x4222, 0xBA59, 0xBA59, 0x2111, 0xBA5A, 0xBA5F, 0x4224,
+ 0xBA60, 0xBA60, 0x25E6, 0xBA61, 0xBA69, 0x422A, 0xBA6A, 0xBA6A, 0x25E7,
+ 0xBA6B, 0xBA73, 0x4233, 0xBA74, 0xBA74, 0x2041, 0xBA75, 0xBA7E, 0x423C,
+ 0xBA80, 0xBA83, 0x4246, 0xBA84, 0xBA84, 0x25EA, 0xBA85, 0xBA85, 0x424A,
+ 0xBA86, 0xBA86, 0x1F8F, 0xBA87, 0xBA87, 0x424B, 0xBA88, 0xBA88, 0x25EC,
+ 0xBA89, 0xBA8C, 0x424C, 0xBA8D, 0xBA8D, 0x25EB, 0xBA8E, 0xBA9D, 0x4250,
+ 0xBA9E, 0xBA9E, 0x20D0, 0xBA9F, 0xBA9F, 0x201D, 0xBAA0, 0xBAA0, 0x4260,
+ 0xBAA1, 0xBAFE, 0x0758, 0xBB40, 0xBB40, 0x1FF7, 0xBB41, 0xBB48, 0x4261,
+ 0xBB49, 0xBB49, 0x1E8D, 0xBB4A, 0xBB57, 0x4269, 0xBB58, 0xBB58, 0x25E9,
+ 0xBB59, 0xBB5A, 0x4277, 0xBB5B, 0xBB5B, 0x25EE, 0xBB5C, 0xBB5C, 0x203A,
+ 0xBB5D, 0xBB5F, 0x4279, 0xBB60, 0xBB60, 0x2693, 0xBB61, 0xBB64, 0x427C,
+ 0xBB65, 0xBB65, 0x25E5, 0xBB66, 0xBB66, 0x25ED, 0xBB67, 0xBB67, 0x4280,
+ 0xBB68, 0xBB68, 0x2009, 0xBB69, 0xBB69, 0x4281, 0xBB6A, 0xBB6A, 0x2065,
+ 0xBB6B, 0xBB6D, 0x4282, 0xBB6E, 0xBB6E, 0x26A3, 0xBB6F, 0xBB7E, 0x4285,
+ 0xBB80, 0xBBA0, 0x4295, 0xBBA1, 0xBBFE, 0x07B6, 0xBC40, 0xBC51, 0x42B6,
+ 0xBC52, 0xBC52, 0x25F5, 0xBC53, 0xBC53, 0x1EFC, 0xBC54, 0xBC59, 0x42C8,
+ 0xBC5A, 0xBC5A, 0x2024, 0xBC5B, 0xBC60, 0x42CE, 0xBC61, 0xBC61, 0x269B,
+ 0xBC62, 0xBC62, 0x42D4, 0xBC63, 0xBC63, 0x25F3, 0xBC64, 0xBC64, 0x42D5,
+ 0xBC65, 0xBC65, 0x22D9, 0xBC66, 0xBC66, 0x42D6, 0xBC67, 0xBC67, 0x25F4,
+ 0xBC68, 0xBC68, 0x42D7, 0xBC69, 0xBC69, 0x241B, 0xBC6A, 0xBC6C, 0x42D8,
+ 0xBC6D, 0xBC6D, 0x1FC8, 0xBC6E, 0xBC6E, 0x42DB, 0xBC6F, 0xBC6F, 0x1F7B,
+ 0xBC70, 0xBC70, 0x42DC, 0xBC71, 0xBC71, 0x241D, 0xBC72, 0xBC72, 0x42DD,
+ 0xBC73, 0xBC73, 0x224C, 0xBC74, 0xBC74, 0x1F48, 0xBC75, 0xBC75, 0x241C,
+ 0xBC76, 0xBC77, 0x241E, 0xBC78, 0xBC78, 0x20FF, 0xBC79, 0xBC79, 0x219A,
+ 0xBC7A, 0xBC7A, 0x42DE, 0xBC7B, 0xBC7B, 0x2091, 0xBC7C, 0xBC7D, 0x42DF,
+ 0xBC7E, 0xBC7E, 0x20A7, 0xBC80, 0xBC81, 0x42E1, 0xBC82, 0xBC82, 0x2423,
+ 0xBC83, 0xBC83, 0x1E9B, 0xBC84, 0xBC84, 0x2422, 0xBC85, 0xBC85, 0x42E3,
+ 0xBC86, 0xBC86, 0x2110, 0xBC87, 0xBC87, 0x42E4, 0xBC88, 0xBC88, 0x228D,
+ 0xBC89, 0xBC89, 0x1F71, 0xBC8A, 0xBC8A, 0x1EF8, 0xBC8B, 0xBC8B, 0x2421,
+ 0xBC8C, 0xBC8E, 0x42E5, 0xBC8F, 0xBC8F, 0x1EF3, 0xBC90, 0xBC99, 0x42E8,
+ 0xBC9A, 0xBC9A, 0x21B1, 0xBC9B, 0xBC9B, 0x2426, 0xBC9C, 0xBC9C, 0x2425,
+ 0xBC9D, 0xBC9D, 0x2120, 0xBC9E, 0xBCA0, 0x42F2, 0xBCA1, 0xBCFE, 0x0814,
+ 0xBD40, 0xBD41, 0x42F5, 0xBD42, 0xBD42, 0x211A, 0xBD43, 0xBD43, 0x2424,
+ 0xBD44, 0xBD44, 0x42F7, 0xBD45, 0xBD45, 0x2428, 0xBD46, 0xBD47, 0x42F8,
+ 0xBD48, 0xBD48, 0x242A, 0xBD49, 0xBD49, 0x2429, 0xBD4A, 0xBD4A, 0x42FA,
+ 0xBD4B, 0xBD4B, 0x2294, 0xBD4C, 0xBD4C, 0x42FB, 0xBD4D, 0xBD4D, 0x22BE,
+ 0xBD4E, 0xBD4E, 0x42FC, 0xBD4F, 0xBD4F, 0x1E31, 0xBD50, 0xBD56, 0x42FD,
+ 0xBD57, 0xBD57, 0x242C, 0xBD58, 0xBD58, 0x4304, 0xBD59, 0xBD59, 0x1FB5,
+ 0xBD5A, 0xBD65, 0x4305, 0xBD66, 0xBD66, 0x242B, 0xBD67, 0xBD67, 0x1FAF,
+ 0xBD68, 0xBD69, 0x4311, 0xBD6A, 0xBD6A, 0x2068, 0xBD6B, 0xBD6B, 0x21E4,
+ 0xBD6C, 0xBD6E, 0x4313, 0xBD6F, 0xBD6F, 0x1F21, 0xBD70, 0xBD70, 0x4316,
+ 0xBD71, 0xBD71, 0x2101, 0xBD72, 0xBD78, 0x4317, 0xBD79, 0xBD79, 0x217C,
+ 0xBD7A, 0xBD7A, 0x214A, 0xBD7B, 0xBD7B, 0x242D, 0xBD7C, 0xBD7D, 0x431E,
+ 0xBD7E, 0xBD7E, 0x1FD4, 0xBD80, 0xBD80, 0x4320, 0xBD81, 0xBD81, 0x1FD1,
+ 0xBD82, 0xBD88, 0x4321, 0xBD89, 0xBD89, 0x1E33, 0xBD8A, 0xBD8A, 0x4328,
+ 0xBD8B, 0xBD8B, 0x242F, 0xBD8C, 0xBD8D, 0x4329, 0xBD8E, 0xBD8E, 0x242E,
+ 0xBD8F, 0xBD8F, 0x432B, 0xBD90, 0xBD90, 0x2430, 0xBD91, 0xBD91, 0x21DB,
+ 0xBD92, 0xBD96, 0x432C, 0xBD97, 0xBD97, 0x2158, 0xBD98, 0xBD9A, 0x4331,
+ 0xBD9B, 0xBD9B, 0x1FC2, 0xBD9C, 0xBDA0, 0x4334, 0xBDA1, 0xBDFE, 0x0872,
+ 0xBE40, 0xBE42, 0x4339, 0xBE43, 0xBE43, 0x22B9, 0xBE44, 0xBE44, 0x433C,
+ 0xBE45, 0xBE45, 0x2436, 0xBE46, 0xBE48, 0x433D, 0xBE49, 0xBE49, 0x1E8E,
+ 0xBE4A, 0xBE4A, 0x2439, 0xBE4B, 0xBE50, 0x4340, 0xBE51, 0xBE51, 0x21C5,
+ 0xBE52, 0xBE52, 0x2437, 0xBE53, 0xBE53, 0x2192, 0xBE54, 0xBE54, 0x4346,
+ 0xBE55, 0xBE55, 0x243A, 0xBE56, 0xBE56, 0x1F19, 0xBE57, 0xBE57, 0x218C,
+ 0xBE58, 0xBE58, 0x1E40, 0xBE59, 0xBE59, 0x22B3, 0xBE5A, 0xBE5C, 0x4347,
+ 0xBE5D, 0xBE5D, 0x205F, 0xBE5E, 0xBE5E, 0x2438, 0xBE5F, 0xBE5F, 0x2432,
+ 0xBE60, 0xBE60, 0x2274, 0xBE61, 0xBE61, 0x434A, 0xBE62, 0xBE62, 0x1E9C,
+ 0xBE63, 0xBE63, 0x2431, 0xBE64, 0xBE64, 0x2085, 0xBE65, 0xBE68, 0x434B,
+ 0xBE69, 0xBE69, 0x2435, 0xBE6A, 0xBE6B, 0x434F, 0xBE6C, 0xBE6C, 0x243B,
+ 0xBE6D, 0xBE6E, 0x4351, 0xBE6F, 0xBE6F, 0x1FB7, 0xBE70, 0xBE70, 0x2433,
+ 0xBE71, 0xBE75, 0x4353, 0xBE76, 0xBE76, 0x2054, 0xBE77, 0xBE77, 0x21DE,
+ 0xBE78, 0xBE78, 0x4358, 0xBE79, 0xBE79, 0x2434, 0xBE7A, 0xBE7B, 0x4359,
+ 0xBE7C, 0xBE7C, 0x243D, 0xBE7D, 0xBE7D, 0x1F89, 0xBE7E, 0xBE7E, 0x243C,
+ 0xBE80, 0xBE82, 0x435B, 0xBE83, 0xBE83, 0x1F6E, 0xBE84, 0xBE84, 0x1ED8,
+ 0xBE85, 0xBE85, 0x435E, 0xBE86, 0xBE86, 0x1EBF, 0xBE87, 0xBE87, 0x2445,
+ 0xBE88, 0xBE88, 0x435F, 0xBE89, 0xBE89, 0x2249, 0xBE8A, 0xBE8B, 0x4360,
+ 0xBE8C, 0xBE8C, 0x2441, 0xBE8D, 0xBE8D, 0x4362, 0xBE8E, 0xBE8E, 0x1E47,
+ 0xBE8F, 0xBE8F, 0x1F56, 0xBE90, 0xBE91, 0x4363, 0xBE92, 0xBE92, 0x2086,
+ 0xBE93, 0xBE94, 0x4365, 0xBE95, 0xBE95, 0x2196, 0xBE96, 0xBE96, 0x4367,
+ 0xBE97, 0xBE97, 0x2443, 0xBE98, 0xBE98, 0x243F, 0xBE99, 0xBE99, 0x4368,
+ 0xBE9A, 0xBE9A, 0x2023, 0xBE9B, 0xBE9B, 0x4369, 0xBE9C, 0xBE9C, 0x2442,
+ 0xBE9D, 0xBE9E, 0x436A, 0xBE9F, 0xBE9F, 0x243E, 0xBEA0, 0xBEA0, 0x436C,
+ 0xBEA1, 0xBEFE, 0x08D0, 0xBF40, 0xBF40, 0x26A6, 0xBF41, 0xBF4C, 0x436D,
+ 0xBF4D, 0xBF4D, 0x234E, 0xBF4E, 0xBF4E, 0x2446, 0xBF4F, 0xBF4F, 0x244B,
+ 0xBF50, 0xBF50, 0x2444, 0xBF51, 0xBF54, 0x4379, 0xBF55, 0xBF55, 0x2427,
+ 0xBF56, 0xBF56, 0x244C, 0xBF57, 0xBF5F, 0x437D, 0xBF60, 0xBF60, 0x1F0F,
+ 0xBF61, 0xBF61, 0x4386, 0xBF62, 0xBF62, 0x2447, 0xBF63, 0xBF63, 0x2449,
+ 0xBF64, 0xBF64, 0x2448, 0xBF65, 0xBF67, 0x4387, 0xBF68, 0xBF68, 0x21C2,
+ 0xBF69, 0xBF6B, 0x438A, 0xBF6C, 0xBF6C, 0x216E, 0xBF6D, 0xBF6F, 0x438D,
+ 0xBF70, 0xBF70, 0x1F03, 0xBF71, 0xBF71, 0x4390, 0xBF72, 0xBF72, 0x244A,
+ 0xBF73, 0xBF73, 0x215C, 0xBF74, 0xBF75, 0x4391, 0xBF76, 0xBF76, 0x22BB,
+ 0xBF77, 0xBF77, 0x2450, 0xBF78, 0xBF78, 0x4393, 0xBF79, 0xBF79, 0x2694,
+ 0xBF7A, 0xBF7A, 0x244F, 0xBF7B, 0xBF7B, 0x25F6, 0xBF7C, 0xBF7C, 0x2051,
+ 0xBF7D, 0xBF7D, 0x4394, 0xBF7E, 0xBF7E, 0x244E, 0xBF80, 0xBF81, 0x4395,
+ 0xBF82, 0xBF82, 0x22BA, 0xBF83, 0xBF83, 0x1F6D, 0xBF84, 0xBF88, 0x4397,
+ 0xBF89, 0xBF89, 0x2452, 0xBF8A, 0xBF8A, 0x2451, 0xBF8B, 0xBF94, 0x439C,
+ 0xBF95, 0xBF95, 0x2455, 0xBF96, 0xBF96, 0x43A6, 0xBF97, 0xBF97, 0x2289,
+ 0xBF98, 0xBF98, 0x2116, 0xBF99, 0xBF9C, 0x43A7, 0xBF9D, 0xBF9D, 0x2454,
+ 0xBF9E, 0xBFA0, 0x43AB, 0xBFA1, 0xBFFE, 0x092E, 0xC040, 0xC040, 0x20FB,
+ 0xC041, 0xC043, 0x43AE, 0xC044, 0xC044, 0x2440, 0xC045, 0xC04A, 0x43B1,
+ 0xC04B, 0xC04B, 0x2126, 0xC04C, 0xC04C, 0x1F61, 0xC04D, 0xC04D, 0x269D,
+ 0xC04E, 0xC04E, 0x43B7, 0xC04F, 0xC04F, 0x1F8A, 0xC050, 0xC050, 0x2456,
+ 0xC051, 0xC051, 0x2459, 0xC052, 0xC052, 0x2458, 0xC053, 0xC054, 0x43B8,
+ 0xC055, 0xC055, 0x1FAE, 0xC056, 0xC05A, 0x43BA, 0xC05B, 0xC05B, 0x221A,
+ 0xC05C, 0xC05D, 0x43BF, 0xC05E, 0xC05E, 0x1F7A, 0xC05F, 0xC05F, 0x244D,
+ 0xC060, 0xC060, 0x2457, 0xC061, 0xC068, 0x43C1, 0xC069, 0xC069, 0x2453,
+ 0xC06A, 0xC06A, 0x43C9, 0xC06B, 0xC06B, 0x2420, 0xC06C, 0xC06C, 0x43CA,
+ 0xC06D, 0xC06D, 0x21DF, 0xC06E, 0xC06E, 0x2685, 0xC06F, 0xC06F, 0x43CB,
+ 0xC070, 0xC070, 0x1E6E, 0xC071, 0xC073, 0x43CC, 0xC074, 0xC074, 0x2224,
+ 0xC075, 0xC075, 0x2670, 0xC076, 0xC076, 0x43CF, 0xC077, 0xC077, 0x21BA,
+ 0xC078, 0xC078, 0x43D0, 0xC079, 0xC079, 0x245A, 0xC07A, 0xC07B, 0x43D1,
+ 0xC07C, 0xC07C, 0x1FFF, 0xC07D, 0xC07E, 0x43D3, 0xC080, 0xC09A, 0x43D5,
+ 0xC09B, 0xC09B, 0x25E2, 0xC09C, 0xC09C, 0x43F0, 0xC09D, 0xC09D, 0x269A,
+ 0xC09E, 0xC0A0, 0x43F1, 0xC0A1, 0xC0FE, 0x098C, 0xC140, 0xC14F, 0x43F4,
+ 0xC150, 0xC150, 0x1EEA, 0xC151, 0xC153, 0x4404, 0xC154, 0xC154, 0x1E2C,
+ 0xC155, 0xC15E, 0x4407, 0xC15F, 0xC15F, 0x2062, 0xC160, 0xC160, 0x24F1,
+ 0xC161, 0xC161, 0x4411, 0xC162, 0xC162, 0x24F2, 0xC163, 0xC174, 0x4412,
+ 0xC175, 0xC175, 0x25F2, 0xC176, 0xC177, 0x4424, 0xC178, 0xC178, 0x2215,
+ 0xC179, 0xC17E, 0x4426, 0xC180, 0xC194, 0x442C, 0xC195, 0xC195, 0x21AE,
+ 0xC196, 0xC1A0, 0x4441, 0xC1A1, 0xC1FE, 0x09EA, 0xC240, 0xC24D, 0x444C,
+ 0xC24E, 0xC24E, 0x20E0, 0xC24F, 0xC264, 0x445A, 0xC265, 0xC265, 0x25C2,
+ 0xC266, 0xC266, 0x4470, 0xC267, 0xC267, 0x25C1, 0xC268, 0xC27C, 0x4471,
+ 0xC27D, 0xC27D, 0x2128, 0xC27E, 0xC27E, 0x4486, 0xC280, 0xC283, 0x4487,
+ 0xC284, 0xC284, 0x2199, 0xC285, 0xC292, 0x448B, 0xC293, 0xC293, 0x2017,
+ 0xC294, 0xC294, 0x1EA0, 0xC295, 0xC295, 0x2125, 0xC296, 0xC296, 0x214D,
+ 0xC297, 0xC297, 0x4499, 0xC298, 0xC298, 0x25C4, 0xC299, 0xC299, 0x209D,
+ 0xC29A, 0xC29A, 0x228A, 0xC29B, 0xC29B, 0x449A, 0xC29C, 0xC29C, 0x25C3,
+ 0xC29D, 0xC29F, 0x449B, 0xC2A0, 0xC2A0, 0x2179, 0xC2A1, 0xC2FE, 0x0A48,
+ 0xC340, 0xC340, 0x2038, 0xC341, 0xC342, 0x449E, 0xC343, 0xC343, 0x2155,
+ 0xC344, 0xC37A, 0x44A0, 0xC37B, 0xC37B, 0x21D2, 0xC37C, 0xC37E, 0x44D7,
+ 0xC380, 0xC383, 0x44DA, 0xC384, 0xC384, 0x24C7, 0xC385, 0xC39A, 0x44DE,
+ 0xC39B, 0xC39B, 0x2279, 0xC39C, 0xC3A0, 0x44F4, 0xC3A1, 0xC3FE, 0x0AA6,
+ 0xC440, 0xC448, 0x44F9, 0xC449, 0xC449, 0x2123, 0xC44A, 0xC44B, 0x4502,
+ 0xC44C, 0xC44C, 0x24C5, 0xC44D, 0xC453, 0x4504, 0xC454, 0xC454, 0x24C9,
+ 0xC455, 0xC457, 0x450B, 0xC458, 0xC458, 0x2094, 0xC459, 0xC45A, 0x450E,
+ 0xC45B, 0xC45B, 0x2296, 0xC45C, 0xC462, 0x4510, 0xC463, 0xC463, 0x1E77,
+ 0xC464, 0xC476, 0x4517, 0xC477, 0xC477, 0x1F06, 0xC478, 0xC479, 0x452A,
+ 0xC47A, 0xC47A, 0x1FA5, 0xC47B, 0xC47E, 0x452C, 0xC480, 0xC480, 0x4530,
+ 0xC481, 0xC481, 0x2099, 0xC482, 0xC490, 0x4531, 0xC491, 0xC491, 0x1EAD,
+ 0xC492, 0xC492, 0x24C8, 0xC493, 0xC493, 0x20A8, 0xC494, 0xC497, 0x4540,
+ 0xC498, 0xC498, 0x201F, 0xC499, 0xC499, 0x4544, 0xC49A, 0xC49A, 0x20C5,
+ 0xC49B, 0xC49B, 0x4545, 0xC49C, 0xC49C, 0x24CA, 0xC49D, 0xC4A0, 0x4546,
+ 0xC4A1, 0xC4FE, 0x0B04, 0xC540, 0xC543, 0x454A, 0xC544, 0xC544, 0x1FF0,
+ 0xC545, 0xC545, 0x454E, 0xC546, 0xC546, 0x24C6, 0xC547, 0xC54A, 0x454F,
+ 0xC54B, 0xC54B, 0x225D, 0xC54C, 0xC54C, 0x22DE, 0xC54D, 0xC551, 0x4553,
+ 0xC552, 0xC552, 0x202C, 0xC553, 0xC55E, 0x4558, 0xC55F, 0xC55F, 0x2161,
+ 0xC560, 0xC562, 0x4564, 0xC563, 0xC563, 0x223B, 0xC564, 0xC564, 0x21D9,
+ 0xC565, 0xC565, 0x1FCB, 0xC566, 0xC566, 0x1FC9, 0xC567, 0xC57E, 0x4567,
+ 0xC580, 0xC592, 0x457F, 0xC593, 0xC593, 0x1E61, 0xC594, 0xC59B, 0x4592,
+ 0xC59C, 0xC59C, 0x25EF, 0xC59D, 0xC59D, 0x459A, 0xC59E, 0xC59E, 0x1F98,
+ 0xC59F, 0xC5A0, 0x459B, 0xC5A1, 0xC5FE, 0x0B62, 0xC640, 0xC640, 0x459D,
+ 0xC641, 0xC641, 0x25F0, 0xC642, 0xC643, 0x459E, 0xC644, 0xC644, 0x1F88,
+ 0xC645, 0xC646, 0x45A0, 0xC647, 0xC647, 0x21F8, 0xC648, 0xC662, 0x45A2,
+ 0xC663, 0xC663, 0x2322, 0xC664, 0xC671, 0x45BD, 0xC672, 0xC672, 0x2336,
+ 0xC673, 0xC67E, 0x45CB, 0xC680, 0xC6A0, 0x45D7, 0xC6A1, 0xC6FE, 0x0BC0,
+ 0xC740, 0xC765, 0x45F8, 0xC766, 0xC766, 0x22AB, 0xC767, 0xC76E, 0x461E,
+ 0xC76F, 0xC76F, 0x1FBF, 0xC770, 0xC775, 0x4626, 0xC776, 0xC776, 0x1F7D,
+ 0xC777, 0xC77A, 0x462C, 0xC77B, 0xC77B, 0x2333, 0xC77C, 0xC77E, 0x4630,
+ 0xC780, 0xC7A0, 0x4633, 0xC7A1, 0xC7FE, 0x0C1E, 0xC840, 0xC840, 0x4654,
+ 0xC841, 0xC841, 0x1F4D, 0xC842, 0xC84E, 0x4655, 0xC84F, 0xC84F, 0x2334,
+ 0xC850, 0xC851, 0x4662, 0xC852, 0xC852, 0x1FF1, 0xC853, 0xC865, 0x4664,
+ 0xC866, 0xC866, 0x218B, 0xC867, 0xC86D, 0x4677, 0xC86E, 0xC86E, 0x2349,
+ 0xC86F, 0xC87D, 0x467E, 0xC87E, 0xC87E, 0x220B, 0xC880, 0xC886, 0x468D,
+ 0xC887, 0xC887, 0x2346, 0xC888, 0xC891, 0x4694, 0xC892, 0xC892, 0x2347,
+ 0xC893, 0xC893, 0x469E, 0xC894, 0xC894, 0x2193, 0xC895, 0xC898, 0x469F,
+ 0xC899, 0xC899, 0x26A1, 0xC89A, 0xC89C, 0x46A3, 0xC89D, 0xC89D, 0x1F62,
+ 0xC89E, 0xC8A0, 0x46A6, 0xC8A1, 0xC8FE, 0x0C7C, 0xC940, 0xC94E, 0x46A9,
+ 0xC94F, 0xC94F, 0x234D, 0xC950, 0xC950, 0x2348, 0xC951, 0xC96D, 0x46B8,
+ 0xC96E, 0xC96E, 0x1E60, 0xC96F, 0xC96F, 0x46D5, 0xC970, 0xC970, 0x2345,
+ 0xC971, 0xC976, 0x46D6, 0xC977, 0xC977, 0x1F12, 0xC978, 0xC97E, 0x46DC,
+ 0xC980, 0xC98E, 0x46E3, 0xC98F, 0xC98F, 0x2018, 0xC990, 0xC990, 0x2335,
+ 0xC991, 0xC99B, 0x46F2, 0xC99C, 0xC99C, 0x233C, 0xC99D, 0xC9A0, 0x46FD,
+ 0xC9A1, 0xC9FE, 0x0CDA, 0xCA40, 0xCA4D, 0x4701, 0xCA4E, 0xCA4E, 0x266F,
+ 0xCA4F, 0xCA55, 0x470F, 0xCA56, 0xCA56, 0x2351, 0xCA57, 0xCA58, 0x4716,
+ 0xCA59, 0xCA59, 0x1FA0, 0xCA5A, 0xCA5B, 0x4718, 0xCA5C, 0xCA5C, 0x2338,
+ 0xCA5D, 0xCA60, 0x471A, 0xCA61, 0xCA61, 0x221B, 0xCA62, 0xCA6D, 0x471E,
+ 0xCA6E, 0xCA6E, 0x2342, 0xCA6F, 0xCA71, 0x472A, 0xCA72, 0xCA72, 0x234F,
+ 0xCA73, 0xCA76, 0x472D, 0xCA77, 0xCA77, 0x233D, 0xCA78, 0xCA7A, 0x4731,
+ 0xCA7B, 0xCA7B, 0x2344, 0xCA7C, 0xCA7C, 0x2331, 0xCA7D, 0xCA7D, 0x4734,
+ 0xCA7E, 0xCA7E, 0x234B, 0xCA80, 0xCA80, 0x4735, 0xCA81, 0xCA81, 0x233B,
+ 0xCA82, 0xCA88, 0x4736, 0xCA89, 0xCA89, 0x2350, 0xCA8A, 0xCA8D, 0x473D,
+ 0xCA8E, 0xCA8E, 0x1EB4, 0xCA8F, 0xCA8F, 0x21A6, 0xCA90, 0xCA91, 0x4741,
+ 0xCA92, 0xCA92, 0x21CB, 0xCA93, 0xCA99, 0x4743, 0xCA9A, 0xCA9A, 0x2355,
+ 0xCA9B, 0xCAA0, 0x474A, 0xCAA1, 0xCAFE, 0x0D38, 0xCB40, 0xCB42, 0x4750,
+ 0xCB43, 0xCB43, 0x233E, 0xCB44, 0xCB44, 0x4753, 0xCB45, 0xCB45, 0x1F74,
+ 0xCB46, 0xCB46, 0x4754, 0xCB47, 0xCB47, 0x2330, 0xCB48, 0xCB4A, 0x4755,
+ 0xCB4B, 0xCB4B, 0x2680, 0xCB4C, 0xCB4D, 0x4758, 0xCB4E, 0xCB4E, 0x20DA,
+ 0xCB4F, 0xCB56, 0x475A, 0xCB57, 0xCB57, 0x234A, 0xCB58, 0xCB5C, 0x4762,
+ 0xCB5D, 0xCB5D, 0x1F91, 0xCB5E, 0xCB5E, 0x4767, 0xCB5F, 0xCB5F, 0x2107,
+ 0xCB60, 0xCB69, 0x4768, 0xCB6A, 0xCB6A, 0x233F, 0xCB6B, 0xCB7A, 0x4772,
+ 0xCB7B, 0xCB7B, 0x1FF4, 0xCB7C, 0xCB7C, 0x2343, 0xCB7D, 0xCB7E, 0x4782,
+ 0xCB80, 0xCB86, 0x4784, 0xCB87, 0xCB87, 0x2212, 0xCB88, 0xCB8D, 0x478B,
+ 0xCB8E, 0xCB8E, 0x2207, 0xCB8F, 0xCB91, 0x4791, 0xCB92, 0xCB92, 0x2359,
+ 0xCB93, 0xCB9B, 0x4794, 0xCB9C, 0xCB9C, 0x2254, 0xCB9D, 0xCB9D, 0x479D,
+ 0xCB9E, 0xCB9E, 0x2332, 0xCB9F, 0xCBA0, 0x479E, 0xCBA1, 0xCBFE, 0x0D96,
+ 0xCC40, 0xCC40, 0x1E26, 0xCC41, 0xCC41, 0x2357, 0xCC42, 0xCC48, 0x47A0,
+ 0xCC49, 0xCC49, 0x2358, 0xCC4A, 0xCC4A, 0x2042, 0xCC4B, 0xCC4B, 0x2153,
+ 0xCC4C, 0xCC4E, 0x47A7, 0xCC4F, 0xCC4F, 0x20BB, 0xCC50, 0xCC5B, 0x47AA,
+ 0xCC5C, 0xCC5C, 0x235A, 0xCC5D, 0xCC5F, 0x47B6, 0xCC60, 0xCC60, 0x2356,
+ 0xCC61, 0xCC63, 0x47B9, 0xCC64, 0xCC64, 0x2337, 0xCC65, 0xCC6C, 0x47BC,
+ 0xCC6D, 0xCC6D, 0x1FF9, 0xCC6E, 0xCC78, 0x47C4, 0xCC79, 0xCC79, 0x2353,
+ 0xCC7A, 0xCC7C, 0x47CF, 0xCC7D, 0xCC7D, 0x2061, 0xCC7E, 0xCC7E, 0x47D2,
+ 0xCC80, 0xCC8D, 0x47D3, 0xCC8E, 0xCC8E, 0x1E95, 0xCC8F, 0xCC93, 0x47E1,
+ 0xCC94, 0xCC94, 0x2049, 0xCC95, 0xCC95, 0x47E6, 0xCC96, 0xCC96, 0x1F42,
+ 0xCC97, 0xCC9C, 0x47E7, 0xCC9D, 0xCC9D, 0x1FE8, 0xCC9E, 0xCCA0, 0x47ED,
+ 0xCCA1, 0xCCFE, 0x0DF4, 0xCD40, 0xCD7E, 0x47F0, 0xCD80, 0xCD8F, 0x482F,
+ 0xCD90, 0xCD90, 0x25DA, 0xCD91, 0xCD97, 0x483F, 0xCD98, 0xCD98, 0x25D7,
+ 0xCD99, 0xCDA0, 0x4846, 0xCDA1, 0xCDFE, 0x0E52, 0xCE40, 0xCE66, 0x484E,
+ 0xCE67, 0xCE67, 0x212E, 0xCE68, 0xCE71, 0x4875, 0xCE72, 0xCE72, 0x21B2,
+ 0xCE73, 0xCE7E, 0x487F, 0xCE80, 0xCE80, 0x488B, 0xCE81, 0xCE81, 0x219E,
+ 0xCE82, 0xCE86, 0x488C, 0xCE87, 0xCE87, 0x25DC, 0xCE88, 0xCE9A, 0x4891,
+ 0xCE9B, 0xCE9B, 0x206C, 0xCE9C, 0xCE9D, 0x48A4, 0xCE9E, 0xCE9E, 0x2226,
+ 0xCE9F, 0xCEA0, 0x48A6, 0xCEA1, 0xCEFE, 0x0EB0, 0xCF40, 0xCF4D, 0x48A8,
+ 0xCF4E, 0xCF4E, 0x25E0, 0xCF4F, 0xCF54, 0x48B6, 0xCF55, 0xCF55, 0x227B,
+ 0xCF56, 0xCF57, 0x48BC, 0xCF58, 0xCF58, 0x25DE, 0xCF59, 0xCF5B, 0x48BE,
+ 0xCF5C, 0xCF5C, 0x25E1, 0xCF5D, 0xCF6B, 0x48C1, 0xCF6C, 0xCF6C, 0x25D5,
+ 0xCF6D, 0xCF72, 0x48D0, 0xCF73, 0xCF73, 0x1E6B, 0xCF74, 0xCF74, 0x48D6,
+ 0xCF75, 0xCF75, 0x25DB, 0xCF76, 0xCF77, 0x48D7, 0xCF78, 0xCF78, 0x1E89,
+ 0xCF79, 0xCF7B, 0x48D9, 0xCF7C, 0xCF7C, 0x25D9, 0xCF7D, 0xCF7E, 0x48DC,
+ 0xCF80, 0xCF80, 0x48DE, 0xCF81, 0xCF81, 0x2211, 0xCF82, 0xCF88, 0x48DF,
+ 0xCF89, 0xCF89, 0x2229, 0xCF8A, 0xCF8A, 0x25D6, 0xCF8B, 0xCF92, 0x48E6,
+ 0xCF93, 0xCF93, 0x25DD, 0xCF94, 0xCF94, 0x25DF, 0xCF95, 0xCF9D, 0x48EE,
+ 0xCF9E, 0xCF9E, 0x1FEF, 0xCF9F, 0xCF9F, 0x48F7, 0xCFA0, 0xCFA0, 0x25D8,
+ 0xCFA1, 0xCFFE, 0x0F0E, 0xD040, 0xD04C, 0x48F8, 0xD04D, 0xD04D, 0x1F29,
+ 0xD04E, 0xD050, 0x4905, 0xD051, 0xD051, 0x1E5B, 0xD052, 0xD054, 0x4908,
+ 0xD055, 0xD055, 0x2076, 0xD056, 0xD05B, 0x490B, 0xD05C, 0xD05C, 0x2297,
+ 0xD05D, 0xD05F, 0x4911, 0xD060, 0xD060, 0x2690, 0xD061, 0xD066, 0x4914,
+ 0xD067, 0xD067, 0x213F, 0xD068, 0xD06B, 0x491A, 0xD06C, 0xD06C, 0x2198,
+ 0xD06D, 0xD06D, 0x491E, 0xD06E, 0xD06E, 0x1E88, 0xD06F, 0xD07C, 0x491F,
+ 0xD07D, 0xD07D, 0x228C, 0xD07E, 0xD07E, 0x492D, 0xD080, 0xD0A0, 0x492E,
+ 0xD0A1, 0xD0FE, 0x0F6C, 0xD140, 0xD154, 0x494F, 0xD155, 0xD155, 0x25F1,
+ 0xD156, 0xD158, 0x4964, 0xD159, 0xD159, 0x200C, 0xD15A, 0xD160, 0x4967,
+ 0xD161, 0xD161, 0x1E58, 0xD162, 0xD162, 0x22AC, 0xD163, 0xD174, 0x496E,
+ 0xD175, 0xD175, 0x26A7, 0xD176, 0xD17C, 0x4980, 0xD17D, 0xD17D, 0x2676,
+ 0xD17E, 0xD17E, 0x4987, 0xD180, 0xD19C, 0x4988, 0xD19D, 0xD19D, 0x1FE1,
+ 0xD19E, 0xD19E, 0x25BB, 0xD19F, 0xD1A0, 0x49A5, 0xD1A1, 0xD1FE, 0x0FCA,
+ 0xD240, 0xD240, 0x25BE, 0xD241, 0xD242, 0x49A7, 0xD243, 0xD243, 0x22DD,
+ 0xD244, 0xD24C, 0x49A9, 0xD24D, 0xD24D, 0x25BD, 0xD24E, 0xD25B, 0x49B2,
+ 0xD25C, 0xD25C, 0x1E2A, 0xD25D, 0xD262, 0x49C0, 0xD263, 0xD263, 0x25BC,
+ 0xD264, 0xD264, 0x25BA, 0xD265, 0xD267, 0x49C6, 0xD268, 0xD268, 0x25BF,
+ 0xD269, 0xD26C, 0x49C9, 0xD26D, 0xD26D, 0x2187, 0xD26E, 0xD26E, 0x49CD,
+ 0xD26F, 0xD26F, 0x266B, 0xD270, 0xD271, 0x49CE, 0xD272, 0xD272, 0x1E7F,
+ 0xD273, 0xD274, 0x49D0, 0xD275, 0xD275, 0x21AD, 0xD276, 0xD27E, 0x49D2,
+ 0xD280, 0xD289, 0x49DB, 0xD28A, 0xD28A, 0x1F96, 0xD28B, 0xD28D, 0x49E5,
+ 0xD28E, 0xD28E, 0x1F32, 0xD28F, 0xD291, 0x49E8, 0xD292, 0xD292, 0x2084,
+ 0xD293, 0xD294, 0x49EB, 0xD295, 0xD295, 0x2136, 0xD296, 0xD296, 0x49ED,
+ 0xD297, 0xD297, 0x24B8, 0xD298, 0xD29F, 0x49EE, 0xD2A0, 0xD2A0, 0x24BA,
+ 0xD2A1, 0xD2FE, 0x1028, 0xD340, 0xD343, 0x49F6, 0xD344, 0xD344, 0x24BC,
+ 0xD345, 0xD347, 0x49FA, 0xD348, 0xD348, 0x20E4, 0xD349, 0xD349, 0x49FD,
+ 0xD34A, 0xD34A, 0x24B9, 0xD34B, 0xD34C, 0x49FE, 0xD34D, 0xD34D, 0x24BD,
+ 0xD34E, 0xD34F, 0x4A00, 0xD350, 0xD350, 0x24BE, 0xD351, 0xD354, 0x4A02,
+ 0xD355, 0xD355, 0x24BF, 0xD356, 0xD357, 0x4A06, 0xD358, 0xD358, 0x1FD2,
+ 0xD359, 0xD35A, 0x4A08, 0xD35B, 0xD35B, 0x1FFD, 0xD35C, 0xD35C, 0x4A0A,
+ 0xD35D, 0xD35D, 0x24BB, 0xD35E, 0xD35E, 0x1F2D, 0xD35F, 0xD377, 0x4A0B,
+ 0xD378, 0xD378, 0x2609, 0xD379, 0xD379, 0x4A24, 0xD37A, 0xD37A, 0x260A,
+ 0xD37B, 0xD37B, 0x4A25, 0xD37C, 0xD37C, 0x1E94, 0xD37D, 0xD37E, 0x4A26,
+ 0xD380, 0xD384, 0x4A28, 0xD385, 0xD385, 0x22DF, 0xD386, 0xD386, 0x1ECB,
+ 0xD387, 0xD387, 0x1F0D, 0xD388, 0xD38A, 0x4A2D, 0xD38B, 0xD38B, 0x1F77,
+ 0xD38C, 0xD38C, 0x4A30, 0xD38D, 0xD38D, 0x21EB, 0xD38E, 0xD38E, 0x4A31,
+ 0xD38F, 0xD38F, 0x22E1, 0xD390, 0xD390, 0x4A32, 0xD391, 0xD391, 0x216F,
+ 0xD392, 0xD392, 0x4A33, 0xD393, 0xD393, 0x22E0, 0xD394, 0xD395, 0x4A34,
+ 0xD396, 0xD396, 0x21EA, 0xD397, 0xD397, 0x4A36, 0xD398, 0xD398, 0x22E2,
+ 0xD399, 0xD399, 0x20CB, 0xD39A, 0xD39A, 0x4A37, 0xD39B, 0xD39B, 0x1F78,
+ 0xD39C, 0xD39D, 0x4A38, 0xD39E, 0xD39E, 0x1EE2, 0xD39F, 0xD39F, 0x4A3A,
+ 0xD3A0, 0xD3A0, 0x21F2, 0xD3A1, 0xD3FE, 0x1086, 0xD440, 0xD440, 0x4A3B,
+ 0xD441, 0xD441, 0x2150, 0xD442, 0xD444, 0x4A3C, 0xD445, 0xD445, 0x1FD3,
+ 0xD446, 0xD446, 0x4A3F, 0xD447, 0xD447, 0x22E5, 0xD448, 0xD44B, 0x4A40,
+ 0xD44C, 0xD44C, 0x1EF2, 0xD44D, 0xD44E, 0x4A44, 0xD44F, 0xD44F, 0x211F,
+ 0xD450, 0xD452, 0x4A46, 0xD453, 0xD453, 0x21DD, 0xD454, 0xD455, 0x4A49,
+ 0xD456, 0xD456, 0x2154, 0xD457, 0xD457, 0x4A4B, 0xD458, 0xD458, 0x22E7,
+ 0xD459, 0xD45B, 0x4A4C, 0xD45C, 0xD45C, 0x2282, 0xD45D, 0xD461, 0x4A4F,
+ 0xD462, 0xD462, 0x22E6, 0xD463, 0xD466, 0x4A54, 0xD467, 0xD467, 0x22E8,
+ 0xD468, 0xD46D, 0x4A58, 0xD46E, 0xD46E, 0x22E4, 0xD46F, 0xD46F, 0x4A5E,
+ 0xD470, 0xD470, 0x226A, 0xD471, 0xD471, 0x4A5F, 0xD472, 0xD472, 0x22EB,
+ 0xD473, 0xD473, 0x4A60, 0xD474, 0xD474, 0x22E9, 0xD475, 0xD475, 0x20BD,
+ 0xD476, 0xD477, 0x4A61, 0xD478, 0xD478, 0x22EA, 0xD479, 0xD47A, 0x4A63,
+ 0xD47B, 0xD47B, 0x22BD, 0xD47C, 0xD47D, 0x4A65, 0xD47E, 0xD47E, 0x1E9E,
+ 0xD480, 0xD481, 0x4A67, 0xD482, 0xD482, 0x22F6, 0xD483, 0xD483, 0x21E7,
+ 0xD484, 0xD484, 0x2216, 0xD485, 0xD486, 0x4A69, 0xD487, 0xD487, 0x2137,
+ 0xD488, 0xD489, 0x4A6B, 0xD48A, 0xD48A, 0x212C, 0xD48B, 0xD48B, 0x4A6D,
+ 0xD48C, 0xD48C, 0x1E68, 0xD48D, 0xD48D, 0x22F2, 0xD48E, 0xD48E, 0x1F37,
+ 0xD48F, 0xD48F, 0x22F3, 0xD490, 0xD490, 0x4A6E, 0xD491, 0xD491, 0x22EF,
+ 0xD492, 0xD492, 0x1F50, 0xD493, 0xD493, 0x1F10, 0xD494, 0xD494, 0x21C8,
+ 0xD495, 0xD495, 0x4A6F, 0xD496, 0xD496, 0x22F1, 0xD497, 0xD49B, 0x4A70,
+ 0xD49C, 0xD49C, 0x22F0, 0xD49D, 0xD49E, 0x4A75, 0xD49F, 0xD49F, 0x22EE,
+ 0xD4A0, 0xD4A0, 0x4A77, 0xD4A1, 0xD4FE, 0x10E4, 0xD540, 0xD542, 0x4A78,
+ 0xD543, 0xD543, 0x22ED, 0xD544, 0xD544, 0x229E, 0xD545, 0xD545, 0x22EC,
+ 0xD546, 0xD546, 0x1FE2, 0xD547, 0xD549, 0x4A7B, 0xD54A, 0xD54A, 0x20FE,
+ 0xD54B, 0xD54D, 0x4A7E, 0xD54E, 0xD54F, 0x22F9, 0xD550, 0xD550, 0x4A81,
+ 0xD551, 0xD551, 0x1EAF, 0xD552, 0xD553, 0x4A82, 0xD554, 0xD554, 0x2236,
+ 0xD555, 0xD555, 0x4A84, 0xD556, 0xD556, 0x22F7, 0xD557, 0xD559, 0x4A85,
+ 0xD55A, 0xD55A, 0x223D, 0xD55B, 0xD55B, 0x4A88, 0xD55C, 0xD55C, 0x1E82,
+ 0xD55D, 0xD55D, 0x1FB6, 0xD55E, 0xD55E, 0x4A89, 0xD55F, 0xD55F, 0x21A4,
+ 0xD560, 0xD560, 0x21AA, 0xD561, 0xD561, 0x22F8, 0xD562, 0xD562, 0x2151,
+ 0xD563, 0xD563, 0x4A8A, 0xD564, 0xD564, 0x1F60, 0xD565, 0xD567, 0x4A8B,
+ 0xD568, 0xD568, 0x2147, 0xD569, 0xD56B, 0x4A8E, 0xD56C, 0xD56C, 0x2145,
+ 0xD56D, 0xD56D, 0x4A91, 0xD56E, 0xD56E, 0x1FDC, 0xD56F, 0xD571, 0x4A92,
+ 0xD572, 0xD572, 0x2301, 0xD573, 0xD574, 0x4A95, 0xD575, 0xD575, 0x1EF5,
+ 0xD576, 0xD577, 0x4A97, 0xD578, 0xD578, 0x2218, 0xD579, 0xD57A, 0x4A99,
+ 0xD57B, 0xD57B, 0x1EC6, 0xD57C, 0xD57D, 0x4A9B, 0xD57E, 0xD57E, 0x2300,
+ 0xD580, 0xD580, 0x4A9D, 0xD581, 0xD581, 0x22B4, 0xD582, 0xD583, 0x4A9E,
+ 0xD584, 0xD584, 0x2169, 0xD585, 0xD585, 0x4AA0, 0xD586, 0xD586, 0x22FD,
+ 0xD587, 0xD587, 0x4AA1, 0xD588, 0xD588, 0x20EA, 0xD589, 0xD589, 0x4AA2,
+ 0xD58A, 0xD58A, 0x22F4, 0xD58B, 0xD58B, 0x4AA3, 0xD58C, 0xD58C, 0x22FB,
+ 0xD58D, 0xD58D, 0x4AA4, 0xD58E, 0xD58E, 0x22FC, 0xD58F, 0xD58F, 0x2027,
+ 0xD590, 0xD592, 0x4AA5, 0xD593, 0xD593, 0x2060, 0xD594, 0xD594, 0x22FF,
+ 0xD595, 0xD597, 0x4AA8, 0xD598, 0xD598, 0x22FE, 0xD599, 0xD599, 0x1EC7,
+ 0xD59A, 0xD59A, 0x4AAB, 0xD59B, 0xD59B, 0x230C, 0xD59C, 0xD59E, 0x4AAC,
+ 0xD59F, 0xD59F, 0x22F5, 0xD5A0, 0xD5A0, 0x4AAF, 0xD5A1, 0xD5FE, 0x1142,
+ 0xD640, 0xD640, 0x2306, 0xD641, 0xD641, 0x4AB0, 0xD642, 0xD642, 0x230A,
+ 0xD643, 0xD643, 0x21D3, 0xD644, 0xD646, 0x4AB1, 0xD647, 0xD647, 0x2303,
+ 0xD648, 0xD648, 0x4AB4, 0xD649, 0xD649, 0x2307, 0xD64A, 0xD64A, 0x230B,
+ 0xD64B, 0xD64C, 0x4AB5, 0xD64D, 0xD64D, 0x1F5F, 0xD64E, 0xD64E, 0x4AB7,
+ 0xD64F, 0xD64F, 0x2309, 0xD650, 0xD651, 0x4AB8, 0xD652, 0xD652, 0x2302,
+ 0xD653, 0xD653, 0x1F04, 0xD654, 0xD654, 0x229D, 0xD655, 0xD655, 0x4ABA,
+ 0xD656, 0xD656, 0x21FB, 0xD657, 0xD657, 0x4ABB, 0xD658, 0xD658, 0x2308,
+ 0xD659, 0xD659, 0x4ABC, 0xD65A, 0xD65A, 0x20AC, 0xD65B, 0xD65B, 0x4ABD,
+ 0xD65C, 0xD65C, 0x208E, 0xD65D, 0xD65D, 0x2305, 0xD65E, 0xD65E, 0x2197,
+ 0xD65F, 0xD65F, 0x4ABE, 0xD660, 0xD660, 0x2171, 0xD661, 0xD661, 0x2298,
+ 0xD662, 0xD664, 0x4ABF, 0xD665, 0xD665, 0x1F57, 0xD666, 0xD668, 0x4AC2,
+ 0xD669, 0xD669, 0x2082, 0xD66A, 0xD66A, 0x4AC5, 0xD66B, 0xD66B, 0x2311,
+ 0xD66C, 0xD66E, 0x4AC6, 0xD66F, 0xD66F, 0x2304, 0xD670, 0xD670, 0x4AC9,
+ 0xD671, 0xD671, 0x230F, 0xD672, 0xD672, 0x1E35, 0xD673, 0xD673, 0x4ACA,
+ 0xD674, 0xD674, 0x20D1, 0xD675, 0xD675, 0x2310, 0xD676, 0xD676, 0x1FA3,
+ 0xD677, 0xD677, 0x4ACB, 0xD678, 0xD678, 0x21D6, 0xD679, 0xD67B, 0x4ACC,
+ 0xD67C, 0xD67C, 0x2206, 0xD67D, 0xD67E, 0x4ACF, 0xD680, 0xD682, 0x4AD1,
+ 0xD683, 0xD683, 0x230D, 0xD684, 0xD685, 0x4AD4, 0xD686, 0xD686, 0x2312,
+ 0xD687, 0xD687, 0x208D, 0xD688, 0xD688, 0x2313, 0xD689, 0xD68D, 0x4AD6,
+ 0xD68E, 0xD68E, 0x22E3, 0xD68F, 0xD693, 0x4ADB, 0xD694, 0xD694, 0x1FBA,
+ 0xD695, 0xD698, 0x4AE0, 0xD699, 0xD699, 0x2078, 0xD69A, 0xD6A0, 0x4AE4,
+ 0xD6A1, 0xD6FE, 0x11A0, 0xD740, 0xD742, 0x4AEB, 0xD743, 0xD743, 0x2288,
+ 0xD744, 0xD747, 0x4AEE, 0xD748, 0xD748, 0x2316, 0xD749, 0xD749, 0x1F6B,
+ 0xD74A, 0xD74F, 0x4AF2, 0xD750, 0xD750, 0x2314, 0xD751, 0xD751, 0x4AF8,
+ 0xD752, 0xD752, 0x2130, 0xD753, 0xD753, 0x2315, 0xD754, 0xD754, 0x2168,
+ 0xD755, 0xD755, 0x4AF9, 0xD756, 0xD756, 0x20C4, 0xD757, 0xD763, 0x4AFA,
+ 0xD764, 0xD764, 0x2318, 0xD765, 0xD766, 0x4B07, 0xD767, 0xD767, 0x2219,
+ 0xD768, 0xD768, 0x2217, 0xD769, 0xD76B, 0x4B09, 0xD76C, 0xD76C, 0x20D5,
+ 0xD76D, 0xD76E, 0x4B0C, 0xD76F, 0xD76F, 0x1F4A, 0xD770, 0xD774, 0x4B0E,
+ 0xD775, 0xD775, 0x2240, 0xD776, 0xD777, 0x4B13, 0xD778, 0xD778, 0x1ED3,
+ 0xD779, 0xD77E, 0x4B15, 0xD780, 0xD782, 0x4B1B, 0xD783, 0xD783, 0x1E49,
+ 0xD784, 0xD786, 0x4B1E, 0xD787, 0xD787, 0x261B, 0xD788, 0xD78A, 0x4B21,
+ 0xD78B, 0xD78B, 0x1E6D, 0xD78C, 0xD78C, 0x20F8, 0xD78D, 0xD78D, 0x4B24,
+ 0xD78E, 0xD78E, 0x1FFB, 0xD78F, 0xD78F, 0x2319, 0xD790, 0xD794, 0x4B25,
+ 0xD795, 0xD795, 0x230E, 0xD796, 0xD796, 0x4B2A, 0xD797, 0xD797, 0x2317,
+ 0xD798, 0xD7A0, 0x4B2B, 0xD7A1, 0xD7F9, 0x11FE, 0xD840, 0xD84C, 0x4B34,
+ 0xD84D, 0xD84D, 0x20C8, 0xD84E, 0xD852, 0x4B41, 0xD853, 0xD853, 0x1EFD,
+ 0xD854, 0xD87E, 0x4B46, 0xD880, 0xD88F, 0x4B71, 0xD890, 0xD890, 0x1E3B,
+ 0xD891, 0xD891, 0x227F, 0xD892, 0xD892, 0x4B81, 0xD893, 0xD893, 0x1F0C,
+ 0xD894, 0xD894, 0x1E59, 0xD895, 0xD895, 0x1F24, 0xD896, 0xD899, 0x4B82,
+ 0xD89A, 0xD89A, 0x20BA, 0xD89B, 0xD89B, 0x1F65, 0xD89C, 0xD89C, 0x1EF0,
+ 0xD89D, 0xD89D, 0x2164, 0xD89E, 0xD89E, 0x1F30, 0xD89F, 0xD89F, 0x2261,
+ 0xD8A0, 0xD8A0, 0x4B86, 0xD8A1, 0xD8FE, 0x1257, 0xD940, 0xD940, 0x4B87,
+ 0xD941, 0xD941, 0x22A2, 0xD942, 0xD942, 0x24AB, 0xD943, 0xD943, 0x4B88,
+ 0xD944, 0xD944, 0x24AF, 0xD945, 0xD945, 0x1EE8, 0xD946, 0xD946, 0x1F39,
+ 0xD947, 0xD947, 0x4B89, 0xD948, 0xD948, 0x1E48, 0xD949, 0xD949, 0x2070,
+ 0xD94A, 0xD94A, 0x1EA8, 0xD94B, 0xD94B, 0x4B8A, 0xD94C, 0xD94C, 0x24AC,
+ 0xD94D, 0xD94D, 0x1EF7, 0xD94E, 0xD94E, 0x2176, 0xD94F, 0xD94F, 0x24AD,
+ 0xD950, 0xD950, 0x4B8B, 0xD951, 0xD951, 0x207B, 0xD952, 0xD952, 0x1F45,
+ 0xD953, 0xD953, 0x24AA, 0xD954, 0xD954, 0x204B, 0xD955, 0xD955, 0x202F,
+ 0xD956, 0xD956, 0x1F5A, 0xD957, 0xD957, 0x24B0, 0xD958, 0xD958, 0x4B8C,
+ 0xD959, 0xD959, 0x22B7, 0xD95A, 0xD95A, 0x1F7F, 0xD95B, 0xD95B, 0x4B8D,
+ 0xD95C, 0xD95C, 0x2265, 0xD95D, 0xD962, 0x4B8E, 0xD963, 0xD963, 0x24B2,
+ 0xD964, 0xD964, 0x211B, 0xD965, 0xD965, 0x1E51, 0xD966, 0xD966, 0x4B94,
+ 0xD967, 0xD967, 0x24B4, 0xD968, 0xD96B, 0x4B95, 0xD96C, 0xD96C, 0x24B3,
+ 0xD96D, 0xD96D, 0x4B99, 0xD96E, 0xD96E, 0x1E9F, 0xD96F, 0xD96F, 0x4B9A,
+ 0xD970, 0xD970, 0x2118, 0xD971, 0xD971, 0x4B9B, 0xD972, 0xD972, 0x20B4,
+ 0xD973, 0xD973, 0x23AF, 0xD974, 0xD974, 0x21BB, 0xD975, 0xD975, 0x2072,
+ 0xD976, 0xD976, 0x1F95, 0xD977, 0xD977, 0x4B9C, 0xD978, 0xD978, 0x1F0A,
+ 0xD979, 0xD979, 0x24B6, 0xD97A, 0xD97B, 0x4B9D, 0xD97C, 0xD97C, 0x2291,
+ 0xD97D, 0xD97D, 0x24B5, 0xD97E, 0xD97E, 0x2278, 0xD980, 0xD980, 0x1ED4,
+ 0xD981, 0xD986, 0x4B9F, 0xD987, 0xD987, 0x1FF3, 0xD988, 0xD98C, 0x4BA5,
+ 0xD98D, 0xD98D, 0x22A9, 0xD98E, 0xD98E, 0x24B7, 0xD98F, 0xD98F, 0x1F28,
+ 0xD990, 0xD990, 0x2109, 0xD991, 0xD991, 0x22C7, 0xD992, 0xD996, 0x4BAA,
+ 0xD997, 0xD997, 0x24AE, 0xD998, 0xD998, 0x22B1, 0xD999, 0xD99A, 0x4BAF,
+ 0xD99B, 0xD99B, 0x2266, 0xD99C, 0xD99C, 0x4BB1, 0xD99D, 0xD99D, 0x225B,
+ 0xD99E, 0xD99E, 0x22C4, 0xD99F, 0xD99F, 0x4BB2, 0xD9A0, 0xD9A0, 0x2115,
+ 0xD9A1, 0xD9FE, 0x12B5, 0xDA40, 0xDA40, 0x4BB3, 0xDA41, 0xDA41, 0x222A,
+ 0xDA42, 0xDA42, 0x24B1, 0xDA43, 0xDA47, 0x4BB4, 0xDA48, 0xDA48, 0x213D,
+ 0xDA49, 0xDA4C, 0x4BB9, 0xDA4D, 0xDA4D, 0x1F15, 0xDA4E, 0xDA4E, 0x225C,
+ 0xDA4F, 0xDA72, 0x4BBD, 0xDA73, 0xDA73, 0x1F14, 0xDA74, 0xDA76, 0x4BE1,
+ 0xDA77, 0xDA77, 0x227A, 0xDA78, 0xDA7E, 0x4BE4, 0xDA80, 0xDA84, 0x4BEB,
+ 0xDA85, 0xDA85, 0x20EE, 0xDA86, 0xDA8D, 0x4BF0, 0xDA8E, 0xDA8E, 0x25F8,
+ 0xDA8F, 0xDAA0, 0x4BF8, 0xDAA1, 0xDAFE, 0x1313, 0xDB40, 0xDB5F, 0x4C0A,
+ 0xDB60, 0xDB60, 0x1F94, 0xDB61, 0xDB77, 0x4C2A, 0xDB78, 0xDB78, 0x2230,
+ 0xDB79, 0xDB7E, 0x4C41, 0xDB80, 0xDB83, 0x4C47, 0xDB84, 0xDB84, 0x25FD,
+ 0xDB85, 0xDB8A, 0x4C4B, 0xDB8B, 0xDB8B, 0x2600, 0xDB8C, 0xDB97, 0x4C51,
+ 0xDB98, 0xDB98, 0x2606, 0xDB99, 0xDBA0, 0x4C5D, 0xDBA1, 0xDBFE, 0x1371,
+ 0xDC40, 0xDC44, 0x4C65, 0xDC45, 0xDC45, 0x25FF, 0xDC46, 0xDC4E, 0x4C6A,
+ 0xDC4F, 0xDC4F, 0x25FC, 0xDC50, 0xDC50, 0x1E8C, 0xDC51, 0xDC51, 0x2602,
+ 0xDC52, 0xDC52, 0x4C73, 0xDC53, 0xDC53, 0x224D, 0xDC54, 0xDC54, 0x4C74,
+ 0xDC55, 0xDC55, 0x2604, 0xDC56, 0xDC56, 0x25FE, 0xDC57, 0xDC57, 0x2603,
+ 0xDC58, 0xDC5C, 0x4C75, 0xDC5D, 0xDC5D, 0x2601, 0xDC5E, 0xDC61, 0x4C7A,
+ 0xDC62, 0xDC62, 0x2605, 0xDC63, 0xDC65, 0x4C7E, 0xDC66, 0xDC66, 0x1EA3,
+ 0xDC67, 0xDC67, 0x2608, 0xDC68, 0xDC6A, 0x4C81, 0xDC6B, 0xDC6B, 0x2607,
+ 0xDC6C, 0xDC7B, 0x4C84, 0xDC7C, 0xDC7C, 0x20F0, 0xDC7D, 0xDC7E, 0x4C94,
+ 0xDC80, 0xDC86, 0x4C96, 0xDC87, 0xDC87, 0x1E7B, 0xDC88, 0xDC88, 0x2267,
+ 0xDC89, 0xDC89, 0x1F36, 0xDC8A, 0xDC8A, 0x1FD6, 0xDC8B, 0xDC8D, 0x4C9D,
+ 0xDC8E, 0xDC8E, 0x21E0, 0xDC8F, 0xDC8F, 0x4CA0, 0xDC90, 0xDC90, 0x248C,
+ 0xDC91, 0xDC96, 0x4CA1, 0xDC97, 0xDC97, 0x248D, 0xDC98, 0xDC9A, 0x4CA7,
+ 0xDC9B, 0xDC9B, 0x2102, 0xDC9C, 0xDC9F, 0x4CAA, 0xDCA0, 0xDCA0, 0x2494,
+ 0xDCA1, 0xDCFE, 0x13CF, 0xDD40, 0xDD45, 0x4CAE, 0xDD46, 0xDD46, 0x2493,
+ 0xDD47, 0xDD4C, 0x4CB4, 0xDD4D, 0xDD4D, 0x248E, 0xDD4E, 0xDD52, 0x4CBA,
+ 0xDD53, 0xDD53, 0x2299, 0xDD54, 0xDD54, 0x2491, 0xDD55, 0xDD55, 0x2496,
+ 0xDD56, 0xDD56, 0x248F, 0xDD57, 0xDD57, 0x2492, 0xDD58, 0xDD58, 0x4CBF,
+ 0xDD59, 0xDD59, 0x2497, 0xDD5A, 0xDD5D, 0x4CC0, 0xDD5E, 0xDD5E, 0x1FB1,
+ 0xDD5F, 0xDD5F, 0x4CC4, 0xDD60, 0xDD60, 0x249A, 0xDD61, 0xDD61, 0x4CC5,
+ 0xDD62, 0xDD62, 0x2499, 0xDD63, 0xDD63, 0x4CC6, 0xDD64, 0xDD64, 0x2258,
+ 0xDD65, 0xDD65, 0x2498, 0xDD66, 0xDD6C, 0x4CC7, 0xDD6D, 0xDD6D, 0x249B,
+ 0xDD6E, 0xDD6E, 0x4CCE, 0xDD6F, 0xDD6F, 0x1F09, 0xDD70, 0xDD70, 0x20E6,
+ 0xDD71, 0xDD75, 0x4CCF, 0xDD76, 0xDD76, 0x2026, 0xDD77, 0xDD77, 0x249F,
+ 0xDD78, 0xDD78, 0x1F59, 0xDD79, 0xDD7A, 0x249D, 0xDD7B, 0xDD7E, 0x4CD4,
+ 0xDD80, 0xDD80, 0x4CD8, 0xDD81, 0xDD81, 0x1F3B, 0xDD82, 0xDD82, 0x249C,
+ 0xDD83, 0xDD84, 0x4CD9, 0xDD85, 0xDD85, 0x1E3A, 0xDD86, 0xDD86, 0x205B,
+ 0xDD87, 0xDD8A, 0x4CDB, 0xDD8B, 0xDD8B, 0x1F70, 0xDD8C, 0xDD8E, 0x4CDF,
+ 0xDD8F, 0xDD8F, 0x24A0, 0xDD90, 0xDD93, 0x4CE2, 0xDD94, 0xDD94, 0x213B,
+ 0xDD95, 0xDD96, 0x4CE6, 0xDD97, 0xDD97, 0x1F07, 0xDD98, 0xDD99, 0x4CE8,
+ 0xDD9A, 0xDD9A, 0x2270, 0xDD9B, 0xDD9B, 0x2237, 0xDD9C, 0xDD9D, 0x4CEA,
+ 0xDD9E, 0xDD9E, 0x24D2, 0xDD9F, 0xDD9F, 0x4CEC, 0xDDA0, 0xDDA0, 0x21B3,
+ 0xDDA1, 0xDDFE, 0x142D, 0xDE40, 0xDE40, 0x2245, 0xDE41, 0xDE41, 0x24A1,
+ 0xDE42, 0xDE43, 0x4CED, 0xDE44, 0xDE44, 0x22A8, 0xDE45, 0xDE47, 0x4CEF,
+ 0xDE48, 0xDE48, 0x227C, 0xDE49, 0xDE49, 0x1FB0, 0xDE4A, 0xDE4E, 0x4CF2,
+ 0xDE4F, 0xDE4F, 0x24A2, 0xDE50, 0xDE59, 0x4CF7, 0xDE5A, 0xDE5A, 0x1F46,
+ 0xDE5B, 0xDE5B, 0x4D01, 0xDE5C, 0xDE5C, 0x2380, 0xDE5D, 0xDE5D, 0x2495,
+ 0xDE5E, 0xDE5E, 0x4D02, 0xDE5F, 0xDE5F, 0x2490, 0xDE60, 0xDE6A, 0x4D03,
+ 0xDE6B, 0xDE6B, 0x1E30, 0xDE6C, 0xDE6E, 0x4D0E, 0xDE6F, 0xDE6F, 0x1E9D,
+ 0xDE70, 0xDE70, 0x1E4B, 0xDE71, 0xDE71, 0x1E4A, 0xDE72, 0xDE72, 0x20AA,
+ 0xDE73, 0xDE7E, 0x4D11, 0xDE80, 0xDE91, 0x4D1D, 0xDE92, 0xDE92, 0x267B,
+ 0xDE93, 0xDE9E, 0x4D2F, 0xDE9F, 0xDE9F, 0x23F2, 0xDEA0, 0xDEA0, 0x4D3B,
+ 0xDEA1, 0xDEFE, 0x148B, 0xDF40, 0xDF40, 0x227E, 0xDF41, 0xDF41, 0x4D3C,
+ 0xDF42, 0xDF42, 0x2019, 0xDF43, 0xDF4C, 0x4D3D, 0xDF4D, 0xDF4D, 0x1FBB,
+ 0xDF4E, 0xDF5B, 0x4D47, 0xDF5C, 0xDF5C, 0x2253, 0xDF5D, 0xDF5D, 0x4D55,
+ 0xDF5E, 0xDF5E, 0x1F3E, 0xDF5F, 0xDF5F, 0x1EA6, 0xDF60, 0xDF60, 0x218E,
+ 0xDF61, 0xDF63, 0x4D56, 0xDF64, 0xDF64, 0x21EC, 0xDF65, 0xDF65, 0x4D59,
+ 0xDF66, 0xDF66, 0x1EBE, 0xDF67, 0xDF67, 0x4D5A, 0xDF68, 0xDF68, 0x224A,
+ 0xDF69, 0xDF6C, 0x4D5B, 0xDF6D, 0xDF6D, 0x2133, 0xDF6E, 0xDF73, 0x4D5F,
+ 0xDF74, 0xDF74, 0x1E84, 0xDF75, 0xDF76, 0x4D65, 0xDF77, 0xDF77, 0x20CF,
+ 0xDF78, 0xDF78, 0x21E2, 0xDF79, 0xDF79, 0x4D67, 0xDF7A, 0xDF7A, 0x220F,
+ 0xDF7B, 0xDF7B, 0x4D68, 0xDF7C, 0xDF7C, 0x2029, 0xDF7D, 0xDF7D, 0x4D69,
+ 0xDF7E, 0xDF7E, 0x2073, 0xDF80, 0xDF80, 0x1F55, 0xDF81, 0xDF82, 0x4D6A,
+ 0xDF83, 0xDF83, 0x23F1, 0xDF84, 0xDF84, 0x4D6C, 0xDF85, 0xDF85, 0x1E46,
+ 0xDF86, 0xDF88, 0x4D6D, 0xDF89, 0xDF89, 0x2063, 0xDF8A, 0xDF8A, 0x23F3,
+ 0xDF8B, 0xDFA0, 0x4D70, 0xDFA1, 0xDFFE, 0x14E9, 0xE040, 0xE04F, 0x4D86,
+ 0xE050, 0xE050, 0x231E, 0xE051, 0xE05C, 0x4D96, 0xE05D, 0xE05D, 0x2233,
+ 0xE05E, 0xE068, 0x4DA2, 0xE069, 0xE069, 0x2320, 0xE06A, 0xE06B, 0x4DAD,
+ 0xE06C, 0xE06C, 0x21C7, 0xE06D, 0xE074, 0x4DAF, 0xE075, 0xE075, 0x22BC,
+ 0xE076, 0xE076, 0x4DB7, 0xE077, 0xE077, 0x231C, 0xE078, 0xE078, 0x4DB8,
+ 0xE079, 0xE079, 0x2251, 0xE07A, 0xE07E, 0x4DB9, 0xE080, 0xE086, 0x4DBE,
+ 0xE087, 0xE087, 0x1EBB, 0xE088, 0xE08C, 0x4DC5, 0xE08D, 0xE08D, 0x2287,
+ 0xE08E, 0xE08E, 0x4DCA, 0xE08F, 0xE08F, 0x202D, 0xE090, 0xE090, 0x1EAB,
+ 0xE091, 0xE091, 0x4DCB, 0xE092, 0xE092, 0x231D, 0xE093, 0xE093, 0x4DCC,
+ 0xE094, 0xE094, 0x231F, 0xE095, 0xE096, 0x4DCD, 0xE097, 0xE097, 0x231B,
+ 0xE098, 0xE0A0, 0x4DCF, 0xE0A1, 0xE0FE, 0x1547, 0xE140, 0xE141, 0x4DD8,
+ 0xE142, 0xE142, 0x2321, 0xE143, 0xE163, 0x4DDA, 0xE164, 0xE164, 0x2255,
+ 0xE165, 0xE167, 0x4DFB, 0xE168, 0xE168, 0x1E8F, 0xE169, 0xE173, 0x4DFE,
+ 0xE174, 0xE174, 0x220C, 0xE175, 0xE175, 0x1FA4, 0xE176, 0xE17E, 0x4E09,
+ 0xE180, 0xE183, 0x4E12, 0xE184, 0xE184, 0x209B, 0xE185, 0xE185, 0x21D8,
+ 0xE186, 0xE186, 0x4E16, 0xE187, 0xE187, 0x25FA, 0xE188, 0xE188, 0x4E17,
+ 0xE189, 0xE189, 0x25F9, 0xE18A, 0xE18B, 0x4E18, 0xE18C, 0xE18C, 0x2134,
+ 0xE18D, 0xE18D, 0x4E1A, 0xE18E, 0xE190, 0x24F3, 0xE191, 0xE191, 0x24F8,
+ 0xE192, 0xE192, 0x4E1B, 0xE193, 0xE193, 0x24F7, 0xE194, 0xE194, 0x1EC8,
+ 0xE195, 0xE195, 0x24F6, 0xE196, 0xE197, 0x4E1C, 0xE198, 0xE198, 0x2280,
+ 0xE199, 0xE19D, 0x4E1E, 0xE19E, 0xE19E, 0x1EC5, 0xE19F, 0xE19F, 0x24FB,
+ 0xE1A0, 0xE1A0, 0x4E23, 0xE1A1, 0xE1FE, 0x15A5, 0xE240, 0xE240, 0x4E24,
+ 0xE241, 0xE241, 0x24FA, 0xE242, 0xE242, 0x4E25, 0xE243, 0xE243, 0x1EED,
+ 0xE244, 0xE24E, 0x4E26, 0xE24F, 0xE24F, 0x24FD, 0xE250, 0xE250, 0x4E31,
+ 0xE251, 0xE251, 0x24F9, 0xE252, 0xE252, 0x4E32, 0xE253, 0xE253, 0x24FE,
+ 0xE254, 0xE254, 0x20CD, 0xE255, 0xE259, 0x4E33, 0xE25A, 0xE25A, 0x2508,
+ 0xE25B, 0xE25B, 0x2504, 0xE25C, 0xE25D, 0x4E38, 0xE25E, 0xE25E, 0x2506,
+ 0xE25F, 0xE261, 0x4E3A, 0xE262, 0xE262, 0x24FF, 0xE263, 0xE263, 0x2090,
+ 0xE264, 0xE266, 0x4E3D, 0xE267, 0xE267, 0x1EDD, 0xE268, 0xE268, 0x1F25,
+ 0xE269, 0xE269, 0x4E40, 0xE26A, 0xE26A, 0x2503, 0xE26B, 0xE26B, 0x2502,
+ 0xE26C, 0xE26D, 0x4E41, 0xE26E, 0xE26E, 0x1E7A, 0xE26F, 0xE26F, 0x20A6,
+ 0xE270, 0xE277, 0x4E43, 0xE278, 0xE278, 0x1FD5, 0xE279, 0xE27C, 0x4E4B,
+ 0xE27D, 0xE27D, 0x1F11, 0xE27E, 0xE27E, 0x4E4F, 0xE280, 0xE280, 0x2507,
+ 0xE281, 0xE281, 0x2500, 0xE282, 0xE282, 0x2505, 0xE283, 0xE288, 0x4E50,
+ 0xE289, 0xE289, 0x2519, 0xE28A, 0xE28A, 0x4E56, 0xE28B, 0xE28B, 0x2515,
+ 0xE28C, 0xE28D, 0x4E57, 0xE28E, 0xE28E, 0x250C, 0xE28F, 0xE28F, 0x2031,
+ 0xE290, 0xE291, 0x4E59, 0xE292, 0xE292, 0x250B, 0xE293, 0xE293, 0x250F,
+ 0xE294, 0xE294, 0x251A, 0xE295, 0xE295, 0x2509, 0xE296, 0xE297, 0x4E5B,
+ 0xE298, 0xE298, 0x250E, 0xE299, 0xE299, 0x2234, 0xE29A, 0xE29A, 0x2513,
+ 0xE29B, 0xE29B, 0x1F80, 0xE29C, 0xE29F, 0x4E5D, 0xE2A0, 0xE2A0, 0x2501,
+ 0xE2A1, 0xE2FE, 0x1603, 0xE340, 0xE341, 0x4E61, 0xE342, 0xE342, 0x2517,
+ 0xE343, 0xE343, 0x2516, 0xE344, 0xE346, 0x4E63, 0xE347, 0xE347, 0x2518,
+ 0xE348, 0xE34A, 0x4E66, 0xE34B, 0xE34B, 0x1E56, 0xE34C, 0xE34E, 0x4E69,
+ 0xE34F, 0xE34F, 0x250D, 0xE350, 0xE350, 0x4E6C, 0xE351, 0xE351, 0x20D3,
+ 0xE352, 0xE353, 0x4E6D, 0xE354, 0xE354, 0x207A, 0xE355, 0xE355, 0x20CE,
+ 0xE356, 0xE357, 0x4E6F, 0xE358, 0xE358, 0x2510, 0xE359, 0xE35B, 0x4E71,
+ 0xE35C, 0xE35C, 0x1E55, 0xE35D, 0xE35F, 0x4E74, 0xE360, 0xE360, 0x250A,
+ 0xE361, 0xE365, 0x4E77, 0xE366, 0xE367, 0x2511, 0xE368, 0xE370, 0x4E7C,
+ 0xE371, 0xE371, 0x1FAA, 0xE372, 0xE372, 0x4E85, 0xE373, 0xE373, 0x251E,
+ 0xE374, 0xE374, 0x1F1F, 0xE375, 0xE377, 0x4E86, 0xE378, 0xE378, 0x252D,
+ 0xE379, 0xE379, 0x221D, 0xE37A, 0xE37B, 0x4E89, 0xE37C, 0xE37C, 0x2532,
+ 0xE37D, 0xE37D, 0x4E8B, 0xE37E, 0xE37E, 0x217B, 0xE380, 0xE389, 0x4E8C,
+ 0xE38A, 0xE38A, 0x21AF, 0xE38B, 0xE38B, 0x4E96, 0xE38C, 0xE38C, 0x252C,
+ 0xE38D, 0xE38E, 0x4E97, 0xE38F, 0xE38F, 0x2528, 0xE390, 0xE390, 0x4E99,
+ 0xE391, 0xE391, 0x208C, 0xE392, 0xE392, 0x4E9A, 0xE393, 0xE393, 0x252F,
+ 0xE394, 0xE394, 0x4E9B, 0xE395, 0xE395, 0x21BC, 0xE396, 0xE398, 0x4E9C,
+ 0xE399, 0xE399, 0x251D, 0xE39A, 0xE39B, 0x4E9F, 0xE39C, 0xE39C, 0x2535,
+ 0xE39D, 0xE39D, 0x4EA1, 0xE39E, 0xE39E, 0x220D, 0xE39F, 0xE39F, 0x2526,
+ 0xE3A0, 0xE3A0, 0x4EA2, 0xE3A1, 0xE3FE, 0x1661, 0xE440, 0xE440, 0x2534,
+ 0xE441, 0xE441, 0x252A, 0xE442, 0xE442, 0x251F, 0xE443, 0xE443, 0x2531,
+ 0xE444, 0xE444, 0x251C, 0xE445, 0xE447, 0x4EA3, 0xE448, 0xE448, 0x2525,
+ 0xE449, 0xE44D, 0x4EA6, 0xE44E, 0xE44E, 0x21CD, 0xE44F, 0xE44F, 0x4EAB,
+ 0xE450, 0xE450, 0x21DA, 0xE451, 0xE451, 0x4EAC, 0xE452, 0xE452, 0x2172,
+ 0xE453, 0xE453, 0x253E, 0xE454, 0xE457, 0x4EAD, 0xE458, 0xE458, 0x204F,
+ 0xE459, 0xE459, 0x4EB1, 0xE45A, 0xE45A, 0x2543, 0xE45B, 0xE45B, 0x4EB2,
+ 0xE45C, 0xE45C, 0x21D7, 0xE45D, 0xE45D, 0x4EB3, 0xE45E, 0xE45E, 0x1E3C,
+ 0xE45F, 0xE461, 0x4EB4, 0xE462, 0xE462, 0x2529, 0xE463, 0xE464, 0x4EB7,
+ 0xE465, 0xE465, 0x2521, 0xE466, 0xE467, 0x4EB9, 0xE468, 0xE468, 0x1EFF,
+ 0xE469, 0xE472, 0x4EBB, 0xE473, 0xE473, 0x253F, 0xE474, 0xE474, 0x4EC5,
+ 0xE475, 0xE475, 0x2544, 0xE476, 0xE478, 0x4EC6, 0xE479, 0xE479, 0x2523,
+ 0xE47A, 0xE47A, 0x1E90, 0xE47B, 0xE47B, 0x253A, 0xE47C, 0xE47C, 0x2545,
+ 0xE47D, 0xE47D, 0x4EC9, 0xE47E, 0xE47E, 0x253D, 0xE480, 0xE480, 0x4ECA,
+ 0xE481, 0xE481, 0x20C1, 0xE482, 0xE483, 0x4ECB, 0xE484, 0xE484, 0x2103,
+ 0xE485, 0xE485, 0x2520, 0xE486, 0xE486, 0x253C, 0xE487, 0xE487, 0x253B,
+ 0xE488, 0xE488, 0x2538, 0xE489, 0xE48C, 0x4ECD, 0xE48D, 0xE48D, 0x2540,
+ 0xE48E, 0xE48E, 0x4ED1, 0xE48F, 0xE48F, 0x1FCD, 0xE490, 0xE492, 0x4ED2,
+ 0xE493, 0xE493, 0x1F18, 0xE494, 0xE497, 0x4ED5, 0xE498, 0xE498, 0x254B,
+ 0xE499, 0xE49C, 0x4ED9, 0xE49D, 0xE49D, 0x2547, 0xE49E, 0xE49F, 0x254F,
+ 0xE4A0, 0xE4A0, 0x4EDD, 0xE4A1, 0xE4FE, 0x16BF, 0xE540, 0xE545, 0x4EDE,
+ 0xE546, 0xE546, 0x22B0, 0xE547, 0xE547, 0x4EE4, 0xE548, 0xE548, 0x2546,
+ 0xE549, 0xE54A, 0x4EE5, 0xE54B, 0xE54B, 0x254C, 0xE54C, 0xE54D, 0x4EE7,
+ 0xE54E, 0xE54E, 0x1E9A, 0xE54F, 0xE54F, 0x2552, 0xE550, 0xE550, 0x2530,
+ 0xE551, 0xE551, 0x2549, 0xE552, 0xE554, 0x4EE9, 0xE555, 0xE555, 0x2551,
+ 0xE556, 0xE556, 0x1ECA, 0xE557, 0xE557, 0x4EEC, 0xE558, 0xE558, 0x20D2,
+ 0xE559, 0xE55B, 0x4EED, 0xE55C, 0xE55C, 0x1FB8, 0xE55D, 0xE55D, 0x4EF0,
+ 0xE55E, 0xE55E, 0x2079, 0xE55F, 0xE560, 0x4EF1, 0xE561, 0xE561, 0x21AB,
+ 0xE562, 0xE563, 0x4EF3, 0xE564, 0xE564, 0x254D, 0xE565, 0xE565, 0x1EA5,
+ 0xE566, 0xE567, 0x4EF5, 0xE568, 0xE568, 0x204C, 0xE569, 0xE569, 0x2080,
+ 0xE56A, 0xE56B, 0x4EF7, 0xE56C, 0xE56C, 0x266D, 0xE56D, 0xE56D, 0x4EF9,
+ 0xE56E, 0xE56E, 0x2537, 0xE56F, 0xE574, 0x4EFA, 0xE575, 0xE575, 0x254A,
+ 0xE576, 0xE576, 0x21B8, 0xE577, 0xE577, 0x4F00, 0xE578, 0xE578, 0x254E,
+ 0xE579, 0xE57A, 0x4F01, 0xE57B, 0xE57B, 0x24FC, 0xE57C, 0xE57C, 0x2554,
+ 0xE57D, 0xE57E, 0x4F03, 0xE580, 0xE580, 0x4F05, 0xE581, 0xE581, 0x1F3C,
+ 0xE582, 0xE582, 0x4F06, 0xE583, 0xE583, 0x1ED5, 0xE584, 0xE589, 0x4F07,
+ 0xE58A, 0xE58A, 0x2556, 0xE58B, 0xE58D, 0x4F0D, 0xE58E, 0xE58E, 0x2268,
+ 0xE58F, 0xE590, 0x4F10, 0xE591, 0xE591, 0x1ED6, 0xE592, 0xE599, 0x4F12,
+ 0xE59A, 0xE59A, 0x2557, 0xE59B, 0xE59B, 0x2553, 0xE59C, 0xE59E, 0x4F1A,
+ 0xE59F, 0xE59F, 0x2548, 0xE5A0, 0xE5A0, 0x4F1D, 0xE5A1, 0xE5FE, 0x171D,
+ 0xE640, 0xE640, 0x20DC, 0xE641, 0xE643, 0x4F1E, 0xE644, 0xE644, 0x2559,
+ 0xE645, 0xE648, 0x4F21, 0xE649, 0xE649, 0x1F97, 0xE64A, 0xE64A, 0x2555,
+ 0xE64B, 0xE64D, 0x4F25, 0xE64E, 0xE64E, 0x227D, 0xE64F, 0xE651, 0x4F28,
+ 0xE652, 0xE652, 0x257E, 0xE653, 0xE655, 0x4F2B, 0xE656, 0xE656, 0x207C,
+ 0xE657, 0xE657, 0x4F2E, 0xE658, 0xE658, 0x255A, 0xE659, 0xE65A, 0x4F2F,
+ 0xE65B, 0xE65B, 0x255E, 0xE65C, 0xE65D, 0x4F31, 0xE65E, 0xE65E, 0x1E34,
+ 0xE65F, 0xE668, 0x4F33, 0xE669, 0xE669, 0x215E, 0xE66A, 0xE66A, 0x4F3D,
+ 0xE66B, 0xE66B, 0x2560, 0xE66C, 0xE674, 0x4F3E, 0xE675, 0xE675, 0x21A2,
+ 0xE676, 0xE676, 0x2354, 0xE677, 0xE678, 0x4F47, 0xE679, 0xE679, 0x2563,
+ 0xE67A, 0xE67A, 0x2527, 0xE67B, 0xE67B, 0x4F49, 0xE67C, 0xE67C, 0x252E,
+ 0xE67D, 0xE67D, 0x2558, 0xE67E, 0xE67E, 0x4F4A, 0xE680, 0xE680, 0x1F1B,
+ 0xE681, 0xE681, 0x4F4B, 0xE682, 0xE682, 0x2283, 0xE683, 0xE683, 0x4F4C,
+ 0xE684, 0xE684, 0x2564, 0xE685, 0xE686, 0x4F4D, 0xE687, 0xE687, 0x20A0,
+ 0xE688, 0xE688, 0x4F4F, 0xE689, 0xE689, 0x2565, 0xE68A, 0xE68B, 0x4F50,
+ 0xE68C, 0xE68C, 0x2561, 0xE68D, 0xE692, 0x4F52, 0xE693, 0xE693, 0x2562,
+ 0xE694, 0xE696, 0x4F58, 0xE697, 0xE697, 0x256C, 0xE698, 0xE69A, 0x4F5B,
+ 0xE69B, 0xE69B, 0x256D, 0xE69C, 0xE69C, 0x2020, 0xE69D, 0xE69E, 0x4F5E,
+ 0xE69F, 0xE69F, 0x255F, 0xE6A0, 0xE6A0, 0x256A, 0xE6A1, 0xE6FE, 0x177B,
+ 0xE740, 0xE742, 0x4F60, 0xE743, 0xE743, 0x256E, 0xE744, 0xE747, 0x4F63,
+ 0xE748, 0xE748, 0x2539, 0xE749, 0xE749, 0x255C, 0xE74A, 0xE74C, 0x4F67,
+ 0xE74D, 0xE74E, 0x2568, 0xE74F, 0xE74F, 0x256B, 0xE750, 0xE750, 0x1E6F,
+ 0xE751, 0xE751, 0x4F6A, 0xE752, 0xE752, 0x1FC4, 0xE753, 0xE753, 0x2567,
+ 0xE754, 0xE754, 0x4F6B, 0xE755, 0xE755, 0x255B, 0xE756, 0xE758, 0x4F6C,
+ 0xE759, 0xE759, 0x261D, 0xE75A, 0xE765, 0x4F6F, 0xE766, 0xE766, 0x252B,
+ 0xE767, 0xE767, 0x4F7B, 0xE768, 0xE768, 0x2571, 0xE769, 0xE769, 0x4F7C,
+ 0xE76A, 0xE76A, 0x2577, 0xE76B, 0xE773, 0x4F7D, 0xE774, 0xE774, 0x2522,
+ 0xE775, 0xE77B, 0x4F86, 0xE77C, 0xE77C, 0x2533, 0xE77D, 0xE77E, 0x4F8D,
+ 0xE780, 0xE781, 0x4F8F, 0xE782, 0xE782, 0x202A, 0xE783, 0xE783, 0x4F91,
+ 0xE784, 0xE784, 0x2536, 0xE785, 0xE785, 0x2573, 0xE786, 0xE786, 0x256F,
+ 0xE787, 0xE789, 0x4F92, 0xE78A, 0xE78A, 0x2293, 0xE78B, 0xE78B, 0x2578,
+ 0xE78C, 0xE78E, 0x4F95, 0xE78F, 0xE78F, 0x2570, 0xE790, 0xE791, 0x4F98,
+ 0xE792, 0xE792, 0x2575, 0xE793, 0xE797, 0x4F9A, 0xE798, 0xE799, 0x2541,
+ 0xE79A, 0xE79A, 0x255D, 0xE79B, 0xE79F, 0x4F9F, 0xE7A0, 0xE7A0, 0x201A,
+ 0xE7A1, 0xE7FE, 0x17D9, 0xE840, 0xE842, 0x4FA4, 0xE843, 0xE843, 0x257A,
+ 0xE844, 0xE844, 0x2006, 0xE845, 0xE845, 0x4FA7, 0xE846, 0xE846, 0x2177,
+ 0xE847, 0xE848, 0x4FA8, 0xE849, 0xE849, 0x251B, 0xE84A, 0xE84A, 0x4FAA,
+ 0xE84B, 0xE84B, 0x2524, 0xE84C, 0xE84E, 0x4FAB, 0xE84F, 0xE84F, 0x257B,
+ 0xE850, 0xE853, 0x4FAE, 0xE854, 0xE854, 0x22A3, 0xE855, 0xE859, 0x4FB2,
+ 0xE85A, 0xE85A, 0x2579, 0xE85B, 0xE85B, 0x4FB7, 0xE85C, 0xE85C, 0x2566,
+ 0xE85D, 0xE861, 0x4FB8, 0xE862, 0xE862, 0x1F93, 0xE863, 0xE863, 0x4FBD,
+ 0xE864, 0xE864, 0x257C, 0xE865, 0xE86F, 0x4FBE, 0xE870, 0xE870, 0x2514,
+ 0xE871, 0xE872, 0x4FC9, 0xE873, 0xE873, 0x257D, 0xE874, 0xE874, 0x4FCB,
+ 0xE875, 0xE875, 0x2572, 0xE876, 0xE87B, 0x4FCC, 0xE87C, 0xE87C, 0x2574,
+ 0xE87D, 0xE87E, 0x4FD2, 0xE880, 0xE880, 0x224E, 0xE881, 0xE881, 0x4FD4,
+ 0xE882, 0xE882, 0x21C6, 0xE883, 0xE886, 0x4FD5, 0xE887, 0xE887, 0x209F,
+ 0xE888, 0xE888, 0x4FD9, 0xE889, 0xE889, 0x2576, 0xE88A, 0xE88B, 0x4FDA,
+ 0xE88C, 0xE88C, 0x2064, 0xE88D, 0xE88D, 0x22BF, 0xE88E, 0xE88E, 0x261C,
+ 0xE88F, 0xE88F, 0x225E, 0xE890, 0xE8A0, 0x4FDC, 0xE8A1, 0xE8FE, 0x1837,
+ 0xE940, 0xE94B, 0x4FED, 0xE94C, 0xE94C, 0x1E75, 0xE94D, 0xE953, 0x4FF9,
+ 0xE954, 0xE954, 0x207D, 0xE955, 0xE955, 0x5000, 0xE956, 0xE956, 0x23BF,
+ 0xE957, 0xE957, 0x2113, 0xE958, 0xE959, 0x5001, 0xE95A, 0xE95A, 0x23C0,
+ 0xE95B, 0xE95C, 0x5003, 0xE95D, 0xE95D, 0x1E45, 0xE95E, 0xE95E, 0x5005,
+ 0xE95F, 0xE95F, 0x1FD8, 0xE960, 0xE960, 0x23C4, 0xE961, 0xE961, 0x5006,
+ 0xE962, 0xE962, 0x23C2, 0xE963, 0xE963, 0x2104, 0xE964, 0xE964, 0x5007,
+ 0xE965, 0xE965, 0x21BD, 0xE966, 0xE966, 0x5008, 0xE967, 0xE967, 0x1F87,
+ 0xE968, 0xE968, 0x23C3, 0xE969, 0xE96B, 0x5009, 0xE96C, 0xE96C, 0x2269,
+ 0xE96D, 0xE974, 0x500C, 0xE975, 0xE975, 0x1F43, 0xE976, 0xE976, 0x5014,
+ 0xE977, 0xE977, 0x1F1E, 0xE978, 0xE978, 0x2679, 0xE979, 0xE979, 0x1EEB,
+ 0xE97A, 0xE97B, 0x5015, 0xE97C, 0xE97C, 0x1F35, 0xE97D, 0xE97D, 0x208A,
+ 0xE97E, 0xE97E, 0x5017, 0xE980, 0xE980, 0x23C7, 0xE981, 0xE981, 0x23C9,
+ 0xE982, 0xE982, 0x23C6, 0xE983, 0xE986, 0x5018, 0xE987, 0xE987, 0x224F,
+ 0xE988, 0xE98A, 0x501C, 0xE98B, 0xE98B, 0x23CB, 0xE98C, 0xE98D, 0x501F,
+ 0xE98E, 0xE98E, 0x21F3, 0xE98F, 0xE98F, 0x5021, 0xE990, 0xE990, 0x21F7,
+ 0xE991, 0xE991, 0x23CF, 0xE992, 0xE992, 0x23CE, 0xE993, 0xE993, 0x23CA,
+ 0xE994, 0xE994, 0x23CD, 0xE995, 0xE997, 0x5022, 0xE998, 0xE998, 0x23D0,
+ 0xE999, 0xE99A, 0x5025, 0xE99B, 0xE99B, 0x266C, 0xE99C, 0xE99C, 0x5027,
+ 0xE99D, 0xE99D, 0x23C1, 0xE99E, 0xE99E, 0x5028, 0xE99F, 0xE99F, 0x1FEE,
+ 0xE9A0, 0xE9A0, 0x23D1, 0xE9A1, 0xE9FE, 0x1895, 0xEA40, 0xEA40, 0x1FF8,
+ 0xEA41, 0xEA43, 0x5029, 0xEA44, 0xEA44, 0x23D3, 0xEA45, 0xEA47, 0x502C,
+ 0xEA48, 0xEA48, 0x23D2, 0xEA49, 0xEA49, 0x23D4, 0xEA4A, 0xEA4A, 0x1E98,
+ 0xEA4B, 0xEA4F, 0x502F, 0xEA50, 0xEA50, 0x1F2C, 0xEA51, 0xEA51, 0x5034,
+ 0xEA52, 0xEA52, 0x23D5, 0xEA53, 0xEA54, 0x5035, 0xEA55, 0xEA55, 0x1E71,
+ 0xEA56, 0xEA56, 0x2691, 0xEA57, 0xEA58, 0x5037, 0xEA59, 0xEA59, 0x23C5,
+ 0xEA5A, 0xEA7E, 0x5039, 0xEA80, 0xEA80, 0x231A, 0xEA81, 0xEA83, 0x505E,
+ 0xEA84, 0xEA84, 0x2114, 0xEA85, 0xEA86, 0x5061, 0xEA87, 0xEA87, 0x2284,
+ 0xEA88, 0xEA8D, 0x5063, 0xEA8E, 0xEA8E, 0x221C, 0xEA8F, 0xEA8F, 0x5069,
+ 0xEA90, 0xEA90, 0x1E7E, 0xEA91, 0xEA91, 0x204D, 0xEA92, 0xEA95, 0x506A,
+ 0xEA96, 0xEA96, 0x2201, 0xEA97, 0xEA9F, 0x506E, 0xEAA0, 0xEAA0, 0x1ED9,
+ 0xEAA1, 0xEAFE, 0x18F3, 0xEB40, 0xEB40, 0x5077, 0xEB41, 0xEB41, 0x1FB2,
+ 0xEB42, 0xEB44, 0x5078, 0xEB45, 0xEB45, 0x2252, 0xEB46, 0xEB47, 0x507B,
+ 0xEB48, 0xEB48, 0x1F79, 0xEB49, 0xEB52, 0x507D, 0xEB53, 0xEB53, 0x2157,
+ 0xEB54, 0xEB54, 0x5087, 0xEB55, 0xEB55, 0x21BF, 0xEB56, 0xEB5A, 0x5088,
+ 0xEB5B, 0xEB5B, 0x221F, 0xEB5C, 0xEB5C, 0x508D, 0xEB5D, 0xEB5D, 0x203D,
+ 0xEB5E, 0xEB5F, 0x508E, 0xEB60, 0xEB60, 0x2015, 0xEB61, 0xEB61, 0x5090,
+ 0xEB62, 0xEB62, 0x26A5, 0xEB63, 0xEB6C, 0x5091, 0xEB6D, 0xEB6D, 0x2156,
+ 0xEB6E, 0xEB6F, 0x509B, 0xEB70, 0xEB70, 0x2144, 0xEB71, 0xEB71, 0x509D,
+ 0xEB72, 0xEB72, 0x1E91, 0xEB73, 0xEB73, 0x2257, 0xEB74, 0xEB77, 0x509E,
+ 0xEB78, 0xEB78, 0x200A, 0xEB79, 0xEB79, 0x2092, 0xEB7A, 0xEB7E, 0x50A2,
+ 0xEB80, 0xEB84, 0x50A7, 0xEB85, 0xEB85, 0x2250, 0xEB86, 0xEB89, 0x50AC,
+ 0xEB8A, 0xEB8A, 0x1EC3, 0xEB8B, 0xEBA0, 0x50B0, 0xEBA1, 0xEBFE, 0x1951,
+ 0xEC40, 0xEC45, 0x50C6, 0xEC46, 0xEC46, 0x21A8, 0xEC47, 0xEC55, 0x50CC,
+ 0xEC56, 0xEC56, 0x260D, 0xEC57, 0xEC59, 0x50DB, 0xEC5A, 0xEC5A, 0x260C,
+ 0xEC5B, 0xEC5B, 0x50DE, 0xEC5C, 0xEC5C, 0x260E, 0xEC5D, 0xEC5F, 0x50DF,
+ 0xEC60, 0xEC60, 0x2032, 0xEC61, 0xEC6D, 0x50E2, 0xEC6E, 0xEC6E, 0x260B,
+ 0xEC6F, 0xEC75, 0x50EF, 0xEC76, 0xEC76, 0x22C3, 0xEC77, 0xEC7E, 0x50F6,
+ 0xEC80, 0xEC95, 0x50FE, 0xEC96, 0xEC96, 0x1F23, 0xEC97, 0xECA0, 0x5114,
+ 0xECA1, 0xECFE, 0x19AF, 0xED40, 0xED45, 0x511E, 0xED46, 0xED46, 0x2695,
+ 0xED47, 0xED57, 0x5124, 0xED58, 0xED58, 0x265E, 0xED59, 0xED5D, 0x5135,
+ 0xED5E, 0xED5E, 0x265D, 0xED5F, 0xED60, 0x513A, 0xED61, 0xED61, 0x2692,
+ 0xED62, 0xED63, 0x513C, 0xED64, 0xED64, 0x265F, 0xED65, 0xED65, 0x513E,
+ 0xED66, 0xED66, 0x218D, 0xED67, 0xED67, 0x20FD, 0xED68, 0xED6D, 0x513F,
+ 0xED6E, 0xED6E, 0x1F40, 0xED6F, 0xED73, 0x5145, 0xED74, 0xED74, 0x2465,
+ 0xED75, 0xED76, 0x514A, 0xED77, 0xED77, 0x2467, 0xED78, 0xED78, 0x514C,
+ 0xED79, 0xED79, 0x2466, 0xED7A, 0xED7E, 0x514D, 0xED80, 0xED90, 0x5152,
+ 0xED91, 0xED91, 0x21C9, 0xED92, 0xED92, 0x5163, 0xED93, 0xED93, 0x2209,
+ 0xED94, 0xED94, 0x1EC9, 0xED95, 0xED95, 0x20E9, 0xED96, 0xED96, 0x5164,
+ 0xED97, 0xED97, 0x21CA, 0xED98, 0xED98, 0x2146, 0xED99, 0xED99, 0x25C5,
+ 0xED9A, 0xED9A, 0x21DC, 0xED9B, 0xED9B, 0x5165, 0xED9C, 0xED9C, 0x245E,
+ 0xED9D, 0xED9D, 0x5166, 0xED9E, 0xED9E, 0x214F, 0xED9F, 0xED9F, 0x5167,
+ 0xEDA0, 0xEDA0, 0x25C6, 0xEDA1, 0xEDFE, 0x1A0D, 0xEE40, 0xEE40, 0x25C7,
+ 0xEE41, 0xEE41, 0x2241, 0xEE42, 0xEE42, 0x218A, 0xEE43, 0xEE43, 0x1E2F,
+ 0xEE44, 0xEE44, 0x1EDC, 0xEE45, 0xEE47, 0x5168, 0xEE48, 0xEE48, 0x20BF,
+ 0xEE49, 0xEE49, 0x2034, 0xEE4A, 0xEE4C, 0x516B, 0xEE4D, 0xEE4D, 0x25C9,
+ 0xEE4E, 0xEE51, 0x516E, 0xEE52, 0xEE52, 0x25C8, 0xEE53, 0xEE54, 0x5172,
+ 0xEE55, 0xEE55, 0x220E, 0xEE56, 0xEE56, 0x5174, 0xEE57, 0xEE57, 0x25CB,
+ 0xEE58, 0xEE5D, 0x5175, 0xEE5E, 0xEE5E, 0x217D, 0xEE5F, 0xEE60, 0x517B,
+ 0xEE61, 0xEE61, 0x1F7E, 0xEE62, 0xEE67, 0x517D, 0xEE68, 0xEE68, 0x25CC,
+ 0xEE69, 0xEE69, 0x1FC3, 0xEE6A, 0xEE6B, 0x5183, 0xEE6C, 0xEE6C, 0x20B9,
+ 0xEE6D, 0xEE6D, 0x5185, 0xEE6E, 0xEE6E, 0x2181, 0xEE6F, 0xEE76, 0x5186,
+ 0xEE77, 0xEE77, 0x1FDA, 0xEE78, 0xEE7C, 0x518E, 0xEE7D, 0xEE7D, 0x2173,
+ 0xEE7E, 0xEE7E, 0x1EE1, 0xEE80, 0xEE80, 0x25CD, 0xEE81, 0xEE84, 0x5193,
+ 0xEE85, 0xEE85, 0x25CE, 0xEE86, 0xEE86, 0x21F6, 0xEE87, 0xEE89, 0x5197,
+ 0xEE8A, 0xEE8A, 0x224B, 0xEE8B, 0xEE8B, 0x25D1, 0xEE8C, 0xEE8C, 0x519A,
+ 0xEE8D, 0xEE8D, 0x1EC0, 0xEE8E, 0xEE8F, 0x519B, 0xEE90, 0xEE90, 0x2008,
+ 0xEE91, 0xEE93, 0x519D, 0xEE94, 0xEE94, 0x25D0, 0xEE95, 0xEE96, 0x51A0,
+ 0xEE97, 0xEE97, 0x25D2, 0xEE98, 0xEE98, 0x51A2, 0xEE99, 0xEE99, 0x1F2A,
+ 0xEE9A, 0xEE9C, 0x51A3, 0xEE9D, 0xEE9D, 0x1E72, 0xEE9E, 0xEE9E, 0x25D3,
+ 0xEE9F, 0xEEA0, 0x51A6, 0xEEA1, 0xEEFE, 0x1A6B, 0xEF40, 0xEF40, 0x21BE,
+ 0xEF41, 0xEF41, 0x25D4, 0xEF42, 0xEF42, 0x2044, 0xEF43, 0xEF43, 0x51A8,
+ 0xEF44, 0xEF44, 0x25CF, 0xEF45, 0xEF45, 0x20F3, 0xEF46, 0xEF4B, 0x51A9,
+ 0xEF4C, 0xEF4C, 0x1F00, 0xEF4D, 0xEF51, 0x51AF, 0xEF52, 0xEF53, 0x24CC,
+ 0xEF54, 0xEF54, 0x51B4, 0xEF55, 0xEF55, 0x2698, 0xEF56, 0xEF56, 0x51B5,
+ 0xEF57, 0xEF57, 0x2678, 0xEF58, 0xEF59, 0x51B6, 0xEF5A, 0xEF5A, 0x24CE,
+ 0xEF5B, 0xEF5F, 0x51B8, 0xEF60, 0xEF60, 0x24CF, 0xEF61, 0xEF67, 0x51BD,
+ 0xEF68, 0xEF68, 0x20B8, 0xEF69, 0xEF69, 0x51C4, 0xEF6A, 0xEF6A, 0x24D0,
+ 0xEF6B, 0xEF6B, 0x51C5, 0xEF6C, 0xEF6C, 0x24D1, 0xEF6D, 0xEF76, 0x51C6,
+ 0xEF77, 0xEF77, 0x1EF4, 0xEF78, 0xEF79, 0x51D0, 0xEF7A, 0xEF7A, 0x239B,
+ 0xEF7B, 0xEF7B, 0x51D2, 0xEF7C, 0xEF7C, 0x267E, 0xEF7D, 0xEF7E, 0x51D3,
+ 0xEF80, 0xEF81, 0x51D5, 0xEF82, 0xEF82, 0x239D, 0xEF83, 0xEF84, 0x239F,
+ 0xEF85, 0xEF85, 0x51D7, 0xEF86, 0xEF86, 0x23A1, 0xEF87, 0xEF87, 0x51D8,
+ 0xEF88, 0xEF88, 0x1EF1, 0xEF89, 0xEF8A, 0x51D9, 0xEF8B, 0xEF8B, 0x221E,
+ 0xEF8C, 0xEF8C, 0x51DB, 0xEF8D, 0xEF8D, 0x23A2, 0xEF8E, 0xEF94, 0x51DC,
+ 0xEF95, 0xEF95, 0x214B, 0xEF96, 0xEF96, 0x1E36, 0xEF97, 0xEF97, 0x2135,
+ 0xEF98, 0xEF9B, 0x51E3, 0xEF9C, 0xEF9C, 0x1FAD, 0xEF9D, 0xEF9D, 0x51E7,
+ 0xEF9E, 0xEF9E, 0x1E53, 0xEF9F, 0xEFA0, 0x51E8, 0xEFA1, 0xEFFE, 0x1AC9,
+ 0xF040, 0xF040, 0x51EA, 0xF041, 0xF041, 0x23A3, 0xF042, 0xF042, 0x2203,
+ 0xF043, 0xF043, 0x51EB, 0xF044, 0xF044, 0x1EE7, 0xF045, 0xF046, 0x51EC,
+ 0xF047, 0xF047, 0x23A4, 0xF048, 0xF048, 0x2097, 0xF049, 0xF049, 0x1EE4,
+ 0xF04A, 0xF04D, 0x51EE, 0xF04E, 0xF04E, 0x2238, 0xF04F, 0xF050, 0x51F2,
+ 0xF051, 0xF051, 0x23A5, 0xF052, 0xF053, 0x51F4, 0xF054, 0xF054, 0x1F9A,
+ 0xF055, 0xF056, 0x51F6, 0xF057, 0xF057, 0x21C3, 0xF058, 0xF05D, 0x51F8,
+ 0xF05E, 0xF05E, 0x1F2E, 0xF05F, 0xF067, 0x51FE, 0xF068, 0xF068, 0x239C,
+ 0xF069, 0xF06B, 0x5207, 0xF06C, 0xF06C, 0x23A6, 0xF06D, 0xF070, 0x520A,
+ 0xF071, 0xF071, 0x239E, 0xF072, 0xF072, 0x520E, 0xF073, 0xF073, 0x2035,
+ 0xF074, 0xF074, 0x23A7, 0xF075, 0xF077, 0x520F, 0xF078, 0xF078, 0x23A8,
+ 0xF079, 0xF079, 0x5212, 0xF07A, 0xF07A, 0x2075, 0xF07B, 0xF07C, 0x5213,
+ 0xF07D, 0xF07E, 0x23A9, 0xF080, 0xF080, 0x23AB, 0xF081, 0xF081, 0x1FEB,
+ 0xF082, 0xF082, 0x23AC, 0xF083, 0xF086, 0x5215, 0xF087, 0xF087, 0x1F6A,
+ 0xF088, 0xF088, 0x20F9, 0xF089, 0xF08A, 0x5219, 0xF08B, 0xF08B, 0x2666,
+ 0xF08C, 0xF08F, 0x521B, 0xF090, 0xF090, 0x2667, 0xF091, 0xF091, 0x521F,
+ 0xF092, 0xF092, 0x1E6C, 0xF093, 0xF095, 0x5220, 0xF096, 0xF096, 0x23AD,
+ 0xF097, 0xF0A0, 0x5223, 0xF0A1, 0xF0FE, 0x1B27, 0xF140, 0xF151, 0x522D,
+ 0xF152, 0xF152, 0x206D, 0xF153, 0xF153, 0x2242, 0xF154, 0xF154, 0x1F02,
+ 0xF155, 0xF156, 0x523F, 0xF157, 0xF157, 0x2183, 0xF158, 0xF158, 0x5241,
+ 0xF159, 0xF159, 0x1E85, 0xF15A, 0xF15A, 0x21E9, 0xF15B, 0xF166, 0x5242,
+ 0xF167, 0xF167, 0x1E57, 0xF168, 0xF175, 0x524E, 0xF176, 0xF176, 0x22A5,
+ 0xF177, 0xF177, 0x2407, 0xF178, 0xF178, 0x1FCA, 0xF179, 0xF179, 0x525C,
+ 0xF17A, 0xF17A, 0x2402, 0xF17B, 0xF17B, 0x1F82, 0xF17C, 0xF17D, 0x525D,
+ 0xF17E, 0xF17E, 0x2408, 0xF180, 0xF180, 0x2404, 0xF181, 0xF181, 0x525F,
+ 0xF182, 0xF182, 0x2131, 0xF183, 0xF183, 0x5260, 0xF184, 0xF184, 0x2184,
+ 0xF185, 0xF185, 0x5261, 0xF186, 0xF186, 0x2403, 0xF187, 0xF187, 0x5262,
+ 0xF188, 0xF188, 0x206E, 0xF189, 0xF189, 0x240B, 0xF18A, 0xF193, 0x5263,
+ 0xF194, 0xF194, 0x1F3F, 0xF195, 0xF197, 0x526D, 0xF198, 0xF198, 0x2067,
+ 0xF199, 0xF1A0, 0x5270, 0xF1A1, 0xF1FE, 0x1B85, 0xF240, 0xF244, 0x5278,
+ 0xF245, 0xF245, 0x1FD7, 0xF246, 0xF246, 0x527D, 0xF247, 0xF247, 0x1E83,
+ 0xF248, 0xF24A, 0x527E, 0xF24B, 0xF24B, 0x240F, 0xF24C, 0xF252, 0x5281,
+ 0xF253, 0xF253, 0x240E, 0xF254, 0xF254, 0x20C7, 0xF255, 0xF255, 0x240D,
+ 0xF256, 0xF25B, 0x5288, 0xF25C, 0xF25C, 0x2412, 0xF25D, 0xF25E, 0x528E,
+ 0xF25F, 0xF25F, 0x20B7, 0xF260, 0xF270, 0x5290, 0xF271, 0xF271, 0x23F0,
+ 0xF272, 0xF272, 0x52A1, 0xF273, 0xF273, 0x2411, 0xF274, 0xF274, 0x2414,
+ 0xF275, 0xF275, 0x52A2, 0xF276, 0xF276, 0x2170, 0xF277, 0xF27B, 0x52A3,
+ 0xF27C, 0xF27C, 0x2405, 0xF27D, 0xF27D, 0x210C, 0xF27E, 0xF27E, 0x2415,
+ 0xF280, 0xF284, 0x52A8, 0xF285, 0xF285, 0x2066, 0xF286, 0xF286, 0x52AD,
+ 0xF287, 0xF287, 0x2352, 0xF288, 0xF288, 0x2413, 0xF289, 0xF289, 0x2410,
+ 0xF28A, 0xF28B, 0x2416, 0xF28C, 0xF28C, 0x20F1, 0xF28D, 0xF290, 0x52AE,
+ 0xF291, 0xF291, 0x240A, 0xF292, 0xF293, 0x52B2, 0xF294, 0xF294, 0x2409,
+ 0xF295, 0xF295, 0x52B4, 0xF296, 0xF296, 0x2418, 0xF297, 0xF29B, 0x52B5,
+ 0xF29C, 0xF29C, 0x1FA7, 0xF29D, 0xF29D, 0x52BA, 0xF29E, 0xF29E, 0x21FC,
+ 0xF29F, 0xF2A0, 0x52BB, 0xF2A1, 0xF2FE, 0x1BE3, 0xF340, 0xF340, 0x1FC1,
+ 0xF341, 0xF341, 0x2406, 0xF342, 0xF344, 0x52BD, 0xF345, 0xF345, 0x229C,
+ 0xF346, 0xF347, 0x52C0, 0xF348, 0xF348, 0x204E, 0xF349, 0xF349, 0x52C2,
+ 0xF34A, 0xF34A, 0x241A, 0xF34B, 0xF34B, 0x2419, 0xF34C, 0xF34F, 0x52C3,
+ 0xF350, 0xF350, 0x240C, 0xF351, 0xF360, 0x52C7, 0xF361, 0xF361, 0x1E29,
+ 0xF362, 0xF373, 0x52D7, 0xF374, 0xF374, 0x2661, 0xF375, 0xF375, 0x52E9,
+ 0xF376, 0xF376, 0x26A4, 0xF377, 0xF377, 0x2174, 0xF378, 0xF378, 0x2663,
+ 0xF379, 0xF379, 0x2662, 0xF37A, 0xF37E, 0x52EA, 0xF380, 0xF38B, 0x52EF,
+ 0xF38C, 0xF38C, 0x2675, 0xF38D, 0xF39F, 0x52FB, 0xF3A0, 0xF3A0, 0x214C,
+ 0xF3A1, 0xF3FE, 0x1C41, 0xF440, 0xF444, 0x530E, 0xF445, 0xF445, 0x267A,
+ 0xF446, 0xF44F, 0x5313, 0xF450, 0xF450, 0x26A0, 0xF451, 0xF456, 0x531D,
+ 0xF457, 0xF457, 0x2668, 0xF458, 0xF458, 0x5323, 0xF459, 0xF459, 0x1ED0,
+ 0xF45A, 0xF45A, 0x5324, 0xF45B, 0xF45B, 0x2096, 0xF45C, 0xF45C, 0x5325,
+ 0xF45D, 0xF45D, 0x23CC, 0xF45E, 0xF461, 0x5326, 0xF462, 0xF462, 0x23C8,
+ 0xF463, 0xF463, 0x532A, 0xF464, 0xF464, 0x223E, 0xF465, 0xF474, 0x532B,
+ 0xF475, 0xF475, 0x2665, 0xF476, 0xF47B, 0x533B, 0xF47C, 0xF47C, 0x2664,
+ 0xF47D, 0xF47D, 0x5341, 0xF47E, 0xF47E, 0x2239, 0xF480, 0xF493, 0x5342,
+ 0xF494, 0xF494, 0x204A, 0xF495, 0xF498, 0x5356, 0xF499, 0xF499, 0x261F,
+ 0xF49A, 0xF49B, 0x535A, 0xF49C, 0xF49C, 0x261E, 0xF49D, 0xF4A0, 0x535C,
+ 0xF4A1, 0xF4FE, 0x1C9F, 0xF540, 0xF544, 0x5360, 0xF545, 0xF545, 0x2620,
+ 0xF546, 0xF546, 0x5365, 0xF547, 0xF547, 0x2621, 0xF548, 0xF551, 0x5366,
+ 0xF552, 0xF552, 0x2622, 0xF553, 0xF553, 0x5370, 0xF554, 0xF554, 0x2627,
+ 0xF555, 0xF555, 0x1E39, 0xF556, 0xF556, 0x2625, 0xF557, 0xF55D, 0x5371,
+ 0xF55E, 0xF55E, 0x2629, 0xF55F, 0xF560, 0x5378, 0xF561, 0xF561, 0x262E,
+ 0xF562, 0xF562, 0x262B, 0xF563, 0xF56D, 0x537A, 0xF56E, 0xF56E, 0x262A,
+ 0xF56F, 0xF56F, 0x262D, 0xF570, 0xF570, 0x5385, 0xF571, 0xF571, 0x2628,
+ 0xF572, 0xF572, 0x21B9, 0xF573, 0xF57E, 0x5386, 0xF580, 0xF584, 0x5392,
+ 0xF585, 0xF585, 0x2636, 0xF586, 0xF586, 0x2630, 0xF587, 0xF58B, 0x5397,
+ 0xF58C, 0xF58C, 0x2638, 0xF58D, 0xF58D, 0x539C, 0xF58E, 0xF58E, 0x200D,
+ 0xF58F, 0xF58F, 0x2637, 0xF590, 0xF598, 0x539D, 0xF599, 0xF599, 0x2645,
+ 0xF59A, 0xF59A, 0x53A6, 0xF59B, 0xF59B, 0x263A, 0xF59C, 0xF59F, 0x53A7,
+ 0xF5A0, 0xF5A0, 0x2643, 0xF5A1, 0xF5FE, 0x1CFD, 0xF640, 0xF640, 0x53AB,
+ 0xF641, 0xF641, 0x2640, 0xF642, 0xF644, 0x53AC, 0xF645, 0xF645, 0x263D,
+ 0xF646, 0xF646, 0x2641, 0xF647, 0xF647, 0x53AF, 0xF648, 0xF648, 0x263E,
+ 0xF649, 0xF64A, 0x53B0, 0xF64B, 0xF64B, 0x263F, 0xF64C, 0xF64C, 0x1FC0,
+ 0xF64D, 0xF64D, 0x53B2, 0xF64E, 0xF64F, 0x263B, 0xF650, 0xF653, 0x53B3,
+ 0xF654, 0xF654, 0x2642, 0xF655, 0xF657, 0x53B7, 0xF658, 0xF658, 0x2644,
+ 0xF659, 0xF660, 0x53BA, 0xF661, 0xF661, 0x2639, 0xF662, 0xF662, 0x53C2,
+ 0xF663, 0xF663, 0x264C, 0xF664, 0xF66B, 0x53C3, 0xF66C, 0xF66C, 0x2647,
+ 0xF66D, 0xF66D, 0x264B, 0xF66E, 0xF670, 0x53CB, 0xF671, 0xF671, 0x2649,
+ 0xF672, 0xF673, 0x53CE, 0xF674, 0xF674, 0x2648, 0xF675, 0xF675, 0x53D0,
+ 0xF676, 0xF676, 0x264A, 0xF677, 0xF677, 0x2108, 0xF678, 0xF67E, 0x53D1,
+ 0xF680, 0xF684, 0x53D8, 0xF685, 0xF685, 0x264D, 0xF686, 0xF687, 0x53DD,
+ 0xF688, 0xF688, 0x2634, 0xF689, 0xF689, 0x53DF, 0xF68A, 0xF68A, 0x2651,
+ 0xF68B, 0xF68C, 0x53E0, 0xF68D, 0xF68D, 0x2650, 0xF68E, 0xF68E, 0x2652,
+ 0xF68F, 0xF691, 0x53E2, 0xF692, 0xF692, 0x264F, 0xF693, 0xF695, 0x53E5,
+ 0xF696, 0xF696, 0x2632, 0xF697, 0xF697, 0x264E, 0xF698, 0xF698, 0x2653,
+ 0xF699, 0xF699, 0x53E8, 0xF69A, 0xF69A, 0x2657, 0xF69B, 0xF69B, 0x53E9,
+ 0xF69C, 0xF69C, 0x2635, 0xF69D, 0xF69D, 0x53EA, 0xF69E, 0xF69E, 0x2633,
+ 0xF69F, 0xF69F, 0x53EB, 0xF6A0, 0xF6A0, 0x2656, 0xF6A1, 0xF6FE, 0x1D5B,
+ 0xF740, 0xF741, 0x53EC, 0xF742, 0xF742, 0x2654, 0xF743, 0xF748, 0x53EE,
+ 0xF749, 0xF749, 0x2658, 0xF74A, 0xF74B, 0x53F4, 0xF74C, 0xF74C, 0x2655,
+ 0xF74D, 0xF74D, 0x1E4D, 0xF74E, 0xF755, 0x53F6, 0xF756, 0xF756, 0x265B,
+ 0xF757, 0xF757, 0x53FE, 0xF758, 0xF758, 0x265A, 0xF759, 0xF759, 0x53FF,
+ 0xF75A, 0xF75A, 0x2659, 0xF75B, 0xF75B, 0x202E, 0xF75C, 0xF75C, 0x262F,
+ 0xF75D, 0xF760, 0x5400, 0xF761, 0xF761, 0x2646, 0xF762, 0xF762, 0x5404,
+ 0xF763, 0xF763, 0x2626, 0xF764, 0xF76A, 0x5405, 0xF76B, 0xF76B, 0x265C,
+ 0xF76C, 0xF770, 0x540C, 0xF771, 0xF771, 0x262C, 0xF772, 0xF77B, 0x5411,
+ 0xF77C, 0xF77C, 0x2623, 0xF77D, 0xF77D, 0x541B, 0xF77E, 0xF77E, 0x2631,
+ 0xF780, 0xF7A0, 0x541C, 0xF7A1, 0xF7FE, 0x1DB9, 0xF840, 0xF841, 0x543D,
+ 0xF842, 0xF842, 0x209C, 0xF843, 0xF845, 0x543F, 0xF846, 0xF846, 0x2580,
+ 0xF847, 0xF848, 0x5442, 0xF849, 0xF849, 0x22DC, 0xF84A, 0xF84F, 0x5444,
+ 0xF850, 0xF850, 0x1F05, 0xF851, 0xF851, 0x208B, 0xF852, 0xF852, 0x544A,
+ 0xF853, 0xF853, 0x2581, 0xF854, 0xF862, 0x544B, 0xF863, 0xF863, 0x2583,
+ 0xF864, 0xF864, 0x2582, 0xF865, 0xF865, 0x545A, 0xF866, 0xF866, 0x21EE,
+ 0xF867, 0xF871, 0x545B, 0xF872, 0xF872, 0x2182, 0xF873, 0xF877, 0x5466,
+ 0xF878, 0xF878, 0x2243, 0xF879, 0xF879, 0x546B, 0xF87A, 0xF87A, 0x2587,
+ 0xF87B, 0xF87B, 0x546C, 0xF87C, 0xF87C, 0x2588, 0xF87D, 0xF87E, 0x546D,
+ 0xF880, 0xF880, 0x546F, 0xF881, 0xF881, 0x2584, 0xF882, 0xF883, 0x5470,
+ 0xF884, 0xF884, 0x21FD, 0xF885, 0xF885, 0x5472, 0xF886, 0xF886, 0x21EF,
+ 0xF887, 0xF88C, 0x5473, 0xF88D, 0xF88D, 0x258A, 0xF88E, 0xF88E, 0x258C,
+ 0xF88F, 0xF898, 0x5479, 0xF899, 0xF899, 0x1F47, 0xF89A, 0xF89C, 0x5483,
+ 0xF89D, 0xF89D, 0x1F1D, 0xF89E, 0xF89F, 0x5486, 0xF8A0, 0xF8A0, 0x258D,
+ 0xF940, 0xF94D, 0x5488, 0xF94E, 0xF94E, 0x1FD0, 0xF94F, 0xF94F, 0x2592,
+ 0xF950, 0xF950, 0x258F, 0xF951, 0xF958, 0x5496, 0xF959, 0xF959, 0x2594,
+ 0xF95A, 0xF95A, 0x1EE0, 0xF95B, 0xF95C, 0x549E, 0xF95D, 0xF95D, 0x2591,
+ 0xF95E, 0xF95E, 0x2595, 0xF95F, 0xF966, 0x54A0, 0xF967, 0xF967, 0x2597,
+ 0xF968, 0xF968, 0x54A8, 0xF969, 0xF969, 0x20B6, 0xF96A, 0xF96B, 0x54A9,
+ 0xF96C, 0xF96C, 0x2598, 0xF96D, 0xF96E, 0x54AB, 0xF96F, 0xF96F, 0x20F6,
+ 0xF970, 0xF97E, 0x54AD, 0xF980, 0xF984, 0x54BC, 0xF985, 0xF985, 0x2585,
+ 0xF986, 0xF986, 0x54C1, 0xF987, 0xF987, 0x2599, 0xF988, 0xF990, 0x54C2,
+ 0xF991, 0xF991, 0x2596, 0xF992, 0xF995, 0x54CB, 0xF996, 0xF996, 0x259A,
+ 0xF997, 0xF997, 0x54CF, 0xF998, 0xF998, 0x259B, 0xF999, 0xF9A0, 0x54D0,
+ 0xFA40, 0xFA41, 0x54D8, 0xFA42, 0xFA42, 0x259D, 0xFA43, 0xFA45, 0x54DA,
+ 0xFA46, 0xFA46, 0x259E, 0xFA47, 0xFA4B, 0x54DD, 0xFA4C, 0xFA4C, 0x234C,
+ 0xFA4D, 0xFA50, 0x54E2, 0xFA51, 0xFA51, 0x1F44, 0xFA52, 0xFA57, 0x54E6,
+ 0xFA58, 0xFA58, 0x2660, 0xFA59, 0xFA59, 0x25A0, 0xFA5A, 0xFA5C, 0x54EC,
+ 0xFA5D, 0xFA5D, 0x259C, 0xFA5E, 0xFA5E, 0x54EF, 0xFA5F, 0xFA5F, 0x259F,
+ 0xFA60, 0xFA60, 0x54F0, 0xFA61, 0xFA61, 0x1F6C, 0xFA62, 0xFA6F, 0x54F1,
+ 0xFA70, 0xFA70, 0x25A2, 0xFA71, 0xFA73, 0x54FF, 0xFA74, 0xFA74, 0x20AE,
+ 0xFA75, 0xFA75, 0x5502, 0xFA76, 0xFA76, 0x258B, 0xFA77, 0xFA77, 0x25A3,
+ 0xFA78, 0xFA7E, 0x5503, 0xFA80, 0xFA82, 0x550A, 0xFA83, 0xFA83, 0x2589,
+ 0xFA84, 0xFA84, 0x25A5, 0xFA85, 0xFA8C, 0x550D, 0xFA8D, 0xFA8D, 0x25A4,
+ 0xFA8E, 0xFA8F, 0x5515, 0xFA90, 0xFA90, 0x25A6, 0xFA91, 0xFA91, 0x2593,
+ 0xFA92, 0xFA95, 0x5517, 0xFA96, 0xFA96, 0x25A7, 0xFA97, 0xFA97, 0x2222,
+ 0xFA98, 0xFA98, 0x25A9, 0xFA99, 0xFAA0, 0x551B, 0xFB40, 0xFB48, 0x5523,
+ 0xFB49, 0xFB49, 0x25A8, 0xFB4A, 0xFB51, 0x552C, 0xFB52, 0xFB52, 0x2586,
+ 0xFB53, 0xFB56, 0x5534, 0xFB57, 0xFB57, 0x25A1, 0xFB58, 0xFB58, 0x25AA,
+ 0xFB59, 0xFB59, 0x5538, 0xFB5A, 0xFB5A, 0x2590, 0xFB5B, 0xFB5B, 0x258E,
+ 0xFB5C, 0xFB74, 0x5539, 0xFB75, 0xFB75, 0x2688, 0xFB76, 0xFB78, 0x5552,
+ 0xFB79, 0xFB79, 0x269E, 0xFB7A, 0xFB7A, 0x25FB, 0xFB7B, 0xFB7B, 0x5555,
+ 0xFB7C, 0xFB7C, 0x1F8C, 0xFB7D, 0xFB7D, 0x21F4, 0xFB7E, 0xFB7E, 0x5556,
+ 0xFB80, 0xFB8F, 0x5557, 0xFB90, 0xFB90, 0x200F, 0xFB91, 0xFB9B, 0x5567,
+ 0xFB9C, 0xFB9C, 0x2071, 0xFB9D, 0xFB9E, 0x5572, 0xFB9F, 0xFB9F, 0x25F7,
+ 0xFBA0, 0xFBA0, 0x5574, 0xFC40, 0xFC43, 0x5575, 0xFC44, 0xFC44, 0x2696,
+ 0xFC45, 0xFC48, 0x5579, 0xFC49, 0xFC49, 0x268F, 0xFC4A, 0xFC59, 0x557D,
+ 0xFC5A, 0xFC5A, 0x22DA, 0xFC5B, 0xFC62, 0x558D, 0xFC63, 0xFC63, 0x1EC1,
+ 0xFC64, 0xFC67, 0x5595, 0xFC68, 0xFC68, 0x1EB3, 0xFC69, 0xFC6E, 0x5599,
+ 0xFC6F, 0xFC6F, 0x266A, 0xFC70, 0xFC70, 0x559F, 0xFC71, 0xFC71, 0x268A,
+ 0xFC72, 0xFC73, 0x55A0, 0xFC74, 0xFC74, 0x2669, 0xFC75, 0xFC76, 0x55A2,
+ 0xFC77, 0xFC78, 0x2618, 0xFC79, 0xFC7E, 0x55A4, 0xFC80, 0xFC82, 0x55AA,
+ 0xFC83, 0xFC83, 0x261A, 0xFC84, 0xFC89, 0x55AD, 0xFC8A, 0xFC8A, 0x2673,
+ 0xFC8B, 0xFCA0, 0x55B3, 0xFD40, 0xFD51, 0x55C9, 0xFD52, 0xFD52, 0x20C6,
+ 0xFD53, 0xFD53, 0x226B, 0xFD54, 0xFD56, 0x55DB, 0xFD57, 0xFD57, 0x24D3,
+ 0xFD58, 0xFD58, 0x1E86, 0xFD59, 0xFD59, 0x55DE, 0xFD5A, 0xFD5A, 0x260F,
+ 0xFD5B, 0xFD5E, 0x55DF, 0xFD5F, 0xFD5F, 0x2611, 0xFD60, 0xFD61, 0x55E3,
+ 0xFD62, 0xFD62, 0x2613, 0xFD63, 0xFD64, 0x55E5, 0xFD65, 0xFD65, 0x2610,
+ 0xFD66, 0xFD66, 0x2612, 0xFD67, 0xFD67, 0x2030, 0xFD68, 0xFD68, 0x55E7,
+ 0xFD69, 0xFD69, 0x2671, 0xFD6A, 0xFD6B, 0x55E8, 0xFD6C, 0xFD6C, 0x2614,
+ 0xFD6D, 0xFD6F, 0x55EA, 0xFD70, 0xFD70, 0x2616, 0xFD71, 0xFD71, 0x55ED,
+ 0xFD72, 0xFD72, 0x2615, 0xFD73, 0xFD77, 0x55EE, 0xFD78, 0xFD78, 0x20F2,
+ 0xFD79, 0xFD7C, 0x55F3, 0xFD7D, 0xFD7D, 0x2617, 0xFD7E, 0xFD7E, 0x55F7,
+ 0xFD80, 0xFD87, 0x55F8, 0xFD88, 0xFD88, 0x2037, 0xFD89, 0xFD8A, 0x5600,
+ 0xFD8B, 0xFD8B, 0x20B3, 0xFD8C, 0xFD8E, 0x5602, 0xFD8F, 0xFD8F, 0x1F22,
+ 0xFD90, 0xFD90, 0x24ED, 0xFD91, 0xFD93, 0x5605, 0xFD94, 0xFD94, 0x1F34,
+ 0xFD95, 0xFD9C, 0x5608, 0xFD9D, 0xFD9D, 0x0A02, 0xFD9E, 0xFD9E, 0x40D3,
+ 0xFD9F, 0xFD9F, 0x200C, 0xFDA0, 0xFDA0, 0x5083, 0xFE40, 0xFE40, 0x1259,
+ 0xFE41, 0xFE7E, 0x5610, 0xFE80, 0xFEA0, 0x564E,
+};
diff --git a/core/src/fpdfapi/fpdf_cmaps/GB1/GBpc-EUC-H_0.cpp b/core/src/fpdfapi/fpdf_cmaps/GB1/GBpc-EUC-H_0.cpp
index 1b3e072a6c..7d1c91fa89 100644
--- a/core/src/fpdfapi/fpdf_cmaps/GB1/GBpc-EUC-H_0.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/GB1/GBpc-EUC-H_0.cpp
@@ -1,39 +1,39 @@
-// 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
-
-extern const unsigned short g_FXCMAP_GBpc_EUC_H_0[91 * 3] = {
- 0x0020, 0x007E, 0x0001, 0x0080, 0x0080, 0x1E20, 0x00FD, 0x00FF, 0x1E21,
- 0xA1A1, 0xA1FE, 0x0060, 0xA2B1, 0xA2E2, 0x00BE, 0xA2E5, 0xA2EE, 0x00F0,
- 0xA2F1, 0xA2FC, 0x00FA, 0xA3A1, 0xA3FE, 0x0106, 0xA4A1, 0xA4F3, 0x0164,
- 0xA5A1, 0xA5F6, 0x01B7, 0xA6A1, 0xA6B8, 0x020D, 0xA6C1, 0xA6F5, 0x0225,
- 0xA7A1, 0xA7C1, 0x025A, 0xA7D1, 0xA7F1, 0x027B, 0xA8A1, 0xA8C0, 0x029C,
- 0xA8C5, 0xA8EA, 0x02BC, 0xA9A4, 0xA9EF, 0x02E2, 0xAAA1, 0xAAFE, 0x032E,
- 0xABA1, 0xABC0, 0x038C, 0xB0A1, 0xB0FE, 0x03AC, 0xB1A1, 0xB1FE, 0x040A,
- 0xB2A1, 0xB2FE, 0x0468, 0xB3A1, 0xB3FE, 0x04C6, 0xB4A1, 0xB4FE, 0x0524,
- 0xB5A1, 0xB5FE, 0x0582, 0xB6A1, 0xB6FE, 0x05E0, 0xB7A1, 0xB7FE, 0x063E,
- 0xB8A1, 0xB8FE, 0x069C, 0xB9A1, 0xB9FE, 0x06FA, 0xBAA1, 0xBAFE, 0x0758,
- 0xBBA1, 0xBBFE, 0x07B6, 0xBCA1, 0xBCFE, 0x0814, 0xBDA1, 0xBDFE, 0x0872,
- 0xBEA1, 0xBEFE, 0x08D0, 0xBFA1, 0xBFFE, 0x092E, 0xC0A1, 0xC0FE, 0x098C,
- 0xC1A1, 0xC1FE, 0x09EA, 0xC2A1, 0xC2FE, 0x0A48, 0xC3A1, 0xC3FE, 0x0AA6,
- 0xC4A1, 0xC4FE, 0x0B04, 0xC5A1, 0xC5FE, 0x0B62, 0xC6A1, 0xC6FE, 0x0BC0,
- 0xC7A1, 0xC7FE, 0x0C1E, 0xC8A1, 0xC8FE, 0x0C7C, 0xC9A1, 0xC9FE, 0x0CDA,
- 0xCAA1, 0xCAFE, 0x0D38, 0xCBA1, 0xCBFE, 0x0D96, 0xCCA1, 0xCCFE, 0x0DF4,
- 0xCDA1, 0xCDFE, 0x0E52, 0xCEA1, 0xCEFE, 0x0EB0, 0xCFA1, 0xCFFE, 0x0F0E,
- 0xD0A1, 0xD0FE, 0x0F6C, 0xD1A1, 0xD1FE, 0x0FCA, 0xD2A1, 0xD2FE, 0x1028,
- 0xD3A1, 0xD3FE, 0x1086, 0xD4A1, 0xD4FE, 0x10E4, 0xD5A1, 0xD5FE, 0x1142,
- 0xD6A1, 0xD6FE, 0x11A0, 0xD7A1, 0xD7F9, 0x11FE, 0xD8A1, 0xD8FE, 0x1257,
- 0xD9A1, 0xD9FE, 0x12B5, 0xDAA1, 0xDAFE, 0x1313, 0xDBA1, 0xDBFE, 0x1371,
- 0xDCA1, 0xDCFE, 0x13CF, 0xDDA1, 0xDDFE, 0x142D, 0xDEA1, 0xDEFE, 0x148B,
- 0xDFA1, 0xDFFE, 0x14E9, 0xE0A1, 0xE0FE, 0x1547, 0xE1A1, 0xE1FE, 0x15A5,
- 0xE2A1, 0xE2FE, 0x1603, 0xE3A1, 0xE3FE, 0x1661, 0xE4A1, 0xE4FE, 0x16BF,
- 0xE5A1, 0xE5FE, 0x171D, 0xE6A1, 0xE6FE, 0x177B, 0xE7A1, 0xE7FE, 0x17D9,
- 0xE8A1, 0xE8FE, 0x1837, 0xE9A1, 0xE9FE, 0x1895, 0xEAA1, 0xEAFE, 0x18F3,
- 0xEBA1, 0xEBFE, 0x1951, 0xECA1, 0xECFE, 0x19AF, 0xEDA1, 0xEDFE, 0x1A0D,
- 0xEEA1, 0xEEFE, 0x1A6B, 0xEFA1, 0xEFFE, 0x1AC9, 0xF0A1, 0xF0FE, 0x1B27,
- 0xF1A1, 0xF1FE, 0x1B85, 0xF2A1, 0xF2FE, 0x1BE3, 0xF3A1, 0xF3FE, 0x1C41,
- 0xF4A1, 0xF4FE, 0x1C9F, 0xF5A1, 0xF5FE, 0x1CFD, 0xF6A1, 0xF6FE, 0x1D5B,
- 0xF7A1, 0xF7FE, 0x1DB9,
-};
+// 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
+
+extern const unsigned short g_FXCMAP_GBpc_EUC_H_0[91 * 3] = {
+ 0x0020, 0x007E, 0x0001, 0x0080, 0x0080, 0x1E20, 0x00FD, 0x00FF, 0x1E21,
+ 0xA1A1, 0xA1FE, 0x0060, 0xA2B1, 0xA2E2, 0x00BE, 0xA2E5, 0xA2EE, 0x00F0,
+ 0xA2F1, 0xA2FC, 0x00FA, 0xA3A1, 0xA3FE, 0x0106, 0xA4A1, 0xA4F3, 0x0164,
+ 0xA5A1, 0xA5F6, 0x01B7, 0xA6A1, 0xA6B8, 0x020D, 0xA6C1, 0xA6F5, 0x0225,
+ 0xA7A1, 0xA7C1, 0x025A, 0xA7D1, 0xA7F1, 0x027B, 0xA8A1, 0xA8C0, 0x029C,
+ 0xA8C5, 0xA8EA, 0x02BC, 0xA9A4, 0xA9EF, 0x02E2, 0xAAA1, 0xAAFE, 0x032E,
+ 0xABA1, 0xABC0, 0x038C, 0xB0A1, 0xB0FE, 0x03AC, 0xB1A1, 0xB1FE, 0x040A,
+ 0xB2A1, 0xB2FE, 0x0468, 0xB3A1, 0xB3FE, 0x04C6, 0xB4A1, 0xB4FE, 0x0524,
+ 0xB5A1, 0xB5FE, 0x0582, 0xB6A1, 0xB6FE, 0x05E0, 0xB7A1, 0xB7FE, 0x063E,
+ 0xB8A1, 0xB8FE, 0x069C, 0xB9A1, 0xB9FE, 0x06FA, 0xBAA1, 0xBAFE, 0x0758,
+ 0xBBA1, 0xBBFE, 0x07B6, 0xBCA1, 0xBCFE, 0x0814, 0xBDA1, 0xBDFE, 0x0872,
+ 0xBEA1, 0xBEFE, 0x08D0, 0xBFA1, 0xBFFE, 0x092E, 0xC0A1, 0xC0FE, 0x098C,
+ 0xC1A1, 0xC1FE, 0x09EA, 0xC2A1, 0xC2FE, 0x0A48, 0xC3A1, 0xC3FE, 0x0AA6,
+ 0xC4A1, 0xC4FE, 0x0B04, 0xC5A1, 0xC5FE, 0x0B62, 0xC6A1, 0xC6FE, 0x0BC0,
+ 0xC7A1, 0xC7FE, 0x0C1E, 0xC8A1, 0xC8FE, 0x0C7C, 0xC9A1, 0xC9FE, 0x0CDA,
+ 0xCAA1, 0xCAFE, 0x0D38, 0xCBA1, 0xCBFE, 0x0D96, 0xCCA1, 0xCCFE, 0x0DF4,
+ 0xCDA1, 0xCDFE, 0x0E52, 0xCEA1, 0xCEFE, 0x0EB0, 0xCFA1, 0xCFFE, 0x0F0E,
+ 0xD0A1, 0xD0FE, 0x0F6C, 0xD1A1, 0xD1FE, 0x0FCA, 0xD2A1, 0xD2FE, 0x1028,
+ 0xD3A1, 0xD3FE, 0x1086, 0xD4A1, 0xD4FE, 0x10E4, 0xD5A1, 0xD5FE, 0x1142,
+ 0xD6A1, 0xD6FE, 0x11A0, 0xD7A1, 0xD7F9, 0x11FE, 0xD8A1, 0xD8FE, 0x1257,
+ 0xD9A1, 0xD9FE, 0x12B5, 0xDAA1, 0xDAFE, 0x1313, 0xDBA1, 0xDBFE, 0x1371,
+ 0xDCA1, 0xDCFE, 0x13CF, 0xDDA1, 0xDDFE, 0x142D, 0xDEA1, 0xDEFE, 0x148B,
+ 0xDFA1, 0xDFFE, 0x14E9, 0xE0A1, 0xE0FE, 0x1547, 0xE1A1, 0xE1FE, 0x15A5,
+ 0xE2A1, 0xE2FE, 0x1603, 0xE3A1, 0xE3FE, 0x1661, 0xE4A1, 0xE4FE, 0x16BF,
+ 0xE5A1, 0xE5FE, 0x171D, 0xE6A1, 0xE6FE, 0x177B, 0xE7A1, 0xE7FE, 0x17D9,
+ 0xE8A1, 0xE8FE, 0x1837, 0xE9A1, 0xE9FE, 0x1895, 0xEAA1, 0xEAFE, 0x18F3,
+ 0xEBA1, 0xEBFE, 0x1951, 0xECA1, 0xECFE, 0x19AF, 0xEDA1, 0xEDFE, 0x1A0D,
+ 0xEEA1, 0xEEFE, 0x1A6B, 0xEFA1, 0xEFFE, 0x1AC9, 0xF0A1, 0xF0FE, 0x1B27,
+ 0xF1A1, 0xF1FE, 0x1B85, 0xF2A1, 0xF2FE, 0x1BE3, 0xF3A1, 0xF3FE, 0x1C41,
+ 0xF4A1, 0xF4FE, 0x1C9F, 0xF5A1, 0xF5FE, 0x1CFD, 0xF6A1, 0xF6FE, 0x1D5B,
+ 0xF7A1, 0xF7FE, 0x1DB9,
+};
diff --git a/core/src/fpdfapi/fpdf_cmaps/GB1/GBpc-EUC-V_0.cpp b/core/src/fpdfapi/fpdf_cmaps/GB1/GBpc-EUC-V_0.cpp
index be469f2eea..325ec224bd 100644
--- a/core/src/fpdfapi/fpdf_cmaps/GB1/GBpc-EUC-V_0.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/GB1/GBpc-EUC-V_0.cpp
@@ -1,15 +1,15 @@
-// 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
-
-extern const unsigned short g_FXCMAP_GBpc_EUC_V_0[20 * 3] = {
- 0xA1A2, 0xA1A2, 0x023F, 0xA1A3, 0xA1A3, 0x023E, 0xA1AA, 0xA1AA, 0x0256,
- 0xA1AB, 0xA1AC, 0x1E18, 0xA1AD, 0xA1AD, 0x0257, 0xA1B2, 0xA1BF, 0x0246,
- 0xA1FE, 0xA1FE, 0x1E1A, 0xA3A1, 0xA3A1, 0x0242, 0xA3A8, 0xA3A9, 0x0244,
- 0xA3AC, 0xA3AC, 0x023D, 0xA3AE, 0xA3AE, 0x1E1B, 0xA3BA, 0xA3BB, 0x0240,
- 0xA3BD, 0xA3BD, 0x1E1C, 0xA3BF, 0xA3BF, 0x0243, 0xA3DB, 0xA3DB, 0x1E1D,
- 0xA3DD, 0xA3DD, 0x1E1E, 0xA3DF, 0xA3DF, 0x0258, 0xA3FB, 0xA3FB, 0x0254,
- 0xA3FD, 0xA3FD, 0x0255, 0xA3FE, 0xA3FE, 0x1E1F,
-};
+// 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
+
+extern const unsigned short g_FXCMAP_GBpc_EUC_V_0[20 * 3] = {
+ 0xA1A2, 0xA1A2, 0x023F, 0xA1A3, 0xA1A3, 0x023E, 0xA1AA, 0xA1AA, 0x0256,
+ 0xA1AB, 0xA1AC, 0x1E18, 0xA1AD, 0xA1AD, 0x0257, 0xA1B2, 0xA1BF, 0x0246,
+ 0xA1FE, 0xA1FE, 0x1E1A, 0xA3A1, 0xA3A1, 0x0242, 0xA3A8, 0xA3A9, 0x0244,
+ 0xA3AC, 0xA3AC, 0x023D, 0xA3AE, 0xA3AE, 0x1E1B, 0xA3BA, 0xA3BB, 0x0240,
+ 0xA3BD, 0xA3BD, 0x1E1C, 0xA3BF, 0xA3BF, 0x0243, 0xA3DB, 0xA3DB, 0x1E1D,
+ 0xA3DD, 0xA3DD, 0x1E1E, 0xA3DF, 0xA3DF, 0x0258, 0xA3FB, 0xA3FB, 0x0254,
+ 0xA3FD, 0xA3FD, 0x0255, 0xA3FE, 0xA3FE, 0x1E1F,
+};
diff --git a/core/src/fpdfapi/fpdf_cmaps/GB1/UniGB-UCS2-H_4.cpp b/core/src/fpdfapi/fpdf_cmaps/GB1/UniGB-UCS2-H_4.cpp
index 30003729df..d12e815dc9 100644
--- a/core/src/fpdfapi/fpdf_cmaps/GB1/UniGB-UCS2-H_4.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/GB1/UniGB-UCS2-H_4.cpp
@@ -1,4617 +1,4617 @@
-// 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
-
-extern const unsigned short g_FXCMAP_UniGB_UCS2_H_4[13825 * 3] = {
- 0x0020, 0x007E, 0x0001, 0x00A4, 0x00A4, 0x00A7, 0x00A5, 0x00A5, 0x5752,
- 0x00A7, 0x00A7, 0x00AB, 0x00A8, 0x00A8, 0x0066, 0x00B0, 0x00B0, 0x00A2,
- 0x00B1, 0x00B1, 0x007F, 0x00D7, 0x00D7, 0x0080, 0x00E0, 0x00E0, 0x029F,
- 0x00E1, 0x00E1, 0x029D, 0x00E8, 0x00E8, 0x02A3, 0x00E9, 0x00E9, 0x02A1,
- 0x00EA, 0x00EA, 0x02B5, 0x00EC, 0x00EC, 0x02A7, 0x00ED, 0x00ED, 0x02A5,
- 0x00F2, 0x00F2, 0x02AB, 0x00F3, 0x00F3, 0x02A9, 0x00F7, 0x00F7, 0x0081,
- 0x00F9, 0x00F9, 0x02AF, 0x00FA, 0x00FA, 0x02AD, 0x00FC, 0x00FC, 0x02B4,
- 0x0101, 0x0101, 0x029C, 0x0113, 0x0113, 0x02A0, 0x011B, 0x011B, 0x02A2,
- 0x012B, 0x012B, 0x02A4, 0x014D, 0x014D, 0x02A8, 0x016B, 0x016B, 0x02AC,
- 0x01CE, 0x01CE, 0x029E, 0x01D0, 0x01D0, 0x02A6, 0x01D2, 0x01D2, 0x02AA,
- 0x01D4, 0x01D4, 0x02AE, 0x01D6, 0x01D6, 0x02B0, 0x01D8, 0x01D8, 0x02B1,
- 0x01DA, 0x01DA, 0x02B2, 0x01DC, 0x01DC, 0x02B3, 0x01F9, 0x01F9, 0x02BA,
- 0x02C7, 0x02C7, 0x0065, 0x02C9, 0x02C9, 0x0064, 0x02CA, 0x02CB, 0x26B3,
- 0x02D9, 0x02D9, 0x26B5, 0x0391, 0x03A1, 0x020D, 0x03A3, 0x03A9, 0x021E,
- 0x03B1, 0x03C1, 0x0225, 0x03C3, 0x03C9, 0x0236, 0x0401, 0x0401, 0x0260,
- 0x0410, 0x0415, 0x025A, 0x0416, 0x0435, 0x0261, 0x0436, 0x044F, 0x0282,
- 0x0451, 0x0451, 0x0281, 0x1E3F, 0x1E3F, 0x02B7, 0x2010, 0x2010, 0x2722,
- 0x2013, 0x2013, 0x26B6, 0x2014, 0x2014, 0x0069, 0x2015, 0x2015, 0x26B7,
- 0x2016, 0x2016, 0x006B, 0x2018, 0x2019, 0x006D, 0x201C, 0x201D, 0x006F,
- 0x2025, 0x2025, 0x26B8, 0x2026, 0x2026, 0x006C, 0x2030, 0x2030, 0x00AA,
- 0x2032, 0x2033, 0x00A3, 0x2035, 0x2035, 0x26B9, 0x203B, 0x203B, 0x00B8,
- 0x20AC, 0x20AC, 0x5751, 0x2103, 0x2103, 0x00A5, 0x2105, 0x2105, 0x26BA,
- 0x2109, 0x2109, 0x26BB, 0x2116, 0x2116, 0x00AC, 0x2121, 0x2121, 0x2720,
- 0x2160, 0x216B, 0x00FA, 0x2170, 0x2179, 0x26A9, 0x2190, 0x2191, 0x00BA,
- 0x2192, 0x2192, 0x00B9, 0x2193, 0x2193, 0x00BC, 0x2196, 0x2199, 0x26BC,
- 0x2208, 0x2208, 0x0089, 0x220F, 0x220F, 0x0086, 0x2211, 0x2211, 0x0085,
- 0x2215, 0x2215, 0x26C0, 0x221A, 0x221A, 0x008B, 0x221D, 0x221D, 0x0097,
- 0x221E, 0x221E, 0x009D, 0x221F, 0x221F, 0x26C1, 0x2220, 0x2220, 0x008E,
- 0x2223, 0x2223, 0x26C2, 0x2225, 0x2225, 0x008D, 0x2227, 0x2228, 0x0083,
- 0x2229, 0x2229, 0x0088, 0x222A, 0x222A, 0x0087, 0x222B, 0x222B, 0x0091,
- 0x222E, 0x222E, 0x0092, 0x2234, 0x2234, 0x009F, 0x2235, 0x2235, 0x009E,
- 0x2236, 0x2236, 0x0082, 0x2237, 0x2237, 0x008A, 0x223D, 0x223D, 0x0096,
- 0x2248, 0x2248, 0x0095, 0x224C, 0x224C, 0x0094, 0x2252, 0x2252, 0x26C3,
- 0x2260, 0x2260, 0x0098, 0x2261, 0x2261, 0x0093, 0x2264, 0x2265, 0x009B,
- 0x2266, 0x2267, 0x26C4, 0x226E, 0x226F, 0x0099, 0x2295, 0x2295, 0x2704,
- 0x2299, 0x2299, 0x0090, 0x22A5, 0x22A5, 0x008C, 0x22BF, 0x22BF, 0x26C6,
- 0x22EF, 0x22EF, 0x006C, 0x2312, 0x2312, 0x008F, 0x2460, 0x2469, 0x00E6,
- 0x2474, 0x2487, 0x00D2, 0x2488, 0x249B, 0x00BE, 0x2500, 0x254B, 0x02E2,
- 0x2550, 0x2573, 0x26C7, 0x2581, 0x258F, 0x26EB, 0x2593, 0x2595, 0x26FA,
- 0x25A0, 0x25A0, 0x00B5, 0x25A1, 0x25A1, 0x00B4, 0x25B2, 0x25B2, 0x00B7,
- 0x25B3, 0x25B3, 0x00B6, 0x25BC, 0x25BD, 0x26FD, 0x25C6, 0x25C6, 0x00B3,
- 0x25C7, 0x25C7, 0x00B2, 0x25CB, 0x25CB, 0x00AF, 0x25CE, 0x25CE, 0x00B1,
- 0x25CF, 0x25CF, 0x00B0, 0x25E2, 0x25E5, 0x26FF, 0x2605, 0x2605, 0x00AE,
- 0x2606, 0x2606, 0x00AD, 0x2609, 0x2609, 0x2703, 0x2640, 0x2640, 0x00A1,
- 0x2642, 0x2642, 0x00A0, 0x2E80, 0x2E80, 0x579C, 0x2E81, 0x2E81, 0x561F,
- 0x2E82, 0x2E83, 0x579D, 0x2E84, 0x2E84, 0x5623, 0x2E85, 0x2E87, 0x579F,
- 0x2E88, 0x2E88, 0x5626, 0x2E89, 0x2E8A, 0x57A2, 0x2E8B, 0x2E8B, 0x5627,
- 0x2E8C, 0x2E8C, 0x562C, 0x2E8D, 0x2E96, 0x57A4, 0x2E97, 0x2E97, 0x562D,
- 0x2E98, 0x2E99, 0x57AE, 0x2E9B, 0x2EA6, 0x57B0, 0x2EA7, 0x2EA7, 0x563A,
- 0x2EA8, 0x2EA9, 0x57BC, 0x2EAA, 0x2EAA, 0x563D, 0x2EAB, 0x2EAD, 0x57BE,
- 0x2EAE, 0x2EAE, 0x5640, 0x2EAF, 0x2EB2, 0x57C1, 0x2EB3, 0x2EB3, 0x5642,
- 0x2EB4, 0x2EB5, 0x57C5, 0x2EB6, 0x2EB7, 0x5643, 0x2EB8, 0x2EBA, 0x57C7,
- 0x2EBB, 0x2EBB, 0x5648, 0x2EBC, 0x2EC9, 0x57CA, 0x2ECA, 0x2ECA, 0x5652,
- 0x2ECB, 0x2EF3, 0x57D8, 0x2F00, 0x2F00, 0x1042, 0x2F01, 0x2F01, 0x1263,
- 0x2F02, 0x2F02, 0x1272, 0x2F03, 0x2F03, 0x1265, 0x2F04, 0x2F04, 0x1059,
- 0x2F05, 0x2F05, 0x2793, 0x2F06, 0x2F06, 0x063D, 0x2F07, 0x2F07, 0x1303,
- 0x2F08, 0x2F08, 0x0CA6, 0x2F09, 0x2F09, 0x0638, 0x2F0A, 0x2F0A, 0x0CC6,
- 0x2F0B, 0x2F0B, 0x03D6, 0x2F0C, 0x2F0C, 0x129D, 0x2F0D, 0x2F0D, 0x1314,
- 0x2F0E, 0x2F0E, 0x130F, 0x2F0F, 0x2F0F, 0x082B, 0x2F10, 0x2F10, 0x1399,
- 0x2F11, 0x2F11, 0x0597, 0x2F12, 0x2F12, 0x09EF, 0x2F13, 0x2F13, 0x12FC,
- 0x2F14, 0x2F14, 0x1266, 0x2F15, 0x2F15, 0x1284, 0x2F16, 0x2F16, 0x2A1A,
- 0x2F17, 0x2F17, 0x0D45, 0x2F18, 0x2F18, 0x047E, 0x2F19, 0x2F19, 0x1352,
- 0x2F1A, 0x2F1A, 0x04CC, 0x2F1B, 0x2F1B, 0x139C, 0x2F1C, 0x2F1C, 0x10BB,
- 0x2F1D, 0x2F1D, 0x0967, 0x2F1E, 0x2F1E, 0x1593, 0x2F1F, 0x2F1F, 0x0E72,
- 0x2F20, 0x2F20, 0x0D56, 0x2F21, 0x2F21, 0x161C, 0x2F22, 0x2F22, 0x2D2D,
- 0x2F23, 0x2F23, 0x0F13, 0x2F24, 0x2F24, 0x0576, 0x2F25, 0x2F25, 0x0B6F,
- 0x2F26, 0x2F26, 0x1230, 0x2F27, 0x2F27, 0x172E, 0x2F28, 0x2F28, 0x056A,
- 0x2F29, 0x2F29, 0x0F6C, 0x2F2A, 0x2F2A, 0x14B6, 0x2F2B, 0x2F2B, 0x0D43,
- 0x2F2C, 0x2F2C, 0x1774, 0x2F2D, 0x2F2D, 0x0CF6, 0x2F2E, 0x2F2E, 0x1815,
- 0x2F2F, 0x2F2F, 0x06FD, 0x2F30, 0x2F30, 0x082D, 0x2F31, 0x2F31, 0x08BE,
- 0x2F32, 0x2F32, 0x06C4, 0x2F33, 0x2F33, 0x1813, 0x2F34, 0x2F34, 0x073C,
- 0x2F35, 0x2F35, 0x1398, 0x2F36, 0x2F36, 0x14AD, 0x2F37, 0x2F37, 0x14F6,
- 0x2F38, 0x2F38, 0x0706, 0x2F39, 0x2F39, 0x1762, 0x2F3A, 0x2F3A, 0x15EE,
- 0x2F3B, 0x2F3B, 0x15E0, 0x2F3C, 0x2F3C, 0x0F8F, 0x2F3D, 0x2F3D, 0x06E5,
- 0x2F3E, 0x2F3E, 0x3292, 0x2F3F, 0x2F3F, 0x0D6D, 0x2F40, 0x2F40, 0x11A6,
- 0x2F41, 0x2F41, 0x1909, 0x2F42, 0x2F42, 0x0ED3, 0x2F43, 0x2F43, 0x05F6,
- 0x2F44, 0x2F44, 0x08C0, 0x2F45, 0x2F45, 0x065A, 0x2F46, 0x2F46, 0x0EED,
- 0x2F47, 0x2F47, 0x0CB0, 0x2F48, 0x2F48, 0x10FE, 0x2F49, 0x2F49, 0x1105,
- 0x2F4A, 0x2F4A, 0x0B21, 0x2F4B, 0x2F4B, 0x0C34, 0x2F4C, 0x2F4C, 0x11B8,
- 0x2F4D, 0x2F4D, 0x0578, 0x2F4E, 0x2F4E, 0x19BD, 0x2F4F, 0x2F4F, 0x0EF2,
- 0x2F50, 0x2F50, 0x0431, 0x2F51, 0x2F51, 0x0AB0, 0x2F52, 0x2F52, 0x0D66,
- 0x2F53, 0x2F53, 0x0C17, 0x2F54, 0x2F54, 0x0DA3, 0x2F55, 0x2F55, 0x0805,
- 0x2F56, 0x2F56, 0x1203, 0x2F57, 0x2F57, 0x06B3, 0x2F58, 0x2F58, 0x1269,
- 0x2F59, 0x2F59, 0x169D, 0x2F5A, 0x2F5A, 0x0BCB, 0x2F5B, 0x2F5B, 0x0FE9,
- 0x2F5C, 0x2F5C, 0x0B64, 0x2F5D, 0x2F5D, 0x0C89, 0x2F5E, 0x2F5E, 0x0FC9,
- 0x2F5F, 0x2F5F, 0x10D6, 0x2F60, 0x2F60, 0x0728, 0x2F61, 0x2F61, 0x0E90,
- 0x2F62, 0x2F62, 0x06C5, 0x2F63, 0x2F63, 0x0D33, 0x2F64, 0x2F64, 0x10A8,
- 0x2F65, 0x2F65, 0x0E42, 0x2F66, 0x2F66, 0x1BC6, 0x2F67, 0x2F67, 0x1B60,
- 0x2F68, 0x2F68, 0x3EBF, 0x2F69, 0x2F69, 0x03E2, 0x2F6A, 0x2F6A, 0x0BC3,
- 0x2F6B, 0x2F6B, 0x0AF8, 0x2F6C, 0x2F6C, 0x0B22, 0x2F6D, 0x2F6D, 0x0AB1,
- 0x2F6E, 0x2F6E, 0x0D4F, 0x2F6F, 0x2F6F, 0x0D46, 0x2F70, 0x2F70, 0x0D55,
- 0x2F71, 0x2F71, 0x40CB, 0x2F72, 0x2F72, 0x0783, 0x2F73, 0x2F73, 0x0FD1,
- 0x2F74, 0x2F74, 0x09EB, 0x2F75, 0x2F75, 0x11F0, 0x2F76, 0x2F76, 0x0ADC,
- 0x2F77, 0x2F77, 0x1CE7, 0x2F78, 0x2F78, 0x1C5E, 0x2F79, 0x2F79, 0x0EA9,
- 0x2F7A, 0x2F7A, 0x101B, 0x2F7B, 0x2F7B, 0x10D5, 0x2F7C, 0x2F7C, 0x09BA,
- 0x2F7D, 0x2F7D, 0x0637, 0x2F7E, 0x2F7E, 0x1BCB, 0x2F7F, 0x2F7F, 0x0639,
- 0x2F80, 0x2F80, 0x1A1E, 0x2F81, 0x2F81, 0x0CBD, 0x2F82, 0x2F82, 0x04E1,
- 0x2F83, 0x2F83, 0x1231, 0x2F84, 0x2F84, 0x11C0, 0x2F85, 0x2F85, 0x08F9,
- 0x2F86, 0x2F86, 0x0D19, 0x2F87, 0x2F87, 0x1618, 0x2F88, 0x2F88, 0x11DA,
- 0x2F89, 0x2F89, 0x1CDC, 0x2F8A, 0x2F8A, 0x0CE4, 0x2F8B, 0x2F8B, 0x45A2,
- 0x2F8C, 0x2F8C, 0x1BF0, 0x2F8D, 0x2F8D, 0x050B, 0x2F8E, 0x2F8E, 0x0FD3,
- 0x2F8F, 0x2F8F, 0x0F9B, 0x2F90, 0x2F90, 0x1049, 0x2F91, 0x2F91, 0x49DC,
- 0x2F92, 0x2F92, 0x1F96, 0x2F93, 0x2F93, 0x0898, 0x2F94, 0x2F94, 0x0FFD,
- 0x2F95, 0x2F95, 0x0721, 0x2F96, 0x2F96, 0x05F8, 0x2F97, 0x2F97, 0x1D15,
- 0x2F98, 0x2F98, 0x1D50, 0x2F99, 0x2F99, 0x1E3B, 0x2F9A, 0x2F9A, 0x0505,
- 0x2F9B, 0x2F9B, 0x123C, 0x2F9C, 0x2F9C, 0x1240, 0x2F9D, 0x2F9D, 0x0D26,
- 0x2F9E, 0x2F9E, 0x1E7B, 0x2F9F, 0x2F9F, 0x0F8C, 0x2FA0, 0x2FA0, 0x04E2,
- 0x2FA1, 0x2FA1, 0x4D13, 0x2FA2, 0x2FA2, 0x105F, 0x2FA3, 0x2FA3, 0x10B4,
- 0x2FA4, 0x2FA4, 0x4E18, 0x2FA5, 0x2FA5, 0x09DA, 0x2FA6, 0x2FA6, 0x08C1,
- 0x2FA7, 0x2FA7, 0x1E75, 0x2FA8, 0x2FA8, 0x207D, 0x2FA9, 0x2FA9, 0x06B2,
- 0x2FAA, 0x2FAA, 0x09EE, 0x2FAB, 0x2FAB, 0x1D79, 0x2FAC, 0x2FAC, 0x10CF,
- 0x2FAD, 0x2FAD, 0x50EA, 0x2FAE, 0x2FAE, 0x0664, 0x2FAF, 0x2FAF, 0x0AEB,
- 0x2FB0, 0x2FB0, 0x06EA, 0x2FB1, 0x2FB1, 0x218D, 0x2FB2, 0x2FB2, 0x08F1,
- 0x2FB3, 0x2FB3, 0x107B, 0x2FB4, 0x2FB4, 0x2209, 0x2FB5, 0x2FB5, 0x1F00,
- 0x2FB6, 0x2FB6, 0x1EF4, 0x2FB7, 0x2FB7, 0x0D4A, 0x2FB8, 0x2FB8, 0x0D6E,
- 0x2FB9, 0x2FB9, 0x0F50, 0x2FBA, 0x2FBA, 0x206D, 0x2FBB, 0x2FBB, 0x0720,
- 0x2FBC, 0x2FBC, 0x06DA, 0x2FBD, 0x2FBD, 0x1DEC, 0x2FBE, 0x2FBE, 0x1ED0,
- 0x2FBF, 0x2FBF, 0x139B, 0x2FC0, 0x2FC0, 0x1260, 0x2FC1, 0x2FC1, 0x0746,
- 0x2FC2, 0x2FC2, 0x2239, 0x2FC3, 0x2FC3, 0x209C, 0x2FC4, 0x2FC4, 0x2688,
- 0x2FC5, 0x2FC5, 0x0A60, 0x2FC6, 0x2FC6, 0x2071, 0x2FC7, 0x2FC7, 0x0A90,
- 0x2FC8, 0x2FC8, 0x5586, 0x2FC9, 0x2FC9, 0x0D89, 0x2FCA, 0x2FCA, 0x0791,
- 0x2FCB, 0x2FCB, 0x1A55, 0x2FCC, 0x2FCC, 0x2618, 0x2FCD, 0x2FCD, 0x05E5,
- 0x2FCE, 0x2FCE, 0x071D, 0x2FCF, 0x2FCF, 0x0D8A, 0x2FD0, 0x2FD0, 0x0430,
- 0x2FD1, 0x2FD1, 0x20C6, 0x2FD2, 0x2FD2, 0x1E86, 0x2FD3, 0x2FD3, 0x2037,
- 0x2FD4, 0x2FD4, 0x1F34, 0x2FD5, 0x2FD5, 0x12F3, 0x2FF0, 0x2FFB, 0x274C,
- 0x3000, 0x3002, 0x0060, 0x3003, 0x3003, 0x0067, 0x3005, 0x3005, 0x0068,
- 0x3006, 0x3006, 0x2728, 0x3007, 0x3007, 0x1E17, 0x3008, 0x300F, 0x0073,
- 0x3010, 0x3011, 0x007D, 0x3012, 0x3012, 0x2705, 0x3013, 0x3013, 0x00BD,
- 0x3014, 0x3015, 0x0071, 0x3016, 0x3017, 0x007B, 0x301D, 0x301E, 0x2706,
- 0x3021, 0x3029, 0x2708, 0x3033, 0x3035, 0x577B, 0x3038, 0x303A, 0x577E,
- 0x303E, 0x303E, 0x274B, 0x303F, 0x303F, 0x5755, 0x3041, 0x3093, 0x0164,
- 0x3094, 0x3094, 0x5767, 0x309B, 0x309C, 0x2724, 0x309D, 0x309E, 0x2729,
- 0x30A1, 0x30F6, 0x01B7, 0x30F7, 0x30FA, 0x5776, 0x30FB, 0x30FB, 0x0063,
- 0x30FC, 0x30FC, 0x2723, 0x30FD, 0x30FE, 0x2726, 0x3105, 0x3129, 0x02BC,
- 0x312A, 0x312C, 0x5781, 0x31A0, 0x31B7, 0x5784, 0x3220, 0x3229, 0x00F0,
- 0x3231, 0x3231, 0x2721, 0x32A3, 0x32A3, 0x2711, 0x338E, 0x338F, 0x2712,
- 0x339C, 0x339E, 0x2714, 0x33A1, 0x33A1, 0x2717, 0x33C4, 0x33C4, 0x2718,
- 0x33CE, 0x33CE, 0x2719, 0x33D1, 0x33D2, 0x271A, 0x33D5, 0x33D5, 0x271C,
- 0x3400, 0x3446, 0x5801, 0x3447, 0x3447, 0x5625, 0x3448, 0x3472, 0x5848,
- 0x3473, 0x3473, 0x5624, 0x3474, 0x34FF, 0x5873, 0x3500, 0x359D, 0x58FF,
- 0x359E, 0x359E, 0x5629, 0x359F, 0x35FF, 0x599D, 0x3600, 0x360D, 0x59FE,
- 0x360E, 0x360E, 0x562B, 0x360F, 0x3619, 0x5A0C, 0x361A, 0x361A, 0x562A,
- 0x361B, 0x36FF, 0x5A17, 0x3700, 0x37FF, 0x5AFC, 0x3800, 0x38FF, 0x5BFC,
- 0x3900, 0x3917, 0x5CFC, 0x3918, 0x3918, 0x562F, 0x3919, 0x396D, 0x5D14,
- 0x396E, 0x396E, 0x562E, 0x396F, 0x39CE, 0x5D69, 0x39CF, 0x39CF, 0x5631,
- 0x39D0, 0x39D0, 0x5634, 0x39D1, 0x39DE, 0x5DC9, 0x39DF, 0x39DF, 0x5632,
- 0x39E0, 0x39FF, 0x5DD7, 0x3A00, 0x3A72, 0x5DF7, 0x3A73, 0x3A73, 0x5633,
- 0x3A74, 0x3AFF, 0x5E6A, 0x3B00, 0x3B4D, 0x5EF6, 0x3B4E, 0x3B4E, 0x5637,
- 0x3B4F, 0x3BFF, 0x5F44, 0x3C00, 0x3C6D, 0x5FF5, 0x3C6E, 0x3C6E, 0x5638,
- 0x3C6F, 0x3CDF, 0x6063, 0x3CE0, 0x3CE0, 0x5639, 0x3CE1, 0x3CFF, 0x60D4,
- 0x3D00, 0x3DFF, 0x60F3, 0x3E00, 0x3EFF, 0x61F3, 0x3F00, 0x3FFF, 0x62F3,
- 0x4000, 0x4055, 0x63F3, 0x4056, 0x4056, 0x563E, 0x4057, 0x40FF, 0x6449,
- 0x4100, 0x415E, 0x64F2, 0x415F, 0x415F, 0x563F, 0x4160, 0x41FF, 0x6551,
- 0x4200, 0x42FF, 0x65F1, 0x4300, 0x4336, 0x66F1, 0x4337, 0x4337, 0x5641,
- 0x4338, 0x43AB, 0x6728, 0x43AC, 0x43AC, 0x5647, 0x43AD, 0x43B0, 0x679C,
- 0x43B1, 0x43B1, 0x5646, 0x43B2, 0x43DC, 0x67A0, 0x43DD, 0x43DD, 0x5649,
- 0x43DE, 0x43FF, 0x67CB, 0x4400, 0x44D5, 0x67ED, 0x44D6, 0x44D6, 0x564A,
- 0x44D7, 0x44FF, 0x68C3, 0x4500, 0x45FF, 0x68EC, 0x4600, 0x464B, 0x69EC,
- 0x464C, 0x464C, 0x564C, 0x464D, 0x4660, 0x6A38, 0x4661, 0x4661, 0x564B,
- 0x4662, 0x46FF, 0x6A4C, 0x4700, 0x4722, 0x6AEA, 0x4723, 0x4723, 0x564E,
- 0x4724, 0x4728, 0x6B0D, 0x4729, 0x4729, 0x564F, 0x472A, 0x477B, 0x6B12,
- 0x477C, 0x477C, 0x5650, 0x477D, 0x478C, 0x6B64, 0x478D, 0x478D, 0x5651,
- 0x478E, 0x47FF, 0x6B74, 0x4800, 0x48FF, 0x6BE6, 0x4900, 0x4946, 0x6CE6,
- 0x4947, 0x4947, 0x5653, 0x4948, 0x4979, 0x6D2D, 0x497A, 0x497A, 0x5654,
- 0x497B, 0x497C, 0x6D5F, 0x497D, 0x497D, 0x5655, 0x497E, 0x4981, 0x6D61,
- 0x4982, 0x4983, 0x5656, 0x4984, 0x4984, 0x6D65, 0x4985, 0x4986, 0x5658,
- 0x4987, 0x499A, 0x6D66, 0x499B, 0x499B, 0x565B, 0x499C, 0x499E, 0x6D7A,
- 0x499F, 0x499F, 0x565A, 0x49A0, 0x49B5, 0x6D7D, 0x49B6, 0x49B6, 0x565D,
- 0x49B7, 0x49B7, 0x565C, 0x49B8, 0x49FF, 0x6D93, 0x4A00, 0x4AFF, 0x6DDB,
- 0x4B00, 0x4BFF, 0x6EDB, 0x4C00, 0x4C76, 0x6FDB, 0x4C77, 0x4C77, 0x5664,
- 0x4C78, 0x4C9E, 0x7052, 0x4C9F, 0x4CA1, 0x5661, 0x4CA2, 0x4CA2, 0x5665,
- 0x4CA3, 0x4CA3, 0x5660, 0x4CA4, 0x4CFF, 0x7079, 0x4D00, 0x4D12, 0x70D5,
- 0x4D13, 0x4D19, 0x5666, 0x4D1A, 0x4DAD, 0x70E8, 0x4DAE, 0x4DAE, 0x566D,
- 0x4DAF, 0x4DB5, 0x717C, 0x4E00, 0x4E00, 0x1042, 0x4E01, 0x4E01, 0x05E0,
- 0x4E02, 0x4E02, 0x2758, 0x4E03, 0x4E03, 0x0BFE, 0x4E04, 0x4E06, 0x2759,
- 0x4E07, 0x4E07, 0x0EA3, 0x4E08, 0x4E08, 0x116A, 0x4E09, 0x4E09, 0x0CD8,
- 0x4E0A, 0x4E0A, 0x0D08, 0x4E0B, 0x4E0B, 0x0F2F, 0x4E0C, 0x4E0C, 0x1258,
- 0x4E0D, 0x4E0D, 0x0482, 0x4E0E, 0x4E0E, 0x10D0, 0x4E0F, 0x4E0F, 0x275C,
- 0x4E10, 0x4E10, 0x125A, 0x4E11, 0x4E11, 0x0518, 0x4E12, 0x4E12, 0x275D,
- 0x4E13, 0x4E13, 0x1205, 0x4E14, 0x4E14, 0x0C4F, 0x4E15, 0x4E15, 0x125D,
- 0x4E16, 0x4E16, 0x0D57, 0x4E17, 0x4E17, 0x275E, 0x4E18, 0x4E18, 0x0C6D,
- 0x4E19, 0x4E19, 0x0464, 0x4E1A, 0x4E1A, 0x103C, 0x4E1B, 0x4E1B, 0x0557,
- 0x4E1C, 0x4E1C, 0x05EA, 0x4E1D, 0x4E1D, 0x0DB4, 0x4E1E, 0x4E1E, 0x125F,
- 0x4E1F, 0x4E21, 0x275F, 0x4E22, 0x4E22, 0x05E9, 0x4E23, 0x4E23, 0x2762,
- 0x4E24, 0x4E24, 0x0A06, 0x4E25, 0x4E25, 0x0FF8, 0x4E26, 0x4E26, 0x2763,
- 0x4E27, 0x4E27, 0x0CDE, 0x4E28, 0x4E28, 0x1263, 0x4E29, 0x4E29, 0x2764,
- 0x4E2A, 0x4E2A, 0x06F1, 0x4E2B, 0x4E2B, 0x0FE7, 0x4E2C, 0x4E2C, 0x169C,
- 0x4E2D, 0x4E2D, 0x11CF, 0x4E2E, 0x4E2F, 0x2765, 0x4E30, 0x4E30, 0x067E,
- 0x4E31, 0x4E31, 0x2767, 0x4E32, 0x4E32, 0x0531, 0x4E33, 0x4E33, 0x2768,
- 0x4E34, 0x4E34, 0x0A22, 0x4E35, 0x4E35, 0x2769, 0x4E36, 0x4E36, 0x1272,
- 0x4E37, 0x4E37, 0x276A, 0x4E38, 0x4E38, 0x0E99, 0x4E39, 0x4E39, 0x0585,
- 0x4E3A, 0x4E3A, 0x0EB9, 0x4E3B, 0x4E3B, 0x11F6, 0x4E3C, 0x4E3C, 0x276B,
- 0x4E3D, 0x4E3D, 0x09E1, 0x4E3E, 0x4E3E, 0x0908, 0x4E3F, 0x4E3F, 0x1265,
- 0x4E40, 0x4E42, 0x276C, 0x4E43, 0x4E43, 0x0B2E, 0x4E44, 0x4E44, 0x276F,
- 0x4E45, 0x4E45, 0x08F2, 0x4E46, 0x4E46, 0x2770, 0x4E47, 0x4E47, 0x1267,
- 0x4E48, 0x4E48, 0x0AB9, 0x4E49, 0x4E49, 0x106C, 0x4E4A, 0x4E4A, 0x2771,
- 0x4E4B, 0x4E4B, 0x11AD, 0x4E4C, 0x4E4C, 0x0EE9, 0x4E4D, 0x4E4D, 0x1148,
- 0x4E4E, 0x4E4E, 0x07AC, 0x4E4F, 0x4E4F, 0x0643, 0x4E50, 0x4E50, 0x09C1,
- 0x4E51, 0x4E51, 0x2772, 0x4E52, 0x4E52, 0x0BD8, 0x4E53, 0x4E53, 0x0B93,
- 0x4E54, 0x4E54, 0x0C44, 0x4E55, 0x4E55, 0x2773, 0x4E56, 0x4E56, 0x072D,
- 0x4E57, 0x4E57, 0x2774, 0x4E58, 0x4E58, 0x04F0, 0x4E59, 0x4E59, 0x1059,
- 0x4E5A, 0x4E5B, 0x2775, 0x4E5C, 0x4E5C, 0x1275, 0x4E5D, 0x4E5D, 0x08F4,
- 0x4E5E, 0x4E5E, 0x0C11, 0x4E5F, 0x4E5F, 0x1039, 0x4E60, 0x4E60, 0x0F1D,
- 0x4E61, 0x4E61, 0x0F54, 0x4E62, 0x4E65, 0x2777, 0x4E66, 0x4E66, 0x0D80,
- 0x4E67, 0x4E68, 0x277B, 0x4E69, 0x4E69, 0x1276, 0x4E6A, 0x4E6F, 0x277D,
- 0x4E70, 0x4E70, 0x0A99, 0x4E71, 0x4E71, 0x0A79, 0x4E72, 0x4E72, 0x2783,
- 0x4E73, 0x4E73, 0x0CC4, 0x4E74, 0x4E7D, 0x2784, 0x4E7E, 0x4E7E, 0x0C29,
- 0x4E7F, 0x4E81, 0x278E, 0x4E82, 0x4E82, 0x2059, 0x4E83, 0x4E85, 0x2791,
- 0x4E86, 0x4E86, 0x0A14, 0x4E87, 0x4E87, 0x2794, 0x4E88, 0x4E88, 0x10CD,
- 0x4E89, 0x4E89, 0x119A, 0x4E8A, 0x4E8A, 0x2795, 0x4E8B, 0x4E8B, 0x0D59,
- 0x4E8C, 0x4E8C, 0x063D, 0x4E8D, 0x4E8D, 0x1257, 0x4E8E, 0x4E8E, 0x10BF,
- 0x4E8F, 0x4E8F, 0x0984, 0x4E90, 0x4E90, 0x2796, 0x4E91, 0x4E91, 0x1109,
- 0x4E92, 0x4E92, 0x07BA, 0x4E93, 0x4E93, 0x1277, 0x4E94, 0x4E94, 0x0EF4,
- 0x4E95, 0x4E95, 0x08DD, 0x4E96, 0x4E97, 0x2797, 0x4E98, 0x4E98, 0x125E,
- 0x4E99, 0x4E99, 0x2799, 0x4E9A, 0x4E9A, 0x0FF0, 0x4E9B, 0x4E9B, 0x0F74,
- 0x4E9C, 0x4E9D, 0x279A, 0x4E9E, 0x4E9E, 0x21F1, 0x4E9F, 0x4E9F, 0x1273,
- 0x4EA0, 0x4EA0, 0x1303, 0x4EA1, 0x4EA1, 0x0EA7, 0x4EA2, 0x4EA2, 0x0947,
- 0x4EA3, 0x4EA3, 0x279C, 0x4EA4, 0x4EA4, 0x088C, 0x4EA5, 0x4EA5, 0x075C,
- 0x4EA6, 0x4EA6, 0x1067, 0x4EA7, 0x4EA7, 0x04C1, 0x4EA8, 0x4EA8, 0x0797,
- 0x4EA9, 0x4EA9, 0x0B19, 0x4EAA, 0x4EAA, 0x279D, 0x4EAB, 0x4EAB, 0x0F5A,
- 0x4EAC, 0x4EAC, 0x08D8, 0x4EAD, 0x4EAD, 0x0E55, 0x4EAE, 0x4EAE, 0x0A0A,
- 0x4EAF, 0x4EB1, 0x279E, 0x4EB2, 0x4EB2, 0x0C54, 0x4EB3, 0x4EB3, 0x1305,
- 0x4EB4, 0x4EB4, 0x27A1, 0x4EB5, 0x4EB5, 0x1308, 0x4EB6, 0x4EB9, 0x27A2,
- 0x4EBA, 0x4EBA, 0x0CA6, 0x4EBB, 0x4EBB, 0x129F, 0x4EBC, 0x4EBE, 0x27A6,
- 0x4EBF, 0x4EBF, 0x1061, 0x4EC0, 0x4EC0, 0x0D49, 0x4EC1, 0x4EC1, 0x0CA5,
- 0x4EC2, 0x4EC2, 0x12A2, 0x4EC3, 0x4EC3, 0x12A0, 0x4EC4, 0x4EC4, 0x127C,
- 0x4EC5, 0x4EC5, 0x08C7, 0x4EC6, 0x4EC6, 0x0BEC, 0x4EC7, 0x4EC7, 0x0515,
- 0x4EC8, 0x4EC8, 0x27A9, 0x4EC9, 0x4EC9, 0x12A1, 0x4ECA, 0x4ECA, 0x08C2,
- 0x4ECB, 0x4ECB, 0x08BA, 0x4ECC, 0x4ECC, 0x27AA, 0x4ECD, 0x4ECD, 0x0CAF,
- 0x4ECE, 0x4ECE, 0x0556, 0x4ECF, 0x4ED0, 0x27AB, 0x4ED1, 0x4ED1, 0x0A7F,
- 0x4ED2, 0x4ED2, 0x27AD, 0x4ED3, 0x4ED3, 0x049D, 0x4ED4, 0x4ED4, 0x122D,
- 0x4ED5, 0x4ED5, 0x0D62, 0x4ED6, 0x4ED6, 0x0DF0, 0x4ED7, 0x4ED7, 0x116D,
- 0x4ED8, 0x4ED8, 0x06B1, 0x4ED9, 0x4ED9, 0x0F36, 0x4EDA, 0x4EDC, 0x27AE,
- 0x4EDD, 0x4EDD, 0x12EE, 0x4EDE, 0x4EDE, 0x12A6, 0x4EDF, 0x4EDF, 0x0C27,
- 0x4EE0, 0x4EE0, 0x27B1, 0x4EE1, 0x4EE1, 0x12A4, 0x4EE2, 0x4EE2, 0x27B2,
- 0x4EE3, 0x4EE3, 0x057D, 0x4EE4, 0x4EE4, 0x0A37, 0x4EE5, 0x4EE5, 0x105B,
- 0x4EE6, 0x4EE7, 0x27B3, 0x4EE8, 0x4EE8, 0x12A3, 0x4EE9, 0x4EE9, 0x27B5,
- 0x4EEA, 0x4EEA, 0x104E, 0x4EEB, 0x4EEB, 0x12A5, 0x4EEC, 0x4EEC, 0x0ACC,
- 0x4EED, 0x4EEF, 0x27B6, 0x4EF0, 0x4EF0, 0x101F, 0x4EF1, 0x4EF1, 0x27B9,
- 0x4EF2, 0x4EF2, 0x11D8, 0x4EF3, 0x4EF3, 0x12A8, 0x4EF4, 0x4EF4, 0x27BA,
- 0x4EF5, 0x4EF5, 0x12AB, 0x4EF6, 0x4EF6, 0x0871, 0x4EF7, 0x4EF7, 0x084E,
- 0x4EF8, 0x4EFA, 0x27BB, 0x4EFB, 0x4EFB, 0x0CA9, 0x4EFC, 0x4EFC, 0x27BE,
- 0x4EFD, 0x4EFD, 0x067A, 0x4EFE, 0x4EFE, 0x27BF, 0x4EFF, 0x4EFF, 0x065F,
- 0x4F00, 0x4F00, 0x27C0, 0x4F01, 0x4F01, 0x0C12, 0x4F02, 0x4F08, 0x27C1,
- 0x4F09, 0x4F09, 0x12AE, 0x4F0A, 0x4F0A, 0x1048, 0x4F0B, 0x4F0C, 0x27C8,
- 0x4F0D, 0x4F0D, 0x0EF8, 0x4F0E, 0x4F0E, 0x0832, 0x4F0F, 0x4F0F, 0x0699,
- 0x4F10, 0x4F10, 0x0642, 0x4F11, 0x4F11, 0x0FA8, 0x4F12, 0x4F16, 0x27CA,
- 0x4F17, 0x4F17, 0x11D9, 0x4F18, 0x4F18, 0x10AA, 0x4F19, 0x4F19, 0x0804,
- 0x4F1A, 0x4F1A, 0x07F6, 0x4F1B, 0x4F1B, 0x12A7, 0x4F1C, 0x4F1D, 0x27CF,
- 0x4F1E, 0x4F1E, 0x0CDA, 0x4F1F, 0x4F1F, 0x0EBF, 0x4F20, 0x4F20, 0x052E,
- 0x4F21, 0x4F21, 0x27D1, 0x4F22, 0x4F22, 0x12A9, 0x4F23, 0x4F23, 0x27D2,
- 0x4F24, 0x4F24, 0x0D04, 0x4F25, 0x4F25, 0x12AC, 0x4F26, 0x4F26, 0x0A7E,
- 0x4F27, 0x4F27, 0x12AD, 0x4F28, 0x4F29, 0x27D3, 0x4F2A, 0x4F2A, 0x0EC0,
- 0x4F2B, 0x4F2B, 0x12AF, 0x4F2C, 0x4F2E, 0x27D5, 0x4F2F, 0x4F2F, 0x0475,
- 0x4F30, 0x4F30, 0x0719, 0x4F31, 0x4F31, 0x27D8, 0x4F32, 0x4F32, 0x12B7,
- 0x4F33, 0x4F33, 0x27D9, 0x4F34, 0x4F34, 0x03F4, 0x4F35, 0x4F35, 0x27DA,
- 0x4F36, 0x4F36, 0x0A2F, 0x4F37, 0x4F37, 0x27DB, 0x4F38, 0x4F38, 0x0D25,
- 0x4F39, 0x4F39, 0x27DC, 0x4F3A, 0x4F3A, 0x0DBA, 0x4F3B, 0x4F3B, 0x27DD,
- 0x4F3C, 0x4F3C, 0x0DBB, 0x4F3D, 0x4F3D, 0x12B8, 0x4F3E, 0x4F42, 0x27DE,
- 0x4F43, 0x4F43, 0x05C9, 0x4F44, 0x4F45, 0x27E3, 0x4F46, 0x4F46, 0x058C,
- 0x4F47, 0x4F4C, 0x27E5, 0x4F4D, 0x4F4D, 0x0ECA, 0x4F4E, 0x4F4E, 0x05AE,
- 0x4F4F, 0x4F4F, 0x11FE, 0x4F50, 0x4F50, 0x1251, 0x4F51, 0x4F51, 0x10B8,
- 0x4F52, 0x4F52, 0x27EB, 0x4F53, 0x4F53, 0x0E38, 0x4F54, 0x4F54, 0x27EC,
- 0x4F55, 0x4F55, 0x0785, 0x4F56, 0x4F56, 0x27ED, 0x4F57, 0x4F57, 0x12B6,
- 0x4F58, 0x4F58, 0x12F0, 0x4F59, 0x4F59, 0x10C5, 0x4F5A, 0x4F5A, 0x12B3,
- 0x4F5B, 0x4F5B, 0x068D, 0x4F5C, 0x4F5C, 0x1254, 0x4F5D, 0x4F5D, 0x12B4,
- 0x4F5E, 0x4F5E, 0x12B0, 0x4F5F, 0x4F5F, 0x12B5, 0x4F60, 0x4F60, 0x0B46,
- 0x4F61, 0x4F62, 0x27EE, 0x4F63, 0x4F63, 0x109B, 0x4F64, 0x4F64, 0x12AA,
- 0x4F65, 0x4F65, 0x12F1, 0x4F66, 0x4F66, 0x27F0, 0x4F67, 0x4F67, 0x12B1,
- 0x4F68, 0x4F68, 0x27F1, 0x4F69, 0x4F69, 0x0BA6, 0x4F6A, 0x4F6B, 0x27F2,
- 0x4F6C, 0x4F6C, 0x09BB, 0x4F6D, 0x4F6E, 0x27F4, 0x4F6F, 0x4F6F, 0x1019,
- 0x4F70, 0x4F70, 0x03E6, 0x4F71, 0x4F72, 0x27F6, 0x4F73, 0x4F73, 0x0844,
- 0x4F74, 0x4F74, 0x12BA, 0x4F75, 0x4F75, 0x27F8, 0x4F76, 0x4F76, 0x12B9,
- 0x4F77, 0x4F7A, 0x27F9, 0x4F7B, 0x4F7B, 0x12C0, 0x4F7C, 0x4F7C, 0x12C2,
- 0x4F7D, 0x4F7D, 0x27FD, 0x4F7E, 0x4F7E, 0x12BF, 0x4F7F, 0x4F7F, 0x0D50,
- 0x4F80, 0x4F82, 0x27FE, 0x4F83, 0x4F83, 0x12BD, 0x4F84, 0x4F84, 0x11B5,
- 0x4F85, 0x4F85, 0x2801, 0x4F86, 0x4F86, 0x1FF2, 0x4F87, 0x4F87, 0x2802,
- 0x4F88, 0x4F88, 0x0503, 0x4F89, 0x4F89, 0x12BC, 0x4F8A, 0x4F8A, 0x2803,
- 0x4F8B, 0x4F8B, 0x09E8, 0x4F8C, 0x4F8C, 0x2804, 0x4F8D, 0x4F8D, 0x0D63,
- 0x4F8E, 0x4F8E, 0x2805, 0x4F8F, 0x4F8F, 0x12BE, 0x4F90, 0x4F90, 0x2806,
- 0x4F91, 0x4F91, 0x12BB, 0x4F92, 0x4F93, 0x2807, 0x4F94, 0x4F94, 0x12C4,
- 0x4F95, 0x4F95, 0x2809, 0x4F96, 0x4F96, 0x205D, 0x4F97, 0x4F97, 0x05F0,
- 0x4F98, 0x4F9A, 0x280A, 0x4F9B, 0x4F9B, 0x0702, 0x4F9C, 0x4F9C, 0x280D,
- 0x4F9D, 0x4F9D, 0x1047, 0x4F9E, 0x4F9F, 0x280E, 0x4FA0, 0x4FA0, 0x0F2D,
- 0x4FA1, 0x4FA2, 0x2810, 0x4FA3, 0x4FA3, 0x0A69, 0x4FA4, 0x4FA4, 0x2812,
- 0x4FA5, 0x4FA5, 0x0895, 0x4FA6, 0x4FA6, 0x118D, 0x4FA7, 0x4FA7, 0x04A7,
- 0x4FA8, 0x4FA8, 0x0C45, 0x4FA9, 0x4FA9, 0x0978, 0x4FAA, 0x4FAA, 0x12C1,
- 0x4FAB, 0x4FAB, 0x2813, 0x4FAC, 0x4FAC, 0x12C3, 0x4FAD, 0x4FAD, 0x2814,
- 0x4FAE, 0x4FAE, 0x0EF9, 0x4FAF, 0x4FAF, 0x07A5, 0x4FB0, 0x4FB4, 0x2815,
- 0x4FB5, 0x4FB5, 0x0C53, 0x4FB6, 0x4FBE, 0x281A, 0x4FBF, 0x4FBF, 0x044C,
- 0x4FC0, 0x4FC1, 0x2823, 0x4FC2, 0x4FC2, 0x269C, 0x4FC3, 0x4FC3, 0x055C,
- 0x4FC4, 0x4FC4, 0x062C, 0x4FC5, 0x4FC5, 0x12C8, 0x4FC6, 0x4FC9, 0x2825,
- 0x4FCA, 0x4FCA, 0x092E, 0x4FCB, 0x4FCD, 0x2829, 0x4FCE, 0x4FCE, 0x12F2,
- 0x4FCF, 0x4FCF, 0x0C4B, 0x4FD0, 0x4FD0, 0x09E9, 0x4FD1, 0x4FD1, 0x12CC,
- 0x4FD2, 0x4FD6, 0x282C, 0x4FD7, 0x4FD7, 0x0DCC, 0x4FD8, 0x4FD8, 0x069A,
- 0x4FD9, 0x4FD9, 0x2831, 0x4FDA, 0x4FDA, 0x12C9, 0x4FDB, 0x4FDB, 0x2832,
- 0x4FDC, 0x4FDC, 0x12CB, 0x4FDD, 0x4FDD, 0x040C, 0x4FDE, 0x4FDE, 0x10C6,
- 0x4FDF, 0x4FDF, 0x12CD, 0x4FE0, 0x4FE0, 0x21B5, 0x4FE1, 0x4FE1, 0x0F90,
- 0x4FE2, 0x4FE2, 0x2833, 0x4FE3, 0x4FE3, 0x12CA, 0x4FE4, 0x4FE5, 0x2834,
- 0x4FE6, 0x4FE6, 0x12C5, 0x4FE7, 0x4FE7, 0x2836, 0x4FE8, 0x4FE8, 0x12C6,
- 0x4FE9, 0x4FE9, 0x09F2, 0x4FEA, 0x4FEA, 0x12C7, 0x4FEB, 0x4FEC, 0x2837,
- 0x4FED, 0x4FED, 0x0866, 0x4FEE, 0x4FEE, 0x0FA9, 0x4FEF, 0x4FEF, 0x06A4,
- 0x4FF0, 0x4FF0, 0x2839, 0x4FF1, 0x4FF1, 0x0912, 0x4FF2, 0x4FF2, 0x283A,
- 0x4FF3, 0x4FF3, 0x12D1, 0x4FF4, 0x4FF7, 0x283B, 0x4FF8, 0x4FF8, 0x12CE,
- 0x4FF9, 0x4FF9, 0x283F, 0x4FFA, 0x4FFA, 0x03BE, 0x4FFB, 0x4FFD, 0x2840,
- 0x4FFE, 0x4FFE, 0x12D6, 0x4FFF, 0x4FFF, 0x2843, 0x5000, 0x5000, 0x22CC,
- 0x5001, 0x5005, 0x2844, 0x5006, 0x5006, 0x2016, 0x5007, 0x5008, 0x2849,
- 0x5009, 0x5009, 0x1E62, 0x500A, 0x500A, 0x284B, 0x500B, 0x500B, 0x1F20,
- 0x500C, 0x500C, 0x12D8, 0x500D, 0x500D, 0x041F, 0x500E, 0x500E, 0x284C,
- 0x500F, 0x500F, 0x12D3, 0x5010, 0x5010, 0x284D, 0x5011, 0x5011, 0x207F,
- 0x5012, 0x5012, 0x059A, 0x5013, 0x5013, 0x284E, 0x5014, 0x5014, 0x0922,
- 0x5015, 0x5017, 0x284F, 0x5018, 0x5018, 0x0E1B, 0x5019, 0x5019, 0x07A9,
- 0x501A, 0x501A, 0x1057, 0x501B, 0x501B, 0x2852, 0x501C, 0x501C, 0x12D7,
- 0x501D, 0x501E, 0x2853, 0x501F, 0x501F, 0x08B9, 0x5020, 0x5020, 0x2855,
- 0x5021, 0x5021, 0x04D0, 0x5022, 0x5024, 0x2856, 0x5025, 0x5025, 0x12D9,
- 0x5026, 0x5026, 0x091A, 0x5027, 0x5027, 0x2859, 0x5028, 0x5028, 0x12DA,
- 0x5029, 0x5029, 0x12CF, 0x502A, 0x502A, 0x0B42, 0x502B, 0x502B, 0x205C,
- 0x502C, 0x502C, 0x12D2, 0x502D, 0x502D, 0x12D5, 0x502E, 0x502E, 0x12D4,
- 0x502F, 0x5039, 0x285A, 0x503A, 0x503A, 0x114F, 0x503B, 0x503B, 0x2865,
- 0x503C, 0x503C, 0x11B4, 0x503D, 0x503D, 0x2866, 0x503E, 0x503E, 0x0C60,
- 0x503F, 0x5042, 0x2867, 0x5043, 0x5043, 0x12DC, 0x5044, 0x5046, 0x286B,
- 0x5047, 0x5047, 0x084C, 0x5048, 0x5048, 0x12DE, 0x5049, 0x5049, 0x2194,
- 0x504A, 0x504B, 0x286E, 0x504C, 0x504C, 0x12D0, 0x504D, 0x504D, 0x2870,
- 0x504E, 0x504E, 0x12DF, 0x504F, 0x504F, 0x0BCA, 0x5050, 0x5054, 0x2871,
- 0x5055, 0x5055, 0x12DD, 0x5056, 0x5059, 0x2876, 0x505A, 0x505A, 0x1253,
- 0x505B, 0x505B, 0x287A, 0x505C, 0x505C, 0x0E54, 0x505D, 0x5064, 0x287B,
- 0x5065, 0x5065, 0x0872, 0x5066, 0x506B, 0x2883, 0x506C, 0x506C, 0x12E0,
- 0x506D, 0x5073, 0x2889, 0x5074, 0x5074, 0x1E65, 0x5075, 0x5075, 0x2281,
- 0x5076, 0x5076, 0x0B7D, 0x5077, 0x5077, 0x0E66, 0x5078, 0x507A, 0x2890,
- 0x507B, 0x507B, 0x12E1, 0x507C, 0x507D, 0x2893, 0x507E, 0x507E, 0x12DB,
- 0x507F, 0x507F, 0x04CA, 0x5080, 0x5080, 0x098B, 0x5081, 0x5084, 0x2895,
- 0x5085, 0x5085, 0x06B0, 0x5086, 0x5087, 0x2899, 0x5088, 0x5088, 0x09E7,
- 0x5089, 0x508C, 0x289B, 0x508D, 0x508D, 0x0403, 0x508E, 0x5095, 0x289F,
- 0x5096, 0x5096, 0x22CD, 0x5097, 0x5097, 0x28A7, 0x5098, 0x5098, 0x210A,
- 0x5099, 0x5099, 0x1E3E, 0x509A, 0x50A1, 0x28A8, 0x50A2, 0x50A2, 0x267F,
- 0x50A3, 0x50A3, 0x0579, 0x50A4, 0x50A4, 0x28B0, 0x50A5, 0x50A5, 0x12E2,
- 0x50A6, 0x50A6, 0x28B1, 0x50A7, 0x50A7, 0x12E3, 0x50A8, 0x50A8, 0x0525,
- 0x50A9, 0x50A9, 0x12E4, 0x50AA, 0x50AB, 0x28B2, 0x50AC, 0x50AC, 0x0562,
- 0x50AD, 0x50AD, 0x222E, 0x50AE, 0x50B1, 0x28B4, 0x50B2, 0x50B2, 0x03CC,
- 0x50B3, 0x50B3, 0x1E96, 0x50B4, 0x50B4, 0x22CB, 0x50B5, 0x50B5, 0x226C,
- 0x50B6, 0x50B6, 0x28B8, 0x50B7, 0x50B7, 0x2117, 0x50B8, 0x50B9, 0x28B9,
- 0x50BA, 0x50BA, 0x12E5, 0x50BB, 0x50BB, 0x0CEE, 0x50BC, 0x50BD, 0x28BB,
- 0x50BE, 0x50BE, 0x20E8, 0x50BF, 0x50C1, 0x28BD, 0x50C2, 0x50C2, 0x22D4,
- 0x50C3, 0x50C4, 0x28C0, 0x50C5, 0x50C5, 0x1FB9, 0x50C6, 0x50C8, 0x28C2,
- 0x50C9, 0x50C9, 0x22D8, 0x50CA, 0x50CE, 0x28C5, 0x50CF, 0x50CF, 0x0F5E,
- 0x50D0, 0x50D0, 0x28CA, 0x50D1, 0x50D1, 0x20DF, 0x50D2, 0x50D4, 0x28CB,
- 0x50D5, 0x50D5, 0x20C2, 0x50D6, 0x50D6, 0x12E6, 0x50D7, 0x50D9, 0x28CE,
- 0x50DA, 0x50DA, 0x0A0E, 0x50DB, 0x50DD, 0x28D1, 0x50DE, 0x50DE, 0x2195,
- 0x50DF, 0x50E4, 0x28D4, 0x50E5, 0x50E5, 0x1FAC, 0x50E6, 0x50E6, 0x12EA,
- 0x50E7, 0x50E7, 0x0CE7, 0x50E8, 0x50E8, 0x22D3, 0x50E9, 0x50EB, 0x28DA,
- 0x50EC, 0x50EC, 0x12E9, 0x50ED, 0x50ED, 0x12E8, 0x50EE, 0x50EE, 0x12EB,
- 0x50EF, 0x50F2, 0x28DD, 0x50F3, 0x50F3, 0x0DD0, 0x50F4, 0x50F4, 0x28E1,
- 0x50F5, 0x50F5, 0x087A, 0x50F6, 0x50F8, 0x28E2, 0x50F9, 0x50F9, 0x1F81,
- 0x50FA, 0x50FA, 0x28E5, 0x50FB, 0x50FB, 0x0BC6, 0x50FC, 0x50FF, 0x28E6,
- 0x5100, 0x5100, 0x2210, 0x5101, 0x5101, 0x28EA, 0x5102, 0x5102, 0x22CF,
- 0x5103, 0x5103, 0x28EB, 0x5104, 0x5104, 0x2213, 0x5105, 0x5105, 0x28EC,
- 0x5106, 0x5106, 0x12E7, 0x5107, 0x5107, 0x12EC, 0x5108, 0x5108, 0x1FE4,
- 0x5109, 0x5109, 0x1F90, 0x510A, 0x510A, 0x28ED, 0x510B, 0x510B, 0x12ED,
- 0x510C, 0x510F, 0x28EE, 0x5110, 0x5110, 0x22D6, 0x5111, 0x5111, 0x28F2,
- 0x5112, 0x5112, 0x0CC0, 0x5113, 0x5113, 0x28F3, 0x5114, 0x5114, 0x22D0,
- 0x5115, 0x5115, 0x22CE, 0x5116, 0x5117, 0x28F4, 0x5118, 0x5118, 0x2681,
- 0x5119, 0x511E, 0x28F6, 0x511F, 0x511F, 0x1E76, 0x5120, 0x5120, 0x28FC,
- 0x5121, 0x5121, 0x09C7, 0x5122, 0x5129, 0x28FD, 0x512A, 0x512A, 0x2231,
- 0x512B, 0x5131, 0x2905, 0x5132, 0x5132, 0x1E93, 0x5133, 0x5136, 0x290C,
- 0x5137, 0x5137, 0x22D2, 0x5138, 0x5139, 0x2910, 0x513A, 0x513A, 0x22D7,
- 0x513B, 0x513B, 0x22D5, 0x513C, 0x513C, 0x22D1, 0x513D, 0x513E, 0x2912,
- 0x513F, 0x513F, 0x0638, 0x5140, 0x5140, 0x1259, 0x5141, 0x5141, 0x110D,
- 0x5142, 0x5142, 0x2914, 0x5143, 0x5143, 0x10ED, 0x5144, 0x5144, 0x0FA1,
- 0x5145, 0x5145, 0x0509, 0x5146, 0x5146, 0x1178, 0x5147, 0x5147, 0x2915,
- 0x5148, 0x5148, 0x0F35, 0x5149, 0x5149, 0x073B, 0x514A, 0x514A, 0x2916,
- 0x514B, 0x514B, 0x0958, 0x514C, 0x514C, 0x2917, 0x514D, 0x514D, 0x0AE7,
- 0x514E, 0x5150, 0x2918, 0x5151, 0x5151, 0x0611, 0x5152, 0x5152, 0x1EE5,
- 0x5153, 0x5153, 0x291B, 0x5154, 0x5154, 0x0E74, 0x5155, 0x5155, 0x1302,
- 0x5156, 0x5156, 0x1304, 0x5157, 0x5159, 0x291C, 0x515A, 0x515A, 0x0594,
- 0x515B, 0x515B, 0x291F, 0x515C, 0x515C, 0x05F4, 0x515D, 0x5161, 0x2920,
- 0x5162, 0x5162, 0x08D3, 0x5163, 0x5164, 0x2925, 0x5165, 0x5165, 0x0CC6,
- 0x5166, 0x5167, 0x2927, 0x5168, 0x5168, 0x0C86, 0x5169, 0x5169, 0x2025,
- 0x516A, 0x516A, 0x2929, 0x516B, 0x516B, 0x03D6, 0x516C, 0x516C, 0x0704,
- 0x516D, 0x516D, 0x0A42, 0x516E, 0x516E, 0x12F6, 0x516F, 0x516F, 0x292A,
- 0x5170, 0x5170, 0x09A7, 0x5171, 0x5171, 0x070B, 0x5172, 0x5172, 0x292B,
- 0x5173, 0x5173, 0x0731, 0x5174, 0x5174, 0x0F96, 0x5175, 0x5175, 0x0461,
- 0x5176, 0x5176, 0x0C03, 0x5177, 0x5177, 0x090E, 0x5178, 0x5178, 0x05C5,
- 0x5179, 0x5179, 0x1225, 0x517A, 0x517A, 0x292C, 0x517B, 0x517B, 0x1021,
- 0x517C, 0x517C, 0x0859, 0x517D, 0x517D, 0x0D75, 0x517E, 0x517F, 0x292D,
- 0x5180, 0x5180, 0x0830, 0x5181, 0x5181, 0x12FA, 0x5182, 0x5182, 0x129D,
- 0x5183, 0x5184, 0x292F, 0x5185, 0x5185, 0x0B3D, 0x5186, 0x5187, 0x2931,
- 0x5188, 0x5188, 0x06CF, 0x5189, 0x5189, 0x0C98, 0x518A, 0x518B, 0x2933,
- 0x518C, 0x518C, 0x04A8, 0x518D, 0x518D, 0x111C, 0x518E, 0x5191, 0x2935,
- 0x5192, 0x5192, 0x0AB5, 0x5193, 0x5194, 0x2939, 0x5195, 0x5195, 0x0AE6,
- 0x5196, 0x5196, 0x1314, 0x5197, 0x5197, 0x0CBA, 0x5198, 0x5198, 0x293B,
- 0x5199, 0x5199, 0x0F7F, 0x519A, 0x519A, 0x293C, 0x519B, 0x519B, 0x092B,
- 0x519C, 0x519C, 0x0B6A, 0x519D, 0x519F, 0x293D, 0x51A0, 0x51A0, 0x0733,
- 0x51A1, 0x51A1, 0x2940, 0x51A2, 0x51A2, 0x1315, 0x51A3, 0x51A3, 0x2941,
- 0x51A4, 0x51A4, 0x10EC, 0x51A5, 0x51A5, 0x1316, 0x51A6, 0x51AA, 0x2942,
- 0x51AB, 0x51AB, 0x130F, 0x51AC, 0x51AC, 0x05EB, 0x51AD, 0x51AE, 0x2947,
- 0x51AF, 0x51AF, 0x0688, 0x51B0, 0x51B0, 0x0462, 0x51B1, 0x51B1, 0x1310,
- 0x51B2, 0x51B2, 0x050A, 0x51B3, 0x51B3, 0x0925, 0x51B4, 0x51B4, 0x2949,
- 0x51B5, 0x51B5, 0x0983, 0x51B6, 0x51B6, 0x1038, 0x51B7, 0x51B7, 0x09CF,
- 0x51B8, 0x51BA, 0x294A, 0x51BB, 0x51BB, 0x05F2, 0x51BC, 0x51BC, 0x1312,
- 0x51BD, 0x51BD, 0x1311, 0x51BE, 0x51BF, 0x294D, 0x51C0, 0x51C0, 0x08EA,
- 0x51C1, 0x51C3, 0x294F, 0x51C4, 0x51C4, 0x0BFF, 0x51C5, 0x51C5, 0x2952,
- 0x51C6, 0x51C6, 0x1219, 0x51C7, 0x51C7, 0x1313, 0x51C8, 0x51C8, 0x2953,
- 0x51C9, 0x51C9, 0x0A02, 0x51CA, 0x51CA, 0x2954, 0x51CB, 0x51CB, 0x05D3,
- 0x51CC, 0x51CC, 0x0A31, 0x51CD, 0x51CD, 0x1ECF, 0x51CE, 0x51CE, 0x2955,
- 0x51CF, 0x51CF, 0x0868, 0x51D0, 0x51D0, 0x2956, 0x51D1, 0x51D1, 0x0558,
- 0x51D2, 0x51DA, 0x2957, 0x51DB, 0x51DB, 0x0A26, 0x51DC, 0x51DC, 0x2960,
- 0x51DD, 0x51DD, 0x0B60, 0x51DE, 0x51DF, 0x2961, 0x51E0, 0x51E0, 0x082B,
- 0x51E1, 0x51E1, 0x064F, 0x51E2, 0x51E3, 0x2963, 0x51E4, 0x51E4, 0x068C,
- 0x51E5, 0x51EA, 0x2965, 0x51EB, 0x51EB, 0x1300, 0x51EC, 0x51EC, 0x296B,
- 0x51ED, 0x51ED, 0x0BDD, 0x51EE, 0x51EE, 0x296C, 0x51EF, 0x51EF, 0x093A,
- 0x51F0, 0x51F0, 0x07E0, 0x51F1, 0x51F1, 0x1FD9, 0x51F2, 0x51F2, 0x296D,
- 0x51F3, 0x51F3, 0x05AB, 0x51F4, 0x51F4, 0x296E, 0x51F5, 0x51F5, 0x1399,
- 0x51F6, 0x51F6, 0x0FA2, 0x51F7, 0x51F7, 0x296F, 0x51F8, 0x51F8, 0x0E6A,
- 0x51F9, 0x51F9, 0x03C7, 0x51FA, 0x51FA, 0x051B, 0x51FB, 0x51FB, 0x080C,
- 0x51FC, 0x51FC, 0x139A, 0x51FD, 0x51FD, 0x0766, 0x51FE, 0x51FE, 0x2970,
- 0x51FF, 0x51FF, 0x1127, 0x5200, 0x5200, 0x0597, 0x5201, 0x5201, 0x05D4,
- 0x5202, 0x5202, 0x128C, 0x5203, 0x5203, 0x0CAB, 0x5204, 0x5205, 0x2971,
- 0x5206, 0x5206, 0x0673, 0x5207, 0x5207, 0x0C4D, 0x5208, 0x5208, 0x128D,
- 0x5209, 0x5209, 0x2973, 0x520A, 0x520A, 0x093C, 0x520B, 0x520C, 0x2974,
- 0x520D, 0x520D, 0x138B, 0x520E, 0x520E, 0x128E, 0x520F, 0x5210, 0x2976,
- 0x5211, 0x5211, 0x0F97, 0x5212, 0x5212, 0x07C3, 0x5213, 0x5215, 0x2978,
- 0x5216, 0x5216, 0x196E, 0x5217, 0x5217, 0x0A19, 0x5218, 0x5218, 0x0A3E,
- 0x5219, 0x5219, 0x1135, 0x521A, 0x521A, 0x06D0, 0x521B, 0x521B, 0x0537,
- 0x521C, 0x521C, 0x297B, 0x521D, 0x521D, 0x051A, 0x521E, 0x521F, 0x297C,
- 0x5220, 0x5220, 0x0CF7, 0x5221, 0x5223, 0x297E, 0x5224, 0x5224, 0x0B91,
- 0x5225, 0x5227, 0x2981, 0x5228, 0x5228, 0x0B9A, 0x5229, 0x5229, 0x09E6,
- 0x522A, 0x522A, 0x2984, 0x522B, 0x522B, 0x0459, 0x522C, 0x522C, 0x2985,
- 0x522D, 0x522D, 0x128F, 0x522E, 0x522E, 0x0727, 0x522F, 0x522F, 0x2986,
- 0x5230, 0x5230, 0x059E, 0x5231, 0x5232, 0x2987, 0x5233, 0x5233, 0x1290,
- 0x5234, 0x5235, 0x2989, 0x5236, 0x5236, 0x11C5, 0x5237, 0x5237, 0x0D97,
- 0x5238, 0x5238, 0x0C8A, 0x5239, 0x5239, 0x0CEB, 0x523A, 0x523A, 0x054F,
- 0x523B, 0x523B, 0x0959, 0x523C, 0x523C, 0x298B, 0x523D, 0x523D, 0x074D,
- 0x523E, 0x523E, 0x298C, 0x523F, 0x5240, 0x1291, 0x5241, 0x5241, 0x0626,
- 0x5242, 0x5242, 0x0834, 0x5243, 0x5243, 0x0E3D, 0x5244, 0x5244, 0x22C8,
- 0x5245, 0x5246, 0x298D, 0x5247, 0x5247, 0x2263, 0x5248, 0x5249, 0x298F,
- 0x524A, 0x524A, 0x0F64, 0x524B, 0x524B, 0x2683, 0x524C, 0x524C, 0x1293,
- 0x524D, 0x524D, 0x0C2D, 0x524E, 0x524F, 0x2991, 0x5250, 0x5250, 0x0729,
- 0x5251, 0x5251, 0x0874, 0x5252, 0x5253, 0x2993, 0x5254, 0x5254, 0x0E31,
- 0x5255, 0x5255, 0x2995, 0x5256, 0x5256, 0x0BE9, 0x5257, 0x525A, 0x2996,
- 0x525B, 0x525B, 0x1F17, 0x525C, 0x525C, 0x1296, 0x525D, 0x525D, 0x299A,
- 0x525E, 0x525E, 0x1294, 0x525F, 0x5260, 0x299B, 0x5261, 0x5261, 0x1295,
- 0x5262, 0x5264, 0x299D, 0x5265, 0x5265, 0x0409, 0x5266, 0x5266, 0x29A0,
- 0x5267, 0x5267, 0x0916, 0x5268, 0x5268, 0x29A1, 0x5269, 0x5269, 0x0D3A,
- 0x526A, 0x526A, 0x0867, 0x526B, 0x526D, 0x29A2, 0x526E, 0x526E, 0x1F2B,
- 0x526F, 0x526F, 0x06AC, 0x5270, 0x5271, 0x29A5, 0x5272, 0x5272, 0x06E9,
- 0x5273, 0x5273, 0x29A7, 0x5274, 0x5274, 0x22CA, 0x5275, 0x5275, 0x1E99,
- 0x5276, 0x527C, 0x29A8, 0x527D, 0x527D, 0x1298, 0x527E, 0x527E, 0x29AF,
- 0x527F, 0x527F, 0x089C, 0x5280, 0x5280, 0x29B0, 0x5281, 0x5281, 0x129A,
- 0x5282, 0x5282, 0x1299, 0x5283, 0x5283, 0x1F4F, 0x5284, 0x5286, 0x29B1,
- 0x5287, 0x5287, 0x1FCF, 0x5288, 0x5288, 0x0BBD, 0x5289, 0x5289, 0x2036,
- 0x528A, 0x528A, 0x1F3A, 0x528B, 0x528B, 0x29B4, 0x528C, 0x528C, 0x22C9,
- 0x528D, 0x528D, 0x1F99, 0x528E, 0x528F, 0x29B5, 0x5290, 0x5290, 0x129B,
- 0x5291, 0x5291, 0x1F75, 0x5292, 0x5292, 0x29B7, 0x5293, 0x5293, 0x129C,
- 0x5294, 0x529A, 0x29B8, 0x529B, 0x529B, 0x09EF, 0x529C, 0x529C, 0x29BF,
- 0x529D, 0x529D, 0x0C8B, 0x529E, 0x529E, 0x03F7, 0x529F, 0x529F, 0x06FF,
- 0x52A0, 0x52A0, 0x0846, 0x52A1, 0x52A1, 0x0F00, 0x52A2, 0x52A2, 0x138D,
- 0x52A3, 0x52A3, 0x0A1C, 0x52A4, 0x52A7, 0x29C0, 0x52A8, 0x52A8, 0x05EE,
- 0x52A9, 0x52A9, 0x11F9, 0x52AA, 0x52AA, 0x0B6D, 0x52AB, 0x52AB, 0x08AA,
- 0x52AC, 0x52AD, 0x138E, 0x52AE, 0x52B0, 0x29C4, 0x52B1, 0x52B1, 0x09E3,
- 0x52B2, 0x52B2, 0x08D1, 0x52B3, 0x52B3, 0x09B8, 0x52B4, 0x52BD, 0x29C7,
- 0x52BE, 0x52BE, 0x1390, 0x52BF, 0x52BF, 0x0D5D, 0x52C0, 0x52C0, 0x29D1,
- 0x52C1, 0x52C1, 0x1FBE, 0x52C2, 0x52C2, 0x29D2, 0x52C3, 0x52C3, 0x0471,
- 0x52C4, 0x52C6, 0x29D3, 0x52C7, 0x52C7, 0x10A7, 0x52C8, 0x52C8, 0x29D6,
- 0x52C9, 0x52C9, 0x0AE8, 0x52CA, 0x52CA, 0x29D7, 0x52CB, 0x52CB, 0x0FD4,
- 0x52CC, 0x52CF, 0x29D8, 0x52D0, 0x52D0, 0x1392, 0x52D1, 0x52D1, 0x29DC,
- 0x52D2, 0x52D2, 0x09C0, 0x52D3, 0x52D4, 0x29DD, 0x52D5, 0x52D5, 0x1ECD,
- 0x52D6, 0x52D6, 0x1393, 0x52D7, 0x52D7, 0x29DF, 0x52D8, 0x52D8, 0x093E,
- 0x52D9, 0x52D9, 0x21A9, 0x52DA, 0x52DA, 0x29E0, 0x52DB, 0x52DB, 0x21E6,
- 0x52DC, 0x52DC, 0x29E1, 0x52DD, 0x52DD, 0x2127, 0x52DE, 0x52DE, 0x2003,
- 0x52DF, 0x52DF, 0x0B1F, 0x52E0, 0x52E1, 0x29E2, 0x52E2, 0x52E2, 0x2132,
- 0x52E3, 0x52E3, 0x29E4, 0x52E4, 0x52E4, 0x0C57, 0x52E5, 0x52EF, 0x29E5,
- 0x52F0, 0x52F0, 0x1394, 0x52F1, 0x52F1, 0x2323, 0x52F2, 0x52F4, 0x29F0,
- 0x52F5, 0x52F5, 0x2011, 0x52F6, 0x52F7, 0x29F3, 0x52F8, 0x52F8, 0x20F5,
- 0x52F9, 0x52F9, 0x12FC, 0x52FA, 0x52FA, 0x0D10, 0x52FB, 0x52FD, 0x29F5,
- 0x52FE, 0x52FE, 0x070D, 0x52FF, 0x52FF, 0x0EFF, 0x5300, 0x5300, 0x110B,
- 0x5301, 0x5304, 0x29F8, 0x5305, 0x5305, 0x0407, 0x5306, 0x5306, 0x0555,
- 0x5307, 0x5307, 0x29FC, 0x5308, 0x5308, 0x0FA4, 0x5309, 0x530C, 0x29FD,
- 0x530D, 0x530D, 0x12FD, 0x530E, 0x530E, 0x2A01, 0x530F, 0x530F, 0x14B5,
- 0x5310, 0x5310, 0x12FF, 0x5311, 0x5314, 0x2A02, 0x5315, 0x5315, 0x1266,
- 0x5316, 0x5316, 0x07C4, 0x5317, 0x5317, 0x041A, 0x5318, 0x5318, 0x2A06,
- 0x5319, 0x5319, 0x04FC, 0x531A, 0x531A, 0x1284, 0x531B, 0x531C, 0x2A07,
- 0x531D, 0x531D, 0x1114, 0x531E, 0x531F, 0x2A09, 0x5320, 0x5320, 0x0884,
- 0x5321, 0x5321, 0x097C, 0x5322, 0x5322, 0x2A0B, 0x5323, 0x5323, 0x0F28,
- 0x5324, 0x5325, 0x2A0C, 0x5326, 0x5326, 0x1286, 0x5327, 0x5329, 0x2A0E,
- 0x532A, 0x532A, 0x0668, 0x532B, 0x532C, 0x2A11, 0x532D, 0x532D, 0x22C5,
- 0x532E, 0x532E, 0x1287, 0x532F, 0x532F, 0x1F5E, 0x5330, 0x5330, 0x2A13,
- 0x5331, 0x5331, 0x22C6, 0x5332, 0x5338, 0x2A14, 0x5339, 0x5339, 0x0BC4,
- 0x533A, 0x533A, 0x0C75, 0x533B, 0x533B, 0x1044, 0x533C, 0x533D, 0x2A1B,
- 0x533E, 0x533E, 0x1288, 0x533F, 0x533F, 0x0B47, 0x5340, 0x5340, 0x20EF,
- 0x5341, 0x5341, 0x0D45, 0x5342, 0x5342, 0x2A1D, 0x5343, 0x5343, 0x0C24,
- 0x5344, 0x5344, 0x2A1E, 0x5345, 0x5345, 0x125C, 0x5346, 0x5346, 0x2A1F,
- 0x5347, 0x5347, 0x0D36, 0x5348, 0x5348, 0x0EF6, 0x5349, 0x5349, 0x07F1,
- 0x534A, 0x534A, 0x03F6, 0x534B, 0x534D, 0x2A20, 0x534E, 0x534E, 0x07BF,
- 0x534F, 0x534F, 0x0F78, 0x5350, 0x5350, 0x2A23, 0x5351, 0x5351, 0x0419,
- 0x5352, 0x5352, 0x1241, 0x5353, 0x5353, 0x121C, 0x5354, 0x5354, 0x21D0,
- 0x5355, 0x5355, 0x0586, 0x5356, 0x5356, 0x0A9B, 0x5357, 0x5357, 0x0B32,
- 0x5358, 0x5359, 0x2A24, 0x535A, 0x535A, 0x0470, 0x535B, 0x535B, 0x2A26,
- 0x535C, 0x535C, 0x047E, 0x535D, 0x535D, 0x2A27, 0x535E, 0x535E, 0x044E,
- 0x535F, 0x535F, 0x14FA, 0x5360, 0x5360, 0x115D, 0x5361, 0x5361, 0x0935,
- 0x5362, 0x5362, 0x0A53, 0x5363, 0x5363, 0x128B, 0x5364, 0x5364, 0x0A58,
- 0x5365, 0x5365, 0x2A28, 0x5366, 0x5366, 0x128A, 0x5367, 0x5367, 0x0EE3,
- 0x5368, 0x5368, 0x2A29, 0x5369, 0x5369, 0x1352, 0x536A, 0x536A, 0x2A2A,
- 0x536B, 0x536B, 0x0ECF, 0x536C, 0x536D, 0x2A2B, 0x536E, 0x536E, 0x126A,
- 0x536F, 0x536F, 0x0AB3, 0x5370, 0x5370, 0x1086, 0x5371, 0x5371, 0x0EB2,
- 0x5372, 0x5372, 0x2A2D, 0x5373, 0x5373, 0x0827, 0x5374, 0x5374, 0x0C8F,
- 0x5375, 0x5375, 0x0A78, 0x5376, 0x5376, 0x2A2E, 0x5377, 0x5377, 0x091C,
- 0x5378, 0x5378, 0x0F81, 0x5379, 0x5379, 0x2A2F, 0x537A, 0x537A, 0x1353,
- 0x537B, 0x537E, 0x2A30, 0x537F, 0x537F, 0x0C61, 0x5380, 0x5381, 0x2A34,
- 0x5382, 0x5382, 0x04CC, 0x5383, 0x5383, 0x2A36, 0x5384, 0x5384, 0x0631,
- 0x5385, 0x5385, 0x0E4F, 0x5386, 0x5386, 0x09E5, 0x5387, 0x5388, 0x2A37,
- 0x5389, 0x5389, 0x09E2, 0x538A, 0x538A, 0x2A39, 0x538B, 0x538B, 0x0FE2,
- 0x538C, 0x538C, 0x100A, 0x538D, 0x538D, 0x127D, 0x538E, 0x5394, 0x2A3A,
- 0x5395, 0x5395, 0x04A5, 0x5396, 0x5397, 0x2A41, 0x5398, 0x5398, 0x09D0,
- 0x5399, 0x5399, 0x22C1, 0x539A, 0x539A, 0x07A8, 0x539B, 0x539C, 0x2A43,
- 0x539D, 0x539D, 0x127E, 0x539E, 0x539E, 0x2A45, 0x539F, 0x539F, 0x10F0,
- 0x53A0, 0x53A0, 0x1E64, 0x53A1, 0x53A1, 0x2A46, 0x53A2, 0x53A2, 0x0F4E,
- 0x53A3, 0x53A3, 0x127F, 0x53A4, 0x53A4, 0x2A47, 0x53A5, 0x53A5, 0x1280,
- 0x53A6, 0x53A6, 0x0F30, 0x53A7, 0x53A7, 0x2A48, 0x53A8, 0x53A8, 0x051D,
- 0x53A9, 0x53A9, 0x08F6, 0x53AA, 0x53AC, 0x2A49, 0x53AD, 0x53AD, 0x21F9,
- 0x53AE, 0x53AE, 0x1281, 0x53AF, 0x53B1, 0x2A4C, 0x53B2, 0x53B2, 0x2010,
- 0x53B3, 0x53B3, 0x2A4F, 0x53B4, 0x53B4, 0x22C2, 0x53B5, 0x53B5, 0x2A50,
- 0x53B6, 0x53B6, 0x139C, 0x53B7, 0x53BA, 0x2A51, 0x53BB, 0x53BB, 0x0C80,
- 0x53BC, 0x53BE, 0x2A55, 0x53BF, 0x53BF, 0x0F45, 0x53C0, 0x53C0, 0x2A58,
- 0x53C1, 0x53C1, 0x0CD9, 0x53C2, 0x53C2, 0x0495, 0x53C3, 0x53C3, 0x1E5A,
- 0x53C4, 0x53C7, 0x2A59, 0x53C8, 0x53C8, 0x10BB, 0x53C9, 0x53C9, 0x04AD,
- 0x53CA, 0x53CA, 0x0823, 0x53CB, 0x53CB, 0x10B6, 0x53CC, 0x53CC, 0x0DA0,
- 0x53CD, 0x53CD, 0x0651, 0x53CE, 0x53D0, 0x2A5D, 0x53D1, 0x53D1, 0x063F,
- 0x53D2, 0x53D3, 0x2A60, 0x53D4, 0x53D4, 0x0D7C, 0x53D5, 0x53D5, 0x2A62,
- 0x53D6, 0x53D6, 0x0C7C, 0x53D7, 0x53D7, 0x0D73, 0x53D8, 0x53D8, 0x044D,
- 0x53D9, 0x53D9, 0x0FBB, 0x53DA, 0x53DA, 0x2A63, 0x53DB, 0x53DB, 0x0B92,
- 0x53DC, 0x53DE, 0x2A64, 0x53DF, 0x53DF, 0x1395, 0x53E0, 0x53E0, 0x05DF,
- 0x53E1, 0x53E1, 0x2A67, 0x53E2, 0x53E2, 0x1EA2, 0x53E3, 0x53E3, 0x0967,
- 0x53E4, 0x53E4, 0x071E, 0x53E5, 0x53E5, 0x0913, 0x53E6, 0x53E6, 0x0A36,
- 0x53E7, 0x53E7, 0x2A68, 0x53E8, 0x53E8, 0x14FE, 0x53E9, 0x53E9, 0x14FD,
- 0x53EA, 0x53EA, 0x11BA, 0x53EB, 0x53EB, 0x08A1, 0x53EC, 0x53EC, 0x117A,
- 0x53ED, 0x53ED, 0x03D3, 0x53EE, 0x53EE, 0x05E2, 0x53EF, 0x53EF, 0x0956,
- 0x53F0, 0x53F0, 0x0DFB, 0x53F1, 0x53F1, 0x14FB, 0x53F2, 0x53F2, 0x0D4E,
- 0x53F3, 0x53F3, 0x10B7, 0x53F4, 0x53F4, 0x2A69, 0x53F5, 0x53F5, 0x1285,
- 0x53F6, 0x53F6, 0x103D, 0x53F7, 0x53F7, 0x077C, 0x53F8, 0x53F8, 0x0DB3,
- 0x53F9, 0x53F9, 0x0E11, 0x53FA, 0x53FA, 0x2A6A, 0x53FB, 0x53FB, 0x14FF,
- 0x53FC, 0x53FC, 0x05D1, 0x53FD, 0x53FD, 0x14FC, 0x53FE, 0x53FF, 0x2A6B,
- 0x5400, 0x5400, 0x2A6D, 0x5401, 0x5401, 0x10DA, 0x5402, 0x5402, 0x2A6E,
- 0x5403, 0x5403, 0x04F9, 0x5404, 0x5404, 0x06F2, 0x5405, 0x5405, 0x2A6F,
- 0x5406, 0x5406, 0x1502, 0x5407, 0x5407, 0x2A70, 0x5408, 0x5408, 0x0786,
- 0x5409, 0x5409, 0x081D, 0x540A, 0x540A, 0x05D6, 0x540B, 0x540B, 0x2A71,
- 0x540C, 0x540C, 0x0E5D, 0x540D, 0x540D, 0x0B00, 0x540E, 0x540E, 0x07AA,
- 0x540F, 0x540F, 0x09DF, 0x5410, 0x5410, 0x0E73, 0x5411, 0x5411, 0x0F5F,
- 0x5412, 0x5412, 0x1500, 0x5413, 0x5413, 0x0F32, 0x5414, 0x5414, 0x2A72,
- 0x5415, 0x5415, 0x0A67, 0x5416, 0x5416, 0x1501, 0x5417, 0x5417, 0x0A97,
- 0x5418, 0x541A, 0x2A73, 0x541B, 0x541B, 0x092C, 0x541C, 0x541C, 0x2A76,
- 0x541D, 0x541D, 0x0A28, 0x541E, 0x541E, 0x0E7D, 0x541F, 0x541F, 0x107E,
- 0x5420, 0x5420, 0x066A, 0x5421, 0x5421, 0x1509, 0x5422, 0x5422, 0x2A77,
- 0x5423, 0x5423, 0x150C, 0x5424, 0x5425, 0x2A78, 0x5426, 0x5426, 0x068E,
- 0x5427, 0x5427, 0x03D4, 0x5428, 0x5428, 0x0615, 0x5429, 0x5429, 0x0671,
- 0x542A, 0x542A, 0x2A7A, 0x542B, 0x542B, 0x0763, 0x542C, 0x542C, 0x0E50,
- 0x542D, 0x542D, 0x0961, 0x542E, 0x542E, 0x0DA6, 0x542F, 0x542F, 0x0C13,
- 0x5430, 0x5430, 0x2A7B, 0x5431, 0x5431, 0x11A7, 0x5432, 0x5432, 0x150D,
- 0x5433, 0x5433, 0x2A7C, 0x5434, 0x5434, 0x0EF1, 0x5435, 0x5435, 0x04D8,
- 0x5436, 0x5437, 0x2A7D, 0x5438, 0x5438, 0x0F0B, 0x5439, 0x5439, 0x0538,
- 0x543A, 0x543A, 0x2A7F, 0x543B, 0x543B, 0x0ED6, 0x543C, 0x543C, 0x07A7,
- 0x543D, 0x543D, 0x2A80, 0x543E, 0x543E, 0x0EF0, 0x543F, 0x543F, 0x2A81,
- 0x5440, 0x5440, 0x0FE6, 0x5441, 0x5442, 0x2A82, 0x5443, 0x5443, 0x1508,
- 0x5444, 0x5445, 0x2A84, 0x5446, 0x5446, 0x0577, 0x5447, 0x5447, 0x2A86,
- 0x5448, 0x5448, 0x04EF, 0x5449, 0x5449, 0x2A87, 0x544A, 0x544A, 0x06E1,
- 0x544B, 0x544B, 0x1503, 0x544C, 0x544F, 0x2A88, 0x5450, 0x5450, 0x0B28,
- 0x5451, 0x5451, 0x2A8C, 0x5452, 0x5454, 0x1504, 0x5455, 0x5455, 0x0B7C,
- 0x5456, 0x5456, 0x1507, 0x5457, 0x5457, 0x150A, 0x5458, 0x5458, 0x10F4,
- 0x5459, 0x5459, 0x150B, 0x545A, 0x545A, 0x2A8D, 0x545B, 0x545B, 0x0C37,
- 0x545C, 0x545C, 0x0EE7, 0x545D, 0x5461, 0x2A8E, 0x5462, 0x5462, 0x0B3B,
- 0x5463, 0x5463, 0x2A93, 0x5464, 0x5464, 0x1512, 0x5465, 0x5465, 0x2A94,
- 0x5466, 0x5466, 0x1517, 0x5467, 0x5467, 0x2A95, 0x5468, 0x5468, 0x11DB,
- 0x5469, 0x5470, 0x2A96, 0x5471, 0x5471, 0x1511, 0x5472, 0x5472, 0x1522,
- 0x5473, 0x5473, 0x0EC5, 0x5474, 0x5474, 0x2A9E, 0x5475, 0x5475, 0x077E,
- 0x5476, 0x5476, 0x1516, 0x5477, 0x5477, 0x1510, 0x5478, 0x5478, 0x0B9F,
- 0x5479, 0x547A, 0x2A9F, 0x547B, 0x547B, 0x0D24, 0x547C, 0x547C, 0x07AB,
- 0x547D, 0x547D, 0x0B01, 0x547E, 0x547F, 0x2AA1, 0x5480, 0x5480, 0x0906,
- 0x5481, 0x5481, 0x2AA3, 0x5482, 0x5482, 0x150E, 0x5483, 0x5483, 0x2AA4,
- 0x5484, 0x5484, 0x1515, 0x5485, 0x5485, 0x2AA5, 0x5486, 0x5486, 0x0B99,
- 0x5487, 0x548A, 0x2AA6, 0x548B, 0x548B, 0x1147, 0x548C, 0x548C, 0x0784,
- 0x548D, 0x548D, 0x2AAA, 0x548E, 0x548E, 0x08FB, 0x548F, 0x548F, 0x10A2,
- 0x5490, 0x5490, 0x06BB, 0x5491, 0x5491, 0x2AAB, 0x5492, 0x5492, 0x11E3,
- 0x5493, 0x5493, 0x2AAC, 0x5494, 0x5494, 0x150F, 0x5495, 0x5495, 0x0717,
- 0x5496, 0x5496, 0x0934, 0x5497, 0x5498, 0x2AAD, 0x5499, 0x5499, 0x0A45,
- 0x549A, 0x549B, 0x1513, 0x549C, 0x549C, 0x2AAF, 0x549D, 0x549D, 0x1518,
- 0x549E, 0x54A2, 0x2AB0, 0x54A3, 0x54A3, 0x1523, 0x54A4, 0x54A4, 0x152D,
- 0x54A5, 0x54A5, 0x2AB5, 0x54A6, 0x54A6, 0x151F, 0x54A7, 0x54A7, 0x151E,
- 0x54A8, 0x54A8, 0x1226, 0x54A9, 0x54AA, 0x152B, 0x54AB, 0x54AB, 0x1767,
- 0x54AC, 0x54AC, 0x102E, 0x54AD, 0x54AD, 0x151A, 0x54AE, 0x54AE, 0x2AB6,
- 0x54AF, 0x54AF, 0x0936, 0x54B0, 0x54B0, 0x2AB7, 0x54B1, 0x54B1, 0x111E,
- 0x54B2, 0x54B2, 0x2AB8, 0x54B3, 0x54B3, 0x0955, 0x54B4, 0x54B4, 0x151C,
- 0x54B5, 0x54B7, 0x2AB9, 0x54B8, 0x54B8, 0x0F39, 0x54B9, 0x54BA, 0x2ABC,
- 0x54BB, 0x54BB, 0x1525, 0x54BC, 0x54BC, 0x236D, 0x54BD, 0x54BD, 0x0FF3,
- 0x54BE, 0x54BE, 0x2ABE, 0x54BF, 0x54BF, 0x1526, 0x54C0, 0x54C0, 0x03B2,
- 0x54C1, 0x54C1, 0x0BD6, 0x54C2, 0x54C2, 0x151B, 0x54C3, 0x54C3, 0x2ABF,
- 0x54C4, 0x54C4, 0x079C, 0x54C5, 0x54C5, 0x2AC0, 0x54C6, 0x54C6, 0x061E,
- 0x54C7, 0x54C7, 0x0E8C, 0x54C8, 0x54C8, 0x0757, 0x54C9, 0x54C9, 0x1118,
- 0x54CA, 0x54CB, 0x2AC1, 0x54CC, 0x54CC, 0x1527, 0x54CD, 0x54CD, 0x0F59,
- 0x54CE, 0x54CE, 0x03B0, 0x54CF, 0x54CF, 0x152F, 0x54D0, 0x54D0, 0x1519,
- 0x54D1, 0x54D1, 0x0FEF, 0x54D2, 0x54D2, 0x151D, 0x54D3, 0x54D4, 0x1520,
- 0x54D5, 0x54D5, 0x1524, 0x54D6, 0x54D6, 0x2AC3, 0x54D7, 0x54D7, 0x07BE,
- 0x54D8, 0x54D8, 0x2AC4, 0x54D9, 0x54DA, 0x1528, 0x54DB, 0x54DB, 0x2AC5,
- 0x54DC, 0x54DC, 0x152A, 0x54DD, 0x54DD, 0x152E, 0x54DE, 0x54DE, 0x1530,
- 0x54DF, 0x54DF, 0x1099, 0x54E0, 0x54E0, 0x2AC6, 0x54E1, 0x54E1, 0x2247,
- 0x54E2, 0x54E4, 0x2AC7, 0x54E5, 0x54E5, 0x06E2, 0x54E6, 0x54E6, 0x0B77,
- 0x54E7, 0x54E7, 0x1532, 0x54E8, 0x54E8, 0x0D13, 0x54E9, 0x54E9, 0x09F1,
- 0x54EA, 0x54EA, 0x0B27, 0x54EB, 0x54EC, 0x2ACA, 0x54ED, 0x54ED, 0x096B,
- 0x54EE, 0x54EE, 0x0F65, 0x54EF, 0x54F1, 0x2ACC, 0x54F2, 0x54F2, 0x117D,
- 0x54F3, 0x54F3, 0x1536, 0x54F4, 0x54F9, 0x2ACF, 0x54FA, 0x54FA, 0x047F,
- 0x54FB, 0x54FB, 0x2AD5, 0x54FC, 0x54FC, 0x0796, 0x54FD, 0x54FD, 0x1534,
- 0x54FE, 0x54FE, 0x2AD6, 0x54FF, 0x54FF, 0x1391, 0x5500, 0x5500, 0x2AD7,
- 0x5501, 0x5501, 0x100D, 0x5502, 0x5503, 0x2AD8, 0x5504, 0x5504, 0x236C,
- 0x5505, 0x5505, 0x2ADA, 0x5506, 0x5506, 0x0DE9, 0x5507, 0x5507, 0x0540,
- 0x5508, 0x5508, 0x2ADB, 0x5509, 0x5509, 0x03B1, 0x550A, 0x550E, 0x2ADC,
- 0x550F, 0x550F, 0x1539, 0x5510, 0x5510, 0x0E19, 0x5511, 0x5511, 0x153A,
- 0x5512, 0x5513, 0x2AE1, 0x5514, 0x5514, 0x1535, 0x5515, 0x551A, 0x2AE3,
- 0x551B, 0x551B, 0x1531, 0x551C, 0x551F, 0x2AE9, 0x5520, 0x5520, 0x1533,
- 0x5521, 0x5521, 0x2AED, 0x5522, 0x5523, 0x1537, 0x5524, 0x5524, 0x07D2,
- 0x5525, 0x5526, 0x2AEE, 0x5527, 0x5527, 0x153B, 0x5528, 0x5529, 0x2AF0,
- 0x552A, 0x552A, 0x153C, 0x552B, 0x552B, 0x2AF2, 0x552C, 0x552C, 0x07B8,
- 0x552D, 0x552D, 0x2AF3, 0x552E, 0x552E, 0x0D72, 0x552F, 0x552F, 0x0EB7,
- 0x5530, 0x5530, 0x154D, 0x5531, 0x5531, 0x04CF, 0x5532, 0x5532, 0x2AF4,
- 0x5533, 0x5533, 0x154C, 0x5534, 0x5536, 0x2AF5, 0x5537, 0x5537, 0x1547,
- 0x5538, 0x553B, 0x2AF8, 0x553C, 0x553C, 0x1546, 0x553D, 0x553D, 0x2AFC,
- 0x553E, 0x553E, 0x0E8A, 0x553F, 0x553F, 0x1544, 0x5540, 0x5540, 0x2AFD,
- 0x5541, 0x5541, 0x1542, 0x5542, 0x5542, 0x2AFE, 0x5543, 0x5543, 0x095D,
- 0x5544, 0x5544, 0x1221, 0x5545, 0x5545, 0x2AFF, 0x5546, 0x5546, 0x0D05,
- 0x5547, 0x5548, 0x2B00, 0x5549, 0x5549, 0x1540, 0x554A, 0x554A, 0x03AC,
- 0x554B, 0x554E, 0x2B02, 0x554F, 0x554F, 0x219C, 0x5550, 0x5550, 0x1545,
- 0x5551, 0x5552, 0x2B06, 0x5553, 0x5553, 0x20C9, 0x5554, 0x5554, 0x2B08,
- 0x5555, 0x5555, 0x1543, 0x5556, 0x5556, 0x1548, 0x5557, 0x555B, 0x2B09,
- 0x555C, 0x555C, 0x154E, 0x555D, 0x555D, 0x2B0E, 0x555E, 0x555E, 0x21F0,
- 0x555F, 0x5560, 0x2B0F, 0x5561, 0x5561, 0x0665, 0x5562, 0x5563, 0x2B11,
- 0x5564, 0x5564, 0x0BC0, 0x5565, 0x5565, 0x0CEF, 0x5566, 0x5566, 0x099D,
- 0x5567, 0x5567, 0x153D, 0x5568, 0x5569, 0x2B13, 0x556A, 0x556A, 0x0B7F,
- 0x556B, 0x556B, 0x2B15, 0x556C, 0x556C, 0x127A, 0x556D, 0x556D, 0x1541,
- 0x556E, 0x556E, 0x0B59, 0x556F, 0x5574, 0x2B16, 0x5575, 0x5577, 0x1549,
- 0x5578, 0x5578, 0x0F70, 0x5579, 0x557A, 0x2B1C, 0x557B, 0x557B, 0x155A,
- 0x557C, 0x557C, 0x0E37, 0x557D, 0x557D, 0x2B1E, 0x557E, 0x557E, 0x1557,
- 0x557F, 0x557F, 0x2B1F, 0x5580, 0x5580, 0x0933, 0x5581, 0x5581, 0x1555,
- 0x5582, 0x5582, 0x0EC8, 0x5583, 0x5583, 0x1551, 0x5584, 0x5584, 0x0CFF,
- 0x5585, 0x5586, 0x2B20, 0x5587, 0x5587, 0x0999, 0x5588, 0x5588, 0x1554,
- 0x5589, 0x5589, 0x07A4, 0x558A, 0x558A, 0x0767, 0x558B, 0x558B, 0x154F,
- 0x558C, 0x558E, 0x2B22, 0x558F, 0x558F, 0x153E, 0x5590, 0x5590, 0x2B25,
- 0x5591, 0x5591, 0x1559, 0x5592, 0x5593, 0x2B26, 0x5594, 0x5594, 0x155E,
- 0x5595, 0x5597, 0x2B28, 0x5598, 0x5598, 0x0530, 0x5599, 0x5599, 0x155F,
- 0x559A, 0x559B, 0x2B2B, 0x559C, 0x559C, 0x0F1F, 0x559D, 0x559D, 0x077F,
- 0x559E, 0x559E, 0x2B2D, 0x559F, 0x559F, 0x1556, 0x55A0, 0x55A6, 0x2B2E,
- 0x55A7, 0x55A7, 0x0FC5, 0x55A8, 0x55A9, 0x2B35, 0x55AA, 0x55AA, 0x210B,
- 0x55AB, 0x55AB, 0x2B37, 0x55AC, 0x55AC, 0x20DE, 0x55AD, 0x55AD, 0x2B38,
- 0x55AE, 0x55AE, 0x1EAA, 0x55AF, 0x55B0, 0x2B39, 0x55B1, 0x55B1, 0x1552,
- 0x55B2, 0x55B2, 0x222C, 0x55B3, 0x55B3, 0x113E, 0x55B4, 0x55B4, 0x2B3B,
- 0x55B5, 0x55B5, 0x153F, 0x55B6, 0x55B6, 0x2B3C, 0x55B7, 0x55B7, 0x0BA8,
- 0x55B8, 0x55B8, 0x2B3D, 0x55B9, 0x55B9, 0x1553, 0x55BA, 0x55BA, 0x2B3E,
- 0x55BB, 0x55BB, 0x10DC, 0x55BC, 0x55BC, 0x2B3F, 0x55BD, 0x55BE, 0x155C,
- 0x55BF, 0x55C3, 0x2B40, 0x55C4, 0x55C4, 0x156A, 0x55C5, 0x55C5, 0x0FAC,
- 0x55C6, 0x55C6, 0x20D8, 0x55C7, 0x55C7, 0x22C0, 0x55C8, 0x55C8, 0x2B45,
- 0x55C9, 0x55C9, 0x1562, 0x55CA, 0x55CB, 0x2B46, 0x55CC, 0x55CD, 0x156F,
- 0x55CE, 0x55CE, 0x206F, 0x55CF, 0x55D0, 0x2B48, 0x55D1, 0x55D1, 0x1564,
- 0x55D2, 0x55D2, 0x1550, 0x55D3, 0x55D3, 0x0CDD, 0x55D4, 0x55D4, 0x1567,
- 0x55D5, 0x55D5, 0x2B4A, 0x55D6, 0x55D6, 0x1558, 0x55D7, 0x55D9, 0x2B4B,
- 0x55DA, 0x55DA, 0x21A1, 0x55DB, 0x55DB, 0x2B4E, 0x55DC, 0x55DC, 0x0D5F,
- 0x55DD, 0x55DD, 0x1569, 0x55DE, 0x55DE, 0x2B4F, 0x55DF, 0x55DF, 0x155B,
- 0x55E0, 0x55E0, 0x2B50, 0x55E1, 0x55E1, 0x0EDA, 0x55E2, 0x55E2, 0x2B51,
- 0x55E3, 0x55E3, 0x0DB8, 0x55E4, 0x55E4, 0x1573, 0x55E5, 0x55E5, 0x156C,
- 0x55E6, 0x55E6, 0x1568, 0x55E7, 0x55E7, 0x2B52, 0x55E8, 0x55E8, 0x1571,
- 0x55E9, 0x55E9, 0x2379, 0x55EA, 0x55EA, 0x1560, 0x55EB, 0x55EC, 0x1565,
- 0x55ED, 0x55EE, 0x2B53, 0x55EF, 0x55EF, 0x156B, 0x55F0, 0x55F1, 0x2B55,
- 0x55F2, 0x55F3, 0x156D, 0x55F4, 0x55F4, 0x2B57, 0x55F5, 0x55F5, 0x1572,
- 0x55F6, 0x55F6, 0x2372, 0x55F7, 0x55F7, 0x1561, 0x55F8, 0x55FC, 0x2B58,
- 0x55FD, 0x55FD, 0x0DC9, 0x55FE, 0x55FE, 0x157B, 0x55FF, 0x55FF, 0x2B5D,
- 0x5600, 0x5600, 0x157C, 0x5601, 0x5601, 0x1578, 0x5602, 0x5605, 0x2B5E,
- 0x5606, 0x5606, 0x216A, 0x5607, 0x5607, 0x2B62, 0x5608, 0x5608, 0x1576,
- 0x5609, 0x5609, 0x0841, 0x560A, 0x560B, 0x2B63, 0x560C, 0x560C, 0x1577,
- 0x560D, 0x560D, 0x237C, 0x560E, 0x560E, 0x06BD, 0x560F, 0x560F, 0x127B,
- 0x5610, 0x5613, 0x2B65, 0x5614, 0x5614, 0x20B0, 0x5615, 0x5615, 0x2B69,
- 0x5616, 0x5616, 0x237A, 0x5617, 0x5617, 0x1E74, 0x5618, 0x5618, 0x0FB5,
- 0x5619, 0x561A, 0x2B6A, 0x561B, 0x561B, 0x0A96, 0x561C, 0x561C, 0x2377,
- 0x561D, 0x561D, 0x2B6C, 0x561E, 0x561E, 0x1575, 0x561F, 0x561F, 0x1563,
- 0x5620, 0x5622, 0x2B6D, 0x5623, 0x5623, 0x157A, 0x5624, 0x5624, 0x1579,
- 0x5625, 0x5626, 0x2B70, 0x5627, 0x5627, 0x157D, 0x5628, 0x5628, 0x2B72,
- 0x5629, 0x5629, 0x1F4C, 0x562A, 0x562B, 0x2B73, 0x562C, 0x562C, 0x1582,
- 0x562D, 0x562D, 0x157E, 0x562E, 0x562E, 0x2378, 0x562F, 0x562F, 0x21CF,
- 0x5630, 0x5630, 0x2368, 0x5631, 0x5631, 0x11F5, 0x5632, 0x5632, 0x04D5,
- 0x5633, 0x5633, 0x2B75, 0x5634, 0x5634, 0x1249, 0x5635, 0x5635, 0x2371,
- 0x5636, 0x5636, 0x0DB0, 0x5637, 0x5637, 0x2B76, 0x5638, 0x5638, 0x2369,
- 0x5639, 0x5639, 0x1580, 0x563A, 0x563A, 0x2B77, 0x563B, 0x563B, 0x0F0A,
- 0x563C, 0x563E, 0x2B78, 0x563F, 0x563F, 0x0790, 0x5640, 0x5640, 0x2B7B,
- 0x5641, 0x5641, 0x2674, 0x5642, 0x564B, 0x2B7C, 0x564C, 0x564C, 0x1587,
- 0x564D, 0x564D, 0x1583, 0x564E, 0x564E, 0x1034, 0x564F, 0x5653, 0x2B86,
- 0x5654, 0x5654, 0x1588, 0x5655, 0x5656, 0x2B8B, 0x5657, 0x5657, 0x1581,
- 0x5658, 0x5658, 0x157F, 0x5659, 0x5659, 0x1585, 0x565A, 0x565B, 0x2B8D,
- 0x565C, 0x565C, 0x1586, 0x565D, 0x565D, 0x236F, 0x565E, 0x565F, 0x2B8F,
- 0x5660, 0x5660, 0x2370, 0x5661, 0x5661, 0x2B91, 0x5662, 0x5662, 0x1584,
- 0x5663, 0x5663, 0x2B92, 0x5664, 0x5664, 0x158A, 0x5665, 0x5665, 0x2376,
- 0x5666, 0x5666, 0x2373, 0x5667, 0x5667, 0x2B93, 0x5668, 0x5668, 0x0C16,
- 0x5669, 0x5669, 0x1262, 0x566A, 0x566A, 0x112E, 0x566B, 0x566B, 0x158C,
- 0x566C, 0x566C, 0x0D60, 0x566D, 0x566E, 0x2B94, 0x566F, 0x566F, 0x237F,
- 0x5670, 0x5670, 0x2B96, 0x5671, 0x5671, 0x158B, 0x5672, 0x5672, 0x2374,
- 0x5673, 0x5673, 0x2B97, 0x5674, 0x5674, 0x20B5, 0x5675, 0x5675, 0x2B98,
- 0x5676, 0x5676, 0x06BC, 0x5677, 0x5677, 0x2B99, 0x5678, 0x5678, 0x1EDB,
- 0x5679, 0x5679, 0x2672, 0x567A, 0x567A, 0x2B9A, 0x567B, 0x567C, 0x158D,
- 0x567D, 0x567F, 0x2B9B, 0x5680, 0x5680, 0x236E, 0x5681, 0x5684, 0x2B9E,
- 0x5685, 0x5685, 0x158F, 0x5686, 0x5686, 0x1589, 0x5687, 0x5687, 0x21B7,
- 0x5688, 0x568B, 0x2BA2, 0x568C, 0x568C, 0x2375, 0x568D, 0x568D, 0x2BA6,
- 0x568E, 0x568E, 0x0776, 0x568F, 0x568F, 0x0E3A, 0x5690, 0x5692, 0x2BA7,
- 0x5693, 0x5693, 0x1590, 0x5694, 0x5694, 0x2BAA, 0x5695, 0x5695, 0x2382,
- 0x5696, 0x5698, 0x2BAB, 0x5699, 0x5699, 0x209E, 0x569A, 0x56A2, 0x2BAE,
- 0x56A3, 0x56A3, 0x0F66, 0x56A4, 0x56A5, 0x2BB7, 0x56A6, 0x56A6, 0x236B,
- 0x56A7, 0x56A7, 0x2BB9, 0x56A8, 0x56A8, 0x2039, 0x56A9, 0x56AD, 0x2BBA,
- 0x56AE, 0x56AE, 0x269F, 0x56AF, 0x56AF, 0x1591, 0x56B0, 0x56B2, 0x2BBF,
- 0x56B3, 0x56B3, 0x237D, 0x56B4, 0x56B4, 0x21F5, 0x56B5, 0x56B5, 0x2BC2,
- 0x56B6, 0x56B6, 0x2381, 0x56B7, 0x56B7, 0x0C9D, 0x56B8, 0x56BB, 0x2BC3,
- 0x56BC, 0x56BC, 0x0891, 0x56BD, 0x56BF, 0x2BC7, 0x56C0, 0x56C0, 0x237B,
- 0x56C1, 0x56C1, 0x237E, 0x56C2, 0x56C2, 0x21CC, 0x56C3, 0x56C4, 0x2BCA,
- 0x56C5, 0x56C5, 0x22DB, 0x56C6, 0x56C7, 0x2BCC, 0x56C8, 0x56C8, 0x236A,
- 0x56C9, 0x56C9, 0x2689, 0x56CA, 0x56CA, 0x0B35, 0x56CB, 0x56CB, 0x2BCE,
- 0x56CC, 0x56CC, 0x2697, 0x56CD, 0x56D0, 0x2BCF, 0x56D1, 0x56D1, 0x22A1,
- 0x56D2, 0x56D3, 0x2BD3, 0x56D4, 0x56D4, 0x1592, 0x56D5, 0x56D6, 0x2BD5,
- 0x56D7, 0x56D7, 0x1593, 0x56D8, 0x56D9, 0x2BD7, 0x56DA, 0x56DA, 0x0C71,
- 0x56DB, 0x56DB, 0x0DB9, 0x56DC, 0x56DC, 0x2BD9, 0x56DD, 0x56DD, 0x1594,
- 0x56DE, 0x56DE, 0x07ED, 0x56DF, 0x56DF, 0x126C, 0x56E0, 0x56E0, 0x1079,
- 0x56E1, 0x56E1, 0x1595, 0x56E2, 0x56E2, 0x0E76, 0x56E3, 0x56E3, 0x2BDA,
- 0x56E4, 0x56E4, 0x0619, 0x56E5, 0x56EA, 0x2BDB, 0x56EB, 0x56EB, 0x1597,
- 0x56EC, 0x56EC, 0x2BE1, 0x56ED, 0x56ED, 0x10F3, 0x56EE, 0x56EF, 0x2BE2,
- 0x56F0, 0x56F0, 0x0992, 0x56F1, 0x56F1, 0x0554, 0x56F2, 0x56F3, 0x2BE4,
- 0x56F4, 0x56F4, 0x0EB6, 0x56F5, 0x56F5, 0x1596, 0x56F6, 0x56F8, 0x2BE6,
- 0x56F9, 0x56F9, 0x1598, 0x56FA, 0x56FA, 0x0725, 0x56FB, 0x56FC, 0x2BE9,
- 0x56FD, 0x56FD, 0x0753, 0x56FE, 0x56FE, 0x0E6D, 0x56FF, 0x56FF, 0x1599,
- 0x5700, 0x5702, 0x2BEB, 0x5703, 0x5703, 0x0BF3, 0x5704, 0x5704, 0x159A,
- 0x5705, 0x5705, 0x2BEE, 0x5706, 0x5706, 0x10F5, 0x5707, 0x5707, 0x2383,
- 0x5708, 0x5708, 0x0C81, 0x5709, 0x5709, 0x159C, 0x570A, 0x570A, 0x159B,
- 0x570B, 0x570B, 0x1F3D, 0x570C, 0x570C, 0x2BEF, 0x570D, 0x570D, 0x218F,
- 0x570E, 0x5711, 0x2BF0, 0x5712, 0x5712, 0x2246, 0x5713, 0x5713, 0x2248,
- 0x5714, 0x5715, 0x2BF4, 0x5716, 0x5716, 0x217E, 0x5717, 0x5717, 0x2BF6,
- 0x5718, 0x5718, 0x2180, 0x5719, 0x571B, 0x2BF7, 0x571C, 0x571C, 0x159D,
- 0x571D, 0x571E, 0x2BFA, 0x571F, 0x571F, 0x0E72, 0x5720, 0x5722, 0x2BFC,
- 0x5723, 0x5723, 0x0D3C, 0x5724, 0x5727, 0x2BFF, 0x5728, 0x5728, 0x111D,
- 0x5729, 0x5729, 0x13A7, 0x572A, 0x572A, 0x13A9, 0x572B, 0x572B, 0x2C03,
- 0x572C, 0x572C, 0x13A8, 0x572D, 0x572D, 0x0740, 0x572E, 0x572F, 0x13AC,
- 0x5730, 0x5730, 0x05B9, 0x5731, 0x5732, 0x2C04, 0x5733, 0x5733, 0x13AA,
- 0x5734, 0x5738, 0x2C06, 0x5739, 0x5739, 0x13AB, 0x573A, 0x573A, 0x04C6,
- 0x573B, 0x573B, 0x13AF, 0x573C, 0x573D, 0x2C0B, 0x573E, 0x573E, 0x080D,
- 0x573F, 0x573F, 0x2C0D, 0x5740, 0x5740, 0x11B6, 0x5741, 0x5741, 0x2C0E,
- 0x5742, 0x5742, 0x13B0, 0x5743, 0x5746, 0x2C0F, 0x5747, 0x5747, 0x0928,
- 0x5748, 0x5749, 0x2C13, 0x574A, 0x574A, 0x0658, 0x574B, 0x574B, 0x2C15,
- 0x574C, 0x574C, 0x13A0, 0x574D, 0x574D, 0x0E01, 0x574E, 0x574E, 0x093F,
- 0x574F, 0x574F, 0x07CA, 0x5750, 0x5750, 0x1255, 0x5751, 0x5751, 0x0960,
- 0x5752, 0x5756, 0x2C16, 0x5757, 0x5757, 0x0976, 0x5758, 0x5759, 0x2C1B,
- 0x575A, 0x575A, 0x0854, 0x575B, 0x575B, 0x0E06, 0x575C, 0x575C, 0x13AE,
- 0x575D, 0x575D, 0x03DE, 0x575E, 0x575E, 0x0EFA, 0x575F, 0x575F, 0x0675,
- 0x5760, 0x5760, 0x1216, 0x5761, 0x5761, 0x0BE1, 0x5762, 0x5763, 0x2C1D,
- 0x5764, 0x5764, 0x098F, 0x5765, 0x5765, 0x2C1F, 0x5766, 0x5766, 0x0E0C,
- 0x5767, 0x5767, 0x2C20, 0x5768, 0x5768, 0x13B7, 0x5769, 0x5769, 0x13B1,
- 0x576A, 0x576A, 0x0BD9, 0x576B, 0x576B, 0x13B3, 0x576C, 0x576C, 0x2C21,
- 0x576D, 0x576D, 0x13B8, 0x576E, 0x576E, 0x2C22, 0x576F, 0x576F, 0x0BB8,
- 0x5770, 0x5772, 0x2C23, 0x5773, 0x5773, 0x13BA, 0x5774, 0x5775, 0x2C26,
- 0x5776, 0x5776, 0x13B9, 0x5777, 0x5777, 0x094D, 0x5778, 0x577A, 0x2C28,
- 0x577B, 0x577B, 0x13B6, 0x577C, 0x577C, 0x13B5, 0x577D, 0x5781, 0x2C2B,
- 0x5782, 0x5782, 0x053C, 0x5783, 0x5783, 0x0997, 0x5784, 0x5784, 0x0A49,
- 0x5785, 0x5785, 0x13B2, 0x5786, 0x5786, 0x13B4, 0x5787, 0x578A, 0x2C30,
- 0x578B, 0x578B, 0x0F98, 0x578C, 0x578C, 0x13BD, 0x578D, 0x5791, 0x2C34,
- 0x5792, 0x5792, 0x09C8, 0x5793, 0x5793, 0x13C2, 0x5794, 0x579A, 0x2C39,
- 0x579B, 0x579B, 0x0621, 0x579C, 0x579F, 0x2C40, 0x57A0, 0x57A0, 0x13C3,
- 0x57A1, 0x57A1, 0x13A2, 0x57A2, 0x57A2, 0x0711, 0x57A3, 0x57A3, 0x10EE,
- 0x57A4, 0x57A4, 0x13BC, 0x57A5, 0x57A5, 0x2C44, 0x57A6, 0x57A6, 0x095E,
- 0x57A7, 0x57A7, 0x13C0, 0x57A8, 0x57A8, 0x2C45, 0x57A9, 0x57A9, 0x13A1,
- 0x57AA, 0x57AA, 0x2C46, 0x57AB, 0x57AB, 0x05C7, 0x57AC, 0x57AC, 0x2C47,
- 0x57AD, 0x57AD, 0x13BB, 0x57AE, 0x57AE, 0x0972, 0x57AF, 0x57B1, 0x2C48,
- 0x57B2, 0x57B2, 0x13BE, 0x57B3, 0x57B3, 0x2C4B, 0x57B4, 0x57B4, 0x13C1,
- 0x57B5, 0x57B7, 0x2C4C, 0x57B8, 0x57B8, 0x13C9, 0x57B9, 0x57C1, 0x2C4F,
- 0x57C2, 0x57C2, 0x06FA, 0x57C3, 0x57C3, 0x03AE, 0x57C4, 0x57CA, 0x2C58,
- 0x57CB, 0x57CB, 0x0A98, 0x57CC, 0x57CD, 0x2C5F, 0x57CE, 0x57CE, 0x04EC,
- 0x57CF, 0x57CF, 0x13BF, 0x57D0, 0x57D1, 0x2C61, 0x57D2, 0x57D2, 0x13C8,
- 0x57D3, 0x57D3, 0x2C63, 0x57D4, 0x57D4, 0x0BF1, 0x57D5, 0x57D5, 0x13C4,
- 0x57D6, 0x57D7, 0x2C64, 0x57D8, 0x57D8, 0x13C5, 0x57D9, 0x57D9, 0x13C7,
- 0x57DA, 0x57DA, 0x13C6, 0x57DB, 0x57DC, 0x2C66, 0x57DD, 0x57DD, 0x13CE,
- 0x57DE, 0x57DE, 0x2C68, 0x57DF, 0x57DF, 0x10D7, 0x57E0, 0x57E0, 0x0481,
- 0x57E1, 0x57E1, 0x232A, 0x57E2, 0x57E3, 0x2C69, 0x57E4, 0x57E4, 0x13CD,
- 0x57E5, 0x57EC, 0x2C6B, 0x57ED, 0x57ED, 0x13D2, 0x57EE, 0x57EE, 0x2C73,
- 0x57EF, 0x57EF, 0x13CB, 0x57F0, 0x57F3, 0x2C74, 0x57F4, 0x57F4, 0x13CA,
- 0x57F5, 0x57F6, 0x2C78, 0x57F7, 0x57F7, 0x228B, 0x57F8, 0x57F8, 0x13CC,
- 0x57F9, 0x57F9, 0x0BA1, 0x57FA, 0x57FA, 0x080E, 0x57FB, 0x57FC, 0x2C7A,
- 0x57FD, 0x57FD, 0x13D1, 0x57FE, 0x57FF, 0x2C7C, 0x5800, 0x5800, 0x13D3,
- 0x5801, 0x5801, 0x2C7E, 0x5802, 0x5802, 0x0E16, 0x5803, 0x5804, 0x2C7F,
- 0x5805, 0x5805, 0x1F85, 0x5806, 0x5806, 0x0610, 0x5807, 0x5807, 0x144C,
- 0x5808, 0x5809, 0x2C81, 0x580A, 0x580A, 0x2325, 0x580B, 0x580B, 0x13CF,
- 0x580C, 0x580C, 0x2C83, 0x580D, 0x580D, 0x13D0, 0x580E, 0x5810, 0x2C84,
- 0x5811, 0x5811, 0x0C32, 0x5812, 0x5814, 0x2C87, 0x5815, 0x5815, 0x0628,
- 0x5816, 0x5816, 0x232C, 0x5817, 0x5818, 0x2C8A, 0x5819, 0x5819, 0x13D5,
- 0x581A, 0x581C, 0x2C8C, 0x581D, 0x581D, 0x232E, 0x581E, 0x581E, 0x13D4,
- 0x581F, 0x581F, 0x2C8F, 0x5820, 0x5820, 0x13D7, 0x5821, 0x5821, 0x040D,
- 0x5822, 0x5823, 0x2C90, 0x5824, 0x5824, 0x05AD, 0x5825, 0x5829, 0x2C92,
- 0x582A, 0x582A, 0x093D, 0x582B, 0x582E, 0x2C97, 0x582F, 0x582F, 0x2205,
- 0x5830, 0x5830, 0x1008, 0x5831, 0x5831, 0x1E38, 0x5832, 0x5833, 0x2C9B,
- 0x5834, 0x5834, 0x1E73, 0x5835, 0x5835, 0x0601, 0x5836, 0x5843, 0x2C9D,
- 0x5844, 0x5844, 0x13D6, 0x5845, 0x5849, 0x2CAB, 0x584A, 0x584A, 0x1FE3,
- 0x584B, 0x584B, 0x2339, 0x584C, 0x584C, 0x0DEF, 0x584D, 0x584D, 0x19A3,
- 0x584E, 0x584E, 0x2CB0, 0x584F, 0x584F, 0x232B, 0x5850, 0x5850, 0x2CB1,
- 0x5851, 0x5851, 0x0DD1, 0x5852, 0x5852, 0x232D, 0x5853, 0x5853, 0x2CB2,
- 0x5854, 0x5854, 0x0DF3, 0x5855, 0x5856, 0x2CB3, 0x5857, 0x5857, 0x217F,
- 0x5858, 0x5858, 0x0E14, 0x5859, 0x585D, 0x2CB5, 0x585E, 0x585E, 0x0CD6,
- 0x585F, 0x5861, 0x2CBA, 0x5862, 0x5862, 0x21A7, 0x5863, 0x5863, 0x2CBD,
- 0x5864, 0x5864, 0x232F, 0x5865, 0x5865, 0x13D8, 0x5866, 0x586A, 0x2CBE,
- 0x586B, 0x586B, 0x0E41, 0x586C, 0x586C, 0x13D9, 0x586D, 0x5874, 0x2CC3,
- 0x5875, 0x5875, 0x1E7D, 0x5876, 0x5878, 0x2CCB, 0x5879, 0x5879, 0x20D6,
- 0x587A, 0x587D, 0x2CCE, 0x587E, 0x587E, 0x13A3, 0x587F, 0x587F, 0x2CD2,
- 0x5880, 0x5880, 0x13DD, 0x5881, 0x5881, 0x13DA, 0x5882, 0x5882, 0x2CD3,
- 0x5883, 0x5883, 0x08E2, 0x5884, 0x5884, 0x2CD4, 0x5885, 0x5885, 0x0D92,
- 0x5886, 0x5888, 0x2CD5, 0x5889, 0x5889, 0x13DB, 0x588A, 0x588A, 0x1EC2,
- 0x588B, 0x5891, 0x2CD8, 0x5892, 0x5892, 0x0D03, 0x5893, 0x5893, 0x0B1C,
- 0x5894, 0x5898, 0x2CDF, 0x5899, 0x5899, 0x0C3A, 0x589A, 0x589A, 0x13DC,
- 0x589B, 0x589B, 0x2CE4, 0x589C, 0x589C, 0x22B2, 0x589D, 0x589D, 0x2CE5,
- 0x589E, 0x589E, 0x1139, 0x589F, 0x589F, 0x0FB1, 0x58A0, 0x58A7, 0x2CE6,
- 0x58A8, 0x58A8, 0x0B0E, 0x58A9, 0x58A9, 0x0614, 0x58AA, 0x58AD, 0x2CEE,
- 0x58AE, 0x58AE, 0x1EDF, 0x58AF, 0x58B2, 0x2CF2, 0x58B3, 0x58B3, 0x1EF9,
- 0x58B4, 0x58BA, 0x2CF6, 0x58BB, 0x58BB, 0x20D9, 0x58BC, 0x58BC, 0x13A4,
- 0x58BD, 0x58BD, 0x2CFD, 0x58BE, 0x58BE, 0x1FDD, 0x58BF, 0x58C0, 0x2CFE,
- 0x58C1, 0x58C1, 0x0443, 0x58C2, 0x58C4, 0x2D00, 0x58C5, 0x58C5, 0x13A5,
- 0x58C6, 0x58C6, 0x2D03, 0x58C7, 0x58C7, 0x2167, 0x58C8, 0x58D0, 0x2D04,
- 0x58D1, 0x58D1, 0x13A6, 0x58D2, 0x58D2, 0x2D0D, 0x58D3, 0x58D3, 0x21ED,
- 0x58D4, 0x58D4, 0x2D0E, 0x58D5, 0x58D5, 0x0775, 0x58D6, 0x58D7, 0x2D0F,
- 0x58D8, 0x58D8, 0x2007, 0x58D9, 0x58D9, 0x2326, 0x58DA, 0x58DA, 0x2329,
- 0x58DB, 0x58DD, 0x2D11, 0x58DE, 0x58DE, 0x1F52, 0x58DF, 0x58DF, 0x203B,
- 0x58E0, 0x58E0, 0x2328, 0x58E1, 0x58E1, 0x2D14, 0x58E2, 0x58E2, 0x2327,
- 0x58E3, 0x58E3, 0x2D15, 0x58E4, 0x58E4, 0x0C9B, 0x58E5, 0x58E8, 0x2D16,
- 0x58E9, 0x58E9, 0x1E2B, 0x58EA, 0x58EA, 0x2D1A, 0x58EB, 0x58EB, 0x0D56,
- 0x58EC, 0x58EC, 0x0CA4, 0x58ED, 0x58ED, 0x2D1B, 0x58EE, 0x58EE, 0x1210,
- 0x58EF, 0x58EF, 0x22AE, 0x58F0, 0x58F0, 0x0D32, 0x58F1, 0x58F2, 0x2D1C,
- 0x58F3, 0x58F3, 0x0954, 0x58F4, 0x58F5, 0x2D1E, 0x58F6, 0x58F6, 0x07AF,
- 0x58F7, 0x58F8, 0x2D20, 0x58F9, 0x58F9, 0x1043, 0x58FA, 0x58FA, 0x1F49,
- 0x58FB, 0x58FC, 0x2D22, 0x58FD, 0x58FD, 0x2138, 0x58FE, 0x58FF, 0x2D24,
- 0x5900, 0x5901, 0x2D26, 0x5902, 0x5902, 0x161C, 0x5903, 0x5903, 0x2D28,
- 0x5904, 0x5904, 0x0529, 0x5905, 0x5906, 0x2D29, 0x5907, 0x5907, 0x0421,
- 0x5908, 0x590C, 0x2D2B, 0x590D, 0x590D, 0x06AF, 0x590E, 0x590E, 0x2D30,
- 0x590F, 0x590F, 0x0F31, 0x5910, 0x5913, 0x2D31, 0x5914, 0x5914, 0x12FB,
- 0x5915, 0x5915, 0x0F13, 0x5916, 0x5916, 0x0E93, 0x5917, 0x5918, 0x2D35,
- 0x5919, 0x5919, 0x1301, 0x591A, 0x591A, 0x061F, 0x591B, 0x591B, 0x2D37,
- 0x591C, 0x591C, 0x1040, 0x591D, 0x591E, 0x2D38, 0x591F, 0x591F, 0x0714,
- 0x5920, 0x5921, 0x2D3A, 0x5922, 0x5922, 0x2081, 0x5923, 0x5923, 0x2D3C,
- 0x5924, 0x5924, 0x161B, 0x5925, 0x5925, 0x1619, 0x5926, 0x5926, 0x2D3D,
- 0x5927, 0x5927, 0x0576, 0x5928, 0x5928, 0x2D3E, 0x5929, 0x5929, 0x0E3F,
- 0x592A, 0x592A, 0x0DFE, 0x592B, 0x592B, 0x068F, 0x592C, 0x592C, 0x2D3F,
- 0x592D, 0x592D, 0x1268, 0x592E, 0x592E, 0x1014, 0x592F, 0x592F, 0x0772,
- 0x5930, 0x5930, 0x2D40, 0x5931, 0x5931, 0x0D3E, 0x5932, 0x5933, 0x2D41,
- 0x5934, 0x5934, 0x0E68, 0x5935, 0x5936, 0x2D43, 0x5937, 0x5937, 0x104B,
- 0x5938, 0x5938, 0x0971, 0x5939, 0x5939, 0x0843, 0x593A, 0x593A, 0x0620,
- 0x593B, 0x593B, 0x2D45, 0x593C, 0x593C, 0x14AF, 0x593D, 0x593D, 0x2D46,
- 0x593E, 0x593E, 0x1F7C, 0x593F, 0x5940, 0x2D47, 0x5941, 0x5941, 0x14B0,
- 0x5942, 0x5942, 0x138C, 0x5943, 0x5943, 0x2D49, 0x5944, 0x5944, 0x1002,
- 0x5945, 0x5946, 0x2D4A, 0x5947, 0x5947, 0x0C05, 0x5948, 0x5948, 0x0B31,
- 0x5949, 0x5949, 0x068B, 0x594A, 0x594A, 0x2D4C, 0x594B, 0x594B, 0x0679,
- 0x594C, 0x594D, 0x2D4D, 0x594E, 0x594E, 0x0989, 0x594F, 0x594F, 0x123D,
- 0x5950, 0x5950, 0x2D4F, 0x5951, 0x5951, 0x0C14, 0x5952, 0x5953, 0x2D50,
- 0x5954, 0x5954, 0x0425, 0x5955, 0x5955, 0x14B2, 0x5956, 0x5956, 0x0882,
- 0x5957, 0x5957, 0x0E2A, 0x5958, 0x5958, 0x14B4, 0x5959, 0x5959, 0x2D52,
- 0x595A, 0x595A, 0x14B3, 0x595B, 0x595F, 0x2D53, 0x5960, 0x5960, 0x05CD,
- 0x5961, 0x5961, 0x2D58, 0x5962, 0x5962, 0x0D16, 0x5963, 0x5964, 0x2D59,
- 0x5965, 0x5965, 0x03CD, 0x5966, 0x5968, 0x2D5B, 0x5969, 0x5969, 0x235B,
- 0x596A, 0x596A, 0x1EDE, 0x596B, 0x596B, 0x2D5E, 0x596C, 0x596C, 0x1FA2,
- 0x596D, 0x596D, 0x2D5F, 0x596E, 0x596E, 0x1EFA, 0x596F, 0x5972, 0x2D60,
- 0x5973, 0x5973, 0x0B6F, 0x5974, 0x5974, 0x0B6C, 0x5975, 0x5975, 0x2D64,
- 0x5976, 0x5976, 0x0B2F, 0x5977, 0x5977, 0x2D65, 0x5978, 0x5978, 0x085C,
- 0x5979, 0x5979, 0x0DF2, 0x597A, 0x597C, 0x2D66, 0x597D, 0x597D, 0x077A,
- 0x597E, 0x5980, 0x2D69, 0x5981, 0x5981, 0x1775, 0x5982, 0x5982, 0x0CC2,
- 0x5983, 0x5983, 0x1776, 0x5984, 0x5984, 0x0EAE, 0x5985, 0x5985, 0x2D6C,
- 0x5986, 0x5986, 0x120E, 0x5987, 0x5987, 0x06B9, 0x5988, 0x5988, 0x0A8F,
- 0x5989, 0x5989, 0x2D6D, 0x598A, 0x598A, 0x0CAC, 0x598B, 0x598C, 0x2D6E,
- 0x598D, 0x598D, 0x1777, 0x598E, 0x5991, 0x2D70, 0x5992, 0x5992, 0x0609,
- 0x5993, 0x5993, 0x083E, 0x5994, 0x5995, 0x2D74, 0x5996, 0x5996, 0x1026,
- 0x5997, 0x5997, 0x177B, 0x5998, 0x5998, 0x2D76, 0x5999, 0x5999, 0x0AF3,
- 0x599A, 0x599C, 0x2D77, 0x599D, 0x599D, 0x22AD, 0x599E, 0x599E, 0x177E,
- 0x599F, 0x59A2, 0x2D7A, 0x59A3, 0x59A3, 0x177A, 0x59A4, 0x59A4, 0x177F,
- 0x59A5, 0x59A5, 0x0E88, 0x59A6, 0x59A7, 0x2D7E, 0x59A8, 0x59A8, 0x065E,
- 0x59A9, 0x59AA, 0x1778, 0x59AB, 0x59AB, 0x177D, 0x59AC, 0x59AD, 0x2D80,
- 0x59AE, 0x59AE, 0x0B40, 0x59AF, 0x59AF, 0x1782, 0x59B0, 0x59B1, 0x2D82,
- 0x59B2, 0x59B2, 0x1781, 0x59B3, 0x59B8, 0x2D84, 0x59B9, 0x59B9, 0x0AC8,
- 0x59BA, 0x59BA, 0x2D8A, 0x59BB, 0x59BB, 0x0BFD, 0x59BC, 0x59BD, 0x2D8B,
- 0x59BE, 0x59BE, 0x1784, 0x59BF, 0x59C5, 0x2D8D, 0x59C6, 0x59C6, 0x0B1A,
- 0x59C7, 0x59C9, 0x2D94, 0x59CA, 0x59CA, 0x177C, 0x59CB, 0x59CB, 0x0D53,
- 0x59CC, 0x59CF, 0x2D97, 0x59D0, 0x59D0, 0x08B4, 0x59D1, 0x59D1, 0x071C,
- 0x59D2, 0x59D2, 0x1780, 0x59D3, 0x59D3, 0x0FA0, 0x59D4, 0x59D4, 0x0EBE,
- 0x59D5, 0x59D6, 0x2D9B, 0x59D7, 0x59D7, 0x1783, 0x59D8, 0x59D8, 0x178A,
- 0x59D9, 0x59D9, 0x2D9D, 0x59DA, 0x59DA, 0x102D, 0x59DB, 0x59DB, 0x2D9E,
- 0x59DC, 0x59DC, 0x087B, 0x59DD, 0x59DD, 0x1787, 0x59DE, 0x59E2, 0x2D9F,
- 0x59E3, 0x59E3, 0x1789, 0x59E4, 0x59E4, 0x2DA4, 0x59E5, 0x59E5, 0x09BC,
- 0x59E6, 0x59E7, 0x2DA5, 0x59E8, 0x59E8, 0x1053, 0x59E9, 0x59EB, 0x2DA7,
- 0x59EC, 0x59EC, 0x081A, 0x59ED, 0x59F8, 0x2DAA, 0x59F9, 0x59F9, 0x178B,
- 0x59FA, 0x59FA, 0x2DB6, 0x59FB, 0x59FB, 0x107D, 0x59FC, 0x59FE, 0x2DB7,
- 0x59FF, 0x59FF, 0x1228, 0x5A00, 0x5A00, 0x2DBA, 0x5A01, 0x5A01, 0x0EAF,
- 0x5A02, 0x5A02, 0x2DBB, 0x5A03, 0x5A03, 0x0E8F, 0x5A04, 0x5A04, 0x0A4D,
- 0x5A05, 0x5A06, 0x1785, 0x5A07, 0x5A07, 0x0890, 0x5A08, 0x5A08, 0x1788,
- 0x5A09, 0x5A09, 0x178D, 0x5A0A, 0x5A0B, 0x2DBC, 0x5A0C, 0x5A0C, 0x178C,
- 0x5A0D, 0x5A10, 0x2DBE, 0x5A11, 0x5A11, 0x1790, 0x5A12, 0x5A12, 0x2DC2,
- 0x5A13, 0x5A13, 0x1792, 0x5A14, 0x5A17, 0x2DC3, 0x5A18, 0x5A18, 0x0B52,
- 0x5A19, 0x5A1B, 0x2DC7, 0x5A1C, 0x5A1C, 0x0B2B, 0x5A1D, 0x5A1E, 0x2DCA,
- 0x5A1F, 0x5A1F, 0x0919, 0x5A20, 0x5A20, 0x0D28, 0x5A21, 0x5A22, 0x2DCC,
- 0x5A23, 0x5A23, 0x1791, 0x5A24, 0x5A24, 0x2DCE, 0x5A25, 0x5A25, 0x062F,
- 0x5A26, 0x5A28, 0x2DCF, 0x5A29, 0x5A29, 0x0AE9, 0x5A2A, 0x5A30, 0x2DD2,
- 0x5A31, 0x5A31, 0x10CE, 0x5A32, 0x5A32, 0x178E, 0x5A33, 0x5A33, 0x2DD9,
- 0x5A34, 0x5A34, 0x178F, 0x5A35, 0x5A35, 0x2DDA, 0x5A36, 0x5A36, 0x0C7D,
- 0x5A37, 0x5A3B, 0x2DDB, 0x5A3C, 0x5A3C, 0x1797, 0x5A3D, 0x5A3F, 0x2DE0,
- 0x5A40, 0x5A40, 0x1793, 0x5A41, 0x5A41, 0x203F, 0x5A42, 0x5A45, 0x2DE3,
- 0x5A46, 0x5A46, 0x0BE4, 0x5A47, 0x5A48, 0x2DE7, 0x5A49, 0x5A49, 0x0EA2,
- 0x5A4A, 0x5A4A, 0x1795, 0x5A4B, 0x5A54, 0x2DE9, 0x5A55, 0x5A55, 0x1796,
- 0x5A56, 0x5A59, 0x2DF3, 0x5A5A, 0x5A5A, 0x07FE, 0x5A5B, 0x5A61, 0x2DF7,
- 0x5A62, 0x5A62, 0x1798, 0x5A63, 0x5A65, 0x2DFE, 0x5A66, 0x5A66, 0x1F0E,
- 0x5A67, 0x5A67, 0x1794, 0x5A68, 0x5A69, 0x2E01, 0x5A6A, 0x5A6A, 0x09A2,
- 0x5A6B, 0x5A6C, 0x2E03, 0x5A6D, 0x5A6D, 0x23F9, 0x5A6E, 0x5A73, 0x2E05,
- 0x5A74, 0x5A74, 0x1089, 0x5A75, 0x5A75, 0x1799, 0x5A76, 0x5A76, 0x0D2D,
- 0x5A77, 0x5A77, 0x179D, 0x5A78, 0x5A79, 0x2E0B, 0x5A7A, 0x5A7A, 0x179E,
- 0x5A7B, 0x5A7E, 0x2E0D, 0x5A7F, 0x5A7F, 0x0FC1, 0x5A80, 0x5A91, 0x2E11,
- 0x5A92, 0x5A92, 0x0AC2, 0x5A93, 0x5A99, 0x2E23, 0x5A9A, 0x5A9A, 0x0AC9,
- 0x5A9B, 0x5A9B, 0x179C, 0x5A9C, 0x5AA6, 0x2E2A, 0x5AA7, 0x5AA7, 0x23FC,
- 0x5AA8, 0x5AA9, 0x2E35, 0x5AAA, 0x5AAA, 0x179B, 0x5AAB, 0x5AB1, 0x2E37,
- 0x5AB2, 0x5AB2, 0x17A1, 0x5AB3, 0x5AB3, 0x0F1E, 0x5AB4, 0x5AB4, 0x2E3E,
- 0x5AB5, 0x5AB5, 0x19A4, 0x5AB6, 0x5AB7, 0x2E3F, 0x5AB8, 0x5AB8, 0x17A4,
- 0x5AB9, 0x5ABC, 0x2E41, 0x5ABD, 0x5ABD, 0x2069, 0x5ABE, 0x5ABE, 0x179F,
- 0x5ABF, 0x5AC0, 0x2E45, 0x5AC1, 0x5AC1, 0x0851, 0x5AC2, 0x5AC2, 0x0CE2,
- 0x5AC3, 0x5AC8, 0x2E47, 0x5AC9, 0x5AC9, 0x0828, 0x5ACA, 0x5ACB, 0x2E4D,
- 0x5ACC, 0x5ACC, 0x0F40, 0x5ACD, 0x5AD1, 0x2E4F, 0x5AD2, 0x5AD2, 0x17A2,
- 0x5AD3, 0x5AD3, 0x2E54, 0x5AD4, 0x5AD4, 0x17A3, 0x5AD5, 0x5AD5, 0x2E55,
- 0x5AD6, 0x5AD6, 0x17A8, 0x5AD7, 0x5AD7, 0x23F7, 0x5AD8, 0x5AD8, 0x17AA,
- 0x5AD9, 0x5ADB, 0x2E56, 0x5ADC, 0x5ADC, 0x17AB, 0x5ADD, 0x5ADF, 0x2E59,
- 0x5AE0, 0x5AE0, 0x17A5, 0x5AE1, 0x5AE1, 0x05B6, 0x5AE2, 0x5AE2, 0x2E5C,
- 0x5AE3, 0x5AE3, 0x17A6, 0x5AE4, 0x5AE5, 0x2E5D, 0x5AE6, 0x5AE6, 0x17A9,
- 0x5AE7, 0x5AE8, 0x2E5F, 0x5AE9, 0x5AE9, 0x0B3E, 0x5AEA, 0x5AEA, 0x2E61,
- 0x5AEB, 0x5AEB, 0x17A0, 0x5AEC, 0x5AF0, 0x2E62, 0x5AF1, 0x5AF1, 0x17A7,
- 0x5AF2, 0x5AF4, 0x2E67, 0x5AF5, 0x5AF5, 0x23F6, 0x5AF6, 0x5AFA, 0x2E6A,
- 0x5AFB, 0x5AFB, 0x23FD, 0x5AFC, 0x5AFF, 0x2E6F, 0x5B00, 0x5B00, 0x23F8,
- 0x5B01, 0x5B07, 0x2E73, 0x5B08, 0x5B08, 0x23FA, 0x5B09, 0x5B09, 0x17AC,
- 0x5B0A, 0x5B0A, 0x2E7A, 0x5B0B, 0x5B0B, 0x23FE, 0x5B0C, 0x5B0C, 0x1FA8,
- 0x5B0D, 0x5B15, 0x2E7B, 0x5B16, 0x5B16, 0x17AE, 0x5B17, 0x5B17, 0x17AD,
- 0x5B18, 0x5B18, 0x2E84, 0x5B19, 0x5B19, 0x2401, 0x5B1A, 0x5B20, 0x2E85,
- 0x5B21, 0x5B21, 0x23FF, 0x5B22, 0x5B29, 0x2E8C, 0x5B2A, 0x5B2A, 0x2400,
- 0x5B2B, 0x5B2F, 0x2E94, 0x5B30, 0x5B30, 0x2221, 0x5B31, 0x5B31, 0x2E99,
- 0x5B32, 0x5B32, 0x17AF, 0x5B33, 0x5B33, 0x2E9A, 0x5B34, 0x5B34, 0x130C,
- 0x5B35, 0x5B36, 0x2E9B, 0x5B37, 0x5B37, 0x17B0, 0x5B38, 0x5B38, 0x2122,
- 0x5B39, 0x5B3F, 0x2E9D, 0x5B40, 0x5B40, 0x17B1, 0x5B41, 0x5B4B, 0x2EA4,
- 0x5B4C, 0x5B4C, 0x23FB, 0x5B4D, 0x5B4F, 0x2EAF, 0x5B50, 0x5B50, 0x1230,
- 0x5B51, 0x5B51, 0x17B7, 0x5B52, 0x5B52, 0x2EB2, 0x5B53, 0x5B53, 0x17B8,
- 0x5B54, 0x5B54, 0x0964, 0x5B55, 0x5B55, 0x1113, 0x5B56, 0x5B56, 0x2EB3,
- 0x5B57, 0x5B57, 0x1233, 0x5B58, 0x5B58, 0x0569, 0x5B59, 0x5B59, 0x0DE4,
- 0x5B5A, 0x5B5A, 0x17B4, 0x5B5B, 0x5B5B, 0x1279, 0x5B5C, 0x5B5C, 0x122B,
- 0x5B5D, 0x5B5D, 0x0F6D, 0x5B5E, 0x5B5E, 0x2EB4, 0x5B5F, 0x5B5F, 0x0AD4,
- 0x5B60, 0x5B61, 0x2EB5, 0x5B62, 0x5B62, 0x17B9, 0x5B63, 0x5B63, 0x0831,
- 0x5B64, 0x5B64, 0x071B, 0x5B65, 0x5B65, 0x17B5, 0x5B66, 0x5B66, 0x0FD0,
- 0x5B67, 0x5B68, 0x2EB7, 0x5B69, 0x5B69, 0x0759, 0x5B6A, 0x5B6A, 0x0A76,
- 0x5B6B, 0x5B6B, 0x215A, 0x5B6C, 0x5B6C, 0x1261, 0x5B6D, 0x5B6F, 0x2EB9,
- 0x5B70, 0x5B70, 0x0D82, 0x5B71, 0x5B71, 0x176A, 0x5B72, 0x5B72, 0x2EBC,
- 0x5B73, 0x5B73, 0x17B6, 0x5B74, 0x5B74, 0x2EBD, 0x5B75, 0x5B75, 0x0692,
- 0x5B76, 0x5B77, 0x2EBE, 0x5B78, 0x5B78, 0x21E5, 0x5B79, 0x5B79, 0x2EC0,
- 0x5B7A, 0x5B7A, 0x0CC1, 0x5B7B, 0x5B7C, 0x2EC1, 0x5B7D, 0x5B7D, 0x0B58,
- 0x5B7E, 0x5B7E, 0x2EC3, 0x5B7F, 0x5B7F, 0x2057, 0x5B80, 0x5B80, 0x172E,
- 0x5B81, 0x5B81, 0x0B61, 0x5B82, 0x5B82, 0x2EC4, 0x5B83, 0x5B83, 0x0DF1,
- 0x5B84, 0x5B84, 0x172F, 0x5B85, 0x5B85, 0x114D, 0x5B86, 0x5B86, 0x2EC5,
- 0x5B87, 0x5B87, 0x10D3, 0x5B88, 0x5B88, 0x0D6F, 0x5B89, 0x5B89, 0x03BD,
- 0x5B8A, 0x5B8A, 0x2EC6, 0x5B8B, 0x5B8B, 0x0DC3, 0x5B8C, 0x5B8C, 0x0E9B,
- 0x5B8D, 0x5B8E, 0x2EC7, 0x5B8F, 0x5B8F, 0x07A1, 0x5B90, 0x5B92, 0x2EC9,
- 0x5B93, 0x5B93, 0x1731, 0x5B94, 0x5B94, 0x2ECC, 0x5B95, 0x5B95, 0x1730,
- 0x5B96, 0x5B96, 0x2ECD, 0x5B97, 0x5B97, 0x1237, 0x5B98, 0x5B98, 0x0732,
- 0x5B99, 0x5B99, 0x11E5, 0x5B9A, 0x5B9A, 0x05E7, 0x5B9B, 0x5B9B, 0x0EA1,
- 0x5B9C, 0x5B9C, 0x1052, 0x5B9D, 0x5B9D, 0x040F, 0x5B9E, 0x5B9E, 0x0D4C,
- 0x5B9F, 0x5B9F, 0x2ECE, 0x5BA0, 0x5BA0, 0x050D, 0x5BA1, 0x5BA1, 0x0D2C,
- 0x5BA2, 0x5BA2, 0x095A, 0x5BA3, 0x5BA3, 0x0FC6, 0x5BA4, 0x5BA4, 0x0D69,
- 0x5BA5, 0x5BA5, 0x1732, 0x5BA6, 0x5BA6, 0x07D7, 0x5BA7, 0x5BA9, 0x2ECF,
- 0x5BAA, 0x5BAA, 0x0F49, 0x5BAB, 0x5BAB, 0x0705, 0x5BAC, 0x5BAF, 0x2ED2,
- 0x5BB0, 0x5BB0, 0x111A, 0x5BB1, 0x5BB2, 0x2ED6, 0x5BB3, 0x5BB3, 0x075D,
- 0x5BB4, 0x5BB4, 0x1010, 0x5BB5, 0x5BB5, 0x0F69, 0x5BB6, 0x5BB6, 0x0845,
- 0x5BB7, 0x5BB7, 0x2ED8, 0x5BB8, 0x5BB8, 0x1733, 0x5BB9, 0x5BB9, 0x0CB8,
- 0x5BBA, 0x5BBC, 0x2ED9, 0x5BBD, 0x5BBD, 0x097A, 0x5BBE, 0x5BBE, 0x045F,
- 0x5BBF, 0x5BBF, 0x0DD3, 0x5BC0, 0x5BC1, 0x2EDC, 0x5BC2, 0x5BC2, 0x0838,
- 0x5BC3, 0x5BC3, 0x2EDE, 0x5BC4, 0x5BC4, 0x0837, 0x5BC5, 0x5BC5, 0x1081,
- 0x5BC6, 0x5BC6, 0x0AE1, 0x5BC7, 0x5BC7, 0x0969, 0x5BC8, 0x5BCB, 0x2EDF,
- 0x5BCC, 0x5BCC, 0x06B6, 0x5BCD, 0x5BCF, 0x2EE3, 0x5BD0, 0x5BD0, 0x0AC7,
- 0x5BD1, 0x5BD1, 0x2EE6, 0x5BD2, 0x5BD2, 0x0765, 0x5BD3, 0x5BD3, 0x10E5,
- 0x5BD4, 0x5BDC, 0x2EE7, 0x5BDD, 0x5BDD, 0x0C5B, 0x5BDE, 0x5BDE, 0x0B12,
- 0x5BDF, 0x5BDF, 0x04B3, 0x5BE0, 0x5BE0, 0x2EF0, 0x5BE1, 0x5BE1, 0x072A,
- 0x5BE2, 0x5BE2, 0x20E5, 0x5BE3, 0x5BE3, 0x2EF1, 0x5BE4, 0x5BE4, 0x1737,
- 0x5BE5, 0x5BE5, 0x0A11, 0x5BE6, 0x5BE6, 0x212F, 0x5BE7, 0x5BE7, 0x20A3,
- 0x5BE8, 0x5BE8, 0x1150, 0x5BE9, 0x5BE9, 0x2121, 0x5BEA, 0x5BEA, 0x2EF2,
- 0x5BEB, 0x5BEB, 0x21D4, 0x5BEC, 0x5BEC, 0x1FE5, 0x5BED, 0x5BED, 0x2EF3,
- 0x5BEE, 0x5BEE, 0x1738, 0x5BEF, 0x5BEF, 0x2EF4, 0x5BF0, 0x5BF0, 0x173A,
- 0x5BF1, 0x5BF4, 0x2EF5, 0x5BF5, 0x5BF5, 0x1E8A, 0x5BF6, 0x5BF6, 0x1E37,
- 0x5BF7, 0x5BF7, 0x2EF9, 0x5BF8, 0x5BF8, 0x056A, 0x5BF9, 0x5BF9, 0x0613,
- 0x5BFA, 0x5BFA, 0x0DB7, 0x5BFB, 0x5BFB, 0x0FD9, 0x5BFC, 0x5BFC, 0x059D,
- 0x5BFD, 0x5BFE, 0x2EFA, 0x5BFF, 0x5BFF, 0x0D70, 0x5C00, 0x5C00, 0x2EFC,
- 0x5C01, 0x5C01, 0x067F, 0x5C02, 0x5C03, 0x2EFD, 0x5C04, 0x5C04, 0x0D1D,
- 0x5C05, 0x5C05, 0x2EFF, 0x5C06, 0x5C06, 0x087C, 0x5C07, 0x5C07, 0x1F9E,
- 0x5C08, 0x5C08, 0x22A6, 0x5C09, 0x5C09, 0x0ECD, 0x5C0A, 0x5C0A, 0x124D,
- 0x5C0B, 0x5C0B, 0x21E8, 0x5C0C, 0x5C0C, 0x2F00, 0x5C0D, 0x5C0D, 0x1EDA,
- 0x5C0E, 0x5C0E, 0x1EB9, 0x5C0F, 0x5C0F, 0x0F6C, 0x5C10, 0x5C10, 0x2F01,
- 0x5C11, 0x5C11, 0x0D12, 0x5C12, 0x5C13, 0x2F02, 0x5C14, 0x5C14, 0x063A,
- 0x5C15, 0x5C15, 0x17B2, 0x5C16, 0x5C16, 0x0855, 0x5C17, 0x5C17, 0x2F04,
- 0x5C18, 0x5C18, 0x04E3, 0x5C19, 0x5C19, 0x2F05, 0x5C1A, 0x5C1A, 0x0D09,
- 0x5C1B, 0x5C1B, 0x2F06, 0x5C1C, 0x5C1C, 0x17B3, 0x5C1D, 0x5C1D, 0x04C7,
- 0x5C1E, 0x5C21, 0x2F07, 0x5C22, 0x5C22, 0x14B6, 0x5C23, 0x5C23, 0x2F0B,
- 0x5C24, 0x5C24, 0x10AD, 0x5C25, 0x5C25, 0x14B7, 0x5C26, 0x5C26, 0x2F0C,
- 0x5C27, 0x5C27, 0x1029, 0x5C28, 0x5C2B, 0x2F0D, 0x5C2C, 0x5C2C, 0x14B8,
- 0x5C2D, 0x5C30, 0x2F11, 0x5C31, 0x5C31, 0x08FC, 0x5C32, 0x5C33, 0x2F15,
- 0x5C34, 0x5C34, 0x14B9, 0x5C35, 0x5C36, 0x2F17, 0x5C37, 0x5C37, 0x235C,
- 0x5C38, 0x5C38, 0x0D43, 0x5C39, 0x5C39, 0x1083, 0x5C3A, 0x5C3A, 0x0504,
- 0x5C3B, 0x5C3B, 0x1766, 0x5C3C, 0x5C3C, 0x0B44, 0x5C3D, 0x5C3D, 0x08D0,
- 0x5C3E, 0x5C3E, 0x0EC1, 0x5C3F, 0x5C3F, 0x0B55, 0x5C40, 0x5C40, 0x0905,
- 0x5C41, 0x5C41, 0x0BC7, 0x5C42, 0x5C42, 0x04AA, 0x5C43, 0x5C44, 0x2F19,
- 0x5C45, 0x5C45, 0x0902, 0x5C46, 0x5C47, 0x2F1B, 0x5C48, 0x5C48, 0x0C79,
- 0x5C49, 0x5C49, 0x0E3E, 0x5C4A, 0x5C4A, 0x08BD, 0x5C4B, 0x5C4B, 0x0EEC,
- 0x5C4C, 0x5C4D, 0x2F1D, 0x5C4E, 0x5C4E, 0x0D51, 0x5C4F, 0x5C4F, 0x0BE0,
- 0x5C50, 0x5C50, 0x1768, 0x5C51, 0x5C51, 0x0F87, 0x5C52, 0x5C54, 0x2F1F,
- 0x5C55, 0x5C55, 0x115A, 0x5C56, 0x5C58, 0x2F22, 0x5C59, 0x5C59, 0x1769,
- 0x5C5A, 0x5C5D, 0x2F25, 0x5C5E, 0x5C5E, 0x0D8B, 0x5C5F, 0x5C5F, 0x2F29,
- 0x5C60, 0x5C60, 0x0E71, 0x5C61, 0x5C61, 0x0A6C, 0x5C62, 0x5C62, 0x2050,
- 0x5C63, 0x5C63, 0x176B, 0x5C64, 0x5C64, 0x1E67, 0x5C65, 0x5C65, 0x0A6B,
- 0x5C66, 0x5C66, 0x176C, 0x5C67, 0x5C67, 0x2F2A, 0x5C68, 0x5C68, 0x23F4,
- 0x5C69, 0x5C6B, 0x2F2B, 0x5C6C, 0x5C6C, 0x213E, 0x5C6D, 0x5C6D, 0x2F2E,
- 0x5C6E, 0x5C6E, 0x1774, 0x5C6F, 0x5C6F, 0x0E7E, 0x5C70, 0x5C70, 0x2F2F,
- 0x5C71, 0x5C71, 0x0CF6, 0x5C72, 0x5C78, 0x2F30, 0x5C79, 0x5C79, 0x1060,
- 0x5C7A, 0x5C7A, 0x15AC, 0x5C7B, 0x5C7E, 0x2F37, 0x5C7F, 0x5C7F, 0x10D1,
- 0x5C80, 0x5C80, 0x2F3B, 0x5C81, 0x5C81, 0x0DDF, 0x5C82, 0x5C82, 0x0C10,
- 0x5C83, 0x5C87, 0x2F3C, 0x5C88, 0x5C88, 0x15B0, 0x5C89, 0x5C8B, 0x2F41,
- 0x5C8C, 0x5C8C, 0x15AB, 0x5C8D, 0x5C8D, 0x15AD, 0x5C8E, 0x5C8F, 0x2F44,
- 0x5C90, 0x5C90, 0x15AE, 0x5C91, 0x5C91, 0x15B3, 0x5C92, 0x5C93, 0x2F46,
- 0x5C94, 0x5C94, 0x04B4, 0x5C95, 0x5C95, 0x2F48, 0x5C96, 0x5C96, 0x15AF,
- 0x5C97, 0x5C97, 0x06D5, 0x5C98, 0x5C99, 0x15B1, 0x5C9A, 0x5C9A, 0x15B4,
- 0x5C9B, 0x5C9B, 0x059B, 0x5C9C, 0x5C9C, 0x15B5, 0x5C9D, 0x5CA0, 0x2F49,
- 0x5CA1, 0x5CA1, 0x1F16, 0x5CA2, 0x5CA2, 0x15B7, 0x5CA3, 0x5CA3, 0x15BC,
- 0x5CA4, 0x5CA8, 0x2F4D, 0x5CA9, 0x5CA9, 0x0FFB, 0x5CAA, 0x5CAA, 0x2F52,
- 0x5CAB, 0x5CAB, 0x15BA, 0x5CAC, 0x5CAC, 0x15B9, 0x5CAD, 0x5CAD, 0x0A34,
- 0x5CAE, 0x5CB0, 0x2F53, 0x5CB1, 0x5CB1, 0x15BB, 0x5CB2, 0x5CB2, 0x2F56,
- 0x5CB3, 0x5CB3, 0x1103, 0x5CB4, 0x5CB4, 0x2F57, 0x5CB5, 0x5CB5, 0x15B6,
- 0x5CB6, 0x5CB6, 0x2F58, 0x5CB7, 0x5CB7, 0x15BE, 0x5CB8, 0x5CB8, 0x03C1,
- 0x5CB9, 0x5CBC, 0x2F59, 0x5CBD, 0x5CBD, 0x15B8, 0x5CBE, 0x5CBE, 0x2F5D,
- 0x5CBF, 0x5CBF, 0x0986, 0x5CC0, 0x5CC0, 0x2F5E, 0x5CC1, 0x5CC1, 0x15BD,
- 0x5CC2, 0x5CC3, 0x2F5F, 0x5CC4, 0x5CC4, 0x15BF, 0x5CC5, 0x5CCA, 0x2F61,
- 0x5CCB, 0x5CCB, 0x15C2, 0x5CCC, 0x5CD1, 0x2F67, 0x5CD2, 0x5CD2, 0x15C0,
- 0x5CD3, 0x5CD8, 0x2F6D, 0x5CD9, 0x5CD9, 0x11C4, 0x5CDA, 0x5CE0, 0x2F73,
- 0x5CE1, 0x5CE1, 0x0F2C, 0x5CE2, 0x5CE3, 0x2F7A, 0x5CE4, 0x5CE4, 0x15C1,
- 0x5CE5, 0x5CE5, 0x15C3, 0x5CE6, 0x5CE6, 0x0A74, 0x5CE7, 0x5CE7, 0x2F7C,
- 0x5CE8, 0x5CE8, 0x062A, 0x5CE9, 0x5CE9, 0x2F7D, 0x5CEA, 0x5CEA, 0x10DD,
- 0x5CEB, 0x5CEC, 0x2F7E, 0x5CED, 0x5CED, 0x0C4A, 0x5CEE, 0x5CEF, 0x2F80,
- 0x5CF0, 0x5CF0, 0x0682, 0x5CF1, 0x5CF3, 0x2F82, 0x5CF4, 0x5CF4, 0x2389,
- 0x5CF5, 0x5CF5, 0x2F85, 0x5CF6, 0x5CF6, 0x1EB7, 0x5CF7, 0x5CFA, 0x2F86,
- 0x5CFB, 0x5CFB, 0x092D, 0x5CFC, 0x5CFC, 0x2F8A, 0x5CFD, 0x5CFD, 0x21B4,
- 0x5CFE, 0x5CFF, 0x2F8B, 0x5D00, 0x5D01, 0x2F8D, 0x5D02, 0x5D03, 0x15C4,
- 0x5D04, 0x5D05, 0x2F8F, 0x5D06, 0x5D06, 0x15CB, 0x5D07, 0x5D07, 0x050C,
- 0x5D08, 0x5D0C, 0x2F91, 0x5D0D, 0x5D0D, 0x238F, 0x5D0E, 0x5D0E, 0x0C08,
- 0x5D0F, 0x5D13, 0x2F96, 0x5D14, 0x5D14, 0x0561, 0x5D15, 0x5D15, 0x2F9B,
- 0x5D16, 0x5D16, 0x0FEB, 0x5D17, 0x5D17, 0x1F1A, 0x5D18, 0x5D1A, 0x2F9C,
- 0x5D1B, 0x5D1B, 0x15CC, 0x5D1C, 0x5D1D, 0x2F9F, 0x5D1E, 0x5D1E, 0x15CA,
- 0x5D1F, 0x5D23, 0x2FA1, 0x5D24, 0x5D24, 0x15C9, 0x5D25, 0x5D25, 0x2FA6,
- 0x5D26, 0x5D26, 0x15C7, 0x5D27, 0x5D27, 0x15C6, 0x5D28, 0x5D28, 0x2FA7,
- 0x5D29, 0x5D29, 0x0429, 0x5D2A, 0x5D2B, 0x2FA8, 0x5D2C, 0x5D2C, 0x238B,
- 0x5D2D, 0x5D2D, 0x1159, 0x5D2E, 0x5D2E, 0x15C8, 0x5D2F, 0x5D33, 0x2FAA,
- 0x5D34, 0x5D34, 0x15CF, 0x5D35, 0x5D3C, 0x2FAF, 0x5D3D, 0x5D3D, 0x15D0,
- 0x5D3E, 0x5D3E, 0x15CE, 0x5D3F, 0x5D46, 0x2FB7, 0x5D47, 0x5D47, 0x1B22,
- 0x5D48, 0x5D49, 0x2FBF, 0x5D4A, 0x5D4A, 0x15D7, 0x5D4B, 0x5D4B, 0x15D6,
- 0x5D4C, 0x5D4C, 0x0C33, 0x5D4D, 0x5D4F, 0x2FC1, 0x5D50, 0x5D50, 0x238A,
- 0x5D51, 0x5D57, 0x2FC4, 0x5D58, 0x5D58, 0x15CD, 0x5D59, 0x5D5A, 0x2FCB,
- 0x5D5B, 0x5D5B, 0x15D2, 0x5D5C, 0x5D5C, 0x2FCD, 0x5D5D, 0x5D5D, 0x15D4,
- 0x5D5E, 0x5D68, 0x2FCE, 0x5D69, 0x5D69, 0x15D8, 0x5D6A, 0x5D6A, 0x2FD9,
- 0x5D6B, 0x5D6B, 0x15D5, 0x5D6C, 0x5D6C, 0x15D1, 0x5D6D, 0x5D6E, 0x2FDA,
- 0x5D6F, 0x5D6F, 0x15D3, 0x5D70, 0x5D73, 0x2FDC, 0x5D74, 0x5D74, 0x15D9,
- 0x5D75, 0x5D80, 0x2FE0, 0x5D81, 0x5D81, 0x2391, 0x5D82, 0x5D82, 0x15DA,
- 0x5D83, 0x5D83, 0x2FEC, 0x5D84, 0x5D84, 0x2271, 0x5D85, 0x5D86, 0x2FED,
- 0x5D87, 0x5D87, 0x2388, 0x5D88, 0x5D96, 0x2FEF, 0x5D97, 0x5D97, 0x238E,
- 0x5D98, 0x5D98, 0x2FFE, 0x5D99, 0x5D99, 0x15DB, 0x5D9A, 0x5D9C, 0x2FFF,
- 0x5D9D, 0x5D9D, 0x15DC, 0x5D9E, 0x5D9F, 0x3002, 0x5DA0, 0x5DA0, 0x238D,
- 0x5DA1, 0x5DA6, 0x3004, 0x5DA7, 0x5DA7, 0x238C, 0x5DA8, 0x5DB6, 0x300A,
- 0x5DB7, 0x5DB7, 0x15DE, 0x5DB8, 0x5DB8, 0x2390, 0x5DB9, 0x5DB9, 0x3019,
- 0x5DBA, 0x5DBA, 0x2033, 0x5DBB, 0x5DBB, 0x301A, 0x5DBC, 0x5DBC, 0x223C,
- 0x5DBD, 0x5DC4, 0x301B, 0x5DC5, 0x5DC5, 0x15DF, 0x5DC6, 0x5DCA, 0x3023,
- 0x5DCB, 0x5DCB, 0x1FE9, 0x5DCC, 0x5DCC, 0x3028, 0x5DCD, 0x5DCD, 0x0EB0,
- 0x5DCE, 0x5DD1, 0x3029, 0x5DD2, 0x5DD2, 0x2055, 0x5DD3, 0x5DD3, 0x302D,
- 0x5DD4, 0x5DD4, 0x2392, 0x5DD5, 0x5DDA, 0x302E, 0x5DDB, 0x5DDB, 0x1815,
- 0x5DDC, 0x5DDC, 0x3034, 0x5DDD, 0x5DDD, 0x052B, 0x5DDE, 0x5DDE, 0x11DC,
- 0x5DDF, 0x5DE0, 0x3035, 0x5DE1, 0x5DE1, 0x0FDB, 0x5DE2, 0x5DE2, 0x04D7,
- 0x5DE3, 0x5DE4, 0x3037, 0x5DE5, 0x5DE5, 0x06FD, 0x5DE6, 0x5DE6, 0x1250,
- 0x5DE7, 0x5DE7, 0x0C46, 0x5DE8, 0x5DE8, 0x090D, 0x5DE9, 0x5DE9, 0x0707,
- 0x5DEA, 0x5DEA, 0x3039, 0x5DEB, 0x5DEB, 0x0EE6, 0x5DEC, 0x5DED, 0x303A,
- 0x5DEE, 0x5DEE, 0x04B5, 0x5DEF, 0x5DEF, 0x139F, 0x5DF0, 0x5DF0, 0x2324,
- 0x5DF1, 0x5DF1, 0x082D, 0x5DF2, 0x5DF2, 0x1058, 0x5DF3, 0x5DF3, 0x0DBD,
- 0x5DF4, 0x5DF4, 0x03D8, 0x5DF5, 0x5DF6, 0x303C, 0x5DF7, 0x5DF7, 0x0F5C,
- 0x5DF8, 0x5DFC, 0x303E, 0x5DFD, 0x5DFD, 0x12F7, 0x5DFE, 0x5DFE, 0x08BE,
- 0x5DFF, 0x5DFF, 0x3043, 0x5E00, 0x5E00, 0x3044, 0x5E01, 0x5E01, 0x043B,
- 0x5E02, 0x5E02, 0x0D67, 0x5E03, 0x5E03, 0x0483, 0x5E04, 0x5E04, 0x3045,
- 0x5E05, 0x5E05, 0x0D9C, 0x5E06, 0x5E06, 0x0648, 0x5E07, 0x5E07, 0x3046,
- 0x5E08, 0x5E08, 0x0D3D, 0x5E09, 0x5E0B, 0x3047, 0x5E0C, 0x5E0C, 0x0F10,
- 0x5E0D, 0x5E0E, 0x304A, 0x5E0F, 0x5E0F, 0x159E, 0x5E10, 0x5E10, 0x116B,
- 0x5E11, 0x5E11, 0x15A1, 0x5E12, 0x5E13, 0x304C, 0x5E14, 0x5E14, 0x15A0,
- 0x5E15, 0x5E15, 0x0B82, 0x5E16, 0x5E16, 0x0E4E, 0x5E17, 0x5E17, 0x304E,
- 0x5E18, 0x5E18, 0x09FA, 0x5E19, 0x5E19, 0x159F, 0x5E1A, 0x5E1A, 0x11E2,
- 0x5E1B, 0x5E1B, 0x0476, 0x5E1C, 0x5E1C, 0x11C3, 0x5E1D, 0x5E1D, 0x05BC,
- 0x5E1E, 0x5E24, 0x304F, 0x5E25, 0x5E25, 0x2143, 0x5E26, 0x5E26, 0x057B,
- 0x5E27, 0x5E27, 0x11A0, 0x5E28, 0x5E2A, 0x3056, 0x5E2B, 0x5E2B, 0x2129,
- 0x5E2C, 0x5E2C, 0x3059, 0x5E2D, 0x5E2D, 0x0F1C, 0x5E2E, 0x5E2E, 0x03FA,
- 0x5E2F, 0x5E30, 0x305A, 0x5E31, 0x5E31, 0x15A2, 0x5E32, 0x5E32, 0x305C,
- 0x5E33, 0x5E33, 0x2277, 0x5E34, 0x5E35, 0x305D, 0x5E36, 0x5E36, 0x1EA7,
- 0x5E37, 0x5E37, 0x15A5, 0x5E38, 0x5E38, 0x04C8, 0x5E39, 0x5E3A, 0x305F,
- 0x5E3B, 0x5E3C, 0x15A3, 0x5E3D, 0x5E3D, 0x0AB6, 0x5E3E, 0x5E3F, 0x3061,
- 0x5E40, 0x5E40, 0x2285, 0x5E41, 0x5E41, 0x3063, 0x5E42, 0x5E42, 0x0AE2,
- 0x5E43, 0x5E43, 0x2384, 0x5E44, 0x5E44, 0x15A6, 0x5E45, 0x5E45, 0x0696,
- 0x5E46, 0x5E4B, 0x3064, 0x5E4C, 0x5E4C, 0x07E4, 0x5E4D, 0x5E53, 0x306A,
- 0x5E54, 0x5E54, 0x15A7, 0x5E55, 0x5E55, 0x0B1E, 0x5E56, 0x5E56, 0x3071,
- 0x5E57, 0x5E57, 0x2387, 0x5E58, 0x5E58, 0x2386, 0x5E59, 0x5E5A, 0x3072,
- 0x5E5B, 0x5E5B, 0x15A8, 0x5E5C, 0x5E5D, 0x3074, 0x5E5E, 0x5E5E, 0x15A9,
- 0x5E5F, 0x5E5F, 0x2290, 0x5E60, 0x5E60, 0x3076, 0x5E61, 0x5E61, 0x15AA,
- 0x5E62, 0x5E62, 0x0534, 0x5E63, 0x5E63, 0x1E44, 0x5E64, 0x5E6A, 0x3077,
- 0x5E6B, 0x5E6B, 0x1E32, 0x5E6C, 0x5E6C, 0x2385, 0x5E6D, 0x5E71, 0x307E,
- 0x5E72, 0x5E72, 0x06C4, 0x5E73, 0x5E73, 0x0BDC, 0x5E74, 0x5E74, 0x0B4D,
- 0x5E75, 0x5E75, 0x3083, 0x5E76, 0x5E76, 0x0469, 0x5E77, 0x5E77, 0x3084,
- 0x5E78, 0x5E78, 0x0F9D, 0x5E79, 0x5E79, 0x1F13, 0x5E7A, 0x5E7A, 0x1813,
- 0x5E7B, 0x5E7B, 0x07D8, 0x5E7C, 0x5E7C, 0x10BC, 0x5E7D, 0x5E7D, 0x10A9,
- 0x5E7E, 0x5E7E, 0x1F73, 0x5E7F, 0x5E7F, 0x073C, 0x5E80, 0x5E80, 0x1631,
- 0x5E81, 0x5E83, 0x3085, 0x5E84, 0x5E84, 0x120C, 0x5E85, 0x5E85, 0x3088,
- 0x5E86, 0x5E86, 0x0C69, 0x5E87, 0x5E87, 0x043C, 0x5E88, 0x5E89, 0x3089,
- 0x5E8A, 0x5E8A, 0x0535, 0x5E8B, 0x5E8B, 0x1633, 0x5E8C, 0x5E8E, 0x308B,
- 0x5E8F, 0x5E8F, 0x0FBD, 0x5E90, 0x5E90, 0x0A55, 0x5E91, 0x5E91, 0x1632,
- 0x5E92, 0x5E92, 0x308E, 0x5E93, 0x5E93, 0x096F, 0x5E94, 0x5E94, 0x108B,
- 0x5E95, 0x5E95, 0x05B8, 0x5E96, 0x5E96, 0x1634, 0x5E97, 0x5E97, 0x05CB,
- 0x5E98, 0x5E98, 0x308F, 0x5E99, 0x5E99, 0x0AF2, 0x5E9A, 0x5E9A, 0x06F8,
- 0x5E9B, 0x5E9B, 0x3090, 0x5E9C, 0x5E9C, 0x06A9, 0x5E9D, 0x5E9D, 0x3091,
- 0x5E9E, 0x5E9E, 0x0B94, 0x5E9F, 0x5E9F, 0x066C, 0x5EA0, 0x5EA0, 0x1636,
- 0x5EA1, 0x5EA4, 0x3092, 0x5EA5, 0x5EA5, 0x1635, 0x5EA6, 0x5EA6, 0x0607,
- 0x5EA7, 0x5EA7, 0x1256, 0x5EA8, 0x5EAA, 0x3096, 0x5EAB, 0x5EAB, 0x1FE0,
- 0x5EAC, 0x5EAC, 0x3099, 0x5EAD, 0x5EAD, 0x0E56, 0x5EAE, 0x5EB2, 0x309A,
- 0x5EB3, 0x5EB3, 0x163A, 0x5EB4, 0x5EB4, 0x309F, 0x5EB5, 0x5EB5, 0x1638,
- 0x5EB6, 0x5EB6, 0x0D93, 0x5EB7, 0x5EB7, 0x0942, 0x5EB8, 0x5EB8, 0x109E,
- 0x5EB9, 0x5EB9, 0x1637, 0x5EBA, 0x5EBD, 0x30A0, 0x5EBE, 0x5EBE, 0x1639,
- 0x5EBF, 0x5EC8, 0x30A4, 0x5EC9, 0x5EC9, 0x09F7, 0x5ECA, 0x5ECA, 0x09B3,
- 0x5ECB, 0x5ED0, 0x30AE, 0x5ED1, 0x5ED1, 0x163D, 0x5ED2, 0x5ED2, 0x163C,
- 0x5ED3, 0x5ED3, 0x0995, 0x5ED4, 0x5ED5, 0x30B4, 0x5ED6, 0x5ED6, 0x0A17,
- 0x5ED7, 0x5EDA, 0x30B6, 0x5EDB, 0x5EDB, 0x163E, 0x5EDC, 0x5EDE, 0x30BA,
- 0x5EDF, 0x5EDF, 0x2087, 0x5EE0, 0x5EE0, 0x1E78, 0x5EE1, 0x5EE1, 0x23AE,
- 0x5EE2, 0x5EE2, 0x1EF6, 0x5EE3, 0x5EE3, 0x1F31, 0x5EE4, 0x5EE7, 0x30BD,
- 0x5EE8, 0x5EE8, 0x163F, 0x5EE9, 0x5EE9, 0x30C1, 0x5EEA, 0x5EEA, 0x1640,
- 0x5EEB, 0x5EEB, 0x30C2, 0x5EEC, 0x5EEC, 0x2045, 0x5EED, 0x5EF2, 0x30C3,
- 0x5EF3, 0x5EF3, 0x2178, 0x5EF4, 0x5EF4, 0x1398, 0x5EF5, 0x5EF5, 0x30C9,
- 0x5EF6, 0x5EF6, 0x0FFC, 0x5EF7, 0x5EF7, 0x0E53, 0x5EF8, 0x5EF9, 0x30CA,
- 0x5EFA, 0x5EFA, 0x0879, 0x5EFB, 0x5EFD, 0x30CC, 0x5EFE, 0x5EFE, 0x14AD,
- 0x5EFF, 0x5EFF, 0x125B, 0x5F00, 0x5F00, 0x0937, 0x5F01, 0x5F01, 0x139D,
- 0x5F02, 0x5F02, 0x1073, 0x5F03, 0x5F03, 0x0C19, 0x5F04, 0x5F04, 0x0B6B,
- 0x5F05, 0x5F07, 0x30CF, 0x5F08, 0x5F08, 0x14AE, 0x5F09, 0x5F09, 0x30D2,
- 0x5F0A, 0x5F0A, 0x0440, 0x5F0B, 0x5F0B, 0x14F6, 0x5F0C, 0x5F0E, 0x30D3,
- 0x5F0F, 0x5F0F, 0x0D54, 0x5F10, 0x5F10, 0x30D6, 0x5F11, 0x5F11, 0x14F9,
- 0x5F12, 0x5F12, 0x30D7, 0x5F13, 0x5F13, 0x0706, 0x5F14, 0x5F14, 0x30D8,
- 0x5F15, 0x5F15, 0x1084, 0x5F16, 0x5F16, 0x30D9, 0x5F17, 0x5F17, 0x06A0,
- 0x5F18, 0x5F18, 0x07A2, 0x5F19, 0x5F1A, 0x30DA, 0x5F1B, 0x5F1B, 0x04FF,
- 0x5F1C, 0x5F1E, 0x30DC, 0x5F1F, 0x5F1F, 0x05BD, 0x5F20, 0x5F20, 0x1166,
- 0x5F21, 0x5F24, 0x30DF, 0x5F25, 0x5F25, 0x0ADB, 0x5F26, 0x5F26, 0x0F3F,
- 0x5F27, 0x5F27, 0x07B6, 0x5F28, 0x5F28, 0x30E3, 0x5F29, 0x5F29, 0x176F,
- 0x5F2A, 0x5F2A, 0x176E, 0x5F2B, 0x5F2C, 0x30E4, 0x5F2D, 0x5F2D, 0x1770,
- 0x5F2E, 0x5F2E, 0x30E6, 0x5F2F, 0x5F2F, 0x0E95, 0x5F30, 0x5F30, 0x30E7,
- 0x5F31, 0x5F31, 0x0CD0, 0x5F32, 0x5F32, 0x30E8, 0x5F33, 0x5F33, 0x23F5,
- 0x5F34, 0x5F34, 0x30E9, 0x5F35, 0x5F35, 0x2275, 0x5F36, 0x5F38, 0x30EA,
- 0x5F39, 0x5F39, 0x0590, 0x5F3A, 0x5F3A, 0x0C3C, 0x5F3B, 0x5F3B, 0x30ED,
- 0x5F3C, 0x5F3C, 0x1772, 0x5F3D, 0x5F3F, 0x30EE, 0x5F40, 0x5F40, 0x19BE,
- 0x5F41, 0x5F45, 0x30F1, 0x5F46, 0x5F46, 0x266E, 0x5F47, 0x5F47, 0x30F6,
- 0x5F48, 0x5F48, 0x1EB0, 0x5F49, 0x5F4B, 0x30F7, 0x5F4C, 0x5F4C, 0x2083,
- 0x5F4D, 0x5F4D, 0x30FA, 0x5F4E, 0x5F4E, 0x2188, 0x5F4F, 0x5F4F, 0x30FB,
- 0x5F50, 0x5F50, 0x1762, 0x5F51, 0x5F51, 0x30FC, 0x5F52, 0x5F52, 0x0742,
- 0x5F53, 0x5F53, 0x0592, 0x5F54, 0x5F54, 0x30FD, 0x5F55, 0x5F55, 0x0A63,
- 0x5F56, 0x5F56, 0x1764, 0x5F57, 0x5F57, 0x1763, 0x5F58, 0x5F58, 0x1765,
- 0x5F59, 0x5F59, 0x267C, 0x5F5A, 0x5F5C, 0x30FE, 0x5F5D, 0x5F5D, 0x1054,
- 0x5F5E, 0x5F60, 0x3101, 0x5F61, 0x5F61, 0x15EE, 0x5F62, 0x5F62, 0x0F99,
- 0x5F63, 0x5F63, 0x3104, 0x5F64, 0x5F64, 0x0E5F, 0x5F65, 0x5F65, 0x3105,
- 0x5F66, 0x5F66, 0x100E, 0x5F67, 0x5F68, 0x3106, 0x5F69, 0x5F69, 0x0491,
- 0x5F6A, 0x5F6A, 0x0454, 0x5F6B, 0x5F6B, 0x3108, 0x5F6C, 0x5F6C, 0x045B,
- 0x5F6D, 0x5F6D, 0x0BAE, 0x5F6E, 0x5F6F, 0x3109, 0x5F70, 0x5F70, 0x1164,
- 0x5F71, 0x5F71, 0x1095, 0x5F72, 0x5F72, 0x310B, 0x5F73, 0x5F73, 0x15E0,
- 0x5F74, 0x5F76, 0x310C, 0x5F77, 0x5F77, 0x15E1, 0x5F78, 0x5F78, 0x310F,
- 0x5F79, 0x5F79, 0x1062, 0x5F7A, 0x5F7A, 0x3110, 0x5F7B, 0x5F7B, 0x04DE,
- 0x5F7C, 0x5F7C, 0x0434, 0x5F7D, 0x5F7F, 0x3111, 0x5F80, 0x5F80, 0x0EAA,
- 0x5F81, 0x5F81, 0x1198, 0x5F82, 0x5F82, 0x15E2, 0x5F83, 0x5F83, 0x3114,
- 0x5F84, 0x5F84, 0x08E5, 0x5F85, 0x5F85, 0x0580, 0x5F86, 0x5F86, 0x3115,
- 0x5F87, 0x5F87, 0x15E3, 0x5F88, 0x5F88, 0x0793, 0x5F89, 0x5F89, 0x15E4,
- 0x5F8A, 0x5F8A, 0x07C7, 0x5F8B, 0x5F8B, 0x0A70, 0x5F8C, 0x5F8C, 0x15E5,
- 0x5F8D, 0x5F8F, 0x3116, 0x5F90, 0x5F90, 0x0FB7, 0x5F91, 0x5F91, 0x1FC5,
- 0x5F92, 0x5F92, 0x0E6E, 0x5F93, 0x5F94, 0x3119, 0x5F95, 0x5F95, 0x15E6,
- 0x5F96, 0x5F96, 0x311B, 0x5F97, 0x5F97, 0x05A4, 0x5F98, 0x5F98, 0x0B88,
- 0x5F99, 0x5F99, 0x15E7, 0x5F9A, 0x5F9B, 0x311C, 0x5F9C, 0x5F9C, 0x15E8,
- 0x5F9D, 0x5F9D, 0x311E, 0x5F9E, 0x5F9E, 0x1EA1, 0x5F9F, 0x5F9F, 0x311F,
- 0x5FA0, 0x5FA0, 0x2393, 0x5FA1, 0x5FA1, 0x10DE, 0x5FA2, 0x5FA7, 0x3120,
- 0x5FA8, 0x5FA8, 0x15E9, 0x5FA9, 0x5FA9, 0x1F0B, 0x5FAA, 0x5FAA, 0x0FD6,
- 0x5FAB, 0x5FAC, 0x3126, 0x5FAD, 0x5FAD, 0x15EA, 0x5FAE, 0x5FAE, 0x0EB1,
- 0x5FAF, 0x5FB4, 0x3128, 0x5FB5, 0x5FB5, 0x15EB, 0x5FB6, 0x5FB6, 0x312E,
- 0x5FB7, 0x5FB7, 0x05A3, 0x5FB8, 0x5FB8, 0x312F, 0x5FB9, 0x5FB9, 0x1E7C,
- 0x5FBA, 0x5FBB, 0x3130, 0x5FBC, 0x5FBC, 0x15EC, 0x5FBD, 0x5FBD, 0x07EA,
- 0x5FBE, 0x5FC2, 0x3132, 0x5FC3, 0x5FC3, 0x0F8F, 0x5FC4, 0x5FC4, 0x1642,
- 0x5FC5, 0x5FC5, 0x0441, 0x5FC6, 0x5FC6, 0x106B, 0x5FC7, 0x5FC8, 0x3137,
- 0x5FC9, 0x5FC9, 0x1643, 0x5FCA, 0x5FCB, 0x3139, 0x5FCC, 0x5FCC, 0x083C,
- 0x5FCD, 0x5FCD, 0x0CA7, 0x5FCE, 0x5FCE, 0x313B, 0x5FCF, 0x5FCF, 0x1645,
- 0x5FD0, 0x5FD0, 0x1A0C, 0x5FD1, 0x5FD1, 0x1A0B, 0x5FD2, 0x5FD2, 0x14F7,
- 0x5FD3, 0x5FD5, 0x313C, 0x5FD6, 0x5FD6, 0x1644, 0x5FD7, 0x5FD7, 0x11BD,
- 0x5FD8, 0x5FD8, 0x0EAD, 0x5FD9, 0x5FD9, 0x0AAB, 0x5FDA, 0x5FDC, 0x313F,
- 0x5FDD, 0x5FDD, 0x1683, 0x5FDE, 0x5FDF, 0x3142, 0x5FE0, 0x5FE0, 0x11D1,
- 0x5FE1, 0x5FE1, 0x1649, 0x5FE2, 0x5FE3, 0x3144, 0x5FE4, 0x5FE4, 0x164A,
- 0x5FE5, 0x5FE6, 0x3146, 0x5FE7, 0x5FE7, 0x10AC, 0x5FE8, 0x5FE9, 0x3148,
- 0x5FEA, 0x5FEA, 0x164E, 0x5FEB, 0x5FEB, 0x0979, 0x5FEC, 0x5FEC, 0x314A,
- 0x5FED, 0x5FED, 0x164F, 0x5FEE, 0x5FEE, 0x1647, 0x5FEF, 0x5FF0, 0x314B,
- 0x5FF1, 0x5FF1, 0x04E5, 0x5FF2, 0x5FF4, 0x314D, 0x5FF5, 0x5FF5, 0x0B51,
- 0x5FF6, 0x5FF7, 0x3150, 0x5FF8, 0x5FF8, 0x1650, 0x5FF9, 0x5FFA, 0x3152,
- 0x5FFB, 0x5FFB, 0x0F8E, 0x5FFC, 0x5FFC, 0x3154, 0x5FFD, 0x5FFD, 0x07AD,
- 0x5FFE, 0x5FFE, 0x164B, 0x5FFF, 0x5FFF, 0x067B, 0x6000, 0x6000, 0x07C8,
- 0x6001, 0x6001, 0x0DFF, 0x6002, 0x6002, 0x0DC0, 0x6003, 0x6003, 0x1646,
- 0x6004, 0x6004, 0x1648, 0x6005, 0x6006, 0x164C, 0x6007, 0x6009, 0x3155,
- 0x600A, 0x600A, 0x1659, 0x600B, 0x600C, 0x3158, 0x600D, 0x600D, 0x1656,
- 0x600E, 0x600E, 0x1138, 0x600F, 0x600F, 0x1655, 0x6010, 0x6011, 0x315A,
- 0x6012, 0x6012, 0x0B6E, 0x6013, 0x6013, 0x315C, 0x6014, 0x6014, 0x119B,
- 0x6015, 0x6015, 0x0B83, 0x6016, 0x6016, 0x0487, 0x6017, 0x6018, 0x315D,
- 0x6019, 0x6019, 0x1651, 0x601A, 0x601A, 0x315F, 0x601B, 0x601B, 0x1654,
- 0x601C, 0x601C, 0x09F8, 0x601D, 0x601D, 0x0DB1, 0x601E, 0x601F, 0x3160,
- 0x6020, 0x6020, 0x0582, 0x6021, 0x6021, 0x165B, 0x6022, 0x6024, 0x3162,
- 0x6025, 0x6025, 0x0824, 0x6026, 0x6026, 0x1653, 0x6027, 0x6027, 0x0F9F,
- 0x6028, 0x6028, 0x10FC, 0x6029, 0x6029, 0x1657, 0x602A, 0x602A, 0x072F,
- 0x602B, 0x602B, 0x1658, 0x602C, 0x602E, 0x3165, 0x602F, 0x602F, 0x0C50,
- 0x6030, 0x6034, 0x3168, 0x6035, 0x6035, 0x1652, 0x6036, 0x603A, 0x316D,
- 0x603B, 0x603B, 0x1239, 0x603C, 0x603C, 0x1A0D, 0x603D, 0x603E, 0x3172,
- 0x603F, 0x603F, 0x165A, 0x6040, 0x6040, 0x3174, 0x6041, 0x6041, 0x1A11,
- 0x6042, 0x6042, 0x1660, 0x6043, 0x6043, 0x0D68, 0x6044, 0x604A, 0x3175,
- 0x604B, 0x604B, 0x09FE, 0x604C, 0x604C, 0x317C, 0x604D, 0x604D, 0x07E5,
- 0x604E, 0x604F, 0x317D, 0x6050, 0x6050, 0x0963, 0x6051, 0x6051, 0x317F,
- 0x6052, 0x6052, 0x079A, 0x6053, 0x6054, 0x3180, 0x6055, 0x6055, 0x0D96,
- 0x6056, 0x6058, 0x3182, 0x6059, 0x6059, 0x1A12, 0x605A, 0x605A, 0x1A0F,
- 0x605B, 0x605C, 0x3185, 0x605D, 0x605D, 0x1A0E, 0x605E, 0x6061, 0x3187,
- 0x6062, 0x6062, 0x07EB, 0x6063, 0x6063, 0x1A13, 0x6064, 0x6064, 0x0FBF,
- 0x6065, 0x6066, 0x318B, 0x6067, 0x6067, 0x1A10, 0x6068, 0x6068, 0x0795,
- 0x6069, 0x6069, 0x0636, 0x606A, 0x606A, 0x1661, 0x606B, 0x606B, 0x05F1,
- 0x606C, 0x606C, 0x0E44, 0x606D, 0x606D, 0x0700, 0x606E, 0x606E, 0x318D,
- 0x606F, 0x606F, 0x0F0F, 0x6070, 0x6070, 0x0C1E, 0x6071, 0x6072, 0x318E,
- 0x6073, 0x6073, 0x095F, 0x6074, 0x6075, 0x3190, 0x6076, 0x6076, 0x0630,
- 0x6077, 0x6077, 0x3192, 0x6078, 0x6079, 0x165C, 0x607A, 0x607A, 0x165F,
- 0x607B, 0x607B, 0x165E, 0x607C, 0x607C, 0x0B38, 0x607D, 0x607D, 0x1662,
- 0x607E, 0x607E, 0x3193, 0x607F, 0x607F, 0x10A6, 0x6080, 0x6082, 0x3194,
- 0x6083, 0x6083, 0x1667, 0x6084, 0x6084, 0x0C41, 0x6085, 0x6088, 0x3197,
- 0x6089, 0x6089, 0x0F11, 0x608A, 0x608B, 0x319B, 0x608C, 0x608C, 0x1669,
- 0x608D, 0x608D, 0x076E, 0x608E, 0x6091, 0x319D, 0x6092, 0x6092, 0x1668,
- 0x6093, 0x6093, 0x31A1, 0x6094, 0x6094, 0x07EF, 0x6095, 0x6095, 0x31A2,
- 0x6096, 0x6096, 0x1663, 0x6097, 0x6099, 0x31A3, 0x609A, 0x609A, 0x1664,
- 0x609B, 0x609B, 0x166A, 0x609C, 0x609C, 0x31A6, 0x609D, 0x609D, 0x1666,
- 0x609E, 0x609E, 0x31A7, 0x609F, 0x609F, 0x0F01, 0x60A0, 0x60A0, 0x10AB,
- 0x60A1, 0x60A2, 0x31A8, 0x60A3, 0x60A3, 0x07D1, 0x60A4, 0x60A5, 0x31AA,
- 0x60A6, 0x60A6, 0x1106, 0x60A7, 0x60A7, 0x31AC, 0x60A8, 0x60A8, 0x0B5D,
- 0x60A9, 0x60AA, 0x31AD, 0x60AB, 0x60AB, 0x1A14, 0x60AC, 0x60AC, 0x0FC7,
- 0x60AD, 0x60AD, 0x1665, 0x60AE, 0x60AE, 0x31AF, 0x60AF, 0x60AF, 0x0AFA,
- 0x60B0, 0x60B0, 0x31B0, 0x60B1, 0x60B1, 0x166D, 0x60B2, 0x60B2, 0x0418,
- 0x60B3, 0x60B3, 0x31B1, 0x60B4, 0x60B4, 0x1672, 0x60B5, 0x60B5, 0x23B4,
- 0x60B6, 0x60B6, 0x207E, 0x60B7, 0x60B7, 0x31B2, 0x60B8, 0x60B8, 0x0835,
- 0x60B9, 0x60BA, 0x31B3, 0x60BB, 0x60BB, 0x166C, 0x60BC, 0x60BC, 0x05A0,
- 0x60BD, 0x60C4, 0x31B5, 0x60C5, 0x60C5, 0x0C66, 0x60C6, 0x60C6, 0x1670,
- 0x60C7, 0x60C9, 0x31BD, 0x60CA, 0x60CA, 0x08D9, 0x60CB, 0x60CB, 0x0EA0,
- 0x60CC, 0x60D0, 0x31C0, 0x60D1, 0x60D1, 0x0808, 0x60D2, 0x60D4, 0x31C5,
- 0x60D5, 0x60D5, 0x0E3B, 0x60D6, 0x60D7, 0x31C8, 0x60D8, 0x60D8, 0x166F,
- 0x60D9, 0x60D9, 0x31CA, 0x60DA, 0x60DA, 0x1671, 0x60DB, 0x60DB, 0x31CB,
- 0x60DC, 0x60DC, 0x0F14, 0x60DD, 0x60DD, 0x166E, 0x60DE, 0x60DE, 0x31CC,
- 0x60DF, 0x60DF, 0x0EB8, 0x60E0, 0x60E0, 0x07F2, 0x60E1, 0x60E1, 0x1EE3,
- 0x60E2, 0x60E5, 0x31CD, 0x60E6, 0x60E6, 0x05CC, 0x60E7, 0x60E7, 0x0914,
- 0x60E8, 0x60E8, 0x0499, 0x60E9, 0x60E9, 0x04F2, 0x60EA, 0x60EA, 0x31D1,
- 0x60EB, 0x60EB, 0x0422, 0x60EC, 0x60EC, 0x166B, 0x60ED, 0x60ED, 0x0498,
- 0x60EE, 0x60EE, 0x058D, 0x60EF, 0x60EF, 0x0738, 0x60F0, 0x60F0, 0x0627,
- 0x60F1, 0x60F1, 0x2095, 0x60F2, 0x60F2, 0x23BB, 0x60F3, 0x60F3, 0x0F58,
- 0x60F4, 0x60F4, 0x1677, 0x60F5, 0x60F5, 0x31D2, 0x60F6, 0x60F6, 0x07E1,
- 0x60F7, 0x60F8, 0x31D3, 0x60F9, 0x60F9, 0x0CA2, 0x60FA, 0x60FA, 0x0F95,
- 0x60FB, 0x60FB, 0x23B9, 0x60FC, 0x60FF, 0x31D5, 0x6100, 0x6100, 0x1678,
- 0x6101, 0x6101, 0x0513, 0x6102, 0x6105, 0x31D9, 0x6106, 0x6106, 0x1A15,
- 0x6107, 0x6107, 0x31DD, 0x6108, 0x6108, 0x10DF, 0x6109, 0x6109, 0x10C9,
- 0x610A, 0x610C, 0x31DE, 0x610D, 0x610D, 0x1A16, 0x610E, 0x610E, 0x1679,
- 0x610F, 0x610F, 0x1069, 0x6110, 0x6114, 0x31E1, 0x6115, 0x6115, 0x1675,
- 0x6116, 0x6119, 0x31E6, 0x611A, 0x611A, 0x10C3, 0x611B, 0x611B, 0x1E28,
- 0x611C, 0x611C, 0x23BD, 0x611D, 0x611E, 0x31EA, 0x611F, 0x611F, 0x06CB,
- 0x6120, 0x6120, 0x1673, 0x6121, 0x6122, 0x31EC, 0x6123, 0x6123, 0x1676,
- 0x6124, 0x6124, 0x067C, 0x6125, 0x6125, 0x31EE, 0x6126, 0x6126, 0x1674,
- 0x6127, 0x6127, 0x098D, 0x6128, 0x612A, 0x31EF, 0x612B, 0x612B, 0x167A,
- 0x612C, 0x6133, 0x31F2, 0x6134, 0x6134, 0x23B5, 0x6135, 0x6136, 0x31FA,
- 0x6137, 0x6137, 0x23BA, 0x6138, 0x613D, 0x31FC, 0x613E, 0x613E, 0x23B3,
- 0x613F, 0x613F, 0x10FB, 0x6140, 0x6147, 0x3202, 0x6148, 0x6148, 0x054B,
- 0x6149, 0x6149, 0x320A, 0x614A, 0x614A, 0x167B, 0x614B, 0x614B, 0x2162,
- 0x614C, 0x614C, 0x07DA, 0x614D, 0x614D, 0x320B, 0x614E, 0x614E, 0x0D30,
- 0x614F, 0x6150, 0x320C, 0x6151, 0x6151, 0x0D1E, 0x6152, 0x6154, 0x320E,
- 0x6155, 0x6155, 0x0B20, 0x6156, 0x6157, 0x3211, 0x6158, 0x6158, 0x1E5E,
- 0x6159, 0x6159, 0x3213, 0x615A, 0x615A, 0x1E5D, 0x615B, 0x615C, 0x3214,
- 0x615D, 0x615D, 0x1A17, 0x615E, 0x615E, 0x3216, 0x615F, 0x615F, 0x23B7,
- 0x6160, 0x6161, 0x3217, 0x6162, 0x6162, 0x0AA4, 0x6163, 0x6163, 0x1F2F,
- 0x6164, 0x6164, 0x24DF, 0x6165, 0x6166, 0x3219, 0x6167, 0x6167, 0x07F0,
- 0x6168, 0x6168, 0x093B, 0x6169, 0x6169, 0x321B, 0x616A, 0x616A, 0x23B2,
- 0x616B, 0x616B, 0x214E, 0x616C, 0x616D, 0x321C, 0x616E, 0x616E, 0x2052,
- 0x616F, 0x616F, 0x321E, 0x6170, 0x6170, 0x0ECE, 0x6171, 0x6172, 0x321F,
- 0x6173, 0x6173, 0x23BC, 0x6174, 0x6174, 0x3221, 0x6175, 0x6175, 0x167C,
- 0x6176, 0x6176, 0x20EB, 0x6177, 0x6177, 0x0943, 0x6178, 0x6181, 0x3222,
- 0x6182, 0x6182, 0x2232, 0x6183, 0x6189, 0x322C, 0x618A, 0x618A, 0x1E3F,
- 0x618B, 0x618B, 0x0458, 0x618C, 0x618D, 0x3233, 0x618E, 0x618E, 0x113A,
- 0x618F, 0x618F, 0x3235, 0x6190, 0x6190, 0x201B, 0x6191, 0x6191, 0x20BC,
- 0x6192, 0x6192, 0x23BE, 0x6193, 0x6193, 0x3236, 0x6194, 0x6194, 0x167E,
- 0x6195, 0x6199, 0x3237, 0x619A, 0x619A, 0x1EAE, 0x619B, 0x619C, 0x323C,
- 0x619D, 0x619D, 0x1A19, 0x619E, 0x61A3, 0x323E, 0x61A4, 0x61A4, 0x1EFB,
- 0x61A5, 0x61A6, 0x3244, 0x61A7, 0x61A7, 0x167F, 0x61A8, 0x61A8, 0x0760,
- 0x61A9, 0x61A9, 0x1A18, 0x61AA, 0x61AA, 0x3246, 0x61AB, 0x61AB, 0x2089,
- 0x61AC, 0x61AC, 0x167D, 0x61AD, 0x61AD, 0x3247, 0x61AE, 0x61AE, 0x23B1,
- 0x61AF, 0x61B1, 0x3248, 0x61B2, 0x61B2, 0x21C4, 0x61B3, 0x61B5, 0x324B,
- 0x61B6, 0x61B6, 0x2214, 0x61B7, 0x61B7, 0x1680, 0x61B8, 0x61BD, 0x324E,
- 0x61BE, 0x61BE, 0x076D, 0x61BF, 0x61C1, 0x3254, 0x61C2, 0x61C2, 0x05ED,
- 0x61C3, 0x61C6, 0x3257, 0x61C7, 0x61C7, 0x1FDE, 0x61C8, 0x61C8, 0x0F83,
- 0x61C9, 0x61C9, 0x2223, 0x61CA, 0x61CA, 0x03CE, 0x61CB, 0x61CB, 0x1A1A,
- 0x61CC, 0x61CC, 0x23B6, 0x61CD, 0x61D0, 0x325B, 0x61D1, 0x61D1, 0x1A1B,
- 0x61D2, 0x61D2, 0x09AC, 0x61D3, 0x61D3, 0x325F, 0x61D4, 0x61D4, 0x1681,
- 0x61D5, 0x61DD, 0x3260, 0x61DE, 0x61DE, 0x268C, 0x61DF, 0x61DF, 0x24DE,
- 0x61E0, 0x61E2, 0x3269, 0x61E3, 0x61E3, 0x24E0, 0x61E4, 0x61E5, 0x326C,
- 0x61E6, 0x61E6, 0x0B74, 0x61E7, 0x61E7, 0x326E, 0x61E8, 0x61E8, 0x23B8,
- 0x61E9, 0x61F1, 0x326F, 0x61F2, 0x61F2, 0x1E81, 0x61F3, 0x61F4, 0x3278,
- 0x61F5, 0x61F5, 0x1682, 0x61F6, 0x61F6, 0x1FFE, 0x61F7, 0x61F7, 0x1F51,
- 0x61F8, 0x61F8, 0x21E1, 0x61F9, 0x61F9, 0x327A, 0x61FA, 0x61FA, 0x23B0,
- 0x61FB, 0x61FB, 0x327B, 0x61FC, 0x61FC, 0x1FCE, 0x61FD, 0x61FD, 0x327C,
- 0x61FE, 0x61FE, 0x211E, 0x61FF, 0x61FF, 0x13E0, 0x6200, 0x6200, 0x2021,
- 0x6201, 0x6205, 0x327D, 0x6206, 0x6206, 0x1A1C, 0x6207, 0x6207, 0x24E1,
- 0x6208, 0x6208, 0x06E5, 0x6209, 0x6209, 0x3282, 0x620A, 0x620A, 0x0EFB,
- 0x620B, 0x620B, 0x18F9, 0x620C, 0x620C, 0x0FB2, 0x620D, 0x620D, 0x0D90,
- 0x620E, 0x620E, 0x0CB1, 0x620F, 0x620F, 0x0F24, 0x6210, 0x6210, 0x04EE,
- 0x6211, 0x6211, 0x0EE1, 0x6212, 0x6212, 0x08B5, 0x6213, 0x6213, 0x3283,
- 0x6214, 0x6214, 0x24A3, 0x6215, 0x6215, 0x169E, 0x6216, 0x6216, 0x0807,
- 0x6217, 0x6217, 0x18FA, 0x6218, 0x6218, 0x115E, 0x6219, 0x6219, 0x3284,
- 0x621A, 0x621A, 0x0BFC, 0x621B, 0x621B, 0x18FB, 0x621C, 0x621E, 0x3285,
- 0x621F, 0x621F, 0x18FC, 0x6220, 0x6220, 0x3288, 0x6221, 0x6221, 0x18FE,
- 0x6222, 0x6222, 0x18FD, 0x6223, 0x6223, 0x3289, 0x6224, 0x6224, 0x1900,
- 0x6225, 0x6225, 0x18FF, 0x6226, 0x6226, 0x328A, 0x6227, 0x6227, 0x24A4,
- 0x6228, 0x6229, 0x328B, 0x622A, 0x622A, 0x08A9, 0x622B, 0x622B, 0x328D,
- 0x622C, 0x622C, 0x1901, 0x622D, 0x622D, 0x328E, 0x622E, 0x622E, 0x0A65,
- 0x622F, 0x622F, 0x328F, 0x6230, 0x6230, 0x2273, 0x6231, 0x6231, 0x3290,
- 0x6232, 0x6232, 0x21B0, 0x6233, 0x6233, 0x0544, 0x6234, 0x6234, 0x057A,
- 0x6235, 0x6236, 0x3291, 0x6237, 0x6237, 0x07BC, 0x6238, 0x623C, 0x3293,
- 0x623D, 0x623D, 0x19F4, 0x623E, 0x623E, 0x19F3, 0x623F, 0x623F, 0x065C,
- 0x6240, 0x6240, 0x0DEE, 0x6241, 0x6241, 0x044B, 0x6242, 0x6242, 0x3298,
- 0x6243, 0x6243, 0x19F5, 0x6244, 0x6246, 0x3299, 0x6247, 0x6247, 0x0D01,
- 0x6248, 0x6249, 0x19F6, 0x624A, 0x624A, 0x329C, 0x624B, 0x624B, 0x0D6D,
- 0x624C, 0x624C, 0x14BA, 0x624D, 0x624D, 0x048C, 0x624E, 0x624E, 0x113D,
- 0x624F, 0x6250, 0x329D, 0x6251, 0x6251, 0x0BEA, 0x6252, 0x6252, 0x03D2,
- 0x6253, 0x6253, 0x0575, 0x6254, 0x6254, 0x0CAE, 0x6255, 0x6257, 0x329F,
- 0x6258, 0x6258, 0x0E81, 0x6259, 0x625A, 0x32A2, 0x625B, 0x625B, 0x0945,
- 0x625C, 0x6262, 0x32A4, 0x6263, 0x6263, 0x0968, 0x6264, 0x6265, 0x32AB,
- 0x6266, 0x6266, 0x0C21, 0x6267, 0x6267, 0x11B3, 0x6268, 0x6268, 0x32AD,
- 0x6269, 0x6269, 0x0994, 0x626A, 0x626A, 0x14BB, 0x626B, 0x626B, 0x0CE1,
- 0x626C, 0x626C, 0x1018, 0x626D, 0x626D, 0x0B65, 0x626E, 0x626E, 0x03F2,
- 0x626F, 0x626F, 0x04DB, 0x6270, 0x6270, 0x0CA0, 0x6271, 0x6272, 0x32AE,
- 0x6273, 0x6273, 0x03ED, 0x6274, 0x6275, 0x32B0, 0x6276, 0x6276, 0x0693,
- 0x6277, 0x6278, 0x32B2, 0x6279, 0x6279, 0x0BBB, 0x627A, 0x627B, 0x32B4,
- 0x627C, 0x627C, 0x0632, 0x627D, 0x627D, 0x32B6, 0x627E, 0x627E, 0x1173,
- 0x627F, 0x627F, 0x04F5, 0x6280, 0x6280, 0x082F, 0x6281, 0x6283, 0x32B7,
- 0x6284, 0x6284, 0x04D2, 0x6285, 0x6288, 0x32BA, 0x6289, 0x6289, 0x0920,
- 0x628A, 0x628A, 0x03DC, 0x628B, 0x6290, 0x32BE, 0x6291, 0x6291, 0x105D,
- 0x6292, 0x6292, 0x0D7A, 0x6293, 0x6293, 0x1202, 0x6294, 0x6294, 0x32C4,
- 0x6295, 0x6295, 0x0E67, 0x6296, 0x6296, 0x05F5, 0x6297, 0x6297, 0x0946,
- 0x6298, 0x6298, 0x117C, 0x6299, 0x6299, 0x32C5, 0x629A, 0x629A, 0x06A2,
- 0x629B, 0x629B, 0x0B98, 0x629C, 0x629E, 0x32C6, 0x629F, 0x629F, 0x14BC,
- 0x62A0, 0x62A0, 0x0966, 0x62A1, 0x62A1, 0x0A7C, 0x62A2, 0x62A2, 0x0C3D,
- 0x62A3, 0x62A3, 0x32C9, 0x62A4, 0x62A4, 0x07B9, 0x62A5, 0x62A5, 0x0411,
- 0x62A6, 0x62A7, 0x32CA, 0x62A8, 0x62A8, 0x0BAB, 0x62A9, 0x62AA, 0x32CC,
- 0x62AB, 0x62AB, 0x0BBC, 0x62AC, 0x62AC, 0x0DFA, 0x62AD, 0x62B0, 0x32CE,
- 0x62B1, 0x62B1, 0x0410, 0x62B2, 0x62B4, 0x32D2, 0x62B5, 0x62B5, 0x05B7,
- 0x62B6, 0x62B8, 0x32D5, 0x62B9, 0x62B9, 0x0B0B, 0x62BA, 0x62BA, 0x32D8,
- 0x62BB, 0x62BB, 0x14BD, 0x62BC, 0x62BC, 0x0FE3, 0x62BD, 0x62BD, 0x050E,
- 0x62BE, 0x62BE, 0x32D9, 0x62BF, 0x62BF, 0x0AF7, 0x62C0, 0x62C1, 0x32DA,
- 0x62C2, 0x62C2, 0x0694, 0x62C3, 0x62C3, 0x32DC, 0x62C4, 0x62C4, 0x11F3,
- 0x62C5, 0x62C5, 0x0584, 0x62C6, 0x62C6, 0x04B7, 0x62C7, 0x62C7, 0x0B17,
- 0x62C8, 0x62C8, 0x0B4C, 0x62C9, 0x62C9, 0x0998, 0x62CA, 0x62CA, 0x14BE,
- 0x62CB, 0x62CB, 0x32DD, 0x62CC, 0x62CC, 0x03F3, 0x62CD, 0x62CD, 0x0B85,
- 0x62CE, 0x62CE, 0x0A29, 0x62CF, 0x62CF, 0x32DE, 0x62D0, 0x62D0, 0x072E,
- 0x62D1, 0x62D1, 0x32DF, 0x62D2, 0x62D2, 0x090B, 0x62D3, 0x62D3, 0x0E89,
- 0x62D4, 0x62D4, 0x03D9, 0x62D5, 0x62D5, 0x32E0, 0x62D6, 0x62D6, 0x0E80,
- 0x62D7, 0x62D7, 0x14C0, 0x62D8, 0x62D8, 0x08FF, 0x62D9, 0x62D9, 0x121B,
- 0x62DA, 0x62DA, 0x14BF, 0x62DB, 0x62DB, 0x1171, 0x62DC, 0x62DC, 0x03E8,
- 0x62DD, 0x62DE, 0x32E1, 0x62DF, 0x62DF, 0x0B45, 0x62E0, 0x62E1, 0x32E3,
- 0x62E2, 0x62E2, 0x0A4A, 0x62E3, 0x62E3, 0x0863, 0x62E4, 0x62E4, 0x32E5,
- 0x62E5, 0x62E5, 0x109A, 0x62E6, 0x62E6, 0x09A4, 0x62E7, 0x62E7, 0x0B62,
- 0x62E8, 0x62E8, 0x046D, 0x62E9, 0x62E9, 0x1134, 0x62EA, 0x62EB, 0x32E6,
- 0x62EC, 0x62EC, 0x0993, 0x62ED, 0x62ED, 0x0D5A, 0x62EE, 0x62EE, 0x14C1,
- 0x62EF, 0x62EF, 0x119D, 0x62F0, 0x62F0, 0x32E8, 0x62F1, 0x62F1, 0x0709,
- 0x62F2, 0x62F2, 0x32E9, 0x62F3, 0x62F3, 0x0C88, 0x62F4, 0x62F4, 0x0D9E,
- 0x62F5, 0x62F5, 0x32EA, 0x62F6, 0x62F6, 0x14C3, 0x62F7, 0x62F7, 0x094A,
- 0x62F8, 0x62FB, 0x32EB, 0x62FC, 0x62FC, 0x0BD3, 0x62FD, 0x62FD, 0x1204,
- 0x62FE, 0x62FE, 0x0D47, 0x62FF, 0x62FF, 0x0B26, 0x6300, 0x6300, 0x32EF,
- 0x6301, 0x6301, 0x04FB, 0x6302, 0x6302, 0x072B, 0x6303, 0x6306, 0x32F0,
- 0x6307, 0x6307, 0x11B7, 0x6308, 0x6308, 0x194E, 0x6309, 0x6309, 0x03BF,
- 0x630A, 0x630D, 0x32F4, 0x630E, 0x630E, 0x0973, 0x630F, 0x6310, 0x32F8,
- 0x6311, 0x6311, 0x0E47, 0x6312, 0x6315, 0x32FA, 0x6316, 0x6316, 0x0E8B,
- 0x6317, 0x6319, 0x32FE, 0x631A, 0x631A, 0x11BE, 0x631B, 0x631B, 0x0A75,
- 0x631C, 0x631C, 0x3301, 0x631D, 0x631D, 0x0EDD, 0x631E, 0x631E, 0x0DF5,
- 0x631F, 0x631F, 0x0F79, 0x6320, 0x6320, 0x0B36, 0x6321, 0x6321, 0x0593,
- 0x6322, 0x6322, 0x14C2, 0x6323, 0x6323, 0x1196, 0x6324, 0x6324, 0x082A,
- 0x6325, 0x6325, 0x07E8, 0x6326, 0x6327, 0x3302, 0x6328, 0x6328, 0x03AF,
- 0x6329, 0x6329, 0x3304, 0x632A, 0x632A, 0x0B73, 0x632B, 0x632B, 0x056F,
- 0x632C, 0x632E, 0x3305, 0x632F, 0x632F, 0x1192, 0x6330, 0x6331, 0x3308,
- 0x6332, 0x6332, 0x194F, 0x6333, 0x6338, 0x330A, 0x6339, 0x6339, 0x14C4,
- 0x633A, 0x633A, 0x0E57, 0x633B, 0x633C, 0x3310, 0x633D, 0x633D, 0x0E9D,
- 0x633E, 0x633E, 0x21D1, 0x633F, 0x6341, 0x3312, 0x6342, 0x6342, 0x0EF5,
- 0x6343, 0x6343, 0x14C6, 0x6344, 0x6344, 0x3315, 0x6345, 0x6345, 0x0E62,
- 0x6346, 0x6346, 0x0991, 0x6347, 0x6348, 0x3316, 0x6349, 0x6349, 0x121A,
- 0x634A, 0x634A, 0x3318, 0x634B, 0x634B, 0x14C5, 0x634C, 0x634C, 0x03D1,
- 0x634D, 0x634D, 0x076B, 0x634E, 0x634E, 0x0D0C, 0x634F, 0x634F, 0x0B56,
- 0x6350, 0x6350, 0x0917, 0x6351, 0x6354, 0x3319, 0x6355, 0x6355, 0x047D,
- 0x6356, 0x635D, 0x331D, 0x635E, 0x635E, 0x09B7, 0x635F, 0x635F, 0x0DE5,
- 0x6360, 0x6360, 0x3325, 0x6361, 0x6361, 0x0864, 0x6362, 0x6362, 0x07D0,
- 0x6363, 0x6363, 0x0598, 0x6364, 0x6366, 0x3326, 0x6367, 0x6367, 0x0BB6,
- 0x6368, 0x6368, 0x211C, 0x6369, 0x6369, 0x14D0, 0x636A, 0x636A, 0x3329,
- 0x636B, 0x636B, 0x235D, 0x636C, 0x636C, 0x332A, 0x636D, 0x636D, 0x14CD,
- 0x636E, 0x636E, 0x090C, 0x636F, 0x6370, 0x332B, 0x6371, 0x6371, 0x14C9,
- 0x6372, 0x6372, 0x2682, 0x6373, 0x6375, 0x332D, 0x6376, 0x6376, 0x053A,
- 0x6377, 0x6377, 0x08AE, 0x6378, 0x6379, 0x3330, 0x637A, 0x637A, 0x14CA,
- 0x637B, 0x637B, 0x0B50, 0x637C, 0x637F, 0x3332, 0x6380, 0x6380, 0x0F33,
- 0x6381, 0x6381, 0x3336, 0x6382, 0x6382, 0x05C1, 0x6383, 0x6383, 0x210D,
- 0x6384, 0x6384, 0x205A, 0x6385, 0x6386, 0x3337, 0x6387, 0x6387, 0x061D,
- 0x6388, 0x6388, 0x0D71, 0x6389, 0x6389, 0x05D5, 0x638A, 0x638A, 0x14CF,
- 0x638B, 0x638B, 0x3339, 0x638C, 0x638C, 0x1167, 0x638D, 0x638D, 0x333A,
- 0x638E, 0x638E, 0x14CB, 0x638F, 0x638F, 0x0E20, 0x6390, 0x6390, 0x0C1D,
- 0x6391, 0x6391, 0x333B, 0x6392, 0x6392, 0x0B86, 0x6393, 0x6395, 0x333C,
- 0x6396, 0x6396, 0x103B, 0x6397, 0x6397, 0x333F, 0x6398, 0x6398, 0x0921,
- 0x6399, 0x639F, 0x3340, 0x63A0, 0x63A0, 0x0A7A, 0x63A1, 0x63A1, 0x3347,
- 0x63A2, 0x63A2, 0x0E10, 0x63A3, 0x63A3, 0x04DD, 0x63A4, 0x63A4, 0x3348,
- 0x63A5, 0x63A5, 0x08A4, 0x63A6, 0x63A6, 0x3349, 0x63A7, 0x63A7, 0x0965,
- 0x63A8, 0x63A8, 0x0E77, 0x63A9, 0x63A9, 0x1003, 0x63AA, 0x63AA, 0x056E,
- 0x63AB, 0x63AB, 0x334A, 0x63AC, 0x63AC, 0x14CE, 0x63AD, 0x63AD, 0x14C7,
- 0x63AE, 0x63AE, 0x14D1, 0x63AF, 0x63AF, 0x334B, 0x63B0, 0x63B0, 0x1950,
- 0x63B1, 0x63B2, 0x334C, 0x63B3, 0x63B3, 0x0A57, 0x63B4, 0x63B4, 0x14CC,
- 0x63B5, 0x63B6, 0x334E, 0x63B7, 0x63B7, 0x11BF, 0x63B8, 0x63B8, 0x0588,
- 0x63B9, 0x63B9, 0x3350, 0x63BA, 0x63BA, 0x04BB, 0x63BB, 0x63BB, 0x3351,
- 0x63BC, 0x63BC, 0x14D2, 0x63BD, 0x63BD, 0x3352, 0x63BE, 0x63BE, 0x14DC,
- 0x63BF, 0x63BF, 0x3353, 0x63C0, 0x63C0, 0x1F8D, 0x63C1, 0x63C3, 0x3354,
- 0x63C4, 0x63C4, 0x14D7, 0x63C5, 0x63C5, 0x3357, 0x63C6, 0x63C6, 0x14DB,
- 0x63C7, 0x63C8, 0x3358, 0x63C9, 0x63C9, 0x0CBB, 0x63CA, 0x63CC, 0x335A,
- 0x63CD, 0x63CD, 0x123E, 0x63CE, 0x63CE, 0x14D9, 0x63CF, 0x63CF, 0x0AED,
- 0x63D0, 0x63D0, 0x0E34, 0x63D1, 0x63D1, 0x335D, 0x63D2, 0x63D2, 0x04AC,
- 0x63D3, 0x63D5, 0x335E, 0x63D6, 0x63D6, 0x1045, 0x63D7, 0x63D9, 0x3361,
- 0x63DA, 0x63DA, 0x21FF, 0x63DB, 0x63DD, 0x3364, 0x63DE, 0x63DE, 0x14D8,
- 0x63DF, 0x63DF, 0x3367, 0x63E0, 0x63E0, 0x14D5, 0x63E1, 0x63E1, 0x0EE4,
- 0x63E2, 0x63E2, 0x3368, 0x63E3, 0x63E3, 0x052A, 0x63E4, 0x63E8, 0x3369,
- 0x63E9, 0x63E9, 0x0938, 0x63EA, 0x63EA, 0x08ED, 0x63EB, 0x63EC, 0x336E,
- 0x63ED, 0x63ED, 0x08A3, 0x63EE, 0x63EE, 0x1F58, 0x63EF, 0x63F1, 0x3370,
- 0x63F2, 0x63F2, 0x14D3, 0x63F3, 0x63F3, 0x3373, 0x63F4, 0x63F4, 0x10F1,
- 0x63F5, 0x63F5, 0x3374, 0x63F6, 0x63F6, 0x14C8, 0x63F7, 0x63F7, 0x3375,
- 0x63F8, 0x63F8, 0x14D4, 0x63F9, 0x63FC, 0x3376, 0x63FD, 0x63FD, 0x09AA,
- 0x63FE, 0x63FE, 0x337A, 0x63FF, 0x63FF, 0x14D6, 0x6400, 0x6400, 0x04BA,
- 0x6401, 0x6401, 0x06E4, 0x6402, 0x6402, 0x0A4E, 0x6403, 0x6404, 0x337B,
- 0x6405, 0x6405, 0x0892, 0x6406, 0x640A, 0x337D, 0x640B, 0x640B, 0x14DF,
- 0x640C, 0x640C, 0x14E2, 0x640D, 0x640D, 0x215B, 0x640E, 0x640E, 0x3382,
- 0x640F, 0x640F, 0x0472, 0x6410, 0x6410, 0x0527, 0x6411, 0x6412, 0x3383,
- 0x6413, 0x6413, 0x056D, 0x6414, 0x6414, 0x0CDF, 0x6415, 0x6416, 0x3385,
- 0x6417, 0x6417, 0x1EB6, 0x6418, 0x641A, 0x3387, 0x641B, 0x641B, 0x14E0,
- 0x641C, 0x641C, 0x0DC6, 0x641D, 0x641D, 0x338A, 0x641E, 0x641E, 0x06DE,
- 0x641F, 0x641F, 0x338B, 0x6420, 0x6420, 0x14E1, 0x6421, 0x6421, 0x14E4,
- 0x6422, 0x6425, 0x338C, 0x6426, 0x6426, 0x14E3, 0x6427, 0x6429, 0x3390,
- 0x642A, 0x642A, 0x0E15, 0x642B, 0x642B, 0x3393, 0x642C, 0x642C, 0x03EC,
- 0x642D, 0x642D, 0x0571, 0x642E, 0x6433, 0x3394, 0x6434, 0x6434, 0x1736,
- 0x6435, 0x6435, 0x339A, 0x6436, 0x6436, 0x20DB, 0x6437, 0x6439, 0x339B,
- 0x643A, 0x643A, 0x0F7A, 0x643B, 0x643C, 0x339E, 0x643D, 0x643D, 0x04B2,
- 0x643E, 0x643E, 0x33A0, 0x643F, 0x643F, 0x1951, 0x6440, 0x6440, 0x33A1,
- 0x6441, 0x6441, 0x14DE, 0x6442, 0x6443, 0x33A2, 0x6444, 0x6444, 0x0D1C,
- 0x6445, 0x6445, 0x14DD, 0x6446, 0x6446, 0x03E5, 0x6447, 0x6447, 0x1028,
- 0x6448, 0x6448, 0x0460, 0x6449, 0x6449, 0x33A4, 0x644A, 0x644A, 0x0E02,
- 0x644B, 0x6450, 0x33A5, 0x6451, 0x6451, 0x2360, 0x6452, 0x6452, 0x14DA,
- 0x6453, 0x6453, 0x33AB, 0x6454, 0x6454, 0x0D99, 0x6455, 0x6457, 0x33AC,
- 0x6458, 0x6458, 0x114B, 0x6459, 0x645B, 0x33AF, 0x645C, 0x645C, 0x2361,
- 0x645D, 0x645D, 0x33B2, 0x645E, 0x645E, 0x14E5, 0x645F, 0x645F, 0x2040,
- 0x6460, 0x6466, 0x33B3, 0x6467, 0x6467, 0x0560, 0x6468, 0x6468, 0x33BA,
- 0x6469, 0x6469, 0x0B09, 0x646A, 0x646C, 0x33BB, 0x646D, 0x646D, 0x14E7,
- 0x646E, 0x646E, 0x33BE, 0x646F, 0x646F, 0x228E, 0x6470, 0x6472, 0x33BF,
- 0x6473, 0x6473, 0x1FDF, 0x6474, 0x6475, 0x33C2, 0x6476, 0x6476, 0x235E,
- 0x6477, 0x6477, 0x33C4, 0x6478, 0x6479, 0x0B03, 0x647A, 0x647A, 0x14E9,
- 0x647B, 0x647B, 0x1E6A, 0x647C, 0x6481, 0x33C5, 0x6482, 0x6482, 0x0A15,
- 0x6483, 0x6483, 0x33CB, 0x6484, 0x6484, 0x14E6, 0x6485, 0x6485, 0x091E,
- 0x6486, 0x6486, 0x33CC, 0x6487, 0x6487, 0x0BD1, 0x6488, 0x6488, 0x2002,
- 0x6489, 0x6490, 0x33CD, 0x6491, 0x6491, 0x04EA, 0x6492, 0x6492, 0x0CD1,
- 0x6493, 0x6493, 0x2093, 0x6494, 0x6494, 0x33D5, 0x6495, 0x6495, 0x0DAF,
- 0x6496, 0x6496, 0x14E8, 0x6497, 0x6498, 0x33D6, 0x6499, 0x6499, 0x14EC,
- 0x649A, 0x649D, 0x33D8, 0x649E, 0x649E, 0x120F, 0x649F, 0x649F, 0x235F,
- 0x64A0, 0x64A2, 0x33DC, 0x64A3, 0x64A3, 0x1EAC, 0x64A4, 0x64A4, 0x04DC,
- 0x64A5, 0x64A5, 0x1E54, 0x64A6, 0x64A8, 0x33DF, 0x64A9, 0x64A9, 0x0A0C,
- 0x64AA, 0x64AA, 0x33E2, 0x64AB, 0x64AB, 0x1F08, 0x64AC, 0x64AC, 0x0C48,
- 0x64AD, 0x64AD, 0x046C, 0x64AE, 0x64AE, 0x056C, 0x64AF, 0x64AF, 0x33E3,
- 0x64B0, 0x64B0, 0x1208, 0x64B1, 0x64B1, 0x33E4, 0x64B2, 0x64B2, 0x20C0,
- 0x64B3, 0x64B3, 0x2362, 0x64B4, 0x64B4, 0x33E5, 0x64B5, 0x64B5, 0x0B4F,
- 0x64B6, 0x64B6, 0x33E6, 0x64B7, 0x64B8, 0x14EA, 0x64B9, 0x64B9, 0x33E7,
- 0x64BA, 0x64BA, 0x14ED, 0x64BB, 0x64BB, 0x2160, 0x64BC, 0x64BC, 0x076A,
- 0x64BD, 0x64BD, 0x33E8, 0x64BE, 0x64BE, 0x219D, 0x64BF, 0x64BF, 0x1F8E,
- 0x64C0, 0x64C0, 0x14EE, 0x64C1, 0x64C1, 0x222D, 0x64C2, 0x64C2, 0x09C9,
- 0x64C3, 0x64C3, 0x33E9, 0x64C4, 0x64C4, 0x2047, 0x64C5, 0x64C5, 0x0CFC,
- 0x64C6, 0x64C6, 0x33EA, 0x64C7, 0x64C7, 0x2262, 0x64C8, 0x64C9, 0x33EB,
- 0x64CA, 0x64CA, 0x1F67, 0x64CB, 0x64CB, 0x1EB2, 0x64CC, 0x64CC, 0x33ED,
- 0x64CD, 0x64CD, 0x04A0, 0x64CE, 0x64CE, 0x0C63, 0x64CF, 0x64CF, 0x33EE,
- 0x64D0, 0x64D0, 0x14EF, 0x64D1, 0x64D1, 0x33EF, 0x64D2, 0x64D2, 0x0C59,
- 0x64D3, 0x64D3, 0x33F0, 0x64D4, 0x64D4, 0x1EA9, 0x64D5, 0x64D6, 0x33F1,
- 0x64D7, 0x64D7, 0x14F0, 0x64D8, 0x64D8, 0x1952, 0x64D9, 0x64D9, 0x33F3,
- 0x64DA, 0x64DA, 0x1FCC, 0x64DB, 0x64DD, 0x33F4, 0x64DE, 0x64DE, 0x0DC8,
- 0x64DF, 0x64DF, 0x33F7, 0x64E0, 0x64E0, 0x1F72, 0x64E1, 0x64E1, 0x33F8,
- 0x64E2, 0x64E2, 0x14F2, 0x64E3, 0x64E3, 0x33F9, 0x64E4, 0x64E4, 0x14F1,
- 0x64E5, 0x64E5, 0x33FA, 0x64E6, 0x64E6, 0x0488, 0x64E7, 0x64EB, 0x33FB,
- 0x64EC, 0x64EC, 0x2098, 0x64ED, 0x64EE, 0x3400, 0x64EF, 0x64EF, 0x1E52,
- 0x64F0, 0x64F0, 0x20A4, 0x64F1, 0x64F1, 0x1F1C, 0x64F2, 0x64F2, 0x228F,
- 0x64F3, 0x64F3, 0x3402, 0x64F4, 0x64F4, 0x1FED, 0x64F5, 0x64F6, 0x3403,
- 0x64F7, 0x64F7, 0x2365, 0x64F8, 0x64F9, 0x3405, 0x64FA, 0x64FA, 0x1E2D,
- 0x64FB, 0x64FB, 0x2152, 0x64FC, 0x64FC, 0x2366, 0x64FD, 0x64FD, 0x3407,
- 0x64FE, 0x64FE, 0x20FA, 0x64FF, 0x64FF, 0x3408, 0x6500, 0x6500, 0x0B8B,
- 0x6501, 0x6503, 0x3409, 0x6504, 0x6504, 0x2363, 0x6505, 0x6505, 0x340C,
- 0x6506, 0x6506, 0x209A, 0x6507, 0x6508, 0x340D, 0x6509, 0x6509, 0x14F3,
- 0x650A, 0x650E, 0x340F, 0x650F, 0x650F, 0x203C, 0x6510, 0x6511, 0x3414,
- 0x6512, 0x6512, 0x111F, 0x6513, 0x6513, 0x3416, 0x6514, 0x6514, 0x1FF6,
- 0x6515, 0x6515, 0x3417, 0x6516, 0x6516, 0x2364, 0x6517, 0x6517, 0x3418,
- 0x6518, 0x6518, 0x0C9C, 0x6519, 0x6519, 0x1E69, 0x651A, 0x651A, 0x3419,
- 0x651B, 0x651B, 0x2367, 0x651C, 0x651C, 0x341A, 0x651D, 0x651D, 0x211D,
- 0x651E, 0x6521, 0x341B, 0x6522, 0x6522, 0x2259, 0x6523, 0x6523, 0x2056,
- 0x6524, 0x6524, 0x2163, 0x6525, 0x6525, 0x14F4, 0x6526, 0x6529, 0x341F,
- 0x652A, 0x652A, 0x1FA9, 0x652B, 0x652B, 0x091F, 0x652C, 0x652C, 0x1FFC,
- 0x652D, 0x652D, 0x3423, 0x652E, 0x652E, 0x14F5, 0x652F, 0x652F, 0x11A6,
- 0x6530, 0x6533, 0x3424, 0x6534, 0x6534, 0x1909, 0x6535, 0x6535, 0x1966,
- 0x6536, 0x6536, 0x0D6C, 0x6537, 0x6537, 0x3428, 0x6538, 0x6538, 0x12B2,
- 0x6539, 0x6539, 0x06BF, 0x653A, 0x653A, 0x3429, 0x653B, 0x653B, 0x06FE,
- 0x653C, 0x653D, 0x342A, 0x653E, 0x653E, 0x0662, 0x653F, 0x653F, 0x119F,
- 0x6540, 0x6544, 0x342C, 0x6545, 0x6545, 0x0723, 0x6546, 0x6547, 0x3431,
- 0x6548, 0x6548, 0x0F72, 0x6549, 0x6549, 0x1CCB, 0x654A, 0x654B, 0x3433,
- 0x654C, 0x654C, 0x05B1, 0x654D, 0x654E, 0x3435, 0x654F, 0x654F, 0x0AF9,
- 0x6550, 0x6550, 0x3437, 0x6551, 0x6551, 0x08F7, 0x6552, 0x6554, 0x3438,
- 0x6555, 0x6555, 0x1967, 0x6556, 0x6556, 0x03C8, 0x6557, 0x6557, 0x1E2E,
- 0x6558, 0x6558, 0x343B, 0x6559, 0x6559, 0x089D, 0x655A, 0x655A, 0x343C,
- 0x655B, 0x655B, 0x09FB, 0x655C, 0x655C, 0x343D, 0x655D, 0x655D, 0x043F,
- 0x655E, 0x655E, 0x04CD, 0x655F, 0x6561, 0x343E, 0x6562, 0x6562, 0x06CD,
- 0x6563, 0x6563, 0x0CDB, 0x6564, 0x6565, 0x3441, 0x6566, 0x6566, 0x0617,
- 0x6567, 0x656A, 0x3443, 0x656B, 0x656B, 0x1968, 0x656C, 0x656C, 0x08E3,
- 0x656D, 0x656F, 0x3447, 0x6570, 0x6570, 0x0D94, 0x6571, 0x6571, 0x344A,
- 0x6572, 0x6572, 0x0C40, 0x6573, 0x6573, 0x344B, 0x6574, 0x6574, 0x119C,
- 0x6575, 0x6575, 0x1EBC, 0x6576, 0x6576, 0x344C, 0x6577, 0x6577, 0x0690,
- 0x6578, 0x6578, 0x2142, 0x6579, 0x6581, 0x344D, 0x6582, 0x6582, 0x201E,
- 0x6583, 0x6583, 0x1E43, 0x6584, 0x6586, 0x3456, 0x6587, 0x6587, 0x0ED3,
- 0x6588, 0x658A, 0x3459, 0x658B, 0x658B, 0x114C, 0x658C, 0x658C, 0x045C,
- 0x658D, 0x658F, 0x345C, 0x6590, 0x6590, 0x19C1, 0x6591, 0x6591, 0x03EA,
- 0x6592, 0x6592, 0x345F, 0x6593, 0x6593, 0x19C3, 0x6594, 0x6594, 0x3460,
- 0x6595, 0x6595, 0x24D4, 0x6596, 0x6596, 0x3461, 0x6597, 0x6597, 0x05F6,
- 0x6598, 0x6598, 0x3462, 0x6599, 0x6599, 0x0A18, 0x659A, 0x659A, 0x3463,
- 0x659B, 0x659B, 0x1D56, 0x659C, 0x659C, 0x0F7C, 0x659D, 0x659E, 0x3464,
- 0x659F, 0x659F, 0x1186, 0x65A0, 0x65A0, 0x3466, 0x65A1, 0x65A1, 0x0EE2,
- 0x65A2, 0x65A3, 0x3467, 0x65A4, 0x65A4, 0x08C0, 0x65A5, 0x65A5, 0x0507,
- 0x65A6, 0x65A6, 0x3469, 0x65A7, 0x65A7, 0x06A6, 0x65A8, 0x65A8, 0x346A,
- 0x65A9, 0x65A9, 0x1157, 0x65AA, 0x65AA, 0x346B, 0x65AB, 0x65AB, 0x1A29,
- 0x65AC, 0x65AC, 0x226F, 0x65AD, 0x65AD, 0x060E, 0x65AE, 0x65AE, 0x346C,
- 0x65AF, 0x65AF, 0x0DAE, 0x65B0, 0x65B0, 0x0F8D, 0x65B1, 0x65B6, 0x346D,
- 0x65B7, 0x65B7, 0x1ED7, 0x65B8, 0x65B8, 0x3473, 0x65B9, 0x65B9, 0x065A,
- 0x65BA, 0x65BB, 0x3474, 0x65BC, 0x65BC, 0x19C4, 0x65BD, 0x65BD, 0x0D40,
- 0x65BE, 0x65C0, 0x3476, 0x65C1, 0x65C1, 0x0B95, 0x65C2, 0x65C2, 0x3479,
- 0x65C3, 0x65C3, 0x19C7, 0x65C4, 0x65C4, 0x19C6, 0x65C5, 0x65C5, 0x0A6A,
- 0x65C6, 0x65C6, 0x19C5, 0x65C7, 0x65CA, 0x347A, 0x65CB, 0x65CB, 0x0FC8,
- 0x65CC, 0x65CC, 0x19C8, 0x65CD, 0x65CD, 0x347E, 0x65CE, 0x65CE, 0x19C9,
- 0x65CF, 0x65CF, 0x1242, 0x65D0, 0x65D1, 0x347F, 0x65D2, 0x65D2, 0x19CA,
- 0x65D3, 0x65D5, 0x3481, 0x65D6, 0x65D6, 0x19CB, 0x65D7, 0x65D7, 0x0C0B,
- 0x65D8, 0x65DF, 0x3484, 0x65E0, 0x65E0, 0x0EED, 0x65E1, 0x65E1, 0x348C,
- 0x65E2, 0x65E2, 0x083B, 0x65E3, 0x65E4, 0x348D, 0x65E5, 0x65E5, 0x0CB0,
- 0x65E6, 0x65E6, 0x058A, 0x65E7, 0x65E7, 0x08F8, 0x65E8, 0x65E8, 0x11BB,
- 0x65E9, 0x65E9, 0x112A, 0x65EA, 0x65EB, 0x348F, 0x65EC, 0x65EC, 0x0FD7,
- 0x65ED, 0x65ED, 0x0FBC, 0x65EE, 0x65F0, 0x190A, 0x65F1, 0x65F1, 0x076C,
- 0x65F2, 0x65F5, 0x3491, 0x65F6, 0x65F6, 0x0D48, 0x65F7, 0x65F7, 0x0982,
- 0x65F8, 0x65F9, 0x3495, 0x65FA, 0x65FA, 0x0EAB, 0x65FB, 0x65FF, 0x3497,
- 0x6600, 0x6600, 0x1912, 0x6601, 0x6601, 0x349C, 0x6602, 0x6602, 0x03C5,
- 0x6603, 0x6603, 0x1910, 0x6604, 0x6605, 0x349D, 0x6606, 0x6606, 0x0990,
- 0x6607, 0x6609, 0x349F, 0x660A, 0x660A, 0x190D, 0x660B, 0x660B, 0x34A2,
- 0x660C, 0x660C, 0x04C4, 0x660D, 0x660D, 0x34A3, 0x660E, 0x660E, 0x0AFC,
- 0x660F, 0x660F, 0x07FD, 0x6610, 0x6612, 0x34A4, 0x6613, 0x6613, 0x105E,
- 0x6614, 0x6614, 0x0F03, 0x6615, 0x6615, 0x1911, 0x6616, 0x6618, 0x34A7,
- 0x6619, 0x6619, 0x190E, 0x661A, 0x661C, 0x34AA, 0x661D, 0x661D, 0x1915,
- 0x661E, 0x661E, 0x34AD, 0x661F, 0x661F, 0x0F92, 0x6620, 0x6620, 0x1098,
- 0x6621, 0x6624, 0x34AE, 0x6625, 0x6625, 0x053D, 0x6626, 0x6626, 0x34B2,
- 0x6627, 0x6627, 0x0AC6, 0x6628, 0x6628, 0x124F, 0x6629, 0x662C, 0x34B3,
- 0x662D, 0x662D, 0x1172, 0x662E, 0x662E, 0x34B7, 0x662F, 0x662F, 0x0D5E,
- 0x6630, 0x6630, 0x34B8, 0x6631, 0x6631, 0x1917, 0x6632, 0x6633, 0x34B9,
- 0x6634, 0x6634, 0x1916, 0x6635, 0x6635, 0x1919, 0x6636, 0x6636, 0x1918,
- 0x6637, 0x663B, 0x34BB, 0x663C, 0x663C, 0x11E6, 0x663D, 0x663D, 0x34C0,
- 0x663E, 0x663E, 0x0F41, 0x663F, 0x6640, 0x34C1, 0x6641, 0x6641, 0x191D,
- 0x6642, 0x6642, 0x212D, 0x6643, 0x6643, 0x07E3, 0x6644, 0x664A, 0x34C3,
- 0x664B, 0x664B, 0x08CB, 0x664C, 0x664C, 0x0D07, 0x664D, 0x664E, 0x34CA,
- 0x664F, 0x664F, 0x191E, 0x6650, 0x6651, 0x34CC, 0x6652, 0x6652, 0x0CF2,
- 0x6653, 0x6653, 0x0F6B, 0x6654, 0x6654, 0x191C, 0x6655, 0x6655, 0x1111,
- 0x6656, 0x6656, 0x191F, 0x6657, 0x6657, 0x1921, 0x6658, 0x6659, 0x34CE,
- 0x665A, 0x665A, 0x0E9E, 0x665B, 0x665C, 0x34D0, 0x665D, 0x665D, 0x229B,
- 0x665E, 0x665E, 0x34D2, 0x665F, 0x665F, 0x191B, 0x6660, 0x6660, 0x34D3,
- 0x6661, 0x6661, 0x1920, 0x6662, 0x6663, 0x34D4, 0x6664, 0x6664, 0x0EFD,
- 0x6665, 0x6665, 0x34D6, 0x6666, 0x6666, 0x07F3, 0x6667, 0x6667, 0x34D7,
- 0x6668, 0x6668, 0x04E4, 0x6669, 0x666D, 0x34D8, 0x666E, 0x666E, 0x0BF4,
- 0x666F, 0x666F, 0x08DF, 0x6670, 0x6670, 0x0F09, 0x6671, 0x6673, 0x34DD,
- 0x6674, 0x6674, 0x0C64, 0x6675, 0x6675, 0x34E0, 0x6676, 0x6676, 0x08D6,
- 0x6677, 0x6677, 0x1922, 0x6678, 0x6679, 0x34E1, 0x667A, 0x667A, 0x11C6,
- 0x667B, 0x667D, 0x34E3, 0x667E, 0x667E, 0x0A09, 0x667F, 0x6681, 0x34E6,
- 0x6682, 0x6682, 0x1120, 0x6683, 0x6683, 0x34E9, 0x6684, 0x6684, 0x1923,
- 0x6685, 0x6686, 0x34EA, 0x6687, 0x6687, 0x0F2B, 0x6688, 0x6688, 0x2256,
- 0x6689, 0x6689, 0x24A8, 0x668A, 0x668B, 0x34EC, 0x668C, 0x668C, 0x1924,
- 0x668D, 0x6690, 0x34EE, 0x6691, 0x6691, 0x0D85, 0x6692, 0x6695, 0x34F2,
- 0x6696, 0x6696, 0x0B70, 0x6697, 0x6697, 0x03C0, 0x6698, 0x669C, 0x34F6,
- 0x669D, 0x669D, 0x1926, 0x669E, 0x66A1, 0x34FB, 0x66A2, 0x66A2, 0x1E79,
- 0x66A3, 0x66A6, 0x34FF, 0x66A7, 0x66A7, 0x1925, 0x66A8, 0x66A8, 0x1CDD,
- 0x66A9, 0x66AA, 0x3503, 0x66AB, 0x66AB, 0x225A, 0x66AC, 0x66AD, 0x3505,
- 0x66AE, 0x66AE, 0x0B1D, 0x66AF, 0x66B3, 0x3507, 0x66B4, 0x66B4, 0x0412,
- 0x66B5, 0x66B8, 0x350C, 0x66B9, 0x66B9, 0x175B, 0x66BA, 0x66BD, 0x3510,
- 0x66BE, 0x66BE, 0x1927, 0x66BF, 0x66C3, 0x3514, 0x66C4, 0x66C4, 0x24A7,
- 0x66C5, 0x66C5, 0x3519, 0x66C6, 0x66C6, 0x2686, 0x66C7, 0x66C7, 0x24A6,
- 0x66C8, 0x66C8, 0x351A, 0x66C9, 0x66C9, 0x21CE, 0x66CA, 0x66D5, 0x351B,
- 0x66D6, 0x66D6, 0x24A9, 0x66D7, 0x66D8, 0x3527, 0x66D9, 0x66D9, 0x0D86,
- 0x66DA, 0x66DA, 0x3529, 0x66DB, 0x66DC, 0x1928, 0x66DD, 0x66DD, 0x0BF7,
- 0x66DE, 0x66DF, 0x352A, 0x66E0, 0x66E0, 0x1FE7, 0x66E1, 0x66E5, 0x352C,
- 0x66E6, 0x66E6, 0x192A, 0x66E7, 0x66E8, 0x3531, 0x66E9, 0x66E9, 0x192B,
- 0x66EA, 0x66EB, 0x3533, 0x66EC, 0x66EC, 0x2112, 0x66ED, 0x66EF, 0x3535,
- 0x66F0, 0x66F0, 0x10FE, 0x66F1, 0x66F1, 0x3538, 0x66F2, 0x66F2, 0x0C77,
- 0x66F3, 0x66F3, 0x103E, 0x66F4, 0x66F4, 0x06F7, 0x66F5, 0x66F6, 0x3539,
- 0x66F7, 0x66F7, 0x1914, 0x66F8, 0x66F8, 0x213C, 0x66F9, 0x66F9, 0x04A3,
- 0x66FA, 0x66FB, 0x353B, 0x66FC, 0x66FC, 0x0AA3, 0x66FD, 0x66FD, 0x353D,
- 0x66FE, 0x66FE, 0x113B, 0x66FF, 0x66FF, 0x0E39, 0x6700, 0x6700, 0x124B,
- 0x6701, 0x6702, 0x353E, 0x6703, 0x6703, 0x1F5C, 0x6704, 0x6707, 0x3540,
- 0x6708, 0x6708, 0x1105, 0x6709, 0x6709, 0x10B5, 0x670A, 0x670A, 0x1973,
- 0x670B, 0x670B, 0x0BB4, 0x670C, 0x670C, 0x3544, 0x670D, 0x670D, 0x069B,
- 0x670E, 0x670F, 0x3545, 0x6710, 0x6710, 0x1984, 0x6711, 0x6713, 0x3547,
- 0x6714, 0x6714, 0x0DAC, 0x6715, 0x6715, 0x198E, 0x6716, 0x6716, 0x354A,
- 0x6717, 0x6717, 0x09B5, 0x6718, 0x671A, 0x354B, 0x671B, 0x671B, 0x0EAC,
- 0x671C, 0x671C, 0x354E, 0x671D, 0x671D, 0x04D4, 0x671E, 0x671E, 0x354F,
- 0x671F, 0x671F, 0x0BF9, 0x6720, 0x6725, 0x3550, 0x6726, 0x6726, 0x19AC,
- 0x6727, 0x6727, 0x24C4, 0x6728, 0x6728, 0x0B21, 0x6729, 0x6729, 0x3556,
- 0x672A, 0x672A, 0x0EC3, 0x672B, 0x672B, 0x0B0C, 0x672C, 0x672C, 0x0427,
- 0x672D, 0x672D, 0x1140, 0x672E, 0x672E, 0x3557, 0x672F, 0x672F, 0x0D8C,
- 0x6730, 0x6730, 0x3558, 0x6731, 0x6731, 0x11EB, 0x6732, 0x6733, 0x3559,
- 0x6734, 0x6734, 0x0BF2, 0x6735, 0x6735, 0x0623, 0x6736, 0x6739, 0x355B,
- 0x673A, 0x673A, 0x080F, 0x673B, 0x673C, 0x355F, 0x673D, 0x673D, 0x0FAB,
- 0x673E, 0x673F, 0x3561, 0x6740, 0x6740, 0x0CEA, 0x6741, 0x6741, 0x3563,
- 0x6742, 0x6742, 0x1116, 0x6743, 0x6743, 0x0C83, 0x6744, 0x6745, 0x3564,
- 0x6746, 0x6746, 0x06C6, 0x6747, 0x6747, 0x3566, 0x6748, 0x6748, 0x1854,
- 0x6749, 0x6749, 0x0CF5, 0x674A, 0x674B, 0x3567, 0x674C, 0x674C, 0x1851,
- 0x674D, 0x674D, 0x3569, 0x674E, 0x674E, 0x09D9, 0x674F, 0x674F, 0x0F9E,
- 0x6750, 0x6750, 0x048B, 0x6751, 0x6751, 0x0568, 0x6752, 0x6752, 0x356A,
- 0x6753, 0x6753, 0x1852, 0x6754, 0x6755, 0x356B, 0x6756, 0x6756, 0x1169,
- 0x6757, 0x675B, 0x356D, 0x675C, 0x675C, 0x0604, 0x675D, 0x675D, 0x3572,
- 0x675E, 0x675E, 0x1853, 0x675F, 0x675F, 0x0D8F, 0x6760, 0x6760, 0x06D7,
- 0x6761, 0x6761, 0x0E48, 0x6762, 0x6764, 0x3573, 0x6765, 0x6765, 0x099F,
- 0x6766, 0x6767, 0x3576, 0x6768, 0x6768, 0x1017, 0x6769, 0x6769, 0x1855,
- 0x676A, 0x676A, 0x1858, 0x676B, 0x676C, 0x3578, 0x676D, 0x676D, 0x0773,
- 0x676E, 0x676E, 0x357A, 0x676F, 0x676F, 0x0416, 0x6770, 0x6770, 0x08AD,
- 0x6771, 0x6771, 0x1ECC, 0x6772, 0x6772, 0x190F, 0x6773, 0x6773, 0x1859,
- 0x6774, 0x6774, 0x357B, 0x6775, 0x6775, 0x185C, 0x6776, 0x6776, 0x357C,
- 0x6777, 0x6777, 0x1861, 0x6778, 0x677B, 0x357D, 0x677C, 0x677C, 0x1862,
- 0x677D, 0x677D, 0x3581, 0x677E, 0x677E, 0x0DBE, 0x677F, 0x677F, 0x03F0,
- 0x6780, 0x6780, 0x3582, 0x6781, 0x6781, 0x081E, 0x6782, 0x6783, 0x3583,
- 0x6784, 0x6784, 0x0712, 0x6785, 0x6786, 0x3585, 0x6787, 0x6787, 0x1857,
- 0x6788, 0x6788, 0x3587, 0x6789, 0x6789, 0x0EA8, 0x678A, 0x678A, 0x3588,
- 0x678B, 0x678B, 0x1860, 0x678C, 0x678F, 0x3589, 0x6790, 0x6790, 0x0F05,
- 0x6791, 0x6794, 0x358D, 0x6795, 0x6795, 0x118E, 0x6796, 0x6796, 0x3591,
- 0x6797, 0x6797, 0x0A1F, 0x6798, 0x6798, 0x185A, 0x6799, 0x6799, 0x3592,
- 0x679A, 0x679A, 0x0ABB, 0x679B, 0x679B, 0x3593, 0x679C, 0x679C, 0x0754,
- 0x679D, 0x679D, 0x11A5, 0x679E, 0x679E, 0x185E, 0x679F, 0x67A1, 0x3594,
- 0x67A2, 0x67A2, 0x0D77, 0x67A3, 0x67A3, 0x1129, 0x67A4, 0x67A4, 0x3597,
- 0x67A5, 0x67A5, 0x1856, 0x67A6, 0x67A6, 0x3598, 0x67A7, 0x67A7, 0x185B,
- 0x67A8, 0x67A8, 0x185D, 0x67A9, 0x67A9, 0x3599, 0x67AA, 0x67AA, 0x0C36,
- 0x67AB, 0x67AB, 0x0680, 0x67AC, 0x67AC, 0x359A, 0x67AD, 0x67AD, 0x185F,
- 0x67AE, 0x67AE, 0x359B, 0x67AF, 0x67AF, 0x096A, 0x67B0, 0x67B0, 0x1868,
- 0x67B1, 0x67B2, 0x359C, 0x67B3, 0x67B3, 0x186D, 0x67B4, 0x67B4, 0x359E,
- 0x67B5, 0x67B5, 0x186B, 0x67B6, 0x67B6, 0x084F, 0x67B7, 0x67B7, 0x0842,
- 0x67B8, 0x67B8, 0x1871, 0x67B9, 0x67C0, 0x359F, 0x67C1, 0x67C1, 0x1874,
- 0x67C2, 0x67C2, 0x35A7, 0x67C3, 0x67C3, 0x1870, 0x67C4, 0x67C4, 0x0463,
- 0x67C5, 0x67CE, 0x35A8, 0x67CF, 0x67CF, 0x03E3, 0x67D0, 0x67D0, 0x0B16,
- 0x67D1, 0x67D1, 0x06C7, 0x67D2, 0x67D2, 0x0C01, 0x67D3, 0x67D3, 0x0C99,
- 0x67D4, 0x67D4, 0x0CBC, 0x67D5, 0x67D7, 0x35B2, 0x67D8, 0x67D8, 0x1865,
- 0x67D9, 0x67D9, 0x186A, 0x67DA, 0x67DA, 0x186C, 0x67DB, 0x67DB, 0x35B5,
- 0x67DC, 0x67DC, 0x074A, 0x67DD, 0x67DD, 0x186E, 0x67DE, 0x67DE, 0x1252,
- 0x67DF, 0x67DF, 0x35B6, 0x67E0, 0x67E0, 0x0B5E, 0x67E1, 0x67E1, 0x35B7,
- 0x67E2, 0x67E2, 0x1872, 0x67E3, 0x67E4, 0x35B8, 0x67E5, 0x67E5, 0x04B0,
- 0x67E6, 0x67E8, 0x35BA, 0x67E9, 0x67E9, 0x1867, 0x67EA, 0x67EB, 0x35BD,
- 0x67EC, 0x67EC, 0x0860, 0x67ED, 0x67EE, 0x35BF, 0x67EF, 0x67EF, 0x094F,
- 0x67F0, 0x67F0, 0x1863, 0x67F1, 0x67F1, 0x11F8, 0x67F2, 0x67F2, 0x35C1,
- 0x67F3, 0x67F3, 0x0A41, 0x67F4, 0x67F4, 0x04B8, 0x67F5, 0x67FC, 0x35C2,
- 0x67FD, 0x67FD, 0x1875, 0x67FE, 0x67FE, 0x35CA, 0x67FF, 0x67FF, 0x0D58,
- 0x6800, 0x6800, 0x186F, 0x6801, 0x6804, 0x35CB, 0x6805, 0x6805, 0x1145,
- 0x6806, 0x6806, 0x35CF, 0x6807, 0x6807, 0x0453, 0x6808, 0x6808, 0x115C,
- 0x6809, 0x6809, 0x1864, 0x680A, 0x680A, 0x1866, 0x680B, 0x680B, 0x05EF,
- 0x680C, 0x680C, 0x1869, 0x680D, 0x680D, 0x35D0, 0x680E, 0x680E, 0x1873,
- 0x680F, 0x680F, 0x09A3, 0x6810, 0x6810, 0x35D1, 0x6811, 0x6811, 0x0D8E,
- 0x6812, 0x6812, 0x35D2, 0x6813, 0x6813, 0x0D9D, 0x6814, 0x6815, 0x35D3,
- 0x6816, 0x6816, 0x0BFB, 0x6817, 0x6817, 0x09E0, 0x6818, 0x681C, 0x35D5,
- 0x681D, 0x681D, 0x187F, 0x681E, 0x6820, 0x35DA, 0x6821, 0x6821, 0x0F6E,
- 0x6822, 0x6828, 0x35DD, 0x6829, 0x6829, 0x1888, 0x682A, 0x682A, 0x11E9,
- 0x682B, 0x6831, 0x35E4, 0x6832, 0x6833, 0x1876, 0x6834, 0x6836, 0x35EB,
- 0x6837, 0x6837, 0x1022, 0x6838, 0x6838, 0x0782, 0x6839, 0x6839, 0x06F4,
- 0x683A, 0x683B, 0x35EE, 0x683C, 0x683C, 0x06EC, 0x683D, 0x683D, 0x1117,
- 0x683E, 0x683E, 0x1885, 0x683F, 0x683F, 0x35F0, 0x6840, 0x6840, 0x1884,
- 0x6841, 0x6841, 0x1882, 0x6842, 0x6842, 0x0749, 0x6843, 0x6843, 0x0E25,
- 0x6844, 0x6844, 0x187C, 0x6845, 0x6845, 0x0EB5, 0x6846, 0x6846, 0x097F,
- 0x6847, 0x6847, 0x35F1, 0x6848, 0x6848, 0x03C3, 0x6849, 0x6849, 0x1887,
- 0x684A, 0x684A, 0x1886, 0x684B, 0x684B, 0x35F2, 0x684C, 0x684C, 0x121D,
- 0x684D, 0x684D, 0x35F3, 0x684E, 0x684E, 0x187A, 0x684F, 0x684F, 0x35F4,
- 0x6850, 0x6850, 0x0E5A, 0x6851, 0x6851, 0x0CDC, 0x6852, 0x6852, 0x35F5,
- 0x6853, 0x6853, 0x07CD, 0x6854, 0x6854, 0x08AC, 0x6855, 0x6855, 0x1880,
- 0x6856, 0x685F, 0x35F6, 0x6860, 0x6861, 0x1878, 0x6862, 0x6862, 0x187B,
- 0x6863, 0x6863, 0x0596, 0x6864, 0x6864, 0x187D, 0x6865, 0x6865, 0x0C42,
- 0x6866, 0x6866, 0x1881, 0x6867, 0x6867, 0x1883, 0x6868, 0x6868, 0x0881,
- 0x6869, 0x6869, 0x120B, 0x686A, 0x686A, 0x3600, 0x686B, 0x686B, 0x188E,
- 0x686C, 0x6873, 0x3601, 0x6874, 0x6874, 0x188B, 0x6875, 0x6875, 0x3609,
- 0x6876, 0x6876, 0x0E61, 0x6877, 0x6877, 0x188C, 0x6878, 0x6880, 0x360A,
- 0x6881, 0x6881, 0x0A03, 0x6882, 0x6882, 0x3613, 0x6883, 0x6883, 0x187E,
- 0x6884, 0x6884, 0x3614, 0x6885, 0x6885, 0x0ABC, 0x6886, 0x6886, 0x03FB,
- 0x6887, 0x688E, 0x3615, 0x688F, 0x688F, 0x188A, 0x6890, 0x6892, 0x361D,
- 0x6893, 0x6893, 0x188D, 0x6894, 0x6896, 0x3620, 0x6897, 0x6897, 0x06FC,
- 0x6898, 0x6898, 0x246A, 0x6899, 0x689C, 0x3623, 0x689D, 0x689D, 0x2175,
- 0x689E, 0x689E, 0x3627, 0x689F, 0x689F, 0x246D, 0x68A0, 0x68A1, 0x3628,
- 0x68A2, 0x68A2, 0x0D0B, 0x68A3, 0x68A5, 0x362A, 0x68A6, 0x68A6, 0x0AD3,
- 0x68A7, 0x68A7, 0x0EEF, 0x68A8, 0x68A8, 0x09D1, 0x68A9, 0x68AC, 0x362D,
- 0x68AD, 0x68AD, 0x0DE8, 0x68AE, 0x68AE, 0x3631, 0x68AF, 0x68AF, 0x0E30,
- 0x68B0, 0x68B0, 0x0F80, 0x68B1, 0x68B2, 0x3632, 0x68B3, 0x68B3, 0x0D78,
- 0x68B4, 0x68B4, 0x3634, 0x68B5, 0x68B5, 0x1889, 0x68B6, 0x68BF, 0x3635,
- 0x68C0, 0x68C0, 0x085F, 0x68C1, 0x68C1, 0x363F, 0x68C2, 0x68C2, 0x188F,
- 0x68C3, 0x68C8, 0x3640, 0x68C9, 0x68C9, 0x0AE3, 0x68CA, 0x68CA, 0x3646,
- 0x68CB, 0x68CB, 0x0C04, 0x68CC, 0x68CC, 0x3647, 0x68CD, 0x68CD, 0x0750,
- 0x68CE, 0x68D1, 0x3648, 0x68D2, 0x68D2, 0x03FF, 0x68D3, 0x68D4, 0x364C,
- 0x68D5, 0x68D5, 0x1235, 0x68D6, 0x68D6, 0x246B, 0x68D7, 0x68D7, 0x225F,
- 0x68D8, 0x68D8, 0x081F, 0x68D9, 0x68D9, 0x364E, 0x68DA, 0x68DA, 0x0BB0,
- 0x68DB, 0x68DE, 0x364F, 0x68DF, 0x68DF, 0x1ECE, 0x68E0, 0x68E0, 0x0E17,
- 0x68E1, 0x68E2, 0x3653, 0x68E3, 0x68E3, 0x189A, 0x68E4, 0x68E6, 0x3655,
- 0x68E7, 0x68E7, 0x2272, 0x68E8, 0x68ED, 0x3658, 0x68EE, 0x68EE, 0x0CE6,
- 0x68EF, 0x68EF, 0x365E, 0x68F0, 0x68F0, 0x1896, 0x68F1, 0x68F1, 0x09CD,
- 0x68F2, 0x68F4, 0x365F, 0x68F5, 0x68F5, 0x0950, 0x68F6, 0x68F8, 0x3662,
- 0x68F9, 0x68F9, 0x1894, 0x68FA, 0x68FA, 0x0730, 0x68FB, 0x68FB, 0x3665,
- 0x68FC, 0x68FC, 0x1891, 0x68FD, 0x68FF, 0x3666, 0x6900, 0x6900, 0x3669,
- 0x6901, 0x6901, 0x1898, 0x6902, 0x6904, 0x366A, 0x6905, 0x6905, 0x1055,
- 0x6906, 0x690A, 0x366D, 0x690B, 0x690B, 0x1897, 0x690C, 0x690C, 0x3672,
- 0x690D, 0x690D, 0x11B1, 0x690E, 0x690E, 0x1212, 0x690F, 0x690F, 0x2473,
- 0x6910, 0x6910, 0x189B, 0x6911, 0x6911, 0x3673, 0x6912, 0x6912, 0x0888,
- 0x6913, 0x691E, 0x3674, 0x691F, 0x6920, 0x1892, 0x6921, 0x6923, 0x3680,
- 0x6924, 0x6924, 0x1895, 0x6925, 0x692C, 0x3683, 0x692D, 0x692D, 0x0E87,
- 0x692E, 0x692F, 0x368B, 0x6930, 0x6930, 0x1033, 0x6931, 0x6933, 0x368D,
- 0x6934, 0x6934, 0x18A6, 0x6935, 0x6938, 0x3690, 0x6939, 0x6939, 0x189D,
- 0x693A, 0x693C, 0x3694, 0x693D, 0x693D, 0x052D, 0x693E, 0x693E, 0x3697,
- 0x693F, 0x693F, 0x053E, 0x6940, 0x6941, 0x3698, 0x6942, 0x6942, 0x189F,
- 0x6943, 0x6949, 0x369A, 0x694A, 0x694A, 0x21FE, 0x694B, 0x6952, 0x36A1,
- 0x6953, 0x6953, 0x1EFE, 0x6954, 0x6954, 0x0F73, 0x6955, 0x6956, 0x36A9,
- 0x6957, 0x6957, 0x1899, 0x6958, 0x6959, 0x36AB, 0x695A, 0x695A, 0x0523,
- 0x695B, 0x695C, 0x36AD, 0x695D, 0x695D, 0x18A0, 0x695E, 0x695E, 0x09CE,
- 0x695F, 0x695F, 0x36AF, 0x6960, 0x6960, 0x189E, 0x6961, 0x6962, 0x36B0,
- 0x6963, 0x6963, 0x18AD, 0x6964, 0x6965, 0x36B2, 0x6966, 0x6966, 0x18AC,
- 0x6967, 0x6967, 0x36B4, 0x6968, 0x6968, 0x2475, 0x6969, 0x696A, 0x36B5,
- 0x696B, 0x696B, 0x18A2, 0x696C, 0x696C, 0x36B7, 0x696D, 0x696D, 0x220A,
- 0x696E, 0x696E, 0x1890, 0x696F, 0x6970, 0x36B8, 0x6971, 0x6971, 0x189C,
- 0x6972, 0x6974, 0x36BA, 0x6975, 0x6975, 0x1F6F, 0x6976, 0x6976, 0x36BD,
- 0x6977, 0x6977, 0x0939, 0x6978, 0x6978, 0x18A5, 0x6979, 0x6979, 0x18AE,
- 0x697A, 0x697B, 0x36BE, 0x697C, 0x697C, 0x0A4C, 0x697D, 0x697F, 0x36C0,
- 0x6980, 0x6980, 0x18A3, 0x6981, 0x6981, 0x36C3, 0x6982, 0x6982, 0x06C0,
- 0x6983, 0x6983, 0x36C4, 0x6984, 0x6984, 0x18A1, 0x6985, 0x6985, 0x36C5,
- 0x6986, 0x6986, 0x10C1, 0x6987, 0x6988, 0x18A8, 0x6989, 0x6989, 0x18AB,
- 0x698A, 0x698C, 0x36C6, 0x698D, 0x698D, 0x18BB, 0x698E, 0x6993, 0x36C9,
- 0x6994, 0x6994, 0x09B1, 0x6995, 0x6995, 0x18B9, 0x6996, 0x6997, 0x36CF,
- 0x6998, 0x6998, 0x18A4, 0x6999, 0x699A, 0x36D1, 0x699B, 0x699B, 0x18AF,
- 0x699C, 0x699C, 0x03FC, 0x699D, 0x69A6, 0x36D3, 0x69A7, 0x69A7, 0x18B0,
- 0x69A8, 0x69A8, 0x1146, 0x69A9, 0x69A9, 0x36DD, 0x69AA, 0x69AA, 0x2468,
- 0x69AB, 0x69AB, 0x18B2, 0x69AC, 0x69AC, 0x36DE, 0x69AD, 0x69AD, 0x18B3,
- 0x69AE, 0x69AE, 0x2100, 0x69AF, 0x69B0, 0x36DF, 0x69B1, 0x69B1, 0x18B5,
- 0x69B2, 0x69B3, 0x36E1, 0x69B4, 0x69B4, 0x0A3A, 0x69B5, 0x69B6, 0x36E3,
- 0x69B7, 0x69B7, 0x0C91, 0x69B8, 0x69BA, 0x36E5, 0x69BB, 0x69BB, 0x18B1,
- 0x69BC, 0x69BE, 0x36E8, 0x69BF, 0x69BF, 0x2476, 0x69C0, 0x69C0, 0x36EB,
- 0x69C1, 0x69C1, 0x18B6, 0x69C2, 0x69C9, 0x36EC, 0x69CA, 0x69CA, 0x18B7,
- 0x69CB, 0x69CB, 0x1F27, 0x69CC, 0x69CC, 0x18A7, 0x69CD, 0x69CD, 0x20D7,
- 0x69CE, 0x69CE, 0x18AA, 0x69CF, 0x69CF, 0x36F4, 0x69D0, 0x69D0, 0x07C6,
- 0x69D1, 0x69D3, 0x36F5, 0x69D4, 0x69D4, 0x18B4, 0x69D5, 0x69DA, 0x36F8,
- 0x69DB, 0x69DB, 0x086A, 0x69DC, 0x69DE, 0x36FE, 0x69DF, 0x69DF, 0x18B8,
- 0x69E0, 0x69E0, 0x18BA, 0x69E1, 0x69E6, 0x3701, 0x69E7, 0x69E7, 0x247C,
- 0x69E8, 0x69EC, 0x3707, 0x69ED, 0x69ED, 0x18BE, 0x69EE, 0x69F1, 0x370C,
- 0x69F2, 0x69F2, 0x18C2, 0x69F3, 0x69F3, 0x1FA1, 0x69F4, 0x69FC, 0x3710,
- 0x69FD, 0x69FD, 0x04A2, 0x69FE, 0x69FE, 0x3719, 0x69FF, 0x69FF, 0x18BC,
- 0x6A00, 0x6A00, 0x371A, 0x6A01, 0x6A01, 0x22AA, 0x6A02, 0x6A02, 0x2005,
- 0x6A03, 0x6A04, 0x371B, 0x6A05, 0x6A05, 0x246C, 0x6A06, 0x6A09, 0x371D,
- 0x6A0A, 0x6A0A, 0x064B, 0x6A0B, 0x6A12, 0x3721, 0x6A13, 0x6A13, 0x203E,
- 0x6A14, 0x6A16, 0x3729, 0x6A17, 0x6A18, 0x18BF, 0x6A19, 0x6A19, 0x1E4C,
- 0x6A1A, 0x6A1D, 0x372C, 0x6A1E, 0x6A1E, 0x213A, 0x6A1F, 0x6A1F, 0x1162,
- 0x6A20, 0x6A20, 0x3730, 0x6A21, 0x6A21, 0x0B06, 0x6A22, 0x6A22, 0x3731,
- 0x6A23, 0x6A23, 0x2204, 0x6A24, 0x6A27, 0x3732, 0x6A28, 0x6A28, 0x18CC,
- 0x6A29, 0x6A29, 0x3736, 0x6A2A, 0x6A2A, 0x0798, 0x6A2B, 0x6A2E, 0x3737,
- 0x6A2F, 0x6A2F, 0x18BD, 0x6A30, 0x6A30, 0x373B, 0x6A31, 0x6A31, 0x1088,
- 0x6A32, 0x6A34, 0x373C, 0x6A35, 0x6A35, 0x18C8, 0x6A36, 0x6A37, 0x373F,
- 0x6A38, 0x6A38, 0x20C3, 0x6A39, 0x6A39, 0x2140, 0x6A3A, 0x6A3A, 0x2477,
- 0x6A3B, 0x6A3C, 0x3741, 0x6A3D, 0x6A3D, 0x18CB, 0x6A3E, 0x6A3E, 0x18C4,
- 0x6A3F, 0x6A43, 0x3743, 0x6A44, 0x6A44, 0x18C3, 0x6A45, 0x6A46, 0x3748,
- 0x6A47, 0x6A47, 0x0C3E, 0x6A48, 0x6A48, 0x2474, 0x6A49, 0x6A4A, 0x374A,
- 0x6A4B, 0x6A4B, 0x20DD, 0x6A4C, 0x6A4F, 0x374C, 0x6A50, 0x6A50, 0x18C6,
- 0x6A51, 0x6A57, 0x3750, 0x6A58, 0x6A58, 0x18CD, 0x6A59, 0x6A59, 0x04ED,
- 0x6A5A, 0x6A5A, 0x3757, 0x6A5B, 0x6A5B, 0x18C7, 0x6A5C, 0x6A5E, 0x3758,
- 0x6A5F, 0x6A5F, 0x1F68, 0x6A60, 0x6A60, 0x375B, 0x6A61, 0x6A61, 0x0F5D,
- 0x6A62, 0x6A62, 0x2185, 0x6A63, 0x6A64, 0x375C, 0x6A65, 0x6A65, 0x18C1,
- 0x6A66, 0x6A70, 0x375E, 0x6A71, 0x6A71, 0x051C, 0x6A72, 0x6A78, 0x3769,
- 0x6A79, 0x6A79, 0x18CA, 0x6A7A, 0x6A7B, 0x3770, 0x6A7C, 0x6A7C, 0x18CE,
- 0x6A7D, 0x6A7F, 0x3772, 0x6A80, 0x6A80, 0x0E07, 0x6A81, 0x6A83, 0x3775,
- 0x6A84, 0x6A84, 0x0F1A, 0x6A85, 0x6A88, 0x3778, 0x6A89, 0x6A89, 0x2472,
- 0x6A8A, 0x6A8D, 0x377C, 0x6A8E, 0x6A8E, 0x18C9, 0x6A8F, 0x6A8F, 0x3780,
- 0x6A90, 0x6A90, 0x18D0, 0x6A91, 0x6A91, 0x18CF, 0x6A92, 0x6A93, 0x3781,
- 0x6A94, 0x6A94, 0x1EB5, 0x6A95, 0x6A96, 0x3783, 0x6A97, 0x6A97, 0x18D2,
- 0x6A98, 0x6A9B, 0x3785, 0x6A9C, 0x6A9C, 0x2478, 0x6A9D, 0x6A9F, 0x3789,
- 0x6AA0, 0x6AA0, 0x18C5, 0x6AA1, 0x6AA1, 0x378C, 0x6AA2, 0x6AA2, 0x1F8B,
- 0x6AA3, 0x6AA3, 0x2484, 0x6AA4, 0x6AA8, 0x378D, 0x6AA9, 0x6AA9, 0x18D1,
- 0x6AAA, 0x6AAA, 0x3792, 0x6AAB, 0x6AAB, 0x18D3, 0x6AAC, 0x6AAC, 0x0ACF,
- 0x6AAD, 0x6AAE, 0x3793, 0x6AAF, 0x6AAF, 0x2699, 0x6AB0, 0x6AB2, 0x3795,
- 0x6AB3, 0x6AB3, 0x2482, 0x6AB4, 0x6AB7, 0x3798, 0x6AB8, 0x6AB8, 0x20A1,
- 0x6AB9, 0x6ABA, 0x379C, 0x6ABB, 0x6ABB, 0x1F92, 0x6ABC, 0x6AC2, 0x379E,
- 0x6AC3, 0x6AC3, 0x1F38, 0x6AC4, 0x6AD2, 0x37A5, 0x6AD3, 0x6AD3, 0x2485,
- 0x6AD4, 0x6AD9, 0x37B4, 0x6ADA, 0x6ADA, 0x2480, 0x6ADB, 0x6ADB, 0x246E,
- 0x6ADC, 0x6ADC, 0x37BA, 0x6ADD, 0x6ADD, 0x247B, 0x6ADE, 0x6ADE, 0x2486,
- 0x6ADF, 0x6ADF, 0x2471, 0x6AE0, 0x6AE6, 0x37BB, 0x6AE7, 0x6AE7, 0x2483,
- 0x6AE8, 0x6AE8, 0x2470, 0x6AE9, 0x6AE9, 0x37C2, 0x6AEA, 0x6AEA, 0x2469,
- 0x6AEB, 0x6AEB, 0x37C3, 0x6AEC, 0x6AEC, 0x247F, 0x6AED, 0x6AF2, 0x37C4,
- 0x6AF3, 0x6AF3, 0x246F, 0x6AF4, 0x6AF7, 0x37CA, 0x6AF8, 0x6AF8, 0x2481,
- 0x6AF9, 0x6AFA, 0x37CE, 0x6AFB, 0x6AFB, 0x2220, 0x6AFC, 0x6AFF, 0x37D0,
- 0x6B00, 0x6B03, 0x37D4, 0x6B04, 0x6B04, 0x1FF5, 0x6B05, 0x6B09, 0x37D8,
- 0x6B0A, 0x6B0A, 0x20F4, 0x6B0B, 0x6B0E, 0x37DD, 0x6B0F, 0x6B0F, 0x247D,
- 0x6B10, 0x6B11, 0x37E1, 0x6B12, 0x6B12, 0x2479, 0x6B13, 0x6B15, 0x37E3,
- 0x6B16, 0x6B16, 0x247E, 0x6B17, 0x6B1D, 0x37E6, 0x6B1E, 0x6B1E, 0x247A,
- 0x6B1F, 0x6B1F, 0x37ED, 0x6B20, 0x6B20, 0x0C34, 0x6B21, 0x6B21, 0x0551,
- 0x6B22, 0x6B22, 0x07CB, 0x6B23, 0x6B23, 0x0F8B, 0x6B24, 0x6B24, 0x19B1,
- 0x6B25, 0x6B26, 0x37EE, 0x6B27, 0x6B27, 0x0B78, 0x6B28, 0x6B31, 0x37F0,
- 0x6B32, 0x6B32, 0x10E0, 0x6B33, 0x6B36, 0x37FA, 0x6B37, 0x6B37, 0x19B2,
- 0x6B38, 0x6B38, 0x37FE, 0x6B39, 0x6B39, 0x19B3, 0x6B3A, 0x6B3A, 0x0BFA,
- 0x6B3B, 0x6B3C, 0x37FF, 0x6B3D, 0x6B3D, 0x20E3, 0x6B3E, 0x6B3E, 0x097B,
- 0x6B3F, 0x6B42, 0x3801, 0x6B43, 0x6B43, 0x19B4, 0x6B44, 0x6B45, 0x3805,
- 0x6B46, 0x6B46, 0x19B5, 0x6B47, 0x6B47, 0x0F75, 0x6B48, 0x6B48, 0x3807,
- 0x6B49, 0x6B49, 0x0C35, 0x6B4A, 0x6B4B, 0x3808, 0x6B4C, 0x6B4C, 0x06E3,
- 0x6B4D, 0x6B4F, 0x380A, 0x6B50, 0x6B50, 0x20AD, 0x6B51, 0x6B58, 0x380D,
- 0x6B59, 0x6B59, 0x19B6, 0x6B5A, 0x6B5E, 0x3815, 0x6B5F, 0x6B5F, 0x24CB,
- 0x6B60, 0x6B60, 0x381A, 0x6B61, 0x6B61, 0x1F53, 0x6B62, 0x6B62, 0x11B8,
- 0x6B63, 0x6B63, 0x119E, 0x6B64, 0x6B64, 0x054E, 0x6B65, 0x6B65, 0x0484,
- 0x6B66, 0x6B66, 0x0EF3, 0x6B67, 0x6B67, 0x0C06, 0x6B68, 0x6B69, 0x381B,
- 0x6B6A, 0x6B6A, 0x0E92, 0x6B6B, 0x6B71, 0x381D, 0x6B72, 0x6B72, 0x2159,
- 0x6B73, 0x6B76, 0x3824, 0x6B77, 0x6B77, 0x2013, 0x6B78, 0x6B78, 0x1F33,
- 0x6B79, 0x6B79, 0x0578, 0x6B7A, 0x6B7A, 0x3828, 0x6B7B, 0x6B7B, 0x0DB5,
- 0x6B7C, 0x6B7C, 0x0852, 0x6B7D, 0x6B80, 0x3829, 0x6B81, 0x6B82, 0x18D6,
- 0x6B83, 0x6B83, 0x1013, 0x6B84, 0x6B84, 0x18D9, 0x6B85, 0x6B85, 0x382D,
- 0x6B86, 0x6B86, 0x057C, 0x6B87, 0x6B87, 0x18D8, 0x6B88, 0x6B88, 0x382E,
- 0x6B89, 0x6B89, 0x0FDC, 0x6B8A, 0x6B8A, 0x0D79, 0x6B8B, 0x6B8B, 0x0497,
- 0x6B8C, 0x6B8C, 0x382F, 0x6B8D, 0x6B8D, 0x18DC, 0x6B8E, 0x6B91, 0x3830,
- 0x6B92, 0x6B93, 0x18DA, 0x6B94, 0x6B95, 0x3834, 0x6B96, 0x6B96, 0x11B2,
- 0x6B97, 0x6B97, 0x3836, 0x6B98, 0x6B98, 0x1E5C, 0x6B99, 0x6B99, 0x3837,
- 0x6B9A, 0x6B9B, 0x18DD, 0x6B9C, 0x6B9D, 0x3838, 0x6B9E, 0x6B9E, 0x2488,
- 0x6B9F, 0x6BA0, 0x383A, 0x6BA1, 0x6BA1, 0x18DF, 0x6BA2, 0x6BA3, 0x383C,
- 0x6BA4, 0x6BA4, 0x2487, 0x6BA5, 0x6BA9, 0x383E, 0x6BAA, 0x6BAA, 0x18E0,
- 0x6BAB, 0x6BAB, 0x248A, 0x6BAC, 0x6BAD, 0x3843, 0x6BAE, 0x6BAE, 0x2489,
- 0x6BAF, 0x6BAF, 0x248B, 0x6BB0, 0x6BB1, 0x3845, 0x6BB2, 0x6BB2, 0x1F83,
- 0x6BB3, 0x6BB3, 0x19BD, 0x6BB4, 0x6BB4, 0x0B7A, 0x6BB5, 0x6BB5, 0x060D,
- 0x6BB6, 0x6BB6, 0x3847, 0x6BB7, 0x6BB7, 0x107A, 0x6BB8, 0x6BB9, 0x3848,
- 0x6BBA, 0x6BBA, 0x210F, 0x6BBB, 0x6BBB, 0x1FDB, 0x6BBC, 0x6BBE, 0x384A,
- 0x6BBF, 0x6BBF, 0x05CF, 0x6BC0, 0x6BC0, 0x384D, 0x6BC1, 0x6BC1, 0x07EE,
- 0x6BC2, 0x6BC2, 0x19BF, 0x6BC3, 0x6BC4, 0x384E, 0x6BC5, 0x6BC5, 0x106A,
- 0x6BC6, 0x6BC6, 0x20AF, 0x6BC7, 0x6BCA, 0x3850, 0x6BCB, 0x6BCB, 0x0EF2,
- 0x6BCC, 0x6BCC, 0x3854, 0x6BCD, 0x6BCD, 0x0B1B, 0x6BCE, 0x6BCE, 0x3855,
- 0x6BCF, 0x6BCF, 0x0AC4, 0x6BD0, 0x6BD1, 0x3856, 0x6BD2, 0x6BD2, 0x05FD,
- 0x6BD3, 0x6BD3, 0x126F, 0x6BD4, 0x6BD4, 0x0431, 0x6BD5, 0x6BD5, 0x0438,
- 0x6BD6, 0x6BD6, 0x043A, 0x6BD7, 0x6BD7, 0x0BBF, 0x6BD8, 0x6BD8, 0x3858,
- 0x6BD9, 0x6BD9, 0x0439, 0x6BDA, 0x6BDA, 0x3859, 0x6BDB, 0x6BDB, 0x0AB0,
- 0x6BDC, 0x6BE0, 0x385A, 0x6BE1, 0x6BE1, 0x1152, 0x6BE2, 0x6BE9, 0x385F,
- 0x6BEA, 0x6BEA, 0x1954, 0x6BEB, 0x6BEB, 0x0778, 0x6BEC, 0x6BEE, 0x3867,
- 0x6BEF, 0x6BEF, 0x0E0D, 0x6BF0, 0x6BF2, 0x386A, 0x6BF3, 0x6BF3, 0x1955,
- 0x6BF4, 0x6BF4, 0x386D, 0x6BF5, 0x6BF5, 0x1957, 0x6BF6, 0x6BF8, 0x386E,
- 0x6BF9, 0x6BF9, 0x1958, 0x6BFA, 0x6BFC, 0x3871, 0x6BFD, 0x6BFD, 0x1956,
- 0x6BFE, 0x6BFE, 0x3874, 0x6BFF, 0x6BFF, 0x24C0, 0x6C00, 0x6C04, 0x3875,
- 0x6C05, 0x6C05, 0x1959, 0x6C06, 0x6C06, 0x195B, 0x6C07, 0x6C07, 0x195A,
- 0x6C08, 0x6C08, 0x226D, 0x6C09, 0x6C0B, 0x387A, 0x6C0C, 0x6C0C, 0x24C1,
- 0x6C0D, 0x6C0D, 0x195C, 0x6C0E, 0x6C0E, 0x387D, 0x6C0F, 0x6C0F, 0x0D66,
- 0x6C10, 0x6C10, 0x126B, 0x6C11, 0x6C11, 0x0AF6, 0x6C12, 0x6C12, 0x387E,
- 0x6C13, 0x6C13, 0x0AAA, 0x6C14, 0x6C14, 0x0C17, 0x6C15, 0x6C15, 0x195D,
- 0x6C16, 0x6C16, 0x0B2D, 0x6C17, 0x6C17, 0x387F, 0x6C18, 0x6C1A, 0x195E,
- 0x6C1B, 0x6C1B, 0x0672, 0x6C1C, 0x6C1E, 0x3880, 0x6C1F, 0x6C1F, 0x0697,
- 0x6C20, 0x6C20, 0x3883, 0x6C21, 0x6C21, 0x1961, 0x6C22, 0x6C22, 0x0C5F,
- 0x6C23, 0x6C23, 0x20CA, 0x6C24, 0x6C24, 0x1963, 0x6C25, 0x6C25, 0x3884,
- 0x6C26, 0x6C26, 0x075B, 0x6C27, 0x6C27, 0x101E, 0x6C28, 0x6C28, 0x03BC,
- 0x6C29, 0x6C29, 0x1962, 0x6C2A, 0x6C2A, 0x1964, 0x6C2B, 0x6C2B, 0x20E7,
- 0x6C2C, 0x6C2C, 0x24C2, 0x6C2D, 0x6C2D, 0x3885, 0x6C2E, 0x6C2E, 0x058B,
- 0x6C2F, 0x6C2F, 0x0A6F, 0x6C30, 0x6C30, 0x0C65, 0x6C31, 0x6C31, 0x3886,
- 0x6C32, 0x6C32, 0x1965, 0x6C33, 0x6C33, 0x3887, 0x6C34, 0x6C34, 0x0DA3,
- 0x6C35, 0x6C35, 0x169F, 0x6C36, 0x6C37, 0x3888, 0x6C38, 0x6C38, 0x10A5,
- 0x6C39, 0x6C3C, 0x388A, 0x6C3D, 0x6C3D, 0x12EF, 0x6C3E, 0x6C3F, 0x388E,
- 0x6C40, 0x6C40, 0x0E52, 0x6C41, 0x6C41, 0x11AC, 0x6C42, 0x6C42, 0x0C70,
- 0x6C43, 0x6C45, 0x3890, 0x6C46, 0x6C46, 0x12F4, 0x6C47, 0x6C47, 0x07F8,
- 0x6C48, 0x6C48, 0x3893, 0x6C49, 0x6C49, 0x0771, 0x6C4A, 0x6C4A, 0x16A2,
- 0x6C4B, 0x6C4F, 0x3894, 0x6C50, 0x6C50, 0x0F18, 0x6C51, 0x6C53, 0x3899,
- 0x6C54, 0x6C54, 0x16A0, 0x6C55, 0x6C55, 0x0D00, 0x6C56, 0x6C56, 0x389C,
- 0x6C57, 0x6C57, 0x0770, 0x6C58, 0x6C5A, 0x389D, 0x6C5B, 0x6C5B, 0x0FDD,
- 0x6C5C, 0x6C5C, 0x16A1, 0x6C5D, 0x6C5D, 0x0CC5, 0x6C5E, 0x6C5E, 0x0708,
- 0x6C5F, 0x6C5F, 0x087E, 0x6C60, 0x6C60, 0x04FD, 0x6C61, 0x6C61, 0x0EEA,
- 0x6C62, 0x6C63, 0x38A0, 0x6C64, 0x6C64, 0x0E13, 0x6C65, 0x6C67, 0x38A2,
- 0x6C68, 0x6C69, 0x16A8, 0x6C6A, 0x6C6A, 0x0EA5, 0x6C6B, 0x6C6F, 0x38A5,
- 0x6C70, 0x6C70, 0x0E00, 0x6C71, 0x6C71, 0x38AA, 0x6C72, 0x6C72, 0x0826,
- 0x6C73, 0x6C73, 0x38AB, 0x6C74, 0x6C74, 0x16AA, 0x6C75, 0x6C75, 0x38AC,
- 0x6C76, 0x6C76, 0x16AB, 0x6C77, 0x6C78, 0x38AD, 0x6C79, 0x6C79, 0x0FA5,
- 0x6C7A, 0x6C7C, 0x38AF, 0x6C7D, 0x6C7D, 0x0C1A, 0x6C7E, 0x6C7E, 0x0677,
- 0x6C7F, 0x6C80, 0x38B2, 0x6C81, 0x6C81, 0x0C5C, 0x6C82, 0x6C82, 0x1051,
- 0x6C83, 0x6C83, 0x0EE5, 0x6C84, 0x6C84, 0x38B4, 0x6C85, 0x6C85, 0x16A4,
- 0x6C86, 0x6C86, 0x16AC, 0x6C87, 0x6C87, 0x38B5, 0x6C88, 0x6C88, 0x0D2B,
- 0x6C89, 0x6C89, 0x04E6, 0x6C8A, 0x6C8B, 0x38B6, 0x6C8C, 0x6C8C, 0x16A7,
- 0x6C8D, 0x6C8E, 0x38B8, 0x6C8F, 0x6C8F, 0x0C02, 0x6C90, 0x6C90, 0x16A5,
- 0x6C91, 0x6C92, 0x38BA, 0x6C93, 0x6C93, 0x1A1F, 0x6C94, 0x6C94, 0x16A6,
- 0x6C95, 0x6C98, 0x38BC, 0x6C99, 0x6C99, 0x0CEC, 0x6C9A, 0x6C9A, 0x38C0,
- 0x6C9B, 0x6C9B, 0x0BA7, 0x6C9C, 0x6C9E, 0x38C1, 0x6C9F, 0x6C9F, 0x070E,
- 0x6CA0, 0x6CA0, 0x38C4, 0x6CA1, 0x6CA1, 0x0AC0, 0x6CA2, 0x6CA2, 0x38C5,
- 0x6CA3, 0x6CA3, 0x16A3, 0x6CA4, 0x6CA4, 0x0B7E, 0x6CA5, 0x6CA5, 0x09ED,
- 0x6CA6, 0x6CA6, 0x0A80, 0x6CA7, 0x6CA7, 0x049E, 0x6CA8, 0x6CA8, 0x38C6,
- 0x6CA9, 0x6CA9, 0x16AD, 0x6CAA, 0x6CAA, 0x07BB, 0x6CAB, 0x6CAB, 0x0B10,
- 0x6CAC, 0x6CAC, 0x38C7, 0x6CAD, 0x6CAD, 0x16B0, 0x6CAE, 0x6CAE, 0x0909,
- 0x6CAF, 0x6CB0, 0x38C8, 0x6CB1, 0x6CB1, 0x16BB, 0x6CB2, 0x6CB2, 0x16B5,
- 0x6CB3, 0x6CB3, 0x078A, 0x6CB4, 0x6CB7, 0x38CA, 0x6CB8, 0x6CB8, 0x066D,
- 0x6CB9, 0x6CB9, 0x10B2, 0x6CBA, 0x6CBA, 0x38CE, 0x6CBB, 0x6CBB, 0x11CD,
- 0x6CBC, 0x6CBC, 0x1174, 0x6CBD, 0x6CBD, 0x071A, 0x6CBE, 0x6CBE, 0x1155,
- 0x6CBF, 0x6CBF, 0x1001, 0x6CC0, 0x6CC3, 0x38CF, 0x6CC4, 0x6CC4, 0x0F84,
- 0x6CC5, 0x6CC5, 0x0C73, 0x6CC6, 0x6CC8, 0x38D3, 0x6CC9, 0x6CC9, 0x0C85,
- 0x6CCA, 0x6CCA, 0x047B, 0x6CCB, 0x6CCB, 0x38D6, 0x6CCC, 0x6CCC, 0x0ADF,
- 0x6CCD, 0x6CCF, 0x38D7, 0x6CD0, 0x6CD0, 0x16AE, 0x6CD1, 0x6CD2, 0x38DA,
- 0x6CD3, 0x6CD3, 0x16BC, 0x6CD4, 0x6CD4, 0x16AF, 0x6CD5, 0x6CD5, 0x0645,
- 0x6CD6, 0x6CD6, 0x16B7, 0x6CD7, 0x6CD7, 0x16B4, 0x6CD8, 0x6CDA, 0x38DC,
- 0x6CDB, 0x6CDB, 0x0657, 0x6CDC, 0x6CDD, 0x38DF, 0x6CDE, 0x6CDE, 0x0B63,
- 0x6CDF, 0x6CDF, 0x38E1, 0x6CE0, 0x6CE0, 0x16B6, 0x6CE1, 0x6CE1, 0x0B9E,
- 0x6CE2, 0x6CE2, 0x046F, 0x6CE3, 0x6CE3, 0x0C1B, 0x6CE4, 0x6CE4, 0x38E2,
- 0x6CE5, 0x6CE5, 0x0B43, 0x6CE6, 0x6CE7, 0x38E3, 0x6CE8, 0x6CE8, 0x11FF,
- 0x6CE9, 0x6CE9, 0x38E5, 0x6CEA, 0x6CEA, 0x09CC, 0x6CEB, 0x6CEB, 0x16B9,
- 0x6CEC, 0x6CED, 0x38E6, 0x6CEE, 0x6CEE, 0x16BA, 0x6CEF, 0x6CEF, 0x16BD,
- 0x6CF0, 0x6CF0, 0x0DFC, 0x6CF1, 0x6CF1, 0x16B3, 0x6CF2, 0x6CF2, 0x38E8,
- 0x6CF3, 0x6CF3, 0x10A3, 0x6CF4, 0x6CF4, 0x38E9, 0x6CF5, 0x6CF5, 0x042C,
- 0x6CF6, 0x6CF6, 0x1A20, 0x6CF7, 0x6CF8, 0x16B1, 0x6CF9, 0x6CF9, 0x38EA,
- 0x6CFA, 0x6CFA, 0x16B8, 0x6CFB, 0x6CFB, 0x0F85, 0x6CFC, 0x6CFC, 0x0BE2,
- 0x6CFD, 0x6CFD, 0x1136, 0x6CFE, 0x6CFE, 0x16BE, 0x6CFF, 0x6CFF, 0x38EB,
- 0x6D00, 0x6D00, 0x38EC, 0x6D01, 0x6D01, 0x08B1, 0x6D02, 0x6D03, 0x38ED,
- 0x6D04, 0x6D04, 0x16C5, 0x6D05, 0x6D06, 0x38EF, 0x6D07, 0x6D07, 0x16C4,
- 0x6D08, 0x6D0A, 0x38F1, 0x6D0B, 0x6D0B, 0x101C, 0x6D0C, 0x6D0C, 0x16C1,
- 0x6D0D, 0x6D0D, 0x38F4, 0x6D0E, 0x6D0E, 0x16C7, 0x6D0F, 0x6D11, 0x38F5,
- 0x6D12, 0x6D12, 0x0CD2, 0x6D13, 0x6D16, 0x38F8, 0x6D17, 0x6D17, 0x0F21,
- 0x6D18, 0x6D18, 0x38FC, 0x6D19, 0x6D19, 0x16C6, 0x6D1A, 0x6D1A, 0x16CC,
- 0x6D1B, 0x6D1B, 0x0A8C, 0x6D1C, 0x6D1D, 0x38FD, 0x6D1E, 0x6D1E, 0x05F3,
- 0x6D1F, 0x6D24, 0x38FF, 0x6D25, 0x6D25, 0x08C3, 0x6D26, 0x6D26, 0x3905,
- 0x6D27, 0x6D27, 0x16C0, 0x6D28, 0x6D29, 0x3906, 0x6D2A, 0x6D2A, 0x07A0,
- 0x6D2B, 0x6D2B, 0x16C8, 0x6D2C, 0x6D2D, 0x3908, 0x6D2E, 0x6D2E, 0x16CA,
- 0x6D2F, 0x6D30, 0x390A, 0x6D31, 0x6D31, 0x063C, 0x6D32, 0x6D32, 0x11DD,
- 0x6D33, 0x6D33, 0x16D0, 0x6D34, 0x6D34, 0x390C, 0x6D35, 0x6D35, 0x16CB,
- 0x6D36, 0x6D38, 0x390D, 0x6D39, 0x6D39, 0x16BF, 0x6D3A, 0x6D3A, 0x3910,
- 0x6D3B, 0x6D3B, 0x0803, 0x6D3C, 0x6D3C, 0x0E8E, 0x6D3D, 0x6D3D, 0x0C1F,
- 0x6D3E, 0x6D3E, 0x0B8A, 0x6D3F, 0x6D40, 0x3911, 0x6D41, 0x6D41, 0x0A40,
- 0x6D42, 0x6D42, 0x3913, 0x6D43, 0x6D43, 0x16C2, 0x6D44, 0x6D44, 0x3914,
- 0x6D45, 0x6D45, 0x0C30, 0x6D46, 0x6D46, 0x087D, 0x6D47, 0x6D47, 0x088E,
- 0x6D48, 0x6D48, 0x16C3, 0x6D49, 0x6D49, 0x3915, 0x6D4A, 0x6D4A, 0x1224,
- 0x6D4B, 0x6D4B, 0x04A9, 0x6D4C, 0x6D4C, 0x3916, 0x6D4D, 0x6D4D, 0x16C9,
- 0x6D4E, 0x6D4E, 0x0836, 0x6D4F, 0x6D4F, 0x16CD, 0x6D50, 0x6D50, 0x3917,
- 0x6D51, 0x6D51, 0x0800, 0x6D52, 0x6D52, 0x16CE, 0x6D53, 0x6D53, 0x0B69,
- 0x6D54, 0x6D54, 0x16CF, 0x6D55, 0x6D58, 0x3918, 0x6D59, 0x6D59, 0x1184,
- 0x6D5A, 0x6D5A, 0x0930, 0x6D5B, 0x6D5B, 0x391C, 0x6D5C, 0x6D5C, 0x16D8,
- 0x6D5D, 0x6D5D, 0x391D, 0x6D5E, 0x6D5E, 0x16D5, 0x6D5F, 0x6D5F, 0x391E,
- 0x6D60, 0x6D60, 0x16D9, 0x6D61, 0x6D62, 0x391F, 0x6D63, 0x6D63, 0x16DB,
- 0x6D64, 0x6D65, 0x3921, 0x6D66, 0x6D66, 0x0BF5, 0x6D67, 0x6D68, 0x3923,
- 0x6D69, 0x6D69, 0x077D, 0x6D6A, 0x6D6A, 0x09B6, 0x6D6B, 0x6D6D, 0x3925,
- 0x6D6E, 0x6D6E, 0x069C, 0x6D6F, 0x6D6F, 0x16D2, 0x6D70, 0x6D73, 0x3928,
- 0x6D74, 0x6D74, 0x10E4, 0x6D75, 0x6D76, 0x392C, 0x6D77, 0x6D77, 0x075A,
- 0x6D78, 0x6D78, 0x08CF, 0x6D79, 0x6D79, 0x23DC, 0x6D7A, 0x6D7B, 0x392E,
- 0x6D7C, 0x6D7C, 0x16DA, 0x6D7D, 0x6D81, 0x3930, 0x6D82, 0x6D82, 0x0E70,
- 0x6D83, 0x6D84, 0x3935, 0x6D85, 0x6D85, 0x0B5C, 0x6D86, 0x6D86, 0x3937,
- 0x6D87, 0x6D87, 0x23DB, 0x6D88, 0x6D88, 0x0F68, 0x6D89, 0x6D89, 0x0D1F,
- 0x6D8A, 0x6D8B, 0x3938, 0x6D8C, 0x6D8C, 0x10A4, 0x6D8D, 0x6D8D, 0x393A,
- 0x6D8E, 0x6D8E, 0x0F3E, 0x6D8F, 0x6D90, 0x393B, 0x6D91, 0x6D91, 0x16D1,
- 0x6D92, 0x6D92, 0x393D, 0x6D93, 0x6D94, 0x16D6, 0x6D95, 0x6D95, 0x0E3C,
- 0x6D96, 0x6D9A, 0x393E, 0x6D9B, 0x6D9B, 0x0E21, 0x6D9C, 0x6D9C, 0x3943,
- 0x6D9D, 0x6D9D, 0x09BF, 0x6D9E, 0x6D9E, 0x16D3, 0x6D9F, 0x6D9F, 0x09F9,
- 0x6DA0, 0x6DA0, 0x16D4, 0x6DA1, 0x6DA1, 0x0EDF, 0x6DA2, 0x6DA2, 0x3944,
- 0x6DA3, 0x6DA3, 0x07D6, 0x6DA4, 0x6DA4, 0x05B4, 0x6DA5, 0x6DA5, 0x3945,
- 0x6DA6, 0x6DA6, 0x0CCE, 0x6DA7, 0x6DA7, 0x0878, 0x6DA8, 0x6DA8, 0x1168,
- 0x6DA9, 0x6DA9, 0x0CE5, 0x6DAA, 0x6DAA, 0x069D, 0x6DAB, 0x6DAB, 0x16E8,
- 0x6DAC, 0x6DAD, 0x3946, 0x6DAE, 0x6DAE, 0x16EA, 0x6DAF, 0x6DAF, 0x0FED,
- 0x6DB0, 0x6DB1, 0x3948, 0x6DB2, 0x6DB2, 0x1041, 0x6DB3, 0x6DB4, 0x394A,
- 0x6DB5, 0x6DB5, 0x0764, 0x6DB6, 0x6DB7, 0x394C, 0x6DB8, 0x6DB8, 0x078B,
- 0x6DB9, 0x6DBE, 0x394E, 0x6DBF, 0x6DBF, 0x16E1, 0x6DC0, 0x6DC0, 0x05CE,
- 0x6DC1, 0x6DC3, 0x3954, 0x6DC4, 0x6DC4, 0x122A, 0x6DC5, 0x6DC5, 0x16DE,
- 0x6DC6, 0x6DC6, 0x0F6A, 0x6DC7, 0x6DC7, 0x16DD, 0x6DC8, 0x6DCA, 0x3957,
- 0x6DCB, 0x6DCB, 0x0A25, 0x6DCC, 0x6DCC, 0x0E1D, 0x6DCD, 0x6DD0, 0x395A,
- 0x6DD1, 0x6DD1, 0x0D7E, 0x6DD2, 0x6DD5, 0x395E, 0x6DD6, 0x6DD6, 0x0B3A,
- 0x6DD7, 0x6DD7, 0x3962, 0x6DD8, 0x6DD8, 0x0E27, 0x6DD9, 0x6DD9, 0x16E6,
- 0x6DDA, 0x6DDC, 0x3963, 0x6DDD, 0x6DDD, 0x16E5, 0x6DDE, 0x6DDE, 0x16DF,
- 0x6DDF, 0x6DDF, 0x3966, 0x6DE0, 0x6DE0, 0x16E2, 0x6DE1, 0x6DE1, 0x058E,
- 0x6DE2, 0x6DE3, 0x3967, 0x6DE4, 0x6DE4, 0x10BE, 0x6DE5, 0x6DE5, 0x3969,
- 0x6DE6, 0x6DE6, 0x16E4, 0x6DE7, 0x6DE9, 0x396A, 0x6DEA, 0x6DEA, 0x205E,
- 0x6DEB, 0x6DEB, 0x1080, 0x6DEC, 0x6DEC, 0x0566, 0x6DED, 0x6DED, 0x396D,
- 0x6DEE, 0x6DEE, 0x07C9, 0x6DEF, 0x6DF0, 0x396E, 0x6DF1, 0x6DF1, 0x0D27,
- 0x6DF2, 0x6DF2, 0x3970, 0x6DF3, 0x6DF3, 0x0541, 0x6DF4, 0x6DF4, 0x3971,
- 0x6DF5, 0x6DF5, 0x2244, 0x6DF6, 0x6DF6, 0x23E2, 0x6DF7, 0x6DF7, 0x0801,
- 0x6DF8, 0x6DF8, 0x3972, 0x6DF9, 0x6DF9, 0x0FF6, 0x6DFA, 0x6DFA, 0x20D4,
- 0x6DFB, 0x6DFB, 0x0E40, 0x6DFC, 0x6DFC, 0x1A21, 0x6DFD, 0x6DFF, 0x3973,
- 0x6E00, 0x6E04, 0x3976, 0x6E05, 0x6E05, 0x0C62, 0x6E06, 0x6E09, 0x397B,
- 0x6E0A, 0x6E0A, 0x10EB, 0x6E0B, 0x6E0B, 0x397F, 0x6E0C, 0x6E0C, 0x16E9,
- 0x6E0D, 0x6E0D, 0x1232, 0x6E0E, 0x6E0E, 0x16E0, 0x6E0F, 0x6E0F, 0x3980,
- 0x6E10, 0x6E10, 0x0876, 0x6E11, 0x6E11, 0x16E3, 0x6E12, 0x6E13, 0x3981,
- 0x6E14, 0x6E14, 0x10CB, 0x6E15, 0x6E15, 0x3983, 0x6E16, 0x6E16, 0x16E7,
- 0x6E17, 0x6E17, 0x0D31, 0x6E18, 0x6E19, 0x3984, 0x6E1A, 0x6E1A, 0x16DC,
- 0x6E1B, 0x6E1C, 0x3986, 0x6E1D, 0x6E1D, 0x10CA, 0x6E1E, 0x6E1F, 0x3988,
- 0x6E20, 0x6E20, 0x0C7B, 0x6E21, 0x6E21, 0x0608, 0x6E22, 0x6E22, 0x398A,
- 0x6E23, 0x6E23, 0x113F, 0x6E24, 0x6E24, 0x047A, 0x6E25, 0x6E25, 0x16F5,
- 0x6E26, 0x6E26, 0x219F, 0x6E27, 0x6E28, 0x398B, 0x6E29, 0x6E29, 0x0ED1,
- 0x6E2A, 0x6E2A, 0x398D, 0x6E2B, 0x6E2B, 0x16EB, 0x6E2C, 0x6E2C, 0x1E66,
- 0x6E2D, 0x6E2D, 0x0ECB, 0x6E2E, 0x6E2E, 0x398E, 0x6E2F, 0x6E2F, 0x06D6,
- 0x6E30, 0x6E31, 0x398F, 0x6E32, 0x6E32, 0x16F4, 0x6E33, 0x6E33, 0x3991,
- 0x6E34, 0x6E34, 0x0957, 0x6E35, 0x6E37, 0x3992, 0x6E38, 0x6E38, 0x10B3,
- 0x6E39, 0x6E39, 0x3995, 0x6E3A, 0x6E3A, 0x0AF1, 0x6E3B, 0x6E3D, 0x3996,
- 0x6E3E, 0x6E3E, 0x1F63, 0x6E3F, 0x6E42, 0x3999, 0x6E43, 0x6E43, 0x0B89,
- 0x6E44, 0x6E44, 0x16F6, 0x6E45, 0x6E4C, 0x399D, 0x6E4D, 0x6E4D, 0x0E75,
- 0x6E4E, 0x6E4E, 0x16ED, 0x6E4F, 0x6E52, 0x39A5, 0x6E53, 0x6E54, 0x16F2,
- 0x6E55, 0x6E55, 0x39A9, 0x6E56, 0x6E56, 0x07B5, 0x6E57, 0x6E57, 0x39AA,
- 0x6E58, 0x6E58, 0x0F53, 0x6E59, 0x6E5A, 0x39AB, 0x6E5B, 0x6E5B, 0x1160,
- 0x6E5C, 0x6E5D, 0x39AD, 0x6E5E, 0x6E5E, 0x23DD, 0x6E5F, 0x6E5F, 0x16F0,
- 0x6E60, 0x6E6A, 0x39AF, 0x6E6B, 0x6E6B, 0x16EE, 0x6E6C, 0x6E6D, 0x39BA,
- 0x6E6E, 0x6E6E, 0x16EC, 0x6E6F, 0x6E6F, 0x216B, 0x6E70, 0x6E7D, 0x39BC,
- 0x6E7E, 0x6E7E, 0x0E96, 0x6E7F, 0x6E7F, 0x0D41, 0x6E80, 0x6E82, 0x39CA,
- 0x6E83, 0x6E83, 0x098E, 0x6E84, 0x6E84, 0x39CD, 0x6E85, 0x6E85, 0x0877,
- 0x6E86, 0x6E86, 0x16F1, 0x6E87, 0x6E88, 0x39CE, 0x6E89, 0x6E89, 0x06C3,
- 0x6E8A, 0x6E8E, 0x39D0, 0x6E8F, 0x6E8F, 0x1705, 0x6E90, 0x6E90, 0x10F7,
- 0x6E91, 0x6E95, 0x39D5, 0x6E96, 0x6E96, 0x22B5, 0x6E97, 0x6E97, 0x39DA,
- 0x6E98, 0x6E98, 0x16F9, 0x6E99, 0x6E9B, 0x39DB, 0x6E9C, 0x6E9C, 0x0A38,
- 0x6E9D, 0x6E9D, 0x1F26, 0x6E9E, 0x6E9E, 0x39DE, 0x6E9F, 0x6E9F, 0x1707,
- 0x6EA0, 0x6EA1, 0x39DF, 0x6EA2, 0x6EA2, 0x106E, 0x6EA3, 0x6EA4, 0x39E1,
- 0x6EA5, 0x6EA5, 0x16FD, 0x6EA6, 0x6EA6, 0x39E3, 0x6EA7, 0x6EA7, 0x16FE,
- 0x6EA8, 0x6EA9, 0x39E4, 0x6EAA, 0x6EAA, 0x0F17, 0x6EAB, 0x6EAE, 0x39E6,
- 0x6EAF, 0x6EAF, 0x0DD2, 0x6EB0, 0x6EB0, 0x39EA, 0x6EB1, 0x6EB1, 0x16F8,
- 0x6EB2, 0x6EB2, 0x16EF, 0x6EB3, 0x6EB3, 0x39EB, 0x6EB4, 0x6EB4, 0x1703,
- 0x6EB5, 0x6EB5, 0x39EC, 0x6EB6, 0x6EB6, 0x0CB7, 0x6EB7, 0x6EB7, 0x1701,
- 0x6EB8, 0x6EB9, 0x39ED, 0x6EBA, 0x6EBA, 0x0B4A, 0x6EBB, 0x6EBB, 0x1700,
- 0x6EBC, 0x6EBC, 0x39EF, 0x6EBD, 0x6EBD, 0x16FF, 0x6EBE, 0x6EC0, 0x39F0,
- 0x6EC1, 0x6EC1, 0x0521, 0x6EC2, 0x6EC2, 0x1706, 0x6EC3, 0x6EC3, 0x39F3,
- 0x6EC4, 0x6EC4, 0x1E63, 0x6EC5, 0x6EC5, 0x2088, 0x6EC6, 0x6EC6, 0x39F4,
- 0x6EC7, 0x6EC7, 0x05C2, 0x6EC8, 0x6ECA, 0x39F5, 0x6ECB, 0x6ECB, 0x1229,
- 0x6ECC, 0x6ECC, 0x1EBD, 0x6ECD, 0x6ECD, 0x39F8, 0x6ECE, 0x6ECE, 0x2341,
- 0x6ECF, 0x6ECF, 0x1704, 0x6ED0, 0x6ED0, 0x39F9, 0x6ED1, 0x6ED1, 0x07C1,
- 0x6ED2, 0x6ED2, 0x39FA, 0x6ED3, 0x6ED3, 0x122F, 0x6ED4, 0x6ED4, 0x0E22,
- 0x6ED5, 0x6ED5, 0x19A8, 0x6ED6, 0x6ED6, 0x39FB, 0x6ED7, 0x6ED7, 0x1702,
- 0x6ED8, 0x6ED9, 0x39FC, 0x6EDA, 0x6EDA, 0x074F, 0x6EDB, 0x6EDD, 0x39FE,
- 0x6EDE, 0x6EDE, 0x11CC, 0x6EDF, 0x6EDF, 0x16F7, 0x6EE0, 0x6EE0, 0x16FA,
- 0x6EE1, 0x6EE1, 0x0AA1, 0x6EE2, 0x6EE2, 0x16FC, 0x6EE3, 0x6EE3, 0x3A01,
- 0x6EE4, 0x6EE4, 0x0A72, 0x6EE5, 0x6EE5, 0x09AF, 0x6EE6, 0x6EE6, 0x0A77,
- 0x6EE7, 0x6EE7, 0x3A02, 0x6EE8, 0x6EE8, 0x045E, 0x6EE9, 0x6EE9, 0x0E05,
- 0x6EEA, 0x6EEB, 0x3A03, 0x6EEC, 0x6EEC, 0x1F4B, 0x6EED, 0x6EEE, 0x3A05,
- 0x6EEF, 0x6EEF, 0x2292, 0x6EF0, 0x6EF1, 0x3A07, 0x6EF2, 0x6EF2, 0x2124,
- 0x6EF3, 0x6EF3, 0x3A09, 0x6EF4, 0x6EF4, 0x05AF, 0x6EF5, 0x6EF6, 0x3A0A,
- 0x6EF7, 0x6EF7, 0x2048, 0x6EF8, 0x6EF8, 0x23E0, 0x6EF9, 0x6EF9, 0x170D,
- 0x6EFA, 0x6EFE, 0x3A0C, 0x6EFF, 0x6EFF, 0x2077, 0x6F00, 0x6F00, 0x3A11,
- 0x6F01, 0x6F01, 0x223A, 0x6F02, 0x6F02, 0x0BCE, 0x6F03, 0x6F05, 0x3A12,
- 0x6F06, 0x6F06, 0x0C00, 0x6F07, 0x6F08, 0x3A15, 0x6F09, 0x6F09, 0x1713,
- 0x6F0A, 0x6F0E, 0x3A17, 0x6F0F, 0x6F0F, 0x0A50, 0x6F10, 0x6F12, 0x3A1C,
- 0x6F13, 0x6F13, 0x09D7, 0x6F14, 0x6F14, 0x1006, 0x6F15, 0x6F15, 0x170C,
- 0x6F16, 0x6F19, 0x3A1F, 0x6F1A, 0x6F1A, 0x20B1, 0x6F1B, 0x6F1F, 0x3A23,
- 0x6F20, 0x6F20, 0x0B11, 0x6F21, 0x6F21, 0x3A28, 0x6F22, 0x6F22, 0x1F41,
- 0x6F23, 0x6F23, 0x201C, 0x6F24, 0x6F24, 0x170B, 0x6F25, 0x6F28, 0x3A29,
- 0x6F29, 0x6F29, 0x1714, 0x6F2A, 0x6F2A, 0x1712, 0x6F2B, 0x6F2B, 0x0AA5,
- 0x6F2C, 0x6F2C, 0x22B8, 0x6F2D, 0x6F2D, 0x16FB, 0x6F2E, 0x6F2E, 0x3A2D,
- 0x6F2F, 0x6F2F, 0x170E, 0x6F30, 0x6F30, 0x3A2E, 0x6F31, 0x6F31, 0x0D95,
- 0x6F32, 0x6F32, 0x2276, 0x6F33, 0x6F33, 0x1165, 0x6F34, 0x6F35, 0x3A2F,
- 0x6F36, 0x6F36, 0x170F, 0x6F37, 0x6F37, 0x3A31, 0x6F38, 0x6F38, 0x1F9B,
- 0x6F39, 0x6F3D, 0x3A32, 0x6F3E, 0x6F3E, 0x1023, 0x6F3F, 0x6F3F, 0x1F9F,
- 0x6F40, 0x6F40, 0x3A37, 0x6F41, 0x6F41, 0x25CA, 0x6F42, 0x6F45, 0x3A38,
- 0x6F46, 0x6F47, 0x1709, 0x6F48, 0x6F4A, 0x3A3C, 0x6F4B, 0x6F4B, 0x1710,
- 0x6F4C, 0x6F4C, 0x3A3F, 0x6F4D, 0x6F4D, 0x0EBA, 0x6F4E, 0x6F50, 0x3A40,
- 0x6F51, 0x6F51, 0x20BE, 0x6F52, 0x6F53, 0x3A43, 0x6F54, 0x6F54, 0x1FB4,
- 0x6F55, 0x6F57, 0x3A45, 0x6F58, 0x6F58, 0x0B8C, 0x6F59, 0x6F59, 0x23D7,
- 0x6F5A, 0x6F5B, 0x3A48, 0x6F5C, 0x6F5C, 0x0C2E, 0x6F5D, 0x6F5D, 0x3A4A,
- 0x6F5E, 0x6F5E, 0x0A61, 0x6F5F, 0x6F61, 0x3A4B, 0x6F62, 0x6F62, 0x1708,
- 0x6F63, 0x6F63, 0x3A4E, 0x6F64, 0x6F64, 0x2105, 0x6F65, 0x6F65, 0x3A4F,
- 0x6F66, 0x6F66, 0x0A13, 0x6F67, 0x6F6C, 0x3A50, 0x6F6D, 0x6F6D, 0x0E09,
- 0x6F6E, 0x6F6E, 0x04D6, 0x6F6F, 0x6F6F, 0x23E1, 0x6F70, 0x6F70, 0x1FEC,
- 0x6F71, 0x6F71, 0x3A56, 0x6F72, 0x6F72, 0x1719, 0x6F73, 0x6F73, 0x3A57,
- 0x6F74, 0x6F74, 0x1711, 0x6F75, 0x6F76, 0x3A58, 0x6F77, 0x6F77, 0x23EA,
- 0x6F78, 0x6F78, 0x1718, 0x6F79, 0x6F79, 0x3A5A, 0x6F7A, 0x6F7A, 0x171B,
- 0x6F7B, 0x6F7B, 0x3A5B, 0x6F7C, 0x6F7C, 0x171A, 0x6F7D, 0x6F7E, 0x3A5C,
- 0x6F7F, 0x6F7F, 0x23E3, 0x6F80, 0x6F80, 0x210E, 0x6F81, 0x6F83, 0x3A5E,
- 0x6F84, 0x6F84, 0x04F3, 0x6F85, 0x6F85, 0x3A61, 0x6F86, 0x6F86, 0x1FA6,
- 0x6F87, 0x6F87, 0x2004, 0x6F88, 0x6F88, 0x04DF, 0x6F89, 0x6F89, 0x1715,
- 0x6F8A, 0x6F8B, 0x3A62, 0x6F8C, 0x6F8C, 0x1717, 0x6F8D, 0x6F8D, 0x1716,
- 0x6F8E, 0x6F8E, 0x0BAD, 0x6F8F, 0x6F96, 0x3A64, 0x6F97, 0x6F97, 0x1F9D,
- 0x6F98, 0x6F9B, 0x3A6C, 0x6F9C, 0x6F9C, 0x09A8, 0x6F9D, 0x6F9F, 0x3A70,
- 0x6FA0, 0x6FA0, 0x23E5, 0x6FA1, 0x6FA1, 0x112B, 0x6FA2, 0x6FA3, 0x3A73,
- 0x6FA4, 0x6FA4, 0x2264, 0x6FA5, 0x6FA6, 0x3A75, 0x6FA7, 0x6FA7, 0x171E,
- 0x6FA8, 0x6FA8, 0x3A77, 0x6FA9, 0x6FA9, 0x24E2, 0x6FAA, 0x6FAD, 0x3A78,
- 0x6FAE, 0x6FAE, 0x23DE, 0x6FAF, 0x6FB0, 0x3A7C, 0x6FB1, 0x6FB1, 0x1EC4,
- 0x6FB2, 0x6FB2, 0x3A7E, 0x6FB3, 0x6FB3, 0x03CF, 0x6FB4, 0x6FB5, 0x3A7F,
- 0x6FB6, 0x6FB6, 0x1720, 0x6FB7, 0x6FB8, 0x3A81, 0x6FB9, 0x6FB9, 0x171F,
- 0x6FBA, 0x6FBF, 0x3A83, 0x6FC0, 0x6FC0, 0x0817, 0x6FC1, 0x6FC1, 0x22B6,
- 0x6FC2, 0x6FC2, 0x1721, 0x6FC3, 0x6FC3, 0x20A9, 0x6FC4, 0x6FC8, 0x3A89,
- 0x6FC9, 0x6FC9, 0x171D, 0x6FCA, 0x6FD0, 0x3A8E, 0x6FD1, 0x6FD1, 0x171C,
- 0x6FD2, 0x6FD2, 0x045D, 0x6FD3, 0x6FD4, 0x3A95, 0x6FD5, 0x6FD5, 0x212B,
- 0x6FD6, 0x6FD7, 0x3A97, 0x6FD8, 0x6FD8, 0x20A5, 0x6FD9, 0x6FDA, 0x3A99,
- 0x6FDB, 0x6FDB, 0x268B, 0x6FDC, 0x6FDD, 0x3A9B, 0x6FDE, 0x6FDE, 0x1724,
- 0x6FDF, 0x6FDF, 0x1F76, 0x6FE0, 0x6FE0, 0x1725, 0x6FE1, 0x6FE1, 0x1722,
- 0x6FE2, 0x6FE3, 0x3A9D, 0x6FE4, 0x6FE4, 0x216D, 0x6FE5, 0x6FEA, 0x3A9F,
- 0x6FEB, 0x6FEB, 0x2001, 0x6FEC, 0x6FED, 0x3AA5, 0x6FEE, 0x6FEE, 0x1723,
- 0x6FEF, 0x6FEF, 0x1726, 0x6FF0, 0x6FF0, 0x2191, 0x6FF1, 0x6FF1, 0x1E50,
- 0x6FF2, 0x6FF9, 0x3AA7, 0x6FFA, 0x6FFA, 0x1F9C, 0x6FFB, 0x6FFB, 0x3AAF,
- 0x6FFC, 0x6FFC, 0x23DA, 0x6FFD, 0x6FFD, 0x3AB0, 0x6FFE, 0x6FFE, 0x2053,
- 0x6FFF, 0x6FFF, 0x3AB1, 0x7000, 0x7004, 0x3AB2, 0x7005, 0x7005, 0x23E9,
- 0x7006, 0x7006, 0x23E4, 0x7007, 0x7008, 0x3AB7, 0x7009, 0x7009, 0x21D5,
- 0x700A, 0x700A, 0x3AB9, 0x700B, 0x700B, 0x23E6, 0x700C, 0x700E, 0x3ABA,
- 0x700F, 0x700F, 0x23DF, 0x7010, 0x7010, 0x3ABD, 0x7011, 0x7011, 0x0BF8,
- 0x7012, 0x7014, 0x3ABE, 0x7015, 0x7015, 0x1E4F, 0x7016, 0x7017, 0x3AC1,
- 0x7018, 0x7018, 0x23D9, 0x7019, 0x7019, 0x3AC3, 0x701A, 0x701A, 0x1727,
- 0x701B, 0x701B, 0x1729, 0x701C, 0x701C, 0x3AC4, 0x701D, 0x701D, 0x2014,
- 0x701E, 0x701E, 0x3AC5, 0x701F, 0x701F, 0x23EC, 0x7020, 0x7020, 0x23EB,
- 0x7021, 0x7022, 0x3AC6, 0x7023, 0x7023, 0x1728, 0x7024, 0x7026, 0x3AC8,
- 0x7027, 0x7027, 0x23D8, 0x7028, 0x7028, 0x23EE, 0x7029, 0x702F, 0x3ACB,
- 0x7030, 0x7030, 0x268E, 0x7031, 0x7031, 0x3AD2, 0x7032, 0x7032, 0x23ED,
- 0x7033, 0x7034, 0x3AD3, 0x7035, 0x7035, 0x172B, 0x7036, 0x7038, 0x3AD5,
- 0x7039, 0x7039, 0x172A, 0x703A, 0x703D, 0x3AD8, 0x703E, 0x703E, 0x1FFA,
- 0x703F, 0x7042, 0x3ADC, 0x7043, 0x7043, 0x23D6, 0x7044, 0x7044, 0x23E8,
- 0x7045, 0x704B, 0x3AE0, 0x704C, 0x704C, 0x0739, 0x704D, 0x704E, 0x3AE7,
- 0x704F, 0x704F, 0x172C, 0x7050, 0x7050, 0x3AE9, 0x7051, 0x7051, 0x2106,
- 0x7052, 0x7054, 0x3AEA, 0x7055, 0x7055, 0x200B, 0x7056, 0x7057, 0x3AED,
- 0x7058, 0x7058, 0x2166, 0x7059, 0x705C, 0x3AEF, 0x705D, 0x705D, 0x23EF,
- 0x705E, 0x705E, 0x172D, 0x705F, 0x7062, 0x3AF3, 0x7063, 0x7063, 0x2189,
- 0x7064, 0x7064, 0x2058, 0x7065, 0x7066, 0x3AF7, 0x7067, 0x7067, 0x23E7,
- 0x7068, 0x706A, 0x3AF9, 0x706B, 0x706B, 0x0805, 0x706C, 0x706C, 0x19EF,
- 0x706D, 0x706D, 0x0AF5, 0x706E, 0x706E, 0x3AFC, 0x706F, 0x706F, 0x05A7,
- 0x7070, 0x7070, 0x07E7, 0x7071, 0x7074, 0x3AFD, 0x7075, 0x7075, 0x0A32,
- 0x7076, 0x7076, 0x1131, 0x7077, 0x7077, 0x3B01, 0x7078, 0x7078, 0x08F3,
- 0x7079, 0x707B, 0x3B02, 0x707C, 0x707C, 0x1223, 0x707D, 0x707D, 0x3B05,
- 0x707E, 0x707E, 0x1119, 0x707F, 0x707F, 0x049A, 0x7080, 0x7080, 0x19CC,
- 0x7081, 0x7084, 0x3B06, 0x7085, 0x7085, 0x1913, 0x7086, 0x7088, 0x3B0A,
- 0x7089, 0x7089, 0x0A56, 0x708A, 0x708A, 0x0539, 0x708B, 0x708D, 0x3B0D,
- 0x708E, 0x708E, 0x1000, 0x708F, 0x7091, 0x3B10, 0x7092, 0x7092, 0x04D9,
- 0x7093, 0x7093, 0x3B13, 0x7094, 0x7094, 0x0C8D, 0x7095, 0x7095, 0x0948,
- 0x7096, 0x7096, 0x19CE, 0x7097, 0x7098, 0x3B14, 0x7099, 0x7099, 0x11CA,
- 0x709A, 0x709B, 0x3B16, 0x709C, 0x709C, 0x19CD, 0x709D, 0x709D, 0x19CF,
- 0x709E, 0x70AA, 0x3B18, 0x70AB, 0x70AB, 0x19D3, 0x70AC, 0x70AC, 0x0915,
- 0x70AD, 0x70AD, 0x0E12, 0x70AE, 0x70AE, 0x0B9B, 0x70AF, 0x70AF, 0x08EB,
- 0x70B0, 0x70B0, 0x3B25, 0x70B1, 0x70B1, 0x19D4, 0x70B2, 0x70B2, 0x3B26,
- 0x70B3, 0x70B3, 0x0467, 0x70B4, 0x70B6, 0x3B27, 0x70B7, 0x70B7, 0x19D2,
- 0x70B8, 0x70B8, 0x1149, 0x70B9, 0x70B9, 0x05C4, 0x70BA, 0x70BA, 0x3B2A,
- 0x70BB, 0x70BB, 0x19D0, 0x70BC, 0x70BC, 0x09FF, 0x70BD, 0x70BD, 0x0508,
- 0x70BE, 0x70BF, 0x3B2B, 0x70C0, 0x70C0, 0x19D1, 0x70C1, 0x70C1, 0x0DAD,
- 0x70C2, 0x70C2, 0x09AE, 0x70C3, 0x70C3, 0x0E51, 0x70C4, 0x70C7, 0x3B2D,
- 0x70C8, 0x70C8, 0x0A1B, 0x70C9, 0x70C9, 0x3B31, 0x70CA, 0x70CA, 0x19D6,
- 0x70CB, 0x70CE, 0x3B32, 0x70CF, 0x70CF, 0x21A3, 0x70D0, 0x70D7, 0x3B36,
- 0x70D8, 0x70D8, 0x079D, 0x70D9, 0x70D9, 0x09BE, 0x70DA, 0x70DA, 0x3B3E,
- 0x70DB, 0x70DB, 0x11F1, 0x70DC, 0x70DE, 0x3B3F, 0x70DF, 0x70DF, 0x0FF5,
- 0x70E0, 0x70E3, 0x3B42, 0x70E4, 0x70E4, 0x094B, 0x70E5, 0x70E5, 0x3B46,
- 0x70E6, 0x70E6, 0x0650, 0x70E7, 0x70E7, 0x0D0E, 0x70E8, 0x70E8, 0x19D5,
- 0x70E9, 0x70E9, 0x07F7, 0x70EA, 0x70EA, 0x3B47, 0x70EB, 0x70EB, 0x0E1F,
- 0x70EC, 0x70EC, 0x08CE, 0x70ED, 0x70ED, 0x0CA3, 0x70EE, 0x70EE, 0x3B48,
- 0x70EF, 0x70EF, 0x0F16, 0x70F0, 0x70F3, 0x3B49, 0x70F4, 0x70F4, 0x217A,
- 0x70F5, 0x70F6, 0x3B4D, 0x70F7, 0x70F7, 0x0E9A, 0x70F8, 0x70F8, 0x3B4F,
- 0x70F9, 0x70F9, 0x0BAC, 0x70FA, 0x70FC, 0x3B50, 0x70FD, 0x70FD, 0x0686,
- 0x70FE, 0x70FF, 0x3B53, 0x7100, 0x7108, 0x3B55, 0x7109, 0x7109, 0x0FF2,
- 0x710A, 0x710A, 0x076F, 0x710B, 0x710F, 0x3B5E, 0x7110, 0x7110, 0x19D7,
- 0x7111, 0x7112, 0x3B63, 0x7113, 0x7113, 0x19D8, 0x7114, 0x7114, 0x3B65,
- 0x7115, 0x7115, 0x07D5, 0x7116, 0x7116, 0x19D9, 0x7117, 0x7117, 0x3B66,
- 0x7118, 0x7118, 0x19F0, 0x7119, 0x7119, 0x0423, 0x711A, 0x711A, 0x0676,
- 0x711B, 0x7120, 0x3B67, 0x7121, 0x7121, 0x21A5, 0x7122, 0x7125, 0x3B6D,
- 0x7126, 0x7126, 0x088A, 0x7127, 0x712E, 0x3B71, 0x712F, 0x712F, 0x19DA,
- 0x7130, 0x7130, 0x100F, 0x7131, 0x7131, 0x19DB, 0x7132, 0x7135, 0x3B79,
- 0x7136, 0x7136, 0x0C96, 0x7137, 0x7144, 0x3B7D, 0x7145, 0x7145, 0x19DF,
- 0x7146, 0x7148, 0x3B8B, 0x7149, 0x7149, 0x2022, 0x714A, 0x714A, 0x19E1,
- 0x714B, 0x714B, 0x3B8E, 0x714C, 0x714C, 0x07E2, 0x714D, 0x714D, 0x3B8F,
- 0x714E, 0x714E, 0x0858, 0x714F, 0x7151, 0x3B90, 0x7152, 0x7152, 0x24D6,
- 0x7153, 0x715B, 0x3B93, 0x715C, 0x715C, 0x19DD, 0x715D, 0x715D, 0x3B9C,
- 0x715E, 0x715E, 0x0CF0, 0x715F, 0x7161, 0x3B9D, 0x7162, 0x7162, 0x233A,
- 0x7163, 0x7163, 0x3BA0, 0x7164, 0x7164, 0x0ABF, 0x7165, 0x7165, 0x3BA1,
- 0x7166, 0x7166, 0x19F1, 0x7167, 0x7167, 0x1176, 0x7168, 0x7168, 0x19DE,
- 0x7169, 0x7169, 0x1EEE, 0x716A, 0x716B, 0x3BA2, 0x716C, 0x716C, 0x24D5,
- 0x716D, 0x716D, 0x3BA4, 0x716E, 0x716E, 0x11F2, 0x716F, 0x7171, 0x3BA5,
- 0x7172, 0x7172, 0x19E0, 0x7173, 0x7173, 0x19DC, 0x7174, 0x7177, 0x3BA8,
- 0x7178, 0x7178, 0x19E2, 0x7179, 0x7179, 0x3BAC, 0x717A, 0x717A, 0x19E3,
- 0x717B, 0x717C, 0x3BAD, 0x717D, 0x717D, 0x0CF8, 0x717E, 0x7183, 0x3BAF,
- 0x7184, 0x7184, 0x0F15, 0x7185, 0x7189, 0x3BB5, 0x718A, 0x718A, 0x0FA7,
- 0x718B, 0x718E, 0x3BBA, 0x718F, 0x718F, 0x0FD5, 0x7190, 0x7191, 0x3BBE,
- 0x7192, 0x7192, 0x2228, 0x7193, 0x7193, 0x3BC0, 0x7194, 0x7194, 0x0CB6,
- 0x7195, 0x7196, 0x3BC1, 0x7197, 0x7197, 0x24D7, 0x7198, 0x7198, 0x19E4,
- 0x7199, 0x7199, 0x0F04, 0x719A, 0x719E, 0x3BC3, 0x719F, 0x719F, 0x0D83,
- 0x71A0, 0x71A0, 0x19E8, 0x71A1, 0x71A7, 0x3BC8, 0x71A8, 0x71A8, 0x19E7,
- 0x71A9, 0x71AB, 0x3BCF, 0x71AC, 0x71AC, 0x03C9, 0x71AD, 0x71B0, 0x3BD2,
- 0x71B1, 0x71B1, 0x20FC, 0x71B2, 0x71B2, 0x3BD6, 0x71B3, 0x71B3, 0x19E5,
- 0x71B4, 0x71B4, 0x3BD7, 0x71B5, 0x71B5, 0x19E6, 0x71B6, 0x71B8, 0x3BD8,
- 0x71B9, 0x71B9, 0x19F2, 0x71BA, 0x71BD, 0x3BDB, 0x71BE, 0x71BE, 0x1E87,
- 0x71BF, 0x71C0, 0x3BDF, 0x71C1, 0x71C1, 0x24D8, 0x71C2, 0x71C2, 0x3BE1,
- 0x71C3, 0x71C3, 0x0C97, 0x71C4, 0x71C7, 0x3BE2, 0x71C8, 0x71C8, 0x1EBA,
- 0x71C9, 0x71CD, 0x3BE6, 0x71CE, 0x71CE, 0x0A10, 0x71CF, 0x71D1, 0x3BEB,
- 0x71D2, 0x71D2, 0x2119, 0x71D3, 0x71D3, 0x3BEE, 0x71D4, 0x71D4, 0x19EA,
- 0x71D5, 0x71D5, 0x1009, 0x71D6, 0x71D8, 0x3BEF, 0x71D9, 0x71D9, 0x216C,
- 0x71DA, 0x71DB, 0x3BF2, 0x71DC, 0x71DC, 0x24D9, 0x71DD, 0x71DE, 0x3BF4,
- 0x71DF, 0x71DF, 0x2227, 0x71E0, 0x71E0, 0x19E9, 0x71E1, 0x71E4, 0x3BF6,
- 0x71E5, 0x71E5, 0x1132, 0x71E6, 0x71E6, 0x1E5F, 0x71E7, 0x71E7, 0x19EB,
- 0x71E8, 0x71EC, 0x3BFA, 0x71ED, 0x71ED, 0x229F, 0x71EE, 0x71EE, 0x1396,
- 0x71EF, 0x71F3, 0x3BFF, 0x71F4, 0x71F4, 0x1F5D, 0x71F5, 0x71F8, 0x3C04,
- 0x71F9, 0x71F9, 0x19EC, 0x71FA, 0x71FB, 0x3C08, 0x71FC, 0x71FC, 0x1FBC,
- 0x71FD, 0x71FD, 0x3C0A, 0x71FE, 0x71FE, 0x24DA, 0x71FF, 0x71FF, 0x3C0B,
- 0x7200, 0x7205, 0x3C0C, 0x7206, 0x7206, 0x0415, 0x7207, 0x720C, 0x3C12,
- 0x720D, 0x720D, 0x2149, 0x720E, 0x720F, 0x3C18, 0x7210, 0x7210, 0x2046,
- 0x7211, 0x721A, 0x3C1A, 0x721B, 0x721B, 0x2000, 0x721C, 0x721C, 0x3C24,
- 0x721D, 0x721D, 0x19ED, 0x721E, 0x7227, 0x3C25, 0x7228, 0x7228, 0x19EE,
- 0x7229, 0x7229, 0x3C2F, 0x722A, 0x722A, 0x1203, 0x722B, 0x722B, 0x3C30,
- 0x722C, 0x722C, 0x0B81, 0x722D, 0x722F, 0x3C31, 0x7230, 0x7230, 0x196C,
- 0x7231, 0x7231, 0x03B9, 0x7232, 0x7232, 0x2190, 0x7233, 0x7234, 0x3C34,
- 0x7235, 0x7235, 0x0923, 0x7236, 0x7236, 0x06B3, 0x7237, 0x7237, 0x1036,
- 0x7238, 0x7238, 0x03E1, 0x7239, 0x7239, 0x05DA, 0x723A, 0x723A, 0x2208,
- 0x723B, 0x723B, 0x1269, 0x723C, 0x723C, 0x3C36, 0x723D, 0x723D, 0x0DA1,
- 0x723E, 0x723E, 0x1EE6, 0x723F, 0x723F, 0x169D, 0x7240, 0x7246, 0x3C37,
- 0x7247, 0x7247, 0x0BCB, 0x7248, 0x7248, 0x03F1, 0x7249, 0x724B, 0x3C3E,
- 0x724C, 0x724C, 0x0B87, 0x724D, 0x724D, 0x1969, 0x724E, 0x7251, 0x3C41,
- 0x7252, 0x7252, 0x196A, 0x7253, 0x7255, 0x3C45, 0x7256, 0x7256, 0x196B,
- 0x7257, 0x7257, 0x3C48, 0x7258, 0x7258, 0x24C3, 0x7259, 0x7259, 0x0FE9,
- 0x725A, 0x725A, 0x3C49, 0x725B, 0x725B, 0x0B64, 0x725C, 0x725C, 0x3C4A,
- 0x725D, 0x725D, 0x1944, 0x725E, 0x725E, 0x3C4B, 0x725F, 0x725F, 0x0B15,
- 0x7260, 0x7260, 0x3C4C, 0x7261, 0x7261, 0x0B18, 0x7262, 0x7262, 0x09B9,
- 0x7263, 0x7265, 0x3C4D, 0x7266, 0x7266, 0x1945, 0x7267, 0x7267, 0x0B24,
- 0x7268, 0x7268, 0x3C50, 0x7269, 0x7269, 0x0EFE, 0x726A, 0x726D, 0x3C51,
- 0x726E, 0x726E, 0x1942, 0x726F, 0x726F, 0x1946, 0x7270, 0x7271, 0x3C55,
- 0x7272, 0x7272, 0x0D35, 0x7273, 0x7274, 0x3C57, 0x7275, 0x7275, 0x0C20,
- 0x7276, 0x7278, 0x3C59, 0x7279, 0x7279, 0x0E2B, 0x727A, 0x727A, 0x0F0D,
- 0x727B, 0x727C, 0x3C5C, 0x727D, 0x727D, 0x20CC, 0x727E, 0x727F, 0x1947,
- 0x7280, 0x7280, 0x0F19, 0x7281, 0x7281, 0x09D2, 0x7282, 0x7283, 0x3C5E,
- 0x7284, 0x7284, 0x1949, 0x7285, 0x7289, 0x3C60, 0x728A, 0x728A, 0x05FE,
- 0x728B, 0x728B, 0x194A, 0x728C, 0x728C, 0x3C65, 0x728D, 0x728D, 0x194B,
- 0x728E, 0x728E, 0x3C66, 0x728F, 0x728F, 0x194C, 0x7290, 0x7291, 0x3C67,
- 0x7292, 0x7292, 0x194D, 0x7293, 0x7295, 0x3C69, 0x7296, 0x7296, 0x2340,
- 0x7297, 0x729E, 0x3C6C, 0x729F, 0x729F, 0x1943, 0x72A0, 0x72A1, 0x3C74,
- 0x72A2, 0x72A2, 0x1ED1, 0x72A3, 0x72A6, 0x3C76, 0x72A7, 0x72A7, 0x21AC,
- 0x72A8, 0x72AB, 0x3C7A, 0x72AC, 0x72AC, 0x0C89, 0x72AD, 0x72AD, 0x15EF,
- 0x72AE, 0x72AE, 0x3C7E, 0x72AF, 0x72AF, 0x0655, 0x72B0, 0x72B0, 0x15F0,
- 0x72B1, 0x72B3, 0x3C7F, 0x72B4, 0x72B4, 0x15F1, 0x72B5, 0x72B5, 0x3C82,
- 0x72B6, 0x72B6, 0x1211, 0x72B7, 0x72B8, 0x15F2, 0x72B9, 0x72B9, 0x10B1,
- 0x72BA, 0x72BF, 0x3C83, 0x72C0, 0x72C0, 0x22AF, 0x72C1, 0x72C1, 0x15F5,
- 0x72C2, 0x72C2, 0x097E, 0x72C3, 0x72C3, 0x15F4, 0x72C4, 0x72C4, 0x05B3,
- 0x72C5, 0x72C7, 0x3C89, 0x72C8, 0x72C8, 0x0420, 0x72C9, 0x72CC, 0x3C8C,
- 0x72CD, 0x72CD, 0x15F7, 0x72CE, 0x72CE, 0x15F6, 0x72CF, 0x72CF, 0x3C90,
- 0x72D0, 0x72D0, 0x07B3, 0x72D1, 0x72D1, 0x3C91, 0x72D2, 0x72D2, 0x15F8,
- 0x72D3, 0x72D6, 0x3C92, 0x72D7, 0x72D7, 0x0710, 0x72D8, 0x72D8, 0x3C96,
- 0x72D9, 0x72D9, 0x0900, 0x72DA, 0x72DD, 0x3C97, 0x72DE, 0x72DE, 0x0B5F,
- 0x72DF, 0x72DF, 0x3C9B, 0x72E0, 0x72E0, 0x0794, 0x72E1, 0x72E1, 0x0897,
- 0x72E2, 0x72E7, 0x3C9C, 0x72E8, 0x72E8, 0x15F9, 0x72E9, 0x72E9, 0x15FB,
- 0x72EA, 0x72EB, 0x3CA2, 0x72EC, 0x72EC, 0x05FF, 0x72ED, 0x72ED, 0x0F2E,
- 0x72EE, 0x72EE, 0x0D3F, 0x72EF, 0x72EF, 0x15FA, 0x72F0, 0x72F0, 0x1199,
- 0x72F1, 0x72F1, 0x10E1, 0x72F2, 0x72F2, 0x15FC, 0x72F3, 0x72F3, 0x1600,
- 0x72F4, 0x72F4, 0x15FD, 0x72F5, 0x72F6, 0x3CA4, 0x72F7, 0x72F7, 0x15FE,
- 0x72F8, 0x72F8, 0x09D5, 0x72F9, 0x72F9, 0x21B6, 0x72FA, 0x72FB, 0x1602,
- 0x72FC, 0x72FC, 0x09B2, 0x72FD, 0x72FD, 0x1E3D, 0x72FE, 0x72FF, 0x3CA6,
- 0x7300, 0x7300, 0x3CA8, 0x7301, 0x7301, 0x15FF, 0x7302, 0x7302, 0x3CA9,
- 0x7303, 0x7303, 0x1601, 0x7304, 0x7309, 0x3CAA, 0x730A, 0x730A, 0x1607,
- 0x730B, 0x730D, 0x3CB0, 0x730E, 0x730E, 0x0A1D, 0x730F, 0x7312, 0x3CB3,
- 0x7313, 0x7313, 0x1605, 0x7314, 0x7314, 0x3CB7, 0x7315, 0x7315, 0x160A,
- 0x7316, 0x7316, 0x04C5, 0x7317, 0x7317, 0x1604, 0x7318, 0x731A, 0x3CB8,
- 0x731B, 0x731B, 0x0AD2, 0x731C, 0x731C, 0x0489, 0x731D, 0x731D, 0x1609,
- 0x731E, 0x731E, 0x1608, 0x731F, 0x7320, 0x3CBB, 0x7321, 0x7321, 0x1606,
- 0x7322, 0x7322, 0x160B, 0x7323, 0x7324, 0x3CBD, 0x7325, 0x7325, 0x160D,
- 0x7326, 0x7328, 0x3CBF, 0x7329, 0x7329, 0x0F94, 0x732A, 0x732A, 0x11EC,
- 0x732B, 0x732B, 0x0AAD, 0x732C, 0x732C, 0x160E, 0x732D, 0x732D, 0x3CC2,
- 0x732E, 0x732E, 0x0F44, 0x732F, 0x7330, 0x3CC3, 0x7331, 0x7331, 0x1610,
- 0x7332, 0x7333, 0x3CC5, 0x7334, 0x7334, 0x07A6, 0x7335, 0x7335, 0x3CC7,
- 0x7336, 0x7336, 0x2235, 0x7337, 0x7337, 0x18D4, 0x7338, 0x7338, 0x160F,
- 0x7339, 0x7339, 0x160C, 0x733A, 0x733A, 0x3CC8, 0x733B, 0x733B, 0x2397,
- 0x733C, 0x733D, 0x3CC9, 0x733E, 0x733E, 0x07C0, 0x733F, 0x733F, 0x10F6,
- 0x7340, 0x7340, 0x3CCB, 0x7341, 0x7341, 0x2395, 0x7342, 0x7343, 0x3CCC,
- 0x7344, 0x7344, 0x223F, 0x7345, 0x7345, 0x212A, 0x7346, 0x734C, 0x3CCE,
- 0x734D, 0x734D, 0x1612, 0x734E, 0x734F, 0x3CD5, 0x7350, 0x7350, 0x1611,
- 0x7351, 0x7351, 0x3CD7, 0x7352, 0x7352, 0x18D5, 0x7353, 0x7356, 0x3CD8,
- 0x7357, 0x7357, 0x1613, 0x7358, 0x735F, 0x3CDC, 0x7360, 0x7360, 0x1614,
- 0x7361, 0x7367, 0x3CE4, 0x7368, 0x7368, 0x1ED2, 0x7369, 0x7369, 0x3CEB,
- 0x736A, 0x736A, 0x2396, 0x736B, 0x736B, 0x2398, 0x736C, 0x736C, 0x1615,
- 0x736D, 0x736D, 0x0DF4, 0x736E, 0x736E, 0x3CEC, 0x736F, 0x736F, 0x1616,
- 0x7370, 0x7370, 0x20A2, 0x7371, 0x7371, 0x3CED, 0x7372, 0x7372, 0x1F64,
- 0x7373, 0x7374, 0x3CEE, 0x7375, 0x7375, 0x202B, 0x7376, 0x7376, 0x3CF0,
- 0x7377, 0x7377, 0x2394, 0x7378, 0x7378, 0x2139, 0x7379, 0x7379, 0x3CF1,
- 0x737A, 0x737A, 0x215F, 0x737B, 0x737B, 0x21C1, 0x737C, 0x737C, 0x239A,
- 0x737D, 0x737D, 0x3CF2, 0x737E, 0x737E, 0x1617, 0x737F, 0x737F, 0x3CF3,
- 0x7380, 0x7380, 0x2399, 0x7381, 0x7383, 0x3CF4, 0x7384, 0x7384, 0x0FC9,
- 0x7385, 0x7386, 0x3CF7, 0x7387, 0x7387, 0x0A71, 0x7388, 0x7388, 0x3CF9,
- 0x7389, 0x7389, 0x10D6, 0x738A, 0x738A, 0x3CFA, 0x738B, 0x738B, 0x0EA6,
- 0x738C, 0x738D, 0x3CFB, 0x738E, 0x738E, 0x1818, 0x738F, 0x7390, 0x3CFD,
- 0x7391, 0x7391, 0x1819, 0x7392, 0x7395, 0x3CFF, 0x7396, 0x7396, 0x08F0,
- 0x7397, 0x739A, 0x3D03, 0x739B, 0x739B, 0x0A91, 0x739C, 0x739E, 0x3D07,
- 0x739F, 0x739F, 0x181C, 0x73A0, 0x73A1, 0x3D0A, 0x73A2, 0x73A2, 0x181B,
- 0x73A3, 0x73A8, 0x3D0C, 0x73A9, 0x73A9, 0x0E97, 0x73AA, 0x73AA, 0x3D12,
- 0x73AB, 0x73AB, 0x0ABA, 0x73AC, 0x73AD, 0x3D13, 0x73AE, 0x73AE, 0x181A,
- 0x73AF, 0x73AF, 0x07CC, 0x73B0, 0x73B0, 0x0F43, 0x73B1, 0x73B1, 0x3D15,
- 0x73B2, 0x73B2, 0x0A2A, 0x73B3, 0x73B3, 0x1821, 0x73B4, 0x73B6, 0x3D16,
- 0x73B7, 0x73B7, 0x1820, 0x73B8, 0x73B9, 0x3D19, 0x73BA, 0x73BA, 0x182C,
- 0x73BB, 0x73BB, 0x046A, 0x73BC, 0x73BF, 0x3D1B, 0x73C0, 0x73C0, 0x1822,
- 0x73C1, 0x73C1, 0x3D1F, 0x73C2, 0x73C2, 0x181E, 0x73C3, 0x73C7, 0x3D20,
- 0x73C8, 0x73C8, 0x1824, 0x73C9, 0x73C9, 0x1823, 0x73CA, 0x73CA, 0x0CF3,
- 0x73CB, 0x73CC, 0x3D25, 0x73CD, 0x73CD, 0x1185, 0x73CE, 0x73CE, 0x3D27,
- 0x73CF, 0x73CF, 0x181D, 0x73D0, 0x73D0, 0x0646, 0x73D1, 0x73D1, 0x181F,
- 0x73D2, 0x73D8, 0x3D28, 0x73D9, 0x73D9, 0x1826, 0x73DA, 0x73DD, 0x3D2F,
- 0x73DE, 0x73DE, 0x182B, 0x73DF, 0x73DF, 0x3D33, 0x73E0, 0x73E0, 0x11E8,
- 0x73E1, 0x73E4, 0x3D34, 0x73E5, 0x73E5, 0x1825, 0x73E6, 0x73E6, 0x3D38,
- 0x73E7, 0x73E7, 0x182A, 0x73E8, 0x73E8, 0x3D39, 0x73E9, 0x73E9, 0x1829,
- 0x73EA, 0x73EC, 0x3D3A, 0x73ED, 0x73ED, 0x03EB, 0x73EE, 0x73F1, 0x3D3D,
- 0x73F2, 0x73F2, 0x182D, 0x73F3, 0x73FD, 0x3D41, 0x73FE, 0x73FE, 0x21C0,
- 0x73FF, 0x73FF, 0x3D4C, 0x7400, 0x7402, 0x3D4D, 0x7403, 0x7403, 0x0C6F,
- 0x7404, 0x7404, 0x3D50, 0x7405, 0x7405, 0x09B0, 0x7406, 0x7406, 0x09D8,
- 0x7407, 0x7408, 0x3D51, 0x7409, 0x7409, 0x0A39, 0x740A, 0x740A, 0x1828,
- 0x740B, 0x740E, 0x3D53, 0x740F, 0x740F, 0x182E, 0x7410, 0x7410, 0x0DEB,
- 0x7411, 0x7419, 0x3D57, 0x741A, 0x741A, 0x1838, 0x741B, 0x741B, 0x1837,
- 0x741C, 0x7421, 0x3D60, 0x7422, 0x7422, 0x121E, 0x7423, 0x7424, 0x3D66,
- 0x7425, 0x7425, 0x1832, 0x7426, 0x7426, 0x1831, 0x7427, 0x7427, 0x3D68,
- 0x7428, 0x7428, 0x1833, 0x7429, 0x7429, 0x3D69, 0x742A, 0x742A, 0x182F,
- 0x742B, 0x742B, 0x3D6A, 0x742C, 0x742C, 0x1836, 0x742D, 0x742D, 0x3D6B,
- 0x742E, 0x742E, 0x1835, 0x742F, 0x742F, 0x3D6C, 0x7430, 0x7430, 0x1834,
- 0x7431, 0x7432, 0x3D6D, 0x7433, 0x7433, 0x0A1E, 0x7434, 0x7434, 0x0C56,
- 0x7435, 0x7435, 0x0BBE, 0x7436, 0x7436, 0x0B84, 0x7437, 0x743B, 0x3D6F,
- 0x743C, 0x743C, 0x0C6A, 0x743D, 0x743E, 0x3D74, 0x743F, 0x743F, 0x2460,
- 0x7440, 0x7440, 0x3D76, 0x7441, 0x7441, 0x1839, 0x7442, 0x744A, 0x3D77,
- 0x744B, 0x744B, 0x245C, 0x744C, 0x7454, 0x3D80, 0x7455, 0x7455, 0x183C,
- 0x7456, 0x7456, 0x3D89, 0x7457, 0x7457, 0x183B, 0x7458, 0x7458, 0x3D8A,
- 0x7459, 0x7459, 0x183D, 0x745A, 0x745A, 0x07AE, 0x745B, 0x745B, 0x1830,
- 0x745C, 0x745C, 0x183A, 0x745D, 0x745D, 0x3D8B, 0x745E, 0x745E, 0x0CCB,
- 0x745F, 0x745F, 0x0CE3, 0x7460, 0x7462, 0x3D8C, 0x7463, 0x7463, 0x215D,
- 0x7464, 0x7468, 0x3D8F, 0x7469, 0x7469, 0x2225, 0x746A, 0x746A, 0x206A,
- 0x746B, 0x746C, 0x3D94, 0x746D, 0x746D, 0x183F, 0x746E, 0x746F, 0x3D96,
- 0x7470, 0x7470, 0x073E, 0x7471, 0x7475, 0x3D98, 0x7476, 0x7476, 0x1027,
- 0x7477, 0x7477, 0x183E, 0x7478, 0x747D, 0x3D9D, 0x747E, 0x747E, 0x1840,
- 0x747F, 0x747F, 0x3DA3, 0x7480, 0x7481, 0x1843, 0x7482, 0x7482, 0x3DA4,
- 0x7483, 0x7483, 0x09F0, 0x7484, 0x7486, 0x3DA5, 0x7487, 0x7487, 0x1845,
- 0x7488, 0x7488, 0x3DA8, 0x7489, 0x7489, 0x2461, 0x748A, 0x748A, 0x3DA9,
- 0x748B, 0x748B, 0x1846, 0x748C, 0x748D, 0x3DAA, 0x748E, 0x748E, 0x1842,
- 0x748F, 0x748F, 0x3DAC, 0x7490, 0x7490, 0x184A, 0x7491, 0x749B, 0x3DAD,
- 0x749C, 0x749C, 0x1841, 0x749D, 0x749D, 0x3DB8, 0x749E, 0x749E, 0x1847,
- 0x749F, 0x74A2, 0x3DB9, 0x74A3, 0x74A3, 0x245B, 0x74A4, 0x74A5, 0x3DBD,
- 0x74A6, 0x74A6, 0x2462, 0x74A7, 0x74A7, 0x184B, 0x74A8, 0x74A9, 0x1848,
- 0x74AA, 0x74AF, 0x3DBF, 0x74B0, 0x74B0, 0x1F54, 0x74B1, 0x74B9, 0x3DC5,
- 0x74BA, 0x74BA, 0x184D, 0x74BB, 0x74BC, 0x3DCE, 0x74BD, 0x74BD, 0x245F,
- 0x74BE, 0x74C9, 0x3DD0, 0x74CA, 0x74CA, 0x20EC, 0x74CB, 0x74CE, 0x3DDC,
- 0x74CF, 0x74CF, 0x245D, 0x74D0, 0x74D1, 0x3DE0, 0x74D2, 0x74D2, 0x184C,
- 0x74D3, 0x74D3, 0x3DE2, 0x74D4, 0x74D4, 0x2463, 0x74D5, 0x74D9, 0x3DE3,
- 0x74DA, 0x74DA, 0x2464, 0x74DB, 0x74DB, 0x3DE8, 0x74DC, 0x74DC, 0x0728,
- 0x74DD, 0x74DD, 0x3DE9, 0x74DE, 0x74DE, 0x1B32, 0x74DF, 0x74DF, 0x3DEA,
- 0x74E0, 0x74E0, 0x1B33, 0x74E1, 0x74E1, 0x3DEB, 0x74E2, 0x74E2, 0x0BCF,
- 0x74E3, 0x74E3, 0x03F5, 0x74E4, 0x74E4, 0x0C9A, 0x74E5, 0x74E5, 0x3DEC,
- 0x74E6, 0x74E6, 0x0E90, 0x74E7, 0x74ED, 0x3DED, 0x74EE, 0x74EE, 0x0EDC,
- 0x74EF, 0x74EF, 0x1903, 0x74F0, 0x74F3, 0x3DF4, 0x74F4, 0x74F4, 0x1904,
- 0x74F5, 0x74F5, 0x3DF8, 0x74F6, 0x74F6, 0x0BDE, 0x74F7, 0x74F7, 0x054C,
- 0x74F8, 0x74FE, 0x3DF9, 0x74FF, 0x74FF, 0x1905, 0x7500, 0x7503, 0x3E00,
- 0x7504, 0x7504, 0x1188, 0x7505, 0x750B, 0x3E04, 0x750C, 0x750C, 0x24A5,
- 0x750D, 0x750D, 0x1485, 0x750E, 0x750E, 0x3E0B, 0x750F, 0x750F, 0x1906,
- 0x7510, 0x7510, 0x3E0C, 0x7511, 0x7511, 0x1907, 0x7512, 0x7512, 0x3E0D,
- 0x7513, 0x7513, 0x1908, 0x7514, 0x7517, 0x3E0E, 0x7518, 0x7518, 0x06C5,
- 0x7519, 0x7519, 0x14F8, 0x751A, 0x751A, 0x0D2E, 0x751B, 0x751B, 0x3E12,
- 0x751C, 0x751C, 0x0E43, 0x751D, 0x751E, 0x3E13, 0x751F, 0x751F, 0x0D33,
- 0x7520, 0x7522, 0x3E15, 0x7523, 0x7523, 0x1E70, 0x7524, 0x7524, 0x3E18,
- 0x7525, 0x7525, 0x0D34, 0x7526, 0x7527, 0x3E19, 0x7528, 0x7528, 0x10A8,
- 0x7529, 0x7529, 0x0D9B, 0x752A, 0x752A, 0x3E1B, 0x752B, 0x752B, 0x06A1,
- 0x752C, 0x752C, 0x1B34, 0x752D, 0x752D, 0x042B, 0x752E, 0x752E, 0x3E1C,
- 0x752F, 0x752F, 0x1734, 0x7530, 0x7530, 0x0E42, 0x7531, 0x7531, 0x10AE,
- 0x7532, 0x7532, 0x084A, 0x7533, 0x7533, 0x0D23, 0x7534, 0x7534, 0x3E1D,
- 0x7535, 0x7535, 0x05C8, 0x7536, 0x7536, 0x3E1E, 0x7537, 0x7537, 0x0B33,
- 0x7538, 0x7538, 0x05CA, 0x7539, 0x7539, 0x3E1F, 0x753A, 0x753A, 0x1A78,
- 0x753B, 0x753B, 0x07C2, 0x753C, 0x753D, 0x3E20, 0x753E, 0x753E, 0x1816,
- 0x753F, 0x753F, 0x3E22, 0x7540, 0x7540, 0x1A79, 0x7541, 0x7544, 0x3E23,
- 0x7545, 0x7545, 0x04CE, 0x7546, 0x7547, 0x3E27, 0x7548, 0x7548, 0x1A7C,
- 0x7549, 0x754A, 0x3E29, 0x754B, 0x754B, 0x1A7B, 0x754C, 0x754C, 0x08B8,
- 0x754D, 0x754D, 0x3E2B, 0x754E, 0x754E, 0x1A7A, 0x754F, 0x754F, 0x0EC6,
- 0x7550, 0x7553, 0x3E2C, 0x7554, 0x7554, 0x0B90, 0x7555, 0x7558, 0x3E30,
- 0x7559, 0x7559, 0x0A3D, 0x755A, 0x755A, 0x139E, 0x755B, 0x755B, 0x1A7D,
- 0x755C, 0x755C, 0x0FBE, 0x755D, 0x755D, 0x208F, 0x755E, 0x7561, 0x3E34,
- 0x7562, 0x7562, 0x1E42, 0x7563, 0x7564, 0x3E38, 0x7565, 0x7565, 0x0A7B,
- 0x7566, 0x7566, 0x0C07, 0x7567, 0x7569, 0x3E3A, 0x756A, 0x756A, 0x0649,
- 0x756B, 0x756B, 0x1F4E, 0x756C, 0x7571, 0x3E3D, 0x7572, 0x7572, 0x1A7E,
- 0x7573, 0x7573, 0x3E43, 0x7574, 0x7574, 0x0510, 0x7575, 0x7575, 0x3E44,
- 0x7576, 0x7576, 0x1EB1, 0x7577, 0x7577, 0x3E45, 0x7578, 0x7578, 0x0810,
- 0x7579, 0x7579, 0x1A7F, 0x757A, 0x757E, 0x3E46, 0x757F, 0x757F, 0x1814,
- 0x7580, 0x7582, 0x3E4B, 0x7583, 0x7583, 0x1A80, 0x7584, 0x7585, 0x3E4E,
- 0x7586, 0x7586, 0x087F, 0x7587, 0x7587, 0x1E8B, 0x7588, 0x758A, 0x3E50,
- 0x758B, 0x758B, 0x1BC6, 0x758C, 0x758E, 0x3E53, 0x758F, 0x758F, 0x0D7F,
- 0x7590, 0x7590, 0x3E56, 0x7591, 0x7591, 0x1050, 0x7592, 0x7592, 0x1B60,
- 0x7593, 0x7593, 0x3E57, 0x7594, 0x7594, 0x1B61, 0x7595, 0x7595, 0x3E58,
- 0x7596, 0x7596, 0x1B62, 0x7597, 0x7597, 0x0A0F, 0x7598, 0x7598, 0x3E59,
- 0x7599, 0x7599, 0x06E8, 0x759A, 0x759A, 0x08FD, 0x759B, 0x759C, 0x3E5A,
- 0x759D, 0x759D, 0x1B64, 0x759E, 0x759E, 0x3E5C, 0x759F, 0x759F, 0x0B72,
- 0x75A0, 0x75A0, 0x1B63, 0x75A1, 0x75A1, 0x101A, 0x75A2, 0x75A2, 0x3E5D,
- 0x75A3, 0x75A3, 0x1B66, 0x75A4, 0x75A4, 0x03D7, 0x75A5, 0x75A5, 0x08BB,
- 0x75A6, 0x75AA, 0x3E5E, 0x75AB, 0x75AB, 0x1066, 0x75AC, 0x75AC, 0x1B65,
- 0x75AD, 0x75AD, 0x3E63, 0x75AE, 0x75AE, 0x0532, 0x75AF, 0x75AF, 0x0685,
- 0x75B0, 0x75B0, 0x1B6C, 0x75B1, 0x75B1, 0x1B6B, 0x75B2, 0x75B2, 0x0BC2,
- 0x75B3, 0x75B4, 0x1B67, 0x75B5, 0x75B5, 0x0546, 0x75B6, 0x75B7, 0x3E64,
- 0x75B8, 0x75B8, 0x1B69, 0x75B9, 0x75B9, 0x118F, 0x75BA, 0x75BB, 0x3E66,
- 0x75BC, 0x75BC, 0x0E2E, 0x75BD, 0x75BD, 0x0901, 0x75BE, 0x75BE, 0x0825,
- 0x75BF, 0x75C1, 0x3E68, 0x75C2, 0x75C2, 0x1B6E, 0x75C3, 0x75C3, 0x1B6D,
- 0x75C4, 0x75C4, 0x1B6A, 0x75C5, 0x75C5, 0x0468, 0x75C6, 0x75C6, 0x3E6B,
- 0x75C7, 0x75C7, 0x11A1, 0x75C8, 0x75C8, 0x109D, 0x75C9, 0x75C9, 0x08E6,
- 0x75CA, 0x75CA, 0x0C87, 0x75CB, 0x75CC, 0x3E6C, 0x75CD, 0x75CD, 0x1B70,
- 0x75CE, 0x75D1, 0x3E6E, 0x75D2, 0x75D2, 0x1020, 0x75D3, 0x75D3, 0x3E72,
- 0x75D4, 0x75D4, 0x11CB, 0x75D5, 0x75D5, 0x0792, 0x75D6, 0x75D6, 0x1B6F,
- 0x75D7, 0x75D7, 0x3E73, 0x75D8, 0x75D8, 0x05FA, 0x75D9, 0x75D9, 0x1FC6,
- 0x75DA, 0x75DA, 0x3E74, 0x75DB, 0x75DB, 0x0E65, 0x75DC, 0x75DD, 0x3E75,
- 0x75DE, 0x75DE, 0x0BC5, 0x75DF, 0x75E1, 0x3E77, 0x75E2, 0x75E2, 0x09EA,
- 0x75E3, 0x75E3, 0x1B71, 0x75E4, 0x75E4, 0x1B74, 0x75E5, 0x75E5, 0x3E7A,
- 0x75E6, 0x75E6, 0x1B73, 0x75E7, 0x75E7, 0x1B76, 0x75E8, 0x75E8, 0x1B72,
- 0x75E9, 0x75E9, 0x3E7B, 0x75EA, 0x75EA, 0x07D3, 0x75EB, 0x75EB, 0x1B75,
- 0x75EC, 0x75EF, 0x3E7C, 0x75F0, 0x75F0, 0x0E08, 0x75F1, 0x75F1, 0x1B78,
- 0x75F2, 0x75F3, 0x3E80, 0x75F4, 0x75F4, 0x04FA, 0x75F5, 0x75F8, 0x3E82,
- 0x75F9, 0x75F9, 0x043D, 0x75FA, 0x75FB, 0x3E86, 0x75FC, 0x75FC, 0x1B79,
- 0x75FD, 0x75FE, 0x3E88, 0x75FF, 0x75FF, 0x1B7A, 0x7600, 0x7600, 0x1B7C,
- 0x7601, 0x7601, 0x0564, 0x7602, 0x7602, 0x25AE, 0x7603, 0x7603, 0x1B77,
- 0x7604, 0x7604, 0x3E8A, 0x7605, 0x7605, 0x1B7D, 0x7606, 0x7609, 0x3E8B,
- 0x760A, 0x760A, 0x1B80, 0x760B, 0x760B, 0x1F01, 0x760C, 0x760C, 0x1B7E,
- 0x760D, 0x760D, 0x2200, 0x760E, 0x760F, 0x3E8F, 0x7610, 0x7610, 0x1B7B,
- 0x7611, 0x7614, 0x3E91, 0x7615, 0x7615, 0x1B83, 0x7616, 0x7616, 0x3E95,
- 0x7617, 0x7617, 0x1B7F, 0x7618, 0x7618, 0x1B82, 0x7619, 0x7619, 0x1B84,
- 0x761A, 0x761A, 0x3E96, 0x761B, 0x761B, 0x1B85, 0x761C, 0x761D, 0x3E97,
- 0x761E, 0x761E, 0x25B2, 0x761F, 0x761F, 0x0ED0, 0x7620, 0x7620, 0x1B88,
- 0x7621, 0x7621, 0x1E97, 0x7622, 0x7622, 0x1B87, 0x7623, 0x7623, 0x3E99,
- 0x7624, 0x7624, 0x0A3F, 0x7625, 0x7625, 0x1B81, 0x7626, 0x7626, 0x0D74,
- 0x7627, 0x7627, 0x20AB, 0x7628, 0x7628, 0x3E9A, 0x7629, 0x7629, 0x0574,
- 0x762A, 0x762A, 0x045A, 0x762B, 0x762B, 0x0E04, 0x762C, 0x762C, 0x3E9B,
- 0x762D, 0x762D, 0x1B8A, 0x762E, 0x762F, 0x3E9C, 0x7630, 0x7630, 0x1B8B,
- 0x7631, 0x7632, 0x3E9E, 0x7633, 0x7633, 0x1B90, 0x7634, 0x7634, 0x116F,
- 0x7635, 0x7635, 0x1B8D, 0x7636, 0x7637, 0x3EA0, 0x7638, 0x7638, 0x0C8E,
- 0x7639, 0x763A, 0x3EA2, 0x763B, 0x763B, 0x25B3, 0x763C, 0x763C, 0x1B86,
- 0x763D, 0x763D, 0x3EA4, 0x763E, 0x763E, 0x1B8F, 0x763F, 0x763F, 0x1B8C,
- 0x7640, 0x7640, 0x1B89, 0x7641, 0x7641, 0x3EA5, 0x7642, 0x7642, 0x2028,
- 0x7643, 0x7643, 0x1B8E, 0x7644, 0x7645, 0x3EA6, 0x7646, 0x7647, 0x25AF,
- 0x7648, 0x7648, 0x3EA8, 0x7649, 0x7649, 0x25B1, 0x764A, 0x764B, 0x3EA9,
- 0x764C, 0x764C, 0x03B4, 0x764D, 0x764D, 0x1B91, 0x764E, 0x7653, 0x3EAB,
- 0x7654, 0x7654, 0x1B93, 0x7655, 0x7655, 0x3EB1, 0x7656, 0x7656, 0x1B95,
- 0x7657, 0x7657, 0x3EB2, 0x7658, 0x7658, 0x25AC, 0x7659, 0x765B, 0x3EB3,
- 0x765C, 0x765C, 0x1B94, 0x765D, 0x765D, 0x3EB6, 0x765E, 0x765E, 0x1B92,
- 0x765F, 0x765F, 0x1E4E, 0x7660, 0x7661, 0x3EB7, 0x7662, 0x7662, 0x2202,
- 0x7663, 0x7663, 0x0FCB, 0x7664, 0x7664, 0x25AB, 0x7665, 0x7665, 0x2286,
- 0x7666, 0x7666, 0x3EB9, 0x7667, 0x7667, 0x25AD, 0x7668, 0x7668, 0x3EBA,
- 0x7669, 0x7669, 0x25B6, 0x766A, 0x766A, 0x3EBB, 0x766B, 0x766B, 0x1B96,
- 0x766C, 0x766C, 0x21E3, 0x766D, 0x766E, 0x25B4, 0x766F, 0x766F, 0x1B97,
- 0x7670, 0x7670, 0x222F, 0x7671, 0x7671, 0x2165, 0x7672, 0x7672, 0x25B7,
- 0x7673, 0x7677, 0x3EBC, 0x7678, 0x7678, 0x0748, 0x7679, 0x767A, 0x3EC1,
- 0x767B, 0x767B, 0x05A8, 0x767C, 0x767C, 0x1EE9, 0x767D, 0x767D, 0x03E2,
- 0x767E, 0x767E, 0x03E4, 0x767F, 0x7681, 0x3EC3, 0x7682, 0x7682, 0x1130,
- 0x7683, 0x7683, 0x3EC6, 0x7684, 0x7684, 0x05A5, 0x7685, 0x7685, 0x3EC7,
- 0x7686, 0x7686, 0x08A5, 0x7687, 0x7687, 0x07DF, 0x7688, 0x7688, 0x1B2D,
- 0x7689, 0x768A, 0x3EC8, 0x768B, 0x768B, 0x06D9, 0x768C, 0x768D, 0x3ECA,
- 0x768E, 0x768E, 0x1B2E, 0x768F, 0x7690, 0x3ECC, 0x7691, 0x7691, 0x03B3,
- 0x7692, 0x7692, 0x3ECE, 0x7693, 0x7693, 0x1B2F, 0x7694, 0x7695, 0x3ECF,
- 0x7696, 0x7696, 0x0E9F, 0x7697, 0x7698, 0x3ED1, 0x7699, 0x7699, 0x1B30,
- 0x769A, 0x769A, 0x1E25, 0x769B, 0x76A3, 0x3ED3, 0x76A4, 0x76A4, 0x1B31,
- 0x76A5, 0x76AD, 0x3EDC, 0x76AE, 0x76AE, 0x0BC3, 0x76AF, 0x76B0, 0x3EE5,
- 0x76B1, 0x76B1, 0x11E4, 0x76B2, 0x76B2, 0x1BC8, 0x76B3, 0x76B3, 0x3EE7,
- 0x76B4, 0x76B4, 0x1BC9, 0x76B5, 0x76B7, 0x3EE8, 0x76B8, 0x76B8, 0x25C0,
- 0x76B9, 0x76B9, 0x3EEB, 0x76BA, 0x76BA, 0x229A, 0x76BB, 0x76BE, 0x3EEC,
- 0x76BF, 0x76BF, 0x0AF8, 0x76C0, 0x76C1, 0x3EF0, 0x76C2, 0x76C2, 0x10C0,
- 0x76C3, 0x76C4, 0x3EF2, 0x76C5, 0x76C5, 0x11D0, 0x76C6, 0x76C6, 0x0BA9,
- 0x76C7, 0x76C7, 0x3EF4, 0x76C8, 0x76C8, 0x1094, 0x76C9, 0x76C9, 0x3EF5,
- 0x76CA, 0x76CA, 0x106D, 0x76CB, 0x76CC, 0x3EF6, 0x76CD, 0x76CD, 0x1A8B,
- 0x76CE, 0x76CE, 0x03C6, 0x76CF, 0x76CF, 0x1156, 0x76D0, 0x76D0, 0x0FF7,
- 0x76D1, 0x76D1, 0x0853, 0x76D2, 0x76D2, 0x0787, 0x76D3, 0x76D3, 0x3EF8,
- 0x76D4, 0x76D4, 0x0985, 0x76D5, 0x76D5, 0x3EF9, 0x76D6, 0x76D6, 0x06C2,
- 0x76D7, 0x76D7, 0x05A2, 0x76D8, 0x76D8, 0x0B8D, 0x76D9, 0x76DA, 0x3EFA,
- 0x76DB, 0x76DB, 0x0D39, 0x76DC, 0x76DD, 0x3EFC, 0x76DE, 0x76DE, 0x226E,
- 0x76DF, 0x76DF, 0x0AD0, 0x76E0, 0x76E0, 0x3EFE, 0x76E1, 0x76E1, 0x1FBD,
- 0x76E2, 0x76E2, 0x3EFF, 0x76E3, 0x76E3, 0x1F84, 0x76E4, 0x76E4, 0x20B2,
- 0x76E5, 0x76E5, 0x1A8C, 0x76E6, 0x76E6, 0x3F00, 0x76E7, 0x76E7, 0x2043,
- 0x76E8, 0x76ED, 0x3F01, 0x76EE, 0x76EE, 0x0B22, 0x76EF, 0x76EF, 0x05E1,
- 0x76F0, 0x76F0, 0x3F07, 0x76F1, 0x76F1, 0x1A58, 0x76F2, 0x76F2, 0x0AA9,
- 0x76F3, 0x76F3, 0x3F08, 0x76F4, 0x76F4, 0x11B0, 0x76F5, 0x76F7, 0x3F09,
- 0x76F8, 0x76F8, 0x0F4D, 0x76F9, 0x76F9, 0x1A5B, 0x76FA, 0x76FB, 0x3F0C,
- 0x76FC, 0x76FC, 0x0B8F, 0x76FD, 0x76FD, 0x3F0E, 0x76FE, 0x76FE, 0x061B,
- 0x76FF, 0x76FF, 0x3F0F, 0x7700, 0x7700, 0x3F10, 0x7701, 0x7701, 0x0D38,
- 0x7702, 0x7703, 0x3F11, 0x7704, 0x7704, 0x1A59, 0x7705, 0x7706, 0x3F13,
- 0x7707, 0x7708, 0x1A5C, 0x7709, 0x7709, 0x0AC1, 0x770A, 0x770A, 0x3F15,
- 0x770B, 0x770B, 0x0941, 0x770C, 0x770C, 0x3F16, 0x770D, 0x770D, 0x1A5A,
- 0x770E, 0x7718, 0x3F17, 0x7719, 0x7719, 0x1A60, 0x771A, 0x771A, 0x1A5E,
- 0x771B, 0x771E, 0x3F22, 0x771F, 0x771F, 0x1187, 0x7720, 0x7720, 0x0AE4,
- 0x7721, 0x7721, 0x3F26, 0x7722, 0x7722, 0x1A5F, 0x7723, 0x7725, 0x3F27,
- 0x7726, 0x7726, 0x1A62, 0x7727, 0x7727, 0x3F2A, 0x7728, 0x7728, 0x1144,
- 0x7729, 0x7729, 0x0FCC, 0x772A, 0x772C, 0x3F2B, 0x772D, 0x772D, 0x1A61,
- 0x772E, 0x772E, 0x3F2E, 0x772F, 0x772F, 0x0AD5, 0x7730, 0x7734, 0x3F2F,
- 0x7735, 0x7735, 0x1A63, 0x7736, 0x7736, 0x0981, 0x7737, 0x7737, 0x091B,
- 0x7738, 0x7738, 0x1A64, 0x7739, 0x7739, 0x3F34, 0x773A, 0x773A, 0x0E4A,
- 0x773B, 0x773B, 0x3F35, 0x773C, 0x773C, 0x1004, 0x773D, 0x773F, 0x3F36,
- 0x7740, 0x7740, 0x1222, 0x7741, 0x7741, 0x1197, 0x7742, 0x7742, 0x3F39,
- 0x7743, 0x7743, 0x1A68, 0x7744, 0x7746, 0x3F3A, 0x7747, 0x7747, 0x1A67,
- 0x7748, 0x774E, 0x3F3D, 0x774F, 0x774F, 0x2684, 0x7750, 0x7751, 0x1A65,
- 0x7752, 0x7759, 0x3F44, 0x775A, 0x775A, 0x1A69, 0x775B, 0x775B, 0x08D5,
- 0x775C, 0x775D, 0x3F4C, 0x775E, 0x775E, 0x24EF, 0x775F, 0x7760, 0x3F4E,
- 0x7761, 0x7761, 0x0DA4, 0x7762, 0x7762, 0x1A6B, 0x7763, 0x7763, 0x05FC,
- 0x7764, 0x7764, 0x3F50, 0x7765, 0x7765, 0x1A6C, 0x7766, 0x7766, 0x0B23,
- 0x7767, 0x7767, 0x3F51, 0x7768, 0x7768, 0x1A6A, 0x7769, 0x776A, 0x3F52,
- 0x776B, 0x776B, 0x08AF, 0x776C, 0x776C, 0x048E, 0x776D, 0x7778, 0x3F54,
- 0x7779, 0x7779, 0x0602, 0x777A, 0x777C, 0x3F60, 0x777D, 0x777D, 0x1A6F,
- 0x777E, 0x777E, 0x1270, 0x777F, 0x777F, 0x1A6D, 0x7780, 0x7780, 0x1A70,
- 0x7781, 0x7783, 0x3F63, 0x7784, 0x7784, 0x0AEE, 0x7785, 0x7785, 0x0517,
- 0x7786, 0x778B, 0x3F66, 0x778C, 0x778C, 0x1A71, 0x778D, 0x778D, 0x1A6E,
- 0x778E, 0x778E, 0x0F26, 0x778F, 0x7790, 0x3F6C, 0x7791, 0x7791, 0x1A72,
- 0x7792, 0x7792, 0x0A9E, 0x7793, 0x7797, 0x3F6E, 0x7798, 0x7798, 0x24EE,
- 0x7799, 0x779D, 0x3F73, 0x779E, 0x779E, 0x2074, 0x779F, 0x77A0, 0x1A73,
- 0x77A1, 0x77A1, 0x3F78, 0x77A2, 0x77A2, 0x1495, 0x77A3, 0x77A4, 0x3F79,
- 0x77A5, 0x77A5, 0x0BD2, 0x77A6, 0x77A6, 0x3F7B, 0x77A7, 0x77A7, 0x0C43,
- 0x77A8, 0x77A8, 0x3F7C, 0x77A9, 0x77A9, 0x11F4, 0x77AA, 0x77AA, 0x05AA,
- 0x77AB, 0x77AB, 0x3F7D, 0x77AC, 0x77AC, 0x0DA7, 0x77AD, 0x77AD, 0x2687,
- 0x77AE, 0x77AF, 0x3F7E, 0x77B0, 0x77B0, 0x1A75, 0x77B1, 0x77B2, 0x3F80,
- 0x77B3, 0x77B3, 0x0E5C, 0x77B4, 0x77B4, 0x3F82, 0x77B5, 0x77B5, 0x1A76,
- 0x77B6, 0x77BA, 0x3F83, 0x77BB, 0x77BB, 0x1151, 0x77BC, 0x77BC, 0x24F0,
- 0x77BD, 0x77BD, 0x1A77, 0x77BE, 0x77BE, 0x3F88, 0x77BF, 0x77BF, 0x1D7E,
- 0x77C0, 0x77C6, 0x3F89, 0x77C7, 0x77C7, 0x268D, 0x77C8, 0x77CC, 0x3F90,
- 0x77CD, 0x77CD, 0x1397, 0x77CE, 0x77D6, 0x3F95, 0x77D7, 0x77D7, 0x0526,
- 0x77D8, 0x77D9, 0x3F9E, 0x77DA, 0x77DA, 0x22A0, 0x77DB, 0x77DB, 0x0AB1,
- 0x77DC, 0x77DC, 0x1BCA, 0x77DD, 0x77E1, 0x3FA0, 0x77E2, 0x77E2, 0x0D4F,
- 0x77E3, 0x77E3, 0x105A, 0x77E4, 0x77E4, 0x3FA5, 0x77E5, 0x77E5, 0x11A9,
- 0x77E6, 0x77E6, 0x3FA6, 0x77E7, 0x77E7, 0x1B1A, 0x77E8, 0x77E8, 0x3FA7,
- 0x77E9, 0x77E9, 0x0907, 0x77EA, 0x77EA, 0x3FA8, 0x77EB, 0x77EB, 0x0894,
- 0x77EC, 0x77EC, 0x1B1B, 0x77ED, 0x77ED, 0x060B, 0x77EE, 0x77EE, 0x03B6,
- 0x77EF, 0x77EF, 0x1FAB, 0x77F0, 0x77F2, 0x3FA9, 0x77F3, 0x77F3, 0x0D46,
- 0x77F4, 0x77F5, 0x3FAC, 0x77F6, 0x77F6, 0x1A22, 0x77F7, 0x77F7, 0x3FAE,
- 0x77F8, 0x77F8, 0x1A23, 0x77F9, 0x77FC, 0x3FAF, 0x77FD, 0x77FD, 0x0F08,
- 0x77FE, 0x77FE, 0x064C, 0x77FF, 0x77FF, 0x0980, 0x7800, 0x7800, 0x1A24,
- 0x7801, 0x7801, 0x0A92, 0x7802, 0x7802, 0x0CE9, 0x7803, 0x7808, 0x3FB3,
- 0x7809, 0x7809, 0x1A25, 0x780A, 0x780B, 0x3FB9, 0x780C, 0x780C, 0x0C15,
- 0x780D, 0x780D, 0x0940, 0x780E, 0x7810, 0x3FBB, 0x7811, 0x7811, 0x1A28,
- 0x7812, 0x7812, 0x0BB9, 0x7813, 0x7813, 0x3FBE, 0x7814, 0x7814, 0x0FF9,
- 0x7815, 0x7815, 0x3FBF, 0x7816, 0x7816, 0x1206, 0x7817, 0x7818, 0x1A26,
- 0x7819, 0x7819, 0x3FC0, 0x781A, 0x781A, 0x100B, 0x781B, 0x781B, 0x3FC1,
- 0x781C, 0x781D, 0x1A2B, 0x781E, 0x781E, 0x3FC2, 0x781F, 0x781F, 0x1A30,
- 0x7820, 0x7822, 0x3FC3, 0x7823, 0x7823, 0x1A34, 0x7824, 0x7824, 0x3FC6,
- 0x7825, 0x7825, 0x1A32, 0x7826, 0x7826, 0x1A3A, 0x7827, 0x7827, 0x1189,
- 0x7828, 0x7828, 0x3FC7, 0x7829, 0x7829, 0x1A35, 0x782A, 0x782B, 0x3FC8,
- 0x782C, 0x782C, 0x1A33, 0x782D, 0x782D, 0x1A2A, 0x782E, 0x782F, 0x3FCA,
- 0x7830, 0x7830, 0x0BAA, 0x7831, 0x7833, 0x3FCC, 0x7834, 0x7834, 0x0BE5,
- 0x7835, 0x7836, 0x3FCF, 0x7837, 0x7837, 0x0D22, 0x7838, 0x7838, 0x1115,
- 0x7839, 0x783B, 0x1A2D, 0x783C, 0x783C, 0x1A31, 0x783D, 0x783D, 0x3FD1,
- 0x783E, 0x783E, 0x09E4, 0x783F, 0x783F, 0x3FD2, 0x7840, 0x7840, 0x0524,
- 0x7841, 0x7842, 0x3FD3, 0x7843, 0x7843, 0x26A8, 0x7844, 0x7844, 0x3FD5,
- 0x7845, 0x7845, 0x0741, 0x7846, 0x7846, 0x3FD6, 0x7847, 0x7847, 0x1A3C,
- 0x7848, 0x784B, 0x3FD7, 0x784C, 0x784C, 0x1A3D, 0x784D, 0x784D, 0x3FDB,
- 0x784E, 0x784E, 0x1A36, 0x784F, 0x784F, 0x3FDC, 0x7850, 0x7850, 0x1A3B,
- 0x7851, 0x7851, 0x3FDD, 0x7852, 0x7852, 0x0F07, 0x7853, 0x7854, 0x3FDE,
- 0x7855, 0x7855, 0x0DAB, 0x7856, 0x7857, 0x1A38, 0x7858, 0x785C, 0x3FE0,
- 0x785D, 0x785D, 0x0F62, 0x785E, 0x7863, 0x3FE5, 0x7864, 0x7864, 0x24E9,
- 0x7865, 0x7867, 0x3FEB, 0x7868, 0x7868, 0x24E5, 0x7869, 0x7869, 0x3FEE,
- 0x786A, 0x786A, 0x1A3E, 0x786B, 0x786B, 0x0A3B, 0x786C, 0x786C, 0x1097,
- 0x786D, 0x786D, 0x1A37, 0x786E, 0x786E, 0x0C92, 0x786F, 0x786F, 0x21FA,
- 0x7870, 0x7876, 0x3FEF, 0x7877, 0x7877, 0x0862, 0x7878, 0x787B, 0x3FF6,
- 0x787C, 0x787C, 0x0BB1, 0x787D, 0x7886, 0x3FFA, 0x7887, 0x7887, 0x1A42,
- 0x7888, 0x7888, 0x4004, 0x7889, 0x7889, 0x05D0, 0x788A, 0x788B, 0x4005,
- 0x788C, 0x788C, 0x0A5C, 0x788D, 0x788D, 0x03B8, 0x788E, 0x788E, 0x0DDE,
- 0x788F, 0x7890, 0x4007, 0x7891, 0x7891, 0x0417, 0x7892, 0x7892, 0x4009,
- 0x7893, 0x7893, 0x1A40, 0x7894, 0x7896, 0x400A, 0x7897, 0x7897, 0x0E9C,
- 0x7898, 0x7898, 0x05C3, 0x7899, 0x7899, 0x400D, 0x789A, 0x789A, 0x1A41,
- 0x789B, 0x789B, 0x1A3F, 0x789C, 0x789C, 0x1A43, 0x789D, 0x789E, 0x400E,
- 0x789F, 0x789F, 0x05DB, 0x78A0, 0x78A0, 0x4010, 0x78A1, 0x78A1, 0x1A44,
- 0x78A2, 0x78A2, 0x4011, 0x78A3, 0x78A3, 0x1A45, 0x78A4, 0x78A4, 0x4012,
- 0x78A5, 0x78A5, 0x1A48, 0x78A6, 0x78A6, 0x4013, 0x78A7, 0x78A7, 0x0435,
- 0x78A8, 0x78A8, 0x4014, 0x78A9, 0x78A9, 0x2148, 0x78AA, 0x78AC, 0x4015,
- 0x78AD, 0x78AD, 0x24E4, 0x78AE, 0x78AF, 0x4018, 0x78B0, 0x78B0, 0x0BB7,
- 0x78B1, 0x78B1, 0x0861, 0x78B2, 0x78B2, 0x1A46, 0x78B3, 0x78B3, 0x0E0F,
- 0x78B4, 0x78B4, 0x04B1, 0x78B5, 0x78B7, 0x401A, 0x78B8, 0x78B8, 0x24E6,
- 0x78B9, 0x78B9, 0x1A47, 0x78BA, 0x78BA, 0x20F7, 0x78BB, 0x78BB, 0x401D,
- 0x78BC, 0x78BC, 0x206B, 0x78BD, 0x78BD, 0x401E, 0x78BE, 0x78BE, 0x0B4E,
- 0x78BF, 0x78C0, 0x401F, 0x78C1, 0x78C1, 0x0548, 0x78C2, 0x78C4, 0x4021,
- 0x78C5, 0x78C5, 0x0400, 0x78C6, 0x78C8, 0x4024, 0x78C9, 0x78C9, 0x1A4B,
- 0x78CA, 0x78CA, 0x09C5, 0x78CB, 0x78CB, 0x056B, 0x78CC, 0x78CF, 0x4027,
- 0x78D0, 0x78D0, 0x0B8E, 0x78D1, 0x78D3, 0x402B, 0x78D4, 0x78D4, 0x1A49,
- 0x78D5, 0x78D5, 0x0951, 0x78D6, 0x78D8, 0x402E, 0x78D9, 0x78D9, 0x1A4A,
- 0x78DA, 0x78DA, 0x22A7, 0x78DB, 0x78E2, 0x4031, 0x78E3, 0x78E3, 0x24EC,
- 0x78E4, 0x78E6, 0x4039, 0x78E7, 0x78E7, 0x24EB, 0x78E8, 0x78E8, 0x0B08,
- 0x78E9, 0x78EB, 0x403C, 0x78EC, 0x78EC, 0x1A4C, 0x78ED, 0x78EE, 0x403F,
- 0x78EF, 0x78EF, 0x24E3, 0x78F0, 0x78F1, 0x4041, 0x78F2, 0x78F2, 0x1A4D,
- 0x78F3, 0x78F3, 0x4043, 0x78F4, 0x78F4, 0x1A4F, 0x78F5, 0x78F6, 0x4044,
- 0x78F7, 0x78F7, 0x0A20, 0x78F8, 0x78F9, 0x4046, 0x78FA, 0x78FA, 0x07DC,
- 0x78FB, 0x78FC, 0x4048, 0x78FD, 0x78FD, 0x24EA, 0x78FE, 0x78FF, 0x404A,
- 0x7900, 0x7900, 0x404C, 0x7901, 0x7901, 0x0889, 0x7902, 0x7904, 0x404D,
- 0x7905, 0x7905, 0x1A4E, 0x7906, 0x790D, 0x4050, 0x790E, 0x790E, 0x1E92,
- 0x790F, 0x7912, 0x4058, 0x7913, 0x7913, 0x1A50, 0x7914, 0x7918, 0x405C,
- 0x7919, 0x7919, 0x1E27, 0x791A, 0x791D, 0x4061, 0x791E, 0x791E, 0x1A52,
- 0x791F, 0x7923, 0x4065, 0x7924, 0x7924, 0x1A51, 0x7925, 0x7925, 0x406A,
- 0x7926, 0x7926, 0x1FE6, 0x7927, 0x7929, 0x406B, 0x792A, 0x792A, 0x24E7,
- 0x792B, 0x792B, 0x2012, 0x792C, 0x792C, 0x1EEC, 0x792D, 0x7930, 0x406E,
- 0x7931, 0x7931, 0x24E8, 0x7932, 0x7933, 0x4072, 0x7934, 0x7934, 0x1A53,
- 0x7935, 0x7939, 0x4074, 0x793A, 0x793A, 0x0D55, 0x793B, 0x793B, 0x19F8,
- 0x793C, 0x793C, 0x09DC, 0x793D, 0x793D, 0x4079, 0x793E, 0x793E, 0x0D20,
- 0x793F, 0x793F, 0x407A, 0x7940, 0x7940, 0x19F9, 0x7941, 0x7941, 0x0C0D,
- 0x7942, 0x7945, 0x407B, 0x7946, 0x7946, 0x19FA, 0x7947, 0x7947, 0x407F,
- 0x7948, 0x7948, 0x0C0C, 0x7949, 0x7949, 0x19FB, 0x794A, 0x7952, 0x4080,
- 0x7953, 0x7953, 0x19FE, 0x7954, 0x7955, 0x4089, 0x7956, 0x7956, 0x1243,
- 0x7957, 0x7957, 0x1A01, 0x7958, 0x7959, 0x408B, 0x795A, 0x795A, 0x19FF,
- 0x795B, 0x795C, 0x19FC, 0x795D, 0x795D, 0x1200, 0x795E, 0x795E, 0x0D2A,
- 0x795F, 0x795F, 0x0DE3, 0x7960, 0x7960, 0x1A02, 0x7961, 0x7961, 0x408D,
- 0x7962, 0x7962, 0x1A00, 0x7963, 0x7964, 0x408E, 0x7965, 0x7965, 0x0F56,
- 0x7966, 0x7966, 0x4090, 0x7967, 0x7967, 0x1A04, 0x7968, 0x7968, 0x0BD0,
- 0x7969, 0x796C, 0x4091, 0x796D, 0x796D, 0x0833, 0x796E, 0x796E, 0x4095,
- 0x796F, 0x796F, 0x1A03, 0x7970, 0x7976, 0x4096, 0x7977, 0x7977, 0x059C,
- 0x7978, 0x7978, 0x080B, 0x7979, 0x7979, 0x409D, 0x797A, 0x797A, 0x1A05,
- 0x797B, 0x797F, 0x409E, 0x7980, 0x7980, 0x130B, 0x7981, 0x7981, 0x08CC,
- 0x7982, 0x7983, 0x40A3, 0x7984, 0x7984, 0x0A62, 0x7985, 0x7985, 0x1A06,
- 0x7986, 0x7989, 0x40A5, 0x798A, 0x798A, 0x1A07, 0x798B, 0x798C, 0x40A9,
- 0x798D, 0x798D, 0x1F66, 0x798E, 0x798E, 0x24DC, 0x798F, 0x798F, 0x069E,
- 0x7990, 0x7999, 0x40AB, 0x799A, 0x799A, 0x1A08, 0x799B, 0x79A5, 0x40B5,
- 0x79A6, 0x79A6, 0x26A2, 0x79A7, 0x79A7, 0x1A09, 0x79A8, 0x79A9, 0x40C0,
- 0x79AA, 0x79AA, 0x24DD, 0x79AB, 0x79AD, 0x40C2, 0x79AE, 0x79AE, 0x200E,
- 0x79AF, 0x79AF, 0x40C5, 0x79B0, 0x79B0, 0x24DB, 0x79B1, 0x79B1, 0x1EB8,
- 0x79B2, 0x79B2, 0x40C6, 0x79B3, 0x79B3, 0x1A0A, 0x79B4, 0x79B8, 0x40C7,
- 0x79B9, 0x79B9, 0x10D2, 0x79BA, 0x79BA, 0x1264, 0x79BB, 0x79BB, 0x09D6,
- 0x79BC, 0x79BC, 0x40CC, 0x79BD, 0x79BD, 0x0C5A, 0x79BE, 0x79BE, 0x0783,
- 0x79BF, 0x79BF, 0x40CD, 0x79C0, 0x79C0, 0x0FAE, 0x79C1, 0x79C1, 0x0DB2,
- 0x79C2, 0x79C2, 0x40CE, 0x79C3, 0x79C3, 0x0E6B, 0x79C4, 0x79C5, 0x40CF,
- 0x79C6, 0x79C6, 0x06CC, 0x79C7, 0x79C8, 0x40D1, 0x79C9, 0x79C9, 0x0465,
- 0x79CA, 0x79CA, 0x40D3, 0x79CB, 0x79CB, 0x0C6C, 0x79CC, 0x79CC, 0x40D4,
- 0x79CD, 0x79CD, 0x11D5, 0x79CE, 0x79D0, 0x40D5, 0x79D1, 0x79D1, 0x0953,
- 0x79D2, 0x79D2, 0x0AF0, 0x79D3, 0x79D4, 0x40D8, 0x79D5, 0x79D5, 0x1B1D,
- 0x79D6, 0x79D7, 0x40DA, 0x79D8, 0x79D8, 0x0ADD, 0x79D9, 0x79DE, 0x40DC,
- 0x79DF, 0x79DF, 0x123F, 0x79E0, 0x79E2, 0x40E2, 0x79E3, 0x79E3, 0x1B1F,
- 0x79E4, 0x79E4, 0x04F8, 0x79E5, 0x79E5, 0x40E5, 0x79E6, 0x79E6, 0x0C55,
- 0x79E7, 0x79E7, 0x1016, 0x79E8, 0x79E8, 0x40E6, 0x79E9, 0x79E9, 0x11C7,
- 0x79EA, 0x79EA, 0x40E7, 0x79EB, 0x79EB, 0x1B20, 0x79EC, 0x79EC, 0x40E8,
- 0x79ED, 0x79ED, 0x1B1E, 0x79EE, 0x79EE, 0x40E9, 0x79EF, 0x79EF, 0x0812,
- 0x79F0, 0x79F0, 0x04EB, 0x79F1, 0x79F7, 0x40EA, 0x79F8, 0x79F8, 0x08A6,
- 0x79F9, 0x79FA, 0x40F1, 0x79FB, 0x79FB, 0x104D, 0x79FC, 0x79FC, 0x40F3,
- 0x79FD, 0x79FD, 0x07F5, 0x79FE, 0x79FF, 0x40F4, 0x7A00, 0x7A00, 0x0F0E,
- 0x7A01, 0x7A01, 0x40F6, 0x7A02, 0x7A02, 0x1B24, 0x7A03, 0x7A03, 0x1B23,
- 0x7A04, 0x7A05, 0x40F7, 0x7A06, 0x7A06, 0x1B21, 0x7A07, 0x7A0A, 0x40F9,
- 0x7A0B, 0x7A0B, 0x04F1, 0x7A0C, 0x7A0C, 0x40FD, 0x7A0D, 0x7A0D, 0x0D0D,
- 0x7A0E, 0x7A0E, 0x0DA5, 0x7A0F, 0x7A13, 0x40FE, 0x7A14, 0x7A14, 0x1B26,
- 0x7A15, 0x7A16, 0x4103, 0x7A17, 0x7A17, 0x03E9, 0x7A18, 0x7A19, 0x4105,
- 0x7A1A, 0x7A1A, 0x11C8, 0x7A1B, 0x7A1D, 0x4107, 0x7A1E, 0x7A1E, 0x1B25,
- 0x7A1F, 0x7A1F, 0x410A, 0x7A20, 0x7A20, 0x0512, 0x7A21, 0x7A22, 0x410B,
- 0x7A23, 0x7A23, 0x1D8F, 0x7A24, 0x7A2D, 0x410D, 0x7A2E, 0x7A2E, 0x2295,
- 0x7A2F, 0x7A30, 0x4117, 0x7A31, 0x7A31, 0x1E80, 0x7A32, 0x7A32, 0x4119,
- 0x7A33, 0x7A33, 0x0ED7, 0x7A34, 0x7A36, 0x411A, 0x7A37, 0x7A37, 0x1B28,
- 0x7A38, 0x7A38, 0x411D, 0x7A39, 0x7A39, 0x1B27, 0x7A3A, 0x7A3A, 0x411E,
- 0x7A3B, 0x7A3B, 0x059F, 0x7A3C, 0x7A3C, 0x084D, 0x7A3D, 0x7A3D, 0x0811,
- 0x7A3E, 0x7A3E, 0x411F, 0x7A3F, 0x7A3F, 0x06E0, 0x7A40, 0x7A40, 0x2677,
- 0x7A41, 0x7A45, 0x4120, 0x7A46, 0x7A46, 0x0B25, 0x7A47, 0x7A4B, 0x4125,
- 0x7A4C, 0x7A4C, 0x2624, 0x7A4D, 0x7A4D, 0x1F69, 0x7A4E, 0x7A4E, 0x222B,
- 0x7A4F, 0x7A50, 0x412A, 0x7A51, 0x7A51, 0x1B29, 0x7A52, 0x7A56, 0x412C,
- 0x7A57, 0x7A57, 0x0DE0, 0x7A58, 0x7A60, 0x4131, 0x7A61, 0x7A61, 0x257F,
- 0x7A62, 0x7A62, 0x1F5B, 0x7A63, 0x7A68, 0x413A, 0x7A69, 0x7A69, 0x219B,
- 0x7A6A, 0x7A6A, 0x4140, 0x7A6B, 0x7A6B, 0x267D, 0x7A6C, 0x7A6F, 0x4141,
- 0x7A70, 0x7A70, 0x1B2C, 0x7A71, 0x7A73, 0x4145, 0x7A74, 0x7A74, 0x0FD1,
- 0x7A75, 0x7A75, 0x4148, 0x7A76, 0x7A76, 0x08EE, 0x7A77, 0x7A77, 0x0C6B,
- 0x7A78, 0x7A79, 0x1B9A, 0x7A7A, 0x7A7A, 0x0962, 0x7A7B, 0x7A7E, 0x4149,
- 0x7A7F, 0x7A7F, 0x052C, 0x7A80, 0x7A80, 0x1B9C, 0x7A81, 0x7A81, 0x0E6C,
- 0x7A82, 0x7A82, 0x414D, 0x7A83, 0x7A83, 0x0C51, 0x7A84, 0x7A84, 0x114E,
- 0x7A85, 0x7A85, 0x414E, 0x7A86, 0x7A86, 0x1B9D, 0x7A87, 0x7A87, 0x414F,
- 0x7A88, 0x7A88, 0x1B9E, 0x7A89, 0x7A8C, 0x4150, 0x7A8D, 0x7A8D, 0x0C4C,
- 0x7A8E, 0x7A90, 0x4154, 0x7A91, 0x7A91, 0x102B, 0x7A92, 0x7A92, 0x11CE,
- 0x7A93, 0x7A94, 0x4157, 0x7A95, 0x7A95, 0x1B9F, 0x7A96, 0x7A96, 0x08A2,
- 0x7A97, 0x7A97, 0x0533, 0x7A98, 0x7A98, 0x08EC, 0x7A99, 0x7A9B, 0x4159,
- 0x7A9C, 0x7A9C, 0x055F, 0x7A9D, 0x7A9D, 0x0EE0, 0x7A9E, 0x7A9E, 0x415C,
- 0x7A9F, 0x7A9F, 0x096C, 0x7AA0, 0x7AA0, 0x1BA1, 0x7AA1, 0x7AA4, 0x415D,
- 0x7AA5, 0x7AA5, 0x0987, 0x7AA6, 0x7AA6, 0x1BA0, 0x7AA7, 0x7AA7, 0x4161,
- 0x7AA8, 0x7AA8, 0x1BA3, 0x7AA9, 0x7AA9, 0x21A0, 0x7AAA, 0x7AAA, 0x2186,
- 0x7AAB, 0x7AAB, 0x4162, 0x7AAC, 0x7AAC, 0x1BA2, 0x7AAD, 0x7AAD, 0x1BA4,
- 0x7AAE, 0x7AAE, 0x20ED, 0x7AAF, 0x7AB2, 0x4163, 0x7AB3, 0x7AB3, 0x1BA5,
- 0x7AB4, 0x7AB5, 0x4167, 0x7AB6, 0x7AB6, 0x25B9, 0x7AB7, 0x7AB9, 0x4169,
- 0x7ABA, 0x7ABA, 0x1FEA, 0x7ABB, 0x7ABE, 0x416C, 0x7ABF, 0x7ABF, 0x0A47,
- 0x7AC0, 0x7AC3, 0x4170, 0x7AC4, 0x7AC4, 0x1EA4, 0x7AC5, 0x7AC5, 0x20E1,
- 0x7AC6, 0x7AC6, 0x4174, 0x7AC7, 0x7AC7, 0x25B8, 0x7AC8, 0x7AC8, 0x2260,
- 0x7AC9, 0x7AC9, 0x4175, 0x7ACA, 0x7ACA, 0x20E2, 0x7ACB, 0x7ACB, 0x09EB,
- 0x7ACC, 0x7AD5, 0x4176, 0x7AD6, 0x7AD6, 0x0D91, 0x7AD7, 0x7AD8, 0x4180,
- 0x7AD9, 0x7AD9, 0x115F, 0x7ADA, 0x7ADD, 0x4182, 0x7ADE, 0x7ADE, 0x08E9,
- 0x7ADF, 0x7ADF, 0x08E8, 0x7AE0, 0x7AE0, 0x1163, 0x7AE1, 0x7AE2, 0x4186,
- 0x7AE3, 0x7AE3, 0x092F, 0x7AE4, 0x7AE4, 0x4188, 0x7AE5, 0x7AE5, 0x0E60,
- 0x7AE6, 0x7AE6, 0x1B99, 0x7AE7, 0x7AE9, 0x4189, 0x7AEA, 0x7AEA, 0x2141,
- 0x7AEB, 0x7AEC, 0x418C, 0x7AED, 0x7AED, 0x08B0, 0x7AEE, 0x7AEE, 0x418E,
- 0x7AEF, 0x7AEF, 0x060A, 0x7AF0, 0x7AF5, 0x418F, 0x7AF6, 0x7AF6, 0x1FC7,
- 0x7AF7, 0x7AF8, 0x4195, 0x7AF9, 0x7AF9, 0x11F0, 0x7AFA, 0x7AFA, 0x1C63,
- 0x7AFB, 0x7AFC, 0x4197, 0x7AFD, 0x7AFD, 0x1C64, 0x7AFE, 0x7AFE, 0x4199,
- 0x7AFF, 0x7AFF, 0x06C8, 0x7B00, 0x7B02, 0x419A, 0x7B03, 0x7B04, 0x1C66,
- 0x7B05, 0x7B05, 0x419D, 0x7B06, 0x7B06, 0x03D5, 0x7B07, 0x7B07, 0x419E,
- 0x7B08, 0x7B08, 0x1C65, 0x7B09, 0x7B09, 0x419F, 0x7B0A, 0x7B0A, 0x1C69,
- 0x7B0B, 0x7B0B, 0x0DE6, 0x7B0C, 0x7B0E, 0x41A0, 0x7B0F, 0x7B0F, 0x1C6B,
- 0x7B10, 0x7B10, 0x41A3, 0x7B11, 0x7B11, 0x0F71, 0x7B12, 0x7B13, 0x41A4,
- 0x7B14, 0x7B14, 0x0433, 0x7B15, 0x7B15, 0x1C68, 0x7B16, 0x7B18, 0x41A6,
- 0x7B19, 0x7B19, 0x1C6F, 0x7B1A, 0x7B1A, 0x41A9, 0x7B1B, 0x7B1B, 0x05B2,
- 0x7B1C, 0x7B1D, 0x41AA, 0x7B1E, 0x7B1E, 0x1C77, 0x7B1F, 0x7B1F, 0x41AC,
- 0x7B20, 0x7B20, 0x1C72, 0x7B21, 0x7B23, 0x41AD, 0x7B24, 0x7B24, 0x1C74,
- 0x7B25, 0x7B25, 0x1C73, 0x7B26, 0x7B26, 0x0698, 0x7B27, 0x7B27, 0x41B0,
- 0x7B28, 0x7B28, 0x0428, 0x7B29, 0x7B29, 0x41B1, 0x7B2A, 0x7B2A, 0x1C6E,
- 0x7B2B, 0x7B2B, 0x1C6A, 0x7B2C, 0x7B2C, 0x05BB, 0x7B2D, 0x7B2D, 0x41B2,
- 0x7B2E, 0x7B2E, 0x1C70, 0x7B2F, 0x7B30, 0x41B3, 0x7B31, 0x7B31, 0x1C71,
- 0x7B32, 0x7B32, 0x41B5, 0x7B33, 0x7B33, 0x1C75, 0x7B34, 0x7B37, 0x41B6,
- 0x7B38, 0x7B38, 0x1C6D, 0x7B39, 0x7B39, 0x41BA, 0x7B3A, 0x7B3A, 0x0856,
- 0x7B3B, 0x7B3B, 0x41BB, 0x7B3C, 0x7B3C, 0x0A46, 0x7B3D, 0x7B3D, 0x41BC,
- 0x7B3E, 0x7B3E, 0x1C76, 0x7B3F, 0x7B44, 0x41BD, 0x7B45, 0x7B45, 0x1C7A,
- 0x7B46, 0x7B46, 0x1E41, 0x7B47, 0x7B47, 0x1C6C, 0x7B48, 0x7B48, 0x41C3,
- 0x7B49, 0x7B49, 0x05A9, 0x7B4A, 0x7B4A, 0x41C4, 0x7B4B, 0x7B4B, 0x08BF,
- 0x7B4C, 0x7B4C, 0x1C7C, 0x7B4D, 0x7B4E, 0x41C5, 0x7B4F, 0x7B4F, 0x0641,
- 0x7B50, 0x7B50, 0x097D, 0x7B51, 0x7B51, 0x11FD, 0x7B52, 0x7B52, 0x0E63,
- 0x7B53, 0x7B53, 0x41C7, 0x7B54, 0x7B54, 0x0573, 0x7B55, 0x7B55, 0x41C8,
- 0x7B56, 0x7B56, 0x04A6, 0x7B57, 0x7B57, 0x41C9, 0x7B58, 0x7B58, 0x1C78,
- 0x7B59, 0x7B59, 0x41CA, 0x7B5A, 0x7B5A, 0x1C79, 0x7B5B, 0x7B5B, 0x0CF1,
- 0x7B5C, 0x7B5C, 0x41CB, 0x7B5D, 0x7B5D, 0x1C7D, 0x7B5E, 0x7B5F, 0x41CC,
- 0x7B60, 0x7B60, 0x1C7E, 0x7B61, 0x7B61, 0x41CE, 0x7B62, 0x7B62, 0x1C81,
- 0x7B63, 0x7B66, 0x41CF, 0x7B67, 0x7B67, 0x25E4, 0x7B68, 0x7B6D, 0x41D3,
- 0x7B6E, 0x7B6E, 0x1C7F, 0x7B6F, 0x7B70, 0x41D9, 0x7B71, 0x7B71, 0x1C83,
- 0x7B72, 0x7B72, 0x1C82, 0x7B73, 0x7B74, 0x41DB, 0x7B75, 0x7B75, 0x1C7B,
- 0x7B76, 0x7B76, 0x41DD, 0x7B77, 0x7B77, 0x0977, 0x7B78, 0x7B78, 0x41DE,
- 0x7B79, 0x7B79, 0x0514, 0x7B7A, 0x7B7A, 0x41DF, 0x7B7B, 0x7B7B, 0x1C80,
- 0x7B7C, 0x7B7D, 0x41E0, 0x7B7E, 0x7B7E, 0x0C26, 0x7B7F, 0x7B7F, 0x41E2,
- 0x7B80, 0x7B80, 0x0865, 0x7B81, 0x7B84, 0x41E3, 0x7B85, 0x7B85, 0x1C8B,
- 0x7B86, 0x7B8A, 0x41E7, 0x7B8B, 0x7B8B, 0x1F86, 0x7B8C, 0x7B8C, 0x41EC,
- 0x7B8D, 0x7B8D, 0x0718, 0x7B8E, 0x7B8F, 0x41ED, 0x7B90, 0x7B90, 0x1C84,
- 0x7B91, 0x7B93, 0x41EF, 0x7B94, 0x7B94, 0x0474, 0x7B95, 0x7B95, 0x0813,
- 0x7B96, 0x7B96, 0x41F2, 0x7B97, 0x7B97, 0x0DD8, 0x7B98, 0x7B9B, 0x41F3,
- 0x7B9C, 0x7B9C, 0x1C8D, 0x7B9D, 0x7B9D, 0x1C89, 0x7B9E, 0x7BA0, 0x41F7,
- 0x7BA1, 0x7BA1, 0x0735, 0x7BA2, 0x7BA2, 0x1C8E, 0x7BA3, 0x7BA5, 0x41FA,
- 0x7BA6, 0x7BA7, 0x1C85, 0x7BA8, 0x7BA8, 0x1C8A, 0x7BA9, 0x7BA9, 0x0A88,
- 0x7BAA, 0x7BAA, 0x1C8C, 0x7BAB, 0x7BAB, 0x1C8F, 0x7BAC, 0x7BAC, 0x1C88,
- 0x7BAD, 0x7BAD, 0x0870, 0x7BAE, 0x7BB0, 0x41FD, 0x7BB1, 0x7BB1, 0x0F51,
- 0x7BB2, 0x7BB3, 0x4200, 0x7BB4, 0x7BB4, 0x1C90, 0x7BB5, 0x7BB7, 0x4202,
- 0x7BB8, 0x7BB8, 0x1C87, 0x7BB9, 0x7BBF, 0x4205, 0x7BC0, 0x7BC0, 0x1FB3,
- 0x7BC1, 0x7BC1, 0x1C92, 0x7BC2, 0x7BC3, 0x420C, 0x7BC4, 0x7BC4, 0x1EEF,
- 0x7BC5, 0x7BC5, 0x420E, 0x7BC6, 0x7BC6, 0x120A, 0x7BC7, 0x7BC7, 0x0BC9,
- 0x7BC8, 0x7BC8, 0x420F, 0x7BC9, 0x7BC9, 0x22A4, 0x7BCA, 0x7BCA, 0x4210,
- 0x7BCB, 0x7BCB, 0x25E8, 0x7BCC, 0x7BCC, 0x1C93, 0x7BCD, 0x7BD0, 0x4211,
- 0x7BD1, 0x7BD1, 0x1C91, 0x7BD2, 0x7BD2, 0x4215, 0x7BD3, 0x7BD3, 0x0A4F,
- 0x7BD4, 0x7BD8, 0x4216, 0x7BD9, 0x7BD9, 0x06D8, 0x7BDA, 0x7BDA, 0x1C95,
- 0x7BDB, 0x7BDC, 0x421B, 0x7BDD, 0x7BDD, 0x1C94, 0x7BDE, 0x7BE0, 0x421D,
- 0x7BE1, 0x7BE1, 0x055E, 0x7BE2, 0x7BE3, 0x4220, 0x7BE4, 0x7BE4, 0x25E3,
- 0x7BE5, 0x7BE6, 0x1C96, 0x7BE7, 0x7BE8, 0x4222, 0x7BE9, 0x7BE9, 0x2111,
- 0x7BEA, 0x7BEA, 0x1C98, 0x7BEB, 0x7BED, 0x4224, 0x7BEE, 0x7BEE, 0x09A5,
- 0x7BEF, 0x7BF0, 0x4227, 0x7BF1, 0x7BF1, 0x09D4, 0x7BF2, 0x7BF2, 0x4229,
- 0x7BF3, 0x7BF3, 0x25E6, 0x7BF4, 0x7BF6, 0x422A, 0x7BF7, 0x7BF7, 0x0BB2,
- 0x7BF8, 0x7BFB, 0x422D, 0x7BFC, 0x7BFC, 0x1C9B, 0x7BFD, 0x7BFD, 0x4231,
- 0x7BFE, 0x7BFE, 0x1C9A, 0x7BFF, 0x7BFF, 0x4232, 0x7C00, 0x7C00, 0x25E7,
- 0x7C01, 0x7C06, 0x4233, 0x7C07, 0x7C07, 0x055B, 0x7C08, 0x7C0A, 0x4239,
- 0x7C0B, 0x7C0B, 0x1C9E, 0x7C0C, 0x7C0C, 0x1C99, 0x7C0D, 0x7C0D, 0x2041,
- 0x7C0E, 0x7C0E, 0x423C, 0x7C0F, 0x7C0F, 0x1C9C, 0x7C10, 0x7C15, 0x423D,
- 0x7C16, 0x7C16, 0x1C9D, 0x7C17, 0x7C1D, 0x4243, 0x7C1E, 0x7C1E, 0x25EA,
- 0x7C1F, 0x7C1F, 0x1C9F, 0x7C20, 0x7C20, 0x424A, 0x7C21, 0x7C21, 0x1F8F,
- 0x7C22, 0x7C22, 0x424B, 0x7C23, 0x7C23, 0x25EC, 0x7C24, 0x7C25, 0x424C,
- 0x7C26, 0x7C26, 0x1CA1, 0x7C27, 0x7C27, 0x07DE, 0x7C28, 0x7C29, 0x424E,
- 0x7C2A, 0x7C2A, 0x1CA0, 0x7C2B, 0x7C2B, 0x25EB, 0x7C2C, 0x7C37, 0x4250,
- 0x7C38, 0x7C38, 0x1CA2, 0x7C39, 0x7C3C, 0x425C, 0x7C3D, 0x7C3D, 0x20D0,
- 0x7C3E, 0x7C3E, 0x201D, 0x7C3F, 0x7C3F, 0x0485, 0x7C40, 0x7C40, 0x1CA4,
- 0x7C41, 0x7C41, 0x1CA3, 0x7C42, 0x7C42, 0x4260, 0x7C43, 0x7C43, 0x1FF7,
- 0x7C44, 0x7C4B, 0x4261, 0x7C4C, 0x7C4C, 0x1E8D, 0x7C4D, 0x7C4D, 0x0821,
- 0x7C4E, 0x7C5B, 0x4269, 0x7C5C, 0x7C5C, 0x25E9, 0x7C5D, 0x7C5E, 0x4277,
- 0x7C5F, 0x7C5F, 0x25EE, 0x7C60, 0x7C60, 0x203A, 0x7C61, 0x7C63, 0x4279,
- 0x7C64, 0x7C64, 0x2693, 0x7C65, 0x7C68, 0x427C, 0x7C69, 0x7C69, 0x25E5,
- 0x7C6A, 0x7C6A, 0x25ED, 0x7C6B, 0x7C6B, 0x4280, 0x7C6C, 0x7C6C, 0x2009,
- 0x7C6D, 0x7C6D, 0x4281, 0x7C6E, 0x7C6E, 0x2065, 0x7C6F, 0x7C71, 0x4282,
- 0x7C72, 0x7C72, 0x26A3, 0x7C73, 0x7C73, 0x0ADC, 0x7C74, 0x7C74, 0x12F5,
- 0x7C75, 0x7C7A, 0x4285, 0x7C7B, 0x7C7B, 0x09CB, 0x7C7C, 0x7C7C, 0x1CCA,
- 0x7C7D, 0x7C7D, 0x122E, 0x7C7E, 0x7C88, 0x428B, 0x7C89, 0x7C89, 0x0678,
- 0x7C8A, 0x7C90, 0x4296, 0x7C91, 0x7C91, 0x1CCC, 0x7C92, 0x7C92, 0x09EC,
- 0x7C93, 0x7C94, 0x429D, 0x7C95, 0x7C95, 0x0BE8, 0x7C96, 0x7C96, 0x429F,
- 0x7C97, 0x7C97, 0x0559, 0x7C98, 0x7C98, 0x1154, 0x7C99, 0x7C9B, 0x42A0,
- 0x7C9C, 0x7C9C, 0x1CCE, 0x7C9D, 0x7C9D, 0x1CCD, 0x7C9E, 0x7C9E, 0x1CCF,
- 0x7C9F, 0x7C9F, 0x0DCF, 0x7CA0, 0x7CA1, 0x42A3, 0x7CA2, 0x7CA2, 0x1CD0,
- 0x7CA3, 0x7CA3, 0x42A5, 0x7CA4, 0x7CA4, 0x1104, 0x7CA5, 0x7CA5, 0x11DF,
- 0x7CA6, 0x7CA9, 0x42A6, 0x7CAA, 0x7CAA, 0x067D, 0x7CAB, 0x7CAD, 0x42AA,
- 0x7CAE, 0x7CAE, 0x0A01, 0x7CAF, 0x7CB0, 0x42AD, 0x7CB1, 0x7CB1, 0x0A04,
- 0x7CB2, 0x7CB2, 0x1CD1, 0x7CB3, 0x7CB3, 0x08DB, 0x7CB4, 0x7CB8, 0x42AF,
- 0x7CB9, 0x7CB9, 0x0565, 0x7CBA, 0x7CBB, 0x42B4, 0x7CBC, 0x7CBD, 0x1CD2,
- 0x7CBE, 0x7CBE, 0x08DA, 0x7CBF, 0x7CC0, 0x42B6, 0x7CC1, 0x7CC1, 0x1CD4,
- 0x7CC2, 0x7CC4, 0x42B8, 0x7CC5, 0x7CC5, 0x1CD9, 0x7CC6, 0x7CC6, 0x42BB,
- 0x7CC7, 0x7CC7, 0x1CD5, 0x7CC8, 0x7CC8, 0x1CD8, 0x7CC9, 0x7CC9, 0x42BC,
- 0x7CCA, 0x7CCA, 0x07B4, 0x7CCB, 0x7CCB, 0x42BD, 0x7CCC, 0x7CCD, 0x1CD6,
- 0x7CCE, 0x7CD4, 0x42BE, 0x7CD5, 0x7CD5, 0x06DD, 0x7CD6, 0x7CD6, 0x0E1A,
- 0x7CD7, 0x7CD7, 0x1CDA, 0x7CD8, 0x7CD8, 0x42C5, 0x7CD9, 0x7CD9, 0x04A1,
- 0x7CDA, 0x7CDB, 0x42C6, 0x7CDC, 0x7CDC, 0x0AD8, 0x7CDD, 0x7CDD, 0x25F5,
- 0x7CDE, 0x7CDE, 0x1EFC, 0x7CDF, 0x7CDF, 0x1126, 0x7CE0, 0x7CE0, 0x0944,
- 0x7CE1, 0x7CE6, 0x42C8, 0x7CE7, 0x7CE7, 0x2024, 0x7CE8, 0x7CE8, 0x1CDB,
- 0x7CE9, 0x7CEE, 0x42CE, 0x7CEF, 0x7CEF, 0x0B75, 0x7CF0, 0x7CF0, 0x269B,
- 0x7CF1, 0x7CF1, 0x42D4, 0x7CF2, 0x7CF2, 0x25F3, 0x7CF3, 0x7CF3, 0x42D5,
- 0x7CF4, 0x7CF4, 0x22D9, 0x7CF5, 0x7CF5, 0x42D6, 0x7CF6, 0x7CF6, 0x25F4,
- 0x7CF7, 0x7CF7, 0x42D7, 0x7CF8, 0x7CF8, 0x1CE7, 0x7CF9, 0x7CF9, 0x241B,
- 0x7CFA, 0x7CFA, 0x42D8, 0x7CFB, 0x7CFB, 0x0F22, 0x7CFC, 0x7CFD, 0x42D9,
- 0x7CFE, 0x7CFE, 0x1FC8, 0x7CFF, 0x7CFF, 0x42DB, 0x7D00, 0x7D00, 0x1F7B,
- 0x7D01, 0x7D01, 0x42DC, 0x7D02, 0x7D02, 0x241D, 0x7D03, 0x7D03, 0x42DD,
- 0x7D04, 0x7D04, 0x224C, 0x7D05, 0x7D05, 0x1F48, 0x7D06, 0x7D06, 0x241C,
- 0x7D07, 0x7D08, 0x241E, 0x7D09, 0x7D09, 0x20FF, 0x7D0A, 0x7D0A, 0x0ED8,
- 0x7D0B, 0x7D0B, 0x219A, 0x7D0C, 0x7D0C, 0x42DE, 0x7D0D, 0x7D0D, 0x2091,
- 0x7D0E, 0x7D0F, 0x42DF, 0x7D10, 0x7D10, 0x20A7, 0x7D11, 0x7D12, 0x42E1,
- 0x7D13, 0x7D13, 0x2423, 0x7D14, 0x7D14, 0x1E9B, 0x7D15, 0x7D15, 0x2422,
- 0x7D16, 0x7D16, 0x42E3, 0x7D17, 0x7D17, 0x2110, 0x7D18, 0x7D18, 0x42E4,
- 0x7D19, 0x7D19, 0x228D, 0x7D1A, 0x7D1A, 0x1F71, 0x7D1B, 0x7D1B, 0x1EF8,
- 0x7D1C, 0x7D1C, 0x2421, 0x7D1D, 0x7D1F, 0x42E5, 0x7D20, 0x7D20, 0x0DCD,
- 0x7D21, 0x7D21, 0x1EF3, 0x7D22, 0x7D22, 0x0DEC, 0x7D23, 0x7D26, 0x42E8,
- 0x7D27, 0x7D27, 0x08C5, 0x7D28, 0x7D2A, 0x42EC, 0x7D2B, 0x7D2B, 0x122C,
- 0x7D2C, 0x7D2E, 0x42EF, 0x7D2F, 0x7D2F, 0x09C6, 0x7D30, 0x7D30, 0x21B1,
- 0x7D31, 0x7D31, 0x2426, 0x7D32, 0x7D32, 0x2425, 0x7D33, 0x7D33, 0x2120,
- 0x7D34, 0x7D38, 0x42F2, 0x7D39, 0x7D39, 0x211A, 0x7D3A, 0x7D3A, 0x2424,
- 0x7D3B, 0x7D3B, 0x42F7, 0x7D3C, 0x7D3C, 0x2428, 0x7D3D, 0x7D3E, 0x42F8,
- 0x7D3F, 0x7D3F, 0x242A, 0x7D40, 0x7D40, 0x2429, 0x7D41, 0x7D41, 0x42FA,
- 0x7D42, 0x7D42, 0x2294, 0x7D43, 0x7D43, 0x42FB, 0x7D44, 0x7D44, 0x22BE,
- 0x7D45, 0x7D45, 0x42FC, 0x7D46, 0x7D46, 0x1E31, 0x7D47, 0x7D4D, 0x42FD,
- 0x7D4E, 0x7D4E, 0x242C, 0x7D4F, 0x7D4F, 0x4304, 0x7D50, 0x7D50, 0x1FB5,
- 0x7D51, 0x7D5C, 0x4305, 0x7D5D, 0x7D5D, 0x242B, 0x7D5E, 0x7D5E, 0x1FAF,
- 0x7D5F, 0x7D60, 0x4311, 0x7D61, 0x7D61, 0x2068, 0x7D62, 0x7D62, 0x21E4,
- 0x7D63, 0x7D65, 0x4313, 0x7D66, 0x7D66, 0x1F21, 0x7D67, 0x7D67, 0x4316,
- 0x7D68, 0x7D68, 0x2101, 0x7D69, 0x7D6D, 0x4317, 0x7D6E, 0x7D6E, 0x0FC0,
- 0x7D6F, 0x7D70, 0x431C, 0x7D71, 0x7D71, 0x217C, 0x7D72, 0x7D72, 0x214A,
- 0x7D73, 0x7D73, 0x242D, 0x7D74, 0x7D75, 0x431E, 0x7D76, 0x7D76, 0x1FD4,
- 0x7D77, 0x7D77, 0x1CE8, 0x7D78, 0x7D78, 0x4320, 0x7D79, 0x7D79, 0x1FD1,
- 0x7D7A, 0x7D80, 0x4321, 0x7D81, 0x7D81, 0x1E33, 0x7D82, 0x7D82, 0x4328,
- 0x7D83, 0x7D83, 0x242F, 0x7D84, 0x7D85, 0x4329, 0x7D86, 0x7D86, 0x242E,
- 0x7D87, 0x7D87, 0x432B, 0x7D88, 0x7D88, 0x2430, 0x7D89, 0x7D89, 0x21DB,
- 0x7D8A, 0x7D8E, 0x432C, 0x7D8F, 0x7D8F, 0x2158, 0x7D90, 0x7D92, 0x4331,
- 0x7D93, 0x7D93, 0x1FC2, 0x7D94, 0x7D9B, 0x4334, 0x7D9C, 0x7D9C, 0x22B9,
- 0x7D9D, 0x7D9D, 0x433C, 0x7D9E, 0x7D9E, 0x2436, 0x7D9F, 0x7DA1, 0x433D,
- 0x7DA2, 0x7DA2, 0x1E8E, 0x7DA3, 0x7DA3, 0x2439, 0x7DA4, 0x7DA5, 0x4340,
- 0x7DA6, 0x7DA6, 0x1CE9, 0x7DA7, 0x7DAA, 0x4342, 0x7DAB, 0x7DAB, 0x21C5,
- 0x7DAC, 0x7DAC, 0x2437, 0x7DAD, 0x7DAD, 0x2192, 0x7DAE, 0x7DAE, 0x1CEA,
- 0x7DAF, 0x7DAF, 0x4346, 0x7DB0, 0x7DB0, 0x243A, 0x7DB1, 0x7DB1, 0x1F19,
- 0x7DB2, 0x7DB2, 0x218C, 0x7DB3, 0x7DB3, 0x1E40, 0x7DB4, 0x7DB4, 0x22B3,
- 0x7DB5, 0x7DB7, 0x4347, 0x7DB8, 0x7DB8, 0x205F, 0x7DB9, 0x7DB9, 0x2438,
- 0x7DBA, 0x7DBA, 0x2432, 0x7DBB, 0x7DBB, 0x2274, 0x7DBC, 0x7DBC, 0x434A,
- 0x7DBD, 0x7DBD, 0x1E9C, 0x7DBE, 0x7DBE, 0x2431, 0x7DBF, 0x7DBF, 0x2085,
- 0x7DC0, 0x7DC3, 0x434B, 0x7DC4, 0x7DC4, 0x2435, 0x7DC5, 0x7DC6, 0x434F,
- 0x7DC7, 0x7DC7, 0x243B, 0x7DC8, 0x7DC9, 0x4351, 0x7DCA, 0x7DCA, 0x1FB7,
- 0x7DCB, 0x7DCB, 0x2433, 0x7DCC, 0x7DD0, 0x4353, 0x7DD1, 0x7DD1, 0x2054,
- 0x7DD2, 0x7DD2, 0x21DE, 0x7DD3, 0x7DD3, 0x4358, 0x7DD4, 0x7DD4, 0x2434,
- 0x7DD5, 0x7DD6, 0x4359, 0x7DD7, 0x7DD7, 0x243D, 0x7DD8, 0x7DD8, 0x1F89,
- 0x7DD9, 0x7DD9, 0x243C, 0x7DDA, 0x7DDC, 0x435B, 0x7DDD, 0x7DDD, 0x1F6E,
- 0x7DDE, 0x7DDE, 0x1ED8, 0x7DDF, 0x7DDF, 0x435E, 0x7DE0, 0x7DE0, 0x1EBF,
- 0x7DE1, 0x7DE1, 0x2445, 0x7DE2, 0x7DE2, 0x435F, 0x7DE3, 0x7DE3, 0x2249,
- 0x7DE4, 0x7DE5, 0x4360, 0x7DE6, 0x7DE6, 0x2441, 0x7DE7, 0x7DE7, 0x4362,
- 0x7DE8, 0x7DE8, 0x1E47, 0x7DE9, 0x7DE9, 0x1F56, 0x7DEA, 0x7DEB, 0x4363,
- 0x7DEC, 0x7DEC, 0x2086, 0x7DED, 0x7DEE, 0x4365, 0x7DEF, 0x7DEF, 0x2196,
- 0x7DF0, 0x7DF0, 0x4367, 0x7DF1, 0x7DF1, 0x2443, 0x7DF2, 0x7DF2, 0x243F,
- 0x7DF3, 0x7DF3, 0x4368, 0x7DF4, 0x7DF4, 0x2023, 0x7DF5, 0x7DF5, 0x4369,
- 0x7DF6, 0x7DF6, 0x2442, 0x7DF7, 0x7DF8, 0x436A, 0x7DF9, 0x7DF9, 0x243E,
- 0x7DFA, 0x7DFA, 0x436C, 0x7DFB, 0x7DFB, 0x26A6, 0x7DFC, 0x7DFF, 0x436D,
- 0x7E00, 0x7E07, 0x4371, 0x7E08, 0x7E08, 0x234E, 0x7E09, 0x7E09, 0x2446,
- 0x7E0A, 0x7E0A, 0x244B, 0x7E0B, 0x7E0B, 0x2444, 0x7E0C, 0x7E0F, 0x4379,
- 0x7E10, 0x7E10, 0x2427, 0x7E11, 0x7E11, 0x244C, 0x7E12, 0x7E1A, 0x437D,
- 0x7E1B, 0x7E1B, 0x1F0F, 0x7E1C, 0x7E1C, 0x4386, 0x7E1D, 0x7E1D, 0x2447,
- 0x7E1E, 0x7E1E, 0x2449, 0x7E1F, 0x7E1F, 0x2448, 0x7E20, 0x7E22, 0x4387,
- 0x7E23, 0x7E23, 0x21C2, 0x7E24, 0x7E26, 0x438A, 0x7E27, 0x7E27, 0x216E,
- 0x7E28, 0x7E2A, 0x438D, 0x7E2B, 0x7E2B, 0x1F03, 0x7E2C, 0x7E2C, 0x4390,
- 0x7E2D, 0x7E2D, 0x244A, 0x7E2E, 0x7E2E, 0x215C, 0x7E2F, 0x7E30, 0x4391,
- 0x7E31, 0x7E31, 0x22BB, 0x7E32, 0x7E32, 0x2450, 0x7E33, 0x7E33, 0x4393,
- 0x7E34, 0x7E34, 0x2694, 0x7E35, 0x7E35, 0x244F, 0x7E36, 0x7E36, 0x25F6,
- 0x7E37, 0x7E37, 0x2051, 0x7E38, 0x7E38, 0x4394, 0x7E39, 0x7E39, 0x244E,
- 0x7E3A, 0x7E3A, 0x4395, 0x7E3B, 0x7E3B, 0x1DFB, 0x7E3C, 0x7E3C, 0x4396,
- 0x7E3D, 0x7E3D, 0x22BA, 0x7E3E, 0x7E3E, 0x1F6D, 0x7E3F, 0x7E40, 0x4397,
- 0x7E41, 0x7E41, 0x064E, 0x7E42, 0x7E44, 0x4399, 0x7E45, 0x7E45, 0x2452,
- 0x7E46, 0x7E46, 0x2451, 0x7E47, 0x7E47, 0x1CEB, 0x7E48, 0x7E51, 0x439C,
- 0x7E52, 0x7E52, 0x2455, 0x7E53, 0x7E53, 0x43A6, 0x7E54, 0x7E54, 0x2289,
- 0x7E55, 0x7E55, 0x2116, 0x7E56, 0x7E59, 0x43A7, 0x7E5A, 0x7E5A, 0x2454,
- 0x7E5B, 0x7E5D, 0x43AB, 0x7E5E, 0x7E5E, 0x20FB, 0x7E5F, 0x7E61, 0x43AE,
- 0x7E62, 0x7E62, 0x2440, 0x7E63, 0x7E68, 0x43B1, 0x7E69, 0x7E69, 0x2126,
- 0x7E6A, 0x7E6A, 0x1F61, 0x7E6B, 0x7E6B, 0x269D, 0x7E6C, 0x7E6C, 0x43B7,
- 0x7E6D, 0x7E6D, 0x1F8A, 0x7E6E, 0x7E6E, 0x2456, 0x7E6F, 0x7E6F, 0x2459,
- 0x7E70, 0x7E70, 0x2458, 0x7E71, 0x7E72, 0x43B8, 0x7E73, 0x7E73, 0x1FAE,
- 0x7E74, 0x7E78, 0x43BA, 0x7E79, 0x7E79, 0x221A, 0x7E7A, 0x7E7B, 0x43BF,
- 0x7E7C, 0x7E7C, 0x1F7A, 0x7E7D, 0x7E7D, 0x244D, 0x7E7E, 0x7E7E, 0x2457,
- 0x7E7F, 0x7E81, 0x43C1, 0x7E82, 0x7E82, 0x1248, 0x7E83, 0x7E87, 0x43C4,
- 0x7E88, 0x7E88, 0x2453, 0x7E89, 0x7E89, 0x43C9, 0x7E8A, 0x7E8A, 0x2420,
- 0x7E8B, 0x7E8B, 0x43CA, 0x7E8C, 0x7E8C, 0x21DF, 0x7E8D, 0x7E8D, 0x2685,
- 0x7E8E, 0x7E8E, 0x43CB, 0x7E8F, 0x7E8F, 0x1E6E, 0x7E90, 0x7E92, 0x43CC,
- 0x7E93, 0x7E93, 0x2224, 0x7E94, 0x7E94, 0x2670, 0x7E95, 0x7E95, 0x43CF,
- 0x7E96, 0x7E96, 0x21BA, 0x7E97, 0x7E97, 0x43D0, 0x7E98, 0x7E98, 0x245A,
- 0x7E99, 0x7E9A, 0x43D1, 0x7E9B, 0x7E9B, 0x1CEC, 0x7E9C, 0x7E9C, 0x1FFF,
- 0x7E9D, 0x7E9E, 0x43D3, 0x7E9F, 0x7E9F, 0x17D3, 0x7EA0, 0x7EA0, 0x08EF,
- 0x7EA1, 0x7EA1, 0x17D4, 0x7EA2, 0x7EA2, 0x07A3, 0x7EA3, 0x7EA3, 0x17D5,
- 0x7EA4, 0x7EA4, 0x0F38, 0x7EA5, 0x7EA5, 0x17D6, 0x7EA6, 0x7EA6, 0x10FF,
- 0x7EA7, 0x7EA7, 0x0829, 0x7EA8, 0x7EA9, 0x17D7, 0x7EAA, 0x7EAA, 0x0840,
- 0x7EAB, 0x7EAB, 0x0CAD, 0x7EAC, 0x7EAC, 0x0EC2, 0x7EAD, 0x7EAD, 0x17D9,
- 0x7EAE, 0x7EAE, 0x43D5, 0x7EAF, 0x7EAF, 0x0542, 0x7EB0, 0x7EB0, 0x17DA,
- 0x7EB1, 0x7EB1, 0x0CED, 0x7EB2, 0x7EB2, 0x06D4, 0x7EB3, 0x7EB3, 0x0B2C,
- 0x7EB4, 0x7EB4, 0x43D6, 0x7EB5, 0x7EB5, 0x123A, 0x7EB6, 0x7EB6, 0x0A81,
- 0x7EB7, 0x7EB7, 0x0674, 0x7EB8, 0x7EB8, 0x11BC, 0x7EB9, 0x7EB9, 0x0ED5,
- 0x7EBA, 0x7EBA, 0x0661, 0x7EBB, 0x7EBC, 0x43D7, 0x7EBD, 0x7EBD, 0x0B67,
- 0x7EBE, 0x7EBE, 0x17DB, 0x7EBF, 0x7EBF, 0x0F4C, 0x7EC0, 0x7EC2, 0x17DC,
- 0x7EC3, 0x7EC3, 0x0A00, 0x7EC4, 0x7EC4, 0x1246, 0x7EC5, 0x7EC5, 0x0D29,
- 0x7EC6, 0x7EC6, 0x0F25, 0x7EC7, 0x7EC7, 0x11AE, 0x7EC8, 0x7EC8, 0x11D4,
- 0x7EC9, 0x7EC9, 0x17DF, 0x7ECA, 0x7ECA, 0x03F8, 0x7ECB, 0x7ECC, 0x17E0,
- 0x7ECD, 0x7ECD, 0x0D15, 0x7ECE, 0x7ECE, 0x1076, 0x7ECF, 0x7ECF, 0x08DC,
- 0x7ED0, 0x7ED0, 0x17E2, 0x7ED1, 0x7ED1, 0x03FE, 0x7ED2, 0x7ED2, 0x0CB9,
- 0x7ED3, 0x7ED3, 0x08B2, 0x7ED4, 0x7ED4, 0x17E3, 0x7ED5, 0x7ED5, 0x0CA1,
- 0x7ED6, 0x7ED6, 0x43D9, 0x7ED7, 0x7ED7, 0x17E4, 0x7ED8, 0x7ED8, 0x07FB,
- 0x7ED9, 0x7ED9, 0x06F3, 0x7EDA, 0x7EDA, 0x0FCD, 0x7EDB, 0x7EDB, 0x17E5,
- 0x7EDC, 0x7EDC, 0x0A8E, 0x7EDD, 0x7EDD, 0x0927, 0x7EDE, 0x7EDE, 0x089B,
- 0x7EDF, 0x7EDF, 0x0E64, 0x7EE0, 0x7EE1, 0x17E6, 0x7EE2, 0x7EE2, 0x091D,
- 0x7EE3, 0x7EE3, 0x0FB0, 0x7EE4, 0x7EE4, 0x43DA, 0x7EE5, 0x7EE5, 0x0DDC,
- 0x7EE6, 0x7EE6, 0x0E23, 0x7EE7, 0x7EE7, 0x083F, 0x7EE8, 0x7EE8, 0x17E8,
- 0x7EE9, 0x7EE9, 0x081B, 0x7EEA, 0x7EEA, 0x0FC2, 0x7EEB, 0x7EEB, 0x17E9,
- 0x7EEC, 0x7EEC, 0x43DB, 0x7EED, 0x7EED, 0x0FC3, 0x7EEE, 0x7EEF, 0x17EA,
- 0x7EF0, 0x7EF0, 0x0545, 0x7EF1, 0x7EF2, 0x17EC, 0x7EF3, 0x7EF3, 0x0D37,
- 0x7EF4, 0x7EF4, 0x0EBB, 0x7EF5, 0x7EF5, 0x0AE5, 0x7EF6, 0x7EF6, 0x17EF,
- 0x7EF7, 0x7EF7, 0x042A, 0x7EF8, 0x7EF8, 0x0516, 0x7EF9, 0x7EF9, 0x43DC,
- 0x7EFA, 0x7EFB, 0x17F0, 0x7EFC, 0x7EFC, 0x1238, 0x7EFD, 0x7EFD, 0x1161,
- 0x7EFE, 0x7EFE, 0x17F2, 0x7EFF, 0x7EFF, 0x0A73, 0x7F00, 0x7F00, 0x1217,
- 0x7F01, 0x7F03, 0x17F3, 0x7F04, 0x7F04, 0x085D, 0x7F05, 0x7F05, 0x0AEA,
- 0x7F06, 0x7F06, 0x09AD, 0x7F07, 0x7F08, 0x17F6, 0x7F09, 0x7F09, 0x081C,
- 0x7F0A, 0x7F0A, 0x43DD, 0x7F0B, 0x7F0C, 0x17F8, 0x7F0D, 0x7F0D, 0x17EE,
- 0x7F0E, 0x7F0E, 0x060F, 0x7F0F, 0x7F0F, 0x17FA, 0x7F10, 0x7F10, 0x43DE,
- 0x7F11, 0x7F12, 0x17FB, 0x7F13, 0x7F13, 0x07CF, 0x7F14, 0x7F14, 0x05BF,
- 0x7F15, 0x7F15, 0x0A6D, 0x7F16, 0x7F16, 0x0449, 0x7F17, 0x7F17, 0x17FD,
- 0x7F18, 0x7F18, 0x10F8, 0x7F19, 0x7F19, 0x17FE, 0x7F1A, 0x7F1A, 0x06BA,
- 0x7F1B, 0x7F1B, 0x1800, 0x7F1C, 0x7F1C, 0x17FF, 0x7F1D, 0x7F1D, 0x0689,
- 0x7F1E, 0x7F1E, 0x43DF, 0x7F1F, 0x7F1F, 0x1801, 0x7F20, 0x7F20, 0x04BF,
- 0x7F21, 0x7F27, 0x1802, 0x7F28, 0x7F28, 0x108C, 0x7F29, 0x7F29, 0x0DEA,
- 0x7F2A, 0x7F2D, 0x1809, 0x7F2E, 0x7F2E, 0x0D02, 0x7F2F, 0x7F33, 0x180D,
- 0x7F34, 0x7F34, 0x089A, 0x7F35, 0x7F35, 0x1812, 0x7F36, 0x7F36, 0x1C5E,
- 0x7F37, 0x7F37, 0x43E0, 0x7F38, 0x7F38, 0x06D2, 0x7F39, 0x7F39, 0x43E1,
- 0x7F3A, 0x7F3A, 0x0C8C, 0x7F3B, 0x7F41, 0x43E2, 0x7F42, 0x7F42, 0x1C5F,
- 0x7F43, 0x7F43, 0x43E9, 0x7F44, 0x7F45, 0x1C60, 0x7F46, 0x7F4B, 0x43EA,
- 0x7F4C, 0x7F4C, 0x25E2, 0x7F4D, 0x7F4D, 0x43F0, 0x7F4E, 0x7F4E, 0x269A,
- 0x7F4F, 0x7F4F, 0x43F1, 0x7F50, 0x7F50, 0x0737, 0x7F51, 0x7F51, 0x0EA9,
- 0x7F52, 0x7F53, 0x43F2, 0x7F54, 0x7F54, 0x129E, 0x7F55, 0x7F55, 0x0768,
- 0x7F56, 0x7F56, 0x43F4, 0x7F57, 0x7F57, 0x0A85, 0x7F58, 0x7F58, 0x1A81,
- 0x7F59, 0x7F59, 0x43F5, 0x7F5A, 0x7F5A, 0x0640, 0x7F5B, 0x7F5E, 0x43F6,
- 0x7F5F, 0x7F5F, 0x1A83, 0x7F60, 0x7F60, 0x43FA, 0x7F61, 0x7F61, 0x1A82,
- 0x7F62, 0x7F62, 0x03E0, 0x7F63, 0x7F67, 0x43FB, 0x7F68, 0x7F68, 0x1A85,
- 0x7F69, 0x7F69, 0x1177, 0x7F6A, 0x7F6A, 0x124C, 0x7F6B, 0x7F6D, 0x4400,
- 0x7F6E, 0x7F6E, 0x11C2, 0x7F6F, 0x7F6F, 0x4403, 0x7F70, 0x7F70, 0x1EEA,
- 0x7F71, 0x7F71, 0x1A87, 0x7F72, 0x7F72, 0x0D87, 0x7F73, 0x7F73, 0x4404,
- 0x7F74, 0x7F74, 0x1A86, 0x7F75, 0x7F76, 0x4405, 0x7F77, 0x7F77, 0x1E2C,
- 0x7F78, 0x7F78, 0x4407, 0x7F79, 0x7F79, 0x1A88, 0x7F7A, 0x7F7D, 0x4408,
- 0x7F7E, 0x7F7E, 0x1A8A, 0x7F7F, 0x7F80, 0x440C, 0x7F81, 0x7F81, 0x1A89,
- 0x7F82, 0x7F84, 0x440E, 0x7F85, 0x7F85, 0x2062, 0x7F86, 0x7F86, 0x24F1,
- 0x7F87, 0x7F87, 0x4411, 0x7F88, 0x7F88, 0x24F2, 0x7F89, 0x7F89, 0x4412,
- 0x7F8A, 0x7F8A, 0x101B, 0x7F8B, 0x7F8B, 0x4413, 0x7F8C, 0x7F8C, 0x0C39,
- 0x7F8D, 0x7F8D, 0x4414, 0x7F8E, 0x7F8E, 0x0AC5, 0x7F8F, 0x7F93, 0x4415,
- 0x7F94, 0x7F94, 0x06DC, 0x7F95, 0x7F99, 0x441A, 0x7F9A, 0x7F9A, 0x0A30,
- 0x7F9B, 0x7F9C, 0x441F, 0x7F9D, 0x7F9D, 0x1CC4, 0x7F9E, 0x7F9E, 0x0FAA,
- 0x7F9F, 0x7F9F, 0x1CC5, 0x7FA0, 0x7FA0, 0x4421, 0x7FA1, 0x7FA1, 0x0F48,
- 0x7FA2, 0x7FA3, 0x4422, 0x7FA4, 0x7FA4, 0x0C95, 0x7FA5, 0x7FA5, 0x25F2,
- 0x7FA6, 0x7FA6, 0x4424, 0x7FA7, 0x7FA7, 0x1CC6, 0x7FA8, 0x7FA8, 0x4425,
- 0x7FA9, 0x7FA9, 0x2215, 0x7FAA, 0x7FAE, 0x4426, 0x7FAF, 0x7FB0, 0x1CC7,
- 0x7FB1, 0x7FB1, 0x442B, 0x7FB2, 0x7FB2, 0x1CC9, 0x7FB3, 0x7FB7, 0x442C,
- 0x7FB8, 0x7FB8, 0x130E, 0x7FB9, 0x7FB9, 0x06F9, 0x7FBA, 0x7FBB, 0x4431,
- 0x7FBC, 0x7FBC, 0x176D, 0x7FBD, 0x7FBD, 0x10D5, 0x7FBE, 0x7FBE, 0x4433,
- 0x7FBF, 0x7FBF, 0x1CDE, 0x7FC0, 0x7FC0, 0x4434, 0x7FC1, 0x7FC1, 0x0EDB,
- 0x7FC2, 0x7FC4, 0x4435, 0x7FC5, 0x7FC5, 0x0506, 0x7FC6, 0x7FC9, 0x4438,
- 0x7FCA, 0x7FCA, 0x1B98, 0x7FCB, 0x7FCB, 0x443C, 0x7FCC, 0x7FCC, 0x1075,
- 0x7FCD, 0x7FCD, 0x443D, 0x7FCE, 0x7FCE, 0x1CDF, 0x7FCF, 0x7FD1, 0x443E,
- 0x7FD2, 0x7FD2, 0x21AE, 0x7FD3, 0x7FD3, 0x4441, 0x7FD4, 0x7FD4, 0x0F55,
- 0x7FD5, 0x7FD5, 0x1CE0, 0x7FD6, 0x7FD7, 0x4442, 0x7FD8, 0x7FD8, 0x0C49,
- 0x7FD9, 0x7FDE, 0x4444, 0x7FDF, 0x7FDF, 0x05B5, 0x7FE0, 0x7FE0, 0x0567,
- 0x7FE1, 0x7FE1, 0x1CE2, 0x7FE2, 0x7FE4, 0x444A, 0x7FE5, 0x7FE5, 0x1CE1,
- 0x7FE6, 0x7FE6, 0x1CE3, 0x7FE7, 0x7FE8, 0x444D, 0x7FE9, 0x7FE9, 0x1CE4,
- 0x7FEA, 0x7FED, 0x444F, 0x7FEE, 0x7FEE, 0x1CE5, 0x7FEF, 0x7FEF, 0x4453,
- 0x7FF0, 0x7FF0, 0x0769, 0x7FF1, 0x7FF1, 0x03CA, 0x7FF2, 0x7FF2, 0x4454,
- 0x7FF3, 0x7FF3, 0x1CE6, 0x7FF4, 0x7FF8, 0x4455, 0x7FF9, 0x7FF9, 0x20E0,
- 0x7FFA, 0x7FFA, 0x445A, 0x7FFB, 0x7FFB, 0x064A, 0x7FFC, 0x7FFC, 0x1074,
- 0x7FFD, 0x7FFF, 0x445B, 0x8000, 0x8000, 0x1032, 0x8001, 0x8001, 0x09BA,
- 0x8002, 0x8002, 0x445E, 0x8003, 0x8003, 0x0949, 0x8004, 0x8004, 0x1953,
- 0x8005, 0x8005, 0x1180, 0x8006, 0x8006, 0x191A, 0x8007, 0x800A, 0x445F,
- 0x800B, 0x800B, 0x1BD7, 0x800C, 0x800C, 0x0637, 0x800D, 0x800D, 0x0D98,
- 0x800E, 0x800F, 0x4463, 0x8010, 0x8010, 0x0B30, 0x8011, 0x8011, 0x4465,
- 0x8012, 0x8012, 0x1BCB, 0x8013, 0x8013, 0x4466, 0x8014, 0x8014, 0x1BCC,
- 0x8015, 0x8015, 0x06F6, 0x8016, 0x8016, 0x1BCD, 0x8017, 0x8017, 0x077B,
- 0x8018, 0x8018, 0x1108, 0x8019, 0x8019, 0x03DD, 0x801A, 0x801B, 0x4467,
- 0x801C, 0x801C, 0x1BCE, 0x801D, 0x801F, 0x4469, 0x8020, 0x8020, 0x1BCF,
- 0x8021, 0x8021, 0x446C, 0x8022, 0x8022, 0x1BD0, 0x8023, 0x8024, 0x446D,
- 0x8025, 0x8027, 0x1BD1, 0x8028, 0x8028, 0x1BD5, 0x8029, 0x8029, 0x1BD4,
- 0x802A, 0x802A, 0x0B96, 0x802B, 0x802B, 0x446F, 0x802C, 0x802C, 0x25C2,
- 0x802D, 0x802D, 0x4470, 0x802E, 0x802E, 0x25C1, 0x802F, 0x8030, 0x4471,
- 0x8031, 0x8031, 0x1BD6, 0x8032, 0x8032, 0x4473, 0x8033, 0x8033, 0x0639,
- 0x8034, 0x8034, 0x4474, 0x8035, 0x8035, 0x1BD8, 0x8036, 0x8036, 0x1035,
- 0x8037, 0x8037, 0x14B1, 0x8038, 0x8038, 0x0DBF, 0x8039, 0x803A, 0x4475,
- 0x803B, 0x803B, 0x0501, 0x803C, 0x803C, 0x4477, 0x803D, 0x803D, 0x0583,
- 0x803E, 0x803E, 0x4478, 0x803F, 0x803F, 0x06FB, 0x8040, 0x8041, 0x4479,
- 0x8042, 0x8042, 0x0B57, 0x8043, 0x8043, 0x1BD9, 0x8044, 0x8045, 0x447B,
- 0x8046, 0x8046, 0x1BDA, 0x8047, 0x8049, 0x447D, 0x804A, 0x804A, 0x0A0D,
- 0x804B, 0x804B, 0x0A44, 0x804C, 0x804C, 0x11AF, 0x804D, 0x804D, 0x1BDB,
- 0x804E, 0x8051, 0x4480, 0x8052, 0x8052, 0x1BDC, 0x8053, 0x8053, 0x4484,
- 0x8054, 0x8054, 0x09F3, 0x8055, 0x8055, 0x4485, 0x8056, 0x8056, 0x2128,
- 0x8057, 0x8057, 0x4486, 0x8058, 0x8058, 0x0BD7, 0x8059, 0x8059, 0x4487,
- 0x805A, 0x805A, 0x090A, 0x805B, 0x805D, 0x4488, 0x805E, 0x805E, 0x2199,
- 0x805F, 0x8068, 0x448B, 0x8069, 0x8069, 0x1BDD, 0x806A, 0x806A, 0x0552,
- 0x806B, 0x806E, 0x4495, 0x806F, 0x806F, 0x2017, 0x8070, 0x8070, 0x1EA0,
- 0x8071, 0x8071, 0x1BDE, 0x8072, 0x8072, 0x2125, 0x8073, 0x8073, 0x214D,
- 0x8074, 0x8074, 0x4499, 0x8075, 0x8075, 0x25C4, 0x8076, 0x8076, 0x209D,
- 0x8077, 0x8077, 0x228A, 0x8078, 0x8078, 0x449A, 0x8079, 0x8079, 0x25C3,
- 0x807A, 0x807C, 0x449B, 0x807D, 0x807D, 0x2179, 0x807E, 0x807E, 0x2038,
- 0x807F, 0x807F, 0x1A1E, 0x8080, 0x8080, 0x1A1D, 0x8081, 0x8082, 0x449E,
- 0x8083, 0x8083, 0x0DD5, 0x8084, 0x8084, 0x1065, 0x8085, 0x8085, 0x2155,
- 0x8086, 0x8086, 0x0DB6, 0x8087, 0x8087, 0x1179, 0x8088, 0x8088, 0x44A0,
- 0x8089, 0x8089, 0x0CBD, 0x808A, 0x808A, 0x44A1, 0x808B, 0x808B, 0x09CA,
- 0x808C, 0x808C, 0x0814, 0x808D, 0x8092, 0x44A2, 0x8093, 0x8093, 0x1971,
- 0x8094, 0x8095, 0x44A8, 0x8096, 0x8096, 0x0F6F, 0x8097, 0x8097, 0x44AA,
- 0x8098, 0x8098, 0x11E1, 0x8099, 0x8099, 0x44AB, 0x809A, 0x809A, 0x0606,
- 0x809B, 0x809B, 0x06D3, 0x809C, 0x809C, 0x1970, 0x809D, 0x809D, 0x06C9,
- 0x809E, 0x809E, 0x44AC, 0x809F, 0x809F, 0x196F, 0x80A0, 0x80A0, 0x04CB,
- 0x80A1, 0x80A1, 0x0722, 0x80A2, 0x80A2, 0x11AA, 0x80A3, 0x80A3, 0x44AD,
- 0x80A4, 0x80A4, 0x0691, 0x80A5, 0x80A5, 0x0667, 0x80A6, 0x80A8, 0x44AE,
- 0x80A9, 0x80A9, 0x085A, 0x80AA, 0x80AA, 0x065B, 0x80AB, 0x80AB, 0x1976,
- 0x80AC, 0x80AC, 0x44B1, 0x80AD, 0x80AD, 0x1977, 0x80AE, 0x80AE, 0x03C4,
- 0x80AF, 0x80AF, 0x095C, 0x80B0, 0x80B0, 0x44B2, 0x80B1, 0x80B1, 0x1975,
- 0x80B2, 0x80B2, 0x10E2, 0x80B3, 0x80B3, 0x44B3, 0x80B4, 0x80B4, 0x1978,
- 0x80B5, 0x80B6, 0x44B4, 0x80B7, 0x80B7, 0x1979, 0x80B8, 0x80B9, 0x44B6,
- 0x80BA, 0x80BA, 0x066B, 0x80BB, 0x80BB, 0x44B8, 0x80BC, 0x80BC, 0x1972,
- 0x80BD, 0x80BD, 0x1974, 0x80BE, 0x80BE, 0x0D2F, 0x80BF, 0x80BF, 0x11D6,
- 0x80C0, 0x80C0, 0x116E, 0x80C1, 0x80C1, 0x0F7D, 0x80C2, 0x80C2, 0x197F,
- 0x80C3, 0x80C3, 0x0EC7, 0x80C4, 0x80C4, 0x1980, 0x80C5, 0x80C5, 0x44B9,
- 0x80C6, 0x80C6, 0x0589, 0x80C7, 0x80CB, 0x44BA, 0x80CC, 0x80CC, 0x041C,
- 0x80CD, 0x80CD, 0x1982, 0x80CE, 0x80CE, 0x0DF8, 0x80CF, 0x80D5, 0x44BF,
- 0x80D6, 0x80D6, 0x0B97, 0x80D7, 0x80D7, 0x1983, 0x80D8, 0x80D8, 0x44C6,
- 0x80D9, 0x80D9, 0x1981, 0x80DA, 0x80DA, 0x0BA0, 0x80DB, 0x80DB, 0x197E,
- 0x80DC, 0x80DC, 0x0D3B, 0x80DD, 0x80DD, 0x1985, 0x80DE, 0x80DE, 0x0406,
- 0x80DF, 0x80E0, 0x44C7, 0x80E1, 0x80E1, 0x07B1, 0x80E2, 0x80E3, 0x44C9,
- 0x80E4, 0x80E4, 0x126D, 0x80E5, 0x80E5, 0x1BC7, 0x80E6, 0x80E6, 0x44CB,
- 0x80E7, 0x80EA, 0x197A, 0x80EB, 0x80EB, 0x1986, 0x80EC, 0x80EC, 0x179A,
- 0x80ED, 0x80ED, 0x1989, 0x80EE, 0x80EE, 0x44CC, 0x80EF, 0x80EF, 0x0975,
- 0x80F0, 0x80F0, 0x104F, 0x80F1, 0x80F1, 0x1987, 0x80F2, 0x80F2, 0x198C,
- 0x80F3, 0x80F3, 0x06E7, 0x80F4, 0x80F4, 0x1988, 0x80F5, 0x80F5, 0x44CD,
- 0x80F6, 0x80F6, 0x088B, 0x80F7, 0x80F7, 0x44CE, 0x80F8, 0x80F8, 0x0FA3,
- 0x80F9, 0x80F9, 0x44CF, 0x80FA, 0x80FA, 0x03C2, 0x80FB, 0x80FB, 0x44D0,
- 0x80FC, 0x80FC, 0x198D, 0x80FD, 0x80FD, 0x0B3F, 0x80FE, 0x80FF, 0x44D1,
- 0x8100, 0x8101, 0x44D3, 0x8102, 0x8102, 0x11AB, 0x8103, 0x8104, 0x44D5,
- 0x8105, 0x8105, 0x21D2, 0x8106, 0x8106, 0x0563, 0x8107, 0x8108, 0x44D7,
- 0x8109, 0x8109, 0x0A9D, 0x810A, 0x810A, 0x082C, 0x810B, 0x810C, 0x44D9,
- 0x810D, 0x810E, 0x198A, 0x810F, 0x810F, 0x1123, 0x8110, 0x8110, 0x0C09,
- 0x8111, 0x8111, 0x0B37, 0x8112, 0x8112, 0x198F, 0x8113, 0x8113, 0x0B68,
- 0x8114, 0x8114, 0x1309, 0x8115, 0x8115, 0x44DB, 0x8116, 0x8116, 0x0478,
- 0x8117, 0x8117, 0x44DC, 0x8118, 0x8118, 0x1994, 0x8119, 0x8119, 0x44DD,
- 0x811A, 0x811A, 0x0896, 0x811B, 0x811B, 0x24C7, 0x811C, 0x811D, 0x44DE,
- 0x811E, 0x811E, 0x1992, 0x811F, 0x812B, 0x44E0, 0x812C, 0x812C, 0x1993,
- 0x812D, 0x812E, 0x44ED, 0x812F, 0x812F, 0x06A7, 0x8130, 0x8130, 0x44EF,
- 0x8131, 0x8131, 0x0E82, 0x8132, 0x8132, 0x1995, 0x8133, 0x8135, 0x44F0,
- 0x8136, 0x8136, 0x1991, 0x8137, 0x8137, 0x44F3, 0x8138, 0x8138, 0x09FC,
- 0x8139, 0x8139, 0x2279, 0x813A, 0x813D, 0x44F4, 0x813E, 0x813E, 0x0BC1,
- 0x813F, 0x8145, 0x44F8, 0x8146, 0x8146, 0x0E46, 0x8147, 0x8147, 0x44FF,
- 0x8148, 0x8148, 0x1996, 0x8149, 0x8149, 0x4500, 0x814A, 0x814A, 0x099B,
- 0x814B, 0x814B, 0x103F, 0x814C, 0x814C, 0x1997, 0x814D, 0x814D, 0x4501,
- 0x814E, 0x814E, 0x2123, 0x814F, 0x814F, 0x4502, 0x8150, 0x8150, 0x06AA,
- 0x8151, 0x8151, 0x06A8, 0x8152, 0x8152, 0x4503, 0x8153, 0x8153, 0x1998,
- 0x8154, 0x8154, 0x0C38, 0x8155, 0x8155, 0x0EA4, 0x8156, 0x8156, 0x24C5,
- 0x8157, 0x8158, 0x4504, 0x8159, 0x815A, 0x199A, 0x815B, 0x815F, 0x4506,
- 0x8160, 0x8160, 0x199D, 0x8161, 0x8161, 0x24C9, 0x8162, 0x8164, 0x450B,
- 0x8165, 0x8165, 0x0F93, 0x8166, 0x8166, 0x2094, 0x8167, 0x8167, 0x19A2,
- 0x8168, 0x8168, 0x450E, 0x8169, 0x8169, 0x199E, 0x816A, 0x816A, 0x450F,
- 0x816B, 0x816B, 0x2296, 0x816C, 0x816C, 0x4510, 0x816D, 0x816D, 0x19A1,
- 0x816E, 0x816E, 0x0CD4, 0x816F, 0x816F, 0x4511, 0x8170, 0x8170, 0x1025,
- 0x8171, 0x8171, 0x199C, 0x8172, 0x8173, 0x4512, 0x8174, 0x8174, 0x1999,
- 0x8175, 0x8177, 0x4514, 0x8178, 0x8178, 0x1E77, 0x8179, 0x8179, 0x06B4,
- 0x817A, 0x817A, 0x0F46, 0x817B, 0x817B, 0x0B48, 0x817C, 0x817D, 0x199F,
- 0x817E, 0x817E, 0x0E2D, 0x817F, 0x817F, 0x0E79, 0x8180, 0x8180, 0x03FD,
- 0x8181, 0x8181, 0x4517, 0x8182, 0x8182, 0x19A6, 0x8183, 0x8187, 0x4518,
- 0x8188, 0x8188, 0x19A5, 0x8189, 0x8189, 0x451D, 0x818A, 0x818A, 0x0479,
- 0x818B, 0x818E, 0x451E, 0x818F, 0x818F, 0x06DB, 0x8190, 0x8190, 0x4522,
- 0x8191, 0x8191, 0x19A7, 0x8192, 0x8197, 0x4523, 0x8198, 0x8198, 0x0455,
- 0x8199, 0x8199, 0x4529, 0x819A, 0x819A, 0x1F06, 0x819B, 0x819B, 0x0E18,
- 0x819C, 0x819C, 0x0B07, 0x819D, 0x819D, 0x0F12, 0x819E, 0x819F, 0x452A,
- 0x81A0, 0x81A0, 0x1FA5, 0x81A1, 0x81A2, 0x452C, 0x81A3, 0x81A3, 0x19A9,
- 0x81A4, 0x81A5, 0x452E, 0x81A6, 0x81A6, 0x19B0, 0x81A7, 0x81A7, 0x4530,
- 0x81A8, 0x81A8, 0x0BB3, 0x81A9, 0x81A9, 0x2099, 0x81AA, 0x81AA, 0x19AA,
- 0x81AB, 0x81B2, 0x4531, 0x81B3, 0x81B3, 0x0CFE, 0x81B4, 0x81B9, 0x4539,
- 0x81BA, 0x81BA, 0x1641, 0x81BB, 0x81BB, 0x19AE, 0x81BC, 0x81BC, 0x453F,
- 0x81BD, 0x81BD, 0x1EAD, 0x81BE, 0x81BE, 0x24C8, 0x81BF, 0x81BF, 0x20A8,
- 0x81C0, 0x81C0, 0x0E7F, 0x81C1, 0x81C1, 0x19AF, 0x81C2, 0x81C2, 0x0444,
- 0x81C3, 0x81C3, 0x109C, 0x81C4, 0x81C5, 0x4540, 0x81C6, 0x81C6, 0x1063,
- 0x81C7, 0x81C8, 0x4542, 0x81C9, 0x81C9, 0x201F, 0x81CA, 0x81CA, 0x19AD,
- 0x81CB, 0x81CB, 0x4544, 0x81CC, 0x81CC, 0x19AB, 0x81CD, 0x81CD, 0x20C5,
- 0x81CE, 0x81CE, 0x4545, 0x81CF, 0x81CF, 0x24CA, 0x81D0, 0x81D7, 0x4546,
- 0x81D8, 0x81D8, 0x1FF0, 0x81D9, 0x81D9, 0x454E, 0x81DA, 0x81DA, 0x24C6,
- 0x81DB, 0x81DE, 0x454F, 0x81DF, 0x81DF, 0x225D, 0x81E0, 0x81E0, 0x22DE,
- 0x81E1, 0x81E2, 0x4553, 0x81E3, 0x81E3, 0x04E1, 0x81E4, 0x81E6, 0x4555,
- 0x81E7, 0x81E7, 0x1902, 0x81E8, 0x81E8, 0x202C, 0x81E9, 0x81E9, 0x4558,
- 0x81EA, 0x81EA, 0x1231, 0x81EB, 0x81EB, 0x4559, 0x81EC, 0x81EC, 0x1CA9,
- 0x81ED, 0x81ED, 0x0519, 0x81EE, 0x81F2, 0x455A, 0x81F3, 0x81F4, 0x11C0,
- 0x81F5, 0x81F9, 0x455F, 0x81FA, 0x81FA, 0x2161, 0x81FB, 0x81FB, 0x118A,
- 0x81FC, 0x81FC, 0x08F9, 0x81FD, 0x81FD, 0x4564, 0x81FE, 0x81FE, 0x1CA5,
- 0x81FF, 0x81FF, 0x4565, 0x8200, 0x8200, 0x102F, 0x8201, 0x8202, 0x1CA6,
- 0x8203, 0x8203, 0x4566, 0x8204, 0x8204, 0x1CA8, 0x8205, 0x8205, 0x08FA,
- 0x8206, 0x8206, 0x10C4, 0x8207, 0x8207, 0x223B, 0x8208, 0x8208, 0x21D9,
- 0x8209, 0x8209, 0x1FCB, 0x820A, 0x820A, 0x1FC9, 0x820B, 0x820B, 0x4567,
- 0x820C, 0x820D, 0x0D19, 0x820E, 0x820F, 0x4568, 0x8210, 0x8210, 0x1C62,
- 0x8211, 0x8211, 0x456A, 0x8212, 0x8212, 0x0D7D, 0x8213, 0x8213, 0x456B,
- 0x8214, 0x8214, 0x0E45, 0x8215, 0x821A, 0x456C, 0x821B, 0x821B, 0x1618,
- 0x821C, 0x821C, 0x0DA9, 0x821D, 0x821D, 0x4572, 0x821E, 0x821E, 0x0EF7,
- 0x821F, 0x821F, 0x11DA, 0x8220, 0x8220, 0x4573, 0x8221, 0x8223, 0x1CAB,
- 0x8224, 0x8227, 0x4574, 0x8228, 0x8228, 0x1CB0, 0x8229, 0x8229, 0x4578,
- 0x822A, 0x822A, 0x0774, 0x822B, 0x822B, 0x1CB1, 0x822C, 0x822C, 0x03EE,
- 0x822D, 0x822D, 0x1CAE, 0x822E, 0x822E, 0x4579, 0x822F, 0x822F, 0x1CAF,
- 0x8230, 0x8230, 0x0873, 0x8231, 0x8231, 0x049C, 0x8232, 0x8232, 0x457A,
- 0x8233, 0x8234, 0x1CB4, 0x8235, 0x8235, 0x0625, 0x8236, 0x8236, 0x0477,
- 0x8237, 0x8237, 0x0F3C, 0x8238, 0x8238, 0x1CB2, 0x8239, 0x8239, 0x052F,
- 0x823A, 0x823A, 0x457B, 0x823B, 0x823B, 0x1CB3, 0x823C, 0x823D, 0x457C,
- 0x823E, 0x823E, 0x1CB6, 0x823F, 0x8243, 0x457E, 0x8244, 0x8244, 0x1CB7,
- 0x8245, 0x8246, 0x4583, 0x8247, 0x8247, 0x0E58, 0x8248, 0x8248, 0x4585,
- 0x8249, 0x8249, 0x1CB8, 0x824A, 0x824A, 0x4586, 0x824B, 0x824B, 0x1CB9,
- 0x824C, 0x824E, 0x4587, 0x824F, 0x824F, 0x1CBA, 0x8250, 0x8257, 0x458A,
- 0x8258, 0x8258, 0x0DC7, 0x8259, 0x8259, 0x1E61, 0x825A, 0x825A, 0x1CBB,
- 0x825B, 0x825E, 0x4592, 0x825F, 0x825F, 0x1CBC, 0x8260, 0x8263, 0x4596,
- 0x8264, 0x8264, 0x25EF, 0x8265, 0x8265, 0x459A, 0x8266, 0x8266, 0x1F98,
- 0x8267, 0x8267, 0x459B, 0x8268, 0x8268, 0x1CBD, 0x8269, 0x826A, 0x459C,
- 0x826B, 0x826B, 0x25F0, 0x826C, 0x826D, 0x459E, 0x826E, 0x826E, 0x1CDC,
- 0x826F, 0x826F, 0x0A05, 0x8270, 0x8270, 0x085B, 0x8271, 0x8271, 0x1F88,
- 0x8272, 0x8272, 0x0CE4, 0x8273, 0x8273, 0x1007, 0x8274, 0x8274, 0x1771,
- 0x8275, 0x8276, 0x45A0, 0x8277, 0x8277, 0x21F8, 0x8278, 0x8278, 0x45A2,
- 0x8279, 0x8279, 0x13E1, 0x827A, 0x827A, 0x105C, 0x827B, 0x827C, 0x45A3,
- 0x827D, 0x827D, 0x13E2, 0x827E, 0x827E, 0x03B7, 0x827F, 0x827F, 0x13E3,
- 0x8280, 0x8281, 0x45A5, 0x8282, 0x8282, 0x08AB, 0x8283, 0x8283, 0x45A7,
- 0x8284, 0x8284, 0x13E7, 0x8285, 0x8287, 0x45A8, 0x8288, 0x8288, 0x1278,
- 0x8289, 0x8289, 0x45AB, 0x828A, 0x828A, 0x13E5, 0x828B, 0x828B, 0x10D8,
- 0x828C, 0x828C, 0x45AC, 0x828D, 0x828D, 0x0D0F, 0x828E, 0x828E, 0x13E8,
- 0x828F, 0x828F, 0x13E4, 0x8290, 0x8290, 0x45AD, 0x8291, 0x8291, 0x13E9,
- 0x8292, 0x8292, 0x0AA7, 0x8293, 0x8296, 0x45AE, 0x8297, 0x8297, 0x13EA,
- 0x8298, 0x8298, 0x13F3, 0x8299, 0x8299, 0x13EB, 0x829A, 0x829B, 0x45B2,
- 0x829C, 0x829C, 0x0EEE, 0x829D, 0x829D, 0x11A4, 0x829E, 0x829E, 0x45B4,
- 0x829F, 0x829F, 0x13FD, 0x82A0, 0x82A0, 0x45B5, 0x82A1, 0x82A1, 0x13FB,
- 0x82A2, 0x82A3, 0x45B6, 0x82A4, 0x82A4, 0x1400, 0x82A5, 0x82A5, 0x08B7,
- 0x82A6, 0x82A6, 0x0A52, 0x82A7, 0x82A7, 0x45B8, 0x82A8, 0x82A8, 0x13E6,
- 0x82A9, 0x82A9, 0x13F9, 0x82AA, 0x82AA, 0x13FC, 0x82AB, 0x82AB, 0x13EC,
- 0x82AC, 0x82AC, 0x066F, 0x82AD, 0x82AD, 0x03D0, 0x82AE, 0x82AE, 0x13F5,
- 0x82AF, 0x82AF, 0x0F89, 0x82B0, 0x82B0, 0x13EF, 0x82B1, 0x82B1, 0x07BD,
- 0x82B2, 0x82B2, 0x45B9, 0x82B3, 0x82B3, 0x0659, 0x82B4, 0x82B4, 0x13FA,
- 0x82B5, 0x82B6, 0x45BA, 0x82B7, 0x82B7, 0x13F4, 0x82B8, 0x82B8, 0x13ED,
- 0x82B9, 0x82B9, 0x0C58, 0x82BA, 0x82BA, 0x45BC, 0x82BB, 0x82BB, 0x2322,
- 0x82BC, 0x82BC, 0x45BD, 0x82BD, 0x82BD, 0x0FE8, 0x82BE, 0x82BE, 0x13EE,
- 0x82BF, 0x82C0, 0x45BE, 0x82C1, 0x82C1, 0x13F8, 0x82C2, 0x82C3, 0x45C0,
- 0x82C4, 0x82C4, 0x13FE, 0x82C5, 0x82C6, 0x45C2, 0x82C7, 0x82C7, 0x0EBC,
- 0x82C8, 0x82C8, 0x13F0, 0x82C9, 0x82C9, 0x45C4, 0x82CA, 0x82CA, 0x13F1,
- 0x82CB, 0x82CC, 0x13F6, 0x82CD, 0x82CD, 0x049B, 0x82CE, 0x82CE, 0x13FF,
- 0x82CF, 0x82CF, 0x0DCA, 0x82D0, 0x82D0, 0x45C5, 0x82D1, 0x82D1, 0x10FA,
- 0x82D2, 0x82D2, 0x1409, 0x82D3, 0x82D3, 0x140D, 0x82D4, 0x82D4, 0x0DF9,
- 0x82D5, 0x82D5, 0x1414, 0x82D6, 0x82D6, 0x45C6, 0x82D7, 0x82D7, 0x0AEC,
- 0x82D8, 0x82D8, 0x140A, 0x82D9, 0x82DA, 0x45C7, 0x82DB, 0x82DB, 0x094E,
- 0x82DC, 0x82DC, 0x1407, 0x82DD, 0x82DD, 0x45C9, 0x82DE, 0x82DE, 0x0405,
- 0x82DF, 0x82DF, 0x070F, 0x82E0, 0x82E0, 0x1413, 0x82E1, 0x82E1, 0x1401,
- 0x82E2, 0x82E2, 0x45CA, 0x82E3, 0x82E3, 0x13F2, 0x82E4, 0x82E4, 0x1404,
- 0x82E5, 0x82E5, 0x0CCF, 0x82E6, 0x82E6, 0x096D, 0x82E7, 0x82E7, 0x2336,
- 0x82E8, 0x82EA, 0x45CB, 0x82EB, 0x82EB, 0x0CF4, 0x82EC, 0x82EE, 0x45CE,
- 0x82EF, 0x82EF, 0x0426, 0x82F0, 0x82F0, 0x45D1, 0x82F1, 0x82F1, 0x1087,
- 0x82F2, 0x82F3, 0x45D2, 0x82F4, 0x82F4, 0x1408, 0x82F5, 0x82F6, 0x45D4,
- 0x82F7, 0x82F7, 0x1403, 0x82F8, 0x82F8, 0x45D6, 0x82F9, 0x82F9, 0x0BDA,
- 0x82FA, 0x82FA, 0x45D7, 0x82FB, 0x82FB, 0x140C, 0x82FC, 0x82FF, 0x45D8,
- 0x8300, 0x8300, 0x45DC, 0x8301, 0x8301, 0x121F, 0x8302, 0x8302, 0x0AB4,
- 0x8303, 0x8303, 0x0653, 0x8304, 0x8304, 0x0C4E, 0x8305, 0x8305, 0x0AAE,
- 0x8306, 0x8306, 0x1410, 0x8307, 0x8307, 0x1406, 0x8308, 0x8308, 0x1419,
- 0x8309, 0x8309, 0x1402, 0x830A, 0x830B, 0x45DD, 0x830C, 0x830C, 0x140B,
- 0x830D, 0x830D, 0x45DF, 0x830E, 0x830E, 0x08D4, 0x830F, 0x830F, 0x1405,
- 0x8310, 0x8310, 0x45E0, 0x8311, 0x8311, 0x140E, 0x8312, 0x8313, 0x45E1,
- 0x8314, 0x8315, 0x1411, 0x8316, 0x8316, 0x45E3, 0x8317, 0x8317, 0x1426,
- 0x8318, 0x8319, 0x45E4, 0x831A, 0x831A, 0x140F, 0x831B, 0x831B, 0x142E,
- 0x831C, 0x831C, 0x1415, 0x831D, 0x8326, 0x45E6, 0x8327, 0x8327, 0x085E,
- 0x8328, 0x8328, 0x0547, 0x8329, 0x832A, 0x45F0, 0x832B, 0x832B, 0x0AA8,
- 0x832C, 0x832C, 0x04AE, 0x832D, 0x832D, 0x1428, 0x832E, 0x832E, 0x45F2,
- 0x832F, 0x832F, 0x1420, 0x8330, 0x8330, 0x45F3, 0x8331, 0x8331, 0x141D,
- 0x8332, 0x8332, 0x45F4, 0x8333, 0x8333, 0x142A, 0x8334, 0x8334, 0x141C,
- 0x8335, 0x8335, 0x1077, 0x8336, 0x8336, 0x04AF, 0x8337, 0x8337, 0x45F5,
- 0x8338, 0x8338, 0x0CB2, 0x8339, 0x8339, 0x0CBE, 0x833A, 0x833A, 0x1429,
- 0x833B, 0x833B, 0x45F6, 0x833C, 0x833C, 0x141B, 0x833D, 0x833F, 0x45F7,
- 0x8340, 0x8340, 0x1425, 0x8341, 0x8342, 0x45FA, 0x8343, 0x8343, 0x1423,
- 0x8344, 0x8345, 0x45FC, 0x8346, 0x8346, 0x08D2, 0x8347, 0x8347, 0x1422,
- 0x8348, 0x8348, 0x45FE, 0x8349, 0x8349, 0x04A4, 0x834A, 0x834E, 0x45FF,
- 0x834F, 0x834F, 0x1421, 0x8350, 0x8350, 0x0869, 0x8351, 0x8351, 0x1416,
- 0x8352, 0x8352, 0x07D9, 0x8353, 0x8353, 0x4604, 0x8354, 0x8354, 0x09DE,
- 0x8355, 0x8359, 0x4605, 0x835A, 0x835A, 0x0847, 0x835B, 0x835C, 0x1417,
- 0x835D, 0x835D, 0x460A, 0x835E, 0x835E, 0x141F, 0x835F, 0x835F, 0x1424,
- 0x8360, 0x8360, 0x1427, 0x8361, 0x8361, 0x0595, 0x8362, 0x8362, 0x460B,
- 0x8363, 0x8363, 0x0CB4, 0x8364, 0x8364, 0x07FC, 0x8365, 0x8365, 0x142C,
- 0x8366, 0x8366, 0x142B, 0x8367, 0x8367, 0x1090, 0x8368, 0x8368, 0x142D,
- 0x8369, 0x8369, 0x142F, 0x836A, 0x836A, 0x1431, 0x836B, 0x836B, 0x1078,
- 0x836C, 0x836C, 0x1430, 0x836D, 0x836E, 0x1432, 0x836F, 0x836F, 0x1030,
- 0x8370, 0x8376, 0x460C, 0x8377, 0x8377, 0x0780, 0x8378, 0x8378, 0x1435,
- 0x8379, 0x837A, 0x4613, 0x837B, 0x837B, 0x1442, 0x837C, 0x837C, 0x143D,
- 0x837D, 0x837D, 0x1440, 0x837E, 0x8384, 0x4615, 0x8385, 0x8385, 0x143C,
- 0x8386, 0x8386, 0x0BED, 0x8387, 0x8388, 0x461C, 0x8389, 0x8389, 0x09DD,
- 0x838A, 0x838A, 0x22AB, 0x838B, 0x838D, 0x461E, 0x838E, 0x838E, 0x0CE8,
- 0x838F, 0x8391, 0x4621, 0x8392, 0x8392, 0x141A, 0x8393, 0x8393, 0x143A,
- 0x8394, 0x8395, 0x4624, 0x8396, 0x8396, 0x1FBF, 0x8397, 0x8397, 0x4626,
- 0x8398, 0x8398, 0x1443, 0x8399, 0x839A, 0x4627, 0x839B, 0x839B, 0x141E,
- 0x839C, 0x839C, 0x143B, 0x839D, 0x839D, 0x4629, 0x839E, 0x839E, 0x1444,
- 0x839F, 0x839F, 0x462A, 0x83A0, 0x83A0, 0x1438, 0x83A1, 0x83A1, 0x462B,
- 0x83A2, 0x83A2, 0x1F7D, 0x83A3, 0x83A6, 0x462C, 0x83A7, 0x83A7, 0x2333,
- 0x83A8, 0x83A8, 0x1445, 0x83A9, 0x83A9, 0x143F, 0x83AA, 0x83AA, 0x1439,
- 0x83AB, 0x83AB, 0x0B0D, 0x83AC, 0x83AF, 0x4630, 0x83B0, 0x83B0, 0x1434,
- 0x83B1, 0x83B1, 0x099E, 0x83B2, 0x83B2, 0x09F4, 0x83B3, 0x83B4, 0x1436,
- 0x83B5, 0x83B5, 0x4634, 0x83B6, 0x83B6, 0x143E, 0x83B7, 0x83B7, 0x0806,
- 0x83B8, 0x83B8, 0x1441, 0x83B9, 0x83B9, 0x108D, 0x83BA, 0x83BA, 0x1446,
- 0x83BB, 0x83BB, 0x4635, 0x83BC, 0x83BC, 0x1447, 0x83BD, 0x83BD, 0x0AAC,
- 0x83BE, 0x83BF, 0x4636, 0x83C0, 0x83C0, 0x145E, 0x83C1, 0x83C1, 0x1448,
- 0x83C2, 0x83C4, 0x4638, 0x83C5, 0x83C5, 0x145D, 0x83C6, 0x83C6, 0x463B,
- 0x83C7, 0x83C7, 0x0716, 0x83C8, 0x83C9, 0x463C, 0x83CA, 0x83CA, 0x0904,
- 0x83CB, 0x83CB, 0x463E, 0x83CC, 0x83CC, 0x0929, 0x83CD, 0x83CE, 0x463F,
- 0x83CF, 0x83CF, 0x0781, 0x83D0, 0x83D3, 0x4641, 0x83D4, 0x83D4, 0x1456,
- 0x83D5, 0x83D5, 0x4645, 0x83D6, 0x83D6, 0x1451, 0x83D7, 0x83D7, 0x4646,
- 0x83D8, 0x83D8, 0x144B, 0x83D9, 0x83DB, 0x4647, 0x83DC, 0x83DC, 0x0492,
- 0x83DD, 0x83DD, 0x144F, 0x83DE, 0x83DE, 0x464A, 0x83DF, 0x83DF, 0x1457,
- 0x83E0, 0x83E0, 0x046B, 0x83E1, 0x83E1, 0x1461, 0x83E2, 0x83E4, 0x464B,
- 0x83E5, 0x83E5, 0x144A, 0x83E6, 0x83E8, 0x464E, 0x83E9, 0x83E9, 0x0BEF,
- 0x83EA, 0x83EA, 0x145C, 0x83EB, 0x83EE, 0x4651, 0x83EF, 0x83EF, 0x1F4D,
- 0x83F0, 0x83F0, 0x1460, 0x83F1, 0x83F1, 0x0A2B, 0x83F2, 0x83F2, 0x0663,
- 0x83F3, 0x83F7, 0x4655, 0x83F8, 0x83F9, 0x145A, 0x83FA, 0x83FC, 0x465A,
- 0x83FD, 0x83FD, 0x1450, 0x83FE, 0x83FF, 0x465D, 0x8400, 0x8400, 0x465F,
- 0x8401, 0x8401, 0x1449, 0x8402, 0x8402, 0x4660, 0x8403, 0x8403, 0x1459,
- 0x8404, 0x8404, 0x0E24, 0x8405, 0x8405, 0x4661, 0x8406, 0x8406, 0x1455,
- 0x8407, 0x8407, 0x2334, 0x8408, 0x8409, 0x4662, 0x840A, 0x840A, 0x1FF1,
- 0x840B, 0x840B, 0x144E, 0x840C, 0x840C, 0x0ACD, 0x840D, 0x840D, 0x0BDB,
- 0x840E, 0x840E, 0x0EBD, 0x840F, 0x840F, 0x1458, 0x8410, 0x8410, 0x4664,
- 0x8411, 0x8411, 0x1454, 0x8412, 0x8417, 0x4665, 0x8418, 0x8418, 0x144D,
- 0x8419, 0x841B, 0x466B, 0x841C, 0x841C, 0x1452, 0x841D, 0x841D, 0x0A83,
- 0x841E, 0x8423, 0x466E, 0x8424, 0x8425, 0x108E, 0x8426, 0x8426, 0x145F,
- 0x8427, 0x8427, 0x0F61, 0x8428, 0x8428, 0x0CD3, 0x8429, 0x842B, 0x4674,
- 0x842C, 0x842C, 0x218B, 0x842D, 0x8430, 0x4677, 0x8431, 0x8431, 0x1472,
- 0x8432, 0x8434, 0x467B, 0x8435, 0x8435, 0x2349, 0x8436, 0x8437, 0x467E,
- 0x8438, 0x8438, 0x1453, 0x8439, 0x843B, 0x4680, 0x843C, 0x843C, 0x146C,
- 0x843D, 0x843D, 0x0A8B, 0x843E, 0x8445, 0x4683, 0x8446, 0x8446, 0x146D,
- 0x8447, 0x8448, 0x468B, 0x8449, 0x8449, 0x220B, 0x844A, 0x8450, 0x468D,
- 0x8451, 0x8451, 0x1463, 0x8452, 0x8452, 0x2346, 0x8453, 0x8456, 0x4694,
- 0x8457, 0x8457, 0x11F7, 0x8458, 0x8458, 0x4698, 0x8459, 0x8459, 0x1465,
- 0x845A, 0x845A, 0x1464, 0x845B, 0x845B, 0x06EB, 0x845C, 0x845C, 0x1462,
- 0x845D, 0x8460, 0x4699, 0x8461, 0x8461, 0x0BEE, 0x8462, 0x8462, 0x469D,
- 0x8463, 0x8463, 0x05EC, 0x8464, 0x8464, 0x2347, 0x8465, 0x8465, 0x469E,
- 0x8466, 0x8466, 0x2193, 0x8467, 0x8468, 0x469F, 0x8469, 0x8469, 0x146E,
- 0x846A, 0x846A, 0x46A1, 0x846B, 0x846B, 0x07B0, 0x846C, 0x846C, 0x1124,
- 0x846D, 0x846D, 0x1473, 0x846E, 0x846E, 0x46A2, 0x846F, 0x846F, 0x26A1,
- 0x8470, 0x8470, 0x46A3, 0x8471, 0x8471, 0x0553, 0x8472, 0x8472, 0x46A4,
- 0x8473, 0x8473, 0x1466, 0x8474, 0x8474, 0x46A5, 0x8475, 0x8475, 0x0988,
- 0x8476, 0x8476, 0x146F, 0x8477, 0x8477, 0x1F62, 0x8478, 0x8478, 0x146B,
- 0x8479, 0x8479, 0x46A6, 0x847A, 0x847A, 0x1469, 0x847B, 0x8481, 0x46A7,
- 0x8482, 0x8482, 0x05BA, 0x8483, 0x8486, 0x46AE, 0x8487, 0x8488, 0x1467,
- 0x8489, 0x8489, 0x146A, 0x848A, 0x848A, 0x46B2, 0x848B, 0x848B, 0x0880,
- 0x848C, 0x848C, 0x1470, 0x848D, 0x848D, 0x46B3, 0x848E, 0x848E, 0x1471,
- 0x848F, 0x8492, 0x46B4, 0x8493, 0x8493, 0x234D, 0x8494, 0x8494, 0x2348,
- 0x8495, 0x8496, 0x46B8, 0x8497, 0x8497, 0x1481, 0x8498, 0x8498, 0x46BA,
- 0x8499, 0x8499, 0x0ACE, 0x849A, 0x849B, 0x46BB, 0x849C, 0x849C, 0x0DD7,
- 0x849D, 0x84A0, 0x46BD, 0x84A1, 0x84A1, 0x147E, 0x84A2, 0x84AE, 0x46C1,
- 0x84AF, 0x84AF, 0x1297, 0x84B0, 0x84B1, 0x46CE, 0x84B2, 0x84B2, 0x0BF0,
- 0x84B3, 0x84B3, 0x46D0, 0x84B4, 0x84B4, 0x1480, 0x84B5, 0x84B7, 0x46D1,
- 0x84B8, 0x84B8, 0x1195, 0x84B9, 0x84B9, 0x147F, 0x84BA, 0x84BA, 0x147C,
- 0x84BB, 0x84BB, 0x46D4, 0x84BC, 0x84BC, 0x1E60, 0x84BD, 0x84BD, 0x1478,
- 0x84BE, 0x84BE, 0x46D5, 0x84BF, 0x84BF, 0x147B, 0x84C0, 0x84C0, 0x2345,
- 0x84C1, 0x84C1, 0x1474, 0x84C2, 0x84C3, 0x46D6, 0x84C4, 0x84C4, 0x0FB9,
- 0x84C5, 0x84C8, 0x46D8, 0x84C9, 0x84C9, 0x0CB3, 0x84CA, 0x84CA, 0x147A,
- 0x84CB, 0x84CB, 0x1F12, 0x84CC, 0x84CC, 0x46DC, 0x84CD, 0x84CD, 0x1475,
- 0x84CE, 0x84CF, 0x46DD, 0x84D0, 0x84D0, 0x1476, 0x84D1, 0x84D1, 0x0DE7,
- 0x84D2, 0x84D2, 0x46DF, 0x84D3, 0x84D3, 0x1479, 0x84D4, 0x84D5, 0x46E0,
- 0x84D6, 0x84D6, 0x0436, 0x84D7, 0x84DC, 0x46E2, 0x84DD, 0x84DD, 0x09A1,
- 0x84DE, 0x84DE, 0x46E8, 0x84DF, 0x84DF, 0x082E, 0x84E0, 0x84E0, 0x147D,
- 0x84E1, 0x84E2, 0x46E9, 0x84E3, 0x84E3, 0x1483, 0x84E4, 0x84E4, 0x46EB,
- 0x84E5, 0x84E5, 0x1482, 0x84E6, 0x84E6, 0x1477, 0x84E7, 0x84EB, 0x46EC,
- 0x84EC, 0x84EC, 0x0BAF, 0x84ED, 0x84ED, 0x46F1, 0x84EE, 0x84EE, 0x2018,
- 0x84EF, 0x84EF, 0x2335, 0x84F0, 0x84F0, 0x1487, 0x84F1, 0x84FB, 0x46F2,
- 0x84FC, 0x84FC, 0x148E, 0x84FD, 0x84FD, 0x233C, 0x84FE, 0x84FE, 0x46FD,
- 0x84FF, 0x84FF, 0x148D, 0x8500, 0x850B, 0x46FE, 0x850C, 0x850C, 0x1484,
- 0x850D, 0x8510, 0x470A, 0x8511, 0x8511, 0x0AF4, 0x8512, 0x8512, 0x470E,
- 0x8513, 0x8513, 0x0AA2, 0x8514, 0x8514, 0x266F, 0x8515, 0x8516, 0x470F,
- 0x8517, 0x8517, 0x1182, 0x8518, 0x8519, 0x4711, 0x851A, 0x851A, 0x0EC4,
- 0x851B, 0x851D, 0x4713, 0x851E, 0x851E, 0x2351, 0x851F, 0x851F, 0x1489,
- 0x8520, 0x8520, 0x4716, 0x8521, 0x8521, 0x0493, 0x8522, 0x8522, 0x4717,
- 0x8523, 0x8523, 0x1FA0, 0x8524, 0x8525, 0x4718, 0x8526, 0x8526, 0x2338,
- 0x8527, 0x852A, 0x471A, 0x852B, 0x852B, 0x0B4B, 0x852C, 0x852C, 0x0D76,
- 0x852D, 0x852D, 0x221B, 0x852E, 0x8536, 0x471E, 0x8537, 0x8537, 0x0C3B,
- 0x8538, 0x8538, 0x1486, 0x8539, 0x8539, 0x1488, 0x853A, 0x853A, 0x148A,
- 0x853B, 0x853B, 0x148C, 0x853C, 0x853C, 0x03B5, 0x853D, 0x853D, 0x0437,
- 0x853E, 0x8540, 0x4727, 0x8541, 0x8541, 0x2342, 0x8542, 0x8542, 0x472A,
- 0x8543, 0x8543, 0x1496, 0x8544, 0x8545, 0x472B, 0x8546, 0x8546, 0x234F,
- 0x8547, 0x8547, 0x472D, 0x8548, 0x8548, 0x1490, 0x8549, 0x8549, 0x0887,
- 0x854A, 0x854A, 0x0CCA, 0x854B, 0x854D, 0x472E, 0x854E, 0x854E, 0x233D,
- 0x854F, 0x8551, 0x4731, 0x8552, 0x8552, 0x2344, 0x8553, 0x8553, 0x2331,
- 0x8554, 0x8554, 0x4734, 0x8555, 0x8555, 0x234B, 0x8556, 0x8556, 0x148B,
- 0x8557, 0x8557, 0x4735, 0x8558, 0x8558, 0x233B, 0x8559, 0x8559, 0x148F,
- 0x855A, 0x855D, 0x4736, 0x855E, 0x855E, 0x1493, 0x855F, 0x8561, 0x473A,
- 0x8562, 0x8562, 0x2350, 0x8563, 0x8563, 0x473D, 0x8564, 0x8564, 0x1492,
- 0x8565, 0x8567, 0x473E, 0x8568, 0x8568, 0x1491, 0x8569, 0x8569, 0x1EB4,
- 0x856A, 0x856A, 0x21A6, 0x856B, 0x856C, 0x4741, 0x856D, 0x856D, 0x21CB,
- 0x856E, 0x8571, 0x4743, 0x8572, 0x8572, 0x1497, 0x8573, 0x8573, 0x4747,
- 0x8574, 0x8574, 0x110F, 0x8575, 0x8576, 0x4748, 0x8577, 0x8577, 0x2355,
- 0x8578, 0x8578, 0x474A, 0x8579, 0x8579, 0x149D, 0x857A, 0x857A, 0x1494,
- 0x857B, 0x857B, 0x1498, 0x857C, 0x857D, 0x474B, 0x857E, 0x857E, 0x09C4,
- 0x857F, 0x8583, 0x474D, 0x8584, 0x8584, 0x040A, 0x8585, 0x8585, 0x14A0,
- 0x8586, 0x8586, 0x4752, 0x8587, 0x8587, 0x149B, 0x8588, 0x8588, 0x233E,
- 0x8589, 0x8589, 0x4753, 0x858A, 0x858A, 0x1F74, 0x858B, 0x858B, 0x4754,
- 0x858C, 0x858C, 0x2330, 0x858D, 0x858E, 0x4755, 0x858F, 0x858F, 0x149C,
- 0x8590, 0x8590, 0x4757, 0x8591, 0x8591, 0x2680, 0x8592, 0x8593, 0x4758,
- 0x8594, 0x8594, 0x20DA, 0x8595, 0x859A, 0x475A, 0x859B, 0x859B, 0x0FCF,
- 0x859C, 0x859C, 0x149F, 0x859D, 0x859E, 0x4760, 0x859F, 0x859F, 0x234A,
- 0x85A0, 0x85A3, 0x4762, 0x85A4, 0x85A4, 0x1499, 0x85A5, 0x85A5, 0x4766,
- 0x85A6, 0x85A6, 0x1F91, 0x85A7, 0x85A7, 0x4767, 0x85A8, 0x85A8, 0x149A,
- 0x85A9, 0x85A9, 0x2107, 0x85AA, 0x85AA, 0x0F88, 0x85AB, 0x85AD, 0x4768,
- 0x85AE, 0x85AE, 0x149E, 0x85AF, 0x85AF, 0x0D84, 0x85B0, 0x85B0, 0x14A3,
- 0x85B1, 0x85B6, 0x476B, 0x85B7, 0x85B7, 0x14A2, 0x85B8, 0x85B8, 0x4771,
- 0x85B9, 0x85B9, 0x14A1, 0x85BA, 0x85BA, 0x233F, 0x85BB, 0x85C0, 0x4772,
- 0x85C1, 0x85C1, 0x14A5, 0x85C2, 0x85C8, 0x4778, 0x85C9, 0x85C9, 0x08B6,
- 0x85CA, 0x85CC, 0x477F, 0x85CD, 0x85CD, 0x1FF4, 0x85CE, 0x85CE, 0x2343,
- 0x85CF, 0x85CF, 0x049F, 0x85D0, 0x85D0, 0x0AEF, 0x85D1, 0x85D2, 0x4782,
- 0x85D3, 0x85D3, 0x14A4, 0x85D4, 0x85D4, 0x4784, 0x85D5, 0x85D5, 0x0B7B,
- 0x85D6, 0x85DB, 0x4785, 0x85DC, 0x85DC, 0x14A6, 0x85DD, 0x85DD, 0x2212,
- 0x85DE, 0x85E3, 0x478B, 0x85E4, 0x85E4, 0x0E2C, 0x85E5, 0x85E5, 0x2207,
- 0x85E6, 0x85E8, 0x4791, 0x85E9, 0x85E9, 0x0647, 0x85EA, 0x85EA, 0x2359,
- 0x85EB, 0x85F3, 0x4794, 0x85F4, 0x85F4, 0x2254, 0x85F5, 0x85F5, 0x479D,
- 0x85F6, 0x85F6, 0x2332, 0x85F7, 0x85F8, 0x479E, 0x85F9, 0x85F9, 0x1E26,
- 0x85FA, 0x85FA, 0x2357, 0x85FB, 0x85FB, 0x1128, 0x85FC, 0x85FE, 0x47A0,
- 0x85FF, 0x85FF, 0x14A7, 0x8600, 0x8603, 0x47A3, 0x8604, 0x8604, 0x2358,
- 0x8605, 0x8605, 0x14A9, 0x8606, 0x8606, 0x2042, 0x8607, 0x8607, 0x2153,
- 0x8608, 0x860A, 0x47A7, 0x860B, 0x860B, 0x20BB, 0x860C, 0x8610, 0x47AA,
- 0x8611, 0x8611, 0x0B05, 0x8612, 0x8615, 0x47AF, 0x8616, 0x8616, 0x14AB,
- 0x8617, 0x8619, 0x47B3, 0x861A, 0x861A, 0x235A, 0x861B, 0x861D, 0x47B6,
- 0x861E, 0x861E, 0x2356, 0x861F, 0x8621, 0x47B9, 0x8622, 0x8622, 0x2337,
- 0x8623, 0x8626, 0x47BC, 0x8627, 0x8627, 0x14A8, 0x8628, 0x8628, 0x47C0,
- 0x8629, 0x8629, 0x14AA, 0x862A, 0x862C, 0x47C1, 0x862D, 0x862D, 0x1FF9,
- 0x862E, 0x8637, 0x47C4, 0x8638, 0x8638, 0x115B, 0x8639, 0x8639, 0x47CE,
- 0x863A, 0x863A, 0x2353, 0x863B, 0x863B, 0x47CF, 0x863C, 0x863C, 0x14AC,
- 0x863D, 0x863E, 0x47D0, 0x863F, 0x863F, 0x2061, 0x8640, 0x864C, 0x47D2,
- 0x864D, 0x864D, 0x1BF0, 0x864E, 0x864E, 0x07B7, 0x864F, 0x864F, 0x0A59,
- 0x8650, 0x8650, 0x0B71, 0x8651, 0x8651, 0x0A6E, 0x8652, 0x8653, 0x47DF,
- 0x8654, 0x8654, 0x1BF1, 0x8655, 0x8655, 0x1E95, 0x8656, 0x8659, 0x47E1,
- 0x865A, 0x865A, 0x0FB4, 0x865B, 0x865B, 0x47E5, 0x865C, 0x865C, 0x2049,
- 0x865D, 0x865D, 0x47E6, 0x865E, 0x865E, 0x10C2, 0x865F, 0x865F, 0x1F42,
- 0x8660, 0x8661, 0x47E7, 0x8662, 0x8662, 0x196D, 0x8663, 0x8666, 0x47E9,
- 0x8667, 0x8667, 0x1FE8, 0x8668, 0x866A, 0x47ED, 0x866B, 0x866B, 0x050B,
- 0x866C, 0x866C, 0x1BF2, 0x866D, 0x866D, 0x47F0, 0x866E, 0x866E, 0x1BF3,
- 0x866F, 0x8670, 0x47F1, 0x8671, 0x8671, 0x0D44, 0x8672, 0x8678, 0x47F3,
- 0x8679, 0x8679, 0x079E, 0x867A, 0x867A, 0x1BF5, 0x867B, 0x867B, 0x1BF7,
- 0x867C, 0x867C, 0x1BF6, 0x867D, 0x867D, 0x0DD9, 0x867E, 0x867E, 0x0F27,
- 0x867F, 0x867F, 0x1BF4, 0x8680, 0x8680, 0x0D4B, 0x8681, 0x8681, 0x1056,
- 0x8682, 0x8682, 0x0A93, 0x8683, 0x8689, 0x47FA, 0x868A, 0x868A, 0x0ED2,
- 0x868B, 0x868B, 0x1BFA, 0x868C, 0x868C, 0x0401, 0x868D, 0x868D, 0x1BF9,
- 0x868E, 0x8692, 0x4801, 0x8693, 0x8693, 0x1C00, 0x8694, 0x8694, 0x4806,
- 0x8695, 0x8695, 0x0496, 0x8696, 0x869B, 0x4807, 0x869C, 0x869C, 0x0FEA,
- 0x869D, 0x869D, 0x1BFC, 0x869E, 0x86A2, 0x480D, 0x86A3, 0x86A3, 0x1BFE,
- 0x86A4, 0x86A4, 0x112C, 0x86A5, 0x86A6, 0x4812, 0x86A7, 0x86A7, 0x1BFD,
- 0x86A8, 0x86A8, 0x1BF8, 0x86A9, 0x86A9, 0x1C01, 0x86AA, 0x86AA, 0x1BFF,
- 0x86AB, 0x86AB, 0x4814, 0x86AC, 0x86AC, 0x1BFB, 0x86AD, 0x86AE, 0x4815,
- 0x86AF, 0x86AF, 0x1C09, 0x86B0, 0x86B0, 0x1C06, 0x86B1, 0x86B1, 0x1C08,
- 0x86B2, 0x86B3, 0x4817, 0x86B4, 0x86B4, 0x1C0C, 0x86B5, 0x86B5, 0x1C04,
- 0x86B6, 0x86B6, 0x1C02, 0x86B7, 0x86B9, 0x4819, 0x86BA, 0x86BA, 0x1C07,
- 0x86BB, 0x86BF, 0x481C, 0x86C0, 0x86C0, 0x11FA, 0x86C1, 0x86C3, 0x4821,
- 0x86C4, 0x86C4, 0x1C03, 0x86C5, 0x86C5, 0x4824, 0x86C6, 0x86C6, 0x0C76,
- 0x86C7, 0x86C7, 0x0D18, 0x86C8, 0x86C8, 0x4825, 0x86C9, 0x86C9, 0x1C0A,
- 0x86CA, 0x86CA, 0x071F, 0x86CB, 0x86CB, 0x0591, 0x86CC, 0x86CD, 0x4826,
- 0x86CE, 0x86CE, 0x1C05, 0x86CF, 0x86CF, 0x1C0B, 0x86D0, 0x86D0, 0x1C12,
- 0x86D1, 0x86D1, 0x1C18, 0x86D2, 0x86D3, 0x4828, 0x86D4, 0x86D4, 0x07EC,
- 0x86D5, 0x86D7, 0x482A, 0x86D8, 0x86D8, 0x1C17, 0x86D9, 0x86D9, 0x0E8D,
- 0x86DA, 0x86DA, 0x482D, 0x86DB, 0x86DB, 0x11EA, 0x86DC, 0x86DD, 0x482E,
- 0x86DE, 0x86DE, 0x1C14, 0x86DF, 0x86DF, 0x1C16, 0x86E0, 0x86E3, 0x4830,
- 0x86E4, 0x86E4, 0x06ED, 0x86E5, 0x86E8, 0x4834, 0x86E9, 0x86E9, 0x1C0D,
- 0x86EA, 0x86EC, 0x4838, 0x86ED, 0x86ED, 0x1C10, 0x86EE, 0x86EE, 0x0AA0,
- 0x86EF, 0x86EF, 0x483B, 0x86F0, 0x86F0, 0x117E, 0x86F1, 0x86F2, 0x1C0E,
- 0x86F3, 0x86F3, 0x1C11, 0x86F4, 0x86F4, 0x1C15, 0x86F5, 0x86F7, 0x483C,
- 0x86F8, 0x86F8, 0x1C1B, 0x86F9, 0x86F9, 0x10A1, 0x86FA, 0x86FA, 0x25DA,
- 0x86FB, 0x86FD, 0x483F, 0x86FE, 0x86FE, 0x0629, 0x86FF, 0x86FF, 0x4842,
- 0x8700, 0x8700, 0x0D88, 0x8701, 0x8701, 0x4843, 0x8702, 0x8702, 0x0681,
- 0x8703, 0x8703, 0x1C19, 0x8704, 0x8705, 0x4844, 0x8706, 0x8706, 0x25D7,
- 0x8707, 0x8707, 0x1C1A, 0x8708, 0x8708, 0x1C1C, 0x8709, 0x8709, 0x1C1F,
- 0x870A, 0x870A, 0x1C1D, 0x870B, 0x870C, 0x4846, 0x870D, 0x870D, 0x1C1E,
- 0x870E, 0x8711, 0x4848, 0x8712, 0x8712, 0x0FFA, 0x8713, 0x8713, 0x1C13,
- 0x8714, 0x8714, 0x484C, 0x8715, 0x8715, 0x0E7A, 0x8716, 0x8716, 0x484D,
- 0x8717, 0x8717, 0x0EDE, 0x8718, 0x8718, 0x11A8, 0x8719, 0x8719, 0x484E,
- 0x871A, 0x871A, 0x1C25, 0x871B, 0x871B, 0x484F, 0x871C, 0x871C, 0x0AE0,
- 0x871D, 0x871D, 0x4850, 0x871E, 0x871E, 0x1C22, 0x871F, 0x8720, 0x4851,
- 0x8721, 0x8721, 0x099A, 0x8722, 0x8722, 0x1C2E, 0x8723, 0x8723, 0x1C20,
- 0x8724, 0x8724, 0x4853, 0x8725, 0x8725, 0x1C23, 0x8726, 0x8728, 0x4854,
- 0x8729, 0x8729, 0x1C2A, 0x872A, 0x872D, 0x4857, 0x872E, 0x872E, 0x1C24,
- 0x872F, 0x8730, 0x485B, 0x8731, 0x8731, 0x1C29, 0x8732, 0x8733, 0x485D,
- 0x8734, 0x8734, 0x1C28, 0x8735, 0x8736, 0x485F, 0x8737, 0x8737, 0x1C2B,
- 0x8738, 0x873A, 0x4861, 0x873B, 0x873B, 0x1C21, 0x873C, 0x873D, 0x4864,
- 0x873E, 0x873E, 0x1C26, 0x873F, 0x873F, 0x1C2C, 0x8740, 0x8746, 0x4866,
- 0x8747, 0x8747, 0x1091, 0x8748, 0x8748, 0x1C27, 0x8749, 0x8749, 0x04BC,
- 0x874A, 0x874B, 0x486D, 0x874C, 0x874C, 0x1C34, 0x874D, 0x874D, 0x486F,
- 0x874E, 0x874E, 0x0F76, 0x874F, 0x8752, 0x4870, 0x8753, 0x8753, 0x1C37,
- 0x8754, 0x8754, 0x4874, 0x8755, 0x8755, 0x212E, 0x8756, 0x8756, 0x4875,
- 0x8757, 0x8757, 0x07DD, 0x8758, 0x8758, 0x4876, 0x8759, 0x8759, 0x1C3B,
- 0x875A, 0x875F, 0x4877, 0x8760, 0x8760, 0x1C32, 0x8761, 0x8762, 0x487D,
- 0x8763, 0x8763, 0x1C38, 0x8764, 0x8764, 0x1C3A, 0x8765, 0x8765, 0x1C3C,
- 0x8766, 0x8766, 0x21B2, 0x8767, 0x876D, 0x487F, 0x876E, 0x876E, 0x1C35,
- 0x876F, 0x876F, 0x4886, 0x8770, 0x8770, 0x1C33, 0x8771, 0x8773, 0x4887,
- 0x8774, 0x8774, 0x07B2, 0x8775, 0x8775, 0x488A, 0x8776, 0x8776, 0x05DC,
- 0x8777, 0x8777, 0x488B, 0x8778, 0x8778, 0x219E, 0x8779, 0x877A, 0x488C,
- 0x877B, 0x877B, 0x1C31, 0x877C, 0x877C, 0x1C39, 0x877D, 0x877E, 0x1C2F,
- 0x877F, 0x8781, 0x488E, 0x8782, 0x8782, 0x1C2D, 0x8783, 0x8783, 0x1C46,
- 0x8784, 0x8784, 0x25DC, 0x8785, 0x8785, 0x1C43, 0x8786, 0x8787, 0x4891,
- 0x8788, 0x8788, 0x1C42, 0x8789, 0x878A, 0x4893, 0x878B, 0x878B, 0x1C36,
- 0x878C, 0x878C, 0x4895, 0x878D, 0x878D, 0x0CB5, 0x878E, 0x8792, 0x4896,
- 0x8793, 0x8793, 0x1C3D, 0x8794, 0x8796, 0x489B, 0x8797, 0x8797, 0x1C45,
- 0x8798, 0x879D, 0x489E, 0x879E, 0x879E, 0x206C, 0x879F, 0x879F, 0x0AFD,
- 0x87A0, 0x87A1, 0x48A4, 0x87A2, 0x87A2, 0x2226, 0x87A3, 0x87A7, 0x48A6,
- 0x87A8, 0x87A8, 0x1C3F, 0x87A9, 0x87AA, 0x48AB, 0x87AB, 0x87AB, 0x1C47,
- 0x87AC, 0x87AC, 0x1C49, 0x87AD, 0x87AD, 0x1C44, 0x87AE, 0x87AE, 0x48AD,
- 0x87AF, 0x87AF, 0x1C3E, 0x87B0, 0x87B2, 0x48AE, 0x87B3, 0x87B3, 0x1C4B,
- 0x87B4, 0x87B4, 0x48B1, 0x87B5, 0x87B5, 0x1C4A, 0x87B6, 0x87B9, 0x48B2,
- 0x87BA, 0x87BA, 0x0A84, 0x87BB, 0x87BB, 0x25E0, 0x87BC, 0x87BC, 0x48B6,
- 0x87BD, 0x87BD, 0x1C4E, 0x87BE, 0x87BF, 0x48B7, 0x87C0, 0x87C0, 0x1C50,
- 0x87C1, 0x87C3, 0x48B9, 0x87C4, 0x87C4, 0x227B, 0x87C5, 0x87C5, 0x48BC,
- 0x87C6, 0x87C6, 0x1C41, 0x87C7, 0x87C7, 0x48BD, 0x87C8, 0x87C8, 0x25DE,
- 0x87C9, 0x87C9, 0x48BE, 0x87CA, 0x87CA, 0x1C51, 0x87CB, 0x87CB, 0x1C4C,
- 0x87CC, 0x87CD, 0x48BF, 0x87CE, 0x87CE, 0x25E1, 0x87CF, 0x87D0, 0x48C1,
- 0x87D1, 0x87D1, 0x1C4F, 0x87D2, 0x87D2, 0x1C40, 0x87D3, 0x87D3, 0x1C4D,
- 0x87D4, 0x87DA, 0x48C3, 0x87DB, 0x87DB, 0x1C52, 0x87DC, 0x87DF, 0x48CA,
- 0x87E0, 0x87E0, 0x1C54, 0x87E1, 0x87E2, 0x48CE, 0x87E3, 0x87E3, 0x25D5,
- 0x87E4, 0x87E4, 0x48D0, 0x87E5, 0x87E5, 0x1C48, 0x87E6, 0x87E9, 0x48D1,
- 0x87EA, 0x87EA, 0x1C53, 0x87EB, 0x87EB, 0x48D5, 0x87EC, 0x87EC, 0x1E6B,
- 0x87ED, 0x87ED, 0x48D6, 0x87EE, 0x87EE, 0x1C55, 0x87EF, 0x87EF, 0x25DB,
- 0x87F0, 0x87F1, 0x48D7, 0x87F2, 0x87F2, 0x1E89, 0x87F3, 0x87F5, 0x48D9,
- 0x87F6, 0x87F6, 0x25D9, 0x87F7, 0x87F8, 0x48DC, 0x87F9, 0x87F9, 0x0F82,
- 0x87FA, 0x87FA, 0x48DE, 0x87FB, 0x87FB, 0x2211, 0x87FC, 0x87FD, 0x48DF,
- 0x87FE, 0x87FE, 0x1C58, 0x87FF, 0x87FF, 0x48E1, 0x8800, 0x8802, 0x48E2,
- 0x8803, 0x8803, 0x130D, 0x8804, 0x8804, 0x48E5, 0x8805, 0x8805, 0x2229,
- 0x8806, 0x8806, 0x25D6, 0x8807, 0x8809, 0x48E6, 0x880A, 0x880A, 0x1C59,
- 0x880B, 0x880F, 0x48E9, 0x8810, 0x8810, 0x25DD, 0x8811, 0x8811, 0x25DF,
- 0x8812, 0x8812, 0x48EE, 0x8813, 0x8813, 0x1C57, 0x8814, 0x8814, 0x48EF,
- 0x8815, 0x8815, 0x0CBF, 0x8816, 0x8816, 0x1C56, 0x8817, 0x881A, 0x48F0,
- 0x881B, 0x881B, 0x1C5A, 0x881C, 0x881E, 0x48F4, 0x881F, 0x881F, 0x1FEF,
- 0x8820, 0x8820, 0x48F7, 0x8821, 0x8821, 0x1C5B, 0x8822, 0x8822, 0x0543,
- 0x8823, 0x8823, 0x25D8, 0x8824, 0x8830, 0x48F8, 0x8831, 0x8831, 0x1F29,
- 0x8832, 0x8832, 0x1A8D, 0x8833, 0x8835, 0x4905, 0x8836, 0x8836, 0x1E5B,
- 0x8837, 0x8838, 0x4908, 0x8839, 0x8839, 0x1C5C, 0x883A, 0x883A, 0x490A,
- 0x883B, 0x883B, 0x2076, 0x883C, 0x883C, 0x1C5D, 0x883D, 0x883F, 0x490B,
- 0x8840, 0x8840, 0x0FD3, 0x8841, 0x8843, 0x490E, 0x8844, 0x8844, 0x1CAA,
- 0x8845, 0x8845, 0x0F91, 0x8846, 0x8846, 0x2297, 0x8847, 0x8849, 0x4911,
- 0x884A, 0x884A, 0x2690, 0x884B, 0x884B, 0x4914, 0x884C, 0x884C, 0x0F9B,
- 0x884D, 0x884D, 0x1005, 0x884E, 0x8852, 0x4915, 0x8853, 0x8853, 0x213F,
- 0x8854, 0x8854, 0x0F3B, 0x8855, 0x8856, 0x491A, 0x8857, 0x8857, 0x08A7,
- 0x8858, 0x8858, 0x491C, 0x8859, 0x8859, 0x0FEC, 0x885A, 0x885A, 0x491D,
- 0x885B, 0x885B, 0x2198, 0x885C, 0x885C, 0x491E, 0x885D, 0x885D, 0x1E88,
- 0x885E, 0x8860, 0x491F, 0x8861, 0x8861, 0x0799, 0x8862, 0x8862, 0x15ED,
- 0x8863, 0x8863, 0x1049, 0x8864, 0x8864, 0x1BA6, 0x8865, 0x8865, 0x0480,
- 0x8866, 0x8867, 0x4922, 0x8868, 0x8868, 0x0456, 0x8869, 0x8869, 0x1BA7,
- 0x886A, 0x886A, 0x4924, 0x886B, 0x886B, 0x0CF9, 0x886C, 0x886C, 0x04E9,
- 0x886D, 0x886D, 0x4925, 0x886E, 0x886E, 0x1306, 0x886F, 0x886F, 0x4926,
- 0x8870, 0x8870, 0x0D9A, 0x8871, 0x8871, 0x4927, 0x8872, 0x8872, 0x1BA8,
- 0x8873, 0x8876, 0x4928, 0x8877, 0x8877, 0x11D3, 0x8878, 0x8878, 0x492C,
- 0x8879, 0x8879, 0x228C, 0x887A, 0x887C, 0x492D, 0x887D, 0x887D, 0x1BA9,
- 0x887E, 0x887E, 0x1CBE, 0x887F, 0x887F, 0x1BAA, 0x8880, 0x8880, 0x4930,
- 0x8881, 0x8881, 0x10EF, 0x8882, 0x8882, 0x1BAB, 0x8883, 0x8883, 0x4931,
- 0x8884, 0x8884, 0x03CB, 0x8885, 0x8885, 0x1CBF, 0x8886, 0x8887, 0x4932,
- 0x8888, 0x8888, 0x1CC0, 0x8889, 0x888A, 0x4934, 0x888B, 0x888B, 0x057F,
- 0x888C, 0x888C, 0x4936, 0x888D, 0x888D, 0x0B9C, 0x888E, 0x8891, 0x4937,
- 0x8892, 0x8892, 0x0E0E, 0x8893, 0x8895, 0x493B, 0x8896, 0x8896, 0x0FAF,
- 0x8897, 0x889B, 0x493E, 0x889C, 0x889C, 0x0E91, 0x889D, 0x88A1, 0x4943,
- 0x88A2, 0x88A2, 0x1BAC, 0x88A3, 0x88A3, 0x4948, 0x88A4, 0x88A4, 0x1307,
- 0x88A5, 0x88AA, 0x4949, 0x88AB, 0x88AB, 0x0424, 0x88AC, 0x88AC, 0x494F,
- 0x88AD, 0x88AD, 0x0F1B, 0x88AE, 0x88B0, 0x4950, 0x88B1, 0x88B1, 0x069F,
- 0x88B2, 0x88B6, 0x4953, 0x88B7, 0x88B7, 0x1BAE, 0x88B8, 0x88BB, 0x4958,
- 0x88BC, 0x88BC, 0x1BAF, 0x88BD, 0x88C0, 0x495C, 0x88C1, 0x88C1, 0x048A,
- 0x88C2, 0x88C2, 0x0A1A, 0x88C3, 0x88C4, 0x4960, 0x88C5, 0x88C5, 0x120D,
- 0x88C6, 0x88C6, 0x1BAD, 0x88C7, 0x88C8, 0x4962, 0x88C9, 0x88C9, 0x1BB0,
- 0x88CA, 0x88CA, 0x25F1, 0x88CB, 0x88CD, 0x4964, 0x88CE, 0x88CE, 0x1BB2,
- 0x88CF, 0x88CF, 0x200C, 0x88D0, 0x88D1, 0x4967, 0x88D2, 0x88D2, 0x130A,
- 0x88D3, 0x88D3, 0x4969, 0x88D4, 0x88D4, 0x1068, 0x88D5, 0x88D5, 0x10E6,
- 0x88D6, 0x88D7, 0x496A, 0x88D8, 0x88D8, 0x1CC1, 0x88D9, 0x88D9, 0x0C94,
- 0x88DA, 0x88DB, 0x496C, 0x88DC, 0x88DC, 0x1E58, 0x88DD, 0x88DD, 0x22AC,
- 0x88DE, 0x88DE, 0x496E, 0x88DF, 0x88DF, 0x1CC2, 0x88E0, 0x88E1, 0x496F,
- 0x88E2, 0x88E2, 0x1BB1, 0x88E3, 0x88E3, 0x1BB3, 0x88E4, 0x88E4, 0x0970,
- 0x88E5, 0x88E5, 0x1BB4, 0x88E6, 0x88E7, 0x4971, 0x88E8, 0x88E8, 0x1BB8,
- 0x88E9, 0x88EF, 0x4973, 0x88F0, 0x88F0, 0x1BBA, 0x88F1, 0x88F1, 0x1BB5,
- 0x88F2, 0x88F2, 0x497A, 0x88F3, 0x88F3, 0x0D0A, 0x88F4, 0x88F4, 0x0BA2,
- 0x88F5, 0x88F7, 0x497B, 0x88F8, 0x88F8, 0x0A8A, 0x88F9, 0x88F9, 0x0755,
- 0x88FA, 0x88FB, 0x497E, 0x88FC, 0x88FC, 0x1BB7, 0x88FD, 0x88FD, 0x26A7,
- 0x88FE, 0x88FE, 0x1BB9, 0x88FF, 0x88FF, 0x4980, 0x8900, 0x8901, 0x4981,
- 0x8902, 0x8902, 0x072C, 0x8903, 0x8906, 0x4983, 0x8907, 0x8907, 0x2676,
- 0x8908, 0x8909, 0x4987, 0x890A, 0x890A, 0x1BBF, 0x890B, 0x890F, 0x4989,
- 0x8910, 0x8910, 0x078D, 0x8911, 0x8911, 0x498E, 0x8912, 0x8912, 0x0408,
- 0x8913, 0x8913, 0x1BBD, 0x8914, 0x8918, 0x498F, 0x8919, 0x8919, 0x1BBC,
- 0x891A, 0x891A, 0x1BB6, 0x891B, 0x891B, 0x1BBE, 0x891C, 0x8920, 0x4994,
- 0x8921, 0x8921, 0x1BBB, 0x8922, 0x8924, 0x4999, 0x8925, 0x8925, 0x0CC7,
- 0x8926, 0x8929, 0x499C, 0x892A, 0x892A, 0x0E7B, 0x892B, 0x892B, 0x1BC1,
- 0x892C, 0x892F, 0x49A0, 0x8930, 0x8930, 0x1739, 0x8931, 0x8931, 0x49A4,
- 0x8932, 0x8932, 0x1FE1, 0x8933, 0x8933, 0x25BB, 0x8934, 0x8934, 0x1BC0,
- 0x8935, 0x8935, 0x49A5, 0x8936, 0x8936, 0x1BC2, 0x8937, 0x8937, 0x49A6,
- 0x8938, 0x8938, 0x25BE, 0x8939, 0x893A, 0x49A7, 0x893B, 0x893B, 0x22DD,
- 0x893C, 0x8940, 0x49A9, 0x8941, 0x8941, 0x1BC3, 0x8942, 0x8943, 0x49AE,
- 0x8944, 0x8944, 0x0F52, 0x8945, 0x8946, 0x49B0, 0x8947, 0x8947, 0x25BD,
- 0x8948, 0x8955, 0x49B2, 0x8956, 0x8956, 0x1E2A, 0x8957, 0x895C, 0x49C0,
- 0x895D, 0x895D, 0x25BC, 0x895E, 0x895E, 0x1CC3, 0x895F, 0x895F, 0x08C4,
- 0x8960, 0x8960, 0x25BA, 0x8961, 0x8963, 0x49C6, 0x8964, 0x8964, 0x25BF,
- 0x8965, 0x8965, 0x49C9, 0x8966, 0x8966, 0x1BC4, 0x8967, 0x8969, 0x49CA,
- 0x896A, 0x896A, 0x2187, 0x896B, 0x896B, 0x49CD, 0x896C, 0x896C, 0x266B,
- 0x896D, 0x896E, 0x49CE, 0x896F, 0x896F, 0x1E7F, 0x8970, 0x8971, 0x49D0,
- 0x8972, 0x8972, 0x21AD, 0x8973, 0x897A, 0x49D2, 0x897B, 0x897B, 0x1BC5,
- 0x897C, 0x897E, 0x49DA, 0x897F, 0x897F, 0x0F06, 0x8980, 0x8980, 0x49DD,
- 0x8981, 0x8981, 0x1031, 0x8982, 0x8982, 0x49DE, 0x8983, 0x8983, 0x1BDF,
- 0x8984, 0x8985, 0x49DF, 0x8986, 0x8986, 0x06AD, 0x8987, 0x898A, 0x49E1,
- 0x898B, 0x898B, 0x1F96, 0x898C, 0x898E, 0x49E5, 0x898F, 0x898F, 0x1F32,
- 0x8990, 0x8992, 0x49E8, 0x8993, 0x8993, 0x2084, 0x8994, 0x8995, 0x49EB,
- 0x8996, 0x8996, 0x2136, 0x8997, 0x8997, 0x49ED, 0x8998, 0x8998, 0x24B8,
- 0x8999, 0x89A0, 0x49EE, 0x89A1, 0x89A1, 0x24BA, 0x89A2, 0x89A5, 0x49F6,
- 0x89A6, 0x89A6, 0x24BC, 0x89A7, 0x89A9, 0x49FA, 0x89AA, 0x89AA, 0x20E4,
- 0x89AB, 0x89AB, 0x49FD, 0x89AC, 0x89AC, 0x24B9, 0x89AD, 0x89AE, 0x49FE,
- 0x89AF, 0x89AF, 0x24BD, 0x89B0, 0x89B1, 0x4A00, 0x89B2, 0x89B2, 0x24BE,
- 0x89B3, 0x89B6, 0x4A02, 0x89B7, 0x89B7, 0x24BF, 0x89B8, 0x89B9, 0x4A06,
- 0x89BA, 0x89BA, 0x1FD2, 0x89BB, 0x89BC, 0x4A08, 0x89BD, 0x89BD, 0x1FFD,
- 0x89BE, 0x89BE, 0x4A0A, 0x89BF, 0x89BF, 0x24BB, 0x89C0, 0x89C0, 0x1F2D,
- 0x89C1, 0x89C1, 0x086E, 0x89C2, 0x89C2, 0x0734, 0x89C3, 0x89C3, 0x4A0B,
- 0x89C4, 0x89C4, 0x073F, 0x89C5, 0x89C5, 0x0ADE, 0x89C6, 0x89C6, 0x0D6A,
- 0x89C7, 0x89C7, 0x193A, 0x89C8, 0x89C8, 0x09AB, 0x89C9, 0x89C9, 0x0924,
- 0x89CA, 0x89CC, 0x193B, 0x89CD, 0x89CD, 0x4A0C, 0x89CE, 0x89D1, 0x193E,
- 0x89D2, 0x89D2, 0x0898, 0x89D3, 0x89D5, 0x4A0D, 0x89D6, 0x89D6, 0x1D57,
- 0x89D7, 0x89D9, 0x4A10, 0x89DA, 0x89DA, 0x1D59, 0x89DB, 0x89DB, 0x4A13,
- 0x89DC, 0x89DC, 0x1D5A, 0x89DD, 0x89DD, 0x4A14, 0x89DE, 0x89DE, 0x1D58,
- 0x89DF, 0x89E2, 0x4A15, 0x89E3, 0x89E3, 0x08B3, 0x89E4, 0x89E4, 0x4A19,
- 0x89E5, 0x89E5, 0x1D5B, 0x89E6, 0x89E6, 0x0528, 0x89E7, 0x89EA, 0x4A1A,
- 0x89EB, 0x89EB, 0x1D5C, 0x89EC, 0x89EE, 0x4A1E, 0x89EF, 0x89EF, 0x1D5D,
- 0x89F0, 0x89F2, 0x4A21, 0x89F3, 0x89F3, 0x19C0, 0x89F4, 0x89F4, 0x2609,
- 0x89F5, 0x89F5, 0x4A24, 0x89F6, 0x89F6, 0x260A, 0x89F7, 0x89F7, 0x4A25,
- 0x89F8, 0x89F8, 0x1E94, 0x89F9, 0x89FF, 0x4A26, 0x8A00, 0x8A00, 0x0FFD,
- 0x8A01, 0x8A01, 0x22DF, 0x8A02, 0x8A02, 0x1ECB, 0x8A03, 0x8A03, 0x1F0D,
- 0x8A04, 0x8A06, 0x4A2D, 0x8A07, 0x8A07, 0x12FE, 0x8A08, 0x8A08, 0x1F77,
- 0x8A09, 0x8A09, 0x4A30, 0x8A0A, 0x8A0A, 0x21EB, 0x8A0B, 0x8A0B, 0x4A31,
- 0x8A0C, 0x8A0C, 0x22E1, 0x8A0D, 0x8A0D, 0x4A32, 0x8A0E, 0x8A0E, 0x216F,
- 0x8A0F, 0x8A0F, 0x4A33, 0x8A10, 0x8A10, 0x22E0, 0x8A11, 0x8A12, 0x4A34,
- 0x8A13, 0x8A13, 0x21EA, 0x8A14, 0x8A14, 0x4A36, 0x8A15, 0x8A15, 0x22E2,
- 0x8A16, 0x8A16, 0x20CB, 0x8A17, 0x8A17, 0x4A37, 0x8A18, 0x8A18, 0x1F78,
- 0x8A19, 0x8A1A, 0x4A38, 0x8A1B, 0x8A1B, 0x1EE2, 0x8A1C, 0x8A1C, 0x4A3A,
- 0x8A1D, 0x8A1D, 0x21F2, 0x8A1E, 0x8A1E, 0x4A3B, 0x8A1F, 0x8A1F, 0x2150,
- 0x8A20, 0x8A22, 0x4A3C, 0x8A23, 0x8A23, 0x1FD3, 0x8A24, 0x8A24, 0x4A3F,
- 0x8A25, 0x8A25, 0x22E5, 0x8A26, 0x8A29, 0x4A40, 0x8A2A, 0x8A2A, 0x1EF2,
- 0x8A2B, 0x8A2C, 0x4A44, 0x8A2D, 0x8A2D, 0x211F, 0x8A2E, 0x8A30, 0x4A46,
- 0x8A31, 0x8A31, 0x21DD, 0x8A32, 0x8A33, 0x4A49, 0x8A34, 0x8A34, 0x2154,
- 0x8A35, 0x8A35, 0x4A4B, 0x8A36, 0x8A36, 0x22E7, 0x8A37, 0x8A39, 0x4A4C,
- 0x8A3A, 0x8A3A, 0x2282, 0x8A3B, 0x8A3D, 0x4A4F, 0x8A3E, 0x8A3E, 0x1D5E,
- 0x8A3F, 0x8A40, 0x4A52, 0x8A41, 0x8A41, 0x22E6, 0x8A42, 0x8A45, 0x4A54,
- 0x8A46, 0x8A46, 0x22E8, 0x8A47, 0x8A47, 0x4A58, 0x8A48, 0x8A48, 0x1A84,
- 0x8A49, 0x8A4D, 0x4A59, 0x8A4E, 0x8A4E, 0x22E4, 0x8A4F, 0x8A4F, 0x4A5E,
- 0x8A50, 0x8A50, 0x226A, 0x8A51, 0x8A51, 0x4A5F, 0x8A52, 0x8A52, 0x22EB,
- 0x8A53, 0x8A53, 0x4A60, 0x8A54, 0x8A54, 0x22E9, 0x8A55, 0x8A55, 0x20BD,
- 0x8A56, 0x8A57, 0x4A61, 0x8A58, 0x8A58, 0x22EA, 0x8A59, 0x8A5A, 0x4A63,
- 0x8A5B, 0x8A5B, 0x22BD, 0x8A5C, 0x8A5D, 0x4A65, 0x8A5E, 0x8A5E, 0x1E9E,
- 0x8A5F, 0x8A60, 0x4A67, 0x8A61, 0x8A61, 0x22F6, 0x8A62, 0x8A62, 0x21E7,
- 0x8A63, 0x8A63, 0x2216, 0x8A64, 0x8A65, 0x4A69, 0x8A66, 0x8A66, 0x2137,
- 0x8A67, 0x8A68, 0x4A6B, 0x8A69, 0x8A69, 0x212C, 0x8A6A, 0x8A6A, 0x4A6D,
- 0x8A6B, 0x8A6B, 0x1E68, 0x8A6C, 0x8A6C, 0x22F2, 0x8A6D, 0x8A6D, 0x1F37,
- 0x8A6E, 0x8A6E, 0x22F3, 0x8A6F, 0x8A6F, 0x4A6E, 0x8A70, 0x8A70, 0x22EF,
- 0x8A71, 0x8A71, 0x1F50, 0x8A72, 0x8A72, 0x1F10, 0x8A73, 0x8A73, 0x21C8,
- 0x8A74, 0x8A74, 0x4A6F, 0x8A75, 0x8A75, 0x22F1, 0x8A76, 0x8A78, 0x4A70,
- 0x8A79, 0x8A79, 0x1153, 0x8A7A, 0x8A7B, 0x4A73, 0x8A7C, 0x8A7C, 0x22F0,
- 0x8A7D, 0x8A7E, 0x4A75, 0x8A7F, 0x8A7F, 0x22EE, 0x8A80, 0x8A83, 0x4A77,
- 0x8A84, 0x8A84, 0x22ED, 0x8A85, 0x8A85, 0x229E, 0x8A86, 0x8A86, 0x22EC,
- 0x8A87, 0x8A87, 0x1FE2, 0x8A88, 0x8A88, 0x4A7B, 0x8A89, 0x8A89, 0x10E3,
- 0x8A8A, 0x8A8A, 0x0E2F, 0x8A8B, 0x8A8C, 0x4A7C, 0x8A8D, 0x8A8D, 0x20FE,
- 0x8A8E, 0x8A90, 0x4A7E, 0x8A91, 0x8A92, 0x22F9, 0x8A93, 0x8A93, 0x0D5B,
- 0x8A94, 0x8A94, 0x4A81, 0x8A95, 0x8A95, 0x1EAF, 0x8A96, 0x8A97, 0x4A82,
- 0x8A98, 0x8A98, 0x2236, 0x8A99, 0x8A99, 0x4A84, 0x8A9A, 0x8A9A, 0x22F7,
- 0x8A9B, 0x8A9D, 0x4A85, 0x8A9E, 0x8A9E, 0x223D, 0x8A9F, 0x8A9F, 0x4A88,
- 0x8AA0, 0x8AA0, 0x1E82, 0x8AA1, 0x8AA1, 0x1FB6, 0x8AA2, 0x8AA2, 0x4A89,
- 0x8AA3, 0x8AA3, 0x21A4, 0x8AA4, 0x8AA4, 0x21AA, 0x8AA5, 0x8AA5, 0x22F8,
- 0x8AA6, 0x8AA6, 0x2151, 0x8AA7, 0x8AA7, 0x4A8A, 0x8AA8, 0x8AA8, 0x1F60,
- 0x8AA9, 0x8AAB, 0x4A8B, 0x8AAC, 0x8AAC, 0x2147, 0x8AAD, 0x8AAF, 0x4A8E,
- 0x8AB0, 0x8AB0, 0x2145, 0x8AB1, 0x8AB1, 0x4A91, 0x8AB2, 0x8AB2, 0x1FDC,
- 0x8AB3, 0x8AB5, 0x4A92, 0x8AB6, 0x8AB6, 0x2301, 0x8AB7, 0x8AB8, 0x4A95,
- 0x8AB9, 0x8AB9, 0x1EF5, 0x8ABA, 0x8ABB, 0x4A97, 0x8ABC, 0x8ABC, 0x2218,
- 0x8ABD, 0x8ABE, 0x4A99, 0x8ABF, 0x8ABF, 0x1EC6, 0x8AC0, 0x8AC1, 0x4A9B,
- 0x8AC2, 0x8AC2, 0x2300, 0x8AC3, 0x8AC3, 0x4A9D, 0x8AC4, 0x8AC4, 0x22B4,
- 0x8AC5, 0x8AC6, 0x4A9E, 0x8AC7, 0x8AC7, 0x2169, 0x8AC8, 0x8AC8, 0x4AA0,
- 0x8AC9, 0x8AC9, 0x22FD, 0x8ACA, 0x8ACA, 0x4AA1, 0x8ACB, 0x8ACB, 0x20EA,
- 0x8ACC, 0x8ACC, 0x4AA2, 0x8ACD, 0x8ACD, 0x22F4, 0x8ACE, 0x8ACE, 0x4AA3,
- 0x8ACF, 0x8ACF, 0x22FB, 0x8AD0, 0x8AD0, 0x4AA4, 0x8AD1, 0x8AD1, 0x22FC,
- 0x8AD2, 0x8AD2, 0x2027, 0x8AD3, 0x8AD5, 0x4AA5, 0x8AD6, 0x8AD6, 0x2060,
- 0x8AD7, 0x8AD7, 0x22FF, 0x8AD8, 0x8ADA, 0x4AA8, 0x8ADB, 0x8ADB, 0x22FE,
- 0x8ADC, 0x8ADC, 0x1EC7, 0x8ADD, 0x8ADD, 0x4AAB, 0x8ADE, 0x8ADE, 0x230C,
- 0x8ADF, 0x8AE1, 0x4AAC, 0x8AE2, 0x8AE2, 0x22F5, 0x8AE3, 0x8AE3, 0x4AAF,
- 0x8AE4, 0x8AE4, 0x2306, 0x8AE5, 0x8AE5, 0x4AB0, 0x8AE6, 0x8AE6, 0x230A,
- 0x8AE7, 0x8AE7, 0x21D3, 0x8AE8, 0x8AEA, 0x4AB1, 0x8AEB, 0x8AEB, 0x2303,
- 0x8AEC, 0x8AEC, 0x4AB4, 0x8AED, 0x8AED, 0x2307, 0x8AEE, 0x8AEE, 0x230B,
- 0x8AEF, 0x8AF0, 0x4AB5, 0x8AF1, 0x8AF1, 0x1F5F, 0x8AF2, 0x8AF2, 0x4AB7,
- 0x8AF3, 0x8AF3, 0x2309, 0x8AF4, 0x8AF5, 0x4AB8, 0x8AF6, 0x8AF6, 0x2302,
- 0x8AF7, 0x8AF7, 0x1F04, 0x8AF8, 0x8AF8, 0x229D, 0x8AF9, 0x8AF9, 0x4ABA,
- 0x8AFA, 0x8AFA, 0x21FB, 0x8AFB, 0x8AFB, 0x4ABB, 0x8AFC, 0x8AFC, 0x2308,
- 0x8AFD, 0x8AFD, 0x4ABC, 0x8AFE, 0x8AFE, 0x20AC, 0x8AFF, 0x8AFF, 0x4ABD,
- 0x8B00, 0x8B00, 0x208E, 0x8B01, 0x8B01, 0x2305, 0x8B02, 0x8B02, 0x2197,
- 0x8B03, 0x8B03, 0x4ABE, 0x8B04, 0x8B04, 0x2171, 0x8B05, 0x8B05, 0x2298,
- 0x8B06, 0x8B06, 0x4ABF, 0x8B07, 0x8B07, 0x173C, 0x8B08, 0x8B09, 0x4AC0,
- 0x8B0A, 0x8B0A, 0x1F57, 0x8B0B, 0x8B0D, 0x4AC2, 0x8B0E, 0x8B0E, 0x2082,
- 0x8B0F, 0x8B0F, 0x4AC5, 0x8B10, 0x8B10, 0x2311, 0x8B11, 0x8B13, 0x4AC6,
- 0x8B14, 0x8B14, 0x2304, 0x8B15, 0x8B15, 0x4AC9, 0x8B16, 0x8B16, 0x230F,
- 0x8B17, 0x8B17, 0x1E35, 0x8B18, 0x8B18, 0x4ACA, 0x8B19, 0x8B19, 0x20D1,
- 0x8B1A, 0x8B1A, 0x2310, 0x8B1B, 0x8B1B, 0x1FA3, 0x8B1C, 0x8B1C, 0x4ACB,
- 0x8B1D, 0x8B1D, 0x21D6, 0x8B1E, 0x8B20, 0x4ACC, 0x8B21, 0x8B21, 0x2206,
- 0x8B22, 0x8B25, 0x4ACF, 0x8B26, 0x8B26, 0x1D5F, 0x8B27, 0x8B27, 0x4AD3,
- 0x8B28, 0x8B28, 0x230D, 0x8B29, 0x8B2A, 0x4AD4, 0x8B2B, 0x8B2B, 0x2312,
- 0x8B2C, 0x8B2C, 0x208D, 0x8B2D, 0x8B2D, 0x2313, 0x8B2E, 0x8B32, 0x4AD6,
- 0x8B33, 0x8B33, 0x22E3, 0x8B34, 0x8B38, 0x4ADB, 0x8B39, 0x8B39, 0x1FBA,
- 0x8B3A, 0x8B3D, 0x4AE0, 0x8B3E, 0x8B3E, 0x2078, 0x8B3F, 0x8B48, 0x4AE4,
- 0x8B49, 0x8B49, 0x2288, 0x8B4A, 0x8B4D, 0x4AEE, 0x8B4E, 0x8B4E, 0x2316,
- 0x8B4F, 0x8B4F, 0x1F6B, 0x8B50, 0x8B55, 0x4AF2, 0x8B56, 0x8B56, 0x2314,
- 0x8B57, 0x8B57, 0x4AF8, 0x8B58, 0x8B58, 0x2130, 0x8B59, 0x8B59, 0x2315,
- 0x8B5A, 0x8B5A, 0x2168, 0x8B5B, 0x8B5B, 0x4AF9, 0x8B5C, 0x8B5C, 0x20C4,
- 0x8B5D, 0x8B65, 0x4AFA, 0x8B66, 0x8B66, 0x08DE, 0x8B67, 0x8B6A, 0x4B03,
- 0x8B6B, 0x8B6B, 0x2318, 0x8B6C, 0x8B6C, 0x0BC8, 0x8B6D, 0x8B6E, 0x4B07,
- 0x8B6F, 0x8B6F, 0x2219, 0x8B70, 0x8B70, 0x2217, 0x8B71, 0x8B73, 0x4B09,
- 0x8B74, 0x8B74, 0x20D5, 0x8B75, 0x8B76, 0x4B0C, 0x8B77, 0x8B77, 0x1F4A,
- 0x8B78, 0x8B7C, 0x4B0E, 0x8B7D, 0x8B7D, 0x2240, 0x8B7E, 0x8B7F, 0x4B13,
- 0x8B80, 0x8B80, 0x1ED3, 0x8B81, 0x8B89, 0x4B15, 0x8B8A, 0x8B8A, 0x1E49,
- 0x8B8B, 0x8B8D, 0x4B1E, 0x8B8E, 0x8B8E, 0x261B, 0x8B8F, 0x8B91, 0x4B21,
- 0x8B92, 0x8B92, 0x1E6D, 0x8B93, 0x8B93, 0x20F8, 0x8B94, 0x8B94, 0x4B24,
- 0x8B95, 0x8B95, 0x1FFB, 0x8B96, 0x8B96, 0x2319, 0x8B97, 0x8B9B, 0x4B25,
- 0x8B9C, 0x8B9C, 0x230E, 0x8B9D, 0x8B9D, 0x4B2A, 0x8B9E, 0x8B9E, 0x2317,
- 0x8B9F, 0x8B9F, 0x4B2B, 0x8BA0, 0x8BA0, 0x1317, 0x8BA1, 0x8BA1, 0x0839,
- 0x8BA2, 0x8BA2, 0x05E8, 0x8BA3, 0x8BA3, 0x06B7, 0x8BA4, 0x8BA4, 0x0CAA,
- 0x8BA5, 0x8BA5, 0x0818, 0x8BA6, 0x8BA7, 0x1318, 0x8BA8, 0x8BA8, 0x0E29,
- 0x8BA9, 0x8BA9, 0x0C9E, 0x8BAA, 0x8BAA, 0x131A, 0x8BAB, 0x8BAB, 0x0C1C,
- 0x8BAC, 0x8BAC, 0x4B2C, 0x8BAD, 0x8BAD, 0x0FDE, 0x8BAE, 0x8BAE, 0x1070,
- 0x8BAF, 0x8BAF, 0x0FDF, 0x8BB0, 0x8BB0, 0x083A, 0x8BB1, 0x8BB1, 0x4B2D,
- 0x8BB2, 0x8BB2, 0x0883, 0x8BB3, 0x8BB3, 0x07F9, 0x8BB4, 0x8BB5, 0x131B,
- 0x8BB6, 0x8BB6, 0x0FF1, 0x8BB7, 0x8BB7, 0x131D, 0x8BB8, 0x8BB8, 0x0FB8,
- 0x8BB9, 0x8BB9, 0x062E, 0x8BBA, 0x8BBA, 0x0A82, 0x8BBB, 0x8BBB, 0x4B2E,
- 0x8BBC, 0x8BBC, 0x0DC4, 0x8BBD, 0x8BBD, 0x068A, 0x8BBE, 0x8BBE, 0x0D21,
- 0x8BBF, 0x8BBF, 0x0660, 0x8BC0, 0x8BC0, 0x0926, 0x8BC1, 0x8BC1, 0x11A3,
- 0x8BC2, 0x8BC3, 0x131E, 0x8BC4, 0x8BC4, 0x0BDF, 0x8BC5, 0x8BC5, 0x1244,
- 0x8BC6, 0x8BC6, 0x0D4D, 0x8BC7, 0x8BC7, 0x4B2F, 0x8BC8, 0x8BC8, 0x114A,
- 0x8BC9, 0x8BC9, 0x0DD4, 0x8BCA, 0x8BCA, 0x1190, 0x8BCB, 0x8BCB, 0x1320,
- 0x8BCC, 0x8BCC, 0x11DE, 0x8BCD, 0x8BCD, 0x054D, 0x8BCE, 0x8BCE, 0x1322,
- 0x8BCF, 0x8BCF, 0x1321, 0x8BD0, 0x8BD0, 0x4B30, 0x8BD1, 0x8BD1, 0x1072,
- 0x8BD2, 0x8BD4, 0x1323, 0x8BD5, 0x8BD5, 0x0D6B, 0x8BD6, 0x8BD6, 0x1326,
- 0x8BD7, 0x8BD7, 0x0D42, 0x8BD8, 0x8BD9, 0x1327, 0x8BDA, 0x8BDA, 0x04F4,
- 0x8BDB, 0x8BDB, 0x11EE, 0x8BDC, 0x8BDC, 0x1329, 0x8BDD, 0x8BDD, 0x07C5,
- 0x8BDE, 0x8BDE, 0x058F, 0x8BDF, 0x8BE0, 0x132A, 0x8BE1, 0x8BE1, 0x0747,
- 0x8BE2, 0x8BE2, 0x0FD8, 0x8BE3, 0x8BE3, 0x106F, 0x8BE4, 0x8BE4, 0x132C,
- 0x8BE5, 0x8BE5, 0x06BE, 0x8BE6, 0x8BE6, 0x0F57, 0x8BE7, 0x8BE7, 0x04B6,
- 0x8BE8, 0x8BE9, 0x132D, 0x8BEA, 0x8BEA, 0x4B31, 0x8BEB, 0x8BEB, 0x08BC,
- 0x8BEC, 0x8BEC, 0x0EEB, 0x8BED, 0x8BED, 0x10D4, 0x8BEE, 0x8BEE, 0x132F,
- 0x8BEF, 0x8BEF, 0x0F02, 0x8BF0, 0x8BF0, 0x1330, 0x8BF1, 0x8BF1, 0x10BA,
- 0x8BF2, 0x8BF2, 0x07FA, 0x8BF3, 0x8BF3, 0x1331, 0x8BF4, 0x8BF4, 0x0DAA,
- 0x8BF5, 0x8BF5, 0x0DC5, 0x8BF6, 0x8BF6, 0x1332, 0x8BF7, 0x8BF7, 0x0C68,
- 0x8BF8, 0x8BF8, 0x11ED, 0x8BF9, 0x8BF9, 0x1333, 0x8BFA, 0x8BFA, 0x0B76,
- 0x8BFB, 0x8BFB, 0x0600, 0x8BFC, 0x8BFC, 0x1334, 0x8BFD, 0x8BFD, 0x0669,
- 0x8BFE, 0x8BFE, 0x095B, 0x8BFF, 0x8BFF, 0x1335, 0x8C00, 0x8C00, 0x1336,
- 0x8C01, 0x8C01, 0x0DA2, 0x8C02, 0x8C02, 0x1337, 0x8C03, 0x8C03, 0x05D8,
- 0x8C04, 0x8C04, 0x1338, 0x8C05, 0x8C05, 0x0A0B, 0x8C06, 0x8C06, 0x1218,
- 0x8C07, 0x8C07, 0x1339, 0x8C08, 0x8C08, 0x0E0B, 0x8C09, 0x8C09, 0x4B32,
- 0x8C0A, 0x8C0A, 0x1071, 0x8C0B, 0x8C0B, 0x0B14, 0x8C0C, 0x8C0C, 0x133A,
- 0x8C0D, 0x8C0D, 0x05DE, 0x8C0E, 0x8C0E, 0x07E6, 0x8C0F, 0x8C0F, 0x133B,
- 0x8C10, 0x8C10, 0x0F7E, 0x8C11, 0x8C12, 0x133C, 0x8C13, 0x8C13, 0x0ECC,
- 0x8C14, 0x8C16, 0x133E, 0x8C17, 0x8C17, 0x04BE, 0x8C18, 0x8C18, 0x1343,
- 0x8C19, 0x8C19, 0x1341, 0x8C1A, 0x8C1A, 0x1011, 0x8C1B, 0x8C1B, 0x1342,
- 0x8C1C, 0x8C1C, 0x0ADA, 0x8C1D, 0x8C1D, 0x1344, 0x8C1E, 0x8C1E, 0x4B33,
- 0x8C1F, 0x8C21, 0x1345, 0x8C22, 0x8C22, 0x0F86, 0x8C23, 0x8C23, 0x102C,
- 0x8C24, 0x8C24, 0x0404, 0x8C25, 0x8C25, 0x1348, 0x8C26, 0x8C26, 0x0C28,
- 0x8C27, 0x8C27, 0x1349, 0x8C28, 0x8C28, 0x08C8, 0x8C29, 0x8C29, 0x0AA6,
- 0x8C2A, 0x8C2B, 0x134A, 0x8C2C, 0x8C2C, 0x0B02, 0x8C2D, 0x8C2D, 0x0E0A,
- 0x8C2E, 0x8C2F, 0x134C, 0x8C30, 0x8C30, 0x09A9, 0x8C31, 0x8C31, 0x0BF6,
- 0x8C32, 0x8C33, 0x134E, 0x8C34, 0x8C34, 0x0C31, 0x8C35, 0x8C36, 0x1350,
- 0x8C37, 0x8C37, 0x0721, 0x8C38, 0x8C40, 0x4B34, 0x8C41, 0x8C41, 0x0802,
- 0x8C42, 0x8C45, 0x4B3D, 0x8C46, 0x8C46, 0x05F8, 0x8C47, 0x8C47, 0x1CF6,
- 0x8C48, 0x8C48, 0x20C8, 0x8C49, 0x8C49, 0x1CF7, 0x8C4A, 0x8C4B, 0x4B41,
- 0x8C4C, 0x8C4C, 0x0E94, 0x8C4D, 0x8C4F, 0x4B43, 0x8C50, 0x8C50, 0x1EFD,
- 0x8C51, 0x8C54, 0x4B46, 0x8C55, 0x8C55, 0x1D15, 0x8C56, 0x8C59, 0x4B4A,
- 0x8C5A, 0x8C5A, 0x1990, 0x8C5B, 0x8C60, 0x4B4E, 0x8C61, 0x8C61, 0x0F60,
- 0x8C62, 0x8C62, 0x07D4, 0x8C63, 0x8C69, 0x4B54, 0x8C6A, 0x8C6A, 0x0777,
- 0x8C6B, 0x8C6B, 0x10E8, 0x8C6C, 0x8C72, 0x4B5B, 0x8C73, 0x8C73, 0x15DD,
- 0x8C74, 0x8C77, 0x4B62, 0x8C78, 0x8C78, 0x1D50, 0x8C79, 0x8C79, 0x0413,
- 0x8C7A, 0x8C7A, 0x04B9, 0x8C7B, 0x8C81, 0x4B66, 0x8C82, 0x8C82, 0x1D51,
- 0x8C83, 0x8C84, 0x4B6D, 0x8C85, 0x8C85, 0x1D53, 0x8C86, 0x8C88, 0x4B6F,
- 0x8C89, 0x8C89, 0x0788, 0x8C8A, 0x8C8A, 0x1D52, 0x8C8B, 0x8C8B, 0x4B72,
- 0x8C8C, 0x8C8C, 0x0AB7, 0x8C8D, 0x8C93, 0x4B73, 0x8C94, 0x8C94, 0x1D55,
- 0x8C95, 0x8C97, 0x4B7A, 0x8C98, 0x8C98, 0x1D54, 0x8C99, 0x8C9C, 0x4B7D,
- 0x8C9D, 0x8C9D, 0x1E3B, 0x8C9E, 0x8C9E, 0x227F, 0x8C9F, 0x8C9F, 0x4B81,
- 0x8CA0, 0x8CA0, 0x1F0C, 0x8CA1, 0x8CA1, 0x1E59, 0x8CA2, 0x8CA2, 0x1F24,
- 0x8CA3, 0x8CA6, 0x4B82, 0x8CA7, 0x8CA7, 0x20BA, 0x8CA8, 0x8CA8, 0x1F65,
- 0x8CA9, 0x8CA9, 0x1EF0, 0x8CAA, 0x8CAA, 0x2164, 0x8CAB, 0x8CAB, 0x1F30,
- 0x8CAC, 0x8CAC, 0x2261, 0x8CAD, 0x8CAE, 0x4B86, 0x8CAF, 0x8CAF, 0x22A2,
- 0x8CB0, 0x8CB0, 0x24AB, 0x8CB1, 0x8CB1, 0x4B88, 0x8CB2, 0x8CB2, 0x24AF,
- 0x8CB3, 0x8CB3, 0x1EE8, 0x8CB4, 0x8CB4, 0x1F39, 0x8CB5, 0x8CB5, 0x4B89,
- 0x8CB6, 0x8CB6, 0x1E48, 0x8CB7, 0x8CB7, 0x2070, 0x8CB8, 0x8CB8, 0x1EA8,
- 0x8CB9, 0x8CB9, 0x4B8A, 0x8CBA, 0x8CBA, 0x24AC, 0x8CBB, 0x8CBB, 0x1EF7,
- 0x8CBC, 0x8CBC, 0x2176, 0x8CBD, 0x8CBD, 0x24AD, 0x8CBE, 0x8CBE, 0x4B8B,
- 0x8CBF, 0x8CBF, 0x207B, 0x8CC0, 0x8CC0, 0x1F45, 0x8CC1, 0x8CC1, 0x24AA,
- 0x8CC2, 0x8CC2, 0x204B, 0x8CC3, 0x8CC3, 0x202F, 0x8CC4, 0x8CC4, 0x1F5A,
- 0x8CC5, 0x8CC5, 0x24B0, 0x8CC6, 0x8CC6, 0x4B8C, 0x8CC7, 0x8CC7, 0x22B7,
- 0x8CC8, 0x8CC8, 0x1F7F, 0x8CC9, 0x8CC9, 0x4B8D, 0x8CCA, 0x8CCA, 0x2265,
- 0x8CCB, 0x8CD0, 0x4B8E, 0x8CD1, 0x8CD1, 0x24B2, 0x8CD2, 0x8CD2, 0x211B,
- 0x8CD3, 0x8CD3, 0x1E51, 0x8CD4, 0x8CD4, 0x4B94, 0x8CD5, 0x8CD5, 0x24B4,
- 0x8CD6, 0x8CD9, 0x4B95, 0x8CDA, 0x8CDA, 0x24B3, 0x8CDB, 0x8CDB, 0x4B99,
- 0x8CDC, 0x8CDC, 0x1E9F, 0x8CDD, 0x8CDD, 0x4B9A, 0x8CDE, 0x8CDE, 0x2118,
- 0x8CDF, 0x8CDF, 0x4B9B, 0x8CE0, 0x8CE0, 0x20B4, 0x8CE1, 0x8CE1, 0x23AF,
- 0x8CE2, 0x8CE2, 0x21BB, 0x8CE3, 0x8CE3, 0x2072, 0x8CE4, 0x8CE4, 0x1F95,
- 0x8CE5, 0x8CE5, 0x4B9C, 0x8CE6, 0x8CE6, 0x1F0A, 0x8CE7, 0x8CE7, 0x24B6,
- 0x8CE8, 0x8CE9, 0x4B9D, 0x8CEA, 0x8CEA, 0x2291, 0x8CEB, 0x8CEB, 0x24B5,
- 0x8CEC, 0x8CEC, 0x2278, 0x8CED, 0x8CED, 0x1ED4, 0x8CEE, 0x8CF3, 0x4B9F,
- 0x8CF4, 0x8CF4, 0x1FF3, 0x8CF5, 0x8CF9, 0x4BA5, 0x8CFA, 0x8CFA, 0x22A9,
- 0x8CFB, 0x8CFB, 0x24B7, 0x8CFC, 0x8CFC, 0x1F28, 0x8CFD, 0x8CFD, 0x2109,
- 0x8CFE, 0x8CFE, 0x22C7, 0x8CFF, 0x8CFF, 0x4BAA, 0x8D00, 0x8D03, 0x4BAB,
- 0x8D04, 0x8D04, 0x24AE, 0x8D05, 0x8D05, 0x22B1, 0x8D06, 0x8D07, 0x4BAF,
- 0x8D08, 0x8D08, 0x2266, 0x8D09, 0x8D09, 0x4BB1, 0x8D0A, 0x8D0A, 0x225B,
- 0x8D0B, 0x8D0B, 0x22C4, 0x8D0C, 0x8D0C, 0x4BB2, 0x8D0D, 0x8D0D, 0x2115,
- 0x8D0E, 0x8D0E, 0x4BB3, 0x8D0F, 0x8D0F, 0x222A, 0x8D10, 0x8D10, 0x24B1,
- 0x8D11, 0x8D15, 0x4BB4, 0x8D16, 0x8D16, 0x213D, 0x8D17, 0x8D1A, 0x4BB9,
- 0x8D1B, 0x8D1B, 0x1F15, 0x8D1C, 0x8D1C, 0x225C, 0x8D1D, 0x8D1D, 0x041D,
- 0x8D1E, 0x8D1E, 0x118B, 0x8D1F, 0x8D1F, 0x06B5, 0x8D20, 0x8D20, 0x4BBD,
- 0x8D21, 0x8D21, 0x070A, 0x8D22, 0x8D22, 0x048D, 0x8D23, 0x8D23, 0x1133,
- 0x8D24, 0x8D24, 0x0F3A, 0x8D25, 0x8D25, 0x03E7, 0x8D26, 0x8D26, 0x116C,
- 0x8D27, 0x8D27, 0x080A, 0x8D28, 0x8D28, 0x11C9, 0x8D29, 0x8D29, 0x0654,
- 0x8D2A, 0x8D2A, 0x0E03, 0x8D2B, 0x8D2B, 0x0BD5, 0x8D2C, 0x8D2C, 0x044A,
- 0x8D2D, 0x8D2D, 0x0713, 0x8D2E, 0x8D2E, 0x11FB, 0x8D2F, 0x8D2F, 0x073A,
- 0x8D30, 0x8D30, 0x063E, 0x8D31, 0x8D31, 0x086D, 0x8D32, 0x8D33, 0x192C,
- 0x8D34, 0x8D34, 0x0E4C, 0x8D35, 0x8D35, 0x074C, 0x8D36, 0x8D36, 0x192E,
- 0x8D37, 0x8D37, 0x057E, 0x8D38, 0x8D38, 0x0AB8, 0x8D39, 0x8D39, 0x066E,
- 0x8D3A, 0x8D3A, 0x078F, 0x8D3B, 0x8D3B, 0x192F, 0x8D3C, 0x8D3C, 0x1137,
- 0x8D3D, 0x8D3D, 0x1930, 0x8D3E, 0x8D3E, 0x0849, 0x8D3F, 0x8D3F, 0x07F4,
- 0x8D40, 0x8D40, 0x1931, 0x8D41, 0x8D41, 0x0A27, 0x8D42, 0x8D42, 0x0A5F,
- 0x8D43, 0x8D43, 0x1122, 0x8D44, 0x8D44, 0x1227, 0x8D45, 0x8D46, 0x1932,
- 0x8D47, 0x8D47, 0x1936, 0x8D48, 0x8D49, 0x1934, 0x8D4A, 0x8D4A, 0x0D17,
- 0x8D4B, 0x8D4B, 0x06AE, 0x8D4C, 0x8D4C, 0x0603, 0x8D4D, 0x8D4D, 0x1937,
- 0x8D4E, 0x8D4E, 0x0D81, 0x8D4F, 0x8D4F, 0x0D06, 0x8D50, 0x8D50, 0x0550,
- 0x8D51, 0x8D52, 0x4BBE, 0x8D53, 0x8D53, 0x163B, 0x8D54, 0x8D54, 0x0BA3,
- 0x8D55, 0x8D55, 0x1938, 0x8D56, 0x8D56, 0x09A0, 0x8D57, 0x8D57, 0x4BC0,
- 0x8D58, 0x8D58, 0x1215, 0x8D59, 0x8D59, 0x1939, 0x8D5A, 0x8D5A, 0x1209,
- 0x8D5B, 0x8D5B, 0x0CD7, 0x8D5C, 0x8D5C, 0x1289, 0x8D5D, 0x8D5D, 0x1283,
- 0x8D5E, 0x8D5E, 0x1121, 0x8D5F, 0x8D5F, 0x4BC1, 0x8D60, 0x8D60, 0x113C,
- 0x8D61, 0x8D61, 0x0CFD, 0x8D62, 0x8D62, 0x1093, 0x8D63, 0x8D63, 0x06CE,
- 0x8D64, 0x8D64, 0x0505, 0x8D65, 0x8D65, 0x4BC2, 0x8D66, 0x8D66, 0x0D1B,
- 0x8D67, 0x8D67, 0x1CF4, 0x8D68, 0x8D6A, 0x4BC3, 0x8D6B, 0x8D6B, 0x078C,
- 0x8D6C, 0x8D6C, 0x4BC6, 0x8D6D, 0x8D6D, 0x1CF5, 0x8D6E, 0x8D6F, 0x4BC7,
- 0x8D70, 0x8D70, 0x123C, 0x8D71, 0x8D72, 0x4BC9, 0x8D73, 0x8D73, 0x1CEF,
- 0x8D74, 0x8D74, 0x06AB, 0x8D75, 0x8D75, 0x1175, 0x8D76, 0x8D76, 0x06CA,
- 0x8D77, 0x8D77, 0x0C0F, 0x8D78, 0x8D80, 0x4BCB, 0x8D81, 0x8D81, 0x04E8,
- 0x8D82, 0x8D83, 0x4BD4, 0x8D84, 0x8D84, 0x1CF0, 0x8D85, 0x8D85, 0x04D1,
- 0x8D86, 0x8D89, 0x4BD6, 0x8D8A, 0x8D8A, 0x1100, 0x8D8B, 0x8D8B, 0x0C74,
- 0x8D8C, 0x8D90, 0x4BDA, 0x8D91, 0x8D91, 0x1CF2, 0x8D92, 0x8D93, 0x4BDF,
- 0x8D94, 0x8D94, 0x1CF1, 0x8D95, 0x8D95, 0x1F14, 0x8D96, 0x8D98, 0x4BE1,
- 0x8D99, 0x8D99, 0x227A, 0x8D9A, 0x8D9E, 0x4BE4, 0x8D9F, 0x8D9F, 0x0E1E,
- 0x8DA0, 0x8DA2, 0x4BE9, 0x8DA3, 0x8DA3, 0x0C7F, 0x8DA4, 0x8DA7, 0x4BEC,
- 0x8DA8, 0x8DA8, 0x20EE, 0x8DA9, 0x8DB0, 0x4BF0, 0x8DB1, 0x8DB1, 0x1CF3,
- 0x8DB2, 0x8DB2, 0x25F8, 0x8DB3, 0x8DB3, 0x1240, 0x8DB4, 0x8DB4, 0x0B80,
- 0x8DB5, 0x8DB5, 0x1D1C, 0x8DB6, 0x8DB7, 0x4BF8, 0x8DB8, 0x8DB8, 0x1D17,
- 0x8DB9, 0x8DB9, 0x4BFA, 0x8DBA, 0x8DBA, 0x1D1F, 0x8DBB, 0x8DBB, 0x4BFB,
- 0x8DBC, 0x8DBC, 0x1D1E, 0x8DBD, 0x8DBD, 0x4BFC, 0x8DBE, 0x8DBE, 0x11B9,
- 0x8DBF, 0x8DBF, 0x1D1D, 0x8DC0, 0x8DC2, 0x4BFD, 0x8DC3, 0x8DC3, 0x1101,
- 0x8DC4, 0x8DC4, 0x1D20, 0x8DC5, 0x8DC5, 0x4C00, 0x8DC6, 0x8DC6, 0x1D28,
- 0x8DC7, 0x8DCA, 0x4C01, 0x8DCB, 0x8DCB, 0x03DA, 0x8DCC, 0x8DCC, 0x05D9,
- 0x8DCD, 0x8DCD, 0x4C05, 0x8DCE, 0x8DCF, 0x1D25, 0x8DD0, 0x8DD0, 0x4C06,
- 0x8DD1, 0x8DD1, 0x0B9D, 0x8DD2, 0x8DD5, 0x4C07, 0x8DD6, 0x8DD7, 0x1D21,
- 0x8DD8, 0x8DD9, 0x4C0B, 0x8DDA, 0x8DDA, 0x1D23, 0x8DDB, 0x8DDB, 0x1D27,
- 0x8DDC, 0x8DDC, 0x4C0D, 0x8DDD, 0x8DDD, 0x090F, 0x8DDE, 0x8DDE, 0x1D24,
- 0x8DDF, 0x8DDF, 0x06F5, 0x8DE0, 0x8DE2, 0x4C0E, 0x8DE3, 0x8DE3, 0x1D2C,
- 0x8DE4, 0x8DE4, 0x1D2F, 0x8DE5, 0x8DE7, 0x4C11, 0x8DE8, 0x8DE8, 0x0974,
- 0x8DE9, 0x8DE9, 0x4C14, 0x8DEA, 0x8DEA, 0x074B, 0x8DEB, 0x8DEB, 0x1D18,
- 0x8DEC, 0x8DEC, 0x1D29, 0x8DED, 0x8DEE, 0x4C15, 0x8DEF, 0x8DEF, 0x0A5E,
- 0x8DF0, 0x8DF2, 0x4C17, 0x8DF3, 0x8DF3, 0x0E4B, 0x8DF4, 0x8DF4, 0x4C1A,
- 0x8DF5, 0x8DF5, 0x086C, 0x8DF6, 0x8DF6, 0x4C1B, 0x8DF7, 0x8DF8, 0x1D2A,
- 0x8DF9, 0x8DF9, 0x1D2D, 0x8DFA, 0x8DFA, 0x0624, 0x8DFB, 0x8DFB, 0x1D2E,
- 0x8DFC, 0x8DFC, 0x4C1C, 0x8DFD, 0x8DFD, 0x1D31, 0x8DFE, 0x8DFF, 0x4C1D,
- 0x8E00, 0x8E04, 0x4C1F, 0x8E05, 0x8E05, 0x1D19, 0x8E06, 0x8E08, 0x4C24,
- 0x8E09, 0x8E09, 0x1D30, 0x8E0A, 0x8E0A, 0x10A0, 0x8E0B, 0x8E0B, 0x4C27,
- 0x8E0C, 0x8E0C, 0x0511, 0x8E0D, 0x8E0E, 0x4C28, 0x8E0F, 0x8E0F, 0x0DF7,
- 0x8E10, 0x8E10, 0x1F94, 0x8E11, 0x8E13, 0x4C2A, 0x8E14, 0x8E14, 0x1D32,
- 0x8E15, 0x8E1C, 0x4C2D, 0x8E1D, 0x8E1D, 0x1D33, 0x8E1E, 0x8E1E, 0x0910,
- 0x8E1F, 0x8E1F, 0x1D34, 0x8E20, 0x8E21, 0x4C35, 0x8E22, 0x8E22, 0x0E32,
- 0x8E23, 0x8E23, 0x1D37, 0x8E24, 0x8E28, 0x4C37, 0x8E29, 0x8E29, 0x048F,
- 0x8E2A, 0x8E2A, 0x1236, 0x8E2B, 0x8E2B, 0x4C3C, 0x8E2C, 0x8E2C, 0x1D35,
- 0x8E2D, 0x8E2D, 0x4C3D, 0x8E2E, 0x8E2E, 0x1D36, 0x8E2F, 0x8E2F, 0x1D38,
- 0x8E30, 0x8E30, 0x4C3E, 0x8E31, 0x8E31, 0x1D3E, 0x8E32, 0x8E33, 0x4C3F,
- 0x8E34, 0x8E34, 0x2230, 0x8E35, 0x8E35, 0x1D3C, 0x8E36, 0x8E38, 0x4C41,
- 0x8E39, 0x8E39, 0x1D3B, 0x8E3A, 0x8E3A, 0x1D39, 0x8E3B, 0x8E3C, 0x4C44,
- 0x8E3D, 0x8E3D, 0x1D3D, 0x8E3E, 0x8E3F, 0x4C46, 0x8E40, 0x8E40, 0x1D3A,
- 0x8E41, 0x8E42, 0x1D40, 0x8E43, 0x8E43, 0x4C48, 0x8E44, 0x8E44, 0x0E36,
- 0x8E45, 0x8E46, 0x4C49, 0x8E47, 0x8E47, 0x173B, 0x8E48, 0x8E48, 0x0599,
- 0x8E49, 0x8E49, 0x1D3F, 0x8E4A, 0x8E4A, 0x1D44, 0x8E4B, 0x8E4B, 0x0DF6,
- 0x8E4C, 0x8E4C, 0x25FD, 0x8E4D, 0x8E50, 0x4C4B, 0x8E51, 0x8E52, 0x1D42,
- 0x8E53, 0x8E54, 0x4C4F, 0x8E55, 0x8E55, 0x2600, 0x8E56, 0x8E58, 0x4C51,
- 0x8E59, 0x8E59, 0x1D1A, 0x8E5A, 0x8E62, 0x4C54, 0x8E63, 0x8E63, 0x2606,
- 0x8E64, 0x8E65, 0x4C5D, 0x8E66, 0x8E66, 0x042D, 0x8E67, 0x8E68, 0x4C5F,
- 0x8E69, 0x8E69, 0x1D1B, 0x8E6A, 0x8E6B, 0x4C61, 0x8E6C, 0x8E6C, 0x05A6,
- 0x8E6D, 0x8E6D, 0x04AB, 0x8E6E, 0x8E6E, 0x4C63, 0x8E6F, 0x8E6F, 0x1D48,
- 0x8E70, 0x8E70, 0x1D45, 0x8E71, 0x8E71, 0x4C64, 0x8E72, 0x8E72, 0x0616,
- 0x8E73, 0x8E73, 0x4C65, 0x8E74, 0x8E74, 0x1D49, 0x8E75, 0x8E75, 0x4C66,
- 0x8E76, 0x8E76, 0x1D46, 0x8E77, 0x8E79, 0x4C67, 0x8E7A, 0x8E7A, 0x25FF,
- 0x8E7B, 0x8E7B, 0x4C6A, 0x8E7C, 0x8E7C, 0x1D47, 0x8E7D, 0x8E7E, 0x4C6B,
- 0x8E7F, 0x8E7F, 0x055D, 0x8E80, 0x8E80, 0x4C6D, 0x8E81, 0x8E81, 0x112D,
- 0x8E82, 0x8E84, 0x4C6E, 0x8E85, 0x8E85, 0x1D4A, 0x8E86, 0x8E86, 0x4C71,
- 0x8E87, 0x8E87, 0x051E, 0x8E88, 0x8E88, 0x4C72, 0x8E89, 0x8E89, 0x25FC,
- 0x8E8A, 0x8E8A, 0x1E8C, 0x8E8B, 0x8E8B, 0x2602, 0x8E8C, 0x8E8C, 0x4C73,
- 0x8E8D, 0x8E8D, 0x224D, 0x8E8E, 0x8E8E, 0x4C74, 0x8E8F, 0x8E8F, 0x1D4B,
- 0x8E90, 0x8E90, 0x1D4D, 0x8E91, 0x8E91, 0x2604, 0x8E92, 0x8E92, 0x25FE,
- 0x8E93, 0x8E93, 0x2603, 0x8E94, 0x8E94, 0x1D4C, 0x8E95, 0x8E99, 0x4C75,
- 0x8E9A, 0x8E9A, 0x2601, 0x8E9B, 0x8E9B, 0x4C7A, 0x8E9C, 0x8E9C, 0x1D4E,
- 0x8E9D, 0x8E9D, 0x4C7B, 0x8E9E, 0x8E9E, 0x1D4F, 0x8E9F, 0x8EA0, 0x4C7C,
- 0x8EA1, 0x8EA1, 0x2605, 0x8EA2, 0x8EA4, 0x4C7E, 0x8EA5, 0x8EA5, 0x1EA3,
- 0x8EA6, 0x8EA6, 0x2608, 0x8EA7, 0x8EA9, 0x4C81, 0x8EAA, 0x8EAA, 0x2607,
- 0x8EAB, 0x8EAB, 0x0D26, 0x8EAC, 0x8EAC, 0x0703, 0x8EAD, 0x8EAE, 0x4C84,
- 0x8EAF, 0x8EAF, 0x0C78, 0x8EB0, 0x8EB1, 0x4C86, 0x8EB2, 0x8EB2, 0x0622,
- 0x8EB3, 0x8EB9, 0x4C88, 0x8EBA, 0x8EBA, 0x0E1C, 0x8EBB, 0x8EBF, 0x4C8F,
- 0x8EC0, 0x8EC0, 0x20F0, 0x8EC1, 0x8EC9, 0x4C94, 0x8ECA, 0x8ECA, 0x1E7B,
- 0x8ECB, 0x8ECB, 0x2267, 0x8ECC, 0x8ECC, 0x1F36, 0x8ECD, 0x8ECD, 0x1FD6,
- 0x8ECE, 0x8ECE, 0x18F8, 0x8ECF, 0x8ED1, 0x4C9D, 0x8ED2, 0x8ED2, 0x21E0,
- 0x8ED3, 0x8ED3, 0x4CA0, 0x8ED4, 0x8ED4, 0x248C, 0x8ED5, 0x8EDA, 0x4CA1,
- 0x8EDB, 0x8EDB, 0x248D, 0x8EDC, 0x8EDE, 0x4CA7, 0x8EDF, 0x8EDF, 0x2102,
- 0x8EE0, 0x8EE3, 0x4CAA, 0x8EE4, 0x8EE4, 0x2494, 0x8EE5, 0x8EEA, 0x4CAE,
- 0x8EEB, 0x8EEB, 0x2493, 0x8EEC, 0x8EF1, 0x4CB4, 0x8EF2, 0x8EF2, 0x248E,
- 0x8EF3, 0x8EF7, 0x4CBA, 0x8EF8, 0x8EF8, 0x2299, 0x8EF9, 0x8EF9, 0x2491,
- 0x8EFA, 0x8EFA, 0x2496, 0x8EFB, 0x8EFB, 0x248F, 0x8EFC, 0x8EFC, 0x2492,
- 0x8EFD, 0x8EFD, 0x4CBF, 0x8EFE, 0x8EFE, 0x2497, 0x8EFF, 0x8EFF, 0x4CC0,
- 0x8F00, 0x8F02, 0x4CC1, 0x8F03, 0x8F03, 0x1FB1, 0x8F04, 0x8F04, 0x4CC4,
- 0x8F05, 0x8F05, 0x249A, 0x8F06, 0x8F06, 0x4CC5, 0x8F07, 0x8F07, 0x2499,
- 0x8F08, 0x8F08, 0x4CC6, 0x8F09, 0x8F09, 0x2258, 0x8F0A, 0x8F0A, 0x2498,
- 0x8F0B, 0x8F11, 0x4CC7, 0x8F12, 0x8F12, 0x249B, 0x8F13, 0x8F13, 0x4CCE,
- 0x8F14, 0x8F14, 0x1F09, 0x8F15, 0x8F15, 0x20E6, 0x8F16, 0x8F1A, 0x4CCF,
- 0x8F1B, 0x8F1B, 0x2026, 0x8F1C, 0x8F1C, 0x249F, 0x8F1D, 0x8F1D, 0x1F59,
- 0x8F1E, 0x8F1F, 0x249D, 0x8F20, 0x8F24, 0x4CD4, 0x8F25, 0x8F25, 0x1F3B,
- 0x8F26, 0x8F26, 0x249C, 0x8F27, 0x8F28, 0x4CD9, 0x8F29, 0x8F29, 0x1E3A,
- 0x8F2A, 0x8F2A, 0x205B, 0x8F2B, 0x8F2E, 0x4CDB, 0x8F2F, 0x8F2F, 0x1F70,
- 0x8F30, 0x8F32, 0x4CDF, 0x8F33, 0x8F33, 0x24A0, 0x8F34, 0x8F37, 0x4CE2,
- 0x8F38, 0x8F38, 0x213B, 0x8F39, 0x8F3A, 0x4CE6, 0x8F3B, 0x8F3B, 0x1F07,
- 0x8F3C, 0x8F3D, 0x4CE8, 0x8F3E, 0x8F3E, 0x2270, 0x8F3F, 0x8F3F, 0x2237,
- 0x8F40, 0x8F41, 0x4CEA, 0x8F42, 0x8F42, 0x24D2, 0x8F43, 0x8F43, 0x4CEC,
- 0x8F44, 0x8F44, 0x21B3, 0x8F45, 0x8F45, 0x2245, 0x8F46, 0x8F46, 0x24A1,
- 0x8F47, 0x8F48, 0x4CED, 0x8F49, 0x8F49, 0x22A8, 0x8F4A, 0x8F4C, 0x4CEF,
- 0x8F4D, 0x8F4D, 0x227C, 0x8F4E, 0x8F4E, 0x1FB0, 0x8F4F, 0x8F53, 0x4CF2,
- 0x8F54, 0x8F54, 0x24A2, 0x8F55, 0x8F5E, 0x4CF7, 0x8F5F, 0x8F5F, 0x1F46,
- 0x8F60, 0x8F60, 0x4D01, 0x8F61, 0x8F61, 0x2380, 0x8F62, 0x8F62, 0x2495,
- 0x8F63, 0x8F63, 0x4D02, 0x8F64, 0x8F64, 0x2490, 0x8F65, 0x8F65, 0x4D03,
- 0x8F66, 0x8F66, 0x04DA, 0x8F67, 0x8F67, 0x1141, 0x8F68, 0x8F68, 0x0745,
- 0x8F69, 0x8F69, 0x0FC4, 0x8F6A, 0x8F6A, 0x4D04, 0x8F6B, 0x8F6B, 0x18E1,
- 0x8F6C, 0x8F6C, 0x1207, 0x8F6D, 0x8F6D, 0x18E2, 0x8F6E, 0x8F6E, 0x0A7D,
- 0x8F6F, 0x8F6F, 0x0CC8, 0x8F70, 0x8F70, 0x079B, 0x8F71, 0x8F73, 0x18E3,
- 0x8F74, 0x8F74, 0x11E0, 0x8F75, 0x8F76, 0x18E6, 0x8F77, 0x8F77, 0x18E9,
- 0x8F78, 0x8F78, 0x18E8, 0x8F79, 0x8F7A, 0x18EA, 0x8F7B, 0x8F7B, 0x0C5E,
- 0x8F7C, 0x8F7C, 0x18EC, 0x8F7D, 0x8F7D, 0x111B, 0x8F7E, 0x8F7E, 0x18ED,
- 0x8F7F, 0x8F7F, 0x089F, 0x8F80, 0x8F80, 0x4D05, 0x8F81, 0x8F82, 0x18EE,
- 0x8F83, 0x8F83, 0x08A0, 0x8F84, 0x8F84, 0x18F0, 0x8F85, 0x8F85, 0x06A3,
- 0x8F86, 0x8F86, 0x0A07, 0x8F87, 0x8F87, 0x18F1, 0x8F88, 0x8F88, 0x041B,
- 0x8F89, 0x8F89, 0x07E9, 0x8F8A, 0x8F8A, 0x074E, 0x8F8B, 0x8F8B, 0x18F2,
- 0x8F8C, 0x8F8C, 0x4D06, 0x8F8D, 0x8F8F, 0x18F3, 0x8F90, 0x8F90, 0x0695,
- 0x8F91, 0x8F91, 0x0820, 0x8F92, 0x8F92, 0x4D07, 0x8F93, 0x8F93, 0x0D7B,
- 0x8F94, 0x8F94, 0x1574, 0x8F95, 0x8F95, 0x10F2, 0x8F96, 0x8F96, 0x0F2A,
- 0x8F97, 0x8F97, 0x1158, 0x8F98, 0x8F98, 0x18F6, 0x8F99, 0x8F99, 0x117F,
- 0x8F9A, 0x8F9A, 0x18F7, 0x8F9B, 0x8F9B, 0x0F8C, 0x8F9C, 0x8F9C, 0x0715,
- 0x8F9D, 0x8F9D, 0x4D08, 0x8F9E, 0x8F9E, 0x054A, 0x8F9F, 0x8F9F, 0x0442,
- 0x8FA0, 0x8FA2, 0x4D09, 0x8FA3, 0x8FA3, 0x099C, 0x8FA4, 0x8FA5, 0x4D0C,
- 0x8FA6, 0x8FA6, 0x1E30, 0x8FA7, 0x8FA7, 0x4D0E, 0x8FA8, 0x8FA9, 0x044F,
- 0x8FAA, 0x8FAA, 0x4D0F, 0x8FAB, 0x8FAB, 0x0451, 0x8FAC, 0x8FAC, 0x4D10,
- 0x8FAD, 0x8FAD, 0x1E9D, 0x8FAE, 0x8FAE, 0x1E4B, 0x8FAF, 0x8FAF, 0x1E4A,
- 0x8FB0, 0x8FB0, 0x04E2, 0x8FB1, 0x8FB1, 0x0CC3, 0x8FB2, 0x8FB2, 0x20AA,
- 0x8FB3, 0x8FB5, 0x4D11, 0x8FB6, 0x8FB6, 0x173D, 0x8FB7, 0x8FB8, 0x4D14,
- 0x8FB9, 0x8FB9, 0x0448, 0x8FBA, 0x8FBC, 0x4D16, 0x8FBD, 0x8FBD, 0x0A12,
- 0x8FBE, 0x8FBE, 0x0572, 0x8FBF, 0x8FC0, 0x4D19, 0x8FC1, 0x8FC1, 0x0C25,
- 0x8FC2, 0x8FC2, 0x10BD, 0x8FC3, 0x8FC3, 0x4D1B, 0x8FC4, 0x8FC4, 0x0C18,
- 0x8FC5, 0x8FC5, 0x0FE1, 0x8FC6, 0x8FC6, 0x4D1C, 0x8FC7, 0x8FC7, 0x0756,
- 0x8FC8, 0x8FC8, 0x0A9C, 0x8FC9, 0x8FCD, 0x4D1D, 0x8FCE, 0x8FCE, 0x1092,
- 0x8FCF, 0x8FCF, 0x4D22, 0x8FD0, 0x8FD0, 0x110E, 0x8FD1, 0x8FD1, 0x08CD,
- 0x8FD2, 0x8FD2, 0x4D23, 0x8FD3, 0x8FD3, 0x173E, 0x8FD4, 0x8FD4, 0x0652,
- 0x8FD5, 0x8FD5, 0x173F, 0x8FD6, 0x8FD7, 0x4D24, 0x8FD8, 0x8FD8, 0x07CE,
- 0x8FD9, 0x8FD9, 0x1183, 0x8FDA, 0x8FDA, 0x4D26, 0x8FDB, 0x8FDB, 0x08C9,
- 0x8FDC, 0x8FDC, 0x10F9, 0x8FDD, 0x8FDD, 0x0EB4, 0x8FDE, 0x8FDE, 0x09F5,
- 0x8FDF, 0x8FDF, 0x04FE, 0x8FE0, 0x8FE1, 0x4D27, 0x8FE2, 0x8FE2, 0x0E49,
- 0x8FE3, 0x8FE3, 0x4D29, 0x8FE4, 0x8FE4, 0x1742, 0x8FE5, 0x8FE5, 0x1740,
- 0x8FE6, 0x8FE6, 0x1744, 0x8FE7, 0x8FE7, 0x4D2A, 0x8FE8, 0x8FE8, 0x1746,
- 0x8FE9, 0x8FE9, 0x1743, 0x8FEA, 0x8FEA, 0x05B0, 0x8FEB, 0x8FEB, 0x0BE7,
- 0x8FEC, 0x8FEC, 0x4D2B, 0x8FED, 0x8FED, 0x05DD, 0x8FEE, 0x8FEE, 0x1741,
- 0x8FEF, 0x8FEF, 0x4D2C, 0x8FF0, 0x8FF0, 0x0D8D, 0x8FF1, 0x8FF2, 0x4D2D,
- 0x8FF3, 0x8FF3, 0x1745, 0x8FF4, 0x8FF4, 0x267B, 0x8FF5, 0x8FF6, 0x4D2F,
- 0x8FF7, 0x8FF7, 0x0AD9, 0x8FF8, 0x8FF8, 0x042E, 0x8FF9, 0x8FF9, 0x0816,
- 0x8FFA, 0x8FFC, 0x4D31, 0x8FFD, 0x8FFD, 0x1214, 0x8FFE, 0x8FFF, 0x4D34,
- 0x9000, 0x9000, 0x0E7C, 0x9001, 0x9001, 0x0DC2, 0x9002, 0x9002, 0x0D61,
- 0x9003, 0x9003, 0x0E26, 0x9004, 0x9004, 0x1748, 0x9005, 0x9005, 0x1747,
- 0x9006, 0x9006, 0x0B49, 0x9007, 0x9008, 0x4D36, 0x9009, 0x9009, 0x0FCA,
- 0x900A, 0x900A, 0x0FE0, 0x900B, 0x900B, 0x1749, 0x900C, 0x900C, 0x4D38,
- 0x900D, 0x900D, 0x174C, 0x900E, 0x900E, 0x4D39, 0x900F, 0x900F, 0x0E69,
- 0x9010, 0x9010, 0x11EF, 0x9011, 0x9011, 0x174B, 0x9012, 0x9012, 0x05BE,
- 0x9013, 0x9013, 0x4D3A, 0x9014, 0x9014, 0x0E6F, 0x9015, 0x9015, 0x23F2,
- 0x9016, 0x9016, 0x174D, 0x9017, 0x9017, 0x05F9, 0x9018, 0x9018, 0x4D3B,
- 0x9019, 0x9019, 0x227E, 0x901A, 0x901A, 0x0E59, 0x901B, 0x901B, 0x073D,
- 0x901C, 0x901C, 0x4D3C, 0x901D, 0x901D, 0x0D5C, 0x901E, 0x901E, 0x04F6,
- 0x901F, 0x901F, 0x0DCE, 0x9020, 0x9020, 0x112F, 0x9021, 0x9021, 0x174E,
- 0x9022, 0x9022, 0x0687, 0x9023, 0x9023, 0x2019, 0x9024, 0x9025, 0x4D3D,
- 0x9026, 0x9026, 0x174A, 0x9027, 0x902C, 0x4D3F, 0x902D, 0x902D, 0x1751,
- 0x902E, 0x902E, 0x0581, 0x902F, 0x902F, 0x1752, 0x9030, 0x9031, 0x4D45,
- 0x9032, 0x9032, 0x1FBB, 0x9033, 0x9034, 0x4D47, 0x9035, 0x9036, 0x174F,
- 0x9037, 0x9037, 0x4D49, 0x9038, 0x9038, 0x1064, 0x9039, 0x903A, 0x4D4A,
- 0x903B, 0x903B, 0x0A86, 0x903C, 0x903C, 0x042F, 0x903D, 0x903D, 0x4D4C,
- 0x903E, 0x903E, 0x10C7, 0x903F, 0x9040, 0x4D4D, 0x9041, 0x9041, 0x061C,
- 0x9042, 0x9042, 0x0DE1, 0x9043, 0x9043, 0x4D4F, 0x9044, 0x9044, 0x1753,
- 0x9045, 0x9046, 0x4D50, 0x9047, 0x9047, 0x10DB, 0x9048, 0x904A, 0x4D52,
- 0x904B, 0x904B, 0x2253, 0x904C, 0x904C, 0x4D55, 0x904D, 0x904D, 0x0452,
- 0x904E, 0x904E, 0x1F3E, 0x904F, 0x904F, 0x0633, 0x9050, 0x9050, 0x1756,
- 0x9051, 0x9052, 0x1754, 0x9053, 0x9053, 0x05A1, 0x9054, 0x9054, 0x1EA6,
- 0x9055, 0x9055, 0x218E, 0x9056, 0x9056, 0x4D56, 0x9057, 0x9057, 0x104C,
- 0x9058, 0x9058, 0x1758, 0x9059, 0x905A, 0x4D57, 0x905B, 0x905B, 0x175A,
- 0x905C, 0x905C, 0x21EC, 0x905D, 0x905D, 0x4D59, 0x905E, 0x905E, 0x1EBE,
- 0x905F, 0x905F, 0x4D5A, 0x9060, 0x9060, 0x224A, 0x9061, 0x9061, 0x4D5B,
- 0x9062, 0x9062, 0x1759, 0x9063, 0x9063, 0x0C2F, 0x9064, 0x9064, 0x4D5C,
- 0x9065, 0x9065, 0x102A, 0x9066, 0x9067, 0x4D5D, 0x9068, 0x9068, 0x1757,
- 0x9069, 0x9069, 0x2133, 0x906A, 0x906C, 0x4D5F, 0x906D, 0x906D, 0x1125,
- 0x906E, 0x906E, 0x117B, 0x906F, 0x9071, 0x4D62, 0x9072, 0x9072, 0x1E84,
- 0x9073, 0x9073, 0x4D65, 0x9074, 0x9074, 0x175C, 0x9075, 0x9075, 0x124E,
- 0x9076, 0x9076, 0x4D66, 0x9077, 0x9077, 0x20CF, 0x9078, 0x9078, 0x21E2,
- 0x9079, 0x9079, 0x4D67, 0x907A, 0x907A, 0x220F, 0x907B, 0x907B, 0x4D68,
- 0x907C, 0x907C, 0x2029, 0x907D, 0x907D, 0x175D, 0x907E, 0x907E, 0x4D69,
- 0x907F, 0x907F, 0x0445, 0x9080, 0x9080, 0x1024, 0x9081, 0x9081, 0x2073,
- 0x9082, 0x9082, 0x175E, 0x9083, 0x9083, 0x1760, 0x9084, 0x9084, 0x1F55,
- 0x9085, 0x9086, 0x4D6A, 0x9087, 0x9087, 0x23F1, 0x9088, 0x9088, 0x175F,
- 0x9089, 0x9089, 0x4D6C, 0x908A, 0x908A, 0x1E46, 0x908B, 0x908B, 0x1761,
- 0x908C, 0x908E, 0x4D6D, 0x908F, 0x908F, 0x2063, 0x9090, 0x9090, 0x23F3,
- 0x9091, 0x9091, 0x105F, 0x9092, 0x9092, 0x4D70, 0x9093, 0x9093, 0x05AC,
- 0x9094, 0x9094, 0x4D71, 0x9095, 0x9095, 0x1817, 0x9096, 0x9096, 0x4D72,
- 0x9097, 0x9097, 0x1367, 0x9098, 0x9098, 0x4D73, 0x9099, 0x9099, 0x136A,
- 0x909A, 0x909A, 0x4D74, 0x909B, 0x909B, 0x1368, 0x909C, 0x909C, 0x4D75,
- 0x909D, 0x909D, 0x1369, 0x909E, 0x90A0, 0x4D76, 0x90A1, 0x90A1, 0x136C,
- 0x90A2, 0x90A2, 0x0F9A, 0x90A3, 0x90A3, 0x0B2A, 0x90A4, 0x90A5, 0x4D79,
- 0x90A6, 0x90A6, 0x03F9, 0x90A7, 0x90A9, 0x4D7B, 0x90AA, 0x90AA, 0x0F7B,
- 0x90AB, 0x90AB, 0x4D7E, 0x90AC, 0x90AC, 0x136B, 0x90AD, 0x90AD, 0x4D7F,
- 0x90AE, 0x90AE, 0x10AF, 0x90AF, 0x90AF, 0x0761, 0x90B0, 0x90B0, 0x1372,
- 0x90B1, 0x90B1, 0x0C6E, 0x90B2, 0x90B2, 0x4D80, 0x90B3, 0x90B3, 0x136E,
- 0x90B4, 0x90B4, 0x136D, 0x90B5, 0x90B5, 0x0D14, 0x90B6, 0x90B6, 0x136F,
- 0x90B7, 0x90B7, 0x4D81, 0x90B8, 0x90B8, 0x1371, 0x90B9, 0x90B9, 0x123B,
- 0x90BA, 0x90BA, 0x1370, 0x90BB, 0x90BB, 0x0A23, 0x90BC, 0x90BD, 0x4D82,
- 0x90BE, 0x90BE, 0x1375, 0x90BF, 0x90C0, 0x4D84, 0x90C1, 0x90C1, 0x10D9,
- 0x90C2, 0x90C3, 0x4D86, 0x90C4, 0x90C4, 0x1377, 0x90C5, 0x90C5, 0x1374,
- 0x90C6, 0x90C6, 0x4D88, 0x90C7, 0x90C7, 0x1378, 0x90C8, 0x90C9, 0x4D89,
- 0x90CA, 0x90CA, 0x088D, 0x90CB, 0x90CD, 0x4D8B, 0x90CE, 0x90CE, 0x09B4,
- 0x90CF, 0x90CF, 0x1373, 0x90D0, 0x90D0, 0x1376, 0x90D1, 0x90D1, 0x11A2,
- 0x90D2, 0x90D2, 0x4D8E, 0x90D3, 0x90D3, 0x1379, 0x90D4, 0x90D6, 0x4D8F,
- 0x90D7, 0x90D7, 0x137D, 0x90D8, 0x90DA, 0x4D92, 0x90DB, 0x90DB, 0x137E,
- 0x90DC, 0x90DC, 0x137C, 0x90DD, 0x90DD, 0x0779, 0x90DE, 0x90DE, 0x4D95,
- 0x90DF, 0x90DF, 0x231E, 0x90E0, 0x90E0, 0x4D96, 0x90E1, 0x90E1, 0x0931,
- 0x90E2, 0x90E2, 0x137B, 0x90E3, 0x90E5, 0x4D97, 0x90E6, 0x90E6, 0x137A,
- 0x90E7, 0x90E7, 0x110A, 0x90E8, 0x90E8, 0x0486, 0x90E9, 0x90EA, 0x4D9A,
- 0x90EB, 0x90EB, 0x137F, 0x90EC, 0x90EC, 0x4D9C, 0x90ED, 0x90ED, 0x0752,
- 0x90EE, 0x90EE, 0x4D9D, 0x90EF, 0x90EF, 0x1380, 0x90F0, 0x90F3, 0x4D9E,
- 0x90F4, 0x90F4, 0x04E0, 0x90F5, 0x90F5, 0x2233, 0x90F6, 0x90F7, 0x4DA2,
- 0x90F8, 0x90F8, 0x0587, 0x90F9, 0x90FC, 0x4DA4, 0x90FD, 0x90FD, 0x05FB,
- 0x90FE, 0x90FE, 0x1381, 0x90FF, 0x90FF, 0x4DA8, 0x9100, 0x9101, 0x4DA9,
- 0x9102, 0x9102, 0x0634, 0x9103, 0x9103, 0x4DAB, 0x9104, 0x9104, 0x1382,
- 0x9105, 0x9105, 0x4DAC, 0x9106, 0x9106, 0x2320, 0x9107, 0x9108, 0x4DAD,
- 0x9109, 0x9109, 0x21C7, 0x910A, 0x9111, 0x4DAF, 0x9112, 0x9112, 0x22BC,
- 0x9113, 0x9113, 0x4DB7, 0x9114, 0x9114, 0x231C, 0x9115, 0x9115, 0x4DB8,
- 0x9116, 0x9116, 0x2251, 0x9117, 0x9118, 0x4DB9, 0x9119, 0x9119, 0x0432,
- 0x911A, 0x911D, 0x4DBB, 0x911E, 0x911E, 0x1384, 0x911F, 0x9121, 0x4DBF,
- 0x9122, 0x9122, 0x1383, 0x9123, 0x9123, 0x1385, 0x9124, 0x9126, 0x4DC2,
- 0x9127, 0x9127, 0x1EBB, 0x9128, 0x912C, 0x4DC5, 0x912D, 0x912D, 0x2287,
- 0x912E, 0x912E, 0x4DCA, 0x912F, 0x912F, 0x1387, 0x9130, 0x9130, 0x202D,
- 0x9131, 0x9131, 0x1386, 0x9132, 0x9132, 0x1EAB, 0x9133, 0x9133, 0x4DCB,
- 0x9134, 0x9134, 0x231D, 0x9135, 0x9135, 0x4DCC, 0x9136, 0x9136, 0x231F,
- 0x9137, 0x9138, 0x4DCD, 0x9139, 0x9139, 0x1388, 0x913A, 0x913A, 0x231B,
- 0x913B, 0x9142, 0x4DCF, 0x9143, 0x9143, 0x1389, 0x9144, 0x9145, 0x4DD7,
- 0x9146, 0x9146, 0x138A, 0x9147, 0x9147, 0x4DD9, 0x9148, 0x9148, 0x2321,
- 0x9149, 0x9149, 0x10B4, 0x914A, 0x914A, 0x1CF8, 0x914B, 0x914B, 0x0C72,
- 0x914C, 0x914C, 0x1220, 0x914D, 0x914D, 0x0BA5, 0x914E, 0x914F, 0x1CFA,
- 0x9150, 0x9150, 0x1CF9, 0x9151, 0x9151, 0x4DDA, 0x9152, 0x9152, 0x08F5,
- 0x9153, 0x9156, 0x4DDB, 0x9157, 0x9157, 0x0FBA, 0x9158, 0x9159, 0x4DDF,
- 0x915A, 0x915A, 0x0670, 0x915B, 0x915C, 0x4DE1, 0x915D, 0x915D, 0x1110,
- 0x915E, 0x915E, 0x0DFD, 0x915F, 0x9160, 0x4DE3, 0x9161, 0x9161, 0x1CFE,
- 0x9162, 0x9162, 0x1CFD, 0x9163, 0x9163, 0x075F, 0x9164, 0x9164, 0x1CFC,
- 0x9165, 0x9165, 0x0DCB, 0x9166, 0x9168, 0x4DE5, 0x9169, 0x9169, 0x1D00,
- 0x916A, 0x916A, 0x09BD, 0x916B, 0x916B, 0x4DE8, 0x916C, 0x916C, 0x050F,
- 0x916D, 0x916D, 0x4DE9, 0x916E, 0x916E, 0x0E5B, 0x916F, 0x916F, 0x1D01,
- 0x9170, 0x9170, 0x1CFF, 0x9171, 0x9171, 0x0885, 0x9172, 0x9172, 0x1D04,
- 0x9173, 0x9173, 0x4DEA, 0x9174, 0x9174, 0x1D05, 0x9175, 0x9175, 0x089E,
- 0x9176, 0x9176, 0x0ABD, 0x9177, 0x9177, 0x096E, 0x9178, 0x9178, 0x0DD6,
- 0x9179, 0x9179, 0x1D06, 0x917A, 0x917C, 0x4DEB, 0x917D, 0x917E, 0x1D02,
- 0x917F, 0x917F, 0x0B53, 0x9180, 0x9184, 0x4DEE, 0x9185, 0x9185, 0x1D08,
- 0x9186, 0x9186, 0x4DF3, 0x9187, 0x9187, 0x053F, 0x9188, 0x9188, 0x4DF4,
- 0x9189, 0x9189, 0x124A, 0x918A, 0x918A, 0x4DF5, 0x918B, 0x918B, 0x055A,
- 0x918C, 0x918C, 0x1D07, 0x918D, 0x918D, 0x1D0A, 0x918E, 0x918F, 0x4DF6,
- 0x9190, 0x9190, 0x1D09, 0x9191, 0x9191, 0x1D0B, 0x9192, 0x9192, 0x0F9C,
- 0x9193, 0x9195, 0x4DF8, 0x9196, 0x9196, 0x2255, 0x9197, 0x9199, 0x4DFB,
- 0x919A, 0x919A, 0x0AD6, 0x919B, 0x919B, 0x0C84, 0x919C, 0x919C, 0x1E8F,
- 0x919D, 0x91A1, 0x4DFE, 0x91A2, 0x91A3, 0x1D0C, 0x91A4, 0x91A9, 0x4E03,
- 0x91AA, 0x91AA, 0x1D0E, 0x91AB, 0x91AB, 0x220C, 0x91AC, 0x91AC, 0x1FA4,
- 0x91AD, 0x91AF, 0x1D0F, 0x91B0, 0x91B3, 0x4E09, 0x91B4, 0x91B4, 0x1D13,
- 0x91B5, 0x91B5, 0x1D12, 0x91B6, 0x91B9, 0x4E0D, 0x91BA, 0x91BA, 0x1D14,
- 0x91BB, 0x91BF, 0x4E11, 0x91C0, 0x91C0, 0x209B, 0x91C1, 0x91C1, 0x21D8,
- 0x91C2, 0x91C2, 0x4E16, 0x91C3, 0x91C3, 0x25FA, 0x91C4, 0x91C4, 0x4E17,
- 0x91C5, 0x91C5, 0x25F9, 0x91C6, 0x91C6, 0x4E18, 0x91C7, 0x91C7, 0x0490,
- 0x91C8, 0x91C8, 0x4E19, 0x91C9, 0x91C9, 0x10B9, 0x91CA, 0x91CA, 0x0D64,
- 0x91CB, 0x91CB, 0x2134, 0x91CC, 0x91CC, 0x09DA, 0x91CD, 0x91CD, 0x11D7,
- 0x91CE, 0x91CE, 0x1037, 0x91CF, 0x91CF, 0x0A08, 0x91D0, 0x91D0, 0x4E1A,
- 0x91D1, 0x91D1, 0x08C1, 0x91D2, 0x91D4, 0x24F3, 0x91D5, 0x91D5, 0x24F8,
- 0x91D6, 0x91D6, 0x4E1B, 0x91D7, 0x91D7, 0x24F7, 0x91D8, 0x91D8, 0x1EC8,
- 0x91D9, 0x91D9, 0x24F6, 0x91DA, 0x91DB, 0x4E1C, 0x91DC, 0x91DC, 0x06A5,
- 0x91DD, 0x91DD, 0x2280, 0x91DE, 0x91E2, 0x4E1E, 0x91E3, 0x91E3, 0x1EC5,
- 0x91E4, 0x91E4, 0x24FB, 0x91E5, 0x91E6, 0x4E23, 0x91E7, 0x91E7, 0x24FA,
- 0x91E8, 0x91E8, 0x4E25, 0x91E9, 0x91E9, 0x1EED, 0x91EA, 0x91F4, 0x4E26,
- 0x91F5, 0x91F5, 0x24FD, 0x91F6, 0x91F6, 0x4E31, 0x91F7, 0x91F7, 0x24F9,
- 0x91F8, 0x91F8, 0x4E32, 0x91F9, 0x91F9, 0x24FE, 0x91FA, 0x91FA, 0x20CD,
- 0x91FB, 0x91FF, 0x4E33, 0x9200, 0x9200, 0x2508, 0x9201, 0x9201, 0x2504,
- 0x9202, 0x9203, 0x4E38, 0x9204, 0x9204, 0x2506, 0x9205, 0x9207, 0x4E3A,
- 0x9208, 0x9208, 0x24FF, 0x9209, 0x9209, 0x2090, 0x920A, 0x920C, 0x4E3D,
- 0x920D, 0x920D, 0x1EDD, 0x920E, 0x920E, 0x1F25, 0x920F, 0x920F, 0x4E40,
- 0x9210, 0x9210, 0x2503, 0x9211, 0x9211, 0x2502, 0x9212, 0x9213, 0x4E41,
- 0x9214, 0x9214, 0x1E7A, 0x9215, 0x9215, 0x20A6, 0x9216, 0x921D, 0x4E43,
- 0x921E, 0x921E, 0x1FD5, 0x921F, 0x9222, 0x4E4B, 0x9223, 0x9223, 0x1F11,
- 0x9224, 0x9224, 0x4E4F, 0x9225, 0x9225, 0x2507, 0x9226, 0x9226, 0x2500,
- 0x9227, 0x9227, 0x2505, 0x9228, 0x922D, 0x4E50, 0x922E, 0x922E, 0x2519,
- 0x922F, 0x922F, 0x4E56, 0x9230, 0x9230, 0x2515, 0x9231, 0x9232, 0x4E57,
- 0x9233, 0x9233, 0x250C, 0x9234, 0x9234, 0x2031, 0x9235, 0x9236, 0x4E59,
- 0x9237, 0x9237, 0x250B, 0x9238, 0x9238, 0x250F, 0x9239, 0x9239, 0x251A,
- 0x923A, 0x923A, 0x2509, 0x923B, 0x923C, 0x4E5B, 0x923D, 0x923D, 0x250E,
- 0x923E, 0x923E, 0x2234, 0x923F, 0x923F, 0x2513, 0x9240, 0x9240, 0x1F80,
- 0x9241, 0x9244, 0x4E5D, 0x9245, 0x9245, 0x2501, 0x9246, 0x9247, 0x4E61,
- 0x9248, 0x9248, 0x2517, 0x9249, 0x9249, 0x2516, 0x924A, 0x924C, 0x4E63,
- 0x924D, 0x924D, 0x2518, 0x924E, 0x9250, 0x4E66, 0x9251, 0x9251, 0x1E56,
- 0x9252, 0x9254, 0x4E69, 0x9255, 0x9255, 0x250D, 0x9256, 0x9256, 0x4E6C,
- 0x9257, 0x9257, 0x20D3, 0x9258, 0x9259, 0x4E6D, 0x925A, 0x925A, 0x207A,
- 0x925B, 0x925B, 0x20CE, 0x925C, 0x925D, 0x4E6F, 0x925E, 0x925E, 0x2510,
- 0x925F, 0x9261, 0x4E71, 0x9262, 0x9262, 0x1E55, 0x9263, 0x9265, 0x4E74,
- 0x9266, 0x9266, 0x250A, 0x9267, 0x926B, 0x4E77, 0x926C, 0x926D, 0x2511,
- 0x926E, 0x9273, 0x4E7C, 0x9274, 0x9274, 0x086B, 0x9275, 0x9277, 0x4E82,
- 0x9278, 0x9278, 0x1FAA, 0x9279, 0x9279, 0x4E85, 0x927A, 0x927A, 0x251E,
- 0x927B, 0x927B, 0x1F1F, 0x927C, 0x927E, 0x4E86, 0x927F, 0x927F, 0x252D,
- 0x9280, 0x9280, 0x221D, 0x9281, 0x9282, 0x4E89, 0x9283, 0x9283, 0x2532,
- 0x9284, 0x9284, 0x4E8B, 0x9285, 0x9285, 0x217B, 0x9286, 0x928D, 0x4E8C,
- 0x928E, 0x928E, 0x1D80, 0x928F, 0x9290, 0x4E94, 0x9291, 0x9291, 0x21AF,
- 0x9292, 0x9292, 0x4E96, 0x9293, 0x9293, 0x252C, 0x9294, 0x9295, 0x4E97,
- 0x9296, 0x9296, 0x2528, 0x9297, 0x9297, 0x4E99, 0x9298, 0x9298, 0x208C,
- 0x9299, 0x9299, 0x4E9A, 0x929A, 0x929A, 0x252F, 0x929B, 0x929B, 0x4E9B,
- 0x929C, 0x929C, 0x21BC, 0x929D, 0x929F, 0x4E9C, 0x92A0, 0x92A0, 0x251D,
- 0x92A1, 0x92A2, 0x4E9F, 0x92A3, 0x92A3, 0x2535, 0x92A4, 0x92A4, 0x4EA1,
- 0x92A5, 0x92A5, 0x220D, 0x92A6, 0x92A6, 0x2526, 0x92A7, 0x92A7, 0x4EA2,
- 0x92A8, 0x92A8, 0x2534, 0x92A9, 0x92A9, 0x252A, 0x92AA, 0x92AA, 0x251F,
- 0x92AB, 0x92AB, 0x2531, 0x92AC, 0x92AC, 0x251C, 0x92AD, 0x92AD, 0x4EA3,
- 0x92AE, 0x92AE, 0x1D81, 0x92AF, 0x92B0, 0x4EA4, 0x92B1, 0x92B1, 0x2525,
- 0x92B2, 0x92B6, 0x4EA6, 0x92B7, 0x92B7, 0x21CD, 0x92B8, 0x92B8, 0x4EAB,
- 0x92B9, 0x92B9, 0x21DA, 0x92BA, 0x92BA, 0x4EAC, 0x92BB, 0x92BB, 0x2172,
- 0x92BC, 0x92BC, 0x253E, 0x92BD, 0x92C0, 0x4EAD, 0x92C1, 0x92C1, 0x204F,
- 0x92C2, 0x92C2, 0x4EB1, 0x92C3, 0x92C3, 0x2543, 0x92C4, 0x92C4, 0x4EB2,
- 0x92C5, 0x92C5, 0x21D7, 0x92C6, 0x92C6, 0x4EB3, 0x92C7, 0x92C7, 0x1E3C,
- 0x92C8, 0x92C8, 0x1D82, 0x92C9, 0x92CB, 0x4EB4, 0x92CC, 0x92CC, 0x2529,
- 0x92CD, 0x92CE, 0x4EB7, 0x92CF, 0x92CF, 0x2521, 0x92D0, 0x92D1, 0x4EB9,
- 0x92D2, 0x92D2, 0x1EFF, 0x92D3, 0x92DC, 0x4EBB, 0x92DD, 0x92DD, 0x253F,
- 0x92DE, 0x92DE, 0x4EC5, 0x92DF, 0x92DF, 0x2544, 0x92E0, 0x92E2, 0x4EC6,
- 0x92E3, 0x92E3, 0x2523, 0x92E4, 0x92E4, 0x1E90, 0x92E5, 0x92E5, 0x253A,
- 0x92E6, 0x92E6, 0x2545, 0x92E7, 0x92E7, 0x4EC9, 0x92E8, 0x92E8, 0x253D,
- 0x92E9, 0x92E9, 0x4ECA, 0x92EA, 0x92EA, 0x20C1, 0x92EB, 0x92EC, 0x4ECB,
- 0x92ED, 0x92ED, 0x2103, 0x92EE, 0x92EE, 0x2520, 0x92EF, 0x92EF, 0x253C,
- 0x92F0, 0x92F0, 0x253B, 0x92F1, 0x92F1, 0x2538, 0x92F2, 0x92F5, 0x4ECD,
- 0x92F6, 0x92F6, 0x2540, 0x92F7, 0x92F7, 0x4ED1, 0x92F8, 0x92F8, 0x1FCD,
- 0x92F9, 0x92FB, 0x4ED2, 0x92FC, 0x92FC, 0x1F18, 0x92FD, 0x92FF, 0x4ED5,
- 0x9300, 0x9300, 0x4ED8, 0x9301, 0x9301, 0x254B, 0x9302, 0x9305, 0x4ED9,
- 0x9306, 0x9306, 0x2547, 0x9307, 0x9308, 0x254F, 0x9309, 0x930F, 0x4EDD,
- 0x9310, 0x9310, 0x22B0, 0x9311, 0x9311, 0x4EE4, 0x9312, 0x9312, 0x2546,
- 0x9313, 0x9314, 0x4EE5, 0x9315, 0x9315, 0x254C, 0x9316, 0x9317, 0x4EE7,
- 0x9318, 0x9318, 0x1E9A, 0x9319, 0x9319, 0x2552, 0x931A, 0x931A, 0x2530,
- 0x931B, 0x931B, 0x2549, 0x931C, 0x931E, 0x4EE9, 0x931F, 0x931F, 0x2551,
- 0x9320, 0x9320, 0x1ECA, 0x9321, 0x9321, 0x4EEC, 0x9322, 0x9322, 0x20D2,
- 0x9323, 0x9325, 0x4EED, 0x9326, 0x9326, 0x1FB8, 0x9327, 0x9327, 0x4EF0,
- 0x9328, 0x9328, 0x2079, 0x9329, 0x932A, 0x4EF1, 0x932B, 0x932B, 0x21AB,
- 0x932C, 0x932D, 0x4EF3, 0x932E, 0x932E, 0x254D, 0x932F, 0x932F, 0x1EA5,
- 0x9330, 0x9331, 0x4EF5, 0x9332, 0x9332, 0x204C, 0x9333, 0x9333, 0x2080,
- 0x9334, 0x9335, 0x4EF7, 0x9336, 0x9336, 0x266D, 0x9337, 0x9337, 0x4EF9,
- 0x9338, 0x9338, 0x2537, 0x9339, 0x933D, 0x4EFA, 0x933E, 0x933E, 0x1D83,
- 0x933F, 0x933F, 0x4EFF, 0x9340, 0x9340, 0x254A, 0x9341, 0x9341, 0x21B8,
- 0x9342, 0x9342, 0x4F00, 0x9343, 0x9343, 0x254E, 0x9344, 0x9345, 0x4F01,
- 0x9346, 0x9346, 0x24FC, 0x9347, 0x9347, 0x2554, 0x9348, 0x934A, 0x4F03,
- 0x934B, 0x934B, 0x1F3C, 0x934C, 0x934C, 0x4F06, 0x934D, 0x934D, 0x1ED5,
- 0x934E, 0x9353, 0x4F07, 0x9354, 0x9354, 0x2556, 0x9355, 0x9357, 0x4F0D,
- 0x9358, 0x9358, 0x2268, 0x9359, 0x935A, 0x4F10, 0x935B, 0x935B, 0x1ED6,
- 0x935C, 0x9363, 0x4F12, 0x9364, 0x9364, 0x2557, 0x9365, 0x9365, 0x2553,
- 0x9366, 0x9368, 0x4F1A, 0x9369, 0x9369, 0x2548, 0x936A, 0x936A, 0x1D84,
- 0x936B, 0x936B, 0x4F1D, 0x936C, 0x936C, 0x20DC, 0x936D, 0x936F, 0x4F1E,
- 0x9370, 0x9370, 0x2559, 0x9371, 0x9374, 0x4F21, 0x9375, 0x9375, 0x1F97,
- 0x9376, 0x9376, 0x2555, 0x9377, 0x9379, 0x4F25, 0x937A, 0x937A, 0x227D,
- 0x937B, 0x937D, 0x4F28, 0x937E, 0x937E, 0x257E, 0x937F, 0x9381, 0x4F2B,
- 0x9382, 0x9382, 0x207C, 0x9383, 0x9383, 0x4F2E, 0x9384, 0x9384, 0x255A,
- 0x9385, 0x9386, 0x4F2F, 0x9387, 0x9387, 0x255E, 0x9388, 0x9389, 0x4F31,
- 0x938A, 0x938A, 0x1E34, 0x938B, 0x938E, 0x4F33, 0x938F, 0x938F, 0x1D86,
- 0x9390, 0x9395, 0x4F37, 0x9396, 0x9396, 0x215E, 0x9397, 0x9397, 0x4F3D,
- 0x9398, 0x9398, 0x2560, 0x9399, 0x93A1, 0x4F3E, 0x93A2, 0x93A2, 0x21A2,
- 0x93A3, 0x93A3, 0x2354, 0x93A4, 0x93A5, 0x4F47, 0x93A6, 0x93A6, 0x2563,
- 0x93A7, 0x93A7, 0x2527, 0x93A8, 0x93A8, 0x4F49, 0x93A9, 0x93A9, 0x252E,
- 0x93AA, 0x93AA, 0x2558, 0x93AB, 0x93AB, 0x4F4A, 0x93AC, 0x93AC, 0x1F1B,
- 0x93AD, 0x93AD, 0x4F4B, 0x93AE, 0x93AE, 0x2283, 0x93AF, 0x93AF, 0x4F4C,
- 0x93B0, 0x93B0, 0x2564, 0x93B1, 0x93B2, 0x4F4D, 0x93B3, 0x93B3, 0x20A0,
- 0x93B4, 0x93B4, 0x4F4F, 0x93B5, 0x93B5, 0x2565, 0x93B6, 0x93B7, 0x4F50,
- 0x93B8, 0x93B8, 0x2561, 0x93B9, 0x93BE, 0x4F52, 0x93BF, 0x93BF, 0x2562,
- 0x93C0, 0x93C2, 0x4F58, 0x93C3, 0x93C3, 0x256C, 0x93C4, 0x93C6, 0x4F5B,
- 0x93C7, 0x93C7, 0x256D, 0x93C8, 0x93C8, 0x2020, 0x93C9, 0x93C9, 0x4F5E,
- 0x93CA, 0x93CA, 0x1D85, 0x93CB, 0x93CB, 0x4F5F, 0x93CC, 0x93CC, 0x255F,
- 0x93CD, 0x93CD, 0x256A, 0x93CE, 0x93D0, 0x4F60, 0x93D1, 0x93D1, 0x256E,
- 0x93D2, 0x93D5, 0x4F63, 0x93D6, 0x93D6, 0x1E01, 0x93D7, 0x93D7, 0x2539,
- 0x93D8, 0x93D8, 0x255C, 0x93D9, 0x93DB, 0x4F67, 0x93DC, 0x93DD, 0x2568,
- 0x93DE, 0x93DE, 0x256B, 0x93DF, 0x93DF, 0x1E6F, 0x93E0, 0x93E0, 0x4F6A,
- 0x93E1, 0x93E1, 0x1FC4, 0x93E2, 0x93E2, 0x2567, 0x93E3, 0x93E3, 0x4F6B,
- 0x93E4, 0x93E4, 0x255B, 0x93E5, 0x93E7, 0x4F6C, 0x93E8, 0x93E8, 0x261D,
- 0x93E9, 0x93F4, 0x4F6F, 0x93F5, 0x93F5, 0x252B, 0x93F6, 0x93F6, 0x4F7B,
- 0x93F7, 0x93F7, 0x2571, 0x93F8, 0x93F8, 0x4F7C, 0x93F9, 0x93F9, 0x2577,
- 0x93FA, 0x93FF, 0x4F7D, 0x9400, 0x9402, 0x4F83, 0x9403, 0x9403, 0x2522,
- 0x9404, 0x940A, 0x4F86, 0x940B, 0x940B, 0x2533, 0x940C, 0x940F, 0x4F8D,
- 0x9410, 0x9410, 0x202A, 0x9411, 0x9411, 0x4F91, 0x9412, 0x9412, 0x2536,
- 0x9413, 0x9413, 0x2573, 0x9414, 0x9414, 0x256F, 0x9415, 0x9417, 0x4F92,
- 0x9418, 0x9418, 0x2293, 0x9419, 0x9419, 0x2578, 0x941A, 0x941C, 0x4F95,
- 0x941D, 0x941D, 0x2570, 0x941E, 0x941F, 0x4F98, 0x9420, 0x9420, 0x2575,
- 0x9421, 0x9425, 0x4F9A, 0x9426, 0x9427, 0x2541, 0x9428, 0x9428, 0x255D,
- 0x9429, 0x942D, 0x4F9F, 0x942E, 0x942E, 0x201A, 0x942F, 0x9431, 0x4FA4,
- 0x9432, 0x9432, 0x257A, 0x9433, 0x9433, 0x2006, 0x9434, 0x9434, 0x4FA7,
- 0x9435, 0x9435, 0x2177, 0x9436, 0x9437, 0x4FA8, 0x9438, 0x9438, 0x251B,
- 0x9439, 0x9439, 0x4FAA, 0x943A, 0x943A, 0x2524, 0x943B, 0x943D, 0x4FAB,
- 0x943E, 0x943E, 0x1D87, 0x943F, 0x943F, 0x257B, 0x9440, 0x9443, 0x4FAE,
- 0x9444, 0x9444, 0x22A3, 0x9445, 0x9449, 0x4FB2, 0x944A, 0x944A, 0x2579,
- 0x944B, 0x944B, 0x4FB7, 0x944C, 0x944C, 0x2566, 0x944D, 0x9451, 0x4FB8,
- 0x9452, 0x9452, 0x1F93, 0x9453, 0x9453, 0x4FBD, 0x9454, 0x9454, 0x257C,
- 0x9455, 0x945F, 0x4FBE, 0x9460, 0x9460, 0x2514, 0x9461, 0x9462, 0x4FC9,
- 0x9463, 0x9463, 0x257D, 0x9464, 0x9464, 0x4FCB, 0x9465, 0x9465, 0x2572,
- 0x9466, 0x946A, 0x4FCC, 0x946B, 0x946B, 0x1D88, 0x946C, 0x946C, 0x4FD1,
- 0x946D, 0x946D, 0x2574, 0x946E, 0x946F, 0x4FD2, 0x9470, 0x9470, 0x224E,
- 0x9471, 0x9471, 0x4FD4, 0x9472, 0x9472, 0x21C6, 0x9473, 0x9476, 0x4FD5,
- 0x9477, 0x9477, 0x209F, 0x9478, 0x9478, 0x4FD9, 0x9479, 0x9479, 0x2576,
- 0x947A, 0x947B, 0x4FDA, 0x947C, 0x947C, 0x2064, 0x947D, 0x947D, 0x22BF,
- 0x947E, 0x947E, 0x261C, 0x947F, 0x947F, 0x225E, 0x9480, 0x9484, 0x4FDC,
- 0x9485, 0x9487, 0x1A8E, 0x9488, 0x9488, 0x118C, 0x9489, 0x9489, 0x05E3,
- 0x948A, 0x948A, 0x1A92, 0x948B, 0x948B, 0x1A91, 0x948C, 0x948D, 0x1A93,
- 0x948E, 0x948E, 0x0C22, 0x948F, 0x9490, 0x1A95, 0x9491, 0x9491, 0x4FE1,
- 0x9492, 0x9492, 0x064D, 0x9493, 0x9493, 0x05D7, 0x9494, 0x9494, 0x1A97,
- 0x9495, 0x9495, 0x1A99, 0x9496, 0x9496, 0x4FE2, 0x9497, 0x9497, 0x1A98,
- 0x9498, 0x9498, 0x4FE3, 0x9499, 0x9499, 0x06C1, 0x949A, 0x949C, 0x1A9A,
- 0x949D, 0x949D, 0x061A, 0x949E, 0x949E, 0x04D3, 0x949F, 0x949F, 0x11D2,
- 0x94A0, 0x94A0, 0x0B29, 0x94A1, 0x94A1, 0x041E, 0x94A2, 0x94A2, 0x06D1,
- 0x94A3, 0x94A4, 0x1A9D, 0x94A5, 0x94A5, 0x1102, 0x94A6, 0x94A6, 0x0C52,
- 0x94A7, 0x94A7, 0x092A, 0x94A8, 0x94A8, 0x0EE8, 0x94A9, 0x94A9, 0x070C,
- 0x94AA, 0x94AA, 0x1AA0, 0x94AB, 0x94AB, 0x1A9F, 0x94AC, 0x94AC, 0x1AA2,
- 0x94AD, 0x94AD, 0x1AA1, 0x94AE, 0x94AE, 0x0B66, 0x94AF, 0x94B0, 0x1AA3,
- 0x94B1, 0x94B1, 0x0C2B, 0x94B2, 0x94B2, 0x1AA5, 0x94B3, 0x94B3, 0x0C2C,
- 0x94B4, 0x94B4, 0x1AA6, 0x94B5, 0x94B5, 0x046E, 0x94B6, 0x94BA, 0x1AA7,
- 0x94BB, 0x94BB, 0x1247, 0x94BC, 0x94BD, 0x1AAC, 0x94BE, 0x94BE, 0x084B,
- 0x94BF, 0x94BF, 0x1AAE, 0x94C0, 0x94C0, 0x10B0, 0x94C1, 0x94C1, 0x0E4D,
- 0x94C2, 0x94C2, 0x0473, 0x94C3, 0x94C3, 0x0A2E, 0x94C4, 0x94C4, 0x1AAF,
- 0x94C5, 0x94C5, 0x0C23, 0x94C6, 0x94C6, 0x0AB2, 0x94C7, 0x94C7, 0x4FE4,
- 0x94C8, 0x94CE, 0x1AB0, 0x94CF, 0x94CF, 0x4FE5, 0x94D0, 0x94D2, 0x1AB7,
- 0x94D3, 0x94D4, 0x4FE6, 0x94D5, 0x94D7, 0x1ABA, 0x94D8, 0x94D8, 0x1ABE,
- 0x94D9, 0x94D9, 0x1ABD, 0x94DA, 0x94DA, 0x4FE8, 0x94DB, 0x94DB, 0x1ABF,
- 0x94DC, 0x94DC, 0x0E5E, 0x94DD, 0x94DD, 0x0A68, 0x94DE, 0x94E0, 0x1AC0,
- 0x94E1, 0x94E1, 0x1142, 0x94E2, 0x94E2, 0x1AC3, 0x94E3, 0x94E3, 0x0F20,
- 0x94E4, 0x94E5, 0x1AC4, 0x94E6, 0x94E6, 0x4FE9, 0x94E7, 0x94E8, 0x1AC6,
- 0x94E9, 0x94E9, 0x1AC9, 0x94EA, 0x94EA, 0x1AC8, 0x94EB, 0x94EB, 0x1ACA,
- 0x94EC, 0x94EC, 0x06F0, 0x94ED, 0x94ED, 0x0AFF, 0x94EE, 0x94EF, 0x1ACB,
- 0x94F0, 0x94F0, 0x0893, 0x94F1, 0x94F1, 0x1046, 0x94F2, 0x94F2, 0x04C0,
- 0x94F3, 0x94F5, 0x1ACD, 0x94F6, 0x94F6, 0x107F, 0x94F7, 0x94F7, 0x1AD0,
- 0x94F8, 0x94F8, 0x11FC, 0x94F9, 0x94F9, 0x1AD1, 0x94FA, 0x94FA, 0x0BEB,
- 0x94FB, 0x94FB, 0x4FEA, 0x94FC, 0x94FD, 0x1AD2, 0x94FE, 0x94FE, 0x09FD,
- 0x94FF, 0x94FF, 0x1AD4, 0x9500, 0x9500, 0x0F67, 0x9501, 0x9501, 0x0DED,
- 0x9502, 0x9502, 0x1AD6, 0x9503, 0x9503, 0x1AD5, 0x9504, 0x9504, 0x051F,
- 0x9505, 0x9505, 0x0751, 0x9506, 0x9507, 0x1AD7, 0x9508, 0x9508, 0x0FAD,
- 0x9509, 0x950A, 0x1AD9, 0x950B, 0x950B, 0x0683, 0x950C, 0x950C, 0x0F8A,
- 0x950D, 0x950F, 0x1ADB, 0x9510, 0x9510, 0x0CCC, 0x9511, 0x9511, 0x0E33,
- 0x9512, 0x9516, 0x1ADE, 0x9517, 0x9517, 0x1181, 0x9518, 0x9518, 0x1AE3,
- 0x9519, 0x9519, 0x0570, 0x951A, 0x951A, 0x0AAF, 0x951B, 0x951B, 0x1AE4,
- 0x951C, 0x951C, 0x4FEB, 0x951D, 0x951F, 0x1AE5, 0x9520, 0x9520, 0x4FEC,
- 0x9521, 0x9521, 0x0F0C, 0x9522, 0x9522, 0x1AE8, 0x9523, 0x9523, 0x0A87,
- 0x9524, 0x9524, 0x053B, 0x9525, 0x9525, 0x1213, 0x9526, 0x9526, 0x08C6,
- 0x9527, 0x9527, 0x4FED, 0x9528, 0x9528, 0x0F34, 0x9529, 0x9529, 0x1AEB,
- 0x952A, 0x952B, 0x1AE9, 0x952C, 0x952C, 0x1AEC, 0x952D, 0x952D, 0x05E6,
- 0x952E, 0x952E, 0x086F, 0x952F, 0x952F, 0x0911, 0x9530, 0x9530, 0x0AD1,
- 0x9531, 0x9532, 0x1AED, 0x9533, 0x9533, 0x4FEE, 0x9534, 0x9534, 0x1AEF,
- 0x9535, 0x9535, 0x1AF7, 0x9536, 0x9538, 0x1AF0, 0x9539, 0x9539, 0x0C3F,
- 0x953A, 0x953A, 0x1B19, 0x953B, 0x953B, 0x060C, 0x953C, 0x953C, 0x1AF3,
- 0x953D, 0x953D, 0x4FEF, 0x953E, 0x953F, 0x1AF4, 0x9540, 0x9540, 0x0605,
- 0x9541, 0x9541, 0x0AC3, 0x9542, 0x9542, 0x1AF6, 0x9543, 0x9543, 0x4FF0,
- 0x9544, 0x9546, 0x1AF8, 0x9547, 0x9547, 0x1193, 0x9548, 0x9548, 0x4FF1,
- 0x9549, 0x9549, 0x1AFB, 0x954A, 0x954A, 0x0B5A, 0x954B, 0x954B, 0x4FF2,
- 0x954C, 0x954C, 0x1AFC, 0x954D, 0x954D, 0x0B5B, 0x954E, 0x954F, 0x1AFD,
- 0x9550, 0x9550, 0x06DF, 0x9551, 0x9551, 0x0402, 0x9552, 0x9554, 0x1AFF,
- 0x9555, 0x9555, 0x4FF3, 0x9556, 0x9559, 0x1B02, 0x955A, 0x955A, 0x4FF4,
- 0x955B, 0x955B, 0x1B06, 0x955C, 0x955C, 0x08E4, 0x955D, 0x955D, 0x1B09,
- 0x955E, 0x955F, 0x1B07, 0x9560, 0x9560, 0x4FF5, 0x9561, 0x9562, 0x1B0A,
- 0x9563, 0x9563, 0x0A16, 0x9564, 0x956C, 0x1B0C, 0x956D, 0x956D, 0x09C3,
- 0x956E, 0x956E, 0x4FF6, 0x956F, 0x956F, 0x1B15, 0x9570, 0x9570, 0x09F6,
- 0x9571, 0x9573, 0x1B16, 0x9574, 0x9575, 0x4FF7, 0x9576, 0x9576, 0x0F4F,
- 0x9577, 0x9577, 0x1E75, 0x9578, 0x957E, 0x4FF9, 0x957F, 0x957F, 0x04C9,
- 0x9580, 0x9580, 0x207D, 0x9581, 0x9581, 0x5000, 0x9582, 0x9582, 0x23BF,
- 0x9583, 0x9583, 0x2113, 0x9584, 0x9585, 0x5001, 0x9586, 0x9586, 0x23C0,
- 0x9587, 0x9588, 0x5003, 0x9589, 0x9589, 0x1E45, 0x958A, 0x958A, 0x5005,
- 0x958B, 0x958B, 0x1FD8, 0x958C, 0x958C, 0x23C4, 0x958D, 0x958D, 0x5006,
- 0x958E, 0x958E, 0x23C2, 0x958F, 0x958F, 0x2104, 0x9590, 0x9590, 0x5007,
- 0x9591, 0x9591, 0x21BD, 0x9592, 0x9592, 0x5008, 0x9593, 0x9593, 0x1F87,
- 0x9594, 0x9594, 0x23C3, 0x9595, 0x9597, 0x5009, 0x9598, 0x9598, 0x2269,
- 0x9599, 0x95A0, 0x500C, 0x95A1, 0x95A1, 0x1F43, 0x95A2, 0x95A2, 0x5014,
- 0x95A3, 0x95A3, 0x1F1E, 0x95A4, 0x95A4, 0x2679, 0x95A5, 0x95A5, 0x1EEB,
- 0x95A6, 0x95A7, 0x5015, 0x95A8, 0x95A8, 0x1F35, 0x95A9, 0x95A9, 0x208A,
- 0x95AA, 0x95AA, 0x5017, 0x95AB, 0x95AB, 0x23C7, 0x95AC, 0x95AC, 0x23C9,
- 0x95AD, 0x95AD, 0x23C6, 0x95AE, 0x95B1, 0x5018, 0x95B2, 0x95B2, 0x224F,
- 0x95B3, 0x95B5, 0x501C, 0x95B6, 0x95B6, 0x23CB, 0x95B7, 0x95B8, 0x501F,
- 0x95B9, 0x95B9, 0x21F3, 0x95BA, 0x95BA, 0x5021, 0x95BB, 0x95BB, 0x21F7,
- 0x95BC, 0x95BC, 0x23CF, 0x95BD, 0x95BD, 0x23CE, 0x95BE, 0x95BE, 0x23CA,
- 0x95BF, 0x95BF, 0x23CD, 0x95C0, 0x95C2, 0x5022, 0x95C3, 0x95C3, 0x23D0,
- 0x95C4, 0x95C5, 0x5025, 0x95C6, 0x95C6, 0x266C, 0x95C7, 0x95C7, 0x5027,
- 0x95C8, 0x95C8, 0x23C1, 0x95C9, 0x95C9, 0x5028, 0x95CA, 0x95CA, 0x1FEE,
- 0x95CB, 0x95CB, 0x23D1, 0x95CC, 0x95CC, 0x1FF8, 0x95CD, 0x95CF, 0x5029,
- 0x95D0, 0x95D0, 0x23D3, 0x95D1, 0x95D3, 0x502C, 0x95D4, 0x95D4, 0x23D2,
- 0x95D5, 0x95D5, 0x23D4, 0x95D6, 0x95D6, 0x1E98, 0x95D7, 0x95DB, 0x502F,
- 0x95DC, 0x95DC, 0x1F2C, 0x95DD, 0x95DD, 0x5034, 0x95DE, 0x95DE, 0x23D5,
- 0x95DF, 0x95E0, 0x5035, 0x95E1, 0x95E1, 0x1E71, 0x95E2, 0x95E2, 0x2691,
- 0x95E3, 0x95E4, 0x5037, 0x95E5, 0x95E5, 0x23C5, 0x95E6, 0x95E7, 0x5039,
- 0x95E8, 0x95E8, 0x0ACA, 0x95E9, 0x95E9, 0x1685, 0x95EA, 0x95EA, 0x0CFA,
- 0x95EB, 0x95EB, 0x1686, 0x95EC, 0x95EC, 0x503B, 0x95ED, 0x95ED, 0x043E,
- 0x95EE, 0x95EE, 0x0ED9, 0x95EF, 0x95EF, 0x0536, 0x95F0, 0x95F0, 0x0CCD,
- 0x95F1, 0x95F1, 0x1687, 0x95F2, 0x95F2, 0x0F3D, 0x95F3, 0x95F3, 0x1688,
- 0x95F4, 0x95F4, 0x0857, 0x95F5, 0x95F6, 0x1689, 0x95F7, 0x95F7, 0x0ACB,
- 0x95F8, 0x95F8, 0x1143, 0x95F9, 0x95F9, 0x0B39, 0x95FA, 0x95FA, 0x0744,
- 0x95FB, 0x95FB, 0x0ED4, 0x95FC, 0x95FC, 0x168B, 0x95FD, 0x95FD, 0x0AFB,
- 0x95FE, 0x95FE, 0x168C, 0x95FF, 0x95FF, 0x503C, 0x9600, 0x9600, 0x0644,
- 0x9601, 0x9601, 0x06EE, 0x9602, 0x9602, 0x0789, 0x9603, 0x9604, 0x168D,
- 0x9605, 0x9605, 0x1107, 0x9606, 0x9606, 0x168F, 0x9607, 0x9607, 0x503D,
- 0x9608, 0x9608, 0x1690, 0x9609, 0x9609, 0x0FF4, 0x960A, 0x960D, 0x1691,
- 0x960E, 0x960E, 0x0FFF, 0x960F, 0x960F, 0x1695, 0x9610, 0x9610, 0x04C2,
- 0x9611, 0x9611, 0x09A6, 0x9612, 0x9612, 0x1696, 0x9613, 0x9613, 0x503E,
- 0x9614, 0x9614, 0x0996, 0x9615, 0x9617, 0x1697, 0x9618, 0x9618, 0x503F,
- 0x9619, 0x961A, 0x169A, 0x961B, 0x961B, 0x5040, 0x961C, 0x961C, 0x06B2,
- 0x961D, 0x961D, 0x1354, 0x961E, 0x961E, 0x5041, 0x961F, 0x961F, 0x0612,
- 0x9620, 0x9620, 0x5042, 0x9621, 0x9621, 0x1356, 0x9622, 0x9622, 0x1355,
- 0x9623, 0x9629, 0x5043, 0x962A, 0x962A, 0x1358, 0x962B, 0x962D, 0x504A,
- 0x962E, 0x962E, 0x0CC9, 0x962F, 0x9630, 0x504D, 0x9631, 0x9631, 0x1357,
- 0x9632, 0x9632, 0x065D, 0x9633, 0x9633, 0x101D, 0x9634, 0x9634, 0x107C,
- 0x9635, 0x9635, 0x1194, 0x9636, 0x9636, 0x08A8, 0x9637, 0x963A, 0x504F,
- 0x963B, 0x963B, 0x1245, 0x963C, 0x963C, 0x135A, 0x963D, 0x963D, 0x1359,
- 0x963E, 0x963E, 0x5053, 0x963F, 0x963F, 0x03AD, 0x9640, 0x9640, 0x0E84,
- 0x9641, 0x9641, 0x5054, 0x9642, 0x9642, 0x135B, 0x9643, 0x9643, 0x5055,
- 0x9644, 0x9644, 0x06B8, 0x9645, 0x9645, 0x083D, 0x9646, 0x9646, 0x0A64,
- 0x9647, 0x9647, 0x0A4B, 0x9648, 0x9648, 0x04E7, 0x9649, 0x9649, 0x135C,
- 0x964A, 0x964A, 0x5056, 0x964B, 0x964B, 0x0A51, 0x964C, 0x964C, 0x0B13,
- 0x964D, 0x964D, 0x0886, 0x964E, 0x964F, 0x5057, 0x9650, 0x9650, 0x0F4B,
- 0x9651, 0x9653, 0x5059, 0x9654, 0x9654, 0x135D, 0x9655, 0x9655, 0x0CFB,
- 0x9656, 0x9657, 0x505C, 0x9658, 0x9658, 0x231A, 0x9659, 0x965A, 0x505E,
- 0x965B, 0x965B, 0x0446, 0x965C, 0x965C, 0x5060, 0x965D, 0x965D, 0x2114,
- 0x965E, 0x965E, 0x5061, 0x965F, 0x965F, 0x135E, 0x9660, 0x9660, 0x5062,
- 0x9661, 0x9661, 0x05F7, 0x9662, 0x9662, 0x10FD, 0x9663, 0x9663, 0x2284,
- 0x9664, 0x9664, 0x0522, 0x9665, 0x9666, 0x5063, 0x9667, 0x9667, 0x135F,
- 0x9668, 0x9668, 0x110C, 0x9669, 0x9669, 0x0F42, 0x966A, 0x966A, 0x0BA4,
- 0x966B, 0x966B, 0x5065, 0x966C, 0x966C, 0x1360, 0x966D, 0x966F, 0x5066,
- 0x9670, 0x9670, 0x221C, 0x9671, 0x9671, 0x5069, 0x9672, 0x9672, 0x1361,
- 0x9673, 0x9673, 0x1E7E, 0x9674, 0x9674, 0x1362, 0x9675, 0x9675, 0x0A33,
- 0x9676, 0x9676, 0x0E28, 0x9677, 0x9677, 0x0F4A, 0x9678, 0x9678, 0x204D,
- 0x9679, 0x967C, 0x506A, 0x967D, 0x967D, 0x2201, 0x967E, 0x9684, 0x506E,
- 0x9685, 0x9685, 0x10CC, 0x9686, 0x9686, 0x0A48, 0x9687, 0x9687, 0x5075,
- 0x9688, 0x9688, 0x1363, 0x9689, 0x9689, 0x5076, 0x968A, 0x968A, 0x1ED9,
- 0x968B, 0x968B, 0x0DDA, 0x968C, 0x968C, 0x5077, 0x968D, 0x968D, 0x1364,
- 0x968E, 0x968E, 0x1FB2, 0x968F, 0x968F, 0x0DDB, 0x9690, 0x9690, 0x1085,
- 0x9691, 0x9693, 0x5078, 0x9694, 0x9694, 0x06EF, 0x9695, 0x9695, 0x2252,
- 0x9696, 0x9696, 0x507B, 0x9697, 0x9697, 0x1365, 0x9698, 0x9698, 0x03BA,
- 0x9699, 0x9699, 0x0F23, 0x969A, 0x969A, 0x507C, 0x969B, 0x969B, 0x1F79,
- 0x969C, 0x969C, 0x1170, 0x969D, 0x96A6, 0x507D, 0x96A7, 0x96A7, 0x0DE2,
- 0x96A8, 0x96A8, 0x2157, 0x96A9, 0x96A9, 0x5087, 0x96AA, 0x96AA, 0x21BF,
- 0x96AB, 0x96AF, 0x5088, 0x96B0, 0x96B0, 0x1366, 0x96B1, 0x96B1, 0x221F,
- 0x96B2, 0x96B2, 0x508D, 0x96B3, 0x96B3, 0x1684, 0x96B4, 0x96B4, 0x203D,
- 0x96B5, 0x96B5, 0x508E, 0x96B6, 0x96B6, 0x09EE, 0x96B7, 0x96B7, 0x508F,
- 0x96B8, 0x96B8, 0x2015, 0x96B9, 0x96B9, 0x1D79, 0x96BA, 0x96BA, 0x5090,
- 0x96BB, 0x96BB, 0x26A5, 0x96BC, 0x96BD, 0x1D7A, 0x96BE, 0x96BE, 0x0B34,
- 0x96BF, 0x96BF, 0x5091, 0x96C0, 0x96C0, 0x0C93, 0x96C1, 0x96C1, 0x100C,
- 0x96C2, 0x96C3, 0x5092, 0x96C4, 0x96C4, 0x0FA6, 0x96C5, 0x96C5, 0x0FEE,
- 0x96C6, 0x96C6, 0x0822, 0x96C7, 0x96C7, 0x0726, 0x96C8, 0x96C8, 0x5094,
- 0x96C9, 0x96C9, 0x1B1C, 0x96CA, 0x96CB, 0x5095, 0x96CC, 0x96CC, 0x0549,
- 0x96CD, 0x96CD, 0x109F, 0x96CE, 0x96CE, 0x1D7C, 0x96CF, 0x96CF, 0x0520,
- 0x96D0, 0x96D1, 0x5097, 0x96D2, 0x96D2, 0x1D7D, 0x96D3, 0x96D4, 0x5099,
- 0x96D5, 0x96D5, 0x05D2, 0x96D6, 0x96D6, 0x2156, 0x96D7, 0x96D8, 0x509B,
- 0x96D9, 0x96D9, 0x2144, 0x96DA, 0x96DA, 0x509D, 0x96DB, 0x96DB, 0x1E91,
- 0x96DC, 0x96DC, 0x2257, 0x96DD, 0x96DF, 0x509E, 0x96E0, 0x96E0, 0x1D7F,
- 0x96E1, 0x96E1, 0x50A1, 0x96E2, 0x96E2, 0x200A, 0x96E3, 0x96E3, 0x2092,
- 0x96E4, 0x96E7, 0x50A2, 0x96E8, 0x96E8, 0x10CF, 0x96E9, 0x96E9, 0x1D61,
- 0x96EA, 0x96EA, 0x0FD2, 0x96EB, 0x96EE, 0x50A6, 0x96EF, 0x96EF, 0x1D63,
- 0x96F0, 0x96F1, 0x50AA, 0x96F2, 0x96F2, 0x2250, 0x96F3, 0x96F3, 0x1D62,
- 0x96F4, 0x96F5, 0x50AC, 0x96F6, 0x96F6, 0x0A2C, 0x96F7, 0x96F7, 0x09C2,
- 0x96F8, 0x96F8, 0x50AE, 0x96F9, 0x96F9, 0x040B, 0x96FA, 0x96FA, 0x50AF,
- 0x96FB, 0x96FB, 0x1EC3, 0x96FC, 0x96FD, 0x50B0, 0x96FE, 0x96FE, 0x0EFC,
- 0x96FF, 0x96FF, 0x50B2, 0x9700, 0x9700, 0x0FB3, 0x9701, 0x9701, 0x1D65,
- 0x9702, 0x9703, 0x50B3, 0x9704, 0x9704, 0x0F63, 0x9705, 0x9705, 0x50B5,
- 0x9706, 0x9706, 0x1D64, 0x9707, 0x9707, 0x1191, 0x9708, 0x9708, 0x1D66,
- 0x9709, 0x9709, 0x0ABE, 0x970A, 0x970C, 0x50B6, 0x970D, 0x970D, 0x0809,
- 0x970E, 0x970E, 0x1D68, 0x970F, 0x970F, 0x1D67, 0x9710, 0x9712, 0x50B9,
- 0x9713, 0x9713, 0x0B41, 0x9714, 0x9715, 0x50BC, 0x9716, 0x9716, 0x0A21,
- 0x9717, 0x971B, 0x50BE, 0x971C, 0x971C, 0x0D9F, 0x971D, 0x971D, 0x50C3,
- 0x971E, 0x971E, 0x0F29, 0x971F, 0x9726, 0x50C4, 0x9727, 0x9727, 0x21A8,
- 0x9728, 0x9729, 0x50CC, 0x972A, 0x972A, 0x1D69, 0x972B, 0x972C, 0x50CE,
- 0x972D, 0x972D, 0x1D6A, 0x972E, 0x972F, 0x50D0, 0x9730, 0x9730, 0x1D6B,
- 0x9731, 0x9731, 0x50D2, 0x9732, 0x9732, 0x0A5D, 0x9733, 0x9737, 0x50D3,
- 0x9738, 0x9738, 0x03DF, 0x9739, 0x9739, 0x0BBA, 0x973A, 0x973C, 0x50D8,
- 0x973D, 0x973D, 0x260D, 0x973E, 0x973E, 0x1D6C, 0x973F, 0x9741, 0x50DB,
- 0x9742, 0x9742, 0x260C, 0x9743, 0x9743, 0x50DE, 0x9744, 0x9744, 0x260E,
- 0x9745, 0x9747, 0x50DF, 0x9748, 0x9748, 0x2032, 0x9749, 0x9751, 0x50E2,
- 0x9752, 0x9752, 0x0C5D, 0x9753, 0x9753, 0x1D60, 0x9754, 0x9755, 0x50EB,
- 0x9756, 0x9756, 0x08E7, 0x9757, 0x9758, 0x50ED, 0x9759, 0x9759, 0x08E1,
- 0x975A, 0x975A, 0x260B, 0x975B, 0x975B, 0x05C6, 0x975C, 0x975D, 0x50EF,
- 0x975E, 0x975E, 0x0664, 0x975F, 0x975F, 0x50F1, 0x9760, 0x9760, 0x094C,
- 0x9761, 0x9761, 0x0AD7, 0x9762, 0x9762, 0x0AEB, 0x9763, 0x9764, 0x50F2,
- 0x9765, 0x9765, 0x1282, 0x9766, 0x9767, 0x50F4, 0x9768, 0x9768, 0x22C3,
- 0x9769, 0x9769, 0x06EA, 0x976A, 0x9772, 0x50F6, 0x9773, 0x9773, 0x08CA,
- 0x9774, 0x9774, 0x0FCE, 0x9775, 0x9775, 0x50FF, 0x9776, 0x9776, 0x03DB,
- 0x9777, 0x977B, 0x5100, 0x977C, 0x977C, 0x1DC8, 0x977D, 0x9784, 0x5105,
- 0x9785, 0x9785, 0x1DC9, 0x9786, 0x978A, 0x510D, 0x978B, 0x978B, 0x0F77,
- 0x978C, 0x978C, 0x5112, 0x978D, 0x978D, 0x03BB, 0x978E, 0x978E, 0x5113,
- 0x978F, 0x978F, 0x1F23, 0x9790, 0x9790, 0x5114, 0x9791, 0x9792, 0x1DCA,
- 0x9793, 0x9793, 0x5115, 0x9794, 0x9794, 0x1DCC, 0x9795, 0x9797, 0x5116,
- 0x9798, 0x9798, 0x0C47, 0x9799, 0x979F, 0x5119, 0x97A0, 0x97A0, 0x08FE,
- 0x97A1, 0x97A2, 0x5120, 0x97A3, 0x97A3, 0x1DCF, 0x97A4, 0x97A5, 0x5122,
- 0x97A6, 0x97A6, 0x2695, 0x97A7, 0x97AA, 0x5124, 0x97AB, 0x97AB, 0x1DCE,
- 0x97AC, 0x97AC, 0x5128, 0x97AD, 0x97AD, 0x0447, 0x97AE, 0x97AE, 0x5129,
- 0x97AF, 0x97AF, 0x1DCD, 0x97B0, 0x97B1, 0x512A, 0x97B2, 0x97B2, 0x1DD0,
- 0x97B3, 0x97B3, 0x512C, 0x97B4, 0x97B4, 0x1DD1, 0x97B5, 0x97BC, 0x512D,
- 0x97BD, 0x97BD, 0x265E, 0x97BE, 0x97C2, 0x5135, 0x97C3, 0x97C3, 0x265D,
- 0x97C4, 0x97C5, 0x513A, 0x97C6, 0x97C6, 0x2692, 0x97C7, 0x97C8, 0x513C,
- 0x97C9, 0x97C9, 0x265F, 0x97CA, 0x97CA, 0x513E, 0x97CB, 0x97CB, 0x218D,
- 0x97CC, 0x97CC, 0x20FD, 0x97CD, 0x97D2, 0x513F, 0x97D3, 0x97D3, 0x1F40,
- 0x97D4, 0x97D8, 0x5145, 0x97D9, 0x97D9, 0x2465, 0x97DA, 0x97DB, 0x514A,
- 0x97DC, 0x97DC, 0x2467, 0x97DD, 0x97DD, 0x514C, 0x97DE, 0x97DE, 0x2466,
- 0x97DF, 0x97E5, 0x514D, 0x97E6, 0x97E6, 0x0EB3, 0x97E7, 0x97E7, 0x0CA8,
- 0x97E8, 0x97E8, 0x5154, 0x97E9, 0x97E9, 0x0762, 0x97EA, 0x97EC, 0x184E,
- 0x97ED, 0x97ED, 0x08F1, 0x97EE, 0x97F2, 0x5155, 0x97F3, 0x97F3, 0x107B,
- 0x97F4, 0x97F4, 0x515A, 0x97F5, 0x97F5, 0x1112, 0x97F6, 0x97F6, 0x0D11,
- 0x97F7, 0x97FE, 0x515B, 0x97FF, 0x97FF, 0x21C9, 0x9800, 0x9800, 0x5163,
- 0x9801, 0x9801, 0x2209, 0x9802, 0x9802, 0x1EC9, 0x9803, 0x9803, 0x20E9,
- 0x9804, 0x9804, 0x5164, 0x9805, 0x9805, 0x21CA, 0x9806, 0x9806, 0x2146,
- 0x9807, 0x9807, 0x25C5, 0x9808, 0x9808, 0x21DC, 0x9809, 0x9809, 0x5165,
- 0x980A, 0x980A, 0x245E, 0x980B, 0x980B, 0x5166, 0x980C, 0x980C, 0x214F,
- 0x980D, 0x980D, 0x5167, 0x980E, 0x980F, 0x25C6, 0x9810, 0x9810, 0x2241,
- 0x9811, 0x9811, 0x218A, 0x9812, 0x9812, 0x1E2F, 0x9813, 0x9813, 0x1EDC,
- 0x9814, 0x9816, 0x5168, 0x9817, 0x9817, 0x20BF, 0x9818, 0x9818, 0x2034,
- 0x9819, 0x981B, 0x516B, 0x981C, 0x981C, 0x25C9, 0x981D, 0x9820, 0x516E,
- 0x9821, 0x9821, 0x25C8, 0x9822, 0x9823, 0x5172, 0x9824, 0x9824, 0x220E,
- 0x9825, 0x9825, 0x5174, 0x9826, 0x9826, 0x25CB, 0x9827, 0x982C, 0x5175,
- 0x982D, 0x982D, 0x217D, 0x982E, 0x982F, 0x517B, 0x9830, 0x9830, 0x1F7E,
- 0x9831, 0x9836, 0x517D, 0x9837, 0x9837, 0x25CC, 0x9838, 0x9838, 0x1FC3,
- 0x9839, 0x983A, 0x5183, 0x983B, 0x983B, 0x20B9, 0x983C, 0x983C, 0x5185,
- 0x983D, 0x983D, 0x2181, 0x983E, 0x9845, 0x5186, 0x9846, 0x9846, 0x1FDA,
- 0x9847, 0x984B, 0x518E, 0x984C, 0x984C, 0x2173, 0x984D, 0x984D, 0x1EE1,
- 0x984E, 0x984E, 0x25CD, 0x984F, 0x9852, 0x5193, 0x9853, 0x9853, 0x25CE,
- 0x9854, 0x9854, 0x21F6, 0x9855, 0x9857, 0x5197, 0x9858, 0x9858, 0x224B,
- 0x9859, 0x9859, 0x25D1, 0x985A, 0x985A, 0x519A, 0x985B, 0x985B, 0x1EC0,
- 0x985C, 0x985D, 0x519B, 0x985E, 0x985E, 0x2008, 0x985F, 0x9861, 0x519D,
- 0x9862, 0x9862, 0x25D0, 0x9863, 0x9864, 0x51A0, 0x9865, 0x9865, 0x25D2,
- 0x9866, 0x9866, 0x51A2, 0x9867, 0x9867, 0x1F2A, 0x9868, 0x986A, 0x51A3,
- 0x986B, 0x986B, 0x1E72, 0x986C, 0x986C, 0x25D3, 0x986D, 0x986E, 0x51A6,
- 0x986F, 0x986F, 0x21BE, 0x9870, 0x9870, 0x25D4, 0x9871, 0x9871, 0x2044,
- 0x9872, 0x9872, 0x51A8, 0x9873, 0x9873, 0x25CF, 0x9874, 0x9874, 0x20F3,
- 0x9875, 0x9875, 0x103A, 0x9876, 0x9876, 0x05E4, 0x9877, 0x9877, 0x0C67,
- 0x9878, 0x9878, 0x1BE0, 0x9879, 0x9879, 0x0F5B, 0x987A, 0x987A, 0x0DA8,
- 0x987B, 0x987B, 0x0FB6, 0x987C, 0x987C, 0x1827, 0x987D, 0x987D, 0x0E98,
- 0x987E, 0x987E, 0x0724, 0x987F, 0x987F, 0x0618, 0x9880, 0x9880, 0x1BE1,
- 0x9881, 0x9881, 0x03EF, 0x9882, 0x9882, 0x0DC1, 0x9883, 0x9883, 0x1BE2,
- 0x9884, 0x9884, 0x10E7, 0x9885, 0x9885, 0x0A54, 0x9886, 0x9886, 0x0A35,
- 0x9887, 0x9887, 0x0BE3, 0x9888, 0x9888, 0x08E0, 0x9889, 0x9889, 0x1BE3,
- 0x988A, 0x988A, 0x0848, 0x988B, 0x988B, 0x51A9, 0x988C, 0x988D, 0x1BE4,
- 0x988E, 0x988E, 0x51AA, 0x988F, 0x988F, 0x1BE6, 0x9890, 0x9890, 0x104A,
- 0x9891, 0x9891, 0x0BD4, 0x9892, 0x9892, 0x51AB, 0x9893, 0x9893, 0x0E78,
- 0x9894, 0x9894, 0x1BE7, 0x9895, 0x9895, 0x51AC, 0x9896, 0x9896, 0x1096,
- 0x9897, 0x9897, 0x0952, 0x9898, 0x9898, 0x0E35, 0x9899, 0x9899, 0x51AD,
- 0x989A, 0x989B, 0x1BE8, 0x989C, 0x989C, 0x0FFE, 0x989D, 0x989D, 0x062D,
- 0x989E, 0x989F, 0x1BEA, 0x98A0, 0x98A0, 0x05C0, 0x98A1, 0x98A2, 0x1BEC,
- 0x98A3, 0x98A3, 0x51AE, 0x98A4, 0x98A4, 0x04C3, 0x98A5, 0x98A6, 0x1BEE,
- 0x98A7, 0x98A7, 0x0C82, 0x98A8, 0x98A8, 0x1F00, 0x98A9, 0x98AD, 0x51AF,
- 0x98AE, 0x98AF, 0x24CC, 0x98B0, 0x98B0, 0x51B4, 0x98B1, 0x98B1, 0x2698,
- 0x98B2, 0x98B2, 0x51B5, 0x98B3, 0x98B3, 0x2678, 0x98B4, 0x98B5, 0x51B6,
- 0x98B6, 0x98B6, 0x24CE, 0x98B7, 0x98BB, 0x51B8, 0x98BC, 0x98BC, 0x24CF,
- 0x98BD, 0x98C3, 0x51BD, 0x98C4, 0x98C4, 0x20B8, 0x98C5, 0x98C5, 0x51C4,
- 0x98C6, 0x98C6, 0x24D0, 0x98C7, 0x98C7, 0x51C5, 0x98C8, 0x98C8, 0x24D1,
- 0x98C9, 0x98CD, 0x51C6, 0x98CE, 0x98CE, 0x0684, 0x98CF, 0x98D0, 0x51CB,
- 0x98D1, 0x98D3, 0x19B7, 0x98D4, 0x98D4, 0x51CD, 0x98D5, 0x98D5, 0x19BA,
- 0x98D6, 0x98D7, 0x51CE, 0x98D8, 0x98D8, 0x0BCD, 0x98D9, 0x98DA, 0x19BB,
- 0x98DB, 0x98DB, 0x1EF4, 0x98DC, 0x98DD, 0x51D0, 0x98DE, 0x98DE, 0x0666,
- 0x98DF, 0x98DF, 0x0D4A, 0x98E0, 0x98E0, 0x239B, 0x98E1, 0x98E1, 0x51D2,
- 0x98E2, 0x98E2, 0x267E, 0x98E3, 0x98E6, 0x51D3, 0x98E7, 0x98E7, 0x161A,
- 0x98E8, 0x98E8, 0x1DE7, 0x98E9, 0x98E9, 0x239D, 0x98EA, 0x98EB, 0x239F,
- 0x98EC, 0x98EC, 0x51D7, 0x98ED, 0x98ED, 0x23A1, 0x98EE, 0x98EE, 0x51D8,
- 0x98EF, 0x98EF, 0x1EF1, 0x98F0, 0x98F1, 0x51D9, 0x98F2, 0x98F2, 0x221E,
- 0x98F3, 0x98F3, 0x51DB, 0x98F4, 0x98F4, 0x23A2, 0x98F5, 0x98FB, 0x51DC,
- 0x98FC, 0x98FC, 0x214B, 0x98FD, 0x98FD, 0x1E36, 0x98FE, 0x98FE, 0x2135,
- 0x98FF, 0x98FF, 0x51E3, 0x9900, 0x9902, 0x51E4, 0x9903, 0x9903, 0x1FAD,
- 0x9904, 0x9904, 0x51E7, 0x9905, 0x9905, 0x1E53, 0x9906, 0x9908, 0x51E8,
- 0x9909, 0x9909, 0x23A3, 0x990A, 0x990A, 0x2203, 0x990B, 0x990B, 0x51EB,
- 0x990C, 0x990C, 0x1EE7, 0x990D, 0x990D, 0x1DE8, 0x990E, 0x990F, 0x51EC,
- 0x9910, 0x9910, 0x0494, 0x9911, 0x9911, 0x23A4, 0x9912, 0x9912, 0x2097,
- 0x9913, 0x9913, 0x1EE4, 0x9914, 0x9917, 0x51EE, 0x9918, 0x9918, 0x2238,
- 0x9919, 0x991A, 0x51F2, 0x991B, 0x991B, 0x23A5, 0x991C, 0x991D, 0x51F4,
- 0x991E, 0x991E, 0x1F9A, 0x991F, 0x9920, 0x51F6, 0x9921, 0x9921, 0x21C3,
- 0x9922, 0x9927, 0x51F8, 0x9928, 0x9928, 0x1F2E, 0x9929, 0x992D, 0x51FE,
- 0x992E, 0x992E, 0x1DE9, 0x992F, 0x9932, 0x5203, 0x9933, 0x9933, 0x239C,
- 0x9934, 0x9936, 0x5207, 0x9937, 0x9937, 0x23A6, 0x9938, 0x993B, 0x520A,
- 0x993C, 0x993C, 0x239E, 0x993D, 0x993D, 0x520E, 0x993E, 0x993E, 0x2035,
- 0x993F, 0x993F, 0x23A7, 0x9940, 0x9942, 0x520F, 0x9943, 0x9943, 0x23A8,
- 0x9944, 0x9944, 0x5212, 0x9945, 0x9945, 0x2075, 0x9946, 0x9947, 0x5213,
- 0x9948, 0x994A, 0x23A9, 0x994B, 0x994B, 0x1FEB, 0x994C, 0x994C, 0x23AC,
- 0x994D, 0x9950, 0x5215, 0x9951, 0x9951, 0x1F6A, 0x9952, 0x9952, 0x20F9,
- 0x9953, 0x9953, 0x5219, 0x9954, 0x9954, 0x1DEB, 0x9955, 0x9955, 0x1DEA,
- 0x9956, 0x9956, 0x521A, 0x9957, 0x9957, 0x2666, 0x9958, 0x995B, 0x521B,
- 0x995C, 0x995C, 0x2667, 0x995D, 0x995D, 0x521F, 0x995E, 0x995E, 0x1E6C,
- 0x995F, 0x9961, 0x5220, 0x9962, 0x9962, 0x23AD, 0x9963, 0x9963, 0x161D,
- 0x9964, 0x9964, 0x5223, 0x9965, 0x9965, 0x0815, 0x9966, 0x9966, 0x5224,
- 0x9967, 0x996C, 0x161E, 0x996D, 0x996D, 0x0656, 0x996E, 0x996E, 0x1082,
- 0x996F, 0x996F, 0x0875, 0x9970, 0x9970, 0x0D65, 0x9971, 0x9971, 0x040E,
- 0x9972, 0x9972, 0x0DBC, 0x9973, 0x9973, 0x5225, 0x9974, 0x9974, 0x1624,
- 0x9975, 0x9975, 0x063B, 0x9976, 0x9976, 0x0C9F, 0x9977, 0x9977, 0x1625,
- 0x9978, 0x9979, 0x5226, 0x997A, 0x997A, 0x0899, 0x997B, 0x997B, 0x5228,
- 0x997C, 0x997C, 0x0466, 0x997D, 0x997D, 0x1626, 0x997E, 0x997E, 0x5229,
- 0x997F, 0x997F, 0x0635, 0x9980, 0x9980, 0x1627, 0x9981, 0x9981, 0x0B3C,
- 0x9982, 0x9983, 0x522A, 0x9984, 0x9984, 0x1628, 0x9985, 0x9985, 0x0F47,
- 0x9986, 0x9986, 0x0736, 0x9987, 0x9987, 0x1629, 0x9988, 0x9988, 0x098C,
- 0x9989, 0x9989, 0x522C, 0x998A, 0x998A, 0x162A, 0x998B, 0x998B, 0x04BD,
- 0x998C, 0x998C, 0x522D, 0x998D, 0x998D, 0x162B, 0x998E, 0x998E, 0x522E,
- 0x998F, 0x998F, 0x0A3C, 0x9990, 0x9991, 0x162C, 0x9992, 0x9992, 0x0A9F,
- 0x9993, 0x9995, 0x162E, 0x9996, 0x9996, 0x0D6E, 0x9997, 0x9997, 0x126E,
- 0x9998, 0x9998, 0x12F9, 0x9999, 0x9999, 0x0F50, 0x999A, 0x99A4, 0x522F,
- 0x99A5, 0x99A5, 0x1B2B, 0x99A6, 0x99A7, 0x523A, 0x99A8, 0x99A8, 0x13DE,
- 0x99A9, 0x99AB, 0x523C, 0x99AC, 0x99AC, 0x206D, 0x99AD, 0x99AD, 0x2242,
- 0x99AE, 0x99AE, 0x1F02, 0x99AF, 0x99B0, 0x523F, 0x99B1, 0x99B1, 0x2183,
- 0x99B2, 0x99B2, 0x5241, 0x99B3, 0x99B3, 0x1E85, 0x99B4, 0x99B4, 0x21E9,
- 0x99B5, 0x99C0, 0x5242, 0x99C1, 0x99C1, 0x1E57, 0x99C2, 0x99CF, 0x524E,
- 0x99D0, 0x99D0, 0x22A5, 0x99D1, 0x99D1, 0x2407, 0x99D2, 0x99D2, 0x1FCA,
- 0x99D3, 0x99D3, 0x525C, 0x99D4, 0x99D4, 0x2402, 0x99D5, 0x99D5, 0x1F82,
- 0x99D6, 0x99D7, 0x525D, 0x99D8, 0x99D8, 0x2408, 0x99D9, 0x99D9, 0x2404,
- 0x99DA, 0x99DA, 0x525F, 0x99DB, 0x99DB, 0x2131, 0x99DC, 0x99DC, 0x5260,
- 0x99DD, 0x99DD, 0x2184, 0x99DE, 0x99DE, 0x5261, 0x99DF, 0x99DF, 0x2403,
- 0x99E0, 0x99E0, 0x5262, 0x99E1, 0x99E1, 0x206E, 0x99E2, 0x99E2, 0x240B,
- 0x99E3, 0x99EC, 0x5263, 0x99ED, 0x99ED, 0x1F3F, 0x99EE, 0x99F0, 0x526D,
- 0x99F1, 0x99F1, 0x2067, 0x99F2, 0x99FE, 0x5270, 0x99FF, 0x99FF, 0x1FD7,
- 0x9A00, 0x9A00, 0x527D, 0x9A01, 0x9A01, 0x1E83, 0x9A02, 0x9A04, 0x527E,
- 0x9A05, 0x9A05, 0x240F, 0x9A06, 0x9A0C, 0x5281, 0x9A0D, 0x9A0D, 0x240E,
- 0x9A0E, 0x9A0E, 0x20C7, 0x9A0F, 0x9A0F, 0x240D, 0x9A10, 0x9A15, 0x5288,
- 0x9A16, 0x9A16, 0x2412, 0x9A17, 0x9A18, 0x528E, 0x9A19, 0x9A19, 0x20B7,
- 0x9A1A, 0x9A2A, 0x5290, 0x9A2B, 0x9A2B, 0x23F0, 0x9A2C, 0x9A2C, 0x52A1,
- 0x9A2D, 0x9A2D, 0x2411, 0x9A2E, 0x9A2E, 0x2414, 0x9A2F, 0x9A2F, 0x52A2,
- 0x9A30, 0x9A30, 0x2170, 0x9A31, 0x9A35, 0x52A3, 0x9A36, 0x9A36, 0x2405,
- 0x9A37, 0x9A37, 0x210C, 0x9A38, 0x9A38, 0x2415, 0x9A39, 0x9A3D, 0x52A8,
- 0x9A3E, 0x9A3E, 0x2066, 0x9A3F, 0x9A3F, 0x52AD, 0x9A40, 0x9A40, 0x2352,
- 0x9A41, 0x9A41, 0x2413, 0x9A42, 0x9A42, 0x2410, 0x9A43, 0x9A44, 0x2416,
- 0x9A45, 0x9A45, 0x20F1, 0x9A46, 0x9A49, 0x52AE, 0x9A4A, 0x9A4A, 0x240A,
- 0x9A4B, 0x9A4C, 0x52B2, 0x9A4D, 0x9A4D, 0x2409, 0x9A4E, 0x9A4E, 0x52B4,
- 0x9A4F, 0x9A4F, 0x2418, 0x9A50, 0x9A54, 0x52B5, 0x9A55, 0x9A55, 0x1FA7,
- 0x9A56, 0x9A56, 0x52BA, 0x9A57, 0x9A57, 0x21FC, 0x9A58, 0x9A59, 0x52BB,
- 0x9A5A, 0x9A5A, 0x1FC1, 0x9A5B, 0x9A5B, 0x2406, 0x9A5C, 0x9A5E, 0x52BD,
- 0x9A5F, 0x9A5F, 0x229C, 0x9A60, 0x9A61, 0x52C0, 0x9A62, 0x9A62, 0x204E,
- 0x9A63, 0x9A63, 0x52C2, 0x9A64, 0x9A64, 0x241A, 0x9A65, 0x9A65, 0x2419,
- 0x9A66, 0x9A69, 0x52C3, 0x9A6A, 0x9A6A, 0x240C, 0x9A6B, 0x9A6B, 0x52C7,
- 0x9A6C, 0x9A6C, 0x0A94, 0x9A6D, 0x9A6D, 0x10E9, 0x9A6E, 0x9A6E, 0x0E85,
- 0x9A6F, 0x9A6F, 0x0FDA, 0x9A70, 0x9A70, 0x0500, 0x9A71, 0x9A71, 0x0C7A,
- 0x9A72, 0x9A72, 0x52C8, 0x9A73, 0x9A73, 0x047C, 0x9A74, 0x9A74, 0x0A66,
- 0x9A75, 0x9A75, 0x17BA, 0x9A76, 0x9A76, 0x0D52, 0x9A77, 0x9A78, 0x17BB,
- 0x9A79, 0x9A79, 0x0903, 0x9A7A, 0x9A7A, 0x17BD, 0x9A7B, 0x9A7B, 0x1201,
- 0x9A7C, 0x9A7C, 0x0E86, 0x9A7D, 0x9A7D, 0x17BF, 0x9A7E, 0x9A7E, 0x0850,
- 0x9A7F, 0x9A7F, 0x17BE, 0x9A80, 0x9A81, 0x17C0, 0x9A82, 0x9A82, 0x0A95,
- 0x9A83, 0x9A83, 0x52C9, 0x9A84, 0x9A84, 0x088F, 0x9A85, 0x9A85, 0x17C2,
- 0x9A86, 0x9A86, 0x0A8D, 0x9A87, 0x9A87, 0x075E, 0x9A88, 0x9A88, 0x17C3,
- 0x9A89, 0x9A89, 0x52CA, 0x9A8A, 0x9A8A, 0x17C4, 0x9A8B, 0x9A8B, 0x04F7,
- 0x9A8C, 0x9A8C, 0x1012, 0x9A8D, 0x9A8E, 0x52CB, 0x9A8F, 0x9A8F, 0x0932,
- 0x9A90, 0x9A90, 0x17C5, 0x9A91, 0x9A91, 0x0C0E, 0x9A92, 0x9A93, 0x17C6,
- 0x9A94, 0x9A95, 0x52CD, 0x9A96, 0x9A96, 0x17C8, 0x9A97, 0x9A97, 0x0BCC,
- 0x9A98, 0x9A98, 0x17C9, 0x9A99, 0x9A99, 0x52CF, 0x9A9A, 0x9A9A, 0x0CE0,
- 0x9A9B, 0x9A9D, 0x17CA, 0x9A9E, 0x9A9E, 0x1735, 0x9A9F, 0x9AA0, 0x17CD,
- 0x9AA1, 0x9AA1, 0x0A89, 0x9AA2, 0x9AA3, 0x17CF, 0x9AA4, 0x9AA4, 0x11E7,
- 0x9AA5, 0x9AA5, 0x17D1, 0x9AA6, 0x9AA6, 0x52D0, 0x9AA7, 0x9AA7, 0x17D2,
- 0x9AA8, 0x9AA8, 0x0720, 0x9AA9, 0x9AAE, 0x52D1, 0x9AAF, 0x9AAF, 0x1E29,
- 0x9AB0, 0x9AB0, 0x1DD3, 0x9AB1, 0x9AB1, 0x1DD2, 0x9AB2, 0x9AB5, 0x52D7,
- 0x9AB6, 0x9AB6, 0x1DD6, 0x9AB7, 0x9AB7, 0x1DD4, 0x9AB8, 0x9AB8, 0x0758,
- 0x9AB9, 0x9AB9, 0x52DB, 0x9ABA, 0x9ABA, 0x1DD7, 0x9ABB, 0x9ABB, 0x52DC,
- 0x9ABC, 0x9ABC, 0x1DD8, 0x9ABD, 0x9ABF, 0x52DD, 0x9AC0, 0x9AC0, 0x1DDA,
- 0x9AC1, 0x9AC1, 0x1DD9, 0x9AC2, 0x9AC2, 0x1DDC, 0x9AC3, 0x9AC4, 0x52E0,
- 0x9AC5, 0x9AC5, 0x1DDB, 0x9AC6, 0x9ACA, 0x52E2, 0x9ACB, 0x9ACC, 0x1DDD,
- 0x9ACD, 0x9ACE, 0x52E7, 0x9ACF, 0x9ACF, 0x2661, 0x9AD0, 0x9AD0, 0x52E9,
- 0x9AD1, 0x9AD1, 0x1DDF, 0x9AD2, 0x9AD2, 0x26A4, 0x9AD3, 0x9AD3, 0x0DDD,
- 0x9AD4, 0x9AD4, 0x2174, 0x9AD5, 0x9AD5, 0x2663, 0x9AD6, 0x9AD6, 0x2662,
- 0x9AD7, 0x9AD7, 0x52EA, 0x9AD8, 0x9AD8, 0x06DA, 0x9AD9, 0x9ADE, 0x52EB,
- 0x9ADF, 0x9ADF, 0x1DEC, 0x9AE0, 0x9AE0, 0x52F1, 0x9AE1, 0x9AE1, 0x1DED,
- 0x9AE2, 0x9AE5, 0x52F2, 0x9AE6, 0x9AE6, 0x1DEE, 0x9AE7, 0x9AEA, 0x52F6,
- 0x9AEB, 0x9AEB, 0x1DF0, 0x9AEC, 0x9AEC, 0x52FA, 0x9AED, 0x9AED, 0x1DF2,
- 0x9AEE, 0x9AEE, 0x2675, 0x9AEF, 0x9AEF, 0x1DEF, 0x9AF0, 0x9AF8, 0x52FB,
- 0x9AF9, 0x9AF9, 0x1DF3, 0x9AFA, 0x9AFA, 0x5304, 0x9AFB, 0x9AFB, 0x1DF1,
- 0x9AFC, 0x9AFF, 0x5305, 0x9B00, 0x9B02, 0x5309, 0x9B03, 0x9B03, 0x1234,
- 0x9B04, 0x9B05, 0x530C, 0x9B06, 0x9B06, 0x214C, 0x9B07, 0x9B07, 0x530E,
- 0x9B08, 0x9B08, 0x1DF4, 0x9B09, 0x9B0C, 0x530F, 0x9B0D, 0x9B0D, 0x267A,
- 0x9B0E, 0x9B0E, 0x5313, 0x9B0F, 0x9B0F, 0x1DF5, 0x9B10, 0x9B12, 0x5314,
- 0x9B13, 0x9B13, 0x1DF6, 0x9B14, 0x9B19, 0x5317, 0x9B1A, 0x9B1A, 0x26A0,
- 0x9B1B, 0x9B1E, 0x531D, 0x9B1F, 0x9B1F, 0x1DF7, 0x9B20, 0x9B21, 0x5321,
- 0x9B22, 0x9B22, 0x2668, 0x9B23, 0x9B23, 0x1DF8, 0x9B24, 0x9B24, 0x5323,
- 0x9B25, 0x9B25, 0x1ED0, 0x9B26, 0x9B26, 0x5324, 0x9B27, 0x9B27, 0x2096,
- 0x9B28, 0x9B28, 0x5325, 0x9B29, 0x9B29, 0x23CC, 0x9B2A, 0x9B2D, 0x5326,
- 0x9B2E, 0x9B2E, 0x23C8, 0x9B2F, 0x9B2F, 0x139B, 0x9B30, 0x9B30, 0x532A,
- 0x9B31, 0x9B31, 0x223E, 0x9B32, 0x9B32, 0x1260, 0x9B33, 0x9B3A, 0x532B,
- 0x9B3B, 0x9B3B, 0x1773, 0x9B3C, 0x9B3C, 0x0746, 0x9B3D, 0x9B40, 0x5333,
- 0x9B41, 0x9B41, 0x098A, 0x9B42, 0x9B42, 0x07FF, 0x9B43, 0x9B43, 0x1DE1,
- 0x9B44, 0x9B44, 0x0BE6, 0x9B45, 0x9B45, 0x1DE0, 0x9B46, 0x9B46, 0x5337,
- 0x9B47, 0x9B47, 0x1DE2, 0x9B48, 0x9B48, 0x1DE4, 0x9B49, 0x9B49, 0x1DE3,
- 0x9B4A, 0x9B4C, 0x5338, 0x9B4D, 0x9B4D, 0x1DE5, 0x9B4E, 0x9B4E, 0x2665,
- 0x9B4F, 0x9B4F, 0x0EC9, 0x9B50, 0x9B50, 0x533B, 0x9B51, 0x9B51, 0x1DE6,
- 0x9B52, 0x9B53, 0x533C, 0x9B54, 0x9B54, 0x0B0A, 0x9B55, 0x9B57, 0x533E,
- 0x9B58, 0x9B58, 0x2664, 0x9B59, 0x9B59, 0x5341, 0x9B5A, 0x9B5A, 0x2239,
- 0x9B5B, 0x9B6E, 0x5342, 0x9B6F, 0x9B6F, 0x204A, 0x9B70, 0x9B73, 0x5356,
- 0x9B74, 0x9B74, 0x261F, 0x9B75, 0x9B76, 0x535A, 0x9B77, 0x9B77, 0x261E,
- 0x9B78, 0x9B80, 0x535C, 0x9B81, 0x9B81, 0x2620, 0x9B82, 0x9B82, 0x5365,
- 0x9B83, 0x9B83, 0x2621, 0x9B84, 0x9B8D, 0x5366, 0x9B8E, 0x9B8E, 0x2622,
- 0x9B8F, 0x9B8F, 0x5370, 0x9B90, 0x9B90, 0x2627, 0x9B91, 0x9B91, 0x1E39,
- 0x9B92, 0x9B92, 0x2625, 0x9B93, 0x9B99, 0x5371, 0x9B9A, 0x9B9A, 0x2629,
- 0x9B9B, 0x9B9C, 0x5378, 0x9B9D, 0x9B9D, 0x262E, 0x9B9E, 0x9B9E, 0x262B,
- 0x9B9F, 0x9BA9, 0x537A, 0x9BAA, 0x9BAA, 0x262A, 0x9BAB, 0x9BAB, 0x262D,
- 0x9BAC, 0x9BAC, 0x5385, 0x9BAD, 0x9BAD, 0x2628, 0x9BAE, 0x9BAE, 0x21B9,
- 0x9BAF, 0x9BBF, 0x5386, 0x9BC0, 0x9BC0, 0x2636, 0x9BC1, 0x9BC1, 0x2630,
- 0x9BC2, 0x9BC6, 0x5397, 0x9BC7, 0x9BC7, 0x2638, 0x9BC8, 0x9BC8, 0x539C,
- 0x9BC9, 0x9BC9, 0x200D, 0x9BCA, 0x9BCA, 0x2637, 0x9BCB, 0x9BD3, 0x539D,
- 0x9BD4, 0x9BD4, 0x2645, 0x9BD5, 0x9BD5, 0x53A6, 0x9BD6, 0x9BD6, 0x263A,
- 0x9BD7, 0x9BDA, 0x53A7, 0x9BDB, 0x9BDB, 0x2643, 0x9BDC, 0x9BDC, 0x53AB,
- 0x9BDD, 0x9BDD, 0x2640, 0x9BDE, 0x9BE0, 0x53AC, 0x9BE1, 0x9BE1, 0x263D,
- 0x9BE2, 0x9BE2, 0x2641, 0x9BE3, 0x9BE3, 0x53AF, 0x9BE4, 0x9BE4, 0x263E,
- 0x9BE5, 0x9BE6, 0x53B0, 0x9BE7, 0x9BE7, 0x263F, 0x9BE8, 0x9BE8, 0x1FC0,
- 0x9BE9, 0x9BE9, 0x53B2, 0x9BEA, 0x9BEB, 0x263B, 0x9BEC, 0x9BEF, 0x53B3,
- 0x9BF0, 0x9BF0, 0x2642, 0x9BF1, 0x9BF3, 0x53B7, 0x9BF4, 0x9BF4, 0x2644,
- 0x9BF5, 0x9BFC, 0x53BA, 0x9BFD, 0x9BFD, 0x2639, 0x9BFE, 0x9BFE, 0x53C2,
- 0x9BFF, 0x9BFF, 0x264C, 0x9C00, 0x9C07, 0x53C3, 0x9C08, 0x9C08, 0x2647,
- 0x9C09, 0x9C09, 0x264B, 0x9C0A, 0x9C0C, 0x53CB, 0x9C0D, 0x9C0D, 0x2649,
- 0x9C0E, 0x9C0F, 0x53CE, 0x9C10, 0x9C10, 0x2648, 0x9C11, 0x9C11, 0x53D0,
- 0x9C12, 0x9C12, 0x264A, 0x9C13, 0x9C13, 0x2108, 0x9C14, 0x9C1F, 0x53D1,
- 0x9C20, 0x9C20, 0x264D, 0x9C21, 0x9C22, 0x53DD, 0x9C23, 0x9C23, 0x2634,
- 0x9C24, 0x9C24, 0x53DF, 0x9C25, 0x9C25, 0x2651, 0x9C26, 0x9C27, 0x53E0,
- 0x9C28, 0x9C28, 0x2650, 0x9C29, 0x9C29, 0x2652, 0x9C2A, 0x9C2C, 0x53E2,
- 0x9C2D, 0x9C2D, 0x264F, 0x9C2E, 0x9C30, 0x53E5, 0x9C31, 0x9C31, 0x2632,
- 0x9C32, 0x9C32, 0x264E, 0x9C33, 0x9C33, 0x2653, 0x9C34, 0x9C34, 0x53E8,
- 0x9C35, 0x9C35, 0x2657, 0x9C36, 0x9C36, 0x53E9, 0x9C37, 0x9C37, 0x2635,
- 0x9C38, 0x9C38, 0x53EA, 0x9C39, 0x9C39, 0x2633, 0x9C3A, 0x9C3A, 0x53EB,
- 0x9C3B, 0x9C3B, 0x2656, 0x9C3C, 0x9C3D, 0x53EC, 0x9C3E, 0x9C3E, 0x2654,
- 0x9C3F, 0x9C44, 0x53EE, 0x9C45, 0x9C45, 0x2658, 0x9C46, 0x9C47, 0x53F4,
- 0x9C48, 0x9C48, 0x2655, 0x9C49, 0x9C49, 0x1E4D, 0x9C4A, 0x9C51, 0x53F6,
- 0x9C52, 0x9C52, 0x265B, 0x9C53, 0x9C53, 0x53FE, 0x9C54, 0x9C54, 0x265A,
- 0x9C55, 0x9C55, 0x53FF, 0x9C56, 0x9C56, 0x2659, 0x9C57, 0x9C57, 0x202E,
- 0x9C58, 0x9C58, 0x262F, 0x9C59, 0x9C5C, 0x5400, 0x9C5D, 0x9C5D, 0x2646,
- 0x9C5E, 0x9C5E, 0x5404, 0x9C5F, 0x9C5F, 0x2626, 0x9C60, 0x9C66, 0x5405,
- 0x9C67, 0x9C67, 0x265C, 0x9C68, 0x9C6C, 0x540C, 0x9C6D, 0x9C6D, 0x262C,
- 0x9C6E, 0x9C77, 0x5411, 0x9C78, 0x9C78, 0x2623, 0x9C79, 0x9C79, 0x541B,
- 0x9C7A, 0x9C7A, 0x2631, 0x9C7B, 0x9C7B, 0x541C, 0x9C7C, 0x9C7C, 0x10C8,
- 0x9C7D, 0x9C7E, 0x541D, 0x9C7F, 0x9C7F, 0x1D89, 0x9C80, 0x9C80, 0x541F,
- 0x9C81, 0x9C81, 0x0A5A, 0x9C82, 0x9C82, 0x1D8A, 0x9C83, 0x9C84, 0x5420,
- 0x9C85, 0x9C88, 0x1D8B, 0x9C89, 0x9C8A, 0x5422, 0x9C8B, 0x9C8B, 0x1D90,
- 0x9C8C, 0x9C8C, 0x5424, 0x9C8D, 0x9C8D, 0x0414, 0x9C8E, 0x9C8E, 0x1D91,
- 0x9C8F, 0x9C8F, 0x5425, 0x9C90, 0x9C92, 0x1D92, 0x9C93, 0x9C93, 0x5426,
- 0x9C94, 0x9C95, 0x1D95, 0x9C96, 0x9C99, 0x5427, 0x9C9A, 0x9C9B, 0x1D97,
- 0x9C9C, 0x9C9C, 0x0F37, 0x9C9D, 0x9C9D, 0x542B, 0x9C9E, 0x9CA3, 0x1D99,
- 0x9CA4, 0x9CA4, 0x09DB, 0x9CA5, 0x9CA9, 0x1D9F, 0x9CAA, 0x9CAA, 0x542C,
- 0x9CAB, 0x9CAB, 0x1DA4, 0x9CAC, 0x9CAC, 0x542D, 0x9CAD, 0x9CAE, 0x1DA5,
- 0x9CAF, 0x9CAF, 0x542E, 0x9CB0, 0x9CB7, 0x1DA7, 0x9CB8, 0x9CB8, 0x08D7,
- 0x9CB9, 0x9CB9, 0x542F, 0x9CBA, 0x9CBD, 0x1DAF, 0x9CBE, 0x9CC2, 0x5430,
- 0x9CC3, 0x9CC3, 0x0CD5, 0x9CC4, 0x9CC7, 0x1DB3, 0x9CC8, 0x9CC9, 0x5435,
- 0x9CCA, 0x9CD0, 0x1DB7, 0x9CD1, 0x9CD2, 0x5437, 0x9CD3, 0x9CD5, 0x1DBE,
- 0x9CD6, 0x9CD6, 0x0457, 0x9CD7, 0x9CD9, 0x1DC1, 0x9CDA, 0x9CDB, 0x5439,
- 0x9CDC, 0x9CDD, 0x1DC4, 0x9CDE, 0x9CDE, 0x0A24, 0x9CDF, 0x9CDF, 0x1DC6,
- 0x9CE0, 0x9CE1, 0x543B, 0x9CE2, 0x9CE2, 0x1DC7, 0x9CE3, 0x9CE4, 0x543D,
- 0x9CE5, 0x9CE5, 0x209C, 0x9CE6, 0x9CE8, 0x543F, 0x9CE9, 0x9CE9, 0x2580,
- 0x9CEA, 0x9CEB, 0x5442, 0x9CEC, 0x9CEC, 0x22DC, 0x9CED, 0x9CF2, 0x5444,
- 0x9CF3, 0x9CF3, 0x1F05, 0x9CF4, 0x9CF4, 0x208B, 0x9CF5, 0x9CF5, 0x544A,
- 0x9CF6, 0x9CF6, 0x2581, 0x9CF7, 0x9CFF, 0x544B, 0x9D00, 0x9D05, 0x5454,
- 0x9D06, 0x9D06, 0x2583, 0x9D07, 0x9D07, 0x2582, 0x9D08, 0x9D08, 0x545A,
- 0x9D09, 0x9D09, 0x21EE, 0x9D0A, 0x9D14, 0x545B, 0x9D15, 0x9D15, 0x2182,
- 0x9D16, 0x9D1A, 0x5466, 0x9D1B, 0x9D1B, 0x2243, 0x9D1C, 0x9D1C, 0x546B,
- 0x9D1D, 0x9D1D, 0x2587, 0x9D1E, 0x9D1E, 0x546C, 0x9D1F, 0x9D1F, 0x2588,
- 0x9D20, 0x9D22, 0x546D, 0x9D23, 0x9D23, 0x2584, 0x9D24, 0x9D25, 0x5470,
- 0x9D26, 0x9D26, 0x21FD, 0x9D27, 0x9D27, 0x5472, 0x9D28, 0x9D28, 0x21EF,
- 0x9D29, 0x9D2E, 0x5473, 0x9D2F, 0x9D2F, 0x258A, 0x9D30, 0x9D30, 0x258C,
- 0x9D31, 0x9D3A, 0x5479, 0x9D3B, 0x9D3B, 0x1F47, 0x9D3C, 0x9D3E, 0x5483,
- 0x9D3F, 0x9D3F, 0x1F1D, 0x9D40, 0x9D41, 0x5486, 0x9D42, 0x9D42, 0x258D,
- 0x9D43, 0x9D50, 0x5488, 0x9D51, 0x9D51, 0x1FD0, 0x9D52, 0x9D52, 0x2592,
- 0x9D53, 0x9D53, 0x258F, 0x9D54, 0x9D5B, 0x5496, 0x9D5C, 0x9D5C, 0x2594,
- 0x9D5D, 0x9D5D, 0x1EE0, 0x9D5E, 0x9D5F, 0x549E, 0x9D60, 0x9D60, 0x2591,
- 0x9D61, 0x9D61, 0x2595, 0x9D62, 0x9D69, 0x54A0, 0x9D6A, 0x9D6A, 0x2597,
- 0x9D6B, 0x9D6B, 0x54A8, 0x9D6C, 0x9D6C, 0x20B6, 0x9D6D, 0x9D6E, 0x54A9,
- 0x9D6F, 0x9D6F, 0x2598, 0x9D70, 0x9D71, 0x54AB, 0x9D72, 0x9D72, 0x20F6,
- 0x9D73, 0x9D86, 0x54AD, 0x9D87, 0x9D87, 0x2585, 0x9D88, 0x9D88, 0x54C1,
- 0x9D89, 0x9D89, 0x2599, 0x9D8A, 0x9D92, 0x54C2, 0x9D93, 0x9D93, 0x2596,
- 0x9D94, 0x9D97, 0x54CB, 0x9D98, 0x9D98, 0x259A, 0x9D99, 0x9D99, 0x54CF,
- 0x9D9A, 0x9D9A, 0x259B, 0x9D9B, 0x9DA4, 0x54D0, 0x9DA5, 0x9DA5, 0x259D,
- 0x9DA6, 0x9DA8, 0x54DA, 0x9DA9, 0x9DA9, 0x259E, 0x9DAA, 0x9DAE, 0x54DD,
- 0x9DAF, 0x9DAF, 0x234C, 0x9DB0, 0x9DB3, 0x54E2, 0x9DB4, 0x9DB4, 0x1F44,
- 0x9DB5, 0x9DBA, 0x54E6, 0x9DBB, 0x9DBB, 0x2660, 0x9DBC, 0x9DBC, 0x25A0,
- 0x9DBD, 0x9DBF, 0x54EC, 0x9DC0, 0x9DC0, 0x259C, 0x9DC1, 0x9DC1, 0x54EF,
- 0x9DC2, 0x9DC2, 0x259F, 0x9DC3, 0x9DC3, 0x54F0, 0x9DC4, 0x9DC4, 0x1F6C,
- 0x9DC5, 0x9DD2, 0x54F1, 0x9DD3, 0x9DD3, 0x25A2, 0x9DD4, 0x9DD6, 0x54FF,
- 0x9DD7, 0x9DD7, 0x20AE, 0x9DD8, 0x9DD8, 0x5502, 0x9DD9, 0x9DD9, 0x258B,
- 0x9DDA, 0x9DDA, 0x25A3, 0x9DDB, 0x9DE4, 0x5503, 0x9DE5, 0x9DE5, 0x2589,
- 0x9DE6, 0x9DE6, 0x25A5, 0x9DE7, 0x9DEE, 0x550D, 0x9DEF, 0x9DEF, 0x25A4,
- 0x9DF0, 0x9DF1, 0x5515, 0x9DF2, 0x9DF2, 0x25A6, 0x9DF3, 0x9DF3, 0x2593,
- 0x9DF4, 0x9DF7, 0x5517, 0x9DF8, 0x9DF8, 0x25A7, 0x9DF9, 0x9DF9, 0x2222,
- 0x9DFA, 0x9DFA, 0x25A9, 0x9DFB, 0x9DFF, 0x551B, 0x9E00, 0x9E0B, 0x5520,
- 0x9E0C, 0x9E0C, 0x25A8, 0x9E0D, 0x9E14, 0x552C, 0x9E15, 0x9E15, 0x2586,
- 0x9E16, 0x9E19, 0x5534, 0x9E1A, 0x9E1A, 0x25A1, 0x9E1B, 0x9E1B, 0x25AA,
- 0x9E1C, 0x9E1C, 0x5538, 0x9E1D, 0x9E1D, 0x2590, 0x9E1E, 0x9E1E, 0x258E,
- 0x9E1F, 0x9E1F, 0x0B54, 0x9E20, 0x9E20, 0x1B35, 0x9E21, 0x9E21, 0x0819,
- 0x9E22, 0x9E22, 0x1B36, 0x9E23, 0x9E23, 0x0AFE, 0x9E24, 0x9E24, 0x5539,
- 0x9E25, 0x9E25, 0x0B79, 0x9E26, 0x9E26, 0x0FE4, 0x9E27, 0x9E27, 0x553A,
- 0x9E28, 0x9E2C, 0x1B37, 0x9E2D, 0x9E2D, 0x0FE5, 0x9E2E, 0x9E2E, 0x553B,
- 0x9E2F, 0x9E2F, 0x1015, 0x9E30, 0x9E30, 0x553C, 0x9E31, 0x9E31, 0x1B3D,
- 0x9E32, 0x9E32, 0x1B3C, 0x9E33, 0x9E33, 0x10EA, 0x9E34, 0x9E34, 0x553D,
- 0x9E35, 0x9E35, 0x0E83, 0x9E36, 0x9E36, 0x1B3E, 0x9E37, 0x9E37, 0x1B40,
- 0x9E38, 0x9E38, 0x1B3F, 0x9E39, 0x9E3A, 0x1B41, 0x9E3B, 0x9E3C, 0x553E,
- 0x9E3D, 0x9E3D, 0x06E6, 0x9E3E, 0x9E3E, 0x1B43, 0x9E3F, 0x9E3F, 0x079F,
- 0x9E40, 0x9E40, 0x5540, 0x9E41, 0x9E42, 0x1B44, 0x9E43, 0x9E43, 0x0918,
- 0x9E44, 0x9E44, 0x1B46, 0x9E45, 0x9E45, 0x062B, 0x9E46, 0x9E49, 0x1B47,
- 0x9E4A, 0x9E4A, 0x0C90, 0x9E4B, 0x9E4C, 0x1B4B, 0x9E4D, 0x9E4D, 0x5541,
- 0x9E4E, 0x9E4E, 0x1B4D, 0x9E4F, 0x9E4F, 0x0BB5, 0x9E50, 0x9E50, 0x5542,
- 0x9E51, 0x9E51, 0x1B4E, 0x9E52, 0x9E54, 0x5543, 0x9E55, 0x9E55, 0x1B4F,
- 0x9E56, 0x9E56, 0x5546, 0x9E57, 0x9E57, 0x1B50, 0x9E58, 0x9E58, 0x1DD5,
- 0x9E59, 0x9E59, 0x5547, 0x9E5A, 0x9E5C, 0x1B51, 0x9E5D, 0x9E5D, 0x5548,
- 0x9E5E, 0x9E5E, 0x1B54, 0x9E5F, 0x9E62, 0x5549, 0x9E63, 0x9E63, 0x1B55,
- 0x9E64, 0x9E64, 0x078E, 0x9E65, 0x9E65, 0x554D, 0x9E66, 0x9E6C, 0x1B56,
- 0x9E6D, 0x9E6D, 0x1B5E, 0x9E6E, 0x9E6F, 0x554E, 0x9E70, 0x9E70, 0x108A,
- 0x9E71, 0x9E71, 0x1B5D, 0x9E72, 0x9E72, 0x5550, 0x9E73, 0x9E73, 0x1B5F,
- 0x9E74, 0x9E74, 0x5551, 0x9E75, 0x9E75, 0x2688, 0x9E76, 0x9E78, 0x5552,
- 0x9E79, 0x9E79, 0x269E, 0x9E7A, 0x9E7A, 0x25FB, 0x9E7B, 0x9E7B, 0x5555,
- 0x9E7C, 0x9E7C, 0x1F8C, 0x9E7D, 0x9E7D, 0x21F4, 0x9E7E, 0x9E7E, 0x1D16,
- 0x9E7F, 0x9E7F, 0x0A60, 0x9E80, 0x9E81, 0x5556, 0x9E82, 0x9E82, 0x1DFC,
- 0x9E83, 0x9E86, 0x5558, 0x9E87, 0x9E88, 0x1DFD, 0x9E89, 0x9E8A, 0x555C,
- 0x9E8B, 0x9E8B, 0x1DFF, 0x9E8C, 0x9E91, 0x555E, 0x9E92, 0x9E92, 0x1E00,
- 0x9E93, 0x9E93, 0x0A5B, 0x9E94, 0x9E96, 0x5564, 0x9E97, 0x9E97, 0x200F,
- 0x9E98, 0x9E9C, 0x5567, 0x9E9D, 0x9E9D, 0x1E02, 0x9E9E, 0x9E9E, 0x556C,
- 0x9E9F, 0x9E9F, 0x1E03, 0x9EA0, 0x9EA4, 0x556D, 0x9EA5, 0x9EA5, 0x2071,
- 0x9EA6, 0x9EA6, 0x0A9A, 0x9EA7, 0x9EA8, 0x5572, 0x9EA9, 0x9EA9, 0x25F7,
- 0x9EAA, 0x9EAE, 0x5574, 0x9EAF, 0x9EAF, 0x2696, 0x9EB0, 0x9EB3, 0x5579,
- 0x9EB4, 0x9EB4, 0x1CEE, 0x9EB5, 0x9EB5, 0x268F, 0x9EB6, 0x9EB7, 0x557D,
- 0x9EB8, 0x9EB8, 0x1CED, 0x9EB9, 0x9EBA, 0x557F, 0x9EBB, 0x9EBB, 0x0A90,
- 0x9EBC, 0x9EBC, 0x5581, 0x9EBD, 0x9EBE, 0x1DF9, 0x9EBF, 0x9EC3, 0x5582,
- 0x9EC4, 0x9EC4, 0x07DB, 0x9EC5, 0x9EC8, 0x5587, 0x9EC9, 0x9EC9, 0x12F8,
- 0x9ECA, 0x9ECB, 0x558B, 0x9ECC, 0x9ECC, 0x22DA, 0x9ECD, 0x9ECD, 0x0D89,
- 0x9ECE, 0x9ECE, 0x09D3, 0x9ECF, 0x9ECF, 0x1B2A, 0x9ED0, 0x9ED0, 0x558D,
- 0x9ED1, 0x9ED1, 0x0791, 0x9ED2, 0x9ED3, 0x558E, 0x9ED4, 0x9ED4, 0x0C2A,
- 0x9ED5, 0x9ED7, 0x5590, 0x9ED8, 0x9ED8, 0x0B0F, 0x9ED9, 0x9EDA, 0x5593,
- 0x9EDB, 0x9EDD, 0x1E04, 0x9EDE, 0x9EDE, 0x1EC1, 0x9EDF, 0x9EDF, 0x1E08,
- 0x9EE0, 0x9EE0, 0x1E07, 0x9EE1, 0x9EE1, 0x5595, 0x9EE2, 0x9EE2, 0x1E09,
- 0x9EE3, 0x9EE4, 0x5596, 0x9EE5, 0x9EE5, 0x1E0C, 0x9EE6, 0x9EE6, 0x5598,
- 0x9EE7, 0x9EE7, 0x1E0B, 0x9EE8, 0x9EE8, 0x1EB3, 0x9EE9, 0x9EE9, 0x1E0A,
- 0x9EEA, 0x9EEA, 0x1E0D, 0x9EEB, 0x9EEE, 0x5599, 0x9EEF, 0x9EEF, 0x1E0E,
- 0x9EF0, 0x9EF1, 0x559D, 0x9EF2, 0x9EF2, 0x266A, 0x9EF3, 0x9EF3, 0x559F,
- 0x9EF4, 0x9EF4, 0x268A, 0x9EF5, 0x9EF6, 0x55A0, 0x9EF7, 0x9EF7, 0x2669,
- 0x9EF8, 0x9EF8, 0x55A2, 0x9EF9, 0x9EF9, 0x1A55, 0x9EFA, 0x9EFA, 0x55A3,
- 0x9EFB, 0x9EFC, 0x1A56, 0x9EFD, 0x9EFD, 0x2618, 0x9EFE, 0x9EFE, 0x1D76,
- 0x9EFF, 0x9EFF, 0x2619, 0x9F00, 0x9F08, 0x55A4, 0x9F09, 0x9F09, 0x261A,
- 0x9F0A, 0x9F0A, 0x55AD, 0x9F0B, 0x9F0B, 0x1D77, 0x9F0C, 0x9F0C, 0x55AE,
- 0x9F0D, 0x9F0D, 0x1D78, 0x9F0E, 0x9F0E, 0x05E5, 0x9F0F, 0x9F0F, 0x55AF,
- 0x9F10, 0x9F10, 0x1274, 0x9F11, 0x9F12, 0x55B0, 0x9F13, 0x9F13, 0x071D,
- 0x9F14, 0x9F14, 0x55B2, 0x9F15, 0x9F15, 0x2673, 0x9F16, 0x9F16, 0x55B3,
- 0x9F17, 0x9F17, 0x1271, 0x9F18, 0x9F18, 0x55B4, 0x9F19, 0x9F19, 0x13DF,
- 0x9F1A, 0x9F1F, 0x55B5, 0x9F20, 0x9F20, 0x0D8A, 0x9F21, 0x9F21, 0x55BB,
- 0x9F22, 0x9F22, 0x1E0F, 0x9F23, 0x9F2B, 0x55BC, 0x9F2C, 0x9F2C, 0x1E10,
- 0x9F2D, 0x9F2E, 0x55C5, 0x9F2F, 0x9F2F, 0x1E11, 0x9F30, 0x9F36, 0x55C7,
- 0x9F37, 0x9F37, 0x1E13, 0x9F38, 0x9F38, 0x55CE, 0x9F39, 0x9F39, 0x1E12,
- 0x9F3A, 0x9F3A, 0x55CF, 0x9F3B, 0x9F3B, 0x0430, 0x9F3C, 0x9F3C, 0x55D0,
- 0x9F3D, 0x9F3E, 0x1E14, 0x9F3F, 0x9F43, 0x55D1, 0x9F44, 0x9F44, 0x1E16,
- 0x9F45, 0x9F49, 0x55D6, 0x9F4A, 0x9F4A, 0x20C6, 0x9F4B, 0x9F4B, 0x226B,
- 0x9F4C, 0x9F4E, 0x55DB, 0x9F4F, 0x9F4F, 0x24D3, 0x9F50, 0x9F50, 0x0C0A,
- 0x9F51, 0x9F51, 0x19C2, 0x9F52, 0x9F52, 0x1E86, 0x9F53, 0x9F53, 0x55DE,
- 0x9F54, 0x9F54, 0x260F, 0x9F55, 0x9F58, 0x55DF, 0x9F59, 0x9F59, 0x2611,
- 0x9F5A, 0x9F5B, 0x55E3, 0x9F5C, 0x9F5C, 0x2613, 0x9F5D, 0x9F5E, 0x55E5,
- 0x9F5F, 0x9F5F, 0x2610, 0x9F60, 0x9F60, 0x2612, 0x9F61, 0x9F61, 0x2030,
- 0x9F62, 0x9F62, 0x55E7, 0x9F63, 0x9F63, 0x2671, 0x9F64, 0x9F65, 0x55E8,
- 0x9F66, 0x9F66, 0x2614, 0x9F67, 0x9F69, 0x55EA, 0x9F6A, 0x9F6A, 0x2616,
- 0x9F6B, 0x9F6B, 0x55ED, 0x9F6C, 0x9F6C, 0x2615, 0x9F6D, 0x9F71, 0x55EE,
- 0x9F72, 0x9F72, 0x20F2, 0x9F73, 0x9F76, 0x55F3, 0x9F77, 0x9F77, 0x2617,
- 0x9F78, 0x9F7E, 0x55F7, 0x9F7F, 0x9F7F, 0x0502, 0x9F80, 0x9F80, 0x1D6D,
- 0x9F81, 0x9F82, 0x55FE, 0x9F83, 0x9F83, 0x1D6E, 0x9F84, 0x9F84, 0x0A2D,
- 0x9F85, 0x9F8A, 0x1D6F, 0x9F8B, 0x9F8B, 0x0C7E, 0x9F8C, 0x9F8C, 0x1D75,
- 0x9F8D, 0x9F8D, 0x2037, 0x9F8E, 0x9F8F, 0x5600, 0x9F90, 0x9F90, 0x20B3,
- 0x9F91, 0x9F93, 0x5602, 0x9F94, 0x9F94, 0x1F22, 0x9F95, 0x9F95, 0x24ED,
- 0x9F96, 0x9F98, 0x5605, 0x9F99, 0x9F99, 0x0A43, 0x9F9A, 0x9F9A, 0x0701,
- 0x9F9B, 0x9F9B, 0x1A54, 0x9F9C, 0x9F9C, 0x1F34, 0x9F9D, 0x9F9E, 0x5608,
- 0x9F9F, 0x9F9F, 0x0743, 0x9FA0, 0x9FA0, 0x12F3, 0x9FA1, 0x9FA5, 0x560A,
- 0xE816, 0xE818, 0x5620, 0xE81E, 0xE81E, 0x5628, 0xE826, 0xE826, 0x5630,
- 0xE82B, 0xE82C, 0x5635, 0xE831, 0xE832, 0x563B, 0xE83B, 0xE83B, 0x5645,
- 0xE843, 0xE843, 0x564D, 0xE854, 0xE855, 0x565E, 0xE864, 0xE864, 0x566E,
- 0xF92C, 0xF92C, 0x560F, 0xFA0D, 0xFA0F, 0x5610, 0xFA11, 0xFA11, 0x5613,
- 0xFA13, 0xFA14, 0x5614, 0xFA18, 0xFA18, 0x5616, 0xFA1F, 0xFA21, 0x5617,
- 0xFA23, 0xFA24, 0x561A, 0xFA27, 0xFA29, 0x561C, 0xFE30, 0xFE30, 0x271D,
- 0xFE49, 0xFE52, 0x272B, 0xFE54, 0xFE57, 0x2735, 0xFE59, 0xFE66, 0x2739,
- 0xFE68, 0xFE6B, 0x2747, 0xFF01, 0xFF03, 0x0106, 0xFF04, 0xFF04, 0x00A6,
- 0xFF05, 0xFF5D, 0x010A, 0xFF5E, 0xFF5E, 0x006A, 0xFFE0, 0xFFE1, 0x00A8,
- 0xFFE2, 0xFFE2, 0x271E, 0xFFE3, 0xFFE3, 0x0163, 0xFFE4, 0xFFE4, 0x271F,
- 0xFFE5, 0xFFE5, 0x0109,
-};
+// 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
+
+extern const unsigned short g_FXCMAP_UniGB_UCS2_H_4[13825 * 3] = {
+ 0x0020, 0x007E, 0x0001, 0x00A4, 0x00A4, 0x00A7, 0x00A5, 0x00A5, 0x5752,
+ 0x00A7, 0x00A7, 0x00AB, 0x00A8, 0x00A8, 0x0066, 0x00B0, 0x00B0, 0x00A2,
+ 0x00B1, 0x00B1, 0x007F, 0x00D7, 0x00D7, 0x0080, 0x00E0, 0x00E0, 0x029F,
+ 0x00E1, 0x00E1, 0x029D, 0x00E8, 0x00E8, 0x02A3, 0x00E9, 0x00E9, 0x02A1,
+ 0x00EA, 0x00EA, 0x02B5, 0x00EC, 0x00EC, 0x02A7, 0x00ED, 0x00ED, 0x02A5,
+ 0x00F2, 0x00F2, 0x02AB, 0x00F3, 0x00F3, 0x02A9, 0x00F7, 0x00F7, 0x0081,
+ 0x00F9, 0x00F9, 0x02AF, 0x00FA, 0x00FA, 0x02AD, 0x00FC, 0x00FC, 0x02B4,
+ 0x0101, 0x0101, 0x029C, 0x0113, 0x0113, 0x02A0, 0x011B, 0x011B, 0x02A2,
+ 0x012B, 0x012B, 0x02A4, 0x014D, 0x014D, 0x02A8, 0x016B, 0x016B, 0x02AC,
+ 0x01CE, 0x01CE, 0x029E, 0x01D0, 0x01D0, 0x02A6, 0x01D2, 0x01D2, 0x02AA,
+ 0x01D4, 0x01D4, 0x02AE, 0x01D6, 0x01D6, 0x02B0, 0x01D8, 0x01D8, 0x02B1,
+ 0x01DA, 0x01DA, 0x02B2, 0x01DC, 0x01DC, 0x02B3, 0x01F9, 0x01F9, 0x02BA,
+ 0x02C7, 0x02C7, 0x0065, 0x02C9, 0x02C9, 0x0064, 0x02CA, 0x02CB, 0x26B3,
+ 0x02D9, 0x02D9, 0x26B5, 0x0391, 0x03A1, 0x020D, 0x03A3, 0x03A9, 0x021E,
+ 0x03B1, 0x03C1, 0x0225, 0x03C3, 0x03C9, 0x0236, 0x0401, 0x0401, 0x0260,
+ 0x0410, 0x0415, 0x025A, 0x0416, 0x0435, 0x0261, 0x0436, 0x044F, 0x0282,
+ 0x0451, 0x0451, 0x0281, 0x1E3F, 0x1E3F, 0x02B7, 0x2010, 0x2010, 0x2722,
+ 0x2013, 0x2013, 0x26B6, 0x2014, 0x2014, 0x0069, 0x2015, 0x2015, 0x26B7,
+ 0x2016, 0x2016, 0x006B, 0x2018, 0x2019, 0x006D, 0x201C, 0x201D, 0x006F,
+ 0x2025, 0x2025, 0x26B8, 0x2026, 0x2026, 0x006C, 0x2030, 0x2030, 0x00AA,
+ 0x2032, 0x2033, 0x00A3, 0x2035, 0x2035, 0x26B9, 0x203B, 0x203B, 0x00B8,
+ 0x20AC, 0x20AC, 0x5751, 0x2103, 0x2103, 0x00A5, 0x2105, 0x2105, 0x26BA,
+ 0x2109, 0x2109, 0x26BB, 0x2116, 0x2116, 0x00AC, 0x2121, 0x2121, 0x2720,
+ 0x2160, 0x216B, 0x00FA, 0x2170, 0x2179, 0x26A9, 0x2190, 0x2191, 0x00BA,
+ 0x2192, 0x2192, 0x00B9, 0x2193, 0x2193, 0x00BC, 0x2196, 0x2199, 0x26BC,
+ 0x2208, 0x2208, 0x0089, 0x220F, 0x220F, 0x0086, 0x2211, 0x2211, 0x0085,
+ 0x2215, 0x2215, 0x26C0, 0x221A, 0x221A, 0x008B, 0x221D, 0x221D, 0x0097,
+ 0x221E, 0x221E, 0x009D, 0x221F, 0x221F, 0x26C1, 0x2220, 0x2220, 0x008E,
+ 0x2223, 0x2223, 0x26C2, 0x2225, 0x2225, 0x008D, 0x2227, 0x2228, 0x0083,
+ 0x2229, 0x2229, 0x0088, 0x222A, 0x222A, 0x0087, 0x222B, 0x222B, 0x0091,
+ 0x222E, 0x222E, 0x0092, 0x2234, 0x2234, 0x009F, 0x2235, 0x2235, 0x009E,
+ 0x2236, 0x2236, 0x0082, 0x2237, 0x2237, 0x008A, 0x223D, 0x223D, 0x0096,
+ 0x2248, 0x2248, 0x0095, 0x224C, 0x224C, 0x0094, 0x2252, 0x2252, 0x26C3,
+ 0x2260, 0x2260, 0x0098, 0x2261, 0x2261, 0x0093, 0x2264, 0x2265, 0x009B,
+ 0x2266, 0x2267, 0x26C4, 0x226E, 0x226F, 0x0099, 0x2295, 0x2295, 0x2704,
+ 0x2299, 0x2299, 0x0090, 0x22A5, 0x22A5, 0x008C, 0x22BF, 0x22BF, 0x26C6,
+ 0x22EF, 0x22EF, 0x006C, 0x2312, 0x2312, 0x008F, 0x2460, 0x2469, 0x00E6,
+ 0x2474, 0x2487, 0x00D2, 0x2488, 0x249B, 0x00BE, 0x2500, 0x254B, 0x02E2,
+ 0x2550, 0x2573, 0x26C7, 0x2581, 0x258F, 0x26EB, 0x2593, 0x2595, 0x26FA,
+ 0x25A0, 0x25A0, 0x00B5, 0x25A1, 0x25A1, 0x00B4, 0x25B2, 0x25B2, 0x00B7,
+ 0x25B3, 0x25B3, 0x00B6, 0x25BC, 0x25BD, 0x26FD, 0x25C6, 0x25C6, 0x00B3,
+ 0x25C7, 0x25C7, 0x00B2, 0x25CB, 0x25CB, 0x00AF, 0x25CE, 0x25CE, 0x00B1,
+ 0x25CF, 0x25CF, 0x00B0, 0x25E2, 0x25E5, 0x26FF, 0x2605, 0x2605, 0x00AE,
+ 0x2606, 0x2606, 0x00AD, 0x2609, 0x2609, 0x2703, 0x2640, 0x2640, 0x00A1,
+ 0x2642, 0x2642, 0x00A0, 0x2E80, 0x2E80, 0x579C, 0x2E81, 0x2E81, 0x561F,
+ 0x2E82, 0x2E83, 0x579D, 0x2E84, 0x2E84, 0x5623, 0x2E85, 0x2E87, 0x579F,
+ 0x2E88, 0x2E88, 0x5626, 0x2E89, 0x2E8A, 0x57A2, 0x2E8B, 0x2E8B, 0x5627,
+ 0x2E8C, 0x2E8C, 0x562C, 0x2E8D, 0x2E96, 0x57A4, 0x2E97, 0x2E97, 0x562D,
+ 0x2E98, 0x2E99, 0x57AE, 0x2E9B, 0x2EA6, 0x57B0, 0x2EA7, 0x2EA7, 0x563A,
+ 0x2EA8, 0x2EA9, 0x57BC, 0x2EAA, 0x2EAA, 0x563D, 0x2EAB, 0x2EAD, 0x57BE,
+ 0x2EAE, 0x2EAE, 0x5640, 0x2EAF, 0x2EB2, 0x57C1, 0x2EB3, 0x2EB3, 0x5642,
+ 0x2EB4, 0x2EB5, 0x57C5, 0x2EB6, 0x2EB7, 0x5643, 0x2EB8, 0x2EBA, 0x57C7,
+ 0x2EBB, 0x2EBB, 0x5648, 0x2EBC, 0x2EC9, 0x57CA, 0x2ECA, 0x2ECA, 0x5652,
+ 0x2ECB, 0x2EF3, 0x57D8, 0x2F00, 0x2F00, 0x1042, 0x2F01, 0x2F01, 0x1263,
+ 0x2F02, 0x2F02, 0x1272, 0x2F03, 0x2F03, 0x1265, 0x2F04, 0x2F04, 0x1059,
+ 0x2F05, 0x2F05, 0x2793, 0x2F06, 0x2F06, 0x063D, 0x2F07, 0x2F07, 0x1303,
+ 0x2F08, 0x2F08, 0x0CA6, 0x2F09, 0x2F09, 0x0638, 0x2F0A, 0x2F0A, 0x0CC6,
+ 0x2F0B, 0x2F0B, 0x03D6, 0x2F0C, 0x2F0C, 0x129D, 0x2F0D, 0x2F0D, 0x1314,
+ 0x2F0E, 0x2F0E, 0x130F, 0x2F0F, 0x2F0F, 0x082B, 0x2F10, 0x2F10, 0x1399,
+ 0x2F11, 0x2F11, 0x0597, 0x2F12, 0x2F12, 0x09EF, 0x2F13, 0x2F13, 0x12FC,
+ 0x2F14, 0x2F14, 0x1266, 0x2F15, 0x2F15, 0x1284, 0x2F16, 0x2F16, 0x2A1A,
+ 0x2F17, 0x2F17, 0x0D45, 0x2F18, 0x2F18, 0x047E, 0x2F19, 0x2F19, 0x1352,
+ 0x2F1A, 0x2F1A, 0x04CC, 0x2F1B, 0x2F1B, 0x139C, 0x2F1C, 0x2F1C, 0x10BB,
+ 0x2F1D, 0x2F1D, 0x0967, 0x2F1E, 0x2F1E, 0x1593, 0x2F1F, 0x2F1F, 0x0E72,
+ 0x2F20, 0x2F20, 0x0D56, 0x2F21, 0x2F21, 0x161C, 0x2F22, 0x2F22, 0x2D2D,
+ 0x2F23, 0x2F23, 0x0F13, 0x2F24, 0x2F24, 0x0576, 0x2F25, 0x2F25, 0x0B6F,
+ 0x2F26, 0x2F26, 0x1230, 0x2F27, 0x2F27, 0x172E, 0x2F28, 0x2F28, 0x056A,
+ 0x2F29, 0x2F29, 0x0F6C, 0x2F2A, 0x2F2A, 0x14B6, 0x2F2B, 0x2F2B, 0x0D43,
+ 0x2F2C, 0x2F2C, 0x1774, 0x2F2D, 0x2F2D, 0x0CF6, 0x2F2E, 0x2F2E, 0x1815,
+ 0x2F2F, 0x2F2F, 0x06FD, 0x2F30, 0x2F30, 0x082D, 0x2F31, 0x2F31, 0x08BE,
+ 0x2F32, 0x2F32, 0x06C4, 0x2F33, 0x2F33, 0x1813, 0x2F34, 0x2F34, 0x073C,
+ 0x2F35, 0x2F35, 0x1398, 0x2F36, 0x2F36, 0x14AD, 0x2F37, 0x2F37, 0x14F6,
+ 0x2F38, 0x2F38, 0x0706, 0x2F39, 0x2F39, 0x1762, 0x2F3A, 0x2F3A, 0x15EE,
+ 0x2F3B, 0x2F3B, 0x15E0, 0x2F3C, 0x2F3C, 0x0F8F, 0x2F3D, 0x2F3D, 0x06E5,
+ 0x2F3E, 0x2F3E, 0x3292, 0x2F3F, 0x2F3F, 0x0D6D, 0x2F40, 0x2F40, 0x11A6,
+ 0x2F41, 0x2F41, 0x1909, 0x2F42, 0x2F42, 0x0ED3, 0x2F43, 0x2F43, 0x05F6,
+ 0x2F44, 0x2F44, 0x08C0, 0x2F45, 0x2F45, 0x065A, 0x2F46, 0x2F46, 0x0EED,
+ 0x2F47, 0x2F47, 0x0CB0, 0x2F48, 0x2F48, 0x10FE, 0x2F49, 0x2F49, 0x1105,
+ 0x2F4A, 0x2F4A, 0x0B21, 0x2F4B, 0x2F4B, 0x0C34, 0x2F4C, 0x2F4C, 0x11B8,
+ 0x2F4D, 0x2F4D, 0x0578, 0x2F4E, 0x2F4E, 0x19BD, 0x2F4F, 0x2F4F, 0x0EF2,
+ 0x2F50, 0x2F50, 0x0431, 0x2F51, 0x2F51, 0x0AB0, 0x2F52, 0x2F52, 0x0D66,
+ 0x2F53, 0x2F53, 0x0C17, 0x2F54, 0x2F54, 0x0DA3, 0x2F55, 0x2F55, 0x0805,
+ 0x2F56, 0x2F56, 0x1203, 0x2F57, 0x2F57, 0x06B3, 0x2F58, 0x2F58, 0x1269,
+ 0x2F59, 0x2F59, 0x169D, 0x2F5A, 0x2F5A, 0x0BCB, 0x2F5B, 0x2F5B, 0x0FE9,
+ 0x2F5C, 0x2F5C, 0x0B64, 0x2F5D, 0x2F5D, 0x0C89, 0x2F5E, 0x2F5E, 0x0FC9,
+ 0x2F5F, 0x2F5F, 0x10D6, 0x2F60, 0x2F60, 0x0728, 0x2F61, 0x2F61, 0x0E90,
+ 0x2F62, 0x2F62, 0x06C5, 0x2F63, 0x2F63, 0x0D33, 0x2F64, 0x2F64, 0x10A8,
+ 0x2F65, 0x2F65, 0x0E42, 0x2F66, 0x2F66, 0x1BC6, 0x2F67, 0x2F67, 0x1B60,
+ 0x2F68, 0x2F68, 0x3EBF, 0x2F69, 0x2F69, 0x03E2, 0x2F6A, 0x2F6A, 0x0BC3,
+ 0x2F6B, 0x2F6B, 0x0AF8, 0x2F6C, 0x2F6C, 0x0B22, 0x2F6D, 0x2F6D, 0x0AB1,
+ 0x2F6E, 0x2F6E, 0x0D4F, 0x2F6F, 0x2F6F, 0x0D46, 0x2F70, 0x2F70, 0x0D55,
+ 0x2F71, 0x2F71, 0x40CB, 0x2F72, 0x2F72, 0x0783, 0x2F73, 0x2F73, 0x0FD1,
+ 0x2F74, 0x2F74, 0x09EB, 0x2F75, 0x2F75, 0x11F0, 0x2F76, 0x2F76, 0x0ADC,
+ 0x2F77, 0x2F77, 0x1CE7, 0x2F78, 0x2F78, 0x1C5E, 0x2F79, 0x2F79, 0x0EA9,
+ 0x2F7A, 0x2F7A, 0x101B, 0x2F7B, 0x2F7B, 0x10D5, 0x2F7C, 0x2F7C, 0x09BA,
+ 0x2F7D, 0x2F7D, 0x0637, 0x2F7E, 0x2F7E, 0x1BCB, 0x2F7F, 0x2F7F, 0x0639,
+ 0x2F80, 0x2F80, 0x1A1E, 0x2F81, 0x2F81, 0x0CBD, 0x2F82, 0x2F82, 0x04E1,
+ 0x2F83, 0x2F83, 0x1231, 0x2F84, 0x2F84, 0x11C0, 0x2F85, 0x2F85, 0x08F9,
+ 0x2F86, 0x2F86, 0x0D19, 0x2F87, 0x2F87, 0x1618, 0x2F88, 0x2F88, 0x11DA,
+ 0x2F89, 0x2F89, 0x1CDC, 0x2F8A, 0x2F8A, 0x0CE4, 0x2F8B, 0x2F8B, 0x45A2,
+ 0x2F8C, 0x2F8C, 0x1BF0, 0x2F8D, 0x2F8D, 0x050B, 0x2F8E, 0x2F8E, 0x0FD3,
+ 0x2F8F, 0x2F8F, 0x0F9B, 0x2F90, 0x2F90, 0x1049, 0x2F91, 0x2F91, 0x49DC,
+ 0x2F92, 0x2F92, 0x1F96, 0x2F93, 0x2F93, 0x0898, 0x2F94, 0x2F94, 0x0FFD,
+ 0x2F95, 0x2F95, 0x0721, 0x2F96, 0x2F96, 0x05F8, 0x2F97, 0x2F97, 0x1D15,
+ 0x2F98, 0x2F98, 0x1D50, 0x2F99, 0x2F99, 0x1E3B, 0x2F9A, 0x2F9A, 0x0505,
+ 0x2F9B, 0x2F9B, 0x123C, 0x2F9C, 0x2F9C, 0x1240, 0x2F9D, 0x2F9D, 0x0D26,
+ 0x2F9E, 0x2F9E, 0x1E7B, 0x2F9F, 0x2F9F, 0x0F8C, 0x2FA0, 0x2FA0, 0x04E2,
+ 0x2FA1, 0x2FA1, 0x4D13, 0x2FA2, 0x2FA2, 0x105F, 0x2FA3, 0x2FA3, 0x10B4,
+ 0x2FA4, 0x2FA4, 0x4E18, 0x2FA5, 0x2FA5, 0x09DA, 0x2FA6, 0x2FA6, 0x08C1,
+ 0x2FA7, 0x2FA7, 0x1E75, 0x2FA8, 0x2FA8, 0x207D, 0x2FA9, 0x2FA9, 0x06B2,
+ 0x2FAA, 0x2FAA, 0x09EE, 0x2FAB, 0x2FAB, 0x1D79, 0x2FAC, 0x2FAC, 0x10CF,
+ 0x2FAD, 0x2FAD, 0x50EA, 0x2FAE, 0x2FAE, 0x0664, 0x2FAF, 0x2FAF, 0x0AEB,
+ 0x2FB0, 0x2FB0, 0x06EA, 0x2FB1, 0x2FB1, 0x218D, 0x2FB2, 0x2FB2, 0x08F1,
+ 0x2FB3, 0x2FB3, 0x107B, 0x2FB4, 0x2FB4, 0x2209, 0x2FB5, 0x2FB5, 0x1F00,
+ 0x2FB6, 0x2FB6, 0x1EF4, 0x2FB7, 0x2FB7, 0x0D4A, 0x2FB8, 0x2FB8, 0x0D6E,
+ 0x2FB9, 0x2FB9, 0x0F50, 0x2FBA, 0x2FBA, 0x206D, 0x2FBB, 0x2FBB, 0x0720,
+ 0x2FBC, 0x2FBC, 0x06DA, 0x2FBD, 0x2FBD, 0x1DEC, 0x2FBE, 0x2FBE, 0x1ED0,
+ 0x2FBF, 0x2FBF, 0x139B, 0x2FC0, 0x2FC0, 0x1260, 0x2FC1, 0x2FC1, 0x0746,
+ 0x2FC2, 0x2FC2, 0x2239, 0x2FC3, 0x2FC3, 0x209C, 0x2FC4, 0x2FC4, 0x2688,
+ 0x2FC5, 0x2FC5, 0x0A60, 0x2FC6, 0x2FC6, 0x2071, 0x2FC7, 0x2FC7, 0x0A90,
+ 0x2FC8, 0x2FC8, 0x5586, 0x2FC9, 0x2FC9, 0x0D89, 0x2FCA, 0x2FCA, 0x0791,
+ 0x2FCB, 0x2FCB, 0x1A55, 0x2FCC, 0x2FCC, 0x2618, 0x2FCD, 0x2FCD, 0x05E5,
+ 0x2FCE, 0x2FCE, 0x071D, 0x2FCF, 0x2FCF, 0x0D8A, 0x2FD0, 0x2FD0, 0x0430,
+ 0x2FD1, 0x2FD1, 0x20C6, 0x2FD2, 0x2FD2, 0x1E86, 0x2FD3, 0x2FD3, 0x2037,
+ 0x2FD4, 0x2FD4, 0x1F34, 0x2FD5, 0x2FD5, 0x12F3, 0x2FF0, 0x2FFB, 0x274C,
+ 0x3000, 0x3002, 0x0060, 0x3003, 0x3003, 0x0067, 0x3005, 0x3005, 0x0068,
+ 0x3006, 0x3006, 0x2728, 0x3007, 0x3007, 0x1E17, 0x3008, 0x300F, 0x0073,
+ 0x3010, 0x3011, 0x007D, 0x3012, 0x3012, 0x2705, 0x3013, 0x3013, 0x00BD,
+ 0x3014, 0x3015, 0x0071, 0x3016, 0x3017, 0x007B, 0x301D, 0x301E, 0x2706,
+ 0x3021, 0x3029, 0x2708, 0x3033, 0x3035, 0x577B, 0x3038, 0x303A, 0x577E,
+ 0x303E, 0x303E, 0x274B, 0x303F, 0x303F, 0x5755, 0x3041, 0x3093, 0x0164,
+ 0x3094, 0x3094, 0x5767, 0x309B, 0x309C, 0x2724, 0x309D, 0x309E, 0x2729,
+ 0x30A1, 0x30F6, 0x01B7, 0x30F7, 0x30FA, 0x5776, 0x30FB, 0x30FB, 0x0063,
+ 0x30FC, 0x30FC, 0x2723, 0x30FD, 0x30FE, 0x2726, 0x3105, 0x3129, 0x02BC,
+ 0x312A, 0x312C, 0x5781, 0x31A0, 0x31B7, 0x5784, 0x3220, 0x3229, 0x00F0,
+ 0x3231, 0x3231, 0x2721, 0x32A3, 0x32A3, 0x2711, 0x338E, 0x338F, 0x2712,
+ 0x339C, 0x339E, 0x2714, 0x33A1, 0x33A1, 0x2717, 0x33C4, 0x33C4, 0x2718,
+ 0x33CE, 0x33CE, 0x2719, 0x33D1, 0x33D2, 0x271A, 0x33D5, 0x33D5, 0x271C,
+ 0x3400, 0x3446, 0x5801, 0x3447, 0x3447, 0x5625, 0x3448, 0x3472, 0x5848,
+ 0x3473, 0x3473, 0x5624, 0x3474, 0x34FF, 0x5873, 0x3500, 0x359D, 0x58FF,
+ 0x359E, 0x359E, 0x5629, 0x359F, 0x35FF, 0x599D, 0x3600, 0x360D, 0x59FE,
+ 0x360E, 0x360E, 0x562B, 0x360F, 0x3619, 0x5A0C, 0x361A, 0x361A, 0x562A,
+ 0x361B, 0x36FF, 0x5A17, 0x3700, 0x37FF, 0x5AFC, 0x3800, 0x38FF, 0x5BFC,
+ 0x3900, 0x3917, 0x5CFC, 0x3918, 0x3918, 0x562F, 0x3919, 0x396D, 0x5D14,
+ 0x396E, 0x396E, 0x562E, 0x396F, 0x39CE, 0x5D69, 0x39CF, 0x39CF, 0x5631,
+ 0x39D0, 0x39D0, 0x5634, 0x39D1, 0x39DE, 0x5DC9, 0x39DF, 0x39DF, 0x5632,
+ 0x39E0, 0x39FF, 0x5DD7, 0x3A00, 0x3A72, 0x5DF7, 0x3A73, 0x3A73, 0x5633,
+ 0x3A74, 0x3AFF, 0x5E6A, 0x3B00, 0x3B4D, 0x5EF6, 0x3B4E, 0x3B4E, 0x5637,
+ 0x3B4F, 0x3BFF, 0x5F44, 0x3C00, 0x3C6D, 0x5FF5, 0x3C6E, 0x3C6E, 0x5638,
+ 0x3C6F, 0x3CDF, 0x6063, 0x3CE0, 0x3CE0, 0x5639, 0x3CE1, 0x3CFF, 0x60D4,
+ 0x3D00, 0x3DFF, 0x60F3, 0x3E00, 0x3EFF, 0x61F3, 0x3F00, 0x3FFF, 0x62F3,
+ 0x4000, 0x4055, 0x63F3, 0x4056, 0x4056, 0x563E, 0x4057, 0x40FF, 0x6449,
+ 0x4100, 0x415E, 0x64F2, 0x415F, 0x415F, 0x563F, 0x4160, 0x41FF, 0x6551,
+ 0x4200, 0x42FF, 0x65F1, 0x4300, 0x4336, 0x66F1, 0x4337, 0x4337, 0x5641,
+ 0x4338, 0x43AB, 0x6728, 0x43AC, 0x43AC, 0x5647, 0x43AD, 0x43B0, 0x679C,
+ 0x43B1, 0x43B1, 0x5646, 0x43B2, 0x43DC, 0x67A0, 0x43DD, 0x43DD, 0x5649,
+ 0x43DE, 0x43FF, 0x67CB, 0x4400, 0x44D5, 0x67ED, 0x44D6, 0x44D6, 0x564A,
+ 0x44D7, 0x44FF, 0x68C3, 0x4500, 0x45FF, 0x68EC, 0x4600, 0x464B, 0x69EC,
+ 0x464C, 0x464C, 0x564C, 0x464D, 0x4660, 0x6A38, 0x4661, 0x4661, 0x564B,
+ 0x4662, 0x46FF, 0x6A4C, 0x4700, 0x4722, 0x6AEA, 0x4723, 0x4723, 0x564E,
+ 0x4724, 0x4728, 0x6B0D, 0x4729, 0x4729, 0x564F, 0x472A, 0x477B, 0x6B12,
+ 0x477C, 0x477C, 0x5650, 0x477D, 0x478C, 0x6B64, 0x478D, 0x478D, 0x5651,
+ 0x478E, 0x47FF, 0x6B74, 0x4800, 0x48FF, 0x6BE6, 0x4900, 0x4946, 0x6CE6,
+ 0x4947, 0x4947, 0x5653, 0x4948, 0x4979, 0x6D2D, 0x497A, 0x497A, 0x5654,
+ 0x497B, 0x497C, 0x6D5F, 0x497D, 0x497D, 0x5655, 0x497E, 0x4981, 0x6D61,
+ 0x4982, 0x4983, 0x5656, 0x4984, 0x4984, 0x6D65, 0x4985, 0x4986, 0x5658,
+ 0x4987, 0x499A, 0x6D66, 0x499B, 0x499B, 0x565B, 0x499C, 0x499E, 0x6D7A,
+ 0x499F, 0x499F, 0x565A, 0x49A0, 0x49B5, 0x6D7D, 0x49B6, 0x49B6, 0x565D,
+ 0x49B7, 0x49B7, 0x565C, 0x49B8, 0x49FF, 0x6D93, 0x4A00, 0x4AFF, 0x6DDB,
+ 0x4B00, 0x4BFF, 0x6EDB, 0x4C00, 0x4C76, 0x6FDB, 0x4C77, 0x4C77, 0x5664,
+ 0x4C78, 0x4C9E, 0x7052, 0x4C9F, 0x4CA1, 0x5661, 0x4CA2, 0x4CA2, 0x5665,
+ 0x4CA3, 0x4CA3, 0x5660, 0x4CA4, 0x4CFF, 0x7079, 0x4D00, 0x4D12, 0x70D5,
+ 0x4D13, 0x4D19, 0x5666, 0x4D1A, 0x4DAD, 0x70E8, 0x4DAE, 0x4DAE, 0x566D,
+ 0x4DAF, 0x4DB5, 0x717C, 0x4E00, 0x4E00, 0x1042, 0x4E01, 0x4E01, 0x05E0,
+ 0x4E02, 0x4E02, 0x2758, 0x4E03, 0x4E03, 0x0BFE, 0x4E04, 0x4E06, 0x2759,
+ 0x4E07, 0x4E07, 0x0EA3, 0x4E08, 0x4E08, 0x116A, 0x4E09, 0x4E09, 0x0CD8,
+ 0x4E0A, 0x4E0A, 0x0D08, 0x4E0B, 0x4E0B, 0x0F2F, 0x4E0C, 0x4E0C, 0x1258,
+ 0x4E0D, 0x4E0D, 0x0482, 0x4E0E, 0x4E0E, 0x10D0, 0x4E0F, 0x4E0F, 0x275C,
+ 0x4E10, 0x4E10, 0x125A, 0x4E11, 0x4E11, 0x0518, 0x4E12, 0x4E12, 0x275D,
+ 0x4E13, 0x4E13, 0x1205, 0x4E14, 0x4E14, 0x0C4F, 0x4E15, 0x4E15, 0x125D,
+ 0x4E16, 0x4E16, 0x0D57, 0x4E17, 0x4E17, 0x275E, 0x4E18, 0x4E18, 0x0C6D,
+ 0x4E19, 0x4E19, 0x0464, 0x4E1A, 0x4E1A, 0x103C, 0x4E1B, 0x4E1B, 0x0557,
+ 0x4E1C, 0x4E1C, 0x05EA, 0x4E1D, 0x4E1D, 0x0DB4, 0x4E1E, 0x4E1E, 0x125F,
+ 0x4E1F, 0x4E21, 0x275F, 0x4E22, 0x4E22, 0x05E9, 0x4E23, 0x4E23, 0x2762,
+ 0x4E24, 0x4E24, 0x0A06, 0x4E25, 0x4E25, 0x0FF8, 0x4E26, 0x4E26, 0x2763,
+ 0x4E27, 0x4E27, 0x0CDE, 0x4E28, 0x4E28, 0x1263, 0x4E29, 0x4E29, 0x2764,
+ 0x4E2A, 0x4E2A, 0x06F1, 0x4E2B, 0x4E2B, 0x0FE7, 0x4E2C, 0x4E2C, 0x169C,
+ 0x4E2D, 0x4E2D, 0x11CF, 0x4E2E, 0x4E2F, 0x2765, 0x4E30, 0x4E30, 0x067E,
+ 0x4E31, 0x4E31, 0x2767, 0x4E32, 0x4E32, 0x0531, 0x4E33, 0x4E33, 0x2768,
+ 0x4E34, 0x4E34, 0x0A22, 0x4E35, 0x4E35, 0x2769, 0x4E36, 0x4E36, 0x1272,
+ 0x4E37, 0x4E37, 0x276A, 0x4E38, 0x4E38, 0x0E99, 0x4E39, 0x4E39, 0x0585,
+ 0x4E3A, 0x4E3A, 0x0EB9, 0x4E3B, 0x4E3B, 0x11F6, 0x4E3C, 0x4E3C, 0x276B,
+ 0x4E3D, 0x4E3D, 0x09E1, 0x4E3E, 0x4E3E, 0x0908, 0x4E3F, 0x4E3F, 0x1265,
+ 0x4E40, 0x4E42, 0x276C, 0x4E43, 0x4E43, 0x0B2E, 0x4E44, 0x4E44, 0x276F,
+ 0x4E45, 0x4E45, 0x08F2, 0x4E46, 0x4E46, 0x2770, 0x4E47, 0x4E47, 0x1267,
+ 0x4E48, 0x4E48, 0x0AB9, 0x4E49, 0x4E49, 0x106C, 0x4E4A, 0x4E4A, 0x2771,
+ 0x4E4B, 0x4E4B, 0x11AD, 0x4E4C, 0x4E4C, 0x0EE9, 0x4E4D, 0x4E4D, 0x1148,
+ 0x4E4E, 0x4E4E, 0x07AC, 0x4E4F, 0x4E4F, 0x0643, 0x4E50, 0x4E50, 0x09C1,
+ 0x4E51, 0x4E51, 0x2772, 0x4E52, 0x4E52, 0x0BD8, 0x4E53, 0x4E53, 0x0B93,
+ 0x4E54, 0x4E54, 0x0C44, 0x4E55, 0x4E55, 0x2773, 0x4E56, 0x4E56, 0x072D,
+ 0x4E57, 0x4E57, 0x2774, 0x4E58, 0x4E58, 0x04F0, 0x4E59, 0x4E59, 0x1059,
+ 0x4E5A, 0x4E5B, 0x2775, 0x4E5C, 0x4E5C, 0x1275, 0x4E5D, 0x4E5D, 0x08F4,
+ 0x4E5E, 0x4E5E, 0x0C11, 0x4E5F, 0x4E5F, 0x1039, 0x4E60, 0x4E60, 0x0F1D,
+ 0x4E61, 0x4E61, 0x0F54, 0x4E62, 0x4E65, 0x2777, 0x4E66, 0x4E66, 0x0D80,
+ 0x4E67, 0x4E68, 0x277B, 0x4E69, 0x4E69, 0x1276, 0x4E6A, 0x4E6F, 0x277D,
+ 0x4E70, 0x4E70, 0x0A99, 0x4E71, 0x4E71, 0x0A79, 0x4E72, 0x4E72, 0x2783,
+ 0x4E73, 0x4E73, 0x0CC4, 0x4E74, 0x4E7D, 0x2784, 0x4E7E, 0x4E7E, 0x0C29,
+ 0x4E7F, 0x4E81, 0x278E, 0x4E82, 0x4E82, 0x2059, 0x4E83, 0x4E85, 0x2791,
+ 0x4E86, 0x4E86, 0x0A14, 0x4E87, 0x4E87, 0x2794, 0x4E88, 0x4E88, 0x10CD,
+ 0x4E89, 0x4E89, 0x119A, 0x4E8A, 0x4E8A, 0x2795, 0x4E8B, 0x4E8B, 0x0D59,
+ 0x4E8C, 0x4E8C, 0x063D, 0x4E8D, 0x4E8D, 0x1257, 0x4E8E, 0x4E8E, 0x10BF,
+ 0x4E8F, 0x4E8F, 0x0984, 0x4E90, 0x4E90, 0x2796, 0x4E91, 0x4E91, 0x1109,
+ 0x4E92, 0x4E92, 0x07BA, 0x4E93, 0x4E93, 0x1277, 0x4E94, 0x4E94, 0x0EF4,
+ 0x4E95, 0x4E95, 0x08DD, 0x4E96, 0x4E97, 0x2797, 0x4E98, 0x4E98, 0x125E,
+ 0x4E99, 0x4E99, 0x2799, 0x4E9A, 0x4E9A, 0x0FF0, 0x4E9B, 0x4E9B, 0x0F74,
+ 0x4E9C, 0x4E9D, 0x279A, 0x4E9E, 0x4E9E, 0x21F1, 0x4E9F, 0x4E9F, 0x1273,
+ 0x4EA0, 0x4EA0, 0x1303, 0x4EA1, 0x4EA1, 0x0EA7, 0x4EA2, 0x4EA2, 0x0947,
+ 0x4EA3, 0x4EA3, 0x279C, 0x4EA4, 0x4EA4, 0x088C, 0x4EA5, 0x4EA5, 0x075C,
+ 0x4EA6, 0x4EA6, 0x1067, 0x4EA7, 0x4EA7, 0x04C1, 0x4EA8, 0x4EA8, 0x0797,
+ 0x4EA9, 0x4EA9, 0x0B19, 0x4EAA, 0x4EAA, 0x279D, 0x4EAB, 0x4EAB, 0x0F5A,
+ 0x4EAC, 0x4EAC, 0x08D8, 0x4EAD, 0x4EAD, 0x0E55, 0x4EAE, 0x4EAE, 0x0A0A,
+ 0x4EAF, 0x4EB1, 0x279E, 0x4EB2, 0x4EB2, 0x0C54, 0x4EB3, 0x4EB3, 0x1305,
+ 0x4EB4, 0x4EB4, 0x27A1, 0x4EB5, 0x4EB5, 0x1308, 0x4EB6, 0x4EB9, 0x27A2,
+ 0x4EBA, 0x4EBA, 0x0CA6, 0x4EBB, 0x4EBB, 0x129F, 0x4EBC, 0x4EBE, 0x27A6,
+ 0x4EBF, 0x4EBF, 0x1061, 0x4EC0, 0x4EC0, 0x0D49, 0x4EC1, 0x4EC1, 0x0CA5,
+ 0x4EC2, 0x4EC2, 0x12A2, 0x4EC3, 0x4EC3, 0x12A0, 0x4EC4, 0x4EC4, 0x127C,
+ 0x4EC5, 0x4EC5, 0x08C7, 0x4EC6, 0x4EC6, 0x0BEC, 0x4EC7, 0x4EC7, 0x0515,
+ 0x4EC8, 0x4EC8, 0x27A9, 0x4EC9, 0x4EC9, 0x12A1, 0x4ECA, 0x4ECA, 0x08C2,
+ 0x4ECB, 0x4ECB, 0x08BA, 0x4ECC, 0x4ECC, 0x27AA, 0x4ECD, 0x4ECD, 0x0CAF,
+ 0x4ECE, 0x4ECE, 0x0556, 0x4ECF, 0x4ED0, 0x27AB, 0x4ED1, 0x4ED1, 0x0A7F,
+ 0x4ED2, 0x4ED2, 0x27AD, 0x4ED3, 0x4ED3, 0x049D, 0x4ED4, 0x4ED4, 0x122D,
+ 0x4ED5, 0x4ED5, 0x0D62, 0x4ED6, 0x4ED6, 0x0DF0, 0x4ED7, 0x4ED7, 0x116D,
+ 0x4ED8, 0x4ED8, 0x06B1, 0x4ED9, 0x4ED9, 0x0F36, 0x4EDA, 0x4EDC, 0x27AE,
+ 0x4EDD, 0x4EDD, 0x12EE, 0x4EDE, 0x4EDE, 0x12A6, 0x4EDF, 0x4EDF, 0x0C27,
+ 0x4EE0, 0x4EE0, 0x27B1, 0x4EE1, 0x4EE1, 0x12A4, 0x4EE2, 0x4EE2, 0x27B2,
+ 0x4EE3, 0x4EE3, 0x057D, 0x4EE4, 0x4EE4, 0x0A37, 0x4EE5, 0x4EE5, 0x105B,
+ 0x4EE6, 0x4EE7, 0x27B3, 0x4EE8, 0x4EE8, 0x12A3, 0x4EE9, 0x4EE9, 0x27B5,
+ 0x4EEA, 0x4EEA, 0x104E, 0x4EEB, 0x4EEB, 0x12A5, 0x4EEC, 0x4EEC, 0x0ACC,
+ 0x4EED, 0x4EEF, 0x27B6, 0x4EF0, 0x4EF0, 0x101F, 0x4EF1, 0x4EF1, 0x27B9,
+ 0x4EF2, 0x4EF2, 0x11D8, 0x4EF3, 0x4EF3, 0x12A8, 0x4EF4, 0x4EF4, 0x27BA,
+ 0x4EF5, 0x4EF5, 0x12AB, 0x4EF6, 0x4EF6, 0x0871, 0x4EF7, 0x4EF7, 0x084E,
+ 0x4EF8, 0x4EFA, 0x27BB, 0x4EFB, 0x4EFB, 0x0CA9, 0x4EFC, 0x4EFC, 0x27BE,
+ 0x4EFD, 0x4EFD, 0x067A, 0x4EFE, 0x4EFE, 0x27BF, 0x4EFF, 0x4EFF, 0x065F,
+ 0x4F00, 0x4F00, 0x27C0, 0x4F01, 0x4F01, 0x0C12, 0x4F02, 0x4F08, 0x27C1,
+ 0x4F09, 0x4F09, 0x12AE, 0x4F0A, 0x4F0A, 0x1048, 0x4F0B, 0x4F0C, 0x27C8,
+ 0x4F0D, 0x4F0D, 0x0EF8, 0x4F0E, 0x4F0E, 0x0832, 0x4F0F, 0x4F0F, 0x0699,
+ 0x4F10, 0x4F10, 0x0642, 0x4F11, 0x4F11, 0x0FA8, 0x4F12, 0x4F16, 0x27CA,
+ 0x4F17, 0x4F17, 0x11D9, 0x4F18, 0x4F18, 0x10AA, 0x4F19, 0x4F19, 0x0804,
+ 0x4F1A, 0x4F1A, 0x07F6, 0x4F1B, 0x4F1B, 0x12A7, 0x4F1C, 0x4F1D, 0x27CF,
+ 0x4F1E, 0x4F1E, 0x0CDA, 0x4F1F, 0x4F1F, 0x0EBF, 0x4F20, 0x4F20, 0x052E,
+ 0x4F21, 0x4F21, 0x27D1, 0x4F22, 0x4F22, 0x12A9, 0x4F23, 0x4F23, 0x27D2,
+ 0x4F24, 0x4F24, 0x0D04, 0x4F25, 0x4F25, 0x12AC, 0x4F26, 0x4F26, 0x0A7E,
+ 0x4F27, 0x4F27, 0x12AD, 0x4F28, 0x4F29, 0x27D3, 0x4F2A, 0x4F2A, 0x0EC0,
+ 0x4F2B, 0x4F2B, 0x12AF, 0x4F2C, 0x4F2E, 0x27D5, 0x4F2F, 0x4F2F, 0x0475,
+ 0x4F30, 0x4F30, 0x0719, 0x4F31, 0x4F31, 0x27D8, 0x4F32, 0x4F32, 0x12B7,
+ 0x4F33, 0x4F33, 0x27D9, 0x4F34, 0x4F34, 0x03F4, 0x4F35, 0x4F35, 0x27DA,
+ 0x4F36, 0x4F36, 0x0A2F, 0x4F37, 0x4F37, 0x27DB, 0x4F38, 0x4F38, 0x0D25,
+ 0x4F39, 0x4F39, 0x27DC, 0x4F3A, 0x4F3A, 0x0DBA, 0x4F3B, 0x4F3B, 0x27DD,
+ 0x4F3C, 0x4F3C, 0x0DBB, 0x4F3D, 0x4F3D, 0x12B8, 0x4F3E, 0x4F42, 0x27DE,
+ 0x4F43, 0x4F43, 0x05C9, 0x4F44, 0x4F45, 0x27E3, 0x4F46, 0x4F46, 0x058C,
+ 0x4F47, 0x4F4C, 0x27E5, 0x4F4D, 0x4F4D, 0x0ECA, 0x4F4E, 0x4F4E, 0x05AE,
+ 0x4F4F, 0x4F4F, 0x11FE, 0x4F50, 0x4F50, 0x1251, 0x4F51, 0x4F51, 0x10B8,
+ 0x4F52, 0x4F52, 0x27EB, 0x4F53, 0x4F53, 0x0E38, 0x4F54, 0x4F54, 0x27EC,
+ 0x4F55, 0x4F55, 0x0785, 0x4F56, 0x4F56, 0x27ED, 0x4F57, 0x4F57, 0x12B6,
+ 0x4F58, 0x4F58, 0x12F0, 0x4F59, 0x4F59, 0x10C5, 0x4F5A, 0x4F5A, 0x12B3,
+ 0x4F5B, 0x4F5B, 0x068D, 0x4F5C, 0x4F5C, 0x1254, 0x4F5D, 0x4F5D, 0x12B4,
+ 0x4F5E, 0x4F5E, 0x12B0, 0x4F5F, 0x4F5F, 0x12B5, 0x4F60, 0x4F60, 0x0B46,
+ 0x4F61, 0x4F62, 0x27EE, 0x4F63, 0x4F63, 0x109B, 0x4F64, 0x4F64, 0x12AA,
+ 0x4F65, 0x4F65, 0x12F1, 0x4F66, 0x4F66, 0x27F0, 0x4F67, 0x4F67, 0x12B1,
+ 0x4F68, 0x4F68, 0x27F1, 0x4F69, 0x4F69, 0x0BA6, 0x4F6A, 0x4F6B, 0x27F2,
+ 0x4F6C, 0x4F6C, 0x09BB, 0x4F6D, 0x4F6E, 0x27F4, 0x4F6F, 0x4F6F, 0x1019,
+ 0x4F70, 0x4F70, 0x03E6, 0x4F71, 0x4F72, 0x27F6, 0x4F73, 0x4F73, 0x0844,
+ 0x4F74, 0x4F74, 0x12BA, 0x4F75, 0x4F75, 0x27F8, 0x4F76, 0x4F76, 0x12B9,
+ 0x4F77, 0x4F7A, 0x27F9, 0x4F7B, 0x4F7B, 0x12C0, 0x4F7C, 0x4F7C, 0x12C2,
+ 0x4F7D, 0x4F7D, 0x27FD, 0x4F7E, 0x4F7E, 0x12BF, 0x4F7F, 0x4F7F, 0x0D50,
+ 0x4F80, 0x4F82, 0x27FE, 0x4F83, 0x4F83, 0x12BD, 0x4F84, 0x4F84, 0x11B5,
+ 0x4F85, 0x4F85, 0x2801, 0x4F86, 0x4F86, 0x1FF2, 0x4F87, 0x4F87, 0x2802,
+ 0x4F88, 0x4F88, 0x0503, 0x4F89, 0x4F89, 0x12BC, 0x4F8A, 0x4F8A, 0x2803,
+ 0x4F8B, 0x4F8B, 0x09E8, 0x4F8C, 0x4F8C, 0x2804, 0x4F8D, 0x4F8D, 0x0D63,
+ 0x4F8E, 0x4F8E, 0x2805, 0x4F8F, 0x4F8F, 0x12BE, 0x4F90, 0x4F90, 0x2806,
+ 0x4F91, 0x4F91, 0x12BB, 0x4F92, 0x4F93, 0x2807, 0x4F94, 0x4F94, 0x12C4,
+ 0x4F95, 0x4F95, 0x2809, 0x4F96, 0x4F96, 0x205D, 0x4F97, 0x4F97, 0x05F0,
+ 0x4F98, 0x4F9A, 0x280A, 0x4F9B, 0x4F9B, 0x0702, 0x4F9C, 0x4F9C, 0x280D,
+ 0x4F9D, 0x4F9D, 0x1047, 0x4F9E, 0x4F9F, 0x280E, 0x4FA0, 0x4FA0, 0x0F2D,
+ 0x4FA1, 0x4FA2, 0x2810, 0x4FA3, 0x4FA3, 0x0A69, 0x4FA4, 0x4FA4, 0x2812,
+ 0x4FA5, 0x4FA5, 0x0895, 0x4FA6, 0x4FA6, 0x118D, 0x4FA7, 0x4FA7, 0x04A7,
+ 0x4FA8, 0x4FA8, 0x0C45, 0x4FA9, 0x4FA9, 0x0978, 0x4FAA, 0x4FAA, 0x12C1,
+ 0x4FAB, 0x4FAB, 0x2813, 0x4FAC, 0x4FAC, 0x12C3, 0x4FAD, 0x4FAD, 0x2814,
+ 0x4FAE, 0x4FAE, 0x0EF9, 0x4FAF, 0x4FAF, 0x07A5, 0x4FB0, 0x4FB4, 0x2815,
+ 0x4FB5, 0x4FB5, 0x0C53, 0x4FB6, 0x4FBE, 0x281A, 0x4FBF, 0x4FBF, 0x044C,
+ 0x4FC0, 0x4FC1, 0x2823, 0x4FC2, 0x4FC2, 0x269C, 0x4FC3, 0x4FC3, 0x055C,
+ 0x4FC4, 0x4FC4, 0x062C, 0x4FC5, 0x4FC5, 0x12C8, 0x4FC6, 0x4FC9, 0x2825,
+ 0x4FCA, 0x4FCA, 0x092E, 0x4FCB, 0x4FCD, 0x2829, 0x4FCE, 0x4FCE, 0x12F2,
+ 0x4FCF, 0x4FCF, 0x0C4B, 0x4FD0, 0x4FD0, 0x09E9, 0x4FD1, 0x4FD1, 0x12CC,
+ 0x4FD2, 0x4FD6, 0x282C, 0x4FD7, 0x4FD7, 0x0DCC, 0x4FD8, 0x4FD8, 0x069A,
+ 0x4FD9, 0x4FD9, 0x2831, 0x4FDA, 0x4FDA, 0x12C9, 0x4FDB, 0x4FDB, 0x2832,
+ 0x4FDC, 0x4FDC, 0x12CB, 0x4FDD, 0x4FDD, 0x040C, 0x4FDE, 0x4FDE, 0x10C6,
+ 0x4FDF, 0x4FDF, 0x12CD, 0x4FE0, 0x4FE0, 0x21B5, 0x4FE1, 0x4FE1, 0x0F90,
+ 0x4FE2, 0x4FE2, 0x2833, 0x4FE3, 0x4FE3, 0x12CA, 0x4FE4, 0x4FE5, 0x2834,
+ 0x4FE6, 0x4FE6, 0x12C5, 0x4FE7, 0x4FE7, 0x2836, 0x4FE8, 0x4FE8, 0x12C6,
+ 0x4FE9, 0x4FE9, 0x09F2, 0x4FEA, 0x4FEA, 0x12C7, 0x4FEB, 0x4FEC, 0x2837,
+ 0x4FED, 0x4FED, 0x0866, 0x4FEE, 0x4FEE, 0x0FA9, 0x4FEF, 0x4FEF, 0x06A4,
+ 0x4FF0, 0x4FF0, 0x2839, 0x4FF1, 0x4FF1, 0x0912, 0x4FF2, 0x4FF2, 0x283A,
+ 0x4FF3, 0x4FF3, 0x12D1, 0x4FF4, 0x4FF7, 0x283B, 0x4FF8, 0x4FF8, 0x12CE,
+ 0x4FF9, 0x4FF9, 0x283F, 0x4FFA, 0x4FFA, 0x03BE, 0x4FFB, 0x4FFD, 0x2840,
+ 0x4FFE, 0x4FFE, 0x12D6, 0x4FFF, 0x4FFF, 0x2843, 0x5000, 0x5000, 0x22CC,
+ 0x5001, 0x5005, 0x2844, 0x5006, 0x5006, 0x2016, 0x5007, 0x5008, 0x2849,
+ 0x5009, 0x5009, 0x1E62, 0x500A, 0x500A, 0x284B, 0x500B, 0x500B, 0x1F20,
+ 0x500C, 0x500C, 0x12D8, 0x500D, 0x500D, 0x041F, 0x500E, 0x500E, 0x284C,
+ 0x500F, 0x500F, 0x12D3, 0x5010, 0x5010, 0x284D, 0x5011, 0x5011, 0x207F,
+ 0x5012, 0x5012, 0x059A, 0x5013, 0x5013, 0x284E, 0x5014, 0x5014, 0x0922,
+ 0x5015, 0x5017, 0x284F, 0x5018, 0x5018, 0x0E1B, 0x5019, 0x5019, 0x07A9,
+ 0x501A, 0x501A, 0x1057, 0x501B, 0x501B, 0x2852, 0x501C, 0x501C, 0x12D7,
+ 0x501D, 0x501E, 0x2853, 0x501F, 0x501F, 0x08B9, 0x5020, 0x5020, 0x2855,
+ 0x5021, 0x5021, 0x04D0, 0x5022, 0x5024, 0x2856, 0x5025, 0x5025, 0x12D9,
+ 0x5026, 0x5026, 0x091A, 0x5027, 0x5027, 0x2859, 0x5028, 0x5028, 0x12DA,
+ 0x5029, 0x5029, 0x12CF, 0x502A, 0x502A, 0x0B42, 0x502B, 0x502B, 0x205C,
+ 0x502C, 0x502C, 0x12D2, 0x502D, 0x502D, 0x12D5, 0x502E, 0x502E, 0x12D4,
+ 0x502F, 0x5039, 0x285A, 0x503A, 0x503A, 0x114F, 0x503B, 0x503B, 0x2865,
+ 0x503C, 0x503C, 0x11B4, 0x503D, 0x503D, 0x2866, 0x503E, 0x503E, 0x0C60,
+ 0x503F, 0x5042, 0x2867, 0x5043, 0x5043, 0x12DC, 0x5044, 0x5046, 0x286B,
+ 0x5047, 0x5047, 0x084C, 0x5048, 0x5048, 0x12DE, 0x5049, 0x5049, 0x2194,
+ 0x504A, 0x504B, 0x286E, 0x504C, 0x504C, 0x12D0, 0x504D, 0x504D, 0x2870,
+ 0x504E, 0x504E, 0x12DF, 0x504F, 0x504F, 0x0BCA, 0x5050, 0x5054, 0x2871,
+ 0x5055, 0x5055, 0x12DD, 0x5056, 0x5059, 0x2876, 0x505A, 0x505A, 0x1253,
+ 0x505B, 0x505B, 0x287A, 0x505C, 0x505C, 0x0E54, 0x505D, 0x5064, 0x287B,
+ 0x5065, 0x5065, 0x0872, 0x5066, 0x506B, 0x2883, 0x506C, 0x506C, 0x12E0,
+ 0x506D, 0x5073, 0x2889, 0x5074, 0x5074, 0x1E65, 0x5075, 0x5075, 0x2281,
+ 0x5076, 0x5076, 0x0B7D, 0x5077, 0x5077, 0x0E66, 0x5078, 0x507A, 0x2890,
+ 0x507B, 0x507B, 0x12E1, 0x507C, 0x507D, 0x2893, 0x507E, 0x507E, 0x12DB,
+ 0x507F, 0x507F, 0x04CA, 0x5080, 0x5080, 0x098B, 0x5081, 0x5084, 0x2895,
+ 0x5085, 0x5085, 0x06B0, 0x5086, 0x5087, 0x2899, 0x5088, 0x5088, 0x09E7,
+ 0x5089, 0x508C, 0x289B, 0x508D, 0x508D, 0x0403, 0x508E, 0x5095, 0x289F,
+ 0x5096, 0x5096, 0x22CD, 0x5097, 0x5097, 0x28A7, 0x5098, 0x5098, 0x210A,
+ 0x5099, 0x5099, 0x1E3E, 0x509A, 0x50A1, 0x28A8, 0x50A2, 0x50A2, 0x267F,
+ 0x50A3, 0x50A3, 0x0579, 0x50A4, 0x50A4, 0x28B0, 0x50A5, 0x50A5, 0x12E2,
+ 0x50A6, 0x50A6, 0x28B1, 0x50A7, 0x50A7, 0x12E3, 0x50A8, 0x50A8, 0x0525,
+ 0x50A9, 0x50A9, 0x12E4, 0x50AA, 0x50AB, 0x28B2, 0x50AC, 0x50AC, 0x0562,
+ 0x50AD, 0x50AD, 0x222E, 0x50AE, 0x50B1, 0x28B4, 0x50B2, 0x50B2, 0x03CC,
+ 0x50B3, 0x50B3, 0x1E96, 0x50B4, 0x50B4, 0x22CB, 0x50B5, 0x50B5, 0x226C,
+ 0x50B6, 0x50B6, 0x28B8, 0x50B7, 0x50B7, 0x2117, 0x50B8, 0x50B9, 0x28B9,
+ 0x50BA, 0x50BA, 0x12E5, 0x50BB, 0x50BB, 0x0CEE, 0x50BC, 0x50BD, 0x28BB,
+ 0x50BE, 0x50BE, 0x20E8, 0x50BF, 0x50C1, 0x28BD, 0x50C2, 0x50C2, 0x22D4,
+ 0x50C3, 0x50C4, 0x28C0, 0x50C5, 0x50C5, 0x1FB9, 0x50C6, 0x50C8, 0x28C2,
+ 0x50C9, 0x50C9, 0x22D8, 0x50CA, 0x50CE, 0x28C5, 0x50CF, 0x50CF, 0x0F5E,
+ 0x50D0, 0x50D0, 0x28CA, 0x50D1, 0x50D1, 0x20DF, 0x50D2, 0x50D4, 0x28CB,
+ 0x50D5, 0x50D5, 0x20C2, 0x50D6, 0x50D6, 0x12E6, 0x50D7, 0x50D9, 0x28CE,
+ 0x50DA, 0x50DA, 0x0A0E, 0x50DB, 0x50DD, 0x28D1, 0x50DE, 0x50DE, 0x2195,
+ 0x50DF, 0x50E4, 0x28D4, 0x50E5, 0x50E5, 0x1FAC, 0x50E6, 0x50E6, 0x12EA,
+ 0x50E7, 0x50E7, 0x0CE7, 0x50E8, 0x50E8, 0x22D3, 0x50E9, 0x50EB, 0x28DA,
+ 0x50EC, 0x50EC, 0x12E9, 0x50ED, 0x50ED, 0x12E8, 0x50EE, 0x50EE, 0x12EB,
+ 0x50EF, 0x50F2, 0x28DD, 0x50F3, 0x50F3, 0x0DD0, 0x50F4, 0x50F4, 0x28E1,
+ 0x50F5, 0x50F5, 0x087A, 0x50F6, 0x50F8, 0x28E2, 0x50F9, 0x50F9, 0x1F81,
+ 0x50FA, 0x50FA, 0x28E5, 0x50FB, 0x50FB, 0x0BC6, 0x50FC, 0x50FF, 0x28E6,
+ 0x5100, 0x5100, 0x2210, 0x5101, 0x5101, 0x28EA, 0x5102, 0x5102, 0x22CF,
+ 0x5103, 0x5103, 0x28EB, 0x5104, 0x5104, 0x2213, 0x5105, 0x5105, 0x28EC,
+ 0x5106, 0x5106, 0x12E7, 0x5107, 0x5107, 0x12EC, 0x5108, 0x5108, 0x1FE4,
+ 0x5109, 0x5109, 0x1F90, 0x510A, 0x510A, 0x28ED, 0x510B, 0x510B, 0x12ED,
+ 0x510C, 0x510F, 0x28EE, 0x5110, 0x5110, 0x22D6, 0x5111, 0x5111, 0x28F2,
+ 0x5112, 0x5112, 0x0CC0, 0x5113, 0x5113, 0x28F3, 0x5114, 0x5114, 0x22D0,
+ 0x5115, 0x5115, 0x22CE, 0x5116, 0x5117, 0x28F4, 0x5118, 0x5118, 0x2681,
+ 0x5119, 0x511E, 0x28F6, 0x511F, 0x511F, 0x1E76, 0x5120, 0x5120, 0x28FC,
+ 0x5121, 0x5121, 0x09C7, 0x5122, 0x5129, 0x28FD, 0x512A, 0x512A, 0x2231,
+ 0x512B, 0x5131, 0x2905, 0x5132, 0x5132, 0x1E93, 0x5133, 0x5136, 0x290C,
+ 0x5137, 0x5137, 0x22D2, 0x5138, 0x5139, 0x2910, 0x513A, 0x513A, 0x22D7,
+ 0x513B, 0x513B, 0x22D5, 0x513C, 0x513C, 0x22D1, 0x513D, 0x513E, 0x2912,
+ 0x513F, 0x513F, 0x0638, 0x5140, 0x5140, 0x1259, 0x5141, 0x5141, 0x110D,
+ 0x5142, 0x5142, 0x2914, 0x5143, 0x5143, 0x10ED, 0x5144, 0x5144, 0x0FA1,
+ 0x5145, 0x5145, 0x0509, 0x5146, 0x5146, 0x1178, 0x5147, 0x5147, 0x2915,
+ 0x5148, 0x5148, 0x0F35, 0x5149, 0x5149, 0x073B, 0x514A, 0x514A, 0x2916,
+ 0x514B, 0x514B, 0x0958, 0x514C, 0x514C, 0x2917, 0x514D, 0x514D, 0x0AE7,
+ 0x514E, 0x5150, 0x2918, 0x5151, 0x5151, 0x0611, 0x5152, 0x5152, 0x1EE5,
+ 0x5153, 0x5153, 0x291B, 0x5154, 0x5154, 0x0E74, 0x5155, 0x5155, 0x1302,
+ 0x5156, 0x5156, 0x1304, 0x5157, 0x5159, 0x291C, 0x515A, 0x515A, 0x0594,
+ 0x515B, 0x515B, 0x291F, 0x515C, 0x515C, 0x05F4, 0x515D, 0x5161, 0x2920,
+ 0x5162, 0x5162, 0x08D3, 0x5163, 0x5164, 0x2925, 0x5165, 0x5165, 0x0CC6,
+ 0x5166, 0x5167, 0x2927, 0x5168, 0x5168, 0x0C86, 0x5169, 0x5169, 0x2025,
+ 0x516A, 0x516A, 0x2929, 0x516B, 0x516B, 0x03D6, 0x516C, 0x516C, 0x0704,
+ 0x516D, 0x516D, 0x0A42, 0x516E, 0x516E, 0x12F6, 0x516F, 0x516F, 0x292A,
+ 0x5170, 0x5170, 0x09A7, 0x5171, 0x5171, 0x070B, 0x5172, 0x5172, 0x292B,
+ 0x5173, 0x5173, 0x0731, 0x5174, 0x5174, 0x0F96, 0x5175, 0x5175, 0x0461,
+ 0x5176, 0x5176, 0x0C03, 0x5177, 0x5177, 0x090E, 0x5178, 0x5178, 0x05C5,
+ 0x5179, 0x5179, 0x1225, 0x517A, 0x517A, 0x292C, 0x517B, 0x517B, 0x1021,
+ 0x517C, 0x517C, 0x0859, 0x517D, 0x517D, 0x0D75, 0x517E, 0x517F, 0x292D,
+ 0x5180, 0x5180, 0x0830, 0x5181, 0x5181, 0x12FA, 0x5182, 0x5182, 0x129D,
+ 0x5183, 0x5184, 0x292F, 0x5185, 0x5185, 0x0B3D, 0x5186, 0x5187, 0x2931,
+ 0x5188, 0x5188, 0x06CF, 0x5189, 0x5189, 0x0C98, 0x518A, 0x518B, 0x2933,
+ 0x518C, 0x518C, 0x04A8, 0x518D, 0x518D, 0x111C, 0x518E, 0x5191, 0x2935,
+ 0x5192, 0x5192, 0x0AB5, 0x5193, 0x5194, 0x2939, 0x5195, 0x5195, 0x0AE6,
+ 0x5196, 0x5196, 0x1314, 0x5197, 0x5197, 0x0CBA, 0x5198, 0x5198, 0x293B,
+ 0x5199, 0x5199, 0x0F7F, 0x519A, 0x519A, 0x293C, 0x519B, 0x519B, 0x092B,
+ 0x519C, 0x519C, 0x0B6A, 0x519D, 0x519F, 0x293D, 0x51A0, 0x51A0, 0x0733,
+ 0x51A1, 0x51A1, 0x2940, 0x51A2, 0x51A2, 0x1315, 0x51A3, 0x51A3, 0x2941,
+ 0x51A4, 0x51A4, 0x10EC, 0x51A5, 0x51A5, 0x1316, 0x51A6, 0x51AA, 0x2942,
+ 0x51AB, 0x51AB, 0x130F, 0x51AC, 0x51AC, 0x05EB, 0x51AD, 0x51AE, 0x2947,
+ 0x51AF, 0x51AF, 0x0688, 0x51B0, 0x51B0, 0x0462, 0x51B1, 0x51B1, 0x1310,
+ 0x51B2, 0x51B2, 0x050A, 0x51B3, 0x51B3, 0x0925, 0x51B4, 0x51B4, 0x2949,
+ 0x51B5, 0x51B5, 0x0983, 0x51B6, 0x51B6, 0x1038, 0x51B7, 0x51B7, 0x09CF,
+ 0x51B8, 0x51BA, 0x294A, 0x51BB, 0x51BB, 0x05F2, 0x51BC, 0x51BC, 0x1312,
+ 0x51BD, 0x51BD, 0x1311, 0x51BE, 0x51BF, 0x294D, 0x51C0, 0x51C0, 0x08EA,
+ 0x51C1, 0x51C3, 0x294F, 0x51C4, 0x51C4, 0x0BFF, 0x51C5, 0x51C5, 0x2952,
+ 0x51C6, 0x51C6, 0x1219, 0x51C7, 0x51C7, 0x1313, 0x51C8, 0x51C8, 0x2953,
+ 0x51C9, 0x51C9, 0x0A02, 0x51CA, 0x51CA, 0x2954, 0x51CB, 0x51CB, 0x05D3,
+ 0x51CC, 0x51CC, 0x0A31, 0x51CD, 0x51CD, 0x1ECF, 0x51CE, 0x51CE, 0x2955,
+ 0x51CF, 0x51CF, 0x0868, 0x51D0, 0x51D0, 0x2956, 0x51D1, 0x51D1, 0x0558,
+ 0x51D2, 0x51DA, 0x2957, 0x51DB, 0x51DB, 0x0A26, 0x51DC, 0x51DC, 0x2960,
+ 0x51DD, 0x51DD, 0x0B60, 0x51DE, 0x51DF, 0x2961, 0x51E0, 0x51E0, 0x082B,
+ 0x51E1, 0x51E1, 0x064F, 0x51E2, 0x51E3, 0x2963, 0x51E4, 0x51E4, 0x068C,
+ 0x51E5, 0x51EA, 0x2965, 0x51EB, 0x51EB, 0x1300, 0x51EC, 0x51EC, 0x296B,
+ 0x51ED, 0x51ED, 0x0BDD, 0x51EE, 0x51EE, 0x296C, 0x51EF, 0x51EF, 0x093A,
+ 0x51F0, 0x51F0, 0x07E0, 0x51F1, 0x51F1, 0x1FD9, 0x51F2, 0x51F2, 0x296D,
+ 0x51F3, 0x51F3, 0x05AB, 0x51F4, 0x51F4, 0x296E, 0x51F5, 0x51F5, 0x1399,
+ 0x51F6, 0x51F6, 0x0FA2, 0x51F7, 0x51F7, 0x296F, 0x51F8, 0x51F8, 0x0E6A,
+ 0x51F9, 0x51F9, 0x03C7, 0x51FA, 0x51FA, 0x051B, 0x51FB, 0x51FB, 0x080C,
+ 0x51FC, 0x51FC, 0x139A, 0x51FD, 0x51FD, 0x0766, 0x51FE, 0x51FE, 0x2970,
+ 0x51FF, 0x51FF, 0x1127, 0x5200, 0x5200, 0x0597, 0x5201, 0x5201, 0x05D4,
+ 0x5202, 0x5202, 0x128C, 0x5203, 0x5203, 0x0CAB, 0x5204, 0x5205, 0x2971,
+ 0x5206, 0x5206, 0x0673, 0x5207, 0x5207, 0x0C4D, 0x5208, 0x5208, 0x128D,
+ 0x5209, 0x5209, 0x2973, 0x520A, 0x520A, 0x093C, 0x520B, 0x520C, 0x2974,
+ 0x520D, 0x520D, 0x138B, 0x520E, 0x520E, 0x128E, 0x520F, 0x5210, 0x2976,
+ 0x5211, 0x5211, 0x0F97, 0x5212, 0x5212, 0x07C3, 0x5213, 0x5215, 0x2978,
+ 0x5216, 0x5216, 0x196E, 0x5217, 0x5217, 0x0A19, 0x5218, 0x5218, 0x0A3E,
+ 0x5219, 0x5219, 0x1135, 0x521A, 0x521A, 0x06D0, 0x521B, 0x521B, 0x0537,
+ 0x521C, 0x521C, 0x297B, 0x521D, 0x521D, 0x051A, 0x521E, 0x521F, 0x297C,
+ 0x5220, 0x5220, 0x0CF7, 0x5221, 0x5223, 0x297E, 0x5224, 0x5224, 0x0B91,
+ 0x5225, 0x5227, 0x2981, 0x5228, 0x5228, 0x0B9A, 0x5229, 0x5229, 0x09E6,
+ 0x522A, 0x522A, 0x2984, 0x522B, 0x522B, 0x0459, 0x522C, 0x522C, 0x2985,
+ 0x522D, 0x522D, 0x128F, 0x522E, 0x522E, 0x0727, 0x522F, 0x522F, 0x2986,
+ 0x5230, 0x5230, 0x059E, 0x5231, 0x5232, 0x2987, 0x5233, 0x5233, 0x1290,
+ 0x5234, 0x5235, 0x2989, 0x5236, 0x5236, 0x11C5, 0x5237, 0x5237, 0x0D97,
+ 0x5238, 0x5238, 0x0C8A, 0x5239, 0x5239, 0x0CEB, 0x523A, 0x523A, 0x054F,
+ 0x523B, 0x523B, 0x0959, 0x523C, 0x523C, 0x298B, 0x523D, 0x523D, 0x074D,
+ 0x523E, 0x523E, 0x298C, 0x523F, 0x5240, 0x1291, 0x5241, 0x5241, 0x0626,
+ 0x5242, 0x5242, 0x0834, 0x5243, 0x5243, 0x0E3D, 0x5244, 0x5244, 0x22C8,
+ 0x5245, 0x5246, 0x298D, 0x5247, 0x5247, 0x2263, 0x5248, 0x5249, 0x298F,
+ 0x524A, 0x524A, 0x0F64, 0x524B, 0x524B, 0x2683, 0x524C, 0x524C, 0x1293,
+ 0x524D, 0x524D, 0x0C2D, 0x524E, 0x524F, 0x2991, 0x5250, 0x5250, 0x0729,
+ 0x5251, 0x5251, 0x0874, 0x5252, 0x5253, 0x2993, 0x5254, 0x5254, 0x0E31,
+ 0x5255, 0x5255, 0x2995, 0x5256, 0x5256, 0x0BE9, 0x5257, 0x525A, 0x2996,
+ 0x525B, 0x525B, 0x1F17, 0x525C, 0x525C, 0x1296, 0x525D, 0x525D, 0x299A,
+ 0x525E, 0x525E, 0x1294, 0x525F, 0x5260, 0x299B, 0x5261, 0x5261, 0x1295,
+ 0x5262, 0x5264, 0x299D, 0x5265, 0x5265, 0x0409, 0x5266, 0x5266, 0x29A0,
+ 0x5267, 0x5267, 0x0916, 0x5268, 0x5268, 0x29A1, 0x5269, 0x5269, 0x0D3A,
+ 0x526A, 0x526A, 0x0867, 0x526B, 0x526D, 0x29A2, 0x526E, 0x526E, 0x1F2B,
+ 0x526F, 0x526F, 0x06AC, 0x5270, 0x5271, 0x29A5, 0x5272, 0x5272, 0x06E9,
+ 0x5273, 0x5273, 0x29A7, 0x5274, 0x5274, 0x22CA, 0x5275, 0x5275, 0x1E99,
+ 0x5276, 0x527C, 0x29A8, 0x527D, 0x527D, 0x1298, 0x527E, 0x527E, 0x29AF,
+ 0x527F, 0x527F, 0x089C, 0x5280, 0x5280, 0x29B0, 0x5281, 0x5281, 0x129A,
+ 0x5282, 0x5282, 0x1299, 0x5283, 0x5283, 0x1F4F, 0x5284, 0x5286, 0x29B1,
+ 0x5287, 0x5287, 0x1FCF, 0x5288, 0x5288, 0x0BBD, 0x5289, 0x5289, 0x2036,
+ 0x528A, 0x528A, 0x1F3A, 0x528B, 0x528B, 0x29B4, 0x528C, 0x528C, 0x22C9,
+ 0x528D, 0x528D, 0x1F99, 0x528E, 0x528F, 0x29B5, 0x5290, 0x5290, 0x129B,
+ 0x5291, 0x5291, 0x1F75, 0x5292, 0x5292, 0x29B7, 0x5293, 0x5293, 0x129C,
+ 0x5294, 0x529A, 0x29B8, 0x529B, 0x529B, 0x09EF, 0x529C, 0x529C, 0x29BF,
+ 0x529D, 0x529D, 0x0C8B, 0x529E, 0x529E, 0x03F7, 0x529F, 0x529F, 0x06FF,
+ 0x52A0, 0x52A0, 0x0846, 0x52A1, 0x52A1, 0x0F00, 0x52A2, 0x52A2, 0x138D,
+ 0x52A3, 0x52A3, 0x0A1C, 0x52A4, 0x52A7, 0x29C0, 0x52A8, 0x52A8, 0x05EE,
+ 0x52A9, 0x52A9, 0x11F9, 0x52AA, 0x52AA, 0x0B6D, 0x52AB, 0x52AB, 0x08AA,
+ 0x52AC, 0x52AD, 0x138E, 0x52AE, 0x52B0, 0x29C4, 0x52B1, 0x52B1, 0x09E3,
+ 0x52B2, 0x52B2, 0x08D1, 0x52B3, 0x52B3, 0x09B8, 0x52B4, 0x52BD, 0x29C7,
+ 0x52BE, 0x52BE, 0x1390, 0x52BF, 0x52BF, 0x0D5D, 0x52C0, 0x52C0, 0x29D1,
+ 0x52C1, 0x52C1, 0x1FBE, 0x52C2, 0x52C2, 0x29D2, 0x52C3, 0x52C3, 0x0471,
+ 0x52C4, 0x52C6, 0x29D3, 0x52C7, 0x52C7, 0x10A7, 0x52C8, 0x52C8, 0x29D6,
+ 0x52C9, 0x52C9, 0x0AE8, 0x52CA, 0x52CA, 0x29D7, 0x52CB, 0x52CB, 0x0FD4,
+ 0x52CC, 0x52CF, 0x29D8, 0x52D0, 0x52D0, 0x1392, 0x52D1, 0x52D1, 0x29DC,
+ 0x52D2, 0x52D2, 0x09C0, 0x52D3, 0x52D4, 0x29DD, 0x52D5, 0x52D5, 0x1ECD,
+ 0x52D6, 0x52D6, 0x1393, 0x52D7, 0x52D7, 0x29DF, 0x52D8, 0x52D8, 0x093E,
+ 0x52D9, 0x52D9, 0x21A9, 0x52DA, 0x52DA, 0x29E0, 0x52DB, 0x52DB, 0x21E6,
+ 0x52DC, 0x52DC, 0x29E1, 0x52DD, 0x52DD, 0x2127, 0x52DE, 0x52DE, 0x2003,
+ 0x52DF, 0x52DF, 0x0B1F, 0x52E0, 0x52E1, 0x29E2, 0x52E2, 0x52E2, 0x2132,
+ 0x52E3, 0x52E3, 0x29E4, 0x52E4, 0x52E4, 0x0C57, 0x52E5, 0x52EF, 0x29E5,
+ 0x52F0, 0x52F0, 0x1394, 0x52F1, 0x52F1, 0x2323, 0x52F2, 0x52F4, 0x29F0,
+ 0x52F5, 0x52F5, 0x2011, 0x52F6, 0x52F7, 0x29F3, 0x52F8, 0x52F8, 0x20F5,
+ 0x52F9, 0x52F9, 0x12FC, 0x52FA, 0x52FA, 0x0D10, 0x52FB, 0x52FD, 0x29F5,
+ 0x52FE, 0x52FE, 0x070D, 0x52FF, 0x52FF, 0x0EFF, 0x5300, 0x5300, 0x110B,
+ 0x5301, 0x5304, 0x29F8, 0x5305, 0x5305, 0x0407, 0x5306, 0x5306, 0x0555,
+ 0x5307, 0x5307, 0x29FC, 0x5308, 0x5308, 0x0FA4, 0x5309, 0x530C, 0x29FD,
+ 0x530D, 0x530D, 0x12FD, 0x530E, 0x530E, 0x2A01, 0x530F, 0x530F, 0x14B5,
+ 0x5310, 0x5310, 0x12FF, 0x5311, 0x5314, 0x2A02, 0x5315, 0x5315, 0x1266,
+ 0x5316, 0x5316, 0x07C4, 0x5317, 0x5317, 0x041A, 0x5318, 0x5318, 0x2A06,
+ 0x5319, 0x5319, 0x04FC, 0x531A, 0x531A, 0x1284, 0x531B, 0x531C, 0x2A07,
+ 0x531D, 0x531D, 0x1114, 0x531E, 0x531F, 0x2A09, 0x5320, 0x5320, 0x0884,
+ 0x5321, 0x5321, 0x097C, 0x5322, 0x5322, 0x2A0B, 0x5323, 0x5323, 0x0F28,
+ 0x5324, 0x5325, 0x2A0C, 0x5326, 0x5326, 0x1286, 0x5327, 0x5329, 0x2A0E,
+ 0x532A, 0x532A, 0x0668, 0x532B, 0x532C, 0x2A11, 0x532D, 0x532D, 0x22C5,
+ 0x532E, 0x532E, 0x1287, 0x532F, 0x532F, 0x1F5E, 0x5330, 0x5330, 0x2A13,
+ 0x5331, 0x5331, 0x22C6, 0x5332, 0x5338, 0x2A14, 0x5339, 0x5339, 0x0BC4,
+ 0x533A, 0x533A, 0x0C75, 0x533B, 0x533B, 0x1044, 0x533C, 0x533D, 0x2A1B,
+ 0x533E, 0x533E, 0x1288, 0x533F, 0x533F, 0x0B47, 0x5340, 0x5340, 0x20EF,
+ 0x5341, 0x5341, 0x0D45, 0x5342, 0x5342, 0x2A1D, 0x5343, 0x5343, 0x0C24,
+ 0x5344, 0x5344, 0x2A1E, 0x5345, 0x5345, 0x125C, 0x5346, 0x5346, 0x2A1F,
+ 0x5347, 0x5347, 0x0D36, 0x5348, 0x5348, 0x0EF6, 0x5349, 0x5349, 0x07F1,
+ 0x534A, 0x534A, 0x03F6, 0x534B, 0x534D, 0x2A20, 0x534E, 0x534E, 0x07BF,
+ 0x534F, 0x534F, 0x0F78, 0x5350, 0x5350, 0x2A23, 0x5351, 0x5351, 0x0419,
+ 0x5352, 0x5352, 0x1241, 0x5353, 0x5353, 0x121C, 0x5354, 0x5354, 0x21D0,
+ 0x5355, 0x5355, 0x0586, 0x5356, 0x5356, 0x0A9B, 0x5357, 0x5357, 0x0B32,
+ 0x5358, 0x5359, 0x2A24, 0x535A, 0x535A, 0x0470, 0x535B, 0x535B, 0x2A26,
+ 0x535C, 0x535C, 0x047E, 0x535D, 0x535D, 0x2A27, 0x535E, 0x535E, 0x044E,
+ 0x535F, 0x535F, 0x14FA, 0x5360, 0x5360, 0x115D, 0x5361, 0x5361, 0x0935,
+ 0x5362, 0x5362, 0x0A53, 0x5363, 0x5363, 0x128B, 0x5364, 0x5364, 0x0A58,
+ 0x5365, 0x5365, 0x2A28, 0x5366, 0x5366, 0x128A, 0x5367, 0x5367, 0x0EE3,
+ 0x5368, 0x5368, 0x2A29, 0x5369, 0x5369, 0x1352, 0x536A, 0x536A, 0x2A2A,
+ 0x536B, 0x536B, 0x0ECF, 0x536C, 0x536D, 0x2A2B, 0x536E, 0x536E, 0x126A,
+ 0x536F, 0x536F, 0x0AB3, 0x5370, 0x5370, 0x1086, 0x5371, 0x5371, 0x0EB2,
+ 0x5372, 0x5372, 0x2A2D, 0x5373, 0x5373, 0x0827, 0x5374, 0x5374, 0x0C8F,
+ 0x5375, 0x5375, 0x0A78, 0x5376, 0x5376, 0x2A2E, 0x5377, 0x5377, 0x091C,
+ 0x5378, 0x5378, 0x0F81, 0x5379, 0x5379, 0x2A2F, 0x537A, 0x537A, 0x1353,
+ 0x537B, 0x537E, 0x2A30, 0x537F, 0x537F, 0x0C61, 0x5380, 0x5381, 0x2A34,
+ 0x5382, 0x5382, 0x04CC, 0x5383, 0x5383, 0x2A36, 0x5384, 0x5384, 0x0631,
+ 0x5385, 0x5385, 0x0E4F, 0x5386, 0x5386, 0x09E5, 0x5387, 0x5388, 0x2A37,
+ 0x5389, 0x5389, 0x09E2, 0x538A, 0x538A, 0x2A39, 0x538B, 0x538B, 0x0FE2,
+ 0x538C, 0x538C, 0x100A, 0x538D, 0x538D, 0x127D, 0x538E, 0x5394, 0x2A3A,
+ 0x5395, 0x5395, 0x04A5, 0x5396, 0x5397, 0x2A41, 0x5398, 0x5398, 0x09D0,
+ 0x5399, 0x5399, 0x22C1, 0x539A, 0x539A, 0x07A8, 0x539B, 0x539C, 0x2A43,
+ 0x539D, 0x539D, 0x127E, 0x539E, 0x539E, 0x2A45, 0x539F, 0x539F, 0x10F0,
+ 0x53A0, 0x53A0, 0x1E64, 0x53A1, 0x53A1, 0x2A46, 0x53A2, 0x53A2, 0x0F4E,
+ 0x53A3, 0x53A3, 0x127F, 0x53A4, 0x53A4, 0x2A47, 0x53A5, 0x53A5, 0x1280,
+ 0x53A6, 0x53A6, 0x0F30, 0x53A7, 0x53A7, 0x2A48, 0x53A8, 0x53A8, 0x051D,
+ 0x53A9, 0x53A9, 0x08F6, 0x53AA, 0x53AC, 0x2A49, 0x53AD, 0x53AD, 0x21F9,
+ 0x53AE, 0x53AE, 0x1281, 0x53AF, 0x53B1, 0x2A4C, 0x53B2, 0x53B2, 0x2010,
+ 0x53B3, 0x53B3, 0x2A4F, 0x53B4, 0x53B4, 0x22C2, 0x53B5, 0x53B5, 0x2A50,
+ 0x53B6, 0x53B6, 0x139C, 0x53B7, 0x53BA, 0x2A51, 0x53BB, 0x53BB, 0x0C80,
+ 0x53BC, 0x53BE, 0x2A55, 0x53BF, 0x53BF, 0x0F45, 0x53C0, 0x53C0, 0x2A58,
+ 0x53C1, 0x53C1, 0x0CD9, 0x53C2, 0x53C2, 0x0495, 0x53C3, 0x53C3, 0x1E5A,
+ 0x53C4, 0x53C7, 0x2A59, 0x53C8, 0x53C8, 0x10BB, 0x53C9, 0x53C9, 0x04AD,
+ 0x53CA, 0x53CA, 0x0823, 0x53CB, 0x53CB, 0x10B6, 0x53CC, 0x53CC, 0x0DA0,
+ 0x53CD, 0x53CD, 0x0651, 0x53CE, 0x53D0, 0x2A5D, 0x53D1, 0x53D1, 0x063F,
+ 0x53D2, 0x53D3, 0x2A60, 0x53D4, 0x53D4, 0x0D7C, 0x53D5, 0x53D5, 0x2A62,
+ 0x53D6, 0x53D6, 0x0C7C, 0x53D7, 0x53D7, 0x0D73, 0x53D8, 0x53D8, 0x044D,
+ 0x53D9, 0x53D9, 0x0FBB, 0x53DA, 0x53DA, 0x2A63, 0x53DB, 0x53DB, 0x0B92,
+ 0x53DC, 0x53DE, 0x2A64, 0x53DF, 0x53DF, 0x1395, 0x53E0, 0x53E0, 0x05DF,
+ 0x53E1, 0x53E1, 0x2A67, 0x53E2, 0x53E2, 0x1EA2, 0x53E3, 0x53E3, 0x0967,
+ 0x53E4, 0x53E4, 0x071E, 0x53E5, 0x53E5, 0x0913, 0x53E6, 0x53E6, 0x0A36,
+ 0x53E7, 0x53E7, 0x2A68, 0x53E8, 0x53E8, 0x14FE, 0x53E9, 0x53E9, 0x14FD,
+ 0x53EA, 0x53EA, 0x11BA, 0x53EB, 0x53EB, 0x08A1, 0x53EC, 0x53EC, 0x117A,
+ 0x53ED, 0x53ED, 0x03D3, 0x53EE, 0x53EE, 0x05E2, 0x53EF, 0x53EF, 0x0956,
+ 0x53F0, 0x53F0, 0x0DFB, 0x53F1, 0x53F1, 0x14FB, 0x53F2, 0x53F2, 0x0D4E,
+ 0x53F3, 0x53F3, 0x10B7, 0x53F4, 0x53F4, 0x2A69, 0x53F5, 0x53F5, 0x1285,
+ 0x53F6, 0x53F6, 0x103D, 0x53F7, 0x53F7, 0x077C, 0x53F8, 0x53F8, 0x0DB3,
+ 0x53F9, 0x53F9, 0x0E11, 0x53FA, 0x53FA, 0x2A6A, 0x53FB, 0x53FB, 0x14FF,
+ 0x53FC, 0x53FC, 0x05D1, 0x53FD, 0x53FD, 0x14FC, 0x53FE, 0x53FF, 0x2A6B,
+ 0x5400, 0x5400, 0x2A6D, 0x5401, 0x5401, 0x10DA, 0x5402, 0x5402, 0x2A6E,
+ 0x5403, 0x5403, 0x04F9, 0x5404, 0x5404, 0x06F2, 0x5405, 0x5405, 0x2A6F,
+ 0x5406, 0x5406, 0x1502, 0x5407, 0x5407, 0x2A70, 0x5408, 0x5408, 0x0786,
+ 0x5409, 0x5409, 0x081D, 0x540A, 0x540A, 0x05D6, 0x540B, 0x540B, 0x2A71,
+ 0x540C, 0x540C, 0x0E5D, 0x540D, 0x540D, 0x0B00, 0x540E, 0x540E, 0x07AA,
+ 0x540F, 0x540F, 0x09DF, 0x5410, 0x5410, 0x0E73, 0x5411, 0x5411, 0x0F5F,
+ 0x5412, 0x5412, 0x1500, 0x5413, 0x5413, 0x0F32, 0x5414, 0x5414, 0x2A72,
+ 0x5415, 0x5415, 0x0A67, 0x5416, 0x5416, 0x1501, 0x5417, 0x5417, 0x0A97,
+ 0x5418, 0x541A, 0x2A73, 0x541B, 0x541B, 0x092C, 0x541C, 0x541C, 0x2A76,
+ 0x541D, 0x541D, 0x0A28, 0x541E, 0x541E, 0x0E7D, 0x541F, 0x541F, 0x107E,
+ 0x5420, 0x5420, 0x066A, 0x5421, 0x5421, 0x1509, 0x5422, 0x5422, 0x2A77,
+ 0x5423, 0x5423, 0x150C, 0x5424, 0x5425, 0x2A78, 0x5426, 0x5426, 0x068E,
+ 0x5427, 0x5427, 0x03D4, 0x5428, 0x5428, 0x0615, 0x5429, 0x5429, 0x0671,
+ 0x542A, 0x542A, 0x2A7A, 0x542B, 0x542B, 0x0763, 0x542C, 0x542C, 0x0E50,
+ 0x542D, 0x542D, 0x0961, 0x542E, 0x542E, 0x0DA6, 0x542F, 0x542F, 0x0C13,
+ 0x5430, 0x5430, 0x2A7B, 0x5431, 0x5431, 0x11A7, 0x5432, 0x5432, 0x150D,
+ 0x5433, 0x5433, 0x2A7C, 0x5434, 0x5434, 0x0EF1, 0x5435, 0x5435, 0x04D8,
+ 0x5436, 0x5437, 0x2A7D, 0x5438, 0x5438, 0x0F0B, 0x5439, 0x5439, 0x0538,
+ 0x543A, 0x543A, 0x2A7F, 0x543B, 0x543B, 0x0ED6, 0x543C, 0x543C, 0x07A7,
+ 0x543D, 0x543D, 0x2A80, 0x543E, 0x543E, 0x0EF0, 0x543F, 0x543F, 0x2A81,
+ 0x5440, 0x5440, 0x0FE6, 0x5441, 0x5442, 0x2A82, 0x5443, 0x5443, 0x1508,
+ 0x5444, 0x5445, 0x2A84, 0x5446, 0x5446, 0x0577, 0x5447, 0x5447, 0x2A86,
+ 0x5448, 0x5448, 0x04EF, 0x5449, 0x5449, 0x2A87, 0x544A, 0x544A, 0x06E1,
+ 0x544B, 0x544B, 0x1503, 0x544C, 0x544F, 0x2A88, 0x5450, 0x5450, 0x0B28,
+ 0x5451, 0x5451, 0x2A8C, 0x5452, 0x5454, 0x1504, 0x5455, 0x5455, 0x0B7C,
+ 0x5456, 0x5456, 0x1507, 0x5457, 0x5457, 0x150A, 0x5458, 0x5458, 0x10F4,
+ 0x5459, 0x5459, 0x150B, 0x545A, 0x545A, 0x2A8D, 0x545B, 0x545B, 0x0C37,
+ 0x545C, 0x545C, 0x0EE7, 0x545D, 0x5461, 0x2A8E, 0x5462, 0x5462, 0x0B3B,
+ 0x5463, 0x5463, 0x2A93, 0x5464, 0x5464, 0x1512, 0x5465, 0x5465, 0x2A94,
+ 0x5466, 0x5466, 0x1517, 0x5467, 0x5467, 0x2A95, 0x5468, 0x5468, 0x11DB,
+ 0x5469, 0x5470, 0x2A96, 0x5471, 0x5471, 0x1511, 0x5472, 0x5472, 0x1522,
+ 0x5473, 0x5473, 0x0EC5, 0x5474, 0x5474, 0x2A9E, 0x5475, 0x5475, 0x077E,
+ 0x5476, 0x5476, 0x1516, 0x5477, 0x5477, 0x1510, 0x5478, 0x5478, 0x0B9F,
+ 0x5479, 0x547A, 0x2A9F, 0x547B, 0x547B, 0x0D24, 0x547C, 0x547C, 0x07AB,
+ 0x547D, 0x547D, 0x0B01, 0x547E, 0x547F, 0x2AA1, 0x5480, 0x5480, 0x0906,
+ 0x5481, 0x5481, 0x2AA3, 0x5482, 0x5482, 0x150E, 0x5483, 0x5483, 0x2AA4,
+ 0x5484, 0x5484, 0x1515, 0x5485, 0x5485, 0x2AA5, 0x5486, 0x5486, 0x0B99,
+ 0x5487, 0x548A, 0x2AA6, 0x548B, 0x548B, 0x1147, 0x548C, 0x548C, 0x0784,
+ 0x548D, 0x548D, 0x2AAA, 0x548E, 0x548E, 0x08FB, 0x548F, 0x548F, 0x10A2,
+ 0x5490, 0x5490, 0x06BB, 0x5491, 0x5491, 0x2AAB, 0x5492, 0x5492, 0x11E3,
+ 0x5493, 0x5493, 0x2AAC, 0x5494, 0x5494, 0x150F, 0x5495, 0x5495, 0x0717,
+ 0x5496, 0x5496, 0x0934, 0x5497, 0x5498, 0x2AAD, 0x5499, 0x5499, 0x0A45,
+ 0x549A, 0x549B, 0x1513, 0x549C, 0x549C, 0x2AAF, 0x549D, 0x549D, 0x1518,
+ 0x549E, 0x54A2, 0x2AB0, 0x54A3, 0x54A3, 0x1523, 0x54A4, 0x54A4, 0x152D,
+ 0x54A5, 0x54A5, 0x2AB5, 0x54A6, 0x54A6, 0x151F, 0x54A7, 0x54A7, 0x151E,
+ 0x54A8, 0x54A8, 0x1226, 0x54A9, 0x54AA, 0x152B, 0x54AB, 0x54AB, 0x1767,
+ 0x54AC, 0x54AC, 0x102E, 0x54AD, 0x54AD, 0x151A, 0x54AE, 0x54AE, 0x2AB6,
+ 0x54AF, 0x54AF, 0x0936, 0x54B0, 0x54B0, 0x2AB7, 0x54B1, 0x54B1, 0x111E,
+ 0x54B2, 0x54B2, 0x2AB8, 0x54B3, 0x54B3, 0x0955, 0x54B4, 0x54B4, 0x151C,
+ 0x54B5, 0x54B7, 0x2AB9, 0x54B8, 0x54B8, 0x0F39, 0x54B9, 0x54BA, 0x2ABC,
+ 0x54BB, 0x54BB, 0x1525, 0x54BC, 0x54BC, 0x236D, 0x54BD, 0x54BD, 0x0FF3,
+ 0x54BE, 0x54BE, 0x2ABE, 0x54BF, 0x54BF, 0x1526, 0x54C0, 0x54C0, 0x03B2,
+ 0x54C1, 0x54C1, 0x0BD6, 0x54C2, 0x54C2, 0x151B, 0x54C3, 0x54C3, 0x2ABF,
+ 0x54C4, 0x54C4, 0x079C, 0x54C5, 0x54C5, 0x2AC0, 0x54C6, 0x54C6, 0x061E,
+ 0x54C7, 0x54C7, 0x0E8C, 0x54C8, 0x54C8, 0x0757, 0x54C9, 0x54C9, 0x1118,
+ 0x54CA, 0x54CB, 0x2AC1, 0x54CC, 0x54CC, 0x1527, 0x54CD, 0x54CD, 0x0F59,
+ 0x54CE, 0x54CE, 0x03B0, 0x54CF, 0x54CF, 0x152F, 0x54D0, 0x54D0, 0x1519,
+ 0x54D1, 0x54D1, 0x0FEF, 0x54D2, 0x54D2, 0x151D, 0x54D3, 0x54D4, 0x1520,
+ 0x54D5, 0x54D5, 0x1524, 0x54D6, 0x54D6, 0x2AC3, 0x54D7, 0x54D7, 0x07BE,
+ 0x54D8, 0x54D8, 0x2AC4, 0x54D9, 0x54DA, 0x1528, 0x54DB, 0x54DB, 0x2AC5,
+ 0x54DC, 0x54DC, 0x152A, 0x54DD, 0x54DD, 0x152E, 0x54DE, 0x54DE, 0x1530,
+ 0x54DF, 0x54DF, 0x1099, 0x54E0, 0x54E0, 0x2AC6, 0x54E1, 0x54E1, 0x2247,
+ 0x54E2, 0x54E4, 0x2AC7, 0x54E5, 0x54E5, 0x06E2, 0x54E6, 0x54E6, 0x0B77,
+ 0x54E7, 0x54E7, 0x1532, 0x54E8, 0x54E8, 0x0D13, 0x54E9, 0x54E9, 0x09F1,
+ 0x54EA, 0x54EA, 0x0B27, 0x54EB, 0x54EC, 0x2ACA, 0x54ED, 0x54ED, 0x096B,
+ 0x54EE, 0x54EE, 0x0F65, 0x54EF, 0x54F1, 0x2ACC, 0x54F2, 0x54F2, 0x117D,
+ 0x54F3, 0x54F3, 0x1536, 0x54F4, 0x54F9, 0x2ACF, 0x54FA, 0x54FA, 0x047F,
+ 0x54FB, 0x54FB, 0x2AD5, 0x54FC, 0x54FC, 0x0796, 0x54FD, 0x54FD, 0x1534,
+ 0x54FE, 0x54FE, 0x2AD6, 0x54FF, 0x54FF, 0x1391, 0x5500, 0x5500, 0x2AD7,
+ 0x5501, 0x5501, 0x100D, 0x5502, 0x5503, 0x2AD8, 0x5504, 0x5504, 0x236C,
+ 0x5505, 0x5505, 0x2ADA, 0x5506, 0x5506, 0x0DE9, 0x5507, 0x5507, 0x0540,
+ 0x5508, 0x5508, 0x2ADB, 0x5509, 0x5509, 0x03B1, 0x550A, 0x550E, 0x2ADC,
+ 0x550F, 0x550F, 0x1539, 0x5510, 0x5510, 0x0E19, 0x5511, 0x5511, 0x153A,
+ 0x5512, 0x5513, 0x2AE1, 0x5514, 0x5514, 0x1535, 0x5515, 0x551A, 0x2AE3,
+ 0x551B, 0x551B, 0x1531, 0x551C, 0x551F, 0x2AE9, 0x5520, 0x5520, 0x1533,
+ 0x5521, 0x5521, 0x2AED, 0x5522, 0x5523, 0x1537, 0x5524, 0x5524, 0x07D2,
+ 0x5525, 0x5526, 0x2AEE, 0x5527, 0x5527, 0x153B, 0x5528, 0x5529, 0x2AF0,
+ 0x552A, 0x552A, 0x153C, 0x552B, 0x552B, 0x2AF2, 0x552C, 0x552C, 0x07B8,
+ 0x552D, 0x552D, 0x2AF3, 0x552E, 0x552E, 0x0D72, 0x552F, 0x552F, 0x0EB7,
+ 0x5530, 0x5530, 0x154D, 0x5531, 0x5531, 0x04CF, 0x5532, 0x5532, 0x2AF4,
+ 0x5533, 0x5533, 0x154C, 0x5534, 0x5536, 0x2AF5, 0x5537, 0x5537, 0x1547,
+ 0x5538, 0x553B, 0x2AF8, 0x553C, 0x553C, 0x1546, 0x553D, 0x553D, 0x2AFC,
+ 0x553E, 0x553E, 0x0E8A, 0x553F, 0x553F, 0x1544, 0x5540, 0x5540, 0x2AFD,
+ 0x5541, 0x5541, 0x1542, 0x5542, 0x5542, 0x2AFE, 0x5543, 0x5543, 0x095D,
+ 0x5544, 0x5544, 0x1221, 0x5545, 0x5545, 0x2AFF, 0x5546, 0x5546, 0x0D05,
+ 0x5547, 0x5548, 0x2B00, 0x5549, 0x5549, 0x1540, 0x554A, 0x554A, 0x03AC,
+ 0x554B, 0x554E, 0x2B02, 0x554F, 0x554F, 0x219C, 0x5550, 0x5550, 0x1545,
+ 0x5551, 0x5552, 0x2B06, 0x5553, 0x5553, 0x20C9, 0x5554, 0x5554, 0x2B08,
+ 0x5555, 0x5555, 0x1543, 0x5556, 0x5556, 0x1548, 0x5557, 0x555B, 0x2B09,
+ 0x555C, 0x555C, 0x154E, 0x555D, 0x555D, 0x2B0E, 0x555E, 0x555E, 0x21F0,
+ 0x555F, 0x5560, 0x2B0F, 0x5561, 0x5561, 0x0665, 0x5562, 0x5563, 0x2B11,
+ 0x5564, 0x5564, 0x0BC0, 0x5565, 0x5565, 0x0CEF, 0x5566, 0x5566, 0x099D,
+ 0x5567, 0x5567, 0x153D, 0x5568, 0x5569, 0x2B13, 0x556A, 0x556A, 0x0B7F,
+ 0x556B, 0x556B, 0x2B15, 0x556C, 0x556C, 0x127A, 0x556D, 0x556D, 0x1541,
+ 0x556E, 0x556E, 0x0B59, 0x556F, 0x5574, 0x2B16, 0x5575, 0x5577, 0x1549,
+ 0x5578, 0x5578, 0x0F70, 0x5579, 0x557A, 0x2B1C, 0x557B, 0x557B, 0x155A,
+ 0x557C, 0x557C, 0x0E37, 0x557D, 0x557D, 0x2B1E, 0x557E, 0x557E, 0x1557,
+ 0x557F, 0x557F, 0x2B1F, 0x5580, 0x5580, 0x0933, 0x5581, 0x5581, 0x1555,
+ 0x5582, 0x5582, 0x0EC8, 0x5583, 0x5583, 0x1551, 0x5584, 0x5584, 0x0CFF,
+ 0x5585, 0x5586, 0x2B20, 0x5587, 0x5587, 0x0999, 0x5588, 0x5588, 0x1554,
+ 0x5589, 0x5589, 0x07A4, 0x558A, 0x558A, 0x0767, 0x558B, 0x558B, 0x154F,
+ 0x558C, 0x558E, 0x2B22, 0x558F, 0x558F, 0x153E, 0x5590, 0x5590, 0x2B25,
+ 0x5591, 0x5591, 0x1559, 0x5592, 0x5593, 0x2B26, 0x5594, 0x5594, 0x155E,
+ 0x5595, 0x5597, 0x2B28, 0x5598, 0x5598, 0x0530, 0x5599, 0x5599, 0x155F,
+ 0x559A, 0x559B, 0x2B2B, 0x559C, 0x559C, 0x0F1F, 0x559D, 0x559D, 0x077F,
+ 0x559E, 0x559E, 0x2B2D, 0x559F, 0x559F, 0x1556, 0x55A0, 0x55A6, 0x2B2E,
+ 0x55A7, 0x55A7, 0x0FC5, 0x55A8, 0x55A9, 0x2B35, 0x55AA, 0x55AA, 0x210B,
+ 0x55AB, 0x55AB, 0x2B37, 0x55AC, 0x55AC, 0x20DE, 0x55AD, 0x55AD, 0x2B38,
+ 0x55AE, 0x55AE, 0x1EAA, 0x55AF, 0x55B0, 0x2B39, 0x55B1, 0x55B1, 0x1552,
+ 0x55B2, 0x55B2, 0x222C, 0x55B3, 0x55B3, 0x113E, 0x55B4, 0x55B4, 0x2B3B,
+ 0x55B5, 0x55B5, 0x153F, 0x55B6, 0x55B6, 0x2B3C, 0x55B7, 0x55B7, 0x0BA8,
+ 0x55B8, 0x55B8, 0x2B3D, 0x55B9, 0x55B9, 0x1553, 0x55BA, 0x55BA, 0x2B3E,
+ 0x55BB, 0x55BB, 0x10DC, 0x55BC, 0x55BC, 0x2B3F, 0x55BD, 0x55BE, 0x155C,
+ 0x55BF, 0x55C3, 0x2B40, 0x55C4, 0x55C4, 0x156A, 0x55C5, 0x55C5, 0x0FAC,
+ 0x55C6, 0x55C6, 0x20D8, 0x55C7, 0x55C7, 0x22C0, 0x55C8, 0x55C8, 0x2B45,
+ 0x55C9, 0x55C9, 0x1562, 0x55CA, 0x55CB, 0x2B46, 0x55CC, 0x55CD, 0x156F,
+ 0x55CE, 0x55CE, 0x206F, 0x55CF, 0x55D0, 0x2B48, 0x55D1, 0x55D1, 0x1564,
+ 0x55D2, 0x55D2, 0x1550, 0x55D3, 0x55D3, 0x0CDD, 0x55D4, 0x55D4, 0x1567,
+ 0x55D5, 0x55D5, 0x2B4A, 0x55D6, 0x55D6, 0x1558, 0x55D7, 0x55D9, 0x2B4B,
+ 0x55DA, 0x55DA, 0x21A1, 0x55DB, 0x55DB, 0x2B4E, 0x55DC, 0x55DC, 0x0D5F,
+ 0x55DD, 0x55DD, 0x1569, 0x55DE, 0x55DE, 0x2B4F, 0x55DF, 0x55DF, 0x155B,
+ 0x55E0, 0x55E0, 0x2B50, 0x55E1, 0x55E1, 0x0EDA, 0x55E2, 0x55E2, 0x2B51,
+ 0x55E3, 0x55E3, 0x0DB8, 0x55E4, 0x55E4, 0x1573, 0x55E5, 0x55E5, 0x156C,
+ 0x55E6, 0x55E6, 0x1568, 0x55E7, 0x55E7, 0x2B52, 0x55E8, 0x55E8, 0x1571,
+ 0x55E9, 0x55E9, 0x2379, 0x55EA, 0x55EA, 0x1560, 0x55EB, 0x55EC, 0x1565,
+ 0x55ED, 0x55EE, 0x2B53, 0x55EF, 0x55EF, 0x156B, 0x55F0, 0x55F1, 0x2B55,
+ 0x55F2, 0x55F3, 0x156D, 0x55F4, 0x55F4, 0x2B57, 0x55F5, 0x55F5, 0x1572,
+ 0x55F6, 0x55F6, 0x2372, 0x55F7, 0x55F7, 0x1561, 0x55F8, 0x55FC, 0x2B58,
+ 0x55FD, 0x55FD, 0x0DC9, 0x55FE, 0x55FE, 0x157B, 0x55FF, 0x55FF, 0x2B5D,
+ 0x5600, 0x5600, 0x157C, 0x5601, 0x5601, 0x1578, 0x5602, 0x5605, 0x2B5E,
+ 0x5606, 0x5606, 0x216A, 0x5607, 0x5607, 0x2B62, 0x5608, 0x5608, 0x1576,
+ 0x5609, 0x5609, 0x0841, 0x560A, 0x560B, 0x2B63, 0x560C, 0x560C, 0x1577,
+ 0x560D, 0x560D, 0x237C, 0x560E, 0x560E, 0x06BD, 0x560F, 0x560F, 0x127B,
+ 0x5610, 0x5613, 0x2B65, 0x5614, 0x5614, 0x20B0, 0x5615, 0x5615, 0x2B69,
+ 0x5616, 0x5616, 0x237A, 0x5617, 0x5617, 0x1E74, 0x5618, 0x5618, 0x0FB5,
+ 0x5619, 0x561A, 0x2B6A, 0x561B, 0x561B, 0x0A96, 0x561C, 0x561C, 0x2377,
+ 0x561D, 0x561D, 0x2B6C, 0x561E, 0x561E, 0x1575, 0x561F, 0x561F, 0x1563,
+ 0x5620, 0x5622, 0x2B6D, 0x5623, 0x5623, 0x157A, 0x5624, 0x5624, 0x1579,
+ 0x5625, 0x5626, 0x2B70, 0x5627, 0x5627, 0x157D, 0x5628, 0x5628, 0x2B72,
+ 0x5629, 0x5629, 0x1F4C, 0x562A, 0x562B, 0x2B73, 0x562C, 0x562C, 0x1582,
+ 0x562D, 0x562D, 0x157E, 0x562E, 0x562E, 0x2378, 0x562F, 0x562F, 0x21CF,
+ 0x5630, 0x5630, 0x2368, 0x5631, 0x5631, 0x11F5, 0x5632, 0x5632, 0x04D5,
+ 0x5633, 0x5633, 0x2B75, 0x5634, 0x5634, 0x1249, 0x5635, 0x5635, 0x2371,
+ 0x5636, 0x5636, 0x0DB0, 0x5637, 0x5637, 0x2B76, 0x5638, 0x5638, 0x2369,
+ 0x5639, 0x5639, 0x1580, 0x563A, 0x563A, 0x2B77, 0x563B, 0x563B, 0x0F0A,
+ 0x563C, 0x563E, 0x2B78, 0x563F, 0x563F, 0x0790, 0x5640, 0x5640, 0x2B7B,
+ 0x5641, 0x5641, 0x2674, 0x5642, 0x564B, 0x2B7C, 0x564C, 0x564C, 0x1587,
+ 0x564D, 0x564D, 0x1583, 0x564E, 0x564E, 0x1034, 0x564F, 0x5653, 0x2B86,
+ 0x5654, 0x5654, 0x1588, 0x5655, 0x5656, 0x2B8B, 0x5657, 0x5657, 0x1581,
+ 0x5658, 0x5658, 0x157F, 0x5659, 0x5659, 0x1585, 0x565A, 0x565B, 0x2B8D,
+ 0x565C, 0x565C, 0x1586, 0x565D, 0x565D, 0x236F, 0x565E, 0x565F, 0x2B8F,
+ 0x5660, 0x5660, 0x2370, 0x5661, 0x5661, 0x2B91, 0x5662, 0x5662, 0x1584,
+ 0x5663, 0x5663, 0x2B92, 0x5664, 0x5664, 0x158A, 0x5665, 0x5665, 0x2376,
+ 0x5666, 0x5666, 0x2373, 0x5667, 0x5667, 0x2B93, 0x5668, 0x5668, 0x0C16,
+ 0x5669, 0x5669, 0x1262, 0x566A, 0x566A, 0x112E, 0x566B, 0x566B, 0x158C,
+ 0x566C, 0x566C, 0x0D60, 0x566D, 0x566E, 0x2B94, 0x566F, 0x566F, 0x237F,
+ 0x5670, 0x5670, 0x2B96, 0x5671, 0x5671, 0x158B, 0x5672, 0x5672, 0x2374,
+ 0x5673, 0x5673, 0x2B97, 0x5674, 0x5674, 0x20B5, 0x5675, 0x5675, 0x2B98,
+ 0x5676, 0x5676, 0x06BC, 0x5677, 0x5677, 0x2B99, 0x5678, 0x5678, 0x1EDB,
+ 0x5679, 0x5679, 0x2672, 0x567A, 0x567A, 0x2B9A, 0x567B, 0x567C, 0x158D,
+ 0x567D, 0x567F, 0x2B9B, 0x5680, 0x5680, 0x236E, 0x5681, 0x5684, 0x2B9E,
+ 0x5685, 0x5685, 0x158F, 0x5686, 0x5686, 0x1589, 0x5687, 0x5687, 0x21B7,
+ 0x5688, 0x568B, 0x2BA2, 0x568C, 0x568C, 0x2375, 0x568D, 0x568D, 0x2BA6,
+ 0x568E, 0x568E, 0x0776, 0x568F, 0x568F, 0x0E3A, 0x5690, 0x5692, 0x2BA7,
+ 0x5693, 0x5693, 0x1590, 0x5694, 0x5694, 0x2BAA, 0x5695, 0x5695, 0x2382,
+ 0x5696, 0x5698, 0x2BAB, 0x5699, 0x5699, 0x209E, 0x569A, 0x56A2, 0x2BAE,
+ 0x56A3, 0x56A3, 0x0F66, 0x56A4, 0x56A5, 0x2BB7, 0x56A6, 0x56A6, 0x236B,
+ 0x56A7, 0x56A7, 0x2BB9, 0x56A8, 0x56A8, 0x2039, 0x56A9, 0x56AD, 0x2BBA,
+ 0x56AE, 0x56AE, 0x269F, 0x56AF, 0x56AF, 0x1591, 0x56B0, 0x56B2, 0x2BBF,
+ 0x56B3, 0x56B3, 0x237D, 0x56B4, 0x56B4, 0x21F5, 0x56B5, 0x56B5, 0x2BC2,
+ 0x56B6, 0x56B6, 0x2381, 0x56B7, 0x56B7, 0x0C9D, 0x56B8, 0x56BB, 0x2BC3,
+ 0x56BC, 0x56BC, 0x0891, 0x56BD, 0x56BF, 0x2BC7, 0x56C0, 0x56C0, 0x237B,
+ 0x56C1, 0x56C1, 0x237E, 0x56C2, 0x56C2, 0x21CC, 0x56C3, 0x56C4, 0x2BCA,
+ 0x56C5, 0x56C5, 0x22DB, 0x56C6, 0x56C7, 0x2BCC, 0x56C8, 0x56C8, 0x236A,
+ 0x56C9, 0x56C9, 0x2689, 0x56CA, 0x56CA, 0x0B35, 0x56CB, 0x56CB, 0x2BCE,
+ 0x56CC, 0x56CC, 0x2697, 0x56CD, 0x56D0, 0x2BCF, 0x56D1, 0x56D1, 0x22A1,
+ 0x56D2, 0x56D3, 0x2BD3, 0x56D4, 0x56D4, 0x1592, 0x56D5, 0x56D6, 0x2BD5,
+ 0x56D7, 0x56D7, 0x1593, 0x56D8, 0x56D9, 0x2BD7, 0x56DA, 0x56DA, 0x0C71,
+ 0x56DB, 0x56DB, 0x0DB9, 0x56DC, 0x56DC, 0x2BD9, 0x56DD, 0x56DD, 0x1594,
+ 0x56DE, 0x56DE, 0x07ED, 0x56DF, 0x56DF, 0x126C, 0x56E0, 0x56E0, 0x1079,
+ 0x56E1, 0x56E1, 0x1595, 0x56E2, 0x56E2, 0x0E76, 0x56E3, 0x56E3, 0x2BDA,
+ 0x56E4, 0x56E4, 0x0619, 0x56E5, 0x56EA, 0x2BDB, 0x56EB, 0x56EB, 0x1597,
+ 0x56EC, 0x56EC, 0x2BE1, 0x56ED, 0x56ED, 0x10F3, 0x56EE, 0x56EF, 0x2BE2,
+ 0x56F0, 0x56F0, 0x0992, 0x56F1, 0x56F1, 0x0554, 0x56F2, 0x56F3, 0x2BE4,
+ 0x56F4, 0x56F4, 0x0EB6, 0x56F5, 0x56F5, 0x1596, 0x56F6, 0x56F8, 0x2BE6,
+ 0x56F9, 0x56F9, 0x1598, 0x56FA, 0x56FA, 0x0725, 0x56FB, 0x56FC, 0x2BE9,
+ 0x56FD, 0x56FD, 0x0753, 0x56FE, 0x56FE, 0x0E6D, 0x56FF, 0x56FF, 0x1599,
+ 0x5700, 0x5702, 0x2BEB, 0x5703, 0x5703, 0x0BF3, 0x5704, 0x5704, 0x159A,
+ 0x5705, 0x5705, 0x2BEE, 0x5706, 0x5706, 0x10F5, 0x5707, 0x5707, 0x2383,
+ 0x5708, 0x5708, 0x0C81, 0x5709, 0x5709, 0x159C, 0x570A, 0x570A, 0x159B,
+ 0x570B, 0x570B, 0x1F3D, 0x570C, 0x570C, 0x2BEF, 0x570D, 0x570D, 0x218F,
+ 0x570E, 0x5711, 0x2BF0, 0x5712, 0x5712, 0x2246, 0x5713, 0x5713, 0x2248,
+ 0x5714, 0x5715, 0x2BF4, 0x5716, 0x5716, 0x217E, 0x5717, 0x5717, 0x2BF6,
+ 0x5718, 0x5718, 0x2180, 0x5719, 0x571B, 0x2BF7, 0x571C, 0x571C, 0x159D,
+ 0x571D, 0x571E, 0x2BFA, 0x571F, 0x571F, 0x0E72, 0x5720, 0x5722, 0x2BFC,
+ 0x5723, 0x5723, 0x0D3C, 0x5724, 0x5727, 0x2BFF, 0x5728, 0x5728, 0x111D,
+ 0x5729, 0x5729, 0x13A7, 0x572A, 0x572A, 0x13A9, 0x572B, 0x572B, 0x2C03,
+ 0x572C, 0x572C, 0x13A8, 0x572D, 0x572D, 0x0740, 0x572E, 0x572F, 0x13AC,
+ 0x5730, 0x5730, 0x05B9, 0x5731, 0x5732, 0x2C04, 0x5733, 0x5733, 0x13AA,
+ 0x5734, 0x5738, 0x2C06, 0x5739, 0x5739, 0x13AB, 0x573A, 0x573A, 0x04C6,
+ 0x573B, 0x573B, 0x13AF, 0x573C, 0x573D, 0x2C0B, 0x573E, 0x573E, 0x080D,
+ 0x573F, 0x573F, 0x2C0D, 0x5740, 0x5740, 0x11B6, 0x5741, 0x5741, 0x2C0E,
+ 0x5742, 0x5742, 0x13B0, 0x5743, 0x5746, 0x2C0F, 0x5747, 0x5747, 0x0928,
+ 0x5748, 0x5749, 0x2C13, 0x574A, 0x574A, 0x0658, 0x574B, 0x574B, 0x2C15,
+ 0x574C, 0x574C, 0x13A0, 0x574D, 0x574D, 0x0E01, 0x574E, 0x574E, 0x093F,
+ 0x574F, 0x574F, 0x07CA, 0x5750, 0x5750, 0x1255, 0x5751, 0x5751, 0x0960,
+ 0x5752, 0x5756, 0x2C16, 0x5757, 0x5757, 0x0976, 0x5758, 0x5759, 0x2C1B,
+ 0x575A, 0x575A, 0x0854, 0x575B, 0x575B, 0x0E06, 0x575C, 0x575C, 0x13AE,
+ 0x575D, 0x575D, 0x03DE, 0x575E, 0x575E, 0x0EFA, 0x575F, 0x575F, 0x0675,
+ 0x5760, 0x5760, 0x1216, 0x5761, 0x5761, 0x0BE1, 0x5762, 0x5763, 0x2C1D,
+ 0x5764, 0x5764, 0x098F, 0x5765, 0x5765, 0x2C1F, 0x5766, 0x5766, 0x0E0C,
+ 0x5767, 0x5767, 0x2C20, 0x5768, 0x5768, 0x13B7, 0x5769, 0x5769, 0x13B1,
+ 0x576A, 0x576A, 0x0BD9, 0x576B, 0x576B, 0x13B3, 0x576C, 0x576C, 0x2C21,
+ 0x576D, 0x576D, 0x13B8, 0x576E, 0x576E, 0x2C22, 0x576F, 0x576F, 0x0BB8,
+ 0x5770, 0x5772, 0x2C23, 0x5773, 0x5773, 0x13BA, 0x5774, 0x5775, 0x2C26,
+ 0x5776, 0x5776, 0x13B9, 0x5777, 0x5777, 0x094D, 0x5778, 0x577A, 0x2C28,
+ 0x577B, 0x577B, 0x13B6, 0x577C, 0x577C, 0x13B5, 0x577D, 0x5781, 0x2C2B,
+ 0x5782, 0x5782, 0x053C, 0x5783, 0x5783, 0x0997, 0x5784, 0x5784, 0x0A49,
+ 0x5785, 0x5785, 0x13B2, 0x5786, 0x5786, 0x13B4, 0x5787, 0x578A, 0x2C30,
+ 0x578B, 0x578B, 0x0F98, 0x578C, 0x578C, 0x13BD, 0x578D, 0x5791, 0x2C34,
+ 0x5792, 0x5792, 0x09C8, 0x5793, 0x5793, 0x13C2, 0x5794, 0x579A, 0x2C39,
+ 0x579B, 0x579B, 0x0621, 0x579C, 0x579F, 0x2C40, 0x57A0, 0x57A0, 0x13C3,
+ 0x57A1, 0x57A1, 0x13A2, 0x57A2, 0x57A2, 0x0711, 0x57A3, 0x57A3, 0x10EE,
+ 0x57A4, 0x57A4, 0x13BC, 0x57A5, 0x57A5, 0x2C44, 0x57A6, 0x57A6, 0x095E,
+ 0x57A7, 0x57A7, 0x13C0, 0x57A8, 0x57A8, 0x2C45, 0x57A9, 0x57A9, 0x13A1,
+ 0x57AA, 0x57AA, 0x2C46, 0x57AB, 0x57AB, 0x05C7, 0x57AC, 0x57AC, 0x2C47,
+ 0x57AD, 0x57AD, 0x13BB, 0x57AE, 0x57AE, 0x0972, 0x57AF, 0x57B1, 0x2C48,
+ 0x57B2, 0x57B2, 0x13BE, 0x57B3, 0x57B3, 0x2C4B, 0x57B4, 0x57B4, 0x13C1,
+ 0x57B5, 0x57B7, 0x2C4C, 0x57B8, 0x57B8, 0x13C9, 0x57B9, 0x57C1, 0x2C4F,
+ 0x57C2, 0x57C2, 0x06FA, 0x57C3, 0x57C3, 0x03AE, 0x57C4, 0x57CA, 0x2C58,
+ 0x57CB, 0x57CB, 0x0A98, 0x57CC, 0x57CD, 0x2C5F, 0x57CE, 0x57CE, 0x04EC,
+ 0x57CF, 0x57CF, 0x13BF, 0x57D0, 0x57D1, 0x2C61, 0x57D2, 0x57D2, 0x13C8,
+ 0x57D3, 0x57D3, 0x2C63, 0x57D4, 0x57D4, 0x0BF1, 0x57D5, 0x57D5, 0x13C4,
+ 0x57D6, 0x57D7, 0x2C64, 0x57D8, 0x57D8, 0x13C5, 0x57D9, 0x57D9, 0x13C7,
+ 0x57DA, 0x57DA, 0x13C6, 0x57DB, 0x57DC, 0x2C66, 0x57DD, 0x57DD, 0x13CE,
+ 0x57DE, 0x57DE, 0x2C68, 0x57DF, 0x57DF, 0x10D7, 0x57E0, 0x57E0, 0x0481,
+ 0x57E1, 0x57E1, 0x232A, 0x57E2, 0x57E3, 0x2C69, 0x57E4, 0x57E4, 0x13CD,
+ 0x57E5, 0x57EC, 0x2C6B, 0x57ED, 0x57ED, 0x13D2, 0x57EE, 0x57EE, 0x2C73,
+ 0x57EF, 0x57EF, 0x13CB, 0x57F0, 0x57F3, 0x2C74, 0x57F4, 0x57F4, 0x13CA,
+ 0x57F5, 0x57F6, 0x2C78, 0x57F7, 0x57F7, 0x228B, 0x57F8, 0x57F8, 0x13CC,
+ 0x57F9, 0x57F9, 0x0BA1, 0x57FA, 0x57FA, 0x080E, 0x57FB, 0x57FC, 0x2C7A,
+ 0x57FD, 0x57FD, 0x13D1, 0x57FE, 0x57FF, 0x2C7C, 0x5800, 0x5800, 0x13D3,
+ 0x5801, 0x5801, 0x2C7E, 0x5802, 0x5802, 0x0E16, 0x5803, 0x5804, 0x2C7F,
+ 0x5805, 0x5805, 0x1F85, 0x5806, 0x5806, 0x0610, 0x5807, 0x5807, 0x144C,
+ 0x5808, 0x5809, 0x2C81, 0x580A, 0x580A, 0x2325, 0x580B, 0x580B, 0x13CF,
+ 0x580C, 0x580C, 0x2C83, 0x580D, 0x580D, 0x13D0, 0x580E, 0x5810, 0x2C84,
+ 0x5811, 0x5811, 0x0C32, 0x5812, 0x5814, 0x2C87, 0x5815, 0x5815, 0x0628,
+ 0x5816, 0x5816, 0x232C, 0x5817, 0x5818, 0x2C8A, 0x5819, 0x5819, 0x13D5,
+ 0x581A, 0x581C, 0x2C8C, 0x581D, 0x581D, 0x232E, 0x581E, 0x581E, 0x13D4,
+ 0x581F, 0x581F, 0x2C8F, 0x5820, 0x5820, 0x13D7, 0x5821, 0x5821, 0x040D,
+ 0x5822, 0x5823, 0x2C90, 0x5824, 0x5824, 0x05AD, 0x5825, 0x5829, 0x2C92,
+ 0x582A, 0x582A, 0x093D, 0x582B, 0x582E, 0x2C97, 0x582F, 0x582F, 0x2205,
+ 0x5830, 0x5830, 0x1008, 0x5831, 0x5831, 0x1E38, 0x5832, 0x5833, 0x2C9B,
+ 0x5834, 0x5834, 0x1E73, 0x5835, 0x5835, 0x0601, 0x5836, 0x5843, 0x2C9D,
+ 0x5844, 0x5844, 0x13D6, 0x5845, 0x5849, 0x2CAB, 0x584A, 0x584A, 0x1FE3,
+ 0x584B, 0x584B, 0x2339, 0x584C, 0x584C, 0x0DEF, 0x584D, 0x584D, 0x19A3,
+ 0x584E, 0x584E, 0x2CB0, 0x584F, 0x584F, 0x232B, 0x5850, 0x5850, 0x2CB1,
+ 0x5851, 0x5851, 0x0DD1, 0x5852, 0x5852, 0x232D, 0x5853, 0x5853, 0x2CB2,
+ 0x5854, 0x5854, 0x0DF3, 0x5855, 0x5856, 0x2CB3, 0x5857, 0x5857, 0x217F,
+ 0x5858, 0x5858, 0x0E14, 0x5859, 0x585D, 0x2CB5, 0x585E, 0x585E, 0x0CD6,
+ 0x585F, 0x5861, 0x2CBA, 0x5862, 0x5862, 0x21A7, 0x5863, 0x5863, 0x2CBD,
+ 0x5864, 0x5864, 0x232F, 0x5865, 0x5865, 0x13D8, 0x5866, 0x586A, 0x2CBE,
+ 0x586B, 0x586B, 0x0E41, 0x586C, 0x586C, 0x13D9, 0x586D, 0x5874, 0x2CC3,
+ 0x5875, 0x5875, 0x1E7D, 0x5876, 0x5878, 0x2CCB, 0x5879, 0x5879, 0x20D6,
+ 0x587A, 0x587D, 0x2CCE, 0x587E, 0x587E, 0x13A3, 0x587F, 0x587F, 0x2CD2,
+ 0x5880, 0x5880, 0x13DD, 0x5881, 0x5881, 0x13DA, 0x5882, 0x5882, 0x2CD3,
+ 0x5883, 0x5883, 0x08E2, 0x5884, 0x5884, 0x2CD4, 0x5885, 0x5885, 0x0D92,
+ 0x5886, 0x5888, 0x2CD5, 0x5889, 0x5889, 0x13DB, 0x588A, 0x588A, 0x1EC2,
+ 0x588B, 0x5891, 0x2CD8, 0x5892, 0x5892, 0x0D03, 0x5893, 0x5893, 0x0B1C,
+ 0x5894, 0x5898, 0x2CDF, 0x5899, 0x5899, 0x0C3A, 0x589A, 0x589A, 0x13DC,
+ 0x589B, 0x589B, 0x2CE4, 0x589C, 0x589C, 0x22B2, 0x589D, 0x589D, 0x2CE5,
+ 0x589E, 0x589E, 0x1139, 0x589F, 0x589F, 0x0FB1, 0x58A0, 0x58A7, 0x2CE6,
+ 0x58A8, 0x58A8, 0x0B0E, 0x58A9, 0x58A9, 0x0614, 0x58AA, 0x58AD, 0x2CEE,
+ 0x58AE, 0x58AE, 0x1EDF, 0x58AF, 0x58B2, 0x2CF2, 0x58B3, 0x58B3, 0x1EF9,
+ 0x58B4, 0x58BA, 0x2CF6, 0x58BB, 0x58BB, 0x20D9, 0x58BC, 0x58BC, 0x13A4,
+ 0x58BD, 0x58BD, 0x2CFD, 0x58BE, 0x58BE, 0x1FDD, 0x58BF, 0x58C0, 0x2CFE,
+ 0x58C1, 0x58C1, 0x0443, 0x58C2, 0x58C4, 0x2D00, 0x58C5, 0x58C5, 0x13A5,
+ 0x58C6, 0x58C6, 0x2D03, 0x58C7, 0x58C7, 0x2167, 0x58C8, 0x58D0, 0x2D04,
+ 0x58D1, 0x58D1, 0x13A6, 0x58D2, 0x58D2, 0x2D0D, 0x58D3, 0x58D3, 0x21ED,
+ 0x58D4, 0x58D4, 0x2D0E, 0x58D5, 0x58D5, 0x0775, 0x58D6, 0x58D7, 0x2D0F,
+ 0x58D8, 0x58D8, 0x2007, 0x58D9, 0x58D9, 0x2326, 0x58DA, 0x58DA, 0x2329,
+ 0x58DB, 0x58DD, 0x2D11, 0x58DE, 0x58DE, 0x1F52, 0x58DF, 0x58DF, 0x203B,
+ 0x58E0, 0x58E0, 0x2328, 0x58E1, 0x58E1, 0x2D14, 0x58E2, 0x58E2, 0x2327,
+ 0x58E3, 0x58E3, 0x2D15, 0x58E4, 0x58E4, 0x0C9B, 0x58E5, 0x58E8, 0x2D16,
+ 0x58E9, 0x58E9, 0x1E2B, 0x58EA, 0x58EA, 0x2D1A, 0x58EB, 0x58EB, 0x0D56,
+ 0x58EC, 0x58EC, 0x0CA4, 0x58ED, 0x58ED, 0x2D1B, 0x58EE, 0x58EE, 0x1210,
+ 0x58EF, 0x58EF, 0x22AE, 0x58F0, 0x58F0, 0x0D32, 0x58F1, 0x58F2, 0x2D1C,
+ 0x58F3, 0x58F3, 0x0954, 0x58F4, 0x58F5, 0x2D1E, 0x58F6, 0x58F6, 0x07AF,
+ 0x58F7, 0x58F8, 0x2D20, 0x58F9, 0x58F9, 0x1043, 0x58FA, 0x58FA, 0x1F49,
+ 0x58FB, 0x58FC, 0x2D22, 0x58FD, 0x58FD, 0x2138, 0x58FE, 0x58FF, 0x2D24,
+ 0x5900, 0x5901, 0x2D26, 0x5902, 0x5902, 0x161C, 0x5903, 0x5903, 0x2D28,
+ 0x5904, 0x5904, 0x0529, 0x5905, 0x5906, 0x2D29, 0x5907, 0x5907, 0x0421,
+ 0x5908, 0x590C, 0x2D2B, 0x590D, 0x590D, 0x06AF, 0x590E, 0x590E, 0x2D30,
+ 0x590F, 0x590F, 0x0F31, 0x5910, 0x5913, 0x2D31, 0x5914, 0x5914, 0x12FB,
+ 0x5915, 0x5915, 0x0F13, 0x5916, 0x5916, 0x0E93, 0x5917, 0x5918, 0x2D35,
+ 0x5919, 0x5919, 0x1301, 0x591A, 0x591A, 0x061F, 0x591B, 0x591B, 0x2D37,
+ 0x591C, 0x591C, 0x1040, 0x591D, 0x591E, 0x2D38, 0x591F, 0x591F, 0x0714,
+ 0x5920, 0x5921, 0x2D3A, 0x5922, 0x5922, 0x2081, 0x5923, 0x5923, 0x2D3C,
+ 0x5924, 0x5924, 0x161B, 0x5925, 0x5925, 0x1619, 0x5926, 0x5926, 0x2D3D,
+ 0x5927, 0x5927, 0x0576, 0x5928, 0x5928, 0x2D3E, 0x5929, 0x5929, 0x0E3F,
+ 0x592A, 0x592A, 0x0DFE, 0x592B, 0x592B, 0x068F, 0x592C, 0x592C, 0x2D3F,
+ 0x592D, 0x592D, 0x1268, 0x592E, 0x592E, 0x1014, 0x592F, 0x592F, 0x0772,
+ 0x5930, 0x5930, 0x2D40, 0x5931, 0x5931, 0x0D3E, 0x5932, 0x5933, 0x2D41,
+ 0x5934, 0x5934, 0x0E68, 0x5935, 0x5936, 0x2D43, 0x5937, 0x5937, 0x104B,
+ 0x5938, 0x5938, 0x0971, 0x5939, 0x5939, 0x0843, 0x593A, 0x593A, 0x0620,
+ 0x593B, 0x593B, 0x2D45, 0x593C, 0x593C, 0x14AF, 0x593D, 0x593D, 0x2D46,
+ 0x593E, 0x593E, 0x1F7C, 0x593F, 0x5940, 0x2D47, 0x5941, 0x5941, 0x14B0,
+ 0x5942, 0x5942, 0x138C, 0x5943, 0x5943, 0x2D49, 0x5944, 0x5944, 0x1002,
+ 0x5945, 0x5946, 0x2D4A, 0x5947, 0x5947, 0x0C05, 0x5948, 0x5948, 0x0B31,
+ 0x5949, 0x5949, 0x068B, 0x594A, 0x594A, 0x2D4C, 0x594B, 0x594B, 0x0679,
+ 0x594C, 0x594D, 0x2D4D, 0x594E, 0x594E, 0x0989, 0x594F, 0x594F, 0x123D,
+ 0x5950, 0x5950, 0x2D4F, 0x5951, 0x5951, 0x0C14, 0x5952, 0x5953, 0x2D50,
+ 0x5954, 0x5954, 0x0425, 0x5955, 0x5955, 0x14B2, 0x5956, 0x5956, 0x0882,
+ 0x5957, 0x5957, 0x0E2A, 0x5958, 0x5958, 0x14B4, 0x5959, 0x5959, 0x2D52,
+ 0x595A, 0x595A, 0x14B3, 0x595B, 0x595F, 0x2D53, 0x5960, 0x5960, 0x05CD,
+ 0x5961, 0x5961, 0x2D58, 0x5962, 0x5962, 0x0D16, 0x5963, 0x5964, 0x2D59,
+ 0x5965, 0x5965, 0x03CD, 0x5966, 0x5968, 0x2D5B, 0x5969, 0x5969, 0x235B,
+ 0x596A, 0x596A, 0x1EDE, 0x596B, 0x596B, 0x2D5E, 0x596C, 0x596C, 0x1FA2,
+ 0x596D, 0x596D, 0x2D5F, 0x596E, 0x596E, 0x1EFA, 0x596F, 0x5972, 0x2D60,
+ 0x5973, 0x5973, 0x0B6F, 0x5974, 0x5974, 0x0B6C, 0x5975, 0x5975, 0x2D64,
+ 0x5976, 0x5976, 0x0B2F, 0x5977, 0x5977, 0x2D65, 0x5978, 0x5978, 0x085C,
+ 0x5979, 0x5979, 0x0DF2, 0x597A, 0x597C, 0x2D66, 0x597D, 0x597D, 0x077A,
+ 0x597E, 0x5980, 0x2D69, 0x5981, 0x5981, 0x1775, 0x5982, 0x5982, 0x0CC2,
+ 0x5983, 0x5983, 0x1776, 0x5984, 0x5984, 0x0EAE, 0x5985, 0x5985, 0x2D6C,
+ 0x5986, 0x5986, 0x120E, 0x5987, 0x5987, 0x06B9, 0x5988, 0x5988, 0x0A8F,
+ 0x5989, 0x5989, 0x2D6D, 0x598A, 0x598A, 0x0CAC, 0x598B, 0x598C, 0x2D6E,
+ 0x598D, 0x598D, 0x1777, 0x598E, 0x5991, 0x2D70, 0x5992, 0x5992, 0x0609,
+ 0x5993, 0x5993, 0x083E, 0x5994, 0x5995, 0x2D74, 0x5996, 0x5996, 0x1026,
+ 0x5997, 0x5997, 0x177B, 0x5998, 0x5998, 0x2D76, 0x5999, 0x5999, 0x0AF3,
+ 0x599A, 0x599C, 0x2D77, 0x599D, 0x599D, 0x22AD, 0x599E, 0x599E, 0x177E,
+ 0x599F, 0x59A2, 0x2D7A, 0x59A3, 0x59A3, 0x177A, 0x59A4, 0x59A4, 0x177F,
+ 0x59A5, 0x59A5, 0x0E88, 0x59A6, 0x59A7, 0x2D7E, 0x59A8, 0x59A8, 0x065E,
+ 0x59A9, 0x59AA, 0x1778, 0x59AB, 0x59AB, 0x177D, 0x59AC, 0x59AD, 0x2D80,
+ 0x59AE, 0x59AE, 0x0B40, 0x59AF, 0x59AF, 0x1782, 0x59B0, 0x59B1, 0x2D82,
+ 0x59B2, 0x59B2, 0x1781, 0x59B3, 0x59B8, 0x2D84, 0x59B9, 0x59B9, 0x0AC8,
+ 0x59BA, 0x59BA, 0x2D8A, 0x59BB, 0x59BB, 0x0BFD, 0x59BC, 0x59BD, 0x2D8B,
+ 0x59BE, 0x59BE, 0x1784, 0x59BF, 0x59C5, 0x2D8D, 0x59C6, 0x59C6, 0x0B1A,
+ 0x59C7, 0x59C9, 0x2D94, 0x59CA, 0x59CA, 0x177C, 0x59CB, 0x59CB, 0x0D53,
+ 0x59CC, 0x59CF, 0x2D97, 0x59D0, 0x59D0, 0x08B4, 0x59D1, 0x59D1, 0x071C,
+ 0x59D2, 0x59D2, 0x1780, 0x59D3, 0x59D3, 0x0FA0, 0x59D4, 0x59D4, 0x0EBE,
+ 0x59D5, 0x59D6, 0x2D9B, 0x59D7, 0x59D7, 0x1783, 0x59D8, 0x59D8, 0x178A,
+ 0x59D9, 0x59D9, 0x2D9D, 0x59DA, 0x59DA, 0x102D, 0x59DB, 0x59DB, 0x2D9E,
+ 0x59DC, 0x59DC, 0x087B, 0x59DD, 0x59DD, 0x1787, 0x59DE, 0x59E2, 0x2D9F,
+ 0x59E3, 0x59E3, 0x1789, 0x59E4, 0x59E4, 0x2DA4, 0x59E5, 0x59E5, 0x09BC,
+ 0x59E6, 0x59E7, 0x2DA5, 0x59E8, 0x59E8, 0x1053, 0x59E9, 0x59EB, 0x2DA7,
+ 0x59EC, 0x59EC, 0x081A, 0x59ED, 0x59F8, 0x2DAA, 0x59F9, 0x59F9, 0x178B,
+ 0x59FA, 0x59FA, 0x2DB6, 0x59FB, 0x59FB, 0x107D, 0x59FC, 0x59FE, 0x2DB7,
+ 0x59FF, 0x59FF, 0x1228, 0x5A00, 0x5A00, 0x2DBA, 0x5A01, 0x5A01, 0x0EAF,
+ 0x5A02, 0x5A02, 0x2DBB, 0x5A03, 0x5A03, 0x0E8F, 0x5A04, 0x5A04, 0x0A4D,
+ 0x5A05, 0x5A06, 0x1785, 0x5A07, 0x5A07, 0x0890, 0x5A08, 0x5A08, 0x1788,
+ 0x5A09, 0x5A09, 0x178D, 0x5A0A, 0x5A0B, 0x2DBC, 0x5A0C, 0x5A0C, 0x178C,
+ 0x5A0D, 0x5A10, 0x2DBE, 0x5A11, 0x5A11, 0x1790, 0x5A12, 0x5A12, 0x2DC2,
+ 0x5A13, 0x5A13, 0x1792, 0x5A14, 0x5A17, 0x2DC3, 0x5A18, 0x5A18, 0x0B52,
+ 0x5A19, 0x5A1B, 0x2DC7, 0x5A1C, 0x5A1C, 0x0B2B, 0x5A1D, 0x5A1E, 0x2DCA,
+ 0x5A1F, 0x5A1F, 0x0919, 0x5A20, 0x5A20, 0x0D28, 0x5A21, 0x5A22, 0x2DCC,
+ 0x5A23, 0x5A23, 0x1791, 0x5A24, 0x5A24, 0x2DCE, 0x5A25, 0x5A25, 0x062F,
+ 0x5A26, 0x5A28, 0x2DCF, 0x5A29, 0x5A29, 0x0AE9, 0x5A2A, 0x5A30, 0x2DD2,
+ 0x5A31, 0x5A31, 0x10CE, 0x5A32, 0x5A32, 0x178E, 0x5A33, 0x5A33, 0x2DD9,
+ 0x5A34, 0x5A34, 0x178F, 0x5A35, 0x5A35, 0x2DDA, 0x5A36, 0x5A36, 0x0C7D,
+ 0x5A37, 0x5A3B, 0x2DDB, 0x5A3C, 0x5A3C, 0x1797, 0x5A3D, 0x5A3F, 0x2DE0,
+ 0x5A40, 0x5A40, 0x1793, 0x5A41, 0x5A41, 0x203F, 0x5A42, 0x5A45, 0x2DE3,
+ 0x5A46, 0x5A46, 0x0BE4, 0x5A47, 0x5A48, 0x2DE7, 0x5A49, 0x5A49, 0x0EA2,
+ 0x5A4A, 0x5A4A, 0x1795, 0x5A4B, 0x5A54, 0x2DE9, 0x5A55, 0x5A55, 0x1796,
+ 0x5A56, 0x5A59, 0x2DF3, 0x5A5A, 0x5A5A, 0x07FE, 0x5A5B, 0x5A61, 0x2DF7,
+ 0x5A62, 0x5A62, 0x1798, 0x5A63, 0x5A65, 0x2DFE, 0x5A66, 0x5A66, 0x1F0E,
+ 0x5A67, 0x5A67, 0x1794, 0x5A68, 0x5A69, 0x2E01, 0x5A6A, 0x5A6A, 0x09A2,
+ 0x5A6B, 0x5A6C, 0x2E03, 0x5A6D, 0x5A6D, 0x23F9, 0x5A6E, 0x5A73, 0x2E05,
+ 0x5A74, 0x5A74, 0x1089, 0x5A75, 0x5A75, 0x1799, 0x5A76, 0x5A76, 0x0D2D,
+ 0x5A77, 0x5A77, 0x179D, 0x5A78, 0x5A79, 0x2E0B, 0x5A7A, 0x5A7A, 0x179E,
+ 0x5A7B, 0x5A7E, 0x2E0D, 0x5A7F, 0x5A7F, 0x0FC1, 0x5A80, 0x5A91, 0x2E11,
+ 0x5A92, 0x5A92, 0x0AC2, 0x5A93, 0x5A99, 0x2E23, 0x5A9A, 0x5A9A, 0x0AC9,
+ 0x5A9B, 0x5A9B, 0x179C, 0x5A9C, 0x5AA6, 0x2E2A, 0x5AA7, 0x5AA7, 0x23FC,
+ 0x5AA8, 0x5AA9, 0x2E35, 0x5AAA, 0x5AAA, 0x179B, 0x5AAB, 0x5AB1, 0x2E37,
+ 0x5AB2, 0x5AB2, 0x17A1, 0x5AB3, 0x5AB3, 0x0F1E, 0x5AB4, 0x5AB4, 0x2E3E,
+ 0x5AB5, 0x5AB5, 0x19A4, 0x5AB6, 0x5AB7, 0x2E3F, 0x5AB8, 0x5AB8, 0x17A4,
+ 0x5AB9, 0x5ABC, 0x2E41, 0x5ABD, 0x5ABD, 0x2069, 0x5ABE, 0x5ABE, 0x179F,
+ 0x5ABF, 0x5AC0, 0x2E45, 0x5AC1, 0x5AC1, 0x0851, 0x5AC2, 0x5AC2, 0x0CE2,
+ 0x5AC3, 0x5AC8, 0x2E47, 0x5AC9, 0x5AC9, 0x0828, 0x5ACA, 0x5ACB, 0x2E4D,
+ 0x5ACC, 0x5ACC, 0x0F40, 0x5ACD, 0x5AD1, 0x2E4F, 0x5AD2, 0x5AD2, 0x17A2,
+ 0x5AD3, 0x5AD3, 0x2E54, 0x5AD4, 0x5AD4, 0x17A3, 0x5AD5, 0x5AD5, 0x2E55,
+ 0x5AD6, 0x5AD6, 0x17A8, 0x5AD7, 0x5AD7, 0x23F7, 0x5AD8, 0x5AD8, 0x17AA,
+ 0x5AD9, 0x5ADB, 0x2E56, 0x5ADC, 0x5ADC, 0x17AB, 0x5ADD, 0x5ADF, 0x2E59,
+ 0x5AE0, 0x5AE0, 0x17A5, 0x5AE1, 0x5AE1, 0x05B6, 0x5AE2, 0x5AE2, 0x2E5C,
+ 0x5AE3, 0x5AE3, 0x17A6, 0x5AE4, 0x5AE5, 0x2E5D, 0x5AE6, 0x5AE6, 0x17A9,
+ 0x5AE7, 0x5AE8, 0x2E5F, 0x5AE9, 0x5AE9, 0x0B3E, 0x5AEA, 0x5AEA, 0x2E61,
+ 0x5AEB, 0x5AEB, 0x17A0, 0x5AEC, 0x5AF0, 0x2E62, 0x5AF1, 0x5AF1, 0x17A7,
+ 0x5AF2, 0x5AF4, 0x2E67, 0x5AF5, 0x5AF5, 0x23F6, 0x5AF6, 0x5AFA, 0x2E6A,
+ 0x5AFB, 0x5AFB, 0x23FD, 0x5AFC, 0x5AFF, 0x2E6F, 0x5B00, 0x5B00, 0x23F8,
+ 0x5B01, 0x5B07, 0x2E73, 0x5B08, 0x5B08, 0x23FA, 0x5B09, 0x5B09, 0x17AC,
+ 0x5B0A, 0x5B0A, 0x2E7A, 0x5B0B, 0x5B0B, 0x23FE, 0x5B0C, 0x5B0C, 0x1FA8,
+ 0x5B0D, 0x5B15, 0x2E7B, 0x5B16, 0x5B16, 0x17AE, 0x5B17, 0x5B17, 0x17AD,
+ 0x5B18, 0x5B18, 0x2E84, 0x5B19, 0x5B19, 0x2401, 0x5B1A, 0x5B20, 0x2E85,
+ 0x5B21, 0x5B21, 0x23FF, 0x5B22, 0x5B29, 0x2E8C, 0x5B2A, 0x5B2A, 0x2400,
+ 0x5B2B, 0x5B2F, 0x2E94, 0x5B30, 0x5B30, 0x2221, 0x5B31, 0x5B31, 0x2E99,
+ 0x5B32, 0x5B32, 0x17AF, 0x5B33, 0x5B33, 0x2E9A, 0x5B34, 0x5B34, 0x130C,
+ 0x5B35, 0x5B36, 0x2E9B, 0x5B37, 0x5B37, 0x17B0, 0x5B38, 0x5B38, 0x2122,
+ 0x5B39, 0x5B3F, 0x2E9D, 0x5B40, 0x5B40, 0x17B1, 0x5B41, 0x5B4B, 0x2EA4,
+ 0x5B4C, 0x5B4C, 0x23FB, 0x5B4D, 0x5B4F, 0x2EAF, 0x5B50, 0x5B50, 0x1230,
+ 0x5B51, 0x5B51, 0x17B7, 0x5B52, 0x5B52, 0x2EB2, 0x5B53, 0x5B53, 0x17B8,
+ 0x5B54, 0x5B54, 0x0964, 0x5B55, 0x5B55, 0x1113, 0x5B56, 0x5B56, 0x2EB3,
+ 0x5B57, 0x5B57, 0x1233, 0x5B58, 0x5B58, 0x0569, 0x5B59, 0x5B59, 0x0DE4,
+ 0x5B5A, 0x5B5A, 0x17B4, 0x5B5B, 0x5B5B, 0x1279, 0x5B5C, 0x5B5C, 0x122B,
+ 0x5B5D, 0x5B5D, 0x0F6D, 0x5B5E, 0x5B5E, 0x2EB4, 0x5B5F, 0x5B5F, 0x0AD4,
+ 0x5B60, 0x5B61, 0x2EB5, 0x5B62, 0x5B62, 0x17B9, 0x5B63, 0x5B63, 0x0831,
+ 0x5B64, 0x5B64, 0x071B, 0x5B65, 0x5B65, 0x17B5, 0x5B66, 0x5B66, 0x0FD0,
+ 0x5B67, 0x5B68, 0x2EB7, 0x5B69, 0x5B69, 0x0759, 0x5B6A, 0x5B6A, 0x0A76,
+ 0x5B6B, 0x5B6B, 0x215A, 0x5B6C, 0x5B6C, 0x1261, 0x5B6D, 0x5B6F, 0x2EB9,
+ 0x5B70, 0x5B70, 0x0D82, 0x5B71, 0x5B71, 0x176A, 0x5B72, 0x5B72, 0x2EBC,
+ 0x5B73, 0x5B73, 0x17B6, 0x5B74, 0x5B74, 0x2EBD, 0x5B75, 0x5B75, 0x0692,
+ 0x5B76, 0x5B77, 0x2EBE, 0x5B78, 0x5B78, 0x21E5, 0x5B79, 0x5B79, 0x2EC0,
+ 0x5B7A, 0x5B7A, 0x0CC1, 0x5B7B, 0x5B7C, 0x2EC1, 0x5B7D, 0x5B7D, 0x0B58,
+ 0x5B7E, 0x5B7E, 0x2EC3, 0x5B7F, 0x5B7F, 0x2057, 0x5B80, 0x5B80, 0x172E,
+ 0x5B81, 0x5B81, 0x0B61, 0x5B82, 0x5B82, 0x2EC4, 0x5B83, 0x5B83, 0x0DF1,
+ 0x5B84, 0x5B84, 0x172F, 0x5B85, 0x5B85, 0x114D, 0x5B86, 0x5B86, 0x2EC5,
+ 0x5B87, 0x5B87, 0x10D3, 0x5B88, 0x5B88, 0x0D6F, 0x5B89, 0x5B89, 0x03BD,
+ 0x5B8A, 0x5B8A, 0x2EC6, 0x5B8B, 0x5B8B, 0x0DC3, 0x5B8C, 0x5B8C, 0x0E9B,
+ 0x5B8D, 0x5B8E, 0x2EC7, 0x5B8F, 0x5B8F, 0x07A1, 0x5B90, 0x5B92, 0x2EC9,
+ 0x5B93, 0x5B93, 0x1731, 0x5B94, 0x5B94, 0x2ECC, 0x5B95, 0x5B95, 0x1730,
+ 0x5B96, 0x5B96, 0x2ECD, 0x5B97, 0x5B97, 0x1237, 0x5B98, 0x5B98, 0x0732,
+ 0x5B99, 0x5B99, 0x11E5, 0x5B9A, 0x5B9A, 0x05E7, 0x5B9B, 0x5B9B, 0x0EA1,
+ 0x5B9C, 0x5B9C, 0x1052, 0x5B9D, 0x5B9D, 0x040F, 0x5B9E, 0x5B9E, 0x0D4C,
+ 0x5B9F, 0x5B9F, 0x2ECE, 0x5BA0, 0x5BA0, 0x050D, 0x5BA1, 0x5BA1, 0x0D2C,
+ 0x5BA2, 0x5BA2, 0x095A, 0x5BA3, 0x5BA3, 0x0FC6, 0x5BA4, 0x5BA4, 0x0D69,
+ 0x5BA5, 0x5BA5, 0x1732, 0x5BA6, 0x5BA6, 0x07D7, 0x5BA7, 0x5BA9, 0x2ECF,
+ 0x5BAA, 0x5BAA, 0x0F49, 0x5BAB, 0x5BAB, 0x0705, 0x5BAC, 0x5BAF, 0x2ED2,
+ 0x5BB0, 0x5BB0, 0x111A, 0x5BB1, 0x5BB2, 0x2ED6, 0x5BB3, 0x5BB3, 0x075D,
+ 0x5BB4, 0x5BB4, 0x1010, 0x5BB5, 0x5BB5, 0x0F69, 0x5BB6, 0x5BB6, 0x0845,
+ 0x5BB7, 0x5BB7, 0x2ED8, 0x5BB8, 0x5BB8, 0x1733, 0x5BB9, 0x5BB9, 0x0CB8,
+ 0x5BBA, 0x5BBC, 0x2ED9, 0x5BBD, 0x5BBD, 0x097A, 0x5BBE, 0x5BBE, 0x045F,
+ 0x5BBF, 0x5BBF, 0x0DD3, 0x5BC0, 0x5BC1, 0x2EDC, 0x5BC2, 0x5BC2, 0x0838,
+ 0x5BC3, 0x5BC3, 0x2EDE, 0x5BC4, 0x5BC4, 0x0837, 0x5BC5, 0x5BC5, 0x1081,
+ 0x5BC6, 0x5BC6, 0x0AE1, 0x5BC7, 0x5BC7, 0x0969, 0x5BC8, 0x5BCB, 0x2EDF,
+ 0x5BCC, 0x5BCC, 0x06B6, 0x5BCD, 0x5BCF, 0x2EE3, 0x5BD0, 0x5BD0, 0x0AC7,
+ 0x5BD1, 0x5BD1, 0x2EE6, 0x5BD2, 0x5BD2, 0x0765, 0x5BD3, 0x5BD3, 0x10E5,
+ 0x5BD4, 0x5BDC, 0x2EE7, 0x5BDD, 0x5BDD, 0x0C5B, 0x5BDE, 0x5BDE, 0x0B12,
+ 0x5BDF, 0x5BDF, 0x04B3, 0x5BE0, 0x5BE0, 0x2EF0, 0x5BE1, 0x5BE1, 0x072A,
+ 0x5BE2, 0x5BE2, 0x20E5, 0x5BE3, 0x5BE3, 0x2EF1, 0x5BE4, 0x5BE4, 0x1737,
+ 0x5BE5, 0x5BE5, 0x0A11, 0x5BE6, 0x5BE6, 0x212F, 0x5BE7, 0x5BE7, 0x20A3,
+ 0x5BE8, 0x5BE8, 0x1150, 0x5BE9, 0x5BE9, 0x2121, 0x5BEA, 0x5BEA, 0x2EF2,
+ 0x5BEB, 0x5BEB, 0x21D4, 0x5BEC, 0x5BEC, 0x1FE5, 0x5BED, 0x5BED, 0x2EF3,
+ 0x5BEE, 0x5BEE, 0x1738, 0x5BEF, 0x5BEF, 0x2EF4, 0x5BF0, 0x5BF0, 0x173A,
+ 0x5BF1, 0x5BF4, 0x2EF5, 0x5BF5, 0x5BF5, 0x1E8A, 0x5BF6, 0x5BF6, 0x1E37,
+ 0x5BF7, 0x5BF7, 0x2EF9, 0x5BF8, 0x5BF8, 0x056A, 0x5BF9, 0x5BF9, 0x0613,
+ 0x5BFA, 0x5BFA, 0x0DB7, 0x5BFB, 0x5BFB, 0x0FD9, 0x5BFC, 0x5BFC, 0x059D,
+ 0x5BFD, 0x5BFE, 0x2EFA, 0x5BFF, 0x5BFF, 0x0D70, 0x5C00, 0x5C00, 0x2EFC,
+ 0x5C01, 0x5C01, 0x067F, 0x5C02, 0x5C03, 0x2EFD, 0x5C04, 0x5C04, 0x0D1D,
+ 0x5C05, 0x5C05, 0x2EFF, 0x5C06, 0x5C06, 0x087C, 0x5C07, 0x5C07, 0x1F9E,
+ 0x5C08, 0x5C08, 0x22A6, 0x5C09, 0x5C09, 0x0ECD, 0x5C0A, 0x5C0A, 0x124D,
+ 0x5C0B, 0x5C0B, 0x21E8, 0x5C0C, 0x5C0C, 0x2F00, 0x5C0D, 0x5C0D, 0x1EDA,
+ 0x5C0E, 0x5C0E, 0x1EB9, 0x5C0F, 0x5C0F, 0x0F6C, 0x5C10, 0x5C10, 0x2F01,
+ 0x5C11, 0x5C11, 0x0D12, 0x5C12, 0x5C13, 0x2F02, 0x5C14, 0x5C14, 0x063A,
+ 0x5C15, 0x5C15, 0x17B2, 0x5C16, 0x5C16, 0x0855, 0x5C17, 0x5C17, 0x2F04,
+ 0x5C18, 0x5C18, 0x04E3, 0x5C19, 0x5C19, 0x2F05, 0x5C1A, 0x5C1A, 0x0D09,
+ 0x5C1B, 0x5C1B, 0x2F06, 0x5C1C, 0x5C1C, 0x17B3, 0x5C1D, 0x5C1D, 0x04C7,
+ 0x5C1E, 0x5C21, 0x2F07, 0x5C22, 0x5C22, 0x14B6, 0x5C23, 0x5C23, 0x2F0B,
+ 0x5C24, 0x5C24, 0x10AD, 0x5C25, 0x5C25, 0x14B7, 0x5C26, 0x5C26, 0x2F0C,
+ 0x5C27, 0x5C27, 0x1029, 0x5C28, 0x5C2B, 0x2F0D, 0x5C2C, 0x5C2C, 0x14B8,
+ 0x5C2D, 0x5C30, 0x2F11, 0x5C31, 0x5C31, 0x08FC, 0x5C32, 0x5C33, 0x2F15,
+ 0x5C34, 0x5C34, 0x14B9, 0x5C35, 0x5C36, 0x2F17, 0x5C37, 0x5C37, 0x235C,
+ 0x5C38, 0x5C38, 0x0D43, 0x5C39, 0x5C39, 0x1083, 0x5C3A, 0x5C3A, 0x0504,
+ 0x5C3B, 0x5C3B, 0x1766, 0x5C3C, 0x5C3C, 0x0B44, 0x5C3D, 0x5C3D, 0x08D0,
+ 0x5C3E, 0x5C3E, 0x0EC1, 0x5C3F, 0x5C3F, 0x0B55, 0x5C40, 0x5C40, 0x0905,
+ 0x5C41, 0x5C41, 0x0BC7, 0x5C42, 0x5C42, 0x04AA, 0x5C43, 0x5C44, 0x2F19,
+ 0x5C45, 0x5C45, 0x0902, 0x5C46, 0x5C47, 0x2F1B, 0x5C48, 0x5C48, 0x0C79,
+ 0x5C49, 0x5C49, 0x0E3E, 0x5C4A, 0x5C4A, 0x08BD, 0x5C4B, 0x5C4B, 0x0EEC,
+ 0x5C4C, 0x5C4D, 0x2F1D, 0x5C4E, 0x5C4E, 0x0D51, 0x5C4F, 0x5C4F, 0x0BE0,
+ 0x5C50, 0x5C50, 0x1768, 0x5C51, 0x5C51, 0x0F87, 0x5C52, 0x5C54, 0x2F1F,
+ 0x5C55, 0x5C55, 0x115A, 0x5C56, 0x5C58, 0x2F22, 0x5C59, 0x5C59, 0x1769,
+ 0x5C5A, 0x5C5D, 0x2F25, 0x5C5E, 0x5C5E, 0x0D8B, 0x5C5F, 0x5C5F, 0x2F29,
+ 0x5C60, 0x5C60, 0x0E71, 0x5C61, 0x5C61, 0x0A6C, 0x5C62, 0x5C62, 0x2050,
+ 0x5C63, 0x5C63, 0x176B, 0x5C64, 0x5C64, 0x1E67, 0x5C65, 0x5C65, 0x0A6B,
+ 0x5C66, 0x5C66, 0x176C, 0x5C67, 0x5C67, 0x2F2A, 0x5C68, 0x5C68, 0x23F4,
+ 0x5C69, 0x5C6B, 0x2F2B, 0x5C6C, 0x5C6C, 0x213E, 0x5C6D, 0x5C6D, 0x2F2E,
+ 0x5C6E, 0x5C6E, 0x1774, 0x5C6F, 0x5C6F, 0x0E7E, 0x5C70, 0x5C70, 0x2F2F,
+ 0x5C71, 0x5C71, 0x0CF6, 0x5C72, 0x5C78, 0x2F30, 0x5C79, 0x5C79, 0x1060,
+ 0x5C7A, 0x5C7A, 0x15AC, 0x5C7B, 0x5C7E, 0x2F37, 0x5C7F, 0x5C7F, 0x10D1,
+ 0x5C80, 0x5C80, 0x2F3B, 0x5C81, 0x5C81, 0x0DDF, 0x5C82, 0x5C82, 0x0C10,
+ 0x5C83, 0x5C87, 0x2F3C, 0x5C88, 0x5C88, 0x15B0, 0x5C89, 0x5C8B, 0x2F41,
+ 0x5C8C, 0x5C8C, 0x15AB, 0x5C8D, 0x5C8D, 0x15AD, 0x5C8E, 0x5C8F, 0x2F44,
+ 0x5C90, 0x5C90, 0x15AE, 0x5C91, 0x5C91, 0x15B3, 0x5C92, 0x5C93, 0x2F46,
+ 0x5C94, 0x5C94, 0x04B4, 0x5C95, 0x5C95, 0x2F48, 0x5C96, 0x5C96, 0x15AF,
+ 0x5C97, 0x5C97, 0x06D5, 0x5C98, 0x5C99, 0x15B1, 0x5C9A, 0x5C9A, 0x15B4,
+ 0x5C9B, 0x5C9B, 0x059B, 0x5C9C, 0x5C9C, 0x15B5, 0x5C9D, 0x5CA0, 0x2F49,
+ 0x5CA1, 0x5CA1, 0x1F16, 0x5CA2, 0x5CA2, 0x15B7, 0x5CA3, 0x5CA3, 0x15BC,
+ 0x5CA4, 0x5CA8, 0x2F4D, 0x5CA9, 0x5CA9, 0x0FFB, 0x5CAA, 0x5CAA, 0x2F52,
+ 0x5CAB, 0x5CAB, 0x15BA, 0x5CAC, 0x5CAC, 0x15B9, 0x5CAD, 0x5CAD, 0x0A34,
+ 0x5CAE, 0x5CB0, 0x2F53, 0x5CB1, 0x5CB1, 0x15BB, 0x5CB2, 0x5CB2, 0x2F56,
+ 0x5CB3, 0x5CB3, 0x1103, 0x5CB4, 0x5CB4, 0x2F57, 0x5CB5, 0x5CB5, 0x15B6,
+ 0x5CB6, 0x5CB6, 0x2F58, 0x5CB7, 0x5CB7, 0x15BE, 0x5CB8, 0x5CB8, 0x03C1,
+ 0x5CB9, 0x5CBC, 0x2F59, 0x5CBD, 0x5CBD, 0x15B8, 0x5CBE, 0x5CBE, 0x2F5D,
+ 0x5CBF, 0x5CBF, 0x0986, 0x5CC0, 0x5CC0, 0x2F5E, 0x5CC1, 0x5CC1, 0x15BD,
+ 0x5CC2, 0x5CC3, 0x2F5F, 0x5CC4, 0x5CC4, 0x15BF, 0x5CC5, 0x5CCA, 0x2F61,
+ 0x5CCB, 0x5CCB, 0x15C2, 0x5CCC, 0x5CD1, 0x2F67, 0x5CD2, 0x5CD2, 0x15C0,
+ 0x5CD3, 0x5CD8, 0x2F6D, 0x5CD9, 0x5CD9, 0x11C4, 0x5CDA, 0x5CE0, 0x2F73,
+ 0x5CE1, 0x5CE1, 0x0F2C, 0x5CE2, 0x5CE3, 0x2F7A, 0x5CE4, 0x5CE4, 0x15C1,
+ 0x5CE5, 0x5CE5, 0x15C3, 0x5CE6, 0x5CE6, 0x0A74, 0x5CE7, 0x5CE7, 0x2F7C,
+ 0x5CE8, 0x5CE8, 0x062A, 0x5CE9, 0x5CE9, 0x2F7D, 0x5CEA, 0x5CEA, 0x10DD,
+ 0x5CEB, 0x5CEC, 0x2F7E, 0x5CED, 0x5CED, 0x0C4A, 0x5CEE, 0x5CEF, 0x2F80,
+ 0x5CF0, 0x5CF0, 0x0682, 0x5CF1, 0x5CF3, 0x2F82, 0x5CF4, 0x5CF4, 0x2389,
+ 0x5CF5, 0x5CF5, 0x2F85, 0x5CF6, 0x5CF6, 0x1EB7, 0x5CF7, 0x5CFA, 0x2F86,
+ 0x5CFB, 0x5CFB, 0x092D, 0x5CFC, 0x5CFC, 0x2F8A, 0x5CFD, 0x5CFD, 0x21B4,
+ 0x5CFE, 0x5CFF, 0x2F8B, 0x5D00, 0x5D01, 0x2F8D, 0x5D02, 0x5D03, 0x15C4,
+ 0x5D04, 0x5D05, 0x2F8F, 0x5D06, 0x5D06, 0x15CB, 0x5D07, 0x5D07, 0x050C,
+ 0x5D08, 0x5D0C, 0x2F91, 0x5D0D, 0x5D0D, 0x238F, 0x5D0E, 0x5D0E, 0x0C08,
+ 0x5D0F, 0x5D13, 0x2F96, 0x5D14, 0x5D14, 0x0561, 0x5D15, 0x5D15, 0x2F9B,
+ 0x5D16, 0x5D16, 0x0FEB, 0x5D17, 0x5D17, 0x1F1A, 0x5D18, 0x5D1A, 0x2F9C,
+ 0x5D1B, 0x5D1B, 0x15CC, 0x5D1C, 0x5D1D, 0x2F9F, 0x5D1E, 0x5D1E, 0x15CA,
+ 0x5D1F, 0x5D23, 0x2FA1, 0x5D24, 0x5D24, 0x15C9, 0x5D25, 0x5D25, 0x2FA6,
+ 0x5D26, 0x5D26, 0x15C7, 0x5D27, 0x5D27, 0x15C6, 0x5D28, 0x5D28, 0x2FA7,
+ 0x5D29, 0x5D29, 0x0429, 0x5D2A, 0x5D2B, 0x2FA8, 0x5D2C, 0x5D2C, 0x238B,
+ 0x5D2D, 0x5D2D, 0x1159, 0x5D2E, 0x5D2E, 0x15C8, 0x5D2F, 0x5D33, 0x2FAA,
+ 0x5D34, 0x5D34, 0x15CF, 0x5D35, 0x5D3C, 0x2FAF, 0x5D3D, 0x5D3D, 0x15D0,
+ 0x5D3E, 0x5D3E, 0x15CE, 0x5D3F, 0x5D46, 0x2FB7, 0x5D47, 0x5D47, 0x1B22,
+ 0x5D48, 0x5D49, 0x2FBF, 0x5D4A, 0x5D4A, 0x15D7, 0x5D4B, 0x5D4B, 0x15D6,
+ 0x5D4C, 0x5D4C, 0x0C33, 0x5D4D, 0x5D4F, 0x2FC1, 0x5D50, 0x5D50, 0x238A,
+ 0x5D51, 0x5D57, 0x2FC4, 0x5D58, 0x5D58, 0x15CD, 0x5D59, 0x5D5A, 0x2FCB,
+ 0x5D5B, 0x5D5B, 0x15D2, 0x5D5C, 0x5D5C, 0x2FCD, 0x5D5D, 0x5D5D, 0x15D4,
+ 0x5D5E, 0x5D68, 0x2FCE, 0x5D69, 0x5D69, 0x15D8, 0x5D6A, 0x5D6A, 0x2FD9,
+ 0x5D6B, 0x5D6B, 0x15D5, 0x5D6C, 0x5D6C, 0x15D1, 0x5D6D, 0x5D6E, 0x2FDA,
+ 0x5D6F, 0x5D6F, 0x15D3, 0x5D70, 0x5D73, 0x2FDC, 0x5D74, 0x5D74, 0x15D9,
+ 0x5D75, 0x5D80, 0x2FE0, 0x5D81, 0x5D81, 0x2391, 0x5D82, 0x5D82, 0x15DA,
+ 0x5D83, 0x5D83, 0x2FEC, 0x5D84, 0x5D84, 0x2271, 0x5D85, 0x5D86, 0x2FED,
+ 0x5D87, 0x5D87, 0x2388, 0x5D88, 0x5D96, 0x2FEF, 0x5D97, 0x5D97, 0x238E,
+ 0x5D98, 0x5D98, 0x2FFE, 0x5D99, 0x5D99, 0x15DB, 0x5D9A, 0x5D9C, 0x2FFF,
+ 0x5D9D, 0x5D9D, 0x15DC, 0x5D9E, 0x5D9F, 0x3002, 0x5DA0, 0x5DA0, 0x238D,
+ 0x5DA1, 0x5DA6, 0x3004, 0x5DA7, 0x5DA7, 0x238C, 0x5DA8, 0x5DB6, 0x300A,
+ 0x5DB7, 0x5DB7, 0x15DE, 0x5DB8, 0x5DB8, 0x2390, 0x5DB9, 0x5DB9, 0x3019,
+ 0x5DBA, 0x5DBA, 0x2033, 0x5DBB, 0x5DBB, 0x301A, 0x5DBC, 0x5DBC, 0x223C,
+ 0x5DBD, 0x5DC4, 0x301B, 0x5DC5, 0x5DC5, 0x15DF, 0x5DC6, 0x5DCA, 0x3023,
+ 0x5DCB, 0x5DCB, 0x1FE9, 0x5DCC, 0x5DCC, 0x3028, 0x5DCD, 0x5DCD, 0x0EB0,
+ 0x5DCE, 0x5DD1, 0x3029, 0x5DD2, 0x5DD2, 0x2055, 0x5DD3, 0x5DD3, 0x302D,
+ 0x5DD4, 0x5DD4, 0x2392, 0x5DD5, 0x5DDA, 0x302E, 0x5DDB, 0x5DDB, 0x1815,
+ 0x5DDC, 0x5DDC, 0x3034, 0x5DDD, 0x5DDD, 0x052B, 0x5DDE, 0x5DDE, 0x11DC,
+ 0x5DDF, 0x5DE0, 0x3035, 0x5DE1, 0x5DE1, 0x0FDB, 0x5DE2, 0x5DE2, 0x04D7,
+ 0x5DE3, 0x5DE4, 0x3037, 0x5DE5, 0x5DE5, 0x06FD, 0x5DE6, 0x5DE6, 0x1250,
+ 0x5DE7, 0x5DE7, 0x0C46, 0x5DE8, 0x5DE8, 0x090D, 0x5DE9, 0x5DE9, 0x0707,
+ 0x5DEA, 0x5DEA, 0x3039, 0x5DEB, 0x5DEB, 0x0EE6, 0x5DEC, 0x5DED, 0x303A,
+ 0x5DEE, 0x5DEE, 0x04B5, 0x5DEF, 0x5DEF, 0x139F, 0x5DF0, 0x5DF0, 0x2324,
+ 0x5DF1, 0x5DF1, 0x082D, 0x5DF2, 0x5DF2, 0x1058, 0x5DF3, 0x5DF3, 0x0DBD,
+ 0x5DF4, 0x5DF4, 0x03D8, 0x5DF5, 0x5DF6, 0x303C, 0x5DF7, 0x5DF7, 0x0F5C,
+ 0x5DF8, 0x5DFC, 0x303E, 0x5DFD, 0x5DFD, 0x12F7, 0x5DFE, 0x5DFE, 0x08BE,
+ 0x5DFF, 0x5DFF, 0x3043, 0x5E00, 0x5E00, 0x3044, 0x5E01, 0x5E01, 0x043B,
+ 0x5E02, 0x5E02, 0x0D67, 0x5E03, 0x5E03, 0x0483, 0x5E04, 0x5E04, 0x3045,
+ 0x5E05, 0x5E05, 0x0D9C, 0x5E06, 0x5E06, 0x0648, 0x5E07, 0x5E07, 0x3046,
+ 0x5E08, 0x5E08, 0x0D3D, 0x5E09, 0x5E0B, 0x3047, 0x5E0C, 0x5E0C, 0x0F10,
+ 0x5E0D, 0x5E0E, 0x304A, 0x5E0F, 0x5E0F, 0x159E, 0x5E10, 0x5E10, 0x116B,
+ 0x5E11, 0x5E11, 0x15A1, 0x5E12, 0x5E13, 0x304C, 0x5E14, 0x5E14, 0x15A0,
+ 0x5E15, 0x5E15, 0x0B82, 0x5E16, 0x5E16, 0x0E4E, 0x5E17, 0x5E17, 0x304E,
+ 0x5E18, 0x5E18, 0x09FA, 0x5E19, 0x5E19, 0x159F, 0x5E1A, 0x5E1A, 0x11E2,
+ 0x5E1B, 0x5E1B, 0x0476, 0x5E1C, 0x5E1C, 0x11C3, 0x5E1D, 0x5E1D, 0x05BC,
+ 0x5E1E, 0x5E24, 0x304F, 0x5E25, 0x5E25, 0x2143, 0x5E26, 0x5E26, 0x057B,
+ 0x5E27, 0x5E27, 0x11A0, 0x5E28, 0x5E2A, 0x3056, 0x5E2B, 0x5E2B, 0x2129,
+ 0x5E2C, 0x5E2C, 0x3059, 0x5E2D, 0x5E2D, 0x0F1C, 0x5E2E, 0x5E2E, 0x03FA,
+ 0x5E2F, 0x5E30, 0x305A, 0x5E31, 0x5E31, 0x15A2, 0x5E32, 0x5E32, 0x305C,
+ 0x5E33, 0x5E33, 0x2277, 0x5E34, 0x5E35, 0x305D, 0x5E36, 0x5E36, 0x1EA7,
+ 0x5E37, 0x5E37, 0x15A5, 0x5E38, 0x5E38, 0x04C8, 0x5E39, 0x5E3A, 0x305F,
+ 0x5E3B, 0x5E3C, 0x15A3, 0x5E3D, 0x5E3D, 0x0AB6, 0x5E3E, 0x5E3F, 0x3061,
+ 0x5E40, 0x5E40, 0x2285, 0x5E41, 0x5E41, 0x3063, 0x5E42, 0x5E42, 0x0AE2,
+ 0x5E43, 0x5E43, 0x2384, 0x5E44, 0x5E44, 0x15A6, 0x5E45, 0x5E45, 0x0696,
+ 0x5E46, 0x5E4B, 0x3064, 0x5E4C, 0x5E4C, 0x07E4, 0x5E4D, 0x5E53, 0x306A,
+ 0x5E54, 0x5E54, 0x15A7, 0x5E55, 0x5E55, 0x0B1E, 0x5E56, 0x5E56, 0x3071,
+ 0x5E57, 0x5E57, 0x2387, 0x5E58, 0x5E58, 0x2386, 0x5E59, 0x5E5A, 0x3072,
+ 0x5E5B, 0x5E5B, 0x15A8, 0x5E5C, 0x5E5D, 0x3074, 0x5E5E, 0x5E5E, 0x15A9,
+ 0x5E5F, 0x5E5F, 0x2290, 0x5E60, 0x5E60, 0x3076, 0x5E61, 0x5E61, 0x15AA,
+ 0x5E62, 0x5E62, 0x0534, 0x5E63, 0x5E63, 0x1E44, 0x5E64, 0x5E6A, 0x3077,
+ 0x5E6B, 0x5E6B, 0x1E32, 0x5E6C, 0x5E6C, 0x2385, 0x5E6D, 0x5E71, 0x307E,
+ 0x5E72, 0x5E72, 0x06C4, 0x5E73, 0x5E73, 0x0BDC, 0x5E74, 0x5E74, 0x0B4D,
+ 0x5E75, 0x5E75, 0x3083, 0x5E76, 0x5E76, 0x0469, 0x5E77, 0x5E77, 0x3084,
+ 0x5E78, 0x5E78, 0x0F9D, 0x5E79, 0x5E79, 0x1F13, 0x5E7A, 0x5E7A, 0x1813,
+ 0x5E7B, 0x5E7B, 0x07D8, 0x5E7C, 0x5E7C, 0x10BC, 0x5E7D, 0x5E7D, 0x10A9,
+ 0x5E7E, 0x5E7E, 0x1F73, 0x5E7F, 0x5E7F, 0x073C, 0x5E80, 0x5E80, 0x1631,
+ 0x5E81, 0x5E83, 0x3085, 0x5E84, 0x5E84, 0x120C, 0x5E85, 0x5E85, 0x3088,
+ 0x5E86, 0x5E86, 0x0C69, 0x5E87, 0x5E87, 0x043C, 0x5E88, 0x5E89, 0x3089,
+ 0x5E8A, 0x5E8A, 0x0535, 0x5E8B, 0x5E8B, 0x1633, 0x5E8C, 0x5E8E, 0x308B,
+ 0x5E8F, 0x5E8F, 0x0FBD, 0x5E90, 0x5E90, 0x0A55, 0x5E91, 0x5E91, 0x1632,
+ 0x5E92, 0x5E92, 0x308E, 0x5E93, 0x5E93, 0x096F, 0x5E94, 0x5E94, 0x108B,
+ 0x5E95, 0x5E95, 0x05B8, 0x5E96, 0x5E96, 0x1634, 0x5E97, 0x5E97, 0x05CB,
+ 0x5E98, 0x5E98, 0x308F, 0x5E99, 0x5E99, 0x0AF2, 0x5E9A, 0x5E9A, 0x06F8,
+ 0x5E9B, 0x5E9B, 0x3090, 0x5E9C, 0x5E9C, 0x06A9, 0x5E9D, 0x5E9D, 0x3091,
+ 0x5E9E, 0x5E9E, 0x0B94, 0x5E9F, 0x5E9F, 0x066C, 0x5EA0, 0x5EA0, 0x1636,
+ 0x5EA1, 0x5EA4, 0x3092, 0x5EA5, 0x5EA5, 0x1635, 0x5EA6, 0x5EA6, 0x0607,
+ 0x5EA7, 0x5EA7, 0x1256, 0x5EA8, 0x5EAA, 0x3096, 0x5EAB, 0x5EAB, 0x1FE0,
+ 0x5EAC, 0x5EAC, 0x3099, 0x5EAD, 0x5EAD, 0x0E56, 0x5EAE, 0x5EB2, 0x309A,
+ 0x5EB3, 0x5EB3, 0x163A, 0x5EB4, 0x5EB4, 0x309F, 0x5EB5, 0x5EB5, 0x1638,
+ 0x5EB6, 0x5EB6, 0x0D93, 0x5EB7, 0x5EB7, 0x0942, 0x5EB8, 0x5EB8, 0x109E,
+ 0x5EB9, 0x5EB9, 0x1637, 0x5EBA, 0x5EBD, 0x30A0, 0x5EBE, 0x5EBE, 0x1639,
+ 0x5EBF, 0x5EC8, 0x30A4, 0x5EC9, 0x5EC9, 0x09F7, 0x5ECA, 0x5ECA, 0x09B3,
+ 0x5ECB, 0x5ED0, 0x30AE, 0x5ED1, 0x5ED1, 0x163D, 0x5ED2, 0x5ED2, 0x163C,
+ 0x5ED3, 0x5ED3, 0x0995, 0x5ED4, 0x5ED5, 0x30B4, 0x5ED6, 0x5ED6, 0x0A17,
+ 0x5ED7, 0x5EDA, 0x30B6, 0x5EDB, 0x5EDB, 0x163E, 0x5EDC, 0x5EDE, 0x30BA,
+ 0x5EDF, 0x5EDF, 0x2087, 0x5EE0, 0x5EE0, 0x1E78, 0x5EE1, 0x5EE1, 0x23AE,
+ 0x5EE2, 0x5EE2, 0x1EF6, 0x5EE3, 0x5EE3, 0x1F31, 0x5EE4, 0x5EE7, 0x30BD,
+ 0x5EE8, 0x5EE8, 0x163F, 0x5EE9, 0x5EE9, 0x30C1, 0x5EEA, 0x5EEA, 0x1640,
+ 0x5EEB, 0x5EEB, 0x30C2, 0x5EEC, 0x5EEC, 0x2045, 0x5EED, 0x5EF2, 0x30C3,
+ 0x5EF3, 0x5EF3, 0x2178, 0x5EF4, 0x5EF4, 0x1398, 0x5EF5, 0x5EF5, 0x30C9,
+ 0x5EF6, 0x5EF6, 0x0FFC, 0x5EF7, 0x5EF7, 0x0E53, 0x5EF8, 0x5EF9, 0x30CA,
+ 0x5EFA, 0x5EFA, 0x0879, 0x5EFB, 0x5EFD, 0x30CC, 0x5EFE, 0x5EFE, 0x14AD,
+ 0x5EFF, 0x5EFF, 0x125B, 0x5F00, 0x5F00, 0x0937, 0x5F01, 0x5F01, 0x139D,
+ 0x5F02, 0x5F02, 0x1073, 0x5F03, 0x5F03, 0x0C19, 0x5F04, 0x5F04, 0x0B6B,
+ 0x5F05, 0x5F07, 0x30CF, 0x5F08, 0x5F08, 0x14AE, 0x5F09, 0x5F09, 0x30D2,
+ 0x5F0A, 0x5F0A, 0x0440, 0x5F0B, 0x5F0B, 0x14F6, 0x5F0C, 0x5F0E, 0x30D3,
+ 0x5F0F, 0x5F0F, 0x0D54, 0x5F10, 0x5F10, 0x30D6, 0x5F11, 0x5F11, 0x14F9,
+ 0x5F12, 0x5F12, 0x30D7, 0x5F13, 0x5F13, 0x0706, 0x5F14, 0x5F14, 0x30D8,
+ 0x5F15, 0x5F15, 0x1084, 0x5F16, 0x5F16, 0x30D9, 0x5F17, 0x5F17, 0x06A0,
+ 0x5F18, 0x5F18, 0x07A2, 0x5F19, 0x5F1A, 0x30DA, 0x5F1B, 0x5F1B, 0x04FF,
+ 0x5F1C, 0x5F1E, 0x30DC, 0x5F1F, 0x5F1F, 0x05BD, 0x5F20, 0x5F20, 0x1166,
+ 0x5F21, 0x5F24, 0x30DF, 0x5F25, 0x5F25, 0x0ADB, 0x5F26, 0x5F26, 0x0F3F,
+ 0x5F27, 0x5F27, 0x07B6, 0x5F28, 0x5F28, 0x30E3, 0x5F29, 0x5F29, 0x176F,
+ 0x5F2A, 0x5F2A, 0x176E, 0x5F2B, 0x5F2C, 0x30E4, 0x5F2D, 0x5F2D, 0x1770,
+ 0x5F2E, 0x5F2E, 0x30E6, 0x5F2F, 0x5F2F, 0x0E95, 0x5F30, 0x5F30, 0x30E7,
+ 0x5F31, 0x5F31, 0x0CD0, 0x5F32, 0x5F32, 0x30E8, 0x5F33, 0x5F33, 0x23F5,
+ 0x5F34, 0x5F34, 0x30E9, 0x5F35, 0x5F35, 0x2275, 0x5F36, 0x5F38, 0x30EA,
+ 0x5F39, 0x5F39, 0x0590, 0x5F3A, 0x5F3A, 0x0C3C, 0x5F3B, 0x5F3B, 0x30ED,
+ 0x5F3C, 0x5F3C, 0x1772, 0x5F3D, 0x5F3F, 0x30EE, 0x5F40, 0x5F40, 0x19BE,
+ 0x5F41, 0x5F45, 0x30F1, 0x5F46, 0x5F46, 0x266E, 0x5F47, 0x5F47, 0x30F6,
+ 0x5F48, 0x5F48, 0x1EB0, 0x5F49, 0x5F4B, 0x30F7, 0x5F4C, 0x5F4C, 0x2083,
+ 0x5F4D, 0x5F4D, 0x30FA, 0x5F4E, 0x5F4E, 0x2188, 0x5F4F, 0x5F4F, 0x30FB,
+ 0x5F50, 0x5F50, 0x1762, 0x5F51, 0x5F51, 0x30FC, 0x5F52, 0x5F52, 0x0742,
+ 0x5F53, 0x5F53, 0x0592, 0x5F54, 0x5F54, 0x30FD, 0x5F55, 0x5F55, 0x0A63,
+ 0x5F56, 0x5F56, 0x1764, 0x5F57, 0x5F57, 0x1763, 0x5F58, 0x5F58, 0x1765,
+ 0x5F59, 0x5F59, 0x267C, 0x5F5A, 0x5F5C, 0x30FE, 0x5F5D, 0x5F5D, 0x1054,
+ 0x5F5E, 0x5F60, 0x3101, 0x5F61, 0x5F61, 0x15EE, 0x5F62, 0x5F62, 0x0F99,
+ 0x5F63, 0x5F63, 0x3104, 0x5F64, 0x5F64, 0x0E5F, 0x5F65, 0x5F65, 0x3105,
+ 0x5F66, 0x5F66, 0x100E, 0x5F67, 0x5F68, 0x3106, 0x5F69, 0x5F69, 0x0491,
+ 0x5F6A, 0x5F6A, 0x0454, 0x5F6B, 0x5F6B, 0x3108, 0x5F6C, 0x5F6C, 0x045B,
+ 0x5F6D, 0x5F6D, 0x0BAE, 0x5F6E, 0x5F6F, 0x3109, 0x5F70, 0x5F70, 0x1164,
+ 0x5F71, 0x5F71, 0x1095, 0x5F72, 0x5F72, 0x310B, 0x5F73, 0x5F73, 0x15E0,
+ 0x5F74, 0x5F76, 0x310C, 0x5F77, 0x5F77, 0x15E1, 0x5F78, 0x5F78, 0x310F,
+ 0x5F79, 0x5F79, 0x1062, 0x5F7A, 0x5F7A, 0x3110, 0x5F7B, 0x5F7B, 0x04DE,
+ 0x5F7C, 0x5F7C, 0x0434, 0x5F7D, 0x5F7F, 0x3111, 0x5F80, 0x5F80, 0x0EAA,
+ 0x5F81, 0x5F81, 0x1198, 0x5F82, 0x5F82, 0x15E2, 0x5F83, 0x5F83, 0x3114,
+ 0x5F84, 0x5F84, 0x08E5, 0x5F85, 0x5F85, 0x0580, 0x5F86, 0x5F86, 0x3115,
+ 0x5F87, 0x5F87, 0x15E3, 0x5F88, 0x5F88, 0x0793, 0x5F89, 0x5F89, 0x15E4,
+ 0x5F8A, 0x5F8A, 0x07C7, 0x5F8B, 0x5F8B, 0x0A70, 0x5F8C, 0x5F8C, 0x15E5,
+ 0x5F8D, 0x5F8F, 0x3116, 0x5F90, 0x5F90, 0x0FB7, 0x5F91, 0x5F91, 0x1FC5,
+ 0x5F92, 0x5F92, 0x0E6E, 0x5F93, 0x5F94, 0x3119, 0x5F95, 0x5F95, 0x15E6,
+ 0x5F96, 0x5F96, 0x311B, 0x5F97, 0x5F97, 0x05A4, 0x5F98, 0x5F98, 0x0B88,
+ 0x5F99, 0x5F99, 0x15E7, 0x5F9A, 0x5F9B, 0x311C, 0x5F9C, 0x5F9C, 0x15E8,
+ 0x5F9D, 0x5F9D, 0x311E, 0x5F9E, 0x5F9E, 0x1EA1, 0x5F9F, 0x5F9F, 0x311F,
+ 0x5FA0, 0x5FA0, 0x2393, 0x5FA1, 0x5FA1, 0x10DE, 0x5FA2, 0x5FA7, 0x3120,
+ 0x5FA8, 0x5FA8, 0x15E9, 0x5FA9, 0x5FA9, 0x1F0B, 0x5FAA, 0x5FAA, 0x0FD6,
+ 0x5FAB, 0x5FAC, 0x3126, 0x5FAD, 0x5FAD, 0x15EA, 0x5FAE, 0x5FAE, 0x0EB1,
+ 0x5FAF, 0x5FB4, 0x3128, 0x5FB5, 0x5FB5, 0x15EB, 0x5FB6, 0x5FB6, 0x312E,
+ 0x5FB7, 0x5FB7, 0x05A3, 0x5FB8, 0x5FB8, 0x312F, 0x5FB9, 0x5FB9, 0x1E7C,
+ 0x5FBA, 0x5FBB, 0x3130, 0x5FBC, 0x5FBC, 0x15EC, 0x5FBD, 0x5FBD, 0x07EA,
+ 0x5FBE, 0x5FC2, 0x3132, 0x5FC3, 0x5FC3, 0x0F8F, 0x5FC4, 0x5FC4, 0x1642,
+ 0x5FC5, 0x5FC5, 0x0441, 0x5FC6, 0x5FC6, 0x106B, 0x5FC7, 0x5FC8, 0x3137,
+ 0x5FC9, 0x5FC9, 0x1643, 0x5FCA, 0x5FCB, 0x3139, 0x5FCC, 0x5FCC, 0x083C,
+ 0x5FCD, 0x5FCD, 0x0CA7, 0x5FCE, 0x5FCE, 0x313B, 0x5FCF, 0x5FCF, 0x1645,
+ 0x5FD0, 0x5FD0, 0x1A0C, 0x5FD1, 0x5FD1, 0x1A0B, 0x5FD2, 0x5FD2, 0x14F7,
+ 0x5FD3, 0x5FD5, 0x313C, 0x5FD6, 0x5FD6, 0x1644, 0x5FD7, 0x5FD7, 0x11BD,
+ 0x5FD8, 0x5FD8, 0x0EAD, 0x5FD9, 0x5FD9, 0x0AAB, 0x5FDA, 0x5FDC, 0x313F,
+ 0x5FDD, 0x5FDD, 0x1683, 0x5FDE, 0x5FDF, 0x3142, 0x5FE0, 0x5FE0, 0x11D1,
+ 0x5FE1, 0x5FE1, 0x1649, 0x5FE2, 0x5FE3, 0x3144, 0x5FE4, 0x5FE4, 0x164A,
+ 0x5FE5, 0x5FE6, 0x3146, 0x5FE7, 0x5FE7, 0x10AC, 0x5FE8, 0x5FE9, 0x3148,
+ 0x5FEA, 0x5FEA, 0x164E, 0x5FEB, 0x5FEB, 0x0979, 0x5FEC, 0x5FEC, 0x314A,
+ 0x5FED, 0x5FED, 0x164F, 0x5FEE, 0x5FEE, 0x1647, 0x5FEF, 0x5FF0, 0x314B,
+ 0x5FF1, 0x5FF1, 0x04E5, 0x5FF2, 0x5FF4, 0x314D, 0x5FF5, 0x5FF5, 0x0B51,
+ 0x5FF6, 0x5FF7, 0x3150, 0x5FF8, 0x5FF8, 0x1650, 0x5FF9, 0x5FFA, 0x3152,
+ 0x5FFB, 0x5FFB, 0x0F8E, 0x5FFC, 0x5FFC, 0x3154, 0x5FFD, 0x5FFD, 0x07AD,
+ 0x5FFE, 0x5FFE, 0x164B, 0x5FFF, 0x5FFF, 0x067B, 0x6000, 0x6000, 0x07C8,
+ 0x6001, 0x6001, 0x0DFF, 0x6002, 0x6002, 0x0DC0, 0x6003, 0x6003, 0x1646,
+ 0x6004, 0x6004, 0x1648, 0x6005, 0x6006, 0x164C, 0x6007, 0x6009, 0x3155,
+ 0x600A, 0x600A, 0x1659, 0x600B, 0x600C, 0x3158, 0x600D, 0x600D, 0x1656,
+ 0x600E, 0x600E, 0x1138, 0x600F, 0x600F, 0x1655, 0x6010, 0x6011, 0x315A,
+ 0x6012, 0x6012, 0x0B6E, 0x6013, 0x6013, 0x315C, 0x6014, 0x6014, 0x119B,
+ 0x6015, 0x6015, 0x0B83, 0x6016, 0x6016, 0x0487, 0x6017, 0x6018, 0x315D,
+ 0x6019, 0x6019, 0x1651, 0x601A, 0x601A, 0x315F, 0x601B, 0x601B, 0x1654,
+ 0x601C, 0x601C, 0x09F8, 0x601D, 0x601D, 0x0DB1, 0x601E, 0x601F, 0x3160,
+ 0x6020, 0x6020, 0x0582, 0x6021, 0x6021, 0x165B, 0x6022, 0x6024, 0x3162,
+ 0x6025, 0x6025, 0x0824, 0x6026, 0x6026, 0x1653, 0x6027, 0x6027, 0x0F9F,
+ 0x6028, 0x6028, 0x10FC, 0x6029, 0x6029, 0x1657, 0x602A, 0x602A, 0x072F,
+ 0x602B, 0x602B, 0x1658, 0x602C, 0x602E, 0x3165, 0x602F, 0x602F, 0x0C50,
+ 0x6030, 0x6034, 0x3168, 0x6035, 0x6035, 0x1652, 0x6036, 0x603A, 0x316D,
+ 0x603B, 0x603B, 0x1239, 0x603C, 0x603C, 0x1A0D, 0x603D, 0x603E, 0x3172,
+ 0x603F, 0x603F, 0x165A, 0x6040, 0x6040, 0x3174, 0x6041, 0x6041, 0x1A11,
+ 0x6042, 0x6042, 0x1660, 0x6043, 0x6043, 0x0D68, 0x6044, 0x604A, 0x3175,
+ 0x604B, 0x604B, 0x09FE, 0x604C, 0x604C, 0x317C, 0x604D, 0x604D, 0x07E5,
+ 0x604E, 0x604F, 0x317D, 0x6050, 0x6050, 0x0963, 0x6051, 0x6051, 0x317F,
+ 0x6052, 0x6052, 0x079A, 0x6053, 0x6054, 0x3180, 0x6055, 0x6055, 0x0D96,
+ 0x6056, 0x6058, 0x3182, 0x6059, 0x6059, 0x1A12, 0x605A, 0x605A, 0x1A0F,
+ 0x605B, 0x605C, 0x3185, 0x605D, 0x605D, 0x1A0E, 0x605E, 0x6061, 0x3187,
+ 0x6062, 0x6062, 0x07EB, 0x6063, 0x6063, 0x1A13, 0x6064, 0x6064, 0x0FBF,
+ 0x6065, 0x6066, 0x318B, 0x6067, 0x6067, 0x1A10, 0x6068, 0x6068, 0x0795,
+ 0x6069, 0x6069, 0x0636, 0x606A, 0x606A, 0x1661, 0x606B, 0x606B, 0x05F1,
+ 0x606C, 0x606C, 0x0E44, 0x606D, 0x606D, 0x0700, 0x606E, 0x606E, 0x318D,
+ 0x606F, 0x606F, 0x0F0F, 0x6070, 0x6070, 0x0C1E, 0x6071, 0x6072, 0x318E,
+ 0x6073, 0x6073, 0x095F, 0x6074, 0x6075, 0x3190, 0x6076, 0x6076, 0x0630,
+ 0x6077, 0x6077, 0x3192, 0x6078, 0x6079, 0x165C, 0x607A, 0x607A, 0x165F,
+ 0x607B, 0x607B, 0x165E, 0x607C, 0x607C, 0x0B38, 0x607D, 0x607D, 0x1662,
+ 0x607E, 0x607E, 0x3193, 0x607F, 0x607F, 0x10A6, 0x6080, 0x6082, 0x3194,
+ 0x6083, 0x6083, 0x1667, 0x6084, 0x6084, 0x0C41, 0x6085, 0x6088, 0x3197,
+ 0x6089, 0x6089, 0x0F11, 0x608A, 0x608B, 0x319B, 0x608C, 0x608C, 0x1669,
+ 0x608D, 0x608D, 0x076E, 0x608E, 0x6091, 0x319D, 0x6092, 0x6092, 0x1668,
+ 0x6093, 0x6093, 0x31A1, 0x6094, 0x6094, 0x07EF, 0x6095, 0x6095, 0x31A2,
+ 0x6096, 0x6096, 0x1663, 0x6097, 0x6099, 0x31A3, 0x609A, 0x609A, 0x1664,
+ 0x609B, 0x609B, 0x166A, 0x609C, 0x609C, 0x31A6, 0x609D, 0x609D, 0x1666,
+ 0x609E, 0x609E, 0x31A7, 0x609F, 0x609F, 0x0F01, 0x60A0, 0x60A0, 0x10AB,
+ 0x60A1, 0x60A2, 0x31A8, 0x60A3, 0x60A3, 0x07D1, 0x60A4, 0x60A5, 0x31AA,
+ 0x60A6, 0x60A6, 0x1106, 0x60A7, 0x60A7, 0x31AC, 0x60A8, 0x60A8, 0x0B5D,
+ 0x60A9, 0x60AA, 0x31AD, 0x60AB, 0x60AB, 0x1A14, 0x60AC, 0x60AC, 0x0FC7,
+ 0x60AD, 0x60AD, 0x1665, 0x60AE, 0x60AE, 0x31AF, 0x60AF, 0x60AF, 0x0AFA,
+ 0x60B0, 0x60B0, 0x31B0, 0x60B1, 0x60B1, 0x166D, 0x60B2, 0x60B2, 0x0418,
+ 0x60B3, 0x60B3, 0x31B1, 0x60B4, 0x60B4, 0x1672, 0x60B5, 0x60B5, 0x23B4,
+ 0x60B6, 0x60B6, 0x207E, 0x60B7, 0x60B7, 0x31B2, 0x60B8, 0x60B8, 0x0835,
+ 0x60B9, 0x60BA, 0x31B3, 0x60BB, 0x60BB, 0x166C, 0x60BC, 0x60BC, 0x05A0,
+ 0x60BD, 0x60C4, 0x31B5, 0x60C5, 0x60C5, 0x0C66, 0x60C6, 0x60C6, 0x1670,
+ 0x60C7, 0x60C9, 0x31BD, 0x60CA, 0x60CA, 0x08D9, 0x60CB, 0x60CB, 0x0EA0,
+ 0x60CC, 0x60D0, 0x31C0, 0x60D1, 0x60D1, 0x0808, 0x60D2, 0x60D4, 0x31C5,
+ 0x60D5, 0x60D5, 0x0E3B, 0x60D6, 0x60D7, 0x31C8, 0x60D8, 0x60D8, 0x166F,
+ 0x60D9, 0x60D9, 0x31CA, 0x60DA, 0x60DA, 0x1671, 0x60DB, 0x60DB, 0x31CB,
+ 0x60DC, 0x60DC, 0x0F14, 0x60DD, 0x60DD, 0x166E, 0x60DE, 0x60DE, 0x31CC,
+ 0x60DF, 0x60DF, 0x0EB8, 0x60E0, 0x60E0, 0x07F2, 0x60E1, 0x60E1, 0x1EE3,
+ 0x60E2, 0x60E5, 0x31CD, 0x60E6, 0x60E6, 0x05CC, 0x60E7, 0x60E7, 0x0914,
+ 0x60E8, 0x60E8, 0x0499, 0x60E9, 0x60E9, 0x04F2, 0x60EA, 0x60EA, 0x31D1,
+ 0x60EB, 0x60EB, 0x0422, 0x60EC, 0x60EC, 0x166B, 0x60ED, 0x60ED, 0x0498,
+ 0x60EE, 0x60EE, 0x058D, 0x60EF, 0x60EF, 0x0738, 0x60F0, 0x60F0, 0x0627,
+ 0x60F1, 0x60F1, 0x2095, 0x60F2, 0x60F2, 0x23BB, 0x60F3, 0x60F3, 0x0F58,
+ 0x60F4, 0x60F4, 0x1677, 0x60F5, 0x60F5, 0x31D2, 0x60F6, 0x60F6, 0x07E1,
+ 0x60F7, 0x60F8, 0x31D3, 0x60F9, 0x60F9, 0x0CA2, 0x60FA, 0x60FA, 0x0F95,
+ 0x60FB, 0x60FB, 0x23B9, 0x60FC, 0x60FF, 0x31D5, 0x6100, 0x6100, 0x1678,
+ 0x6101, 0x6101, 0x0513, 0x6102, 0x6105, 0x31D9, 0x6106, 0x6106, 0x1A15,
+ 0x6107, 0x6107, 0x31DD, 0x6108, 0x6108, 0x10DF, 0x6109, 0x6109, 0x10C9,
+ 0x610A, 0x610C, 0x31DE, 0x610D, 0x610D, 0x1A16, 0x610E, 0x610E, 0x1679,
+ 0x610F, 0x610F, 0x1069, 0x6110, 0x6114, 0x31E1, 0x6115, 0x6115, 0x1675,
+ 0x6116, 0x6119, 0x31E6, 0x611A, 0x611A, 0x10C3, 0x611B, 0x611B, 0x1E28,
+ 0x611C, 0x611C, 0x23BD, 0x611D, 0x611E, 0x31EA, 0x611F, 0x611F, 0x06CB,
+ 0x6120, 0x6120, 0x1673, 0x6121, 0x6122, 0x31EC, 0x6123, 0x6123, 0x1676,
+ 0x6124, 0x6124, 0x067C, 0x6125, 0x6125, 0x31EE, 0x6126, 0x6126, 0x1674,
+ 0x6127, 0x6127, 0x098D, 0x6128, 0x612A, 0x31EF, 0x612B, 0x612B, 0x167A,
+ 0x612C, 0x6133, 0x31F2, 0x6134, 0x6134, 0x23B5, 0x6135, 0x6136, 0x31FA,
+ 0x6137, 0x6137, 0x23BA, 0x6138, 0x613D, 0x31FC, 0x613E, 0x613E, 0x23B3,
+ 0x613F, 0x613F, 0x10FB, 0x6140, 0x6147, 0x3202, 0x6148, 0x6148, 0x054B,
+ 0x6149, 0x6149, 0x320A, 0x614A, 0x614A, 0x167B, 0x614B, 0x614B, 0x2162,
+ 0x614C, 0x614C, 0x07DA, 0x614D, 0x614D, 0x320B, 0x614E, 0x614E, 0x0D30,
+ 0x614F, 0x6150, 0x320C, 0x6151, 0x6151, 0x0D1E, 0x6152, 0x6154, 0x320E,
+ 0x6155, 0x6155, 0x0B20, 0x6156, 0x6157, 0x3211, 0x6158, 0x6158, 0x1E5E,
+ 0x6159, 0x6159, 0x3213, 0x615A, 0x615A, 0x1E5D, 0x615B, 0x615C, 0x3214,
+ 0x615D, 0x615D, 0x1A17, 0x615E, 0x615E, 0x3216, 0x615F, 0x615F, 0x23B7,
+ 0x6160, 0x6161, 0x3217, 0x6162, 0x6162, 0x0AA4, 0x6163, 0x6163, 0x1F2F,
+ 0x6164, 0x6164, 0x24DF, 0x6165, 0x6166, 0x3219, 0x6167, 0x6167, 0x07F0,
+ 0x6168, 0x6168, 0x093B, 0x6169, 0x6169, 0x321B, 0x616A, 0x616A, 0x23B2,
+ 0x616B, 0x616B, 0x214E, 0x616C, 0x616D, 0x321C, 0x616E, 0x616E, 0x2052,
+ 0x616F, 0x616F, 0x321E, 0x6170, 0x6170, 0x0ECE, 0x6171, 0x6172, 0x321F,
+ 0x6173, 0x6173, 0x23BC, 0x6174, 0x6174, 0x3221, 0x6175, 0x6175, 0x167C,
+ 0x6176, 0x6176, 0x20EB, 0x6177, 0x6177, 0x0943, 0x6178, 0x6181, 0x3222,
+ 0x6182, 0x6182, 0x2232, 0x6183, 0x6189, 0x322C, 0x618A, 0x618A, 0x1E3F,
+ 0x618B, 0x618B, 0x0458, 0x618C, 0x618D, 0x3233, 0x618E, 0x618E, 0x113A,
+ 0x618F, 0x618F, 0x3235, 0x6190, 0x6190, 0x201B, 0x6191, 0x6191, 0x20BC,
+ 0x6192, 0x6192, 0x23BE, 0x6193, 0x6193, 0x3236, 0x6194, 0x6194, 0x167E,
+ 0x6195, 0x6199, 0x3237, 0x619A, 0x619A, 0x1EAE, 0x619B, 0x619C, 0x323C,
+ 0x619D, 0x619D, 0x1A19, 0x619E, 0x61A3, 0x323E, 0x61A4, 0x61A4, 0x1EFB,
+ 0x61A5, 0x61A6, 0x3244, 0x61A7, 0x61A7, 0x167F, 0x61A8, 0x61A8, 0x0760,
+ 0x61A9, 0x61A9, 0x1A18, 0x61AA, 0x61AA, 0x3246, 0x61AB, 0x61AB, 0x2089,
+ 0x61AC, 0x61AC, 0x167D, 0x61AD, 0x61AD, 0x3247, 0x61AE, 0x61AE, 0x23B1,
+ 0x61AF, 0x61B1, 0x3248, 0x61B2, 0x61B2, 0x21C4, 0x61B3, 0x61B5, 0x324B,
+ 0x61B6, 0x61B6, 0x2214, 0x61B7, 0x61B7, 0x1680, 0x61B8, 0x61BD, 0x324E,
+ 0x61BE, 0x61BE, 0x076D, 0x61BF, 0x61C1, 0x3254, 0x61C2, 0x61C2, 0x05ED,
+ 0x61C3, 0x61C6, 0x3257, 0x61C7, 0x61C7, 0x1FDE, 0x61C8, 0x61C8, 0x0F83,
+ 0x61C9, 0x61C9, 0x2223, 0x61CA, 0x61CA, 0x03CE, 0x61CB, 0x61CB, 0x1A1A,
+ 0x61CC, 0x61CC, 0x23B6, 0x61CD, 0x61D0, 0x325B, 0x61D1, 0x61D1, 0x1A1B,
+ 0x61D2, 0x61D2, 0x09AC, 0x61D3, 0x61D3, 0x325F, 0x61D4, 0x61D4, 0x1681,
+ 0x61D5, 0x61DD, 0x3260, 0x61DE, 0x61DE, 0x268C, 0x61DF, 0x61DF, 0x24DE,
+ 0x61E0, 0x61E2, 0x3269, 0x61E3, 0x61E3, 0x24E0, 0x61E4, 0x61E5, 0x326C,
+ 0x61E6, 0x61E6, 0x0B74, 0x61E7, 0x61E7, 0x326E, 0x61E8, 0x61E8, 0x23B8,
+ 0x61E9, 0x61F1, 0x326F, 0x61F2, 0x61F2, 0x1E81, 0x61F3, 0x61F4, 0x3278,
+ 0x61F5, 0x61F5, 0x1682, 0x61F6, 0x61F6, 0x1FFE, 0x61F7, 0x61F7, 0x1F51,
+ 0x61F8, 0x61F8, 0x21E1, 0x61F9, 0x61F9, 0x327A, 0x61FA, 0x61FA, 0x23B0,
+ 0x61FB, 0x61FB, 0x327B, 0x61FC, 0x61FC, 0x1FCE, 0x61FD, 0x61FD, 0x327C,
+ 0x61FE, 0x61FE, 0x211E, 0x61FF, 0x61FF, 0x13E0, 0x6200, 0x6200, 0x2021,
+ 0x6201, 0x6205, 0x327D, 0x6206, 0x6206, 0x1A1C, 0x6207, 0x6207, 0x24E1,
+ 0x6208, 0x6208, 0x06E5, 0x6209, 0x6209, 0x3282, 0x620A, 0x620A, 0x0EFB,
+ 0x620B, 0x620B, 0x18F9, 0x620C, 0x620C, 0x0FB2, 0x620D, 0x620D, 0x0D90,
+ 0x620E, 0x620E, 0x0CB1, 0x620F, 0x620F, 0x0F24, 0x6210, 0x6210, 0x04EE,
+ 0x6211, 0x6211, 0x0EE1, 0x6212, 0x6212, 0x08B5, 0x6213, 0x6213, 0x3283,
+ 0x6214, 0x6214, 0x24A3, 0x6215, 0x6215, 0x169E, 0x6216, 0x6216, 0x0807,
+ 0x6217, 0x6217, 0x18FA, 0x6218, 0x6218, 0x115E, 0x6219, 0x6219, 0x3284,
+ 0x621A, 0x621A, 0x0BFC, 0x621B, 0x621B, 0x18FB, 0x621C, 0x621E, 0x3285,
+ 0x621F, 0x621F, 0x18FC, 0x6220, 0x6220, 0x3288, 0x6221, 0x6221, 0x18FE,
+ 0x6222, 0x6222, 0x18FD, 0x6223, 0x6223, 0x3289, 0x6224, 0x6224, 0x1900,
+ 0x6225, 0x6225, 0x18FF, 0x6226, 0x6226, 0x328A, 0x6227, 0x6227, 0x24A4,
+ 0x6228, 0x6229, 0x328B, 0x622A, 0x622A, 0x08A9, 0x622B, 0x622B, 0x328D,
+ 0x622C, 0x622C, 0x1901, 0x622D, 0x622D, 0x328E, 0x622E, 0x622E, 0x0A65,
+ 0x622F, 0x622F, 0x328F, 0x6230, 0x6230, 0x2273, 0x6231, 0x6231, 0x3290,
+ 0x6232, 0x6232, 0x21B0, 0x6233, 0x6233, 0x0544, 0x6234, 0x6234, 0x057A,
+ 0x6235, 0x6236, 0x3291, 0x6237, 0x6237, 0x07BC, 0x6238, 0x623C, 0x3293,
+ 0x623D, 0x623D, 0x19F4, 0x623E, 0x623E, 0x19F3, 0x623F, 0x623F, 0x065C,
+ 0x6240, 0x6240, 0x0DEE, 0x6241, 0x6241, 0x044B, 0x6242, 0x6242, 0x3298,
+ 0x6243, 0x6243, 0x19F5, 0x6244, 0x6246, 0x3299, 0x6247, 0x6247, 0x0D01,
+ 0x6248, 0x6249, 0x19F6, 0x624A, 0x624A, 0x329C, 0x624B, 0x624B, 0x0D6D,
+ 0x624C, 0x624C, 0x14BA, 0x624D, 0x624D, 0x048C, 0x624E, 0x624E, 0x113D,
+ 0x624F, 0x6250, 0x329D, 0x6251, 0x6251, 0x0BEA, 0x6252, 0x6252, 0x03D2,
+ 0x6253, 0x6253, 0x0575, 0x6254, 0x6254, 0x0CAE, 0x6255, 0x6257, 0x329F,
+ 0x6258, 0x6258, 0x0E81, 0x6259, 0x625A, 0x32A2, 0x625B, 0x625B, 0x0945,
+ 0x625C, 0x6262, 0x32A4, 0x6263, 0x6263, 0x0968, 0x6264, 0x6265, 0x32AB,
+ 0x6266, 0x6266, 0x0C21, 0x6267, 0x6267, 0x11B3, 0x6268, 0x6268, 0x32AD,
+ 0x6269, 0x6269, 0x0994, 0x626A, 0x626A, 0x14BB, 0x626B, 0x626B, 0x0CE1,
+ 0x626C, 0x626C, 0x1018, 0x626D, 0x626D, 0x0B65, 0x626E, 0x626E, 0x03F2,
+ 0x626F, 0x626F, 0x04DB, 0x6270, 0x6270, 0x0CA0, 0x6271, 0x6272, 0x32AE,
+ 0x6273, 0x6273, 0x03ED, 0x6274, 0x6275, 0x32B0, 0x6276, 0x6276, 0x0693,
+ 0x6277, 0x6278, 0x32B2, 0x6279, 0x6279, 0x0BBB, 0x627A, 0x627B, 0x32B4,
+ 0x627C, 0x627C, 0x0632, 0x627D, 0x627D, 0x32B6, 0x627E, 0x627E, 0x1173,
+ 0x627F, 0x627F, 0x04F5, 0x6280, 0x6280, 0x082F, 0x6281, 0x6283, 0x32B7,
+ 0x6284, 0x6284, 0x04D2, 0x6285, 0x6288, 0x32BA, 0x6289, 0x6289, 0x0920,
+ 0x628A, 0x628A, 0x03DC, 0x628B, 0x6290, 0x32BE, 0x6291, 0x6291, 0x105D,
+ 0x6292, 0x6292, 0x0D7A, 0x6293, 0x6293, 0x1202, 0x6294, 0x6294, 0x32C4,
+ 0x6295, 0x6295, 0x0E67, 0x6296, 0x6296, 0x05F5, 0x6297, 0x6297, 0x0946,
+ 0x6298, 0x6298, 0x117C, 0x6299, 0x6299, 0x32C5, 0x629A, 0x629A, 0x06A2,
+ 0x629B, 0x629B, 0x0B98, 0x629C, 0x629E, 0x32C6, 0x629F, 0x629F, 0x14BC,
+ 0x62A0, 0x62A0, 0x0966, 0x62A1, 0x62A1, 0x0A7C, 0x62A2, 0x62A2, 0x0C3D,
+ 0x62A3, 0x62A3, 0x32C9, 0x62A4, 0x62A4, 0x07B9, 0x62A5, 0x62A5, 0x0411,
+ 0x62A6, 0x62A7, 0x32CA, 0x62A8, 0x62A8, 0x0BAB, 0x62A9, 0x62AA, 0x32CC,
+ 0x62AB, 0x62AB, 0x0BBC, 0x62AC, 0x62AC, 0x0DFA, 0x62AD, 0x62B0, 0x32CE,
+ 0x62B1, 0x62B1, 0x0410, 0x62B2, 0x62B4, 0x32D2, 0x62B5, 0x62B5, 0x05B7,
+ 0x62B6, 0x62B8, 0x32D5, 0x62B9, 0x62B9, 0x0B0B, 0x62BA, 0x62BA, 0x32D8,
+ 0x62BB, 0x62BB, 0x14BD, 0x62BC, 0x62BC, 0x0FE3, 0x62BD, 0x62BD, 0x050E,
+ 0x62BE, 0x62BE, 0x32D9, 0x62BF, 0x62BF, 0x0AF7, 0x62C0, 0x62C1, 0x32DA,
+ 0x62C2, 0x62C2, 0x0694, 0x62C3, 0x62C3, 0x32DC, 0x62C4, 0x62C4, 0x11F3,
+ 0x62C5, 0x62C5, 0x0584, 0x62C6, 0x62C6, 0x04B7, 0x62C7, 0x62C7, 0x0B17,
+ 0x62C8, 0x62C8, 0x0B4C, 0x62C9, 0x62C9, 0x0998, 0x62CA, 0x62CA, 0x14BE,
+ 0x62CB, 0x62CB, 0x32DD, 0x62CC, 0x62CC, 0x03F3, 0x62CD, 0x62CD, 0x0B85,
+ 0x62CE, 0x62CE, 0x0A29, 0x62CF, 0x62CF, 0x32DE, 0x62D0, 0x62D0, 0x072E,
+ 0x62D1, 0x62D1, 0x32DF, 0x62D2, 0x62D2, 0x090B, 0x62D3, 0x62D3, 0x0E89,
+ 0x62D4, 0x62D4, 0x03D9, 0x62D5, 0x62D5, 0x32E0, 0x62D6, 0x62D6, 0x0E80,
+ 0x62D7, 0x62D7, 0x14C0, 0x62D8, 0x62D8, 0x08FF, 0x62D9, 0x62D9, 0x121B,
+ 0x62DA, 0x62DA, 0x14BF, 0x62DB, 0x62DB, 0x1171, 0x62DC, 0x62DC, 0x03E8,
+ 0x62DD, 0x62DE, 0x32E1, 0x62DF, 0x62DF, 0x0B45, 0x62E0, 0x62E1, 0x32E3,
+ 0x62E2, 0x62E2, 0x0A4A, 0x62E3, 0x62E3, 0x0863, 0x62E4, 0x62E4, 0x32E5,
+ 0x62E5, 0x62E5, 0x109A, 0x62E6, 0x62E6, 0x09A4, 0x62E7, 0x62E7, 0x0B62,
+ 0x62E8, 0x62E8, 0x046D, 0x62E9, 0x62E9, 0x1134, 0x62EA, 0x62EB, 0x32E6,
+ 0x62EC, 0x62EC, 0x0993, 0x62ED, 0x62ED, 0x0D5A, 0x62EE, 0x62EE, 0x14C1,
+ 0x62EF, 0x62EF, 0x119D, 0x62F0, 0x62F0, 0x32E8, 0x62F1, 0x62F1, 0x0709,
+ 0x62F2, 0x62F2, 0x32E9, 0x62F3, 0x62F3, 0x0C88, 0x62F4, 0x62F4, 0x0D9E,
+ 0x62F5, 0x62F5, 0x32EA, 0x62F6, 0x62F6, 0x14C3, 0x62F7, 0x62F7, 0x094A,
+ 0x62F8, 0x62FB, 0x32EB, 0x62FC, 0x62FC, 0x0BD3, 0x62FD, 0x62FD, 0x1204,
+ 0x62FE, 0x62FE, 0x0D47, 0x62FF, 0x62FF, 0x0B26, 0x6300, 0x6300, 0x32EF,
+ 0x6301, 0x6301, 0x04FB, 0x6302, 0x6302, 0x072B, 0x6303, 0x6306, 0x32F0,
+ 0x6307, 0x6307, 0x11B7, 0x6308, 0x6308, 0x194E, 0x6309, 0x6309, 0x03BF,
+ 0x630A, 0x630D, 0x32F4, 0x630E, 0x630E, 0x0973, 0x630F, 0x6310, 0x32F8,
+ 0x6311, 0x6311, 0x0E47, 0x6312, 0x6315, 0x32FA, 0x6316, 0x6316, 0x0E8B,
+ 0x6317, 0x6319, 0x32FE, 0x631A, 0x631A, 0x11BE, 0x631B, 0x631B, 0x0A75,
+ 0x631C, 0x631C, 0x3301, 0x631D, 0x631D, 0x0EDD, 0x631E, 0x631E, 0x0DF5,
+ 0x631F, 0x631F, 0x0F79, 0x6320, 0x6320, 0x0B36, 0x6321, 0x6321, 0x0593,
+ 0x6322, 0x6322, 0x14C2, 0x6323, 0x6323, 0x1196, 0x6324, 0x6324, 0x082A,
+ 0x6325, 0x6325, 0x07E8, 0x6326, 0x6327, 0x3302, 0x6328, 0x6328, 0x03AF,
+ 0x6329, 0x6329, 0x3304, 0x632A, 0x632A, 0x0B73, 0x632B, 0x632B, 0x056F,
+ 0x632C, 0x632E, 0x3305, 0x632F, 0x632F, 0x1192, 0x6330, 0x6331, 0x3308,
+ 0x6332, 0x6332, 0x194F, 0x6333, 0x6338, 0x330A, 0x6339, 0x6339, 0x14C4,
+ 0x633A, 0x633A, 0x0E57, 0x633B, 0x633C, 0x3310, 0x633D, 0x633D, 0x0E9D,
+ 0x633E, 0x633E, 0x21D1, 0x633F, 0x6341, 0x3312, 0x6342, 0x6342, 0x0EF5,
+ 0x6343, 0x6343, 0x14C6, 0x6344, 0x6344, 0x3315, 0x6345, 0x6345, 0x0E62,
+ 0x6346, 0x6346, 0x0991, 0x6347, 0x6348, 0x3316, 0x6349, 0x6349, 0x121A,
+ 0x634A, 0x634A, 0x3318, 0x634B, 0x634B, 0x14C5, 0x634C, 0x634C, 0x03D1,
+ 0x634D, 0x634D, 0x076B, 0x634E, 0x634E, 0x0D0C, 0x634F, 0x634F, 0x0B56,
+ 0x6350, 0x6350, 0x0917, 0x6351, 0x6354, 0x3319, 0x6355, 0x6355, 0x047D,
+ 0x6356, 0x635D, 0x331D, 0x635E, 0x635E, 0x09B7, 0x635F, 0x635F, 0x0DE5,
+ 0x6360, 0x6360, 0x3325, 0x6361, 0x6361, 0x0864, 0x6362, 0x6362, 0x07D0,
+ 0x6363, 0x6363, 0x0598, 0x6364, 0x6366, 0x3326, 0x6367, 0x6367, 0x0BB6,
+ 0x6368, 0x6368, 0x211C, 0x6369, 0x6369, 0x14D0, 0x636A, 0x636A, 0x3329,
+ 0x636B, 0x636B, 0x235D, 0x636C, 0x636C, 0x332A, 0x636D, 0x636D, 0x14CD,
+ 0x636E, 0x636E, 0x090C, 0x636F, 0x6370, 0x332B, 0x6371, 0x6371, 0x14C9,
+ 0x6372, 0x6372, 0x2682, 0x6373, 0x6375, 0x332D, 0x6376, 0x6376, 0x053A,
+ 0x6377, 0x6377, 0x08AE, 0x6378, 0x6379, 0x3330, 0x637A, 0x637A, 0x14CA,
+ 0x637B, 0x637B, 0x0B50, 0x637C, 0x637F, 0x3332, 0x6380, 0x6380, 0x0F33,
+ 0x6381, 0x6381, 0x3336, 0x6382, 0x6382, 0x05C1, 0x6383, 0x6383, 0x210D,
+ 0x6384, 0x6384, 0x205A, 0x6385, 0x6386, 0x3337, 0x6387, 0x6387, 0x061D,
+ 0x6388, 0x6388, 0x0D71, 0x6389, 0x6389, 0x05D5, 0x638A, 0x638A, 0x14CF,
+ 0x638B, 0x638B, 0x3339, 0x638C, 0x638C, 0x1167, 0x638D, 0x638D, 0x333A,
+ 0x638E, 0x638E, 0x14CB, 0x638F, 0x638F, 0x0E20, 0x6390, 0x6390, 0x0C1D,
+ 0x6391, 0x6391, 0x333B, 0x6392, 0x6392, 0x0B86, 0x6393, 0x6395, 0x333C,
+ 0x6396, 0x6396, 0x103B, 0x6397, 0x6397, 0x333F, 0x6398, 0x6398, 0x0921,
+ 0x6399, 0x639F, 0x3340, 0x63A0, 0x63A0, 0x0A7A, 0x63A1, 0x63A1, 0x3347,
+ 0x63A2, 0x63A2, 0x0E10, 0x63A3, 0x63A3, 0x04DD, 0x63A4, 0x63A4, 0x3348,
+ 0x63A5, 0x63A5, 0x08A4, 0x63A6, 0x63A6, 0x3349, 0x63A7, 0x63A7, 0x0965,
+ 0x63A8, 0x63A8, 0x0E77, 0x63A9, 0x63A9, 0x1003, 0x63AA, 0x63AA, 0x056E,
+ 0x63AB, 0x63AB, 0x334A, 0x63AC, 0x63AC, 0x14CE, 0x63AD, 0x63AD, 0x14C7,
+ 0x63AE, 0x63AE, 0x14D1, 0x63AF, 0x63AF, 0x334B, 0x63B0, 0x63B0, 0x1950,
+ 0x63B1, 0x63B2, 0x334C, 0x63B3, 0x63B3, 0x0A57, 0x63B4, 0x63B4, 0x14CC,
+ 0x63B5, 0x63B6, 0x334E, 0x63B7, 0x63B7, 0x11BF, 0x63B8, 0x63B8, 0x0588,
+ 0x63B9, 0x63B9, 0x3350, 0x63BA, 0x63BA, 0x04BB, 0x63BB, 0x63BB, 0x3351,
+ 0x63BC, 0x63BC, 0x14D2, 0x63BD, 0x63BD, 0x3352, 0x63BE, 0x63BE, 0x14DC,
+ 0x63BF, 0x63BF, 0x3353, 0x63C0, 0x63C0, 0x1F8D, 0x63C1, 0x63C3, 0x3354,
+ 0x63C4, 0x63C4, 0x14D7, 0x63C5, 0x63C5, 0x3357, 0x63C6, 0x63C6, 0x14DB,
+ 0x63C7, 0x63C8, 0x3358, 0x63C9, 0x63C9, 0x0CBB, 0x63CA, 0x63CC, 0x335A,
+ 0x63CD, 0x63CD, 0x123E, 0x63CE, 0x63CE, 0x14D9, 0x63CF, 0x63CF, 0x0AED,
+ 0x63D0, 0x63D0, 0x0E34, 0x63D1, 0x63D1, 0x335D, 0x63D2, 0x63D2, 0x04AC,
+ 0x63D3, 0x63D5, 0x335E, 0x63D6, 0x63D6, 0x1045, 0x63D7, 0x63D9, 0x3361,
+ 0x63DA, 0x63DA, 0x21FF, 0x63DB, 0x63DD, 0x3364, 0x63DE, 0x63DE, 0x14D8,
+ 0x63DF, 0x63DF, 0x3367, 0x63E0, 0x63E0, 0x14D5, 0x63E1, 0x63E1, 0x0EE4,
+ 0x63E2, 0x63E2, 0x3368, 0x63E3, 0x63E3, 0x052A, 0x63E4, 0x63E8, 0x3369,
+ 0x63E9, 0x63E9, 0x0938, 0x63EA, 0x63EA, 0x08ED, 0x63EB, 0x63EC, 0x336E,
+ 0x63ED, 0x63ED, 0x08A3, 0x63EE, 0x63EE, 0x1F58, 0x63EF, 0x63F1, 0x3370,
+ 0x63F2, 0x63F2, 0x14D3, 0x63F3, 0x63F3, 0x3373, 0x63F4, 0x63F4, 0x10F1,
+ 0x63F5, 0x63F5, 0x3374, 0x63F6, 0x63F6, 0x14C8, 0x63F7, 0x63F7, 0x3375,
+ 0x63F8, 0x63F8, 0x14D4, 0x63F9, 0x63FC, 0x3376, 0x63FD, 0x63FD, 0x09AA,
+ 0x63FE, 0x63FE, 0x337A, 0x63FF, 0x63FF, 0x14D6, 0x6400, 0x6400, 0x04BA,
+ 0x6401, 0x6401, 0x06E4, 0x6402, 0x6402, 0x0A4E, 0x6403, 0x6404, 0x337B,
+ 0x6405, 0x6405, 0x0892, 0x6406, 0x640A, 0x337D, 0x640B, 0x640B, 0x14DF,
+ 0x640C, 0x640C, 0x14E2, 0x640D, 0x640D, 0x215B, 0x640E, 0x640E, 0x3382,
+ 0x640F, 0x640F, 0x0472, 0x6410, 0x6410, 0x0527, 0x6411, 0x6412, 0x3383,
+ 0x6413, 0x6413, 0x056D, 0x6414, 0x6414, 0x0CDF, 0x6415, 0x6416, 0x3385,
+ 0x6417, 0x6417, 0x1EB6, 0x6418, 0x641A, 0x3387, 0x641B, 0x641B, 0x14E0,
+ 0x641C, 0x641C, 0x0DC6, 0x641D, 0x641D, 0x338A, 0x641E, 0x641E, 0x06DE,
+ 0x641F, 0x641F, 0x338B, 0x6420, 0x6420, 0x14E1, 0x6421, 0x6421, 0x14E4,
+ 0x6422, 0x6425, 0x338C, 0x6426, 0x6426, 0x14E3, 0x6427, 0x6429, 0x3390,
+ 0x642A, 0x642A, 0x0E15, 0x642B, 0x642B, 0x3393, 0x642C, 0x642C, 0x03EC,
+ 0x642D, 0x642D, 0x0571, 0x642E, 0x6433, 0x3394, 0x6434, 0x6434, 0x1736,
+ 0x6435, 0x6435, 0x339A, 0x6436, 0x6436, 0x20DB, 0x6437, 0x6439, 0x339B,
+ 0x643A, 0x643A, 0x0F7A, 0x643B, 0x643C, 0x339E, 0x643D, 0x643D, 0x04B2,
+ 0x643E, 0x643E, 0x33A0, 0x643F, 0x643F, 0x1951, 0x6440, 0x6440, 0x33A1,
+ 0x6441, 0x6441, 0x14DE, 0x6442, 0x6443, 0x33A2, 0x6444, 0x6444, 0x0D1C,
+ 0x6445, 0x6445, 0x14DD, 0x6446, 0x6446, 0x03E5, 0x6447, 0x6447, 0x1028,
+ 0x6448, 0x6448, 0x0460, 0x6449, 0x6449, 0x33A4, 0x644A, 0x644A, 0x0E02,
+ 0x644B, 0x6450, 0x33A5, 0x6451, 0x6451, 0x2360, 0x6452, 0x6452, 0x14DA,
+ 0x6453, 0x6453, 0x33AB, 0x6454, 0x6454, 0x0D99, 0x6455, 0x6457, 0x33AC,
+ 0x6458, 0x6458, 0x114B, 0x6459, 0x645B, 0x33AF, 0x645C, 0x645C, 0x2361,
+ 0x645D, 0x645D, 0x33B2, 0x645E, 0x645E, 0x14E5, 0x645F, 0x645F, 0x2040,
+ 0x6460, 0x6466, 0x33B3, 0x6467, 0x6467, 0x0560, 0x6468, 0x6468, 0x33BA,
+ 0x6469, 0x6469, 0x0B09, 0x646A, 0x646C, 0x33BB, 0x646D, 0x646D, 0x14E7,
+ 0x646E, 0x646E, 0x33BE, 0x646F, 0x646F, 0x228E, 0x6470, 0x6472, 0x33BF,
+ 0x6473, 0x6473, 0x1FDF, 0x6474, 0x6475, 0x33C2, 0x6476, 0x6476, 0x235E,
+ 0x6477, 0x6477, 0x33C4, 0x6478, 0x6479, 0x0B03, 0x647A, 0x647A, 0x14E9,
+ 0x647B, 0x647B, 0x1E6A, 0x647C, 0x6481, 0x33C5, 0x6482, 0x6482, 0x0A15,
+ 0x6483, 0x6483, 0x33CB, 0x6484, 0x6484, 0x14E6, 0x6485, 0x6485, 0x091E,
+ 0x6486, 0x6486, 0x33CC, 0x6487, 0x6487, 0x0BD1, 0x6488, 0x6488, 0x2002,
+ 0x6489, 0x6490, 0x33CD, 0x6491, 0x6491, 0x04EA, 0x6492, 0x6492, 0x0CD1,
+ 0x6493, 0x6493, 0x2093, 0x6494, 0x6494, 0x33D5, 0x6495, 0x6495, 0x0DAF,
+ 0x6496, 0x6496, 0x14E8, 0x6497, 0x6498, 0x33D6, 0x6499, 0x6499, 0x14EC,
+ 0x649A, 0x649D, 0x33D8, 0x649E, 0x649E, 0x120F, 0x649F, 0x649F, 0x235F,
+ 0x64A0, 0x64A2, 0x33DC, 0x64A3, 0x64A3, 0x1EAC, 0x64A4, 0x64A4, 0x04DC,
+ 0x64A5, 0x64A5, 0x1E54, 0x64A6, 0x64A8, 0x33DF, 0x64A9, 0x64A9, 0x0A0C,
+ 0x64AA, 0x64AA, 0x33E2, 0x64AB, 0x64AB, 0x1F08, 0x64AC, 0x64AC, 0x0C48,
+ 0x64AD, 0x64AD, 0x046C, 0x64AE, 0x64AE, 0x056C, 0x64AF, 0x64AF, 0x33E3,
+ 0x64B0, 0x64B0, 0x1208, 0x64B1, 0x64B1, 0x33E4, 0x64B2, 0x64B2, 0x20C0,
+ 0x64B3, 0x64B3, 0x2362, 0x64B4, 0x64B4, 0x33E5, 0x64B5, 0x64B5, 0x0B4F,
+ 0x64B6, 0x64B6, 0x33E6, 0x64B7, 0x64B8, 0x14EA, 0x64B9, 0x64B9, 0x33E7,
+ 0x64BA, 0x64BA, 0x14ED, 0x64BB, 0x64BB, 0x2160, 0x64BC, 0x64BC, 0x076A,
+ 0x64BD, 0x64BD, 0x33E8, 0x64BE, 0x64BE, 0x219D, 0x64BF, 0x64BF, 0x1F8E,
+ 0x64C0, 0x64C0, 0x14EE, 0x64C1, 0x64C1, 0x222D, 0x64C2, 0x64C2, 0x09C9,
+ 0x64C3, 0x64C3, 0x33E9, 0x64C4, 0x64C4, 0x2047, 0x64C5, 0x64C5, 0x0CFC,
+ 0x64C6, 0x64C6, 0x33EA, 0x64C7, 0x64C7, 0x2262, 0x64C8, 0x64C9, 0x33EB,
+ 0x64CA, 0x64CA, 0x1F67, 0x64CB, 0x64CB, 0x1EB2, 0x64CC, 0x64CC, 0x33ED,
+ 0x64CD, 0x64CD, 0x04A0, 0x64CE, 0x64CE, 0x0C63, 0x64CF, 0x64CF, 0x33EE,
+ 0x64D0, 0x64D0, 0x14EF, 0x64D1, 0x64D1, 0x33EF, 0x64D2, 0x64D2, 0x0C59,
+ 0x64D3, 0x64D3, 0x33F0, 0x64D4, 0x64D4, 0x1EA9, 0x64D5, 0x64D6, 0x33F1,
+ 0x64D7, 0x64D7, 0x14F0, 0x64D8, 0x64D8, 0x1952, 0x64D9, 0x64D9, 0x33F3,
+ 0x64DA, 0x64DA, 0x1FCC, 0x64DB, 0x64DD, 0x33F4, 0x64DE, 0x64DE, 0x0DC8,
+ 0x64DF, 0x64DF, 0x33F7, 0x64E0, 0x64E0, 0x1F72, 0x64E1, 0x64E1, 0x33F8,
+ 0x64E2, 0x64E2, 0x14F2, 0x64E3, 0x64E3, 0x33F9, 0x64E4, 0x64E4, 0x14F1,
+ 0x64E5, 0x64E5, 0x33FA, 0x64E6, 0x64E6, 0x0488, 0x64E7, 0x64EB, 0x33FB,
+ 0x64EC, 0x64EC, 0x2098, 0x64ED, 0x64EE, 0x3400, 0x64EF, 0x64EF, 0x1E52,
+ 0x64F0, 0x64F0, 0x20A4, 0x64F1, 0x64F1, 0x1F1C, 0x64F2, 0x64F2, 0x228F,
+ 0x64F3, 0x64F3, 0x3402, 0x64F4, 0x64F4, 0x1FED, 0x64F5, 0x64F6, 0x3403,
+ 0x64F7, 0x64F7, 0x2365, 0x64F8, 0x64F9, 0x3405, 0x64FA, 0x64FA, 0x1E2D,
+ 0x64FB, 0x64FB, 0x2152, 0x64FC, 0x64FC, 0x2366, 0x64FD, 0x64FD, 0x3407,
+ 0x64FE, 0x64FE, 0x20FA, 0x64FF, 0x64FF, 0x3408, 0x6500, 0x6500, 0x0B8B,
+ 0x6501, 0x6503, 0x3409, 0x6504, 0x6504, 0x2363, 0x6505, 0x6505, 0x340C,
+ 0x6506, 0x6506, 0x209A, 0x6507, 0x6508, 0x340D, 0x6509, 0x6509, 0x14F3,
+ 0x650A, 0x650E, 0x340F, 0x650F, 0x650F, 0x203C, 0x6510, 0x6511, 0x3414,
+ 0x6512, 0x6512, 0x111F, 0x6513, 0x6513, 0x3416, 0x6514, 0x6514, 0x1FF6,
+ 0x6515, 0x6515, 0x3417, 0x6516, 0x6516, 0x2364, 0x6517, 0x6517, 0x3418,
+ 0x6518, 0x6518, 0x0C9C, 0x6519, 0x6519, 0x1E69, 0x651A, 0x651A, 0x3419,
+ 0x651B, 0x651B, 0x2367, 0x651C, 0x651C, 0x341A, 0x651D, 0x651D, 0x211D,
+ 0x651E, 0x6521, 0x341B, 0x6522, 0x6522, 0x2259, 0x6523, 0x6523, 0x2056,
+ 0x6524, 0x6524, 0x2163, 0x6525, 0x6525, 0x14F4, 0x6526, 0x6529, 0x341F,
+ 0x652A, 0x652A, 0x1FA9, 0x652B, 0x652B, 0x091F, 0x652C, 0x652C, 0x1FFC,
+ 0x652D, 0x652D, 0x3423, 0x652E, 0x652E, 0x14F5, 0x652F, 0x652F, 0x11A6,
+ 0x6530, 0x6533, 0x3424, 0x6534, 0x6534, 0x1909, 0x6535, 0x6535, 0x1966,
+ 0x6536, 0x6536, 0x0D6C, 0x6537, 0x6537, 0x3428, 0x6538, 0x6538, 0x12B2,
+ 0x6539, 0x6539, 0x06BF, 0x653A, 0x653A, 0x3429, 0x653B, 0x653B, 0x06FE,
+ 0x653C, 0x653D, 0x342A, 0x653E, 0x653E, 0x0662, 0x653F, 0x653F, 0x119F,
+ 0x6540, 0x6544, 0x342C, 0x6545, 0x6545, 0x0723, 0x6546, 0x6547, 0x3431,
+ 0x6548, 0x6548, 0x0F72, 0x6549, 0x6549, 0x1CCB, 0x654A, 0x654B, 0x3433,
+ 0x654C, 0x654C, 0x05B1, 0x654D, 0x654E, 0x3435, 0x654F, 0x654F, 0x0AF9,
+ 0x6550, 0x6550, 0x3437, 0x6551, 0x6551, 0x08F7, 0x6552, 0x6554, 0x3438,
+ 0x6555, 0x6555, 0x1967, 0x6556, 0x6556, 0x03C8, 0x6557, 0x6557, 0x1E2E,
+ 0x6558, 0x6558, 0x343B, 0x6559, 0x6559, 0x089D, 0x655A, 0x655A, 0x343C,
+ 0x655B, 0x655B, 0x09FB, 0x655C, 0x655C, 0x343D, 0x655D, 0x655D, 0x043F,
+ 0x655E, 0x655E, 0x04CD, 0x655F, 0x6561, 0x343E, 0x6562, 0x6562, 0x06CD,
+ 0x6563, 0x6563, 0x0CDB, 0x6564, 0x6565, 0x3441, 0x6566, 0x6566, 0x0617,
+ 0x6567, 0x656A, 0x3443, 0x656B, 0x656B, 0x1968, 0x656C, 0x656C, 0x08E3,
+ 0x656D, 0x656F, 0x3447, 0x6570, 0x6570, 0x0D94, 0x6571, 0x6571, 0x344A,
+ 0x6572, 0x6572, 0x0C40, 0x6573, 0x6573, 0x344B, 0x6574, 0x6574, 0x119C,
+ 0x6575, 0x6575, 0x1EBC, 0x6576, 0x6576, 0x344C, 0x6577, 0x6577, 0x0690,
+ 0x6578, 0x6578, 0x2142, 0x6579, 0x6581, 0x344D, 0x6582, 0x6582, 0x201E,
+ 0x6583, 0x6583, 0x1E43, 0x6584, 0x6586, 0x3456, 0x6587, 0x6587, 0x0ED3,
+ 0x6588, 0x658A, 0x3459, 0x658B, 0x658B, 0x114C, 0x658C, 0x658C, 0x045C,
+ 0x658D, 0x658F, 0x345C, 0x6590, 0x6590, 0x19C1, 0x6591, 0x6591, 0x03EA,
+ 0x6592, 0x6592, 0x345F, 0x6593, 0x6593, 0x19C3, 0x6594, 0x6594, 0x3460,
+ 0x6595, 0x6595, 0x24D4, 0x6596, 0x6596, 0x3461, 0x6597, 0x6597, 0x05F6,
+ 0x6598, 0x6598, 0x3462, 0x6599, 0x6599, 0x0A18, 0x659A, 0x659A, 0x3463,
+ 0x659B, 0x659B, 0x1D56, 0x659C, 0x659C, 0x0F7C, 0x659D, 0x659E, 0x3464,
+ 0x659F, 0x659F, 0x1186, 0x65A0, 0x65A0, 0x3466, 0x65A1, 0x65A1, 0x0EE2,
+ 0x65A2, 0x65A3, 0x3467, 0x65A4, 0x65A4, 0x08C0, 0x65A5, 0x65A5, 0x0507,
+ 0x65A6, 0x65A6, 0x3469, 0x65A7, 0x65A7, 0x06A6, 0x65A8, 0x65A8, 0x346A,
+ 0x65A9, 0x65A9, 0x1157, 0x65AA, 0x65AA, 0x346B, 0x65AB, 0x65AB, 0x1A29,
+ 0x65AC, 0x65AC, 0x226F, 0x65AD, 0x65AD, 0x060E, 0x65AE, 0x65AE, 0x346C,
+ 0x65AF, 0x65AF, 0x0DAE, 0x65B0, 0x65B0, 0x0F8D, 0x65B1, 0x65B6, 0x346D,
+ 0x65B7, 0x65B7, 0x1ED7, 0x65B8, 0x65B8, 0x3473, 0x65B9, 0x65B9, 0x065A,
+ 0x65BA, 0x65BB, 0x3474, 0x65BC, 0x65BC, 0x19C4, 0x65BD, 0x65BD, 0x0D40,
+ 0x65BE, 0x65C0, 0x3476, 0x65C1, 0x65C1, 0x0B95, 0x65C2, 0x65C2, 0x3479,
+ 0x65C3, 0x65C3, 0x19C7, 0x65C4, 0x65C4, 0x19C6, 0x65C5, 0x65C5, 0x0A6A,
+ 0x65C6, 0x65C6, 0x19C5, 0x65C7, 0x65CA, 0x347A, 0x65CB, 0x65CB, 0x0FC8,
+ 0x65CC, 0x65CC, 0x19C8, 0x65CD, 0x65CD, 0x347E, 0x65CE, 0x65CE, 0x19C9,
+ 0x65CF, 0x65CF, 0x1242, 0x65D0, 0x65D1, 0x347F, 0x65D2, 0x65D2, 0x19CA,
+ 0x65D3, 0x65D5, 0x3481, 0x65D6, 0x65D6, 0x19CB, 0x65D7, 0x65D7, 0x0C0B,
+ 0x65D8, 0x65DF, 0x3484, 0x65E0, 0x65E0, 0x0EED, 0x65E1, 0x65E1, 0x348C,
+ 0x65E2, 0x65E2, 0x083B, 0x65E3, 0x65E4, 0x348D, 0x65E5, 0x65E5, 0x0CB0,
+ 0x65E6, 0x65E6, 0x058A, 0x65E7, 0x65E7, 0x08F8, 0x65E8, 0x65E8, 0x11BB,
+ 0x65E9, 0x65E9, 0x112A, 0x65EA, 0x65EB, 0x348F, 0x65EC, 0x65EC, 0x0FD7,
+ 0x65ED, 0x65ED, 0x0FBC, 0x65EE, 0x65F0, 0x190A, 0x65F1, 0x65F1, 0x076C,
+ 0x65F2, 0x65F5, 0x3491, 0x65F6, 0x65F6, 0x0D48, 0x65F7, 0x65F7, 0x0982,
+ 0x65F8, 0x65F9, 0x3495, 0x65FA, 0x65FA, 0x0EAB, 0x65FB, 0x65FF, 0x3497,
+ 0x6600, 0x6600, 0x1912, 0x6601, 0x6601, 0x349C, 0x6602, 0x6602, 0x03C5,
+ 0x6603, 0x6603, 0x1910, 0x6604, 0x6605, 0x349D, 0x6606, 0x6606, 0x0990,
+ 0x6607, 0x6609, 0x349F, 0x660A, 0x660A, 0x190D, 0x660B, 0x660B, 0x34A2,
+ 0x660C, 0x660C, 0x04C4, 0x660D, 0x660D, 0x34A3, 0x660E, 0x660E, 0x0AFC,
+ 0x660F, 0x660F, 0x07FD, 0x6610, 0x6612, 0x34A4, 0x6613, 0x6613, 0x105E,
+ 0x6614, 0x6614, 0x0F03, 0x6615, 0x6615, 0x1911, 0x6616, 0x6618, 0x34A7,
+ 0x6619, 0x6619, 0x190E, 0x661A, 0x661C, 0x34AA, 0x661D, 0x661D, 0x1915,
+ 0x661E, 0x661E, 0x34AD, 0x661F, 0x661F, 0x0F92, 0x6620, 0x6620, 0x1098,
+ 0x6621, 0x6624, 0x34AE, 0x6625, 0x6625, 0x053D, 0x6626, 0x6626, 0x34B2,
+ 0x6627, 0x6627, 0x0AC6, 0x6628, 0x6628, 0x124F, 0x6629, 0x662C, 0x34B3,
+ 0x662D, 0x662D, 0x1172, 0x662E, 0x662E, 0x34B7, 0x662F, 0x662F, 0x0D5E,
+ 0x6630, 0x6630, 0x34B8, 0x6631, 0x6631, 0x1917, 0x6632, 0x6633, 0x34B9,
+ 0x6634, 0x6634, 0x1916, 0x6635, 0x6635, 0x1919, 0x6636, 0x6636, 0x1918,
+ 0x6637, 0x663B, 0x34BB, 0x663C, 0x663C, 0x11E6, 0x663D, 0x663D, 0x34C0,
+ 0x663E, 0x663E, 0x0F41, 0x663F, 0x6640, 0x34C1, 0x6641, 0x6641, 0x191D,
+ 0x6642, 0x6642, 0x212D, 0x6643, 0x6643, 0x07E3, 0x6644, 0x664A, 0x34C3,
+ 0x664B, 0x664B, 0x08CB, 0x664C, 0x664C, 0x0D07, 0x664D, 0x664E, 0x34CA,
+ 0x664F, 0x664F, 0x191E, 0x6650, 0x6651, 0x34CC, 0x6652, 0x6652, 0x0CF2,
+ 0x6653, 0x6653, 0x0F6B, 0x6654, 0x6654, 0x191C, 0x6655, 0x6655, 0x1111,
+ 0x6656, 0x6656, 0x191F, 0x6657, 0x6657, 0x1921, 0x6658, 0x6659, 0x34CE,
+ 0x665A, 0x665A, 0x0E9E, 0x665B, 0x665C, 0x34D0, 0x665D, 0x665D, 0x229B,
+ 0x665E, 0x665E, 0x34D2, 0x665F, 0x665F, 0x191B, 0x6660, 0x6660, 0x34D3,
+ 0x6661, 0x6661, 0x1920, 0x6662, 0x6663, 0x34D4, 0x6664, 0x6664, 0x0EFD,
+ 0x6665, 0x6665, 0x34D6, 0x6666, 0x6666, 0x07F3, 0x6667, 0x6667, 0x34D7,
+ 0x6668, 0x6668, 0x04E4, 0x6669, 0x666D, 0x34D8, 0x666E, 0x666E, 0x0BF4,
+ 0x666F, 0x666F, 0x08DF, 0x6670, 0x6670, 0x0F09, 0x6671, 0x6673, 0x34DD,
+ 0x6674, 0x6674, 0x0C64, 0x6675, 0x6675, 0x34E0, 0x6676, 0x6676, 0x08D6,
+ 0x6677, 0x6677, 0x1922, 0x6678, 0x6679, 0x34E1, 0x667A, 0x667A, 0x11C6,
+ 0x667B, 0x667D, 0x34E3, 0x667E, 0x667E, 0x0A09, 0x667F, 0x6681, 0x34E6,
+ 0x6682, 0x6682, 0x1120, 0x6683, 0x6683, 0x34E9, 0x6684, 0x6684, 0x1923,
+ 0x6685, 0x6686, 0x34EA, 0x6687, 0x6687, 0x0F2B, 0x6688, 0x6688, 0x2256,
+ 0x6689, 0x6689, 0x24A8, 0x668A, 0x668B, 0x34EC, 0x668C, 0x668C, 0x1924,
+ 0x668D, 0x6690, 0x34EE, 0x6691, 0x6691, 0x0D85, 0x6692, 0x6695, 0x34F2,
+ 0x6696, 0x6696, 0x0B70, 0x6697, 0x6697, 0x03C0, 0x6698, 0x669C, 0x34F6,
+ 0x669D, 0x669D, 0x1926, 0x669E, 0x66A1, 0x34FB, 0x66A2, 0x66A2, 0x1E79,
+ 0x66A3, 0x66A6, 0x34FF, 0x66A7, 0x66A7, 0x1925, 0x66A8, 0x66A8, 0x1CDD,
+ 0x66A9, 0x66AA, 0x3503, 0x66AB, 0x66AB, 0x225A, 0x66AC, 0x66AD, 0x3505,
+ 0x66AE, 0x66AE, 0x0B1D, 0x66AF, 0x66B3, 0x3507, 0x66B4, 0x66B4, 0x0412,
+ 0x66B5, 0x66B8, 0x350C, 0x66B9, 0x66B9, 0x175B, 0x66BA, 0x66BD, 0x3510,
+ 0x66BE, 0x66BE, 0x1927, 0x66BF, 0x66C3, 0x3514, 0x66C4, 0x66C4, 0x24A7,
+ 0x66C5, 0x66C5, 0x3519, 0x66C6, 0x66C6, 0x2686, 0x66C7, 0x66C7, 0x24A6,
+ 0x66C8, 0x66C8, 0x351A, 0x66C9, 0x66C9, 0x21CE, 0x66CA, 0x66D5, 0x351B,
+ 0x66D6, 0x66D6, 0x24A9, 0x66D7, 0x66D8, 0x3527, 0x66D9, 0x66D9, 0x0D86,
+ 0x66DA, 0x66DA, 0x3529, 0x66DB, 0x66DC, 0x1928, 0x66DD, 0x66DD, 0x0BF7,
+ 0x66DE, 0x66DF, 0x352A, 0x66E0, 0x66E0, 0x1FE7, 0x66E1, 0x66E5, 0x352C,
+ 0x66E6, 0x66E6, 0x192A, 0x66E7, 0x66E8, 0x3531, 0x66E9, 0x66E9, 0x192B,
+ 0x66EA, 0x66EB, 0x3533, 0x66EC, 0x66EC, 0x2112, 0x66ED, 0x66EF, 0x3535,
+ 0x66F0, 0x66F0, 0x10FE, 0x66F1, 0x66F1, 0x3538, 0x66F2, 0x66F2, 0x0C77,
+ 0x66F3, 0x66F3, 0x103E, 0x66F4, 0x66F4, 0x06F7, 0x66F5, 0x66F6, 0x3539,
+ 0x66F7, 0x66F7, 0x1914, 0x66F8, 0x66F8, 0x213C, 0x66F9, 0x66F9, 0x04A3,
+ 0x66FA, 0x66FB, 0x353B, 0x66FC, 0x66FC, 0x0AA3, 0x66FD, 0x66FD, 0x353D,
+ 0x66FE, 0x66FE, 0x113B, 0x66FF, 0x66FF, 0x0E39, 0x6700, 0x6700, 0x124B,
+ 0x6701, 0x6702, 0x353E, 0x6703, 0x6703, 0x1F5C, 0x6704, 0x6707, 0x3540,
+ 0x6708, 0x6708, 0x1105, 0x6709, 0x6709, 0x10B5, 0x670A, 0x670A, 0x1973,
+ 0x670B, 0x670B, 0x0BB4, 0x670C, 0x670C, 0x3544, 0x670D, 0x670D, 0x069B,
+ 0x670E, 0x670F, 0x3545, 0x6710, 0x6710, 0x1984, 0x6711, 0x6713, 0x3547,
+ 0x6714, 0x6714, 0x0DAC, 0x6715, 0x6715, 0x198E, 0x6716, 0x6716, 0x354A,
+ 0x6717, 0x6717, 0x09B5, 0x6718, 0x671A, 0x354B, 0x671B, 0x671B, 0x0EAC,
+ 0x671C, 0x671C, 0x354E, 0x671D, 0x671D, 0x04D4, 0x671E, 0x671E, 0x354F,
+ 0x671F, 0x671F, 0x0BF9, 0x6720, 0x6725, 0x3550, 0x6726, 0x6726, 0x19AC,
+ 0x6727, 0x6727, 0x24C4, 0x6728, 0x6728, 0x0B21, 0x6729, 0x6729, 0x3556,
+ 0x672A, 0x672A, 0x0EC3, 0x672B, 0x672B, 0x0B0C, 0x672C, 0x672C, 0x0427,
+ 0x672D, 0x672D, 0x1140, 0x672E, 0x672E, 0x3557, 0x672F, 0x672F, 0x0D8C,
+ 0x6730, 0x6730, 0x3558, 0x6731, 0x6731, 0x11EB, 0x6732, 0x6733, 0x3559,
+ 0x6734, 0x6734, 0x0BF2, 0x6735, 0x6735, 0x0623, 0x6736, 0x6739, 0x355B,
+ 0x673A, 0x673A, 0x080F, 0x673B, 0x673C, 0x355F, 0x673D, 0x673D, 0x0FAB,
+ 0x673E, 0x673F, 0x3561, 0x6740, 0x6740, 0x0CEA, 0x6741, 0x6741, 0x3563,
+ 0x6742, 0x6742, 0x1116, 0x6743, 0x6743, 0x0C83, 0x6744, 0x6745, 0x3564,
+ 0x6746, 0x6746, 0x06C6, 0x6747, 0x6747, 0x3566, 0x6748, 0x6748, 0x1854,
+ 0x6749, 0x6749, 0x0CF5, 0x674A, 0x674B, 0x3567, 0x674C, 0x674C, 0x1851,
+ 0x674D, 0x674D, 0x3569, 0x674E, 0x674E, 0x09D9, 0x674F, 0x674F, 0x0F9E,
+ 0x6750, 0x6750, 0x048B, 0x6751, 0x6751, 0x0568, 0x6752, 0x6752, 0x356A,
+ 0x6753, 0x6753, 0x1852, 0x6754, 0x6755, 0x356B, 0x6756, 0x6756, 0x1169,
+ 0x6757, 0x675B, 0x356D, 0x675C, 0x675C, 0x0604, 0x675D, 0x675D, 0x3572,
+ 0x675E, 0x675E, 0x1853, 0x675F, 0x675F, 0x0D8F, 0x6760, 0x6760, 0x06D7,
+ 0x6761, 0x6761, 0x0E48, 0x6762, 0x6764, 0x3573, 0x6765, 0x6765, 0x099F,
+ 0x6766, 0x6767, 0x3576, 0x6768, 0x6768, 0x1017, 0x6769, 0x6769, 0x1855,
+ 0x676A, 0x676A, 0x1858, 0x676B, 0x676C, 0x3578, 0x676D, 0x676D, 0x0773,
+ 0x676E, 0x676E, 0x357A, 0x676F, 0x676F, 0x0416, 0x6770, 0x6770, 0x08AD,
+ 0x6771, 0x6771, 0x1ECC, 0x6772, 0x6772, 0x190F, 0x6773, 0x6773, 0x1859,
+ 0x6774, 0x6774, 0x357B, 0x6775, 0x6775, 0x185C, 0x6776, 0x6776, 0x357C,
+ 0x6777, 0x6777, 0x1861, 0x6778, 0x677B, 0x357D, 0x677C, 0x677C, 0x1862,
+ 0x677D, 0x677D, 0x3581, 0x677E, 0x677E, 0x0DBE, 0x677F, 0x677F, 0x03F0,
+ 0x6780, 0x6780, 0x3582, 0x6781, 0x6781, 0x081E, 0x6782, 0x6783, 0x3583,
+ 0x6784, 0x6784, 0x0712, 0x6785, 0x6786, 0x3585, 0x6787, 0x6787, 0x1857,
+ 0x6788, 0x6788, 0x3587, 0x6789, 0x6789, 0x0EA8, 0x678A, 0x678A, 0x3588,
+ 0x678B, 0x678B, 0x1860, 0x678C, 0x678F, 0x3589, 0x6790, 0x6790, 0x0F05,
+ 0x6791, 0x6794, 0x358D, 0x6795, 0x6795, 0x118E, 0x6796, 0x6796, 0x3591,
+ 0x6797, 0x6797, 0x0A1F, 0x6798, 0x6798, 0x185A, 0x6799, 0x6799, 0x3592,
+ 0x679A, 0x679A, 0x0ABB, 0x679B, 0x679B, 0x3593, 0x679C, 0x679C, 0x0754,
+ 0x679D, 0x679D, 0x11A5, 0x679E, 0x679E, 0x185E, 0x679F, 0x67A1, 0x3594,
+ 0x67A2, 0x67A2, 0x0D77, 0x67A3, 0x67A3, 0x1129, 0x67A4, 0x67A4, 0x3597,
+ 0x67A5, 0x67A5, 0x1856, 0x67A6, 0x67A6, 0x3598, 0x67A7, 0x67A7, 0x185B,
+ 0x67A8, 0x67A8, 0x185D, 0x67A9, 0x67A9, 0x3599, 0x67AA, 0x67AA, 0x0C36,
+ 0x67AB, 0x67AB, 0x0680, 0x67AC, 0x67AC, 0x359A, 0x67AD, 0x67AD, 0x185F,
+ 0x67AE, 0x67AE, 0x359B, 0x67AF, 0x67AF, 0x096A, 0x67B0, 0x67B0, 0x1868,
+ 0x67B1, 0x67B2, 0x359C, 0x67B3, 0x67B3, 0x186D, 0x67B4, 0x67B4, 0x359E,
+ 0x67B5, 0x67B5, 0x186B, 0x67B6, 0x67B6, 0x084F, 0x67B7, 0x67B7, 0x0842,
+ 0x67B8, 0x67B8, 0x1871, 0x67B9, 0x67C0, 0x359F, 0x67C1, 0x67C1, 0x1874,
+ 0x67C2, 0x67C2, 0x35A7, 0x67C3, 0x67C3, 0x1870, 0x67C4, 0x67C4, 0x0463,
+ 0x67C5, 0x67CE, 0x35A8, 0x67CF, 0x67CF, 0x03E3, 0x67D0, 0x67D0, 0x0B16,
+ 0x67D1, 0x67D1, 0x06C7, 0x67D2, 0x67D2, 0x0C01, 0x67D3, 0x67D3, 0x0C99,
+ 0x67D4, 0x67D4, 0x0CBC, 0x67D5, 0x67D7, 0x35B2, 0x67D8, 0x67D8, 0x1865,
+ 0x67D9, 0x67D9, 0x186A, 0x67DA, 0x67DA, 0x186C, 0x67DB, 0x67DB, 0x35B5,
+ 0x67DC, 0x67DC, 0x074A, 0x67DD, 0x67DD, 0x186E, 0x67DE, 0x67DE, 0x1252,
+ 0x67DF, 0x67DF, 0x35B6, 0x67E0, 0x67E0, 0x0B5E, 0x67E1, 0x67E1, 0x35B7,
+ 0x67E2, 0x67E2, 0x1872, 0x67E3, 0x67E4, 0x35B8, 0x67E5, 0x67E5, 0x04B0,
+ 0x67E6, 0x67E8, 0x35BA, 0x67E9, 0x67E9, 0x1867, 0x67EA, 0x67EB, 0x35BD,
+ 0x67EC, 0x67EC, 0x0860, 0x67ED, 0x67EE, 0x35BF, 0x67EF, 0x67EF, 0x094F,
+ 0x67F0, 0x67F0, 0x1863, 0x67F1, 0x67F1, 0x11F8, 0x67F2, 0x67F2, 0x35C1,
+ 0x67F3, 0x67F3, 0x0A41, 0x67F4, 0x67F4, 0x04B8, 0x67F5, 0x67FC, 0x35C2,
+ 0x67FD, 0x67FD, 0x1875, 0x67FE, 0x67FE, 0x35CA, 0x67FF, 0x67FF, 0x0D58,
+ 0x6800, 0x6800, 0x186F, 0x6801, 0x6804, 0x35CB, 0x6805, 0x6805, 0x1145,
+ 0x6806, 0x6806, 0x35CF, 0x6807, 0x6807, 0x0453, 0x6808, 0x6808, 0x115C,
+ 0x6809, 0x6809, 0x1864, 0x680A, 0x680A, 0x1866, 0x680B, 0x680B, 0x05EF,
+ 0x680C, 0x680C, 0x1869, 0x680D, 0x680D, 0x35D0, 0x680E, 0x680E, 0x1873,
+ 0x680F, 0x680F, 0x09A3, 0x6810, 0x6810, 0x35D1, 0x6811, 0x6811, 0x0D8E,
+ 0x6812, 0x6812, 0x35D2, 0x6813, 0x6813, 0x0D9D, 0x6814, 0x6815, 0x35D3,
+ 0x6816, 0x6816, 0x0BFB, 0x6817, 0x6817, 0x09E0, 0x6818, 0x681C, 0x35D5,
+ 0x681D, 0x681D, 0x187F, 0x681E, 0x6820, 0x35DA, 0x6821, 0x6821, 0x0F6E,
+ 0x6822, 0x6828, 0x35DD, 0x6829, 0x6829, 0x1888, 0x682A, 0x682A, 0x11E9,
+ 0x682B, 0x6831, 0x35E4, 0x6832, 0x6833, 0x1876, 0x6834, 0x6836, 0x35EB,
+ 0x6837, 0x6837, 0x1022, 0x6838, 0x6838, 0x0782, 0x6839, 0x6839, 0x06F4,
+ 0x683A, 0x683B, 0x35EE, 0x683C, 0x683C, 0x06EC, 0x683D, 0x683D, 0x1117,
+ 0x683E, 0x683E, 0x1885, 0x683F, 0x683F, 0x35F0, 0x6840, 0x6840, 0x1884,
+ 0x6841, 0x6841, 0x1882, 0x6842, 0x6842, 0x0749, 0x6843, 0x6843, 0x0E25,
+ 0x6844, 0x6844, 0x187C, 0x6845, 0x6845, 0x0EB5, 0x6846, 0x6846, 0x097F,
+ 0x6847, 0x6847, 0x35F1, 0x6848, 0x6848, 0x03C3, 0x6849, 0x6849, 0x1887,
+ 0x684A, 0x684A, 0x1886, 0x684B, 0x684B, 0x35F2, 0x684C, 0x684C, 0x121D,
+ 0x684D, 0x684D, 0x35F3, 0x684E, 0x684E, 0x187A, 0x684F, 0x684F, 0x35F4,
+ 0x6850, 0x6850, 0x0E5A, 0x6851, 0x6851, 0x0CDC, 0x6852, 0x6852, 0x35F5,
+ 0x6853, 0x6853, 0x07CD, 0x6854, 0x6854, 0x08AC, 0x6855, 0x6855, 0x1880,
+ 0x6856, 0x685F, 0x35F6, 0x6860, 0x6861, 0x1878, 0x6862, 0x6862, 0x187B,
+ 0x6863, 0x6863, 0x0596, 0x6864, 0x6864, 0x187D, 0x6865, 0x6865, 0x0C42,
+ 0x6866, 0x6866, 0x1881, 0x6867, 0x6867, 0x1883, 0x6868, 0x6868, 0x0881,
+ 0x6869, 0x6869, 0x120B, 0x686A, 0x686A, 0x3600, 0x686B, 0x686B, 0x188E,
+ 0x686C, 0x6873, 0x3601, 0x6874, 0x6874, 0x188B, 0x6875, 0x6875, 0x3609,
+ 0x6876, 0x6876, 0x0E61, 0x6877, 0x6877, 0x188C, 0x6878, 0x6880, 0x360A,
+ 0x6881, 0x6881, 0x0A03, 0x6882, 0x6882, 0x3613, 0x6883, 0x6883, 0x187E,
+ 0x6884, 0x6884, 0x3614, 0x6885, 0x6885, 0x0ABC, 0x6886, 0x6886, 0x03FB,
+ 0x6887, 0x688E, 0x3615, 0x688F, 0x688F, 0x188A, 0x6890, 0x6892, 0x361D,
+ 0x6893, 0x6893, 0x188D, 0x6894, 0x6896, 0x3620, 0x6897, 0x6897, 0x06FC,
+ 0x6898, 0x6898, 0x246A, 0x6899, 0x689C, 0x3623, 0x689D, 0x689D, 0x2175,
+ 0x689E, 0x689E, 0x3627, 0x689F, 0x689F, 0x246D, 0x68A0, 0x68A1, 0x3628,
+ 0x68A2, 0x68A2, 0x0D0B, 0x68A3, 0x68A5, 0x362A, 0x68A6, 0x68A6, 0x0AD3,
+ 0x68A7, 0x68A7, 0x0EEF, 0x68A8, 0x68A8, 0x09D1, 0x68A9, 0x68AC, 0x362D,
+ 0x68AD, 0x68AD, 0x0DE8, 0x68AE, 0x68AE, 0x3631, 0x68AF, 0x68AF, 0x0E30,
+ 0x68B0, 0x68B0, 0x0F80, 0x68B1, 0x68B2, 0x3632, 0x68B3, 0x68B3, 0x0D78,
+ 0x68B4, 0x68B4, 0x3634, 0x68B5, 0x68B5, 0x1889, 0x68B6, 0x68BF, 0x3635,
+ 0x68C0, 0x68C0, 0x085F, 0x68C1, 0x68C1, 0x363F, 0x68C2, 0x68C2, 0x188F,
+ 0x68C3, 0x68C8, 0x3640, 0x68C9, 0x68C9, 0x0AE3, 0x68CA, 0x68CA, 0x3646,
+ 0x68CB, 0x68CB, 0x0C04, 0x68CC, 0x68CC, 0x3647, 0x68CD, 0x68CD, 0x0750,
+ 0x68CE, 0x68D1, 0x3648, 0x68D2, 0x68D2, 0x03FF, 0x68D3, 0x68D4, 0x364C,
+ 0x68D5, 0x68D5, 0x1235, 0x68D6, 0x68D6, 0x246B, 0x68D7, 0x68D7, 0x225F,
+ 0x68D8, 0x68D8, 0x081F, 0x68D9, 0x68D9, 0x364E, 0x68DA, 0x68DA, 0x0BB0,
+ 0x68DB, 0x68DE, 0x364F, 0x68DF, 0x68DF, 0x1ECE, 0x68E0, 0x68E0, 0x0E17,
+ 0x68E1, 0x68E2, 0x3653, 0x68E3, 0x68E3, 0x189A, 0x68E4, 0x68E6, 0x3655,
+ 0x68E7, 0x68E7, 0x2272, 0x68E8, 0x68ED, 0x3658, 0x68EE, 0x68EE, 0x0CE6,
+ 0x68EF, 0x68EF, 0x365E, 0x68F0, 0x68F0, 0x1896, 0x68F1, 0x68F1, 0x09CD,
+ 0x68F2, 0x68F4, 0x365F, 0x68F5, 0x68F5, 0x0950, 0x68F6, 0x68F8, 0x3662,
+ 0x68F9, 0x68F9, 0x1894, 0x68FA, 0x68FA, 0x0730, 0x68FB, 0x68FB, 0x3665,
+ 0x68FC, 0x68FC, 0x1891, 0x68FD, 0x68FF, 0x3666, 0x6900, 0x6900, 0x3669,
+ 0x6901, 0x6901, 0x1898, 0x6902, 0x6904, 0x366A, 0x6905, 0x6905, 0x1055,
+ 0x6906, 0x690A, 0x366D, 0x690B, 0x690B, 0x1897, 0x690C, 0x690C, 0x3672,
+ 0x690D, 0x690D, 0x11B1, 0x690E, 0x690E, 0x1212, 0x690F, 0x690F, 0x2473,
+ 0x6910, 0x6910, 0x189B, 0x6911, 0x6911, 0x3673, 0x6912, 0x6912, 0x0888,
+ 0x6913, 0x691E, 0x3674, 0x691F, 0x6920, 0x1892, 0x6921, 0x6923, 0x3680,
+ 0x6924, 0x6924, 0x1895, 0x6925, 0x692C, 0x3683, 0x692D, 0x692D, 0x0E87,
+ 0x692E, 0x692F, 0x368B, 0x6930, 0x6930, 0x1033, 0x6931, 0x6933, 0x368D,
+ 0x6934, 0x6934, 0x18A6, 0x6935, 0x6938, 0x3690, 0x6939, 0x6939, 0x189D,
+ 0x693A, 0x693C, 0x3694, 0x693D, 0x693D, 0x052D, 0x693E, 0x693E, 0x3697,
+ 0x693F, 0x693F, 0x053E, 0x6940, 0x6941, 0x3698, 0x6942, 0x6942, 0x189F,
+ 0x6943, 0x6949, 0x369A, 0x694A, 0x694A, 0x21FE, 0x694B, 0x6952, 0x36A1,
+ 0x6953, 0x6953, 0x1EFE, 0x6954, 0x6954, 0x0F73, 0x6955, 0x6956, 0x36A9,
+ 0x6957, 0x6957, 0x1899, 0x6958, 0x6959, 0x36AB, 0x695A, 0x695A, 0x0523,
+ 0x695B, 0x695C, 0x36AD, 0x695D, 0x695D, 0x18A0, 0x695E, 0x695E, 0x09CE,
+ 0x695F, 0x695F, 0x36AF, 0x6960, 0x6960, 0x189E, 0x6961, 0x6962, 0x36B0,
+ 0x6963, 0x6963, 0x18AD, 0x6964, 0x6965, 0x36B2, 0x6966, 0x6966, 0x18AC,
+ 0x6967, 0x6967, 0x36B4, 0x6968, 0x6968, 0x2475, 0x6969, 0x696A, 0x36B5,
+ 0x696B, 0x696B, 0x18A2, 0x696C, 0x696C, 0x36B7, 0x696D, 0x696D, 0x220A,
+ 0x696E, 0x696E, 0x1890, 0x696F, 0x6970, 0x36B8, 0x6971, 0x6971, 0x189C,
+ 0x6972, 0x6974, 0x36BA, 0x6975, 0x6975, 0x1F6F, 0x6976, 0x6976, 0x36BD,
+ 0x6977, 0x6977, 0x0939, 0x6978, 0x6978, 0x18A5, 0x6979, 0x6979, 0x18AE,
+ 0x697A, 0x697B, 0x36BE, 0x697C, 0x697C, 0x0A4C, 0x697D, 0x697F, 0x36C0,
+ 0x6980, 0x6980, 0x18A3, 0x6981, 0x6981, 0x36C3, 0x6982, 0x6982, 0x06C0,
+ 0x6983, 0x6983, 0x36C4, 0x6984, 0x6984, 0x18A1, 0x6985, 0x6985, 0x36C5,
+ 0x6986, 0x6986, 0x10C1, 0x6987, 0x6988, 0x18A8, 0x6989, 0x6989, 0x18AB,
+ 0x698A, 0x698C, 0x36C6, 0x698D, 0x698D, 0x18BB, 0x698E, 0x6993, 0x36C9,
+ 0x6994, 0x6994, 0x09B1, 0x6995, 0x6995, 0x18B9, 0x6996, 0x6997, 0x36CF,
+ 0x6998, 0x6998, 0x18A4, 0x6999, 0x699A, 0x36D1, 0x699B, 0x699B, 0x18AF,
+ 0x699C, 0x699C, 0x03FC, 0x699D, 0x69A6, 0x36D3, 0x69A7, 0x69A7, 0x18B0,
+ 0x69A8, 0x69A8, 0x1146, 0x69A9, 0x69A9, 0x36DD, 0x69AA, 0x69AA, 0x2468,
+ 0x69AB, 0x69AB, 0x18B2, 0x69AC, 0x69AC, 0x36DE, 0x69AD, 0x69AD, 0x18B3,
+ 0x69AE, 0x69AE, 0x2100, 0x69AF, 0x69B0, 0x36DF, 0x69B1, 0x69B1, 0x18B5,
+ 0x69B2, 0x69B3, 0x36E1, 0x69B4, 0x69B4, 0x0A3A, 0x69B5, 0x69B6, 0x36E3,
+ 0x69B7, 0x69B7, 0x0C91, 0x69B8, 0x69BA, 0x36E5, 0x69BB, 0x69BB, 0x18B1,
+ 0x69BC, 0x69BE, 0x36E8, 0x69BF, 0x69BF, 0x2476, 0x69C0, 0x69C0, 0x36EB,
+ 0x69C1, 0x69C1, 0x18B6, 0x69C2, 0x69C9, 0x36EC, 0x69CA, 0x69CA, 0x18B7,
+ 0x69CB, 0x69CB, 0x1F27, 0x69CC, 0x69CC, 0x18A7, 0x69CD, 0x69CD, 0x20D7,
+ 0x69CE, 0x69CE, 0x18AA, 0x69CF, 0x69CF, 0x36F4, 0x69D0, 0x69D0, 0x07C6,
+ 0x69D1, 0x69D3, 0x36F5, 0x69D4, 0x69D4, 0x18B4, 0x69D5, 0x69DA, 0x36F8,
+ 0x69DB, 0x69DB, 0x086A, 0x69DC, 0x69DE, 0x36FE, 0x69DF, 0x69DF, 0x18B8,
+ 0x69E0, 0x69E0, 0x18BA, 0x69E1, 0x69E6, 0x3701, 0x69E7, 0x69E7, 0x247C,
+ 0x69E8, 0x69EC, 0x3707, 0x69ED, 0x69ED, 0x18BE, 0x69EE, 0x69F1, 0x370C,
+ 0x69F2, 0x69F2, 0x18C2, 0x69F3, 0x69F3, 0x1FA1, 0x69F4, 0x69FC, 0x3710,
+ 0x69FD, 0x69FD, 0x04A2, 0x69FE, 0x69FE, 0x3719, 0x69FF, 0x69FF, 0x18BC,
+ 0x6A00, 0x6A00, 0x371A, 0x6A01, 0x6A01, 0x22AA, 0x6A02, 0x6A02, 0x2005,
+ 0x6A03, 0x6A04, 0x371B, 0x6A05, 0x6A05, 0x246C, 0x6A06, 0x6A09, 0x371D,
+ 0x6A0A, 0x6A0A, 0x064B, 0x6A0B, 0x6A12, 0x3721, 0x6A13, 0x6A13, 0x203E,
+ 0x6A14, 0x6A16, 0x3729, 0x6A17, 0x6A18, 0x18BF, 0x6A19, 0x6A19, 0x1E4C,
+ 0x6A1A, 0x6A1D, 0x372C, 0x6A1E, 0x6A1E, 0x213A, 0x6A1F, 0x6A1F, 0x1162,
+ 0x6A20, 0x6A20, 0x3730, 0x6A21, 0x6A21, 0x0B06, 0x6A22, 0x6A22, 0x3731,
+ 0x6A23, 0x6A23, 0x2204, 0x6A24, 0x6A27, 0x3732, 0x6A28, 0x6A28, 0x18CC,
+ 0x6A29, 0x6A29, 0x3736, 0x6A2A, 0x6A2A, 0x0798, 0x6A2B, 0x6A2E, 0x3737,
+ 0x6A2F, 0x6A2F, 0x18BD, 0x6A30, 0x6A30, 0x373B, 0x6A31, 0x6A31, 0x1088,
+ 0x6A32, 0x6A34, 0x373C, 0x6A35, 0x6A35, 0x18C8, 0x6A36, 0x6A37, 0x373F,
+ 0x6A38, 0x6A38, 0x20C3, 0x6A39, 0x6A39, 0x2140, 0x6A3A, 0x6A3A, 0x2477,
+ 0x6A3B, 0x6A3C, 0x3741, 0x6A3D, 0x6A3D, 0x18CB, 0x6A3E, 0x6A3E, 0x18C4,
+ 0x6A3F, 0x6A43, 0x3743, 0x6A44, 0x6A44, 0x18C3, 0x6A45, 0x6A46, 0x3748,
+ 0x6A47, 0x6A47, 0x0C3E, 0x6A48, 0x6A48, 0x2474, 0x6A49, 0x6A4A, 0x374A,
+ 0x6A4B, 0x6A4B, 0x20DD, 0x6A4C, 0x6A4F, 0x374C, 0x6A50, 0x6A50, 0x18C6,
+ 0x6A51, 0x6A57, 0x3750, 0x6A58, 0x6A58, 0x18CD, 0x6A59, 0x6A59, 0x04ED,
+ 0x6A5A, 0x6A5A, 0x3757, 0x6A5B, 0x6A5B, 0x18C7, 0x6A5C, 0x6A5E, 0x3758,
+ 0x6A5F, 0x6A5F, 0x1F68, 0x6A60, 0x6A60, 0x375B, 0x6A61, 0x6A61, 0x0F5D,
+ 0x6A62, 0x6A62, 0x2185, 0x6A63, 0x6A64, 0x375C, 0x6A65, 0x6A65, 0x18C1,
+ 0x6A66, 0x6A70, 0x375E, 0x6A71, 0x6A71, 0x051C, 0x6A72, 0x6A78, 0x3769,
+ 0x6A79, 0x6A79, 0x18CA, 0x6A7A, 0x6A7B, 0x3770, 0x6A7C, 0x6A7C, 0x18CE,
+ 0x6A7D, 0x6A7F, 0x3772, 0x6A80, 0x6A80, 0x0E07, 0x6A81, 0x6A83, 0x3775,
+ 0x6A84, 0x6A84, 0x0F1A, 0x6A85, 0x6A88, 0x3778, 0x6A89, 0x6A89, 0x2472,
+ 0x6A8A, 0x6A8D, 0x377C, 0x6A8E, 0x6A8E, 0x18C9, 0x6A8F, 0x6A8F, 0x3780,
+ 0x6A90, 0x6A90, 0x18D0, 0x6A91, 0x6A91, 0x18CF, 0x6A92, 0x6A93, 0x3781,
+ 0x6A94, 0x6A94, 0x1EB5, 0x6A95, 0x6A96, 0x3783, 0x6A97, 0x6A97, 0x18D2,
+ 0x6A98, 0x6A9B, 0x3785, 0x6A9C, 0x6A9C, 0x2478, 0x6A9D, 0x6A9F, 0x3789,
+ 0x6AA0, 0x6AA0, 0x18C5, 0x6AA1, 0x6AA1, 0x378C, 0x6AA2, 0x6AA2, 0x1F8B,
+ 0x6AA3, 0x6AA3, 0x2484, 0x6AA4, 0x6AA8, 0x378D, 0x6AA9, 0x6AA9, 0x18D1,
+ 0x6AAA, 0x6AAA, 0x3792, 0x6AAB, 0x6AAB, 0x18D3, 0x6AAC, 0x6AAC, 0x0ACF,
+ 0x6AAD, 0x6AAE, 0x3793, 0x6AAF, 0x6AAF, 0x2699, 0x6AB0, 0x6AB2, 0x3795,
+ 0x6AB3, 0x6AB3, 0x2482, 0x6AB4, 0x6AB7, 0x3798, 0x6AB8, 0x6AB8, 0x20A1,
+ 0x6AB9, 0x6ABA, 0x379C, 0x6ABB, 0x6ABB, 0x1F92, 0x6ABC, 0x6AC2, 0x379E,
+ 0x6AC3, 0x6AC3, 0x1F38, 0x6AC4, 0x6AD2, 0x37A5, 0x6AD3, 0x6AD3, 0x2485,
+ 0x6AD4, 0x6AD9, 0x37B4, 0x6ADA, 0x6ADA, 0x2480, 0x6ADB, 0x6ADB, 0x246E,
+ 0x6ADC, 0x6ADC, 0x37BA, 0x6ADD, 0x6ADD, 0x247B, 0x6ADE, 0x6ADE, 0x2486,
+ 0x6ADF, 0x6ADF, 0x2471, 0x6AE0, 0x6AE6, 0x37BB, 0x6AE7, 0x6AE7, 0x2483,
+ 0x6AE8, 0x6AE8, 0x2470, 0x6AE9, 0x6AE9, 0x37C2, 0x6AEA, 0x6AEA, 0x2469,
+ 0x6AEB, 0x6AEB, 0x37C3, 0x6AEC, 0x6AEC, 0x247F, 0x6AED, 0x6AF2, 0x37C4,
+ 0x6AF3, 0x6AF3, 0x246F, 0x6AF4, 0x6AF7, 0x37CA, 0x6AF8, 0x6AF8, 0x2481,
+ 0x6AF9, 0x6AFA, 0x37CE, 0x6AFB, 0x6AFB, 0x2220, 0x6AFC, 0x6AFF, 0x37D0,
+ 0x6B00, 0x6B03, 0x37D4, 0x6B04, 0x6B04, 0x1FF5, 0x6B05, 0x6B09, 0x37D8,
+ 0x6B0A, 0x6B0A, 0x20F4, 0x6B0B, 0x6B0E, 0x37DD, 0x6B0F, 0x6B0F, 0x247D,
+ 0x6B10, 0x6B11, 0x37E1, 0x6B12, 0x6B12, 0x2479, 0x6B13, 0x6B15, 0x37E3,
+ 0x6B16, 0x6B16, 0x247E, 0x6B17, 0x6B1D, 0x37E6, 0x6B1E, 0x6B1E, 0x247A,
+ 0x6B1F, 0x6B1F, 0x37ED, 0x6B20, 0x6B20, 0x0C34, 0x6B21, 0x6B21, 0x0551,
+ 0x6B22, 0x6B22, 0x07CB, 0x6B23, 0x6B23, 0x0F8B, 0x6B24, 0x6B24, 0x19B1,
+ 0x6B25, 0x6B26, 0x37EE, 0x6B27, 0x6B27, 0x0B78, 0x6B28, 0x6B31, 0x37F0,
+ 0x6B32, 0x6B32, 0x10E0, 0x6B33, 0x6B36, 0x37FA, 0x6B37, 0x6B37, 0x19B2,
+ 0x6B38, 0x6B38, 0x37FE, 0x6B39, 0x6B39, 0x19B3, 0x6B3A, 0x6B3A, 0x0BFA,
+ 0x6B3B, 0x6B3C, 0x37FF, 0x6B3D, 0x6B3D, 0x20E3, 0x6B3E, 0x6B3E, 0x097B,
+ 0x6B3F, 0x6B42, 0x3801, 0x6B43, 0x6B43, 0x19B4, 0x6B44, 0x6B45, 0x3805,
+ 0x6B46, 0x6B46, 0x19B5, 0x6B47, 0x6B47, 0x0F75, 0x6B48, 0x6B48, 0x3807,
+ 0x6B49, 0x6B49, 0x0C35, 0x6B4A, 0x6B4B, 0x3808, 0x6B4C, 0x6B4C, 0x06E3,
+ 0x6B4D, 0x6B4F, 0x380A, 0x6B50, 0x6B50, 0x20AD, 0x6B51, 0x6B58, 0x380D,
+ 0x6B59, 0x6B59, 0x19B6, 0x6B5A, 0x6B5E, 0x3815, 0x6B5F, 0x6B5F, 0x24CB,
+ 0x6B60, 0x6B60, 0x381A, 0x6B61, 0x6B61, 0x1F53, 0x6B62, 0x6B62, 0x11B8,
+ 0x6B63, 0x6B63, 0x119E, 0x6B64, 0x6B64, 0x054E, 0x6B65, 0x6B65, 0x0484,
+ 0x6B66, 0x6B66, 0x0EF3, 0x6B67, 0x6B67, 0x0C06, 0x6B68, 0x6B69, 0x381B,
+ 0x6B6A, 0x6B6A, 0x0E92, 0x6B6B, 0x6B71, 0x381D, 0x6B72, 0x6B72, 0x2159,
+ 0x6B73, 0x6B76, 0x3824, 0x6B77, 0x6B77, 0x2013, 0x6B78, 0x6B78, 0x1F33,
+ 0x6B79, 0x6B79, 0x0578, 0x6B7A, 0x6B7A, 0x3828, 0x6B7B, 0x6B7B, 0x0DB5,
+ 0x6B7C, 0x6B7C, 0x0852, 0x6B7D, 0x6B80, 0x3829, 0x6B81, 0x6B82, 0x18D6,
+ 0x6B83, 0x6B83, 0x1013, 0x6B84, 0x6B84, 0x18D9, 0x6B85, 0x6B85, 0x382D,
+ 0x6B86, 0x6B86, 0x057C, 0x6B87, 0x6B87, 0x18D8, 0x6B88, 0x6B88, 0x382E,
+ 0x6B89, 0x6B89, 0x0FDC, 0x6B8A, 0x6B8A, 0x0D79, 0x6B8B, 0x6B8B, 0x0497,
+ 0x6B8C, 0x6B8C, 0x382F, 0x6B8D, 0x6B8D, 0x18DC, 0x6B8E, 0x6B91, 0x3830,
+ 0x6B92, 0x6B93, 0x18DA, 0x6B94, 0x6B95, 0x3834, 0x6B96, 0x6B96, 0x11B2,
+ 0x6B97, 0x6B97, 0x3836, 0x6B98, 0x6B98, 0x1E5C, 0x6B99, 0x6B99, 0x3837,
+ 0x6B9A, 0x6B9B, 0x18DD, 0x6B9C, 0x6B9D, 0x3838, 0x6B9E, 0x6B9E, 0x2488,
+ 0x6B9F, 0x6BA0, 0x383A, 0x6BA1, 0x6BA1, 0x18DF, 0x6BA2, 0x6BA3, 0x383C,
+ 0x6BA4, 0x6BA4, 0x2487, 0x6BA5, 0x6BA9, 0x383E, 0x6BAA, 0x6BAA, 0x18E0,
+ 0x6BAB, 0x6BAB, 0x248A, 0x6BAC, 0x6BAD, 0x3843, 0x6BAE, 0x6BAE, 0x2489,
+ 0x6BAF, 0x6BAF, 0x248B, 0x6BB0, 0x6BB1, 0x3845, 0x6BB2, 0x6BB2, 0x1F83,
+ 0x6BB3, 0x6BB3, 0x19BD, 0x6BB4, 0x6BB4, 0x0B7A, 0x6BB5, 0x6BB5, 0x060D,
+ 0x6BB6, 0x6BB6, 0x3847, 0x6BB7, 0x6BB7, 0x107A, 0x6BB8, 0x6BB9, 0x3848,
+ 0x6BBA, 0x6BBA, 0x210F, 0x6BBB, 0x6BBB, 0x1FDB, 0x6BBC, 0x6BBE, 0x384A,
+ 0x6BBF, 0x6BBF, 0x05CF, 0x6BC0, 0x6BC0, 0x384D, 0x6BC1, 0x6BC1, 0x07EE,
+ 0x6BC2, 0x6BC2, 0x19BF, 0x6BC3, 0x6BC4, 0x384E, 0x6BC5, 0x6BC5, 0x106A,
+ 0x6BC6, 0x6BC6, 0x20AF, 0x6BC7, 0x6BCA, 0x3850, 0x6BCB, 0x6BCB, 0x0EF2,
+ 0x6BCC, 0x6BCC, 0x3854, 0x6BCD, 0x6BCD, 0x0B1B, 0x6BCE, 0x6BCE, 0x3855,
+ 0x6BCF, 0x6BCF, 0x0AC4, 0x6BD0, 0x6BD1, 0x3856, 0x6BD2, 0x6BD2, 0x05FD,
+ 0x6BD3, 0x6BD3, 0x126F, 0x6BD4, 0x6BD4, 0x0431, 0x6BD5, 0x6BD5, 0x0438,
+ 0x6BD6, 0x6BD6, 0x043A, 0x6BD7, 0x6BD7, 0x0BBF, 0x6BD8, 0x6BD8, 0x3858,
+ 0x6BD9, 0x6BD9, 0x0439, 0x6BDA, 0x6BDA, 0x3859, 0x6BDB, 0x6BDB, 0x0AB0,
+ 0x6BDC, 0x6BE0, 0x385A, 0x6BE1, 0x6BE1, 0x1152, 0x6BE2, 0x6BE9, 0x385F,
+ 0x6BEA, 0x6BEA, 0x1954, 0x6BEB, 0x6BEB, 0x0778, 0x6BEC, 0x6BEE, 0x3867,
+ 0x6BEF, 0x6BEF, 0x0E0D, 0x6BF0, 0x6BF2, 0x386A, 0x6BF3, 0x6BF3, 0x1955,
+ 0x6BF4, 0x6BF4, 0x386D, 0x6BF5, 0x6BF5, 0x1957, 0x6BF6, 0x6BF8, 0x386E,
+ 0x6BF9, 0x6BF9, 0x1958, 0x6BFA, 0x6BFC, 0x3871, 0x6BFD, 0x6BFD, 0x1956,
+ 0x6BFE, 0x6BFE, 0x3874, 0x6BFF, 0x6BFF, 0x24C0, 0x6C00, 0x6C04, 0x3875,
+ 0x6C05, 0x6C05, 0x1959, 0x6C06, 0x6C06, 0x195B, 0x6C07, 0x6C07, 0x195A,
+ 0x6C08, 0x6C08, 0x226D, 0x6C09, 0x6C0B, 0x387A, 0x6C0C, 0x6C0C, 0x24C1,
+ 0x6C0D, 0x6C0D, 0x195C, 0x6C0E, 0x6C0E, 0x387D, 0x6C0F, 0x6C0F, 0x0D66,
+ 0x6C10, 0x6C10, 0x126B, 0x6C11, 0x6C11, 0x0AF6, 0x6C12, 0x6C12, 0x387E,
+ 0x6C13, 0x6C13, 0x0AAA, 0x6C14, 0x6C14, 0x0C17, 0x6C15, 0x6C15, 0x195D,
+ 0x6C16, 0x6C16, 0x0B2D, 0x6C17, 0x6C17, 0x387F, 0x6C18, 0x6C1A, 0x195E,
+ 0x6C1B, 0x6C1B, 0x0672, 0x6C1C, 0x6C1E, 0x3880, 0x6C1F, 0x6C1F, 0x0697,
+ 0x6C20, 0x6C20, 0x3883, 0x6C21, 0x6C21, 0x1961, 0x6C22, 0x6C22, 0x0C5F,
+ 0x6C23, 0x6C23, 0x20CA, 0x6C24, 0x6C24, 0x1963, 0x6C25, 0x6C25, 0x3884,
+ 0x6C26, 0x6C26, 0x075B, 0x6C27, 0x6C27, 0x101E, 0x6C28, 0x6C28, 0x03BC,
+ 0x6C29, 0x6C29, 0x1962, 0x6C2A, 0x6C2A, 0x1964, 0x6C2B, 0x6C2B, 0x20E7,
+ 0x6C2C, 0x6C2C, 0x24C2, 0x6C2D, 0x6C2D, 0x3885, 0x6C2E, 0x6C2E, 0x058B,
+ 0x6C2F, 0x6C2F, 0x0A6F, 0x6C30, 0x6C30, 0x0C65, 0x6C31, 0x6C31, 0x3886,
+ 0x6C32, 0x6C32, 0x1965, 0x6C33, 0x6C33, 0x3887, 0x6C34, 0x6C34, 0x0DA3,
+ 0x6C35, 0x6C35, 0x169F, 0x6C36, 0x6C37, 0x3888, 0x6C38, 0x6C38, 0x10A5,
+ 0x6C39, 0x6C3C, 0x388A, 0x6C3D, 0x6C3D, 0x12EF, 0x6C3E, 0x6C3F, 0x388E,
+ 0x6C40, 0x6C40, 0x0E52, 0x6C41, 0x6C41, 0x11AC, 0x6C42, 0x6C42, 0x0C70,
+ 0x6C43, 0x6C45, 0x3890, 0x6C46, 0x6C46, 0x12F4, 0x6C47, 0x6C47, 0x07F8,
+ 0x6C48, 0x6C48, 0x3893, 0x6C49, 0x6C49, 0x0771, 0x6C4A, 0x6C4A, 0x16A2,
+ 0x6C4B, 0x6C4F, 0x3894, 0x6C50, 0x6C50, 0x0F18, 0x6C51, 0x6C53, 0x3899,
+ 0x6C54, 0x6C54, 0x16A0, 0x6C55, 0x6C55, 0x0D00, 0x6C56, 0x6C56, 0x389C,
+ 0x6C57, 0x6C57, 0x0770, 0x6C58, 0x6C5A, 0x389D, 0x6C5B, 0x6C5B, 0x0FDD,
+ 0x6C5C, 0x6C5C, 0x16A1, 0x6C5D, 0x6C5D, 0x0CC5, 0x6C5E, 0x6C5E, 0x0708,
+ 0x6C5F, 0x6C5F, 0x087E, 0x6C60, 0x6C60, 0x04FD, 0x6C61, 0x6C61, 0x0EEA,
+ 0x6C62, 0x6C63, 0x38A0, 0x6C64, 0x6C64, 0x0E13, 0x6C65, 0x6C67, 0x38A2,
+ 0x6C68, 0x6C69, 0x16A8, 0x6C6A, 0x6C6A, 0x0EA5, 0x6C6B, 0x6C6F, 0x38A5,
+ 0x6C70, 0x6C70, 0x0E00, 0x6C71, 0x6C71, 0x38AA, 0x6C72, 0x6C72, 0x0826,
+ 0x6C73, 0x6C73, 0x38AB, 0x6C74, 0x6C74, 0x16AA, 0x6C75, 0x6C75, 0x38AC,
+ 0x6C76, 0x6C76, 0x16AB, 0x6C77, 0x6C78, 0x38AD, 0x6C79, 0x6C79, 0x0FA5,
+ 0x6C7A, 0x6C7C, 0x38AF, 0x6C7D, 0x6C7D, 0x0C1A, 0x6C7E, 0x6C7E, 0x0677,
+ 0x6C7F, 0x6C80, 0x38B2, 0x6C81, 0x6C81, 0x0C5C, 0x6C82, 0x6C82, 0x1051,
+ 0x6C83, 0x6C83, 0x0EE5, 0x6C84, 0x6C84, 0x38B4, 0x6C85, 0x6C85, 0x16A4,
+ 0x6C86, 0x6C86, 0x16AC, 0x6C87, 0x6C87, 0x38B5, 0x6C88, 0x6C88, 0x0D2B,
+ 0x6C89, 0x6C89, 0x04E6, 0x6C8A, 0x6C8B, 0x38B6, 0x6C8C, 0x6C8C, 0x16A7,
+ 0x6C8D, 0x6C8E, 0x38B8, 0x6C8F, 0x6C8F, 0x0C02, 0x6C90, 0x6C90, 0x16A5,
+ 0x6C91, 0x6C92, 0x38BA, 0x6C93, 0x6C93, 0x1A1F, 0x6C94, 0x6C94, 0x16A6,
+ 0x6C95, 0x6C98, 0x38BC, 0x6C99, 0x6C99, 0x0CEC, 0x6C9A, 0x6C9A, 0x38C0,
+ 0x6C9B, 0x6C9B, 0x0BA7, 0x6C9C, 0x6C9E, 0x38C1, 0x6C9F, 0x6C9F, 0x070E,
+ 0x6CA0, 0x6CA0, 0x38C4, 0x6CA1, 0x6CA1, 0x0AC0, 0x6CA2, 0x6CA2, 0x38C5,
+ 0x6CA3, 0x6CA3, 0x16A3, 0x6CA4, 0x6CA4, 0x0B7E, 0x6CA5, 0x6CA5, 0x09ED,
+ 0x6CA6, 0x6CA6, 0x0A80, 0x6CA7, 0x6CA7, 0x049E, 0x6CA8, 0x6CA8, 0x38C6,
+ 0x6CA9, 0x6CA9, 0x16AD, 0x6CAA, 0x6CAA, 0x07BB, 0x6CAB, 0x6CAB, 0x0B10,
+ 0x6CAC, 0x6CAC, 0x38C7, 0x6CAD, 0x6CAD, 0x16B0, 0x6CAE, 0x6CAE, 0x0909,
+ 0x6CAF, 0x6CB0, 0x38C8, 0x6CB1, 0x6CB1, 0x16BB, 0x6CB2, 0x6CB2, 0x16B5,
+ 0x6CB3, 0x6CB3, 0x078A, 0x6CB4, 0x6CB7, 0x38CA, 0x6CB8, 0x6CB8, 0x066D,
+ 0x6CB9, 0x6CB9, 0x10B2, 0x6CBA, 0x6CBA, 0x38CE, 0x6CBB, 0x6CBB, 0x11CD,
+ 0x6CBC, 0x6CBC, 0x1174, 0x6CBD, 0x6CBD, 0x071A, 0x6CBE, 0x6CBE, 0x1155,
+ 0x6CBF, 0x6CBF, 0x1001, 0x6CC0, 0x6CC3, 0x38CF, 0x6CC4, 0x6CC4, 0x0F84,
+ 0x6CC5, 0x6CC5, 0x0C73, 0x6CC6, 0x6CC8, 0x38D3, 0x6CC9, 0x6CC9, 0x0C85,
+ 0x6CCA, 0x6CCA, 0x047B, 0x6CCB, 0x6CCB, 0x38D6, 0x6CCC, 0x6CCC, 0x0ADF,
+ 0x6CCD, 0x6CCF, 0x38D7, 0x6CD0, 0x6CD0, 0x16AE, 0x6CD1, 0x6CD2, 0x38DA,
+ 0x6CD3, 0x6CD3, 0x16BC, 0x6CD4, 0x6CD4, 0x16AF, 0x6CD5, 0x6CD5, 0x0645,
+ 0x6CD6, 0x6CD6, 0x16B7, 0x6CD7, 0x6CD7, 0x16B4, 0x6CD8, 0x6CDA, 0x38DC,
+ 0x6CDB, 0x6CDB, 0x0657, 0x6CDC, 0x6CDD, 0x38DF, 0x6CDE, 0x6CDE, 0x0B63,
+ 0x6CDF, 0x6CDF, 0x38E1, 0x6CE0, 0x6CE0, 0x16B6, 0x6CE1, 0x6CE1, 0x0B9E,
+ 0x6CE2, 0x6CE2, 0x046F, 0x6CE3, 0x6CE3, 0x0C1B, 0x6CE4, 0x6CE4, 0x38E2,
+ 0x6CE5, 0x6CE5, 0x0B43, 0x6CE6, 0x6CE7, 0x38E3, 0x6CE8, 0x6CE8, 0x11FF,
+ 0x6CE9, 0x6CE9, 0x38E5, 0x6CEA, 0x6CEA, 0x09CC, 0x6CEB, 0x6CEB, 0x16B9,
+ 0x6CEC, 0x6CED, 0x38E6, 0x6CEE, 0x6CEE, 0x16BA, 0x6CEF, 0x6CEF, 0x16BD,
+ 0x6CF0, 0x6CF0, 0x0DFC, 0x6CF1, 0x6CF1, 0x16B3, 0x6CF2, 0x6CF2, 0x38E8,
+ 0x6CF3, 0x6CF3, 0x10A3, 0x6CF4, 0x6CF4, 0x38E9, 0x6CF5, 0x6CF5, 0x042C,
+ 0x6CF6, 0x6CF6, 0x1A20, 0x6CF7, 0x6CF8, 0x16B1, 0x6CF9, 0x6CF9, 0x38EA,
+ 0x6CFA, 0x6CFA, 0x16B8, 0x6CFB, 0x6CFB, 0x0F85, 0x6CFC, 0x6CFC, 0x0BE2,
+ 0x6CFD, 0x6CFD, 0x1136, 0x6CFE, 0x6CFE, 0x16BE, 0x6CFF, 0x6CFF, 0x38EB,
+ 0x6D00, 0x6D00, 0x38EC, 0x6D01, 0x6D01, 0x08B1, 0x6D02, 0x6D03, 0x38ED,
+ 0x6D04, 0x6D04, 0x16C5, 0x6D05, 0x6D06, 0x38EF, 0x6D07, 0x6D07, 0x16C4,
+ 0x6D08, 0x6D0A, 0x38F1, 0x6D0B, 0x6D0B, 0x101C, 0x6D0C, 0x6D0C, 0x16C1,
+ 0x6D0D, 0x6D0D, 0x38F4, 0x6D0E, 0x6D0E, 0x16C7, 0x6D0F, 0x6D11, 0x38F5,
+ 0x6D12, 0x6D12, 0x0CD2, 0x6D13, 0x6D16, 0x38F8, 0x6D17, 0x6D17, 0x0F21,
+ 0x6D18, 0x6D18, 0x38FC, 0x6D19, 0x6D19, 0x16C6, 0x6D1A, 0x6D1A, 0x16CC,
+ 0x6D1B, 0x6D1B, 0x0A8C, 0x6D1C, 0x6D1D, 0x38FD, 0x6D1E, 0x6D1E, 0x05F3,
+ 0x6D1F, 0x6D24, 0x38FF, 0x6D25, 0x6D25, 0x08C3, 0x6D26, 0x6D26, 0x3905,
+ 0x6D27, 0x6D27, 0x16C0, 0x6D28, 0x6D29, 0x3906, 0x6D2A, 0x6D2A, 0x07A0,
+ 0x6D2B, 0x6D2B, 0x16C8, 0x6D2C, 0x6D2D, 0x3908, 0x6D2E, 0x6D2E, 0x16CA,
+ 0x6D2F, 0x6D30, 0x390A, 0x6D31, 0x6D31, 0x063C, 0x6D32, 0x6D32, 0x11DD,
+ 0x6D33, 0x6D33, 0x16D0, 0x6D34, 0x6D34, 0x390C, 0x6D35, 0x6D35, 0x16CB,
+ 0x6D36, 0x6D38, 0x390D, 0x6D39, 0x6D39, 0x16BF, 0x6D3A, 0x6D3A, 0x3910,
+ 0x6D3B, 0x6D3B, 0x0803, 0x6D3C, 0x6D3C, 0x0E8E, 0x6D3D, 0x6D3D, 0x0C1F,
+ 0x6D3E, 0x6D3E, 0x0B8A, 0x6D3F, 0x6D40, 0x3911, 0x6D41, 0x6D41, 0x0A40,
+ 0x6D42, 0x6D42, 0x3913, 0x6D43, 0x6D43, 0x16C2, 0x6D44, 0x6D44, 0x3914,
+ 0x6D45, 0x6D45, 0x0C30, 0x6D46, 0x6D46, 0x087D, 0x6D47, 0x6D47, 0x088E,
+ 0x6D48, 0x6D48, 0x16C3, 0x6D49, 0x6D49, 0x3915, 0x6D4A, 0x6D4A, 0x1224,
+ 0x6D4B, 0x6D4B, 0x04A9, 0x6D4C, 0x6D4C, 0x3916, 0x6D4D, 0x6D4D, 0x16C9,
+ 0x6D4E, 0x6D4E, 0x0836, 0x6D4F, 0x6D4F, 0x16CD, 0x6D50, 0x6D50, 0x3917,
+ 0x6D51, 0x6D51, 0x0800, 0x6D52, 0x6D52, 0x16CE, 0x6D53, 0x6D53, 0x0B69,
+ 0x6D54, 0x6D54, 0x16CF, 0x6D55, 0x6D58, 0x3918, 0x6D59, 0x6D59, 0x1184,
+ 0x6D5A, 0x6D5A, 0x0930, 0x6D5B, 0x6D5B, 0x391C, 0x6D5C, 0x6D5C, 0x16D8,
+ 0x6D5D, 0x6D5D, 0x391D, 0x6D5E, 0x6D5E, 0x16D5, 0x6D5F, 0x6D5F, 0x391E,
+ 0x6D60, 0x6D60, 0x16D9, 0x6D61, 0x6D62, 0x391F, 0x6D63, 0x6D63, 0x16DB,
+ 0x6D64, 0x6D65, 0x3921, 0x6D66, 0x6D66, 0x0BF5, 0x6D67, 0x6D68, 0x3923,
+ 0x6D69, 0x6D69, 0x077D, 0x6D6A, 0x6D6A, 0x09B6, 0x6D6B, 0x6D6D, 0x3925,
+ 0x6D6E, 0x6D6E, 0x069C, 0x6D6F, 0x6D6F, 0x16D2, 0x6D70, 0x6D73, 0x3928,
+ 0x6D74, 0x6D74, 0x10E4, 0x6D75, 0x6D76, 0x392C, 0x6D77, 0x6D77, 0x075A,
+ 0x6D78, 0x6D78, 0x08CF, 0x6D79, 0x6D79, 0x23DC, 0x6D7A, 0x6D7B, 0x392E,
+ 0x6D7C, 0x6D7C, 0x16DA, 0x6D7D, 0x6D81, 0x3930, 0x6D82, 0x6D82, 0x0E70,
+ 0x6D83, 0x6D84, 0x3935, 0x6D85, 0x6D85, 0x0B5C, 0x6D86, 0x6D86, 0x3937,
+ 0x6D87, 0x6D87, 0x23DB, 0x6D88, 0x6D88, 0x0F68, 0x6D89, 0x6D89, 0x0D1F,
+ 0x6D8A, 0x6D8B, 0x3938, 0x6D8C, 0x6D8C, 0x10A4, 0x6D8D, 0x6D8D, 0x393A,
+ 0x6D8E, 0x6D8E, 0x0F3E, 0x6D8F, 0x6D90, 0x393B, 0x6D91, 0x6D91, 0x16D1,
+ 0x6D92, 0x6D92, 0x393D, 0x6D93, 0x6D94, 0x16D6, 0x6D95, 0x6D95, 0x0E3C,
+ 0x6D96, 0x6D9A, 0x393E, 0x6D9B, 0x6D9B, 0x0E21, 0x6D9C, 0x6D9C, 0x3943,
+ 0x6D9D, 0x6D9D, 0x09BF, 0x6D9E, 0x6D9E, 0x16D3, 0x6D9F, 0x6D9F, 0x09F9,
+ 0x6DA0, 0x6DA0, 0x16D4, 0x6DA1, 0x6DA1, 0x0EDF, 0x6DA2, 0x6DA2, 0x3944,
+ 0x6DA3, 0x6DA3, 0x07D6, 0x6DA4, 0x6DA4, 0x05B4, 0x6DA5, 0x6DA5, 0x3945,
+ 0x6DA6, 0x6DA6, 0x0CCE, 0x6DA7, 0x6DA7, 0x0878, 0x6DA8, 0x6DA8, 0x1168,
+ 0x6DA9, 0x6DA9, 0x0CE5, 0x6DAA, 0x6DAA, 0x069D, 0x6DAB, 0x6DAB, 0x16E8,
+ 0x6DAC, 0x6DAD, 0x3946, 0x6DAE, 0x6DAE, 0x16EA, 0x6DAF, 0x6DAF, 0x0FED,
+ 0x6DB0, 0x6DB1, 0x3948, 0x6DB2, 0x6DB2, 0x1041, 0x6DB3, 0x6DB4, 0x394A,
+ 0x6DB5, 0x6DB5, 0x0764, 0x6DB6, 0x6DB7, 0x394C, 0x6DB8, 0x6DB8, 0x078B,
+ 0x6DB9, 0x6DBE, 0x394E, 0x6DBF, 0x6DBF, 0x16E1, 0x6DC0, 0x6DC0, 0x05CE,
+ 0x6DC1, 0x6DC3, 0x3954, 0x6DC4, 0x6DC4, 0x122A, 0x6DC5, 0x6DC5, 0x16DE,
+ 0x6DC6, 0x6DC6, 0x0F6A, 0x6DC7, 0x6DC7, 0x16DD, 0x6DC8, 0x6DCA, 0x3957,
+ 0x6DCB, 0x6DCB, 0x0A25, 0x6DCC, 0x6DCC, 0x0E1D, 0x6DCD, 0x6DD0, 0x395A,
+ 0x6DD1, 0x6DD1, 0x0D7E, 0x6DD2, 0x6DD5, 0x395E, 0x6DD6, 0x6DD6, 0x0B3A,
+ 0x6DD7, 0x6DD7, 0x3962, 0x6DD8, 0x6DD8, 0x0E27, 0x6DD9, 0x6DD9, 0x16E6,
+ 0x6DDA, 0x6DDC, 0x3963, 0x6DDD, 0x6DDD, 0x16E5, 0x6DDE, 0x6DDE, 0x16DF,
+ 0x6DDF, 0x6DDF, 0x3966, 0x6DE0, 0x6DE0, 0x16E2, 0x6DE1, 0x6DE1, 0x058E,
+ 0x6DE2, 0x6DE3, 0x3967, 0x6DE4, 0x6DE4, 0x10BE, 0x6DE5, 0x6DE5, 0x3969,
+ 0x6DE6, 0x6DE6, 0x16E4, 0x6DE7, 0x6DE9, 0x396A, 0x6DEA, 0x6DEA, 0x205E,
+ 0x6DEB, 0x6DEB, 0x1080, 0x6DEC, 0x6DEC, 0x0566, 0x6DED, 0x6DED, 0x396D,
+ 0x6DEE, 0x6DEE, 0x07C9, 0x6DEF, 0x6DF0, 0x396E, 0x6DF1, 0x6DF1, 0x0D27,
+ 0x6DF2, 0x6DF2, 0x3970, 0x6DF3, 0x6DF3, 0x0541, 0x6DF4, 0x6DF4, 0x3971,
+ 0x6DF5, 0x6DF5, 0x2244, 0x6DF6, 0x6DF6, 0x23E2, 0x6DF7, 0x6DF7, 0x0801,
+ 0x6DF8, 0x6DF8, 0x3972, 0x6DF9, 0x6DF9, 0x0FF6, 0x6DFA, 0x6DFA, 0x20D4,
+ 0x6DFB, 0x6DFB, 0x0E40, 0x6DFC, 0x6DFC, 0x1A21, 0x6DFD, 0x6DFF, 0x3973,
+ 0x6E00, 0x6E04, 0x3976, 0x6E05, 0x6E05, 0x0C62, 0x6E06, 0x6E09, 0x397B,
+ 0x6E0A, 0x6E0A, 0x10EB, 0x6E0B, 0x6E0B, 0x397F, 0x6E0C, 0x6E0C, 0x16E9,
+ 0x6E0D, 0x6E0D, 0x1232, 0x6E0E, 0x6E0E, 0x16E0, 0x6E0F, 0x6E0F, 0x3980,
+ 0x6E10, 0x6E10, 0x0876, 0x6E11, 0x6E11, 0x16E3, 0x6E12, 0x6E13, 0x3981,
+ 0x6E14, 0x6E14, 0x10CB, 0x6E15, 0x6E15, 0x3983, 0x6E16, 0x6E16, 0x16E7,
+ 0x6E17, 0x6E17, 0x0D31, 0x6E18, 0x6E19, 0x3984, 0x6E1A, 0x6E1A, 0x16DC,
+ 0x6E1B, 0x6E1C, 0x3986, 0x6E1D, 0x6E1D, 0x10CA, 0x6E1E, 0x6E1F, 0x3988,
+ 0x6E20, 0x6E20, 0x0C7B, 0x6E21, 0x6E21, 0x0608, 0x6E22, 0x6E22, 0x398A,
+ 0x6E23, 0x6E23, 0x113F, 0x6E24, 0x6E24, 0x047A, 0x6E25, 0x6E25, 0x16F5,
+ 0x6E26, 0x6E26, 0x219F, 0x6E27, 0x6E28, 0x398B, 0x6E29, 0x6E29, 0x0ED1,
+ 0x6E2A, 0x6E2A, 0x398D, 0x6E2B, 0x6E2B, 0x16EB, 0x6E2C, 0x6E2C, 0x1E66,
+ 0x6E2D, 0x6E2D, 0x0ECB, 0x6E2E, 0x6E2E, 0x398E, 0x6E2F, 0x6E2F, 0x06D6,
+ 0x6E30, 0x6E31, 0x398F, 0x6E32, 0x6E32, 0x16F4, 0x6E33, 0x6E33, 0x3991,
+ 0x6E34, 0x6E34, 0x0957, 0x6E35, 0x6E37, 0x3992, 0x6E38, 0x6E38, 0x10B3,
+ 0x6E39, 0x6E39, 0x3995, 0x6E3A, 0x6E3A, 0x0AF1, 0x6E3B, 0x6E3D, 0x3996,
+ 0x6E3E, 0x6E3E, 0x1F63, 0x6E3F, 0x6E42, 0x3999, 0x6E43, 0x6E43, 0x0B89,
+ 0x6E44, 0x6E44, 0x16F6, 0x6E45, 0x6E4C, 0x399D, 0x6E4D, 0x6E4D, 0x0E75,
+ 0x6E4E, 0x6E4E, 0x16ED, 0x6E4F, 0x6E52, 0x39A5, 0x6E53, 0x6E54, 0x16F2,
+ 0x6E55, 0x6E55, 0x39A9, 0x6E56, 0x6E56, 0x07B5, 0x6E57, 0x6E57, 0x39AA,
+ 0x6E58, 0x6E58, 0x0F53, 0x6E59, 0x6E5A, 0x39AB, 0x6E5B, 0x6E5B, 0x1160,
+ 0x6E5C, 0x6E5D, 0x39AD, 0x6E5E, 0x6E5E, 0x23DD, 0x6E5F, 0x6E5F, 0x16F0,
+ 0x6E60, 0x6E6A, 0x39AF, 0x6E6B, 0x6E6B, 0x16EE, 0x6E6C, 0x6E6D, 0x39BA,
+ 0x6E6E, 0x6E6E, 0x16EC, 0x6E6F, 0x6E6F, 0x216B, 0x6E70, 0x6E7D, 0x39BC,
+ 0x6E7E, 0x6E7E, 0x0E96, 0x6E7F, 0x6E7F, 0x0D41, 0x6E80, 0x6E82, 0x39CA,
+ 0x6E83, 0x6E83, 0x098E, 0x6E84, 0x6E84, 0x39CD, 0x6E85, 0x6E85, 0x0877,
+ 0x6E86, 0x6E86, 0x16F1, 0x6E87, 0x6E88, 0x39CE, 0x6E89, 0x6E89, 0x06C3,
+ 0x6E8A, 0x6E8E, 0x39D0, 0x6E8F, 0x6E8F, 0x1705, 0x6E90, 0x6E90, 0x10F7,
+ 0x6E91, 0x6E95, 0x39D5, 0x6E96, 0x6E96, 0x22B5, 0x6E97, 0x6E97, 0x39DA,
+ 0x6E98, 0x6E98, 0x16F9, 0x6E99, 0x6E9B, 0x39DB, 0x6E9C, 0x6E9C, 0x0A38,
+ 0x6E9D, 0x6E9D, 0x1F26, 0x6E9E, 0x6E9E, 0x39DE, 0x6E9F, 0x6E9F, 0x1707,
+ 0x6EA0, 0x6EA1, 0x39DF, 0x6EA2, 0x6EA2, 0x106E, 0x6EA3, 0x6EA4, 0x39E1,
+ 0x6EA5, 0x6EA5, 0x16FD, 0x6EA6, 0x6EA6, 0x39E3, 0x6EA7, 0x6EA7, 0x16FE,
+ 0x6EA8, 0x6EA9, 0x39E4, 0x6EAA, 0x6EAA, 0x0F17, 0x6EAB, 0x6EAE, 0x39E6,
+ 0x6EAF, 0x6EAF, 0x0DD2, 0x6EB0, 0x6EB0, 0x39EA, 0x6EB1, 0x6EB1, 0x16F8,
+ 0x6EB2, 0x6EB2, 0x16EF, 0x6EB3, 0x6EB3, 0x39EB, 0x6EB4, 0x6EB4, 0x1703,
+ 0x6EB5, 0x6EB5, 0x39EC, 0x6EB6, 0x6EB6, 0x0CB7, 0x6EB7, 0x6EB7, 0x1701,
+ 0x6EB8, 0x6EB9, 0x39ED, 0x6EBA, 0x6EBA, 0x0B4A, 0x6EBB, 0x6EBB, 0x1700,
+ 0x6EBC, 0x6EBC, 0x39EF, 0x6EBD, 0x6EBD, 0x16FF, 0x6EBE, 0x6EC0, 0x39F0,
+ 0x6EC1, 0x6EC1, 0x0521, 0x6EC2, 0x6EC2, 0x1706, 0x6EC3, 0x6EC3, 0x39F3,
+ 0x6EC4, 0x6EC4, 0x1E63, 0x6EC5, 0x6EC5, 0x2088, 0x6EC6, 0x6EC6, 0x39F4,
+ 0x6EC7, 0x6EC7, 0x05C2, 0x6EC8, 0x6ECA, 0x39F5, 0x6ECB, 0x6ECB, 0x1229,
+ 0x6ECC, 0x6ECC, 0x1EBD, 0x6ECD, 0x6ECD, 0x39F8, 0x6ECE, 0x6ECE, 0x2341,
+ 0x6ECF, 0x6ECF, 0x1704, 0x6ED0, 0x6ED0, 0x39F9, 0x6ED1, 0x6ED1, 0x07C1,
+ 0x6ED2, 0x6ED2, 0x39FA, 0x6ED3, 0x6ED3, 0x122F, 0x6ED4, 0x6ED4, 0x0E22,
+ 0x6ED5, 0x6ED5, 0x19A8, 0x6ED6, 0x6ED6, 0x39FB, 0x6ED7, 0x6ED7, 0x1702,
+ 0x6ED8, 0x6ED9, 0x39FC, 0x6EDA, 0x6EDA, 0x074F, 0x6EDB, 0x6EDD, 0x39FE,
+ 0x6EDE, 0x6EDE, 0x11CC, 0x6EDF, 0x6EDF, 0x16F7, 0x6EE0, 0x6EE0, 0x16FA,
+ 0x6EE1, 0x6EE1, 0x0AA1, 0x6EE2, 0x6EE2, 0x16FC, 0x6EE3, 0x6EE3, 0x3A01,
+ 0x6EE4, 0x6EE4, 0x0A72, 0x6EE5, 0x6EE5, 0x09AF, 0x6EE6, 0x6EE6, 0x0A77,
+ 0x6EE7, 0x6EE7, 0x3A02, 0x6EE8, 0x6EE8, 0x045E, 0x6EE9, 0x6EE9, 0x0E05,
+ 0x6EEA, 0x6EEB, 0x3A03, 0x6EEC, 0x6EEC, 0x1F4B, 0x6EED, 0x6EEE, 0x3A05,
+ 0x6EEF, 0x6EEF, 0x2292, 0x6EF0, 0x6EF1, 0x3A07, 0x6EF2, 0x6EF2, 0x2124,
+ 0x6EF3, 0x6EF3, 0x3A09, 0x6EF4, 0x6EF4, 0x05AF, 0x6EF5, 0x6EF6, 0x3A0A,
+ 0x6EF7, 0x6EF7, 0x2048, 0x6EF8, 0x6EF8, 0x23E0, 0x6EF9, 0x6EF9, 0x170D,
+ 0x6EFA, 0x6EFE, 0x3A0C, 0x6EFF, 0x6EFF, 0x2077, 0x6F00, 0x6F00, 0x3A11,
+ 0x6F01, 0x6F01, 0x223A, 0x6F02, 0x6F02, 0x0BCE, 0x6F03, 0x6F05, 0x3A12,
+ 0x6F06, 0x6F06, 0x0C00, 0x6F07, 0x6F08, 0x3A15, 0x6F09, 0x6F09, 0x1713,
+ 0x6F0A, 0x6F0E, 0x3A17, 0x6F0F, 0x6F0F, 0x0A50, 0x6F10, 0x6F12, 0x3A1C,
+ 0x6F13, 0x6F13, 0x09D7, 0x6F14, 0x6F14, 0x1006, 0x6F15, 0x6F15, 0x170C,
+ 0x6F16, 0x6F19, 0x3A1F, 0x6F1A, 0x6F1A, 0x20B1, 0x6F1B, 0x6F1F, 0x3A23,
+ 0x6F20, 0x6F20, 0x0B11, 0x6F21, 0x6F21, 0x3A28, 0x6F22, 0x6F22, 0x1F41,
+ 0x6F23, 0x6F23, 0x201C, 0x6F24, 0x6F24, 0x170B, 0x6F25, 0x6F28, 0x3A29,
+ 0x6F29, 0x6F29, 0x1714, 0x6F2A, 0x6F2A, 0x1712, 0x6F2B, 0x6F2B, 0x0AA5,
+ 0x6F2C, 0x6F2C, 0x22B8, 0x6F2D, 0x6F2D, 0x16FB, 0x6F2E, 0x6F2E, 0x3A2D,
+ 0x6F2F, 0x6F2F, 0x170E, 0x6F30, 0x6F30, 0x3A2E, 0x6F31, 0x6F31, 0x0D95,
+ 0x6F32, 0x6F32, 0x2276, 0x6F33, 0x6F33, 0x1165, 0x6F34, 0x6F35, 0x3A2F,
+ 0x6F36, 0x6F36, 0x170F, 0x6F37, 0x6F37, 0x3A31, 0x6F38, 0x6F38, 0x1F9B,
+ 0x6F39, 0x6F3D, 0x3A32, 0x6F3E, 0x6F3E, 0x1023, 0x6F3F, 0x6F3F, 0x1F9F,
+ 0x6F40, 0x6F40, 0x3A37, 0x6F41, 0x6F41, 0x25CA, 0x6F42, 0x6F45, 0x3A38,
+ 0x6F46, 0x6F47, 0x1709, 0x6F48, 0x6F4A, 0x3A3C, 0x6F4B, 0x6F4B, 0x1710,
+ 0x6F4C, 0x6F4C, 0x3A3F, 0x6F4D, 0x6F4D, 0x0EBA, 0x6F4E, 0x6F50, 0x3A40,
+ 0x6F51, 0x6F51, 0x20BE, 0x6F52, 0x6F53, 0x3A43, 0x6F54, 0x6F54, 0x1FB4,
+ 0x6F55, 0x6F57, 0x3A45, 0x6F58, 0x6F58, 0x0B8C, 0x6F59, 0x6F59, 0x23D7,
+ 0x6F5A, 0x6F5B, 0x3A48, 0x6F5C, 0x6F5C, 0x0C2E, 0x6F5D, 0x6F5D, 0x3A4A,
+ 0x6F5E, 0x6F5E, 0x0A61, 0x6F5F, 0x6F61, 0x3A4B, 0x6F62, 0x6F62, 0x1708,
+ 0x6F63, 0x6F63, 0x3A4E, 0x6F64, 0x6F64, 0x2105, 0x6F65, 0x6F65, 0x3A4F,
+ 0x6F66, 0x6F66, 0x0A13, 0x6F67, 0x6F6C, 0x3A50, 0x6F6D, 0x6F6D, 0x0E09,
+ 0x6F6E, 0x6F6E, 0x04D6, 0x6F6F, 0x6F6F, 0x23E1, 0x6F70, 0x6F70, 0x1FEC,
+ 0x6F71, 0x6F71, 0x3A56, 0x6F72, 0x6F72, 0x1719, 0x6F73, 0x6F73, 0x3A57,
+ 0x6F74, 0x6F74, 0x1711, 0x6F75, 0x6F76, 0x3A58, 0x6F77, 0x6F77, 0x23EA,
+ 0x6F78, 0x6F78, 0x1718, 0x6F79, 0x6F79, 0x3A5A, 0x6F7A, 0x6F7A, 0x171B,
+ 0x6F7B, 0x6F7B, 0x3A5B, 0x6F7C, 0x6F7C, 0x171A, 0x6F7D, 0x6F7E, 0x3A5C,
+ 0x6F7F, 0x6F7F, 0x23E3, 0x6F80, 0x6F80, 0x210E, 0x6F81, 0x6F83, 0x3A5E,
+ 0x6F84, 0x6F84, 0x04F3, 0x6F85, 0x6F85, 0x3A61, 0x6F86, 0x6F86, 0x1FA6,
+ 0x6F87, 0x6F87, 0x2004, 0x6F88, 0x6F88, 0x04DF, 0x6F89, 0x6F89, 0x1715,
+ 0x6F8A, 0x6F8B, 0x3A62, 0x6F8C, 0x6F8C, 0x1717, 0x6F8D, 0x6F8D, 0x1716,
+ 0x6F8E, 0x6F8E, 0x0BAD, 0x6F8F, 0x6F96, 0x3A64, 0x6F97, 0x6F97, 0x1F9D,
+ 0x6F98, 0x6F9B, 0x3A6C, 0x6F9C, 0x6F9C, 0x09A8, 0x6F9D, 0x6F9F, 0x3A70,
+ 0x6FA0, 0x6FA0, 0x23E5, 0x6FA1, 0x6FA1, 0x112B, 0x6FA2, 0x6FA3, 0x3A73,
+ 0x6FA4, 0x6FA4, 0x2264, 0x6FA5, 0x6FA6, 0x3A75, 0x6FA7, 0x6FA7, 0x171E,
+ 0x6FA8, 0x6FA8, 0x3A77, 0x6FA9, 0x6FA9, 0x24E2, 0x6FAA, 0x6FAD, 0x3A78,
+ 0x6FAE, 0x6FAE, 0x23DE, 0x6FAF, 0x6FB0, 0x3A7C, 0x6FB1, 0x6FB1, 0x1EC4,
+ 0x6FB2, 0x6FB2, 0x3A7E, 0x6FB3, 0x6FB3, 0x03CF, 0x6FB4, 0x6FB5, 0x3A7F,
+ 0x6FB6, 0x6FB6, 0x1720, 0x6FB7, 0x6FB8, 0x3A81, 0x6FB9, 0x6FB9, 0x171F,
+ 0x6FBA, 0x6FBF, 0x3A83, 0x6FC0, 0x6FC0, 0x0817, 0x6FC1, 0x6FC1, 0x22B6,
+ 0x6FC2, 0x6FC2, 0x1721, 0x6FC3, 0x6FC3, 0x20A9, 0x6FC4, 0x6FC8, 0x3A89,
+ 0x6FC9, 0x6FC9, 0x171D, 0x6FCA, 0x6FD0, 0x3A8E, 0x6FD1, 0x6FD1, 0x171C,
+ 0x6FD2, 0x6FD2, 0x045D, 0x6FD3, 0x6FD4, 0x3A95, 0x6FD5, 0x6FD5, 0x212B,
+ 0x6FD6, 0x6FD7, 0x3A97, 0x6FD8, 0x6FD8, 0x20A5, 0x6FD9, 0x6FDA, 0x3A99,
+ 0x6FDB, 0x6FDB, 0x268B, 0x6FDC, 0x6FDD, 0x3A9B, 0x6FDE, 0x6FDE, 0x1724,
+ 0x6FDF, 0x6FDF, 0x1F76, 0x6FE0, 0x6FE0, 0x1725, 0x6FE1, 0x6FE1, 0x1722,
+ 0x6FE2, 0x6FE3, 0x3A9D, 0x6FE4, 0x6FE4, 0x216D, 0x6FE5, 0x6FEA, 0x3A9F,
+ 0x6FEB, 0x6FEB, 0x2001, 0x6FEC, 0x6FED, 0x3AA5, 0x6FEE, 0x6FEE, 0x1723,
+ 0x6FEF, 0x6FEF, 0x1726, 0x6FF0, 0x6FF0, 0x2191, 0x6FF1, 0x6FF1, 0x1E50,
+ 0x6FF2, 0x6FF9, 0x3AA7, 0x6FFA, 0x6FFA, 0x1F9C, 0x6FFB, 0x6FFB, 0x3AAF,
+ 0x6FFC, 0x6FFC, 0x23DA, 0x6FFD, 0x6FFD, 0x3AB0, 0x6FFE, 0x6FFE, 0x2053,
+ 0x6FFF, 0x6FFF, 0x3AB1, 0x7000, 0x7004, 0x3AB2, 0x7005, 0x7005, 0x23E9,
+ 0x7006, 0x7006, 0x23E4, 0x7007, 0x7008, 0x3AB7, 0x7009, 0x7009, 0x21D5,
+ 0x700A, 0x700A, 0x3AB9, 0x700B, 0x700B, 0x23E6, 0x700C, 0x700E, 0x3ABA,
+ 0x700F, 0x700F, 0x23DF, 0x7010, 0x7010, 0x3ABD, 0x7011, 0x7011, 0x0BF8,
+ 0x7012, 0x7014, 0x3ABE, 0x7015, 0x7015, 0x1E4F, 0x7016, 0x7017, 0x3AC1,
+ 0x7018, 0x7018, 0x23D9, 0x7019, 0x7019, 0x3AC3, 0x701A, 0x701A, 0x1727,
+ 0x701B, 0x701B, 0x1729, 0x701C, 0x701C, 0x3AC4, 0x701D, 0x701D, 0x2014,
+ 0x701E, 0x701E, 0x3AC5, 0x701F, 0x701F, 0x23EC, 0x7020, 0x7020, 0x23EB,
+ 0x7021, 0x7022, 0x3AC6, 0x7023, 0x7023, 0x1728, 0x7024, 0x7026, 0x3AC8,
+ 0x7027, 0x7027, 0x23D8, 0x7028, 0x7028, 0x23EE, 0x7029, 0x702F, 0x3ACB,
+ 0x7030, 0x7030, 0x268E, 0x7031, 0x7031, 0x3AD2, 0x7032, 0x7032, 0x23ED,
+ 0x7033, 0x7034, 0x3AD3, 0x7035, 0x7035, 0x172B, 0x7036, 0x7038, 0x3AD5,
+ 0x7039, 0x7039, 0x172A, 0x703A, 0x703D, 0x3AD8, 0x703E, 0x703E, 0x1FFA,
+ 0x703F, 0x7042, 0x3ADC, 0x7043, 0x7043, 0x23D6, 0x7044, 0x7044, 0x23E8,
+ 0x7045, 0x704B, 0x3AE0, 0x704C, 0x704C, 0x0739, 0x704D, 0x704E, 0x3AE7,
+ 0x704F, 0x704F, 0x172C, 0x7050, 0x7050, 0x3AE9, 0x7051, 0x7051, 0x2106,
+ 0x7052, 0x7054, 0x3AEA, 0x7055, 0x7055, 0x200B, 0x7056, 0x7057, 0x3AED,
+ 0x7058, 0x7058, 0x2166, 0x7059, 0x705C, 0x3AEF, 0x705D, 0x705D, 0x23EF,
+ 0x705E, 0x705E, 0x172D, 0x705F, 0x7062, 0x3AF3, 0x7063, 0x7063, 0x2189,
+ 0x7064, 0x7064, 0x2058, 0x7065, 0x7066, 0x3AF7, 0x7067, 0x7067, 0x23E7,
+ 0x7068, 0x706A, 0x3AF9, 0x706B, 0x706B, 0x0805, 0x706C, 0x706C, 0x19EF,
+ 0x706D, 0x706D, 0x0AF5, 0x706E, 0x706E, 0x3AFC, 0x706F, 0x706F, 0x05A7,
+ 0x7070, 0x7070, 0x07E7, 0x7071, 0x7074, 0x3AFD, 0x7075, 0x7075, 0x0A32,
+ 0x7076, 0x7076, 0x1131, 0x7077, 0x7077, 0x3B01, 0x7078, 0x7078, 0x08F3,
+ 0x7079, 0x707B, 0x3B02, 0x707C, 0x707C, 0x1223, 0x707D, 0x707D, 0x3B05,
+ 0x707E, 0x707E, 0x1119, 0x707F, 0x707F, 0x049A, 0x7080, 0x7080, 0x19CC,
+ 0x7081, 0x7084, 0x3B06, 0x7085, 0x7085, 0x1913, 0x7086, 0x7088, 0x3B0A,
+ 0x7089, 0x7089, 0x0A56, 0x708A, 0x708A, 0x0539, 0x708B, 0x708D, 0x3B0D,
+ 0x708E, 0x708E, 0x1000, 0x708F, 0x7091, 0x3B10, 0x7092, 0x7092, 0x04D9,
+ 0x7093, 0x7093, 0x3B13, 0x7094, 0x7094, 0x0C8D, 0x7095, 0x7095, 0x0948,
+ 0x7096, 0x7096, 0x19CE, 0x7097, 0x7098, 0x3B14, 0x7099, 0x7099, 0x11CA,
+ 0x709A, 0x709B, 0x3B16, 0x709C, 0x709C, 0x19CD, 0x709D, 0x709D, 0x19CF,
+ 0x709E, 0x70AA, 0x3B18, 0x70AB, 0x70AB, 0x19D3, 0x70AC, 0x70AC, 0x0915,
+ 0x70AD, 0x70AD, 0x0E12, 0x70AE, 0x70AE, 0x0B9B, 0x70AF, 0x70AF, 0x08EB,
+ 0x70B0, 0x70B0, 0x3B25, 0x70B1, 0x70B1, 0x19D4, 0x70B2, 0x70B2, 0x3B26,
+ 0x70B3, 0x70B3, 0x0467, 0x70B4, 0x70B6, 0x3B27, 0x70B7, 0x70B7, 0x19D2,
+ 0x70B8, 0x70B8, 0x1149, 0x70B9, 0x70B9, 0x05C4, 0x70BA, 0x70BA, 0x3B2A,
+ 0x70BB, 0x70BB, 0x19D0, 0x70BC, 0x70BC, 0x09FF, 0x70BD, 0x70BD, 0x0508,
+ 0x70BE, 0x70BF, 0x3B2B, 0x70C0, 0x70C0, 0x19D1, 0x70C1, 0x70C1, 0x0DAD,
+ 0x70C2, 0x70C2, 0x09AE, 0x70C3, 0x70C3, 0x0E51, 0x70C4, 0x70C7, 0x3B2D,
+ 0x70C8, 0x70C8, 0x0A1B, 0x70C9, 0x70C9, 0x3B31, 0x70CA, 0x70CA, 0x19D6,
+ 0x70CB, 0x70CE, 0x3B32, 0x70CF, 0x70CF, 0x21A3, 0x70D0, 0x70D7, 0x3B36,
+ 0x70D8, 0x70D8, 0x079D, 0x70D9, 0x70D9, 0x09BE, 0x70DA, 0x70DA, 0x3B3E,
+ 0x70DB, 0x70DB, 0x11F1, 0x70DC, 0x70DE, 0x3B3F, 0x70DF, 0x70DF, 0x0FF5,
+ 0x70E0, 0x70E3, 0x3B42, 0x70E4, 0x70E4, 0x094B, 0x70E5, 0x70E5, 0x3B46,
+ 0x70E6, 0x70E6, 0x0650, 0x70E7, 0x70E7, 0x0D0E, 0x70E8, 0x70E8, 0x19D5,
+ 0x70E9, 0x70E9, 0x07F7, 0x70EA, 0x70EA, 0x3B47, 0x70EB, 0x70EB, 0x0E1F,
+ 0x70EC, 0x70EC, 0x08CE, 0x70ED, 0x70ED, 0x0CA3, 0x70EE, 0x70EE, 0x3B48,
+ 0x70EF, 0x70EF, 0x0F16, 0x70F0, 0x70F3, 0x3B49, 0x70F4, 0x70F4, 0x217A,
+ 0x70F5, 0x70F6, 0x3B4D, 0x70F7, 0x70F7, 0x0E9A, 0x70F8, 0x70F8, 0x3B4F,
+ 0x70F9, 0x70F9, 0x0BAC, 0x70FA, 0x70FC, 0x3B50, 0x70FD, 0x70FD, 0x0686,
+ 0x70FE, 0x70FF, 0x3B53, 0x7100, 0x7108, 0x3B55, 0x7109, 0x7109, 0x0FF2,
+ 0x710A, 0x710A, 0x076F, 0x710B, 0x710F, 0x3B5E, 0x7110, 0x7110, 0x19D7,
+ 0x7111, 0x7112, 0x3B63, 0x7113, 0x7113, 0x19D8, 0x7114, 0x7114, 0x3B65,
+ 0x7115, 0x7115, 0x07D5, 0x7116, 0x7116, 0x19D9, 0x7117, 0x7117, 0x3B66,
+ 0x7118, 0x7118, 0x19F0, 0x7119, 0x7119, 0x0423, 0x711A, 0x711A, 0x0676,
+ 0x711B, 0x7120, 0x3B67, 0x7121, 0x7121, 0x21A5, 0x7122, 0x7125, 0x3B6D,
+ 0x7126, 0x7126, 0x088A, 0x7127, 0x712E, 0x3B71, 0x712F, 0x712F, 0x19DA,
+ 0x7130, 0x7130, 0x100F, 0x7131, 0x7131, 0x19DB, 0x7132, 0x7135, 0x3B79,
+ 0x7136, 0x7136, 0x0C96, 0x7137, 0x7144, 0x3B7D, 0x7145, 0x7145, 0x19DF,
+ 0x7146, 0x7148, 0x3B8B, 0x7149, 0x7149, 0x2022, 0x714A, 0x714A, 0x19E1,
+ 0x714B, 0x714B, 0x3B8E, 0x714C, 0x714C, 0x07E2, 0x714D, 0x714D, 0x3B8F,
+ 0x714E, 0x714E, 0x0858, 0x714F, 0x7151, 0x3B90, 0x7152, 0x7152, 0x24D6,
+ 0x7153, 0x715B, 0x3B93, 0x715C, 0x715C, 0x19DD, 0x715D, 0x715D, 0x3B9C,
+ 0x715E, 0x715E, 0x0CF0, 0x715F, 0x7161, 0x3B9D, 0x7162, 0x7162, 0x233A,
+ 0x7163, 0x7163, 0x3BA0, 0x7164, 0x7164, 0x0ABF, 0x7165, 0x7165, 0x3BA1,
+ 0x7166, 0x7166, 0x19F1, 0x7167, 0x7167, 0x1176, 0x7168, 0x7168, 0x19DE,
+ 0x7169, 0x7169, 0x1EEE, 0x716A, 0x716B, 0x3BA2, 0x716C, 0x716C, 0x24D5,
+ 0x716D, 0x716D, 0x3BA4, 0x716E, 0x716E, 0x11F2, 0x716F, 0x7171, 0x3BA5,
+ 0x7172, 0x7172, 0x19E0, 0x7173, 0x7173, 0x19DC, 0x7174, 0x7177, 0x3BA8,
+ 0x7178, 0x7178, 0x19E2, 0x7179, 0x7179, 0x3BAC, 0x717A, 0x717A, 0x19E3,
+ 0x717B, 0x717C, 0x3BAD, 0x717D, 0x717D, 0x0CF8, 0x717E, 0x7183, 0x3BAF,
+ 0x7184, 0x7184, 0x0F15, 0x7185, 0x7189, 0x3BB5, 0x718A, 0x718A, 0x0FA7,
+ 0x718B, 0x718E, 0x3BBA, 0x718F, 0x718F, 0x0FD5, 0x7190, 0x7191, 0x3BBE,
+ 0x7192, 0x7192, 0x2228, 0x7193, 0x7193, 0x3BC0, 0x7194, 0x7194, 0x0CB6,
+ 0x7195, 0x7196, 0x3BC1, 0x7197, 0x7197, 0x24D7, 0x7198, 0x7198, 0x19E4,
+ 0x7199, 0x7199, 0x0F04, 0x719A, 0x719E, 0x3BC3, 0x719F, 0x719F, 0x0D83,
+ 0x71A0, 0x71A0, 0x19E8, 0x71A1, 0x71A7, 0x3BC8, 0x71A8, 0x71A8, 0x19E7,
+ 0x71A9, 0x71AB, 0x3BCF, 0x71AC, 0x71AC, 0x03C9, 0x71AD, 0x71B0, 0x3BD2,
+ 0x71B1, 0x71B1, 0x20FC, 0x71B2, 0x71B2, 0x3BD6, 0x71B3, 0x71B3, 0x19E5,
+ 0x71B4, 0x71B4, 0x3BD7, 0x71B5, 0x71B5, 0x19E6, 0x71B6, 0x71B8, 0x3BD8,
+ 0x71B9, 0x71B9, 0x19F2, 0x71BA, 0x71BD, 0x3BDB, 0x71BE, 0x71BE, 0x1E87,
+ 0x71BF, 0x71C0, 0x3BDF, 0x71C1, 0x71C1, 0x24D8, 0x71C2, 0x71C2, 0x3BE1,
+ 0x71C3, 0x71C3, 0x0C97, 0x71C4, 0x71C7, 0x3BE2, 0x71C8, 0x71C8, 0x1EBA,
+ 0x71C9, 0x71CD, 0x3BE6, 0x71CE, 0x71CE, 0x0A10, 0x71CF, 0x71D1, 0x3BEB,
+ 0x71D2, 0x71D2, 0x2119, 0x71D3, 0x71D3, 0x3BEE, 0x71D4, 0x71D4, 0x19EA,
+ 0x71D5, 0x71D5, 0x1009, 0x71D6, 0x71D8, 0x3BEF, 0x71D9, 0x71D9, 0x216C,
+ 0x71DA, 0x71DB, 0x3BF2, 0x71DC, 0x71DC, 0x24D9, 0x71DD, 0x71DE, 0x3BF4,
+ 0x71DF, 0x71DF, 0x2227, 0x71E0, 0x71E0, 0x19E9, 0x71E1, 0x71E4, 0x3BF6,
+ 0x71E5, 0x71E5, 0x1132, 0x71E6, 0x71E6, 0x1E5F, 0x71E7, 0x71E7, 0x19EB,
+ 0x71E8, 0x71EC, 0x3BFA, 0x71ED, 0x71ED, 0x229F, 0x71EE, 0x71EE, 0x1396,
+ 0x71EF, 0x71F3, 0x3BFF, 0x71F4, 0x71F4, 0x1F5D, 0x71F5, 0x71F8, 0x3C04,
+ 0x71F9, 0x71F9, 0x19EC, 0x71FA, 0x71FB, 0x3C08, 0x71FC, 0x71FC, 0x1FBC,
+ 0x71FD, 0x71FD, 0x3C0A, 0x71FE, 0x71FE, 0x24DA, 0x71FF, 0x71FF, 0x3C0B,
+ 0x7200, 0x7205, 0x3C0C, 0x7206, 0x7206, 0x0415, 0x7207, 0x720C, 0x3C12,
+ 0x720D, 0x720D, 0x2149, 0x720E, 0x720F, 0x3C18, 0x7210, 0x7210, 0x2046,
+ 0x7211, 0x721A, 0x3C1A, 0x721B, 0x721B, 0x2000, 0x721C, 0x721C, 0x3C24,
+ 0x721D, 0x721D, 0x19ED, 0x721E, 0x7227, 0x3C25, 0x7228, 0x7228, 0x19EE,
+ 0x7229, 0x7229, 0x3C2F, 0x722A, 0x722A, 0x1203, 0x722B, 0x722B, 0x3C30,
+ 0x722C, 0x722C, 0x0B81, 0x722D, 0x722F, 0x3C31, 0x7230, 0x7230, 0x196C,
+ 0x7231, 0x7231, 0x03B9, 0x7232, 0x7232, 0x2190, 0x7233, 0x7234, 0x3C34,
+ 0x7235, 0x7235, 0x0923, 0x7236, 0x7236, 0x06B3, 0x7237, 0x7237, 0x1036,
+ 0x7238, 0x7238, 0x03E1, 0x7239, 0x7239, 0x05DA, 0x723A, 0x723A, 0x2208,
+ 0x723B, 0x723B, 0x1269, 0x723C, 0x723C, 0x3C36, 0x723D, 0x723D, 0x0DA1,
+ 0x723E, 0x723E, 0x1EE6, 0x723F, 0x723F, 0x169D, 0x7240, 0x7246, 0x3C37,
+ 0x7247, 0x7247, 0x0BCB, 0x7248, 0x7248, 0x03F1, 0x7249, 0x724B, 0x3C3E,
+ 0x724C, 0x724C, 0x0B87, 0x724D, 0x724D, 0x1969, 0x724E, 0x7251, 0x3C41,
+ 0x7252, 0x7252, 0x196A, 0x7253, 0x7255, 0x3C45, 0x7256, 0x7256, 0x196B,
+ 0x7257, 0x7257, 0x3C48, 0x7258, 0x7258, 0x24C3, 0x7259, 0x7259, 0x0FE9,
+ 0x725A, 0x725A, 0x3C49, 0x725B, 0x725B, 0x0B64, 0x725C, 0x725C, 0x3C4A,
+ 0x725D, 0x725D, 0x1944, 0x725E, 0x725E, 0x3C4B, 0x725F, 0x725F, 0x0B15,
+ 0x7260, 0x7260, 0x3C4C, 0x7261, 0x7261, 0x0B18, 0x7262, 0x7262, 0x09B9,
+ 0x7263, 0x7265, 0x3C4D, 0x7266, 0x7266, 0x1945, 0x7267, 0x7267, 0x0B24,
+ 0x7268, 0x7268, 0x3C50, 0x7269, 0x7269, 0x0EFE, 0x726A, 0x726D, 0x3C51,
+ 0x726E, 0x726E, 0x1942, 0x726F, 0x726F, 0x1946, 0x7270, 0x7271, 0x3C55,
+ 0x7272, 0x7272, 0x0D35, 0x7273, 0x7274, 0x3C57, 0x7275, 0x7275, 0x0C20,
+ 0x7276, 0x7278, 0x3C59, 0x7279, 0x7279, 0x0E2B, 0x727A, 0x727A, 0x0F0D,
+ 0x727B, 0x727C, 0x3C5C, 0x727D, 0x727D, 0x20CC, 0x727E, 0x727F, 0x1947,
+ 0x7280, 0x7280, 0x0F19, 0x7281, 0x7281, 0x09D2, 0x7282, 0x7283, 0x3C5E,
+ 0x7284, 0x7284, 0x1949, 0x7285, 0x7289, 0x3C60, 0x728A, 0x728A, 0x05FE,
+ 0x728B, 0x728B, 0x194A, 0x728C, 0x728C, 0x3C65, 0x728D, 0x728D, 0x194B,
+ 0x728E, 0x728E, 0x3C66, 0x728F, 0x728F, 0x194C, 0x7290, 0x7291, 0x3C67,
+ 0x7292, 0x7292, 0x194D, 0x7293, 0x7295, 0x3C69, 0x7296, 0x7296, 0x2340,
+ 0x7297, 0x729E, 0x3C6C, 0x729F, 0x729F, 0x1943, 0x72A0, 0x72A1, 0x3C74,
+ 0x72A2, 0x72A2, 0x1ED1, 0x72A3, 0x72A6, 0x3C76, 0x72A7, 0x72A7, 0x21AC,
+ 0x72A8, 0x72AB, 0x3C7A, 0x72AC, 0x72AC, 0x0C89, 0x72AD, 0x72AD, 0x15EF,
+ 0x72AE, 0x72AE, 0x3C7E, 0x72AF, 0x72AF, 0x0655, 0x72B0, 0x72B0, 0x15F0,
+ 0x72B1, 0x72B3, 0x3C7F, 0x72B4, 0x72B4, 0x15F1, 0x72B5, 0x72B5, 0x3C82,
+ 0x72B6, 0x72B6, 0x1211, 0x72B7, 0x72B8, 0x15F2, 0x72B9, 0x72B9, 0x10B1,
+ 0x72BA, 0x72BF, 0x3C83, 0x72C0, 0x72C0, 0x22AF, 0x72C1, 0x72C1, 0x15F5,
+ 0x72C2, 0x72C2, 0x097E, 0x72C3, 0x72C3, 0x15F4, 0x72C4, 0x72C4, 0x05B3,
+ 0x72C5, 0x72C7, 0x3C89, 0x72C8, 0x72C8, 0x0420, 0x72C9, 0x72CC, 0x3C8C,
+ 0x72CD, 0x72CD, 0x15F7, 0x72CE, 0x72CE, 0x15F6, 0x72CF, 0x72CF, 0x3C90,
+ 0x72D0, 0x72D0, 0x07B3, 0x72D1, 0x72D1, 0x3C91, 0x72D2, 0x72D2, 0x15F8,
+ 0x72D3, 0x72D6, 0x3C92, 0x72D7, 0x72D7, 0x0710, 0x72D8, 0x72D8, 0x3C96,
+ 0x72D9, 0x72D9, 0x0900, 0x72DA, 0x72DD, 0x3C97, 0x72DE, 0x72DE, 0x0B5F,
+ 0x72DF, 0x72DF, 0x3C9B, 0x72E0, 0x72E0, 0x0794, 0x72E1, 0x72E1, 0x0897,
+ 0x72E2, 0x72E7, 0x3C9C, 0x72E8, 0x72E8, 0x15F9, 0x72E9, 0x72E9, 0x15FB,
+ 0x72EA, 0x72EB, 0x3CA2, 0x72EC, 0x72EC, 0x05FF, 0x72ED, 0x72ED, 0x0F2E,
+ 0x72EE, 0x72EE, 0x0D3F, 0x72EF, 0x72EF, 0x15FA, 0x72F0, 0x72F0, 0x1199,
+ 0x72F1, 0x72F1, 0x10E1, 0x72F2, 0x72F2, 0x15FC, 0x72F3, 0x72F3, 0x1600,
+ 0x72F4, 0x72F4, 0x15FD, 0x72F5, 0x72F6, 0x3CA4, 0x72F7, 0x72F7, 0x15FE,
+ 0x72F8, 0x72F8, 0x09D5, 0x72F9, 0x72F9, 0x21B6, 0x72FA, 0x72FB, 0x1602,
+ 0x72FC, 0x72FC, 0x09B2, 0x72FD, 0x72FD, 0x1E3D, 0x72FE, 0x72FF, 0x3CA6,
+ 0x7300, 0x7300, 0x3CA8, 0x7301, 0x7301, 0x15FF, 0x7302, 0x7302, 0x3CA9,
+ 0x7303, 0x7303, 0x1601, 0x7304, 0x7309, 0x3CAA, 0x730A, 0x730A, 0x1607,
+ 0x730B, 0x730D, 0x3CB0, 0x730E, 0x730E, 0x0A1D, 0x730F, 0x7312, 0x3CB3,
+ 0x7313, 0x7313, 0x1605, 0x7314, 0x7314, 0x3CB7, 0x7315, 0x7315, 0x160A,
+ 0x7316, 0x7316, 0x04C5, 0x7317, 0x7317, 0x1604, 0x7318, 0x731A, 0x3CB8,
+ 0x731B, 0x731B, 0x0AD2, 0x731C, 0x731C, 0x0489, 0x731D, 0x731D, 0x1609,
+ 0x731E, 0x731E, 0x1608, 0x731F, 0x7320, 0x3CBB, 0x7321, 0x7321, 0x1606,
+ 0x7322, 0x7322, 0x160B, 0x7323, 0x7324, 0x3CBD, 0x7325, 0x7325, 0x160D,
+ 0x7326, 0x7328, 0x3CBF, 0x7329, 0x7329, 0x0F94, 0x732A, 0x732A, 0x11EC,
+ 0x732B, 0x732B, 0x0AAD, 0x732C, 0x732C, 0x160E, 0x732D, 0x732D, 0x3CC2,
+ 0x732E, 0x732E, 0x0F44, 0x732F, 0x7330, 0x3CC3, 0x7331, 0x7331, 0x1610,
+ 0x7332, 0x7333, 0x3CC5, 0x7334, 0x7334, 0x07A6, 0x7335, 0x7335, 0x3CC7,
+ 0x7336, 0x7336, 0x2235, 0x7337, 0x7337, 0x18D4, 0x7338, 0x7338, 0x160F,
+ 0x7339, 0x7339, 0x160C, 0x733A, 0x733A, 0x3CC8, 0x733B, 0x733B, 0x2397,
+ 0x733C, 0x733D, 0x3CC9, 0x733E, 0x733E, 0x07C0, 0x733F, 0x733F, 0x10F6,
+ 0x7340, 0x7340, 0x3CCB, 0x7341, 0x7341, 0x2395, 0x7342, 0x7343, 0x3CCC,
+ 0x7344, 0x7344, 0x223F, 0x7345, 0x7345, 0x212A, 0x7346, 0x734C, 0x3CCE,
+ 0x734D, 0x734D, 0x1612, 0x734E, 0x734F, 0x3CD5, 0x7350, 0x7350, 0x1611,
+ 0x7351, 0x7351, 0x3CD7, 0x7352, 0x7352, 0x18D5, 0x7353, 0x7356, 0x3CD8,
+ 0x7357, 0x7357, 0x1613, 0x7358, 0x735F, 0x3CDC, 0x7360, 0x7360, 0x1614,
+ 0x7361, 0x7367, 0x3CE4, 0x7368, 0x7368, 0x1ED2, 0x7369, 0x7369, 0x3CEB,
+ 0x736A, 0x736A, 0x2396, 0x736B, 0x736B, 0x2398, 0x736C, 0x736C, 0x1615,
+ 0x736D, 0x736D, 0x0DF4, 0x736E, 0x736E, 0x3CEC, 0x736F, 0x736F, 0x1616,
+ 0x7370, 0x7370, 0x20A2, 0x7371, 0x7371, 0x3CED, 0x7372, 0x7372, 0x1F64,
+ 0x7373, 0x7374, 0x3CEE, 0x7375, 0x7375, 0x202B, 0x7376, 0x7376, 0x3CF0,
+ 0x7377, 0x7377, 0x2394, 0x7378, 0x7378, 0x2139, 0x7379, 0x7379, 0x3CF1,
+ 0x737A, 0x737A, 0x215F, 0x737B, 0x737B, 0x21C1, 0x737C, 0x737C, 0x239A,
+ 0x737D, 0x737D, 0x3CF2, 0x737E, 0x737E, 0x1617, 0x737F, 0x737F, 0x3CF3,
+ 0x7380, 0x7380, 0x2399, 0x7381, 0x7383, 0x3CF4, 0x7384, 0x7384, 0x0FC9,
+ 0x7385, 0x7386, 0x3CF7, 0x7387, 0x7387, 0x0A71, 0x7388, 0x7388, 0x3CF9,
+ 0x7389, 0x7389, 0x10D6, 0x738A, 0x738A, 0x3CFA, 0x738B, 0x738B, 0x0EA6,
+ 0x738C, 0x738D, 0x3CFB, 0x738E, 0x738E, 0x1818, 0x738F, 0x7390, 0x3CFD,
+ 0x7391, 0x7391, 0x1819, 0x7392, 0x7395, 0x3CFF, 0x7396, 0x7396, 0x08F0,
+ 0x7397, 0x739A, 0x3D03, 0x739B, 0x739B, 0x0A91, 0x739C, 0x739E, 0x3D07,
+ 0x739F, 0x739F, 0x181C, 0x73A0, 0x73A1, 0x3D0A, 0x73A2, 0x73A2, 0x181B,
+ 0x73A3, 0x73A8, 0x3D0C, 0x73A9, 0x73A9, 0x0E97, 0x73AA, 0x73AA, 0x3D12,
+ 0x73AB, 0x73AB, 0x0ABA, 0x73AC, 0x73AD, 0x3D13, 0x73AE, 0x73AE, 0x181A,
+ 0x73AF, 0x73AF, 0x07CC, 0x73B0, 0x73B0, 0x0F43, 0x73B1, 0x73B1, 0x3D15,
+ 0x73B2, 0x73B2, 0x0A2A, 0x73B3, 0x73B3, 0x1821, 0x73B4, 0x73B6, 0x3D16,
+ 0x73B7, 0x73B7, 0x1820, 0x73B8, 0x73B9, 0x3D19, 0x73BA, 0x73BA, 0x182C,
+ 0x73BB, 0x73BB, 0x046A, 0x73BC, 0x73BF, 0x3D1B, 0x73C0, 0x73C0, 0x1822,
+ 0x73C1, 0x73C1, 0x3D1F, 0x73C2, 0x73C2, 0x181E, 0x73C3, 0x73C7, 0x3D20,
+ 0x73C8, 0x73C8, 0x1824, 0x73C9, 0x73C9, 0x1823, 0x73CA, 0x73CA, 0x0CF3,
+ 0x73CB, 0x73CC, 0x3D25, 0x73CD, 0x73CD, 0x1185, 0x73CE, 0x73CE, 0x3D27,
+ 0x73CF, 0x73CF, 0x181D, 0x73D0, 0x73D0, 0x0646, 0x73D1, 0x73D1, 0x181F,
+ 0x73D2, 0x73D8, 0x3D28, 0x73D9, 0x73D9, 0x1826, 0x73DA, 0x73DD, 0x3D2F,
+ 0x73DE, 0x73DE, 0x182B, 0x73DF, 0x73DF, 0x3D33, 0x73E0, 0x73E0, 0x11E8,
+ 0x73E1, 0x73E4, 0x3D34, 0x73E5, 0x73E5, 0x1825, 0x73E6, 0x73E6, 0x3D38,
+ 0x73E7, 0x73E7, 0x182A, 0x73E8, 0x73E8, 0x3D39, 0x73E9, 0x73E9, 0x1829,
+ 0x73EA, 0x73EC, 0x3D3A, 0x73ED, 0x73ED, 0x03EB, 0x73EE, 0x73F1, 0x3D3D,
+ 0x73F2, 0x73F2, 0x182D, 0x73F3, 0x73FD, 0x3D41, 0x73FE, 0x73FE, 0x21C0,
+ 0x73FF, 0x73FF, 0x3D4C, 0x7400, 0x7402, 0x3D4D, 0x7403, 0x7403, 0x0C6F,
+ 0x7404, 0x7404, 0x3D50, 0x7405, 0x7405, 0x09B0, 0x7406, 0x7406, 0x09D8,
+ 0x7407, 0x7408, 0x3D51, 0x7409, 0x7409, 0x0A39, 0x740A, 0x740A, 0x1828,
+ 0x740B, 0x740E, 0x3D53, 0x740F, 0x740F, 0x182E, 0x7410, 0x7410, 0x0DEB,
+ 0x7411, 0x7419, 0x3D57, 0x741A, 0x741A, 0x1838, 0x741B, 0x741B, 0x1837,
+ 0x741C, 0x7421, 0x3D60, 0x7422, 0x7422, 0x121E, 0x7423, 0x7424, 0x3D66,
+ 0x7425, 0x7425, 0x1832, 0x7426, 0x7426, 0x1831, 0x7427, 0x7427, 0x3D68,
+ 0x7428, 0x7428, 0x1833, 0x7429, 0x7429, 0x3D69, 0x742A, 0x742A, 0x182F,
+ 0x742B, 0x742B, 0x3D6A, 0x742C, 0x742C, 0x1836, 0x742D, 0x742D, 0x3D6B,
+ 0x742E, 0x742E, 0x1835, 0x742F, 0x742F, 0x3D6C, 0x7430, 0x7430, 0x1834,
+ 0x7431, 0x7432, 0x3D6D, 0x7433, 0x7433, 0x0A1E, 0x7434, 0x7434, 0x0C56,
+ 0x7435, 0x7435, 0x0BBE, 0x7436, 0x7436, 0x0B84, 0x7437, 0x743B, 0x3D6F,
+ 0x743C, 0x743C, 0x0C6A, 0x743D, 0x743E, 0x3D74, 0x743F, 0x743F, 0x2460,
+ 0x7440, 0x7440, 0x3D76, 0x7441, 0x7441, 0x1839, 0x7442, 0x744A, 0x3D77,
+ 0x744B, 0x744B, 0x245C, 0x744C, 0x7454, 0x3D80, 0x7455, 0x7455, 0x183C,
+ 0x7456, 0x7456, 0x3D89, 0x7457, 0x7457, 0x183B, 0x7458, 0x7458, 0x3D8A,
+ 0x7459, 0x7459, 0x183D, 0x745A, 0x745A, 0x07AE, 0x745B, 0x745B, 0x1830,
+ 0x745C, 0x745C, 0x183A, 0x745D, 0x745D, 0x3D8B, 0x745E, 0x745E, 0x0CCB,
+ 0x745F, 0x745F, 0x0CE3, 0x7460, 0x7462, 0x3D8C, 0x7463, 0x7463, 0x215D,
+ 0x7464, 0x7468, 0x3D8F, 0x7469, 0x7469, 0x2225, 0x746A, 0x746A, 0x206A,
+ 0x746B, 0x746C, 0x3D94, 0x746D, 0x746D, 0x183F, 0x746E, 0x746F, 0x3D96,
+ 0x7470, 0x7470, 0x073E, 0x7471, 0x7475, 0x3D98, 0x7476, 0x7476, 0x1027,
+ 0x7477, 0x7477, 0x183E, 0x7478, 0x747D, 0x3D9D, 0x747E, 0x747E, 0x1840,
+ 0x747F, 0x747F, 0x3DA3, 0x7480, 0x7481, 0x1843, 0x7482, 0x7482, 0x3DA4,
+ 0x7483, 0x7483, 0x09F0, 0x7484, 0x7486, 0x3DA5, 0x7487, 0x7487, 0x1845,
+ 0x7488, 0x7488, 0x3DA8, 0x7489, 0x7489, 0x2461, 0x748A, 0x748A, 0x3DA9,
+ 0x748B, 0x748B, 0x1846, 0x748C, 0x748D, 0x3DAA, 0x748E, 0x748E, 0x1842,
+ 0x748F, 0x748F, 0x3DAC, 0x7490, 0x7490, 0x184A, 0x7491, 0x749B, 0x3DAD,
+ 0x749C, 0x749C, 0x1841, 0x749D, 0x749D, 0x3DB8, 0x749E, 0x749E, 0x1847,
+ 0x749F, 0x74A2, 0x3DB9, 0x74A3, 0x74A3, 0x245B, 0x74A4, 0x74A5, 0x3DBD,
+ 0x74A6, 0x74A6, 0x2462, 0x74A7, 0x74A7, 0x184B, 0x74A8, 0x74A9, 0x1848,
+ 0x74AA, 0x74AF, 0x3DBF, 0x74B0, 0x74B0, 0x1F54, 0x74B1, 0x74B9, 0x3DC5,
+ 0x74BA, 0x74BA, 0x184D, 0x74BB, 0x74BC, 0x3DCE, 0x74BD, 0x74BD, 0x245F,
+ 0x74BE, 0x74C9, 0x3DD0, 0x74CA, 0x74CA, 0x20EC, 0x74CB, 0x74CE, 0x3DDC,
+ 0x74CF, 0x74CF, 0x245D, 0x74D0, 0x74D1, 0x3DE0, 0x74D2, 0x74D2, 0x184C,
+ 0x74D3, 0x74D3, 0x3DE2, 0x74D4, 0x74D4, 0x2463, 0x74D5, 0x74D9, 0x3DE3,
+ 0x74DA, 0x74DA, 0x2464, 0x74DB, 0x74DB, 0x3DE8, 0x74DC, 0x74DC, 0x0728,
+ 0x74DD, 0x74DD, 0x3DE9, 0x74DE, 0x74DE, 0x1B32, 0x74DF, 0x74DF, 0x3DEA,
+ 0x74E0, 0x74E0, 0x1B33, 0x74E1, 0x74E1, 0x3DEB, 0x74E2, 0x74E2, 0x0BCF,
+ 0x74E3, 0x74E3, 0x03F5, 0x74E4, 0x74E4, 0x0C9A, 0x74E5, 0x74E5, 0x3DEC,
+ 0x74E6, 0x74E6, 0x0E90, 0x74E7, 0x74ED, 0x3DED, 0x74EE, 0x74EE, 0x0EDC,
+ 0x74EF, 0x74EF, 0x1903, 0x74F0, 0x74F3, 0x3DF4, 0x74F4, 0x74F4, 0x1904,
+ 0x74F5, 0x74F5, 0x3DF8, 0x74F6, 0x74F6, 0x0BDE, 0x74F7, 0x74F7, 0x054C,
+ 0x74F8, 0x74FE, 0x3DF9, 0x74FF, 0x74FF, 0x1905, 0x7500, 0x7503, 0x3E00,
+ 0x7504, 0x7504, 0x1188, 0x7505, 0x750B, 0x3E04, 0x750C, 0x750C, 0x24A5,
+ 0x750D, 0x750D, 0x1485, 0x750E, 0x750E, 0x3E0B, 0x750F, 0x750F, 0x1906,
+ 0x7510, 0x7510, 0x3E0C, 0x7511, 0x7511, 0x1907, 0x7512, 0x7512, 0x3E0D,
+ 0x7513, 0x7513, 0x1908, 0x7514, 0x7517, 0x3E0E, 0x7518, 0x7518, 0x06C5,
+ 0x7519, 0x7519, 0x14F8, 0x751A, 0x751A, 0x0D2E, 0x751B, 0x751B, 0x3E12,
+ 0x751C, 0x751C, 0x0E43, 0x751D, 0x751E, 0x3E13, 0x751F, 0x751F, 0x0D33,
+ 0x7520, 0x7522, 0x3E15, 0x7523, 0x7523, 0x1E70, 0x7524, 0x7524, 0x3E18,
+ 0x7525, 0x7525, 0x0D34, 0x7526, 0x7527, 0x3E19, 0x7528, 0x7528, 0x10A8,
+ 0x7529, 0x7529, 0x0D9B, 0x752A, 0x752A, 0x3E1B, 0x752B, 0x752B, 0x06A1,
+ 0x752C, 0x752C, 0x1B34, 0x752D, 0x752D, 0x042B, 0x752E, 0x752E, 0x3E1C,
+ 0x752F, 0x752F, 0x1734, 0x7530, 0x7530, 0x0E42, 0x7531, 0x7531, 0x10AE,
+ 0x7532, 0x7532, 0x084A, 0x7533, 0x7533, 0x0D23, 0x7534, 0x7534, 0x3E1D,
+ 0x7535, 0x7535, 0x05C8, 0x7536, 0x7536, 0x3E1E, 0x7537, 0x7537, 0x0B33,
+ 0x7538, 0x7538, 0x05CA, 0x7539, 0x7539, 0x3E1F, 0x753A, 0x753A, 0x1A78,
+ 0x753B, 0x753B, 0x07C2, 0x753C, 0x753D, 0x3E20, 0x753E, 0x753E, 0x1816,
+ 0x753F, 0x753F, 0x3E22, 0x7540, 0x7540, 0x1A79, 0x7541, 0x7544, 0x3E23,
+ 0x7545, 0x7545, 0x04CE, 0x7546, 0x7547, 0x3E27, 0x7548, 0x7548, 0x1A7C,
+ 0x7549, 0x754A, 0x3E29, 0x754B, 0x754B, 0x1A7B, 0x754C, 0x754C, 0x08B8,
+ 0x754D, 0x754D, 0x3E2B, 0x754E, 0x754E, 0x1A7A, 0x754F, 0x754F, 0x0EC6,
+ 0x7550, 0x7553, 0x3E2C, 0x7554, 0x7554, 0x0B90, 0x7555, 0x7558, 0x3E30,
+ 0x7559, 0x7559, 0x0A3D, 0x755A, 0x755A, 0x139E, 0x755B, 0x755B, 0x1A7D,
+ 0x755C, 0x755C, 0x0FBE, 0x755D, 0x755D, 0x208F, 0x755E, 0x7561, 0x3E34,
+ 0x7562, 0x7562, 0x1E42, 0x7563, 0x7564, 0x3E38, 0x7565, 0x7565, 0x0A7B,
+ 0x7566, 0x7566, 0x0C07, 0x7567, 0x7569, 0x3E3A, 0x756A, 0x756A, 0x0649,
+ 0x756B, 0x756B, 0x1F4E, 0x756C, 0x7571, 0x3E3D, 0x7572, 0x7572, 0x1A7E,
+ 0x7573, 0x7573, 0x3E43, 0x7574, 0x7574, 0x0510, 0x7575, 0x7575, 0x3E44,
+ 0x7576, 0x7576, 0x1EB1, 0x7577, 0x7577, 0x3E45, 0x7578, 0x7578, 0x0810,
+ 0x7579, 0x7579, 0x1A7F, 0x757A, 0x757E, 0x3E46, 0x757F, 0x757F, 0x1814,
+ 0x7580, 0x7582, 0x3E4B, 0x7583, 0x7583, 0x1A80, 0x7584, 0x7585, 0x3E4E,
+ 0x7586, 0x7586, 0x087F, 0x7587, 0x7587, 0x1E8B, 0x7588, 0x758A, 0x3E50,
+ 0x758B, 0x758B, 0x1BC6, 0x758C, 0x758E, 0x3E53, 0x758F, 0x758F, 0x0D7F,
+ 0x7590, 0x7590, 0x3E56, 0x7591, 0x7591, 0x1050, 0x7592, 0x7592, 0x1B60,
+ 0x7593, 0x7593, 0x3E57, 0x7594, 0x7594, 0x1B61, 0x7595, 0x7595, 0x3E58,
+ 0x7596, 0x7596, 0x1B62, 0x7597, 0x7597, 0x0A0F, 0x7598, 0x7598, 0x3E59,
+ 0x7599, 0x7599, 0x06E8, 0x759A, 0x759A, 0x08FD, 0x759B, 0x759C, 0x3E5A,
+ 0x759D, 0x759D, 0x1B64, 0x759E, 0x759E, 0x3E5C, 0x759F, 0x759F, 0x0B72,
+ 0x75A0, 0x75A0, 0x1B63, 0x75A1, 0x75A1, 0x101A, 0x75A2, 0x75A2, 0x3E5D,
+ 0x75A3, 0x75A3, 0x1B66, 0x75A4, 0x75A4, 0x03D7, 0x75A5, 0x75A5, 0x08BB,
+ 0x75A6, 0x75AA, 0x3E5E, 0x75AB, 0x75AB, 0x1066, 0x75AC, 0x75AC, 0x1B65,
+ 0x75AD, 0x75AD, 0x3E63, 0x75AE, 0x75AE, 0x0532, 0x75AF, 0x75AF, 0x0685,
+ 0x75B0, 0x75B0, 0x1B6C, 0x75B1, 0x75B1, 0x1B6B, 0x75B2, 0x75B2, 0x0BC2,
+ 0x75B3, 0x75B4, 0x1B67, 0x75B5, 0x75B5, 0x0546, 0x75B6, 0x75B7, 0x3E64,
+ 0x75B8, 0x75B8, 0x1B69, 0x75B9, 0x75B9, 0x118F, 0x75BA, 0x75BB, 0x3E66,
+ 0x75BC, 0x75BC, 0x0E2E, 0x75BD, 0x75BD, 0x0901, 0x75BE, 0x75BE, 0x0825,
+ 0x75BF, 0x75C1, 0x3E68, 0x75C2, 0x75C2, 0x1B6E, 0x75C3, 0x75C3, 0x1B6D,
+ 0x75C4, 0x75C4, 0x1B6A, 0x75C5, 0x75C5, 0x0468, 0x75C6, 0x75C6, 0x3E6B,
+ 0x75C7, 0x75C7, 0x11A1, 0x75C8, 0x75C8, 0x109D, 0x75C9, 0x75C9, 0x08E6,
+ 0x75CA, 0x75CA, 0x0C87, 0x75CB, 0x75CC, 0x3E6C, 0x75CD, 0x75CD, 0x1B70,
+ 0x75CE, 0x75D1, 0x3E6E, 0x75D2, 0x75D2, 0x1020, 0x75D3, 0x75D3, 0x3E72,
+ 0x75D4, 0x75D4, 0x11CB, 0x75D5, 0x75D5, 0x0792, 0x75D6, 0x75D6, 0x1B6F,
+ 0x75D7, 0x75D7, 0x3E73, 0x75D8, 0x75D8, 0x05FA, 0x75D9, 0x75D9, 0x1FC6,
+ 0x75DA, 0x75DA, 0x3E74, 0x75DB, 0x75DB, 0x0E65, 0x75DC, 0x75DD, 0x3E75,
+ 0x75DE, 0x75DE, 0x0BC5, 0x75DF, 0x75E1, 0x3E77, 0x75E2, 0x75E2, 0x09EA,
+ 0x75E3, 0x75E3, 0x1B71, 0x75E4, 0x75E4, 0x1B74, 0x75E5, 0x75E5, 0x3E7A,
+ 0x75E6, 0x75E6, 0x1B73, 0x75E7, 0x75E7, 0x1B76, 0x75E8, 0x75E8, 0x1B72,
+ 0x75E9, 0x75E9, 0x3E7B, 0x75EA, 0x75EA, 0x07D3, 0x75EB, 0x75EB, 0x1B75,
+ 0x75EC, 0x75EF, 0x3E7C, 0x75F0, 0x75F0, 0x0E08, 0x75F1, 0x75F1, 0x1B78,
+ 0x75F2, 0x75F3, 0x3E80, 0x75F4, 0x75F4, 0x04FA, 0x75F5, 0x75F8, 0x3E82,
+ 0x75F9, 0x75F9, 0x043D, 0x75FA, 0x75FB, 0x3E86, 0x75FC, 0x75FC, 0x1B79,
+ 0x75FD, 0x75FE, 0x3E88, 0x75FF, 0x75FF, 0x1B7A, 0x7600, 0x7600, 0x1B7C,
+ 0x7601, 0x7601, 0x0564, 0x7602, 0x7602, 0x25AE, 0x7603, 0x7603, 0x1B77,
+ 0x7604, 0x7604, 0x3E8A, 0x7605, 0x7605, 0x1B7D, 0x7606, 0x7609, 0x3E8B,
+ 0x760A, 0x760A, 0x1B80, 0x760B, 0x760B, 0x1F01, 0x760C, 0x760C, 0x1B7E,
+ 0x760D, 0x760D, 0x2200, 0x760E, 0x760F, 0x3E8F, 0x7610, 0x7610, 0x1B7B,
+ 0x7611, 0x7614, 0x3E91, 0x7615, 0x7615, 0x1B83, 0x7616, 0x7616, 0x3E95,
+ 0x7617, 0x7617, 0x1B7F, 0x7618, 0x7618, 0x1B82, 0x7619, 0x7619, 0x1B84,
+ 0x761A, 0x761A, 0x3E96, 0x761B, 0x761B, 0x1B85, 0x761C, 0x761D, 0x3E97,
+ 0x761E, 0x761E, 0x25B2, 0x761F, 0x761F, 0x0ED0, 0x7620, 0x7620, 0x1B88,
+ 0x7621, 0x7621, 0x1E97, 0x7622, 0x7622, 0x1B87, 0x7623, 0x7623, 0x3E99,
+ 0x7624, 0x7624, 0x0A3F, 0x7625, 0x7625, 0x1B81, 0x7626, 0x7626, 0x0D74,
+ 0x7627, 0x7627, 0x20AB, 0x7628, 0x7628, 0x3E9A, 0x7629, 0x7629, 0x0574,
+ 0x762A, 0x762A, 0x045A, 0x762B, 0x762B, 0x0E04, 0x762C, 0x762C, 0x3E9B,
+ 0x762D, 0x762D, 0x1B8A, 0x762E, 0x762F, 0x3E9C, 0x7630, 0x7630, 0x1B8B,
+ 0x7631, 0x7632, 0x3E9E, 0x7633, 0x7633, 0x1B90, 0x7634, 0x7634, 0x116F,
+ 0x7635, 0x7635, 0x1B8D, 0x7636, 0x7637, 0x3EA0, 0x7638, 0x7638, 0x0C8E,
+ 0x7639, 0x763A, 0x3EA2, 0x763B, 0x763B, 0x25B3, 0x763C, 0x763C, 0x1B86,
+ 0x763D, 0x763D, 0x3EA4, 0x763E, 0x763E, 0x1B8F, 0x763F, 0x763F, 0x1B8C,
+ 0x7640, 0x7640, 0x1B89, 0x7641, 0x7641, 0x3EA5, 0x7642, 0x7642, 0x2028,
+ 0x7643, 0x7643, 0x1B8E, 0x7644, 0x7645, 0x3EA6, 0x7646, 0x7647, 0x25AF,
+ 0x7648, 0x7648, 0x3EA8, 0x7649, 0x7649, 0x25B1, 0x764A, 0x764B, 0x3EA9,
+ 0x764C, 0x764C, 0x03B4, 0x764D, 0x764D, 0x1B91, 0x764E, 0x7653, 0x3EAB,
+ 0x7654, 0x7654, 0x1B93, 0x7655, 0x7655, 0x3EB1, 0x7656, 0x7656, 0x1B95,
+ 0x7657, 0x7657, 0x3EB2, 0x7658, 0x7658, 0x25AC, 0x7659, 0x765B, 0x3EB3,
+ 0x765C, 0x765C, 0x1B94, 0x765D, 0x765D, 0x3EB6, 0x765E, 0x765E, 0x1B92,
+ 0x765F, 0x765F, 0x1E4E, 0x7660, 0x7661, 0x3EB7, 0x7662, 0x7662, 0x2202,
+ 0x7663, 0x7663, 0x0FCB, 0x7664, 0x7664, 0x25AB, 0x7665, 0x7665, 0x2286,
+ 0x7666, 0x7666, 0x3EB9, 0x7667, 0x7667, 0x25AD, 0x7668, 0x7668, 0x3EBA,
+ 0x7669, 0x7669, 0x25B6, 0x766A, 0x766A, 0x3EBB, 0x766B, 0x766B, 0x1B96,
+ 0x766C, 0x766C, 0x21E3, 0x766D, 0x766E, 0x25B4, 0x766F, 0x766F, 0x1B97,
+ 0x7670, 0x7670, 0x222F, 0x7671, 0x7671, 0x2165, 0x7672, 0x7672, 0x25B7,
+ 0x7673, 0x7677, 0x3EBC, 0x7678, 0x7678, 0x0748, 0x7679, 0x767A, 0x3EC1,
+ 0x767B, 0x767B, 0x05A8, 0x767C, 0x767C, 0x1EE9, 0x767D, 0x767D, 0x03E2,
+ 0x767E, 0x767E, 0x03E4, 0x767F, 0x7681, 0x3EC3, 0x7682, 0x7682, 0x1130,
+ 0x7683, 0x7683, 0x3EC6, 0x7684, 0x7684, 0x05A5, 0x7685, 0x7685, 0x3EC7,
+ 0x7686, 0x7686, 0x08A5, 0x7687, 0x7687, 0x07DF, 0x7688, 0x7688, 0x1B2D,
+ 0x7689, 0x768A, 0x3EC8, 0x768B, 0x768B, 0x06D9, 0x768C, 0x768D, 0x3ECA,
+ 0x768E, 0x768E, 0x1B2E, 0x768F, 0x7690, 0x3ECC, 0x7691, 0x7691, 0x03B3,
+ 0x7692, 0x7692, 0x3ECE, 0x7693, 0x7693, 0x1B2F, 0x7694, 0x7695, 0x3ECF,
+ 0x7696, 0x7696, 0x0E9F, 0x7697, 0x7698, 0x3ED1, 0x7699, 0x7699, 0x1B30,
+ 0x769A, 0x769A, 0x1E25, 0x769B, 0x76A3, 0x3ED3, 0x76A4, 0x76A4, 0x1B31,
+ 0x76A5, 0x76AD, 0x3EDC, 0x76AE, 0x76AE, 0x0BC3, 0x76AF, 0x76B0, 0x3EE5,
+ 0x76B1, 0x76B1, 0x11E4, 0x76B2, 0x76B2, 0x1BC8, 0x76B3, 0x76B3, 0x3EE7,
+ 0x76B4, 0x76B4, 0x1BC9, 0x76B5, 0x76B7, 0x3EE8, 0x76B8, 0x76B8, 0x25C0,
+ 0x76B9, 0x76B9, 0x3EEB, 0x76BA, 0x76BA, 0x229A, 0x76BB, 0x76BE, 0x3EEC,
+ 0x76BF, 0x76BF, 0x0AF8, 0x76C0, 0x76C1, 0x3EF0, 0x76C2, 0x76C2, 0x10C0,
+ 0x76C3, 0x76C4, 0x3EF2, 0x76C5, 0x76C5, 0x11D0, 0x76C6, 0x76C6, 0x0BA9,
+ 0x76C7, 0x76C7, 0x3EF4, 0x76C8, 0x76C8, 0x1094, 0x76C9, 0x76C9, 0x3EF5,
+ 0x76CA, 0x76CA, 0x106D, 0x76CB, 0x76CC, 0x3EF6, 0x76CD, 0x76CD, 0x1A8B,
+ 0x76CE, 0x76CE, 0x03C6, 0x76CF, 0x76CF, 0x1156, 0x76D0, 0x76D0, 0x0FF7,
+ 0x76D1, 0x76D1, 0x0853, 0x76D2, 0x76D2, 0x0787, 0x76D3, 0x76D3, 0x3EF8,
+ 0x76D4, 0x76D4, 0x0985, 0x76D5, 0x76D5, 0x3EF9, 0x76D6, 0x76D6, 0x06C2,
+ 0x76D7, 0x76D7, 0x05A2, 0x76D8, 0x76D8, 0x0B8D, 0x76D9, 0x76DA, 0x3EFA,
+ 0x76DB, 0x76DB, 0x0D39, 0x76DC, 0x76DD, 0x3EFC, 0x76DE, 0x76DE, 0x226E,
+ 0x76DF, 0x76DF, 0x0AD0, 0x76E0, 0x76E0, 0x3EFE, 0x76E1, 0x76E1, 0x1FBD,
+ 0x76E2, 0x76E2, 0x3EFF, 0x76E3, 0x76E3, 0x1F84, 0x76E4, 0x76E4, 0x20B2,
+ 0x76E5, 0x76E5, 0x1A8C, 0x76E6, 0x76E6, 0x3F00, 0x76E7, 0x76E7, 0x2043,
+ 0x76E8, 0x76ED, 0x3F01, 0x76EE, 0x76EE, 0x0B22, 0x76EF, 0x76EF, 0x05E1,
+ 0x76F0, 0x76F0, 0x3F07, 0x76F1, 0x76F1, 0x1A58, 0x76F2, 0x76F2, 0x0AA9,
+ 0x76F3, 0x76F3, 0x3F08, 0x76F4, 0x76F4, 0x11B0, 0x76F5, 0x76F7, 0x3F09,
+ 0x76F8, 0x76F8, 0x0F4D, 0x76F9, 0x76F9, 0x1A5B, 0x76FA, 0x76FB, 0x3F0C,
+ 0x76FC, 0x76FC, 0x0B8F, 0x76FD, 0x76FD, 0x3F0E, 0x76FE, 0x76FE, 0x061B,
+ 0x76FF, 0x76FF, 0x3F0F, 0x7700, 0x7700, 0x3F10, 0x7701, 0x7701, 0x0D38,
+ 0x7702, 0x7703, 0x3F11, 0x7704, 0x7704, 0x1A59, 0x7705, 0x7706, 0x3F13,
+ 0x7707, 0x7708, 0x1A5C, 0x7709, 0x7709, 0x0AC1, 0x770A, 0x770A, 0x3F15,
+ 0x770B, 0x770B, 0x0941, 0x770C, 0x770C, 0x3F16, 0x770D, 0x770D, 0x1A5A,
+ 0x770E, 0x7718, 0x3F17, 0x7719, 0x7719, 0x1A60, 0x771A, 0x771A, 0x1A5E,
+ 0x771B, 0x771E, 0x3F22, 0x771F, 0x771F, 0x1187, 0x7720, 0x7720, 0x0AE4,
+ 0x7721, 0x7721, 0x3F26, 0x7722, 0x7722, 0x1A5F, 0x7723, 0x7725, 0x3F27,
+ 0x7726, 0x7726, 0x1A62, 0x7727, 0x7727, 0x3F2A, 0x7728, 0x7728, 0x1144,
+ 0x7729, 0x7729, 0x0FCC, 0x772A, 0x772C, 0x3F2B, 0x772D, 0x772D, 0x1A61,
+ 0x772E, 0x772E, 0x3F2E, 0x772F, 0x772F, 0x0AD5, 0x7730, 0x7734, 0x3F2F,
+ 0x7735, 0x7735, 0x1A63, 0x7736, 0x7736, 0x0981, 0x7737, 0x7737, 0x091B,
+ 0x7738, 0x7738, 0x1A64, 0x7739, 0x7739, 0x3F34, 0x773A, 0x773A, 0x0E4A,
+ 0x773B, 0x773B, 0x3F35, 0x773C, 0x773C, 0x1004, 0x773D, 0x773F, 0x3F36,
+ 0x7740, 0x7740, 0x1222, 0x7741, 0x7741, 0x1197, 0x7742, 0x7742, 0x3F39,
+ 0x7743, 0x7743, 0x1A68, 0x7744, 0x7746, 0x3F3A, 0x7747, 0x7747, 0x1A67,
+ 0x7748, 0x774E, 0x3F3D, 0x774F, 0x774F, 0x2684, 0x7750, 0x7751, 0x1A65,
+ 0x7752, 0x7759, 0x3F44, 0x775A, 0x775A, 0x1A69, 0x775B, 0x775B, 0x08D5,
+ 0x775C, 0x775D, 0x3F4C, 0x775E, 0x775E, 0x24EF, 0x775F, 0x7760, 0x3F4E,
+ 0x7761, 0x7761, 0x0DA4, 0x7762, 0x7762, 0x1A6B, 0x7763, 0x7763, 0x05FC,
+ 0x7764, 0x7764, 0x3F50, 0x7765, 0x7765, 0x1A6C, 0x7766, 0x7766, 0x0B23,
+ 0x7767, 0x7767, 0x3F51, 0x7768, 0x7768, 0x1A6A, 0x7769, 0x776A, 0x3F52,
+ 0x776B, 0x776B, 0x08AF, 0x776C, 0x776C, 0x048E, 0x776D, 0x7778, 0x3F54,
+ 0x7779, 0x7779, 0x0602, 0x777A, 0x777C, 0x3F60, 0x777D, 0x777D, 0x1A6F,
+ 0x777E, 0x777E, 0x1270, 0x777F, 0x777F, 0x1A6D, 0x7780, 0x7780, 0x1A70,
+ 0x7781, 0x7783, 0x3F63, 0x7784, 0x7784, 0x0AEE, 0x7785, 0x7785, 0x0517,
+ 0x7786, 0x778B, 0x3F66, 0x778C, 0x778C, 0x1A71, 0x778D, 0x778D, 0x1A6E,
+ 0x778E, 0x778E, 0x0F26, 0x778F, 0x7790, 0x3F6C, 0x7791, 0x7791, 0x1A72,
+ 0x7792, 0x7792, 0x0A9E, 0x7793, 0x7797, 0x3F6E, 0x7798, 0x7798, 0x24EE,
+ 0x7799, 0x779D, 0x3F73, 0x779E, 0x779E, 0x2074, 0x779F, 0x77A0, 0x1A73,
+ 0x77A1, 0x77A1, 0x3F78, 0x77A2, 0x77A2, 0x1495, 0x77A3, 0x77A4, 0x3F79,
+ 0x77A5, 0x77A5, 0x0BD2, 0x77A6, 0x77A6, 0x3F7B, 0x77A7, 0x77A7, 0x0C43,
+ 0x77A8, 0x77A8, 0x3F7C, 0x77A9, 0x77A9, 0x11F4, 0x77AA, 0x77AA, 0x05AA,
+ 0x77AB, 0x77AB, 0x3F7D, 0x77AC, 0x77AC, 0x0DA7, 0x77AD, 0x77AD, 0x2687,
+ 0x77AE, 0x77AF, 0x3F7E, 0x77B0, 0x77B0, 0x1A75, 0x77B1, 0x77B2, 0x3F80,
+ 0x77B3, 0x77B3, 0x0E5C, 0x77B4, 0x77B4, 0x3F82, 0x77B5, 0x77B5, 0x1A76,
+ 0x77B6, 0x77BA, 0x3F83, 0x77BB, 0x77BB, 0x1151, 0x77BC, 0x77BC, 0x24F0,
+ 0x77BD, 0x77BD, 0x1A77, 0x77BE, 0x77BE, 0x3F88, 0x77BF, 0x77BF, 0x1D7E,
+ 0x77C0, 0x77C6, 0x3F89, 0x77C7, 0x77C7, 0x268D, 0x77C8, 0x77CC, 0x3F90,
+ 0x77CD, 0x77CD, 0x1397, 0x77CE, 0x77D6, 0x3F95, 0x77D7, 0x77D7, 0x0526,
+ 0x77D8, 0x77D9, 0x3F9E, 0x77DA, 0x77DA, 0x22A0, 0x77DB, 0x77DB, 0x0AB1,
+ 0x77DC, 0x77DC, 0x1BCA, 0x77DD, 0x77E1, 0x3FA0, 0x77E2, 0x77E2, 0x0D4F,
+ 0x77E3, 0x77E3, 0x105A, 0x77E4, 0x77E4, 0x3FA5, 0x77E5, 0x77E5, 0x11A9,
+ 0x77E6, 0x77E6, 0x3FA6, 0x77E7, 0x77E7, 0x1B1A, 0x77E8, 0x77E8, 0x3FA7,
+ 0x77E9, 0x77E9, 0x0907, 0x77EA, 0x77EA, 0x3FA8, 0x77EB, 0x77EB, 0x0894,
+ 0x77EC, 0x77EC, 0x1B1B, 0x77ED, 0x77ED, 0x060B, 0x77EE, 0x77EE, 0x03B6,
+ 0x77EF, 0x77EF, 0x1FAB, 0x77F0, 0x77F2, 0x3FA9, 0x77F3, 0x77F3, 0x0D46,
+ 0x77F4, 0x77F5, 0x3FAC, 0x77F6, 0x77F6, 0x1A22, 0x77F7, 0x77F7, 0x3FAE,
+ 0x77F8, 0x77F8, 0x1A23, 0x77F9, 0x77FC, 0x3FAF, 0x77FD, 0x77FD, 0x0F08,
+ 0x77FE, 0x77FE, 0x064C, 0x77FF, 0x77FF, 0x0980, 0x7800, 0x7800, 0x1A24,
+ 0x7801, 0x7801, 0x0A92, 0x7802, 0x7802, 0x0CE9, 0x7803, 0x7808, 0x3FB3,
+ 0x7809, 0x7809, 0x1A25, 0x780A, 0x780B, 0x3FB9, 0x780C, 0x780C, 0x0C15,
+ 0x780D, 0x780D, 0x0940, 0x780E, 0x7810, 0x3FBB, 0x7811, 0x7811, 0x1A28,
+ 0x7812, 0x7812, 0x0BB9, 0x7813, 0x7813, 0x3FBE, 0x7814, 0x7814, 0x0FF9,
+ 0x7815, 0x7815, 0x3FBF, 0x7816, 0x7816, 0x1206, 0x7817, 0x7818, 0x1A26,
+ 0x7819, 0x7819, 0x3FC0, 0x781A, 0x781A, 0x100B, 0x781B, 0x781B, 0x3FC1,
+ 0x781C, 0x781D, 0x1A2B, 0x781E, 0x781E, 0x3FC2, 0x781F, 0x781F, 0x1A30,
+ 0x7820, 0x7822, 0x3FC3, 0x7823, 0x7823, 0x1A34, 0x7824, 0x7824, 0x3FC6,
+ 0x7825, 0x7825, 0x1A32, 0x7826, 0x7826, 0x1A3A, 0x7827, 0x7827, 0x1189,
+ 0x7828, 0x7828, 0x3FC7, 0x7829, 0x7829, 0x1A35, 0x782A, 0x782B, 0x3FC8,
+ 0x782C, 0x782C, 0x1A33, 0x782D, 0x782D, 0x1A2A, 0x782E, 0x782F, 0x3FCA,
+ 0x7830, 0x7830, 0x0BAA, 0x7831, 0x7833, 0x3FCC, 0x7834, 0x7834, 0x0BE5,
+ 0x7835, 0x7836, 0x3FCF, 0x7837, 0x7837, 0x0D22, 0x7838, 0x7838, 0x1115,
+ 0x7839, 0x783B, 0x1A2D, 0x783C, 0x783C, 0x1A31, 0x783D, 0x783D, 0x3FD1,
+ 0x783E, 0x783E, 0x09E4, 0x783F, 0x783F, 0x3FD2, 0x7840, 0x7840, 0x0524,
+ 0x7841, 0x7842, 0x3FD3, 0x7843, 0x7843, 0x26A8, 0x7844, 0x7844, 0x3FD5,
+ 0x7845, 0x7845, 0x0741, 0x7846, 0x7846, 0x3FD6, 0x7847, 0x7847, 0x1A3C,
+ 0x7848, 0x784B, 0x3FD7, 0x784C, 0x784C, 0x1A3D, 0x784D, 0x784D, 0x3FDB,
+ 0x784E, 0x784E, 0x1A36, 0x784F, 0x784F, 0x3FDC, 0x7850, 0x7850, 0x1A3B,
+ 0x7851, 0x7851, 0x3FDD, 0x7852, 0x7852, 0x0F07, 0x7853, 0x7854, 0x3FDE,
+ 0x7855, 0x7855, 0x0DAB, 0x7856, 0x7857, 0x1A38, 0x7858, 0x785C, 0x3FE0,
+ 0x785D, 0x785D, 0x0F62, 0x785E, 0x7863, 0x3FE5, 0x7864, 0x7864, 0x24E9,
+ 0x7865, 0x7867, 0x3FEB, 0x7868, 0x7868, 0x24E5, 0x7869, 0x7869, 0x3FEE,
+ 0x786A, 0x786A, 0x1A3E, 0x786B, 0x786B, 0x0A3B, 0x786C, 0x786C, 0x1097,
+ 0x786D, 0x786D, 0x1A37, 0x786E, 0x786E, 0x0C92, 0x786F, 0x786F, 0x21FA,
+ 0x7870, 0x7876, 0x3FEF, 0x7877, 0x7877, 0x0862, 0x7878, 0x787B, 0x3FF6,
+ 0x787C, 0x787C, 0x0BB1, 0x787D, 0x7886, 0x3FFA, 0x7887, 0x7887, 0x1A42,
+ 0x7888, 0x7888, 0x4004, 0x7889, 0x7889, 0x05D0, 0x788A, 0x788B, 0x4005,
+ 0x788C, 0x788C, 0x0A5C, 0x788D, 0x788D, 0x03B8, 0x788E, 0x788E, 0x0DDE,
+ 0x788F, 0x7890, 0x4007, 0x7891, 0x7891, 0x0417, 0x7892, 0x7892, 0x4009,
+ 0x7893, 0x7893, 0x1A40, 0x7894, 0x7896, 0x400A, 0x7897, 0x7897, 0x0E9C,
+ 0x7898, 0x7898, 0x05C3, 0x7899, 0x7899, 0x400D, 0x789A, 0x789A, 0x1A41,
+ 0x789B, 0x789B, 0x1A3F, 0x789C, 0x789C, 0x1A43, 0x789D, 0x789E, 0x400E,
+ 0x789F, 0x789F, 0x05DB, 0x78A0, 0x78A0, 0x4010, 0x78A1, 0x78A1, 0x1A44,
+ 0x78A2, 0x78A2, 0x4011, 0x78A3, 0x78A3, 0x1A45, 0x78A4, 0x78A4, 0x4012,
+ 0x78A5, 0x78A5, 0x1A48, 0x78A6, 0x78A6, 0x4013, 0x78A7, 0x78A7, 0x0435,
+ 0x78A8, 0x78A8, 0x4014, 0x78A9, 0x78A9, 0x2148, 0x78AA, 0x78AC, 0x4015,
+ 0x78AD, 0x78AD, 0x24E4, 0x78AE, 0x78AF, 0x4018, 0x78B0, 0x78B0, 0x0BB7,
+ 0x78B1, 0x78B1, 0x0861, 0x78B2, 0x78B2, 0x1A46, 0x78B3, 0x78B3, 0x0E0F,
+ 0x78B4, 0x78B4, 0x04B1, 0x78B5, 0x78B7, 0x401A, 0x78B8, 0x78B8, 0x24E6,
+ 0x78B9, 0x78B9, 0x1A47, 0x78BA, 0x78BA, 0x20F7, 0x78BB, 0x78BB, 0x401D,
+ 0x78BC, 0x78BC, 0x206B, 0x78BD, 0x78BD, 0x401E, 0x78BE, 0x78BE, 0x0B4E,
+ 0x78BF, 0x78C0, 0x401F, 0x78C1, 0x78C1, 0x0548, 0x78C2, 0x78C4, 0x4021,
+ 0x78C5, 0x78C5, 0x0400, 0x78C6, 0x78C8, 0x4024, 0x78C9, 0x78C9, 0x1A4B,
+ 0x78CA, 0x78CA, 0x09C5, 0x78CB, 0x78CB, 0x056B, 0x78CC, 0x78CF, 0x4027,
+ 0x78D0, 0x78D0, 0x0B8E, 0x78D1, 0x78D3, 0x402B, 0x78D4, 0x78D4, 0x1A49,
+ 0x78D5, 0x78D5, 0x0951, 0x78D6, 0x78D8, 0x402E, 0x78D9, 0x78D9, 0x1A4A,
+ 0x78DA, 0x78DA, 0x22A7, 0x78DB, 0x78E2, 0x4031, 0x78E3, 0x78E3, 0x24EC,
+ 0x78E4, 0x78E6, 0x4039, 0x78E7, 0x78E7, 0x24EB, 0x78E8, 0x78E8, 0x0B08,
+ 0x78E9, 0x78EB, 0x403C, 0x78EC, 0x78EC, 0x1A4C, 0x78ED, 0x78EE, 0x403F,
+ 0x78EF, 0x78EF, 0x24E3, 0x78F0, 0x78F1, 0x4041, 0x78F2, 0x78F2, 0x1A4D,
+ 0x78F3, 0x78F3, 0x4043, 0x78F4, 0x78F4, 0x1A4F, 0x78F5, 0x78F6, 0x4044,
+ 0x78F7, 0x78F7, 0x0A20, 0x78F8, 0x78F9, 0x4046, 0x78FA, 0x78FA, 0x07DC,
+ 0x78FB, 0x78FC, 0x4048, 0x78FD, 0x78FD, 0x24EA, 0x78FE, 0x78FF, 0x404A,
+ 0x7900, 0x7900, 0x404C, 0x7901, 0x7901, 0x0889, 0x7902, 0x7904, 0x404D,
+ 0x7905, 0x7905, 0x1A4E, 0x7906, 0x790D, 0x4050, 0x790E, 0x790E, 0x1E92,
+ 0x790F, 0x7912, 0x4058, 0x7913, 0x7913, 0x1A50, 0x7914, 0x7918, 0x405C,
+ 0x7919, 0x7919, 0x1E27, 0x791A, 0x791D, 0x4061, 0x791E, 0x791E, 0x1A52,
+ 0x791F, 0x7923, 0x4065, 0x7924, 0x7924, 0x1A51, 0x7925, 0x7925, 0x406A,
+ 0x7926, 0x7926, 0x1FE6, 0x7927, 0x7929, 0x406B, 0x792A, 0x792A, 0x24E7,
+ 0x792B, 0x792B, 0x2012, 0x792C, 0x792C, 0x1EEC, 0x792D, 0x7930, 0x406E,
+ 0x7931, 0x7931, 0x24E8, 0x7932, 0x7933, 0x4072, 0x7934, 0x7934, 0x1A53,
+ 0x7935, 0x7939, 0x4074, 0x793A, 0x793A, 0x0D55, 0x793B, 0x793B, 0x19F8,
+ 0x793C, 0x793C, 0x09DC, 0x793D, 0x793D, 0x4079, 0x793E, 0x793E, 0x0D20,
+ 0x793F, 0x793F, 0x407A, 0x7940, 0x7940, 0x19F9, 0x7941, 0x7941, 0x0C0D,
+ 0x7942, 0x7945, 0x407B, 0x7946, 0x7946, 0x19FA, 0x7947, 0x7947, 0x407F,
+ 0x7948, 0x7948, 0x0C0C, 0x7949, 0x7949, 0x19FB, 0x794A, 0x7952, 0x4080,
+ 0x7953, 0x7953, 0x19FE, 0x7954, 0x7955, 0x4089, 0x7956, 0x7956, 0x1243,
+ 0x7957, 0x7957, 0x1A01, 0x7958, 0x7959, 0x408B, 0x795A, 0x795A, 0x19FF,
+ 0x795B, 0x795C, 0x19FC, 0x795D, 0x795D, 0x1200, 0x795E, 0x795E, 0x0D2A,
+ 0x795F, 0x795F, 0x0DE3, 0x7960, 0x7960, 0x1A02, 0x7961, 0x7961, 0x408D,
+ 0x7962, 0x7962, 0x1A00, 0x7963, 0x7964, 0x408E, 0x7965, 0x7965, 0x0F56,
+ 0x7966, 0x7966, 0x4090, 0x7967, 0x7967, 0x1A04, 0x7968, 0x7968, 0x0BD0,
+ 0x7969, 0x796C, 0x4091, 0x796D, 0x796D, 0x0833, 0x796E, 0x796E, 0x4095,
+ 0x796F, 0x796F, 0x1A03, 0x7970, 0x7976, 0x4096, 0x7977, 0x7977, 0x059C,
+ 0x7978, 0x7978, 0x080B, 0x7979, 0x7979, 0x409D, 0x797A, 0x797A, 0x1A05,
+ 0x797B, 0x797F, 0x409E, 0x7980, 0x7980, 0x130B, 0x7981, 0x7981, 0x08CC,
+ 0x7982, 0x7983, 0x40A3, 0x7984, 0x7984, 0x0A62, 0x7985, 0x7985, 0x1A06,
+ 0x7986, 0x7989, 0x40A5, 0x798A, 0x798A, 0x1A07, 0x798B, 0x798C, 0x40A9,
+ 0x798D, 0x798D, 0x1F66, 0x798E, 0x798E, 0x24DC, 0x798F, 0x798F, 0x069E,
+ 0x7990, 0x7999, 0x40AB, 0x799A, 0x799A, 0x1A08, 0x799B, 0x79A5, 0x40B5,
+ 0x79A6, 0x79A6, 0x26A2, 0x79A7, 0x79A7, 0x1A09, 0x79A8, 0x79A9, 0x40C0,
+ 0x79AA, 0x79AA, 0x24DD, 0x79AB, 0x79AD, 0x40C2, 0x79AE, 0x79AE, 0x200E,
+ 0x79AF, 0x79AF, 0x40C5, 0x79B0, 0x79B0, 0x24DB, 0x79B1, 0x79B1, 0x1EB8,
+ 0x79B2, 0x79B2, 0x40C6, 0x79B3, 0x79B3, 0x1A0A, 0x79B4, 0x79B8, 0x40C7,
+ 0x79B9, 0x79B9, 0x10D2, 0x79BA, 0x79BA, 0x1264, 0x79BB, 0x79BB, 0x09D6,
+ 0x79BC, 0x79BC, 0x40CC, 0x79BD, 0x79BD, 0x0C5A, 0x79BE, 0x79BE, 0x0783,
+ 0x79BF, 0x79BF, 0x40CD, 0x79C0, 0x79C0, 0x0FAE, 0x79C1, 0x79C1, 0x0DB2,
+ 0x79C2, 0x79C2, 0x40CE, 0x79C3, 0x79C3, 0x0E6B, 0x79C4, 0x79C5, 0x40CF,
+ 0x79C6, 0x79C6, 0x06CC, 0x79C7, 0x79C8, 0x40D1, 0x79C9, 0x79C9, 0x0465,
+ 0x79CA, 0x79CA, 0x40D3, 0x79CB, 0x79CB, 0x0C6C, 0x79CC, 0x79CC, 0x40D4,
+ 0x79CD, 0x79CD, 0x11D5, 0x79CE, 0x79D0, 0x40D5, 0x79D1, 0x79D1, 0x0953,
+ 0x79D2, 0x79D2, 0x0AF0, 0x79D3, 0x79D4, 0x40D8, 0x79D5, 0x79D5, 0x1B1D,
+ 0x79D6, 0x79D7, 0x40DA, 0x79D8, 0x79D8, 0x0ADD, 0x79D9, 0x79DE, 0x40DC,
+ 0x79DF, 0x79DF, 0x123F, 0x79E0, 0x79E2, 0x40E2, 0x79E3, 0x79E3, 0x1B1F,
+ 0x79E4, 0x79E4, 0x04F8, 0x79E5, 0x79E5, 0x40E5, 0x79E6, 0x79E6, 0x0C55,
+ 0x79E7, 0x79E7, 0x1016, 0x79E8, 0x79E8, 0x40E6, 0x79E9, 0x79E9, 0x11C7,
+ 0x79EA, 0x79EA, 0x40E7, 0x79EB, 0x79EB, 0x1B20, 0x79EC, 0x79EC, 0x40E8,
+ 0x79ED, 0x79ED, 0x1B1E, 0x79EE, 0x79EE, 0x40E9, 0x79EF, 0x79EF, 0x0812,
+ 0x79F0, 0x79F0, 0x04EB, 0x79F1, 0x79F7, 0x40EA, 0x79F8, 0x79F8, 0x08A6,
+ 0x79F9, 0x79FA, 0x40F1, 0x79FB, 0x79FB, 0x104D, 0x79FC, 0x79FC, 0x40F3,
+ 0x79FD, 0x79FD, 0x07F5, 0x79FE, 0x79FF, 0x40F4, 0x7A00, 0x7A00, 0x0F0E,
+ 0x7A01, 0x7A01, 0x40F6, 0x7A02, 0x7A02, 0x1B24, 0x7A03, 0x7A03, 0x1B23,
+ 0x7A04, 0x7A05, 0x40F7, 0x7A06, 0x7A06, 0x1B21, 0x7A07, 0x7A0A, 0x40F9,
+ 0x7A0B, 0x7A0B, 0x04F1, 0x7A0C, 0x7A0C, 0x40FD, 0x7A0D, 0x7A0D, 0x0D0D,
+ 0x7A0E, 0x7A0E, 0x0DA5, 0x7A0F, 0x7A13, 0x40FE, 0x7A14, 0x7A14, 0x1B26,
+ 0x7A15, 0x7A16, 0x4103, 0x7A17, 0x7A17, 0x03E9, 0x7A18, 0x7A19, 0x4105,
+ 0x7A1A, 0x7A1A, 0x11C8, 0x7A1B, 0x7A1D, 0x4107, 0x7A1E, 0x7A1E, 0x1B25,
+ 0x7A1F, 0x7A1F, 0x410A, 0x7A20, 0x7A20, 0x0512, 0x7A21, 0x7A22, 0x410B,
+ 0x7A23, 0x7A23, 0x1D8F, 0x7A24, 0x7A2D, 0x410D, 0x7A2E, 0x7A2E, 0x2295,
+ 0x7A2F, 0x7A30, 0x4117, 0x7A31, 0x7A31, 0x1E80, 0x7A32, 0x7A32, 0x4119,
+ 0x7A33, 0x7A33, 0x0ED7, 0x7A34, 0x7A36, 0x411A, 0x7A37, 0x7A37, 0x1B28,
+ 0x7A38, 0x7A38, 0x411D, 0x7A39, 0x7A39, 0x1B27, 0x7A3A, 0x7A3A, 0x411E,
+ 0x7A3B, 0x7A3B, 0x059F, 0x7A3C, 0x7A3C, 0x084D, 0x7A3D, 0x7A3D, 0x0811,
+ 0x7A3E, 0x7A3E, 0x411F, 0x7A3F, 0x7A3F, 0x06E0, 0x7A40, 0x7A40, 0x2677,
+ 0x7A41, 0x7A45, 0x4120, 0x7A46, 0x7A46, 0x0B25, 0x7A47, 0x7A4B, 0x4125,
+ 0x7A4C, 0x7A4C, 0x2624, 0x7A4D, 0x7A4D, 0x1F69, 0x7A4E, 0x7A4E, 0x222B,
+ 0x7A4F, 0x7A50, 0x412A, 0x7A51, 0x7A51, 0x1B29, 0x7A52, 0x7A56, 0x412C,
+ 0x7A57, 0x7A57, 0x0DE0, 0x7A58, 0x7A60, 0x4131, 0x7A61, 0x7A61, 0x257F,
+ 0x7A62, 0x7A62, 0x1F5B, 0x7A63, 0x7A68, 0x413A, 0x7A69, 0x7A69, 0x219B,
+ 0x7A6A, 0x7A6A, 0x4140, 0x7A6B, 0x7A6B, 0x267D, 0x7A6C, 0x7A6F, 0x4141,
+ 0x7A70, 0x7A70, 0x1B2C, 0x7A71, 0x7A73, 0x4145, 0x7A74, 0x7A74, 0x0FD1,
+ 0x7A75, 0x7A75, 0x4148, 0x7A76, 0x7A76, 0x08EE, 0x7A77, 0x7A77, 0x0C6B,
+ 0x7A78, 0x7A79, 0x1B9A, 0x7A7A, 0x7A7A, 0x0962, 0x7A7B, 0x7A7E, 0x4149,
+ 0x7A7F, 0x7A7F, 0x052C, 0x7A80, 0x7A80, 0x1B9C, 0x7A81, 0x7A81, 0x0E6C,
+ 0x7A82, 0x7A82, 0x414D, 0x7A83, 0x7A83, 0x0C51, 0x7A84, 0x7A84, 0x114E,
+ 0x7A85, 0x7A85, 0x414E, 0x7A86, 0x7A86, 0x1B9D, 0x7A87, 0x7A87, 0x414F,
+ 0x7A88, 0x7A88, 0x1B9E, 0x7A89, 0x7A8C, 0x4150, 0x7A8D, 0x7A8D, 0x0C4C,
+ 0x7A8E, 0x7A90, 0x4154, 0x7A91, 0x7A91, 0x102B, 0x7A92, 0x7A92, 0x11CE,
+ 0x7A93, 0x7A94, 0x4157, 0x7A95, 0x7A95, 0x1B9F, 0x7A96, 0x7A96, 0x08A2,
+ 0x7A97, 0x7A97, 0x0533, 0x7A98, 0x7A98, 0x08EC, 0x7A99, 0x7A9B, 0x4159,
+ 0x7A9C, 0x7A9C, 0x055F, 0x7A9D, 0x7A9D, 0x0EE0, 0x7A9E, 0x7A9E, 0x415C,
+ 0x7A9F, 0x7A9F, 0x096C, 0x7AA0, 0x7AA0, 0x1BA1, 0x7AA1, 0x7AA4, 0x415D,
+ 0x7AA5, 0x7AA5, 0x0987, 0x7AA6, 0x7AA6, 0x1BA0, 0x7AA7, 0x7AA7, 0x4161,
+ 0x7AA8, 0x7AA8, 0x1BA3, 0x7AA9, 0x7AA9, 0x21A0, 0x7AAA, 0x7AAA, 0x2186,
+ 0x7AAB, 0x7AAB, 0x4162, 0x7AAC, 0x7AAC, 0x1BA2, 0x7AAD, 0x7AAD, 0x1BA4,
+ 0x7AAE, 0x7AAE, 0x20ED, 0x7AAF, 0x7AB2, 0x4163, 0x7AB3, 0x7AB3, 0x1BA5,
+ 0x7AB4, 0x7AB5, 0x4167, 0x7AB6, 0x7AB6, 0x25B9, 0x7AB7, 0x7AB9, 0x4169,
+ 0x7ABA, 0x7ABA, 0x1FEA, 0x7ABB, 0x7ABE, 0x416C, 0x7ABF, 0x7ABF, 0x0A47,
+ 0x7AC0, 0x7AC3, 0x4170, 0x7AC4, 0x7AC4, 0x1EA4, 0x7AC5, 0x7AC5, 0x20E1,
+ 0x7AC6, 0x7AC6, 0x4174, 0x7AC7, 0x7AC7, 0x25B8, 0x7AC8, 0x7AC8, 0x2260,
+ 0x7AC9, 0x7AC9, 0x4175, 0x7ACA, 0x7ACA, 0x20E2, 0x7ACB, 0x7ACB, 0x09EB,
+ 0x7ACC, 0x7AD5, 0x4176, 0x7AD6, 0x7AD6, 0x0D91, 0x7AD7, 0x7AD8, 0x4180,
+ 0x7AD9, 0x7AD9, 0x115F, 0x7ADA, 0x7ADD, 0x4182, 0x7ADE, 0x7ADE, 0x08E9,
+ 0x7ADF, 0x7ADF, 0x08E8, 0x7AE0, 0x7AE0, 0x1163, 0x7AE1, 0x7AE2, 0x4186,
+ 0x7AE3, 0x7AE3, 0x092F, 0x7AE4, 0x7AE4, 0x4188, 0x7AE5, 0x7AE5, 0x0E60,
+ 0x7AE6, 0x7AE6, 0x1B99, 0x7AE7, 0x7AE9, 0x4189, 0x7AEA, 0x7AEA, 0x2141,
+ 0x7AEB, 0x7AEC, 0x418C, 0x7AED, 0x7AED, 0x08B0, 0x7AEE, 0x7AEE, 0x418E,
+ 0x7AEF, 0x7AEF, 0x060A, 0x7AF0, 0x7AF5, 0x418F, 0x7AF6, 0x7AF6, 0x1FC7,
+ 0x7AF7, 0x7AF8, 0x4195, 0x7AF9, 0x7AF9, 0x11F0, 0x7AFA, 0x7AFA, 0x1C63,
+ 0x7AFB, 0x7AFC, 0x4197, 0x7AFD, 0x7AFD, 0x1C64, 0x7AFE, 0x7AFE, 0x4199,
+ 0x7AFF, 0x7AFF, 0x06C8, 0x7B00, 0x7B02, 0x419A, 0x7B03, 0x7B04, 0x1C66,
+ 0x7B05, 0x7B05, 0x419D, 0x7B06, 0x7B06, 0x03D5, 0x7B07, 0x7B07, 0x419E,
+ 0x7B08, 0x7B08, 0x1C65, 0x7B09, 0x7B09, 0x419F, 0x7B0A, 0x7B0A, 0x1C69,
+ 0x7B0B, 0x7B0B, 0x0DE6, 0x7B0C, 0x7B0E, 0x41A0, 0x7B0F, 0x7B0F, 0x1C6B,
+ 0x7B10, 0x7B10, 0x41A3, 0x7B11, 0x7B11, 0x0F71, 0x7B12, 0x7B13, 0x41A4,
+ 0x7B14, 0x7B14, 0x0433, 0x7B15, 0x7B15, 0x1C68, 0x7B16, 0x7B18, 0x41A6,
+ 0x7B19, 0x7B19, 0x1C6F, 0x7B1A, 0x7B1A, 0x41A9, 0x7B1B, 0x7B1B, 0x05B2,
+ 0x7B1C, 0x7B1D, 0x41AA, 0x7B1E, 0x7B1E, 0x1C77, 0x7B1F, 0x7B1F, 0x41AC,
+ 0x7B20, 0x7B20, 0x1C72, 0x7B21, 0x7B23, 0x41AD, 0x7B24, 0x7B24, 0x1C74,
+ 0x7B25, 0x7B25, 0x1C73, 0x7B26, 0x7B26, 0x0698, 0x7B27, 0x7B27, 0x41B0,
+ 0x7B28, 0x7B28, 0x0428, 0x7B29, 0x7B29, 0x41B1, 0x7B2A, 0x7B2A, 0x1C6E,
+ 0x7B2B, 0x7B2B, 0x1C6A, 0x7B2C, 0x7B2C, 0x05BB, 0x7B2D, 0x7B2D, 0x41B2,
+ 0x7B2E, 0x7B2E, 0x1C70, 0x7B2F, 0x7B30, 0x41B3, 0x7B31, 0x7B31, 0x1C71,
+ 0x7B32, 0x7B32, 0x41B5, 0x7B33, 0x7B33, 0x1C75, 0x7B34, 0x7B37, 0x41B6,
+ 0x7B38, 0x7B38, 0x1C6D, 0x7B39, 0x7B39, 0x41BA, 0x7B3A, 0x7B3A, 0x0856,
+ 0x7B3B, 0x7B3B, 0x41BB, 0x7B3C, 0x7B3C, 0x0A46, 0x7B3D, 0x7B3D, 0x41BC,
+ 0x7B3E, 0x7B3E, 0x1C76, 0x7B3F, 0x7B44, 0x41BD, 0x7B45, 0x7B45, 0x1C7A,
+ 0x7B46, 0x7B46, 0x1E41, 0x7B47, 0x7B47, 0x1C6C, 0x7B48, 0x7B48, 0x41C3,
+ 0x7B49, 0x7B49, 0x05A9, 0x7B4A, 0x7B4A, 0x41C4, 0x7B4B, 0x7B4B, 0x08BF,
+ 0x7B4C, 0x7B4C, 0x1C7C, 0x7B4D, 0x7B4E, 0x41C5, 0x7B4F, 0x7B4F, 0x0641,
+ 0x7B50, 0x7B50, 0x097D, 0x7B51, 0x7B51, 0x11FD, 0x7B52, 0x7B52, 0x0E63,
+ 0x7B53, 0x7B53, 0x41C7, 0x7B54, 0x7B54, 0x0573, 0x7B55, 0x7B55, 0x41C8,
+ 0x7B56, 0x7B56, 0x04A6, 0x7B57, 0x7B57, 0x41C9, 0x7B58, 0x7B58, 0x1C78,
+ 0x7B59, 0x7B59, 0x41CA, 0x7B5A, 0x7B5A, 0x1C79, 0x7B5B, 0x7B5B, 0x0CF1,
+ 0x7B5C, 0x7B5C, 0x41CB, 0x7B5D, 0x7B5D, 0x1C7D, 0x7B5E, 0x7B5F, 0x41CC,
+ 0x7B60, 0x7B60, 0x1C7E, 0x7B61, 0x7B61, 0x41CE, 0x7B62, 0x7B62, 0x1C81,
+ 0x7B63, 0x7B66, 0x41CF, 0x7B67, 0x7B67, 0x25E4, 0x7B68, 0x7B6D, 0x41D3,
+ 0x7B6E, 0x7B6E, 0x1C7F, 0x7B6F, 0x7B70, 0x41D9, 0x7B71, 0x7B71, 0x1C83,
+ 0x7B72, 0x7B72, 0x1C82, 0x7B73, 0x7B74, 0x41DB, 0x7B75, 0x7B75, 0x1C7B,
+ 0x7B76, 0x7B76, 0x41DD, 0x7B77, 0x7B77, 0x0977, 0x7B78, 0x7B78, 0x41DE,
+ 0x7B79, 0x7B79, 0x0514, 0x7B7A, 0x7B7A, 0x41DF, 0x7B7B, 0x7B7B, 0x1C80,
+ 0x7B7C, 0x7B7D, 0x41E0, 0x7B7E, 0x7B7E, 0x0C26, 0x7B7F, 0x7B7F, 0x41E2,
+ 0x7B80, 0x7B80, 0x0865, 0x7B81, 0x7B84, 0x41E3, 0x7B85, 0x7B85, 0x1C8B,
+ 0x7B86, 0x7B8A, 0x41E7, 0x7B8B, 0x7B8B, 0x1F86, 0x7B8C, 0x7B8C, 0x41EC,
+ 0x7B8D, 0x7B8D, 0x0718, 0x7B8E, 0x7B8F, 0x41ED, 0x7B90, 0x7B90, 0x1C84,
+ 0x7B91, 0x7B93, 0x41EF, 0x7B94, 0x7B94, 0x0474, 0x7B95, 0x7B95, 0x0813,
+ 0x7B96, 0x7B96, 0x41F2, 0x7B97, 0x7B97, 0x0DD8, 0x7B98, 0x7B9B, 0x41F3,
+ 0x7B9C, 0x7B9C, 0x1C8D, 0x7B9D, 0x7B9D, 0x1C89, 0x7B9E, 0x7BA0, 0x41F7,
+ 0x7BA1, 0x7BA1, 0x0735, 0x7BA2, 0x7BA2, 0x1C8E, 0x7BA3, 0x7BA5, 0x41FA,
+ 0x7BA6, 0x7BA7, 0x1C85, 0x7BA8, 0x7BA8, 0x1C8A, 0x7BA9, 0x7BA9, 0x0A88,
+ 0x7BAA, 0x7BAA, 0x1C8C, 0x7BAB, 0x7BAB, 0x1C8F, 0x7BAC, 0x7BAC, 0x1C88,
+ 0x7BAD, 0x7BAD, 0x0870, 0x7BAE, 0x7BB0, 0x41FD, 0x7BB1, 0x7BB1, 0x0F51,
+ 0x7BB2, 0x7BB3, 0x4200, 0x7BB4, 0x7BB4, 0x1C90, 0x7BB5, 0x7BB7, 0x4202,
+ 0x7BB8, 0x7BB8, 0x1C87, 0x7BB9, 0x7BBF, 0x4205, 0x7BC0, 0x7BC0, 0x1FB3,
+ 0x7BC1, 0x7BC1, 0x1C92, 0x7BC2, 0x7BC3, 0x420C, 0x7BC4, 0x7BC4, 0x1EEF,
+ 0x7BC5, 0x7BC5, 0x420E, 0x7BC6, 0x7BC6, 0x120A, 0x7BC7, 0x7BC7, 0x0BC9,
+ 0x7BC8, 0x7BC8, 0x420F, 0x7BC9, 0x7BC9, 0x22A4, 0x7BCA, 0x7BCA, 0x4210,
+ 0x7BCB, 0x7BCB, 0x25E8, 0x7BCC, 0x7BCC, 0x1C93, 0x7BCD, 0x7BD0, 0x4211,
+ 0x7BD1, 0x7BD1, 0x1C91, 0x7BD2, 0x7BD2, 0x4215, 0x7BD3, 0x7BD3, 0x0A4F,
+ 0x7BD4, 0x7BD8, 0x4216, 0x7BD9, 0x7BD9, 0x06D8, 0x7BDA, 0x7BDA, 0x1C95,
+ 0x7BDB, 0x7BDC, 0x421B, 0x7BDD, 0x7BDD, 0x1C94, 0x7BDE, 0x7BE0, 0x421D,
+ 0x7BE1, 0x7BE1, 0x055E, 0x7BE2, 0x7BE3, 0x4220, 0x7BE4, 0x7BE4, 0x25E3,
+ 0x7BE5, 0x7BE6, 0x1C96, 0x7BE7, 0x7BE8, 0x4222, 0x7BE9, 0x7BE9, 0x2111,
+ 0x7BEA, 0x7BEA, 0x1C98, 0x7BEB, 0x7BED, 0x4224, 0x7BEE, 0x7BEE, 0x09A5,
+ 0x7BEF, 0x7BF0, 0x4227, 0x7BF1, 0x7BF1, 0x09D4, 0x7BF2, 0x7BF2, 0x4229,
+ 0x7BF3, 0x7BF3, 0x25E6, 0x7BF4, 0x7BF6, 0x422A, 0x7BF7, 0x7BF7, 0x0BB2,
+ 0x7BF8, 0x7BFB, 0x422D, 0x7BFC, 0x7BFC, 0x1C9B, 0x7BFD, 0x7BFD, 0x4231,
+ 0x7BFE, 0x7BFE, 0x1C9A, 0x7BFF, 0x7BFF, 0x4232, 0x7C00, 0x7C00, 0x25E7,
+ 0x7C01, 0x7C06, 0x4233, 0x7C07, 0x7C07, 0x055B, 0x7C08, 0x7C0A, 0x4239,
+ 0x7C0B, 0x7C0B, 0x1C9E, 0x7C0C, 0x7C0C, 0x1C99, 0x7C0D, 0x7C0D, 0x2041,
+ 0x7C0E, 0x7C0E, 0x423C, 0x7C0F, 0x7C0F, 0x1C9C, 0x7C10, 0x7C15, 0x423D,
+ 0x7C16, 0x7C16, 0x1C9D, 0x7C17, 0x7C1D, 0x4243, 0x7C1E, 0x7C1E, 0x25EA,
+ 0x7C1F, 0x7C1F, 0x1C9F, 0x7C20, 0x7C20, 0x424A, 0x7C21, 0x7C21, 0x1F8F,
+ 0x7C22, 0x7C22, 0x424B, 0x7C23, 0x7C23, 0x25EC, 0x7C24, 0x7C25, 0x424C,
+ 0x7C26, 0x7C26, 0x1CA1, 0x7C27, 0x7C27, 0x07DE, 0x7C28, 0x7C29, 0x424E,
+ 0x7C2A, 0x7C2A, 0x1CA0, 0x7C2B, 0x7C2B, 0x25EB, 0x7C2C, 0x7C37, 0x4250,
+ 0x7C38, 0x7C38, 0x1CA2, 0x7C39, 0x7C3C, 0x425C, 0x7C3D, 0x7C3D, 0x20D0,
+ 0x7C3E, 0x7C3E, 0x201D, 0x7C3F, 0x7C3F, 0x0485, 0x7C40, 0x7C40, 0x1CA4,
+ 0x7C41, 0x7C41, 0x1CA3, 0x7C42, 0x7C42, 0x4260, 0x7C43, 0x7C43, 0x1FF7,
+ 0x7C44, 0x7C4B, 0x4261, 0x7C4C, 0x7C4C, 0x1E8D, 0x7C4D, 0x7C4D, 0x0821,
+ 0x7C4E, 0x7C5B, 0x4269, 0x7C5C, 0x7C5C, 0x25E9, 0x7C5D, 0x7C5E, 0x4277,
+ 0x7C5F, 0x7C5F, 0x25EE, 0x7C60, 0x7C60, 0x203A, 0x7C61, 0x7C63, 0x4279,
+ 0x7C64, 0x7C64, 0x2693, 0x7C65, 0x7C68, 0x427C, 0x7C69, 0x7C69, 0x25E5,
+ 0x7C6A, 0x7C6A, 0x25ED, 0x7C6B, 0x7C6B, 0x4280, 0x7C6C, 0x7C6C, 0x2009,
+ 0x7C6D, 0x7C6D, 0x4281, 0x7C6E, 0x7C6E, 0x2065, 0x7C6F, 0x7C71, 0x4282,
+ 0x7C72, 0x7C72, 0x26A3, 0x7C73, 0x7C73, 0x0ADC, 0x7C74, 0x7C74, 0x12F5,
+ 0x7C75, 0x7C7A, 0x4285, 0x7C7B, 0x7C7B, 0x09CB, 0x7C7C, 0x7C7C, 0x1CCA,
+ 0x7C7D, 0x7C7D, 0x122E, 0x7C7E, 0x7C88, 0x428B, 0x7C89, 0x7C89, 0x0678,
+ 0x7C8A, 0x7C90, 0x4296, 0x7C91, 0x7C91, 0x1CCC, 0x7C92, 0x7C92, 0x09EC,
+ 0x7C93, 0x7C94, 0x429D, 0x7C95, 0x7C95, 0x0BE8, 0x7C96, 0x7C96, 0x429F,
+ 0x7C97, 0x7C97, 0x0559, 0x7C98, 0x7C98, 0x1154, 0x7C99, 0x7C9B, 0x42A0,
+ 0x7C9C, 0x7C9C, 0x1CCE, 0x7C9D, 0x7C9D, 0x1CCD, 0x7C9E, 0x7C9E, 0x1CCF,
+ 0x7C9F, 0x7C9F, 0x0DCF, 0x7CA0, 0x7CA1, 0x42A3, 0x7CA2, 0x7CA2, 0x1CD0,
+ 0x7CA3, 0x7CA3, 0x42A5, 0x7CA4, 0x7CA4, 0x1104, 0x7CA5, 0x7CA5, 0x11DF,
+ 0x7CA6, 0x7CA9, 0x42A6, 0x7CAA, 0x7CAA, 0x067D, 0x7CAB, 0x7CAD, 0x42AA,
+ 0x7CAE, 0x7CAE, 0x0A01, 0x7CAF, 0x7CB0, 0x42AD, 0x7CB1, 0x7CB1, 0x0A04,
+ 0x7CB2, 0x7CB2, 0x1CD1, 0x7CB3, 0x7CB3, 0x08DB, 0x7CB4, 0x7CB8, 0x42AF,
+ 0x7CB9, 0x7CB9, 0x0565, 0x7CBA, 0x7CBB, 0x42B4, 0x7CBC, 0x7CBD, 0x1CD2,
+ 0x7CBE, 0x7CBE, 0x08DA, 0x7CBF, 0x7CC0, 0x42B6, 0x7CC1, 0x7CC1, 0x1CD4,
+ 0x7CC2, 0x7CC4, 0x42B8, 0x7CC5, 0x7CC5, 0x1CD9, 0x7CC6, 0x7CC6, 0x42BB,
+ 0x7CC7, 0x7CC7, 0x1CD5, 0x7CC8, 0x7CC8, 0x1CD8, 0x7CC9, 0x7CC9, 0x42BC,
+ 0x7CCA, 0x7CCA, 0x07B4, 0x7CCB, 0x7CCB, 0x42BD, 0x7CCC, 0x7CCD, 0x1CD6,
+ 0x7CCE, 0x7CD4, 0x42BE, 0x7CD5, 0x7CD5, 0x06DD, 0x7CD6, 0x7CD6, 0x0E1A,
+ 0x7CD7, 0x7CD7, 0x1CDA, 0x7CD8, 0x7CD8, 0x42C5, 0x7CD9, 0x7CD9, 0x04A1,
+ 0x7CDA, 0x7CDB, 0x42C6, 0x7CDC, 0x7CDC, 0x0AD8, 0x7CDD, 0x7CDD, 0x25F5,
+ 0x7CDE, 0x7CDE, 0x1EFC, 0x7CDF, 0x7CDF, 0x1126, 0x7CE0, 0x7CE0, 0x0944,
+ 0x7CE1, 0x7CE6, 0x42C8, 0x7CE7, 0x7CE7, 0x2024, 0x7CE8, 0x7CE8, 0x1CDB,
+ 0x7CE9, 0x7CEE, 0x42CE, 0x7CEF, 0x7CEF, 0x0B75, 0x7CF0, 0x7CF0, 0x269B,
+ 0x7CF1, 0x7CF1, 0x42D4, 0x7CF2, 0x7CF2, 0x25F3, 0x7CF3, 0x7CF3, 0x42D5,
+ 0x7CF4, 0x7CF4, 0x22D9, 0x7CF5, 0x7CF5, 0x42D6, 0x7CF6, 0x7CF6, 0x25F4,
+ 0x7CF7, 0x7CF7, 0x42D7, 0x7CF8, 0x7CF8, 0x1CE7, 0x7CF9, 0x7CF9, 0x241B,
+ 0x7CFA, 0x7CFA, 0x42D8, 0x7CFB, 0x7CFB, 0x0F22, 0x7CFC, 0x7CFD, 0x42D9,
+ 0x7CFE, 0x7CFE, 0x1FC8, 0x7CFF, 0x7CFF, 0x42DB, 0x7D00, 0x7D00, 0x1F7B,
+ 0x7D01, 0x7D01, 0x42DC, 0x7D02, 0x7D02, 0x241D, 0x7D03, 0x7D03, 0x42DD,
+ 0x7D04, 0x7D04, 0x224C, 0x7D05, 0x7D05, 0x1F48, 0x7D06, 0x7D06, 0x241C,
+ 0x7D07, 0x7D08, 0x241E, 0x7D09, 0x7D09, 0x20FF, 0x7D0A, 0x7D0A, 0x0ED8,
+ 0x7D0B, 0x7D0B, 0x219A, 0x7D0C, 0x7D0C, 0x42DE, 0x7D0D, 0x7D0D, 0x2091,
+ 0x7D0E, 0x7D0F, 0x42DF, 0x7D10, 0x7D10, 0x20A7, 0x7D11, 0x7D12, 0x42E1,
+ 0x7D13, 0x7D13, 0x2423, 0x7D14, 0x7D14, 0x1E9B, 0x7D15, 0x7D15, 0x2422,
+ 0x7D16, 0x7D16, 0x42E3, 0x7D17, 0x7D17, 0x2110, 0x7D18, 0x7D18, 0x42E4,
+ 0x7D19, 0x7D19, 0x228D, 0x7D1A, 0x7D1A, 0x1F71, 0x7D1B, 0x7D1B, 0x1EF8,
+ 0x7D1C, 0x7D1C, 0x2421, 0x7D1D, 0x7D1F, 0x42E5, 0x7D20, 0x7D20, 0x0DCD,
+ 0x7D21, 0x7D21, 0x1EF3, 0x7D22, 0x7D22, 0x0DEC, 0x7D23, 0x7D26, 0x42E8,
+ 0x7D27, 0x7D27, 0x08C5, 0x7D28, 0x7D2A, 0x42EC, 0x7D2B, 0x7D2B, 0x122C,
+ 0x7D2C, 0x7D2E, 0x42EF, 0x7D2F, 0x7D2F, 0x09C6, 0x7D30, 0x7D30, 0x21B1,
+ 0x7D31, 0x7D31, 0x2426, 0x7D32, 0x7D32, 0x2425, 0x7D33, 0x7D33, 0x2120,
+ 0x7D34, 0x7D38, 0x42F2, 0x7D39, 0x7D39, 0x211A, 0x7D3A, 0x7D3A, 0x2424,
+ 0x7D3B, 0x7D3B, 0x42F7, 0x7D3C, 0x7D3C, 0x2428, 0x7D3D, 0x7D3E, 0x42F8,
+ 0x7D3F, 0x7D3F, 0x242A, 0x7D40, 0x7D40, 0x2429, 0x7D41, 0x7D41, 0x42FA,
+ 0x7D42, 0x7D42, 0x2294, 0x7D43, 0x7D43, 0x42FB, 0x7D44, 0x7D44, 0x22BE,
+ 0x7D45, 0x7D45, 0x42FC, 0x7D46, 0x7D46, 0x1E31, 0x7D47, 0x7D4D, 0x42FD,
+ 0x7D4E, 0x7D4E, 0x242C, 0x7D4F, 0x7D4F, 0x4304, 0x7D50, 0x7D50, 0x1FB5,
+ 0x7D51, 0x7D5C, 0x4305, 0x7D5D, 0x7D5D, 0x242B, 0x7D5E, 0x7D5E, 0x1FAF,
+ 0x7D5F, 0x7D60, 0x4311, 0x7D61, 0x7D61, 0x2068, 0x7D62, 0x7D62, 0x21E4,
+ 0x7D63, 0x7D65, 0x4313, 0x7D66, 0x7D66, 0x1F21, 0x7D67, 0x7D67, 0x4316,
+ 0x7D68, 0x7D68, 0x2101, 0x7D69, 0x7D6D, 0x4317, 0x7D6E, 0x7D6E, 0x0FC0,
+ 0x7D6F, 0x7D70, 0x431C, 0x7D71, 0x7D71, 0x217C, 0x7D72, 0x7D72, 0x214A,
+ 0x7D73, 0x7D73, 0x242D, 0x7D74, 0x7D75, 0x431E, 0x7D76, 0x7D76, 0x1FD4,
+ 0x7D77, 0x7D77, 0x1CE8, 0x7D78, 0x7D78, 0x4320, 0x7D79, 0x7D79, 0x1FD1,
+ 0x7D7A, 0x7D80, 0x4321, 0x7D81, 0x7D81, 0x1E33, 0x7D82, 0x7D82, 0x4328,
+ 0x7D83, 0x7D83, 0x242F, 0x7D84, 0x7D85, 0x4329, 0x7D86, 0x7D86, 0x242E,
+ 0x7D87, 0x7D87, 0x432B, 0x7D88, 0x7D88, 0x2430, 0x7D89, 0x7D89, 0x21DB,
+ 0x7D8A, 0x7D8E, 0x432C, 0x7D8F, 0x7D8F, 0x2158, 0x7D90, 0x7D92, 0x4331,
+ 0x7D93, 0x7D93, 0x1FC2, 0x7D94, 0x7D9B, 0x4334, 0x7D9C, 0x7D9C, 0x22B9,
+ 0x7D9D, 0x7D9D, 0x433C, 0x7D9E, 0x7D9E, 0x2436, 0x7D9F, 0x7DA1, 0x433D,
+ 0x7DA2, 0x7DA2, 0x1E8E, 0x7DA3, 0x7DA3, 0x2439, 0x7DA4, 0x7DA5, 0x4340,
+ 0x7DA6, 0x7DA6, 0x1CE9, 0x7DA7, 0x7DAA, 0x4342, 0x7DAB, 0x7DAB, 0x21C5,
+ 0x7DAC, 0x7DAC, 0x2437, 0x7DAD, 0x7DAD, 0x2192, 0x7DAE, 0x7DAE, 0x1CEA,
+ 0x7DAF, 0x7DAF, 0x4346, 0x7DB0, 0x7DB0, 0x243A, 0x7DB1, 0x7DB1, 0x1F19,
+ 0x7DB2, 0x7DB2, 0x218C, 0x7DB3, 0x7DB3, 0x1E40, 0x7DB4, 0x7DB4, 0x22B3,
+ 0x7DB5, 0x7DB7, 0x4347, 0x7DB8, 0x7DB8, 0x205F, 0x7DB9, 0x7DB9, 0x2438,
+ 0x7DBA, 0x7DBA, 0x2432, 0x7DBB, 0x7DBB, 0x2274, 0x7DBC, 0x7DBC, 0x434A,
+ 0x7DBD, 0x7DBD, 0x1E9C, 0x7DBE, 0x7DBE, 0x2431, 0x7DBF, 0x7DBF, 0x2085,
+ 0x7DC0, 0x7DC3, 0x434B, 0x7DC4, 0x7DC4, 0x2435, 0x7DC5, 0x7DC6, 0x434F,
+ 0x7DC7, 0x7DC7, 0x243B, 0x7DC8, 0x7DC9, 0x4351, 0x7DCA, 0x7DCA, 0x1FB7,
+ 0x7DCB, 0x7DCB, 0x2433, 0x7DCC, 0x7DD0, 0x4353, 0x7DD1, 0x7DD1, 0x2054,
+ 0x7DD2, 0x7DD2, 0x21DE, 0x7DD3, 0x7DD3, 0x4358, 0x7DD4, 0x7DD4, 0x2434,
+ 0x7DD5, 0x7DD6, 0x4359, 0x7DD7, 0x7DD7, 0x243D, 0x7DD8, 0x7DD8, 0x1F89,
+ 0x7DD9, 0x7DD9, 0x243C, 0x7DDA, 0x7DDC, 0x435B, 0x7DDD, 0x7DDD, 0x1F6E,
+ 0x7DDE, 0x7DDE, 0x1ED8, 0x7DDF, 0x7DDF, 0x435E, 0x7DE0, 0x7DE0, 0x1EBF,
+ 0x7DE1, 0x7DE1, 0x2445, 0x7DE2, 0x7DE2, 0x435F, 0x7DE3, 0x7DE3, 0x2249,
+ 0x7DE4, 0x7DE5, 0x4360, 0x7DE6, 0x7DE6, 0x2441, 0x7DE7, 0x7DE7, 0x4362,
+ 0x7DE8, 0x7DE8, 0x1E47, 0x7DE9, 0x7DE9, 0x1F56, 0x7DEA, 0x7DEB, 0x4363,
+ 0x7DEC, 0x7DEC, 0x2086, 0x7DED, 0x7DEE, 0x4365, 0x7DEF, 0x7DEF, 0x2196,
+ 0x7DF0, 0x7DF0, 0x4367, 0x7DF1, 0x7DF1, 0x2443, 0x7DF2, 0x7DF2, 0x243F,
+ 0x7DF3, 0x7DF3, 0x4368, 0x7DF4, 0x7DF4, 0x2023, 0x7DF5, 0x7DF5, 0x4369,
+ 0x7DF6, 0x7DF6, 0x2442, 0x7DF7, 0x7DF8, 0x436A, 0x7DF9, 0x7DF9, 0x243E,
+ 0x7DFA, 0x7DFA, 0x436C, 0x7DFB, 0x7DFB, 0x26A6, 0x7DFC, 0x7DFF, 0x436D,
+ 0x7E00, 0x7E07, 0x4371, 0x7E08, 0x7E08, 0x234E, 0x7E09, 0x7E09, 0x2446,
+ 0x7E0A, 0x7E0A, 0x244B, 0x7E0B, 0x7E0B, 0x2444, 0x7E0C, 0x7E0F, 0x4379,
+ 0x7E10, 0x7E10, 0x2427, 0x7E11, 0x7E11, 0x244C, 0x7E12, 0x7E1A, 0x437D,
+ 0x7E1B, 0x7E1B, 0x1F0F, 0x7E1C, 0x7E1C, 0x4386, 0x7E1D, 0x7E1D, 0x2447,
+ 0x7E1E, 0x7E1E, 0x2449, 0x7E1F, 0x7E1F, 0x2448, 0x7E20, 0x7E22, 0x4387,
+ 0x7E23, 0x7E23, 0x21C2, 0x7E24, 0x7E26, 0x438A, 0x7E27, 0x7E27, 0x216E,
+ 0x7E28, 0x7E2A, 0x438D, 0x7E2B, 0x7E2B, 0x1F03, 0x7E2C, 0x7E2C, 0x4390,
+ 0x7E2D, 0x7E2D, 0x244A, 0x7E2E, 0x7E2E, 0x215C, 0x7E2F, 0x7E30, 0x4391,
+ 0x7E31, 0x7E31, 0x22BB, 0x7E32, 0x7E32, 0x2450, 0x7E33, 0x7E33, 0x4393,
+ 0x7E34, 0x7E34, 0x2694, 0x7E35, 0x7E35, 0x244F, 0x7E36, 0x7E36, 0x25F6,
+ 0x7E37, 0x7E37, 0x2051, 0x7E38, 0x7E38, 0x4394, 0x7E39, 0x7E39, 0x244E,
+ 0x7E3A, 0x7E3A, 0x4395, 0x7E3B, 0x7E3B, 0x1DFB, 0x7E3C, 0x7E3C, 0x4396,
+ 0x7E3D, 0x7E3D, 0x22BA, 0x7E3E, 0x7E3E, 0x1F6D, 0x7E3F, 0x7E40, 0x4397,
+ 0x7E41, 0x7E41, 0x064E, 0x7E42, 0x7E44, 0x4399, 0x7E45, 0x7E45, 0x2452,
+ 0x7E46, 0x7E46, 0x2451, 0x7E47, 0x7E47, 0x1CEB, 0x7E48, 0x7E51, 0x439C,
+ 0x7E52, 0x7E52, 0x2455, 0x7E53, 0x7E53, 0x43A6, 0x7E54, 0x7E54, 0x2289,
+ 0x7E55, 0x7E55, 0x2116, 0x7E56, 0x7E59, 0x43A7, 0x7E5A, 0x7E5A, 0x2454,
+ 0x7E5B, 0x7E5D, 0x43AB, 0x7E5E, 0x7E5E, 0x20FB, 0x7E5F, 0x7E61, 0x43AE,
+ 0x7E62, 0x7E62, 0x2440, 0x7E63, 0x7E68, 0x43B1, 0x7E69, 0x7E69, 0x2126,
+ 0x7E6A, 0x7E6A, 0x1F61, 0x7E6B, 0x7E6B, 0x269D, 0x7E6C, 0x7E6C, 0x43B7,
+ 0x7E6D, 0x7E6D, 0x1F8A, 0x7E6E, 0x7E6E, 0x2456, 0x7E6F, 0x7E6F, 0x2459,
+ 0x7E70, 0x7E70, 0x2458, 0x7E71, 0x7E72, 0x43B8, 0x7E73, 0x7E73, 0x1FAE,
+ 0x7E74, 0x7E78, 0x43BA, 0x7E79, 0x7E79, 0x221A, 0x7E7A, 0x7E7B, 0x43BF,
+ 0x7E7C, 0x7E7C, 0x1F7A, 0x7E7D, 0x7E7D, 0x244D, 0x7E7E, 0x7E7E, 0x2457,
+ 0x7E7F, 0x7E81, 0x43C1, 0x7E82, 0x7E82, 0x1248, 0x7E83, 0x7E87, 0x43C4,
+ 0x7E88, 0x7E88, 0x2453, 0x7E89, 0x7E89, 0x43C9, 0x7E8A, 0x7E8A, 0x2420,
+ 0x7E8B, 0x7E8B, 0x43CA, 0x7E8C, 0x7E8C, 0x21DF, 0x7E8D, 0x7E8D, 0x2685,
+ 0x7E8E, 0x7E8E, 0x43CB, 0x7E8F, 0x7E8F, 0x1E6E, 0x7E90, 0x7E92, 0x43CC,
+ 0x7E93, 0x7E93, 0x2224, 0x7E94, 0x7E94, 0x2670, 0x7E95, 0x7E95, 0x43CF,
+ 0x7E96, 0x7E96, 0x21BA, 0x7E97, 0x7E97, 0x43D0, 0x7E98, 0x7E98, 0x245A,
+ 0x7E99, 0x7E9A, 0x43D1, 0x7E9B, 0x7E9B, 0x1CEC, 0x7E9C, 0x7E9C, 0x1FFF,
+ 0x7E9D, 0x7E9E, 0x43D3, 0x7E9F, 0x7E9F, 0x17D3, 0x7EA0, 0x7EA0, 0x08EF,
+ 0x7EA1, 0x7EA1, 0x17D4, 0x7EA2, 0x7EA2, 0x07A3, 0x7EA3, 0x7EA3, 0x17D5,
+ 0x7EA4, 0x7EA4, 0x0F38, 0x7EA5, 0x7EA5, 0x17D6, 0x7EA6, 0x7EA6, 0x10FF,
+ 0x7EA7, 0x7EA7, 0x0829, 0x7EA8, 0x7EA9, 0x17D7, 0x7EAA, 0x7EAA, 0x0840,
+ 0x7EAB, 0x7EAB, 0x0CAD, 0x7EAC, 0x7EAC, 0x0EC2, 0x7EAD, 0x7EAD, 0x17D9,
+ 0x7EAE, 0x7EAE, 0x43D5, 0x7EAF, 0x7EAF, 0x0542, 0x7EB0, 0x7EB0, 0x17DA,
+ 0x7EB1, 0x7EB1, 0x0CED, 0x7EB2, 0x7EB2, 0x06D4, 0x7EB3, 0x7EB3, 0x0B2C,
+ 0x7EB4, 0x7EB4, 0x43D6, 0x7EB5, 0x7EB5, 0x123A, 0x7EB6, 0x7EB6, 0x0A81,
+ 0x7EB7, 0x7EB7, 0x0674, 0x7EB8, 0x7EB8, 0x11BC, 0x7EB9, 0x7EB9, 0x0ED5,
+ 0x7EBA, 0x7EBA, 0x0661, 0x7EBB, 0x7EBC, 0x43D7, 0x7EBD, 0x7EBD, 0x0B67,
+ 0x7EBE, 0x7EBE, 0x17DB, 0x7EBF, 0x7EBF, 0x0F4C, 0x7EC0, 0x7EC2, 0x17DC,
+ 0x7EC3, 0x7EC3, 0x0A00, 0x7EC4, 0x7EC4, 0x1246, 0x7EC5, 0x7EC5, 0x0D29,
+ 0x7EC6, 0x7EC6, 0x0F25, 0x7EC7, 0x7EC7, 0x11AE, 0x7EC8, 0x7EC8, 0x11D4,
+ 0x7EC9, 0x7EC9, 0x17DF, 0x7ECA, 0x7ECA, 0x03F8, 0x7ECB, 0x7ECC, 0x17E0,
+ 0x7ECD, 0x7ECD, 0x0D15, 0x7ECE, 0x7ECE, 0x1076, 0x7ECF, 0x7ECF, 0x08DC,
+ 0x7ED0, 0x7ED0, 0x17E2, 0x7ED1, 0x7ED1, 0x03FE, 0x7ED2, 0x7ED2, 0x0CB9,
+ 0x7ED3, 0x7ED3, 0x08B2, 0x7ED4, 0x7ED4, 0x17E3, 0x7ED5, 0x7ED5, 0x0CA1,
+ 0x7ED6, 0x7ED6, 0x43D9, 0x7ED7, 0x7ED7, 0x17E4, 0x7ED8, 0x7ED8, 0x07FB,
+ 0x7ED9, 0x7ED9, 0x06F3, 0x7EDA, 0x7EDA, 0x0FCD, 0x7EDB, 0x7EDB, 0x17E5,
+ 0x7EDC, 0x7EDC, 0x0A8E, 0x7EDD, 0x7EDD, 0x0927, 0x7EDE, 0x7EDE, 0x089B,
+ 0x7EDF, 0x7EDF, 0x0E64, 0x7EE0, 0x7EE1, 0x17E6, 0x7EE2, 0x7EE2, 0x091D,
+ 0x7EE3, 0x7EE3, 0x0FB0, 0x7EE4, 0x7EE4, 0x43DA, 0x7EE5, 0x7EE5, 0x0DDC,
+ 0x7EE6, 0x7EE6, 0x0E23, 0x7EE7, 0x7EE7, 0x083F, 0x7EE8, 0x7EE8, 0x17E8,
+ 0x7EE9, 0x7EE9, 0x081B, 0x7EEA, 0x7EEA, 0x0FC2, 0x7EEB, 0x7EEB, 0x17E9,
+ 0x7EEC, 0x7EEC, 0x43DB, 0x7EED, 0x7EED, 0x0FC3, 0x7EEE, 0x7EEF, 0x17EA,
+ 0x7EF0, 0x7EF0, 0x0545, 0x7EF1, 0x7EF2, 0x17EC, 0x7EF3, 0x7EF3, 0x0D37,
+ 0x7EF4, 0x7EF4, 0x0EBB, 0x7EF5, 0x7EF5, 0x0AE5, 0x7EF6, 0x7EF6, 0x17EF,
+ 0x7EF7, 0x7EF7, 0x042A, 0x7EF8, 0x7EF8, 0x0516, 0x7EF9, 0x7EF9, 0x43DC,
+ 0x7EFA, 0x7EFB, 0x17F0, 0x7EFC, 0x7EFC, 0x1238, 0x7EFD, 0x7EFD, 0x1161,
+ 0x7EFE, 0x7EFE, 0x17F2, 0x7EFF, 0x7EFF, 0x0A73, 0x7F00, 0x7F00, 0x1217,
+ 0x7F01, 0x7F03, 0x17F3, 0x7F04, 0x7F04, 0x085D, 0x7F05, 0x7F05, 0x0AEA,
+ 0x7F06, 0x7F06, 0x09AD, 0x7F07, 0x7F08, 0x17F6, 0x7F09, 0x7F09, 0x081C,
+ 0x7F0A, 0x7F0A, 0x43DD, 0x7F0B, 0x7F0C, 0x17F8, 0x7F0D, 0x7F0D, 0x17EE,
+ 0x7F0E, 0x7F0E, 0x060F, 0x7F0F, 0x7F0F, 0x17FA, 0x7F10, 0x7F10, 0x43DE,
+ 0x7F11, 0x7F12, 0x17FB, 0x7F13, 0x7F13, 0x07CF, 0x7F14, 0x7F14, 0x05BF,
+ 0x7F15, 0x7F15, 0x0A6D, 0x7F16, 0x7F16, 0x0449, 0x7F17, 0x7F17, 0x17FD,
+ 0x7F18, 0x7F18, 0x10F8, 0x7F19, 0x7F19, 0x17FE, 0x7F1A, 0x7F1A, 0x06BA,
+ 0x7F1B, 0x7F1B, 0x1800, 0x7F1C, 0x7F1C, 0x17FF, 0x7F1D, 0x7F1D, 0x0689,
+ 0x7F1E, 0x7F1E, 0x43DF, 0x7F1F, 0x7F1F, 0x1801, 0x7F20, 0x7F20, 0x04BF,
+ 0x7F21, 0x7F27, 0x1802, 0x7F28, 0x7F28, 0x108C, 0x7F29, 0x7F29, 0x0DEA,
+ 0x7F2A, 0x7F2D, 0x1809, 0x7F2E, 0x7F2E, 0x0D02, 0x7F2F, 0x7F33, 0x180D,
+ 0x7F34, 0x7F34, 0x089A, 0x7F35, 0x7F35, 0x1812, 0x7F36, 0x7F36, 0x1C5E,
+ 0x7F37, 0x7F37, 0x43E0, 0x7F38, 0x7F38, 0x06D2, 0x7F39, 0x7F39, 0x43E1,
+ 0x7F3A, 0x7F3A, 0x0C8C, 0x7F3B, 0x7F41, 0x43E2, 0x7F42, 0x7F42, 0x1C5F,
+ 0x7F43, 0x7F43, 0x43E9, 0x7F44, 0x7F45, 0x1C60, 0x7F46, 0x7F4B, 0x43EA,
+ 0x7F4C, 0x7F4C, 0x25E2, 0x7F4D, 0x7F4D, 0x43F0, 0x7F4E, 0x7F4E, 0x269A,
+ 0x7F4F, 0x7F4F, 0x43F1, 0x7F50, 0x7F50, 0x0737, 0x7F51, 0x7F51, 0x0EA9,
+ 0x7F52, 0x7F53, 0x43F2, 0x7F54, 0x7F54, 0x129E, 0x7F55, 0x7F55, 0x0768,
+ 0x7F56, 0x7F56, 0x43F4, 0x7F57, 0x7F57, 0x0A85, 0x7F58, 0x7F58, 0x1A81,
+ 0x7F59, 0x7F59, 0x43F5, 0x7F5A, 0x7F5A, 0x0640, 0x7F5B, 0x7F5E, 0x43F6,
+ 0x7F5F, 0x7F5F, 0x1A83, 0x7F60, 0x7F60, 0x43FA, 0x7F61, 0x7F61, 0x1A82,
+ 0x7F62, 0x7F62, 0x03E0, 0x7F63, 0x7F67, 0x43FB, 0x7F68, 0x7F68, 0x1A85,
+ 0x7F69, 0x7F69, 0x1177, 0x7F6A, 0x7F6A, 0x124C, 0x7F6B, 0x7F6D, 0x4400,
+ 0x7F6E, 0x7F6E, 0x11C2, 0x7F6F, 0x7F6F, 0x4403, 0x7F70, 0x7F70, 0x1EEA,
+ 0x7F71, 0x7F71, 0x1A87, 0x7F72, 0x7F72, 0x0D87, 0x7F73, 0x7F73, 0x4404,
+ 0x7F74, 0x7F74, 0x1A86, 0x7F75, 0x7F76, 0x4405, 0x7F77, 0x7F77, 0x1E2C,
+ 0x7F78, 0x7F78, 0x4407, 0x7F79, 0x7F79, 0x1A88, 0x7F7A, 0x7F7D, 0x4408,
+ 0x7F7E, 0x7F7E, 0x1A8A, 0x7F7F, 0x7F80, 0x440C, 0x7F81, 0x7F81, 0x1A89,
+ 0x7F82, 0x7F84, 0x440E, 0x7F85, 0x7F85, 0x2062, 0x7F86, 0x7F86, 0x24F1,
+ 0x7F87, 0x7F87, 0x4411, 0x7F88, 0x7F88, 0x24F2, 0x7F89, 0x7F89, 0x4412,
+ 0x7F8A, 0x7F8A, 0x101B, 0x7F8B, 0x7F8B, 0x4413, 0x7F8C, 0x7F8C, 0x0C39,
+ 0x7F8D, 0x7F8D, 0x4414, 0x7F8E, 0x7F8E, 0x0AC5, 0x7F8F, 0x7F93, 0x4415,
+ 0x7F94, 0x7F94, 0x06DC, 0x7F95, 0x7F99, 0x441A, 0x7F9A, 0x7F9A, 0x0A30,
+ 0x7F9B, 0x7F9C, 0x441F, 0x7F9D, 0x7F9D, 0x1CC4, 0x7F9E, 0x7F9E, 0x0FAA,
+ 0x7F9F, 0x7F9F, 0x1CC5, 0x7FA0, 0x7FA0, 0x4421, 0x7FA1, 0x7FA1, 0x0F48,
+ 0x7FA2, 0x7FA3, 0x4422, 0x7FA4, 0x7FA4, 0x0C95, 0x7FA5, 0x7FA5, 0x25F2,
+ 0x7FA6, 0x7FA6, 0x4424, 0x7FA7, 0x7FA7, 0x1CC6, 0x7FA8, 0x7FA8, 0x4425,
+ 0x7FA9, 0x7FA9, 0x2215, 0x7FAA, 0x7FAE, 0x4426, 0x7FAF, 0x7FB0, 0x1CC7,
+ 0x7FB1, 0x7FB1, 0x442B, 0x7FB2, 0x7FB2, 0x1CC9, 0x7FB3, 0x7FB7, 0x442C,
+ 0x7FB8, 0x7FB8, 0x130E, 0x7FB9, 0x7FB9, 0x06F9, 0x7FBA, 0x7FBB, 0x4431,
+ 0x7FBC, 0x7FBC, 0x176D, 0x7FBD, 0x7FBD, 0x10D5, 0x7FBE, 0x7FBE, 0x4433,
+ 0x7FBF, 0x7FBF, 0x1CDE, 0x7FC0, 0x7FC0, 0x4434, 0x7FC1, 0x7FC1, 0x0EDB,
+ 0x7FC2, 0x7FC4, 0x4435, 0x7FC5, 0x7FC5, 0x0506, 0x7FC6, 0x7FC9, 0x4438,
+ 0x7FCA, 0x7FCA, 0x1B98, 0x7FCB, 0x7FCB, 0x443C, 0x7FCC, 0x7FCC, 0x1075,
+ 0x7FCD, 0x7FCD, 0x443D, 0x7FCE, 0x7FCE, 0x1CDF, 0x7FCF, 0x7FD1, 0x443E,
+ 0x7FD2, 0x7FD2, 0x21AE, 0x7FD3, 0x7FD3, 0x4441, 0x7FD4, 0x7FD4, 0x0F55,
+ 0x7FD5, 0x7FD5, 0x1CE0, 0x7FD6, 0x7FD7, 0x4442, 0x7FD8, 0x7FD8, 0x0C49,
+ 0x7FD9, 0x7FDE, 0x4444, 0x7FDF, 0x7FDF, 0x05B5, 0x7FE0, 0x7FE0, 0x0567,
+ 0x7FE1, 0x7FE1, 0x1CE2, 0x7FE2, 0x7FE4, 0x444A, 0x7FE5, 0x7FE5, 0x1CE1,
+ 0x7FE6, 0x7FE6, 0x1CE3, 0x7FE7, 0x7FE8, 0x444D, 0x7FE9, 0x7FE9, 0x1CE4,
+ 0x7FEA, 0x7FED, 0x444F, 0x7FEE, 0x7FEE, 0x1CE5, 0x7FEF, 0x7FEF, 0x4453,
+ 0x7FF0, 0x7FF0, 0x0769, 0x7FF1, 0x7FF1, 0x03CA, 0x7FF2, 0x7FF2, 0x4454,
+ 0x7FF3, 0x7FF3, 0x1CE6, 0x7FF4, 0x7FF8, 0x4455, 0x7FF9, 0x7FF9, 0x20E0,
+ 0x7FFA, 0x7FFA, 0x445A, 0x7FFB, 0x7FFB, 0x064A, 0x7FFC, 0x7FFC, 0x1074,
+ 0x7FFD, 0x7FFF, 0x445B, 0x8000, 0x8000, 0x1032, 0x8001, 0x8001, 0x09BA,
+ 0x8002, 0x8002, 0x445E, 0x8003, 0x8003, 0x0949, 0x8004, 0x8004, 0x1953,
+ 0x8005, 0x8005, 0x1180, 0x8006, 0x8006, 0x191A, 0x8007, 0x800A, 0x445F,
+ 0x800B, 0x800B, 0x1BD7, 0x800C, 0x800C, 0x0637, 0x800D, 0x800D, 0x0D98,
+ 0x800E, 0x800F, 0x4463, 0x8010, 0x8010, 0x0B30, 0x8011, 0x8011, 0x4465,
+ 0x8012, 0x8012, 0x1BCB, 0x8013, 0x8013, 0x4466, 0x8014, 0x8014, 0x1BCC,
+ 0x8015, 0x8015, 0x06F6, 0x8016, 0x8016, 0x1BCD, 0x8017, 0x8017, 0x077B,
+ 0x8018, 0x8018, 0x1108, 0x8019, 0x8019, 0x03DD, 0x801A, 0x801B, 0x4467,
+ 0x801C, 0x801C, 0x1BCE, 0x801D, 0x801F, 0x4469, 0x8020, 0x8020, 0x1BCF,
+ 0x8021, 0x8021, 0x446C, 0x8022, 0x8022, 0x1BD0, 0x8023, 0x8024, 0x446D,
+ 0x8025, 0x8027, 0x1BD1, 0x8028, 0x8028, 0x1BD5, 0x8029, 0x8029, 0x1BD4,
+ 0x802A, 0x802A, 0x0B96, 0x802B, 0x802B, 0x446F, 0x802C, 0x802C, 0x25C2,
+ 0x802D, 0x802D, 0x4470, 0x802E, 0x802E, 0x25C1, 0x802F, 0x8030, 0x4471,
+ 0x8031, 0x8031, 0x1BD6, 0x8032, 0x8032, 0x4473, 0x8033, 0x8033, 0x0639,
+ 0x8034, 0x8034, 0x4474, 0x8035, 0x8035, 0x1BD8, 0x8036, 0x8036, 0x1035,
+ 0x8037, 0x8037, 0x14B1, 0x8038, 0x8038, 0x0DBF, 0x8039, 0x803A, 0x4475,
+ 0x803B, 0x803B, 0x0501, 0x803C, 0x803C, 0x4477, 0x803D, 0x803D, 0x0583,
+ 0x803E, 0x803E, 0x4478, 0x803F, 0x803F, 0x06FB, 0x8040, 0x8041, 0x4479,
+ 0x8042, 0x8042, 0x0B57, 0x8043, 0x8043, 0x1BD9, 0x8044, 0x8045, 0x447B,
+ 0x8046, 0x8046, 0x1BDA, 0x8047, 0x8049, 0x447D, 0x804A, 0x804A, 0x0A0D,
+ 0x804B, 0x804B, 0x0A44, 0x804C, 0x804C, 0x11AF, 0x804D, 0x804D, 0x1BDB,
+ 0x804E, 0x8051, 0x4480, 0x8052, 0x8052, 0x1BDC, 0x8053, 0x8053, 0x4484,
+ 0x8054, 0x8054, 0x09F3, 0x8055, 0x8055, 0x4485, 0x8056, 0x8056, 0x2128,
+ 0x8057, 0x8057, 0x4486, 0x8058, 0x8058, 0x0BD7, 0x8059, 0x8059, 0x4487,
+ 0x805A, 0x805A, 0x090A, 0x805B, 0x805D, 0x4488, 0x805E, 0x805E, 0x2199,
+ 0x805F, 0x8068, 0x448B, 0x8069, 0x8069, 0x1BDD, 0x806A, 0x806A, 0x0552,
+ 0x806B, 0x806E, 0x4495, 0x806F, 0x806F, 0x2017, 0x8070, 0x8070, 0x1EA0,
+ 0x8071, 0x8071, 0x1BDE, 0x8072, 0x8072, 0x2125, 0x8073, 0x8073, 0x214D,
+ 0x8074, 0x8074, 0x4499, 0x8075, 0x8075, 0x25C4, 0x8076, 0x8076, 0x209D,
+ 0x8077, 0x8077, 0x228A, 0x8078, 0x8078, 0x449A, 0x8079, 0x8079, 0x25C3,
+ 0x807A, 0x807C, 0x449B, 0x807D, 0x807D, 0x2179, 0x807E, 0x807E, 0x2038,
+ 0x807F, 0x807F, 0x1A1E, 0x8080, 0x8080, 0x1A1D, 0x8081, 0x8082, 0x449E,
+ 0x8083, 0x8083, 0x0DD5, 0x8084, 0x8084, 0x1065, 0x8085, 0x8085, 0x2155,
+ 0x8086, 0x8086, 0x0DB6, 0x8087, 0x8087, 0x1179, 0x8088, 0x8088, 0x44A0,
+ 0x8089, 0x8089, 0x0CBD, 0x808A, 0x808A, 0x44A1, 0x808B, 0x808B, 0x09CA,
+ 0x808C, 0x808C, 0x0814, 0x808D, 0x8092, 0x44A2, 0x8093, 0x8093, 0x1971,
+ 0x8094, 0x8095, 0x44A8, 0x8096, 0x8096, 0x0F6F, 0x8097, 0x8097, 0x44AA,
+ 0x8098, 0x8098, 0x11E1, 0x8099, 0x8099, 0x44AB, 0x809A, 0x809A, 0x0606,
+ 0x809B, 0x809B, 0x06D3, 0x809C, 0x809C, 0x1970, 0x809D, 0x809D, 0x06C9,
+ 0x809E, 0x809E, 0x44AC, 0x809F, 0x809F, 0x196F, 0x80A0, 0x80A0, 0x04CB,
+ 0x80A1, 0x80A1, 0x0722, 0x80A2, 0x80A2, 0x11AA, 0x80A3, 0x80A3, 0x44AD,
+ 0x80A4, 0x80A4, 0x0691, 0x80A5, 0x80A5, 0x0667, 0x80A6, 0x80A8, 0x44AE,
+ 0x80A9, 0x80A9, 0x085A, 0x80AA, 0x80AA, 0x065B, 0x80AB, 0x80AB, 0x1976,
+ 0x80AC, 0x80AC, 0x44B1, 0x80AD, 0x80AD, 0x1977, 0x80AE, 0x80AE, 0x03C4,
+ 0x80AF, 0x80AF, 0x095C, 0x80B0, 0x80B0, 0x44B2, 0x80B1, 0x80B1, 0x1975,
+ 0x80B2, 0x80B2, 0x10E2, 0x80B3, 0x80B3, 0x44B3, 0x80B4, 0x80B4, 0x1978,
+ 0x80B5, 0x80B6, 0x44B4, 0x80B7, 0x80B7, 0x1979, 0x80B8, 0x80B9, 0x44B6,
+ 0x80BA, 0x80BA, 0x066B, 0x80BB, 0x80BB, 0x44B8, 0x80BC, 0x80BC, 0x1972,
+ 0x80BD, 0x80BD, 0x1974, 0x80BE, 0x80BE, 0x0D2F, 0x80BF, 0x80BF, 0x11D6,
+ 0x80C0, 0x80C0, 0x116E, 0x80C1, 0x80C1, 0x0F7D, 0x80C2, 0x80C2, 0x197F,
+ 0x80C3, 0x80C3, 0x0EC7, 0x80C4, 0x80C4, 0x1980, 0x80C5, 0x80C5, 0x44B9,
+ 0x80C6, 0x80C6, 0x0589, 0x80C7, 0x80CB, 0x44BA, 0x80CC, 0x80CC, 0x041C,
+ 0x80CD, 0x80CD, 0x1982, 0x80CE, 0x80CE, 0x0DF8, 0x80CF, 0x80D5, 0x44BF,
+ 0x80D6, 0x80D6, 0x0B97, 0x80D7, 0x80D7, 0x1983, 0x80D8, 0x80D8, 0x44C6,
+ 0x80D9, 0x80D9, 0x1981, 0x80DA, 0x80DA, 0x0BA0, 0x80DB, 0x80DB, 0x197E,
+ 0x80DC, 0x80DC, 0x0D3B, 0x80DD, 0x80DD, 0x1985, 0x80DE, 0x80DE, 0x0406,
+ 0x80DF, 0x80E0, 0x44C7, 0x80E1, 0x80E1, 0x07B1, 0x80E2, 0x80E3, 0x44C9,
+ 0x80E4, 0x80E4, 0x126D, 0x80E5, 0x80E5, 0x1BC7, 0x80E6, 0x80E6, 0x44CB,
+ 0x80E7, 0x80EA, 0x197A, 0x80EB, 0x80EB, 0x1986, 0x80EC, 0x80EC, 0x179A,
+ 0x80ED, 0x80ED, 0x1989, 0x80EE, 0x80EE, 0x44CC, 0x80EF, 0x80EF, 0x0975,
+ 0x80F0, 0x80F0, 0x104F, 0x80F1, 0x80F1, 0x1987, 0x80F2, 0x80F2, 0x198C,
+ 0x80F3, 0x80F3, 0x06E7, 0x80F4, 0x80F4, 0x1988, 0x80F5, 0x80F5, 0x44CD,
+ 0x80F6, 0x80F6, 0x088B, 0x80F7, 0x80F7, 0x44CE, 0x80F8, 0x80F8, 0x0FA3,
+ 0x80F9, 0x80F9, 0x44CF, 0x80FA, 0x80FA, 0x03C2, 0x80FB, 0x80FB, 0x44D0,
+ 0x80FC, 0x80FC, 0x198D, 0x80FD, 0x80FD, 0x0B3F, 0x80FE, 0x80FF, 0x44D1,
+ 0x8100, 0x8101, 0x44D3, 0x8102, 0x8102, 0x11AB, 0x8103, 0x8104, 0x44D5,
+ 0x8105, 0x8105, 0x21D2, 0x8106, 0x8106, 0x0563, 0x8107, 0x8108, 0x44D7,
+ 0x8109, 0x8109, 0x0A9D, 0x810A, 0x810A, 0x082C, 0x810B, 0x810C, 0x44D9,
+ 0x810D, 0x810E, 0x198A, 0x810F, 0x810F, 0x1123, 0x8110, 0x8110, 0x0C09,
+ 0x8111, 0x8111, 0x0B37, 0x8112, 0x8112, 0x198F, 0x8113, 0x8113, 0x0B68,
+ 0x8114, 0x8114, 0x1309, 0x8115, 0x8115, 0x44DB, 0x8116, 0x8116, 0x0478,
+ 0x8117, 0x8117, 0x44DC, 0x8118, 0x8118, 0x1994, 0x8119, 0x8119, 0x44DD,
+ 0x811A, 0x811A, 0x0896, 0x811B, 0x811B, 0x24C7, 0x811C, 0x811D, 0x44DE,
+ 0x811E, 0x811E, 0x1992, 0x811F, 0x812B, 0x44E0, 0x812C, 0x812C, 0x1993,
+ 0x812D, 0x812E, 0x44ED, 0x812F, 0x812F, 0x06A7, 0x8130, 0x8130, 0x44EF,
+ 0x8131, 0x8131, 0x0E82, 0x8132, 0x8132, 0x1995, 0x8133, 0x8135, 0x44F0,
+ 0x8136, 0x8136, 0x1991, 0x8137, 0x8137, 0x44F3, 0x8138, 0x8138, 0x09FC,
+ 0x8139, 0x8139, 0x2279, 0x813A, 0x813D, 0x44F4, 0x813E, 0x813E, 0x0BC1,
+ 0x813F, 0x8145, 0x44F8, 0x8146, 0x8146, 0x0E46, 0x8147, 0x8147, 0x44FF,
+ 0x8148, 0x8148, 0x1996, 0x8149, 0x8149, 0x4500, 0x814A, 0x814A, 0x099B,
+ 0x814B, 0x814B, 0x103F, 0x814C, 0x814C, 0x1997, 0x814D, 0x814D, 0x4501,
+ 0x814E, 0x814E, 0x2123, 0x814F, 0x814F, 0x4502, 0x8150, 0x8150, 0x06AA,
+ 0x8151, 0x8151, 0x06A8, 0x8152, 0x8152, 0x4503, 0x8153, 0x8153, 0x1998,
+ 0x8154, 0x8154, 0x0C38, 0x8155, 0x8155, 0x0EA4, 0x8156, 0x8156, 0x24C5,
+ 0x8157, 0x8158, 0x4504, 0x8159, 0x815A, 0x199A, 0x815B, 0x815F, 0x4506,
+ 0x8160, 0x8160, 0x199D, 0x8161, 0x8161, 0x24C9, 0x8162, 0x8164, 0x450B,
+ 0x8165, 0x8165, 0x0F93, 0x8166, 0x8166, 0x2094, 0x8167, 0x8167, 0x19A2,
+ 0x8168, 0x8168, 0x450E, 0x8169, 0x8169, 0x199E, 0x816A, 0x816A, 0x450F,
+ 0x816B, 0x816B, 0x2296, 0x816C, 0x816C, 0x4510, 0x816D, 0x816D, 0x19A1,
+ 0x816E, 0x816E, 0x0CD4, 0x816F, 0x816F, 0x4511, 0x8170, 0x8170, 0x1025,
+ 0x8171, 0x8171, 0x199C, 0x8172, 0x8173, 0x4512, 0x8174, 0x8174, 0x1999,
+ 0x8175, 0x8177, 0x4514, 0x8178, 0x8178, 0x1E77, 0x8179, 0x8179, 0x06B4,
+ 0x817A, 0x817A, 0x0F46, 0x817B, 0x817B, 0x0B48, 0x817C, 0x817D, 0x199F,
+ 0x817E, 0x817E, 0x0E2D, 0x817F, 0x817F, 0x0E79, 0x8180, 0x8180, 0x03FD,
+ 0x8181, 0x8181, 0x4517, 0x8182, 0x8182, 0x19A6, 0x8183, 0x8187, 0x4518,
+ 0x8188, 0x8188, 0x19A5, 0x8189, 0x8189, 0x451D, 0x818A, 0x818A, 0x0479,
+ 0x818B, 0x818E, 0x451E, 0x818F, 0x818F, 0x06DB, 0x8190, 0x8190, 0x4522,
+ 0x8191, 0x8191, 0x19A7, 0x8192, 0x8197, 0x4523, 0x8198, 0x8198, 0x0455,
+ 0x8199, 0x8199, 0x4529, 0x819A, 0x819A, 0x1F06, 0x819B, 0x819B, 0x0E18,
+ 0x819C, 0x819C, 0x0B07, 0x819D, 0x819D, 0x0F12, 0x819E, 0x819F, 0x452A,
+ 0x81A0, 0x81A0, 0x1FA5, 0x81A1, 0x81A2, 0x452C, 0x81A3, 0x81A3, 0x19A9,
+ 0x81A4, 0x81A5, 0x452E, 0x81A6, 0x81A6, 0x19B0, 0x81A7, 0x81A7, 0x4530,
+ 0x81A8, 0x81A8, 0x0BB3, 0x81A9, 0x81A9, 0x2099, 0x81AA, 0x81AA, 0x19AA,
+ 0x81AB, 0x81B2, 0x4531, 0x81B3, 0x81B3, 0x0CFE, 0x81B4, 0x81B9, 0x4539,
+ 0x81BA, 0x81BA, 0x1641, 0x81BB, 0x81BB, 0x19AE, 0x81BC, 0x81BC, 0x453F,
+ 0x81BD, 0x81BD, 0x1EAD, 0x81BE, 0x81BE, 0x24C8, 0x81BF, 0x81BF, 0x20A8,
+ 0x81C0, 0x81C0, 0x0E7F, 0x81C1, 0x81C1, 0x19AF, 0x81C2, 0x81C2, 0x0444,
+ 0x81C3, 0x81C3, 0x109C, 0x81C4, 0x81C5, 0x4540, 0x81C6, 0x81C6, 0x1063,
+ 0x81C7, 0x81C8, 0x4542, 0x81C9, 0x81C9, 0x201F, 0x81CA, 0x81CA, 0x19AD,
+ 0x81CB, 0x81CB, 0x4544, 0x81CC, 0x81CC, 0x19AB, 0x81CD, 0x81CD, 0x20C5,
+ 0x81CE, 0x81CE, 0x4545, 0x81CF, 0x81CF, 0x24CA, 0x81D0, 0x81D7, 0x4546,
+ 0x81D8, 0x81D8, 0x1FF0, 0x81D9, 0x81D9, 0x454E, 0x81DA, 0x81DA, 0x24C6,
+ 0x81DB, 0x81DE, 0x454F, 0x81DF, 0x81DF, 0x225D, 0x81E0, 0x81E0, 0x22DE,
+ 0x81E1, 0x81E2, 0x4553, 0x81E3, 0x81E3, 0x04E1, 0x81E4, 0x81E6, 0x4555,
+ 0x81E7, 0x81E7, 0x1902, 0x81E8, 0x81E8, 0x202C, 0x81E9, 0x81E9, 0x4558,
+ 0x81EA, 0x81EA, 0x1231, 0x81EB, 0x81EB, 0x4559, 0x81EC, 0x81EC, 0x1CA9,
+ 0x81ED, 0x81ED, 0x0519, 0x81EE, 0x81F2, 0x455A, 0x81F3, 0x81F4, 0x11C0,
+ 0x81F5, 0x81F9, 0x455F, 0x81FA, 0x81FA, 0x2161, 0x81FB, 0x81FB, 0x118A,
+ 0x81FC, 0x81FC, 0x08F9, 0x81FD, 0x81FD, 0x4564, 0x81FE, 0x81FE, 0x1CA5,
+ 0x81FF, 0x81FF, 0x4565, 0x8200, 0x8200, 0x102F, 0x8201, 0x8202, 0x1CA6,
+ 0x8203, 0x8203, 0x4566, 0x8204, 0x8204, 0x1CA8, 0x8205, 0x8205, 0x08FA,
+ 0x8206, 0x8206, 0x10C4, 0x8207, 0x8207, 0x223B, 0x8208, 0x8208, 0x21D9,
+ 0x8209, 0x8209, 0x1FCB, 0x820A, 0x820A, 0x1FC9, 0x820B, 0x820B, 0x4567,
+ 0x820C, 0x820D, 0x0D19, 0x820E, 0x820F, 0x4568, 0x8210, 0x8210, 0x1C62,
+ 0x8211, 0x8211, 0x456A, 0x8212, 0x8212, 0x0D7D, 0x8213, 0x8213, 0x456B,
+ 0x8214, 0x8214, 0x0E45, 0x8215, 0x821A, 0x456C, 0x821B, 0x821B, 0x1618,
+ 0x821C, 0x821C, 0x0DA9, 0x821D, 0x821D, 0x4572, 0x821E, 0x821E, 0x0EF7,
+ 0x821F, 0x821F, 0x11DA, 0x8220, 0x8220, 0x4573, 0x8221, 0x8223, 0x1CAB,
+ 0x8224, 0x8227, 0x4574, 0x8228, 0x8228, 0x1CB0, 0x8229, 0x8229, 0x4578,
+ 0x822A, 0x822A, 0x0774, 0x822B, 0x822B, 0x1CB1, 0x822C, 0x822C, 0x03EE,
+ 0x822D, 0x822D, 0x1CAE, 0x822E, 0x822E, 0x4579, 0x822F, 0x822F, 0x1CAF,
+ 0x8230, 0x8230, 0x0873, 0x8231, 0x8231, 0x049C, 0x8232, 0x8232, 0x457A,
+ 0x8233, 0x8234, 0x1CB4, 0x8235, 0x8235, 0x0625, 0x8236, 0x8236, 0x0477,
+ 0x8237, 0x8237, 0x0F3C, 0x8238, 0x8238, 0x1CB2, 0x8239, 0x8239, 0x052F,
+ 0x823A, 0x823A, 0x457B, 0x823B, 0x823B, 0x1CB3, 0x823C, 0x823D, 0x457C,
+ 0x823E, 0x823E, 0x1CB6, 0x823F, 0x8243, 0x457E, 0x8244, 0x8244, 0x1CB7,
+ 0x8245, 0x8246, 0x4583, 0x8247, 0x8247, 0x0E58, 0x8248, 0x8248, 0x4585,
+ 0x8249, 0x8249, 0x1CB8, 0x824A, 0x824A, 0x4586, 0x824B, 0x824B, 0x1CB9,
+ 0x824C, 0x824E, 0x4587, 0x824F, 0x824F, 0x1CBA, 0x8250, 0x8257, 0x458A,
+ 0x8258, 0x8258, 0x0DC7, 0x8259, 0x8259, 0x1E61, 0x825A, 0x825A, 0x1CBB,
+ 0x825B, 0x825E, 0x4592, 0x825F, 0x825F, 0x1CBC, 0x8260, 0x8263, 0x4596,
+ 0x8264, 0x8264, 0x25EF, 0x8265, 0x8265, 0x459A, 0x8266, 0x8266, 0x1F98,
+ 0x8267, 0x8267, 0x459B, 0x8268, 0x8268, 0x1CBD, 0x8269, 0x826A, 0x459C,
+ 0x826B, 0x826B, 0x25F0, 0x826C, 0x826D, 0x459E, 0x826E, 0x826E, 0x1CDC,
+ 0x826F, 0x826F, 0x0A05, 0x8270, 0x8270, 0x085B, 0x8271, 0x8271, 0x1F88,
+ 0x8272, 0x8272, 0x0CE4, 0x8273, 0x8273, 0x1007, 0x8274, 0x8274, 0x1771,
+ 0x8275, 0x8276, 0x45A0, 0x8277, 0x8277, 0x21F8, 0x8278, 0x8278, 0x45A2,
+ 0x8279, 0x8279, 0x13E1, 0x827A, 0x827A, 0x105C, 0x827B, 0x827C, 0x45A3,
+ 0x827D, 0x827D, 0x13E2, 0x827E, 0x827E, 0x03B7, 0x827F, 0x827F, 0x13E3,
+ 0x8280, 0x8281, 0x45A5, 0x8282, 0x8282, 0x08AB, 0x8283, 0x8283, 0x45A7,
+ 0x8284, 0x8284, 0x13E7, 0x8285, 0x8287, 0x45A8, 0x8288, 0x8288, 0x1278,
+ 0x8289, 0x8289, 0x45AB, 0x828A, 0x828A, 0x13E5, 0x828B, 0x828B, 0x10D8,
+ 0x828C, 0x828C, 0x45AC, 0x828D, 0x828D, 0x0D0F, 0x828E, 0x828E, 0x13E8,
+ 0x828F, 0x828F, 0x13E4, 0x8290, 0x8290, 0x45AD, 0x8291, 0x8291, 0x13E9,
+ 0x8292, 0x8292, 0x0AA7, 0x8293, 0x8296, 0x45AE, 0x8297, 0x8297, 0x13EA,
+ 0x8298, 0x8298, 0x13F3, 0x8299, 0x8299, 0x13EB, 0x829A, 0x829B, 0x45B2,
+ 0x829C, 0x829C, 0x0EEE, 0x829D, 0x829D, 0x11A4, 0x829E, 0x829E, 0x45B4,
+ 0x829F, 0x829F, 0x13FD, 0x82A0, 0x82A0, 0x45B5, 0x82A1, 0x82A1, 0x13FB,
+ 0x82A2, 0x82A3, 0x45B6, 0x82A4, 0x82A4, 0x1400, 0x82A5, 0x82A5, 0x08B7,
+ 0x82A6, 0x82A6, 0x0A52, 0x82A7, 0x82A7, 0x45B8, 0x82A8, 0x82A8, 0x13E6,
+ 0x82A9, 0x82A9, 0x13F9, 0x82AA, 0x82AA, 0x13FC, 0x82AB, 0x82AB, 0x13EC,
+ 0x82AC, 0x82AC, 0x066F, 0x82AD, 0x82AD, 0x03D0, 0x82AE, 0x82AE, 0x13F5,
+ 0x82AF, 0x82AF, 0x0F89, 0x82B0, 0x82B0, 0x13EF, 0x82B1, 0x82B1, 0x07BD,
+ 0x82B2, 0x82B2, 0x45B9, 0x82B3, 0x82B3, 0x0659, 0x82B4, 0x82B4, 0x13FA,
+ 0x82B5, 0x82B6, 0x45BA, 0x82B7, 0x82B7, 0x13F4, 0x82B8, 0x82B8, 0x13ED,
+ 0x82B9, 0x82B9, 0x0C58, 0x82BA, 0x82BA, 0x45BC, 0x82BB, 0x82BB, 0x2322,
+ 0x82BC, 0x82BC, 0x45BD, 0x82BD, 0x82BD, 0x0FE8, 0x82BE, 0x82BE, 0x13EE,
+ 0x82BF, 0x82C0, 0x45BE, 0x82C1, 0x82C1, 0x13F8, 0x82C2, 0x82C3, 0x45C0,
+ 0x82C4, 0x82C4, 0x13FE, 0x82C5, 0x82C6, 0x45C2, 0x82C7, 0x82C7, 0x0EBC,
+ 0x82C8, 0x82C8, 0x13F0, 0x82C9, 0x82C9, 0x45C4, 0x82CA, 0x82CA, 0x13F1,
+ 0x82CB, 0x82CC, 0x13F6, 0x82CD, 0x82CD, 0x049B, 0x82CE, 0x82CE, 0x13FF,
+ 0x82CF, 0x82CF, 0x0DCA, 0x82D0, 0x82D0, 0x45C5, 0x82D1, 0x82D1, 0x10FA,
+ 0x82D2, 0x82D2, 0x1409, 0x82D3, 0x82D3, 0x140D, 0x82D4, 0x82D4, 0x0DF9,
+ 0x82D5, 0x82D5, 0x1414, 0x82D6, 0x82D6, 0x45C6, 0x82D7, 0x82D7, 0x0AEC,
+ 0x82D8, 0x82D8, 0x140A, 0x82D9, 0x82DA, 0x45C7, 0x82DB, 0x82DB, 0x094E,
+ 0x82DC, 0x82DC, 0x1407, 0x82DD, 0x82DD, 0x45C9, 0x82DE, 0x82DE, 0x0405,
+ 0x82DF, 0x82DF, 0x070F, 0x82E0, 0x82E0, 0x1413, 0x82E1, 0x82E1, 0x1401,
+ 0x82E2, 0x82E2, 0x45CA, 0x82E3, 0x82E3, 0x13F2, 0x82E4, 0x82E4, 0x1404,
+ 0x82E5, 0x82E5, 0x0CCF, 0x82E6, 0x82E6, 0x096D, 0x82E7, 0x82E7, 0x2336,
+ 0x82E8, 0x82EA, 0x45CB, 0x82EB, 0x82EB, 0x0CF4, 0x82EC, 0x82EE, 0x45CE,
+ 0x82EF, 0x82EF, 0x0426, 0x82F0, 0x82F0, 0x45D1, 0x82F1, 0x82F1, 0x1087,
+ 0x82F2, 0x82F3, 0x45D2, 0x82F4, 0x82F4, 0x1408, 0x82F5, 0x82F6, 0x45D4,
+ 0x82F7, 0x82F7, 0x1403, 0x82F8, 0x82F8, 0x45D6, 0x82F9, 0x82F9, 0x0BDA,
+ 0x82FA, 0x82FA, 0x45D7, 0x82FB, 0x82FB, 0x140C, 0x82FC, 0x82FF, 0x45D8,
+ 0x8300, 0x8300, 0x45DC, 0x8301, 0x8301, 0x121F, 0x8302, 0x8302, 0x0AB4,
+ 0x8303, 0x8303, 0x0653, 0x8304, 0x8304, 0x0C4E, 0x8305, 0x8305, 0x0AAE,
+ 0x8306, 0x8306, 0x1410, 0x8307, 0x8307, 0x1406, 0x8308, 0x8308, 0x1419,
+ 0x8309, 0x8309, 0x1402, 0x830A, 0x830B, 0x45DD, 0x830C, 0x830C, 0x140B,
+ 0x830D, 0x830D, 0x45DF, 0x830E, 0x830E, 0x08D4, 0x830F, 0x830F, 0x1405,
+ 0x8310, 0x8310, 0x45E0, 0x8311, 0x8311, 0x140E, 0x8312, 0x8313, 0x45E1,
+ 0x8314, 0x8315, 0x1411, 0x8316, 0x8316, 0x45E3, 0x8317, 0x8317, 0x1426,
+ 0x8318, 0x8319, 0x45E4, 0x831A, 0x831A, 0x140F, 0x831B, 0x831B, 0x142E,
+ 0x831C, 0x831C, 0x1415, 0x831D, 0x8326, 0x45E6, 0x8327, 0x8327, 0x085E,
+ 0x8328, 0x8328, 0x0547, 0x8329, 0x832A, 0x45F0, 0x832B, 0x832B, 0x0AA8,
+ 0x832C, 0x832C, 0x04AE, 0x832D, 0x832D, 0x1428, 0x832E, 0x832E, 0x45F2,
+ 0x832F, 0x832F, 0x1420, 0x8330, 0x8330, 0x45F3, 0x8331, 0x8331, 0x141D,
+ 0x8332, 0x8332, 0x45F4, 0x8333, 0x8333, 0x142A, 0x8334, 0x8334, 0x141C,
+ 0x8335, 0x8335, 0x1077, 0x8336, 0x8336, 0x04AF, 0x8337, 0x8337, 0x45F5,
+ 0x8338, 0x8338, 0x0CB2, 0x8339, 0x8339, 0x0CBE, 0x833A, 0x833A, 0x1429,
+ 0x833B, 0x833B, 0x45F6, 0x833C, 0x833C, 0x141B, 0x833D, 0x833F, 0x45F7,
+ 0x8340, 0x8340, 0x1425, 0x8341, 0x8342, 0x45FA, 0x8343, 0x8343, 0x1423,
+ 0x8344, 0x8345, 0x45FC, 0x8346, 0x8346, 0x08D2, 0x8347, 0x8347, 0x1422,
+ 0x8348, 0x8348, 0x45FE, 0x8349, 0x8349, 0x04A4, 0x834A, 0x834E, 0x45FF,
+ 0x834F, 0x834F, 0x1421, 0x8350, 0x8350, 0x0869, 0x8351, 0x8351, 0x1416,
+ 0x8352, 0x8352, 0x07D9, 0x8353, 0x8353, 0x4604, 0x8354, 0x8354, 0x09DE,
+ 0x8355, 0x8359, 0x4605, 0x835A, 0x835A, 0x0847, 0x835B, 0x835C, 0x1417,
+ 0x835D, 0x835D, 0x460A, 0x835E, 0x835E, 0x141F, 0x835F, 0x835F, 0x1424,
+ 0x8360, 0x8360, 0x1427, 0x8361, 0x8361, 0x0595, 0x8362, 0x8362, 0x460B,
+ 0x8363, 0x8363, 0x0CB4, 0x8364, 0x8364, 0x07FC, 0x8365, 0x8365, 0x142C,
+ 0x8366, 0x8366, 0x142B, 0x8367, 0x8367, 0x1090, 0x8368, 0x8368, 0x142D,
+ 0x8369, 0x8369, 0x142F, 0x836A, 0x836A, 0x1431, 0x836B, 0x836B, 0x1078,
+ 0x836C, 0x836C, 0x1430, 0x836D, 0x836E, 0x1432, 0x836F, 0x836F, 0x1030,
+ 0x8370, 0x8376, 0x460C, 0x8377, 0x8377, 0x0780, 0x8378, 0x8378, 0x1435,
+ 0x8379, 0x837A, 0x4613, 0x837B, 0x837B, 0x1442, 0x837C, 0x837C, 0x143D,
+ 0x837D, 0x837D, 0x1440, 0x837E, 0x8384, 0x4615, 0x8385, 0x8385, 0x143C,
+ 0x8386, 0x8386, 0x0BED, 0x8387, 0x8388, 0x461C, 0x8389, 0x8389, 0x09DD,
+ 0x838A, 0x838A, 0x22AB, 0x838B, 0x838D, 0x461E, 0x838E, 0x838E, 0x0CE8,
+ 0x838F, 0x8391, 0x4621, 0x8392, 0x8392, 0x141A, 0x8393, 0x8393, 0x143A,
+ 0x8394, 0x8395, 0x4624, 0x8396, 0x8396, 0x1FBF, 0x8397, 0x8397, 0x4626,
+ 0x8398, 0x8398, 0x1443, 0x8399, 0x839A, 0x4627, 0x839B, 0x839B, 0x141E,
+ 0x839C, 0x839C, 0x143B, 0x839D, 0x839D, 0x4629, 0x839E, 0x839E, 0x1444,
+ 0x839F, 0x839F, 0x462A, 0x83A0, 0x83A0, 0x1438, 0x83A1, 0x83A1, 0x462B,
+ 0x83A2, 0x83A2, 0x1F7D, 0x83A3, 0x83A6, 0x462C, 0x83A7, 0x83A7, 0x2333,
+ 0x83A8, 0x83A8, 0x1445, 0x83A9, 0x83A9, 0x143F, 0x83AA, 0x83AA, 0x1439,
+ 0x83AB, 0x83AB, 0x0B0D, 0x83AC, 0x83AF, 0x4630, 0x83B0, 0x83B0, 0x1434,
+ 0x83B1, 0x83B1, 0x099E, 0x83B2, 0x83B2, 0x09F4, 0x83B3, 0x83B4, 0x1436,
+ 0x83B5, 0x83B5, 0x4634, 0x83B6, 0x83B6, 0x143E, 0x83B7, 0x83B7, 0x0806,
+ 0x83B8, 0x83B8, 0x1441, 0x83B9, 0x83B9, 0x108D, 0x83BA, 0x83BA, 0x1446,
+ 0x83BB, 0x83BB, 0x4635, 0x83BC, 0x83BC, 0x1447, 0x83BD, 0x83BD, 0x0AAC,
+ 0x83BE, 0x83BF, 0x4636, 0x83C0, 0x83C0, 0x145E, 0x83C1, 0x83C1, 0x1448,
+ 0x83C2, 0x83C4, 0x4638, 0x83C5, 0x83C5, 0x145D, 0x83C6, 0x83C6, 0x463B,
+ 0x83C7, 0x83C7, 0x0716, 0x83C8, 0x83C9, 0x463C, 0x83CA, 0x83CA, 0x0904,
+ 0x83CB, 0x83CB, 0x463E, 0x83CC, 0x83CC, 0x0929, 0x83CD, 0x83CE, 0x463F,
+ 0x83CF, 0x83CF, 0x0781, 0x83D0, 0x83D3, 0x4641, 0x83D4, 0x83D4, 0x1456,
+ 0x83D5, 0x83D5, 0x4645, 0x83D6, 0x83D6, 0x1451, 0x83D7, 0x83D7, 0x4646,
+ 0x83D8, 0x83D8, 0x144B, 0x83D9, 0x83DB, 0x4647, 0x83DC, 0x83DC, 0x0492,
+ 0x83DD, 0x83DD, 0x144F, 0x83DE, 0x83DE, 0x464A, 0x83DF, 0x83DF, 0x1457,
+ 0x83E0, 0x83E0, 0x046B, 0x83E1, 0x83E1, 0x1461, 0x83E2, 0x83E4, 0x464B,
+ 0x83E5, 0x83E5, 0x144A, 0x83E6, 0x83E8, 0x464E, 0x83E9, 0x83E9, 0x0BEF,
+ 0x83EA, 0x83EA, 0x145C, 0x83EB, 0x83EE, 0x4651, 0x83EF, 0x83EF, 0x1F4D,
+ 0x83F0, 0x83F0, 0x1460, 0x83F1, 0x83F1, 0x0A2B, 0x83F2, 0x83F2, 0x0663,
+ 0x83F3, 0x83F7, 0x4655, 0x83F8, 0x83F9, 0x145A, 0x83FA, 0x83FC, 0x465A,
+ 0x83FD, 0x83FD, 0x1450, 0x83FE, 0x83FF, 0x465D, 0x8400, 0x8400, 0x465F,
+ 0x8401, 0x8401, 0x1449, 0x8402, 0x8402, 0x4660, 0x8403, 0x8403, 0x1459,
+ 0x8404, 0x8404, 0x0E24, 0x8405, 0x8405, 0x4661, 0x8406, 0x8406, 0x1455,
+ 0x8407, 0x8407, 0x2334, 0x8408, 0x8409, 0x4662, 0x840A, 0x840A, 0x1FF1,
+ 0x840B, 0x840B, 0x144E, 0x840C, 0x840C, 0x0ACD, 0x840D, 0x840D, 0x0BDB,
+ 0x840E, 0x840E, 0x0EBD, 0x840F, 0x840F, 0x1458, 0x8410, 0x8410, 0x4664,
+ 0x8411, 0x8411, 0x1454, 0x8412, 0x8417, 0x4665, 0x8418, 0x8418, 0x144D,
+ 0x8419, 0x841B, 0x466B, 0x841C, 0x841C, 0x1452, 0x841D, 0x841D, 0x0A83,
+ 0x841E, 0x8423, 0x466E, 0x8424, 0x8425, 0x108E, 0x8426, 0x8426, 0x145F,
+ 0x8427, 0x8427, 0x0F61, 0x8428, 0x8428, 0x0CD3, 0x8429, 0x842B, 0x4674,
+ 0x842C, 0x842C, 0x218B, 0x842D, 0x8430, 0x4677, 0x8431, 0x8431, 0x1472,
+ 0x8432, 0x8434, 0x467B, 0x8435, 0x8435, 0x2349, 0x8436, 0x8437, 0x467E,
+ 0x8438, 0x8438, 0x1453, 0x8439, 0x843B, 0x4680, 0x843C, 0x843C, 0x146C,
+ 0x843D, 0x843D, 0x0A8B, 0x843E, 0x8445, 0x4683, 0x8446, 0x8446, 0x146D,
+ 0x8447, 0x8448, 0x468B, 0x8449, 0x8449, 0x220B, 0x844A, 0x8450, 0x468D,
+ 0x8451, 0x8451, 0x1463, 0x8452, 0x8452, 0x2346, 0x8453, 0x8456, 0x4694,
+ 0x8457, 0x8457, 0x11F7, 0x8458, 0x8458, 0x4698, 0x8459, 0x8459, 0x1465,
+ 0x845A, 0x845A, 0x1464, 0x845B, 0x845B, 0x06EB, 0x845C, 0x845C, 0x1462,
+ 0x845D, 0x8460, 0x4699, 0x8461, 0x8461, 0x0BEE, 0x8462, 0x8462, 0x469D,
+ 0x8463, 0x8463, 0x05EC, 0x8464, 0x8464, 0x2347, 0x8465, 0x8465, 0x469E,
+ 0x8466, 0x8466, 0x2193, 0x8467, 0x8468, 0x469F, 0x8469, 0x8469, 0x146E,
+ 0x846A, 0x846A, 0x46A1, 0x846B, 0x846B, 0x07B0, 0x846C, 0x846C, 0x1124,
+ 0x846D, 0x846D, 0x1473, 0x846E, 0x846E, 0x46A2, 0x846F, 0x846F, 0x26A1,
+ 0x8470, 0x8470, 0x46A3, 0x8471, 0x8471, 0x0553, 0x8472, 0x8472, 0x46A4,
+ 0x8473, 0x8473, 0x1466, 0x8474, 0x8474, 0x46A5, 0x8475, 0x8475, 0x0988,
+ 0x8476, 0x8476, 0x146F, 0x8477, 0x8477, 0x1F62, 0x8478, 0x8478, 0x146B,
+ 0x8479, 0x8479, 0x46A6, 0x847A, 0x847A, 0x1469, 0x847B, 0x8481, 0x46A7,
+ 0x8482, 0x8482, 0x05BA, 0x8483, 0x8486, 0x46AE, 0x8487, 0x8488, 0x1467,
+ 0x8489, 0x8489, 0x146A, 0x848A, 0x848A, 0x46B2, 0x848B, 0x848B, 0x0880,
+ 0x848C, 0x848C, 0x1470, 0x848D, 0x848D, 0x46B3, 0x848E, 0x848E, 0x1471,
+ 0x848F, 0x8492, 0x46B4, 0x8493, 0x8493, 0x234D, 0x8494, 0x8494, 0x2348,
+ 0x8495, 0x8496, 0x46B8, 0x8497, 0x8497, 0x1481, 0x8498, 0x8498, 0x46BA,
+ 0x8499, 0x8499, 0x0ACE, 0x849A, 0x849B, 0x46BB, 0x849C, 0x849C, 0x0DD7,
+ 0x849D, 0x84A0, 0x46BD, 0x84A1, 0x84A1, 0x147E, 0x84A2, 0x84AE, 0x46C1,
+ 0x84AF, 0x84AF, 0x1297, 0x84B0, 0x84B1, 0x46CE, 0x84B2, 0x84B2, 0x0BF0,
+ 0x84B3, 0x84B3, 0x46D0, 0x84B4, 0x84B4, 0x1480, 0x84B5, 0x84B7, 0x46D1,
+ 0x84B8, 0x84B8, 0x1195, 0x84B9, 0x84B9, 0x147F, 0x84BA, 0x84BA, 0x147C,
+ 0x84BB, 0x84BB, 0x46D4, 0x84BC, 0x84BC, 0x1E60, 0x84BD, 0x84BD, 0x1478,
+ 0x84BE, 0x84BE, 0x46D5, 0x84BF, 0x84BF, 0x147B, 0x84C0, 0x84C0, 0x2345,
+ 0x84C1, 0x84C1, 0x1474, 0x84C2, 0x84C3, 0x46D6, 0x84C4, 0x84C4, 0x0FB9,
+ 0x84C5, 0x84C8, 0x46D8, 0x84C9, 0x84C9, 0x0CB3, 0x84CA, 0x84CA, 0x147A,
+ 0x84CB, 0x84CB, 0x1F12, 0x84CC, 0x84CC, 0x46DC, 0x84CD, 0x84CD, 0x1475,
+ 0x84CE, 0x84CF, 0x46DD, 0x84D0, 0x84D0, 0x1476, 0x84D1, 0x84D1, 0x0DE7,
+ 0x84D2, 0x84D2, 0x46DF, 0x84D3, 0x84D3, 0x1479, 0x84D4, 0x84D5, 0x46E0,
+ 0x84D6, 0x84D6, 0x0436, 0x84D7, 0x84DC, 0x46E2, 0x84DD, 0x84DD, 0x09A1,
+ 0x84DE, 0x84DE, 0x46E8, 0x84DF, 0x84DF, 0x082E, 0x84E0, 0x84E0, 0x147D,
+ 0x84E1, 0x84E2, 0x46E9, 0x84E3, 0x84E3, 0x1483, 0x84E4, 0x84E4, 0x46EB,
+ 0x84E5, 0x84E5, 0x1482, 0x84E6, 0x84E6, 0x1477, 0x84E7, 0x84EB, 0x46EC,
+ 0x84EC, 0x84EC, 0x0BAF, 0x84ED, 0x84ED, 0x46F1, 0x84EE, 0x84EE, 0x2018,
+ 0x84EF, 0x84EF, 0x2335, 0x84F0, 0x84F0, 0x1487, 0x84F1, 0x84FB, 0x46F2,
+ 0x84FC, 0x84FC, 0x148E, 0x84FD, 0x84FD, 0x233C, 0x84FE, 0x84FE, 0x46FD,
+ 0x84FF, 0x84FF, 0x148D, 0x8500, 0x850B, 0x46FE, 0x850C, 0x850C, 0x1484,
+ 0x850D, 0x8510, 0x470A, 0x8511, 0x8511, 0x0AF4, 0x8512, 0x8512, 0x470E,
+ 0x8513, 0x8513, 0x0AA2, 0x8514, 0x8514, 0x266F, 0x8515, 0x8516, 0x470F,
+ 0x8517, 0x8517, 0x1182, 0x8518, 0x8519, 0x4711, 0x851A, 0x851A, 0x0EC4,
+ 0x851B, 0x851D, 0x4713, 0x851E, 0x851E, 0x2351, 0x851F, 0x851F, 0x1489,
+ 0x8520, 0x8520, 0x4716, 0x8521, 0x8521, 0x0493, 0x8522, 0x8522, 0x4717,
+ 0x8523, 0x8523, 0x1FA0, 0x8524, 0x8525, 0x4718, 0x8526, 0x8526, 0x2338,
+ 0x8527, 0x852A, 0x471A, 0x852B, 0x852B, 0x0B4B, 0x852C, 0x852C, 0x0D76,
+ 0x852D, 0x852D, 0x221B, 0x852E, 0x8536, 0x471E, 0x8537, 0x8537, 0x0C3B,
+ 0x8538, 0x8538, 0x1486, 0x8539, 0x8539, 0x1488, 0x853A, 0x853A, 0x148A,
+ 0x853B, 0x853B, 0x148C, 0x853C, 0x853C, 0x03B5, 0x853D, 0x853D, 0x0437,
+ 0x853E, 0x8540, 0x4727, 0x8541, 0x8541, 0x2342, 0x8542, 0x8542, 0x472A,
+ 0x8543, 0x8543, 0x1496, 0x8544, 0x8545, 0x472B, 0x8546, 0x8546, 0x234F,
+ 0x8547, 0x8547, 0x472D, 0x8548, 0x8548, 0x1490, 0x8549, 0x8549, 0x0887,
+ 0x854A, 0x854A, 0x0CCA, 0x854B, 0x854D, 0x472E, 0x854E, 0x854E, 0x233D,
+ 0x854F, 0x8551, 0x4731, 0x8552, 0x8552, 0x2344, 0x8553, 0x8553, 0x2331,
+ 0x8554, 0x8554, 0x4734, 0x8555, 0x8555, 0x234B, 0x8556, 0x8556, 0x148B,
+ 0x8557, 0x8557, 0x4735, 0x8558, 0x8558, 0x233B, 0x8559, 0x8559, 0x148F,
+ 0x855A, 0x855D, 0x4736, 0x855E, 0x855E, 0x1493, 0x855F, 0x8561, 0x473A,
+ 0x8562, 0x8562, 0x2350, 0x8563, 0x8563, 0x473D, 0x8564, 0x8564, 0x1492,
+ 0x8565, 0x8567, 0x473E, 0x8568, 0x8568, 0x1491, 0x8569, 0x8569, 0x1EB4,
+ 0x856A, 0x856A, 0x21A6, 0x856B, 0x856C, 0x4741, 0x856D, 0x856D, 0x21CB,
+ 0x856E, 0x8571, 0x4743, 0x8572, 0x8572, 0x1497, 0x8573, 0x8573, 0x4747,
+ 0x8574, 0x8574, 0x110F, 0x8575, 0x8576, 0x4748, 0x8577, 0x8577, 0x2355,
+ 0x8578, 0x8578, 0x474A, 0x8579, 0x8579, 0x149D, 0x857A, 0x857A, 0x1494,
+ 0x857B, 0x857B, 0x1498, 0x857C, 0x857D, 0x474B, 0x857E, 0x857E, 0x09C4,
+ 0x857F, 0x8583, 0x474D, 0x8584, 0x8584, 0x040A, 0x8585, 0x8585, 0x14A0,
+ 0x8586, 0x8586, 0x4752, 0x8587, 0x8587, 0x149B, 0x8588, 0x8588, 0x233E,
+ 0x8589, 0x8589, 0x4753, 0x858A, 0x858A, 0x1F74, 0x858B, 0x858B, 0x4754,
+ 0x858C, 0x858C, 0x2330, 0x858D, 0x858E, 0x4755, 0x858F, 0x858F, 0x149C,
+ 0x8590, 0x8590, 0x4757, 0x8591, 0x8591, 0x2680, 0x8592, 0x8593, 0x4758,
+ 0x8594, 0x8594, 0x20DA, 0x8595, 0x859A, 0x475A, 0x859B, 0x859B, 0x0FCF,
+ 0x859C, 0x859C, 0x149F, 0x859D, 0x859E, 0x4760, 0x859F, 0x859F, 0x234A,
+ 0x85A0, 0x85A3, 0x4762, 0x85A4, 0x85A4, 0x1499, 0x85A5, 0x85A5, 0x4766,
+ 0x85A6, 0x85A6, 0x1F91, 0x85A7, 0x85A7, 0x4767, 0x85A8, 0x85A8, 0x149A,
+ 0x85A9, 0x85A9, 0x2107, 0x85AA, 0x85AA, 0x0F88, 0x85AB, 0x85AD, 0x4768,
+ 0x85AE, 0x85AE, 0x149E, 0x85AF, 0x85AF, 0x0D84, 0x85B0, 0x85B0, 0x14A3,
+ 0x85B1, 0x85B6, 0x476B, 0x85B7, 0x85B7, 0x14A2, 0x85B8, 0x85B8, 0x4771,
+ 0x85B9, 0x85B9, 0x14A1, 0x85BA, 0x85BA, 0x233F, 0x85BB, 0x85C0, 0x4772,
+ 0x85C1, 0x85C1, 0x14A5, 0x85C2, 0x85C8, 0x4778, 0x85C9, 0x85C9, 0x08B6,
+ 0x85CA, 0x85CC, 0x477F, 0x85CD, 0x85CD, 0x1FF4, 0x85CE, 0x85CE, 0x2343,
+ 0x85CF, 0x85CF, 0x049F, 0x85D0, 0x85D0, 0x0AEF, 0x85D1, 0x85D2, 0x4782,
+ 0x85D3, 0x85D3, 0x14A4, 0x85D4, 0x85D4, 0x4784, 0x85D5, 0x85D5, 0x0B7B,
+ 0x85D6, 0x85DB, 0x4785, 0x85DC, 0x85DC, 0x14A6, 0x85DD, 0x85DD, 0x2212,
+ 0x85DE, 0x85E3, 0x478B, 0x85E4, 0x85E4, 0x0E2C, 0x85E5, 0x85E5, 0x2207,
+ 0x85E6, 0x85E8, 0x4791, 0x85E9, 0x85E9, 0x0647, 0x85EA, 0x85EA, 0x2359,
+ 0x85EB, 0x85F3, 0x4794, 0x85F4, 0x85F4, 0x2254, 0x85F5, 0x85F5, 0x479D,
+ 0x85F6, 0x85F6, 0x2332, 0x85F7, 0x85F8, 0x479E, 0x85F9, 0x85F9, 0x1E26,
+ 0x85FA, 0x85FA, 0x2357, 0x85FB, 0x85FB, 0x1128, 0x85FC, 0x85FE, 0x47A0,
+ 0x85FF, 0x85FF, 0x14A7, 0x8600, 0x8603, 0x47A3, 0x8604, 0x8604, 0x2358,
+ 0x8605, 0x8605, 0x14A9, 0x8606, 0x8606, 0x2042, 0x8607, 0x8607, 0x2153,
+ 0x8608, 0x860A, 0x47A7, 0x860B, 0x860B, 0x20BB, 0x860C, 0x8610, 0x47AA,
+ 0x8611, 0x8611, 0x0B05, 0x8612, 0x8615, 0x47AF, 0x8616, 0x8616, 0x14AB,
+ 0x8617, 0x8619, 0x47B3, 0x861A, 0x861A, 0x235A, 0x861B, 0x861D, 0x47B6,
+ 0x861E, 0x861E, 0x2356, 0x861F, 0x8621, 0x47B9, 0x8622, 0x8622, 0x2337,
+ 0x8623, 0x8626, 0x47BC, 0x8627, 0x8627, 0x14A8, 0x8628, 0x8628, 0x47C0,
+ 0x8629, 0x8629, 0x14AA, 0x862A, 0x862C, 0x47C1, 0x862D, 0x862D, 0x1FF9,
+ 0x862E, 0x8637, 0x47C4, 0x8638, 0x8638, 0x115B, 0x8639, 0x8639, 0x47CE,
+ 0x863A, 0x863A, 0x2353, 0x863B, 0x863B, 0x47CF, 0x863C, 0x863C, 0x14AC,
+ 0x863D, 0x863E, 0x47D0, 0x863F, 0x863F, 0x2061, 0x8640, 0x864C, 0x47D2,
+ 0x864D, 0x864D, 0x1BF0, 0x864E, 0x864E, 0x07B7, 0x864F, 0x864F, 0x0A59,
+ 0x8650, 0x8650, 0x0B71, 0x8651, 0x8651, 0x0A6E, 0x8652, 0x8653, 0x47DF,
+ 0x8654, 0x8654, 0x1BF1, 0x8655, 0x8655, 0x1E95, 0x8656, 0x8659, 0x47E1,
+ 0x865A, 0x865A, 0x0FB4, 0x865B, 0x865B, 0x47E5, 0x865C, 0x865C, 0x2049,
+ 0x865D, 0x865D, 0x47E6, 0x865E, 0x865E, 0x10C2, 0x865F, 0x865F, 0x1F42,
+ 0x8660, 0x8661, 0x47E7, 0x8662, 0x8662, 0x196D, 0x8663, 0x8666, 0x47E9,
+ 0x8667, 0x8667, 0x1FE8, 0x8668, 0x866A, 0x47ED, 0x866B, 0x866B, 0x050B,
+ 0x866C, 0x866C, 0x1BF2, 0x866D, 0x866D, 0x47F0, 0x866E, 0x866E, 0x1BF3,
+ 0x866F, 0x8670, 0x47F1, 0x8671, 0x8671, 0x0D44, 0x8672, 0x8678, 0x47F3,
+ 0x8679, 0x8679, 0x079E, 0x867A, 0x867A, 0x1BF5, 0x867B, 0x867B, 0x1BF7,
+ 0x867C, 0x867C, 0x1BF6, 0x867D, 0x867D, 0x0DD9, 0x867E, 0x867E, 0x0F27,
+ 0x867F, 0x867F, 0x1BF4, 0x8680, 0x8680, 0x0D4B, 0x8681, 0x8681, 0x1056,
+ 0x8682, 0x8682, 0x0A93, 0x8683, 0x8689, 0x47FA, 0x868A, 0x868A, 0x0ED2,
+ 0x868B, 0x868B, 0x1BFA, 0x868C, 0x868C, 0x0401, 0x868D, 0x868D, 0x1BF9,
+ 0x868E, 0x8692, 0x4801, 0x8693, 0x8693, 0x1C00, 0x8694, 0x8694, 0x4806,
+ 0x8695, 0x8695, 0x0496, 0x8696, 0x869B, 0x4807, 0x869C, 0x869C, 0x0FEA,
+ 0x869D, 0x869D, 0x1BFC, 0x869E, 0x86A2, 0x480D, 0x86A3, 0x86A3, 0x1BFE,
+ 0x86A4, 0x86A4, 0x112C, 0x86A5, 0x86A6, 0x4812, 0x86A7, 0x86A7, 0x1BFD,
+ 0x86A8, 0x86A8, 0x1BF8, 0x86A9, 0x86A9, 0x1C01, 0x86AA, 0x86AA, 0x1BFF,
+ 0x86AB, 0x86AB, 0x4814, 0x86AC, 0x86AC, 0x1BFB, 0x86AD, 0x86AE, 0x4815,
+ 0x86AF, 0x86AF, 0x1C09, 0x86B0, 0x86B0, 0x1C06, 0x86B1, 0x86B1, 0x1C08,
+ 0x86B2, 0x86B3, 0x4817, 0x86B4, 0x86B4, 0x1C0C, 0x86B5, 0x86B5, 0x1C04,
+ 0x86B6, 0x86B6, 0x1C02, 0x86B7, 0x86B9, 0x4819, 0x86BA, 0x86BA, 0x1C07,
+ 0x86BB, 0x86BF, 0x481C, 0x86C0, 0x86C0, 0x11FA, 0x86C1, 0x86C3, 0x4821,
+ 0x86C4, 0x86C4, 0x1C03, 0x86C5, 0x86C5, 0x4824, 0x86C6, 0x86C6, 0x0C76,
+ 0x86C7, 0x86C7, 0x0D18, 0x86C8, 0x86C8, 0x4825, 0x86C9, 0x86C9, 0x1C0A,
+ 0x86CA, 0x86CA, 0x071F, 0x86CB, 0x86CB, 0x0591, 0x86CC, 0x86CD, 0x4826,
+ 0x86CE, 0x86CE, 0x1C05, 0x86CF, 0x86CF, 0x1C0B, 0x86D0, 0x86D0, 0x1C12,
+ 0x86D1, 0x86D1, 0x1C18, 0x86D2, 0x86D3, 0x4828, 0x86D4, 0x86D4, 0x07EC,
+ 0x86D5, 0x86D7, 0x482A, 0x86D8, 0x86D8, 0x1C17, 0x86D9, 0x86D9, 0x0E8D,
+ 0x86DA, 0x86DA, 0x482D, 0x86DB, 0x86DB, 0x11EA, 0x86DC, 0x86DD, 0x482E,
+ 0x86DE, 0x86DE, 0x1C14, 0x86DF, 0x86DF, 0x1C16, 0x86E0, 0x86E3, 0x4830,
+ 0x86E4, 0x86E4, 0x06ED, 0x86E5, 0x86E8, 0x4834, 0x86E9, 0x86E9, 0x1C0D,
+ 0x86EA, 0x86EC, 0x4838, 0x86ED, 0x86ED, 0x1C10, 0x86EE, 0x86EE, 0x0AA0,
+ 0x86EF, 0x86EF, 0x483B, 0x86F0, 0x86F0, 0x117E, 0x86F1, 0x86F2, 0x1C0E,
+ 0x86F3, 0x86F3, 0x1C11, 0x86F4, 0x86F4, 0x1C15, 0x86F5, 0x86F7, 0x483C,
+ 0x86F8, 0x86F8, 0x1C1B, 0x86F9, 0x86F9, 0x10A1, 0x86FA, 0x86FA, 0x25DA,
+ 0x86FB, 0x86FD, 0x483F, 0x86FE, 0x86FE, 0x0629, 0x86FF, 0x86FF, 0x4842,
+ 0x8700, 0x8700, 0x0D88, 0x8701, 0x8701, 0x4843, 0x8702, 0x8702, 0x0681,
+ 0x8703, 0x8703, 0x1C19, 0x8704, 0x8705, 0x4844, 0x8706, 0x8706, 0x25D7,
+ 0x8707, 0x8707, 0x1C1A, 0x8708, 0x8708, 0x1C1C, 0x8709, 0x8709, 0x1C1F,
+ 0x870A, 0x870A, 0x1C1D, 0x870B, 0x870C, 0x4846, 0x870D, 0x870D, 0x1C1E,
+ 0x870E, 0x8711, 0x4848, 0x8712, 0x8712, 0x0FFA, 0x8713, 0x8713, 0x1C13,
+ 0x8714, 0x8714, 0x484C, 0x8715, 0x8715, 0x0E7A, 0x8716, 0x8716, 0x484D,
+ 0x8717, 0x8717, 0x0EDE, 0x8718, 0x8718, 0x11A8, 0x8719, 0x8719, 0x484E,
+ 0x871A, 0x871A, 0x1C25, 0x871B, 0x871B, 0x484F, 0x871C, 0x871C, 0x0AE0,
+ 0x871D, 0x871D, 0x4850, 0x871E, 0x871E, 0x1C22, 0x871F, 0x8720, 0x4851,
+ 0x8721, 0x8721, 0x099A, 0x8722, 0x8722, 0x1C2E, 0x8723, 0x8723, 0x1C20,
+ 0x8724, 0x8724, 0x4853, 0x8725, 0x8725, 0x1C23, 0x8726, 0x8728, 0x4854,
+ 0x8729, 0x8729, 0x1C2A, 0x872A, 0x872D, 0x4857, 0x872E, 0x872E, 0x1C24,
+ 0x872F, 0x8730, 0x485B, 0x8731, 0x8731, 0x1C29, 0x8732, 0x8733, 0x485D,
+ 0x8734, 0x8734, 0x1C28, 0x8735, 0x8736, 0x485F, 0x8737, 0x8737, 0x1C2B,
+ 0x8738, 0x873A, 0x4861, 0x873B, 0x873B, 0x1C21, 0x873C, 0x873D, 0x4864,
+ 0x873E, 0x873E, 0x1C26, 0x873F, 0x873F, 0x1C2C, 0x8740, 0x8746, 0x4866,
+ 0x8747, 0x8747, 0x1091, 0x8748, 0x8748, 0x1C27, 0x8749, 0x8749, 0x04BC,
+ 0x874A, 0x874B, 0x486D, 0x874C, 0x874C, 0x1C34, 0x874D, 0x874D, 0x486F,
+ 0x874E, 0x874E, 0x0F76, 0x874F, 0x8752, 0x4870, 0x8753, 0x8753, 0x1C37,
+ 0x8754, 0x8754, 0x4874, 0x8755, 0x8755, 0x212E, 0x8756, 0x8756, 0x4875,
+ 0x8757, 0x8757, 0x07DD, 0x8758, 0x8758, 0x4876, 0x8759, 0x8759, 0x1C3B,
+ 0x875A, 0x875F, 0x4877, 0x8760, 0x8760, 0x1C32, 0x8761, 0x8762, 0x487D,
+ 0x8763, 0x8763, 0x1C38, 0x8764, 0x8764, 0x1C3A, 0x8765, 0x8765, 0x1C3C,
+ 0x8766, 0x8766, 0x21B2, 0x8767, 0x876D, 0x487F, 0x876E, 0x876E, 0x1C35,
+ 0x876F, 0x876F, 0x4886, 0x8770, 0x8770, 0x1C33, 0x8771, 0x8773, 0x4887,
+ 0x8774, 0x8774, 0x07B2, 0x8775, 0x8775, 0x488A, 0x8776, 0x8776, 0x05DC,
+ 0x8777, 0x8777, 0x488B, 0x8778, 0x8778, 0x219E, 0x8779, 0x877A, 0x488C,
+ 0x877B, 0x877B, 0x1C31, 0x877C, 0x877C, 0x1C39, 0x877D, 0x877E, 0x1C2F,
+ 0x877F, 0x8781, 0x488E, 0x8782, 0x8782, 0x1C2D, 0x8783, 0x8783, 0x1C46,
+ 0x8784, 0x8784, 0x25DC, 0x8785, 0x8785, 0x1C43, 0x8786, 0x8787, 0x4891,
+ 0x8788, 0x8788, 0x1C42, 0x8789, 0x878A, 0x4893, 0x878B, 0x878B, 0x1C36,
+ 0x878C, 0x878C, 0x4895, 0x878D, 0x878D, 0x0CB5, 0x878E, 0x8792, 0x4896,
+ 0x8793, 0x8793, 0x1C3D, 0x8794, 0x8796, 0x489B, 0x8797, 0x8797, 0x1C45,
+ 0x8798, 0x879D, 0x489E, 0x879E, 0x879E, 0x206C, 0x879F, 0x879F, 0x0AFD,
+ 0x87A0, 0x87A1, 0x48A4, 0x87A2, 0x87A2, 0x2226, 0x87A3, 0x87A7, 0x48A6,
+ 0x87A8, 0x87A8, 0x1C3F, 0x87A9, 0x87AA, 0x48AB, 0x87AB, 0x87AB, 0x1C47,
+ 0x87AC, 0x87AC, 0x1C49, 0x87AD, 0x87AD, 0x1C44, 0x87AE, 0x87AE, 0x48AD,
+ 0x87AF, 0x87AF, 0x1C3E, 0x87B0, 0x87B2, 0x48AE, 0x87B3, 0x87B3, 0x1C4B,
+ 0x87B4, 0x87B4, 0x48B1, 0x87B5, 0x87B5, 0x1C4A, 0x87B6, 0x87B9, 0x48B2,
+ 0x87BA, 0x87BA, 0x0A84, 0x87BB, 0x87BB, 0x25E0, 0x87BC, 0x87BC, 0x48B6,
+ 0x87BD, 0x87BD, 0x1C4E, 0x87BE, 0x87BF, 0x48B7, 0x87C0, 0x87C0, 0x1C50,
+ 0x87C1, 0x87C3, 0x48B9, 0x87C4, 0x87C4, 0x227B, 0x87C5, 0x87C5, 0x48BC,
+ 0x87C6, 0x87C6, 0x1C41, 0x87C7, 0x87C7, 0x48BD, 0x87C8, 0x87C8, 0x25DE,
+ 0x87C9, 0x87C9, 0x48BE, 0x87CA, 0x87CA, 0x1C51, 0x87CB, 0x87CB, 0x1C4C,
+ 0x87CC, 0x87CD, 0x48BF, 0x87CE, 0x87CE, 0x25E1, 0x87CF, 0x87D0, 0x48C1,
+ 0x87D1, 0x87D1, 0x1C4F, 0x87D2, 0x87D2, 0x1C40, 0x87D3, 0x87D3, 0x1C4D,
+ 0x87D4, 0x87DA, 0x48C3, 0x87DB, 0x87DB, 0x1C52, 0x87DC, 0x87DF, 0x48CA,
+ 0x87E0, 0x87E0, 0x1C54, 0x87E1, 0x87E2, 0x48CE, 0x87E3, 0x87E3, 0x25D5,
+ 0x87E4, 0x87E4, 0x48D0, 0x87E5, 0x87E5, 0x1C48, 0x87E6, 0x87E9, 0x48D1,
+ 0x87EA, 0x87EA, 0x1C53, 0x87EB, 0x87EB, 0x48D5, 0x87EC, 0x87EC, 0x1E6B,
+ 0x87ED, 0x87ED, 0x48D6, 0x87EE, 0x87EE, 0x1C55, 0x87EF, 0x87EF, 0x25DB,
+ 0x87F0, 0x87F1, 0x48D7, 0x87F2, 0x87F2, 0x1E89, 0x87F3, 0x87F5, 0x48D9,
+ 0x87F6, 0x87F6, 0x25D9, 0x87F7, 0x87F8, 0x48DC, 0x87F9, 0x87F9, 0x0F82,
+ 0x87FA, 0x87FA, 0x48DE, 0x87FB, 0x87FB, 0x2211, 0x87FC, 0x87FD, 0x48DF,
+ 0x87FE, 0x87FE, 0x1C58, 0x87FF, 0x87FF, 0x48E1, 0x8800, 0x8802, 0x48E2,
+ 0x8803, 0x8803, 0x130D, 0x8804, 0x8804, 0x48E5, 0x8805, 0x8805, 0x2229,
+ 0x8806, 0x8806, 0x25D6, 0x8807, 0x8809, 0x48E6, 0x880A, 0x880A, 0x1C59,
+ 0x880B, 0x880F, 0x48E9, 0x8810, 0x8810, 0x25DD, 0x8811, 0x8811, 0x25DF,
+ 0x8812, 0x8812, 0x48EE, 0x8813, 0x8813, 0x1C57, 0x8814, 0x8814, 0x48EF,
+ 0x8815, 0x8815, 0x0CBF, 0x8816, 0x8816, 0x1C56, 0x8817, 0x881A, 0x48F0,
+ 0x881B, 0x881B, 0x1C5A, 0x881C, 0x881E, 0x48F4, 0x881F, 0x881F, 0x1FEF,
+ 0x8820, 0x8820, 0x48F7, 0x8821, 0x8821, 0x1C5B, 0x8822, 0x8822, 0x0543,
+ 0x8823, 0x8823, 0x25D8, 0x8824, 0x8830, 0x48F8, 0x8831, 0x8831, 0x1F29,
+ 0x8832, 0x8832, 0x1A8D, 0x8833, 0x8835, 0x4905, 0x8836, 0x8836, 0x1E5B,
+ 0x8837, 0x8838, 0x4908, 0x8839, 0x8839, 0x1C5C, 0x883A, 0x883A, 0x490A,
+ 0x883B, 0x883B, 0x2076, 0x883C, 0x883C, 0x1C5D, 0x883D, 0x883F, 0x490B,
+ 0x8840, 0x8840, 0x0FD3, 0x8841, 0x8843, 0x490E, 0x8844, 0x8844, 0x1CAA,
+ 0x8845, 0x8845, 0x0F91, 0x8846, 0x8846, 0x2297, 0x8847, 0x8849, 0x4911,
+ 0x884A, 0x884A, 0x2690, 0x884B, 0x884B, 0x4914, 0x884C, 0x884C, 0x0F9B,
+ 0x884D, 0x884D, 0x1005, 0x884E, 0x8852, 0x4915, 0x8853, 0x8853, 0x213F,
+ 0x8854, 0x8854, 0x0F3B, 0x8855, 0x8856, 0x491A, 0x8857, 0x8857, 0x08A7,
+ 0x8858, 0x8858, 0x491C, 0x8859, 0x8859, 0x0FEC, 0x885A, 0x885A, 0x491D,
+ 0x885B, 0x885B, 0x2198, 0x885C, 0x885C, 0x491E, 0x885D, 0x885D, 0x1E88,
+ 0x885E, 0x8860, 0x491F, 0x8861, 0x8861, 0x0799, 0x8862, 0x8862, 0x15ED,
+ 0x8863, 0x8863, 0x1049, 0x8864, 0x8864, 0x1BA6, 0x8865, 0x8865, 0x0480,
+ 0x8866, 0x8867, 0x4922, 0x8868, 0x8868, 0x0456, 0x8869, 0x8869, 0x1BA7,
+ 0x886A, 0x886A, 0x4924, 0x886B, 0x886B, 0x0CF9, 0x886C, 0x886C, 0x04E9,
+ 0x886D, 0x886D, 0x4925, 0x886E, 0x886E, 0x1306, 0x886F, 0x886F, 0x4926,
+ 0x8870, 0x8870, 0x0D9A, 0x8871, 0x8871, 0x4927, 0x8872, 0x8872, 0x1BA8,
+ 0x8873, 0x8876, 0x4928, 0x8877, 0x8877, 0x11D3, 0x8878, 0x8878, 0x492C,
+ 0x8879, 0x8879, 0x228C, 0x887A, 0x887C, 0x492D, 0x887D, 0x887D, 0x1BA9,
+ 0x887E, 0x887E, 0x1CBE, 0x887F, 0x887F, 0x1BAA, 0x8880, 0x8880, 0x4930,
+ 0x8881, 0x8881, 0x10EF, 0x8882, 0x8882, 0x1BAB, 0x8883, 0x8883, 0x4931,
+ 0x8884, 0x8884, 0x03CB, 0x8885, 0x8885, 0x1CBF, 0x8886, 0x8887, 0x4932,
+ 0x8888, 0x8888, 0x1CC0, 0x8889, 0x888A, 0x4934, 0x888B, 0x888B, 0x057F,
+ 0x888C, 0x888C, 0x4936, 0x888D, 0x888D, 0x0B9C, 0x888E, 0x8891, 0x4937,
+ 0x8892, 0x8892, 0x0E0E, 0x8893, 0x8895, 0x493B, 0x8896, 0x8896, 0x0FAF,
+ 0x8897, 0x889B, 0x493E, 0x889C, 0x889C, 0x0E91, 0x889D, 0x88A1, 0x4943,
+ 0x88A2, 0x88A2, 0x1BAC, 0x88A3, 0x88A3, 0x4948, 0x88A4, 0x88A4, 0x1307,
+ 0x88A5, 0x88AA, 0x4949, 0x88AB, 0x88AB, 0x0424, 0x88AC, 0x88AC, 0x494F,
+ 0x88AD, 0x88AD, 0x0F1B, 0x88AE, 0x88B0, 0x4950, 0x88B1, 0x88B1, 0x069F,
+ 0x88B2, 0x88B6, 0x4953, 0x88B7, 0x88B7, 0x1BAE, 0x88B8, 0x88BB, 0x4958,
+ 0x88BC, 0x88BC, 0x1BAF, 0x88BD, 0x88C0, 0x495C, 0x88C1, 0x88C1, 0x048A,
+ 0x88C2, 0x88C2, 0x0A1A, 0x88C3, 0x88C4, 0x4960, 0x88C5, 0x88C5, 0x120D,
+ 0x88C6, 0x88C6, 0x1BAD, 0x88C7, 0x88C8, 0x4962, 0x88C9, 0x88C9, 0x1BB0,
+ 0x88CA, 0x88CA, 0x25F1, 0x88CB, 0x88CD, 0x4964, 0x88CE, 0x88CE, 0x1BB2,
+ 0x88CF, 0x88CF, 0x200C, 0x88D0, 0x88D1, 0x4967, 0x88D2, 0x88D2, 0x130A,
+ 0x88D3, 0x88D3, 0x4969, 0x88D4, 0x88D4, 0x1068, 0x88D5, 0x88D5, 0x10E6,
+ 0x88D6, 0x88D7, 0x496A, 0x88D8, 0x88D8, 0x1CC1, 0x88D9, 0x88D9, 0x0C94,
+ 0x88DA, 0x88DB, 0x496C, 0x88DC, 0x88DC, 0x1E58, 0x88DD, 0x88DD, 0x22AC,
+ 0x88DE, 0x88DE, 0x496E, 0x88DF, 0x88DF, 0x1CC2, 0x88E0, 0x88E1, 0x496F,
+ 0x88E2, 0x88E2, 0x1BB1, 0x88E3, 0x88E3, 0x1BB3, 0x88E4, 0x88E4, 0x0970,
+ 0x88E5, 0x88E5, 0x1BB4, 0x88E6, 0x88E7, 0x4971, 0x88E8, 0x88E8, 0x1BB8,
+ 0x88E9, 0x88EF, 0x4973, 0x88F0, 0x88F0, 0x1BBA, 0x88F1, 0x88F1, 0x1BB5,
+ 0x88F2, 0x88F2, 0x497A, 0x88F3, 0x88F3, 0x0D0A, 0x88F4, 0x88F4, 0x0BA2,
+ 0x88F5, 0x88F7, 0x497B, 0x88F8, 0x88F8, 0x0A8A, 0x88F9, 0x88F9, 0x0755,
+ 0x88FA, 0x88FB, 0x497E, 0x88FC, 0x88FC, 0x1BB7, 0x88FD, 0x88FD, 0x26A7,
+ 0x88FE, 0x88FE, 0x1BB9, 0x88FF, 0x88FF, 0x4980, 0x8900, 0x8901, 0x4981,
+ 0x8902, 0x8902, 0x072C, 0x8903, 0x8906, 0x4983, 0x8907, 0x8907, 0x2676,
+ 0x8908, 0x8909, 0x4987, 0x890A, 0x890A, 0x1BBF, 0x890B, 0x890F, 0x4989,
+ 0x8910, 0x8910, 0x078D, 0x8911, 0x8911, 0x498E, 0x8912, 0x8912, 0x0408,
+ 0x8913, 0x8913, 0x1BBD, 0x8914, 0x8918, 0x498F, 0x8919, 0x8919, 0x1BBC,
+ 0x891A, 0x891A, 0x1BB6, 0x891B, 0x891B, 0x1BBE, 0x891C, 0x8920, 0x4994,
+ 0x8921, 0x8921, 0x1BBB, 0x8922, 0x8924, 0x4999, 0x8925, 0x8925, 0x0CC7,
+ 0x8926, 0x8929, 0x499C, 0x892A, 0x892A, 0x0E7B, 0x892B, 0x892B, 0x1BC1,
+ 0x892C, 0x892F, 0x49A0, 0x8930, 0x8930, 0x1739, 0x8931, 0x8931, 0x49A4,
+ 0x8932, 0x8932, 0x1FE1, 0x8933, 0x8933, 0x25BB, 0x8934, 0x8934, 0x1BC0,
+ 0x8935, 0x8935, 0x49A5, 0x8936, 0x8936, 0x1BC2, 0x8937, 0x8937, 0x49A6,
+ 0x8938, 0x8938, 0x25BE, 0x8939, 0x893A, 0x49A7, 0x893B, 0x893B, 0x22DD,
+ 0x893C, 0x8940, 0x49A9, 0x8941, 0x8941, 0x1BC3, 0x8942, 0x8943, 0x49AE,
+ 0x8944, 0x8944, 0x0F52, 0x8945, 0x8946, 0x49B0, 0x8947, 0x8947, 0x25BD,
+ 0x8948, 0x8955, 0x49B2, 0x8956, 0x8956, 0x1E2A, 0x8957, 0x895C, 0x49C0,
+ 0x895D, 0x895D, 0x25BC, 0x895E, 0x895E, 0x1CC3, 0x895F, 0x895F, 0x08C4,
+ 0x8960, 0x8960, 0x25BA, 0x8961, 0x8963, 0x49C6, 0x8964, 0x8964, 0x25BF,
+ 0x8965, 0x8965, 0x49C9, 0x8966, 0x8966, 0x1BC4, 0x8967, 0x8969, 0x49CA,
+ 0x896A, 0x896A, 0x2187, 0x896B, 0x896B, 0x49CD, 0x896C, 0x896C, 0x266B,
+ 0x896D, 0x896E, 0x49CE, 0x896F, 0x896F, 0x1E7F, 0x8970, 0x8971, 0x49D0,
+ 0x8972, 0x8972, 0x21AD, 0x8973, 0x897A, 0x49D2, 0x897B, 0x897B, 0x1BC5,
+ 0x897C, 0x897E, 0x49DA, 0x897F, 0x897F, 0x0F06, 0x8980, 0x8980, 0x49DD,
+ 0x8981, 0x8981, 0x1031, 0x8982, 0x8982, 0x49DE, 0x8983, 0x8983, 0x1BDF,
+ 0x8984, 0x8985, 0x49DF, 0x8986, 0x8986, 0x06AD, 0x8987, 0x898A, 0x49E1,
+ 0x898B, 0x898B, 0x1F96, 0x898C, 0x898E, 0x49E5, 0x898F, 0x898F, 0x1F32,
+ 0x8990, 0x8992, 0x49E8, 0x8993, 0x8993, 0x2084, 0x8994, 0x8995, 0x49EB,
+ 0x8996, 0x8996, 0x2136, 0x8997, 0x8997, 0x49ED, 0x8998, 0x8998, 0x24B8,
+ 0x8999, 0x89A0, 0x49EE, 0x89A1, 0x89A1, 0x24BA, 0x89A2, 0x89A5, 0x49F6,
+ 0x89A6, 0x89A6, 0x24BC, 0x89A7, 0x89A9, 0x49FA, 0x89AA, 0x89AA, 0x20E4,
+ 0x89AB, 0x89AB, 0x49FD, 0x89AC, 0x89AC, 0x24B9, 0x89AD, 0x89AE, 0x49FE,
+ 0x89AF, 0x89AF, 0x24BD, 0x89B0, 0x89B1, 0x4A00, 0x89B2, 0x89B2, 0x24BE,
+ 0x89B3, 0x89B6, 0x4A02, 0x89B7, 0x89B7, 0x24BF, 0x89B8, 0x89B9, 0x4A06,
+ 0x89BA, 0x89BA, 0x1FD2, 0x89BB, 0x89BC, 0x4A08, 0x89BD, 0x89BD, 0x1FFD,
+ 0x89BE, 0x89BE, 0x4A0A, 0x89BF, 0x89BF, 0x24BB, 0x89C0, 0x89C0, 0x1F2D,
+ 0x89C1, 0x89C1, 0x086E, 0x89C2, 0x89C2, 0x0734, 0x89C3, 0x89C3, 0x4A0B,
+ 0x89C4, 0x89C4, 0x073F, 0x89C5, 0x89C5, 0x0ADE, 0x89C6, 0x89C6, 0x0D6A,
+ 0x89C7, 0x89C7, 0x193A, 0x89C8, 0x89C8, 0x09AB, 0x89C9, 0x89C9, 0x0924,
+ 0x89CA, 0x89CC, 0x193B, 0x89CD, 0x89CD, 0x4A0C, 0x89CE, 0x89D1, 0x193E,
+ 0x89D2, 0x89D2, 0x0898, 0x89D3, 0x89D5, 0x4A0D, 0x89D6, 0x89D6, 0x1D57,
+ 0x89D7, 0x89D9, 0x4A10, 0x89DA, 0x89DA, 0x1D59, 0x89DB, 0x89DB, 0x4A13,
+ 0x89DC, 0x89DC, 0x1D5A, 0x89DD, 0x89DD, 0x4A14, 0x89DE, 0x89DE, 0x1D58,
+ 0x89DF, 0x89E2, 0x4A15, 0x89E3, 0x89E3, 0x08B3, 0x89E4, 0x89E4, 0x4A19,
+ 0x89E5, 0x89E5, 0x1D5B, 0x89E6, 0x89E6, 0x0528, 0x89E7, 0x89EA, 0x4A1A,
+ 0x89EB, 0x89EB, 0x1D5C, 0x89EC, 0x89EE, 0x4A1E, 0x89EF, 0x89EF, 0x1D5D,
+ 0x89F0, 0x89F2, 0x4A21, 0x89F3, 0x89F3, 0x19C0, 0x89F4, 0x89F4, 0x2609,
+ 0x89F5, 0x89F5, 0x4A24, 0x89F6, 0x89F6, 0x260A, 0x89F7, 0x89F7, 0x4A25,
+ 0x89F8, 0x89F8, 0x1E94, 0x89F9, 0x89FF, 0x4A26, 0x8A00, 0x8A00, 0x0FFD,
+ 0x8A01, 0x8A01, 0x22DF, 0x8A02, 0x8A02, 0x1ECB, 0x8A03, 0x8A03, 0x1F0D,
+ 0x8A04, 0x8A06, 0x4A2D, 0x8A07, 0x8A07, 0x12FE, 0x8A08, 0x8A08, 0x1F77,
+ 0x8A09, 0x8A09, 0x4A30, 0x8A0A, 0x8A0A, 0x21EB, 0x8A0B, 0x8A0B, 0x4A31,
+ 0x8A0C, 0x8A0C, 0x22E1, 0x8A0D, 0x8A0D, 0x4A32, 0x8A0E, 0x8A0E, 0x216F,
+ 0x8A0F, 0x8A0F, 0x4A33, 0x8A10, 0x8A10, 0x22E0, 0x8A11, 0x8A12, 0x4A34,
+ 0x8A13, 0x8A13, 0x21EA, 0x8A14, 0x8A14, 0x4A36, 0x8A15, 0x8A15, 0x22E2,
+ 0x8A16, 0x8A16, 0x20CB, 0x8A17, 0x8A17, 0x4A37, 0x8A18, 0x8A18, 0x1F78,
+ 0x8A19, 0x8A1A, 0x4A38, 0x8A1B, 0x8A1B, 0x1EE2, 0x8A1C, 0x8A1C, 0x4A3A,
+ 0x8A1D, 0x8A1D, 0x21F2, 0x8A1E, 0x8A1E, 0x4A3B, 0x8A1F, 0x8A1F, 0x2150,
+ 0x8A20, 0x8A22, 0x4A3C, 0x8A23, 0x8A23, 0x1FD3, 0x8A24, 0x8A24, 0x4A3F,
+ 0x8A25, 0x8A25, 0x22E5, 0x8A26, 0x8A29, 0x4A40, 0x8A2A, 0x8A2A, 0x1EF2,
+ 0x8A2B, 0x8A2C, 0x4A44, 0x8A2D, 0x8A2D, 0x211F, 0x8A2E, 0x8A30, 0x4A46,
+ 0x8A31, 0x8A31, 0x21DD, 0x8A32, 0x8A33, 0x4A49, 0x8A34, 0x8A34, 0x2154,
+ 0x8A35, 0x8A35, 0x4A4B, 0x8A36, 0x8A36, 0x22E7, 0x8A37, 0x8A39, 0x4A4C,
+ 0x8A3A, 0x8A3A, 0x2282, 0x8A3B, 0x8A3D, 0x4A4F, 0x8A3E, 0x8A3E, 0x1D5E,
+ 0x8A3F, 0x8A40, 0x4A52, 0x8A41, 0x8A41, 0x22E6, 0x8A42, 0x8A45, 0x4A54,
+ 0x8A46, 0x8A46, 0x22E8, 0x8A47, 0x8A47, 0x4A58, 0x8A48, 0x8A48, 0x1A84,
+ 0x8A49, 0x8A4D, 0x4A59, 0x8A4E, 0x8A4E, 0x22E4, 0x8A4F, 0x8A4F, 0x4A5E,
+ 0x8A50, 0x8A50, 0x226A, 0x8A51, 0x8A51, 0x4A5F, 0x8A52, 0x8A52, 0x22EB,
+ 0x8A53, 0x8A53, 0x4A60, 0x8A54, 0x8A54, 0x22E9, 0x8A55, 0x8A55, 0x20BD,
+ 0x8A56, 0x8A57, 0x4A61, 0x8A58, 0x8A58, 0x22EA, 0x8A59, 0x8A5A, 0x4A63,
+ 0x8A5B, 0x8A5B, 0x22BD, 0x8A5C, 0x8A5D, 0x4A65, 0x8A5E, 0x8A5E, 0x1E9E,
+ 0x8A5F, 0x8A60, 0x4A67, 0x8A61, 0x8A61, 0x22F6, 0x8A62, 0x8A62, 0x21E7,
+ 0x8A63, 0x8A63, 0x2216, 0x8A64, 0x8A65, 0x4A69, 0x8A66, 0x8A66, 0x2137,
+ 0x8A67, 0x8A68, 0x4A6B, 0x8A69, 0x8A69, 0x212C, 0x8A6A, 0x8A6A, 0x4A6D,
+ 0x8A6B, 0x8A6B, 0x1E68, 0x8A6C, 0x8A6C, 0x22F2, 0x8A6D, 0x8A6D, 0x1F37,
+ 0x8A6E, 0x8A6E, 0x22F3, 0x8A6F, 0x8A6F, 0x4A6E, 0x8A70, 0x8A70, 0x22EF,
+ 0x8A71, 0x8A71, 0x1F50, 0x8A72, 0x8A72, 0x1F10, 0x8A73, 0x8A73, 0x21C8,
+ 0x8A74, 0x8A74, 0x4A6F, 0x8A75, 0x8A75, 0x22F1, 0x8A76, 0x8A78, 0x4A70,
+ 0x8A79, 0x8A79, 0x1153, 0x8A7A, 0x8A7B, 0x4A73, 0x8A7C, 0x8A7C, 0x22F0,
+ 0x8A7D, 0x8A7E, 0x4A75, 0x8A7F, 0x8A7F, 0x22EE, 0x8A80, 0x8A83, 0x4A77,
+ 0x8A84, 0x8A84, 0x22ED, 0x8A85, 0x8A85, 0x229E, 0x8A86, 0x8A86, 0x22EC,
+ 0x8A87, 0x8A87, 0x1FE2, 0x8A88, 0x8A88, 0x4A7B, 0x8A89, 0x8A89, 0x10E3,
+ 0x8A8A, 0x8A8A, 0x0E2F, 0x8A8B, 0x8A8C, 0x4A7C, 0x8A8D, 0x8A8D, 0x20FE,
+ 0x8A8E, 0x8A90, 0x4A7E, 0x8A91, 0x8A92, 0x22F9, 0x8A93, 0x8A93, 0x0D5B,
+ 0x8A94, 0x8A94, 0x4A81, 0x8A95, 0x8A95, 0x1EAF, 0x8A96, 0x8A97, 0x4A82,
+ 0x8A98, 0x8A98, 0x2236, 0x8A99, 0x8A99, 0x4A84, 0x8A9A, 0x8A9A, 0x22F7,
+ 0x8A9B, 0x8A9D, 0x4A85, 0x8A9E, 0x8A9E, 0x223D, 0x8A9F, 0x8A9F, 0x4A88,
+ 0x8AA0, 0x8AA0, 0x1E82, 0x8AA1, 0x8AA1, 0x1FB6, 0x8AA2, 0x8AA2, 0x4A89,
+ 0x8AA3, 0x8AA3, 0x21A4, 0x8AA4, 0x8AA4, 0x21AA, 0x8AA5, 0x8AA5, 0x22F8,
+ 0x8AA6, 0x8AA6, 0x2151, 0x8AA7, 0x8AA7, 0x4A8A, 0x8AA8, 0x8AA8, 0x1F60,
+ 0x8AA9, 0x8AAB, 0x4A8B, 0x8AAC, 0x8AAC, 0x2147, 0x8AAD, 0x8AAF, 0x4A8E,
+ 0x8AB0, 0x8AB0, 0x2145, 0x8AB1, 0x8AB1, 0x4A91, 0x8AB2, 0x8AB2, 0x1FDC,
+ 0x8AB3, 0x8AB5, 0x4A92, 0x8AB6, 0x8AB6, 0x2301, 0x8AB7, 0x8AB8, 0x4A95,
+ 0x8AB9, 0x8AB9, 0x1EF5, 0x8ABA, 0x8ABB, 0x4A97, 0x8ABC, 0x8ABC, 0x2218,
+ 0x8ABD, 0x8ABE, 0x4A99, 0x8ABF, 0x8ABF, 0x1EC6, 0x8AC0, 0x8AC1, 0x4A9B,
+ 0x8AC2, 0x8AC2, 0x2300, 0x8AC3, 0x8AC3, 0x4A9D, 0x8AC4, 0x8AC4, 0x22B4,
+ 0x8AC5, 0x8AC6, 0x4A9E, 0x8AC7, 0x8AC7, 0x2169, 0x8AC8, 0x8AC8, 0x4AA0,
+ 0x8AC9, 0x8AC9, 0x22FD, 0x8ACA, 0x8ACA, 0x4AA1, 0x8ACB, 0x8ACB, 0x20EA,
+ 0x8ACC, 0x8ACC, 0x4AA2, 0x8ACD, 0x8ACD, 0x22F4, 0x8ACE, 0x8ACE, 0x4AA3,
+ 0x8ACF, 0x8ACF, 0x22FB, 0x8AD0, 0x8AD0, 0x4AA4, 0x8AD1, 0x8AD1, 0x22FC,
+ 0x8AD2, 0x8AD2, 0x2027, 0x8AD3, 0x8AD5, 0x4AA5, 0x8AD6, 0x8AD6, 0x2060,
+ 0x8AD7, 0x8AD7, 0x22FF, 0x8AD8, 0x8ADA, 0x4AA8, 0x8ADB, 0x8ADB, 0x22FE,
+ 0x8ADC, 0x8ADC, 0x1EC7, 0x8ADD, 0x8ADD, 0x4AAB, 0x8ADE, 0x8ADE, 0x230C,
+ 0x8ADF, 0x8AE1, 0x4AAC, 0x8AE2, 0x8AE2, 0x22F5, 0x8AE3, 0x8AE3, 0x4AAF,
+ 0x8AE4, 0x8AE4, 0x2306, 0x8AE5, 0x8AE5, 0x4AB0, 0x8AE6, 0x8AE6, 0x230A,
+ 0x8AE7, 0x8AE7, 0x21D3, 0x8AE8, 0x8AEA, 0x4AB1, 0x8AEB, 0x8AEB, 0x2303,
+ 0x8AEC, 0x8AEC, 0x4AB4, 0x8AED, 0x8AED, 0x2307, 0x8AEE, 0x8AEE, 0x230B,
+ 0x8AEF, 0x8AF0, 0x4AB5, 0x8AF1, 0x8AF1, 0x1F5F, 0x8AF2, 0x8AF2, 0x4AB7,
+ 0x8AF3, 0x8AF3, 0x2309, 0x8AF4, 0x8AF5, 0x4AB8, 0x8AF6, 0x8AF6, 0x2302,
+ 0x8AF7, 0x8AF7, 0x1F04, 0x8AF8, 0x8AF8, 0x229D, 0x8AF9, 0x8AF9, 0x4ABA,
+ 0x8AFA, 0x8AFA, 0x21FB, 0x8AFB, 0x8AFB, 0x4ABB, 0x8AFC, 0x8AFC, 0x2308,
+ 0x8AFD, 0x8AFD, 0x4ABC, 0x8AFE, 0x8AFE, 0x20AC, 0x8AFF, 0x8AFF, 0x4ABD,
+ 0x8B00, 0x8B00, 0x208E, 0x8B01, 0x8B01, 0x2305, 0x8B02, 0x8B02, 0x2197,
+ 0x8B03, 0x8B03, 0x4ABE, 0x8B04, 0x8B04, 0x2171, 0x8B05, 0x8B05, 0x2298,
+ 0x8B06, 0x8B06, 0x4ABF, 0x8B07, 0x8B07, 0x173C, 0x8B08, 0x8B09, 0x4AC0,
+ 0x8B0A, 0x8B0A, 0x1F57, 0x8B0B, 0x8B0D, 0x4AC2, 0x8B0E, 0x8B0E, 0x2082,
+ 0x8B0F, 0x8B0F, 0x4AC5, 0x8B10, 0x8B10, 0x2311, 0x8B11, 0x8B13, 0x4AC6,
+ 0x8B14, 0x8B14, 0x2304, 0x8B15, 0x8B15, 0x4AC9, 0x8B16, 0x8B16, 0x230F,
+ 0x8B17, 0x8B17, 0x1E35, 0x8B18, 0x8B18, 0x4ACA, 0x8B19, 0x8B19, 0x20D1,
+ 0x8B1A, 0x8B1A, 0x2310, 0x8B1B, 0x8B1B, 0x1FA3, 0x8B1C, 0x8B1C, 0x4ACB,
+ 0x8B1D, 0x8B1D, 0x21D6, 0x8B1E, 0x8B20, 0x4ACC, 0x8B21, 0x8B21, 0x2206,
+ 0x8B22, 0x8B25, 0x4ACF, 0x8B26, 0x8B26, 0x1D5F, 0x8B27, 0x8B27, 0x4AD3,
+ 0x8B28, 0x8B28, 0x230D, 0x8B29, 0x8B2A, 0x4AD4, 0x8B2B, 0x8B2B, 0x2312,
+ 0x8B2C, 0x8B2C, 0x208D, 0x8B2D, 0x8B2D, 0x2313, 0x8B2E, 0x8B32, 0x4AD6,
+ 0x8B33, 0x8B33, 0x22E3, 0x8B34, 0x8B38, 0x4ADB, 0x8B39, 0x8B39, 0x1FBA,
+ 0x8B3A, 0x8B3D, 0x4AE0, 0x8B3E, 0x8B3E, 0x2078, 0x8B3F, 0x8B48, 0x4AE4,
+ 0x8B49, 0x8B49, 0x2288, 0x8B4A, 0x8B4D, 0x4AEE, 0x8B4E, 0x8B4E, 0x2316,
+ 0x8B4F, 0x8B4F, 0x1F6B, 0x8B50, 0x8B55, 0x4AF2, 0x8B56, 0x8B56, 0x2314,
+ 0x8B57, 0x8B57, 0x4AF8, 0x8B58, 0x8B58, 0x2130, 0x8B59, 0x8B59, 0x2315,
+ 0x8B5A, 0x8B5A, 0x2168, 0x8B5B, 0x8B5B, 0x4AF9, 0x8B5C, 0x8B5C, 0x20C4,
+ 0x8B5D, 0x8B65, 0x4AFA, 0x8B66, 0x8B66, 0x08DE, 0x8B67, 0x8B6A, 0x4B03,
+ 0x8B6B, 0x8B6B, 0x2318, 0x8B6C, 0x8B6C, 0x0BC8, 0x8B6D, 0x8B6E, 0x4B07,
+ 0x8B6F, 0x8B6F, 0x2219, 0x8B70, 0x8B70, 0x2217, 0x8B71, 0x8B73, 0x4B09,
+ 0x8B74, 0x8B74, 0x20D5, 0x8B75, 0x8B76, 0x4B0C, 0x8B77, 0x8B77, 0x1F4A,
+ 0x8B78, 0x8B7C, 0x4B0E, 0x8B7D, 0x8B7D, 0x2240, 0x8B7E, 0x8B7F, 0x4B13,
+ 0x8B80, 0x8B80, 0x1ED3, 0x8B81, 0x8B89, 0x4B15, 0x8B8A, 0x8B8A, 0x1E49,
+ 0x8B8B, 0x8B8D, 0x4B1E, 0x8B8E, 0x8B8E, 0x261B, 0x8B8F, 0x8B91, 0x4B21,
+ 0x8B92, 0x8B92, 0x1E6D, 0x8B93, 0x8B93, 0x20F8, 0x8B94, 0x8B94, 0x4B24,
+ 0x8B95, 0x8B95, 0x1FFB, 0x8B96, 0x8B96, 0x2319, 0x8B97, 0x8B9B, 0x4B25,
+ 0x8B9C, 0x8B9C, 0x230E, 0x8B9D, 0x8B9D, 0x4B2A, 0x8B9E, 0x8B9E, 0x2317,
+ 0x8B9F, 0x8B9F, 0x4B2B, 0x8BA0, 0x8BA0, 0x1317, 0x8BA1, 0x8BA1, 0x0839,
+ 0x8BA2, 0x8BA2, 0x05E8, 0x8BA3, 0x8BA3, 0x06B7, 0x8BA4, 0x8BA4, 0x0CAA,
+ 0x8BA5, 0x8BA5, 0x0818, 0x8BA6, 0x8BA7, 0x1318, 0x8BA8, 0x8BA8, 0x0E29,
+ 0x8BA9, 0x8BA9, 0x0C9E, 0x8BAA, 0x8BAA, 0x131A, 0x8BAB, 0x8BAB, 0x0C1C,
+ 0x8BAC, 0x8BAC, 0x4B2C, 0x8BAD, 0x8BAD, 0x0FDE, 0x8BAE, 0x8BAE, 0x1070,
+ 0x8BAF, 0x8BAF, 0x0FDF, 0x8BB0, 0x8BB0, 0x083A, 0x8BB1, 0x8BB1, 0x4B2D,
+ 0x8BB2, 0x8BB2, 0x0883, 0x8BB3, 0x8BB3, 0x07F9, 0x8BB4, 0x8BB5, 0x131B,
+ 0x8BB6, 0x8BB6, 0x0FF1, 0x8BB7, 0x8BB7, 0x131D, 0x8BB8, 0x8BB8, 0x0FB8,
+ 0x8BB9, 0x8BB9, 0x062E, 0x8BBA, 0x8BBA, 0x0A82, 0x8BBB, 0x8BBB, 0x4B2E,
+ 0x8BBC, 0x8BBC, 0x0DC4, 0x8BBD, 0x8BBD, 0x068A, 0x8BBE, 0x8BBE, 0x0D21,
+ 0x8BBF, 0x8BBF, 0x0660, 0x8BC0, 0x8BC0, 0x0926, 0x8BC1, 0x8BC1, 0x11A3,
+ 0x8BC2, 0x8BC3, 0x131E, 0x8BC4, 0x8BC4, 0x0BDF, 0x8BC5, 0x8BC5, 0x1244,
+ 0x8BC6, 0x8BC6, 0x0D4D, 0x8BC7, 0x8BC7, 0x4B2F, 0x8BC8, 0x8BC8, 0x114A,
+ 0x8BC9, 0x8BC9, 0x0DD4, 0x8BCA, 0x8BCA, 0x1190, 0x8BCB, 0x8BCB, 0x1320,
+ 0x8BCC, 0x8BCC, 0x11DE, 0x8BCD, 0x8BCD, 0x054D, 0x8BCE, 0x8BCE, 0x1322,
+ 0x8BCF, 0x8BCF, 0x1321, 0x8BD0, 0x8BD0, 0x4B30, 0x8BD1, 0x8BD1, 0x1072,
+ 0x8BD2, 0x8BD4, 0x1323, 0x8BD5, 0x8BD5, 0x0D6B, 0x8BD6, 0x8BD6, 0x1326,
+ 0x8BD7, 0x8BD7, 0x0D42, 0x8BD8, 0x8BD9, 0x1327, 0x8BDA, 0x8BDA, 0x04F4,
+ 0x8BDB, 0x8BDB, 0x11EE, 0x8BDC, 0x8BDC, 0x1329, 0x8BDD, 0x8BDD, 0x07C5,
+ 0x8BDE, 0x8BDE, 0x058F, 0x8BDF, 0x8BE0, 0x132A, 0x8BE1, 0x8BE1, 0x0747,
+ 0x8BE2, 0x8BE2, 0x0FD8, 0x8BE3, 0x8BE3, 0x106F, 0x8BE4, 0x8BE4, 0x132C,
+ 0x8BE5, 0x8BE5, 0x06BE, 0x8BE6, 0x8BE6, 0x0F57, 0x8BE7, 0x8BE7, 0x04B6,
+ 0x8BE8, 0x8BE9, 0x132D, 0x8BEA, 0x8BEA, 0x4B31, 0x8BEB, 0x8BEB, 0x08BC,
+ 0x8BEC, 0x8BEC, 0x0EEB, 0x8BED, 0x8BED, 0x10D4, 0x8BEE, 0x8BEE, 0x132F,
+ 0x8BEF, 0x8BEF, 0x0F02, 0x8BF0, 0x8BF0, 0x1330, 0x8BF1, 0x8BF1, 0x10BA,
+ 0x8BF2, 0x8BF2, 0x07FA, 0x8BF3, 0x8BF3, 0x1331, 0x8BF4, 0x8BF4, 0x0DAA,
+ 0x8BF5, 0x8BF5, 0x0DC5, 0x8BF6, 0x8BF6, 0x1332, 0x8BF7, 0x8BF7, 0x0C68,
+ 0x8BF8, 0x8BF8, 0x11ED, 0x8BF9, 0x8BF9, 0x1333, 0x8BFA, 0x8BFA, 0x0B76,
+ 0x8BFB, 0x8BFB, 0x0600, 0x8BFC, 0x8BFC, 0x1334, 0x8BFD, 0x8BFD, 0x0669,
+ 0x8BFE, 0x8BFE, 0x095B, 0x8BFF, 0x8BFF, 0x1335, 0x8C00, 0x8C00, 0x1336,
+ 0x8C01, 0x8C01, 0x0DA2, 0x8C02, 0x8C02, 0x1337, 0x8C03, 0x8C03, 0x05D8,
+ 0x8C04, 0x8C04, 0x1338, 0x8C05, 0x8C05, 0x0A0B, 0x8C06, 0x8C06, 0x1218,
+ 0x8C07, 0x8C07, 0x1339, 0x8C08, 0x8C08, 0x0E0B, 0x8C09, 0x8C09, 0x4B32,
+ 0x8C0A, 0x8C0A, 0x1071, 0x8C0B, 0x8C0B, 0x0B14, 0x8C0C, 0x8C0C, 0x133A,
+ 0x8C0D, 0x8C0D, 0x05DE, 0x8C0E, 0x8C0E, 0x07E6, 0x8C0F, 0x8C0F, 0x133B,
+ 0x8C10, 0x8C10, 0x0F7E, 0x8C11, 0x8C12, 0x133C, 0x8C13, 0x8C13, 0x0ECC,
+ 0x8C14, 0x8C16, 0x133E, 0x8C17, 0x8C17, 0x04BE, 0x8C18, 0x8C18, 0x1343,
+ 0x8C19, 0x8C19, 0x1341, 0x8C1A, 0x8C1A, 0x1011, 0x8C1B, 0x8C1B, 0x1342,
+ 0x8C1C, 0x8C1C, 0x0ADA, 0x8C1D, 0x8C1D, 0x1344, 0x8C1E, 0x8C1E, 0x4B33,
+ 0x8C1F, 0x8C21, 0x1345, 0x8C22, 0x8C22, 0x0F86, 0x8C23, 0x8C23, 0x102C,
+ 0x8C24, 0x8C24, 0x0404, 0x8C25, 0x8C25, 0x1348, 0x8C26, 0x8C26, 0x0C28,
+ 0x8C27, 0x8C27, 0x1349, 0x8C28, 0x8C28, 0x08C8, 0x8C29, 0x8C29, 0x0AA6,
+ 0x8C2A, 0x8C2B, 0x134A, 0x8C2C, 0x8C2C, 0x0B02, 0x8C2D, 0x8C2D, 0x0E0A,
+ 0x8C2E, 0x8C2F, 0x134C, 0x8C30, 0x8C30, 0x09A9, 0x8C31, 0x8C31, 0x0BF6,
+ 0x8C32, 0x8C33, 0x134E, 0x8C34, 0x8C34, 0x0C31, 0x8C35, 0x8C36, 0x1350,
+ 0x8C37, 0x8C37, 0x0721, 0x8C38, 0x8C40, 0x4B34, 0x8C41, 0x8C41, 0x0802,
+ 0x8C42, 0x8C45, 0x4B3D, 0x8C46, 0x8C46, 0x05F8, 0x8C47, 0x8C47, 0x1CF6,
+ 0x8C48, 0x8C48, 0x20C8, 0x8C49, 0x8C49, 0x1CF7, 0x8C4A, 0x8C4B, 0x4B41,
+ 0x8C4C, 0x8C4C, 0x0E94, 0x8C4D, 0x8C4F, 0x4B43, 0x8C50, 0x8C50, 0x1EFD,
+ 0x8C51, 0x8C54, 0x4B46, 0x8C55, 0x8C55, 0x1D15, 0x8C56, 0x8C59, 0x4B4A,
+ 0x8C5A, 0x8C5A, 0x1990, 0x8C5B, 0x8C60, 0x4B4E, 0x8C61, 0x8C61, 0x0F60,
+ 0x8C62, 0x8C62, 0x07D4, 0x8C63, 0x8C69, 0x4B54, 0x8C6A, 0x8C6A, 0x0777,
+ 0x8C6B, 0x8C6B, 0x10E8, 0x8C6C, 0x8C72, 0x4B5B, 0x8C73, 0x8C73, 0x15DD,
+ 0x8C74, 0x8C77, 0x4B62, 0x8C78, 0x8C78, 0x1D50, 0x8C79, 0x8C79, 0x0413,
+ 0x8C7A, 0x8C7A, 0x04B9, 0x8C7B, 0x8C81, 0x4B66, 0x8C82, 0x8C82, 0x1D51,
+ 0x8C83, 0x8C84, 0x4B6D, 0x8C85, 0x8C85, 0x1D53, 0x8C86, 0x8C88, 0x4B6F,
+ 0x8C89, 0x8C89, 0x0788, 0x8C8A, 0x8C8A, 0x1D52, 0x8C8B, 0x8C8B, 0x4B72,
+ 0x8C8C, 0x8C8C, 0x0AB7, 0x8C8D, 0x8C93, 0x4B73, 0x8C94, 0x8C94, 0x1D55,
+ 0x8C95, 0x8C97, 0x4B7A, 0x8C98, 0x8C98, 0x1D54, 0x8C99, 0x8C9C, 0x4B7D,
+ 0x8C9D, 0x8C9D, 0x1E3B, 0x8C9E, 0x8C9E, 0x227F, 0x8C9F, 0x8C9F, 0x4B81,
+ 0x8CA0, 0x8CA0, 0x1F0C, 0x8CA1, 0x8CA1, 0x1E59, 0x8CA2, 0x8CA2, 0x1F24,
+ 0x8CA3, 0x8CA6, 0x4B82, 0x8CA7, 0x8CA7, 0x20BA, 0x8CA8, 0x8CA8, 0x1F65,
+ 0x8CA9, 0x8CA9, 0x1EF0, 0x8CAA, 0x8CAA, 0x2164, 0x8CAB, 0x8CAB, 0x1F30,
+ 0x8CAC, 0x8CAC, 0x2261, 0x8CAD, 0x8CAE, 0x4B86, 0x8CAF, 0x8CAF, 0x22A2,
+ 0x8CB0, 0x8CB0, 0x24AB, 0x8CB1, 0x8CB1, 0x4B88, 0x8CB2, 0x8CB2, 0x24AF,
+ 0x8CB3, 0x8CB3, 0x1EE8, 0x8CB4, 0x8CB4, 0x1F39, 0x8CB5, 0x8CB5, 0x4B89,
+ 0x8CB6, 0x8CB6, 0x1E48, 0x8CB7, 0x8CB7, 0x2070, 0x8CB8, 0x8CB8, 0x1EA8,
+ 0x8CB9, 0x8CB9, 0x4B8A, 0x8CBA, 0x8CBA, 0x24AC, 0x8CBB, 0x8CBB, 0x1EF7,
+ 0x8CBC, 0x8CBC, 0x2176, 0x8CBD, 0x8CBD, 0x24AD, 0x8CBE, 0x8CBE, 0x4B8B,
+ 0x8CBF, 0x8CBF, 0x207B, 0x8CC0, 0x8CC0, 0x1F45, 0x8CC1, 0x8CC1, 0x24AA,
+ 0x8CC2, 0x8CC2, 0x204B, 0x8CC3, 0x8CC3, 0x202F, 0x8CC4, 0x8CC4, 0x1F5A,
+ 0x8CC5, 0x8CC5, 0x24B0, 0x8CC6, 0x8CC6, 0x4B8C, 0x8CC7, 0x8CC7, 0x22B7,
+ 0x8CC8, 0x8CC8, 0x1F7F, 0x8CC9, 0x8CC9, 0x4B8D, 0x8CCA, 0x8CCA, 0x2265,
+ 0x8CCB, 0x8CD0, 0x4B8E, 0x8CD1, 0x8CD1, 0x24B2, 0x8CD2, 0x8CD2, 0x211B,
+ 0x8CD3, 0x8CD3, 0x1E51, 0x8CD4, 0x8CD4, 0x4B94, 0x8CD5, 0x8CD5, 0x24B4,
+ 0x8CD6, 0x8CD9, 0x4B95, 0x8CDA, 0x8CDA, 0x24B3, 0x8CDB, 0x8CDB, 0x4B99,
+ 0x8CDC, 0x8CDC, 0x1E9F, 0x8CDD, 0x8CDD, 0x4B9A, 0x8CDE, 0x8CDE, 0x2118,
+ 0x8CDF, 0x8CDF, 0x4B9B, 0x8CE0, 0x8CE0, 0x20B4, 0x8CE1, 0x8CE1, 0x23AF,
+ 0x8CE2, 0x8CE2, 0x21BB, 0x8CE3, 0x8CE3, 0x2072, 0x8CE4, 0x8CE4, 0x1F95,
+ 0x8CE5, 0x8CE5, 0x4B9C, 0x8CE6, 0x8CE6, 0x1F0A, 0x8CE7, 0x8CE7, 0x24B6,
+ 0x8CE8, 0x8CE9, 0x4B9D, 0x8CEA, 0x8CEA, 0x2291, 0x8CEB, 0x8CEB, 0x24B5,
+ 0x8CEC, 0x8CEC, 0x2278, 0x8CED, 0x8CED, 0x1ED4, 0x8CEE, 0x8CF3, 0x4B9F,
+ 0x8CF4, 0x8CF4, 0x1FF3, 0x8CF5, 0x8CF9, 0x4BA5, 0x8CFA, 0x8CFA, 0x22A9,
+ 0x8CFB, 0x8CFB, 0x24B7, 0x8CFC, 0x8CFC, 0x1F28, 0x8CFD, 0x8CFD, 0x2109,
+ 0x8CFE, 0x8CFE, 0x22C7, 0x8CFF, 0x8CFF, 0x4BAA, 0x8D00, 0x8D03, 0x4BAB,
+ 0x8D04, 0x8D04, 0x24AE, 0x8D05, 0x8D05, 0x22B1, 0x8D06, 0x8D07, 0x4BAF,
+ 0x8D08, 0x8D08, 0x2266, 0x8D09, 0x8D09, 0x4BB1, 0x8D0A, 0x8D0A, 0x225B,
+ 0x8D0B, 0x8D0B, 0x22C4, 0x8D0C, 0x8D0C, 0x4BB2, 0x8D0D, 0x8D0D, 0x2115,
+ 0x8D0E, 0x8D0E, 0x4BB3, 0x8D0F, 0x8D0F, 0x222A, 0x8D10, 0x8D10, 0x24B1,
+ 0x8D11, 0x8D15, 0x4BB4, 0x8D16, 0x8D16, 0x213D, 0x8D17, 0x8D1A, 0x4BB9,
+ 0x8D1B, 0x8D1B, 0x1F15, 0x8D1C, 0x8D1C, 0x225C, 0x8D1D, 0x8D1D, 0x041D,
+ 0x8D1E, 0x8D1E, 0x118B, 0x8D1F, 0x8D1F, 0x06B5, 0x8D20, 0x8D20, 0x4BBD,
+ 0x8D21, 0x8D21, 0x070A, 0x8D22, 0x8D22, 0x048D, 0x8D23, 0x8D23, 0x1133,
+ 0x8D24, 0x8D24, 0x0F3A, 0x8D25, 0x8D25, 0x03E7, 0x8D26, 0x8D26, 0x116C,
+ 0x8D27, 0x8D27, 0x080A, 0x8D28, 0x8D28, 0x11C9, 0x8D29, 0x8D29, 0x0654,
+ 0x8D2A, 0x8D2A, 0x0E03, 0x8D2B, 0x8D2B, 0x0BD5, 0x8D2C, 0x8D2C, 0x044A,
+ 0x8D2D, 0x8D2D, 0x0713, 0x8D2E, 0x8D2E, 0x11FB, 0x8D2F, 0x8D2F, 0x073A,
+ 0x8D30, 0x8D30, 0x063E, 0x8D31, 0x8D31, 0x086D, 0x8D32, 0x8D33, 0x192C,
+ 0x8D34, 0x8D34, 0x0E4C, 0x8D35, 0x8D35, 0x074C, 0x8D36, 0x8D36, 0x192E,
+ 0x8D37, 0x8D37, 0x057E, 0x8D38, 0x8D38, 0x0AB8, 0x8D39, 0x8D39, 0x066E,
+ 0x8D3A, 0x8D3A, 0x078F, 0x8D3B, 0x8D3B, 0x192F, 0x8D3C, 0x8D3C, 0x1137,
+ 0x8D3D, 0x8D3D, 0x1930, 0x8D3E, 0x8D3E, 0x0849, 0x8D3F, 0x8D3F, 0x07F4,
+ 0x8D40, 0x8D40, 0x1931, 0x8D41, 0x8D41, 0x0A27, 0x8D42, 0x8D42, 0x0A5F,
+ 0x8D43, 0x8D43, 0x1122, 0x8D44, 0x8D44, 0x1227, 0x8D45, 0x8D46, 0x1932,
+ 0x8D47, 0x8D47, 0x1936, 0x8D48, 0x8D49, 0x1934, 0x8D4A, 0x8D4A, 0x0D17,
+ 0x8D4B, 0x8D4B, 0x06AE, 0x8D4C, 0x8D4C, 0x0603, 0x8D4D, 0x8D4D, 0x1937,
+ 0x8D4E, 0x8D4E, 0x0D81, 0x8D4F, 0x8D4F, 0x0D06, 0x8D50, 0x8D50, 0x0550,
+ 0x8D51, 0x8D52, 0x4BBE, 0x8D53, 0x8D53, 0x163B, 0x8D54, 0x8D54, 0x0BA3,
+ 0x8D55, 0x8D55, 0x1938, 0x8D56, 0x8D56, 0x09A0, 0x8D57, 0x8D57, 0x4BC0,
+ 0x8D58, 0x8D58, 0x1215, 0x8D59, 0x8D59, 0x1939, 0x8D5A, 0x8D5A, 0x1209,
+ 0x8D5B, 0x8D5B, 0x0CD7, 0x8D5C, 0x8D5C, 0x1289, 0x8D5D, 0x8D5D, 0x1283,
+ 0x8D5E, 0x8D5E, 0x1121, 0x8D5F, 0x8D5F, 0x4BC1, 0x8D60, 0x8D60, 0x113C,
+ 0x8D61, 0x8D61, 0x0CFD, 0x8D62, 0x8D62, 0x1093, 0x8D63, 0x8D63, 0x06CE,
+ 0x8D64, 0x8D64, 0x0505, 0x8D65, 0x8D65, 0x4BC2, 0x8D66, 0x8D66, 0x0D1B,
+ 0x8D67, 0x8D67, 0x1CF4, 0x8D68, 0x8D6A, 0x4BC3, 0x8D6B, 0x8D6B, 0x078C,
+ 0x8D6C, 0x8D6C, 0x4BC6, 0x8D6D, 0x8D6D, 0x1CF5, 0x8D6E, 0x8D6F, 0x4BC7,
+ 0x8D70, 0x8D70, 0x123C, 0x8D71, 0x8D72, 0x4BC9, 0x8D73, 0x8D73, 0x1CEF,
+ 0x8D74, 0x8D74, 0x06AB, 0x8D75, 0x8D75, 0x1175, 0x8D76, 0x8D76, 0x06CA,
+ 0x8D77, 0x8D77, 0x0C0F, 0x8D78, 0x8D80, 0x4BCB, 0x8D81, 0x8D81, 0x04E8,
+ 0x8D82, 0x8D83, 0x4BD4, 0x8D84, 0x8D84, 0x1CF0, 0x8D85, 0x8D85, 0x04D1,
+ 0x8D86, 0x8D89, 0x4BD6, 0x8D8A, 0x8D8A, 0x1100, 0x8D8B, 0x8D8B, 0x0C74,
+ 0x8D8C, 0x8D90, 0x4BDA, 0x8D91, 0x8D91, 0x1CF2, 0x8D92, 0x8D93, 0x4BDF,
+ 0x8D94, 0x8D94, 0x1CF1, 0x8D95, 0x8D95, 0x1F14, 0x8D96, 0x8D98, 0x4BE1,
+ 0x8D99, 0x8D99, 0x227A, 0x8D9A, 0x8D9E, 0x4BE4, 0x8D9F, 0x8D9F, 0x0E1E,
+ 0x8DA0, 0x8DA2, 0x4BE9, 0x8DA3, 0x8DA3, 0x0C7F, 0x8DA4, 0x8DA7, 0x4BEC,
+ 0x8DA8, 0x8DA8, 0x20EE, 0x8DA9, 0x8DB0, 0x4BF0, 0x8DB1, 0x8DB1, 0x1CF3,
+ 0x8DB2, 0x8DB2, 0x25F8, 0x8DB3, 0x8DB3, 0x1240, 0x8DB4, 0x8DB4, 0x0B80,
+ 0x8DB5, 0x8DB5, 0x1D1C, 0x8DB6, 0x8DB7, 0x4BF8, 0x8DB8, 0x8DB8, 0x1D17,
+ 0x8DB9, 0x8DB9, 0x4BFA, 0x8DBA, 0x8DBA, 0x1D1F, 0x8DBB, 0x8DBB, 0x4BFB,
+ 0x8DBC, 0x8DBC, 0x1D1E, 0x8DBD, 0x8DBD, 0x4BFC, 0x8DBE, 0x8DBE, 0x11B9,
+ 0x8DBF, 0x8DBF, 0x1D1D, 0x8DC0, 0x8DC2, 0x4BFD, 0x8DC3, 0x8DC3, 0x1101,
+ 0x8DC4, 0x8DC4, 0x1D20, 0x8DC5, 0x8DC5, 0x4C00, 0x8DC6, 0x8DC6, 0x1D28,
+ 0x8DC7, 0x8DCA, 0x4C01, 0x8DCB, 0x8DCB, 0x03DA, 0x8DCC, 0x8DCC, 0x05D9,
+ 0x8DCD, 0x8DCD, 0x4C05, 0x8DCE, 0x8DCF, 0x1D25, 0x8DD0, 0x8DD0, 0x4C06,
+ 0x8DD1, 0x8DD1, 0x0B9D, 0x8DD2, 0x8DD5, 0x4C07, 0x8DD6, 0x8DD7, 0x1D21,
+ 0x8DD8, 0x8DD9, 0x4C0B, 0x8DDA, 0x8DDA, 0x1D23, 0x8DDB, 0x8DDB, 0x1D27,
+ 0x8DDC, 0x8DDC, 0x4C0D, 0x8DDD, 0x8DDD, 0x090F, 0x8DDE, 0x8DDE, 0x1D24,
+ 0x8DDF, 0x8DDF, 0x06F5, 0x8DE0, 0x8DE2, 0x4C0E, 0x8DE3, 0x8DE3, 0x1D2C,
+ 0x8DE4, 0x8DE4, 0x1D2F, 0x8DE5, 0x8DE7, 0x4C11, 0x8DE8, 0x8DE8, 0x0974,
+ 0x8DE9, 0x8DE9, 0x4C14, 0x8DEA, 0x8DEA, 0x074B, 0x8DEB, 0x8DEB, 0x1D18,
+ 0x8DEC, 0x8DEC, 0x1D29, 0x8DED, 0x8DEE, 0x4C15, 0x8DEF, 0x8DEF, 0x0A5E,
+ 0x8DF0, 0x8DF2, 0x4C17, 0x8DF3, 0x8DF3, 0x0E4B, 0x8DF4, 0x8DF4, 0x4C1A,
+ 0x8DF5, 0x8DF5, 0x086C, 0x8DF6, 0x8DF6, 0x4C1B, 0x8DF7, 0x8DF8, 0x1D2A,
+ 0x8DF9, 0x8DF9, 0x1D2D, 0x8DFA, 0x8DFA, 0x0624, 0x8DFB, 0x8DFB, 0x1D2E,
+ 0x8DFC, 0x8DFC, 0x4C1C, 0x8DFD, 0x8DFD, 0x1D31, 0x8DFE, 0x8DFF, 0x4C1D,
+ 0x8E00, 0x8E04, 0x4C1F, 0x8E05, 0x8E05, 0x1D19, 0x8E06, 0x8E08, 0x4C24,
+ 0x8E09, 0x8E09, 0x1D30, 0x8E0A, 0x8E0A, 0x10A0, 0x8E0B, 0x8E0B, 0x4C27,
+ 0x8E0C, 0x8E0C, 0x0511, 0x8E0D, 0x8E0E, 0x4C28, 0x8E0F, 0x8E0F, 0x0DF7,
+ 0x8E10, 0x8E10, 0x1F94, 0x8E11, 0x8E13, 0x4C2A, 0x8E14, 0x8E14, 0x1D32,
+ 0x8E15, 0x8E1C, 0x4C2D, 0x8E1D, 0x8E1D, 0x1D33, 0x8E1E, 0x8E1E, 0x0910,
+ 0x8E1F, 0x8E1F, 0x1D34, 0x8E20, 0x8E21, 0x4C35, 0x8E22, 0x8E22, 0x0E32,
+ 0x8E23, 0x8E23, 0x1D37, 0x8E24, 0x8E28, 0x4C37, 0x8E29, 0x8E29, 0x048F,
+ 0x8E2A, 0x8E2A, 0x1236, 0x8E2B, 0x8E2B, 0x4C3C, 0x8E2C, 0x8E2C, 0x1D35,
+ 0x8E2D, 0x8E2D, 0x4C3D, 0x8E2E, 0x8E2E, 0x1D36, 0x8E2F, 0x8E2F, 0x1D38,
+ 0x8E30, 0x8E30, 0x4C3E, 0x8E31, 0x8E31, 0x1D3E, 0x8E32, 0x8E33, 0x4C3F,
+ 0x8E34, 0x8E34, 0x2230, 0x8E35, 0x8E35, 0x1D3C, 0x8E36, 0x8E38, 0x4C41,
+ 0x8E39, 0x8E39, 0x1D3B, 0x8E3A, 0x8E3A, 0x1D39, 0x8E3B, 0x8E3C, 0x4C44,
+ 0x8E3D, 0x8E3D, 0x1D3D, 0x8E3E, 0x8E3F, 0x4C46, 0x8E40, 0x8E40, 0x1D3A,
+ 0x8E41, 0x8E42, 0x1D40, 0x8E43, 0x8E43, 0x4C48, 0x8E44, 0x8E44, 0x0E36,
+ 0x8E45, 0x8E46, 0x4C49, 0x8E47, 0x8E47, 0x173B, 0x8E48, 0x8E48, 0x0599,
+ 0x8E49, 0x8E49, 0x1D3F, 0x8E4A, 0x8E4A, 0x1D44, 0x8E4B, 0x8E4B, 0x0DF6,
+ 0x8E4C, 0x8E4C, 0x25FD, 0x8E4D, 0x8E50, 0x4C4B, 0x8E51, 0x8E52, 0x1D42,
+ 0x8E53, 0x8E54, 0x4C4F, 0x8E55, 0x8E55, 0x2600, 0x8E56, 0x8E58, 0x4C51,
+ 0x8E59, 0x8E59, 0x1D1A, 0x8E5A, 0x8E62, 0x4C54, 0x8E63, 0x8E63, 0x2606,
+ 0x8E64, 0x8E65, 0x4C5D, 0x8E66, 0x8E66, 0x042D, 0x8E67, 0x8E68, 0x4C5F,
+ 0x8E69, 0x8E69, 0x1D1B, 0x8E6A, 0x8E6B, 0x4C61, 0x8E6C, 0x8E6C, 0x05A6,
+ 0x8E6D, 0x8E6D, 0x04AB, 0x8E6E, 0x8E6E, 0x4C63, 0x8E6F, 0x8E6F, 0x1D48,
+ 0x8E70, 0x8E70, 0x1D45, 0x8E71, 0x8E71, 0x4C64, 0x8E72, 0x8E72, 0x0616,
+ 0x8E73, 0x8E73, 0x4C65, 0x8E74, 0x8E74, 0x1D49, 0x8E75, 0x8E75, 0x4C66,
+ 0x8E76, 0x8E76, 0x1D46, 0x8E77, 0x8E79, 0x4C67, 0x8E7A, 0x8E7A, 0x25FF,
+ 0x8E7B, 0x8E7B, 0x4C6A, 0x8E7C, 0x8E7C, 0x1D47, 0x8E7D, 0x8E7E, 0x4C6B,
+ 0x8E7F, 0x8E7F, 0x055D, 0x8E80, 0x8E80, 0x4C6D, 0x8E81, 0x8E81, 0x112D,
+ 0x8E82, 0x8E84, 0x4C6E, 0x8E85, 0x8E85, 0x1D4A, 0x8E86, 0x8E86, 0x4C71,
+ 0x8E87, 0x8E87, 0x051E, 0x8E88, 0x8E88, 0x4C72, 0x8E89, 0x8E89, 0x25FC,
+ 0x8E8A, 0x8E8A, 0x1E8C, 0x8E8B, 0x8E8B, 0x2602, 0x8E8C, 0x8E8C, 0x4C73,
+ 0x8E8D, 0x8E8D, 0x224D, 0x8E8E, 0x8E8E, 0x4C74, 0x8E8F, 0x8E8F, 0x1D4B,
+ 0x8E90, 0x8E90, 0x1D4D, 0x8E91, 0x8E91, 0x2604, 0x8E92, 0x8E92, 0x25FE,
+ 0x8E93, 0x8E93, 0x2603, 0x8E94, 0x8E94, 0x1D4C, 0x8E95, 0x8E99, 0x4C75,
+ 0x8E9A, 0x8E9A, 0x2601, 0x8E9B, 0x8E9B, 0x4C7A, 0x8E9C, 0x8E9C, 0x1D4E,
+ 0x8E9D, 0x8E9D, 0x4C7B, 0x8E9E, 0x8E9E, 0x1D4F, 0x8E9F, 0x8EA0, 0x4C7C,
+ 0x8EA1, 0x8EA1, 0x2605, 0x8EA2, 0x8EA4, 0x4C7E, 0x8EA5, 0x8EA5, 0x1EA3,
+ 0x8EA6, 0x8EA6, 0x2608, 0x8EA7, 0x8EA9, 0x4C81, 0x8EAA, 0x8EAA, 0x2607,
+ 0x8EAB, 0x8EAB, 0x0D26, 0x8EAC, 0x8EAC, 0x0703, 0x8EAD, 0x8EAE, 0x4C84,
+ 0x8EAF, 0x8EAF, 0x0C78, 0x8EB0, 0x8EB1, 0x4C86, 0x8EB2, 0x8EB2, 0x0622,
+ 0x8EB3, 0x8EB9, 0x4C88, 0x8EBA, 0x8EBA, 0x0E1C, 0x8EBB, 0x8EBF, 0x4C8F,
+ 0x8EC0, 0x8EC0, 0x20F0, 0x8EC1, 0x8EC9, 0x4C94, 0x8ECA, 0x8ECA, 0x1E7B,
+ 0x8ECB, 0x8ECB, 0x2267, 0x8ECC, 0x8ECC, 0x1F36, 0x8ECD, 0x8ECD, 0x1FD6,
+ 0x8ECE, 0x8ECE, 0x18F8, 0x8ECF, 0x8ED1, 0x4C9D, 0x8ED2, 0x8ED2, 0x21E0,
+ 0x8ED3, 0x8ED3, 0x4CA0, 0x8ED4, 0x8ED4, 0x248C, 0x8ED5, 0x8EDA, 0x4CA1,
+ 0x8EDB, 0x8EDB, 0x248D, 0x8EDC, 0x8EDE, 0x4CA7, 0x8EDF, 0x8EDF, 0x2102,
+ 0x8EE0, 0x8EE3, 0x4CAA, 0x8EE4, 0x8EE4, 0x2494, 0x8EE5, 0x8EEA, 0x4CAE,
+ 0x8EEB, 0x8EEB, 0x2493, 0x8EEC, 0x8EF1, 0x4CB4, 0x8EF2, 0x8EF2, 0x248E,
+ 0x8EF3, 0x8EF7, 0x4CBA, 0x8EF8, 0x8EF8, 0x2299, 0x8EF9, 0x8EF9, 0x2491,
+ 0x8EFA, 0x8EFA, 0x2496, 0x8EFB, 0x8EFB, 0x248F, 0x8EFC, 0x8EFC, 0x2492,
+ 0x8EFD, 0x8EFD, 0x4CBF, 0x8EFE, 0x8EFE, 0x2497, 0x8EFF, 0x8EFF, 0x4CC0,
+ 0x8F00, 0x8F02, 0x4CC1, 0x8F03, 0x8F03, 0x1FB1, 0x8F04, 0x8F04, 0x4CC4,
+ 0x8F05, 0x8F05, 0x249A, 0x8F06, 0x8F06, 0x4CC5, 0x8F07, 0x8F07, 0x2499,
+ 0x8F08, 0x8F08, 0x4CC6, 0x8F09, 0x8F09, 0x2258, 0x8F0A, 0x8F0A, 0x2498,
+ 0x8F0B, 0x8F11, 0x4CC7, 0x8F12, 0x8F12, 0x249B, 0x8F13, 0x8F13, 0x4CCE,
+ 0x8F14, 0x8F14, 0x1F09, 0x8F15, 0x8F15, 0x20E6, 0x8F16, 0x8F1A, 0x4CCF,
+ 0x8F1B, 0x8F1B, 0x2026, 0x8F1C, 0x8F1C, 0x249F, 0x8F1D, 0x8F1D, 0x1F59,
+ 0x8F1E, 0x8F1F, 0x249D, 0x8F20, 0x8F24, 0x4CD4, 0x8F25, 0x8F25, 0x1F3B,
+ 0x8F26, 0x8F26, 0x249C, 0x8F27, 0x8F28, 0x4CD9, 0x8F29, 0x8F29, 0x1E3A,
+ 0x8F2A, 0x8F2A, 0x205B, 0x8F2B, 0x8F2E, 0x4CDB, 0x8F2F, 0x8F2F, 0x1F70,
+ 0x8F30, 0x8F32, 0x4CDF, 0x8F33, 0x8F33, 0x24A0, 0x8F34, 0x8F37, 0x4CE2,
+ 0x8F38, 0x8F38, 0x213B, 0x8F39, 0x8F3A, 0x4CE6, 0x8F3B, 0x8F3B, 0x1F07,
+ 0x8F3C, 0x8F3D, 0x4CE8, 0x8F3E, 0x8F3E, 0x2270, 0x8F3F, 0x8F3F, 0x2237,
+ 0x8F40, 0x8F41, 0x4CEA, 0x8F42, 0x8F42, 0x24D2, 0x8F43, 0x8F43, 0x4CEC,
+ 0x8F44, 0x8F44, 0x21B3, 0x8F45, 0x8F45, 0x2245, 0x8F46, 0x8F46, 0x24A1,
+ 0x8F47, 0x8F48, 0x4CED, 0x8F49, 0x8F49, 0x22A8, 0x8F4A, 0x8F4C, 0x4CEF,
+ 0x8F4D, 0x8F4D, 0x227C, 0x8F4E, 0x8F4E, 0x1FB0, 0x8F4F, 0x8F53, 0x4CF2,
+ 0x8F54, 0x8F54, 0x24A2, 0x8F55, 0x8F5E, 0x4CF7, 0x8F5F, 0x8F5F, 0x1F46,
+ 0x8F60, 0x8F60, 0x4D01, 0x8F61, 0x8F61, 0x2380, 0x8F62, 0x8F62, 0x2495,
+ 0x8F63, 0x8F63, 0x4D02, 0x8F64, 0x8F64, 0x2490, 0x8F65, 0x8F65, 0x4D03,
+ 0x8F66, 0x8F66, 0x04DA, 0x8F67, 0x8F67, 0x1141, 0x8F68, 0x8F68, 0x0745,
+ 0x8F69, 0x8F69, 0x0FC4, 0x8F6A, 0x8F6A, 0x4D04, 0x8F6B, 0x8F6B, 0x18E1,
+ 0x8F6C, 0x8F6C, 0x1207, 0x8F6D, 0x8F6D, 0x18E2, 0x8F6E, 0x8F6E, 0x0A7D,
+ 0x8F6F, 0x8F6F, 0x0CC8, 0x8F70, 0x8F70, 0x079B, 0x8F71, 0x8F73, 0x18E3,
+ 0x8F74, 0x8F74, 0x11E0, 0x8F75, 0x8F76, 0x18E6, 0x8F77, 0x8F77, 0x18E9,
+ 0x8F78, 0x8F78, 0x18E8, 0x8F79, 0x8F7A, 0x18EA, 0x8F7B, 0x8F7B, 0x0C5E,
+ 0x8F7C, 0x8F7C, 0x18EC, 0x8F7D, 0x8F7D, 0x111B, 0x8F7E, 0x8F7E, 0x18ED,
+ 0x8F7F, 0x8F7F, 0x089F, 0x8F80, 0x8F80, 0x4D05, 0x8F81, 0x8F82, 0x18EE,
+ 0x8F83, 0x8F83, 0x08A0, 0x8F84, 0x8F84, 0x18F0, 0x8F85, 0x8F85, 0x06A3,
+ 0x8F86, 0x8F86, 0x0A07, 0x8F87, 0x8F87, 0x18F1, 0x8F88, 0x8F88, 0x041B,
+ 0x8F89, 0x8F89, 0x07E9, 0x8F8A, 0x8F8A, 0x074E, 0x8F8B, 0x8F8B, 0x18F2,
+ 0x8F8C, 0x8F8C, 0x4D06, 0x8F8D, 0x8F8F, 0x18F3, 0x8F90, 0x8F90, 0x0695,
+ 0x8F91, 0x8F91, 0x0820, 0x8F92, 0x8F92, 0x4D07, 0x8F93, 0x8F93, 0x0D7B,
+ 0x8F94, 0x8F94, 0x1574, 0x8F95, 0x8F95, 0x10F2, 0x8F96, 0x8F96, 0x0F2A,
+ 0x8F97, 0x8F97, 0x1158, 0x8F98, 0x8F98, 0x18F6, 0x8F99, 0x8F99, 0x117F,
+ 0x8F9A, 0x8F9A, 0x18F7, 0x8F9B, 0x8F9B, 0x0F8C, 0x8F9C, 0x8F9C, 0x0715,
+ 0x8F9D, 0x8F9D, 0x4D08, 0x8F9E, 0x8F9E, 0x054A, 0x8F9F, 0x8F9F, 0x0442,
+ 0x8FA0, 0x8FA2, 0x4D09, 0x8FA3, 0x8FA3, 0x099C, 0x8FA4, 0x8FA5, 0x4D0C,
+ 0x8FA6, 0x8FA6, 0x1E30, 0x8FA7, 0x8FA7, 0x4D0E, 0x8FA8, 0x8FA9, 0x044F,
+ 0x8FAA, 0x8FAA, 0x4D0F, 0x8FAB, 0x8FAB, 0x0451, 0x8FAC, 0x8FAC, 0x4D10,
+ 0x8FAD, 0x8FAD, 0x1E9D, 0x8FAE, 0x8FAE, 0x1E4B, 0x8FAF, 0x8FAF, 0x1E4A,
+ 0x8FB0, 0x8FB0, 0x04E2, 0x8FB1, 0x8FB1, 0x0CC3, 0x8FB2, 0x8FB2, 0x20AA,
+ 0x8FB3, 0x8FB5, 0x4D11, 0x8FB6, 0x8FB6, 0x173D, 0x8FB7, 0x8FB8, 0x4D14,
+ 0x8FB9, 0x8FB9, 0x0448, 0x8FBA, 0x8FBC, 0x4D16, 0x8FBD, 0x8FBD, 0x0A12,
+ 0x8FBE, 0x8FBE, 0x0572, 0x8FBF, 0x8FC0, 0x4D19, 0x8FC1, 0x8FC1, 0x0C25,
+ 0x8FC2, 0x8FC2, 0x10BD, 0x8FC3, 0x8FC3, 0x4D1B, 0x8FC4, 0x8FC4, 0x0C18,
+ 0x8FC5, 0x8FC5, 0x0FE1, 0x8FC6, 0x8FC6, 0x4D1C, 0x8FC7, 0x8FC7, 0x0756,
+ 0x8FC8, 0x8FC8, 0x0A9C, 0x8FC9, 0x8FCD, 0x4D1D, 0x8FCE, 0x8FCE, 0x1092,
+ 0x8FCF, 0x8FCF, 0x4D22, 0x8FD0, 0x8FD0, 0x110E, 0x8FD1, 0x8FD1, 0x08CD,
+ 0x8FD2, 0x8FD2, 0x4D23, 0x8FD3, 0x8FD3, 0x173E, 0x8FD4, 0x8FD4, 0x0652,
+ 0x8FD5, 0x8FD5, 0x173F, 0x8FD6, 0x8FD7, 0x4D24, 0x8FD8, 0x8FD8, 0x07CE,
+ 0x8FD9, 0x8FD9, 0x1183, 0x8FDA, 0x8FDA, 0x4D26, 0x8FDB, 0x8FDB, 0x08C9,
+ 0x8FDC, 0x8FDC, 0x10F9, 0x8FDD, 0x8FDD, 0x0EB4, 0x8FDE, 0x8FDE, 0x09F5,
+ 0x8FDF, 0x8FDF, 0x04FE, 0x8FE0, 0x8FE1, 0x4D27, 0x8FE2, 0x8FE2, 0x0E49,
+ 0x8FE3, 0x8FE3, 0x4D29, 0x8FE4, 0x8FE4, 0x1742, 0x8FE5, 0x8FE5, 0x1740,
+ 0x8FE6, 0x8FE6, 0x1744, 0x8FE7, 0x8FE7, 0x4D2A, 0x8FE8, 0x8FE8, 0x1746,
+ 0x8FE9, 0x8FE9, 0x1743, 0x8FEA, 0x8FEA, 0x05B0, 0x8FEB, 0x8FEB, 0x0BE7,
+ 0x8FEC, 0x8FEC, 0x4D2B, 0x8FED, 0x8FED, 0x05DD, 0x8FEE, 0x8FEE, 0x1741,
+ 0x8FEF, 0x8FEF, 0x4D2C, 0x8FF0, 0x8FF0, 0x0D8D, 0x8FF1, 0x8FF2, 0x4D2D,
+ 0x8FF3, 0x8FF3, 0x1745, 0x8FF4, 0x8FF4, 0x267B, 0x8FF5, 0x8FF6, 0x4D2F,
+ 0x8FF7, 0x8FF7, 0x0AD9, 0x8FF8, 0x8FF8, 0x042E, 0x8FF9, 0x8FF9, 0x0816,
+ 0x8FFA, 0x8FFC, 0x4D31, 0x8FFD, 0x8FFD, 0x1214, 0x8FFE, 0x8FFF, 0x4D34,
+ 0x9000, 0x9000, 0x0E7C, 0x9001, 0x9001, 0x0DC2, 0x9002, 0x9002, 0x0D61,
+ 0x9003, 0x9003, 0x0E26, 0x9004, 0x9004, 0x1748, 0x9005, 0x9005, 0x1747,
+ 0x9006, 0x9006, 0x0B49, 0x9007, 0x9008, 0x4D36, 0x9009, 0x9009, 0x0FCA,
+ 0x900A, 0x900A, 0x0FE0, 0x900B, 0x900B, 0x1749, 0x900C, 0x900C, 0x4D38,
+ 0x900D, 0x900D, 0x174C, 0x900E, 0x900E, 0x4D39, 0x900F, 0x900F, 0x0E69,
+ 0x9010, 0x9010, 0x11EF, 0x9011, 0x9011, 0x174B, 0x9012, 0x9012, 0x05BE,
+ 0x9013, 0x9013, 0x4D3A, 0x9014, 0x9014, 0x0E6F, 0x9015, 0x9015, 0x23F2,
+ 0x9016, 0x9016, 0x174D, 0x9017, 0x9017, 0x05F9, 0x9018, 0x9018, 0x4D3B,
+ 0x9019, 0x9019, 0x227E, 0x901A, 0x901A, 0x0E59, 0x901B, 0x901B, 0x073D,
+ 0x901C, 0x901C, 0x4D3C, 0x901D, 0x901D, 0x0D5C, 0x901E, 0x901E, 0x04F6,
+ 0x901F, 0x901F, 0x0DCE, 0x9020, 0x9020, 0x112F, 0x9021, 0x9021, 0x174E,
+ 0x9022, 0x9022, 0x0687, 0x9023, 0x9023, 0x2019, 0x9024, 0x9025, 0x4D3D,
+ 0x9026, 0x9026, 0x174A, 0x9027, 0x902C, 0x4D3F, 0x902D, 0x902D, 0x1751,
+ 0x902E, 0x902E, 0x0581, 0x902F, 0x902F, 0x1752, 0x9030, 0x9031, 0x4D45,
+ 0x9032, 0x9032, 0x1FBB, 0x9033, 0x9034, 0x4D47, 0x9035, 0x9036, 0x174F,
+ 0x9037, 0x9037, 0x4D49, 0x9038, 0x9038, 0x1064, 0x9039, 0x903A, 0x4D4A,
+ 0x903B, 0x903B, 0x0A86, 0x903C, 0x903C, 0x042F, 0x903D, 0x903D, 0x4D4C,
+ 0x903E, 0x903E, 0x10C7, 0x903F, 0x9040, 0x4D4D, 0x9041, 0x9041, 0x061C,
+ 0x9042, 0x9042, 0x0DE1, 0x9043, 0x9043, 0x4D4F, 0x9044, 0x9044, 0x1753,
+ 0x9045, 0x9046, 0x4D50, 0x9047, 0x9047, 0x10DB, 0x9048, 0x904A, 0x4D52,
+ 0x904B, 0x904B, 0x2253, 0x904C, 0x904C, 0x4D55, 0x904D, 0x904D, 0x0452,
+ 0x904E, 0x904E, 0x1F3E, 0x904F, 0x904F, 0x0633, 0x9050, 0x9050, 0x1756,
+ 0x9051, 0x9052, 0x1754, 0x9053, 0x9053, 0x05A1, 0x9054, 0x9054, 0x1EA6,
+ 0x9055, 0x9055, 0x218E, 0x9056, 0x9056, 0x4D56, 0x9057, 0x9057, 0x104C,
+ 0x9058, 0x9058, 0x1758, 0x9059, 0x905A, 0x4D57, 0x905B, 0x905B, 0x175A,
+ 0x905C, 0x905C, 0x21EC, 0x905D, 0x905D, 0x4D59, 0x905E, 0x905E, 0x1EBE,
+ 0x905F, 0x905F, 0x4D5A, 0x9060, 0x9060, 0x224A, 0x9061, 0x9061, 0x4D5B,
+ 0x9062, 0x9062, 0x1759, 0x9063, 0x9063, 0x0C2F, 0x9064, 0x9064, 0x4D5C,
+ 0x9065, 0x9065, 0x102A, 0x9066, 0x9067, 0x4D5D, 0x9068, 0x9068, 0x1757,
+ 0x9069, 0x9069, 0x2133, 0x906A, 0x906C, 0x4D5F, 0x906D, 0x906D, 0x1125,
+ 0x906E, 0x906E, 0x117B, 0x906F, 0x9071, 0x4D62, 0x9072, 0x9072, 0x1E84,
+ 0x9073, 0x9073, 0x4D65, 0x9074, 0x9074, 0x175C, 0x9075, 0x9075, 0x124E,
+ 0x9076, 0x9076, 0x4D66, 0x9077, 0x9077, 0x20CF, 0x9078, 0x9078, 0x21E2,
+ 0x9079, 0x9079, 0x4D67, 0x907A, 0x907A, 0x220F, 0x907B, 0x907B, 0x4D68,
+ 0x907C, 0x907C, 0x2029, 0x907D, 0x907D, 0x175D, 0x907E, 0x907E, 0x4D69,
+ 0x907F, 0x907F, 0x0445, 0x9080, 0x9080, 0x1024, 0x9081, 0x9081, 0x2073,
+ 0x9082, 0x9082, 0x175E, 0x9083, 0x9083, 0x1760, 0x9084, 0x9084, 0x1F55,
+ 0x9085, 0x9086, 0x4D6A, 0x9087, 0x9087, 0x23F1, 0x9088, 0x9088, 0x175F,
+ 0x9089, 0x9089, 0x4D6C, 0x908A, 0x908A, 0x1E46, 0x908B, 0x908B, 0x1761,
+ 0x908C, 0x908E, 0x4D6D, 0x908F, 0x908F, 0x2063, 0x9090, 0x9090, 0x23F3,
+ 0x9091, 0x9091, 0x105F, 0x9092, 0x9092, 0x4D70, 0x9093, 0x9093, 0x05AC,
+ 0x9094, 0x9094, 0x4D71, 0x9095, 0x9095, 0x1817, 0x9096, 0x9096, 0x4D72,
+ 0x9097, 0x9097, 0x1367, 0x9098, 0x9098, 0x4D73, 0x9099, 0x9099, 0x136A,
+ 0x909A, 0x909A, 0x4D74, 0x909B, 0x909B, 0x1368, 0x909C, 0x909C, 0x4D75,
+ 0x909D, 0x909D, 0x1369, 0x909E, 0x90A0, 0x4D76, 0x90A1, 0x90A1, 0x136C,
+ 0x90A2, 0x90A2, 0x0F9A, 0x90A3, 0x90A3, 0x0B2A, 0x90A4, 0x90A5, 0x4D79,
+ 0x90A6, 0x90A6, 0x03F9, 0x90A7, 0x90A9, 0x4D7B, 0x90AA, 0x90AA, 0x0F7B,
+ 0x90AB, 0x90AB, 0x4D7E, 0x90AC, 0x90AC, 0x136B, 0x90AD, 0x90AD, 0x4D7F,
+ 0x90AE, 0x90AE, 0x10AF, 0x90AF, 0x90AF, 0x0761, 0x90B0, 0x90B0, 0x1372,
+ 0x90B1, 0x90B1, 0x0C6E, 0x90B2, 0x90B2, 0x4D80, 0x90B3, 0x90B3, 0x136E,
+ 0x90B4, 0x90B4, 0x136D, 0x90B5, 0x90B5, 0x0D14, 0x90B6, 0x90B6, 0x136F,
+ 0x90B7, 0x90B7, 0x4D81, 0x90B8, 0x90B8, 0x1371, 0x90B9, 0x90B9, 0x123B,
+ 0x90BA, 0x90BA, 0x1370, 0x90BB, 0x90BB, 0x0A23, 0x90BC, 0x90BD, 0x4D82,
+ 0x90BE, 0x90BE, 0x1375, 0x90BF, 0x90C0, 0x4D84, 0x90C1, 0x90C1, 0x10D9,
+ 0x90C2, 0x90C3, 0x4D86, 0x90C4, 0x90C4, 0x1377, 0x90C5, 0x90C5, 0x1374,
+ 0x90C6, 0x90C6, 0x4D88, 0x90C7, 0x90C7, 0x1378, 0x90C8, 0x90C9, 0x4D89,
+ 0x90CA, 0x90CA, 0x088D, 0x90CB, 0x90CD, 0x4D8B, 0x90CE, 0x90CE, 0x09B4,
+ 0x90CF, 0x90CF, 0x1373, 0x90D0, 0x90D0, 0x1376, 0x90D1, 0x90D1, 0x11A2,
+ 0x90D2, 0x90D2, 0x4D8E, 0x90D3, 0x90D3, 0x1379, 0x90D4, 0x90D6, 0x4D8F,
+ 0x90D7, 0x90D7, 0x137D, 0x90D8, 0x90DA, 0x4D92, 0x90DB, 0x90DB, 0x137E,
+ 0x90DC, 0x90DC, 0x137C, 0x90DD, 0x90DD, 0x0779, 0x90DE, 0x90DE, 0x4D95,
+ 0x90DF, 0x90DF, 0x231E, 0x90E0, 0x90E0, 0x4D96, 0x90E1, 0x90E1, 0x0931,
+ 0x90E2, 0x90E2, 0x137B, 0x90E3, 0x90E5, 0x4D97, 0x90E6, 0x90E6, 0x137A,
+ 0x90E7, 0x90E7, 0x110A, 0x90E8, 0x90E8, 0x0486, 0x90E9, 0x90EA, 0x4D9A,
+ 0x90EB, 0x90EB, 0x137F, 0x90EC, 0x90EC, 0x4D9C, 0x90ED, 0x90ED, 0x0752,
+ 0x90EE, 0x90EE, 0x4D9D, 0x90EF, 0x90EF, 0x1380, 0x90F0, 0x90F3, 0x4D9E,
+ 0x90F4, 0x90F4, 0x04E0, 0x90F5, 0x90F5, 0x2233, 0x90F6, 0x90F7, 0x4DA2,
+ 0x90F8, 0x90F8, 0x0587, 0x90F9, 0x90FC, 0x4DA4, 0x90FD, 0x90FD, 0x05FB,
+ 0x90FE, 0x90FE, 0x1381, 0x90FF, 0x90FF, 0x4DA8, 0x9100, 0x9101, 0x4DA9,
+ 0x9102, 0x9102, 0x0634, 0x9103, 0x9103, 0x4DAB, 0x9104, 0x9104, 0x1382,
+ 0x9105, 0x9105, 0x4DAC, 0x9106, 0x9106, 0x2320, 0x9107, 0x9108, 0x4DAD,
+ 0x9109, 0x9109, 0x21C7, 0x910A, 0x9111, 0x4DAF, 0x9112, 0x9112, 0x22BC,
+ 0x9113, 0x9113, 0x4DB7, 0x9114, 0x9114, 0x231C, 0x9115, 0x9115, 0x4DB8,
+ 0x9116, 0x9116, 0x2251, 0x9117, 0x9118, 0x4DB9, 0x9119, 0x9119, 0x0432,
+ 0x911A, 0x911D, 0x4DBB, 0x911E, 0x911E, 0x1384, 0x911F, 0x9121, 0x4DBF,
+ 0x9122, 0x9122, 0x1383, 0x9123, 0x9123, 0x1385, 0x9124, 0x9126, 0x4DC2,
+ 0x9127, 0x9127, 0x1EBB, 0x9128, 0x912C, 0x4DC5, 0x912D, 0x912D, 0x2287,
+ 0x912E, 0x912E, 0x4DCA, 0x912F, 0x912F, 0x1387, 0x9130, 0x9130, 0x202D,
+ 0x9131, 0x9131, 0x1386, 0x9132, 0x9132, 0x1EAB, 0x9133, 0x9133, 0x4DCB,
+ 0x9134, 0x9134, 0x231D, 0x9135, 0x9135, 0x4DCC, 0x9136, 0x9136, 0x231F,
+ 0x9137, 0x9138, 0x4DCD, 0x9139, 0x9139, 0x1388, 0x913A, 0x913A, 0x231B,
+ 0x913B, 0x9142, 0x4DCF, 0x9143, 0x9143, 0x1389, 0x9144, 0x9145, 0x4DD7,
+ 0x9146, 0x9146, 0x138A, 0x9147, 0x9147, 0x4DD9, 0x9148, 0x9148, 0x2321,
+ 0x9149, 0x9149, 0x10B4, 0x914A, 0x914A, 0x1CF8, 0x914B, 0x914B, 0x0C72,
+ 0x914C, 0x914C, 0x1220, 0x914D, 0x914D, 0x0BA5, 0x914E, 0x914F, 0x1CFA,
+ 0x9150, 0x9150, 0x1CF9, 0x9151, 0x9151, 0x4DDA, 0x9152, 0x9152, 0x08F5,
+ 0x9153, 0x9156, 0x4DDB, 0x9157, 0x9157, 0x0FBA, 0x9158, 0x9159, 0x4DDF,
+ 0x915A, 0x915A, 0x0670, 0x915B, 0x915C, 0x4DE1, 0x915D, 0x915D, 0x1110,
+ 0x915E, 0x915E, 0x0DFD, 0x915F, 0x9160, 0x4DE3, 0x9161, 0x9161, 0x1CFE,
+ 0x9162, 0x9162, 0x1CFD, 0x9163, 0x9163, 0x075F, 0x9164, 0x9164, 0x1CFC,
+ 0x9165, 0x9165, 0x0DCB, 0x9166, 0x9168, 0x4DE5, 0x9169, 0x9169, 0x1D00,
+ 0x916A, 0x916A, 0x09BD, 0x916B, 0x916B, 0x4DE8, 0x916C, 0x916C, 0x050F,
+ 0x916D, 0x916D, 0x4DE9, 0x916E, 0x916E, 0x0E5B, 0x916F, 0x916F, 0x1D01,
+ 0x9170, 0x9170, 0x1CFF, 0x9171, 0x9171, 0x0885, 0x9172, 0x9172, 0x1D04,
+ 0x9173, 0x9173, 0x4DEA, 0x9174, 0x9174, 0x1D05, 0x9175, 0x9175, 0x089E,
+ 0x9176, 0x9176, 0x0ABD, 0x9177, 0x9177, 0x096E, 0x9178, 0x9178, 0x0DD6,
+ 0x9179, 0x9179, 0x1D06, 0x917A, 0x917C, 0x4DEB, 0x917D, 0x917E, 0x1D02,
+ 0x917F, 0x917F, 0x0B53, 0x9180, 0x9184, 0x4DEE, 0x9185, 0x9185, 0x1D08,
+ 0x9186, 0x9186, 0x4DF3, 0x9187, 0x9187, 0x053F, 0x9188, 0x9188, 0x4DF4,
+ 0x9189, 0x9189, 0x124A, 0x918A, 0x918A, 0x4DF5, 0x918B, 0x918B, 0x055A,
+ 0x918C, 0x918C, 0x1D07, 0x918D, 0x918D, 0x1D0A, 0x918E, 0x918F, 0x4DF6,
+ 0x9190, 0x9190, 0x1D09, 0x9191, 0x9191, 0x1D0B, 0x9192, 0x9192, 0x0F9C,
+ 0x9193, 0x9195, 0x4DF8, 0x9196, 0x9196, 0x2255, 0x9197, 0x9199, 0x4DFB,
+ 0x919A, 0x919A, 0x0AD6, 0x919B, 0x919B, 0x0C84, 0x919C, 0x919C, 0x1E8F,
+ 0x919D, 0x91A1, 0x4DFE, 0x91A2, 0x91A3, 0x1D0C, 0x91A4, 0x91A9, 0x4E03,
+ 0x91AA, 0x91AA, 0x1D0E, 0x91AB, 0x91AB, 0x220C, 0x91AC, 0x91AC, 0x1FA4,
+ 0x91AD, 0x91AF, 0x1D0F, 0x91B0, 0x91B3, 0x4E09, 0x91B4, 0x91B4, 0x1D13,
+ 0x91B5, 0x91B5, 0x1D12, 0x91B6, 0x91B9, 0x4E0D, 0x91BA, 0x91BA, 0x1D14,
+ 0x91BB, 0x91BF, 0x4E11, 0x91C0, 0x91C0, 0x209B, 0x91C1, 0x91C1, 0x21D8,
+ 0x91C2, 0x91C2, 0x4E16, 0x91C3, 0x91C3, 0x25FA, 0x91C4, 0x91C4, 0x4E17,
+ 0x91C5, 0x91C5, 0x25F9, 0x91C6, 0x91C6, 0x4E18, 0x91C7, 0x91C7, 0x0490,
+ 0x91C8, 0x91C8, 0x4E19, 0x91C9, 0x91C9, 0x10B9, 0x91CA, 0x91CA, 0x0D64,
+ 0x91CB, 0x91CB, 0x2134, 0x91CC, 0x91CC, 0x09DA, 0x91CD, 0x91CD, 0x11D7,
+ 0x91CE, 0x91CE, 0x1037, 0x91CF, 0x91CF, 0x0A08, 0x91D0, 0x91D0, 0x4E1A,
+ 0x91D1, 0x91D1, 0x08C1, 0x91D2, 0x91D4, 0x24F3, 0x91D5, 0x91D5, 0x24F8,
+ 0x91D6, 0x91D6, 0x4E1B, 0x91D7, 0x91D7, 0x24F7, 0x91D8, 0x91D8, 0x1EC8,
+ 0x91D9, 0x91D9, 0x24F6, 0x91DA, 0x91DB, 0x4E1C, 0x91DC, 0x91DC, 0x06A5,
+ 0x91DD, 0x91DD, 0x2280, 0x91DE, 0x91E2, 0x4E1E, 0x91E3, 0x91E3, 0x1EC5,
+ 0x91E4, 0x91E4, 0x24FB, 0x91E5, 0x91E6, 0x4E23, 0x91E7, 0x91E7, 0x24FA,
+ 0x91E8, 0x91E8, 0x4E25, 0x91E9, 0x91E9, 0x1EED, 0x91EA, 0x91F4, 0x4E26,
+ 0x91F5, 0x91F5, 0x24FD, 0x91F6, 0x91F6, 0x4E31, 0x91F7, 0x91F7, 0x24F9,
+ 0x91F8, 0x91F8, 0x4E32, 0x91F9, 0x91F9, 0x24FE, 0x91FA, 0x91FA, 0x20CD,
+ 0x91FB, 0x91FF, 0x4E33, 0x9200, 0x9200, 0x2508, 0x9201, 0x9201, 0x2504,
+ 0x9202, 0x9203, 0x4E38, 0x9204, 0x9204, 0x2506, 0x9205, 0x9207, 0x4E3A,
+ 0x9208, 0x9208, 0x24FF, 0x9209, 0x9209, 0x2090, 0x920A, 0x920C, 0x4E3D,
+ 0x920D, 0x920D, 0x1EDD, 0x920E, 0x920E, 0x1F25, 0x920F, 0x920F, 0x4E40,
+ 0x9210, 0x9210, 0x2503, 0x9211, 0x9211, 0x2502, 0x9212, 0x9213, 0x4E41,
+ 0x9214, 0x9214, 0x1E7A, 0x9215, 0x9215, 0x20A6, 0x9216, 0x921D, 0x4E43,
+ 0x921E, 0x921E, 0x1FD5, 0x921F, 0x9222, 0x4E4B, 0x9223, 0x9223, 0x1F11,
+ 0x9224, 0x9224, 0x4E4F, 0x9225, 0x9225, 0x2507, 0x9226, 0x9226, 0x2500,
+ 0x9227, 0x9227, 0x2505, 0x9228, 0x922D, 0x4E50, 0x922E, 0x922E, 0x2519,
+ 0x922F, 0x922F, 0x4E56, 0x9230, 0x9230, 0x2515, 0x9231, 0x9232, 0x4E57,
+ 0x9233, 0x9233, 0x250C, 0x9234, 0x9234, 0x2031, 0x9235, 0x9236, 0x4E59,
+ 0x9237, 0x9237, 0x250B, 0x9238, 0x9238, 0x250F, 0x9239, 0x9239, 0x251A,
+ 0x923A, 0x923A, 0x2509, 0x923B, 0x923C, 0x4E5B, 0x923D, 0x923D, 0x250E,
+ 0x923E, 0x923E, 0x2234, 0x923F, 0x923F, 0x2513, 0x9240, 0x9240, 0x1F80,
+ 0x9241, 0x9244, 0x4E5D, 0x9245, 0x9245, 0x2501, 0x9246, 0x9247, 0x4E61,
+ 0x9248, 0x9248, 0x2517, 0x9249, 0x9249, 0x2516, 0x924A, 0x924C, 0x4E63,
+ 0x924D, 0x924D, 0x2518, 0x924E, 0x9250, 0x4E66, 0x9251, 0x9251, 0x1E56,
+ 0x9252, 0x9254, 0x4E69, 0x9255, 0x9255, 0x250D, 0x9256, 0x9256, 0x4E6C,
+ 0x9257, 0x9257, 0x20D3, 0x9258, 0x9259, 0x4E6D, 0x925A, 0x925A, 0x207A,
+ 0x925B, 0x925B, 0x20CE, 0x925C, 0x925D, 0x4E6F, 0x925E, 0x925E, 0x2510,
+ 0x925F, 0x9261, 0x4E71, 0x9262, 0x9262, 0x1E55, 0x9263, 0x9265, 0x4E74,
+ 0x9266, 0x9266, 0x250A, 0x9267, 0x926B, 0x4E77, 0x926C, 0x926D, 0x2511,
+ 0x926E, 0x9273, 0x4E7C, 0x9274, 0x9274, 0x086B, 0x9275, 0x9277, 0x4E82,
+ 0x9278, 0x9278, 0x1FAA, 0x9279, 0x9279, 0x4E85, 0x927A, 0x927A, 0x251E,
+ 0x927B, 0x927B, 0x1F1F, 0x927C, 0x927E, 0x4E86, 0x927F, 0x927F, 0x252D,
+ 0x9280, 0x9280, 0x221D, 0x9281, 0x9282, 0x4E89, 0x9283, 0x9283, 0x2532,
+ 0x9284, 0x9284, 0x4E8B, 0x9285, 0x9285, 0x217B, 0x9286, 0x928D, 0x4E8C,
+ 0x928E, 0x928E, 0x1D80, 0x928F, 0x9290, 0x4E94, 0x9291, 0x9291, 0x21AF,
+ 0x9292, 0x9292, 0x4E96, 0x9293, 0x9293, 0x252C, 0x9294, 0x9295, 0x4E97,
+ 0x9296, 0x9296, 0x2528, 0x9297, 0x9297, 0x4E99, 0x9298, 0x9298, 0x208C,
+ 0x9299, 0x9299, 0x4E9A, 0x929A, 0x929A, 0x252F, 0x929B, 0x929B, 0x4E9B,
+ 0x929C, 0x929C, 0x21BC, 0x929D, 0x929F, 0x4E9C, 0x92A0, 0x92A0, 0x251D,
+ 0x92A1, 0x92A2, 0x4E9F, 0x92A3, 0x92A3, 0x2535, 0x92A4, 0x92A4, 0x4EA1,
+ 0x92A5, 0x92A5, 0x220D, 0x92A6, 0x92A6, 0x2526, 0x92A7, 0x92A7, 0x4EA2,
+ 0x92A8, 0x92A8, 0x2534, 0x92A9, 0x92A9, 0x252A, 0x92AA, 0x92AA, 0x251F,
+ 0x92AB, 0x92AB, 0x2531, 0x92AC, 0x92AC, 0x251C, 0x92AD, 0x92AD, 0x4EA3,
+ 0x92AE, 0x92AE, 0x1D81, 0x92AF, 0x92B0, 0x4EA4, 0x92B1, 0x92B1, 0x2525,
+ 0x92B2, 0x92B6, 0x4EA6, 0x92B7, 0x92B7, 0x21CD, 0x92B8, 0x92B8, 0x4EAB,
+ 0x92B9, 0x92B9, 0x21DA, 0x92BA, 0x92BA, 0x4EAC, 0x92BB, 0x92BB, 0x2172,
+ 0x92BC, 0x92BC, 0x253E, 0x92BD, 0x92C0, 0x4EAD, 0x92C1, 0x92C1, 0x204F,
+ 0x92C2, 0x92C2, 0x4EB1, 0x92C3, 0x92C3, 0x2543, 0x92C4, 0x92C4, 0x4EB2,
+ 0x92C5, 0x92C5, 0x21D7, 0x92C6, 0x92C6, 0x4EB3, 0x92C7, 0x92C7, 0x1E3C,
+ 0x92C8, 0x92C8, 0x1D82, 0x92C9, 0x92CB, 0x4EB4, 0x92CC, 0x92CC, 0x2529,
+ 0x92CD, 0x92CE, 0x4EB7, 0x92CF, 0x92CF, 0x2521, 0x92D0, 0x92D1, 0x4EB9,
+ 0x92D2, 0x92D2, 0x1EFF, 0x92D3, 0x92DC, 0x4EBB, 0x92DD, 0x92DD, 0x253F,
+ 0x92DE, 0x92DE, 0x4EC5, 0x92DF, 0x92DF, 0x2544, 0x92E0, 0x92E2, 0x4EC6,
+ 0x92E3, 0x92E3, 0x2523, 0x92E4, 0x92E4, 0x1E90, 0x92E5, 0x92E5, 0x253A,
+ 0x92E6, 0x92E6, 0x2545, 0x92E7, 0x92E7, 0x4EC9, 0x92E8, 0x92E8, 0x253D,
+ 0x92E9, 0x92E9, 0x4ECA, 0x92EA, 0x92EA, 0x20C1, 0x92EB, 0x92EC, 0x4ECB,
+ 0x92ED, 0x92ED, 0x2103, 0x92EE, 0x92EE, 0x2520, 0x92EF, 0x92EF, 0x253C,
+ 0x92F0, 0x92F0, 0x253B, 0x92F1, 0x92F1, 0x2538, 0x92F2, 0x92F5, 0x4ECD,
+ 0x92F6, 0x92F6, 0x2540, 0x92F7, 0x92F7, 0x4ED1, 0x92F8, 0x92F8, 0x1FCD,
+ 0x92F9, 0x92FB, 0x4ED2, 0x92FC, 0x92FC, 0x1F18, 0x92FD, 0x92FF, 0x4ED5,
+ 0x9300, 0x9300, 0x4ED8, 0x9301, 0x9301, 0x254B, 0x9302, 0x9305, 0x4ED9,
+ 0x9306, 0x9306, 0x2547, 0x9307, 0x9308, 0x254F, 0x9309, 0x930F, 0x4EDD,
+ 0x9310, 0x9310, 0x22B0, 0x9311, 0x9311, 0x4EE4, 0x9312, 0x9312, 0x2546,
+ 0x9313, 0x9314, 0x4EE5, 0x9315, 0x9315, 0x254C, 0x9316, 0x9317, 0x4EE7,
+ 0x9318, 0x9318, 0x1E9A, 0x9319, 0x9319, 0x2552, 0x931A, 0x931A, 0x2530,
+ 0x931B, 0x931B, 0x2549, 0x931C, 0x931E, 0x4EE9, 0x931F, 0x931F, 0x2551,
+ 0x9320, 0x9320, 0x1ECA, 0x9321, 0x9321, 0x4EEC, 0x9322, 0x9322, 0x20D2,
+ 0x9323, 0x9325, 0x4EED, 0x9326, 0x9326, 0x1FB8, 0x9327, 0x9327, 0x4EF0,
+ 0x9328, 0x9328, 0x2079, 0x9329, 0x932A, 0x4EF1, 0x932B, 0x932B, 0x21AB,
+ 0x932C, 0x932D, 0x4EF3, 0x932E, 0x932E, 0x254D, 0x932F, 0x932F, 0x1EA5,
+ 0x9330, 0x9331, 0x4EF5, 0x9332, 0x9332, 0x204C, 0x9333, 0x9333, 0x2080,
+ 0x9334, 0x9335, 0x4EF7, 0x9336, 0x9336, 0x266D, 0x9337, 0x9337, 0x4EF9,
+ 0x9338, 0x9338, 0x2537, 0x9339, 0x933D, 0x4EFA, 0x933E, 0x933E, 0x1D83,
+ 0x933F, 0x933F, 0x4EFF, 0x9340, 0x9340, 0x254A, 0x9341, 0x9341, 0x21B8,
+ 0x9342, 0x9342, 0x4F00, 0x9343, 0x9343, 0x254E, 0x9344, 0x9345, 0x4F01,
+ 0x9346, 0x9346, 0x24FC, 0x9347, 0x9347, 0x2554, 0x9348, 0x934A, 0x4F03,
+ 0x934B, 0x934B, 0x1F3C, 0x934C, 0x934C, 0x4F06, 0x934D, 0x934D, 0x1ED5,
+ 0x934E, 0x9353, 0x4F07, 0x9354, 0x9354, 0x2556, 0x9355, 0x9357, 0x4F0D,
+ 0x9358, 0x9358, 0x2268, 0x9359, 0x935A, 0x4F10, 0x935B, 0x935B, 0x1ED6,
+ 0x935C, 0x9363, 0x4F12, 0x9364, 0x9364, 0x2557, 0x9365, 0x9365, 0x2553,
+ 0x9366, 0x9368, 0x4F1A, 0x9369, 0x9369, 0x2548, 0x936A, 0x936A, 0x1D84,
+ 0x936B, 0x936B, 0x4F1D, 0x936C, 0x936C, 0x20DC, 0x936D, 0x936F, 0x4F1E,
+ 0x9370, 0x9370, 0x2559, 0x9371, 0x9374, 0x4F21, 0x9375, 0x9375, 0x1F97,
+ 0x9376, 0x9376, 0x2555, 0x9377, 0x9379, 0x4F25, 0x937A, 0x937A, 0x227D,
+ 0x937B, 0x937D, 0x4F28, 0x937E, 0x937E, 0x257E, 0x937F, 0x9381, 0x4F2B,
+ 0x9382, 0x9382, 0x207C, 0x9383, 0x9383, 0x4F2E, 0x9384, 0x9384, 0x255A,
+ 0x9385, 0x9386, 0x4F2F, 0x9387, 0x9387, 0x255E, 0x9388, 0x9389, 0x4F31,
+ 0x938A, 0x938A, 0x1E34, 0x938B, 0x938E, 0x4F33, 0x938F, 0x938F, 0x1D86,
+ 0x9390, 0x9395, 0x4F37, 0x9396, 0x9396, 0x215E, 0x9397, 0x9397, 0x4F3D,
+ 0x9398, 0x9398, 0x2560, 0x9399, 0x93A1, 0x4F3E, 0x93A2, 0x93A2, 0x21A2,
+ 0x93A3, 0x93A3, 0x2354, 0x93A4, 0x93A5, 0x4F47, 0x93A6, 0x93A6, 0x2563,
+ 0x93A7, 0x93A7, 0x2527, 0x93A8, 0x93A8, 0x4F49, 0x93A9, 0x93A9, 0x252E,
+ 0x93AA, 0x93AA, 0x2558, 0x93AB, 0x93AB, 0x4F4A, 0x93AC, 0x93AC, 0x1F1B,
+ 0x93AD, 0x93AD, 0x4F4B, 0x93AE, 0x93AE, 0x2283, 0x93AF, 0x93AF, 0x4F4C,
+ 0x93B0, 0x93B0, 0x2564, 0x93B1, 0x93B2, 0x4F4D, 0x93B3, 0x93B3, 0x20A0,
+ 0x93B4, 0x93B4, 0x4F4F, 0x93B5, 0x93B5, 0x2565, 0x93B6, 0x93B7, 0x4F50,
+ 0x93B8, 0x93B8, 0x2561, 0x93B9, 0x93BE, 0x4F52, 0x93BF, 0x93BF, 0x2562,
+ 0x93C0, 0x93C2, 0x4F58, 0x93C3, 0x93C3, 0x256C, 0x93C4, 0x93C6, 0x4F5B,
+ 0x93C7, 0x93C7, 0x256D, 0x93C8, 0x93C8, 0x2020, 0x93C9, 0x93C9, 0x4F5E,
+ 0x93CA, 0x93CA, 0x1D85, 0x93CB, 0x93CB, 0x4F5F, 0x93CC, 0x93CC, 0x255F,
+ 0x93CD, 0x93CD, 0x256A, 0x93CE, 0x93D0, 0x4F60, 0x93D1, 0x93D1, 0x256E,
+ 0x93D2, 0x93D5, 0x4F63, 0x93D6, 0x93D6, 0x1E01, 0x93D7, 0x93D7, 0x2539,
+ 0x93D8, 0x93D8, 0x255C, 0x93D9, 0x93DB, 0x4F67, 0x93DC, 0x93DD, 0x2568,
+ 0x93DE, 0x93DE, 0x256B, 0x93DF, 0x93DF, 0x1E6F, 0x93E0, 0x93E0, 0x4F6A,
+ 0x93E1, 0x93E1, 0x1FC4, 0x93E2, 0x93E2, 0x2567, 0x93E3, 0x93E3, 0x4F6B,
+ 0x93E4, 0x93E4, 0x255B, 0x93E5, 0x93E7, 0x4F6C, 0x93E8, 0x93E8, 0x261D,
+ 0x93E9, 0x93F4, 0x4F6F, 0x93F5, 0x93F5, 0x252B, 0x93F6, 0x93F6, 0x4F7B,
+ 0x93F7, 0x93F7, 0x2571, 0x93F8, 0x93F8, 0x4F7C, 0x93F9, 0x93F9, 0x2577,
+ 0x93FA, 0x93FF, 0x4F7D, 0x9400, 0x9402, 0x4F83, 0x9403, 0x9403, 0x2522,
+ 0x9404, 0x940A, 0x4F86, 0x940B, 0x940B, 0x2533, 0x940C, 0x940F, 0x4F8D,
+ 0x9410, 0x9410, 0x202A, 0x9411, 0x9411, 0x4F91, 0x9412, 0x9412, 0x2536,
+ 0x9413, 0x9413, 0x2573, 0x9414, 0x9414, 0x256F, 0x9415, 0x9417, 0x4F92,
+ 0x9418, 0x9418, 0x2293, 0x9419, 0x9419, 0x2578, 0x941A, 0x941C, 0x4F95,
+ 0x941D, 0x941D, 0x2570, 0x941E, 0x941F, 0x4F98, 0x9420, 0x9420, 0x2575,
+ 0x9421, 0x9425, 0x4F9A, 0x9426, 0x9427, 0x2541, 0x9428, 0x9428, 0x255D,
+ 0x9429, 0x942D, 0x4F9F, 0x942E, 0x942E, 0x201A, 0x942F, 0x9431, 0x4FA4,
+ 0x9432, 0x9432, 0x257A, 0x9433, 0x9433, 0x2006, 0x9434, 0x9434, 0x4FA7,
+ 0x9435, 0x9435, 0x2177, 0x9436, 0x9437, 0x4FA8, 0x9438, 0x9438, 0x251B,
+ 0x9439, 0x9439, 0x4FAA, 0x943A, 0x943A, 0x2524, 0x943B, 0x943D, 0x4FAB,
+ 0x943E, 0x943E, 0x1D87, 0x943F, 0x943F, 0x257B, 0x9440, 0x9443, 0x4FAE,
+ 0x9444, 0x9444, 0x22A3, 0x9445, 0x9449, 0x4FB2, 0x944A, 0x944A, 0x2579,
+ 0x944B, 0x944B, 0x4FB7, 0x944C, 0x944C, 0x2566, 0x944D, 0x9451, 0x4FB8,
+ 0x9452, 0x9452, 0x1F93, 0x9453, 0x9453, 0x4FBD, 0x9454, 0x9454, 0x257C,
+ 0x9455, 0x945F, 0x4FBE, 0x9460, 0x9460, 0x2514, 0x9461, 0x9462, 0x4FC9,
+ 0x9463, 0x9463, 0x257D, 0x9464, 0x9464, 0x4FCB, 0x9465, 0x9465, 0x2572,
+ 0x9466, 0x946A, 0x4FCC, 0x946B, 0x946B, 0x1D88, 0x946C, 0x946C, 0x4FD1,
+ 0x946D, 0x946D, 0x2574, 0x946E, 0x946F, 0x4FD2, 0x9470, 0x9470, 0x224E,
+ 0x9471, 0x9471, 0x4FD4, 0x9472, 0x9472, 0x21C6, 0x9473, 0x9476, 0x4FD5,
+ 0x9477, 0x9477, 0x209F, 0x9478, 0x9478, 0x4FD9, 0x9479, 0x9479, 0x2576,
+ 0x947A, 0x947B, 0x4FDA, 0x947C, 0x947C, 0x2064, 0x947D, 0x947D, 0x22BF,
+ 0x947E, 0x947E, 0x261C, 0x947F, 0x947F, 0x225E, 0x9480, 0x9484, 0x4FDC,
+ 0x9485, 0x9487, 0x1A8E, 0x9488, 0x9488, 0x118C, 0x9489, 0x9489, 0x05E3,
+ 0x948A, 0x948A, 0x1A92, 0x948B, 0x948B, 0x1A91, 0x948C, 0x948D, 0x1A93,
+ 0x948E, 0x948E, 0x0C22, 0x948F, 0x9490, 0x1A95, 0x9491, 0x9491, 0x4FE1,
+ 0x9492, 0x9492, 0x064D, 0x9493, 0x9493, 0x05D7, 0x9494, 0x9494, 0x1A97,
+ 0x9495, 0x9495, 0x1A99, 0x9496, 0x9496, 0x4FE2, 0x9497, 0x9497, 0x1A98,
+ 0x9498, 0x9498, 0x4FE3, 0x9499, 0x9499, 0x06C1, 0x949A, 0x949C, 0x1A9A,
+ 0x949D, 0x949D, 0x061A, 0x949E, 0x949E, 0x04D3, 0x949F, 0x949F, 0x11D2,
+ 0x94A0, 0x94A0, 0x0B29, 0x94A1, 0x94A1, 0x041E, 0x94A2, 0x94A2, 0x06D1,
+ 0x94A3, 0x94A4, 0x1A9D, 0x94A5, 0x94A5, 0x1102, 0x94A6, 0x94A6, 0x0C52,
+ 0x94A7, 0x94A7, 0x092A, 0x94A8, 0x94A8, 0x0EE8, 0x94A9, 0x94A9, 0x070C,
+ 0x94AA, 0x94AA, 0x1AA0, 0x94AB, 0x94AB, 0x1A9F, 0x94AC, 0x94AC, 0x1AA2,
+ 0x94AD, 0x94AD, 0x1AA1, 0x94AE, 0x94AE, 0x0B66, 0x94AF, 0x94B0, 0x1AA3,
+ 0x94B1, 0x94B1, 0x0C2B, 0x94B2, 0x94B2, 0x1AA5, 0x94B3, 0x94B3, 0x0C2C,
+ 0x94B4, 0x94B4, 0x1AA6, 0x94B5, 0x94B5, 0x046E, 0x94B6, 0x94BA, 0x1AA7,
+ 0x94BB, 0x94BB, 0x1247, 0x94BC, 0x94BD, 0x1AAC, 0x94BE, 0x94BE, 0x084B,
+ 0x94BF, 0x94BF, 0x1AAE, 0x94C0, 0x94C0, 0x10B0, 0x94C1, 0x94C1, 0x0E4D,
+ 0x94C2, 0x94C2, 0x0473, 0x94C3, 0x94C3, 0x0A2E, 0x94C4, 0x94C4, 0x1AAF,
+ 0x94C5, 0x94C5, 0x0C23, 0x94C6, 0x94C6, 0x0AB2, 0x94C7, 0x94C7, 0x4FE4,
+ 0x94C8, 0x94CE, 0x1AB0, 0x94CF, 0x94CF, 0x4FE5, 0x94D0, 0x94D2, 0x1AB7,
+ 0x94D3, 0x94D4, 0x4FE6, 0x94D5, 0x94D7, 0x1ABA, 0x94D8, 0x94D8, 0x1ABE,
+ 0x94D9, 0x94D9, 0x1ABD, 0x94DA, 0x94DA, 0x4FE8, 0x94DB, 0x94DB, 0x1ABF,
+ 0x94DC, 0x94DC, 0x0E5E, 0x94DD, 0x94DD, 0x0A68, 0x94DE, 0x94E0, 0x1AC0,
+ 0x94E1, 0x94E1, 0x1142, 0x94E2, 0x94E2, 0x1AC3, 0x94E3, 0x94E3, 0x0F20,
+ 0x94E4, 0x94E5, 0x1AC4, 0x94E6, 0x94E6, 0x4FE9, 0x94E7, 0x94E8, 0x1AC6,
+ 0x94E9, 0x94E9, 0x1AC9, 0x94EA, 0x94EA, 0x1AC8, 0x94EB, 0x94EB, 0x1ACA,
+ 0x94EC, 0x94EC, 0x06F0, 0x94ED, 0x94ED, 0x0AFF, 0x94EE, 0x94EF, 0x1ACB,
+ 0x94F0, 0x94F0, 0x0893, 0x94F1, 0x94F1, 0x1046, 0x94F2, 0x94F2, 0x04C0,
+ 0x94F3, 0x94F5, 0x1ACD, 0x94F6, 0x94F6, 0x107F, 0x94F7, 0x94F7, 0x1AD0,
+ 0x94F8, 0x94F8, 0x11FC, 0x94F9, 0x94F9, 0x1AD1, 0x94FA, 0x94FA, 0x0BEB,
+ 0x94FB, 0x94FB, 0x4FEA, 0x94FC, 0x94FD, 0x1AD2, 0x94FE, 0x94FE, 0x09FD,
+ 0x94FF, 0x94FF, 0x1AD4, 0x9500, 0x9500, 0x0F67, 0x9501, 0x9501, 0x0DED,
+ 0x9502, 0x9502, 0x1AD6, 0x9503, 0x9503, 0x1AD5, 0x9504, 0x9504, 0x051F,
+ 0x9505, 0x9505, 0x0751, 0x9506, 0x9507, 0x1AD7, 0x9508, 0x9508, 0x0FAD,
+ 0x9509, 0x950A, 0x1AD9, 0x950B, 0x950B, 0x0683, 0x950C, 0x950C, 0x0F8A,
+ 0x950D, 0x950F, 0x1ADB, 0x9510, 0x9510, 0x0CCC, 0x9511, 0x9511, 0x0E33,
+ 0x9512, 0x9516, 0x1ADE, 0x9517, 0x9517, 0x1181, 0x9518, 0x9518, 0x1AE3,
+ 0x9519, 0x9519, 0x0570, 0x951A, 0x951A, 0x0AAF, 0x951B, 0x951B, 0x1AE4,
+ 0x951C, 0x951C, 0x4FEB, 0x951D, 0x951F, 0x1AE5, 0x9520, 0x9520, 0x4FEC,
+ 0x9521, 0x9521, 0x0F0C, 0x9522, 0x9522, 0x1AE8, 0x9523, 0x9523, 0x0A87,
+ 0x9524, 0x9524, 0x053B, 0x9525, 0x9525, 0x1213, 0x9526, 0x9526, 0x08C6,
+ 0x9527, 0x9527, 0x4FED, 0x9528, 0x9528, 0x0F34, 0x9529, 0x9529, 0x1AEB,
+ 0x952A, 0x952B, 0x1AE9, 0x952C, 0x952C, 0x1AEC, 0x952D, 0x952D, 0x05E6,
+ 0x952E, 0x952E, 0x086F, 0x952F, 0x952F, 0x0911, 0x9530, 0x9530, 0x0AD1,
+ 0x9531, 0x9532, 0x1AED, 0x9533, 0x9533, 0x4FEE, 0x9534, 0x9534, 0x1AEF,
+ 0x9535, 0x9535, 0x1AF7, 0x9536, 0x9538, 0x1AF0, 0x9539, 0x9539, 0x0C3F,
+ 0x953A, 0x953A, 0x1B19, 0x953B, 0x953B, 0x060C, 0x953C, 0x953C, 0x1AF3,
+ 0x953D, 0x953D, 0x4FEF, 0x953E, 0x953F, 0x1AF4, 0x9540, 0x9540, 0x0605,
+ 0x9541, 0x9541, 0x0AC3, 0x9542, 0x9542, 0x1AF6, 0x9543, 0x9543, 0x4FF0,
+ 0x9544, 0x9546, 0x1AF8, 0x9547, 0x9547, 0x1193, 0x9548, 0x9548, 0x4FF1,
+ 0x9549, 0x9549, 0x1AFB, 0x954A, 0x954A, 0x0B5A, 0x954B, 0x954B, 0x4FF2,
+ 0x954C, 0x954C, 0x1AFC, 0x954D, 0x954D, 0x0B5B, 0x954E, 0x954F, 0x1AFD,
+ 0x9550, 0x9550, 0x06DF, 0x9551, 0x9551, 0x0402, 0x9552, 0x9554, 0x1AFF,
+ 0x9555, 0x9555, 0x4FF3, 0x9556, 0x9559, 0x1B02, 0x955A, 0x955A, 0x4FF4,
+ 0x955B, 0x955B, 0x1B06, 0x955C, 0x955C, 0x08E4, 0x955D, 0x955D, 0x1B09,
+ 0x955E, 0x955F, 0x1B07, 0x9560, 0x9560, 0x4FF5, 0x9561, 0x9562, 0x1B0A,
+ 0x9563, 0x9563, 0x0A16, 0x9564, 0x956C, 0x1B0C, 0x956D, 0x956D, 0x09C3,
+ 0x956E, 0x956E, 0x4FF6, 0x956F, 0x956F, 0x1B15, 0x9570, 0x9570, 0x09F6,
+ 0x9571, 0x9573, 0x1B16, 0x9574, 0x9575, 0x4FF7, 0x9576, 0x9576, 0x0F4F,
+ 0x9577, 0x9577, 0x1E75, 0x9578, 0x957E, 0x4FF9, 0x957F, 0x957F, 0x04C9,
+ 0x9580, 0x9580, 0x207D, 0x9581, 0x9581, 0x5000, 0x9582, 0x9582, 0x23BF,
+ 0x9583, 0x9583, 0x2113, 0x9584, 0x9585, 0x5001, 0x9586, 0x9586, 0x23C0,
+ 0x9587, 0x9588, 0x5003, 0x9589, 0x9589, 0x1E45, 0x958A, 0x958A, 0x5005,
+ 0x958B, 0x958B, 0x1FD8, 0x958C, 0x958C, 0x23C4, 0x958D, 0x958D, 0x5006,
+ 0x958E, 0x958E, 0x23C2, 0x958F, 0x958F, 0x2104, 0x9590, 0x9590, 0x5007,
+ 0x9591, 0x9591, 0x21BD, 0x9592, 0x9592, 0x5008, 0x9593, 0x9593, 0x1F87,
+ 0x9594, 0x9594, 0x23C3, 0x9595, 0x9597, 0x5009, 0x9598, 0x9598, 0x2269,
+ 0x9599, 0x95A0, 0x500C, 0x95A1, 0x95A1, 0x1F43, 0x95A2, 0x95A2, 0x5014,
+ 0x95A3, 0x95A3, 0x1F1E, 0x95A4, 0x95A4, 0x2679, 0x95A5, 0x95A5, 0x1EEB,
+ 0x95A6, 0x95A7, 0x5015, 0x95A8, 0x95A8, 0x1F35, 0x95A9, 0x95A9, 0x208A,
+ 0x95AA, 0x95AA, 0x5017, 0x95AB, 0x95AB, 0x23C7, 0x95AC, 0x95AC, 0x23C9,
+ 0x95AD, 0x95AD, 0x23C6, 0x95AE, 0x95B1, 0x5018, 0x95B2, 0x95B2, 0x224F,
+ 0x95B3, 0x95B5, 0x501C, 0x95B6, 0x95B6, 0x23CB, 0x95B7, 0x95B8, 0x501F,
+ 0x95B9, 0x95B9, 0x21F3, 0x95BA, 0x95BA, 0x5021, 0x95BB, 0x95BB, 0x21F7,
+ 0x95BC, 0x95BC, 0x23CF, 0x95BD, 0x95BD, 0x23CE, 0x95BE, 0x95BE, 0x23CA,
+ 0x95BF, 0x95BF, 0x23CD, 0x95C0, 0x95C2, 0x5022, 0x95C3, 0x95C3, 0x23D0,
+ 0x95C4, 0x95C5, 0x5025, 0x95C6, 0x95C6, 0x266C, 0x95C7, 0x95C7, 0x5027,
+ 0x95C8, 0x95C8, 0x23C1, 0x95C9, 0x95C9, 0x5028, 0x95CA, 0x95CA, 0x1FEE,
+ 0x95CB, 0x95CB, 0x23D1, 0x95CC, 0x95CC, 0x1FF8, 0x95CD, 0x95CF, 0x5029,
+ 0x95D0, 0x95D0, 0x23D3, 0x95D1, 0x95D3, 0x502C, 0x95D4, 0x95D4, 0x23D2,
+ 0x95D5, 0x95D5, 0x23D4, 0x95D6, 0x95D6, 0x1E98, 0x95D7, 0x95DB, 0x502F,
+ 0x95DC, 0x95DC, 0x1F2C, 0x95DD, 0x95DD, 0x5034, 0x95DE, 0x95DE, 0x23D5,
+ 0x95DF, 0x95E0, 0x5035, 0x95E1, 0x95E1, 0x1E71, 0x95E2, 0x95E2, 0x2691,
+ 0x95E3, 0x95E4, 0x5037, 0x95E5, 0x95E5, 0x23C5, 0x95E6, 0x95E7, 0x5039,
+ 0x95E8, 0x95E8, 0x0ACA, 0x95E9, 0x95E9, 0x1685, 0x95EA, 0x95EA, 0x0CFA,
+ 0x95EB, 0x95EB, 0x1686, 0x95EC, 0x95EC, 0x503B, 0x95ED, 0x95ED, 0x043E,
+ 0x95EE, 0x95EE, 0x0ED9, 0x95EF, 0x95EF, 0x0536, 0x95F0, 0x95F0, 0x0CCD,
+ 0x95F1, 0x95F1, 0x1687, 0x95F2, 0x95F2, 0x0F3D, 0x95F3, 0x95F3, 0x1688,
+ 0x95F4, 0x95F4, 0x0857, 0x95F5, 0x95F6, 0x1689, 0x95F7, 0x95F7, 0x0ACB,
+ 0x95F8, 0x95F8, 0x1143, 0x95F9, 0x95F9, 0x0B39, 0x95FA, 0x95FA, 0x0744,
+ 0x95FB, 0x95FB, 0x0ED4, 0x95FC, 0x95FC, 0x168B, 0x95FD, 0x95FD, 0x0AFB,
+ 0x95FE, 0x95FE, 0x168C, 0x95FF, 0x95FF, 0x503C, 0x9600, 0x9600, 0x0644,
+ 0x9601, 0x9601, 0x06EE, 0x9602, 0x9602, 0x0789, 0x9603, 0x9604, 0x168D,
+ 0x9605, 0x9605, 0x1107, 0x9606, 0x9606, 0x168F, 0x9607, 0x9607, 0x503D,
+ 0x9608, 0x9608, 0x1690, 0x9609, 0x9609, 0x0FF4, 0x960A, 0x960D, 0x1691,
+ 0x960E, 0x960E, 0x0FFF, 0x960F, 0x960F, 0x1695, 0x9610, 0x9610, 0x04C2,
+ 0x9611, 0x9611, 0x09A6, 0x9612, 0x9612, 0x1696, 0x9613, 0x9613, 0x503E,
+ 0x9614, 0x9614, 0x0996, 0x9615, 0x9617, 0x1697, 0x9618, 0x9618, 0x503F,
+ 0x9619, 0x961A, 0x169A, 0x961B, 0x961B, 0x5040, 0x961C, 0x961C, 0x06B2,
+ 0x961D, 0x961D, 0x1354, 0x961E, 0x961E, 0x5041, 0x961F, 0x961F, 0x0612,
+ 0x9620, 0x9620, 0x5042, 0x9621, 0x9621, 0x1356, 0x9622, 0x9622, 0x1355,
+ 0x9623, 0x9629, 0x5043, 0x962A, 0x962A, 0x1358, 0x962B, 0x962D, 0x504A,
+ 0x962E, 0x962E, 0x0CC9, 0x962F, 0x9630, 0x504D, 0x9631, 0x9631, 0x1357,
+ 0x9632, 0x9632, 0x065D, 0x9633, 0x9633, 0x101D, 0x9634, 0x9634, 0x107C,
+ 0x9635, 0x9635, 0x1194, 0x9636, 0x9636, 0x08A8, 0x9637, 0x963A, 0x504F,
+ 0x963B, 0x963B, 0x1245, 0x963C, 0x963C, 0x135A, 0x963D, 0x963D, 0x1359,
+ 0x963E, 0x963E, 0x5053, 0x963F, 0x963F, 0x03AD, 0x9640, 0x9640, 0x0E84,
+ 0x9641, 0x9641, 0x5054, 0x9642, 0x9642, 0x135B, 0x9643, 0x9643, 0x5055,
+ 0x9644, 0x9644, 0x06B8, 0x9645, 0x9645, 0x083D, 0x9646, 0x9646, 0x0A64,
+ 0x9647, 0x9647, 0x0A4B, 0x9648, 0x9648, 0x04E7, 0x9649, 0x9649, 0x135C,
+ 0x964A, 0x964A, 0x5056, 0x964B, 0x964B, 0x0A51, 0x964C, 0x964C, 0x0B13,
+ 0x964D, 0x964D, 0x0886, 0x964E, 0x964F, 0x5057, 0x9650, 0x9650, 0x0F4B,
+ 0x9651, 0x9653, 0x5059, 0x9654, 0x9654, 0x135D, 0x9655, 0x9655, 0x0CFB,
+ 0x9656, 0x9657, 0x505C, 0x9658, 0x9658, 0x231A, 0x9659, 0x965A, 0x505E,
+ 0x965B, 0x965B, 0x0446, 0x965C, 0x965C, 0x5060, 0x965D, 0x965D, 0x2114,
+ 0x965E, 0x965E, 0x5061, 0x965F, 0x965F, 0x135E, 0x9660, 0x9660, 0x5062,
+ 0x9661, 0x9661, 0x05F7, 0x9662, 0x9662, 0x10FD, 0x9663, 0x9663, 0x2284,
+ 0x9664, 0x9664, 0x0522, 0x9665, 0x9666, 0x5063, 0x9667, 0x9667, 0x135F,
+ 0x9668, 0x9668, 0x110C, 0x9669, 0x9669, 0x0F42, 0x966A, 0x966A, 0x0BA4,
+ 0x966B, 0x966B, 0x5065, 0x966C, 0x966C, 0x1360, 0x966D, 0x966F, 0x5066,
+ 0x9670, 0x9670, 0x221C, 0x9671, 0x9671, 0x5069, 0x9672, 0x9672, 0x1361,
+ 0x9673, 0x9673, 0x1E7E, 0x9674, 0x9674, 0x1362, 0x9675, 0x9675, 0x0A33,
+ 0x9676, 0x9676, 0x0E28, 0x9677, 0x9677, 0x0F4A, 0x9678, 0x9678, 0x204D,
+ 0x9679, 0x967C, 0x506A, 0x967D, 0x967D, 0x2201, 0x967E, 0x9684, 0x506E,
+ 0x9685, 0x9685, 0x10CC, 0x9686, 0x9686, 0x0A48, 0x9687, 0x9687, 0x5075,
+ 0x9688, 0x9688, 0x1363, 0x9689, 0x9689, 0x5076, 0x968A, 0x968A, 0x1ED9,
+ 0x968B, 0x968B, 0x0DDA, 0x968C, 0x968C, 0x5077, 0x968D, 0x968D, 0x1364,
+ 0x968E, 0x968E, 0x1FB2, 0x968F, 0x968F, 0x0DDB, 0x9690, 0x9690, 0x1085,
+ 0x9691, 0x9693, 0x5078, 0x9694, 0x9694, 0x06EF, 0x9695, 0x9695, 0x2252,
+ 0x9696, 0x9696, 0x507B, 0x9697, 0x9697, 0x1365, 0x9698, 0x9698, 0x03BA,
+ 0x9699, 0x9699, 0x0F23, 0x969A, 0x969A, 0x507C, 0x969B, 0x969B, 0x1F79,
+ 0x969C, 0x969C, 0x1170, 0x969D, 0x96A6, 0x507D, 0x96A7, 0x96A7, 0x0DE2,
+ 0x96A8, 0x96A8, 0x2157, 0x96A9, 0x96A9, 0x5087, 0x96AA, 0x96AA, 0x21BF,
+ 0x96AB, 0x96AF, 0x5088, 0x96B0, 0x96B0, 0x1366, 0x96B1, 0x96B1, 0x221F,
+ 0x96B2, 0x96B2, 0x508D, 0x96B3, 0x96B3, 0x1684, 0x96B4, 0x96B4, 0x203D,
+ 0x96B5, 0x96B5, 0x508E, 0x96B6, 0x96B6, 0x09EE, 0x96B7, 0x96B7, 0x508F,
+ 0x96B8, 0x96B8, 0x2015, 0x96B9, 0x96B9, 0x1D79, 0x96BA, 0x96BA, 0x5090,
+ 0x96BB, 0x96BB, 0x26A5, 0x96BC, 0x96BD, 0x1D7A, 0x96BE, 0x96BE, 0x0B34,
+ 0x96BF, 0x96BF, 0x5091, 0x96C0, 0x96C0, 0x0C93, 0x96C1, 0x96C1, 0x100C,
+ 0x96C2, 0x96C3, 0x5092, 0x96C4, 0x96C4, 0x0FA6, 0x96C5, 0x96C5, 0x0FEE,
+ 0x96C6, 0x96C6, 0x0822, 0x96C7, 0x96C7, 0x0726, 0x96C8, 0x96C8, 0x5094,
+ 0x96C9, 0x96C9, 0x1B1C, 0x96CA, 0x96CB, 0x5095, 0x96CC, 0x96CC, 0x0549,
+ 0x96CD, 0x96CD, 0x109F, 0x96CE, 0x96CE, 0x1D7C, 0x96CF, 0x96CF, 0x0520,
+ 0x96D0, 0x96D1, 0x5097, 0x96D2, 0x96D2, 0x1D7D, 0x96D3, 0x96D4, 0x5099,
+ 0x96D5, 0x96D5, 0x05D2, 0x96D6, 0x96D6, 0x2156, 0x96D7, 0x96D8, 0x509B,
+ 0x96D9, 0x96D9, 0x2144, 0x96DA, 0x96DA, 0x509D, 0x96DB, 0x96DB, 0x1E91,
+ 0x96DC, 0x96DC, 0x2257, 0x96DD, 0x96DF, 0x509E, 0x96E0, 0x96E0, 0x1D7F,
+ 0x96E1, 0x96E1, 0x50A1, 0x96E2, 0x96E2, 0x200A, 0x96E3, 0x96E3, 0x2092,
+ 0x96E4, 0x96E7, 0x50A2, 0x96E8, 0x96E8, 0x10CF, 0x96E9, 0x96E9, 0x1D61,
+ 0x96EA, 0x96EA, 0x0FD2, 0x96EB, 0x96EE, 0x50A6, 0x96EF, 0x96EF, 0x1D63,
+ 0x96F0, 0x96F1, 0x50AA, 0x96F2, 0x96F2, 0x2250, 0x96F3, 0x96F3, 0x1D62,
+ 0x96F4, 0x96F5, 0x50AC, 0x96F6, 0x96F6, 0x0A2C, 0x96F7, 0x96F7, 0x09C2,
+ 0x96F8, 0x96F8, 0x50AE, 0x96F9, 0x96F9, 0x040B, 0x96FA, 0x96FA, 0x50AF,
+ 0x96FB, 0x96FB, 0x1EC3, 0x96FC, 0x96FD, 0x50B0, 0x96FE, 0x96FE, 0x0EFC,
+ 0x96FF, 0x96FF, 0x50B2, 0x9700, 0x9700, 0x0FB3, 0x9701, 0x9701, 0x1D65,
+ 0x9702, 0x9703, 0x50B3, 0x9704, 0x9704, 0x0F63, 0x9705, 0x9705, 0x50B5,
+ 0x9706, 0x9706, 0x1D64, 0x9707, 0x9707, 0x1191, 0x9708, 0x9708, 0x1D66,
+ 0x9709, 0x9709, 0x0ABE, 0x970A, 0x970C, 0x50B6, 0x970D, 0x970D, 0x0809,
+ 0x970E, 0x970E, 0x1D68, 0x970F, 0x970F, 0x1D67, 0x9710, 0x9712, 0x50B9,
+ 0x9713, 0x9713, 0x0B41, 0x9714, 0x9715, 0x50BC, 0x9716, 0x9716, 0x0A21,
+ 0x9717, 0x971B, 0x50BE, 0x971C, 0x971C, 0x0D9F, 0x971D, 0x971D, 0x50C3,
+ 0x971E, 0x971E, 0x0F29, 0x971F, 0x9726, 0x50C4, 0x9727, 0x9727, 0x21A8,
+ 0x9728, 0x9729, 0x50CC, 0x972A, 0x972A, 0x1D69, 0x972B, 0x972C, 0x50CE,
+ 0x972D, 0x972D, 0x1D6A, 0x972E, 0x972F, 0x50D0, 0x9730, 0x9730, 0x1D6B,
+ 0x9731, 0x9731, 0x50D2, 0x9732, 0x9732, 0x0A5D, 0x9733, 0x9737, 0x50D3,
+ 0x9738, 0x9738, 0x03DF, 0x9739, 0x9739, 0x0BBA, 0x973A, 0x973C, 0x50D8,
+ 0x973D, 0x973D, 0x260D, 0x973E, 0x973E, 0x1D6C, 0x973F, 0x9741, 0x50DB,
+ 0x9742, 0x9742, 0x260C, 0x9743, 0x9743, 0x50DE, 0x9744, 0x9744, 0x260E,
+ 0x9745, 0x9747, 0x50DF, 0x9748, 0x9748, 0x2032, 0x9749, 0x9751, 0x50E2,
+ 0x9752, 0x9752, 0x0C5D, 0x9753, 0x9753, 0x1D60, 0x9754, 0x9755, 0x50EB,
+ 0x9756, 0x9756, 0x08E7, 0x9757, 0x9758, 0x50ED, 0x9759, 0x9759, 0x08E1,
+ 0x975A, 0x975A, 0x260B, 0x975B, 0x975B, 0x05C6, 0x975C, 0x975D, 0x50EF,
+ 0x975E, 0x975E, 0x0664, 0x975F, 0x975F, 0x50F1, 0x9760, 0x9760, 0x094C,
+ 0x9761, 0x9761, 0x0AD7, 0x9762, 0x9762, 0x0AEB, 0x9763, 0x9764, 0x50F2,
+ 0x9765, 0x9765, 0x1282, 0x9766, 0x9767, 0x50F4, 0x9768, 0x9768, 0x22C3,
+ 0x9769, 0x9769, 0x06EA, 0x976A, 0x9772, 0x50F6, 0x9773, 0x9773, 0x08CA,
+ 0x9774, 0x9774, 0x0FCE, 0x9775, 0x9775, 0x50FF, 0x9776, 0x9776, 0x03DB,
+ 0x9777, 0x977B, 0x5100, 0x977C, 0x977C, 0x1DC8, 0x977D, 0x9784, 0x5105,
+ 0x9785, 0x9785, 0x1DC9, 0x9786, 0x978A, 0x510D, 0x978B, 0x978B, 0x0F77,
+ 0x978C, 0x978C, 0x5112, 0x978D, 0x978D, 0x03BB, 0x978E, 0x978E, 0x5113,
+ 0x978F, 0x978F, 0x1F23, 0x9790, 0x9790, 0x5114, 0x9791, 0x9792, 0x1DCA,
+ 0x9793, 0x9793, 0x5115, 0x9794, 0x9794, 0x1DCC, 0x9795, 0x9797, 0x5116,
+ 0x9798, 0x9798, 0x0C47, 0x9799, 0x979F, 0x5119, 0x97A0, 0x97A0, 0x08FE,
+ 0x97A1, 0x97A2, 0x5120, 0x97A3, 0x97A3, 0x1DCF, 0x97A4, 0x97A5, 0x5122,
+ 0x97A6, 0x97A6, 0x2695, 0x97A7, 0x97AA, 0x5124, 0x97AB, 0x97AB, 0x1DCE,
+ 0x97AC, 0x97AC, 0x5128, 0x97AD, 0x97AD, 0x0447, 0x97AE, 0x97AE, 0x5129,
+ 0x97AF, 0x97AF, 0x1DCD, 0x97B0, 0x97B1, 0x512A, 0x97B2, 0x97B2, 0x1DD0,
+ 0x97B3, 0x97B3, 0x512C, 0x97B4, 0x97B4, 0x1DD1, 0x97B5, 0x97BC, 0x512D,
+ 0x97BD, 0x97BD, 0x265E, 0x97BE, 0x97C2, 0x5135, 0x97C3, 0x97C3, 0x265D,
+ 0x97C4, 0x97C5, 0x513A, 0x97C6, 0x97C6, 0x2692, 0x97C7, 0x97C8, 0x513C,
+ 0x97C9, 0x97C9, 0x265F, 0x97CA, 0x97CA, 0x513E, 0x97CB, 0x97CB, 0x218D,
+ 0x97CC, 0x97CC, 0x20FD, 0x97CD, 0x97D2, 0x513F, 0x97D3, 0x97D3, 0x1F40,
+ 0x97D4, 0x97D8, 0x5145, 0x97D9, 0x97D9, 0x2465, 0x97DA, 0x97DB, 0x514A,
+ 0x97DC, 0x97DC, 0x2467, 0x97DD, 0x97DD, 0x514C, 0x97DE, 0x97DE, 0x2466,
+ 0x97DF, 0x97E5, 0x514D, 0x97E6, 0x97E6, 0x0EB3, 0x97E7, 0x97E7, 0x0CA8,
+ 0x97E8, 0x97E8, 0x5154, 0x97E9, 0x97E9, 0x0762, 0x97EA, 0x97EC, 0x184E,
+ 0x97ED, 0x97ED, 0x08F1, 0x97EE, 0x97F2, 0x5155, 0x97F3, 0x97F3, 0x107B,
+ 0x97F4, 0x97F4, 0x515A, 0x97F5, 0x97F5, 0x1112, 0x97F6, 0x97F6, 0x0D11,
+ 0x97F7, 0x97FE, 0x515B, 0x97FF, 0x97FF, 0x21C9, 0x9800, 0x9800, 0x5163,
+ 0x9801, 0x9801, 0x2209, 0x9802, 0x9802, 0x1EC9, 0x9803, 0x9803, 0x20E9,
+ 0x9804, 0x9804, 0x5164, 0x9805, 0x9805, 0x21CA, 0x9806, 0x9806, 0x2146,
+ 0x9807, 0x9807, 0x25C5, 0x9808, 0x9808, 0x21DC, 0x9809, 0x9809, 0x5165,
+ 0x980A, 0x980A, 0x245E, 0x980B, 0x980B, 0x5166, 0x980C, 0x980C, 0x214F,
+ 0x980D, 0x980D, 0x5167, 0x980E, 0x980F, 0x25C6, 0x9810, 0x9810, 0x2241,
+ 0x9811, 0x9811, 0x218A, 0x9812, 0x9812, 0x1E2F, 0x9813, 0x9813, 0x1EDC,
+ 0x9814, 0x9816, 0x5168, 0x9817, 0x9817, 0x20BF, 0x9818, 0x9818, 0x2034,
+ 0x9819, 0x981B, 0x516B, 0x981C, 0x981C, 0x25C9, 0x981D, 0x9820, 0x516E,
+ 0x9821, 0x9821, 0x25C8, 0x9822, 0x9823, 0x5172, 0x9824, 0x9824, 0x220E,
+ 0x9825, 0x9825, 0x5174, 0x9826, 0x9826, 0x25CB, 0x9827, 0x982C, 0x5175,
+ 0x982D, 0x982D, 0x217D, 0x982E, 0x982F, 0x517B, 0x9830, 0x9830, 0x1F7E,
+ 0x9831, 0x9836, 0x517D, 0x9837, 0x9837, 0x25CC, 0x9838, 0x9838, 0x1FC3,
+ 0x9839, 0x983A, 0x5183, 0x983B, 0x983B, 0x20B9, 0x983C, 0x983C, 0x5185,
+ 0x983D, 0x983D, 0x2181, 0x983E, 0x9845, 0x5186, 0x9846, 0x9846, 0x1FDA,
+ 0x9847, 0x984B, 0x518E, 0x984C, 0x984C, 0x2173, 0x984D, 0x984D, 0x1EE1,
+ 0x984E, 0x984E, 0x25CD, 0x984F, 0x9852, 0x5193, 0x9853, 0x9853, 0x25CE,
+ 0x9854, 0x9854, 0x21F6, 0x9855, 0x9857, 0x5197, 0x9858, 0x9858, 0x224B,
+ 0x9859, 0x9859, 0x25D1, 0x985A, 0x985A, 0x519A, 0x985B, 0x985B, 0x1EC0,
+ 0x985C, 0x985D, 0x519B, 0x985E, 0x985E, 0x2008, 0x985F, 0x9861, 0x519D,
+ 0x9862, 0x9862, 0x25D0, 0x9863, 0x9864, 0x51A0, 0x9865, 0x9865, 0x25D2,
+ 0x9866, 0x9866, 0x51A2, 0x9867, 0x9867, 0x1F2A, 0x9868, 0x986A, 0x51A3,
+ 0x986B, 0x986B, 0x1E72, 0x986C, 0x986C, 0x25D3, 0x986D, 0x986E, 0x51A6,
+ 0x986F, 0x986F, 0x21BE, 0x9870, 0x9870, 0x25D4, 0x9871, 0x9871, 0x2044,
+ 0x9872, 0x9872, 0x51A8, 0x9873, 0x9873, 0x25CF, 0x9874, 0x9874, 0x20F3,
+ 0x9875, 0x9875, 0x103A, 0x9876, 0x9876, 0x05E4, 0x9877, 0x9877, 0x0C67,
+ 0x9878, 0x9878, 0x1BE0, 0x9879, 0x9879, 0x0F5B, 0x987A, 0x987A, 0x0DA8,
+ 0x987B, 0x987B, 0x0FB6, 0x987C, 0x987C, 0x1827, 0x987D, 0x987D, 0x0E98,
+ 0x987E, 0x987E, 0x0724, 0x987F, 0x987F, 0x0618, 0x9880, 0x9880, 0x1BE1,
+ 0x9881, 0x9881, 0x03EF, 0x9882, 0x9882, 0x0DC1, 0x9883, 0x9883, 0x1BE2,
+ 0x9884, 0x9884, 0x10E7, 0x9885, 0x9885, 0x0A54, 0x9886, 0x9886, 0x0A35,
+ 0x9887, 0x9887, 0x0BE3, 0x9888, 0x9888, 0x08E0, 0x9889, 0x9889, 0x1BE3,
+ 0x988A, 0x988A, 0x0848, 0x988B, 0x988B, 0x51A9, 0x988C, 0x988D, 0x1BE4,
+ 0x988E, 0x988E, 0x51AA, 0x988F, 0x988F, 0x1BE6, 0x9890, 0x9890, 0x104A,
+ 0x9891, 0x9891, 0x0BD4, 0x9892, 0x9892, 0x51AB, 0x9893, 0x9893, 0x0E78,
+ 0x9894, 0x9894, 0x1BE7, 0x9895, 0x9895, 0x51AC, 0x9896, 0x9896, 0x1096,
+ 0x9897, 0x9897, 0x0952, 0x9898, 0x9898, 0x0E35, 0x9899, 0x9899, 0x51AD,
+ 0x989A, 0x989B, 0x1BE8, 0x989C, 0x989C, 0x0FFE, 0x989D, 0x989D, 0x062D,
+ 0x989E, 0x989F, 0x1BEA, 0x98A0, 0x98A0, 0x05C0, 0x98A1, 0x98A2, 0x1BEC,
+ 0x98A3, 0x98A3, 0x51AE, 0x98A4, 0x98A4, 0x04C3, 0x98A5, 0x98A6, 0x1BEE,
+ 0x98A7, 0x98A7, 0x0C82, 0x98A8, 0x98A8, 0x1F00, 0x98A9, 0x98AD, 0x51AF,
+ 0x98AE, 0x98AF, 0x24CC, 0x98B0, 0x98B0, 0x51B4, 0x98B1, 0x98B1, 0x2698,
+ 0x98B2, 0x98B2, 0x51B5, 0x98B3, 0x98B3, 0x2678, 0x98B4, 0x98B5, 0x51B6,
+ 0x98B6, 0x98B6, 0x24CE, 0x98B7, 0x98BB, 0x51B8, 0x98BC, 0x98BC, 0x24CF,
+ 0x98BD, 0x98C3, 0x51BD, 0x98C4, 0x98C4, 0x20B8, 0x98C5, 0x98C5, 0x51C4,
+ 0x98C6, 0x98C6, 0x24D0, 0x98C7, 0x98C7, 0x51C5, 0x98C8, 0x98C8, 0x24D1,
+ 0x98C9, 0x98CD, 0x51C6, 0x98CE, 0x98CE, 0x0684, 0x98CF, 0x98D0, 0x51CB,
+ 0x98D1, 0x98D3, 0x19B7, 0x98D4, 0x98D4, 0x51CD, 0x98D5, 0x98D5, 0x19BA,
+ 0x98D6, 0x98D7, 0x51CE, 0x98D8, 0x98D8, 0x0BCD, 0x98D9, 0x98DA, 0x19BB,
+ 0x98DB, 0x98DB, 0x1EF4, 0x98DC, 0x98DD, 0x51D0, 0x98DE, 0x98DE, 0x0666,
+ 0x98DF, 0x98DF, 0x0D4A, 0x98E0, 0x98E0, 0x239B, 0x98E1, 0x98E1, 0x51D2,
+ 0x98E2, 0x98E2, 0x267E, 0x98E3, 0x98E6, 0x51D3, 0x98E7, 0x98E7, 0x161A,
+ 0x98E8, 0x98E8, 0x1DE7, 0x98E9, 0x98E9, 0x239D, 0x98EA, 0x98EB, 0x239F,
+ 0x98EC, 0x98EC, 0x51D7, 0x98ED, 0x98ED, 0x23A1, 0x98EE, 0x98EE, 0x51D8,
+ 0x98EF, 0x98EF, 0x1EF1, 0x98F0, 0x98F1, 0x51D9, 0x98F2, 0x98F2, 0x221E,
+ 0x98F3, 0x98F3, 0x51DB, 0x98F4, 0x98F4, 0x23A2, 0x98F5, 0x98FB, 0x51DC,
+ 0x98FC, 0x98FC, 0x214B, 0x98FD, 0x98FD, 0x1E36, 0x98FE, 0x98FE, 0x2135,
+ 0x98FF, 0x98FF, 0x51E3, 0x9900, 0x9902, 0x51E4, 0x9903, 0x9903, 0x1FAD,
+ 0x9904, 0x9904, 0x51E7, 0x9905, 0x9905, 0x1E53, 0x9906, 0x9908, 0x51E8,
+ 0x9909, 0x9909, 0x23A3, 0x990A, 0x990A, 0x2203, 0x990B, 0x990B, 0x51EB,
+ 0x990C, 0x990C, 0x1EE7, 0x990D, 0x990D, 0x1DE8, 0x990E, 0x990F, 0x51EC,
+ 0x9910, 0x9910, 0x0494, 0x9911, 0x9911, 0x23A4, 0x9912, 0x9912, 0x2097,
+ 0x9913, 0x9913, 0x1EE4, 0x9914, 0x9917, 0x51EE, 0x9918, 0x9918, 0x2238,
+ 0x9919, 0x991A, 0x51F2, 0x991B, 0x991B, 0x23A5, 0x991C, 0x991D, 0x51F4,
+ 0x991E, 0x991E, 0x1F9A, 0x991F, 0x9920, 0x51F6, 0x9921, 0x9921, 0x21C3,
+ 0x9922, 0x9927, 0x51F8, 0x9928, 0x9928, 0x1F2E, 0x9929, 0x992D, 0x51FE,
+ 0x992E, 0x992E, 0x1DE9, 0x992F, 0x9932, 0x5203, 0x9933, 0x9933, 0x239C,
+ 0x9934, 0x9936, 0x5207, 0x9937, 0x9937, 0x23A6, 0x9938, 0x993B, 0x520A,
+ 0x993C, 0x993C, 0x239E, 0x993D, 0x993D, 0x520E, 0x993E, 0x993E, 0x2035,
+ 0x993F, 0x993F, 0x23A7, 0x9940, 0x9942, 0x520F, 0x9943, 0x9943, 0x23A8,
+ 0x9944, 0x9944, 0x5212, 0x9945, 0x9945, 0x2075, 0x9946, 0x9947, 0x5213,
+ 0x9948, 0x994A, 0x23A9, 0x994B, 0x994B, 0x1FEB, 0x994C, 0x994C, 0x23AC,
+ 0x994D, 0x9950, 0x5215, 0x9951, 0x9951, 0x1F6A, 0x9952, 0x9952, 0x20F9,
+ 0x9953, 0x9953, 0x5219, 0x9954, 0x9954, 0x1DEB, 0x9955, 0x9955, 0x1DEA,
+ 0x9956, 0x9956, 0x521A, 0x9957, 0x9957, 0x2666, 0x9958, 0x995B, 0x521B,
+ 0x995C, 0x995C, 0x2667, 0x995D, 0x995D, 0x521F, 0x995E, 0x995E, 0x1E6C,
+ 0x995F, 0x9961, 0x5220, 0x9962, 0x9962, 0x23AD, 0x9963, 0x9963, 0x161D,
+ 0x9964, 0x9964, 0x5223, 0x9965, 0x9965, 0x0815, 0x9966, 0x9966, 0x5224,
+ 0x9967, 0x996C, 0x161E, 0x996D, 0x996D, 0x0656, 0x996E, 0x996E, 0x1082,
+ 0x996F, 0x996F, 0x0875, 0x9970, 0x9970, 0x0D65, 0x9971, 0x9971, 0x040E,
+ 0x9972, 0x9972, 0x0DBC, 0x9973, 0x9973, 0x5225, 0x9974, 0x9974, 0x1624,
+ 0x9975, 0x9975, 0x063B, 0x9976, 0x9976, 0x0C9F, 0x9977, 0x9977, 0x1625,
+ 0x9978, 0x9979, 0x5226, 0x997A, 0x997A, 0x0899, 0x997B, 0x997B, 0x5228,
+ 0x997C, 0x997C, 0x0466, 0x997D, 0x997D, 0x1626, 0x997E, 0x997E, 0x5229,
+ 0x997F, 0x997F, 0x0635, 0x9980, 0x9980, 0x1627, 0x9981, 0x9981, 0x0B3C,
+ 0x9982, 0x9983, 0x522A, 0x9984, 0x9984, 0x1628, 0x9985, 0x9985, 0x0F47,
+ 0x9986, 0x9986, 0x0736, 0x9987, 0x9987, 0x1629, 0x9988, 0x9988, 0x098C,
+ 0x9989, 0x9989, 0x522C, 0x998A, 0x998A, 0x162A, 0x998B, 0x998B, 0x04BD,
+ 0x998C, 0x998C, 0x522D, 0x998D, 0x998D, 0x162B, 0x998E, 0x998E, 0x522E,
+ 0x998F, 0x998F, 0x0A3C, 0x9990, 0x9991, 0x162C, 0x9992, 0x9992, 0x0A9F,
+ 0x9993, 0x9995, 0x162E, 0x9996, 0x9996, 0x0D6E, 0x9997, 0x9997, 0x126E,
+ 0x9998, 0x9998, 0x12F9, 0x9999, 0x9999, 0x0F50, 0x999A, 0x99A4, 0x522F,
+ 0x99A5, 0x99A5, 0x1B2B, 0x99A6, 0x99A7, 0x523A, 0x99A8, 0x99A8, 0x13DE,
+ 0x99A9, 0x99AB, 0x523C, 0x99AC, 0x99AC, 0x206D, 0x99AD, 0x99AD, 0x2242,
+ 0x99AE, 0x99AE, 0x1F02, 0x99AF, 0x99B0, 0x523F, 0x99B1, 0x99B1, 0x2183,
+ 0x99B2, 0x99B2, 0x5241, 0x99B3, 0x99B3, 0x1E85, 0x99B4, 0x99B4, 0x21E9,
+ 0x99B5, 0x99C0, 0x5242, 0x99C1, 0x99C1, 0x1E57, 0x99C2, 0x99CF, 0x524E,
+ 0x99D0, 0x99D0, 0x22A5, 0x99D1, 0x99D1, 0x2407, 0x99D2, 0x99D2, 0x1FCA,
+ 0x99D3, 0x99D3, 0x525C, 0x99D4, 0x99D4, 0x2402, 0x99D5, 0x99D5, 0x1F82,
+ 0x99D6, 0x99D7, 0x525D, 0x99D8, 0x99D8, 0x2408, 0x99D9, 0x99D9, 0x2404,
+ 0x99DA, 0x99DA, 0x525F, 0x99DB, 0x99DB, 0x2131, 0x99DC, 0x99DC, 0x5260,
+ 0x99DD, 0x99DD, 0x2184, 0x99DE, 0x99DE, 0x5261, 0x99DF, 0x99DF, 0x2403,
+ 0x99E0, 0x99E0, 0x5262, 0x99E1, 0x99E1, 0x206E, 0x99E2, 0x99E2, 0x240B,
+ 0x99E3, 0x99EC, 0x5263, 0x99ED, 0x99ED, 0x1F3F, 0x99EE, 0x99F0, 0x526D,
+ 0x99F1, 0x99F1, 0x2067, 0x99F2, 0x99FE, 0x5270, 0x99FF, 0x99FF, 0x1FD7,
+ 0x9A00, 0x9A00, 0x527D, 0x9A01, 0x9A01, 0x1E83, 0x9A02, 0x9A04, 0x527E,
+ 0x9A05, 0x9A05, 0x240F, 0x9A06, 0x9A0C, 0x5281, 0x9A0D, 0x9A0D, 0x240E,
+ 0x9A0E, 0x9A0E, 0x20C7, 0x9A0F, 0x9A0F, 0x240D, 0x9A10, 0x9A15, 0x5288,
+ 0x9A16, 0x9A16, 0x2412, 0x9A17, 0x9A18, 0x528E, 0x9A19, 0x9A19, 0x20B7,
+ 0x9A1A, 0x9A2A, 0x5290, 0x9A2B, 0x9A2B, 0x23F0, 0x9A2C, 0x9A2C, 0x52A1,
+ 0x9A2D, 0x9A2D, 0x2411, 0x9A2E, 0x9A2E, 0x2414, 0x9A2F, 0x9A2F, 0x52A2,
+ 0x9A30, 0x9A30, 0x2170, 0x9A31, 0x9A35, 0x52A3, 0x9A36, 0x9A36, 0x2405,
+ 0x9A37, 0x9A37, 0x210C, 0x9A38, 0x9A38, 0x2415, 0x9A39, 0x9A3D, 0x52A8,
+ 0x9A3E, 0x9A3E, 0x2066, 0x9A3F, 0x9A3F, 0x52AD, 0x9A40, 0x9A40, 0x2352,
+ 0x9A41, 0x9A41, 0x2413, 0x9A42, 0x9A42, 0x2410, 0x9A43, 0x9A44, 0x2416,
+ 0x9A45, 0x9A45, 0x20F1, 0x9A46, 0x9A49, 0x52AE, 0x9A4A, 0x9A4A, 0x240A,
+ 0x9A4B, 0x9A4C, 0x52B2, 0x9A4D, 0x9A4D, 0x2409, 0x9A4E, 0x9A4E, 0x52B4,
+ 0x9A4F, 0x9A4F, 0x2418, 0x9A50, 0x9A54, 0x52B5, 0x9A55, 0x9A55, 0x1FA7,
+ 0x9A56, 0x9A56, 0x52BA, 0x9A57, 0x9A57, 0x21FC, 0x9A58, 0x9A59, 0x52BB,
+ 0x9A5A, 0x9A5A, 0x1FC1, 0x9A5B, 0x9A5B, 0x2406, 0x9A5C, 0x9A5E, 0x52BD,
+ 0x9A5F, 0x9A5F, 0x229C, 0x9A60, 0x9A61, 0x52C0, 0x9A62, 0x9A62, 0x204E,
+ 0x9A63, 0x9A63, 0x52C2, 0x9A64, 0x9A64, 0x241A, 0x9A65, 0x9A65, 0x2419,
+ 0x9A66, 0x9A69, 0x52C3, 0x9A6A, 0x9A6A, 0x240C, 0x9A6B, 0x9A6B, 0x52C7,
+ 0x9A6C, 0x9A6C, 0x0A94, 0x9A6D, 0x9A6D, 0x10E9, 0x9A6E, 0x9A6E, 0x0E85,
+ 0x9A6F, 0x9A6F, 0x0FDA, 0x9A70, 0x9A70, 0x0500, 0x9A71, 0x9A71, 0x0C7A,
+ 0x9A72, 0x9A72, 0x52C8, 0x9A73, 0x9A73, 0x047C, 0x9A74, 0x9A74, 0x0A66,
+ 0x9A75, 0x9A75, 0x17BA, 0x9A76, 0x9A76, 0x0D52, 0x9A77, 0x9A78, 0x17BB,
+ 0x9A79, 0x9A79, 0x0903, 0x9A7A, 0x9A7A, 0x17BD, 0x9A7B, 0x9A7B, 0x1201,
+ 0x9A7C, 0x9A7C, 0x0E86, 0x9A7D, 0x9A7D, 0x17BF, 0x9A7E, 0x9A7E, 0x0850,
+ 0x9A7F, 0x9A7F, 0x17BE, 0x9A80, 0x9A81, 0x17C0, 0x9A82, 0x9A82, 0x0A95,
+ 0x9A83, 0x9A83, 0x52C9, 0x9A84, 0x9A84, 0x088F, 0x9A85, 0x9A85, 0x17C2,
+ 0x9A86, 0x9A86, 0x0A8D, 0x9A87, 0x9A87, 0x075E, 0x9A88, 0x9A88, 0x17C3,
+ 0x9A89, 0x9A89, 0x52CA, 0x9A8A, 0x9A8A, 0x17C4, 0x9A8B, 0x9A8B, 0x04F7,
+ 0x9A8C, 0x9A8C, 0x1012, 0x9A8D, 0x9A8E, 0x52CB, 0x9A8F, 0x9A8F, 0x0932,
+ 0x9A90, 0x9A90, 0x17C5, 0x9A91, 0x9A91, 0x0C0E, 0x9A92, 0x9A93, 0x17C6,
+ 0x9A94, 0x9A95, 0x52CD, 0x9A96, 0x9A96, 0x17C8, 0x9A97, 0x9A97, 0x0BCC,
+ 0x9A98, 0x9A98, 0x17C9, 0x9A99, 0x9A99, 0x52CF, 0x9A9A, 0x9A9A, 0x0CE0,
+ 0x9A9B, 0x9A9D, 0x17CA, 0x9A9E, 0x9A9E, 0x1735, 0x9A9F, 0x9AA0, 0x17CD,
+ 0x9AA1, 0x9AA1, 0x0A89, 0x9AA2, 0x9AA3, 0x17CF, 0x9AA4, 0x9AA4, 0x11E7,
+ 0x9AA5, 0x9AA5, 0x17D1, 0x9AA6, 0x9AA6, 0x52D0, 0x9AA7, 0x9AA7, 0x17D2,
+ 0x9AA8, 0x9AA8, 0x0720, 0x9AA9, 0x9AAE, 0x52D1, 0x9AAF, 0x9AAF, 0x1E29,
+ 0x9AB0, 0x9AB0, 0x1DD3, 0x9AB1, 0x9AB1, 0x1DD2, 0x9AB2, 0x9AB5, 0x52D7,
+ 0x9AB6, 0x9AB6, 0x1DD6, 0x9AB7, 0x9AB7, 0x1DD4, 0x9AB8, 0x9AB8, 0x0758,
+ 0x9AB9, 0x9AB9, 0x52DB, 0x9ABA, 0x9ABA, 0x1DD7, 0x9ABB, 0x9ABB, 0x52DC,
+ 0x9ABC, 0x9ABC, 0x1DD8, 0x9ABD, 0x9ABF, 0x52DD, 0x9AC0, 0x9AC0, 0x1DDA,
+ 0x9AC1, 0x9AC1, 0x1DD9, 0x9AC2, 0x9AC2, 0x1DDC, 0x9AC3, 0x9AC4, 0x52E0,
+ 0x9AC5, 0x9AC5, 0x1DDB, 0x9AC6, 0x9ACA, 0x52E2, 0x9ACB, 0x9ACC, 0x1DDD,
+ 0x9ACD, 0x9ACE, 0x52E7, 0x9ACF, 0x9ACF, 0x2661, 0x9AD0, 0x9AD0, 0x52E9,
+ 0x9AD1, 0x9AD1, 0x1DDF, 0x9AD2, 0x9AD2, 0x26A4, 0x9AD3, 0x9AD3, 0x0DDD,
+ 0x9AD4, 0x9AD4, 0x2174, 0x9AD5, 0x9AD5, 0x2663, 0x9AD6, 0x9AD6, 0x2662,
+ 0x9AD7, 0x9AD7, 0x52EA, 0x9AD8, 0x9AD8, 0x06DA, 0x9AD9, 0x9ADE, 0x52EB,
+ 0x9ADF, 0x9ADF, 0x1DEC, 0x9AE0, 0x9AE0, 0x52F1, 0x9AE1, 0x9AE1, 0x1DED,
+ 0x9AE2, 0x9AE5, 0x52F2, 0x9AE6, 0x9AE6, 0x1DEE, 0x9AE7, 0x9AEA, 0x52F6,
+ 0x9AEB, 0x9AEB, 0x1DF0, 0x9AEC, 0x9AEC, 0x52FA, 0x9AED, 0x9AED, 0x1DF2,
+ 0x9AEE, 0x9AEE, 0x2675, 0x9AEF, 0x9AEF, 0x1DEF, 0x9AF0, 0x9AF8, 0x52FB,
+ 0x9AF9, 0x9AF9, 0x1DF3, 0x9AFA, 0x9AFA, 0x5304, 0x9AFB, 0x9AFB, 0x1DF1,
+ 0x9AFC, 0x9AFF, 0x5305, 0x9B00, 0x9B02, 0x5309, 0x9B03, 0x9B03, 0x1234,
+ 0x9B04, 0x9B05, 0x530C, 0x9B06, 0x9B06, 0x214C, 0x9B07, 0x9B07, 0x530E,
+ 0x9B08, 0x9B08, 0x1DF4, 0x9B09, 0x9B0C, 0x530F, 0x9B0D, 0x9B0D, 0x267A,
+ 0x9B0E, 0x9B0E, 0x5313, 0x9B0F, 0x9B0F, 0x1DF5, 0x9B10, 0x9B12, 0x5314,
+ 0x9B13, 0x9B13, 0x1DF6, 0x9B14, 0x9B19, 0x5317, 0x9B1A, 0x9B1A, 0x26A0,
+ 0x9B1B, 0x9B1E, 0x531D, 0x9B1F, 0x9B1F, 0x1DF7, 0x9B20, 0x9B21, 0x5321,
+ 0x9B22, 0x9B22, 0x2668, 0x9B23, 0x9B23, 0x1DF8, 0x9B24, 0x9B24, 0x5323,
+ 0x9B25, 0x9B25, 0x1ED0, 0x9B26, 0x9B26, 0x5324, 0x9B27, 0x9B27, 0x2096,
+ 0x9B28, 0x9B28, 0x5325, 0x9B29, 0x9B29, 0x23CC, 0x9B2A, 0x9B2D, 0x5326,
+ 0x9B2E, 0x9B2E, 0x23C8, 0x9B2F, 0x9B2F, 0x139B, 0x9B30, 0x9B30, 0x532A,
+ 0x9B31, 0x9B31, 0x223E, 0x9B32, 0x9B32, 0x1260, 0x9B33, 0x9B3A, 0x532B,
+ 0x9B3B, 0x9B3B, 0x1773, 0x9B3C, 0x9B3C, 0x0746, 0x9B3D, 0x9B40, 0x5333,
+ 0x9B41, 0x9B41, 0x098A, 0x9B42, 0x9B42, 0x07FF, 0x9B43, 0x9B43, 0x1DE1,
+ 0x9B44, 0x9B44, 0x0BE6, 0x9B45, 0x9B45, 0x1DE0, 0x9B46, 0x9B46, 0x5337,
+ 0x9B47, 0x9B47, 0x1DE2, 0x9B48, 0x9B48, 0x1DE4, 0x9B49, 0x9B49, 0x1DE3,
+ 0x9B4A, 0x9B4C, 0x5338, 0x9B4D, 0x9B4D, 0x1DE5, 0x9B4E, 0x9B4E, 0x2665,
+ 0x9B4F, 0x9B4F, 0x0EC9, 0x9B50, 0x9B50, 0x533B, 0x9B51, 0x9B51, 0x1DE6,
+ 0x9B52, 0x9B53, 0x533C, 0x9B54, 0x9B54, 0x0B0A, 0x9B55, 0x9B57, 0x533E,
+ 0x9B58, 0x9B58, 0x2664, 0x9B59, 0x9B59, 0x5341, 0x9B5A, 0x9B5A, 0x2239,
+ 0x9B5B, 0x9B6E, 0x5342, 0x9B6F, 0x9B6F, 0x204A, 0x9B70, 0x9B73, 0x5356,
+ 0x9B74, 0x9B74, 0x261F, 0x9B75, 0x9B76, 0x535A, 0x9B77, 0x9B77, 0x261E,
+ 0x9B78, 0x9B80, 0x535C, 0x9B81, 0x9B81, 0x2620, 0x9B82, 0x9B82, 0x5365,
+ 0x9B83, 0x9B83, 0x2621, 0x9B84, 0x9B8D, 0x5366, 0x9B8E, 0x9B8E, 0x2622,
+ 0x9B8F, 0x9B8F, 0x5370, 0x9B90, 0x9B90, 0x2627, 0x9B91, 0x9B91, 0x1E39,
+ 0x9B92, 0x9B92, 0x2625, 0x9B93, 0x9B99, 0x5371, 0x9B9A, 0x9B9A, 0x2629,
+ 0x9B9B, 0x9B9C, 0x5378, 0x9B9D, 0x9B9D, 0x262E, 0x9B9E, 0x9B9E, 0x262B,
+ 0x9B9F, 0x9BA9, 0x537A, 0x9BAA, 0x9BAA, 0x262A, 0x9BAB, 0x9BAB, 0x262D,
+ 0x9BAC, 0x9BAC, 0x5385, 0x9BAD, 0x9BAD, 0x2628, 0x9BAE, 0x9BAE, 0x21B9,
+ 0x9BAF, 0x9BBF, 0x5386, 0x9BC0, 0x9BC0, 0x2636, 0x9BC1, 0x9BC1, 0x2630,
+ 0x9BC2, 0x9BC6, 0x5397, 0x9BC7, 0x9BC7, 0x2638, 0x9BC8, 0x9BC8, 0x539C,
+ 0x9BC9, 0x9BC9, 0x200D, 0x9BCA, 0x9BCA, 0x2637, 0x9BCB, 0x9BD3, 0x539D,
+ 0x9BD4, 0x9BD4, 0x2645, 0x9BD5, 0x9BD5, 0x53A6, 0x9BD6, 0x9BD6, 0x263A,
+ 0x9BD7, 0x9BDA, 0x53A7, 0x9BDB, 0x9BDB, 0x2643, 0x9BDC, 0x9BDC, 0x53AB,
+ 0x9BDD, 0x9BDD, 0x2640, 0x9BDE, 0x9BE0, 0x53AC, 0x9BE1, 0x9BE1, 0x263D,
+ 0x9BE2, 0x9BE2, 0x2641, 0x9BE3, 0x9BE3, 0x53AF, 0x9BE4, 0x9BE4, 0x263E,
+ 0x9BE5, 0x9BE6, 0x53B0, 0x9BE7, 0x9BE7, 0x263F, 0x9BE8, 0x9BE8, 0x1FC0,
+ 0x9BE9, 0x9BE9, 0x53B2, 0x9BEA, 0x9BEB, 0x263B, 0x9BEC, 0x9BEF, 0x53B3,
+ 0x9BF0, 0x9BF0, 0x2642, 0x9BF1, 0x9BF3, 0x53B7, 0x9BF4, 0x9BF4, 0x2644,
+ 0x9BF5, 0x9BFC, 0x53BA, 0x9BFD, 0x9BFD, 0x2639, 0x9BFE, 0x9BFE, 0x53C2,
+ 0x9BFF, 0x9BFF, 0x264C, 0x9C00, 0x9C07, 0x53C3, 0x9C08, 0x9C08, 0x2647,
+ 0x9C09, 0x9C09, 0x264B, 0x9C0A, 0x9C0C, 0x53CB, 0x9C0D, 0x9C0D, 0x2649,
+ 0x9C0E, 0x9C0F, 0x53CE, 0x9C10, 0x9C10, 0x2648, 0x9C11, 0x9C11, 0x53D0,
+ 0x9C12, 0x9C12, 0x264A, 0x9C13, 0x9C13, 0x2108, 0x9C14, 0x9C1F, 0x53D1,
+ 0x9C20, 0x9C20, 0x264D, 0x9C21, 0x9C22, 0x53DD, 0x9C23, 0x9C23, 0x2634,
+ 0x9C24, 0x9C24, 0x53DF, 0x9C25, 0x9C25, 0x2651, 0x9C26, 0x9C27, 0x53E0,
+ 0x9C28, 0x9C28, 0x2650, 0x9C29, 0x9C29, 0x2652, 0x9C2A, 0x9C2C, 0x53E2,
+ 0x9C2D, 0x9C2D, 0x264F, 0x9C2E, 0x9C30, 0x53E5, 0x9C31, 0x9C31, 0x2632,
+ 0x9C32, 0x9C32, 0x264E, 0x9C33, 0x9C33, 0x2653, 0x9C34, 0x9C34, 0x53E8,
+ 0x9C35, 0x9C35, 0x2657, 0x9C36, 0x9C36, 0x53E9, 0x9C37, 0x9C37, 0x2635,
+ 0x9C38, 0x9C38, 0x53EA, 0x9C39, 0x9C39, 0x2633, 0x9C3A, 0x9C3A, 0x53EB,
+ 0x9C3B, 0x9C3B, 0x2656, 0x9C3C, 0x9C3D, 0x53EC, 0x9C3E, 0x9C3E, 0x2654,
+ 0x9C3F, 0x9C44, 0x53EE, 0x9C45, 0x9C45, 0x2658, 0x9C46, 0x9C47, 0x53F4,
+ 0x9C48, 0x9C48, 0x2655, 0x9C49, 0x9C49, 0x1E4D, 0x9C4A, 0x9C51, 0x53F6,
+ 0x9C52, 0x9C52, 0x265B, 0x9C53, 0x9C53, 0x53FE, 0x9C54, 0x9C54, 0x265A,
+ 0x9C55, 0x9C55, 0x53FF, 0x9C56, 0x9C56, 0x2659, 0x9C57, 0x9C57, 0x202E,
+ 0x9C58, 0x9C58, 0x262F, 0x9C59, 0x9C5C, 0x5400, 0x9C5D, 0x9C5D, 0x2646,
+ 0x9C5E, 0x9C5E, 0x5404, 0x9C5F, 0x9C5F, 0x2626, 0x9C60, 0x9C66, 0x5405,
+ 0x9C67, 0x9C67, 0x265C, 0x9C68, 0x9C6C, 0x540C, 0x9C6D, 0x9C6D, 0x262C,
+ 0x9C6E, 0x9C77, 0x5411, 0x9C78, 0x9C78, 0x2623, 0x9C79, 0x9C79, 0x541B,
+ 0x9C7A, 0x9C7A, 0x2631, 0x9C7B, 0x9C7B, 0x541C, 0x9C7C, 0x9C7C, 0x10C8,
+ 0x9C7D, 0x9C7E, 0x541D, 0x9C7F, 0x9C7F, 0x1D89, 0x9C80, 0x9C80, 0x541F,
+ 0x9C81, 0x9C81, 0x0A5A, 0x9C82, 0x9C82, 0x1D8A, 0x9C83, 0x9C84, 0x5420,
+ 0x9C85, 0x9C88, 0x1D8B, 0x9C89, 0x9C8A, 0x5422, 0x9C8B, 0x9C8B, 0x1D90,
+ 0x9C8C, 0x9C8C, 0x5424, 0x9C8D, 0x9C8D, 0x0414, 0x9C8E, 0x9C8E, 0x1D91,
+ 0x9C8F, 0x9C8F, 0x5425, 0x9C90, 0x9C92, 0x1D92, 0x9C93, 0x9C93, 0x5426,
+ 0x9C94, 0x9C95, 0x1D95, 0x9C96, 0x9C99, 0x5427, 0x9C9A, 0x9C9B, 0x1D97,
+ 0x9C9C, 0x9C9C, 0x0F37, 0x9C9D, 0x9C9D, 0x542B, 0x9C9E, 0x9CA3, 0x1D99,
+ 0x9CA4, 0x9CA4, 0x09DB, 0x9CA5, 0x9CA9, 0x1D9F, 0x9CAA, 0x9CAA, 0x542C,
+ 0x9CAB, 0x9CAB, 0x1DA4, 0x9CAC, 0x9CAC, 0x542D, 0x9CAD, 0x9CAE, 0x1DA5,
+ 0x9CAF, 0x9CAF, 0x542E, 0x9CB0, 0x9CB7, 0x1DA7, 0x9CB8, 0x9CB8, 0x08D7,
+ 0x9CB9, 0x9CB9, 0x542F, 0x9CBA, 0x9CBD, 0x1DAF, 0x9CBE, 0x9CC2, 0x5430,
+ 0x9CC3, 0x9CC3, 0x0CD5, 0x9CC4, 0x9CC7, 0x1DB3, 0x9CC8, 0x9CC9, 0x5435,
+ 0x9CCA, 0x9CD0, 0x1DB7, 0x9CD1, 0x9CD2, 0x5437, 0x9CD3, 0x9CD5, 0x1DBE,
+ 0x9CD6, 0x9CD6, 0x0457, 0x9CD7, 0x9CD9, 0x1DC1, 0x9CDA, 0x9CDB, 0x5439,
+ 0x9CDC, 0x9CDD, 0x1DC4, 0x9CDE, 0x9CDE, 0x0A24, 0x9CDF, 0x9CDF, 0x1DC6,
+ 0x9CE0, 0x9CE1, 0x543B, 0x9CE2, 0x9CE2, 0x1DC7, 0x9CE3, 0x9CE4, 0x543D,
+ 0x9CE5, 0x9CE5, 0x209C, 0x9CE6, 0x9CE8, 0x543F, 0x9CE9, 0x9CE9, 0x2580,
+ 0x9CEA, 0x9CEB, 0x5442, 0x9CEC, 0x9CEC, 0x22DC, 0x9CED, 0x9CF2, 0x5444,
+ 0x9CF3, 0x9CF3, 0x1F05, 0x9CF4, 0x9CF4, 0x208B, 0x9CF5, 0x9CF5, 0x544A,
+ 0x9CF6, 0x9CF6, 0x2581, 0x9CF7, 0x9CFF, 0x544B, 0x9D00, 0x9D05, 0x5454,
+ 0x9D06, 0x9D06, 0x2583, 0x9D07, 0x9D07, 0x2582, 0x9D08, 0x9D08, 0x545A,
+ 0x9D09, 0x9D09, 0x21EE, 0x9D0A, 0x9D14, 0x545B, 0x9D15, 0x9D15, 0x2182,
+ 0x9D16, 0x9D1A, 0x5466, 0x9D1B, 0x9D1B, 0x2243, 0x9D1C, 0x9D1C, 0x546B,
+ 0x9D1D, 0x9D1D, 0x2587, 0x9D1E, 0x9D1E, 0x546C, 0x9D1F, 0x9D1F, 0x2588,
+ 0x9D20, 0x9D22, 0x546D, 0x9D23, 0x9D23, 0x2584, 0x9D24, 0x9D25, 0x5470,
+ 0x9D26, 0x9D26, 0x21FD, 0x9D27, 0x9D27, 0x5472, 0x9D28, 0x9D28, 0x21EF,
+ 0x9D29, 0x9D2E, 0x5473, 0x9D2F, 0x9D2F, 0x258A, 0x9D30, 0x9D30, 0x258C,
+ 0x9D31, 0x9D3A, 0x5479, 0x9D3B, 0x9D3B, 0x1F47, 0x9D3C, 0x9D3E, 0x5483,
+ 0x9D3F, 0x9D3F, 0x1F1D, 0x9D40, 0x9D41, 0x5486, 0x9D42, 0x9D42, 0x258D,
+ 0x9D43, 0x9D50, 0x5488, 0x9D51, 0x9D51, 0x1FD0, 0x9D52, 0x9D52, 0x2592,
+ 0x9D53, 0x9D53, 0x258F, 0x9D54, 0x9D5B, 0x5496, 0x9D5C, 0x9D5C, 0x2594,
+ 0x9D5D, 0x9D5D, 0x1EE0, 0x9D5E, 0x9D5F, 0x549E, 0x9D60, 0x9D60, 0x2591,
+ 0x9D61, 0x9D61, 0x2595, 0x9D62, 0x9D69, 0x54A0, 0x9D6A, 0x9D6A, 0x2597,
+ 0x9D6B, 0x9D6B, 0x54A8, 0x9D6C, 0x9D6C, 0x20B6, 0x9D6D, 0x9D6E, 0x54A9,
+ 0x9D6F, 0x9D6F, 0x2598, 0x9D70, 0x9D71, 0x54AB, 0x9D72, 0x9D72, 0x20F6,
+ 0x9D73, 0x9D86, 0x54AD, 0x9D87, 0x9D87, 0x2585, 0x9D88, 0x9D88, 0x54C1,
+ 0x9D89, 0x9D89, 0x2599, 0x9D8A, 0x9D92, 0x54C2, 0x9D93, 0x9D93, 0x2596,
+ 0x9D94, 0x9D97, 0x54CB, 0x9D98, 0x9D98, 0x259A, 0x9D99, 0x9D99, 0x54CF,
+ 0x9D9A, 0x9D9A, 0x259B, 0x9D9B, 0x9DA4, 0x54D0, 0x9DA5, 0x9DA5, 0x259D,
+ 0x9DA6, 0x9DA8, 0x54DA, 0x9DA9, 0x9DA9, 0x259E, 0x9DAA, 0x9DAE, 0x54DD,
+ 0x9DAF, 0x9DAF, 0x234C, 0x9DB0, 0x9DB3, 0x54E2, 0x9DB4, 0x9DB4, 0x1F44,
+ 0x9DB5, 0x9DBA, 0x54E6, 0x9DBB, 0x9DBB, 0x2660, 0x9DBC, 0x9DBC, 0x25A0,
+ 0x9DBD, 0x9DBF, 0x54EC, 0x9DC0, 0x9DC0, 0x259C, 0x9DC1, 0x9DC1, 0x54EF,
+ 0x9DC2, 0x9DC2, 0x259F, 0x9DC3, 0x9DC3, 0x54F0, 0x9DC4, 0x9DC4, 0x1F6C,
+ 0x9DC5, 0x9DD2, 0x54F1, 0x9DD3, 0x9DD3, 0x25A2, 0x9DD4, 0x9DD6, 0x54FF,
+ 0x9DD7, 0x9DD7, 0x20AE, 0x9DD8, 0x9DD8, 0x5502, 0x9DD9, 0x9DD9, 0x258B,
+ 0x9DDA, 0x9DDA, 0x25A3, 0x9DDB, 0x9DE4, 0x5503, 0x9DE5, 0x9DE5, 0x2589,
+ 0x9DE6, 0x9DE6, 0x25A5, 0x9DE7, 0x9DEE, 0x550D, 0x9DEF, 0x9DEF, 0x25A4,
+ 0x9DF0, 0x9DF1, 0x5515, 0x9DF2, 0x9DF2, 0x25A6, 0x9DF3, 0x9DF3, 0x2593,
+ 0x9DF4, 0x9DF7, 0x5517, 0x9DF8, 0x9DF8, 0x25A7, 0x9DF9, 0x9DF9, 0x2222,
+ 0x9DFA, 0x9DFA, 0x25A9, 0x9DFB, 0x9DFF, 0x551B, 0x9E00, 0x9E0B, 0x5520,
+ 0x9E0C, 0x9E0C, 0x25A8, 0x9E0D, 0x9E14, 0x552C, 0x9E15, 0x9E15, 0x2586,
+ 0x9E16, 0x9E19, 0x5534, 0x9E1A, 0x9E1A, 0x25A1, 0x9E1B, 0x9E1B, 0x25AA,
+ 0x9E1C, 0x9E1C, 0x5538, 0x9E1D, 0x9E1D, 0x2590, 0x9E1E, 0x9E1E, 0x258E,
+ 0x9E1F, 0x9E1F, 0x0B54, 0x9E20, 0x9E20, 0x1B35, 0x9E21, 0x9E21, 0x0819,
+ 0x9E22, 0x9E22, 0x1B36, 0x9E23, 0x9E23, 0x0AFE, 0x9E24, 0x9E24, 0x5539,
+ 0x9E25, 0x9E25, 0x0B79, 0x9E26, 0x9E26, 0x0FE4, 0x9E27, 0x9E27, 0x553A,
+ 0x9E28, 0x9E2C, 0x1B37, 0x9E2D, 0x9E2D, 0x0FE5, 0x9E2E, 0x9E2E, 0x553B,
+ 0x9E2F, 0x9E2F, 0x1015, 0x9E30, 0x9E30, 0x553C, 0x9E31, 0x9E31, 0x1B3D,
+ 0x9E32, 0x9E32, 0x1B3C, 0x9E33, 0x9E33, 0x10EA, 0x9E34, 0x9E34, 0x553D,
+ 0x9E35, 0x9E35, 0x0E83, 0x9E36, 0x9E36, 0x1B3E, 0x9E37, 0x9E37, 0x1B40,
+ 0x9E38, 0x9E38, 0x1B3F, 0x9E39, 0x9E3A, 0x1B41, 0x9E3B, 0x9E3C, 0x553E,
+ 0x9E3D, 0x9E3D, 0x06E6, 0x9E3E, 0x9E3E, 0x1B43, 0x9E3F, 0x9E3F, 0x079F,
+ 0x9E40, 0x9E40, 0x5540, 0x9E41, 0x9E42, 0x1B44, 0x9E43, 0x9E43, 0x0918,
+ 0x9E44, 0x9E44, 0x1B46, 0x9E45, 0x9E45, 0x062B, 0x9E46, 0x9E49, 0x1B47,
+ 0x9E4A, 0x9E4A, 0x0C90, 0x9E4B, 0x9E4C, 0x1B4B, 0x9E4D, 0x9E4D, 0x5541,
+ 0x9E4E, 0x9E4E, 0x1B4D, 0x9E4F, 0x9E4F, 0x0BB5, 0x9E50, 0x9E50, 0x5542,
+ 0x9E51, 0x9E51, 0x1B4E, 0x9E52, 0x9E54, 0x5543, 0x9E55, 0x9E55, 0x1B4F,
+ 0x9E56, 0x9E56, 0x5546, 0x9E57, 0x9E57, 0x1B50, 0x9E58, 0x9E58, 0x1DD5,
+ 0x9E59, 0x9E59, 0x5547, 0x9E5A, 0x9E5C, 0x1B51, 0x9E5D, 0x9E5D, 0x5548,
+ 0x9E5E, 0x9E5E, 0x1B54, 0x9E5F, 0x9E62, 0x5549, 0x9E63, 0x9E63, 0x1B55,
+ 0x9E64, 0x9E64, 0x078E, 0x9E65, 0x9E65, 0x554D, 0x9E66, 0x9E6C, 0x1B56,
+ 0x9E6D, 0x9E6D, 0x1B5E, 0x9E6E, 0x9E6F, 0x554E, 0x9E70, 0x9E70, 0x108A,
+ 0x9E71, 0x9E71, 0x1B5D, 0x9E72, 0x9E72, 0x5550, 0x9E73, 0x9E73, 0x1B5F,
+ 0x9E74, 0x9E74, 0x5551, 0x9E75, 0x9E75, 0x2688, 0x9E76, 0x9E78, 0x5552,
+ 0x9E79, 0x9E79, 0x269E, 0x9E7A, 0x9E7A, 0x25FB, 0x9E7B, 0x9E7B, 0x5555,
+ 0x9E7C, 0x9E7C, 0x1F8C, 0x9E7D, 0x9E7D, 0x21F4, 0x9E7E, 0x9E7E, 0x1D16,
+ 0x9E7F, 0x9E7F, 0x0A60, 0x9E80, 0x9E81, 0x5556, 0x9E82, 0x9E82, 0x1DFC,
+ 0x9E83, 0x9E86, 0x5558, 0x9E87, 0x9E88, 0x1DFD, 0x9E89, 0x9E8A, 0x555C,
+ 0x9E8B, 0x9E8B, 0x1DFF, 0x9E8C, 0x9E91, 0x555E, 0x9E92, 0x9E92, 0x1E00,
+ 0x9E93, 0x9E93, 0x0A5B, 0x9E94, 0x9E96, 0x5564, 0x9E97, 0x9E97, 0x200F,
+ 0x9E98, 0x9E9C, 0x5567, 0x9E9D, 0x9E9D, 0x1E02, 0x9E9E, 0x9E9E, 0x556C,
+ 0x9E9F, 0x9E9F, 0x1E03, 0x9EA0, 0x9EA4, 0x556D, 0x9EA5, 0x9EA5, 0x2071,
+ 0x9EA6, 0x9EA6, 0x0A9A, 0x9EA7, 0x9EA8, 0x5572, 0x9EA9, 0x9EA9, 0x25F7,
+ 0x9EAA, 0x9EAE, 0x5574, 0x9EAF, 0x9EAF, 0x2696, 0x9EB0, 0x9EB3, 0x5579,
+ 0x9EB4, 0x9EB4, 0x1CEE, 0x9EB5, 0x9EB5, 0x268F, 0x9EB6, 0x9EB7, 0x557D,
+ 0x9EB8, 0x9EB8, 0x1CED, 0x9EB9, 0x9EBA, 0x557F, 0x9EBB, 0x9EBB, 0x0A90,
+ 0x9EBC, 0x9EBC, 0x5581, 0x9EBD, 0x9EBE, 0x1DF9, 0x9EBF, 0x9EC3, 0x5582,
+ 0x9EC4, 0x9EC4, 0x07DB, 0x9EC5, 0x9EC8, 0x5587, 0x9EC9, 0x9EC9, 0x12F8,
+ 0x9ECA, 0x9ECB, 0x558B, 0x9ECC, 0x9ECC, 0x22DA, 0x9ECD, 0x9ECD, 0x0D89,
+ 0x9ECE, 0x9ECE, 0x09D3, 0x9ECF, 0x9ECF, 0x1B2A, 0x9ED0, 0x9ED0, 0x558D,
+ 0x9ED1, 0x9ED1, 0x0791, 0x9ED2, 0x9ED3, 0x558E, 0x9ED4, 0x9ED4, 0x0C2A,
+ 0x9ED5, 0x9ED7, 0x5590, 0x9ED8, 0x9ED8, 0x0B0F, 0x9ED9, 0x9EDA, 0x5593,
+ 0x9EDB, 0x9EDD, 0x1E04, 0x9EDE, 0x9EDE, 0x1EC1, 0x9EDF, 0x9EDF, 0x1E08,
+ 0x9EE0, 0x9EE0, 0x1E07, 0x9EE1, 0x9EE1, 0x5595, 0x9EE2, 0x9EE2, 0x1E09,
+ 0x9EE3, 0x9EE4, 0x5596, 0x9EE5, 0x9EE5, 0x1E0C, 0x9EE6, 0x9EE6, 0x5598,
+ 0x9EE7, 0x9EE7, 0x1E0B, 0x9EE8, 0x9EE8, 0x1EB3, 0x9EE9, 0x9EE9, 0x1E0A,
+ 0x9EEA, 0x9EEA, 0x1E0D, 0x9EEB, 0x9EEE, 0x5599, 0x9EEF, 0x9EEF, 0x1E0E,
+ 0x9EF0, 0x9EF1, 0x559D, 0x9EF2, 0x9EF2, 0x266A, 0x9EF3, 0x9EF3, 0x559F,
+ 0x9EF4, 0x9EF4, 0x268A, 0x9EF5, 0x9EF6, 0x55A0, 0x9EF7, 0x9EF7, 0x2669,
+ 0x9EF8, 0x9EF8, 0x55A2, 0x9EF9, 0x9EF9, 0x1A55, 0x9EFA, 0x9EFA, 0x55A3,
+ 0x9EFB, 0x9EFC, 0x1A56, 0x9EFD, 0x9EFD, 0x2618, 0x9EFE, 0x9EFE, 0x1D76,
+ 0x9EFF, 0x9EFF, 0x2619, 0x9F00, 0x9F08, 0x55A4, 0x9F09, 0x9F09, 0x261A,
+ 0x9F0A, 0x9F0A, 0x55AD, 0x9F0B, 0x9F0B, 0x1D77, 0x9F0C, 0x9F0C, 0x55AE,
+ 0x9F0D, 0x9F0D, 0x1D78, 0x9F0E, 0x9F0E, 0x05E5, 0x9F0F, 0x9F0F, 0x55AF,
+ 0x9F10, 0x9F10, 0x1274, 0x9F11, 0x9F12, 0x55B0, 0x9F13, 0x9F13, 0x071D,
+ 0x9F14, 0x9F14, 0x55B2, 0x9F15, 0x9F15, 0x2673, 0x9F16, 0x9F16, 0x55B3,
+ 0x9F17, 0x9F17, 0x1271, 0x9F18, 0x9F18, 0x55B4, 0x9F19, 0x9F19, 0x13DF,
+ 0x9F1A, 0x9F1F, 0x55B5, 0x9F20, 0x9F20, 0x0D8A, 0x9F21, 0x9F21, 0x55BB,
+ 0x9F22, 0x9F22, 0x1E0F, 0x9F23, 0x9F2B, 0x55BC, 0x9F2C, 0x9F2C, 0x1E10,
+ 0x9F2D, 0x9F2E, 0x55C5, 0x9F2F, 0x9F2F, 0x1E11, 0x9F30, 0x9F36, 0x55C7,
+ 0x9F37, 0x9F37, 0x1E13, 0x9F38, 0x9F38, 0x55CE, 0x9F39, 0x9F39, 0x1E12,
+ 0x9F3A, 0x9F3A, 0x55CF, 0x9F3B, 0x9F3B, 0x0430, 0x9F3C, 0x9F3C, 0x55D0,
+ 0x9F3D, 0x9F3E, 0x1E14, 0x9F3F, 0x9F43, 0x55D1, 0x9F44, 0x9F44, 0x1E16,
+ 0x9F45, 0x9F49, 0x55D6, 0x9F4A, 0x9F4A, 0x20C6, 0x9F4B, 0x9F4B, 0x226B,
+ 0x9F4C, 0x9F4E, 0x55DB, 0x9F4F, 0x9F4F, 0x24D3, 0x9F50, 0x9F50, 0x0C0A,
+ 0x9F51, 0x9F51, 0x19C2, 0x9F52, 0x9F52, 0x1E86, 0x9F53, 0x9F53, 0x55DE,
+ 0x9F54, 0x9F54, 0x260F, 0x9F55, 0x9F58, 0x55DF, 0x9F59, 0x9F59, 0x2611,
+ 0x9F5A, 0x9F5B, 0x55E3, 0x9F5C, 0x9F5C, 0x2613, 0x9F5D, 0x9F5E, 0x55E5,
+ 0x9F5F, 0x9F5F, 0x2610, 0x9F60, 0x9F60, 0x2612, 0x9F61, 0x9F61, 0x2030,
+ 0x9F62, 0x9F62, 0x55E7, 0x9F63, 0x9F63, 0x2671, 0x9F64, 0x9F65, 0x55E8,
+ 0x9F66, 0x9F66, 0x2614, 0x9F67, 0x9F69, 0x55EA, 0x9F6A, 0x9F6A, 0x2616,
+ 0x9F6B, 0x9F6B, 0x55ED, 0x9F6C, 0x9F6C, 0x2615, 0x9F6D, 0x9F71, 0x55EE,
+ 0x9F72, 0x9F72, 0x20F2, 0x9F73, 0x9F76, 0x55F3, 0x9F77, 0x9F77, 0x2617,
+ 0x9F78, 0x9F7E, 0x55F7, 0x9F7F, 0x9F7F, 0x0502, 0x9F80, 0x9F80, 0x1D6D,
+ 0x9F81, 0x9F82, 0x55FE, 0x9F83, 0x9F83, 0x1D6E, 0x9F84, 0x9F84, 0x0A2D,
+ 0x9F85, 0x9F8A, 0x1D6F, 0x9F8B, 0x9F8B, 0x0C7E, 0x9F8C, 0x9F8C, 0x1D75,
+ 0x9F8D, 0x9F8D, 0x2037, 0x9F8E, 0x9F8F, 0x5600, 0x9F90, 0x9F90, 0x20B3,
+ 0x9F91, 0x9F93, 0x5602, 0x9F94, 0x9F94, 0x1F22, 0x9F95, 0x9F95, 0x24ED,
+ 0x9F96, 0x9F98, 0x5605, 0x9F99, 0x9F99, 0x0A43, 0x9F9A, 0x9F9A, 0x0701,
+ 0x9F9B, 0x9F9B, 0x1A54, 0x9F9C, 0x9F9C, 0x1F34, 0x9F9D, 0x9F9E, 0x5608,
+ 0x9F9F, 0x9F9F, 0x0743, 0x9FA0, 0x9FA0, 0x12F3, 0x9FA1, 0x9FA5, 0x560A,
+ 0xE816, 0xE818, 0x5620, 0xE81E, 0xE81E, 0x5628, 0xE826, 0xE826, 0x5630,
+ 0xE82B, 0xE82C, 0x5635, 0xE831, 0xE832, 0x563B, 0xE83B, 0xE83B, 0x5645,
+ 0xE843, 0xE843, 0x564D, 0xE854, 0xE855, 0x565E, 0xE864, 0xE864, 0x566E,
+ 0xF92C, 0xF92C, 0x560F, 0xFA0D, 0xFA0F, 0x5610, 0xFA11, 0xFA11, 0x5613,
+ 0xFA13, 0xFA14, 0x5614, 0xFA18, 0xFA18, 0x5616, 0xFA1F, 0xFA21, 0x5617,
+ 0xFA23, 0xFA24, 0x561A, 0xFA27, 0xFA29, 0x561C, 0xFE30, 0xFE30, 0x271D,
+ 0xFE49, 0xFE52, 0x272B, 0xFE54, 0xFE57, 0x2735, 0xFE59, 0xFE66, 0x2739,
+ 0xFE68, 0xFE6B, 0x2747, 0xFF01, 0xFF03, 0x0106, 0xFF04, 0xFF04, 0x00A6,
+ 0xFF05, 0xFF5D, 0x010A, 0xFF5E, 0xFF5E, 0x006A, 0xFFE0, 0xFFE1, 0x00A8,
+ 0xFFE2, 0xFFE2, 0x271E, 0xFFE3, 0xFFE3, 0x0163, 0xFFE4, 0xFFE4, 0x271F,
+ 0xFFE5, 0xFFE5, 0x0109,
+};
diff --git a/core/src/fpdfapi/fpdf_cmaps/Japan1/83pv-RKSJ-H_1.cpp b/core/src/fpdfapi/fpdf_cmaps/Japan1/83pv-RKSJ-H_1.cpp
index 9399e63115..6a8853735a 100644
--- a/core/src/fpdfapi/fpdf_cmaps/Japan1/83pv-RKSJ-H_1.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/Japan1/83pv-RKSJ-H_1.cpp
@@ -1,82 +1,82 @@
-// 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
-
-extern const unsigned short g_FXCMAP_83pv_RKSJ_H_1[222 * 3] = {
- 0x0020, 0x007E, 0x0001, 0x0080, 0x0080, 0x0061, 0x00A0, 0x00DF, 0x0146,
- 0x00FD, 0x00FD, 0x0098, 0x00FE, 0x00FE, 0x00E4, 0x00FF, 0x00FF, 0x007C,
- 0x8140, 0x817E, 0x0279, 0x8180, 0x81AC, 0x02B8, 0x81B8, 0x81BF, 0x02E5,
- 0x81C8, 0x81CE, 0x02ED, 0x81DA, 0x81E8, 0x02F4, 0x81F0, 0x81F7, 0x0303,
- 0x81FC, 0x81FC, 0x030B, 0x824F, 0x8258, 0x030C, 0x8260, 0x8279, 0x0316,
- 0x8281, 0x829A, 0x0330, 0x829F, 0x82F1, 0x034A, 0x8340, 0x837E, 0x039D,
- 0x8380, 0x8396, 0x03DC, 0x839F, 0x83B6, 0x03F3, 0x83BF, 0x83D6, 0x040B,
- 0x8440, 0x8460, 0x0423, 0x8470, 0x847E, 0x0444, 0x8480, 0x8491, 0x0453,
- 0x849F, 0x849F, 0x1D37, 0x84A0, 0x84A0, 0x1D39, 0x84A1, 0x84A1, 0x1D43,
- 0x84A2, 0x84A2, 0x1D47, 0x84A3, 0x84A3, 0x1D4F, 0x84A4, 0x84A4, 0x1D4B,
- 0x84A5, 0x84A5, 0x1D53, 0x84A6, 0x84A6, 0x1D63, 0x84A7, 0x84A7, 0x1D5B,
- 0x84A8, 0x84A8, 0x1D6B, 0x84A9, 0x84A9, 0x1D73, 0x84AA, 0x84AA, 0x1D38,
- 0x84AB, 0x84AB, 0x1D3A, 0x84AC, 0x84AC, 0x1D46, 0x84AD, 0x84AD, 0x1D4A,
- 0x84AE, 0x84AE, 0x1D52, 0x84AF, 0x84AF, 0x1D4E, 0x84B0, 0x84B0, 0x1D5A,
- 0x84B1, 0x84B1, 0x1D6A, 0x84B2, 0x84B2, 0x1D62, 0x84B3, 0x84B3, 0x1D72,
- 0x84B4, 0x84B4, 0x1D82, 0x84B5, 0x84B5, 0x1D57, 0x84B6, 0x84B6, 0x1D66,
- 0x84B7, 0x84B7, 0x1D5F, 0x84B8, 0x84B8, 0x1D6E, 0x84B9, 0x84B9, 0x1D76,
- 0x84BA, 0x84BA, 0x1D54, 0x84BB, 0x84BB, 0x1D67, 0x84BC, 0x84BC, 0x1D5C,
- 0x84BD, 0x84BD, 0x1D6F, 0x84BE, 0x84BE, 0x1D79, 0x8540, 0x857E, 0x00E8,
- 0x8580, 0x8580, 0x0186, 0x8581, 0x859E, 0x0128, 0x859F, 0x85DD, 0x0147,
- 0x85DE, 0x85FC, 0x0187, 0x8640, 0x867E, 0x01A6, 0x8680, 0x8691, 0x01E5,
- 0x8692, 0x8692, 0x0127, 0x8693, 0x869E, 0x01F7, 0x86A2, 0x86ED, 0x1D37,
- 0x8740, 0x875D, 0x1D83, 0x875F, 0x8775, 0x1DA1, 0x8780, 0x878F, 0x1DB8,
- 0x8790, 0x8790, 0x02FA, 0x8791, 0x8791, 0x02F9, 0x8792, 0x8792, 0x0301,
- 0x8793, 0x8799, 0x1DC8, 0x879A, 0x879A, 0x0300, 0x879B, 0x879C, 0x1DCF,
- 0x889F, 0x88FC, 0x0465, 0x8940, 0x897E, 0x04C3, 0x8980, 0x89FC, 0x0502,
- 0x8A40, 0x8A7E, 0x057F, 0x8A80, 0x8AFC, 0x05BE, 0x8B40, 0x8B7E, 0x063B,
- 0x8B80, 0x8BFC, 0x067A, 0x8C40, 0x8C7E, 0x06F7, 0x8C80, 0x8CFC, 0x0736,
- 0x8D40, 0x8D7E, 0x07B3, 0x8D80, 0x8DFC, 0x07F2, 0x8E40, 0x8E7E, 0x086F,
- 0x8E80, 0x8EFC, 0x08AE, 0x8F40, 0x8F7E, 0x092B, 0x8F80, 0x8FFC, 0x096A,
- 0x9040, 0x907E, 0x09E7, 0x9080, 0x90FC, 0x0A26, 0x9140, 0x917E, 0x0AA3,
- 0x9180, 0x91FC, 0x0AE2, 0x9240, 0x927E, 0x0B5F, 0x9280, 0x92FC, 0x0B9E,
- 0x9340, 0x937E, 0x0C1B, 0x9380, 0x93FC, 0x0C5A, 0x9440, 0x947E, 0x0CD7,
- 0x9480, 0x94FC, 0x0D16, 0x9540, 0x957E, 0x0D93, 0x9580, 0x95FC, 0x0DD2,
- 0x9640, 0x967E, 0x0E4F, 0x9680, 0x96FC, 0x0E8E, 0x9740, 0x977E, 0x0F0B,
- 0x9780, 0x97FC, 0x0F4A, 0x9840, 0x9872, 0x0FC7, 0x989F, 0x98FC, 0x0FFA,
- 0x9940, 0x997E, 0x1058, 0x9980, 0x99FC, 0x1097, 0x9A40, 0x9A7E, 0x1114,
- 0x9A80, 0x9AFC, 0x1153, 0x9B40, 0x9B7E, 0x11D0, 0x9B80, 0x9BFC, 0x120F,
- 0x9C40, 0x9C7E, 0x128C, 0x9C80, 0x9CFC, 0x12CB, 0x9D40, 0x9D7E, 0x1348,
- 0x9D80, 0x9DFC, 0x1387, 0x9E40, 0x9E7E, 0x1404, 0x9E80, 0x9EFC, 0x1443,
- 0x9F40, 0x9F7E, 0x14C0, 0x9F80, 0x9FFC, 0x14FF, 0xE040, 0xE07E, 0x157C,
- 0xE080, 0xE0FC, 0x15BB, 0xE140, 0xE17E, 0x1638, 0xE180, 0xE1FC, 0x1677,
- 0xE240, 0xE27E, 0x16F4, 0xE280, 0xE2FC, 0x1733, 0xE340, 0xE37E, 0x17B0,
- 0xE380, 0xE3FC, 0x17EF, 0xE440, 0xE47E, 0x186C, 0xE480, 0xE4FC, 0x18AB,
- 0xE540, 0xE57E, 0x1928, 0xE580, 0xE5FC, 0x1967, 0xE640, 0xE67E, 0x19E4,
- 0xE680, 0xE6FC, 0x1A23, 0xE740, 0xE77E, 0x1AA0, 0xE780, 0xE7FC, 0x1ADF,
- 0xE840, 0xE87E, 0x1B5C, 0xE880, 0xE8FC, 0x1B9B, 0xE940, 0xE97E, 0x1C18,
- 0xE980, 0xE9FC, 0x1C57, 0xEA40, 0xEA7E, 0x1CD4, 0xEA80, 0xEAA2, 0x1D13,
- 0xEAA3, 0xEAA4, 0x205C, 0xEB40, 0xEB40, 0x0279, 0xEB41, 0xEB42, 0x1ECF,
- 0xEB43, 0xEB4F, 0x027C, 0xEB50, 0xEB51, 0x1ED1, 0xEB52, 0xEB5A, 0x028B,
- 0xEB5B, 0xEB5D, 0x1ED3, 0xEB5E, 0xEB5F, 0x0297, 0xEB60, 0xEB64, 0x1ED6,
- 0xEB65, 0xEB68, 0x029E, 0xEB69, 0xEB7A, 0x1EDB, 0xEB7B, 0xEB7E, 0x02B4,
- 0xEB80, 0xEB80, 0x02B8, 0xEB81, 0xEB81, 0x1EED, 0xEB82, 0xEBAC, 0x02BA,
- 0xEBB8, 0xEBBF, 0x02E5, 0xEBC8, 0xEBCE, 0x02ED, 0xEBDA, 0xEBE8, 0x02F4,
- 0xEBF0, 0xEBF7, 0x0303, 0xEBFC, 0xEBFC, 0x030B, 0xEC4F, 0xEC58, 0x030C,
- 0xEC60, 0xEC79, 0x0316, 0xEC81, 0xEC9A, 0x0330, 0xEC9F, 0xEC9F, 0x1EEE,
- 0xECA0, 0xECA0, 0x034B, 0xECA1, 0xECA1, 0x1EEF, 0xECA2, 0xECA2, 0x034D,
- 0xECA3, 0xECA3, 0x1EF0, 0xECA4, 0xECA4, 0x034F, 0xECA5, 0xECA5, 0x1EF1,
- 0xECA6, 0xECA6, 0x0351, 0xECA7, 0xECA7, 0x1EF2, 0xECA8, 0xECC0, 0x0353,
- 0xECC1, 0xECC1, 0x1EF3, 0xECC2, 0xECE0, 0x036D, 0xECE1, 0xECE1, 0x1EF4,
- 0xECE2, 0xECE2, 0x038D, 0xECE3, 0xECE3, 0x1EF5, 0xECE4, 0xECE4, 0x038F,
- 0xECE5, 0xECE5, 0x1EF6, 0xECE6, 0xECEB, 0x0391, 0xECEC, 0xECEC, 0x1EF7,
- 0xECED, 0xECF1, 0x0398, 0xED40, 0xED40, 0x1EF8, 0xED41, 0xED41, 0x039E,
- 0xED42, 0xED42, 0x1EF9, 0xED43, 0xED43, 0x03A0, 0xED44, 0xED44, 0x1EFA,
- 0xED45, 0xED45, 0x03A2, 0xED46, 0xED46, 0x1EFB, 0xED47, 0xED47, 0x03A4,
- 0xED48, 0xED48, 0x1EFC, 0xED49, 0xED61, 0x03A6, 0xED62, 0xED62, 0x1EFD,
- 0xED63, 0xED7E, 0x03C0, 0xED80, 0xED82, 0x03DC, 0xED83, 0xED83, 0x1EFE,
- 0xED84, 0xED84, 0x03E0, 0xED85, 0xED85, 0x1EFF, 0xED86, 0xED86, 0x03E2,
- 0xED87, 0xED87, 0x1F00, 0xED88, 0xED8D, 0x03E4, 0xED8E, 0xED8E, 0x1F01,
- 0xED8F, 0xED94, 0x03EB, 0xED95, 0xED96, 0x1F02, 0xED9F, 0xEDB6, 0x03F3,
- 0xEDBF, 0xEDD6, 0x040B, 0xEE40, 0xEE5D, 0x1D83, 0xEE5F, 0xEE6E, 0x1F04,
- 0xEE6F, 0xEE75, 0x1DB1, 0xEE80, 0xEE81, 0x1F14, 0xEE82, 0xEE8F, 0x1DBA,
- 0xEE90, 0xEE90, 0x02FA, 0xEE91, 0xEE91, 0x02F9, 0xEE92, 0xEE92, 0x0301,
- 0xEE93, 0xEE99, 0x1DC8, 0xEE9A, 0xEE9A, 0x0300, 0xEE9B, 0xEE9C, 0x1DCF,
-};
+// 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
+
+extern const unsigned short g_FXCMAP_83pv_RKSJ_H_1[222 * 3] = {
+ 0x0020, 0x007E, 0x0001, 0x0080, 0x0080, 0x0061, 0x00A0, 0x00DF, 0x0146,
+ 0x00FD, 0x00FD, 0x0098, 0x00FE, 0x00FE, 0x00E4, 0x00FF, 0x00FF, 0x007C,
+ 0x8140, 0x817E, 0x0279, 0x8180, 0x81AC, 0x02B8, 0x81B8, 0x81BF, 0x02E5,
+ 0x81C8, 0x81CE, 0x02ED, 0x81DA, 0x81E8, 0x02F4, 0x81F0, 0x81F7, 0x0303,
+ 0x81FC, 0x81FC, 0x030B, 0x824F, 0x8258, 0x030C, 0x8260, 0x8279, 0x0316,
+ 0x8281, 0x829A, 0x0330, 0x829F, 0x82F1, 0x034A, 0x8340, 0x837E, 0x039D,
+ 0x8380, 0x8396, 0x03DC, 0x839F, 0x83B6, 0x03F3, 0x83BF, 0x83D6, 0x040B,
+ 0x8440, 0x8460, 0x0423, 0x8470, 0x847E, 0x0444, 0x8480, 0x8491, 0x0453,
+ 0x849F, 0x849F, 0x1D37, 0x84A0, 0x84A0, 0x1D39, 0x84A1, 0x84A1, 0x1D43,
+ 0x84A2, 0x84A2, 0x1D47, 0x84A3, 0x84A3, 0x1D4F, 0x84A4, 0x84A4, 0x1D4B,
+ 0x84A5, 0x84A5, 0x1D53, 0x84A6, 0x84A6, 0x1D63, 0x84A7, 0x84A7, 0x1D5B,
+ 0x84A8, 0x84A8, 0x1D6B, 0x84A9, 0x84A9, 0x1D73, 0x84AA, 0x84AA, 0x1D38,
+ 0x84AB, 0x84AB, 0x1D3A, 0x84AC, 0x84AC, 0x1D46, 0x84AD, 0x84AD, 0x1D4A,
+ 0x84AE, 0x84AE, 0x1D52, 0x84AF, 0x84AF, 0x1D4E, 0x84B0, 0x84B0, 0x1D5A,
+ 0x84B1, 0x84B1, 0x1D6A, 0x84B2, 0x84B2, 0x1D62, 0x84B3, 0x84B3, 0x1D72,
+ 0x84B4, 0x84B4, 0x1D82, 0x84B5, 0x84B5, 0x1D57, 0x84B6, 0x84B6, 0x1D66,
+ 0x84B7, 0x84B7, 0x1D5F, 0x84B8, 0x84B8, 0x1D6E, 0x84B9, 0x84B9, 0x1D76,
+ 0x84BA, 0x84BA, 0x1D54, 0x84BB, 0x84BB, 0x1D67, 0x84BC, 0x84BC, 0x1D5C,
+ 0x84BD, 0x84BD, 0x1D6F, 0x84BE, 0x84BE, 0x1D79, 0x8540, 0x857E, 0x00E8,
+ 0x8580, 0x8580, 0x0186, 0x8581, 0x859E, 0x0128, 0x859F, 0x85DD, 0x0147,
+ 0x85DE, 0x85FC, 0x0187, 0x8640, 0x867E, 0x01A6, 0x8680, 0x8691, 0x01E5,
+ 0x8692, 0x8692, 0x0127, 0x8693, 0x869E, 0x01F7, 0x86A2, 0x86ED, 0x1D37,
+ 0x8740, 0x875D, 0x1D83, 0x875F, 0x8775, 0x1DA1, 0x8780, 0x878F, 0x1DB8,
+ 0x8790, 0x8790, 0x02FA, 0x8791, 0x8791, 0x02F9, 0x8792, 0x8792, 0x0301,
+ 0x8793, 0x8799, 0x1DC8, 0x879A, 0x879A, 0x0300, 0x879B, 0x879C, 0x1DCF,
+ 0x889F, 0x88FC, 0x0465, 0x8940, 0x897E, 0x04C3, 0x8980, 0x89FC, 0x0502,
+ 0x8A40, 0x8A7E, 0x057F, 0x8A80, 0x8AFC, 0x05BE, 0x8B40, 0x8B7E, 0x063B,
+ 0x8B80, 0x8BFC, 0x067A, 0x8C40, 0x8C7E, 0x06F7, 0x8C80, 0x8CFC, 0x0736,
+ 0x8D40, 0x8D7E, 0x07B3, 0x8D80, 0x8DFC, 0x07F2, 0x8E40, 0x8E7E, 0x086F,
+ 0x8E80, 0x8EFC, 0x08AE, 0x8F40, 0x8F7E, 0x092B, 0x8F80, 0x8FFC, 0x096A,
+ 0x9040, 0x907E, 0x09E7, 0x9080, 0x90FC, 0x0A26, 0x9140, 0x917E, 0x0AA3,
+ 0x9180, 0x91FC, 0x0AE2, 0x9240, 0x927E, 0x0B5F, 0x9280, 0x92FC, 0x0B9E,
+ 0x9340, 0x937E, 0x0C1B, 0x9380, 0x93FC, 0x0C5A, 0x9440, 0x947E, 0x0CD7,
+ 0x9480, 0x94FC, 0x0D16, 0x9540, 0x957E, 0x0D93, 0x9580, 0x95FC, 0x0DD2,
+ 0x9640, 0x967E, 0x0E4F, 0x9680, 0x96FC, 0x0E8E, 0x9740, 0x977E, 0x0F0B,
+ 0x9780, 0x97FC, 0x0F4A, 0x9840, 0x9872, 0x0FC7, 0x989F, 0x98FC, 0x0FFA,
+ 0x9940, 0x997E, 0x1058, 0x9980, 0x99FC, 0x1097, 0x9A40, 0x9A7E, 0x1114,
+ 0x9A80, 0x9AFC, 0x1153, 0x9B40, 0x9B7E, 0x11D0, 0x9B80, 0x9BFC, 0x120F,
+ 0x9C40, 0x9C7E, 0x128C, 0x9C80, 0x9CFC, 0x12CB, 0x9D40, 0x9D7E, 0x1348,
+ 0x9D80, 0x9DFC, 0x1387, 0x9E40, 0x9E7E, 0x1404, 0x9E80, 0x9EFC, 0x1443,
+ 0x9F40, 0x9F7E, 0x14C0, 0x9F80, 0x9FFC, 0x14FF, 0xE040, 0xE07E, 0x157C,
+ 0xE080, 0xE0FC, 0x15BB, 0xE140, 0xE17E, 0x1638, 0xE180, 0xE1FC, 0x1677,
+ 0xE240, 0xE27E, 0x16F4, 0xE280, 0xE2FC, 0x1733, 0xE340, 0xE37E, 0x17B0,
+ 0xE380, 0xE3FC, 0x17EF, 0xE440, 0xE47E, 0x186C, 0xE480, 0xE4FC, 0x18AB,
+ 0xE540, 0xE57E, 0x1928, 0xE580, 0xE5FC, 0x1967, 0xE640, 0xE67E, 0x19E4,
+ 0xE680, 0xE6FC, 0x1A23, 0xE740, 0xE77E, 0x1AA0, 0xE780, 0xE7FC, 0x1ADF,
+ 0xE840, 0xE87E, 0x1B5C, 0xE880, 0xE8FC, 0x1B9B, 0xE940, 0xE97E, 0x1C18,
+ 0xE980, 0xE9FC, 0x1C57, 0xEA40, 0xEA7E, 0x1CD4, 0xEA80, 0xEAA2, 0x1D13,
+ 0xEAA3, 0xEAA4, 0x205C, 0xEB40, 0xEB40, 0x0279, 0xEB41, 0xEB42, 0x1ECF,
+ 0xEB43, 0xEB4F, 0x027C, 0xEB50, 0xEB51, 0x1ED1, 0xEB52, 0xEB5A, 0x028B,
+ 0xEB5B, 0xEB5D, 0x1ED3, 0xEB5E, 0xEB5F, 0x0297, 0xEB60, 0xEB64, 0x1ED6,
+ 0xEB65, 0xEB68, 0x029E, 0xEB69, 0xEB7A, 0x1EDB, 0xEB7B, 0xEB7E, 0x02B4,
+ 0xEB80, 0xEB80, 0x02B8, 0xEB81, 0xEB81, 0x1EED, 0xEB82, 0xEBAC, 0x02BA,
+ 0xEBB8, 0xEBBF, 0x02E5, 0xEBC8, 0xEBCE, 0x02ED, 0xEBDA, 0xEBE8, 0x02F4,
+ 0xEBF0, 0xEBF7, 0x0303, 0xEBFC, 0xEBFC, 0x030B, 0xEC4F, 0xEC58, 0x030C,
+ 0xEC60, 0xEC79, 0x0316, 0xEC81, 0xEC9A, 0x0330, 0xEC9F, 0xEC9F, 0x1EEE,
+ 0xECA0, 0xECA0, 0x034B, 0xECA1, 0xECA1, 0x1EEF, 0xECA2, 0xECA2, 0x034D,
+ 0xECA3, 0xECA3, 0x1EF0, 0xECA4, 0xECA4, 0x034F, 0xECA5, 0xECA5, 0x1EF1,
+ 0xECA6, 0xECA6, 0x0351, 0xECA7, 0xECA7, 0x1EF2, 0xECA8, 0xECC0, 0x0353,
+ 0xECC1, 0xECC1, 0x1EF3, 0xECC2, 0xECE0, 0x036D, 0xECE1, 0xECE1, 0x1EF4,
+ 0xECE2, 0xECE2, 0x038D, 0xECE3, 0xECE3, 0x1EF5, 0xECE4, 0xECE4, 0x038F,
+ 0xECE5, 0xECE5, 0x1EF6, 0xECE6, 0xECEB, 0x0391, 0xECEC, 0xECEC, 0x1EF7,
+ 0xECED, 0xECF1, 0x0398, 0xED40, 0xED40, 0x1EF8, 0xED41, 0xED41, 0x039E,
+ 0xED42, 0xED42, 0x1EF9, 0xED43, 0xED43, 0x03A0, 0xED44, 0xED44, 0x1EFA,
+ 0xED45, 0xED45, 0x03A2, 0xED46, 0xED46, 0x1EFB, 0xED47, 0xED47, 0x03A4,
+ 0xED48, 0xED48, 0x1EFC, 0xED49, 0xED61, 0x03A6, 0xED62, 0xED62, 0x1EFD,
+ 0xED63, 0xED7E, 0x03C0, 0xED80, 0xED82, 0x03DC, 0xED83, 0xED83, 0x1EFE,
+ 0xED84, 0xED84, 0x03E0, 0xED85, 0xED85, 0x1EFF, 0xED86, 0xED86, 0x03E2,
+ 0xED87, 0xED87, 0x1F00, 0xED88, 0xED8D, 0x03E4, 0xED8E, 0xED8E, 0x1F01,
+ 0xED8F, 0xED94, 0x03EB, 0xED95, 0xED96, 0x1F02, 0xED9F, 0xEDB6, 0x03F3,
+ 0xEDBF, 0xEDD6, 0x040B, 0xEE40, 0xEE5D, 0x1D83, 0xEE5F, 0xEE6E, 0x1F04,
+ 0xEE6F, 0xEE75, 0x1DB1, 0xEE80, 0xEE81, 0x1F14, 0xEE82, 0xEE8F, 0x1DBA,
+ 0xEE90, 0xEE90, 0x02FA, 0xEE91, 0xEE91, 0x02F9, 0xEE92, 0xEE92, 0x0301,
+ 0xEE93, 0xEE99, 0x1DC8, 0xEE9A, 0xEE9A, 0x0300, 0xEE9B, 0xEE9C, 0x1DCF,
+};
diff --git a/core/src/fpdfapi/fpdf_cmaps/Japan1/90ms-RKSJ-H_2.cpp b/core/src/fpdfapi/fpdf_cmaps/Japan1/90ms-RKSJ-H_2.cpp
index f41ca62b92..1bc31d8794 100644
--- a/core/src/fpdfapi/fpdf_cmaps/Japan1/90ms-RKSJ-H_2.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/Japan1/90ms-RKSJ-H_2.cpp
@@ -1,65 +1,65 @@
-// 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
-
-extern const unsigned short g_FXCMAP_90ms_RKSJ_H_2[171 * 3] = {
- 0x0020, 0x007D, 0x00E7, 0x007E, 0x007E, 0x0277, 0x00A0, 0x00DF, 0x0146,
- 0x8140, 0x817E, 0x0279, 0x8180, 0x81AC, 0x02B8, 0x81B8, 0x81BF, 0x02E5,
- 0x81C8, 0x81CE, 0x02ED, 0x81DA, 0x81E8, 0x02F4, 0x81F0, 0x81F7, 0x0303,
- 0x81FC, 0x81FC, 0x030B, 0x824F, 0x8258, 0x030C, 0x8260, 0x8279, 0x0316,
- 0x8281, 0x829A, 0x0330, 0x829F, 0x82F1, 0x034A, 0x8340, 0x837E, 0x039D,
- 0x8380, 0x8396, 0x03DC, 0x839F, 0x83B6, 0x03F3, 0x83BF, 0x83D6, 0x040B,
- 0x8440, 0x8460, 0x0423, 0x8470, 0x847E, 0x0444, 0x8480, 0x8491, 0x0453,
- 0x849F, 0x849F, 0x1D37, 0x84A0, 0x84A0, 0x1D39, 0x84A1, 0x84A1, 0x1D43,
- 0x84A2, 0x84A2, 0x1D47, 0x84A3, 0x84A3, 0x1D4F, 0x84A4, 0x84A4, 0x1D4B,
- 0x84A5, 0x84A5, 0x1D53, 0x84A6, 0x84A6, 0x1D63, 0x84A7, 0x84A7, 0x1D5B,
- 0x84A8, 0x84A8, 0x1D6B, 0x84A9, 0x84A9, 0x1D73, 0x84AA, 0x84AA, 0x1D38,
- 0x84AB, 0x84AB, 0x1D3A, 0x84AC, 0x84AC, 0x1D46, 0x84AD, 0x84AD, 0x1D4A,
- 0x84AE, 0x84AE, 0x1D52, 0x84AF, 0x84AF, 0x1D4E, 0x84B0, 0x84B0, 0x1D5A,
- 0x84B1, 0x84B1, 0x1D6A, 0x84B2, 0x84B2, 0x1D62, 0x84B3, 0x84B3, 0x1D72,
- 0x84B4, 0x84B4, 0x1D82, 0x84B5, 0x84B5, 0x1D57, 0x84B6, 0x84B6, 0x1D66,
- 0x84B7, 0x84B7, 0x1D5F, 0x84B8, 0x84B8, 0x1D6E, 0x84B9, 0x84B9, 0x1D76,
- 0x84BA, 0x84BA, 0x1D54, 0x84BB, 0x84BB, 0x1D67, 0x84BC, 0x84BC, 0x1D5C,
- 0x84BD, 0x84BD, 0x1D6F, 0x84BE, 0x84BE, 0x1D79, 0x8740, 0x875D, 0x1D83,
- 0x875F, 0x8760, 0x1DA1, 0x8761, 0x8761, 0x1F66, 0x8762, 0x8762, 0x1DA4,
- 0x8763, 0x8763, 0x1F68, 0x8764, 0x8764, 0x1DA6, 0x8765, 0x8765, 0x1F6A,
- 0x8766, 0x8767, 0x1DA8, 0x8768, 0x8768, 0x1F6C, 0x8769, 0x876A, 0x1DAB,
- 0x876B, 0x876B, 0x1F6B, 0x876C, 0x876D, 0x1DAE, 0x876E, 0x876E, 0x1F6F,
- 0x876F, 0x8775, 0x1DB1, 0x877E, 0x877E, 0x2083, 0x8780, 0x8783, 0x1DB8,
- 0x8784, 0x8784, 0x1F77, 0x8785, 0x878F, 0x1DBD, 0x8790, 0x8790, 0x02FA,
- 0x8791, 0x8791, 0x02F9, 0x8792, 0x8792, 0x0301, 0x8793, 0x8799, 0x1DC8,
- 0x879A, 0x879A, 0x0300, 0x879B, 0x879C, 0x1DCF, 0x889F, 0x88FC, 0x0465,
- 0x8940, 0x897E, 0x04C3, 0x8980, 0x89FC, 0x0502, 0x8A40, 0x8A7E, 0x057F,
- 0x8A80, 0x8AFC, 0x05BE, 0x8B40, 0x8B7E, 0x063B, 0x8B80, 0x8BFC, 0x067A,
- 0x8C40, 0x8C7E, 0x06F7, 0x8C80, 0x8CFC, 0x0736, 0x8D40, 0x8D7E, 0x07B3,
- 0x8D80, 0x8DFC, 0x07F2, 0x8E40, 0x8E7E, 0x086F, 0x8E80, 0x8EFC, 0x08AE,
- 0x8F40, 0x8F7E, 0x092B, 0x8F80, 0x8FFC, 0x096A, 0x9040, 0x907E, 0x09E7,
- 0x9080, 0x90FC, 0x0A26, 0x9140, 0x917E, 0x0AA3, 0x9180, 0x91FC, 0x0AE2,
- 0x9240, 0x927E, 0x0B5F, 0x9280, 0x92FC, 0x0B9E, 0x9340, 0x937E, 0x0C1B,
- 0x9380, 0x93FC, 0x0C5A, 0x9440, 0x947E, 0x0CD7, 0x9480, 0x94FC, 0x0D16,
- 0x9540, 0x957E, 0x0D93, 0x9580, 0x95FC, 0x0DD2, 0x9640, 0x967E, 0x0E4F,
- 0x9680, 0x96FC, 0x0E8E, 0x9740, 0x977E, 0x0F0B, 0x9780, 0x97FC, 0x0F4A,
- 0x9840, 0x9872, 0x0FC7, 0x989F, 0x98FC, 0x0FFA, 0x9940, 0x997E, 0x1058,
- 0x9980, 0x99FC, 0x1097, 0x9A40, 0x9A7E, 0x1114, 0x9A80, 0x9AFC, 0x1153,
- 0x9B40, 0x9B7E, 0x11D0, 0x9B80, 0x9BFC, 0x120F, 0x9C40, 0x9C7E, 0x128C,
- 0x9C80, 0x9CFC, 0x12CB, 0x9D40, 0x9D7E, 0x1348, 0x9D80, 0x9DFC, 0x1387,
- 0x9E40, 0x9E7E, 0x1404, 0x9E80, 0x9EFC, 0x1443, 0x9F40, 0x9F7E, 0x14C0,
- 0x9F80, 0x9FFC, 0x14FF, 0xE040, 0xE07E, 0x157C, 0xE080, 0xE0FC, 0x15BB,
- 0xE140, 0xE17E, 0x1638, 0xE180, 0xE1FC, 0x1677, 0xE240, 0xE27E, 0x16F4,
- 0xE280, 0xE2FC, 0x1733, 0xE340, 0xE37E, 0x17B0, 0xE380, 0xE3FC, 0x17EF,
- 0xE440, 0xE47E, 0x186C, 0xE480, 0xE4FC, 0x18AB, 0xE540, 0xE57E, 0x1928,
- 0xE580, 0xE5FC, 0x1967, 0xE640, 0xE67E, 0x19E4, 0xE680, 0xE6FC, 0x1A23,
- 0xE740, 0xE77E, 0x1AA0, 0xE780, 0xE7FC, 0x1ADF, 0xE840, 0xE87E, 0x1B5C,
- 0xE880, 0xE8FC, 0x1B9B, 0xE940, 0xE97E, 0x1C18, 0xE980, 0xE9FC, 0x1C57,
- 0xEA40, 0xEA7E, 0x1CD4, 0xEA80, 0xEAA2, 0x1D13, 0xEAA3, 0xEAA4, 0x205C,
- 0xED40, 0xED7E, 0x20A7, 0xED80, 0xEDB3, 0x20E6, 0xEDB4, 0xEDB4, 0x07C9,
- 0xEDB5, 0xEDFC, 0x211A, 0xEE40, 0xEE7E, 0x2162, 0xEE80, 0xEEEC, 0x21A1,
- 0xEEEF, 0xEEF8, 0x1F9C, 0xEEF9, 0xEEF9, 0x02EF, 0xEEFA, 0xEEFC, 0x1F45,
- 0xFA40, 0xFA49, 0x1F9C, 0xFA4A, 0xFA53, 0x1D97, 0xFA54, 0xFA54, 0x02EF,
- 0xFA55, 0xFA57, 0x1F45, 0xFA58, 0xFA58, 0x1DC2, 0xFA59, 0xFA59, 0x1DBA,
- 0xFA5A, 0xFA5A, 0x1F77, 0xFA5B, 0xFA5B, 0x0300, 0xFA5C, 0xFA7E, 0x20A7,
- 0xFA80, 0xFACF, 0x20CA, 0xFAD0, 0xFAD0, 0x07C9, 0xFAD1, 0xFAFC, 0x211A,
- 0xFB40, 0xFB7E, 0x2146, 0xFB80, 0xFBFC, 0x2185, 0xFC40, 0xFC4B, 0x2202,
-};
+// 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
+
+extern const unsigned short g_FXCMAP_90ms_RKSJ_H_2[171 * 3] = {
+ 0x0020, 0x007D, 0x00E7, 0x007E, 0x007E, 0x0277, 0x00A0, 0x00DF, 0x0146,
+ 0x8140, 0x817E, 0x0279, 0x8180, 0x81AC, 0x02B8, 0x81B8, 0x81BF, 0x02E5,
+ 0x81C8, 0x81CE, 0x02ED, 0x81DA, 0x81E8, 0x02F4, 0x81F0, 0x81F7, 0x0303,
+ 0x81FC, 0x81FC, 0x030B, 0x824F, 0x8258, 0x030C, 0x8260, 0x8279, 0x0316,
+ 0x8281, 0x829A, 0x0330, 0x829F, 0x82F1, 0x034A, 0x8340, 0x837E, 0x039D,
+ 0x8380, 0x8396, 0x03DC, 0x839F, 0x83B6, 0x03F3, 0x83BF, 0x83D6, 0x040B,
+ 0x8440, 0x8460, 0x0423, 0x8470, 0x847E, 0x0444, 0x8480, 0x8491, 0x0453,
+ 0x849F, 0x849F, 0x1D37, 0x84A0, 0x84A0, 0x1D39, 0x84A1, 0x84A1, 0x1D43,
+ 0x84A2, 0x84A2, 0x1D47, 0x84A3, 0x84A3, 0x1D4F, 0x84A4, 0x84A4, 0x1D4B,
+ 0x84A5, 0x84A5, 0x1D53, 0x84A6, 0x84A6, 0x1D63, 0x84A7, 0x84A7, 0x1D5B,
+ 0x84A8, 0x84A8, 0x1D6B, 0x84A9, 0x84A9, 0x1D73, 0x84AA, 0x84AA, 0x1D38,
+ 0x84AB, 0x84AB, 0x1D3A, 0x84AC, 0x84AC, 0x1D46, 0x84AD, 0x84AD, 0x1D4A,
+ 0x84AE, 0x84AE, 0x1D52, 0x84AF, 0x84AF, 0x1D4E, 0x84B0, 0x84B0, 0x1D5A,
+ 0x84B1, 0x84B1, 0x1D6A, 0x84B2, 0x84B2, 0x1D62, 0x84B3, 0x84B3, 0x1D72,
+ 0x84B4, 0x84B4, 0x1D82, 0x84B5, 0x84B5, 0x1D57, 0x84B6, 0x84B6, 0x1D66,
+ 0x84B7, 0x84B7, 0x1D5F, 0x84B8, 0x84B8, 0x1D6E, 0x84B9, 0x84B9, 0x1D76,
+ 0x84BA, 0x84BA, 0x1D54, 0x84BB, 0x84BB, 0x1D67, 0x84BC, 0x84BC, 0x1D5C,
+ 0x84BD, 0x84BD, 0x1D6F, 0x84BE, 0x84BE, 0x1D79, 0x8740, 0x875D, 0x1D83,
+ 0x875F, 0x8760, 0x1DA1, 0x8761, 0x8761, 0x1F66, 0x8762, 0x8762, 0x1DA4,
+ 0x8763, 0x8763, 0x1F68, 0x8764, 0x8764, 0x1DA6, 0x8765, 0x8765, 0x1F6A,
+ 0x8766, 0x8767, 0x1DA8, 0x8768, 0x8768, 0x1F6C, 0x8769, 0x876A, 0x1DAB,
+ 0x876B, 0x876B, 0x1F6B, 0x876C, 0x876D, 0x1DAE, 0x876E, 0x876E, 0x1F6F,
+ 0x876F, 0x8775, 0x1DB1, 0x877E, 0x877E, 0x2083, 0x8780, 0x8783, 0x1DB8,
+ 0x8784, 0x8784, 0x1F77, 0x8785, 0x878F, 0x1DBD, 0x8790, 0x8790, 0x02FA,
+ 0x8791, 0x8791, 0x02F9, 0x8792, 0x8792, 0x0301, 0x8793, 0x8799, 0x1DC8,
+ 0x879A, 0x879A, 0x0300, 0x879B, 0x879C, 0x1DCF, 0x889F, 0x88FC, 0x0465,
+ 0x8940, 0x897E, 0x04C3, 0x8980, 0x89FC, 0x0502, 0x8A40, 0x8A7E, 0x057F,
+ 0x8A80, 0x8AFC, 0x05BE, 0x8B40, 0x8B7E, 0x063B, 0x8B80, 0x8BFC, 0x067A,
+ 0x8C40, 0x8C7E, 0x06F7, 0x8C80, 0x8CFC, 0x0736, 0x8D40, 0x8D7E, 0x07B3,
+ 0x8D80, 0x8DFC, 0x07F2, 0x8E40, 0x8E7E, 0x086F, 0x8E80, 0x8EFC, 0x08AE,
+ 0x8F40, 0x8F7E, 0x092B, 0x8F80, 0x8FFC, 0x096A, 0x9040, 0x907E, 0x09E7,
+ 0x9080, 0x90FC, 0x0A26, 0x9140, 0x917E, 0x0AA3, 0x9180, 0x91FC, 0x0AE2,
+ 0x9240, 0x927E, 0x0B5F, 0x9280, 0x92FC, 0x0B9E, 0x9340, 0x937E, 0x0C1B,
+ 0x9380, 0x93FC, 0x0C5A, 0x9440, 0x947E, 0x0CD7, 0x9480, 0x94FC, 0x0D16,
+ 0x9540, 0x957E, 0x0D93, 0x9580, 0x95FC, 0x0DD2, 0x9640, 0x967E, 0x0E4F,
+ 0x9680, 0x96FC, 0x0E8E, 0x9740, 0x977E, 0x0F0B, 0x9780, 0x97FC, 0x0F4A,
+ 0x9840, 0x9872, 0x0FC7, 0x989F, 0x98FC, 0x0FFA, 0x9940, 0x997E, 0x1058,
+ 0x9980, 0x99FC, 0x1097, 0x9A40, 0x9A7E, 0x1114, 0x9A80, 0x9AFC, 0x1153,
+ 0x9B40, 0x9B7E, 0x11D0, 0x9B80, 0x9BFC, 0x120F, 0x9C40, 0x9C7E, 0x128C,
+ 0x9C80, 0x9CFC, 0x12CB, 0x9D40, 0x9D7E, 0x1348, 0x9D80, 0x9DFC, 0x1387,
+ 0x9E40, 0x9E7E, 0x1404, 0x9E80, 0x9EFC, 0x1443, 0x9F40, 0x9F7E, 0x14C0,
+ 0x9F80, 0x9FFC, 0x14FF, 0xE040, 0xE07E, 0x157C, 0xE080, 0xE0FC, 0x15BB,
+ 0xE140, 0xE17E, 0x1638, 0xE180, 0xE1FC, 0x1677, 0xE240, 0xE27E, 0x16F4,
+ 0xE280, 0xE2FC, 0x1733, 0xE340, 0xE37E, 0x17B0, 0xE380, 0xE3FC, 0x17EF,
+ 0xE440, 0xE47E, 0x186C, 0xE480, 0xE4FC, 0x18AB, 0xE540, 0xE57E, 0x1928,
+ 0xE580, 0xE5FC, 0x1967, 0xE640, 0xE67E, 0x19E4, 0xE680, 0xE6FC, 0x1A23,
+ 0xE740, 0xE77E, 0x1AA0, 0xE780, 0xE7FC, 0x1ADF, 0xE840, 0xE87E, 0x1B5C,
+ 0xE880, 0xE8FC, 0x1B9B, 0xE940, 0xE97E, 0x1C18, 0xE980, 0xE9FC, 0x1C57,
+ 0xEA40, 0xEA7E, 0x1CD4, 0xEA80, 0xEAA2, 0x1D13, 0xEAA3, 0xEAA4, 0x205C,
+ 0xED40, 0xED7E, 0x20A7, 0xED80, 0xEDB3, 0x20E6, 0xEDB4, 0xEDB4, 0x07C9,
+ 0xEDB5, 0xEDFC, 0x211A, 0xEE40, 0xEE7E, 0x2162, 0xEE80, 0xEEEC, 0x21A1,
+ 0xEEEF, 0xEEF8, 0x1F9C, 0xEEF9, 0xEEF9, 0x02EF, 0xEEFA, 0xEEFC, 0x1F45,
+ 0xFA40, 0xFA49, 0x1F9C, 0xFA4A, 0xFA53, 0x1D97, 0xFA54, 0xFA54, 0x02EF,
+ 0xFA55, 0xFA57, 0x1F45, 0xFA58, 0xFA58, 0x1DC2, 0xFA59, 0xFA59, 0x1DBA,
+ 0xFA5A, 0xFA5A, 0x1F77, 0xFA5B, 0xFA5B, 0x0300, 0xFA5C, 0xFA7E, 0x20A7,
+ 0xFA80, 0xFACF, 0x20CA, 0xFAD0, 0xFAD0, 0x07C9, 0xFAD1, 0xFAFC, 0x211A,
+ 0xFB40, 0xFB7E, 0x2146, 0xFB80, 0xFBFC, 0x2185, 0xFC40, 0xFC4B, 0x2202,
+};
diff --git a/core/src/fpdfapi/fpdf_cmaps/Japan1/90msp-RKSJ-H_2.cpp b/core/src/fpdfapi/fpdf_cmaps/Japan1/90msp-RKSJ-H_2.cpp
index d0d8c2d0f3..36ecb17a5e 100644
--- a/core/src/fpdfapi/fpdf_cmaps/Japan1/90msp-RKSJ-H_2.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/Japan1/90msp-RKSJ-H_2.cpp
@@ -1,65 +1,65 @@
-// 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
-
-extern const unsigned short g_FXCMAP_90msp_RKSJ_H_2[170 * 3] = {
- 0x0020, 0x007E, 0x0001, 0x00A0, 0x00DF, 0x0146, 0x8140, 0x817E, 0x0279,
- 0x8180, 0x81AC, 0x02B8, 0x81B8, 0x81BF, 0x02E5, 0x81C8, 0x81CE, 0x02ED,
- 0x81DA, 0x81E8, 0x02F4, 0x81F0, 0x81F7, 0x0303, 0x81FC, 0x81FC, 0x030B,
- 0x824F, 0x8258, 0x030C, 0x8260, 0x8279, 0x0316, 0x8281, 0x829A, 0x0330,
- 0x829F, 0x82F1, 0x034A, 0x8340, 0x837E, 0x039D, 0x8380, 0x8396, 0x03DC,
- 0x839F, 0x83B6, 0x03F3, 0x83BF, 0x83D6, 0x040B, 0x8440, 0x8460, 0x0423,
- 0x8470, 0x847E, 0x0444, 0x8480, 0x8491, 0x0453, 0x849F, 0x849F, 0x1D37,
- 0x84A0, 0x84A0, 0x1D39, 0x84A1, 0x84A1, 0x1D43, 0x84A2, 0x84A2, 0x1D47,
- 0x84A3, 0x84A3, 0x1D4F, 0x84A4, 0x84A4, 0x1D4B, 0x84A5, 0x84A5, 0x1D53,
- 0x84A6, 0x84A6, 0x1D63, 0x84A7, 0x84A7, 0x1D5B, 0x84A8, 0x84A8, 0x1D6B,
- 0x84A9, 0x84A9, 0x1D73, 0x84AA, 0x84AA, 0x1D38, 0x84AB, 0x84AB, 0x1D3A,
- 0x84AC, 0x84AC, 0x1D46, 0x84AD, 0x84AD, 0x1D4A, 0x84AE, 0x84AE, 0x1D52,
- 0x84AF, 0x84AF, 0x1D4E, 0x84B0, 0x84B0, 0x1D5A, 0x84B1, 0x84B1, 0x1D6A,
- 0x84B2, 0x84B2, 0x1D62, 0x84B3, 0x84B3, 0x1D72, 0x84B4, 0x84B4, 0x1D82,
- 0x84B5, 0x84B5, 0x1D57, 0x84B6, 0x84B6, 0x1D66, 0x84B7, 0x84B7, 0x1D5F,
- 0x84B8, 0x84B8, 0x1D6E, 0x84B9, 0x84B9, 0x1D76, 0x84BA, 0x84BA, 0x1D54,
- 0x84BB, 0x84BB, 0x1D67, 0x84BC, 0x84BC, 0x1D5C, 0x84BD, 0x84BD, 0x1D6F,
- 0x84BE, 0x84BE, 0x1D79, 0x8740, 0x875D, 0x1D83, 0x875F, 0x8760, 0x1DA1,
- 0x8761, 0x8761, 0x1F66, 0x8762, 0x8762, 0x1DA4, 0x8763, 0x8763, 0x1F68,
- 0x8764, 0x8764, 0x1DA6, 0x8765, 0x8765, 0x1F6A, 0x8766, 0x8767, 0x1DA8,
- 0x8768, 0x8768, 0x1F6C, 0x8769, 0x876A, 0x1DAB, 0x876B, 0x876B, 0x1F6B,
- 0x876C, 0x876D, 0x1DAE, 0x876E, 0x876E, 0x1F6F, 0x876F, 0x8775, 0x1DB1,
- 0x877E, 0x877E, 0x2083, 0x8780, 0x8783, 0x1DB8, 0x8784, 0x8784, 0x1F77,
- 0x8785, 0x878F, 0x1DBD, 0x8790, 0x8790, 0x02FA, 0x8791, 0x8791, 0x02F9,
- 0x8792, 0x8792, 0x0301, 0x8793, 0x8799, 0x1DC8, 0x879A, 0x879A, 0x0300,
- 0x879B, 0x879C, 0x1DCF, 0x889F, 0x88FC, 0x0465, 0x8940, 0x897E, 0x04C3,
- 0x8980, 0x89FC, 0x0502, 0x8A40, 0x8A7E, 0x057F, 0x8A80, 0x8AFC, 0x05BE,
- 0x8B40, 0x8B7E, 0x063B, 0x8B80, 0x8BFC, 0x067A, 0x8C40, 0x8C7E, 0x06F7,
- 0x8C80, 0x8CFC, 0x0736, 0x8D40, 0x8D7E, 0x07B3, 0x8D80, 0x8DFC, 0x07F2,
- 0x8E40, 0x8E7E, 0x086F, 0x8E80, 0x8EFC, 0x08AE, 0x8F40, 0x8F7E, 0x092B,
- 0x8F80, 0x8FFC, 0x096A, 0x9040, 0x907E, 0x09E7, 0x9080, 0x90FC, 0x0A26,
- 0x9140, 0x917E, 0x0AA3, 0x9180, 0x91FC, 0x0AE2, 0x9240, 0x927E, 0x0B5F,
- 0x9280, 0x92FC, 0x0B9E, 0x9340, 0x937E, 0x0C1B, 0x9380, 0x93FC, 0x0C5A,
- 0x9440, 0x947E, 0x0CD7, 0x9480, 0x94FC, 0x0D16, 0x9540, 0x957E, 0x0D93,
- 0x9580, 0x95FC, 0x0DD2, 0x9640, 0x967E, 0x0E4F, 0x9680, 0x96FC, 0x0E8E,
- 0x9740, 0x977E, 0x0F0B, 0x9780, 0x97FC, 0x0F4A, 0x9840, 0x9872, 0x0FC7,
- 0x989F, 0x98FC, 0x0FFA, 0x9940, 0x997E, 0x1058, 0x9980, 0x99FC, 0x1097,
- 0x9A40, 0x9A7E, 0x1114, 0x9A80, 0x9AFC, 0x1153, 0x9B40, 0x9B7E, 0x11D0,
- 0x9B80, 0x9BFC, 0x120F, 0x9C40, 0x9C7E, 0x128C, 0x9C80, 0x9CFC, 0x12CB,
- 0x9D40, 0x9D7E, 0x1348, 0x9D80, 0x9DFC, 0x1387, 0x9E40, 0x9E7E, 0x1404,
- 0x9E80, 0x9EFC, 0x1443, 0x9F40, 0x9F7E, 0x14C0, 0x9F80, 0x9FFC, 0x14FF,
- 0xE040, 0xE07E, 0x157C, 0xE080, 0xE0FC, 0x15BB, 0xE140, 0xE17E, 0x1638,
- 0xE180, 0xE1FC, 0x1677, 0xE240, 0xE27E, 0x16F4, 0xE280, 0xE2FC, 0x1733,
- 0xE340, 0xE37E, 0x17B0, 0xE380, 0xE3FC, 0x17EF, 0xE440, 0xE47E, 0x186C,
- 0xE480, 0xE4FC, 0x18AB, 0xE540, 0xE57E, 0x1928, 0xE580, 0xE5FC, 0x1967,
- 0xE640, 0xE67E, 0x19E4, 0xE680, 0xE6FC, 0x1A23, 0xE740, 0xE77E, 0x1AA0,
- 0xE780, 0xE7FC, 0x1ADF, 0xE840, 0xE87E, 0x1B5C, 0xE880, 0xE8FC, 0x1B9B,
- 0xE940, 0xE97E, 0x1C18, 0xE980, 0xE9FC, 0x1C57, 0xEA40, 0xEA7E, 0x1CD4,
- 0xEA80, 0xEAA2, 0x1D13, 0xEAA3, 0xEAA4, 0x205C, 0xED40, 0xED7E, 0x20A7,
- 0xED80, 0xEDB3, 0x20E6, 0xEDB4, 0xEDB4, 0x07C9, 0xEDB5, 0xEDFC, 0x211A,
- 0xEE40, 0xEE7E, 0x2162, 0xEE80, 0xEEEC, 0x21A1, 0xEEEF, 0xEEF8, 0x1F9C,
- 0xEEF9, 0xEEF9, 0x02EF, 0xEEFA, 0xEEFC, 0x1F45, 0xFA40, 0xFA49, 0x1F9C,
- 0xFA4A, 0xFA53, 0x1D97, 0xFA54, 0xFA54, 0x02EF, 0xFA55, 0xFA57, 0x1F45,
- 0xFA58, 0xFA58, 0x1DC2, 0xFA59, 0xFA59, 0x1DBA, 0xFA5A, 0xFA5A, 0x1F77,
- 0xFA5B, 0xFA5B, 0x0300, 0xFA5C, 0xFA7E, 0x20A7, 0xFA80, 0xFACF, 0x20CA,
- 0xFAD0, 0xFAD0, 0x07C9, 0xFAD1, 0xFAFC, 0x211A, 0xFB40, 0xFB7E, 0x2146,
- 0xFB80, 0xFBFC, 0x2185, 0xFC40, 0xFC4B, 0x2202,
-};
+// 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
+
+extern const unsigned short g_FXCMAP_90msp_RKSJ_H_2[170 * 3] = {
+ 0x0020, 0x007E, 0x0001, 0x00A0, 0x00DF, 0x0146, 0x8140, 0x817E, 0x0279,
+ 0x8180, 0x81AC, 0x02B8, 0x81B8, 0x81BF, 0x02E5, 0x81C8, 0x81CE, 0x02ED,
+ 0x81DA, 0x81E8, 0x02F4, 0x81F0, 0x81F7, 0x0303, 0x81FC, 0x81FC, 0x030B,
+ 0x824F, 0x8258, 0x030C, 0x8260, 0x8279, 0x0316, 0x8281, 0x829A, 0x0330,
+ 0x829F, 0x82F1, 0x034A, 0x8340, 0x837E, 0x039D, 0x8380, 0x8396, 0x03DC,
+ 0x839F, 0x83B6, 0x03F3, 0x83BF, 0x83D6, 0x040B, 0x8440, 0x8460, 0x0423,
+ 0x8470, 0x847E, 0x0444, 0x8480, 0x8491, 0x0453, 0x849F, 0x849F, 0x1D37,
+ 0x84A0, 0x84A0, 0x1D39, 0x84A1, 0x84A1, 0x1D43, 0x84A2, 0x84A2, 0x1D47,
+ 0x84A3, 0x84A3, 0x1D4F, 0x84A4, 0x84A4, 0x1D4B, 0x84A5, 0x84A5, 0x1D53,
+ 0x84A6, 0x84A6, 0x1D63, 0x84A7, 0x84A7, 0x1D5B, 0x84A8, 0x84A8, 0x1D6B,
+ 0x84A9, 0x84A9, 0x1D73, 0x84AA, 0x84AA, 0x1D38, 0x84AB, 0x84AB, 0x1D3A,
+ 0x84AC, 0x84AC, 0x1D46, 0x84AD, 0x84AD, 0x1D4A, 0x84AE, 0x84AE, 0x1D52,
+ 0x84AF, 0x84AF, 0x1D4E, 0x84B0, 0x84B0, 0x1D5A, 0x84B1, 0x84B1, 0x1D6A,
+ 0x84B2, 0x84B2, 0x1D62, 0x84B3, 0x84B3, 0x1D72, 0x84B4, 0x84B4, 0x1D82,
+ 0x84B5, 0x84B5, 0x1D57, 0x84B6, 0x84B6, 0x1D66, 0x84B7, 0x84B7, 0x1D5F,
+ 0x84B8, 0x84B8, 0x1D6E, 0x84B9, 0x84B9, 0x1D76, 0x84BA, 0x84BA, 0x1D54,
+ 0x84BB, 0x84BB, 0x1D67, 0x84BC, 0x84BC, 0x1D5C, 0x84BD, 0x84BD, 0x1D6F,
+ 0x84BE, 0x84BE, 0x1D79, 0x8740, 0x875D, 0x1D83, 0x875F, 0x8760, 0x1DA1,
+ 0x8761, 0x8761, 0x1F66, 0x8762, 0x8762, 0x1DA4, 0x8763, 0x8763, 0x1F68,
+ 0x8764, 0x8764, 0x1DA6, 0x8765, 0x8765, 0x1F6A, 0x8766, 0x8767, 0x1DA8,
+ 0x8768, 0x8768, 0x1F6C, 0x8769, 0x876A, 0x1DAB, 0x876B, 0x876B, 0x1F6B,
+ 0x876C, 0x876D, 0x1DAE, 0x876E, 0x876E, 0x1F6F, 0x876F, 0x8775, 0x1DB1,
+ 0x877E, 0x877E, 0x2083, 0x8780, 0x8783, 0x1DB8, 0x8784, 0x8784, 0x1F77,
+ 0x8785, 0x878F, 0x1DBD, 0x8790, 0x8790, 0x02FA, 0x8791, 0x8791, 0x02F9,
+ 0x8792, 0x8792, 0x0301, 0x8793, 0x8799, 0x1DC8, 0x879A, 0x879A, 0x0300,
+ 0x879B, 0x879C, 0x1DCF, 0x889F, 0x88FC, 0x0465, 0x8940, 0x897E, 0x04C3,
+ 0x8980, 0x89FC, 0x0502, 0x8A40, 0x8A7E, 0x057F, 0x8A80, 0x8AFC, 0x05BE,
+ 0x8B40, 0x8B7E, 0x063B, 0x8B80, 0x8BFC, 0x067A, 0x8C40, 0x8C7E, 0x06F7,
+ 0x8C80, 0x8CFC, 0x0736, 0x8D40, 0x8D7E, 0x07B3, 0x8D80, 0x8DFC, 0x07F2,
+ 0x8E40, 0x8E7E, 0x086F, 0x8E80, 0x8EFC, 0x08AE, 0x8F40, 0x8F7E, 0x092B,
+ 0x8F80, 0x8FFC, 0x096A, 0x9040, 0x907E, 0x09E7, 0x9080, 0x90FC, 0x0A26,
+ 0x9140, 0x917E, 0x0AA3, 0x9180, 0x91FC, 0x0AE2, 0x9240, 0x927E, 0x0B5F,
+ 0x9280, 0x92FC, 0x0B9E, 0x9340, 0x937E, 0x0C1B, 0x9380, 0x93FC, 0x0C5A,
+ 0x9440, 0x947E, 0x0CD7, 0x9480, 0x94FC, 0x0D16, 0x9540, 0x957E, 0x0D93,
+ 0x9580, 0x95FC, 0x0DD2, 0x9640, 0x967E, 0x0E4F, 0x9680, 0x96FC, 0x0E8E,
+ 0x9740, 0x977E, 0x0F0B, 0x9780, 0x97FC, 0x0F4A, 0x9840, 0x9872, 0x0FC7,
+ 0x989F, 0x98FC, 0x0FFA, 0x9940, 0x997E, 0x1058, 0x9980, 0x99FC, 0x1097,
+ 0x9A40, 0x9A7E, 0x1114, 0x9A80, 0x9AFC, 0x1153, 0x9B40, 0x9B7E, 0x11D0,
+ 0x9B80, 0x9BFC, 0x120F, 0x9C40, 0x9C7E, 0x128C, 0x9C80, 0x9CFC, 0x12CB,
+ 0x9D40, 0x9D7E, 0x1348, 0x9D80, 0x9DFC, 0x1387, 0x9E40, 0x9E7E, 0x1404,
+ 0x9E80, 0x9EFC, 0x1443, 0x9F40, 0x9F7E, 0x14C0, 0x9F80, 0x9FFC, 0x14FF,
+ 0xE040, 0xE07E, 0x157C, 0xE080, 0xE0FC, 0x15BB, 0xE140, 0xE17E, 0x1638,
+ 0xE180, 0xE1FC, 0x1677, 0xE240, 0xE27E, 0x16F4, 0xE280, 0xE2FC, 0x1733,
+ 0xE340, 0xE37E, 0x17B0, 0xE380, 0xE3FC, 0x17EF, 0xE440, 0xE47E, 0x186C,
+ 0xE480, 0xE4FC, 0x18AB, 0xE540, 0xE57E, 0x1928, 0xE580, 0xE5FC, 0x1967,
+ 0xE640, 0xE67E, 0x19E4, 0xE680, 0xE6FC, 0x1A23, 0xE740, 0xE77E, 0x1AA0,
+ 0xE780, 0xE7FC, 0x1ADF, 0xE840, 0xE87E, 0x1B5C, 0xE880, 0xE8FC, 0x1B9B,
+ 0xE940, 0xE97E, 0x1C18, 0xE980, 0xE9FC, 0x1C57, 0xEA40, 0xEA7E, 0x1CD4,
+ 0xEA80, 0xEAA2, 0x1D13, 0xEAA3, 0xEAA4, 0x205C, 0xED40, 0xED7E, 0x20A7,
+ 0xED80, 0xEDB3, 0x20E6, 0xEDB4, 0xEDB4, 0x07C9, 0xEDB5, 0xEDFC, 0x211A,
+ 0xEE40, 0xEE7E, 0x2162, 0xEE80, 0xEEEC, 0x21A1, 0xEEEF, 0xEEF8, 0x1F9C,
+ 0xEEF9, 0xEEF9, 0x02EF, 0xEEFA, 0xEEFC, 0x1F45, 0xFA40, 0xFA49, 0x1F9C,
+ 0xFA4A, 0xFA53, 0x1D97, 0xFA54, 0xFA54, 0x02EF, 0xFA55, 0xFA57, 0x1F45,
+ 0xFA58, 0xFA58, 0x1DC2, 0xFA59, 0xFA59, 0x1DBA, 0xFA5A, 0xFA5A, 0x1F77,
+ 0xFA5B, 0xFA5B, 0x0300, 0xFA5C, 0xFA7E, 0x20A7, 0xFA80, 0xFACF, 0x20CA,
+ 0xFAD0, 0xFAD0, 0x07C9, 0xFAD1, 0xFAFC, 0x211A, 0xFB40, 0xFB7E, 0x2146,
+ 0xFB80, 0xFBFC, 0x2185, 0xFC40, 0xFC4B, 0x2202,
+};
diff --git a/core/src/fpdfapi/fpdf_cmaps/Japan1/90pv-RKSJ-H_1.cpp b/core/src/fpdfapi/fpdf_cmaps/Japan1/90pv-RKSJ-H_1.cpp
index 504d4dc3c7..19526bba3b 100644
--- a/core/src/fpdfapi/fpdf_cmaps/Japan1/90pv-RKSJ-H_1.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/Japan1/90pv-RKSJ-H_1.cpp
@@ -1,96 +1,96 @@
-// 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
-
-extern const unsigned short g_FXCMAP_90pv_RKSJ_H_1[263 * 3] = {
- 0x0020, 0x007E, 0x0001, 0x0080, 0x0080, 0x0061, 0x00A0, 0x00DF, 0x0146,
- 0x00FD, 0x00FD, 0x0098, 0x00FE, 0x00FE, 0x00E4, 0x00FF, 0x00FF, 0x007C,
- 0x8140, 0x817E, 0x0279, 0x8180, 0x81AC, 0x02B8, 0x81B8, 0x81BF, 0x02E5,
- 0x81C8, 0x81CE, 0x02ED, 0x81DA, 0x81E8, 0x02F4, 0x81F0, 0x81F7, 0x0303,
- 0x81FC, 0x81FC, 0x030B, 0x824F, 0x8258, 0x030C, 0x8260, 0x8279, 0x0316,
- 0x8281, 0x829A, 0x0330, 0x829F, 0x82F1, 0x034A, 0x8340, 0x837E, 0x039D,
- 0x8380, 0x8396, 0x03DC, 0x839F, 0x83B6, 0x03F3, 0x83BF, 0x83D6, 0x040B,
- 0x8440, 0x8460, 0x0423, 0x8470, 0x847E, 0x0444, 0x8480, 0x8491, 0x0453,
- 0x849F, 0x849F, 0x1D37, 0x84A0, 0x84A0, 0x1D39, 0x84A1, 0x84A1, 0x1D43,
- 0x84A2, 0x84A2, 0x1D47, 0x84A3, 0x84A3, 0x1D4F, 0x84A4, 0x84A4, 0x1D4B,
- 0x84A5, 0x84A5, 0x1D53, 0x84A6, 0x84A6, 0x1D63, 0x84A7, 0x84A7, 0x1D5B,
- 0x84A8, 0x84A8, 0x1D6B, 0x84A9, 0x84A9, 0x1D73, 0x84AA, 0x84AA, 0x1D38,
- 0x84AB, 0x84AB, 0x1D3A, 0x84AC, 0x84AC, 0x1D46, 0x84AD, 0x84AD, 0x1D4A,
- 0x84AE, 0x84AE, 0x1D52, 0x84AF, 0x84AF, 0x1D4E, 0x84B0, 0x84B0, 0x1D5A,
- 0x84B1, 0x84B1, 0x1D6A, 0x84B2, 0x84B2, 0x1D62, 0x84B3, 0x84B3, 0x1D72,
- 0x84B4, 0x84B4, 0x1D82, 0x84B5, 0x84B5, 0x1D57, 0x84B6, 0x84B6, 0x1D66,
- 0x84B7, 0x84B7, 0x1D5F, 0x84B8, 0x84B8, 0x1D6E, 0x84B9, 0x84B9, 0x1D76,
- 0x84BA, 0x84BA, 0x1D54, 0x84BB, 0x84BB, 0x1D67, 0x84BC, 0x84BC, 0x1D5C,
- 0x84BD, 0x84BD, 0x1D6F, 0x84BE, 0x84BE, 0x1D79, 0x8540, 0x8553, 0x1D83,
- 0x855E, 0x8571, 0x1F87, 0x857C, 0x857E, 0x205E, 0x8580, 0x8585, 0x2061,
- 0x8591, 0x859A, 0x1F7D, 0x859F, 0x85A8, 0x1D97, 0x85A9, 0x85AA, 0x2021,
- 0x85AB, 0x85AD, 0x2067, 0x85B3, 0x85BC, 0x1F9C, 0x85BD, 0x85C1, 0x206A,
- 0x85DB, 0x85F4, 0x1FB0, 0x8640, 0x8640, 0x1DB1, 0x8641, 0x8641, 0x1FFA,
- 0x8642, 0x8642, 0x1DB2, 0x8643, 0x8643, 0x1F54, 0x8644, 0x8644, 0x1F56,
- 0x8645, 0x8645, 0x206F, 0x8646, 0x8646, 0x1DB7, 0x8647, 0x8647, 0x1F57,
- 0x8648, 0x8648, 0x1DB3, 0x8649, 0x8649, 0x1F55, 0x864A, 0x864A, 0x1DB4,
- 0x864B, 0x864B, 0x2070, 0x864C, 0x864D, 0x1DB5, 0x864E, 0x864E, 0x1F65,
- 0x864F, 0x8655, 0x1F58, 0x8656, 0x8656, 0x2071, 0x8657, 0x8657, 0x1F64,
- 0x8658, 0x8659, 0x1F62, 0x865A, 0x865C, 0x1F5F, 0x865D, 0x865D, 0x2072,
- 0x869B, 0x869D, 0x1DBA, 0x869E, 0x869E, 0x2073, 0x869F, 0x869F, 0x1F52,
- 0x86A0, 0x86A1, 0x1F50, 0x86A2, 0x86A2, 0x1F53, 0x86A3, 0x86A3, 0x2013,
- 0x86A4, 0x86A4, 0x2015, 0x86A5, 0x86A5, 0x2014, 0x86A6, 0x86A6, 0x2016,
- 0x86B3, 0x86B3, 0x1F7A, 0x86B4, 0x86B4, 0x1F78, 0x86B5, 0x86B5, 0x2074,
- 0x86C7, 0x86CA, 0x201B, 0x86CB, 0x86CE, 0x2075, 0x86CF, 0x86CF, 0x1F4E,
- 0x86D0, 0x86D0, 0x1F4D, 0x86D1, 0x86D1, 0x1F4C, 0x86D2, 0x86D2, 0x1F4B,
- 0x86D3, 0x86D6, 0x200E, 0x8740, 0x8746, 0x2005, 0x8747, 0x8747, 0x1FD6,
- 0x8748, 0x8748, 0x200C, 0x8749, 0x8749, 0x1FD1, 0x874A, 0x874A, 0x1FCA,
- 0x874B, 0x874B, 0x1DC4, 0x874C, 0x874C, 0x1FD7, 0x874D, 0x874D, 0x1DC2,
- 0x874E, 0x874E, 0x1FD2, 0x874F, 0x874F, 0x1FCD, 0x8750, 0x8750, 0x1DC3,
- 0x8751, 0x8751, 0x1FD5, 0x8752, 0x8752, 0x1FD3, 0x8753, 0x8753, 0x1FCF,
- 0x8754, 0x8754, 0x1FD4, 0x8755, 0x8755, 0x1FD0, 0x8756, 0x8757, 0x1FCB,
- 0x8758, 0x8758, 0x1FCE, 0x8791, 0x8792, 0x207D, 0x8793, 0x8797, 0x1DBD,
- 0x8798, 0x8798, 0x1FDA, 0x8799, 0x8799, 0x1FE5, 0x879A, 0x879A, 0x207F,
- 0x879B, 0x879B, 0x1FDE, 0x879C, 0x879C, 0x1FFF, 0x879D, 0x879D, 0x2080,
- 0x879E, 0x879E, 0x201F, 0x879F, 0x879F, 0x1DA1, 0x87A0, 0x87A0, 0x1F66,
- 0x87A1, 0x87A1, 0x1DA4, 0x87A2, 0x87A2, 0x1DA2, 0x87A3, 0x87A3, 0x1F67,
- 0x87A4, 0x87A4, 0x1FF7, 0x87A5, 0x87A6, 0x2087, 0x87A7, 0x87A7, 0x1F6A,
- 0x87A8, 0x87A8, 0x1DA8, 0x87A9, 0x87AA, 0x1F68, 0x87AB, 0x87AB, 0x1DA6,
- 0x87AC, 0x87AC, 0x1DA9, 0x87AD, 0x87AD, 0x1DAF, 0x87AE, 0x87AE, 0x1F6E,
- 0x87AF, 0x87AF, 0x1F6C, 0x87B0, 0x87B0, 0x1DAB, 0x87B1, 0x87B1, 0x1F6D,
- 0x87B2, 0x87B2, 0x1F6B, 0x87B3, 0x87B3, 0x1DAC, 0x87B4, 0x87B4, 0x1F6F,
- 0x87B5, 0x87B5, 0x1DAE, 0x87BD, 0x87BD, 0x1F70, 0x87BE, 0x87BF, 0x1F73,
- 0x87C0, 0x87C1, 0x1F71, 0x87E5, 0x87E7, 0x1DC5, 0x87E8, 0x87E8, 0x2083,
- 0x87FA, 0x87FA, 0x1F76, 0x87FB, 0x87FC, 0x2081, 0x8840, 0x8840, 0x1DC8,
- 0x8841, 0x8842, 0x1DCD, 0x8854, 0x8855, 0x1DB8, 0x8868, 0x8868, 0x1F16,
- 0x886A, 0x886D, 0x2079, 0x889F, 0x88FC, 0x0465, 0x8940, 0x897E, 0x04C3,
- 0x8980, 0x89FC, 0x0502, 0x8A40, 0x8A7E, 0x057F, 0x8A80, 0x8AFC, 0x05BE,
- 0x8B40, 0x8B7E, 0x063B, 0x8B80, 0x8BFC, 0x067A, 0x8C40, 0x8C7E, 0x06F7,
- 0x8C80, 0x8CFC, 0x0736, 0x8D40, 0x8D7E, 0x07B3, 0x8D80, 0x8DFC, 0x07F2,
- 0x8E40, 0x8E7E, 0x086F, 0x8E80, 0x8EFC, 0x08AE, 0x8F40, 0x8F7E, 0x092B,
- 0x8F80, 0x8FFC, 0x096A, 0x9040, 0x907E, 0x09E7, 0x9080, 0x90FC, 0x0A26,
- 0x9140, 0x917E, 0x0AA3, 0x9180, 0x91FC, 0x0AE2, 0x9240, 0x927E, 0x0B5F,
- 0x9280, 0x92FC, 0x0B9E, 0x9340, 0x937E, 0x0C1B, 0x9380, 0x93FC, 0x0C5A,
- 0x9440, 0x947E, 0x0CD7, 0x9480, 0x94FC, 0x0D16, 0x9540, 0x957E, 0x0D93,
- 0x9580, 0x95FC, 0x0DD2, 0x9640, 0x967E, 0x0E4F, 0x9680, 0x96FC, 0x0E8E,
- 0x9740, 0x977E, 0x0F0B, 0x9780, 0x97FC, 0x0F4A, 0x9840, 0x9872, 0x0FC7,
- 0x989F, 0x98FC, 0x0FFA, 0x9940, 0x997E, 0x1058, 0x9980, 0x99FC, 0x1097,
- 0x9A40, 0x9A7E, 0x1114, 0x9A80, 0x9AFC, 0x1153, 0x9B40, 0x9B7E, 0x11D0,
- 0x9B80, 0x9BFC, 0x120F, 0x9C40, 0x9C7E, 0x128C, 0x9C80, 0x9CFC, 0x12CB,
- 0x9D40, 0x9D7E, 0x1348, 0x9D80, 0x9DFC, 0x1387, 0x9E40, 0x9E7E, 0x1404,
- 0x9E80, 0x9EFC, 0x1443, 0x9F40, 0x9F7E, 0x14C0, 0x9F80, 0x9FFC, 0x14FF,
- 0xE040, 0xE07E, 0x157C, 0xE080, 0xE0FC, 0x15BB, 0xE140, 0xE17E, 0x1638,
- 0xE180, 0xE1FC, 0x1677, 0xE240, 0xE27E, 0x16F4, 0xE280, 0xE2FC, 0x1733,
- 0xE340, 0xE37E, 0x17B0, 0xE380, 0xE3FC, 0x17EF, 0xE440, 0xE47E, 0x186C,
- 0xE480, 0xE4FC, 0x18AB, 0xE540, 0xE57E, 0x1928, 0xE580, 0xE5FC, 0x1967,
- 0xE640, 0xE67E, 0x19E4, 0xE680, 0xE6FC, 0x1A23, 0xE740, 0xE77E, 0x1AA0,
- 0xE780, 0xE7FC, 0x1ADF, 0xE840, 0xE87E, 0x1B5C, 0xE880, 0xE8FC, 0x1B9B,
- 0xE940, 0xE97E, 0x1C18, 0xE980, 0xE9FC, 0x1C57, 0xEA40, 0xEA7E, 0x1CD4,
- 0xEA80, 0xEAA2, 0x1D13, 0xEAA3, 0xEAA4, 0x205C, 0xEB41, 0xEB42, 0x1ECF,
- 0xEB50, 0xEB51, 0x1ED1, 0xEB5B, 0xEB5D, 0x1ED3, 0xEB60, 0xEB64, 0x1ED6,
- 0xEB69, 0xEB7A, 0x1EDB, 0xEB81, 0xEB81, 0x1EED, 0xEC9F, 0xEC9F, 0x1EEE,
- 0xECA1, 0xECA1, 0x1EEF, 0xECA3, 0xECA3, 0x1EF0, 0xECA5, 0xECA5, 0x1EF1,
- 0xECA7, 0xECA7, 0x1EF2, 0xECC1, 0xECC1, 0x1EF3, 0xECE1, 0xECE1, 0x1EF4,
- 0xECE3, 0xECE3, 0x1EF5, 0xECE5, 0xECE5, 0x1EF6, 0xECEC, 0xECEC, 0x1EF7,
- 0xED40, 0xED40, 0x1EF8, 0xED42, 0xED42, 0x1EF9, 0xED44, 0xED44, 0x1EFA,
- 0xED46, 0xED46, 0x1EFB, 0xED48, 0xED48, 0x1EFC, 0xED62, 0xED62, 0x1EFD,
- 0xED83, 0xED83, 0x1EFE, 0xED85, 0xED85, 0x1EFF, 0xED87, 0xED87, 0x1F00,
- 0xED8E, 0xED8E, 0x1F01, 0xED95, 0xED96, 0x1F02,
-};
+// 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
+
+extern const unsigned short g_FXCMAP_90pv_RKSJ_H_1[263 * 3] = {
+ 0x0020, 0x007E, 0x0001, 0x0080, 0x0080, 0x0061, 0x00A0, 0x00DF, 0x0146,
+ 0x00FD, 0x00FD, 0x0098, 0x00FE, 0x00FE, 0x00E4, 0x00FF, 0x00FF, 0x007C,
+ 0x8140, 0x817E, 0x0279, 0x8180, 0x81AC, 0x02B8, 0x81B8, 0x81BF, 0x02E5,
+ 0x81C8, 0x81CE, 0x02ED, 0x81DA, 0x81E8, 0x02F4, 0x81F0, 0x81F7, 0x0303,
+ 0x81FC, 0x81FC, 0x030B, 0x824F, 0x8258, 0x030C, 0x8260, 0x8279, 0x0316,
+ 0x8281, 0x829A, 0x0330, 0x829F, 0x82F1, 0x034A, 0x8340, 0x837E, 0x039D,
+ 0x8380, 0x8396, 0x03DC, 0x839F, 0x83B6, 0x03F3, 0x83BF, 0x83D6, 0x040B,
+ 0x8440, 0x8460, 0x0423, 0x8470, 0x847E, 0x0444, 0x8480, 0x8491, 0x0453,
+ 0x849F, 0x849F, 0x1D37, 0x84A0, 0x84A0, 0x1D39, 0x84A1, 0x84A1, 0x1D43,
+ 0x84A2, 0x84A2, 0x1D47, 0x84A3, 0x84A3, 0x1D4F, 0x84A4, 0x84A4, 0x1D4B,
+ 0x84A5, 0x84A5, 0x1D53, 0x84A6, 0x84A6, 0x1D63, 0x84A7, 0x84A7, 0x1D5B,
+ 0x84A8, 0x84A8, 0x1D6B, 0x84A9, 0x84A9, 0x1D73, 0x84AA, 0x84AA, 0x1D38,
+ 0x84AB, 0x84AB, 0x1D3A, 0x84AC, 0x84AC, 0x1D46, 0x84AD, 0x84AD, 0x1D4A,
+ 0x84AE, 0x84AE, 0x1D52, 0x84AF, 0x84AF, 0x1D4E, 0x84B0, 0x84B0, 0x1D5A,
+ 0x84B1, 0x84B1, 0x1D6A, 0x84B2, 0x84B2, 0x1D62, 0x84B3, 0x84B3, 0x1D72,
+ 0x84B4, 0x84B4, 0x1D82, 0x84B5, 0x84B5, 0x1D57, 0x84B6, 0x84B6, 0x1D66,
+ 0x84B7, 0x84B7, 0x1D5F, 0x84B8, 0x84B8, 0x1D6E, 0x84B9, 0x84B9, 0x1D76,
+ 0x84BA, 0x84BA, 0x1D54, 0x84BB, 0x84BB, 0x1D67, 0x84BC, 0x84BC, 0x1D5C,
+ 0x84BD, 0x84BD, 0x1D6F, 0x84BE, 0x84BE, 0x1D79, 0x8540, 0x8553, 0x1D83,
+ 0x855E, 0x8571, 0x1F87, 0x857C, 0x857E, 0x205E, 0x8580, 0x8585, 0x2061,
+ 0x8591, 0x859A, 0x1F7D, 0x859F, 0x85A8, 0x1D97, 0x85A9, 0x85AA, 0x2021,
+ 0x85AB, 0x85AD, 0x2067, 0x85B3, 0x85BC, 0x1F9C, 0x85BD, 0x85C1, 0x206A,
+ 0x85DB, 0x85F4, 0x1FB0, 0x8640, 0x8640, 0x1DB1, 0x8641, 0x8641, 0x1FFA,
+ 0x8642, 0x8642, 0x1DB2, 0x8643, 0x8643, 0x1F54, 0x8644, 0x8644, 0x1F56,
+ 0x8645, 0x8645, 0x206F, 0x8646, 0x8646, 0x1DB7, 0x8647, 0x8647, 0x1F57,
+ 0x8648, 0x8648, 0x1DB3, 0x8649, 0x8649, 0x1F55, 0x864A, 0x864A, 0x1DB4,
+ 0x864B, 0x864B, 0x2070, 0x864C, 0x864D, 0x1DB5, 0x864E, 0x864E, 0x1F65,
+ 0x864F, 0x8655, 0x1F58, 0x8656, 0x8656, 0x2071, 0x8657, 0x8657, 0x1F64,
+ 0x8658, 0x8659, 0x1F62, 0x865A, 0x865C, 0x1F5F, 0x865D, 0x865D, 0x2072,
+ 0x869B, 0x869D, 0x1DBA, 0x869E, 0x869E, 0x2073, 0x869F, 0x869F, 0x1F52,
+ 0x86A0, 0x86A1, 0x1F50, 0x86A2, 0x86A2, 0x1F53, 0x86A3, 0x86A3, 0x2013,
+ 0x86A4, 0x86A4, 0x2015, 0x86A5, 0x86A5, 0x2014, 0x86A6, 0x86A6, 0x2016,
+ 0x86B3, 0x86B3, 0x1F7A, 0x86B4, 0x86B4, 0x1F78, 0x86B5, 0x86B5, 0x2074,
+ 0x86C7, 0x86CA, 0x201B, 0x86CB, 0x86CE, 0x2075, 0x86CF, 0x86CF, 0x1F4E,
+ 0x86D0, 0x86D0, 0x1F4D, 0x86D1, 0x86D1, 0x1F4C, 0x86D2, 0x86D2, 0x1F4B,
+ 0x86D3, 0x86D6, 0x200E, 0x8740, 0x8746, 0x2005, 0x8747, 0x8747, 0x1FD6,
+ 0x8748, 0x8748, 0x200C, 0x8749, 0x8749, 0x1FD1, 0x874A, 0x874A, 0x1FCA,
+ 0x874B, 0x874B, 0x1DC4, 0x874C, 0x874C, 0x1FD7, 0x874D, 0x874D, 0x1DC2,
+ 0x874E, 0x874E, 0x1FD2, 0x874F, 0x874F, 0x1FCD, 0x8750, 0x8750, 0x1DC3,
+ 0x8751, 0x8751, 0x1FD5, 0x8752, 0x8752, 0x1FD3, 0x8753, 0x8753, 0x1FCF,
+ 0x8754, 0x8754, 0x1FD4, 0x8755, 0x8755, 0x1FD0, 0x8756, 0x8757, 0x1FCB,
+ 0x8758, 0x8758, 0x1FCE, 0x8791, 0x8792, 0x207D, 0x8793, 0x8797, 0x1DBD,
+ 0x8798, 0x8798, 0x1FDA, 0x8799, 0x8799, 0x1FE5, 0x879A, 0x879A, 0x207F,
+ 0x879B, 0x879B, 0x1FDE, 0x879C, 0x879C, 0x1FFF, 0x879D, 0x879D, 0x2080,
+ 0x879E, 0x879E, 0x201F, 0x879F, 0x879F, 0x1DA1, 0x87A0, 0x87A0, 0x1F66,
+ 0x87A1, 0x87A1, 0x1DA4, 0x87A2, 0x87A2, 0x1DA2, 0x87A3, 0x87A3, 0x1F67,
+ 0x87A4, 0x87A4, 0x1FF7, 0x87A5, 0x87A6, 0x2087, 0x87A7, 0x87A7, 0x1F6A,
+ 0x87A8, 0x87A8, 0x1DA8, 0x87A9, 0x87AA, 0x1F68, 0x87AB, 0x87AB, 0x1DA6,
+ 0x87AC, 0x87AC, 0x1DA9, 0x87AD, 0x87AD, 0x1DAF, 0x87AE, 0x87AE, 0x1F6E,
+ 0x87AF, 0x87AF, 0x1F6C, 0x87B0, 0x87B0, 0x1DAB, 0x87B1, 0x87B1, 0x1F6D,
+ 0x87B2, 0x87B2, 0x1F6B, 0x87B3, 0x87B3, 0x1DAC, 0x87B4, 0x87B4, 0x1F6F,
+ 0x87B5, 0x87B5, 0x1DAE, 0x87BD, 0x87BD, 0x1F70, 0x87BE, 0x87BF, 0x1F73,
+ 0x87C0, 0x87C1, 0x1F71, 0x87E5, 0x87E7, 0x1DC5, 0x87E8, 0x87E8, 0x2083,
+ 0x87FA, 0x87FA, 0x1F76, 0x87FB, 0x87FC, 0x2081, 0x8840, 0x8840, 0x1DC8,
+ 0x8841, 0x8842, 0x1DCD, 0x8854, 0x8855, 0x1DB8, 0x8868, 0x8868, 0x1F16,
+ 0x886A, 0x886D, 0x2079, 0x889F, 0x88FC, 0x0465, 0x8940, 0x897E, 0x04C3,
+ 0x8980, 0x89FC, 0x0502, 0x8A40, 0x8A7E, 0x057F, 0x8A80, 0x8AFC, 0x05BE,
+ 0x8B40, 0x8B7E, 0x063B, 0x8B80, 0x8BFC, 0x067A, 0x8C40, 0x8C7E, 0x06F7,
+ 0x8C80, 0x8CFC, 0x0736, 0x8D40, 0x8D7E, 0x07B3, 0x8D80, 0x8DFC, 0x07F2,
+ 0x8E40, 0x8E7E, 0x086F, 0x8E80, 0x8EFC, 0x08AE, 0x8F40, 0x8F7E, 0x092B,
+ 0x8F80, 0x8FFC, 0x096A, 0x9040, 0x907E, 0x09E7, 0x9080, 0x90FC, 0x0A26,
+ 0x9140, 0x917E, 0x0AA3, 0x9180, 0x91FC, 0x0AE2, 0x9240, 0x927E, 0x0B5F,
+ 0x9280, 0x92FC, 0x0B9E, 0x9340, 0x937E, 0x0C1B, 0x9380, 0x93FC, 0x0C5A,
+ 0x9440, 0x947E, 0x0CD7, 0x9480, 0x94FC, 0x0D16, 0x9540, 0x957E, 0x0D93,
+ 0x9580, 0x95FC, 0x0DD2, 0x9640, 0x967E, 0x0E4F, 0x9680, 0x96FC, 0x0E8E,
+ 0x9740, 0x977E, 0x0F0B, 0x9780, 0x97FC, 0x0F4A, 0x9840, 0x9872, 0x0FC7,
+ 0x989F, 0x98FC, 0x0FFA, 0x9940, 0x997E, 0x1058, 0x9980, 0x99FC, 0x1097,
+ 0x9A40, 0x9A7E, 0x1114, 0x9A80, 0x9AFC, 0x1153, 0x9B40, 0x9B7E, 0x11D0,
+ 0x9B80, 0x9BFC, 0x120F, 0x9C40, 0x9C7E, 0x128C, 0x9C80, 0x9CFC, 0x12CB,
+ 0x9D40, 0x9D7E, 0x1348, 0x9D80, 0x9DFC, 0x1387, 0x9E40, 0x9E7E, 0x1404,
+ 0x9E80, 0x9EFC, 0x1443, 0x9F40, 0x9F7E, 0x14C0, 0x9F80, 0x9FFC, 0x14FF,
+ 0xE040, 0xE07E, 0x157C, 0xE080, 0xE0FC, 0x15BB, 0xE140, 0xE17E, 0x1638,
+ 0xE180, 0xE1FC, 0x1677, 0xE240, 0xE27E, 0x16F4, 0xE280, 0xE2FC, 0x1733,
+ 0xE340, 0xE37E, 0x17B0, 0xE380, 0xE3FC, 0x17EF, 0xE440, 0xE47E, 0x186C,
+ 0xE480, 0xE4FC, 0x18AB, 0xE540, 0xE57E, 0x1928, 0xE580, 0xE5FC, 0x1967,
+ 0xE640, 0xE67E, 0x19E4, 0xE680, 0xE6FC, 0x1A23, 0xE740, 0xE77E, 0x1AA0,
+ 0xE780, 0xE7FC, 0x1ADF, 0xE840, 0xE87E, 0x1B5C, 0xE880, 0xE8FC, 0x1B9B,
+ 0xE940, 0xE97E, 0x1C18, 0xE980, 0xE9FC, 0x1C57, 0xEA40, 0xEA7E, 0x1CD4,
+ 0xEA80, 0xEAA2, 0x1D13, 0xEAA3, 0xEAA4, 0x205C, 0xEB41, 0xEB42, 0x1ECF,
+ 0xEB50, 0xEB51, 0x1ED1, 0xEB5B, 0xEB5D, 0x1ED3, 0xEB60, 0xEB64, 0x1ED6,
+ 0xEB69, 0xEB7A, 0x1EDB, 0xEB81, 0xEB81, 0x1EED, 0xEC9F, 0xEC9F, 0x1EEE,
+ 0xECA1, 0xECA1, 0x1EEF, 0xECA3, 0xECA3, 0x1EF0, 0xECA5, 0xECA5, 0x1EF1,
+ 0xECA7, 0xECA7, 0x1EF2, 0xECC1, 0xECC1, 0x1EF3, 0xECE1, 0xECE1, 0x1EF4,
+ 0xECE3, 0xECE3, 0x1EF5, 0xECE5, 0xECE5, 0x1EF6, 0xECEC, 0xECEC, 0x1EF7,
+ 0xED40, 0xED40, 0x1EF8, 0xED42, 0xED42, 0x1EF9, 0xED44, 0xED44, 0x1EFA,
+ 0xED46, 0xED46, 0x1EFB, 0xED48, 0xED48, 0x1EFC, 0xED62, 0xED62, 0x1EFD,
+ 0xED83, 0xED83, 0x1EFE, 0xED85, 0xED85, 0x1EFF, 0xED87, 0xED87, 0x1F00,
+ 0xED8E, 0xED8E, 0x1F01, 0xED95, 0xED96, 0x1F02,
+};
diff --git a/core/src/fpdfapi/fpdf_cmaps/Japan1/Add-RKSJ-H_1.cpp b/core/src/fpdfapi/fpdf_cmaps/Japan1/Add-RKSJ-H_1.cpp
index fd580d50a1..848cb49964 100644
--- a/core/src/fpdfapi/fpdf_cmaps/Japan1/Add-RKSJ-H_1.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/Japan1/Add-RKSJ-H_1.cpp
@@ -1,220 +1,220 @@
-// 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
-
-extern const unsigned short g_FXCMAP_Add_RKSJ_H_1[635 * 3] = {
- 0x0020, 0x007E, 0x00E7, 0x00A0, 0x00DF, 0x0146, 0x8140, 0x817E, 0x0279,
- 0x8180, 0x81AC, 0x02B8, 0x81B8, 0x81BF, 0x02E5, 0x81C8, 0x81CE, 0x02ED,
- 0x81DA, 0x81E8, 0x02F4, 0x81F0, 0x81F7, 0x0303, 0x81FC, 0x81FC, 0x030B,
- 0x824F, 0x8258, 0x030C, 0x8260, 0x8279, 0x0316, 0x8281, 0x829A, 0x0330,
- 0x829F, 0x82F1, 0x034A, 0x82F2, 0x82F4, 0x1F16, 0x8340, 0x837E, 0x039D,
- 0x8380, 0x8396, 0x03DC, 0x839F, 0x83B6, 0x03F3, 0x83BF, 0x83D6, 0x040B,
- 0x8440, 0x8460, 0x0423, 0x8470, 0x847E, 0x0444, 0x8480, 0x8491, 0x0453,
- 0x849F, 0x849F, 0x1D37, 0x84A0, 0x84A0, 0x1D39, 0x84A1, 0x84A1, 0x1D43,
- 0x84A2, 0x84A2, 0x1D47, 0x84A3, 0x84A3, 0x1D4F, 0x84A4, 0x84A4, 0x1D4B,
- 0x84A5, 0x84A5, 0x1D53, 0x84A6, 0x84A6, 0x1D63, 0x84A7, 0x84A7, 0x1D5B,
- 0x84A8, 0x84A8, 0x1D6B, 0x84A9, 0x84A9, 0x1D73, 0x84AA, 0x84AA, 0x1D38,
- 0x84AB, 0x84AB, 0x1D3A, 0x84AC, 0x84AC, 0x1D46, 0x84AD, 0x84AD, 0x1D4A,
- 0x84AE, 0x84AE, 0x1D52, 0x84AF, 0x84AF, 0x1D4E, 0x84B0, 0x84B0, 0x1D5A,
- 0x84B1, 0x84B1, 0x1D6A, 0x84B2, 0x84B2, 0x1D62, 0x84B3, 0x84B3, 0x1D72,
- 0x84B4, 0x84B4, 0x1D82, 0x84B5, 0x84B5, 0x1D57, 0x84B6, 0x84B6, 0x1D66,
- 0x84B7, 0x84B7, 0x1D5F, 0x84B8, 0x84B8, 0x1D6E, 0x84B9, 0x84B9, 0x1D76,
- 0x84BA, 0x84BA, 0x1D54, 0x84BB, 0x84BB, 0x1D67, 0x84BC, 0x84BC, 0x1D5C,
- 0x84BD, 0x84BD, 0x1D6F, 0x84BE, 0x84BE, 0x1D79, 0x889F, 0x889F, 0x0465,
- 0x88A0, 0x88A0, 0x1DD1, 0x88A1, 0x88AF, 0x0467, 0x88B0, 0x88B0, 0x1F19,
- 0x88B1, 0x88B8, 0x0477, 0x88B9, 0x88B9, 0x1DD2, 0x88BA, 0x88EB, 0x0480,
- 0x88EC, 0x88EC, 0x1DD3, 0x88ED, 0x88EE, 0x04B3, 0x88EF, 0x88EF, 0x1F1A,
- 0x88F0, 0x88F0, 0x04B6, 0x88F1, 0x88F1, 0x1DD4, 0x88F2, 0x88F9, 0x04B8,
- 0x88FA, 0x88FA, 0x1DD5, 0x88FB, 0x88FC, 0x04C1, 0x8940, 0x8948, 0x04C3,
- 0x8949, 0x8949, 0x1DD6, 0x894A, 0x8951, 0x04CD, 0x8952, 0x8952, 0x1F1B,
- 0x8953, 0x8953, 0x04D6, 0x8954, 0x8954, 0x1DD7, 0x8955, 0x8957, 0x04D8,
- 0x8958, 0x8958, 0x1F1C, 0x8959, 0x895B, 0x04DC, 0x895C, 0x895C, 0x1DDA,
- 0x895D, 0x8960, 0x04E0, 0x8961, 0x8961, 0x1DDB, 0x8962, 0x897E, 0x04E5,
- 0x8980, 0x898A, 0x0502, 0x898B, 0x898B, 0x1DDC, 0x898C, 0x89A5, 0x050E,
- 0x89A6, 0x89A6, 0x1DDD, 0x89A7, 0x89A7, 0x0529, 0x89A8, 0x89A8, 0x1DDE,
- 0x89A9, 0x89DD, 0x052B, 0x89DE, 0x89DE, 0x1DDF, 0x89DF, 0x89E4, 0x0561,
- 0x89E5, 0x89E5, 0x1F1D, 0x89E6, 0x89F7, 0x0568, 0x89F8, 0x89F8, 0x1DE0,
- 0x89F9, 0x89FC, 0x057B, 0x8A40, 0x8A40, 0x057F, 0x8A41, 0x8A41, 0x1DE2,
- 0x8A42, 0x8A7E, 0x0581, 0x8A80, 0x8A8A, 0x05BE, 0x8A8B, 0x8A8B, 0x1DE4,
- 0x8A8C, 0x8A92, 0x05CA, 0x8A93, 0x8A93, 0x1DE5, 0x8A94, 0x8A99, 0x05D2,
- 0x8A9A, 0x8A9A, 0x1DE6, 0x8A9B, 0x8ABF, 0x05D9, 0x8AC0, 0x8AC0, 0x1DE7,
- 0x8AC1, 0x8ACA, 0x05FF, 0x8ACB, 0x8ACB, 0x1DE8, 0x8ACC, 0x8AE2, 0x060A,
- 0x8AE3, 0x8AE3, 0x1DE9, 0x8AE4, 0x8AFC, 0x0622, 0x8B40, 0x8B49, 0x063B,
- 0x8B4A, 0x8B4A, 0x1DEA, 0x8B4B, 0x8B5E, 0x0646, 0x8B5F, 0x8B5F, 0x1DEB,
- 0x8B60, 0x8B7E, 0x065B, 0x8B80, 0x8B81, 0x067A, 0x8B82, 0x8B82, 0x1F1E,
- 0x8B83, 0x8B87, 0x067D, 0x8B88, 0x8B88, 0x1F1F, 0x8B89, 0x8B9F, 0x0683,
- 0x8BA0, 0x8BA0, 0x1DEC, 0x8BA1, 0x8BA7, 0x069B, 0x8BA8, 0x8BA8, 0x1DED,
- 0x8BA9, 0x8BBF, 0x06A3, 0x8BC0, 0x8BC0, 0x1F20, 0x8BC1, 0x8BCC, 0x06BB,
- 0x8BCD, 0x8BCD, 0x1DEE, 0x8BCE, 0x8BEA, 0x06C8, 0x8BEB, 0x8BEB, 0x1DEF,
- 0x8BEC, 0x8BF1, 0x06E6, 0x8BF2, 0x8BF2, 0x1DF0, 0x8BF3, 0x8BF8, 0x06ED,
- 0x8BF9, 0x8BF9, 0x1DF1, 0x8BFA, 0x8BFA, 0x06F4, 0x8BFB, 0x8BFB, 0x1DF2,
- 0x8BFC, 0x8BFC, 0x06F6, 0x8C40, 0x8C55, 0x06F7, 0x8C56, 0x8C56, 0x1DF4,
- 0x8C57, 0x8C70, 0x070E, 0x8C71, 0x8C71, 0x1DF7, 0x8C72, 0x8C7E, 0x0729,
- 0x8C80, 0x8C90, 0x0736, 0x8C91, 0x8C91, 0x1DFA, 0x8C92, 0x8C9C, 0x0748,
- 0x8C9D, 0x8C9D, 0x1F21, 0x8C9E, 0x8C9E, 0x1DFC, 0x8C9F, 0x8CB1, 0x0755,
- 0x8CB2, 0x8CB2, 0x1DFD, 0x8CB3, 0x8CBE, 0x0769, 0x8CBF, 0x8CBF, 0x1DFE,
- 0x8CC0, 0x8CFC, 0x0776, 0x8D40, 0x8D49, 0x07B3, 0x8D4A, 0x8D4A, 0x1DFF,
- 0x8D4B, 0x8D7E, 0x07BE, 0x8D80, 0x8D8C, 0x07F2, 0x8D8D, 0x8D8D, 0x1E02,
- 0x8D8E, 0x8D93, 0x0800, 0x8D94, 0x8D94, 0x1E03, 0x8D95, 0x8D98, 0x0807,
- 0x8D99, 0x8D99, 0x1E04, 0x8D9A, 0x8DD0, 0x080C, 0x8DD1, 0x8DD1, 0x1E05,
- 0x8DD2, 0x8DE4, 0x0844, 0x8DE5, 0x8DE5, 0x1E06, 0x8DE6, 0x8DF1, 0x0858,
- 0x8DF2, 0x8DF2, 0x1E07, 0x8DF3, 0x8DFC, 0x0865, 0x8E40, 0x8E45, 0x086F,
- 0x8E46, 0x8E46, 0x1E08, 0x8E47, 0x8E48, 0x0876, 0x8E49, 0x8E49, 0x1E09,
- 0x8E4A, 0x8E4A, 0x0879, 0x8E4B, 0x8E4B, 0x1E0A, 0x8E4C, 0x8E57, 0x087B,
- 0x8E58, 0x8E58, 0x1E0B, 0x8E59, 0x8E5F, 0x0888, 0x8E60, 0x8E60, 0x1F22,
- 0x8E61, 0x8E7E, 0x0890, 0x8E80, 0x8EC5, 0x08AE, 0x8EC6, 0x8EC6, 0x1E0D,
- 0x8EC7, 0x8EDA, 0x08F5, 0x8EDB, 0x8EDC, 0x1E0F, 0x8EDD, 0x8EFC, 0x090B,
- 0x8F40, 0x8F49, 0x092B, 0x8F4A, 0x8F4A, 0x1E11, 0x8F4B, 0x8F54, 0x0936,
- 0x8F55, 0x8F55, 0x1E12, 0x8F56, 0x8F7E, 0x0941, 0x8F80, 0x8F8B, 0x096A,
- 0x8F8C, 0x8F8C, 0x1E13, 0x8F8D, 0x8F91, 0x0977, 0x8F92, 0x8F93, 0x1E15,
- 0x8F94, 0x8FA2, 0x097E, 0x8FA3, 0x8FA3, 0x1E17, 0x8FA4, 0x8FB0, 0x098E,
- 0x8FB1, 0x8FB1, 0x1E18, 0x8FB2, 0x8FD2, 0x099C, 0x8FD3, 0x8FD3, 0x1E1A,
- 0x8FD4, 0x8FDC, 0x09BE, 0x8FDD, 0x8FDD, 0x1E1B, 0x8FDE, 0x8FE1, 0x09C8,
- 0x8FE2, 0x8FE2, 0x1E1C, 0x8FE3, 0x8FFC, 0x09CD, 0x9040, 0x9048, 0x09E7,
- 0x9049, 0x9049, 0x1E1D, 0x904A, 0x9077, 0x09F1, 0x9078, 0x9078, 0x1F23,
- 0x9079, 0x907E, 0x0A20, 0x9080, 0x9080, 0x1E1F, 0x9081, 0x909F, 0x0A27,
- 0x90A0, 0x90A0, 0x1E21, 0x90A1, 0x90E3, 0x0A47, 0x90E4, 0x90E4, 0x1E23,
- 0x90E5, 0x90EE, 0x0A8B, 0x90EF, 0x90EF, 0x1E24, 0x90F0, 0x90F6, 0x0A96,
- 0x90F7, 0x90F7, 0x1E26, 0x90F8, 0x90F8, 0x1F24, 0x90F9, 0x90F9, 0x0A9F,
- 0x90FA, 0x90FB, 0x1F25, 0x90FC, 0x90FC, 0x0AA2, 0x9140, 0x9145, 0x0AA3,
- 0x9146, 0x9146, 0x1E28, 0x9147, 0x9157, 0x0AAA, 0x9158, 0x9158, 0x1E29,
- 0x9159, 0x916A, 0x0ABC, 0x916B, 0x916B, 0x1E2A, 0x916C, 0x916D, 0x0ACF,
- 0x916E, 0x916E, 0x1E2B, 0x916F, 0x917D, 0x0AD2, 0x917E, 0x917E, 0x1E2C,
- 0x9180, 0x9188, 0x0AE2, 0x9189, 0x9189, 0x1E2D, 0x918A, 0x91B4, 0x0AEC,
- 0x91B5, 0x91B5, 0x1F27, 0x91B6, 0x91BA, 0x0B18, 0x91BB, 0x91BB, 0x1E2E,
- 0x91BC, 0x91CA, 0x0B1E, 0x91CB, 0x91CB, 0x1E2F, 0x91CC, 0x91D9, 0x0B2E,
- 0x91DA, 0x91DA, 0x1E30, 0x91DB, 0x91E0, 0x0B3D, 0x91E1, 0x91E1, 0x1E31,
- 0x91E2, 0x91EC, 0x0B44, 0x91ED, 0x91ED, 0x1E32, 0x91EE, 0x91FA, 0x0B50,
- 0x91FB, 0x91FB, 0x1E35, 0x91FC, 0x91FC, 0x0B5E, 0x9240, 0x9245, 0x0B5F,
- 0x9246, 0x9246, 0x1E36, 0x9247, 0x9247, 0x0B66, 0x9248, 0x9248, 0x1E37,
- 0x9249, 0x924B, 0x0B68, 0x924C, 0x924D, 0x1E39, 0x924E, 0x925B, 0x0B6D,
- 0x925C, 0x925C, 0x1E3B, 0x925D, 0x927E, 0x0B7C, 0x9280, 0x928F, 0x0B9E,
- 0x9290, 0x9290, 0x1E3C, 0x9291, 0x9294, 0x0BAF, 0x9295, 0x9295, 0x1E3D,
- 0x9296, 0x929B, 0x0BB4, 0x929C, 0x929C, 0x1E3E, 0x929D, 0x92BA, 0x0BBB,
- 0x92BB, 0x92BB, 0x1E3F, 0x92BC, 0x92C5, 0x0BDA, 0x92C6, 0x92C6, 0x1E40,
- 0x92C7, 0x92C7, 0x0BE5, 0x92C8, 0x92C8, 0x1E41, 0x92C9, 0x92CC, 0x0BE7,
- 0x92CD, 0x92CD, 0x1E43, 0x92CE, 0x92FC, 0x0BEC, 0x9340, 0x9340, 0x0C1B,
- 0x9341, 0x9341, 0x1E44, 0x9342, 0x9345, 0x0C1D, 0x9346, 0x9346, 0x1E45,
- 0x9347, 0x934C, 0x0C22, 0x934D, 0x934D, 0x1E46, 0x934E, 0x9354, 0x0C29,
- 0x9355, 0x9355, 0x1E47, 0x9356, 0x935D, 0x0C31, 0x935E, 0x935E, 0x1E48,
- 0x935F, 0x9366, 0x0C3A, 0x9367, 0x9367, 0x1E49, 0x9368, 0x9369, 0x0C43,
- 0x936A, 0x936A, 0x1E4A, 0x936B, 0x936F, 0x0C46, 0x9370, 0x9370, 0x1F28,
- 0x9371, 0x9371, 0x1E4C, 0x9372, 0x937E, 0x0C4D, 0x9380, 0x9383, 0x0C5A,
- 0x9384, 0x9384, 0x1E4D, 0x9385, 0x9397, 0x0C5F, 0x9398, 0x9398, 0x1E4E,
- 0x9399, 0x93BF, 0x0C73, 0x93C0, 0x93C0, 0x1E50, 0x93C1, 0x93D1, 0x0C9B,
- 0x93D2, 0x93D2, 0x1E51, 0x93D3, 0x93D8, 0x0CAD, 0x93D9, 0x93D9, 0x1E53,
- 0x93DA, 0x93E3, 0x0CB4, 0x93E4, 0x93E5, 0x1E56, 0x93E6, 0x93E7, 0x0CC0,
- 0x93E8, 0x93E8, 0x1E58, 0x93E9, 0x93F3, 0x0CC3, 0x93F4, 0x93F4, 0x1EC0,
- 0x93F5, 0x93FC, 0x0CCF, 0x9440, 0x9447, 0x0CD7, 0x9448, 0x9448, 0x1E59,
- 0x9449, 0x9449, 0x1F29, 0x944A, 0x9457, 0x0CE1, 0x9458, 0x9458, 0x1E5A,
- 0x9459, 0x9475, 0x0CF0, 0x9476, 0x9476, 0x1E5B, 0x9477, 0x947E, 0x0D0E,
- 0x9480, 0x9486, 0x0D16, 0x9487, 0x9487, 0x1E5C, 0x9488, 0x9488, 0x0D1E,
- 0x9489, 0x9489, 0x1E5D, 0x948A, 0x948C, 0x0D20, 0x948D, 0x948D, 0x1E5E,
- 0x948E, 0x94A1, 0x0D24, 0x94A2, 0x94A2, 0x1E5F, 0x94A3, 0x94AB, 0x0D39,
- 0x94AC, 0x94AC, 0x1E60, 0x94AD, 0x94AD, 0x0D43, 0x94AE, 0x94AE, 0x1E61,
- 0x94AF, 0x94BD, 0x0D45, 0x94BE, 0x94BE, 0x1F2A, 0x94BF, 0x94D1, 0x0D55,
- 0x94D2, 0x94D2, 0x1E62, 0x94D3, 0x94F2, 0x0D69, 0x94F3, 0x94F3, 0x1E64,
- 0x94F4, 0x94FC, 0x0D8A, 0x9540, 0x9540, 0x0D93, 0x9541, 0x9542, 0x1E65,
- 0x9543, 0x954D, 0x0D96, 0x954E, 0x954E, 0x1E67, 0x954F, 0x9550, 0x0DA2,
- 0x9551, 0x9551, 0x1E68, 0x9552, 0x9553, 0x0DA5, 0x9554, 0x9554, 0x1E69,
- 0x9555, 0x955E, 0x0DA8, 0x955F, 0x955F, 0x1E6A, 0x9560, 0x956C, 0x0DB3,
- 0x956D, 0x956D, 0x1E6B, 0x956E, 0x957E, 0x0DC1, 0x9580, 0x95C0, 0x0DD2,
- 0x95C1, 0x95C1, 0x1E6D, 0x95C2, 0x95CA, 0x0E14, 0x95CB, 0x95CB, 0x1E6E,
- 0x95CC, 0x95D0, 0x0E1E, 0x95D1, 0x95D1, 0x1F2B, 0x95D2, 0x95D7, 0x0E24,
- 0x95D8, 0x95D8, 0x1E6F, 0x95D9, 0x95F6, 0x0E2B, 0x95F7, 0x95F7, 0x1E70,
- 0x95F8, 0x95FC, 0x0E4A, 0x9640, 0x9647, 0x0E4F, 0x9648, 0x9648, 0x1E72,
- 0x9649, 0x9669, 0x0E58, 0x966A, 0x966A, 0x1E73, 0x966B, 0x967E, 0x0E7A,
- 0x9680, 0x968F, 0x0E8E, 0x9690, 0x9690, 0x1E74, 0x9691, 0x9697, 0x0E9F,
- 0x9698, 0x9698, 0x1F2C, 0x9699, 0x96CA, 0x0EA7, 0x96CB, 0x96CB, 0x1E75,
- 0x96CC, 0x96D6, 0x0EDA, 0x96D7, 0x96D7, 0x1E76, 0x96D8, 0x96DC, 0x0EE6,
- 0x96DD, 0x96DD, 0x1E77, 0x96DE, 0x96DF, 0x0EEC, 0x96E0, 0x96E0, 0x1E78,
- 0x96E1, 0x96F7, 0x0EEF, 0x96F8, 0x96F8, 0x1E79, 0x96F9, 0x96F9, 0x0F07,
- 0x96FA, 0x96FA, 0x1E7A, 0x96FB, 0x96FC, 0x0F09, 0x9740, 0x9750, 0x0F0B,
- 0x9751, 0x9751, 0x1E7C, 0x9752, 0x976E, 0x0F1D, 0x976F, 0x976F, 0x1E7D,
- 0x9770, 0x9772, 0x0F3B, 0x9773, 0x9773, 0x1E7E, 0x9774, 0x977E, 0x0F3F,
- 0x9780, 0x9788, 0x0F4A, 0x9789, 0x9789, 0x1E7F, 0x978A, 0x97F7, 0x0F54,
- 0x97F8, 0x97F9, 0x1E81, 0x97FA, 0x97FA, 0x1F2D, 0x97FB, 0x97FC, 0x0FC5,
- 0x9840, 0x9840, 0x1E83, 0x9841, 0x984F, 0x0FC8, 0x9850, 0x9850, 0x1E84,
- 0x9851, 0x9857, 0x0FD8, 0x9858, 0x9858, 0x1E85, 0x9859, 0x9872, 0x0FE0,
- 0x989F, 0x98FC, 0x0FFA, 0x9940, 0x9940, 0x1058, 0x9941, 0x9941, 0x1F2E,
- 0x9942, 0x995B, 0x105A, 0x995C, 0x995C, 0x1E86, 0x995D, 0x996B, 0x1075,
- 0x996C, 0x996C, 0x1E89, 0x996D, 0x997E, 0x1085, 0x9980, 0x99B5, 0x1097,
- 0x99B6, 0x99B6, 0x1F2F, 0x99B7, 0x99FC, 0x10CE, 0x9A40, 0x9A4E, 0x1114,
- 0x9A4F, 0x9A4F, 0x1E8A, 0x9A50, 0x9A58, 0x1124, 0x9A59, 0x9A59, 0x1E8B,
- 0x9A5A, 0x9A66, 0x112E, 0x9A67, 0x9A67, 0x1F30, 0x9A68, 0x9A7C, 0x113C,
- 0x9A7D, 0x9A7D, 0x1E8D, 0x9A7E, 0x9A7E, 0x1152, 0x9A80, 0x9A8A, 0x1153,
- 0x9A8B, 0x9A8B, 0x1E8E, 0x9A8C, 0x9A8C, 0x1F31, 0x9A8D, 0x9AC1, 0x1160,
- 0x9AC2, 0x9AC2, 0x1E8F, 0x9AC3, 0x9AC3, 0x1F32, 0x9AC4, 0x9AE9, 0x1197,
- 0x9AEA, 0x9AEA, 0x1F33, 0x9AEB, 0x9AFC, 0x11BE, 0x9B40, 0x9B5B, 0x11D0,
- 0x9B5C, 0x9B5C, 0x1E90, 0x9B5D, 0x9B7E, 0x11ED, 0x9B80, 0x9B82, 0x120F,
- 0x9B83, 0x9B83, 0x1E91, 0x9B84, 0x9B97, 0x1213, 0x9B98, 0x9B98, 0x1F34,
- 0x9B99, 0x9B9F, 0x1228, 0x9BA0, 0x9BA0, 0x1E92, 0x9BA1, 0x9BFA, 0x1230,
- 0x9BFB, 0x9BFC, 0x1F35, 0x9C40, 0x9C7E, 0x128C, 0x9C80, 0x9CA1, 0x12CB,
- 0x9CA2, 0x9CA2, 0x1E94, 0x9CA3, 0x9CFC, 0x12EE, 0x9D40, 0x9D46, 0x1348,
- 0x9D47, 0x9D47, 0x1F37, 0x9D48, 0x9D7E, 0x1350, 0x9D80, 0x9D80, 0x1E95,
- 0x9D81, 0x9D8B, 0x1388, 0x9D8C, 0x9D8C, 0x1E96, 0x9D8D, 0x9DB6, 0x1394,
- 0x9DB7, 0x9DB7, 0x1E97, 0x9DB8, 0x9DF7, 0x13BF, 0x9DF8, 0x9DF8, 0x1F38,
- 0x9DF9, 0x9DFC, 0x1400, 0x9E40, 0x9E63, 0x1404, 0x9E64, 0x9E64, 0x1E99,
- 0x9E65, 0x9E7E, 0x1429, 0x9E80, 0x9E8A, 0x1443, 0x9E8B, 0x9E8B, 0x1E9B,
- 0x9E8C, 0x9EFC, 0x144F, 0x9F40, 0x9F7E, 0x14C0, 0x9F80, 0x9F80, 0x14FF,
- 0x9F81, 0x9F81, 0x1F39, 0x9F82, 0x9FCD, 0x1501, 0x9FCE, 0x9FCE, 0x1E9D,
- 0x9FCF, 0x9FD3, 0x154E, 0x9FD4, 0x9FD4, 0x1F3A, 0x9FD5, 0x9FF3, 0x1554,
- 0x9FF4, 0x9FF4, 0x1F3B, 0x9FF5, 0x9FFC, 0x1574, 0xE040, 0xE07E, 0x157C,
- 0xE080, 0xE092, 0x15BB, 0xE093, 0xE093, 0x1E9E, 0xE094, 0xE0A3, 0x15CF,
- 0xE0A4, 0xE0A4, 0x1E9F, 0xE0A5, 0xE0DC, 0x15E0, 0xE0DD, 0xE0DD, 0x1EA0,
- 0xE0DE, 0xE0FC, 0x1619, 0xE140, 0xE149, 0x1638, 0xE14A, 0xE14A, 0x1EA1,
- 0xE14B, 0xE17E, 0x1643, 0xE180, 0xE1EC, 0x1677, 0xE1ED, 0xE1ED, 0x1EA5,
- 0xE1EE, 0xE1FC, 0x16E5, 0xE240, 0xE268, 0x16F4, 0xE269, 0xE269, 0x1EA6,
- 0xE26A, 0xE272, 0x171E, 0xE273, 0xE273, 0x1EA7, 0xE274, 0xE277, 0x1728,
- 0xE278, 0xE278, 0x1F3C, 0xE279, 0xE27E, 0x172D, 0xE280, 0xE2B6, 0x1733,
- 0xE2B7, 0xE2B7, 0x1EA8, 0xE2B8, 0xE2BD, 0x176B, 0xE2BE, 0xE2BE, 0x1F3D,
- 0xE2BF, 0xE2E1, 0x1772, 0xE2E2, 0xE2E2, 0x1EA9, 0xE2E3, 0xE2EB, 0x1796,
- 0xE2EC, 0xE2EC, 0x1EAA, 0xE2ED, 0xE2FC, 0x17A0, 0xE340, 0xE357, 0x17B0,
- 0xE358, 0xE358, 0x1EAB, 0xE359, 0xE359, 0x17C9, 0xE35A, 0xE35A, 0x1EAC,
- 0xE35B, 0xE364, 0x17CB, 0xE365, 0xE365, 0x1EAD, 0xE366, 0xE37E, 0x17D6,
- 0xE380, 0xE3C6, 0x17EF, 0xE3C7, 0xE3C7, 0x1F3E, 0xE3C8, 0xE3FC, 0x1837,
- 0xE440, 0xE47E, 0x186C, 0xE480, 0xE483, 0x18AB, 0xE484, 0xE484, 0x1EAF,
- 0xE485, 0xE488, 0x18B0, 0xE489, 0xE489, 0x1EB0, 0xE48A, 0xE491, 0x18B5,
- 0xE492, 0xE492, 0x1EB1, 0xE493, 0xE4B8, 0x18BE, 0xE4B9, 0xE4B9, 0x1EB3,
- 0xE4BA, 0xE4CA, 0x18E5, 0xE4CB, 0xE4CB, 0x1F3F, 0xE4CC, 0xE4FC, 0x18F7,
- 0xE540, 0xE57E, 0x1928, 0xE580, 0xE59D, 0x1967, 0xE59E, 0xE59E, 0x1F40,
- 0xE59F, 0xE5B9, 0x1986, 0xE5BA, 0xE5BB, 0x1F41, 0xE5BC, 0xE5EC, 0x19A3,
- 0xE5ED, 0xE5ED, 0x1EB8, 0xE5EE, 0xE5FC, 0x19D5, 0xE640, 0xE650, 0x19E4,
- 0xE651, 0xE651, 0x1EB9, 0xE652, 0xE67E, 0x19F6, 0xE680, 0xE685, 0x1A23,
- 0xE686, 0xE686, 0x1EBA, 0xE687, 0xE6E6, 0x1A2A, 0xE6E7, 0xE6E7, 0x1EBC,
- 0xE6E8, 0xE6FC, 0x1A8B, 0xE740, 0xE76C, 0x1AA0, 0xE76D, 0xE76D, 0x1EBE,
- 0xE76E, 0xE77E, 0x1ACE, 0xE780, 0xE7A6, 0x1ADF, 0xE7A7, 0xE7A7, 0x1EC1,
- 0xE7A8, 0xE7BA, 0x1B07, 0xE7BB, 0xE7BB, 0x1EC2, 0xE7BC, 0xE7FC, 0x1B1B,
- 0xE840, 0xE87E, 0x1B5C, 0xE880, 0xE8CE, 0x1B9B, 0xE8CF, 0xE8CF, 0x1EC7,
- 0xE8D0, 0xE8FC, 0x1BEB, 0xE940, 0xE977, 0x1C18, 0xE978, 0xE978, 0x1F43,
- 0xE979, 0xE97E, 0x1C51, 0xE980, 0xE9AA, 0x1C57, 0xE9AB, 0xE9AB, 0x1ECA,
- 0xE9AC, 0xE9B9, 0x1C83, 0xE9BA, 0xE9BA, 0x1ECB, 0xE9BB, 0xE9CB, 0x1C92,
- 0xE9CC, 0xE9CC, 0x1ECC, 0xE9CD, 0xE9FC, 0x1CA4, 0xEA40, 0xEA6F, 0x1CD4,
- 0xEA70, 0xEA70, 0x1ECD, 0xEA71, 0xEA71, 0x1F44, 0xEA72, 0xEA7E, 0x1D06,
- 0xEA80, 0xEA9C, 0x1D13, 0xEA9D, 0xEA9D, 0x1ECE, 0xEA9E, 0xEAA2, 0x1D31,
- 0xEAA3, 0xEAA4, 0x205C, 0xEC40, 0xEC42, 0x1F45, 0xEC46, 0xEC46, 0x1F48,
- 0xEC47, 0xEC47, 0x0300, 0xEC48, 0xEC48, 0x02FA, 0xEC49, 0xEC49, 0x02F9,
- 0xEC4D, 0xEC57, 0x1F49, 0xEC5B, 0xEC5D, 0x1DB1, 0xEC5E, 0xEC5E, 0x1F54,
- 0xEC5F, 0xEC5F, 0x1DB7, 0xEC60, 0xEC62, 0x1F55, 0xEC63, 0xEC65, 0x1DB4,
- 0xEC66, 0xEC6F, 0x1F58, 0xEC70, 0xEC70, 0x0303, 0xEC71, 0xEC71, 0x1F62,
- 0xEC72, 0xEC72, 0x0304, 0xEC73, 0xEC74, 0x1F63, 0xEC76, 0xEC76, 0x1F65,
- 0xEC78, 0xEC78, 0x1DA4, 0xEC79, 0xEC79, 0x1DA1, 0xEC7A, 0xEC7A, 0x1F66,
- 0xEC7B, 0xEC7B, 0x1DA2, 0xEC7C, 0xEC7E, 0x1F67, 0xEC80, 0xEC80, 0x1DA6,
- 0xEC81, 0xEC81, 0x1F6A, 0xEC82, 0xEC82, 0x1DA8, 0xEC83, 0xEC83, 0x1DAC,
- 0xEC84, 0xEC84, 0x1F6B, 0xEC85, 0xEC85, 0x1DAE, 0xEC86, 0xEC86, 0x1DAB,
- 0xEC87, 0xEC88, 0x1F6C, 0xEC89, 0xEC89, 0x1DAF, 0xEC8A, 0xEC90, 0x1F6E,
- 0xEC94, 0xEC99, 0x1F75, 0xEC9A, 0xEC9A, 0x1DBA, 0xEC9B, 0xEC9B, 0x1F7B,
- 0xEC9E, 0xEC9E, 0x1F7C, 0xECA7, 0xECB0, 0x1F7D, 0xECB2, 0xECC5, 0x1F87,
- 0xECC7, 0xECDA, 0x1D83, 0xECDB, 0xECDB, 0x1F9B, 0xECDC, 0xECE5, 0x1D97,
- 0xECE9, 0xECFC, 0x1F9C, 0xED40, 0xED59, 0x1FB0, 0xED64, 0xED64, 0x1F16,
- 0xED68, 0xED69, 0x1FCA, 0xED6A, 0xED6A, 0x1DC4, 0xED6B, 0xED6D, 0x1FCC,
- 0xED6E, 0xED6E, 0x1DC3, 0xED6F, 0xED73, 0x1FCF, 0xED74, 0xED74, 0x1DC2,
- 0xED75, 0xED78, 0x1FD4, 0xED7C, 0xED7E, 0x1FD8, 0xED80, 0xED8A, 0x1FDB,
- 0xED8F, 0xED9E, 0x1FE6, 0xEF40, 0xEF41, 0x1ECF, 0xEF42, 0xEF42, 0x204C,
- 0xEF43, 0xEF43, 0x2052, 0xEF44, 0xEF4D, 0x1ED1, 0xEF4E, 0xEF4E, 0x205A,
- 0xEF4F, 0xEF4F, 0x2053, 0xEF50, 0xEF50, 0x2058, 0xEF51, 0xEF51, 0x2055,
- 0xEF52, 0xEF63, 0x1EDB, 0xEF64, 0xEF79, 0x1EEE, 0xEF7A, 0xEF7B, 0x2048,
- 0xEF8D, 0xEF90, 0x02E0, 0xEF91, 0xEF94, 0x1FF6,
-};
+// 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
+
+extern const unsigned short g_FXCMAP_Add_RKSJ_H_1[635 * 3] = {
+ 0x0020, 0x007E, 0x00E7, 0x00A0, 0x00DF, 0x0146, 0x8140, 0x817E, 0x0279,
+ 0x8180, 0x81AC, 0x02B8, 0x81B8, 0x81BF, 0x02E5, 0x81C8, 0x81CE, 0x02ED,
+ 0x81DA, 0x81E8, 0x02F4, 0x81F0, 0x81F7, 0x0303, 0x81FC, 0x81FC, 0x030B,
+ 0x824F, 0x8258, 0x030C, 0x8260, 0x8279, 0x0316, 0x8281, 0x829A, 0x0330,
+ 0x829F, 0x82F1, 0x034A, 0x82F2, 0x82F4, 0x1F16, 0x8340, 0x837E, 0x039D,
+ 0x8380, 0x8396, 0x03DC, 0x839F, 0x83B6, 0x03F3, 0x83BF, 0x83D6, 0x040B,
+ 0x8440, 0x8460, 0x0423, 0x8470, 0x847E, 0x0444, 0x8480, 0x8491, 0x0453,
+ 0x849F, 0x849F, 0x1D37, 0x84A0, 0x84A0, 0x1D39, 0x84A1, 0x84A1, 0x1D43,
+ 0x84A2, 0x84A2, 0x1D47, 0x84A3, 0x84A3, 0x1D4F, 0x84A4, 0x84A4, 0x1D4B,
+ 0x84A5, 0x84A5, 0x1D53, 0x84A6, 0x84A6, 0x1D63, 0x84A7, 0x84A7, 0x1D5B,
+ 0x84A8, 0x84A8, 0x1D6B, 0x84A9, 0x84A9, 0x1D73, 0x84AA, 0x84AA, 0x1D38,
+ 0x84AB, 0x84AB, 0x1D3A, 0x84AC, 0x84AC, 0x1D46, 0x84AD, 0x84AD, 0x1D4A,
+ 0x84AE, 0x84AE, 0x1D52, 0x84AF, 0x84AF, 0x1D4E, 0x84B0, 0x84B0, 0x1D5A,
+ 0x84B1, 0x84B1, 0x1D6A, 0x84B2, 0x84B2, 0x1D62, 0x84B3, 0x84B3, 0x1D72,
+ 0x84B4, 0x84B4, 0x1D82, 0x84B5, 0x84B5, 0x1D57, 0x84B6, 0x84B6, 0x1D66,
+ 0x84B7, 0x84B7, 0x1D5F, 0x84B8, 0x84B8, 0x1D6E, 0x84B9, 0x84B9, 0x1D76,
+ 0x84BA, 0x84BA, 0x1D54, 0x84BB, 0x84BB, 0x1D67, 0x84BC, 0x84BC, 0x1D5C,
+ 0x84BD, 0x84BD, 0x1D6F, 0x84BE, 0x84BE, 0x1D79, 0x889F, 0x889F, 0x0465,
+ 0x88A0, 0x88A0, 0x1DD1, 0x88A1, 0x88AF, 0x0467, 0x88B0, 0x88B0, 0x1F19,
+ 0x88B1, 0x88B8, 0x0477, 0x88B9, 0x88B9, 0x1DD2, 0x88BA, 0x88EB, 0x0480,
+ 0x88EC, 0x88EC, 0x1DD3, 0x88ED, 0x88EE, 0x04B3, 0x88EF, 0x88EF, 0x1F1A,
+ 0x88F0, 0x88F0, 0x04B6, 0x88F1, 0x88F1, 0x1DD4, 0x88F2, 0x88F9, 0x04B8,
+ 0x88FA, 0x88FA, 0x1DD5, 0x88FB, 0x88FC, 0x04C1, 0x8940, 0x8948, 0x04C3,
+ 0x8949, 0x8949, 0x1DD6, 0x894A, 0x8951, 0x04CD, 0x8952, 0x8952, 0x1F1B,
+ 0x8953, 0x8953, 0x04D6, 0x8954, 0x8954, 0x1DD7, 0x8955, 0x8957, 0x04D8,
+ 0x8958, 0x8958, 0x1F1C, 0x8959, 0x895B, 0x04DC, 0x895C, 0x895C, 0x1DDA,
+ 0x895D, 0x8960, 0x04E0, 0x8961, 0x8961, 0x1DDB, 0x8962, 0x897E, 0x04E5,
+ 0x8980, 0x898A, 0x0502, 0x898B, 0x898B, 0x1DDC, 0x898C, 0x89A5, 0x050E,
+ 0x89A6, 0x89A6, 0x1DDD, 0x89A7, 0x89A7, 0x0529, 0x89A8, 0x89A8, 0x1DDE,
+ 0x89A9, 0x89DD, 0x052B, 0x89DE, 0x89DE, 0x1DDF, 0x89DF, 0x89E4, 0x0561,
+ 0x89E5, 0x89E5, 0x1F1D, 0x89E6, 0x89F7, 0x0568, 0x89F8, 0x89F8, 0x1DE0,
+ 0x89F9, 0x89FC, 0x057B, 0x8A40, 0x8A40, 0x057F, 0x8A41, 0x8A41, 0x1DE2,
+ 0x8A42, 0x8A7E, 0x0581, 0x8A80, 0x8A8A, 0x05BE, 0x8A8B, 0x8A8B, 0x1DE4,
+ 0x8A8C, 0x8A92, 0x05CA, 0x8A93, 0x8A93, 0x1DE5, 0x8A94, 0x8A99, 0x05D2,
+ 0x8A9A, 0x8A9A, 0x1DE6, 0x8A9B, 0x8ABF, 0x05D9, 0x8AC0, 0x8AC0, 0x1DE7,
+ 0x8AC1, 0x8ACA, 0x05FF, 0x8ACB, 0x8ACB, 0x1DE8, 0x8ACC, 0x8AE2, 0x060A,
+ 0x8AE3, 0x8AE3, 0x1DE9, 0x8AE4, 0x8AFC, 0x0622, 0x8B40, 0x8B49, 0x063B,
+ 0x8B4A, 0x8B4A, 0x1DEA, 0x8B4B, 0x8B5E, 0x0646, 0x8B5F, 0x8B5F, 0x1DEB,
+ 0x8B60, 0x8B7E, 0x065B, 0x8B80, 0x8B81, 0x067A, 0x8B82, 0x8B82, 0x1F1E,
+ 0x8B83, 0x8B87, 0x067D, 0x8B88, 0x8B88, 0x1F1F, 0x8B89, 0x8B9F, 0x0683,
+ 0x8BA0, 0x8BA0, 0x1DEC, 0x8BA1, 0x8BA7, 0x069B, 0x8BA8, 0x8BA8, 0x1DED,
+ 0x8BA9, 0x8BBF, 0x06A3, 0x8BC0, 0x8BC0, 0x1F20, 0x8BC1, 0x8BCC, 0x06BB,
+ 0x8BCD, 0x8BCD, 0x1DEE, 0x8BCE, 0x8BEA, 0x06C8, 0x8BEB, 0x8BEB, 0x1DEF,
+ 0x8BEC, 0x8BF1, 0x06E6, 0x8BF2, 0x8BF2, 0x1DF0, 0x8BF3, 0x8BF8, 0x06ED,
+ 0x8BF9, 0x8BF9, 0x1DF1, 0x8BFA, 0x8BFA, 0x06F4, 0x8BFB, 0x8BFB, 0x1DF2,
+ 0x8BFC, 0x8BFC, 0x06F6, 0x8C40, 0x8C55, 0x06F7, 0x8C56, 0x8C56, 0x1DF4,
+ 0x8C57, 0x8C70, 0x070E, 0x8C71, 0x8C71, 0x1DF7, 0x8C72, 0x8C7E, 0x0729,
+ 0x8C80, 0x8C90, 0x0736, 0x8C91, 0x8C91, 0x1DFA, 0x8C92, 0x8C9C, 0x0748,
+ 0x8C9D, 0x8C9D, 0x1F21, 0x8C9E, 0x8C9E, 0x1DFC, 0x8C9F, 0x8CB1, 0x0755,
+ 0x8CB2, 0x8CB2, 0x1DFD, 0x8CB3, 0x8CBE, 0x0769, 0x8CBF, 0x8CBF, 0x1DFE,
+ 0x8CC0, 0x8CFC, 0x0776, 0x8D40, 0x8D49, 0x07B3, 0x8D4A, 0x8D4A, 0x1DFF,
+ 0x8D4B, 0x8D7E, 0x07BE, 0x8D80, 0x8D8C, 0x07F2, 0x8D8D, 0x8D8D, 0x1E02,
+ 0x8D8E, 0x8D93, 0x0800, 0x8D94, 0x8D94, 0x1E03, 0x8D95, 0x8D98, 0x0807,
+ 0x8D99, 0x8D99, 0x1E04, 0x8D9A, 0x8DD0, 0x080C, 0x8DD1, 0x8DD1, 0x1E05,
+ 0x8DD2, 0x8DE4, 0x0844, 0x8DE5, 0x8DE5, 0x1E06, 0x8DE6, 0x8DF1, 0x0858,
+ 0x8DF2, 0x8DF2, 0x1E07, 0x8DF3, 0x8DFC, 0x0865, 0x8E40, 0x8E45, 0x086F,
+ 0x8E46, 0x8E46, 0x1E08, 0x8E47, 0x8E48, 0x0876, 0x8E49, 0x8E49, 0x1E09,
+ 0x8E4A, 0x8E4A, 0x0879, 0x8E4B, 0x8E4B, 0x1E0A, 0x8E4C, 0x8E57, 0x087B,
+ 0x8E58, 0x8E58, 0x1E0B, 0x8E59, 0x8E5F, 0x0888, 0x8E60, 0x8E60, 0x1F22,
+ 0x8E61, 0x8E7E, 0x0890, 0x8E80, 0x8EC5, 0x08AE, 0x8EC6, 0x8EC6, 0x1E0D,
+ 0x8EC7, 0x8EDA, 0x08F5, 0x8EDB, 0x8EDC, 0x1E0F, 0x8EDD, 0x8EFC, 0x090B,
+ 0x8F40, 0x8F49, 0x092B, 0x8F4A, 0x8F4A, 0x1E11, 0x8F4B, 0x8F54, 0x0936,
+ 0x8F55, 0x8F55, 0x1E12, 0x8F56, 0x8F7E, 0x0941, 0x8F80, 0x8F8B, 0x096A,
+ 0x8F8C, 0x8F8C, 0x1E13, 0x8F8D, 0x8F91, 0x0977, 0x8F92, 0x8F93, 0x1E15,
+ 0x8F94, 0x8FA2, 0x097E, 0x8FA3, 0x8FA3, 0x1E17, 0x8FA4, 0x8FB0, 0x098E,
+ 0x8FB1, 0x8FB1, 0x1E18, 0x8FB2, 0x8FD2, 0x099C, 0x8FD3, 0x8FD3, 0x1E1A,
+ 0x8FD4, 0x8FDC, 0x09BE, 0x8FDD, 0x8FDD, 0x1E1B, 0x8FDE, 0x8FE1, 0x09C8,
+ 0x8FE2, 0x8FE2, 0x1E1C, 0x8FE3, 0x8FFC, 0x09CD, 0x9040, 0x9048, 0x09E7,
+ 0x9049, 0x9049, 0x1E1D, 0x904A, 0x9077, 0x09F1, 0x9078, 0x9078, 0x1F23,
+ 0x9079, 0x907E, 0x0A20, 0x9080, 0x9080, 0x1E1F, 0x9081, 0x909F, 0x0A27,
+ 0x90A0, 0x90A0, 0x1E21, 0x90A1, 0x90E3, 0x0A47, 0x90E4, 0x90E4, 0x1E23,
+ 0x90E5, 0x90EE, 0x0A8B, 0x90EF, 0x90EF, 0x1E24, 0x90F0, 0x90F6, 0x0A96,
+ 0x90F7, 0x90F7, 0x1E26, 0x90F8, 0x90F8, 0x1F24, 0x90F9, 0x90F9, 0x0A9F,
+ 0x90FA, 0x90FB, 0x1F25, 0x90FC, 0x90FC, 0x0AA2, 0x9140, 0x9145, 0x0AA3,
+ 0x9146, 0x9146, 0x1E28, 0x9147, 0x9157, 0x0AAA, 0x9158, 0x9158, 0x1E29,
+ 0x9159, 0x916A, 0x0ABC, 0x916B, 0x916B, 0x1E2A, 0x916C, 0x916D, 0x0ACF,
+ 0x916E, 0x916E, 0x1E2B, 0x916F, 0x917D, 0x0AD2, 0x917E, 0x917E, 0x1E2C,
+ 0x9180, 0x9188, 0x0AE2, 0x9189, 0x9189, 0x1E2D, 0x918A, 0x91B4, 0x0AEC,
+ 0x91B5, 0x91B5, 0x1F27, 0x91B6, 0x91BA, 0x0B18, 0x91BB, 0x91BB, 0x1E2E,
+ 0x91BC, 0x91CA, 0x0B1E, 0x91CB, 0x91CB, 0x1E2F, 0x91CC, 0x91D9, 0x0B2E,
+ 0x91DA, 0x91DA, 0x1E30, 0x91DB, 0x91E0, 0x0B3D, 0x91E1, 0x91E1, 0x1E31,
+ 0x91E2, 0x91EC, 0x0B44, 0x91ED, 0x91ED, 0x1E32, 0x91EE, 0x91FA, 0x0B50,
+ 0x91FB, 0x91FB, 0x1E35, 0x91FC, 0x91FC, 0x0B5E, 0x9240, 0x9245, 0x0B5F,
+ 0x9246, 0x9246, 0x1E36, 0x9247, 0x9247, 0x0B66, 0x9248, 0x9248, 0x1E37,
+ 0x9249, 0x924B, 0x0B68, 0x924C, 0x924D, 0x1E39, 0x924E, 0x925B, 0x0B6D,
+ 0x925C, 0x925C, 0x1E3B, 0x925D, 0x927E, 0x0B7C, 0x9280, 0x928F, 0x0B9E,
+ 0x9290, 0x9290, 0x1E3C, 0x9291, 0x9294, 0x0BAF, 0x9295, 0x9295, 0x1E3D,
+ 0x9296, 0x929B, 0x0BB4, 0x929C, 0x929C, 0x1E3E, 0x929D, 0x92BA, 0x0BBB,
+ 0x92BB, 0x92BB, 0x1E3F, 0x92BC, 0x92C5, 0x0BDA, 0x92C6, 0x92C6, 0x1E40,
+ 0x92C7, 0x92C7, 0x0BE5, 0x92C8, 0x92C8, 0x1E41, 0x92C9, 0x92CC, 0x0BE7,
+ 0x92CD, 0x92CD, 0x1E43, 0x92CE, 0x92FC, 0x0BEC, 0x9340, 0x9340, 0x0C1B,
+ 0x9341, 0x9341, 0x1E44, 0x9342, 0x9345, 0x0C1D, 0x9346, 0x9346, 0x1E45,
+ 0x9347, 0x934C, 0x0C22, 0x934D, 0x934D, 0x1E46, 0x934E, 0x9354, 0x0C29,
+ 0x9355, 0x9355, 0x1E47, 0x9356, 0x935D, 0x0C31, 0x935E, 0x935E, 0x1E48,
+ 0x935F, 0x9366, 0x0C3A, 0x9367, 0x9367, 0x1E49, 0x9368, 0x9369, 0x0C43,
+ 0x936A, 0x936A, 0x1E4A, 0x936B, 0x936F, 0x0C46, 0x9370, 0x9370, 0x1F28,
+ 0x9371, 0x9371, 0x1E4C, 0x9372, 0x937E, 0x0C4D, 0x9380, 0x9383, 0x0C5A,
+ 0x9384, 0x9384, 0x1E4D, 0x9385, 0x9397, 0x0C5F, 0x9398, 0x9398, 0x1E4E,
+ 0x9399, 0x93BF, 0x0C73, 0x93C0, 0x93C0, 0x1E50, 0x93C1, 0x93D1, 0x0C9B,
+ 0x93D2, 0x93D2, 0x1E51, 0x93D3, 0x93D8, 0x0CAD, 0x93D9, 0x93D9, 0x1E53,
+ 0x93DA, 0x93E3, 0x0CB4, 0x93E4, 0x93E5, 0x1E56, 0x93E6, 0x93E7, 0x0CC0,
+ 0x93E8, 0x93E8, 0x1E58, 0x93E9, 0x93F3, 0x0CC3, 0x93F4, 0x93F4, 0x1EC0,
+ 0x93F5, 0x93FC, 0x0CCF, 0x9440, 0x9447, 0x0CD7, 0x9448, 0x9448, 0x1E59,
+ 0x9449, 0x9449, 0x1F29, 0x944A, 0x9457, 0x0CE1, 0x9458, 0x9458, 0x1E5A,
+ 0x9459, 0x9475, 0x0CF0, 0x9476, 0x9476, 0x1E5B, 0x9477, 0x947E, 0x0D0E,
+ 0x9480, 0x9486, 0x0D16, 0x9487, 0x9487, 0x1E5C, 0x9488, 0x9488, 0x0D1E,
+ 0x9489, 0x9489, 0x1E5D, 0x948A, 0x948C, 0x0D20, 0x948D, 0x948D, 0x1E5E,
+ 0x948E, 0x94A1, 0x0D24, 0x94A2, 0x94A2, 0x1E5F, 0x94A3, 0x94AB, 0x0D39,
+ 0x94AC, 0x94AC, 0x1E60, 0x94AD, 0x94AD, 0x0D43, 0x94AE, 0x94AE, 0x1E61,
+ 0x94AF, 0x94BD, 0x0D45, 0x94BE, 0x94BE, 0x1F2A, 0x94BF, 0x94D1, 0x0D55,
+ 0x94D2, 0x94D2, 0x1E62, 0x94D3, 0x94F2, 0x0D69, 0x94F3, 0x94F3, 0x1E64,
+ 0x94F4, 0x94FC, 0x0D8A, 0x9540, 0x9540, 0x0D93, 0x9541, 0x9542, 0x1E65,
+ 0x9543, 0x954D, 0x0D96, 0x954E, 0x954E, 0x1E67, 0x954F, 0x9550, 0x0DA2,
+ 0x9551, 0x9551, 0x1E68, 0x9552, 0x9553, 0x0DA5, 0x9554, 0x9554, 0x1E69,
+ 0x9555, 0x955E, 0x0DA8, 0x955F, 0x955F, 0x1E6A, 0x9560, 0x956C, 0x0DB3,
+ 0x956D, 0x956D, 0x1E6B, 0x956E, 0x957E, 0x0DC1, 0x9580, 0x95C0, 0x0DD2,
+ 0x95C1, 0x95C1, 0x1E6D, 0x95C2, 0x95CA, 0x0E14, 0x95CB, 0x95CB, 0x1E6E,
+ 0x95CC, 0x95D0, 0x0E1E, 0x95D1, 0x95D1, 0x1F2B, 0x95D2, 0x95D7, 0x0E24,
+ 0x95D8, 0x95D8, 0x1E6F, 0x95D9, 0x95F6, 0x0E2B, 0x95F7, 0x95F7, 0x1E70,
+ 0x95F8, 0x95FC, 0x0E4A, 0x9640, 0x9647, 0x0E4F, 0x9648, 0x9648, 0x1E72,
+ 0x9649, 0x9669, 0x0E58, 0x966A, 0x966A, 0x1E73, 0x966B, 0x967E, 0x0E7A,
+ 0x9680, 0x968F, 0x0E8E, 0x9690, 0x9690, 0x1E74, 0x9691, 0x9697, 0x0E9F,
+ 0x9698, 0x9698, 0x1F2C, 0x9699, 0x96CA, 0x0EA7, 0x96CB, 0x96CB, 0x1E75,
+ 0x96CC, 0x96D6, 0x0EDA, 0x96D7, 0x96D7, 0x1E76, 0x96D8, 0x96DC, 0x0EE6,
+ 0x96DD, 0x96DD, 0x1E77, 0x96DE, 0x96DF, 0x0EEC, 0x96E0, 0x96E0, 0x1E78,
+ 0x96E1, 0x96F7, 0x0EEF, 0x96F8, 0x96F8, 0x1E79, 0x96F9, 0x96F9, 0x0F07,
+ 0x96FA, 0x96FA, 0x1E7A, 0x96FB, 0x96FC, 0x0F09, 0x9740, 0x9750, 0x0F0B,
+ 0x9751, 0x9751, 0x1E7C, 0x9752, 0x976E, 0x0F1D, 0x976F, 0x976F, 0x1E7D,
+ 0x9770, 0x9772, 0x0F3B, 0x9773, 0x9773, 0x1E7E, 0x9774, 0x977E, 0x0F3F,
+ 0x9780, 0x9788, 0x0F4A, 0x9789, 0x9789, 0x1E7F, 0x978A, 0x97F7, 0x0F54,
+ 0x97F8, 0x97F9, 0x1E81, 0x97FA, 0x97FA, 0x1F2D, 0x97FB, 0x97FC, 0x0FC5,
+ 0x9840, 0x9840, 0x1E83, 0x9841, 0x984F, 0x0FC8, 0x9850, 0x9850, 0x1E84,
+ 0x9851, 0x9857, 0x0FD8, 0x9858, 0x9858, 0x1E85, 0x9859, 0x9872, 0x0FE0,
+ 0x989F, 0x98FC, 0x0FFA, 0x9940, 0x9940, 0x1058, 0x9941, 0x9941, 0x1F2E,
+ 0x9942, 0x995B, 0x105A, 0x995C, 0x995C, 0x1E86, 0x995D, 0x996B, 0x1075,
+ 0x996C, 0x996C, 0x1E89, 0x996D, 0x997E, 0x1085, 0x9980, 0x99B5, 0x1097,
+ 0x99B6, 0x99B6, 0x1F2F, 0x99B7, 0x99FC, 0x10CE, 0x9A40, 0x9A4E, 0x1114,
+ 0x9A4F, 0x9A4F, 0x1E8A, 0x9A50, 0x9A58, 0x1124, 0x9A59, 0x9A59, 0x1E8B,
+ 0x9A5A, 0x9A66, 0x112E, 0x9A67, 0x9A67, 0x1F30, 0x9A68, 0x9A7C, 0x113C,
+ 0x9A7D, 0x9A7D, 0x1E8D, 0x9A7E, 0x9A7E, 0x1152, 0x9A80, 0x9A8A, 0x1153,
+ 0x9A8B, 0x9A8B, 0x1E8E, 0x9A8C, 0x9A8C, 0x1F31, 0x9A8D, 0x9AC1, 0x1160,
+ 0x9AC2, 0x9AC2, 0x1E8F, 0x9AC3, 0x9AC3, 0x1F32, 0x9AC4, 0x9AE9, 0x1197,
+ 0x9AEA, 0x9AEA, 0x1F33, 0x9AEB, 0x9AFC, 0x11BE, 0x9B40, 0x9B5B, 0x11D0,
+ 0x9B5C, 0x9B5C, 0x1E90, 0x9B5D, 0x9B7E, 0x11ED, 0x9B80, 0x9B82, 0x120F,
+ 0x9B83, 0x9B83, 0x1E91, 0x9B84, 0x9B97, 0x1213, 0x9B98, 0x9B98, 0x1F34,
+ 0x9B99, 0x9B9F, 0x1228, 0x9BA0, 0x9BA0, 0x1E92, 0x9BA1, 0x9BFA, 0x1230,
+ 0x9BFB, 0x9BFC, 0x1F35, 0x9C40, 0x9C7E, 0x128C, 0x9C80, 0x9CA1, 0x12CB,
+ 0x9CA2, 0x9CA2, 0x1E94, 0x9CA3, 0x9CFC, 0x12EE, 0x9D40, 0x9D46, 0x1348,
+ 0x9D47, 0x9D47, 0x1F37, 0x9D48, 0x9D7E, 0x1350, 0x9D80, 0x9D80, 0x1E95,
+ 0x9D81, 0x9D8B, 0x1388, 0x9D8C, 0x9D8C, 0x1E96, 0x9D8D, 0x9DB6, 0x1394,
+ 0x9DB7, 0x9DB7, 0x1E97, 0x9DB8, 0x9DF7, 0x13BF, 0x9DF8, 0x9DF8, 0x1F38,
+ 0x9DF9, 0x9DFC, 0x1400, 0x9E40, 0x9E63, 0x1404, 0x9E64, 0x9E64, 0x1E99,
+ 0x9E65, 0x9E7E, 0x1429, 0x9E80, 0x9E8A, 0x1443, 0x9E8B, 0x9E8B, 0x1E9B,
+ 0x9E8C, 0x9EFC, 0x144F, 0x9F40, 0x9F7E, 0x14C0, 0x9F80, 0x9F80, 0x14FF,
+ 0x9F81, 0x9F81, 0x1F39, 0x9F82, 0x9FCD, 0x1501, 0x9FCE, 0x9FCE, 0x1E9D,
+ 0x9FCF, 0x9FD3, 0x154E, 0x9FD4, 0x9FD4, 0x1F3A, 0x9FD5, 0x9FF3, 0x1554,
+ 0x9FF4, 0x9FF4, 0x1F3B, 0x9FF5, 0x9FFC, 0x1574, 0xE040, 0xE07E, 0x157C,
+ 0xE080, 0xE092, 0x15BB, 0xE093, 0xE093, 0x1E9E, 0xE094, 0xE0A3, 0x15CF,
+ 0xE0A4, 0xE0A4, 0x1E9F, 0xE0A5, 0xE0DC, 0x15E0, 0xE0DD, 0xE0DD, 0x1EA0,
+ 0xE0DE, 0xE0FC, 0x1619, 0xE140, 0xE149, 0x1638, 0xE14A, 0xE14A, 0x1EA1,
+ 0xE14B, 0xE17E, 0x1643, 0xE180, 0xE1EC, 0x1677, 0xE1ED, 0xE1ED, 0x1EA5,
+ 0xE1EE, 0xE1FC, 0x16E5, 0xE240, 0xE268, 0x16F4, 0xE269, 0xE269, 0x1EA6,
+ 0xE26A, 0xE272, 0x171E, 0xE273, 0xE273, 0x1EA7, 0xE274, 0xE277, 0x1728,
+ 0xE278, 0xE278, 0x1F3C, 0xE279, 0xE27E, 0x172D, 0xE280, 0xE2B6, 0x1733,
+ 0xE2B7, 0xE2B7, 0x1EA8, 0xE2B8, 0xE2BD, 0x176B, 0xE2BE, 0xE2BE, 0x1F3D,
+ 0xE2BF, 0xE2E1, 0x1772, 0xE2E2, 0xE2E2, 0x1EA9, 0xE2E3, 0xE2EB, 0x1796,
+ 0xE2EC, 0xE2EC, 0x1EAA, 0xE2ED, 0xE2FC, 0x17A0, 0xE340, 0xE357, 0x17B0,
+ 0xE358, 0xE358, 0x1EAB, 0xE359, 0xE359, 0x17C9, 0xE35A, 0xE35A, 0x1EAC,
+ 0xE35B, 0xE364, 0x17CB, 0xE365, 0xE365, 0x1EAD, 0xE366, 0xE37E, 0x17D6,
+ 0xE380, 0xE3C6, 0x17EF, 0xE3C7, 0xE3C7, 0x1F3E, 0xE3C8, 0xE3FC, 0x1837,
+ 0xE440, 0xE47E, 0x186C, 0xE480, 0xE483, 0x18AB, 0xE484, 0xE484, 0x1EAF,
+ 0xE485, 0xE488, 0x18B0, 0xE489, 0xE489, 0x1EB0, 0xE48A, 0xE491, 0x18B5,
+ 0xE492, 0xE492, 0x1EB1, 0xE493, 0xE4B8, 0x18BE, 0xE4B9, 0xE4B9, 0x1EB3,
+ 0xE4BA, 0xE4CA, 0x18E5, 0xE4CB, 0xE4CB, 0x1F3F, 0xE4CC, 0xE4FC, 0x18F7,
+ 0xE540, 0xE57E, 0x1928, 0xE580, 0xE59D, 0x1967, 0xE59E, 0xE59E, 0x1F40,
+ 0xE59F, 0xE5B9, 0x1986, 0xE5BA, 0xE5BB, 0x1F41, 0xE5BC, 0xE5EC, 0x19A3,
+ 0xE5ED, 0xE5ED, 0x1EB8, 0xE5EE, 0xE5FC, 0x19D5, 0xE640, 0xE650, 0x19E4,
+ 0xE651, 0xE651, 0x1EB9, 0xE652, 0xE67E, 0x19F6, 0xE680, 0xE685, 0x1A23,
+ 0xE686, 0xE686, 0x1EBA, 0xE687, 0xE6E6, 0x1A2A, 0xE6E7, 0xE6E7, 0x1EBC,
+ 0xE6E8, 0xE6FC, 0x1A8B, 0xE740, 0xE76C, 0x1AA0, 0xE76D, 0xE76D, 0x1EBE,
+ 0xE76E, 0xE77E, 0x1ACE, 0xE780, 0xE7A6, 0x1ADF, 0xE7A7, 0xE7A7, 0x1EC1,
+ 0xE7A8, 0xE7BA, 0x1B07, 0xE7BB, 0xE7BB, 0x1EC2, 0xE7BC, 0xE7FC, 0x1B1B,
+ 0xE840, 0xE87E, 0x1B5C, 0xE880, 0xE8CE, 0x1B9B, 0xE8CF, 0xE8CF, 0x1EC7,
+ 0xE8D0, 0xE8FC, 0x1BEB, 0xE940, 0xE977, 0x1C18, 0xE978, 0xE978, 0x1F43,
+ 0xE979, 0xE97E, 0x1C51, 0xE980, 0xE9AA, 0x1C57, 0xE9AB, 0xE9AB, 0x1ECA,
+ 0xE9AC, 0xE9B9, 0x1C83, 0xE9BA, 0xE9BA, 0x1ECB, 0xE9BB, 0xE9CB, 0x1C92,
+ 0xE9CC, 0xE9CC, 0x1ECC, 0xE9CD, 0xE9FC, 0x1CA4, 0xEA40, 0xEA6F, 0x1CD4,
+ 0xEA70, 0xEA70, 0x1ECD, 0xEA71, 0xEA71, 0x1F44, 0xEA72, 0xEA7E, 0x1D06,
+ 0xEA80, 0xEA9C, 0x1D13, 0xEA9D, 0xEA9D, 0x1ECE, 0xEA9E, 0xEAA2, 0x1D31,
+ 0xEAA3, 0xEAA4, 0x205C, 0xEC40, 0xEC42, 0x1F45, 0xEC46, 0xEC46, 0x1F48,
+ 0xEC47, 0xEC47, 0x0300, 0xEC48, 0xEC48, 0x02FA, 0xEC49, 0xEC49, 0x02F9,
+ 0xEC4D, 0xEC57, 0x1F49, 0xEC5B, 0xEC5D, 0x1DB1, 0xEC5E, 0xEC5E, 0x1F54,
+ 0xEC5F, 0xEC5F, 0x1DB7, 0xEC60, 0xEC62, 0x1F55, 0xEC63, 0xEC65, 0x1DB4,
+ 0xEC66, 0xEC6F, 0x1F58, 0xEC70, 0xEC70, 0x0303, 0xEC71, 0xEC71, 0x1F62,
+ 0xEC72, 0xEC72, 0x0304, 0xEC73, 0xEC74, 0x1F63, 0xEC76, 0xEC76, 0x1F65,
+ 0xEC78, 0xEC78, 0x1DA4, 0xEC79, 0xEC79, 0x1DA1, 0xEC7A, 0xEC7A, 0x1F66,
+ 0xEC7B, 0xEC7B, 0x1DA2, 0xEC7C, 0xEC7E, 0x1F67, 0xEC80, 0xEC80, 0x1DA6,
+ 0xEC81, 0xEC81, 0x1F6A, 0xEC82, 0xEC82, 0x1DA8, 0xEC83, 0xEC83, 0x1DAC,
+ 0xEC84, 0xEC84, 0x1F6B, 0xEC85, 0xEC85, 0x1DAE, 0xEC86, 0xEC86, 0x1DAB,
+ 0xEC87, 0xEC88, 0x1F6C, 0xEC89, 0xEC89, 0x1DAF, 0xEC8A, 0xEC90, 0x1F6E,
+ 0xEC94, 0xEC99, 0x1F75, 0xEC9A, 0xEC9A, 0x1DBA, 0xEC9B, 0xEC9B, 0x1F7B,
+ 0xEC9E, 0xEC9E, 0x1F7C, 0xECA7, 0xECB0, 0x1F7D, 0xECB2, 0xECC5, 0x1F87,
+ 0xECC7, 0xECDA, 0x1D83, 0xECDB, 0xECDB, 0x1F9B, 0xECDC, 0xECE5, 0x1D97,
+ 0xECE9, 0xECFC, 0x1F9C, 0xED40, 0xED59, 0x1FB0, 0xED64, 0xED64, 0x1F16,
+ 0xED68, 0xED69, 0x1FCA, 0xED6A, 0xED6A, 0x1DC4, 0xED6B, 0xED6D, 0x1FCC,
+ 0xED6E, 0xED6E, 0x1DC3, 0xED6F, 0xED73, 0x1FCF, 0xED74, 0xED74, 0x1DC2,
+ 0xED75, 0xED78, 0x1FD4, 0xED7C, 0xED7E, 0x1FD8, 0xED80, 0xED8A, 0x1FDB,
+ 0xED8F, 0xED9E, 0x1FE6, 0xEF40, 0xEF41, 0x1ECF, 0xEF42, 0xEF42, 0x204C,
+ 0xEF43, 0xEF43, 0x2052, 0xEF44, 0xEF4D, 0x1ED1, 0xEF4E, 0xEF4E, 0x205A,
+ 0xEF4F, 0xEF4F, 0x2053, 0xEF50, 0xEF50, 0x2058, 0xEF51, 0xEF51, 0x2055,
+ 0xEF52, 0xEF63, 0x1EDB, 0xEF64, 0xEF79, 0x1EEE, 0xEF7A, 0xEF7B, 0x2048,
+ 0xEF8D, 0xEF90, 0x02E0, 0xEF91, 0xEF94, 0x1FF6,
+};
diff --git a/core/src/fpdfapi/fpdf_cmaps/Japan1/Add-RKSJ-V_1.cpp b/core/src/fpdfapi/fpdf_cmaps/Japan1/Add-RKSJ-V_1.cpp
index 8736184dbe..c855911293 100644
--- a/core/src/fpdfapi/fpdf_cmaps/Japan1/Add-RKSJ-V_1.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/Japan1/Add-RKSJ-V_1.cpp
@@ -1,27 +1,27 @@
-// 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
-
-extern const unsigned short g_FXCMAP_Add_RKSJ_V_1[57 * 3] = {
- 0x8141, 0x8142, 0x1ECF, 0x8143, 0x8143, 0x204C, 0x8144, 0x8144, 0x2052,
- 0x8150, 0x8151, 0x1ED1, 0x815B, 0x815D, 0x1ED3, 0x8160, 0x8164, 0x1ED6,
- 0x8165, 0x8165, 0x205A, 0x8166, 0x8166, 0x2053, 0x8167, 0x8167, 0x2058,
- 0x8168, 0x8168, 0x2055, 0x8169, 0x817A, 0x1EDB, 0x829F, 0x829F, 0x1EEE,
- 0x82A1, 0x82A1, 0x1EEF, 0x82A3, 0x82A3, 0x1EF0, 0x82A5, 0x82A5, 0x1EF1,
- 0x82A7, 0x82A7, 0x1EF2, 0x82C1, 0x82C1, 0x1EF3, 0x82E1, 0x82E1, 0x1EF4,
- 0x82E3, 0x82E3, 0x1EF5, 0x82E5, 0x82E5, 0x1EF6, 0x82EC, 0x82EC, 0x1EF7,
- 0x82F3, 0x82F4, 0x2048, 0x8340, 0x8340, 0x1EF8, 0x8342, 0x8342, 0x1EF9,
- 0x8344, 0x8344, 0x1EFA, 0x8346, 0x8346, 0x1EFB, 0x8348, 0x8348, 0x1EFC,
- 0x8362, 0x8362, 0x1EFD, 0x8383, 0x8383, 0x1EFE, 0x8385, 0x8385, 0x1EFF,
- 0x8387, 0x8387, 0x1F00, 0x838E, 0x838E, 0x1F01, 0x8395, 0x8396, 0x1F02,
- 0xEC78, 0xEC78, 0x1F07, 0xEC79, 0xEC79, 0x1F04, 0xEC7A, 0xEC7A, 0x2089,
- 0xEC7B, 0xEC7B, 0x1F05, 0xEC7C, 0xEC7C, 0x208A, 0xEC7D, 0xEC7E, 0x2093,
- 0xEC80, 0xEC80, 0x1F09, 0xEC81, 0xEC81, 0x2092, 0xEC82, 0xEC82, 0x1F0B,
- 0xEC83, 0xEC83, 0x1F0F, 0xEC84, 0xEC84, 0x209C, 0xEC85, 0xEC85, 0x1F11,
- 0xEC86, 0xEC86, 0x1F0E, 0xEC87, 0xEC87, 0x2098, 0xEC88, 0xEC88, 0x209B,
- 0xEC89, 0xEC89, 0x1F12, 0xEC8A, 0xEC8A, 0x2097, 0xEC8B, 0xEC8C, 0x209D,
- 0xEC8D, 0xEC8D, 0x20A6, 0xEC8E, 0xEC8E, 0x20A5, 0xEC8F, 0xEC8F, 0x20A1,
- 0xEC90, 0xEC90, 0x20A4, 0xEC95, 0xEC95, 0x2084, 0xEF92, 0xEF92, 0x208D,
-};
+// 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
+
+extern const unsigned short g_FXCMAP_Add_RKSJ_V_1[57 * 3] = {
+ 0x8141, 0x8142, 0x1ECF, 0x8143, 0x8143, 0x204C, 0x8144, 0x8144, 0x2052,
+ 0x8150, 0x8151, 0x1ED1, 0x815B, 0x815D, 0x1ED3, 0x8160, 0x8164, 0x1ED6,
+ 0x8165, 0x8165, 0x205A, 0x8166, 0x8166, 0x2053, 0x8167, 0x8167, 0x2058,
+ 0x8168, 0x8168, 0x2055, 0x8169, 0x817A, 0x1EDB, 0x829F, 0x829F, 0x1EEE,
+ 0x82A1, 0x82A1, 0x1EEF, 0x82A3, 0x82A3, 0x1EF0, 0x82A5, 0x82A5, 0x1EF1,
+ 0x82A7, 0x82A7, 0x1EF2, 0x82C1, 0x82C1, 0x1EF3, 0x82E1, 0x82E1, 0x1EF4,
+ 0x82E3, 0x82E3, 0x1EF5, 0x82E5, 0x82E5, 0x1EF6, 0x82EC, 0x82EC, 0x1EF7,
+ 0x82F3, 0x82F4, 0x2048, 0x8340, 0x8340, 0x1EF8, 0x8342, 0x8342, 0x1EF9,
+ 0x8344, 0x8344, 0x1EFA, 0x8346, 0x8346, 0x1EFB, 0x8348, 0x8348, 0x1EFC,
+ 0x8362, 0x8362, 0x1EFD, 0x8383, 0x8383, 0x1EFE, 0x8385, 0x8385, 0x1EFF,
+ 0x8387, 0x8387, 0x1F00, 0x838E, 0x838E, 0x1F01, 0x8395, 0x8396, 0x1F02,
+ 0xEC78, 0xEC78, 0x1F07, 0xEC79, 0xEC79, 0x1F04, 0xEC7A, 0xEC7A, 0x2089,
+ 0xEC7B, 0xEC7B, 0x1F05, 0xEC7C, 0xEC7C, 0x208A, 0xEC7D, 0xEC7E, 0x2093,
+ 0xEC80, 0xEC80, 0x1F09, 0xEC81, 0xEC81, 0x2092, 0xEC82, 0xEC82, 0x1F0B,
+ 0xEC83, 0xEC83, 0x1F0F, 0xEC84, 0xEC84, 0x209C, 0xEC85, 0xEC85, 0x1F11,
+ 0xEC86, 0xEC86, 0x1F0E, 0xEC87, 0xEC87, 0x2098, 0xEC88, 0xEC88, 0x209B,
+ 0xEC89, 0xEC89, 0x1F12, 0xEC8A, 0xEC8A, 0x2097, 0xEC8B, 0xEC8C, 0x209D,
+ 0xEC8D, 0xEC8D, 0x20A6, 0xEC8E, 0xEC8E, 0x20A5, 0xEC8F, 0xEC8F, 0x20A1,
+ 0xEC90, 0xEC90, 0x20A4, 0xEC95, 0xEC95, 0x2084, 0xEF92, 0xEF92, 0x208D,
+};
diff --git a/core/src/fpdfapi/fpdf_cmaps/Japan1/Adobe-Japan1-UCS2_4.cpp b/core/src/fpdfapi/fpdf_cmaps/Japan1/Adobe-Japan1-UCS2_4.cpp
index e0080a1059..3454537273 100644
--- a/core/src/fpdfapi/fpdf_cmaps/Japan1/Adobe-Japan1-UCS2_4.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/Japan1/Adobe-Japan1-UCS2_4.cpp
@@ -1,1939 +1,1939 @@
-// 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
-
-extern const unsigned short g_FXCMAP_Japan1CID2Unicode_4[15444] = {
- 0xFFFD, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026,
- 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E,
- 0x002F, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036,
- 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E,
- 0x003F, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046,
- 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E,
- 0x004F, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056,
- 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x00A5, 0x005D, 0x005E,
- 0x005F, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066,
- 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E,
- 0x006F, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076,
- 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x00A6, 0x007D, 0x0303,
- 0x02BC, 0x005C, 0x02BB, 0x007C, 0x007E, 0x00A1, 0x00A2, 0x00A3,
- 0x2044, 0x0192, 0x00A7, 0x00A4, 0x201C, 0x00AB, 0x2039, 0x203A,
- 0xFB01, 0xFB02, 0x2012, 0x2020, 0x2021, 0x00B7, 0x00B6, 0x2022,
- 0x201A, 0x201E, 0x201D, 0x00BB, 0x2026, 0x2030, 0x00BF, 0x0301,
- 0x0302, 0x00AF, 0x0306, 0x0307, 0x0308, 0x030A, 0x00B8, 0x030B,
- 0x0328, 0x030C, 0x0336, 0x00C6, 0x00AA, 0x0141, 0x00D8, 0x0152,
- 0x00BA, 0x00E6, 0x0131, 0x0142, 0x00F8, 0x0153, 0x00DF, 0x002D,
- 0x00A9, 0x00AC, 0x00AE, 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B5,
- 0x00B9, 0x00BC, 0x00BD, 0x00BE, 0x00C0, 0x00C1, 0x00C2, 0x00C3,
- 0x00C4, 0x00C5, 0x00C7, 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC,
- 0x00CD, 0x00CE, 0x00CF, 0x00D0, 0x00D1, 0x00D2, 0x00D3, 0x00D4,
- 0x00D5, 0x00D6, 0x00D7, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x00DD,
- 0x00DE, 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E7,
- 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF,
- 0x00F0, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7,
- 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x00FF, 0x0160,
- 0x0178, 0x017D, 0x0305, 0x0161, 0x2122, 0x017E, 0x0030, 0x0020,
- 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028,
- 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 0x0030,
- 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038,
- 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 0x0040,
- 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048,
- 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050,
- 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058,
- 0x0059, 0x005A, 0x005B, 0x00A5, 0x005D, 0x005E, 0x005F, 0x0060,
- 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068,
- 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070,
- 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078,
- 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x203E, 0xFF60, 0xFF61,
- 0xFF62, 0xFF63, 0xFF64, 0xFF65, 0xFF66, 0xFF67, 0xFF68, 0xFF69,
- 0xFF6A, 0xFF6B, 0xFF6C, 0xFF6D, 0xFF6E, 0xFF6F, 0xFF70, 0xFF71,
- 0xFF72, 0xFF73, 0xFF74, 0xFF75, 0xFF76, 0xFF77, 0xFF78, 0xFF79,
- 0xFF7A, 0xFF7B, 0xFF7C, 0xFF7D, 0xFF7E, 0xFF7F, 0xFF80, 0xFF81,
- 0xFF82, 0xFF83, 0xFF84, 0xFF85, 0xFF86, 0xFF87, 0xFF88, 0xFF89,
- 0xFF8A, 0xFF8B, 0xFF8C, 0xFF8D, 0xFF8E, 0xFF8F, 0xFF90, 0xFF91,
- 0xFF92, 0xFF93, 0xFF94, 0xFF95, 0xFF96, 0xFF97, 0xFF98, 0xFF99,
- 0xFF9A, 0xFF9B, 0xFF9C, 0xFF9D, 0xFF9E, 0xFF9F, 0xFF40, 0x30F0,
- 0x30F1, 0x30EE, 0x30AB, 0x30B1, 0x30F4, 0x30AC, 0x30AE, 0x30B0,
- 0x30B2, 0x30B4, 0x30B6, 0x30B8, 0x30BA, 0x30BC, 0x30BE, 0x30C0,
- 0x30C2, 0x30C5, 0x30C7, 0x30C9, 0x30D0, 0x30D1, 0x30D3, 0x30D4,
- 0x30D6, 0x30D7, 0x30D9, 0x30DA, 0x30DC, 0x30DD, 0xFF60, 0x301D,
- 0x301E, 0x2500, 0x2501, 0x2502, 0x2503, 0x2504, 0x2505, 0x2506,
- 0x2507, 0x2508, 0x2509, 0x250A, 0x250B, 0x250C, 0x250D, 0x250E,
- 0x250F, 0x2510, 0x2511, 0x2512, 0x2513, 0x2514, 0x2515, 0x2516,
- 0x2517, 0x2518, 0x2519, 0x251A, 0x251B, 0x251C, 0x251D, 0x251E,
- 0x251F, 0x2520, 0x2521, 0x2522, 0x2523, 0x2524, 0x2525, 0x2526,
- 0x2527, 0x2528, 0x2529, 0x252A, 0x252B, 0x252C, 0x252D, 0x252E,
- 0x252F, 0x2530, 0x2531, 0x2532, 0x2533, 0x2534, 0x2535, 0x2536,
- 0x2537, 0x2538, 0x2539, 0x253A, 0x253B, 0x253C, 0x253D, 0x253E,
- 0x253F, 0x2540, 0x2541, 0x2542, 0x2543, 0x2544, 0x2545, 0x2546,
- 0x2547, 0x2548, 0x2549, 0x254A, 0x254B, 0x2032, 0x00A8, 0x2036,
- 0x005B, 0x005D, 0x3008, 0x3009, 0x300A, 0x300B, 0x300E, 0x300F,
- 0x3010, 0x3011, 0x2012, 0xFF60, 0x3092, 0x3041, 0x3043, 0x3045,
- 0x3047, 0x3049, 0x3083, 0x3085, 0x3087, 0x3063, 0x3042, 0x3044,
- 0x3046, 0x3048, 0x304A, 0x304B, 0x304D, 0x304F, 0x3051, 0x3053,
- 0x3055, 0x3057, 0x3059, 0x305B, 0x305D, 0x305F, 0x3061, 0x3064,
- 0x3066, 0x3068, 0x306A, 0x306B, 0x306C, 0x306D, 0x306E, 0x306F,
- 0x3072, 0x3075, 0x3078, 0x307B, 0x307E, 0x307F, 0x3080, 0x3081,
- 0x3082, 0x3084, 0x3086, 0x3088, 0x3089, 0x308A, 0x308B, 0x308C,
- 0x308D, 0x308F, 0x3093, 0x3090, 0x3091, 0x308E, 0x304C, 0x304E,
- 0x3050, 0x3052, 0x3054, 0x3056, 0x3068, 0x305A, 0x305C, 0x305E,
- 0x3060, 0x3062, 0x3065, 0x3067, 0x3069, 0x3070, 0x3071, 0x3073,
- 0x3074, 0x3076, 0x3077, 0x3079, 0x307A, 0x307C, 0x307D, 0x00C4,
- 0x00F9, 0x00E9, 0x00ED, 0x00DF, 0x00E7, 0x00C7, 0x00D1, 0x00F1,
- 0x00A2, 0x00A3, 0x00F3, 0x00FA, 0x00A1, 0x00BF, 0x00BD, 0x00D6,
- 0x00DC, 0x00E4, 0x00EB, 0x00EF, 0x00F6, 0x00DC, 0x00E2, 0x00EA,
- 0x00EE, 0x00F4, 0x00FC, 0x00E0, 0x00E9, 0x25B2, 0x00E1, 0x007E,
- 0x0030, 0x3000, 0x3001, 0x3002, 0xFF0C, 0xFF0E, 0x30FB, 0xFF1A,
- 0xFF1B, 0xFF1F, 0xFF01, 0x309B, 0x309C, 0x00B4, 0xFF40, 0x00A8,
- 0xFF3E, 0x203E, 0xFF3F, 0x30FD, 0x30FE, 0x309D, 0x309E, 0x3003,
- 0x4EDD, 0x3005, 0x3006, 0x3007, 0x30FC, 0x2015, 0x2010, 0xFF0F,
- 0xFF3C, 0xFF5E, 0x2016, 0xFF5C, 0x2026, 0x2025, 0x2018, 0x2019,
- 0x201C, 0x201D, 0xFF08, 0xFF09, 0x3014, 0x3015, 0xFF3B, 0xFF3D,
- 0xFF5B, 0xFF5D, 0x3008, 0x3009, 0x300A, 0x300B, 0x300C, 0x300D,
- 0x300E, 0x300F, 0x3010, 0x3011, 0xFF0B, 0xFF0D, 0x00B1, 0x00D7,
- 0x00F7, 0xFF1D, 0x2260, 0xFF1C, 0xFF1E, 0x2266, 0x2267, 0x221E,
- 0x2234, 0x2642, 0x2640, 0x00B0, 0x2032, 0x2033, 0x2103, 0xFFE5,
- 0xFF04, 0x00A2, 0x00A3, 0xFF05, 0xFF03, 0xFF06, 0xFF0A, 0xFF20,
- 0x00A7, 0x2606, 0x2605, 0x25CB, 0x25CF, 0x25CE, 0x25C7, 0x25C6,
- 0x25A1, 0x25A0, 0x25B3, 0x25B2, 0x25BD, 0x25BC, 0x203B, 0x3012,
- 0x2192, 0x2190, 0x2191, 0x2193, 0x3013, 0x2208, 0x220B, 0x2286,
- 0x2287, 0x2282, 0x2283, 0x222A, 0x2229, 0x2227, 0x2228, 0x00AC,
- 0x21D2, 0x21D4, 0x2200, 0x2203, 0x2220, 0x22A5, 0x2312, 0x2202,
- 0x2207, 0x2261, 0x2252, 0x226A, 0x226B, 0x221A, 0x223D, 0x221D,
- 0x2235, 0x222B, 0x222C, 0x212B, 0x2030, 0x266F, 0x266D, 0x266A,
- 0x2020, 0x2021, 0x00B6, 0x25EF, 0xFF10, 0xFF11, 0xFF12, 0xFF13,
- 0xFF14, 0xFF15, 0xFF16, 0xFF17, 0xFF18, 0xFF19, 0xFF21, 0xFF22,
- 0xFF23, 0xFF24, 0xFF25, 0xFF26, 0xFF27, 0xFF28, 0xFF29, 0xFF2A,
- 0xFF2B, 0xFF2C, 0xFF2D, 0xFF2E, 0xFF2F, 0xFF30, 0xFF31, 0xFF32,
- 0xFF33, 0xFF34, 0xFF35, 0xFF36, 0xFF37, 0xFF38, 0xFF39, 0xFF3A,
- 0xFF41, 0xFF42, 0xFF43, 0xFF44, 0xFF45, 0xFF46, 0xFF47, 0xFF48,
- 0xFF49, 0xFF4A, 0xFF4B, 0xFF4C, 0xFF4D, 0xFF4E, 0xFF4F, 0xFF50,
- 0xFF51, 0xFF52, 0xFF53, 0xFF54, 0xFF55, 0xFF56, 0xFF57, 0xFF58,
- 0xFF59, 0xFF5A, 0x3041, 0x3042, 0x3043, 0x3044, 0x3045, 0x3046,
- 0x3047, 0x3048, 0x3049, 0x304A, 0x304B, 0x304C, 0x304D, 0x304E,
- 0x304F, 0x3050, 0x3051, 0x3052, 0x3053, 0x3054, 0x3055, 0x3056,
- 0x3057, 0x3058, 0x3059, 0x305A, 0x305B, 0x305C, 0x305D, 0x305E,
- 0x305F, 0x3060, 0x3061, 0x3062, 0x3063, 0x3064, 0x3065, 0x3066,
- 0x3067, 0x3068, 0x3069, 0x306A, 0x306B, 0x306C, 0x306D, 0x306E,
- 0x306F, 0x3070, 0x3071, 0x3072, 0x3073, 0x3074, 0x3075, 0x3076,
- 0x3077, 0x3078, 0x3079, 0x307A, 0x307B, 0x307C, 0x307D, 0x307E,
- 0x307F, 0x3080, 0x3081, 0x3082, 0x3083, 0x3084, 0x3085, 0x3086,
- 0x3087, 0x3088, 0x3089, 0x308A, 0x308B, 0x308C, 0x308D, 0x308E,
- 0x308F, 0x3090, 0x3091, 0x3092, 0x3093, 0x30A1, 0x30A2, 0x30A3,
- 0x30A4, 0x30A5, 0x30A6, 0x30A7, 0x30A8, 0x30A9, 0x30AA, 0x30AB,
- 0x30AC, 0x30AD, 0x30AE, 0x30AF, 0x30B0, 0x30B1, 0x30B2, 0x30B3,
- 0x30B4, 0x30B5, 0x30B6, 0x30B7, 0x30B8, 0x30B9, 0x30BA, 0x30BB,
- 0x30BC, 0x30BD, 0x30BE, 0x30BF, 0x30C0, 0x30C1, 0x30C2, 0x30C3,
- 0x30C4, 0x30C5, 0x30C6, 0x30C7, 0x30C8, 0x30C9, 0x30CA, 0x30CB,
- 0x30CC, 0x30CD, 0x30CE, 0x30CF, 0x30D0, 0x30D1, 0x30D2, 0x30D3,
- 0x30D4, 0x30D5, 0x30D6, 0x30D7, 0x30D8, 0x30D9, 0x30DA, 0x30DB,
- 0x30DC, 0x30DD, 0x30DE, 0x30DF, 0x30E0, 0x30E1, 0x30E2, 0x30E3,
- 0x30E4, 0x30E5, 0x30E6, 0x30E7, 0x30E8, 0x30E9, 0x30EA, 0x30EB,
- 0x30EC, 0x30ED, 0x30EE, 0x30EF, 0x30F0, 0x30F1, 0x30F2, 0x30F3,
- 0x30F4, 0x30F5, 0x30F6, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395,
- 0x0396, 0x0397, 0x0398, 0x0399, 0x039A, 0x039B, 0x039C, 0x039D,
- 0x039E, 0x039F, 0x03A0, 0x03A1, 0x03A3, 0x03A4, 0x03A5, 0x03A6,
- 0x03A7, 0x03A8, 0x03A9, 0x03B1, 0x03B2, 0x03B3, 0x03B4, 0x03B5,
- 0x03B6, 0x03B7, 0x03B8, 0x03B9, 0x03BA, 0x03BB, 0x03BC, 0x03BD,
- 0x03BE, 0x03BF, 0x03C0, 0x03C1, 0x03C3, 0x03C4, 0x03C5, 0x03C6,
- 0x03C7, 0x03C8, 0x03C9, 0x0410, 0x0411, 0x0412, 0x0413, 0x0414,
- 0x0415, 0x0401, 0x0416, 0x0417, 0x0418, 0x0419, 0x041A, 0x041B,
- 0x041C, 0x041D, 0x041E, 0x041F, 0x0420, 0x0421, 0x0422, 0x0423,
- 0x0424, 0x0425, 0x0426, 0x0427, 0x0428, 0x0429, 0x042A, 0x042B,
- 0x042C, 0x042D, 0x042E, 0x042F, 0x0430, 0x0431, 0x0432, 0x0433,
- 0x0434, 0x0435, 0x0451, 0x0436, 0x0437, 0x0438, 0x0439, 0x043A,
- 0x043B, 0x043C, 0x043D, 0x043E, 0x043F, 0x0440, 0x0441, 0x0442,
- 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, 0x0448, 0x0449, 0x044A,
- 0x044B, 0x044C, 0x044D, 0x044E, 0x044F, 0x4E9C, 0x5516, 0x5A03,
- 0x963F, 0x54C0, 0x611B, 0x6328, 0x59F6, 0x9022, 0x8475, 0x831C,
- 0x7A50, 0x60AA, 0x63E1, 0x6E25, 0x65ED, 0x8466, 0x82A6, 0x9BF5,
- 0x6893, 0x5727, 0x65A1, 0x6271, 0x5B9B, 0x59D0, 0x867B, 0x98F4,
- 0x7D62, 0x7DBE, 0x9B8E, 0x6216, 0x7C9F, 0x88B7, 0x5B89, 0x5EB5,
- 0x6309, 0x6697, 0x6848, 0x95C7, 0x978D, 0x674F, 0x4EE5, 0x4F0A,
- 0x4F4D, 0x4F9D, 0x5049, 0x56F2, 0x5937, 0x59D4, 0x5A01, 0x5C09,
- 0x60DF, 0x610F, 0x6170, 0x6613, 0x6905, 0x70BA, 0x754F, 0x7570,
- 0x79FB, 0x7DAD, 0x7DEF, 0x80C3, 0x840E, 0x8863, 0x8B02, 0x9055,
- 0x907A, 0x533B, 0x4E95, 0x4EA5, 0x57DF, 0x80B2, 0x90C1, 0x78EF,
- 0x4E00, 0x58F1, 0x6EA2, 0x9038, 0x7A32, 0x8328, 0x828B, 0x9C2F,
- 0x5141, 0x5370, 0x54BD, 0x54E1, 0x56E0, 0x59FB, 0x5F15, 0x98F2,
- 0x6DEB, 0x80E4, 0x852D, 0x9662, 0x9670, 0x96A0, 0x97FB, 0x540B,
- 0x53F3, 0x5B87, 0x70CF, 0x7FBD, 0x8FC2, 0x96E8, 0x536F, 0x9D5C,
- 0x7ABA, 0x4E11, 0x7893, 0x81FC, 0x6E26, 0x5618, 0x5504, 0x6B1D,
- 0x851A, 0x9C3B, 0x59E5, 0x53A9, 0x6D66, 0x74DC, 0x958F, 0x5642,
- 0x4E91, 0x904B, 0x96F2, 0x834F, 0x990C, 0x53E1, 0x55B6, 0x5B30,
- 0x5F71, 0x6620, 0x66F3, 0x6804, 0x6C38, 0x6CF3, 0x6D29, 0x745B,
- 0x76C8, 0x7A4E, 0x9834, 0x82F1, 0x885B, 0x8A60, 0x92ED, 0x6DB2,
- 0x75AB, 0x76CA, 0x99C5, 0x60A6, 0x8B01, 0x8D8A, 0x95B2, 0x698E,
- 0x53AD, 0x5186, 0x5712, 0x5830, 0x5944, 0x5BB4, 0x5EF6, 0x6028,
- 0x63A9, 0x63F4, 0x6CBF, 0x6F14, 0x708E, 0x7114, 0x7159, 0x71D5,
- 0x733F, 0x7E01, 0x8276, 0x82D1, 0x8597, 0x9060, 0x925B, 0x9D1B,
- 0x5869, 0x65BC, 0x6C5A, 0x7525, 0x51F9, 0x592E, 0x5965, 0x5F80,
- 0x5FDC, 0x62BC, 0x65FA, 0x6A2A, 0x6B27, 0x6BB4, 0x738B, 0x7FC1,
- 0x8956, 0x9D2C, 0x9D0E, 0x9EC4, 0x5CA1, 0x6C96, 0x837B, 0x5104,
- 0x5C4B, 0x61B6, 0x81C6, 0x6876, 0x7261, 0x4E59, 0x4FFA, 0x5378,
- 0x6069, 0x6E29, 0x7A4F, 0x97F3, 0x4E0B, 0x5316, 0x4EEE, 0x4F55,
- 0x4F3D, 0x4FA1, 0x4F73, 0x52A0, 0x53EF, 0x5609, 0x590F, 0x5AC1,
- 0x5BB6, 0x5BE1, 0x79D1, 0x6687, 0x679C, 0x67B6, 0x6B4C, 0x6CB3,
- 0x706B, 0x73C2, 0x798D, 0x79BE, 0x7A3C, 0x7B87, 0x82B1, 0x82DB,
- 0x8304, 0x8377, 0x83EF, 0x83D3, 0x8766, 0x8AB2, 0x5629, 0x8CA8,
- 0x8FE6, 0x904E, 0x971E, 0x868A, 0x4FC4, 0x5CE8, 0x6211, 0x7259,
- 0x753B, 0x81E5, 0x82BD, 0x86FE, 0x8CC0, 0x96C5, 0x9913, 0x99D5,
- 0x4ECB, 0x4F1A, 0x89E3, 0x56DE, 0x584A, 0x58CA, 0x5EFB, 0x5FEB,
- 0x602A, 0x6094, 0x6062, 0x61D0, 0x6212, 0x62D0, 0x6539, 0x9B41,
- 0x6666, 0x68B0, 0x6D77, 0x7070, 0x754C, 0x7686, 0x7D75, 0x82A5,
- 0x87F9, 0x958B, 0x968E, 0x8C9D, 0x51F1, 0x52BE, 0x5916, 0x54B3,
- 0x5BB3, 0x5D16, 0x6168, 0x6982, 0x6DAF, 0x788D, 0x84CB, 0x8857,
- 0x8A72, 0x93A7, 0x9AB8, 0x6D6C, 0x99A8, 0x86D9, 0x57A3, 0x67FF,
- 0x86CE, 0x920E, 0x5283, 0x5687, 0x5404, 0x5ED3, 0x62E1, 0x64B9,
- 0x683C, 0x6838, 0x6BBB, 0x7372, 0x78BA, 0x7A6B, 0x899A, 0x89D2,
- 0x8D6B, 0x8F03, 0x90ED, 0x95A3, 0x9694, 0x9769, 0x5B66, 0x5CB3,
- 0x697D, 0x984D, 0x984E, 0x639B, 0x7B20, 0x6A2B, 0x6A7F, 0x68B6,
- 0x9C0D, 0x6F5F, 0x5272, 0x559D, 0x6070, 0x62EC, 0x6D3B, 0x6E07,
- 0x6ED1, 0x845B, 0x8910, 0x8F44, 0x4E14, 0x9C39, 0x53F6, 0x691B,
- 0x6A3A, 0x9784, 0x682A, 0x515C, 0x7AC3, 0x84B2, 0x91DC, 0x938C,
- 0x565B, 0x9D28, 0x6822, 0x8305, 0x8431, 0x7CA5, 0x5208, 0x82C5,
- 0x74E6, 0x4E7E, 0x4F83, 0x51A0, 0x5BD2, 0x520A, 0x52D8, 0x52E7,
- 0x5DFB, 0x559A, 0x582A, 0x59E6, 0x5B8C, 0x5B98, 0x5BDB, 0x5E72,
- 0x5E79, 0x60A3, 0x611F, 0x6163, 0x61BE, 0x63DB, 0x6562, 0x67D1,
- 0x6853, 0x68FA, 0x6B3E, 0x6B53, 0x6C57, 0x6F22, 0x6F97, 0x6F45,
- 0x74B0, 0x7518, 0x76E3, 0x770B, 0x7AFF, 0x7BA1, 0x7C21, 0x7DE9,
- 0x7F36, 0x7FF0, 0x809D, 0x8266, 0x839E, 0x89B3, 0x8ACC, 0x8CAB,
- 0x9084, 0x9451, 0x9593, 0x9591, 0x95A2, 0x9665, 0x97D3, 0x9928,
- 0x8218, 0x4E38, 0x542B, 0x5CB8, 0x5DCC, 0x73A9, 0x764C, 0x773C,
- 0x5CA9, 0x7FEB, 0x8D0B, 0x96C1, 0x9811, 0x9854, 0x9858, 0x4F01,
- 0x4F0E, 0x5371, 0x559C, 0x5668, 0x57FA, 0x5947, 0x5B09, 0x5BC4,
- 0x5C90, 0x5E0C, 0x5E7E, 0x5FCC, 0x63EE, 0x673A, 0x65D7, 0x65E2,
- 0x671F, 0x68CB, 0x68C4, 0x6A5F, 0x5E30, 0x6BC5, 0x6C17, 0x6C7D,
- 0x757F, 0x7948, 0x5B63, 0x7A00, 0x7D00, 0x5FBD, 0x898F, 0x8A18,
- 0x8CB4, 0x8D77, 0x8ECC, 0x8F1D, 0x98E2, 0x9A0E, 0x9B3C, 0x4E80,
- 0x507D, 0x5100, 0x5993, 0x5B9C, 0x622F, 0x6280, 0x64EC, 0x6B3A,
- 0x72A0, 0x7591, 0x7947, 0x7FA9, 0x87FB, 0x8ABC, 0x8B70, 0x63AC,
- 0x83CA, 0x97A0, 0x5409, 0x5403, 0x55AB, 0x6854, 0x6A58, 0x8A70,
- 0x7827, 0x6775, 0x9ECD, 0x5374, 0x5BA2, 0x811A, 0x8650, 0x9006,
- 0x4E18, 0x4E45, 0x4EC7, 0x4F11, 0x53CA, 0x5438, 0x5BAE, 0x5F13,
- 0x6025, 0x6551, 0x673D, 0x6C42, 0x6C72, 0x6CE3, 0x7078, 0x7403,
- 0x7A76, 0x7AAE, 0x7B08, 0x7D1A, 0x7CFE, 0x7D66, 0x65E7, 0x725B,
- 0x53BB, 0x5C45, 0x5DE8, 0x62D2, 0x62E0, 0x6319, 0x6E20, 0x865A,
- 0x8A31, 0x8DDD, 0x92F8, 0x6F01, 0x79A6, 0x9B5A, 0x4EA8, 0x4EAB,
- 0x4EAC, 0x4F9B, 0x4FA0, 0x50D1, 0x5147, 0x7AF6, 0x5171, 0x51F6,
- 0x5354, 0x5321, 0x537F, 0x53EB, 0x55AC, 0x5883, 0x5CE1, 0x5F37,
- 0x5F4A, 0x602F, 0x6050, 0x606D, 0x631F, 0x6559, 0x6A4B, 0x6CC1,
- 0x72C2, 0x72ED, 0x77EF, 0x80F8, 0x8105, 0x8208, 0x854E, 0x90F7,
- 0x93E1, 0x97FF, 0x9957, 0x9A5A, 0x4EF0, 0x51DD, 0x5C2D, 0x6681,
- 0x696D, 0x5C40, 0x66F2, 0x6975, 0x7389, 0x6850, 0x7C81, 0x50C5,
- 0x52E4, 0x5747, 0x5DFE, 0x9326, 0x65A4, 0x6B23, 0x6B3D, 0x7434,
- 0x7981, 0x79BD, 0x7B4B, 0x7DCA, 0x82B9, 0x83CC, 0x887F, 0x895F,
- 0x8B39, 0x8FD1, 0x91D1, 0x541F, 0x9280, 0x4E5D, 0x5036, 0x53E5,
- 0x533A, 0x72D7, 0x7396, 0x77E9, 0x82E6, 0x8EAF, 0x99C6, 0x99C8,
- 0x99D2, 0x5177, 0x611A, 0x865E, 0x55B0, 0x7A7A, 0x5076, 0x5BD3,
- 0x9047, 0x9685, 0x4E32, 0x6ADB, 0x91E7, 0x5C51, 0x5C48, 0x6398,
- 0x7A9F, 0x6C93, 0x9774, 0x8F61, 0x7AAA, 0x718A, 0x9688, 0x7C82,
- 0x6817, 0x7E70, 0x6851, 0x936C, 0x52F2, 0x541B, 0x85AB, 0x8A13,
- 0x7FA4, 0x8ECD, 0x90E1, 0x5366, 0x8888, 0x7941, 0x4FC2, 0x50BE,
- 0x5211, 0x5144, 0x5553, 0x572D, 0x73EA, 0x578B, 0x5951, 0x5F62,
- 0x5F84, 0x6075, 0x6176, 0x6167, 0x61A9, 0x63B2, 0x643A, 0x656C,
- 0x666F, 0x6842, 0x6E13, 0x7566, 0x7A3D, 0x7CFB, 0x7D4C, 0x7D99,
- 0x7E4B, 0x7F6B, 0x830E, 0x834A, 0x86CD, 0x8A08, 0x8A63, 0x8B66,
- 0x8EFD, 0x981A, 0x9D8F, 0x82B8, 0x8FCE, 0x9BE8, 0x5287, 0x621F,
- 0x6483, 0x6FC0, 0x9699, 0x6841, 0x5091, 0x6B20, 0x6C7A, 0x6F54,
- 0x7A74, 0x7D50, 0x8840, 0x8A23, 0x6708, 0x4EF6, 0x5039, 0x5026,
- 0x5065, 0x517C, 0x5238, 0x5263, 0x55A7, 0x570F, 0x5805, 0x5ACC,
- 0x5EFA, 0x61B2, 0x61F8, 0x62F3, 0x6372, 0x691C, 0x6A29, 0x727D,
- 0x72AC, 0x732E, 0x7814, 0x786F, 0x7D79, 0x770C, 0x80A9, 0x898B,
- 0x8B19, 0x8CE2, 0x8ED2, 0x9063, 0x9375, 0x967A, 0x9855, 0x9A13,
- 0x9E78, 0x5143, 0x539F, 0x53B3, 0x5E7B, 0x5F26, 0x6E1B, 0x6E90,
- 0x7384, 0x73FE, 0x7D43, 0x8237, 0x8A00, 0x8AFA, 0x9650, 0x4E4E,
- 0x500B, 0x53E4, 0x547C, 0x56FA, 0x59D1, 0x5B64, 0x5DF1, 0x5EAB,
- 0x5F27, 0x6238, 0x6545, 0x67AF, 0x6E56, 0x72D0, 0x7CCA, 0x88B4,
- 0x80A1, 0x80E1, 0x83F0, 0x864E, 0x8A87, 0x8DE8, 0x9237, 0x96C7,
- 0x9867, 0x9F13, 0x4E94, 0x4E92, 0x4F0D, 0x5348, 0x5449, 0x543E,
- 0x5A2F, 0x5F8C, 0x5FA1, 0x609F, 0x68A7, 0x6A8E, 0x745A, 0x7881,
- 0x8A9E, 0x8AA4, 0x8B77, 0x9190, 0x4E5E, 0x9BC9, 0x4EA4, 0x4F7C,
- 0x4FAF, 0x5019, 0x5016, 0x5149, 0x516C, 0x529F, 0x52B9, 0x52FE,
- 0x539A, 0x53E3, 0x5411, 0x540E, 0x5589, 0x5751, 0x57A2, 0x597D,
- 0x5B54, 0x5B5D, 0x5B8F, 0x5DE5, 0x5DE7, 0x5DF7, 0x5E78, 0x5E83,
- 0x5E9A, 0x5EB7, 0x5F18, 0x6052, 0x614C, 0x6297, 0x62D8, 0x63A7,
- 0x653B, 0x6602, 0x6643, 0x66F4, 0x676D, 0x6821, 0x6897, 0x69CB,
- 0x6C5F, 0x6D2A, 0x6D69, 0x6E2F, 0x6E9D, 0x7532, 0x7687, 0x786C,
- 0x7A3F, 0x7CE0, 0x7D05, 0x7D18, 0x7D5E, 0x7DB1, 0x8015, 0x8003,
- 0x80AF, 0x80B1, 0x8154, 0x818F, 0x822A, 0x8352, 0x884C, 0x8861,
- 0x8B1B, 0x8CA2, 0x8CFC, 0x90CA, 0x9175, 0x9271, 0x783F, 0x92FC,
- 0x95A4, 0x964D, 0x9805, 0x9999, 0x9AD8, 0x9D3B, 0x525B, 0x52AB,
- 0x53F7, 0x5408, 0x58D5, 0x62F7, 0x6FE0, 0x8C6A, 0x8F5F, 0x9EB9,
- 0x514B, 0x523B, 0x544A, 0x56FD, 0x7A40, 0x9177, 0x9D60, 0x9ED2,
- 0x7344, 0x6F09, 0x8170, 0x7511, 0x5FFD, 0x60DA, 0x9AA8, 0x72DB,
- 0x8FBC, 0x6B64, 0x9803, 0x4ECA, 0x56F0, 0x5764, 0x58BE, 0x5A5A,
- 0x6068, 0x61C7, 0x660F, 0x6606, 0x6839, 0x68B1, 0x6DF7, 0x75D5,
- 0x7D3A, 0x826E, 0x9B42, 0x4E9B, 0x4F50, 0x53C9, 0x5506, 0x5D6F,
- 0x5DE6, 0x5DEE, 0x67FB, 0x6C99, 0x7473, 0x7802, 0x8A50, 0x9396,
- 0x88DF, 0x5750, 0x5EA7, 0x632B, 0x50B5, 0x50AC, 0x518D, 0x6700,
- 0x54C9, 0x585E, 0x59BB, 0x5BB0, 0x5F69, 0x624D, 0x63A1, 0x683D,
- 0x6B73, 0x6E08, 0x707D, 0x91C7, 0x7280, 0x7815, 0x7826, 0x796D,
- 0x658E, 0x7D30, 0x83DC, 0x88C1, 0x8F09, 0x969B, 0x5264, 0x5728,
- 0x6750, 0x7F6A, 0x8CA1, 0x51B4, 0x5742, 0x962A, 0x583A, 0x698A,
- 0x80B4, 0x54B2, 0x5D0E, 0x57FC, 0x7895, 0x9DFA, 0x4F5C, 0x524A,
- 0x548B, 0x643E, 0x6628, 0x6714, 0x67F5, 0x7A84, 0x7B56, 0x7D22,
- 0x932F, 0x685C, 0x9BAD, 0x7B39, 0x5319, 0x518A, 0x5237, 0x5BDF,
- 0x62F6, 0x64AE, 0x64E6, 0x672D, 0x6BBA, 0x85A9, 0x96D1, 0x7690,
- 0x9BD6, 0x634C, 0x9306, 0x9BAB, 0x76BF, 0x6652, 0x4E09, 0x5098,
- 0x53C2, 0x5C71, 0x60E8, 0x6492, 0x6563, 0x685F, 0x71E6, 0x73CA,
- 0x7523, 0x7B97, 0x7E82, 0x8695, 0x8B83, 0x8CDB, 0x9178, 0x9910,
- 0x65AC, 0x66AB, 0x6B8B, 0x4ED5, 0x4ED4, 0x4F3A, 0x4F7F, 0x523A,
- 0x53F8, 0x53F2, 0x55E3, 0x56DB, 0x58EB, 0x59CB, 0x59C9, 0x59FF,
- 0x5B50, 0x5C4D, 0x5E02, 0x5E2B, 0x5FD7, 0x601D, 0x6307, 0x652F,
- 0x5B5C, 0x65AF, 0x65BD, 0x65E8, 0x679D, 0x6B62, 0x6B7B, 0x6C0F,
- 0x7345, 0x7949, 0x79C1, 0x7CF8, 0x7D19, 0x7D2B, 0x80A2, 0x8102,
- 0x81F3, 0x8996, 0x8A5E, 0x8A69, 0x8A66, 0x8A8C, 0x8AEE, 0x8CC7,
- 0x8CDC, 0x96CC, 0x98FC, 0x6B6F, 0x4E8B, 0x4F3C, 0x4F8D, 0x5150,
- 0x5B57, 0x5BFA, 0x6148, 0x6301, 0x6642, 0x6B21, 0x6ECB, 0x6CBB,
- 0x723E, 0x74BD, 0x75D4, 0x78C1, 0x793A, 0x800C, 0x8033, 0x81EA,
- 0x8494, 0x8F9E, 0x6C50, 0x9E7F, 0x5F0F, 0x8B58, 0x9D2B, 0x7AFA,
- 0x8EF8, 0x5B8D, 0x96EB, 0x4E03, 0x53F1, 0x57F7, 0x5931, 0x5AC9,
- 0x5BA4, 0x6089, 0x6E7F, 0x6F06, 0x75BE, 0x8CEA, 0x5B9F, 0x8500,
- 0x7BE0, 0x5072, 0x67F4, 0x829D, 0x5C61, 0x854A, 0x7E1E, 0x820E,
- 0x5199, 0x5C04, 0x6368, 0x8D66, 0x659C, 0x716E, 0x793E, 0x7D17,
- 0x8005, 0x8B1D, 0x8ECA, 0x906E, 0x86C7, 0x90AA, 0x501F, 0x52FA,
- 0x5C3A, 0x6753, 0x707C, 0x7235, 0x914C, 0x91C8, 0x932B, 0x82E5,
- 0x5BC2, 0x5F31, 0x60F9, 0x4E3B, 0x53D6, 0x5B88, 0x624B, 0x6731,
- 0x6B8A, 0x72E9, 0x73E0, 0x7A2E, 0x816B, 0x8DA3, 0x9152, 0x9996,
- 0x5112, 0x53D7, 0x546A, 0x5BFF, 0x6388, 0x6A39, 0x7DAC, 0x9700,
- 0x56DA, 0x53CE, 0x5468, 0x5B97, 0x5C31, 0x5DDE, 0x4FEE, 0x6101,
- 0x62FE, 0x6D32, 0x79C0, 0x79CB, 0x7D42, 0x7E4D, 0x7FD2, 0x81ED,
- 0x821F, 0x8490, 0x8846, 0x8972, 0x8B90, 0x8E74, 0x8F2F, 0x9031,
- 0x914B, 0x916C, 0x96C6, 0x919C, 0x4EC0, 0x4F4F, 0x5145, 0x5341,
- 0x5F93, 0x620E, 0x67D4, 0x6C41, 0x6E0B, 0x7363, 0x7E26, 0x91CD,
- 0x9283, 0x53D4, 0x5919, 0x5BBF, 0x6DD1, 0x795D, 0x7E2E, 0x7C9B,
- 0x587E, 0x719F, 0x51FA, 0x8853, 0x8FF0, 0x4FCA, 0x5CFB, 0x6625,
- 0x77AC, 0x7AE3, 0x821C, 0x99FF, 0x51C6, 0x5FAA, 0x65EC, 0x696F,
- 0x6B89, 0x6DF3, 0x6E96, 0x6F64, 0x76FE, 0x7D14, 0x5DE1, 0x9075,
- 0x9187, 0x9806, 0x51E6, 0x521D, 0x6240, 0x6691, 0x66D9, 0x6E1A,
- 0x5EB6, 0x7DD2, 0x7F72, 0x66F8, 0x85AF, 0x85F7, 0x8AF8, 0x52A9,
- 0x53D9, 0x5973, 0x5E8F, 0x5F90, 0x6055, 0x92E4, 0x9664, 0x50B7,
- 0x511F, 0x52DD, 0x5320, 0x5347, 0x53EC, 0x54E8, 0x5546, 0x5531,
- 0x5617, 0x5968, 0x59BE, 0x5A3C, 0x5BB5, 0x5C06, 0x5C0F, 0x5C11,
- 0x5C1A, 0x5E84, 0x5E8A, 0x5EE0, 0x5F70, 0x627F, 0x6284, 0x62DB,
- 0x638C, 0x6377, 0x6607, 0x660C, 0x662D, 0x6676, 0x677E, 0x68A2,
- 0x6A1F, 0x6A35, 0x6CBC, 0x6D88, 0x6E09, 0x6E58, 0x713C, 0x7126,
- 0x7167, 0x75C7, 0x7701, 0x785D, 0x7901, 0x7965, 0x79F0, 0x7AE0,
- 0x7B11, 0x7CA7, 0x7D39, 0x8096, 0x83D6, 0x848B, 0x8549, 0x885D,
- 0x88F3, 0x8A1F, 0x8A3C, 0x8A54, 0x8A73, 0x8C61, 0x8CDE, 0x91A4,
- 0x9266, 0x937E, 0x9418, 0x969C, 0x9798, 0x4E0A, 0x4E08, 0x4E1E,
- 0x4E57, 0x5197, 0x5270, 0x57CE, 0x5834, 0x58CC, 0x5B22, 0x5E38,
- 0x60C5, 0x64FE, 0x6761, 0x6756, 0x6D44, 0x72B6, 0x7573, 0x7A63,
- 0x84B8, 0x8B72, 0x91B8, 0x9320, 0x5631, 0x57F4, 0x98FE, 0x62ED,
- 0x690D, 0x6B96, 0x71ED, 0x7E54, 0x8077, 0x8272, 0x89E6, 0x98DF,
- 0x8755, 0x8FB1, 0x5C3B, 0x4F38, 0x4FE1, 0x4FB5, 0x5507, 0x5A20,
- 0x5BDD, 0x5BE9, 0x5FC3, 0x614E, 0x632F, 0x65B0, 0x664B, 0x68EE,
- 0x699B, 0x6D78, 0x6DF1, 0x7533, 0x75B9, 0x771F, 0x795E, 0x79E6,
- 0x7D33, 0x81E3, 0x82AF, 0x85AA, 0x89AA, 0x8A3A, 0x8EAB, 0x8F9B,
- 0x9032, 0x91DD, 0x9707, 0x4EBA, 0x4EC1, 0x5203, 0x5875, 0x58EC,
- 0x5C0B, 0x751A, 0x5C3D, 0x814E, 0x8A0A, 0x8FC5, 0x9663, 0x976D,
- 0x7B25, 0x8ACF, 0x9808, 0x9162, 0x56F3, 0x53A8, 0x9017, 0x5439,
- 0x5782, 0x5E25, 0x63A8, 0x6C34, 0x708A, 0x7761, 0x7C8B, 0x7FE0,
- 0x8870, 0x9042, 0x9154, 0x9310, 0x9318, 0x968F, 0x745E, 0x9AC4,
- 0x5D07, 0x5D69, 0x6570, 0x67A2, 0x8DA8, 0x96DB, 0x636E, 0x6749,
- 0x6919, 0x83C5, 0x9817, 0x96C0, 0x88FE, 0x6F84, 0x647A, 0x5BF8,
- 0x4E16, 0x702C, 0x755D, 0x662F, 0x51C4, 0x5236, 0x52E2, 0x59D3,
- 0x5F81, 0x6027, 0x6210, 0x653F, 0x6574, 0x661F, 0x6674, 0x68F2,
- 0x6816, 0x6B63, 0x6E05, 0x7272, 0x751F, 0x76DB, 0x7CBE, 0x8056,
- 0x58F0, 0x88FD, 0x897F, 0x8AA0, 0x8A93, 0x8ACB, 0x901D, 0x9192,
- 0x9752, 0x9759, 0x6589, 0x7A0E, 0x8106, 0x96BB, 0x5E2D, 0x60DC,
- 0x621A, 0x65A5, 0x6614, 0x6790, 0x77F3, 0x7A4D, 0x7C4D, 0x7E3E,
- 0x810A, 0x8CAC, 0x8D64, 0x8DE1, 0x8E5F, 0x78A9, 0x5207, 0x62D9,
- 0x63A5, 0x6442, 0x6298, 0x8A2D, 0x7A83, 0x7BC0, 0x8AAC, 0x96EA,
- 0x7D76, 0x820C, 0x8749, 0x4ED9, 0x5148, 0x5343, 0x5360, 0x5BA3,
- 0x5C02, 0x5C16, 0x5DDD, 0x6226, 0x6247, 0x64B0, 0x6813, 0x6834,
- 0x6CC9, 0x6D45, 0x6D17, 0x67D3, 0x6F5C, 0x714E, 0x717D, 0x65CB,
- 0x7A7F, 0x7BAD, 0x7DDA, 0x7E4A, 0x7FA8, 0x817A, 0x821B, 0x8239,
- 0x85A6, 0x8A6E, 0x8CCE, 0x8DF5, 0x9078, 0x9077, 0x92AD, 0x9291,
- 0x9583, 0x9BAE, 0x524D, 0x5584, 0x6F38, 0x7136, 0x5168, 0x7985,
- 0x7E55, 0x81B3, 0x7CCE, 0x564C, 0x5851, 0x5CA8, 0x63AA, 0x66FE,
- 0x66FD, 0x695A, 0x72D9, 0x758F, 0x758E, 0x790E, 0x7956, 0x79DF,
- 0x7C97, 0x7D20, 0x7D44, 0x8607, 0x8A34, 0x963B, 0x9061, 0x9F20,
- 0x50E7, 0x5275, 0x53CC, 0x53E2, 0x5009, 0x55AA, 0x58EE, 0x594F,
- 0x723D, 0x5B8B, 0x5C64, 0x531D, 0x60E3, 0x60F3, 0x635C, 0x6383,
- 0x633F, 0x63BB, 0x64CD, 0x65E9, 0x66F9, 0x5DE3, 0x69CD, 0x69FD,
- 0x6F15, 0x71E5, 0x4E89, 0x75E9, 0x76F8, 0x7A93, 0x7CDF, 0x7DCF,
- 0x7D9C, 0x8061, 0x8349, 0x8358, 0x846C, 0x84BC, 0x85FB, 0x88C5,
- 0x8D70, 0x9001, 0x906D, 0x9397, 0x971C, 0x9A12, 0x50CF, 0x5897,
- 0x618E, 0x81D3, 0x8535, 0x8D08, 0x9020, 0x4FC3, 0x5074, 0x5247,
- 0x5373, 0x606F, 0x6349, 0x675F, 0x6E2C, 0x8DB3, 0x901F, 0x4FD7,
- 0x5C5E, 0x8CCA, 0x65CF, 0x7D9A, 0x5352, 0x8896, 0x5176, 0x63C3,
- 0x5B58, 0x5B6B, 0x5C0A, 0x640D, 0x6751, 0x905C, 0x4ED6, 0x591A,
- 0x592A, 0x6C70, 0x8A51, 0x553E, 0x5815, 0x59A5, 0x60F0, 0x6253,
- 0x67C1, 0x8235, 0x6955, 0x9640, 0x99C4, 0x9A28, 0x4F53, 0x5806,
- 0x5BFE, 0x8010, 0x5CB1, 0x5E2F, 0x5F85, 0x6020, 0x614B, 0x6234,
- 0x66FF, 0x6CF0, 0x6EDE, 0x80CE, 0x817F, 0x82D4, 0x888B, 0x8CB8,
- 0x9000, 0x902E, 0x968A, 0x9EDB, 0x9BDB, 0x4EE3, 0x53F0, 0x5927,
- 0x7B2C, 0x918D, 0x984C, 0x9DF9, 0x6EDD, 0x7027, 0x5353, 0x5544,
- 0x5B85, 0x6258, 0x629E, 0x62D3, 0x6CA2, 0x6FEF, 0x7422, 0x8A17,
- 0x9438, 0x6FC1, 0x8AFE, 0x8338, 0x51E7, 0x86F8, 0x53EA, 0x53E9,
- 0x4F46, 0x9054, 0x8FB0, 0x596A, 0x8131, 0x5DFD, 0x7AEA, 0x8FBF,
- 0x68DA, 0x8C37, 0x72F8, 0x9C48, 0x6A3D, 0x8AB0, 0x4E39, 0x5358,
- 0x5606, 0x5766, 0x62C5, 0x63A2, 0x65E6, 0x6B4E, 0x6DE1, 0x6E5B,
- 0x70AD, 0x77ED, 0x7AEF, 0x7BAA, 0x7DBB, 0x803D, 0x80C6, 0x86CB,
- 0x8A95, 0x935B, 0x56E3, 0x58C7, 0x5F3E, 0x65AD, 0x6696, 0x6A80,
- 0x6BB5, 0x7537, 0x8AC7, 0x5024, 0x77E5, 0x5730, 0x5F1B, 0x6065,
- 0x667A, 0x6C60, 0x75F4, 0x7A1A, 0x7F6E, 0x81F4, 0x8718, 0x9045,
- 0x99B3, 0x7BC9, 0x755C, 0x7AF9, 0x7B51, 0x84C4, 0x9010, 0x79E9,
- 0x7A92, 0x8336, 0x5AE1, 0x7740, 0x4E2D, 0x4EF2, 0x5B99, 0x5FE0,
- 0x62BD, 0x663C, 0x67F1, 0x6CE8, 0x866B, 0x8877, 0x8A3B, 0x914E,
- 0x92F3, 0x99D0, 0x6A17, 0x7026, 0x732A, 0x82E7, 0x8457, 0x8CAF,
- 0x4E01, 0x5146, 0x51CB, 0x558B, 0x5BF5, 0x5E16, 0x5E33, 0x5E81,
- 0x5F14, 0x5F35, 0x5F6B, 0x5FB4, 0x61F2, 0x6311, 0x66A2, 0x671D,
- 0x6F6E, 0x7252, 0x753A, 0x773A, 0x8074, 0x8139, 0x8178, 0x8776,
- 0x8ABF, 0x8ADC, 0x8D85, 0x8DF3, 0x929A, 0x9577, 0x9802, 0x9CE5,
- 0x52C5, 0x6357, 0x76F4, 0x6715, 0x6C88, 0x73CD, 0x8CC3, 0x93AE,
- 0x9673, 0x6D25, 0x589C, 0x690E, 0x69CC, 0x8FFD, 0x939A, 0x75DB,
- 0x901A, 0x585A, 0x6802, 0x63B4, 0x69FB, 0x4F43, 0x6F2C, 0x67D8,
- 0x8FBB, 0x8526, 0x7DB4, 0x9354, 0x693F, 0x6F70, 0x576A, 0x58F7,
- 0x5B2C, 0x7D2C, 0x722A, 0x540A, 0x91E3, 0x9DB4, 0x4EAD, 0x4F4E,
- 0x505C, 0x5075, 0x5243, 0x8C9E, 0x5448, 0x5824, 0x5B9A, 0x5E1D,
- 0x5E95, 0x5EAD, 0x5EF7, 0x5F1F, 0x608C, 0x62B5, 0x633A, 0x63D0,
- 0x68AF, 0x6C40, 0x7887, 0x798E, 0x7A0B, 0x7DE0, 0x8247, 0x8A02,
- 0x8AE6, 0x8E44, 0x9013, 0x90B8, 0x912D, 0x91D8, 0x9F0E, 0x6CE5,
- 0x6458, 0x64E2, 0x6575, 0x6EF4, 0x7684, 0x7B1B, 0x9069, 0x93D1,
- 0x6EBA, 0x54F2, 0x5FB9, 0x64A4, 0x8F4D, 0x8FED, 0x9244, 0x5178,
- 0x586B, 0x5929, 0x5C55, 0x5E97, 0x6DFB, 0x7E8F, 0x751C, 0x8CBC,
- 0x8EE2, 0x985B, 0x70B9, 0x4F1D, 0x6BBF, 0x6FB1, 0x7530, 0x96FB,
- 0x514E, 0x5410, 0x5835, 0x5857, 0x59AC, 0x5C60, 0x5F92, 0x6597,
- 0x675C, 0x6E21, 0x767B, 0x83DF, 0x8CED, 0x9014, 0x90FD, 0x934D,
- 0x7825, 0x783A, 0x52AA, 0x5EA6, 0x571F, 0x5974, 0x6012, 0x5012,
- 0x515A, 0x51AC, 0x51CD, 0x5200, 0x5510, 0x5854, 0x5858, 0x5957,
- 0x5B95, 0x5CF6, 0x5D8B, 0x60BC, 0x6295, 0x642D, 0x6771, 0x6843,
- 0x68BC, 0x68DF, 0x76D7, 0x6DD8, 0x6E6F, 0x6D9B, 0x706F, 0x71C8,
- 0x5F53, 0x75D8, 0x7977, 0x7B49, 0x7B54, 0x7B52, 0x7CD6, 0x7D71,
- 0x5230, 0x8463, 0x8569, 0x85E4, 0x8A0E, 0x8B04, 0x8C46, 0x8E0F,
- 0x9003, 0x900F, 0x9419, 0x9676, 0x982D, 0x9A30, 0x95D8, 0x50CD,
- 0x52D5, 0x540C, 0x5802, 0x5C0E, 0x61A7, 0x649E, 0x6D1E, 0x77B3,
- 0x7AE5, 0x80F4, 0x8404, 0x9053, 0x9285, 0x5CE0, 0x9D07, 0x533F,
- 0x5F97, 0x5FB3, 0x6D9C, 0x7279, 0x7763, 0x79BF, 0x7BE4, 0x6BD2,
- 0x72EC, 0x8AAD, 0x6803, 0x6A61, 0x51F8, 0x7A81, 0x6934, 0x5C4A,
- 0x9CF6, 0x82EB, 0x5BC5, 0x9149, 0x701E, 0x5678, 0x5C6F, 0x60C7,
- 0x6566, 0x6C8C, 0x8C5A, 0x9041, 0x9813, 0x5451, 0x66C7, 0x920D,
- 0x5948, 0x90A3, 0x5185, 0x4E4D, 0x51EA, 0x8599, 0x8B0E, 0x7058,
- 0x637A, 0x934B, 0x6962, 0x99B4, 0x7E04, 0x7577, 0x5357, 0x6960,
- 0x8EDF, 0x96E3, 0x6C5D, 0x4E8C, 0x5C3C, 0x5F10, 0x8FE9, 0x5302,
- 0x8CD1, 0x8089, 0x8679, 0x5EFF, 0x65E5, 0x4E73, 0x5165, 0x5982,
- 0x5C3F, 0x97EE, 0x4EFB, 0x598A, 0x5FCD, 0x8A8D, 0x6FE1, 0x79B0,
- 0x7962, 0x5BE7, 0x8471, 0x732B, 0x71B1, 0x5E74, 0x5FF5, 0x637B,
- 0x649A, 0x71C3, 0x7C98, 0x4E43, 0x5EFC, 0x4E4B, 0x57DC, 0x56A2,
- 0x60A9, 0x6FC3, 0x7D0D, 0x80FD, 0x8133, 0x81BF, 0x8FB2, 0x8997,
- 0x86A4, 0x5DF4, 0x628A, 0x64AD, 0x8987, 0x6777, 0x6CE2, 0x6D3E,
- 0x7436, 0x7834, 0x5A46, 0x7F75, 0x82AD, 0x99AC, 0x4FF3, 0x5EC3,
- 0x62DD, 0x6392, 0x6557, 0x676F, 0x76C3, 0x724C, 0x80CC, 0x80BA,
- 0x8F29, 0x914D, 0x500D, 0x57F9, 0x5A92, 0x6885, 0x6973, 0x7164,
- 0x72FD, 0x8CB7, 0x58F2, 0x8CE0, 0x966A, 0x9019, 0x877F, 0x79E4,
- 0x77E7, 0x8429, 0x4F2F, 0x5265, 0x535A, 0x62CD, 0x67CF, 0x6CCA,
- 0x767D, 0x7B94, 0x7C95, 0x8236, 0x8584, 0x8FEB, 0x66DD, 0x6F20,
- 0x7206, 0x7E1B, 0x83AB, 0x99C1, 0x9EA6, 0x51FD, 0x7BB1, 0x7872,
- 0x7BB8, 0x8087, 0x7B48, 0x6AE8, 0x5E61, 0x808C, 0x7551, 0x7560,
- 0x516B, 0x9262, 0x6E8C, 0x767A, 0x9197, 0x9AEA, 0x4F10, 0x7F70,
- 0x629C, 0x7B4F, 0x95A5, 0x9CE9, 0x567A, 0x5859, 0x86E4, 0x96BC,
- 0x4F34, 0x5224, 0x534A, 0x53CD, 0x53DB, 0x5E06, 0x642C, 0x6591,
- 0x677F, 0x6C3E, 0x6C4E, 0x7248, 0x72AF, 0x73ED, 0x7554, 0x7E41,
- 0x822C, 0x85E9, 0x8CA9, 0x7BC4, 0x91C6, 0x7169, 0x9812, 0x98EF,
- 0x633D, 0x6669, 0x756A, 0x76E4, 0x78D0, 0x8543, 0x86EE, 0x532A,
- 0x5351, 0x5426, 0x5983, 0x5E87, 0x5F7C, 0x60B2, 0x6249, 0x6279,
- 0x62AB, 0x6590, 0x6BD4, 0x6CCC, 0x75B2, 0x76AE, 0x7891, 0x79D8,
- 0x7DCB, 0x7F77, 0x80A5, 0x88AB, 0x8AB9, 0x8CBB, 0x907F, 0x975E,
- 0x98DB, 0x6A0B, 0x7C38, 0x5099, 0x5C3E, 0x5FAE, 0x6787, 0x6BD8,
- 0x7435, 0x7709, 0x7F8E, 0x9F3B, 0x67CA, 0x7A17, 0x5339, 0x758B,
- 0x9AED, 0x5F66, 0x819D, 0x83F1, 0x8098, 0x5F3C, 0x5FC5, 0x7562,
- 0x7B46, 0x903C, 0x6867, 0x59EB, 0x5A9B, 0x7D10, 0x767E, 0x8B2C,
- 0x4FF5, 0x5F6A, 0x6A19, 0x6C37, 0x6F02, 0x74E2, 0x7968, 0x8868,
- 0x8A55, 0x8C79, 0x5EDF, 0x63CF, 0x75C5, 0x79D2, 0x82D7, 0x9328,
- 0x92F2, 0x849C, 0x86ED, 0x9C2D, 0x54C1, 0x5F6C, 0x658C, 0x6D5C,
- 0x7015, 0x8CA7, 0x8CD3, 0x983B, 0x654F, 0x74F6, 0x4E0D, 0x4ED8,
- 0x57E0, 0x592B, 0x5A66, 0x5BCC, 0x51A8, 0x5E03, 0x5E9C, 0x6016,
- 0x6276, 0x6577, 0x65A7, 0x666E, 0x6D6E, 0x7236, 0x7B26, 0x8150,
- 0x819A, 0x8299, 0x8B5C, 0x8CA0, 0x8CE6, 0x8D74, 0x961C, 0x9644,
- 0x4FAE, 0x64AB, 0x6B66, 0x821E, 0x8461, 0x856A, 0x90E8, 0x5C01,
- 0x6953, 0x98A8, 0x847A, 0x8557, 0x4F0F, 0x526F, 0x5FA9, 0x5E45,
- 0x670D, 0x798F, 0x8179, 0x8907, 0x8986, 0x6DF5, 0x5F17, 0x6255,
- 0x6CB8, 0x4ECF, 0x7269, 0x9B92, 0x5206, 0x543B, 0x5674, 0x58B3,
- 0x61A4, 0x626E, 0x711A, 0x596E, 0x7C89, 0x7CDE, 0x7D1B, 0x96F0,
- 0x6587, 0x805E, 0x4E19, 0x4F75, 0x5175, 0x5840, 0x5E63, 0x5E73,
- 0x5F0A, 0x67C4, 0x4E26, 0x853D, 0x9589, 0x965B, 0x7C73, 0x9801,
- 0x50FB, 0x58C1, 0x7656, 0x78A7, 0x5225, 0x77A5, 0x8511, 0x7B86,
- 0x504F, 0x5909, 0x7247, 0x7BC7, 0x7DE8, 0x8FBA, 0x8FD4, 0x904D,
- 0x4FBF, 0x52C9, 0x5A29, 0x5F01, 0x97AD, 0x4FDD, 0x8217, 0x92EA,
- 0x5703, 0x6355, 0x6B69, 0x752B, 0x88DC, 0x8F14, 0x7A42, 0x52DF,
- 0x5893, 0x6155, 0x620A, 0x66AE, 0x6BCD, 0x7C3F, 0x83E9, 0x5023,
- 0x4FF8, 0x5305, 0x5446, 0x5831, 0x5949, 0x5B9D, 0x5CF0, 0x5CEF,
- 0x5D29, 0x5E96, 0x62B1, 0x6367, 0x653E, 0x65B9, 0x670B, 0x6CD5,
- 0x6CE1, 0x70F9, 0x7832, 0x7E2B, 0x80DE, 0x82B3, 0x840C, 0x84EC,
- 0x8702, 0x8912, 0x8A2A, 0x8C4A, 0x90A6, 0x92D2, 0x98FD, 0x9CF3,
- 0x9D6C, 0x4E4F, 0x4EA1, 0x508D, 0x5256, 0x574A, 0x59A8, 0x5E3D,
- 0x5FD8, 0x5FD9, 0x623F, 0x66B4, 0x671B, 0x67D0, 0x68D2, 0x5192,
- 0x7D21, 0x80AA, 0x81A8, 0x8B00, 0x8C8C, 0x8CBF, 0x927E, 0x9632,
- 0x5420, 0x982C, 0x5317, 0x50D5, 0x535C, 0x58A8, 0x64B2, 0x6734,
- 0x7267, 0x7766, 0x7A46, 0x91E6, 0x52C3, 0x6CA1, 0x6B86, 0x5800,
- 0x5E4C, 0x5954, 0x672C, 0x7FFB, 0x51E1, 0x76C6, 0x6469, 0x78E8,
- 0x9B54, 0x9EBB, 0x57CB, 0x59B9, 0x6627, 0x679A, 0x6BCE, 0x54E9,
- 0x69D9, 0x5E55, 0x819C, 0x6795, 0x9BAA, 0x67FE, 0x9C52, 0x685D,
- 0x4EA6, 0x4FE3, 0x53C8, 0x62B9, 0x672B, 0x6CAB, 0x8FC4, 0x4FAD,
- 0x7E6D, 0x9EBF, 0x4E07, 0x6162, 0x6E80, 0x6F2B, 0x8513, 0x5473,
- 0x672A, 0x9B45, 0x5DF3, 0x7B95, 0x5CAC, 0x5BC6, 0x871C, 0x6E4A,
- 0x84D1, 0x7A14, 0x8108, 0x5999, 0x7C8D, 0x6C11, 0x7720, 0x52D9,
- 0x5922, 0x7121, 0x725F, 0x77DB, 0x9727, 0x9D61, 0x690B, 0x5A7F,
- 0x5A18, 0x51A5, 0x540D, 0x547D, 0x660E, 0x76DF, 0x8FF7, 0x9298,
- 0x9CF4, 0x59EA, 0x725D, 0x6EC5, 0x514D, 0x68C9, 0x7DBF, 0x7DEC,
- 0x9762, 0x9EBA, 0x6478, 0x6A21, 0x8302, 0x5984, 0x5B5F, 0x6BDB,
- 0x731B, 0x76F2, 0x7DB2, 0x8017, 0x8499, 0x5132, 0x6728, 0x9ED9,
- 0x76EE, 0x6762, 0x52FF, 0x9905, 0x5C24, 0x623B, 0x7C7E, 0x8CB0,
- 0x554F, 0x60B6, 0x7D0B, 0x9580, 0x5301, 0x4E5F, 0x51B6, 0x591C,
- 0x723A, 0x8036, 0x91CE, 0x5F25, 0x77E2, 0x5384, 0x5F79, 0x7D04,
- 0x85AC, 0x8A33, 0x8E8D, 0x9756, 0x67F3, 0x85AE, 0x9453, 0x6109,
- 0x6108, 0x6CB9, 0x7652, 0x8AED, 0x8F38, 0x552F, 0x4F51, 0x512A,
- 0x52C7, 0x53CB, 0x5BA5, 0x5E7D, 0x60A0, 0x6182, 0x63D6, 0x6709,
- 0x67DA, 0x6E67, 0x6D8C, 0x7336, 0x7337, 0x7531, 0x7950, 0x88D5,
- 0x8A98, 0x904A, 0x9091, 0x90F5, 0x96C4, 0x878D, 0x5915, 0x4E88,
- 0x4F59, 0x4E0E, 0x8A89, 0x8F3F, 0x9810, 0x50AD, 0x5E7C, 0x5996,
- 0x5BB9, 0x5EB8, 0x63DA, 0x63FA, 0x64C1, 0x66DC, 0x694A, 0x69D8,
- 0x6D0B, 0x6EB6, 0x7194, 0x7528, 0x7AAF, 0x7F8A, 0x8000, 0x8449,
- 0x84C9, 0x8981, 0x8B21, 0x8E0A, 0x9065, 0x967D, 0x990A, 0x617E,
- 0x6291, 0x6B32, 0x6C83, 0x6D74, 0x7FCC, 0x7FFC, 0x6DC0, 0x7F85,
- 0x87BA, 0x88F8, 0x6765, 0x83B1, 0x983C, 0x96F7, 0x6D1B, 0x7D61,
- 0x843D, 0x916A, 0x4E71, 0x5375, 0x5D50, 0x6B04, 0x6FEB, 0x85CD,
- 0x862D, 0x89A7, 0x5229, 0x540F, 0x5C65, 0x674E, 0x68A8, 0x7406,
- 0x7483, 0x75E2, 0x88CF, 0x88E1, 0x91CC, 0x96E2, 0x9678, 0x5F8B,
- 0x7387, 0x7ACB, 0x844E, 0x63A0, 0x7565, 0x5289, 0x6D41, 0x6E9C,
- 0x7409, 0x7559, 0x786B, 0x7C92, 0x9686, 0x7ADC, 0x9F8D, 0x4FB6,
- 0x616E, 0x65C5, 0x865C, 0x4E86, 0x4EAE, 0x50DA, 0x4E21, 0x51CC,
- 0x5BEE, 0x6599, 0x6881, 0x6DBC, 0x731F, 0x7642, 0x77AD, 0x7A1C,
- 0x7CE7, 0x826F, 0x8AD2, 0x907C, 0x91CF, 0x9675, 0x9818, 0x529B,
- 0x7DD1, 0x502B, 0x5398, 0x6797, 0x6DCB, 0x71D0, 0x7433, 0x81E8,
- 0x8F2A, 0x96A3, 0x9C57, 0x9E9F, 0x7460, 0x5841, 0x6D99, 0x7D2F,
- 0x985E, 0x4EE4, 0x4F36, 0x4F8B, 0x51B7, 0x52B1, 0x5DBA, 0x601C,
- 0x73B2, 0x793C, 0x82D3, 0x9234, 0x96B7, 0x96F6, 0x970A, 0x9E97,
- 0x9F62, 0x66A6, 0x6B74, 0x5217, 0x52A3, 0x70C8, 0x88C2, 0x5EC9,
- 0x604B, 0x6190, 0x6F23, 0x7149, 0x7C3E, 0x7DF4, 0x806F, 0x84EE,
- 0x9023, 0x932C, 0x5442, 0x9B6F, 0x6AD3, 0x7089, 0x8CC2, 0x8DEF,
- 0x9732, 0x52B4, 0x5A41, 0x5ECA, 0x5F04, 0x6717, 0x697C, 0x6994,
- 0x6D6A, 0x6F0F, 0x7262, 0x72FC, 0x7BED, 0x8001, 0x807E, 0x874B,
- 0x90CE, 0x516D, 0x9E93, 0x7984, 0x808B, 0x9332, 0x8AD6, 0x502D,
- 0x548C, 0x8A71, 0x6B6A, 0x8CC4, 0x8107, 0x60D1, 0x67A0, 0x9DF2,
- 0x4E99, 0x4E98, 0x9C10, 0x8A6B, 0x85C1, 0x8568, 0x6900, 0x6E7E,
- 0x7897, 0x8155, 0x5F0C, 0x4E10, 0x4E15, 0x4E2A, 0x4E31, 0x4E36,
- 0x4E3C, 0x4E3F, 0x4E42, 0x4E56, 0x4E58, 0x4E82, 0x4E85, 0x8C6B,
- 0x4E8A, 0x8212, 0x5F0D, 0x4E8E, 0x4E9E, 0x4E9F, 0x4EA0, 0x4EA2,
- 0x4EB0, 0x4EB3, 0x4EB6, 0x4ECE, 0x4ECD, 0x4EC4, 0x4EC6, 0x4EC2,
- 0x4ED7, 0x4EDE, 0x4EED, 0x4EDF, 0x4EF7, 0x4F09, 0x4F5A, 0x4F30,
- 0x4F5B, 0x4F5D, 0x4F57, 0x4F47, 0x4F76, 0x4F88, 0x4F8F, 0x4F98,
- 0x4F7B, 0x4F69, 0x4F70, 0x4F91, 0x4F6F, 0x4F86, 0x4F96, 0x5118,
- 0x4FD4, 0x4FDF, 0x4FCE, 0x4FD8, 0x4FDB, 0x4FD1, 0x4FDA, 0x4FD0,
- 0x4FE4, 0x4FE5, 0x501A, 0x5028, 0x5014, 0x502A, 0x5025, 0x5005,
- 0x4F1C, 0x4FF6, 0x5021, 0x5029, 0x502C, 0x4FFE, 0x4FEF, 0x5011,
- 0x5006, 0x5043, 0x5047, 0x6703, 0x5055, 0x5050, 0x5048, 0x505A,
- 0x5056, 0x506C, 0x5078, 0x5080, 0x509A, 0x5085, 0x50B4, 0x50B2,
- 0x50C9, 0x50CA, 0x50B3, 0x50C2, 0x50D6, 0x50DE, 0x50E5, 0x50ED,
- 0x50E3, 0x50EE, 0x50F9, 0x50F5, 0x5109, 0x5101, 0x5102, 0x5116,
- 0x5115, 0x5114, 0x511A, 0x5121, 0x513A, 0x5137, 0x513C, 0x513B,
- 0x513F, 0x5140, 0x5152, 0x514C, 0x5154, 0x5162, 0x7AF8, 0x5169,
- 0x516A, 0x516E, 0x5180, 0x5182, 0x56D8, 0x518C, 0x5189, 0x518F,
- 0x5191, 0x5193, 0x5195, 0x5196, 0x51A4, 0x51A6, 0x51A2, 0x51A9,
- 0x51AA, 0x51AB, 0x51B3, 0x51B1, 0x51B2, 0x51B0, 0x51B5, 0x51BD,
- 0x51C5, 0x51C9, 0x51DB, 0x51E0, 0x8655, 0x51E9, 0x51ED, 0x51F0,
- 0x51F5, 0x51FE, 0x5204, 0x520B, 0x5214, 0x520E, 0x5227, 0x522A,
- 0x522E, 0x5233, 0x5239, 0x524F, 0x5244, 0x524B, 0x524C, 0x525E,
- 0x5254, 0x526A, 0x5274, 0x5269, 0x5273, 0x527F, 0x527D, 0x528D,
- 0x5294, 0x5292, 0x5271, 0x5288, 0x5291, 0x8FA8, 0x8FA7, 0x52AC,
- 0x52AD, 0x52BC, 0x52B5, 0x52C1, 0x52CD, 0x52D7, 0x52DE, 0x52E3,
- 0x52E6, 0x98ED, 0x52E0, 0x52F3, 0x52F5, 0x52F8, 0x52F9, 0x5306,
- 0x5308, 0x7538, 0x530D, 0x5310, 0x530F, 0x5315, 0x531A, 0x5323,
- 0x532F, 0x5331, 0x5333, 0x5338, 0x5340, 0x5346, 0x5345, 0x4E17,
- 0x5349, 0x534D, 0x51D6, 0x535E, 0x5369, 0x536E, 0x5918, 0x537B,
- 0x5377, 0x5382, 0x5396, 0x53A0, 0x53A6, 0x53A5, 0x53AE, 0x53B0,
- 0x53B6, 0x53C3, 0x7C12, 0x96D9, 0x53DF, 0x66FC, 0x71EE, 0x53EE,
- 0x53E8, 0x53ED, 0x53FA, 0x5401, 0x543D, 0x5440, 0x542C, 0x542D,
- 0x543C, 0x542E, 0x5436, 0x5429, 0x541D, 0x544E, 0x548F, 0x5475,
- 0x548E, 0x545F, 0x5471, 0x5477, 0x5470, 0x5492, 0x547B, 0x5480,
- 0x5476, 0x5484, 0x5490, 0x5486, 0x54C7, 0x54A2, 0x54B8, 0x54A5,
- 0x54AC, 0x54C4, 0x54C8, 0x54A8, 0x54AB, 0x54C2, 0x54A4, 0x54BE,
- 0x54BC, 0x54D8, 0x54E5, 0x54E6, 0x550F, 0x5514, 0x54FD, 0x54EE,
- 0x54ED, 0x54FA, 0x54E2, 0x5539, 0x5540, 0x5563, 0x554C, 0x552E,
- 0x555C, 0x5545, 0x5556, 0x5557, 0x5538, 0x5533, 0x555D, 0x5599,
- 0x5580, 0x54AF, 0x558A, 0x559F, 0x557B, 0x557E, 0x5598, 0x559E,
- 0x55AE, 0x557C, 0x5583, 0x55A9, 0x5587, 0x55A8, 0x55DA, 0x55C5,
- 0x55DF, 0x55C4, 0x55DC, 0x55E4, 0x55D4, 0x5614, 0x55F7, 0x5616,
- 0x55FE, 0x55FD, 0x561B, 0x55F9, 0x564E, 0x5650, 0x71DF, 0x5634,
- 0x5636, 0x5632, 0x5638, 0x566B, 0x5664, 0x562F, 0x566C, 0x566A,
- 0x5686, 0x5680, 0x568A, 0x56A0, 0x5694, 0x568F, 0x56A5, 0x56AE,
- 0x56B6, 0x56B4, 0x56C2, 0x56BC, 0x56C1, 0x56C3, 0x56C0, 0x56C8,
- 0x56CE, 0x56D1, 0x56D3, 0x56D7, 0x56EE, 0x56F9, 0x5700, 0x56FF,
- 0x5704, 0x5709, 0x5708, 0x570B, 0x570D, 0x5713, 0x5718, 0x5716,
- 0x55C7, 0x571C, 0x5726, 0x5737, 0x5738, 0x574E, 0x573B, 0x5740,
- 0x574F, 0x5769, 0x57C0, 0x5788, 0x5761, 0x577F, 0x5789, 0x5793,
- 0x57A0, 0x57B3, 0x57A4, 0x57AA, 0x57B0, 0x57C3, 0x57C6, 0x57D4,
- 0x57D2, 0x57D3, 0x580A, 0x57D6, 0x57E3, 0x580B, 0x5819, 0x581D,
- 0x5872, 0x5821, 0x5862, 0x584B, 0x5870, 0x6BC0, 0x5852, 0x583D,
- 0x5879, 0x5885, 0x58B9, 0x589F, 0x58AB, 0x58BA, 0x58DE, 0x58BB,
- 0x58B8, 0x58AE, 0x58C5, 0x58D3, 0x58D1, 0x58D7, 0x58D9, 0x58D8,
- 0x58E5, 0x58DC, 0x58E4, 0x58DF, 0x58EF, 0x58FA, 0x58F9, 0x58FB,
- 0x58FC, 0x58FD, 0x5902, 0x590A, 0x5910, 0x591B, 0x68A6, 0x5925,
- 0x592C, 0x592D, 0x5932, 0x5938, 0x593E, 0x7AD2, 0x5955, 0x5950,
- 0x594E, 0x595A, 0x5958, 0x5962, 0x5960, 0x5967, 0x596C, 0x5969,
- 0x5978, 0x5981, 0x599D, 0x4F5E, 0x4FAB, 0x59A3, 0x59B2, 0x59C6,
- 0x59E8, 0x59DC, 0x598D, 0x59D9, 0x59DA, 0x5A25, 0x5A1F, 0x5A11,
- 0x5A1C, 0x5A09, 0x5A1A, 0x5A40, 0x5A6C, 0x5A49, 0x5A35, 0x5A36,
- 0x5A62, 0x5A6A, 0x5A9A, 0x5ABC, 0x5ABE, 0x5ACB, 0x5AC2, 0x5ABD,
- 0x5AE3, 0x5AD7, 0x5AE6, 0x5AE9, 0x5AD6, 0x5AFA, 0x5AFB, 0x5B0C,
- 0x5B0B, 0x5B16, 0x5B32, 0x5AD0, 0x5B2A, 0x5B36, 0x5B3E, 0x5B43,
- 0x5B45, 0x5B40, 0x5B51, 0x5B55, 0x5B5A, 0x5B5B, 0x5B65, 0x5B69,
- 0x5B70, 0x5B73, 0x5B75, 0x5B78, 0x6588, 0x5B7A, 0x5B80, 0x5B83,
- 0x5BA6, 0x5BB8, 0x5BC3, 0x5BC7, 0x5BC9, 0x5BD4, 0x5BD0, 0x5BE4,
- 0x5BE6, 0x5BE2, 0x5BDE, 0x5BE5, 0x5BEB, 0x5BF0, 0x5BF6, 0x5BF3,
- 0x5C05, 0x5C07, 0x5C08, 0x5C0D, 0x5C13, 0x5C20, 0x5C22, 0x5C28,
- 0x5C38, 0x5C39, 0x5C41, 0x5C46, 0x5C4E, 0x5C53, 0x5C50, 0x5C4F,
- 0x5B71, 0x5C6C, 0x5C6E, 0x4E62, 0x5C76, 0x5C79, 0x5C8C, 0x5C91,
- 0x5C94, 0x599B, 0x5CAB, 0x5CBB, 0x5CB6, 0x5CBC, 0x5CB7, 0x5CC5,
- 0x5CBE, 0x5CC7, 0x5CD9, 0x5CE9, 0x5CFD, 0x5CFA, 0x5CED, 0x5D8C,
- 0x5CEA, 0x5D0B, 0x5D15, 0x5D17, 0x5D5C, 0x5D1F, 0x5D1B, 0x5D11,
- 0x5D14, 0x5D22, 0x5D1A, 0x5D19, 0x5D18, 0x5D4C, 0x5D52, 0x5D4E,
- 0x5D4B, 0x5D6C, 0x5D73, 0x5D76, 0x5D87, 0x5D84, 0x5D82, 0x5DA2,
- 0x5D9D, 0x5DAC, 0x5DAE, 0x5DBD, 0x5D90, 0x5DB7, 0x5DBC, 0x5DC9,
- 0x5DCD, 0x5DD3, 0x5DD2, 0x5DD6, 0x5DDB, 0x5DEB, 0x5DF2, 0x5DF5,
- 0x5E0B, 0x5E1A, 0x5E19, 0x5E11, 0x5E1B, 0x5E36, 0x5E37, 0x5E44,
- 0x5E43, 0x5E40, 0x5E4E, 0x5E57, 0x5E54, 0x5E5F, 0x5E62, 0x5E64,
- 0x5E47, 0x5E75, 0x5E76, 0x5E7A, 0x9EBC, 0x5E7F, 0x5EA0, 0x5EC1,
- 0x5EC2, 0x5EC8, 0x5ED0, 0x5ECF, 0x5ED6, 0x5EE3, 0x5EDD, 0x5EDA,
- 0x5EDB, 0x5EE2, 0x5EE1, 0x5EE8, 0x5EE9, 0x5EEC, 0x5EF1, 0x5EF3,
- 0x5EF0, 0x5EF4, 0x5EF8, 0x5EFE, 0x5F03, 0x5F09, 0x5F5D, 0x5F5C,
- 0x5F0B, 0x5F11, 0x5F16, 0x5F29, 0x5F2D, 0x5F38, 0x5F41, 0x5F48,
- 0x5F4C, 0x5F4E, 0x5F2F, 0x5F51, 0x5F56, 0x5F57, 0x5F59, 0x5F61,
- 0x5F6D, 0x5F73, 0x5F77, 0x5F83, 0x5F82, 0x5F7F, 0x5F8A, 0x5F88,
- 0x5F91, 0x5F87, 0x5F9E, 0x5F99, 0x5F98, 0x5FA0, 0x5FA8, 0x5FAD,
- 0x5FBC, 0x5FD6, 0x5FFB, 0x5FE4, 0x5FF8, 0x5FF1, 0x5FDD, 0x60B3,
- 0x5FFF, 0x6021, 0x6060, 0x6019, 0x6010, 0x6029, 0x600E, 0x6031,
- 0x601B, 0x6015, 0x602B, 0x6026, 0x600F, 0x603A, 0x605A, 0x6041,
- 0x606A, 0x6077, 0x605F, 0x604A, 0x6046, 0x604D, 0x6063, 0x6043,
- 0x6064, 0x6042, 0x606C, 0x606B, 0x6059, 0x6081, 0x608D, 0x60E7,
- 0x6083, 0x609A, 0x6084, 0x609B, 0x6096, 0x6097, 0x6092, 0x60A7,
- 0x608B, 0x60E1, 0x60B8, 0x60E0, 0x60D3, 0x60B4, 0x5FF0, 0x60BD,
- 0x60C6, 0x60B5, 0x60D8, 0x614D, 0x6115, 0x6106, 0x60F6, 0x60F7,
- 0x6100, 0x60F4, 0x60FA, 0x6103, 0x6121, 0x60FB, 0x60F1, 0x610D,
- 0x610E, 0x6147, 0x613E, 0x6128, 0x6127, 0x614A, 0x613F, 0x613C,
- 0x612C, 0x6134, 0x613D, 0x6142, 0x6144, 0x6173, 0x6177, 0x6158,
- 0x6159, 0x615A, 0x616B, 0x6174, 0x616F, 0x6165, 0x6171, 0x615F,
- 0x615D, 0x6153, 0x6175, 0x6199, 0x6196, 0x6187, 0x61AC, 0x6194,
- 0x619A, 0x618A, 0x6191, 0x61AB, 0x61AE, 0x61CC, 0x61CA, 0x61C9,
- 0x61F7, 0x61C8, 0x61C3, 0x61C6, 0x61BA, 0x61CB, 0x7F79, 0x61CD,
- 0x61E6, 0x61E3, 0x61F6, 0x61FA, 0x61F4, 0x61FF, 0x61FD, 0x61FC,
- 0x61FE, 0x6200, 0x6208, 0x6209, 0x620D, 0x620C, 0x6214, 0x621B,
- 0x621E, 0x6221, 0x622A, 0x622E, 0x6230, 0x6232, 0x6233, 0x6241,
- 0x624E, 0x625E, 0x6263, 0x625B, 0x6260, 0x6268, 0x627C, 0x6282,
- 0x6289, 0x627E, 0x6292, 0x6293, 0x6296, 0x62D4, 0x6283, 0x6294,
- 0x62D7, 0x62D1, 0x62BB, 0x62CF, 0x62FF, 0x62C6, 0x64D4, 0x62C8,
- 0x62DC, 0x62CC, 0x62CA, 0x62C2, 0x62C7, 0x629B, 0x62C9, 0x630C,
- 0x62EE, 0x62F1, 0x6327, 0x6302, 0x6308, 0x62EF, 0x62F5, 0x6350,
- 0x633E, 0x634D, 0x641C, 0x634F, 0x6396, 0x638E, 0x6380, 0x63AB,
- 0x6376, 0x63A3, 0x638F, 0x6389, 0x639F, 0x63B5, 0x636B, 0x6369,
- 0x63BE, 0x63E9, 0x63C0, 0x63C6, 0x63E3, 0x63C9, 0x63D2, 0x63F6,
- 0x63C4, 0x6416, 0x6434, 0x6406, 0x6413, 0x6426, 0x6436, 0x651D,
- 0x6417, 0x6428, 0x640F, 0x6467, 0x646F, 0x6476, 0x644E, 0x652A,
- 0x6495, 0x6493, 0x64A5, 0x64A9, 0x6488, 0x64BC, 0x64DA, 0x64D2,
- 0x64C5, 0x64C7, 0x64BB, 0x64D8, 0x64C2, 0x64F1, 0x64E7, 0x8209,
- 0x64E0, 0x64E1, 0x62AC, 0x64E3, 0x64EF, 0x652C, 0x64F6, 0x64F4,
- 0x64F2, 0x64FA, 0x6500, 0x64FD, 0x6518, 0x651C, 0x6505, 0x6524,
- 0x6523, 0x652B, 0x6534, 0x6535, 0x6537, 0x6536, 0x6538, 0x754B,
- 0x6548, 0x6556, 0x6555, 0x654D, 0x6558, 0x655E, 0x655D, 0x6572,
- 0x6578, 0x6582, 0x6583, 0x8B8A, 0x659B, 0x659F, 0x65AB, 0x65B7,
- 0x65C3, 0x65C6, 0x65C1, 0x65C4, 0x65CC, 0x65D2, 0x65DB, 0x65D9,
- 0x65E0, 0x65E1, 0x65F1, 0x6772, 0x660A, 0x6603, 0x65FB, 0x6773,
- 0x6635, 0x6636, 0x6634, 0x661C, 0x664F, 0x6644, 0x6649, 0x6641,
- 0x665E, 0x665D, 0x6664, 0x6667, 0x6668, 0x665F, 0x6662, 0x6670,
- 0x6683, 0x6688, 0x668E, 0x6689, 0x6684, 0x6698, 0x669D, 0x66C1,
- 0x66B9, 0x66C9, 0x66BE, 0x66BC, 0x66C4, 0x66B8, 0x66D6, 0x66DA,
- 0x66E0, 0x663F, 0x66E6, 0x66E9, 0x66F0, 0x66F5, 0x66F7, 0x670F,
- 0x6716, 0x671E, 0x6726, 0x6727, 0x9738, 0x672E, 0x673F, 0x6736,
- 0x6741, 0x6738, 0x6737, 0x6746, 0x675E, 0x6760, 0x6759, 0x6763,
- 0x6764, 0x6789, 0x6770, 0x67A9, 0x677C, 0x676A, 0x678C, 0x678B,
- 0x67A6, 0x67A1, 0x6785, 0x67B7, 0x67EF, 0x67B4, 0x67EC, 0x67B3,
- 0x67E9, 0x67B8, 0x67E4, 0x67DE, 0x67DD, 0x67E2, 0x67EE, 0x67B9,
- 0x67CE, 0x67C6, 0x67E7, 0x6A9C, 0x681E, 0x6846, 0x6829, 0x6840,
- 0x684D, 0x6832, 0x684E, 0x68B3, 0x682B, 0x6859, 0x6863, 0x6877,
- 0x687F, 0x689F, 0x688F, 0x68AD, 0x6894, 0x689D, 0x689B, 0x6883,
- 0x6AAE, 0x68B9, 0x6874, 0x68B5, 0x68A0, 0x68BA, 0x690F, 0x688D,
- 0x687E, 0x6901, 0x68CA, 0x6908, 0x68D8, 0x6922, 0x6926, 0x68E1,
- 0x690C, 0x68CD, 0x68D4, 0x68E7, 0x68D5, 0x6936, 0x6912, 0x6904,
- 0x68D7, 0x68E3, 0x6925, 0x68F9, 0x68E0, 0x68EF, 0x6928, 0x692A,
- 0x691A, 0x6923, 0x6921, 0x68C6, 0x6979, 0x6977, 0x695C, 0x6978,
- 0x696B, 0x6954, 0x697E, 0x696E, 0x6939, 0x6974, 0x693D, 0x6959,
- 0x6930, 0x6961, 0x695E, 0x695D, 0x6981, 0x696A, 0x69B2, 0x69AE,
- 0x69D0, 0x69BF, 0x69C1, 0x69D3, 0x69BE, 0x69CE, 0x5BE8, 0x69CA,
- 0x69DD, 0x69BB, 0x69C3, 0x69A7, 0x6A2E, 0x6991, 0x69A0, 0x699C,
- 0x6995, 0x69B4, 0x69DE, 0x69E8, 0x6A02, 0x6A1B, 0x69FF, 0x6B0A,
- 0x69F9, 0x69F2, 0x69E7, 0x6A05, 0x69B1, 0x6A1E, 0x69ED, 0x6A14,
- 0x69EB, 0x6A0A, 0x6A12, 0x6AC1, 0x6A23, 0x6A13, 0x6A44, 0x6A0C,
- 0x6A72, 0x6A36, 0x6A78, 0x6A47, 0x6A62, 0x6A59, 0x6A66, 0x6A48,
- 0x6A38, 0x6A22, 0x6A90, 0x6A8D, 0x6AA0, 0x6A84, 0x6AA2, 0x6AA3,
- 0x6A97, 0x8617, 0x6ABB, 0x6AC3, 0x6AC2, 0x6AB8, 0x6AB3, 0x6AAC,
- 0x6ADE, 0x6AD1, 0x6ADF, 0x6AAA, 0x6ADA, 0x6AEA, 0x6AFB, 0x6B05,
- 0x8616, 0x6AFA, 0x6B12, 0x6B16, 0x9B31, 0x6B1F, 0x6B38, 0x6B37,
- 0x76DC, 0x6B39, 0x98EE, 0x6B47, 0x6B43, 0x6B49, 0x6B50, 0x6B59,
- 0x6B54, 0x6B5B, 0x6B5F, 0x6B61, 0x6B78, 0x6B79, 0x6B7F, 0x6B80,
- 0x6B84, 0x6B83, 0x6B8D, 0x6B98, 0x6B95, 0x6B9E, 0x6BA4, 0x6BAA,
- 0x6BAB, 0x6BAF, 0x6BB2, 0x6BB1, 0x6BB3, 0x6BB7, 0x6BBC, 0x6BC6,
- 0x6BCB, 0x6BD3, 0x6BDF, 0x6BEC, 0x6BEB, 0x6BF3, 0x6BEF, 0x9EBE,
- 0x6C08, 0x6C13, 0x6C14, 0x6C1B, 0x6C24, 0x6C23, 0x6C5E, 0x6C55,
- 0x6C62, 0x6C6A, 0x6C82, 0x6C8D, 0x6C9A, 0x6C81, 0x6C9B, 0x6C7E,
- 0x6C68, 0x6C73, 0x6C92, 0x6C90, 0x6CC4, 0x6CF1, 0x6CD3, 0x6CBD,
- 0x6CD7, 0x6CC5, 0x6CDD, 0x6CAE, 0x6CB1, 0x6CBE, 0x6CBA, 0x6CDB,
- 0x6CEF, 0x6CD9, 0x6CEA, 0x6D1F, 0x884D, 0x6D36, 0x6D2B, 0x6D3D,
- 0x6D38, 0x6D19, 0x6D35, 0x6D33, 0x6D12, 0x6D0C, 0x6D63, 0x6D93,
- 0x6D64, 0x6D5A, 0x6D79, 0x6D59, 0x6D8E, 0x6D95, 0x6FE4, 0x6D85,
- 0x6DF9, 0x6E15, 0x6E0A, 0x6DB5, 0x6DC7, 0x6DE6, 0x6DB8, 0x6DC6,
- 0x6DEC, 0x6DDE, 0x6DCC, 0x6DE8, 0x6DD2, 0x6DC5, 0x6DFA, 0x6DD9,
- 0x6DE4, 0x6DD5, 0x6DEA, 0x6DEE, 0x6E2D, 0x6E6E, 0x6E2E, 0x6E19,
- 0x6E72, 0x6E5F, 0x6E3E, 0x6E23, 0x6E6B, 0x6E2B, 0x6E76, 0x6E4D,
- 0x6E1F, 0x6E43, 0x6E3A, 0x6E4E, 0x6E24, 0x6EFF, 0x6E1D, 0x6E38,
- 0x6E82, 0x6EAA, 0x6E98, 0x6EC9, 0x6EB7, 0x6ED3, 0x6EBD, 0x6EAF,
- 0x6EC4, 0x6EB2, 0x6ED4, 0x6ED5, 0x6E8F, 0x6EA5, 0x6EC2, 0x6E9F,
- 0x6F41, 0x6F11, 0x704C, 0x6EEC, 0x6EF8, 0x6EFE, 0x6F3F, 0x6EF2,
- 0x6F31, 0x6EEF, 0x6F32, 0x6ECC, 0x6F3E, 0x6F13, 0x6EF7, 0x6F86,
- 0x6F7A, 0x6F78, 0x6F81, 0x6F80, 0x6F6F, 0x6F5B, 0x6FF3, 0x6F6D,
- 0x6F82, 0x6F7C, 0x6F58, 0x6F8E, 0x6F91, 0x6FC2, 0x6F66, 0x6FB3,
- 0x6FA3, 0x6FA1, 0x6FA4, 0x6FB9, 0x6FC6, 0x6FAA, 0x6FDF, 0x6FD5,
- 0x6FEC, 0x6FD4, 0x6FD8, 0x6FF1, 0x6FEE, 0x6FDB, 0x7009, 0x700B,
- 0x6FFA, 0x7011, 0x7001, 0x700F, 0x6FFE, 0x701B, 0x701A, 0x6F74,
- 0x701D, 0x7018, 0x701F, 0x7030, 0x703E, 0x7032, 0x7051, 0x7063,
- 0x7099, 0x7092, 0x70AF, 0x70F1, 0x70AC, 0x70B8, 0x70B3, 0x70AE,
- 0x70DF, 0x70CB, 0x70DD, 0x70D9, 0x7109, 0x70FD, 0x711C, 0x7119,
- 0x7165, 0x7155, 0x7188, 0x7166, 0x7162, 0x714C, 0x7156, 0x716C,
- 0x718F, 0x71FB, 0x7184, 0x7195, 0x71A8, 0x71AC, 0x71D7, 0x71B9,
- 0x71BE, 0x71D2, 0x71C9, 0x71D4, 0x71CE, 0x71E0, 0x71EC, 0x71E7,
- 0x71F5, 0x71FC, 0x71F9, 0x71FF, 0x720D, 0x7210, 0x721B, 0x7228,
- 0x722D, 0x722C, 0x7230, 0x7232, 0x723B, 0x723C, 0x723F, 0x7240,
- 0x7246, 0x724B, 0x7258, 0x7274, 0x727E, 0x7282, 0x7281, 0x7287,
- 0x7292, 0x7296, 0x72A2, 0x72A7, 0x72B9, 0x72B2, 0x72C3, 0x72C6,
- 0x72C4, 0x72CE, 0x72D2, 0x72E2, 0x72E0, 0x72E1, 0x72F9, 0x72F7,
- 0x500F, 0x7317, 0x730A, 0x731C, 0x7316, 0x731D, 0x7334, 0x732F,
- 0x7329, 0x7325, 0x733E, 0x734E, 0x734F, 0x9ED8, 0x7357, 0x736A,
- 0x7368, 0x7370, 0x7378, 0x7375, 0x737B, 0x737A, 0x73C8, 0x73B3,
- 0x73CE, 0x73BB, 0x73C0, 0x73E5, 0x73EE, 0x73DE, 0x74A2, 0x7405,
- 0x746F, 0x7425, 0x73F8, 0x7432, 0x743A, 0x7455, 0x743F, 0x745F,
- 0x7459, 0x7441, 0x745C, 0x7469, 0x7470, 0x7463, 0x746A, 0x7476,
- 0x747E, 0x748B, 0x749E, 0x74A7, 0x74CA, 0x74CF, 0x74D4, 0x73F1,
- 0x74E0, 0x74E3, 0x74E7, 0x74E9, 0x74EE, 0x74F2, 0x74F0, 0x74F1,
- 0x74F8, 0x74F7, 0x7504, 0x7503, 0x7505, 0x750C, 0x750E, 0x750D,
- 0x7515, 0x7513, 0x751E, 0x7526, 0x752C, 0x753C, 0x7544, 0x754D,
- 0x754A, 0x7549, 0x755B, 0x7546, 0x755A, 0x7569, 0x7564, 0x7567,
- 0x756B, 0x756D, 0x7578, 0x7576, 0x7586, 0x7587, 0x7574, 0x758A,
- 0x7589, 0x7582, 0x7594, 0x759A, 0x759D, 0x75A5, 0x75A3, 0x75C2,
- 0x75B3, 0x75C3, 0x75B5, 0x75BD, 0x75B8, 0x75BC, 0x75B1, 0x75CD,
- 0x75CA, 0x75D2, 0x75D9, 0x75E3, 0x75DE, 0x75FE, 0x75FF, 0x75FC,
- 0x7601, 0x75F0, 0x75FA, 0x75F2, 0x75F3, 0x760B, 0x760D, 0x7609,
- 0x761F, 0x7627, 0x7620, 0x7621, 0x7622, 0x7624, 0x7634, 0x7630,
- 0x763B, 0x7647, 0x7648, 0x7646, 0x765C, 0x7658, 0x7661, 0x7662,
- 0x7668, 0x7669, 0x766A, 0x7667, 0x766C, 0x7670, 0x7672, 0x7676,
- 0x7678, 0x767C, 0x7680, 0x7683, 0x7688, 0x768B, 0x768E, 0x7696,
- 0x7693, 0x7699, 0x769A, 0x76B0, 0x76B4, 0x76B8, 0x76B9, 0x76BA,
- 0x76C2, 0x76CD, 0x76D6, 0x76D2, 0x76DE, 0x76E1, 0x76E5, 0x76E7,
- 0x76EA, 0x862F, 0x76FB, 0x7708, 0x7707, 0x7704, 0x7729, 0x7724,
- 0x771E, 0x7725, 0x7726, 0x771B, 0x7737, 0x7738, 0x7747, 0x775A,
- 0x7768, 0x776B, 0x775B, 0x7765, 0x777F, 0x777E, 0x7779, 0x778E,
- 0x778B, 0x7791, 0x77A0, 0x779E, 0x77B0, 0x77B6, 0x77B9, 0x77BF,
- 0x77BC, 0x77BD, 0x77BB, 0x77C7, 0x77CD, 0x77D7, 0x77DA, 0x77DC,
- 0x77E3, 0x77EE, 0x77FC, 0x780C, 0x7812, 0x7926, 0x7820, 0x792A,
- 0x7845, 0x788E, 0x7874, 0x7886, 0x787C, 0x789A, 0x788C, 0x78A3,
- 0x78B5, 0x78AA, 0x78AF, 0x78D1, 0x78C6, 0x78CB, 0x78D4, 0x78BE,
- 0x78BC, 0x78C5, 0x78CA, 0x78EC, 0x78E7, 0x78DA, 0x78FD, 0x78F4,
- 0x7907, 0x7912, 0x7911, 0x7919, 0x792C, 0x792B, 0x7940, 0x7960,
- 0x7957, 0x795F, 0x795A, 0x7955, 0x7953, 0x797A, 0x797F, 0x798A,
- 0x799D, 0x79A7, 0x9F4B, 0x79AA, 0x79AE, 0x79B3, 0x79B9, 0x79BA,
- 0x79C9, 0x79D5, 0x79E7, 0x79EC, 0x79E1, 0x79E3, 0x7A08, 0x7A0D,
- 0x7A18, 0x7A19, 0x7A20, 0x7A1F, 0x7980, 0x7A31, 0x7A3B, 0x7A3E,
- 0x7A37, 0x7A43, 0x7A57, 0x7A49, 0x7A61, 0x7A62, 0x7A69, 0x9F9D,
- 0x7A70, 0x7A79, 0x7A7D, 0x7A88, 0x7A97, 0x7A95, 0x7A98, 0x7A96,
- 0x7AA9, 0x7AC8, 0x7AB0, 0x7AB6, 0x7AC5, 0x7AC4, 0x7ABF, 0x9083,
- 0x7AC7, 0x7ACA, 0x7ACD, 0x7ACF, 0x7AD5, 0x7AD3, 0x7AD9, 0x7ADA,
- 0x7ADD, 0x7AE1, 0x7AE2, 0x7AE6, 0x7AED, 0x7AF0, 0x7B02, 0x7B0F,
- 0x7B0A, 0x7B06, 0x7B33, 0x7B18, 0x7B19, 0x7B1E, 0x7B35, 0x7B28,
- 0x7B36, 0x7B50, 0x7B7A, 0x7B04, 0x7B4D, 0x7B0B, 0x7B4C, 0x7B45,
- 0x7B75, 0x7B65, 0x7B74, 0x7B67, 0x7B70, 0x7B71, 0x7B6C, 0x7B6E,
- 0x7B9D, 0x7B98, 0x7B9F, 0x7B8D, 0x7B9C, 0x7B9A, 0x7B8B, 0x7B92,
- 0x7B8F, 0x7B5D, 0x7B99, 0x7BCB, 0x7BC1, 0x7BCC, 0x7BCF, 0x7BB4,
- 0x7BC6, 0x7BDD, 0x7BE9, 0x7C11, 0x7C14, 0x7BE6, 0x7BE5, 0x7C60,
- 0x7C00, 0x7C07, 0x7C13, 0x7BF3, 0x7BF7, 0x7C17, 0x7C0D, 0x7BF6,
- 0x7C23, 0x7C27, 0x7C2A, 0x7C1F, 0x7C37, 0x7C2B, 0x7C3D, 0x7C4C,
- 0x7C43, 0x7C54, 0x7C4F, 0x7C40, 0x7C50, 0x7C58, 0x7C5F, 0x7C64,
- 0x7C56, 0x7C65, 0x7C6C, 0x7C75, 0x7C83, 0x7C90, 0x7CA4, 0x7CAD,
- 0x7CA2, 0x7CAB, 0x7CA1, 0x7CA8, 0x7CB3, 0x7CB2, 0x7CB1, 0x7CAE,
- 0x7CB9, 0x7CBD, 0x7CC0, 0x7CC5, 0x7CC2, 0x7CD8, 0x7CD2, 0x7CDC,
- 0x7CE2, 0x9B3B, 0x7CEF, 0x7CF2, 0x7CF4, 0x7CF6, 0x7CFA, 0x7D06,
- 0x7D02, 0x7D1C, 0x7D15, 0x7D0A, 0x7D45, 0x7D4B, 0x7D2E, 0x7D32,
- 0x7D3F, 0x7D35, 0x7D46, 0x7D73, 0x7D56, 0x7D4E, 0x7D72, 0x7D68,
- 0x7D6E, 0x7D4F, 0x7D63, 0x7D93, 0x7D89, 0x7D5B, 0x7D8F, 0x7D7D,
- 0x7D9B, 0x7DBA, 0x7DAE, 0x7DA3, 0x7DB5, 0x7DC7, 0x7DBD, 0x7DAB,
- 0x7E3D, 0x7DA2, 0x7DAF, 0x7DDC, 0x7DB8, 0x7D9F, 0x7DB0, 0x7DD8,
- 0x7DDD, 0x7DE4, 0x7DDE, 0x7DFB, 0x7DF2, 0x7DE1, 0x7E05, 0x7E0A,
- 0x7E23, 0x7E21, 0x7E12, 0x7E31, 0x7E1F, 0x7E09, 0x7E0B, 0x7E22,
- 0x7E46, 0x7E66, 0x7E3B, 0x7E35, 0x7E39, 0x7E43, 0x7E37, 0x7E32,
- 0x7E3A, 0x7E67, 0x7E5D, 0x7E56, 0x7E5E, 0x7E59, 0x7E5A, 0x7E79,
- 0x7E6A, 0x7E69, 0x7E7C, 0x7E7B, 0x7E83, 0x7DD5, 0x7E7D, 0x8FAE,
- 0x7E7F, 0x7E88, 0x7E89, 0x7E8C, 0x7E92, 0x7E90, 0x7E93, 0x7E94,
- 0x7E96, 0x7E8E, 0x7E9B, 0x7E9C, 0x7F38, 0x7F3A, 0x7F45, 0x7F4C,
- 0x7F4D, 0x7F4E, 0x7F50, 0x7F51, 0x7F55, 0x7F54, 0x7F58, 0x7F5F,
- 0x7F60, 0x7F68, 0x7F69, 0x7F67, 0x7F78, 0x7F82, 0x7F86, 0x7F83,
- 0x7F88, 0x7F87, 0x7F8C, 0x7F94, 0x7F9E, 0x7F9D, 0x7F9A, 0x7FA3,
- 0x7FAF, 0x7FB2, 0x7FB9, 0x7FAE, 0x7FB6, 0x7FB8, 0x8B71, 0x7FC5,
- 0x7FC6, 0x7FCA, 0x7FD5, 0x7FD4, 0x7FE1, 0x7FE6, 0x7FE9, 0x7FF3,
- 0x7FF9, 0x98DC, 0x8006, 0x8004, 0x800B, 0x8012, 0x8018, 0x8019,
- 0x801C, 0x8021, 0x8028, 0x803F, 0x803B, 0x804A, 0x8046, 0x8052,
- 0x8058, 0x805A, 0x805F, 0x8062, 0x8068, 0x8073, 0x8072, 0x8070,
- 0x8076, 0x8079, 0x807D, 0x807F, 0x8084, 0x8086, 0x8085, 0x809B,
- 0x8093, 0x809A, 0x80AD, 0x5190, 0x80AC, 0x80DB, 0x80E5, 0x80D9,
- 0x80DD, 0x80C4, 0x80DA, 0x80D6, 0x8109, 0x80EF, 0x80F1, 0x811B,
- 0x8129, 0x8123, 0x812F, 0x814B, 0x968B, 0x8146, 0x813E, 0x8153,
- 0x8151, 0x80FC, 0x8171, 0x816E, 0x8165, 0x8166, 0x8174, 0x8183,
- 0x8188, 0x818A, 0x8180, 0x8182, 0x81A0, 0x8195, 0x81A4, 0x81A3,
- 0x815F, 0x8193, 0x81A9, 0x81B0, 0x81B5, 0x81BE, 0x81B8, 0x81BD,
- 0x81C0, 0x81C2, 0x81BA, 0x81C9, 0x81CD, 0x81D1, 0x81D9, 0x81D8,
- 0x81C8, 0x81DA, 0x81DF, 0x81E0, 0x81E7, 0x81FA, 0x81FB, 0x81FE,
- 0x8201, 0x8202, 0x8205, 0x8207, 0x820A, 0x820D, 0x8210, 0x8216,
- 0x8229, 0x822B, 0x8238, 0x8233, 0x8240, 0x8259, 0x8258, 0x825D,
- 0x825A, 0x825F, 0x8264, 0x8262, 0x8268, 0x826A, 0x826B, 0x822E,
- 0x8271, 0x8277, 0x8278, 0x827E, 0x828D, 0x8292, 0x82AB, 0x829F,
- 0x82BB, 0x82AC, 0x82E1, 0x82E3, 0x82DF, 0x82D2, 0x82F4, 0x82F3,
- 0x82FA, 0x8393, 0x8303, 0x82FB, 0x82F9, 0x82DE, 0x8306, 0x82DC,
- 0x8309, 0x82D9, 0x8335, 0x8334, 0x8316, 0x8332, 0x8331, 0x8340,
- 0x8339, 0x8350, 0x8345, 0x832F, 0x832B, 0x8317, 0x8318, 0x8385,
- 0x839A, 0x83AA, 0x839F, 0x83A2, 0x8396, 0x8323, 0x838E, 0x8387,
- 0x838A, 0x837C, 0x83B5, 0x8373, 0x8375, 0x83A0, 0x8389, 0x83A8,
- 0x83F4, 0x8413, 0x83EB, 0x83CE, 0x83FD, 0x8403, 0x83D8, 0x840B,
- 0x83C1, 0x83F7, 0x8407, 0x83E0, 0x83F2, 0x840D, 0x8422, 0x8420,
- 0x83BD, 0x8438, 0x8506, 0x83FB, 0x846D, 0x842A, 0x843C, 0x855A,
- 0x8484, 0x8477, 0x846B, 0x84AD, 0x846E, 0x8482, 0x8469, 0x8446,
- 0x842C, 0x846F, 0x8479, 0x8435, 0x84CA, 0x8462, 0x84B9, 0x84BF,
- 0x849F, 0x84D9, 0x84CD, 0x84BB, 0x84DA, 0x84D0, 0x84C1, 0x84C6,
- 0x84D6, 0x84A1, 0x8521, 0x84FF, 0x84F4, 0x8517, 0x8518, 0x852C,
- 0x851F, 0x8515, 0x8514, 0x84FC, 0x8540, 0x8563, 0x8558, 0x8548,
- 0x8541, 0x8602, 0x854B, 0x8555, 0x8580, 0x85A4, 0x8588, 0x8591,
- 0x858A, 0x85A8, 0x856D, 0x8594, 0x859B, 0x85EA, 0x8587, 0x859C,
- 0x8577, 0x857E, 0x8590, 0x85C9, 0x85BA, 0x85CF, 0x85B9, 0x85D0,
- 0x85D5, 0x85DD, 0x85E5, 0x85DC, 0x85F9, 0x860A, 0x8613, 0x860B,
- 0x85FE, 0x85FA, 0x8606, 0x8622, 0x861A, 0x8630, 0x863F, 0x864D,
- 0x4E55, 0x8654, 0x865F, 0x8667, 0x8671, 0x8693, 0x86A3, 0x86A9,
- 0x86AA, 0x868B, 0x868C, 0x86B6, 0x86AF, 0x86C4, 0x86C6, 0x86B0,
- 0x86C9, 0x8823, 0x86AB, 0x86D4, 0x86DE, 0x86E9, 0x86EC, 0x86DF,
- 0x86DB, 0x86EF, 0x8712, 0x8706, 0x8708, 0x8700, 0x8703, 0x86FB,
- 0x8711, 0x8709, 0x870D, 0x86F9, 0x870A, 0x8734, 0x873F, 0x8737,
- 0x873B, 0x8725, 0x8729, 0x871A, 0x8760, 0x875F, 0x8778, 0x874C,
- 0x874E, 0x8774, 0x8757, 0x8768, 0x876E, 0x8759, 0x8753, 0x8763,
- 0x876A, 0x8805, 0x87A2, 0x879F, 0x8782, 0x87AF, 0x87CB, 0x87BD,
- 0x87C0, 0x87D0, 0x96D6, 0x87AB, 0x87C4, 0x87B3, 0x87C7, 0x87C6,
- 0x87BB, 0x87EF, 0x87F2, 0x87E0, 0x880F, 0x880D, 0x87FE, 0x87F6,
- 0x87F7, 0x880E, 0x87D2, 0x8811, 0x8816, 0x8815, 0x8822, 0x8821,
- 0x8831, 0x8836, 0x8839, 0x8827, 0x883B, 0x8844, 0x8842, 0x8852,
- 0x8859, 0x885E, 0x8862, 0x886B, 0x8881, 0x887E, 0x889E, 0x8875,
- 0x887D, 0x88B5, 0x8872, 0x8882, 0x8897, 0x8892, 0x88AE, 0x8899,
- 0x88A2, 0x888D, 0x88A4, 0x88B0, 0x88BF, 0x88B1, 0x88C3, 0x88C4,
- 0x88D4, 0x88D8, 0x88D9, 0x88DD, 0x88F9, 0x8902, 0x88FC, 0x88F4,
- 0x88E8, 0x88F2, 0x8904, 0x890C, 0x890A, 0x8913, 0x8943, 0x891E,
- 0x8925, 0x892A, 0x892B, 0x8941, 0x8944, 0x893B, 0x8936, 0x8938,
- 0x894C, 0x891D, 0x8960, 0x895E, 0x8966, 0x8964, 0x896D, 0x896A,
- 0x896F, 0x8974, 0x8977, 0x897E, 0x8983, 0x8988, 0x898A, 0x8993,
- 0x8998, 0x89A1, 0x89A9, 0x89A6, 0x89AC, 0x89AF, 0x89B2, 0x89BA,
- 0x89BD, 0x89BF, 0x89C0, 0x89DA, 0x89DC, 0x89DD, 0x89E7, 0x89F4,
- 0x89F8, 0x8A03, 0x8A16, 0x8A10, 0x8A0C, 0x8A1B, 0x8A1D, 0x8A25,
- 0x8A36, 0x8A41, 0x8A5B, 0x8A52, 0x8A46, 0x8A48, 0x8A7C, 0x8A6D,
- 0x8A6C, 0x8A62, 0x8A85, 0x8A82, 0x8A84, 0x8AA8, 0x8AA1, 0x8A91,
- 0x8AA5, 0x8AA6, 0x8A9A, 0x8AA3, 0x8AC4, 0x8ACD, 0x8AC2, 0x8ADA,
- 0x8AEB, 0x8AF3, 0x8AE7, 0x8AE4, 0x8AF1, 0x8B14, 0x8AE0, 0x8AE2,
- 0x8AF7, 0x8ADE, 0x8ADB, 0x8B0C, 0x8B07, 0x8B1A, 0x8AE1, 0x8B16,
- 0x8B10, 0x8B17, 0x8B20, 0x8B33, 0x97AB, 0x8B26, 0x8B2B, 0x8B3E,
- 0x8B28, 0x8B41, 0x8B4C, 0x8B4F, 0x8B4E, 0x8B49, 0x8B56, 0x8B5B,
- 0x8B5A, 0x8B6B, 0x8B5F, 0x8B6C, 0x8B6F, 0x8B74, 0x8B7D, 0x8B80,
- 0x8B8C, 0x8B8E, 0x8B92, 0x8B93, 0x8B96, 0x8B99, 0x8B9A, 0x8C3A,
- 0x8C41, 0x8C3F, 0x8C48, 0x8C4C, 0x8C4E, 0x8C50, 0x8C55, 0x8C62,
- 0x8C6C, 0x8C78, 0x8C7A, 0x8C82, 0x8C89, 0x8C85, 0x8C8A, 0x8C8D,
- 0x8C8E, 0x8C94, 0x8C7C, 0x8C98, 0x621D, 0x8CAD, 0x8CAA, 0x8CBD,
- 0x8CB2, 0x8CB3, 0x8CAE, 0x8CB6, 0x8CC8, 0x8CC1, 0x8CE4, 0x8CE3,
- 0x8CDA, 0x8CFD, 0x8CFA, 0x8CFB, 0x8D04, 0x8D05, 0x8D0A, 0x8D07,
- 0x8D0F, 0x8D0D, 0x8D10, 0x9F4E, 0x8D13, 0x8CCD, 0x8D14, 0x8D16,
- 0x8D67, 0x8D6D, 0x8D71, 0x8D73, 0x8D81, 0x8D99, 0x8DC2, 0x8DBE,
- 0x8DBA, 0x8DCF, 0x8DDA, 0x8DD6, 0x8DCC, 0x8DDB, 0x8DCB, 0x8DEA,
- 0x8DEB, 0x8DDF, 0x8DE3, 0x8DFC, 0x8E08, 0x8E09, 0x8DFF, 0x8E1D,
- 0x8E1E, 0x8E10, 0x8E1F, 0x8E42, 0x8E35, 0x8E30, 0x8E34, 0x8E4A,
- 0x8E47, 0x8E49, 0x8E4C, 0x8E50, 0x8E48, 0x8E59, 0x8E64, 0x8E60,
- 0x8E2A, 0x8E63, 0x8E55, 0x8E76, 0x8E72, 0x8E7C, 0x8E81, 0x8E87,
- 0x8E85, 0x8E84, 0x8E8B, 0x8E8A, 0x8E93, 0x8E91, 0x8E94, 0x8E99,
- 0x8EAA, 0x8EA1, 0x8EAC, 0x8EB0, 0x8EC6, 0x8EB1, 0x8EBE, 0x8EC5,
- 0x8EC8, 0x8ECB, 0x8EDB, 0x8EE3, 0x8EFC, 0x8EFB, 0x8EEB, 0x8EFE,
- 0x8F0A, 0x8F05, 0x8F15, 0x8F12, 0x8F19, 0x8F13, 0x8F1C, 0x8F1F,
- 0x8F1B, 0x8F0C, 0x8F26, 0x8F33, 0x8F3B, 0x8F39, 0x8F45, 0x8F42,
- 0x8F3E, 0x8F4C, 0x8F49, 0x8F46, 0x8F4E, 0x8F57, 0x8F5C, 0x8F62,
- 0x8F63, 0x8F64, 0x8F9C, 0x8F9F, 0x8FA3, 0x8FAD, 0x8FAF, 0x8FB7,
- 0x8FDA, 0x8FE5, 0x8FE2, 0x8FEA, 0x8FEF, 0x9087, 0x8FF4, 0x9005,
- 0x8FF9, 0x8FFA, 0x9011, 0x9015, 0x9021, 0x900D, 0x901E, 0x9016,
- 0x900B, 0x9027, 0x9036, 0x9035, 0x9039, 0x8FF8, 0x904F, 0x9050,
- 0x9051, 0x9052, 0x900E, 0x9049, 0x903E, 0x9056, 0x9058, 0x905E,
- 0x9068, 0x906F, 0x9076, 0x96A8, 0x9072, 0x9082, 0x907D, 0x9081,
- 0x9080, 0x908A, 0x9089, 0x908F, 0x90A8, 0x90AF, 0x90B1, 0x90B5,
- 0x90E2, 0x90E4, 0x6248, 0x90DB, 0x9102, 0x9112, 0x9119, 0x9132,
- 0x9130, 0x914A, 0x9156, 0x9158, 0x9163, 0x9165, 0x9169, 0x9173,
- 0x9172, 0x918B, 0x9189, 0x9182, 0x91A2, 0x91AB, 0x91AF, 0x91AA,
- 0x91B5, 0x91B4, 0x91BA, 0x91C0, 0x91C1, 0x91C9, 0x91CB, 0x91D0,
- 0x91D6, 0x91DF, 0x91E1, 0x91DB, 0x91FC, 0x91F5, 0x91F6, 0x921E,
- 0x91FF, 0x9214, 0x922C, 0x9215, 0x9211, 0x925E, 0x9257, 0x9245,
- 0x9249, 0x9264, 0x9248, 0x9295, 0x923F, 0x924B, 0x9250, 0x929C,
- 0x9296, 0x9293, 0x929B, 0x925A, 0x92CF, 0x92B9, 0x92B7, 0x92E9,
- 0x930F, 0x92FA, 0x9344, 0x932E, 0x9319, 0x9322, 0x931A, 0x9323,
- 0x933A, 0x9335, 0x933B, 0x935C, 0x9360, 0x937C, 0x936E, 0x9356,
- 0x93B0, 0x93AC, 0x93AD, 0x9394, 0x93B9, 0x93D6, 0x93D7, 0x93E8,
- 0x93E5, 0x93D8, 0x93C3, 0x93DD, 0x93D0, 0x93C8, 0x93E4, 0x941A,
- 0x9414, 0x9413, 0x9403, 0x9407, 0x9410, 0x9436, 0x942B, 0x9435,
- 0x9421, 0x943A, 0x9441, 0x9452, 0x9444, 0x945B, 0x9460, 0x9462,
- 0x945E, 0x946A, 0x9229, 0x9470, 0x9475, 0x9477, 0x947D, 0x945A,
- 0x947C, 0x947E, 0x9481, 0x947F, 0x9582, 0x9587, 0x958A, 0x9594,
- 0x9596, 0x9598, 0x9599, 0x95A0, 0x95A8, 0x95A7, 0x95AD, 0x95BC,
- 0x95BB, 0x95B9, 0x95BE, 0x95CA, 0x6FF6, 0x95C3, 0x95CD, 0x95CC,
- 0x95D5, 0x95D4, 0x95D6, 0x95DC, 0x95E1, 0x95E5, 0x95E2, 0x9621,
- 0x9628, 0x962E, 0x962F, 0x9642, 0x964C, 0x964F, 0x964B, 0x9677,
- 0x965C, 0x965E, 0x965D, 0x965F, 0x9666, 0x9672, 0x966C, 0x968D,
- 0x9698, 0x9695, 0x9697, 0x96AA, 0x96A7, 0x96B1, 0x96B2, 0x96B0,
- 0x96B4, 0x96B6, 0x96B8, 0x96B9, 0x96CE, 0x96CB, 0x96C9, 0x96CD,
- 0x894D, 0x96DC, 0x970D, 0x96D5, 0x96F9, 0x9704, 0x9706, 0x9708,
- 0x9713, 0x970E, 0x9711, 0x970F, 0x9716, 0x9719, 0x9724, 0x972A,
- 0x9730, 0x9739, 0x973D, 0x973E, 0x9744, 0x9746, 0x9748, 0x9742,
- 0x9749, 0x975C, 0x9760, 0x9764, 0x9766, 0x9768, 0x52D2, 0x976B,
- 0x9771, 0x9779, 0x9785, 0x977C, 0x9781, 0x977A, 0x9786, 0x978B,
- 0x978F, 0x9790, 0x979C, 0x97A8, 0x97A6, 0x97A3, 0x97B3, 0x97B4,
- 0x97C3, 0x97C6, 0x97C8, 0x97CB, 0x97DC, 0x97ED, 0x9F4F, 0x97F2,
- 0x7ADF, 0x97F6, 0x97F5, 0x980F, 0x980C, 0x9838, 0x9824, 0x9821,
- 0x9837, 0x983D, 0x9846, 0x984F, 0x984B, 0x986B, 0x986F, 0x9870,
- 0x9871, 0x9874, 0x9873, 0x98AA, 0x98AF, 0x98B1, 0x98B6, 0x98C4,
- 0x98C3, 0x98C6, 0x98E9, 0x98EB, 0x9903, 0x9909, 0x9912, 0x9914,
- 0x9918, 0x9921, 0x991D, 0x991E, 0x9924, 0x9920, 0x992C, 0x992E,
- 0x993D, 0x993E, 0x9942, 0x9949, 0x9945, 0x9950, 0x994B, 0x9951,
- 0x9952, 0x994C, 0x9955, 0x9997, 0x9998, 0x99A5, 0x99AD, 0x99AE,
- 0x99BC, 0x99DF, 0x99DB, 0x99DD, 0x99D8, 0x99D1, 0x99ED, 0x99EE,
- 0x99F1, 0x99F2, 0x99FB, 0x99F8, 0x9A01, 0x9A0F, 0x9A05, 0x99E2,
- 0x9A19, 0x9A2B, 0x9A37, 0x9A45, 0x9A42, 0x9A40, 0x9A43, 0x9A3E,
- 0x9A55, 0x9A4D, 0x9A5B, 0x9A57, 0x9A5F, 0x9A62, 0x9A65, 0x9A64,
- 0x9A69, 0x9A6B, 0x9A6A, 0x9AAD, 0x9AB0, 0x9ABC, 0x9AC0, 0x9ACF,
- 0x9AD1, 0x9AD3, 0x9AD4, 0x9ADE, 0x9ADF, 0x9AE2, 0x9AE3, 0x9AE6,
- 0x9AEF, 0x9AEB, 0x9AEE, 0x9AF4, 0x9AF1, 0x9AF7, 0x9AFB, 0x9B06,
- 0x9B18, 0x9B1A, 0x9B1F, 0x9B22, 0x9B23, 0x9B25, 0x9B27, 0x9B28,
- 0x9B29, 0x9B2A, 0x9B2E, 0x9B2F, 0x9B32, 0x9B44, 0x9B43, 0x9B4F,
- 0x9B4D, 0x9B4E, 0x9B51, 0x9B58, 0x9B74, 0x9B93, 0x9B83, 0x9B91,
- 0x9B96, 0x9B97, 0x9B9F, 0x9BA0, 0x9BA8, 0x9BB4, 0x9BC0, 0x9BCA,
- 0x9BB9, 0x9BC6, 0x9BCF, 0x9BD1, 0x9BD2, 0x9BE3, 0x9BE2, 0x9BE4,
- 0x9BD4, 0x9BE1, 0x9C3A, 0x9BF2, 0x9BF1, 0x9BF0, 0x9C15, 0x9C14,
- 0x9C09, 0x9C13, 0x9C0C, 0x9C06, 0x9C08, 0x9C12, 0x9C0A, 0x9C04,
- 0x9C2E, 0x9C1B, 0x9C25, 0x9C24, 0x9C21, 0x9C30, 0x9C47, 0x9C32,
- 0x9C46, 0x9C3E, 0x9C5A, 0x9C60, 0x9C67, 0x9C76, 0x9C78, 0x9CE7,
- 0x9CEC, 0x9CF0, 0x9D09, 0x9D08, 0x9CEB, 0x9D03, 0x9D06, 0x9D2A,
- 0x9D26, 0x9DAF, 0x9D23, 0x9D1F, 0x9D44, 0x9D15, 0x9D12, 0x9D41,
- 0x9D3F, 0x9D3E, 0x9D46, 0x9D48, 0x9D5D, 0x9D5E, 0x9D64, 0x9D51,
- 0x9D50, 0x9D59, 0x9D72, 0x9D89, 0x9D87, 0x9DAB, 0x9D6F, 0x9D7A,
- 0x9D9A, 0x9DA4, 0x9DA9, 0x9DB2, 0x9DC4, 0x9DC1, 0x9DBB, 0x9DB8,
- 0x9DBA, 0x9DC6, 0x9DCF, 0x9DC2, 0x9DD9, 0x9DD3, 0x9DF8, 0x9DE6,
- 0x9DED, 0x9DEF, 0x9DFD, 0x9E1A, 0x9E1B, 0x9E1E, 0x9E75, 0x9E79,
- 0x9E7D, 0x9E81, 0x9E88, 0x9E8B, 0x9E8C, 0x9E92, 0x9E95, 0x9E91,
- 0x9E9D, 0x9EA5, 0x9EA9, 0x9EB8, 0x9EAA, 0x9EAD, 0x9761, 0x9ECC,
- 0x9ECE, 0x9ECF, 0x9ED0, 0x9ED4, 0x9EDC, 0x9EDE, 0x9EDD, 0x9EE0,
- 0x9EE5, 0x9EE8, 0x9EEF, 0x9EF4, 0x9EF6, 0x9EF7, 0x9EF9, 0x9EFB,
- 0x9EFC, 0x9EFD, 0x9F07, 0x9F08, 0x76B7, 0x9F15, 0x9F21, 0x9F2C,
- 0x9F3E, 0x9F4A, 0x9F52, 0x9F54, 0x9F63, 0x9F5F, 0x9F60, 0x9F61,
- 0x9F66, 0x9F67, 0x9F6C, 0x9F6A, 0x9F77, 0x9F72, 0x9F76, 0x9F95,
- 0x9F9C, 0x9FA0, 0x582F, 0x69C7, 0x9059, 0x7464, 0x2642, 0x2500,
- 0x2501, 0x2502, 0x2503, 0x2504, 0x2505, 0x2506, 0x2507, 0x2508,
- 0x2509, 0x250A, 0x250B, 0x250C, 0x250D, 0x250E, 0x250F, 0x2510,
- 0x2511, 0x2512, 0x2513, 0x2514, 0x2515, 0x2516, 0x2517, 0x2518,
- 0x2519, 0x251A, 0x251B, 0x251C, 0x251D, 0x251E, 0x251F, 0x2520,
- 0x2521, 0x2522, 0x2523, 0x2524, 0x2525, 0x2526, 0x2527, 0x2528,
- 0x2529, 0x252A, 0x252B, 0x252C, 0x252D, 0x252E, 0x252F, 0x2530,
- 0x2531, 0x2532, 0x2533, 0x2534, 0x2535, 0x2536, 0x2537, 0x2538,
- 0x2539, 0x253A, 0x253B, 0x253C, 0x253D, 0x253E, 0x253F, 0x2540,
- 0x2541, 0x2542, 0x2543, 0x2544, 0x2545, 0x2546, 0x2547, 0x2548,
- 0x2549, 0x254A, 0x254B, 0x2460, 0x2461, 0x2462, 0x2463, 0x2464,
- 0x2465, 0x2466, 0x2467, 0x2468, 0x2469, 0x246A, 0x246B, 0x246C,
- 0x246D, 0x246E, 0x246F, 0x2470, 0x2471, 0x2472, 0x2473, 0x2160,
- 0x2161, 0x2162, 0x2163, 0x2164, 0x2165, 0x2166, 0x2167, 0x2168,
- 0x2169, 0x3349, 0x3314, 0x3322, 0x334D, 0x3318, 0x3327, 0x3303,
- 0x3336, 0x3351, 0x3357, 0x330D, 0x3326, 0x3323, 0x332B, 0x334A,
- 0x333B, 0x339C, 0x339D, 0x339E, 0x338E, 0x338F, 0x33C4, 0x33A1,
- 0x301D, 0x301F, 0x2116, 0x33CD, 0x2121, 0x32A4, 0x32A5, 0x32A6,
- 0x32A7, 0x32A8, 0x3231, 0x3232, 0x3239, 0x337E, 0x337D, 0x337C,
- 0x222E, 0x2211, 0x221A, 0x22A5, 0x2220, 0x221F, 0x22BF, 0x2229,
- 0x222A, 0x555E, 0x98F4, 0x6EA2, 0x9C2F, 0x6DEB, 0x8FC2, 0x6B1D,
- 0x53A9, 0x958F, 0x5642, 0x990C, 0x7130, 0x8956, 0x9DD7, 0x8FE6,
- 0x6062, 0x62D0, 0x6666, 0x559D, 0x845B, 0x9784, 0x5699, 0x6F97,
- 0x7FF0, 0x7FEB, 0x5FBD, 0x7947, 0x4FE0, 0x537F, 0x50C5, 0x8EC0,
- 0x55B0, 0x6ADB, 0x5C51, 0x9774, 0x7941, 0x6167, 0x7A3D, 0x7E6B,
- 0x834A, 0x9699, 0x5026, 0x5ACC, 0x6372, 0x9E7C, 0x8AFA, 0x5DF7,
- 0x663B, 0x6E9D, 0x9EB4, 0x9D60, 0x7511, 0x91C7, 0x698A, 0x6805,
- 0x85A9, 0x9BD6, 0x9306, 0x73CA, 0x53F1, 0x5C62, 0x906E, 0x6753,
- 0x707C, 0x7E61, 0x914B, 0x66D9, 0x6E1A, 0x85AF, 0x85F7, 0x54E8,
- 0x5EE0, 0x68A2, 0x8523, 0x91AC, 0x9798, 0x8755, 0x9771, 0x9017,
- 0x7FE0, 0x647A, 0x901D, 0x87EC, 0x64B0, 0x6813, 0x714E, 0x717D,
- 0x8A6E, 0x564C, 0x9061, 0x5275, 0x6414, 0x7626, 0x905C, 0x9A52,
- 0x817F, 0x9EDB, 0x5544, 0x6FEF, 0x7422, 0x86F8, 0x5DFD, 0x8FBF,
- 0x68DA, 0x9C48, 0x6A3D, 0x7C1E, 0x8A3B, 0x7026, 0x51CB, 0x6357,
- 0x69CC, 0x939A, 0x585A, 0x6451, 0x912D, 0x64E2, 0x6EBA, 0x5861,
- 0x985A, 0x5835, 0x5C60, 0x83DF, 0x8CED, 0x5858, 0x79B1, 0x9D07,
- 0x7006, 0x701E, 0x5678, 0x9041, 0x9813, 0x90A3, 0x8B0E, 0x7058,
- 0x6962, 0x79B0, 0x56CA, 0x724C, 0x9019, 0x79E4, 0x525D, 0x7BB8,
- 0x6F51, 0x91B1, 0x633D, 0x6249, 0x6A0B, 0x67CA, 0x7A17, 0x903C,
- 0x5A9B, 0x8B2C, 0x5EDF, 0x7015, 0x983B, 0x853D, 0x77A5, 0x5A29,
- 0x5E96, 0x6CE1, 0x84EC, 0x9830, 0x9C52, 0x9EB5, 0x5132, 0x9905,
- 0x7C7E, 0x9453, 0x6108, 0x7652, 0x7337, 0x7194, 0x8000, 0x840A,
- 0x907C, 0x6F23, 0x7149, 0x84EE, 0x6994, 0x881F, 0x5154, 0x5189,
- 0x5195, 0x51A4, 0x5539, 0x5533, 0x55E4, 0x5632, 0x56A5, 0x580B,
- 0x5ABE, 0x5BC3, 0x5C5B, 0x5E64, 0x6097, 0x6369, 0x6406, 0x6522,
- 0x6583, 0x67A6, 0x67B4, 0x689B, 0x688E, 0x6E6E, 0x71D7, 0x7228,
- 0x73CE, 0x7504, 0x750D, 0x7515, 0x7693, 0x787C, 0x7A31, 0x9F9D,
- 0x7B99, 0x7C90, 0x7CAE, 0x7D9B, 0x7DAE, 0x7D9F, 0x7FD4, 0x822E,
- 0x828D, 0x82D2, 0x8323, 0x8375, 0x8517, 0x853E, 0x8782, 0x87D2,
- 0x890A, 0x89AF, 0x8ADE, 0x8B41, 0x8DDA, 0x8E09, 0x8F13, 0x8FEA,
- 0x8FE9, 0x9058, 0x6248, 0x91C1, 0x95BB, 0x7762, 0x9724, 0x9760,
- 0x976D, 0x9824, 0x9B2E, 0x9B97, 0x9BF2, 0x9EAA, 0x9F9C, 0x3001,
- 0x3002, 0x203E, 0xFF3F, 0x30FC, 0x2015, 0x2010, 0x301C, 0x2016,
- 0xFF5C, 0x2026, 0x2025, 0xFF08, 0xFF09, 0x3014, 0x3015, 0xFF3B,
- 0xFF3D, 0xFF5B, 0xFF5D, 0x3008, 0x3009, 0x300A, 0x300B, 0x300C,
- 0x300D, 0x300E, 0x300F, 0x3010, 0x3011, 0xFF1D, 0x3041, 0x3043,
- 0x3045, 0x3047, 0x3049, 0x3063, 0x3083, 0x3085, 0x3087, 0x308E,
- 0x30A1, 0x30A3, 0x30A5, 0x30A7, 0x30A9, 0x30C3, 0x30E3, 0x30E5,
- 0x30E7, 0x30EE, 0x30F5, 0x30F6, 0x3349, 0x3314, 0x3322, 0x334D,
- 0x3318, 0x3327, 0x3303, 0x3336, 0x3351, 0x3357, 0x330D, 0x3326,
- 0x3323, 0x332B, 0x334A, 0x333B, 0x301D, 0x301E, 0x3094, 0x304B,
- 0x3051, 0x82A6, 0x8328, 0x5653, 0x53A9, 0x7259, 0x6C72, 0x7B08,
- 0x9957, 0x62F3, 0x9910, 0x976D, 0x717D, 0x7A7F, 0x7BAD, 0x63C3,
- 0x83DF, 0x7962, 0x53DB, 0x7BC7, 0x8FC4, 0x7C3E, 0x50CA, 0x5315,
- 0x55A9, 0x56AE, 0x5819, 0x591B, 0x5C28, 0x5ED0, 0x5ECF, 0x6241,
- 0x66C1, 0x6C08, 0x6E23, 0x6EEC, 0x7A97, 0x7BDD, 0x7FE9, 0x8422,
- 0x8759, 0x880E, 0x87D2, 0x9A19, 0x9EAD, 0xFFE4, 0xFF07, 0xFF02,
- 0x11A8, 0x25C1, 0x25B7, 0x21E9, 0x21E7, 0x21E6, 0x21E8, 0x25A2,
- 0x2667, 0x2661, 0x2664, 0x2662, 0x33A0, 0x33A2, 0x33A4, 0x33A5,
- 0x3397, 0x2113, 0x3398, 0x33B3, 0x33B2, 0x33B1, 0x33B0, 0x3385,
- 0x3386, 0x3387, 0x33CB, 0x3390, 0x33D4, 0x3396, 0x3322, 0x3316,
- 0x3318, 0x3315, 0x3303, 0x3323, 0x3357, 0x3342, 0x3339, 0x333B,
- 0x3300, 0x3331, 0x3347, 0x331E, 0x332A, 0x33CD, 0x337F, 0x2121,
- 0x260E, 0x3036, 0x3020, 0x00A9, 0x00AE, 0x0000, 0x2488, 0x2489,
- 0x248A, 0x248B, 0x248C, 0x248D, 0x248E, 0x248F, 0x2490, 0x2474,
- 0x2475, 0x2476, 0x2477, 0x2478, 0x2479, 0x247A, 0x247B, 0x247C,
- 0x247D, 0x247E, 0x247F, 0x2480, 0x2481, 0x2482, 0x2483, 0x2484,
- 0x2485, 0x2486, 0x2487, 0x3251, 0x2170, 0x2171, 0x2172, 0x2173,
- 0x2174, 0x2175, 0x2176, 0x2177, 0x2178, 0x2179, 0x3252, 0x3253,
- 0x3254, 0x3255, 0x3256, 0x3257, 0x3258, 0x3259, 0x325A, 0x325B,
- 0x249C, 0x249D, 0x249E, 0x249F, 0x24A0, 0x24A1, 0x24A2, 0x24A3,
- 0x24A4, 0x24A5, 0x24A6, 0x24A7, 0x24A8, 0x24A9, 0x24AA, 0x24AB,
- 0x24AC, 0x24AD, 0x24AE, 0x24AF, 0x24B0, 0x24B1, 0x24B2, 0x24B3,
- 0x24B4, 0x24B5, 0x3243, 0x323D, 0x323F, 0x3234, 0x3238, 0x3233,
- 0x323C, 0x3242, 0x323E, 0x3236, 0x3235, 0x323B, 0x3240, 0x323A,
- 0x32B0, 0x32AD, 0x32A9, 0x32AF, 0x3294, 0x32AA, 0x3298, 0x32AB,
- 0x3292, 0x3291, 0x3293, 0x32AC, 0x32AE, 0x3296, 0x23A9, 0x23A8,
- 0x23A7, 0xFE38, 0x23AD, 0x23AC, 0x23AB, 0xFE38, 0x23AB, 0x23AC,
- 0x23AD, 0xFE38, 0x23A7, 0x23A8, 0x23A9, 0xFE38, 0x33CC, 0x3305,
- 0x00BD, 0x00BC, 0x339F, 0x33A3, 0x33A6, 0xFFFD, 0xFFFD, 0x329E,
- 0x3388, 0x3389, 0x33C8, 0x222D, 0x5370, 0x3230, 0x322A, 0x322B,
- 0x322C, 0x322D, 0x322E, 0x322F, 0x3237, 0x3241, 0x27A1, 0x21E6,
- 0x21E7, 0x21E9, 0x25C9, 0x2660, 0x2665, 0x2663, 0x2666, 0x2600,
- 0x2601, 0x2602, 0x2603, 0x261E, 0x261C, 0x261D, 0x261F, 0x3299,
- 0x24EA, 0x216A, 0x216B, 0xFF10, 0xFF10, 0x3000, 0x2581, 0x2582,
- 0x2583, 0x2584, 0x2585, 0x2586, 0x2587, 0x2588, 0x258F, 0x258E,
- 0x258D, 0x258C, 0x258B, 0x258A, 0x2589, 0x2594, 0x2595, 0x256D,
- 0x256E, 0x2570, 0x256F, 0x2550, 0x255E, 0x256A, 0x2561, 0x25E2,
- 0x25E3, 0x25E5, 0x25E4, 0x25CF, 0x0ED0, 0x2571, 0x2572, 0x2573,
- 0x304B, 0x3051, 0x9022, 0x8FBB, 0xFF0C, 0x00B0, 0x3013, 0x309C,
- 0x309B, 0x02CF, 0xFF0E, 0x2018, 0x2019, 0x201C, 0x201D, 0x201C,
- 0x201E, 0x2018, 0x201A, 0x02BA, 0x51DC, 0x7199, 0x2776, 0x2777,
- 0x2778, 0x2779, 0x277A, 0x277B, 0x277C, 0x277D, 0x277E, 0x0000,
- 0x0000, 0x0000, 0x217A, 0x217B, 0x0000, 0x0000, 0x0000, 0x217F,
- 0x210A, 0x2109, 0x0000, 0x0000, 0x3004, 0x21C6, 0x21C4, 0x21C5,
- 0x0000, 0x30F7, 0x30F8, 0x30F9, 0x30FA, 0x5927, 0x5C0F, 0x329D,
- 0x63A7, 0x0000, 0x0000, 0x337B, 0x337F, 0x0000, 0x0000, 0x3333,
- 0x334E, 0x3322, 0x3316, 0x3305, 0x3305, 0x3305, 0x3333, 0x334E,
- 0x334E, 0x334E, 0x3303, 0x3318, 0x3315, 0x3339, 0x3339, 0x3339,
- 0x3357, 0x3342, 0x3342, 0x3342, 0x3323, 0x333B, 0x3300, 0x331E,
- 0x331E, 0x331E, 0x332A, 0x332A, 0x332A, 0x3347, 0x3331, 0x7E8A,
- 0x891C, 0x9348, 0x9288, 0x84DC, 0x4FC9, 0x70BB, 0x6631, 0x68C8,
- 0x92F9, 0x66FB, 0x5F45, 0x4E28, 0x4EE1, 0x4EFC, 0x4F00, 0x4F03,
- 0x4F39, 0x4F56, 0x4F92, 0x4F8A, 0x4F9A, 0x4F94, 0x4FCD, 0x5040,
- 0x5022, 0x4FFF, 0x501E, 0x5046, 0x5070, 0x5042, 0x5094, 0x50F4,
- 0x50D8, 0x514A, 0x5164, 0x519D, 0x51BE, 0x51EC, 0x5215, 0x529C,
- 0x52A6, 0x52C0, 0x52DB, 0x5300, 0x5307, 0x5324, 0x5372, 0x5393,
- 0x53B2, 0x53DD, 0xFA0E, 0x549C, 0x548A, 0x54A9, 0x54FF, 0x5586,
- 0x5759, 0x5765, 0x57AC, 0x57C8, 0x57C7, 0xFA0F, 0xFA10, 0x589E,
- 0x58B2, 0x590B, 0x5953, 0x595B, 0x595D, 0x5963, 0x59A4, 0x59BA,
- 0x5B56, 0x5BC0, 0x752F, 0x5BD8, 0x5BEC, 0x5C1E, 0x5CA6, 0x5CBA,
- 0x5CF5, 0x5D27, 0x5D53, 0xFA11, 0x5D42, 0x5D6D, 0x5DB8, 0x5DB9,
- 0x5DD0, 0x5F21, 0x5F34, 0x5F67, 0x5FB7, 0x5FDE, 0x605D, 0x6085,
- 0x608A, 0x60DE, 0x60D5, 0x6120, 0x60F2, 0x6111, 0x6137, 0x6130,
- 0x6198, 0x6213, 0x62A6, 0x63F5, 0x6460, 0x649D, 0x64CE, 0x654E,
- 0x6600, 0x6615, 0x6609, 0x662E, 0x661E, 0x6624, 0x6665, 0x6657,
- 0x6659, 0xFA12, 0x6673, 0x6699, 0x66A0, 0x66B2, 0x66BF, 0x66FA,
- 0x670E, 0xF929, 0x6766, 0x67BB, 0x6852, 0x67C0, 0x6801, 0x6844,
- 0x68CF, 0xFA13, 0x6968, 0xFA14, 0x6998, 0x69E2, 0x6A30, 0x6A6B,
- 0x6A46, 0x6A73, 0x6A7E, 0x6AE2, 0x6AE4, 0x6BD6, 0x6C3F, 0x6C5C,
- 0x6C86, 0x6C6F, 0x6CDA, 0x6D04, 0x6D87, 0x6D6F, 0x6D96, 0x6DAC,
- 0x6DCF, 0x6DF8, 0x6DF2, 0x6DFC, 0x6E39, 0x6E5C, 0x6E27, 0x6E3C,
- 0x6EBF, 0x6F88, 0x6FB5, 0x6FF5, 0x7005, 0x7007, 0x7028, 0x7085,
- 0x70AB, 0x710F, 0x7104, 0x715C, 0x7146, 0x7147, 0xFA15, 0x71C1,
- 0x71FE, 0x72B1, 0x72BE, 0x7324, 0xFA16, 0x7377, 0x73BD, 0x73C9,
- 0x73D6, 0x73E3, 0x73D2, 0x7407, 0x73F5, 0x7426, 0x742A, 0x7429,
- 0x742E, 0x7462, 0x7489, 0x749F, 0x7501, 0x756F, 0x7682, 0x769C,
- 0x769E, 0x769B, 0x76A6, 0xFA17, 0x7746, 0x52AF, 0x7821, 0x784E,
- 0x7864, 0x787A, 0x7930, 0xFA18, 0xFA19, 0xFA1A, 0x7994, 0xFA1B,
- 0x799B, 0x7AD1, 0x7AE7, 0xFA1C, 0x7AEB, 0x7B9E, 0xFA1D, 0x7D48,
- 0x7D5C, 0x7DB7, 0x7DA0, 0x7DD6, 0x7E52, 0x7F47, 0x7FA1, 0xFA1E,
- 0x8301, 0x8362, 0x837F, 0x83C7, 0x83F6, 0x8448, 0x84B4, 0x8553,
- 0x8559, 0x856B, 0xFA1F, 0x85B0, 0xFA20, 0xFA21, 0x8807, 0x88F5,
- 0x8A12, 0x8A37, 0x8A79, 0x8AA7, 0x8ABE, 0x8ADF, 0xFA22, 0x8AF6,
- 0x8B53, 0x8B7F, 0x8CF0, 0x8CF4, 0x8D12, 0x8D76, 0xFA23, 0x8ECF,
- 0xFA24, 0xFA25, 0x9067, 0x90DE, 0xFA26, 0x9115, 0x9127, 0x91DA,
- 0x91D7, 0x91DE, 0x91ED, 0x91EE, 0x91E4, 0x91E5, 0x9206, 0x9210,
- 0x920A, 0x923A, 0x9240, 0x923C, 0x924E, 0x9259, 0x9251, 0x9239,
- 0x9267, 0x92A7, 0x9277, 0x9278, 0x92E7, 0x92D7, 0x92D9, 0x92D0,
- 0xFA27, 0x92D5, 0x92E0, 0x92D3, 0x9325, 0x9321, 0x92FB, 0xFA28,
- 0x931E, 0x92FF, 0x931D, 0x9302, 0x9370, 0x9357, 0x93A4, 0x93C6,
- 0x93DE, 0x93F8, 0x9431, 0x9445, 0x9448, 0x9592, 0xF9DC, 0xFA29,
- 0x969D, 0x96AF, 0x9733, 0x973B, 0x9743, 0x974D, 0x974F, 0x9751,
- 0x9755, 0x9857, 0x9865, 0xFA2A, 0xFA2B, 0x9927, 0xFA2C, 0x999E,
- 0x9A4E, 0x9AD9, 0x9ADC, 0x9B75, 0x9B72, 0x9B8F, 0x9BB1, 0x9BBB,
- 0x9C00, 0x9D70, 0x9D6B, 0xFA2D, 0x9E19, 0x9ED1, 0x00AC, 0x005C,
- 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027,
- 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F,
- 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037,
- 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,
- 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047,
- 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
- 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057,
- 0x0058, 0x0059, 0x005A, 0x005B, 0x00A5, 0x005D, 0x005E, 0x005F,
- 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067,
- 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F,
- 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077,
- 0x0078, 0x0079, 0x007A, 0x007B, 0x00A6, 0x007D, 0x0303, 0x02BC,
- 0x005C, 0x02BB, 0x007C, 0x007E, 0x00A1, 0x00A2, 0x00A3, 0x2044,
- 0x0192, 0x00A7, 0x00A4, 0x201C, 0x00AB, 0x2039, 0x203A, 0xFB01,
- 0xFB02, 0x2012, 0x2020, 0x2021, 0x00B7, 0x00B6, 0x2022, 0x201A,
- 0x201E, 0x201D, 0x00BB, 0x2026, 0x2030, 0x00BF, 0x0301, 0x0302,
- 0x00AF, 0x0306, 0x0307, 0x0308, 0x030A, 0x00B8, 0x030B, 0x0328,
- 0x030C, 0x0336, 0x00C6, 0x00AA, 0x0141, 0x00D8, 0x0152, 0x00BA,
- 0x00E6, 0x0131, 0x0142, 0x00F8, 0x0153, 0x00DF, 0x002D, 0x00A9,
- 0x00AC, 0x00AE, 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B5, 0x00B9,
- 0x00BC, 0x00BD, 0x00BE, 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4,
- 0x00C5, 0x00C7, 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD,
- 0x00CE, 0x00CF, 0x00D0, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5,
- 0x00D6, 0x00D7, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x00DE,
- 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E7, 0x00E8,
- 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF, 0x00F0,
- 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7, 0x00F9,
- 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x00FF, 0x0160, 0x0178,
- 0x017D, 0x0305, 0x0161, 0x2122, 0x017E, 0x0030, 0x2002, 0x0021,
- 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029,
- 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 0x0030, 0x0031,
- 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039,
- 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 0x0040, 0x0041,
- 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049,
- 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051,
- 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059,
- 0x005A, 0x005B, 0x00A5, 0x005D, 0x005E, 0x005F, 0x0060, 0x0061,
- 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069,
- 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071,
- 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079,
- 0x007A, 0x007B, 0x007C, 0x007D, 0x203E, 0xFF40, 0x2032, 0x00A8,
- 0x2036, 0x00C4, 0x00F9, 0x00E9, 0x00ED, 0x00DF, 0x00E7, 0x00C7,
- 0x00D1, 0x00F1, 0x00A2, 0x00A3, 0x00F3, 0x00FA, 0x00A1, 0x00BF,
- 0x00BD, 0x00D6, 0x00DC, 0x00E4, 0x00EB, 0x00EF, 0x00F6, 0x00DC,
- 0x00E2, 0x00EA, 0x00EE, 0x00F4, 0x00FC, 0x00E0, 0x00E9, 0x00E1,
- 0x007E, 0x0030, 0x00AC, 0x005C, 0xFF60, 0xFF61, 0xFF62, 0xFF63,
- 0xFF64, 0xFF65, 0xFF66, 0xFF67, 0xFF68, 0xFF69, 0xFF6A, 0xFF6B,
- 0xFF6C, 0xFF6D, 0xFF6E, 0xFF6F, 0xFF70, 0xFF71, 0xFF72, 0xFF73,
- 0xFF74, 0xFF75, 0xFF76, 0xFF77, 0xFF78, 0xFF79, 0xFF7A, 0xFF7B,
- 0xFF7C, 0xFF7D, 0xFF7E, 0xFF7F, 0xFF80, 0xFF81, 0xFF82, 0xFF83,
- 0xFF84, 0xFF85, 0xFF86, 0xFF87, 0xFF88, 0xFF89, 0xFF8A, 0xFF8B,
- 0xFF8C, 0xFF8D, 0xFF8E, 0xFF8F, 0xFF90, 0xFF91, 0xFF92, 0xFF93,
- 0xFF94, 0xFF95, 0xFF96, 0xFF97, 0xFF98, 0xFF99, 0xFF9A, 0xFF9B,
- 0xFF9C, 0xFF9D, 0xFF9E, 0xFF9F, 0x30F0, 0x30F1, 0x30EE, 0x30AB,
- 0x30B1, 0x30F4, 0x30AC, 0x30AE, 0x30B0, 0x30B2, 0x30B4, 0x30B6,
- 0x30B8, 0x30BA, 0x30BC, 0x30BE, 0x30C0, 0x30C2, 0x30C5, 0x30C7,
- 0x30C9, 0x30D0, 0x30D1, 0x30D3, 0x30D4, 0x30D6, 0x30D7, 0x30D9,
- 0x30DA, 0x30DC, 0x30DD, 0xFF60, 0x3092, 0x3041, 0x3043, 0x3045,
- 0x3047, 0x3049, 0x3083, 0x3085, 0x3087, 0x3063, 0x3042, 0x3044,
- 0x3046, 0x3048, 0x304A, 0x304B, 0x304D, 0x304F, 0x3051, 0x3053,
- 0x3055, 0x3057, 0x3059, 0x305B, 0x305D, 0x305F, 0x3061, 0x3064,
- 0x3066, 0x3068, 0x306A, 0x306B, 0x306C, 0x306D, 0x306E, 0x306F,
- 0x3072, 0x3075, 0x3078, 0x307B, 0x307E, 0x307F, 0x3080, 0x3081,
- 0x3082, 0x3084, 0x3086, 0x3088, 0x3089, 0x308A, 0x308B, 0x308C,
- 0x308D, 0x308F, 0x3093, 0x3090, 0x3091, 0x308E, 0x304C, 0x304E,
- 0x3050, 0x3052, 0x3054, 0x3056, 0x3068, 0x305A, 0x305C, 0x305E,
- 0x3060, 0x3062, 0x3065, 0x3067, 0x3069, 0x3070, 0x3071, 0x3073,
- 0x3074, 0x3076, 0x3077, 0x3079, 0x307A, 0x307C, 0x307D, 0x301D,
- 0x301E, 0x005B, 0x005D, 0x3008, 0x3009, 0x300A, 0x300B, 0x300E,
- 0x300F, 0x3010, 0x3011, 0x2012, 0xFF60, 0x2500, 0x2501, 0x2502,
- 0x2503, 0x2504, 0x2505, 0x2506, 0x2507, 0x2508, 0x2509, 0x250A,
- 0x250B, 0x250C, 0x250D, 0x250E, 0x250F, 0x2510, 0x2511, 0x2512,
- 0x2513, 0x2514, 0x2515, 0x2516, 0x2517, 0x2518, 0x2519, 0x251A,
- 0x251B, 0x251C, 0x251D, 0x251E, 0x251F, 0x2520, 0x2521, 0x2522,
- 0x2523, 0x2524, 0x2525, 0x2526, 0x2527, 0x2528, 0x2529, 0x252A,
- 0x252B, 0x252C, 0x252D, 0x252E, 0x252F, 0x2530, 0x2531, 0x2532,
- 0x2533, 0x2534, 0x2535, 0x2536, 0x2537, 0x2538, 0x2539, 0x253A,
- 0x253B, 0x253C, 0x253D, 0x253E, 0x253F, 0x2540, 0x2541, 0x2542,
- 0x2543, 0x2544, 0x2545, 0x2546, 0x2547, 0x2548, 0x2549, 0x254A,
- 0x254B, 0x25B2, 0x20AC, 0x2126, 0x2032, 0x2033, 0xFB00, 0xFB03,
- 0xFB04, 0x0101, 0x012B, 0x016B, 0x0113, 0x014D, 0x0100, 0x012A,
- 0x016A, 0x0112, 0x014C, 0x215B, 0x215C, 0x215D, 0x215E, 0x2153,
- 0x2154, 0x2070, 0x2074, 0x2075, 0x2076, 0x2077, 0x2078, 0x2079,
- 0x2080, 0x2081, 0x2082, 0x2083, 0x2084, 0x2085, 0x2086, 0x2087,
- 0x2088, 0x2089, 0x01CD, 0x011A, 0x0000, 0x1EBC, 0x01CF, 0x0000,
- 0x0128, 0x01D1, 0x0000, 0x01D3, 0x016E, 0x0168, 0x01CE, 0x011B,
- 0x0000, 0x1EBD, 0x01D0, 0x0000, 0x0129, 0x01D2, 0x0000, 0x01D4,
- 0x016F, 0x0169, 0x0251, 0x0251, 0x0251, 0x01FD, 0x00E6, 0x0254,
- 0x0254, 0x0254, 0x0259, 0x0259, 0x0259, 0x025A, 0x025A, 0x025A,
- 0x025B, 0x025B, 0x025B, 0x006A, 0x014B, 0x0275, 0x028C, 0x028C,
- 0x028C, 0x0292, 0x0283, 0x02D0, 0x0020, 0x0021, 0x0022, 0x0023,
- 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B,
- 0x002C, 0x002D, 0x002E, 0x002F, 0x0030, 0x0031, 0x0032, 0x0033,
- 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B,
- 0x003C, 0x003D, 0x003E, 0x003F, 0x0040, 0x0041, 0x0042, 0x0043,
- 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B,
- 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051, 0x0052, 0x0053,
- 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B,
- 0x00A5, 0x005D, 0x005E, 0x005F, 0x0060, 0x0061, 0x0062, 0x0063,
- 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B,
- 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, 0x0072, 0x0073,
- 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B,
- 0x00A6, 0x007D, 0x0303, 0x02BC, 0x005C, 0x02BB, 0x007C, 0x007E,
- 0x00A1, 0x00A2, 0x00A3, 0x2044, 0x0192, 0x00A7, 0x00A4, 0x201C,
- 0x00AB, 0x2039, 0x203A, 0xFB01, 0xFB02, 0x2012, 0x2020, 0x2021,
- 0x00B7, 0x00B6, 0x2022, 0x201A, 0x201E, 0x201D, 0x00BB, 0x2026,
- 0x2030, 0x00BF, 0x0301, 0x0302, 0x00AF, 0x0306, 0x0307, 0x0308,
- 0x030A, 0x00B8, 0x030B, 0x0328, 0x030C, 0x0336, 0x00C6, 0x00AA,
- 0x0141, 0x00D8, 0x0152, 0x00BA, 0x00E6, 0x0131, 0x0142, 0x00F8,
- 0x0153, 0x00DF, 0x002D, 0x00A9, 0x00AC, 0x00AE, 0x00B0, 0x00B1,
- 0x00B2, 0x00B3, 0x00B5, 0x00B9, 0x00BC, 0x00BD, 0x00BE, 0x00C0,
- 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C7, 0x00C8, 0x00C9,
- 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF, 0x00D0, 0x00D1,
- 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7, 0x00D9, 0x00DA,
- 0x00DB, 0x00DC, 0x00DD, 0x00DE, 0x00E0, 0x00E1, 0x00E2, 0x00E3,
- 0x00E4, 0x00E5, 0x00E7, 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC,
- 0x00ED, 0x00EE, 0x00EF, 0x00F0, 0x00F1, 0x00F2, 0x00F3, 0x00F4,
- 0x00F5, 0x00F6, 0x00F7, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x00FD,
- 0x00FE, 0x00FF, 0x0160, 0x0178, 0x017D, 0x0305, 0x0161, 0x2122,
- 0x017E, 0x0030, 0x20AC, 0x2126, 0x2032, 0x2033, 0xFB00, 0xFB03,
- 0xFB04, 0x0101, 0x012B, 0x016B, 0x0113, 0x014D, 0x0100, 0x012A,
- 0x016A, 0x0112, 0x014C, 0x215B, 0x215C, 0x215D, 0x215E, 0x2153,
- 0x2154, 0x2070, 0x2074, 0x2075, 0x2076, 0x2077, 0x2078, 0x2079,
- 0x2080, 0x2081, 0x2082, 0x2083, 0x2084, 0x2085, 0x2086, 0x2087,
- 0x2088, 0x2089, 0x01CD, 0x011A, 0x0000, 0x1EBC, 0x01CF, 0x0000,
- 0x0128, 0x01D1, 0x0000, 0x01D3, 0x016E, 0x0168, 0x01CE, 0x011B,
- 0x0000, 0x1EBD, 0x01D0, 0x0000, 0x0129, 0x01D2, 0x0000, 0x01D4,
- 0x016F, 0x0169, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035,
- 0x0036, 0x0037, 0x0038, 0x0039, 0x0336, 0x002D, 0x003D, 0x002C,
- 0x0028, 0x0029, 0x002E, 0x002F, 0x003A, 0x003B, 0x0030, 0x0031,
- 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039,
- 0x0336, 0x002D, 0x003D, 0x002C, 0x0028, 0x0029, 0x002E, 0x002F,
- 0x003A, 0x003B, 0x00B7, 0x20AC, 0x0000, 0x2153, 0x2154, 0x00BE,
- 0x2155, 0x2156, 0x2157, 0x2158, 0x2159, 0x215A, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x215B, 0x215C, 0x215D, 0x215E,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037,
- 0x0038, 0x0039, 0x0030, 0x2163, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2170, 0x2171,
- 0x2172, 0x2173, 0x2174, 0x2175, 0x2176, 0x2177, 0x2178, 0x2179,
- 0x217A, 0x217B, 0x0000, 0x0000, 0x0000, 0x2160, 0x2161, 0x2162,
- 0x2163, 0x2164, 0x2165, 0x2166, 0x2167, 0x2168, 0x2169, 0x216A,
- 0x216B, 0x0000, 0x0000, 0x0000, 0x0041, 0x0042, 0x0043, 0x0044,
- 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C,
- 0x004D, 0x004E, 0x004F, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054,
- 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x3042, 0x3044,
- 0x3046, 0x3048, 0x304A, 0x304B, 0x304D, 0x304F, 0x3051, 0x3053,
- 0x3055, 0x3057, 0x3059, 0x305B, 0x305D, 0x305F, 0x3061, 0x3064,
- 0x3066, 0x3068, 0x306A, 0x306B, 0x306C, 0x306D, 0x306E, 0x306F,
- 0x3072, 0x3075, 0x3078, 0x307B, 0x307E, 0x307F, 0x3080, 0x3081,
- 0x3082, 0x3084, 0x3086, 0x3088, 0x3089, 0x308A, 0x308B, 0x308C,
- 0x308D, 0x308F, 0x3090, 0x3091, 0x3092, 0x3093, 0x30A2, 0x30A4,
- 0x30A6, 0x30A8, 0x30AA, 0x30AB, 0x30AD, 0x30AF, 0x30B1, 0x30B3,
- 0x30B5, 0x30B7, 0x30B9, 0x30BB, 0x30BD, 0x30BF, 0x30C1, 0x30C4,
- 0x30C6, 0x30C8, 0x30CA, 0x30CB, 0x30CC, 0x30CD, 0x30CE, 0x30CF,
- 0x30D2, 0x30D5, 0x30D8, 0x30DB, 0x30DE, 0x30DF, 0x30E0, 0x30E1,
- 0x30E2, 0x30E4, 0x30E6, 0x30E8, 0x30E9, 0x30EA, 0x30EB, 0x30EC,
- 0x30ED, 0x30EF, 0x30F0, 0x30F1, 0x30F2, 0x30F3, 0x3220, 0x3221,
- 0x3222, 0x3223, 0x3224, 0x3225, 0x3226, 0x3227, 0x3228, 0x3229,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x55B6, 0x5408, 0x6CEB, 0x554F, 0x7B54, 0x4F8B,
- 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037,
- 0x0038, 0x0039, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035,
- 0x0036, 0x0037, 0x0038, 0x0039, 0x3063, 0x624D, 0x3007, 0x4E00,
- 0x4E8C, 0x4E09, 0x56DB, 0x4E94, 0x516D, 0x4E03, 0x516B, 0x4E5D,
- 0x5341, 0x3007, 0x4E00, 0x4E8C, 0x4E09, 0x56DB, 0x4E94, 0x516D,
- 0x4E03, 0x516B, 0x4E5D, 0x5341, 0x3007, 0x4E00, 0x4E8C, 0x4E09,
- 0x56DB, 0x4E94, 0x516D, 0x4E03, 0x516B, 0x4E5D, 0x3064, 0x624D,
- 0x4E00, 0x4E8C, 0x4E09, 0x56DB, 0x4E94, 0x516D, 0x4E03, 0x516B,
- 0x4E5D, 0x5341, 0x3007, 0x4E00, 0x4E8C, 0x4E09, 0x56DB, 0x4E94,
- 0x516D, 0x4E03, 0x516B, 0x4E5D, 0x5341, 0x30B3, 0x3063, 0x30C3,
- 0x30A9, 0x0000, 0x0000, 0x2460, 0x2461, 0x2462, 0x2463, 0x2464,
- 0x2465, 0x2466, 0x2467, 0x2468, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x24D0, 0x24D1, 0x24D2, 0x24D3, 0x24D4, 0x24D5, 0x24D6,
- 0x24D7, 0x24D8, 0x24D9, 0x24DA, 0x24DB, 0x24DC, 0x24DD, 0x24DE,
- 0x24DF, 0x24E0, 0x24E1, 0x24E2, 0x24E3, 0x24E4, 0x24E5, 0x24E6,
- 0x24E7, 0x24E8, 0x24E9, 0x24B6, 0x24B7, 0x24B8, 0x24B9, 0x24BA,
- 0x24BB, 0x24BC, 0x24BD, 0x24BE, 0x24BF, 0x24C0, 0x24C1, 0x24C2,
- 0x24C3, 0x24C4, 0x24C5, 0x24C6, 0x24C7, 0x24C8, 0x24C9, 0x24CA,
- 0x24CB, 0x24CC, 0x24CD, 0x24CE, 0x24CF, 0x3042, 0x3044, 0x3046,
- 0x3048, 0x304A, 0x304B, 0x304D, 0x304F, 0x3051, 0x3053, 0x3055,
- 0x3057, 0x3059, 0x305B, 0x305D, 0x305F, 0x3061, 0x3064, 0x3066,
- 0x3068, 0x306A, 0x306B, 0x306C, 0x306D, 0x306E, 0x306F, 0x3072,
- 0x3075, 0x3078, 0x307B, 0x307E, 0x307F, 0x3080, 0x3081, 0x3082,
- 0x3084, 0x3086, 0x3088, 0x3089, 0x308A, 0x308B, 0x308C, 0x308D,
- 0x308F, 0x3090, 0x3091, 0x3092, 0x3093, 0x32D0, 0x32D1, 0x32D2,
- 0x32D3, 0x32D4, 0x32D5, 0x32D6, 0x32D7, 0x32D8, 0x32D9, 0x32DA,
- 0x32DB, 0x32DC, 0x32DD, 0x32DE, 0x32DF, 0x32E0, 0x32E1, 0x32E2,
- 0x32E3, 0x32E4, 0x32E5, 0x32E6, 0x32E7, 0x32E8, 0x32E9, 0x32EA,
- 0x32EB, 0x32EC, 0x32ED, 0x32EE, 0x32EF, 0x32F0, 0x32F1, 0x32F2,
- 0x32F3, 0x32F4, 0x32F5, 0x32F6, 0x32F7, 0x32F8, 0x32F9, 0x32FA,
- 0x32FB, 0x32FC, 0x32FD, 0x32FE, 0x30F3, 0x3280, 0x3281, 0x3282,
- 0x3283, 0x3284, 0x3285, 0x3286, 0x3287, 0x3288, 0x3289, 0x3290,
- 0x328A, 0x328B, 0x328C, 0x328D, 0x328E, 0x328F, 0x8ABF, 0x329F,
- 0x526F, 0x6E1B, 0x6A19, 0x6B20, 0x57FA, 0x7981, 0x32A0, 0x32A1,
- 0x329B, 0x329A, 0x32A3, 0x32A2, 0x3297, 0x51FA, 0x329C, 0x3295,
- 0x6E08, 0x5897, 0x554F, 0x7B54, 0x4F8B, 0x96FB, 0x25CC, 0x0030,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0061, 0x0062, 0x0063,
- 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B,
- 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, 0x0072, 0x0073,
- 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x0041,
- 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049,
- 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051,
- 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059,
- 0x005A, 0x3042, 0x3044, 0x3046, 0x3048, 0x304A, 0x304B, 0x304D,
- 0x304F, 0x3051, 0x3053, 0x3055, 0x3057, 0x3059, 0x305B, 0x305D,
- 0x305F, 0x3061, 0x3064, 0x3066, 0x3068, 0x306A, 0x306B, 0x306C,
- 0x306D, 0x306E, 0x306F, 0x3072, 0x3075, 0x3078, 0x307B, 0x307E,
- 0x307F, 0x3080, 0x3081, 0x3082, 0x3084, 0x3086, 0x3088, 0x3089,
- 0x308A, 0x308B, 0x308C, 0x308D, 0x308F, 0x3090, 0x3091, 0x3092,
- 0x3093, 0x30A2, 0x30A4, 0x30A6, 0x30A8, 0x30AA, 0x30AB, 0x30AD,
- 0x30AF, 0x30B1, 0x30B3, 0x30B5, 0x30B7, 0x30B9, 0x30BB, 0x30BD,
- 0x30BF, 0x30C1, 0x30C4, 0x30C6, 0x30C8, 0x30CA, 0x30CB, 0x30CC,
- 0x30CD, 0x30CE, 0x30CF, 0x30D2, 0x30D5, 0x30D8, 0x30DB, 0x30DE,
- 0x30DF, 0x30E0, 0x30E1, 0x30E2, 0x30E4, 0x30E6, 0x30E8, 0x30E9,
- 0x30EA, 0x30EB, 0x30EC, 0x30ED, 0x30EF, 0x30F0, 0x30F1, 0x30F2,
- 0x30F3, 0x65E5, 0x6708, 0x706B, 0x6C34, 0x6728, 0x91D1, 0x571F,
- 0x554F, 0x7B54, 0x4F8B, 0x25CF, 0x0030, 0x0000, 0x0031, 0x0000,
- 0x0032, 0x0000, 0x0033, 0x0000, 0x0034, 0x0000, 0x0035, 0x0000,
- 0x0036, 0x0000, 0x0037, 0x0000, 0x0038, 0x0000, 0x0039, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065,
- 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D,
- 0x006E, 0x006F, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075,
- 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x0041, 0x0042, 0x0043,
- 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B,
- 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051, 0x0052, 0x0053,
- 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x3042,
- 0x3044, 0x3046, 0x3048, 0x304A, 0x304B, 0x304D, 0x304F, 0x3051,
- 0x3053, 0x3055, 0x3057, 0x3059, 0x305B, 0x305D, 0x305F, 0x3061,
- 0x3064, 0x3066, 0x3068, 0x306A, 0x306B, 0x306C, 0x306D, 0x306E,
- 0x306F, 0x3072, 0x3075, 0x3078, 0x307B, 0x307E, 0x307F, 0x3080,
- 0x3081, 0x3082, 0x3084, 0x3086, 0x3088, 0x3089, 0x308A, 0x308B,
- 0x308C, 0x308D, 0x308F, 0x3090, 0x3091, 0x3092, 0x3093, 0x30A2,
- 0x30A4, 0x30A6, 0x30A8, 0x30AA, 0x30AB, 0x30AD, 0x30AF, 0x30B1,
- 0x30B3, 0x30B5, 0x30B7, 0x30B9, 0x30BB, 0x30BD, 0x30BF, 0x30C1,
- 0x30C4, 0x30C6, 0x30C8, 0x30CA, 0x30CB, 0x30CC, 0x30CD, 0x30CE,
- 0x30CF, 0x30D2, 0x30D5, 0x30D8, 0x30DB, 0x30DE, 0x30DF, 0x30E0,
- 0x30E1, 0x30E2, 0x30E4, 0x30E6, 0x30E8, 0x30E9, 0x30EA, 0x30EB,
- 0x30EC, 0x30ED, 0x30EF, 0x30F0, 0x30F1, 0x30F2, 0x30F3, 0x65E5,
- 0x6708, 0x706B, 0x6C34, 0x6728, 0x91D1, 0x571F, 0x8CA0, 0x52DD,
- 0x554F, 0x7B54, 0x4F8B, 0x25A1, 0x25A1, 0x0030, 0x0000, 0x0031,
- 0x0000, 0x0032, 0x0000, 0x0033, 0x0000, 0x0034, 0x0000, 0x0035,
- 0x0000, 0x0036, 0x0000, 0x0037, 0x0000, 0x0038, 0x0000, 0x0039,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0061, 0x0062, 0x0063, 0x0064,
- 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C,
- 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074,
- 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x0041, 0x0042,
- 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A,
- 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051, 0x0052,
- 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A,
- 0x3042, 0x3044, 0x3046, 0x3048, 0x304A, 0x304B, 0x304D, 0x304F,
- 0x3051, 0x3053, 0x3055, 0x3057, 0x3059, 0x305B, 0x305D, 0x305F,
- 0x3061, 0x3064, 0x3066, 0x3068, 0x306A, 0x306B, 0x306C, 0x306D,
- 0x306E, 0x306F, 0x3072, 0x3075, 0x3078, 0x307B, 0x307E, 0x307F,
- 0x3080, 0x3081, 0x3082, 0x3084, 0x3086, 0x3088, 0x3089, 0x308A,
- 0x308B, 0x308C, 0x308D, 0x308F, 0x3090, 0x3091, 0x3092, 0x3093,
- 0x30A2, 0x30A4, 0x30A6, 0x30A8, 0x30AA, 0x30AB, 0x30AD, 0x30AF,
- 0x30B1, 0x30B3, 0x30B5, 0x30B7, 0x30B9, 0x30BB, 0x30BD, 0x30BF,
- 0x30C1, 0x30C4, 0x30C6, 0x30C8, 0x30CA, 0x30CB, 0x30CC, 0x30CD,
- 0x30CE, 0x30CF, 0x30D2, 0x30D5, 0x30D8, 0x30DB, 0x30DE, 0x30DF,
- 0x30E0, 0x30E1, 0x30E2, 0x30E4, 0x30E6, 0x30E8, 0x30E9, 0x30EA,
- 0x30EB, 0x30EC, 0x30ED, 0x30EF, 0x30F0, 0x30F1, 0x30F2, 0x30F3,
- 0x65E5, 0x6708, 0x706B, 0x6C34, 0x6728, 0x91D1, 0x571F, 0x554F,
- 0x7B54, 0x4F8B, 0x25A0, 0x0030, 0x0000, 0x0031, 0x0000, 0x0032,
- 0x0000, 0x0033, 0x0000, 0x0034, 0x0000, 0x0035, 0x0000, 0x0036,
- 0x0000, 0x0037, 0x0000, 0x0038, 0x0000, 0x0039, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066,
- 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E,
- 0x006F, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076,
- 0x0077, 0x0078, 0x0079, 0x007A, 0x0041, 0x0042, 0x0043, 0x0044,
- 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C,
- 0x004D, 0x004E, 0x004F, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054,
- 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x3042, 0x3044,
- 0x3046, 0x3048, 0x304A, 0x304B, 0x304D, 0x304F, 0x3051, 0x3053,
- 0x3055, 0x3057, 0x3059, 0x305B, 0x305D, 0x305F, 0x3061, 0x3064,
- 0x3066, 0x3068, 0x306A, 0x306B, 0x306C, 0x306D, 0x306E, 0x306F,
- 0x3072, 0x3075, 0x3078, 0x307B, 0x307E, 0x307F, 0x3080, 0x3081,
- 0x3082, 0x3084, 0x3086, 0x3088, 0x3089, 0x308A, 0x308B, 0x308C,
- 0x308D, 0x308F, 0x3090, 0x3091, 0x3092, 0x3093, 0x30A2, 0x30A4,
- 0x30A6, 0x30A8, 0x30AA, 0x30AB, 0x30AD, 0x30AF, 0x30B1, 0x30B3,
- 0x30B5, 0x30B7, 0x30B9, 0x30BB, 0x30BD, 0x30BF, 0x30C1, 0x30C4,
- 0x30C6, 0x30C8, 0x30CA, 0x30CB, 0x30CC, 0x30CD, 0x30CE, 0x30CF,
- 0x30D2, 0x30D5, 0x30D8, 0x30DB, 0x30DE, 0x30DF, 0x30E0, 0x30E1,
- 0x30E2, 0x30E4, 0x30E6, 0x30E8, 0x30E9, 0x30EA, 0x30EB, 0x30EC,
- 0x30ED, 0x30EF, 0x30F0, 0x30F1, 0x30F2, 0x30F3, 0x65E5, 0x6708,
- 0x706B, 0x6C34, 0x6728, 0x91D1, 0x571F, 0x554F, 0x7B54, 0x4F8B,
- 0x0030, 0x0000, 0x0031, 0x0000, 0x0032, 0x0000, 0x0033, 0x0000,
- 0x0034, 0x0000, 0x0035, 0x0000, 0x0036, 0x0000, 0x0037, 0x0000,
- 0x0038, 0x0000, 0x0039, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0061,
- 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069,
- 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071,
- 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079,
- 0x007A, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047,
- 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
- 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057,
- 0x0058, 0x0059, 0x005A, 0x3042, 0x3044, 0x3046, 0x3048, 0x304A,
- 0x304B, 0x304D, 0x304F, 0x3051, 0x3053, 0x3055, 0x3057, 0x3059,
- 0x305B, 0x305D, 0x305F, 0x3061, 0x3064, 0x3066, 0x3068, 0x306A,
- 0x306B, 0x306C, 0x306D, 0x306E, 0x306F, 0x3072, 0x3075, 0x3078,
- 0x307B, 0x307E, 0x307F, 0x3080, 0x3081, 0x3082, 0x3084, 0x3086,
- 0x3088, 0x3089, 0x308A, 0x308B, 0x308C, 0x308D, 0x308F, 0x3090,
- 0x3091, 0x3092, 0x3093, 0x30A2, 0x30A4, 0x30A6, 0x30A8, 0x30AA,
- 0x30AB, 0x30AD, 0x30AF, 0x30B1, 0x30B3, 0x30B5, 0x30B7, 0x30B9,
- 0x30BB, 0x30BD, 0x30BF, 0x30C1, 0x30C4, 0x30C6, 0x30C8, 0x30CA,
- 0x30CB, 0x30CC, 0x30CD, 0x30CE, 0x30CF, 0x30D2, 0x30D5, 0x30D8,
- 0x30DB, 0x30DE, 0x30DF, 0x30E0, 0x30E1, 0x30E2, 0x30E4, 0x30E6,
- 0x30E8, 0x30E9, 0x30EA, 0x30EB, 0x30EC, 0x30ED, 0x30EF, 0x30F0,
- 0x30F1, 0x30F2, 0x30F3, 0x65E5, 0x6708, 0x706B, 0x6C34, 0x6728,
- 0x91D1, 0x571F, 0x554F, 0x7B54, 0x4F8B, 0x25A0, 0x33C2, 0x33CD,
- 0x2116, 0x0000, 0x33D8, 0x33DA, 0x2121, 0x2122, 0x0000, 0x2100,
- 0x33C2, 0x0000, 0x33C4, 0x2105, 0x3397, 0x3371, 0x3398, 0x2113,
- 0x338D, 0x339B, 0x3396, 0x0000, 0x0000, 0x33D7, 0x33D8, 0x0000,
- 0x0000, 0x0000, 0x3301, 0x3302, 0x3304, 0x3306, 0x0000, 0x3308,
- 0x0000, 0x3307, 0x330A, 0x0000, 0x3309, 0x0000, 0x330B, 0x0000,
- 0x330C, 0x330E, 0x330F, 0x3310, 0x3311, 0x3312, 0x3313, 0x0000,
- 0x3317, 0x0000, 0x3319, 0x0000, 0x331A, 0x331B, 0x331C, 0x331D,
- 0x331F, 0x3320, 0x3321, 0x3324, 0x0000, 0x3325, 0x0000, 0x0000,
- 0x3328, 0x3329, 0x0000, 0x332D, 0x0000, 0x0000, 0x332E, 0x332F,
- 0x3330, 0x3332, 0x0000, 0x0000, 0x3334, 0x3335, 0x333C, 0x0000,
- 0x0000, 0x0000, 0x3337, 0x0000, 0x3338, 0x333A, 0x333D, 0x3341,
- 0x333E, 0x333F, 0x3340, 0x3343, 0x3344, 0x3345, 0x3346, 0x3348,
- 0x334B, 0x334C, 0x334F, 0x3350, 0x0000, 0x0000, 0x3352, 0x3354,
- 0x0000, 0x0000, 0x3353, 0x3355, 0x3356, 0x0000, 0x3301, 0x3302,
- 0x3304, 0x3306, 0x0000, 0x3308, 0x0000, 0x3307, 0x330A, 0x0000,
- 0x3309, 0x0000, 0x330B, 0x0000, 0x330C, 0x330E, 0x330F, 0x3310,
- 0x3311, 0x3312, 0x3313, 0x0000, 0x3317, 0x0000, 0x3319, 0x0000,
- 0x331A, 0x331B, 0x331C, 0x331D, 0x331F, 0x3320, 0x3321, 0x3324,
- 0x0000, 0x3325, 0x0000, 0x0000, 0x3328, 0x3329, 0x0000, 0x332D,
- 0x0000, 0x0000, 0x332E, 0x332F, 0x3330, 0x3332, 0x0000, 0x0000,
- 0x3334, 0x3335, 0x333C, 0x0000, 0x0000, 0x0000, 0x3337, 0x0000,
- 0x3338, 0x333A, 0x333D, 0x3341, 0x333E, 0x333F, 0x3340, 0x3343,
- 0x3344, 0x3345, 0x3346, 0x3348, 0x334B, 0x334C, 0x334F, 0x3350,
- 0x0000, 0x0000, 0x3352, 0x3354, 0x0000, 0x0000, 0x3353, 0x3355,
- 0x3356, 0x337E, 0x337D, 0x337C, 0x337B, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x002D,
- 0x003D, 0x2103, 0x2640, 0x2642, 0x3013, 0x3012, 0x300C, 0x300D,
- 0x300E, 0x300F, 0x301A, 0x301B, 0x3018, 0x3019, 0xFF08, 0xFF09,
- 0x301D, 0x301E, 0x2018, 0x2019, 0x201C, 0x201D, 0x0027, 0x0022,
- 0x0000, 0x2135, 0x03D0, 0x220A, 0x210F, 0x00B5, 0x03C6, 0x03DB,
- 0x03D1, 0xFFFD, 0x2668, 0x2669, 0x266C, 0xFF1A, 0x00A9, 0x00A9,
- 0x00AE, 0x00AE, 0x303B, 0x303B, 0x3033, 0x3034, 0x3035, 0x203C,
- 0x2049, 0x0021, 0x203C, 0x2049, 0x244A, 0x0000, 0x2213, 0x2260,
- 0x2243, 0x2272, 0x2273, 0x300C, 0x300D, 0x300E, 0x300F, 0x301A,
- 0x301B, 0x3018, 0x3019, 0xFF5F, 0xFF60, 0x300C, 0x300D, 0x300E,
- 0x300F, 0x301A, 0x301B, 0x3018, 0x3019, 0xFF5F, 0xFF60, 0x239B,
- 0x239D, 0x239E, 0x23A0, 0x239D, 0x239B, 0x23A0, 0x239E, 0x23A1,
- 0x23A3, 0x23A4, 0x23A6, 0x23A3, 0x23A1, 0x23A6, 0x23A4, 0x23A1,
- 0x23A3, 0x23A4, 0x23A6, 0x23A3, 0x23A1, 0x23A6, 0x23A4, 0xFF5C,
- 0x2015, 0x301D, 0x301E, 0x2018, 0x2019, 0x2018, 0x2019, 0x2702,
- 0x2702, 0x2702, 0x2702, 0x303D, 0x3012, 0x309F, 0x534D, 0x2207,
- 0x2205, 0x22A0, 0x2296, 0x2298, 0x2295, 0x2297, 0x229E, 0x2295,
- 0x0021, 0x25B3, 0x25C0, 0x25B6, 0x21E6, 0x21E8, 0x21E7, 0x21E9,
- 0x21D0, 0x2194, 0x2198, 0x2199, 0x2196, 0x2197, 0x21CC, 0x21C6,
- 0x21C4, 0x21C5, 0x2190, 0x2192, 0x2191, 0x2193, 0x2194, 0x2195,
- 0x2504, 0x2506, 0x3030, 0x2307, 0x3030, 0x2307, 0x3030, 0x2307,
- 0x3030, 0x2307, 0x3030, 0x2307, 0x2740, 0x273F, 0x25A1, 0x25A0,
- 0x25A1, 0x25A1, 0x25A1, 0x25A1, 0x25A1, 0x25AB, 0x25A0, 0x25AA,
- 0x271A, 0x271A, 0x25C7, 0x25C6, 0x25C7, 0x25C7, 0x25C7, 0x25C7,
- 0x25C7, 0x25C6, 0x25C6, 0x25CE, 0x25C9, 0x25CB, 0x25E6, 0x25CF,
- 0x2022, 0x2756, 0x2756, 0x2756, 0x2756, 0x3008, 0x3009, 0x3008,
- 0x3009, 0x300A, 0x300B, 0x300A, 0x300B, 0x3053, 0x3053, 0x30B3,
- 0x30B3, 0x309D, 0x309E, 0x3041, 0x3042, 0x3043, 0x3044, 0x3045,
- 0x3046, 0x3047, 0x3048, 0x3049, 0x304A, 0x304B, 0x304B, 0x304C,
- 0x304D, 0x304E, 0x304F, 0x3050, 0x3051, 0x3051, 0x3052, 0x3053,
- 0x3053, 0x3054, 0x3055, 0x3056, 0x3057, 0x3058, 0x3059, 0x305A,
- 0x305B, 0x305C, 0x305D, 0x305E, 0x305F, 0x3060, 0x3061, 0x3062,
- 0x3063, 0x3064, 0x3065, 0x3066, 0x3067, 0x3068, 0x3069, 0x306A,
- 0x306B, 0x306C, 0x306D, 0x306E, 0x306F, 0x3070, 0x3071, 0x3072,
- 0x3073, 0x3074, 0x3075, 0x3076, 0x3077, 0x3078, 0x3079, 0x307A,
- 0x307B, 0x307C, 0x307D, 0x307E, 0x307F, 0x3080, 0x3081, 0x3082,
- 0x3083, 0x3084, 0x3085, 0x3086, 0x3087, 0x3088, 0x3089, 0x308A,
- 0x308B, 0x308C, 0x308D, 0x308E, 0x308F, 0x3090, 0x3091, 0x3092,
- 0x3093, 0x3094, 0x30FD, 0x30FE, 0x30FC, 0x30A1, 0x30A2, 0x30A3,
- 0x30A4, 0x30A5, 0x30A6, 0x30A7, 0x30A8, 0x30A9, 0x30AA, 0x30F5,
- 0x30AB, 0x30AC, 0x30AD, 0x30AE, 0x30AF, 0x30B0, 0x30F6, 0x30B1,
- 0x30B2, 0x30B3, 0x30B3, 0x30B4, 0x30B5, 0x30B6, 0x30B7, 0x30B8,
- 0x30B9, 0x30BA, 0x30BB, 0x30BC, 0x30BD, 0x30BE, 0x30BF, 0x30C0,
- 0x30C1, 0x30C2, 0x30C3, 0x30C4, 0x30C5, 0x30C6, 0x30C7, 0x30C8,
- 0x30C9, 0x30CA, 0x30CB, 0x30CC, 0x30CD, 0x30CE, 0x30CF, 0x30D0,
- 0x30D1, 0x30D2, 0x30D3, 0x30D4, 0x30D5, 0x30D6, 0x30D7, 0x30D8,
- 0x30D9, 0x30DA, 0x30DB, 0x30DC, 0x30DD, 0x30DE, 0x30DF, 0x30E0,
- 0x30E1, 0x30E2, 0x30E3, 0x30E4, 0x30E5, 0x30E6, 0x30E7, 0x30E8,
- 0x30E9, 0x30EA, 0x30EB, 0x30EC, 0x30ED, 0x30EE, 0x30EF, 0x30F0,
- 0x30F1, 0x30F2, 0x30F3, 0x30F4, 0x30F7, 0x30F8, 0x30F9, 0x30FA,
- 0x309D, 0x309E, 0x3041, 0x3042, 0x3043, 0x3044, 0x3045, 0x3046,
- 0x3047, 0x3048, 0x3049, 0x304A, 0x304B, 0x304B, 0x304C, 0x304D,
- 0x304E, 0x304F, 0x3050, 0x3051, 0x3051, 0x3052, 0x3053, 0x3053,
- 0x3054, 0x3055, 0x3056, 0x3057, 0x3058, 0x3059, 0x305A, 0x305B,
- 0x305C, 0x305D, 0x305E, 0x305F, 0x3060, 0x3061, 0x3062, 0x3063,
- 0x3064, 0x3065, 0x3066, 0x3067, 0x3068, 0x3069, 0x306A, 0x306B,
- 0x306C, 0x306D, 0x306E, 0x306F, 0x3070, 0x3071, 0x3072, 0x3073,
- 0x3074, 0x3075, 0x3076, 0x3077, 0x3078, 0x3079, 0x307A, 0x307B,
- 0x307C, 0x307D, 0x307E, 0x307F, 0x3080, 0x3081, 0x3082, 0x3083,
- 0x3084, 0x3085, 0x3086, 0x3087, 0x3088, 0x3089, 0x308A, 0x308B,
- 0x308C, 0x308D, 0x308E, 0x308F, 0x3090, 0x3091, 0x3092, 0x3093,
- 0x3094, 0x30FD, 0x30FE, 0x30FC, 0x30A1, 0x30A2, 0x30A3, 0x30A4,
- 0x30A5, 0x30A6, 0x30A7, 0x30A8, 0x30A9, 0x30AA, 0x30F5, 0x30AB,
- 0x30AC, 0x30AD, 0x30AE, 0x30AF, 0x30B0, 0x30F6, 0x30B1, 0x30B2,
- 0x30B3, 0x30B3, 0x30B4, 0x30B5, 0x30B6, 0x30B7, 0x30B8, 0x30B9,
- 0x30BA, 0x30BB, 0x30BC, 0x30BD, 0x30BE, 0x30BF, 0x30C0, 0x30C1,
- 0x30C2, 0x30C3, 0x30C4, 0x30C5, 0x30C6, 0x30C7, 0x30C8, 0x30C9,
- 0x30CA, 0x30CB, 0x30CC, 0x30CD, 0x30CE, 0x30CF, 0x30D0, 0x30D1,
- 0x30D2, 0x30D3, 0x30D4, 0x30D5, 0x30D6, 0x30D7, 0x30D8, 0x30D9,
- 0x30DA, 0x30DB, 0x30DC, 0x30DD, 0x30DE, 0x30DF, 0x30E0, 0x30E1,
- 0x30E2, 0x30E3, 0x30E4, 0x30E5, 0x30E6, 0x30E7, 0x30E8, 0x30E9,
- 0x30EA, 0x30EB, 0x30EC, 0x30ED, 0x30EE, 0x30EF, 0x30F0, 0x30F1,
- 0x30F2, 0x30F3, 0x30F4, 0x30F7, 0x30F8, 0x30F9, 0x30FA, 0x3001,
- 0x3002, 0x30FB, 0xFF0A, 0x203B, 0x25CB, 0x25CE, 0x25C9, 0x25B3,
- 0x25B2, 0x30FD, 0x30FE, 0x309D, 0x309E, 0xFF08, 0xFF09, 0x3014,
- 0x3015, 0xFF08, 0xFF09, 0x3014, 0x3015, 0x0030, 0x0031, 0x0032,
- 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x3041,
- 0x3042, 0x3043, 0x3044, 0x3045, 0x3046, 0x3047, 0x3048, 0x3049,
- 0x304A, 0x304B, 0x304B, 0x304C, 0x304D, 0x304E, 0x304F, 0x3050,
- 0x3051, 0x3051, 0x3052, 0x3053, 0x3054, 0x3055, 0x3056, 0x3057,
- 0x3058, 0x3059, 0x305A, 0x305B, 0x305C, 0x305D, 0x305E, 0x305F,
- 0x3060, 0x3061, 0x3062, 0x3063, 0x3064, 0x3065, 0x3066, 0x3067,
- 0x3068, 0x3069, 0x306A, 0x306B, 0x306C, 0x306D, 0x306E, 0x306F,
- 0x3070, 0x3071, 0x3072, 0x3073, 0x3074, 0x3075, 0x3076, 0x3077,
- 0x3078, 0x3079, 0x307A, 0x307B, 0x307C, 0x307D, 0x307E, 0x307F,
- 0x3080, 0x3081, 0x3082, 0x3083, 0x3084, 0x3085, 0x3086, 0x3087,
- 0x3088, 0x3089, 0x308A, 0x308B, 0x308C, 0x308D, 0x308E, 0x308F,
- 0x3090, 0x3091, 0x3092, 0x3093, 0x3094, 0x3041, 0x3043, 0x3045,
- 0x3047, 0x3049, 0x304B, 0x3051, 0x3063, 0x3083, 0x3085, 0x3087,
- 0x308E, 0x30A1, 0x30A2, 0x30A3, 0x30A4, 0x30A5, 0x30A6, 0x30A7,
- 0x30A8, 0x30A9, 0x30AA, 0x30AB, 0x30F5, 0x30AC, 0x30AD, 0x30AE,
- 0x30AF, 0x30B0, 0x30B1, 0x30F6, 0x30B2, 0x30B3, 0x30B4, 0x30B5,
- 0x30B6, 0x30B7, 0x30B8, 0x30B9, 0x30BA, 0x30BB, 0x30BC, 0x30BD,
- 0x30BE, 0x30BF, 0x30C0, 0x30C1, 0x30C2, 0x30C3, 0x30C4, 0x30C5,
- 0x30C6, 0x30C7, 0x30C8, 0x30C9, 0x30CA, 0x30CB, 0x30CC, 0x30CD,
- 0x30CE, 0x30CF, 0x30D0, 0x30D1, 0x30D2, 0x30D3, 0x30D4, 0x30D5,
- 0x30D6, 0x30D7, 0x30D8, 0x30D9, 0x30DA, 0x30DB, 0x30DC, 0x30DD,
- 0x30DE, 0x30DF, 0x30E0, 0x30E1, 0x30E2, 0x30E3, 0x30E4, 0x30E5,
- 0x30E6, 0x30E7, 0x30E8, 0x30E9, 0x30EA, 0x30EB, 0x30EC, 0x30ED,
- 0x30EE, 0x30EF, 0x30F0, 0x30F1, 0x30F2, 0x30F3, 0x30F4, 0x30A1,
- 0x30A3, 0x30A5, 0x30A7, 0x30A9, 0x30F5, 0x30F6, 0x30C3, 0x30E3,
- 0x30E5, 0x30E7, 0x30EE, 0x30FC, 0x30FC, 0x6CE8, 0x20AC, 0x2126,
- 0x2032, 0x2033, 0xFB00, 0xFB03, 0xFB04, 0x0101, 0x012B, 0x016B,
- 0x0113, 0x014D, 0x0100, 0x012A, 0x016A, 0x0112, 0x014C, 0x215B,
- 0x215C, 0x215D, 0x215E, 0x2153, 0x2154, 0x2070, 0x2074, 0x2075,
- 0x2076, 0x2077, 0x2078, 0x2079, 0x2080, 0x2081, 0x2082, 0x2083,
- 0x2084, 0x2085, 0x2086, 0x2087, 0x2088, 0x2089, 0x01CD, 0x011A,
- 0x0000, 0x1EBC, 0x01CF, 0x0000, 0x0128, 0x01D1, 0x0000, 0x01D3,
- 0x016E, 0x0168, 0x01CE, 0x011B, 0x0000, 0x1EBD, 0x01D0, 0x0000,
- 0x0129, 0x01D2, 0x0000, 0x01D4, 0x016F, 0x0169, 0x0251, 0x0251,
- 0x0251, 0x01FD, 0x00E6, 0x0254, 0x0254, 0x0254, 0x0259, 0x0259,
- 0x0259, 0x025A, 0x025A, 0x025A, 0x025B, 0x025B, 0x025B, 0x006A,
- 0x014B, 0x0275, 0x028C, 0x028C, 0x028C, 0x0292, 0x0283, 0x02D0,
- 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027,
- 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F,
- 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037,
- 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,
- 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047,
- 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
- 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057,
- 0x0058, 0x0059, 0x005A, 0x005B, 0x00A5, 0x005D, 0x005E, 0x005F,
- 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067,
- 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F,
- 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077,
- 0x0078, 0x0079, 0x007A, 0x007B, 0x00A6, 0x007D, 0x0303, 0x02BC,
- 0x005C, 0x02BB, 0x007C, 0x007E, 0x00A1, 0x00A2, 0x00A3, 0x2044,
- 0x0192, 0x00A7, 0x00A4, 0x201C, 0x00AB, 0x2039, 0x203A, 0xFB01,
- 0xFB02, 0x2012, 0x2020, 0x2021, 0x00B7, 0x00B6, 0x2022, 0x201A,
- 0x201E, 0x201D, 0x00BB, 0x2026, 0x2030, 0x00BF, 0x0301, 0x0302,
- 0x00AF, 0x0306, 0x0307, 0x0308, 0x030A, 0x00B8, 0x030B, 0x0328,
- 0x030C, 0x0336, 0x00C6, 0x00AA, 0x0141, 0x00D8, 0x0152, 0x00BA,
- 0x00E6, 0x0131, 0x0142, 0x00F8, 0x0153, 0x00DF, 0x002D, 0x00A9,
- 0x00AC, 0x00AE, 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B5, 0x00B9,
- 0x00BC, 0x00BD, 0x00BE, 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4,
- 0x00C5, 0x00C7, 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD,
- 0x00CE, 0x00CF, 0x00D0, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5,
- 0x00D6, 0x00D7, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x00DE,
- 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E7, 0x00E8,
- 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF, 0x00F0,
- 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7, 0x00F9,
- 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x00FF, 0x0160, 0x0178,
- 0x017D, 0x0305, 0x0161, 0x2122, 0x017E, 0x0030, 0x20AC, 0x2126,
- 0x2032, 0x2033, 0xFB00, 0xFB03, 0xFB04, 0x0101, 0x012B, 0x016B,
- 0x0113, 0x014D, 0x0100, 0x012A, 0x016A, 0x0112, 0x014C, 0x215B,
- 0x215C, 0x215D, 0x215E, 0x2153, 0x2154, 0x2070, 0x2074, 0x2075,
- 0x2076, 0x2077, 0x2078, 0x2079, 0x2080, 0x2081, 0x2082, 0x2083,
- 0x2084, 0x2085, 0x2086, 0x2087, 0x2088, 0x2089, 0x01CD, 0x011A,
- 0x0000, 0x1EBC, 0x01CF, 0x0000, 0x0128, 0x01D1, 0x0000, 0x01D3,
- 0x016E, 0x0168, 0x01CE, 0x011B, 0x0000, 0x1EBD, 0x01D0, 0x0000,
- 0x0129, 0x01D2, 0x0000, 0x01D4, 0x016F, 0x0169, 0x0030, 0x0031,
- 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039,
- 0x0336, 0x002D, 0x003D, 0x002C, 0x0028, 0x0029, 0x002E, 0x002F,
- 0x003A, 0x003B, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035,
- 0x0036, 0x0037, 0x0038, 0x0039, 0x0336, 0x002D, 0x003D, 0x002C,
- 0x0028, 0x0029, 0x002E, 0x002F, 0x003A, 0x003B, 0x00B7, 0x002D,
- 0x003D, 0x2103, 0x2640, 0x2642, 0x3013, 0x3012, 0x300C, 0x300D,
- 0x300E, 0x300F, 0x301A, 0x301B, 0x3018, 0x3019, 0xFF08, 0xFF09,
- 0x301D, 0x301E, 0x2018, 0x2019, 0x201C, 0x201D, 0x0027, 0x0022,
- 0x9038, 0x8B01, 0x7DE3, 0x9EC3, 0x6EAB, 0x798D, 0x6094, 0x6D77,
- 0x6168, 0x6982, 0x6E34, 0x8910, 0x6F22, 0x5668, 0x65E2, 0x7948,
- 0x865B, 0x97FF, 0x52E4, 0x8B39, 0x63ED, 0x64CA, 0x784F, 0x7A40,
- 0x6BBA, 0x7949, 0x8996, 0x716E, 0x793E, 0x8005, 0x81ED, 0x795D,
- 0x6691, 0x7F72, 0x6D89, 0x72C0, 0x613C, 0x771E, 0x7BC0, 0x7956,
- 0x50E7, 0x5C64, 0x5DE2, 0x618E, 0x8D08, 0x537D, 0x5606, 0x8457,
- 0x5FB5, 0x61F2, 0x93AD, 0x798E, 0x9B2D, 0x7A81, 0x96E3, 0x6885,
- 0x7E41, 0x6669, 0x5351, 0x7891, 0x8CD3, 0x654F, 0x4FAE, 0x5002,
- 0x5840, 0x52C9, 0x6B65, 0x58A8, 0x6BCF, 0x514D, 0x623E, 0x7950,
- 0x6B04, 0x9686, 0x865C, 0x6DDA, 0x985E, 0x66C6, 0x6B77, 0x7DF4,
- 0x934A, 0x5ECA, 0x9304, 0x6982, 0x51B4, 0x634C, 0x86DB, 0x9089,
- 0x9022, 0x5049, 0x7DEF, 0x9055, 0x53A9, 0x990C, 0x885B, 0x5EF6,
- 0x6CBF, 0x925B, 0x7FC1, 0x82BD, 0x96C5, 0x5BB3, 0x6168, 0x6982,
- 0x6BBB, 0x6562, 0x8CAB, 0x5DCC, 0x9811, 0x5E30, 0x8ECC, 0x7AAE,
- 0x5747, 0x5091, 0x7A74, 0x5065, 0x5EFA, 0x9237, 0x6A8E, 0x4EA4,
- 0x516C, 0x66F4, 0x6821, 0x786C, 0x7D5E, 0x8003, 0x8CFC, 0x964D,
- 0x62F7, 0x7F6A, 0x4F7F, 0x53F2, 0x59C9, 0x8B1D, 0x90AA, 0x53CE,
- 0x8F2F, 0x67D4, 0x77AC, 0x821C, 0x696F, 0x677E, 0x8A1F, 0x4E08,
- 0x57F4, 0x690D, 0x8077, 0x89AA, 0x9042, 0x636E, 0x6442, 0x8239,
- 0x7DCF, 0x8061, 0x50CF, 0x8A95, 0x6065, 0x5146, 0x773A, 0x8074,
- 0x8DF3, 0x5EAD, 0x5EF7, 0x8247, 0x6843, 0x9003, 0x6D3E, 0x6392,
- 0x8F29, 0x73ED, 0x9812, 0x60B2, 0x6249, 0x6590, 0x7DCB, 0x8AB9,
- 0x8CA7, 0x7236, 0x847A, 0x5206, 0x5674, 0x61A4, 0x7C89, 0x7D1B,
- 0x96F0, 0x853D, 0x4FBF, 0x6367, 0x76C6, 0x685D, 0x8108, 0x8036,
- 0x7FFC, 0x540F, 0x96A3, 0x9E9F, 0x9E97, 0x806F, 0x807E, 0x6E7E,
- 0x5085, 0x5193, 0x51DB, 0x5315, 0x5340, 0x96D9, 0x55A9, 0x56C1,
- 0x570D, 0x58AB, 0x59DA, 0x5A36, 0x5ABE, 0x5D4E, 0x5D87, 0x5DC9,
- 0x5DD3, 0x5F2D, 0x5F98, 0x60D8, 0x613D, 0x61FE, 0x6268, 0x62CF,
- 0x651D, 0x640F, 0x64F2, 0x655D, 0x665F, 0x67A9, 0x67E7, 0x696B,
- 0x6930, 0x69A7, 0x6A44, 0x6A90, 0x6C08, 0x6C13, 0x6E23, 0x6F11,
- 0x6EFE, 0x6F3E, 0x71FF, 0x73E5, 0x7432, 0x745F, 0x74E0, 0x750C,
- 0x7672, 0x792A, 0x78D4, 0x79BA, 0x7A19, 0x7A95, 0x7CF2, 0x7D73,
- 0x7DDD, 0x7E35, 0x7FAE, 0x7FE1, 0x805A, 0x805F, 0x8073, 0x8070,
- 0x8076, 0x8153, 0x818A, 0x81B5, 0x81CD, 0x83F2, 0x8555, 0x85D5,
- 0x871A, 0x8836, 0x889E, 0x88D8, 0x88F4, 0x892B, 0x893B, 0x896A,
- 0x896F, 0x8A1D, 0x8D05, 0x8D0F, 0x9F4E, 0x8E91, 0x8EA1, 0x9052,
- 0x900E, 0x9130, 0x9156, 0x9158, 0x9165, 0x9173, 0x9172, 0x91A2,
- 0x91AF, 0x91AA, 0x91B4, 0x91BA, 0x9477, 0x9698, 0x973D, 0x9760,
- 0x9771, 0x980C, 0x9873, 0x98C3, 0x9A45, 0x9B4D, 0x9B58, 0x9BC6,
- 0x9BE1, 0x9BF1, 0x9D48, 0x9DCF, 0x9F08, 0x6271, 0x6697, 0x610F,
- 0x8863, 0x9055, 0x907A, 0x78EF, 0x54E1, 0x2ED7, 0x2EBD, 0x53A9,
- 0x74DC, 0x904B, 0x990C, 0x885E, 0x92B3, 0x95B1, 0x5EF6, 0x63F4,
- 0x6CBF, 0x7159, 0x9060, 0x925B, 0x65BC, 0x5F80, 0x7FC1, 0x5378,
- 0x97F3, 0x5316, 0x82B1, 0x83D3, 0x8CA8, 0x904E, 0x82BD, 0x96C5,
- 0x9913, 0x5EFB, 0x7070, 0x5BB3, 0x6168, 0x6168, 0x6168, 0x69EA,
- 0x6982, 0x676E, 0x89D2, 0x9694, 0x5272, 0x8F44, 0x938C, 0x82C5,
- 0x5BD2, 0x74B0, 0x7DE9, 0x7F36, 0x9084, 0x9592, 0x97D3, 0x8218,
- 0x5371, 0x559C, 0x3402, 0x3402, 0x5E7E, 0x65E3, 0x671F, 0x6A5F,
- 0x8D77, 0x98E2, 0x5409, 0x55AB, 0x8650, 0x9006, 0x53CA, 0x5438,
- 0x6025, 0x7D1A, 0x5DE8, 0x62D2, 0x8DDD, 0x9B5A, 0x9B5A, 0x537F,
- 0x5F3A, 0x6050, 0x69C1, 0x6A4B, 0x6A4B, 0x9115, 0x97FF, 0x9957,
- 0x6681, 0x2EA9, 0x8FD1, 0x5036, 0x77E9, 0x5177, 0x865E, 0x7A7A,
- 0x9047, 0x6ADB, 0x5553, 0x5951, 0x6075, 0x6167, 0x8FCE, 0x5091,
- 0x6F54, 0x7A74, 0x2EBC, 0x2EBC, 0x517C, 0x5238, 0x61B2, 0x6743,
- 0x80A9, 0x8B19, 0x9063, 0x539F, 0x8A01, 0x6236, 0x96C7, 0x9867,
- 0x5433, 0x5A1B, 0x8AA4, 0x5DE5, 0x614C, 0x6285, 0x63A7, 0x69CB,
- 0x6D69, 0x6E2F, 0x8015, 0x8154, 0x8352, 0x8B1B, 0x8CFC, 0x543F,
- 0x9177, 0x8170, 0x7511, 0x8FBC, 0x4ECA, 0x9396, 0x5EA7, 0x5F69,
- 0x63A1, 0x6B72, 0x83DC, 0x51B4, 0x54B2, 0x524A, 0x7522, 0x9910,
- 0x59FF, 0x59FF, 0x5DFF, 0x8AEE, 0x8AEE, 0x8CC7, 0x8CC7, 0x6B21,
- 0x6B21, 0x6ECB, 0x73BA, 0x53F1, 0x6368, 0x659C, 0x90AA, 0x52FA,
- 0x7235, 0x7235, 0x914C, 0x5F31, 0x4E3B, 0x53D7, 0x6388, 0x5468,
- 0x7D42, 0x7FD2, 0x8846, 0x9031, 0x4F4F, 0x8853, 0x8FF0, 0x5DE1,
- 0x9075, 0x9075, 0x6240, 0x66F8, 0x5973, 0x52DD, 0x5546, 0x5BB5,
- 0x5C06, 0x2E8C, 0x2E8D, 0x5C19, 0x6D88, 0x785D, 0x8096, 0x4E08,
- 0x5B82, 0x57CE, 0x60C5, 0x57F4, 0x98FE, 0x690D, 0x6B96, 0x98DF,
- 0x98E0, 0x2EDE, 0x378D, 0x4FB5, 0x2E97, 0x6D78, 0x771F, 0x9032,
- 0x4EBB, 0x4EBA, 0x5203, 0x5C0B, 0x8A0A, 0x8A0A, 0x8FC5, 0x8870,
- 0x9042, 0x351F, 0x52E2, 0x6210, 0x76DB, 0x8056, 0x8980, 0x8AA0,
- 0x8ACB, 0x975C, 0x975C, 0x7A05, 0x8106, 0x96BB, 0x7C4D, 0x7BC0,
- 0x8AAA, 0x96EA, 0x7D76, 0x6247, 0x6F98, 0x7FA1, 0x8239, 0x9078,
- 0x9077, 0x524D, 0x5168, 0x6383, 0x63F7, 0x7626, 0x8D70, 0x9001,
- 0x906D, 0x9020, 0x2ECA, 0x901F, 0x8CCA, 0x5C0A, 0x5C0A, 0x59A5,
- 0x6CF0, 0x9000, 0x902E, 0x968A, 0x9BDB, 0x5927, 0x3427, 0x7027,
- 0x9054, 0x812B, 0x4E39, 0x6B4E, 0x70AD, 0x8A95, 0x6696, 0x5024,
- 0x7F6E, 0x7BC9, 0x2EAE, 0x7B51, 0x9010, 0x67F1, 0x6CE8, 0x99D0,
- 0x5F6B, 0x5FB5, 0x61F2, 0x671D, 0x6F6E, 0x8ABF, 0x76F4, 0x6715,
- 0x6715, 0x589C, 0x8FFD, 0x901A, 0x576A, 0x91E3, 0x5448, 0x5E1D,
- 0x7A0B, 0x7684, 0x9069, 0x8FED, 0x6DFB, 0x514E, 0x9014, 0x783A,
- 0x5721, 0x571F, 0x51AC, 0x5510, 0x7CD6, 0x85E4, 0x8B04, 0x9003,
- 0x900F, 0x9A30, 0x5C0E, 0x9053, 0x5451, 0x3B88, 0x5167, 0x8089,
- 0x4E73, 0x5FCD, 0x8A8D, 0x5BE7, 0x7D0D, 0x8987, 0x6D3E, 0x80BA,
- 0x535A, 0x8584, 0x8FEB, 0x7E1B, 0x8087, 0x4E37, 0x6F51, 0x91B1,
- 0x4F34, 0x5224, 0x534A, 0x5E06, 0x7554, 0x6669, 0x8543, 0x907F,
- 0x5FAE, 0x9F3B, 0x5339, 0x2EAA, 0x5F65, 0x59EC, 0x59EB, 0x8A55,
- 0x5E99, 0x75C5, 0x5A66, 0x6577, 0x6D6E, 0x8CA0, 0x8CA0, 0x670D,
- 0x8986, 0x4E19, 0x5E63, 0x5E73, 0x5F0A, 0x8511, 0x504F, 0x7DE8,
- 0x8FD4, 0x904D, 0x7C3F, 0x5305, 0x5D29, 0x62B1, 0x670B, 0x7832,
- 0x7E2B, 0x80DE, 0x840C, 0x90A6, 0x90A6, 0x98FD, 0x9D6C, 0x4EA1,
- 0x5E3D, 0x5FD8, 0x5FD9, 0x623F, 0x671B, 0x671B, 0x5192, 0x6469,
- 0x7FFB, 0x51E1, 0x78E8, 0x9B54, 0x2FC7, 0x69D9, 0x685D, 0x4FE3,
- 0x53C8, 0x7E6D, 0x9EBF, 0x8108, 0x660E, 0x76DF, 0x8FF7, 0x5984,
- 0x52D0, 0x76F2, 0x8017, 0x623E, 0x7D0B, 0x9580, 0x7D04, 0x8E8D,
- 0x687A, 0x687A, 0x6801, 0x6109, 0x8AED, 0x8F38, 0x52C7, 0x6709,
- 0x7336, 0x7336, 0x7337, 0x88D5, 0x904A, 0x66DC, 0x2EB7, 0x8981,
- 0x990A, 0x7FCC, 0x7FFC, 0x8EB6, 0x862D, 0x7387, 0x9F8D, 0x9F8D,
- 0x65C5, 0x6881, 0x71D0, 0x96A3, 0x9C57, 0x9E9F, 0x7C7B, 0x5EC9,
- 0x6190, 0x9023, 0x6717, 0x8002, 0x8107, 0x50CA, 0x511A, 0x5154,
- 0x5195, 0x2E87, 0x528D, 0x52D7, 0x52F9, 0x5349, 0x353E, 0x53DF,
- 0x66FC, 0x5533, 0x55E4, 0x5455, 0x56C0, 0x5939, 0x5A1C, 0x5AC2,
- 0x5B73, 0x5BC3, 0x5C14, 0x37E2, 0x5CE6, 0x5E54, 0x4E48, 0x5EE3,
- 0x6097, 0x62D4, 0x62CC, 0x641C, 0x63C6, 0x6428, 0x8209, 0x631B,
- 0x665F, 0x665F, 0x6663, 0x66F5, 0x675E, 0x689D, 0x688D, 0x69F6,
- 0x6961, 0x5BE8, 0x5BE8, 0x69BB, 0x6BCC, 0x6F11, 0x6E17, 0x6F98,
- 0x6CAA, 0x6CAA, 0x701B, 0x7162, 0x723B, 0x4E2C, 0x731C, 0x74CA,
- 0x74EF, 0x7575, 0x75EC, 0x764E, 0x3FB1, 0x776A, 0x77A9, 0x7940,
- 0x7953, 0x7953, 0x9F4B, 0x79AE, 0x9083, 0x7B53, 0x7C11, 0x7C14,
- 0x4264, 0x7C50, 0x7C58, 0x7D46, 0x7D63, 0x7E22, 0x7E22, 0x7E48,
- 0x7E35, 0x7E43, 0x7E8C, 0x7F50, 0x7F51, 0x7F51, 0x7F51, 0x7FC5,
- 0x7FC6, 0x7FE9, 0x8141, 0x4453, 0x8258, 0x8279, 0x2EBF, 0x2EC0,
- 0x82E3, 0x5179, 0x83A2, 0x8420, 0x83BD, 0x84F4, 0x856D, 0x8587,
- 0x85F4, 0x4E55, 0x8737, 0x873B, 0x8805, 0x87BD, 0x867D, 0x8836,
- 0x8944, 0x88C6, 0x89BD, 0x8ADB, 0x8B3E, 0x8B5A, 0x8D73, 0x8D99,
- 0x8DCB, 0x8E34, 0x8E4A, 0x8FEF, 0x9087, 0x8FFA, 0x901E, 0x9035,
- 0x9050, 0x8FC8, 0x9081, 0x908A, 0x908A, 0x908A, 0x908A, 0x908A,
- 0x908A, 0x9089, 0x9089, 0x9089, 0x9089, 0x9089, 0x9089, 0x9089,
- 0x9089, 0x9089, 0x9089, 0x9089, 0x9089, 0x92CF, 0x93DD, 0x95BC,
- 0x9621, 0x96B2, 0x975C, 0x9839, 0x98EB, 0x9903, 0x9909, 0x9945,
- 0x9945, 0x994B, 0x9A08, 0x9A5F, 0x9A65, 0x9AEF, 0x9B18, 0x9BDF,
- 0x9D09, 0x9D08, 0x9EA5, 0x9ECC, 0x9F08, 0x9F4A, 0x9F63, 0x9F67,
- 0x9F6C, 0x7199, 0x7199, 0x891C, 0x68C8, 0x66FB, 0x5F45, 0x5300,
- 0x5389, 0x5953, 0xFA11, 0x6852, 0x6A73, 0x6D87, 0xFA15, 0x8A12,
- 0x4E04, 0x4E05, 0x4E1F, 0x4E2B, 0x4E2F, 0x4E30, 0x4E40, 0x4E41,
- 0x4E44, 0x4E5A, 0x4E7F, 0x4E8D, 0x4E96, 0x4EB9, 0x4ED0, 0x4EE0,
- 0x4EFD, 0x4EFF, 0x4F0B, 0x4F15, 0x4F60, 0x4F3B, 0x4F49, 0x4F54,
- 0x4F7A, 0x4F7D, 0x4F7E, 0x4F97, 0x4FBE, 0x4FCF, 0x4FFD, 0x5000,
- 0x5001, 0x5010, 0x501B, 0x5027, 0x502E, 0x5057, 0x5066, 0x506A,
- 0x503B, 0x508F, 0x5096, 0x509C, 0x50CC, 0x50E6, 0x50E9, 0x50EF,
- 0x5108, 0x510B, 0x5110, 0x511B, 0x511E, 0x515F, 0x51A1, 0x51BC,
- 0x51DE, 0x51EE, 0x51F4, 0x5201, 0x5202, 0x5213, 0x5249, 0x5261,
- 0x5266, 0x5293, 0x52C8, 0x52F0, 0x530A, 0x530B, 0x533E, 0x534C,
- 0x534B, 0x5361, 0x536C, 0x53AB, 0x53DA, 0x53E6, 0x53F5, 0x5427,
- 0x544D, 0x5466, 0x546B, 0x5474, 0x548D, 0x5496, 0x54A1, 0x54AD,
- 0x54B9, 0x54BF, 0x54C6, 0x54CD, 0x550E, 0x552B, 0x5535, 0x554A,
- 0x5560, 0x5561, 0x5588, 0x558E, 0x5608, 0x560E, 0x560F, 0x5637,
- 0x563F, 0x5649, 0x564B, 0x564F, 0x5666, 0x5669, 0x566F, 0x5671,
- 0x5672, 0x5695, 0x569A, 0x56AC, 0x56AD, 0x56B1, 0x56C9, 0x56DD,
- 0x56E4, 0x570A, 0x5715, 0x5723, 0x572F, 0x5733, 0x5734, 0x574C,
- 0x5770, 0x578C, 0x579C, 0x57B8, 0x57E6, 0x57ED, 0x57F5, 0x57F6,
- 0x57FF, 0x5809, 0x5820, 0x5832, 0x587C, 0x5880, 0x58A9, 0x58CE,
- 0x58D0, 0x58D4, 0x58DA, 0x58E9, 0x590C, 0x5924, 0x592F, 0x5961,
- 0x596D, 0x59CA, 0x59D2, 0x59DD, 0x59E3, 0x59E4, 0x5A04, 0x5A0C,
- 0x5A23, 0x5A47, 0x5A55, 0x5A63, 0x5A6D, 0x5A7E, 0x5A9E, 0x5AA7,
- 0x5AAC, 0x5AB3, 0x5AE0, 0x5B00, 0x5B19, 0x5B25, 0x5B2D, 0x5B41,
- 0x5B7C, 0x5B7E, 0x5B7F, 0x5B8A, 0x5C23, 0x5C2B, 0x5C30, 0x5C63,
- 0x5C69, 0x5C7C, 0x5CCB, 0x5CD2, 0x5CF4, 0x5D24, 0x5D26, 0x5D43,
- 0x5D46, 0x5D4A, 0x5D92, 0x5D94, 0x5D99, 0x5DA0, 0x5DD8, 0x5DE0,
- 0x5DF8, 0x5E00, 0x5E12, 0x5E14, 0x5E15, 0x5E18, 0x5E2E, 0x5E58,
- 0x5E6B, 0x5E6C, 0x5EA8, 0x5EAA, 0x5EBE, 0x5EBF, 0x5ECB, 0x5ED2,
- 0x5F07, 0x5F0E, 0x5F1C, 0x5F1D, 0x5F22, 0x5F28, 0x5F36, 0x5F3B,
- 0x5F40, 0x5F50, 0x5F58, 0x5F64, 0x5F89, 0x5F9C, 0x5FA7, 0x5FA4,
- 0x5FAF, 0x5FB8, 0x5FC4, 0x5FC9, 0x5FE1, 0x5FE9, 0x5FED, 0x5FFC,
- 0x6017, 0x601A, 0x6033, 0x6061, 0x607F, 0x609E, 0x60A4, 0x60B0,
- 0x60CB, 0x60DB, 0x60F8, 0x6112, 0x6113, 0x6114, 0x611C, 0x617C,
- 0x618D, 0x619F, 0x61A8, 0x61C2, 0x61DF, 0x6215, 0x6229, 0x6243,
- 0x6246, 0x624C, 0x6251, 0x6256, 0x62C4, 0x62FC, 0x630A, 0x630D,
- 0x6318, 0x6339, 0x6342, 0x6343, 0x6365, 0x6374, 0x637D, 0x6384,
- 0x6387, 0x6390, 0x639E, 0x63D1, 0x63DC, 0x6409, 0x6410, 0x6422,
- 0x6454, 0x645B, 0x646D, 0x647B, 0x64BE, 0x64BF, 0x64E5, 0x64F7,
- 0x64FB, 0x6504, 0x6516, 0x6519, 0x6547, 0x6567, 0x6581, 0x6585,
- 0x65C2, 0x65F0, 0x65F2, 0x662C, 0x664C, 0x665B, 0x665C, 0x6661,
- 0x666B, 0x6677, 0x66A4, 0x66C8, 0x66EC, 0x6705, 0x6713, 0x6733,
- 0x6748, 0x674C, 0x6776, 0x677B, 0x67B0, 0x67B2, 0x67F9, 0x67D7,
- 0x67D9, 0x67F0, 0x682C, 0x6830, 0x6831, 0x685B, 0x6872, 0x6875,
- 0x687A, 0x6884, 0x68A5, 0x68B2, 0x68D0, 0x68D6, 0x68E8, 0x68ED,
- 0x68F0, 0x68F1, 0x68FC, 0x6911, 0x6913, 0x6935, 0x693B, 0x6957,
- 0x6963, 0x6972, 0x697F, 0x6980, 0x69A6, 0x69AD, 0x69B7, 0x69D6,
- 0x69D7, 0x6A01, 0x6A0F, 0x6A15, 0x6A28, 0x6A34, 0x6A3E, 0x6A45,
- 0x6A50, 0x6A51, 0x6A56, 0x6A5B, 0x6A83, 0x6A89, 0x6A91, 0x6A9D,
- 0x6A9E, 0x6A9F, 0x6ADC, 0x6AE7, 0x6AEC, 0x6B1E, 0x6B24, 0x6B35,
- 0x6B46, 0x6B56, 0x6B60, 0x6B82, 0x6BBE, 0x6BE1, 0x6BF1, 0x6C10,
- 0x6C33, 0x6C35, 0x6C3A, 0x6C59, 0x6C76, 0x6C7B, 0x6C85, 0x6C95,
- 0x6C9C, 0x6CD0, 0x6CD4, 0x6CD6, 0x6CE0, 0x6CEB, 0x6CEC, 0x6CEE,
- 0x6D0A, 0x6D0E, 0x6D11, 0x6D2E, 0x6D57, 0x6D5E, 0x6D65, 0x6D82,
- 0x6DBF, 0x6DC4, 0x6DCA, 0x6DD6, 0x6DE9, 0x6E22, 0x6E51, 0x6EC7,
- 0x6ECA, 0x6ECE, 0x6EFD, 0x6F1A, 0x6F2A, 0x6F2F, 0x6F33, 0x6F5A,
- 0x6F5E, 0x6F62, 0x6F7D, 0x6F8B, 0x6F8D, 0x6F92, 0x6F94, 0x6F9A,
- 0x6FA7, 0x6FA8, 0x6FB6, 0x6FDA, 0x6FDE, 0x6FF9, 0x7039, 0x703C,
- 0x704A, 0x7054, 0x705D, 0x705E, 0x7064, 0x706C, 0x707E, 0x7081,
- 0x7095, 0x70B7, 0x70D3, 0x70D4, 0x70D8, 0x70DC, 0x7107, 0x7120,
- 0x7131, 0x714A, 0x7152, 0x7160, 0x7179, 0x7192, 0x71B3, 0x71CB,
- 0x71D3, 0x71D6, 0x7200, 0x721D, 0x722B, 0x7238, 0x7241, 0x7253,
- 0x7255, 0x7256, 0x725C, 0x728D, 0x72AD, 0x72B4, 0x72C7, 0x72FB,
- 0x7304, 0x7305, 0x7328, 0x7331, 0x7343, 0x736C, 0x737C, 0x7383,
- 0x7385, 0x7386, 0x7395, 0x739E, 0x739F, 0x73A0, 0x73A6, 0x73AB,
- 0x73B5, 0x73B7, 0x73BC, 0x73CF, 0x73D9, 0x73E9, 0x73F4, 0x73FD,
- 0x7404, 0x740A, 0x741A, 0x741B, 0x7424, 0x7428, 0x742C, 0x742F,
- 0x7430, 0x7431, 0x7439, 0x7444, 0x7447, 0x744B, 0x744D, 0x7451,
- 0x7457, 0x7466, 0x746B, 0x7471, 0x7480, 0x7485, 0x7486, 0x7487,
- 0x7490, 0x7498, 0x749C, 0x74A0, 0x74A3, 0x74A8, 0x74AB, 0x74B5,
- 0x74BF, 0x74C8, 0x74DA, 0x74DE, 0x754E, 0x7579, 0x7581, 0x7590,
- 0x7592, 0x7593, 0x75B4, 0x75E4, 0x75F9, 0x7600, 0x760A, 0x7615,
- 0x7616, 0x7619, 0x761E, 0x762D, 0x7635, 0x7643, 0x764B, 0x7665,
- 0x766D, 0x766F, 0x7671, 0x7674, 0x76A4, 0x76A5, 0x76C5, 0x76CC,
- 0x76EC, 0x76FC, 0x7734, 0x7736, 0x775C, 0x775F, 0x7760, 0x7772,
- 0x777D, 0x7795, 0x77AA, 0x77E6, 0x77F0, 0x77F4, 0x7806, 0x7822,
- 0x782D, 0x782E, 0x7830, 0x7835, 0x7868, 0x789E, 0x78C8, 0x78CC,
- 0x78CE, 0x78E4, 0x78E0, 0x78E1, 0x78F2, 0x78F7, 0x78FB, 0x7931,
- 0x7934, 0x793B, 0x793D, 0x7945, 0x795B, 0x795C, 0x798B, 0x7996,
- 0x7998, 0x79B8, 0x79BB, 0x79CA, 0x79DA, 0x7A03, 0x7A09, 0x7A11,
- 0x7A1E, 0x7A2D, 0x7A39, 0x7A45, 0x7A4C, 0x7A5D, 0x7A60, 0x7A6D,
- 0x7A78, 0x7AA0, 0x7AA3, 0x7AB3, 0x7ABB, 0x7ABC, 0x7AC6, 0x7B07,
- 0x7B14, 0x7B27, 0x7B31, 0x7B47, 0x7B4E, 0x7B60, 0x7B69, 0x7B6D,
- 0x7B72, 0x7B91, 0x7BAF, 0x7BD7, 0x7BD9, 0x7C0B, 0x7C0F, 0x7C20,
- 0x7C26, 0x7C31, 0x7C36, 0x7C51, 0x7C59, 0x7C67, 0x7C6E, 0x7C70,
- 0x7CBC, 0x7CBF, 0x7CC8, 0x7CC9, 0x7CD7, 0x7CD9, 0x7CDD, 0x7CEB,
- 0x7D07, 0x7D08, 0x7D09, 0x7D13, 0x7D1D, 0x7D23, 0x7D41, 0x7D53,
- 0x7D59, 0x7D5D, 0x7D7A, 0x7D86, 0x7D8B, 0x7D8C, 0x7DCC, 0x7DEB,
- 0x7DF1, 0x7DF9, 0x7E08, 0x7E11, 0x7E15, 0x7E20, 0x7E47, 0x7E62,
- 0x7E6E, 0x7E73, 0x7E8D, 0x7E91, 0x7E98, 0x7F44, 0x7F4F, 0x7F52,
- 0x7F53, 0x7F61, 0x7F91, 0x7FBF, 0x7FCE, 0x7FDF, 0x7FE5, 0x7FEC,
- 0x7FEE, 0x7FEF, 0x7FFA, 0x800E, 0x8011, 0x8014, 0x8024, 0x8026,
- 0x803A, 0x803C, 0x8060, 0x8071, 0x8075, 0x809E, 0x80A6, 0x80AB,
- 0x80D7, 0x80D8, 0x8116, 0x8118, 0x813A, 0x814A, 0x814C, 0x8181,
- 0x8184, 0x81B4, 0x81CF, 0x81F9, 0x8203, 0x8221, 0x8232, 0x8234,
- 0x8246, 0x824B, 0x824F, 0x828E, 0x82AE, 0x82B7, 0x82BE, 0x82C6,
- 0x82FE, 0x8343, 0x8351, 0x8355, 0x8386, 0x838D, 0x8392, 0x8398,
- 0x83A9, 0x83BF, 0x83C0, 0x83EA, 0x840F, 0x8411, 0x844A, 0x8476,
- 0x84A8, 0x84AF, 0x84C0, 0x84C2, 0x84F0, 0x84FD, 0x850C, 0x8534,
- 0x855E, 0x858F, 0x85B7, 0x85CE, 0x85AD, 0x8612, 0x8629, 0x8652,
- 0x8663, 0x866C, 0x866F, 0x867A, 0x868D, 0x8691, 0x8698, 0x86A7,
- 0x86A8, 0x86FA, 0x86FD, 0x870B, 0x8713, 0x8719, 0x871E, 0x8728,
- 0x873E, 0x8771, 0x8788, 0x8799, 0x87AC, 0x87AD, 0x87B5, 0x87D6,
- 0x87EB, 0x87ED, 0x8801, 0x8803, 0x8806, 0x880B, 0x8814, 0x881C,
- 0x8856, 0x885F, 0x8864, 0x8898, 0x88AA, 0x88BD, 0x88BE, 0x88CA,
- 0x88D2, 0x88DB, 0x88F0, 0x88F1, 0x8906, 0x8918, 0x8919, 0x891A,
- 0x8927, 0x8930, 0x893E, 0x897B, 0x89D4, 0x89D6, 0x89E5, 0x89F1,
- 0x8A07, 0x8A0F, 0x8A15, 0x8A22, 0x8A4E, 0x8A7F, 0x8AF4, 0x8B1F,
- 0x8B37, 0x8B43, 0x8B44, 0x8B54, 0x8B9C, 0x8B9E, 0x8C47, 0x8C54,
- 0x8C73, 0x8CA4, 0x8CD9, 0x8CE1, 0x8CF8, 0x8CFE, 0x8D1B, 0x8D69,
- 0x8D6C, 0x8D84, 0x8D8D, 0x8D95, 0x8DA6, 0x8DC6, 0x8DCE, 0x8DE4,
- 0x8DEC, 0x8E20, 0x8E4B, 0x8E6C, 0x8E70, 0x8E7A, 0x8E92, 0x8EAE,
- 0x8EB3, 0x8ED1, 0x8ED4, 0x8EF9, 0x8F17, 0x8F36, 0x8FA6, 0x8FB5,
- 0x8FB6, 0x8FC6, 0x8FE0, 0x8FE4, 0x8FF6, 0x9002, 0x902C, 0x9044,
- 0x9088, 0x9095, 0x9099, 0x909B, 0x90A2, 0x90B4, 0x90D7, 0x90DD,
- 0x90F4, 0x9117, 0x911C, 0x9131, 0x913A, 0x913D, 0x9148, 0x915B,
- 0x9161, 0x9164, 0x918E, 0x919E, 0x91A8, 0x91AD, 0x91AE, 0x91B2,
- 0x91BC, 0x91F0, 0x91F7, 0x91FB, 0x9207, 0x9228, 0x9233, 0x9238,
- 0x9243, 0x9247, 0x924F, 0x9260, 0x92C2, 0x92CB, 0x92CC, 0x92DF,
- 0x930D, 0x9315, 0x931F, 0x9327, 0x9347, 0x9352, 0x9365, 0x936A,
- 0x936D, 0x939B, 0x93BA, 0x93A9, 0x93C1, 0x93CA, 0x93E2, 0x93FA,
- 0x93FD, 0x940F, 0x9434, 0x943F, 0x9455, 0x946B, 0x9472, 0x9578,
- 0x95A6, 0x95A9, 0x95AB, 0x95B4, 0x95BD, 0x95DA, 0x961D, 0x9641,
- 0x9658, 0x9684, 0x96A4, 0x96A9, 0x96D2, 0x5DB2, 0x96DE, 0x96E9,
- 0x96F1, 0x9702, 0x9709, 0x975A, 0x9763, 0x976E, 0x9773, 0x979A,
- 0x97A2, 0x97B5, 0x97B6, 0x97D9, 0x97DE, 0x97F4, 0x980A, 0x980E,
- 0x981E, 0x9823, 0x982B, 0x983E, 0x9852, 0x9853, 0x9859, 0x986C,
- 0x98B8, 0x98BA, 0x98BF, 0x98C8, 0x98E5, 0x9932, 0x9933, 0x9940,
- 0x994D, 0x995C, 0x995F, 0x99B1, 0x99B9, 0x99BA, 0x99C9, 0x9A02,
- 0x9A16, 0x9A24, 0x9A27, 0x9A2D, 0x9A2E, 0x9A36, 0x9A38, 0x9A4A,
- 0x9A56, 0x9AB5, 0x9AB6, 0x9AF9, 0x9B03, 0x9B20, 0x9B33, 0x9B34,
- 0x9B73, 0x9B79, 0x9BA7, 0x9BC1, 0x9BC7, 0x9BD7, 0x9BE7, 0x9BEB,
- 0x9BF7, 0x9BFA, 0x9BFD, 0x9C0B, 0x9C27, 0x9C2A, 0x9C36, 0x9C41,
- 0x9C53, 0x9C63, 0x9C6A, 0x9C77, 0x9D02, 0x9D42, 0x9D47, 0x9D63,
- 0x9D69, 0x9D7C, 0x9D7E, 0x9D8D, 0x9DB1, 0x9DC3, 0x9DC7, 0x9DD6,
- 0x9DDF, 0x9DEB, 0x9DF4, 0x9E15, 0x9E1D, 0x9EA4, 0x9EA8, 0x9EAC,
- 0x9EE7, 0x9EEE, 0x9F10, 0x9F12, 0x9F17, 0x9F19, 0x9F2F, 0x9F37,
- 0x9F39, 0x9F41, 0x9F45, 0x9F57, 0x9F68, 0x9F71, 0x9F75, 0x9F90,
- 0x9F94, 0x9FA2, 0x4E30, 0x3405, 0x4F60, 0x5620, 0x5ECB, 0x2E95,
- 0x60A4, 0x69D7, 0x6B24, 0x6FF9, 0x6EE6, 0x71B3, 0x2EA4, 0x7AC6,
- 0x7F61, 0x8071, 0x809E, 0x2ECC, 0x91F0, 0x5DB2, 0x97DE, 0x4FD3,
- 0x50D9, 0x50F0, 0x51C3, 0x5676, 0x6A54, 0x6D01, 0x6DD0, 0x6E42,
- 0x6ED9, 0x73E4, 0x7421, 0x756C, 0x7851, 0x87F5, 0xFFFD, 0x73A8,
- 0x3AF3, 0x34DB, 0x440C, 0x3E8A, 0xFFFD, 0xFFFD, 0x4BE8, 0xFFFD,
- 0x3EDA, 0x3B22, 0xFFFD, 0x457A, 0x4093, 0xFFFD, 0x4665, 0x4103,
- 0x4293, 0x46AE, 0x3488, 0xFFFD,
-};
+// 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
+
+extern const unsigned short g_FXCMAP_Japan1CID2Unicode_4[15444] = {
+ 0xFFFD, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026,
+ 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E,
+ 0x002F, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036,
+ 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E,
+ 0x003F, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046,
+ 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E,
+ 0x004F, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056,
+ 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x00A5, 0x005D, 0x005E,
+ 0x005F, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066,
+ 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E,
+ 0x006F, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076,
+ 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x00A6, 0x007D, 0x0303,
+ 0x02BC, 0x005C, 0x02BB, 0x007C, 0x007E, 0x00A1, 0x00A2, 0x00A3,
+ 0x2044, 0x0192, 0x00A7, 0x00A4, 0x201C, 0x00AB, 0x2039, 0x203A,
+ 0xFB01, 0xFB02, 0x2012, 0x2020, 0x2021, 0x00B7, 0x00B6, 0x2022,
+ 0x201A, 0x201E, 0x201D, 0x00BB, 0x2026, 0x2030, 0x00BF, 0x0301,
+ 0x0302, 0x00AF, 0x0306, 0x0307, 0x0308, 0x030A, 0x00B8, 0x030B,
+ 0x0328, 0x030C, 0x0336, 0x00C6, 0x00AA, 0x0141, 0x00D8, 0x0152,
+ 0x00BA, 0x00E6, 0x0131, 0x0142, 0x00F8, 0x0153, 0x00DF, 0x002D,
+ 0x00A9, 0x00AC, 0x00AE, 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B5,
+ 0x00B9, 0x00BC, 0x00BD, 0x00BE, 0x00C0, 0x00C1, 0x00C2, 0x00C3,
+ 0x00C4, 0x00C5, 0x00C7, 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC,
+ 0x00CD, 0x00CE, 0x00CF, 0x00D0, 0x00D1, 0x00D2, 0x00D3, 0x00D4,
+ 0x00D5, 0x00D6, 0x00D7, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x00DD,
+ 0x00DE, 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E7,
+ 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF,
+ 0x00F0, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7,
+ 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x00FF, 0x0160,
+ 0x0178, 0x017D, 0x0305, 0x0161, 0x2122, 0x017E, 0x0030, 0x0020,
+ 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028,
+ 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 0x0030,
+ 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038,
+ 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 0x0040,
+ 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048,
+ 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050,
+ 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058,
+ 0x0059, 0x005A, 0x005B, 0x00A5, 0x005D, 0x005E, 0x005F, 0x0060,
+ 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068,
+ 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070,
+ 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078,
+ 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x203E, 0xFF60, 0xFF61,
+ 0xFF62, 0xFF63, 0xFF64, 0xFF65, 0xFF66, 0xFF67, 0xFF68, 0xFF69,
+ 0xFF6A, 0xFF6B, 0xFF6C, 0xFF6D, 0xFF6E, 0xFF6F, 0xFF70, 0xFF71,
+ 0xFF72, 0xFF73, 0xFF74, 0xFF75, 0xFF76, 0xFF77, 0xFF78, 0xFF79,
+ 0xFF7A, 0xFF7B, 0xFF7C, 0xFF7D, 0xFF7E, 0xFF7F, 0xFF80, 0xFF81,
+ 0xFF82, 0xFF83, 0xFF84, 0xFF85, 0xFF86, 0xFF87, 0xFF88, 0xFF89,
+ 0xFF8A, 0xFF8B, 0xFF8C, 0xFF8D, 0xFF8E, 0xFF8F, 0xFF90, 0xFF91,
+ 0xFF92, 0xFF93, 0xFF94, 0xFF95, 0xFF96, 0xFF97, 0xFF98, 0xFF99,
+ 0xFF9A, 0xFF9B, 0xFF9C, 0xFF9D, 0xFF9E, 0xFF9F, 0xFF40, 0x30F0,
+ 0x30F1, 0x30EE, 0x30AB, 0x30B1, 0x30F4, 0x30AC, 0x30AE, 0x30B0,
+ 0x30B2, 0x30B4, 0x30B6, 0x30B8, 0x30BA, 0x30BC, 0x30BE, 0x30C0,
+ 0x30C2, 0x30C5, 0x30C7, 0x30C9, 0x30D0, 0x30D1, 0x30D3, 0x30D4,
+ 0x30D6, 0x30D7, 0x30D9, 0x30DA, 0x30DC, 0x30DD, 0xFF60, 0x301D,
+ 0x301E, 0x2500, 0x2501, 0x2502, 0x2503, 0x2504, 0x2505, 0x2506,
+ 0x2507, 0x2508, 0x2509, 0x250A, 0x250B, 0x250C, 0x250D, 0x250E,
+ 0x250F, 0x2510, 0x2511, 0x2512, 0x2513, 0x2514, 0x2515, 0x2516,
+ 0x2517, 0x2518, 0x2519, 0x251A, 0x251B, 0x251C, 0x251D, 0x251E,
+ 0x251F, 0x2520, 0x2521, 0x2522, 0x2523, 0x2524, 0x2525, 0x2526,
+ 0x2527, 0x2528, 0x2529, 0x252A, 0x252B, 0x252C, 0x252D, 0x252E,
+ 0x252F, 0x2530, 0x2531, 0x2532, 0x2533, 0x2534, 0x2535, 0x2536,
+ 0x2537, 0x2538, 0x2539, 0x253A, 0x253B, 0x253C, 0x253D, 0x253E,
+ 0x253F, 0x2540, 0x2541, 0x2542, 0x2543, 0x2544, 0x2545, 0x2546,
+ 0x2547, 0x2548, 0x2549, 0x254A, 0x254B, 0x2032, 0x00A8, 0x2036,
+ 0x005B, 0x005D, 0x3008, 0x3009, 0x300A, 0x300B, 0x300E, 0x300F,
+ 0x3010, 0x3011, 0x2012, 0xFF60, 0x3092, 0x3041, 0x3043, 0x3045,
+ 0x3047, 0x3049, 0x3083, 0x3085, 0x3087, 0x3063, 0x3042, 0x3044,
+ 0x3046, 0x3048, 0x304A, 0x304B, 0x304D, 0x304F, 0x3051, 0x3053,
+ 0x3055, 0x3057, 0x3059, 0x305B, 0x305D, 0x305F, 0x3061, 0x3064,
+ 0x3066, 0x3068, 0x306A, 0x306B, 0x306C, 0x306D, 0x306E, 0x306F,
+ 0x3072, 0x3075, 0x3078, 0x307B, 0x307E, 0x307F, 0x3080, 0x3081,
+ 0x3082, 0x3084, 0x3086, 0x3088, 0x3089, 0x308A, 0x308B, 0x308C,
+ 0x308D, 0x308F, 0x3093, 0x3090, 0x3091, 0x308E, 0x304C, 0x304E,
+ 0x3050, 0x3052, 0x3054, 0x3056, 0x3068, 0x305A, 0x305C, 0x305E,
+ 0x3060, 0x3062, 0x3065, 0x3067, 0x3069, 0x3070, 0x3071, 0x3073,
+ 0x3074, 0x3076, 0x3077, 0x3079, 0x307A, 0x307C, 0x307D, 0x00C4,
+ 0x00F9, 0x00E9, 0x00ED, 0x00DF, 0x00E7, 0x00C7, 0x00D1, 0x00F1,
+ 0x00A2, 0x00A3, 0x00F3, 0x00FA, 0x00A1, 0x00BF, 0x00BD, 0x00D6,
+ 0x00DC, 0x00E4, 0x00EB, 0x00EF, 0x00F6, 0x00DC, 0x00E2, 0x00EA,
+ 0x00EE, 0x00F4, 0x00FC, 0x00E0, 0x00E9, 0x25B2, 0x00E1, 0x007E,
+ 0x0030, 0x3000, 0x3001, 0x3002, 0xFF0C, 0xFF0E, 0x30FB, 0xFF1A,
+ 0xFF1B, 0xFF1F, 0xFF01, 0x309B, 0x309C, 0x00B4, 0xFF40, 0x00A8,
+ 0xFF3E, 0x203E, 0xFF3F, 0x30FD, 0x30FE, 0x309D, 0x309E, 0x3003,
+ 0x4EDD, 0x3005, 0x3006, 0x3007, 0x30FC, 0x2015, 0x2010, 0xFF0F,
+ 0xFF3C, 0xFF5E, 0x2016, 0xFF5C, 0x2026, 0x2025, 0x2018, 0x2019,
+ 0x201C, 0x201D, 0xFF08, 0xFF09, 0x3014, 0x3015, 0xFF3B, 0xFF3D,
+ 0xFF5B, 0xFF5D, 0x3008, 0x3009, 0x300A, 0x300B, 0x300C, 0x300D,
+ 0x300E, 0x300F, 0x3010, 0x3011, 0xFF0B, 0xFF0D, 0x00B1, 0x00D7,
+ 0x00F7, 0xFF1D, 0x2260, 0xFF1C, 0xFF1E, 0x2266, 0x2267, 0x221E,
+ 0x2234, 0x2642, 0x2640, 0x00B0, 0x2032, 0x2033, 0x2103, 0xFFE5,
+ 0xFF04, 0x00A2, 0x00A3, 0xFF05, 0xFF03, 0xFF06, 0xFF0A, 0xFF20,
+ 0x00A7, 0x2606, 0x2605, 0x25CB, 0x25CF, 0x25CE, 0x25C7, 0x25C6,
+ 0x25A1, 0x25A0, 0x25B3, 0x25B2, 0x25BD, 0x25BC, 0x203B, 0x3012,
+ 0x2192, 0x2190, 0x2191, 0x2193, 0x3013, 0x2208, 0x220B, 0x2286,
+ 0x2287, 0x2282, 0x2283, 0x222A, 0x2229, 0x2227, 0x2228, 0x00AC,
+ 0x21D2, 0x21D4, 0x2200, 0x2203, 0x2220, 0x22A5, 0x2312, 0x2202,
+ 0x2207, 0x2261, 0x2252, 0x226A, 0x226B, 0x221A, 0x223D, 0x221D,
+ 0x2235, 0x222B, 0x222C, 0x212B, 0x2030, 0x266F, 0x266D, 0x266A,
+ 0x2020, 0x2021, 0x00B6, 0x25EF, 0xFF10, 0xFF11, 0xFF12, 0xFF13,
+ 0xFF14, 0xFF15, 0xFF16, 0xFF17, 0xFF18, 0xFF19, 0xFF21, 0xFF22,
+ 0xFF23, 0xFF24, 0xFF25, 0xFF26, 0xFF27, 0xFF28, 0xFF29, 0xFF2A,
+ 0xFF2B, 0xFF2C, 0xFF2D, 0xFF2E, 0xFF2F, 0xFF30, 0xFF31, 0xFF32,
+ 0xFF33, 0xFF34, 0xFF35, 0xFF36, 0xFF37, 0xFF38, 0xFF39, 0xFF3A,
+ 0xFF41, 0xFF42, 0xFF43, 0xFF44, 0xFF45, 0xFF46, 0xFF47, 0xFF48,
+ 0xFF49, 0xFF4A, 0xFF4B, 0xFF4C, 0xFF4D, 0xFF4E, 0xFF4F, 0xFF50,
+ 0xFF51, 0xFF52, 0xFF53, 0xFF54, 0xFF55, 0xFF56, 0xFF57, 0xFF58,
+ 0xFF59, 0xFF5A, 0x3041, 0x3042, 0x3043, 0x3044, 0x3045, 0x3046,
+ 0x3047, 0x3048, 0x3049, 0x304A, 0x304B, 0x304C, 0x304D, 0x304E,
+ 0x304F, 0x3050, 0x3051, 0x3052, 0x3053, 0x3054, 0x3055, 0x3056,
+ 0x3057, 0x3058, 0x3059, 0x305A, 0x305B, 0x305C, 0x305D, 0x305E,
+ 0x305F, 0x3060, 0x3061, 0x3062, 0x3063, 0x3064, 0x3065, 0x3066,
+ 0x3067, 0x3068, 0x3069, 0x306A, 0x306B, 0x306C, 0x306D, 0x306E,
+ 0x306F, 0x3070, 0x3071, 0x3072, 0x3073, 0x3074, 0x3075, 0x3076,
+ 0x3077, 0x3078, 0x3079, 0x307A, 0x307B, 0x307C, 0x307D, 0x307E,
+ 0x307F, 0x3080, 0x3081, 0x3082, 0x3083, 0x3084, 0x3085, 0x3086,
+ 0x3087, 0x3088, 0x3089, 0x308A, 0x308B, 0x308C, 0x308D, 0x308E,
+ 0x308F, 0x3090, 0x3091, 0x3092, 0x3093, 0x30A1, 0x30A2, 0x30A3,
+ 0x30A4, 0x30A5, 0x30A6, 0x30A7, 0x30A8, 0x30A9, 0x30AA, 0x30AB,
+ 0x30AC, 0x30AD, 0x30AE, 0x30AF, 0x30B0, 0x30B1, 0x30B2, 0x30B3,
+ 0x30B4, 0x30B5, 0x30B6, 0x30B7, 0x30B8, 0x30B9, 0x30BA, 0x30BB,
+ 0x30BC, 0x30BD, 0x30BE, 0x30BF, 0x30C0, 0x30C1, 0x30C2, 0x30C3,
+ 0x30C4, 0x30C5, 0x30C6, 0x30C7, 0x30C8, 0x30C9, 0x30CA, 0x30CB,
+ 0x30CC, 0x30CD, 0x30CE, 0x30CF, 0x30D0, 0x30D1, 0x30D2, 0x30D3,
+ 0x30D4, 0x30D5, 0x30D6, 0x30D7, 0x30D8, 0x30D9, 0x30DA, 0x30DB,
+ 0x30DC, 0x30DD, 0x30DE, 0x30DF, 0x30E0, 0x30E1, 0x30E2, 0x30E3,
+ 0x30E4, 0x30E5, 0x30E6, 0x30E7, 0x30E8, 0x30E9, 0x30EA, 0x30EB,
+ 0x30EC, 0x30ED, 0x30EE, 0x30EF, 0x30F0, 0x30F1, 0x30F2, 0x30F3,
+ 0x30F4, 0x30F5, 0x30F6, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395,
+ 0x0396, 0x0397, 0x0398, 0x0399, 0x039A, 0x039B, 0x039C, 0x039D,
+ 0x039E, 0x039F, 0x03A0, 0x03A1, 0x03A3, 0x03A4, 0x03A5, 0x03A6,
+ 0x03A7, 0x03A8, 0x03A9, 0x03B1, 0x03B2, 0x03B3, 0x03B4, 0x03B5,
+ 0x03B6, 0x03B7, 0x03B8, 0x03B9, 0x03BA, 0x03BB, 0x03BC, 0x03BD,
+ 0x03BE, 0x03BF, 0x03C0, 0x03C1, 0x03C3, 0x03C4, 0x03C5, 0x03C6,
+ 0x03C7, 0x03C8, 0x03C9, 0x0410, 0x0411, 0x0412, 0x0413, 0x0414,
+ 0x0415, 0x0401, 0x0416, 0x0417, 0x0418, 0x0419, 0x041A, 0x041B,
+ 0x041C, 0x041D, 0x041E, 0x041F, 0x0420, 0x0421, 0x0422, 0x0423,
+ 0x0424, 0x0425, 0x0426, 0x0427, 0x0428, 0x0429, 0x042A, 0x042B,
+ 0x042C, 0x042D, 0x042E, 0x042F, 0x0430, 0x0431, 0x0432, 0x0433,
+ 0x0434, 0x0435, 0x0451, 0x0436, 0x0437, 0x0438, 0x0439, 0x043A,
+ 0x043B, 0x043C, 0x043D, 0x043E, 0x043F, 0x0440, 0x0441, 0x0442,
+ 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, 0x0448, 0x0449, 0x044A,
+ 0x044B, 0x044C, 0x044D, 0x044E, 0x044F, 0x4E9C, 0x5516, 0x5A03,
+ 0x963F, 0x54C0, 0x611B, 0x6328, 0x59F6, 0x9022, 0x8475, 0x831C,
+ 0x7A50, 0x60AA, 0x63E1, 0x6E25, 0x65ED, 0x8466, 0x82A6, 0x9BF5,
+ 0x6893, 0x5727, 0x65A1, 0x6271, 0x5B9B, 0x59D0, 0x867B, 0x98F4,
+ 0x7D62, 0x7DBE, 0x9B8E, 0x6216, 0x7C9F, 0x88B7, 0x5B89, 0x5EB5,
+ 0x6309, 0x6697, 0x6848, 0x95C7, 0x978D, 0x674F, 0x4EE5, 0x4F0A,
+ 0x4F4D, 0x4F9D, 0x5049, 0x56F2, 0x5937, 0x59D4, 0x5A01, 0x5C09,
+ 0x60DF, 0x610F, 0x6170, 0x6613, 0x6905, 0x70BA, 0x754F, 0x7570,
+ 0x79FB, 0x7DAD, 0x7DEF, 0x80C3, 0x840E, 0x8863, 0x8B02, 0x9055,
+ 0x907A, 0x533B, 0x4E95, 0x4EA5, 0x57DF, 0x80B2, 0x90C1, 0x78EF,
+ 0x4E00, 0x58F1, 0x6EA2, 0x9038, 0x7A32, 0x8328, 0x828B, 0x9C2F,
+ 0x5141, 0x5370, 0x54BD, 0x54E1, 0x56E0, 0x59FB, 0x5F15, 0x98F2,
+ 0x6DEB, 0x80E4, 0x852D, 0x9662, 0x9670, 0x96A0, 0x97FB, 0x540B,
+ 0x53F3, 0x5B87, 0x70CF, 0x7FBD, 0x8FC2, 0x96E8, 0x536F, 0x9D5C,
+ 0x7ABA, 0x4E11, 0x7893, 0x81FC, 0x6E26, 0x5618, 0x5504, 0x6B1D,
+ 0x851A, 0x9C3B, 0x59E5, 0x53A9, 0x6D66, 0x74DC, 0x958F, 0x5642,
+ 0x4E91, 0x904B, 0x96F2, 0x834F, 0x990C, 0x53E1, 0x55B6, 0x5B30,
+ 0x5F71, 0x6620, 0x66F3, 0x6804, 0x6C38, 0x6CF3, 0x6D29, 0x745B,
+ 0x76C8, 0x7A4E, 0x9834, 0x82F1, 0x885B, 0x8A60, 0x92ED, 0x6DB2,
+ 0x75AB, 0x76CA, 0x99C5, 0x60A6, 0x8B01, 0x8D8A, 0x95B2, 0x698E,
+ 0x53AD, 0x5186, 0x5712, 0x5830, 0x5944, 0x5BB4, 0x5EF6, 0x6028,
+ 0x63A9, 0x63F4, 0x6CBF, 0x6F14, 0x708E, 0x7114, 0x7159, 0x71D5,
+ 0x733F, 0x7E01, 0x8276, 0x82D1, 0x8597, 0x9060, 0x925B, 0x9D1B,
+ 0x5869, 0x65BC, 0x6C5A, 0x7525, 0x51F9, 0x592E, 0x5965, 0x5F80,
+ 0x5FDC, 0x62BC, 0x65FA, 0x6A2A, 0x6B27, 0x6BB4, 0x738B, 0x7FC1,
+ 0x8956, 0x9D2C, 0x9D0E, 0x9EC4, 0x5CA1, 0x6C96, 0x837B, 0x5104,
+ 0x5C4B, 0x61B6, 0x81C6, 0x6876, 0x7261, 0x4E59, 0x4FFA, 0x5378,
+ 0x6069, 0x6E29, 0x7A4F, 0x97F3, 0x4E0B, 0x5316, 0x4EEE, 0x4F55,
+ 0x4F3D, 0x4FA1, 0x4F73, 0x52A0, 0x53EF, 0x5609, 0x590F, 0x5AC1,
+ 0x5BB6, 0x5BE1, 0x79D1, 0x6687, 0x679C, 0x67B6, 0x6B4C, 0x6CB3,
+ 0x706B, 0x73C2, 0x798D, 0x79BE, 0x7A3C, 0x7B87, 0x82B1, 0x82DB,
+ 0x8304, 0x8377, 0x83EF, 0x83D3, 0x8766, 0x8AB2, 0x5629, 0x8CA8,
+ 0x8FE6, 0x904E, 0x971E, 0x868A, 0x4FC4, 0x5CE8, 0x6211, 0x7259,
+ 0x753B, 0x81E5, 0x82BD, 0x86FE, 0x8CC0, 0x96C5, 0x9913, 0x99D5,
+ 0x4ECB, 0x4F1A, 0x89E3, 0x56DE, 0x584A, 0x58CA, 0x5EFB, 0x5FEB,
+ 0x602A, 0x6094, 0x6062, 0x61D0, 0x6212, 0x62D0, 0x6539, 0x9B41,
+ 0x6666, 0x68B0, 0x6D77, 0x7070, 0x754C, 0x7686, 0x7D75, 0x82A5,
+ 0x87F9, 0x958B, 0x968E, 0x8C9D, 0x51F1, 0x52BE, 0x5916, 0x54B3,
+ 0x5BB3, 0x5D16, 0x6168, 0x6982, 0x6DAF, 0x788D, 0x84CB, 0x8857,
+ 0x8A72, 0x93A7, 0x9AB8, 0x6D6C, 0x99A8, 0x86D9, 0x57A3, 0x67FF,
+ 0x86CE, 0x920E, 0x5283, 0x5687, 0x5404, 0x5ED3, 0x62E1, 0x64B9,
+ 0x683C, 0x6838, 0x6BBB, 0x7372, 0x78BA, 0x7A6B, 0x899A, 0x89D2,
+ 0x8D6B, 0x8F03, 0x90ED, 0x95A3, 0x9694, 0x9769, 0x5B66, 0x5CB3,
+ 0x697D, 0x984D, 0x984E, 0x639B, 0x7B20, 0x6A2B, 0x6A7F, 0x68B6,
+ 0x9C0D, 0x6F5F, 0x5272, 0x559D, 0x6070, 0x62EC, 0x6D3B, 0x6E07,
+ 0x6ED1, 0x845B, 0x8910, 0x8F44, 0x4E14, 0x9C39, 0x53F6, 0x691B,
+ 0x6A3A, 0x9784, 0x682A, 0x515C, 0x7AC3, 0x84B2, 0x91DC, 0x938C,
+ 0x565B, 0x9D28, 0x6822, 0x8305, 0x8431, 0x7CA5, 0x5208, 0x82C5,
+ 0x74E6, 0x4E7E, 0x4F83, 0x51A0, 0x5BD2, 0x520A, 0x52D8, 0x52E7,
+ 0x5DFB, 0x559A, 0x582A, 0x59E6, 0x5B8C, 0x5B98, 0x5BDB, 0x5E72,
+ 0x5E79, 0x60A3, 0x611F, 0x6163, 0x61BE, 0x63DB, 0x6562, 0x67D1,
+ 0x6853, 0x68FA, 0x6B3E, 0x6B53, 0x6C57, 0x6F22, 0x6F97, 0x6F45,
+ 0x74B0, 0x7518, 0x76E3, 0x770B, 0x7AFF, 0x7BA1, 0x7C21, 0x7DE9,
+ 0x7F36, 0x7FF0, 0x809D, 0x8266, 0x839E, 0x89B3, 0x8ACC, 0x8CAB,
+ 0x9084, 0x9451, 0x9593, 0x9591, 0x95A2, 0x9665, 0x97D3, 0x9928,
+ 0x8218, 0x4E38, 0x542B, 0x5CB8, 0x5DCC, 0x73A9, 0x764C, 0x773C,
+ 0x5CA9, 0x7FEB, 0x8D0B, 0x96C1, 0x9811, 0x9854, 0x9858, 0x4F01,
+ 0x4F0E, 0x5371, 0x559C, 0x5668, 0x57FA, 0x5947, 0x5B09, 0x5BC4,
+ 0x5C90, 0x5E0C, 0x5E7E, 0x5FCC, 0x63EE, 0x673A, 0x65D7, 0x65E2,
+ 0x671F, 0x68CB, 0x68C4, 0x6A5F, 0x5E30, 0x6BC5, 0x6C17, 0x6C7D,
+ 0x757F, 0x7948, 0x5B63, 0x7A00, 0x7D00, 0x5FBD, 0x898F, 0x8A18,
+ 0x8CB4, 0x8D77, 0x8ECC, 0x8F1D, 0x98E2, 0x9A0E, 0x9B3C, 0x4E80,
+ 0x507D, 0x5100, 0x5993, 0x5B9C, 0x622F, 0x6280, 0x64EC, 0x6B3A,
+ 0x72A0, 0x7591, 0x7947, 0x7FA9, 0x87FB, 0x8ABC, 0x8B70, 0x63AC,
+ 0x83CA, 0x97A0, 0x5409, 0x5403, 0x55AB, 0x6854, 0x6A58, 0x8A70,
+ 0x7827, 0x6775, 0x9ECD, 0x5374, 0x5BA2, 0x811A, 0x8650, 0x9006,
+ 0x4E18, 0x4E45, 0x4EC7, 0x4F11, 0x53CA, 0x5438, 0x5BAE, 0x5F13,
+ 0x6025, 0x6551, 0x673D, 0x6C42, 0x6C72, 0x6CE3, 0x7078, 0x7403,
+ 0x7A76, 0x7AAE, 0x7B08, 0x7D1A, 0x7CFE, 0x7D66, 0x65E7, 0x725B,
+ 0x53BB, 0x5C45, 0x5DE8, 0x62D2, 0x62E0, 0x6319, 0x6E20, 0x865A,
+ 0x8A31, 0x8DDD, 0x92F8, 0x6F01, 0x79A6, 0x9B5A, 0x4EA8, 0x4EAB,
+ 0x4EAC, 0x4F9B, 0x4FA0, 0x50D1, 0x5147, 0x7AF6, 0x5171, 0x51F6,
+ 0x5354, 0x5321, 0x537F, 0x53EB, 0x55AC, 0x5883, 0x5CE1, 0x5F37,
+ 0x5F4A, 0x602F, 0x6050, 0x606D, 0x631F, 0x6559, 0x6A4B, 0x6CC1,
+ 0x72C2, 0x72ED, 0x77EF, 0x80F8, 0x8105, 0x8208, 0x854E, 0x90F7,
+ 0x93E1, 0x97FF, 0x9957, 0x9A5A, 0x4EF0, 0x51DD, 0x5C2D, 0x6681,
+ 0x696D, 0x5C40, 0x66F2, 0x6975, 0x7389, 0x6850, 0x7C81, 0x50C5,
+ 0x52E4, 0x5747, 0x5DFE, 0x9326, 0x65A4, 0x6B23, 0x6B3D, 0x7434,
+ 0x7981, 0x79BD, 0x7B4B, 0x7DCA, 0x82B9, 0x83CC, 0x887F, 0x895F,
+ 0x8B39, 0x8FD1, 0x91D1, 0x541F, 0x9280, 0x4E5D, 0x5036, 0x53E5,
+ 0x533A, 0x72D7, 0x7396, 0x77E9, 0x82E6, 0x8EAF, 0x99C6, 0x99C8,
+ 0x99D2, 0x5177, 0x611A, 0x865E, 0x55B0, 0x7A7A, 0x5076, 0x5BD3,
+ 0x9047, 0x9685, 0x4E32, 0x6ADB, 0x91E7, 0x5C51, 0x5C48, 0x6398,
+ 0x7A9F, 0x6C93, 0x9774, 0x8F61, 0x7AAA, 0x718A, 0x9688, 0x7C82,
+ 0x6817, 0x7E70, 0x6851, 0x936C, 0x52F2, 0x541B, 0x85AB, 0x8A13,
+ 0x7FA4, 0x8ECD, 0x90E1, 0x5366, 0x8888, 0x7941, 0x4FC2, 0x50BE,
+ 0x5211, 0x5144, 0x5553, 0x572D, 0x73EA, 0x578B, 0x5951, 0x5F62,
+ 0x5F84, 0x6075, 0x6176, 0x6167, 0x61A9, 0x63B2, 0x643A, 0x656C,
+ 0x666F, 0x6842, 0x6E13, 0x7566, 0x7A3D, 0x7CFB, 0x7D4C, 0x7D99,
+ 0x7E4B, 0x7F6B, 0x830E, 0x834A, 0x86CD, 0x8A08, 0x8A63, 0x8B66,
+ 0x8EFD, 0x981A, 0x9D8F, 0x82B8, 0x8FCE, 0x9BE8, 0x5287, 0x621F,
+ 0x6483, 0x6FC0, 0x9699, 0x6841, 0x5091, 0x6B20, 0x6C7A, 0x6F54,
+ 0x7A74, 0x7D50, 0x8840, 0x8A23, 0x6708, 0x4EF6, 0x5039, 0x5026,
+ 0x5065, 0x517C, 0x5238, 0x5263, 0x55A7, 0x570F, 0x5805, 0x5ACC,
+ 0x5EFA, 0x61B2, 0x61F8, 0x62F3, 0x6372, 0x691C, 0x6A29, 0x727D,
+ 0x72AC, 0x732E, 0x7814, 0x786F, 0x7D79, 0x770C, 0x80A9, 0x898B,
+ 0x8B19, 0x8CE2, 0x8ED2, 0x9063, 0x9375, 0x967A, 0x9855, 0x9A13,
+ 0x9E78, 0x5143, 0x539F, 0x53B3, 0x5E7B, 0x5F26, 0x6E1B, 0x6E90,
+ 0x7384, 0x73FE, 0x7D43, 0x8237, 0x8A00, 0x8AFA, 0x9650, 0x4E4E,
+ 0x500B, 0x53E4, 0x547C, 0x56FA, 0x59D1, 0x5B64, 0x5DF1, 0x5EAB,
+ 0x5F27, 0x6238, 0x6545, 0x67AF, 0x6E56, 0x72D0, 0x7CCA, 0x88B4,
+ 0x80A1, 0x80E1, 0x83F0, 0x864E, 0x8A87, 0x8DE8, 0x9237, 0x96C7,
+ 0x9867, 0x9F13, 0x4E94, 0x4E92, 0x4F0D, 0x5348, 0x5449, 0x543E,
+ 0x5A2F, 0x5F8C, 0x5FA1, 0x609F, 0x68A7, 0x6A8E, 0x745A, 0x7881,
+ 0x8A9E, 0x8AA4, 0x8B77, 0x9190, 0x4E5E, 0x9BC9, 0x4EA4, 0x4F7C,
+ 0x4FAF, 0x5019, 0x5016, 0x5149, 0x516C, 0x529F, 0x52B9, 0x52FE,
+ 0x539A, 0x53E3, 0x5411, 0x540E, 0x5589, 0x5751, 0x57A2, 0x597D,
+ 0x5B54, 0x5B5D, 0x5B8F, 0x5DE5, 0x5DE7, 0x5DF7, 0x5E78, 0x5E83,
+ 0x5E9A, 0x5EB7, 0x5F18, 0x6052, 0x614C, 0x6297, 0x62D8, 0x63A7,
+ 0x653B, 0x6602, 0x6643, 0x66F4, 0x676D, 0x6821, 0x6897, 0x69CB,
+ 0x6C5F, 0x6D2A, 0x6D69, 0x6E2F, 0x6E9D, 0x7532, 0x7687, 0x786C,
+ 0x7A3F, 0x7CE0, 0x7D05, 0x7D18, 0x7D5E, 0x7DB1, 0x8015, 0x8003,
+ 0x80AF, 0x80B1, 0x8154, 0x818F, 0x822A, 0x8352, 0x884C, 0x8861,
+ 0x8B1B, 0x8CA2, 0x8CFC, 0x90CA, 0x9175, 0x9271, 0x783F, 0x92FC,
+ 0x95A4, 0x964D, 0x9805, 0x9999, 0x9AD8, 0x9D3B, 0x525B, 0x52AB,
+ 0x53F7, 0x5408, 0x58D5, 0x62F7, 0x6FE0, 0x8C6A, 0x8F5F, 0x9EB9,
+ 0x514B, 0x523B, 0x544A, 0x56FD, 0x7A40, 0x9177, 0x9D60, 0x9ED2,
+ 0x7344, 0x6F09, 0x8170, 0x7511, 0x5FFD, 0x60DA, 0x9AA8, 0x72DB,
+ 0x8FBC, 0x6B64, 0x9803, 0x4ECA, 0x56F0, 0x5764, 0x58BE, 0x5A5A,
+ 0x6068, 0x61C7, 0x660F, 0x6606, 0x6839, 0x68B1, 0x6DF7, 0x75D5,
+ 0x7D3A, 0x826E, 0x9B42, 0x4E9B, 0x4F50, 0x53C9, 0x5506, 0x5D6F,
+ 0x5DE6, 0x5DEE, 0x67FB, 0x6C99, 0x7473, 0x7802, 0x8A50, 0x9396,
+ 0x88DF, 0x5750, 0x5EA7, 0x632B, 0x50B5, 0x50AC, 0x518D, 0x6700,
+ 0x54C9, 0x585E, 0x59BB, 0x5BB0, 0x5F69, 0x624D, 0x63A1, 0x683D,
+ 0x6B73, 0x6E08, 0x707D, 0x91C7, 0x7280, 0x7815, 0x7826, 0x796D,
+ 0x658E, 0x7D30, 0x83DC, 0x88C1, 0x8F09, 0x969B, 0x5264, 0x5728,
+ 0x6750, 0x7F6A, 0x8CA1, 0x51B4, 0x5742, 0x962A, 0x583A, 0x698A,
+ 0x80B4, 0x54B2, 0x5D0E, 0x57FC, 0x7895, 0x9DFA, 0x4F5C, 0x524A,
+ 0x548B, 0x643E, 0x6628, 0x6714, 0x67F5, 0x7A84, 0x7B56, 0x7D22,
+ 0x932F, 0x685C, 0x9BAD, 0x7B39, 0x5319, 0x518A, 0x5237, 0x5BDF,
+ 0x62F6, 0x64AE, 0x64E6, 0x672D, 0x6BBA, 0x85A9, 0x96D1, 0x7690,
+ 0x9BD6, 0x634C, 0x9306, 0x9BAB, 0x76BF, 0x6652, 0x4E09, 0x5098,
+ 0x53C2, 0x5C71, 0x60E8, 0x6492, 0x6563, 0x685F, 0x71E6, 0x73CA,
+ 0x7523, 0x7B97, 0x7E82, 0x8695, 0x8B83, 0x8CDB, 0x9178, 0x9910,
+ 0x65AC, 0x66AB, 0x6B8B, 0x4ED5, 0x4ED4, 0x4F3A, 0x4F7F, 0x523A,
+ 0x53F8, 0x53F2, 0x55E3, 0x56DB, 0x58EB, 0x59CB, 0x59C9, 0x59FF,
+ 0x5B50, 0x5C4D, 0x5E02, 0x5E2B, 0x5FD7, 0x601D, 0x6307, 0x652F,
+ 0x5B5C, 0x65AF, 0x65BD, 0x65E8, 0x679D, 0x6B62, 0x6B7B, 0x6C0F,
+ 0x7345, 0x7949, 0x79C1, 0x7CF8, 0x7D19, 0x7D2B, 0x80A2, 0x8102,
+ 0x81F3, 0x8996, 0x8A5E, 0x8A69, 0x8A66, 0x8A8C, 0x8AEE, 0x8CC7,
+ 0x8CDC, 0x96CC, 0x98FC, 0x6B6F, 0x4E8B, 0x4F3C, 0x4F8D, 0x5150,
+ 0x5B57, 0x5BFA, 0x6148, 0x6301, 0x6642, 0x6B21, 0x6ECB, 0x6CBB,
+ 0x723E, 0x74BD, 0x75D4, 0x78C1, 0x793A, 0x800C, 0x8033, 0x81EA,
+ 0x8494, 0x8F9E, 0x6C50, 0x9E7F, 0x5F0F, 0x8B58, 0x9D2B, 0x7AFA,
+ 0x8EF8, 0x5B8D, 0x96EB, 0x4E03, 0x53F1, 0x57F7, 0x5931, 0x5AC9,
+ 0x5BA4, 0x6089, 0x6E7F, 0x6F06, 0x75BE, 0x8CEA, 0x5B9F, 0x8500,
+ 0x7BE0, 0x5072, 0x67F4, 0x829D, 0x5C61, 0x854A, 0x7E1E, 0x820E,
+ 0x5199, 0x5C04, 0x6368, 0x8D66, 0x659C, 0x716E, 0x793E, 0x7D17,
+ 0x8005, 0x8B1D, 0x8ECA, 0x906E, 0x86C7, 0x90AA, 0x501F, 0x52FA,
+ 0x5C3A, 0x6753, 0x707C, 0x7235, 0x914C, 0x91C8, 0x932B, 0x82E5,
+ 0x5BC2, 0x5F31, 0x60F9, 0x4E3B, 0x53D6, 0x5B88, 0x624B, 0x6731,
+ 0x6B8A, 0x72E9, 0x73E0, 0x7A2E, 0x816B, 0x8DA3, 0x9152, 0x9996,
+ 0x5112, 0x53D7, 0x546A, 0x5BFF, 0x6388, 0x6A39, 0x7DAC, 0x9700,
+ 0x56DA, 0x53CE, 0x5468, 0x5B97, 0x5C31, 0x5DDE, 0x4FEE, 0x6101,
+ 0x62FE, 0x6D32, 0x79C0, 0x79CB, 0x7D42, 0x7E4D, 0x7FD2, 0x81ED,
+ 0x821F, 0x8490, 0x8846, 0x8972, 0x8B90, 0x8E74, 0x8F2F, 0x9031,
+ 0x914B, 0x916C, 0x96C6, 0x919C, 0x4EC0, 0x4F4F, 0x5145, 0x5341,
+ 0x5F93, 0x620E, 0x67D4, 0x6C41, 0x6E0B, 0x7363, 0x7E26, 0x91CD,
+ 0x9283, 0x53D4, 0x5919, 0x5BBF, 0x6DD1, 0x795D, 0x7E2E, 0x7C9B,
+ 0x587E, 0x719F, 0x51FA, 0x8853, 0x8FF0, 0x4FCA, 0x5CFB, 0x6625,
+ 0x77AC, 0x7AE3, 0x821C, 0x99FF, 0x51C6, 0x5FAA, 0x65EC, 0x696F,
+ 0x6B89, 0x6DF3, 0x6E96, 0x6F64, 0x76FE, 0x7D14, 0x5DE1, 0x9075,
+ 0x9187, 0x9806, 0x51E6, 0x521D, 0x6240, 0x6691, 0x66D9, 0x6E1A,
+ 0x5EB6, 0x7DD2, 0x7F72, 0x66F8, 0x85AF, 0x85F7, 0x8AF8, 0x52A9,
+ 0x53D9, 0x5973, 0x5E8F, 0x5F90, 0x6055, 0x92E4, 0x9664, 0x50B7,
+ 0x511F, 0x52DD, 0x5320, 0x5347, 0x53EC, 0x54E8, 0x5546, 0x5531,
+ 0x5617, 0x5968, 0x59BE, 0x5A3C, 0x5BB5, 0x5C06, 0x5C0F, 0x5C11,
+ 0x5C1A, 0x5E84, 0x5E8A, 0x5EE0, 0x5F70, 0x627F, 0x6284, 0x62DB,
+ 0x638C, 0x6377, 0x6607, 0x660C, 0x662D, 0x6676, 0x677E, 0x68A2,
+ 0x6A1F, 0x6A35, 0x6CBC, 0x6D88, 0x6E09, 0x6E58, 0x713C, 0x7126,
+ 0x7167, 0x75C7, 0x7701, 0x785D, 0x7901, 0x7965, 0x79F0, 0x7AE0,
+ 0x7B11, 0x7CA7, 0x7D39, 0x8096, 0x83D6, 0x848B, 0x8549, 0x885D,
+ 0x88F3, 0x8A1F, 0x8A3C, 0x8A54, 0x8A73, 0x8C61, 0x8CDE, 0x91A4,
+ 0x9266, 0x937E, 0x9418, 0x969C, 0x9798, 0x4E0A, 0x4E08, 0x4E1E,
+ 0x4E57, 0x5197, 0x5270, 0x57CE, 0x5834, 0x58CC, 0x5B22, 0x5E38,
+ 0x60C5, 0x64FE, 0x6761, 0x6756, 0x6D44, 0x72B6, 0x7573, 0x7A63,
+ 0x84B8, 0x8B72, 0x91B8, 0x9320, 0x5631, 0x57F4, 0x98FE, 0x62ED,
+ 0x690D, 0x6B96, 0x71ED, 0x7E54, 0x8077, 0x8272, 0x89E6, 0x98DF,
+ 0x8755, 0x8FB1, 0x5C3B, 0x4F38, 0x4FE1, 0x4FB5, 0x5507, 0x5A20,
+ 0x5BDD, 0x5BE9, 0x5FC3, 0x614E, 0x632F, 0x65B0, 0x664B, 0x68EE,
+ 0x699B, 0x6D78, 0x6DF1, 0x7533, 0x75B9, 0x771F, 0x795E, 0x79E6,
+ 0x7D33, 0x81E3, 0x82AF, 0x85AA, 0x89AA, 0x8A3A, 0x8EAB, 0x8F9B,
+ 0x9032, 0x91DD, 0x9707, 0x4EBA, 0x4EC1, 0x5203, 0x5875, 0x58EC,
+ 0x5C0B, 0x751A, 0x5C3D, 0x814E, 0x8A0A, 0x8FC5, 0x9663, 0x976D,
+ 0x7B25, 0x8ACF, 0x9808, 0x9162, 0x56F3, 0x53A8, 0x9017, 0x5439,
+ 0x5782, 0x5E25, 0x63A8, 0x6C34, 0x708A, 0x7761, 0x7C8B, 0x7FE0,
+ 0x8870, 0x9042, 0x9154, 0x9310, 0x9318, 0x968F, 0x745E, 0x9AC4,
+ 0x5D07, 0x5D69, 0x6570, 0x67A2, 0x8DA8, 0x96DB, 0x636E, 0x6749,
+ 0x6919, 0x83C5, 0x9817, 0x96C0, 0x88FE, 0x6F84, 0x647A, 0x5BF8,
+ 0x4E16, 0x702C, 0x755D, 0x662F, 0x51C4, 0x5236, 0x52E2, 0x59D3,
+ 0x5F81, 0x6027, 0x6210, 0x653F, 0x6574, 0x661F, 0x6674, 0x68F2,
+ 0x6816, 0x6B63, 0x6E05, 0x7272, 0x751F, 0x76DB, 0x7CBE, 0x8056,
+ 0x58F0, 0x88FD, 0x897F, 0x8AA0, 0x8A93, 0x8ACB, 0x901D, 0x9192,
+ 0x9752, 0x9759, 0x6589, 0x7A0E, 0x8106, 0x96BB, 0x5E2D, 0x60DC,
+ 0x621A, 0x65A5, 0x6614, 0x6790, 0x77F3, 0x7A4D, 0x7C4D, 0x7E3E,
+ 0x810A, 0x8CAC, 0x8D64, 0x8DE1, 0x8E5F, 0x78A9, 0x5207, 0x62D9,
+ 0x63A5, 0x6442, 0x6298, 0x8A2D, 0x7A83, 0x7BC0, 0x8AAC, 0x96EA,
+ 0x7D76, 0x820C, 0x8749, 0x4ED9, 0x5148, 0x5343, 0x5360, 0x5BA3,
+ 0x5C02, 0x5C16, 0x5DDD, 0x6226, 0x6247, 0x64B0, 0x6813, 0x6834,
+ 0x6CC9, 0x6D45, 0x6D17, 0x67D3, 0x6F5C, 0x714E, 0x717D, 0x65CB,
+ 0x7A7F, 0x7BAD, 0x7DDA, 0x7E4A, 0x7FA8, 0x817A, 0x821B, 0x8239,
+ 0x85A6, 0x8A6E, 0x8CCE, 0x8DF5, 0x9078, 0x9077, 0x92AD, 0x9291,
+ 0x9583, 0x9BAE, 0x524D, 0x5584, 0x6F38, 0x7136, 0x5168, 0x7985,
+ 0x7E55, 0x81B3, 0x7CCE, 0x564C, 0x5851, 0x5CA8, 0x63AA, 0x66FE,
+ 0x66FD, 0x695A, 0x72D9, 0x758F, 0x758E, 0x790E, 0x7956, 0x79DF,
+ 0x7C97, 0x7D20, 0x7D44, 0x8607, 0x8A34, 0x963B, 0x9061, 0x9F20,
+ 0x50E7, 0x5275, 0x53CC, 0x53E2, 0x5009, 0x55AA, 0x58EE, 0x594F,
+ 0x723D, 0x5B8B, 0x5C64, 0x531D, 0x60E3, 0x60F3, 0x635C, 0x6383,
+ 0x633F, 0x63BB, 0x64CD, 0x65E9, 0x66F9, 0x5DE3, 0x69CD, 0x69FD,
+ 0x6F15, 0x71E5, 0x4E89, 0x75E9, 0x76F8, 0x7A93, 0x7CDF, 0x7DCF,
+ 0x7D9C, 0x8061, 0x8349, 0x8358, 0x846C, 0x84BC, 0x85FB, 0x88C5,
+ 0x8D70, 0x9001, 0x906D, 0x9397, 0x971C, 0x9A12, 0x50CF, 0x5897,
+ 0x618E, 0x81D3, 0x8535, 0x8D08, 0x9020, 0x4FC3, 0x5074, 0x5247,
+ 0x5373, 0x606F, 0x6349, 0x675F, 0x6E2C, 0x8DB3, 0x901F, 0x4FD7,
+ 0x5C5E, 0x8CCA, 0x65CF, 0x7D9A, 0x5352, 0x8896, 0x5176, 0x63C3,
+ 0x5B58, 0x5B6B, 0x5C0A, 0x640D, 0x6751, 0x905C, 0x4ED6, 0x591A,
+ 0x592A, 0x6C70, 0x8A51, 0x553E, 0x5815, 0x59A5, 0x60F0, 0x6253,
+ 0x67C1, 0x8235, 0x6955, 0x9640, 0x99C4, 0x9A28, 0x4F53, 0x5806,
+ 0x5BFE, 0x8010, 0x5CB1, 0x5E2F, 0x5F85, 0x6020, 0x614B, 0x6234,
+ 0x66FF, 0x6CF0, 0x6EDE, 0x80CE, 0x817F, 0x82D4, 0x888B, 0x8CB8,
+ 0x9000, 0x902E, 0x968A, 0x9EDB, 0x9BDB, 0x4EE3, 0x53F0, 0x5927,
+ 0x7B2C, 0x918D, 0x984C, 0x9DF9, 0x6EDD, 0x7027, 0x5353, 0x5544,
+ 0x5B85, 0x6258, 0x629E, 0x62D3, 0x6CA2, 0x6FEF, 0x7422, 0x8A17,
+ 0x9438, 0x6FC1, 0x8AFE, 0x8338, 0x51E7, 0x86F8, 0x53EA, 0x53E9,
+ 0x4F46, 0x9054, 0x8FB0, 0x596A, 0x8131, 0x5DFD, 0x7AEA, 0x8FBF,
+ 0x68DA, 0x8C37, 0x72F8, 0x9C48, 0x6A3D, 0x8AB0, 0x4E39, 0x5358,
+ 0x5606, 0x5766, 0x62C5, 0x63A2, 0x65E6, 0x6B4E, 0x6DE1, 0x6E5B,
+ 0x70AD, 0x77ED, 0x7AEF, 0x7BAA, 0x7DBB, 0x803D, 0x80C6, 0x86CB,
+ 0x8A95, 0x935B, 0x56E3, 0x58C7, 0x5F3E, 0x65AD, 0x6696, 0x6A80,
+ 0x6BB5, 0x7537, 0x8AC7, 0x5024, 0x77E5, 0x5730, 0x5F1B, 0x6065,
+ 0x667A, 0x6C60, 0x75F4, 0x7A1A, 0x7F6E, 0x81F4, 0x8718, 0x9045,
+ 0x99B3, 0x7BC9, 0x755C, 0x7AF9, 0x7B51, 0x84C4, 0x9010, 0x79E9,
+ 0x7A92, 0x8336, 0x5AE1, 0x7740, 0x4E2D, 0x4EF2, 0x5B99, 0x5FE0,
+ 0x62BD, 0x663C, 0x67F1, 0x6CE8, 0x866B, 0x8877, 0x8A3B, 0x914E,
+ 0x92F3, 0x99D0, 0x6A17, 0x7026, 0x732A, 0x82E7, 0x8457, 0x8CAF,
+ 0x4E01, 0x5146, 0x51CB, 0x558B, 0x5BF5, 0x5E16, 0x5E33, 0x5E81,
+ 0x5F14, 0x5F35, 0x5F6B, 0x5FB4, 0x61F2, 0x6311, 0x66A2, 0x671D,
+ 0x6F6E, 0x7252, 0x753A, 0x773A, 0x8074, 0x8139, 0x8178, 0x8776,
+ 0x8ABF, 0x8ADC, 0x8D85, 0x8DF3, 0x929A, 0x9577, 0x9802, 0x9CE5,
+ 0x52C5, 0x6357, 0x76F4, 0x6715, 0x6C88, 0x73CD, 0x8CC3, 0x93AE,
+ 0x9673, 0x6D25, 0x589C, 0x690E, 0x69CC, 0x8FFD, 0x939A, 0x75DB,
+ 0x901A, 0x585A, 0x6802, 0x63B4, 0x69FB, 0x4F43, 0x6F2C, 0x67D8,
+ 0x8FBB, 0x8526, 0x7DB4, 0x9354, 0x693F, 0x6F70, 0x576A, 0x58F7,
+ 0x5B2C, 0x7D2C, 0x722A, 0x540A, 0x91E3, 0x9DB4, 0x4EAD, 0x4F4E,
+ 0x505C, 0x5075, 0x5243, 0x8C9E, 0x5448, 0x5824, 0x5B9A, 0x5E1D,
+ 0x5E95, 0x5EAD, 0x5EF7, 0x5F1F, 0x608C, 0x62B5, 0x633A, 0x63D0,
+ 0x68AF, 0x6C40, 0x7887, 0x798E, 0x7A0B, 0x7DE0, 0x8247, 0x8A02,
+ 0x8AE6, 0x8E44, 0x9013, 0x90B8, 0x912D, 0x91D8, 0x9F0E, 0x6CE5,
+ 0x6458, 0x64E2, 0x6575, 0x6EF4, 0x7684, 0x7B1B, 0x9069, 0x93D1,
+ 0x6EBA, 0x54F2, 0x5FB9, 0x64A4, 0x8F4D, 0x8FED, 0x9244, 0x5178,
+ 0x586B, 0x5929, 0x5C55, 0x5E97, 0x6DFB, 0x7E8F, 0x751C, 0x8CBC,
+ 0x8EE2, 0x985B, 0x70B9, 0x4F1D, 0x6BBF, 0x6FB1, 0x7530, 0x96FB,
+ 0x514E, 0x5410, 0x5835, 0x5857, 0x59AC, 0x5C60, 0x5F92, 0x6597,
+ 0x675C, 0x6E21, 0x767B, 0x83DF, 0x8CED, 0x9014, 0x90FD, 0x934D,
+ 0x7825, 0x783A, 0x52AA, 0x5EA6, 0x571F, 0x5974, 0x6012, 0x5012,
+ 0x515A, 0x51AC, 0x51CD, 0x5200, 0x5510, 0x5854, 0x5858, 0x5957,
+ 0x5B95, 0x5CF6, 0x5D8B, 0x60BC, 0x6295, 0x642D, 0x6771, 0x6843,
+ 0x68BC, 0x68DF, 0x76D7, 0x6DD8, 0x6E6F, 0x6D9B, 0x706F, 0x71C8,
+ 0x5F53, 0x75D8, 0x7977, 0x7B49, 0x7B54, 0x7B52, 0x7CD6, 0x7D71,
+ 0x5230, 0x8463, 0x8569, 0x85E4, 0x8A0E, 0x8B04, 0x8C46, 0x8E0F,
+ 0x9003, 0x900F, 0x9419, 0x9676, 0x982D, 0x9A30, 0x95D8, 0x50CD,
+ 0x52D5, 0x540C, 0x5802, 0x5C0E, 0x61A7, 0x649E, 0x6D1E, 0x77B3,
+ 0x7AE5, 0x80F4, 0x8404, 0x9053, 0x9285, 0x5CE0, 0x9D07, 0x533F,
+ 0x5F97, 0x5FB3, 0x6D9C, 0x7279, 0x7763, 0x79BF, 0x7BE4, 0x6BD2,
+ 0x72EC, 0x8AAD, 0x6803, 0x6A61, 0x51F8, 0x7A81, 0x6934, 0x5C4A,
+ 0x9CF6, 0x82EB, 0x5BC5, 0x9149, 0x701E, 0x5678, 0x5C6F, 0x60C7,
+ 0x6566, 0x6C8C, 0x8C5A, 0x9041, 0x9813, 0x5451, 0x66C7, 0x920D,
+ 0x5948, 0x90A3, 0x5185, 0x4E4D, 0x51EA, 0x8599, 0x8B0E, 0x7058,
+ 0x637A, 0x934B, 0x6962, 0x99B4, 0x7E04, 0x7577, 0x5357, 0x6960,
+ 0x8EDF, 0x96E3, 0x6C5D, 0x4E8C, 0x5C3C, 0x5F10, 0x8FE9, 0x5302,
+ 0x8CD1, 0x8089, 0x8679, 0x5EFF, 0x65E5, 0x4E73, 0x5165, 0x5982,
+ 0x5C3F, 0x97EE, 0x4EFB, 0x598A, 0x5FCD, 0x8A8D, 0x6FE1, 0x79B0,
+ 0x7962, 0x5BE7, 0x8471, 0x732B, 0x71B1, 0x5E74, 0x5FF5, 0x637B,
+ 0x649A, 0x71C3, 0x7C98, 0x4E43, 0x5EFC, 0x4E4B, 0x57DC, 0x56A2,
+ 0x60A9, 0x6FC3, 0x7D0D, 0x80FD, 0x8133, 0x81BF, 0x8FB2, 0x8997,
+ 0x86A4, 0x5DF4, 0x628A, 0x64AD, 0x8987, 0x6777, 0x6CE2, 0x6D3E,
+ 0x7436, 0x7834, 0x5A46, 0x7F75, 0x82AD, 0x99AC, 0x4FF3, 0x5EC3,
+ 0x62DD, 0x6392, 0x6557, 0x676F, 0x76C3, 0x724C, 0x80CC, 0x80BA,
+ 0x8F29, 0x914D, 0x500D, 0x57F9, 0x5A92, 0x6885, 0x6973, 0x7164,
+ 0x72FD, 0x8CB7, 0x58F2, 0x8CE0, 0x966A, 0x9019, 0x877F, 0x79E4,
+ 0x77E7, 0x8429, 0x4F2F, 0x5265, 0x535A, 0x62CD, 0x67CF, 0x6CCA,
+ 0x767D, 0x7B94, 0x7C95, 0x8236, 0x8584, 0x8FEB, 0x66DD, 0x6F20,
+ 0x7206, 0x7E1B, 0x83AB, 0x99C1, 0x9EA6, 0x51FD, 0x7BB1, 0x7872,
+ 0x7BB8, 0x8087, 0x7B48, 0x6AE8, 0x5E61, 0x808C, 0x7551, 0x7560,
+ 0x516B, 0x9262, 0x6E8C, 0x767A, 0x9197, 0x9AEA, 0x4F10, 0x7F70,
+ 0x629C, 0x7B4F, 0x95A5, 0x9CE9, 0x567A, 0x5859, 0x86E4, 0x96BC,
+ 0x4F34, 0x5224, 0x534A, 0x53CD, 0x53DB, 0x5E06, 0x642C, 0x6591,
+ 0x677F, 0x6C3E, 0x6C4E, 0x7248, 0x72AF, 0x73ED, 0x7554, 0x7E41,
+ 0x822C, 0x85E9, 0x8CA9, 0x7BC4, 0x91C6, 0x7169, 0x9812, 0x98EF,
+ 0x633D, 0x6669, 0x756A, 0x76E4, 0x78D0, 0x8543, 0x86EE, 0x532A,
+ 0x5351, 0x5426, 0x5983, 0x5E87, 0x5F7C, 0x60B2, 0x6249, 0x6279,
+ 0x62AB, 0x6590, 0x6BD4, 0x6CCC, 0x75B2, 0x76AE, 0x7891, 0x79D8,
+ 0x7DCB, 0x7F77, 0x80A5, 0x88AB, 0x8AB9, 0x8CBB, 0x907F, 0x975E,
+ 0x98DB, 0x6A0B, 0x7C38, 0x5099, 0x5C3E, 0x5FAE, 0x6787, 0x6BD8,
+ 0x7435, 0x7709, 0x7F8E, 0x9F3B, 0x67CA, 0x7A17, 0x5339, 0x758B,
+ 0x9AED, 0x5F66, 0x819D, 0x83F1, 0x8098, 0x5F3C, 0x5FC5, 0x7562,
+ 0x7B46, 0x903C, 0x6867, 0x59EB, 0x5A9B, 0x7D10, 0x767E, 0x8B2C,
+ 0x4FF5, 0x5F6A, 0x6A19, 0x6C37, 0x6F02, 0x74E2, 0x7968, 0x8868,
+ 0x8A55, 0x8C79, 0x5EDF, 0x63CF, 0x75C5, 0x79D2, 0x82D7, 0x9328,
+ 0x92F2, 0x849C, 0x86ED, 0x9C2D, 0x54C1, 0x5F6C, 0x658C, 0x6D5C,
+ 0x7015, 0x8CA7, 0x8CD3, 0x983B, 0x654F, 0x74F6, 0x4E0D, 0x4ED8,
+ 0x57E0, 0x592B, 0x5A66, 0x5BCC, 0x51A8, 0x5E03, 0x5E9C, 0x6016,
+ 0x6276, 0x6577, 0x65A7, 0x666E, 0x6D6E, 0x7236, 0x7B26, 0x8150,
+ 0x819A, 0x8299, 0x8B5C, 0x8CA0, 0x8CE6, 0x8D74, 0x961C, 0x9644,
+ 0x4FAE, 0x64AB, 0x6B66, 0x821E, 0x8461, 0x856A, 0x90E8, 0x5C01,
+ 0x6953, 0x98A8, 0x847A, 0x8557, 0x4F0F, 0x526F, 0x5FA9, 0x5E45,
+ 0x670D, 0x798F, 0x8179, 0x8907, 0x8986, 0x6DF5, 0x5F17, 0x6255,
+ 0x6CB8, 0x4ECF, 0x7269, 0x9B92, 0x5206, 0x543B, 0x5674, 0x58B3,
+ 0x61A4, 0x626E, 0x711A, 0x596E, 0x7C89, 0x7CDE, 0x7D1B, 0x96F0,
+ 0x6587, 0x805E, 0x4E19, 0x4F75, 0x5175, 0x5840, 0x5E63, 0x5E73,
+ 0x5F0A, 0x67C4, 0x4E26, 0x853D, 0x9589, 0x965B, 0x7C73, 0x9801,
+ 0x50FB, 0x58C1, 0x7656, 0x78A7, 0x5225, 0x77A5, 0x8511, 0x7B86,
+ 0x504F, 0x5909, 0x7247, 0x7BC7, 0x7DE8, 0x8FBA, 0x8FD4, 0x904D,
+ 0x4FBF, 0x52C9, 0x5A29, 0x5F01, 0x97AD, 0x4FDD, 0x8217, 0x92EA,
+ 0x5703, 0x6355, 0x6B69, 0x752B, 0x88DC, 0x8F14, 0x7A42, 0x52DF,
+ 0x5893, 0x6155, 0x620A, 0x66AE, 0x6BCD, 0x7C3F, 0x83E9, 0x5023,
+ 0x4FF8, 0x5305, 0x5446, 0x5831, 0x5949, 0x5B9D, 0x5CF0, 0x5CEF,
+ 0x5D29, 0x5E96, 0x62B1, 0x6367, 0x653E, 0x65B9, 0x670B, 0x6CD5,
+ 0x6CE1, 0x70F9, 0x7832, 0x7E2B, 0x80DE, 0x82B3, 0x840C, 0x84EC,
+ 0x8702, 0x8912, 0x8A2A, 0x8C4A, 0x90A6, 0x92D2, 0x98FD, 0x9CF3,
+ 0x9D6C, 0x4E4F, 0x4EA1, 0x508D, 0x5256, 0x574A, 0x59A8, 0x5E3D,
+ 0x5FD8, 0x5FD9, 0x623F, 0x66B4, 0x671B, 0x67D0, 0x68D2, 0x5192,
+ 0x7D21, 0x80AA, 0x81A8, 0x8B00, 0x8C8C, 0x8CBF, 0x927E, 0x9632,
+ 0x5420, 0x982C, 0x5317, 0x50D5, 0x535C, 0x58A8, 0x64B2, 0x6734,
+ 0x7267, 0x7766, 0x7A46, 0x91E6, 0x52C3, 0x6CA1, 0x6B86, 0x5800,
+ 0x5E4C, 0x5954, 0x672C, 0x7FFB, 0x51E1, 0x76C6, 0x6469, 0x78E8,
+ 0x9B54, 0x9EBB, 0x57CB, 0x59B9, 0x6627, 0x679A, 0x6BCE, 0x54E9,
+ 0x69D9, 0x5E55, 0x819C, 0x6795, 0x9BAA, 0x67FE, 0x9C52, 0x685D,
+ 0x4EA6, 0x4FE3, 0x53C8, 0x62B9, 0x672B, 0x6CAB, 0x8FC4, 0x4FAD,
+ 0x7E6D, 0x9EBF, 0x4E07, 0x6162, 0x6E80, 0x6F2B, 0x8513, 0x5473,
+ 0x672A, 0x9B45, 0x5DF3, 0x7B95, 0x5CAC, 0x5BC6, 0x871C, 0x6E4A,
+ 0x84D1, 0x7A14, 0x8108, 0x5999, 0x7C8D, 0x6C11, 0x7720, 0x52D9,
+ 0x5922, 0x7121, 0x725F, 0x77DB, 0x9727, 0x9D61, 0x690B, 0x5A7F,
+ 0x5A18, 0x51A5, 0x540D, 0x547D, 0x660E, 0x76DF, 0x8FF7, 0x9298,
+ 0x9CF4, 0x59EA, 0x725D, 0x6EC5, 0x514D, 0x68C9, 0x7DBF, 0x7DEC,
+ 0x9762, 0x9EBA, 0x6478, 0x6A21, 0x8302, 0x5984, 0x5B5F, 0x6BDB,
+ 0x731B, 0x76F2, 0x7DB2, 0x8017, 0x8499, 0x5132, 0x6728, 0x9ED9,
+ 0x76EE, 0x6762, 0x52FF, 0x9905, 0x5C24, 0x623B, 0x7C7E, 0x8CB0,
+ 0x554F, 0x60B6, 0x7D0B, 0x9580, 0x5301, 0x4E5F, 0x51B6, 0x591C,
+ 0x723A, 0x8036, 0x91CE, 0x5F25, 0x77E2, 0x5384, 0x5F79, 0x7D04,
+ 0x85AC, 0x8A33, 0x8E8D, 0x9756, 0x67F3, 0x85AE, 0x9453, 0x6109,
+ 0x6108, 0x6CB9, 0x7652, 0x8AED, 0x8F38, 0x552F, 0x4F51, 0x512A,
+ 0x52C7, 0x53CB, 0x5BA5, 0x5E7D, 0x60A0, 0x6182, 0x63D6, 0x6709,
+ 0x67DA, 0x6E67, 0x6D8C, 0x7336, 0x7337, 0x7531, 0x7950, 0x88D5,
+ 0x8A98, 0x904A, 0x9091, 0x90F5, 0x96C4, 0x878D, 0x5915, 0x4E88,
+ 0x4F59, 0x4E0E, 0x8A89, 0x8F3F, 0x9810, 0x50AD, 0x5E7C, 0x5996,
+ 0x5BB9, 0x5EB8, 0x63DA, 0x63FA, 0x64C1, 0x66DC, 0x694A, 0x69D8,
+ 0x6D0B, 0x6EB6, 0x7194, 0x7528, 0x7AAF, 0x7F8A, 0x8000, 0x8449,
+ 0x84C9, 0x8981, 0x8B21, 0x8E0A, 0x9065, 0x967D, 0x990A, 0x617E,
+ 0x6291, 0x6B32, 0x6C83, 0x6D74, 0x7FCC, 0x7FFC, 0x6DC0, 0x7F85,
+ 0x87BA, 0x88F8, 0x6765, 0x83B1, 0x983C, 0x96F7, 0x6D1B, 0x7D61,
+ 0x843D, 0x916A, 0x4E71, 0x5375, 0x5D50, 0x6B04, 0x6FEB, 0x85CD,
+ 0x862D, 0x89A7, 0x5229, 0x540F, 0x5C65, 0x674E, 0x68A8, 0x7406,
+ 0x7483, 0x75E2, 0x88CF, 0x88E1, 0x91CC, 0x96E2, 0x9678, 0x5F8B,
+ 0x7387, 0x7ACB, 0x844E, 0x63A0, 0x7565, 0x5289, 0x6D41, 0x6E9C,
+ 0x7409, 0x7559, 0x786B, 0x7C92, 0x9686, 0x7ADC, 0x9F8D, 0x4FB6,
+ 0x616E, 0x65C5, 0x865C, 0x4E86, 0x4EAE, 0x50DA, 0x4E21, 0x51CC,
+ 0x5BEE, 0x6599, 0x6881, 0x6DBC, 0x731F, 0x7642, 0x77AD, 0x7A1C,
+ 0x7CE7, 0x826F, 0x8AD2, 0x907C, 0x91CF, 0x9675, 0x9818, 0x529B,
+ 0x7DD1, 0x502B, 0x5398, 0x6797, 0x6DCB, 0x71D0, 0x7433, 0x81E8,
+ 0x8F2A, 0x96A3, 0x9C57, 0x9E9F, 0x7460, 0x5841, 0x6D99, 0x7D2F,
+ 0x985E, 0x4EE4, 0x4F36, 0x4F8B, 0x51B7, 0x52B1, 0x5DBA, 0x601C,
+ 0x73B2, 0x793C, 0x82D3, 0x9234, 0x96B7, 0x96F6, 0x970A, 0x9E97,
+ 0x9F62, 0x66A6, 0x6B74, 0x5217, 0x52A3, 0x70C8, 0x88C2, 0x5EC9,
+ 0x604B, 0x6190, 0x6F23, 0x7149, 0x7C3E, 0x7DF4, 0x806F, 0x84EE,
+ 0x9023, 0x932C, 0x5442, 0x9B6F, 0x6AD3, 0x7089, 0x8CC2, 0x8DEF,
+ 0x9732, 0x52B4, 0x5A41, 0x5ECA, 0x5F04, 0x6717, 0x697C, 0x6994,
+ 0x6D6A, 0x6F0F, 0x7262, 0x72FC, 0x7BED, 0x8001, 0x807E, 0x874B,
+ 0x90CE, 0x516D, 0x9E93, 0x7984, 0x808B, 0x9332, 0x8AD6, 0x502D,
+ 0x548C, 0x8A71, 0x6B6A, 0x8CC4, 0x8107, 0x60D1, 0x67A0, 0x9DF2,
+ 0x4E99, 0x4E98, 0x9C10, 0x8A6B, 0x85C1, 0x8568, 0x6900, 0x6E7E,
+ 0x7897, 0x8155, 0x5F0C, 0x4E10, 0x4E15, 0x4E2A, 0x4E31, 0x4E36,
+ 0x4E3C, 0x4E3F, 0x4E42, 0x4E56, 0x4E58, 0x4E82, 0x4E85, 0x8C6B,
+ 0x4E8A, 0x8212, 0x5F0D, 0x4E8E, 0x4E9E, 0x4E9F, 0x4EA0, 0x4EA2,
+ 0x4EB0, 0x4EB3, 0x4EB6, 0x4ECE, 0x4ECD, 0x4EC4, 0x4EC6, 0x4EC2,
+ 0x4ED7, 0x4EDE, 0x4EED, 0x4EDF, 0x4EF7, 0x4F09, 0x4F5A, 0x4F30,
+ 0x4F5B, 0x4F5D, 0x4F57, 0x4F47, 0x4F76, 0x4F88, 0x4F8F, 0x4F98,
+ 0x4F7B, 0x4F69, 0x4F70, 0x4F91, 0x4F6F, 0x4F86, 0x4F96, 0x5118,
+ 0x4FD4, 0x4FDF, 0x4FCE, 0x4FD8, 0x4FDB, 0x4FD1, 0x4FDA, 0x4FD0,
+ 0x4FE4, 0x4FE5, 0x501A, 0x5028, 0x5014, 0x502A, 0x5025, 0x5005,
+ 0x4F1C, 0x4FF6, 0x5021, 0x5029, 0x502C, 0x4FFE, 0x4FEF, 0x5011,
+ 0x5006, 0x5043, 0x5047, 0x6703, 0x5055, 0x5050, 0x5048, 0x505A,
+ 0x5056, 0x506C, 0x5078, 0x5080, 0x509A, 0x5085, 0x50B4, 0x50B2,
+ 0x50C9, 0x50CA, 0x50B3, 0x50C2, 0x50D6, 0x50DE, 0x50E5, 0x50ED,
+ 0x50E3, 0x50EE, 0x50F9, 0x50F5, 0x5109, 0x5101, 0x5102, 0x5116,
+ 0x5115, 0x5114, 0x511A, 0x5121, 0x513A, 0x5137, 0x513C, 0x513B,
+ 0x513F, 0x5140, 0x5152, 0x514C, 0x5154, 0x5162, 0x7AF8, 0x5169,
+ 0x516A, 0x516E, 0x5180, 0x5182, 0x56D8, 0x518C, 0x5189, 0x518F,
+ 0x5191, 0x5193, 0x5195, 0x5196, 0x51A4, 0x51A6, 0x51A2, 0x51A9,
+ 0x51AA, 0x51AB, 0x51B3, 0x51B1, 0x51B2, 0x51B0, 0x51B5, 0x51BD,
+ 0x51C5, 0x51C9, 0x51DB, 0x51E0, 0x8655, 0x51E9, 0x51ED, 0x51F0,
+ 0x51F5, 0x51FE, 0x5204, 0x520B, 0x5214, 0x520E, 0x5227, 0x522A,
+ 0x522E, 0x5233, 0x5239, 0x524F, 0x5244, 0x524B, 0x524C, 0x525E,
+ 0x5254, 0x526A, 0x5274, 0x5269, 0x5273, 0x527F, 0x527D, 0x528D,
+ 0x5294, 0x5292, 0x5271, 0x5288, 0x5291, 0x8FA8, 0x8FA7, 0x52AC,
+ 0x52AD, 0x52BC, 0x52B5, 0x52C1, 0x52CD, 0x52D7, 0x52DE, 0x52E3,
+ 0x52E6, 0x98ED, 0x52E0, 0x52F3, 0x52F5, 0x52F8, 0x52F9, 0x5306,
+ 0x5308, 0x7538, 0x530D, 0x5310, 0x530F, 0x5315, 0x531A, 0x5323,
+ 0x532F, 0x5331, 0x5333, 0x5338, 0x5340, 0x5346, 0x5345, 0x4E17,
+ 0x5349, 0x534D, 0x51D6, 0x535E, 0x5369, 0x536E, 0x5918, 0x537B,
+ 0x5377, 0x5382, 0x5396, 0x53A0, 0x53A6, 0x53A5, 0x53AE, 0x53B0,
+ 0x53B6, 0x53C3, 0x7C12, 0x96D9, 0x53DF, 0x66FC, 0x71EE, 0x53EE,
+ 0x53E8, 0x53ED, 0x53FA, 0x5401, 0x543D, 0x5440, 0x542C, 0x542D,
+ 0x543C, 0x542E, 0x5436, 0x5429, 0x541D, 0x544E, 0x548F, 0x5475,
+ 0x548E, 0x545F, 0x5471, 0x5477, 0x5470, 0x5492, 0x547B, 0x5480,
+ 0x5476, 0x5484, 0x5490, 0x5486, 0x54C7, 0x54A2, 0x54B8, 0x54A5,
+ 0x54AC, 0x54C4, 0x54C8, 0x54A8, 0x54AB, 0x54C2, 0x54A4, 0x54BE,
+ 0x54BC, 0x54D8, 0x54E5, 0x54E6, 0x550F, 0x5514, 0x54FD, 0x54EE,
+ 0x54ED, 0x54FA, 0x54E2, 0x5539, 0x5540, 0x5563, 0x554C, 0x552E,
+ 0x555C, 0x5545, 0x5556, 0x5557, 0x5538, 0x5533, 0x555D, 0x5599,
+ 0x5580, 0x54AF, 0x558A, 0x559F, 0x557B, 0x557E, 0x5598, 0x559E,
+ 0x55AE, 0x557C, 0x5583, 0x55A9, 0x5587, 0x55A8, 0x55DA, 0x55C5,
+ 0x55DF, 0x55C4, 0x55DC, 0x55E4, 0x55D4, 0x5614, 0x55F7, 0x5616,
+ 0x55FE, 0x55FD, 0x561B, 0x55F9, 0x564E, 0x5650, 0x71DF, 0x5634,
+ 0x5636, 0x5632, 0x5638, 0x566B, 0x5664, 0x562F, 0x566C, 0x566A,
+ 0x5686, 0x5680, 0x568A, 0x56A0, 0x5694, 0x568F, 0x56A5, 0x56AE,
+ 0x56B6, 0x56B4, 0x56C2, 0x56BC, 0x56C1, 0x56C3, 0x56C0, 0x56C8,
+ 0x56CE, 0x56D1, 0x56D3, 0x56D7, 0x56EE, 0x56F9, 0x5700, 0x56FF,
+ 0x5704, 0x5709, 0x5708, 0x570B, 0x570D, 0x5713, 0x5718, 0x5716,
+ 0x55C7, 0x571C, 0x5726, 0x5737, 0x5738, 0x574E, 0x573B, 0x5740,
+ 0x574F, 0x5769, 0x57C0, 0x5788, 0x5761, 0x577F, 0x5789, 0x5793,
+ 0x57A0, 0x57B3, 0x57A4, 0x57AA, 0x57B0, 0x57C3, 0x57C6, 0x57D4,
+ 0x57D2, 0x57D3, 0x580A, 0x57D6, 0x57E3, 0x580B, 0x5819, 0x581D,
+ 0x5872, 0x5821, 0x5862, 0x584B, 0x5870, 0x6BC0, 0x5852, 0x583D,
+ 0x5879, 0x5885, 0x58B9, 0x589F, 0x58AB, 0x58BA, 0x58DE, 0x58BB,
+ 0x58B8, 0x58AE, 0x58C5, 0x58D3, 0x58D1, 0x58D7, 0x58D9, 0x58D8,
+ 0x58E5, 0x58DC, 0x58E4, 0x58DF, 0x58EF, 0x58FA, 0x58F9, 0x58FB,
+ 0x58FC, 0x58FD, 0x5902, 0x590A, 0x5910, 0x591B, 0x68A6, 0x5925,
+ 0x592C, 0x592D, 0x5932, 0x5938, 0x593E, 0x7AD2, 0x5955, 0x5950,
+ 0x594E, 0x595A, 0x5958, 0x5962, 0x5960, 0x5967, 0x596C, 0x5969,
+ 0x5978, 0x5981, 0x599D, 0x4F5E, 0x4FAB, 0x59A3, 0x59B2, 0x59C6,
+ 0x59E8, 0x59DC, 0x598D, 0x59D9, 0x59DA, 0x5A25, 0x5A1F, 0x5A11,
+ 0x5A1C, 0x5A09, 0x5A1A, 0x5A40, 0x5A6C, 0x5A49, 0x5A35, 0x5A36,
+ 0x5A62, 0x5A6A, 0x5A9A, 0x5ABC, 0x5ABE, 0x5ACB, 0x5AC2, 0x5ABD,
+ 0x5AE3, 0x5AD7, 0x5AE6, 0x5AE9, 0x5AD6, 0x5AFA, 0x5AFB, 0x5B0C,
+ 0x5B0B, 0x5B16, 0x5B32, 0x5AD0, 0x5B2A, 0x5B36, 0x5B3E, 0x5B43,
+ 0x5B45, 0x5B40, 0x5B51, 0x5B55, 0x5B5A, 0x5B5B, 0x5B65, 0x5B69,
+ 0x5B70, 0x5B73, 0x5B75, 0x5B78, 0x6588, 0x5B7A, 0x5B80, 0x5B83,
+ 0x5BA6, 0x5BB8, 0x5BC3, 0x5BC7, 0x5BC9, 0x5BD4, 0x5BD0, 0x5BE4,
+ 0x5BE6, 0x5BE2, 0x5BDE, 0x5BE5, 0x5BEB, 0x5BF0, 0x5BF6, 0x5BF3,
+ 0x5C05, 0x5C07, 0x5C08, 0x5C0D, 0x5C13, 0x5C20, 0x5C22, 0x5C28,
+ 0x5C38, 0x5C39, 0x5C41, 0x5C46, 0x5C4E, 0x5C53, 0x5C50, 0x5C4F,
+ 0x5B71, 0x5C6C, 0x5C6E, 0x4E62, 0x5C76, 0x5C79, 0x5C8C, 0x5C91,
+ 0x5C94, 0x599B, 0x5CAB, 0x5CBB, 0x5CB6, 0x5CBC, 0x5CB7, 0x5CC5,
+ 0x5CBE, 0x5CC7, 0x5CD9, 0x5CE9, 0x5CFD, 0x5CFA, 0x5CED, 0x5D8C,
+ 0x5CEA, 0x5D0B, 0x5D15, 0x5D17, 0x5D5C, 0x5D1F, 0x5D1B, 0x5D11,
+ 0x5D14, 0x5D22, 0x5D1A, 0x5D19, 0x5D18, 0x5D4C, 0x5D52, 0x5D4E,
+ 0x5D4B, 0x5D6C, 0x5D73, 0x5D76, 0x5D87, 0x5D84, 0x5D82, 0x5DA2,
+ 0x5D9D, 0x5DAC, 0x5DAE, 0x5DBD, 0x5D90, 0x5DB7, 0x5DBC, 0x5DC9,
+ 0x5DCD, 0x5DD3, 0x5DD2, 0x5DD6, 0x5DDB, 0x5DEB, 0x5DF2, 0x5DF5,
+ 0x5E0B, 0x5E1A, 0x5E19, 0x5E11, 0x5E1B, 0x5E36, 0x5E37, 0x5E44,
+ 0x5E43, 0x5E40, 0x5E4E, 0x5E57, 0x5E54, 0x5E5F, 0x5E62, 0x5E64,
+ 0x5E47, 0x5E75, 0x5E76, 0x5E7A, 0x9EBC, 0x5E7F, 0x5EA0, 0x5EC1,
+ 0x5EC2, 0x5EC8, 0x5ED0, 0x5ECF, 0x5ED6, 0x5EE3, 0x5EDD, 0x5EDA,
+ 0x5EDB, 0x5EE2, 0x5EE1, 0x5EE8, 0x5EE9, 0x5EEC, 0x5EF1, 0x5EF3,
+ 0x5EF0, 0x5EF4, 0x5EF8, 0x5EFE, 0x5F03, 0x5F09, 0x5F5D, 0x5F5C,
+ 0x5F0B, 0x5F11, 0x5F16, 0x5F29, 0x5F2D, 0x5F38, 0x5F41, 0x5F48,
+ 0x5F4C, 0x5F4E, 0x5F2F, 0x5F51, 0x5F56, 0x5F57, 0x5F59, 0x5F61,
+ 0x5F6D, 0x5F73, 0x5F77, 0x5F83, 0x5F82, 0x5F7F, 0x5F8A, 0x5F88,
+ 0x5F91, 0x5F87, 0x5F9E, 0x5F99, 0x5F98, 0x5FA0, 0x5FA8, 0x5FAD,
+ 0x5FBC, 0x5FD6, 0x5FFB, 0x5FE4, 0x5FF8, 0x5FF1, 0x5FDD, 0x60B3,
+ 0x5FFF, 0x6021, 0x6060, 0x6019, 0x6010, 0x6029, 0x600E, 0x6031,
+ 0x601B, 0x6015, 0x602B, 0x6026, 0x600F, 0x603A, 0x605A, 0x6041,
+ 0x606A, 0x6077, 0x605F, 0x604A, 0x6046, 0x604D, 0x6063, 0x6043,
+ 0x6064, 0x6042, 0x606C, 0x606B, 0x6059, 0x6081, 0x608D, 0x60E7,
+ 0x6083, 0x609A, 0x6084, 0x609B, 0x6096, 0x6097, 0x6092, 0x60A7,
+ 0x608B, 0x60E1, 0x60B8, 0x60E0, 0x60D3, 0x60B4, 0x5FF0, 0x60BD,
+ 0x60C6, 0x60B5, 0x60D8, 0x614D, 0x6115, 0x6106, 0x60F6, 0x60F7,
+ 0x6100, 0x60F4, 0x60FA, 0x6103, 0x6121, 0x60FB, 0x60F1, 0x610D,
+ 0x610E, 0x6147, 0x613E, 0x6128, 0x6127, 0x614A, 0x613F, 0x613C,
+ 0x612C, 0x6134, 0x613D, 0x6142, 0x6144, 0x6173, 0x6177, 0x6158,
+ 0x6159, 0x615A, 0x616B, 0x6174, 0x616F, 0x6165, 0x6171, 0x615F,
+ 0x615D, 0x6153, 0x6175, 0x6199, 0x6196, 0x6187, 0x61AC, 0x6194,
+ 0x619A, 0x618A, 0x6191, 0x61AB, 0x61AE, 0x61CC, 0x61CA, 0x61C9,
+ 0x61F7, 0x61C8, 0x61C3, 0x61C6, 0x61BA, 0x61CB, 0x7F79, 0x61CD,
+ 0x61E6, 0x61E3, 0x61F6, 0x61FA, 0x61F4, 0x61FF, 0x61FD, 0x61FC,
+ 0x61FE, 0x6200, 0x6208, 0x6209, 0x620D, 0x620C, 0x6214, 0x621B,
+ 0x621E, 0x6221, 0x622A, 0x622E, 0x6230, 0x6232, 0x6233, 0x6241,
+ 0x624E, 0x625E, 0x6263, 0x625B, 0x6260, 0x6268, 0x627C, 0x6282,
+ 0x6289, 0x627E, 0x6292, 0x6293, 0x6296, 0x62D4, 0x6283, 0x6294,
+ 0x62D7, 0x62D1, 0x62BB, 0x62CF, 0x62FF, 0x62C6, 0x64D4, 0x62C8,
+ 0x62DC, 0x62CC, 0x62CA, 0x62C2, 0x62C7, 0x629B, 0x62C9, 0x630C,
+ 0x62EE, 0x62F1, 0x6327, 0x6302, 0x6308, 0x62EF, 0x62F5, 0x6350,
+ 0x633E, 0x634D, 0x641C, 0x634F, 0x6396, 0x638E, 0x6380, 0x63AB,
+ 0x6376, 0x63A3, 0x638F, 0x6389, 0x639F, 0x63B5, 0x636B, 0x6369,
+ 0x63BE, 0x63E9, 0x63C0, 0x63C6, 0x63E3, 0x63C9, 0x63D2, 0x63F6,
+ 0x63C4, 0x6416, 0x6434, 0x6406, 0x6413, 0x6426, 0x6436, 0x651D,
+ 0x6417, 0x6428, 0x640F, 0x6467, 0x646F, 0x6476, 0x644E, 0x652A,
+ 0x6495, 0x6493, 0x64A5, 0x64A9, 0x6488, 0x64BC, 0x64DA, 0x64D2,
+ 0x64C5, 0x64C7, 0x64BB, 0x64D8, 0x64C2, 0x64F1, 0x64E7, 0x8209,
+ 0x64E0, 0x64E1, 0x62AC, 0x64E3, 0x64EF, 0x652C, 0x64F6, 0x64F4,
+ 0x64F2, 0x64FA, 0x6500, 0x64FD, 0x6518, 0x651C, 0x6505, 0x6524,
+ 0x6523, 0x652B, 0x6534, 0x6535, 0x6537, 0x6536, 0x6538, 0x754B,
+ 0x6548, 0x6556, 0x6555, 0x654D, 0x6558, 0x655E, 0x655D, 0x6572,
+ 0x6578, 0x6582, 0x6583, 0x8B8A, 0x659B, 0x659F, 0x65AB, 0x65B7,
+ 0x65C3, 0x65C6, 0x65C1, 0x65C4, 0x65CC, 0x65D2, 0x65DB, 0x65D9,
+ 0x65E0, 0x65E1, 0x65F1, 0x6772, 0x660A, 0x6603, 0x65FB, 0x6773,
+ 0x6635, 0x6636, 0x6634, 0x661C, 0x664F, 0x6644, 0x6649, 0x6641,
+ 0x665E, 0x665D, 0x6664, 0x6667, 0x6668, 0x665F, 0x6662, 0x6670,
+ 0x6683, 0x6688, 0x668E, 0x6689, 0x6684, 0x6698, 0x669D, 0x66C1,
+ 0x66B9, 0x66C9, 0x66BE, 0x66BC, 0x66C4, 0x66B8, 0x66D6, 0x66DA,
+ 0x66E0, 0x663F, 0x66E6, 0x66E9, 0x66F0, 0x66F5, 0x66F7, 0x670F,
+ 0x6716, 0x671E, 0x6726, 0x6727, 0x9738, 0x672E, 0x673F, 0x6736,
+ 0x6741, 0x6738, 0x6737, 0x6746, 0x675E, 0x6760, 0x6759, 0x6763,
+ 0x6764, 0x6789, 0x6770, 0x67A9, 0x677C, 0x676A, 0x678C, 0x678B,
+ 0x67A6, 0x67A1, 0x6785, 0x67B7, 0x67EF, 0x67B4, 0x67EC, 0x67B3,
+ 0x67E9, 0x67B8, 0x67E4, 0x67DE, 0x67DD, 0x67E2, 0x67EE, 0x67B9,
+ 0x67CE, 0x67C6, 0x67E7, 0x6A9C, 0x681E, 0x6846, 0x6829, 0x6840,
+ 0x684D, 0x6832, 0x684E, 0x68B3, 0x682B, 0x6859, 0x6863, 0x6877,
+ 0x687F, 0x689F, 0x688F, 0x68AD, 0x6894, 0x689D, 0x689B, 0x6883,
+ 0x6AAE, 0x68B9, 0x6874, 0x68B5, 0x68A0, 0x68BA, 0x690F, 0x688D,
+ 0x687E, 0x6901, 0x68CA, 0x6908, 0x68D8, 0x6922, 0x6926, 0x68E1,
+ 0x690C, 0x68CD, 0x68D4, 0x68E7, 0x68D5, 0x6936, 0x6912, 0x6904,
+ 0x68D7, 0x68E3, 0x6925, 0x68F9, 0x68E0, 0x68EF, 0x6928, 0x692A,
+ 0x691A, 0x6923, 0x6921, 0x68C6, 0x6979, 0x6977, 0x695C, 0x6978,
+ 0x696B, 0x6954, 0x697E, 0x696E, 0x6939, 0x6974, 0x693D, 0x6959,
+ 0x6930, 0x6961, 0x695E, 0x695D, 0x6981, 0x696A, 0x69B2, 0x69AE,
+ 0x69D0, 0x69BF, 0x69C1, 0x69D3, 0x69BE, 0x69CE, 0x5BE8, 0x69CA,
+ 0x69DD, 0x69BB, 0x69C3, 0x69A7, 0x6A2E, 0x6991, 0x69A0, 0x699C,
+ 0x6995, 0x69B4, 0x69DE, 0x69E8, 0x6A02, 0x6A1B, 0x69FF, 0x6B0A,
+ 0x69F9, 0x69F2, 0x69E7, 0x6A05, 0x69B1, 0x6A1E, 0x69ED, 0x6A14,
+ 0x69EB, 0x6A0A, 0x6A12, 0x6AC1, 0x6A23, 0x6A13, 0x6A44, 0x6A0C,
+ 0x6A72, 0x6A36, 0x6A78, 0x6A47, 0x6A62, 0x6A59, 0x6A66, 0x6A48,
+ 0x6A38, 0x6A22, 0x6A90, 0x6A8D, 0x6AA0, 0x6A84, 0x6AA2, 0x6AA3,
+ 0x6A97, 0x8617, 0x6ABB, 0x6AC3, 0x6AC2, 0x6AB8, 0x6AB3, 0x6AAC,
+ 0x6ADE, 0x6AD1, 0x6ADF, 0x6AAA, 0x6ADA, 0x6AEA, 0x6AFB, 0x6B05,
+ 0x8616, 0x6AFA, 0x6B12, 0x6B16, 0x9B31, 0x6B1F, 0x6B38, 0x6B37,
+ 0x76DC, 0x6B39, 0x98EE, 0x6B47, 0x6B43, 0x6B49, 0x6B50, 0x6B59,
+ 0x6B54, 0x6B5B, 0x6B5F, 0x6B61, 0x6B78, 0x6B79, 0x6B7F, 0x6B80,
+ 0x6B84, 0x6B83, 0x6B8D, 0x6B98, 0x6B95, 0x6B9E, 0x6BA4, 0x6BAA,
+ 0x6BAB, 0x6BAF, 0x6BB2, 0x6BB1, 0x6BB3, 0x6BB7, 0x6BBC, 0x6BC6,
+ 0x6BCB, 0x6BD3, 0x6BDF, 0x6BEC, 0x6BEB, 0x6BF3, 0x6BEF, 0x9EBE,
+ 0x6C08, 0x6C13, 0x6C14, 0x6C1B, 0x6C24, 0x6C23, 0x6C5E, 0x6C55,
+ 0x6C62, 0x6C6A, 0x6C82, 0x6C8D, 0x6C9A, 0x6C81, 0x6C9B, 0x6C7E,
+ 0x6C68, 0x6C73, 0x6C92, 0x6C90, 0x6CC4, 0x6CF1, 0x6CD3, 0x6CBD,
+ 0x6CD7, 0x6CC5, 0x6CDD, 0x6CAE, 0x6CB1, 0x6CBE, 0x6CBA, 0x6CDB,
+ 0x6CEF, 0x6CD9, 0x6CEA, 0x6D1F, 0x884D, 0x6D36, 0x6D2B, 0x6D3D,
+ 0x6D38, 0x6D19, 0x6D35, 0x6D33, 0x6D12, 0x6D0C, 0x6D63, 0x6D93,
+ 0x6D64, 0x6D5A, 0x6D79, 0x6D59, 0x6D8E, 0x6D95, 0x6FE4, 0x6D85,
+ 0x6DF9, 0x6E15, 0x6E0A, 0x6DB5, 0x6DC7, 0x6DE6, 0x6DB8, 0x6DC6,
+ 0x6DEC, 0x6DDE, 0x6DCC, 0x6DE8, 0x6DD2, 0x6DC5, 0x6DFA, 0x6DD9,
+ 0x6DE4, 0x6DD5, 0x6DEA, 0x6DEE, 0x6E2D, 0x6E6E, 0x6E2E, 0x6E19,
+ 0x6E72, 0x6E5F, 0x6E3E, 0x6E23, 0x6E6B, 0x6E2B, 0x6E76, 0x6E4D,
+ 0x6E1F, 0x6E43, 0x6E3A, 0x6E4E, 0x6E24, 0x6EFF, 0x6E1D, 0x6E38,
+ 0x6E82, 0x6EAA, 0x6E98, 0x6EC9, 0x6EB7, 0x6ED3, 0x6EBD, 0x6EAF,
+ 0x6EC4, 0x6EB2, 0x6ED4, 0x6ED5, 0x6E8F, 0x6EA5, 0x6EC2, 0x6E9F,
+ 0x6F41, 0x6F11, 0x704C, 0x6EEC, 0x6EF8, 0x6EFE, 0x6F3F, 0x6EF2,
+ 0x6F31, 0x6EEF, 0x6F32, 0x6ECC, 0x6F3E, 0x6F13, 0x6EF7, 0x6F86,
+ 0x6F7A, 0x6F78, 0x6F81, 0x6F80, 0x6F6F, 0x6F5B, 0x6FF3, 0x6F6D,
+ 0x6F82, 0x6F7C, 0x6F58, 0x6F8E, 0x6F91, 0x6FC2, 0x6F66, 0x6FB3,
+ 0x6FA3, 0x6FA1, 0x6FA4, 0x6FB9, 0x6FC6, 0x6FAA, 0x6FDF, 0x6FD5,
+ 0x6FEC, 0x6FD4, 0x6FD8, 0x6FF1, 0x6FEE, 0x6FDB, 0x7009, 0x700B,
+ 0x6FFA, 0x7011, 0x7001, 0x700F, 0x6FFE, 0x701B, 0x701A, 0x6F74,
+ 0x701D, 0x7018, 0x701F, 0x7030, 0x703E, 0x7032, 0x7051, 0x7063,
+ 0x7099, 0x7092, 0x70AF, 0x70F1, 0x70AC, 0x70B8, 0x70B3, 0x70AE,
+ 0x70DF, 0x70CB, 0x70DD, 0x70D9, 0x7109, 0x70FD, 0x711C, 0x7119,
+ 0x7165, 0x7155, 0x7188, 0x7166, 0x7162, 0x714C, 0x7156, 0x716C,
+ 0x718F, 0x71FB, 0x7184, 0x7195, 0x71A8, 0x71AC, 0x71D7, 0x71B9,
+ 0x71BE, 0x71D2, 0x71C9, 0x71D4, 0x71CE, 0x71E0, 0x71EC, 0x71E7,
+ 0x71F5, 0x71FC, 0x71F9, 0x71FF, 0x720D, 0x7210, 0x721B, 0x7228,
+ 0x722D, 0x722C, 0x7230, 0x7232, 0x723B, 0x723C, 0x723F, 0x7240,
+ 0x7246, 0x724B, 0x7258, 0x7274, 0x727E, 0x7282, 0x7281, 0x7287,
+ 0x7292, 0x7296, 0x72A2, 0x72A7, 0x72B9, 0x72B2, 0x72C3, 0x72C6,
+ 0x72C4, 0x72CE, 0x72D2, 0x72E2, 0x72E0, 0x72E1, 0x72F9, 0x72F7,
+ 0x500F, 0x7317, 0x730A, 0x731C, 0x7316, 0x731D, 0x7334, 0x732F,
+ 0x7329, 0x7325, 0x733E, 0x734E, 0x734F, 0x9ED8, 0x7357, 0x736A,
+ 0x7368, 0x7370, 0x7378, 0x7375, 0x737B, 0x737A, 0x73C8, 0x73B3,
+ 0x73CE, 0x73BB, 0x73C0, 0x73E5, 0x73EE, 0x73DE, 0x74A2, 0x7405,
+ 0x746F, 0x7425, 0x73F8, 0x7432, 0x743A, 0x7455, 0x743F, 0x745F,
+ 0x7459, 0x7441, 0x745C, 0x7469, 0x7470, 0x7463, 0x746A, 0x7476,
+ 0x747E, 0x748B, 0x749E, 0x74A7, 0x74CA, 0x74CF, 0x74D4, 0x73F1,
+ 0x74E0, 0x74E3, 0x74E7, 0x74E9, 0x74EE, 0x74F2, 0x74F0, 0x74F1,
+ 0x74F8, 0x74F7, 0x7504, 0x7503, 0x7505, 0x750C, 0x750E, 0x750D,
+ 0x7515, 0x7513, 0x751E, 0x7526, 0x752C, 0x753C, 0x7544, 0x754D,
+ 0x754A, 0x7549, 0x755B, 0x7546, 0x755A, 0x7569, 0x7564, 0x7567,
+ 0x756B, 0x756D, 0x7578, 0x7576, 0x7586, 0x7587, 0x7574, 0x758A,
+ 0x7589, 0x7582, 0x7594, 0x759A, 0x759D, 0x75A5, 0x75A3, 0x75C2,
+ 0x75B3, 0x75C3, 0x75B5, 0x75BD, 0x75B8, 0x75BC, 0x75B1, 0x75CD,
+ 0x75CA, 0x75D2, 0x75D9, 0x75E3, 0x75DE, 0x75FE, 0x75FF, 0x75FC,
+ 0x7601, 0x75F0, 0x75FA, 0x75F2, 0x75F3, 0x760B, 0x760D, 0x7609,
+ 0x761F, 0x7627, 0x7620, 0x7621, 0x7622, 0x7624, 0x7634, 0x7630,
+ 0x763B, 0x7647, 0x7648, 0x7646, 0x765C, 0x7658, 0x7661, 0x7662,
+ 0x7668, 0x7669, 0x766A, 0x7667, 0x766C, 0x7670, 0x7672, 0x7676,
+ 0x7678, 0x767C, 0x7680, 0x7683, 0x7688, 0x768B, 0x768E, 0x7696,
+ 0x7693, 0x7699, 0x769A, 0x76B0, 0x76B4, 0x76B8, 0x76B9, 0x76BA,
+ 0x76C2, 0x76CD, 0x76D6, 0x76D2, 0x76DE, 0x76E1, 0x76E5, 0x76E7,
+ 0x76EA, 0x862F, 0x76FB, 0x7708, 0x7707, 0x7704, 0x7729, 0x7724,
+ 0x771E, 0x7725, 0x7726, 0x771B, 0x7737, 0x7738, 0x7747, 0x775A,
+ 0x7768, 0x776B, 0x775B, 0x7765, 0x777F, 0x777E, 0x7779, 0x778E,
+ 0x778B, 0x7791, 0x77A0, 0x779E, 0x77B0, 0x77B6, 0x77B9, 0x77BF,
+ 0x77BC, 0x77BD, 0x77BB, 0x77C7, 0x77CD, 0x77D7, 0x77DA, 0x77DC,
+ 0x77E3, 0x77EE, 0x77FC, 0x780C, 0x7812, 0x7926, 0x7820, 0x792A,
+ 0x7845, 0x788E, 0x7874, 0x7886, 0x787C, 0x789A, 0x788C, 0x78A3,
+ 0x78B5, 0x78AA, 0x78AF, 0x78D1, 0x78C6, 0x78CB, 0x78D4, 0x78BE,
+ 0x78BC, 0x78C5, 0x78CA, 0x78EC, 0x78E7, 0x78DA, 0x78FD, 0x78F4,
+ 0x7907, 0x7912, 0x7911, 0x7919, 0x792C, 0x792B, 0x7940, 0x7960,
+ 0x7957, 0x795F, 0x795A, 0x7955, 0x7953, 0x797A, 0x797F, 0x798A,
+ 0x799D, 0x79A7, 0x9F4B, 0x79AA, 0x79AE, 0x79B3, 0x79B9, 0x79BA,
+ 0x79C9, 0x79D5, 0x79E7, 0x79EC, 0x79E1, 0x79E3, 0x7A08, 0x7A0D,
+ 0x7A18, 0x7A19, 0x7A20, 0x7A1F, 0x7980, 0x7A31, 0x7A3B, 0x7A3E,
+ 0x7A37, 0x7A43, 0x7A57, 0x7A49, 0x7A61, 0x7A62, 0x7A69, 0x9F9D,
+ 0x7A70, 0x7A79, 0x7A7D, 0x7A88, 0x7A97, 0x7A95, 0x7A98, 0x7A96,
+ 0x7AA9, 0x7AC8, 0x7AB0, 0x7AB6, 0x7AC5, 0x7AC4, 0x7ABF, 0x9083,
+ 0x7AC7, 0x7ACA, 0x7ACD, 0x7ACF, 0x7AD5, 0x7AD3, 0x7AD9, 0x7ADA,
+ 0x7ADD, 0x7AE1, 0x7AE2, 0x7AE6, 0x7AED, 0x7AF0, 0x7B02, 0x7B0F,
+ 0x7B0A, 0x7B06, 0x7B33, 0x7B18, 0x7B19, 0x7B1E, 0x7B35, 0x7B28,
+ 0x7B36, 0x7B50, 0x7B7A, 0x7B04, 0x7B4D, 0x7B0B, 0x7B4C, 0x7B45,
+ 0x7B75, 0x7B65, 0x7B74, 0x7B67, 0x7B70, 0x7B71, 0x7B6C, 0x7B6E,
+ 0x7B9D, 0x7B98, 0x7B9F, 0x7B8D, 0x7B9C, 0x7B9A, 0x7B8B, 0x7B92,
+ 0x7B8F, 0x7B5D, 0x7B99, 0x7BCB, 0x7BC1, 0x7BCC, 0x7BCF, 0x7BB4,
+ 0x7BC6, 0x7BDD, 0x7BE9, 0x7C11, 0x7C14, 0x7BE6, 0x7BE5, 0x7C60,
+ 0x7C00, 0x7C07, 0x7C13, 0x7BF3, 0x7BF7, 0x7C17, 0x7C0D, 0x7BF6,
+ 0x7C23, 0x7C27, 0x7C2A, 0x7C1F, 0x7C37, 0x7C2B, 0x7C3D, 0x7C4C,
+ 0x7C43, 0x7C54, 0x7C4F, 0x7C40, 0x7C50, 0x7C58, 0x7C5F, 0x7C64,
+ 0x7C56, 0x7C65, 0x7C6C, 0x7C75, 0x7C83, 0x7C90, 0x7CA4, 0x7CAD,
+ 0x7CA2, 0x7CAB, 0x7CA1, 0x7CA8, 0x7CB3, 0x7CB2, 0x7CB1, 0x7CAE,
+ 0x7CB9, 0x7CBD, 0x7CC0, 0x7CC5, 0x7CC2, 0x7CD8, 0x7CD2, 0x7CDC,
+ 0x7CE2, 0x9B3B, 0x7CEF, 0x7CF2, 0x7CF4, 0x7CF6, 0x7CFA, 0x7D06,
+ 0x7D02, 0x7D1C, 0x7D15, 0x7D0A, 0x7D45, 0x7D4B, 0x7D2E, 0x7D32,
+ 0x7D3F, 0x7D35, 0x7D46, 0x7D73, 0x7D56, 0x7D4E, 0x7D72, 0x7D68,
+ 0x7D6E, 0x7D4F, 0x7D63, 0x7D93, 0x7D89, 0x7D5B, 0x7D8F, 0x7D7D,
+ 0x7D9B, 0x7DBA, 0x7DAE, 0x7DA3, 0x7DB5, 0x7DC7, 0x7DBD, 0x7DAB,
+ 0x7E3D, 0x7DA2, 0x7DAF, 0x7DDC, 0x7DB8, 0x7D9F, 0x7DB0, 0x7DD8,
+ 0x7DDD, 0x7DE4, 0x7DDE, 0x7DFB, 0x7DF2, 0x7DE1, 0x7E05, 0x7E0A,
+ 0x7E23, 0x7E21, 0x7E12, 0x7E31, 0x7E1F, 0x7E09, 0x7E0B, 0x7E22,
+ 0x7E46, 0x7E66, 0x7E3B, 0x7E35, 0x7E39, 0x7E43, 0x7E37, 0x7E32,
+ 0x7E3A, 0x7E67, 0x7E5D, 0x7E56, 0x7E5E, 0x7E59, 0x7E5A, 0x7E79,
+ 0x7E6A, 0x7E69, 0x7E7C, 0x7E7B, 0x7E83, 0x7DD5, 0x7E7D, 0x8FAE,
+ 0x7E7F, 0x7E88, 0x7E89, 0x7E8C, 0x7E92, 0x7E90, 0x7E93, 0x7E94,
+ 0x7E96, 0x7E8E, 0x7E9B, 0x7E9C, 0x7F38, 0x7F3A, 0x7F45, 0x7F4C,
+ 0x7F4D, 0x7F4E, 0x7F50, 0x7F51, 0x7F55, 0x7F54, 0x7F58, 0x7F5F,
+ 0x7F60, 0x7F68, 0x7F69, 0x7F67, 0x7F78, 0x7F82, 0x7F86, 0x7F83,
+ 0x7F88, 0x7F87, 0x7F8C, 0x7F94, 0x7F9E, 0x7F9D, 0x7F9A, 0x7FA3,
+ 0x7FAF, 0x7FB2, 0x7FB9, 0x7FAE, 0x7FB6, 0x7FB8, 0x8B71, 0x7FC5,
+ 0x7FC6, 0x7FCA, 0x7FD5, 0x7FD4, 0x7FE1, 0x7FE6, 0x7FE9, 0x7FF3,
+ 0x7FF9, 0x98DC, 0x8006, 0x8004, 0x800B, 0x8012, 0x8018, 0x8019,
+ 0x801C, 0x8021, 0x8028, 0x803F, 0x803B, 0x804A, 0x8046, 0x8052,
+ 0x8058, 0x805A, 0x805F, 0x8062, 0x8068, 0x8073, 0x8072, 0x8070,
+ 0x8076, 0x8079, 0x807D, 0x807F, 0x8084, 0x8086, 0x8085, 0x809B,
+ 0x8093, 0x809A, 0x80AD, 0x5190, 0x80AC, 0x80DB, 0x80E5, 0x80D9,
+ 0x80DD, 0x80C4, 0x80DA, 0x80D6, 0x8109, 0x80EF, 0x80F1, 0x811B,
+ 0x8129, 0x8123, 0x812F, 0x814B, 0x968B, 0x8146, 0x813E, 0x8153,
+ 0x8151, 0x80FC, 0x8171, 0x816E, 0x8165, 0x8166, 0x8174, 0x8183,
+ 0x8188, 0x818A, 0x8180, 0x8182, 0x81A0, 0x8195, 0x81A4, 0x81A3,
+ 0x815F, 0x8193, 0x81A9, 0x81B0, 0x81B5, 0x81BE, 0x81B8, 0x81BD,
+ 0x81C0, 0x81C2, 0x81BA, 0x81C9, 0x81CD, 0x81D1, 0x81D9, 0x81D8,
+ 0x81C8, 0x81DA, 0x81DF, 0x81E0, 0x81E7, 0x81FA, 0x81FB, 0x81FE,
+ 0x8201, 0x8202, 0x8205, 0x8207, 0x820A, 0x820D, 0x8210, 0x8216,
+ 0x8229, 0x822B, 0x8238, 0x8233, 0x8240, 0x8259, 0x8258, 0x825D,
+ 0x825A, 0x825F, 0x8264, 0x8262, 0x8268, 0x826A, 0x826B, 0x822E,
+ 0x8271, 0x8277, 0x8278, 0x827E, 0x828D, 0x8292, 0x82AB, 0x829F,
+ 0x82BB, 0x82AC, 0x82E1, 0x82E3, 0x82DF, 0x82D2, 0x82F4, 0x82F3,
+ 0x82FA, 0x8393, 0x8303, 0x82FB, 0x82F9, 0x82DE, 0x8306, 0x82DC,
+ 0x8309, 0x82D9, 0x8335, 0x8334, 0x8316, 0x8332, 0x8331, 0x8340,
+ 0x8339, 0x8350, 0x8345, 0x832F, 0x832B, 0x8317, 0x8318, 0x8385,
+ 0x839A, 0x83AA, 0x839F, 0x83A2, 0x8396, 0x8323, 0x838E, 0x8387,
+ 0x838A, 0x837C, 0x83B5, 0x8373, 0x8375, 0x83A0, 0x8389, 0x83A8,
+ 0x83F4, 0x8413, 0x83EB, 0x83CE, 0x83FD, 0x8403, 0x83D8, 0x840B,
+ 0x83C1, 0x83F7, 0x8407, 0x83E0, 0x83F2, 0x840D, 0x8422, 0x8420,
+ 0x83BD, 0x8438, 0x8506, 0x83FB, 0x846D, 0x842A, 0x843C, 0x855A,
+ 0x8484, 0x8477, 0x846B, 0x84AD, 0x846E, 0x8482, 0x8469, 0x8446,
+ 0x842C, 0x846F, 0x8479, 0x8435, 0x84CA, 0x8462, 0x84B9, 0x84BF,
+ 0x849F, 0x84D9, 0x84CD, 0x84BB, 0x84DA, 0x84D0, 0x84C1, 0x84C6,
+ 0x84D6, 0x84A1, 0x8521, 0x84FF, 0x84F4, 0x8517, 0x8518, 0x852C,
+ 0x851F, 0x8515, 0x8514, 0x84FC, 0x8540, 0x8563, 0x8558, 0x8548,
+ 0x8541, 0x8602, 0x854B, 0x8555, 0x8580, 0x85A4, 0x8588, 0x8591,
+ 0x858A, 0x85A8, 0x856D, 0x8594, 0x859B, 0x85EA, 0x8587, 0x859C,
+ 0x8577, 0x857E, 0x8590, 0x85C9, 0x85BA, 0x85CF, 0x85B9, 0x85D0,
+ 0x85D5, 0x85DD, 0x85E5, 0x85DC, 0x85F9, 0x860A, 0x8613, 0x860B,
+ 0x85FE, 0x85FA, 0x8606, 0x8622, 0x861A, 0x8630, 0x863F, 0x864D,
+ 0x4E55, 0x8654, 0x865F, 0x8667, 0x8671, 0x8693, 0x86A3, 0x86A9,
+ 0x86AA, 0x868B, 0x868C, 0x86B6, 0x86AF, 0x86C4, 0x86C6, 0x86B0,
+ 0x86C9, 0x8823, 0x86AB, 0x86D4, 0x86DE, 0x86E9, 0x86EC, 0x86DF,
+ 0x86DB, 0x86EF, 0x8712, 0x8706, 0x8708, 0x8700, 0x8703, 0x86FB,
+ 0x8711, 0x8709, 0x870D, 0x86F9, 0x870A, 0x8734, 0x873F, 0x8737,
+ 0x873B, 0x8725, 0x8729, 0x871A, 0x8760, 0x875F, 0x8778, 0x874C,
+ 0x874E, 0x8774, 0x8757, 0x8768, 0x876E, 0x8759, 0x8753, 0x8763,
+ 0x876A, 0x8805, 0x87A2, 0x879F, 0x8782, 0x87AF, 0x87CB, 0x87BD,
+ 0x87C0, 0x87D0, 0x96D6, 0x87AB, 0x87C4, 0x87B3, 0x87C7, 0x87C6,
+ 0x87BB, 0x87EF, 0x87F2, 0x87E0, 0x880F, 0x880D, 0x87FE, 0x87F6,
+ 0x87F7, 0x880E, 0x87D2, 0x8811, 0x8816, 0x8815, 0x8822, 0x8821,
+ 0x8831, 0x8836, 0x8839, 0x8827, 0x883B, 0x8844, 0x8842, 0x8852,
+ 0x8859, 0x885E, 0x8862, 0x886B, 0x8881, 0x887E, 0x889E, 0x8875,
+ 0x887D, 0x88B5, 0x8872, 0x8882, 0x8897, 0x8892, 0x88AE, 0x8899,
+ 0x88A2, 0x888D, 0x88A4, 0x88B0, 0x88BF, 0x88B1, 0x88C3, 0x88C4,
+ 0x88D4, 0x88D8, 0x88D9, 0x88DD, 0x88F9, 0x8902, 0x88FC, 0x88F4,
+ 0x88E8, 0x88F2, 0x8904, 0x890C, 0x890A, 0x8913, 0x8943, 0x891E,
+ 0x8925, 0x892A, 0x892B, 0x8941, 0x8944, 0x893B, 0x8936, 0x8938,
+ 0x894C, 0x891D, 0x8960, 0x895E, 0x8966, 0x8964, 0x896D, 0x896A,
+ 0x896F, 0x8974, 0x8977, 0x897E, 0x8983, 0x8988, 0x898A, 0x8993,
+ 0x8998, 0x89A1, 0x89A9, 0x89A6, 0x89AC, 0x89AF, 0x89B2, 0x89BA,
+ 0x89BD, 0x89BF, 0x89C0, 0x89DA, 0x89DC, 0x89DD, 0x89E7, 0x89F4,
+ 0x89F8, 0x8A03, 0x8A16, 0x8A10, 0x8A0C, 0x8A1B, 0x8A1D, 0x8A25,
+ 0x8A36, 0x8A41, 0x8A5B, 0x8A52, 0x8A46, 0x8A48, 0x8A7C, 0x8A6D,
+ 0x8A6C, 0x8A62, 0x8A85, 0x8A82, 0x8A84, 0x8AA8, 0x8AA1, 0x8A91,
+ 0x8AA5, 0x8AA6, 0x8A9A, 0x8AA3, 0x8AC4, 0x8ACD, 0x8AC2, 0x8ADA,
+ 0x8AEB, 0x8AF3, 0x8AE7, 0x8AE4, 0x8AF1, 0x8B14, 0x8AE0, 0x8AE2,
+ 0x8AF7, 0x8ADE, 0x8ADB, 0x8B0C, 0x8B07, 0x8B1A, 0x8AE1, 0x8B16,
+ 0x8B10, 0x8B17, 0x8B20, 0x8B33, 0x97AB, 0x8B26, 0x8B2B, 0x8B3E,
+ 0x8B28, 0x8B41, 0x8B4C, 0x8B4F, 0x8B4E, 0x8B49, 0x8B56, 0x8B5B,
+ 0x8B5A, 0x8B6B, 0x8B5F, 0x8B6C, 0x8B6F, 0x8B74, 0x8B7D, 0x8B80,
+ 0x8B8C, 0x8B8E, 0x8B92, 0x8B93, 0x8B96, 0x8B99, 0x8B9A, 0x8C3A,
+ 0x8C41, 0x8C3F, 0x8C48, 0x8C4C, 0x8C4E, 0x8C50, 0x8C55, 0x8C62,
+ 0x8C6C, 0x8C78, 0x8C7A, 0x8C82, 0x8C89, 0x8C85, 0x8C8A, 0x8C8D,
+ 0x8C8E, 0x8C94, 0x8C7C, 0x8C98, 0x621D, 0x8CAD, 0x8CAA, 0x8CBD,
+ 0x8CB2, 0x8CB3, 0x8CAE, 0x8CB6, 0x8CC8, 0x8CC1, 0x8CE4, 0x8CE3,
+ 0x8CDA, 0x8CFD, 0x8CFA, 0x8CFB, 0x8D04, 0x8D05, 0x8D0A, 0x8D07,
+ 0x8D0F, 0x8D0D, 0x8D10, 0x9F4E, 0x8D13, 0x8CCD, 0x8D14, 0x8D16,
+ 0x8D67, 0x8D6D, 0x8D71, 0x8D73, 0x8D81, 0x8D99, 0x8DC2, 0x8DBE,
+ 0x8DBA, 0x8DCF, 0x8DDA, 0x8DD6, 0x8DCC, 0x8DDB, 0x8DCB, 0x8DEA,
+ 0x8DEB, 0x8DDF, 0x8DE3, 0x8DFC, 0x8E08, 0x8E09, 0x8DFF, 0x8E1D,
+ 0x8E1E, 0x8E10, 0x8E1F, 0x8E42, 0x8E35, 0x8E30, 0x8E34, 0x8E4A,
+ 0x8E47, 0x8E49, 0x8E4C, 0x8E50, 0x8E48, 0x8E59, 0x8E64, 0x8E60,
+ 0x8E2A, 0x8E63, 0x8E55, 0x8E76, 0x8E72, 0x8E7C, 0x8E81, 0x8E87,
+ 0x8E85, 0x8E84, 0x8E8B, 0x8E8A, 0x8E93, 0x8E91, 0x8E94, 0x8E99,
+ 0x8EAA, 0x8EA1, 0x8EAC, 0x8EB0, 0x8EC6, 0x8EB1, 0x8EBE, 0x8EC5,
+ 0x8EC8, 0x8ECB, 0x8EDB, 0x8EE3, 0x8EFC, 0x8EFB, 0x8EEB, 0x8EFE,
+ 0x8F0A, 0x8F05, 0x8F15, 0x8F12, 0x8F19, 0x8F13, 0x8F1C, 0x8F1F,
+ 0x8F1B, 0x8F0C, 0x8F26, 0x8F33, 0x8F3B, 0x8F39, 0x8F45, 0x8F42,
+ 0x8F3E, 0x8F4C, 0x8F49, 0x8F46, 0x8F4E, 0x8F57, 0x8F5C, 0x8F62,
+ 0x8F63, 0x8F64, 0x8F9C, 0x8F9F, 0x8FA3, 0x8FAD, 0x8FAF, 0x8FB7,
+ 0x8FDA, 0x8FE5, 0x8FE2, 0x8FEA, 0x8FEF, 0x9087, 0x8FF4, 0x9005,
+ 0x8FF9, 0x8FFA, 0x9011, 0x9015, 0x9021, 0x900D, 0x901E, 0x9016,
+ 0x900B, 0x9027, 0x9036, 0x9035, 0x9039, 0x8FF8, 0x904F, 0x9050,
+ 0x9051, 0x9052, 0x900E, 0x9049, 0x903E, 0x9056, 0x9058, 0x905E,
+ 0x9068, 0x906F, 0x9076, 0x96A8, 0x9072, 0x9082, 0x907D, 0x9081,
+ 0x9080, 0x908A, 0x9089, 0x908F, 0x90A8, 0x90AF, 0x90B1, 0x90B5,
+ 0x90E2, 0x90E4, 0x6248, 0x90DB, 0x9102, 0x9112, 0x9119, 0x9132,
+ 0x9130, 0x914A, 0x9156, 0x9158, 0x9163, 0x9165, 0x9169, 0x9173,
+ 0x9172, 0x918B, 0x9189, 0x9182, 0x91A2, 0x91AB, 0x91AF, 0x91AA,
+ 0x91B5, 0x91B4, 0x91BA, 0x91C0, 0x91C1, 0x91C9, 0x91CB, 0x91D0,
+ 0x91D6, 0x91DF, 0x91E1, 0x91DB, 0x91FC, 0x91F5, 0x91F6, 0x921E,
+ 0x91FF, 0x9214, 0x922C, 0x9215, 0x9211, 0x925E, 0x9257, 0x9245,
+ 0x9249, 0x9264, 0x9248, 0x9295, 0x923F, 0x924B, 0x9250, 0x929C,
+ 0x9296, 0x9293, 0x929B, 0x925A, 0x92CF, 0x92B9, 0x92B7, 0x92E9,
+ 0x930F, 0x92FA, 0x9344, 0x932E, 0x9319, 0x9322, 0x931A, 0x9323,
+ 0x933A, 0x9335, 0x933B, 0x935C, 0x9360, 0x937C, 0x936E, 0x9356,
+ 0x93B0, 0x93AC, 0x93AD, 0x9394, 0x93B9, 0x93D6, 0x93D7, 0x93E8,
+ 0x93E5, 0x93D8, 0x93C3, 0x93DD, 0x93D0, 0x93C8, 0x93E4, 0x941A,
+ 0x9414, 0x9413, 0x9403, 0x9407, 0x9410, 0x9436, 0x942B, 0x9435,
+ 0x9421, 0x943A, 0x9441, 0x9452, 0x9444, 0x945B, 0x9460, 0x9462,
+ 0x945E, 0x946A, 0x9229, 0x9470, 0x9475, 0x9477, 0x947D, 0x945A,
+ 0x947C, 0x947E, 0x9481, 0x947F, 0x9582, 0x9587, 0x958A, 0x9594,
+ 0x9596, 0x9598, 0x9599, 0x95A0, 0x95A8, 0x95A7, 0x95AD, 0x95BC,
+ 0x95BB, 0x95B9, 0x95BE, 0x95CA, 0x6FF6, 0x95C3, 0x95CD, 0x95CC,
+ 0x95D5, 0x95D4, 0x95D6, 0x95DC, 0x95E1, 0x95E5, 0x95E2, 0x9621,
+ 0x9628, 0x962E, 0x962F, 0x9642, 0x964C, 0x964F, 0x964B, 0x9677,
+ 0x965C, 0x965E, 0x965D, 0x965F, 0x9666, 0x9672, 0x966C, 0x968D,
+ 0x9698, 0x9695, 0x9697, 0x96AA, 0x96A7, 0x96B1, 0x96B2, 0x96B0,
+ 0x96B4, 0x96B6, 0x96B8, 0x96B9, 0x96CE, 0x96CB, 0x96C9, 0x96CD,
+ 0x894D, 0x96DC, 0x970D, 0x96D5, 0x96F9, 0x9704, 0x9706, 0x9708,
+ 0x9713, 0x970E, 0x9711, 0x970F, 0x9716, 0x9719, 0x9724, 0x972A,
+ 0x9730, 0x9739, 0x973D, 0x973E, 0x9744, 0x9746, 0x9748, 0x9742,
+ 0x9749, 0x975C, 0x9760, 0x9764, 0x9766, 0x9768, 0x52D2, 0x976B,
+ 0x9771, 0x9779, 0x9785, 0x977C, 0x9781, 0x977A, 0x9786, 0x978B,
+ 0x978F, 0x9790, 0x979C, 0x97A8, 0x97A6, 0x97A3, 0x97B3, 0x97B4,
+ 0x97C3, 0x97C6, 0x97C8, 0x97CB, 0x97DC, 0x97ED, 0x9F4F, 0x97F2,
+ 0x7ADF, 0x97F6, 0x97F5, 0x980F, 0x980C, 0x9838, 0x9824, 0x9821,
+ 0x9837, 0x983D, 0x9846, 0x984F, 0x984B, 0x986B, 0x986F, 0x9870,
+ 0x9871, 0x9874, 0x9873, 0x98AA, 0x98AF, 0x98B1, 0x98B6, 0x98C4,
+ 0x98C3, 0x98C6, 0x98E9, 0x98EB, 0x9903, 0x9909, 0x9912, 0x9914,
+ 0x9918, 0x9921, 0x991D, 0x991E, 0x9924, 0x9920, 0x992C, 0x992E,
+ 0x993D, 0x993E, 0x9942, 0x9949, 0x9945, 0x9950, 0x994B, 0x9951,
+ 0x9952, 0x994C, 0x9955, 0x9997, 0x9998, 0x99A5, 0x99AD, 0x99AE,
+ 0x99BC, 0x99DF, 0x99DB, 0x99DD, 0x99D8, 0x99D1, 0x99ED, 0x99EE,
+ 0x99F1, 0x99F2, 0x99FB, 0x99F8, 0x9A01, 0x9A0F, 0x9A05, 0x99E2,
+ 0x9A19, 0x9A2B, 0x9A37, 0x9A45, 0x9A42, 0x9A40, 0x9A43, 0x9A3E,
+ 0x9A55, 0x9A4D, 0x9A5B, 0x9A57, 0x9A5F, 0x9A62, 0x9A65, 0x9A64,
+ 0x9A69, 0x9A6B, 0x9A6A, 0x9AAD, 0x9AB0, 0x9ABC, 0x9AC0, 0x9ACF,
+ 0x9AD1, 0x9AD3, 0x9AD4, 0x9ADE, 0x9ADF, 0x9AE2, 0x9AE3, 0x9AE6,
+ 0x9AEF, 0x9AEB, 0x9AEE, 0x9AF4, 0x9AF1, 0x9AF7, 0x9AFB, 0x9B06,
+ 0x9B18, 0x9B1A, 0x9B1F, 0x9B22, 0x9B23, 0x9B25, 0x9B27, 0x9B28,
+ 0x9B29, 0x9B2A, 0x9B2E, 0x9B2F, 0x9B32, 0x9B44, 0x9B43, 0x9B4F,
+ 0x9B4D, 0x9B4E, 0x9B51, 0x9B58, 0x9B74, 0x9B93, 0x9B83, 0x9B91,
+ 0x9B96, 0x9B97, 0x9B9F, 0x9BA0, 0x9BA8, 0x9BB4, 0x9BC0, 0x9BCA,
+ 0x9BB9, 0x9BC6, 0x9BCF, 0x9BD1, 0x9BD2, 0x9BE3, 0x9BE2, 0x9BE4,
+ 0x9BD4, 0x9BE1, 0x9C3A, 0x9BF2, 0x9BF1, 0x9BF0, 0x9C15, 0x9C14,
+ 0x9C09, 0x9C13, 0x9C0C, 0x9C06, 0x9C08, 0x9C12, 0x9C0A, 0x9C04,
+ 0x9C2E, 0x9C1B, 0x9C25, 0x9C24, 0x9C21, 0x9C30, 0x9C47, 0x9C32,
+ 0x9C46, 0x9C3E, 0x9C5A, 0x9C60, 0x9C67, 0x9C76, 0x9C78, 0x9CE7,
+ 0x9CEC, 0x9CF0, 0x9D09, 0x9D08, 0x9CEB, 0x9D03, 0x9D06, 0x9D2A,
+ 0x9D26, 0x9DAF, 0x9D23, 0x9D1F, 0x9D44, 0x9D15, 0x9D12, 0x9D41,
+ 0x9D3F, 0x9D3E, 0x9D46, 0x9D48, 0x9D5D, 0x9D5E, 0x9D64, 0x9D51,
+ 0x9D50, 0x9D59, 0x9D72, 0x9D89, 0x9D87, 0x9DAB, 0x9D6F, 0x9D7A,
+ 0x9D9A, 0x9DA4, 0x9DA9, 0x9DB2, 0x9DC4, 0x9DC1, 0x9DBB, 0x9DB8,
+ 0x9DBA, 0x9DC6, 0x9DCF, 0x9DC2, 0x9DD9, 0x9DD3, 0x9DF8, 0x9DE6,
+ 0x9DED, 0x9DEF, 0x9DFD, 0x9E1A, 0x9E1B, 0x9E1E, 0x9E75, 0x9E79,
+ 0x9E7D, 0x9E81, 0x9E88, 0x9E8B, 0x9E8C, 0x9E92, 0x9E95, 0x9E91,
+ 0x9E9D, 0x9EA5, 0x9EA9, 0x9EB8, 0x9EAA, 0x9EAD, 0x9761, 0x9ECC,
+ 0x9ECE, 0x9ECF, 0x9ED0, 0x9ED4, 0x9EDC, 0x9EDE, 0x9EDD, 0x9EE0,
+ 0x9EE5, 0x9EE8, 0x9EEF, 0x9EF4, 0x9EF6, 0x9EF7, 0x9EF9, 0x9EFB,
+ 0x9EFC, 0x9EFD, 0x9F07, 0x9F08, 0x76B7, 0x9F15, 0x9F21, 0x9F2C,
+ 0x9F3E, 0x9F4A, 0x9F52, 0x9F54, 0x9F63, 0x9F5F, 0x9F60, 0x9F61,
+ 0x9F66, 0x9F67, 0x9F6C, 0x9F6A, 0x9F77, 0x9F72, 0x9F76, 0x9F95,
+ 0x9F9C, 0x9FA0, 0x582F, 0x69C7, 0x9059, 0x7464, 0x2642, 0x2500,
+ 0x2501, 0x2502, 0x2503, 0x2504, 0x2505, 0x2506, 0x2507, 0x2508,
+ 0x2509, 0x250A, 0x250B, 0x250C, 0x250D, 0x250E, 0x250F, 0x2510,
+ 0x2511, 0x2512, 0x2513, 0x2514, 0x2515, 0x2516, 0x2517, 0x2518,
+ 0x2519, 0x251A, 0x251B, 0x251C, 0x251D, 0x251E, 0x251F, 0x2520,
+ 0x2521, 0x2522, 0x2523, 0x2524, 0x2525, 0x2526, 0x2527, 0x2528,
+ 0x2529, 0x252A, 0x252B, 0x252C, 0x252D, 0x252E, 0x252F, 0x2530,
+ 0x2531, 0x2532, 0x2533, 0x2534, 0x2535, 0x2536, 0x2537, 0x2538,
+ 0x2539, 0x253A, 0x253B, 0x253C, 0x253D, 0x253E, 0x253F, 0x2540,
+ 0x2541, 0x2542, 0x2543, 0x2544, 0x2545, 0x2546, 0x2547, 0x2548,
+ 0x2549, 0x254A, 0x254B, 0x2460, 0x2461, 0x2462, 0x2463, 0x2464,
+ 0x2465, 0x2466, 0x2467, 0x2468, 0x2469, 0x246A, 0x246B, 0x246C,
+ 0x246D, 0x246E, 0x246F, 0x2470, 0x2471, 0x2472, 0x2473, 0x2160,
+ 0x2161, 0x2162, 0x2163, 0x2164, 0x2165, 0x2166, 0x2167, 0x2168,
+ 0x2169, 0x3349, 0x3314, 0x3322, 0x334D, 0x3318, 0x3327, 0x3303,
+ 0x3336, 0x3351, 0x3357, 0x330D, 0x3326, 0x3323, 0x332B, 0x334A,
+ 0x333B, 0x339C, 0x339D, 0x339E, 0x338E, 0x338F, 0x33C4, 0x33A1,
+ 0x301D, 0x301F, 0x2116, 0x33CD, 0x2121, 0x32A4, 0x32A5, 0x32A6,
+ 0x32A7, 0x32A8, 0x3231, 0x3232, 0x3239, 0x337E, 0x337D, 0x337C,
+ 0x222E, 0x2211, 0x221A, 0x22A5, 0x2220, 0x221F, 0x22BF, 0x2229,
+ 0x222A, 0x555E, 0x98F4, 0x6EA2, 0x9C2F, 0x6DEB, 0x8FC2, 0x6B1D,
+ 0x53A9, 0x958F, 0x5642, 0x990C, 0x7130, 0x8956, 0x9DD7, 0x8FE6,
+ 0x6062, 0x62D0, 0x6666, 0x559D, 0x845B, 0x9784, 0x5699, 0x6F97,
+ 0x7FF0, 0x7FEB, 0x5FBD, 0x7947, 0x4FE0, 0x537F, 0x50C5, 0x8EC0,
+ 0x55B0, 0x6ADB, 0x5C51, 0x9774, 0x7941, 0x6167, 0x7A3D, 0x7E6B,
+ 0x834A, 0x9699, 0x5026, 0x5ACC, 0x6372, 0x9E7C, 0x8AFA, 0x5DF7,
+ 0x663B, 0x6E9D, 0x9EB4, 0x9D60, 0x7511, 0x91C7, 0x698A, 0x6805,
+ 0x85A9, 0x9BD6, 0x9306, 0x73CA, 0x53F1, 0x5C62, 0x906E, 0x6753,
+ 0x707C, 0x7E61, 0x914B, 0x66D9, 0x6E1A, 0x85AF, 0x85F7, 0x54E8,
+ 0x5EE0, 0x68A2, 0x8523, 0x91AC, 0x9798, 0x8755, 0x9771, 0x9017,
+ 0x7FE0, 0x647A, 0x901D, 0x87EC, 0x64B0, 0x6813, 0x714E, 0x717D,
+ 0x8A6E, 0x564C, 0x9061, 0x5275, 0x6414, 0x7626, 0x905C, 0x9A52,
+ 0x817F, 0x9EDB, 0x5544, 0x6FEF, 0x7422, 0x86F8, 0x5DFD, 0x8FBF,
+ 0x68DA, 0x9C48, 0x6A3D, 0x7C1E, 0x8A3B, 0x7026, 0x51CB, 0x6357,
+ 0x69CC, 0x939A, 0x585A, 0x6451, 0x912D, 0x64E2, 0x6EBA, 0x5861,
+ 0x985A, 0x5835, 0x5C60, 0x83DF, 0x8CED, 0x5858, 0x79B1, 0x9D07,
+ 0x7006, 0x701E, 0x5678, 0x9041, 0x9813, 0x90A3, 0x8B0E, 0x7058,
+ 0x6962, 0x79B0, 0x56CA, 0x724C, 0x9019, 0x79E4, 0x525D, 0x7BB8,
+ 0x6F51, 0x91B1, 0x633D, 0x6249, 0x6A0B, 0x67CA, 0x7A17, 0x903C,
+ 0x5A9B, 0x8B2C, 0x5EDF, 0x7015, 0x983B, 0x853D, 0x77A5, 0x5A29,
+ 0x5E96, 0x6CE1, 0x84EC, 0x9830, 0x9C52, 0x9EB5, 0x5132, 0x9905,
+ 0x7C7E, 0x9453, 0x6108, 0x7652, 0x7337, 0x7194, 0x8000, 0x840A,
+ 0x907C, 0x6F23, 0x7149, 0x84EE, 0x6994, 0x881F, 0x5154, 0x5189,
+ 0x5195, 0x51A4, 0x5539, 0x5533, 0x55E4, 0x5632, 0x56A5, 0x580B,
+ 0x5ABE, 0x5BC3, 0x5C5B, 0x5E64, 0x6097, 0x6369, 0x6406, 0x6522,
+ 0x6583, 0x67A6, 0x67B4, 0x689B, 0x688E, 0x6E6E, 0x71D7, 0x7228,
+ 0x73CE, 0x7504, 0x750D, 0x7515, 0x7693, 0x787C, 0x7A31, 0x9F9D,
+ 0x7B99, 0x7C90, 0x7CAE, 0x7D9B, 0x7DAE, 0x7D9F, 0x7FD4, 0x822E,
+ 0x828D, 0x82D2, 0x8323, 0x8375, 0x8517, 0x853E, 0x8782, 0x87D2,
+ 0x890A, 0x89AF, 0x8ADE, 0x8B41, 0x8DDA, 0x8E09, 0x8F13, 0x8FEA,
+ 0x8FE9, 0x9058, 0x6248, 0x91C1, 0x95BB, 0x7762, 0x9724, 0x9760,
+ 0x976D, 0x9824, 0x9B2E, 0x9B97, 0x9BF2, 0x9EAA, 0x9F9C, 0x3001,
+ 0x3002, 0x203E, 0xFF3F, 0x30FC, 0x2015, 0x2010, 0x301C, 0x2016,
+ 0xFF5C, 0x2026, 0x2025, 0xFF08, 0xFF09, 0x3014, 0x3015, 0xFF3B,
+ 0xFF3D, 0xFF5B, 0xFF5D, 0x3008, 0x3009, 0x300A, 0x300B, 0x300C,
+ 0x300D, 0x300E, 0x300F, 0x3010, 0x3011, 0xFF1D, 0x3041, 0x3043,
+ 0x3045, 0x3047, 0x3049, 0x3063, 0x3083, 0x3085, 0x3087, 0x308E,
+ 0x30A1, 0x30A3, 0x30A5, 0x30A7, 0x30A9, 0x30C3, 0x30E3, 0x30E5,
+ 0x30E7, 0x30EE, 0x30F5, 0x30F6, 0x3349, 0x3314, 0x3322, 0x334D,
+ 0x3318, 0x3327, 0x3303, 0x3336, 0x3351, 0x3357, 0x330D, 0x3326,
+ 0x3323, 0x332B, 0x334A, 0x333B, 0x301D, 0x301E, 0x3094, 0x304B,
+ 0x3051, 0x82A6, 0x8328, 0x5653, 0x53A9, 0x7259, 0x6C72, 0x7B08,
+ 0x9957, 0x62F3, 0x9910, 0x976D, 0x717D, 0x7A7F, 0x7BAD, 0x63C3,
+ 0x83DF, 0x7962, 0x53DB, 0x7BC7, 0x8FC4, 0x7C3E, 0x50CA, 0x5315,
+ 0x55A9, 0x56AE, 0x5819, 0x591B, 0x5C28, 0x5ED0, 0x5ECF, 0x6241,
+ 0x66C1, 0x6C08, 0x6E23, 0x6EEC, 0x7A97, 0x7BDD, 0x7FE9, 0x8422,
+ 0x8759, 0x880E, 0x87D2, 0x9A19, 0x9EAD, 0xFFE4, 0xFF07, 0xFF02,
+ 0x11A8, 0x25C1, 0x25B7, 0x21E9, 0x21E7, 0x21E6, 0x21E8, 0x25A2,
+ 0x2667, 0x2661, 0x2664, 0x2662, 0x33A0, 0x33A2, 0x33A4, 0x33A5,
+ 0x3397, 0x2113, 0x3398, 0x33B3, 0x33B2, 0x33B1, 0x33B0, 0x3385,
+ 0x3386, 0x3387, 0x33CB, 0x3390, 0x33D4, 0x3396, 0x3322, 0x3316,
+ 0x3318, 0x3315, 0x3303, 0x3323, 0x3357, 0x3342, 0x3339, 0x333B,
+ 0x3300, 0x3331, 0x3347, 0x331E, 0x332A, 0x33CD, 0x337F, 0x2121,
+ 0x260E, 0x3036, 0x3020, 0x00A9, 0x00AE, 0x0000, 0x2488, 0x2489,
+ 0x248A, 0x248B, 0x248C, 0x248D, 0x248E, 0x248F, 0x2490, 0x2474,
+ 0x2475, 0x2476, 0x2477, 0x2478, 0x2479, 0x247A, 0x247B, 0x247C,
+ 0x247D, 0x247E, 0x247F, 0x2480, 0x2481, 0x2482, 0x2483, 0x2484,
+ 0x2485, 0x2486, 0x2487, 0x3251, 0x2170, 0x2171, 0x2172, 0x2173,
+ 0x2174, 0x2175, 0x2176, 0x2177, 0x2178, 0x2179, 0x3252, 0x3253,
+ 0x3254, 0x3255, 0x3256, 0x3257, 0x3258, 0x3259, 0x325A, 0x325B,
+ 0x249C, 0x249D, 0x249E, 0x249F, 0x24A0, 0x24A1, 0x24A2, 0x24A3,
+ 0x24A4, 0x24A5, 0x24A6, 0x24A7, 0x24A8, 0x24A9, 0x24AA, 0x24AB,
+ 0x24AC, 0x24AD, 0x24AE, 0x24AF, 0x24B0, 0x24B1, 0x24B2, 0x24B3,
+ 0x24B4, 0x24B5, 0x3243, 0x323D, 0x323F, 0x3234, 0x3238, 0x3233,
+ 0x323C, 0x3242, 0x323E, 0x3236, 0x3235, 0x323B, 0x3240, 0x323A,
+ 0x32B0, 0x32AD, 0x32A9, 0x32AF, 0x3294, 0x32AA, 0x3298, 0x32AB,
+ 0x3292, 0x3291, 0x3293, 0x32AC, 0x32AE, 0x3296, 0x23A9, 0x23A8,
+ 0x23A7, 0xFE38, 0x23AD, 0x23AC, 0x23AB, 0xFE38, 0x23AB, 0x23AC,
+ 0x23AD, 0xFE38, 0x23A7, 0x23A8, 0x23A9, 0xFE38, 0x33CC, 0x3305,
+ 0x00BD, 0x00BC, 0x339F, 0x33A3, 0x33A6, 0xFFFD, 0xFFFD, 0x329E,
+ 0x3388, 0x3389, 0x33C8, 0x222D, 0x5370, 0x3230, 0x322A, 0x322B,
+ 0x322C, 0x322D, 0x322E, 0x322F, 0x3237, 0x3241, 0x27A1, 0x21E6,
+ 0x21E7, 0x21E9, 0x25C9, 0x2660, 0x2665, 0x2663, 0x2666, 0x2600,
+ 0x2601, 0x2602, 0x2603, 0x261E, 0x261C, 0x261D, 0x261F, 0x3299,
+ 0x24EA, 0x216A, 0x216B, 0xFF10, 0xFF10, 0x3000, 0x2581, 0x2582,
+ 0x2583, 0x2584, 0x2585, 0x2586, 0x2587, 0x2588, 0x258F, 0x258E,
+ 0x258D, 0x258C, 0x258B, 0x258A, 0x2589, 0x2594, 0x2595, 0x256D,
+ 0x256E, 0x2570, 0x256F, 0x2550, 0x255E, 0x256A, 0x2561, 0x25E2,
+ 0x25E3, 0x25E5, 0x25E4, 0x25CF, 0x0ED0, 0x2571, 0x2572, 0x2573,
+ 0x304B, 0x3051, 0x9022, 0x8FBB, 0xFF0C, 0x00B0, 0x3013, 0x309C,
+ 0x309B, 0x02CF, 0xFF0E, 0x2018, 0x2019, 0x201C, 0x201D, 0x201C,
+ 0x201E, 0x2018, 0x201A, 0x02BA, 0x51DC, 0x7199, 0x2776, 0x2777,
+ 0x2778, 0x2779, 0x277A, 0x277B, 0x277C, 0x277D, 0x277E, 0x0000,
+ 0x0000, 0x0000, 0x217A, 0x217B, 0x0000, 0x0000, 0x0000, 0x217F,
+ 0x210A, 0x2109, 0x0000, 0x0000, 0x3004, 0x21C6, 0x21C4, 0x21C5,
+ 0x0000, 0x30F7, 0x30F8, 0x30F9, 0x30FA, 0x5927, 0x5C0F, 0x329D,
+ 0x63A7, 0x0000, 0x0000, 0x337B, 0x337F, 0x0000, 0x0000, 0x3333,
+ 0x334E, 0x3322, 0x3316, 0x3305, 0x3305, 0x3305, 0x3333, 0x334E,
+ 0x334E, 0x334E, 0x3303, 0x3318, 0x3315, 0x3339, 0x3339, 0x3339,
+ 0x3357, 0x3342, 0x3342, 0x3342, 0x3323, 0x333B, 0x3300, 0x331E,
+ 0x331E, 0x331E, 0x332A, 0x332A, 0x332A, 0x3347, 0x3331, 0x7E8A,
+ 0x891C, 0x9348, 0x9288, 0x84DC, 0x4FC9, 0x70BB, 0x6631, 0x68C8,
+ 0x92F9, 0x66FB, 0x5F45, 0x4E28, 0x4EE1, 0x4EFC, 0x4F00, 0x4F03,
+ 0x4F39, 0x4F56, 0x4F92, 0x4F8A, 0x4F9A, 0x4F94, 0x4FCD, 0x5040,
+ 0x5022, 0x4FFF, 0x501E, 0x5046, 0x5070, 0x5042, 0x5094, 0x50F4,
+ 0x50D8, 0x514A, 0x5164, 0x519D, 0x51BE, 0x51EC, 0x5215, 0x529C,
+ 0x52A6, 0x52C0, 0x52DB, 0x5300, 0x5307, 0x5324, 0x5372, 0x5393,
+ 0x53B2, 0x53DD, 0xFA0E, 0x549C, 0x548A, 0x54A9, 0x54FF, 0x5586,
+ 0x5759, 0x5765, 0x57AC, 0x57C8, 0x57C7, 0xFA0F, 0xFA10, 0x589E,
+ 0x58B2, 0x590B, 0x5953, 0x595B, 0x595D, 0x5963, 0x59A4, 0x59BA,
+ 0x5B56, 0x5BC0, 0x752F, 0x5BD8, 0x5BEC, 0x5C1E, 0x5CA6, 0x5CBA,
+ 0x5CF5, 0x5D27, 0x5D53, 0xFA11, 0x5D42, 0x5D6D, 0x5DB8, 0x5DB9,
+ 0x5DD0, 0x5F21, 0x5F34, 0x5F67, 0x5FB7, 0x5FDE, 0x605D, 0x6085,
+ 0x608A, 0x60DE, 0x60D5, 0x6120, 0x60F2, 0x6111, 0x6137, 0x6130,
+ 0x6198, 0x6213, 0x62A6, 0x63F5, 0x6460, 0x649D, 0x64CE, 0x654E,
+ 0x6600, 0x6615, 0x6609, 0x662E, 0x661E, 0x6624, 0x6665, 0x6657,
+ 0x6659, 0xFA12, 0x6673, 0x6699, 0x66A0, 0x66B2, 0x66BF, 0x66FA,
+ 0x670E, 0xF929, 0x6766, 0x67BB, 0x6852, 0x67C0, 0x6801, 0x6844,
+ 0x68CF, 0xFA13, 0x6968, 0xFA14, 0x6998, 0x69E2, 0x6A30, 0x6A6B,
+ 0x6A46, 0x6A73, 0x6A7E, 0x6AE2, 0x6AE4, 0x6BD6, 0x6C3F, 0x6C5C,
+ 0x6C86, 0x6C6F, 0x6CDA, 0x6D04, 0x6D87, 0x6D6F, 0x6D96, 0x6DAC,
+ 0x6DCF, 0x6DF8, 0x6DF2, 0x6DFC, 0x6E39, 0x6E5C, 0x6E27, 0x6E3C,
+ 0x6EBF, 0x6F88, 0x6FB5, 0x6FF5, 0x7005, 0x7007, 0x7028, 0x7085,
+ 0x70AB, 0x710F, 0x7104, 0x715C, 0x7146, 0x7147, 0xFA15, 0x71C1,
+ 0x71FE, 0x72B1, 0x72BE, 0x7324, 0xFA16, 0x7377, 0x73BD, 0x73C9,
+ 0x73D6, 0x73E3, 0x73D2, 0x7407, 0x73F5, 0x7426, 0x742A, 0x7429,
+ 0x742E, 0x7462, 0x7489, 0x749F, 0x7501, 0x756F, 0x7682, 0x769C,
+ 0x769E, 0x769B, 0x76A6, 0xFA17, 0x7746, 0x52AF, 0x7821, 0x784E,
+ 0x7864, 0x787A, 0x7930, 0xFA18, 0xFA19, 0xFA1A, 0x7994, 0xFA1B,
+ 0x799B, 0x7AD1, 0x7AE7, 0xFA1C, 0x7AEB, 0x7B9E, 0xFA1D, 0x7D48,
+ 0x7D5C, 0x7DB7, 0x7DA0, 0x7DD6, 0x7E52, 0x7F47, 0x7FA1, 0xFA1E,
+ 0x8301, 0x8362, 0x837F, 0x83C7, 0x83F6, 0x8448, 0x84B4, 0x8553,
+ 0x8559, 0x856B, 0xFA1F, 0x85B0, 0xFA20, 0xFA21, 0x8807, 0x88F5,
+ 0x8A12, 0x8A37, 0x8A79, 0x8AA7, 0x8ABE, 0x8ADF, 0xFA22, 0x8AF6,
+ 0x8B53, 0x8B7F, 0x8CF0, 0x8CF4, 0x8D12, 0x8D76, 0xFA23, 0x8ECF,
+ 0xFA24, 0xFA25, 0x9067, 0x90DE, 0xFA26, 0x9115, 0x9127, 0x91DA,
+ 0x91D7, 0x91DE, 0x91ED, 0x91EE, 0x91E4, 0x91E5, 0x9206, 0x9210,
+ 0x920A, 0x923A, 0x9240, 0x923C, 0x924E, 0x9259, 0x9251, 0x9239,
+ 0x9267, 0x92A7, 0x9277, 0x9278, 0x92E7, 0x92D7, 0x92D9, 0x92D0,
+ 0xFA27, 0x92D5, 0x92E0, 0x92D3, 0x9325, 0x9321, 0x92FB, 0xFA28,
+ 0x931E, 0x92FF, 0x931D, 0x9302, 0x9370, 0x9357, 0x93A4, 0x93C6,
+ 0x93DE, 0x93F8, 0x9431, 0x9445, 0x9448, 0x9592, 0xF9DC, 0xFA29,
+ 0x969D, 0x96AF, 0x9733, 0x973B, 0x9743, 0x974D, 0x974F, 0x9751,
+ 0x9755, 0x9857, 0x9865, 0xFA2A, 0xFA2B, 0x9927, 0xFA2C, 0x999E,
+ 0x9A4E, 0x9AD9, 0x9ADC, 0x9B75, 0x9B72, 0x9B8F, 0x9BB1, 0x9BBB,
+ 0x9C00, 0x9D70, 0x9D6B, 0xFA2D, 0x9E19, 0x9ED1, 0x00AC, 0x005C,
+ 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027,
+ 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F,
+ 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037,
+ 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,
+ 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047,
+ 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
+ 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057,
+ 0x0058, 0x0059, 0x005A, 0x005B, 0x00A5, 0x005D, 0x005E, 0x005F,
+ 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067,
+ 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F,
+ 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077,
+ 0x0078, 0x0079, 0x007A, 0x007B, 0x00A6, 0x007D, 0x0303, 0x02BC,
+ 0x005C, 0x02BB, 0x007C, 0x007E, 0x00A1, 0x00A2, 0x00A3, 0x2044,
+ 0x0192, 0x00A7, 0x00A4, 0x201C, 0x00AB, 0x2039, 0x203A, 0xFB01,
+ 0xFB02, 0x2012, 0x2020, 0x2021, 0x00B7, 0x00B6, 0x2022, 0x201A,
+ 0x201E, 0x201D, 0x00BB, 0x2026, 0x2030, 0x00BF, 0x0301, 0x0302,
+ 0x00AF, 0x0306, 0x0307, 0x0308, 0x030A, 0x00B8, 0x030B, 0x0328,
+ 0x030C, 0x0336, 0x00C6, 0x00AA, 0x0141, 0x00D8, 0x0152, 0x00BA,
+ 0x00E6, 0x0131, 0x0142, 0x00F8, 0x0153, 0x00DF, 0x002D, 0x00A9,
+ 0x00AC, 0x00AE, 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B5, 0x00B9,
+ 0x00BC, 0x00BD, 0x00BE, 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4,
+ 0x00C5, 0x00C7, 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD,
+ 0x00CE, 0x00CF, 0x00D0, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5,
+ 0x00D6, 0x00D7, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x00DE,
+ 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E7, 0x00E8,
+ 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF, 0x00F0,
+ 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7, 0x00F9,
+ 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x00FF, 0x0160, 0x0178,
+ 0x017D, 0x0305, 0x0161, 0x2122, 0x017E, 0x0030, 0x2002, 0x0021,
+ 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029,
+ 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 0x0030, 0x0031,
+ 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039,
+ 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 0x0040, 0x0041,
+ 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049,
+ 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051,
+ 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059,
+ 0x005A, 0x005B, 0x00A5, 0x005D, 0x005E, 0x005F, 0x0060, 0x0061,
+ 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069,
+ 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071,
+ 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079,
+ 0x007A, 0x007B, 0x007C, 0x007D, 0x203E, 0xFF40, 0x2032, 0x00A8,
+ 0x2036, 0x00C4, 0x00F9, 0x00E9, 0x00ED, 0x00DF, 0x00E7, 0x00C7,
+ 0x00D1, 0x00F1, 0x00A2, 0x00A3, 0x00F3, 0x00FA, 0x00A1, 0x00BF,
+ 0x00BD, 0x00D6, 0x00DC, 0x00E4, 0x00EB, 0x00EF, 0x00F6, 0x00DC,
+ 0x00E2, 0x00EA, 0x00EE, 0x00F4, 0x00FC, 0x00E0, 0x00E9, 0x00E1,
+ 0x007E, 0x0030, 0x00AC, 0x005C, 0xFF60, 0xFF61, 0xFF62, 0xFF63,
+ 0xFF64, 0xFF65, 0xFF66, 0xFF67, 0xFF68, 0xFF69, 0xFF6A, 0xFF6B,
+ 0xFF6C, 0xFF6D, 0xFF6E, 0xFF6F, 0xFF70, 0xFF71, 0xFF72, 0xFF73,
+ 0xFF74, 0xFF75, 0xFF76, 0xFF77, 0xFF78, 0xFF79, 0xFF7A, 0xFF7B,
+ 0xFF7C, 0xFF7D, 0xFF7E, 0xFF7F, 0xFF80, 0xFF81, 0xFF82, 0xFF83,
+ 0xFF84, 0xFF85, 0xFF86, 0xFF87, 0xFF88, 0xFF89, 0xFF8A, 0xFF8B,
+ 0xFF8C, 0xFF8D, 0xFF8E, 0xFF8F, 0xFF90, 0xFF91, 0xFF92, 0xFF93,
+ 0xFF94, 0xFF95, 0xFF96, 0xFF97, 0xFF98, 0xFF99, 0xFF9A, 0xFF9B,
+ 0xFF9C, 0xFF9D, 0xFF9E, 0xFF9F, 0x30F0, 0x30F1, 0x30EE, 0x30AB,
+ 0x30B1, 0x30F4, 0x30AC, 0x30AE, 0x30B0, 0x30B2, 0x30B4, 0x30B6,
+ 0x30B8, 0x30BA, 0x30BC, 0x30BE, 0x30C0, 0x30C2, 0x30C5, 0x30C7,
+ 0x30C9, 0x30D0, 0x30D1, 0x30D3, 0x30D4, 0x30D6, 0x30D7, 0x30D9,
+ 0x30DA, 0x30DC, 0x30DD, 0xFF60, 0x3092, 0x3041, 0x3043, 0x3045,
+ 0x3047, 0x3049, 0x3083, 0x3085, 0x3087, 0x3063, 0x3042, 0x3044,
+ 0x3046, 0x3048, 0x304A, 0x304B, 0x304D, 0x304F, 0x3051, 0x3053,
+ 0x3055, 0x3057, 0x3059, 0x305B, 0x305D, 0x305F, 0x3061, 0x3064,
+ 0x3066, 0x3068, 0x306A, 0x306B, 0x306C, 0x306D, 0x306E, 0x306F,
+ 0x3072, 0x3075, 0x3078, 0x307B, 0x307E, 0x307F, 0x3080, 0x3081,
+ 0x3082, 0x3084, 0x3086, 0x3088, 0x3089, 0x308A, 0x308B, 0x308C,
+ 0x308D, 0x308F, 0x3093, 0x3090, 0x3091, 0x308E, 0x304C, 0x304E,
+ 0x3050, 0x3052, 0x3054, 0x3056, 0x3068, 0x305A, 0x305C, 0x305E,
+ 0x3060, 0x3062, 0x3065, 0x3067, 0x3069, 0x3070, 0x3071, 0x3073,
+ 0x3074, 0x3076, 0x3077, 0x3079, 0x307A, 0x307C, 0x307D, 0x301D,
+ 0x301E, 0x005B, 0x005D, 0x3008, 0x3009, 0x300A, 0x300B, 0x300E,
+ 0x300F, 0x3010, 0x3011, 0x2012, 0xFF60, 0x2500, 0x2501, 0x2502,
+ 0x2503, 0x2504, 0x2505, 0x2506, 0x2507, 0x2508, 0x2509, 0x250A,
+ 0x250B, 0x250C, 0x250D, 0x250E, 0x250F, 0x2510, 0x2511, 0x2512,
+ 0x2513, 0x2514, 0x2515, 0x2516, 0x2517, 0x2518, 0x2519, 0x251A,
+ 0x251B, 0x251C, 0x251D, 0x251E, 0x251F, 0x2520, 0x2521, 0x2522,
+ 0x2523, 0x2524, 0x2525, 0x2526, 0x2527, 0x2528, 0x2529, 0x252A,
+ 0x252B, 0x252C, 0x252D, 0x252E, 0x252F, 0x2530, 0x2531, 0x2532,
+ 0x2533, 0x2534, 0x2535, 0x2536, 0x2537, 0x2538, 0x2539, 0x253A,
+ 0x253B, 0x253C, 0x253D, 0x253E, 0x253F, 0x2540, 0x2541, 0x2542,
+ 0x2543, 0x2544, 0x2545, 0x2546, 0x2547, 0x2548, 0x2549, 0x254A,
+ 0x254B, 0x25B2, 0x20AC, 0x2126, 0x2032, 0x2033, 0xFB00, 0xFB03,
+ 0xFB04, 0x0101, 0x012B, 0x016B, 0x0113, 0x014D, 0x0100, 0x012A,
+ 0x016A, 0x0112, 0x014C, 0x215B, 0x215C, 0x215D, 0x215E, 0x2153,
+ 0x2154, 0x2070, 0x2074, 0x2075, 0x2076, 0x2077, 0x2078, 0x2079,
+ 0x2080, 0x2081, 0x2082, 0x2083, 0x2084, 0x2085, 0x2086, 0x2087,
+ 0x2088, 0x2089, 0x01CD, 0x011A, 0x0000, 0x1EBC, 0x01CF, 0x0000,
+ 0x0128, 0x01D1, 0x0000, 0x01D3, 0x016E, 0x0168, 0x01CE, 0x011B,
+ 0x0000, 0x1EBD, 0x01D0, 0x0000, 0x0129, 0x01D2, 0x0000, 0x01D4,
+ 0x016F, 0x0169, 0x0251, 0x0251, 0x0251, 0x01FD, 0x00E6, 0x0254,
+ 0x0254, 0x0254, 0x0259, 0x0259, 0x0259, 0x025A, 0x025A, 0x025A,
+ 0x025B, 0x025B, 0x025B, 0x006A, 0x014B, 0x0275, 0x028C, 0x028C,
+ 0x028C, 0x0292, 0x0283, 0x02D0, 0x0020, 0x0021, 0x0022, 0x0023,
+ 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B,
+ 0x002C, 0x002D, 0x002E, 0x002F, 0x0030, 0x0031, 0x0032, 0x0033,
+ 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B,
+ 0x003C, 0x003D, 0x003E, 0x003F, 0x0040, 0x0041, 0x0042, 0x0043,
+ 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B,
+ 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051, 0x0052, 0x0053,
+ 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B,
+ 0x00A5, 0x005D, 0x005E, 0x005F, 0x0060, 0x0061, 0x0062, 0x0063,
+ 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B,
+ 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, 0x0072, 0x0073,
+ 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B,
+ 0x00A6, 0x007D, 0x0303, 0x02BC, 0x005C, 0x02BB, 0x007C, 0x007E,
+ 0x00A1, 0x00A2, 0x00A3, 0x2044, 0x0192, 0x00A7, 0x00A4, 0x201C,
+ 0x00AB, 0x2039, 0x203A, 0xFB01, 0xFB02, 0x2012, 0x2020, 0x2021,
+ 0x00B7, 0x00B6, 0x2022, 0x201A, 0x201E, 0x201D, 0x00BB, 0x2026,
+ 0x2030, 0x00BF, 0x0301, 0x0302, 0x00AF, 0x0306, 0x0307, 0x0308,
+ 0x030A, 0x00B8, 0x030B, 0x0328, 0x030C, 0x0336, 0x00C6, 0x00AA,
+ 0x0141, 0x00D8, 0x0152, 0x00BA, 0x00E6, 0x0131, 0x0142, 0x00F8,
+ 0x0153, 0x00DF, 0x002D, 0x00A9, 0x00AC, 0x00AE, 0x00B0, 0x00B1,
+ 0x00B2, 0x00B3, 0x00B5, 0x00B9, 0x00BC, 0x00BD, 0x00BE, 0x00C0,
+ 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C7, 0x00C8, 0x00C9,
+ 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF, 0x00D0, 0x00D1,
+ 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7, 0x00D9, 0x00DA,
+ 0x00DB, 0x00DC, 0x00DD, 0x00DE, 0x00E0, 0x00E1, 0x00E2, 0x00E3,
+ 0x00E4, 0x00E5, 0x00E7, 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC,
+ 0x00ED, 0x00EE, 0x00EF, 0x00F0, 0x00F1, 0x00F2, 0x00F3, 0x00F4,
+ 0x00F5, 0x00F6, 0x00F7, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x00FD,
+ 0x00FE, 0x00FF, 0x0160, 0x0178, 0x017D, 0x0305, 0x0161, 0x2122,
+ 0x017E, 0x0030, 0x20AC, 0x2126, 0x2032, 0x2033, 0xFB00, 0xFB03,
+ 0xFB04, 0x0101, 0x012B, 0x016B, 0x0113, 0x014D, 0x0100, 0x012A,
+ 0x016A, 0x0112, 0x014C, 0x215B, 0x215C, 0x215D, 0x215E, 0x2153,
+ 0x2154, 0x2070, 0x2074, 0x2075, 0x2076, 0x2077, 0x2078, 0x2079,
+ 0x2080, 0x2081, 0x2082, 0x2083, 0x2084, 0x2085, 0x2086, 0x2087,
+ 0x2088, 0x2089, 0x01CD, 0x011A, 0x0000, 0x1EBC, 0x01CF, 0x0000,
+ 0x0128, 0x01D1, 0x0000, 0x01D3, 0x016E, 0x0168, 0x01CE, 0x011B,
+ 0x0000, 0x1EBD, 0x01D0, 0x0000, 0x0129, 0x01D2, 0x0000, 0x01D4,
+ 0x016F, 0x0169, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035,
+ 0x0036, 0x0037, 0x0038, 0x0039, 0x0336, 0x002D, 0x003D, 0x002C,
+ 0x0028, 0x0029, 0x002E, 0x002F, 0x003A, 0x003B, 0x0030, 0x0031,
+ 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039,
+ 0x0336, 0x002D, 0x003D, 0x002C, 0x0028, 0x0029, 0x002E, 0x002F,
+ 0x003A, 0x003B, 0x00B7, 0x20AC, 0x0000, 0x2153, 0x2154, 0x00BE,
+ 0x2155, 0x2156, 0x2157, 0x2158, 0x2159, 0x215A, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x215B, 0x215C, 0x215D, 0x215E,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037,
+ 0x0038, 0x0039, 0x0030, 0x2163, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2170, 0x2171,
+ 0x2172, 0x2173, 0x2174, 0x2175, 0x2176, 0x2177, 0x2178, 0x2179,
+ 0x217A, 0x217B, 0x0000, 0x0000, 0x0000, 0x2160, 0x2161, 0x2162,
+ 0x2163, 0x2164, 0x2165, 0x2166, 0x2167, 0x2168, 0x2169, 0x216A,
+ 0x216B, 0x0000, 0x0000, 0x0000, 0x0041, 0x0042, 0x0043, 0x0044,
+ 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C,
+ 0x004D, 0x004E, 0x004F, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054,
+ 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x3042, 0x3044,
+ 0x3046, 0x3048, 0x304A, 0x304B, 0x304D, 0x304F, 0x3051, 0x3053,
+ 0x3055, 0x3057, 0x3059, 0x305B, 0x305D, 0x305F, 0x3061, 0x3064,
+ 0x3066, 0x3068, 0x306A, 0x306B, 0x306C, 0x306D, 0x306E, 0x306F,
+ 0x3072, 0x3075, 0x3078, 0x307B, 0x307E, 0x307F, 0x3080, 0x3081,
+ 0x3082, 0x3084, 0x3086, 0x3088, 0x3089, 0x308A, 0x308B, 0x308C,
+ 0x308D, 0x308F, 0x3090, 0x3091, 0x3092, 0x3093, 0x30A2, 0x30A4,
+ 0x30A6, 0x30A8, 0x30AA, 0x30AB, 0x30AD, 0x30AF, 0x30B1, 0x30B3,
+ 0x30B5, 0x30B7, 0x30B9, 0x30BB, 0x30BD, 0x30BF, 0x30C1, 0x30C4,
+ 0x30C6, 0x30C8, 0x30CA, 0x30CB, 0x30CC, 0x30CD, 0x30CE, 0x30CF,
+ 0x30D2, 0x30D5, 0x30D8, 0x30DB, 0x30DE, 0x30DF, 0x30E0, 0x30E1,
+ 0x30E2, 0x30E4, 0x30E6, 0x30E8, 0x30E9, 0x30EA, 0x30EB, 0x30EC,
+ 0x30ED, 0x30EF, 0x30F0, 0x30F1, 0x30F2, 0x30F3, 0x3220, 0x3221,
+ 0x3222, 0x3223, 0x3224, 0x3225, 0x3226, 0x3227, 0x3228, 0x3229,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x55B6, 0x5408, 0x6CEB, 0x554F, 0x7B54, 0x4F8B,
+ 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037,
+ 0x0038, 0x0039, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035,
+ 0x0036, 0x0037, 0x0038, 0x0039, 0x3063, 0x624D, 0x3007, 0x4E00,
+ 0x4E8C, 0x4E09, 0x56DB, 0x4E94, 0x516D, 0x4E03, 0x516B, 0x4E5D,
+ 0x5341, 0x3007, 0x4E00, 0x4E8C, 0x4E09, 0x56DB, 0x4E94, 0x516D,
+ 0x4E03, 0x516B, 0x4E5D, 0x5341, 0x3007, 0x4E00, 0x4E8C, 0x4E09,
+ 0x56DB, 0x4E94, 0x516D, 0x4E03, 0x516B, 0x4E5D, 0x3064, 0x624D,
+ 0x4E00, 0x4E8C, 0x4E09, 0x56DB, 0x4E94, 0x516D, 0x4E03, 0x516B,
+ 0x4E5D, 0x5341, 0x3007, 0x4E00, 0x4E8C, 0x4E09, 0x56DB, 0x4E94,
+ 0x516D, 0x4E03, 0x516B, 0x4E5D, 0x5341, 0x30B3, 0x3063, 0x30C3,
+ 0x30A9, 0x0000, 0x0000, 0x2460, 0x2461, 0x2462, 0x2463, 0x2464,
+ 0x2465, 0x2466, 0x2467, 0x2468, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x24D0, 0x24D1, 0x24D2, 0x24D3, 0x24D4, 0x24D5, 0x24D6,
+ 0x24D7, 0x24D8, 0x24D9, 0x24DA, 0x24DB, 0x24DC, 0x24DD, 0x24DE,
+ 0x24DF, 0x24E0, 0x24E1, 0x24E2, 0x24E3, 0x24E4, 0x24E5, 0x24E6,
+ 0x24E7, 0x24E8, 0x24E9, 0x24B6, 0x24B7, 0x24B8, 0x24B9, 0x24BA,
+ 0x24BB, 0x24BC, 0x24BD, 0x24BE, 0x24BF, 0x24C0, 0x24C1, 0x24C2,
+ 0x24C3, 0x24C4, 0x24C5, 0x24C6, 0x24C7, 0x24C8, 0x24C9, 0x24CA,
+ 0x24CB, 0x24CC, 0x24CD, 0x24CE, 0x24CF, 0x3042, 0x3044, 0x3046,
+ 0x3048, 0x304A, 0x304B, 0x304D, 0x304F, 0x3051, 0x3053, 0x3055,
+ 0x3057, 0x3059, 0x305B, 0x305D, 0x305F, 0x3061, 0x3064, 0x3066,
+ 0x3068, 0x306A, 0x306B, 0x306C, 0x306D, 0x306E, 0x306F, 0x3072,
+ 0x3075, 0x3078, 0x307B, 0x307E, 0x307F, 0x3080, 0x3081, 0x3082,
+ 0x3084, 0x3086, 0x3088, 0x3089, 0x308A, 0x308B, 0x308C, 0x308D,
+ 0x308F, 0x3090, 0x3091, 0x3092, 0x3093, 0x32D0, 0x32D1, 0x32D2,
+ 0x32D3, 0x32D4, 0x32D5, 0x32D6, 0x32D7, 0x32D8, 0x32D9, 0x32DA,
+ 0x32DB, 0x32DC, 0x32DD, 0x32DE, 0x32DF, 0x32E0, 0x32E1, 0x32E2,
+ 0x32E3, 0x32E4, 0x32E5, 0x32E6, 0x32E7, 0x32E8, 0x32E9, 0x32EA,
+ 0x32EB, 0x32EC, 0x32ED, 0x32EE, 0x32EF, 0x32F0, 0x32F1, 0x32F2,
+ 0x32F3, 0x32F4, 0x32F5, 0x32F6, 0x32F7, 0x32F8, 0x32F9, 0x32FA,
+ 0x32FB, 0x32FC, 0x32FD, 0x32FE, 0x30F3, 0x3280, 0x3281, 0x3282,
+ 0x3283, 0x3284, 0x3285, 0x3286, 0x3287, 0x3288, 0x3289, 0x3290,
+ 0x328A, 0x328B, 0x328C, 0x328D, 0x328E, 0x328F, 0x8ABF, 0x329F,
+ 0x526F, 0x6E1B, 0x6A19, 0x6B20, 0x57FA, 0x7981, 0x32A0, 0x32A1,
+ 0x329B, 0x329A, 0x32A3, 0x32A2, 0x3297, 0x51FA, 0x329C, 0x3295,
+ 0x6E08, 0x5897, 0x554F, 0x7B54, 0x4F8B, 0x96FB, 0x25CC, 0x0030,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0061, 0x0062, 0x0063,
+ 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B,
+ 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, 0x0072, 0x0073,
+ 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x0041,
+ 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049,
+ 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051,
+ 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059,
+ 0x005A, 0x3042, 0x3044, 0x3046, 0x3048, 0x304A, 0x304B, 0x304D,
+ 0x304F, 0x3051, 0x3053, 0x3055, 0x3057, 0x3059, 0x305B, 0x305D,
+ 0x305F, 0x3061, 0x3064, 0x3066, 0x3068, 0x306A, 0x306B, 0x306C,
+ 0x306D, 0x306E, 0x306F, 0x3072, 0x3075, 0x3078, 0x307B, 0x307E,
+ 0x307F, 0x3080, 0x3081, 0x3082, 0x3084, 0x3086, 0x3088, 0x3089,
+ 0x308A, 0x308B, 0x308C, 0x308D, 0x308F, 0x3090, 0x3091, 0x3092,
+ 0x3093, 0x30A2, 0x30A4, 0x30A6, 0x30A8, 0x30AA, 0x30AB, 0x30AD,
+ 0x30AF, 0x30B1, 0x30B3, 0x30B5, 0x30B7, 0x30B9, 0x30BB, 0x30BD,
+ 0x30BF, 0x30C1, 0x30C4, 0x30C6, 0x30C8, 0x30CA, 0x30CB, 0x30CC,
+ 0x30CD, 0x30CE, 0x30CF, 0x30D2, 0x30D5, 0x30D8, 0x30DB, 0x30DE,
+ 0x30DF, 0x30E0, 0x30E1, 0x30E2, 0x30E4, 0x30E6, 0x30E8, 0x30E9,
+ 0x30EA, 0x30EB, 0x30EC, 0x30ED, 0x30EF, 0x30F0, 0x30F1, 0x30F2,
+ 0x30F3, 0x65E5, 0x6708, 0x706B, 0x6C34, 0x6728, 0x91D1, 0x571F,
+ 0x554F, 0x7B54, 0x4F8B, 0x25CF, 0x0030, 0x0000, 0x0031, 0x0000,
+ 0x0032, 0x0000, 0x0033, 0x0000, 0x0034, 0x0000, 0x0035, 0x0000,
+ 0x0036, 0x0000, 0x0037, 0x0000, 0x0038, 0x0000, 0x0039, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065,
+ 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D,
+ 0x006E, 0x006F, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075,
+ 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x0041, 0x0042, 0x0043,
+ 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B,
+ 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051, 0x0052, 0x0053,
+ 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x3042,
+ 0x3044, 0x3046, 0x3048, 0x304A, 0x304B, 0x304D, 0x304F, 0x3051,
+ 0x3053, 0x3055, 0x3057, 0x3059, 0x305B, 0x305D, 0x305F, 0x3061,
+ 0x3064, 0x3066, 0x3068, 0x306A, 0x306B, 0x306C, 0x306D, 0x306E,
+ 0x306F, 0x3072, 0x3075, 0x3078, 0x307B, 0x307E, 0x307F, 0x3080,
+ 0x3081, 0x3082, 0x3084, 0x3086, 0x3088, 0x3089, 0x308A, 0x308B,
+ 0x308C, 0x308D, 0x308F, 0x3090, 0x3091, 0x3092, 0x3093, 0x30A2,
+ 0x30A4, 0x30A6, 0x30A8, 0x30AA, 0x30AB, 0x30AD, 0x30AF, 0x30B1,
+ 0x30B3, 0x30B5, 0x30B7, 0x30B9, 0x30BB, 0x30BD, 0x30BF, 0x30C1,
+ 0x30C4, 0x30C6, 0x30C8, 0x30CA, 0x30CB, 0x30CC, 0x30CD, 0x30CE,
+ 0x30CF, 0x30D2, 0x30D5, 0x30D8, 0x30DB, 0x30DE, 0x30DF, 0x30E0,
+ 0x30E1, 0x30E2, 0x30E4, 0x30E6, 0x30E8, 0x30E9, 0x30EA, 0x30EB,
+ 0x30EC, 0x30ED, 0x30EF, 0x30F0, 0x30F1, 0x30F2, 0x30F3, 0x65E5,
+ 0x6708, 0x706B, 0x6C34, 0x6728, 0x91D1, 0x571F, 0x8CA0, 0x52DD,
+ 0x554F, 0x7B54, 0x4F8B, 0x25A1, 0x25A1, 0x0030, 0x0000, 0x0031,
+ 0x0000, 0x0032, 0x0000, 0x0033, 0x0000, 0x0034, 0x0000, 0x0035,
+ 0x0000, 0x0036, 0x0000, 0x0037, 0x0000, 0x0038, 0x0000, 0x0039,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0061, 0x0062, 0x0063, 0x0064,
+ 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C,
+ 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074,
+ 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x0041, 0x0042,
+ 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A,
+ 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051, 0x0052,
+ 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A,
+ 0x3042, 0x3044, 0x3046, 0x3048, 0x304A, 0x304B, 0x304D, 0x304F,
+ 0x3051, 0x3053, 0x3055, 0x3057, 0x3059, 0x305B, 0x305D, 0x305F,
+ 0x3061, 0x3064, 0x3066, 0x3068, 0x306A, 0x306B, 0x306C, 0x306D,
+ 0x306E, 0x306F, 0x3072, 0x3075, 0x3078, 0x307B, 0x307E, 0x307F,
+ 0x3080, 0x3081, 0x3082, 0x3084, 0x3086, 0x3088, 0x3089, 0x308A,
+ 0x308B, 0x308C, 0x308D, 0x308F, 0x3090, 0x3091, 0x3092, 0x3093,
+ 0x30A2, 0x30A4, 0x30A6, 0x30A8, 0x30AA, 0x30AB, 0x30AD, 0x30AF,
+ 0x30B1, 0x30B3, 0x30B5, 0x30B7, 0x30B9, 0x30BB, 0x30BD, 0x30BF,
+ 0x30C1, 0x30C4, 0x30C6, 0x30C8, 0x30CA, 0x30CB, 0x30CC, 0x30CD,
+ 0x30CE, 0x30CF, 0x30D2, 0x30D5, 0x30D8, 0x30DB, 0x30DE, 0x30DF,
+ 0x30E0, 0x30E1, 0x30E2, 0x30E4, 0x30E6, 0x30E8, 0x30E9, 0x30EA,
+ 0x30EB, 0x30EC, 0x30ED, 0x30EF, 0x30F0, 0x30F1, 0x30F2, 0x30F3,
+ 0x65E5, 0x6708, 0x706B, 0x6C34, 0x6728, 0x91D1, 0x571F, 0x554F,
+ 0x7B54, 0x4F8B, 0x25A0, 0x0030, 0x0000, 0x0031, 0x0000, 0x0032,
+ 0x0000, 0x0033, 0x0000, 0x0034, 0x0000, 0x0035, 0x0000, 0x0036,
+ 0x0000, 0x0037, 0x0000, 0x0038, 0x0000, 0x0039, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066,
+ 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E,
+ 0x006F, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076,
+ 0x0077, 0x0078, 0x0079, 0x007A, 0x0041, 0x0042, 0x0043, 0x0044,
+ 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C,
+ 0x004D, 0x004E, 0x004F, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054,
+ 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x3042, 0x3044,
+ 0x3046, 0x3048, 0x304A, 0x304B, 0x304D, 0x304F, 0x3051, 0x3053,
+ 0x3055, 0x3057, 0x3059, 0x305B, 0x305D, 0x305F, 0x3061, 0x3064,
+ 0x3066, 0x3068, 0x306A, 0x306B, 0x306C, 0x306D, 0x306E, 0x306F,
+ 0x3072, 0x3075, 0x3078, 0x307B, 0x307E, 0x307F, 0x3080, 0x3081,
+ 0x3082, 0x3084, 0x3086, 0x3088, 0x3089, 0x308A, 0x308B, 0x308C,
+ 0x308D, 0x308F, 0x3090, 0x3091, 0x3092, 0x3093, 0x30A2, 0x30A4,
+ 0x30A6, 0x30A8, 0x30AA, 0x30AB, 0x30AD, 0x30AF, 0x30B1, 0x30B3,
+ 0x30B5, 0x30B7, 0x30B9, 0x30BB, 0x30BD, 0x30BF, 0x30C1, 0x30C4,
+ 0x30C6, 0x30C8, 0x30CA, 0x30CB, 0x30CC, 0x30CD, 0x30CE, 0x30CF,
+ 0x30D2, 0x30D5, 0x30D8, 0x30DB, 0x30DE, 0x30DF, 0x30E0, 0x30E1,
+ 0x30E2, 0x30E4, 0x30E6, 0x30E8, 0x30E9, 0x30EA, 0x30EB, 0x30EC,
+ 0x30ED, 0x30EF, 0x30F0, 0x30F1, 0x30F2, 0x30F3, 0x65E5, 0x6708,
+ 0x706B, 0x6C34, 0x6728, 0x91D1, 0x571F, 0x554F, 0x7B54, 0x4F8B,
+ 0x0030, 0x0000, 0x0031, 0x0000, 0x0032, 0x0000, 0x0033, 0x0000,
+ 0x0034, 0x0000, 0x0035, 0x0000, 0x0036, 0x0000, 0x0037, 0x0000,
+ 0x0038, 0x0000, 0x0039, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0061,
+ 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069,
+ 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071,
+ 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079,
+ 0x007A, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047,
+ 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
+ 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057,
+ 0x0058, 0x0059, 0x005A, 0x3042, 0x3044, 0x3046, 0x3048, 0x304A,
+ 0x304B, 0x304D, 0x304F, 0x3051, 0x3053, 0x3055, 0x3057, 0x3059,
+ 0x305B, 0x305D, 0x305F, 0x3061, 0x3064, 0x3066, 0x3068, 0x306A,
+ 0x306B, 0x306C, 0x306D, 0x306E, 0x306F, 0x3072, 0x3075, 0x3078,
+ 0x307B, 0x307E, 0x307F, 0x3080, 0x3081, 0x3082, 0x3084, 0x3086,
+ 0x3088, 0x3089, 0x308A, 0x308B, 0x308C, 0x308D, 0x308F, 0x3090,
+ 0x3091, 0x3092, 0x3093, 0x30A2, 0x30A4, 0x30A6, 0x30A8, 0x30AA,
+ 0x30AB, 0x30AD, 0x30AF, 0x30B1, 0x30B3, 0x30B5, 0x30B7, 0x30B9,
+ 0x30BB, 0x30BD, 0x30BF, 0x30C1, 0x30C4, 0x30C6, 0x30C8, 0x30CA,
+ 0x30CB, 0x30CC, 0x30CD, 0x30CE, 0x30CF, 0x30D2, 0x30D5, 0x30D8,
+ 0x30DB, 0x30DE, 0x30DF, 0x30E0, 0x30E1, 0x30E2, 0x30E4, 0x30E6,
+ 0x30E8, 0x30E9, 0x30EA, 0x30EB, 0x30EC, 0x30ED, 0x30EF, 0x30F0,
+ 0x30F1, 0x30F2, 0x30F3, 0x65E5, 0x6708, 0x706B, 0x6C34, 0x6728,
+ 0x91D1, 0x571F, 0x554F, 0x7B54, 0x4F8B, 0x25A0, 0x33C2, 0x33CD,
+ 0x2116, 0x0000, 0x33D8, 0x33DA, 0x2121, 0x2122, 0x0000, 0x2100,
+ 0x33C2, 0x0000, 0x33C4, 0x2105, 0x3397, 0x3371, 0x3398, 0x2113,
+ 0x338D, 0x339B, 0x3396, 0x0000, 0x0000, 0x33D7, 0x33D8, 0x0000,
+ 0x0000, 0x0000, 0x3301, 0x3302, 0x3304, 0x3306, 0x0000, 0x3308,
+ 0x0000, 0x3307, 0x330A, 0x0000, 0x3309, 0x0000, 0x330B, 0x0000,
+ 0x330C, 0x330E, 0x330F, 0x3310, 0x3311, 0x3312, 0x3313, 0x0000,
+ 0x3317, 0x0000, 0x3319, 0x0000, 0x331A, 0x331B, 0x331C, 0x331D,
+ 0x331F, 0x3320, 0x3321, 0x3324, 0x0000, 0x3325, 0x0000, 0x0000,
+ 0x3328, 0x3329, 0x0000, 0x332D, 0x0000, 0x0000, 0x332E, 0x332F,
+ 0x3330, 0x3332, 0x0000, 0x0000, 0x3334, 0x3335, 0x333C, 0x0000,
+ 0x0000, 0x0000, 0x3337, 0x0000, 0x3338, 0x333A, 0x333D, 0x3341,
+ 0x333E, 0x333F, 0x3340, 0x3343, 0x3344, 0x3345, 0x3346, 0x3348,
+ 0x334B, 0x334C, 0x334F, 0x3350, 0x0000, 0x0000, 0x3352, 0x3354,
+ 0x0000, 0x0000, 0x3353, 0x3355, 0x3356, 0x0000, 0x3301, 0x3302,
+ 0x3304, 0x3306, 0x0000, 0x3308, 0x0000, 0x3307, 0x330A, 0x0000,
+ 0x3309, 0x0000, 0x330B, 0x0000, 0x330C, 0x330E, 0x330F, 0x3310,
+ 0x3311, 0x3312, 0x3313, 0x0000, 0x3317, 0x0000, 0x3319, 0x0000,
+ 0x331A, 0x331B, 0x331C, 0x331D, 0x331F, 0x3320, 0x3321, 0x3324,
+ 0x0000, 0x3325, 0x0000, 0x0000, 0x3328, 0x3329, 0x0000, 0x332D,
+ 0x0000, 0x0000, 0x332E, 0x332F, 0x3330, 0x3332, 0x0000, 0x0000,
+ 0x3334, 0x3335, 0x333C, 0x0000, 0x0000, 0x0000, 0x3337, 0x0000,
+ 0x3338, 0x333A, 0x333D, 0x3341, 0x333E, 0x333F, 0x3340, 0x3343,
+ 0x3344, 0x3345, 0x3346, 0x3348, 0x334B, 0x334C, 0x334F, 0x3350,
+ 0x0000, 0x0000, 0x3352, 0x3354, 0x0000, 0x0000, 0x3353, 0x3355,
+ 0x3356, 0x337E, 0x337D, 0x337C, 0x337B, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x002D,
+ 0x003D, 0x2103, 0x2640, 0x2642, 0x3013, 0x3012, 0x300C, 0x300D,
+ 0x300E, 0x300F, 0x301A, 0x301B, 0x3018, 0x3019, 0xFF08, 0xFF09,
+ 0x301D, 0x301E, 0x2018, 0x2019, 0x201C, 0x201D, 0x0027, 0x0022,
+ 0x0000, 0x2135, 0x03D0, 0x220A, 0x210F, 0x00B5, 0x03C6, 0x03DB,
+ 0x03D1, 0xFFFD, 0x2668, 0x2669, 0x266C, 0xFF1A, 0x00A9, 0x00A9,
+ 0x00AE, 0x00AE, 0x303B, 0x303B, 0x3033, 0x3034, 0x3035, 0x203C,
+ 0x2049, 0x0021, 0x203C, 0x2049, 0x244A, 0x0000, 0x2213, 0x2260,
+ 0x2243, 0x2272, 0x2273, 0x300C, 0x300D, 0x300E, 0x300F, 0x301A,
+ 0x301B, 0x3018, 0x3019, 0xFF5F, 0xFF60, 0x300C, 0x300D, 0x300E,
+ 0x300F, 0x301A, 0x301B, 0x3018, 0x3019, 0xFF5F, 0xFF60, 0x239B,
+ 0x239D, 0x239E, 0x23A0, 0x239D, 0x239B, 0x23A0, 0x239E, 0x23A1,
+ 0x23A3, 0x23A4, 0x23A6, 0x23A3, 0x23A1, 0x23A6, 0x23A4, 0x23A1,
+ 0x23A3, 0x23A4, 0x23A6, 0x23A3, 0x23A1, 0x23A6, 0x23A4, 0xFF5C,
+ 0x2015, 0x301D, 0x301E, 0x2018, 0x2019, 0x2018, 0x2019, 0x2702,
+ 0x2702, 0x2702, 0x2702, 0x303D, 0x3012, 0x309F, 0x534D, 0x2207,
+ 0x2205, 0x22A0, 0x2296, 0x2298, 0x2295, 0x2297, 0x229E, 0x2295,
+ 0x0021, 0x25B3, 0x25C0, 0x25B6, 0x21E6, 0x21E8, 0x21E7, 0x21E9,
+ 0x21D0, 0x2194, 0x2198, 0x2199, 0x2196, 0x2197, 0x21CC, 0x21C6,
+ 0x21C4, 0x21C5, 0x2190, 0x2192, 0x2191, 0x2193, 0x2194, 0x2195,
+ 0x2504, 0x2506, 0x3030, 0x2307, 0x3030, 0x2307, 0x3030, 0x2307,
+ 0x3030, 0x2307, 0x3030, 0x2307, 0x2740, 0x273F, 0x25A1, 0x25A0,
+ 0x25A1, 0x25A1, 0x25A1, 0x25A1, 0x25A1, 0x25AB, 0x25A0, 0x25AA,
+ 0x271A, 0x271A, 0x25C7, 0x25C6, 0x25C7, 0x25C7, 0x25C7, 0x25C7,
+ 0x25C7, 0x25C6, 0x25C6, 0x25CE, 0x25C9, 0x25CB, 0x25E6, 0x25CF,
+ 0x2022, 0x2756, 0x2756, 0x2756, 0x2756, 0x3008, 0x3009, 0x3008,
+ 0x3009, 0x300A, 0x300B, 0x300A, 0x300B, 0x3053, 0x3053, 0x30B3,
+ 0x30B3, 0x309D, 0x309E, 0x3041, 0x3042, 0x3043, 0x3044, 0x3045,
+ 0x3046, 0x3047, 0x3048, 0x3049, 0x304A, 0x304B, 0x304B, 0x304C,
+ 0x304D, 0x304E, 0x304F, 0x3050, 0x3051, 0x3051, 0x3052, 0x3053,
+ 0x3053, 0x3054, 0x3055, 0x3056, 0x3057, 0x3058, 0x3059, 0x305A,
+ 0x305B, 0x305C, 0x305D, 0x305E, 0x305F, 0x3060, 0x3061, 0x3062,
+ 0x3063, 0x3064, 0x3065, 0x3066, 0x3067, 0x3068, 0x3069, 0x306A,
+ 0x306B, 0x306C, 0x306D, 0x306E, 0x306F, 0x3070, 0x3071, 0x3072,
+ 0x3073, 0x3074, 0x3075, 0x3076, 0x3077, 0x3078, 0x3079, 0x307A,
+ 0x307B, 0x307C, 0x307D, 0x307E, 0x307F, 0x3080, 0x3081, 0x3082,
+ 0x3083, 0x3084, 0x3085, 0x3086, 0x3087, 0x3088, 0x3089, 0x308A,
+ 0x308B, 0x308C, 0x308D, 0x308E, 0x308F, 0x3090, 0x3091, 0x3092,
+ 0x3093, 0x3094, 0x30FD, 0x30FE, 0x30FC, 0x30A1, 0x30A2, 0x30A3,
+ 0x30A4, 0x30A5, 0x30A6, 0x30A7, 0x30A8, 0x30A9, 0x30AA, 0x30F5,
+ 0x30AB, 0x30AC, 0x30AD, 0x30AE, 0x30AF, 0x30B0, 0x30F6, 0x30B1,
+ 0x30B2, 0x30B3, 0x30B3, 0x30B4, 0x30B5, 0x30B6, 0x30B7, 0x30B8,
+ 0x30B9, 0x30BA, 0x30BB, 0x30BC, 0x30BD, 0x30BE, 0x30BF, 0x30C0,
+ 0x30C1, 0x30C2, 0x30C3, 0x30C4, 0x30C5, 0x30C6, 0x30C7, 0x30C8,
+ 0x30C9, 0x30CA, 0x30CB, 0x30CC, 0x30CD, 0x30CE, 0x30CF, 0x30D0,
+ 0x30D1, 0x30D2, 0x30D3, 0x30D4, 0x30D5, 0x30D6, 0x30D7, 0x30D8,
+ 0x30D9, 0x30DA, 0x30DB, 0x30DC, 0x30DD, 0x30DE, 0x30DF, 0x30E0,
+ 0x30E1, 0x30E2, 0x30E3, 0x30E4, 0x30E5, 0x30E6, 0x30E7, 0x30E8,
+ 0x30E9, 0x30EA, 0x30EB, 0x30EC, 0x30ED, 0x30EE, 0x30EF, 0x30F0,
+ 0x30F1, 0x30F2, 0x30F3, 0x30F4, 0x30F7, 0x30F8, 0x30F9, 0x30FA,
+ 0x309D, 0x309E, 0x3041, 0x3042, 0x3043, 0x3044, 0x3045, 0x3046,
+ 0x3047, 0x3048, 0x3049, 0x304A, 0x304B, 0x304B, 0x304C, 0x304D,
+ 0x304E, 0x304F, 0x3050, 0x3051, 0x3051, 0x3052, 0x3053, 0x3053,
+ 0x3054, 0x3055, 0x3056, 0x3057, 0x3058, 0x3059, 0x305A, 0x305B,
+ 0x305C, 0x305D, 0x305E, 0x305F, 0x3060, 0x3061, 0x3062, 0x3063,
+ 0x3064, 0x3065, 0x3066, 0x3067, 0x3068, 0x3069, 0x306A, 0x306B,
+ 0x306C, 0x306D, 0x306E, 0x306F, 0x3070, 0x3071, 0x3072, 0x3073,
+ 0x3074, 0x3075, 0x3076, 0x3077, 0x3078, 0x3079, 0x307A, 0x307B,
+ 0x307C, 0x307D, 0x307E, 0x307F, 0x3080, 0x3081, 0x3082, 0x3083,
+ 0x3084, 0x3085, 0x3086, 0x3087, 0x3088, 0x3089, 0x308A, 0x308B,
+ 0x308C, 0x308D, 0x308E, 0x308F, 0x3090, 0x3091, 0x3092, 0x3093,
+ 0x3094, 0x30FD, 0x30FE, 0x30FC, 0x30A1, 0x30A2, 0x30A3, 0x30A4,
+ 0x30A5, 0x30A6, 0x30A7, 0x30A8, 0x30A9, 0x30AA, 0x30F5, 0x30AB,
+ 0x30AC, 0x30AD, 0x30AE, 0x30AF, 0x30B0, 0x30F6, 0x30B1, 0x30B2,
+ 0x30B3, 0x30B3, 0x30B4, 0x30B5, 0x30B6, 0x30B7, 0x30B8, 0x30B9,
+ 0x30BA, 0x30BB, 0x30BC, 0x30BD, 0x30BE, 0x30BF, 0x30C0, 0x30C1,
+ 0x30C2, 0x30C3, 0x30C4, 0x30C5, 0x30C6, 0x30C7, 0x30C8, 0x30C9,
+ 0x30CA, 0x30CB, 0x30CC, 0x30CD, 0x30CE, 0x30CF, 0x30D0, 0x30D1,
+ 0x30D2, 0x30D3, 0x30D4, 0x30D5, 0x30D6, 0x30D7, 0x30D8, 0x30D9,
+ 0x30DA, 0x30DB, 0x30DC, 0x30DD, 0x30DE, 0x30DF, 0x30E0, 0x30E1,
+ 0x30E2, 0x30E3, 0x30E4, 0x30E5, 0x30E6, 0x30E7, 0x30E8, 0x30E9,
+ 0x30EA, 0x30EB, 0x30EC, 0x30ED, 0x30EE, 0x30EF, 0x30F0, 0x30F1,
+ 0x30F2, 0x30F3, 0x30F4, 0x30F7, 0x30F8, 0x30F9, 0x30FA, 0x3001,
+ 0x3002, 0x30FB, 0xFF0A, 0x203B, 0x25CB, 0x25CE, 0x25C9, 0x25B3,
+ 0x25B2, 0x30FD, 0x30FE, 0x309D, 0x309E, 0xFF08, 0xFF09, 0x3014,
+ 0x3015, 0xFF08, 0xFF09, 0x3014, 0x3015, 0x0030, 0x0031, 0x0032,
+ 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x3041,
+ 0x3042, 0x3043, 0x3044, 0x3045, 0x3046, 0x3047, 0x3048, 0x3049,
+ 0x304A, 0x304B, 0x304B, 0x304C, 0x304D, 0x304E, 0x304F, 0x3050,
+ 0x3051, 0x3051, 0x3052, 0x3053, 0x3054, 0x3055, 0x3056, 0x3057,
+ 0x3058, 0x3059, 0x305A, 0x305B, 0x305C, 0x305D, 0x305E, 0x305F,
+ 0x3060, 0x3061, 0x3062, 0x3063, 0x3064, 0x3065, 0x3066, 0x3067,
+ 0x3068, 0x3069, 0x306A, 0x306B, 0x306C, 0x306D, 0x306E, 0x306F,
+ 0x3070, 0x3071, 0x3072, 0x3073, 0x3074, 0x3075, 0x3076, 0x3077,
+ 0x3078, 0x3079, 0x307A, 0x307B, 0x307C, 0x307D, 0x307E, 0x307F,
+ 0x3080, 0x3081, 0x3082, 0x3083, 0x3084, 0x3085, 0x3086, 0x3087,
+ 0x3088, 0x3089, 0x308A, 0x308B, 0x308C, 0x308D, 0x308E, 0x308F,
+ 0x3090, 0x3091, 0x3092, 0x3093, 0x3094, 0x3041, 0x3043, 0x3045,
+ 0x3047, 0x3049, 0x304B, 0x3051, 0x3063, 0x3083, 0x3085, 0x3087,
+ 0x308E, 0x30A1, 0x30A2, 0x30A3, 0x30A4, 0x30A5, 0x30A6, 0x30A7,
+ 0x30A8, 0x30A9, 0x30AA, 0x30AB, 0x30F5, 0x30AC, 0x30AD, 0x30AE,
+ 0x30AF, 0x30B0, 0x30B1, 0x30F6, 0x30B2, 0x30B3, 0x30B4, 0x30B5,
+ 0x30B6, 0x30B7, 0x30B8, 0x30B9, 0x30BA, 0x30BB, 0x30BC, 0x30BD,
+ 0x30BE, 0x30BF, 0x30C0, 0x30C1, 0x30C2, 0x30C3, 0x30C4, 0x30C5,
+ 0x30C6, 0x30C7, 0x30C8, 0x30C9, 0x30CA, 0x30CB, 0x30CC, 0x30CD,
+ 0x30CE, 0x30CF, 0x30D0, 0x30D1, 0x30D2, 0x30D3, 0x30D4, 0x30D5,
+ 0x30D6, 0x30D7, 0x30D8, 0x30D9, 0x30DA, 0x30DB, 0x30DC, 0x30DD,
+ 0x30DE, 0x30DF, 0x30E0, 0x30E1, 0x30E2, 0x30E3, 0x30E4, 0x30E5,
+ 0x30E6, 0x30E7, 0x30E8, 0x30E9, 0x30EA, 0x30EB, 0x30EC, 0x30ED,
+ 0x30EE, 0x30EF, 0x30F0, 0x30F1, 0x30F2, 0x30F3, 0x30F4, 0x30A1,
+ 0x30A3, 0x30A5, 0x30A7, 0x30A9, 0x30F5, 0x30F6, 0x30C3, 0x30E3,
+ 0x30E5, 0x30E7, 0x30EE, 0x30FC, 0x30FC, 0x6CE8, 0x20AC, 0x2126,
+ 0x2032, 0x2033, 0xFB00, 0xFB03, 0xFB04, 0x0101, 0x012B, 0x016B,
+ 0x0113, 0x014D, 0x0100, 0x012A, 0x016A, 0x0112, 0x014C, 0x215B,
+ 0x215C, 0x215D, 0x215E, 0x2153, 0x2154, 0x2070, 0x2074, 0x2075,
+ 0x2076, 0x2077, 0x2078, 0x2079, 0x2080, 0x2081, 0x2082, 0x2083,
+ 0x2084, 0x2085, 0x2086, 0x2087, 0x2088, 0x2089, 0x01CD, 0x011A,
+ 0x0000, 0x1EBC, 0x01CF, 0x0000, 0x0128, 0x01D1, 0x0000, 0x01D3,
+ 0x016E, 0x0168, 0x01CE, 0x011B, 0x0000, 0x1EBD, 0x01D0, 0x0000,
+ 0x0129, 0x01D2, 0x0000, 0x01D4, 0x016F, 0x0169, 0x0251, 0x0251,
+ 0x0251, 0x01FD, 0x00E6, 0x0254, 0x0254, 0x0254, 0x0259, 0x0259,
+ 0x0259, 0x025A, 0x025A, 0x025A, 0x025B, 0x025B, 0x025B, 0x006A,
+ 0x014B, 0x0275, 0x028C, 0x028C, 0x028C, 0x0292, 0x0283, 0x02D0,
+ 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027,
+ 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F,
+ 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037,
+ 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,
+ 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047,
+ 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
+ 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057,
+ 0x0058, 0x0059, 0x005A, 0x005B, 0x00A5, 0x005D, 0x005E, 0x005F,
+ 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067,
+ 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F,
+ 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077,
+ 0x0078, 0x0079, 0x007A, 0x007B, 0x00A6, 0x007D, 0x0303, 0x02BC,
+ 0x005C, 0x02BB, 0x007C, 0x007E, 0x00A1, 0x00A2, 0x00A3, 0x2044,
+ 0x0192, 0x00A7, 0x00A4, 0x201C, 0x00AB, 0x2039, 0x203A, 0xFB01,
+ 0xFB02, 0x2012, 0x2020, 0x2021, 0x00B7, 0x00B6, 0x2022, 0x201A,
+ 0x201E, 0x201D, 0x00BB, 0x2026, 0x2030, 0x00BF, 0x0301, 0x0302,
+ 0x00AF, 0x0306, 0x0307, 0x0308, 0x030A, 0x00B8, 0x030B, 0x0328,
+ 0x030C, 0x0336, 0x00C6, 0x00AA, 0x0141, 0x00D8, 0x0152, 0x00BA,
+ 0x00E6, 0x0131, 0x0142, 0x00F8, 0x0153, 0x00DF, 0x002D, 0x00A9,
+ 0x00AC, 0x00AE, 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B5, 0x00B9,
+ 0x00BC, 0x00BD, 0x00BE, 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4,
+ 0x00C5, 0x00C7, 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD,
+ 0x00CE, 0x00CF, 0x00D0, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5,
+ 0x00D6, 0x00D7, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x00DE,
+ 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E7, 0x00E8,
+ 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF, 0x00F0,
+ 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7, 0x00F9,
+ 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x00FF, 0x0160, 0x0178,
+ 0x017D, 0x0305, 0x0161, 0x2122, 0x017E, 0x0030, 0x20AC, 0x2126,
+ 0x2032, 0x2033, 0xFB00, 0xFB03, 0xFB04, 0x0101, 0x012B, 0x016B,
+ 0x0113, 0x014D, 0x0100, 0x012A, 0x016A, 0x0112, 0x014C, 0x215B,
+ 0x215C, 0x215D, 0x215E, 0x2153, 0x2154, 0x2070, 0x2074, 0x2075,
+ 0x2076, 0x2077, 0x2078, 0x2079, 0x2080, 0x2081, 0x2082, 0x2083,
+ 0x2084, 0x2085, 0x2086, 0x2087, 0x2088, 0x2089, 0x01CD, 0x011A,
+ 0x0000, 0x1EBC, 0x01CF, 0x0000, 0x0128, 0x01D1, 0x0000, 0x01D3,
+ 0x016E, 0x0168, 0x01CE, 0x011B, 0x0000, 0x1EBD, 0x01D0, 0x0000,
+ 0x0129, 0x01D2, 0x0000, 0x01D4, 0x016F, 0x0169, 0x0030, 0x0031,
+ 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039,
+ 0x0336, 0x002D, 0x003D, 0x002C, 0x0028, 0x0029, 0x002E, 0x002F,
+ 0x003A, 0x003B, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035,
+ 0x0036, 0x0037, 0x0038, 0x0039, 0x0336, 0x002D, 0x003D, 0x002C,
+ 0x0028, 0x0029, 0x002E, 0x002F, 0x003A, 0x003B, 0x00B7, 0x002D,
+ 0x003D, 0x2103, 0x2640, 0x2642, 0x3013, 0x3012, 0x300C, 0x300D,
+ 0x300E, 0x300F, 0x301A, 0x301B, 0x3018, 0x3019, 0xFF08, 0xFF09,
+ 0x301D, 0x301E, 0x2018, 0x2019, 0x201C, 0x201D, 0x0027, 0x0022,
+ 0x9038, 0x8B01, 0x7DE3, 0x9EC3, 0x6EAB, 0x798D, 0x6094, 0x6D77,
+ 0x6168, 0x6982, 0x6E34, 0x8910, 0x6F22, 0x5668, 0x65E2, 0x7948,
+ 0x865B, 0x97FF, 0x52E4, 0x8B39, 0x63ED, 0x64CA, 0x784F, 0x7A40,
+ 0x6BBA, 0x7949, 0x8996, 0x716E, 0x793E, 0x8005, 0x81ED, 0x795D,
+ 0x6691, 0x7F72, 0x6D89, 0x72C0, 0x613C, 0x771E, 0x7BC0, 0x7956,
+ 0x50E7, 0x5C64, 0x5DE2, 0x618E, 0x8D08, 0x537D, 0x5606, 0x8457,
+ 0x5FB5, 0x61F2, 0x93AD, 0x798E, 0x9B2D, 0x7A81, 0x96E3, 0x6885,
+ 0x7E41, 0x6669, 0x5351, 0x7891, 0x8CD3, 0x654F, 0x4FAE, 0x5002,
+ 0x5840, 0x52C9, 0x6B65, 0x58A8, 0x6BCF, 0x514D, 0x623E, 0x7950,
+ 0x6B04, 0x9686, 0x865C, 0x6DDA, 0x985E, 0x66C6, 0x6B77, 0x7DF4,
+ 0x934A, 0x5ECA, 0x9304, 0x6982, 0x51B4, 0x634C, 0x86DB, 0x9089,
+ 0x9022, 0x5049, 0x7DEF, 0x9055, 0x53A9, 0x990C, 0x885B, 0x5EF6,
+ 0x6CBF, 0x925B, 0x7FC1, 0x82BD, 0x96C5, 0x5BB3, 0x6168, 0x6982,
+ 0x6BBB, 0x6562, 0x8CAB, 0x5DCC, 0x9811, 0x5E30, 0x8ECC, 0x7AAE,
+ 0x5747, 0x5091, 0x7A74, 0x5065, 0x5EFA, 0x9237, 0x6A8E, 0x4EA4,
+ 0x516C, 0x66F4, 0x6821, 0x786C, 0x7D5E, 0x8003, 0x8CFC, 0x964D,
+ 0x62F7, 0x7F6A, 0x4F7F, 0x53F2, 0x59C9, 0x8B1D, 0x90AA, 0x53CE,
+ 0x8F2F, 0x67D4, 0x77AC, 0x821C, 0x696F, 0x677E, 0x8A1F, 0x4E08,
+ 0x57F4, 0x690D, 0x8077, 0x89AA, 0x9042, 0x636E, 0x6442, 0x8239,
+ 0x7DCF, 0x8061, 0x50CF, 0x8A95, 0x6065, 0x5146, 0x773A, 0x8074,
+ 0x8DF3, 0x5EAD, 0x5EF7, 0x8247, 0x6843, 0x9003, 0x6D3E, 0x6392,
+ 0x8F29, 0x73ED, 0x9812, 0x60B2, 0x6249, 0x6590, 0x7DCB, 0x8AB9,
+ 0x8CA7, 0x7236, 0x847A, 0x5206, 0x5674, 0x61A4, 0x7C89, 0x7D1B,
+ 0x96F0, 0x853D, 0x4FBF, 0x6367, 0x76C6, 0x685D, 0x8108, 0x8036,
+ 0x7FFC, 0x540F, 0x96A3, 0x9E9F, 0x9E97, 0x806F, 0x807E, 0x6E7E,
+ 0x5085, 0x5193, 0x51DB, 0x5315, 0x5340, 0x96D9, 0x55A9, 0x56C1,
+ 0x570D, 0x58AB, 0x59DA, 0x5A36, 0x5ABE, 0x5D4E, 0x5D87, 0x5DC9,
+ 0x5DD3, 0x5F2D, 0x5F98, 0x60D8, 0x613D, 0x61FE, 0x6268, 0x62CF,
+ 0x651D, 0x640F, 0x64F2, 0x655D, 0x665F, 0x67A9, 0x67E7, 0x696B,
+ 0x6930, 0x69A7, 0x6A44, 0x6A90, 0x6C08, 0x6C13, 0x6E23, 0x6F11,
+ 0x6EFE, 0x6F3E, 0x71FF, 0x73E5, 0x7432, 0x745F, 0x74E0, 0x750C,
+ 0x7672, 0x792A, 0x78D4, 0x79BA, 0x7A19, 0x7A95, 0x7CF2, 0x7D73,
+ 0x7DDD, 0x7E35, 0x7FAE, 0x7FE1, 0x805A, 0x805F, 0x8073, 0x8070,
+ 0x8076, 0x8153, 0x818A, 0x81B5, 0x81CD, 0x83F2, 0x8555, 0x85D5,
+ 0x871A, 0x8836, 0x889E, 0x88D8, 0x88F4, 0x892B, 0x893B, 0x896A,
+ 0x896F, 0x8A1D, 0x8D05, 0x8D0F, 0x9F4E, 0x8E91, 0x8EA1, 0x9052,
+ 0x900E, 0x9130, 0x9156, 0x9158, 0x9165, 0x9173, 0x9172, 0x91A2,
+ 0x91AF, 0x91AA, 0x91B4, 0x91BA, 0x9477, 0x9698, 0x973D, 0x9760,
+ 0x9771, 0x980C, 0x9873, 0x98C3, 0x9A45, 0x9B4D, 0x9B58, 0x9BC6,
+ 0x9BE1, 0x9BF1, 0x9D48, 0x9DCF, 0x9F08, 0x6271, 0x6697, 0x610F,
+ 0x8863, 0x9055, 0x907A, 0x78EF, 0x54E1, 0x2ED7, 0x2EBD, 0x53A9,
+ 0x74DC, 0x904B, 0x990C, 0x885E, 0x92B3, 0x95B1, 0x5EF6, 0x63F4,
+ 0x6CBF, 0x7159, 0x9060, 0x925B, 0x65BC, 0x5F80, 0x7FC1, 0x5378,
+ 0x97F3, 0x5316, 0x82B1, 0x83D3, 0x8CA8, 0x904E, 0x82BD, 0x96C5,
+ 0x9913, 0x5EFB, 0x7070, 0x5BB3, 0x6168, 0x6168, 0x6168, 0x69EA,
+ 0x6982, 0x676E, 0x89D2, 0x9694, 0x5272, 0x8F44, 0x938C, 0x82C5,
+ 0x5BD2, 0x74B0, 0x7DE9, 0x7F36, 0x9084, 0x9592, 0x97D3, 0x8218,
+ 0x5371, 0x559C, 0x3402, 0x3402, 0x5E7E, 0x65E3, 0x671F, 0x6A5F,
+ 0x8D77, 0x98E2, 0x5409, 0x55AB, 0x8650, 0x9006, 0x53CA, 0x5438,
+ 0x6025, 0x7D1A, 0x5DE8, 0x62D2, 0x8DDD, 0x9B5A, 0x9B5A, 0x537F,
+ 0x5F3A, 0x6050, 0x69C1, 0x6A4B, 0x6A4B, 0x9115, 0x97FF, 0x9957,
+ 0x6681, 0x2EA9, 0x8FD1, 0x5036, 0x77E9, 0x5177, 0x865E, 0x7A7A,
+ 0x9047, 0x6ADB, 0x5553, 0x5951, 0x6075, 0x6167, 0x8FCE, 0x5091,
+ 0x6F54, 0x7A74, 0x2EBC, 0x2EBC, 0x517C, 0x5238, 0x61B2, 0x6743,
+ 0x80A9, 0x8B19, 0x9063, 0x539F, 0x8A01, 0x6236, 0x96C7, 0x9867,
+ 0x5433, 0x5A1B, 0x8AA4, 0x5DE5, 0x614C, 0x6285, 0x63A7, 0x69CB,
+ 0x6D69, 0x6E2F, 0x8015, 0x8154, 0x8352, 0x8B1B, 0x8CFC, 0x543F,
+ 0x9177, 0x8170, 0x7511, 0x8FBC, 0x4ECA, 0x9396, 0x5EA7, 0x5F69,
+ 0x63A1, 0x6B72, 0x83DC, 0x51B4, 0x54B2, 0x524A, 0x7522, 0x9910,
+ 0x59FF, 0x59FF, 0x5DFF, 0x8AEE, 0x8AEE, 0x8CC7, 0x8CC7, 0x6B21,
+ 0x6B21, 0x6ECB, 0x73BA, 0x53F1, 0x6368, 0x659C, 0x90AA, 0x52FA,
+ 0x7235, 0x7235, 0x914C, 0x5F31, 0x4E3B, 0x53D7, 0x6388, 0x5468,
+ 0x7D42, 0x7FD2, 0x8846, 0x9031, 0x4F4F, 0x8853, 0x8FF0, 0x5DE1,
+ 0x9075, 0x9075, 0x6240, 0x66F8, 0x5973, 0x52DD, 0x5546, 0x5BB5,
+ 0x5C06, 0x2E8C, 0x2E8D, 0x5C19, 0x6D88, 0x785D, 0x8096, 0x4E08,
+ 0x5B82, 0x57CE, 0x60C5, 0x57F4, 0x98FE, 0x690D, 0x6B96, 0x98DF,
+ 0x98E0, 0x2EDE, 0x378D, 0x4FB5, 0x2E97, 0x6D78, 0x771F, 0x9032,
+ 0x4EBB, 0x4EBA, 0x5203, 0x5C0B, 0x8A0A, 0x8A0A, 0x8FC5, 0x8870,
+ 0x9042, 0x351F, 0x52E2, 0x6210, 0x76DB, 0x8056, 0x8980, 0x8AA0,
+ 0x8ACB, 0x975C, 0x975C, 0x7A05, 0x8106, 0x96BB, 0x7C4D, 0x7BC0,
+ 0x8AAA, 0x96EA, 0x7D76, 0x6247, 0x6F98, 0x7FA1, 0x8239, 0x9078,
+ 0x9077, 0x524D, 0x5168, 0x6383, 0x63F7, 0x7626, 0x8D70, 0x9001,
+ 0x906D, 0x9020, 0x2ECA, 0x901F, 0x8CCA, 0x5C0A, 0x5C0A, 0x59A5,
+ 0x6CF0, 0x9000, 0x902E, 0x968A, 0x9BDB, 0x5927, 0x3427, 0x7027,
+ 0x9054, 0x812B, 0x4E39, 0x6B4E, 0x70AD, 0x8A95, 0x6696, 0x5024,
+ 0x7F6E, 0x7BC9, 0x2EAE, 0x7B51, 0x9010, 0x67F1, 0x6CE8, 0x99D0,
+ 0x5F6B, 0x5FB5, 0x61F2, 0x671D, 0x6F6E, 0x8ABF, 0x76F4, 0x6715,
+ 0x6715, 0x589C, 0x8FFD, 0x901A, 0x576A, 0x91E3, 0x5448, 0x5E1D,
+ 0x7A0B, 0x7684, 0x9069, 0x8FED, 0x6DFB, 0x514E, 0x9014, 0x783A,
+ 0x5721, 0x571F, 0x51AC, 0x5510, 0x7CD6, 0x85E4, 0x8B04, 0x9003,
+ 0x900F, 0x9A30, 0x5C0E, 0x9053, 0x5451, 0x3B88, 0x5167, 0x8089,
+ 0x4E73, 0x5FCD, 0x8A8D, 0x5BE7, 0x7D0D, 0x8987, 0x6D3E, 0x80BA,
+ 0x535A, 0x8584, 0x8FEB, 0x7E1B, 0x8087, 0x4E37, 0x6F51, 0x91B1,
+ 0x4F34, 0x5224, 0x534A, 0x5E06, 0x7554, 0x6669, 0x8543, 0x907F,
+ 0x5FAE, 0x9F3B, 0x5339, 0x2EAA, 0x5F65, 0x59EC, 0x59EB, 0x8A55,
+ 0x5E99, 0x75C5, 0x5A66, 0x6577, 0x6D6E, 0x8CA0, 0x8CA0, 0x670D,
+ 0x8986, 0x4E19, 0x5E63, 0x5E73, 0x5F0A, 0x8511, 0x504F, 0x7DE8,
+ 0x8FD4, 0x904D, 0x7C3F, 0x5305, 0x5D29, 0x62B1, 0x670B, 0x7832,
+ 0x7E2B, 0x80DE, 0x840C, 0x90A6, 0x90A6, 0x98FD, 0x9D6C, 0x4EA1,
+ 0x5E3D, 0x5FD8, 0x5FD9, 0x623F, 0x671B, 0x671B, 0x5192, 0x6469,
+ 0x7FFB, 0x51E1, 0x78E8, 0x9B54, 0x2FC7, 0x69D9, 0x685D, 0x4FE3,
+ 0x53C8, 0x7E6D, 0x9EBF, 0x8108, 0x660E, 0x76DF, 0x8FF7, 0x5984,
+ 0x52D0, 0x76F2, 0x8017, 0x623E, 0x7D0B, 0x9580, 0x7D04, 0x8E8D,
+ 0x687A, 0x687A, 0x6801, 0x6109, 0x8AED, 0x8F38, 0x52C7, 0x6709,
+ 0x7336, 0x7336, 0x7337, 0x88D5, 0x904A, 0x66DC, 0x2EB7, 0x8981,
+ 0x990A, 0x7FCC, 0x7FFC, 0x8EB6, 0x862D, 0x7387, 0x9F8D, 0x9F8D,
+ 0x65C5, 0x6881, 0x71D0, 0x96A3, 0x9C57, 0x9E9F, 0x7C7B, 0x5EC9,
+ 0x6190, 0x9023, 0x6717, 0x8002, 0x8107, 0x50CA, 0x511A, 0x5154,
+ 0x5195, 0x2E87, 0x528D, 0x52D7, 0x52F9, 0x5349, 0x353E, 0x53DF,
+ 0x66FC, 0x5533, 0x55E4, 0x5455, 0x56C0, 0x5939, 0x5A1C, 0x5AC2,
+ 0x5B73, 0x5BC3, 0x5C14, 0x37E2, 0x5CE6, 0x5E54, 0x4E48, 0x5EE3,
+ 0x6097, 0x62D4, 0x62CC, 0x641C, 0x63C6, 0x6428, 0x8209, 0x631B,
+ 0x665F, 0x665F, 0x6663, 0x66F5, 0x675E, 0x689D, 0x688D, 0x69F6,
+ 0x6961, 0x5BE8, 0x5BE8, 0x69BB, 0x6BCC, 0x6F11, 0x6E17, 0x6F98,
+ 0x6CAA, 0x6CAA, 0x701B, 0x7162, 0x723B, 0x4E2C, 0x731C, 0x74CA,
+ 0x74EF, 0x7575, 0x75EC, 0x764E, 0x3FB1, 0x776A, 0x77A9, 0x7940,
+ 0x7953, 0x7953, 0x9F4B, 0x79AE, 0x9083, 0x7B53, 0x7C11, 0x7C14,
+ 0x4264, 0x7C50, 0x7C58, 0x7D46, 0x7D63, 0x7E22, 0x7E22, 0x7E48,
+ 0x7E35, 0x7E43, 0x7E8C, 0x7F50, 0x7F51, 0x7F51, 0x7F51, 0x7FC5,
+ 0x7FC6, 0x7FE9, 0x8141, 0x4453, 0x8258, 0x8279, 0x2EBF, 0x2EC0,
+ 0x82E3, 0x5179, 0x83A2, 0x8420, 0x83BD, 0x84F4, 0x856D, 0x8587,
+ 0x85F4, 0x4E55, 0x8737, 0x873B, 0x8805, 0x87BD, 0x867D, 0x8836,
+ 0x8944, 0x88C6, 0x89BD, 0x8ADB, 0x8B3E, 0x8B5A, 0x8D73, 0x8D99,
+ 0x8DCB, 0x8E34, 0x8E4A, 0x8FEF, 0x9087, 0x8FFA, 0x901E, 0x9035,
+ 0x9050, 0x8FC8, 0x9081, 0x908A, 0x908A, 0x908A, 0x908A, 0x908A,
+ 0x908A, 0x9089, 0x9089, 0x9089, 0x9089, 0x9089, 0x9089, 0x9089,
+ 0x9089, 0x9089, 0x9089, 0x9089, 0x9089, 0x92CF, 0x93DD, 0x95BC,
+ 0x9621, 0x96B2, 0x975C, 0x9839, 0x98EB, 0x9903, 0x9909, 0x9945,
+ 0x9945, 0x994B, 0x9A08, 0x9A5F, 0x9A65, 0x9AEF, 0x9B18, 0x9BDF,
+ 0x9D09, 0x9D08, 0x9EA5, 0x9ECC, 0x9F08, 0x9F4A, 0x9F63, 0x9F67,
+ 0x9F6C, 0x7199, 0x7199, 0x891C, 0x68C8, 0x66FB, 0x5F45, 0x5300,
+ 0x5389, 0x5953, 0xFA11, 0x6852, 0x6A73, 0x6D87, 0xFA15, 0x8A12,
+ 0x4E04, 0x4E05, 0x4E1F, 0x4E2B, 0x4E2F, 0x4E30, 0x4E40, 0x4E41,
+ 0x4E44, 0x4E5A, 0x4E7F, 0x4E8D, 0x4E96, 0x4EB9, 0x4ED0, 0x4EE0,
+ 0x4EFD, 0x4EFF, 0x4F0B, 0x4F15, 0x4F60, 0x4F3B, 0x4F49, 0x4F54,
+ 0x4F7A, 0x4F7D, 0x4F7E, 0x4F97, 0x4FBE, 0x4FCF, 0x4FFD, 0x5000,
+ 0x5001, 0x5010, 0x501B, 0x5027, 0x502E, 0x5057, 0x5066, 0x506A,
+ 0x503B, 0x508F, 0x5096, 0x509C, 0x50CC, 0x50E6, 0x50E9, 0x50EF,
+ 0x5108, 0x510B, 0x5110, 0x511B, 0x511E, 0x515F, 0x51A1, 0x51BC,
+ 0x51DE, 0x51EE, 0x51F4, 0x5201, 0x5202, 0x5213, 0x5249, 0x5261,
+ 0x5266, 0x5293, 0x52C8, 0x52F0, 0x530A, 0x530B, 0x533E, 0x534C,
+ 0x534B, 0x5361, 0x536C, 0x53AB, 0x53DA, 0x53E6, 0x53F5, 0x5427,
+ 0x544D, 0x5466, 0x546B, 0x5474, 0x548D, 0x5496, 0x54A1, 0x54AD,
+ 0x54B9, 0x54BF, 0x54C6, 0x54CD, 0x550E, 0x552B, 0x5535, 0x554A,
+ 0x5560, 0x5561, 0x5588, 0x558E, 0x5608, 0x560E, 0x560F, 0x5637,
+ 0x563F, 0x5649, 0x564B, 0x564F, 0x5666, 0x5669, 0x566F, 0x5671,
+ 0x5672, 0x5695, 0x569A, 0x56AC, 0x56AD, 0x56B1, 0x56C9, 0x56DD,
+ 0x56E4, 0x570A, 0x5715, 0x5723, 0x572F, 0x5733, 0x5734, 0x574C,
+ 0x5770, 0x578C, 0x579C, 0x57B8, 0x57E6, 0x57ED, 0x57F5, 0x57F6,
+ 0x57FF, 0x5809, 0x5820, 0x5832, 0x587C, 0x5880, 0x58A9, 0x58CE,
+ 0x58D0, 0x58D4, 0x58DA, 0x58E9, 0x590C, 0x5924, 0x592F, 0x5961,
+ 0x596D, 0x59CA, 0x59D2, 0x59DD, 0x59E3, 0x59E4, 0x5A04, 0x5A0C,
+ 0x5A23, 0x5A47, 0x5A55, 0x5A63, 0x5A6D, 0x5A7E, 0x5A9E, 0x5AA7,
+ 0x5AAC, 0x5AB3, 0x5AE0, 0x5B00, 0x5B19, 0x5B25, 0x5B2D, 0x5B41,
+ 0x5B7C, 0x5B7E, 0x5B7F, 0x5B8A, 0x5C23, 0x5C2B, 0x5C30, 0x5C63,
+ 0x5C69, 0x5C7C, 0x5CCB, 0x5CD2, 0x5CF4, 0x5D24, 0x5D26, 0x5D43,
+ 0x5D46, 0x5D4A, 0x5D92, 0x5D94, 0x5D99, 0x5DA0, 0x5DD8, 0x5DE0,
+ 0x5DF8, 0x5E00, 0x5E12, 0x5E14, 0x5E15, 0x5E18, 0x5E2E, 0x5E58,
+ 0x5E6B, 0x5E6C, 0x5EA8, 0x5EAA, 0x5EBE, 0x5EBF, 0x5ECB, 0x5ED2,
+ 0x5F07, 0x5F0E, 0x5F1C, 0x5F1D, 0x5F22, 0x5F28, 0x5F36, 0x5F3B,
+ 0x5F40, 0x5F50, 0x5F58, 0x5F64, 0x5F89, 0x5F9C, 0x5FA7, 0x5FA4,
+ 0x5FAF, 0x5FB8, 0x5FC4, 0x5FC9, 0x5FE1, 0x5FE9, 0x5FED, 0x5FFC,
+ 0x6017, 0x601A, 0x6033, 0x6061, 0x607F, 0x609E, 0x60A4, 0x60B0,
+ 0x60CB, 0x60DB, 0x60F8, 0x6112, 0x6113, 0x6114, 0x611C, 0x617C,
+ 0x618D, 0x619F, 0x61A8, 0x61C2, 0x61DF, 0x6215, 0x6229, 0x6243,
+ 0x6246, 0x624C, 0x6251, 0x6256, 0x62C4, 0x62FC, 0x630A, 0x630D,
+ 0x6318, 0x6339, 0x6342, 0x6343, 0x6365, 0x6374, 0x637D, 0x6384,
+ 0x6387, 0x6390, 0x639E, 0x63D1, 0x63DC, 0x6409, 0x6410, 0x6422,
+ 0x6454, 0x645B, 0x646D, 0x647B, 0x64BE, 0x64BF, 0x64E5, 0x64F7,
+ 0x64FB, 0x6504, 0x6516, 0x6519, 0x6547, 0x6567, 0x6581, 0x6585,
+ 0x65C2, 0x65F0, 0x65F2, 0x662C, 0x664C, 0x665B, 0x665C, 0x6661,
+ 0x666B, 0x6677, 0x66A4, 0x66C8, 0x66EC, 0x6705, 0x6713, 0x6733,
+ 0x6748, 0x674C, 0x6776, 0x677B, 0x67B0, 0x67B2, 0x67F9, 0x67D7,
+ 0x67D9, 0x67F0, 0x682C, 0x6830, 0x6831, 0x685B, 0x6872, 0x6875,
+ 0x687A, 0x6884, 0x68A5, 0x68B2, 0x68D0, 0x68D6, 0x68E8, 0x68ED,
+ 0x68F0, 0x68F1, 0x68FC, 0x6911, 0x6913, 0x6935, 0x693B, 0x6957,
+ 0x6963, 0x6972, 0x697F, 0x6980, 0x69A6, 0x69AD, 0x69B7, 0x69D6,
+ 0x69D7, 0x6A01, 0x6A0F, 0x6A15, 0x6A28, 0x6A34, 0x6A3E, 0x6A45,
+ 0x6A50, 0x6A51, 0x6A56, 0x6A5B, 0x6A83, 0x6A89, 0x6A91, 0x6A9D,
+ 0x6A9E, 0x6A9F, 0x6ADC, 0x6AE7, 0x6AEC, 0x6B1E, 0x6B24, 0x6B35,
+ 0x6B46, 0x6B56, 0x6B60, 0x6B82, 0x6BBE, 0x6BE1, 0x6BF1, 0x6C10,
+ 0x6C33, 0x6C35, 0x6C3A, 0x6C59, 0x6C76, 0x6C7B, 0x6C85, 0x6C95,
+ 0x6C9C, 0x6CD0, 0x6CD4, 0x6CD6, 0x6CE0, 0x6CEB, 0x6CEC, 0x6CEE,
+ 0x6D0A, 0x6D0E, 0x6D11, 0x6D2E, 0x6D57, 0x6D5E, 0x6D65, 0x6D82,
+ 0x6DBF, 0x6DC4, 0x6DCA, 0x6DD6, 0x6DE9, 0x6E22, 0x6E51, 0x6EC7,
+ 0x6ECA, 0x6ECE, 0x6EFD, 0x6F1A, 0x6F2A, 0x6F2F, 0x6F33, 0x6F5A,
+ 0x6F5E, 0x6F62, 0x6F7D, 0x6F8B, 0x6F8D, 0x6F92, 0x6F94, 0x6F9A,
+ 0x6FA7, 0x6FA8, 0x6FB6, 0x6FDA, 0x6FDE, 0x6FF9, 0x7039, 0x703C,
+ 0x704A, 0x7054, 0x705D, 0x705E, 0x7064, 0x706C, 0x707E, 0x7081,
+ 0x7095, 0x70B7, 0x70D3, 0x70D4, 0x70D8, 0x70DC, 0x7107, 0x7120,
+ 0x7131, 0x714A, 0x7152, 0x7160, 0x7179, 0x7192, 0x71B3, 0x71CB,
+ 0x71D3, 0x71D6, 0x7200, 0x721D, 0x722B, 0x7238, 0x7241, 0x7253,
+ 0x7255, 0x7256, 0x725C, 0x728D, 0x72AD, 0x72B4, 0x72C7, 0x72FB,
+ 0x7304, 0x7305, 0x7328, 0x7331, 0x7343, 0x736C, 0x737C, 0x7383,
+ 0x7385, 0x7386, 0x7395, 0x739E, 0x739F, 0x73A0, 0x73A6, 0x73AB,
+ 0x73B5, 0x73B7, 0x73BC, 0x73CF, 0x73D9, 0x73E9, 0x73F4, 0x73FD,
+ 0x7404, 0x740A, 0x741A, 0x741B, 0x7424, 0x7428, 0x742C, 0x742F,
+ 0x7430, 0x7431, 0x7439, 0x7444, 0x7447, 0x744B, 0x744D, 0x7451,
+ 0x7457, 0x7466, 0x746B, 0x7471, 0x7480, 0x7485, 0x7486, 0x7487,
+ 0x7490, 0x7498, 0x749C, 0x74A0, 0x74A3, 0x74A8, 0x74AB, 0x74B5,
+ 0x74BF, 0x74C8, 0x74DA, 0x74DE, 0x754E, 0x7579, 0x7581, 0x7590,
+ 0x7592, 0x7593, 0x75B4, 0x75E4, 0x75F9, 0x7600, 0x760A, 0x7615,
+ 0x7616, 0x7619, 0x761E, 0x762D, 0x7635, 0x7643, 0x764B, 0x7665,
+ 0x766D, 0x766F, 0x7671, 0x7674, 0x76A4, 0x76A5, 0x76C5, 0x76CC,
+ 0x76EC, 0x76FC, 0x7734, 0x7736, 0x775C, 0x775F, 0x7760, 0x7772,
+ 0x777D, 0x7795, 0x77AA, 0x77E6, 0x77F0, 0x77F4, 0x7806, 0x7822,
+ 0x782D, 0x782E, 0x7830, 0x7835, 0x7868, 0x789E, 0x78C8, 0x78CC,
+ 0x78CE, 0x78E4, 0x78E0, 0x78E1, 0x78F2, 0x78F7, 0x78FB, 0x7931,
+ 0x7934, 0x793B, 0x793D, 0x7945, 0x795B, 0x795C, 0x798B, 0x7996,
+ 0x7998, 0x79B8, 0x79BB, 0x79CA, 0x79DA, 0x7A03, 0x7A09, 0x7A11,
+ 0x7A1E, 0x7A2D, 0x7A39, 0x7A45, 0x7A4C, 0x7A5D, 0x7A60, 0x7A6D,
+ 0x7A78, 0x7AA0, 0x7AA3, 0x7AB3, 0x7ABB, 0x7ABC, 0x7AC6, 0x7B07,
+ 0x7B14, 0x7B27, 0x7B31, 0x7B47, 0x7B4E, 0x7B60, 0x7B69, 0x7B6D,
+ 0x7B72, 0x7B91, 0x7BAF, 0x7BD7, 0x7BD9, 0x7C0B, 0x7C0F, 0x7C20,
+ 0x7C26, 0x7C31, 0x7C36, 0x7C51, 0x7C59, 0x7C67, 0x7C6E, 0x7C70,
+ 0x7CBC, 0x7CBF, 0x7CC8, 0x7CC9, 0x7CD7, 0x7CD9, 0x7CDD, 0x7CEB,
+ 0x7D07, 0x7D08, 0x7D09, 0x7D13, 0x7D1D, 0x7D23, 0x7D41, 0x7D53,
+ 0x7D59, 0x7D5D, 0x7D7A, 0x7D86, 0x7D8B, 0x7D8C, 0x7DCC, 0x7DEB,
+ 0x7DF1, 0x7DF9, 0x7E08, 0x7E11, 0x7E15, 0x7E20, 0x7E47, 0x7E62,
+ 0x7E6E, 0x7E73, 0x7E8D, 0x7E91, 0x7E98, 0x7F44, 0x7F4F, 0x7F52,
+ 0x7F53, 0x7F61, 0x7F91, 0x7FBF, 0x7FCE, 0x7FDF, 0x7FE5, 0x7FEC,
+ 0x7FEE, 0x7FEF, 0x7FFA, 0x800E, 0x8011, 0x8014, 0x8024, 0x8026,
+ 0x803A, 0x803C, 0x8060, 0x8071, 0x8075, 0x809E, 0x80A6, 0x80AB,
+ 0x80D7, 0x80D8, 0x8116, 0x8118, 0x813A, 0x814A, 0x814C, 0x8181,
+ 0x8184, 0x81B4, 0x81CF, 0x81F9, 0x8203, 0x8221, 0x8232, 0x8234,
+ 0x8246, 0x824B, 0x824F, 0x828E, 0x82AE, 0x82B7, 0x82BE, 0x82C6,
+ 0x82FE, 0x8343, 0x8351, 0x8355, 0x8386, 0x838D, 0x8392, 0x8398,
+ 0x83A9, 0x83BF, 0x83C0, 0x83EA, 0x840F, 0x8411, 0x844A, 0x8476,
+ 0x84A8, 0x84AF, 0x84C0, 0x84C2, 0x84F0, 0x84FD, 0x850C, 0x8534,
+ 0x855E, 0x858F, 0x85B7, 0x85CE, 0x85AD, 0x8612, 0x8629, 0x8652,
+ 0x8663, 0x866C, 0x866F, 0x867A, 0x868D, 0x8691, 0x8698, 0x86A7,
+ 0x86A8, 0x86FA, 0x86FD, 0x870B, 0x8713, 0x8719, 0x871E, 0x8728,
+ 0x873E, 0x8771, 0x8788, 0x8799, 0x87AC, 0x87AD, 0x87B5, 0x87D6,
+ 0x87EB, 0x87ED, 0x8801, 0x8803, 0x8806, 0x880B, 0x8814, 0x881C,
+ 0x8856, 0x885F, 0x8864, 0x8898, 0x88AA, 0x88BD, 0x88BE, 0x88CA,
+ 0x88D2, 0x88DB, 0x88F0, 0x88F1, 0x8906, 0x8918, 0x8919, 0x891A,
+ 0x8927, 0x8930, 0x893E, 0x897B, 0x89D4, 0x89D6, 0x89E5, 0x89F1,
+ 0x8A07, 0x8A0F, 0x8A15, 0x8A22, 0x8A4E, 0x8A7F, 0x8AF4, 0x8B1F,
+ 0x8B37, 0x8B43, 0x8B44, 0x8B54, 0x8B9C, 0x8B9E, 0x8C47, 0x8C54,
+ 0x8C73, 0x8CA4, 0x8CD9, 0x8CE1, 0x8CF8, 0x8CFE, 0x8D1B, 0x8D69,
+ 0x8D6C, 0x8D84, 0x8D8D, 0x8D95, 0x8DA6, 0x8DC6, 0x8DCE, 0x8DE4,
+ 0x8DEC, 0x8E20, 0x8E4B, 0x8E6C, 0x8E70, 0x8E7A, 0x8E92, 0x8EAE,
+ 0x8EB3, 0x8ED1, 0x8ED4, 0x8EF9, 0x8F17, 0x8F36, 0x8FA6, 0x8FB5,
+ 0x8FB6, 0x8FC6, 0x8FE0, 0x8FE4, 0x8FF6, 0x9002, 0x902C, 0x9044,
+ 0x9088, 0x9095, 0x9099, 0x909B, 0x90A2, 0x90B4, 0x90D7, 0x90DD,
+ 0x90F4, 0x9117, 0x911C, 0x9131, 0x913A, 0x913D, 0x9148, 0x915B,
+ 0x9161, 0x9164, 0x918E, 0x919E, 0x91A8, 0x91AD, 0x91AE, 0x91B2,
+ 0x91BC, 0x91F0, 0x91F7, 0x91FB, 0x9207, 0x9228, 0x9233, 0x9238,
+ 0x9243, 0x9247, 0x924F, 0x9260, 0x92C2, 0x92CB, 0x92CC, 0x92DF,
+ 0x930D, 0x9315, 0x931F, 0x9327, 0x9347, 0x9352, 0x9365, 0x936A,
+ 0x936D, 0x939B, 0x93BA, 0x93A9, 0x93C1, 0x93CA, 0x93E2, 0x93FA,
+ 0x93FD, 0x940F, 0x9434, 0x943F, 0x9455, 0x946B, 0x9472, 0x9578,
+ 0x95A6, 0x95A9, 0x95AB, 0x95B4, 0x95BD, 0x95DA, 0x961D, 0x9641,
+ 0x9658, 0x9684, 0x96A4, 0x96A9, 0x96D2, 0x5DB2, 0x96DE, 0x96E9,
+ 0x96F1, 0x9702, 0x9709, 0x975A, 0x9763, 0x976E, 0x9773, 0x979A,
+ 0x97A2, 0x97B5, 0x97B6, 0x97D9, 0x97DE, 0x97F4, 0x980A, 0x980E,
+ 0x981E, 0x9823, 0x982B, 0x983E, 0x9852, 0x9853, 0x9859, 0x986C,
+ 0x98B8, 0x98BA, 0x98BF, 0x98C8, 0x98E5, 0x9932, 0x9933, 0x9940,
+ 0x994D, 0x995C, 0x995F, 0x99B1, 0x99B9, 0x99BA, 0x99C9, 0x9A02,
+ 0x9A16, 0x9A24, 0x9A27, 0x9A2D, 0x9A2E, 0x9A36, 0x9A38, 0x9A4A,
+ 0x9A56, 0x9AB5, 0x9AB6, 0x9AF9, 0x9B03, 0x9B20, 0x9B33, 0x9B34,
+ 0x9B73, 0x9B79, 0x9BA7, 0x9BC1, 0x9BC7, 0x9BD7, 0x9BE7, 0x9BEB,
+ 0x9BF7, 0x9BFA, 0x9BFD, 0x9C0B, 0x9C27, 0x9C2A, 0x9C36, 0x9C41,
+ 0x9C53, 0x9C63, 0x9C6A, 0x9C77, 0x9D02, 0x9D42, 0x9D47, 0x9D63,
+ 0x9D69, 0x9D7C, 0x9D7E, 0x9D8D, 0x9DB1, 0x9DC3, 0x9DC7, 0x9DD6,
+ 0x9DDF, 0x9DEB, 0x9DF4, 0x9E15, 0x9E1D, 0x9EA4, 0x9EA8, 0x9EAC,
+ 0x9EE7, 0x9EEE, 0x9F10, 0x9F12, 0x9F17, 0x9F19, 0x9F2F, 0x9F37,
+ 0x9F39, 0x9F41, 0x9F45, 0x9F57, 0x9F68, 0x9F71, 0x9F75, 0x9F90,
+ 0x9F94, 0x9FA2, 0x4E30, 0x3405, 0x4F60, 0x5620, 0x5ECB, 0x2E95,
+ 0x60A4, 0x69D7, 0x6B24, 0x6FF9, 0x6EE6, 0x71B3, 0x2EA4, 0x7AC6,
+ 0x7F61, 0x8071, 0x809E, 0x2ECC, 0x91F0, 0x5DB2, 0x97DE, 0x4FD3,
+ 0x50D9, 0x50F0, 0x51C3, 0x5676, 0x6A54, 0x6D01, 0x6DD0, 0x6E42,
+ 0x6ED9, 0x73E4, 0x7421, 0x756C, 0x7851, 0x87F5, 0xFFFD, 0x73A8,
+ 0x3AF3, 0x34DB, 0x440C, 0x3E8A, 0xFFFD, 0xFFFD, 0x4BE8, 0xFFFD,
+ 0x3EDA, 0x3B22, 0xFFFD, 0x457A, 0x4093, 0xFFFD, 0x4665, 0x4103,
+ 0x4293, 0x46AE, 0x3488, 0xFFFD,
+};
diff --git a/core/src/fpdfapi/fpdf_cmaps/Japan1/EUC-H_1.cpp b/core/src/fpdfapi/fpdf_cmaps/Japan1/EUC-H_1.cpp
index f0e01e1e23..7ea5866db4 100644
--- a/core/src/fpdfapi/fpdf_cmaps/Japan1/EUC-H_1.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/Japan1/EUC-H_1.cpp
@@ -1,48 +1,48 @@
-// 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
-
-extern const unsigned short g_FXCMAP_EUC_H_1[120 * 3] = {
- 0x0020, 0x007E, 0x00E7, 0x8EA0, 0x8EDF, 0x0146, 0xA1A1, 0xA1FE, 0x0279,
- 0xA2A1, 0xA2AE, 0x02D7, 0xA2BA, 0xA2C1, 0x02E5, 0xA2CA, 0xA2D0, 0x02ED,
- 0xA2DC, 0xA2EA, 0x02F4, 0xA2F2, 0xA2F9, 0x0303, 0xA2FE, 0xA2FE, 0x030B,
- 0xA3B0, 0xA3B9, 0x030C, 0xA3C1, 0xA3DA, 0x0316, 0xA3E1, 0xA3FA, 0x0330,
- 0xA4A1, 0xA4F3, 0x034A, 0xA5A1, 0xA5F6, 0x039D, 0xA6A1, 0xA6B8, 0x03F3,
- 0xA6C1, 0xA6D8, 0x040B, 0xA7A1, 0xA7C1, 0x0423, 0xA7D1, 0xA7F1, 0x0444,
- 0xA8A1, 0xA8A1, 0x1D37, 0xA8A2, 0xA8A2, 0x1D39, 0xA8A3, 0xA8A3, 0x1D43,
- 0xA8A4, 0xA8A4, 0x1D47, 0xA8A5, 0xA8A5, 0x1D4F, 0xA8A6, 0xA8A6, 0x1D4B,
- 0xA8A7, 0xA8A7, 0x1D53, 0xA8A8, 0xA8A8, 0x1D63, 0xA8A9, 0xA8A9, 0x1D5B,
- 0xA8AA, 0xA8AA, 0x1D6B, 0xA8AB, 0xA8AB, 0x1D73, 0xA8AC, 0xA8AC, 0x1D38,
- 0xA8AD, 0xA8AD, 0x1D3A, 0xA8AE, 0xA8AE, 0x1D46, 0xA8AF, 0xA8AF, 0x1D4A,
- 0xA8B0, 0xA8B0, 0x1D52, 0xA8B1, 0xA8B1, 0x1D4E, 0xA8B2, 0xA8B2, 0x1D5A,
- 0xA8B3, 0xA8B3, 0x1D6A, 0xA8B4, 0xA8B4, 0x1D62, 0xA8B5, 0xA8B5, 0x1D72,
- 0xA8B6, 0xA8B6, 0x1D82, 0xA8B7, 0xA8B7, 0x1D57, 0xA8B8, 0xA8B8, 0x1D66,
- 0xA8B9, 0xA8B9, 0x1D5F, 0xA8BA, 0xA8BA, 0x1D6E, 0xA8BB, 0xA8BB, 0x1D76,
- 0xA8BC, 0xA8BC, 0x1D54, 0xA8BD, 0xA8BD, 0x1D67, 0xA8BE, 0xA8BE, 0x1D5C,
- 0xA8BF, 0xA8BF, 0x1D6F, 0xA8C0, 0xA8C0, 0x1D79, 0xB0A1, 0xB0FE, 0x0465,
- 0xB1A1, 0xB1FE, 0x04C3, 0xB2A1, 0xB2FE, 0x0521, 0xB3A1, 0xB3FE, 0x057F,
- 0xB4A1, 0xB4FE, 0x05DD, 0xB5A1, 0xB5FE, 0x063B, 0xB6A1, 0xB6FE, 0x0699,
- 0xB7A1, 0xB7FE, 0x06F7, 0xB8A1, 0xB8FE, 0x0755, 0xB9A1, 0xB9FE, 0x07B3,
- 0xBAA1, 0xBAFE, 0x0811, 0xBBA1, 0xBBFE, 0x086F, 0xBCA1, 0xBCFE, 0x08CD,
- 0xBDA1, 0xBDFE, 0x092B, 0xBEA1, 0xBEFE, 0x0989, 0xBFA1, 0xBFFE, 0x09E7,
- 0xC0A1, 0xC0FE, 0x0A45, 0xC1A1, 0xC1FE, 0x0AA3, 0xC2A1, 0xC2FE, 0x0B01,
- 0xC3A1, 0xC3FE, 0x0B5F, 0xC4A1, 0xC4FE, 0x0BBD, 0xC5A1, 0xC5FE, 0x0C1B,
- 0xC6A1, 0xC6FE, 0x0C79, 0xC7A1, 0xC7FE, 0x0CD7, 0xC8A1, 0xC8FE, 0x0D35,
- 0xC9A1, 0xC9FE, 0x0D93, 0xCAA1, 0xCAFE, 0x0DF1, 0xCBA1, 0xCBFE, 0x0E4F,
- 0xCCA1, 0xCCFE, 0x0EAD, 0xCDA1, 0xCDFE, 0x0F0B, 0xCEA1, 0xCEFE, 0x0F69,
- 0xCFA1, 0xCFD3, 0x0FC7, 0xD0A1, 0xD0FE, 0x0FFA, 0xD1A1, 0xD1FE, 0x1058,
- 0xD2A1, 0xD2FE, 0x10B6, 0xD3A1, 0xD3FE, 0x1114, 0xD4A1, 0xD4FE, 0x1172,
- 0xD5A1, 0xD5FE, 0x11D0, 0xD6A1, 0xD6FE, 0x122E, 0xD7A1, 0xD7FE, 0x128C,
- 0xD8A1, 0xD8FE, 0x12EA, 0xD9A1, 0xD9FE, 0x1348, 0xDAA1, 0xDAFE, 0x13A6,
- 0xDBA1, 0xDBFE, 0x1404, 0xDCA1, 0xDCFE, 0x1462, 0xDDA1, 0xDDFE, 0x14C0,
- 0xDEA1, 0xDEFE, 0x151E, 0xDFA1, 0xDFFE, 0x157C, 0xE0A1, 0xE0FE, 0x15DA,
- 0xE1A1, 0xE1FE, 0x1638, 0xE2A1, 0xE2FE, 0x1696, 0xE3A1, 0xE3FE, 0x16F4,
- 0xE4A1, 0xE4FE, 0x1752, 0xE5A1, 0xE5FE, 0x17B0, 0xE6A1, 0xE6FE, 0x180E,
- 0xE7A1, 0xE7FE, 0x186C, 0xE8A1, 0xE8FE, 0x18CA, 0xE9A1, 0xE9FE, 0x1928,
- 0xEAA1, 0xEAFE, 0x1986, 0xEBA1, 0xEBFE, 0x19E4, 0xECA1, 0xECFE, 0x1A42,
- 0xEDA1, 0xEDFE, 0x1AA0, 0xEEA1, 0xEEFE, 0x1AFE, 0xEFA1, 0xEFFE, 0x1B5C,
- 0xF0A1, 0xF0FE, 0x1BBA, 0xF1A1, 0xF1FE, 0x1C18, 0xF2A1, 0xF2FE, 0x1C76,
- 0xF3A1, 0xF3FE, 0x1CD4, 0xF4A1, 0xF4A4, 0x1D32, 0xF4A5, 0xF4A6, 0x205C,
-};
+// 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
+
+extern const unsigned short g_FXCMAP_EUC_H_1[120 * 3] = {
+ 0x0020, 0x007E, 0x00E7, 0x8EA0, 0x8EDF, 0x0146, 0xA1A1, 0xA1FE, 0x0279,
+ 0xA2A1, 0xA2AE, 0x02D7, 0xA2BA, 0xA2C1, 0x02E5, 0xA2CA, 0xA2D0, 0x02ED,
+ 0xA2DC, 0xA2EA, 0x02F4, 0xA2F2, 0xA2F9, 0x0303, 0xA2FE, 0xA2FE, 0x030B,
+ 0xA3B0, 0xA3B9, 0x030C, 0xA3C1, 0xA3DA, 0x0316, 0xA3E1, 0xA3FA, 0x0330,
+ 0xA4A1, 0xA4F3, 0x034A, 0xA5A1, 0xA5F6, 0x039D, 0xA6A1, 0xA6B8, 0x03F3,
+ 0xA6C1, 0xA6D8, 0x040B, 0xA7A1, 0xA7C1, 0x0423, 0xA7D1, 0xA7F1, 0x0444,
+ 0xA8A1, 0xA8A1, 0x1D37, 0xA8A2, 0xA8A2, 0x1D39, 0xA8A3, 0xA8A3, 0x1D43,
+ 0xA8A4, 0xA8A4, 0x1D47, 0xA8A5, 0xA8A5, 0x1D4F, 0xA8A6, 0xA8A6, 0x1D4B,
+ 0xA8A7, 0xA8A7, 0x1D53, 0xA8A8, 0xA8A8, 0x1D63, 0xA8A9, 0xA8A9, 0x1D5B,
+ 0xA8AA, 0xA8AA, 0x1D6B, 0xA8AB, 0xA8AB, 0x1D73, 0xA8AC, 0xA8AC, 0x1D38,
+ 0xA8AD, 0xA8AD, 0x1D3A, 0xA8AE, 0xA8AE, 0x1D46, 0xA8AF, 0xA8AF, 0x1D4A,
+ 0xA8B0, 0xA8B0, 0x1D52, 0xA8B1, 0xA8B1, 0x1D4E, 0xA8B2, 0xA8B2, 0x1D5A,
+ 0xA8B3, 0xA8B3, 0x1D6A, 0xA8B4, 0xA8B4, 0x1D62, 0xA8B5, 0xA8B5, 0x1D72,
+ 0xA8B6, 0xA8B6, 0x1D82, 0xA8B7, 0xA8B7, 0x1D57, 0xA8B8, 0xA8B8, 0x1D66,
+ 0xA8B9, 0xA8B9, 0x1D5F, 0xA8BA, 0xA8BA, 0x1D6E, 0xA8BB, 0xA8BB, 0x1D76,
+ 0xA8BC, 0xA8BC, 0x1D54, 0xA8BD, 0xA8BD, 0x1D67, 0xA8BE, 0xA8BE, 0x1D5C,
+ 0xA8BF, 0xA8BF, 0x1D6F, 0xA8C0, 0xA8C0, 0x1D79, 0xB0A1, 0xB0FE, 0x0465,
+ 0xB1A1, 0xB1FE, 0x04C3, 0xB2A1, 0xB2FE, 0x0521, 0xB3A1, 0xB3FE, 0x057F,
+ 0xB4A1, 0xB4FE, 0x05DD, 0xB5A1, 0xB5FE, 0x063B, 0xB6A1, 0xB6FE, 0x0699,
+ 0xB7A1, 0xB7FE, 0x06F7, 0xB8A1, 0xB8FE, 0x0755, 0xB9A1, 0xB9FE, 0x07B3,
+ 0xBAA1, 0xBAFE, 0x0811, 0xBBA1, 0xBBFE, 0x086F, 0xBCA1, 0xBCFE, 0x08CD,
+ 0xBDA1, 0xBDFE, 0x092B, 0xBEA1, 0xBEFE, 0x0989, 0xBFA1, 0xBFFE, 0x09E7,
+ 0xC0A1, 0xC0FE, 0x0A45, 0xC1A1, 0xC1FE, 0x0AA3, 0xC2A1, 0xC2FE, 0x0B01,
+ 0xC3A1, 0xC3FE, 0x0B5F, 0xC4A1, 0xC4FE, 0x0BBD, 0xC5A1, 0xC5FE, 0x0C1B,
+ 0xC6A1, 0xC6FE, 0x0C79, 0xC7A1, 0xC7FE, 0x0CD7, 0xC8A1, 0xC8FE, 0x0D35,
+ 0xC9A1, 0xC9FE, 0x0D93, 0xCAA1, 0xCAFE, 0x0DF1, 0xCBA1, 0xCBFE, 0x0E4F,
+ 0xCCA1, 0xCCFE, 0x0EAD, 0xCDA1, 0xCDFE, 0x0F0B, 0xCEA1, 0xCEFE, 0x0F69,
+ 0xCFA1, 0xCFD3, 0x0FC7, 0xD0A1, 0xD0FE, 0x0FFA, 0xD1A1, 0xD1FE, 0x1058,
+ 0xD2A1, 0xD2FE, 0x10B6, 0xD3A1, 0xD3FE, 0x1114, 0xD4A1, 0xD4FE, 0x1172,
+ 0xD5A1, 0xD5FE, 0x11D0, 0xD6A1, 0xD6FE, 0x122E, 0xD7A1, 0xD7FE, 0x128C,
+ 0xD8A1, 0xD8FE, 0x12EA, 0xD9A1, 0xD9FE, 0x1348, 0xDAA1, 0xDAFE, 0x13A6,
+ 0xDBA1, 0xDBFE, 0x1404, 0xDCA1, 0xDCFE, 0x1462, 0xDDA1, 0xDDFE, 0x14C0,
+ 0xDEA1, 0xDEFE, 0x151E, 0xDFA1, 0xDFFE, 0x157C, 0xE0A1, 0xE0FE, 0x15DA,
+ 0xE1A1, 0xE1FE, 0x1638, 0xE2A1, 0xE2FE, 0x1696, 0xE3A1, 0xE3FE, 0x16F4,
+ 0xE4A1, 0xE4FE, 0x1752, 0xE5A1, 0xE5FE, 0x17B0, 0xE6A1, 0xE6FE, 0x180E,
+ 0xE7A1, 0xE7FE, 0x186C, 0xE8A1, 0xE8FE, 0x18CA, 0xE9A1, 0xE9FE, 0x1928,
+ 0xEAA1, 0xEAFE, 0x1986, 0xEBA1, 0xEBFE, 0x19E4, 0xECA1, 0xECFE, 0x1A42,
+ 0xEDA1, 0xEDFE, 0x1AA0, 0xEEA1, 0xEEFE, 0x1AFE, 0xEFA1, 0xEFFE, 0x1B5C,
+ 0xF0A1, 0xF0FE, 0x1BBA, 0xF1A1, 0xF1FE, 0x1C18, 0xF2A1, 0xF2FE, 0x1C76,
+ 0xF3A1, 0xF3FE, 0x1CD4, 0xF4A1, 0xF4A4, 0x1D32, 0xF4A5, 0xF4A6, 0x205C,
+};
diff --git a/core/src/fpdfapi/fpdf_cmaps/Japan1/H_1.cpp b/core/src/fpdfapi/fpdf_cmaps/Japan1/H_1.cpp
index e14e699c8d..43076a0ace 100644
--- a/core/src/fpdfapi/fpdf_cmaps/Japan1/H_1.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/Japan1/H_1.cpp
@@ -1,48 +1,48 @@
-// 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
-
-extern const unsigned short g_FXCMAP_H_1[118 * 3] = {
- 0x2121, 0x217E, 0x0279, 0x2221, 0x222E, 0x02D7, 0x223A, 0x2241, 0x02E5,
- 0x224A, 0x2250, 0x02ED, 0x225C, 0x226A, 0x02F4, 0x2272, 0x2279, 0x0303,
- 0x227E, 0x227E, 0x030B, 0x2330, 0x2339, 0x030C, 0x2341, 0x235A, 0x0316,
- 0x2361, 0x237A, 0x0330, 0x2421, 0x2473, 0x034A, 0x2521, 0x2576, 0x039D,
- 0x2621, 0x2638, 0x03F3, 0x2641, 0x2658, 0x040B, 0x2721, 0x2741, 0x0423,
- 0x2751, 0x2771, 0x0444, 0x2821, 0x2821, 0x1D37, 0x2822, 0x2822, 0x1D39,
- 0x2823, 0x2823, 0x1D43, 0x2824, 0x2824, 0x1D47, 0x2825, 0x2825, 0x1D4F,
- 0x2826, 0x2826, 0x1D4B, 0x2827, 0x2827, 0x1D53, 0x2828, 0x2828, 0x1D63,
- 0x2829, 0x2829, 0x1D5B, 0x282A, 0x282A, 0x1D6B, 0x282B, 0x282B, 0x1D73,
- 0x282C, 0x282C, 0x1D38, 0x282D, 0x282D, 0x1D3A, 0x282E, 0x282E, 0x1D46,
- 0x282F, 0x282F, 0x1D4A, 0x2830, 0x2830, 0x1D52, 0x2831, 0x2831, 0x1D4E,
- 0x2832, 0x2832, 0x1D5A, 0x2833, 0x2833, 0x1D6A, 0x2834, 0x2834, 0x1D62,
- 0x2835, 0x2835, 0x1D72, 0x2836, 0x2836, 0x1D82, 0x2837, 0x2837, 0x1D57,
- 0x2838, 0x2838, 0x1D66, 0x2839, 0x2839, 0x1D5F, 0x283A, 0x283A, 0x1D6E,
- 0x283B, 0x283B, 0x1D76, 0x283C, 0x283C, 0x1D54, 0x283D, 0x283D, 0x1D67,
- 0x283E, 0x283E, 0x1D5C, 0x283F, 0x283F, 0x1D6F, 0x2840, 0x2840, 0x1D79,
- 0x3021, 0x307E, 0x0465, 0x3121, 0x317E, 0x04C3, 0x3221, 0x327E, 0x0521,
- 0x3321, 0x337E, 0x057F, 0x3421, 0x347E, 0x05DD, 0x3521, 0x357E, 0x063B,
- 0x3621, 0x367E, 0x0699, 0x3721, 0x377E, 0x06F7, 0x3821, 0x387E, 0x0755,
- 0x3921, 0x397E, 0x07B3, 0x3A21, 0x3A7E, 0x0811, 0x3B21, 0x3B7E, 0x086F,
- 0x3C21, 0x3C7E, 0x08CD, 0x3D21, 0x3D7E, 0x092B, 0x3E21, 0x3E7E, 0x0989,
- 0x3F21, 0x3F7E, 0x09E7, 0x4021, 0x407E, 0x0A45, 0x4121, 0x417E, 0x0AA3,
- 0x4221, 0x427E, 0x0B01, 0x4321, 0x437E, 0x0B5F, 0x4421, 0x447E, 0x0BBD,
- 0x4521, 0x457E, 0x0C1B, 0x4621, 0x467E, 0x0C79, 0x4721, 0x477E, 0x0CD7,
- 0x4821, 0x487E, 0x0D35, 0x4921, 0x497E, 0x0D93, 0x4A21, 0x4A7E, 0x0DF1,
- 0x4B21, 0x4B7E, 0x0E4F, 0x4C21, 0x4C7E, 0x0EAD, 0x4D21, 0x4D7E, 0x0F0B,
- 0x4E21, 0x4E7E, 0x0F69, 0x4F21, 0x4F53, 0x0FC7, 0x5021, 0x507E, 0x0FFA,
- 0x5121, 0x517E, 0x1058, 0x5221, 0x527E, 0x10B6, 0x5321, 0x537E, 0x1114,
- 0x5421, 0x547E, 0x1172, 0x5521, 0x557E, 0x11D0, 0x5621, 0x567E, 0x122E,
- 0x5721, 0x577E, 0x128C, 0x5821, 0x587E, 0x12EA, 0x5921, 0x597E, 0x1348,
- 0x5A21, 0x5A7E, 0x13A6, 0x5B21, 0x5B7E, 0x1404, 0x5C21, 0x5C7E, 0x1462,
- 0x5D21, 0x5D7E, 0x14C0, 0x5E21, 0x5E7E, 0x151E, 0x5F21, 0x5F7E, 0x157C,
- 0x6021, 0x607E, 0x15DA, 0x6121, 0x617E, 0x1638, 0x6221, 0x627E, 0x1696,
- 0x6321, 0x637E, 0x16F4, 0x6421, 0x647E, 0x1752, 0x6521, 0x657E, 0x17B0,
- 0x6621, 0x667E, 0x180E, 0x6721, 0x677E, 0x186C, 0x6821, 0x687E, 0x18CA,
- 0x6921, 0x697E, 0x1928, 0x6A21, 0x6A7E, 0x1986, 0x6B21, 0x6B7E, 0x19E4,
- 0x6C21, 0x6C7E, 0x1A42, 0x6D21, 0x6D7E, 0x1AA0, 0x6E21, 0x6E7E, 0x1AFE,
- 0x6F21, 0x6F7E, 0x1B5C, 0x7021, 0x707E, 0x1BBA, 0x7121, 0x717E, 0x1C18,
- 0x7221, 0x727E, 0x1C76, 0x7321, 0x737E, 0x1CD4, 0x7421, 0x7424, 0x1D32,
- 0x7425, 0x7426, 0x205C,
-};
+// 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
+
+extern const unsigned short g_FXCMAP_H_1[118 * 3] = {
+ 0x2121, 0x217E, 0x0279, 0x2221, 0x222E, 0x02D7, 0x223A, 0x2241, 0x02E5,
+ 0x224A, 0x2250, 0x02ED, 0x225C, 0x226A, 0x02F4, 0x2272, 0x2279, 0x0303,
+ 0x227E, 0x227E, 0x030B, 0x2330, 0x2339, 0x030C, 0x2341, 0x235A, 0x0316,
+ 0x2361, 0x237A, 0x0330, 0x2421, 0x2473, 0x034A, 0x2521, 0x2576, 0x039D,
+ 0x2621, 0x2638, 0x03F3, 0x2641, 0x2658, 0x040B, 0x2721, 0x2741, 0x0423,
+ 0x2751, 0x2771, 0x0444, 0x2821, 0x2821, 0x1D37, 0x2822, 0x2822, 0x1D39,
+ 0x2823, 0x2823, 0x1D43, 0x2824, 0x2824, 0x1D47, 0x2825, 0x2825, 0x1D4F,
+ 0x2826, 0x2826, 0x1D4B, 0x2827, 0x2827, 0x1D53, 0x2828, 0x2828, 0x1D63,
+ 0x2829, 0x2829, 0x1D5B, 0x282A, 0x282A, 0x1D6B, 0x282B, 0x282B, 0x1D73,
+ 0x282C, 0x282C, 0x1D38, 0x282D, 0x282D, 0x1D3A, 0x282E, 0x282E, 0x1D46,
+ 0x282F, 0x282F, 0x1D4A, 0x2830, 0x2830, 0x1D52, 0x2831, 0x2831, 0x1D4E,
+ 0x2832, 0x2832, 0x1D5A, 0x2833, 0x2833, 0x1D6A, 0x2834, 0x2834, 0x1D62,
+ 0x2835, 0x2835, 0x1D72, 0x2836, 0x2836, 0x1D82, 0x2837, 0x2837, 0x1D57,
+ 0x2838, 0x2838, 0x1D66, 0x2839, 0x2839, 0x1D5F, 0x283A, 0x283A, 0x1D6E,
+ 0x283B, 0x283B, 0x1D76, 0x283C, 0x283C, 0x1D54, 0x283D, 0x283D, 0x1D67,
+ 0x283E, 0x283E, 0x1D5C, 0x283F, 0x283F, 0x1D6F, 0x2840, 0x2840, 0x1D79,
+ 0x3021, 0x307E, 0x0465, 0x3121, 0x317E, 0x04C3, 0x3221, 0x327E, 0x0521,
+ 0x3321, 0x337E, 0x057F, 0x3421, 0x347E, 0x05DD, 0x3521, 0x357E, 0x063B,
+ 0x3621, 0x367E, 0x0699, 0x3721, 0x377E, 0x06F7, 0x3821, 0x387E, 0x0755,
+ 0x3921, 0x397E, 0x07B3, 0x3A21, 0x3A7E, 0x0811, 0x3B21, 0x3B7E, 0x086F,
+ 0x3C21, 0x3C7E, 0x08CD, 0x3D21, 0x3D7E, 0x092B, 0x3E21, 0x3E7E, 0x0989,
+ 0x3F21, 0x3F7E, 0x09E7, 0x4021, 0x407E, 0x0A45, 0x4121, 0x417E, 0x0AA3,
+ 0x4221, 0x427E, 0x0B01, 0x4321, 0x437E, 0x0B5F, 0x4421, 0x447E, 0x0BBD,
+ 0x4521, 0x457E, 0x0C1B, 0x4621, 0x467E, 0x0C79, 0x4721, 0x477E, 0x0CD7,
+ 0x4821, 0x487E, 0x0D35, 0x4921, 0x497E, 0x0D93, 0x4A21, 0x4A7E, 0x0DF1,
+ 0x4B21, 0x4B7E, 0x0E4F, 0x4C21, 0x4C7E, 0x0EAD, 0x4D21, 0x4D7E, 0x0F0B,
+ 0x4E21, 0x4E7E, 0x0F69, 0x4F21, 0x4F53, 0x0FC7, 0x5021, 0x507E, 0x0FFA,
+ 0x5121, 0x517E, 0x1058, 0x5221, 0x527E, 0x10B6, 0x5321, 0x537E, 0x1114,
+ 0x5421, 0x547E, 0x1172, 0x5521, 0x557E, 0x11D0, 0x5621, 0x567E, 0x122E,
+ 0x5721, 0x577E, 0x128C, 0x5821, 0x587E, 0x12EA, 0x5921, 0x597E, 0x1348,
+ 0x5A21, 0x5A7E, 0x13A6, 0x5B21, 0x5B7E, 0x1404, 0x5C21, 0x5C7E, 0x1462,
+ 0x5D21, 0x5D7E, 0x14C0, 0x5E21, 0x5E7E, 0x151E, 0x5F21, 0x5F7E, 0x157C,
+ 0x6021, 0x607E, 0x15DA, 0x6121, 0x617E, 0x1638, 0x6221, 0x627E, 0x1696,
+ 0x6321, 0x637E, 0x16F4, 0x6421, 0x647E, 0x1752, 0x6521, 0x657E, 0x17B0,
+ 0x6621, 0x667E, 0x180E, 0x6721, 0x677E, 0x186C, 0x6821, 0x687E, 0x18CA,
+ 0x6921, 0x697E, 0x1928, 0x6A21, 0x6A7E, 0x1986, 0x6B21, 0x6B7E, 0x19E4,
+ 0x6C21, 0x6C7E, 0x1A42, 0x6D21, 0x6D7E, 0x1AA0, 0x6E21, 0x6E7E, 0x1AFE,
+ 0x6F21, 0x6F7E, 0x1B5C, 0x7021, 0x707E, 0x1BBA, 0x7121, 0x717E, 0x1C18,
+ 0x7221, 0x727E, 0x1C76, 0x7321, 0x737E, 0x1CD4, 0x7421, 0x7424, 0x1D32,
+ 0x7425, 0x7426, 0x205C,
+};
diff --git a/core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UCS2-HW-V_4.cpp b/core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UCS2-HW-V_4.cpp
index a59420ac5f..e996aebbae 100644
--- a/core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UCS2-HW-V_4.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UCS2-HW-V_4.cpp
@@ -1,75 +1,75 @@
-// 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
-
-extern const unsigned short g_FXCMAP_UniJIS_UCS2_HW_V_4[199 * 3] = {
- 0x0020, 0x005B, 0x00E7, 0x005C, 0x005C, 0x220F, 0x005D, 0x007E, 0x0124,
- 0x00A5, 0x00A5, 0x0123, 0x00B0, 0x00B0, 0x204D, 0x2010, 0x2010, 0x1ED5,
- 0x2015, 0x2015, 0x1ED4, 0x2016, 0x2016, 0x1ED7, 0x2018, 0x2019, 0x2059,
- 0x201C, 0x201D, 0x2057, 0x2025, 0x2025, 0x1EDA, 0x2026, 0x2026, 0x1ED9,
- 0x2032, 0x2032, 0x2051, 0x2033, 0x2033, 0x205B, 0x2190, 0x2190, 0x02E2,
- 0x2191, 0x2191, 0x02E0, 0x2192, 0x2192, 0x02E3, 0x2193, 0x2193, 0x02E1,
- 0x2195, 0x2195, 0x2FB6, 0x21C4, 0x21C4, 0x2077, 0x21C5, 0x21C5, 0x2076,
- 0x21C6, 0x21C6, 0x2078, 0x21E6, 0x21E6, 0x1F4C, 0x21E7, 0x21E7, 0x1F4E,
- 0x21E8, 0x21E8, 0x1F4B, 0x21E9, 0x21E9, 0x1F4D, 0x2225, 0x2225, 0x1ED7,
- 0x223C, 0x223C, 0x1ED6, 0x22EF, 0x22EF, 0x1ED9, 0x2500, 0x2501, 0x1D39,
- 0x2502, 0x2503, 0x1D37, 0x2504, 0x2505, 0x1D3D, 0x2506, 0x2507, 0x1D3B,
- 0x2508, 0x2509, 0x1D41, 0x250A, 0x250B, 0x1D3F, 0x250C, 0x250C, 0x1D47,
- 0x250D, 0x250D, 0x1D49, 0x250E, 0x250E, 0x1D48, 0x250F, 0x250F, 0x1D4A,
- 0x2510, 0x2510, 0x1D4F, 0x2511, 0x2511, 0x1D51, 0x2512, 0x2512, 0x1D50,
- 0x2513, 0x2513, 0x1D52, 0x2514, 0x2514, 0x1D43, 0x2515, 0x2515, 0x1D45,
- 0x2516, 0x2516, 0x1D44, 0x2517, 0x2517, 0x1D46, 0x2518, 0x2518, 0x1D4B,
- 0x2519, 0x2519, 0x1D4D, 0x251A, 0x251A, 0x1D4C, 0x251B, 0x251B, 0x1D4E,
- 0x251C, 0x251C, 0x1D63, 0x251D, 0x251D, 0x1D67, 0x251E, 0x251E, 0x1D65,
- 0x251F, 0x251F, 0x1D64, 0x2520, 0x2520, 0x1D66, 0x2521, 0x2521, 0x1D69,
- 0x2522, 0x2522, 0x1D68, 0x2523, 0x2524, 0x1D6A, 0x2525, 0x2525, 0x1D6F,
- 0x2526, 0x2526, 0x1D6D, 0x2527, 0x2527, 0x1D6C, 0x2528, 0x2528, 0x1D6E,
- 0x2529, 0x2529, 0x1D71, 0x252A, 0x252A, 0x1D70, 0x252B, 0x252B, 0x1D72,
- 0x252C, 0x252C, 0x1D5B, 0x252D, 0x252F, 0x1D5D, 0x2530, 0x2530, 0x1D5C,
- 0x2531, 0x2533, 0x1D60, 0x2534, 0x2534, 0x1D53, 0x2535, 0x2537, 0x1D55,
- 0x2538, 0x2538, 0x1D54, 0x2539, 0x253B, 0x1D58, 0x253D, 0x253F, 0x1D77,
- 0x2540, 0x2540, 0x1D75, 0x2541, 0x2541, 0x1D74, 0x2542, 0x2542, 0x1D76,
- 0x2543, 0x2543, 0x1D7B, 0x2544, 0x2544, 0x1D7D, 0x2545, 0x2545, 0x1D7A,
- 0x2546, 0x2546, 0x1D7C, 0x2547, 0x2547, 0x1D81, 0x2548, 0x2548, 0x1D80,
- 0x2549, 0x254A, 0x1D7E, 0x261C, 0x261C, 0x201D, 0x261D, 0x261D, 0x201B,
- 0x261E, 0x261E, 0x201E, 0x261F, 0x261F, 0x201C, 0x2702, 0x2702, 0x2F92,
- 0x27A1, 0x27A1, 0x2011, 0x3001, 0x3002, 0x1ECF, 0x3008, 0x3011, 0x1EE3,
- 0x3013, 0x3013, 0x204E, 0x3014, 0x3015, 0x1EDD, 0x301C, 0x301C, 0x1ED6,
- 0x301D, 0x301D, 0x1F14, 0x301F, 0x301F, 0x1F15, 0x3041, 0x3041, 0x1EEE,
- 0x3043, 0x3043, 0x1EEF, 0x3045, 0x3045, 0x1EF0, 0x3047, 0x3047, 0x1EF1,
- 0x3049, 0x3049, 0x1EF2, 0x3063, 0x3063, 0x1EF3, 0x3083, 0x3083, 0x1EF4,
- 0x3085, 0x3085, 0x1EF5, 0x3087, 0x3087, 0x1EF6, 0x308E, 0x308E, 0x1EF7,
- 0x309B, 0x309B, 0x2050, 0x309C, 0x309C, 0x204F, 0x30A1, 0x30A1, 0x1EF8,
- 0x30A3, 0x30A3, 0x1EF9, 0x30A5, 0x30A5, 0x1EFA, 0x30A7, 0x30A7, 0x1EFB,
- 0x30A9, 0x30A9, 0x1EFC, 0x30C3, 0x30C3, 0x1EFD, 0x30E3, 0x30E3, 0x1EFE,
- 0x30E5, 0x30E5, 0x1EFF, 0x30E7, 0x30E7, 0x1F00, 0x30EE, 0x30EE, 0x1F01,
- 0x30F5, 0x30F6, 0x1F02, 0x30FC, 0x30FC, 0x1ED3, 0x3300, 0x3300, 0x209E,
- 0x3301, 0x3302, 0x2EB6, 0x3303, 0x3303, 0x2092, 0x3304, 0x3304, 0x2EB8,
- 0x3305, 0x3305, 0x208D, 0x3306, 0x3306, 0x2EB9, 0x3307, 0x3307, 0x2EBD,
- 0x3308, 0x3308, 0x2EBB, 0x3309, 0x3309, 0x2EC0, 0x330A, 0x330A, 0x2EBE,
- 0x330B, 0x330B, 0x2EC2, 0x330C, 0x330C, 0x2EC4, 0x330D, 0x330D, 0x1F0E,
- 0x330E, 0x3313, 0x2EC5, 0x3314, 0x3314, 0x1F05, 0x3315, 0x3315, 0x2094,
- 0x3316, 0x3316, 0x208A, 0x3317, 0x3317, 0x2ECC, 0x3318, 0x3318, 0x2093,
- 0x3319, 0x3319, 0x2ECE, 0x331A, 0x331D, 0x2ED0, 0x331E, 0x331E, 0x20A1,
- 0x331F, 0x3321, 0x2ED4, 0x3322, 0x3322, 0x2089, 0x3323, 0x3323, 0x209C,
- 0x3324, 0x3324, 0x2ED7, 0x3325, 0x3325, 0x2ED9, 0x3326, 0x3326, 0x1F0F,
- 0x3327, 0x3327, 0x1F09, 0x3328, 0x3329, 0x2EDC, 0x332A, 0x332A, 0x20A4,
- 0x332B, 0x332B, 0x1F11, 0x332D, 0x332D, 0x2EDF, 0x332E, 0x3330, 0x2EE2,
- 0x3331, 0x3331, 0x20A6, 0x3332, 0x3332, 0x2EE5, 0x3333, 0x3333, 0x208E,
- 0x3334, 0x3335, 0x2EE8, 0x3336, 0x3336, 0x1F0B, 0x3337, 0x3337, 0x2EEE,
- 0x3338, 0x3338, 0x2EF0, 0x3339, 0x3339, 0x2097, 0x333A, 0x333A, 0x2EF1,
- 0x333B, 0x333B, 0x209D, 0x333C, 0x333C, 0x2EEA, 0x333D, 0x333D, 0x2EF2,
- 0x333E, 0x3340, 0x2EF4, 0x3341, 0x3341, 0x2EF3, 0x3342, 0x3342, 0x209B,
- 0x3343, 0x3346, 0x2EF7, 0x3347, 0x3347, 0x20A5, 0x3348, 0x3348, 0x2EFB,
- 0x3349, 0x3349, 0x1F04, 0x334A, 0x334A, 0x1F12, 0x334B, 0x334C, 0x2EFC,
- 0x334D, 0x334D, 0x1F07, 0x334E, 0x334E, 0x2091, 0x334F, 0x3350, 0x2EFE,
- 0x3351, 0x3351, 0x1F0C, 0x3352, 0x3352, 0x2F02, 0x3353, 0x3353, 0x2F06,
- 0x3354, 0x3354, 0x2F03, 0x3355, 0x3356, 0x2F07, 0x3357, 0x3357, 0x2098,
- 0x337F, 0x337F, 0x2084, 0xFF08, 0xFF09, 0x1EDB, 0xFF0C, 0xFF0C, 0x204C,
- 0xFF0E, 0xFF0E, 0x2052, 0xFF1D, 0xFF1D, 0x1EED, 0xFF3B, 0xFF3B, 0x1EDF,
- 0xFF3D, 0xFF3D, 0x1EE0, 0xFF3F, 0xFF3F, 0x1ED2, 0xFF5B, 0xFF5B, 0x1EE1,
- 0xFF5C, 0xFF5C, 0x1ED8, 0xFF5D, 0xFF5D, 0x1EE2, 0xFF5E, 0xFF5E, 0x1ED6,
- 0xFFE3, 0xFFE3, 0x1ED1,
-};
+// 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
+
+extern const unsigned short g_FXCMAP_UniJIS_UCS2_HW_V_4[199 * 3] = {
+ 0x0020, 0x005B, 0x00E7, 0x005C, 0x005C, 0x220F, 0x005D, 0x007E, 0x0124,
+ 0x00A5, 0x00A5, 0x0123, 0x00B0, 0x00B0, 0x204D, 0x2010, 0x2010, 0x1ED5,
+ 0x2015, 0x2015, 0x1ED4, 0x2016, 0x2016, 0x1ED7, 0x2018, 0x2019, 0x2059,
+ 0x201C, 0x201D, 0x2057, 0x2025, 0x2025, 0x1EDA, 0x2026, 0x2026, 0x1ED9,
+ 0x2032, 0x2032, 0x2051, 0x2033, 0x2033, 0x205B, 0x2190, 0x2190, 0x02E2,
+ 0x2191, 0x2191, 0x02E0, 0x2192, 0x2192, 0x02E3, 0x2193, 0x2193, 0x02E1,
+ 0x2195, 0x2195, 0x2FB6, 0x21C4, 0x21C4, 0x2077, 0x21C5, 0x21C5, 0x2076,
+ 0x21C6, 0x21C6, 0x2078, 0x21E6, 0x21E6, 0x1F4C, 0x21E7, 0x21E7, 0x1F4E,
+ 0x21E8, 0x21E8, 0x1F4B, 0x21E9, 0x21E9, 0x1F4D, 0x2225, 0x2225, 0x1ED7,
+ 0x223C, 0x223C, 0x1ED6, 0x22EF, 0x22EF, 0x1ED9, 0x2500, 0x2501, 0x1D39,
+ 0x2502, 0x2503, 0x1D37, 0x2504, 0x2505, 0x1D3D, 0x2506, 0x2507, 0x1D3B,
+ 0x2508, 0x2509, 0x1D41, 0x250A, 0x250B, 0x1D3F, 0x250C, 0x250C, 0x1D47,
+ 0x250D, 0x250D, 0x1D49, 0x250E, 0x250E, 0x1D48, 0x250F, 0x250F, 0x1D4A,
+ 0x2510, 0x2510, 0x1D4F, 0x2511, 0x2511, 0x1D51, 0x2512, 0x2512, 0x1D50,
+ 0x2513, 0x2513, 0x1D52, 0x2514, 0x2514, 0x1D43, 0x2515, 0x2515, 0x1D45,
+ 0x2516, 0x2516, 0x1D44, 0x2517, 0x2517, 0x1D46, 0x2518, 0x2518, 0x1D4B,
+ 0x2519, 0x2519, 0x1D4D, 0x251A, 0x251A, 0x1D4C, 0x251B, 0x251B, 0x1D4E,
+ 0x251C, 0x251C, 0x1D63, 0x251D, 0x251D, 0x1D67, 0x251E, 0x251E, 0x1D65,
+ 0x251F, 0x251F, 0x1D64, 0x2520, 0x2520, 0x1D66, 0x2521, 0x2521, 0x1D69,
+ 0x2522, 0x2522, 0x1D68, 0x2523, 0x2524, 0x1D6A, 0x2525, 0x2525, 0x1D6F,
+ 0x2526, 0x2526, 0x1D6D, 0x2527, 0x2527, 0x1D6C, 0x2528, 0x2528, 0x1D6E,
+ 0x2529, 0x2529, 0x1D71, 0x252A, 0x252A, 0x1D70, 0x252B, 0x252B, 0x1D72,
+ 0x252C, 0x252C, 0x1D5B, 0x252D, 0x252F, 0x1D5D, 0x2530, 0x2530, 0x1D5C,
+ 0x2531, 0x2533, 0x1D60, 0x2534, 0x2534, 0x1D53, 0x2535, 0x2537, 0x1D55,
+ 0x2538, 0x2538, 0x1D54, 0x2539, 0x253B, 0x1D58, 0x253D, 0x253F, 0x1D77,
+ 0x2540, 0x2540, 0x1D75, 0x2541, 0x2541, 0x1D74, 0x2542, 0x2542, 0x1D76,
+ 0x2543, 0x2543, 0x1D7B, 0x2544, 0x2544, 0x1D7D, 0x2545, 0x2545, 0x1D7A,
+ 0x2546, 0x2546, 0x1D7C, 0x2547, 0x2547, 0x1D81, 0x2548, 0x2548, 0x1D80,
+ 0x2549, 0x254A, 0x1D7E, 0x261C, 0x261C, 0x201D, 0x261D, 0x261D, 0x201B,
+ 0x261E, 0x261E, 0x201E, 0x261F, 0x261F, 0x201C, 0x2702, 0x2702, 0x2F92,
+ 0x27A1, 0x27A1, 0x2011, 0x3001, 0x3002, 0x1ECF, 0x3008, 0x3011, 0x1EE3,
+ 0x3013, 0x3013, 0x204E, 0x3014, 0x3015, 0x1EDD, 0x301C, 0x301C, 0x1ED6,
+ 0x301D, 0x301D, 0x1F14, 0x301F, 0x301F, 0x1F15, 0x3041, 0x3041, 0x1EEE,
+ 0x3043, 0x3043, 0x1EEF, 0x3045, 0x3045, 0x1EF0, 0x3047, 0x3047, 0x1EF1,
+ 0x3049, 0x3049, 0x1EF2, 0x3063, 0x3063, 0x1EF3, 0x3083, 0x3083, 0x1EF4,
+ 0x3085, 0x3085, 0x1EF5, 0x3087, 0x3087, 0x1EF6, 0x308E, 0x308E, 0x1EF7,
+ 0x309B, 0x309B, 0x2050, 0x309C, 0x309C, 0x204F, 0x30A1, 0x30A1, 0x1EF8,
+ 0x30A3, 0x30A3, 0x1EF9, 0x30A5, 0x30A5, 0x1EFA, 0x30A7, 0x30A7, 0x1EFB,
+ 0x30A9, 0x30A9, 0x1EFC, 0x30C3, 0x30C3, 0x1EFD, 0x30E3, 0x30E3, 0x1EFE,
+ 0x30E5, 0x30E5, 0x1EFF, 0x30E7, 0x30E7, 0x1F00, 0x30EE, 0x30EE, 0x1F01,
+ 0x30F5, 0x30F6, 0x1F02, 0x30FC, 0x30FC, 0x1ED3, 0x3300, 0x3300, 0x209E,
+ 0x3301, 0x3302, 0x2EB6, 0x3303, 0x3303, 0x2092, 0x3304, 0x3304, 0x2EB8,
+ 0x3305, 0x3305, 0x208D, 0x3306, 0x3306, 0x2EB9, 0x3307, 0x3307, 0x2EBD,
+ 0x3308, 0x3308, 0x2EBB, 0x3309, 0x3309, 0x2EC0, 0x330A, 0x330A, 0x2EBE,
+ 0x330B, 0x330B, 0x2EC2, 0x330C, 0x330C, 0x2EC4, 0x330D, 0x330D, 0x1F0E,
+ 0x330E, 0x3313, 0x2EC5, 0x3314, 0x3314, 0x1F05, 0x3315, 0x3315, 0x2094,
+ 0x3316, 0x3316, 0x208A, 0x3317, 0x3317, 0x2ECC, 0x3318, 0x3318, 0x2093,
+ 0x3319, 0x3319, 0x2ECE, 0x331A, 0x331D, 0x2ED0, 0x331E, 0x331E, 0x20A1,
+ 0x331F, 0x3321, 0x2ED4, 0x3322, 0x3322, 0x2089, 0x3323, 0x3323, 0x209C,
+ 0x3324, 0x3324, 0x2ED7, 0x3325, 0x3325, 0x2ED9, 0x3326, 0x3326, 0x1F0F,
+ 0x3327, 0x3327, 0x1F09, 0x3328, 0x3329, 0x2EDC, 0x332A, 0x332A, 0x20A4,
+ 0x332B, 0x332B, 0x1F11, 0x332D, 0x332D, 0x2EDF, 0x332E, 0x3330, 0x2EE2,
+ 0x3331, 0x3331, 0x20A6, 0x3332, 0x3332, 0x2EE5, 0x3333, 0x3333, 0x208E,
+ 0x3334, 0x3335, 0x2EE8, 0x3336, 0x3336, 0x1F0B, 0x3337, 0x3337, 0x2EEE,
+ 0x3338, 0x3338, 0x2EF0, 0x3339, 0x3339, 0x2097, 0x333A, 0x333A, 0x2EF1,
+ 0x333B, 0x333B, 0x209D, 0x333C, 0x333C, 0x2EEA, 0x333D, 0x333D, 0x2EF2,
+ 0x333E, 0x3340, 0x2EF4, 0x3341, 0x3341, 0x2EF3, 0x3342, 0x3342, 0x209B,
+ 0x3343, 0x3346, 0x2EF7, 0x3347, 0x3347, 0x20A5, 0x3348, 0x3348, 0x2EFB,
+ 0x3349, 0x3349, 0x1F04, 0x334A, 0x334A, 0x1F12, 0x334B, 0x334C, 0x2EFC,
+ 0x334D, 0x334D, 0x1F07, 0x334E, 0x334E, 0x2091, 0x334F, 0x3350, 0x2EFE,
+ 0x3351, 0x3351, 0x1F0C, 0x3352, 0x3352, 0x2F02, 0x3353, 0x3353, 0x2F06,
+ 0x3354, 0x3354, 0x2F03, 0x3355, 0x3356, 0x2F07, 0x3357, 0x3357, 0x2098,
+ 0x337F, 0x337F, 0x2084, 0xFF08, 0xFF09, 0x1EDB, 0xFF0C, 0xFF0C, 0x204C,
+ 0xFF0E, 0xFF0E, 0x2052, 0xFF1D, 0xFF1D, 0x1EED, 0xFF3B, 0xFF3B, 0x1EDF,
+ 0xFF3D, 0xFF3D, 0x1EE0, 0xFF3F, 0xFF3F, 0x1ED2, 0xFF5B, 0xFF5B, 0x1EE1,
+ 0xFF5C, 0xFF5C, 0x1ED8, 0xFF5D, 0xFF5D, 0x1EE2, 0xFF5E, 0xFF5E, 0x1ED6,
+ 0xFFE3, 0xFFE3, 0x1ED1,
+};
diff --git a/core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UCS2-H_4.cpp b/core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UCS2-H_4.cpp
index 35f0b71518..c6ab8349c3 100644
--- a/core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UCS2-H_4.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UCS2-H_4.cpp
@@ -1,2451 +1,2451 @@
-// 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
-
-extern const unsigned short g_FXCMAP_UniJIS_UCS2_H_4[9772 * 2] = {
- 0x0020, 0x0001, 0x0021, 0x0002, 0x0022, 0x0003, 0x0023, 0x0004,
- 0x0024, 0x0005, 0x0025, 0x0006, 0x0026, 0x0007, 0x0027, 0x0008,
- 0x0028, 0x0009, 0x0029, 0x000A, 0x002A, 0x000B, 0x002B, 0x000C,
- 0x002C, 0x000D, 0x002D, 0x000E, 0x002E, 0x000F, 0x002F, 0x0010,
- 0x0030, 0x0011, 0x0031, 0x0012, 0x0032, 0x0013, 0x0033, 0x0014,
- 0x0034, 0x0015, 0x0035, 0x0016, 0x0036, 0x0017, 0x0037, 0x0018,
- 0x0038, 0x0019, 0x0039, 0x001A, 0x003A, 0x001B, 0x003B, 0x001C,
- 0x003C, 0x001D, 0x003D, 0x001E, 0x003E, 0x001F, 0x003F, 0x0020,
- 0x0040, 0x0021, 0x0041, 0x0022, 0x0042, 0x0023, 0x0043, 0x0024,
- 0x0044, 0x0025, 0x0045, 0x0026, 0x0046, 0x0027, 0x0047, 0x0028,
- 0x0048, 0x0029, 0x0049, 0x002A, 0x004A, 0x002B, 0x004B, 0x002C,
- 0x004C, 0x002D, 0x004D, 0x002E, 0x004E, 0x002F, 0x004F, 0x0030,
- 0x0050, 0x0031, 0x0051, 0x0032, 0x0052, 0x0033, 0x0053, 0x0034,
- 0x0054, 0x0035, 0x0055, 0x0036, 0x0056, 0x0037, 0x0057, 0x0038,
- 0x0058, 0x0039, 0x0059, 0x003A, 0x005A, 0x003B, 0x005B, 0x003C,
- 0x005C, 0x0061, 0x005D, 0x003E, 0x005E, 0x003F, 0x005F, 0x0040,
- 0x0060, 0x0041, 0x0061, 0x0042, 0x0062, 0x0043, 0x0063, 0x0044,
- 0x0064, 0x0045, 0x0065, 0x0046, 0x0066, 0x0047, 0x0067, 0x0048,
- 0x0068, 0x0049, 0x0069, 0x004A, 0x006A, 0x004B, 0x006B, 0x004C,
- 0x006C, 0x004D, 0x006D, 0x004E, 0x006E, 0x004F, 0x006F, 0x0050,
- 0x0070, 0x0051, 0x0071, 0x0052, 0x0072, 0x0053, 0x0073, 0x0054,
- 0x0074, 0x0055, 0x0075, 0x0056, 0x0076, 0x0057, 0x0077, 0x0058,
- 0x0078, 0x0059, 0x0079, 0x005A, 0x007A, 0x005B, 0x007B, 0x005C,
- 0x007C, 0x005D, 0x007D, 0x005E, 0x007E, 0x005F, 0x00A1, 0x0065,
- 0x00A2, 0x0066, 0x00A3, 0x0067, 0x00A4, 0x006B, 0x00A5, 0x003D,
- 0x00A6, 0x0063, 0x00A7, 0x02D0, 0x00A8, 0x0287, 0x00A9, 0x0098,
- 0x00AA, 0x008C, 0x00AB, 0x006D, 0x00AC, 0x0099, 0x00AD, 0x0097,
- 0x00AE, 0x009A, 0x00AF, 0x0081, 0x00B0, 0x02C3, 0x00B1, 0x02B6,
- 0x00B2, 0x009D, 0x00B3, 0x009E, 0x00B4, 0x0285, 0x00B5, 0x009F,
- 0x00B6, 0x030A, 0x00B7, 0x0075, 0x00B8, 0x0086, 0x00B9, 0x00A0,
- 0x00BA, 0x0090, 0x00BB, 0x007B, 0x00BC, 0x00A1, 0x00BD, 0x00A2,
- 0x00BE, 0x00A3, 0x00BF, 0x007E, 0x00C0, 0x00A4, 0x00C1, 0x00A5,
- 0x00C2, 0x00A6, 0x00C3, 0x00A7, 0x00C4, 0x00A8, 0x00C5, 0x00A9,
- 0x00C6, 0x008B, 0x00C7, 0x00AA, 0x00C8, 0x00AB, 0x00C9, 0x00AC,
- 0x00CA, 0x00AD, 0x00CB, 0x00AE, 0x00CC, 0x00AF, 0x00CD, 0x00B0,
- 0x00CE, 0x00B1, 0x00CF, 0x00B2, 0x00D0, 0x00B3, 0x00D1, 0x00B4,
- 0x00D2, 0x00B5, 0x00D3, 0x00B6, 0x00D4, 0x00B7, 0x00D5, 0x00B8,
- 0x00D6, 0x00B9, 0x00D7, 0x02B7, 0x00D8, 0x008E, 0x00D9, 0x00BB,
- 0x00DA, 0x00BC, 0x00DB, 0x00BD, 0x00DC, 0x00BE, 0x00DD, 0x00BF,
- 0x00DE, 0x00C0, 0x00DF, 0x0096, 0x00E0, 0x00C1, 0x00E1, 0x00C2,
- 0x00E2, 0x00C3, 0x00E3, 0x00C4, 0x00E4, 0x00C5, 0x00E5, 0x00C6,
- 0x00E6, 0x0091, 0x00E7, 0x00C7, 0x00E8, 0x00C8, 0x00E9, 0x00C9,
- 0x00EA, 0x00CA, 0x00EB, 0x00CB, 0x00EC, 0x00CC, 0x00ED, 0x00CD,
- 0x00EE, 0x00CE, 0x00EF, 0x00CF, 0x00F0, 0x00D0, 0x00F1, 0x00D1,
- 0x00F2, 0x00D2, 0x00F3, 0x00D3, 0x00F4, 0x00D4, 0x00F5, 0x00D5,
- 0x00F6, 0x00D6, 0x00F7, 0x02B8, 0x00F8, 0x0094, 0x00F9, 0x00D8,
- 0x00FA, 0x00D9, 0x00FB, 0x00DA, 0x00FC, 0x00DB, 0x00FD, 0x00DC,
- 0x00FE, 0x00DD, 0x00FF, 0x00DE, 0x0100, 0x2496, 0x0101, 0x2491,
- 0x0112, 0x2499, 0x0113, 0x2494, 0x011A, 0x24B3, 0x011B, 0x24BF,
- 0x0127, 0x2F3C, 0x0128, 0x24B8, 0x0129, 0x24C4, 0x012A, 0x2497,
- 0x012B, 0x2492, 0x0131, 0x0092, 0x0141, 0x008D, 0x0142, 0x0093,
- 0x014B, 0x24DC, 0x014C, 0x249A, 0x014D, 0x2495, 0x0152, 0x008F,
- 0x0153, 0x0095, 0x0160, 0x00DF, 0x0161, 0x00E3, 0x0168, 0x24BD,
- 0x0169, 0x24C9, 0x016A, 0x2498, 0x016B, 0x2493, 0x016E, 0x24BC,
- 0x016F, 0x24C8, 0x0178, 0x00E0, 0x017D, 0x00E1, 0x017E, 0x00E5,
- 0x01C0, 0x0063, 0x01CD, 0x24B2, 0x01CE, 0x24BE, 0x01CF, 0x24B6,
- 0x01D0, 0x24C2, 0x01D1, 0x24B9, 0x01D2, 0x24C5, 0x01D3, 0x24BB,
- 0x01D4, 0x24C7, 0x01FD, 0x24CD, 0x0251, 0x24CA, 0x0254, 0x24CF,
- 0x0259, 0x24D2, 0x025A, 0x24D5, 0x025B, 0x24D8, 0x0275, 0x24DD,
- 0x0283, 0x24E2, 0x028C, 0x24DE, 0x0292, 0x24E1, 0x02D0, 0x24E3,
- 0x0300, 0x0041, 0x0301, 0x007F, 0x0302, 0x0080, 0x0303, 0x005F,
- 0x0304, 0x0081, 0x0305, 0x00E2, 0x0306, 0x0082, 0x0307, 0x0083,
- 0x0308, 0x0084, 0x030A, 0x0085, 0x030B, 0x0087, 0x030C, 0x0089,
- 0x0327, 0x0086, 0x0328, 0x0088, 0x0332, 0x0040, 0x0336, 0x008A,
- 0x0361, 0x02F6, 0x0391, 0x03F3, 0x0392, 0x03F4, 0x0393, 0x03F5,
- 0x0394, 0x03F6, 0x0395, 0x03F7, 0x0396, 0x03F8, 0x0397, 0x03F9,
- 0x0398, 0x03FA, 0x0399, 0x03FB, 0x039A, 0x03FC, 0x039B, 0x03FD,
- 0x039C, 0x03FE, 0x039D, 0x03FF, 0x039E, 0x0400, 0x039F, 0x0401,
- 0x03A0, 0x0402, 0x03A1, 0x0403, 0x03A3, 0x0404, 0x03A4, 0x0405,
- 0x03A5, 0x0406, 0x03A6, 0x0407, 0x03A7, 0x0408, 0x03A8, 0x0409,
- 0x03A9, 0x040A, 0x03B1, 0x040B, 0x03B2, 0x040C, 0x03B3, 0x040D,
- 0x03B4, 0x040E, 0x03B5, 0x040F, 0x03B6, 0x0410, 0x03B7, 0x0411,
- 0x03B8, 0x0412, 0x03B9, 0x0413, 0x03BA, 0x0414, 0x03BB, 0x0415,
- 0x03BC, 0x0416, 0x03BD, 0x0417, 0x03BE, 0x0418, 0x03BF, 0x0419,
- 0x03C0, 0x041A, 0x03C1, 0x041B, 0x03C3, 0x041C, 0x03C4, 0x041D,
- 0x03C5, 0x041E, 0x03C6, 0x041F, 0x03C7, 0x0420, 0x03C8, 0x0421,
- 0x03C9, 0x0422, 0x03D0, 0x2F3A, 0x03D1, 0x2F40, 0x03DB, 0x2F3F,
- 0x0401, 0x0429, 0x0410, 0x0423, 0x0411, 0x0424, 0x0412, 0x0425,
- 0x0413, 0x0426, 0x0414, 0x0427, 0x0415, 0x0428, 0x0416, 0x042A,
- 0x0417, 0x042B, 0x0418, 0x042C, 0x0419, 0x042D, 0x041A, 0x042E,
- 0x041B, 0x042F, 0x041C, 0x0430, 0x041D, 0x0431, 0x041E, 0x0432,
- 0x041F, 0x0433, 0x0420, 0x0434, 0x0421, 0x0435, 0x0422, 0x0436,
- 0x0423, 0x0437, 0x0424, 0x0438, 0x0425, 0x0439, 0x0426, 0x043A,
- 0x0427, 0x043B, 0x0428, 0x043C, 0x0429, 0x043D, 0x042A, 0x043E,
- 0x042B, 0x043F, 0x042C, 0x0440, 0x042D, 0x0441, 0x042E, 0x0442,
- 0x042F, 0x0443, 0x0430, 0x0444, 0x0431, 0x0445, 0x0432, 0x0446,
- 0x0433, 0x0447, 0x0434, 0x0448, 0x0435, 0x0449, 0x0436, 0x044B,
- 0x0437, 0x044C, 0x0438, 0x044D, 0x0439, 0x044E, 0x043A, 0x044F,
- 0x043B, 0x0450, 0x043C, 0x0451, 0x043D, 0x0452, 0x043E, 0x0453,
- 0x043F, 0x0454, 0x0440, 0x0455, 0x0441, 0x0456, 0x0442, 0x0457,
- 0x0443, 0x0458, 0x0444, 0x0459, 0x0445, 0x045A, 0x0446, 0x045B,
- 0x0447, 0x045C, 0x0448, 0x045D, 0x0449, 0x045E, 0x044A, 0x045F,
- 0x044B, 0x0460, 0x044C, 0x0461, 0x044D, 0x0462, 0x044E, 0x0463,
- 0x044F, 0x0464, 0x0451, 0x044A, 0x045B, 0x2F3C, 0x1EBC, 0x24B5,
- 0x1EBD, 0x24C1, 0x2002, 0x00E7, 0x2003, 0x0279, 0x2010, 0x0296,
- 0x2011, 0x000E, 0x2012, 0x0072, 0x2013, 0x0072, 0x2014, 0x008A,
- 0x2015, 0x0295, 0x2016, 0x029A, 0x2018, 0x029E, 0x2019, 0x029F,
- 0x201A, 0x0078, 0x201C, 0x02A0, 0x201D, 0x02A1, 0x201E, 0x0079,
- 0x2020, 0x0308, 0x2021, 0x0309, 0x2022, 0x0077, 0x2025, 0x029D,
- 0x2026, 0x029C, 0x2030, 0x0304, 0x2032, 0x02C4, 0x2033, 0x02C5,
- 0x2039, 0x006E, 0x203A, 0x006F, 0x203B, 0x02DE, 0x203C, 0x2F4F,
- 0x203E, 0x0145, 0x2044, 0x0068, 0x2049, 0x2F50, 0x2070, 0x24A1,
- 0x2074, 0x24A2, 0x2075, 0x24A3, 0x2076, 0x24A4, 0x2077, 0x24A5,
- 0x2078, 0x24A6, 0x2079, 0x24A7, 0x2080, 0x24A8, 0x2081, 0x24A9,
- 0x2082, 0x24AA, 0x2083, 0x24AB, 0x2084, 0x24AC, 0x2085, 0x24AD,
- 0x2086, 0x24AE, 0x2087, 0x24AF, 0x2088, 0x24B0, 0x2089, 0x24B1,
- 0x20AC, 0x248A, 0x20DD, 0x030B, 0x2100, 0x2E4F, 0x2103, 0x02C6,
- 0x2105, 0x2E53, 0x2109, 0x2071, 0x210A, 0x2070, 0x210F, 0x2F3C,
- 0x2113, 0x1F59, 0x2116, 0x1DBA, 0x2121, 0x1F77, 0x2122, 0x00E4,
- 0x2126, 0x248B, 0x212B, 0x0303, 0x2135, 0x2F39, 0x2153, 0x249F,
- 0x2154, 0x24A0, 0x215B, 0x249B, 0x215C, 0x249C, 0x215D, 0x249D,
- 0x215E, 0x249E, 0x2160, 0x1D97, 0x2161, 0x1D98, 0x2162, 0x1D99,
- 0x2163, 0x1D9A, 0x2164, 0x1D9B, 0x2165, 0x1D9C, 0x2166, 0x1D9D,
- 0x2167, 0x1D9E, 0x2168, 0x1D9F, 0x2169, 0x1DA0, 0x216A, 0x2021,
- 0x216B, 0x2022, 0x2170, 0x1F9C, 0x2171, 0x1F9D, 0x2172, 0x1F9E,
- 0x2173, 0x1F9F, 0x2174, 0x1FA0, 0x2175, 0x1FA1, 0x2176, 0x1FA2,
- 0x2177, 0x1FA3, 0x2178, 0x1FA4, 0x2179, 0x1FA5, 0x217A, 0x206A,
- 0x217B, 0x206B, 0x217F, 0x206F, 0x2190, 0x02E1, 0x2191, 0x02E2,
- 0x2192, 0x02E0, 0x2193, 0x02E3, 0x2194, 0x2FA9, 0x2195, 0x2FB7,
- 0x2196, 0x2FAC, 0x2197, 0x2FAD, 0x2198, 0x2FAA, 0x2199, 0x2FAB,
- 0x21C4, 0x2076, 0x21C5, 0x2077, 0x21C6, 0x2075, 0x21CC, 0x2FAE,
- 0x21D0, 0x2FA8, 0x21D2, 0x02F0, 0x21D4, 0x02F1, 0x21E6, 0x1F4D,
- 0x21E7, 0x1F4C, 0x21E8, 0x1F4E, 0x21E9, 0x1F4B, 0x2200, 0x02F2,
- 0x2202, 0x02F7, 0x2203, 0x02F3, 0x2205, 0x2F98, 0x2207, 0x02F8,
- 0x2208, 0x02E5, 0x220A, 0x2F3B, 0x220B, 0x02E6, 0x2211, 0x1DC9,
- 0x2212, 0x02B5, 0x2213, 0x2F56, 0x221A, 0x02FD, 0x221D, 0x02FF,
- 0x221E, 0x02BF, 0x221F, 0x1DCD, 0x2220, 0x02F4, 0x2225, 0x029A,
- 0x2227, 0x02ED, 0x2228, 0x02EE, 0x2229, 0x02EC, 0x222A, 0x02EB,
- 0x222B, 0x0301, 0x222C, 0x0302, 0x222D, 0x2003, 0x222E, 0x1DC8,
- 0x2234, 0x02C0, 0x2235, 0x0300, 0x223C, 0x0299, 0x223D, 0x02FE,
- 0x2243, 0x2F58, 0x2252, 0x02FA, 0x2260, 0x02BA, 0x2261, 0x02F9,
- 0x2266, 0x02BD, 0x2267, 0x02BE, 0x226A, 0x02FB, 0x226B, 0x02FC,
- 0x2272, 0x2F59, 0x2273, 0x2F5A, 0x2282, 0x02E9, 0x2283, 0x02EA,
- 0x2286, 0x02E7, 0x2287, 0x02E8, 0x2295, 0x2F9C, 0x2296, 0x2F9A,
- 0x2297, 0x2F9D, 0x2298, 0x2F9B, 0x229D, 0x2F9A, 0x229E, 0x2F9E,
- 0x22A0, 0x2F99, 0x22A5, 0x02F5, 0x22BF, 0x1DCE, 0x22EE, 0x1ED9,
- 0x22EF, 0x029C, 0x2300, 0x2F98, 0x2307, 0x2FBB, 0x2312, 0x02F6,
- 0x244A, 0x2F54, 0x2460, 0x1D83, 0x2461, 0x1D84, 0x2462, 0x1D85,
- 0x2463, 0x1D86, 0x2464, 0x1D87, 0x2465, 0x1D88, 0x2466, 0x1D89,
- 0x2467, 0x1D8A, 0x2468, 0x1D8B, 0x2469, 0x1D8C, 0x246A, 0x1D8D,
- 0x246B, 0x1D8E, 0x246C, 0x1D8F, 0x246D, 0x1D90, 0x246E, 0x1D91,
- 0x246F, 0x1D92, 0x2470, 0x1D93, 0x2471, 0x1D94, 0x2472, 0x1D95,
- 0x2473, 0x1D96, 0x2474, 0x1F87, 0x2475, 0x1F88, 0x2476, 0x1F89,
- 0x2477, 0x1F8A, 0x2478, 0x1F8B, 0x2479, 0x1F8C, 0x247A, 0x1F8D,
- 0x247B, 0x1F8E, 0x247C, 0x1F8F, 0x247D, 0x1F90, 0x247E, 0x1F91,
- 0x247F, 0x1F92, 0x2480, 0x1F93, 0x2481, 0x1F94, 0x2482, 0x1F95,
- 0x2483, 0x1F96, 0x2484, 0x1F97, 0x2485, 0x1F98, 0x2486, 0x1F99,
- 0x2487, 0x1F9A, 0x2488, 0x1F7E, 0x2489, 0x1F7F, 0x248A, 0x1F80,
- 0x248B, 0x1F81, 0x248C, 0x1F82, 0x248D, 0x1F83, 0x248E, 0x1F84,
- 0x248F, 0x1F85, 0x2490, 0x1F86, 0x249C, 0x1FB0, 0x249D, 0x1FB1,
- 0x249E, 0x1FB2, 0x249F, 0x1FB3, 0x24A0, 0x1FB4, 0x24A1, 0x1FB5,
- 0x24A2, 0x1FB6, 0x24A3, 0x1FB7, 0x24A4, 0x1FB8, 0x24A5, 0x1FB9,
- 0x24A6, 0x1FBA, 0x24A7, 0x1FBB, 0x24A8, 0x1FBC, 0x24A9, 0x1FBD,
- 0x24AA, 0x1FBE, 0x24AB, 0x1FBF, 0x24AC, 0x1FC0, 0x24AD, 0x1FC1,
- 0x24AE, 0x1FC2, 0x24AF, 0x1FC3, 0x24B0, 0x1FC4, 0x24B1, 0x1FC5,
- 0x24B2, 0x1FC6, 0x24B3, 0x1FC7, 0x24B4, 0x1FC8, 0x24B5, 0x1FC9,
- 0x24B6, 0x2863, 0x24B7, 0x2864, 0x24B8, 0x2865, 0x24B9, 0x2866,
- 0x24BA, 0x2867, 0x24BB, 0x2868, 0x24BC, 0x2869, 0x24BD, 0x286A,
- 0x24BE, 0x286B, 0x24BF, 0x286C, 0x24C0, 0x286D, 0x24C1, 0x286E,
- 0x24C2, 0x286F, 0x24C3, 0x2870, 0x24C4, 0x2871, 0x24C5, 0x2872,
- 0x24C6, 0x2873, 0x24C7, 0x2874, 0x24C8, 0x2875, 0x24C9, 0x2876,
- 0x24CA, 0x2877, 0x24CB, 0x2878, 0x24CC, 0x2879, 0x24CD, 0x287A,
- 0x24CE, 0x287B, 0x24CF, 0x287C, 0x24D0, 0x2849, 0x24D1, 0x284A,
- 0x24D2, 0x284B, 0x24D3, 0x284C, 0x24D4, 0x284D, 0x24D5, 0x284E,
- 0x24D6, 0x284F, 0x24D7, 0x2850, 0x24D8, 0x2851, 0x24D9, 0x2852,
- 0x24DA, 0x2853, 0x24DB, 0x2854, 0x24DC, 0x2855, 0x24DD, 0x2856,
- 0x24DE, 0x2857, 0x24DF, 0x2858, 0x24E0, 0x2859, 0x24E1, 0x285A,
- 0x24E2, 0x285B, 0x24E3, 0x285C, 0x24E4, 0x285D, 0x24E5, 0x285E,
- 0x24E6, 0x285F, 0x24E7, 0x2860, 0x24E8, 0x2861, 0x24E9, 0x2862,
- 0x24EA, 0x2020, 0x2500, 0x1D37, 0x2501, 0x1D38, 0x2502, 0x1D39,
- 0x2503, 0x1D3A, 0x2504, 0x1D3B, 0x2505, 0x1D3C, 0x2506, 0x1D3D,
- 0x2507, 0x1D3E, 0x2508, 0x1D3F, 0x2509, 0x1D40, 0x250A, 0x1D41,
- 0x250B, 0x1D42, 0x250C, 0x1D43, 0x250D, 0x1D44, 0x250E, 0x1D45,
- 0x250F, 0x1D46, 0x2510, 0x1D47, 0x2511, 0x1D48, 0x2512, 0x1D49,
- 0x2513, 0x1D4A, 0x2514, 0x1D4B, 0x2515, 0x1D4C, 0x2516, 0x1D4D,
- 0x2517, 0x1D4E, 0x2518, 0x1D4F, 0x2519, 0x1D50, 0x251A, 0x1D51,
- 0x251B, 0x1D52, 0x251C, 0x1D53, 0x251D, 0x1D54, 0x251E, 0x1D55,
- 0x251F, 0x1D56, 0x2520, 0x1D57, 0x2521, 0x1D58, 0x2522, 0x1D59,
- 0x2523, 0x1D5A, 0x2524, 0x1D5B, 0x2525, 0x1D5C, 0x2526, 0x1D5D,
- 0x2527, 0x1D5E, 0x2528, 0x1D5F, 0x2529, 0x1D60, 0x252A, 0x1D61,
- 0x252B, 0x1D62, 0x252C, 0x1D63, 0x252D, 0x1D64, 0x252E, 0x1D65,
- 0x252F, 0x1D66, 0x2530, 0x1D67, 0x2531, 0x1D68, 0x2532, 0x1D69,
- 0x2533, 0x1D6A, 0x2534, 0x1D6B, 0x2535, 0x1D6C, 0x2536, 0x1D6D,
- 0x2537, 0x1D6E, 0x2538, 0x1D6F, 0x2539, 0x1D70, 0x253A, 0x1D71,
- 0x253B, 0x1D72, 0x253C, 0x1D73, 0x253D, 0x1D74, 0x253E, 0x1D75,
- 0x253F, 0x1D76, 0x2540, 0x1D77, 0x2541, 0x1D78, 0x2542, 0x1D79,
- 0x2543, 0x1D7A, 0x2544, 0x1D7B, 0x2545, 0x1D7C, 0x2546, 0x1D7D,
- 0x2547, 0x1D7E, 0x2548, 0x1D7F, 0x2549, 0x1D80, 0x254A, 0x1D81,
- 0x254B, 0x1D82, 0x2550, 0x203B, 0x255E, 0x203C, 0x2561, 0x203E,
- 0x256A, 0x203D, 0x256D, 0x2037, 0x256E, 0x2038, 0x256F, 0x203A,
- 0x2570, 0x2039, 0x2571, 0x2045, 0x2572, 0x2046, 0x2573, 0x2047,
- 0x2581, 0x2026, 0x2582, 0x2027, 0x2583, 0x2028, 0x2584, 0x2029,
- 0x2585, 0x202A, 0x2586, 0x202B, 0x2587, 0x202C, 0x2588, 0x202D,
- 0x2589, 0x2034, 0x258A, 0x2033, 0x258B, 0x2032, 0x258C, 0x2031,
- 0x258D, 0x2030, 0x258E, 0x202F, 0x258F, 0x202E, 0x2594, 0x2035,
- 0x2595, 0x2036, 0x25A0, 0x02D9, 0x25A1, 0x02D8, 0x25A2, 0x1F4F,
- 0x25AA, 0x2FCF, 0x25AB, 0x2FCD, 0x25B2, 0x02DB, 0x25B3, 0x02DA,
- 0x25B6, 0x2FA3, 0x25B7, 0x1F4A, 0x25BC, 0x02DD, 0x25BD, 0x02DC,
- 0x25C0, 0x2FA2, 0x25C1, 0x1F49, 0x25C6, 0x02D7, 0x25C7, 0x02D6,
- 0x25C9, 0x2012, 0x25CB, 0x02D3, 0x25CC, 0x2906, 0x25CE, 0x02D5,
- 0x25CF, 0x02D4, 0x25E2, 0x203F, 0x25E3, 0x2040, 0x25E4, 0x2042,
- 0x25E5, 0x2041, 0x25E6, 0x2FDE, 0x25EF, 0x030B, 0x2600, 0x2017,
- 0x2601, 0x2018, 0x2602, 0x2019, 0x2603, 0x201A, 0x2605, 0x02D2,
- 0x2606, 0x02D1, 0x260E, 0x1F78, 0x2612, 0x2F99, 0x261C, 0x201C,
- 0x261D, 0x201D, 0x261E, 0x201B, 0x261F, 0x201E, 0x2640, 0x02C2,
- 0x2642, 0x02C1, 0x2660, 0x2013, 0x2661, 0x1F51, 0x2662, 0x1F53,
- 0x2663, 0x2015, 0x2664, 0x1F52, 0x2665, 0x2014, 0x2666, 0x2016,
- 0x2667, 0x1F50, 0x2668, 0x2F42, 0x2669, 0x2F43, 0x266A, 0x0307,
- 0x266C, 0x2F44, 0x266D, 0x0306, 0x266F, 0x0305, 0x2702, 0x2F90,
- 0x271A, 0x2FD1, 0x2756, 0x2FE3, 0x2776, 0x205E, 0x2777, 0x205F,
- 0x2778, 0x2060, 0x2779, 0x2061, 0x277A, 0x2062, 0x277B, 0x2063,
- 0x277C, 0x2064, 0x277D, 0x2065, 0x277E, 0x2066, 0x27A1, 0x200E,
- 0x2E83, 0x37E1, 0x2E85, 0x3620, 0x2E87, 0x3719, 0x2E89, 0x3814,
- 0x2E8B, 0x371E, 0x2E8C, 0x3609, 0x2E8D, 0x360A, 0x2E8E, 0x1071,
- 0x2E8F, 0x388C, 0x2E90, 0x1226, 0x2E92, 0x0EB2, 0x2E93, 0x1283,
- 0x2E94, 0x12AB, 0x2E95, 0x3C1F, 0x2E96, 0x38C2, 0x2E97, 0x361C,
- 0x2E98, 0x38E1, 0x2E99, 0x13C3, 0x2E9B, 0x13E1, 0x2E9F, 0x0E3C,
- 0x2EA0, 0x0EBD, 0x2EA1, 0x3961, 0x2EA2, 0x3962, 0x2EA3, 0x399D,
- 0x2EA4, 0x3C26, 0x2EA6, 0x374D, 0x2EA8, 0x39BC, 0x2EA9, 0x35A1,
- 0x2EAA, 0x36AB, 0x2EAB, 0x3A97, 0x2EAC, 0x08D4, 0x2EAD, 0x3A39,
- 0x2EAE, 0x3662, 0x2EB1, 0x3A98, 0x2EB2, 0x3A97, 0x2EB3, 0x376D,
- 0x2EB7, 0x36FE, 0x2EB9, 0x3713, 0x2EBC, 0x35B3, 0x2EBD, 0x354E,
- 0x2EBE, 0x3775, 0x2EBF, 0x3776, 0x2EC0, 0x3777, 0x2EC1, 0x078B,
- 0x2EC2, 0x3B0A, 0x2EC3, 0x362E, 0x2EC4, 0x0A62, 0x2EC6, 0x3572,
- 0x2ECA, 0x364A, 0x2ECC, 0x3C2B, 0x2ECD, 0x3B50, 0x2ECF, 0x3B9E,
- 0x2ED1, 0x0BD5, 0x2ED2, 0x3B97, 0x2ED6, 0x3B9E, 0x2ED7, 0x354D,
- 0x2ED8, 0x0A68, 0x2EDD, 0x3617, 0x2EDE, 0x3619, 0x2EDF, 0x3618,
- 0x2EE4, 0x064E, 0x2EE8, 0x0D34, 0x2EE9, 0x052B, 0x2EEB, 0x0A6A,
- 0x2EED, 0x08C3, 0x2EEF, 0x0F7D, 0x2EF2, 0x064F, 0x2F00, 0x04B0,
- 0x2F01, 0x20B3, 0x2F02, 0x0FFF, 0x2F03, 0x1001, 0x2F04, 0x0535,
- 0x2F05, 0x1006, 0x2F06, 0x0CCB, 0x2F07, 0x100E, 0x2F08, 0x0A13,
- 0x2F09, 0x1070, 0x2F0A, 0x0CD6, 0x2F0B, 0x0D40, 0x2F0C, 0x107B,
- 0x2F0D, 0x1083, 0x2F0E, 0x1089, 0x2F0F, 0x1093, 0x2F10, 0x1098,
- 0x2F11, 0x0C5B, 0x2F12, 0x0F97, 0x2F13, 0x10C6, 0x2F14, 0x10CD,
- 0x2F15, 0x10CE, 0x2F16, 0x10D3, 0x2F17, 0x0947, 0x2F18, 0x0E7C,
- 0x2F19, 0x10DC, 0x2F1A, 0x10E1, 0x2F1B, 0x10E8, 0x2F1C, 0x0EA2,
- 0x2F1D, 0x07B1, 0x2F1E, 0x116B, 0x2F1F, 0x0C54, 0x2F20, 0x089C,
- 0x2F21, 0x11BA, 0x2F22, 0x11BB, 0x2F23, 0x0F26, 0x2F24, 0x0B47,
- 0x2F25, 0x0981, 0x2F26, 0x08A0, 0x2F27, 0x120E, 0x2F28, 0x0A47,
- 0x2F29, 0x0996, 0x2F2A, 0x1226, 0x2F2B, 0x1228, 0x2F2C, 0x1232,
- 0x2F2D, 0x0881, 0x2F2E, 0x126C, 0x2F2F, 0x07BB, 0x2F30, 0x077E,
- 0x2F31, 0x06CA, 0x2F32, 0x05EF, 0x2F33, 0x1283, 0x2F34, 0x1285,
- 0x2F35, 0x1299, 0x2F36, 0x129B, 0x2F37, 0x12A0, 0x2F38, 0x0677,
- 0x2F39, 0x38B9, 0x2F3A, 0x12AF, 0x2F3B, 0x12B1, 0x2F3C, 0x09FA,
- 0x2F3D, 0x1342, 0x2F3E, 0x0781, 0x2F3F, 0x0916, 0x2F40, 0x08A7,
- 0x2F41, 0x13C2, 0x2F42, 0x0E08, 0x2F43, 0x0C47, 0x2F44, 0x06CC,
- 0x2F45, 0x0E4D, 0x2F46, 0x13E0, 0x2F47, 0x0CD4, 0x2F48, 0x140C,
- 0x2F49, 0x0744, 0x2F4A, 0x0EE6, 0x2F4B, 0x073D, 0x2F4C, 0x08AD,
- 0x2F4D, 0x14E5, 0x2F4E, 0x14F4, 0x2F4F, 0x14F8, 0x2F50, 0x0D7A,
- 0x2F51, 0x0EDF, 0x2F52, 0x08AF, 0x2F53, 0x1502, 0x2F54, 0x0A2B,
- 0x2F55, 0x0550, 0x2F56, 0x0BFA, 0x2F57, 0x0DD5, 0x2F58, 0x15E4,
- 0x2F59, 0x15E6, 0x2F5A, 0x0E22, 0x2F5B, 0x0567, 0x2F5C, 0x0687,
- 0x2F5D, 0x0758, 0x2F5E, 0x0770, 0x2F5F, 0x06C4, 0x2F60, 0x04DD,
- 0x2F61, 0x05E0, 0x2F62, 0x0601, 0x2F63, 0x0A5C, 0x2F64, 0x0F3B,
- 0x2F65, 0x0C3E, 0x2F66, 0x0D97, 0x2F67, 0x3A00, 0x2F68, 0x1697,
- 0x2F69, 0x0D28, 0x2F6A, 0x0D7D, 0x2F6B, 0x087C, 0x2F6C, 0x0EE8,
- 0x2F6D, 0x0EC3, 0x2F6E, 0x0EFC, 0x2F6F, 0x0A74, 0x2F70, 0x08D4,
- 0x2F71, 0x3A41, 0x2F72, 0x0553, 0x2F73, 0x0740, 0x2F74, 0x0F71,
- 0x2F75, 0x0B9B, 0x2F76, 0x0E16, 0x2F77, 0x08B3, 0x2F78, 0x0608,
- 0x2F79, 0x1813, 0x2F7A, 0x0F3D, 0x2F7B, 0x04CB, 0x2F7C, 0x0FDD,
- 0x2F7D, 0x08D5, 0x2F7E, 0x183D, 0x2F7F, 0x08D6, 0x2F80, 0x1853,
- 0x2F81, 0x0CD1, 0x2F82, 0x0A09, 0x2F83, 0x08D7, 0x2F84, 0x08B8,
- 0x2F85, 0x04D3, 0x2F86, 0x0A89, 0x2F87, 0x0AA6, 0x2F88, 0x0938,
- 0x2F89, 0x0821, 0x2F8A, 0x09ED, 0x2F8B, 0x18B2, 0x2F8C, 0x194F,
- 0x2F8D, 0x0BAC, 0x2F8E, 0x0742, 0x2F8F, 0x07E6, 0x2F90, 0x04A5,
- 0x2F91, 0x19EB, 0x2F92, 0x075F, 0x2F93, 0x05AF, 0x2F94, 0x0774,
- 0x2F95, 0x0B69, 0x2F96, 0x0C7E, 0x2F97, 0x1A56, 0x2F98, 0x1A59,
- 0x2F99, 0x058B, 0x2F9A, 0x0A7A, 0x2F9B, 0x0AF8, 0x2F9C, 0x0B0D,
- 0x2F9D, 0x0A0E, 0x2F9E, 0x0902, 0x2F9F, 0x0A0F, 0x2FA0, 0x0B62,
- 0x2FA1, 0x3B4F, 0x2FA2, 0x0F22, 0x2FA3, 0x0CAB, 0x2FA4, 0x0D64,
- 0x2FA5, 0x0F6C, 0x2FA6, 0x06DA, 0x2FA7, 0x0BD5, 0x2FA8, 0x0EF3,
- 0x2FA9, 0x0DDE, 0x2FAA, 0x1BC9, 0x2FAB, 0x1BCB, 0x2FAC, 0x04CD,
- 0x2FAD, 0x21F7, 0x2FAE, 0x0D87, 0x2FAF, 0x0ED8, 0x2FB0, 0x05B5,
- 0x2FB1, 0x1C03, 0x2FB2, 0x1C05, 0x2FB3, 0x053B, 0x2FB4, 0x0E17,
- 0x2FB5, 0x0DE9, 0x2FB6, 0x0D88, 0x2FB7, 0x09EF, 0x2FB8, 0x091F,
- 0x2FB9, 0x07F3, 0x2FBA, 0x0D05, 0x2FBB, 0x080E, 0x2FBC, 0x07F4,
- 0x2FBD, 0x1C6C, 0x2FBE, 0x1C7D, 0x2FBF, 0x1C83, 0x2FC0, 0x1C84,
- 0x2FC1, 0x064E, 0x2FC2, 0x0695, 0x2FC3, 0x0BD7, 0x2FC4, 0x1CF6,
- 0x2FC5, 0x08DB, 0x2FC6, 0x1D01, 0x2FC7, 0x0E91, 0x2FC8, 0x340B,
- 0x2FC9, 0x066A, 0x2FCA, 0x0807, 0x2FCB, 0x1D16, 0x2FCC, 0x1D19,
- 0x2FCD, 0x0C1E, 0x2FCE, 0x0791, 0x2FCF, 0x0ACF, 0x2FD0, 0x0D93,
- 0x2FD1, 0x1D21, 0x2FD2, 0x1D22, 0x2FD3, 0x0F7E, 0x2FD4, 0x1D30,
- 0x2FD5, 0x1D31, 0x3000, 0x0279, 0x3001, 0x027A, 0x3002, 0x027B,
- 0x3003, 0x028F, 0x3004, 0x2074, 0x3005, 0x0291, 0x3006, 0x0292,
- 0x3007, 0x0293, 0x3008, 0x02AA, 0x3009, 0x02AB, 0x300A, 0x02AC,
- 0x300B, 0x02AD, 0x300C, 0x02AE, 0x300D, 0x02AF, 0x300E, 0x02B0,
- 0x300F, 0x02B1, 0x3010, 0x02B2, 0x3011, 0x02B3, 0x3012, 0x02DF,
- 0x3013, 0x02E4, 0x3014, 0x02A4, 0x3015, 0x02A5, 0x301C, 0x0299,
- 0x301D, 0x1DB8, 0x301F, 0x1DB9, 0x3020, 0x1F7A, 0x3030, 0x2FBA,
- 0x3033, 0x2F4C, 0x3034, 0x2F4D, 0x3035, 0x2F4E, 0x3036, 0x1F79,
- 0x3041, 0x034A, 0x3042, 0x034B, 0x3043, 0x034C, 0x3044, 0x034D,
- 0x3045, 0x034E, 0x3046, 0x034F, 0x3047, 0x0350, 0x3048, 0x0351,
- 0x3049, 0x0352, 0x304A, 0x0353, 0x304B, 0x0354, 0x304C, 0x0355,
- 0x304D, 0x0356, 0x304E, 0x0357, 0x304F, 0x0358, 0x3050, 0x0359,
- 0x3051, 0x035A, 0x3052, 0x035B, 0x3053, 0x035C, 0x3054, 0x035D,
- 0x3055, 0x035E, 0x3056, 0x035F, 0x3057, 0x0360, 0x3058, 0x0361,
- 0x3059, 0x0362, 0x305A, 0x0363, 0x305B, 0x0364, 0x305C, 0x0365,
- 0x305D, 0x0366, 0x305E, 0x0367, 0x305F, 0x0368, 0x3060, 0x0369,
- 0x3061, 0x036A, 0x3062, 0x036B, 0x3063, 0x036C, 0x3064, 0x036D,
- 0x3065, 0x036E, 0x3066, 0x036F, 0x3067, 0x0370, 0x3068, 0x0371,
- 0x3069, 0x0372, 0x306A, 0x0373, 0x306B, 0x0374, 0x306C, 0x0375,
- 0x306D, 0x0376, 0x306E, 0x0377, 0x306F, 0x0378, 0x3070, 0x0379,
- 0x3071, 0x037A, 0x3072, 0x037B, 0x3073, 0x037C, 0x3074, 0x037D,
- 0x3075, 0x037E, 0x3076, 0x037F, 0x3077, 0x0380, 0x3078, 0x0381,
- 0x3079, 0x0382, 0x307A, 0x0383, 0x307B, 0x0384, 0x307C, 0x0385,
- 0x307D, 0x0386, 0x307E, 0x0387, 0x307F, 0x0388, 0x3080, 0x0389,
- 0x3081, 0x038A, 0x3082, 0x038B, 0x3083, 0x038C, 0x3084, 0x038D,
- 0x3085, 0x038E, 0x3086, 0x038F, 0x3087, 0x0390, 0x3088, 0x0391,
- 0x3089, 0x0392, 0x308A, 0x0393, 0x308B, 0x0394, 0x308C, 0x0395,
- 0x308D, 0x0396, 0x308E, 0x0397, 0x308F, 0x0398, 0x3090, 0x0399,
- 0x3091, 0x039A, 0x3092, 0x039B, 0x3093, 0x039C, 0x3094, 0x1F16,
- 0x309B, 0x0283, 0x309C, 0x0284, 0x309D, 0x028D, 0x309E, 0x028E,
- 0x30A1, 0x039D, 0x30A2, 0x039E, 0x30A3, 0x039F, 0x30A4, 0x03A0,
- 0x30A5, 0x03A1, 0x30A6, 0x03A2, 0x30A7, 0x03A3, 0x30A8, 0x03A4,
- 0x30A9, 0x03A5, 0x30AA, 0x03A6, 0x30AB, 0x03A7, 0x30AC, 0x03A8,
- 0x30AD, 0x03A9, 0x30AE, 0x03AA, 0x30AF, 0x03AB, 0x30B0, 0x03AC,
- 0x30B1, 0x03AD, 0x30B2, 0x03AE, 0x30B3, 0x03AF, 0x30B4, 0x03B0,
- 0x30B5, 0x03B1, 0x30B6, 0x03B2, 0x30B7, 0x03B3, 0x30B8, 0x03B4,
- 0x30B9, 0x03B5, 0x30BA, 0x03B6, 0x30BB, 0x03B7, 0x30BC, 0x03B8,
- 0x30BD, 0x03B9, 0x30BE, 0x03BA, 0x30BF, 0x03BB, 0x30C0, 0x03BC,
- 0x30C1, 0x03BD, 0x30C2, 0x03BE, 0x30C3, 0x03BF, 0x30C4, 0x03C0,
- 0x30C5, 0x03C1, 0x30C6, 0x03C2, 0x30C7, 0x03C3, 0x30C8, 0x03C4,
- 0x30C9, 0x03C5, 0x30CA, 0x03C6, 0x30CB, 0x03C7, 0x30CC, 0x03C8,
- 0x30CD, 0x03C9, 0x30CE, 0x03CA, 0x30CF, 0x03CB, 0x30D0, 0x03CC,
- 0x30D1, 0x03CD, 0x30D2, 0x03CE, 0x30D3, 0x03CF, 0x30D4, 0x03D0,
- 0x30D5, 0x03D1, 0x30D6, 0x03D2, 0x30D7, 0x03D3, 0x30D8, 0x03D4,
- 0x30D9, 0x03D5, 0x30DA, 0x03D6, 0x30DB, 0x03D7, 0x30DC, 0x03D8,
- 0x30DD, 0x03D9, 0x30DE, 0x03DA, 0x30DF, 0x03DB, 0x30E0, 0x03DC,
- 0x30E1, 0x03DD, 0x30E2, 0x03DE, 0x30E3, 0x03DF, 0x30E4, 0x03E0,
- 0x30E5, 0x03E1, 0x30E6, 0x03E2, 0x30E7, 0x03E3, 0x30E8, 0x03E4,
- 0x30E9, 0x03E5, 0x30EA, 0x03E6, 0x30EB, 0x03E7, 0x30EC, 0x03E8,
- 0x30ED, 0x03E9, 0x30EE, 0x03EA, 0x30EF, 0x03EB, 0x30F0, 0x03EC,
- 0x30F1, 0x03ED, 0x30F2, 0x03EE, 0x30F3, 0x03EF, 0x30F4, 0x03F0,
- 0x30F5, 0x03F1, 0x30F6, 0x03F2, 0x30F7, 0x2079, 0x30F8, 0x207A,
- 0x30F9, 0x207B, 0x30FA, 0x207C, 0x30FB, 0x027E, 0x30FC, 0x0294,
- 0x30FD, 0x028B, 0x30FE, 0x028C, 0x3220, 0x278E, 0x3221, 0x278F,
- 0x3222, 0x2790, 0x3223, 0x2791, 0x3224, 0x2792, 0x3225, 0x2793,
- 0x3226, 0x2794, 0x3227, 0x2795, 0x3228, 0x2796, 0x3229, 0x2797,
- 0x322A, 0x2006, 0x322B, 0x2007, 0x322C, 0x2008, 0x322D, 0x2009,
- 0x322E, 0x200A, 0x322F, 0x200B, 0x3230, 0x2005, 0x3231, 0x1DC2,
- 0x3232, 0x1DC3, 0x3233, 0x1FCF, 0x3234, 0x1FCD, 0x3235, 0x1FD4,
- 0x3236, 0x1FD3, 0x3237, 0x200C, 0x3238, 0x1FCE, 0x3239, 0x1DC4,
- 0x323A, 0x1FD7, 0x323B, 0x1FD5, 0x323C, 0x1FD0, 0x323D, 0x1FCB,
- 0x323E, 0x1FD2, 0x323F, 0x1FCC, 0x3240, 0x1FD6, 0x3241, 0x200D,
- 0x3242, 0x1FD1, 0x3243, 0x1FCA, 0x3280, 0x28DD, 0x3281, 0x28DE,
- 0x3282, 0x28DF, 0x3283, 0x28E0, 0x3284, 0x28E1, 0x3285, 0x28E2,
- 0x3286, 0x28E3, 0x3287, 0x28E4, 0x3288, 0x28E5, 0x3289, 0x28E6,
- 0x328A, 0x28E8, 0x328B, 0x28E9, 0x328C, 0x28EA, 0x328D, 0x28EB,
- 0x328E, 0x28EC, 0x328F, 0x28ED, 0x3290, 0x28E7, 0x3291, 0x1FE1,
- 0x3292, 0x1FE0, 0x3293, 0x1FE2, 0x3294, 0x1FDC, 0x3295, 0x28FF,
- 0x3296, 0x1FE5, 0x3297, 0x28FC, 0x3298, 0x1FDE, 0x3299, 0x201F,
- 0x329A, 0x28F9, 0x329B, 0x28F8, 0x329C, 0x28FE, 0x329D, 0x207F,
- 0x329E, 0x1FFF, 0x329F, 0x28EF, 0x32A0, 0x28F6, 0x32A1, 0x28F7,
- 0x32A2, 0x28FB, 0x32A3, 0x28FA, 0x32A4, 0x1DBD, 0x32A5, 0x1DBE,
- 0x32A6, 0x1DBF, 0x32A7, 0x1DC0, 0x32A8, 0x1DC1, 0x32A9, 0x1FDA,
- 0x32AA, 0x1FDD, 0x32AB, 0x1FDF, 0x32AC, 0x1FE3, 0x32AD, 0x1FD9,
- 0x32AE, 0x1FE4, 0x32AF, 0x1FDB, 0x32B0, 0x1FD8, 0x32D0, 0x28AD,
- 0x32D1, 0x28AE, 0x32D2, 0x28AF, 0x32D3, 0x28B0, 0x32D4, 0x28B1,
- 0x32D5, 0x28B2, 0x32D6, 0x28B3, 0x32D7, 0x28B4, 0x32D8, 0x28B5,
- 0x32D9, 0x28B6, 0x32DA, 0x28B7, 0x32DB, 0x28B8, 0x32DC, 0x28B9,
- 0x32DD, 0x28BA, 0x32DE, 0x28BB, 0x32DF, 0x28BC, 0x32E0, 0x28BD,
- 0x32E1, 0x28BE, 0x32E2, 0x28BF, 0x32E3, 0x28C0, 0x32E4, 0x28C1,
- 0x32E5, 0x28C2, 0x32E6, 0x28C3, 0x32E7, 0x28C4, 0x32E8, 0x28C5,
- 0x32E9, 0x28C6, 0x32EA, 0x28C7, 0x32EB, 0x28C8, 0x32EC, 0x28C9,
- 0x32ED, 0x28CA, 0x32EE, 0x28CB, 0x32EF, 0x28CC, 0x32F0, 0x28CD,
- 0x32F1, 0x28CE, 0x32F2, 0x28CF, 0x32F3, 0x28D0, 0x32F4, 0x28D1,
- 0x32F5, 0x28D2, 0x32F6, 0x28D3, 0x32F7, 0x28D4, 0x32F8, 0x28D5,
- 0x32F9, 0x28D6, 0x32FA, 0x28D7, 0x32FB, 0x28D8, 0x32FC, 0x28D9,
- 0x32FD, 0x28DA, 0x32FE, 0x28DB, 0x3300, 0x1F70, 0x3301, 0x2E62,
- 0x3302, 0x2E63, 0x3303, 0x1F6A, 0x3304, 0x2E64, 0x3305, 0x1FF7,
- 0x3306, 0x2E65, 0x3307, 0x2E69, 0x3308, 0x2E67, 0x3309, 0x2E6C,
- 0x330A, 0x2E6A, 0x330B, 0x2E6E, 0x330C, 0x2E70, 0x330D, 0x1DAB,
- 0x330E, 0x2E71, 0x330F, 0x2E72, 0x3310, 0x2E73, 0x3311, 0x2E74,
- 0x3312, 0x2E75, 0x3313, 0x2E76, 0x3314, 0x1DA2, 0x3315, 0x1F69,
- 0x3316, 0x1F67, 0x3317, 0x2E78, 0x3318, 0x1F68, 0x3319, 0x2E7A,
- 0x331A, 0x2E7C, 0x331B, 0x2E7D, 0x331C, 0x2E7E, 0x331D, 0x2E7F,
- 0x331E, 0x1F73, 0x331F, 0x2E80, 0x3320, 0x2E81, 0x3321, 0x2E82,
- 0x3322, 0x1F66, 0x3323, 0x1F6B, 0x3324, 0x2E83, 0x3325, 0x2E85,
- 0x3326, 0x1DAC, 0x3327, 0x1DA6, 0x3328, 0x2E88, 0x3329, 0x2E89,
- 0x332A, 0x1F74, 0x332B, 0x1DAE, 0x332D, 0x2E8B, 0x332E, 0x2E8E,
- 0x332F, 0x2E8F, 0x3330, 0x2E90, 0x3331, 0x1F71, 0x3332, 0x2E91,
- 0x3333, 0x2087, 0x3334, 0x2E94, 0x3335, 0x2E95, 0x3336, 0x1DA8,
- 0x3337, 0x2E9A, 0x3338, 0x2E9C, 0x3339, 0x1F6E, 0x333A, 0x2E9D,
- 0x333B, 0x1F6F, 0x333C, 0x2E96, 0x333D, 0x2E9E, 0x333E, 0x2EA0,
- 0x333F, 0x2EA1, 0x3340, 0x2EA2, 0x3341, 0x2E9F, 0x3342, 0x1F6D,
- 0x3343, 0x2EA3, 0x3344, 0x2EA4, 0x3345, 0x2EA5, 0x3346, 0x2EA6,
- 0x3347, 0x1F72, 0x3348, 0x2EA7, 0x3349, 0x1DA1, 0x334A, 0x1DAF,
- 0x334B, 0x2EA8, 0x334C, 0x2EA9, 0x334D, 0x1DA4, 0x334E, 0x2088,
- 0x334F, 0x2EAA, 0x3350, 0x2EAB, 0x3351, 0x1DA9, 0x3352, 0x2EAE,
- 0x3353, 0x2EB2, 0x3354, 0x2EAF, 0x3355, 0x2EB3, 0x3356, 0x2EB4,
- 0x3357, 0x1F6C, 0x3371, 0x2E55, 0x337B, 0x2083, 0x337C, 0x1DC7,
- 0x337D, 0x1DC6, 0x337E, 0x1DC5, 0x337F, 0x1F76, 0x3385, 0x1F5F,
- 0x3386, 0x1F60, 0x3387, 0x1F61, 0x3388, 0x2000, 0x3389, 0x2001,
- 0x338D, 0x2E58, 0x338E, 0x1DB4, 0x338F, 0x1DB5, 0x3390, 0x1F63,
- 0x3396, 0x1F65, 0x3397, 0x1F58, 0x3398, 0x1F5A, 0x339B, 0x2E59,
- 0x339C, 0x1DB1, 0x339D, 0x1DB2, 0x339E, 0x1DB3, 0x339F, 0x1FFA,
- 0x33A0, 0x1F54, 0x33A1, 0x1DB7, 0x33A2, 0x1F55, 0x33A3, 0x1FFB,
- 0x33A4, 0x1F56, 0x33A5, 0x1F57, 0x33A6, 0x1FFC, 0x33B0, 0x1F5E,
- 0x33B1, 0x1F5D, 0x33B2, 0x1F5C, 0x33B3, 0x1F5B, 0x33C2, 0x2E50,
- 0x33C4, 0x1DB6, 0x33C8, 0x2002, 0x33CB, 0x1F62, 0x33CC, 0x1FF6,
- 0x33CD, 0x1DBB, 0x33D4, 0x1F64, 0x33D7, 0x2E5D, 0x33D8, 0x2E5E,
- 0x33DA, 0x2E4B, 0x3402, 0x3582, 0x3405, 0x3C1B, 0x3427, 0x3656,
- 0x3488, 0x3C52, 0x34DB, 0x3C41, 0x351F, 0x3629, 0x353E, 0x371E,
- 0x378D, 0x361A, 0x37E2, 0x372B, 0x3AF3, 0x3C40, 0x3B22, 0x3C49,
- 0x3B88, 0x368D, 0x3E8A, 0x3C43, 0x3EDA, 0x3C48, 0x3FB1, 0x3754,
- 0x4093, 0x3C4C, 0x4103, 0x3C4F, 0x4264, 0x3760, 0x4293, 0x3C50,
- 0x440C, 0x3C42, 0x4453, 0x3773, 0x457A, 0x3C4B, 0x4665, 0x3C4E,
- 0x46AE, 0x3C51, 0x4BE8, 0x3C46, 0x4E00, 0x04B0, 0x4E01, 0x0BB8,
- 0x4E03, 0x08E3, 0x4E04, 0x37D8, 0x4E05, 0x37D9, 0x4E07, 0x0EAA,
- 0x4E08, 0x09CE, 0x4E09, 0x087E, 0x4E0A, 0x09CD, 0x4E0B, 0x053C,
- 0x4E0D, 0x0DC6, 0x4E0E, 0x0F29, 0x4E10, 0x0FFB, 0x4E11, 0x04D1,
- 0x4E14, 0x05CC, 0x4E15, 0x0FFC, 0x4E16, 0x0A48, 0x4E17, 0x10D7,
- 0x4E18, 0x0670, 0x4E19, 0x0E0A, 0x4E1E, 0x09CF, 0x4E1F, 0x37DA,
- 0x4E21, 0x0F86, 0x4E26, 0x0E12, 0x4E28, 0x20B3, 0x4E2A, 0x0FFD,
- 0x4E2B, 0x37DB, 0x4E2C, 0x374D, 0x4E2D, 0x0BA4, 0x4E2F, 0x37DC,
- 0x4E30, 0x37DD, 0x4E31, 0x0FFE, 0x4E32, 0x06F2, 0x4E36, 0x0FFF,
- 0x4E37, 0x369D, 0x4E38, 0x0619, 0x4E39, 0x0B6E, 0x4E3B, 0x0913,
- 0x4E3C, 0x1000, 0x4E3F, 0x1001, 0x4E40, 0x37DE, 0x4E41, 0x37DF,
- 0x4E42, 0x1002, 0x4E43, 0x0CEB, 0x4E44, 0x37E0, 0x4E45, 0x0671,
- 0x4E48, 0x372E, 0x4E4B, 0x0CED, 0x4E4D, 0x0CBB, 0x4E4E, 0x0777,
- 0x4E4F, 0x0E61, 0x4E55, 0x1950, 0x4E56, 0x1003, 0x4E57, 0x09D0,
- 0x4E58, 0x1004, 0x4E59, 0x0535, 0x4E5A, 0x37E1, 0x4E5D, 0x06DD,
- 0x4E5E, 0x07A4, 0x4E5F, 0x0EF5, 0x4E62, 0x1233, 0x4E71, 0x0F5A,
- 0x4E73, 0x0CD5, 0x4E7E, 0x05E1, 0x4E7F, 0x37E2, 0x4E80, 0x064F,
- 0x4E82, 0x1005, 0x4E85, 0x1006, 0x4E86, 0x0F83, 0x4E88, 0x0F27,
- 0x4E89, 0x0AEA, 0x4E8A, 0x1008, 0x4E8B, 0x08C4, 0x4E8C, 0x0CCB,
- 0x4E8D, 0x37E3, 0x4E8E, 0x100B, 0x4E91, 0x04E0, 0x4E92, 0x0793,
- 0x4E94, 0x0792, 0x4E95, 0x04AA, 0x4E96, 0x37E4, 0x4E98, 0x0FF1,
- 0x4E99, 0x0FF0, 0x4E9B, 0x0823, 0x4E9C, 0x0465, 0x4E9E, 0x100C,
- 0x4E9F, 0x100D, 0x4EA0, 0x100E, 0x4EA1, 0x0E62, 0x4EA2, 0x100F,
- 0x4EA4, 0x07A6, 0x4EA5, 0x04AB, 0x4EA6, 0x0EA0, 0x4EA8, 0x0696,
- 0x4EAB, 0x0697, 0x4EAC, 0x0698, 0x4EAD, 0x0BFE, 0x4EAE, 0x0F84,
- 0x4EB0, 0x1010, 0x4EB3, 0x1011, 0x4EB6, 0x1012, 0x4EB9, 0x37E5,
- 0x4EBA, 0x0A13, 0x4EBB, 0x3620, 0x4EC0, 0x0944, 0x4EC1, 0x0A14,
- 0x4EC2, 0x1017, 0x4EC4, 0x1015, 0x4EC6, 0x1016, 0x4EC7, 0x0672,
- 0x4ECA, 0x0813, 0x4ECB, 0x0570, 0x4ECD, 0x1014, 0x4ECE, 0x1013,
- 0x4ECF, 0x0DF9, 0x4ED0, 0x37E6, 0x4ED4, 0x0894, 0x4ED5, 0x0893,
- 0x4ED6, 0x0B1E, 0x4ED7, 0x1018, 0x4ED8, 0x0DC7, 0x4ED9, 0x0A8B,
- 0x4EDD, 0x0290, 0x4EDE, 0x1019, 0x4EDF, 0x101B, 0x4EE0, 0x37E7,
- 0x4EE1, 0x20B4, 0x4EE3, 0x0B45, 0x4EE4, 0x0FA9, 0x4EE5, 0x048E,
- 0x4EED, 0x101A, 0x4EEE, 0x053E, 0x4EF0, 0x06BC, 0x4EF2, 0x0BA5,
- 0x4EF6, 0x0745, 0x4EF7, 0x101C, 0x4EFB, 0x0CDA, 0x4EFC, 0x20B5,
- 0x4EFD, 0x37E8, 0x4EFF, 0x37E9, 0x4F00, 0x20B6, 0x4F01, 0x0627,
- 0x4F03, 0x20B7, 0x4F09, 0x101D, 0x4F0A, 0x048F, 0x4F0B, 0x37EA,
- 0x4F0D, 0x0794, 0x4F0E, 0x0628, 0x4F0F, 0x0DEC, 0x4F10, 0x0D46,
- 0x4F11, 0x0673, 0x4F15, 0x37EB, 0x4F1A, 0x0571, 0x4F1C, 0x1040,
- 0x4F1D, 0x0C3B, 0x4F2F, 0x0D22, 0x4F30, 0x101F, 0x4F34, 0x0D50,
- 0x4F36, 0x0FAA, 0x4F38, 0x09F3, 0x4F39, 0x20B8, 0x4F3A, 0x0895,
- 0x4F3B, 0x37ED, 0x4F3C, 0x08C5, 0x4F3D, 0x0540, 0x4F43, 0x0BED,
- 0x4F46, 0x0B60, 0x4F47, 0x1023, 0x4F49, 0x37EE, 0x4F4D, 0x0490,
- 0x4F4E, 0x0BFF, 0x4F4F, 0x0945, 0x4F50, 0x0824, 0x4F51, 0x0F0E,
- 0x4F53, 0x0B2E, 0x4F54, 0x37EF, 0x4F55, 0x053F, 0x4F56, 0x20B9,
- 0x4F57, 0x1022, 0x4F59, 0x0F28, 0x4F5A, 0x101E, 0x4F5B, 0x1020,
- 0x4F5C, 0x085E, 0x4F5D, 0x1021, 0x4F5E, 0x11D3, 0x4F60, 0x37EC,
- 0x4F69, 0x1029, 0x4F6F, 0x102C, 0x4F70, 0x102A, 0x4F73, 0x0542,
- 0x4F75, 0x0E0B, 0x4F76, 0x1024, 0x4F7A, 0x37F0, 0x4F7B, 0x1028,
- 0x4F7C, 0x07A7, 0x4F7D, 0x37F1, 0x4F7E, 0x37F2, 0x4F7F, 0x0896,
- 0x4F83, 0x05E2, 0x4F86, 0x102D, 0x4F88, 0x1025, 0x4F8A, 0x20BB,
- 0x4F8B, 0x0FAB, 0x4F8D, 0x08C6, 0x4F8F, 0x1026, 0x4F91, 0x102B,
- 0x4F92, 0x20BA, 0x4F94, 0x20BD, 0x4F96, 0x102E, 0x4F97, 0x37F3,
- 0x4F98, 0x1027, 0x4F9A, 0x20BC, 0x4F9B, 0x0699, 0x4F9D, 0x0491,
- 0x4FA0, 0x069A, 0x4FA1, 0x0541, 0x4FAB, 0x11D4, 0x4FAD, 0x0EA7,
- 0x4FAE, 0x0DE0, 0x4FAF, 0x07A8, 0x4FB5, 0x09F5, 0x4FB6, 0x0F7F,
- 0x4FBE, 0x37F4, 0x4FBF, 0x0E28, 0x4FC2, 0x070E, 0x4FC3, 0x0B05,
- 0x4FC4, 0x0564, 0x4FC9, 0x20AC, 0x4FCA, 0x095D, 0x4FCD, 0x20BE,
- 0x4FCE, 0x1032, 0x4FCF, 0x37F5, 0x4FD0, 0x1037, 0x4FD1, 0x1035,
- 0x4FD3, 0x3C2F, 0x4FD4, 0x1030, 0x4FD7, 0x0B0F, 0x4FD8, 0x1033,
- 0x4FDA, 0x1036, 0x4FDB, 0x1034, 0x4FDD, 0x0E2D, 0x4FDF, 0x1031,
- 0x4FE0, 0x1DEC, 0x4FE1, 0x09F4, 0x4FE3, 0x0EA1, 0x4FE4, 0x1038,
- 0x4FE5, 0x1039, 0x4FEE, 0x092E, 0x4FEF, 0x1046, 0x4FF3, 0x0D06,
- 0x4FF5, 0x0DA8, 0x4FF6, 0x1041, 0x4FF8, 0x0E40, 0x4FFA, 0x0536,
- 0x4FFD, 0x37F6, 0x4FFE, 0x1045, 0x4FFF, 0x20C1, 0x5000, 0x37F7,
- 0x5001, 0x37F8, 0x5002, 0x3447, 0x5005, 0x103F, 0x5006, 0x1048,
- 0x5009, 0x0AD4, 0x500B, 0x0778, 0x500D, 0x0D12, 0x500F, 0x1600,
- 0x5010, 0x37F9, 0x5011, 0x1047, 0x5012, 0x0C57, 0x5014, 0x103C,
- 0x5016, 0x07AA, 0x5019, 0x07A9, 0x501A, 0x103A, 0x501B, 0x37FA,
- 0x501E, 0x20C2, 0x501F, 0x0906, 0x5021, 0x1042, 0x5022, 0x20C0,
- 0x5023, 0x0E3F, 0x5024, 0x0B8B, 0x5025, 0x103E, 0x5026, 0x0747,
- 0x5027, 0x37FB, 0x5028, 0x103B, 0x5029, 0x1043, 0x502A, 0x103D,
- 0x502B, 0x0F99, 0x502C, 0x1044, 0x502D, 0x0FE7, 0x502E, 0x37FC,
- 0x5036, 0x06DE, 0x5039, 0x0746, 0x503B, 0x3800, 0x5040, 0x20BF,
- 0x5042, 0x20C5, 0x5043, 0x1049, 0x5046, 0x20C3, 0x5047, 0x104A,
- 0x5048, 0x104E, 0x5049, 0x0492, 0x504F, 0x0E20, 0x5050, 0x104D,
- 0x5055, 0x104C, 0x5056, 0x1050, 0x5057, 0x37FD, 0x505A, 0x104F,
- 0x505C, 0x0C00, 0x5065, 0x0748, 0x5066, 0x37FE, 0x506A, 0x37FF,
- 0x506C, 0x1051, 0x5070, 0x20C4, 0x5072, 0x08F1, 0x5074, 0x0B06,
- 0x5075, 0x0C01, 0x5076, 0x06EE, 0x5078, 0x1052, 0x507D, 0x0650,
- 0x5080, 0x1053, 0x5085, 0x1055, 0x508D, 0x0E63, 0x508F, 0x3801,
- 0x5091, 0x073C, 0x5094, 0x20C6, 0x5096, 0x3802, 0x5098, 0x087F,
- 0x5099, 0x0D8B, 0x509A, 0x1054, 0x509C, 0x3803, 0x50AC, 0x0835,
- 0x50AD, 0x0F2D, 0x50B2, 0x1057, 0x50B3, 0x105A, 0x50B4, 0x1056,
- 0x50B5, 0x0834, 0x50B7, 0x0987, 0x50BE, 0x070F, 0x50C2, 0x105B,
- 0x50C5, 0x06C7, 0x50C9, 0x1058, 0x50CA, 0x1059, 0x50CC, 0x3804,
- 0x50CD, 0x0C87, 0x50CF, 0x0AFE, 0x50D1, 0x069B, 0x50D5, 0x0E7B,
- 0x50D6, 0x105C, 0x50D8, 0x20C8, 0x50D9, 0x3C30, 0x50DA, 0x0F85,
- 0x50DE, 0x105D, 0x50E3, 0x1060, 0x50E5, 0x105E, 0x50E6, 0x3805,
- 0x50E7, 0x0AD0, 0x50E9, 0x3806, 0x50ED, 0x105F, 0x50EE, 0x1061,
- 0x50EF, 0x3807, 0x50F0, 0x3C31, 0x50F4, 0x20C7, 0x50F5, 0x1063,
- 0x50F9, 0x1062, 0x50FB, 0x0E18, 0x5100, 0x0651, 0x5101, 0x1065,
- 0x5102, 0x1066, 0x5104, 0x052F, 0x5108, 0x3808, 0x5109, 0x1064,
- 0x510B, 0x3809, 0x5110, 0x380A, 0x5112, 0x0920, 0x5114, 0x1069,
- 0x5115, 0x1068, 0x5116, 0x1067, 0x5118, 0x102F, 0x511A, 0x106A,
- 0x511B, 0x380B, 0x511E, 0x380C, 0x511F, 0x0988, 0x5121, 0x106B,
- 0x512A, 0x0F0F, 0x5132, 0x0EE5, 0x5137, 0x106D, 0x513A, 0x106C,
- 0x513B, 0x106F, 0x513C, 0x106E, 0x513F, 0x1070, 0x5140, 0x1071,
- 0x5141, 0x04B8, 0x5143, 0x0769, 0x5144, 0x0711, 0x5145, 0x0946,
- 0x5146, 0x0BB9, 0x5147, 0x069C, 0x5148, 0x0A8C, 0x5149, 0x07AB,
- 0x514A, 0x20C9, 0x514B, 0x0800, 0x514C, 0x1073, 0x514D, 0x0ED4,
- 0x514E, 0x0C40, 0x5150, 0x08C7, 0x5152, 0x1072, 0x5154, 0x1074,
- 0x515A, 0x0C58, 0x515C, 0x05D3, 0x515F, 0x380D, 0x5162, 0x1075,
- 0x5164, 0x20CA, 0x5165, 0x0CD6, 0x5167, 0x368E, 0x5168, 0x0AB6,
- 0x5169, 0x1077, 0x516A, 0x1078, 0x516B, 0x0D40, 0x516C, 0x07AC,
- 0x516D, 0x0FE1, 0x516E, 0x1079, 0x5171, 0x069E, 0x5175, 0x0E0C,
- 0x5176, 0x0B16, 0x5177, 0x06E9, 0x5178, 0x0C2F, 0x5179, 0x3779,
- 0x517C, 0x0749, 0x5180, 0x107A, 0x5182, 0x107B, 0x5185, 0x0CBA,
- 0x5186, 0x0501, 0x5189, 0x107E, 0x518A, 0x086D, 0x518C, 0x107D,
- 0x518D, 0x0836, 0x518F, 0x107F, 0x5190, 0x185B, 0x5191, 0x1080,
- 0x5192, 0x0E6F, 0x5193, 0x1081, 0x5195, 0x1082, 0x5196, 0x1083,
- 0x5197, 0x09D1, 0x5199, 0x08F8, 0x519D, 0x20CB, 0x51A0, 0x05E3,
- 0x51A1, 0x380E, 0x51A2, 0x1086, 0x51A4, 0x1084, 0x51A5, 0x0EC9,
- 0x51A6, 0x1085, 0x51A8, 0x0DCC, 0x51A9, 0x1087, 0x51AA, 0x1088,
- 0x51AB, 0x1089, 0x51AC, 0x0C59, 0x51B0, 0x108D, 0x51B1, 0x108B,
- 0x51B2, 0x108C, 0x51B3, 0x108A, 0x51B4, 0x0853, 0x51B5, 0x108E,
- 0x51B6, 0x0EF6, 0x51B7, 0x0FAC, 0x51BC, 0x380F, 0x51BD, 0x108F,
- 0x51BE, 0x20CC, 0x51C3, 0x3C32, 0x51C4, 0x0A4C, 0x51C5, 0x1090,
- 0x51C6, 0x0964, 0x51C9, 0x1091, 0x51CB, 0x0BBA, 0x51CC, 0x0F87,
- 0x51CD, 0x0C5A, 0x51D6, 0x10DA, 0x51DB, 0x1092, 0x51DC, 0x205C,
- 0x51DD, 0x06BD, 0x51DE, 0x3810, 0x51E0, 0x1093, 0x51E1, 0x0E8C,
- 0x51E6, 0x0972, 0x51E7, 0x0B5C, 0x51E9, 0x1095, 0x51EA, 0x0CBC,
- 0x51EC, 0x20CD, 0x51ED, 0x1096, 0x51EE, 0x3811, 0x51F0, 0x1097,
- 0x51F1, 0x058C, 0x51F4, 0x3812, 0x51F5, 0x1098, 0x51F6, 0x069F,
- 0x51F8, 0x0CA4, 0x51F9, 0x051C, 0x51FA, 0x095A, 0x51FD, 0x0D35,
- 0x51FE, 0x1099, 0x5200, 0x0C5B, 0x5201, 0x3813, 0x5202, 0x3814,
- 0x5203, 0x0A15, 0x5204, 0x109A, 0x5206, 0x0DFC, 0x5207, 0x0A7E,
- 0x5208, 0x05DE, 0x520A, 0x05E5, 0x520B, 0x109B, 0x520E, 0x109D,
- 0x5211, 0x0710, 0x5213, 0x3815, 0x5214, 0x109C, 0x5215, 0x20CE,
- 0x5217, 0x0FBB, 0x521D, 0x0973, 0x5224, 0x0D51, 0x5225, 0x0E1C,
- 0x5227, 0x109E, 0x5229, 0x0F62, 0x522A, 0x109F, 0x522E, 0x10A0,
- 0x5230, 0x0C78, 0x5233, 0x10A1, 0x5236, 0x0A4D, 0x5237, 0x086E,
- 0x5238, 0x074A, 0x5239, 0x10A2, 0x523A, 0x0897, 0x523B, 0x0801,
- 0x5243, 0x0C02, 0x5244, 0x10A4, 0x5247, 0x0B07, 0x5249, 0x3816,
- 0x524A, 0x085F, 0x524B, 0x10A5, 0x524C, 0x10A6, 0x524D, 0x0AB2,
- 0x524F, 0x10A3, 0x5254, 0x10A8, 0x5256, 0x0E64, 0x525B, 0x07F6,
- 0x525D, 0x1E5E, 0x525E, 0x10A7, 0x5261, 0x3817, 0x5263, 0x074B,
- 0x5264, 0x084E, 0x5265, 0x0D23, 0x5266, 0x3818, 0x5269, 0x10AB,
- 0x526A, 0x10A9, 0x526F, 0x0DED, 0x5270, 0x09D2, 0x5271, 0x10B2,
- 0x5272, 0x05C2, 0x5273, 0x10AC, 0x5274, 0x10AA, 0x5275, 0x0AD1,
- 0x527D, 0x10AE, 0x527F, 0x10AD, 0x5283, 0x05A2, 0x5287, 0x0736,
- 0x5288, 0x10B3, 0x5289, 0x0F75, 0x528D, 0x10AF, 0x5291, 0x10B4,
- 0x5292, 0x10B1, 0x5293, 0x3819, 0x5294, 0x10B0, 0x529B, 0x0F97,
- 0x529C, 0x20CF, 0x529F, 0x07AD, 0x52A0, 0x0543, 0x52A3, 0x0FBC,
- 0x52A6, 0x20D0, 0x52A9, 0x097F, 0x52AA, 0x0C52, 0x52AB, 0x07F7,
- 0x52AC, 0x10B7, 0x52AD, 0x10B8, 0x52AF, 0x217D, 0x52B1, 0x0FAD,
- 0x52B4, 0x0FD1, 0x52B5, 0x10BA, 0x52B9, 0x07AE, 0x52BC, 0x10B9,
- 0x52BE, 0x058D, 0x52C0, 0x20D1, 0x52C1, 0x10BB, 0x52C3, 0x0E84,
- 0x52C5, 0x0BD8, 0x52C7, 0x0F10, 0x52C8, 0x381A, 0x52C9, 0x0E29,
- 0x52CD, 0x10BC, 0x52D0, 0x36E8, 0x52D2, 0x1BEE, 0x52D5, 0x0C88,
- 0x52D7, 0x10BD, 0x52D8, 0x05E6, 0x52D9, 0x0EBF, 0x52DB, 0x20D2,
- 0x52DD, 0x0989, 0x52DE, 0x10BE, 0x52DF, 0x0E37, 0x52E0, 0x10C2,
- 0x52E2, 0x0A4E, 0x52E3, 0x10BF, 0x52E4, 0x06C8, 0x52E6, 0x10C0,
- 0x52E7, 0x05E7, 0x52F0, 0x381B, 0x52F2, 0x0704, 0x52F3, 0x10C3,
- 0x52F5, 0x10C4, 0x52F8, 0x10C5, 0x52F9, 0x10C6, 0x52FA, 0x0907,
- 0x52FE, 0x07AF, 0x52FF, 0x0EEA, 0x5300, 0x20D3, 0x5301, 0x0EF4,
- 0x5302, 0x0CCF, 0x5305, 0x0E41, 0x5306, 0x10C7, 0x5307, 0x20D4,
- 0x5308, 0x10C8, 0x530A, 0x381C, 0x530B, 0x381D, 0x530D, 0x10CA,
- 0x530F, 0x10CC, 0x5310, 0x10CB, 0x5315, 0x10CD, 0x5316, 0x053D,
- 0x5317, 0x0E7A, 0x5319, 0x086C, 0x531A, 0x10CE, 0x531D, 0x0ADB,
- 0x5320, 0x098A, 0x5321, 0x06A1, 0x5323, 0x10CF, 0x5324, 0x20D5,
- 0x532A, 0x0D6F, 0x532F, 0x10D0, 0x5331, 0x10D1, 0x5333, 0x10D2,
- 0x5338, 0x10D3, 0x5339, 0x0D96, 0x533A, 0x06E0, 0x533B, 0x04A9,
- 0x533E, 0x381E, 0x533F, 0x0C97, 0x5340, 0x10D4, 0x5341, 0x0947,
- 0x5343, 0x0A8D, 0x5345, 0x10D6, 0x5346, 0x10D5, 0x5347, 0x098B,
- 0x5348, 0x0795, 0x5349, 0x10D8, 0x534A, 0x0D52, 0x534B, 0x3820,
- 0x534C, 0x381F, 0x534D, 0x10D9, 0x5351, 0x0D70, 0x5352, 0x0B14,
- 0x5353, 0x0B4E, 0x5354, 0x06A0, 0x5357, 0x0CC6, 0x5358, 0x0B6F,
- 0x535A, 0x0D24, 0x535C, 0x0E7C, 0x535E, 0x10DB, 0x5360, 0x0A8E,
- 0x5361, 0x3821, 0x5366, 0x070B, 0x5369, 0x10DC, 0x536C, 0x3822,
- 0x536E, 0x10DD, 0x536F, 0x04CE, 0x5370, 0x04B9, 0x5371, 0x0629,
- 0x5372, 0x20D6, 0x5373, 0x0B08, 0x5374, 0x066B, 0x5375, 0x0F5B,
- 0x5377, 0x10E0, 0x5378, 0x0537, 0x537B, 0x10DF, 0x537D, 0x3435,
- 0x537F, 0x06A2, 0x5382, 0x10E1, 0x5384, 0x0EFD, 0x5389, 0x37D0,
- 0x5393, 0x20D7, 0x5396, 0x10E2, 0x5398, 0x0F9A, 0x539A, 0x07B0,
- 0x539F, 0x076A, 0x53A0, 0x10E3, 0x53A5, 0x10E5, 0x53A6, 0x10E4,
- 0x53A8, 0x0A25, 0x53A9, 0x04DB, 0x53AB, 0x3823, 0x53AD, 0x0500,
- 0x53AE, 0x10E6, 0x53B0, 0x10E7, 0x53B2, 0x20D8, 0x53B3, 0x076B,
- 0x53B6, 0x10E8, 0x53BB, 0x0688, 0x53C2, 0x0880, 0x53C3, 0x10E9,
- 0x53C8, 0x0EA2, 0x53C9, 0x0825, 0x53CA, 0x0674, 0x53CB, 0x0F11,
- 0x53CC, 0x0AD2, 0x53CD, 0x0D53, 0x53CE, 0x0929, 0x53D4, 0x0951,
- 0x53D6, 0x0914, 0x53D7, 0x0921, 0x53D9, 0x0980, 0x53DA, 0x3824,
- 0x53DB, 0x0D54, 0x53DD, 0x20D9, 0x53DF, 0x10EC, 0x53E1, 0x04E5,
- 0x53E2, 0x0AD3, 0x53E3, 0x07B1, 0x53E4, 0x0779, 0x53E5, 0x06DF,
- 0x53E6, 0x3825, 0x53E8, 0x10F0, 0x53E9, 0x0B5F, 0x53EA, 0x0B5E,
- 0x53EB, 0x06A3, 0x53EC, 0x098C, 0x53ED, 0x10F1, 0x53EE, 0x10EF,
- 0x53EF, 0x0544, 0x53F0, 0x0B46, 0x53F1, 0x08E4, 0x53F2, 0x0899,
- 0x53F3, 0x04C8, 0x53F5, 0x3826, 0x53F6, 0x05CE, 0x53F7, 0x07F8,
- 0x53F8, 0x0898, 0x53FA, 0x10F2, 0x5401, 0x10F3, 0x5403, 0x0663,
- 0x5404, 0x05A4, 0x5408, 0x07F9, 0x5409, 0x0662, 0x540A, 0x0BFB,
- 0x540B, 0x04C7, 0x540C, 0x0C89, 0x540D, 0x0ECA, 0x540E, 0x07B3,
- 0x540F, 0x0F63, 0x5410, 0x0C41, 0x5411, 0x07B2, 0x541B, 0x0705,
- 0x541D, 0x10FC, 0x541F, 0x06DB, 0x5420, 0x0E78, 0x5426, 0x0D71,
- 0x5427, 0x3827, 0x5429, 0x10FB, 0x542B, 0x061A, 0x542C, 0x10F6,
- 0x542D, 0x10F7, 0x542E, 0x10F9, 0x5433, 0x35C0, 0x5436, 0x10FA,
- 0x5438, 0x0675, 0x5439, 0x0A27, 0x543B, 0x0DFD, 0x543C, 0x10F8,
- 0x543D, 0x10F4, 0x543E, 0x0797, 0x543F, 0x35CF, 0x5440, 0x10F5,
- 0x5442, 0x0FCA, 0x5446, 0x0E42, 0x5448, 0x0C04, 0x5449, 0x0796,
- 0x544A, 0x0802, 0x544D, 0x3828, 0x544E, 0x10FD, 0x5451, 0x0CB5,
- 0x5455, 0x3723, 0x545F, 0x1101, 0x5466, 0x3829, 0x5468, 0x092A,
- 0x546A, 0x0922, 0x546B, 0x382A, 0x5470, 0x1104, 0x5471, 0x1102,
- 0x5473, 0x0EAF, 0x5474, 0x382B, 0x5475, 0x10FF, 0x5476, 0x1108,
- 0x5477, 0x1103, 0x547B, 0x1106, 0x547C, 0x077A, 0x547D, 0x0ECB,
- 0x5480, 0x1107, 0x5484, 0x1109, 0x5486, 0x110B, 0x548A, 0x20DC,
- 0x548B, 0x0860, 0x548C, 0x0FE8, 0x548D, 0x382C, 0x548E, 0x1100,
- 0x548F, 0x10FE, 0x5490, 0x110A, 0x5492, 0x1105, 0x5496, 0x382D,
- 0x549C, 0x20DB, 0x54A1, 0x382E, 0x54A2, 0x110D, 0x54A4, 0x1116,
- 0x54A5, 0x110F, 0x54A8, 0x1113, 0x54A9, 0x20DD, 0x54AB, 0x1114,
- 0x54AC, 0x1110, 0x54AD, 0x382F, 0x54AF, 0x1131, 0x54B2, 0x0859,
- 0x54B3, 0x058F, 0x54B8, 0x110E, 0x54B9, 0x3830, 0x54BC, 0x1118,
- 0x54BD, 0x04BA, 0x54BE, 0x1117, 0x54BF, 0x3831, 0x54C0, 0x0469,
- 0x54C1, 0x0DBC, 0x54C2, 0x1115, 0x54C4, 0x1111, 0x54C6, 0x3832,
- 0x54C7, 0x110C, 0x54C8, 0x1112, 0x54C9, 0x0838, 0x54CD, 0x3833,
- 0x54D8, 0x1119, 0x54E1, 0x04BB, 0x54E2, 0x1122, 0x54E5, 0x111A,
- 0x54E6, 0x111B, 0x54E8, 0x098D, 0x54E9, 0x0E97, 0x54ED, 0x1120,
- 0x54EE, 0x111F, 0x54F2, 0x0C29, 0x54FA, 0x1121, 0x54FD, 0x111E,
- 0x54FF, 0x20DE, 0x5504, 0x04D6, 0x5506, 0x0826, 0x5507, 0x09F6,
- 0x550E, 0x3834, 0x550F, 0x111C, 0x5510, 0x0C5C, 0x5514, 0x111D,
- 0x5516, 0x0466, 0x552B, 0x3835, 0x552E, 0x1127, 0x552F, 0x0F0D,
- 0x5531, 0x098F, 0x5533, 0x112D, 0x5535, 0x3836, 0x5538, 0x112C,
- 0x5539, 0x1123, 0x553E, 0x0B23, 0x5540, 0x1124, 0x5544, 0x0B4F,
- 0x5545, 0x1129, 0x5546, 0x098E, 0x554A, 0x3837, 0x554C, 0x1126,
- 0x554F, 0x0EF0, 0x5553, 0x0712, 0x5556, 0x112A, 0x5557, 0x112B,
- 0x555C, 0x1128, 0x555D, 0x112E, 0x555E, 0x1DD1, 0x5560, 0x3838,
- 0x5561, 0x3839, 0x5563, 0x1125, 0x557B, 0x1134, 0x557C, 0x1139,
- 0x557E, 0x1135, 0x5580, 0x1130, 0x5583, 0x113A, 0x5584, 0x0AB3,
- 0x5586, 0x20DF, 0x5587, 0x113C, 0x5588, 0x383A, 0x5589, 0x07B4,
- 0x558A, 0x1132, 0x558B, 0x0BBB, 0x558E, 0x383B, 0x5598, 0x1136,
- 0x5599, 0x112F, 0x559A, 0x05E9, 0x559C, 0x062A, 0x559D, 0x05C3,
- 0x559E, 0x1137, 0x559F, 0x1133, 0x55A7, 0x074C, 0x55A8, 0x113D,
- 0x55A9, 0x113B, 0x55AA, 0x0AD5, 0x55AB, 0x0664, 0x55AC, 0x06A4,
- 0x55AE, 0x1138, 0x55B0, 0x06EC, 0x55B6, 0x04E6, 0x55C4, 0x1141,
- 0x55C5, 0x113F, 0x55C7, 0x1178, 0x55D4, 0x1144, 0x55DA, 0x113E,
- 0x55DC, 0x1142, 0x55DF, 0x1140, 0x55E3, 0x089A, 0x55E4, 0x1143,
- 0x55F7, 0x1146, 0x55F9, 0x114B, 0x55FD, 0x1149, 0x55FE, 0x1148,
- 0x5606, 0x0B70, 0x5608, 0x383C, 0x5609, 0x0545, 0x560E, 0x383D,
- 0x560F, 0x383E, 0x5614, 0x1145, 0x5616, 0x1147, 0x5617, 0x0990,
- 0x5618, 0x04D5, 0x561B, 0x114A, 0x5620, 0x3C1D, 0x5629, 0x055E,
- 0x562F, 0x1155, 0x5631, 0x09E4, 0x5632, 0x1151, 0x5634, 0x114F,
- 0x5636, 0x1150, 0x5637, 0x383F, 0x5638, 0x1152, 0x563F, 0x3840,
- 0x5642, 0x04DF, 0x5649, 0x3841, 0x564B, 0x3842, 0x564C, 0x0ABB,
- 0x564E, 0x114C, 0x564F, 0x3843, 0x5650, 0x114D, 0x5653, 0x1F1B,
- 0x565B, 0x05D8, 0x5664, 0x1154, 0x5666, 0x3844, 0x5668, 0x062B,
- 0x5669, 0x3845, 0x566A, 0x1157, 0x566B, 0x1153, 0x566C, 0x1156,
- 0x566F, 0x3846, 0x5671, 0x3847, 0x5672, 0x3848, 0x5674, 0x0DFE,
- 0x5676, 0x3C33, 0x5678, 0x0CAD, 0x567A, 0x0D4C, 0x5680, 0x1159,
- 0x5686, 0x1158, 0x5687, 0x05A3, 0x568A, 0x115A, 0x568F, 0x115D,
- 0x5694, 0x115C, 0x5695, 0x3849, 0x5699, 0x1DE6, 0x569A, 0x384A,
- 0x56A0, 0x115B, 0x56A2, 0x0CEF, 0x56A5, 0x115E, 0x56AC, 0x384B,
- 0x56AD, 0x384C, 0x56AE, 0x115F, 0x56B1, 0x384D, 0x56B4, 0x1161,
- 0x56B6, 0x1160, 0x56BC, 0x1163, 0x56C0, 0x1166, 0x56C1, 0x1164,
- 0x56C2, 0x1162, 0x56C3, 0x1165, 0x56C8, 0x1167, 0x56C9, 0x384E,
- 0x56CA, 0x1E5A, 0x56CE, 0x1168, 0x56D1, 0x1169, 0x56D3, 0x116A,
- 0x56D7, 0x116B, 0x56D8, 0x107C, 0x56DA, 0x0928, 0x56DB, 0x089B,
- 0x56DD, 0x384F, 0x56DE, 0x0573, 0x56E0, 0x04BC, 0x56E3, 0x0B82,
- 0x56E4, 0x3850, 0x56EE, 0x116C, 0x56F0, 0x0814, 0x56F2, 0x0493,
- 0x56F3, 0x0A24, 0x56F9, 0x116D, 0x56FA, 0x077B, 0x56FD, 0x0803,
- 0x56FF, 0x116F, 0x5700, 0x116E, 0x5703, 0x0E30, 0x5704, 0x1170,
- 0x5708, 0x1172, 0x5709, 0x1171, 0x570A, 0x3851, 0x570B, 0x1173,
- 0x570D, 0x1174, 0x570F, 0x074D, 0x5712, 0x0502, 0x5713, 0x1175,
- 0x5715, 0x3852, 0x5716, 0x1177, 0x5718, 0x1176, 0x571C, 0x1179,
- 0x571F, 0x0C54, 0x5721, 0x3680, 0x5723, 0x3853, 0x5726, 0x117A,
- 0x5727, 0x0479, 0x5728, 0x084F, 0x572D, 0x0713, 0x572F, 0x3854,
- 0x5730, 0x0B8D, 0x5733, 0x3855, 0x5734, 0x3856, 0x5737, 0x117B,
- 0x5738, 0x117C, 0x573B, 0x117E, 0x5740, 0x117F, 0x5742, 0x0854,
- 0x5747, 0x06C9, 0x574A, 0x0E65, 0x574C, 0x3857, 0x574E, 0x117D,
- 0x574F, 0x1180, 0x5750, 0x0831, 0x5751, 0x07B5, 0x5759, 0x20E0,
- 0x5761, 0x1184, 0x5764, 0x0815, 0x5765, 0x20E1, 0x5766, 0x0B71,
- 0x5769, 0x1181, 0x576A, 0x0BF6, 0x5770, 0x3858, 0x577F, 0x1185,
- 0x5782, 0x0A28, 0x5788, 0x1183, 0x5789, 0x1186, 0x578B, 0x0715,
- 0x578C, 0x3859, 0x5793, 0x1187, 0x579C, 0x385A, 0x57A0, 0x1188,
- 0x57A2, 0x07B6, 0x57A3, 0x059E, 0x57A4, 0x118A, 0x57AA, 0x118B,
- 0x57AC, 0x20E2, 0x57B0, 0x118C, 0x57B3, 0x1189, 0x57B8, 0x385B,
- 0x57C0, 0x1182, 0x57C3, 0x118D, 0x57C6, 0x118E, 0x57C7, 0x20E4,
- 0x57C8, 0x20E3, 0x57CB, 0x0E92, 0x57CE, 0x09D3, 0x57D2, 0x1190,
- 0x57D3, 0x1191, 0x57D4, 0x118F, 0x57D6, 0x1193, 0x57DC, 0x0CEE,
- 0x57DF, 0x04AC, 0x57E0, 0x0DC8, 0x57E3, 0x1194, 0x57E6, 0x385C,
- 0x57ED, 0x385D, 0x57F4, 0x09E5, 0x57F5, 0x385E, 0x57F6, 0x385F,
- 0x57F7, 0x08E5, 0x57F9, 0x0D13, 0x57FA, 0x062C, 0x57FC, 0x085B,
- 0x57FF, 0x3860, 0x5800, 0x0E87, 0x5802, 0x0C8A, 0x5805, 0x074E,
- 0x5806, 0x0B2F, 0x5809, 0x3861, 0x580A, 0x1192, 0x580B, 0x1195,
- 0x5815, 0x0B24, 0x5819, 0x1196, 0x581D, 0x1197, 0x5820, 0x3862,
- 0x5821, 0x1199, 0x5824, 0x0C05, 0x582A, 0x05EA, 0x582F, 0x1D32,
- 0x5830, 0x0503, 0x5831, 0x0E43, 0x5832, 0x3863, 0x5834, 0x09D4,
- 0x5835, 0x0C42, 0x583A, 0x0856, 0x583D, 0x119F, 0x5840, 0x0E0D,
- 0x5841, 0x0FA5, 0x584A, 0x0574, 0x584B, 0x119B, 0x5851, 0x0ABC,
- 0x5852, 0x119E, 0x5854, 0x0C5D, 0x5857, 0x0C43, 0x5858, 0x0C5E,
- 0x5859, 0x0D4D, 0x585A, 0x0BE9, 0x585E, 0x0839, 0x5861, 0x1E47,
- 0x5862, 0x119A, 0x5869, 0x0518, 0x586B, 0x0C30, 0x5870, 0x119C,
- 0x5872, 0x1198, 0x5875, 0x0A16, 0x5879, 0x11A0, 0x587C, 0x3864,
- 0x587E, 0x0958, 0x5880, 0x3865, 0x5883, 0x06A5, 0x5885, 0x11A1,
- 0x5893, 0x0E38, 0x5897, 0x0AFF, 0x589C, 0x0BE2, 0x589E, 0x20E7,
- 0x589F, 0x11A3, 0x58A8, 0x0E7D, 0x58A9, 0x3866, 0x58AB, 0x11A4,
- 0x58AE, 0x11A9, 0x58B2, 0x20E8, 0x58B3, 0x0DFF, 0x58B8, 0x11A8,
- 0x58B9, 0x11A2, 0x58BA, 0x11A5, 0x58BB, 0x11A7, 0x58BE, 0x0816,
- 0x58C1, 0x0E19, 0x58C5, 0x11AA, 0x58C7, 0x0B83, 0x58CA, 0x0575,
- 0x58CC, 0x09D5, 0x58CE, 0x3867, 0x58D0, 0x3868, 0x58D1, 0x11AC,
- 0x58D3, 0x11AB, 0x58D4, 0x3869, 0x58D5, 0x07FA, 0x58D7, 0x11AD,
- 0x58D8, 0x11AF, 0x58D9, 0x11AE, 0x58DA, 0x386A, 0x58DC, 0x11B1,
- 0x58DE, 0x11A6, 0x58DF, 0x11B3, 0x58E4, 0x11B2, 0x58E5, 0x11B0,
- 0x58E9, 0x386B, 0x58EB, 0x089C, 0x58EC, 0x0A17, 0x58EE, 0x0AD6,
- 0x58EF, 0x11B4, 0x58F0, 0x0A60, 0x58F1, 0x04B1, 0x58F2, 0x0D1A,
- 0x58F7, 0x0BF7, 0x58F9, 0x11B6, 0x58FA, 0x11B5, 0x58FB, 0x11B7,
- 0x58FC, 0x11B8, 0x58FD, 0x11B9, 0x5902, 0x11BA, 0x5909, 0x0E21,
- 0x590A, 0x11BB, 0x590B, 0x20E9, 0x590C, 0x386C, 0x590F, 0x0546,
- 0x5910, 0x11BC, 0x5915, 0x0F26, 0x5916, 0x058E, 0x5918, 0x10DE,
- 0x5919, 0x0952, 0x591A, 0x0B1F, 0x591B, 0x11BD, 0x591C, 0x0EF7,
- 0x5922, 0x0EC0, 0x5924, 0x386D, 0x5925, 0x11BF, 0x5927, 0x0B47,
- 0x5929, 0x0C31, 0x592A, 0x0B20, 0x592B, 0x0DC9, 0x592C, 0x11C0,
- 0x592D, 0x11C1, 0x592E, 0x051D, 0x592F, 0x386E, 0x5931, 0x08E6,
- 0x5932, 0x11C2, 0x5937, 0x0494, 0x5938, 0x11C3, 0x5939, 0x3725,
- 0x593E, 0x11C4, 0x5944, 0x0504, 0x5947, 0x062D, 0x5948, 0x0CB8,
- 0x5949, 0x0E44, 0x594E, 0x11C8, 0x594F, 0x0AD7, 0x5950, 0x11C7,
- 0x5951, 0x0716, 0x5953, 0x20EA, 0x5954, 0x0E89, 0x5955, 0x11C6,
- 0x5957, 0x0C5F, 0x5958, 0x11CA, 0x595A, 0x11C9, 0x595B, 0x20EB,
- 0x595D, 0x20EC, 0x5960, 0x11CC, 0x5961, 0x386F, 0x5962, 0x11CB,
- 0x5963, 0x20ED, 0x5965, 0x051E, 0x5967, 0x11CD, 0x5968, 0x0991,
- 0x5969, 0x11CF, 0x596A, 0x0B63, 0x596C, 0x11CE, 0x596D, 0x3870,
- 0x596E, 0x0E03, 0x5973, 0x0981, 0x5974, 0x0C55, 0x5978, 0x11D0,
- 0x597D, 0x07B7, 0x5981, 0x11D1, 0x5982, 0x0CD7, 0x5983, 0x0D72,
- 0x5984, 0x0EDD, 0x598A, 0x0CDB, 0x598D, 0x11DA, 0x5993, 0x0652,
- 0x5996, 0x0F2F, 0x5999, 0x0EBB, 0x599B, 0x1239, 0x599D, 0x11D2,
- 0x59A3, 0x11D5, 0x59A4, 0x20EE, 0x59A5, 0x0B25, 0x59A8, 0x0E66,
- 0x59AC, 0x0C44, 0x59B2, 0x11D6, 0x59B9, 0x0E93, 0x59BA, 0x20EF,
- 0x59BB, 0x083A, 0x59BE, 0x0992, 0x59C6, 0x11D7, 0x59C9, 0x089E,
- 0x59CA, 0x3871, 0x59CB, 0x089D, 0x59D0, 0x047D, 0x59D1, 0x077C,
- 0x59D2, 0x3872, 0x59D3, 0x0A4F, 0x59D4, 0x0495, 0x59D9, 0x11DB,
- 0x59DA, 0x11DC, 0x59DC, 0x11D9, 0x59DD, 0x3873, 0x59E3, 0x3874,
- 0x59E4, 0x3875, 0x59E5, 0x04DA, 0x59E6, 0x05EB, 0x59E8, 0x11D8,
- 0x59EA, 0x0ED1, 0x59EB, 0x0DA3, 0x59EC, 0x36AD, 0x59F6, 0x046C,
- 0x59FB, 0x04BD, 0x59FF, 0x089F, 0x5A01, 0x0496, 0x5A03, 0x0467,
- 0x5A04, 0x3876, 0x5A09, 0x11E1, 0x5A0C, 0x3877, 0x5A11, 0x11DF,
- 0x5A18, 0x0EC8, 0x5A1A, 0x11E2, 0x5A1B, 0x35C1, 0x5A1C, 0x11E0,
- 0x5A1F, 0x11DE, 0x5A20, 0x09F7, 0x5A23, 0x3878, 0x5A25, 0x11DD,
- 0x5A29, 0x0E2A, 0x5A2F, 0x0798, 0x5A35, 0x11E6, 0x5A36, 0x11E7,
- 0x5A3C, 0x0993, 0x5A40, 0x11E3, 0x5A41, 0x0FD2, 0x5A46, 0x0D02,
- 0x5A47, 0x3879, 0x5A49, 0x11E5, 0x5A55, 0x387A, 0x5A5A, 0x0817,
- 0x5A62, 0x11E8, 0x5A63, 0x387B, 0x5A66, 0x0DCA, 0x5A6A, 0x11E9,
- 0x5A6C, 0x11E4, 0x5A6D, 0x387C, 0x5A7E, 0x387D, 0x5A7F, 0x0EC7,
- 0x5A92, 0x0D14, 0x5A9A, 0x11EA, 0x5A9B, 0x0DA4, 0x5A9E, 0x387E,
- 0x5AA7, 0x387F, 0x5AAC, 0x3880, 0x5AB3, 0x3881, 0x5ABC, 0x11EB,
- 0x5ABD, 0x11EF, 0x5ABE, 0x11EC, 0x5AC1, 0x0547, 0x5AC2, 0x11EE,
- 0x5AC9, 0x08E7, 0x5ACB, 0x11ED, 0x5ACC, 0x074F, 0x5AD0, 0x11FB,
- 0x5AD6, 0x11F4, 0x5AD7, 0x11F1, 0x5AE0, 0x3882, 0x5AE1, 0x0BA2,
- 0x5AE3, 0x11F0, 0x5AE6, 0x11F2, 0x5AE9, 0x11F3, 0x5AFA, 0x11F5,
- 0x5AFB, 0x11F6, 0x5B00, 0x3883, 0x5B09, 0x062E, 0x5B0B, 0x11F8,
- 0x5B0C, 0x11F7, 0x5B16, 0x11F9, 0x5B19, 0x3884, 0x5B22, 0x09D6,
- 0x5B25, 0x3885, 0x5B2A, 0x11FC, 0x5B2C, 0x0BF8, 0x5B2D, 0x3886,
- 0x5B30, 0x04E7, 0x5B32, 0x11FA, 0x5B36, 0x11FD, 0x5B3E, 0x11FE,
- 0x5B40, 0x1201, 0x5B41, 0x3887, 0x5B43, 0x11FF, 0x5B45, 0x1200,
- 0x5B50, 0x08A0, 0x5B51, 0x1202, 0x5B54, 0x07B8, 0x5B55, 0x1203,
- 0x5B56, 0x20F0, 0x5B57, 0x08C8, 0x5B58, 0x0B18, 0x5B5A, 0x1204,
- 0x5B5B, 0x1205, 0x5B5C, 0x08A8, 0x5B5D, 0x07B9, 0x5B5F, 0x0EDE,
- 0x5B63, 0x0642, 0x5B64, 0x077D, 0x5B65, 0x1206, 0x5B66, 0x05B6,
- 0x5B69, 0x1207, 0x5B6B, 0x0B19, 0x5B70, 0x1208, 0x5B71, 0x1230,
- 0x5B73, 0x1209, 0x5B75, 0x120A, 0x5B78, 0x120B, 0x5B7A, 0x120D,
- 0x5B7C, 0x3888, 0x5B7E, 0x3889, 0x5B7F, 0x388A, 0x5B80, 0x120E,
- 0x5B82, 0x3610, 0x5B83, 0x120F, 0x5B85, 0x0B50, 0x5B87, 0x04C9,
- 0x5B88, 0x0915, 0x5B89, 0x0486, 0x5B8A, 0x388B, 0x5B8B, 0x0AD9,
- 0x5B8C, 0x05EC, 0x5B8D, 0x08E1, 0x5B8F, 0x07BA, 0x5B95, 0x0C60,
- 0x5B97, 0x092B, 0x5B98, 0x05ED, 0x5B99, 0x0BA6, 0x5B9A, 0x0C06,
- 0x5B9B, 0x047C, 0x5B9C, 0x0653, 0x5B9D, 0x0E45, 0x5B9F, 0x08EE,
- 0x5BA2, 0x066C, 0x5BA3, 0x0A8F, 0x5BA4, 0x08E8, 0x5BA5, 0x0F12,
- 0x5BA6, 0x1210, 0x5BAE, 0x0676, 0x5BB0, 0x083B, 0x5BB3, 0x0590,
- 0x5BB4, 0x0505, 0x5BB5, 0x0994, 0x5BB6, 0x0548, 0x5BB8, 0x1211,
- 0x5BB9, 0x0F30, 0x5BBF, 0x0953, 0x5BC0, 0x20F1, 0x5BC2, 0x0910,
- 0x5BC3, 0x1212, 0x5BC4, 0x062F, 0x5BC5, 0x0CAA, 0x5BC6, 0x0EB5,
- 0x5BC7, 0x1213, 0x5BC9, 0x1214, 0x5BCC, 0x0DCB, 0x5BD0, 0x1216,
- 0x5BD2, 0x05E4, 0x5BD3, 0x06EF, 0x5BD4, 0x1215, 0x5BD8, 0x20F3,
- 0x5BDB, 0x05EE, 0x5BDD, 0x09F8, 0x5BDE, 0x121A, 0x5BDF, 0x086F,
- 0x5BE1, 0x0549, 0x5BE2, 0x1219, 0x5BE4, 0x1217, 0x5BE5, 0x121B,
- 0x5BE6, 0x1218, 0x5BE7, 0x0CE1, 0x5BE8, 0x148E, 0x5BE9, 0x09F9,
- 0x5BEB, 0x121C, 0x5BEC, 0x20F4, 0x5BEE, 0x0F88, 0x5BF0, 0x121D,
- 0x5BF3, 0x121F, 0x5BF5, 0x0BBC, 0x5BF6, 0x121E, 0x5BF8, 0x0A47,
- 0x5BFA, 0x08C9, 0x5BFE, 0x0B30, 0x5BFF, 0x0923, 0x5C01, 0x0DE7,
- 0x5C02, 0x0A90, 0x5C04, 0x08F9, 0x5C05, 0x1220, 0x5C06, 0x0995,
- 0x5C07, 0x1221, 0x5C08, 0x1222, 0x5C09, 0x0497, 0x5C0A, 0x0B1A,
- 0x5C0B, 0x0A18, 0x5C0D, 0x1223, 0x5C0E, 0x0C8B, 0x5C0F, 0x0996,
- 0x5C11, 0x0997, 0x5C13, 0x1224, 0x5C14, 0x372A, 0x5C16, 0x0A91,
- 0x5C19, 0x360B, 0x5C1A, 0x0998, 0x5C1E, 0x20F5, 0x5C20, 0x1225,
- 0x5C22, 0x1226, 0x5C23, 0x388C, 0x5C24, 0x0EEC, 0x5C28, 0x1227,
- 0x5C2B, 0x388D, 0x5C2D, 0x06BE, 0x5C30, 0x388E, 0x5C31, 0x092C,
- 0x5C38, 0x1228, 0x5C39, 0x1229, 0x5C3A, 0x0908, 0x5C3B, 0x09F2,
- 0x5C3C, 0x0CCC, 0x5C3D, 0x0A1A, 0x5C3E, 0x0D8C, 0x5C3F, 0x0CD8,
- 0x5C40, 0x06C1, 0x5C41, 0x122A, 0x5C45, 0x0689, 0x5C46, 0x122B,
- 0x5C48, 0x06F6, 0x5C4A, 0x0CA7, 0x5C4B, 0x0530, 0x5C4D, 0x08A1,
- 0x5C4E, 0x122C, 0x5C4F, 0x122F, 0x5C50, 0x122E, 0x5C51, 0x06F5,
- 0x5C53, 0x122D, 0x5C55, 0x0C32, 0x5C5B, 0x1E92, 0x5C5E, 0x0B10,
- 0x5C60, 0x0C45, 0x5C61, 0x08F4, 0x5C62, 0x1E0D, 0x5C63, 0x388F,
- 0x5C64, 0x0ADA, 0x5C65, 0x0F64, 0x5C69, 0x3890, 0x5C6C, 0x1231,
- 0x5C6E, 0x1232, 0x5C6F, 0x0CAE, 0x5C71, 0x0881, 0x5C76, 0x1234,
- 0x5C79, 0x1235, 0x5C7C, 0x3891, 0x5C8C, 0x1236, 0x5C90, 0x0630,
- 0x5C91, 0x1237, 0x5C94, 0x1238, 0x5CA1, 0x052C, 0x5CA6, 0x20F6,
- 0x5CA8, 0x0ABD, 0x5CA9, 0x0620, 0x5CAB, 0x123A, 0x5CAC, 0x0EB4,
- 0x5CB1, 0x0B32, 0x5CB3, 0x05B7, 0x5CB6, 0x123C, 0x5CB7, 0x123E,
- 0x5CB8, 0x061B, 0x5CBA, 0x20F7, 0x5CBB, 0x123B, 0x5CBC, 0x123D,
- 0x5CBE, 0x1240, 0x5CC5, 0x123F, 0x5CC7, 0x1241, 0x5CCB, 0x3892,
- 0x5CD2, 0x3893, 0x5CD9, 0x1242, 0x5CE0, 0x0C95, 0x5CE1, 0x06A6,
- 0x5CE6, 0x372C, 0x5CE8, 0x0565, 0x5CE9, 0x1243, 0x5CEA, 0x1248,
- 0x5CED, 0x1246, 0x5CEF, 0x0E47, 0x5CF0, 0x0E46, 0x5CF4, 0x3894,
- 0x5CF5, 0x20F8, 0x5CF6, 0x0C61, 0x5CFA, 0x1245, 0x5CFB, 0x095E,
- 0x5CFD, 0x1244, 0x5D07, 0x0A38, 0x5D0B, 0x1249, 0x5D0E, 0x085A,
- 0x5D11, 0x124F, 0x5D14, 0x1250, 0x5D15, 0x124A, 0x5D16, 0x0591,
- 0x5D17, 0x124B, 0x5D18, 0x1254, 0x5D19, 0x1253, 0x5D1A, 0x1252,
- 0x5D1B, 0x124E, 0x5D1F, 0x124D, 0x5D22, 0x1251, 0x5D24, 0x3895,
- 0x5D26, 0x3896, 0x5D27, 0x20F9, 0x5D29, 0x0E48, 0x5D42, 0x20FC,
- 0x5D43, 0x3897, 0x5D46, 0x3898, 0x5D4A, 0x3899, 0x5D4B, 0x1258,
- 0x5D4C, 0x1255, 0x5D4E, 0x1257, 0x5D50, 0x0F5C, 0x5D52, 0x1256,
- 0x5D53, 0x20FA, 0x5D5C, 0x124C, 0x5D69, 0x0A39, 0x5D6C, 0x1259,
- 0x5D6D, 0x20FD, 0x5D6F, 0x0827, 0x5D73, 0x125A, 0x5D76, 0x125B,
- 0x5D82, 0x125E, 0x5D84, 0x125D, 0x5D87, 0x125C, 0x5D8B, 0x0C62,
- 0x5D8C, 0x1247, 0x5D90, 0x1264, 0x5D92, 0x389A, 0x5D94, 0x389B,
- 0x5D99, 0x389C, 0x5D9D, 0x1260, 0x5DA0, 0x389D, 0x5DA2, 0x125F,
- 0x5DAC, 0x1261, 0x5DAE, 0x1262, 0x5DB2, 0x3BA5, 0x5DB7, 0x1265,
- 0x5DB8, 0x20FE, 0x5DB9, 0x20FF, 0x5DBA, 0x0FAE, 0x5DBC, 0x1266,
- 0x5DBD, 0x1263, 0x5DC9, 0x1267, 0x5DCC, 0x061C, 0x5DCD, 0x1268,
- 0x5DD0, 0x2100, 0x5DD2, 0x126A, 0x5DD3, 0x1269, 0x5DD6, 0x126B,
- 0x5DD8, 0x389E, 0x5DDB, 0x126C, 0x5DDD, 0x0A92, 0x5DDE, 0x092D,
- 0x5DE0, 0x389F, 0x5DE1, 0x096E, 0x5DE2, 0x3432, 0x5DE3, 0x0AE5,
- 0x5DE5, 0x07BB, 0x5DE6, 0x0828, 0x5DE7, 0x07BC, 0x5DE8, 0x068A,
- 0x5DEB, 0x126D, 0x5DEE, 0x0829, 0x5DF1, 0x077E, 0x5DF2, 0x126E,
- 0x5DF3, 0x0EB2, 0x5DF4, 0x0CF9, 0x5DF5, 0x126F, 0x5DF7, 0x07BD,
- 0x5DF8, 0x38A0, 0x5DFB, 0x05E8, 0x5DFD, 0x0B65, 0x5DFE, 0x06CA,
- 0x5DFF, 0x35E2, 0x5E00, 0x38A1, 0x5E02, 0x08A2, 0x5E03, 0x0DCD,
- 0x5E06, 0x0D55, 0x5E0B, 0x1270, 0x5E0C, 0x0631, 0x5E11, 0x1273,
- 0x5E12, 0x38A2, 0x5E14, 0x38A3, 0x5E15, 0x38A4, 0x5E16, 0x0BBD,
- 0x5E18, 0x38A5, 0x5E19, 0x1272, 0x5E1A, 0x1271, 0x5E1B, 0x1274,
- 0x5E1D, 0x0C07, 0x5E25, 0x0A29, 0x5E2B, 0x08A3, 0x5E2D, 0x0A6E,
- 0x5E2E, 0x38A6, 0x5E2F, 0x0B33, 0x5E30, 0x063C, 0x5E33, 0x0BBE,
- 0x5E36, 0x1275, 0x5E37, 0x1276, 0x5E38, 0x09D7, 0x5E3D, 0x0E67,
- 0x5E40, 0x1279, 0x5E43, 0x1278, 0x5E44, 0x1277, 0x5E45, 0x0DEF,
- 0x5E47, 0x1280, 0x5E4C, 0x0E88, 0x5E4E, 0x127A, 0x5E54, 0x127C,
- 0x5E55, 0x0E99, 0x5E57, 0x127B, 0x5E58, 0x38A7, 0x5E5F, 0x127D,
- 0x5E61, 0x0D3C, 0x5E62, 0x127E, 0x5E63, 0x0E0E, 0x5E64, 0x127F,
- 0x5E6B, 0x38A8, 0x5E6C, 0x38A9, 0x5E72, 0x05EF, 0x5E73, 0x0E0F,
- 0x5E74, 0x0CE5, 0x5E75, 0x1281, 0x5E76, 0x1282, 0x5E78, 0x07BE,
- 0x5E79, 0x05F0, 0x5E7A, 0x1283, 0x5E7B, 0x076C, 0x5E7C, 0x0F2E,
- 0x5E7D, 0x0F13, 0x5E7E, 0x0632, 0x5E7F, 0x1285, 0x5E81, 0x0BBF,
- 0x5E83, 0x07BF, 0x5E84, 0x0999, 0x5E87, 0x0D73, 0x5E8A, 0x099A,
- 0x5E8F, 0x0982, 0x5E95, 0x0C08, 0x5E96, 0x0E49, 0x5E97, 0x0C33,
- 0x5E99, 0x36B0, 0x5E9A, 0x07C0, 0x5E9C, 0x0DCE, 0x5EA0, 0x1286,
- 0x5EA6, 0x0C53, 0x5EA7, 0x0832, 0x5EA8, 0x38AA, 0x5EAA, 0x38AB,
- 0x5EAB, 0x077F, 0x5EAD, 0x0C09, 0x5EB5, 0x0487, 0x5EB6, 0x0978,
- 0x5EB7, 0x07C1, 0x5EB8, 0x0F31, 0x5EBE, 0x38AC, 0x5EBF, 0x38AD,
- 0x5EC1, 0x1287, 0x5EC2, 0x1288, 0x5EC3, 0x0D07, 0x5EC8, 0x1289,
- 0x5EC9, 0x0FBF, 0x5ECA, 0x0FD3, 0x5ECB, 0x38AE, 0x5ECF, 0x128B,
- 0x5ED0, 0x128A, 0x5ED2, 0x38AF, 0x5ED3, 0x05A5, 0x5ED6, 0x128C,
- 0x5EDA, 0x128F, 0x5EDB, 0x1290, 0x5EDD, 0x128E, 0x5EDF, 0x0DB2,
- 0x5EE0, 0x099B, 0x5EE1, 0x1292, 0x5EE2, 0x1291, 0x5EE3, 0x128D,
- 0x5EE8, 0x1293, 0x5EE9, 0x1294, 0x5EEC, 0x1295, 0x5EF0, 0x1298,
- 0x5EF1, 0x1296, 0x5EF3, 0x1297, 0x5EF4, 0x1299, 0x5EF6, 0x0506,
- 0x5EF7, 0x0C0A, 0x5EF8, 0x129A, 0x5EFA, 0x0750, 0x5EFB, 0x0576,
- 0x5EFC, 0x0CEC, 0x5EFE, 0x129B, 0x5EFF, 0x0CD3, 0x5F01, 0x0E2B,
- 0x5F03, 0x129C, 0x5F04, 0x0FD4, 0x5F07, 0x38B0, 0x5F09, 0x129D,
- 0x5F0A, 0x0E10, 0x5F0B, 0x12A0, 0x5F0C, 0x0FFA, 0x5F0D, 0x100A,
- 0x5F0E, 0x38B1, 0x5F0F, 0x08DC, 0x5F10, 0x0CCD, 0x5F11, 0x12A1,
- 0x5F13, 0x0677, 0x5F14, 0x0BC0, 0x5F15, 0x04BE, 0x5F16, 0x12A2,
- 0x5F17, 0x0DF6, 0x5F18, 0x07C2, 0x5F1B, 0x0B8E, 0x5F1C, 0x38B2,
- 0x5F1D, 0x38B3, 0x5F1F, 0x0C0B, 0x5F21, 0x2101, 0x5F22, 0x38B4,
- 0x5F25, 0x0EFB, 0x5F26, 0x076D, 0x5F27, 0x0780, 0x5F28, 0x38B5,
- 0x5F29, 0x12A3, 0x5F2D, 0x12A4, 0x5F2F, 0x12AA, 0x5F31, 0x0911,
- 0x5F34, 0x2102, 0x5F35, 0x0BC1, 0x5F36, 0x38B6, 0x5F37, 0x06A7,
- 0x5F38, 0x12A5, 0x5F3A, 0x3598, 0x5F3B, 0x38B7, 0x5F3C, 0x0D9D,
- 0x5F3E, 0x0B84, 0x5F40, 0x38B8, 0x5F41, 0x12A6, 0x5F45, 0x20B2,
- 0x5F48, 0x12A7, 0x5F4A, 0x06A8, 0x5F4C, 0x12A8, 0x5F4E, 0x12A9,
- 0x5F50, 0x38B9, 0x5F51, 0x12AB, 0x5F53, 0x0C70, 0x5F56, 0x12AC,
- 0x5F57, 0x12AD, 0x5F58, 0x38BA, 0x5F59, 0x12AE, 0x5F5C, 0x129F,
- 0x5F5D, 0x129E, 0x5F61, 0x12AF, 0x5F62, 0x0717, 0x5F64, 0x38BB,
- 0x5F65, 0x36AC, 0x5F66, 0x0D99, 0x5F67, 0x2103, 0x5F69, 0x083C,
- 0x5F6A, 0x0DA9, 0x5F6B, 0x0BC2, 0x5F6C, 0x0DBD, 0x5F6D, 0x12B0,
- 0x5F70, 0x099C, 0x5F71, 0x04E8, 0x5F73, 0x12B1, 0x5F77, 0x12B2,
- 0x5F79, 0x0EFE, 0x5F7C, 0x0D74, 0x5F7F, 0x12B5, 0x5F80, 0x051F,
- 0x5F81, 0x0A50, 0x5F82, 0x12B4, 0x5F83, 0x12B3, 0x5F84, 0x0718,
- 0x5F85, 0x0B34, 0x5F87, 0x12B9, 0x5F88, 0x12B7, 0x5F89, 0x38BC,
- 0x5F8A, 0x12B6, 0x5F8B, 0x0F6F, 0x5F8C, 0x0799, 0x5F90, 0x0983,
- 0x5F91, 0x12B8, 0x5F92, 0x0C46, 0x5F93, 0x0948, 0x5F97, 0x0C98,
- 0x5F98, 0x12BC, 0x5F99, 0x12BB, 0x5F9C, 0x38BD, 0x5F9E, 0x12BA,
- 0x5FA0, 0x12BD, 0x5FA1, 0x079A, 0x5FA4, 0x38BF, 0x5FA7, 0x38BE,
- 0x5FA8, 0x12BE, 0x5FA9, 0x0DEE, 0x5FAA, 0x0965, 0x5FAD, 0x12BF,
- 0x5FAE, 0x0D8D, 0x5FAF, 0x38C0, 0x5FB3, 0x0C99, 0x5FB4, 0x0BC3,
- 0x5FB5, 0x3438, 0x5FB7, 0x2104, 0x5FB8, 0x38C1, 0x5FB9, 0x0C2A,
- 0x5FBC, 0x12C0, 0x5FBD, 0x0645, 0x5FC3, 0x09FA, 0x5FC4, 0x38C2,
- 0x5FC5, 0x0D9E, 0x5FC9, 0x38C3, 0x5FCC, 0x0633, 0x5FCD, 0x0CDC,
- 0x5FD6, 0x12C1, 0x5FD7, 0x08A4, 0x5FD8, 0x0E68, 0x5FD9, 0x0E69,
- 0x5FDC, 0x0520, 0x5FDD, 0x12C6, 0x5FDE, 0x2105, 0x5FE0, 0x0BA7,
- 0x5FE1, 0x38C4, 0x5FE4, 0x12C3, 0x5FE9, 0x38C5, 0x5FEB, 0x0577,
- 0x5FED, 0x38C6, 0x5FF0, 0x12F6, 0x5FF1, 0x12C5, 0x5FF5, 0x0CE6,
- 0x5FF8, 0x12C4, 0x5FFB, 0x12C2, 0x5FFC, 0x38C7, 0x5FFD, 0x080C,
- 0x5FFF, 0x12C8, 0x600E, 0x12CE, 0x600F, 0x12D4, 0x6010, 0x12CC,
- 0x6012, 0x0C56, 0x6015, 0x12D1, 0x6016, 0x0DCF, 0x6017, 0x38C8,
- 0x6019, 0x12CB, 0x601A, 0x38C9, 0x601B, 0x12D0, 0x601C, 0x0FAF,
- 0x601D, 0x08A5, 0x6020, 0x0B35, 0x6021, 0x12C9, 0x6025, 0x0678,
- 0x6026, 0x12D3, 0x6027, 0x0A51, 0x6028, 0x0507, 0x6029, 0x12CD,
- 0x602A, 0x0578, 0x602B, 0x12D2, 0x602F, 0x06A9, 0x6031, 0x12CF,
- 0x6033, 0x38CA, 0x603A, 0x12D5, 0x6041, 0x12D7, 0x6042, 0x12E1,
- 0x6043, 0x12DF, 0x6046, 0x12DC, 0x604A, 0x12DB, 0x604B, 0x0FC0,
- 0x604D, 0x12DD, 0x6050, 0x06AA, 0x6052, 0x07C3, 0x6055, 0x0984,
- 0x6059, 0x12E4, 0x605A, 0x12D6, 0x605D, 0x2106, 0x605F, 0x12DA,
- 0x6060, 0x12CA, 0x6061, 0x38CB, 0x6062, 0x057A, 0x6063, 0x12DE,
- 0x6064, 0x12E0, 0x6065, 0x0B8F, 0x6068, 0x0818, 0x6069, 0x0538,
- 0x606A, 0x12D8, 0x606B, 0x12E3, 0x606C, 0x12E2, 0x606D, 0x06AB,
- 0x606F, 0x0B09, 0x6070, 0x05C4, 0x6075, 0x0719, 0x6077, 0x12D9,
- 0x607F, 0x38CC, 0x6081, 0x12E5, 0x6083, 0x12E8, 0x6084, 0x12EA,
- 0x6085, 0x2107, 0x6089, 0x08E9, 0x608A, 0x2108, 0x608B, 0x12F0,
- 0x608C, 0x0C0C, 0x608D, 0x12E6, 0x6092, 0x12EE, 0x6094, 0x0579,
- 0x6096, 0x12EC, 0x6097, 0x12ED, 0x609A, 0x12E9, 0x609B, 0x12EB,
- 0x609E, 0x38CD, 0x609F, 0x079B, 0x60A0, 0x0F14, 0x60A3, 0x05F1,
- 0x60A4, 0x38CE, 0x60A6, 0x04FB, 0x60A7, 0x12EF, 0x60A9, 0x0CF0,
- 0x60AA, 0x0471, 0x60B0, 0x38CF, 0x60B2, 0x0D75, 0x60B3, 0x12C7,
- 0x60B4, 0x12F5, 0x60B5, 0x12F9, 0x60B6, 0x0EF1, 0x60B8, 0x12F2,
- 0x60BC, 0x0C63, 0x60BD, 0x12F7, 0x60C5, 0x09D8, 0x60C6, 0x12F8,
- 0x60C7, 0x0CAF, 0x60CB, 0x38D0, 0x60D1, 0x0FED, 0x60D3, 0x12F4,
- 0x60D5, 0x210A, 0x60D8, 0x12FA, 0x60DA, 0x080D, 0x60DB, 0x38D1,
- 0x60DC, 0x0A6F, 0x60DE, 0x2109, 0x60DF, 0x0498, 0x60E0, 0x12F3,
- 0x60E1, 0x12F1, 0x60E3, 0x0ADC, 0x60E7, 0x12E7, 0x60E8, 0x0882,
- 0x60F0, 0x0B26, 0x60F1, 0x1306, 0x60F2, 0x210C, 0x60F3, 0x0ADD,
- 0x60F4, 0x1301, 0x60F6, 0x12FE, 0x60F7, 0x12FF, 0x60F8, 0x38D2,
- 0x60F9, 0x0912, 0x60FA, 0x1302, 0x60FB, 0x1305, 0x6100, 0x1300,
- 0x6101, 0x092F, 0x6103, 0x1303, 0x6106, 0x12FD, 0x6108, 0x0F08,
- 0x6109, 0x0F07, 0x610D, 0x1307, 0x610E, 0x1308, 0x610F, 0x0499,
- 0x6111, 0x210D, 0x6112, 0x38D3, 0x6113, 0x38D4, 0x6114, 0x38D5,
- 0x6115, 0x12FC, 0x611A, 0x06EA, 0x611B, 0x046A, 0x611C, 0x38D6,
- 0x611F, 0x05F2, 0x6120, 0x210B, 0x6121, 0x1304, 0x6127, 0x130C,
- 0x6128, 0x130B, 0x612C, 0x1310, 0x6130, 0x210F, 0x6134, 0x1311,
- 0x6137, 0x210E, 0x613C, 0x130F, 0x613D, 0x1312, 0x613E, 0x130A,
- 0x613F, 0x130E, 0x6142, 0x1313, 0x6144, 0x1314, 0x6147, 0x1309,
- 0x6148, 0x08CA, 0x614A, 0x130D, 0x614B, 0x0B36, 0x614C, 0x07C4,
- 0x614D, 0x12FB, 0x614E, 0x09FB, 0x6153, 0x1321, 0x6155, 0x0E39,
- 0x6158, 0x1317, 0x6159, 0x1318, 0x615A, 0x1319, 0x615D, 0x1320,
- 0x615F, 0x131F, 0x6162, 0x0EAB, 0x6163, 0x05F3, 0x6165, 0x131D,
- 0x6167, 0x071B, 0x6168, 0x0592, 0x616B, 0x131A, 0x616E, 0x0F80,
- 0x616F, 0x131C, 0x6170, 0x049A, 0x6171, 0x131E, 0x6173, 0x1315,
- 0x6174, 0x131B, 0x6175, 0x1322, 0x6176, 0x071A, 0x6177, 0x1316,
- 0x617C, 0x38D7, 0x617E, 0x0F47, 0x6182, 0x0F15, 0x6187, 0x1325,
- 0x618A, 0x1329, 0x618D, 0x38D8, 0x618E, 0x0B00, 0x6190, 0x0FC1,
- 0x6191, 0x132A, 0x6194, 0x1327, 0x6196, 0x1324, 0x6198, 0x2110,
- 0x6199, 0x1323, 0x619A, 0x1328, 0x619F, 0x38D9, 0x61A4, 0x0E00,
- 0x61A7, 0x0C8C, 0x61A8, 0x38DA, 0x61A9, 0x071C, 0x61AB, 0x132B,
- 0x61AC, 0x1326, 0x61AE, 0x132C, 0x61B2, 0x0751, 0x61B6, 0x0531,
- 0x61BA, 0x1334, 0x61BE, 0x05F4, 0x61C2, 0x38DB, 0x61C3, 0x1332,
- 0x61C6, 0x1333, 0x61C7, 0x0819, 0x61C8, 0x1331, 0x61C9, 0x132F,
- 0x61CA, 0x132E, 0x61CB, 0x1335, 0x61CC, 0x132D, 0x61CD, 0x1337,
- 0x61D0, 0x057B, 0x61DF, 0x38DC, 0x61E3, 0x1339, 0x61E6, 0x1338,
- 0x61F2, 0x0BC4, 0x61F4, 0x133C, 0x61F6, 0x133A, 0x61F7, 0x1330,
- 0x61F8, 0x0752, 0x61FA, 0x133B, 0x61FC, 0x133F, 0x61FD, 0x133E,
- 0x61FE, 0x1340, 0x61FF, 0x133D, 0x6200, 0x1341, 0x6208, 0x1342,
- 0x6209, 0x1343, 0x620A, 0x0E3A, 0x620C, 0x1345, 0x620D, 0x1344,
- 0x620E, 0x0949, 0x6210, 0x0A52, 0x6211, 0x0566, 0x6212, 0x057C,
- 0x6213, 0x2111, 0x6214, 0x1346, 0x6215, 0x38DD, 0x6216, 0x0483,
- 0x621A, 0x0A70, 0x621B, 0x1347, 0x621D, 0x1A64, 0x621E, 0x1348,
- 0x621F, 0x0737, 0x6221, 0x1349, 0x6226, 0x0A93, 0x6229, 0x38DE,
- 0x622A, 0x134A, 0x622E, 0x134B, 0x622F, 0x0654, 0x6230, 0x134C,
- 0x6232, 0x134D, 0x6233, 0x134E, 0x6234, 0x0B37, 0x6236, 0x35BD,
- 0x6238, 0x0781, 0x623B, 0x0EED, 0x623E, 0x344E, 0x623F, 0x0E6A,
- 0x6240, 0x0974, 0x6241, 0x134F, 0x6243, 0x38DF, 0x6246, 0x38E0,
- 0x6247, 0x0A94, 0x6248, 0x1B1A, 0x6249, 0x0D76, 0x624B, 0x0916,
- 0x624C, 0x38E1, 0x624D, 0x083D, 0x624E, 0x1350, 0x6251, 0x38E2,
- 0x6253, 0x0B27, 0x6255, 0x0DF7, 0x6256, 0x38E3, 0x6258, 0x0B51,
- 0x625B, 0x1353, 0x625E, 0x1351, 0x6260, 0x1354, 0x6263, 0x1352,
- 0x6268, 0x1355, 0x626E, 0x0E01, 0x6271, 0x047B, 0x6276, 0x0DD0,
- 0x6279, 0x0D77, 0x627C, 0x1356, 0x627E, 0x1359, 0x627F, 0x099D,
- 0x6280, 0x0655, 0x6282, 0x1357, 0x6283, 0x135E, 0x6284, 0x099E,
- 0x6285, 0x35C5, 0x6289, 0x1358, 0x628A, 0x0CFA, 0x6291, 0x0F48,
- 0x6292, 0x135A, 0x6293, 0x135B, 0x6294, 0x135F, 0x6295, 0x0C64,
- 0x6296, 0x135C, 0x6297, 0x07C5, 0x6298, 0x0A82, 0x629B, 0x136D,
- 0x629C, 0x0D48, 0x629E, 0x0B52, 0x62A6, 0x2112, 0x62AB, 0x0D78,
- 0x62AC, 0x13B2, 0x62B1, 0x0E4A, 0x62B5, 0x0C0D, 0x62B9, 0x0EA3,
- 0x62BB, 0x1362, 0x62BC, 0x0521, 0x62BD, 0x0BA8, 0x62C2, 0x136B,
- 0x62C4, 0x38E4, 0x62C5, 0x0B72, 0x62C6, 0x1365, 0x62C7, 0x136C,
- 0x62C8, 0x1367, 0x62C9, 0x136E, 0x62CA, 0x136A, 0x62CC, 0x1369,
- 0x62CD, 0x0D25, 0x62CF, 0x1363, 0x62D0, 0x057D, 0x62D1, 0x1361,
- 0x62D2, 0x068B, 0x62D3, 0x0B53, 0x62D4, 0x135D, 0x62D7, 0x1360,
- 0x62D8, 0x07C6, 0x62D9, 0x0A7F, 0x62DB, 0x099F, 0x62DC, 0x1368,
- 0x62DD, 0x0D08, 0x62E0, 0x068C, 0x62E1, 0x05A6, 0x62EC, 0x05C5,
- 0x62ED, 0x09E7, 0x62EE, 0x1370, 0x62EF, 0x1375, 0x62F1, 0x1371,
- 0x62F3, 0x0753, 0x62F5, 0x1376, 0x62F6, 0x0870, 0x62F7, 0x07FB,
- 0x62FC, 0x38E5, 0x62FE, 0x0930, 0x62FF, 0x1364, 0x6301, 0x08CB,
- 0x6302, 0x1373, 0x6307, 0x08A6, 0x6308, 0x1374, 0x6309, 0x0488,
- 0x630A, 0x38E6, 0x630C, 0x136F, 0x630D, 0x38E7, 0x6311, 0x0BC5,
- 0x6318, 0x38E8, 0x6319, 0x068D, 0x631B, 0x3737, 0x631F, 0x06AC,
- 0x6327, 0x1372, 0x6328, 0x046B, 0x632B, 0x0833, 0x632F, 0x09FC,
- 0x6339, 0x38E9, 0x633A, 0x0C0E, 0x633D, 0x0D68, 0x633E, 0x1378,
- 0x633F, 0x0AE0, 0x6342, 0x38EA, 0x6343, 0x38EB, 0x6349, 0x0B0A,
- 0x634C, 0x0879, 0x634D, 0x1379, 0x634F, 0x137B, 0x6350, 0x1377,
- 0x6355, 0x0E31, 0x6357, 0x0BD9, 0x635C, 0x0ADE, 0x6365, 0x38EC,
- 0x6367, 0x0E4B, 0x6368, 0x08FA, 0x6369, 0x1387, 0x636B, 0x1386,
- 0x636E, 0x0A3E, 0x6372, 0x0754, 0x6374, 0x38ED, 0x6376, 0x1380,
- 0x6377, 0x09A1, 0x637A, 0x0CC0, 0x637B, 0x0CE7, 0x637D, 0x38EE,
- 0x6380, 0x137E, 0x6383, 0x0ADF, 0x6384, 0x38EF, 0x6387, 0x38F0,
- 0x6388, 0x0924, 0x6389, 0x1383, 0x638C, 0x09A0, 0x638E, 0x137D,
- 0x638F, 0x1382, 0x6390, 0x38F1, 0x6392, 0x0D09, 0x6396, 0x137C,
- 0x6398, 0x06F7, 0x639B, 0x05BB, 0x639E, 0x38F2, 0x639F, 0x1384,
- 0x63A0, 0x0F73, 0x63A1, 0x083E, 0x63A2, 0x0B73, 0x63A3, 0x1381,
- 0x63A5, 0x0A80, 0x63A7, 0x07C7, 0x63A8, 0x0A2A, 0x63A9, 0x0508,
- 0x63AA, 0x0ABE, 0x63AB, 0x137F, 0x63AC, 0x065F, 0x63B2, 0x071D,
- 0x63B4, 0x0BEB, 0x63B5, 0x1385, 0x63BB, 0x0AE1, 0x63BE, 0x1388,
- 0x63C0, 0x138A, 0x63C3, 0x0B17, 0x63C4, 0x1390, 0x63C6, 0x138B,
- 0x63C9, 0x138D, 0x63CF, 0x0DB3, 0x63D0, 0x0C0F, 0x63D1, 0x38F3,
- 0x63D2, 0x138E, 0x63D6, 0x0F16, 0x63DA, 0x0F32, 0x63DB, 0x05F5,
- 0x63DC, 0x38F4, 0x63E1, 0x0472, 0x63E3, 0x138C, 0x63E9, 0x1389,
- 0x63ED, 0x341C, 0x63EE, 0x0634, 0x63F4, 0x0509, 0x63F5, 0x2113,
- 0x63F6, 0x138F, 0x63F7, 0x3644, 0x63FA, 0x0F33, 0x6406, 0x1393,
- 0x6409, 0x38F5, 0x640D, 0x0B1B, 0x640F, 0x139A, 0x6410, 0x38F6,
- 0x6413, 0x1394, 0x6414, 0x1E2C, 0x6416, 0x1391, 0x6417, 0x1398,
- 0x641C, 0x137A, 0x6422, 0x38F7, 0x6426, 0x1395, 0x6428, 0x1399,
- 0x642C, 0x0D56, 0x642D, 0x0C65, 0x6434, 0x1392, 0x6436, 0x1396,
- 0x643A, 0x071E, 0x643E, 0x0861, 0x6442, 0x0A81, 0x644E, 0x139E,
- 0x6451, 0x1E43, 0x6454, 0x38F8, 0x6458, 0x0C20, 0x645B, 0x38F9,
- 0x6460, 0x2114, 0x6467, 0x139B, 0x6469, 0x0E8E, 0x646D, 0x38FA,
- 0x646F, 0x139C, 0x6476, 0x139D, 0x6478, 0x0EDA, 0x647A, 0x0A46,
- 0x647B, 0x38FB, 0x6483, 0x0738, 0x6488, 0x13A4, 0x6492, 0x0883,
- 0x6493, 0x13A1, 0x6495, 0x13A0, 0x649A, 0x0CE8, 0x649D, 0x2115,
- 0x649E, 0x0C8D, 0x64A4, 0x0C2B, 0x64A5, 0x13A2, 0x64A9, 0x13A3,
- 0x64AB, 0x0DE1, 0x64AD, 0x0CFB, 0x64AE, 0x0871, 0x64B0, 0x0A95,
- 0x64B2, 0x0E7E, 0x64B9, 0x05A7, 0x64BB, 0x13AA, 0x64BC, 0x13A5,
- 0x64BE, 0x38FC, 0x64BF, 0x38FD, 0x64C1, 0x0F34, 0x64C2, 0x13AC,
- 0x64C5, 0x13A8, 0x64C7, 0x13A9, 0x64CA, 0x341D, 0x64CD, 0x0AE2,
- 0x64CE, 0x2116, 0x64D2, 0x13A7, 0x64D4, 0x1366, 0x64D8, 0x13AB,
- 0x64DA, 0x13A6, 0x64E0, 0x13B0, 0x64E1, 0x13B1, 0x64E2, 0x0C21,
- 0x64E3, 0x13B3, 0x64E5, 0x38FE, 0x64E6, 0x0872, 0x64E7, 0x13AE,
- 0x64EC, 0x0656, 0x64EF, 0x13B4, 0x64F1, 0x13AD, 0x64F2, 0x13B8,
- 0x64F4, 0x13B7, 0x64F6, 0x13B6, 0x64F7, 0x38FF, 0x64FA, 0x13B9,
- 0x64FB, 0x3900, 0x64FD, 0x13BB, 0x64FE, 0x09D9, 0x6500, 0x13BA,
- 0x6504, 0x3901, 0x6505, 0x13BE, 0x6516, 0x3902, 0x6518, 0x13BC,
- 0x6519, 0x3903, 0x651C, 0x13BD, 0x651D, 0x1397, 0x6522, 0x1E97,
- 0x6523, 0x13C0, 0x6524, 0x13BF, 0x652A, 0x139F, 0x652B, 0x13C1,
- 0x652C, 0x13B5, 0x652F, 0x08A7, 0x6534, 0x13C2, 0x6535, 0x13C3,
- 0x6536, 0x13C5, 0x6537, 0x13C4, 0x6538, 0x13C6, 0x6539, 0x057E,
- 0x653B, 0x07C8, 0x653E, 0x0E4C, 0x653F, 0x0A53, 0x6545, 0x0782,
- 0x6547, 0x3904, 0x6548, 0x13C8, 0x654D, 0x13CB, 0x654E, 0x2117,
- 0x654F, 0x0DC4, 0x6551, 0x0679, 0x6555, 0x13CA, 0x6556, 0x13C9,
- 0x6557, 0x0D0A, 0x6558, 0x13CC, 0x6559, 0x06AD, 0x655D, 0x13CE,
- 0x655E, 0x13CD, 0x6562, 0x05F6, 0x6563, 0x0884, 0x6566, 0x0CB0,
- 0x6567, 0x3905, 0x656C, 0x071F, 0x6570, 0x0A3A, 0x6572, 0x13CF,
- 0x6574, 0x0A54, 0x6575, 0x0C22, 0x6577, 0x0DD1, 0x6578, 0x13D0,
- 0x6581, 0x3906, 0x6582, 0x13D1, 0x6583, 0x13D2, 0x6585, 0x3907,
- 0x6587, 0x0E08, 0x6588, 0x120C, 0x6589, 0x0A6A, 0x658C, 0x0DBE,
- 0x658E, 0x0848, 0x6590, 0x0D79, 0x6591, 0x0D57, 0x6597, 0x0C47,
- 0x6599, 0x0F89, 0x659B, 0x13D4, 0x659C, 0x08FC, 0x659F, 0x13D5,
- 0x65A1, 0x047A, 0x65A4, 0x06CC, 0x65A5, 0x0A71, 0x65A7, 0x0DD2,
- 0x65AB, 0x13D6, 0x65AC, 0x0890, 0x65AD, 0x0B85, 0x65AF, 0x08A9,
- 0x65B0, 0x09FD, 0x65B7, 0x13D7, 0x65B9, 0x0E4D, 0x65BC, 0x0519,
- 0x65BD, 0x08AA, 0x65C1, 0x13DA, 0x65C2, 0x3908, 0x65C3, 0x13D8,
- 0x65C4, 0x13DB, 0x65C5, 0x0F81, 0x65C6, 0x13D9, 0x65CB, 0x0A9F,
- 0x65CC, 0x13DC, 0x65CF, 0x0B12, 0x65D2, 0x13DD, 0x65D7, 0x0636,
- 0x65D9, 0x13DF, 0x65DB, 0x13DE, 0x65E0, 0x13E0, 0x65E1, 0x13E1,
- 0x65E2, 0x0637, 0x65E3, 0x3585, 0x65E5, 0x0CD4, 0x65E6, 0x0B74,
- 0x65E7, 0x0686, 0x65E8, 0x08AB, 0x65E9, 0x0AE3, 0x65EC, 0x0966,
- 0x65ED, 0x0474, 0x65F0, 0x3909, 0x65F1, 0x13E2, 0x65F2, 0x390A,
- 0x65FA, 0x0522, 0x65FB, 0x13E6, 0x6600, 0x2118, 0x6602, 0x07C9,
- 0x6603, 0x13E5, 0x6606, 0x081B, 0x6607, 0x09A2, 0x6609, 0x211A,
- 0x660A, 0x13E4, 0x660C, 0x09A3, 0x660E, 0x0ECC, 0x660F, 0x081A,
- 0x6613, 0x049B, 0x6614, 0x0A72, 0x6615, 0x2119, 0x661C, 0x13EB,
- 0x661E, 0x211C, 0x661F, 0x0A55, 0x6620, 0x04E9, 0x6624, 0x211D,
- 0x6625, 0x095F, 0x6627, 0x0E94, 0x6628, 0x0862, 0x662C, 0x390B,
- 0x662D, 0x09A4, 0x662E, 0x211B, 0x662F, 0x0A4B, 0x6631, 0x20AE,
- 0x6634, 0x13EA, 0x6635, 0x13E8, 0x6636, 0x13E9, 0x663B, 0x1E00,
- 0x663C, 0x0BA9, 0x663F, 0x1409, 0x6641, 0x13EF, 0x6642, 0x08CC,
- 0x6643, 0x07CA, 0x6644, 0x13ED, 0x6649, 0x13EE, 0x664B, 0x09FE,
- 0x664C, 0x390C, 0x664F, 0x13EC, 0x6652, 0x087D, 0x6657, 0x211F,
- 0x6659, 0x2120, 0x665B, 0x390D, 0x665C, 0x390E, 0x665D, 0x13F1,
- 0x665E, 0x13F0, 0x665F, 0x13F5, 0x6661, 0x390F, 0x6662, 0x13F6,
- 0x6663, 0x373A, 0x6664, 0x13F2, 0x6665, 0x211E, 0x6666, 0x0580,
- 0x6667, 0x13F3, 0x6668, 0x13F4, 0x6669, 0x0D69, 0x666B, 0x3910,
- 0x666E, 0x0DD3, 0x666F, 0x0720, 0x6670, 0x13F7, 0x6673, 0x2122,
- 0x6674, 0x0A56, 0x6676, 0x09A5, 0x6677, 0x3911, 0x667A, 0x0B90,
- 0x6681, 0x06BF, 0x6683, 0x13F8, 0x6684, 0x13FC, 0x6687, 0x054B,
- 0x6688, 0x13F9, 0x6689, 0x13FB, 0x668E, 0x13FA, 0x6691, 0x0975,
- 0x6696, 0x0B86, 0x6697, 0x0489, 0x6698, 0x13FD, 0x6699, 0x2123,
- 0x669D, 0x13FE, 0x66A0, 0x2124, 0x66A2, 0x0BC6, 0x66A4, 0x3912,
- 0x66A6, 0x0FB9, 0x66AB, 0x0891, 0x66AE, 0x0E3B, 0x66B2, 0x2125,
- 0x66B4, 0x0E6B, 0x66B8, 0x1405, 0x66B9, 0x1400, 0x66BC, 0x1403,
- 0x66BE, 0x1402, 0x66BF, 0x2126, 0x66C1, 0x13FF, 0x66C4, 0x1404,
- 0x66C6, 0x3455, 0x66C7, 0x0CB6, 0x66C8, 0x3913, 0x66C9, 0x1401,
- 0x66D6, 0x1406, 0x66D9, 0x0976, 0x66DA, 0x1407, 0x66DC, 0x0F35,
- 0x66DD, 0x0D2E, 0x66E0, 0x1408, 0x66E6, 0x140A, 0x66E9, 0x140B,
- 0x66EC, 0x3914, 0x66F0, 0x140C, 0x66F2, 0x06C2, 0x66F3, 0x04EA,
- 0x66F4, 0x07CB, 0x66F5, 0x140D, 0x66F7, 0x140E, 0x66F8, 0x097B,
- 0x66F9, 0x0AE4, 0x66FA, 0x2127, 0x66FB, 0x20B1, 0x66FC, 0x10ED,
- 0x66FD, 0x0AC0, 0x66FE, 0x0ABF, 0x66FF, 0x0B38, 0x6700, 0x0837,
- 0x6703, 0x104B, 0x6705, 0x3915, 0x6708, 0x0744, 0x6709, 0x0F17,
- 0x670B, 0x0E4E, 0x670D, 0x0DF0, 0x670E, 0x2128, 0x670F, 0x140F,
- 0x6713, 0x3916, 0x6714, 0x0863, 0x6715, 0x0BDB, 0x6716, 0x1410,
- 0x6717, 0x0FD5, 0x671B, 0x0E6C, 0x671D, 0x0BC7, 0x671E, 0x1411,
- 0x671F, 0x0638, 0x6726, 0x1412, 0x6727, 0x1413, 0x6728, 0x0EE6,
- 0x672A, 0x0EB0, 0x672B, 0x0EA4, 0x672C, 0x0E8A, 0x672D, 0x0873,
- 0x672E, 0x1415, 0x6731, 0x0917, 0x6733, 0x3917, 0x6734, 0x0E7F,
- 0x6736, 0x1417, 0x6737, 0x141A, 0x6738, 0x1419, 0x673A, 0x0635,
- 0x673D, 0x067A, 0x673F, 0x1416, 0x6741, 0x1418, 0x6743, 0x35B7,
- 0x6746, 0x141B, 0x6748, 0x3918, 0x6749, 0x0A3F, 0x674C, 0x3919,
- 0x674E, 0x0F65, 0x674F, 0x048D, 0x6750, 0x0850, 0x6751, 0x0B1C,
- 0x6753, 0x0909, 0x6756, 0x09DB, 0x6759, 0x141E, 0x675C, 0x0C48,
- 0x675E, 0x141C, 0x675F, 0x0B0B, 0x6760, 0x141D, 0x6761, 0x09DA,
- 0x6762, 0x0EE9, 0x6763, 0x141F, 0x6764, 0x1420, 0x6765, 0x0F52,
- 0x6766, 0x212A, 0x676A, 0x1425, 0x676D, 0x07CC, 0x676E, 0x3571,
- 0x676F, 0x0D0B, 0x6770, 0x1422, 0x6771, 0x0C66, 0x6772, 0x13E3,
- 0x6773, 0x13E7, 0x6775, 0x0669, 0x6776, 0x391A, 0x6777, 0x0CFD,
- 0x677B, 0x391B, 0x677C, 0x1424, 0x677E, 0x09A6, 0x677F, 0x0D58,
- 0x6785, 0x142A, 0x6787, 0x0D8E, 0x6789, 0x1421, 0x678B, 0x1427,
- 0x678C, 0x1426, 0x6790, 0x0A73, 0x6795, 0x0E9B, 0x6797, 0x0F9B,
- 0x679A, 0x0E95, 0x679C, 0x054C, 0x679D, 0x08AC, 0x67A0, 0x0FEE,
- 0x67A1, 0x1429, 0x67A2, 0x0A3B, 0x67A6, 0x1428, 0x67A9, 0x1423,
- 0x67AF, 0x0783, 0x67B0, 0x391C, 0x67B2, 0x391D, 0x67B3, 0x142F,
- 0x67B4, 0x142D, 0x67B6, 0x054D, 0x67B7, 0x142B, 0x67B8, 0x1431,
- 0x67B9, 0x1437, 0x67BB, 0x212B, 0x67C0, 0x212D, 0x67C1, 0x0B28,
- 0x67C4, 0x0E11, 0x67C6, 0x1439, 0x67CA, 0x0D94, 0x67CE, 0x1438,
- 0x67CF, 0x0D26, 0x67D0, 0x0E6D, 0x67D1, 0x05F7, 0x67D3, 0x0A9B,
- 0x67D4, 0x094A, 0x67D7, 0x391F, 0x67D8, 0x0BEF, 0x67D9, 0x3920,
- 0x67DA, 0x0F18, 0x67DD, 0x1434, 0x67DE, 0x1433, 0x67E2, 0x1435,
- 0x67E4, 0x1432, 0x67E7, 0x143A, 0x67E9, 0x1430, 0x67EC, 0x142E,
- 0x67EE, 0x1436, 0x67EF, 0x142C, 0x67F0, 0x3921, 0x67F1, 0x0BAA,
- 0x67F3, 0x0F04, 0x67F4, 0x08F2, 0x67F5, 0x0864, 0x67F9, 0x391E,
- 0x67FB, 0x082A, 0x67FE, 0x0E9D, 0x67FF, 0x059F, 0x6801, 0x212E,
- 0x6802, 0x0BEA, 0x6803, 0x0CA2, 0x6804, 0x04EB, 0x6805, 0x1E07,
- 0x6813, 0x0A96, 0x6816, 0x0A58, 0x6817, 0x0700, 0x681E, 0x143C,
- 0x6821, 0x07CD, 0x6822, 0x05DA, 0x6829, 0x143E, 0x682A, 0x05D2,
- 0x682B, 0x1444, 0x682C, 0x3922, 0x6830, 0x3923, 0x6831, 0x3924,
- 0x6832, 0x1441, 0x6834, 0x0A97, 0x6838, 0x05A9, 0x6839, 0x081C,
- 0x683C, 0x05A8, 0x683D, 0x083F, 0x6840, 0x143F, 0x6841, 0x073B,
- 0x6842, 0x0721, 0x6843, 0x0C67, 0x6844, 0x212F, 0x6846, 0x143D,
- 0x6848, 0x048A, 0x684D, 0x1440, 0x684E, 0x1442, 0x6850, 0x06C5,
- 0x6851, 0x0702, 0x6852, 0x212C, 0x6853, 0x05F8, 0x6854, 0x0665,
- 0x6859, 0x1445, 0x685B, 0x3925, 0x685C, 0x0869, 0x685D, 0x0E9F,
- 0x685F, 0x0885, 0x6863, 0x1446, 0x6867, 0x0DA2, 0x6872, 0x3926,
- 0x6874, 0x1452, 0x6875, 0x3927, 0x6876, 0x0533, 0x6877, 0x1447,
- 0x687A, 0x3928, 0x687E, 0x1458, 0x687F, 0x1448, 0x6881, 0x0F8A,
- 0x6883, 0x144F, 0x6884, 0x3929, 0x6885, 0x0D15, 0x688D, 0x1457,
- 0x688E, 0x1E9C, 0x688F, 0x144A, 0x6893, 0x0478, 0x6894, 0x144C,
- 0x6897, 0x07CE, 0x689B, 0x144E, 0x689D, 0x144D, 0x689F, 0x1449,
- 0x68A0, 0x1454, 0x68A2, 0x09A7, 0x68A5, 0x392A, 0x68A6, 0x11BE,
- 0x68A7, 0x079C, 0x68A8, 0x0F66, 0x68AD, 0x144B, 0x68AF, 0x0C10,
- 0x68B0, 0x0581, 0x68B1, 0x081D, 0x68B2, 0x392B, 0x68B3, 0x1443,
- 0x68B5, 0x1453, 0x68B6, 0x05BF, 0x68B9, 0x1451, 0x68BA, 0x1455,
- 0x68BC, 0x0C68, 0x68C4, 0x063A, 0x68C6, 0x1473, 0x68C8, 0x20AF,
- 0x68C9, 0x0ED5, 0x68CA, 0x145A, 0x68CB, 0x0639, 0x68CD, 0x1461,
- 0x68CF, 0x2130, 0x68D0, 0x392C, 0x68D2, 0x0E6E, 0x68D4, 0x1462,
- 0x68D5, 0x1464, 0x68D6, 0x392D, 0x68D7, 0x1468, 0x68D8, 0x145C,
- 0x68DA, 0x0B68, 0x68DF, 0x0C69, 0x68E0, 0x146C, 0x68E1, 0x145F,
- 0x68E3, 0x1469, 0x68E7, 0x1463, 0x68E8, 0x392E, 0x68ED, 0x392F,
- 0x68EE, 0x09FF, 0x68EF, 0x146D, 0x68F0, 0x3930, 0x68F1, 0x3931,
- 0x68F2, 0x0A57, 0x68F9, 0x146B, 0x68FA, 0x05F9, 0x68FC, 0x3932,
- 0x6900, 0x0FF6, 0x6901, 0x1459, 0x6904, 0x1467, 0x6905, 0x049C,
- 0x6908, 0x145B, 0x690B, 0x0EC6, 0x690C, 0x1460, 0x690D, 0x09E8,
- 0x690E, 0x0BE3, 0x690F, 0x1456, 0x6911, 0x3933, 0x6912, 0x1466,
- 0x6913, 0x3934, 0x6919, 0x0A40, 0x691A, 0x1470, 0x691B, 0x05CF,
- 0x691C, 0x0755, 0x6921, 0x1472, 0x6922, 0x145D, 0x6923, 0x1471,
- 0x6925, 0x146A, 0x6926, 0x145E, 0x6928, 0x146E, 0x692A, 0x146F,
- 0x6930, 0x1480, 0x6934, 0x0CA6, 0x6935, 0x3935, 0x6936, 0x1465,
- 0x6939, 0x147C, 0x693B, 0x3936, 0x693D, 0x147E, 0x693F, 0x0BF4,
- 0x694A, 0x0F36, 0x6953, 0x0DE8, 0x6954, 0x1479, 0x6955, 0x0B2A,
- 0x6957, 0x3937, 0x6959, 0x147F, 0x695A, 0x0AC1, 0x695C, 0x1476,
- 0x695D, 0x1483, 0x695E, 0x1482, 0x6960, 0x0CC7, 0x6961, 0x1481,
- 0x6962, 0x0CC2, 0x6963, 0x3938, 0x6968, 0x2132, 0x696A, 0x1485,
- 0x696B, 0x1478, 0x696D, 0x06C0, 0x696E, 0x147B, 0x696F, 0x0967,
- 0x6972, 0x3939, 0x6973, 0x0D16, 0x6974, 0x147D, 0x6975, 0x06C3,
- 0x6977, 0x1475, 0x6978, 0x1477, 0x6979, 0x1474, 0x697C, 0x0FD6,
- 0x697D, 0x05B8, 0x697E, 0x147A, 0x697F, 0x393A, 0x6980, 0x393B,
- 0x6981, 0x1484, 0x6982, 0x0593, 0x698A, 0x0857, 0x698E, 0x04FF,
- 0x6991, 0x1495, 0x6994, 0x0FD7, 0x6995, 0x1498, 0x6998, 0x2134,
- 0x699B, 0x0A00, 0x699C, 0x1497, 0x69A0, 0x1496, 0x69A6, 0x393C,
- 0x69A7, 0x1493, 0x69AD, 0x393D, 0x69AE, 0x1487, 0x69B1, 0x14A4,
- 0x69B2, 0x1486, 0x69B4, 0x1499, 0x69B7, 0x393E, 0x69BB, 0x1491,
- 0x69BE, 0x148C, 0x69BF, 0x1489, 0x69C1, 0x148A, 0x69C3, 0x1492,
- 0x69C7, 0x1D33, 0x69CA, 0x148F, 0x69CB, 0x07CF, 0x69CC, 0x0BE4,
- 0x69CD, 0x0AE6, 0x69CE, 0x148D, 0x69D0, 0x1488, 0x69D3, 0x148B,
- 0x69D6, 0x393F, 0x69D7, 0x3940, 0x69D8, 0x0F37, 0x69D9, 0x0E98,
- 0x69DD, 0x1490, 0x69DE, 0x149A, 0x69E2, 0x2135, 0x69E7, 0x14A2,
- 0x69E8, 0x149B, 0x69EA, 0x356F, 0x69EB, 0x14A8, 0x69ED, 0x14A6,
- 0x69F2, 0x14A1, 0x69F6, 0x373F, 0x69F9, 0x14A0, 0x69FB, 0x0BEC,
- 0x69FD, 0x0AE7, 0x69FF, 0x149E, 0x6A01, 0x3941, 0x6A02, 0x149C,
- 0x6A05, 0x14A3, 0x6A0A, 0x14A9, 0x6A0B, 0x0D89, 0x6A0C, 0x14AF,
- 0x6A0F, 0x3942, 0x6A12, 0x14AA, 0x6A13, 0x14AD, 0x6A14, 0x14A7,
- 0x6A15, 0x3943, 0x6A17, 0x0BB2, 0x6A19, 0x0DAA, 0x6A1B, 0x149D,
- 0x6A1E, 0x14A5, 0x6A1F, 0x09A8, 0x6A21, 0x0EDB, 0x6A22, 0x14B9,
- 0x6A23, 0x14AC, 0x6A28, 0x3944, 0x6A29, 0x0756, 0x6A2A, 0x0523,
- 0x6A2B, 0x05BD, 0x6A2E, 0x1494, 0x6A30, 0x2136, 0x6A34, 0x3945,
- 0x6A35, 0x09A9, 0x6A36, 0x14B1, 0x6A38, 0x14B8, 0x6A39, 0x0925,
- 0x6A3A, 0x05D0, 0x6A3D, 0x0B6C, 0x6A3E, 0x3946, 0x6A44, 0x14AE,
- 0x6A45, 0x3947, 0x6A46, 0x2138, 0x6A47, 0x14B3, 0x6A48, 0x14B7,
- 0x6A4B, 0x06AE, 0x6A50, 0x3948, 0x6A51, 0x3949, 0x6A54, 0x3C34,
- 0x6A56, 0x394A, 0x6A58, 0x0666, 0x6A59, 0x14B5, 0x6A5B, 0x394B,
- 0x6A5F, 0x063B, 0x6A61, 0x0CA3, 0x6A62, 0x14B4, 0x6A66, 0x14B6,
- 0x6A6B, 0x2137, 0x6A72, 0x14B0, 0x6A73, 0x2139, 0x6A78, 0x14B2,
- 0x6A7E, 0x213A, 0x6A7F, 0x05BE, 0x6A80, 0x0B87, 0x6A83, 0x394C,
- 0x6A84, 0x14BD, 0x6A89, 0x394D, 0x6A8D, 0x14BB, 0x6A8E, 0x079D,
- 0x6A90, 0x14BA, 0x6A91, 0x394E, 0x6A97, 0x14C0, 0x6A9C, 0x143B,
- 0x6A9D, 0x394F, 0x6A9E, 0x3950, 0x6A9F, 0x3951, 0x6AA0, 0x14BC,
- 0x6AA2, 0x14BE, 0x6AA3, 0x14BF, 0x6AAA, 0x14CB, 0x6AAC, 0x14C7,
- 0x6AAE, 0x1450, 0x6AB3, 0x14C6, 0x6AB8, 0x14C5, 0x6ABB, 0x14C2,
- 0x6AC1, 0x14AB, 0x6AC2, 0x14C4, 0x6AC3, 0x14C3, 0x6AD1, 0x14C9,
- 0x6AD3, 0x0FCC, 0x6ADA, 0x14CC, 0x6ADB, 0x06F3, 0x6ADC, 0x3952,
- 0x6ADE, 0x14C8, 0x6ADF, 0x14CA, 0x6AE2, 0x213B, 0x6AE4, 0x213C,
- 0x6AE7, 0x3953, 0x6AE8, 0x0D3B, 0x6AEA, 0x14CD, 0x6AEC, 0x3954,
- 0x6AFA, 0x14D1, 0x6AFB, 0x14CE, 0x6B04, 0x0F5D, 0x6B05, 0x14CF,
- 0x6B0A, 0x149F, 0x6B12, 0x14D2, 0x6B16, 0x14D3, 0x6B1D, 0x04D7,
- 0x6B1E, 0x3955, 0x6B1F, 0x14D5, 0x6B20, 0x073D, 0x6B21, 0x08CD,
- 0x6B23, 0x06CD, 0x6B24, 0x3956, 0x6B27, 0x0524, 0x6B32, 0x0F49,
- 0x6B35, 0x3957, 0x6B37, 0x14D7, 0x6B38, 0x14D6, 0x6B39, 0x14D9,
- 0x6B3A, 0x0657, 0x6B3D, 0x06CE, 0x6B3E, 0x05FA, 0x6B43, 0x14DC,
- 0x6B46, 0x3958, 0x6B47, 0x14DB, 0x6B49, 0x14DD, 0x6B4C, 0x054E,
- 0x6B4E, 0x0B75, 0x6B50, 0x14DE, 0x6B53, 0x05FB, 0x6B54, 0x14E0,
- 0x6B56, 0x3959, 0x6B59, 0x14DF, 0x6B5B, 0x14E1, 0x6B5F, 0x14E2,
- 0x6B60, 0x395A, 0x6B61, 0x14E3, 0x6B62, 0x08AD, 0x6B63, 0x0A59,
- 0x6B64, 0x0811, 0x6B65, 0x344A, 0x6B66, 0x0DE2, 0x6B69, 0x0E32,
- 0x6B6A, 0x0FEA, 0x6B6F, 0x08C3, 0x6B72, 0x35D9, 0x6B73, 0x0840,
- 0x6B74, 0x0FBA, 0x6B77, 0x3456, 0x6B78, 0x14E4, 0x6B79, 0x14E5,
- 0x6B7B, 0x08AE, 0x6B7F, 0x14E6, 0x6B80, 0x14E7, 0x6B82, 0x395B,
- 0x6B83, 0x14E9, 0x6B84, 0x14E8, 0x6B86, 0x0E86, 0x6B89, 0x0968,
- 0x6B8A, 0x0918, 0x6B8B, 0x0892, 0x6B8D, 0x14EA, 0x6B95, 0x14EC,
- 0x6B96, 0x09E9, 0x6B98, 0x14EB, 0x6B9E, 0x14ED, 0x6BA4, 0x14EE,
- 0x6BAA, 0x14EF, 0x6BAB, 0x14F0, 0x6BAF, 0x14F1, 0x6BB1, 0x14F3,
- 0x6BB2, 0x14F2, 0x6BB3, 0x14F4, 0x6BB4, 0x0525, 0x6BB5, 0x0B88,
- 0x6BB7, 0x14F5, 0x6BBA, 0x0874, 0x6BBB, 0x05AA, 0x6BBC, 0x14F6,
- 0x6BBE, 0x395C, 0x6BBF, 0x0C3C, 0x6BC0, 0x119D, 0x6BC5, 0x063D,
- 0x6BC6, 0x14F7, 0x6BCB, 0x14F8, 0x6BCC, 0x3744, 0x6BCD, 0x0E3C,
- 0x6BCE, 0x0E96, 0x6BCF, 0x344C, 0x6BD2, 0x0C9F, 0x6BD3, 0x14F9,
- 0x6BD4, 0x0D7A, 0x6BD6, 0x213D, 0x6BD8, 0x0D8F, 0x6BDB, 0x0EDF,
- 0x6BDF, 0x14FA, 0x6BE1, 0x395D, 0x6BEB, 0x14FC, 0x6BEC, 0x14FB,
- 0x6BEF, 0x14FE, 0x6BF1, 0x395E, 0x6BF3, 0x14FD, 0x6C08, 0x1500,
- 0x6C0F, 0x08AF, 0x6C10, 0x395F, 0x6C11, 0x0EBD, 0x6C13, 0x1501,
- 0x6C14, 0x1502, 0x6C17, 0x063E, 0x6C1B, 0x1503, 0x6C23, 0x1505,
- 0x6C24, 0x1504, 0x6C33, 0x3960, 0x6C34, 0x0A2B, 0x6C35, 0x3961,
- 0x6C37, 0x0DAB, 0x6C38, 0x04EC, 0x6C3A, 0x3962, 0x6C3E, 0x0D59,
- 0x6C3F, 0x213E, 0x6C40, 0x0C11, 0x6C41, 0x094B, 0x6C42, 0x067B,
- 0x6C4E, 0x0D5A, 0x6C50, 0x08DA, 0x6C55, 0x1507, 0x6C57, 0x05FC,
- 0x6C59, 0x3963, 0x6C5A, 0x051A, 0x6C5C, 0x213F, 0x6C5D, 0x0CCA,
- 0x6C5E, 0x1506, 0x6C5F, 0x07D0, 0x6C60, 0x0B91, 0x6C62, 0x1508,
- 0x6C68, 0x1510, 0x6C6A, 0x1509, 0x6C6F, 0x2141, 0x6C70, 0x0B21,
- 0x6C72, 0x067C, 0x6C73, 0x1511, 0x6C76, 0x3964, 0x6C7A, 0x073E,
- 0x6C7B, 0x3965, 0x6C7D, 0x063F, 0x6C7E, 0x150F, 0x6C81, 0x150D,
- 0x6C82, 0x150A, 0x6C83, 0x0F4A, 0x6C85, 0x3966, 0x6C86, 0x2140,
- 0x6C88, 0x0BDC, 0x6C8C, 0x0CB1, 0x6C8D, 0x150B, 0x6C90, 0x1513,
- 0x6C92, 0x1512, 0x6C93, 0x06F9, 0x6C95, 0x3967, 0x6C96, 0x052D,
- 0x6C99, 0x082B, 0x6C9A, 0x150C, 0x6C9B, 0x150E, 0x6C9C, 0x3968,
- 0x6CA1, 0x0E85, 0x6CA2, 0x0B54, 0x6CAA, 0x3749, 0x6CAB, 0x0EA5,
- 0x6CAE, 0x151B, 0x6CB1, 0x151C, 0x6CB3, 0x054F, 0x6CB8, 0x0DF8,
- 0x6CB9, 0x0F09, 0x6CBA, 0x151E, 0x6CBB, 0x08CF, 0x6CBC, 0x09AA,
- 0x6CBD, 0x1517, 0x6CBE, 0x151D, 0x6CBF, 0x050A, 0x6CC1, 0x06AF,
- 0x6CC4, 0x1514, 0x6CC5, 0x1519, 0x6CC9, 0x0A98, 0x6CCA, 0x0D27,
- 0x6CCC, 0x0D7B, 0x6CD0, 0x3969, 0x6CD3, 0x1516, 0x6CD4, 0x396A,
- 0x6CD5, 0x0E4F, 0x6CD6, 0x396B, 0x6CD7, 0x1518, 0x6CD9, 0x1521,
- 0x6CDA, 0x2142, 0x6CDB, 0x151F, 0x6CDD, 0x151A, 0x6CE0, 0x396C,
- 0x6CE1, 0x0E50, 0x6CE2, 0x0CFE, 0x6CE3, 0x067D, 0x6CE5, 0x0C1F,
- 0x6CE8, 0x0BAB, 0x6CEA, 0x1522, 0x6CEB, 0x396D, 0x6CEC, 0x396E,
- 0x6CEE, 0x396F, 0x6CEF, 0x1520, 0x6CF0, 0x0B39, 0x6CF1, 0x1515,
- 0x6CF3, 0x04ED, 0x6D01, 0x3C35, 0x6D04, 0x2143, 0x6D0A, 0x3970,
- 0x6D0B, 0x0F38, 0x6D0C, 0x152D, 0x6D0E, 0x3971, 0x6D11, 0x3972,
- 0x6D12, 0x152C, 0x6D17, 0x0A9A, 0x6D19, 0x1529, 0x6D1B, 0x0F56,
- 0x6D1E, 0x0C8E, 0x6D1F, 0x1523, 0x6D25, 0x0BE1, 0x6D29, 0x04EE,
- 0x6D2A, 0x07D1, 0x6D2B, 0x1526, 0x6D2E, 0x3973, 0x6D32, 0x0931,
- 0x6D33, 0x152B, 0x6D35, 0x152A, 0x6D36, 0x1525, 0x6D38, 0x1528,
- 0x6D3B, 0x05C6, 0x6D3D, 0x1527, 0x6D3E, 0x0CFF, 0x6D41, 0x0F76,
- 0x6D44, 0x09DC, 0x6D45, 0x0A99, 0x6D57, 0x3974, 0x6D59, 0x1533,
- 0x6D5A, 0x1531, 0x6D5C, 0x0DBF, 0x6D5E, 0x3975, 0x6D63, 0x152E,
- 0x6D64, 0x1530, 0x6D65, 0x3976, 0x6D66, 0x04DC, 0x6D69, 0x07D2,
- 0x6D6A, 0x0FD8, 0x6D6C, 0x059B, 0x6D6E, 0x0DD4, 0x6D6F, 0x2145,
- 0x6D74, 0x0F4B, 0x6D77, 0x0582, 0x6D78, 0x0A01, 0x6D79, 0x1532,
- 0x6D82, 0x3977, 0x6D85, 0x1537, 0x6D87, 0x2144, 0x6D88, 0x09AB,
- 0x6D89, 0x342A, 0x6D8C, 0x0F1A, 0x6D8E, 0x1534, 0x6D93, 0x152F,
- 0x6D95, 0x1535, 0x6D96, 0x2146, 0x6D99, 0x0FA6, 0x6D9B, 0x0C6D,
- 0x6D9C, 0x0C9A, 0x6DAC, 0x2147, 0x6DAF, 0x0594, 0x6DB2, 0x04F7,
- 0x6DB5, 0x153B, 0x6DB8, 0x153E, 0x6DBC, 0x0F8B, 0x6DBF, 0x3978,
- 0x6DC0, 0x0F4E, 0x6DC4, 0x3979, 0x6DC5, 0x1545, 0x6DC6, 0x153F,
- 0x6DC7, 0x153C, 0x6DCA, 0x397A, 0x6DCB, 0x0F9C, 0x6DCC, 0x1542,
- 0x6DCF, 0x2148, 0x6DD0, 0x3C36, 0x6DD1, 0x0954, 0x6DD2, 0x1544,
- 0x6DD5, 0x1549, 0x6DD6, 0x397B, 0x6DD8, 0x0C6B, 0x6DD9, 0x1547,
- 0x6DDA, 0x3453, 0x6DDE, 0x1541, 0x6DE1, 0x0B76, 0x6DE4, 0x1548,
- 0x6DE6, 0x153D, 0x6DE8, 0x1543, 0x6DE9, 0x397C, 0x6DEA, 0x154A,
- 0x6DEB, 0x04C0, 0x6DEC, 0x1540, 0x6DEE, 0x154B, 0x6DF1, 0x0A02,
- 0x6DF2, 0x214A, 0x6DF3, 0x0969, 0x6DF5, 0x0DF5, 0x6DF7, 0x081E,
- 0x6DF8, 0x2149, 0x6DF9, 0x1538, 0x6DFA, 0x1546, 0x6DFB, 0x0C34,
- 0x6DFC, 0x214B, 0x6E05, 0x0A5A, 0x6E07, 0x05C7, 0x6E08, 0x0841,
- 0x6E09, 0x09AC, 0x6E0A, 0x153A, 0x6E0B, 0x094C, 0x6E13, 0x0722,
- 0x6E15, 0x1539, 0x6E17, 0x3746, 0x6E19, 0x154F, 0x6E1A, 0x0977,
- 0x6E1B, 0x076E, 0x6E1D, 0x155E, 0x6E1F, 0x1558, 0x6E20, 0x068E,
- 0x6E21, 0x0C49, 0x6E22, 0x397D, 0x6E23, 0x1553, 0x6E24, 0x155C,
- 0x6E25, 0x0473, 0x6E26, 0x04D4, 0x6E27, 0x214E, 0x6E29, 0x0539,
- 0x6E2B, 0x1555, 0x6E2C, 0x0B0C, 0x6E2D, 0x154C, 0x6E2E, 0x154E,
- 0x6E2F, 0x07D3, 0x6E34, 0x3412, 0x6E38, 0x155F, 0x6E39, 0x214C,
- 0x6E3A, 0x155A, 0x6E3C, 0x214F, 0x6E3E, 0x1552, 0x6E42, 0x3C37,
- 0x6E43, 0x1559, 0x6E4A, 0x0EB7, 0x6E4D, 0x1557, 0x6E4E, 0x155B,
- 0x6E51, 0x397E, 0x6E56, 0x0784, 0x6E58, 0x09AD, 0x6E5B, 0x0B77,
- 0x6E5C, 0x214D, 0x6E5F, 0x1551, 0x6E67, 0x0F19, 0x6E6B, 0x1554,
- 0x6E6E, 0x154D, 0x6E6F, 0x0C6C, 0x6E72, 0x1550, 0x6E76, 0x1556,
- 0x6E7E, 0x0FF7, 0x6E7F, 0x08EA, 0x6E80, 0x0EAC, 0x6E82, 0x1560,
- 0x6E8C, 0x0D42, 0x6E8F, 0x156C, 0x6E90, 0x076F, 0x6E96, 0x096A,
- 0x6E98, 0x1562, 0x6E9C, 0x0F77, 0x6E9D, 0x07D4, 0x6E9F, 0x156F,
- 0x6EA2, 0x04B2, 0x6EA5, 0x156D, 0x6EAA, 0x1561, 0x6EAB, 0x340C,
- 0x6EAF, 0x1567, 0x6EB2, 0x1569, 0x6EB6, 0x0F39, 0x6EB7, 0x1564,
- 0x6EBA, 0x0C28, 0x6EBD, 0x1566, 0x6EBF, 0x2150, 0x6EC2, 0x156E,
- 0x6EC4, 0x1568, 0x6EC5, 0x0ED3, 0x6EC7, 0x397F, 0x6EC9, 0x1563,
- 0x6ECA, 0x3980, 0x6ECB, 0x08CE, 0x6ECC, 0x157B, 0x6ECE, 0x3981,
- 0x6ED1, 0x05C8, 0x6ED3, 0x1565, 0x6ED4, 0x156A, 0x6ED5, 0x156B,
- 0x6ED9, 0x3C38, 0x6EDD, 0x0B4C, 0x6EDE, 0x0B3A, 0x6EE6, 0x3C24,
- 0x6EEC, 0x1573, 0x6EEF, 0x1579, 0x6EF2, 0x1577, 0x6EF4, 0x0C23,
- 0x6EF7, 0x157E, 0x6EF8, 0x1574, 0x6EFD, 0x3982, 0x6EFE, 0x1575,
- 0x6EFF, 0x155D, 0x6F01, 0x0693, 0x6F02, 0x0DAC, 0x6F06, 0x08EB,
- 0x6F09, 0x0809, 0x6F0F, 0x0FD9, 0x6F11, 0x1571, 0x6F13, 0x157D,
- 0x6F14, 0x050B, 0x6F15, 0x0AE8, 0x6F1A, 0x3983, 0x6F20, 0x0D2F,
- 0x6F22, 0x05FD, 0x6F23, 0x0FC2, 0x6F2A, 0x3984, 0x6F2B, 0x0EAD,
- 0x6F2C, 0x0BEE, 0x6F2F, 0x3985, 0x6F31, 0x1578, 0x6F32, 0x157A,
- 0x6F33, 0x3986, 0x6F38, 0x0AB4, 0x6F3E, 0x157C, 0x6F3F, 0x1576,
- 0x6F41, 0x1570, 0x6F45, 0x05FF, 0x6F51, 0x1E60, 0x6F54, 0x073F,
- 0x6F58, 0x158A, 0x6F5A, 0x3987, 0x6F5B, 0x1585, 0x6F5C, 0x0A9C,
- 0x6F5E, 0x3988, 0x6F5F, 0x05C1, 0x6F62, 0x3989, 0x6F64, 0x096B,
- 0x6F66, 0x158E, 0x6F6D, 0x1587, 0x6F6E, 0x0BC8, 0x6F6F, 0x1584,
- 0x6F70, 0x0BF5, 0x6F74, 0x15A7, 0x6F78, 0x1581, 0x6F7A, 0x1580,
- 0x6F7C, 0x1589, 0x6F7D, 0x398A, 0x6F80, 0x1583, 0x6F81, 0x1582,
- 0x6F82, 0x1588, 0x6F84, 0x0A45, 0x6F86, 0x157F, 0x6F88, 0x2151,
- 0x6F8B, 0x398B, 0x6F8D, 0x398C, 0x6F8E, 0x158B, 0x6F91, 0x158C,
- 0x6F92, 0x398D, 0x6F94, 0x398E, 0x6F97, 0x05FE, 0x6F98, 0x363C,
- 0x6F9A, 0x398F, 0x6FA1, 0x1591, 0x6FA3, 0x1590, 0x6FA4, 0x1592,
- 0x6FA7, 0x3990, 0x6FA8, 0x3991, 0x6FAA, 0x1595, 0x6FB1, 0x0C3D,
- 0x6FB3, 0x158F, 0x6FB5, 0x2152, 0x6FB6, 0x3992, 0x6FB9, 0x1593,
- 0x6FC0, 0x0739, 0x6FC1, 0x0B59, 0x6FC2, 0x158D, 0x6FC3, 0x0CF1,
- 0x6FC6, 0x1594, 0x6FD4, 0x1599, 0x6FD5, 0x1597, 0x6FD8, 0x159A,
- 0x6FDA, 0x3993, 0x6FDB, 0x159D, 0x6FDE, 0x3994, 0x6FDF, 0x1596,
- 0x6FE0, 0x07FC, 0x6FE1, 0x0CDE, 0x6FE4, 0x1536, 0x6FEB, 0x0F5E,
- 0x6FEC, 0x1598, 0x6FEE, 0x159C, 0x6FEF, 0x0B55, 0x6FF1, 0x159B,
- 0x6FF3, 0x1586, 0x6FF5, 0x2153, 0x6FF6, 0x1BA4, 0x6FF9, 0x3995,
- 0x6FFA, 0x15A0, 0x6FFE, 0x15A4, 0x7001, 0x15A2, 0x7005, 0x2154,
- 0x7006, 0x1E50, 0x7007, 0x2155, 0x7009, 0x159E, 0x700B, 0x159F,
- 0x700F, 0x15A3, 0x7011, 0x15A1, 0x7015, 0x0DC0, 0x7018, 0x15A9,
- 0x701A, 0x15A6, 0x701B, 0x15A5, 0x701D, 0x15A8, 0x701E, 0x0CAC,
- 0x701F, 0x15AA, 0x7026, 0x0BB3, 0x7027, 0x0B4D, 0x7028, 0x2156,
- 0x702C, 0x0A49, 0x7030, 0x15AB, 0x7032, 0x15AD, 0x7039, 0x3996,
- 0x703C, 0x3997, 0x703E, 0x15AC, 0x704A, 0x3998, 0x704C, 0x1572,
- 0x7051, 0x15AE, 0x7054, 0x3999, 0x7058, 0x0CBF, 0x705D, 0x399A,
- 0x705E, 0x399B, 0x7063, 0x15AF, 0x7064, 0x399C, 0x706B, 0x0550,
- 0x706C, 0x399D, 0x706F, 0x0C6E, 0x7070, 0x0583, 0x7078, 0x067E,
- 0x707C, 0x090A, 0x707D, 0x0842, 0x707E, 0x399E, 0x7081, 0x399F,
- 0x7085, 0x2157, 0x7089, 0x0FCD, 0x708A, 0x0A2C, 0x708E, 0x050C,
- 0x7092, 0x15B1, 0x7095, 0x39A0, 0x7099, 0x15B0, 0x70AB, 0x2158,
- 0x70AC, 0x15B4, 0x70AD, 0x0B78, 0x70AE, 0x15B7, 0x70AF, 0x15B2,
- 0x70B3, 0x15B6, 0x70B7, 0x39A1, 0x70B8, 0x15B5, 0x70B9, 0x0C3A,
- 0x70BA, 0x049D, 0x70BB, 0x20AD, 0x70C8, 0x0FBD, 0x70CB, 0x15B9,
- 0x70CF, 0x04CA, 0x70D3, 0x39A2, 0x70D4, 0x39A3, 0x70D8, 0x39A4,
- 0x70D9, 0x15BB, 0x70DC, 0x39A5, 0x70DD, 0x15BA, 0x70DF, 0x15B8,
- 0x70F1, 0x15B3, 0x70F9, 0x0E51, 0x70FD, 0x15BD, 0x7104, 0x215A,
- 0x7107, 0x39A6, 0x7109, 0x15BC, 0x710F, 0x2159, 0x7114, 0x050D,
- 0x7119, 0x15BF, 0x711A, 0x0E02, 0x711C, 0x15BE, 0x7120, 0x39A7,
- 0x7121, 0x0EC1, 0x7126, 0x09AF, 0x7130, 0x1DDC, 0x7131, 0x39A8,
- 0x7136, 0x0AB5, 0x713C, 0x09AE, 0x7146, 0x215C, 0x7147, 0x215D,
- 0x7149, 0x0FC3, 0x714A, 0x39A9, 0x714C, 0x15C5, 0x714E, 0x0A9D,
- 0x7152, 0x39AA, 0x7155, 0x15C1, 0x7156, 0x15C6, 0x7159, 0x050E,
- 0x715C, 0x215B, 0x7160, 0x39AB, 0x7162, 0x15C4, 0x7164, 0x0D17,
- 0x7165, 0x15C0, 0x7166, 0x15C3, 0x7167, 0x09B0, 0x7169, 0x0D65,
- 0x716C, 0x15C7, 0x716E, 0x08FD, 0x7179, 0x39AC, 0x717D, 0x0A9E,
- 0x7184, 0x15CA, 0x7188, 0x15C2, 0x718A, 0x06FD, 0x718F, 0x15C8,
- 0x7192, 0x39AD, 0x7194, 0x0F3A, 0x7195, 0x15CB, 0x7199, 0x205D,
- 0x719F, 0x0959, 0x71A8, 0x15CC, 0x71AC, 0x15CD, 0x71B1, 0x0CE4,
- 0x71B3, 0x39AE, 0x71B9, 0x15CF, 0x71BE, 0x15D0, 0x71C1, 0x215F,
- 0x71C3, 0x0CE9, 0x71C8, 0x0C6F, 0x71C9, 0x15D2, 0x71CB, 0x39AF,
- 0x71CE, 0x15D4, 0x71D0, 0x0F9D, 0x71D2, 0x15D1, 0x71D3, 0x39B0,
- 0x71D4, 0x15D3, 0x71D5, 0x050F, 0x71D6, 0x39B1, 0x71D7, 0x15CE,
- 0x71DF, 0x114E, 0x71E0, 0x15D5, 0x71E5, 0x0AE9, 0x71E6, 0x0886,
- 0x71E7, 0x15D7, 0x71EC, 0x15D6, 0x71ED, 0x09EA, 0x71EE, 0x10EE,
- 0x71F5, 0x15D8, 0x71F9, 0x15DA, 0x71FB, 0x15C9, 0x71FC, 0x15D9,
- 0x71FE, 0x2160, 0x71FF, 0x15DB, 0x7200, 0x39B2, 0x7206, 0x0D30,
- 0x720D, 0x15DC, 0x7210, 0x15DD, 0x721B, 0x15DE, 0x721D, 0x39B3,
- 0x7228, 0x15DF, 0x722A, 0x0BFA, 0x722B, 0x39B4, 0x722C, 0x15E1,
- 0x722D, 0x15E0, 0x7230, 0x15E2, 0x7232, 0x15E3, 0x7235, 0x090B,
- 0x7236, 0x0DD5, 0x7238, 0x39B5, 0x723A, 0x0EF8, 0x723B, 0x15E4,
- 0x723C, 0x15E5, 0x723D, 0x0AD8, 0x723E, 0x08D0, 0x723F, 0x15E6,
- 0x7240, 0x15E7, 0x7241, 0x39B6, 0x7246, 0x15E8, 0x7247, 0x0E22,
- 0x7248, 0x0D5B, 0x724B, 0x15E9, 0x724C, 0x0D0D, 0x7252, 0x0BC9,
- 0x7253, 0x39B7, 0x7255, 0x39B8, 0x7256, 0x39B9, 0x7258, 0x15EA,
- 0x7259, 0x0567, 0x725B, 0x0687, 0x725C, 0x39BA, 0x725D, 0x0ED2,
- 0x725F, 0x0EC2, 0x7261, 0x0534, 0x7262, 0x0FDA, 0x7267, 0x0E80,
- 0x7269, 0x0DFA, 0x7272, 0x0A5B, 0x7274, 0x15EB, 0x7279, 0x0C9B,
- 0x727D, 0x0757, 0x727E, 0x15EC, 0x7280, 0x0844, 0x7281, 0x15EE,
- 0x7282, 0x15ED, 0x7287, 0x15EF, 0x728D, 0x39BB, 0x7292, 0x15F0,
- 0x7296, 0x15F1, 0x72A0, 0x0658, 0x72A2, 0x15F2, 0x72A7, 0x15F3,
- 0x72AC, 0x0758, 0x72AD, 0x39BC, 0x72AF, 0x0D5C, 0x72B1, 0x2161,
- 0x72B2, 0x15F5, 0x72B4, 0x39BD, 0x72B6, 0x09DD, 0x72B9, 0x15F4,
- 0x72BE, 0x2162, 0x72C0, 0x342B, 0x72C2, 0x06B0, 0x72C3, 0x15F6,
- 0x72C4, 0x15F8, 0x72C6, 0x15F7, 0x72C7, 0x39BE, 0x72CE, 0x15F9,
- 0x72D0, 0x0785, 0x72D2, 0x15FA, 0x72D7, 0x06E1, 0x72D9, 0x0AC2,
- 0x72DB, 0x080F, 0x72E0, 0x15FC, 0x72E1, 0x15FD, 0x72E2, 0x15FB,
- 0x72E9, 0x0919, 0x72EC, 0x0CA0, 0x72ED, 0x06B1, 0x72F7, 0x15FF,
- 0x72F8, 0x0B6A, 0x72F9, 0x15FE, 0x72FB, 0x39BF, 0x72FC, 0x0FDB,
- 0x72FD, 0x0D18, 0x7304, 0x39C0, 0x7305, 0x39C1, 0x730A, 0x1602,
- 0x7316, 0x1604, 0x7317, 0x1601, 0x731B, 0x0EE0, 0x731C, 0x1603,
- 0x731D, 0x1605, 0x731F, 0x0F8C, 0x7324, 0x2163, 0x7325, 0x1609,
- 0x7328, 0x39C2, 0x7329, 0x1608, 0x732A, 0x0BB4, 0x732B, 0x0CE3,
- 0x732E, 0x0759, 0x732F, 0x1607, 0x7331, 0x39C3, 0x7334, 0x1606,
- 0x7336, 0x0F1B, 0x7337, 0x0F1C, 0x733E, 0x160A, 0x733F, 0x0510,
- 0x7343, 0x39C4, 0x7344, 0x0808, 0x7345, 0x08B0, 0x734E, 0x160B,
- 0x734F, 0x160C, 0x7357, 0x160E, 0x7363, 0x094D, 0x7368, 0x1610,
- 0x736A, 0x160F, 0x736C, 0x39C5, 0x7370, 0x1611, 0x7372, 0x05AB,
- 0x7375, 0x1613, 0x7377, 0x2165, 0x7378, 0x1612, 0x737A, 0x1615,
- 0x737B, 0x1614, 0x737C, 0x39C6, 0x7383, 0x39C7, 0x7384, 0x0770,
- 0x7385, 0x39C8, 0x7386, 0x39C9, 0x7387, 0x0F70, 0x7389, 0x06C4,
- 0x738B, 0x0526, 0x7395, 0x39CA, 0x7396, 0x06E2, 0x739E, 0x39CB,
- 0x739F, 0x39CC, 0x73A0, 0x39CD, 0x73A6, 0x39CE, 0x73A8, 0x3C3F,
- 0x73A9, 0x061D, 0x73AB, 0x39CF, 0x73B2, 0x0FB0, 0x73B3, 0x1617,
- 0x73B5, 0x39D0, 0x73B7, 0x39D1, 0x73BA, 0x35EA, 0x73BB, 0x1619,
- 0x73BC, 0x39D2, 0x73BD, 0x2166, 0x73C0, 0x161A, 0x73C2, 0x0551,
- 0x73C8, 0x1616, 0x73C9, 0x2167, 0x73CA, 0x0887, 0x73CD, 0x0BDD,
- 0x73CE, 0x1618, 0x73CF, 0x39D3, 0x73D2, 0x216A, 0x73D6, 0x2168,
- 0x73D9, 0x39D4, 0x73DE, 0x161D, 0x73E0, 0x091A, 0x73E3, 0x2169,
- 0x73E4, 0x3C39, 0x73E5, 0x161B, 0x73E9, 0x39D5, 0x73EA, 0x0714,
- 0x73ED, 0x0D5D, 0x73EE, 0x161C, 0x73F1, 0x1637, 0x73F4, 0x39D6,
- 0x73F5, 0x216C, 0x73F8, 0x1622, 0x73FD, 0x39D7, 0x73FE, 0x0771,
- 0x7403, 0x067F, 0x7404, 0x39D8, 0x7405, 0x161F, 0x7406, 0x0F67,
- 0x7407, 0x216B, 0x7409, 0x0F78, 0x740A, 0x39D9, 0x741A, 0x39DA,
- 0x741B, 0x39DB, 0x7421, 0x3C3A, 0x7422, 0x0B56, 0x7424, 0x39DC,
- 0x7425, 0x1621, 0x7426, 0x216D, 0x7428, 0x39DD, 0x7429, 0x216F,
- 0x742A, 0x216E, 0x742C, 0x39DE, 0x742E, 0x2170, 0x742F, 0x39DF,
- 0x7430, 0x39E0, 0x7431, 0x39E1, 0x7432, 0x1623, 0x7433, 0x0F9E,
- 0x7434, 0x06CF, 0x7435, 0x0D90, 0x7436, 0x0D00, 0x7439, 0x39E2,
- 0x743A, 0x1624, 0x743F, 0x1626, 0x7441, 0x1629, 0x7444, 0x39E3,
- 0x7447, 0x39E4, 0x744B, 0x39E5, 0x744D, 0x39E6, 0x7451, 0x39E7,
- 0x7455, 0x1625, 0x7457, 0x39E8, 0x7459, 0x1628, 0x745A, 0x079E,
- 0x745B, 0x04EF, 0x745C, 0x162A, 0x745E, 0x0A36, 0x745F, 0x1627,
- 0x7460, 0x0FA4, 0x7462, 0x2171, 0x7463, 0x162D, 0x7464, 0x1D35,
- 0x7466, 0x39E9, 0x7469, 0x162B, 0x746A, 0x162E, 0x746B, 0x39EA,
- 0x746F, 0x1620, 0x7470, 0x162C, 0x7471, 0x39EB, 0x7473, 0x082C,
- 0x7476, 0x162F, 0x747E, 0x1630, 0x7480, 0x39EC, 0x7483, 0x0F68,
- 0x7485, 0x39ED, 0x7486, 0x39EE, 0x7487, 0x39EF, 0x7489, 0x2172,
- 0x748B, 0x1631, 0x7490, 0x39F0, 0x7498, 0x39F1, 0x749C, 0x39F2,
- 0x749E, 0x1632, 0x749F, 0x2173, 0x74A0, 0x39F3, 0x74A2, 0x161E,
- 0x74A3, 0x39F4, 0x74A7, 0x1633, 0x74A8, 0x39F5, 0x74AB, 0x39F6,
- 0x74B0, 0x0600, 0x74B5, 0x39F7, 0x74BD, 0x08D1, 0x74BF, 0x39F8,
- 0x74C8, 0x39F9, 0x74CA, 0x1634, 0x74CF, 0x1635, 0x74D4, 0x1636,
- 0x74DA, 0x39FA, 0x74DC, 0x04DD, 0x74DE, 0x39FB, 0x74E0, 0x1638,
- 0x74E2, 0x0DAD, 0x74E3, 0x1639, 0x74E6, 0x05E0, 0x74E7, 0x163A,
- 0x74E9, 0x163B, 0x74EE, 0x163C, 0x74EF, 0x3750, 0x74F0, 0x163E,
- 0x74F1, 0x163F, 0x74F2, 0x163D, 0x74F6, 0x0DC5, 0x74F7, 0x1641,
- 0x74F8, 0x1640, 0x7501, 0x2174, 0x7503, 0x1643, 0x7504, 0x1642,
- 0x7505, 0x1644, 0x750C, 0x1645, 0x750D, 0x1647, 0x750E, 0x1646,
- 0x7511, 0x080B, 0x7513, 0x1649, 0x7515, 0x1648, 0x7518, 0x0601,
- 0x751A, 0x0A19, 0x751C, 0x0C36, 0x751E, 0x164A, 0x751F, 0x0A5C,
- 0x7522, 0x35DE, 0x7523, 0x0888, 0x7525, 0x051B, 0x7526, 0x164B,
- 0x7528, 0x0F3B, 0x752B, 0x0E33, 0x752C, 0x164C, 0x752F, 0x20F2,
- 0x7530, 0x0C3E, 0x7531, 0x0F1D, 0x7532, 0x07D5, 0x7533, 0x0A03,
- 0x7537, 0x0B89, 0x7538, 0x10C9, 0x753A, 0x0BCA, 0x753B, 0x0568,
- 0x753C, 0x164D, 0x7544, 0x164E, 0x7546, 0x1653, 0x7549, 0x1651,
- 0x754A, 0x1650, 0x754B, 0x13C7, 0x754C, 0x0584, 0x754D, 0x164F,
- 0x754E, 0x39FC, 0x754F, 0x049E, 0x7551, 0x0D3E, 0x7554, 0x0D5E,
- 0x7559, 0x0F79, 0x755A, 0x1654, 0x755B, 0x1652, 0x755C, 0x0B9A,
- 0x755D, 0x0A4A, 0x7560, 0x0D3F, 0x7562, 0x0D9F, 0x7564, 0x1656,
- 0x7565, 0x0F74, 0x7566, 0x0723, 0x7567, 0x1657, 0x7569, 0x1655,
- 0x756A, 0x0D6A, 0x756B, 0x1658, 0x756C, 0x3C3B, 0x756D, 0x1659,
- 0x756F, 0x2175, 0x7570, 0x049F, 0x7573, 0x09DE, 0x7574, 0x165E,
- 0x7575, 0x3751, 0x7576, 0x165B, 0x7577, 0x0CC5, 0x7578, 0x165A,
- 0x7579, 0x39FD, 0x757F, 0x0640, 0x7581, 0x39FE, 0x7582, 0x1661,
- 0x7586, 0x165C, 0x7587, 0x165D, 0x7589, 0x1660, 0x758A, 0x165F,
- 0x758B, 0x0D97, 0x758E, 0x0AC4, 0x758F, 0x0AC3, 0x7590, 0x39FF,
- 0x7591, 0x0659, 0x7592, 0x3A00, 0x7593, 0x3A01, 0x7594, 0x1662,
- 0x759A, 0x1663, 0x759D, 0x1664, 0x75A3, 0x1666, 0x75A5, 0x1665,
- 0x75AB, 0x04F8, 0x75B1, 0x166E, 0x75B2, 0x0D7C, 0x75B3, 0x1668,
- 0x75B4, 0x3A02, 0x75B5, 0x166A, 0x75B8, 0x166C, 0x75B9, 0x0A04,
- 0x75BC, 0x166D, 0x75BD, 0x166B, 0x75BE, 0x08EC, 0x75C2, 0x1667,
- 0x75C3, 0x1669, 0x75C5, 0x0DB4, 0x75C7, 0x09B1, 0x75CA, 0x1670,
- 0x75CD, 0x166F, 0x75D2, 0x1671, 0x75D4, 0x08D2, 0x75D5, 0x081F,
- 0x75D8, 0x0C71, 0x75D9, 0x1672, 0x75DB, 0x0BE7, 0x75DE, 0x1674,
- 0x75E2, 0x0F69, 0x75E3, 0x1673, 0x75E4, 0x3A03, 0x75E9, 0x0AEB,
- 0x75EC, 0x3752, 0x75F0, 0x1679, 0x75F2, 0x167B, 0x75F3, 0x167C,
- 0x75F4, 0x0B92, 0x75F9, 0x3A04, 0x75FA, 0x167A, 0x75FC, 0x1677,
- 0x75FE, 0x1675, 0x75FF, 0x1676, 0x7600, 0x3A05, 0x7601, 0x1678,
- 0x7609, 0x167F, 0x760A, 0x3A06, 0x760B, 0x167D, 0x760D, 0x167E,
- 0x7615, 0x3A07, 0x7616, 0x3A08, 0x7619, 0x3A09, 0x761E, 0x3A0A,
- 0x761F, 0x1680, 0x7620, 0x1682, 0x7621, 0x1683, 0x7622, 0x1684,
- 0x7624, 0x1685, 0x7626, 0x1E2D, 0x7627, 0x1681, 0x762D, 0x3A0B,
- 0x7630, 0x1687, 0x7634, 0x1686, 0x7635, 0x3A0C, 0x763B, 0x1688,
- 0x7642, 0x0F8D, 0x7643, 0x3A0D, 0x7646, 0x168B, 0x7647, 0x1689,
- 0x7648, 0x168A, 0x764B, 0x3A0E, 0x764C, 0x061E, 0x764E, 0x3753,
- 0x7652, 0x0F0A, 0x7656, 0x0E1A, 0x7658, 0x168D, 0x765C, 0x168C,
- 0x7661, 0x168E, 0x7662, 0x168F, 0x7665, 0x3A0F, 0x7667, 0x1693,
- 0x7668, 0x1690, 0x7669, 0x1691, 0x766A, 0x1692, 0x766C, 0x1694,
- 0x766D, 0x3A10, 0x766F, 0x3A11, 0x7670, 0x1695, 0x7671, 0x3A12,
- 0x7672, 0x1696, 0x7674, 0x3A13, 0x7676, 0x1697, 0x7678, 0x1698,
- 0x767A, 0x0D43, 0x767B, 0x0C4A, 0x767C, 0x1699, 0x767D, 0x0D28,
- 0x767E, 0x0DA6, 0x7680, 0x169A, 0x7682, 0x2176, 0x7683, 0x169B,
- 0x7684, 0x0C24, 0x7686, 0x0585, 0x7687, 0x07D6, 0x7688, 0x169C,
- 0x768B, 0x169D, 0x768E, 0x169E, 0x7690, 0x0877, 0x7693, 0x16A0,
- 0x7696, 0x169F, 0x7699, 0x16A1, 0x769A, 0x16A2, 0x769B, 0x2179,
- 0x769C, 0x2177, 0x769E, 0x2178, 0x76A4, 0x3A14, 0x76A5, 0x3A15,
- 0x76A6, 0x217A, 0x76AE, 0x0D7D, 0x76B0, 0x16A3, 0x76B4, 0x16A4,
- 0x76B7, 0x1D1C, 0x76B8, 0x16A5, 0x76B9, 0x16A6, 0x76BA, 0x16A7,
- 0x76BF, 0x087C, 0x76C2, 0x16A8, 0x76C3, 0x0D0C, 0x76C5, 0x3A16,
- 0x76C6, 0x0E8D, 0x76C8, 0x04F0, 0x76CA, 0x04F9, 0x76CC, 0x3A17,
- 0x76CD, 0x16A9, 0x76D2, 0x16AB, 0x76D6, 0x16AA, 0x76D7, 0x0C6A,
- 0x76DB, 0x0A5D, 0x76DC, 0x14D8, 0x76DE, 0x16AC, 0x76DF, 0x0ECD,
- 0x76E1, 0x16AD, 0x76E3, 0x0602, 0x76E4, 0x0D6B, 0x76E5, 0x16AE,
- 0x76E7, 0x16AF, 0x76EA, 0x16B0, 0x76EC, 0x3A18, 0x76EE, 0x0EE8,
- 0x76F2, 0x0EE1, 0x76F4, 0x0BDA, 0x76F8, 0x0AEC, 0x76FB, 0x16B2,
- 0x76FC, 0x3A19, 0x76FE, 0x096C, 0x7701, 0x09B2, 0x7704, 0x16B5,
- 0x7707, 0x16B4, 0x7708, 0x16B3, 0x7709, 0x0D91, 0x770B, 0x0603,
- 0x770C, 0x075D, 0x771B, 0x16BB, 0x771E, 0x16B8, 0x771F, 0x0A05,
- 0x7720, 0x0EBE, 0x7724, 0x16B7, 0x7725, 0x16B9, 0x7726, 0x16BA,
- 0x7729, 0x16B6, 0x7734, 0x3A1A, 0x7736, 0x3A1B, 0x7737, 0x16BC,
- 0x7738, 0x16BD, 0x773A, 0x0BCB, 0x773C, 0x061F, 0x7740, 0x0BA3,
- 0x7746, 0x217C, 0x7747, 0x16BE, 0x775A, 0x16BF, 0x775B, 0x16C2,
- 0x775C, 0x3A1C, 0x775F, 0x3A1D, 0x7760, 0x3A1E, 0x7761, 0x0A2D,
- 0x7762, 0x1EC5, 0x7763, 0x0C9C, 0x7765, 0x16C3, 0x7766, 0x0E81,
- 0x7768, 0x16C0, 0x776A, 0x3755, 0x776B, 0x16C1, 0x7772, 0x3A1F,
- 0x7779, 0x16C6, 0x777D, 0x3A20, 0x777E, 0x16C5, 0x777F, 0x16C4,
- 0x778B, 0x16C8, 0x778E, 0x16C7, 0x7791, 0x16C9, 0x7795, 0x3A21,
- 0x779E, 0x16CB, 0x77A0, 0x16CA, 0x77A5, 0x0E1D, 0x77A9, 0x3756,
- 0x77AA, 0x3A22, 0x77AC, 0x0960, 0x77AD, 0x0F8E, 0x77B0, 0x16CC,
- 0x77B3, 0x0C8F, 0x77B6, 0x16CD, 0x77B9, 0x16CE, 0x77BB, 0x16D2,
- 0x77BC, 0x16D0, 0x77BD, 0x16D1, 0x77BF, 0x16CF, 0x77C7, 0x16D3,
- 0x77CD, 0x16D4, 0x77D7, 0x16D5, 0x77DA, 0x16D6, 0x77DB, 0x0EC3,
- 0x77DC, 0x16D7, 0x77E2, 0x0EFC, 0x77E3, 0x16D8, 0x77E5, 0x0B8C,
- 0x77E6, 0x3A23, 0x77E7, 0x0D20, 0x77E9, 0x06E3, 0x77ED, 0x0B79,
- 0x77EE, 0x16D9, 0x77EF, 0x06B2, 0x77F0, 0x3A24, 0x77F3, 0x0A74,
- 0x77F4, 0x3A25, 0x77FC, 0x16DA, 0x7802, 0x082D, 0x7806, 0x3A26,
- 0x780C, 0x16DB, 0x7812, 0x16DC, 0x7814, 0x075A, 0x7815, 0x0845,
- 0x7820, 0x16DE, 0x7821, 0x217E, 0x7822, 0x3A27, 0x7825, 0x0C50,
- 0x7826, 0x0846, 0x7827, 0x0668, 0x782D, 0x3A28, 0x782E, 0x3A29,
- 0x7830, 0x3A2A, 0x7832, 0x0E52, 0x7834, 0x0D01, 0x7835, 0x3A2B,
- 0x783A, 0x0C51, 0x783F, 0x07EE, 0x7845, 0x16E0, 0x784E, 0x217F,
- 0x784F, 0x341E, 0x7851, 0x3C3C, 0x785D, 0x09B3, 0x7864, 0x2180,
- 0x7868, 0x3A2C, 0x786B, 0x0F7A, 0x786C, 0x07D7, 0x786F, 0x075B,
- 0x7872, 0x0D37, 0x7874, 0x16E2, 0x787A, 0x2181, 0x787C, 0x16E4,
- 0x7881, 0x079F, 0x7886, 0x16E3, 0x7887, 0x0C12, 0x788C, 0x16E6,
- 0x788D, 0x0595, 0x788E, 0x16E1, 0x7891, 0x0D7E, 0x7893, 0x04D2,
- 0x7895, 0x085C, 0x7897, 0x0FF8, 0x789A, 0x16E5, 0x789E, 0x3A2D,
- 0x78A3, 0x16E7, 0x78A7, 0x0E1B, 0x78A9, 0x0A7D, 0x78AA, 0x16E9,
- 0x78AF, 0x16EA, 0x78B5, 0x16E8, 0x78BA, 0x05AC, 0x78BC, 0x16F0,
- 0x78BE, 0x16EF, 0x78C1, 0x08D3, 0x78C5, 0x16F1, 0x78C6, 0x16EC,
- 0x78C8, 0x3A2E, 0x78CA, 0x16F2, 0x78CB, 0x16ED, 0x78CC, 0x3A2F,
- 0x78CE, 0x3A30, 0x78D0, 0x0D6C, 0x78D1, 0x16EB, 0x78D4, 0x16EE,
- 0x78DA, 0x16F5, 0x78E0, 0x3A32, 0x78E1, 0x3A33, 0x78E4, 0x3A31,
- 0x78E7, 0x16F4, 0x78E8, 0x0E8F, 0x78EC, 0x16F3, 0x78EF, 0x04AF,
- 0x78F2, 0x3A34, 0x78F4, 0x16F7, 0x78F7, 0x3A35, 0x78FB, 0x3A36,
- 0x78FD, 0x16F6, 0x7901, 0x09B4, 0x7907, 0x16F8, 0x790E, 0x0AC5,
- 0x7911, 0x16FA, 0x7912, 0x16F9, 0x7919, 0x16FB, 0x7926, 0x16DD,
- 0x792A, 0x16DF, 0x792B, 0x16FD, 0x792C, 0x16FC, 0x7930, 0x2182,
- 0x7931, 0x3A37, 0x7934, 0x3A38, 0x793A, 0x08D4, 0x793B, 0x3A39,
- 0x793C, 0x0FB1, 0x793D, 0x3A3A, 0x793E, 0x08FE, 0x7940, 0x16FE,
- 0x7941, 0x070D, 0x7945, 0x3A3B, 0x7947, 0x065A, 0x7948, 0x0641,
- 0x7949, 0x08B1, 0x7950, 0x0F1E, 0x7953, 0x1704, 0x7955, 0x1703,
- 0x7956, 0x0AC6, 0x7957, 0x1700, 0x795A, 0x1702, 0x795B, 0x3A3C,
- 0x795C, 0x3A3D, 0x795D, 0x0955, 0x795E, 0x0A06, 0x795F, 0x1701,
- 0x7960, 0x16FF, 0x7962, 0x0CE0, 0x7965, 0x09B5, 0x7968, 0x0DAE,
- 0x796D, 0x0847, 0x7977, 0x0C72, 0x797A, 0x1705, 0x797F, 0x1706,
- 0x7980, 0x171C, 0x7981, 0x06D0, 0x7984, 0x0FE3, 0x7985, 0x0AB7,
- 0x798A, 0x1707, 0x798B, 0x3A3E, 0x798D, 0x0552, 0x798E, 0x0C13,
- 0x798F, 0x0DF1, 0x7994, 0x2186, 0x7996, 0x3A3F, 0x7998, 0x3A40,
- 0x799B, 0x2188, 0x799D, 0x1708, 0x79A6, 0x0694, 0x79A7, 0x1709,
- 0x79AA, 0x170B, 0x79AE, 0x170C, 0x79B0, 0x0CDF, 0x79B1, 0x1E4E,
- 0x79B3, 0x170D, 0x79B8, 0x3A41, 0x79B9, 0x170E, 0x79BA, 0x170F,
- 0x79BB, 0x3A42, 0x79BD, 0x06D1, 0x79BE, 0x0553, 0x79BF, 0x0C9D,
- 0x79C0, 0x0932, 0x79C1, 0x08B2, 0x79C9, 0x1710, 0x79CA, 0x3A43,
- 0x79CB, 0x0933, 0x79D1, 0x054A, 0x79D2, 0x0DB5, 0x79D5, 0x1711,
- 0x79D8, 0x0D7F, 0x79DA, 0x3A44, 0x79DF, 0x0AC7, 0x79E1, 0x1714,
- 0x79E3, 0x1715, 0x79E4, 0x0D1F, 0x79E6, 0x0A07, 0x79E7, 0x1712,
- 0x79E9, 0x0B9F, 0x79EC, 0x1713, 0x79F0, 0x09B6, 0x79FB, 0x04A0,
- 0x7A00, 0x0643, 0x7A03, 0x3A45, 0x7A05, 0x3633, 0x7A08, 0x1716,
- 0x7A09, 0x3A46, 0x7A0B, 0x0C14, 0x7A0D, 0x1717, 0x7A0E, 0x0A6B,
- 0x7A11, 0x3A47, 0x7A14, 0x0EB9, 0x7A17, 0x0D95, 0x7A18, 0x1718,
- 0x7A19, 0x1719, 0x7A1A, 0x0B93, 0x7A1C, 0x0F8F, 0x7A1E, 0x3A48,
- 0x7A1F, 0x171B, 0x7A20, 0x171A, 0x7A2D, 0x3A49, 0x7A2E, 0x091B,
- 0x7A31, 0x171D, 0x7A32, 0x04B4, 0x7A37, 0x1720, 0x7A39, 0x3A4A,
- 0x7A3B, 0x171E, 0x7A3C, 0x0554, 0x7A3D, 0x0724, 0x7A3E, 0x171F,
- 0x7A3F, 0x07D8, 0x7A40, 0x0804, 0x7A42, 0x0E36, 0x7A43, 0x1721,
- 0x7A45, 0x3A4B, 0x7A46, 0x0E82, 0x7A49, 0x1723, 0x7A4C, 0x3A4C,
- 0x7A4D, 0x0A75, 0x7A4E, 0x04F1, 0x7A4F, 0x053A, 0x7A50, 0x0470,
- 0x7A57, 0x1722, 0x7A5D, 0x3A4D, 0x7A60, 0x3A4E, 0x7A61, 0x1724,
- 0x7A62, 0x1725, 0x7A63, 0x09DF, 0x7A69, 0x1726, 0x7A6B, 0x05AD,
- 0x7A6D, 0x3A4F, 0x7A70, 0x1728, 0x7A74, 0x0740, 0x7A76, 0x0680,
- 0x7A78, 0x3A50, 0x7A79, 0x1729, 0x7A7A, 0x06ED, 0x7A7D, 0x172A,
- 0x7A7F, 0x0AA0, 0x7A81, 0x0CA5, 0x7A83, 0x0A84, 0x7A84, 0x0865,
- 0x7A88, 0x172B, 0x7A92, 0x0BA0, 0x7A93, 0x0AED, 0x7A95, 0x172D,
- 0x7A96, 0x172F, 0x7A97, 0x172C, 0x7A98, 0x172E, 0x7A9F, 0x06F8,
- 0x7AA0, 0x3A51, 0x7AA3, 0x3A52, 0x7AA9, 0x1730, 0x7AAA, 0x06FC,
- 0x7AAE, 0x0681, 0x7AAF, 0x0F3C, 0x7AB0, 0x1732, 0x7AB3, 0x3A53,
- 0x7AB6, 0x1733, 0x7ABA, 0x04D0, 0x7ABB, 0x3A54, 0x7ABC, 0x3A55,
- 0x7ABF, 0x1736, 0x7AC3, 0x05D4, 0x7AC4, 0x1735, 0x7AC5, 0x1734,
- 0x7AC6, 0x3A56, 0x7AC7, 0x1738, 0x7AC8, 0x1731, 0x7ACA, 0x1739,
- 0x7ACB, 0x0F71, 0x7ACD, 0x173A, 0x7ACF, 0x173B, 0x7AD1, 0x2189,
- 0x7AD2, 0x11C5, 0x7AD3, 0x173D, 0x7AD5, 0x173C, 0x7AD9, 0x173E,
- 0x7ADA, 0x173F, 0x7ADC, 0x0F7D, 0x7ADD, 0x1740, 0x7ADF, 0x1C08,
- 0x7AE0, 0x09B7, 0x7AE1, 0x1741, 0x7AE2, 0x1742, 0x7AE3, 0x0961,
- 0x7AE5, 0x0C90, 0x7AE6, 0x1743, 0x7AE7, 0x218A, 0x7AEA, 0x0B66,
- 0x7AEB, 0x218C, 0x7AED, 0x1744, 0x7AEF, 0x0B7A, 0x7AF0, 0x1745,
- 0x7AF6, 0x069D, 0x7AF8, 0x1076, 0x7AF9, 0x0B9B, 0x7AFA, 0x08DF,
- 0x7AFF, 0x0604, 0x7B02, 0x1746, 0x7B04, 0x1753, 0x7B06, 0x1749,
- 0x7B07, 0x3A57, 0x7B08, 0x0682, 0x7B0A, 0x1748, 0x7B0B, 0x1755,
- 0x7B0F, 0x1747, 0x7B11, 0x09B8, 0x7B14, 0x3A58, 0x7B18, 0x174B,
- 0x7B19, 0x174C, 0x7B1B, 0x0C25, 0x7B1E, 0x174D, 0x7B20, 0x05BC,
- 0x7B25, 0x0A20, 0x7B26, 0x0DD6, 0x7B27, 0x3A59, 0x7B28, 0x174F,
- 0x7B2C, 0x0B48, 0x7B31, 0x3A5A, 0x7B33, 0x174A, 0x7B35, 0x174E,
- 0x7B36, 0x1750, 0x7B39, 0x086B, 0x7B45, 0x1757, 0x7B46, 0x0DA0,
- 0x7B47, 0x3A5B, 0x7B48, 0x0D3A, 0x7B49, 0x0C73, 0x7B4B, 0x06D2,
- 0x7B4C, 0x1756, 0x7B4D, 0x1754, 0x7B4E, 0x3A5C, 0x7B4F, 0x0D49,
- 0x7B50, 0x1751, 0x7B51, 0x0B9C, 0x7B52, 0x0C75, 0x7B53, 0x375D,
- 0x7B54, 0x0C74, 0x7B56, 0x0866, 0x7B5D, 0x1769, 0x7B60, 0x3A5D,
- 0x7B65, 0x1759, 0x7B67, 0x175B, 0x7B69, 0x3A5E, 0x7B6C, 0x175E,
- 0x7B6D, 0x3A5F, 0x7B6E, 0x175F, 0x7B70, 0x175C, 0x7B71, 0x175D,
- 0x7B72, 0x3A60, 0x7B74, 0x175A, 0x7B75, 0x1758, 0x7B7A, 0x1752,
- 0x7B86, 0x0E1F, 0x7B87, 0x0555, 0x7B8B, 0x1766, 0x7B8D, 0x1763,
- 0x7B8F, 0x1768, 0x7B91, 0x3A61, 0x7B92, 0x1767, 0x7B94, 0x0D29,
- 0x7B95, 0x0EB3, 0x7B97, 0x0889, 0x7B98, 0x1761, 0x7B99, 0x176A,
- 0x7B9A, 0x1765, 0x7B9C, 0x1764, 0x7B9D, 0x1760, 0x7B9E, 0x218D,
- 0x7B9F, 0x1762, 0x7BA1, 0x0605, 0x7BAA, 0x0B7B, 0x7BAD, 0x0AA1,
- 0x7BAF, 0x3A62, 0x7BB1, 0x0D36, 0x7BB4, 0x176F, 0x7BB8, 0x0D38,
- 0x7BC0, 0x0A85, 0x7BC1, 0x176C, 0x7BC4, 0x0D63, 0x7BC6, 0x1770,
- 0x7BC7, 0x0E23, 0x7BC9, 0x0B99, 0x7BCB, 0x176B, 0x7BCC, 0x176D,
- 0x7BCF, 0x176E, 0x7BD7, 0x3A63, 0x7BD9, 0x3A64, 0x7BDD, 0x1771,
- 0x7BE0, 0x08F0, 0x7BE4, 0x0C9E, 0x7BE5, 0x1776, 0x7BE6, 0x1775,
- 0x7BE9, 0x1772, 0x7BED, 0x0FDC, 0x7BF3, 0x177B, 0x7BF6, 0x177F,
- 0x7BF7, 0x177C, 0x7C00, 0x1778, 0x7C07, 0x1779, 0x7C0B, 0x3A65,
- 0x7C0D, 0x177E, 0x7C0F, 0x3A66, 0x7C11, 0x1773, 0x7C12, 0x10EA,
- 0x7C13, 0x177A, 0x7C14, 0x1774, 0x7C17, 0x177D, 0x7C1E, 0x1E3B,
- 0x7C1F, 0x1783, 0x7C20, 0x3A67, 0x7C21, 0x0606, 0x7C23, 0x1780,
- 0x7C26, 0x3A68, 0x7C27, 0x1781, 0x7C2A, 0x1782, 0x7C2B, 0x1785,
- 0x7C31, 0x3A69, 0x7C36, 0x3A6A, 0x7C37, 0x1784, 0x7C38, 0x0D8A,
- 0x7C3D, 0x1786, 0x7C3E, 0x0FC4, 0x7C3F, 0x0E3D, 0x7C40, 0x178B,
- 0x7C43, 0x1788, 0x7C4C, 0x1787, 0x7C4D, 0x0A76, 0x7C4F, 0x178A,
- 0x7C50, 0x178C, 0x7C51, 0x3A6B, 0x7C54, 0x1789, 0x7C56, 0x1790,
- 0x7C58, 0x178D, 0x7C59, 0x3A6C, 0x7C5F, 0x178E, 0x7C60, 0x1777,
- 0x7C64, 0x178F, 0x7C65, 0x1791, 0x7C67, 0x3A6D, 0x7C6C, 0x1792,
- 0x7C6E, 0x3A6E, 0x7C70, 0x3A6F, 0x7C73, 0x0E16, 0x7C75, 0x1793,
- 0x7C7B, 0x370E, 0x7C7E, 0x0EEE, 0x7C81, 0x06C6, 0x7C82, 0x06FF,
- 0x7C83, 0x1794, 0x7C89, 0x0E04, 0x7C8B, 0x0A2E, 0x7C8D, 0x0EBC,
- 0x7C90, 0x1795, 0x7C92, 0x0F7B, 0x7C95, 0x0D2A, 0x7C97, 0x0AC8,
- 0x7C98, 0x0CEA, 0x7C9B, 0x0957, 0x7C9F, 0x0484, 0x7CA1, 0x179A,
- 0x7CA2, 0x1798, 0x7CA4, 0x1796, 0x7CA5, 0x05DD, 0x7CA7, 0x09B9,
- 0x7CA8, 0x179B, 0x7CAB, 0x1799, 0x7CAD, 0x1797, 0x7CAE, 0x179F,
- 0x7CB1, 0x179E, 0x7CB2, 0x179D, 0x7CB3, 0x179C, 0x7CB9, 0x17A0,
- 0x7CBC, 0x3A70, 0x7CBD, 0x17A1, 0x7CBE, 0x0A5E, 0x7CBF, 0x3A71,
- 0x7CC0, 0x17A2, 0x7CC2, 0x17A4, 0x7CC5, 0x17A3, 0x7CC8, 0x3A72,
- 0x7CC9, 0x3A73, 0x7CCA, 0x0786, 0x7CCE, 0x0ABA, 0x7CD2, 0x17A6,
- 0x7CD6, 0x0C76, 0x7CD7, 0x3A74, 0x7CD8, 0x17A5, 0x7CD9, 0x3A75,
- 0x7CDC, 0x17A7, 0x7CDD, 0x3A76, 0x7CDE, 0x0E05, 0x7CDF, 0x0AEE,
- 0x7CE0, 0x07D9, 0x7CE2, 0x17A8, 0x7CE7, 0x0F90, 0x7CEB, 0x3A77,
- 0x7CEF, 0x17AA, 0x7CF2, 0x17AB, 0x7CF4, 0x17AC, 0x7CF6, 0x17AD,
- 0x7CF8, 0x08B3, 0x7CFA, 0x17AE, 0x7CFB, 0x0725, 0x7CFE, 0x0684,
- 0x7D00, 0x0644, 0x7D02, 0x17B0, 0x7D04, 0x0EFF, 0x7D05, 0x07DA,
- 0x7D06, 0x17AF, 0x7D07, 0x3A78, 0x7D08, 0x3A79, 0x7D09, 0x3A7A,
- 0x7D0A, 0x17B3, 0x7D0B, 0x0EF2, 0x7D0D, 0x0CF2, 0x7D10, 0x0DA5,
- 0x7D13, 0x3A7B, 0x7D14, 0x096D, 0x7D15, 0x17B2, 0x7D17, 0x08FF,
- 0x7D18, 0x07DB, 0x7D19, 0x08B4, 0x7D1A, 0x0683, 0x7D1B, 0x0E06,
- 0x7D1C, 0x17B1, 0x7D1D, 0x3A7C, 0x7D20, 0x0AC9, 0x7D21, 0x0E70,
- 0x7D22, 0x0867, 0x7D23, 0x3A7D, 0x7D2B, 0x08B5, 0x7D2C, 0x0BF9,
- 0x7D2E, 0x17B6, 0x7D2F, 0x0FA7, 0x7D30, 0x0849, 0x7D32, 0x17B7,
- 0x7D33, 0x0A08, 0x7D35, 0x17B9, 0x7D39, 0x09BA, 0x7D3A, 0x0820,
- 0x7D3F, 0x17B8, 0x7D41, 0x3A7E, 0x7D42, 0x0934, 0x7D43, 0x0772,
- 0x7D44, 0x0ACA, 0x7D45, 0x17B4, 0x7D46, 0x17BA, 0x7D48, 0x218F,
- 0x7D4B, 0x17B5, 0x7D4C, 0x0726, 0x7D4E, 0x17BD, 0x7D4F, 0x17C1,
- 0x7D50, 0x0741, 0x7D53, 0x3A7F, 0x7D56, 0x17BC, 0x7D59, 0x3A80,
- 0x7D5B, 0x17C5, 0x7D5C, 0x2190, 0x7D5D, 0x3A81, 0x7D5E, 0x07DC,
- 0x7D61, 0x0F57, 0x7D62, 0x0480, 0x7D63, 0x17C2, 0x7D66, 0x0685,
- 0x7D68, 0x17BF, 0x7D6E, 0x17C0, 0x7D71, 0x0C77, 0x7D72, 0x17BE,
- 0x7D73, 0x17BB, 0x7D75, 0x0586, 0x7D76, 0x0A88, 0x7D79, 0x075C,
- 0x7D7A, 0x3A82, 0x7D7D, 0x17C7, 0x7D86, 0x3A83, 0x7D89, 0x17C4,
- 0x7D8B, 0x3A84, 0x7D8C, 0x3A85, 0x7D8F, 0x17C6, 0x7D93, 0x17C3,
- 0x7D99, 0x0727, 0x7D9A, 0x0B13, 0x7D9B, 0x17C8, 0x7D9C, 0x0AF0,
- 0x7D9F, 0x17D5, 0x7DA0, 0x2192, 0x7DA2, 0x17D1, 0x7DA3, 0x17CB,
- 0x7DAB, 0x17CF, 0x7DAC, 0x0926, 0x7DAD, 0x04A1, 0x7DAE, 0x17CA,
- 0x7DAF, 0x17D2, 0x7DB0, 0x17D6, 0x7DB1, 0x07DD, 0x7DB2, 0x0EE2,
- 0x7DB4, 0x0BF2, 0x7DB5, 0x17CC, 0x7DB7, 0x2191, 0x7DB8, 0x17D4,
- 0x7DBA, 0x17C9, 0x7DBB, 0x0B7C, 0x7DBD, 0x17CE, 0x7DBE, 0x0481,
- 0x7DBF, 0x0ED6, 0x7DC7, 0x17CD, 0x7DCA, 0x06D3, 0x7DCB, 0x0D80,
- 0x7DCC, 0x3A86, 0x7DCF, 0x0AEF, 0x7DD1, 0x0F98, 0x7DD2, 0x0979,
- 0x7DD5, 0x17FD, 0x7DD6, 0x2193, 0x7DD8, 0x17D7, 0x7DDA, 0x0AA2,
- 0x7DDC, 0x17D3, 0x7DDD, 0x17D8, 0x7DDE, 0x17DA, 0x7DE0, 0x0C15,
- 0x7DE1, 0x17DD, 0x7DE3, 0x340A, 0x7DE4, 0x17D9, 0x7DE8, 0x0E24,
- 0x7DE9, 0x0607, 0x7DEB, 0x3A87, 0x7DEC, 0x0ED7, 0x7DEF, 0x04A2,
- 0x7DF1, 0x3A88, 0x7DF2, 0x17DC, 0x7DF4, 0x0FC5, 0x7DF9, 0x3A89,
- 0x7DFB, 0x17DB, 0x7E01, 0x0511, 0x7E04, 0x0CC4, 0x7E05, 0x17DE,
- 0x7E08, 0x3A8A, 0x7E09, 0x17E5, 0x7E0A, 0x17DF, 0x7E0B, 0x17E6,
- 0x7E11, 0x3A8B, 0x7E12, 0x17E2, 0x7E15, 0x3A8C, 0x7E1B, 0x0D31,
- 0x7E1E, 0x08F6, 0x7E1F, 0x17E4, 0x7E20, 0x3A8D, 0x7E21, 0x17E1,
- 0x7E22, 0x17E7, 0x7E23, 0x17E0, 0x7E26, 0x094E, 0x7E2B, 0x0E53,
- 0x7E2E, 0x0956, 0x7E31, 0x17E3, 0x7E32, 0x17EF, 0x7E35, 0x17EB,
- 0x7E37, 0x17EE, 0x7E39, 0x17EC, 0x7E3A, 0x17F0, 0x7E3B, 0x17EA,
- 0x7E3D, 0x17D0, 0x7E3E, 0x0A77, 0x7E41, 0x0D5F, 0x7E43, 0x17ED,
- 0x7E46, 0x17E8, 0x7E47, 0x3A8E, 0x7E48, 0x3767, 0x7E4A, 0x0AA3,
- 0x7E4B, 0x0728, 0x7E4D, 0x0935, 0x7E52, 0x2194, 0x7E54, 0x09EB,
- 0x7E55, 0x0AB8, 0x7E56, 0x17F3, 0x7E59, 0x17F5, 0x7E5A, 0x17F6,
- 0x7E5D, 0x17F2, 0x7E5E, 0x17F4, 0x7E61, 0x1E11, 0x7E62, 0x3A8F,
- 0x7E66, 0x17E9, 0x7E67, 0x17F1, 0x7E69, 0x17F9, 0x7E6A, 0x17F8,
- 0x7E6B, 0x1DF7, 0x7E6D, 0x0EA8, 0x7E6E, 0x3A90, 0x7E70, 0x0701,
- 0x7E73, 0x3A91, 0x7E79, 0x17F7, 0x7E7B, 0x17FB, 0x7E7C, 0x17FA,
- 0x7E7D, 0x17FE, 0x7E7F, 0x1800, 0x7E82, 0x088A, 0x7E83, 0x17FC,
- 0x7E88, 0x1801, 0x7E89, 0x1802, 0x7E8A, 0x20A7, 0x7E8C, 0x1803,
- 0x7E8D, 0x3A92, 0x7E8E, 0x1809, 0x7E8F, 0x0C35, 0x7E90, 0x1805,
- 0x7E91, 0x3A93, 0x7E92, 0x1804, 0x7E93, 0x1806, 0x7E94, 0x1807,
- 0x7E96, 0x1808, 0x7E98, 0x3A94, 0x7E9B, 0x180A, 0x7E9C, 0x180B,
- 0x7F36, 0x0608, 0x7F38, 0x180C, 0x7F3A, 0x180D, 0x7F44, 0x3A95,
- 0x7F45, 0x180E, 0x7F47, 0x2195, 0x7F4C, 0x180F, 0x7F4D, 0x1810,
- 0x7F4E, 0x1811, 0x7F4F, 0x3A96, 0x7F50, 0x1812, 0x7F51, 0x1813,
- 0x7F52, 0x3A97, 0x7F53, 0x3A98, 0x7F54, 0x1815, 0x7F55, 0x1814,
- 0x7F58, 0x1816, 0x7F5F, 0x1817, 0x7F60, 0x1818, 0x7F61, 0x3A99,
- 0x7F67, 0x181B, 0x7F68, 0x1819, 0x7F69, 0x181A, 0x7F6A, 0x0851,
- 0x7F6B, 0x0729, 0x7F6E, 0x0B94, 0x7F70, 0x0D47, 0x7F72, 0x097A,
- 0x7F75, 0x0D03, 0x7F77, 0x0D81, 0x7F78, 0x181C, 0x7F79, 0x1336,
- 0x7F82, 0x181D, 0x7F83, 0x181F, 0x7F85, 0x0F4F, 0x7F86, 0x181E,
- 0x7F87, 0x1821, 0x7F88, 0x1820, 0x7F8A, 0x0F3D, 0x7F8C, 0x1822,
- 0x7F8E, 0x0D92, 0x7F91, 0x3A9A, 0x7F94, 0x1823, 0x7F9A, 0x1826,
- 0x7F9D, 0x1825, 0x7F9E, 0x1824, 0x7FA1, 0x2196, 0x7FA3, 0x1827,
- 0x7FA4, 0x0708, 0x7FA8, 0x0AA4, 0x7FA9, 0x065B, 0x7FAE, 0x182B,
- 0x7FAF, 0x1828, 0x7FB2, 0x1829, 0x7FB6, 0x182C, 0x7FB8, 0x182D,
- 0x7FB9, 0x182A, 0x7FBD, 0x04CB, 0x7FBF, 0x3A9B, 0x7FC1, 0x0527,
- 0x7FC5, 0x182F, 0x7FC6, 0x1830, 0x7FCA, 0x1831, 0x7FCC, 0x0F4C,
- 0x7FCE, 0x3A9C, 0x7FD2, 0x0936, 0x7FD4, 0x1833, 0x7FD5, 0x1832,
- 0x7FDF, 0x3A9D, 0x7FE0, 0x0A2F, 0x7FE1, 0x1834, 0x7FE5, 0x3A9E,
- 0x7FE6, 0x1835, 0x7FE9, 0x1836, 0x7FEB, 0x0621, 0x7FEC, 0x3A9F,
- 0x7FEE, 0x3AA0, 0x7FEF, 0x3AA1, 0x7FF0, 0x0609, 0x7FF3, 0x1837,
- 0x7FF9, 0x1838, 0x7FFA, 0x3AA2, 0x7FFB, 0x0E8B, 0x7FFC, 0x0F4D,
- 0x8000, 0x0F3E, 0x8001, 0x0FDD, 0x8002, 0x3713, 0x8003, 0x07DF,
- 0x8004, 0x183B, 0x8005, 0x0900, 0x8006, 0x183A, 0x800B, 0x183C,
- 0x800C, 0x08D5, 0x800E, 0x3AA3, 0x8010, 0x0B31, 0x8011, 0x3AA4,
- 0x8012, 0x183D, 0x8014, 0x3AA5, 0x8015, 0x07DE, 0x8017, 0x0EE3,
- 0x8018, 0x183E, 0x8019, 0x183F, 0x801C, 0x1840, 0x8021, 0x1841,
- 0x8024, 0x3AA6, 0x8026, 0x3AA7, 0x8028, 0x1842, 0x8033, 0x08D6,
- 0x8036, 0x0EF9, 0x803A, 0x3AA8, 0x803B, 0x1844, 0x803C, 0x3AA9,
- 0x803D, 0x0B7D, 0x803F, 0x1843, 0x8046, 0x1846, 0x804A, 0x1845,
- 0x8052, 0x1847, 0x8056, 0x0A5F, 0x8058, 0x1848, 0x805A, 0x1849,
- 0x805E, 0x0E09, 0x805F, 0x184A, 0x8060, 0x3AAA, 0x8061, 0x0AF1,
- 0x8062, 0x184B, 0x8068, 0x184C, 0x806F, 0x0FC6, 0x8070, 0x184F,
- 0x8071, 0x3AAB, 0x8072, 0x184E, 0x8073, 0x184D, 0x8074, 0x0BCC,
- 0x8075, 0x3AAC, 0x8076, 0x1850, 0x8077, 0x09EC, 0x8079, 0x1851,
- 0x807D, 0x1852, 0x807E, 0x0FDE, 0x807F, 0x1853, 0x8084, 0x1854,
- 0x8085, 0x1856, 0x8086, 0x1855, 0x8087, 0x0D39, 0x8089, 0x0CD1,
- 0x808B, 0x0FE4, 0x808C, 0x0D3D, 0x8093, 0x1858, 0x8096, 0x09BB,
- 0x8098, 0x0D9C, 0x809A, 0x1859, 0x809B, 0x1857, 0x809D, 0x060A,
- 0x809E, 0x3AAD, 0x80A1, 0x0788, 0x80A2, 0x08B6, 0x80A5, 0x0D82,
- 0x80A6, 0x3AAE, 0x80A9, 0x075E, 0x80AA, 0x0E71, 0x80AB, 0x3AAF,
- 0x80AC, 0x185C, 0x80AD, 0x185A, 0x80AF, 0x07E0, 0x80B1, 0x07E1,
- 0x80B2, 0x04AD, 0x80B4, 0x0858, 0x80BA, 0x0D0F, 0x80C3, 0x04A3,
- 0x80C4, 0x1861, 0x80C6, 0x0B7E, 0x80CC, 0x0D0E, 0x80CE, 0x0B3B,
- 0x80D6, 0x1863, 0x80D7, 0x3AB0, 0x80D8, 0x3AB1, 0x80D9, 0x185F,
- 0x80DA, 0x1862, 0x80DB, 0x185D, 0x80DD, 0x1860, 0x80DE, 0x0E54,
- 0x80E1, 0x0789, 0x80E4, 0x04C1, 0x80E5, 0x185E, 0x80EF, 0x1865,
- 0x80F1, 0x1866, 0x80F4, 0x0C91, 0x80F8, 0x06B3, 0x80FC, 0x1871,
- 0x80FD, 0x0CF3, 0x8102, 0x08B7, 0x8105, 0x06B4, 0x8106, 0x0A6C,
- 0x8107, 0x0FEC, 0x8108, 0x0EBA, 0x8109, 0x1864, 0x810A, 0x0A78,
- 0x8116, 0x3AB2, 0x8118, 0x3AB3, 0x811A, 0x066D, 0x811B, 0x1867,
- 0x8123, 0x1869, 0x8129, 0x1868, 0x812B, 0x3659, 0x812F, 0x186A,
- 0x8131, 0x0B64, 0x8133, 0x0CF4, 0x8139, 0x0BCD, 0x813A, 0x3AB4,
- 0x813E, 0x186E, 0x8141, 0x3772, 0x8146, 0x186D, 0x814A, 0x3AB5,
- 0x814B, 0x186B, 0x814C, 0x3AB6, 0x814E, 0x0A1B, 0x8150, 0x0DD7,
- 0x8151, 0x1870, 0x8153, 0x186F, 0x8154, 0x07E2, 0x8155, 0x0FF9,
- 0x815F, 0x1880, 0x8165, 0x1874, 0x8166, 0x1875, 0x816B, 0x091C,
- 0x816E, 0x1873, 0x8170, 0x080A, 0x8171, 0x1872, 0x8174, 0x1876,
- 0x8178, 0x0BCE, 0x8179, 0x0DF2, 0x817A, 0x0AA5, 0x817F, 0x0B3C,
- 0x8180, 0x187A, 0x8181, 0x3AB7, 0x8182, 0x187B, 0x8183, 0x1877,
- 0x8184, 0x3AB8, 0x8188, 0x1878, 0x818A, 0x1879, 0x818F, 0x07E3,
- 0x8193, 0x1881, 0x8195, 0x187D, 0x819A, 0x0DD8, 0x819C, 0x0E9A,
- 0x819D, 0x0D9A, 0x81A0, 0x187C, 0x81A3, 0x187F, 0x81A4, 0x187E,
- 0x81A8, 0x0E72, 0x81A9, 0x1882, 0x81B0, 0x1883, 0x81B3, 0x0AB9,
- 0x81B4, 0x3AB9, 0x81B5, 0x1884, 0x81B8, 0x1886, 0x81BA, 0x188A,
- 0x81BD, 0x1887, 0x81BE, 0x1885, 0x81BF, 0x0CF5, 0x81C0, 0x1888,
- 0x81C2, 0x1889, 0x81C6, 0x0532, 0x81C8, 0x1890, 0x81C9, 0x188B,
- 0x81CD, 0x188C, 0x81CF, 0x3ABA, 0x81D1, 0x188D, 0x81D3, 0x0B01,
- 0x81D8, 0x188F, 0x81D9, 0x188E, 0x81DA, 0x1891, 0x81DF, 0x1892,
- 0x81E0, 0x1893, 0x81E3, 0x0A09, 0x81E5, 0x0569, 0x81E7, 0x1894,
- 0x81E8, 0x0F9F, 0x81EA, 0x08D7, 0x81ED, 0x0937, 0x81F3, 0x08B8,
- 0x81F4, 0x0B95, 0x81F9, 0x3ABB, 0x81FA, 0x1895, 0x81FB, 0x1896,
- 0x81FC, 0x04D3, 0x81FE, 0x1897, 0x8201, 0x1898, 0x8202, 0x1899,
- 0x8203, 0x3ABC, 0x8205, 0x189A, 0x8207, 0x189B, 0x8208, 0x06B5,
- 0x8209, 0x13AF, 0x820A, 0x189C, 0x820C, 0x0A89, 0x820D, 0x189D,
- 0x820E, 0x08F7, 0x8210, 0x189E, 0x8212, 0x1009, 0x8216, 0x189F,
- 0x8217, 0x0E2E, 0x8218, 0x0618, 0x821B, 0x0AA6, 0x821C, 0x0962,
- 0x821E, 0x0DE3, 0x821F, 0x0938, 0x8221, 0x3ABD, 0x8229, 0x18A0,
- 0x822A, 0x07E4, 0x822B, 0x18A1, 0x822C, 0x0D60, 0x822E, 0x18AF,
- 0x8232, 0x3ABE, 0x8233, 0x18A3, 0x8234, 0x3ABF, 0x8235, 0x0B29,
- 0x8236, 0x0D2B, 0x8237, 0x0773, 0x8238, 0x18A2, 0x8239, 0x0AA7,
- 0x8240, 0x18A4, 0x8246, 0x3AC0, 0x8247, 0x0C16, 0x824B, 0x3AC1,
- 0x824F, 0x3AC2, 0x8258, 0x18A6, 0x8259, 0x18A5, 0x825A, 0x18A8,
- 0x825D, 0x18A7, 0x825F, 0x18A9, 0x8262, 0x18AB, 0x8264, 0x18AA,
- 0x8266, 0x060B, 0x8268, 0x18AC, 0x826A, 0x18AD, 0x826B, 0x18AE,
- 0x826E, 0x0821, 0x826F, 0x0F91, 0x8271, 0x18B0, 0x8272, 0x09ED,
- 0x8276, 0x0512, 0x8277, 0x18B1, 0x8278, 0x18B2, 0x8279, 0x3775,
- 0x827E, 0x18B3, 0x828B, 0x04B6, 0x828D, 0x18B4, 0x828E, 0x3AC3,
- 0x8292, 0x18B5, 0x8299, 0x0DD9, 0x829D, 0x08F3, 0x829F, 0x18B7,
- 0x82A5, 0x0587, 0x82A6, 0x0476, 0x82AB, 0x18B6, 0x82AC, 0x18B9,
- 0x82AD, 0x0D04, 0x82AE, 0x3AC4, 0x82AF, 0x0A0A, 0x82B1, 0x0556,
- 0x82B3, 0x0E55, 0x82B7, 0x3AC5, 0x82B8, 0x0733, 0x82B9, 0x06D4,
- 0x82BB, 0x18B8, 0x82BD, 0x056A, 0x82BE, 0x3AC6, 0x82C5, 0x05DF,
- 0x82C6, 0x3AC7, 0x82D1, 0x0513, 0x82D2, 0x18BD, 0x82D3, 0x0FB2,
- 0x82D4, 0x0B3D, 0x82D7, 0x0DB6, 0x82D9, 0x18C9, 0x82DB, 0x0557,
- 0x82DC, 0x18C7, 0x82DE, 0x18C5, 0x82DF, 0x18BC, 0x82E1, 0x18BA,
- 0x82E3, 0x18BB, 0x82E5, 0x090F, 0x82E6, 0x06E4, 0x82E7, 0x0BB5,
- 0x82EB, 0x0CA9, 0x82F1, 0x04F3, 0x82F3, 0x18BF, 0x82F4, 0x18BE,
- 0x82F9, 0x18C4, 0x82FA, 0x18C0, 0x82FB, 0x18C3, 0x82FE, 0x3AC8,
- 0x8301, 0x2198, 0x8302, 0x0EDC, 0x8303, 0x18C2, 0x8304, 0x0558,
- 0x8305, 0x05DB, 0x8306, 0x18C6, 0x8309, 0x18C8, 0x830E, 0x072A,
- 0x8316, 0x18CC, 0x8317, 0x18D5, 0x8318, 0x18D6, 0x831C, 0x046F,
- 0x8323, 0x18DD, 0x8328, 0x04B5, 0x832B, 0x18D4, 0x832F, 0x18D3,
- 0x8331, 0x18CE, 0x8332, 0x18CD, 0x8334, 0x18CB, 0x8335, 0x18CA,
- 0x8336, 0x0BA1, 0x8338, 0x0B5B, 0x8339, 0x18D0, 0x8340, 0x18CF,
- 0x8343, 0x3AC9, 0x8345, 0x18D2, 0x8349, 0x0AF2, 0x834A, 0x072B,
- 0x834F, 0x04E3, 0x8350, 0x18D1, 0x8351, 0x3ACA, 0x8352, 0x07E5,
- 0x8355, 0x3ACB, 0x8358, 0x0AF3, 0x8362, 0x2199, 0x8373, 0x18E3,
- 0x8375, 0x18E4, 0x8377, 0x0559, 0x837B, 0x052E, 0x837C, 0x18E1,
- 0x837F, 0x219A, 0x8385, 0x18D7, 0x8386, 0x3ACC, 0x8387, 0x18DF,
- 0x8389, 0x18E6, 0x838A, 0x18E0, 0x838D, 0x3ACD, 0x838E, 0x18DE,
- 0x8392, 0x3ACE, 0x8393, 0x18C1, 0x8396, 0x18DC, 0x8398, 0x3ACF,
- 0x839A, 0x18D8, 0x839E, 0x060C, 0x839F, 0x18DA, 0x83A0, 0x18E5,
- 0x83A2, 0x18DB, 0x83A8, 0x18E7, 0x83A9, 0x3AD0, 0x83AA, 0x18D9,
- 0x83AB, 0x0D32, 0x83B1, 0x0F53, 0x83B5, 0x18E2, 0x83BD, 0x18F8,
- 0x83BF, 0x3AD1, 0x83C0, 0x3AD2, 0x83C1, 0x18F0, 0x83C5, 0x0A41,
- 0x83C7, 0x219B, 0x83CA, 0x0660, 0x83CC, 0x06D5, 0x83CE, 0x18EB,
- 0x83D3, 0x055B, 0x83D6, 0x09BC, 0x83D8, 0x18EE, 0x83DC, 0x084A,
- 0x83DF, 0x0C4B, 0x83E0, 0x18F3, 0x83E9, 0x0E3E, 0x83EA, 0x3AD3,
- 0x83EB, 0x18EA, 0x83EF, 0x055A, 0x83F0, 0x078A, 0x83F1, 0x0D9B,
- 0x83F2, 0x18F4, 0x83F4, 0x18E8, 0x83F6, 0x219C, 0x83F7, 0x18F1,
- 0x83FB, 0x18FB, 0x83FD, 0x18EC, 0x8403, 0x18ED, 0x8404, 0x0C92,
- 0x8407, 0x18F2, 0x840A, 0x1E7F, 0x840B, 0x18EF, 0x840C, 0x0E56,
- 0x840D, 0x18F5, 0x840E, 0x04A4, 0x840F, 0x3AD4, 0x8411, 0x3AD5,
- 0x8413, 0x18E9, 0x8420, 0x18F7, 0x8422, 0x18F6, 0x8429, 0x0D21,
- 0x842A, 0x18FD, 0x842C, 0x1908, 0x8431, 0x05DC, 0x8435, 0x190B,
- 0x8438, 0x18F9, 0x843C, 0x18FE, 0x843D, 0x0F58, 0x8446, 0x1907,
- 0x8448, 0x219D, 0x8449, 0x0F3F, 0x844A, 0x3AD6, 0x844E, 0x0F72,
- 0x8457, 0x0BB6, 0x845B, 0x05C9, 0x8461, 0x0DE4, 0x8462, 0x190D,
- 0x8463, 0x0C79, 0x8466, 0x0475, 0x8469, 0x1906, 0x846B, 0x1902,
- 0x846C, 0x0AF4, 0x846D, 0x18FC, 0x846E, 0x1904, 0x846F, 0x1909,
- 0x8471, 0x0CE2, 0x8475, 0x046E, 0x8476, 0x3AD7, 0x8477, 0x1901,
- 0x8479, 0x190A, 0x847A, 0x0DEA, 0x8482, 0x1905, 0x8484, 0x1900,
- 0x848B, 0x09BD, 0x8490, 0x0939, 0x8494, 0x08D8, 0x8499, 0x0EE4,
- 0x849C, 0x0DB9, 0x849F, 0x1910, 0x84A1, 0x1919, 0x84A8, 0x3AD8,
- 0x84AD, 0x1903, 0x84AF, 0x3AD9, 0x84B2, 0x05D5, 0x84B4, 0x219E,
- 0x84B8, 0x09E0, 0x84B9, 0x190E, 0x84BB, 0x1913, 0x84BC, 0x0AF5,
- 0x84BF, 0x190F, 0x84C0, 0x3ADA, 0x84C1, 0x1916, 0x84C2, 0x3ADB,
- 0x84C4, 0x0B9D, 0x84C6, 0x1917, 0x84C9, 0x0F40, 0x84CA, 0x190C,
- 0x84CB, 0x0596, 0x84CD, 0x1912, 0x84D0, 0x1915, 0x84D1, 0x0EB8,
- 0x84D6, 0x1918, 0x84D9, 0x1911, 0x84DA, 0x1914, 0x84DC, 0x20AB,
- 0x84EC, 0x0E57, 0x84EE, 0x0FC7, 0x84F0, 0x3ADC, 0x84F4, 0x191C,
- 0x84FC, 0x1923, 0x84FD, 0x3ADD, 0x84FF, 0x191B, 0x8500, 0x08EF,
- 0x8506, 0x18FA, 0x850C, 0x3ADE, 0x8511, 0x0E1E, 0x8513, 0x0EAE,
- 0x8514, 0x1922, 0x8515, 0x1921, 0x8517, 0x191D, 0x8518, 0x191E,
- 0x851A, 0x04D8, 0x851F, 0x1920, 0x8521, 0x191A, 0x8523, 0x1E1A,
- 0x8526, 0x0BF1, 0x852C, 0x191F, 0x852D, 0x04C2, 0x8534, 0x3ADF,
- 0x8535, 0x0B02, 0x853D, 0x0E13, 0x853E, 0x1EB5, 0x8540, 0x1924,
- 0x8541, 0x1928, 0x8543, 0x0D6D, 0x8548, 0x1927, 0x8549, 0x09BE,
- 0x854A, 0x08F5, 0x854B, 0x192A, 0x854E, 0x06B6, 0x8553, 0x219F,
- 0x8555, 0x192B, 0x8557, 0x0DEB, 0x8558, 0x1926, 0x8559, 0x21A0,
- 0x855A, 0x18FF, 0x855E, 0x3AE0, 0x8563, 0x1925, 0x8568, 0x0FF5,
- 0x8569, 0x0C7A, 0x856A, 0x0DE5, 0x856B, 0x21A1, 0x856D, 0x1932,
- 0x8577, 0x1938, 0x857E, 0x1939, 0x8580, 0x192C, 0x8584, 0x0D2C,
- 0x8587, 0x1936, 0x8588, 0x192E, 0x858A, 0x1930, 0x858F, 0x3AE1,
- 0x8590, 0x193A, 0x8591, 0x192F, 0x8594, 0x1933, 0x8597, 0x0514,
- 0x8599, 0x0CBD, 0x859B, 0x1934, 0x859C, 0x1937, 0x85A4, 0x192D,
- 0x85A6, 0x0AA8, 0x85A8, 0x1931, 0x85A9, 0x0875, 0x85AA, 0x0A0B,
- 0x85AB, 0x0706, 0x85AC, 0x0F00, 0x85AD, 0x3AE4, 0x85AE, 0x0F05,
- 0x85AF, 0x097C, 0x85B0, 0x21A3, 0x85B7, 0x3AE2, 0x85B9, 0x193E,
- 0x85BA, 0x193C, 0x85C1, 0x0FF4, 0x85C9, 0x193B, 0x85CD, 0x0F5F,
- 0x85CE, 0x3AE3, 0x85CF, 0x193D, 0x85D0, 0x193F, 0x85D5, 0x1940,
- 0x85DC, 0x1943, 0x85DD, 0x1941, 0x85E4, 0x0C7B, 0x85E5, 0x1942,
- 0x85E9, 0x0D61, 0x85EA, 0x1935, 0x85F4, 0x3780, 0x85F7, 0x097D,
- 0x85F9, 0x1944, 0x85FA, 0x1949, 0x85FB, 0x0AF6, 0x85FE, 0x1948,
- 0x8602, 0x1929, 0x8606, 0x194A, 0x8607, 0x0ACB, 0x860A, 0x1945,
- 0x860B, 0x1947, 0x8612, 0x3AE5, 0x8613, 0x1946, 0x8616, 0x14D0,
- 0x8617, 0x14C1, 0x861A, 0x194C, 0x8622, 0x194B, 0x8629, 0x3AE6,
- 0x862D, 0x0F60, 0x862F, 0x16B1, 0x8630, 0x194D, 0x863F, 0x194E,
- 0x864D, 0x194F, 0x864E, 0x078B, 0x8650, 0x066E, 0x8652, 0x3AE7,
- 0x8654, 0x1951, 0x8655, 0x1094, 0x865A, 0x068F, 0x865B, 0x3418,
- 0x865C, 0x0F82, 0x865E, 0x06EB, 0x865F, 0x1952, 0x8663, 0x3AE8,
- 0x8667, 0x1953, 0x866B, 0x0BAC, 0x866C, 0x3AE9, 0x866F, 0x3AEA,
- 0x8671, 0x1954, 0x8679, 0x0CD2, 0x867A, 0x3AEB, 0x867B, 0x047E,
- 0x867D, 0x3786, 0x868A, 0x0563, 0x868B, 0x1959, 0x868C, 0x195A,
- 0x868D, 0x3AEC, 0x8691, 0x3AED, 0x8693, 0x1955, 0x8695, 0x088B,
- 0x8698, 0x3AEE, 0x86A3, 0x1956, 0x86A4, 0x0CF8, 0x86A7, 0x3AEF,
- 0x86A8, 0x3AF0, 0x86A9, 0x1957, 0x86AA, 0x1958, 0x86AB, 0x1962,
- 0x86AF, 0x195C, 0x86B0, 0x195F, 0x86B6, 0x195B, 0x86C4, 0x195D,
- 0x86C6, 0x195E, 0x86C7, 0x0904, 0x86C9, 0x1960, 0x86CB, 0x0B7F,
- 0x86CD, 0x072C, 0x86CE, 0x05A0, 0x86D4, 0x1963, 0x86D9, 0x059D,
- 0x86DB, 0x1968, 0x86DE, 0x1964, 0x86DF, 0x1967, 0x86E4, 0x0D4E,
- 0x86E9, 0x1965, 0x86EC, 0x1966, 0x86ED, 0x0DBA, 0x86EE, 0x0D6E,
- 0x86EF, 0x1969, 0x86F8, 0x0B5D, 0x86F9, 0x1973, 0x86FA, 0x3AF1,
- 0x86FB, 0x196F, 0x86FD, 0x3AF2, 0x86FE, 0x056B, 0x8700, 0x196D,
- 0x8702, 0x0E58, 0x8703, 0x196E, 0x8706, 0x196B, 0x8708, 0x196C,
- 0x8709, 0x1971, 0x870A, 0x1974, 0x870B, 0x3AF3, 0x870D, 0x1972,
- 0x8711, 0x1970, 0x8712, 0x196A, 0x8713, 0x3AF4, 0x8718, 0x0B96,
- 0x8719, 0x3AF5, 0x871A, 0x197B, 0x871C, 0x0EB6, 0x871E, 0x3AF6,
- 0x8725, 0x1979, 0x8728, 0x3AF7, 0x8729, 0x197A, 0x8734, 0x1975,
- 0x8737, 0x1977, 0x873B, 0x1978, 0x873E, 0x3AF8, 0x873F, 0x1976,
- 0x8749, 0x0A8A, 0x874B, 0x0FDF, 0x874C, 0x197F, 0x874E, 0x1980,
- 0x8753, 0x1986, 0x8755, 0x09F0, 0x8757, 0x1982, 0x8759, 0x1985,
- 0x875F, 0x197D, 0x8760, 0x197C, 0x8763, 0x1987, 0x8766, 0x055C,
- 0x8768, 0x1983, 0x876A, 0x1988, 0x876E, 0x1984, 0x8771, 0x3AF9,
- 0x8774, 0x1981, 0x8776, 0x0BCF, 0x8778, 0x197E, 0x877F, 0x0D1E,
- 0x8782, 0x198C, 0x8788, 0x3AFA, 0x878D, 0x0F25, 0x8799, 0x3AFB,
- 0x879F, 0x198B, 0x87A2, 0x198A, 0x87AB, 0x1993, 0x87AC, 0x3AFC,
- 0x87AD, 0x3AFD, 0x87AF, 0x198D, 0x87B3, 0x1995, 0x87B5, 0x3AFE,
- 0x87BA, 0x0F50, 0x87BB, 0x1998, 0x87BD, 0x198F, 0x87C0, 0x1990,
- 0x87C4, 0x1994, 0x87C6, 0x1997, 0x87C7, 0x1996, 0x87CB, 0x198E,
- 0x87D0, 0x1991, 0x87D2, 0x19A2, 0x87D6, 0x3AFF, 0x87E0, 0x199B,
- 0x87EB, 0x3B00, 0x87EC, 0x1E23, 0x87ED, 0x3B01, 0x87EF, 0x1999,
- 0x87F2, 0x199A, 0x87F5, 0x3C3D, 0x87F6, 0x199F, 0x87F7, 0x19A0,
- 0x87F9, 0x0588, 0x87FB, 0x065C, 0x87FE, 0x199E, 0x8801, 0x3B02,
- 0x8803, 0x3B03, 0x8805, 0x1989, 0x8806, 0x3B04, 0x8807, 0x21A6,
- 0x880B, 0x3B05, 0x880D, 0x199D, 0x880E, 0x19A1, 0x880F, 0x199C,
- 0x8811, 0x19A3, 0x8814, 0x3B06, 0x8815, 0x19A5, 0x8816, 0x19A4,
- 0x881C, 0x3B07, 0x881F, 0x1E85, 0x8821, 0x19A7, 0x8822, 0x19A6,
- 0x8823, 0x1961, 0x8827, 0x19AB, 0x8831, 0x19A8, 0x8836, 0x19A9,
- 0x8839, 0x19AA, 0x883B, 0x19AC, 0x8840, 0x0742, 0x8842, 0x19AE,
- 0x8844, 0x19AD, 0x8846, 0x093A, 0x884C, 0x07E6, 0x884D, 0x1524,
- 0x8852, 0x19AF, 0x8853, 0x095B, 0x8856, 0x3B08, 0x8857, 0x0597,
- 0x8859, 0x19B0, 0x885B, 0x04F4, 0x885D, 0x09BF, 0x885E, 0x19B1,
- 0x885F, 0x3B09, 0x8861, 0x07E7, 0x8862, 0x19B2, 0x8863, 0x04A5,
- 0x8864, 0x3B0A, 0x8868, 0x0DAF, 0x886B, 0x19B3, 0x8870, 0x0A30,
- 0x8872, 0x19BA, 0x8875, 0x19B7, 0x8877, 0x0BAD, 0x887D, 0x19B8,
- 0x887E, 0x19B5, 0x887F, 0x06D6, 0x8881, 0x19B4, 0x8882, 0x19BB,
- 0x8888, 0x070C, 0x888B, 0x0B3E, 0x888D, 0x19C1, 0x8892, 0x19BD,
- 0x8896, 0x0B15, 0x8897, 0x19BC, 0x8898, 0x3B0B, 0x8899, 0x19BF,
- 0x889E, 0x19B6, 0x88A2, 0x19C0, 0x88A4, 0x19C2, 0x88AA, 0x3B0C,
- 0x88AB, 0x0D83, 0x88AE, 0x19BE, 0x88B0, 0x19C3, 0x88B1, 0x19C5,
- 0x88B4, 0x0787, 0x88B5, 0x19B9, 0x88B7, 0x0485, 0x88BD, 0x3B0D,
- 0x88BE, 0x3B0E, 0x88BF, 0x19C4, 0x88C1, 0x084B, 0x88C2, 0x0FBE,
- 0x88C3, 0x19C6, 0x88C4, 0x19C7, 0x88C5, 0x0AF7, 0x88C6, 0x3789,
- 0x88CA, 0x3B0F, 0x88CF, 0x0F6A, 0x88D2, 0x3B10, 0x88D4, 0x19C8,
- 0x88D5, 0x0F1F, 0x88D8, 0x19C9, 0x88D9, 0x19CA, 0x88DB, 0x3B11,
- 0x88DC, 0x0E34, 0x88DD, 0x19CB, 0x88DF, 0x0830, 0x88E1, 0x0F6B,
- 0x88E8, 0x19D0, 0x88F0, 0x3B12, 0x88F1, 0x3B13, 0x88F2, 0x19D1,
- 0x88F3, 0x09C0, 0x88F4, 0x19CF, 0x88F5, 0x21A7, 0x88F8, 0x0F51,
- 0x88F9, 0x19CC, 0x88FC, 0x19CE, 0x88FD, 0x0A61, 0x88FE, 0x0A44,
- 0x8902, 0x19CD, 0x8904, 0x19D2, 0x8906, 0x3B14, 0x8907, 0x0DF3,
- 0x890A, 0x19D4, 0x890C, 0x19D3, 0x8910, 0x05CA, 0x8912, 0x0E59,
- 0x8913, 0x19D5, 0x8918, 0x3B15, 0x8919, 0x3B16, 0x891A, 0x3B17,
- 0x891C, 0x20A8, 0x891D, 0x19E1, 0x891E, 0x19D7, 0x8925, 0x19D8,
- 0x8927, 0x3B18, 0x892A, 0x19D9, 0x892B, 0x19DA, 0x8930, 0x3B19,
- 0x8936, 0x19DE, 0x8938, 0x19DF, 0x893B, 0x19DD, 0x893E, 0x3B1A,
- 0x8941, 0x19DB, 0x8943, 0x19D6, 0x8944, 0x19DC, 0x894C, 0x19E0,
- 0x894D, 0x1BD0, 0x8956, 0x0528, 0x895E, 0x19E3, 0x895F, 0x06D7,
- 0x8960, 0x19E2, 0x8964, 0x19E5, 0x8966, 0x19E4, 0x896A, 0x19E7,
- 0x896D, 0x19E6, 0x896F, 0x19E8, 0x8972, 0x093B, 0x8974, 0x19E9,
- 0x8977, 0x19EA, 0x897B, 0x3B1B, 0x897E, 0x19EB, 0x897F, 0x0A62,
- 0x8980, 0x362E, 0x8981, 0x0F41, 0x8983, 0x19EC, 0x8986, 0x0DF4,
- 0x8987, 0x0CFC, 0x8988, 0x19ED, 0x898A, 0x19EE, 0x898B, 0x075F,
- 0x898F, 0x0646, 0x8993, 0x19EF, 0x8996, 0x08B9, 0x8997, 0x0CF7,
- 0x8998, 0x19F0, 0x899A, 0x05AE, 0x89A1, 0x19F1, 0x89A6, 0x19F3,
- 0x89A7, 0x0F61, 0x89A9, 0x19F2, 0x89AA, 0x0A0C, 0x89AC, 0x19F4,
- 0x89AF, 0x19F5, 0x89B2, 0x19F6, 0x89B3, 0x060D, 0x89BA, 0x19F7,
- 0x89BD, 0x19F8, 0x89BF, 0x19F9, 0x89C0, 0x19FA, 0x89D2, 0x05AF,
- 0x89D4, 0x3B1C, 0x89D6, 0x3B1D, 0x89DA, 0x19FB, 0x89DC, 0x19FC,
- 0x89DD, 0x19FD, 0x89E3, 0x0572, 0x89E5, 0x3B1E, 0x89E6, 0x09EE,
- 0x89E7, 0x19FE, 0x89F1, 0x3B1F, 0x89F4, 0x19FF, 0x89F8, 0x1A00,
- 0x8A00, 0x0774, 0x8A01, 0x35BC, 0x8A02, 0x0C17, 0x8A03, 0x1A01,
- 0x8A07, 0x3B20, 0x8A08, 0x072D, 0x8A0A, 0x0A1C, 0x8A0C, 0x1A04,
- 0x8A0E, 0x0C7C, 0x8A0F, 0x3B21, 0x8A10, 0x1A03, 0x8A12, 0x21A8,
- 0x8A13, 0x0707, 0x8A15, 0x3B22, 0x8A16, 0x1A02, 0x8A17, 0x0B57,
- 0x8A18, 0x0647, 0x8A1B, 0x1A05, 0x8A1D, 0x1A06, 0x8A1F, 0x09C1,
- 0x8A22, 0x3B23, 0x8A23, 0x0743, 0x8A25, 0x1A07, 0x8A2A, 0x0E5A,
- 0x8A2D, 0x0A83, 0x8A31, 0x0690, 0x8A33, 0x0F01, 0x8A34, 0x0ACC,
- 0x8A36, 0x1A08, 0x8A37, 0x21A9, 0x8A3A, 0x0A0D, 0x8A3B, 0x0BAE,
- 0x8A3C, 0x09C2, 0x8A41, 0x1A09, 0x8A46, 0x1A0C, 0x8A48, 0x1A0D,
- 0x8A4E, 0x3B24, 0x8A50, 0x082E, 0x8A51, 0x0B22, 0x8A52, 0x1A0B,
- 0x8A54, 0x09C3, 0x8A55, 0x0DB0, 0x8A5B, 0x1A0A, 0x8A5E, 0x08BA,
- 0x8A60, 0x04F5, 0x8A62, 0x1A11, 0x8A63, 0x072E, 0x8A66, 0x08BC,
- 0x8A69, 0x08BB, 0x8A6B, 0x0FF3, 0x8A6C, 0x1A10, 0x8A6D, 0x1A0F,
- 0x8A6E, 0x0AA9, 0x8A70, 0x0667, 0x8A71, 0x0FE9, 0x8A72, 0x0598,
- 0x8A73, 0x09C4, 0x8A79, 0x21AA, 0x8A7C, 0x1A0E, 0x8A7F, 0x3B25,
- 0x8A82, 0x1A13, 0x8A84, 0x1A14, 0x8A85, 0x1A12, 0x8A87, 0x078C,
- 0x8A89, 0x0F2A, 0x8A8C, 0x08BD, 0x8A8D, 0x0CDD, 0x8A91, 0x1A17,
- 0x8A93, 0x0A64, 0x8A95, 0x0B80, 0x8A98, 0x0F20, 0x8A9A, 0x1A1A,
- 0x8A9E, 0x07A0, 0x8AA0, 0x0A63, 0x8AA1, 0x1A16, 0x8AA3, 0x1A1B,
- 0x8AA4, 0x07A1, 0x8AA5, 0x1A18, 0x8AA6, 0x1A19, 0x8AA7, 0x21AB,
- 0x8AA8, 0x1A15, 0x8AAA, 0x3638, 0x8AAC, 0x0A86, 0x8AAD, 0x0CA1,
- 0x8AB0, 0x0B6D, 0x8AB2, 0x055D, 0x8AB9, 0x0D84, 0x8ABC, 0x065D,
- 0x8ABE, 0x21AC, 0x8ABF, 0x0BD0, 0x8AC2, 0x1A1E, 0x8AC4, 0x1A1C,
- 0x8AC7, 0x0B8A, 0x8ACB, 0x0A65, 0x8ACC, 0x060E, 0x8ACD, 0x1A1D,
- 0x8ACF, 0x0A21, 0x8AD2, 0x0F92, 0x8AD6, 0x0FE6, 0x8ADA, 0x1A1F,
- 0x8ADB, 0x1A2A, 0x8ADC, 0x0BD1, 0x8ADE, 0x1A29, 0x8ADF, 0x21AD,
- 0x8AE0, 0x1A26, 0x8AE1, 0x1A2E, 0x8AE2, 0x1A27, 0x8AE4, 0x1A23,
- 0x8AE6, 0x0C18, 0x8AE7, 0x1A22, 0x8AEB, 0x1A20, 0x8AED, 0x0F0B,
- 0x8AEE, 0x08BE, 0x8AF1, 0x1A24, 0x8AF3, 0x1A21, 0x8AF4, 0x3B26,
- 0x8AF6, 0x21AF, 0x8AF7, 0x1A28, 0x8AF8, 0x097E, 0x8AFA, 0x0775,
- 0x8AFE, 0x0B5A, 0x8B00, 0x0E73, 0x8B01, 0x04FC, 0x8B02, 0x04A6,
- 0x8B04, 0x0C7D, 0x8B07, 0x1A2C, 0x8B0C, 0x1A2B, 0x8B0E, 0x0CBE,
- 0x8B10, 0x1A30, 0x8B14, 0x1A25, 0x8B16, 0x1A2F, 0x8B17, 0x1A31,
- 0x8B19, 0x0760, 0x8B1A, 0x1A2D, 0x8B1B, 0x07E8, 0x8B1D, 0x0901,
- 0x8B1F, 0x3B27, 0x8B20, 0x1A32, 0x8B21, 0x0F42, 0x8B26, 0x1A35,
- 0x8B28, 0x1A38, 0x8B2B, 0x1A36, 0x8B2C, 0x0DA7, 0x8B33, 0x1A33,
- 0x8B37, 0x3B28, 0x8B39, 0x06D8, 0x8B3E, 0x1A37, 0x8B41, 0x1A39,
- 0x8B43, 0x3B29, 0x8B44, 0x3B2A, 0x8B49, 0x1A3D, 0x8B4C, 0x1A3A,
- 0x8B4E, 0x1A3C, 0x8B4F, 0x1A3B, 0x8B53, 0x21B0, 0x8B54, 0x3B2B,
- 0x8B56, 0x1A3E, 0x8B58, 0x08DD, 0x8B5A, 0x1A40, 0x8B5B, 0x1A3F,
- 0x8B5C, 0x0DDA, 0x8B5F, 0x1A42, 0x8B66, 0x072F, 0x8B6B, 0x1A41,
- 0x8B6C, 0x1A43, 0x8B6F, 0x1A44, 0x8B70, 0x065E, 0x8B71, 0x182E,
- 0x8B72, 0x09E1, 0x8B74, 0x1A45, 0x8B77, 0x07A2, 0x8B7D, 0x1A46,
- 0x8B7F, 0x21B1, 0x8B80, 0x1A47, 0x8B83, 0x088C, 0x8B8A, 0x13D3,
- 0x8B8C, 0x1A48, 0x8B8E, 0x1A49, 0x8B90, 0x093C, 0x8B92, 0x1A4A,
- 0x8B93, 0x1A4B, 0x8B96, 0x1A4C, 0x8B99, 0x1A4D, 0x8B9A, 0x1A4E,
- 0x8B9C, 0x3B2C, 0x8B9E, 0x3B2D, 0x8C37, 0x0B69, 0x8C3A, 0x1A4F,
- 0x8C3F, 0x1A51, 0x8C41, 0x1A50, 0x8C46, 0x0C7E, 0x8C47, 0x3B2E,
- 0x8C48, 0x1A52, 0x8C4A, 0x0E5B, 0x8C4C, 0x1A53, 0x8C4E, 0x1A54,
- 0x8C50, 0x1A55, 0x8C54, 0x3B2F, 0x8C55, 0x1A56, 0x8C5A, 0x0CB2,
- 0x8C61, 0x09C5, 0x8C62, 0x1A57, 0x8C6A, 0x07FD, 0x8C6B, 0x1007,
- 0x8C6C, 0x1A58, 0x8C73, 0x3B30, 0x8C78, 0x1A59, 0x8C79, 0x0DB1,
- 0x8C7A, 0x1A5A, 0x8C7C, 0x1A62, 0x8C82, 0x1A5B, 0x8C85, 0x1A5D,
- 0x8C89, 0x1A5C, 0x8C8A, 0x1A5E, 0x8C8C, 0x0E74, 0x8C8D, 0x1A5F,
- 0x8C8E, 0x1A60, 0x8C94, 0x1A61, 0x8C98, 0x1A63, 0x8C9D, 0x058B,
- 0x8C9E, 0x0C03, 0x8CA0, 0x0DDB, 0x8CA1, 0x0852, 0x8CA2, 0x07E9,
- 0x8CA4, 0x3B31, 0x8CA7, 0x0DC1, 0x8CA8, 0x055F, 0x8CA9, 0x0D62,
- 0x8CAA, 0x1A66, 0x8CAB, 0x060F, 0x8CAC, 0x0A79, 0x8CAD, 0x1A65,
- 0x8CAE, 0x1A6A, 0x8CAF, 0x0BB7, 0x8CB0, 0x0EEF, 0x8CB2, 0x1A68,
- 0x8CB3, 0x1A69, 0x8CB4, 0x0648, 0x8CB6, 0x1A6B, 0x8CB7, 0x0D19,
- 0x8CB8, 0x0B3F, 0x8CBB, 0x0D85, 0x8CBC, 0x0C37, 0x8CBD, 0x1A67,
- 0x8CBF, 0x0E75, 0x8CC0, 0x056C, 0x8CC1, 0x1A6D, 0x8CC2, 0x0FCE,
- 0x8CC3, 0x0BDE, 0x8CC4, 0x0FEB, 0x8CC7, 0x08BF, 0x8CC8, 0x1A6C,
- 0x8CCA, 0x0B11, 0x8CCD, 0x1A7D, 0x8CCE, 0x0AAA, 0x8CD1, 0x0CD0,
- 0x8CD3, 0x0DC2, 0x8CD9, 0x3B32, 0x8CDA, 0x1A70, 0x8CDB, 0x088D,
- 0x8CDC, 0x08C0, 0x8CDE, 0x09C6, 0x8CE0, 0x0D1B, 0x8CE1, 0x3B33,
- 0x8CE2, 0x0761, 0x8CE3, 0x1A6F, 0x8CE4, 0x1A6E, 0x8CE6, 0x0DDC,
- 0x8CEA, 0x08ED, 0x8CED, 0x0C4C, 0x8CF0, 0x21B2, 0x8CF4, 0x21B3,
- 0x8CF8, 0x3B34, 0x8CFA, 0x1A72, 0x8CFB, 0x1A73, 0x8CFC, 0x07EA,
- 0x8CFD, 0x1A71, 0x8CFE, 0x3B35, 0x8D04, 0x1A74, 0x8D05, 0x1A75,
- 0x8D07, 0x1A77, 0x8D08, 0x0B03, 0x8D0A, 0x1A76, 0x8D0B, 0x0622,
- 0x8D0D, 0x1A79, 0x8D0F, 0x1A78, 0x8D10, 0x1A7A, 0x8D12, 0x21B4,
- 0x8D13, 0x1A7C, 0x8D14, 0x1A7E, 0x8D16, 0x1A7F, 0x8D1B, 0x3B36,
- 0x8D64, 0x0A7A, 0x8D66, 0x08FB, 0x8D67, 0x1A80, 0x8D69, 0x3B37,
- 0x8D6B, 0x05B0, 0x8D6C, 0x3B38, 0x8D6D, 0x1A81, 0x8D70, 0x0AF8,
- 0x8D71, 0x1A82, 0x8D73, 0x1A83, 0x8D74, 0x0DDD, 0x8D76, 0x21B5,
- 0x8D77, 0x0649, 0x8D81, 0x1A84, 0x8D84, 0x3B39, 0x8D85, 0x0BD2,
- 0x8D8A, 0x04FD, 0x8D8D, 0x3B3A, 0x8D95, 0x3B3B, 0x8D99, 0x1A85,
- 0x8DA3, 0x091D, 0x8DA6, 0x3B3C, 0x8DA8, 0x0A3C, 0x8DB3, 0x0B0D,
- 0x8DBA, 0x1A88, 0x8DBE, 0x1A87, 0x8DC2, 0x1A86, 0x8DC6, 0x3B3D,
- 0x8DCB, 0x1A8E, 0x8DCC, 0x1A8C, 0x8DCE, 0x3B3E, 0x8DCF, 0x1A89,
- 0x8DD6, 0x1A8B, 0x8DDA, 0x1A8A, 0x8DDB, 0x1A8D, 0x8DDD, 0x0691,
- 0x8DDF, 0x1A91, 0x8DE1, 0x0A7B, 0x8DE3, 0x1A92, 0x8DE4, 0x3B3F,
- 0x8DE8, 0x078D, 0x8DEA, 0x1A8F, 0x8DEB, 0x1A90, 0x8DEC, 0x3B40,
- 0x8DEF, 0x0FCF, 0x8DF3, 0x0BD3, 0x8DF5, 0x0AAB, 0x8DFC, 0x1A93,
- 0x8DFF, 0x1A96, 0x8E08, 0x1A94, 0x8E09, 0x1A95, 0x8E0A, 0x0F43,
- 0x8E0F, 0x0C7F, 0x8E10, 0x1A99, 0x8E1D, 0x1A97, 0x8E1E, 0x1A98,
- 0x8E1F, 0x1A9A, 0x8E20, 0x3B41, 0x8E2A, 0x1AA8, 0x8E30, 0x1A9D,
- 0x8E34, 0x1A9E, 0x8E35, 0x1A9C, 0x8E42, 0x1A9B, 0x8E44, 0x0C19,
- 0x8E47, 0x1AA0, 0x8E48, 0x1AA4, 0x8E49, 0x1AA1, 0x8E4A, 0x1A9F,
- 0x8E4B, 0x3B42, 0x8E4C, 0x1AA2, 0x8E50, 0x1AA3, 0x8E55, 0x1AAA,
- 0x8E59, 0x1AA5, 0x8E5F, 0x0A7C, 0x8E60, 0x1AA7, 0x8E63, 0x1AA9,
- 0x8E64, 0x1AA6, 0x8E6C, 0x3B43, 0x8E70, 0x3B44, 0x8E72, 0x1AAC,
- 0x8E74, 0x093D, 0x8E76, 0x1AAB, 0x8E7A, 0x3B45, 0x8E7C, 0x1AAD,
- 0x8E81, 0x1AAE, 0x8E84, 0x1AB1, 0x8E85, 0x1AB0, 0x8E87, 0x1AAF,
- 0x8E8A, 0x1AB3, 0x8E8B, 0x1AB2, 0x8E8D, 0x0F02, 0x8E91, 0x1AB5,
- 0x8E92, 0x3B46, 0x8E93, 0x1AB4, 0x8E94, 0x1AB6, 0x8E99, 0x1AB7,
- 0x8EA1, 0x1AB9, 0x8EAA, 0x1AB8, 0x8EAB, 0x0A0E, 0x8EAC, 0x1ABA,
- 0x8EAE, 0x3B47, 0x8EAF, 0x06E5, 0x8EB0, 0x1ABB, 0x8EB1, 0x1ABD,
- 0x8EB3, 0x3B48, 0x8EB6, 0x3703, 0x8EBE, 0x1ABE, 0x8EC0, 0x1DEF,
- 0x8EC5, 0x1ABF, 0x8EC6, 0x1ABC, 0x8EC8, 0x1AC0, 0x8ECA, 0x0902,
- 0x8ECB, 0x1AC1, 0x8ECC, 0x064A, 0x8ECD, 0x0709, 0x8ECF, 0x21B7,
- 0x8ED1, 0x3B49, 0x8ED2, 0x0762, 0x8ED4, 0x3B4A, 0x8EDB, 0x1AC2,
- 0x8EDF, 0x0CC8, 0x8EE2, 0x0C38, 0x8EE3, 0x1AC3, 0x8EEB, 0x1AC6,
- 0x8EF8, 0x08E0, 0x8EF9, 0x3B4B, 0x8EFB, 0x1AC5, 0x8EFC, 0x1AC4,
- 0x8EFD, 0x0730, 0x8EFE, 0x1AC7, 0x8F03, 0x05B1, 0x8F05, 0x1AC9,
- 0x8F09, 0x084C, 0x8F0A, 0x1AC8, 0x8F0C, 0x1AD1, 0x8F12, 0x1ACB,
- 0x8F13, 0x1ACD, 0x8F14, 0x0E35, 0x8F15, 0x1ACA, 0x8F17, 0x3B4C,
- 0x8F19, 0x1ACC, 0x8F1B, 0x1AD0, 0x8F1C, 0x1ACE, 0x8F1D, 0x064B,
- 0x8F1F, 0x1ACF, 0x8F26, 0x1AD2, 0x8F29, 0x0D10, 0x8F2A, 0x0FA0,
- 0x8F2F, 0x093E, 0x8F33, 0x1AD3, 0x8F36, 0x3B4D, 0x8F38, 0x0F0C,
- 0x8F39, 0x1AD5, 0x8F3B, 0x1AD4, 0x8F3E, 0x1AD8, 0x8F3F, 0x0F2B,
- 0x8F42, 0x1AD7, 0x8F44, 0x05CB, 0x8F45, 0x1AD6, 0x8F46, 0x1ADB,
- 0x8F49, 0x1ADA, 0x8F4C, 0x1AD9, 0x8F4D, 0x0C2C, 0x8F4E, 0x1ADC,
- 0x8F57, 0x1ADD, 0x8F5C, 0x1ADE, 0x8F5F, 0x07FE, 0x8F61, 0x06FB,
- 0x8F62, 0x1ADF, 0x8F63, 0x1AE0, 0x8F64, 0x1AE1, 0x8F9B, 0x0A0F,
- 0x8F9C, 0x1AE2, 0x8F9E, 0x08D9, 0x8F9F, 0x1AE3, 0x8FA3, 0x1AE4,
- 0x8FA6, 0x3B4E, 0x8FA7, 0x10B6, 0x8FA8, 0x10B5, 0x8FAD, 0x1AE5,
- 0x8FAE, 0x17FF, 0x8FAF, 0x1AE6, 0x8FB0, 0x0B62, 0x8FB1, 0x09F1,
- 0x8FB2, 0x0CF6, 0x8FB5, 0x3B4F, 0x8FB6, 0x3B50, 0x8FB7, 0x1AE7,
- 0x8FBA, 0x0E25, 0x8FBB, 0x0BF0, 0x8FBC, 0x0810, 0x8FBF, 0x0B67,
- 0x8FC2, 0x04CC, 0x8FC4, 0x0EA6, 0x8FC5, 0x0A1D, 0x8FC6, 0x3B51,
- 0x8FC8, 0x3799, 0x8FCE, 0x0734, 0x8FD1, 0x06D9, 0x8FD4, 0x0E26,
- 0x8FDA, 0x1AE8, 0x8FE0, 0x3B52, 0x8FE2, 0x1AEA, 0x8FE4, 0x3B53,
- 0x8FE5, 0x1AE9, 0x8FE6, 0x0560, 0x8FE9, 0x0CCE, 0x8FEA, 0x1AEB,
- 0x8FEB, 0x0D2D, 0x8FED, 0x0C2D, 0x8FEF, 0x1AEC, 0x8FF0, 0x095C,
- 0x8FF4, 0x1AEE, 0x8FF6, 0x3B54, 0x8FF7, 0x0ECE, 0x8FF8, 0x1AFD,
- 0x8FF9, 0x1AF0, 0x8FFA, 0x1AF1, 0x8FFD, 0x0BE5, 0x9000, 0x0B40,
- 0x9001, 0x0AF9, 0x9002, 0x3B55, 0x9003, 0x0C80, 0x9005, 0x1AEF,
- 0x9006, 0x066F, 0x900B, 0x1AF8, 0x900D, 0x1AF5, 0x900E, 0x1B02,
- 0x900F, 0x0C81, 0x9010, 0x0B9E, 0x9011, 0x1AF2, 0x9013, 0x0C1A,
- 0x9014, 0x0C4D, 0x9015, 0x1AF3, 0x9016, 0x1AF7, 0x9017, 0x0A26,
- 0x9019, 0x0D1D, 0x901A, 0x0BE8, 0x901D, 0x0A66, 0x901E, 0x1AF6,
- 0x901F, 0x0B0E, 0x9020, 0x0B04, 0x9021, 0x1AF4, 0x9022, 0x046D,
- 0x9023, 0x0FC8, 0x9027, 0x1AF9, 0x902C, 0x3B56, 0x902E, 0x0B41,
- 0x9031, 0x093F, 0x9032, 0x0A10, 0x9035, 0x1AFB, 0x9036, 0x1AFA,
- 0x9038, 0x04B3, 0x9039, 0x1AFC, 0x903C, 0x0DA1, 0x903E, 0x1B04,
- 0x9041, 0x0CB3, 0x9042, 0x0A31, 0x9044, 0x3B57, 0x9045, 0x0B97,
- 0x9047, 0x06F0, 0x9049, 0x1B03, 0x904A, 0x0F21, 0x904B, 0x04E1,
- 0x904D, 0x0E27, 0x904E, 0x0561, 0x904F, 0x1AFE, 0x9050, 0x1AFF,
- 0x9051, 0x1B00, 0x9052, 0x1B01, 0x9053, 0x0C93, 0x9054, 0x0B61,
- 0x9055, 0x04A7, 0x9056, 0x1B05, 0x9058, 0x1B06, 0x9059, 0x1D34,
- 0x905C, 0x0B1D, 0x905E, 0x1B07, 0x9060, 0x0515, 0x9061, 0x0ACE,
- 0x9063, 0x0763, 0x9065, 0x0F44, 0x9067, 0x21BA, 0x9068, 0x1B08,
- 0x9069, 0x0C26, 0x906D, 0x0AFA, 0x906E, 0x0903, 0x906F, 0x1B09,
- 0x9072, 0x1B0C, 0x9075, 0x096F, 0x9076, 0x1B0A, 0x9077, 0x0AAD,
- 0x9078, 0x0AAC, 0x907A, 0x04A8, 0x907C, 0x0F93, 0x907D, 0x1B0E,
- 0x907F, 0x0D86, 0x9080, 0x1B10, 0x9081, 0x1B0F, 0x9082, 0x1B0D,
- 0x9083, 0x1737, 0x9084, 0x0610, 0x9087, 0x1AED, 0x9088, 0x3B58,
- 0x9089, 0x1B12, 0x908A, 0x1B11, 0x908F, 0x1B13, 0x9091, 0x0F22,
- 0x9095, 0x3B59, 0x9099, 0x3B5A, 0x909B, 0x3B5B, 0x90A2, 0x3B5C,
- 0x90A3, 0x0CB9, 0x90A6, 0x0E5C, 0x90A8, 0x1B14, 0x90AA, 0x0905,
- 0x90AF, 0x1B15, 0x90B1, 0x1B16, 0x90B4, 0x3B5D, 0x90B5, 0x1B17,
- 0x90B8, 0x0C1B, 0x90C1, 0x04AE, 0x90CA, 0x07EB, 0x90CE, 0x0FE0,
- 0x90D7, 0x3B5E, 0x90DB, 0x1B1B, 0x90DD, 0x3B5F, 0x90DE, 0x21BB,
- 0x90E1, 0x070A, 0x90E2, 0x1B18, 0x90E4, 0x1B19, 0x90E8, 0x0DE6,
- 0x90ED, 0x05B2, 0x90F4, 0x3B60, 0x90F5, 0x0F23, 0x90F7, 0x06B7,
- 0x90FD, 0x0C4E, 0x9102, 0x1B1C, 0x9112, 0x1B1D, 0x9115, 0x21BD,
- 0x9117, 0x3B61, 0x9119, 0x1B1E, 0x911C, 0x3B62, 0x9127, 0x21BE,
- 0x912D, 0x0C1C, 0x9130, 0x1B20, 0x9131, 0x3B63, 0x9132, 0x1B1F,
- 0x913A, 0x3B64, 0x913D, 0x3B65, 0x9148, 0x3B66, 0x9149, 0x0CAB,
- 0x914A, 0x1B21, 0x914B, 0x0940, 0x914C, 0x090C, 0x914D, 0x0D11,
- 0x914E, 0x0BAF, 0x9152, 0x091E, 0x9154, 0x0A32, 0x9156, 0x1B22,
- 0x9158, 0x1B23, 0x915B, 0x3B67, 0x9161, 0x3B68, 0x9162, 0x0A23,
- 0x9163, 0x1B24, 0x9164, 0x3B69, 0x9165, 0x1B25, 0x9169, 0x1B26,
- 0x916A, 0x0F59, 0x916C, 0x0941, 0x9172, 0x1B28, 0x9173, 0x1B27,
- 0x9175, 0x07EC, 0x9177, 0x0805, 0x9178, 0x088E, 0x9182, 0x1B2B,
- 0x9187, 0x0970, 0x9189, 0x1B2A, 0x918B, 0x1B29, 0x918D, 0x0B49,
- 0x918E, 0x3B6A, 0x9190, 0x07A3, 0x9192, 0x0A67, 0x9197, 0x0D44,
- 0x919C, 0x0943, 0x919E, 0x3B6B, 0x91A2, 0x1B2C, 0x91A4, 0x09C7,
- 0x91A8, 0x3B6C, 0x91AA, 0x1B2F, 0x91AB, 0x1B2D, 0x91AC, 0x1E1B,
- 0x91AD, 0x3B6D, 0x91AE, 0x3B6E, 0x91AF, 0x1B2E, 0x91B1, 0x1E61,
- 0x91B2, 0x3B6F, 0x91B4, 0x1B31, 0x91B5, 0x1B30, 0x91B8, 0x09E2,
- 0x91BA, 0x1B32, 0x91BC, 0x3B70, 0x91C0, 0x1B33, 0x91C1, 0x1B34,
- 0x91C6, 0x0D64, 0x91C7, 0x0843, 0x91C8, 0x090D, 0x91C9, 0x1B35,
- 0x91CB, 0x1B36, 0x91CC, 0x0F6C, 0x91CD, 0x094F, 0x91CE, 0x0EFA,
- 0x91CF, 0x0F94, 0x91D0, 0x1B37, 0x91D1, 0x06DA, 0x91D6, 0x1B38,
- 0x91D7, 0x21C0, 0x91D8, 0x0C1D, 0x91DA, 0x21BF, 0x91DB, 0x1B3B,
- 0x91DC, 0x05D6, 0x91DD, 0x0A11, 0x91DE, 0x21C1, 0x91DF, 0x1B39,
- 0x91E1, 0x1B3A, 0x91E3, 0x0BFC, 0x91E4, 0x21C4, 0x91E5, 0x21C5,
- 0x91E6, 0x0E83, 0x91E7, 0x06F4, 0x91ED, 0x21C2, 0x91EE, 0x21C3,
- 0x91F0, 0x3B71, 0x91F5, 0x1B3D, 0x91F6, 0x1B3E, 0x91F7, 0x3B72,
- 0x91FB, 0x3B73, 0x91FC, 0x1B3C, 0x91FF, 0x1B40, 0x9206, 0x21C6,
- 0x9207, 0x3B74, 0x920A, 0x21C8, 0x920D, 0x0CB7, 0x920E, 0x05A1,
- 0x9210, 0x21C7, 0x9211, 0x1B44, 0x9214, 0x1B41, 0x9215, 0x1B43,
- 0x921E, 0x1B3F, 0x9228, 0x3B75, 0x9229, 0x1B8A, 0x922C, 0x1B42,
- 0x9233, 0x3B76, 0x9234, 0x0FB3, 0x9237, 0x078E, 0x9238, 0x3B77,
- 0x9239, 0x21CF, 0x923A, 0x21C9, 0x923C, 0x21CB, 0x923F, 0x1B4C,
- 0x9240, 0x21CA, 0x9243, 0x3B78, 0x9244, 0x0C2E, 0x9245, 0x1B47,
- 0x9247, 0x3B79, 0x9248, 0x1B4A, 0x9249, 0x1B48, 0x924B, 0x1B4D,
- 0x924E, 0x21CC, 0x924F, 0x3B7A, 0x9250, 0x1B4E, 0x9251, 0x21CE,
- 0x9257, 0x1B46, 0x9259, 0x21CD, 0x925A, 0x1B53, 0x925B, 0x0516,
- 0x925E, 0x1B45, 0x9260, 0x3B7B, 0x9262, 0x0D41, 0x9264, 0x1B49,
- 0x9266, 0x09C8, 0x9267, 0x21D0, 0x9271, 0x07ED, 0x9277, 0x21D2,
- 0x9278, 0x21D3, 0x927E, 0x0E76, 0x9280, 0x06DC, 0x9283, 0x0950,
- 0x9285, 0x0C94, 0x9288, 0x20AA, 0x9291, 0x0AAF, 0x9293, 0x1B51,
- 0x9295, 0x1B4B, 0x9296, 0x1B50, 0x9298, 0x0ECF, 0x929A, 0x0BD4,
- 0x929B, 0x1B52, 0x929C, 0x1B4F, 0x92A7, 0x21D1, 0x92AD, 0x0AAE,
- 0x92B3, 0x3554, 0x92B7, 0x1B56, 0x92B9, 0x1B55, 0x92C2, 0x3B7C,
- 0x92CB, 0x3B7D, 0x92CC, 0x3B7E, 0x92CF, 0x1B54, 0x92D0, 0x21D7,
- 0x92D2, 0x0E5D, 0x92D3, 0x21DB, 0x92D5, 0x21D9, 0x92D7, 0x21D5,
- 0x92D9, 0x21D6, 0x92DF, 0x3B7F, 0x92E0, 0x21DA, 0x92E4, 0x0985,
- 0x92E7, 0x21D4, 0x92E9, 0x1B57, 0x92EA, 0x0E2F, 0x92ED, 0x04F6,
- 0x92F2, 0x0DB8, 0x92F3, 0x0BB0, 0x92F8, 0x0692, 0x92F9, 0x20B0,
- 0x92FA, 0x1B59, 0x92FB, 0x21DE, 0x92FC, 0x07EF, 0x92FF, 0x21E1,
- 0x9302, 0x21E3, 0x9304, 0x345A, 0x9306, 0x087A, 0x930D, 0x3B80,
- 0x930F, 0x1B58, 0x9310, 0x0A33, 0x9315, 0x3B81, 0x9318, 0x0A34,
- 0x9319, 0x1B5C, 0x931A, 0x1B5E, 0x931D, 0x21E2, 0x931E, 0x21E0,
- 0x931F, 0x3B82, 0x9320, 0x09E3, 0x9321, 0x21DD, 0x9322, 0x1B5D,
- 0x9323, 0x1B5F, 0x9325, 0x21DC, 0x9326, 0x06CB, 0x9327, 0x3B83,
- 0x9328, 0x0DB7, 0x932B, 0x090E, 0x932C, 0x0FC9, 0x932E, 0x1B5B,
- 0x932F, 0x0868, 0x9332, 0x0FE5, 0x9335, 0x1B61, 0x933A, 0x1B60,
- 0x933B, 0x1B62, 0x9344, 0x1B5A, 0x9347, 0x3B84, 0x9348, 0x20A9,
- 0x934A, 0x3458, 0x934B, 0x0CC1, 0x934D, 0x0C4F, 0x9352, 0x3B85,
- 0x9354, 0x0BF3, 0x9356, 0x1B67, 0x9357, 0x21E5, 0x935B, 0x0B81,
- 0x935C, 0x1B63, 0x9360, 0x1B64, 0x9365, 0x3B86, 0x936A, 0x3B87,
- 0x936C, 0x0703, 0x936D, 0x3B88, 0x936E, 0x1B66, 0x9370, 0x21E4,
- 0x9375, 0x0764, 0x937C, 0x1B65, 0x937E, 0x09C9, 0x938C, 0x05D7,
- 0x9394, 0x1B6B, 0x9396, 0x082F, 0x9397, 0x0AFB, 0x939A, 0x0BE6,
- 0x939B, 0x3B89, 0x93A4, 0x21E6, 0x93A7, 0x0599, 0x93A9, 0x3B8B,
- 0x93AC, 0x1B69, 0x93AD, 0x1B6A, 0x93AE, 0x0BDF, 0x93B0, 0x1B68,
- 0x93B9, 0x1B6C, 0x93BA, 0x3B8A, 0x93C1, 0x3B8C, 0x93C3, 0x1B72,
- 0x93C6, 0x21E7, 0x93C8, 0x1B75, 0x93CA, 0x3B8D, 0x93D0, 0x1B74,
- 0x93D1, 0x0C27, 0x93D6, 0x1B6D, 0x93D7, 0x1B6E, 0x93D8, 0x1B71,
- 0x93DD, 0x1B73, 0x93DE, 0x21E8, 0x93E1, 0x06B8, 0x93E2, 0x3B8E,
- 0x93E4, 0x1B76, 0x93E5, 0x1B70, 0x93E8, 0x1B6F, 0x93F8, 0x21E9,
- 0x93FA, 0x3B8F, 0x93FD, 0x3B90, 0x9403, 0x1B7A, 0x9407, 0x1B7B,
- 0x940F, 0x3B91, 0x9410, 0x1B7C, 0x9413, 0x1B79, 0x9414, 0x1B78,
- 0x9418, 0x09CA, 0x9419, 0x0C82, 0x941A, 0x1B77, 0x9421, 0x1B80,
- 0x942B, 0x1B7E, 0x9431, 0x21EA, 0x9434, 0x3B92, 0x9435, 0x1B7F,
- 0x9436, 0x1B7D, 0x9438, 0x0B58, 0x943A, 0x1B81, 0x943F, 0x3B93,
- 0x9441, 0x1B82, 0x9444, 0x1B84, 0x9445, 0x21EB, 0x9448, 0x21EC,
- 0x9451, 0x0611, 0x9452, 0x1B83, 0x9453, 0x0F06, 0x9455, 0x3B94,
- 0x945A, 0x1B8F, 0x945B, 0x1B85, 0x945E, 0x1B88, 0x9460, 0x1B86,
- 0x9462, 0x1B87, 0x946A, 0x1B89, 0x946B, 0x3B95, 0x9470, 0x1B8B,
- 0x9472, 0x3B96, 0x9475, 0x1B8C, 0x9477, 0x1B8D, 0x947C, 0x1B90,
- 0x947D, 0x1B8E, 0x947E, 0x1B91, 0x947F, 0x1B93, 0x9481, 0x1B92,
- 0x9577, 0x0BD5, 0x9578, 0x3B97, 0x9580, 0x0EF3, 0x9582, 0x1B94,
- 0x9583, 0x0AB0, 0x9587, 0x1B95, 0x9589, 0x0E14, 0x958A, 0x1B96,
- 0x958B, 0x0589, 0x958F, 0x04DE, 0x9591, 0x0613, 0x9592, 0x21ED,
- 0x9593, 0x0612, 0x9594, 0x1B97, 0x9596, 0x1B98, 0x9598, 0x1B99,
- 0x9599, 0x1B9A, 0x95A0, 0x1B9B, 0x95A2, 0x0614, 0x95A3, 0x05B3,
- 0x95A4, 0x07F0, 0x95A5, 0x0D4A, 0x95A6, 0x3B98, 0x95A7, 0x1B9D,
- 0x95A8, 0x1B9C, 0x95A9, 0x3B99, 0x95AB, 0x3B9A, 0x95AD, 0x1B9E,
- 0x95B1, 0x3555, 0x95B2, 0x04FE, 0x95B4, 0x3B9B, 0x95B9, 0x1BA1,
- 0x95BB, 0x1BA0, 0x95BC, 0x1B9F, 0x95BD, 0x3B9C, 0x95BE, 0x1BA2,
- 0x95C3, 0x1BA5, 0x95C7, 0x048B, 0x95CA, 0x1BA3, 0x95CC, 0x1BA7,
- 0x95CD, 0x1BA6, 0x95D4, 0x1BA9, 0x95D5, 0x1BA8, 0x95D6, 0x1BAA,
- 0x95D8, 0x0C86, 0x95DA, 0x3B9D, 0x95DC, 0x1BAB, 0x95E1, 0x1BAC,
- 0x95E2, 0x1BAE, 0x95E5, 0x1BAD, 0x961C, 0x0DDE, 0x961D, 0x3B9E,
- 0x9621, 0x1BAF, 0x9628, 0x1BB0, 0x962A, 0x0855, 0x962E, 0x1BB1,
- 0x962F, 0x1BB2, 0x9632, 0x0E77, 0x963B, 0x0ACD, 0x963F, 0x0468,
- 0x9640, 0x0B2B, 0x9641, 0x3B9F, 0x9642, 0x1BB3, 0x9644, 0x0DDF,
- 0x964B, 0x1BB6, 0x964C, 0x1BB4, 0x964D, 0x07F1, 0x964F, 0x1BB5,
- 0x9650, 0x0776, 0x9658, 0x3BA0, 0x965B, 0x0E15, 0x965C, 0x1BB8,
- 0x965D, 0x1BBA, 0x965E, 0x1BB9, 0x965F, 0x1BBB, 0x9662, 0x04C3,
- 0x9663, 0x0A1E, 0x9664, 0x0986, 0x9665, 0x0615, 0x9666, 0x1BBC,
- 0x966A, 0x0D1C, 0x966C, 0x1BBE, 0x9670, 0x04C4, 0x9672, 0x1BBD,
- 0x9673, 0x0BE0, 0x9675, 0x0F95, 0x9676, 0x0C83, 0x9677, 0x1BB7,
- 0x9678, 0x0F6E, 0x967A, 0x0765, 0x967D, 0x0F45, 0x9684, 0x3BA1,
- 0x9685, 0x06F1, 0x9686, 0x0F7C, 0x9688, 0x06FE, 0x968A, 0x0B42,
- 0x968B, 0x186C, 0x968D, 0x1BBF, 0x968E, 0x058A, 0x968F, 0x0A35,
- 0x9694, 0x05B4, 0x9695, 0x1BC1, 0x9697, 0x1BC2, 0x9698, 0x1BC0,
- 0x9699, 0x073A, 0x969B, 0x084D, 0x969C, 0x09CB, 0x969D, 0x21F0,
- 0x96A0, 0x04C5, 0x96A3, 0x0FA1, 0x96A4, 0x3BA2, 0x96A7, 0x1BC4,
- 0x96A8, 0x1B0B, 0x96A9, 0x3BA3, 0x96AA, 0x1BC3, 0x96AF, 0x21F1,
- 0x96B0, 0x1BC7, 0x96B1, 0x1BC5, 0x96B2, 0x1BC6, 0x96B4, 0x1BC8,
- 0x96B6, 0x1BC9, 0x96B7, 0x0FB4, 0x96B8, 0x1BCA, 0x96B9, 0x1BCB,
- 0x96BB, 0x0A6D, 0x96BC, 0x0D4F, 0x96C0, 0x0A43, 0x96C1, 0x0623,
- 0x96C4, 0x0F24, 0x96C5, 0x056D, 0x96C6, 0x0942, 0x96C7, 0x078F,
- 0x96C9, 0x1BCE, 0x96CB, 0x1BCD, 0x96CC, 0x08C1, 0x96CD, 0x1BCF,
- 0x96CE, 0x1BCC, 0x96D1, 0x0876, 0x96D2, 0x3BA4, 0x96D5, 0x1BD3,
- 0x96D6, 0x1992, 0x96D9, 0x10EB, 0x96DB, 0x0A3D, 0x96DC, 0x1BD1,
- 0x96DE, 0x3BA6, 0x96E2, 0x0F6D, 0x96E3, 0x0CC9, 0x96E8, 0x04CD,
- 0x96E9, 0x3BA7, 0x96EA, 0x0A87, 0x96EB, 0x08E2, 0x96F0, 0x0E07,
- 0x96F1, 0x3BA8, 0x96F2, 0x04E2, 0x96F6, 0x0FB5, 0x96F7, 0x0F55,
- 0x96F9, 0x1BD4, 0x96FB, 0x0C3F, 0x9700, 0x0927, 0x9702, 0x3BA9,
- 0x9704, 0x1BD5, 0x9706, 0x1BD6, 0x9707, 0x0A12, 0x9708, 0x1BD7,
- 0x9709, 0x3BAA, 0x970A, 0x0FB6, 0x970D, 0x1BD2, 0x970E, 0x1BD9,
- 0x970F, 0x1BDB, 0x9711, 0x1BDA, 0x9713, 0x1BD8, 0x9716, 0x1BDC,
- 0x9719, 0x1BDD, 0x971C, 0x0AFC, 0x971E, 0x0562, 0x9724, 0x1BDE,
- 0x9727, 0x0EC4, 0x972A, 0x1BDF, 0x9730, 0x1BE0, 0x9732, 0x0FD0,
- 0x9733, 0x21F2, 0x9738, 0x1414, 0x9739, 0x1BE1, 0x973B, 0x21F3,
- 0x973D, 0x1BE2, 0x973E, 0x1BE3, 0x9742, 0x1BE7, 0x9743, 0x21F4,
- 0x9744, 0x1BE4, 0x9746, 0x1BE5, 0x9748, 0x1BE6, 0x9749, 0x1BE8,
- 0x974D, 0x21F5, 0x974F, 0x21F6, 0x9751, 0x21F7, 0x9752, 0x0A68,
- 0x9755, 0x21F8, 0x9756, 0x0F03, 0x9759, 0x0A69, 0x975A, 0x3BAB,
- 0x975C, 0x1BE9, 0x975E, 0x0D87, 0x9760, 0x1BEA, 0x9761, 0x1D06,
- 0x9762, 0x0ED8, 0x9763, 0x3BAC, 0x9764, 0x1BEB, 0x9766, 0x1BEC,
- 0x9768, 0x1BED, 0x9769, 0x05B5, 0x976B, 0x1BEF, 0x976D, 0x0A1F,
- 0x976E, 0x3BAD, 0x9771, 0x1BF0, 0x9773, 0x3BAE, 0x9774, 0x06FA,
- 0x9779, 0x1BF1, 0x977A, 0x1BF5, 0x977C, 0x1BF3, 0x9781, 0x1BF4,
- 0x9784, 0x05D1, 0x9785, 0x1BF2, 0x9786, 0x1BF6, 0x978B, 0x1BF7,
- 0x978D, 0x048C, 0x978F, 0x1BF8, 0x9790, 0x1BF9, 0x9798, 0x09CC,
- 0x979A, 0x3BAF, 0x979C, 0x1BFA, 0x97A0, 0x0661, 0x97A2, 0x3BB0,
- 0x97A3, 0x1BFD, 0x97A6, 0x1BFC, 0x97A8, 0x1BFB, 0x97AB, 0x1A34,
- 0x97AD, 0x0E2C, 0x97B3, 0x1BFE, 0x97B4, 0x1BFF, 0x97B5, 0x3BB1,
- 0x97B6, 0x3BB2, 0x97C3, 0x1C00, 0x97C6, 0x1C01, 0x97C8, 0x1C02,
- 0x97CB, 0x1C03, 0x97D3, 0x0616, 0x97D9, 0x3BB3, 0x97DC, 0x1C04,
- 0x97DE, 0x3BB4, 0x97ED, 0x1C05, 0x97EE, 0x0CD9, 0x97F2, 0x1C07,
- 0x97F3, 0x053B, 0x97F4, 0x3BB5, 0x97F5, 0x1C0A, 0x97F6, 0x1C09,
- 0x97FB, 0x04C6, 0x97FF, 0x06B9, 0x9801, 0x0E17, 0x9802, 0x0BD6,
- 0x9803, 0x0812, 0x9805, 0x07F2, 0x9806, 0x0971, 0x9808, 0x0A22,
- 0x980A, 0x3BB6, 0x980C, 0x1C0C, 0x980E, 0x3BB7, 0x980F, 0x1C0B,
- 0x9810, 0x0F2C, 0x9811, 0x0624, 0x9812, 0x0D66, 0x9813, 0x0CB4,
- 0x9817, 0x0A42, 0x9818, 0x0F96, 0x981A, 0x0731, 0x981E, 0x3BB8,
- 0x9821, 0x1C0F, 0x9823, 0x3BB9, 0x9824, 0x1C0E, 0x982B, 0x3BBA,
- 0x982C, 0x0E79, 0x982D, 0x0C84, 0x9830, 0x1E73, 0x9834, 0x04F2,
- 0x9837, 0x1C10, 0x9838, 0x1C0D, 0x9839, 0x37B3, 0x983B, 0x0DC3,
- 0x983C, 0x0F54, 0x983D, 0x1C11, 0x983E, 0x3BBB, 0x9846, 0x1C12,
- 0x984B, 0x1C14, 0x984C, 0x0B4A, 0x984D, 0x05B9, 0x984E, 0x05BA,
- 0x984F, 0x1C13, 0x9852, 0x3BBC, 0x9853, 0x3BBD, 0x9854, 0x0625,
- 0x9855, 0x0766, 0x9857, 0x21F9, 0x9858, 0x0626, 0x9859, 0x3BBE,
- 0x985A, 0x1E48, 0x985B, 0x0C39, 0x985E, 0x0FA8, 0x9865, 0x21FA,
- 0x9867, 0x0790, 0x986B, 0x1C15, 0x986C, 0x3BBF, 0x986F, 0x1C16,
- 0x9870, 0x1C17, 0x9871, 0x1C18, 0x9873, 0x1C1A, 0x9874, 0x1C19,
- 0x98A8, 0x0DE9, 0x98AA, 0x1C1B, 0x98AF, 0x1C1C, 0x98B1, 0x1C1D,
- 0x98B6, 0x1C1E, 0x98B8, 0x3BC0, 0x98BA, 0x3BC1, 0x98BF, 0x3BC2,
- 0x98C3, 0x1C20, 0x98C4, 0x1C1F, 0x98C6, 0x1C21, 0x98C8, 0x3BC3,
- 0x98DB, 0x0D88, 0x98DC, 0x1839, 0x98DF, 0x09EF, 0x98E0, 0x3618,
- 0x98E2, 0x064C, 0x98E5, 0x3BC4, 0x98E9, 0x1C22, 0x98EB, 0x1C23,
- 0x98ED, 0x10C1, 0x98EE, 0x14DA, 0x98EF, 0x0D67, 0x98F2, 0x04BF,
- 0x98F4, 0x047F, 0x98FC, 0x08C2, 0x98FD, 0x0E5E, 0x98FE, 0x09E6,
- 0x9903, 0x1C24, 0x9905, 0x0EEB, 0x9909, 0x1C25, 0x990A, 0x0F46,
- 0x990C, 0x04E4, 0x9910, 0x088F, 0x9912, 0x1C26, 0x9913, 0x056E,
- 0x9914, 0x1C27, 0x9918, 0x1C28, 0x991D, 0x1C2A, 0x991E, 0x1C2B,
- 0x9920, 0x1C2D, 0x9921, 0x1C29, 0x9924, 0x1C2C, 0x9927, 0x21FD,
- 0x9928, 0x0617, 0x992C, 0x1C2E, 0x992E, 0x1C2F, 0x9932, 0x3BC5,
- 0x9933, 0x3BC6, 0x993D, 0x1C30, 0x993E, 0x1C31, 0x9940, 0x3BC7,
- 0x9942, 0x1C32, 0x9945, 0x1C34, 0x9949, 0x1C33, 0x994B, 0x1C36,
- 0x994C, 0x1C39, 0x994D, 0x3BC8, 0x9950, 0x1C35, 0x9951, 0x1C37,
- 0x9952, 0x1C38, 0x9955, 0x1C3A, 0x9957, 0x06BA, 0x995C, 0x3BC9,
- 0x995F, 0x3BCA, 0x9996, 0x091F, 0x9997, 0x1C3B, 0x9998, 0x1C3C,
- 0x9999, 0x07F3, 0x999E, 0x21FF, 0x99A5, 0x1C3D, 0x99A8, 0x059C,
- 0x99AC, 0x0D05, 0x99AD, 0x1C3E, 0x99AE, 0x1C3F, 0x99B1, 0x3BCB,
- 0x99B3, 0x0B98, 0x99B4, 0x0CC3, 0x99B9, 0x3BCC, 0x99BA, 0x3BCD,
- 0x99BC, 0x1C40, 0x99C1, 0x0D33, 0x99C4, 0x0B2C, 0x99C5, 0x04FA,
- 0x99C6, 0x06E6, 0x99C8, 0x06E7, 0x99C9, 0x3BCE, 0x99D0, 0x0BB1,
- 0x99D1, 0x1C45, 0x99D2, 0x06E8, 0x99D5, 0x056F, 0x99D8, 0x1C44,
- 0x99DB, 0x1C42, 0x99DD, 0x1C43, 0x99DF, 0x1C41, 0x99E2, 0x1C4F,
- 0x99ED, 0x1C46, 0x99EE, 0x1C47, 0x99F1, 0x1C48, 0x99F2, 0x1C49,
- 0x99F8, 0x1C4B, 0x99FB, 0x1C4A, 0x99FF, 0x0963, 0x9A01, 0x1C4C,
- 0x9A02, 0x3BCF, 0x9A05, 0x1C4E, 0x9A08, 0x37BA, 0x9A0E, 0x064D,
- 0x9A0F, 0x1C4D, 0x9A12, 0x0AFD, 0x9A13, 0x0767, 0x9A16, 0x3BD0,
- 0x9A19, 0x1C50, 0x9A24, 0x3BD1, 0x9A27, 0x3BD2, 0x9A28, 0x0B2D,
- 0x9A2B, 0x1C51, 0x9A2D, 0x3BD3, 0x9A2E, 0x3BD4, 0x9A30, 0x0C85,
- 0x9A36, 0x3BD5, 0x9A37, 0x1C52, 0x9A38, 0x3BD6, 0x9A3E, 0x1C57,
- 0x9A40, 0x1C55, 0x9A42, 0x1C54, 0x9A43, 0x1C56, 0x9A45, 0x1C53,
- 0x9A4A, 0x3BD7, 0x9A4D, 0x1C59, 0x9A4E, 0x2200, 0x9A52, 0x1E2F,
- 0x9A55, 0x1C58, 0x9A56, 0x3BD8, 0x9A57, 0x1C5B, 0x9A5A, 0x06BB,
- 0x9A5B, 0x1C5A, 0x9A5F, 0x1C5C, 0x9A62, 0x1C5D, 0x9A64, 0x1C5F,
- 0x9A65, 0x1C5E, 0x9A69, 0x1C60, 0x9A6A, 0x1C62, 0x9A6B, 0x1C61,
- 0x9AA8, 0x080E, 0x9AAD, 0x1C63, 0x9AB0, 0x1C64, 0x9AB5, 0x3BD9,
- 0x9AB6, 0x3BDA, 0x9AB8, 0x059A, 0x9ABC, 0x1C65, 0x9AC0, 0x1C66,
- 0x9AC4, 0x0A37, 0x9ACF, 0x1C67, 0x9AD1, 0x1C68, 0x9AD3, 0x1C69,
- 0x9AD4, 0x1C6A, 0x9AD8, 0x07F4, 0x9AD9, 0x2201, 0x9ADC, 0x2202,
- 0x9ADE, 0x1C6B, 0x9ADF, 0x1C6C, 0x9AE2, 0x1C6D, 0x9AE3, 0x1C6E,
- 0x9AE6, 0x1C6F, 0x9AEA, 0x0D45, 0x9AEB, 0x1C71, 0x9AED, 0x0D98,
- 0x9AEE, 0x1C72, 0x9AEF, 0x1C70, 0x9AF1, 0x1C74, 0x9AF4, 0x1C73,
- 0x9AF7, 0x1C75, 0x9AF9, 0x3BDB, 0x9AFB, 0x1C76, 0x9B03, 0x3BDC,
- 0x9B06, 0x1C77, 0x9B18, 0x1C78, 0x9B1A, 0x1C79, 0x9B1F, 0x1C7A,
- 0x9B20, 0x3BDD, 0x9B22, 0x1C7B, 0x9B23, 0x1C7C, 0x9B25, 0x1C7D,
- 0x9B27, 0x1C7E, 0x9B28, 0x1C7F, 0x9B29, 0x1C80, 0x9B2A, 0x1C81,
- 0x9B2D, 0x343C, 0x9B2E, 0x1C82, 0x9B2F, 0x1C83, 0x9B31, 0x14D4,
- 0x9B32, 0x1C84, 0x9B33, 0x3BDE, 0x9B34, 0x3BDF, 0x9B3B, 0x17A9,
- 0x9B3C, 0x064E, 0x9B41, 0x057F, 0x9B42, 0x0822, 0x9B43, 0x1C86,
- 0x9B44, 0x1C85, 0x9B45, 0x0EB1, 0x9B4D, 0x1C88, 0x9B4E, 0x1C89,
- 0x9B4F, 0x1C87, 0x9B51, 0x1C8A, 0x9B54, 0x0E90, 0x9B58, 0x1C8B,
- 0x9B5A, 0x0695, 0x9B6F, 0x0FCB, 0x9B72, 0x2204, 0x9B73, 0x3BE0,
- 0x9B74, 0x1C8C, 0x9B75, 0x2203, 0x9B79, 0x3BE1, 0x9B83, 0x1C8E,
- 0x9B8E, 0x0482, 0x9B8F, 0x2205, 0x9B91, 0x1C8F, 0x9B92, 0x0DFB,
- 0x9B93, 0x1C8D, 0x9B96, 0x1C90, 0x9B97, 0x1C91, 0x9B9F, 0x1C92,
- 0x9BA0, 0x1C93, 0x9BA7, 0x3BE2, 0x9BA8, 0x1C94, 0x9BAA, 0x0E9C,
- 0x9BAB, 0x087B, 0x9BAD, 0x086A, 0x9BAE, 0x0AB1, 0x9BB1, 0x2206,
- 0x9BB4, 0x1C95, 0x9BB9, 0x1C98, 0x9BBB, 0x2207, 0x9BC0, 0x1C96,
- 0x9BC1, 0x3BE3, 0x9BC6, 0x1C99, 0x9BC7, 0x3BE4, 0x9BC9, 0x07A5,
- 0x9BCA, 0x1C97, 0x9BCF, 0x1C9A, 0x9BD1, 0x1C9B, 0x9BD2, 0x1C9C,
- 0x9BD4, 0x1CA0, 0x9BD6, 0x0878, 0x9BD7, 0x3BE5, 0x9BDB, 0x0B44,
- 0x9BDF, 0x37BF, 0x9BE1, 0x1CA1, 0x9BE2, 0x1C9E, 0x9BE3, 0x1C9D,
- 0x9BE4, 0x1C9F, 0x9BE7, 0x3BE6, 0x9BE8, 0x0735, 0x9BEB, 0x3BE7,
- 0x9BF0, 0x1CA5, 0x9BF1, 0x1CA4, 0x9BF2, 0x1CA3, 0x9BF5, 0x0477,
- 0x9BF7, 0x3BE8, 0x9BFA, 0x3BE9, 0x9BFD, 0x3BEA, 0x9C00, 0x2208,
- 0x9C04, 0x1CAF, 0x9C06, 0x1CAB, 0x9C08, 0x1CAC, 0x9C09, 0x1CA8,
- 0x9C0A, 0x1CAE, 0x9C0B, 0x3BEB, 0x9C0C, 0x1CAA, 0x9C0D, 0x05C0,
- 0x9C10, 0x0FF2, 0x9C12, 0x1CAD, 0x9C13, 0x1CA9, 0x9C14, 0x1CA7,
- 0x9C15, 0x1CA6, 0x9C1B, 0x1CB1, 0x9C21, 0x1CB4, 0x9C24, 0x1CB3,
- 0x9C25, 0x1CB2, 0x9C27, 0x3BEC, 0x9C2A, 0x3BED, 0x9C2D, 0x0DBB,
- 0x9C2E, 0x1CB0, 0x9C2F, 0x04B7, 0x9C30, 0x1CB5, 0x9C32, 0x1CB7,
- 0x9C36, 0x3BEE, 0x9C39, 0x05CD, 0x9C3A, 0x1CA2, 0x9C3B, 0x04D9,
- 0x9C3E, 0x1CB9, 0x9C41, 0x3BEF, 0x9C46, 0x1CB8, 0x9C47, 0x1CB6,
- 0x9C48, 0x0B6B, 0x9C52, 0x0E9E, 0x9C53, 0x3BF0, 0x9C57, 0x0FA2,
- 0x9C5A, 0x1CBA, 0x9C60, 0x1CBB, 0x9C63, 0x3BF1, 0x9C67, 0x1CBC,
- 0x9C6A, 0x3BF2, 0x9C76, 0x1CBD, 0x9C77, 0x3BF3, 0x9C78, 0x1CBE,
- 0x9CE5, 0x0BD7, 0x9CE7, 0x1CBF, 0x9CE9, 0x0D4B, 0x9CEB, 0x1CC4,
- 0x9CEC, 0x1CC0, 0x9CF0, 0x1CC1, 0x9CF3, 0x0E5F, 0x9CF4, 0x0ED0,
- 0x9CF6, 0x0CA8, 0x9D02, 0x3BF4, 0x9D03, 0x1CC5, 0x9D06, 0x1CC6,
- 0x9D07, 0x0C96, 0x9D08, 0x1CC3, 0x9D09, 0x1CC2, 0x9D0E, 0x052A,
- 0x9D12, 0x1CCE, 0x9D15, 0x1CCD, 0x9D1B, 0x0517, 0x9D1F, 0x1CCB,
- 0x9D23, 0x1CCA, 0x9D26, 0x1CC8, 0x9D28, 0x05D9, 0x9D2A, 0x1CC7,
- 0x9D2B, 0x08DE, 0x9D2C, 0x0529, 0x9D3B, 0x07F5, 0x9D3E, 0x1CD1,
- 0x9D3F, 0x1CD0, 0x9D41, 0x1CCF, 0x9D42, 0x3BF5, 0x9D44, 0x1CCC,
- 0x9D46, 0x1CD2, 0x9D47, 0x3BF6, 0x9D48, 0x1CD3, 0x9D50, 0x1CD8,
- 0x9D51, 0x1CD7, 0x9D59, 0x1CD9, 0x9D5C, 0x04CF, 0x9D5D, 0x1CD4,
- 0x9D5E, 0x1CD5, 0x9D60, 0x0806, 0x9D61, 0x0EC5, 0x9D63, 0x3BF7,
- 0x9D64, 0x1CD6, 0x9D69, 0x3BF8, 0x9D6B, 0x220A, 0x9D6C, 0x0E60,
- 0x9D6F, 0x1CDE, 0x9D70, 0x2209, 0x9D72, 0x1CDA, 0x9D7A, 0x1CDF,
- 0x9D7C, 0x3BF9, 0x9D7E, 0x3BFA, 0x9D87, 0x1CDC, 0x9D89, 0x1CDB,
- 0x9D8D, 0x3BFB, 0x9D8F, 0x0732, 0x9D9A, 0x1CE0, 0x9DA4, 0x1CE1,
- 0x9DA9, 0x1CE2, 0x9DAB, 0x1CDD, 0x9DAF, 0x1CC9, 0x9DB1, 0x3BFC,
- 0x9DB2, 0x1CE3, 0x9DB4, 0x0BFD, 0x9DB8, 0x1CE7, 0x9DBA, 0x1CE8,
- 0x9DBB, 0x1CE6, 0x9DC1, 0x1CE5, 0x9DC2, 0x1CEB, 0x9DC3, 0x3BFD,
- 0x9DC4, 0x1CE4, 0x9DC6, 0x1CE9, 0x9DC7, 0x3BFE, 0x9DCF, 0x1CEA,
- 0x9DD3, 0x1CED, 0x9DD6, 0x3BFF, 0x9DD7, 0x1DDE, 0x9DD9, 0x1CEC,
- 0x9DDF, 0x3C00, 0x9DE6, 0x1CEF, 0x9DEB, 0x3C01, 0x9DED, 0x1CF0,
- 0x9DEF, 0x1CF1, 0x9DF2, 0x0FEF, 0x9DF4, 0x3C02, 0x9DF8, 0x1CEE,
- 0x9DF9, 0x0B4B, 0x9DFA, 0x085D, 0x9DFD, 0x1CF2, 0x9E15, 0x3C03,
- 0x9E19, 0x220C, 0x9E1A, 0x1CF3, 0x9E1B, 0x1CF4, 0x9E1D, 0x3C04,
- 0x9E1E, 0x1CF5, 0x9E75, 0x1CF6, 0x9E78, 0x0768, 0x9E79, 0x1CF7,
- 0x9E7C, 0x1DFD, 0x9E7D, 0x1CF8, 0x9E7F, 0x08DB, 0x9E81, 0x1CF9,
- 0x9E88, 0x1CFA, 0x9E8B, 0x1CFB, 0x9E8C, 0x1CFC, 0x9E91, 0x1CFF,
- 0x9E92, 0x1CFD, 0x9E93, 0x0FE2, 0x9E95, 0x1CFE, 0x9E97, 0x0FB7,
- 0x9E9D, 0x1D00, 0x9E9F, 0x0FA3, 0x9EA4, 0x3C05, 0x9EA5, 0x1D01,
- 0x9EA6, 0x0D34, 0x9EA8, 0x3C06, 0x9EA9, 0x1D02, 0x9EAA, 0x1D04,
- 0x9EAC, 0x3C07, 0x9EAD, 0x1D05, 0x9EB4, 0x1E02, 0x9EB5, 0x1E75,
- 0x9EB8, 0x1D03, 0x9EB9, 0x07FF, 0x9EBA, 0x0ED9, 0x9EBB, 0x0E91,
- 0x9EBC, 0x1284, 0x9EBE, 0x14FF, 0x9EBF, 0x0EA9, 0x9EC3, 0x340B,
- 0x9EC4, 0x052B, 0x9ECC, 0x1D07, 0x9ECD, 0x066A, 0x9ECE, 0x1D08,
- 0x9ECF, 0x1D09, 0x9ED0, 0x1D0A, 0x9ED1, 0x220D, 0x9ED2, 0x0807,
- 0x9ED4, 0x1D0B, 0x9ED8, 0x160D, 0x9ED9, 0x0EE7, 0x9EDB, 0x0B43,
- 0x9EDC, 0x1D0C, 0x9EDD, 0x1D0E, 0x9EDE, 0x1D0D, 0x9EE0, 0x1D0F,
- 0x9EE5, 0x1D10, 0x9EE7, 0x3C08, 0x9EE8, 0x1D11, 0x9EEE, 0x3C09,
- 0x9EEF, 0x1D12, 0x9EF4, 0x1D13, 0x9EF6, 0x1D14, 0x9EF7, 0x1D15,
- 0x9EF9, 0x1D16, 0x9EFB, 0x1D17, 0x9EFC, 0x1D18, 0x9EFD, 0x1D19,
- 0x9F07, 0x1D1A, 0x9F08, 0x1D1B, 0x9F0E, 0x0C1E, 0x9F10, 0x3C0A,
- 0x9F12, 0x3C0B, 0x9F13, 0x0791, 0x9F15, 0x1D1D, 0x9F17, 0x3C0C,
- 0x9F19, 0x3C0D, 0x9F20, 0x0ACF, 0x9F21, 0x1D1E, 0x9F2C, 0x1D1F,
- 0x9F2F, 0x3C0E, 0x9F37, 0x3C0F, 0x9F39, 0x3C10, 0x9F3B, 0x0D93,
- 0x9F3E, 0x1D20, 0x9F41, 0x3C11, 0x9F45, 0x3C12, 0x9F4A, 0x1D21,
- 0x9F4B, 0x170A, 0x9F4E, 0x1A7B, 0x9F4F, 0x1C06, 0x9F52, 0x1D22,
- 0x9F54, 0x1D23, 0x9F57, 0x3C13, 0x9F5F, 0x1D25, 0x9F60, 0x1D26,
- 0x9F61, 0x1D27, 0x9F62, 0x0FB8, 0x9F63, 0x1D24, 0x9F66, 0x1D28,
- 0x9F67, 0x1D29, 0x9F68, 0x3C14, 0x9F6A, 0x1D2B, 0x9F6C, 0x1D2A,
- 0x9F71, 0x3C15, 0x9F72, 0x1D2D, 0x9F75, 0x3C16, 0x9F76, 0x1D2E,
- 0x9F77, 0x1D2C, 0x9F8D, 0x0F7E, 0x9F90, 0x3C17, 0x9F94, 0x3C18,
- 0x9F95, 0x1D2F, 0x9F9C, 0x1D30, 0x9F9D, 0x1727, 0x9FA0, 0x1D31,
- 0x9FA2, 0x3C19, 0xF929, 0x2129, 0xF9DC, 0x21EE, 0xFA0E, 0x20DA,
- 0xFA0F, 0x20E5, 0xFA10, 0x20E6, 0xFA11, 0x20FB, 0xFA12, 0x2121,
- 0xFA13, 0x2131, 0xFA14, 0x2133, 0xFA15, 0x215E, 0xFA16, 0x2164,
- 0xFA17, 0x217B, 0xFA18, 0x2183, 0xFA19, 0x2184, 0xFA1A, 0x2185,
- 0xFA1B, 0x2187, 0xFA1C, 0x218B, 0xFA1D, 0x218E, 0xFA1E, 0x2197,
- 0xFA1F, 0x21A2, 0xFA20, 0x21A4, 0xFA21, 0x21A5, 0xFA22, 0x21AE,
- 0xFA23, 0x21B6, 0xFA24, 0x21B8, 0xFA25, 0x21B9, 0xFA26, 0x21BC,
- 0xFA27, 0x21D8, 0xFA28, 0x21DF, 0xFA29, 0x21EF, 0xFA2A, 0x21FB,
- 0xFA2B, 0x21FC, 0xFA2C, 0x21FE, 0xFA2D, 0x220B, 0xFB00, 0x248E,
- 0xFB01, 0x0070, 0xFB02, 0x0071, 0xFB03, 0x248F, 0xFB04, 0x2490,
- 0xFE30, 0x1EDA, 0xFE31, 0x1ED4, 0xFE32, 0x1ED5, 0xFE33, 0x1ED2,
- 0xFE35, 0x1EDB, 0xFE36, 0x1EDC, 0xFE37, 0x1EE1, 0xFE38, 0x1EE2,
- 0xFE39, 0x1EDD, 0xFE3A, 0x1EDE, 0xFE3B, 0x1EEB, 0xFE3C, 0x1EEC,
- 0xFE3D, 0x1EE5, 0xFE3E, 0x1EE6, 0xFE3F, 0x1EE3, 0xFE40, 0x1EE4,
- 0xFE41, 0x1EE7, 0xFE42, 0x1EE8, 0xFE43, 0x1EE9, 0xFE44, 0x1EEA,
- 0xFF01, 0x0282, 0xFF02, 0x1F47, 0xFF03, 0x02CC, 0xFF04, 0x02C8,
- 0xFF05, 0x02CB, 0xFF06, 0x02CD, 0xFF07, 0x1F46, 0xFF08, 0x02A2,
- 0xFF09, 0x02A3, 0xFF0A, 0x02CE, 0xFF0B, 0x02B4, 0xFF0C, 0x027C,
- 0xFF0D, 0x02B5, 0xFF0E, 0x027D, 0xFF0F, 0x0297, 0xFF10, 0x030C,
- 0xFF11, 0x030D, 0xFF12, 0x030E, 0xFF13, 0x030F, 0xFF14, 0x0310,
- 0xFF15, 0x0311, 0xFF16, 0x0312, 0xFF17, 0x0313, 0xFF18, 0x0314,
- 0xFF19, 0x0315, 0xFF1A, 0x027F, 0xFF1B, 0x0280, 0xFF1C, 0x02BB,
- 0xFF1D, 0x02B9, 0xFF1E, 0x02BC, 0xFF1F, 0x0281, 0xFF20, 0x02CF,
- 0xFF21, 0x0316, 0xFF22, 0x0317, 0xFF23, 0x0318, 0xFF24, 0x0319,
- 0xFF25, 0x031A, 0xFF26, 0x031B, 0xFF27, 0x031C, 0xFF28, 0x031D,
- 0xFF29, 0x031E, 0xFF2A, 0x031F, 0xFF2B, 0x0320, 0xFF2C, 0x0321,
- 0xFF2D, 0x0322, 0xFF2E, 0x0323, 0xFF2F, 0x0324, 0xFF30, 0x0325,
- 0xFF31, 0x0326, 0xFF32, 0x0327, 0xFF33, 0x0328, 0xFF34, 0x0329,
- 0xFF35, 0x032A, 0xFF36, 0x032B, 0xFF37, 0x032C, 0xFF38, 0x032D,
- 0xFF39, 0x032E, 0xFF3A, 0x032F, 0xFF3B, 0x02A6, 0xFF3C, 0x0298,
- 0xFF3D, 0x02A7, 0xFF3E, 0x0288, 0xFF3F, 0x028A, 0xFF40, 0x0286,
- 0xFF41, 0x0330, 0xFF42, 0x0331, 0xFF43, 0x0332, 0xFF44, 0x0333,
- 0xFF45, 0x0334, 0xFF46, 0x0335, 0xFF47, 0x0336, 0xFF48, 0x0337,
- 0xFF49, 0x0338, 0xFF4A, 0x0339, 0xFF4B, 0x033A, 0xFF4C, 0x033B,
- 0xFF4D, 0x033C, 0xFF4E, 0x033D, 0xFF4F, 0x033E, 0xFF50, 0x033F,
- 0xFF51, 0x0340, 0xFF52, 0x0341, 0xFF53, 0x0342, 0xFF54, 0x0343,
- 0xFF55, 0x0344, 0xFF56, 0x0345, 0xFF57, 0x0346, 0xFF58, 0x0347,
- 0xFF59, 0x0348, 0xFF5A, 0x0349, 0xFF5B, 0x02A8, 0xFF5C, 0x029B,
- 0xFF5D, 0x02A9, 0xFF5E, 0x0299, 0xFF61, 0x0147, 0xFF62, 0x0148,
- 0xFF63, 0x0149, 0xFF64, 0x014A, 0xFF65, 0x014B, 0xFF66, 0x014C,
- 0xFF67, 0x014D, 0xFF68, 0x014E, 0xFF69, 0x014F, 0xFF6A, 0x0150,
- 0xFF6B, 0x0151, 0xFF6C, 0x0152, 0xFF6D, 0x0153, 0xFF6E, 0x0154,
- 0xFF6F, 0x0155, 0xFF70, 0x0156, 0xFF71, 0x0157, 0xFF72, 0x0158,
- 0xFF73, 0x0159, 0xFF74, 0x015A, 0xFF75, 0x015B, 0xFF76, 0x015C,
- 0xFF77, 0x015D, 0xFF78, 0x015E, 0xFF79, 0x015F, 0xFF7A, 0x0160,
- 0xFF7B, 0x0161, 0xFF7C, 0x0162, 0xFF7D, 0x0163, 0xFF7E, 0x0164,
- 0xFF7F, 0x0165, 0xFF80, 0x0166, 0xFF81, 0x0167, 0xFF82, 0x0168,
- 0xFF83, 0x0169, 0xFF84, 0x016A, 0xFF85, 0x016B, 0xFF86, 0x016C,
- 0xFF87, 0x016D, 0xFF88, 0x016E, 0xFF89, 0x016F, 0xFF8A, 0x0170,
- 0xFF8B, 0x0171, 0xFF8C, 0x0172, 0xFF8D, 0x0173, 0xFF8E, 0x0174,
- 0xFF8F, 0x0175, 0xFF90, 0x0176, 0xFF91, 0x0177, 0xFF92, 0x0178,
- 0xFF93, 0x0179, 0xFF94, 0x017A, 0xFF95, 0x017B, 0xFF96, 0x017C,
- 0xFF97, 0x017D, 0xFF98, 0x017E, 0xFF99, 0x017F, 0xFF9A, 0x0180,
- 0xFF9B, 0x0181, 0xFF9C, 0x0182, 0xFF9D, 0x0183, 0xFF9E, 0x0184,
- 0xFF9F, 0x0185, 0xFFE0, 0x02C9, 0xFFE1, 0x02CA, 0xFFE2, 0x02EF,
- 0xFFE3, 0x0289, 0xFFE4, 0x1F45, 0xFFE5, 0x02C7, 0xFFE8, 0x0143,
-};
+// 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
+
+extern const unsigned short g_FXCMAP_UniJIS_UCS2_H_4[9772 * 2] = {
+ 0x0020, 0x0001, 0x0021, 0x0002, 0x0022, 0x0003, 0x0023, 0x0004,
+ 0x0024, 0x0005, 0x0025, 0x0006, 0x0026, 0x0007, 0x0027, 0x0008,
+ 0x0028, 0x0009, 0x0029, 0x000A, 0x002A, 0x000B, 0x002B, 0x000C,
+ 0x002C, 0x000D, 0x002D, 0x000E, 0x002E, 0x000F, 0x002F, 0x0010,
+ 0x0030, 0x0011, 0x0031, 0x0012, 0x0032, 0x0013, 0x0033, 0x0014,
+ 0x0034, 0x0015, 0x0035, 0x0016, 0x0036, 0x0017, 0x0037, 0x0018,
+ 0x0038, 0x0019, 0x0039, 0x001A, 0x003A, 0x001B, 0x003B, 0x001C,
+ 0x003C, 0x001D, 0x003D, 0x001E, 0x003E, 0x001F, 0x003F, 0x0020,
+ 0x0040, 0x0021, 0x0041, 0x0022, 0x0042, 0x0023, 0x0043, 0x0024,
+ 0x0044, 0x0025, 0x0045, 0x0026, 0x0046, 0x0027, 0x0047, 0x0028,
+ 0x0048, 0x0029, 0x0049, 0x002A, 0x004A, 0x002B, 0x004B, 0x002C,
+ 0x004C, 0x002D, 0x004D, 0x002E, 0x004E, 0x002F, 0x004F, 0x0030,
+ 0x0050, 0x0031, 0x0051, 0x0032, 0x0052, 0x0033, 0x0053, 0x0034,
+ 0x0054, 0x0035, 0x0055, 0x0036, 0x0056, 0x0037, 0x0057, 0x0038,
+ 0x0058, 0x0039, 0x0059, 0x003A, 0x005A, 0x003B, 0x005B, 0x003C,
+ 0x005C, 0x0061, 0x005D, 0x003E, 0x005E, 0x003F, 0x005F, 0x0040,
+ 0x0060, 0x0041, 0x0061, 0x0042, 0x0062, 0x0043, 0x0063, 0x0044,
+ 0x0064, 0x0045, 0x0065, 0x0046, 0x0066, 0x0047, 0x0067, 0x0048,
+ 0x0068, 0x0049, 0x0069, 0x004A, 0x006A, 0x004B, 0x006B, 0x004C,
+ 0x006C, 0x004D, 0x006D, 0x004E, 0x006E, 0x004F, 0x006F, 0x0050,
+ 0x0070, 0x0051, 0x0071, 0x0052, 0x0072, 0x0053, 0x0073, 0x0054,
+ 0x0074, 0x0055, 0x0075, 0x0056, 0x0076, 0x0057, 0x0077, 0x0058,
+ 0x0078, 0x0059, 0x0079, 0x005A, 0x007A, 0x005B, 0x007B, 0x005C,
+ 0x007C, 0x005D, 0x007D, 0x005E, 0x007E, 0x005F, 0x00A1, 0x0065,
+ 0x00A2, 0x0066, 0x00A3, 0x0067, 0x00A4, 0x006B, 0x00A5, 0x003D,
+ 0x00A6, 0x0063, 0x00A7, 0x02D0, 0x00A8, 0x0287, 0x00A9, 0x0098,
+ 0x00AA, 0x008C, 0x00AB, 0x006D, 0x00AC, 0x0099, 0x00AD, 0x0097,
+ 0x00AE, 0x009A, 0x00AF, 0x0081, 0x00B0, 0x02C3, 0x00B1, 0x02B6,
+ 0x00B2, 0x009D, 0x00B3, 0x009E, 0x00B4, 0x0285, 0x00B5, 0x009F,
+ 0x00B6, 0x030A, 0x00B7, 0x0075, 0x00B8, 0x0086, 0x00B9, 0x00A0,
+ 0x00BA, 0x0090, 0x00BB, 0x007B, 0x00BC, 0x00A1, 0x00BD, 0x00A2,
+ 0x00BE, 0x00A3, 0x00BF, 0x007E, 0x00C0, 0x00A4, 0x00C1, 0x00A5,
+ 0x00C2, 0x00A6, 0x00C3, 0x00A7, 0x00C4, 0x00A8, 0x00C5, 0x00A9,
+ 0x00C6, 0x008B, 0x00C7, 0x00AA, 0x00C8, 0x00AB, 0x00C9, 0x00AC,
+ 0x00CA, 0x00AD, 0x00CB, 0x00AE, 0x00CC, 0x00AF, 0x00CD, 0x00B0,
+ 0x00CE, 0x00B1, 0x00CF, 0x00B2, 0x00D0, 0x00B3, 0x00D1, 0x00B4,
+ 0x00D2, 0x00B5, 0x00D3, 0x00B6, 0x00D4, 0x00B7, 0x00D5, 0x00B8,
+ 0x00D6, 0x00B9, 0x00D7, 0x02B7, 0x00D8, 0x008E, 0x00D9, 0x00BB,
+ 0x00DA, 0x00BC, 0x00DB, 0x00BD, 0x00DC, 0x00BE, 0x00DD, 0x00BF,
+ 0x00DE, 0x00C0, 0x00DF, 0x0096, 0x00E0, 0x00C1, 0x00E1, 0x00C2,
+ 0x00E2, 0x00C3, 0x00E3, 0x00C4, 0x00E4, 0x00C5, 0x00E5, 0x00C6,
+ 0x00E6, 0x0091, 0x00E7, 0x00C7, 0x00E8, 0x00C8, 0x00E9, 0x00C9,
+ 0x00EA, 0x00CA, 0x00EB, 0x00CB, 0x00EC, 0x00CC, 0x00ED, 0x00CD,
+ 0x00EE, 0x00CE, 0x00EF, 0x00CF, 0x00F0, 0x00D0, 0x00F1, 0x00D1,
+ 0x00F2, 0x00D2, 0x00F3, 0x00D3, 0x00F4, 0x00D4, 0x00F5, 0x00D5,
+ 0x00F6, 0x00D6, 0x00F7, 0x02B8, 0x00F8, 0x0094, 0x00F9, 0x00D8,
+ 0x00FA, 0x00D9, 0x00FB, 0x00DA, 0x00FC, 0x00DB, 0x00FD, 0x00DC,
+ 0x00FE, 0x00DD, 0x00FF, 0x00DE, 0x0100, 0x2496, 0x0101, 0x2491,
+ 0x0112, 0x2499, 0x0113, 0x2494, 0x011A, 0x24B3, 0x011B, 0x24BF,
+ 0x0127, 0x2F3C, 0x0128, 0x24B8, 0x0129, 0x24C4, 0x012A, 0x2497,
+ 0x012B, 0x2492, 0x0131, 0x0092, 0x0141, 0x008D, 0x0142, 0x0093,
+ 0x014B, 0x24DC, 0x014C, 0x249A, 0x014D, 0x2495, 0x0152, 0x008F,
+ 0x0153, 0x0095, 0x0160, 0x00DF, 0x0161, 0x00E3, 0x0168, 0x24BD,
+ 0x0169, 0x24C9, 0x016A, 0x2498, 0x016B, 0x2493, 0x016E, 0x24BC,
+ 0x016F, 0x24C8, 0x0178, 0x00E0, 0x017D, 0x00E1, 0x017E, 0x00E5,
+ 0x01C0, 0x0063, 0x01CD, 0x24B2, 0x01CE, 0x24BE, 0x01CF, 0x24B6,
+ 0x01D0, 0x24C2, 0x01D1, 0x24B9, 0x01D2, 0x24C5, 0x01D3, 0x24BB,
+ 0x01D4, 0x24C7, 0x01FD, 0x24CD, 0x0251, 0x24CA, 0x0254, 0x24CF,
+ 0x0259, 0x24D2, 0x025A, 0x24D5, 0x025B, 0x24D8, 0x0275, 0x24DD,
+ 0x0283, 0x24E2, 0x028C, 0x24DE, 0x0292, 0x24E1, 0x02D0, 0x24E3,
+ 0x0300, 0x0041, 0x0301, 0x007F, 0x0302, 0x0080, 0x0303, 0x005F,
+ 0x0304, 0x0081, 0x0305, 0x00E2, 0x0306, 0x0082, 0x0307, 0x0083,
+ 0x0308, 0x0084, 0x030A, 0x0085, 0x030B, 0x0087, 0x030C, 0x0089,
+ 0x0327, 0x0086, 0x0328, 0x0088, 0x0332, 0x0040, 0x0336, 0x008A,
+ 0x0361, 0x02F6, 0x0391, 0x03F3, 0x0392, 0x03F4, 0x0393, 0x03F5,
+ 0x0394, 0x03F6, 0x0395, 0x03F7, 0x0396, 0x03F8, 0x0397, 0x03F9,
+ 0x0398, 0x03FA, 0x0399, 0x03FB, 0x039A, 0x03FC, 0x039B, 0x03FD,
+ 0x039C, 0x03FE, 0x039D, 0x03FF, 0x039E, 0x0400, 0x039F, 0x0401,
+ 0x03A0, 0x0402, 0x03A1, 0x0403, 0x03A3, 0x0404, 0x03A4, 0x0405,
+ 0x03A5, 0x0406, 0x03A6, 0x0407, 0x03A7, 0x0408, 0x03A8, 0x0409,
+ 0x03A9, 0x040A, 0x03B1, 0x040B, 0x03B2, 0x040C, 0x03B3, 0x040D,
+ 0x03B4, 0x040E, 0x03B5, 0x040F, 0x03B6, 0x0410, 0x03B7, 0x0411,
+ 0x03B8, 0x0412, 0x03B9, 0x0413, 0x03BA, 0x0414, 0x03BB, 0x0415,
+ 0x03BC, 0x0416, 0x03BD, 0x0417, 0x03BE, 0x0418, 0x03BF, 0x0419,
+ 0x03C0, 0x041A, 0x03C1, 0x041B, 0x03C3, 0x041C, 0x03C4, 0x041D,
+ 0x03C5, 0x041E, 0x03C6, 0x041F, 0x03C7, 0x0420, 0x03C8, 0x0421,
+ 0x03C9, 0x0422, 0x03D0, 0x2F3A, 0x03D1, 0x2F40, 0x03DB, 0x2F3F,
+ 0x0401, 0x0429, 0x0410, 0x0423, 0x0411, 0x0424, 0x0412, 0x0425,
+ 0x0413, 0x0426, 0x0414, 0x0427, 0x0415, 0x0428, 0x0416, 0x042A,
+ 0x0417, 0x042B, 0x0418, 0x042C, 0x0419, 0x042D, 0x041A, 0x042E,
+ 0x041B, 0x042F, 0x041C, 0x0430, 0x041D, 0x0431, 0x041E, 0x0432,
+ 0x041F, 0x0433, 0x0420, 0x0434, 0x0421, 0x0435, 0x0422, 0x0436,
+ 0x0423, 0x0437, 0x0424, 0x0438, 0x0425, 0x0439, 0x0426, 0x043A,
+ 0x0427, 0x043B, 0x0428, 0x043C, 0x0429, 0x043D, 0x042A, 0x043E,
+ 0x042B, 0x043F, 0x042C, 0x0440, 0x042D, 0x0441, 0x042E, 0x0442,
+ 0x042F, 0x0443, 0x0430, 0x0444, 0x0431, 0x0445, 0x0432, 0x0446,
+ 0x0433, 0x0447, 0x0434, 0x0448, 0x0435, 0x0449, 0x0436, 0x044B,
+ 0x0437, 0x044C, 0x0438, 0x044D, 0x0439, 0x044E, 0x043A, 0x044F,
+ 0x043B, 0x0450, 0x043C, 0x0451, 0x043D, 0x0452, 0x043E, 0x0453,
+ 0x043F, 0x0454, 0x0440, 0x0455, 0x0441, 0x0456, 0x0442, 0x0457,
+ 0x0443, 0x0458, 0x0444, 0x0459, 0x0445, 0x045A, 0x0446, 0x045B,
+ 0x0447, 0x045C, 0x0448, 0x045D, 0x0449, 0x045E, 0x044A, 0x045F,
+ 0x044B, 0x0460, 0x044C, 0x0461, 0x044D, 0x0462, 0x044E, 0x0463,
+ 0x044F, 0x0464, 0x0451, 0x044A, 0x045B, 0x2F3C, 0x1EBC, 0x24B5,
+ 0x1EBD, 0x24C1, 0x2002, 0x00E7, 0x2003, 0x0279, 0x2010, 0x0296,
+ 0x2011, 0x000E, 0x2012, 0x0072, 0x2013, 0x0072, 0x2014, 0x008A,
+ 0x2015, 0x0295, 0x2016, 0x029A, 0x2018, 0x029E, 0x2019, 0x029F,
+ 0x201A, 0x0078, 0x201C, 0x02A0, 0x201D, 0x02A1, 0x201E, 0x0079,
+ 0x2020, 0x0308, 0x2021, 0x0309, 0x2022, 0x0077, 0x2025, 0x029D,
+ 0x2026, 0x029C, 0x2030, 0x0304, 0x2032, 0x02C4, 0x2033, 0x02C5,
+ 0x2039, 0x006E, 0x203A, 0x006F, 0x203B, 0x02DE, 0x203C, 0x2F4F,
+ 0x203E, 0x0145, 0x2044, 0x0068, 0x2049, 0x2F50, 0x2070, 0x24A1,
+ 0x2074, 0x24A2, 0x2075, 0x24A3, 0x2076, 0x24A4, 0x2077, 0x24A5,
+ 0x2078, 0x24A6, 0x2079, 0x24A7, 0x2080, 0x24A8, 0x2081, 0x24A9,
+ 0x2082, 0x24AA, 0x2083, 0x24AB, 0x2084, 0x24AC, 0x2085, 0x24AD,
+ 0x2086, 0x24AE, 0x2087, 0x24AF, 0x2088, 0x24B0, 0x2089, 0x24B1,
+ 0x20AC, 0x248A, 0x20DD, 0x030B, 0x2100, 0x2E4F, 0x2103, 0x02C6,
+ 0x2105, 0x2E53, 0x2109, 0x2071, 0x210A, 0x2070, 0x210F, 0x2F3C,
+ 0x2113, 0x1F59, 0x2116, 0x1DBA, 0x2121, 0x1F77, 0x2122, 0x00E4,
+ 0x2126, 0x248B, 0x212B, 0x0303, 0x2135, 0x2F39, 0x2153, 0x249F,
+ 0x2154, 0x24A0, 0x215B, 0x249B, 0x215C, 0x249C, 0x215D, 0x249D,
+ 0x215E, 0x249E, 0x2160, 0x1D97, 0x2161, 0x1D98, 0x2162, 0x1D99,
+ 0x2163, 0x1D9A, 0x2164, 0x1D9B, 0x2165, 0x1D9C, 0x2166, 0x1D9D,
+ 0x2167, 0x1D9E, 0x2168, 0x1D9F, 0x2169, 0x1DA0, 0x216A, 0x2021,
+ 0x216B, 0x2022, 0x2170, 0x1F9C, 0x2171, 0x1F9D, 0x2172, 0x1F9E,
+ 0x2173, 0x1F9F, 0x2174, 0x1FA0, 0x2175, 0x1FA1, 0x2176, 0x1FA2,
+ 0x2177, 0x1FA3, 0x2178, 0x1FA4, 0x2179, 0x1FA5, 0x217A, 0x206A,
+ 0x217B, 0x206B, 0x217F, 0x206F, 0x2190, 0x02E1, 0x2191, 0x02E2,
+ 0x2192, 0x02E0, 0x2193, 0x02E3, 0x2194, 0x2FA9, 0x2195, 0x2FB7,
+ 0x2196, 0x2FAC, 0x2197, 0x2FAD, 0x2198, 0x2FAA, 0x2199, 0x2FAB,
+ 0x21C4, 0x2076, 0x21C5, 0x2077, 0x21C6, 0x2075, 0x21CC, 0x2FAE,
+ 0x21D0, 0x2FA8, 0x21D2, 0x02F0, 0x21D4, 0x02F1, 0x21E6, 0x1F4D,
+ 0x21E7, 0x1F4C, 0x21E8, 0x1F4E, 0x21E9, 0x1F4B, 0x2200, 0x02F2,
+ 0x2202, 0x02F7, 0x2203, 0x02F3, 0x2205, 0x2F98, 0x2207, 0x02F8,
+ 0x2208, 0x02E5, 0x220A, 0x2F3B, 0x220B, 0x02E6, 0x2211, 0x1DC9,
+ 0x2212, 0x02B5, 0x2213, 0x2F56, 0x221A, 0x02FD, 0x221D, 0x02FF,
+ 0x221E, 0x02BF, 0x221F, 0x1DCD, 0x2220, 0x02F4, 0x2225, 0x029A,
+ 0x2227, 0x02ED, 0x2228, 0x02EE, 0x2229, 0x02EC, 0x222A, 0x02EB,
+ 0x222B, 0x0301, 0x222C, 0x0302, 0x222D, 0x2003, 0x222E, 0x1DC8,
+ 0x2234, 0x02C0, 0x2235, 0x0300, 0x223C, 0x0299, 0x223D, 0x02FE,
+ 0x2243, 0x2F58, 0x2252, 0x02FA, 0x2260, 0x02BA, 0x2261, 0x02F9,
+ 0x2266, 0x02BD, 0x2267, 0x02BE, 0x226A, 0x02FB, 0x226B, 0x02FC,
+ 0x2272, 0x2F59, 0x2273, 0x2F5A, 0x2282, 0x02E9, 0x2283, 0x02EA,
+ 0x2286, 0x02E7, 0x2287, 0x02E8, 0x2295, 0x2F9C, 0x2296, 0x2F9A,
+ 0x2297, 0x2F9D, 0x2298, 0x2F9B, 0x229D, 0x2F9A, 0x229E, 0x2F9E,
+ 0x22A0, 0x2F99, 0x22A5, 0x02F5, 0x22BF, 0x1DCE, 0x22EE, 0x1ED9,
+ 0x22EF, 0x029C, 0x2300, 0x2F98, 0x2307, 0x2FBB, 0x2312, 0x02F6,
+ 0x244A, 0x2F54, 0x2460, 0x1D83, 0x2461, 0x1D84, 0x2462, 0x1D85,
+ 0x2463, 0x1D86, 0x2464, 0x1D87, 0x2465, 0x1D88, 0x2466, 0x1D89,
+ 0x2467, 0x1D8A, 0x2468, 0x1D8B, 0x2469, 0x1D8C, 0x246A, 0x1D8D,
+ 0x246B, 0x1D8E, 0x246C, 0x1D8F, 0x246D, 0x1D90, 0x246E, 0x1D91,
+ 0x246F, 0x1D92, 0x2470, 0x1D93, 0x2471, 0x1D94, 0x2472, 0x1D95,
+ 0x2473, 0x1D96, 0x2474, 0x1F87, 0x2475, 0x1F88, 0x2476, 0x1F89,
+ 0x2477, 0x1F8A, 0x2478, 0x1F8B, 0x2479, 0x1F8C, 0x247A, 0x1F8D,
+ 0x247B, 0x1F8E, 0x247C, 0x1F8F, 0x247D, 0x1F90, 0x247E, 0x1F91,
+ 0x247F, 0x1F92, 0x2480, 0x1F93, 0x2481, 0x1F94, 0x2482, 0x1F95,
+ 0x2483, 0x1F96, 0x2484, 0x1F97, 0x2485, 0x1F98, 0x2486, 0x1F99,
+ 0x2487, 0x1F9A, 0x2488, 0x1F7E, 0x2489, 0x1F7F, 0x248A, 0x1F80,
+ 0x248B, 0x1F81, 0x248C, 0x1F82, 0x248D, 0x1F83, 0x248E, 0x1F84,
+ 0x248F, 0x1F85, 0x2490, 0x1F86, 0x249C, 0x1FB0, 0x249D, 0x1FB1,
+ 0x249E, 0x1FB2, 0x249F, 0x1FB3, 0x24A0, 0x1FB4, 0x24A1, 0x1FB5,
+ 0x24A2, 0x1FB6, 0x24A3, 0x1FB7, 0x24A4, 0x1FB8, 0x24A5, 0x1FB9,
+ 0x24A6, 0x1FBA, 0x24A7, 0x1FBB, 0x24A8, 0x1FBC, 0x24A9, 0x1FBD,
+ 0x24AA, 0x1FBE, 0x24AB, 0x1FBF, 0x24AC, 0x1FC0, 0x24AD, 0x1FC1,
+ 0x24AE, 0x1FC2, 0x24AF, 0x1FC3, 0x24B0, 0x1FC4, 0x24B1, 0x1FC5,
+ 0x24B2, 0x1FC6, 0x24B3, 0x1FC7, 0x24B4, 0x1FC8, 0x24B5, 0x1FC9,
+ 0x24B6, 0x2863, 0x24B7, 0x2864, 0x24B8, 0x2865, 0x24B9, 0x2866,
+ 0x24BA, 0x2867, 0x24BB, 0x2868, 0x24BC, 0x2869, 0x24BD, 0x286A,
+ 0x24BE, 0x286B, 0x24BF, 0x286C, 0x24C0, 0x286D, 0x24C1, 0x286E,
+ 0x24C2, 0x286F, 0x24C3, 0x2870, 0x24C4, 0x2871, 0x24C5, 0x2872,
+ 0x24C6, 0x2873, 0x24C7, 0x2874, 0x24C8, 0x2875, 0x24C9, 0x2876,
+ 0x24CA, 0x2877, 0x24CB, 0x2878, 0x24CC, 0x2879, 0x24CD, 0x287A,
+ 0x24CE, 0x287B, 0x24CF, 0x287C, 0x24D0, 0x2849, 0x24D1, 0x284A,
+ 0x24D2, 0x284B, 0x24D3, 0x284C, 0x24D4, 0x284D, 0x24D5, 0x284E,
+ 0x24D6, 0x284F, 0x24D7, 0x2850, 0x24D8, 0x2851, 0x24D9, 0x2852,
+ 0x24DA, 0x2853, 0x24DB, 0x2854, 0x24DC, 0x2855, 0x24DD, 0x2856,
+ 0x24DE, 0x2857, 0x24DF, 0x2858, 0x24E0, 0x2859, 0x24E1, 0x285A,
+ 0x24E2, 0x285B, 0x24E3, 0x285C, 0x24E4, 0x285D, 0x24E5, 0x285E,
+ 0x24E6, 0x285F, 0x24E7, 0x2860, 0x24E8, 0x2861, 0x24E9, 0x2862,
+ 0x24EA, 0x2020, 0x2500, 0x1D37, 0x2501, 0x1D38, 0x2502, 0x1D39,
+ 0x2503, 0x1D3A, 0x2504, 0x1D3B, 0x2505, 0x1D3C, 0x2506, 0x1D3D,
+ 0x2507, 0x1D3E, 0x2508, 0x1D3F, 0x2509, 0x1D40, 0x250A, 0x1D41,
+ 0x250B, 0x1D42, 0x250C, 0x1D43, 0x250D, 0x1D44, 0x250E, 0x1D45,
+ 0x250F, 0x1D46, 0x2510, 0x1D47, 0x2511, 0x1D48, 0x2512, 0x1D49,
+ 0x2513, 0x1D4A, 0x2514, 0x1D4B, 0x2515, 0x1D4C, 0x2516, 0x1D4D,
+ 0x2517, 0x1D4E, 0x2518, 0x1D4F, 0x2519, 0x1D50, 0x251A, 0x1D51,
+ 0x251B, 0x1D52, 0x251C, 0x1D53, 0x251D, 0x1D54, 0x251E, 0x1D55,
+ 0x251F, 0x1D56, 0x2520, 0x1D57, 0x2521, 0x1D58, 0x2522, 0x1D59,
+ 0x2523, 0x1D5A, 0x2524, 0x1D5B, 0x2525, 0x1D5C, 0x2526, 0x1D5D,
+ 0x2527, 0x1D5E, 0x2528, 0x1D5F, 0x2529, 0x1D60, 0x252A, 0x1D61,
+ 0x252B, 0x1D62, 0x252C, 0x1D63, 0x252D, 0x1D64, 0x252E, 0x1D65,
+ 0x252F, 0x1D66, 0x2530, 0x1D67, 0x2531, 0x1D68, 0x2532, 0x1D69,
+ 0x2533, 0x1D6A, 0x2534, 0x1D6B, 0x2535, 0x1D6C, 0x2536, 0x1D6D,
+ 0x2537, 0x1D6E, 0x2538, 0x1D6F, 0x2539, 0x1D70, 0x253A, 0x1D71,
+ 0x253B, 0x1D72, 0x253C, 0x1D73, 0x253D, 0x1D74, 0x253E, 0x1D75,
+ 0x253F, 0x1D76, 0x2540, 0x1D77, 0x2541, 0x1D78, 0x2542, 0x1D79,
+ 0x2543, 0x1D7A, 0x2544, 0x1D7B, 0x2545, 0x1D7C, 0x2546, 0x1D7D,
+ 0x2547, 0x1D7E, 0x2548, 0x1D7F, 0x2549, 0x1D80, 0x254A, 0x1D81,
+ 0x254B, 0x1D82, 0x2550, 0x203B, 0x255E, 0x203C, 0x2561, 0x203E,
+ 0x256A, 0x203D, 0x256D, 0x2037, 0x256E, 0x2038, 0x256F, 0x203A,
+ 0x2570, 0x2039, 0x2571, 0x2045, 0x2572, 0x2046, 0x2573, 0x2047,
+ 0x2581, 0x2026, 0x2582, 0x2027, 0x2583, 0x2028, 0x2584, 0x2029,
+ 0x2585, 0x202A, 0x2586, 0x202B, 0x2587, 0x202C, 0x2588, 0x202D,
+ 0x2589, 0x2034, 0x258A, 0x2033, 0x258B, 0x2032, 0x258C, 0x2031,
+ 0x258D, 0x2030, 0x258E, 0x202F, 0x258F, 0x202E, 0x2594, 0x2035,
+ 0x2595, 0x2036, 0x25A0, 0x02D9, 0x25A1, 0x02D8, 0x25A2, 0x1F4F,
+ 0x25AA, 0x2FCF, 0x25AB, 0x2FCD, 0x25B2, 0x02DB, 0x25B3, 0x02DA,
+ 0x25B6, 0x2FA3, 0x25B7, 0x1F4A, 0x25BC, 0x02DD, 0x25BD, 0x02DC,
+ 0x25C0, 0x2FA2, 0x25C1, 0x1F49, 0x25C6, 0x02D7, 0x25C7, 0x02D6,
+ 0x25C9, 0x2012, 0x25CB, 0x02D3, 0x25CC, 0x2906, 0x25CE, 0x02D5,
+ 0x25CF, 0x02D4, 0x25E2, 0x203F, 0x25E3, 0x2040, 0x25E4, 0x2042,
+ 0x25E5, 0x2041, 0x25E6, 0x2FDE, 0x25EF, 0x030B, 0x2600, 0x2017,
+ 0x2601, 0x2018, 0x2602, 0x2019, 0x2603, 0x201A, 0x2605, 0x02D2,
+ 0x2606, 0x02D1, 0x260E, 0x1F78, 0x2612, 0x2F99, 0x261C, 0x201C,
+ 0x261D, 0x201D, 0x261E, 0x201B, 0x261F, 0x201E, 0x2640, 0x02C2,
+ 0x2642, 0x02C1, 0x2660, 0x2013, 0x2661, 0x1F51, 0x2662, 0x1F53,
+ 0x2663, 0x2015, 0x2664, 0x1F52, 0x2665, 0x2014, 0x2666, 0x2016,
+ 0x2667, 0x1F50, 0x2668, 0x2F42, 0x2669, 0x2F43, 0x266A, 0x0307,
+ 0x266C, 0x2F44, 0x266D, 0x0306, 0x266F, 0x0305, 0x2702, 0x2F90,
+ 0x271A, 0x2FD1, 0x2756, 0x2FE3, 0x2776, 0x205E, 0x2777, 0x205F,
+ 0x2778, 0x2060, 0x2779, 0x2061, 0x277A, 0x2062, 0x277B, 0x2063,
+ 0x277C, 0x2064, 0x277D, 0x2065, 0x277E, 0x2066, 0x27A1, 0x200E,
+ 0x2E83, 0x37E1, 0x2E85, 0x3620, 0x2E87, 0x3719, 0x2E89, 0x3814,
+ 0x2E8B, 0x371E, 0x2E8C, 0x3609, 0x2E8D, 0x360A, 0x2E8E, 0x1071,
+ 0x2E8F, 0x388C, 0x2E90, 0x1226, 0x2E92, 0x0EB2, 0x2E93, 0x1283,
+ 0x2E94, 0x12AB, 0x2E95, 0x3C1F, 0x2E96, 0x38C2, 0x2E97, 0x361C,
+ 0x2E98, 0x38E1, 0x2E99, 0x13C3, 0x2E9B, 0x13E1, 0x2E9F, 0x0E3C,
+ 0x2EA0, 0x0EBD, 0x2EA1, 0x3961, 0x2EA2, 0x3962, 0x2EA3, 0x399D,
+ 0x2EA4, 0x3C26, 0x2EA6, 0x374D, 0x2EA8, 0x39BC, 0x2EA9, 0x35A1,
+ 0x2EAA, 0x36AB, 0x2EAB, 0x3A97, 0x2EAC, 0x08D4, 0x2EAD, 0x3A39,
+ 0x2EAE, 0x3662, 0x2EB1, 0x3A98, 0x2EB2, 0x3A97, 0x2EB3, 0x376D,
+ 0x2EB7, 0x36FE, 0x2EB9, 0x3713, 0x2EBC, 0x35B3, 0x2EBD, 0x354E,
+ 0x2EBE, 0x3775, 0x2EBF, 0x3776, 0x2EC0, 0x3777, 0x2EC1, 0x078B,
+ 0x2EC2, 0x3B0A, 0x2EC3, 0x362E, 0x2EC4, 0x0A62, 0x2EC6, 0x3572,
+ 0x2ECA, 0x364A, 0x2ECC, 0x3C2B, 0x2ECD, 0x3B50, 0x2ECF, 0x3B9E,
+ 0x2ED1, 0x0BD5, 0x2ED2, 0x3B97, 0x2ED6, 0x3B9E, 0x2ED7, 0x354D,
+ 0x2ED8, 0x0A68, 0x2EDD, 0x3617, 0x2EDE, 0x3619, 0x2EDF, 0x3618,
+ 0x2EE4, 0x064E, 0x2EE8, 0x0D34, 0x2EE9, 0x052B, 0x2EEB, 0x0A6A,
+ 0x2EED, 0x08C3, 0x2EEF, 0x0F7D, 0x2EF2, 0x064F, 0x2F00, 0x04B0,
+ 0x2F01, 0x20B3, 0x2F02, 0x0FFF, 0x2F03, 0x1001, 0x2F04, 0x0535,
+ 0x2F05, 0x1006, 0x2F06, 0x0CCB, 0x2F07, 0x100E, 0x2F08, 0x0A13,
+ 0x2F09, 0x1070, 0x2F0A, 0x0CD6, 0x2F0B, 0x0D40, 0x2F0C, 0x107B,
+ 0x2F0D, 0x1083, 0x2F0E, 0x1089, 0x2F0F, 0x1093, 0x2F10, 0x1098,
+ 0x2F11, 0x0C5B, 0x2F12, 0x0F97, 0x2F13, 0x10C6, 0x2F14, 0x10CD,
+ 0x2F15, 0x10CE, 0x2F16, 0x10D3, 0x2F17, 0x0947, 0x2F18, 0x0E7C,
+ 0x2F19, 0x10DC, 0x2F1A, 0x10E1, 0x2F1B, 0x10E8, 0x2F1C, 0x0EA2,
+ 0x2F1D, 0x07B1, 0x2F1E, 0x116B, 0x2F1F, 0x0C54, 0x2F20, 0x089C,
+ 0x2F21, 0x11BA, 0x2F22, 0x11BB, 0x2F23, 0x0F26, 0x2F24, 0x0B47,
+ 0x2F25, 0x0981, 0x2F26, 0x08A0, 0x2F27, 0x120E, 0x2F28, 0x0A47,
+ 0x2F29, 0x0996, 0x2F2A, 0x1226, 0x2F2B, 0x1228, 0x2F2C, 0x1232,
+ 0x2F2D, 0x0881, 0x2F2E, 0x126C, 0x2F2F, 0x07BB, 0x2F30, 0x077E,
+ 0x2F31, 0x06CA, 0x2F32, 0x05EF, 0x2F33, 0x1283, 0x2F34, 0x1285,
+ 0x2F35, 0x1299, 0x2F36, 0x129B, 0x2F37, 0x12A0, 0x2F38, 0x0677,
+ 0x2F39, 0x38B9, 0x2F3A, 0x12AF, 0x2F3B, 0x12B1, 0x2F3C, 0x09FA,
+ 0x2F3D, 0x1342, 0x2F3E, 0x0781, 0x2F3F, 0x0916, 0x2F40, 0x08A7,
+ 0x2F41, 0x13C2, 0x2F42, 0x0E08, 0x2F43, 0x0C47, 0x2F44, 0x06CC,
+ 0x2F45, 0x0E4D, 0x2F46, 0x13E0, 0x2F47, 0x0CD4, 0x2F48, 0x140C,
+ 0x2F49, 0x0744, 0x2F4A, 0x0EE6, 0x2F4B, 0x073D, 0x2F4C, 0x08AD,
+ 0x2F4D, 0x14E5, 0x2F4E, 0x14F4, 0x2F4F, 0x14F8, 0x2F50, 0x0D7A,
+ 0x2F51, 0x0EDF, 0x2F52, 0x08AF, 0x2F53, 0x1502, 0x2F54, 0x0A2B,
+ 0x2F55, 0x0550, 0x2F56, 0x0BFA, 0x2F57, 0x0DD5, 0x2F58, 0x15E4,
+ 0x2F59, 0x15E6, 0x2F5A, 0x0E22, 0x2F5B, 0x0567, 0x2F5C, 0x0687,
+ 0x2F5D, 0x0758, 0x2F5E, 0x0770, 0x2F5F, 0x06C4, 0x2F60, 0x04DD,
+ 0x2F61, 0x05E0, 0x2F62, 0x0601, 0x2F63, 0x0A5C, 0x2F64, 0x0F3B,
+ 0x2F65, 0x0C3E, 0x2F66, 0x0D97, 0x2F67, 0x3A00, 0x2F68, 0x1697,
+ 0x2F69, 0x0D28, 0x2F6A, 0x0D7D, 0x2F6B, 0x087C, 0x2F6C, 0x0EE8,
+ 0x2F6D, 0x0EC3, 0x2F6E, 0x0EFC, 0x2F6F, 0x0A74, 0x2F70, 0x08D4,
+ 0x2F71, 0x3A41, 0x2F72, 0x0553, 0x2F73, 0x0740, 0x2F74, 0x0F71,
+ 0x2F75, 0x0B9B, 0x2F76, 0x0E16, 0x2F77, 0x08B3, 0x2F78, 0x0608,
+ 0x2F79, 0x1813, 0x2F7A, 0x0F3D, 0x2F7B, 0x04CB, 0x2F7C, 0x0FDD,
+ 0x2F7D, 0x08D5, 0x2F7E, 0x183D, 0x2F7F, 0x08D6, 0x2F80, 0x1853,
+ 0x2F81, 0x0CD1, 0x2F82, 0x0A09, 0x2F83, 0x08D7, 0x2F84, 0x08B8,
+ 0x2F85, 0x04D3, 0x2F86, 0x0A89, 0x2F87, 0x0AA6, 0x2F88, 0x0938,
+ 0x2F89, 0x0821, 0x2F8A, 0x09ED, 0x2F8B, 0x18B2, 0x2F8C, 0x194F,
+ 0x2F8D, 0x0BAC, 0x2F8E, 0x0742, 0x2F8F, 0x07E6, 0x2F90, 0x04A5,
+ 0x2F91, 0x19EB, 0x2F92, 0x075F, 0x2F93, 0x05AF, 0x2F94, 0x0774,
+ 0x2F95, 0x0B69, 0x2F96, 0x0C7E, 0x2F97, 0x1A56, 0x2F98, 0x1A59,
+ 0x2F99, 0x058B, 0x2F9A, 0x0A7A, 0x2F9B, 0x0AF8, 0x2F9C, 0x0B0D,
+ 0x2F9D, 0x0A0E, 0x2F9E, 0x0902, 0x2F9F, 0x0A0F, 0x2FA0, 0x0B62,
+ 0x2FA1, 0x3B4F, 0x2FA2, 0x0F22, 0x2FA3, 0x0CAB, 0x2FA4, 0x0D64,
+ 0x2FA5, 0x0F6C, 0x2FA6, 0x06DA, 0x2FA7, 0x0BD5, 0x2FA8, 0x0EF3,
+ 0x2FA9, 0x0DDE, 0x2FAA, 0x1BC9, 0x2FAB, 0x1BCB, 0x2FAC, 0x04CD,
+ 0x2FAD, 0x21F7, 0x2FAE, 0x0D87, 0x2FAF, 0x0ED8, 0x2FB0, 0x05B5,
+ 0x2FB1, 0x1C03, 0x2FB2, 0x1C05, 0x2FB3, 0x053B, 0x2FB4, 0x0E17,
+ 0x2FB5, 0x0DE9, 0x2FB6, 0x0D88, 0x2FB7, 0x09EF, 0x2FB8, 0x091F,
+ 0x2FB9, 0x07F3, 0x2FBA, 0x0D05, 0x2FBB, 0x080E, 0x2FBC, 0x07F4,
+ 0x2FBD, 0x1C6C, 0x2FBE, 0x1C7D, 0x2FBF, 0x1C83, 0x2FC0, 0x1C84,
+ 0x2FC1, 0x064E, 0x2FC2, 0x0695, 0x2FC3, 0x0BD7, 0x2FC4, 0x1CF6,
+ 0x2FC5, 0x08DB, 0x2FC6, 0x1D01, 0x2FC7, 0x0E91, 0x2FC8, 0x340B,
+ 0x2FC9, 0x066A, 0x2FCA, 0x0807, 0x2FCB, 0x1D16, 0x2FCC, 0x1D19,
+ 0x2FCD, 0x0C1E, 0x2FCE, 0x0791, 0x2FCF, 0x0ACF, 0x2FD0, 0x0D93,
+ 0x2FD1, 0x1D21, 0x2FD2, 0x1D22, 0x2FD3, 0x0F7E, 0x2FD4, 0x1D30,
+ 0x2FD5, 0x1D31, 0x3000, 0x0279, 0x3001, 0x027A, 0x3002, 0x027B,
+ 0x3003, 0x028F, 0x3004, 0x2074, 0x3005, 0x0291, 0x3006, 0x0292,
+ 0x3007, 0x0293, 0x3008, 0x02AA, 0x3009, 0x02AB, 0x300A, 0x02AC,
+ 0x300B, 0x02AD, 0x300C, 0x02AE, 0x300D, 0x02AF, 0x300E, 0x02B0,
+ 0x300F, 0x02B1, 0x3010, 0x02B2, 0x3011, 0x02B3, 0x3012, 0x02DF,
+ 0x3013, 0x02E4, 0x3014, 0x02A4, 0x3015, 0x02A5, 0x301C, 0x0299,
+ 0x301D, 0x1DB8, 0x301F, 0x1DB9, 0x3020, 0x1F7A, 0x3030, 0x2FBA,
+ 0x3033, 0x2F4C, 0x3034, 0x2F4D, 0x3035, 0x2F4E, 0x3036, 0x1F79,
+ 0x3041, 0x034A, 0x3042, 0x034B, 0x3043, 0x034C, 0x3044, 0x034D,
+ 0x3045, 0x034E, 0x3046, 0x034F, 0x3047, 0x0350, 0x3048, 0x0351,
+ 0x3049, 0x0352, 0x304A, 0x0353, 0x304B, 0x0354, 0x304C, 0x0355,
+ 0x304D, 0x0356, 0x304E, 0x0357, 0x304F, 0x0358, 0x3050, 0x0359,
+ 0x3051, 0x035A, 0x3052, 0x035B, 0x3053, 0x035C, 0x3054, 0x035D,
+ 0x3055, 0x035E, 0x3056, 0x035F, 0x3057, 0x0360, 0x3058, 0x0361,
+ 0x3059, 0x0362, 0x305A, 0x0363, 0x305B, 0x0364, 0x305C, 0x0365,
+ 0x305D, 0x0366, 0x305E, 0x0367, 0x305F, 0x0368, 0x3060, 0x0369,
+ 0x3061, 0x036A, 0x3062, 0x036B, 0x3063, 0x036C, 0x3064, 0x036D,
+ 0x3065, 0x036E, 0x3066, 0x036F, 0x3067, 0x0370, 0x3068, 0x0371,
+ 0x3069, 0x0372, 0x306A, 0x0373, 0x306B, 0x0374, 0x306C, 0x0375,
+ 0x306D, 0x0376, 0x306E, 0x0377, 0x306F, 0x0378, 0x3070, 0x0379,
+ 0x3071, 0x037A, 0x3072, 0x037B, 0x3073, 0x037C, 0x3074, 0x037D,
+ 0x3075, 0x037E, 0x3076, 0x037F, 0x3077, 0x0380, 0x3078, 0x0381,
+ 0x3079, 0x0382, 0x307A, 0x0383, 0x307B, 0x0384, 0x307C, 0x0385,
+ 0x307D, 0x0386, 0x307E, 0x0387, 0x307F, 0x0388, 0x3080, 0x0389,
+ 0x3081, 0x038A, 0x3082, 0x038B, 0x3083, 0x038C, 0x3084, 0x038D,
+ 0x3085, 0x038E, 0x3086, 0x038F, 0x3087, 0x0390, 0x3088, 0x0391,
+ 0x3089, 0x0392, 0x308A, 0x0393, 0x308B, 0x0394, 0x308C, 0x0395,
+ 0x308D, 0x0396, 0x308E, 0x0397, 0x308F, 0x0398, 0x3090, 0x0399,
+ 0x3091, 0x039A, 0x3092, 0x039B, 0x3093, 0x039C, 0x3094, 0x1F16,
+ 0x309B, 0x0283, 0x309C, 0x0284, 0x309D, 0x028D, 0x309E, 0x028E,
+ 0x30A1, 0x039D, 0x30A2, 0x039E, 0x30A3, 0x039F, 0x30A4, 0x03A0,
+ 0x30A5, 0x03A1, 0x30A6, 0x03A2, 0x30A7, 0x03A3, 0x30A8, 0x03A4,
+ 0x30A9, 0x03A5, 0x30AA, 0x03A6, 0x30AB, 0x03A7, 0x30AC, 0x03A8,
+ 0x30AD, 0x03A9, 0x30AE, 0x03AA, 0x30AF, 0x03AB, 0x30B0, 0x03AC,
+ 0x30B1, 0x03AD, 0x30B2, 0x03AE, 0x30B3, 0x03AF, 0x30B4, 0x03B0,
+ 0x30B5, 0x03B1, 0x30B6, 0x03B2, 0x30B7, 0x03B3, 0x30B8, 0x03B4,
+ 0x30B9, 0x03B5, 0x30BA, 0x03B6, 0x30BB, 0x03B7, 0x30BC, 0x03B8,
+ 0x30BD, 0x03B9, 0x30BE, 0x03BA, 0x30BF, 0x03BB, 0x30C0, 0x03BC,
+ 0x30C1, 0x03BD, 0x30C2, 0x03BE, 0x30C3, 0x03BF, 0x30C4, 0x03C0,
+ 0x30C5, 0x03C1, 0x30C6, 0x03C2, 0x30C7, 0x03C3, 0x30C8, 0x03C4,
+ 0x30C9, 0x03C5, 0x30CA, 0x03C6, 0x30CB, 0x03C7, 0x30CC, 0x03C8,
+ 0x30CD, 0x03C9, 0x30CE, 0x03CA, 0x30CF, 0x03CB, 0x30D0, 0x03CC,
+ 0x30D1, 0x03CD, 0x30D2, 0x03CE, 0x30D3, 0x03CF, 0x30D4, 0x03D0,
+ 0x30D5, 0x03D1, 0x30D6, 0x03D2, 0x30D7, 0x03D3, 0x30D8, 0x03D4,
+ 0x30D9, 0x03D5, 0x30DA, 0x03D6, 0x30DB, 0x03D7, 0x30DC, 0x03D8,
+ 0x30DD, 0x03D9, 0x30DE, 0x03DA, 0x30DF, 0x03DB, 0x30E0, 0x03DC,
+ 0x30E1, 0x03DD, 0x30E2, 0x03DE, 0x30E3, 0x03DF, 0x30E4, 0x03E0,
+ 0x30E5, 0x03E1, 0x30E6, 0x03E2, 0x30E7, 0x03E3, 0x30E8, 0x03E4,
+ 0x30E9, 0x03E5, 0x30EA, 0x03E6, 0x30EB, 0x03E7, 0x30EC, 0x03E8,
+ 0x30ED, 0x03E9, 0x30EE, 0x03EA, 0x30EF, 0x03EB, 0x30F0, 0x03EC,
+ 0x30F1, 0x03ED, 0x30F2, 0x03EE, 0x30F3, 0x03EF, 0x30F4, 0x03F0,
+ 0x30F5, 0x03F1, 0x30F6, 0x03F2, 0x30F7, 0x2079, 0x30F8, 0x207A,
+ 0x30F9, 0x207B, 0x30FA, 0x207C, 0x30FB, 0x027E, 0x30FC, 0x0294,
+ 0x30FD, 0x028B, 0x30FE, 0x028C, 0x3220, 0x278E, 0x3221, 0x278F,
+ 0x3222, 0x2790, 0x3223, 0x2791, 0x3224, 0x2792, 0x3225, 0x2793,
+ 0x3226, 0x2794, 0x3227, 0x2795, 0x3228, 0x2796, 0x3229, 0x2797,
+ 0x322A, 0x2006, 0x322B, 0x2007, 0x322C, 0x2008, 0x322D, 0x2009,
+ 0x322E, 0x200A, 0x322F, 0x200B, 0x3230, 0x2005, 0x3231, 0x1DC2,
+ 0x3232, 0x1DC3, 0x3233, 0x1FCF, 0x3234, 0x1FCD, 0x3235, 0x1FD4,
+ 0x3236, 0x1FD3, 0x3237, 0x200C, 0x3238, 0x1FCE, 0x3239, 0x1DC4,
+ 0x323A, 0x1FD7, 0x323B, 0x1FD5, 0x323C, 0x1FD0, 0x323D, 0x1FCB,
+ 0x323E, 0x1FD2, 0x323F, 0x1FCC, 0x3240, 0x1FD6, 0x3241, 0x200D,
+ 0x3242, 0x1FD1, 0x3243, 0x1FCA, 0x3280, 0x28DD, 0x3281, 0x28DE,
+ 0x3282, 0x28DF, 0x3283, 0x28E0, 0x3284, 0x28E1, 0x3285, 0x28E2,
+ 0x3286, 0x28E3, 0x3287, 0x28E4, 0x3288, 0x28E5, 0x3289, 0x28E6,
+ 0x328A, 0x28E8, 0x328B, 0x28E9, 0x328C, 0x28EA, 0x328D, 0x28EB,
+ 0x328E, 0x28EC, 0x328F, 0x28ED, 0x3290, 0x28E7, 0x3291, 0x1FE1,
+ 0x3292, 0x1FE0, 0x3293, 0x1FE2, 0x3294, 0x1FDC, 0x3295, 0x28FF,
+ 0x3296, 0x1FE5, 0x3297, 0x28FC, 0x3298, 0x1FDE, 0x3299, 0x201F,
+ 0x329A, 0x28F9, 0x329B, 0x28F8, 0x329C, 0x28FE, 0x329D, 0x207F,
+ 0x329E, 0x1FFF, 0x329F, 0x28EF, 0x32A0, 0x28F6, 0x32A1, 0x28F7,
+ 0x32A2, 0x28FB, 0x32A3, 0x28FA, 0x32A4, 0x1DBD, 0x32A5, 0x1DBE,
+ 0x32A6, 0x1DBF, 0x32A7, 0x1DC0, 0x32A8, 0x1DC1, 0x32A9, 0x1FDA,
+ 0x32AA, 0x1FDD, 0x32AB, 0x1FDF, 0x32AC, 0x1FE3, 0x32AD, 0x1FD9,
+ 0x32AE, 0x1FE4, 0x32AF, 0x1FDB, 0x32B0, 0x1FD8, 0x32D0, 0x28AD,
+ 0x32D1, 0x28AE, 0x32D2, 0x28AF, 0x32D3, 0x28B0, 0x32D4, 0x28B1,
+ 0x32D5, 0x28B2, 0x32D6, 0x28B3, 0x32D7, 0x28B4, 0x32D8, 0x28B5,
+ 0x32D9, 0x28B6, 0x32DA, 0x28B7, 0x32DB, 0x28B8, 0x32DC, 0x28B9,
+ 0x32DD, 0x28BA, 0x32DE, 0x28BB, 0x32DF, 0x28BC, 0x32E0, 0x28BD,
+ 0x32E1, 0x28BE, 0x32E2, 0x28BF, 0x32E3, 0x28C0, 0x32E4, 0x28C1,
+ 0x32E5, 0x28C2, 0x32E6, 0x28C3, 0x32E7, 0x28C4, 0x32E8, 0x28C5,
+ 0x32E9, 0x28C6, 0x32EA, 0x28C7, 0x32EB, 0x28C8, 0x32EC, 0x28C9,
+ 0x32ED, 0x28CA, 0x32EE, 0x28CB, 0x32EF, 0x28CC, 0x32F0, 0x28CD,
+ 0x32F1, 0x28CE, 0x32F2, 0x28CF, 0x32F3, 0x28D0, 0x32F4, 0x28D1,
+ 0x32F5, 0x28D2, 0x32F6, 0x28D3, 0x32F7, 0x28D4, 0x32F8, 0x28D5,
+ 0x32F9, 0x28D6, 0x32FA, 0x28D7, 0x32FB, 0x28D8, 0x32FC, 0x28D9,
+ 0x32FD, 0x28DA, 0x32FE, 0x28DB, 0x3300, 0x1F70, 0x3301, 0x2E62,
+ 0x3302, 0x2E63, 0x3303, 0x1F6A, 0x3304, 0x2E64, 0x3305, 0x1FF7,
+ 0x3306, 0x2E65, 0x3307, 0x2E69, 0x3308, 0x2E67, 0x3309, 0x2E6C,
+ 0x330A, 0x2E6A, 0x330B, 0x2E6E, 0x330C, 0x2E70, 0x330D, 0x1DAB,
+ 0x330E, 0x2E71, 0x330F, 0x2E72, 0x3310, 0x2E73, 0x3311, 0x2E74,
+ 0x3312, 0x2E75, 0x3313, 0x2E76, 0x3314, 0x1DA2, 0x3315, 0x1F69,
+ 0x3316, 0x1F67, 0x3317, 0x2E78, 0x3318, 0x1F68, 0x3319, 0x2E7A,
+ 0x331A, 0x2E7C, 0x331B, 0x2E7D, 0x331C, 0x2E7E, 0x331D, 0x2E7F,
+ 0x331E, 0x1F73, 0x331F, 0x2E80, 0x3320, 0x2E81, 0x3321, 0x2E82,
+ 0x3322, 0x1F66, 0x3323, 0x1F6B, 0x3324, 0x2E83, 0x3325, 0x2E85,
+ 0x3326, 0x1DAC, 0x3327, 0x1DA6, 0x3328, 0x2E88, 0x3329, 0x2E89,
+ 0x332A, 0x1F74, 0x332B, 0x1DAE, 0x332D, 0x2E8B, 0x332E, 0x2E8E,
+ 0x332F, 0x2E8F, 0x3330, 0x2E90, 0x3331, 0x1F71, 0x3332, 0x2E91,
+ 0x3333, 0x2087, 0x3334, 0x2E94, 0x3335, 0x2E95, 0x3336, 0x1DA8,
+ 0x3337, 0x2E9A, 0x3338, 0x2E9C, 0x3339, 0x1F6E, 0x333A, 0x2E9D,
+ 0x333B, 0x1F6F, 0x333C, 0x2E96, 0x333D, 0x2E9E, 0x333E, 0x2EA0,
+ 0x333F, 0x2EA1, 0x3340, 0x2EA2, 0x3341, 0x2E9F, 0x3342, 0x1F6D,
+ 0x3343, 0x2EA3, 0x3344, 0x2EA4, 0x3345, 0x2EA5, 0x3346, 0x2EA6,
+ 0x3347, 0x1F72, 0x3348, 0x2EA7, 0x3349, 0x1DA1, 0x334A, 0x1DAF,
+ 0x334B, 0x2EA8, 0x334C, 0x2EA9, 0x334D, 0x1DA4, 0x334E, 0x2088,
+ 0x334F, 0x2EAA, 0x3350, 0x2EAB, 0x3351, 0x1DA9, 0x3352, 0x2EAE,
+ 0x3353, 0x2EB2, 0x3354, 0x2EAF, 0x3355, 0x2EB3, 0x3356, 0x2EB4,
+ 0x3357, 0x1F6C, 0x3371, 0x2E55, 0x337B, 0x2083, 0x337C, 0x1DC7,
+ 0x337D, 0x1DC6, 0x337E, 0x1DC5, 0x337F, 0x1F76, 0x3385, 0x1F5F,
+ 0x3386, 0x1F60, 0x3387, 0x1F61, 0x3388, 0x2000, 0x3389, 0x2001,
+ 0x338D, 0x2E58, 0x338E, 0x1DB4, 0x338F, 0x1DB5, 0x3390, 0x1F63,
+ 0x3396, 0x1F65, 0x3397, 0x1F58, 0x3398, 0x1F5A, 0x339B, 0x2E59,
+ 0x339C, 0x1DB1, 0x339D, 0x1DB2, 0x339E, 0x1DB3, 0x339F, 0x1FFA,
+ 0x33A0, 0x1F54, 0x33A1, 0x1DB7, 0x33A2, 0x1F55, 0x33A3, 0x1FFB,
+ 0x33A4, 0x1F56, 0x33A5, 0x1F57, 0x33A6, 0x1FFC, 0x33B0, 0x1F5E,
+ 0x33B1, 0x1F5D, 0x33B2, 0x1F5C, 0x33B3, 0x1F5B, 0x33C2, 0x2E50,
+ 0x33C4, 0x1DB6, 0x33C8, 0x2002, 0x33CB, 0x1F62, 0x33CC, 0x1FF6,
+ 0x33CD, 0x1DBB, 0x33D4, 0x1F64, 0x33D7, 0x2E5D, 0x33D8, 0x2E5E,
+ 0x33DA, 0x2E4B, 0x3402, 0x3582, 0x3405, 0x3C1B, 0x3427, 0x3656,
+ 0x3488, 0x3C52, 0x34DB, 0x3C41, 0x351F, 0x3629, 0x353E, 0x371E,
+ 0x378D, 0x361A, 0x37E2, 0x372B, 0x3AF3, 0x3C40, 0x3B22, 0x3C49,
+ 0x3B88, 0x368D, 0x3E8A, 0x3C43, 0x3EDA, 0x3C48, 0x3FB1, 0x3754,
+ 0x4093, 0x3C4C, 0x4103, 0x3C4F, 0x4264, 0x3760, 0x4293, 0x3C50,
+ 0x440C, 0x3C42, 0x4453, 0x3773, 0x457A, 0x3C4B, 0x4665, 0x3C4E,
+ 0x46AE, 0x3C51, 0x4BE8, 0x3C46, 0x4E00, 0x04B0, 0x4E01, 0x0BB8,
+ 0x4E03, 0x08E3, 0x4E04, 0x37D8, 0x4E05, 0x37D9, 0x4E07, 0x0EAA,
+ 0x4E08, 0x09CE, 0x4E09, 0x087E, 0x4E0A, 0x09CD, 0x4E0B, 0x053C,
+ 0x4E0D, 0x0DC6, 0x4E0E, 0x0F29, 0x4E10, 0x0FFB, 0x4E11, 0x04D1,
+ 0x4E14, 0x05CC, 0x4E15, 0x0FFC, 0x4E16, 0x0A48, 0x4E17, 0x10D7,
+ 0x4E18, 0x0670, 0x4E19, 0x0E0A, 0x4E1E, 0x09CF, 0x4E1F, 0x37DA,
+ 0x4E21, 0x0F86, 0x4E26, 0x0E12, 0x4E28, 0x20B3, 0x4E2A, 0x0FFD,
+ 0x4E2B, 0x37DB, 0x4E2C, 0x374D, 0x4E2D, 0x0BA4, 0x4E2F, 0x37DC,
+ 0x4E30, 0x37DD, 0x4E31, 0x0FFE, 0x4E32, 0x06F2, 0x4E36, 0x0FFF,
+ 0x4E37, 0x369D, 0x4E38, 0x0619, 0x4E39, 0x0B6E, 0x4E3B, 0x0913,
+ 0x4E3C, 0x1000, 0x4E3F, 0x1001, 0x4E40, 0x37DE, 0x4E41, 0x37DF,
+ 0x4E42, 0x1002, 0x4E43, 0x0CEB, 0x4E44, 0x37E0, 0x4E45, 0x0671,
+ 0x4E48, 0x372E, 0x4E4B, 0x0CED, 0x4E4D, 0x0CBB, 0x4E4E, 0x0777,
+ 0x4E4F, 0x0E61, 0x4E55, 0x1950, 0x4E56, 0x1003, 0x4E57, 0x09D0,
+ 0x4E58, 0x1004, 0x4E59, 0x0535, 0x4E5A, 0x37E1, 0x4E5D, 0x06DD,
+ 0x4E5E, 0x07A4, 0x4E5F, 0x0EF5, 0x4E62, 0x1233, 0x4E71, 0x0F5A,
+ 0x4E73, 0x0CD5, 0x4E7E, 0x05E1, 0x4E7F, 0x37E2, 0x4E80, 0x064F,
+ 0x4E82, 0x1005, 0x4E85, 0x1006, 0x4E86, 0x0F83, 0x4E88, 0x0F27,
+ 0x4E89, 0x0AEA, 0x4E8A, 0x1008, 0x4E8B, 0x08C4, 0x4E8C, 0x0CCB,
+ 0x4E8D, 0x37E3, 0x4E8E, 0x100B, 0x4E91, 0x04E0, 0x4E92, 0x0793,
+ 0x4E94, 0x0792, 0x4E95, 0x04AA, 0x4E96, 0x37E4, 0x4E98, 0x0FF1,
+ 0x4E99, 0x0FF0, 0x4E9B, 0x0823, 0x4E9C, 0x0465, 0x4E9E, 0x100C,
+ 0x4E9F, 0x100D, 0x4EA0, 0x100E, 0x4EA1, 0x0E62, 0x4EA2, 0x100F,
+ 0x4EA4, 0x07A6, 0x4EA5, 0x04AB, 0x4EA6, 0x0EA0, 0x4EA8, 0x0696,
+ 0x4EAB, 0x0697, 0x4EAC, 0x0698, 0x4EAD, 0x0BFE, 0x4EAE, 0x0F84,
+ 0x4EB0, 0x1010, 0x4EB3, 0x1011, 0x4EB6, 0x1012, 0x4EB9, 0x37E5,
+ 0x4EBA, 0x0A13, 0x4EBB, 0x3620, 0x4EC0, 0x0944, 0x4EC1, 0x0A14,
+ 0x4EC2, 0x1017, 0x4EC4, 0x1015, 0x4EC6, 0x1016, 0x4EC7, 0x0672,
+ 0x4ECA, 0x0813, 0x4ECB, 0x0570, 0x4ECD, 0x1014, 0x4ECE, 0x1013,
+ 0x4ECF, 0x0DF9, 0x4ED0, 0x37E6, 0x4ED4, 0x0894, 0x4ED5, 0x0893,
+ 0x4ED6, 0x0B1E, 0x4ED7, 0x1018, 0x4ED8, 0x0DC7, 0x4ED9, 0x0A8B,
+ 0x4EDD, 0x0290, 0x4EDE, 0x1019, 0x4EDF, 0x101B, 0x4EE0, 0x37E7,
+ 0x4EE1, 0x20B4, 0x4EE3, 0x0B45, 0x4EE4, 0x0FA9, 0x4EE5, 0x048E,
+ 0x4EED, 0x101A, 0x4EEE, 0x053E, 0x4EF0, 0x06BC, 0x4EF2, 0x0BA5,
+ 0x4EF6, 0x0745, 0x4EF7, 0x101C, 0x4EFB, 0x0CDA, 0x4EFC, 0x20B5,
+ 0x4EFD, 0x37E8, 0x4EFF, 0x37E9, 0x4F00, 0x20B6, 0x4F01, 0x0627,
+ 0x4F03, 0x20B7, 0x4F09, 0x101D, 0x4F0A, 0x048F, 0x4F0B, 0x37EA,
+ 0x4F0D, 0x0794, 0x4F0E, 0x0628, 0x4F0F, 0x0DEC, 0x4F10, 0x0D46,
+ 0x4F11, 0x0673, 0x4F15, 0x37EB, 0x4F1A, 0x0571, 0x4F1C, 0x1040,
+ 0x4F1D, 0x0C3B, 0x4F2F, 0x0D22, 0x4F30, 0x101F, 0x4F34, 0x0D50,
+ 0x4F36, 0x0FAA, 0x4F38, 0x09F3, 0x4F39, 0x20B8, 0x4F3A, 0x0895,
+ 0x4F3B, 0x37ED, 0x4F3C, 0x08C5, 0x4F3D, 0x0540, 0x4F43, 0x0BED,
+ 0x4F46, 0x0B60, 0x4F47, 0x1023, 0x4F49, 0x37EE, 0x4F4D, 0x0490,
+ 0x4F4E, 0x0BFF, 0x4F4F, 0x0945, 0x4F50, 0x0824, 0x4F51, 0x0F0E,
+ 0x4F53, 0x0B2E, 0x4F54, 0x37EF, 0x4F55, 0x053F, 0x4F56, 0x20B9,
+ 0x4F57, 0x1022, 0x4F59, 0x0F28, 0x4F5A, 0x101E, 0x4F5B, 0x1020,
+ 0x4F5C, 0x085E, 0x4F5D, 0x1021, 0x4F5E, 0x11D3, 0x4F60, 0x37EC,
+ 0x4F69, 0x1029, 0x4F6F, 0x102C, 0x4F70, 0x102A, 0x4F73, 0x0542,
+ 0x4F75, 0x0E0B, 0x4F76, 0x1024, 0x4F7A, 0x37F0, 0x4F7B, 0x1028,
+ 0x4F7C, 0x07A7, 0x4F7D, 0x37F1, 0x4F7E, 0x37F2, 0x4F7F, 0x0896,
+ 0x4F83, 0x05E2, 0x4F86, 0x102D, 0x4F88, 0x1025, 0x4F8A, 0x20BB,
+ 0x4F8B, 0x0FAB, 0x4F8D, 0x08C6, 0x4F8F, 0x1026, 0x4F91, 0x102B,
+ 0x4F92, 0x20BA, 0x4F94, 0x20BD, 0x4F96, 0x102E, 0x4F97, 0x37F3,
+ 0x4F98, 0x1027, 0x4F9A, 0x20BC, 0x4F9B, 0x0699, 0x4F9D, 0x0491,
+ 0x4FA0, 0x069A, 0x4FA1, 0x0541, 0x4FAB, 0x11D4, 0x4FAD, 0x0EA7,
+ 0x4FAE, 0x0DE0, 0x4FAF, 0x07A8, 0x4FB5, 0x09F5, 0x4FB6, 0x0F7F,
+ 0x4FBE, 0x37F4, 0x4FBF, 0x0E28, 0x4FC2, 0x070E, 0x4FC3, 0x0B05,
+ 0x4FC4, 0x0564, 0x4FC9, 0x20AC, 0x4FCA, 0x095D, 0x4FCD, 0x20BE,
+ 0x4FCE, 0x1032, 0x4FCF, 0x37F5, 0x4FD0, 0x1037, 0x4FD1, 0x1035,
+ 0x4FD3, 0x3C2F, 0x4FD4, 0x1030, 0x4FD7, 0x0B0F, 0x4FD8, 0x1033,
+ 0x4FDA, 0x1036, 0x4FDB, 0x1034, 0x4FDD, 0x0E2D, 0x4FDF, 0x1031,
+ 0x4FE0, 0x1DEC, 0x4FE1, 0x09F4, 0x4FE3, 0x0EA1, 0x4FE4, 0x1038,
+ 0x4FE5, 0x1039, 0x4FEE, 0x092E, 0x4FEF, 0x1046, 0x4FF3, 0x0D06,
+ 0x4FF5, 0x0DA8, 0x4FF6, 0x1041, 0x4FF8, 0x0E40, 0x4FFA, 0x0536,
+ 0x4FFD, 0x37F6, 0x4FFE, 0x1045, 0x4FFF, 0x20C1, 0x5000, 0x37F7,
+ 0x5001, 0x37F8, 0x5002, 0x3447, 0x5005, 0x103F, 0x5006, 0x1048,
+ 0x5009, 0x0AD4, 0x500B, 0x0778, 0x500D, 0x0D12, 0x500F, 0x1600,
+ 0x5010, 0x37F9, 0x5011, 0x1047, 0x5012, 0x0C57, 0x5014, 0x103C,
+ 0x5016, 0x07AA, 0x5019, 0x07A9, 0x501A, 0x103A, 0x501B, 0x37FA,
+ 0x501E, 0x20C2, 0x501F, 0x0906, 0x5021, 0x1042, 0x5022, 0x20C0,
+ 0x5023, 0x0E3F, 0x5024, 0x0B8B, 0x5025, 0x103E, 0x5026, 0x0747,
+ 0x5027, 0x37FB, 0x5028, 0x103B, 0x5029, 0x1043, 0x502A, 0x103D,
+ 0x502B, 0x0F99, 0x502C, 0x1044, 0x502D, 0x0FE7, 0x502E, 0x37FC,
+ 0x5036, 0x06DE, 0x5039, 0x0746, 0x503B, 0x3800, 0x5040, 0x20BF,
+ 0x5042, 0x20C5, 0x5043, 0x1049, 0x5046, 0x20C3, 0x5047, 0x104A,
+ 0x5048, 0x104E, 0x5049, 0x0492, 0x504F, 0x0E20, 0x5050, 0x104D,
+ 0x5055, 0x104C, 0x5056, 0x1050, 0x5057, 0x37FD, 0x505A, 0x104F,
+ 0x505C, 0x0C00, 0x5065, 0x0748, 0x5066, 0x37FE, 0x506A, 0x37FF,
+ 0x506C, 0x1051, 0x5070, 0x20C4, 0x5072, 0x08F1, 0x5074, 0x0B06,
+ 0x5075, 0x0C01, 0x5076, 0x06EE, 0x5078, 0x1052, 0x507D, 0x0650,
+ 0x5080, 0x1053, 0x5085, 0x1055, 0x508D, 0x0E63, 0x508F, 0x3801,
+ 0x5091, 0x073C, 0x5094, 0x20C6, 0x5096, 0x3802, 0x5098, 0x087F,
+ 0x5099, 0x0D8B, 0x509A, 0x1054, 0x509C, 0x3803, 0x50AC, 0x0835,
+ 0x50AD, 0x0F2D, 0x50B2, 0x1057, 0x50B3, 0x105A, 0x50B4, 0x1056,
+ 0x50B5, 0x0834, 0x50B7, 0x0987, 0x50BE, 0x070F, 0x50C2, 0x105B,
+ 0x50C5, 0x06C7, 0x50C9, 0x1058, 0x50CA, 0x1059, 0x50CC, 0x3804,
+ 0x50CD, 0x0C87, 0x50CF, 0x0AFE, 0x50D1, 0x069B, 0x50D5, 0x0E7B,
+ 0x50D6, 0x105C, 0x50D8, 0x20C8, 0x50D9, 0x3C30, 0x50DA, 0x0F85,
+ 0x50DE, 0x105D, 0x50E3, 0x1060, 0x50E5, 0x105E, 0x50E6, 0x3805,
+ 0x50E7, 0x0AD0, 0x50E9, 0x3806, 0x50ED, 0x105F, 0x50EE, 0x1061,
+ 0x50EF, 0x3807, 0x50F0, 0x3C31, 0x50F4, 0x20C7, 0x50F5, 0x1063,
+ 0x50F9, 0x1062, 0x50FB, 0x0E18, 0x5100, 0x0651, 0x5101, 0x1065,
+ 0x5102, 0x1066, 0x5104, 0x052F, 0x5108, 0x3808, 0x5109, 0x1064,
+ 0x510B, 0x3809, 0x5110, 0x380A, 0x5112, 0x0920, 0x5114, 0x1069,
+ 0x5115, 0x1068, 0x5116, 0x1067, 0x5118, 0x102F, 0x511A, 0x106A,
+ 0x511B, 0x380B, 0x511E, 0x380C, 0x511F, 0x0988, 0x5121, 0x106B,
+ 0x512A, 0x0F0F, 0x5132, 0x0EE5, 0x5137, 0x106D, 0x513A, 0x106C,
+ 0x513B, 0x106F, 0x513C, 0x106E, 0x513F, 0x1070, 0x5140, 0x1071,
+ 0x5141, 0x04B8, 0x5143, 0x0769, 0x5144, 0x0711, 0x5145, 0x0946,
+ 0x5146, 0x0BB9, 0x5147, 0x069C, 0x5148, 0x0A8C, 0x5149, 0x07AB,
+ 0x514A, 0x20C9, 0x514B, 0x0800, 0x514C, 0x1073, 0x514D, 0x0ED4,
+ 0x514E, 0x0C40, 0x5150, 0x08C7, 0x5152, 0x1072, 0x5154, 0x1074,
+ 0x515A, 0x0C58, 0x515C, 0x05D3, 0x515F, 0x380D, 0x5162, 0x1075,
+ 0x5164, 0x20CA, 0x5165, 0x0CD6, 0x5167, 0x368E, 0x5168, 0x0AB6,
+ 0x5169, 0x1077, 0x516A, 0x1078, 0x516B, 0x0D40, 0x516C, 0x07AC,
+ 0x516D, 0x0FE1, 0x516E, 0x1079, 0x5171, 0x069E, 0x5175, 0x0E0C,
+ 0x5176, 0x0B16, 0x5177, 0x06E9, 0x5178, 0x0C2F, 0x5179, 0x3779,
+ 0x517C, 0x0749, 0x5180, 0x107A, 0x5182, 0x107B, 0x5185, 0x0CBA,
+ 0x5186, 0x0501, 0x5189, 0x107E, 0x518A, 0x086D, 0x518C, 0x107D,
+ 0x518D, 0x0836, 0x518F, 0x107F, 0x5190, 0x185B, 0x5191, 0x1080,
+ 0x5192, 0x0E6F, 0x5193, 0x1081, 0x5195, 0x1082, 0x5196, 0x1083,
+ 0x5197, 0x09D1, 0x5199, 0x08F8, 0x519D, 0x20CB, 0x51A0, 0x05E3,
+ 0x51A1, 0x380E, 0x51A2, 0x1086, 0x51A4, 0x1084, 0x51A5, 0x0EC9,
+ 0x51A6, 0x1085, 0x51A8, 0x0DCC, 0x51A9, 0x1087, 0x51AA, 0x1088,
+ 0x51AB, 0x1089, 0x51AC, 0x0C59, 0x51B0, 0x108D, 0x51B1, 0x108B,
+ 0x51B2, 0x108C, 0x51B3, 0x108A, 0x51B4, 0x0853, 0x51B5, 0x108E,
+ 0x51B6, 0x0EF6, 0x51B7, 0x0FAC, 0x51BC, 0x380F, 0x51BD, 0x108F,
+ 0x51BE, 0x20CC, 0x51C3, 0x3C32, 0x51C4, 0x0A4C, 0x51C5, 0x1090,
+ 0x51C6, 0x0964, 0x51C9, 0x1091, 0x51CB, 0x0BBA, 0x51CC, 0x0F87,
+ 0x51CD, 0x0C5A, 0x51D6, 0x10DA, 0x51DB, 0x1092, 0x51DC, 0x205C,
+ 0x51DD, 0x06BD, 0x51DE, 0x3810, 0x51E0, 0x1093, 0x51E1, 0x0E8C,
+ 0x51E6, 0x0972, 0x51E7, 0x0B5C, 0x51E9, 0x1095, 0x51EA, 0x0CBC,
+ 0x51EC, 0x20CD, 0x51ED, 0x1096, 0x51EE, 0x3811, 0x51F0, 0x1097,
+ 0x51F1, 0x058C, 0x51F4, 0x3812, 0x51F5, 0x1098, 0x51F6, 0x069F,
+ 0x51F8, 0x0CA4, 0x51F9, 0x051C, 0x51FA, 0x095A, 0x51FD, 0x0D35,
+ 0x51FE, 0x1099, 0x5200, 0x0C5B, 0x5201, 0x3813, 0x5202, 0x3814,
+ 0x5203, 0x0A15, 0x5204, 0x109A, 0x5206, 0x0DFC, 0x5207, 0x0A7E,
+ 0x5208, 0x05DE, 0x520A, 0x05E5, 0x520B, 0x109B, 0x520E, 0x109D,
+ 0x5211, 0x0710, 0x5213, 0x3815, 0x5214, 0x109C, 0x5215, 0x20CE,
+ 0x5217, 0x0FBB, 0x521D, 0x0973, 0x5224, 0x0D51, 0x5225, 0x0E1C,
+ 0x5227, 0x109E, 0x5229, 0x0F62, 0x522A, 0x109F, 0x522E, 0x10A0,
+ 0x5230, 0x0C78, 0x5233, 0x10A1, 0x5236, 0x0A4D, 0x5237, 0x086E,
+ 0x5238, 0x074A, 0x5239, 0x10A2, 0x523A, 0x0897, 0x523B, 0x0801,
+ 0x5243, 0x0C02, 0x5244, 0x10A4, 0x5247, 0x0B07, 0x5249, 0x3816,
+ 0x524A, 0x085F, 0x524B, 0x10A5, 0x524C, 0x10A6, 0x524D, 0x0AB2,
+ 0x524F, 0x10A3, 0x5254, 0x10A8, 0x5256, 0x0E64, 0x525B, 0x07F6,
+ 0x525D, 0x1E5E, 0x525E, 0x10A7, 0x5261, 0x3817, 0x5263, 0x074B,
+ 0x5264, 0x084E, 0x5265, 0x0D23, 0x5266, 0x3818, 0x5269, 0x10AB,
+ 0x526A, 0x10A9, 0x526F, 0x0DED, 0x5270, 0x09D2, 0x5271, 0x10B2,
+ 0x5272, 0x05C2, 0x5273, 0x10AC, 0x5274, 0x10AA, 0x5275, 0x0AD1,
+ 0x527D, 0x10AE, 0x527F, 0x10AD, 0x5283, 0x05A2, 0x5287, 0x0736,
+ 0x5288, 0x10B3, 0x5289, 0x0F75, 0x528D, 0x10AF, 0x5291, 0x10B4,
+ 0x5292, 0x10B1, 0x5293, 0x3819, 0x5294, 0x10B0, 0x529B, 0x0F97,
+ 0x529C, 0x20CF, 0x529F, 0x07AD, 0x52A0, 0x0543, 0x52A3, 0x0FBC,
+ 0x52A6, 0x20D0, 0x52A9, 0x097F, 0x52AA, 0x0C52, 0x52AB, 0x07F7,
+ 0x52AC, 0x10B7, 0x52AD, 0x10B8, 0x52AF, 0x217D, 0x52B1, 0x0FAD,
+ 0x52B4, 0x0FD1, 0x52B5, 0x10BA, 0x52B9, 0x07AE, 0x52BC, 0x10B9,
+ 0x52BE, 0x058D, 0x52C0, 0x20D1, 0x52C1, 0x10BB, 0x52C3, 0x0E84,
+ 0x52C5, 0x0BD8, 0x52C7, 0x0F10, 0x52C8, 0x381A, 0x52C9, 0x0E29,
+ 0x52CD, 0x10BC, 0x52D0, 0x36E8, 0x52D2, 0x1BEE, 0x52D5, 0x0C88,
+ 0x52D7, 0x10BD, 0x52D8, 0x05E6, 0x52D9, 0x0EBF, 0x52DB, 0x20D2,
+ 0x52DD, 0x0989, 0x52DE, 0x10BE, 0x52DF, 0x0E37, 0x52E0, 0x10C2,
+ 0x52E2, 0x0A4E, 0x52E3, 0x10BF, 0x52E4, 0x06C8, 0x52E6, 0x10C0,
+ 0x52E7, 0x05E7, 0x52F0, 0x381B, 0x52F2, 0x0704, 0x52F3, 0x10C3,
+ 0x52F5, 0x10C4, 0x52F8, 0x10C5, 0x52F9, 0x10C6, 0x52FA, 0x0907,
+ 0x52FE, 0x07AF, 0x52FF, 0x0EEA, 0x5300, 0x20D3, 0x5301, 0x0EF4,
+ 0x5302, 0x0CCF, 0x5305, 0x0E41, 0x5306, 0x10C7, 0x5307, 0x20D4,
+ 0x5308, 0x10C8, 0x530A, 0x381C, 0x530B, 0x381D, 0x530D, 0x10CA,
+ 0x530F, 0x10CC, 0x5310, 0x10CB, 0x5315, 0x10CD, 0x5316, 0x053D,
+ 0x5317, 0x0E7A, 0x5319, 0x086C, 0x531A, 0x10CE, 0x531D, 0x0ADB,
+ 0x5320, 0x098A, 0x5321, 0x06A1, 0x5323, 0x10CF, 0x5324, 0x20D5,
+ 0x532A, 0x0D6F, 0x532F, 0x10D0, 0x5331, 0x10D1, 0x5333, 0x10D2,
+ 0x5338, 0x10D3, 0x5339, 0x0D96, 0x533A, 0x06E0, 0x533B, 0x04A9,
+ 0x533E, 0x381E, 0x533F, 0x0C97, 0x5340, 0x10D4, 0x5341, 0x0947,
+ 0x5343, 0x0A8D, 0x5345, 0x10D6, 0x5346, 0x10D5, 0x5347, 0x098B,
+ 0x5348, 0x0795, 0x5349, 0x10D8, 0x534A, 0x0D52, 0x534B, 0x3820,
+ 0x534C, 0x381F, 0x534D, 0x10D9, 0x5351, 0x0D70, 0x5352, 0x0B14,
+ 0x5353, 0x0B4E, 0x5354, 0x06A0, 0x5357, 0x0CC6, 0x5358, 0x0B6F,
+ 0x535A, 0x0D24, 0x535C, 0x0E7C, 0x535E, 0x10DB, 0x5360, 0x0A8E,
+ 0x5361, 0x3821, 0x5366, 0x070B, 0x5369, 0x10DC, 0x536C, 0x3822,
+ 0x536E, 0x10DD, 0x536F, 0x04CE, 0x5370, 0x04B9, 0x5371, 0x0629,
+ 0x5372, 0x20D6, 0x5373, 0x0B08, 0x5374, 0x066B, 0x5375, 0x0F5B,
+ 0x5377, 0x10E0, 0x5378, 0x0537, 0x537B, 0x10DF, 0x537D, 0x3435,
+ 0x537F, 0x06A2, 0x5382, 0x10E1, 0x5384, 0x0EFD, 0x5389, 0x37D0,
+ 0x5393, 0x20D7, 0x5396, 0x10E2, 0x5398, 0x0F9A, 0x539A, 0x07B0,
+ 0x539F, 0x076A, 0x53A0, 0x10E3, 0x53A5, 0x10E5, 0x53A6, 0x10E4,
+ 0x53A8, 0x0A25, 0x53A9, 0x04DB, 0x53AB, 0x3823, 0x53AD, 0x0500,
+ 0x53AE, 0x10E6, 0x53B0, 0x10E7, 0x53B2, 0x20D8, 0x53B3, 0x076B,
+ 0x53B6, 0x10E8, 0x53BB, 0x0688, 0x53C2, 0x0880, 0x53C3, 0x10E9,
+ 0x53C8, 0x0EA2, 0x53C9, 0x0825, 0x53CA, 0x0674, 0x53CB, 0x0F11,
+ 0x53CC, 0x0AD2, 0x53CD, 0x0D53, 0x53CE, 0x0929, 0x53D4, 0x0951,
+ 0x53D6, 0x0914, 0x53D7, 0x0921, 0x53D9, 0x0980, 0x53DA, 0x3824,
+ 0x53DB, 0x0D54, 0x53DD, 0x20D9, 0x53DF, 0x10EC, 0x53E1, 0x04E5,
+ 0x53E2, 0x0AD3, 0x53E3, 0x07B1, 0x53E4, 0x0779, 0x53E5, 0x06DF,
+ 0x53E6, 0x3825, 0x53E8, 0x10F0, 0x53E9, 0x0B5F, 0x53EA, 0x0B5E,
+ 0x53EB, 0x06A3, 0x53EC, 0x098C, 0x53ED, 0x10F1, 0x53EE, 0x10EF,
+ 0x53EF, 0x0544, 0x53F0, 0x0B46, 0x53F1, 0x08E4, 0x53F2, 0x0899,
+ 0x53F3, 0x04C8, 0x53F5, 0x3826, 0x53F6, 0x05CE, 0x53F7, 0x07F8,
+ 0x53F8, 0x0898, 0x53FA, 0x10F2, 0x5401, 0x10F3, 0x5403, 0x0663,
+ 0x5404, 0x05A4, 0x5408, 0x07F9, 0x5409, 0x0662, 0x540A, 0x0BFB,
+ 0x540B, 0x04C7, 0x540C, 0x0C89, 0x540D, 0x0ECA, 0x540E, 0x07B3,
+ 0x540F, 0x0F63, 0x5410, 0x0C41, 0x5411, 0x07B2, 0x541B, 0x0705,
+ 0x541D, 0x10FC, 0x541F, 0x06DB, 0x5420, 0x0E78, 0x5426, 0x0D71,
+ 0x5427, 0x3827, 0x5429, 0x10FB, 0x542B, 0x061A, 0x542C, 0x10F6,
+ 0x542D, 0x10F7, 0x542E, 0x10F9, 0x5433, 0x35C0, 0x5436, 0x10FA,
+ 0x5438, 0x0675, 0x5439, 0x0A27, 0x543B, 0x0DFD, 0x543C, 0x10F8,
+ 0x543D, 0x10F4, 0x543E, 0x0797, 0x543F, 0x35CF, 0x5440, 0x10F5,
+ 0x5442, 0x0FCA, 0x5446, 0x0E42, 0x5448, 0x0C04, 0x5449, 0x0796,
+ 0x544A, 0x0802, 0x544D, 0x3828, 0x544E, 0x10FD, 0x5451, 0x0CB5,
+ 0x5455, 0x3723, 0x545F, 0x1101, 0x5466, 0x3829, 0x5468, 0x092A,
+ 0x546A, 0x0922, 0x546B, 0x382A, 0x5470, 0x1104, 0x5471, 0x1102,
+ 0x5473, 0x0EAF, 0x5474, 0x382B, 0x5475, 0x10FF, 0x5476, 0x1108,
+ 0x5477, 0x1103, 0x547B, 0x1106, 0x547C, 0x077A, 0x547D, 0x0ECB,
+ 0x5480, 0x1107, 0x5484, 0x1109, 0x5486, 0x110B, 0x548A, 0x20DC,
+ 0x548B, 0x0860, 0x548C, 0x0FE8, 0x548D, 0x382C, 0x548E, 0x1100,
+ 0x548F, 0x10FE, 0x5490, 0x110A, 0x5492, 0x1105, 0x5496, 0x382D,
+ 0x549C, 0x20DB, 0x54A1, 0x382E, 0x54A2, 0x110D, 0x54A4, 0x1116,
+ 0x54A5, 0x110F, 0x54A8, 0x1113, 0x54A9, 0x20DD, 0x54AB, 0x1114,
+ 0x54AC, 0x1110, 0x54AD, 0x382F, 0x54AF, 0x1131, 0x54B2, 0x0859,
+ 0x54B3, 0x058F, 0x54B8, 0x110E, 0x54B9, 0x3830, 0x54BC, 0x1118,
+ 0x54BD, 0x04BA, 0x54BE, 0x1117, 0x54BF, 0x3831, 0x54C0, 0x0469,
+ 0x54C1, 0x0DBC, 0x54C2, 0x1115, 0x54C4, 0x1111, 0x54C6, 0x3832,
+ 0x54C7, 0x110C, 0x54C8, 0x1112, 0x54C9, 0x0838, 0x54CD, 0x3833,
+ 0x54D8, 0x1119, 0x54E1, 0x04BB, 0x54E2, 0x1122, 0x54E5, 0x111A,
+ 0x54E6, 0x111B, 0x54E8, 0x098D, 0x54E9, 0x0E97, 0x54ED, 0x1120,
+ 0x54EE, 0x111F, 0x54F2, 0x0C29, 0x54FA, 0x1121, 0x54FD, 0x111E,
+ 0x54FF, 0x20DE, 0x5504, 0x04D6, 0x5506, 0x0826, 0x5507, 0x09F6,
+ 0x550E, 0x3834, 0x550F, 0x111C, 0x5510, 0x0C5C, 0x5514, 0x111D,
+ 0x5516, 0x0466, 0x552B, 0x3835, 0x552E, 0x1127, 0x552F, 0x0F0D,
+ 0x5531, 0x098F, 0x5533, 0x112D, 0x5535, 0x3836, 0x5538, 0x112C,
+ 0x5539, 0x1123, 0x553E, 0x0B23, 0x5540, 0x1124, 0x5544, 0x0B4F,
+ 0x5545, 0x1129, 0x5546, 0x098E, 0x554A, 0x3837, 0x554C, 0x1126,
+ 0x554F, 0x0EF0, 0x5553, 0x0712, 0x5556, 0x112A, 0x5557, 0x112B,
+ 0x555C, 0x1128, 0x555D, 0x112E, 0x555E, 0x1DD1, 0x5560, 0x3838,
+ 0x5561, 0x3839, 0x5563, 0x1125, 0x557B, 0x1134, 0x557C, 0x1139,
+ 0x557E, 0x1135, 0x5580, 0x1130, 0x5583, 0x113A, 0x5584, 0x0AB3,
+ 0x5586, 0x20DF, 0x5587, 0x113C, 0x5588, 0x383A, 0x5589, 0x07B4,
+ 0x558A, 0x1132, 0x558B, 0x0BBB, 0x558E, 0x383B, 0x5598, 0x1136,
+ 0x5599, 0x112F, 0x559A, 0x05E9, 0x559C, 0x062A, 0x559D, 0x05C3,
+ 0x559E, 0x1137, 0x559F, 0x1133, 0x55A7, 0x074C, 0x55A8, 0x113D,
+ 0x55A9, 0x113B, 0x55AA, 0x0AD5, 0x55AB, 0x0664, 0x55AC, 0x06A4,
+ 0x55AE, 0x1138, 0x55B0, 0x06EC, 0x55B6, 0x04E6, 0x55C4, 0x1141,
+ 0x55C5, 0x113F, 0x55C7, 0x1178, 0x55D4, 0x1144, 0x55DA, 0x113E,
+ 0x55DC, 0x1142, 0x55DF, 0x1140, 0x55E3, 0x089A, 0x55E4, 0x1143,
+ 0x55F7, 0x1146, 0x55F9, 0x114B, 0x55FD, 0x1149, 0x55FE, 0x1148,
+ 0x5606, 0x0B70, 0x5608, 0x383C, 0x5609, 0x0545, 0x560E, 0x383D,
+ 0x560F, 0x383E, 0x5614, 0x1145, 0x5616, 0x1147, 0x5617, 0x0990,
+ 0x5618, 0x04D5, 0x561B, 0x114A, 0x5620, 0x3C1D, 0x5629, 0x055E,
+ 0x562F, 0x1155, 0x5631, 0x09E4, 0x5632, 0x1151, 0x5634, 0x114F,
+ 0x5636, 0x1150, 0x5637, 0x383F, 0x5638, 0x1152, 0x563F, 0x3840,
+ 0x5642, 0x04DF, 0x5649, 0x3841, 0x564B, 0x3842, 0x564C, 0x0ABB,
+ 0x564E, 0x114C, 0x564F, 0x3843, 0x5650, 0x114D, 0x5653, 0x1F1B,
+ 0x565B, 0x05D8, 0x5664, 0x1154, 0x5666, 0x3844, 0x5668, 0x062B,
+ 0x5669, 0x3845, 0x566A, 0x1157, 0x566B, 0x1153, 0x566C, 0x1156,
+ 0x566F, 0x3846, 0x5671, 0x3847, 0x5672, 0x3848, 0x5674, 0x0DFE,
+ 0x5676, 0x3C33, 0x5678, 0x0CAD, 0x567A, 0x0D4C, 0x5680, 0x1159,
+ 0x5686, 0x1158, 0x5687, 0x05A3, 0x568A, 0x115A, 0x568F, 0x115D,
+ 0x5694, 0x115C, 0x5695, 0x3849, 0x5699, 0x1DE6, 0x569A, 0x384A,
+ 0x56A0, 0x115B, 0x56A2, 0x0CEF, 0x56A5, 0x115E, 0x56AC, 0x384B,
+ 0x56AD, 0x384C, 0x56AE, 0x115F, 0x56B1, 0x384D, 0x56B4, 0x1161,
+ 0x56B6, 0x1160, 0x56BC, 0x1163, 0x56C0, 0x1166, 0x56C1, 0x1164,
+ 0x56C2, 0x1162, 0x56C3, 0x1165, 0x56C8, 0x1167, 0x56C9, 0x384E,
+ 0x56CA, 0x1E5A, 0x56CE, 0x1168, 0x56D1, 0x1169, 0x56D3, 0x116A,
+ 0x56D7, 0x116B, 0x56D8, 0x107C, 0x56DA, 0x0928, 0x56DB, 0x089B,
+ 0x56DD, 0x384F, 0x56DE, 0x0573, 0x56E0, 0x04BC, 0x56E3, 0x0B82,
+ 0x56E4, 0x3850, 0x56EE, 0x116C, 0x56F0, 0x0814, 0x56F2, 0x0493,
+ 0x56F3, 0x0A24, 0x56F9, 0x116D, 0x56FA, 0x077B, 0x56FD, 0x0803,
+ 0x56FF, 0x116F, 0x5700, 0x116E, 0x5703, 0x0E30, 0x5704, 0x1170,
+ 0x5708, 0x1172, 0x5709, 0x1171, 0x570A, 0x3851, 0x570B, 0x1173,
+ 0x570D, 0x1174, 0x570F, 0x074D, 0x5712, 0x0502, 0x5713, 0x1175,
+ 0x5715, 0x3852, 0x5716, 0x1177, 0x5718, 0x1176, 0x571C, 0x1179,
+ 0x571F, 0x0C54, 0x5721, 0x3680, 0x5723, 0x3853, 0x5726, 0x117A,
+ 0x5727, 0x0479, 0x5728, 0x084F, 0x572D, 0x0713, 0x572F, 0x3854,
+ 0x5730, 0x0B8D, 0x5733, 0x3855, 0x5734, 0x3856, 0x5737, 0x117B,
+ 0x5738, 0x117C, 0x573B, 0x117E, 0x5740, 0x117F, 0x5742, 0x0854,
+ 0x5747, 0x06C9, 0x574A, 0x0E65, 0x574C, 0x3857, 0x574E, 0x117D,
+ 0x574F, 0x1180, 0x5750, 0x0831, 0x5751, 0x07B5, 0x5759, 0x20E0,
+ 0x5761, 0x1184, 0x5764, 0x0815, 0x5765, 0x20E1, 0x5766, 0x0B71,
+ 0x5769, 0x1181, 0x576A, 0x0BF6, 0x5770, 0x3858, 0x577F, 0x1185,
+ 0x5782, 0x0A28, 0x5788, 0x1183, 0x5789, 0x1186, 0x578B, 0x0715,
+ 0x578C, 0x3859, 0x5793, 0x1187, 0x579C, 0x385A, 0x57A0, 0x1188,
+ 0x57A2, 0x07B6, 0x57A3, 0x059E, 0x57A4, 0x118A, 0x57AA, 0x118B,
+ 0x57AC, 0x20E2, 0x57B0, 0x118C, 0x57B3, 0x1189, 0x57B8, 0x385B,
+ 0x57C0, 0x1182, 0x57C3, 0x118D, 0x57C6, 0x118E, 0x57C7, 0x20E4,
+ 0x57C8, 0x20E3, 0x57CB, 0x0E92, 0x57CE, 0x09D3, 0x57D2, 0x1190,
+ 0x57D3, 0x1191, 0x57D4, 0x118F, 0x57D6, 0x1193, 0x57DC, 0x0CEE,
+ 0x57DF, 0x04AC, 0x57E0, 0x0DC8, 0x57E3, 0x1194, 0x57E6, 0x385C,
+ 0x57ED, 0x385D, 0x57F4, 0x09E5, 0x57F5, 0x385E, 0x57F6, 0x385F,
+ 0x57F7, 0x08E5, 0x57F9, 0x0D13, 0x57FA, 0x062C, 0x57FC, 0x085B,
+ 0x57FF, 0x3860, 0x5800, 0x0E87, 0x5802, 0x0C8A, 0x5805, 0x074E,
+ 0x5806, 0x0B2F, 0x5809, 0x3861, 0x580A, 0x1192, 0x580B, 0x1195,
+ 0x5815, 0x0B24, 0x5819, 0x1196, 0x581D, 0x1197, 0x5820, 0x3862,
+ 0x5821, 0x1199, 0x5824, 0x0C05, 0x582A, 0x05EA, 0x582F, 0x1D32,
+ 0x5830, 0x0503, 0x5831, 0x0E43, 0x5832, 0x3863, 0x5834, 0x09D4,
+ 0x5835, 0x0C42, 0x583A, 0x0856, 0x583D, 0x119F, 0x5840, 0x0E0D,
+ 0x5841, 0x0FA5, 0x584A, 0x0574, 0x584B, 0x119B, 0x5851, 0x0ABC,
+ 0x5852, 0x119E, 0x5854, 0x0C5D, 0x5857, 0x0C43, 0x5858, 0x0C5E,
+ 0x5859, 0x0D4D, 0x585A, 0x0BE9, 0x585E, 0x0839, 0x5861, 0x1E47,
+ 0x5862, 0x119A, 0x5869, 0x0518, 0x586B, 0x0C30, 0x5870, 0x119C,
+ 0x5872, 0x1198, 0x5875, 0x0A16, 0x5879, 0x11A0, 0x587C, 0x3864,
+ 0x587E, 0x0958, 0x5880, 0x3865, 0x5883, 0x06A5, 0x5885, 0x11A1,
+ 0x5893, 0x0E38, 0x5897, 0x0AFF, 0x589C, 0x0BE2, 0x589E, 0x20E7,
+ 0x589F, 0x11A3, 0x58A8, 0x0E7D, 0x58A9, 0x3866, 0x58AB, 0x11A4,
+ 0x58AE, 0x11A9, 0x58B2, 0x20E8, 0x58B3, 0x0DFF, 0x58B8, 0x11A8,
+ 0x58B9, 0x11A2, 0x58BA, 0x11A5, 0x58BB, 0x11A7, 0x58BE, 0x0816,
+ 0x58C1, 0x0E19, 0x58C5, 0x11AA, 0x58C7, 0x0B83, 0x58CA, 0x0575,
+ 0x58CC, 0x09D5, 0x58CE, 0x3867, 0x58D0, 0x3868, 0x58D1, 0x11AC,
+ 0x58D3, 0x11AB, 0x58D4, 0x3869, 0x58D5, 0x07FA, 0x58D7, 0x11AD,
+ 0x58D8, 0x11AF, 0x58D9, 0x11AE, 0x58DA, 0x386A, 0x58DC, 0x11B1,
+ 0x58DE, 0x11A6, 0x58DF, 0x11B3, 0x58E4, 0x11B2, 0x58E5, 0x11B0,
+ 0x58E9, 0x386B, 0x58EB, 0x089C, 0x58EC, 0x0A17, 0x58EE, 0x0AD6,
+ 0x58EF, 0x11B4, 0x58F0, 0x0A60, 0x58F1, 0x04B1, 0x58F2, 0x0D1A,
+ 0x58F7, 0x0BF7, 0x58F9, 0x11B6, 0x58FA, 0x11B5, 0x58FB, 0x11B7,
+ 0x58FC, 0x11B8, 0x58FD, 0x11B9, 0x5902, 0x11BA, 0x5909, 0x0E21,
+ 0x590A, 0x11BB, 0x590B, 0x20E9, 0x590C, 0x386C, 0x590F, 0x0546,
+ 0x5910, 0x11BC, 0x5915, 0x0F26, 0x5916, 0x058E, 0x5918, 0x10DE,
+ 0x5919, 0x0952, 0x591A, 0x0B1F, 0x591B, 0x11BD, 0x591C, 0x0EF7,
+ 0x5922, 0x0EC0, 0x5924, 0x386D, 0x5925, 0x11BF, 0x5927, 0x0B47,
+ 0x5929, 0x0C31, 0x592A, 0x0B20, 0x592B, 0x0DC9, 0x592C, 0x11C0,
+ 0x592D, 0x11C1, 0x592E, 0x051D, 0x592F, 0x386E, 0x5931, 0x08E6,
+ 0x5932, 0x11C2, 0x5937, 0x0494, 0x5938, 0x11C3, 0x5939, 0x3725,
+ 0x593E, 0x11C4, 0x5944, 0x0504, 0x5947, 0x062D, 0x5948, 0x0CB8,
+ 0x5949, 0x0E44, 0x594E, 0x11C8, 0x594F, 0x0AD7, 0x5950, 0x11C7,
+ 0x5951, 0x0716, 0x5953, 0x20EA, 0x5954, 0x0E89, 0x5955, 0x11C6,
+ 0x5957, 0x0C5F, 0x5958, 0x11CA, 0x595A, 0x11C9, 0x595B, 0x20EB,
+ 0x595D, 0x20EC, 0x5960, 0x11CC, 0x5961, 0x386F, 0x5962, 0x11CB,
+ 0x5963, 0x20ED, 0x5965, 0x051E, 0x5967, 0x11CD, 0x5968, 0x0991,
+ 0x5969, 0x11CF, 0x596A, 0x0B63, 0x596C, 0x11CE, 0x596D, 0x3870,
+ 0x596E, 0x0E03, 0x5973, 0x0981, 0x5974, 0x0C55, 0x5978, 0x11D0,
+ 0x597D, 0x07B7, 0x5981, 0x11D1, 0x5982, 0x0CD7, 0x5983, 0x0D72,
+ 0x5984, 0x0EDD, 0x598A, 0x0CDB, 0x598D, 0x11DA, 0x5993, 0x0652,
+ 0x5996, 0x0F2F, 0x5999, 0x0EBB, 0x599B, 0x1239, 0x599D, 0x11D2,
+ 0x59A3, 0x11D5, 0x59A4, 0x20EE, 0x59A5, 0x0B25, 0x59A8, 0x0E66,
+ 0x59AC, 0x0C44, 0x59B2, 0x11D6, 0x59B9, 0x0E93, 0x59BA, 0x20EF,
+ 0x59BB, 0x083A, 0x59BE, 0x0992, 0x59C6, 0x11D7, 0x59C9, 0x089E,
+ 0x59CA, 0x3871, 0x59CB, 0x089D, 0x59D0, 0x047D, 0x59D1, 0x077C,
+ 0x59D2, 0x3872, 0x59D3, 0x0A4F, 0x59D4, 0x0495, 0x59D9, 0x11DB,
+ 0x59DA, 0x11DC, 0x59DC, 0x11D9, 0x59DD, 0x3873, 0x59E3, 0x3874,
+ 0x59E4, 0x3875, 0x59E5, 0x04DA, 0x59E6, 0x05EB, 0x59E8, 0x11D8,
+ 0x59EA, 0x0ED1, 0x59EB, 0x0DA3, 0x59EC, 0x36AD, 0x59F6, 0x046C,
+ 0x59FB, 0x04BD, 0x59FF, 0x089F, 0x5A01, 0x0496, 0x5A03, 0x0467,
+ 0x5A04, 0x3876, 0x5A09, 0x11E1, 0x5A0C, 0x3877, 0x5A11, 0x11DF,
+ 0x5A18, 0x0EC8, 0x5A1A, 0x11E2, 0x5A1B, 0x35C1, 0x5A1C, 0x11E0,
+ 0x5A1F, 0x11DE, 0x5A20, 0x09F7, 0x5A23, 0x3878, 0x5A25, 0x11DD,
+ 0x5A29, 0x0E2A, 0x5A2F, 0x0798, 0x5A35, 0x11E6, 0x5A36, 0x11E7,
+ 0x5A3C, 0x0993, 0x5A40, 0x11E3, 0x5A41, 0x0FD2, 0x5A46, 0x0D02,
+ 0x5A47, 0x3879, 0x5A49, 0x11E5, 0x5A55, 0x387A, 0x5A5A, 0x0817,
+ 0x5A62, 0x11E8, 0x5A63, 0x387B, 0x5A66, 0x0DCA, 0x5A6A, 0x11E9,
+ 0x5A6C, 0x11E4, 0x5A6D, 0x387C, 0x5A7E, 0x387D, 0x5A7F, 0x0EC7,
+ 0x5A92, 0x0D14, 0x5A9A, 0x11EA, 0x5A9B, 0x0DA4, 0x5A9E, 0x387E,
+ 0x5AA7, 0x387F, 0x5AAC, 0x3880, 0x5AB3, 0x3881, 0x5ABC, 0x11EB,
+ 0x5ABD, 0x11EF, 0x5ABE, 0x11EC, 0x5AC1, 0x0547, 0x5AC2, 0x11EE,
+ 0x5AC9, 0x08E7, 0x5ACB, 0x11ED, 0x5ACC, 0x074F, 0x5AD0, 0x11FB,
+ 0x5AD6, 0x11F4, 0x5AD7, 0x11F1, 0x5AE0, 0x3882, 0x5AE1, 0x0BA2,
+ 0x5AE3, 0x11F0, 0x5AE6, 0x11F2, 0x5AE9, 0x11F3, 0x5AFA, 0x11F5,
+ 0x5AFB, 0x11F6, 0x5B00, 0x3883, 0x5B09, 0x062E, 0x5B0B, 0x11F8,
+ 0x5B0C, 0x11F7, 0x5B16, 0x11F9, 0x5B19, 0x3884, 0x5B22, 0x09D6,
+ 0x5B25, 0x3885, 0x5B2A, 0x11FC, 0x5B2C, 0x0BF8, 0x5B2D, 0x3886,
+ 0x5B30, 0x04E7, 0x5B32, 0x11FA, 0x5B36, 0x11FD, 0x5B3E, 0x11FE,
+ 0x5B40, 0x1201, 0x5B41, 0x3887, 0x5B43, 0x11FF, 0x5B45, 0x1200,
+ 0x5B50, 0x08A0, 0x5B51, 0x1202, 0x5B54, 0x07B8, 0x5B55, 0x1203,
+ 0x5B56, 0x20F0, 0x5B57, 0x08C8, 0x5B58, 0x0B18, 0x5B5A, 0x1204,
+ 0x5B5B, 0x1205, 0x5B5C, 0x08A8, 0x5B5D, 0x07B9, 0x5B5F, 0x0EDE,
+ 0x5B63, 0x0642, 0x5B64, 0x077D, 0x5B65, 0x1206, 0x5B66, 0x05B6,
+ 0x5B69, 0x1207, 0x5B6B, 0x0B19, 0x5B70, 0x1208, 0x5B71, 0x1230,
+ 0x5B73, 0x1209, 0x5B75, 0x120A, 0x5B78, 0x120B, 0x5B7A, 0x120D,
+ 0x5B7C, 0x3888, 0x5B7E, 0x3889, 0x5B7F, 0x388A, 0x5B80, 0x120E,
+ 0x5B82, 0x3610, 0x5B83, 0x120F, 0x5B85, 0x0B50, 0x5B87, 0x04C9,
+ 0x5B88, 0x0915, 0x5B89, 0x0486, 0x5B8A, 0x388B, 0x5B8B, 0x0AD9,
+ 0x5B8C, 0x05EC, 0x5B8D, 0x08E1, 0x5B8F, 0x07BA, 0x5B95, 0x0C60,
+ 0x5B97, 0x092B, 0x5B98, 0x05ED, 0x5B99, 0x0BA6, 0x5B9A, 0x0C06,
+ 0x5B9B, 0x047C, 0x5B9C, 0x0653, 0x5B9D, 0x0E45, 0x5B9F, 0x08EE,
+ 0x5BA2, 0x066C, 0x5BA3, 0x0A8F, 0x5BA4, 0x08E8, 0x5BA5, 0x0F12,
+ 0x5BA6, 0x1210, 0x5BAE, 0x0676, 0x5BB0, 0x083B, 0x5BB3, 0x0590,
+ 0x5BB4, 0x0505, 0x5BB5, 0x0994, 0x5BB6, 0x0548, 0x5BB8, 0x1211,
+ 0x5BB9, 0x0F30, 0x5BBF, 0x0953, 0x5BC0, 0x20F1, 0x5BC2, 0x0910,
+ 0x5BC3, 0x1212, 0x5BC4, 0x062F, 0x5BC5, 0x0CAA, 0x5BC6, 0x0EB5,
+ 0x5BC7, 0x1213, 0x5BC9, 0x1214, 0x5BCC, 0x0DCB, 0x5BD0, 0x1216,
+ 0x5BD2, 0x05E4, 0x5BD3, 0x06EF, 0x5BD4, 0x1215, 0x5BD8, 0x20F3,
+ 0x5BDB, 0x05EE, 0x5BDD, 0x09F8, 0x5BDE, 0x121A, 0x5BDF, 0x086F,
+ 0x5BE1, 0x0549, 0x5BE2, 0x1219, 0x5BE4, 0x1217, 0x5BE5, 0x121B,
+ 0x5BE6, 0x1218, 0x5BE7, 0x0CE1, 0x5BE8, 0x148E, 0x5BE9, 0x09F9,
+ 0x5BEB, 0x121C, 0x5BEC, 0x20F4, 0x5BEE, 0x0F88, 0x5BF0, 0x121D,
+ 0x5BF3, 0x121F, 0x5BF5, 0x0BBC, 0x5BF6, 0x121E, 0x5BF8, 0x0A47,
+ 0x5BFA, 0x08C9, 0x5BFE, 0x0B30, 0x5BFF, 0x0923, 0x5C01, 0x0DE7,
+ 0x5C02, 0x0A90, 0x5C04, 0x08F9, 0x5C05, 0x1220, 0x5C06, 0x0995,
+ 0x5C07, 0x1221, 0x5C08, 0x1222, 0x5C09, 0x0497, 0x5C0A, 0x0B1A,
+ 0x5C0B, 0x0A18, 0x5C0D, 0x1223, 0x5C0E, 0x0C8B, 0x5C0F, 0x0996,
+ 0x5C11, 0x0997, 0x5C13, 0x1224, 0x5C14, 0x372A, 0x5C16, 0x0A91,
+ 0x5C19, 0x360B, 0x5C1A, 0x0998, 0x5C1E, 0x20F5, 0x5C20, 0x1225,
+ 0x5C22, 0x1226, 0x5C23, 0x388C, 0x5C24, 0x0EEC, 0x5C28, 0x1227,
+ 0x5C2B, 0x388D, 0x5C2D, 0x06BE, 0x5C30, 0x388E, 0x5C31, 0x092C,
+ 0x5C38, 0x1228, 0x5C39, 0x1229, 0x5C3A, 0x0908, 0x5C3B, 0x09F2,
+ 0x5C3C, 0x0CCC, 0x5C3D, 0x0A1A, 0x5C3E, 0x0D8C, 0x5C3F, 0x0CD8,
+ 0x5C40, 0x06C1, 0x5C41, 0x122A, 0x5C45, 0x0689, 0x5C46, 0x122B,
+ 0x5C48, 0x06F6, 0x5C4A, 0x0CA7, 0x5C4B, 0x0530, 0x5C4D, 0x08A1,
+ 0x5C4E, 0x122C, 0x5C4F, 0x122F, 0x5C50, 0x122E, 0x5C51, 0x06F5,
+ 0x5C53, 0x122D, 0x5C55, 0x0C32, 0x5C5B, 0x1E92, 0x5C5E, 0x0B10,
+ 0x5C60, 0x0C45, 0x5C61, 0x08F4, 0x5C62, 0x1E0D, 0x5C63, 0x388F,
+ 0x5C64, 0x0ADA, 0x5C65, 0x0F64, 0x5C69, 0x3890, 0x5C6C, 0x1231,
+ 0x5C6E, 0x1232, 0x5C6F, 0x0CAE, 0x5C71, 0x0881, 0x5C76, 0x1234,
+ 0x5C79, 0x1235, 0x5C7C, 0x3891, 0x5C8C, 0x1236, 0x5C90, 0x0630,
+ 0x5C91, 0x1237, 0x5C94, 0x1238, 0x5CA1, 0x052C, 0x5CA6, 0x20F6,
+ 0x5CA8, 0x0ABD, 0x5CA9, 0x0620, 0x5CAB, 0x123A, 0x5CAC, 0x0EB4,
+ 0x5CB1, 0x0B32, 0x5CB3, 0x05B7, 0x5CB6, 0x123C, 0x5CB7, 0x123E,
+ 0x5CB8, 0x061B, 0x5CBA, 0x20F7, 0x5CBB, 0x123B, 0x5CBC, 0x123D,
+ 0x5CBE, 0x1240, 0x5CC5, 0x123F, 0x5CC7, 0x1241, 0x5CCB, 0x3892,
+ 0x5CD2, 0x3893, 0x5CD9, 0x1242, 0x5CE0, 0x0C95, 0x5CE1, 0x06A6,
+ 0x5CE6, 0x372C, 0x5CE8, 0x0565, 0x5CE9, 0x1243, 0x5CEA, 0x1248,
+ 0x5CED, 0x1246, 0x5CEF, 0x0E47, 0x5CF0, 0x0E46, 0x5CF4, 0x3894,
+ 0x5CF5, 0x20F8, 0x5CF6, 0x0C61, 0x5CFA, 0x1245, 0x5CFB, 0x095E,
+ 0x5CFD, 0x1244, 0x5D07, 0x0A38, 0x5D0B, 0x1249, 0x5D0E, 0x085A,
+ 0x5D11, 0x124F, 0x5D14, 0x1250, 0x5D15, 0x124A, 0x5D16, 0x0591,
+ 0x5D17, 0x124B, 0x5D18, 0x1254, 0x5D19, 0x1253, 0x5D1A, 0x1252,
+ 0x5D1B, 0x124E, 0x5D1F, 0x124D, 0x5D22, 0x1251, 0x5D24, 0x3895,
+ 0x5D26, 0x3896, 0x5D27, 0x20F9, 0x5D29, 0x0E48, 0x5D42, 0x20FC,
+ 0x5D43, 0x3897, 0x5D46, 0x3898, 0x5D4A, 0x3899, 0x5D4B, 0x1258,
+ 0x5D4C, 0x1255, 0x5D4E, 0x1257, 0x5D50, 0x0F5C, 0x5D52, 0x1256,
+ 0x5D53, 0x20FA, 0x5D5C, 0x124C, 0x5D69, 0x0A39, 0x5D6C, 0x1259,
+ 0x5D6D, 0x20FD, 0x5D6F, 0x0827, 0x5D73, 0x125A, 0x5D76, 0x125B,
+ 0x5D82, 0x125E, 0x5D84, 0x125D, 0x5D87, 0x125C, 0x5D8B, 0x0C62,
+ 0x5D8C, 0x1247, 0x5D90, 0x1264, 0x5D92, 0x389A, 0x5D94, 0x389B,
+ 0x5D99, 0x389C, 0x5D9D, 0x1260, 0x5DA0, 0x389D, 0x5DA2, 0x125F,
+ 0x5DAC, 0x1261, 0x5DAE, 0x1262, 0x5DB2, 0x3BA5, 0x5DB7, 0x1265,
+ 0x5DB8, 0x20FE, 0x5DB9, 0x20FF, 0x5DBA, 0x0FAE, 0x5DBC, 0x1266,
+ 0x5DBD, 0x1263, 0x5DC9, 0x1267, 0x5DCC, 0x061C, 0x5DCD, 0x1268,
+ 0x5DD0, 0x2100, 0x5DD2, 0x126A, 0x5DD3, 0x1269, 0x5DD6, 0x126B,
+ 0x5DD8, 0x389E, 0x5DDB, 0x126C, 0x5DDD, 0x0A92, 0x5DDE, 0x092D,
+ 0x5DE0, 0x389F, 0x5DE1, 0x096E, 0x5DE2, 0x3432, 0x5DE3, 0x0AE5,
+ 0x5DE5, 0x07BB, 0x5DE6, 0x0828, 0x5DE7, 0x07BC, 0x5DE8, 0x068A,
+ 0x5DEB, 0x126D, 0x5DEE, 0x0829, 0x5DF1, 0x077E, 0x5DF2, 0x126E,
+ 0x5DF3, 0x0EB2, 0x5DF4, 0x0CF9, 0x5DF5, 0x126F, 0x5DF7, 0x07BD,
+ 0x5DF8, 0x38A0, 0x5DFB, 0x05E8, 0x5DFD, 0x0B65, 0x5DFE, 0x06CA,
+ 0x5DFF, 0x35E2, 0x5E00, 0x38A1, 0x5E02, 0x08A2, 0x5E03, 0x0DCD,
+ 0x5E06, 0x0D55, 0x5E0B, 0x1270, 0x5E0C, 0x0631, 0x5E11, 0x1273,
+ 0x5E12, 0x38A2, 0x5E14, 0x38A3, 0x5E15, 0x38A4, 0x5E16, 0x0BBD,
+ 0x5E18, 0x38A5, 0x5E19, 0x1272, 0x5E1A, 0x1271, 0x5E1B, 0x1274,
+ 0x5E1D, 0x0C07, 0x5E25, 0x0A29, 0x5E2B, 0x08A3, 0x5E2D, 0x0A6E,
+ 0x5E2E, 0x38A6, 0x5E2F, 0x0B33, 0x5E30, 0x063C, 0x5E33, 0x0BBE,
+ 0x5E36, 0x1275, 0x5E37, 0x1276, 0x5E38, 0x09D7, 0x5E3D, 0x0E67,
+ 0x5E40, 0x1279, 0x5E43, 0x1278, 0x5E44, 0x1277, 0x5E45, 0x0DEF,
+ 0x5E47, 0x1280, 0x5E4C, 0x0E88, 0x5E4E, 0x127A, 0x5E54, 0x127C,
+ 0x5E55, 0x0E99, 0x5E57, 0x127B, 0x5E58, 0x38A7, 0x5E5F, 0x127D,
+ 0x5E61, 0x0D3C, 0x5E62, 0x127E, 0x5E63, 0x0E0E, 0x5E64, 0x127F,
+ 0x5E6B, 0x38A8, 0x5E6C, 0x38A9, 0x5E72, 0x05EF, 0x5E73, 0x0E0F,
+ 0x5E74, 0x0CE5, 0x5E75, 0x1281, 0x5E76, 0x1282, 0x5E78, 0x07BE,
+ 0x5E79, 0x05F0, 0x5E7A, 0x1283, 0x5E7B, 0x076C, 0x5E7C, 0x0F2E,
+ 0x5E7D, 0x0F13, 0x5E7E, 0x0632, 0x5E7F, 0x1285, 0x5E81, 0x0BBF,
+ 0x5E83, 0x07BF, 0x5E84, 0x0999, 0x5E87, 0x0D73, 0x5E8A, 0x099A,
+ 0x5E8F, 0x0982, 0x5E95, 0x0C08, 0x5E96, 0x0E49, 0x5E97, 0x0C33,
+ 0x5E99, 0x36B0, 0x5E9A, 0x07C0, 0x5E9C, 0x0DCE, 0x5EA0, 0x1286,
+ 0x5EA6, 0x0C53, 0x5EA7, 0x0832, 0x5EA8, 0x38AA, 0x5EAA, 0x38AB,
+ 0x5EAB, 0x077F, 0x5EAD, 0x0C09, 0x5EB5, 0x0487, 0x5EB6, 0x0978,
+ 0x5EB7, 0x07C1, 0x5EB8, 0x0F31, 0x5EBE, 0x38AC, 0x5EBF, 0x38AD,
+ 0x5EC1, 0x1287, 0x5EC2, 0x1288, 0x5EC3, 0x0D07, 0x5EC8, 0x1289,
+ 0x5EC9, 0x0FBF, 0x5ECA, 0x0FD3, 0x5ECB, 0x38AE, 0x5ECF, 0x128B,
+ 0x5ED0, 0x128A, 0x5ED2, 0x38AF, 0x5ED3, 0x05A5, 0x5ED6, 0x128C,
+ 0x5EDA, 0x128F, 0x5EDB, 0x1290, 0x5EDD, 0x128E, 0x5EDF, 0x0DB2,
+ 0x5EE0, 0x099B, 0x5EE1, 0x1292, 0x5EE2, 0x1291, 0x5EE3, 0x128D,
+ 0x5EE8, 0x1293, 0x5EE9, 0x1294, 0x5EEC, 0x1295, 0x5EF0, 0x1298,
+ 0x5EF1, 0x1296, 0x5EF3, 0x1297, 0x5EF4, 0x1299, 0x5EF6, 0x0506,
+ 0x5EF7, 0x0C0A, 0x5EF8, 0x129A, 0x5EFA, 0x0750, 0x5EFB, 0x0576,
+ 0x5EFC, 0x0CEC, 0x5EFE, 0x129B, 0x5EFF, 0x0CD3, 0x5F01, 0x0E2B,
+ 0x5F03, 0x129C, 0x5F04, 0x0FD4, 0x5F07, 0x38B0, 0x5F09, 0x129D,
+ 0x5F0A, 0x0E10, 0x5F0B, 0x12A0, 0x5F0C, 0x0FFA, 0x5F0D, 0x100A,
+ 0x5F0E, 0x38B1, 0x5F0F, 0x08DC, 0x5F10, 0x0CCD, 0x5F11, 0x12A1,
+ 0x5F13, 0x0677, 0x5F14, 0x0BC0, 0x5F15, 0x04BE, 0x5F16, 0x12A2,
+ 0x5F17, 0x0DF6, 0x5F18, 0x07C2, 0x5F1B, 0x0B8E, 0x5F1C, 0x38B2,
+ 0x5F1D, 0x38B3, 0x5F1F, 0x0C0B, 0x5F21, 0x2101, 0x5F22, 0x38B4,
+ 0x5F25, 0x0EFB, 0x5F26, 0x076D, 0x5F27, 0x0780, 0x5F28, 0x38B5,
+ 0x5F29, 0x12A3, 0x5F2D, 0x12A4, 0x5F2F, 0x12AA, 0x5F31, 0x0911,
+ 0x5F34, 0x2102, 0x5F35, 0x0BC1, 0x5F36, 0x38B6, 0x5F37, 0x06A7,
+ 0x5F38, 0x12A5, 0x5F3A, 0x3598, 0x5F3B, 0x38B7, 0x5F3C, 0x0D9D,
+ 0x5F3E, 0x0B84, 0x5F40, 0x38B8, 0x5F41, 0x12A6, 0x5F45, 0x20B2,
+ 0x5F48, 0x12A7, 0x5F4A, 0x06A8, 0x5F4C, 0x12A8, 0x5F4E, 0x12A9,
+ 0x5F50, 0x38B9, 0x5F51, 0x12AB, 0x5F53, 0x0C70, 0x5F56, 0x12AC,
+ 0x5F57, 0x12AD, 0x5F58, 0x38BA, 0x5F59, 0x12AE, 0x5F5C, 0x129F,
+ 0x5F5D, 0x129E, 0x5F61, 0x12AF, 0x5F62, 0x0717, 0x5F64, 0x38BB,
+ 0x5F65, 0x36AC, 0x5F66, 0x0D99, 0x5F67, 0x2103, 0x5F69, 0x083C,
+ 0x5F6A, 0x0DA9, 0x5F6B, 0x0BC2, 0x5F6C, 0x0DBD, 0x5F6D, 0x12B0,
+ 0x5F70, 0x099C, 0x5F71, 0x04E8, 0x5F73, 0x12B1, 0x5F77, 0x12B2,
+ 0x5F79, 0x0EFE, 0x5F7C, 0x0D74, 0x5F7F, 0x12B5, 0x5F80, 0x051F,
+ 0x5F81, 0x0A50, 0x5F82, 0x12B4, 0x5F83, 0x12B3, 0x5F84, 0x0718,
+ 0x5F85, 0x0B34, 0x5F87, 0x12B9, 0x5F88, 0x12B7, 0x5F89, 0x38BC,
+ 0x5F8A, 0x12B6, 0x5F8B, 0x0F6F, 0x5F8C, 0x0799, 0x5F90, 0x0983,
+ 0x5F91, 0x12B8, 0x5F92, 0x0C46, 0x5F93, 0x0948, 0x5F97, 0x0C98,
+ 0x5F98, 0x12BC, 0x5F99, 0x12BB, 0x5F9C, 0x38BD, 0x5F9E, 0x12BA,
+ 0x5FA0, 0x12BD, 0x5FA1, 0x079A, 0x5FA4, 0x38BF, 0x5FA7, 0x38BE,
+ 0x5FA8, 0x12BE, 0x5FA9, 0x0DEE, 0x5FAA, 0x0965, 0x5FAD, 0x12BF,
+ 0x5FAE, 0x0D8D, 0x5FAF, 0x38C0, 0x5FB3, 0x0C99, 0x5FB4, 0x0BC3,
+ 0x5FB5, 0x3438, 0x5FB7, 0x2104, 0x5FB8, 0x38C1, 0x5FB9, 0x0C2A,
+ 0x5FBC, 0x12C0, 0x5FBD, 0x0645, 0x5FC3, 0x09FA, 0x5FC4, 0x38C2,
+ 0x5FC5, 0x0D9E, 0x5FC9, 0x38C3, 0x5FCC, 0x0633, 0x5FCD, 0x0CDC,
+ 0x5FD6, 0x12C1, 0x5FD7, 0x08A4, 0x5FD8, 0x0E68, 0x5FD9, 0x0E69,
+ 0x5FDC, 0x0520, 0x5FDD, 0x12C6, 0x5FDE, 0x2105, 0x5FE0, 0x0BA7,
+ 0x5FE1, 0x38C4, 0x5FE4, 0x12C3, 0x5FE9, 0x38C5, 0x5FEB, 0x0577,
+ 0x5FED, 0x38C6, 0x5FF0, 0x12F6, 0x5FF1, 0x12C5, 0x5FF5, 0x0CE6,
+ 0x5FF8, 0x12C4, 0x5FFB, 0x12C2, 0x5FFC, 0x38C7, 0x5FFD, 0x080C,
+ 0x5FFF, 0x12C8, 0x600E, 0x12CE, 0x600F, 0x12D4, 0x6010, 0x12CC,
+ 0x6012, 0x0C56, 0x6015, 0x12D1, 0x6016, 0x0DCF, 0x6017, 0x38C8,
+ 0x6019, 0x12CB, 0x601A, 0x38C9, 0x601B, 0x12D0, 0x601C, 0x0FAF,
+ 0x601D, 0x08A5, 0x6020, 0x0B35, 0x6021, 0x12C9, 0x6025, 0x0678,
+ 0x6026, 0x12D3, 0x6027, 0x0A51, 0x6028, 0x0507, 0x6029, 0x12CD,
+ 0x602A, 0x0578, 0x602B, 0x12D2, 0x602F, 0x06A9, 0x6031, 0x12CF,
+ 0x6033, 0x38CA, 0x603A, 0x12D5, 0x6041, 0x12D7, 0x6042, 0x12E1,
+ 0x6043, 0x12DF, 0x6046, 0x12DC, 0x604A, 0x12DB, 0x604B, 0x0FC0,
+ 0x604D, 0x12DD, 0x6050, 0x06AA, 0x6052, 0x07C3, 0x6055, 0x0984,
+ 0x6059, 0x12E4, 0x605A, 0x12D6, 0x605D, 0x2106, 0x605F, 0x12DA,
+ 0x6060, 0x12CA, 0x6061, 0x38CB, 0x6062, 0x057A, 0x6063, 0x12DE,
+ 0x6064, 0x12E0, 0x6065, 0x0B8F, 0x6068, 0x0818, 0x6069, 0x0538,
+ 0x606A, 0x12D8, 0x606B, 0x12E3, 0x606C, 0x12E2, 0x606D, 0x06AB,
+ 0x606F, 0x0B09, 0x6070, 0x05C4, 0x6075, 0x0719, 0x6077, 0x12D9,
+ 0x607F, 0x38CC, 0x6081, 0x12E5, 0x6083, 0x12E8, 0x6084, 0x12EA,
+ 0x6085, 0x2107, 0x6089, 0x08E9, 0x608A, 0x2108, 0x608B, 0x12F0,
+ 0x608C, 0x0C0C, 0x608D, 0x12E6, 0x6092, 0x12EE, 0x6094, 0x0579,
+ 0x6096, 0x12EC, 0x6097, 0x12ED, 0x609A, 0x12E9, 0x609B, 0x12EB,
+ 0x609E, 0x38CD, 0x609F, 0x079B, 0x60A0, 0x0F14, 0x60A3, 0x05F1,
+ 0x60A4, 0x38CE, 0x60A6, 0x04FB, 0x60A7, 0x12EF, 0x60A9, 0x0CF0,
+ 0x60AA, 0x0471, 0x60B0, 0x38CF, 0x60B2, 0x0D75, 0x60B3, 0x12C7,
+ 0x60B4, 0x12F5, 0x60B5, 0x12F9, 0x60B6, 0x0EF1, 0x60B8, 0x12F2,
+ 0x60BC, 0x0C63, 0x60BD, 0x12F7, 0x60C5, 0x09D8, 0x60C6, 0x12F8,
+ 0x60C7, 0x0CAF, 0x60CB, 0x38D0, 0x60D1, 0x0FED, 0x60D3, 0x12F4,
+ 0x60D5, 0x210A, 0x60D8, 0x12FA, 0x60DA, 0x080D, 0x60DB, 0x38D1,
+ 0x60DC, 0x0A6F, 0x60DE, 0x2109, 0x60DF, 0x0498, 0x60E0, 0x12F3,
+ 0x60E1, 0x12F1, 0x60E3, 0x0ADC, 0x60E7, 0x12E7, 0x60E8, 0x0882,
+ 0x60F0, 0x0B26, 0x60F1, 0x1306, 0x60F2, 0x210C, 0x60F3, 0x0ADD,
+ 0x60F4, 0x1301, 0x60F6, 0x12FE, 0x60F7, 0x12FF, 0x60F8, 0x38D2,
+ 0x60F9, 0x0912, 0x60FA, 0x1302, 0x60FB, 0x1305, 0x6100, 0x1300,
+ 0x6101, 0x092F, 0x6103, 0x1303, 0x6106, 0x12FD, 0x6108, 0x0F08,
+ 0x6109, 0x0F07, 0x610D, 0x1307, 0x610E, 0x1308, 0x610F, 0x0499,
+ 0x6111, 0x210D, 0x6112, 0x38D3, 0x6113, 0x38D4, 0x6114, 0x38D5,
+ 0x6115, 0x12FC, 0x611A, 0x06EA, 0x611B, 0x046A, 0x611C, 0x38D6,
+ 0x611F, 0x05F2, 0x6120, 0x210B, 0x6121, 0x1304, 0x6127, 0x130C,
+ 0x6128, 0x130B, 0x612C, 0x1310, 0x6130, 0x210F, 0x6134, 0x1311,
+ 0x6137, 0x210E, 0x613C, 0x130F, 0x613D, 0x1312, 0x613E, 0x130A,
+ 0x613F, 0x130E, 0x6142, 0x1313, 0x6144, 0x1314, 0x6147, 0x1309,
+ 0x6148, 0x08CA, 0x614A, 0x130D, 0x614B, 0x0B36, 0x614C, 0x07C4,
+ 0x614D, 0x12FB, 0x614E, 0x09FB, 0x6153, 0x1321, 0x6155, 0x0E39,
+ 0x6158, 0x1317, 0x6159, 0x1318, 0x615A, 0x1319, 0x615D, 0x1320,
+ 0x615F, 0x131F, 0x6162, 0x0EAB, 0x6163, 0x05F3, 0x6165, 0x131D,
+ 0x6167, 0x071B, 0x6168, 0x0592, 0x616B, 0x131A, 0x616E, 0x0F80,
+ 0x616F, 0x131C, 0x6170, 0x049A, 0x6171, 0x131E, 0x6173, 0x1315,
+ 0x6174, 0x131B, 0x6175, 0x1322, 0x6176, 0x071A, 0x6177, 0x1316,
+ 0x617C, 0x38D7, 0x617E, 0x0F47, 0x6182, 0x0F15, 0x6187, 0x1325,
+ 0x618A, 0x1329, 0x618D, 0x38D8, 0x618E, 0x0B00, 0x6190, 0x0FC1,
+ 0x6191, 0x132A, 0x6194, 0x1327, 0x6196, 0x1324, 0x6198, 0x2110,
+ 0x6199, 0x1323, 0x619A, 0x1328, 0x619F, 0x38D9, 0x61A4, 0x0E00,
+ 0x61A7, 0x0C8C, 0x61A8, 0x38DA, 0x61A9, 0x071C, 0x61AB, 0x132B,
+ 0x61AC, 0x1326, 0x61AE, 0x132C, 0x61B2, 0x0751, 0x61B6, 0x0531,
+ 0x61BA, 0x1334, 0x61BE, 0x05F4, 0x61C2, 0x38DB, 0x61C3, 0x1332,
+ 0x61C6, 0x1333, 0x61C7, 0x0819, 0x61C8, 0x1331, 0x61C9, 0x132F,
+ 0x61CA, 0x132E, 0x61CB, 0x1335, 0x61CC, 0x132D, 0x61CD, 0x1337,
+ 0x61D0, 0x057B, 0x61DF, 0x38DC, 0x61E3, 0x1339, 0x61E6, 0x1338,
+ 0x61F2, 0x0BC4, 0x61F4, 0x133C, 0x61F6, 0x133A, 0x61F7, 0x1330,
+ 0x61F8, 0x0752, 0x61FA, 0x133B, 0x61FC, 0x133F, 0x61FD, 0x133E,
+ 0x61FE, 0x1340, 0x61FF, 0x133D, 0x6200, 0x1341, 0x6208, 0x1342,
+ 0x6209, 0x1343, 0x620A, 0x0E3A, 0x620C, 0x1345, 0x620D, 0x1344,
+ 0x620E, 0x0949, 0x6210, 0x0A52, 0x6211, 0x0566, 0x6212, 0x057C,
+ 0x6213, 0x2111, 0x6214, 0x1346, 0x6215, 0x38DD, 0x6216, 0x0483,
+ 0x621A, 0x0A70, 0x621B, 0x1347, 0x621D, 0x1A64, 0x621E, 0x1348,
+ 0x621F, 0x0737, 0x6221, 0x1349, 0x6226, 0x0A93, 0x6229, 0x38DE,
+ 0x622A, 0x134A, 0x622E, 0x134B, 0x622F, 0x0654, 0x6230, 0x134C,
+ 0x6232, 0x134D, 0x6233, 0x134E, 0x6234, 0x0B37, 0x6236, 0x35BD,
+ 0x6238, 0x0781, 0x623B, 0x0EED, 0x623E, 0x344E, 0x623F, 0x0E6A,
+ 0x6240, 0x0974, 0x6241, 0x134F, 0x6243, 0x38DF, 0x6246, 0x38E0,
+ 0x6247, 0x0A94, 0x6248, 0x1B1A, 0x6249, 0x0D76, 0x624B, 0x0916,
+ 0x624C, 0x38E1, 0x624D, 0x083D, 0x624E, 0x1350, 0x6251, 0x38E2,
+ 0x6253, 0x0B27, 0x6255, 0x0DF7, 0x6256, 0x38E3, 0x6258, 0x0B51,
+ 0x625B, 0x1353, 0x625E, 0x1351, 0x6260, 0x1354, 0x6263, 0x1352,
+ 0x6268, 0x1355, 0x626E, 0x0E01, 0x6271, 0x047B, 0x6276, 0x0DD0,
+ 0x6279, 0x0D77, 0x627C, 0x1356, 0x627E, 0x1359, 0x627F, 0x099D,
+ 0x6280, 0x0655, 0x6282, 0x1357, 0x6283, 0x135E, 0x6284, 0x099E,
+ 0x6285, 0x35C5, 0x6289, 0x1358, 0x628A, 0x0CFA, 0x6291, 0x0F48,
+ 0x6292, 0x135A, 0x6293, 0x135B, 0x6294, 0x135F, 0x6295, 0x0C64,
+ 0x6296, 0x135C, 0x6297, 0x07C5, 0x6298, 0x0A82, 0x629B, 0x136D,
+ 0x629C, 0x0D48, 0x629E, 0x0B52, 0x62A6, 0x2112, 0x62AB, 0x0D78,
+ 0x62AC, 0x13B2, 0x62B1, 0x0E4A, 0x62B5, 0x0C0D, 0x62B9, 0x0EA3,
+ 0x62BB, 0x1362, 0x62BC, 0x0521, 0x62BD, 0x0BA8, 0x62C2, 0x136B,
+ 0x62C4, 0x38E4, 0x62C5, 0x0B72, 0x62C6, 0x1365, 0x62C7, 0x136C,
+ 0x62C8, 0x1367, 0x62C9, 0x136E, 0x62CA, 0x136A, 0x62CC, 0x1369,
+ 0x62CD, 0x0D25, 0x62CF, 0x1363, 0x62D0, 0x057D, 0x62D1, 0x1361,
+ 0x62D2, 0x068B, 0x62D3, 0x0B53, 0x62D4, 0x135D, 0x62D7, 0x1360,
+ 0x62D8, 0x07C6, 0x62D9, 0x0A7F, 0x62DB, 0x099F, 0x62DC, 0x1368,
+ 0x62DD, 0x0D08, 0x62E0, 0x068C, 0x62E1, 0x05A6, 0x62EC, 0x05C5,
+ 0x62ED, 0x09E7, 0x62EE, 0x1370, 0x62EF, 0x1375, 0x62F1, 0x1371,
+ 0x62F3, 0x0753, 0x62F5, 0x1376, 0x62F6, 0x0870, 0x62F7, 0x07FB,
+ 0x62FC, 0x38E5, 0x62FE, 0x0930, 0x62FF, 0x1364, 0x6301, 0x08CB,
+ 0x6302, 0x1373, 0x6307, 0x08A6, 0x6308, 0x1374, 0x6309, 0x0488,
+ 0x630A, 0x38E6, 0x630C, 0x136F, 0x630D, 0x38E7, 0x6311, 0x0BC5,
+ 0x6318, 0x38E8, 0x6319, 0x068D, 0x631B, 0x3737, 0x631F, 0x06AC,
+ 0x6327, 0x1372, 0x6328, 0x046B, 0x632B, 0x0833, 0x632F, 0x09FC,
+ 0x6339, 0x38E9, 0x633A, 0x0C0E, 0x633D, 0x0D68, 0x633E, 0x1378,
+ 0x633F, 0x0AE0, 0x6342, 0x38EA, 0x6343, 0x38EB, 0x6349, 0x0B0A,
+ 0x634C, 0x0879, 0x634D, 0x1379, 0x634F, 0x137B, 0x6350, 0x1377,
+ 0x6355, 0x0E31, 0x6357, 0x0BD9, 0x635C, 0x0ADE, 0x6365, 0x38EC,
+ 0x6367, 0x0E4B, 0x6368, 0x08FA, 0x6369, 0x1387, 0x636B, 0x1386,
+ 0x636E, 0x0A3E, 0x6372, 0x0754, 0x6374, 0x38ED, 0x6376, 0x1380,
+ 0x6377, 0x09A1, 0x637A, 0x0CC0, 0x637B, 0x0CE7, 0x637D, 0x38EE,
+ 0x6380, 0x137E, 0x6383, 0x0ADF, 0x6384, 0x38EF, 0x6387, 0x38F0,
+ 0x6388, 0x0924, 0x6389, 0x1383, 0x638C, 0x09A0, 0x638E, 0x137D,
+ 0x638F, 0x1382, 0x6390, 0x38F1, 0x6392, 0x0D09, 0x6396, 0x137C,
+ 0x6398, 0x06F7, 0x639B, 0x05BB, 0x639E, 0x38F2, 0x639F, 0x1384,
+ 0x63A0, 0x0F73, 0x63A1, 0x083E, 0x63A2, 0x0B73, 0x63A3, 0x1381,
+ 0x63A5, 0x0A80, 0x63A7, 0x07C7, 0x63A8, 0x0A2A, 0x63A9, 0x0508,
+ 0x63AA, 0x0ABE, 0x63AB, 0x137F, 0x63AC, 0x065F, 0x63B2, 0x071D,
+ 0x63B4, 0x0BEB, 0x63B5, 0x1385, 0x63BB, 0x0AE1, 0x63BE, 0x1388,
+ 0x63C0, 0x138A, 0x63C3, 0x0B17, 0x63C4, 0x1390, 0x63C6, 0x138B,
+ 0x63C9, 0x138D, 0x63CF, 0x0DB3, 0x63D0, 0x0C0F, 0x63D1, 0x38F3,
+ 0x63D2, 0x138E, 0x63D6, 0x0F16, 0x63DA, 0x0F32, 0x63DB, 0x05F5,
+ 0x63DC, 0x38F4, 0x63E1, 0x0472, 0x63E3, 0x138C, 0x63E9, 0x1389,
+ 0x63ED, 0x341C, 0x63EE, 0x0634, 0x63F4, 0x0509, 0x63F5, 0x2113,
+ 0x63F6, 0x138F, 0x63F7, 0x3644, 0x63FA, 0x0F33, 0x6406, 0x1393,
+ 0x6409, 0x38F5, 0x640D, 0x0B1B, 0x640F, 0x139A, 0x6410, 0x38F6,
+ 0x6413, 0x1394, 0x6414, 0x1E2C, 0x6416, 0x1391, 0x6417, 0x1398,
+ 0x641C, 0x137A, 0x6422, 0x38F7, 0x6426, 0x1395, 0x6428, 0x1399,
+ 0x642C, 0x0D56, 0x642D, 0x0C65, 0x6434, 0x1392, 0x6436, 0x1396,
+ 0x643A, 0x071E, 0x643E, 0x0861, 0x6442, 0x0A81, 0x644E, 0x139E,
+ 0x6451, 0x1E43, 0x6454, 0x38F8, 0x6458, 0x0C20, 0x645B, 0x38F9,
+ 0x6460, 0x2114, 0x6467, 0x139B, 0x6469, 0x0E8E, 0x646D, 0x38FA,
+ 0x646F, 0x139C, 0x6476, 0x139D, 0x6478, 0x0EDA, 0x647A, 0x0A46,
+ 0x647B, 0x38FB, 0x6483, 0x0738, 0x6488, 0x13A4, 0x6492, 0x0883,
+ 0x6493, 0x13A1, 0x6495, 0x13A0, 0x649A, 0x0CE8, 0x649D, 0x2115,
+ 0x649E, 0x0C8D, 0x64A4, 0x0C2B, 0x64A5, 0x13A2, 0x64A9, 0x13A3,
+ 0x64AB, 0x0DE1, 0x64AD, 0x0CFB, 0x64AE, 0x0871, 0x64B0, 0x0A95,
+ 0x64B2, 0x0E7E, 0x64B9, 0x05A7, 0x64BB, 0x13AA, 0x64BC, 0x13A5,
+ 0x64BE, 0x38FC, 0x64BF, 0x38FD, 0x64C1, 0x0F34, 0x64C2, 0x13AC,
+ 0x64C5, 0x13A8, 0x64C7, 0x13A9, 0x64CA, 0x341D, 0x64CD, 0x0AE2,
+ 0x64CE, 0x2116, 0x64D2, 0x13A7, 0x64D4, 0x1366, 0x64D8, 0x13AB,
+ 0x64DA, 0x13A6, 0x64E0, 0x13B0, 0x64E1, 0x13B1, 0x64E2, 0x0C21,
+ 0x64E3, 0x13B3, 0x64E5, 0x38FE, 0x64E6, 0x0872, 0x64E7, 0x13AE,
+ 0x64EC, 0x0656, 0x64EF, 0x13B4, 0x64F1, 0x13AD, 0x64F2, 0x13B8,
+ 0x64F4, 0x13B7, 0x64F6, 0x13B6, 0x64F7, 0x38FF, 0x64FA, 0x13B9,
+ 0x64FB, 0x3900, 0x64FD, 0x13BB, 0x64FE, 0x09D9, 0x6500, 0x13BA,
+ 0x6504, 0x3901, 0x6505, 0x13BE, 0x6516, 0x3902, 0x6518, 0x13BC,
+ 0x6519, 0x3903, 0x651C, 0x13BD, 0x651D, 0x1397, 0x6522, 0x1E97,
+ 0x6523, 0x13C0, 0x6524, 0x13BF, 0x652A, 0x139F, 0x652B, 0x13C1,
+ 0x652C, 0x13B5, 0x652F, 0x08A7, 0x6534, 0x13C2, 0x6535, 0x13C3,
+ 0x6536, 0x13C5, 0x6537, 0x13C4, 0x6538, 0x13C6, 0x6539, 0x057E,
+ 0x653B, 0x07C8, 0x653E, 0x0E4C, 0x653F, 0x0A53, 0x6545, 0x0782,
+ 0x6547, 0x3904, 0x6548, 0x13C8, 0x654D, 0x13CB, 0x654E, 0x2117,
+ 0x654F, 0x0DC4, 0x6551, 0x0679, 0x6555, 0x13CA, 0x6556, 0x13C9,
+ 0x6557, 0x0D0A, 0x6558, 0x13CC, 0x6559, 0x06AD, 0x655D, 0x13CE,
+ 0x655E, 0x13CD, 0x6562, 0x05F6, 0x6563, 0x0884, 0x6566, 0x0CB0,
+ 0x6567, 0x3905, 0x656C, 0x071F, 0x6570, 0x0A3A, 0x6572, 0x13CF,
+ 0x6574, 0x0A54, 0x6575, 0x0C22, 0x6577, 0x0DD1, 0x6578, 0x13D0,
+ 0x6581, 0x3906, 0x6582, 0x13D1, 0x6583, 0x13D2, 0x6585, 0x3907,
+ 0x6587, 0x0E08, 0x6588, 0x120C, 0x6589, 0x0A6A, 0x658C, 0x0DBE,
+ 0x658E, 0x0848, 0x6590, 0x0D79, 0x6591, 0x0D57, 0x6597, 0x0C47,
+ 0x6599, 0x0F89, 0x659B, 0x13D4, 0x659C, 0x08FC, 0x659F, 0x13D5,
+ 0x65A1, 0x047A, 0x65A4, 0x06CC, 0x65A5, 0x0A71, 0x65A7, 0x0DD2,
+ 0x65AB, 0x13D6, 0x65AC, 0x0890, 0x65AD, 0x0B85, 0x65AF, 0x08A9,
+ 0x65B0, 0x09FD, 0x65B7, 0x13D7, 0x65B9, 0x0E4D, 0x65BC, 0x0519,
+ 0x65BD, 0x08AA, 0x65C1, 0x13DA, 0x65C2, 0x3908, 0x65C3, 0x13D8,
+ 0x65C4, 0x13DB, 0x65C5, 0x0F81, 0x65C6, 0x13D9, 0x65CB, 0x0A9F,
+ 0x65CC, 0x13DC, 0x65CF, 0x0B12, 0x65D2, 0x13DD, 0x65D7, 0x0636,
+ 0x65D9, 0x13DF, 0x65DB, 0x13DE, 0x65E0, 0x13E0, 0x65E1, 0x13E1,
+ 0x65E2, 0x0637, 0x65E3, 0x3585, 0x65E5, 0x0CD4, 0x65E6, 0x0B74,
+ 0x65E7, 0x0686, 0x65E8, 0x08AB, 0x65E9, 0x0AE3, 0x65EC, 0x0966,
+ 0x65ED, 0x0474, 0x65F0, 0x3909, 0x65F1, 0x13E2, 0x65F2, 0x390A,
+ 0x65FA, 0x0522, 0x65FB, 0x13E6, 0x6600, 0x2118, 0x6602, 0x07C9,
+ 0x6603, 0x13E5, 0x6606, 0x081B, 0x6607, 0x09A2, 0x6609, 0x211A,
+ 0x660A, 0x13E4, 0x660C, 0x09A3, 0x660E, 0x0ECC, 0x660F, 0x081A,
+ 0x6613, 0x049B, 0x6614, 0x0A72, 0x6615, 0x2119, 0x661C, 0x13EB,
+ 0x661E, 0x211C, 0x661F, 0x0A55, 0x6620, 0x04E9, 0x6624, 0x211D,
+ 0x6625, 0x095F, 0x6627, 0x0E94, 0x6628, 0x0862, 0x662C, 0x390B,
+ 0x662D, 0x09A4, 0x662E, 0x211B, 0x662F, 0x0A4B, 0x6631, 0x20AE,
+ 0x6634, 0x13EA, 0x6635, 0x13E8, 0x6636, 0x13E9, 0x663B, 0x1E00,
+ 0x663C, 0x0BA9, 0x663F, 0x1409, 0x6641, 0x13EF, 0x6642, 0x08CC,
+ 0x6643, 0x07CA, 0x6644, 0x13ED, 0x6649, 0x13EE, 0x664B, 0x09FE,
+ 0x664C, 0x390C, 0x664F, 0x13EC, 0x6652, 0x087D, 0x6657, 0x211F,
+ 0x6659, 0x2120, 0x665B, 0x390D, 0x665C, 0x390E, 0x665D, 0x13F1,
+ 0x665E, 0x13F0, 0x665F, 0x13F5, 0x6661, 0x390F, 0x6662, 0x13F6,
+ 0x6663, 0x373A, 0x6664, 0x13F2, 0x6665, 0x211E, 0x6666, 0x0580,
+ 0x6667, 0x13F3, 0x6668, 0x13F4, 0x6669, 0x0D69, 0x666B, 0x3910,
+ 0x666E, 0x0DD3, 0x666F, 0x0720, 0x6670, 0x13F7, 0x6673, 0x2122,
+ 0x6674, 0x0A56, 0x6676, 0x09A5, 0x6677, 0x3911, 0x667A, 0x0B90,
+ 0x6681, 0x06BF, 0x6683, 0x13F8, 0x6684, 0x13FC, 0x6687, 0x054B,
+ 0x6688, 0x13F9, 0x6689, 0x13FB, 0x668E, 0x13FA, 0x6691, 0x0975,
+ 0x6696, 0x0B86, 0x6697, 0x0489, 0x6698, 0x13FD, 0x6699, 0x2123,
+ 0x669D, 0x13FE, 0x66A0, 0x2124, 0x66A2, 0x0BC6, 0x66A4, 0x3912,
+ 0x66A6, 0x0FB9, 0x66AB, 0x0891, 0x66AE, 0x0E3B, 0x66B2, 0x2125,
+ 0x66B4, 0x0E6B, 0x66B8, 0x1405, 0x66B9, 0x1400, 0x66BC, 0x1403,
+ 0x66BE, 0x1402, 0x66BF, 0x2126, 0x66C1, 0x13FF, 0x66C4, 0x1404,
+ 0x66C6, 0x3455, 0x66C7, 0x0CB6, 0x66C8, 0x3913, 0x66C9, 0x1401,
+ 0x66D6, 0x1406, 0x66D9, 0x0976, 0x66DA, 0x1407, 0x66DC, 0x0F35,
+ 0x66DD, 0x0D2E, 0x66E0, 0x1408, 0x66E6, 0x140A, 0x66E9, 0x140B,
+ 0x66EC, 0x3914, 0x66F0, 0x140C, 0x66F2, 0x06C2, 0x66F3, 0x04EA,
+ 0x66F4, 0x07CB, 0x66F5, 0x140D, 0x66F7, 0x140E, 0x66F8, 0x097B,
+ 0x66F9, 0x0AE4, 0x66FA, 0x2127, 0x66FB, 0x20B1, 0x66FC, 0x10ED,
+ 0x66FD, 0x0AC0, 0x66FE, 0x0ABF, 0x66FF, 0x0B38, 0x6700, 0x0837,
+ 0x6703, 0x104B, 0x6705, 0x3915, 0x6708, 0x0744, 0x6709, 0x0F17,
+ 0x670B, 0x0E4E, 0x670D, 0x0DF0, 0x670E, 0x2128, 0x670F, 0x140F,
+ 0x6713, 0x3916, 0x6714, 0x0863, 0x6715, 0x0BDB, 0x6716, 0x1410,
+ 0x6717, 0x0FD5, 0x671B, 0x0E6C, 0x671D, 0x0BC7, 0x671E, 0x1411,
+ 0x671F, 0x0638, 0x6726, 0x1412, 0x6727, 0x1413, 0x6728, 0x0EE6,
+ 0x672A, 0x0EB0, 0x672B, 0x0EA4, 0x672C, 0x0E8A, 0x672D, 0x0873,
+ 0x672E, 0x1415, 0x6731, 0x0917, 0x6733, 0x3917, 0x6734, 0x0E7F,
+ 0x6736, 0x1417, 0x6737, 0x141A, 0x6738, 0x1419, 0x673A, 0x0635,
+ 0x673D, 0x067A, 0x673F, 0x1416, 0x6741, 0x1418, 0x6743, 0x35B7,
+ 0x6746, 0x141B, 0x6748, 0x3918, 0x6749, 0x0A3F, 0x674C, 0x3919,
+ 0x674E, 0x0F65, 0x674F, 0x048D, 0x6750, 0x0850, 0x6751, 0x0B1C,
+ 0x6753, 0x0909, 0x6756, 0x09DB, 0x6759, 0x141E, 0x675C, 0x0C48,
+ 0x675E, 0x141C, 0x675F, 0x0B0B, 0x6760, 0x141D, 0x6761, 0x09DA,
+ 0x6762, 0x0EE9, 0x6763, 0x141F, 0x6764, 0x1420, 0x6765, 0x0F52,
+ 0x6766, 0x212A, 0x676A, 0x1425, 0x676D, 0x07CC, 0x676E, 0x3571,
+ 0x676F, 0x0D0B, 0x6770, 0x1422, 0x6771, 0x0C66, 0x6772, 0x13E3,
+ 0x6773, 0x13E7, 0x6775, 0x0669, 0x6776, 0x391A, 0x6777, 0x0CFD,
+ 0x677B, 0x391B, 0x677C, 0x1424, 0x677E, 0x09A6, 0x677F, 0x0D58,
+ 0x6785, 0x142A, 0x6787, 0x0D8E, 0x6789, 0x1421, 0x678B, 0x1427,
+ 0x678C, 0x1426, 0x6790, 0x0A73, 0x6795, 0x0E9B, 0x6797, 0x0F9B,
+ 0x679A, 0x0E95, 0x679C, 0x054C, 0x679D, 0x08AC, 0x67A0, 0x0FEE,
+ 0x67A1, 0x1429, 0x67A2, 0x0A3B, 0x67A6, 0x1428, 0x67A9, 0x1423,
+ 0x67AF, 0x0783, 0x67B0, 0x391C, 0x67B2, 0x391D, 0x67B3, 0x142F,
+ 0x67B4, 0x142D, 0x67B6, 0x054D, 0x67B7, 0x142B, 0x67B8, 0x1431,
+ 0x67B9, 0x1437, 0x67BB, 0x212B, 0x67C0, 0x212D, 0x67C1, 0x0B28,
+ 0x67C4, 0x0E11, 0x67C6, 0x1439, 0x67CA, 0x0D94, 0x67CE, 0x1438,
+ 0x67CF, 0x0D26, 0x67D0, 0x0E6D, 0x67D1, 0x05F7, 0x67D3, 0x0A9B,
+ 0x67D4, 0x094A, 0x67D7, 0x391F, 0x67D8, 0x0BEF, 0x67D9, 0x3920,
+ 0x67DA, 0x0F18, 0x67DD, 0x1434, 0x67DE, 0x1433, 0x67E2, 0x1435,
+ 0x67E4, 0x1432, 0x67E7, 0x143A, 0x67E9, 0x1430, 0x67EC, 0x142E,
+ 0x67EE, 0x1436, 0x67EF, 0x142C, 0x67F0, 0x3921, 0x67F1, 0x0BAA,
+ 0x67F3, 0x0F04, 0x67F4, 0x08F2, 0x67F5, 0x0864, 0x67F9, 0x391E,
+ 0x67FB, 0x082A, 0x67FE, 0x0E9D, 0x67FF, 0x059F, 0x6801, 0x212E,
+ 0x6802, 0x0BEA, 0x6803, 0x0CA2, 0x6804, 0x04EB, 0x6805, 0x1E07,
+ 0x6813, 0x0A96, 0x6816, 0x0A58, 0x6817, 0x0700, 0x681E, 0x143C,
+ 0x6821, 0x07CD, 0x6822, 0x05DA, 0x6829, 0x143E, 0x682A, 0x05D2,
+ 0x682B, 0x1444, 0x682C, 0x3922, 0x6830, 0x3923, 0x6831, 0x3924,
+ 0x6832, 0x1441, 0x6834, 0x0A97, 0x6838, 0x05A9, 0x6839, 0x081C,
+ 0x683C, 0x05A8, 0x683D, 0x083F, 0x6840, 0x143F, 0x6841, 0x073B,
+ 0x6842, 0x0721, 0x6843, 0x0C67, 0x6844, 0x212F, 0x6846, 0x143D,
+ 0x6848, 0x048A, 0x684D, 0x1440, 0x684E, 0x1442, 0x6850, 0x06C5,
+ 0x6851, 0x0702, 0x6852, 0x212C, 0x6853, 0x05F8, 0x6854, 0x0665,
+ 0x6859, 0x1445, 0x685B, 0x3925, 0x685C, 0x0869, 0x685D, 0x0E9F,
+ 0x685F, 0x0885, 0x6863, 0x1446, 0x6867, 0x0DA2, 0x6872, 0x3926,
+ 0x6874, 0x1452, 0x6875, 0x3927, 0x6876, 0x0533, 0x6877, 0x1447,
+ 0x687A, 0x3928, 0x687E, 0x1458, 0x687F, 0x1448, 0x6881, 0x0F8A,
+ 0x6883, 0x144F, 0x6884, 0x3929, 0x6885, 0x0D15, 0x688D, 0x1457,
+ 0x688E, 0x1E9C, 0x688F, 0x144A, 0x6893, 0x0478, 0x6894, 0x144C,
+ 0x6897, 0x07CE, 0x689B, 0x144E, 0x689D, 0x144D, 0x689F, 0x1449,
+ 0x68A0, 0x1454, 0x68A2, 0x09A7, 0x68A5, 0x392A, 0x68A6, 0x11BE,
+ 0x68A7, 0x079C, 0x68A8, 0x0F66, 0x68AD, 0x144B, 0x68AF, 0x0C10,
+ 0x68B0, 0x0581, 0x68B1, 0x081D, 0x68B2, 0x392B, 0x68B3, 0x1443,
+ 0x68B5, 0x1453, 0x68B6, 0x05BF, 0x68B9, 0x1451, 0x68BA, 0x1455,
+ 0x68BC, 0x0C68, 0x68C4, 0x063A, 0x68C6, 0x1473, 0x68C8, 0x20AF,
+ 0x68C9, 0x0ED5, 0x68CA, 0x145A, 0x68CB, 0x0639, 0x68CD, 0x1461,
+ 0x68CF, 0x2130, 0x68D0, 0x392C, 0x68D2, 0x0E6E, 0x68D4, 0x1462,
+ 0x68D5, 0x1464, 0x68D6, 0x392D, 0x68D7, 0x1468, 0x68D8, 0x145C,
+ 0x68DA, 0x0B68, 0x68DF, 0x0C69, 0x68E0, 0x146C, 0x68E1, 0x145F,
+ 0x68E3, 0x1469, 0x68E7, 0x1463, 0x68E8, 0x392E, 0x68ED, 0x392F,
+ 0x68EE, 0x09FF, 0x68EF, 0x146D, 0x68F0, 0x3930, 0x68F1, 0x3931,
+ 0x68F2, 0x0A57, 0x68F9, 0x146B, 0x68FA, 0x05F9, 0x68FC, 0x3932,
+ 0x6900, 0x0FF6, 0x6901, 0x1459, 0x6904, 0x1467, 0x6905, 0x049C,
+ 0x6908, 0x145B, 0x690B, 0x0EC6, 0x690C, 0x1460, 0x690D, 0x09E8,
+ 0x690E, 0x0BE3, 0x690F, 0x1456, 0x6911, 0x3933, 0x6912, 0x1466,
+ 0x6913, 0x3934, 0x6919, 0x0A40, 0x691A, 0x1470, 0x691B, 0x05CF,
+ 0x691C, 0x0755, 0x6921, 0x1472, 0x6922, 0x145D, 0x6923, 0x1471,
+ 0x6925, 0x146A, 0x6926, 0x145E, 0x6928, 0x146E, 0x692A, 0x146F,
+ 0x6930, 0x1480, 0x6934, 0x0CA6, 0x6935, 0x3935, 0x6936, 0x1465,
+ 0x6939, 0x147C, 0x693B, 0x3936, 0x693D, 0x147E, 0x693F, 0x0BF4,
+ 0x694A, 0x0F36, 0x6953, 0x0DE8, 0x6954, 0x1479, 0x6955, 0x0B2A,
+ 0x6957, 0x3937, 0x6959, 0x147F, 0x695A, 0x0AC1, 0x695C, 0x1476,
+ 0x695D, 0x1483, 0x695E, 0x1482, 0x6960, 0x0CC7, 0x6961, 0x1481,
+ 0x6962, 0x0CC2, 0x6963, 0x3938, 0x6968, 0x2132, 0x696A, 0x1485,
+ 0x696B, 0x1478, 0x696D, 0x06C0, 0x696E, 0x147B, 0x696F, 0x0967,
+ 0x6972, 0x3939, 0x6973, 0x0D16, 0x6974, 0x147D, 0x6975, 0x06C3,
+ 0x6977, 0x1475, 0x6978, 0x1477, 0x6979, 0x1474, 0x697C, 0x0FD6,
+ 0x697D, 0x05B8, 0x697E, 0x147A, 0x697F, 0x393A, 0x6980, 0x393B,
+ 0x6981, 0x1484, 0x6982, 0x0593, 0x698A, 0x0857, 0x698E, 0x04FF,
+ 0x6991, 0x1495, 0x6994, 0x0FD7, 0x6995, 0x1498, 0x6998, 0x2134,
+ 0x699B, 0x0A00, 0x699C, 0x1497, 0x69A0, 0x1496, 0x69A6, 0x393C,
+ 0x69A7, 0x1493, 0x69AD, 0x393D, 0x69AE, 0x1487, 0x69B1, 0x14A4,
+ 0x69B2, 0x1486, 0x69B4, 0x1499, 0x69B7, 0x393E, 0x69BB, 0x1491,
+ 0x69BE, 0x148C, 0x69BF, 0x1489, 0x69C1, 0x148A, 0x69C3, 0x1492,
+ 0x69C7, 0x1D33, 0x69CA, 0x148F, 0x69CB, 0x07CF, 0x69CC, 0x0BE4,
+ 0x69CD, 0x0AE6, 0x69CE, 0x148D, 0x69D0, 0x1488, 0x69D3, 0x148B,
+ 0x69D6, 0x393F, 0x69D7, 0x3940, 0x69D8, 0x0F37, 0x69D9, 0x0E98,
+ 0x69DD, 0x1490, 0x69DE, 0x149A, 0x69E2, 0x2135, 0x69E7, 0x14A2,
+ 0x69E8, 0x149B, 0x69EA, 0x356F, 0x69EB, 0x14A8, 0x69ED, 0x14A6,
+ 0x69F2, 0x14A1, 0x69F6, 0x373F, 0x69F9, 0x14A0, 0x69FB, 0x0BEC,
+ 0x69FD, 0x0AE7, 0x69FF, 0x149E, 0x6A01, 0x3941, 0x6A02, 0x149C,
+ 0x6A05, 0x14A3, 0x6A0A, 0x14A9, 0x6A0B, 0x0D89, 0x6A0C, 0x14AF,
+ 0x6A0F, 0x3942, 0x6A12, 0x14AA, 0x6A13, 0x14AD, 0x6A14, 0x14A7,
+ 0x6A15, 0x3943, 0x6A17, 0x0BB2, 0x6A19, 0x0DAA, 0x6A1B, 0x149D,
+ 0x6A1E, 0x14A5, 0x6A1F, 0x09A8, 0x6A21, 0x0EDB, 0x6A22, 0x14B9,
+ 0x6A23, 0x14AC, 0x6A28, 0x3944, 0x6A29, 0x0756, 0x6A2A, 0x0523,
+ 0x6A2B, 0x05BD, 0x6A2E, 0x1494, 0x6A30, 0x2136, 0x6A34, 0x3945,
+ 0x6A35, 0x09A9, 0x6A36, 0x14B1, 0x6A38, 0x14B8, 0x6A39, 0x0925,
+ 0x6A3A, 0x05D0, 0x6A3D, 0x0B6C, 0x6A3E, 0x3946, 0x6A44, 0x14AE,
+ 0x6A45, 0x3947, 0x6A46, 0x2138, 0x6A47, 0x14B3, 0x6A48, 0x14B7,
+ 0x6A4B, 0x06AE, 0x6A50, 0x3948, 0x6A51, 0x3949, 0x6A54, 0x3C34,
+ 0x6A56, 0x394A, 0x6A58, 0x0666, 0x6A59, 0x14B5, 0x6A5B, 0x394B,
+ 0x6A5F, 0x063B, 0x6A61, 0x0CA3, 0x6A62, 0x14B4, 0x6A66, 0x14B6,
+ 0x6A6B, 0x2137, 0x6A72, 0x14B0, 0x6A73, 0x2139, 0x6A78, 0x14B2,
+ 0x6A7E, 0x213A, 0x6A7F, 0x05BE, 0x6A80, 0x0B87, 0x6A83, 0x394C,
+ 0x6A84, 0x14BD, 0x6A89, 0x394D, 0x6A8D, 0x14BB, 0x6A8E, 0x079D,
+ 0x6A90, 0x14BA, 0x6A91, 0x394E, 0x6A97, 0x14C0, 0x6A9C, 0x143B,
+ 0x6A9D, 0x394F, 0x6A9E, 0x3950, 0x6A9F, 0x3951, 0x6AA0, 0x14BC,
+ 0x6AA2, 0x14BE, 0x6AA3, 0x14BF, 0x6AAA, 0x14CB, 0x6AAC, 0x14C7,
+ 0x6AAE, 0x1450, 0x6AB3, 0x14C6, 0x6AB8, 0x14C5, 0x6ABB, 0x14C2,
+ 0x6AC1, 0x14AB, 0x6AC2, 0x14C4, 0x6AC3, 0x14C3, 0x6AD1, 0x14C9,
+ 0x6AD3, 0x0FCC, 0x6ADA, 0x14CC, 0x6ADB, 0x06F3, 0x6ADC, 0x3952,
+ 0x6ADE, 0x14C8, 0x6ADF, 0x14CA, 0x6AE2, 0x213B, 0x6AE4, 0x213C,
+ 0x6AE7, 0x3953, 0x6AE8, 0x0D3B, 0x6AEA, 0x14CD, 0x6AEC, 0x3954,
+ 0x6AFA, 0x14D1, 0x6AFB, 0x14CE, 0x6B04, 0x0F5D, 0x6B05, 0x14CF,
+ 0x6B0A, 0x149F, 0x6B12, 0x14D2, 0x6B16, 0x14D3, 0x6B1D, 0x04D7,
+ 0x6B1E, 0x3955, 0x6B1F, 0x14D5, 0x6B20, 0x073D, 0x6B21, 0x08CD,
+ 0x6B23, 0x06CD, 0x6B24, 0x3956, 0x6B27, 0x0524, 0x6B32, 0x0F49,
+ 0x6B35, 0x3957, 0x6B37, 0x14D7, 0x6B38, 0x14D6, 0x6B39, 0x14D9,
+ 0x6B3A, 0x0657, 0x6B3D, 0x06CE, 0x6B3E, 0x05FA, 0x6B43, 0x14DC,
+ 0x6B46, 0x3958, 0x6B47, 0x14DB, 0x6B49, 0x14DD, 0x6B4C, 0x054E,
+ 0x6B4E, 0x0B75, 0x6B50, 0x14DE, 0x6B53, 0x05FB, 0x6B54, 0x14E0,
+ 0x6B56, 0x3959, 0x6B59, 0x14DF, 0x6B5B, 0x14E1, 0x6B5F, 0x14E2,
+ 0x6B60, 0x395A, 0x6B61, 0x14E3, 0x6B62, 0x08AD, 0x6B63, 0x0A59,
+ 0x6B64, 0x0811, 0x6B65, 0x344A, 0x6B66, 0x0DE2, 0x6B69, 0x0E32,
+ 0x6B6A, 0x0FEA, 0x6B6F, 0x08C3, 0x6B72, 0x35D9, 0x6B73, 0x0840,
+ 0x6B74, 0x0FBA, 0x6B77, 0x3456, 0x6B78, 0x14E4, 0x6B79, 0x14E5,
+ 0x6B7B, 0x08AE, 0x6B7F, 0x14E6, 0x6B80, 0x14E7, 0x6B82, 0x395B,
+ 0x6B83, 0x14E9, 0x6B84, 0x14E8, 0x6B86, 0x0E86, 0x6B89, 0x0968,
+ 0x6B8A, 0x0918, 0x6B8B, 0x0892, 0x6B8D, 0x14EA, 0x6B95, 0x14EC,
+ 0x6B96, 0x09E9, 0x6B98, 0x14EB, 0x6B9E, 0x14ED, 0x6BA4, 0x14EE,
+ 0x6BAA, 0x14EF, 0x6BAB, 0x14F0, 0x6BAF, 0x14F1, 0x6BB1, 0x14F3,
+ 0x6BB2, 0x14F2, 0x6BB3, 0x14F4, 0x6BB4, 0x0525, 0x6BB5, 0x0B88,
+ 0x6BB7, 0x14F5, 0x6BBA, 0x0874, 0x6BBB, 0x05AA, 0x6BBC, 0x14F6,
+ 0x6BBE, 0x395C, 0x6BBF, 0x0C3C, 0x6BC0, 0x119D, 0x6BC5, 0x063D,
+ 0x6BC6, 0x14F7, 0x6BCB, 0x14F8, 0x6BCC, 0x3744, 0x6BCD, 0x0E3C,
+ 0x6BCE, 0x0E96, 0x6BCF, 0x344C, 0x6BD2, 0x0C9F, 0x6BD3, 0x14F9,
+ 0x6BD4, 0x0D7A, 0x6BD6, 0x213D, 0x6BD8, 0x0D8F, 0x6BDB, 0x0EDF,
+ 0x6BDF, 0x14FA, 0x6BE1, 0x395D, 0x6BEB, 0x14FC, 0x6BEC, 0x14FB,
+ 0x6BEF, 0x14FE, 0x6BF1, 0x395E, 0x6BF3, 0x14FD, 0x6C08, 0x1500,
+ 0x6C0F, 0x08AF, 0x6C10, 0x395F, 0x6C11, 0x0EBD, 0x6C13, 0x1501,
+ 0x6C14, 0x1502, 0x6C17, 0x063E, 0x6C1B, 0x1503, 0x6C23, 0x1505,
+ 0x6C24, 0x1504, 0x6C33, 0x3960, 0x6C34, 0x0A2B, 0x6C35, 0x3961,
+ 0x6C37, 0x0DAB, 0x6C38, 0x04EC, 0x6C3A, 0x3962, 0x6C3E, 0x0D59,
+ 0x6C3F, 0x213E, 0x6C40, 0x0C11, 0x6C41, 0x094B, 0x6C42, 0x067B,
+ 0x6C4E, 0x0D5A, 0x6C50, 0x08DA, 0x6C55, 0x1507, 0x6C57, 0x05FC,
+ 0x6C59, 0x3963, 0x6C5A, 0x051A, 0x6C5C, 0x213F, 0x6C5D, 0x0CCA,
+ 0x6C5E, 0x1506, 0x6C5F, 0x07D0, 0x6C60, 0x0B91, 0x6C62, 0x1508,
+ 0x6C68, 0x1510, 0x6C6A, 0x1509, 0x6C6F, 0x2141, 0x6C70, 0x0B21,
+ 0x6C72, 0x067C, 0x6C73, 0x1511, 0x6C76, 0x3964, 0x6C7A, 0x073E,
+ 0x6C7B, 0x3965, 0x6C7D, 0x063F, 0x6C7E, 0x150F, 0x6C81, 0x150D,
+ 0x6C82, 0x150A, 0x6C83, 0x0F4A, 0x6C85, 0x3966, 0x6C86, 0x2140,
+ 0x6C88, 0x0BDC, 0x6C8C, 0x0CB1, 0x6C8D, 0x150B, 0x6C90, 0x1513,
+ 0x6C92, 0x1512, 0x6C93, 0x06F9, 0x6C95, 0x3967, 0x6C96, 0x052D,
+ 0x6C99, 0x082B, 0x6C9A, 0x150C, 0x6C9B, 0x150E, 0x6C9C, 0x3968,
+ 0x6CA1, 0x0E85, 0x6CA2, 0x0B54, 0x6CAA, 0x3749, 0x6CAB, 0x0EA5,
+ 0x6CAE, 0x151B, 0x6CB1, 0x151C, 0x6CB3, 0x054F, 0x6CB8, 0x0DF8,
+ 0x6CB9, 0x0F09, 0x6CBA, 0x151E, 0x6CBB, 0x08CF, 0x6CBC, 0x09AA,
+ 0x6CBD, 0x1517, 0x6CBE, 0x151D, 0x6CBF, 0x050A, 0x6CC1, 0x06AF,
+ 0x6CC4, 0x1514, 0x6CC5, 0x1519, 0x6CC9, 0x0A98, 0x6CCA, 0x0D27,
+ 0x6CCC, 0x0D7B, 0x6CD0, 0x3969, 0x6CD3, 0x1516, 0x6CD4, 0x396A,
+ 0x6CD5, 0x0E4F, 0x6CD6, 0x396B, 0x6CD7, 0x1518, 0x6CD9, 0x1521,
+ 0x6CDA, 0x2142, 0x6CDB, 0x151F, 0x6CDD, 0x151A, 0x6CE0, 0x396C,
+ 0x6CE1, 0x0E50, 0x6CE2, 0x0CFE, 0x6CE3, 0x067D, 0x6CE5, 0x0C1F,
+ 0x6CE8, 0x0BAB, 0x6CEA, 0x1522, 0x6CEB, 0x396D, 0x6CEC, 0x396E,
+ 0x6CEE, 0x396F, 0x6CEF, 0x1520, 0x6CF0, 0x0B39, 0x6CF1, 0x1515,
+ 0x6CF3, 0x04ED, 0x6D01, 0x3C35, 0x6D04, 0x2143, 0x6D0A, 0x3970,
+ 0x6D0B, 0x0F38, 0x6D0C, 0x152D, 0x6D0E, 0x3971, 0x6D11, 0x3972,
+ 0x6D12, 0x152C, 0x6D17, 0x0A9A, 0x6D19, 0x1529, 0x6D1B, 0x0F56,
+ 0x6D1E, 0x0C8E, 0x6D1F, 0x1523, 0x6D25, 0x0BE1, 0x6D29, 0x04EE,
+ 0x6D2A, 0x07D1, 0x6D2B, 0x1526, 0x6D2E, 0x3973, 0x6D32, 0x0931,
+ 0x6D33, 0x152B, 0x6D35, 0x152A, 0x6D36, 0x1525, 0x6D38, 0x1528,
+ 0x6D3B, 0x05C6, 0x6D3D, 0x1527, 0x6D3E, 0x0CFF, 0x6D41, 0x0F76,
+ 0x6D44, 0x09DC, 0x6D45, 0x0A99, 0x6D57, 0x3974, 0x6D59, 0x1533,
+ 0x6D5A, 0x1531, 0x6D5C, 0x0DBF, 0x6D5E, 0x3975, 0x6D63, 0x152E,
+ 0x6D64, 0x1530, 0x6D65, 0x3976, 0x6D66, 0x04DC, 0x6D69, 0x07D2,
+ 0x6D6A, 0x0FD8, 0x6D6C, 0x059B, 0x6D6E, 0x0DD4, 0x6D6F, 0x2145,
+ 0x6D74, 0x0F4B, 0x6D77, 0x0582, 0x6D78, 0x0A01, 0x6D79, 0x1532,
+ 0x6D82, 0x3977, 0x6D85, 0x1537, 0x6D87, 0x2144, 0x6D88, 0x09AB,
+ 0x6D89, 0x342A, 0x6D8C, 0x0F1A, 0x6D8E, 0x1534, 0x6D93, 0x152F,
+ 0x6D95, 0x1535, 0x6D96, 0x2146, 0x6D99, 0x0FA6, 0x6D9B, 0x0C6D,
+ 0x6D9C, 0x0C9A, 0x6DAC, 0x2147, 0x6DAF, 0x0594, 0x6DB2, 0x04F7,
+ 0x6DB5, 0x153B, 0x6DB8, 0x153E, 0x6DBC, 0x0F8B, 0x6DBF, 0x3978,
+ 0x6DC0, 0x0F4E, 0x6DC4, 0x3979, 0x6DC5, 0x1545, 0x6DC6, 0x153F,
+ 0x6DC7, 0x153C, 0x6DCA, 0x397A, 0x6DCB, 0x0F9C, 0x6DCC, 0x1542,
+ 0x6DCF, 0x2148, 0x6DD0, 0x3C36, 0x6DD1, 0x0954, 0x6DD2, 0x1544,
+ 0x6DD5, 0x1549, 0x6DD6, 0x397B, 0x6DD8, 0x0C6B, 0x6DD9, 0x1547,
+ 0x6DDA, 0x3453, 0x6DDE, 0x1541, 0x6DE1, 0x0B76, 0x6DE4, 0x1548,
+ 0x6DE6, 0x153D, 0x6DE8, 0x1543, 0x6DE9, 0x397C, 0x6DEA, 0x154A,
+ 0x6DEB, 0x04C0, 0x6DEC, 0x1540, 0x6DEE, 0x154B, 0x6DF1, 0x0A02,
+ 0x6DF2, 0x214A, 0x6DF3, 0x0969, 0x6DF5, 0x0DF5, 0x6DF7, 0x081E,
+ 0x6DF8, 0x2149, 0x6DF9, 0x1538, 0x6DFA, 0x1546, 0x6DFB, 0x0C34,
+ 0x6DFC, 0x214B, 0x6E05, 0x0A5A, 0x6E07, 0x05C7, 0x6E08, 0x0841,
+ 0x6E09, 0x09AC, 0x6E0A, 0x153A, 0x6E0B, 0x094C, 0x6E13, 0x0722,
+ 0x6E15, 0x1539, 0x6E17, 0x3746, 0x6E19, 0x154F, 0x6E1A, 0x0977,
+ 0x6E1B, 0x076E, 0x6E1D, 0x155E, 0x6E1F, 0x1558, 0x6E20, 0x068E,
+ 0x6E21, 0x0C49, 0x6E22, 0x397D, 0x6E23, 0x1553, 0x6E24, 0x155C,
+ 0x6E25, 0x0473, 0x6E26, 0x04D4, 0x6E27, 0x214E, 0x6E29, 0x0539,
+ 0x6E2B, 0x1555, 0x6E2C, 0x0B0C, 0x6E2D, 0x154C, 0x6E2E, 0x154E,
+ 0x6E2F, 0x07D3, 0x6E34, 0x3412, 0x6E38, 0x155F, 0x6E39, 0x214C,
+ 0x6E3A, 0x155A, 0x6E3C, 0x214F, 0x6E3E, 0x1552, 0x6E42, 0x3C37,
+ 0x6E43, 0x1559, 0x6E4A, 0x0EB7, 0x6E4D, 0x1557, 0x6E4E, 0x155B,
+ 0x6E51, 0x397E, 0x6E56, 0x0784, 0x6E58, 0x09AD, 0x6E5B, 0x0B77,
+ 0x6E5C, 0x214D, 0x6E5F, 0x1551, 0x6E67, 0x0F19, 0x6E6B, 0x1554,
+ 0x6E6E, 0x154D, 0x6E6F, 0x0C6C, 0x6E72, 0x1550, 0x6E76, 0x1556,
+ 0x6E7E, 0x0FF7, 0x6E7F, 0x08EA, 0x6E80, 0x0EAC, 0x6E82, 0x1560,
+ 0x6E8C, 0x0D42, 0x6E8F, 0x156C, 0x6E90, 0x076F, 0x6E96, 0x096A,
+ 0x6E98, 0x1562, 0x6E9C, 0x0F77, 0x6E9D, 0x07D4, 0x6E9F, 0x156F,
+ 0x6EA2, 0x04B2, 0x6EA5, 0x156D, 0x6EAA, 0x1561, 0x6EAB, 0x340C,
+ 0x6EAF, 0x1567, 0x6EB2, 0x1569, 0x6EB6, 0x0F39, 0x6EB7, 0x1564,
+ 0x6EBA, 0x0C28, 0x6EBD, 0x1566, 0x6EBF, 0x2150, 0x6EC2, 0x156E,
+ 0x6EC4, 0x1568, 0x6EC5, 0x0ED3, 0x6EC7, 0x397F, 0x6EC9, 0x1563,
+ 0x6ECA, 0x3980, 0x6ECB, 0x08CE, 0x6ECC, 0x157B, 0x6ECE, 0x3981,
+ 0x6ED1, 0x05C8, 0x6ED3, 0x1565, 0x6ED4, 0x156A, 0x6ED5, 0x156B,
+ 0x6ED9, 0x3C38, 0x6EDD, 0x0B4C, 0x6EDE, 0x0B3A, 0x6EE6, 0x3C24,
+ 0x6EEC, 0x1573, 0x6EEF, 0x1579, 0x6EF2, 0x1577, 0x6EF4, 0x0C23,
+ 0x6EF7, 0x157E, 0x6EF8, 0x1574, 0x6EFD, 0x3982, 0x6EFE, 0x1575,
+ 0x6EFF, 0x155D, 0x6F01, 0x0693, 0x6F02, 0x0DAC, 0x6F06, 0x08EB,
+ 0x6F09, 0x0809, 0x6F0F, 0x0FD9, 0x6F11, 0x1571, 0x6F13, 0x157D,
+ 0x6F14, 0x050B, 0x6F15, 0x0AE8, 0x6F1A, 0x3983, 0x6F20, 0x0D2F,
+ 0x6F22, 0x05FD, 0x6F23, 0x0FC2, 0x6F2A, 0x3984, 0x6F2B, 0x0EAD,
+ 0x6F2C, 0x0BEE, 0x6F2F, 0x3985, 0x6F31, 0x1578, 0x6F32, 0x157A,
+ 0x6F33, 0x3986, 0x6F38, 0x0AB4, 0x6F3E, 0x157C, 0x6F3F, 0x1576,
+ 0x6F41, 0x1570, 0x6F45, 0x05FF, 0x6F51, 0x1E60, 0x6F54, 0x073F,
+ 0x6F58, 0x158A, 0x6F5A, 0x3987, 0x6F5B, 0x1585, 0x6F5C, 0x0A9C,
+ 0x6F5E, 0x3988, 0x6F5F, 0x05C1, 0x6F62, 0x3989, 0x6F64, 0x096B,
+ 0x6F66, 0x158E, 0x6F6D, 0x1587, 0x6F6E, 0x0BC8, 0x6F6F, 0x1584,
+ 0x6F70, 0x0BF5, 0x6F74, 0x15A7, 0x6F78, 0x1581, 0x6F7A, 0x1580,
+ 0x6F7C, 0x1589, 0x6F7D, 0x398A, 0x6F80, 0x1583, 0x6F81, 0x1582,
+ 0x6F82, 0x1588, 0x6F84, 0x0A45, 0x6F86, 0x157F, 0x6F88, 0x2151,
+ 0x6F8B, 0x398B, 0x6F8D, 0x398C, 0x6F8E, 0x158B, 0x6F91, 0x158C,
+ 0x6F92, 0x398D, 0x6F94, 0x398E, 0x6F97, 0x05FE, 0x6F98, 0x363C,
+ 0x6F9A, 0x398F, 0x6FA1, 0x1591, 0x6FA3, 0x1590, 0x6FA4, 0x1592,
+ 0x6FA7, 0x3990, 0x6FA8, 0x3991, 0x6FAA, 0x1595, 0x6FB1, 0x0C3D,
+ 0x6FB3, 0x158F, 0x6FB5, 0x2152, 0x6FB6, 0x3992, 0x6FB9, 0x1593,
+ 0x6FC0, 0x0739, 0x6FC1, 0x0B59, 0x6FC2, 0x158D, 0x6FC3, 0x0CF1,
+ 0x6FC6, 0x1594, 0x6FD4, 0x1599, 0x6FD5, 0x1597, 0x6FD8, 0x159A,
+ 0x6FDA, 0x3993, 0x6FDB, 0x159D, 0x6FDE, 0x3994, 0x6FDF, 0x1596,
+ 0x6FE0, 0x07FC, 0x6FE1, 0x0CDE, 0x6FE4, 0x1536, 0x6FEB, 0x0F5E,
+ 0x6FEC, 0x1598, 0x6FEE, 0x159C, 0x6FEF, 0x0B55, 0x6FF1, 0x159B,
+ 0x6FF3, 0x1586, 0x6FF5, 0x2153, 0x6FF6, 0x1BA4, 0x6FF9, 0x3995,
+ 0x6FFA, 0x15A0, 0x6FFE, 0x15A4, 0x7001, 0x15A2, 0x7005, 0x2154,
+ 0x7006, 0x1E50, 0x7007, 0x2155, 0x7009, 0x159E, 0x700B, 0x159F,
+ 0x700F, 0x15A3, 0x7011, 0x15A1, 0x7015, 0x0DC0, 0x7018, 0x15A9,
+ 0x701A, 0x15A6, 0x701B, 0x15A5, 0x701D, 0x15A8, 0x701E, 0x0CAC,
+ 0x701F, 0x15AA, 0x7026, 0x0BB3, 0x7027, 0x0B4D, 0x7028, 0x2156,
+ 0x702C, 0x0A49, 0x7030, 0x15AB, 0x7032, 0x15AD, 0x7039, 0x3996,
+ 0x703C, 0x3997, 0x703E, 0x15AC, 0x704A, 0x3998, 0x704C, 0x1572,
+ 0x7051, 0x15AE, 0x7054, 0x3999, 0x7058, 0x0CBF, 0x705D, 0x399A,
+ 0x705E, 0x399B, 0x7063, 0x15AF, 0x7064, 0x399C, 0x706B, 0x0550,
+ 0x706C, 0x399D, 0x706F, 0x0C6E, 0x7070, 0x0583, 0x7078, 0x067E,
+ 0x707C, 0x090A, 0x707D, 0x0842, 0x707E, 0x399E, 0x7081, 0x399F,
+ 0x7085, 0x2157, 0x7089, 0x0FCD, 0x708A, 0x0A2C, 0x708E, 0x050C,
+ 0x7092, 0x15B1, 0x7095, 0x39A0, 0x7099, 0x15B0, 0x70AB, 0x2158,
+ 0x70AC, 0x15B4, 0x70AD, 0x0B78, 0x70AE, 0x15B7, 0x70AF, 0x15B2,
+ 0x70B3, 0x15B6, 0x70B7, 0x39A1, 0x70B8, 0x15B5, 0x70B9, 0x0C3A,
+ 0x70BA, 0x049D, 0x70BB, 0x20AD, 0x70C8, 0x0FBD, 0x70CB, 0x15B9,
+ 0x70CF, 0x04CA, 0x70D3, 0x39A2, 0x70D4, 0x39A3, 0x70D8, 0x39A4,
+ 0x70D9, 0x15BB, 0x70DC, 0x39A5, 0x70DD, 0x15BA, 0x70DF, 0x15B8,
+ 0x70F1, 0x15B3, 0x70F9, 0x0E51, 0x70FD, 0x15BD, 0x7104, 0x215A,
+ 0x7107, 0x39A6, 0x7109, 0x15BC, 0x710F, 0x2159, 0x7114, 0x050D,
+ 0x7119, 0x15BF, 0x711A, 0x0E02, 0x711C, 0x15BE, 0x7120, 0x39A7,
+ 0x7121, 0x0EC1, 0x7126, 0x09AF, 0x7130, 0x1DDC, 0x7131, 0x39A8,
+ 0x7136, 0x0AB5, 0x713C, 0x09AE, 0x7146, 0x215C, 0x7147, 0x215D,
+ 0x7149, 0x0FC3, 0x714A, 0x39A9, 0x714C, 0x15C5, 0x714E, 0x0A9D,
+ 0x7152, 0x39AA, 0x7155, 0x15C1, 0x7156, 0x15C6, 0x7159, 0x050E,
+ 0x715C, 0x215B, 0x7160, 0x39AB, 0x7162, 0x15C4, 0x7164, 0x0D17,
+ 0x7165, 0x15C0, 0x7166, 0x15C3, 0x7167, 0x09B0, 0x7169, 0x0D65,
+ 0x716C, 0x15C7, 0x716E, 0x08FD, 0x7179, 0x39AC, 0x717D, 0x0A9E,
+ 0x7184, 0x15CA, 0x7188, 0x15C2, 0x718A, 0x06FD, 0x718F, 0x15C8,
+ 0x7192, 0x39AD, 0x7194, 0x0F3A, 0x7195, 0x15CB, 0x7199, 0x205D,
+ 0x719F, 0x0959, 0x71A8, 0x15CC, 0x71AC, 0x15CD, 0x71B1, 0x0CE4,
+ 0x71B3, 0x39AE, 0x71B9, 0x15CF, 0x71BE, 0x15D0, 0x71C1, 0x215F,
+ 0x71C3, 0x0CE9, 0x71C8, 0x0C6F, 0x71C9, 0x15D2, 0x71CB, 0x39AF,
+ 0x71CE, 0x15D4, 0x71D0, 0x0F9D, 0x71D2, 0x15D1, 0x71D3, 0x39B0,
+ 0x71D4, 0x15D3, 0x71D5, 0x050F, 0x71D6, 0x39B1, 0x71D7, 0x15CE,
+ 0x71DF, 0x114E, 0x71E0, 0x15D5, 0x71E5, 0x0AE9, 0x71E6, 0x0886,
+ 0x71E7, 0x15D7, 0x71EC, 0x15D6, 0x71ED, 0x09EA, 0x71EE, 0x10EE,
+ 0x71F5, 0x15D8, 0x71F9, 0x15DA, 0x71FB, 0x15C9, 0x71FC, 0x15D9,
+ 0x71FE, 0x2160, 0x71FF, 0x15DB, 0x7200, 0x39B2, 0x7206, 0x0D30,
+ 0x720D, 0x15DC, 0x7210, 0x15DD, 0x721B, 0x15DE, 0x721D, 0x39B3,
+ 0x7228, 0x15DF, 0x722A, 0x0BFA, 0x722B, 0x39B4, 0x722C, 0x15E1,
+ 0x722D, 0x15E0, 0x7230, 0x15E2, 0x7232, 0x15E3, 0x7235, 0x090B,
+ 0x7236, 0x0DD5, 0x7238, 0x39B5, 0x723A, 0x0EF8, 0x723B, 0x15E4,
+ 0x723C, 0x15E5, 0x723D, 0x0AD8, 0x723E, 0x08D0, 0x723F, 0x15E6,
+ 0x7240, 0x15E7, 0x7241, 0x39B6, 0x7246, 0x15E8, 0x7247, 0x0E22,
+ 0x7248, 0x0D5B, 0x724B, 0x15E9, 0x724C, 0x0D0D, 0x7252, 0x0BC9,
+ 0x7253, 0x39B7, 0x7255, 0x39B8, 0x7256, 0x39B9, 0x7258, 0x15EA,
+ 0x7259, 0x0567, 0x725B, 0x0687, 0x725C, 0x39BA, 0x725D, 0x0ED2,
+ 0x725F, 0x0EC2, 0x7261, 0x0534, 0x7262, 0x0FDA, 0x7267, 0x0E80,
+ 0x7269, 0x0DFA, 0x7272, 0x0A5B, 0x7274, 0x15EB, 0x7279, 0x0C9B,
+ 0x727D, 0x0757, 0x727E, 0x15EC, 0x7280, 0x0844, 0x7281, 0x15EE,
+ 0x7282, 0x15ED, 0x7287, 0x15EF, 0x728D, 0x39BB, 0x7292, 0x15F0,
+ 0x7296, 0x15F1, 0x72A0, 0x0658, 0x72A2, 0x15F2, 0x72A7, 0x15F3,
+ 0x72AC, 0x0758, 0x72AD, 0x39BC, 0x72AF, 0x0D5C, 0x72B1, 0x2161,
+ 0x72B2, 0x15F5, 0x72B4, 0x39BD, 0x72B6, 0x09DD, 0x72B9, 0x15F4,
+ 0x72BE, 0x2162, 0x72C0, 0x342B, 0x72C2, 0x06B0, 0x72C3, 0x15F6,
+ 0x72C4, 0x15F8, 0x72C6, 0x15F7, 0x72C7, 0x39BE, 0x72CE, 0x15F9,
+ 0x72D0, 0x0785, 0x72D2, 0x15FA, 0x72D7, 0x06E1, 0x72D9, 0x0AC2,
+ 0x72DB, 0x080F, 0x72E0, 0x15FC, 0x72E1, 0x15FD, 0x72E2, 0x15FB,
+ 0x72E9, 0x0919, 0x72EC, 0x0CA0, 0x72ED, 0x06B1, 0x72F7, 0x15FF,
+ 0x72F8, 0x0B6A, 0x72F9, 0x15FE, 0x72FB, 0x39BF, 0x72FC, 0x0FDB,
+ 0x72FD, 0x0D18, 0x7304, 0x39C0, 0x7305, 0x39C1, 0x730A, 0x1602,
+ 0x7316, 0x1604, 0x7317, 0x1601, 0x731B, 0x0EE0, 0x731C, 0x1603,
+ 0x731D, 0x1605, 0x731F, 0x0F8C, 0x7324, 0x2163, 0x7325, 0x1609,
+ 0x7328, 0x39C2, 0x7329, 0x1608, 0x732A, 0x0BB4, 0x732B, 0x0CE3,
+ 0x732E, 0x0759, 0x732F, 0x1607, 0x7331, 0x39C3, 0x7334, 0x1606,
+ 0x7336, 0x0F1B, 0x7337, 0x0F1C, 0x733E, 0x160A, 0x733F, 0x0510,
+ 0x7343, 0x39C4, 0x7344, 0x0808, 0x7345, 0x08B0, 0x734E, 0x160B,
+ 0x734F, 0x160C, 0x7357, 0x160E, 0x7363, 0x094D, 0x7368, 0x1610,
+ 0x736A, 0x160F, 0x736C, 0x39C5, 0x7370, 0x1611, 0x7372, 0x05AB,
+ 0x7375, 0x1613, 0x7377, 0x2165, 0x7378, 0x1612, 0x737A, 0x1615,
+ 0x737B, 0x1614, 0x737C, 0x39C6, 0x7383, 0x39C7, 0x7384, 0x0770,
+ 0x7385, 0x39C8, 0x7386, 0x39C9, 0x7387, 0x0F70, 0x7389, 0x06C4,
+ 0x738B, 0x0526, 0x7395, 0x39CA, 0x7396, 0x06E2, 0x739E, 0x39CB,
+ 0x739F, 0x39CC, 0x73A0, 0x39CD, 0x73A6, 0x39CE, 0x73A8, 0x3C3F,
+ 0x73A9, 0x061D, 0x73AB, 0x39CF, 0x73B2, 0x0FB0, 0x73B3, 0x1617,
+ 0x73B5, 0x39D0, 0x73B7, 0x39D1, 0x73BA, 0x35EA, 0x73BB, 0x1619,
+ 0x73BC, 0x39D2, 0x73BD, 0x2166, 0x73C0, 0x161A, 0x73C2, 0x0551,
+ 0x73C8, 0x1616, 0x73C9, 0x2167, 0x73CA, 0x0887, 0x73CD, 0x0BDD,
+ 0x73CE, 0x1618, 0x73CF, 0x39D3, 0x73D2, 0x216A, 0x73D6, 0x2168,
+ 0x73D9, 0x39D4, 0x73DE, 0x161D, 0x73E0, 0x091A, 0x73E3, 0x2169,
+ 0x73E4, 0x3C39, 0x73E5, 0x161B, 0x73E9, 0x39D5, 0x73EA, 0x0714,
+ 0x73ED, 0x0D5D, 0x73EE, 0x161C, 0x73F1, 0x1637, 0x73F4, 0x39D6,
+ 0x73F5, 0x216C, 0x73F8, 0x1622, 0x73FD, 0x39D7, 0x73FE, 0x0771,
+ 0x7403, 0x067F, 0x7404, 0x39D8, 0x7405, 0x161F, 0x7406, 0x0F67,
+ 0x7407, 0x216B, 0x7409, 0x0F78, 0x740A, 0x39D9, 0x741A, 0x39DA,
+ 0x741B, 0x39DB, 0x7421, 0x3C3A, 0x7422, 0x0B56, 0x7424, 0x39DC,
+ 0x7425, 0x1621, 0x7426, 0x216D, 0x7428, 0x39DD, 0x7429, 0x216F,
+ 0x742A, 0x216E, 0x742C, 0x39DE, 0x742E, 0x2170, 0x742F, 0x39DF,
+ 0x7430, 0x39E0, 0x7431, 0x39E1, 0x7432, 0x1623, 0x7433, 0x0F9E,
+ 0x7434, 0x06CF, 0x7435, 0x0D90, 0x7436, 0x0D00, 0x7439, 0x39E2,
+ 0x743A, 0x1624, 0x743F, 0x1626, 0x7441, 0x1629, 0x7444, 0x39E3,
+ 0x7447, 0x39E4, 0x744B, 0x39E5, 0x744D, 0x39E6, 0x7451, 0x39E7,
+ 0x7455, 0x1625, 0x7457, 0x39E8, 0x7459, 0x1628, 0x745A, 0x079E,
+ 0x745B, 0x04EF, 0x745C, 0x162A, 0x745E, 0x0A36, 0x745F, 0x1627,
+ 0x7460, 0x0FA4, 0x7462, 0x2171, 0x7463, 0x162D, 0x7464, 0x1D35,
+ 0x7466, 0x39E9, 0x7469, 0x162B, 0x746A, 0x162E, 0x746B, 0x39EA,
+ 0x746F, 0x1620, 0x7470, 0x162C, 0x7471, 0x39EB, 0x7473, 0x082C,
+ 0x7476, 0x162F, 0x747E, 0x1630, 0x7480, 0x39EC, 0x7483, 0x0F68,
+ 0x7485, 0x39ED, 0x7486, 0x39EE, 0x7487, 0x39EF, 0x7489, 0x2172,
+ 0x748B, 0x1631, 0x7490, 0x39F0, 0x7498, 0x39F1, 0x749C, 0x39F2,
+ 0x749E, 0x1632, 0x749F, 0x2173, 0x74A0, 0x39F3, 0x74A2, 0x161E,
+ 0x74A3, 0x39F4, 0x74A7, 0x1633, 0x74A8, 0x39F5, 0x74AB, 0x39F6,
+ 0x74B0, 0x0600, 0x74B5, 0x39F7, 0x74BD, 0x08D1, 0x74BF, 0x39F8,
+ 0x74C8, 0x39F9, 0x74CA, 0x1634, 0x74CF, 0x1635, 0x74D4, 0x1636,
+ 0x74DA, 0x39FA, 0x74DC, 0x04DD, 0x74DE, 0x39FB, 0x74E0, 0x1638,
+ 0x74E2, 0x0DAD, 0x74E3, 0x1639, 0x74E6, 0x05E0, 0x74E7, 0x163A,
+ 0x74E9, 0x163B, 0x74EE, 0x163C, 0x74EF, 0x3750, 0x74F0, 0x163E,
+ 0x74F1, 0x163F, 0x74F2, 0x163D, 0x74F6, 0x0DC5, 0x74F7, 0x1641,
+ 0x74F8, 0x1640, 0x7501, 0x2174, 0x7503, 0x1643, 0x7504, 0x1642,
+ 0x7505, 0x1644, 0x750C, 0x1645, 0x750D, 0x1647, 0x750E, 0x1646,
+ 0x7511, 0x080B, 0x7513, 0x1649, 0x7515, 0x1648, 0x7518, 0x0601,
+ 0x751A, 0x0A19, 0x751C, 0x0C36, 0x751E, 0x164A, 0x751F, 0x0A5C,
+ 0x7522, 0x35DE, 0x7523, 0x0888, 0x7525, 0x051B, 0x7526, 0x164B,
+ 0x7528, 0x0F3B, 0x752B, 0x0E33, 0x752C, 0x164C, 0x752F, 0x20F2,
+ 0x7530, 0x0C3E, 0x7531, 0x0F1D, 0x7532, 0x07D5, 0x7533, 0x0A03,
+ 0x7537, 0x0B89, 0x7538, 0x10C9, 0x753A, 0x0BCA, 0x753B, 0x0568,
+ 0x753C, 0x164D, 0x7544, 0x164E, 0x7546, 0x1653, 0x7549, 0x1651,
+ 0x754A, 0x1650, 0x754B, 0x13C7, 0x754C, 0x0584, 0x754D, 0x164F,
+ 0x754E, 0x39FC, 0x754F, 0x049E, 0x7551, 0x0D3E, 0x7554, 0x0D5E,
+ 0x7559, 0x0F79, 0x755A, 0x1654, 0x755B, 0x1652, 0x755C, 0x0B9A,
+ 0x755D, 0x0A4A, 0x7560, 0x0D3F, 0x7562, 0x0D9F, 0x7564, 0x1656,
+ 0x7565, 0x0F74, 0x7566, 0x0723, 0x7567, 0x1657, 0x7569, 0x1655,
+ 0x756A, 0x0D6A, 0x756B, 0x1658, 0x756C, 0x3C3B, 0x756D, 0x1659,
+ 0x756F, 0x2175, 0x7570, 0x049F, 0x7573, 0x09DE, 0x7574, 0x165E,
+ 0x7575, 0x3751, 0x7576, 0x165B, 0x7577, 0x0CC5, 0x7578, 0x165A,
+ 0x7579, 0x39FD, 0x757F, 0x0640, 0x7581, 0x39FE, 0x7582, 0x1661,
+ 0x7586, 0x165C, 0x7587, 0x165D, 0x7589, 0x1660, 0x758A, 0x165F,
+ 0x758B, 0x0D97, 0x758E, 0x0AC4, 0x758F, 0x0AC3, 0x7590, 0x39FF,
+ 0x7591, 0x0659, 0x7592, 0x3A00, 0x7593, 0x3A01, 0x7594, 0x1662,
+ 0x759A, 0x1663, 0x759D, 0x1664, 0x75A3, 0x1666, 0x75A5, 0x1665,
+ 0x75AB, 0x04F8, 0x75B1, 0x166E, 0x75B2, 0x0D7C, 0x75B3, 0x1668,
+ 0x75B4, 0x3A02, 0x75B5, 0x166A, 0x75B8, 0x166C, 0x75B9, 0x0A04,
+ 0x75BC, 0x166D, 0x75BD, 0x166B, 0x75BE, 0x08EC, 0x75C2, 0x1667,
+ 0x75C3, 0x1669, 0x75C5, 0x0DB4, 0x75C7, 0x09B1, 0x75CA, 0x1670,
+ 0x75CD, 0x166F, 0x75D2, 0x1671, 0x75D4, 0x08D2, 0x75D5, 0x081F,
+ 0x75D8, 0x0C71, 0x75D9, 0x1672, 0x75DB, 0x0BE7, 0x75DE, 0x1674,
+ 0x75E2, 0x0F69, 0x75E3, 0x1673, 0x75E4, 0x3A03, 0x75E9, 0x0AEB,
+ 0x75EC, 0x3752, 0x75F0, 0x1679, 0x75F2, 0x167B, 0x75F3, 0x167C,
+ 0x75F4, 0x0B92, 0x75F9, 0x3A04, 0x75FA, 0x167A, 0x75FC, 0x1677,
+ 0x75FE, 0x1675, 0x75FF, 0x1676, 0x7600, 0x3A05, 0x7601, 0x1678,
+ 0x7609, 0x167F, 0x760A, 0x3A06, 0x760B, 0x167D, 0x760D, 0x167E,
+ 0x7615, 0x3A07, 0x7616, 0x3A08, 0x7619, 0x3A09, 0x761E, 0x3A0A,
+ 0x761F, 0x1680, 0x7620, 0x1682, 0x7621, 0x1683, 0x7622, 0x1684,
+ 0x7624, 0x1685, 0x7626, 0x1E2D, 0x7627, 0x1681, 0x762D, 0x3A0B,
+ 0x7630, 0x1687, 0x7634, 0x1686, 0x7635, 0x3A0C, 0x763B, 0x1688,
+ 0x7642, 0x0F8D, 0x7643, 0x3A0D, 0x7646, 0x168B, 0x7647, 0x1689,
+ 0x7648, 0x168A, 0x764B, 0x3A0E, 0x764C, 0x061E, 0x764E, 0x3753,
+ 0x7652, 0x0F0A, 0x7656, 0x0E1A, 0x7658, 0x168D, 0x765C, 0x168C,
+ 0x7661, 0x168E, 0x7662, 0x168F, 0x7665, 0x3A0F, 0x7667, 0x1693,
+ 0x7668, 0x1690, 0x7669, 0x1691, 0x766A, 0x1692, 0x766C, 0x1694,
+ 0x766D, 0x3A10, 0x766F, 0x3A11, 0x7670, 0x1695, 0x7671, 0x3A12,
+ 0x7672, 0x1696, 0x7674, 0x3A13, 0x7676, 0x1697, 0x7678, 0x1698,
+ 0x767A, 0x0D43, 0x767B, 0x0C4A, 0x767C, 0x1699, 0x767D, 0x0D28,
+ 0x767E, 0x0DA6, 0x7680, 0x169A, 0x7682, 0x2176, 0x7683, 0x169B,
+ 0x7684, 0x0C24, 0x7686, 0x0585, 0x7687, 0x07D6, 0x7688, 0x169C,
+ 0x768B, 0x169D, 0x768E, 0x169E, 0x7690, 0x0877, 0x7693, 0x16A0,
+ 0x7696, 0x169F, 0x7699, 0x16A1, 0x769A, 0x16A2, 0x769B, 0x2179,
+ 0x769C, 0x2177, 0x769E, 0x2178, 0x76A4, 0x3A14, 0x76A5, 0x3A15,
+ 0x76A6, 0x217A, 0x76AE, 0x0D7D, 0x76B0, 0x16A3, 0x76B4, 0x16A4,
+ 0x76B7, 0x1D1C, 0x76B8, 0x16A5, 0x76B9, 0x16A6, 0x76BA, 0x16A7,
+ 0x76BF, 0x087C, 0x76C2, 0x16A8, 0x76C3, 0x0D0C, 0x76C5, 0x3A16,
+ 0x76C6, 0x0E8D, 0x76C8, 0x04F0, 0x76CA, 0x04F9, 0x76CC, 0x3A17,
+ 0x76CD, 0x16A9, 0x76D2, 0x16AB, 0x76D6, 0x16AA, 0x76D7, 0x0C6A,
+ 0x76DB, 0x0A5D, 0x76DC, 0x14D8, 0x76DE, 0x16AC, 0x76DF, 0x0ECD,
+ 0x76E1, 0x16AD, 0x76E3, 0x0602, 0x76E4, 0x0D6B, 0x76E5, 0x16AE,
+ 0x76E7, 0x16AF, 0x76EA, 0x16B0, 0x76EC, 0x3A18, 0x76EE, 0x0EE8,
+ 0x76F2, 0x0EE1, 0x76F4, 0x0BDA, 0x76F8, 0x0AEC, 0x76FB, 0x16B2,
+ 0x76FC, 0x3A19, 0x76FE, 0x096C, 0x7701, 0x09B2, 0x7704, 0x16B5,
+ 0x7707, 0x16B4, 0x7708, 0x16B3, 0x7709, 0x0D91, 0x770B, 0x0603,
+ 0x770C, 0x075D, 0x771B, 0x16BB, 0x771E, 0x16B8, 0x771F, 0x0A05,
+ 0x7720, 0x0EBE, 0x7724, 0x16B7, 0x7725, 0x16B9, 0x7726, 0x16BA,
+ 0x7729, 0x16B6, 0x7734, 0x3A1A, 0x7736, 0x3A1B, 0x7737, 0x16BC,
+ 0x7738, 0x16BD, 0x773A, 0x0BCB, 0x773C, 0x061F, 0x7740, 0x0BA3,
+ 0x7746, 0x217C, 0x7747, 0x16BE, 0x775A, 0x16BF, 0x775B, 0x16C2,
+ 0x775C, 0x3A1C, 0x775F, 0x3A1D, 0x7760, 0x3A1E, 0x7761, 0x0A2D,
+ 0x7762, 0x1EC5, 0x7763, 0x0C9C, 0x7765, 0x16C3, 0x7766, 0x0E81,
+ 0x7768, 0x16C0, 0x776A, 0x3755, 0x776B, 0x16C1, 0x7772, 0x3A1F,
+ 0x7779, 0x16C6, 0x777D, 0x3A20, 0x777E, 0x16C5, 0x777F, 0x16C4,
+ 0x778B, 0x16C8, 0x778E, 0x16C7, 0x7791, 0x16C9, 0x7795, 0x3A21,
+ 0x779E, 0x16CB, 0x77A0, 0x16CA, 0x77A5, 0x0E1D, 0x77A9, 0x3756,
+ 0x77AA, 0x3A22, 0x77AC, 0x0960, 0x77AD, 0x0F8E, 0x77B0, 0x16CC,
+ 0x77B3, 0x0C8F, 0x77B6, 0x16CD, 0x77B9, 0x16CE, 0x77BB, 0x16D2,
+ 0x77BC, 0x16D0, 0x77BD, 0x16D1, 0x77BF, 0x16CF, 0x77C7, 0x16D3,
+ 0x77CD, 0x16D4, 0x77D7, 0x16D5, 0x77DA, 0x16D6, 0x77DB, 0x0EC3,
+ 0x77DC, 0x16D7, 0x77E2, 0x0EFC, 0x77E3, 0x16D8, 0x77E5, 0x0B8C,
+ 0x77E6, 0x3A23, 0x77E7, 0x0D20, 0x77E9, 0x06E3, 0x77ED, 0x0B79,
+ 0x77EE, 0x16D9, 0x77EF, 0x06B2, 0x77F0, 0x3A24, 0x77F3, 0x0A74,
+ 0x77F4, 0x3A25, 0x77FC, 0x16DA, 0x7802, 0x082D, 0x7806, 0x3A26,
+ 0x780C, 0x16DB, 0x7812, 0x16DC, 0x7814, 0x075A, 0x7815, 0x0845,
+ 0x7820, 0x16DE, 0x7821, 0x217E, 0x7822, 0x3A27, 0x7825, 0x0C50,
+ 0x7826, 0x0846, 0x7827, 0x0668, 0x782D, 0x3A28, 0x782E, 0x3A29,
+ 0x7830, 0x3A2A, 0x7832, 0x0E52, 0x7834, 0x0D01, 0x7835, 0x3A2B,
+ 0x783A, 0x0C51, 0x783F, 0x07EE, 0x7845, 0x16E0, 0x784E, 0x217F,
+ 0x784F, 0x341E, 0x7851, 0x3C3C, 0x785D, 0x09B3, 0x7864, 0x2180,
+ 0x7868, 0x3A2C, 0x786B, 0x0F7A, 0x786C, 0x07D7, 0x786F, 0x075B,
+ 0x7872, 0x0D37, 0x7874, 0x16E2, 0x787A, 0x2181, 0x787C, 0x16E4,
+ 0x7881, 0x079F, 0x7886, 0x16E3, 0x7887, 0x0C12, 0x788C, 0x16E6,
+ 0x788D, 0x0595, 0x788E, 0x16E1, 0x7891, 0x0D7E, 0x7893, 0x04D2,
+ 0x7895, 0x085C, 0x7897, 0x0FF8, 0x789A, 0x16E5, 0x789E, 0x3A2D,
+ 0x78A3, 0x16E7, 0x78A7, 0x0E1B, 0x78A9, 0x0A7D, 0x78AA, 0x16E9,
+ 0x78AF, 0x16EA, 0x78B5, 0x16E8, 0x78BA, 0x05AC, 0x78BC, 0x16F0,
+ 0x78BE, 0x16EF, 0x78C1, 0x08D3, 0x78C5, 0x16F1, 0x78C6, 0x16EC,
+ 0x78C8, 0x3A2E, 0x78CA, 0x16F2, 0x78CB, 0x16ED, 0x78CC, 0x3A2F,
+ 0x78CE, 0x3A30, 0x78D0, 0x0D6C, 0x78D1, 0x16EB, 0x78D4, 0x16EE,
+ 0x78DA, 0x16F5, 0x78E0, 0x3A32, 0x78E1, 0x3A33, 0x78E4, 0x3A31,
+ 0x78E7, 0x16F4, 0x78E8, 0x0E8F, 0x78EC, 0x16F3, 0x78EF, 0x04AF,
+ 0x78F2, 0x3A34, 0x78F4, 0x16F7, 0x78F7, 0x3A35, 0x78FB, 0x3A36,
+ 0x78FD, 0x16F6, 0x7901, 0x09B4, 0x7907, 0x16F8, 0x790E, 0x0AC5,
+ 0x7911, 0x16FA, 0x7912, 0x16F9, 0x7919, 0x16FB, 0x7926, 0x16DD,
+ 0x792A, 0x16DF, 0x792B, 0x16FD, 0x792C, 0x16FC, 0x7930, 0x2182,
+ 0x7931, 0x3A37, 0x7934, 0x3A38, 0x793A, 0x08D4, 0x793B, 0x3A39,
+ 0x793C, 0x0FB1, 0x793D, 0x3A3A, 0x793E, 0x08FE, 0x7940, 0x16FE,
+ 0x7941, 0x070D, 0x7945, 0x3A3B, 0x7947, 0x065A, 0x7948, 0x0641,
+ 0x7949, 0x08B1, 0x7950, 0x0F1E, 0x7953, 0x1704, 0x7955, 0x1703,
+ 0x7956, 0x0AC6, 0x7957, 0x1700, 0x795A, 0x1702, 0x795B, 0x3A3C,
+ 0x795C, 0x3A3D, 0x795D, 0x0955, 0x795E, 0x0A06, 0x795F, 0x1701,
+ 0x7960, 0x16FF, 0x7962, 0x0CE0, 0x7965, 0x09B5, 0x7968, 0x0DAE,
+ 0x796D, 0x0847, 0x7977, 0x0C72, 0x797A, 0x1705, 0x797F, 0x1706,
+ 0x7980, 0x171C, 0x7981, 0x06D0, 0x7984, 0x0FE3, 0x7985, 0x0AB7,
+ 0x798A, 0x1707, 0x798B, 0x3A3E, 0x798D, 0x0552, 0x798E, 0x0C13,
+ 0x798F, 0x0DF1, 0x7994, 0x2186, 0x7996, 0x3A3F, 0x7998, 0x3A40,
+ 0x799B, 0x2188, 0x799D, 0x1708, 0x79A6, 0x0694, 0x79A7, 0x1709,
+ 0x79AA, 0x170B, 0x79AE, 0x170C, 0x79B0, 0x0CDF, 0x79B1, 0x1E4E,
+ 0x79B3, 0x170D, 0x79B8, 0x3A41, 0x79B9, 0x170E, 0x79BA, 0x170F,
+ 0x79BB, 0x3A42, 0x79BD, 0x06D1, 0x79BE, 0x0553, 0x79BF, 0x0C9D,
+ 0x79C0, 0x0932, 0x79C1, 0x08B2, 0x79C9, 0x1710, 0x79CA, 0x3A43,
+ 0x79CB, 0x0933, 0x79D1, 0x054A, 0x79D2, 0x0DB5, 0x79D5, 0x1711,
+ 0x79D8, 0x0D7F, 0x79DA, 0x3A44, 0x79DF, 0x0AC7, 0x79E1, 0x1714,
+ 0x79E3, 0x1715, 0x79E4, 0x0D1F, 0x79E6, 0x0A07, 0x79E7, 0x1712,
+ 0x79E9, 0x0B9F, 0x79EC, 0x1713, 0x79F0, 0x09B6, 0x79FB, 0x04A0,
+ 0x7A00, 0x0643, 0x7A03, 0x3A45, 0x7A05, 0x3633, 0x7A08, 0x1716,
+ 0x7A09, 0x3A46, 0x7A0B, 0x0C14, 0x7A0D, 0x1717, 0x7A0E, 0x0A6B,
+ 0x7A11, 0x3A47, 0x7A14, 0x0EB9, 0x7A17, 0x0D95, 0x7A18, 0x1718,
+ 0x7A19, 0x1719, 0x7A1A, 0x0B93, 0x7A1C, 0x0F8F, 0x7A1E, 0x3A48,
+ 0x7A1F, 0x171B, 0x7A20, 0x171A, 0x7A2D, 0x3A49, 0x7A2E, 0x091B,
+ 0x7A31, 0x171D, 0x7A32, 0x04B4, 0x7A37, 0x1720, 0x7A39, 0x3A4A,
+ 0x7A3B, 0x171E, 0x7A3C, 0x0554, 0x7A3D, 0x0724, 0x7A3E, 0x171F,
+ 0x7A3F, 0x07D8, 0x7A40, 0x0804, 0x7A42, 0x0E36, 0x7A43, 0x1721,
+ 0x7A45, 0x3A4B, 0x7A46, 0x0E82, 0x7A49, 0x1723, 0x7A4C, 0x3A4C,
+ 0x7A4D, 0x0A75, 0x7A4E, 0x04F1, 0x7A4F, 0x053A, 0x7A50, 0x0470,
+ 0x7A57, 0x1722, 0x7A5D, 0x3A4D, 0x7A60, 0x3A4E, 0x7A61, 0x1724,
+ 0x7A62, 0x1725, 0x7A63, 0x09DF, 0x7A69, 0x1726, 0x7A6B, 0x05AD,
+ 0x7A6D, 0x3A4F, 0x7A70, 0x1728, 0x7A74, 0x0740, 0x7A76, 0x0680,
+ 0x7A78, 0x3A50, 0x7A79, 0x1729, 0x7A7A, 0x06ED, 0x7A7D, 0x172A,
+ 0x7A7F, 0x0AA0, 0x7A81, 0x0CA5, 0x7A83, 0x0A84, 0x7A84, 0x0865,
+ 0x7A88, 0x172B, 0x7A92, 0x0BA0, 0x7A93, 0x0AED, 0x7A95, 0x172D,
+ 0x7A96, 0x172F, 0x7A97, 0x172C, 0x7A98, 0x172E, 0x7A9F, 0x06F8,
+ 0x7AA0, 0x3A51, 0x7AA3, 0x3A52, 0x7AA9, 0x1730, 0x7AAA, 0x06FC,
+ 0x7AAE, 0x0681, 0x7AAF, 0x0F3C, 0x7AB0, 0x1732, 0x7AB3, 0x3A53,
+ 0x7AB6, 0x1733, 0x7ABA, 0x04D0, 0x7ABB, 0x3A54, 0x7ABC, 0x3A55,
+ 0x7ABF, 0x1736, 0x7AC3, 0x05D4, 0x7AC4, 0x1735, 0x7AC5, 0x1734,
+ 0x7AC6, 0x3A56, 0x7AC7, 0x1738, 0x7AC8, 0x1731, 0x7ACA, 0x1739,
+ 0x7ACB, 0x0F71, 0x7ACD, 0x173A, 0x7ACF, 0x173B, 0x7AD1, 0x2189,
+ 0x7AD2, 0x11C5, 0x7AD3, 0x173D, 0x7AD5, 0x173C, 0x7AD9, 0x173E,
+ 0x7ADA, 0x173F, 0x7ADC, 0x0F7D, 0x7ADD, 0x1740, 0x7ADF, 0x1C08,
+ 0x7AE0, 0x09B7, 0x7AE1, 0x1741, 0x7AE2, 0x1742, 0x7AE3, 0x0961,
+ 0x7AE5, 0x0C90, 0x7AE6, 0x1743, 0x7AE7, 0x218A, 0x7AEA, 0x0B66,
+ 0x7AEB, 0x218C, 0x7AED, 0x1744, 0x7AEF, 0x0B7A, 0x7AF0, 0x1745,
+ 0x7AF6, 0x069D, 0x7AF8, 0x1076, 0x7AF9, 0x0B9B, 0x7AFA, 0x08DF,
+ 0x7AFF, 0x0604, 0x7B02, 0x1746, 0x7B04, 0x1753, 0x7B06, 0x1749,
+ 0x7B07, 0x3A57, 0x7B08, 0x0682, 0x7B0A, 0x1748, 0x7B0B, 0x1755,
+ 0x7B0F, 0x1747, 0x7B11, 0x09B8, 0x7B14, 0x3A58, 0x7B18, 0x174B,
+ 0x7B19, 0x174C, 0x7B1B, 0x0C25, 0x7B1E, 0x174D, 0x7B20, 0x05BC,
+ 0x7B25, 0x0A20, 0x7B26, 0x0DD6, 0x7B27, 0x3A59, 0x7B28, 0x174F,
+ 0x7B2C, 0x0B48, 0x7B31, 0x3A5A, 0x7B33, 0x174A, 0x7B35, 0x174E,
+ 0x7B36, 0x1750, 0x7B39, 0x086B, 0x7B45, 0x1757, 0x7B46, 0x0DA0,
+ 0x7B47, 0x3A5B, 0x7B48, 0x0D3A, 0x7B49, 0x0C73, 0x7B4B, 0x06D2,
+ 0x7B4C, 0x1756, 0x7B4D, 0x1754, 0x7B4E, 0x3A5C, 0x7B4F, 0x0D49,
+ 0x7B50, 0x1751, 0x7B51, 0x0B9C, 0x7B52, 0x0C75, 0x7B53, 0x375D,
+ 0x7B54, 0x0C74, 0x7B56, 0x0866, 0x7B5D, 0x1769, 0x7B60, 0x3A5D,
+ 0x7B65, 0x1759, 0x7B67, 0x175B, 0x7B69, 0x3A5E, 0x7B6C, 0x175E,
+ 0x7B6D, 0x3A5F, 0x7B6E, 0x175F, 0x7B70, 0x175C, 0x7B71, 0x175D,
+ 0x7B72, 0x3A60, 0x7B74, 0x175A, 0x7B75, 0x1758, 0x7B7A, 0x1752,
+ 0x7B86, 0x0E1F, 0x7B87, 0x0555, 0x7B8B, 0x1766, 0x7B8D, 0x1763,
+ 0x7B8F, 0x1768, 0x7B91, 0x3A61, 0x7B92, 0x1767, 0x7B94, 0x0D29,
+ 0x7B95, 0x0EB3, 0x7B97, 0x0889, 0x7B98, 0x1761, 0x7B99, 0x176A,
+ 0x7B9A, 0x1765, 0x7B9C, 0x1764, 0x7B9D, 0x1760, 0x7B9E, 0x218D,
+ 0x7B9F, 0x1762, 0x7BA1, 0x0605, 0x7BAA, 0x0B7B, 0x7BAD, 0x0AA1,
+ 0x7BAF, 0x3A62, 0x7BB1, 0x0D36, 0x7BB4, 0x176F, 0x7BB8, 0x0D38,
+ 0x7BC0, 0x0A85, 0x7BC1, 0x176C, 0x7BC4, 0x0D63, 0x7BC6, 0x1770,
+ 0x7BC7, 0x0E23, 0x7BC9, 0x0B99, 0x7BCB, 0x176B, 0x7BCC, 0x176D,
+ 0x7BCF, 0x176E, 0x7BD7, 0x3A63, 0x7BD9, 0x3A64, 0x7BDD, 0x1771,
+ 0x7BE0, 0x08F0, 0x7BE4, 0x0C9E, 0x7BE5, 0x1776, 0x7BE6, 0x1775,
+ 0x7BE9, 0x1772, 0x7BED, 0x0FDC, 0x7BF3, 0x177B, 0x7BF6, 0x177F,
+ 0x7BF7, 0x177C, 0x7C00, 0x1778, 0x7C07, 0x1779, 0x7C0B, 0x3A65,
+ 0x7C0D, 0x177E, 0x7C0F, 0x3A66, 0x7C11, 0x1773, 0x7C12, 0x10EA,
+ 0x7C13, 0x177A, 0x7C14, 0x1774, 0x7C17, 0x177D, 0x7C1E, 0x1E3B,
+ 0x7C1F, 0x1783, 0x7C20, 0x3A67, 0x7C21, 0x0606, 0x7C23, 0x1780,
+ 0x7C26, 0x3A68, 0x7C27, 0x1781, 0x7C2A, 0x1782, 0x7C2B, 0x1785,
+ 0x7C31, 0x3A69, 0x7C36, 0x3A6A, 0x7C37, 0x1784, 0x7C38, 0x0D8A,
+ 0x7C3D, 0x1786, 0x7C3E, 0x0FC4, 0x7C3F, 0x0E3D, 0x7C40, 0x178B,
+ 0x7C43, 0x1788, 0x7C4C, 0x1787, 0x7C4D, 0x0A76, 0x7C4F, 0x178A,
+ 0x7C50, 0x178C, 0x7C51, 0x3A6B, 0x7C54, 0x1789, 0x7C56, 0x1790,
+ 0x7C58, 0x178D, 0x7C59, 0x3A6C, 0x7C5F, 0x178E, 0x7C60, 0x1777,
+ 0x7C64, 0x178F, 0x7C65, 0x1791, 0x7C67, 0x3A6D, 0x7C6C, 0x1792,
+ 0x7C6E, 0x3A6E, 0x7C70, 0x3A6F, 0x7C73, 0x0E16, 0x7C75, 0x1793,
+ 0x7C7B, 0x370E, 0x7C7E, 0x0EEE, 0x7C81, 0x06C6, 0x7C82, 0x06FF,
+ 0x7C83, 0x1794, 0x7C89, 0x0E04, 0x7C8B, 0x0A2E, 0x7C8D, 0x0EBC,
+ 0x7C90, 0x1795, 0x7C92, 0x0F7B, 0x7C95, 0x0D2A, 0x7C97, 0x0AC8,
+ 0x7C98, 0x0CEA, 0x7C9B, 0x0957, 0x7C9F, 0x0484, 0x7CA1, 0x179A,
+ 0x7CA2, 0x1798, 0x7CA4, 0x1796, 0x7CA5, 0x05DD, 0x7CA7, 0x09B9,
+ 0x7CA8, 0x179B, 0x7CAB, 0x1799, 0x7CAD, 0x1797, 0x7CAE, 0x179F,
+ 0x7CB1, 0x179E, 0x7CB2, 0x179D, 0x7CB3, 0x179C, 0x7CB9, 0x17A0,
+ 0x7CBC, 0x3A70, 0x7CBD, 0x17A1, 0x7CBE, 0x0A5E, 0x7CBF, 0x3A71,
+ 0x7CC0, 0x17A2, 0x7CC2, 0x17A4, 0x7CC5, 0x17A3, 0x7CC8, 0x3A72,
+ 0x7CC9, 0x3A73, 0x7CCA, 0x0786, 0x7CCE, 0x0ABA, 0x7CD2, 0x17A6,
+ 0x7CD6, 0x0C76, 0x7CD7, 0x3A74, 0x7CD8, 0x17A5, 0x7CD9, 0x3A75,
+ 0x7CDC, 0x17A7, 0x7CDD, 0x3A76, 0x7CDE, 0x0E05, 0x7CDF, 0x0AEE,
+ 0x7CE0, 0x07D9, 0x7CE2, 0x17A8, 0x7CE7, 0x0F90, 0x7CEB, 0x3A77,
+ 0x7CEF, 0x17AA, 0x7CF2, 0x17AB, 0x7CF4, 0x17AC, 0x7CF6, 0x17AD,
+ 0x7CF8, 0x08B3, 0x7CFA, 0x17AE, 0x7CFB, 0x0725, 0x7CFE, 0x0684,
+ 0x7D00, 0x0644, 0x7D02, 0x17B0, 0x7D04, 0x0EFF, 0x7D05, 0x07DA,
+ 0x7D06, 0x17AF, 0x7D07, 0x3A78, 0x7D08, 0x3A79, 0x7D09, 0x3A7A,
+ 0x7D0A, 0x17B3, 0x7D0B, 0x0EF2, 0x7D0D, 0x0CF2, 0x7D10, 0x0DA5,
+ 0x7D13, 0x3A7B, 0x7D14, 0x096D, 0x7D15, 0x17B2, 0x7D17, 0x08FF,
+ 0x7D18, 0x07DB, 0x7D19, 0x08B4, 0x7D1A, 0x0683, 0x7D1B, 0x0E06,
+ 0x7D1C, 0x17B1, 0x7D1D, 0x3A7C, 0x7D20, 0x0AC9, 0x7D21, 0x0E70,
+ 0x7D22, 0x0867, 0x7D23, 0x3A7D, 0x7D2B, 0x08B5, 0x7D2C, 0x0BF9,
+ 0x7D2E, 0x17B6, 0x7D2F, 0x0FA7, 0x7D30, 0x0849, 0x7D32, 0x17B7,
+ 0x7D33, 0x0A08, 0x7D35, 0x17B9, 0x7D39, 0x09BA, 0x7D3A, 0x0820,
+ 0x7D3F, 0x17B8, 0x7D41, 0x3A7E, 0x7D42, 0x0934, 0x7D43, 0x0772,
+ 0x7D44, 0x0ACA, 0x7D45, 0x17B4, 0x7D46, 0x17BA, 0x7D48, 0x218F,
+ 0x7D4B, 0x17B5, 0x7D4C, 0x0726, 0x7D4E, 0x17BD, 0x7D4F, 0x17C1,
+ 0x7D50, 0x0741, 0x7D53, 0x3A7F, 0x7D56, 0x17BC, 0x7D59, 0x3A80,
+ 0x7D5B, 0x17C5, 0x7D5C, 0x2190, 0x7D5D, 0x3A81, 0x7D5E, 0x07DC,
+ 0x7D61, 0x0F57, 0x7D62, 0x0480, 0x7D63, 0x17C2, 0x7D66, 0x0685,
+ 0x7D68, 0x17BF, 0x7D6E, 0x17C0, 0x7D71, 0x0C77, 0x7D72, 0x17BE,
+ 0x7D73, 0x17BB, 0x7D75, 0x0586, 0x7D76, 0x0A88, 0x7D79, 0x075C,
+ 0x7D7A, 0x3A82, 0x7D7D, 0x17C7, 0x7D86, 0x3A83, 0x7D89, 0x17C4,
+ 0x7D8B, 0x3A84, 0x7D8C, 0x3A85, 0x7D8F, 0x17C6, 0x7D93, 0x17C3,
+ 0x7D99, 0x0727, 0x7D9A, 0x0B13, 0x7D9B, 0x17C8, 0x7D9C, 0x0AF0,
+ 0x7D9F, 0x17D5, 0x7DA0, 0x2192, 0x7DA2, 0x17D1, 0x7DA3, 0x17CB,
+ 0x7DAB, 0x17CF, 0x7DAC, 0x0926, 0x7DAD, 0x04A1, 0x7DAE, 0x17CA,
+ 0x7DAF, 0x17D2, 0x7DB0, 0x17D6, 0x7DB1, 0x07DD, 0x7DB2, 0x0EE2,
+ 0x7DB4, 0x0BF2, 0x7DB5, 0x17CC, 0x7DB7, 0x2191, 0x7DB8, 0x17D4,
+ 0x7DBA, 0x17C9, 0x7DBB, 0x0B7C, 0x7DBD, 0x17CE, 0x7DBE, 0x0481,
+ 0x7DBF, 0x0ED6, 0x7DC7, 0x17CD, 0x7DCA, 0x06D3, 0x7DCB, 0x0D80,
+ 0x7DCC, 0x3A86, 0x7DCF, 0x0AEF, 0x7DD1, 0x0F98, 0x7DD2, 0x0979,
+ 0x7DD5, 0x17FD, 0x7DD6, 0x2193, 0x7DD8, 0x17D7, 0x7DDA, 0x0AA2,
+ 0x7DDC, 0x17D3, 0x7DDD, 0x17D8, 0x7DDE, 0x17DA, 0x7DE0, 0x0C15,
+ 0x7DE1, 0x17DD, 0x7DE3, 0x340A, 0x7DE4, 0x17D9, 0x7DE8, 0x0E24,
+ 0x7DE9, 0x0607, 0x7DEB, 0x3A87, 0x7DEC, 0x0ED7, 0x7DEF, 0x04A2,
+ 0x7DF1, 0x3A88, 0x7DF2, 0x17DC, 0x7DF4, 0x0FC5, 0x7DF9, 0x3A89,
+ 0x7DFB, 0x17DB, 0x7E01, 0x0511, 0x7E04, 0x0CC4, 0x7E05, 0x17DE,
+ 0x7E08, 0x3A8A, 0x7E09, 0x17E5, 0x7E0A, 0x17DF, 0x7E0B, 0x17E6,
+ 0x7E11, 0x3A8B, 0x7E12, 0x17E2, 0x7E15, 0x3A8C, 0x7E1B, 0x0D31,
+ 0x7E1E, 0x08F6, 0x7E1F, 0x17E4, 0x7E20, 0x3A8D, 0x7E21, 0x17E1,
+ 0x7E22, 0x17E7, 0x7E23, 0x17E0, 0x7E26, 0x094E, 0x7E2B, 0x0E53,
+ 0x7E2E, 0x0956, 0x7E31, 0x17E3, 0x7E32, 0x17EF, 0x7E35, 0x17EB,
+ 0x7E37, 0x17EE, 0x7E39, 0x17EC, 0x7E3A, 0x17F0, 0x7E3B, 0x17EA,
+ 0x7E3D, 0x17D0, 0x7E3E, 0x0A77, 0x7E41, 0x0D5F, 0x7E43, 0x17ED,
+ 0x7E46, 0x17E8, 0x7E47, 0x3A8E, 0x7E48, 0x3767, 0x7E4A, 0x0AA3,
+ 0x7E4B, 0x0728, 0x7E4D, 0x0935, 0x7E52, 0x2194, 0x7E54, 0x09EB,
+ 0x7E55, 0x0AB8, 0x7E56, 0x17F3, 0x7E59, 0x17F5, 0x7E5A, 0x17F6,
+ 0x7E5D, 0x17F2, 0x7E5E, 0x17F4, 0x7E61, 0x1E11, 0x7E62, 0x3A8F,
+ 0x7E66, 0x17E9, 0x7E67, 0x17F1, 0x7E69, 0x17F9, 0x7E6A, 0x17F8,
+ 0x7E6B, 0x1DF7, 0x7E6D, 0x0EA8, 0x7E6E, 0x3A90, 0x7E70, 0x0701,
+ 0x7E73, 0x3A91, 0x7E79, 0x17F7, 0x7E7B, 0x17FB, 0x7E7C, 0x17FA,
+ 0x7E7D, 0x17FE, 0x7E7F, 0x1800, 0x7E82, 0x088A, 0x7E83, 0x17FC,
+ 0x7E88, 0x1801, 0x7E89, 0x1802, 0x7E8A, 0x20A7, 0x7E8C, 0x1803,
+ 0x7E8D, 0x3A92, 0x7E8E, 0x1809, 0x7E8F, 0x0C35, 0x7E90, 0x1805,
+ 0x7E91, 0x3A93, 0x7E92, 0x1804, 0x7E93, 0x1806, 0x7E94, 0x1807,
+ 0x7E96, 0x1808, 0x7E98, 0x3A94, 0x7E9B, 0x180A, 0x7E9C, 0x180B,
+ 0x7F36, 0x0608, 0x7F38, 0x180C, 0x7F3A, 0x180D, 0x7F44, 0x3A95,
+ 0x7F45, 0x180E, 0x7F47, 0x2195, 0x7F4C, 0x180F, 0x7F4D, 0x1810,
+ 0x7F4E, 0x1811, 0x7F4F, 0x3A96, 0x7F50, 0x1812, 0x7F51, 0x1813,
+ 0x7F52, 0x3A97, 0x7F53, 0x3A98, 0x7F54, 0x1815, 0x7F55, 0x1814,
+ 0x7F58, 0x1816, 0x7F5F, 0x1817, 0x7F60, 0x1818, 0x7F61, 0x3A99,
+ 0x7F67, 0x181B, 0x7F68, 0x1819, 0x7F69, 0x181A, 0x7F6A, 0x0851,
+ 0x7F6B, 0x0729, 0x7F6E, 0x0B94, 0x7F70, 0x0D47, 0x7F72, 0x097A,
+ 0x7F75, 0x0D03, 0x7F77, 0x0D81, 0x7F78, 0x181C, 0x7F79, 0x1336,
+ 0x7F82, 0x181D, 0x7F83, 0x181F, 0x7F85, 0x0F4F, 0x7F86, 0x181E,
+ 0x7F87, 0x1821, 0x7F88, 0x1820, 0x7F8A, 0x0F3D, 0x7F8C, 0x1822,
+ 0x7F8E, 0x0D92, 0x7F91, 0x3A9A, 0x7F94, 0x1823, 0x7F9A, 0x1826,
+ 0x7F9D, 0x1825, 0x7F9E, 0x1824, 0x7FA1, 0x2196, 0x7FA3, 0x1827,
+ 0x7FA4, 0x0708, 0x7FA8, 0x0AA4, 0x7FA9, 0x065B, 0x7FAE, 0x182B,
+ 0x7FAF, 0x1828, 0x7FB2, 0x1829, 0x7FB6, 0x182C, 0x7FB8, 0x182D,
+ 0x7FB9, 0x182A, 0x7FBD, 0x04CB, 0x7FBF, 0x3A9B, 0x7FC1, 0x0527,
+ 0x7FC5, 0x182F, 0x7FC6, 0x1830, 0x7FCA, 0x1831, 0x7FCC, 0x0F4C,
+ 0x7FCE, 0x3A9C, 0x7FD2, 0x0936, 0x7FD4, 0x1833, 0x7FD5, 0x1832,
+ 0x7FDF, 0x3A9D, 0x7FE0, 0x0A2F, 0x7FE1, 0x1834, 0x7FE5, 0x3A9E,
+ 0x7FE6, 0x1835, 0x7FE9, 0x1836, 0x7FEB, 0x0621, 0x7FEC, 0x3A9F,
+ 0x7FEE, 0x3AA0, 0x7FEF, 0x3AA1, 0x7FF0, 0x0609, 0x7FF3, 0x1837,
+ 0x7FF9, 0x1838, 0x7FFA, 0x3AA2, 0x7FFB, 0x0E8B, 0x7FFC, 0x0F4D,
+ 0x8000, 0x0F3E, 0x8001, 0x0FDD, 0x8002, 0x3713, 0x8003, 0x07DF,
+ 0x8004, 0x183B, 0x8005, 0x0900, 0x8006, 0x183A, 0x800B, 0x183C,
+ 0x800C, 0x08D5, 0x800E, 0x3AA3, 0x8010, 0x0B31, 0x8011, 0x3AA4,
+ 0x8012, 0x183D, 0x8014, 0x3AA5, 0x8015, 0x07DE, 0x8017, 0x0EE3,
+ 0x8018, 0x183E, 0x8019, 0x183F, 0x801C, 0x1840, 0x8021, 0x1841,
+ 0x8024, 0x3AA6, 0x8026, 0x3AA7, 0x8028, 0x1842, 0x8033, 0x08D6,
+ 0x8036, 0x0EF9, 0x803A, 0x3AA8, 0x803B, 0x1844, 0x803C, 0x3AA9,
+ 0x803D, 0x0B7D, 0x803F, 0x1843, 0x8046, 0x1846, 0x804A, 0x1845,
+ 0x8052, 0x1847, 0x8056, 0x0A5F, 0x8058, 0x1848, 0x805A, 0x1849,
+ 0x805E, 0x0E09, 0x805F, 0x184A, 0x8060, 0x3AAA, 0x8061, 0x0AF1,
+ 0x8062, 0x184B, 0x8068, 0x184C, 0x806F, 0x0FC6, 0x8070, 0x184F,
+ 0x8071, 0x3AAB, 0x8072, 0x184E, 0x8073, 0x184D, 0x8074, 0x0BCC,
+ 0x8075, 0x3AAC, 0x8076, 0x1850, 0x8077, 0x09EC, 0x8079, 0x1851,
+ 0x807D, 0x1852, 0x807E, 0x0FDE, 0x807F, 0x1853, 0x8084, 0x1854,
+ 0x8085, 0x1856, 0x8086, 0x1855, 0x8087, 0x0D39, 0x8089, 0x0CD1,
+ 0x808B, 0x0FE4, 0x808C, 0x0D3D, 0x8093, 0x1858, 0x8096, 0x09BB,
+ 0x8098, 0x0D9C, 0x809A, 0x1859, 0x809B, 0x1857, 0x809D, 0x060A,
+ 0x809E, 0x3AAD, 0x80A1, 0x0788, 0x80A2, 0x08B6, 0x80A5, 0x0D82,
+ 0x80A6, 0x3AAE, 0x80A9, 0x075E, 0x80AA, 0x0E71, 0x80AB, 0x3AAF,
+ 0x80AC, 0x185C, 0x80AD, 0x185A, 0x80AF, 0x07E0, 0x80B1, 0x07E1,
+ 0x80B2, 0x04AD, 0x80B4, 0x0858, 0x80BA, 0x0D0F, 0x80C3, 0x04A3,
+ 0x80C4, 0x1861, 0x80C6, 0x0B7E, 0x80CC, 0x0D0E, 0x80CE, 0x0B3B,
+ 0x80D6, 0x1863, 0x80D7, 0x3AB0, 0x80D8, 0x3AB1, 0x80D9, 0x185F,
+ 0x80DA, 0x1862, 0x80DB, 0x185D, 0x80DD, 0x1860, 0x80DE, 0x0E54,
+ 0x80E1, 0x0789, 0x80E4, 0x04C1, 0x80E5, 0x185E, 0x80EF, 0x1865,
+ 0x80F1, 0x1866, 0x80F4, 0x0C91, 0x80F8, 0x06B3, 0x80FC, 0x1871,
+ 0x80FD, 0x0CF3, 0x8102, 0x08B7, 0x8105, 0x06B4, 0x8106, 0x0A6C,
+ 0x8107, 0x0FEC, 0x8108, 0x0EBA, 0x8109, 0x1864, 0x810A, 0x0A78,
+ 0x8116, 0x3AB2, 0x8118, 0x3AB3, 0x811A, 0x066D, 0x811B, 0x1867,
+ 0x8123, 0x1869, 0x8129, 0x1868, 0x812B, 0x3659, 0x812F, 0x186A,
+ 0x8131, 0x0B64, 0x8133, 0x0CF4, 0x8139, 0x0BCD, 0x813A, 0x3AB4,
+ 0x813E, 0x186E, 0x8141, 0x3772, 0x8146, 0x186D, 0x814A, 0x3AB5,
+ 0x814B, 0x186B, 0x814C, 0x3AB6, 0x814E, 0x0A1B, 0x8150, 0x0DD7,
+ 0x8151, 0x1870, 0x8153, 0x186F, 0x8154, 0x07E2, 0x8155, 0x0FF9,
+ 0x815F, 0x1880, 0x8165, 0x1874, 0x8166, 0x1875, 0x816B, 0x091C,
+ 0x816E, 0x1873, 0x8170, 0x080A, 0x8171, 0x1872, 0x8174, 0x1876,
+ 0x8178, 0x0BCE, 0x8179, 0x0DF2, 0x817A, 0x0AA5, 0x817F, 0x0B3C,
+ 0x8180, 0x187A, 0x8181, 0x3AB7, 0x8182, 0x187B, 0x8183, 0x1877,
+ 0x8184, 0x3AB8, 0x8188, 0x1878, 0x818A, 0x1879, 0x818F, 0x07E3,
+ 0x8193, 0x1881, 0x8195, 0x187D, 0x819A, 0x0DD8, 0x819C, 0x0E9A,
+ 0x819D, 0x0D9A, 0x81A0, 0x187C, 0x81A3, 0x187F, 0x81A4, 0x187E,
+ 0x81A8, 0x0E72, 0x81A9, 0x1882, 0x81B0, 0x1883, 0x81B3, 0x0AB9,
+ 0x81B4, 0x3AB9, 0x81B5, 0x1884, 0x81B8, 0x1886, 0x81BA, 0x188A,
+ 0x81BD, 0x1887, 0x81BE, 0x1885, 0x81BF, 0x0CF5, 0x81C0, 0x1888,
+ 0x81C2, 0x1889, 0x81C6, 0x0532, 0x81C8, 0x1890, 0x81C9, 0x188B,
+ 0x81CD, 0x188C, 0x81CF, 0x3ABA, 0x81D1, 0x188D, 0x81D3, 0x0B01,
+ 0x81D8, 0x188F, 0x81D9, 0x188E, 0x81DA, 0x1891, 0x81DF, 0x1892,
+ 0x81E0, 0x1893, 0x81E3, 0x0A09, 0x81E5, 0x0569, 0x81E7, 0x1894,
+ 0x81E8, 0x0F9F, 0x81EA, 0x08D7, 0x81ED, 0x0937, 0x81F3, 0x08B8,
+ 0x81F4, 0x0B95, 0x81F9, 0x3ABB, 0x81FA, 0x1895, 0x81FB, 0x1896,
+ 0x81FC, 0x04D3, 0x81FE, 0x1897, 0x8201, 0x1898, 0x8202, 0x1899,
+ 0x8203, 0x3ABC, 0x8205, 0x189A, 0x8207, 0x189B, 0x8208, 0x06B5,
+ 0x8209, 0x13AF, 0x820A, 0x189C, 0x820C, 0x0A89, 0x820D, 0x189D,
+ 0x820E, 0x08F7, 0x8210, 0x189E, 0x8212, 0x1009, 0x8216, 0x189F,
+ 0x8217, 0x0E2E, 0x8218, 0x0618, 0x821B, 0x0AA6, 0x821C, 0x0962,
+ 0x821E, 0x0DE3, 0x821F, 0x0938, 0x8221, 0x3ABD, 0x8229, 0x18A0,
+ 0x822A, 0x07E4, 0x822B, 0x18A1, 0x822C, 0x0D60, 0x822E, 0x18AF,
+ 0x8232, 0x3ABE, 0x8233, 0x18A3, 0x8234, 0x3ABF, 0x8235, 0x0B29,
+ 0x8236, 0x0D2B, 0x8237, 0x0773, 0x8238, 0x18A2, 0x8239, 0x0AA7,
+ 0x8240, 0x18A4, 0x8246, 0x3AC0, 0x8247, 0x0C16, 0x824B, 0x3AC1,
+ 0x824F, 0x3AC2, 0x8258, 0x18A6, 0x8259, 0x18A5, 0x825A, 0x18A8,
+ 0x825D, 0x18A7, 0x825F, 0x18A9, 0x8262, 0x18AB, 0x8264, 0x18AA,
+ 0x8266, 0x060B, 0x8268, 0x18AC, 0x826A, 0x18AD, 0x826B, 0x18AE,
+ 0x826E, 0x0821, 0x826F, 0x0F91, 0x8271, 0x18B0, 0x8272, 0x09ED,
+ 0x8276, 0x0512, 0x8277, 0x18B1, 0x8278, 0x18B2, 0x8279, 0x3775,
+ 0x827E, 0x18B3, 0x828B, 0x04B6, 0x828D, 0x18B4, 0x828E, 0x3AC3,
+ 0x8292, 0x18B5, 0x8299, 0x0DD9, 0x829D, 0x08F3, 0x829F, 0x18B7,
+ 0x82A5, 0x0587, 0x82A6, 0x0476, 0x82AB, 0x18B6, 0x82AC, 0x18B9,
+ 0x82AD, 0x0D04, 0x82AE, 0x3AC4, 0x82AF, 0x0A0A, 0x82B1, 0x0556,
+ 0x82B3, 0x0E55, 0x82B7, 0x3AC5, 0x82B8, 0x0733, 0x82B9, 0x06D4,
+ 0x82BB, 0x18B8, 0x82BD, 0x056A, 0x82BE, 0x3AC6, 0x82C5, 0x05DF,
+ 0x82C6, 0x3AC7, 0x82D1, 0x0513, 0x82D2, 0x18BD, 0x82D3, 0x0FB2,
+ 0x82D4, 0x0B3D, 0x82D7, 0x0DB6, 0x82D9, 0x18C9, 0x82DB, 0x0557,
+ 0x82DC, 0x18C7, 0x82DE, 0x18C5, 0x82DF, 0x18BC, 0x82E1, 0x18BA,
+ 0x82E3, 0x18BB, 0x82E5, 0x090F, 0x82E6, 0x06E4, 0x82E7, 0x0BB5,
+ 0x82EB, 0x0CA9, 0x82F1, 0x04F3, 0x82F3, 0x18BF, 0x82F4, 0x18BE,
+ 0x82F9, 0x18C4, 0x82FA, 0x18C0, 0x82FB, 0x18C3, 0x82FE, 0x3AC8,
+ 0x8301, 0x2198, 0x8302, 0x0EDC, 0x8303, 0x18C2, 0x8304, 0x0558,
+ 0x8305, 0x05DB, 0x8306, 0x18C6, 0x8309, 0x18C8, 0x830E, 0x072A,
+ 0x8316, 0x18CC, 0x8317, 0x18D5, 0x8318, 0x18D6, 0x831C, 0x046F,
+ 0x8323, 0x18DD, 0x8328, 0x04B5, 0x832B, 0x18D4, 0x832F, 0x18D3,
+ 0x8331, 0x18CE, 0x8332, 0x18CD, 0x8334, 0x18CB, 0x8335, 0x18CA,
+ 0x8336, 0x0BA1, 0x8338, 0x0B5B, 0x8339, 0x18D0, 0x8340, 0x18CF,
+ 0x8343, 0x3AC9, 0x8345, 0x18D2, 0x8349, 0x0AF2, 0x834A, 0x072B,
+ 0x834F, 0x04E3, 0x8350, 0x18D1, 0x8351, 0x3ACA, 0x8352, 0x07E5,
+ 0x8355, 0x3ACB, 0x8358, 0x0AF3, 0x8362, 0x2199, 0x8373, 0x18E3,
+ 0x8375, 0x18E4, 0x8377, 0x0559, 0x837B, 0x052E, 0x837C, 0x18E1,
+ 0x837F, 0x219A, 0x8385, 0x18D7, 0x8386, 0x3ACC, 0x8387, 0x18DF,
+ 0x8389, 0x18E6, 0x838A, 0x18E0, 0x838D, 0x3ACD, 0x838E, 0x18DE,
+ 0x8392, 0x3ACE, 0x8393, 0x18C1, 0x8396, 0x18DC, 0x8398, 0x3ACF,
+ 0x839A, 0x18D8, 0x839E, 0x060C, 0x839F, 0x18DA, 0x83A0, 0x18E5,
+ 0x83A2, 0x18DB, 0x83A8, 0x18E7, 0x83A9, 0x3AD0, 0x83AA, 0x18D9,
+ 0x83AB, 0x0D32, 0x83B1, 0x0F53, 0x83B5, 0x18E2, 0x83BD, 0x18F8,
+ 0x83BF, 0x3AD1, 0x83C0, 0x3AD2, 0x83C1, 0x18F0, 0x83C5, 0x0A41,
+ 0x83C7, 0x219B, 0x83CA, 0x0660, 0x83CC, 0x06D5, 0x83CE, 0x18EB,
+ 0x83D3, 0x055B, 0x83D6, 0x09BC, 0x83D8, 0x18EE, 0x83DC, 0x084A,
+ 0x83DF, 0x0C4B, 0x83E0, 0x18F3, 0x83E9, 0x0E3E, 0x83EA, 0x3AD3,
+ 0x83EB, 0x18EA, 0x83EF, 0x055A, 0x83F0, 0x078A, 0x83F1, 0x0D9B,
+ 0x83F2, 0x18F4, 0x83F4, 0x18E8, 0x83F6, 0x219C, 0x83F7, 0x18F1,
+ 0x83FB, 0x18FB, 0x83FD, 0x18EC, 0x8403, 0x18ED, 0x8404, 0x0C92,
+ 0x8407, 0x18F2, 0x840A, 0x1E7F, 0x840B, 0x18EF, 0x840C, 0x0E56,
+ 0x840D, 0x18F5, 0x840E, 0x04A4, 0x840F, 0x3AD4, 0x8411, 0x3AD5,
+ 0x8413, 0x18E9, 0x8420, 0x18F7, 0x8422, 0x18F6, 0x8429, 0x0D21,
+ 0x842A, 0x18FD, 0x842C, 0x1908, 0x8431, 0x05DC, 0x8435, 0x190B,
+ 0x8438, 0x18F9, 0x843C, 0x18FE, 0x843D, 0x0F58, 0x8446, 0x1907,
+ 0x8448, 0x219D, 0x8449, 0x0F3F, 0x844A, 0x3AD6, 0x844E, 0x0F72,
+ 0x8457, 0x0BB6, 0x845B, 0x05C9, 0x8461, 0x0DE4, 0x8462, 0x190D,
+ 0x8463, 0x0C79, 0x8466, 0x0475, 0x8469, 0x1906, 0x846B, 0x1902,
+ 0x846C, 0x0AF4, 0x846D, 0x18FC, 0x846E, 0x1904, 0x846F, 0x1909,
+ 0x8471, 0x0CE2, 0x8475, 0x046E, 0x8476, 0x3AD7, 0x8477, 0x1901,
+ 0x8479, 0x190A, 0x847A, 0x0DEA, 0x8482, 0x1905, 0x8484, 0x1900,
+ 0x848B, 0x09BD, 0x8490, 0x0939, 0x8494, 0x08D8, 0x8499, 0x0EE4,
+ 0x849C, 0x0DB9, 0x849F, 0x1910, 0x84A1, 0x1919, 0x84A8, 0x3AD8,
+ 0x84AD, 0x1903, 0x84AF, 0x3AD9, 0x84B2, 0x05D5, 0x84B4, 0x219E,
+ 0x84B8, 0x09E0, 0x84B9, 0x190E, 0x84BB, 0x1913, 0x84BC, 0x0AF5,
+ 0x84BF, 0x190F, 0x84C0, 0x3ADA, 0x84C1, 0x1916, 0x84C2, 0x3ADB,
+ 0x84C4, 0x0B9D, 0x84C6, 0x1917, 0x84C9, 0x0F40, 0x84CA, 0x190C,
+ 0x84CB, 0x0596, 0x84CD, 0x1912, 0x84D0, 0x1915, 0x84D1, 0x0EB8,
+ 0x84D6, 0x1918, 0x84D9, 0x1911, 0x84DA, 0x1914, 0x84DC, 0x20AB,
+ 0x84EC, 0x0E57, 0x84EE, 0x0FC7, 0x84F0, 0x3ADC, 0x84F4, 0x191C,
+ 0x84FC, 0x1923, 0x84FD, 0x3ADD, 0x84FF, 0x191B, 0x8500, 0x08EF,
+ 0x8506, 0x18FA, 0x850C, 0x3ADE, 0x8511, 0x0E1E, 0x8513, 0x0EAE,
+ 0x8514, 0x1922, 0x8515, 0x1921, 0x8517, 0x191D, 0x8518, 0x191E,
+ 0x851A, 0x04D8, 0x851F, 0x1920, 0x8521, 0x191A, 0x8523, 0x1E1A,
+ 0x8526, 0x0BF1, 0x852C, 0x191F, 0x852D, 0x04C2, 0x8534, 0x3ADF,
+ 0x8535, 0x0B02, 0x853D, 0x0E13, 0x853E, 0x1EB5, 0x8540, 0x1924,
+ 0x8541, 0x1928, 0x8543, 0x0D6D, 0x8548, 0x1927, 0x8549, 0x09BE,
+ 0x854A, 0x08F5, 0x854B, 0x192A, 0x854E, 0x06B6, 0x8553, 0x219F,
+ 0x8555, 0x192B, 0x8557, 0x0DEB, 0x8558, 0x1926, 0x8559, 0x21A0,
+ 0x855A, 0x18FF, 0x855E, 0x3AE0, 0x8563, 0x1925, 0x8568, 0x0FF5,
+ 0x8569, 0x0C7A, 0x856A, 0x0DE5, 0x856B, 0x21A1, 0x856D, 0x1932,
+ 0x8577, 0x1938, 0x857E, 0x1939, 0x8580, 0x192C, 0x8584, 0x0D2C,
+ 0x8587, 0x1936, 0x8588, 0x192E, 0x858A, 0x1930, 0x858F, 0x3AE1,
+ 0x8590, 0x193A, 0x8591, 0x192F, 0x8594, 0x1933, 0x8597, 0x0514,
+ 0x8599, 0x0CBD, 0x859B, 0x1934, 0x859C, 0x1937, 0x85A4, 0x192D,
+ 0x85A6, 0x0AA8, 0x85A8, 0x1931, 0x85A9, 0x0875, 0x85AA, 0x0A0B,
+ 0x85AB, 0x0706, 0x85AC, 0x0F00, 0x85AD, 0x3AE4, 0x85AE, 0x0F05,
+ 0x85AF, 0x097C, 0x85B0, 0x21A3, 0x85B7, 0x3AE2, 0x85B9, 0x193E,
+ 0x85BA, 0x193C, 0x85C1, 0x0FF4, 0x85C9, 0x193B, 0x85CD, 0x0F5F,
+ 0x85CE, 0x3AE3, 0x85CF, 0x193D, 0x85D0, 0x193F, 0x85D5, 0x1940,
+ 0x85DC, 0x1943, 0x85DD, 0x1941, 0x85E4, 0x0C7B, 0x85E5, 0x1942,
+ 0x85E9, 0x0D61, 0x85EA, 0x1935, 0x85F4, 0x3780, 0x85F7, 0x097D,
+ 0x85F9, 0x1944, 0x85FA, 0x1949, 0x85FB, 0x0AF6, 0x85FE, 0x1948,
+ 0x8602, 0x1929, 0x8606, 0x194A, 0x8607, 0x0ACB, 0x860A, 0x1945,
+ 0x860B, 0x1947, 0x8612, 0x3AE5, 0x8613, 0x1946, 0x8616, 0x14D0,
+ 0x8617, 0x14C1, 0x861A, 0x194C, 0x8622, 0x194B, 0x8629, 0x3AE6,
+ 0x862D, 0x0F60, 0x862F, 0x16B1, 0x8630, 0x194D, 0x863F, 0x194E,
+ 0x864D, 0x194F, 0x864E, 0x078B, 0x8650, 0x066E, 0x8652, 0x3AE7,
+ 0x8654, 0x1951, 0x8655, 0x1094, 0x865A, 0x068F, 0x865B, 0x3418,
+ 0x865C, 0x0F82, 0x865E, 0x06EB, 0x865F, 0x1952, 0x8663, 0x3AE8,
+ 0x8667, 0x1953, 0x866B, 0x0BAC, 0x866C, 0x3AE9, 0x866F, 0x3AEA,
+ 0x8671, 0x1954, 0x8679, 0x0CD2, 0x867A, 0x3AEB, 0x867B, 0x047E,
+ 0x867D, 0x3786, 0x868A, 0x0563, 0x868B, 0x1959, 0x868C, 0x195A,
+ 0x868D, 0x3AEC, 0x8691, 0x3AED, 0x8693, 0x1955, 0x8695, 0x088B,
+ 0x8698, 0x3AEE, 0x86A3, 0x1956, 0x86A4, 0x0CF8, 0x86A7, 0x3AEF,
+ 0x86A8, 0x3AF0, 0x86A9, 0x1957, 0x86AA, 0x1958, 0x86AB, 0x1962,
+ 0x86AF, 0x195C, 0x86B0, 0x195F, 0x86B6, 0x195B, 0x86C4, 0x195D,
+ 0x86C6, 0x195E, 0x86C7, 0x0904, 0x86C9, 0x1960, 0x86CB, 0x0B7F,
+ 0x86CD, 0x072C, 0x86CE, 0x05A0, 0x86D4, 0x1963, 0x86D9, 0x059D,
+ 0x86DB, 0x1968, 0x86DE, 0x1964, 0x86DF, 0x1967, 0x86E4, 0x0D4E,
+ 0x86E9, 0x1965, 0x86EC, 0x1966, 0x86ED, 0x0DBA, 0x86EE, 0x0D6E,
+ 0x86EF, 0x1969, 0x86F8, 0x0B5D, 0x86F9, 0x1973, 0x86FA, 0x3AF1,
+ 0x86FB, 0x196F, 0x86FD, 0x3AF2, 0x86FE, 0x056B, 0x8700, 0x196D,
+ 0x8702, 0x0E58, 0x8703, 0x196E, 0x8706, 0x196B, 0x8708, 0x196C,
+ 0x8709, 0x1971, 0x870A, 0x1974, 0x870B, 0x3AF3, 0x870D, 0x1972,
+ 0x8711, 0x1970, 0x8712, 0x196A, 0x8713, 0x3AF4, 0x8718, 0x0B96,
+ 0x8719, 0x3AF5, 0x871A, 0x197B, 0x871C, 0x0EB6, 0x871E, 0x3AF6,
+ 0x8725, 0x1979, 0x8728, 0x3AF7, 0x8729, 0x197A, 0x8734, 0x1975,
+ 0x8737, 0x1977, 0x873B, 0x1978, 0x873E, 0x3AF8, 0x873F, 0x1976,
+ 0x8749, 0x0A8A, 0x874B, 0x0FDF, 0x874C, 0x197F, 0x874E, 0x1980,
+ 0x8753, 0x1986, 0x8755, 0x09F0, 0x8757, 0x1982, 0x8759, 0x1985,
+ 0x875F, 0x197D, 0x8760, 0x197C, 0x8763, 0x1987, 0x8766, 0x055C,
+ 0x8768, 0x1983, 0x876A, 0x1988, 0x876E, 0x1984, 0x8771, 0x3AF9,
+ 0x8774, 0x1981, 0x8776, 0x0BCF, 0x8778, 0x197E, 0x877F, 0x0D1E,
+ 0x8782, 0x198C, 0x8788, 0x3AFA, 0x878D, 0x0F25, 0x8799, 0x3AFB,
+ 0x879F, 0x198B, 0x87A2, 0x198A, 0x87AB, 0x1993, 0x87AC, 0x3AFC,
+ 0x87AD, 0x3AFD, 0x87AF, 0x198D, 0x87B3, 0x1995, 0x87B5, 0x3AFE,
+ 0x87BA, 0x0F50, 0x87BB, 0x1998, 0x87BD, 0x198F, 0x87C0, 0x1990,
+ 0x87C4, 0x1994, 0x87C6, 0x1997, 0x87C7, 0x1996, 0x87CB, 0x198E,
+ 0x87D0, 0x1991, 0x87D2, 0x19A2, 0x87D6, 0x3AFF, 0x87E0, 0x199B,
+ 0x87EB, 0x3B00, 0x87EC, 0x1E23, 0x87ED, 0x3B01, 0x87EF, 0x1999,
+ 0x87F2, 0x199A, 0x87F5, 0x3C3D, 0x87F6, 0x199F, 0x87F7, 0x19A0,
+ 0x87F9, 0x0588, 0x87FB, 0x065C, 0x87FE, 0x199E, 0x8801, 0x3B02,
+ 0x8803, 0x3B03, 0x8805, 0x1989, 0x8806, 0x3B04, 0x8807, 0x21A6,
+ 0x880B, 0x3B05, 0x880D, 0x199D, 0x880E, 0x19A1, 0x880F, 0x199C,
+ 0x8811, 0x19A3, 0x8814, 0x3B06, 0x8815, 0x19A5, 0x8816, 0x19A4,
+ 0x881C, 0x3B07, 0x881F, 0x1E85, 0x8821, 0x19A7, 0x8822, 0x19A6,
+ 0x8823, 0x1961, 0x8827, 0x19AB, 0x8831, 0x19A8, 0x8836, 0x19A9,
+ 0x8839, 0x19AA, 0x883B, 0x19AC, 0x8840, 0x0742, 0x8842, 0x19AE,
+ 0x8844, 0x19AD, 0x8846, 0x093A, 0x884C, 0x07E6, 0x884D, 0x1524,
+ 0x8852, 0x19AF, 0x8853, 0x095B, 0x8856, 0x3B08, 0x8857, 0x0597,
+ 0x8859, 0x19B0, 0x885B, 0x04F4, 0x885D, 0x09BF, 0x885E, 0x19B1,
+ 0x885F, 0x3B09, 0x8861, 0x07E7, 0x8862, 0x19B2, 0x8863, 0x04A5,
+ 0x8864, 0x3B0A, 0x8868, 0x0DAF, 0x886B, 0x19B3, 0x8870, 0x0A30,
+ 0x8872, 0x19BA, 0x8875, 0x19B7, 0x8877, 0x0BAD, 0x887D, 0x19B8,
+ 0x887E, 0x19B5, 0x887F, 0x06D6, 0x8881, 0x19B4, 0x8882, 0x19BB,
+ 0x8888, 0x070C, 0x888B, 0x0B3E, 0x888D, 0x19C1, 0x8892, 0x19BD,
+ 0x8896, 0x0B15, 0x8897, 0x19BC, 0x8898, 0x3B0B, 0x8899, 0x19BF,
+ 0x889E, 0x19B6, 0x88A2, 0x19C0, 0x88A4, 0x19C2, 0x88AA, 0x3B0C,
+ 0x88AB, 0x0D83, 0x88AE, 0x19BE, 0x88B0, 0x19C3, 0x88B1, 0x19C5,
+ 0x88B4, 0x0787, 0x88B5, 0x19B9, 0x88B7, 0x0485, 0x88BD, 0x3B0D,
+ 0x88BE, 0x3B0E, 0x88BF, 0x19C4, 0x88C1, 0x084B, 0x88C2, 0x0FBE,
+ 0x88C3, 0x19C6, 0x88C4, 0x19C7, 0x88C5, 0x0AF7, 0x88C6, 0x3789,
+ 0x88CA, 0x3B0F, 0x88CF, 0x0F6A, 0x88D2, 0x3B10, 0x88D4, 0x19C8,
+ 0x88D5, 0x0F1F, 0x88D8, 0x19C9, 0x88D9, 0x19CA, 0x88DB, 0x3B11,
+ 0x88DC, 0x0E34, 0x88DD, 0x19CB, 0x88DF, 0x0830, 0x88E1, 0x0F6B,
+ 0x88E8, 0x19D0, 0x88F0, 0x3B12, 0x88F1, 0x3B13, 0x88F2, 0x19D1,
+ 0x88F3, 0x09C0, 0x88F4, 0x19CF, 0x88F5, 0x21A7, 0x88F8, 0x0F51,
+ 0x88F9, 0x19CC, 0x88FC, 0x19CE, 0x88FD, 0x0A61, 0x88FE, 0x0A44,
+ 0x8902, 0x19CD, 0x8904, 0x19D2, 0x8906, 0x3B14, 0x8907, 0x0DF3,
+ 0x890A, 0x19D4, 0x890C, 0x19D3, 0x8910, 0x05CA, 0x8912, 0x0E59,
+ 0x8913, 0x19D5, 0x8918, 0x3B15, 0x8919, 0x3B16, 0x891A, 0x3B17,
+ 0x891C, 0x20A8, 0x891D, 0x19E1, 0x891E, 0x19D7, 0x8925, 0x19D8,
+ 0x8927, 0x3B18, 0x892A, 0x19D9, 0x892B, 0x19DA, 0x8930, 0x3B19,
+ 0x8936, 0x19DE, 0x8938, 0x19DF, 0x893B, 0x19DD, 0x893E, 0x3B1A,
+ 0x8941, 0x19DB, 0x8943, 0x19D6, 0x8944, 0x19DC, 0x894C, 0x19E0,
+ 0x894D, 0x1BD0, 0x8956, 0x0528, 0x895E, 0x19E3, 0x895F, 0x06D7,
+ 0x8960, 0x19E2, 0x8964, 0x19E5, 0x8966, 0x19E4, 0x896A, 0x19E7,
+ 0x896D, 0x19E6, 0x896F, 0x19E8, 0x8972, 0x093B, 0x8974, 0x19E9,
+ 0x8977, 0x19EA, 0x897B, 0x3B1B, 0x897E, 0x19EB, 0x897F, 0x0A62,
+ 0x8980, 0x362E, 0x8981, 0x0F41, 0x8983, 0x19EC, 0x8986, 0x0DF4,
+ 0x8987, 0x0CFC, 0x8988, 0x19ED, 0x898A, 0x19EE, 0x898B, 0x075F,
+ 0x898F, 0x0646, 0x8993, 0x19EF, 0x8996, 0x08B9, 0x8997, 0x0CF7,
+ 0x8998, 0x19F0, 0x899A, 0x05AE, 0x89A1, 0x19F1, 0x89A6, 0x19F3,
+ 0x89A7, 0x0F61, 0x89A9, 0x19F2, 0x89AA, 0x0A0C, 0x89AC, 0x19F4,
+ 0x89AF, 0x19F5, 0x89B2, 0x19F6, 0x89B3, 0x060D, 0x89BA, 0x19F7,
+ 0x89BD, 0x19F8, 0x89BF, 0x19F9, 0x89C0, 0x19FA, 0x89D2, 0x05AF,
+ 0x89D4, 0x3B1C, 0x89D6, 0x3B1D, 0x89DA, 0x19FB, 0x89DC, 0x19FC,
+ 0x89DD, 0x19FD, 0x89E3, 0x0572, 0x89E5, 0x3B1E, 0x89E6, 0x09EE,
+ 0x89E7, 0x19FE, 0x89F1, 0x3B1F, 0x89F4, 0x19FF, 0x89F8, 0x1A00,
+ 0x8A00, 0x0774, 0x8A01, 0x35BC, 0x8A02, 0x0C17, 0x8A03, 0x1A01,
+ 0x8A07, 0x3B20, 0x8A08, 0x072D, 0x8A0A, 0x0A1C, 0x8A0C, 0x1A04,
+ 0x8A0E, 0x0C7C, 0x8A0F, 0x3B21, 0x8A10, 0x1A03, 0x8A12, 0x21A8,
+ 0x8A13, 0x0707, 0x8A15, 0x3B22, 0x8A16, 0x1A02, 0x8A17, 0x0B57,
+ 0x8A18, 0x0647, 0x8A1B, 0x1A05, 0x8A1D, 0x1A06, 0x8A1F, 0x09C1,
+ 0x8A22, 0x3B23, 0x8A23, 0x0743, 0x8A25, 0x1A07, 0x8A2A, 0x0E5A,
+ 0x8A2D, 0x0A83, 0x8A31, 0x0690, 0x8A33, 0x0F01, 0x8A34, 0x0ACC,
+ 0x8A36, 0x1A08, 0x8A37, 0x21A9, 0x8A3A, 0x0A0D, 0x8A3B, 0x0BAE,
+ 0x8A3C, 0x09C2, 0x8A41, 0x1A09, 0x8A46, 0x1A0C, 0x8A48, 0x1A0D,
+ 0x8A4E, 0x3B24, 0x8A50, 0x082E, 0x8A51, 0x0B22, 0x8A52, 0x1A0B,
+ 0x8A54, 0x09C3, 0x8A55, 0x0DB0, 0x8A5B, 0x1A0A, 0x8A5E, 0x08BA,
+ 0x8A60, 0x04F5, 0x8A62, 0x1A11, 0x8A63, 0x072E, 0x8A66, 0x08BC,
+ 0x8A69, 0x08BB, 0x8A6B, 0x0FF3, 0x8A6C, 0x1A10, 0x8A6D, 0x1A0F,
+ 0x8A6E, 0x0AA9, 0x8A70, 0x0667, 0x8A71, 0x0FE9, 0x8A72, 0x0598,
+ 0x8A73, 0x09C4, 0x8A79, 0x21AA, 0x8A7C, 0x1A0E, 0x8A7F, 0x3B25,
+ 0x8A82, 0x1A13, 0x8A84, 0x1A14, 0x8A85, 0x1A12, 0x8A87, 0x078C,
+ 0x8A89, 0x0F2A, 0x8A8C, 0x08BD, 0x8A8D, 0x0CDD, 0x8A91, 0x1A17,
+ 0x8A93, 0x0A64, 0x8A95, 0x0B80, 0x8A98, 0x0F20, 0x8A9A, 0x1A1A,
+ 0x8A9E, 0x07A0, 0x8AA0, 0x0A63, 0x8AA1, 0x1A16, 0x8AA3, 0x1A1B,
+ 0x8AA4, 0x07A1, 0x8AA5, 0x1A18, 0x8AA6, 0x1A19, 0x8AA7, 0x21AB,
+ 0x8AA8, 0x1A15, 0x8AAA, 0x3638, 0x8AAC, 0x0A86, 0x8AAD, 0x0CA1,
+ 0x8AB0, 0x0B6D, 0x8AB2, 0x055D, 0x8AB9, 0x0D84, 0x8ABC, 0x065D,
+ 0x8ABE, 0x21AC, 0x8ABF, 0x0BD0, 0x8AC2, 0x1A1E, 0x8AC4, 0x1A1C,
+ 0x8AC7, 0x0B8A, 0x8ACB, 0x0A65, 0x8ACC, 0x060E, 0x8ACD, 0x1A1D,
+ 0x8ACF, 0x0A21, 0x8AD2, 0x0F92, 0x8AD6, 0x0FE6, 0x8ADA, 0x1A1F,
+ 0x8ADB, 0x1A2A, 0x8ADC, 0x0BD1, 0x8ADE, 0x1A29, 0x8ADF, 0x21AD,
+ 0x8AE0, 0x1A26, 0x8AE1, 0x1A2E, 0x8AE2, 0x1A27, 0x8AE4, 0x1A23,
+ 0x8AE6, 0x0C18, 0x8AE7, 0x1A22, 0x8AEB, 0x1A20, 0x8AED, 0x0F0B,
+ 0x8AEE, 0x08BE, 0x8AF1, 0x1A24, 0x8AF3, 0x1A21, 0x8AF4, 0x3B26,
+ 0x8AF6, 0x21AF, 0x8AF7, 0x1A28, 0x8AF8, 0x097E, 0x8AFA, 0x0775,
+ 0x8AFE, 0x0B5A, 0x8B00, 0x0E73, 0x8B01, 0x04FC, 0x8B02, 0x04A6,
+ 0x8B04, 0x0C7D, 0x8B07, 0x1A2C, 0x8B0C, 0x1A2B, 0x8B0E, 0x0CBE,
+ 0x8B10, 0x1A30, 0x8B14, 0x1A25, 0x8B16, 0x1A2F, 0x8B17, 0x1A31,
+ 0x8B19, 0x0760, 0x8B1A, 0x1A2D, 0x8B1B, 0x07E8, 0x8B1D, 0x0901,
+ 0x8B1F, 0x3B27, 0x8B20, 0x1A32, 0x8B21, 0x0F42, 0x8B26, 0x1A35,
+ 0x8B28, 0x1A38, 0x8B2B, 0x1A36, 0x8B2C, 0x0DA7, 0x8B33, 0x1A33,
+ 0x8B37, 0x3B28, 0x8B39, 0x06D8, 0x8B3E, 0x1A37, 0x8B41, 0x1A39,
+ 0x8B43, 0x3B29, 0x8B44, 0x3B2A, 0x8B49, 0x1A3D, 0x8B4C, 0x1A3A,
+ 0x8B4E, 0x1A3C, 0x8B4F, 0x1A3B, 0x8B53, 0x21B0, 0x8B54, 0x3B2B,
+ 0x8B56, 0x1A3E, 0x8B58, 0x08DD, 0x8B5A, 0x1A40, 0x8B5B, 0x1A3F,
+ 0x8B5C, 0x0DDA, 0x8B5F, 0x1A42, 0x8B66, 0x072F, 0x8B6B, 0x1A41,
+ 0x8B6C, 0x1A43, 0x8B6F, 0x1A44, 0x8B70, 0x065E, 0x8B71, 0x182E,
+ 0x8B72, 0x09E1, 0x8B74, 0x1A45, 0x8B77, 0x07A2, 0x8B7D, 0x1A46,
+ 0x8B7F, 0x21B1, 0x8B80, 0x1A47, 0x8B83, 0x088C, 0x8B8A, 0x13D3,
+ 0x8B8C, 0x1A48, 0x8B8E, 0x1A49, 0x8B90, 0x093C, 0x8B92, 0x1A4A,
+ 0x8B93, 0x1A4B, 0x8B96, 0x1A4C, 0x8B99, 0x1A4D, 0x8B9A, 0x1A4E,
+ 0x8B9C, 0x3B2C, 0x8B9E, 0x3B2D, 0x8C37, 0x0B69, 0x8C3A, 0x1A4F,
+ 0x8C3F, 0x1A51, 0x8C41, 0x1A50, 0x8C46, 0x0C7E, 0x8C47, 0x3B2E,
+ 0x8C48, 0x1A52, 0x8C4A, 0x0E5B, 0x8C4C, 0x1A53, 0x8C4E, 0x1A54,
+ 0x8C50, 0x1A55, 0x8C54, 0x3B2F, 0x8C55, 0x1A56, 0x8C5A, 0x0CB2,
+ 0x8C61, 0x09C5, 0x8C62, 0x1A57, 0x8C6A, 0x07FD, 0x8C6B, 0x1007,
+ 0x8C6C, 0x1A58, 0x8C73, 0x3B30, 0x8C78, 0x1A59, 0x8C79, 0x0DB1,
+ 0x8C7A, 0x1A5A, 0x8C7C, 0x1A62, 0x8C82, 0x1A5B, 0x8C85, 0x1A5D,
+ 0x8C89, 0x1A5C, 0x8C8A, 0x1A5E, 0x8C8C, 0x0E74, 0x8C8D, 0x1A5F,
+ 0x8C8E, 0x1A60, 0x8C94, 0x1A61, 0x8C98, 0x1A63, 0x8C9D, 0x058B,
+ 0x8C9E, 0x0C03, 0x8CA0, 0x0DDB, 0x8CA1, 0x0852, 0x8CA2, 0x07E9,
+ 0x8CA4, 0x3B31, 0x8CA7, 0x0DC1, 0x8CA8, 0x055F, 0x8CA9, 0x0D62,
+ 0x8CAA, 0x1A66, 0x8CAB, 0x060F, 0x8CAC, 0x0A79, 0x8CAD, 0x1A65,
+ 0x8CAE, 0x1A6A, 0x8CAF, 0x0BB7, 0x8CB0, 0x0EEF, 0x8CB2, 0x1A68,
+ 0x8CB3, 0x1A69, 0x8CB4, 0x0648, 0x8CB6, 0x1A6B, 0x8CB7, 0x0D19,
+ 0x8CB8, 0x0B3F, 0x8CBB, 0x0D85, 0x8CBC, 0x0C37, 0x8CBD, 0x1A67,
+ 0x8CBF, 0x0E75, 0x8CC0, 0x056C, 0x8CC1, 0x1A6D, 0x8CC2, 0x0FCE,
+ 0x8CC3, 0x0BDE, 0x8CC4, 0x0FEB, 0x8CC7, 0x08BF, 0x8CC8, 0x1A6C,
+ 0x8CCA, 0x0B11, 0x8CCD, 0x1A7D, 0x8CCE, 0x0AAA, 0x8CD1, 0x0CD0,
+ 0x8CD3, 0x0DC2, 0x8CD9, 0x3B32, 0x8CDA, 0x1A70, 0x8CDB, 0x088D,
+ 0x8CDC, 0x08C0, 0x8CDE, 0x09C6, 0x8CE0, 0x0D1B, 0x8CE1, 0x3B33,
+ 0x8CE2, 0x0761, 0x8CE3, 0x1A6F, 0x8CE4, 0x1A6E, 0x8CE6, 0x0DDC,
+ 0x8CEA, 0x08ED, 0x8CED, 0x0C4C, 0x8CF0, 0x21B2, 0x8CF4, 0x21B3,
+ 0x8CF8, 0x3B34, 0x8CFA, 0x1A72, 0x8CFB, 0x1A73, 0x8CFC, 0x07EA,
+ 0x8CFD, 0x1A71, 0x8CFE, 0x3B35, 0x8D04, 0x1A74, 0x8D05, 0x1A75,
+ 0x8D07, 0x1A77, 0x8D08, 0x0B03, 0x8D0A, 0x1A76, 0x8D0B, 0x0622,
+ 0x8D0D, 0x1A79, 0x8D0F, 0x1A78, 0x8D10, 0x1A7A, 0x8D12, 0x21B4,
+ 0x8D13, 0x1A7C, 0x8D14, 0x1A7E, 0x8D16, 0x1A7F, 0x8D1B, 0x3B36,
+ 0x8D64, 0x0A7A, 0x8D66, 0x08FB, 0x8D67, 0x1A80, 0x8D69, 0x3B37,
+ 0x8D6B, 0x05B0, 0x8D6C, 0x3B38, 0x8D6D, 0x1A81, 0x8D70, 0x0AF8,
+ 0x8D71, 0x1A82, 0x8D73, 0x1A83, 0x8D74, 0x0DDD, 0x8D76, 0x21B5,
+ 0x8D77, 0x0649, 0x8D81, 0x1A84, 0x8D84, 0x3B39, 0x8D85, 0x0BD2,
+ 0x8D8A, 0x04FD, 0x8D8D, 0x3B3A, 0x8D95, 0x3B3B, 0x8D99, 0x1A85,
+ 0x8DA3, 0x091D, 0x8DA6, 0x3B3C, 0x8DA8, 0x0A3C, 0x8DB3, 0x0B0D,
+ 0x8DBA, 0x1A88, 0x8DBE, 0x1A87, 0x8DC2, 0x1A86, 0x8DC6, 0x3B3D,
+ 0x8DCB, 0x1A8E, 0x8DCC, 0x1A8C, 0x8DCE, 0x3B3E, 0x8DCF, 0x1A89,
+ 0x8DD6, 0x1A8B, 0x8DDA, 0x1A8A, 0x8DDB, 0x1A8D, 0x8DDD, 0x0691,
+ 0x8DDF, 0x1A91, 0x8DE1, 0x0A7B, 0x8DE3, 0x1A92, 0x8DE4, 0x3B3F,
+ 0x8DE8, 0x078D, 0x8DEA, 0x1A8F, 0x8DEB, 0x1A90, 0x8DEC, 0x3B40,
+ 0x8DEF, 0x0FCF, 0x8DF3, 0x0BD3, 0x8DF5, 0x0AAB, 0x8DFC, 0x1A93,
+ 0x8DFF, 0x1A96, 0x8E08, 0x1A94, 0x8E09, 0x1A95, 0x8E0A, 0x0F43,
+ 0x8E0F, 0x0C7F, 0x8E10, 0x1A99, 0x8E1D, 0x1A97, 0x8E1E, 0x1A98,
+ 0x8E1F, 0x1A9A, 0x8E20, 0x3B41, 0x8E2A, 0x1AA8, 0x8E30, 0x1A9D,
+ 0x8E34, 0x1A9E, 0x8E35, 0x1A9C, 0x8E42, 0x1A9B, 0x8E44, 0x0C19,
+ 0x8E47, 0x1AA0, 0x8E48, 0x1AA4, 0x8E49, 0x1AA1, 0x8E4A, 0x1A9F,
+ 0x8E4B, 0x3B42, 0x8E4C, 0x1AA2, 0x8E50, 0x1AA3, 0x8E55, 0x1AAA,
+ 0x8E59, 0x1AA5, 0x8E5F, 0x0A7C, 0x8E60, 0x1AA7, 0x8E63, 0x1AA9,
+ 0x8E64, 0x1AA6, 0x8E6C, 0x3B43, 0x8E70, 0x3B44, 0x8E72, 0x1AAC,
+ 0x8E74, 0x093D, 0x8E76, 0x1AAB, 0x8E7A, 0x3B45, 0x8E7C, 0x1AAD,
+ 0x8E81, 0x1AAE, 0x8E84, 0x1AB1, 0x8E85, 0x1AB0, 0x8E87, 0x1AAF,
+ 0x8E8A, 0x1AB3, 0x8E8B, 0x1AB2, 0x8E8D, 0x0F02, 0x8E91, 0x1AB5,
+ 0x8E92, 0x3B46, 0x8E93, 0x1AB4, 0x8E94, 0x1AB6, 0x8E99, 0x1AB7,
+ 0x8EA1, 0x1AB9, 0x8EAA, 0x1AB8, 0x8EAB, 0x0A0E, 0x8EAC, 0x1ABA,
+ 0x8EAE, 0x3B47, 0x8EAF, 0x06E5, 0x8EB0, 0x1ABB, 0x8EB1, 0x1ABD,
+ 0x8EB3, 0x3B48, 0x8EB6, 0x3703, 0x8EBE, 0x1ABE, 0x8EC0, 0x1DEF,
+ 0x8EC5, 0x1ABF, 0x8EC6, 0x1ABC, 0x8EC8, 0x1AC0, 0x8ECA, 0x0902,
+ 0x8ECB, 0x1AC1, 0x8ECC, 0x064A, 0x8ECD, 0x0709, 0x8ECF, 0x21B7,
+ 0x8ED1, 0x3B49, 0x8ED2, 0x0762, 0x8ED4, 0x3B4A, 0x8EDB, 0x1AC2,
+ 0x8EDF, 0x0CC8, 0x8EE2, 0x0C38, 0x8EE3, 0x1AC3, 0x8EEB, 0x1AC6,
+ 0x8EF8, 0x08E0, 0x8EF9, 0x3B4B, 0x8EFB, 0x1AC5, 0x8EFC, 0x1AC4,
+ 0x8EFD, 0x0730, 0x8EFE, 0x1AC7, 0x8F03, 0x05B1, 0x8F05, 0x1AC9,
+ 0x8F09, 0x084C, 0x8F0A, 0x1AC8, 0x8F0C, 0x1AD1, 0x8F12, 0x1ACB,
+ 0x8F13, 0x1ACD, 0x8F14, 0x0E35, 0x8F15, 0x1ACA, 0x8F17, 0x3B4C,
+ 0x8F19, 0x1ACC, 0x8F1B, 0x1AD0, 0x8F1C, 0x1ACE, 0x8F1D, 0x064B,
+ 0x8F1F, 0x1ACF, 0x8F26, 0x1AD2, 0x8F29, 0x0D10, 0x8F2A, 0x0FA0,
+ 0x8F2F, 0x093E, 0x8F33, 0x1AD3, 0x8F36, 0x3B4D, 0x8F38, 0x0F0C,
+ 0x8F39, 0x1AD5, 0x8F3B, 0x1AD4, 0x8F3E, 0x1AD8, 0x8F3F, 0x0F2B,
+ 0x8F42, 0x1AD7, 0x8F44, 0x05CB, 0x8F45, 0x1AD6, 0x8F46, 0x1ADB,
+ 0x8F49, 0x1ADA, 0x8F4C, 0x1AD9, 0x8F4D, 0x0C2C, 0x8F4E, 0x1ADC,
+ 0x8F57, 0x1ADD, 0x8F5C, 0x1ADE, 0x8F5F, 0x07FE, 0x8F61, 0x06FB,
+ 0x8F62, 0x1ADF, 0x8F63, 0x1AE0, 0x8F64, 0x1AE1, 0x8F9B, 0x0A0F,
+ 0x8F9C, 0x1AE2, 0x8F9E, 0x08D9, 0x8F9F, 0x1AE3, 0x8FA3, 0x1AE4,
+ 0x8FA6, 0x3B4E, 0x8FA7, 0x10B6, 0x8FA8, 0x10B5, 0x8FAD, 0x1AE5,
+ 0x8FAE, 0x17FF, 0x8FAF, 0x1AE6, 0x8FB0, 0x0B62, 0x8FB1, 0x09F1,
+ 0x8FB2, 0x0CF6, 0x8FB5, 0x3B4F, 0x8FB6, 0x3B50, 0x8FB7, 0x1AE7,
+ 0x8FBA, 0x0E25, 0x8FBB, 0x0BF0, 0x8FBC, 0x0810, 0x8FBF, 0x0B67,
+ 0x8FC2, 0x04CC, 0x8FC4, 0x0EA6, 0x8FC5, 0x0A1D, 0x8FC6, 0x3B51,
+ 0x8FC8, 0x3799, 0x8FCE, 0x0734, 0x8FD1, 0x06D9, 0x8FD4, 0x0E26,
+ 0x8FDA, 0x1AE8, 0x8FE0, 0x3B52, 0x8FE2, 0x1AEA, 0x8FE4, 0x3B53,
+ 0x8FE5, 0x1AE9, 0x8FE6, 0x0560, 0x8FE9, 0x0CCE, 0x8FEA, 0x1AEB,
+ 0x8FEB, 0x0D2D, 0x8FED, 0x0C2D, 0x8FEF, 0x1AEC, 0x8FF0, 0x095C,
+ 0x8FF4, 0x1AEE, 0x8FF6, 0x3B54, 0x8FF7, 0x0ECE, 0x8FF8, 0x1AFD,
+ 0x8FF9, 0x1AF0, 0x8FFA, 0x1AF1, 0x8FFD, 0x0BE5, 0x9000, 0x0B40,
+ 0x9001, 0x0AF9, 0x9002, 0x3B55, 0x9003, 0x0C80, 0x9005, 0x1AEF,
+ 0x9006, 0x066F, 0x900B, 0x1AF8, 0x900D, 0x1AF5, 0x900E, 0x1B02,
+ 0x900F, 0x0C81, 0x9010, 0x0B9E, 0x9011, 0x1AF2, 0x9013, 0x0C1A,
+ 0x9014, 0x0C4D, 0x9015, 0x1AF3, 0x9016, 0x1AF7, 0x9017, 0x0A26,
+ 0x9019, 0x0D1D, 0x901A, 0x0BE8, 0x901D, 0x0A66, 0x901E, 0x1AF6,
+ 0x901F, 0x0B0E, 0x9020, 0x0B04, 0x9021, 0x1AF4, 0x9022, 0x046D,
+ 0x9023, 0x0FC8, 0x9027, 0x1AF9, 0x902C, 0x3B56, 0x902E, 0x0B41,
+ 0x9031, 0x093F, 0x9032, 0x0A10, 0x9035, 0x1AFB, 0x9036, 0x1AFA,
+ 0x9038, 0x04B3, 0x9039, 0x1AFC, 0x903C, 0x0DA1, 0x903E, 0x1B04,
+ 0x9041, 0x0CB3, 0x9042, 0x0A31, 0x9044, 0x3B57, 0x9045, 0x0B97,
+ 0x9047, 0x06F0, 0x9049, 0x1B03, 0x904A, 0x0F21, 0x904B, 0x04E1,
+ 0x904D, 0x0E27, 0x904E, 0x0561, 0x904F, 0x1AFE, 0x9050, 0x1AFF,
+ 0x9051, 0x1B00, 0x9052, 0x1B01, 0x9053, 0x0C93, 0x9054, 0x0B61,
+ 0x9055, 0x04A7, 0x9056, 0x1B05, 0x9058, 0x1B06, 0x9059, 0x1D34,
+ 0x905C, 0x0B1D, 0x905E, 0x1B07, 0x9060, 0x0515, 0x9061, 0x0ACE,
+ 0x9063, 0x0763, 0x9065, 0x0F44, 0x9067, 0x21BA, 0x9068, 0x1B08,
+ 0x9069, 0x0C26, 0x906D, 0x0AFA, 0x906E, 0x0903, 0x906F, 0x1B09,
+ 0x9072, 0x1B0C, 0x9075, 0x096F, 0x9076, 0x1B0A, 0x9077, 0x0AAD,
+ 0x9078, 0x0AAC, 0x907A, 0x04A8, 0x907C, 0x0F93, 0x907D, 0x1B0E,
+ 0x907F, 0x0D86, 0x9080, 0x1B10, 0x9081, 0x1B0F, 0x9082, 0x1B0D,
+ 0x9083, 0x1737, 0x9084, 0x0610, 0x9087, 0x1AED, 0x9088, 0x3B58,
+ 0x9089, 0x1B12, 0x908A, 0x1B11, 0x908F, 0x1B13, 0x9091, 0x0F22,
+ 0x9095, 0x3B59, 0x9099, 0x3B5A, 0x909B, 0x3B5B, 0x90A2, 0x3B5C,
+ 0x90A3, 0x0CB9, 0x90A6, 0x0E5C, 0x90A8, 0x1B14, 0x90AA, 0x0905,
+ 0x90AF, 0x1B15, 0x90B1, 0x1B16, 0x90B4, 0x3B5D, 0x90B5, 0x1B17,
+ 0x90B8, 0x0C1B, 0x90C1, 0x04AE, 0x90CA, 0x07EB, 0x90CE, 0x0FE0,
+ 0x90D7, 0x3B5E, 0x90DB, 0x1B1B, 0x90DD, 0x3B5F, 0x90DE, 0x21BB,
+ 0x90E1, 0x070A, 0x90E2, 0x1B18, 0x90E4, 0x1B19, 0x90E8, 0x0DE6,
+ 0x90ED, 0x05B2, 0x90F4, 0x3B60, 0x90F5, 0x0F23, 0x90F7, 0x06B7,
+ 0x90FD, 0x0C4E, 0x9102, 0x1B1C, 0x9112, 0x1B1D, 0x9115, 0x21BD,
+ 0x9117, 0x3B61, 0x9119, 0x1B1E, 0x911C, 0x3B62, 0x9127, 0x21BE,
+ 0x912D, 0x0C1C, 0x9130, 0x1B20, 0x9131, 0x3B63, 0x9132, 0x1B1F,
+ 0x913A, 0x3B64, 0x913D, 0x3B65, 0x9148, 0x3B66, 0x9149, 0x0CAB,
+ 0x914A, 0x1B21, 0x914B, 0x0940, 0x914C, 0x090C, 0x914D, 0x0D11,
+ 0x914E, 0x0BAF, 0x9152, 0x091E, 0x9154, 0x0A32, 0x9156, 0x1B22,
+ 0x9158, 0x1B23, 0x915B, 0x3B67, 0x9161, 0x3B68, 0x9162, 0x0A23,
+ 0x9163, 0x1B24, 0x9164, 0x3B69, 0x9165, 0x1B25, 0x9169, 0x1B26,
+ 0x916A, 0x0F59, 0x916C, 0x0941, 0x9172, 0x1B28, 0x9173, 0x1B27,
+ 0x9175, 0x07EC, 0x9177, 0x0805, 0x9178, 0x088E, 0x9182, 0x1B2B,
+ 0x9187, 0x0970, 0x9189, 0x1B2A, 0x918B, 0x1B29, 0x918D, 0x0B49,
+ 0x918E, 0x3B6A, 0x9190, 0x07A3, 0x9192, 0x0A67, 0x9197, 0x0D44,
+ 0x919C, 0x0943, 0x919E, 0x3B6B, 0x91A2, 0x1B2C, 0x91A4, 0x09C7,
+ 0x91A8, 0x3B6C, 0x91AA, 0x1B2F, 0x91AB, 0x1B2D, 0x91AC, 0x1E1B,
+ 0x91AD, 0x3B6D, 0x91AE, 0x3B6E, 0x91AF, 0x1B2E, 0x91B1, 0x1E61,
+ 0x91B2, 0x3B6F, 0x91B4, 0x1B31, 0x91B5, 0x1B30, 0x91B8, 0x09E2,
+ 0x91BA, 0x1B32, 0x91BC, 0x3B70, 0x91C0, 0x1B33, 0x91C1, 0x1B34,
+ 0x91C6, 0x0D64, 0x91C7, 0x0843, 0x91C8, 0x090D, 0x91C9, 0x1B35,
+ 0x91CB, 0x1B36, 0x91CC, 0x0F6C, 0x91CD, 0x094F, 0x91CE, 0x0EFA,
+ 0x91CF, 0x0F94, 0x91D0, 0x1B37, 0x91D1, 0x06DA, 0x91D6, 0x1B38,
+ 0x91D7, 0x21C0, 0x91D8, 0x0C1D, 0x91DA, 0x21BF, 0x91DB, 0x1B3B,
+ 0x91DC, 0x05D6, 0x91DD, 0x0A11, 0x91DE, 0x21C1, 0x91DF, 0x1B39,
+ 0x91E1, 0x1B3A, 0x91E3, 0x0BFC, 0x91E4, 0x21C4, 0x91E5, 0x21C5,
+ 0x91E6, 0x0E83, 0x91E7, 0x06F4, 0x91ED, 0x21C2, 0x91EE, 0x21C3,
+ 0x91F0, 0x3B71, 0x91F5, 0x1B3D, 0x91F6, 0x1B3E, 0x91F7, 0x3B72,
+ 0x91FB, 0x3B73, 0x91FC, 0x1B3C, 0x91FF, 0x1B40, 0x9206, 0x21C6,
+ 0x9207, 0x3B74, 0x920A, 0x21C8, 0x920D, 0x0CB7, 0x920E, 0x05A1,
+ 0x9210, 0x21C7, 0x9211, 0x1B44, 0x9214, 0x1B41, 0x9215, 0x1B43,
+ 0x921E, 0x1B3F, 0x9228, 0x3B75, 0x9229, 0x1B8A, 0x922C, 0x1B42,
+ 0x9233, 0x3B76, 0x9234, 0x0FB3, 0x9237, 0x078E, 0x9238, 0x3B77,
+ 0x9239, 0x21CF, 0x923A, 0x21C9, 0x923C, 0x21CB, 0x923F, 0x1B4C,
+ 0x9240, 0x21CA, 0x9243, 0x3B78, 0x9244, 0x0C2E, 0x9245, 0x1B47,
+ 0x9247, 0x3B79, 0x9248, 0x1B4A, 0x9249, 0x1B48, 0x924B, 0x1B4D,
+ 0x924E, 0x21CC, 0x924F, 0x3B7A, 0x9250, 0x1B4E, 0x9251, 0x21CE,
+ 0x9257, 0x1B46, 0x9259, 0x21CD, 0x925A, 0x1B53, 0x925B, 0x0516,
+ 0x925E, 0x1B45, 0x9260, 0x3B7B, 0x9262, 0x0D41, 0x9264, 0x1B49,
+ 0x9266, 0x09C8, 0x9267, 0x21D0, 0x9271, 0x07ED, 0x9277, 0x21D2,
+ 0x9278, 0x21D3, 0x927E, 0x0E76, 0x9280, 0x06DC, 0x9283, 0x0950,
+ 0x9285, 0x0C94, 0x9288, 0x20AA, 0x9291, 0x0AAF, 0x9293, 0x1B51,
+ 0x9295, 0x1B4B, 0x9296, 0x1B50, 0x9298, 0x0ECF, 0x929A, 0x0BD4,
+ 0x929B, 0x1B52, 0x929C, 0x1B4F, 0x92A7, 0x21D1, 0x92AD, 0x0AAE,
+ 0x92B3, 0x3554, 0x92B7, 0x1B56, 0x92B9, 0x1B55, 0x92C2, 0x3B7C,
+ 0x92CB, 0x3B7D, 0x92CC, 0x3B7E, 0x92CF, 0x1B54, 0x92D0, 0x21D7,
+ 0x92D2, 0x0E5D, 0x92D3, 0x21DB, 0x92D5, 0x21D9, 0x92D7, 0x21D5,
+ 0x92D9, 0x21D6, 0x92DF, 0x3B7F, 0x92E0, 0x21DA, 0x92E4, 0x0985,
+ 0x92E7, 0x21D4, 0x92E9, 0x1B57, 0x92EA, 0x0E2F, 0x92ED, 0x04F6,
+ 0x92F2, 0x0DB8, 0x92F3, 0x0BB0, 0x92F8, 0x0692, 0x92F9, 0x20B0,
+ 0x92FA, 0x1B59, 0x92FB, 0x21DE, 0x92FC, 0x07EF, 0x92FF, 0x21E1,
+ 0x9302, 0x21E3, 0x9304, 0x345A, 0x9306, 0x087A, 0x930D, 0x3B80,
+ 0x930F, 0x1B58, 0x9310, 0x0A33, 0x9315, 0x3B81, 0x9318, 0x0A34,
+ 0x9319, 0x1B5C, 0x931A, 0x1B5E, 0x931D, 0x21E2, 0x931E, 0x21E0,
+ 0x931F, 0x3B82, 0x9320, 0x09E3, 0x9321, 0x21DD, 0x9322, 0x1B5D,
+ 0x9323, 0x1B5F, 0x9325, 0x21DC, 0x9326, 0x06CB, 0x9327, 0x3B83,
+ 0x9328, 0x0DB7, 0x932B, 0x090E, 0x932C, 0x0FC9, 0x932E, 0x1B5B,
+ 0x932F, 0x0868, 0x9332, 0x0FE5, 0x9335, 0x1B61, 0x933A, 0x1B60,
+ 0x933B, 0x1B62, 0x9344, 0x1B5A, 0x9347, 0x3B84, 0x9348, 0x20A9,
+ 0x934A, 0x3458, 0x934B, 0x0CC1, 0x934D, 0x0C4F, 0x9352, 0x3B85,
+ 0x9354, 0x0BF3, 0x9356, 0x1B67, 0x9357, 0x21E5, 0x935B, 0x0B81,
+ 0x935C, 0x1B63, 0x9360, 0x1B64, 0x9365, 0x3B86, 0x936A, 0x3B87,
+ 0x936C, 0x0703, 0x936D, 0x3B88, 0x936E, 0x1B66, 0x9370, 0x21E4,
+ 0x9375, 0x0764, 0x937C, 0x1B65, 0x937E, 0x09C9, 0x938C, 0x05D7,
+ 0x9394, 0x1B6B, 0x9396, 0x082F, 0x9397, 0x0AFB, 0x939A, 0x0BE6,
+ 0x939B, 0x3B89, 0x93A4, 0x21E6, 0x93A7, 0x0599, 0x93A9, 0x3B8B,
+ 0x93AC, 0x1B69, 0x93AD, 0x1B6A, 0x93AE, 0x0BDF, 0x93B0, 0x1B68,
+ 0x93B9, 0x1B6C, 0x93BA, 0x3B8A, 0x93C1, 0x3B8C, 0x93C3, 0x1B72,
+ 0x93C6, 0x21E7, 0x93C8, 0x1B75, 0x93CA, 0x3B8D, 0x93D0, 0x1B74,
+ 0x93D1, 0x0C27, 0x93D6, 0x1B6D, 0x93D7, 0x1B6E, 0x93D8, 0x1B71,
+ 0x93DD, 0x1B73, 0x93DE, 0x21E8, 0x93E1, 0x06B8, 0x93E2, 0x3B8E,
+ 0x93E4, 0x1B76, 0x93E5, 0x1B70, 0x93E8, 0x1B6F, 0x93F8, 0x21E9,
+ 0x93FA, 0x3B8F, 0x93FD, 0x3B90, 0x9403, 0x1B7A, 0x9407, 0x1B7B,
+ 0x940F, 0x3B91, 0x9410, 0x1B7C, 0x9413, 0x1B79, 0x9414, 0x1B78,
+ 0x9418, 0x09CA, 0x9419, 0x0C82, 0x941A, 0x1B77, 0x9421, 0x1B80,
+ 0x942B, 0x1B7E, 0x9431, 0x21EA, 0x9434, 0x3B92, 0x9435, 0x1B7F,
+ 0x9436, 0x1B7D, 0x9438, 0x0B58, 0x943A, 0x1B81, 0x943F, 0x3B93,
+ 0x9441, 0x1B82, 0x9444, 0x1B84, 0x9445, 0x21EB, 0x9448, 0x21EC,
+ 0x9451, 0x0611, 0x9452, 0x1B83, 0x9453, 0x0F06, 0x9455, 0x3B94,
+ 0x945A, 0x1B8F, 0x945B, 0x1B85, 0x945E, 0x1B88, 0x9460, 0x1B86,
+ 0x9462, 0x1B87, 0x946A, 0x1B89, 0x946B, 0x3B95, 0x9470, 0x1B8B,
+ 0x9472, 0x3B96, 0x9475, 0x1B8C, 0x9477, 0x1B8D, 0x947C, 0x1B90,
+ 0x947D, 0x1B8E, 0x947E, 0x1B91, 0x947F, 0x1B93, 0x9481, 0x1B92,
+ 0x9577, 0x0BD5, 0x9578, 0x3B97, 0x9580, 0x0EF3, 0x9582, 0x1B94,
+ 0x9583, 0x0AB0, 0x9587, 0x1B95, 0x9589, 0x0E14, 0x958A, 0x1B96,
+ 0x958B, 0x0589, 0x958F, 0x04DE, 0x9591, 0x0613, 0x9592, 0x21ED,
+ 0x9593, 0x0612, 0x9594, 0x1B97, 0x9596, 0x1B98, 0x9598, 0x1B99,
+ 0x9599, 0x1B9A, 0x95A0, 0x1B9B, 0x95A2, 0x0614, 0x95A3, 0x05B3,
+ 0x95A4, 0x07F0, 0x95A5, 0x0D4A, 0x95A6, 0x3B98, 0x95A7, 0x1B9D,
+ 0x95A8, 0x1B9C, 0x95A9, 0x3B99, 0x95AB, 0x3B9A, 0x95AD, 0x1B9E,
+ 0x95B1, 0x3555, 0x95B2, 0x04FE, 0x95B4, 0x3B9B, 0x95B9, 0x1BA1,
+ 0x95BB, 0x1BA0, 0x95BC, 0x1B9F, 0x95BD, 0x3B9C, 0x95BE, 0x1BA2,
+ 0x95C3, 0x1BA5, 0x95C7, 0x048B, 0x95CA, 0x1BA3, 0x95CC, 0x1BA7,
+ 0x95CD, 0x1BA6, 0x95D4, 0x1BA9, 0x95D5, 0x1BA8, 0x95D6, 0x1BAA,
+ 0x95D8, 0x0C86, 0x95DA, 0x3B9D, 0x95DC, 0x1BAB, 0x95E1, 0x1BAC,
+ 0x95E2, 0x1BAE, 0x95E5, 0x1BAD, 0x961C, 0x0DDE, 0x961D, 0x3B9E,
+ 0x9621, 0x1BAF, 0x9628, 0x1BB0, 0x962A, 0x0855, 0x962E, 0x1BB1,
+ 0x962F, 0x1BB2, 0x9632, 0x0E77, 0x963B, 0x0ACD, 0x963F, 0x0468,
+ 0x9640, 0x0B2B, 0x9641, 0x3B9F, 0x9642, 0x1BB3, 0x9644, 0x0DDF,
+ 0x964B, 0x1BB6, 0x964C, 0x1BB4, 0x964D, 0x07F1, 0x964F, 0x1BB5,
+ 0x9650, 0x0776, 0x9658, 0x3BA0, 0x965B, 0x0E15, 0x965C, 0x1BB8,
+ 0x965D, 0x1BBA, 0x965E, 0x1BB9, 0x965F, 0x1BBB, 0x9662, 0x04C3,
+ 0x9663, 0x0A1E, 0x9664, 0x0986, 0x9665, 0x0615, 0x9666, 0x1BBC,
+ 0x966A, 0x0D1C, 0x966C, 0x1BBE, 0x9670, 0x04C4, 0x9672, 0x1BBD,
+ 0x9673, 0x0BE0, 0x9675, 0x0F95, 0x9676, 0x0C83, 0x9677, 0x1BB7,
+ 0x9678, 0x0F6E, 0x967A, 0x0765, 0x967D, 0x0F45, 0x9684, 0x3BA1,
+ 0x9685, 0x06F1, 0x9686, 0x0F7C, 0x9688, 0x06FE, 0x968A, 0x0B42,
+ 0x968B, 0x186C, 0x968D, 0x1BBF, 0x968E, 0x058A, 0x968F, 0x0A35,
+ 0x9694, 0x05B4, 0x9695, 0x1BC1, 0x9697, 0x1BC2, 0x9698, 0x1BC0,
+ 0x9699, 0x073A, 0x969B, 0x084D, 0x969C, 0x09CB, 0x969D, 0x21F0,
+ 0x96A0, 0x04C5, 0x96A3, 0x0FA1, 0x96A4, 0x3BA2, 0x96A7, 0x1BC4,
+ 0x96A8, 0x1B0B, 0x96A9, 0x3BA3, 0x96AA, 0x1BC3, 0x96AF, 0x21F1,
+ 0x96B0, 0x1BC7, 0x96B1, 0x1BC5, 0x96B2, 0x1BC6, 0x96B4, 0x1BC8,
+ 0x96B6, 0x1BC9, 0x96B7, 0x0FB4, 0x96B8, 0x1BCA, 0x96B9, 0x1BCB,
+ 0x96BB, 0x0A6D, 0x96BC, 0x0D4F, 0x96C0, 0x0A43, 0x96C1, 0x0623,
+ 0x96C4, 0x0F24, 0x96C5, 0x056D, 0x96C6, 0x0942, 0x96C7, 0x078F,
+ 0x96C9, 0x1BCE, 0x96CB, 0x1BCD, 0x96CC, 0x08C1, 0x96CD, 0x1BCF,
+ 0x96CE, 0x1BCC, 0x96D1, 0x0876, 0x96D2, 0x3BA4, 0x96D5, 0x1BD3,
+ 0x96D6, 0x1992, 0x96D9, 0x10EB, 0x96DB, 0x0A3D, 0x96DC, 0x1BD1,
+ 0x96DE, 0x3BA6, 0x96E2, 0x0F6D, 0x96E3, 0x0CC9, 0x96E8, 0x04CD,
+ 0x96E9, 0x3BA7, 0x96EA, 0x0A87, 0x96EB, 0x08E2, 0x96F0, 0x0E07,
+ 0x96F1, 0x3BA8, 0x96F2, 0x04E2, 0x96F6, 0x0FB5, 0x96F7, 0x0F55,
+ 0x96F9, 0x1BD4, 0x96FB, 0x0C3F, 0x9700, 0x0927, 0x9702, 0x3BA9,
+ 0x9704, 0x1BD5, 0x9706, 0x1BD6, 0x9707, 0x0A12, 0x9708, 0x1BD7,
+ 0x9709, 0x3BAA, 0x970A, 0x0FB6, 0x970D, 0x1BD2, 0x970E, 0x1BD9,
+ 0x970F, 0x1BDB, 0x9711, 0x1BDA, 0x9713, 0x1BD8, 0x9716, 0x1BDC,
+ 0x9719, 0x1BDD, 0x971C, 0x0AFC, 0x971E, 0x0562, 0x9724, 0x1BDE,
+ 0x9727, 0x0EC4, 0x972A, 0x1BDF, 0x9730, 0x1BE0, 0x9732, 0x0FD0,
+ 0x9733, 0x21F2, 0x9738, 0x1414, 0x9739, 0x1BE1, 0x973B, 0x21F3,
+ 0x973D, 0x1BE2, 0x973E, 0x1BE3, 0x9742, 0x1BE7, 0x9743, 0x21F4,
+ 0x9744, 0x1BE4, 0x9746, 0x1BE5, 0x9748, 0x1BE6, 0x9749, 0x1BE8,
+ 0x974D, 0x21F5, 0x974F, 0x21F6, 0x9751, 0x21F7, 0x9752, 0x0A68,
+ 0x9755, 0x21F8, 0x9756, 0x0F03, 0x9759, 0x0A69, 0x975A, 0x3BAB,
+ 0x975C, 0x1BE9, 0x975E, 0x0D87, 0x9760, 0x1BEA, 0x9761, 0x1D06,
+ 0x9762, 0x0ED8, 0x9763, 0x3BAC, 0x9764, 0x1BEB, 0x9766, 0x1BEC,
+ 0x9768, 0x1BED, 0x9769, 0x05B5, 0x976B, 0x1BEF, 0x976D, 0x0A1F,
+ 0x976E, 0x3BAD, 0x9771, 0x1BF0, 0x9773, 0x3BAE, 0x9774, 0x06FA,
+ 0x9779, 0x1BF1, 0x977A, 0x1BF5, 0x977C, 0x1BF3, 0x9781, 0x1BF4,
+ 0x9784, 0x05D1, 0x9785, 0x1BF2, 0x9786, 0x1BF6, 0x978B, 0x1BF7,
+ 0x978D, 0x048C, 0x978F, 0x1BF8, 0x9790, 0x1BF9, 0x9798, 0x09CC,
+ 0x979A, 0x3BAF, 0x979C, 0x1BFA, 0x97A0, 0x0661, 0x97A2, 0x3BB0,
+ 0x97A3, 0x1BFD, 0x97A6, 0x1BFC, 0x97A8, 0x1BFB, 0x97AB, 0x1A34,
+ 0x97AD, 0x0E2C, 0x97B3, 0x1BFE, 0x97B4, 0x1BFF, 0x97B5, 0x3BB1,
+ 0x97B6, 0x3BB2, 0x97C3, 0x1C00, 0x97C6, 0x1C01, 0x97C8, 0x1C02,
+ 0x97CB, 0x1C03, 0x97D3, 0x0616, 0x97D9, 0x3BB3, 0x97DC, 0x1C04,
+ 0x97DE, 0x3BB4, 0x97ED, 0x1C05, 0x97EE, 0x0CD9, 0x97F2, 0x1C07,
+ 0x97F3, 0x053B, 0x97F4, 0x3BB5, 0x97F5, 0x1C0A, 0x97F6, 0x1C09,
+ 0x97FB, 0x04C6, 0x97FF, 0x06B9, 0x9801, 0x0E17, 0x9802, 0x0BD6,
+ 0x9803, 0x0812, 0x9805, 0x07F2, 0x9806, 0x0971, 0x9808, 0x0A22,
+ 0x980A, 0x3BB6, 0x980C, 0x1C0C, 0x980E, 0x3BB7, 0x980F, 0x1C0B,
+ 0x9810, 0x0F2C, 0x9811, 0x0624, 0x9812, 0x0D66, 0x9813, 0x0CB4,
+ 0x9817, 0x0A42, 0x9818, 0x0F96, 0x981A, 0x0731, 0x981E, 0x3BB8,
+ 0x9821, 0x1C0F, 0x9823, 0x3BB9, 0x9824, 0x1C0E, 0x982B, 0x3BBA,
+ 0x982C, 0x0E79, 0x982D, 0x0C84, 0x9830, 0x1E73, 0x9834, 0x04F2,
+ 0x9837, 0x1C10, 0x9838, 0x1C0D, 0x9839, 0x37B3, 0x983B, 0x0DC3,
+ 0x983C, 0x0F54, 0x983D, 0x1C11, 0x983E, 0x3BBB, 0x9846, 0x1C12,
+ 0x984B, 0x1C14, 0x984C, 0x0B4A, 0x984D, 0x05B9, 0x984E, 0x05BA,
+ 0x984F, 0x1C13, 0x9852, 0x3BBC, 0x9853, 0x3BBD, 0x9854, 0x0625,
+ 0x9855, 0x0766, 0x9857, 0x21F9, 0x9858, 0x0626, 0x9859, 0x3BBE,
+ 0x985A, 0x1E48, 0x985B, 0x0C39, 0x985E, 0x0FA8, 0x9865, 0x21FA,
+ 0x9867, 0x0790, 0x986B, 0x1C15, 0x986C, 0x3BBF, 0x986F, 0x1C16,
+ 0x9870, 0x1C17, 0x9871, 0x1C18, 0x9873, 0x1C1A, 0x9874, 0x1C19,
+ 0x98A8, 0x0DE9, 0x98AA, 0x1C1B, 0x98AF, 0x1C1C, 0x98B1, 0x1C1D,
+ 0x98B6, 0x1C1E, 0x98B8, 0x3BC0, 0x98BA, 0x3BC1, 0x98BF, 0x3BC2,
+ 0x98C3, 0x1C20, 0x98C4, 0x1C1F, 0x98C6, 0x1C21, 0x98C8, 0x3BC3,
+ 0x98DB, 0x0D88, 0x98DC, 0x1839, 0x98DF, 0x09EF, 0x98E0, 0x3618,
+ 0x98E2, 0x064C, 0x98E5, 0x3BC4, 0x98E9, 0x1C22, 0x98EB, 0x1C23,
+ 0x98ED, 0x10C1, 0x98EE, 0x14DA, 0x98EF, 0x0D67, 0x98F2, 0x04BF,
+ 0x98F4, 0x047F, 0x98FC, 0x08C2, 0x98FD, 0x0E5E, 0x98FE, 0x09E6,
+ 0x9903, 0x1C24, 0x9905, 0x0EEB, 0x9909, 0x1C25, 0x990A, 0x0F46,
+ 0x990C, 0x04E4, 0x9910, 0x088F, 0x9912, 0x1C26, 0x9913, 0x056E,
+ 0x9914, 0x1C27, 0x9918, 0x1C28, 0x991D, 0x1C2A, 0x991E, 0x1C2B,
+ 0x9920, 0x1C2D, 0x9921, 0x1C29, 0x9924, 0x1C2C, 0x9927, 0x21FD,
+ 0x9928, 0x0617, 0x992C, 0x1C2E, 0x992E, 0x1C2F, 0x9932, 0x3BC5,
+ 0x9933, 0x3BC6, 0x993D, 0x1C30, 0x993E, 0x1C31, 0x9940, 0x3BC7,
+ 0x9942, 0x1C32, 0x9945, 0x1C34, 0x9949, 0x1C33, 0x994B, 0x1C36,
+ 0x994C, 0x1C39, 0x994D, 0x3BC8, 0x9950, 0x1C35, 0x9951, 0x1C37,
+ 0x9952, 0x1C38, 0x9955, 0x1C3A, 0x9957, 0x06BA, 0x995C, 0x3BC9,
+ 0x995F, 0x3BCA, 0x9996, 0x091F, 0x9997, 0x1C3B, 0x9998, 0x1C3C,
+ 0x9999, 0x07F3, 0x999E, 0x21FF, 0x99A5, 0x1C3D, 0x99A8, 0x059C,
+ 0x99AC, 0x0D05, 0x99AD, 0x1C3E, 0x99AE, 0x1C3F, 0x99B1, 0x3BCB,
+ 0x99B3, 0x0B98, 0x99B4, 0x0CC3, 0x99B9, 0x3BCC, 0x99BA, 0x3BCD,
+ 0x99BC, 0x1C40, 0x99C1, 0x0D33, 0x99C4, 0x0B2C, 0x99C5, 0x04FA,
+ 0x99C6, 0x06E6, 0x99C8, 0x06E7, 0x99C9, 0x3BCE, 0x99D0, 0x0BB1,
+ 0x99D1, 0x1C45, 0x99D2, 0x06E8, 0x99D5, 0x056F, 0x99D8, 0x1C44,
+ 0x99DB, 0x1C42, 0x99DD, 0x1C43, 0x99DF, 0x1C41, 0x99E2, 0x1C4F,
+ 0x99ED, 0x1C46, 0x99EE, 0x1C47, 0x99F1, 0x1C48, 0x99F2, 0x1C49,
+ 0x99F8, 0x1C4B, 0x99FB, 0x1C4A, 0x99FF, 0x0963, 0x9A01, 0x1C4C,
+ 0x9A02, 0x3BCF, 0x9A05, 0x1C4E, 0x9A08, 0x37BA, 0x9A0E, 0x064D,
+ 0x9A0F, 0x1C4D, 0x9A12, 0x0AFD, 0x9A13, 0x0767, 0x9A16, 0x3BD0,
+ 0x9A19, 0x1C50, 0x9A24, 0x3BD1, 0x9A27, 0x3BD2, 0x9A28, 0x0B2D,
+ 0x9A2B, 0x1C51, 0x9A2D, 0x3BD3, 0x9A2E, 0x3BD4, 0x9A30, 0x0C85,
+ 0x9A36, 0x3BD5, 0x9A37, 0x1C52, 0x9A38, 0x3BD6, 0x9A3E, 0x1C57,
+ 0x9A40, 0x1C55, 0x9A42, 0x1C54, 0x9A43, 0x1C56, 0x9A45, 0x1C53,
+ 0x9A4A, 0x3BD7, 0x9A4D, 0x1C59, 0x9A4E, 0x2200, 0x9A52, 0x1E2F,
+ 0x9A55, 0x1C58, 0x9A56, 0x3BD8, 0x9A57, 0x1C5B, 0x9A5A, 0x06BB,
+ 0x9A5B, 0x1C5A, 0x9A5F, 0x1C5C, 0x9A62, 0x1C5D, 0x9A64, 0x1C5F,
+ 0x9A65, 0x1C5E, 0x9A69, 0x1C60, 0x9A6A, 0x1C62, 0x9A6B, 0x1C61,
+ 0x9AA8, 0x080E, 0x9AAD, 0x1C63, 0x9AB0, 0x1C64, 0x9AB5, 0x3BD9,
+ 0x9AB6, 0x3BDA, 0x9AB8, 0x059A, 0x9ABC, 0x1C65, 0x9AC0, 0x1C66,
+ 0x9AC4, 0x0A37, 0x9ACF, 0x1C67, 0x9AD1, 0x1C68, 0x9AD3, 0x1C69,
+ 0x9AD4, 0x1C6A, 0x9AD8, 0x07F4, 0x9AD9, 0x2201, 0x9ADC, 0x2202,
+ 0x9ADE, 0x1C6B, 0x9ADF, 0x1C6C, 0x9AE2, 0x1C6D, 0x9AE3, 0x1C6E,
+ 0x9AE6, 0x1C6F, 0x9AEA, 0x0D45, 0x9AEB, 0x1C71, 0x9AED, 0x0D98,
+ 0x9AEE, 0x1C72, 0x9AEF, 0x1C70, 0x9AF1, 0x1C74, 0x9AF4, 0x1C73,
+ 0x9AF7, 0x1C75, 0x9AF9, 0x3BDB, 0x9AFB, 0x1C76, 0x9B03, 0x3BDC,
+ 0x9B06, 0x1C77, 0x9B18, 0x1C78, 0x9B1A, 0x1C79, 0x9B1F, 0x1C7A,
+ 0x9B20, 0x3BDD, 0x9B22, 0x1C7B, 0x9B23, 0x1C7C, 0x9B25, 0x1C7D,
+ 0x9B27, 0x1C7E, 0x9B28, 0x1C7F, 0x9B29, 0x1C80, 0x9B2A, 0x1C81,
+ 0x9B2D, 0x343C, 0x9B2E, 0x1C82, 0x9B2F, 0x1C83, 0x9B31, 0x14D4,
+ 0x9B32, 0x1C84, 0x9B33, 0x3BDE, 0x9B34, 0x3BDF, 0x9B3B, 0x17A9,
+ 0x9B3C, 0x064E, 0x9B41, 0x057F, 0x9B42, 0x0822, 0x9B43, 0x1C86,
+ 0x9B44, 0x1C85, 0x9B45, 0x0EB1, 0x9B4D, 0x1C88, 0x9B4E, 0x1C89,
+ 0x9B4F, 0x1C87, 0x9B51, 0x1C8A, 0x9B54, 0x0E90, 0x9B58, 0x1C8B,
+ 0x9B5A, 0x0695, 0x9B6F, 0x0FCB, 0x9B72, 0x2204, 0x9B73, 0x3BE0,
+ 0x9B74, 0x1C8C, 0x9B75, 0x2203, 0x9B79, 0x3BE1, 0x9B83, 0x1C8E,
+ 0x9B8E, 0x0482, 0x9B8F, 0x2205, 0x9B91, 0x1C8F, 0x9B92, 0x0DFB,
+ 0x9B93, 0x1C8D, 0x9B96, 0x1C90, 0x9B97, 0x1C91, 0x9B9F, 0x1C92,
+ 0x9BA0, 0x1C93, 0x9BA7, 0x3BE2, 0x9BA8, 0x1C94, 0x9BAA, 0x0E9C,
+ 0x9BAB, 0x087B, 0x9BAD, 0x086A, 0x9BAE, 0x0AB1, 0x9BB1, 0x2206,
+ 0x9BB4, 0x1C95, 0x9BB9, 0x1C98, 0x9BBB, 0x2207, 0x9BC0, 0x1C96,
+ 0x9BC1, 0x3BE3, 0x9BC6, 0x1C99, 0x9BC7, 0x3BE4, 0x9BC9, 0x07A5,
+ 0x9BCA, 0x1C97, 0x9BCF, 0x1C9A, 0x9BD1, 0x1C9B, 0x9BD2, 0x1C9C,
+ 0x9BD4, 0x1CA0, 0x9BD6, 0x0878, 0x9BD7, 0x3BE5, 0x9BDB, 0x0B44,
+ 0x9BDF, 0x37BF, 0x9BE1, 0x1CA1, 0x9BE2, 0x1C9E, 0x9BE3, 0x1C9D,
+ 0x9BE4, 0x1C9F, 0x9BE7, 0x3BE6, 0x9BE8, 0x0735, 0x9BEB, 0x3BE7,
+ 0x9BF0, 0x1CA5, 0x9BF1, 0x1CA4, 0x9BF2, 0x1CA3, 0x9BF5, 0x0477,
+ 0x9BF7, 0x3BE8, 0x9BFA, 0x3BE9, 0x9BFD, 0x3BEA, 0x9C00, 0x2208,
+ 0x9C04, 0x1CAF, 0x9C06, 0x1CAB, 0x9C08, 0x1CAC, 0x9C09, 0x1CA8,
+ 0x9C0A, 0x1CAE, 0x9C0B, 0x3BEB, 0x9C0C, 0x1CAA, 0x9C0D, 0x05C0,
+ 0x9C10, 0x0FF2, 0x9C12, 0x1CAD, 0x9C13, 0x1CA9, 0x9C14, 0x1CA7,
+ 0x9C15, 0x1CA6, 0x9C1B, 0x1CB1, 0x9C21, 0x1CB4, 0x9C24, 0x1CB3,
+ 0x9C25, 0x1CB2, 0x9C27, 0x3BEC, 0x9C2A, 0x3BED, 0x9C2D, 0x0DBB,
+ 0x9C2E, 0x1CB0, 0x9C2F, 0x04B7, 0x9C30, 0x1CB5, 0x9C32, 0x1CB7,
+ 0x9C36, 0x3BEE, 0x9C39, 0x05CD, 0x9C3A, 0x1CA2, 0x9C3B, 0x04D9,
+ 0x9C3E, 0x1CB9, 0x9C41, 0x3BEF, 0x9C46, 0x1CB8, 0x9C47, 0x1CB6,
+ 0x9C48, 0x0B6B, 0x9C52, 0x0E9E, 0x9C53, 0x3BF0, 0x9C57, 0x0FA2,
+ 0x9C5A, 0x1CBA, 0x9C60, 0x1CBB, 0x9C63, 0x3BF1, 0x9C67, 0x1CBC,
+ 0x9C6A, 0x3BF2, 0x9C76, 0x1CBD, 0x9C77, 0x3BF3, 0x9C78, 0x1CBE,
+ 0x9CE5, 0x0BD7, 0x9CE7, 0x1CBF, 0x9CE9, 0x0D4B, 0x9CEB, 0x1CC4,
+ 0x9CEC, 0x1CC0, 0x9CF0, 0x1CC1, 0x9CF3, 0x0E5F, 0x9CF4, 0x0ED0,
+ 0x9CF6, 0x0CA8, 0x9D02, 0x3BF4, 0x9D03, 0x1CC5, 0x9D06, 0x1CC6,
+ 0x9D07, 0x0C96, 0x9D08, 0x1CC3, 0x9D09, 0x1CC2, 0x9D0E, 0x052A,
+ 0x9D12, 0x1CCE, 0x9D15, 0x1CCD, 0x9D1B, 0x0517, 0x9D1F, 0x1CCB,
+ 0x9D23, 0x1CCA, 0x9D26, 0x1CC8, 0x9D28, 0x05D9, 0x9D2A, 0x1CC7,
+ 0x9D2B, 0x08DE, 0x9D2C, 0x0529, 0x9D3B, 0x07F5, 0x9D3E, 0x1CD1,
+ 0x9D3F, 0x1CD0, 0x9D41, 0x1CCF, 0x9D42, 0x3BF5, 0x9D44, 0x1CCC,
+ 0x9D46, 0x1CD2, 0x9D47, 0x3BF6, 0x9D48, 0x1CD3, 0x9D50, 0x1CD8,
+ 0x9D51, 0x1CD7, 0x9D59, 0x1CD9, 0x9D5C, 0x04CF, 0x9D5D, 0x1CD4,
+ 0x9D5E, 0x1CD5, 0x9D60, 0x0806, 0x9D61, 0x0EC5, 0x9D63, 0x3BF7,
+ 0x9D64, 0x1CD6, 0x9D69, 0x3BF8, 0x9D6B, 0x220A, 0x9D6C, 0x0E60,
+ 0x9D6F, 0x1CDE, 0x9D70, 0x2209, 0x9D72, 0x1CDA, 0x9D7A, 0x1CDF,
+ 0x9D7C, 0x3BF9, 0x9D7E, 0x3BFA, 0x9D87, 0x1CDC, 0x9D89, 0x1CDB,
+ 0x9D8D, 0x3BFB, 0x9D8F, 0x0732, 0x9D9A, 0x1CE0, 0x9DA4, 0x1CE1,
+ 0x9DA9, 0x1CE2, 0x9DAB, 0x1CDD, 0x9DAF, 0x1CC9, 0x9DB1, 0x3BFC,
+ 0x9DB2, 0x1CE3, 0x9DB4, 0x0BFD, 0x9DB8, 0x1CE7, 0x9DBA, 0x1CE8,
+ 0x9DBB, 0x1CE6, 0x9DC1, 0x1CE5, 0x9DC2, 0x1CEB, 0x9DC3, 0x3BFD,
+ 0x9DC4, 0x1CE4, 0x9DC6, 0x1CE9, 0x9DC7, 0x3BFE, 0x9DCF, 0x1CEA,
+ 0x9DD3, 0x1CED, 0x9DD6, 0x3BFF, 0x9DD7, 0x1DDE, 0x9DD9, 0x1CEC,
+ 0x9DDF, 0x3C00, 0x9DE6, 0x1CEF, 0x9DEB, 0x3C01, 0x9DED, 0x1CF0,
+ 0x9DEF, 0x1CF1, 0x9DF2, 0x0FEF, 0x9DF4, 0x3C02, 0x9DF8, 0x1CEE,
+ 0x9DF9, 0x0B4B, 0x9DFA, 0x085D, 0x9DFD, 0x1CF2, 0x9E15, 0x3C03,
+ 0x9E19, 0x220C, 0x9E1A, 0x1CF3, 0x9E1B, 0x1CF4, 0x9E1D, 0x3C04,
+ 0x9E1E, 0x1CF5, 0x9E75, 0x1CF6, 0x9E78, 0x0768, 0x9E79, 0x1CF7,
+ 0x9E7C, 0x1DFD, 0x9E7D, 0x1CF8, 0x9E7F, 0x08DB, 0x9E81, 0x1CF9,
+ 0x9E88, 0x1CFA, 0x9E8B, 0x1CFB, 0x9E8C, 0x1CFC, 0x9E91, 0x1CFF,
+ 0x9E92, 0x1CFD, 0x9E93, 0x0FE2, 0x9E95, 0x1CFE, 0x9E97, 0x0FB7,
+ 0x9E9D, 0x1D00, 0x9E9F, 0x0FA3, 0x9EA4, 0x3C05, 0x9EA5, 0x1D01,
+ 0x9EA6, 0x0D34, 0x9EA8, 0x3C06, 0x9EA9, 0x1D02, 0x9EAA, 0x1D04,
+ 0x9EAC, 0x3C07, 0x9EAD, 0x1D05, 0x9EB4, 0x1E02, 0x9EB5, 0x1E75,
+ 0x9EB8, 0x1D03, 0x9EB9, 0x07FF, 0x9EBA, 0x0ED9, 0x9EBB, 0x0E91,
+ 0x9EBC, 0x1284, 0x9EBE, 0x14FF, 0x9EBF, 0x0EA9, 0x9EC3, 0x340B,
+ 0x9EC4, 0x052B, 0x9ECC, 0x1D07, 0x9ECD, 0x066A, 0x9ECE, 0x1D08,
+ 0x9ECF, 0x1D09, 0x9ED0, 0x1D0A, 0x9ED1, 0x220D, 0x9ED2, 0x0807,
+ 0x9ED4, 0x1D0B, 0x9ED8, 0x160D, 0x9ED9, 0x0EE7, 0x9EDB, 0x0B43,
+ 0x9EDC, 0x1D0C, 0x9EDD, 0x1D0E, 0x9EDE, 0x1D0D, 0x9EE0, 0x1D0F,
+ 0x9EE5, 0x1D10, 0x9EE7, 0x3C08, 0x9EE8, 0x1D11, 0x9EEE, 0x3C09,
+ 0x9EEF, 0x1D12, 0x9EF4, 0x1D13, 0x9EF6, 0x1D14, 0x9EF7, 0x1D15,
+ 0x9EF9, 0x1D16, 0x9EFB, 0x1D17, 0x9EFC, 0x1D18, 0x9EFD, 0x1D19,
+ 0x9F07, 0x1D1A, 0x9F08, 0x1D1B, 0x9F0E, 0x0C1E, 0x9F10, 0x3C0A,
+ 0x9F12, 0x3C0B, 0x9F13, 0x0791, 0x9F15, 0x1D1D, 0x9F17, 0x3C0C,
+ 0x9F19, 0x3C0D, 0x9F20, 0x0ACF, 0x9F21, 0x1D1E, 0x9F2C, 0x1D1F,
+ 0x9F2F, 0x3C0E, 0x9F37, 0x3C0F, 0x9F39, 0x3C10, 0x9F3B, 0x0D93,
+ 0x9F3E, 0x1D20, 0x9F41, 0x3C11, 0x9F45, 0x3C12, 0x9F4A, 0x1D21,
+ 0x9F4B, 0x170A, 0x9F4E, 0x1A7B, 0x9F4F, 0x1C06, 0x9F52, 0x1D22,
+ 0x9F54, 0x1D23, 0x9F57, 0x3C13, 0x9F5F, 0x1D25, 0x9F60, 0x1D26,
+ 0x9F61, 0x1D27, 0x9F62, 0x0FB8, 0x9F63, 0x1D24, 0x9F66, 0x1D28,
+ 0x9F67, 0x1D29, 0x9F68, 0x3C14, 0x9F6A, 0x1D2B, 0x9F6C, 0x1D2A,
+ 0x9F71, 0x3C15, 0x9F72, 0x1D2D, 0x9F75, 0x3C16, 0x9F76, 0x1D2E,
+ 0x9F77, 0x1D2C, 0x9F8D, 0x0F7E, 0x9F90, 0x3C17, 0x9F94, 0x3C18,
+ 0x9F95, 0x1D2F, 0x9F9C, 0x1D30, 0x9F9D, 0x1727, 0x9FA0, 0x1D31,
+ 0x9FA2, 0x3C19, 0xF929, 0x2129, 0xF9DC, 0x21EE, 0xFA0E, 0x20DA,
+ 0xFA0F, 0x20E5, 0xFA10, 0x20E6, 0xFA11, 0x20FB, 0xFA12, 0x2121,
+ 0xFA13, 0x2131, 0xFA14, 0x2133, 0xFA15, 0x215E, 0xFA16, 0x2164,
+ 0xFA17, 0x217B, 0xFA18, 0x2183, 0xFA19, 0x2184, 0xFA1A, 0x2185,
+ 0xFA1B, 0x2187, 0xFA1C, 0x218B, 0xFA1D, 0x218E, 0xFA1E, 0x2197,
+ 0xFA1F, 0x21A2, 0xFA20, 0x21A4, 0xFA21, 0x21A5, 0xFA22, 0x21AE,
+ 0xFA23, 0x21B6, 0xFA24, 0x21B8, 0xFA25, 0x21B9, 0xFA26, 0x21BC,
+ 0xFA27, 0x21D8, 0xFA28, 0x21DF, 0xFA29, 0x21EF, 0xFA2A, 0x21FB,
+ 0xFA2B, 0x21FC, 0xFA2C, 0x21FE, 0xFA2D, 0x220B, 0xFB00, 0x248E,
+ 0xFB01, 0x0070, 0xFB02, 0x0071, 0xFB03, 0x248F, 0xFB04, 0x2490,
+ 0xFE30, 0x1EDA, 0xFE31, 0x1ED4, 0xFE32, 0x1ED5, 0xFE33, 0x1ED2,
+ 0xFE35, 0x1EDB, 0xFE36, 0x1EDC, 0xFE37, 0x1EE1, 0xFE38, 0x1EE2,
+ 0xFE39, 0x1EDD, 0xFE3A, 0x1EDE, 0xFE3B, 0x1EEB, 0xFE3C, 0x1EEC,
+ 0xFE3D, 0x1EE5, 0xFE3E, 0x1EE6, 0xFE3F, 0x1EE3, 0xFE40, 0x1EE4,
+ 0xFE41, 0x1EE7, 0xFE42, 0x1EE8, 0xFE43, 0x1EE9, 0xFE44, 0x1EEA,
+ 0xFF01, 0x0282, 0xFF02, 0x1F47, 0xFF03, 0x02CC, 0xFF04, 0x02C8,
+ 0xFF05, 0x02CB, 0xFF06, 0x02CD, 0xFF07, 0x1F46, 0xFF08, 0x02A2,
+ 0xFF09, 0x02A3, 0xFF0A, 0x02CE, 0xFF0B, 0x02B4, 0xFF0C, 0x027C,
+ 0xFF0D, 0x02B5, 0xFF0E, 0x027D, 0xFF0F, 0x0297, 0xFF10, 0x030C,
+ 0xFF11, 0x030D, 0xFF12, 0x030E, 0xFF13, 0x030F, 0xFF14, 0x0310,
+ 0xFF15, 0x0311, 0xFF16, 0x0312, 0xFF17, 0x0313, 0xFF18, 0x0314,
+ 0xFF19, 0x0315, 0xFF1A, 0x027F, 0xFF1B, 0x0280, 0xFF1C, 0x02BB,
+ 0xFF1D, 0x02B9, 0xFF1E, 0x02BC, 0xFF1F, 0x0281, 0xFF20, 0x02CF,
+ 0xFF21, 0x0316, 0xFF22, 0x0317, 0xFF23, 0x0318, 0xFF24, 0x0319,
+ 0xFF25, 0x031A, 0xFF26, 0x031B, 0xFF27, 0x031C, 0xFF28, 0x031D,
+ 0xFF29, 0x031E, 0xFF2A, 0x031F, 0xFF2B, 0x0320, 0xFF2C, 0x0321,
+ 0xFF2D, 0x0322, 0xFF2E, 0x0323, 0xFF2F, 0x0324, 0xFF30, 0x0325,
+ 0xFF31, 0x0326, 0xFF32, 0x0327, 0xFF33, 0x0328, 0xFF34, 0x0329,
+ 0xFF35, 0x032A, 0xFF36, 0x032B, 0xFF37, 0x032C, 0xFF38, 0x032D,
+ 0xFF39, 0x032E, 0xFF3A, 0x032F, 0xFF3B, 0x02A6, 0xFF3C, 0x0298,
+ 0xFF3D, 0x02A7, 0xFF3E, 0x0288, 0xFF3F, 0x028A, 0xFF40, 0x0286,
+ 0xFF41, 0x0330, 0xFF42, 0x0331, 0xFF43, 0x0332, 0xFF44, 0x0333,
+ 0xFF45, 0x0334, 0xFF46, 0x0335, 0xFF47, 0x0336, 0xFF48, 0x0337,
+ 0xFF49, 0x0338, 0xFF4A, 0x0339, 0xFF4B, 0x033A, 0xFF4C, 0x033B,
+ 0xFF4D, 0x033C, 0xFF4E, 0x033D, 0xFF4F, 0x033E, 0xFF50, 0x033F,
+ 0xFF51, 0x0340, 0xFF52, 0x0341, 0xFF53, 0x0342, 0xFF54, 0x0343,
+ 0xFF55, 0x0344, 0xFF56, 0x0345, 0xFF57, 0x0346, 0xFF58, 0x0347,
+ 0xFF59, 0x0348, 0xFF5A, 0x0349, 0xFF5B, 0x02A8, 0xFF5C, 0x029B,
+ 0xFF5D, 0x02A9, 0xFF5E, 0x0299, 0xFF61, 0x0147, 0xFF62, 0x0148,
+ 0xFF63, 0x0149, 0xFF64, 0x014A, 0xFF65, 0x014B, 0xFF66, 0x014C,
+ 0xFF67, 0x014D, 0xFF68, 0x014E, 0xFF69, 0x014F, 0xFF6A, 0x0150,
+ 0xFF6B, 0x0151, 0xFF6C, 0x0152, 0xFF6D, 0x0153, 0xFF6E, 0x0154,
+ 0xFF6F, 0x0155, 0xFF70, 0x0156, 0xFF71, 0x0157, 0xFF72, 0x0158,
+ 0xFF73, 0x0159, 0xFF74, 0x015A, 0xFF75, 0x015B, 0xFF76, 0x015C,
+ 0xFF77, 0x015D, 0xFF78, 0x015E, 0xFF79, 0x015F, 0xFF7A, 0x0160,
+ 0xFF7B, 0x0161, 0xFF7C, 0x0162, 0xFF7D, 0x0163, 0xFF7E, 0x0164,
+ 0xFF7F, 0x0165, 0xFF80, 0x0166, 0xFF81, 0x0167, 0xFF82, 0x0168,
+ 0xFF83, 0x0169, 0xFF84, 0x016A, 0xFF85, 0x016B, 0xFF86, 0x016C,
+ 0xFF87, 0x016D, 0xFF88, 0x016E, 0xFF89, 0x016F, 0xFF8A, 0x0170,
+ 0xFF8B, 0x0171, 0xFF8C, 0x0172, 0xFF8D, 0x0173, 0xFF8E, 0x0174,
+ 0xFF8F, 0x0175, 0xFF90, 0x0176, 0xFF91, 0x0177, 0xFF92, 0x0178,
+ 0xFF93, 0x0179, 0xFF94, 0x017A, 0xFF95, 0x017B, 0xFF96, 0x017C,
+ 0xFF97, 0x017D, 0xFF98, 0x017E, 0xFF99, 0x017F, 0xFF9A, 0x0180,
+ 0xFF9B, 0x0181, 0xFF9C, 0x0182, 0xFF9D, 0x0183, 0xFF9E, 0x0184,
+ 0xFF9F, 0x0185, 0xFFE0, 0x02C9, 0xFFE1, 0x02CA, 0xFFE2, 0x02EF,
+ 0xFFE3, 0x0289, 0xFFE4, 0x1F45, 0xFFE5, 0x02C7, 0xFFE8, 0x0143,
+};
diff --git a/core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UCS2-V_4.cpp b/core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UCS2-V_4.cpp
index 52f1008c83..916631b242 100644
--- a/core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UCS2-V_4.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UCS2-V_4.cpp
@@ -1,71 +1,71 @@
-// 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
-
-extern const unsigned short g_FXCMAP_UniJIS_UCS2_V_4[251 * 2] = {
- 0x00B0, 0x204D, 0x2010, 0x1ED5, 0x2015, 0x1ED4, 0x2016, 0x1ED7,
- 0x2018, 0x2059, 0x2019, 0x205A, 0x201C, 0x2057, 0x201D, 0x2058,
- 0x2025, 0x1EDA, 0x2026, 0x1ED9, 0x2032, 0x2051, 0x2033, 0x205B,
- 0x2190, 0x02E2, 0x2191, 0x02E0, 0x2192, 0x02E3, 0x2193, 0x02E1,
- 0x2195, 0x2FB6, 0x21C4, 0x2077, 0x21C5, 0x2076, 0x21C6, 0x2078,
- 0x21E6, 0x1F4C, 0x21E7, 0x1F4E, 0x21E8, 0x1F4B, 0x21E9, 0x1F4D,
- 0x2225, 0x1ED7, 0x223C, 0x1ED6, 0x22EF, 0x1ED9, 0x2500, 0x1D39,
- 0x2501, 0x1D3A, 0x2502, 0x1D37, 0x2503, 0x1D38, 0x2504, 0x1D3D,
- 0x2505, 0x1D3E, 0x2506, 0x1D3B, 0x2507, 0x1D3C, 0x2508, 0x1D41,
- 0x2509, 0x1D42, 0x250A, 0x1D3F, 0x250B, 0x1D40, 0x250C, 0x1D47,
- 0x250D, 0x1D49, 0x250E, 0x1D48, 0x250F, 0x1D4A, 0x2510, 0x1D4F,
- 0x2511, 0x1D51, 0x2512, 0x1D50, 0x2513, 0x1D52, 0x2514, 0x1D43,
- 0x2515, 0x1D45, 0x2516, 0x1D44, 0x2517, 0x1D46, 0x2518, 0x1D4B,
- 0x2519, 0x1D4D, 0x251A, 0x1D4C, 0x251B, 0x1D4E, 0x251C, 0x1D63,
- 0x251D, 0x1D67, 0x251E, 0x1D65, 0x251F, 0x1D64, 0x2520, 0x1D66,
- 0x2521, 0x1D69, 0x2522, 0x1D68, 0x2523, 0x1D6A, 0x2524, 0x1D6B,
- 0x2525, 0x1D6F, 0x2526, 0x1D6D, 0x2527, 0x1D6C, 0x2528, 0x1D6E,
- 0x2529, 0x1D71, 0x252A, 0x1D70, 0x252B, 0x1D72, 0x252C, 0x1D5B,
- 0x252D, 0x1D5D, 0x252E, 0x1D5E, 0x252F, 0x1D5F, 0x2530, 0x1D5C,
- 0x2531, 0x1D60, 0x2532, 0x1D61, 0x2533, 0x1D62, 0x2534, 0x1D53,
- 0x2535, 0x1D55, 0x2536, 0x1D56, 0x2537, 0x1D57, 0x2538, 0x1D54,
- 0x2539, 0x1D58, 0x253A, 0x1D59, 0x253B, 0x1D5A, 0x253D, 0x1D77,
- 0x253E, 0x1D78, 0x253F, 0x1D79, 0x2540, 0x1D75, 0x2541, 0x1D74,
- 0x2542, 0x1D76, 0x2543, 0x1D7B, 0x2544, 0x1D7D, 0x2545, 0x1D7A,
- 0x2546, 0x1D7C, 0x2547, 0x1D81, 0x2548, 0x1D80, 0x2549, 0x1D7E,
- 0x254A, 0x1D7F, 0x261C, 0x201D, 0x261D, 0x201B, 0x261E, 0x201E,
- 0x261F, 0x201C, 0x2702, 0x2F92, 0x27A1, 0x2011, 0x3001, 0x1ECF,
- 0x3002, 0x1ED0, 0x3008, 0x1EE3, 0x3009, 0x1EE4, 0x300A, 0x1EE5,
- 0x300B, 0x1EE6, 0x300C, 0x1EE7, 0x300D, 0x1EE8, 0x300E, 0x1EE9,
- 0x300F, 0x1EEA, 0x3010, 0x1EEB, 0x3011, 0x1EEC, 0x3013, 0x204E,
- 0x3014, 0x1EDD, 0x3015, 0x1EDE, 0x301C, 0x1ED6, 0x301D, 0x1F14,
- 0x301F, 0x1F15, 0x3041, 0x1EEE, 0x3043, 0x1EEF, 0x3045, 0x1EF0,
- 0x3047, 0x1EF1, 0x3049, 0x1EF2, 0x3063, 0x1EF3, 0x3083, 0x1EF4,
- 0x3085, 0x1EF5, 0x3087, 0x1EF6, 0x308E, 0x1EF7, 0x309B, 0x2050,
- 0x309C, 0x204F, 0x30A1, 0x1EF8, 0x30A3, 0x1EF9, 0x30A5, 0x1EFA,
- 0x30A7, 0x1EFB, 0x30A9, 0x1EFC, 0x30C3, 0x1EFD, 0x30E3, 0x1EFE,
- 0x30E5, 0x1EFF, 0x30E7, 0x1F00, 0x30EE, 0x1F01, 0x30F5, 0x1F02,
- 0x30F6, 0x1F03, 0x30FC, 0x1ED3, 0x3300, 0x209E, 0x3301, 0x2EB6,
- 0x3302, 0x2EB7, 0x3303, 0x2092, 0x3304, 0x2EB8, 0x3305, 0x208D,
- 0x3306, 0x2EB9, 0x3307, 0x2EBD, 0x3308, 0x2EBB, 0x3309, 0x2EC0,
- 0x330A, 0x2EBE, 0x330B, 0x2EC2, 0x330C, 0x2EC4, 0x330D, 0x1F0E,
- 0x330E, 0x2EC5, 0x330F, 0x2EC6, 0x3310, 0x2EC7, 0x3311, 0x2EC8,
- 0x3312, 0x2EC9, 0x3313, 0x2ECA, 0x3314, 0x1F05, 0x3315, 0x2094,
- 0x3316, 0x208A, 0x3317, 0x2ECC, 0x3318, 0x2093, 0x3319, 0x2ECE,
- 0x331A, 0x2ED0, 0x331B, 0x2ED1, 0x331C, 0x2ED2, 0x331D, 0x2ED3,
- 0x331E, 0x20A1, 0x331F, 0x2ED4, 0x3320, 0x2ED5, 0x3321, 0x2ED6,
- 0x3322, 0x2089, 0x3323, 0x209C, 0x3324, 0x2ED7, 0x3325, 0x2ED9,
- 0x3326, 0x1F0F, 0x3327, 0x1F09, 0x3328, 0x2EDC, 0x3329, 0x2EDD,
- 0x332A, 0x20A4, 0x332B, 0x1F11, 0x332D, 0x2EDF, 0x332E, 0x2EE2,
- 0x332F, 0x2EE3, 0x3330, 0x2EE4, 0x3331, 0x20A6, 0x3332, 0x2EE5,
- 0x3333, 0x208E, 0x3334, 0x2EE8, 0x3335, 0x2EE9, 0x3336, 0x1F0B,
- 0x3337, 0x2EEE, 0x3338, 0x2EF0, 0x3339, 0x2097, 0x333A, 0x2EF1,
- 0x333B, 0x209D, 0x333C, 0x2EEA, 0x333D, 0x2EF2, 0x333E, 0x2EF4,
- 0x333F, 0x2EF5, 0x3340, 0x2EF6, 0x3341, 0x2EF3, 0x3342, 0x209B,
- 0x3343, 0x2EF7, 0x3344, 0x2EF8, 0x3345, 0x2EF9, 0x3346, 0x2EFA,
- 0x3347, 0x20A5, 0x3348, 0x2EFB, 0x3349, 0x1F04, 0x334A, 0x1F12,
- 0x334B, 0x2EFC, 0x334C, 0x2EFD, 0x334D, 0x1F07, 0x334E, 0x2091,
- 0x334F, 0x2EFE, 0x3350, 0x2EFF, 0x3351, 0x1F0C, 0x3352, 0x2F02,
- 0x3353, 0x2F06, 0x3354, 0x2F03, 0x3355, 0x2F07, 0x3356, 0x2F08,
- 0x3357, 0x2098, 0x337F, 0x2084, 0xFF08, 0x1EDB, 0xFF09, 0x1EDC,
- 0xFF0C, 0x204C, 0xFF0E, 0x2052, 0xFF1D, 0x1EED, 0xFF3B, 0x1EDF,
- 0xFF3D, 0x1EE0, 0xFF3F, 0x1ED2, 0xFF5B, 0x1EE1, 0xFF5C, 0x1ED8,
- 0xFF5D, 0x1EE2, 0xFF5E, 0x1ED6, 0xFFE3, 0x1ED1,
-};
+// 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
+
+extern const unsigned short g_FXCMAP_UniJIS_UCS2_V_4[251 * 2] = {
+ 0x00B0, 0x204D, 0x2010, 0x1ED5, 0x2015, 0x1ED4, 0x2016, 0x1ED7,
+ 0x2018, 0x2059, 0x2019, 0x205A, 0x201C, 0x2057, 0x201D, 0x2058,
+ 0x2025, 0x1EDA, 0x2026, 0x1ED9, 0x2032, 0x2051, 0x2033, 0x205B,
+ 0x2190, 0x02E2, 0x2191, 0x02E0, 0x2192, 0x02E3, 0x2193, 0x02E1,
+ 0x2195, 0x2FB6, 0x21C4, 0x2077, 0x21C5, 0x2076, 0x21C6, 0x2078,
+ 0x21E6, 0x1F4C, 0x21E7, 0x1F4E, 0x21E8, 0x1F4B, 0x21E9, 0x1F4D,
+ 0x2225, 0x1ED7, 0x223C, 0x1ED6, 0x22EF, 0x1ED9, 0x2500, 0x1D39,
+ 0x2501, 0x1D3A, 0x2502, 0x1D37, 0x2503, 0x1D38, 0x2504, 0x1D3D,
+ 0x2505, 0x1D3E, 0x2506, 0x1D3B, 0x2507, 0x1D3C, 0x2508, 0x1D41,
+ 0x2509, 0x1D42, 0x250A, 0x1D3F, 0x250B, 0x1D40, 0x250C, 0x1D47,
+ 0x250D, 0x1D49, 0x250E, 0x1D48, 0x250F, 0x1D4A, 0x2510, 0x1D4F,
+ 0x2511, 0x1D51, 0x2512, 0x1D50, 0x2513, 0x1D52, 0x2514, 0x1D43,
+ 0x2515, 0x1D45, 0x2516, 0x1D44, 0x2517, 0x1D46, 0x2518, 0x1D4B,
+ 0x2519, 0x1D4D, 0x251A, 0x1D4C, 0x251B, 0x1D4E, 0x251C, 0x1D63,
+ 0x251D, 0x1D67, 0x251E, 0x1D65, 0x251F, 0x1D64, 0x2520, 0x1D66,
+ 0x2521, 0x1D69, 0x2522, 0x1D68, 0x2523, 0x1D6A, 0x2524, 0x1D6B,
+ 0x2525, 0x1D6F, 0x2526, 0x1D6D, 0x2527, 0x1D6C, 0x2528, 0x1D6E,
+ 0x2529, 0x1D71, 0x252A, 0x1D70, 0x252B, 0x1D72, 0x252C, 0x1D5B,
+ 0x252D, 0x1D5D, 0x252E, 0x1D5E, 0x252F, 0x1D5F, 0x2530, 0x1D5C,
+ 0x2531, 0x1D60, 0x2532, 0x1D61, 0x2533, 0x1D62, 0x2534, 0x1D53,
+ 0x2535, 0x1D55, 0x2536, 0x1D56, 0x2537, 0x1D57, 0x2538, 0x1D54,
+ 0x2539, 0x1D58, 0x253A, 0x1D59, 0x253B, 0x1D5A, 0x253D, 0x1D77,
+ 0x253E, 0x1D78, 0x253F, 0x1D79, 0x2540, 0x1D75, 0x2541, 0x1D74,
+ 0x2542, 0x1D76, 0x2543, 0x1D7B, 0x2544, 0x1D7D, 0x2545, 0x1D7A,
+ 0x2546, 0x1D7C, 0x2547, 0x1D81, 0x2548, 0x1D80, 0x2549, 0x1D7E,
+ 0x254A, 0x1D7F, 0x261C, 0x201D, 0x261D, 0x201B, 0x261E, 0x201E,
+ 0x261F, 0x201C, 0x2702, 0x2F92, 0x27A1, 0x2011, 0x3001, 0x1ECF,
+ 0x3002, 0x1ED0, 0x3008, 0x1EE3, 0x3009, 0x1EE4, 0x300A, 0x1EE5,
+ 0x300B, 0x1EE6, 0x300C, 0x1EE7, 0x300D, 0x1EE8, 0x300E, 0x1EE9,
+ 0x300F, 0x1EEA, 0x3010, 0x1EEB, 0x3011, 0x1EEC, 0x3013, 0x204E,
+ 0x3014, 0x1EDD, 0x3015, 0x1EDE, 0x301C, 0x1ED6, 0x301D, 0x1F14,
+ 0x301F, 0x1F15, 0x3041, 0x1EEE, 0x3043, 0x1EEF, 0x3045, 0x1EF0,
+ 0x3047, 0x1EF1, 0x3049, 0x1EF2, 0x3063, 0x1EF3, 0x3083, 0x1EF4,
+ 0x3085, 0x1EF5, 0x3087, 0x1EF6, 0x308E, 0x1EF7, 0x309B, 0x2050,
+ 0x309C, 0x204F, 0x30A1, 0x1EF8, 0x30A3, 0x1EF9, 0x30A5, 0x1EFA,
+ 0x30A7, 0x1EFB, 0x30A9, 0x1EFC, 0x30C3, 0x1EFD, 0x30E3, 0x1EFE,
+ 0x30E5, 0x1EFF, 0x30E7, 0x1F00, 0x30EE, 0x1F01, 0x30F5, 0x1F02,
+ 0x30F6, 0x1F03, 0x30FC, 0x1ED3, 0x3300, 0x209E, 0x3301, 0x2EB6,
+ 0x3302, 0x2EB7, 0x3303, 0x2092, 0x3304, 0x2EB8, 0x3305, 0x208D,
+ 0x3306, 0x2EB9, 0x3307, 0x2EBD, 0x3308, 0x2EBB, 0x3309, 0x2EC0,
+ 0x330A, 0x2EBE, 0x330B, 0x2EC2, 0x330C, 0x2EC4, 0x330D, 0x1F0E,
+ 0x330E, 0x2EC5, 0x330F, 0x2EC6, 0x3310, 0x2EC7, 0x3311, 0x2EC8,
+ 0x3312, 0x2EC9, 0x3313, 0x2ECA, 0x3314, 0x1F05, 0x3315, 0x2094,
+ 0x3316, 0x208A, 0x3317, 0x2ECC, 0x3318, 0x2093, 0x3319, 0x2ECE,
+ 0x331A, 0x2ED0, 0x331B, 0x2ED1, 0x331C, 0x2ED2, 0x331D, 0x2ED3,
+ 0x331E, 0x20A1, 0x331F, 0x2ED4, 0x3320, 0x2ED5, 0x3321, 0x2ED6,
+ 0x3322, 0x2089, 0x3323, 0x209C, 0x3324, 0x2ED7, 0x3325, 0x2ED9,
+ 0x3326, 0x1F0F, 0x3327, 0x1F09, 0x3328, 0x2EDC, 0x3329, 0x2EDD,
+ 0x332A, 0x20A4, 0x332B, 0x1F11, 0x332D, 0x2EDF, 0x332E, 0x2EE2,
+ 0x332F, 0x2EE3, 0x3330, 0x2EE4, 0x3331, 0x20A6, 0x3332, 0x2EE5,
+ 0x3333, 0x208E, 0x3334, 0x2EE8, 0x3335, 0x2EE9, 0x3336, 0x1F0B,
+ 0x3337, 0x2EEE, 0x3338, 0x2EF0, 0x3339, 0x2097, 0x333A, 0x2EF1,
+ 0x333B, 0x209D, 0x333C, 0x2EEA, 0x333D, 0x2EF2, 0x333E, 0x2EF4,
+ 0x333F, 0x2EF5, 0x3340, 0x2EF6, 0x3341, 0x2EF3, 0x3342, 0x209B,
+ 0x3343, 0x2EF7, 0x3344, 0x2EF8, 0x3345, 0x2EF9, 0x3346, 0x2EFA,
+ 0x3347, 0x20A5, 0x3348, 0x2EFB, 0x3349, 0x1F04, 0x334A, 0x1F12,
+ 0x334B, 0x2EFC, 0x334C, 0x2EFD, 0x334D, 0x1F07, 0x334E, 0x2091,
+ 0x334F, 0x2EFE, 0x3350, 0x2EFF, 0x3351, 0x1F0C, 0x3352, 0x2F02,
+ 0x3353, 0x2F06, 0x3354, 0x2F03, 0x3355, 0x2F07, 0x3356, 0x2F08,
+ 0x3357, 0x2098, 0x337F, 0x2084, 0xFF08, 0x1EDB, 0xFF09, 0x1EDC,
+ 0xFF0C, 0x204C, 0xFF0E, 0x2052, 0xFF1D, 0x1EED, 0xFF3B, 0x1EDF,
+ 0xFF3D, 0x1EE0, 0xFF3F, 0x1ED2, 0xFF5B, 0x1EE1, 0xFF5C, 0x1ED8,
+ 0xFF5D, 0x1EE2, 0xFF5E, 0x1ED6, 0xFFE3, 0x1ED1,
+};
diff --git a/core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UTF16-H_5.cpp b/core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UTF16-H_5.cpp
index 1cc2312a13..5c22d995e6 100644
--- a/core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UTF16-H_5.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UTF16-H_5.cpp
@@ -1,3449 +1,3449 @@
-// 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
-
-extern const unsigned short g_FXCMAP_UniJIS_UTF16_H_5[13241 * 2] = {
- 0x0020, 0x0001, 0x0021, 0x0002, 0x0022, 0x0003, 0x0023, 0x0004,
- 0x0024, 0x0005, 0x0025, 0x0006, 0x0026, 0x0007, 0x0027, 0x0008,
- 0x0028, 0x0009, 0x0029, 0x000A, 0x002A, 0x000B, 0x002B, 0x000C,
- 0x002C, 0x000D, 0x002D, 0x000E, 0x002E, 0x000F, 0x002F, 0x0010,
- 0x0030, 0x0011, 0x0031, 0x0012, 0x0032, 0x0013, 0x0033, 0x0014,
- 0x0034, 0x0015, 0x0035, 0x0016, 0x0036, 0x0017, 0x0037, 0x0018,
- 0x0038, 0x0019, 0x0039, 0x001A, 0x003A, 0x001B, 0x003B, 0x001C,
- 0x003C, 0x001D, 0x003D, 0x001E, 0x003E, 0x001F, 0x003F, 0x0020,
- 0x0040, 0x0021, 0x0041, 0x0022, 0x0042, 0x0023, 0x0043, 0x0024,
- 0x0044, 0x0025, 0x0045, 0x0026, 0x0046, 0x0027, 0x0047, 0x0028,
- 0x0048, 0x0029, 0x0049, 0x002A, 0x004A, 0x002B, 0x004B, 0x002C,
- 0x004C, 0x002D, 0x004D, 0x002E, 0x004E, 0x002F, 0x004F, 0x0030,
- 0x0050, 0x0031, 0x0051, 0x0032, 0x0052, 0x0033, 0x0053, 0x0034,
- 0x0054, 0x0035, 0x0055, 0x0036, 0x0056, 0x0037, 0x0057, 0x0038,
- 0x0058, 0x0039, 0x0059, 0x003A, 0x005A, 0x003B, 0x005B, 0x003C,
- 0x005C, 0x0061, 0x005D, 0x003E, 0x005E, 0x003F, 0x005F, 0x0040,
- 0x0060, 0x0041, 0x0061, 0x0042, 0x0062, 0x0043, 0x0063, 0x0044,
- 0x0064, 0x0045, 0x0065, 0x0046, 0x0066, 0x0047, 0x0067, 0x0048,
- 0x0068, 0x0049, 0x0069, 0x004A, 0x006A, 0x004B, 0x006B, 0x004C,
- 0x006C, 0x004D, 0x006D, 0x004E, 0x006E, 0x004F, 0x006F, 0x0050,
- 0x0070, 0x0051, 0x0071, 0x0052, 0x0072, 0x0053, 0x0073, 0x0054,
- 0x0074, 0x0055, 0x0075, 0x0056, 0x0076, 0x0057, 0x0077, 0x0058,
- 0x0078, 0x0059, 0x0079, 0x005A, 0x007A, 0x005B, 0x007B, 0x005C,
- 0x007C, 0x0063, 0x007D, 0x005E, 0x007E, 0x0064, 0x00A0, 0x0001,
- 0x00A1, 0x0065, 0x00A2, 0x0066, 0x00A3, 0x0067, 0x00A4, 0x006B,
- 0x00A5, 0x003D, 0x00A6, 0x005D, 0x00A7, 0x02D0, 0x00A8, 0x0287,
- 0x00A9, 0x0098, 0x00AA, 0x008C, 0x00AB, 0x006D, 0x00AC, 0x0099,
- 0x00AD, 0x0097, 0x00AE, 0x009A, 0x00AF, 0x0081, 0x00B0, 0x02C3,
- 0x00B1, 0x02B6, 0x00B2, 0x009D, 0x00B3, 0x009E, 0x00B4, 0x0285,
- 0x00B5, 0x009F, 0x00B6, 0x030A, 0x00B7, 0x0075, 0x00B8, 0x0086,
- 0x00B9, 0x00A0, 0x00BA, 0x0090, 0x00BB, 0x007B, 0x00BC, 0x00A1,
- 0x00BD, 0x00A2, 0x00BE, 0x00A3, 0x00BF, 0x007E, 0x00C0, 0x00A4,
- 0x00C1, 0x00A5, 0x00C2, 0x00A6, 0x00C3, 0x00A7, 0x00C4, 0x00A8,
- 0x00C5, 0x00A9, 0x00C6, 0x008B, 0x00C7, 0x00AA, 0x00C8, 0x00AB,
- 0x00C9, 0x00AC, 0x00CA, 0x00AD, 0x00CB, 0x00AE, 0x00CC, 0x00AF,
- 0x00CD, 0x00B0, 0x00CE, 0x00B1, 0x00CF, 0x00B2, 0x00D0, 0x00B3,
- 0x00D1, 0x00B4, 0x00D2, 0x00B5, 0x00D3, 0x00B6, 0x00D4, 0x00B7,
- 0x00D5, 0x00B8, 0x00D6, 0x00B9, 0x00D7, 0x02B7, 0x00D8, 0x008E,
- 0x00D9, 0x00BB, 0x00DA, 0x00BC, 0x00DB, 0x00BD, 0x00DC, 0x00BE,
- 0x00DD, 0x00BF, 0x00DE, 0x00C0, 0x00DF, 0x0096, 0x00E0, 0x00C1,
- 0x00E1, 0x00C2, 0x00E2, 0x00C3, 0x00E3, 0x00C4, 0x00E4, 0x00C5,
- 0x00E5, 0x00C6, 0x00E6, 0x0091, 0x00E7, 0x00C7, 0x00E8, 0x00C8,
- 0x00E9, 0x00C9, 0x00EA, 0x00CA, 0x00EB, 0x00CB, 0x00EC, 0x00CC,
- 0x00ED, 0x00CD, 0x00EE, 0x00CE, 0x00EF, 0x00CF, 0x00F0, 0x00D0,
- 0x00F1, 0x00D1, 0x00F2, 0x00D2, 0x00F3, 0x00D3, 0x00F4, 0x00D4,
- 0x00F5, 0x00D5, 0x00F6, 0x00D6, 0x00F7, 0x02B8, 0x00F8, 0x0094,
- 0x00F9, 0x00D8, 0x00FA, 0x00D9, 0x00FB, 0x00DA, 0x00FC, 0x00DB,
- 0x00FD, 0x00DC, 0x00FE, 0x00DD, 0x00FF, 0x00DE, 0x0100, 0x2496,
- 0x0101, 0x2491, 0x0102, 0x3D8C, 0x0103, 0x3D99, 0x0104, 0x3D79,
- 0x0105, 0x3D81, 0x0106, 0x3D8E, 0x0107, 0x3D9B, 0x0108, 0x3DA7,
- 0x0109, 0x3DAD, 0x010C, 0x3D8F, 0x010D, 0x3D9C, 0x010E, 0x3D91,
- 0x010F, 0x3D9E, 0x0111, 0x3D9F, 0x0112, 0x2499, 0x0113, 0x2494,
- 0x0118, 0x3D90, 0x0119, 0x3D9D, 0x011A, 0x24B3, 0x011B, 0x24BF,
- 0x011C, 0x3DA8, 0x011D, 0x3DAE, 0x0124, 0x3DA9, 0x0125, 0x3DAF,
- 0x0127, 0x3DC8, 0x0128, 0x24B8, 0x0129, 0x24C4, 0x012A, 0x2497,
- 0x012B, 0x2492, 0x0131, 0x0092, 0x0134, 0x3DAA, 0x0135, 0x3DB0,
- 0x0139, 0x3D8D, 0x013A, 0x3D9A, 0x013D, 0x3D7B, 0x013E, 0x3D83,
- 0x0141, 0x008D, 0x0142, 0x0093, 0x0143, 0x3D92, 0x0144, 0x3DA0,
- 0x0147, 0x3D93, 0x0148, 0x3DA1, 0x014B, 0x24DC, 0x014C, 0x249A,
- 0x014D, 0x2495, 0x0150, 0x3D94, 0x0151, 0x3DA2, 0x0152, 0x008F,
- 0x0153, 0x0095, 0x0154, 0x3D8B, 0x0155, 0x3D98, 0x0158, 0x3D95,
- 0x0159, 0x3DA3, 0x015A, 0x3D7C, 0x015B, 0x3D84, 0x015C, 0x3DAB,
- 0x015D, 0x3DB1, 0x015E, 0x3D7D, 0x015F, 0x3D86, 0x0160, 0x00DF,
- 0x0161, 0x00E3, 0x0162, 0x3D97, 0x0163, 0x3DA5, 0x0164, 0x3D7E,
- 0x0165, 0x3D87, 0x0168, 0x24BD, 0x0169, 0x24C9, 0x016A, 0x2498,
- 0x016B, 0x2493, 0x016C, 0x3DAC, 0x016D, 0x3DB2, 0x016E, 0x24BC,
- 0x016F, 0x24C8, 0x0170, 0x3D96, 0x0171, 0x3DA4, 0x0178, 0x00E0,
- 0x0179, 0x3D7F, 0x017A, 0x3D88, 0x017B, 0x3D80, 0x017C, 0x3D8A,
- 0x017D, 0x00E1, 0x017E, 0x00E5, 0x0192, 0x0069, 0x0193, 0x3DD2,
- 0x01C2, 0x3DCD, 0x01CD, 0x24B2, 0x01CE, 0x24BE, 0x01CF, 0x24B6,
- 0x01D0, 0x24C2, 0x01D1, 0x24B9, 0x01D2, 0x24C5, 0x01D3, 0x24BB,
- 0x01D4, 0x24C7, 0x01D6, 0x3D75, 0x01D8, 0x3D76, 0x01DA, 0x3D77,
- 0x01DC, 0x3D78, 0x01F8, 0x3D73, 0x01F9, 0x3D74, 0x01FD, 0x24CD,
- 0x0250, 0x3DD8, 0x0251, 0x24CA, 0x0252, 0x3DDC, 0x0253, 0x3DCE,
- 0x0254, 0x24CF, 0x0255, 0x3DE1, 0x0256, 0x3DBA, 0x0257, 0x3DCF,
- 0x0258, 0x3DD5, 0x0259, 0x24D2, 0x025A, 0x24D5, 0x025B, 0x24D8,
- 0x025C, 0x3DD6, 0x025E, 0x3DD7, 0x025F, 0x3DC1, 0x0260, 0x3DD1,
- 0x0261, 0x3DC5, 0x0262, 0x3E0B, 0x0263, 0x3E0C, 0x0264, 0x3DDB,
- 0x0265, 0x3DDE, 0x0266, 0x3DCB, 0x0267, 0x3DE4, 0x0268, 0x3DD3,
- 0x026A, 0x3E0D, 0x026C, 0x3DB6, 0x026D, 0x3DC0, 0x026E, 0x3DB7,
- 0x026F, 0x3DD9, 0x0270, 0x3DC6, 0x0271, 0x3DB3, 0x0272, 0x3DC2,
- 0x0273, 0x3DBB, 0x0274, 0x3E0E, 0x0275, 0x24DD, 0x0276, 0x3E0F,
- 0x0278, 0x3E10, 0x0279, 0x3DB8, 0x027A, 0x3DE3, 0x027B, 0x3DBF,
- 0x027D, 0x3DBC, 0x027E, 0x3DB5, 0x0280, 0x3E11, 0x0281, 0x3DC7,
- 0x0282, 0x3DBD, 0x0283, 0x24E2, 0x0284, 0x3DD0, 0x0288, 0x3DB9,
- 0x0289, 0x3DD4, 0x028A, 0x3DDA, 0x028B, 0x3DB4, 0x028C, 0x24DE,
- 0x028D, 0x3DDD, 0x028E, 0x3DC4, 0x028F, 0x3E12, 0x0290, 0x3DBE,
- 0x0291, 0x3DE2, 0x0292, 0x24E1, 0x0294, 0x3DCA, 0x0295, 0x3DC9,
- 0x0298, 0x3DCC, 0x0299, 0x3E13, 0x029C, 0x3E14, 0x029D, 0x3DC3,
- 0x029F, 0x3E15, 0x02A1, 0x3DE0, 0x02A2, 0x3DDF, 0x02B0, 0x3E16,
- 0x02B2, 0x3E17, 0x02B7, 0x3E18, 0x02BB, 0x0062, 0x02BC, 0x0060,
- 0x02C1, 0x3E19, 0x02C6, 0x0080, 0x02C7, 0x3D85, 0x02C8, 0x3DE6,
- 0x02CC, 0x3DE7, 0x02D0, 0x24E3, 0x02D1, 0x3DE8, 0x02D8, 0x3D7A,
- 0x02D9, 0x3DA6, 0x02DA, 0x0085, 0x02DB, 0x3D82, 0x02DC, 0x005F,
- 0x02DD, 0x3D89, 0x02DE, 0x3DFB, 0x02E0, 0x3E1A, 0x02E1, 0x3E1B,
- 0x02E5, 0x3DEB, 0x02E6, 0x3DEC, 0x02E7, 0x3DED, 0x02E8, 0x3DEE,
- 0x02E9, 0x3DEF, 0x0300, 0x0041, 0x0301, 0x007F, 0x0302, 0x0080,
- 0x0303, 0x005F, 0x0304, 0x0081, 0x0305, 0x00E2, 0x0306, 0x0082,
- 0x0307, 0x0083, 0x0308, 0x0084, 0x030A, 0x0085, 0x030B, 0x0087,
- 0x030C, 0x0089, 0x030F, 0x3DEA, 0x0318, 0x3E02, 0x0319, 0x3E03,
- 0x031A, 0x3E07, 0x031C, 0x3DF5, 0x031D, 0x3E00, 0x031E, 0x3E01,
- 0x031F, 0x3DF6, 0x0320, 0x3DF7, 0x0324, 0x3DFC, 0x0325, 0x3DF2,
- 0x0327, 0x0086, 0x0328, 0x0088, 0x0329, 0x3DF9, 0x032A, 0x3E04,
- 0x032C, 0x3DF3, 0x032F, 0x3DFA, 0x0330, 0x3DFD, 0x0332, 0x0040,
- 0x0334, 0x3DFF, 0x0336, 0x008A, 0x0339, 0x3DF4, 0x033A, 0x3E05,
- 0x033B, 0x3E06, 0x033C, 0x3DFE, 0x033D, 0x3DF8, 0x0361, 0x3DE5,
- 0x0391, 0x03F3, 0x0392, 0x03F4, 0x0393, 0x03F5, 0x0394, 0x03F6,
- 0x0395, 0x03F7, 0x0396, 0x03F8, 0x0397, 0x03F9, 0x0398, 0x03FA,
- 0x0399, 0x03FB, 0x039A, 0x03FC, 0x039B, 0x03FD, 0x039C, 0x03FE,
- 0x039D, 0x03FF, 0x039E, 0x0400, 0x039F, 0x0401, 0x03A0, 0x0402,
- 0x03A1, 0x0403, 0x03A3, 0x0404, 0x03A4, 0x0405, 0x03A5, 0x0406,
- 0x03A6, 0x0407, 0x03A7, 0x0408, 0x03A8, 0x0409, 0x03A9, 0x040A,
- 0x03B1, 0x040B, 0x03B2, 0x040C, 0x03B3, 0x040D, 0x03B4, 0x040E,
- 0x03B5, 0x040F, 0x03B6, 0x0410, 0x03B7, 0x0411, 0x03B8, 0x0412,
- 0x03B9, 0x0413, 0x03BA, 0x0414, 0x03BB, 0x0415, 0x03BC, 0x0416,
- 0x03BD, 0x0417, 0x03BE, 0x0418, 0x03BF, 0x0419, 0x03C0, 0x041A,
- 0x03C1, 0x041B, 0x03C2, 0x3F5E, 0x03C3, 0x041C, 0x03C4, 0x041D,
- 0x03C5, 0x041E, 0x03C6, 0x041F, 0x03C7, 0x0420, 0x03C8, 0x0421,
- 0x03C9, 0x0422, 0x03D0, 0x2F3A, 0x03D1, 0x2F40, 0x03D5, 0x2F3E,
- 0x03DB, 0x2F3F, 0x0401, 0x0429, 0x0410, 0x0423, 0x0411, 0x0424,
- 0x0412, 0x0425, 0x0413, 0x0426, 0x0414, 0x0427, 0x0415, 0x0428,
- 0x0416, 0x042A, 0x0417, 0x042B, 0x0418, 0x042C, 0x0419, 0x042D,
- 0x041A, 0x042E, 0x041B, 0x042F, 0x041C, 0x0430, 0x041D, 0x0431,
- 0x041E, 0x0432, 0x041F, 0x0433, 0x0420, 0x0434, 0x0421, 0x0435,
- 0x0422, 0x0436, 0x0423, 0x0437, 0x0424, 0x0438, 0x0425, 0x0439,
- 0x0426, 0x043A, 0x0427, 0x043B, 0x0428, 0x043C, 0x0429, 0x043D,
- 0x042A, 0x043E, 0x042B, 0x043F, 0x042C, 0x0440, 0x042D, 0x0441,
- 0x042E, 0x0442, 0x042F, 0x0443, 0x0430, 0x0444, 0x0431, 0x0445,
- 0x0432, 0x0446, 0x0433, 0x0447, 0x0434, 0x0448, 0x0435, 0x0449,
- 0x0436, 0x044B, 0x0437, 0x044C, 0x0438, 0x044D, 0x0439, 0x044E,
- 0x043A, 0x044F, 0x043B, 0x0450, 0x043C, 0x0451, 0x043D, 0x0452,
- 0x043E, 0x0453, 0x043F, 0x0454, 0x0440, 0x0455, 0x0441, 0x0456,
- 0x0442, 0x0457, 0x0443, 0x0458, 0x0444, 0x0459, 0x0445, 0x045A,
- 0x0446, 0x045B, 0x0447, 0x045C, 0x0448, 0x045D, 0x0449, 0x045E,
- 0x044A, 0x045F, 0x044B, 0x0460, 0x044C, 0x0461, 0x044D, 0x0462,
- 0x044E, 0x0463, 0x044F, 0x0464, 0x0451, 0x044A, 0x1E3E, 0x3D71,
- 0x1E3F, 0x3D72, 0x1EBC, 0x24B5, 0x1EBD, 0x24C1, 0x1F70, 0x24CC,
- 0x1F71, 0x24CB, 0x1F72, 0x24DA, 0x1F73, 0x24D9, 0x2002, 0x00E7,
- 0x2003, 0x0279, 0x2010, 0x0296, 0x2011, 0x000E, 0x2012, 0x0072,
- 0x2013, 0x0072, 0x2014, 0x008A, 0x2015, 0x0295, 0x2016, 0x029A,
- 0x2018, 0x0062, 0x2019, 0x0060, 0x201A, 0x0078, 0x201C, 0x006C,
- 0x201D, 0x007A, 0x201E, 0x0079, 0x2020, 0x0308, 0x2021, 0x0309,
- 0x2022, 0x0077, 0x2025, 0x029D, 0x2026, 0x029C, 0x2030, 0x0304,
- 0x2032, 0x02C4, 0x2033, 0x02C5, 0x2039, 0x006E, 0x203A, 0x006F,
- 0x203B, 0x02DE, 0x203C, 0x2F4F, 0x203E, 0x00E2, 0x203F, 0x3DE9,
- 0x2042, 0x3F9A, 0x2044, 0x0068, 0x2047, 0x3F96, 0x2048, 0x3F97,
- 0x2049, 0x2F50, 0x2051, 0x3F99, 0x2070, 0x24A1, 0x2074, 0x24A2,
- 0x2075, 0x24A3, 0x2076, 0x24A4, 0x2077, 0x24A5, 0x2078, 0x24A6,
- 0x2079, 0x24A7, 0x2080, 0x24A8, 0x2081, 0x24A9, 0x2082, 0x24AA,
- 0x2083, 0x24AB, 0x2084, 0x24AC, 0x2085, 0x24AD, 0x2086, 0x24AE,
- 0x2087, 0x24AF, 0x2088, 0x24B0, 0x2089, 0x24B1, 0x20AC, 0x248A,
- 0x20DD, 0x3FC8, 0x20DE, 0x2B1B, 0x2100, 0x2E4F, 0x2103, 0x02C6,
- 0x2105, 0x2E53, 0x2109, 0x2071, 0x210A, 0x2070, 0x210F, 0x2F3C,
- 0x2113, 0x1F59, 0x2116, 0x1DBA, 0x2121, 0x1F77, 0x2122, 0x00E4,
- 0x2126, 0x248B, 0x2127, 0x3C9B, 0x212B, 0x0303, 0x2135, 0x2F39,
- 0x213B, 0x2073, 0x2153, 0x249F, 0x2154, 0x24A0, 0x2155, 0x3D6F,
- 0x2156, 0x2639, 0x2157, 0x263A, 0x2158, 0x263B, 0x2159, 0x263C,
- 0x215A, 0x263D, 0x215B, 0x249B, 0x215C, 0x249C, 0x215D, 0x249D,
- 0x215E, 0x249E, 0x2160, 0x1D97, 0x2161, 0x1D98, 0x2162, 0x1D99,
- 0x2163, 0x1D9A, 0x2164, 0x1D9B, 0x2165, 0x1D9C, 0x2166, 0x1D9D,
- 0x2167, 0x1D9E, 0x2168, 0x1D9F, 0x2169, 0x1DA0, 0x216A, 0x2021,
- 0x216B, 0x2022, 0x2170, 0x1F9C, 0x2171, 0x1F9D, 0x2172, 0x1F9E,
- 0x2173, 0x1F9F, 0x2174, 0x1FA0, 0x2175, 0x1FA1, 0x2176, 0x1FA2,
- 0x2177, 0x1FA3, 0x2178, 0x1FA4, 0x2179, 0x1FA5, 0x217A, 0x206A,
- 0x217B, 0x206B, 0x217F, 0x206F, 0x2190, 0x02E1, 0x2191, 0x02E2,
- 0x2192, 0x02E0, 0x2193, 0x02E3, 0x2194, 0x2FA9, 0x2196, 0x2FAC,
- 0x2197, 0x2FAD, 0x2198, 0x2FAA, 0x2199, 0x2FAB, 0x21C4, 0x2076,
- 0x21C5, 0x2077, 0x21C6, 0x2075, 0x21CB, 0x2FAF, 0x21CC, 0x2FAE,
- 0x21D0, 0x2FA8, 0x21D2, 0x02F0, 0x21D4, 0x02F1, 0x21E6, 0x1F4D,
- 0x21E7, 0x1F4C, 0x21E8, 0x1F4E, 0x21E9, 0x1F4B, 0x2200, 0x02F2,
- 0x2202, 0x02F7, 0x2203, 0x02F3, 0x2205, 0x2F98, 0x2207, 0x02F8,
- 0x2208, 0x02E5, 0x2209, 0x3C74, 0x220A, 0x2F3B, 0x220B, 0x02E6,
- 0x2211, 0x1DC9, 0x2212, 0x02B5, 0x2213, 0x2F56, 0x2219, 0x0075,
- 0x221A, 0x02FD, 0x221D, 0x02FF, 0x221E, 0x02BF, 0x221F, 0x1DCD,
- 0x2220, 0x02F4, 0x2225, 0x3C81, 0x2226, 0x3C82, 0x2227, 0x02ED,
- 0x2228, 0x02EE, 0x2229, 0x02EC, 0x222A, 0x02EB, 0x222B, 0x0301,
- 0x222C, 0x0302, 0x222D, 0x2003, 0x222E, 0x1DC8, 0x2234, 0x02C0,
- 0x2235, 0x0300, 0x223C, 0x0064, 0x223D, 0x02FE, 0x2243, 0x2F58,
- 0x2245, 0x3C93, 0x2248, 0x3C94, 0x2252, 0x02FA, 0x2260, 0x02BA,
- 0x2261, 0x02F9, 0x2262, 0x3C91, 0x2266, 0x02BD, 0x2267, 0x02BE,
- 0x226A, 0x02FB, 0x226B, 0x02FC, 0x2272, 0x2F59, 0x2273, 0x2F5A,
- 0x2276, 0x3C95, 0x2277, 0x3C96, 0x2282, 0x02E9, 0x2283, 0x02EA,
- 0x2284, 0x3C70, 0x2285, 0x3C71, 0x2286, 0x02E7, 0x2287, 0x02E8,
- 0x228A, 0x3C72, 0x228B, 0x3C73, 0x2295, 0x2F9C, 0x2296, 0x2F9A,
- 0x2297, 0x2F9D, 0x2298, 0x2F9B, 0x229E, 0x3E22, 0x22A0, 0x2F99,
- 0x22A5, 0x02F5, 0x22BF, 0x1DCE, 0x22DA, 0x3D6D, 0x22DB, 0x3D6E,
- 0x2305, 0x3C76, 0x2306, 0x3C77, 0x2307, 0x2FBB, 0x2312, 0x02F6,
- 0x2318, 0x3D70, 0x239B, 0x2F6F, 0x239C, 0x2F87, 0x239D, 0x2F70,
- 0x239E, 0x2F71, 0x239F, 0x2F87, 0x23A0, 0x2F72, 0x23A1, 0x2F77,
- 0x23A2, 0x2F87, 0x23A3, 0x2F78, 0x23A4, 0x2F79, 0x23A5, 0x2F87,
- 0x23A6, 0x2F7A, 0x23A7, 0x1FF2, 0x23A8, 0x1FF3, 0x23A9, 0x1FF4,
- 0x23AA, 0x2F87, 0x23AB, 0x1FEE, 0x23AC, 0x1FEF, 0x23AD, 0x1FF0,
- 0x23B0, 0x3FB8, 0x23B1, 0x3FB9, 0x23BE, 0x3F7D, 0x23BF, 0x3F7E,
- 0x23C0, 0x3F7F, 0x23C1, 0x3F80, 0x23C2, 0x3F81, 0x23C3, 0x3F82,
- 0x23C4, 0x3F83, 0x23C5, 0x3F84, 0x23C6, 0x3F85, 0x23C7, 0x3F86,
- 0x23C8, 0x3F87, 0x23C9, 0x3F88, 0x23CA, 0x3F89, 0x23CB, 0x3F8A,
- 0x23CC, 0x3F8B, 0x23CE, 0x3F91, 0x2423, 0x3F90, 0x2460, 0x1D83,
- 0x2461, 0x1D84, 0x2462, 0x1D85, 0x2463, 0x1D86, 0x2464, 0x1D87,
- 0x2465, 0x1D88, 0x2466, 0x1D89, 0x2467, 0x1D8A, 0x2468, 0x1D8B,
- 0x2469, 0x1D8C, 0x246A, 0x1D8D, 0x246B, 0x1D8E, 0x246C, 0x1D8F,
- 0x246D, 0x1D90, 0x246E, 0x1D91, 0x246F, 0x1D92, 0x2470, 0x1D93,
- 0x2471, 0x1D94, 0x2472, 0x1D95, 0x2473, 0x1D96, 0x2474, 0x1F87,
- 0x2475, 0x1F88, 0x2476, 0x1F89, 0x2477, 0x1F8A, 0x2478, 0x1F8B,
- 0x2479, 0x1F8C, 0x247A, 0x1F8D, 0x247B, 0x1F8E, 0x247C, 0x1F8F,
- 0x247D, 0x1F90, 0x247E, 0x1F91, 0x247F, 0x1F92, 0x2480, 0x1F93,
- 0x2481, 0x1F94, 0x2482, 0x1F95, 0x2483, 0x1F96, 0x2484, 0x1F97,
- 0x2485, 0x1F98, 0x2486, 0x1F99, 0x2487, 0x1F9A, 0x2488, 0x1F7E,
- 0x2489, 0x1F7F, 0x248A, 0x1F80, 0x248B, 0x1F81, 0x248C, 0x1F82,
- 0x248D, 0x1F83, 0x248E, 0x1F84, 0x248F, 0x1F85, 0x2490, 0x1F86,
- 0x249C, 0x1FB0, 0x249D, 0x1FB1, 0x249E, 0x1FB2, 0x249F, 0x1FB3,
- 0x24A0, 0x1FB4, 0x24A1, 0x1FB5, 0x24A2, 0x1FB6, 0x24A3, 0x1FB7,
- 0x24A4, 0x1FB8, 0x24A5, 0x1FB9, 0x24A6, 0x1FBA, 0x24A7, 0x1FBB,
- 0x24A8, 0x1FBC, 0x24A9, 0x1FBD, 0x24AA, 0x1FBE, 0x24AB, 0x1FBF,
- 0x24AC, 0x1FC0, 0x24AD, 0x1FC1, 0x24AE, 0x1FC2, 0x24AF, 0x1FC3,
- 0x24B0, 0x1FC4, 0x24B1, 0x1FC5, 0x24B2, 0x1FC6, 0x24B3, 0x1FC7,
- 0x24B4, 0x1FC8, 0x24B5, 0x1FC9, 0x24B6, 0x2863, 0x24B7, 0x2864,
- 0x24B8, 0x2865, 0x24B9, 0x2866, 0x24BA, 0x2867, 0x24BB, 0x2868,
- 0x24BC, 0x2869, 0x24BD, 0x286A, 0x24BE, 0x286B, 0x24BF, 0x286C,
- 0x24C0, 0x286D, 0x24C1, 0x286E, 0x24C2, 0x286F, 0x24C3, 0x2870,
- 0x24C4, 0x2871, 0x24C5, 0x2872, 0x24C6, 0x2873, 0x24C7, 0x2874,
- 0x24C8, 0x2875, 0x24C9, 0x2876, 0x24CA, 0x2877, 0x24CB, 0x2878,
- 0x24CC, 0x2879, 0x24CD, 0x287A, 0x24CE, 0x287B, 0x24CF, 0x287C,
- 0x24D0, 0x2849, 0x24D1, 0x284A, 0x24D2, 0x284B, 0x24D3, 0x284C,
- 0x24D4, 0x284D, 0x24D5, 0x284E, 0x24D6, 0x284F, 0x24D7, 0x2850,
- 0x24D8, 0x2851, 0x24D9, 0x2852, 0x24DA, 0x2853, 0x24DB, 0x2854,
- 0x24DC, 0x2855, 0x24DD, 0x2856, 0x24DE, 0x2857, 0x24DF, 0x2858,
- 0x24E0, 0x2859, 0x24E1, 0x285A, 0x24E2, 0x285B, 0x24E3, 0x285C,
- 0x24E4, 0x285D, 0x24E5, 0x285E, 0x24E6, 0x285F, 0x24E7, 0x2860,
- 0x24E8, 0x2861, 0x24E9, 0x2862, 0x24EA, 0x2020, 0x24EB, 0x2913,
- 0x24EC, 0x2914, 0x24ED, 0x2915, 0x24EE, 0x2916, 0x24EF, 0x2917,
- 0x24F0, 0x2918, 0x24F1, 0x2919, 0x24F2, 0x291A, 0x24F3, 0x291B,
- 0x24F4, 0x291C, 0x24F5, 0x3F5F, 0x24F6, 0x3F60, 0x24F7, 0x3F61,
- 0x24F8, 0x3F62, 0x24F9, 0x3F63, 0x24FA, 0x3F64, 0x24FB, 0x3F65,
- 0x24FC, 0x3F66, 0x24FD, 0x3F67, 0x24FE, 0x3F68, 0x24FF, 0x2907,
- 0x2500, 0x1D37, 0x2501, 0x1D38, 0x2502, 0x1D39, 0x2503, 0x1D3A,
- 0x2504, 0x1D3B, 0x2505, 0x1D3C, 0x2506, 0x1D3D, 0x2507, 0x1D3E,
- 0x2508, 0x1D3F, 0x2509, 0x1D40, 0x250A, 0x1D41, 0x250B, 0x1D42,
- 0x250C, 0x1D43, 0x250D, 0x1D44, 0x250E, 0x1D45, 0x250F, 0x1D46,
- 0x2510, 0x1D47, 0x2511, 0x1D48, 0x2512, 0x1D49, 0x2513, 0x1D4A,
- 0x2514, 0x1D4B, 0x2515, 0x1D4C, 0x2516, 0x1D4D, 0x2517, 0x1D4E,
- 0x2518, 0x1D4F, 0x2519, 0x1D50, 0x251A, 0x1D51, 0x251B, 0x1D52,
- 0x251C, 0x1D53, 0x251D, 0x1D54, 0x251E, 0x1D55, 0x251F, 0x1D56,
- 0x2520, 0x1D57, 0x2521, 0x1D58, 0x2522, 0x1D59, 0x2523, 0x1D5A,
- 0x2524, 0x1D5B, 0x2525, 0x1D5C, 0x2526, 0x1D5D, 0x2527, 0x1D5E,
- 0x2528, 0x1D5F, 0x2529, 0x1D60, 0x252A, 0x1D61, 0x252B, 0x1D62,
- 0x252C, 0x1D63, 0x252D, 0x1D64, 0x252E, 0x1D65, 0x252F, 0x1D66,
- 0x2530, 0x1D67, 0x2531, 0x1D68, 0x2532, 0x1D69, 0x2533, 0x1D6A,
- 0x2534, 0x1D6B, 0x2535, 0x1D6C, 0x2536, 0x1D6D, 0x2537, 0x1D6E,
- 0x2538, 0x1D6F, 0x2539, 0x1D70, 0x253A, 0x1D71, 0x253B, 0x1D72,
- 0x253C, 0x1D73, 0x253D, 0x1D74, 0x253E, 0x1D75, 0x253F, 0x1D76,
- 0x2540, 0x1D77, 0x2541, 0x1D78, 0x2542, 0x1D79, 0x2543, 0x1D7A,
- 0x2544, 0x1D7B, 0x2545, 0x1D7C, 0x2546, 0x1D7D, 0x2547, 0x1D7E,
- 0x2548, 0x1D7F, 0x2549, 0x1D80, 0x254A, 0x1D81, 0x254B, 0x1D82,
- 0x2550, 0x203B, 0x255E, 0x203C, 0x2561, 0x203E, 0x256A, 0x203D,
- 0x256D, 0x2037, 0x256E, 0x2038, 0x256F, 0x203A, 0x2570, 0x2039,
- 0x2571, 0x2045, 0x2572, 0x2046, 0x2573, 0x2047, 0x2581, 0x2026,
- 0x2582, 0x2027, 0x2583, 0x2028, 0x2584, 0x2029, 0x2585, 0x202A,
- 0x2586, 0x202B, 0x2587, 0x202C, 0x2588, 0x202D, 0x2589, 0x2034,
- 0x258A, 0x2033, 0x258B, 0x2032, 0x258C, 0x2031, 0x258D, 0x2030,
- 0x258E, 0x202F, 0x258F, 0x202E, 0x2594, 0x2035, 0x2595, 0x2036,
- 0x25A0, 0x02D9, 0x25A1, 0x02D8, 0x25A2, 0x1F4F, 0x25AA, 0x2FCF,
- 0x25AB, 0x2FCD, 0x25B1, 0x3F6B, 0x25B2, 0x02DB, 0x25B3, 0x02DA,
- 0x25B6, 0x2FA3, 0x25B7, 0x1F4A, 0x25BC, 0x02DD, 0x25BD, 0x02DC,
- 0x25C0, 0x2FA2, 0x25C1, 0x1F49, 0x25C6, 0x02D7, 0x25C7, 0x02D6,
- 0x25C9, 0x2012, 0x25CB, 0x02D3, 0x25CC, 0x2906, 0x25CE, 0x02D5,
- 0x25CF, 0x02D4, 0x25D0, 0x3F92, 0x25D1, 0x3F93, 0x25D2, 0x3F94,
- 0x25D3, 0x3F95, 0x25E2, 0x203F, 0x25E3, 0x2040, 0x25E4, 0x2042,
- 0x25E5, 0x2041, 0x25E6, 0x2FDE, 0x25EF, 0x030B, 0x2600, 0x2017,
- 0x2601, 0x2018, 0x2602, 0x2019, 0x2603, 0x201A, 0x2605, 0x02D2,
- 0x2606, 0x02D1, 0x260E, 0x1F78, 0x2616, 0x3F69, 0x2617, 0x3F6A,
- 0x261C, 0x201C, 0x261D, 0x201D, 0x261E, 0x201B, 0x261F, 0x201E,
- 0x2640, 0x02C2, 0x2642, 0x02C1, 0x2660, 0x2013, 0x2661, 0x1F51,
- 0x2662, 0x1F53, 0x2663, 0x2015, 0x2664, 0x1F52, 0x2665, 0x2014,
- 0x2666, 0x2016, 0x2667, 0x1F50, 0x2668, 0x2F42, 0x2669, 0x2F43,
- 0x266A, 0x0307, 0x266B, 0x3F48, 0x266C, 0x2F44, 0x266D, 0x0306,
- 0x266E, 0x3F47, 0x266F, 0x0305, 0x2672, 0x3FBA, 0x2673, 0x3FBB,
- 0x2674, 0x3FBC, 0x2675, 0x3FBD, 0x2676, 0x3FBE, 0x2677, 0x3FBF,
- 0x2678, 0x3FC0, 0x2679, 0x3FC1, 0x267A, 0x3FC2, 0x267B, 0x3FC3,
- 0x267C, 0x3FC4, 0x267D, 0x3FC5, 0x26A0, 0x2FA0, 0x2702, 0x2F90,
- 0x2713, 0x3F8E, 0x271A, 0x2FD1, 0x273F, 0x2FC5, 0x2740, 0x2FC4,
- 0x2756, 0x2FE3, 0x2776, 0x205E, 0x2777, 0x205F, 0x2778, 0x2060,
- 0x2779, 0x2061, 0x277A, 0x2062, 0x277B, 0x2063, 0x277C, 0x2064,
- 0x277D, 0x2065, 0x277E, 0x2066, 0x277F, 0x2912, 0x27A1, 0x200E,
- 0x2934, 0x3F49, 0x2935, 0x3F4A, 0x29BF, 0x3F4B, 0x29FA, 0x3F4F,
- 0x29FB, 0x3F50, 0x2B05, 0x200F, 0x2B06, 0x2010, 0x2B07, 0x2011,
- 0x2E83, 0x37E1, 0x2E85, 0x3620, 0x2E87, 0x3719, 0x2E89, 0x3814,
- 0x2E8B, 0x371E, 0x2E8C, 0x3609, 0x2E8D, 0x360A, 0x2E8E, 0x1071,
- 0x2E8F, 0x388C, 0x2E90, 0x1226, 0x2E92, 0x0EB2, 0x2E93, 0x1283,
- 0x2E94, 0x12AB, 0x2E95, 0x3C1F, 0x2E96, 0x38C2, 0x2E97, 0x361C,
- 0x2E98, 0x38E1, 0x2E99, 0x13C3, 0x2E9B, 0x13E1, 0x2E9E, 0x45E5,
- 0x2E9F, 0x0E3C, 0x2EA0, 0x0EBD, 0x2EA1, 0x3961, 0x2EA2, 0x3962,
- 0x2EA3, 0x399D, 0x2EA4, 0x3C26, 0x2EA6, 0x374D, 0x2EA8, 0x39BC,
- 0x2EA9, 0x35A1, 0x2EAA, 0x36AB, 0x2EAB, 0x3A97, 0x2EAC, 0x4ABA,
- 0x2EAD, 0x3A39, 0x2EAE, 0x3662, 0x2EB1, 0x3A98, 0x2EB2, 0x3A97,
- 0x2EB3, 0x376D, 0x2EB7, 0x36FE, 0x2EB9, 0x3713, 0x2EBC, 0x35B3,
- 0x2EBD, 0x354E, 0x2EBE, 0x3775, 0x2EBF, 0x3776, 0x2EC0, 0x3777,
- 0x2EC1, 0x078B, 0x2EC2, 0x3B0A, 0x2EC3, 0x362E, 0x2EC4, 0x0A62,
- 0x2EC6, 0x3572, 0x2ECA, 0x364A, 0x2ECC, 0x3C2B, 0x2ECD, 0x3B50,
- 0x2ECF, 0x3B9E, 0x2ED1, 0x0BD5, 0x2ED2, 0x3B97, 0x2ED6, 0x3B9E,
- 0x2ED7, 0x354D, 0x2ED8, 0x0A68, 0x2EDD, 0x3617, 0x2EDE, 0x3619,
- 0x2EDF, 0x3618, 0x2EE4, 0x064E, 0x2EE8, 0x0D34, 0x2EE9, 0x052B,
- 0x2EEB, 0x0A6A, 0x2EED, 0x08C3, 0x2EEF, 0x0F7D, 0x2EF2, 0x064F,
- 0x2F00, 0x04B0, 0x2F01, 0x20B3, 0x2F02, 0x0FFF, 0x2F03, 0x1001,
- 0x2F04, 0x0535, 0x2F05, 0x1006, 0x2F06, 0x0CCB, 0x2F07, 0x100E,
- 0x2F08, 0x0A13, 0x2F09, 0x1070, 0x2F0A, 0x0CD6, 0x2F0B, 0x0D40,
- 0x2F0C, 0x107B, 0x2F0D, 0x1083, 0x2F0E, 0x1089, 0x2F0F, 0x1093,
- 0x2F10, 0x1098, 0x2F11, 0x0C5B, 0x2F12, 0x0F97, 0x2F13, 0x10C6,
- 0x2F14, 0x10CD, 0x2F15, 0x10CE, 0x2F16, 0x10D3, 0x2F17, 0x0947,
- 0x2F18, 0x0E7C, 0x2F19, 0x10DC, 0x2F1A, 0x10E1, 0x2F1B, 0x10E8,
- 0x2F1C, 0x0EA2, 0x2F1D, 0x07B1, 0x2F1E, 0x116B, 0x2F1F, 0x0C54,
- 0x2F20, 0x089C, 0x2F21, 0x11BA, 0x2F22, 0x11BB, 0x2F23, 0x0F26,
- 0x2F24, 0x0B47, 0x2F25, 0x0981, 0x2F26, 0x08A0, 0x2F27, 0x120E,
- 0x2F28, 0x0A47, 0x2F29, 0x0996, 0x2F2A, 0x1226, 0x2F2B, 0x1228,
- 0x2F2C, 0x1232, 0x2F2D, 0x0881, 0x2F2E, 0x126C, 0x2F2F, 0x07BB,
- 0x2F30, 0x077E, 0x2F31, 0x06CA, 0x2F32, 0x05EF, 0x2F33, 0x1283,
- 0x2F34, 0x1285, 0x2F35, 0x1299, 0x2F36, 0x129B, 0x2F37, 0x12A0,
- 0x2F38, 0x0677, 0x2F39, 0x38B9, 0x2F3A, 0x12AF, 0x2F3B, 0x12B1,
- 0x2F3C, 0x09FA, 0x2F3D, 0x1342, 0x2F3E, 0x0781, 0x2F3F, 0x0916,
- 0x2F40, 0x08A7, 0x2F41, 0x13C2, 0x2F42, 0x0E08, 0x2F43, 0x0C47,
- 0x2F44, 0x06CC, 0x2F45, 0x0E4D, 0x2F46, 0x13E0, 0x2F47, 0x0CD4,
- 0x2F48, 0x140C, 0x2F49, 0x0744, 0x2F4A, 0x0EE6, 0x2F4B, 0x073D,
- 0x2F4C, 0x08AD, 0x2F4D, 0x14E5, 0x2F4E, 0x14F4, 0x2F4F, 0x14F8,
- 0x2F50, 0x0D7A, 0x2F51, 0x0EDF, 0x2F52, 0x08AF, 0x2F53, 0x1502,
- 0x2F54, 0x0A2B, 0x2F55, 0x0550, 0x2F56, 0x0BFA, 0x2F57, 0x0DD5,
- 0x2F58, 0x15E4, 0x2F59, 0x15E6, 0x2F5A, 0x0E22, 0x2F5B, 0x0567,
- 0x2F5C, 0x0687, 0x2F5D, 0x0758, 0x2F5E, 0x0770, 0x2F5F, 0x06C4,
- 0x2F60, 0x04DD, 0x2F61, 0x05E0, 0x2F62, 0x0601, 0x2F63, 0x0A5C,
- 0x2F64, 0x0F3B, 0x2F65, 0x0C3E, 0x2F66, 0x0D97, 0x2F67, 0x3A00,
- 0x2F68, 0x1697, 0x2F69, 0x0D28, 0x2F6A, 0x0D7D, 0x2F6B, 0x087C,
- 0x2F6C, 0x0EE8, 0x2F6D, 0x0EC3, 0x2F6E, 0x0EFC, 0x2F6F, 0x0A74,
- 0x2F70, 0x08D4, 0x2F71, 0x3A41, 0x2F72, 0x0553, 0x2F73, 0x0740,
- 0x2F74, 0x0F71, 0x2F75, 0x0B9B, 0x2F76, 0x0E16, 0x2F77, 0x08B3,
- 0x2F78, 0x0608, 0x2F79, 0x1813, 0x2F7A, 0x0F3D, 0x2F7B, 0x04CB,
- 0x2F7C, 0x0FDD, 0x2F7D, 0x08D5, 0x2F7E, 0x183D, 0x2F7F, 0x08D6,
- 0x2F80, 0x1853, 0x2F81, 0x0CD1, 0x2F82, 0x0A09, 0x2F83, 0x08D7,
- 0x2F84, 0x08B8, 0x2F85, 0x04D3, 0x2F86, 0x0A89, 0x2F87, 0x0AA6,
- 0x2F88, 0x0938, 0x2F89, 0x0821, 0x2F8A, 0x09ED, 0x2F8B, 0x18B2,
- 0x2F8C, 0x194F, 0x2F8D, 0x0BAC, 0x2F8E, 0x0742, 0x2F8F, 0x07E6,
- 0x2F90, 0x04A5, 0x2F91, 0x19EB, 0x2F92, 0x075F, 0x2F93, 0x05AF,
- 0x2F94, 0x0774, 0x2F95, 0x0B69, 0x2F96, 0x0C7E, 0x2F97, 0x1A56,
- 0x2F98, 0x1A59, 0x2F99, 0x058B, 0x2F9A, 0x0A7A, 0x2F9B, 0x0AF8,
- 0x2F9C, 0x0B0D, 0x2F9D, 0x0A0E, 0x2F9E, 0x0902, 0x2F9F, 0x0A0F,
- 0x2FA0, 0x0B62, 0x2FA1, 0x3B4F, 0x2FA2, 0x0F22, 0x2FA3, 0x0CAB,
- 0x2FA4, 0x0D64, 0x2FA5, 0x0F6C, 0x2FA6, 0x06DA, 0x2FA7, 0x0BD5,
- 0x2FA8, 0x0EF3, 0x2FA9, 0x0DDE, 0x2FAA, 0x1BC9, 0x2FAB, 0x1BCB,
- 0x2FAC, 0x04CD, 0x2FAD, 0x21F7, 0x2FAE, 0x0D87, 0x2FAF, 0x0ED8,
- 0x2FB0, 0x05B5, 0x2FB1, 0x1C03, 0x2FB2, 0x1C05, 0x2FB3, 0x053B,
- 0x2FB4, 0x0E17, 0x2FB5, 0x0DE9, 0x2FB6, 0x0D88, 0x2FB7, 0x09EF,
- 0x2FB8, 0x091F, 0x2FB9, 0x07F3, 0x2FBA, 0x0D05, 0x2FBB, 0x080E,
- 0x2FBC, 0x07F4, 0x2FBD, 0x1C6C, 0x2FBE, 0x1C7D, 0x2FBF, 0x1C83,
- 0x2FC0, 0x1C84, 0x2FC1, 0x064E, 0x2FC2, 0x0695, 0x2FC3, 0x0BD7,
- 0x2FC4, 0x1CF6, 0x2FC5, 0x08DB, 0x2FC6, 0x1D01, 0x2FC7, 0x0E91,
- 0x2FC8, 0x340B, 0x2FC9, 0x066A, 0x2FCA, 0x0807, 0x2FCB, 0x1D16,
- 0x2FCC, 0x1D19, 0x2FCD, 0x0C1E, 0x2FCE, 0x0791, 0x2FCF, 0x0ACF,
- 0x2FD0, 0x0D93, 0x2FD1, 0x1D21, 0x2FD2, 0x1D22, 0x2FD3, 0x0F7E,
- 0x2FD4, 0x1D30, 0x2FD5, 0x1D31, 0x3000, 0x0279, 0x3001, 0x027A,
- 0x3002, 0x027B, 0x3003, 0x028F, 0x3004, 0x2074, 0x3005, 0x0291,
- 0x3006, 0x0292, 0x3007, 0x0293, 0x3008, 0x02AA, 0x3009, 0x02AB,
- 0x300A, 0x02AC, 0x300B, 0x02AD, 0x300C, 0x02AE, 0x300D, 0x02AF,
- 0x300E, 0x02B0, 0x300F, 0x02B1, 0x3010, 0x02B2, 0x3011, 0x02B3,
- 0x3012, 0x02DF, 0x3013, 0x02E4, 0x3014, 0x02A4, 0x3015, 0x02A5,
- 0x3016, 0x3F45, 0x3017, 0x3F46, 0x3018, 0x2F61, 0x3019, 0x2F62,
- 0x301C, 0x0299, 0x301D, 0x1DB8, 0x301F, 0x1DB9, 0x3020, 0x1F7A,
- 0x3030, 0x2FBA, 0x3033, 0x2F4C, 0x3034, 0x2F4D, 0x3035, 0x2F4E,
- 0x3036, 0x1F79, 0x303B, 0x2F4A, 0x303C, 0x3F42, 0x303D, 0x2F93,
- 0x3041, 0x034A, 0x3042, 0x034B, 0x3043, 0x034C, 0x3044, 0x034D,
- 0x3045, 0x034E, 0x3046, 0x034F, 0x3047, 0x0350, 0x3048, 0x0351,
- 0x3049, 0x0352, 0x304A, 0x0353, 0x304B, 0x0354, 0x304C, 0x0355,
- 0x304D, 0x0356, 0x304E, 0x0357, 0x304F, 0x0358, 0x3050, 0x0359,
- 0x3051, 0x035A, 0x3052, 0x035B, 0x3053, 0x035C, 0x3054, 0x035D,
- 0x3055, 0x035E, 0x3056, 0x035F, 0x3057, 0x0360, 0x3058, 0x0361,
- 0x3059, 0x0362, 0x305A, 0x0363, 0x305B, 0x0364, 0x305C, 0x0365,
- 0x305D, 0x0366, 0x305E, 0x0367, 0x305F, 0x0368, 0x3060, 0x0369,
- 0x3061, 0x036A, 0x3062, 0x036B, 0x3063, 0x036C, 0x3064, 0x036D,
- 0x3065, 0x036E, 0x3066, 0x036F, 0x3067, 0x0370, 0x3068, 0x0371,
- 0x3069, 0x0372, 0x306A, 0x0373, 0x306B, 0x0374, 0x306C, 0x0375,
- 0x306D, 0x0376, 0x306E, 0x0377, 0x306F, 0x0378, 0x3070, 0x0379,
- 0x3071, 0x037A, 0x3072, 0x037B, 0x3073, 0x037C, 0x3074, 0x037D,
- 0x3075, 0x037E, 0x3076, 0x037F, 0x3077, 0x0380, 0x3078, 0x0381,
- 0x3079, 0x0382, 0x307A, 0x0383, 0x307B, 0x0384, 0x307C, 0x0385,
- 0x307D, 0x0386, 0x307E, 0x0387, 0x307F, 0x0388, 0x3080, 0x0389,
- 0x3081, 0x038A, 0x3082, 0x038B, 0x3083, 0x038C, 0x3084, 0x038D,
- 0x3085, 0x038E, 0x3086, 0x038F, 0x3087, 0x0390, 0x3088, 0x0391,
- 0x3089, 0x0392, 0x308A, 0x0393, 0x308B, 0x0394, 0x308C, 0x0395,
- 0x308D, 0x0396, 0x308E, 0x0397, 0x308F, 0x0398, 0x3090, 0x0399,
- 0x3091, 0x039A, 0x3092, 0x039B, 0x3093, 0x039C, 0x3094, 0x1F16,
- 0x3095, 0x1F17, 0x3096, 0x1F18, 0x3099, 0x3FC6, 0x309A, 0x3FC7,
- 0x309B, 0x0283, 0x309C, 0x0284, 0x309D, 0x028D, 0x309E, 0x028E,
- 0x309F, 0x2F95, 0x30A0, 0x3F4D, 0x30A1, 0x039D, 0x30A2, 0x039E,
- 0x30A3, 0x039F, 0x30A4, 0x03A0, 0x30A5, 0x03A1, 0x30A6, 0x03A2,
- 0x30A7, 0x03A3, 0x30A8, 0x03A4, 0x30A9, 0x03A5, 0x30AA, 0x03A6,
- 0x30AB, 0x03A7, 0x30AC, 0x03A8, 0x30AD, 0x03A9, 0x30AE, 0x03AA,
- 0x30AF, 0x03AB, 0x30B0, 0x03AC, 0x30B1, 0x03AD, 0x30B2, 0x03AE,
- 0x30B3, 0x03AF, 0x30B4, 0x03B0, 0x30B5, 0x03B1, 0x30B6, 0x03B2,
- 0x30B7, 0x03B3, 0x30B8, 0x03B4, 0x30B9, 0x03B5, 0x30BA, 0x03B6,
- 0x30BB, 0x03B7, 0x30BC, 0x03B8, 0x30BD, 0x03B9, 0x30BE, 0x03BA,
- 0x30BF, 0x03BB, 0x30C0, 0x03BC, 0x30C1, 0x03BD, 0x30C2, 0x03BE,
- 0x30C3, 0x03BF, 0x30C4, 0x03C0, 0x30C5, 0x03C1, 0x30C6, 0x03C2,
- 0x30C7, 0x03C3, 0x30C8, 0x03C4, 0x30C9, 0x03C5, 0x30CA, 0x03C6,
- 0x30CB, 0x03C7, 0x30CC, 0x03C8, 0x30CD, 0x03C9, 0x30CE, 0x03CA,
- 0x30CF, 0x03CB, 0x30D0, 0x03CC, 0x30D1, 0x03CD, 0x30D2, 0x03CE,
- 0x30D3, 0x03CF, 0x30D4, 0x03D0, 0x30D5, 0x03D1, 0x30D6, 0x03D2,
- 0x30D7, 0x03D3, 0x30D8, 0x03D4, 0x30D9, 0x03D5, 0x30DA, 0x03D6,
- 0x30DB, 0x03D7, 0x30DC, 0x03D8, 0x30DD, 0x03D9, 0x30DE, 0x03DA,
- 0x30DF, 0x03DB, 0x30E0, 0x03DC, 0x30E1, 0x03DD, 0x30E2, 0x03DE,
- 0x30E3, 0x03DF, 0x30E4, 0x03E0, 0x30E5, 0x03E1, 0x30E6, 0x03E2,
- 0x30E7, 0x03E3, 0x30E8, 0x03E4, 0x30E9, 0x03E5, 0x30EA, 0x03E6,
- 0x30EB, 0x03E7, 0x30EC, 0x03E8, 0x30ED, 0x03E9, 0x30EE, 0x03EA,
- 0x30EF, 0x03EB, 0x30F0, 0x03EC, 0x30F1, 0x03ED, 0x30F2, 0x03EE,
- 0x30F3, 0x03EF, 0x30F4, 0x03F0, 0x30F5, 0x03F1, 0x30F6, 0x03F2,
- 0x30F7, 0x2079, 0x30F8, 0x207A, 0x30F9, 0x207B, 0x30FA, 0x207C,
- 0x30FB, 0x027E, 0x30FC, 0x0294, 0x30FD, 0x028B, 0x30FE, 0x028C,
- 0x30FF, 0x3F43, 0x3190, 0x3F9B, 0x3191, 0x3F9C, 0x3192, 0x3F9D,
- 0x3193, 0x3F9E, 0x3194, 0x3F9F, 0x3195, 0x3FA0, 0x3196, 0x3FA1,
- 0x3197, 0x3FA2, 0x3198, 0x3FA3, 0x3199, 0x3FA4, 0x319A, 0x3FA5,
- 0x319B, 0x3FA6, 0x319C, 0x3FA7, 0x319D, 0x3FA8, 0x319E, 0x3FA9,
- 0x319F, 0x3FAA, 0x31F0, 0x3F6C, 0x31F1, 0x3F6D, 0x31F2, 0x3F6E,
- 0x31F3, 0x3F6F, 0x31F4, 0x3F70, 0x31F5, 0x3F71, 0x31F6, 0x3F72,
- 0x31F7, 0x3F73, 0x31F8, 0x3F74, 0x31F9, 0x3F75, 0x31FA, 0x3F77,
- 0x31FB, 0x3F78, 0x31FC, 0x3F79, 0x31FD, 0x3F7A, 0x31FE, 0x3F7B,
- 0x31FF, 0x3F7C, 0x3220, 0x278E, 0x3221, 0x278F, 0x3222, 0x2790,
- 0x3223, 0x2791, 0x3224, 0x2792, 0x3225, 0x2793, 0x3226, 0x2794,
- 0x3227, 0x2795, 0x3228, 0x2796, 0x3229, 0x2797, 0x322A, 0x2006,
- 0x322B, 0x2007, 0x322C, 0x2008, 0x322D, 0x2009, 0x322E, 0x200A,
- 0x322F, 0x200B, 0x3230, 0x2005, 0x3231, 0x1DC2, 0x3232, 0x1DC3,
- 0x3233, 0x1FCF, 0x3234, 0x1FCD, 0x3235, 0x1FD4, 0x3236, 0x1FD3,
- 0x3237, 0x200C, 0x3238, 0x1FCE, 0x3239, 0x1DC4, 0x323A, 0x1FD7,
- 0x323B, 0x1FD5, 0x323C, 0x1FD0, 0x323D, 0x1FCB, 0x323E, 0x1FD2,
- 0x323F, 0x1FCC, 0x3240, 0x1FD6, 0x3241, 0x200D, 0x3242, 0x1FD1,
- 0x3243, 0x1FCA, 0x3251, 0x1F9B, 0x3252, 0x1FA6, 0x3253, 0x1FA7,
- 0x3254, 0x1FA8, 0x3255, 0x1FA9, 0x3256, 0x1FAA, 0x3257, 0x1FAB,
- 0x3258, 0x1FAC, 0x3259, 0x1FAD, 0x325A, 0x1FAE, 0x325B, 0x1FAF,
- 0x325C, 0x2804, 0x325D, 0x2805, 0x325E, 0x2806, 0x325F, 0x2807,
- 0x3280, 0x28DD, 0x3281, 0x28DE, 0x3282, 0x28DF, 0x3283, 0x28E0,
- 0x3284, 0x28E1, 0x3285, 0x28E2, 0x3286, 0x28E3, 0x3287, 0x28E4,
- 0x3288, 0x28E5, 0x3289, 0x28E6, 0x328A, 0x28E8, 0x328B, 0x28E9,
- 0x328C, 0x28EA, 0x328D, 0x28EB, 0x328E, 0x28EC, 0x328F, 0x28ED,
- 0x3290, 0x28E7, 0x3291, 0x1FE1, 0x3292, 0x1FE0, 0x3293, 0x1FE2,
- 0x3294, 0x1FDC, 0x3295, 0x28FF, 0x3296, 0x1FE5, 0x3297, 0x28FC,
- 0x3298, 0x1FDE, 0x3299, 0x201F, 0x329A, 0x28F9, 0x329B, 0x28F8,
- 0x329C, 0x28FE, 0x329D, 0x207F, 0x329E, 0x1FFF, 0x329F, 0x28EF,
- 0x32A0, 0x28F6, 0x32A1, 0x28F7, 0x32A2, 0x28FB, 0x32A3, 0x28FA,
- 0x32A4, 0x1DBD, 0x32A5, 0x1DBE, 0x32A6, 0x1DBF, 0x32A7, 0x1DC0,
- 0x32A8, 0x1DC1, 0x32A9, 0x1FDA, 0x32AA, 0x1FDD, 0x32AB, 0x1FDF,
- 0x32AC, 0x1FE3, 0x32AD, 0x1FD9, 0x32AE, 0x1FE4, 0x32AF, 0x1FDB,
- 0x32B0, 0x1FD8, 0x32B1, 0x2808, 0x32B2, 0x2809, 0x32B3, 0x280A,
- 0x32B4, 0x280B, 0x32B5, 0x280C, 0x32B6, 0x280D, 0x32B7, 0x280E,
- 0x32B8, 0x280F, 0x32B9, 0x2810, 0x32BA, 0x2811, 0x32BB, 0x2812,
- 0x32BC, 0x2813, 0x32BD, 0x2814, 0x32BE, 0x2815, 0x32BF, 0x2816,
- 0x32D0, 0x28AD, 0x32D1, 0x28AE, 0x32D2, 0x28AF, 0x32D3, 0x28B0,
- 0x32D4, 0x28B1, 0x32D5, 0x28B2, 0x32D6, 0x28B3, 0x32D7, 0x28B4,
- 0x32D8, 0x28B5, 0x32D9, 0x28B6, 0x32DA, 0x28B7, 0x32DB, 0x28B8,
- 0x32DC, 0x28B9, 0x32DD, 0x28BA, 0x32DE, 0x28BB, 0x32DF, 0x28BC,
- 0x32E0, 0x28BD, 0x32E1, 0x28BE, 0x32E2, 0x28BF, 0x32E3, 0x28C0,
- 0x32E4, 0x28C1, 0x32E5, 0x28C2, 0x32E6, 0x28C3, 0x32E7, 0x28C4,
- 0x32E8, 0x28C5, 0x32E9, 0x28C6, 0x32EA, 0x28C7, 0x32EB, 0x28C8,
- 0x32EC, 0x28C9, 0x32ED, 0x28CA, 0x32EE, 0x28CB, 0x32EF, 0x28CC,
- 0x32F0, 0x28CD, 0x32F1, 0x28CE, 0x32F2, 0x28CF, 0x32F3, 0x28D0,
- 0x32F4, 0x28D1, 0x32F5, 0x28D2, 0x32F6, 0x28D3, 0x32F7, 0x28D4,
- 0x32F8, 0x28D5, 0x32F9, 0x28D6, 0x32FA, 0x28D7, 0x32FB, 0x28D8,
- 0x32FC, 0x28D9, 0x32FD, 0x28DA, 0x32FE, 0x28DB, 0x3300, 0x1F70,
- 0x3301, 0x2E62, 0x3302, 0x2E63, 0x3303, 0x1F6A, 0x3304, 0x2E64,
- 0x3305, 0x1FF7, 0x3306, 0x2E65, 0x3307, 0x2E69, 0x3308, 0x2E67,
- 0x3309, 0x2E6C, 0x330A, 0x2E6A, 0x330B, 0x2E6E, 0x330C, 0x2E70,
- 0x330D, 0x1DAB, 0x330E, 0x2E71, 0x330F, 0x2E72, 0x3310, 0x2E73,
- 0x3311, 0x2E74, 0x3312, 0x2E75, 0x3313, 0x2E76, 0x3314, 0x1DA2,
- 0x3315, 0x1F69, 0x3316, 0x1F67, 0x3317, 0x2E78, 0x3318, 0x1F68,
- 0x3319, 0x2E7A, 0x331A, 0x2E7C, 0x331B, 0x2E7D, 0x331C, 0x2E7E,
- 0x331D, 0x2E7F, 0x331E, 0x1F73, 0x331F, 0x2E80, 0x3320, 0x2E81,
- 0x3321, 0x2E82, 0x3322, 0x1F66, 0x3323, 0x1F6B, 0x3324, 0x2E83,
- 0x3325, 0x2E85, 0x3326, 0x1DAC, 0x3327, 0x1DA6, 0x3328, 0x2E88,
- 0x3329, 0x2E89, 0x332A, 0x1F74, 0x332B, 0x1DAE, 0x332D, 0x2E8B,
- 0x332E, 0x2E8E, 0x332F, 0x2E8F, 0x3330, 0x2E90, 0x3331, 0x1F71,
- 0x3332, 0x2E91, 0x3333, 0x2087, 0x3334, 0x2E94, 0x3335, 0x2E95,
- 0x3336, 0x1DA8, 0x3337, 0x2E9A, 0x3338, 0x2E9C, 0x3339, 0x1F6E,
- 0x333A, 0x2E9D, 0x333B, 0x1F6F, 0x333C, 0x2E96, 0x333D, 0x2E9E,
- 0x333E, 0x2EA0, 0x333F, 0x2EA1, 0x3340, 0x2EA2, 0x3341, 0x2E9F,
- 0x3342, 0x1F6D, 0x3343, 0x2EA3, 0x3344, 0x2EA4, 0x3345, 0x2EA5,
- 0x3346, 0x2EA6, 0x3347, 0x1F72, 0x3348, 0x2EA7, 0x3349, 0x1DA1,
- 0x334A, 0x1DAF, 0x334B, 0x2EA8, 0x334C, 0x2EA9, 0x334D, 0x1DA4,
- 0x334E, 0x2088, 0x334F, 0x2EAA, 0x3350, 0x2EAB, 0x3351, 0x1DA9,
- 0x3352, 0x2EAE, 0x3353, 0x2EB2, 0x3354, 0x2EAF, 0x3355, 0x2EB3,
- 0x3356, 0x2EB4, 0x3357, 0x1F6C, 0x3371, 0x2E55, 0x337B, 0x2083,
- 0x337C, 0x1DC7, 0x337D, 0x1DC6, 0x337E, 0x1DC5, 0x337F, 0x1F76,
- 0x3385, 0x1F5F, 0x3386, 0x1F60, 0x3387, 0x1F61, 0x3388, 0x2000,
- 0x3389, 0x2001, 0x338D, 0x2E58, 0x338E, 0x1DB4, 0x338F, 0x1DB5,
- 0x3390, 0x1F63, 0x3396, 0x1F65, 0x3397, 0x1F58, 0x3398, 0x1F5A,
- 0x339B, 0x2E59, 0x339C, 0x1DB1, 0x339D, 0x1DB2, 0x339E, 0x1DB3,
- 0x339F, 0x1FFA, 0x33A0, 0x1F54, 0x33A1, 0x1DB7, 0x33A2, 0x1F55,
- 0x33A3, 0x1FFB, 0x33A4, 0x1F56, 0x33A5, 0x1F57, 0x33A6, 0x1FFC,
- 0x33B0, 0x1F5E, 0x33B1, 0x1F5D, 0x33B2, 0x1F5C, 0x33B3, 0x1F5B,
- 0x33C2, 0x2E50, 0x33C4, 0x1DB6, 0x33C8, 0x2002, 0x33CB, 0x1F62,
- 0x33CC, 0x1FF6, 0x33CD, 0x1DBB, 0x33D4, 0x1F64, 0x33D7, 0x2E5D,
- 0x33D8, 0x2E5E, 0x33DA, 0x2E4B, 0x3402, 0x3582, 0x3405, 0x3C1B,
- 0x3406, 0x435A, 0x3427, 0x3656, 0x342C, 0x435E, 0x342E, 0x3788,
- 0x3468, 0x36DF, 0x346A, 0x4375, 0x3488, 0x3C52, 0x3492, 0x438E,
- 0x34B5, 0x4199, 0x34BC, 0x4397, 0x34C1, 0x47D0, 0x34C7, 0x439B,
- 0x34DB, 0x3C41, 0x351F, 0x3629, 0x353E, 0x371E, 0x355D, 0x43BD,
- 0x355E, 0x43BE, 0x3563, 0x43C0, 0x356E, 0x43C4, 0x35A6, 0x43D9,
- 0x35A8, 0x43DB, 0x35C5, 0x43E1, 0x35DA, 0x43EA, 0x35DE, 0x4E63,
- 0x35F4, 0x43F3, 0x3605, 0x43FA, 0x3614, 0x4ABB, 0x364A, 0x4421,
- 0x3691, 0x4441, 0x3696, 0x4445, 0x3699, 0x4443, 0x36CF, 0x4456,
- 0x3761, 0x4478, 0x3762, 0x4479, 0x376B, 0x447D, 0x376C, 0x447C,
- 0x3775, 0x4480, 0x378D, 0x361A, 0x37C1, 0x448E, 0x37E2, 0x372B,
- 0x37E8, 0x44A2, 0x37F4, 0x44A5, 0x37FD, 0x44A8, 0x3800, 0x44AA,
- 0x382F, 0x44B4, 0x3836, 0x44B5, 0x3840, 0x44B6, 0x385C, 0x44BA,
- 0x3861, 0x44BC, 0x38A1, 0x4ECB, 0x38AD, 0x4ABC, 0x38FA, 0x361C,
- 0x3917, 0x44D9, 0x391A, 0x44DC, 0x396F, 0x44EB, 0x39A4, 0x4E9A,
- 0x39B8, 0x4E9B, 0x3A5C, 0x4E9F, 0x3A6E, 0x4531, 0x3A73, 0x4534,
- 0x3A85, 0x4EAE, 0x3AC4, 0x4EA7, 0x3ACB, 0x4EA8, 0x3AD6, 0x4543,
- 0x3AD7, 0x455E, 0x3AEA, 0x454D, 0x3AF3, 0x3C40, 0x3B0E, 0x4558,
- 0x3B1A, 0x455C, 0x3B1C, 0x455D, 0x3B22, 0x3C49, 0x3B6D, 0x458C,
- 0x3B77, 0x4585, 0x3B87, 0x45A2, 0x3B88, 0x368D, 0x3B8D, 0x45A4,
- 0x3BA4, 0x45AA, 0x3BB6, 0x420E, 0x3BC3, 0x420F, 0x3BCD, 0x45B8,
- 0x3BF0, 0x45C9, 0x3BF3, 0x4EB7, 0x3C0F, 0x4217, 0x3C26, 0x45DF,
- 0x3CC3, 0x45FC, 0x3CD2, 0x4601, 0x3D11, 0x4625, 0x3D1E, 0x4630,
- 0x3D31, 0x4EBE, 0x3D4E, 0x1DE7, 0x3D64, 0x464A, 0x3D9A, 0x4658,
- 0x3DC0, 0x466A, 0x3DCC, 0x4ABD, 0x3DD4, 0x466F, 0x3E05, 0x467B,
- 0x3E3F, 0x4248, 0x3E40, 0x4ECA, 0x3E60, 0x468B, 0x3E66, 0x468D,
- 0x3E68, 0x468E, 0x3E83, 0x4695, 0x3E8A, 0x3C43, 0x3E94, 0x469B,
- 0x3EDA, 0x3C48, 0x3F57, 0x46CB, 0x3F72, 0x4258, 0x3F75, 0x46D9,
- 0x3F77, 0x46DB, 0x3FAE, 0x46ED, 0x3FB1, 0x3754, 0x3FC9, 0x46F8,
- 0x3FD7, 0x46FD, 0x3FDC, 0x4ABE, 0x4039, 0x470F, 0x4058, 0x4716,
- 0x4093, 0x3C4C, 0x4103, 0x3C4F, 0x4105, 0x473B, 0x4148, 0x4747,
- 0x414F, 0x474A, 0x4163, 0x474E, 0x41B4, 0x475D, 0x41BF, 0x4760,
- 0x41E6, 0x476B, 0x41EE, 0x476F, 0x41F3, 0x476C, 0x4207, 0x4776,
- 0x420E, 0x4779, 0x4264, 0x3760, 0x4293, 0x3C50, 0x42C6, 0x479F,
- 0x42D6, 0x47AA, 0x42DD, 0x47AE, 0x4302, 0x47BC, 0x432B, 0x47C9,
- 0x4343, 0x47CB, 0x43EE, 0x47F7, 0x43F0, 0x47FA, 0x4408, 0x4800,
- 0x440C, 0x3C42, 0x4417, 0x4802, 0x441C, 0x4803, 0x4422, 0x4805,
- 0x4453, 0x3773, 0x445B, 0x42A4, 0x4476, 0x481C, 0x447A, 0x481D,
- 0x4491, 0x4823, 0x44B3, 0x483E, 0x44BE, 0x483C, 0x44D4, 0x483D,
- 0x4508, 0x485C, 0x450D, 0x4858, 0x4525, 0x377E, 0x4543, 0x486C,
- 0x457A, 0x3C4B, 0x459D, 0x42D4, 0x45B8, 0x48A0, 0x45BE, 0x4ABF,
- 0x45E5, 0x48BA, 0x45EA, 0x42D9, 0x460F, 0x48CA, 0x4610, 0x4AC0,
- 0x4641, 0x48D8, 0x4665, 0x3C4E, 0x46A1, 0x48E9, 0x46AE, 0x3C51,
- 0x46AF, 0x48ED, 0x470C, 0x4902, 0x471F, 0x4EFB, 0x4764, 0x4918,
- 0x47E6, 0x3790, 0x47FD, 0x4924, 0x4816, 0x492E, 0x481E, 0x4F01,
- 0x4844, 0x42F5, 0x484E, 0x493A, 0x48B5, 0x495B, 0x49B0, 0x431F,
- 0x49E7, 0x49D2, 0x49FA, 0x49D6, 0x4A04, 0x49DB, 0x4A29, 0x49DE,
- 0x4ABC, 0x49F6, 0x4B38, 0x35DF, 0x4B3B, 0x4A0E, 0x4B7E, 0x4AC1,
- 0x4BC2, 0x4A33, 0x4BCA, 0x4A35, 0x4BD2, 0x4A37, 0x4BE8, 0x3C46,
- 0x4C17, 0x4334, 0x4C20, 0x4A48, 0x4C38, 0x4AC2, 0x4CC4, 0x4A84,
- 0x4CD1, 0x4A87, 0x4CE1, 0x4AC3, 0x4D07, 0x4A9B, 0x4D77, 0x4AAB,
- 0x4E00, 0x04B0, 0x4E01, 0x0BB8, 0x4E02, 0x4352, 0x4E03, 0x08E3,
- 0x4E04, 0x37D8, 0x4E05, 0x37D9, 0x4E07, 0x0EAA, 0x4E08, 0x09CE,
- 0x4E09, 0x087E, 0x4E0A, 0x09CD, 0x4E0B, 0x053C, 0x4E0C, 0x4AC4,
- 0x4E0D, 0x0DC6, 0x4E0E, 0x0F29, 0x4E0F, 0x4353, 0x4E10, 0x0FFB,
- 0x4E11, 0x04D1, 0x4E12, 0x4354, 0x4E14, 0x05CC, 0x4E15, 0x0FFC,
- 0x4E16, 0x0A48, 0x4E17, 0x10D7, 0x4E18, 0x0670, 0x4E19, 0x0E0A,
- 0x4E1E, 0x09CF, 0x4E1F, 0x37DA, 0x4E21, 0x0F86, 0x4E23, 0x4AC5,
- 0x4E24, 0x4AC6, 0x4E26, 0x0E12, 0x4E28, 0x20B3, 0x4E29, 0x4355,
- 0x4E2A, 0x0FFD, 0x4E2B, 0x37DB, 0x4E2C, 0x374D, 0x4E2D, 0x0BA4,
- 0x4E2E, 0x4356, 0x4E2F, 0x37DC, 0x4E30, 0x37DD, 0x4E31, 0x0FFE,
- 0x4E32, 0x06F2, 0x4E36, 0x0FFF, 0x4E37, 0x369D, 0x4E38, 0x0619,
- 0x4E39, 0x0B6E, 0x4E3B, 0x0913, 0x4E3C, 0x1000, 0x4E3F, 0x1001,
- 0x4E40, 0x37DE, 0x4E41, 0x37DF, 0x4E42, 0x1002, 0x4E43, 0x0CEB,
- 0x4E44, 0x37E0, 0x4E45, 0x0671, 0x4E47, 0x4357, 0x4E48, 0x372E,
- 0x4E4B, 0x0CED, 0x4E4D, 0x0CBB, 0x4E4E, 0x0777, 0x4E4F, 0x0E61,
- 0x4E51, 0x4359, 0x4E55, 0x1950, 0x4E56, 0x1003, 0x4E57, 0x09D0,
- 0x4E58, 0x1004, 0x4E59, 0x0535, 0x4E5A, 0x37E1, 0x4E5D, 0x06DD,
- 0x4E5E, 0x07A4, 0x4E5F, 0x0EF5, 0x4E62, 0x1233, 0x4E69, 0x435C,
- 0x4E71, 0x0F5A, 0x4E73, 0x0CD5, 0x4E79, 0x4AC7, 0x4E7E, 0x05E1,
- 0x4E7F, 0x37E2, 0x4E80, 0x064F, 0x4E82, 0x1005, 0x4E85, 0x1006,
- 0x4E86, 0x0F83, 0x4E88, 0x0F27, 0x4E89, 0x0AEA, 0x4E8A, 0x1008,
- 0x4E8B, 0x08C4, 0x4E8C, 0x0CCB, 0x4E8D, 0x37E3, 0x4E8E, 0x100B,
- 0x4E91, 0x04E0, 0x4E92, 0x0793, 0x4E94, 0x0792, 0x4E95, 0x04AA,
- 0x4E96, 0x37E4, 0x4E98, 0x0FF1, 0x4E99, 0x0FF0, 0x4E9B, 0x0823,
- 0x4E9C, 0x0465, 0x4E9D, 0x435D, 0x4E9E, 0x100C, 0x4E9F, 0x100D,
- 0x4EA0, 0x100E, 0x4EA1, 0x0E62, 0x4EA2, 0x100F, 0x4EA4, 0x07A6,
- 0x4EA5, 0x04AB, 0x4EA6, 0x0EA0, 0x4EA8, 0x0696, 0x4EAB, 0x0697,
- 0x4EAC, 0x0698, 0x4EAD, 0x0BFE, 0x4EAE, 0x0F84, 0x4EB0, 0x1010,
- 0x4EB3, 0x1011, 0x4EB6, 0x1012, 0x4EB9, 0x37E5, 0x4EBA, 0x0A13,
- 0x4EBB, 0x3620, 0x4EBC, 0x435F, 0x4EC0, 0x0944, 0x4EC1, 0x0A14,
- 0x4EC2, 0x1017, 0x4EC3, 0x4360, 0x4EC4, 0x1015, 0x4EC6, 0x1016,
- 0x4EC7, 0x0672, 0x4EC8, 0x4361, 0x4ECA, 0x0813, 0x4ECB, 0x0570,
- 0x4ECD, 0x1014, 0x4ECE, 0x1013, 0x4ECF, 0x0DF9, 0x4ED0, 0x37E6,
- 0x4ED4, 0x0894, 0x4ED5, 0x0893, 0x4ED6, 0x0B1E, 0x4ED7, 0x1018,
- 0x4ED8, 0x0DC7, 0x4ED9, 0x0A8B, 0x4EDA, 0x4363, 0x4EDD, 0x0290,
- 0x4EDE, 0x1019, 0x4EDF, 0x101B, 0x4EE0, 0x37E7, 0x4EE1, 0x20B4,
- 0x4EE3, 0x0B45, 0x4EE4, 0x0FA9, 0x4EE5, 0x048E, 0x4EEB, 0x4362,
- 0x4EED, 0x101A, 0x4EEE, 0x053E, 0x4EF0, 0x06BC, 0x4EF1, 0x4364,
- 0x4EF2, 0x0BA5, 0x4EF3, 0x4AC8, 0x4EF5, 0x4365, 0x4EF6, 0x0745,
- 0x4EF7, 0x101C, 0x4EFB, 0x0CDA, 0x4EFC, 0x20B5, 0x4EFD, 0x37E8,
- 0x4EFF, 0x37E9, 0x4F00, 0x20B6, 0x4F01, 0x0627, 0x4F03, 0x20B7,
- 0x4F09, 0x101D, 0x4F0A, 0x048F, 0x4F0B, 0x37EA, 0x4F0C, 0x4AC9,
- 0x4F0D, 0x0794, 0x4F0E, 0x0628, 0x4F0F, 0x0DEC, 0x4F10, 0x0D46,
- 0x4F11, 0x0673, 0x4F15, 0x37EB, 0x4F16, 0x4366, 0x4F19, 0x4ACA,
- 0x4F1A, 0x0571, 0x4F1C, 0x1040, 0x4F1D, 0x0C3B, 0x4F2B, 0x4ACB,
- 0x4F2E, 0x4ACC, 0x4F2F, 0x0D22, 0x4F30, 0x101F, 0x4F31, 0x4ACD,
- 0x4F34, 0x0D50, 0x4F36, 0x0FAA, 0x4F37, 0x4368, 0x4F38, 0x09F3,
- 0x4F39, 0x20B8, 0x4F3A, 0x0895, 0x4F3B, 0x37ED, 0x4F3C, 0x08C5,
- 0x4F3D, 0x0540, 0x4F3E, 0x4369, 0x4F43, 0x0BED, 0x4F46, 0x0B60,
- 0x4F47, 0x1023, 0x4F48, 0x418B, 0x4F49, 0x37EE, 0x4F4D, 0x0490,
- 0x4F4E, 0x0BFF, 0x4F4F, 0x0945, 0x4F50, 0x0824, 0x4F51, 0x0F0E,
- 0x4F53, 0x0B2E, 0x4F54, 0x37EF, 0x4F55, 0x053F, 0x4F56, 0x20B9,
- 0x4F57, 0x1022, 0x4F58, 0x436A, 0x4F59, 0x0F28, 0x4F5A, 0x101E,
- 0x4F5B, 0x1020, 0x4F5C, 0x085E, 0x4F5D, 0x1021, 0x4F5E, 0x11D3,
- 0x4F5F, 0x418C, 0x4F60, 0x37EC, 0x4F64, 0x4367, 0x4F69, 0x1029,
- 0x4F6A, 0x418D, 0x4F6C, 0x418E, 0x4F6F, 0x102C, 0x4F70, 0x102A,
- 0x4F73, 0x0542, 0x4F75, 0x0E0B, 0x4F76, 0x1024, 0x4F77, 0x436C,
- 0x4F78, 0x436D, 0x4F7A, 0x37F0, 0x4F7B, 0x1028, 0x4F7C, 0x07A7,
- 0x4F7D, 0x37F1, 0x4F7E, 0x37F2, 0x4F7F, 0x0896, 0x4F82, 0x436E,
- 0x4F83, 0x05E2, 0x4F84, 0x4ACE, 0x4F85, 0x436F, 0x4F86, 0x102D,
- 0x4F88, 0x1025, 0x4F8A, 0x20BB, 0x4F8B, 0x0FAB, 0x4F8D, 0x08C6,
- 0x4F8F, 0x1026, 0x4F91, 0x102B, 0x4F92, 0x20BA, 0x4F94, 0x20BD,
- 0x4F96, 0x102E, 0x4F97, 0x37F3, 0x4F98, 0x1027, 0x4F9A, 0x20BC,
- 0x4F9B, 0x0699, 0x4F9D, 0x0491, 0x4F9E, 0x4ACF, 0x4FA0, 0x069A,
- 0x4FA1, 0x0541, 0x4FAB, 0x11D4, 0x4FAD, 0x0EA7, 0x4FAE, 0x0DE0,
- 0x4FAF, 0x07A8, 0x4FB2, 0x4371, 0x4FB5, 0x09F5, 0x4FB6, 0x0F7F,
- 0x4FB7, 0x4AD0, 0x4FBE, 0x37F4, 0x4FBF, 0x0E28, 0x4FC2, 0x070E,
- 0x4FC3, 0x0B05, 0x4FC4, 0x0564, 0x4FC5, 0x4372, 0x4FC9, 0x20AC,
- 0x4FCA, 0x095D, 0x4FCB, 0x4373, 0x4FCD, 0x20BE, 0x4FCE, 0x1032,
- 0x4FCF, 0x37F5, 0x4FD0, 0x1037, 0x4FD1, 0x1035, 0x4FD2, 0x4374,
- 0x4FD3, 0x3C2F, 0x4FD4, 0x1030, 0x4FD7, 0x0B0F, 0x4FD8, 0x1033,
- 0x4FDA, 0x1036, 0x4FDB, 0x1034, 0x4FDD, 0x0E2D, 0x4FDF, 0x1031,
- 0x4FE0, 0x1DEC, 0x4FE1, 0x09F4, 0x4FE3, 0x0EA1, 0x4FE4, 0x1038,
- 0x4FE5, 0x1039, 0x4FE6, 0x4370, 0x4FEE, 0x092E, 0x4FEF, 0x1046,
- 0x4FF1, 0x35A3, 0x4FF2, 0x4376, 0x4FF3, 0x0D06, 0x4FF5, 0x0DA8,
- 0x4FF6, 0x1041, 0x4FF8, 0x0E40, 0x4FFA, 0x0536, 0x4FFD, 0x37F6,
- 0x4FFE, 0x1045, 0x4FFF, 0x20C1, 0x5000, 0x37F7, 0x5001, 0x37F8,
- 0x5002, 0x4F4B, 0x5004, 0x4AD1, 0x5005, 0x103F, 0x5006, 0x1048,
- 0x5009, 0x0AD4, 0x500B, 0x0778, 0x500C, 0x4AD2, 0x500D, 0x0D12,
- 0x500E, 0x418F, 0x500F, 0x1600, 0x5010, 0x37F9, 0x5011, 0x1047,
- 0x5012, 0x0C57, 0x5013, 0x4377, 0x5014, 0x103C, 0x5016, 0x07AA,
- 0x5018, 0x4190, 0x5019, 0x07A9, 0x501A, 0x103A, 0x501B, 0x37FA,
- 0x501C, 0x4378, 0x501E, 0x20C2, 0x501F, 0x0906, 0x5021, 0x1042,
- 0x5022, 0x20C0, 0x5023, 0x0E3F, 0x5024, 0x0B8B, 0x5025, 0x103E,
- 0x5026, 0x0747, 0x5027, 0x37FB, 0x5028, 0x103B, 0x5029, 0x1043,
- 0x502A, 0x103D, 0x502B, 0x0F99, 0x502C, 0x1044, 0x502D, 0x0FE7,
- 0x502E, 0x37FC, 0x5036, 0x06DE, 0x5039, 0x0746, 0x503B, 0x3800,
- 0x5040, 0x20BF, 0x5041, 0x4191, 0x5042, 0x20C5, 0x5043, 0x1049,
- 0x5046, 0x20C3, 0x5047, 0x104A, 0x5048, 0x104E, 0x5049, 0x0492,
- 0x504C, 0x4AD3, 0x504E, 0x4379, 0x504F, 0x0E20, 0x5050, 0x104D,
- 0x5053, 0x437A, 0x5055, 0x104C, 0x5056, 0x1050, 0x5057, 0x37FD,
- 0x505A, 0x104F, 0x505C, 0x0C00, 0x505F, 0x4AD4, 0x5062, 0x4AD5,
- 0x5063, 0x437B, 0x5065, 0x0748, 0x5066, 0x37FE, 0x506A, 0x37FF,
- 0x506C, 0x1051, 0x5070, 0x20C4, 0x5072, 0x08F1, 0x5074, 0x0B06,
- 0x5075, 0x0C01, 0x5076, 0x06EE, 0x5077, 0x4AD6, 0x5078, 0x1052,
- 0x507D, 0x0650, 0x5080, 0x1053, 0x5085, 0x1055, 0x5088, 0x437D,
- 0x508D, 0x0E63, 0x508E, 0x4AD7, 0x508F, 0x3801, 0x5091, 0x073C,
- 0x5092, 0x437E, 0x5093, 0x437F, 0x5094, 0x20C6, 0x5095, 0x4380,
- 0x5096, 0x3802, 0x5098, 0x087F, 0x5099, 0x0D8B, 0x509A, 0x1054,
- 0x509C, 0x3803, 0x509E, 0x4AD8, 0x50A2, 0x4AD9, 0x50A3, 0x437C,
- 0x50AA, 0x4381, 0x50AC, 0x0835, 0x50AD, 0x0F2D, 0x50B1, 0x4383,
- 0x50B2, 0x1057, 0x50B3, 0x105A, 0x50B4, 0x1056, 0x50B5, 0x0834,
- 0x50B7, 0x0987, 0x50BA, 0x4384, 0x50BB, 0x4385, 0x50BE, 0x070F,
- 0x50C2, 0x105B, 0x50C3, 0x4ADA, 0x50C4, 0x4386, 0x50C5, 0x06C7,
- 0x50C7, 0x4387, 0x50C9, 0x1058, 0x50CA, 0x1059, 0x50CC, 0x3804,
- 0x50CD, 0x0C87, 0x50CE, 0x438A, 0x50CF, 0x0AFE, 0x50D0, 0x4193,
- 0x50D1, 0x069B, 0x50D4, 0x438C, 0x50D5, 0x0E7B, 0x50D6, 0x105C,
- 0x50D8, 0x20C8, 0x50D9, 0x3C30, 0x50DA, 0x0F85, 0x50DE, 0x105D,
- 0x50E1, 0x438D, 0x50E3, 0x1060, 0x50E5, 0x105E, 0x50E6, 0x3805,
- 0x50E7, 0x0AD0, 0x50E8, 0x4ADB, 0x50E9, 0x3806, 0x50ED, 0x105F,
- 0x50EE, 0x1061, 0x50EF, 0x3807, 0x50F0, 0x3C31, 0x50F1, 0x4ADC,
- 0x50F2, 0x4192, 0x50F3, 0x4388, 0x50F4, 0x20C7, 0x50F5, 0x1063,
- 0x50F9, 0x1062, 0x50FB, 0x0E18, 0x50FE, 0x4ADD, 0x5100, 0x0651,
- 0x5101, 0x1065, 0x5102, 0x1066, 0x5103, 0x4195, 0x5104, 0x052F,
- 0x5106, 0x4194, 0x5107, 0x4ADE, 0x5108, 0x3808, 0x5109, 0x1064,
- 0x510B, 0x3809, 0x510C, 0x4ADF, 0x510D, 0x4AE0, 0x510E, 0x4AE1,
- 0x5110, 0x380A, 0x5112, 0x0920, 0x5114, 0x1069, 0x5115, 0x1068,
- 0x5116, 0x1067, 0x5117, 0x4390, 0x5118, 0x102F, 0x511A, 0x106A,
- 0x511B, 0x380B, 0x511E, 0x380C, 0x511F, 0x0988, 0x5121, 0x106B,
- 0x512A, 0x0F0F, 0x5132, 0x0EE5, 0x5133, 0x4AE2, 0x5135, 0x4196,
- 0x5137, 0x106D, 0x5138, 0x4AE3, 0x513A, 0x106C, 0x513B, 0x106F,
- 0x513C, 0x106E, 0x513F, 0x1070, 0x5140, 0x1071, 0x5141, 0x04B8,
- 0x5143, 0x0769, 0x5144, 0x0711, 0x5145, 0x0946, 0x5146, 0x0BB9,
- 0x5147, 0x069C, 0x5148, 0x0A8C, 0x5149, 0x07AB, 0x514A, 0x20C9,
- 0x514B, 0x0800, 0x514C, 0x1073, 0x514D, 0x0ED4, 0x514E, 0x0C40,
- 0x5150, 0x08C7, 0x5152, 0x1072, 0x5154, 0x1074, 0x5155, 0x4197,
- 0x5157, 0x4198, 0x515A, 0x0C58, 0x515C, 0x05D3, 0x515F, 0x380D,
- 0x5160, 0x4392, 0x5162, 0x1075, 0x5164, 0x20CA, 0x5165, 0x0CD6,
- 0x5167, 0x368E, 0x5168, 0x0AB6, 0x5169, 0x1077, 0x516A, 0x1078,
- 0x516B, 0x0D40, 0x516C, 0x07AC, 0x516D, 0x0FE1, 0x516E, 0x1079,
- 0x5171, 0x069E, 0x5173, 0x4394, 0x5174, 0x4AE4, 0x5175, 0x0E0C,
- 0x5176, 0x0B16, 0x5177, 0x06E9, 0x5178, 0x0C2F, 0x5179, 0x3779,
- 0x517B, 0x47D9, 0x517C, 0x0749, 0x5180, 0x107A, 0x5182, 0x107B,
- 0x5183, 0x4395, 0x5184, 0x4AE5, 0x5185, 0x0CBA, 0x5186, 0x0501,
- 0x5189, 0x107E, 0x518A, 0x086D, 0x518B, 0x4396, 0x518C, 0x107D,
- 0x518D, 0x0836, 0x518F, 0x107F, 0x5190, 0x185B, 0x5191, 0x1080,
- 0x5192, 0x0E6F, 0x5193, 0x1081, 0x5195, 0x1082, 0x5196, 0x1083,
- 0x5197, 0x09D1, 0x5198, 0x4398, 0x5199, 0x08F8, 0x519D, 0x20CB,
- 0x51A0, 0x05E3, 0x51A1, 0x380E, 0x51A2, 0x1086, 0x51A3, 0x4399,
- 0x51A4, 0x1084, 0x51A5, 0x0EC9, 0x51A6, 0x1085, 0x51A8, 0x0DCC,
- 0x51A9, 0x1087, 0x51AA, 0x1088, 0x51AB, 0x1089, 0x51AC, 0x0C59,
- 0x51AD, 0x439A, 0x51B0, 0x108D, 0x51B1, 0x108B, 0x51B2, 0x108C,
- 0x51B3, 0x108A, 0x51B4, 0x0853, 0x51B5, 0x108E, 0x51B6, 0x0EF6,
- 0x51B7, 0x0FAC, 0x51B8, 0x4AE6, 0x51BA, 0x4AE7, 0x51BC, 0x380F,
- 0x51BD, 0x108F, 0x51BE, 0x20CC, 0x51C3, 0x3C32, 0x51C4, 0x0A4C,
- 0x51C5, 0x1090, 0x51C6, 0x0964, 0x51C8, 0x4AE8, 0x51C9, 0x1091,
- 0x51CA, 0x419A, 0x51CB, 0x0BBA, 0x51CC, 0x0F87, 0x51CD, 0x0C5A,
- 0x51CF, 0x4AE9, 0x51D1, 0x4AEA, 0x51D3, 0x4AEB, 0x51D4, 0x4AEC,
- 0x51D6, 0x10DA, 0x51D8, 0x4AED, 0x51DB, 0x1092, 0x51DC, 0x205C,
- 0x51DD, 0x06BD, 0x51DE, 0x4F4C, 0x51DF, 0x4AEE, 0x51E0, 0x1093,
- 0x51E1, 0x0E8C, 0x51E2, 0x419B, 0x51E6, 0x0972, 0x51E7, 0x0B5C,
- 0x51E9, 0x1095, 0x51EA, 0x0CBC, 0x51EC, 0x20CD, 0x51ED, 0x1096,
- 0x51EE, 0x3811, 0x51F0, 0x1097, 0x51F1, 0x058C, 0x51F3, 0x439D,
- 0x51F4, 0x3812, 0x51F5, 0x1098, 0x51F6, 0x069F, 0x51F8, 0x0CA4,
- 0x51F9, 0x051C, 0x51FA, 0x095A, 0x51FD, 0x0D35, 0x51FE, 0x1099,
- 0x5200, 0x0C5B, 0x5201, 0x3813, 0x5202, 0x3814, 0x5203, 0x0A15,
- 0x5204, 0x109A, 0x5205, 0x4AEF, 0x5206, 0x0DFC, 0x5207, 0x0A7E,
- 0x5208, 0x05DE, 0x520A, 0x05E5, 0x520B, 0x109B, 0x520E, 0x109D,
- 0x5211, 0x0710, 0x5212, 0x439E, 0x5213, 0x3815, 0x5214, 0x109C,
- 0x5215, 0x20CE, 0x5216, 0x439F, 0x5217, 0x0FBB, 0x521D, 0x0973,
- 0x5224, 0x0D51, 0x5225, 0x0E1C, 0x5226, 0x4AF0, 0x5227, 0x109E,
- 0x5228, 0x4AF1, 0x5229, 0x0F62, 0x522A, 0x109F, 0x522B, 0x4AF2,
- 0x522E, 0x10A0, 0x5230, 0x0C78, 0x5231, 0x4AF3, 0x5232, 0x4AF4,
- 0x5233, 0x10A1, 0x5235, 0x4AF5, 0x5236, 0x0A4D, 0x5237, 0x086E,
- 0x5238, 0x074A, 0x5239, 0x10A2, 0x523A, 0x0897, 0x523B, 0x0801,
- 0x523C, 0x4AF6, 0x5243, 0x0C02, 0x5244, 0x10A4, 0x5247, 0x0B07,
- 0x5249, 0x3816, 0x524A, 0x085F, 0x524B, 0x10A5, 0x524C, 0x10A6,
- 0x524D, 0x0AB2, 0x524F, 0x10A3, 0x5254, 0x10A8, 0x5255, 0x43A1,
- 0x5256, 0x0E64, 0x5257, 0x419C, 0x525A, 0x4AF7, 0x525B, 0x07F6,
- 0x525C, 0x43A2, 0x525D, 0x1E5E, 0x525E, 0x10A7, 0x5260, 0x4AF8,
- 0x5261, 0x3817, 0x5263, 0x074B, 0x5264, 0x084E, 0x5265, 0x0D23,
- 0x5266, 0x3818, 0x5269, 0x10AB, 0x526A, 0x10A9, 0x526C, 0x43A3,
- 0x526E, 0x4AF9, 0x526F, 0x0DED, 0x5270, 0x09D2, 0x5271, 0x10B2,
- 0x5272, 0x05C2, 0x5273, 0x10AC, 0x5274, 0x10AA, 0x5275, 0x0AD1,
- 0x5277, 0x43A4, 0x5278, 0x4AFA, 0x5279, 0x4AFB, 0x527D, 0x10AE,
- 0x527F, 0x10AD, 0x5282, 0x43A6, 0x5283, 0x05A2, 0x5284, 0x43A5,
- 0x5287, 0x0736, 0x5288, 0x10B3, 0x5289, 0x0F75, 0x528A, 0x4AFC,
- 0x528C, 0x4AFD, 0x528D, 0x10AF, 0x5291, 0x10B4, 0x5292, 0x10B1,
- 0x5293, 0x3819, 0x5294, 0x10B0, 0x5298, 0x43A8, 0x529B, 0x0F97,
- 0x529C, 0x20CF, 0x529F, 0x07AD, 0x52A0, 0x0543, 0x52A3, 0x0FBC,
- 0x52A4, 0x43AA, 0x52A6, 0x20D0, 0x52A9, 0x097F, 0x52AA, 0x0C52,
- 0x52AB, 0x07F7, 0x52AC, 0x10B7, 0x52AD, 0x10B8, 0x52AF, 0x217D,
- 0x52B1, 0x0FAD, 0x52B4, 0x0FD1, 0x52B5, 0x10BA, 0x52B9, 0x07AE,
- 0x52BA, 0x43AB, 0x52BB, 0x43AC, 0x52BC, 0x10B9, 0x52BE, 0x058D,
- 0x52C0, 0x20D1, 0x52C1, 0x10BB, 0x52C3, 0x0E84, 0x52C5, 0x0BD8,
- 0x52C7, 0x0F10, 0x52C8, 0x381A, 0x52C9, 0x0E29, 0x52CA, 0x43AD,
- 0x52CC, 0x419D, 0x52CD, 0x10BC, 0x52D0, 0x36E8, 0x52D1, 0x43AE,
- 0x52D2, 0x1BEE, 0x52D5, 0x0C88, 0x52D6, 0x419E, 0x52D7, 0x10BD,
- 0x52D8, 0x05E6, 0x52D9, 0x0EBF, 0x52DB, 0x20D2, 0x52DD, 0x0989,
- 0x52DE, 0x10BE, 0x52DF, 0x0E37, 0x52E0, 0x10C2, 0x52E1, 0x4AFE,
- 0x52E2, 0x0A4E, 0x52E3, 0x10BF, 0x52E4, 0x06C8, 0x52E6, 0x10C0,
- 0x52E7, 0x05E7, 0x52E9, 0x4AFF, 0x52F0, 0x381B, 0x52F1, 0x4B00,
- 0x52F2, 0x0704, 0x52F3, 0x10C3, 0x52F5, 0x10C4, 0x52F7, 0x43B0,
- 0x52F8, 0x10C5, 0x52F9, 0x10C6, 0x52FA, 0x0907, 0x52FB, 0x419F,
- 0x52FE, 0x07AF, 0x52FF, 0x0EEA, 0x5300, 0x20D3, 0x5301, 0x0EF4,
- 0x5302, 0x0CCF, 0x5303, 0x4B01, 0x5305, 0x0E41, 0x5306, 0x10C7,
- 0x5307, 0x4F4D, 0x5308, 0x10C8, 0x530A, 0x381C, 0x530B, 0x381D,
- 0x530D, 0x10CA, 0x530F, 0x10CC, 0x5310, 0x10CB, 0x5311, 0x4B02,
- 0x5315, 0x10CD, 0x5316, 0x053D, 0x5317, 0x0E7A, 0x5319, 0x086C,
- 0x531A, 0x10CE, 0x531C, 0x41A0, 0x531D, 0x0ADB, 0x531F, 0x4B03,
- 0x5320, 0x098A, 0x5321, 0x06A1, 0x5323, 0x10CF, 0x5324, 0x20D5,
- 0x532A, 0x0D6F, 0x532D, 0x4B04, 0x532F, 0x10D0, 0x5331, 0x10D1,
- 0x5332, 0x4B05, 0x5333, 0x10D2, 0x5335, 0x43B1, 0x5338, 0x10D3,
- 0x5339, 0x0D96, 0x533A, 0x06E0, 0x533B, 0x04A9, 0x533D, 0x4B06,
- 0x533E, 0x381E, 0x533F, 0x0C97, 0x5340, 0x10D4, 0x5341, 0x0947,
- 0x5342, 0x43B2, 0x5343, 0x0A8D, 0x5345, 0x10D6, 0x5346, 0x10D5,
- 0x5347, 0x098B, 0x5348, 0x0795, 0x5349, 0x10D8, 0x534A, 0x0D52,
- 0x534B, 0x3820, 0x534C, 0x381F, 0x534D, 0x10D9, 0x5351, 0x0D70,
- 0x5352, 0x0B14, 0x5353, 0x0B4E, 0x5354, 0x06A0, 0x5357, 0x0CC6,
- 0x5358, 0x0B6F, 0x535A, 0x0D24, 0x535C, 0x0E7C, 0x535E, 0x10DB,
- 0x5360, 0x0A8E, 0x5361, 0x3821, 0x5363, 0x41A1, 0x5365, 0x4B07,
- 0x5366, 0x070B, 0x5367, 0x43B5, 0x5369, 0x10DC, 0x536C, 0x3822,
- 0x536D, 0x4B08, 0x536E, 0x10DD, 0x536F, 0x04CE, 0x5370, 0x04B9,
- 0x5371, 0x0629, 0x5372, 0x20D6, 0x5373, 0x0B08, 0x5374, 0x066B,
- 0x5375, 0x0F5B, 0x5377, 0x10E0, 0x5378, 0x0537, 0x5379, 0x4B09,
- 0x537A, 0x43B6, 0x537B, 0x10DF, 0x537D, 0x3435, 0x537E, 0x4B0A,
- 0x537F, 0x06A2, 0x5382, 0x10E1, 0x5384, 0x0EFD, 0x5389, 0x37D0,
- 0x5393, 0x20D7, 0x5394, 0x4B0B, 0x5396, 0x10E2, 0x5398, 0x0F9A,
- 0x5399, 0x4B0C, 0x539A, 0x07B0, 0x539D, 0x41A2, 0x539F, 0x076A,
- 0x53A0, 0x10E3, 0x53A4, 0x43B7, 0x53A5, 0x10E5, 0x53A6, 0x10E4,
- 0x53A8, 0x0A25, 0x53A9, 0x04DB, 0x53AA, 0x4B0D, 0x53AB, 0x3823,
- 0x53AD, 0x0500, 0x53AE, 0x10E6, 0x53AF, 0x4B0E, 0x53B0, 0x10E7,
- 0x53B2, 0x20D8, 0x53B3, 0x076B, 0x53B4, 0x43B8, 0x53B6, 0x10E8,
- 0x53B7, 0x43BA, 0x53BA, 0x4B0F, 0x53BB, 0x0688, 0x53C0, 0x43BB,
- 0x53C1, 0x4B10, 0x53C2, 0x0880, 0x53C3, 0x10E9, 0x53C4, 0x4B11,
- 0x53C5, 0x4B12, 0x53C8, 0x0EA2, 0x53C9, 0x0825, 0x53CA, 0x0674,
- 0x53CB, 0x0F11, 0x53CC, 0x0AD2, 0x53CD, 0x0D53, 0x53CE, 0x0929,
- 0x53D4, 0x0951, 0x53D5, 0x43BF, 0x53D6, 0x0914, 0x53D7, 0x0921,
- 0x53D9, 0x0980, 0x53DA, 0x3824, 0x53DB, 0x0D54, 0x53DD, 0x20D9,
- 0x53DF, 0x10EC, 0x53E0, 0x4B13, 0x53E1, 0x04E5, 0x53E2, 0x0AD3,
- 0x53E3, 0x07B1, 0x53E4, 0x0779, 0x53E5, 0x06DF, 0x53E6, 0x3825,
- 0x53E8, 0x10F0, 0x53E9, 0x0B5F, 0x53EA, 0x0B5E, 0x53EB, 0x06A3,
- 0x53EC, 0x098C, 0x53ED, 0x10F1, 0x53EE, 0x10EF, 0x53EF, 0x0544,
- 0x53F0, 0x0B46, 0x53F1, 0x08E4, 0x53F2, 0x0899, 0x53F3, 0x04C8,
- 0x53F4, 0x43C1, 0x53F5, 0x3826, 0x53F6, 0x05CE, 0x53F7, 0x07F8,
- 0x53F8, 0x0898, 0x53FA, 0x10F2, 0x5401, 0x10F3, 0x5403, 0x0663,
- 0x5404, 0x05A4, 0x5408, 0x07F9, 0x5409, 0x0662, 0x540A, 0x0BFB,
- 0x540B, 0x04C7, 0x540C, 0x0C89, 0x540D, 0x0ECA, 0x540E, 0x07B3,
- 0x540F, 0x0F63, 0x5410, 0x0C41, 0x5411, 0x07B2, 0x5412, 0x41A3,
- 0x5413, 0x4B14, 0x541B, 0x0705, 0x541D, 0x10FC, 0x541E, 0x368C,
- 0x541F, 0x06DB, 0x5420, 0x0E78, 0x5424, 0x43C2, 0x5426, 0x0D71,
- 0x5427, 0x3827, 0x5428, 0x43C3, 0x5429, 0x10FB, 0x542A, 0x4B15,
- 0x542B, 0x061A, 0x542C, 0x10F6, 0x542D, 0x10F7, 0x542E, 0x10F9,
- 0x5431, 0x4B16, 0x5433, 0x35C0, 0x5434, 0x4B17, 0x5435, 0x4B18,
- 0x5436, 0x10FA, 0x5438, 0x0675, 0x5439, 0x0A27, 0x543B, 0x0DFD,
- 0x543C, 0x10F8, 0x543D, 0x10F4, 0x543E, 0x0797, 0x543F, 0x35CF,
- 0x5440, 0x10F5, 0x5442, 0x0FCA, 0x5443, 0x43C5, 0x5446, 0x0E42,
- 0x5448, 0x0C04, 0x5449, 0x0796, 0x544A, 0x0802, 0x544C, 0x4B19,
- 0x544D, 0x3828, 0x544E, 0x10FD, 0x5451, 0x0CB5, 0x5455, 0x3723,
- 0x545F, 0x1101, 0x5462, 0x43C6, 0x5466, 0x3829, 0x5468, 0x092A,
- 0x546A, 0x0922, 0x546B, 0x382A, 0x546C, 0x43C7, 0x5470, 0x1104,
- 0x5471, 0x1102, 0x5473, 0x0EAF, 0x5474, 0x382B, 0x5475, 0x10FF,
- 0x5476, 0x1108, 0x5477, 0x1103, 0x547B, 0x1106, 0x547C, 0x077A,
- 0x547D, 0x0ECB, 0x547F, 0x41A4, 0x5480, 0x1107, 0x5484, 0x1109,
- 0x5486, 0x110B, 0x5488, 0x41A5, 0x548A, 0x20DC, 0x548B, 0x0860,
- 0x548C, 0x0FE8, 0x548D, 0x382C, 0x548E, 0x1100, 0x548F, 0x10FE,
- 0x5490, 0x110A, 0x5492, 0x1105, 0x5495, 0x43C8, 0x5496, 0x382D,
- 0x549C, 0x20DB, 0x54A0, 0x43C9, 0x54A1, 0x382E, 0x54A2, 0x110D,
- 0x54A4, 0x1116, 0x54A5, 0x110F, 0x54A6, 0x43CA, 0x54A7, 0x4B1A,
- 0x54A8, 0x1113, 0x54A9, 0x20DD, 0x54AA, 0x4B1B, 0x54AB, 0x1114,
- 0x54AC, 0x1110, 0x54AD, 0x382F, 0x54AE, 0x43CB, 0x54AF, 0x1131,
- 0x54B1, 0x4B1C, 0x54B2, 0x0859, 0x54B3, 0x058F, 0x54B7, 0x43CC,
- 0x54B8, 0x110E, 0x54B9, 0x3830, 0x54BA, 0x43CD, 0x54BB, 0x4B1D,
- 0x54BC, 0x1118, 0x54BD, 0x04BA, 0x54BE, 0x1117, 0x54BF, 0x3831,
- 0x54C0, 0x0469, 0x54C1, 0x0DBC, 0x54C2, 0x1115, 0x54C3, 0x43CE,
- 0x54C4, 0x1111, 0x54C6, 0x3832, 0x54C7, 0x110C, 0x54C8, 0x1112,
- 0x54C9, 0x0838, 0x54CD, 0x3833, 0x54CE, 0x4B1E, 0x54D8, 0x1119,
- 0x54E1, 0x04BB, 0x54E2, 0x1122, 0x54E5, 0x111A, 0x54E6, 0x111B,
- 0x54E8, 0x098D, 0x54E9, 0x0E97, 0x54EA, 0x4B1F, 0x54EC, 0x43D0,
- 0x54ED, 0x1120, 0x54EE, 0x111F, 0x54EF, 0x43D1, 0x54F1, 0x43D2,
- 0x54F2, 0x0C29, 0x54F3, 0x43D3, 0x54FA, 0x1121, 0x54FC, 0x4B20,
- 0x54FD, 0x111E, 0x54FF, 0x20DE, 0x5500, 0x43D4, 0x5501, 0x43D5,
- 0x5504, 0x04D6, 0x5505, 0x4B21, 0x5506, 0x0826, 0x5507, 0x09F6,
- 0x5508, 0x4B22, 0x5509, 0x43D6, 0x550E, 0x3834, 0x550F, 0x111C,
- 0x5510, 0x0C5C, 0x5514, 0x111D, 0x5515, 0x4B23, 0x5516, 0x0466,
- 0x5527, 0x4B24, 0x552A, 0x4B25, 0x552B, 0x3835, 0x552E, 0x1127,
- 0x552F, 0x0F0D, 0x5531, 0x098F, 0x5533, 0x112D, 0x5535, 0x3836,
- 0x5536, 0x4B26, 0x5538, 0x112C, 0x5539, 0x1123, 0x553C, 0x43D7,
- 0x553E, 0x0B23, 0x5540, 0x1124, 0x5541, 0x43D8, 0x5544, 0x0B4F,
- 0x5545, 0x1129, 0x5546, 0x098E, 0x5547, 0x43DA, 0x554A, 0x3837,
- 0x554C, 0x1126, 0x554F, 0x0EF0, 0x5550, 0x41A6, 0x5551, 0x4B27,
- 0x5553, 0x0712, 0x5556, 0x112A, 0x5557, 0x112B, 0x555C, 0x1128,
- 0x555D, 0x112E, 0x555E, 0x1DD1, 0x5560, 0x3838, 0x5561, 0x4F54,
- 0x5563, 0x1125, 0x5564, 0x43DC, 0x5566, 0x4B28, 0x557B, 0x1134,
- 0x557C, 0x1139, 0x557D, 0x43DE, 0x557E, 0x1135, 0x5580, 0x1130,
- 0x5581, 0x41A7, 0x5582, 0x43DF, 0x5583, 0x113A, 0x5584, 0x0AB3,
- 0x5586, 0x20DF, 0x5587, 0x113C, 0x5588, 0x383A, 0x5589, 0x07B4,
- 0x558A, 0x1132, 0x558B, 0x0BBB, 0x558E, 0x383B, 0x558F, 0x4B29,
- 0x5591, 0x43E0, 0x5592, 0x4B2A, 0x5594, 0x4B2B, 0x5598, 0x1136,
- 0x5599, 0x112F, 0x559A, 0x05E9, 0x559C, 0x062A, 0x559D, 0x05C3,
- 0x559E, 0x1137, 0x559F, 0x1133, 0x55A4, 0x4B2C, 0x55A7, 0x074C,
- 0x55A8, 0x113D, 0x55A9, 0x113B, 0x55AA, 0x0AD5, 0x55AB, 0x0664,
- 0x55AC, 0x06A4, 0x55AD, 0x41A8, 0x55AE, 0x1138, 0x55B0, 0x06EC,
- 0x55B2, 0x4B2D, 0x55B6, 0x04E6, 0x55BF, 0x43E5, 0x55C3, 0x4B2E,
- 0x55C4, 0x1141, 0x55C5, 0x113F, 0x55C6, 0x4B2F, 0x55C7, 0x1178,
- 0x55C9, 0x43E6, 0x55CC, 0x43E7, 0x55CE, 0x41A9, 0x55D1, 0x43E8,
- 0x55D2, 0x43E2, 0x55D3, 0x4B30, 0x55D4, 0x1144, 0x55DA, 0x113E,
- 0x55DB, 0x4B31, 0x55DC, 0x1142, 0x55DD, 0x43E9, 0x55DF, 0x1140,
- 0x55E2, 0x43EB, 0x55E3, 0x089A, 0x55E4, 0x1143, 0x55E9, 0x43ED,
- 0x55EC, 0x4B32, 0x55EE, 0x4B33, 0x55F1, 0x4B34, 0x55F6, 0x4B35,
- 0x55F7, 0x1146, 0x55F8, 0x4B36, 0x55F9, 0x114B, 0x55FD, 0x1149,
- 0x55FE, 0x1148, 0x5605, 0x4B37, 0x5606, 0x0B70, 0x5607, 0x43F0,
- 0x5608, 0x383C, 0x5609, 0x0545, 0x560D, 0x4B38, 0x560E, 0x383D,
- 0x560F, 0x383E, 0x5610, 0x43F1, 0x5611, 0x4B39, 0x5612, 0x4B3A,
- 0x5614, 0x1145, 0x5616, 0x1147, 0x5617, 0x0990, 0x5618, 0x04D5,
- 0x561B, 0x114A, 0x5620, 0x3C1D, 0x5628, 0x43EE, 0x5629, 0x055E,
- 0x562C, 0x4B3B, 0x562F, 0x1155, 0x5630, 0x43F2, 0x5631, 0x09E4,
- 0x5632, 0x1151, 0x5634, 0x114F, 0x5635, 0x4B3C, 0x5636, 0x1150,
- 0x5637, 0x383F, 0x5638, 0x1152, 0x5639, 0x4B3D, 0x563B, 0x41AA,
- 0x563D, 0x43F4, 0x563F, 0x3840, 0x5640, 0x43F5, 0x5642, 0x04DF,
- 0x5647, 0x43F6, 0x5649, 0x3841, 0x564B, 0x3842, 0x564C, 0x0ABB,
- 0x564D, 0x4B3E, 0x564E, 0x114C, 0x564F, 0x3843, 0x5650, 0x114D,
- 0x5653, 0x1F1B, 0x5654, 0x4B3F, 0x565B, 0x05D8, 0x565E, 0x43F7,
- 0x5660, 0x43F8, 0x5664, 0x1154, 0x5666, 0x3844, 0x5668, 0x062B,
- 0x5669, 0x3845, 0x566A, 0x1157, 0x566B, 0x1153, 0x566C, 0x1156,
- 0x566D, 0x43F9, 0x566F, 0x3846, 0x5671, 0x3847, 0x5672, 0x3848,
- 0x5674, 0x0DFE, 0x5676, 0x3C33, 0x5678, 0x0CAD, 0x567A, 0x0D4C,
- 0x5680, 0x1159, 0x5685, 0x4B40, 0x5686, 0x1158, 0x5687, 0x05A3,
- 0x5688, 0x43FB, 0x568A, 0x115A, 0x568C, 0x43FC, 0x568F, 0x115D,
- 0x5694, 0x115C, 0x5695, 0x3849, 0x5699, 0x1DE6, 0x569A, 0x384A,
- 0x569D, 0x43FD, 0x569E, 0x41AB, 0x569F, 0x4B41, 0x56A0, 0x115B,
- 0x56A2, 0x0CEF, 0x56A5, 0x115E, 0x56A6, 0x4B42, 0x56A8, 0x43FE,
- 0x56A9, 0x41AC, 0x56AC, 0x384B, 0x56AD, 0x384C, 0x56AE, 0x115F,
- 0x56B1, 0x384D, 0x56B2, 0x43FF, 0x56B3, 0x41AD, 0x56B4, 0x1161,
- 0x56B6, 0x1160, 0x56B7, 0x4B43, 0x56BC, 0x1163, 0x56C0, 0x1166,
- 0x56C1, 0x1164, 0x56C2, 0x1162, 0x56C3, 0x1165, 0x56C5, 0x4400,
- 0x56C8, 0x1167, 0x56C9, 0x384E, 0x56CA, 0x1E5A, 0x56CC, 0x4B44,
- 0x56CD, 0x4401, 0x56CE, 0x1168, 0x56CF, 0x4B45, 0x56D1, 0x1169,
- 0x56D3, 0x116A, 0x56D7, 0x116B, 0x56D8, 0x107C, 0x56D9, 0x4B46,
- 0x56DA, 0x0928, 0x56DB, 0x089B, 0x56DD, 0x384F, 0x56DE, 0x0573,
- 0x56DF, 0x4402, 0x56E0, 0x04BC, 0x56E1, 0x4B47, 0x56E3, 0x0B82,
- 0x56E4, 0x3850, 0x56E8, 0x4403, 0x56EB, 0x4B48, 0x56ED, 0x4B49,
- 0x56EE, 0x116C, 0x56F0, 0x0814, 0x56F1, 0x4B4A, 0x56F2, 0x0493,
- 0x56F3, 0x0A24, 0x56F6, 0x4404, 0x56F7, 0x4405, 0x56F9, 0x116D,
- 0x56FA, 0x077B, 0x56FD, 0x0803, 0x56FF, 0x116F, 0x5700, 0x116E,
- 0x5703, 0x0E30, 0x5704, 0x1170, 0x5707, 0x4B4B, 0x5708, 0x1172,
- 0x5709, 0x1171, 0x570A, 0x3851, 0x570B, 0x1173, 0x570C, 0x4B4C,
- 0x570D, 0x1174, 0x570F, 0x074D, 0x5712, 0x0502, 0x5713, 0x1175,
- 0x5715, 0x3852, 0x5716, 0x1177, 0x5718, 0x1176, 0x571A, 0x4B4D,
- 0x571B, 0x4B4E, 0x571C, 0x1179, 0x571D, 0x4B4F, 0x571F, 0x0C54,
- 0x5721, 0x3680, 0x5723, 0x3853, 0x5726, 0x117A, 0x5727, 0x0479,
- 0x5728, 0x084F, 0x5729, 0x4408, 0x572C, 0x4B50, 0x572D, 0x0713,
- 0x572E, 0x4B51, 0x572F, 0x3854, 0x5730, 0x0B8D, 0x5733, 0x3855,
- 0x5734, 0x3856, 0x5737, 0x117B, 0x5738, 0x117C, 0x573B, 0x117E,
- 0x573D, 0x4B52, 0x573E, 0x4B53, 0x5740, 0x117F, 0x5742, 0x0854,
- 0x5745, 0x440A, 0x5746, 0x440B, 0x5747, 0x06C9, 0x574A, 0x0E65,
- 0x574C, 0x3857, 0x574D, 0x440C, 0x574E, 0x117D, 0x574F, 0x1180,
- 0x5750, 0x0831, 0x5751, 0x07B5, 0x5759, 0x20E0, 0x575F, 0x4B54,
- 0x5761, 0x1184, 0x5764, 0x0815, 0x5765, 0x20E1, 0x5766, 0x0B71,
- 0x5768, 0x440E, 0x5769, 0x1181, 0x576A, 0x0BF6, 0x576B, 0x4B55,
- 0x576D, 0x4B56, 0x576F, 0x440F, 0x5770, 0x3858, 0x5773, 0x4410,
- 0x5774, 0x4411, 0x5775, 0x4412, 0x5777, 0x41AE, 0x577A, 0x4B57,
- 0x577B, 0x4413, 0x577C, 0x41AF, 0x577F, 0x1185, 0x5782, 0x0A28,
- 0x5783, 0x4B58, 0x5788, 0x1183, 0x5789, 0x1186, 0x578B, 0x0715,
- 0x578C, 0x3859, 0x5793, 0x1187, 0x5797, 0x4B59, 0x579A, 0x4416,
- 0x579C, 0x385A, 0x579D, 0x4417, 0x579E, 0x4418, 0x57A0, 0x1188,
- 0x57A2, 0x07B6, 0x57A3, 0x059E, 0x57A4, 0x118A, 0x57A8, 0x4419,
- 0x57AA, 0x118B, 0x57AC, 0x20E2, 0x57AE, 0x4B5A, 0x57B0, 0x118C,
- 0x57B3, 0x1189, 0x57B8, 0x385B, 0x57C0, 0x1182, 0x57C3, 0x118D,
- 0x57C6, 0x118E, 0x57C7, 0x20E4, 0x57C8, 0x20E3, 0x57CB, 0x0E92,
- 0x57CC, 0x441C, 0x57CE, 0x09D3, 0x57CF, 0x41B1, 0x57D2, 0x1190,
- 0x57D3, 0x1191, 0x57D4, 0x118F, 0x57D5, 0x4B5B, 0x57D6, 0x1193,
- 0x57D7, 0x441A, 0x57DC, 0x0CEE, 0x57DE, 0x441F, 0x57DF, 0x04AC,
- 0x57E0, 0x0DC8, 0x57E3, 0x1194, 0x57E4, 0x41B2, 0x57E6, 0x385C,
- 0x57E7, 0x4B5C, 0x57ED, 0x385D, 0x57F0, 0x4420, 0x57F4, 0x09E5,
- 0x57F5, 0x385E, 0x57F6, 0x385F, 0x57F7, 0x08E5, 0x57F8, 0x4422,
- 0x57F9, 0x0D13, 0x57FA, 0x062C, 0x57FB, 0x4423, 0x57FC, 0x085B,
- 0x57FD, 0x4424, 0x57FF, 0x3860, 0x5800, 0x0E87, 0x5802, 0x0C8A,
- 0x5804, 0x4425, 0x5805, 0x074E, 0x5806, 0x0B2F, 0x5809, 0x3861,
- 0x580A, 0x1192, 0x580B, 0x1195, 0x580D, 0x4B5D, 0x5815, 0x0B24,
- 0x5819, 0x1196, 0x581D, 0x1197, 0x581E, 0x4426, 0x5820, 0x3862,
- 0x5821, 0x1199, 0x5824, 0x0C05, 0x5826, 0x4B5E, 0x5827, 0x4427,
- 0x582A, 0x05EA, 0x582F, 0x1D32, 0x5830, 0x0503, 0x5831, 0x0E43,
- 0x5832, 0x3863, 0x5834, 0x09D4, 0x5835, 0x0C42, 0x5839, 0x4428,
- 0x583A, 0x0856, 0x583D, 0x119F, 0x5840, 0x0E0D, 0x5841, 0x0FA5,
- 0x5849, 0x442A, 0x584A, 0x0574, 0x584B, 0x119B, 0x584C, 0x442B,
- 0x584D, 0x4B5F, 0x584F, 0x4B60, 0x5851, 0x0ABC, 0x5852, 0x119E,
- 0x5854, 0x0C5D, 0x5857, 0x0C43, 0x5858, 0x0C5E, 0x5859, 0x0D4D,
- 0x585A, 0x0BE9, 0x585E, 0x0839, 0x585F, 0x4B61, 0x5861, 0x1E47,
- 0x5862, 0x119A, 0x5864, 0x41B3, 0x5867, 0x442C, 0x5869, 0x0518,
- 0x586B, 0x0C30, 0x586D, 0x4B62, 0x5870, 0x119C, 0x5872, 0x1198,
- 0x5875, 0x0A16, 0x5879, 0x11A0, 0x587C, 0x3864, 0x587E, 0x0958,
- 0x587F, 0x4B63, 0x5880, 0x3865, 0x5881, 0x4B64, 0x5883, 0x06A5,
- 0x5885, 0x11A1, 0x5889, 0x41B4, 0x588A, 0x442D, 0x588B, 0x442E,
- 0x588D, 0x442F, 0x588F, 0x4430, 0x5890, 0x4431, 0x5893, 0x0E38,
- 0x5894, 0x4432, 0x5897, 0x0AFF, 0x5898, 0x4B65, 0x589C, 0x0BE2,
- 0x589D, 0x4433, 0x589E, 0x20E7, 0x589F, 0x11A3, 0x58A8, 0x0E7D,
- 0x58A9, 0x3866, 0x58AA, 0x4434, 0x58AB, 0x11A4, 0x58AE, 0x11A9,
- 0x58B1, 0x4435, 0x58B2, 0x20E8, 0x58B3, 0x0DFF, 0x58B8, 0x11A8,
- 0x58B9, 0x11A2, 0x58BA, 0x11A5, 0x58BB, 0x11A7, 0x58BC, 0x4B66,
- 0x58BE, 0x0816, 0x58C1, 0x0E19, 0x58C3, 0x4437, 0x58C5, 0x11AA,
- 0x58C7, 0x0B83, 0x58CA, 0x0575, 0x58CC, 0x09D5, 0x58CD, 0x4438,
- 0x58CE, 0x3867, 0x58D0, 0x3868, 0x58D1, 0x11AC, 0x58D2, 0x41B6,
- 0x58D3, 0x11AB, 0x58D4, 0x3869, 0x58D5, 0x07FA, 0x58D7, 0x11AD,
- 0x58D8, 0x11AF, 0x58D9, 0x11AE, 0x58DA, 0x386A, 0x58DC, 0x11B1,
- 0x58DE, 0x11A6, 0x58DF, 0x11B3, 0x58E0, 0x41B7, 0x58E2, 0x4439,
- 0x58E4, 0x11B2, 0x58E5, 0x11B0, 0x58E9, 0x386B, 0x58EB, 0x089C,
- 0x58EC, 0x0A17, 0x58EE, 0x0AD6, 0x58EF, 0x11B4, 0x58F0, 0x0A60,
- 0x58F1, 0x04B1, 0x58F2, 0x0D1A, 0x58F3, 0x443A, 0x58F4, 0x443B,
- 0x58F7, 0x0BF7, 0x58F9, 0x11B6, 0x58FA, 0x11B5, 0x58FB, 0x11B7,
- 0x58FC, 0x11B8, 0x58FD, 0x11B9, 0x5902, 0x11BA, 0x5905, 0x443C,
- 0x5906, 0x443D, 0x5909, 0x0E21, 0x590A, 0x11BB, 0x590B, 0x20E9,
- 0x590C, 0x386C, 0x590D, 0x443E, 0x590F, 0x0546, 0x5910, 0x11BC,
- 0x5914, 0x443F, 0x5915, 0x0F26, 0x5916, 0x058E, 0x5918, 0x10DE,
- 0x5919, 0x0952, 0x591A, 0x0B1F, 0x591B, 0x11BD, 0x591C, 0x0EF7,
- 0x591F, 0x4B67, 0x5922, 0x0EC0, 0x5923, 0x4B68, 0x5924, 0x386D,
- 0x5925, 0x11BF, 0x5927, 0x0B47, 0x5929, 0x0C31, 0x592A, 0x0B20,
- 0x592B, 0x0DC9, 0x592C, 0x11C0, 0x592D, 0x11C1, 0x592E, 0x051D,
- 0x592F, 0x386E, 0x5931, 0x08E6, 0x5932, 0x11C2, 0x5937, 0x0494,
- 0x5938, 0x11C3, 0x5939, 0x3725, 0x593D, 0x4442, 0x593E, 0x11C4,
- 0x5944, 0x0504, 0x5946, 0x4444, 0x5947, 0x062D, 0x5948, 0x0CB8,
- 0x5949, 0x0E44, 0x594E, 0x11C8, 0x594F, 0x0AD7, 0x5950, 0x11C7,
- 0x5951, 0x0716, 0x5953, 0x20EA, 0x5954, 0x0E89, 0x5955, 0x11C6,
- 0x5957, 0x0C5F, 0x5958, 0x11CA, 0x5959, 0x4B69, 0x595A, 0x11C9,
- 0x595B, 0x20EB, 0x595D, 0x20EC, 0x595F, 0x4447, 0x5960, 0x11CC,
- 0x5961, 0x386F, 0x5962, 0x11CB, 0x5963, 0x20ED, 0x5965, 0x051E,
- 0x5967, 0x11CD, 0x5968, 0x0991, 0x5969, 0x11CF, 0x596A, 0x0B63,
- 0x596C, 0x11CE, 0x596D, 0x3870, 0x596E, 0x0E03, 0x5973, 0x0981,
- 0x5974, 0x0C55, 0x5975, 0x4449, 0x5976, 0x444A, 0x5978, 0x11D0,
- 0x5979, 0x4B6A, 0x597C, 0x444B, 0x597D, 0x07B7, 0x5981, 0x11D1,
- 0x5982, 0x0CD7, 0x5983, 0x0D72, 0x5984, 0x0EDD, 0x598A, 0x0CDB,
- 0x598B, 0x41B9, 0x598D, 0x11DA, 0x5992, 0x41BA, 0x5993, 0x0652,
- 0x5996, 0x0F2F, 0x5997, 0x4B6B, 0x5999, 0x0EBB, 0x599B, 0x1239,
- 0x599D, 0x11D2, 0x599F, 0x444C, 0x59A3, 0x11D5, 0x59A4, 0x20EE,
- 0x59A5, 0x0B25, 0x59A8, 0x0E66, 0x59AC, 0x0C44, 0x59AE, 0x444D,
- 0x59AF, 0x4B6C, 0x59B2, 0x11D6, 0x59B3, 0x4B6D, 0x59B9, 0x0E93,
- 0x59BA, 0x20EF, 0x59BB, 0x083A, 0x59BC, 0x444E, 0x59BE, 0x0992,
- 0x59C3, 0x41BB, 0x59C6, 0x11D7, 0x59C8, 0x444F, 0x59C9, 0x089E,
- 0x59CA, 0x3871, 0x59CB, 0x089D, 0x59CD, 0x4450, 0x59D0, 0x047D,
- 0x59D1, 0x077C, 0x59D2, 0x3872, 0x59D3, 0x0A4F, 0x59D4, 0x0495,
- 0x59D9, 0x11DB, 0x59DA, 0x11DC, 0x59DC, 0x11D9, 0x59DD, 0x3873,
- 0x59DE, 0x4451, 0x59DF, 0x4B6E, 0x59E3, 0x3874, 0x59E4, 0x3875,
- 0x59E5, 0x04DA, 0x59E6, 0x05EB, 0x59E7, 0x4452, 0x59E8, 0x11D8,
- 0x59EA, 0x0ED1, 0x59EB, 0x0DA3, 0x59EC, 0x36AD, 0x59EE, 0x4453,
- 0x59F1, 0x4B6F, 0x59F6, 0x046C, 0x59F8, 0x4B70, 0x59FB, 0x04BD,
- 0x59FF, 0x089F, 0x5A01, 0x0496, 0x5A03, 0x0467, 0x5A04, 0x3876,
- 0x5A09, 0x11E1, 0x5A0C, 0x3877, 0x5A0D, 0x4457, 0x5A11, 0x11DF,
- 0x5A13, 0x41BC, 0x5A17, 0x4458, 0x5A18, 0x0EC8, 0x5A1A, 0x11E2,
- 0x5A1B, 0x35C1, 0x5A1C, 0x11E0, 0x5A1F, 0x11DE, 0x5A20, 0x09F7,
- 0x5A23, 0x3878, 0x5A25, 0x11DD, 0x5A27, 0x4459, 0x5A29, 0x0E2A,
- 0x5A2D, 0x445A, 0x5A2F, 0x0798, 0x5A35, 0x11E6, 0x5A36, 0x11E7,
- 0x5A3C, 0x0993, 0x5A40, 0x11E3, 0x5A41, 0x0FD2, 0x5A46, 0x0D02,
- 0x5A47, 0x3879, 0x5A49, 0x11E5, 0x5A55, 0x387A, 0x5A5A, 0x0817,
- 0x5A62, 0x11E8, 0x5A63, 0x387B, 0x5A65, 0x445B, 0x5A66, 0x0DCA,
- 0x5A67, 0x41BD, 0x5A6A, 0x11E9, 0x5A6C, 0x11E4, 0x5A6D, 0x387C,
- 0x5A77, 0x41BE, 0x5A7A, 0x445C, 0x5A7E, 0x387D, 0x5A7F, 0x0EC7,
- 0x5A84, 0x41BF, 0x5A8B, 0x445D, 0x5A92, 0x0D14, 0x5A9A, 0x11EA,
- 0x5A9B, 0x0DA4, 0x5A9C, 0x445E, 0x5A9E, 0x387E, 0x5A9F, 0x445F,
- 0x5AA0, 0x4460, 0x5AA2, 0x4461, 0x5AA7, 0x387F, 0x5AAC, 0x3880,
- 0x5AB1, 0x4462, 0x5AB2, 0x4B71, 0x5AB3, 0x3881, 0x5AB5, 0x4463,
- 0x5AB8, 0x4B72, 0x5ABA, 0x4464, 0x5ABC, 0x11EB, 0x5ABD, 0x11EF,
- 0x5ABE, 0x11EC, 0x5ABF, 0x4465, 0x5AC1, 0x0547, 0x5AC2, 0x11EE,
- 0x5AC4, 0x41C0, 0x5AC9, 0x08E7, 0x5ACB, 0x11ED, 0x5ACC, 0x074F,
- 0x5AD0, 0x11FB, 0x5AD6, 0x11F4, 0x5AD7, 0x11F1, 0x5ADA, 0x4466,
- 0x5ADC, 0x4467, 0x5AE0, 0x3882, 0x5AE1, 0x0BA2, 0x5AE3, 0x11F0,
- 0x5AE5, 0x4468, 0x5AE6, 0x11F2, 0x5AE9, 0x11F3, 0x5AEA, 0x4B73,
- 0x5AEE, 0x446A, 0x5AF0, 0x4469, 0x5AF5, 0x446B, 0x5AF6, 0x4B74,
- 0x5AFA, 0x11F5, 0x5AFB, 0x11F6, 0x5B00, 0x3883, 0x5B08, 0x446C,
- 0x5B09, 0x062E, 0x5B0B, 0x11F8, 0x5B0C, 0x11F7, 0x5B16, 0x11F9,
- 0x5B17, 0x446D, 0x5B19, 0x3884, 0x5B1B, 0x4B75, 0x5B1D, 0x4B76,
- 0x5B21, 0x4B77, 0x5B22, 0x09D6, 0x5B25, 0x3885, 0x5B2A, 0x11FC,
- 0x5B2C, 0x0BF8, 0x5B2D, 0x3886, 0x5B30, 0x04E7, 0x5B32, 0x11FA,
- 0x5B34, 0x446E, 0x5B36, 0x11FD, 0x5B38, 0x4B78, 0x5B3E, 0x11FE,
- 0x5B40, 0x1201, 0x5B41, 0x3887, 0x5B43, 0x11FF, 0x5B45, 0x1200,
- 0x5B4C, 0x446F, 0x5B50, 0x08A0, 0x5B51, 0x1202, 0x5B52, 0x4470,
- 0x5B54, 0x07B8, 0x5B55, 0x1203, 0x5B56, 0x20F0, 0x5B57, 0x08C8,
- 0x5B58, 0x0B18, 0x5B5A, 0x1204, 0x5B5B, 0x1205, 0x5B5C, 0x08A8,
- 0x5B5D, 0x07B9, 0x5B5F, 0x0EDE, 0x5B63, 0x0642, 0x5B64, 0x077D,
- 0x5B65, 0x1206, 0x5B66, 0x05B6, 0x5B68, 0x4471, 0x5B69, 0x1207,
- 0x5B6B, 0x0B19, 0x5B6F, 0x4472, 0x5B70, 0x1208, 0x5B71, 0x1230,
- 0x5B73, 0x1209, 0x5B75, 0x120A, 0x5B76, 0x3728, 0x5B78, 0x120B,
- 0x5B7A, 0x120D, 0x5B7C, 0x3888, 0x5B7D, 0x41C2, 0x5B7E, 0x3889,
- 0x5B7F, 0x388A, 0x5B80, 0x120E, 0x5B81, 0x4473, 0x5B82, 0x3610,
- 0x5B83, 0x120F, 0x5B84, 0x4474, 0x5B85, 0x0B50, 0x5B87, 0x04C9,
- 0x5B88, 0x0915, 0x5B89, 0x0486, 0x5B8A, 0x388B, 0x5B8B, 0x0AD9,
- 0x5B8C, 0x05EC, 0x5B8D, 0x08E1, 0x5B8F, 0x07BA, 0x5B93, 0x41C3,
- 0x5B95, 0x0C60, 0x5B96, 0x4476, 0x5B97, 0x092B, 0x5B98, 0x05ED,
- 0x5B99, 0x0BA6, 0x5B9A, 0x0C06, 0x5B9B, 0x047C, 0x5B9C, 0x0653,
- 0x5B9D, 0x0E45, 0x5B9F, 0x08EE, 0x5BA2, 0x066C, 0x5BA3, 0x0A8F,
- 0x5BA4, 0x08E8, 0x5BA5, 0x0F12, 0x5BA6, 0x1210, 0x5BAC, 0x4477,
- 0x5BAE, 0x0676, 0x5BB0, 0x083B, 0x5BB3, 0x0590, 0x5BB4, 0x0505,
- 0x5BB5, 0x0994, 0x5BB6, 0x0548, 0x5BB7, 0x4B79, 0x5BB8, 0x1211,
- 0x5BB9, 0x0F30, 0x5BBF, 0x0953, 0x5BC0, 0x20F1, 0x5BC2, 0x0910,
- 0x5BC3, 0x1212, 0x5BC4, 0x062F, 0x5BC5, 0x0CAA, 0x5BC6, 0x0EB5,
- 0x5BC7, 0x1213, 0x5BC9, 0x1214, 0x5BCC, 0x0DCB, 0x5BCE, 0x447A,
- 0x5BD0, 0x1216, 0x5BD2, 0x05E4, 0x5BD3, 0x06EF, 0x5BD4, 0x1215,
- 0x5BD6, 0x447B, 0x5BD7, 0x4B7A, 0x5BD8, 0x20F3, 0x5BDB, 0x05EE,
- 0x5BDD, 0x09F8, 0x5BDE, 0x121A, 0x5BDF, 0x086F, 0x5BE0, 0x4B7B,
- 0x5BE1, 0x0549, 0x5BE2, 0x1219, 0x5BE4, 0x1217, 0x5BE5, 0x121B,
- 0x5BE6, 0x1218, 0x5BE7, 0x0CE1, 0x5BE8, 0x148E, 0x5BE9, 0x09F9,
- 0x5BEB, 0x121C, 0x5BEC, 0x4F4E, 0x5BEE, 0x0F88, 0x5BF0, 0x121D,
- 0x5BF1, 0x447E, 0x5BF3, 0x121F, 0x5BF5, 0x0BBC, 0x5BF6, 0x121E,
- 0x5BF8, 0x0A47, 0x5BFA, 0x08C9, 0x5BFD, 0x447F, 0x5BFE, 0x0B30,
- 0x5BFF, 0x0923, 0x5C01, 0x0DE7, 0x5C02, 0x0A90, 0x5C03, 0x4481,
- 0x5C04, 0x08F9, 0x5C05, 0x1220, 0x5C06, 0x0995, 0x5C07, 0x1221,
- 0x5C08, 0x1222, 0x5C09, 0x0497, 0x5C0A, 0x0B1A, 0x5C0B, 0x0A18,
- 0x5C0D, 0x1223, 0x5C0E, 0x0C8B, 0x5C0F, 0x0996, 0x5C11, 0x0997,
- 0x5C12, 0x41C4, 0x5C13, 0x1224, 0x5C14, 0x372A, 0x5C16, 0x0A91,
- 0x5C19, 0x360B, 0x5C1A, 0x0998, 0x5C1E, 0x20F5, 0x5C1F, 0x4B7C,
- 0x5C20, 0x1225, 0x5C22, 0x1226, 0x5C23, 0x388C, 0x5C24, 0x0EEC,
- 0x5C28, 0x1227, 0x5C29, 0x4482, 0x5C2A, 0x4B7D, 0x5C2B, 0x388D,
- 0x5C2C, 0x4B7E, 0x5C2D, 0x06BE, 0x5C30, 0x388E, 0x5C31, 0x092C,
- 0x5C36, 0x4B7F, 0x5C38, 0x1228, 0x5C39, 0x1229, 0x5C3A, 0x0908,
- 0x5C3B, 0x09F2, 0x5C3C, 0x0CCC, 0x5C3D, 0x0A1A, 0x5C3E, 0x0D8C,
- 0x5C3F, 0x0CD8, 0x5C40, 0x06C1, 0x5C41, 0x122A, 0x5C45, 0x0689,
- 0x5C46, 0x122B, 0x5C48, 0x06F6, 0x5C4A, 0x0CA7, 0x5C4B, 0x0530,
- 0x5C4D, 0x08A1, 0x5C4E, 0x122C, 0x5C4F, 0x122F, 0x5C50, 0x122E,
- 0x5C51, 0x06F5, 0x5C53, 0x122D, 0x5C55, 0x0C32, 0x5C59, 0x4B80,
- 0x5C5B, 0x1E92, 0x5C5C, 0x4B81, 0x5C5E, 0x0B10, 0x5C5F, 0x4484,
- 0x5C60, 0x0C45, 0x5C61, 0x08F4, 0x5C62, 0x1E0D, 0x5C63, 0x388F,
- 0x5C64, 0x0ADA, 0x5C65, 0x0F64, 0x5C67, 0x4485, 0x5C68, 0x4486,
- 0x5C69, 0x3890, 0x5C6C, 0x1231, 0x5C6D, 0x4B82, 0x5C6E, 0x1232,
- 0x5C6F, 0x0CAE, 0x5C70, 0x4487, 0x5C71, 0x0881, 0x5C76, 0x1234,
- 0x5C79, 0x1235, 0x5C7A, 0x41C7, 0x5C7C, 0x3891, 0x5C88, 0x448C,
- 0x5C8A, 0x448D, 0x5C8C, 0x1236, 0x5C8F, 0x41C8, 0x5C90, 0x0630,
- 0x5C91, 0x1237, 0x5C94, 0x1238, 0x5C9F, 0x41C9, 0x5CA0, 0x4491,
- 0x5CA1, 0x052C, 0x5CA2, 0x4492, 0x5CA3, 0x41CA, 0x5CA6, 0x20F6,
- 0x5CA7, 0x4493, 0x5CA8, 0x0ABD, 0x5CA9, 0x0620, 0x5CAA, 0x41CB,
- 0x5CAB, 0x123A, 0x5CAC, 0x0EB4, 0x5CAD, 0x4495, 0x5CB1, 0x0B32,
- 0x5CB3, 0x05B7, 0x5CB5, 0x4496, 0x5CB6, 0x123C, 0x5CB7, 0x123E,
- 0x5CB8, 0x061B, 0x5CBA, 0x20F7, 0x5CBB, 0x123B, 0x5CBC, 0x123D,
- 0x5CBE, 0x1240, 0x5CC5, 0x123F, 0x5CC7, 0x1241, 0x5CC9, 0x4498,
- 0x5CCB, 0x3892, 0x5CD0, 0x41CC, 0x5CD2, 0x3893, 0x5CD9, 0x1242,
- 0x5CDD, 0x4B83, 0x5CE0, 0x0C95, 0x5CE1, 0x06A6, 0x5CE6, 0x372C,
- 0x5CE8, 0x0565, 0x5CE9, 0x1243, 0x5CEA, 0x1248, 0x5CED, 0x1246,
- 0x5CEF, 0x0E47, 0x5CF0, 0x0E46, 0x5CF4, 0x3894, 0x5CF5, 0x20F8,
- 0x5CF6, 0x0C61, 0x5CFA, 0x1245, 0x5CFB, 0x095E, 0x5CFD, 0x1244,
- 0x5D01, 0x4B84, 0x5D06, 0x449B, 0x5D07, 0x0A38, 0x5D0B, 0x1249,
- 0x5D0D, 0x41CE, 0x5D0E, 0x085A, 0x5D10, 0x449C, 0x5D11, 0x124F,
- 0x5D14, 0x1250, 0x5D15, 0x124A, 0x5D16, 0x0591, 0x5D17, 0x124B,
- 0x5D18, 0x1254, 0x5D19, 0x1253, 0x5D1A, 0x1252, 0x5D1B, 0x124E,
- 0x5D1D, 0x449E, 0x5D1F, 0x124D, 0x5D20, 0x449F, 0x5D22, 0x1251,
- 0x5D24, 0x3895, 0x5D26, 0x3896, 0x5D27, 0x20F9, 0x5D29, 0x0E48,
- 0x5D2B, 0x449D, 0x5D31, 0x44A0, 0x5D34, 0x4B85, 0x5D39, 0x44A1,
- 0x5D3D, 0x4B86, 0x5D42, 0x20FC, 0x5D43, 0x3897, 0x5D46, 0x3898,
- 0x5D47, 0x41CF, 0x5D4A, 0x3899, 0x5D4B, 0x1258, 0x5D4C, 0x1255,
- 0x5D4E, 0x1257, 0x5D50, 0x0F5C, 0x5D52, 0x1256, 0x5D53, 0x20FA,
- 0x5D59, 0x4B87, 0x5D5C, 0x124C, 0x5D61, 0x44A3, 0x5D69, 0x0A39,
- 0x5D6A, 0x44A4, 0x5D6C, 0x1259, 0x5D6D, 0x20FD, 0x5D6F, 0x0827,
- 0x5D70, 0x44A6, 0x5D73, 0x125A, 0x5D76, 0x125B, 0x5D7E, 0x4B88,
- 0x5D81, 0x41D0, 0x5D82, 0x125E, 0x5D83, 0x4B89, 0x5D84, 0x125D,
- 0x5D87, 0x125C, 0x5D88, 0x44A9, 0x5D8B, 0x0C62, 0x5D8C, 0x1247,
- 0x5D90, 0x1264, 0x5D92, 0x389A, 0x5D94, 0x389B, 0x5D97, 0x44AB,
- 0x5D99, 0x389C, 0x5D9D, 0x1260, 0x5DA0, 0x389D, 0x5DA2, 0x125F,
- 0x5DA4, 0x41D1, 0x5DA7, 0x41D2, 0x5DAC, 0x1261, 0x5DAE, 0x1262,
- 0x5DB0, 0x44AC, 0x5DB2, 0x3C2D, 0x5DB4, 0x44AD, 0x5DB7, 0x1265,
- 0x5DB8, 0x20FE, 0x5DB9, 0x20FF, 0x5DBA, 0x0FAE, 0x5DBC, 0x1266,
- 0x5DBD, 0x1263, 0x5DC7, 0x4B8A, 0x5DC9, 0x1267, 0x5DCB, 0x41D3,
- 0x5DCC, 0x061C, 0x5DCD, 0x1268, 0x5DD0, 0x2100, 0x5DD1, 0x44AF,
- 0x5DD2, 0x126A, 0x5DD3, 0x1269, 0x5DD6, 0x126B, 0x5DD7, 0x44B0,
- 0x5DD8, 0x389E, 0x5DDB, 0x126C, 0x5DDD, 0x0A92, 0x5DDE, 0x092D,
- 0x5DE0, 0x389F, 0x5DE1, 0x096E, 0x5DE2, 0x3432, 0x5DE3, 0x0AE5,
- 0x5DE4, 0x44B2, 0x5DE5, 0x07BB, 0x5DE6, 0x0828, 0x5DE7, 0x07BC,
- 0x5DE8, 0x068A, 0x5DE9, 0x44B3, 0x5DEB, 0x126D, 0x5DEE, 0x0829,
- 0x5DF1, 0x077E, 0x5DF2, 0x126E, 0x5DF3, 0x0EB2, 0x5DF4, 0x0CF9,
- 0x5DF5, 0x126F, 0x5DF7, 0x07BD, 0x5DF8, 0x38A0, 0x5DF9, 0x4B8B,
- 0x5DFB, 0x05E8, 0x5DFD, 0x0B65, 0x5DFE, 0x06CA, 0x5DFF, 0x35E2,
- 0x5E00, 0x38A1, 0x5E02, 0x08A2, 0x5E03, 0x0DCD, 0x5E06, 0x0D55,
- 0x5E0B, 0x1270, 0x5E0C, 0x0631, 0x5E11, 0x1273, 0x5E12, 0x38A2,
- 0x5E14, 0x38A3, 0x5E15, 0x38A4, 0x5E16, 0x0BBD, 0x5E18, 0x38A5,
- 0x5E19, 0x1272, 0x5E1A, 0x1271, 0x5E1B, 0x1274, 0x5E1D, 0x0C07,
- 0x5E1F, 0x44B7, 0x5E25, 0x0A29, 0x5E28, 0x4B8C, 0x5E2B, 0x08A3,
- 0x5E2D, 0x0A6E, 0x5E2E, 0x38A6, 0x5E2F, 0x0B33, 0x5E30, 0x063C,
- 0x5E32, 0x4B8D, 0x5E33, 0x0BBE, 0x5E35, 0x4B8E, 0x5E36, 0x1275,
- 0x5E37, 0x1276, 0x5E38, 0x09D7, 0x5E3D, 0x0E67, 0x5E3E, 0x44B8,
- 0x5E40, 0x1279, 0x5E43, 0x1278, 0x5E44, 0x1277, 0x5E45, 0x0DEF,
- 0x5E47, 0x1280, 0x5E49, 0x44B9, 0x5E4C, 0x0E88, 0x5E4E, 0x127A,
- 0x5E54, 0x127C, 0x5E55, 0x0E99, 0x5E56, 0x44BB, 0x5E57, 0x127B,
- 0x5E58, 0x38A7, 0x5E5B, 0x4B8F, 0x5E5E, 0x41D4, 0x5E5F, 0x127D,
- 0x5E61, 0x0D3C, 0x5E62, 0x127E, 0x5E63, 0x0E0E, 0x5E64, 0x127F,
- 0x5E68, 0x4B90, 0x5E6A, 0x4B91, 0x5E6B, 0x38A8, 0x5E6C, 0x38A9,
- 0x5E6D, 0x44BD, 0x5E6E, 0x44BE, 0x5E72, 0x05EF, 0x5E73, 0x0E0F,
- 0x5E74, 0x0CE5, 0x5E75, 0x1281, 0x5E76, 0x1282, 0x5E77, 0x4B92,
- 0x5E78, 0x07BE, 0x5E79, 0x05F0, 0x5E7A, 0x1283, 0x5E7B, 0x076C,
- 0x5E7C, 0x0F2E, 0x5E7D, 0x0F13, 0x5E7E, 0x0632, 0x5E7F, 0x1285,
- 0x5E80, 0x4B93, 0x5E81, 0x0BBF, 0x5E83, 0x07BF, 0x5E84, 0x0999,
- 0x5E87, 0x0D73, 0x5E8A, 0x099A, 0x5E8B, 0x4B94, 0x5E8F, 0x0982,
- 0x5E95, 0x0C08, 0x5E96, 0x0E49, 0x5E97, 0x0C33, 0x5E99, 0x36B0,
- 0x5E9A, 0x07C0, 0x5E9C, 0x0DCE, 0x5EA0, 0x1286, 0x5EA5, 0x44C0,
- 0x5EA6, 0x0C53, 0x5EA7, 0x0832, 0x5EA8, 0x38AA, 0x5EAA, 0x38AB,
- 0x5EAB, 0x077F, 0x5EAC, 0x44C1, 0x5EAD, 0x0C09, 0x5EB3, 0x4B95,
- 0x5EB5, 0x0487, 0x5EB6, 0x0978, 0x5EB7, 0x07C1, 0x5EB8, 0x0F31,
- 0x5EB9, 0x44C2, 0x5EBD, 0x4B96, 0x5EBE, 0x38AC, 0x5EBF, 0x38AD,
- 0x5EC1, 0x1287, 0x5EC2, 0x1288, 0x5EC3, 0x0D07, 0x5EC6, 0x44C3,
- 0x5EC8, 0x1289, 0x5EC9, 0x0FBF, 0x5ECA, 0x0FD3, 0x5ECB, 0x3C1E,
- 0x5ECF, 0x128B, 0x5ED0, 0x128A, 0x5ED1, 0x4B97, 0x5ED2, 0x38AF,
- 0x5ED3, 0x05A5, 0x5ED4, 0x4B98, 0x5ED5, 0x4B99, 0x5ED6, 0x128C,
- 0x5ED9, 0x44C4, 0x5EDA, 0x128F, 0x5EDB, 0x1290, 0x5EDD, 0x128E,
- 0x5EDF, 0x0DB2, 0x5EE0, 0x099B, 0x5EE1, 0x1292, 0x5EE2, 0x1291,
- 0x5EE3, 0x128D, 0x5EE8, 0x1293, 0x5EE9, 0x1294, 0x5EEC, 0x1295,
- 0x5EF0, 0x1298, 0x5EF1, 0x1296, 0x5EF3, 0x1297, 0x5EF4, 0x1299,
- 0x5EF6, 0x0506, 0x5EF7, 0x0C0A, 0x5EF8, 0x129A, 0x5EF9, 0x41D5,
- 0x5EFA, 0x0750, 0x5EFB, 0x0576, 0x5EFC, 0x0CEC, 0x5EFD, 0x44C6,
- 0x5EFE, 0x129B, 0x5EFF, 0x0CD3, 0x5F00, 0x41D6, 0x5F01, 0x0E2B,
- 0x5F02, 0x41D7, 0x5F03, 0x129C, 0x5F04, 0x0FD4, 0x5F07, 0x38B0,
- 0x5F08, 0x44C7, 0x5F09, 0x129D, 0x5F0A, 0x0E10, 0x5F0B, 0x12A0,
- 0x5F0C, 0x0FFA, 0x5F0D, 0x100A, 0x5F0E, 0x38B1, 0x5F0F, 0x08DC,
- 0x5F10, 0x0CCD, 0x5F11, 0x12A1, 0x5F13, 0x0677, 0x5F14, 0x0BC0,
- 0x5F15, 0x04BE, 0x5F16, 0x12A2, 0x5F17, 0x0DF6, 0x5F18, 0x07C2,
- 0x5F1B, 0x0B8E, 0x5F1C, 0x38B2, 0x5F1D, 0x38B3, 0x5F1E, 0x44C9,
- 0x5F1F, 0x0C0B, 0x5F21, 0x2101, 0x5F22, 0x38B4, 0x5F23, 0x41D8,
- 0x5F25, 0x0EFB, 0x5F26, 0x076D, 0x5F27, 0x0780, 0x5F28, 0x38B5,
- 0x5F29, 0x12A3, 0x5F2D, 0x12A4, 0x5F2F, 0x12AA, 0x5F31, 0x0911,
- 0x5F34, 0x2102, 0x5F35, 0x0BC1, 0x5F36, 0x38B6, 0x5F37, 0x06A7,
- 0x5F38, 0x12A5, 0x5F3A, 0x3598, 0x5F3B, 0x38B7, 0x5F3C, 0x0D9D,
- 0x5F3D, 0x41D9, 0x5F3E, 0x0B84, 0x5F40, 0x38B8, 0x5F41, 0x12A6,
- 0x5F45, 0x20B2, 0x5F47, 0x44CA, 0x5F48, 0x12A7, 0x5F4A, 0x06A8,
- 0x5F4C, 0x12A8, 0x5F4D, 0x4B9A, 0x5F4E, 0x12A9, 0x5F50, 0x38B9,
- 0x5F51, 0x12AB, 0x5F53, 0x0C70, 0x5F54, 0x41DA, 0x5F56, 0x12AC,
- 0x5F57, 0x12AD, 0x5F58, 0x38BA, 0x5F59, 0x12AE, 0x5F5C, 0x129F,
- 0x5F5D, 0x129E, 0x5F61, 0x12AF, 0x5F62, 0x0717, 0x5F63, 0x44CB,
- 0x5F64, 0x38BB, 0x5F65, 0x36AC, 0x5F66, 0x0D99, 0x5F67, 0x2103,
- 0x5F69, 0x083C, 0x5F6A, 0x0DA9, 0x5F6B, 0x0BC2, 0x5F6C, 0x0DBD,
- 0x5F6D, 0x12B0, 0x5F70, 0x099C, 0x5F71, 0x04E8, 0x5F72, 0x44CC,
- 0x5F73, 0x12B1, 0x5F77, 0x12B2, 0x5F79, 0x0EFE, 0x5F7C, 0x0D74,
- 0x5F7D, 0x41DB, 0x5F7E, 0x44CD, 0x5F7F, 0x12B5, 0x5F80, 0x051F,
- 0x5F81, 0x0A50, 0x5F82, 0x12B4, 0x5F83, 0x12B3, 0x5F84, 0x0718,
- 0x5F85, 0x0B34, 0x5F87, 0x12B9, 0x5F88, 0x12B7, 0x5F89, 0x38BC,
- 0x5F8A, 0x12B6, 0x5F8B, 0x0F6F, 0x5F8C, 0x0799, 0x5F8F, 0x44CE,
- 0x5F90, 0x0983, 0x5F91, 0x12B8, 0x5F92, 0x0C46, 0x5F93, 0x0948,
- 0x5F97, 0x0C98, 0x5F98, 0x12BC, 0x5F99, 0x12BB, 0x5F9C, 0x38BD,
- 0x5F9E, 0x12BA, 0x5FA0, 0x12BD, 0x5FA1, 0x079A, 0x5FA2, 0x44CF,
- 0x5FA4, 0x38BF, 0x5FA7, 0x38BE, 0x5FA8, 0x12BE, 0x5FA9, 0x0DEE,
- 0x5FAA, 0x0965, 0x5FAC, 0x4B9B, 0x5FAD, 0x12BF, 0x5FAE, 0x0D8D,
- 0x5FAF, 0x38C0, 0x5FB3, 0x0C99, 0x5FB4, 0x0BC3, 0x5FB5, 0x3438,
- 0x5FB7, 0x2104, 0x5FB8, 0x38C1, 0x5FB9, 0x0C2A, 0x5FBC, 0x12C0,
- 0x5FBD, 0x0645, 0x5FC3, 0x09FA, 0x5FC4, 0x38C2, 0x5FC5, 0x0D9E,
- 0x5FC7, 0x44D0, 0x5FC9, 0x38C3, 0x5FCB, 0x44D1, 0x5FCC, 0x0633,
- 0x5FCD, 0x0CDC, 0x5FD2, 0x44D2, 0x5FD3, 0x44D3, 0x5FD4, 0x44D4,
- 0x5FD6, 0x12C1, 0x5FD7, 0x08A4, 0x5FD8, 0x0E68, 0x5FD9, 0x0E69,
- 0x5FDC, 0x0520, 0x5FDD, 0x12C6, 0x5FDE, 0x2105, 0x5FE0, 0x0BA7,
- 0x5FE1, 0x38C4, 0x5FE2, 0x44D5, 0x5FE4, 0x12C3, 0x5FE9, 0x38C5,
- 0x5FEA, 0x4B9C, 0x5FEB, 0x0577, 0x5FED, 0x38C6, 0x5FEE, 0x44D6,
- 0x5FEF, 0x44D7, 0x5FF0, 0x12F6, 0x5FF1, 0x12C5, 0x5FF3, 0x44D8,
- 0x5FF5, 0x0CE6, 0x5FF8, 0x12C4, 0x5FFB, 0x12C2, 0x5FFC, 0x38C7,
- 0x5FFD, 0x080C, 0x5FFF, 0x12C8, 0x6007, 0x4B9D, 0x600D, 0x41DC,
- 0x600E, 0x12CE, 0x600F, 0x12D4, 0x6010, 0x12CC, 0x6012, 0x0C56,
- 0x6014, 0x41DD, 0x6015, 0x12D1, 0x6016, 0x0DCF, 0x6017, 0x38C8,
- 0x6018, 0x41DE, 0x6019, 0x12CB, 0x601A, 0x38C9, 0x601B, 0x12D0,
- 0x601C, 0x0FAF, 0x601D, 0x08A5, 0x6020, 0x0B35, 0x6021, 0x12C9,
- 0x6022, 0x44DA, 0x6024, 0x44DB, 0x6025, 0x0678, 0x6026, 0x12D3,
- 0x6027, 0x0A51, 0x6028, 0x0507, 0x6029, 0x12CD, 0x602A, 0x0578,
- 0x602B, 0x12D2, 0x602F, 0x06A9, 0x6031, 0x12CF, 0x6033, 0x38CA,
- 0x6035, 0x41DF, 0x603A, 0x12D5, 0x6041, 0x12D7, 0x6042, 0x12E1,
- 0x6043, 0x12DF, 0x6046, 0x12DC, 0x6047, 0x41E0, 0x6049, 0x4B9E,
- 0x604A, 0x12DB, 0x604B, 0x0FC0, 0x604C, 0x44DD, 0x604D, 0x12DD,
- 0x6050, 0x06AA, 0x6052, 0x07C3, 0x6054, 0x4B9F, 0x6055, 0x0984,
- 0x6059, 0x12E4, 0x605A, 0x12D6, 0x605D, 0x2106, 0x605F, 0x12DA,
- 0x6060, 0x12CA, 0x6061, 0x38CB, 0x6062, 0x057A, 0x6063, 0x12DE,
- 0x6064, 0x12E0, 0x6065, 0x0B8F, 0x6067, 0x4BA0, 0x6068, 0x0818,
- 0x6069, 0x0538, 0x606A, 0x12D8, 0x606B, 0x12E3, 0x606C, 0x12E2,
- 0x606D, 0x06AB, 0x606F, 0x0B09, 0x6070, 0x05C4, 0x6075, 0x0719,
- 0x6077, 0x12D9, 0x607F, 0x38CC, 0x6081, 0x12E5, 0x6083, 0x12E8,
- 0x6084, 0x12EA, 0x6085, 0x2107, 0x6089, 0x08E9, 0x608A, 0x2108,
- 0x608B, 0x12F0, 0x608C, 0x0C0C, 0x608D, 0x12E6, 0x6092, 0x12EE,
- 0x6094, 0x0579, 0x6095, 0x44DE, 0x6096, 0x12EC, 0x6097, 0x12ED,
- 0x609A, 0x12E9, 0x609B, 0x12EB, 0x609D, 0x41E1, 0x609E, 0x38CD,
- 0x609F, 0x079B, 0x60A0, 0x0F14, 0x60A3, 0x05F1, 0x60A4, 0x38CE,
- 0x60A6, 0x04FB, 0x60A7, 0x12EF, 0x60A8, 0x44DF, 0x60A9, 0x0CF0,
- 0x60AA, 0x0471, 0x60B0, 0x38CF, 0x60B1, 0x44E1, 0x60B2, 0x0D75,
- 0x60B3, 0x12C7, 0x60B4, 0x12F5, 0x60B5, 0x12F9, 0x60B6, 0x0EF1,
- 0x60B8, 0x12F2, 0x60BB, 0x4BA1, 0x60BC, 0x0C63, 0x60BD, 0x12F7,
- 0x60BE, 0x44E2, 0x60C4, 0x4BA2, 0x60C5, 0x09D8, 0x60C6, 0x12F8,
- 0x60C7, 0x0CAF, 0x60C8, 0x44E3, 0x60CB, 0x38D0, 0x60D1, 0x0FED,
- 0x60D3, 0x12F4, 0x60D4, 0x41E2, 0x60D5, 0x210A, 0x60D8, 0x12FA,
- 0x60D9, 0x44E4, 0x60DA, 0x080D, 0x60DB, 0x38D1, 0x60DC, 0x0A6F,
- 0x60DD, 0x41E3, 0x60DE, 0x2109, 0x60DF, 0x0498, 0x60E0, 0x12F3,
- 0x60E1, 0x12F1, 0x60E3, 0x0ADC, 0x60E7, 0x12E7, 0x60E8, 0x0882,
- 0x60EE, 0x44E5, 0x60F0, 0x0B26, 0x60F1, 0x1306, 0x60F2, 0x210C,
- 0x60F3, 0x0ADD, 0x60F4, 0x1301, 0x60F5, 0x44E6, 0x60F6, 0x12FE,
- 0x60F7, 0x12FF, 0x60F8, 0x38D2, 0x60F9, 0x0912, 0x60FA, 0x1302,
- 0x60FB, 0x1305, 0x60FD, 0x4BA3, 0x6100, 0x1300, 0x6101, 0x092F,
- 0x6103, 0x1303, 0x6106, 0x12FD, 0x6108, 0x0F08, 0x6109, 0x0F07,
- 0x610A, 0x4BA4, 0x610D, 0x1307, 0x610E, 0x1308, 0x610F, 0x0499,
- 0x6110, 0x44E7, 0x6111, 0x210D, 0x6112, 0x38D3, 0x6113, 0x38D4,
- 0x6114, 0x38D5, 0x6115, 0x12FC, 0x6116, 0x4BA5, 0x6119, 0x44E8,
- 0x611A, 0x06EA, 0x611B, 0x046A, 0x611C, 0x38D6, 0x611E, 0x44E9,
- 0x611F, 0x05F2, 0x6120, 0x210B, 0x6121, 0x1304, 0x6127, 0x130C,
- 0x6128, 0x130B, 0x612A, 0x4BA6, 0x612B, 0x41E4, 0x612C, 0x1310,
- 0x6130, 0x210F, 0x6134, 0x1311, 0x6136, 0x4BA7, 0x6137, 0x210E,
- 0x613A, 0x44EA, 0x613C, 0x130F, 0x613D, 0x1312, 0x613E, 0x130A,
- 0x613F, 0x130E, 0x6141, 0x44EC, 0x6142, 0x1313, 0x6144, 0x1314,
- 0x6146, 0x44ED, 0x6147, 0x1309, 0x6148, 0x08CA, 0x614A, 0x130D,
- 0x614B, 0x0B36, 0x614C, 0x07C4, 0x614D, 0x12FB, 0x614E, 0x09FB,
- 0x6153, 0x1321, 0x6155, 0x0E39, 0x6158, 0x1317, 0x6159, 0x1318,
- 0x615A, 0x1319, 0x615D, 0x1320, 0x615E, 0x4BA8, 0x615F, 0x131F,
- 0x6160, 0x44EE, 0x6162, 0x0EAB, 0x6163, 0x05F3, 0x6164, 0x4BA9,
- 0x6165, 0x131D, 0x6167, 0x071B, 0x6168, 0x0592, 0x616B, 0x131A,
- 0x616E, 0x0F80, 0x616F, 0x131C, 0x6170, 0x049A, 0x6171, 0x131E,
- 0x6173, 0x1315, 0x6174, 0x131B, 0x6175, 0x1322, 0x6176, 0x071A,
- 0x6177, 0x1316, 0x617B, 0x4BAA, 0x617C, 0x38D7, 0x617D, 0x4BAB,
- 0x617E, 0x0F47, 0x617F, 0x4BAC, 0x6182, 0x0F15, 0x6187, 0x1325,
- 0x618A, 0x1329, 0x618D, 0x38D8, 0x618E, 0x0B00, 0x6190, 0x0FC1,
- 0x6191, 0x132A, 0x6192, 0x44F0, 0x6193, 0x44F1, 0x6194, 0x1327,
- 0x6196, 0x1324, 0x6197, 0x44F2, 0x6198, 0x2110, 0x6199, 0x1323,
- 0x619A, 0x1328, 0x619D, 0x4BAD, 0x619F, 0x38D9, 0x61A4, 0x0E00,
- 0x61A5, 0x44F3, 0x61A7, 0x0C8C, 0x61A8, 0x38DA, 0x61A9, 0x071C,
- 0x61AB, 0x132B, 0x61AC, 0x1326, 0x61AD, 0x44F4, 0x61AE, 0x132C,
- 0x61B2, 0x0751, 0x61B6, 0x0531, 0x61B8, 0x4BAE, 0x61B9, 0x41E6,
- 0x61BA, 0x1334, 0x61BC, 0x41E5, 0x61BE, 0x05F4, 0x61C2, 0x38DB,
- 0x61C3, 0x1332, 0x61C6, 0x1333, 0x61C7, 0x0819, 0x61C8, 0x1331,
- 0x61C9, 0x132F, 0x61CA, 0x132E, 0x61CB, 0x1335, 0x61CC, 0x132D,
- 0x61CD, 0x1337, 0x61D0, 0x057B, 0x61D5, 0x44F6, 0x61DC, 0x4BAF,
- 0x61DD, 0x44F7, 0x61DF, 0x38DC, 0x61E2, 0x4BB0, 0x61E3, 0x1339,
- 0x61E5, 0x4BB1, 0x61E6, 0x1338, 0x61E8, 0x4BB2, 0x61F2, 0x0BC4,
- 0x61F4, 0x133C, 0x61F5, 0x44F8, 0x61F6, 0x133A, 0x61F7, 0x1330,
- 0x61F8, 0x0752, 0x61FA, 0x133B, 0x61FC, 0x133F, 0x61FD, 0x133E,
- 0x61FE, 0x1340, 0x61FF, 0x133D, 0x6200, 0x1341, 0x6204, 0x4BB3,
- 0x6207, 0x4BB4, 0x6208, 0x1342, 0x6209, 0x1343, 0x620A, 0x0E3A,
- 0x620C, 0x1345, 0x620D, 0x1344, 0x620E, 0x0949, 0x6210, 0x0A52,
- 0x6211, 0x0566, 0x6212, 0x057C, 0x6213, 0x2111, 0x6214, 0x1346,
- 0x6215, 0x38DD, 0x6216, 0x0483, 0x621A, 0x0A70, 0x621B, 0x1347,
- 0x621D, 0x1A64, 0x621E, 0x1348, 0x621F, 0x0737, 0x6221, 0x1349,
- 0x6222, 0x41E7, 0x6223, 0x44FA, 0x6226, 0x0A93, 0x6229, 0x38DE,
- 0x622A, 0x134A, 0x622E, 0x134B, 0x622F, 0x0654, 0x6230, 0x134C,
- 0x6231, 0x4BB5, 0x6232, 0x134D, 0x6233, 0x134E, 0x6234, 0x0B37,
- 0x6236, 0x35BD, 0x6238, 0x0781, 0x6239, 0x4BB6, 0x623B, 0x0EED,
- 0x623D, 0x4BB7, 0x623E, 0x344E, 0x623F, 0x0E6A, 0x6240, 0x0974,
- 0x6241, 0x134F, 0x6243, 0x38DF, 0x6246, 0x38E0, 0x6247, 0x0A94,
- 0x6248, 0x1B1A, 0x6249, 0x0D76, 0x624B, 0x0916, 0x624C, 0x38E1,
- 0x624D, 0x083D, 0x624E, 0x1350, 0x6251, 0x38E2, 0x6252, 0x44FB,
- 0x6253, 0x0B27, 0x6255, 0x0DF7, 0x6256, 0x38E3, 0x6258, 0x0B51,
- 0x625A, 0x41E8, 0x625B, 0x1353, 0x625E, 0x1351, 0x6260, 0x1354,
- 0x6261, 0x44FC, 0x6263, 0x1352, 0x6264, 0x44FD, 0x6268, 0x1355,
- 0x626D, 0x44FF, 0x626E, 0x0E01, 0x626F, 0x41E9, 0x6271, 0x047B,
- 0x6273, 0x4500, 0x6276, 0x0DD0, 0x6279, 0x0D77, 0x627A, 0x4BB8,
- 0x627B, 0x44FE, 0x627C, 0x1356, 0x627E, 0x1359, 0x627F, 0x099D,
- 0x6280, 0x0655, 0x6282, 0x1357, 0x6283, 0x135E, 0x6284, 0x099E,
- 0x6285, 0x35C5, 0x6289, 0x1358, 0x628A, 0x0CFA, 0x6290, 0x4BB9,
- 0x6291, 0x0F48, 0x6292, 0x135A, 0x6293, 0x135B, 0x6294, 0x135F,
- 0x6295, 0x0C64, 0x6296, 0x135C, 0x6297, 0x07C5, 0x6298, 0x0A82,
- 0x6299, 0x4501, 0x629B, 0x136D, 0x629C, 0x0D48, 0x629E, 0x0B52,
- 0x62A6, 0x2112, 0x62A8, 0x4BBA, 0x62AB, 0x0D78, 0x62AC, 0x13B2,
- 0x62B1, 0x0E4A, 0x62B5, 0x0C0D, 0x62B9, 0x0EA3, 0x62BB, 0x1362,
- 0x62BC, 0x0521, 0x62BD, 0x0BA8, 0x62C2, 0x136B, 0x62C4, 0x38E4,
- 0x62C5, 0x0B72, 0x62C6, 0x1365, 0x62C7, 0x136C, 0x62C8, 0x1367,
- 0x62C9, 0x136E, 0x62CA, 0x136A, 0x62CC, 0x1369, 0x62CD, 0x0D25,
- 0x62CF, 0x1363, 0x62D0, 0x057D, 0x62D1, 0x1361, 0x62D2, 0x068B,
- 0x62D3, 0x0B53, 0x62D4, 0x135D, 0x62D5, 0x4502, 0x62D6, 0x41EA,
- 0x62D7, 0x1360, 0x62D8, 0x07C6, 0x62D9, 0x0A7F, 0x62DA, 0x4BBB,
- 0x62DB, 0x099F, 0x62DC, 0x1368, 0x62DD, 0x0D08, 0x62E0, 0x068C,
- 0x62E1, 0x05A6, 0x62EC, 0x05C5, 0x62ED, 0x09E7, 0x62EE, 0x1370,
- 0x62EF, 0x1375, 0x62F1, 0x1371, 0x62F3, 0x0753, 0x62F4, 0x4BBC,
- 0x62F5, 0x1376, 0x62F6, 0x0870, 0x62F7, 0x07FB, 0x62FC, 0x38E5,
- 0x62FD, 0x4504, 0x62FE, 0x0930, 0x62FF, 0x1364, 0x6301, 0x08CB,
- 0x6302, 0x1373, 0x6303, 0x4505, 0x6307, 0x08A6, 0x6308, 0x1374,
- 0x6309, 0x0488, 0x630A, 0x38E6, 0x630C, 0x136F, 0x630D, 0x38E7,
- 0x6310, 0x4506, 0x6311, 0x0BC5, 0x6316, 0x4BBD, 0x6318, 0x38E8,
- 0x6319, 0x068D, 0x631B, 0x3737, 0x631F, 0x06AC, 0x6327, 0x1372,
- 0x6328, 0x046B, 0x632A, 0x4BBE, 0x632B, 0x0833, 0x632F, 0x09FC,
- 0x6332, 0x4509, 0x6335, 0x450A, 0x6336, 0x4BBF, 0x6339, 0x38E9,
- 0x633A, 0x0C0E, 0x633B, 0x450B, 0x633C, 0x450C, 0x633D, 0x0D68,
- 0x633E, 0x1378, 0x633F, 0x0AE0, 0x6341, 0x450D, 0x6342, 0x38EA,
- 0x6343, 0x38EB, 0x6344, 0x450E, 0x6346, 0x4BC0, 0x6349, 0x0B0A,
- 0x634B, 0x4BC1, 0x634C, 0x0879, 0x634D, 0x1379, 0x634E, 0x450F,
- 0x634F, 0x137B, 0x6350, 0x1377, 0x6353, 0x4BC2, 0x6355, 0x0E31,
- 0x6357, 0x0BD9, 0x6359, 0x4511, 0x635C, 0x0ADE, 0x6365, 0x38EC,
- 0x6367, 0x0E4B, 0x6368, 0x08FA, 0x6369, 0x1387, 0x636B, 0x1386,
- 0x636C, 0x4514, 0x636E, 0x0A3E, 0x6371, 0x4BC3, 0x6372, 0x0754,
- 0x6374, 0x38ED, 0x6375, 0x4BC4, 0x6376, 0x1380, 0x6377, 0x09A1,
- 0x637A, 0x0CC0, 0x637B, 0x0CE7, 0x637C, 0x41EB, 0x637D, 0x38EE,
- 0x637F, 0x4BC5, 0x6380, 0x137E, 0x6382, 0x4BC6, 0x6383, 0x0ADF,
- 0x6384, 0x38EF, 0x6387, 0x38F0, 0x6388, 0x0924, 0x6389, 0x1383,
- 0x638A, 0x4BC7, 0x638C, 0x09A0, 0x638E, 0x137D, 0x638F, 0x1382,
- 0x6390, 0x38F1, 0x6392, 0x0D09, 0x6394, 0x4517, 0x6396, 0x137C,
- 0x6398, 0x06F7, 0x6399, 0x4515, 0x639B, 0x05BB, 0x639E, 0x38F2,
- 0x639F, 0x1384, 0x63A0, 0x0F73, 0x63A1, 0x083E, 0x63A2, 0x0B73,
- 0x63A3, 0x1381, 0x63A5, 0x0A80, 0x63A7, 0x07C7, 0x63A8, 0x0A2A,
- 0x63A9, 0x0508, 0x63AA, 0x0ABE, 0x63AB, 0x137F, 0x63AC, 0x065F,
- 0x63AE, 0x4BC8, 0x63AF, 0x4BC9, 0x63B2, 0x071D, 0x63B4, 0x0BEB,
- 0x63B5, 0x1385, 0x63BB, 0x0AE1, 0x63BD, 0x4518, 0x63BE, 0x1388,
- 0x63C0, 0x138A, 0x63C3, 0x0B17, 0x63C4, 0x1390, 0x63C6, 0x138B,
- 0x63C9, 0x138D, 0x63CF, 0x0DB3, 0x63D0, 0x0C0F, 0x63D1, 0x38F3,
- 0x63D2, 0x138E, 0x63D4, 0x4519, 0x63D5, 0x451A, 0x63D6, 0x0F16,
- 0x63DA, 0x0F32, 0x63DB, 0x05F5, 0x63DC, 0x38F4, 0x63E0, 0x451B,
- 0x63E1, 0x0472, 0x63E3, 0x138C, 0x63E5, 0x41EC, 0x63E9, 0x1389,
- 0x63EA, 0x4BCA, 0x63EB, 0x451C, 0x63EC, 0x451D, 0x63ED, 0x341C,
- 0x63EE, 0x0634, 0x63F2, 0x451E, 0x63F4, 0x0509, 0x63F5, 0x2113,
- 0x63F6, 0x138F, 0x63F7, 0x3644, 0x63F8, 0x4BCB, 0x63F9, 0x4BCC,
- 0x63FA, 0x0F33, 0x6406, 0x1393, 0x6409, 0x38F5, 0x640D, 0x0B1B,
- 0x640F, 0x139A, 0x6410, 0x38F6, 0x6412, 0x4BCD, 0x6413, 0x1394,
- 0x6414, 0x1E2C, 0x6416, 0x1391, 0x6417, 0x1398, 0x6418, 0x4BCE,
- 0x641C, 0x137A, 0x641E, 0x451F, 0x6420, 0x4BCF, 0x6422, 0x38F7,
- 0x6424, 0x4BD0, 0x6425, 0x4520, 0x6426, 0x1395, 0x6428, 0x1399,
- 0x6429, 0x4521, 0x642A, 0x4BD1, 0x642C, 0x0D56, 0x642D, 0x0C65,
- 0x642F, 0x4522, 0x6434, 0x1392, 0x6435, 0x4BD2, 0x6436, 0x1396,
- 0x643A, 0x071E, 0x643D, 0x4BD3, 0x643E, 0x0861, 0x643F, 0x4BD4,
- 0x6442, 0x0A81, 0x644E, 0x139E, 0x6451, 0x1E43, 0x6452, 0x4BD5,
- 0x6454, 0x38F8, 0x6458, 0x0C20, 0x645A, 0x4523, 0x645B, 0x38F9,
- 0x645D, 0x4524, 0x645F, 0x4BD6, 0x6460, 0x2114, 0x6467, 0x139B,
- 0x6469, 0x0E8E, 0x646D, 0x38FA, 0x646F, 0x139C, 0x6473, 0x4525,
- 0x6474, 0x4BD7, 0x6476, 0x139D, 0x6478, 0x0EDA, 0x6479, 0x41ED,
- 0x647A, 0x0A46, 0x647B, 0x38FB, 0x647D, 0x4526, 0x6483, 0x0738,
- 0x6487, 0x4527, 0x6488, 0x13A4, 0x6490, 0x4BD8, 0x6491, 0x4528,
- 0x6492, 0x0883, 0x6493, 0x13A1, 0x6495, 0x13A0, 0x6498, 0x4BD9,
- 0x6499, 0x4BDA, 0x649A, 0x0CE8, 0x649D, 0x2115, 0x649E, 0x0C8D,
- 0x649F, 0x4529, 0x64A4, 0x0C2B, 0x64A5, 0x13A2, 0x64A9, 0x13A3,
- 0x64AB, 0x0DE1, 0x64AC, 0x4BDB, 0x64AD, 0x0CFB, 0x64AE, 0x0871,
- 0x64B0, 0x0A95, 0x64B2, 0x0E7E, 0x64B3, 0x4BDC, 0x64B9, 0x05A7,
- 0x64BB, 0x13AA, 0x64BC, 0x13A5, 0x64BE, 0x38FC, 0x64BF, 0x38FD,
- 0x64C1, 0x0F34, 0x64C2, 0x13AC, 0x64C4, 0x41EE, 0x64C5, 0x13A8,
- 0x64C7, 0x13A9, 0x64CA, 0x341D, 0x64CB, 0x452A, 0x64CC, 0x452B,
- 0x64CD, 0x0AE2, 0x64CE, 0x2116, 0x64D0, 0x41EF, 0x64D2, 0x13A7,
- 0x64D4, 0x1366, 0x64D5, 0x452C, 0x64D7, 0x452D, 0x64D8, 0x13AB,
- 0x64DA, 0x13A6, 0x64E0, 0x13B0, 0x64E1, 0x13B1, 0x64E2, 0x0C21,
- 0x64E3, 0x13B3, 0x64E4, 0x452F, 0x64E5, 0x38FE, 0x64E6, 0x0872,
- 0x64E7, 0x13AE, 0x64EC, 0x0656, 0x64ED, 0x4BDD, 0x64EF, 0x13B4,
- 0x64F0, 0x4BDE, 0x64F1, 0x13AD, 0x64F2, 0x13B8, 0x64F4, 0x13B7,
- 0x64F6, 0x13B6, 0x64F7, 0x38FF, 0x64FA, 0x13B9, 0x64FB, 0x3900,
- 0x64FD, 0x13BB, 0x64FE, 0x09D9, 0x64FF, 0x4530, 0x6500, 0x13BA,
- 0x6504, 0x3901, 0x6505, 0x13BE, 0x650F, 0x4532, 0x6514, 0x4533,
- 0x6516, 0x3902, 0x6518, 0x13BC, 0x6519, 0x3903, 0x651B, 0x4BDF,
- 0x651C, 0x13BD, 0x651D, 0x1397, 0x651E, 0x4535, 0x651F, 0x4BE0,
- 0x6522, 0x1E97, 0x6523, 0x13C0, 0x6524, 0x13BF, 0x6529, 0x41F0,
- 0x652A, 0x139F, 0x652B, 0x13C1, 0x652C, 0x13B5, 0x652E, 0x4BE1,
- 0x652F, 0x08A7, 0x6532, 0x4536, 0x6534, 0x13C2, 0x6535, 0x13C3,
- 0x6536, 0x13C5, 0x6537, 0x13C4, 0x6538, 0x13C6, 0x6539, 0x057E,
- 0x653B, 0x07C8, 0x653E, 0x0E4C, 0x653F, 0x0A53, 0x6544, 0x4537,
- 0x6545, 0x0782, 0x6547, 0x3904, 0x6548, 0x13C8, 0x6549, 0x4BE2,
- 0x654D, 0x13CB, 0x654E, 0x2117, 0x654F, 0x0DC4, 0x6551, 0x0679,
- 0x6554, 0x4538, 0x6555, 0x13CA, 0x6556, 0x13C9, 0x6557, 0x0D0A,
- 0x6558, 0x13CC, 0x6559, 0x06AD, 0x655D, 0x13CE, 0x655E, 0x13CD,
- 0x6560, 0x4BE3, 0x6562, 0x05F6, 0x6563, 0x0884, 0x6566, 0x0CB0,
- 0x6567, 0x3905, 0x656B, 0x4539, 0x656C, 0x071F, 0x6570, 0x0A3A,
- 0x6572, 0x13CF, 0x6574, 0x0A54, 0x6575, 0x0C22, 0x6577, 0x0DD1,
- 0x6578, 0x13D0, 0x657A, 0x453A, 0x6581, 0x3906, 0x6582, 0x13D1,
- 0x6583, 0x13D2, 0x6584, 0x453B, 0x6585, 0x3907, 0x6587, 0x0E08,
- 0x6588, 0x120C, 0x6589, 0x0A6A, 0x658A, 0x453C, 0x658C, 0x0DBE,
- 0x658E, 0x0848, 0x6590, 0x0D79, 0x6591, 0x0D57, 0x6592, 0x4BE4,
- 0x6595, 0x4BE5, 0x6597, 0x0C47, 0x6599, 0x0F89, 0x659B, 0x13D4,
- 0x659C, 0x08FC, 0x659D, 0x41F1, 0x659F, 0x13D5, 0x65A1, 0x047A,
- 0x65A4, 0x06CC, 0x65A5, 0x0A71, 0x65A7, 0x0DD2, 0x65AB, 0x13D6,
- 0x65AC, 0x0890, 0x65AD, 0x0B85, 0x65AF, 0x08A9, 0x65B0, 0x09FD,
- 0x65B2, 0x453D, 0x65B4, 0x4BE6, 0x65B5, 0x453E, 0x65B7, 0x13D7,
- 0x65B8, 0x453F, 0x65B9, 0x0E4D, 0x65BC, 0x0519, 0x65BD, 0x08AA,
- 0x65BE, 0x4BE7, 0x65BF, 0x4540, 0x65C1, 0x13DA, 0x65C2, 0x3908,
- 0x65C3, 0x13D8, 0x65C4, 0x13DB, 0x65C5, 0x0F81, 0x65C6, 0x13D9,
- 0x65C8, 0x4BE8, 0x65C9, 0x4541, 0x65CB, 0x0A9F, 0x65CC, 0x13DC,
- 0x65CE, 0x4BE9, 0x65CF, 0x0B12, 0x65D0, 0x4BEA, 0x65D2, 0x13DD,
- 0x65D4, 0x4542, 0x65D7, 0x0636, 0x65D9, 0x13DF, 0x65DB, 0x13DE,
- 0x65DF, 0x4BEB, 0x65E0, 0x13E0, 0x65E1, 0x13E1, 0x65E2, 0x0637,
- 0x65E3, 0x3585, 0x65E5, 0x0CD4, 0x65E6, 0x0B74, 0x65E7, 0x0686,
- 0x65E8, 0x08AB, 0x65E9, 0x0AE3, 0x65EC, 0x0966, 0x65ED, 0x0474,
- 0x65F0, 0x3909, 0x65F1, 0x13E2, 0x65F2, 0x390A, 0x65F9, 0x4544,
- 0x65FA, 0x0522, 0x65FB, 0x13E6, 0x65FC, 0x4545, 0x6600, 0x2118,
- 0x6602, 0x07C9, 0x6603, 0x13E5, 0x6604, 0x4546, 0x6606, 0x081B,
- 0x6607, 0x09A2, 0x6608, 0x4547, 0x6609, 0x211A, 0x660A, 0x13E4,
- 0x660C, 0x09A3, 0x660E, 0x0ECC, 0x660F, 0x081A, 0x6613, 0x049B,
- 0x6614, 0x0A72, 0x6615, 0x2119, 0x661C, 0x13EB, 0x661E, 0x4F50,
- 0x661F, 0x0A55, 0x6620, 0x04E9, 0x6621, 0x4548, 0x6622, 0x41F3,
- 0x6624, 0x211D, 0x6625, 0x095F, 0x6627, 0x0E94, 0x6628, 0x0862,
- 0x662A, 0x4549, 0x662B, 0x41F4, 0x662C, 0x390B, 0x662D, 0x09A4,
- 0x662E, 0x211B, 0x662F, 0x0A4B, 0x6630, 0x41F5, 0x6631, 0x20AE,
- 0x6633, 0x41F6, 0x6634, 0x13EA, 0x6635, 0x13E8, 0x6636, 0x13E9,
- 0x663A, 0x41F2, 0x663B, 0x1E00, 0x663C, 0x0BA9, 0x663F, 0x1409,
- 0x6641, 0x13EF, 0x6642, 0x08CC, 0x6643, 0x07CA, 0x6644, 0x13ED,
- 0x6645, 0x454A, 0x6648, 0x41F7, 0x6649, 0x13EE, 0x664B, 0x09FE,
- 0x664C, 0x390C, 0x664E, 0x454C, 0x664F, 0x13EC, 0x6651, 0x454B,
- 0x6652, 0x087D, 0x6657, 0x211F, 0x6659, 0x2120, 0x665A, 0x3441,
- 0x665B, 0x390D, 0x665C, 0x390E, 0x665D, 0x13F1, 0x665E, 0x13F0,
- 0x665F, 0x13F5, 0x6661, 0x390F, 0x6662, 0x13F6, 0x6663, 0x373A,
- 0x6664, 0x13F2, 0x6665, 0x211E, 0x6666, 0x0580, 0x6667, 0x13F3,
- 0x6668, 0x13F4, 0x6669, 0x0D69, 0x666A, 0x4551, 0x666B, 0x3910,
- 0x666C, 0x4552, 0x666D, 0x4553, 0x666E, 0x0DD3, 0x666F, 0x0720,
- 0x6670, 0x13F7, 0x6673, 0x2122, 0x6674, 0x0A56, 0x6676, 0x09A5,
- 0x6677, 0x41F9, 0x6678, 0x41FA, 0x667A, 0x0B90, 0x667B, 0x4554,
- 0x667E, 0x4BEC, 0x6680, 0x4555, 0x6681, 0x06BF, 0x6683, 0x13F8,
- 0x6684, 0x13FC, 0x6687, 0x054B, 0x6688, 0x13F9, 0x6689, 0x13FB,
- 0x668B, 0x4BED, 0x668C, 0x4BEE, 0x668D, 0x41FB, 0x668E, 0x13FA,
- 0x6690, 0x4556, 0x6691, 0x0975, 0x6692, 0x4557, 0x6696, 0x0B86,
- 0x6697, 0x0489, 0x6698, 0x13FD, 0x6699, 0x2123, 0x669D, 0x13FE,
- 0x66A0, 0x2124, 0x66A2, 0x0BC6, 0x66A4, 0x3912, 0x66A6, 0x0FB9,
- 0x66AB, 0x0891, 0x66AD, 0x4559, 0x66AE, 0x0E3B, 0x66B1, 0x455A,
- 0x66B2, 0x2125, 0x66B3, 0x4BEF, 0x66B4, 0x0E6B, 0x66B5, 0x455B,
- 0x66B8, 0x1405, 0x66B9, 0x1400, 0x66BB, 0x41FC, 0x66BC, 0x1403,
- 0x66BE, 0x1402, 0x66BF, 0x2126, 0x66C0, 0x4BF0, 0x66C1, 0x13FF,
- 0x66C4, 0x1404, 0x66C6, 0x3455, 0x66C7, 0x0CB6, 0x66C8, 0x3913,
- 0x66C9, 0x1401, 0x66CF, 0x4BF1, 0x66D6, 0x1406, 0x66D9, 0x0976,
- 0x66DA, 0x1407, 0x66DB, 0x41FD, 0x66DC, 0x0F35, 0x66DD, 0x0D2E,
- 0x66E0, 0x1408, 0x66E6, 0x140A, 0x66E8, 0x41FE, 0x66E9, 0x140B,
- 0x66EC, 0x3914, 0x66F0, 0x140C, 0x66F2, 0x06C2, 0x66F3, 0x04EA,
- 0x66F4, 0x07CB, 0x66F5, 0x140D, 0x66F7, 0x140E, 0x66F8, 0x097B,
- 0x66F9, 0x0AE4, 0x66FA, 0x2127, 0x66FB, 0x20B1, 0x66FC, 0x10ED,
- 0x66FD, 0x0AC0, 0x66FE, 0x0ABF, 0x66FF, 0x0B38, 0x6700, 0x0837,
- 0x6701, 0x455F, 0x6703, 0x104B, 0x6705, 0x3915, 0x6708, 0x0744,
- 0x6709, 0x0F17, 0x670B, 0x0E4E, 0x670D, 0x0DF0, 0x670E, 0x2128,
- 0x670F, 0x140F, 0x6712, 0x4560, 0x6713, 0x3916, 0x6714, 0x0863,
- 0x6715, 0x0BDB, 0x6716, 0x1410, 0x6717, 0x0FD5, 0x6719, 0x4562,
- 0x671B, 0x0E6C, 0x671D, 0x0BC7, 0x671E, 0x1411, 0x671F, 0x0638,
- 0x6725, 0x4BF2, 0x6726, 0x1412, 0x6727, 0x1413, 0x6728, 0x0EE6,
- 0x672A, 0x0EB0, 0x672B, 0x0EA4, 0x672C, 0x0E8A, 0x672D, 0x0873,
- 0x672E, 0x1415, 0x6731, 0x0917, 0x6733, 0x3917, 0x6734, 0x0E7F,
- 0x6735, 0x4BF3, 0x6736, 0x1417, 0x6737, 0x141A, 0x6738, 0x1419,
- 0x673A, 0x0635, 0x673D, 0x067A, 0x673F, 0x1416, 0x6741, 0x1418,
- 0x6743, 0x35B7, 0x6746, 0x141B, 0x6747, 0x41FF, 0x6748, 0x3918,
- 0x6749, 0x0A3F, 0x674C, 0x3919, 0x674D, 0x4565, 0x674E, 0x0F65,
- 0x674F, 0x048D, 0x6750, 0x0850, 0x6751, 0x0B1C, 0x6753, 0x0909,
- 0x6754, 0x4566, 0x6755, 0x4BF4, 0x6756, 0x09DB, 0x6759, 0x141E,
- 0x675C, 0x0C48, 0x675D, 0x4567, 0x675E, 0x141C, 0x675F, 0x0B0B,
- 0x6760, 0x141D, 0x6761, 0x09DA, 0x6762, 0x0EE9, 0x6763, 0x141F,
- 0x6764, 0x1420, 0x6765, 0x0F52, 0x6766, 0x212A, 0x676A, 0x1425,
- 0x676D, 0x07CC, 0x676E, 0x3571, 0x676F, 0x0D0B, 0x6770, 0x1422,
- 0x6771, 0x0C66, 0x6772, 0x13E3, 0x6773, 0x13E7, 0x6774, 0x456B,
- 0x6775, 0x0669, 0x6776, 0x391A, 0x6777, 0x0CFD, 0x677B, 0x391B,
- 0x677C, 0x1424, 0x677E, 0x09A6, 0x677F, 0x0D58, 0x6780, 0x4BF5,
- 0x6781, 0x4200, 0x6785, 0x142A, 0x6787, 0x0D8E, 0x6789, 0x1421,
- 0x678B, 0x1427, 0x678C, 0x1426, 0x678F, 0x4BF6, 0x6790, 0x0A73,
- 0x6791, 0x4BF7, 0x6792, 0x456D, 0x6793, 0x4201, 0x6795, 0x0E9B,
- 0x6797, 0x0F9B, 0x6798, 0x4202, 0x679A, 0x0E95, 0x679B, 0x4203,
- 0x679C, 0x054C, 0x679D, 0x08AC, 0x67A0, 0x0FEE, 0x67A1, 0x1429,
- 0x67A2, 0x0A3B, 0x67A4, 0x4BF8, 0x67A6, 0x1428, 0x67A9, 0x1423,
- 0x67AF, 0x0783, 0x67B0, 0x391C, 0x67B1, 0x4BF9, 0x67B2, 0x391D,
- 0x67B3, 0x142F, 0x67B4, 0x142D, 0x67B5, 0x4BFA, 0x67B6, 0x054D,
- 0x67B7, 0x142B, 0x67B8, 0x1431, 0x67B9, 0x1437, 0x67BB, 0x212B,
- 0x67BE, 0x4BFB, 0x67C0, 0x212D, 0x67C1, 0x0B28, 0x67C3, 0x4571,
- 0x67C4, 0x0E11, 0x67C6, 0x1439, 0x67C8, 0x4572, 0x67CA, 0x0D94,
- 0x67CE, 0x1438, 0x67CF, 0x0D26, 0x67D0, 0x0E6D, 0x67D1, 0x05F7,
- 0x67D2, 0x4573, 0x67D3, 0x0A9B, 0x67D4, 0x094A, 0x67D7, 0x391F,
- 0x67D8, 0x0BEF, 0x67D9, 0x3920, 0x67DA, 0x0F18, 0x67DB, 0x4574,
- 0x67DD, 0x1434, 0x67DE, 0x1433, 0x67E2, 0x1435, 0x67E4, 0x1432,
- 0x67E7, 0x143A, 0x67E9, 0x1430, 0x67EC, 0x142E, 0x67EE, 0x1436,
- 0x67EF, 0x142C, 0x67F0, 0x3921, 0x67F1, 0x0BAA, 0x67F3, 0x0F04,
- 0x67F4, 0x08F2, 0x67F5, 0x0864, 0x67F7, 0x4575, 0x67F9, 0x391E,
- 0x67FA, 0x1E9A, 0x67FB, 0x082A, 0x67FC, 0x4204, 0x67FE, 0x0E9D,
- 0x67FF, 0x059F, 0x6801, 0x36F2, 0x6802, 0x0BEA, 0x6803, 0x0CA2,
- 0x6804, 0x04EB, 0x6805, 0x1E07, 0x6810, 0x4570, 0x6813, 0x0A96,
- 0x6816, 0x0A58, 0x6817, 0x0700, 0x6818, 0x4579, 0x681D, 0x4205,
- 0x681E, 0x143C, 0x681F, 0x457A, 0x6821, 0x07CD, 0x6822, 0x05DA,
- 0x6828, 0x4BFC, 0x6829, 0x143E, 0x682A, 0x05D2, 0x682B, 0x1444,
- 0x682C, 0x3922, 0x682D, 0x457B, 0x6830, 0x3923, 0x6831, 0x3924,
- 0x6832, 0x1441, 0x6833, 0x457D, 0x6834, 0x0A97, 0x6838, 0x05A9,
- 0x6839, 0x081C, 0x683B, 0x457E, 0x683C, 0x05A8, 0x683D, 0x083F,
- 0x683E, 0x457F, 0x6840, 0x143F, 0x6841, 0x073B, 0x6842, 0x0721,
- 0x6843, 0x0C67, 0x6844, 0x212F, 0x6845, 0x4580, 0x6846, 0x143D,
- 0x6848, 0x048A, 0x6849, 0x4581, 0x684C, 0x4582, 0x684D, 0x1440,
- 0x684E, 0x1442, 0x6850, 0x06C5, 0x6851, 0x0702, 0x6852, 0x212C,
- 0x6853, 0x05F8, 0x6854, 0x0665, 0x6855, 0x4583, 0x6857, 0x4584,
- 0x6859, 0x1445, 0x685B, 0x3925, 0x685C, 0x0869, 0x685D, 0x0E9F,
- 0x685F, 0x0885, 0x6863, 0x1446, 0x6867, 0x0DA2, 0x686B, 0x4586,
- 0x686E, 0x4587, 0x6872, 0x3926, 0x6874, 0x1452, 0x6875, 0x3927,
- 0x6876, 0x0533, 0x6877, 0x1447, 0x687A, 0x3928, 0x687C, 0x4588,
- 0x687E, 0x1458, 0x687F, 0x1448, 0x6881, 0x0F8A, 0x6882, 0x4589,
- 0x6883, 0x144F, 0x6884, 0x3929, 0x6885, 0x0D15, 0x6886, 0x4BFD,
- 0x688D, 0x1457, 0x688E, 0x1E9C, 0x688F, 0x144A, 0x6890, 0x458A,
- 0x6893, 0x0478, 0x6894, 0x144C, 0x6896, 0x458B, 0x6897, 0x07CE,
- 0x6898, 0x458D, 0x6899, 0x458E, 0x689A, 0x458F, 0x689B, 0x144E,
- 0x689C, 0x4590, 0x689D, 0x144D, 0x689F, 0x1449, 0x68A0, 0x1454,
- 0x68A2, 0x09A7, 0x68A3, 0x4206, 0x68A5, 0x392A, 0x68A6, 0x11BE,
- 0x68A7, 0x079C, 0x68A8, 0x0F66, 0x68AA, 0x4591, 0x68AB, 0x4592,
- 0x68AD, 0x144B, 0x68AF, 0x0C10, 0x68B0, 0x0581, 0x68B1, 0x081D,
- 0x68B2, 0x392B, 0x68B3, 0x1443, 0x68B4, 0x4593, 0x68B5, 0x1453,
- 0x68B6, 0x05BF, 0x68B9, 0x1451, 0x68BA, 0x1455, 0x68BB, 0x4594,
- 0x68BC, 0x0C68, 0x68C3, 0x4598, 0x68C4, 0x063A, 0x68C5, 0x4599,
- 0x68C6, 0x1473, 0x68C8, 0x20AF, 0x68C9, 0x0ED5, 0x68CA, 0x145A,
- 0x68CB, 0x0639, 0x68CC, 0x459A, 0x68CD, 0x1461, 0x68CF, 0x2130,
- 0x68D0, 0x392C, 0x68D2, 0x0E6E, 0x68D4, 0x1462, 0x68D5, 0x1464,
- 0x68D6, 0x392D, 0x68D7, 0x1468, 0x68D8, 0x145C, 0x68D9, 0x459B,
- 0x68DA, 0x0B68, 0x68DF, 0x0C69, 0x68E0, 0x146C, 0x68E1, 0x145F,
- 0x68E3, 0x1469, 0x68E4, 0x459C, 0x68E5, 0x459D, 0x68E7, 0x1463,
- 0x68E8, 0x392E, 0x68EB, 0x4BFE, 0x68EC, 0x459E, 0x68ED, 0x392F,
- 0x68EE, 0x09FF, 0x68EF, 0x146D, 0x68F0, 0x3930, 0x68F1, 0x3931,
- 0x68F2, 0x0A57, 0x68F5, 0x4BFF, 0x68F7, 0x459F, 0x68F9, 0x146B,
- 0x68FA, 0x05F9, 0x68FB, 0x4595, 0x68FC, 0x3932, 0x6900, 0x0FF6,
- 0x6901, 0x1459, 0x6903, 0x45A0, 0x6904, 0x1467, 0x6905, 0x049C,
- 0x6907, 0x45A1, 0x6908, 0x145B, 0x690A, 0x4207, 0x690B, 0x0EC6,
- 0x690C, 0x1460, 0x690D, 0x09E8, 0x690E, 0x0BE3, 0x690F, 0x1456,
- 0x6911, 0x3933, 0x6912, 0x1466, 0x6913, 0x3934, 0x6917, 0x4C00,
- 0x6919, 0x0A40, 0x691A, 0x1470, 0x691B, 0x05CF, 0x691C, 0x0755,
- 0x6921, 0x1472, 0x6922, 0x145D, 0x6923, 0x1471, 0x6925, 0x146A,
- 0x6926, 0x145E, 0x6928, 0x146E, 0x692A, 0x146F, 0x6930, 0x1480,
- 0x6933, 0x4C01, 0x6934, 0x0CA6, 0x6935, 0x3935, 0x6936, 0x1465,
- 0x6938, 0x4C02, 0x6939, 0x147C, 0x693B, 0x3936, 0x693D, 0x147E,
- 0x693F, 0x0BF4, 0x6942, 0x420A, 0x6946, 0x45A5, 0x6949, 0x4208,
- 0x694A, 0x0F36, 0x6953, 0x0DE8, 0x6954, 0x1479, 0x6955, 0x0B2A,
- 0x6957, 0x3937, 0x6959, 0x147F, 0x695A, 0x0AC1, 0x695B, 0x4C03,
- 0x695C, 0x1476, 0x695D, 0x1483, 0x695E, 0x1482, 0x6960, 0x0CC7,
- 0x6961, 0x1481, 0x6962, 0x0CC2, 0x6963, 0x3938, 0x6964, 0x420B,
- 0x6965, 0x4C04, 0x6968, 0x2132, 0x6969, 0x45A6, 0x696A, 0x1485,
- 0x696B, 0x1478, 0x696C, 0x45A7, 0x696D, 0x06C0, 0x696E, 0x147B,
- 0x696F, 0x0967, 0x6972, 0x3939, 0x6973, 0x0D16, 0x6974, 0x147D,
- 0x6975, 0x06C3, 0x6977, 0x1475, 0x6978, 0x1477, 0x6979, 0x1474,
- 0x697A, 0x45A8, 0x697C, 0x0FD6, 0x697D, 0x05B8, 0x697E, 0x147A,
- 0x697F, 0x393A, 0x6980, 0x393B, 0x6981, 0x1484, 0x6982, 0x0593,
- 0x6986, 0x3740, 0x698A, 0x0857, 0x698E, 0x04FF, 0x6991, 0x1495,
- 0x6992, 0x45A9, 0x6994, 0x0FD7, 0x6995, 0x1498, 0x6996, 0x45AB,
- 0x6998, 0x2134, 0x699B, 0x0A00, 0x699C, 0x1497, 0x69A0, 0x1496,
- 0x69A5, 0x420C, 0x69A6, 0x393C, 0x69A7, 0x1493, 0x69A8, 0x4C05,
- 0x69AB, 0x4C06, 0x69AD, 0x393D, 0x69AE, 0x1487, 0x69AF, 0x4C07,
- 0x69B0, 0x45AC, 0x69B1, 0x14A4, 0x69B2, 0x1486, 0x69B4, 0x1499,
- 0x69B7, 0x393E, 0x69BA, 0x45AD, 0x69BB, 0x1491, 0x69BC, 0x45AE,
- 0x69BE, 0x148C, 0x69BF, 0x1489, 0x69C0, 0x45AF, 0x69C1, 0x148A,
- 0x69C3, 0x1492, 0x69C7, 0x1D33, 0x69CA, 0x148F, 0x69CB, 0x07CF,
- 0x69CC, 0x0BE4, 0x69CD, 0x0AE6, 0x69CE, 0x148D, 0x69CF, 0x420D,
- 0x69D0, 0x1488, 0x69D1, 0x45B0, 0x69D3, 0x148B, 0x69D6, 0x393F,
- 0x69D7, 0x3940, 0x69D8, 0x0F37, 0x69D9, 0x0E98, 0x69DD, 0x1490,
- 0x69DE, 0x149A, 0x69E2, 0x2135, 0x69E3, 0x45B4, 0x69E5, 0x4C08,
- 0x69E7, 0x14A2, 0x69E8, 0x149B, 0x69E9, 0x4210, 0x69EA, 0x3411,
- 0x69EB, 0x14A8, 0x69ED, 0x14A6, 0x69EE, 0x45B5, 0x69EF, 0x45B6,
- 0x69F1, 0x4C09, 0x69F2, 0x14A1, 0x69F3, 0x45B7, 0x69F4, 0x45B9,
- 0x69F5, 0x4211, 0x69F6, 0x373F, 0x69F9, 0x14A0, 0x69FB, 0x0BEC,
- 0x69FD, 0x0AE7, 0x69FE, 0x45BA, 0x69FF, 0x149E, 0x6A01, 0x3941,
- 0x6A02, 0x149C, 0x6A05, 0x14A3, 0x6A0A, 0x14A9, 0x6A0B, 0x0D89,
- 0x6A0C, 0x14AF, 0x6A0F, 0x3942, 0x6A11, 0x45BB, 0x6A12, 0x14AA,
- 0x6A13, 0x14AD, 0x6A14, 0x14A7, 0x6A15, 0x3943, 0x6A17, 0x0BB2,
- 0x6A19, 0x0DAA, 0x6A1A, 0x45BC, 0x6A1B, 0x149D, 0x6A1D, 0x45BD,
- 0x6A1E, 0x14A5, 0x6A1F, 0x09A8, 0x6A21, 0x0EDB, 0x6A22, 0x14B9,
- 0x6A23, 0x14AC, 0x6A28, 0x3944, 0x6A29, 0x0756, 0x6A2A, 0x0523,
- 0x6A2B, 0x05BD, 0x6A2E, 0x1494, 0x6A30, 0x2136, 0x6A32, 0x45BF,
- 0x6A33, 0x45C0, 0x6A34, 0x3945, 0x6A35, 0x09A9, 0x6A36, 0x14B1,
- 0x6A38, 0x14B8, 0x6A39, 0x0925, 0x6A3A, 0x05D0, 0x6A3B, 0x4213,
- 0x6A3D, 0x0B6C, 0x6A3E, 0x3946, 0x6A3F, 0x45C1, 0x6A44, 0x14AE,
- 0x6A45, 0x3947, 0x6A46, 0x2138, 0x6A47, 0x14B3, 0x6A48, 0x14B7,
- 0x6A49, 0x45C2, 0x6A4A, 0x4C0A, 0x6A4B, 0x06AE, 0x6A4E, 0x45C4,
- 0x6A50, 0x3948, 0x6A51, 0x3949, 0x6A52, 0x45C5, 0x6A54, 0x3C34,
- 0x6A55, 0x4C0B, 0x6A56, 0x394A, 0x6A58, 0x0666, 0x6A59, 0x14B5,
- 0x6A5B, 0x394B, 0x6A5F, 0x063B, 0x6A61, 0x0CA3, 0x6A62, 0x14B4,
- 0x6A64, 0x45C6, 0x6A66, 0x14B6, 0x6A67, 0x4C0C, 0x6A6B, 0x2137,
- 0x6A71, 0x4C0D, 0x6A72, 0x14B0, 0x6A73, 0x2139, 0x6A78, 0x14B2,
- 0x6A7A, 0x45C3, 0x6A7E, 0x213A, 0x6A7F, 0x05BE, 0x6A80, 0x0B87,
- 0x6A83, 0x394C, 0x6A84, 0x14BD, 0x6A89, 0x394D, 0x6A8B, 0x45C8,
- 0x6A8D, 0x14BB, 0x6A8E, 0x079D, 0x6A90, 0x14BA, 0x6A91, 0x394E,
- 0x6A94, 0x4215, 0x6A97, 0x14C0, 0x6A9C, 0x143B, 0x6A9D, 0x394F,
- 0x6A9E, 0x3950, 0x6A9F, 0x3951, 0x6AA0, 0x14BC, 0x6AA1, 0x45CA,
- 0x6AA2, 0x14BE, 0x6AA3, 0x14BF, 0x6AA5, 0x4216, 0x6AAA, 0x14CB,
- 0x6AAB, 0x45CC, 0x6AAC, 0x14C7, 0x6AAE, 0x1450, 0x6AAF, 0x4C0E,
- 0x6AB3, 0x14C6, 0x6AB8, 0x14C5, 0x6ABB, 0x14C2, 0x6ABD, 0x45CD,
- 0x6AC1, 0x14AB, 0x6AC2, 0x14C4, 0x6AC3, 0x14C3, 0x6AC6, 0x45CE,
- 0x6AC8, 0x4C0F, 0x6AC9, 0x4C10, 0x6AD0, 0x45D0, 0x6AD1, 0x14C9,
- 0x6AD3, 0x0FCC, 0x6AD4, 0x45CF, 0x6ADA, 0x14CC, 0x6ADB, 0x06F3,
- 0x6ADC, 0x3952, 0x6ADD, 0x45D1, 0x6ADE, 0x14C8, 0x6ADF, 0x14CA,
- 0x6AE2, 0x213B, 0x6AE4, 0x213C, 0x6AE7, 0x3953, 0x6AE8, 0x0D3B,
- 0x6AEA, 0x14CD, 0x6AEC, 0x3954, 0x6AF1, 0x45D4, 0x6AF2, 0x45D5,
- 0x6AF3, 0x45D6, 0x6AF8, 0x4EB8, 0x6AFA, 0x14D1, 0x6AFB, 0x14CE,
- 0x6AFD, 0x45D7, 0x6B03, 0x4C11, 0x6B04, 0x0F5D, 0x6B05, 0x14CF,
- 0x6B0A, 0x149F, 0x6B0B, 0x45D9, 0x6B0F, 0x45DA, 0x6B10, 0x45DB,
- 0x6B11, 0x45DC, 0x6B12, 0x14D2, 0x6B16, 0x14D3, 0x6B17, 0x45DE,
- 0x6B1B, 0x4218, 0x6B1D, 0x04D7, 0x6B1E, 0x3955, 0x6B1F, 0x14D5,
- 0x6B20, 0x073D, 0x6B21, 0x08CD, 0x6B23, 0x06CD, 0x6B24, 0x3956,
- 0x6B27, 0x0524, 0x6B2C, 0x4219, 0x6B2F, 0x45E0, 0x6B32, 0x0F49,
- 0x6B35, 0x3957, 0x6B37, 0x14D7, 0x6B38, 0x14D6, 0x6B39, 0x14D9,
- 0x6B3A, 0x0657, 0x6B3B, 0x4C12, 0x6B3D, 0x06CE, 0x6B3E, 0x05FA,
- 0x6B3F, 0x4C13, 0x6B43, 0x14DC, 0x6B46, 0x3958, 0x6B47, 0x14DB,
- 0x6B49, 0x14DD, 0x6B4A, 0x45E1, 0x6B4C, 0x054E, 0x6B4E, 0x0B75,
- 0x6B50, 0x14DE, 0x6B53, 0x05FB, 0x6B54, 0x14E0, 0x6B56, 0x3959,
- 0x6B58, 0x45E2, 0x6B59, 0x14DF, 0x6B5B, 0x14E1, 0x6B5F, 0x14E2,
- 0x6B60, 0x395A, 0x6B61, 0x14E3, 0x6B62, 0x08AD, 0x6B63, 0x0A59,
- 0x6B64, 0x0811, 0x6B65, 0x344A, 0x6B66, 0x0DE2, 0x6B67, 0x421A,
- 0x6B69, 0x0E32, 0x6B6A, 0x0FEA, 0x6B6C, 0x45E3, 0x6B6F, 0x08C3,
- 0x6B72, 0x35D9, 0x6B73, 0x0840, 0x6B74, 0x0FBA, 0x6B75, 0x45E4,
- 0x6B77, 0x3456, 0x6B78, 0x14E4, 0x6B79, 0x14E5, 0x6B7A, 0x45E5,
- 0x6B7B, 0x08AE, 0x6B7D, 0x4C14, 0x6B7E, 0x4C15, 0x6B7F, 0x14E6,
- 0x6B80, 0x14E7, 0x6B81, 0x45E6, 0x6B82, 0x395B, 0x6B83, 0x14E9,
- 0x6B84, 0x14E8, 0x6B86, 0x0E86, 0x6B89, 0x0968, 0x6B8A, 0x0918,
- 0x6B8B, 0x0892, 0x6B8D, 0x14EA, 0x6B95, 0x14EC, 0x6B96, 0x09E9,
- 0x6B98, 0x14EB, 0x6B9B, 0x45E7, 0x6B9E, 0x14ED, 0x6BA4, 0x14EE,
- 0x6BA9, 0x421B, 0x6BAA, 0x14EF, 0x6BAB, 0x14F0, 0x6BAD, 0x421C,
- 0x6BAE, 0x45E8, 0x6BAF, 0x14F1, 0x6BB0, 0x4C16, 0x6BB1, 0x14F3,
- 0x6BB2, 0x14F2, 0x6BB3, 0x14F4, 0x6BB4, 0x0525, 0x6BB5, 0x0B88,
- 0x6BB7, 0x14F5, 0x6BBA, 0x0874, 0x6BBB, 0x05AA, 0x6BBC, 0x14F6,
- 0x6BBD, 0x45EA, 0x6BBE, 0x395C, 0x6BBF, 0x0C3C, 0x6BC0, 0x119D,
- 0x6BC5, 0x063D, 0x6BC6, 0x14F7, 0x6BC7, 0x45EB, 0x6BC8, 0x45EC,
- 0x6BC9, 0x45ED, 0x6BCB, 0x14F8, 0x6BCC, 0x3744, 0x6BCD, 0x0E3C,
- 0x6BCE, 0x0E96, 0x6BCF, 0x344C, 0x6BD2, 0x0C9F, 0x6BD3, 0x14F9,
- 0x6BD4, 0x0D7A, 0x6BD6, 0x213D, 0x6BD7, 0x421D, 0x6BD8, 0x0D8F,
- 0x6BDA, 0x45EE, 0x6BDB, 0x0EDF, 0x6BDF, 0x14FA, 0x6BE1, 0x395D,
- 0x6BE6, 0x45EF, 0x6BE7, 0x45F0, 0x6BEB, 0x14FC, 0x6BEC, 0x14FB,
- 0x6BEE, 0x45F1, 0x6BEF, 0x14FE, 0x6BF1, 0x395E, 0x6BF3, 0x14FD,
- 0x6BF7, 0x4C17, 0x6BF9, 0x4C18, 0x6BFF, 0x421E, 0x6C02, 0x45F2,
- 0x6C04, 0x4C19, 0x6C05, 0x421F, 0x6C08, 0x1500, 0x6C09, 0x4C1A,
- 0x6C0A, 0x45F3, 0x6C0D, 0x4C1B, 0x6C0E, 0x45F4, 0x6C0F, 0x08AF,
- 0x6C10, 0x395F, 0x6C11, 0x0EBD, 0x6C13, 0x1501, 0x6C14, 0x1502,
- 0x6C17, 0x063E, 0x6C1B, 0x1503, 0x6C23, 0x1505, 0x6C24, 0x1504,
- 0x6C2C, 0x4C1C, 0x6C33, 0x3960, 0x6C34, 0x0A2B, 0x6C35, 0x3961,
- 0x6C36, 0x45F5, 0x6C37, 0x0DAB, 0x6C38, 0x04EC, 0x6C3A, 0x4F55,
- 0x6C3E, 0x0D59, 0x6C3F, 0x213E, 0x6C40, 0x0C11, 0x6C41, 0x094B,
- 0x6C42, 0x067B, 0x6C4A, 0x4C1D, 0x6C4D, 0x45F7, 0x6C4E, 0x0D5A,
- 0x6C50, 0x08DA, 0x6C52, 0x4C1E, 0x6C54, 0x4C1F, 0x6C55, 0x1507,
- 0x6C57, 0x05FC, 0x6C59, 0x3963, 0x6C5A, 0x051A, 0x6C5B, 0x45F8,
- 0x6C5C, 0x213F, 0x6C5D, 0x0CCA, 0x6C5E, 0x1506, 0x6C5F, 0x07D0,
- 0x6C60, 0x0B91, 0x6C62, 0x1508, 0x6C67, 0x460A, 0x6C68, 0x1510,
- 0x6C6A, 0x1509, 0x6C6D, 0x45F9, 0x6C6F, 0x2141, 0x6C70, 0x0B21,
- 0x6C72, 0x067C, 0x6C73, 0x1511, 0x6C74, 0x4220, 0x6C76, 0x3964,
- 0x6C79, 0x4C20, 0x6C7A, 0x073E, 0x6C7B, 0x3965, 0x6C7D, 0x063F,
- 0x6C7E, 0x150F, 0x6C81, 0x150D, 0x6C82, 0x150A, 0x6C83, 0x0F4A,
- 0x6C84, 0x45FA, 0x6C85, 0x3966, 0x6C86, 0x2140, 0x6C88, 0x0BDC,
- 0x6C89, 0x45FB, 0x6C8C, 0x0CB1, 0x6C8D, 0x150B, 0x6C90, 0x1513,
- 0x6C92, 0x1512, 0x6C93, 0x06F9, 0x6C94, 0x45FD, 0x6C95, 0x3967,
- 0x6C96, 0x052D, 0x6C97, 0x45FE, 0x6C98, 0x4221, 0x6C99, 0x082B,
- 0x6C9A, 0x150C, 0x6C9B, 0x150E, 0x6C9C, 0x3968, 0x6CA1, 0x0E85,
- 0x6CA2, 0x0B54, 0x6CAA, 0x3749, 0x6CAB, 0x0EA5, 0x6CAC, 0x4C21,
- 0x6CAD, 0x45FF, 0x6CAE, 0x151B, 0x6CB1, 0x151C, 0x6CB3, 0x054F,
- 0x6CB4, 0x4C22, 0x6CB8, 0x0DF8, 0x6CB9, 0x0F09, 0x6CBA, 0x151E,
- 0x6CBB, 0x08CF, 0x6CBC, 0x09AA, 0x6CBD, 0x1517, 0x6CBE, 0x151D,
- 0x6CBF, 0x050A, 0x6CC1, 0x06AF, 0x6CC2, 0x4600, 0x6CC4, 0x1514,
- 0x6CC5, 0x1519, 0x6CC6, 0x4223, 0x6CC9, 0x0A98, 0x6CCA, 0x0D27,
- 0x6CCC, 0x0D7B, 0x6CD0, 0x3969, 0x6CD2, 0x4C23, 0x6CD3, 0x1516,
- 0x6CD4, 0x396A, 0x6CD5, 0x0E4F, 0x6CD6, 0x396B, 0x6CD7, 0x1518,
- 0x6CD9, 0x1521, 0x6CDA, 0x2142, 0x6CDB, 0x151F, 0x6CDC, 0x4602,
- 0x6CDD, 0x151A, 0x6CE0, 0x396C, 0x6CE1, 0x0E50, 0x6CE2, 0x0CFE,
- 0x6CE3, 0x067D, 0x6CE5, 0x0C1F, 0x6CE8, 0x0BAB, 0x6CE9, 0x4603,
- 0x6CEA, 0x1522, 0x6CEB, 0x396D, 0x6CEC, 0x396E, 0x6CED, 0x4604,
- 0x6CEE, 0x396F, 0x6CEF, 0x1520, 0x6CF0, 0x0B39, 0x6CF1, 0x1515,
- 0x6CF3, 0x04ED, 0x6CFB, 0x4222, 0x6D00, 0x4606, 0x6D01, 0x3C35,
- 0x6D04, 0x2143, 0x6D0A, 0x3970, 0x6D0B, 0x0F38, 0x6D0C, 0x152D,
- 0x6D0E, 0x3971, 0x6D11, 0x3972, 0x6D12, 0x152C, 0x6D17, 0x0A9A,
- 0x6D19, 0x1529, 0x6D1B, 0x0F56, 0x6D1E, 0x0C8E, 0x6D1F, 0x1523,
- 0x6D24, 0x4607, 0x6D25, 0x0BE1, 0x6D26, 0x4608, 0x6D27, 0x4609,
- 0x6D29, 0x04EE, 0x6D2A, 0x07D1, 0x6D2B, 0x1526, 0x6D2E, 0x3973,
- 0x6D2F, 0x460B, 0x6D31, 0x4224, 0x6D32, 0x0931, 0x6D33, 0x152B,
- 0x6D34, 0x461E, 0x6D35, 0x152A, 0x6D36, 0x1525, 0x6D38, 0x1528,
- 0x6D39, 0x4225, 0x6D3B, 0x05C6, 0x6D3C, 0x460C, 0x6D3D, 0x1527,
- 0x6D3E, 0x0CFF, 0x6D3F, 0x4226, 0x6D41, 0x0F76, 0x6D44, 0x09DC,
- 0x6D45, 0x0A99, 0x6D57, 0x3974, 0x6D58, 0x4227, 0x6D59, 0x1533,
- 0x6D5A, 0x1531, 0x6D5B, 0x460D, 0x6D5C, 0x0DBF, 0x6D5E, 0x3975,
- 0x6D60, 0x460E, 0x6D61, 0x4C24, 0x6D63, 0x152E, 0x6D64, 0x1530,
- 0x6D65, 0x3976, 0x6D66, 0x04DC, 0x6D69, 0x07D2, 0x6D6A, 0x0FD8,
- 0x6D6C, 0x059B, 0x6D6E, 0x0DD4, 0x6D6F, 0x2145, 0x6D70, 0x460F,
- 0x6D74, 0x0F4B, 0x6D77, 0x0582, 0x6D78, 0x0A01, 0x6D79, 0x1532,
- 0x6D7C, 0x4C25, 0x6D80, 0x4610, 0x6D81, 0x4611, 0x6D82, 0x3977,
- 0x6D85, 0x1537, 0x6D87, 0x2144, 0x6D88, 0x09AB, 0x6D89, 0x342A,
- 0x6D8A, 0x4612, 0x6D8C, 0x0F1A, 0x6D8D, 0x4613, 0x6D8E, 0x1534,
- 0x6D91, 0x4614, 0x6D93, 0x152F, 0x6D94, 0x4228, 0x6D95, 0x1535,
- 0x6D96, 0x2146, 0x6D98, 0x4615, 0x6D99, 0x0FA6, 0x6D9B, 0x0C6D,
- 0x6D9C, 0x0C9A, 0x6DAA, 0x4229, 0x6DAB, 0x461A, 0x6DAC, 0x2147,
- 0x6DAE, 0x461B, 0x6DAF, 0x0594, 0x6DB2, 0x04F7, 0x6DB4, 0x461C,
- 0x6DB5, 0x153B, 0x6DB8, 0x153E, 0x6DB9, 0x4C26, 0x6DBC, 0x0F8B,
- 0x6DBF, 0x3978, 0x6DC0, 0x0F4E, 0x6DC2, 0x461D, 0x6DC4, 0x3979,
- 0x6DC5, 0x1545, 0x6DC6, 0x153F, 0x6DC7, 0x153C, 0x6DC8, 0x461F,
- 0x6DCA, 0x397A, 0x6DCB, 0x0F9C, 0x6DCC, 0x1542, 0x6DCE, 0x4620,
- 0x6DCF, 0x2148, 0x6DD0, 0x3C36, 0x6DD1, 0x0954, 0x6DD2, 0x1544,
- 0x6DD5, 0x1549, 0x6DD6, 0x397B, 0x6DD8, 0x0C6B, 0x6DD9, 0x1547,
- 0x6DDA, 0x3453, 0x6DDB, 0x422A, 0x6DDD, 0x422B, 0x6DDE, 0x1541,
- 0x6DDF, 0x4621, 0x6DE1, 0x0B76, 0x6DE4, 0x1548, 0x6DE6, 0x153D,
- 0x6DE8, 0x1543, 0x6DE9, 0x397C, 0x6DEA, 0x154A, 0x6DEB, 0x04C0,
- 0x6DEC, 0x1540, 0x6DEE, 0x154B, 0x6DF0, 0x4C27, 0x6DF1, 0x0A02,
- 0x6DF2, 0x214A, 0x6DF3, 0x0969, 0x6DF5, 0x0DF5, 0x6DF6, 0x4622,
- 0x6DF7, 0x081E, 0x6DF8, 0x2149, 0x6DF9, 0x1538, 0x6DFA, 0x1546,
- 0x6DFB, 0x0C34, 0x6DFC, 0x214B, 0x6E05, 0x0A5A, 0x6E07, 0x05C7,
- 0x6E08, 0x0841, 0x6E09, 0x09AC, 0x6E0A, 0x153A, 0x6E0B, 0x094C,
- 0x6E13, 0x0722, 0x6E15, 0x1539, 0x6E17, 0x3746, 0x6E19, 0x154F,
- 0x6E1A, 0x0977, 0x6E1B, 0x076E, 0x6E1D, 0x155E, 0x6E1E, 0x4624,
- 0x6E1F, 0x1558, 0x6E20, 0x068E, 0x6E21, 0x0C49, 0x6E22, 0x397D,
- 0x6E23, 0x1553, 0x6E24, 0x155C, 0x6E25, 0x0473, 0x6E26, 0x04D4,
- 0x6E27, 0x214E, 0x6E29, 0x0539, 0x6E2B, 0x1555, 0x6E2C, 0x0B0C,
- 0x6E2D, 0x154C, 0x6E2E, 0x154E, 0x6E2F, 0x07D3, 0x6E32, 0x4626,
- 0x6E34, 0x3412, 0x6E36, 0x4623, 0x6E38, 0x155F, 0x6E39, 0x214C,
- 0x6E3A, 0x155A, 0x6E3C, 0x214F, 0x6E3E, 0x1552, 0x6E42, 0x3C37,
- 0x6E43, 0x1559, 0x6E44, 0x422C, 0x6E45, 0x4C28, 0x6E48, 0x4627,
- 0x6E49, 0x4628, 0x6E4A, 0x0EB7, 0x6E4B, 0x4629, 0x6E4C, 0x462A,
- 0x6E4D, 0x1557, 0x6E4E, 0x155B, 0x6E4F, 0x462B, 0x6E51, 0x397E,
- 0x6E53, 0x462C, 0x6E54, 0x462D, 0x6E56, 0x0784, 0x6E57, 0x462E,
- 0x6E58, 0x09AD, 0x6E5B, 0x0B77, 0x6E5C, 0x214D, 0x6E5E, 0x422D,
- 0x6E5F, 0x1551, 0x6E63, 0x462F, 0x6E67, 0x0F19, 0x6E6B, 0x1554,
- 0x6E6E, 0x154D, 0x6E6F, 0x0C6C, 0x6E72, 0x1550, 0x6E73, 0x4C29,
- 0x6E76, 0x1556, 0x6E7B, 0x4C2A, 0x6E7D, 0x4C2B, 0x6E7E, 0x0FF7,
- 0x6E7F, 0x08EA, 0x6E80, 0x0EAC, 0x6E82, 0x1560, 0x6E89, 0x4C2C,
- 0x6E8C, 0x0D42, 0x6E8F, 0x156C, 0x6E90, 0x076F, 0x6E93, 0x4631,
- 0x6E96, 0x096A, 0x6E98, 0x1562, 0x6E9C, 0x0F77, 0x6E9D, 0x07D4,
- 0x6E9F, 0x156F, 0x6EA2, 0x04B2, 0x6EA5, 0x156D, 0x6EA7, 0x4632,
- 0x6EAA, 0x1561, 0x6EAB, 0x340C, 0x6EAF, 0x1567, 0x6EB1, 0x422E,
- 0x6EB2, 0x1569, 0x6EB4, 0x4633, 0x6EB6, 0x0F39, 0x6EB7, 0x1564,
- 0x6EBA, 0x0C28, 0x6EBC, 0x4C2D, 0x6EBD, 0x1566, 0x6EBF, 0x2150,
- 0x6EC1, 0x422F, 0x6EC2, 0x156E, 0x6EC3, 0x4634, 0x6EC4, 0x1568,
- 0x6EC5, 0x0ED3, 0x6EC7, 0x397F, 0x6EC9, 0x1563, 0x6ECA, 0x3980,
- 0x6ECB, 0x08CE, 0x6ECC, 0x157B, 0x6ECE, 0x3981, 0x6ED1, 0x05C8,
- 0x6ED3, 0x1565, 0x6ED4, 0x156A, 0x6ED5, 0x156B, 0x6ED9, 0x3C38,
- 0x6EDA, 0x4C2E, 0x6EDB, 0x4C2F, 0x6EDD, 0x0B4C, 0x6EDE, 0x0B3A,
- 0x6EE6, 0x3C24, 0x6EEB, 0x4636, 0x6EEC, 0x1573, 0x6EEF, 0x1579,
- 0x6EF2, 0x1577, 0x6EF4, 0x0C23, 0x6EF7, 0x157E, 0x6EF8, 0x1574,
- 0x6EF9, 0x4637, 0x6EFB, 0x4638, 0x6EFD, 0x3982, 0x6EFE, 0x1575,
- 0x6EFF, 0x155D, 0x6F01, 0x0693, 0x6F02, 0x0DAC, 0x6F06, 0x08EB,
- 0x6F09, 0x0809, 0x6F0A, 0x4639, 0x6F0C, 0x463A, 0x6F0F, 0x0FD9,
- 0x6F10, 0x4230, 0x6F11, 0x1571, 0x6F13, 0x157D, 0x6F14, 0x050B,
- 0x6F15, 0x0AE8, 0x6F18, 0x463B, 0x6F1A, 0x3983, 0x6F20, 0x0D2F,
- 0x6F22, 0x05FD, 0x6F23, 0x0FC2, 0x6F25, 0x463C, 0x6F26, 0x4C30,
- 0x6F29, 0x4C31, 0x6F2A, 0x3984, 0x6F2B, 0x0EAD, 0x6F2C, 0x0BEE,
- 0x6F2F, 0x3985, 0x6F30, 0x4C32, 0x6F31, 0x1578, 0x6F32, 0x157A,
- 0x6F33, 0x3986, 0x6F35, 0x4635, 0x6F36, 0x463D, 0x6F38, 0x0AB4,
- 0x6F3C, 0x463E, 0x6F3E, 0x157C, 0x6F3F, 0x1576, 0x6F41, 0x1570,
- 0x6F45, 0x05FF, 0x6F51, 0x1E60, 0x6F52, 0x4640, 0x6F54, 0x073F,
- 0x6F57, 0x4641, 0x6F58, 0x158A, 0x6F59, 0x4231, 0x6F5A, 0x3987,
- 0x6F5B, 0x1585, 0x6F5C, 0x0A9C, 0x6F5E, 0x3988, 0x6F5F, 0x05C1,
- 0x6F60, 0x4642, 0x6F61, 0x4232, 0x6F62, 0x3989, 0x6F64, 0x096B,
- 0x6F66, 0x158E, 0x6F68, 0x4643, 0x6F6D, 0x1587, 0x6F6E, 0x0BC8,
- 0x6F6F, 0x1584, 0x6F70, 0x0BF5, 0x6F74, 0x15A7, 0x6F78, 0x1581,
- 0x6F7A, 0x1580, 0x6F7C, 0x1589, 0x6F7D, 0x398A, 0x6F7E, 0x4233,
- 0x6F80, 0x1583, 0x6F81, 0x1582, 0x6F82, 0x1588, 0x6F84, 0x0A45,
- 0x6F86, 0x157F, 0x6F87, 0x4C33, 0x6F88, 0x2151, 0x6F8B, 0x398B,
- 0x6F8C, 0x4234, 0x6F8D, 0x398C, 0x6F8E, 0x158B, 0x6F90, 0x4644,
- 0x6F91, 0x158C, 0x6F92, 0x398D, 0x6F94, 0x398E, 0x6F96, 0x4645,
- 0x6F97, 0x05FE, 0x6F98, 0x363C, 0x6F9A, 0x398F, 0x6F9D, 0x4C34,
- 0x6F9F, 0x4647, 0x6FA0, 0x4235, 0x6FA1, 0x1591, 0x6FA3, 0x1590,
- 0x6FA4, 0x1592, 0x6FA5, 0x4648, 0x6FA7, 0x3990, 0x6FA8, 0x3991,
- 0x6FAA, 0x1595, 0x6FAE, 0x4C35, 0x6FAF, 0x4649, 0x6FB1, 0x0C3D,
- 0x6FB3, 0x158F, 0x6FB5, 0x2152, 0x6FB6, 0x3992, 0x6FB7, 0x4C36,
- 0x6FB9, 0x1593, 0x6FBC, 0x4236, 0x6FBE, 0x4646, 0x6FC0, 0x0739,
- 0x6FC1, 0x0B59, 0x6FC2, 0x158D, 0x6FC3, 0x0CF1, 0x6FC6, 0x1594,
- 0x6FC7, 0x4237, 0x6FC8, 0x464B, 0x6FC9, 0x464C, 0x6FCA, 0x4238,
- 0x6FD4, 0x1599, 0x6FD5, 0x1597, 0x6FD8, 0x159A, 0x6FDA, 0x3993,
- 0x6FDB, 0x159D, 0x6FDE, 0x3994, 0x6FDF, 0x1596, 0x6FE0, 0x07FC,
- 0x6FE1, 0x0CDE, 0x6FE4, 0x1536, 0x6FE9, 0x464D, 0x6FEB, 0x0F5E,
- 0x6FEC, 0x1598, 0x6FEE, 0x159C, 0x6FEF, 0x0B55, 0x6FF0, 0x4239,
- 0x6FF1, 0x159B, 0x6FF3, 0x1586, 0x6FF5, 0x2153, 0x6FF6, 0x1BA4,
- 0x6FF9, 0x3C23, 0x6FFA, 0x15A0, 0x6FFC, 0x464F, 0x6FFE, 0x15A4,
- 0x7000, 0x4650, 0x7001, 0x15A2, 0x7005, 0x2154, 0x7006, 0x1E50,
- 0x7007, 0x2155, 0x7009, 0x159E, 0x700A, 0x4651, 0x700B, 0x159F,
- 0x700D, 0x4C37, 0x700F, 0x15A3, 0x7011, 0x15A1, 0x7015, 0x0DC0,
- 0x7018, 0x15A9, 0x701A, 0x15A6, 0x701B, 0x15A5, 0x701D, 0x15A8,
- 0x701E, 0x0CAC, 0x701F, 0x15AA, 0x7020, 0x4C38, 0x7023, 0x4652,
- 0x7026, 0x0BB3, 0x7027, 0x0B4D, 0x7028, 0x2156, 0x702C, 0x0A49,
- 0x7030, 0x15AB, 0x7032, 0x15AD, 0x7039, 0x3996, 0x703A, 0x4654,
- 0x703C, 0x3997, 0x703E, 0x15AC, 0x7043, 0x4655, 0x7047, 0x4656,
- 0x7049, 0x4C39, 0x704A, 0x4F52, 0x704B, 0x4657, 0x704C, 0x1572,
- 0x704E, 0x423A, 0x7051, 0x15AE, 0x7054, 0x3999, 0x7058, 0x0CBF,
- 0x705D, 0x399A, 0x705E, 0x399B, 0x7063, 0x15AF, 0x7064, 0x399C,
- 0x7065, 0x4659, 0x7069, 0x465A, 0x706B, 0x0550, 0x706C, 0x399D,
- 0x706E, 0x465B, 0x706F, 0x0C6E, 0x7070, 0x0583, 0x7075, 0x423B,
- 0x7076, 0x465C, 0x7078, 0x067E, 0x707C, 0x090A, 0x707D, 0x0842,
- 0x707E, 0x399E, 0x7081, 0x399F, 0x7085, 0x2157, 0x7086, 0x465D,
- 0x7089, 0x0FCD, 0x708A, 0x0A2C, 0x708E, 0x050C, 0x7092, 0x15B1,
- 0x7095, 0x39A0, 0x7097, 0x465E, 0x7098, 0x4C3A, 0x7099, 0x15B0,
- 0x709F, 0x4660, 0x70A4, 0x423C, 0x70AB, 0x2158, 0x70AC, 0x15B4,
- 0x70AD, 0x0B78, 0x70AE, 0x15B7, 0x70AF, 0x15B2, 0x70B0, 0x4C3B,
- 0x70B1, 0x4661, 0x70B3, 0x15B6, 0x70B7, 0x39A1, 0x70B8, 0x15B5,
- 0x70B9, 0x0C3A, 0x70BA, 0x049D, 0x70BB, 0x20AD, 0x70C8, 0x0FBD,
- 0x70CA, 0x4664, 0x70CB, 0x15B9, 0x70CF, 0x04CA, 0x70D1, 0x4665,
- 0x70D3, 0x39A2, 0x70D4, 0x39A3, 0x70D5, 0x4C3C, 0x70D6, 0x4C3D,
- 0x70D8, 0x39A4, 0x70D9, 0x15BB, 0x70DC, 0x39A5, 0x70DD, 0x15BA,
- 0x70DF, 0x15B8, 0x70E4, 0x423D, 0x70EC, 0x4663, 0x70F1, 0x15B3,
- 0x70F9, 0x0E51, 0x70FD, 0x15BD, 0x7103, 0x4666, 0x7104, 0x215A,
- 0x7106, 0x4667, 0x7107, 0x39A6, 0x7108, 0x4668, 0x7109, 0x15BC,
- 0x710C, 0x4669, 0x710F, 0x2159, 0x7114, 0x050D, 0x7119, 0x15BF,
- 0x711A, 0x0E02, 0x711C, 0x15BE, 0x711E, 0x423F, 0x7120, 0x39A7,
- 0x7121, 0x0EC1, 0x7126, 0x09AF, 0x712B, 0x423E, 0x712E, 0x4240,
- 0x712F, 0x466B, 0x7130, 0x1DDC, 0x7131, 0x39A8, 0x7136, 0x0AB5,
- 0x713C, 0x09AE, 0x7145, 0x4C3E, 0x7146, 0x215C, 0x7147, 0x215D,
- 0x7149, 0x0FC3, 0x714A, 0x39A9, 0x714C, 0x15C5, 0x714E, 0x0A9D,
- 0x7150, 0x466C, 0x7151, 0x4241, 0x7152, 0x39AA, 0x7153, 0x466D,
- 0x7155, 0x15C1, 0x7156, 0x15C6, 0x7159, 0x050E, 0x715C, 0x215B,
- 0x715E, 0x466E, 0x7160, 0x39AB, 0x7162, 0x15C4, 0x7164, 0x0D17,
- 0x7165, 0x15C0, 0x7166, 0x15C3, 0x7167, 0x09B0, 0x7168, 0x4242,
- 0x7169, 0x0D65, 0x716C, 0x15C7, 0x716E, 0x08FD, 0x7179, 0x39AC,
- 0x717D, 0x0A9E, 0x7180, 0x4671, 0x7184, 0x15CA, 0x7185, 0x4243,
- 0x7187, 0x4244, 0x7188, 0x15C2, 0x718A, 0x06FD, 0x718F, 0x15C8,
- 0x7192, 0x39AD, 0x7194, 0x0F3A, 0x7195, 0x15CB, 0x7196, 0x4670,
- 0x7199, 0x205D, 0x719B, 0x4672, 0x719F, 0x0959, 0x71A0, 0x4673,
- 0x71A2, 0x4674, 0x71A8, 0x15CC, 0x71AC, 0x15CD, 0x71AE, 0x4675,
- 0x71AF, 0x4676, 0x71B1, 0x0CE4, 0x71B2, 0x4C3F, 0x71B3, 0x3C25,
- 0x71B9, 0x15CF, 0x71BA, 0x4245, 0x71BE, 0x15D0, 0x71C1, 0x215F,
- 0x71C3, 0x0CE9, 0x71C4, 0x4246, 0x71C8, 0x0C6F, 0x71C9, 0x15D2,
- 0x71CB, 0x39AF, 0x71CE, 0x15D4, 0x71D0, 0x0F9D, 0x71D2, 0x15D1,
- 0x71D3, 0x39B0, 0x71D4, 0x15D3, 0x71D5, 0x050F, 0x71D6, 0x39B1,
- 0x71D7, 0x15CE, 0x71D9, 0x4678, 0x71DC, 0x4679, 0x71DF, 0x114E,
- 0x71E0, 0x15D5, 0x71E5, 0x0AE9, 0x71E6, 0x0886, 0x71E7, 0x15D7,
- 0x71EC, 0x15D6, 0x71ED, 0x09EA, 0x71EE, 0x10EE, 0x71F4, 0x4C40,
- 0x71F5, 0x15D8, 0x71F9, 0x15DA, 0x71FB, 0x15C9, 0x71FC, 0x15D9,
- 0x71FE, 0x2160, 0x71FF, 0x15DB, 0x7200, 0x39B2, 0x7206, 0x0D30,
- 0x7207, 0x467A, 0x720D, 0x15DC, 0x7210, 0x15DD, 0x7215, 0x4247,
- 0x7217, 0x4C41, 0x721B, 0x15DE, 0x721D, 0x39B3, 0x721F, 0x4C42,
- 0x7228, 0x15DF, 0x722A, 0x0BFA, 0x722B, 0x39B4, 0x722C, 0x15E1,
- 0x722D, 0x15E0, 0x7230, 0x15E2, 0x7232, 0x15E3, 0x7234, 0x467C,
- 0x7235, 0x090B, 0x7236, 0x0DD5, 0x7238, 0x39B5, 0x7239, 0x467D,
- 0x723A, 0x0EF8, 0x723B, 0x15E4, 0x723C, 0x15E5, 0x723D, 0x0AD8,
- 0x723E, 0x08D0, 0x723F, 0x15E6, 0x7240, 0x15E7, 0x7241, 0x39B6,
- 0x7242, 0x467E, 0x7243, 0x4C43, 0x7246, 0x15E8, 0x7247, 0x0E22,
- 0x7248, 0x0D5B, 0x724B, 0x15E9, 0x724C, 0x0D0D, 0x724F, 0x4C44,
- 0x7250, 0x4C45, 0x7252, 0x0BC9, 0x7253, 0x39B7, 0x7255, 0x39B8,
- 0x7256, 0x39B9, 0x7257, 0x467F, 0x7258, 0x15EA, 0x7259, 0x0567,
- 0x725A, 0x4C46, 0x725B, 0x0687, 0x725C, 0x39BA, 0x725D, 0x0ED2,
- 0x725F, 0x0EC2, 0x7260, 0x4C47, 0x7261, 0x0534, 0x7262, 0x0FDA,
- 0x7263, 0x4680, 0x7267, 0x0E80, 0x7268, 0x4C48, 0x7269, 0x0DFA,
- 0x726E, 0x4682, 0x726F, 0x4683, 0x7272, 0x0A5B, 0x7274, 0x15EB,
- 0x7277, 0x4C49, 0x7278, 0x4684, 0x7279, 0x0C9B, 0x727D, 0x0757,
- 0x727E, 0x15EC, 0x727F, 0x4685, 0x7280, 0x0844, 0x7281, 0x15EE,
- 0x7282, 0x15ED, 0x7284, 0x4C4A, 0x7287, 0x15EF, 0x728D, 0x39BB,
- 0x728E, 0x4686, 0x7292, 0x15F0, 0x7296, 0x15F1, 0x729B, 0x4249,
- 0x72A0, 0x0658, 0x72A2, 0x15F2, 0x72A7, 0x15F3, 0x72AC, 0x0758,
- 0x72AD, 0x39BC, 0x72AE, 0x4688, 0x72AF, 0x0D5C, 0x72B0, 0x4689,
- 0x72B1, 0x2161, 0x72B2, 0x15F5, 0x72B4, 0x39BD, 0x72B6, 0x09DD,
- 0x72B9, 0x15F4, 0x72BE, 0x2162, 0x72C0, 0x342B, 0x72C1, 0x468A,
- 0x72C2, 0x06B0, 0x72C3, 0x15F6, 0x72C4, 0x15F8, 0x72C6, 0x15F7,
- 0x72C7, 0x39BE, 0x72C9, 0x4C4B, 0x72CC, 0x468C, 0x72CE, 0x15F9,
- 0x72D0, 0x0785, 0x72D2, 0x15FA, 0x72D7, 0x06E1, 0x72D9, 0x0AC2,
- 0x72DB, 0x080F, 0x72E0, 0x15FC, 0x72E1, 0x15FD, 0x72E2, 0x15FB,
- 0x72E5, 0x4C4C, 0x72E9, 0x0919, 0x72EC, 0x0CA0, 0x72ED, 0x06B1,
- 0x72F3, 0x468F, 0x72F4, 0x4C4D, 0x72F7, 0x15FF, 0x72F8, 0x0B6A,
- 0x72F9, 0x15FE, 0x72FA, 0x4690, 0x72FB, 0x39BF, 0x72FC, 0x0FDB,
- 0x72FD, 0x0D18, 0x7302, 0x4C4E, 0x7304, 0x39C0, 0x7305, 0x39C1,
- 0x7307, 0x4691, 0x730A, 0x1602, 0x730B, 0x4C4F, 0x7312, 0x4692,
- 0x7316, 0x1604, 0x7317, 0x1601, 0x7318, 0x4693, 0x7319, 0x4694,
- 0x731B, 0x0EE0, 0x731C, 0x1603, 0x731D, 0x1605, 0x731E, 0x4C50,
- 0x731F, 0x0F8C, 0x7322, 0x4C51, 0x7324, 0x2163, 0x7325, 0x1609,
- 0x7327, 0x424B, 0x7328, 0x39C2, 0x7329, 0x1608, 0x732A, 0x0BB4,
- 0x732B, 0x0CE3, 0x732C, 0x4697, 0x732E, 0x0759, 0x732F, 0x1607,
- 0x7331, 0x39C3, 0x7333, 0x4698, 0x7334, 0x1606, 0x7336, 0x0F1B,
- 0x7337, 0x0F1C, 0x7339, 0x4696, 0x733A, 0x4C52, 0x733B, 0x4C53,
- 0x733D, 0x4699, 0x733E, 0x160A, 0x733F, 0x0510, 0x7343, 0x39C4,
- 0x7344, 0x0808, 0x7345, 0x08B0, 0x734D, 0x4C54, 0x734E, 0x160B,
- 0x734F, 0x160C, 0x7350, 0x424C, 0x7352, 0x469A, 0x7357, 0x160E,
- 0x7358, 0x4C55, 0x7363, 0x094D, 0x7366, 0x424D, 0x7367, 0x4C56,
- 0x7368, 0x1610, 0x736A, 0x160F, 0x736B, 0x469C, 0x736C, 0x39C5,
- 0x736E, 0x469E, 0x736F, 0x469F, 0x7370, 0x1611, 0x7371, 0x46A0,
- 0x7372, 0x05AB, 0x7375, 0x1613, 0x7377, 0x2165, 0x7378, 0x1612,
- 0x737A, 0x1615, 0x737B, 0x1614, 0x737C, 0x39C6, 0x7381, 0x46A1,
- 0x7383, 0x39C7, 0x7384, 0x0770, 0x7385, 0x39C8, 0x7386, 0x39C9,
- 0x7387, 0x0F70, 0x7389, 0x06C4, 0x738A, 0x46A2, 0x738B, 0x0526,
- 0x7394, 0x46A3, 0x7395, 0x39CA, 0x7396, 0x06E2, 0x7398, 0x46A4,
- 0x739C, 0x46A5, 0x739E, 0x39CB, 0x739F, 0x39CC, 0x73A0, 0x39CD,
- 0x73A2, 0x424E, 0x73A5, 0x46A6, 0x73A6, 0x39CE, 0x73A8, 0x3C3F,
- 0x73A9, 0x061D, 0x73AB, 0x39CF, 0x73B2, 0x0FB0, 0x73B3, 0x1617,
- 0x73B5, 0x39D0, 0x73B7, 0x39D1, 0x73B9, 0x46A7, 0x73BA, 0x35EA,
- 0x73BB, 0x1619, 0x73BC, 0x39D2, 0x73BD, 0x2166, 0x73BF, 0x46A8,
- 0x73C0, 0x161A, 0x73C2, 0x0551, 0x73C5, 0x46A9, 0x73C8, 0x1616,
- 0x73C9, 0x2167, 0x73CA, 0x0887, 0x73CB, 0x46AA, 0x73CD, 0x0BDD,
- 0x73CE, 0x1618, 0x73CF, 0x39D3, 0x73D2, 0x216A, 0x73D6, 0x2168,
- 0x73D9, 0x39D4, 0x73DE, 0x161D, 0x73E0, 0x091A, 0x73E1, 0x46AB,
- 0x73E3, 0x2169, 0x73E4, 0x3C39, 0x73E5, 0x161B, 0x73E7, 0x46AC,
- 0x73E9, 0x39D5, 0x73EA, 0x0714, 0x73ED, 0x0D5D, 0x73EE, 0x161C,
- 0x73F1, 0x1637, 0x73F4, 0x39D6, 0x73F5, 0x216C, 0x73F8, 0x1622,
- 0x73F9, 0x46AD, 0x73FA, 0x46AF, 0x73FD, 0x39D7, 0x73FE, 0x0771,
- 0x7401, 0x46B0, 0x7403, 0x067F, 0x7404, 0x39D8, 0x7405, 0x161F,
- 0x7406, 0x0F67, 0x7407, 0x216B, 0x7409, 0x0F78, 0x740A, 0x39D9,
- 0x7413, 0x46AE, 0x741A, 0x39DA, 0x741B, 0x39DB, 0x7421, 0x3C3A,
- 0x7422, 0x0B56, 0x7424, 0x39DC, 0x7425, 0x1621, 0x7426, 0x216D,
- 0x7428, 0x39DD, 0x7429, 0x216F, 0x742A, 0x216E, 0x742B, 0x424F,
- 0x742C, 0x39DE, 0x742E, 0x2170, 0x742F, 0x39DF, 0x7430, 0x39E0,
- 0x7431, 0x39E1, 0x7432, 0x1623, 0x7433, 0x0F9E, 0x7434, 0x06CF,
- 0x7435, 0x0D90, 0x7436, 0x0D00, 0x7439, 0x39E2, 0x743A, 0x1624,
- 0x743F, 0x1626, 0x7440, 0x46B2, 0x7441, 0x1629, 0x7443, 0x46B3,
- 0x7444, 0x39E3, 0x7446, 0x4250, 0x7447, 0x39E4, 0x744B, 0x39E5,
- 0x744D, 0x39E6, 0x7451, 0x39E7, 0x7452, 0x46B4, 0x7453, 0x46B1,
- 0x7455, 0x1625, 0x7457, 0x39E8, 0x7459, 0x1628, 0x745A, 0x079E,
- 0x745B, 0x04EF, 0x745C, 0x162A, 0x745D, 0x46B5, 0x745E, 0x0A36,
- 0x745F, 0x1627, 0x7460, 0x0FA4, 0x7462, 0x4251, 0x7463, 0x162D,
- 0x7464, 0x1D35, 0x7466, 0x39E9, 0x7469, 0x162B, 0x746A, 0x162E,
- 0x746B, 0x39EA, 0x746D, 0x4252, 0x746F, 0x1620, 0x7470, 0x162C,
- 0x7471, 0x39EB, 0x7472, 0x4C57, 0x7473, 0x082C, 0x7476, 0x162F,
- 0x747E, 0x1630, 0x7480, 0x39EC, 0x7481, 0x46B6, 0x7483, 0x0F68,
- 0x7485, 0x39ED, 0x7486, 0x39EE, 0x7487, 0x39EF, 0x7488, 0x46B7,
- 0x7489, 0x2172, 0x748B, 0x1631, 0x7490, 0x39F0, 0x7492, 0x46B9,
- 0x7497, 0x46BA, 0x7498, 0x39F1, 0x7499, 0x46BB, 0x749C, 0x39F2,
- 0x749E, 0x1632, 0x749F, 0x2173, 0x74A0, 0x39F3, 0x74A1, 0x46BC,
- 0x74A2, 0x161E, 0x74A3, 0x39F4, 0x74A5, 0x46BD, 0x74A6, 0x4253,
- 0x74A7, 0x1633, 0x74A8, 0x39F5, 0x74A9, 0x4254, 0x74AA, 0x46BE,
- 0x74AB, 0x39F6, 0x74AF, 0x4C58, 0x74B0, 0x0600, 0x74B5, 0x39F7,
- 0x74B9, 0x46BF, 0x74BA, 0x46C1, 0x74BB, 0x46C0, 0x74BD, 0x08D1,
- 0x74BF, 0x39F8, 0x74C8, 0x39F9, 0x74C9, 0x4255, 0x74CA, 0x1634,
- 0x74CF, 0x1635, 0x74D4, 0x1636, 0x74D6, 0x46C2, 0x74D8, 0x46C3,
- 0x74DA, 0x39FA, 0x74DC, 0x04DD, 0x74DE, 0x39FB, 0x74DF, 0x4C59,
- 0x74E0, 0x1638, 0x74E2, 0x0DAD, 0x74E3, 0x1639, 0x74E4, 0x4C5A,
- 0x74E6, 0x05E0, 0x74E7, 0x163A, 0x74E9, 0x163B, 0x74EB, 0x46C4,
- 0x74EE, 0x163C, 0x74EF, 0x3750, 0x74F0, 0x163E, 0x74F1, 0x163F,
- 0x74F2, 0x163D, 0x74F4, 0x4C5B, 0x74F6, 0x0DC5, 0x74F7, 0x1641,
- 0x74F8, 0x1640, 0x74FA, 0x46C6, 0x74FB, 0x4C5C, 0x74FF, 0x4256,
- 0x7501, 0x2174, 0x7503, 0x1643, 0x7504, 0x1642, 0x7505, 0x1644,
- 0x750C, 0x1645, 0x750D, 0x1647, 0x750E, 0x1646, 0x7511, 0x080B,
- 0x7513, 0x1649, 0x7515, 0x1648, 0x7516, 0x4C5D, 0x7517, 0x4257,
- 0x7518, 0x0601, 0x751A, 0x0A19, 0x751C, 0x0C36, 0x751E, 0x164A,
- 0x751F, 0x0A5C, 0x7520, 0x46C8, 0x7521, 0x4C5E, 0x7522, 0x35DE,
- 0x7523, 0x0888, 0x7524, 0x46C9, 0x7525, 0x051B, 0x7526, 0x164B,
- 0x7528, 0x0F3B, 0x752A, 0x46CA, 0x752B, 0x0E33, 0x752C, 0x164C,
- 0x752F, 0x20F2, 0x7530, 0x0C3E, 0x7531, 0x0F1D, 0x7532, 0x07D5,
- 0x7533, 0x0A03, 0x7537, 0x0B89, 0x7538, 0x10C9, 0x753A, 0x0BCA,
- 0x753B, 0x0568, 0x753C, 0x164D, 0x753D, 0x46CD, 0x753E, 0x46CE,
- 0x753F, 0x4C5F, 0x7540, 0x46CF, 0x7544, 0x164E, 0x7546, 0x1653,
- 0x7548, 0x46D0, 0x7549, 0x1651, 0x754A, 0x1650, 0x754B, 0x13C7,
- 0x754C, 0x0584, 0x754D, 0x164F, 0x754E, 0x39FC, 0x754F, 0x049E,
- 0x7550, 0x46D1, 0x7551, 0x0D3E, 0x7552, 0x46D2, 0x7554, 0x0D5E,
- 0x7559, 0x0F79, 0x755A, 0x1654, 0x755B, 0x1652, 0x755C, 0x0B9A,
- 0x755D, 0x0A4A, 0x755E, 0x4C60, 0x7560, 0x0D3F, 0x7562, 0x0D9F,
- 0x7564, 0x1656, 0x7565, 0x0F74, 0x7566, 0x0723, 0x7567, 0x1657,
- 0x7569, 0x1655, 0x756A, 0x0D6A, 0x756B, 0x1658, 0x756C, 0x3C3B,
- 0x756D, 0x1659, 0x756F, 0x2175, 0x7570, 0x049F, 0x7571, 0x46D4,
- 0x7572, 0x46D3, 0x7573, 0x09DE, 0x7574, 0x165E, 0x7575, 0x3751,
- 0x7576, 0x165B, 0x7577, 0x0CC5, 0x7578, 0x165A, 0x7579, 0x39FD,
- 0x757A, 0x46D5, 0x757D, 0x46D6, 0x757E, 0x46D7, 0x757F, 0x0640,
- 0x7581, 0x39FE, 0x7582, 0x1661, 0x7586, 0x165C, 0x7587, 0x165D,
- 0x7589, 0x1660, 0x758A, 0x165F, 0x758B, 0x0D97, 0x758C, 0x46D8,
- 0x758E, 0x0AC4, 0x758F, 0x0AC3, 0x7590, 0x39FF, 0x7591, 0x0659,
- 0x7592, 0x3A00, 0x7593, 0x3A01, 0x7594, 0x1662, 0x7599, 0x4C61,
- 0x759A, 0x1663, 0x759D, 0x1664, 0x75A2, 0x46DA, 0x75A3, 0x1666,
- 0x75A4, 0x4C62, 0x75A5, 0x1665, 0x75AB, 0x04F8, 0x75B0, 0x46DC,
- 0x75B1, 0x166E, 0x75B2, 0x0D7C, 0x75B3, 0x1668, 0x75B4, 0x3A02,
- 0x75B5, 0x166A, 0x75B7, 0x46DD, 0x75B8, 0x166C, 0x75B9, 0x0A04,
- 0x75BC, 0x166D, 0x75BD, 0x166B, 0x75BE, 0x08EC, 0x75BF, 0x46DE,
- 0x75C0, 0x46DF, 0x75C1, 0x4C63, 0x75C2, 0x1667, 0x75C3, 0x1669,
- 0x75C4, 0x4C64, 0x75C5, 0x0DB4, 0x75C6, 0x46E0, 0x75C7, 0x09B1,
- 0x75CA, 0x1670, 0x75CC, 0x4C65, 0x75CD, 0x166F, 0x75CE, 0x4259,
- 0x75CF, 0x46E1, 0x75D2, 0x1671, 0x75D3, 0x46E2, 0x75D4, 0x08D2,
- 0x75D5, 0x081F, 0x75D7, 0x4C66, 0x75D8, 0x0C71, 0x75D9, 0x1672,
- 0x75DB, 0x0BE7, 0x75DC, 0x4C67, 0x75DD, 0x46E3, 0x75DE, 0x1674,
- 0x75DF, 0x46E4, 0x75E0, 0x46E5, 0x75E1, 0x4C68, 0x75E2, 0x0F69,
- 0x75E3, 0x1673, 0x75E4, 0x3A03, 0x75E7, 0x46E6, 0x75E9, 0x0AEB,
- 0x75EC, 0x3752, 0x75EE, 0x46E7, 0x75EF, 0x4C69, 0x75F0, 0x1679,
- 0x75F1, 0x46E8, 0x75F2, 0x167B, 0x75F3, 0x167C, 0x75F4, 0x0B92,
- 0x75F9, 0x3A04, 0x75FA, 0x167A, 0x75FC, 0x1677, 0x75FE, 0x1675,
- 0x75FF, 0x1676, 0x7600, 0x3A05, 0x7601, 0x1678, 0x7602, 0x425A,
- 0x7603, 0x46E9, 0x7604, 0x4C6A, 0x7607, 0x46EB, 0x7608, 0x425B,
- 0x7609, 0x167F, 0x760A, 0x3A06, 0x760B, 0x167D, 0x760C, 0x4C6B,
- 0x760D, 0x167E, 0x760F, 0x46EC, 0x7613, 0x46EF, 0x7615, 0x3A07,
- 0x7616, 0x3A08, 0x7618, 0x46EA, 0x7619, 0x3A09, 0x761B, 0x46F0,
- 0x761C, 0x46F1, 0x761D, 0x4C6C, 0x761E, 0x3A0A, 0x761F, 0x1680,
- 0x7620, 0x1682, 0x7621, 0x1683, 0x7622, 0x1684, 0x7624, 0x1685,
- 0x7625, 0x46F3, 0x7626, 0x3645, 0x7627, 0x1681, 0x7628, 0x46F4,
- 0x762D, 0x3A0B, 0x7630, 0x1687, 0x7632, 0x4C6D, 0x7633, 0x46F6,
- 0x7634, 0x1686, 0x7635, 0x3A0C, 0x7638, 0x4C6E, 0x763B, 0x1688,
- 0x763C, 0x46F5, 0x7641, 0x46F9, 0x7642, 0x0F8D, 0x7643, 0x3A0D,
- 0x7645, 0x4C6F, 0x7646, 0x168B, 0x7647, 0x1689, 0x7648, 0x168A,
- 0x7649, 0x46FB, 0x764A, 0x4C70, 0x764B, 0x3A0E, 0x764C, 0x061E,
- 0x764E, 0x3753, 0x7652, 0x0F0A, 0x7655, 0x46FC, 0x7656, 0x0E1A,
- 0x7658, 0x168D, 0x765C, 0x168C, 0x765F, 0x4C71, 0x7661, 0x168E,
- 0x7662, 0x168F, 0x7664, 0x425C, 0x7665, 0x3A0F, 0x7667, 0x1693,
- 0x7668, 0x1690, 0x7669, 0x1691, 0x766A, 0x1692, 0x766C, 0x1694,
- 0x766D, 0x3A10, 0x766E, 0x46FE, 0x766F, 0x3A11, 0x7670, 0x1695,
- 0x7671, 0x3A12, 0x7672, 0x1696, 0x7674, 0x3A13, 0x7676, 0x1697,
- 0x7678, 0x1698, 0x767A, 0x0D43, 0x767B, 0x0C4A, 0x767C, 0x1699,
- 0x767D, 0x0D28, 0x767E, 0x0DA6, 0x7680, 0x169A, 0x7681, 0x425D,
- 0x7682, 0x2176, 0x7683, 0x169B, 0x7684, 0x0C24, 0x7686, 0x0585,
- 0x7687, 0x07D6, 0x7688, 0x169C, 0x768B, 0x169D, 0x768E, 0x169E,
- 0x7690, 0x0877, 0x7693, 0x16A0, 0x7695, 0x46FF, 0x7696, 0x169F,
- 0x7699, 0x16A1, 0x769A, 0x16A2, 0x769B, 0x2179, 0x769C, 0x2177,
- 0x769D, 0x425E, 0x769E, 0x2178, 0x76A0, 0x4701, 0x76A1, 0x4700,
- 0x76A4, 0x3A14, 0x76A5, 0x3A15, 0x76A6, 0x217A, 0x76A7, 0x4702,
- 0x76A8, 0x4703, 0x76AA, 0x425F, 0x76AD, 0x4C72, 0x76AE, 0x0D7D,
- 0x76AF, 0x4704, 0x76B0, 0x16A3, 0x76B4, 0x16A4, 0x76B6, 0x4260,
- 0x76B7, 0x1D1C, 0x76B8, 0x16A5, 0x76B9, 0x16A6, 0x76BA, 0x16A7,
- 0x76BD, 0x4C73, 0x76BF, 0x087C, 0x76C2, 0x16A8, 0x76C3, 0x0D0C,
- 0x76C5, 0x3A16, 0x76C6, 0x0E8D, 0x76C8, 0x04F0, 0x76C9, 0x4706,
- 0x76CA, 0x04F9, 0x76CC, 0x3A17, 0x76CD, 0x16A9, 0x76CE, 0x4261,
- 0x76D2, 0x16AB, 0x76D4, 0x4262, 0x76D6, 0x16AA, 0x76D7, 0x0C6A,
- 0x76D9, 0x4C74, 0x76DB, 0x0A5D, 0x76DC, 0x14D8, 0x76DE, 0x16AC,
- 0x76DF, 0x0ECD, 0x76E1, 0x16AD, 0x76E3, 0x0602, 0x76E4, 0x0D6B,
- 0x76E5, 0x16AE, 0x76E6, 0x4263, 0x76E7, 0x16AF, 0x76E8, 0x4708,
- 0x76EA, 0x16B0, 0x76EB, 0x4C75, 0x76EC, 0x3A18, 0x76EE, 0x0EE8,
- 0x76F0, 0x4C76, 0x76F1, 0x4264, 0x76F2, 0x0EE1, 0x76F4, 0x0BDA,
- 0x76F8, 0x0AEC, 0x76F9, 0x4C77, 0x76FB, 0x16B2, 0x76FC, 0x3A19,
- 0x76FE, 0x096C, 0x7700, 0x4C78, 0x7701, 0x09B2, 0x7704, 0x16B5,
- 0x7707, 0x16B4, 0x7708, 0x16B3, 0x7709, 0x0D91, 0x770A, 0x4265,
- 0x770B, 0x0603, 0x770C, 0x075D, 0x770E, 0x4C79, 0x7717, 0x470A,
- 0x7719, 0x4266, 0x771A, 0x470B, 0x771B, 0x16BB, 0x771E, 0x16B8,
- 0x771F, 0x0A05, 0x7720, 0x0EBE, 0x7722, 0x4C7A, 0x7724, 0x16B7,
- 0x7725, 0x16B9, 0x7726, 0x16BA, 0x7728, 0x4C7B, 0x7729, 0x16B6,
- 0x772D, 0x470C, 0x772F, 0x4C7C, 0x7734, 0x3A1A, 0x7735, 0x470D,
- 0x7736, 0x3A1B, 0x7737, 0x16BC, 0x7738, 0x16BD, 0x7739, 0x4C7D,
- 0x773A, 0x0BCB, 0x773C, 0x061F, 0x773E, 0x4C7E, 0x7740, 0x0BA3,
- 0x7745, 0x4C7F, 0x7746, 0x217C, 0x7747, 0x16BE, 0x774A, 0x4C80,
- 0x774D, 0x4267, 0x774E, 0x4268, 0x774F, 0x4C81, 0x7758, 0x4712,
- 0x775A, 0x16BF, 0x775B, 0x16C2, 0x775C, 0x3A1C, 0x775E, 0x4C82,
- 0x775F, 0x3A1D, 0x7760, 0x3A1E, 0x7761, 0x0A2D, 0x7762, 0x1EC5,
- 0x7763, 0x0C9C, 0x7764, 0x4C83, 0x7765, 0x16C3, 0x7766, 0x0E81,
- 0x7767, 0x4C84, 0x7768, 0x16C0, 0x776A, 0x3755, 0x776B, 0x16C1,
- 0x776C, 0x4C85, 0x7772, 0x3A1F, 0x7779, 0x16C6, 0x777A, 0x4269,
- 0x777C, 0x4714, 0x777D, 0x3A20, 0x777E, 0x16C5, 0x777F, 0x16C4,
- 0x7780, 0x426A, 0x7784, 0x4C86, 0x778B, 0x16C8, 0x778C, 0x4C87,
- 0x778D, 0x4C88, 0x778E, 0x16C7, 0x7791, 0x16C9, 0x7794, 0x426B,
- 0x7795, 0x3A21, 0x7796, 0x4C89, 0x779A, 0x4717, 0x779E, 0x16CB,
- 0x779F, 0x4718, 0x77A0, 0x16CA, 0x77A2, 0x4719, 0x77A4, 0x471A,
- 0x77A5, 0x0E1D, 0x77A7, 0x4C8A, 0x77A9, 0x3756, 0x77AA, 0x3A22,
- 0x77AC, 0x0960, 0x77AD, 0x0F8E, 0x77AF, 0x4C8B, 0x77B0, 0x16CC,
- 0x77B3, 0x0C8F, 0x77B6, 0x16CD, 0x77B7, 0x4C8C, 0x77B9, 0x16CE,
- 0x77BB, 0x16D2, 0x77BC, 0x16D0, 0x77BD, 0x16D1, 0x77BE, 0x4C8D,
- 0x77BF, 0x16CF, 0x77C7, 0x16D3, 0x77C9, 0x4C8E, 0x77CD, 0x16D4,
- 0x77D1, 0x4C8F, 0x77D7, 0x16D5, 0x77D9, 0x4C90, 0x77DA, 0x16D6,
- 0x77DB, 0x0EC3, 0x77DC, 0x16D7, 0x77DE, 0x471B, 0x77DF, 0x471C,
- 0x77E0, 0x426C, 0x77E2, 0x0EFC, 0x77E3, 0x16D8, 0x77E4, 0x471D,
- 0x77E5, 0x0B8C, 0x77E6, 0x3A23, 0x77E7, 0x0D20, 0x77E9, 0x06E3,
- 0x77EA, 0x471E, 0x77EC, 0x471F, 0x77ED, 0x0B79, 0x77EE, 0x16D9,
- 0x77EF, 0x06B2, 0x77F0, 0x3A24, 0x77F1, 0x4C91, 0x77F3, 0x0A74,
- 0x77F4, 0x3A25, 0x77FB, 0x4720, 0x77FC, 0x16DA, 0x7802, 0x082D,
- 0x7805, 0x4722, 0x7806, 0x3A26, 0x7809, 0x4723, 0x780C, 0x16DB,
- 0x780D, 0x4724, 0x7812, 0x16DC, 0x7814, 0x075A, 0x7815, 0x0845,
- 0x7819, 0x4725, 0x7820, 0x16DE, 0x7821, 0x217E, 0x7822, 0x3A27,
- 0x7825, 0x0C50, 0x7826, 0x0846, 0x7827, 0x0668, 0x782C, 0x4726,
- 0x782D, 0x3A28, 0x782E, 0x3A29, 0x7830, 0x3A2A, 0x7832, 0x0E52,
- 0x7834, 0x0D01, 0x7835, 0x3A2B, 0x7837, 0x4C92, 0x783A, 0x0C51,
- 0x783F, 0x07EE, 0x7843, 0x426E, 0x7845, 0x16E0, 0x7847, 0x4727,
- 0x784E, 0x217F, 0x784F, 0x341E, 0x7851, 0x3C3C, 0x785C, 0x4C93,
- 0x785D, 0x09B3, 0x7864, 0x2180, 0x7868, 0x3A2C, 0x786A, 0x4728,
- 0x786B, 0x0F7A, 0x786C, 0x07D7, 0x786E, 0x426F, 0x786F, 0x075B,
- 0x7872, 0x0D37, 0x7874, 0x16E2, 0x787A, 0x2181, 0x787C, 0x16E4,
- 0x787E, 0x4C94, 0x7881, 0x079F, 0x7886, 0x16E3, 0x7887, 0x0C12,
- 0x788A, 0x472A, 0x788C, 0x16E6, 0x788D, 0x0595, 0x788E, 0x16E1,
- 0x7891, 0x0D7E, 0x7893, 0x04D2, 0x7894, 0x472B, 0x7895, 0x085C,
- 0x7897, 0x0FF8, 0x7898, 0x4C95, 0x789A, 0x16E5, 0x789D, 0x472D,
- 0x789E, 0x3A2D, 0x789F, 0x472E, 0x78A1, 0x4C96, 0x78A3, 0x16E7,
- 0x78A4, 0x472C, 0x78A7, 0x0E1B, 0x78A9, 0x0A7D, 0x78AA, 0x16E9,
- 0x78AD, 0x4272, 0x78AF, 0x16EA, 0x78B0, 0x4270, 0x78B1, 0x4C97,
- 0x78B3, 0x4C98, 0x78B5, 0x16E8, 0x78BA, 0x05AC, 0x78BB, 0x472F,
- 0x78BC, 0x16F0, 0x78BE, 0x16EF, 0x78C1, 0x08D3, 0x78C5, 0x16F1,
- 0x78C6, 0x16EC, 0x78C8, 0x3A2E, 0x78C9, 0x4C99, 0x78CA, 0x16F2,
- 0x78CB, 0x16ED, 0x78CC, 0x3A2F, 0x78CE, 0x3A30, 0x78D0, 0x0D6C,
- 0x78D1, 0x16EB, 0x78D3, 0x4C9A, 0x78D4, 0x16EE, 0x78D5, 0x4730,
- 0x78DA, 0x16F5, 0x78E0, 0x3A32, 0x78E1, 0x3A33, 0x78E4, 0x3A31,
- 0x78E6, 0x4731, 0x78E7, 0x16F4, 0x78E8, 0x0E8F, 0x78EC, 0x16F3,
- 0x78EF, 0x04AF, 0x78F2, 0x3A34, 0x78F4, 0x16F7, 0x78F7, 0x3A35,
- 0x78F9, 0x4732, 0x78FA, 0x4733, 0x78FB, 0x3A36, 0x78FD, 0x16F6,
- 0x78FE, 0x4734, 0x7900, 0x4273, 0x7901, 0x09B4, 0x7907, 0x16F8,
- 0x790C, 0x4C9B, 0x790E, 0x0AC5, 0x7910, 0x4736, 0x7911, 0x16FA,
- 0x7912, 0x16F9, 0x7919, 0x16FB, 0x791B, 0x4737, 0x791C, 0x4274,
- 0x791F, 0x4C9C, 0x7925, 0x4738, 0x7926, 0x16DD, 0x7927, 0x4C9D,
- 0x7928, 0x4C9E, 0x792A, 0x16DF, 0x792B, 0x16FD, 0x792C, 0x16FC,
- 0x792E, 0x4275, 0x7930, 0x2182, 0x7931, 0x3A37, 0x7934, 0x4276,
- 0x793A, 0x08D4, 0x793B, 0x3A39, 0x793C, 0x0FB1, 0x793D, 0x3A3A,
- 0x793E, 0x08FE, 0x793F, 0x4C9F, 0x7940, 0x16FE, 0x7941, 0x070D,
- 0x7942, 0x4CA0, 0x7945, 0x3A3B, 0x7946, 0x4277, 0x7947, 0x065A,
- 0x7948, 0x0641, 0x7949, 0x08B1, 0x794A, 0x4739, 0x7950, 0x0F1E,
- 0x7953, 0x1704, 0x7954, 0x4CA1, 0x7955, 0x1703, 0x7956, 0x0AC6,
- 0x7957, 0x1700, 0x7958, 0x473A, 0x795A, 0x1702, 0x795B, 0x3A3C,
- 0x795C, 0x3A3D, 0x795D, 0x0955, 0x795E, 0x0A06, 0x795F, 0x1701,
- 0x7960, 0x16FF, 0x7962, 0x0CE0, 0x7965, 0x09B5, 0x7967, 0x473C,
- 0x7968, 0x0DAE, 0x796B, 0x4CA2, 0x796D, 0x0847, 0x7972, 0x473D,
- 0x7977, 0x0C72, 0x7979, 0x4278, 0x797A, 0x1705, 0x797C, 0x4CA3,
- 0x797F, 0x1706, 0x7980, 0x171C, 0x7981, 0x06D0, 0x7984, 0x0FE3,
- 0x7985, 0x0AB7, 0x798A, 0x1707, 0x798B, 0x3A3E, 0x798D, 0x0552,
- 0x798E, 0x0C13, 0x798F, 0x0DF1, 0x7994, 0x2186, 0x7995, 0x473E,
- 0x7996, 0x3A3F, 0x7998, 0x3A40, 0x799B, 0x2188, 0x799D, 0x1708,
- 0x79A1, 0x473F, 0x79A6, 0x0694, 0x79A7, 0x1709, 0x79A9, 0x4740,
- 0x79AA, 0x170B, 0x79AB, 0x4CA4, 0x79AE, 0x170C, 0x79B0, 0x0CDF,
- 0x79B1, 0x1E4E, 0x79B3, 0x170D, 0x79B4, 0x4741, 0x79B8, 0x3A41,
- 0x79B9, 0x170E, 0x79BA, 0x170F, 0x79BB, 0x3A42, 0x79BD, 0x06D1,
- 0x79BE, 0x0553, 0x79BF, 0x0C9D, 0x79C0, 0x0932, 0x79C1, 0x08B2,
- 0x79C2, 0x4742, 0x79C4, 0x4CA5, 0x79C7, 0x4743, 0x79C8, 0x4279,
- 0x79C9, 0x1710, 0x79CA, 0x3A43, 0x79CB, 0x0933, 0x79CC, 0x4744,
- 0x79CD, 0x4745, 0x79D1, 0x054A, 0x79D2, 0x0DB5, 0x79D4, 0x427B,
- 0x79D5, 0x1711, 0x79D6, 0x4746, 0x79D8, 0x0D7F, 0x79DA, 0x3A44,
- 0x79DE, 0x427C, 0x79DF, 0x0AC7, 0x79E1, 0x1714, 0x79E3, 0x1715,
- 0x79E4, 0x0D1F, 0x79E6, 0x0A07, 0x79E7, 0x1712, 0x79E9, 0x0B9F,
- 0x79EA, 0x4CA6, 0x79EB, 0x427D, 0x79EC, 0x1713, 0x79ED, 0x427E,
- 0x79F0, 0x09B6, 0x79FB, 0x04A0, 0x7A00, 0x0643, 0x7A02, 0x4CA7,
- 0x7A03, 0x3A45, 0x7A05, 0x3633, 0x7A08, 0x1716, 0x7A09, 0x3A46,
- 0x7A0A, 0x474B, 0x7A0B, 0x0C14, 0x7A0C, 0x4CA8, 0x7A0D, 0x1717,
- 0x7A0E, 0x0A6B, 0x7A11, 0x3A47, 0x7A14, 0x0EB9, 0x7A15, 0x474C,
- 0x7A17, 0x0D95, 0x7A18, 0x1718, 0x7A19, 0x1719, 0x7A1A, 0x0B93,
- 0x7A1B, 0x474D, 0x7A1C, 0x0F8F, 0x7A1E, 0x3A48, 0x7A1F, 0x171B,
- 0x7A20, 0x171A, 0x7A2D, 0x3A49, 0x7A2E, 0x091B, 0x7A30, 0x4CA9,
- 0x7A31, 0x171D, 0x7A32, 0x04B4, 0x7A37, 0x1720, 0x7A38, 0x474F,
- 0x7A39, 0x3A4A, 0x7A3A, 0x4CAA, 0x7A3B, 0x171E, 0x7A3C, 0x0554,
- 0x7A3D, 0x0724, 0x7A3E, 0x171F, 0x7A3F, 0x07D8, 0x7A40, 0x0804,
- 0x7A42, 0x0E36, 0x7A43, 0x1721, 0x7A44, 0x4CAB, 0x7A45, 0x3A4B,
- 0x7A46, 0x0E82, 0x7A47, 0x4750, 0x7A49, 0x1723, 0x7A4C, 0x3A4C,
- 0x7A4D, 0x0A75, 0x7A4E, 0x04F1, 0x7A4F, 0x053A, 0x7A50, 0x0470,
- 0x7A56, 0x4751, 0x7A57, 0x1722, 0x7A59, 0x4752, 0x7A5C, 0x4753,
- 0x7A5D, 0x3A4D, 0x7A5F, 0x4754, 0x7A60, 0x4F56, 0x7A61, 0x1724,
- 0x7A62, 0x1725, 0x7A63, 0x09DF, 0x7A67, 0x4755, 0x7A69, 0x1726,
- 0x7A6A, 0x4756, 0x7A6B, 0x05AD, 0x7A6D, 0x3A4F, 0x7A70, 0x1728,
- 0x7A74, 0x0740, 0x7A75, 0x4757, 0x7A76, 0x0680, 0x7A78, 0x3A50,
- 0x7A79, 0x1729, 0x7A7A, 0x06ED, 0x7A7D, 0x172A, 0x7A7F, 0x0AA0,
- 0x7A80, 0x4CAC, 0x7A81, 0x0CA5, 0x7A82, 0x4758, 0x7A83, 0x0A84,
- 0x7A84, 0x0865, 0x7A85, 0x427F, 0x7A86, 0x4CAD, 0x7A88, 0x172B,
- 0x7A8A, 0x4759, 0x7A90, 0x475A, 0x7A92, 0x0BA0, 0x7A93, 0x0AED,
- 0x7A94, 0x4CAE, 0x7A95, 0x172D, 0x7A96, 0x172F, 0x7A97, 0x172C,
- 0x7A98, 0x172E, 0x7A9F, 0x06F8, 0x7AA0, 0x3A51, 0x7AA3, 0x3A52,
- 0x7AA9, 0x1730, 0x7AAA, 0x06FC, 0x7AAC, 0x475B, 0x7AAE, 0x0681,
- 0x7AAF, 0x0F3C, 0x7AB0, 0x1732, 0x7AB3, 0x3A53, 0x7AB5, 0x4CAF,
- 0x7AB6, 0x1733, 0x7AB9, 0x475E, 0x7ABA, 0x04D0, 0x7ABB, 0x3A54,
- 0x7ABC, 0x3A55, 0x7ABD, 0x4CB0, 0x7ABE, 0x475F, 0x7ABF, 0x1736,
- 0x7AC3, 0x05D4, 0x7AC4, 0x1735, 0x7AC5, 0x1734, 0x7AC6, 0x3A56,
- 0x7AC7, 0x1738, 0x7AC8, 0x1731, 0x7ACA, 0x1739, 0x7ACB, 0x0F71,
- 0x7ACC, 0x4761, 0x7ACD, 0x173A, 0x7ACE, 0x4281, 0x7ACF, 0x173B,
- 0x7AD1, 0x2189, 0x7AD2, 0x11C5, 0x7AD3, 0x173D, 0x7AD5, 0x173C,
- 0x7AD9, 0x173E, 0x7ADA, 0x173F, 0x7ADC, 0x0F7D, 0x7ADD, 0x1740,
- 0x7ADF, 0x1C08, 0x7AE0, 0x09B7, 0x7AE1, 0x1741, 0x7AE2, 0x1742,
- 0x7AE3, 0x0961, 0x7AE5, 0x0C90, 0x7AE6, 0x1743, 0x7AE7, 0x218A,
- 0x7AE8, 0x4762, 0x7AEA, 0x0B66, 0x7AEB, 0x218C, 0x7AED, 0x1744,
- 0x7AEF, 0x0B7A, 0x7AF0, 0x1745, 0x7AF4, 0x4763, 0x7AF6, 0x069D,
- 0x7AF8, 0x1076, 0x7AF9, 0x0B9B, 0x7AFA, 0x08DF, 0x7AFD, 0x4282,
- 0x7AFE, 0x4CB1, 0x7AFF, 0x0604, 0x7B02, 0x1746, 0x7B04, 0x1753,
- 0x7B06, 0x1749, 0x7B07, 0x3A57, 0x7B08, 0x0682, 0x7B0A, 0x1748,
- 0x7B0B, 0x1755, 0x7B0F, 0x1747, 0x7B11, 0x09B8, 0x7B12, 0x4283,
- 0x7B14, 0x3A58, 0x7B18, 0x174B, 0x7B19, 0x174C, 0x7B1B, 0x0C25,
- 0x7B1E, 0x174D, 0x7B20, 0x05BC, 0x7B25, 0x0A20, 0x7B26, 0x0DD6,
- 0x7B27, 0x3A59, 0x7B28, 0x174F, 0x7B2A, 0x4768, 0x7B2B, 0x4CB2,
- 0x7B2C, 0x0B48, 0x7B2D, 0x4284, 0x7B2E, 0x4769, 0x7B2F, 0x476A,
- 0x7B31, 0x3A5A, 0x7B33, 0x174A, 0x7B35, 0x174E, 0x7B36, 0x1750,
- 0x7B39, 0x086B, 0x7B3B, 0x4285, 0x7B3D, 0x4767, 0x7B41, 0x476E,
- 0x7B45, 0x1757, 0x7B46, 0x0DA0, 0x7B47, 0x3A5B, 0x7B48, 0x0D3A,
- 0x7B49, 0x0C73, 0x7B4B, 0x06D2, 0x7B4C, 0x1756, 0x7B4D, 0x1754,
- 0x7B4E, 0x3A5C, 0x7B4F, 0x0D49, 0x7B50, 0x1751, 0x7B51, 0x0B9C,
- 0x7B52, 0x0C75, 0x7B53, 0x375D, 0x7B54, 0x0C74, 0x7B55, 0x4770,
- 0x7B56, 0x0866, 0x7B5D, 0x1769, 0x7B60, 0x3A5D, 0x7B64, 0x4772,
- 0x7B65, 0x1759, 0x7B66, 0x4773, 0x7B67, 0x175B, 0x7B69, 0x3A5E,
- 0x7B6C, 0x175E, 0x7B6D, 0x3A5F, 0x7B6E, 0x175F, 0x7B6F, 0x4286,
- 0x7B70, 0x175C, 0x7B71, 0x175D, 0x7B72, 0x3A60, 0x7B73, 0x4774,
- 0x7B74, 0x175A, 0x7B75, 0x1758, 0x7B77, 0x4CB3, 0x7B79, 0x4771,
- 0x7B7A, 0x1752, 0x7B7F, 0x476D, 0x7B86, 0x0E1F, 0x7B87, 0x0555,
- 0x7B8B, 0x1766, 0x7B8D, 0x1763, 0x7B8F, 0x1768, 0x7B90, 0x4777,
- 0x7B91, 0x3A61, 0x7B92, 0x1767, 0x7B94, 0x0D29, 0x7B95, 0x0EB3,
- 0x7B97, 0x0889, 0x7B98, 0x1761, 0x7B99, 0x176A, 0x7B9A, 0x1765,
- 0x7B9B, 0x4778, 0x7B9C, 0x1764, 0x7B9D, 0x1760, 0x7B9E, 0x218D,
- 0x7B9F, 0x1762, 0x7BA0, 0x4CB4, 0x7BA1, 0x0605, 0x7BAA, 0x0B7B,
- 0x7BAC, 0x4CB5, 0x7BAD, 0x0AA1, 0x7BAF, 0x3A62, 0x7BB0, 0x4CB6,
- 0x7BB1, 0x0D36, 0x7BB4, 0x176F, 0x7BB5, 0x477A, 0x7BB8, 0x0D38,
- 0x7BBC, 0x477B, 0x7BC0, 0x0A85, 0x7BC1, 0x176C, 0x7BC4, 0x0D63,
- 0x7BC5, 0x477C, 0x7BC6, 0x1770, 0x7BC7, 0x0E23, 0x7BC9, 0x0B99,
- 0x7BCA, 0x477D, 0x7BCB, 0x176B, 0x7BCC, 0x176D, 0x7BCF, 0x176E,
- 0x7BD4, 0x4780, 0x7BD6, 0x4781, 0x7BD7, 0x3A63, 0x7BD9, 0x3A64,
- 0x7BDA, 0x4782, 0x7BDD, 0x1771, 0x7BE0, 0x08F0, 0x7BE4, 0x0C9E,
- 0x7BE5, 0x1776, 0x7BE6, 0x1775, 0x7BE8, 0x4CB7, 0x7BE9, 0x1772,
- 0x7BEA, 0x4783, 0x7BED, 0x0FDC, 0x7BF0, 0x4784, 0x7BF2, 0x4CB8,
- 0x7BF3, 0x177B, 0x7BF6, 0x177F, 0x7BF7, 0x177C, 0x7BF8, 0x4CB9,
- 0x7BFC, 0x4CBA, 0x7BFE, 0x4CBB, 0x7C00, 0x1778, 0x7C01, 0x4287,
- 0x7C03, 0x4785, 0x7C07, 0x1779, 0x7C09, 0x4CBC, 0x7C0B, 0x3A65,
- 0x7C0D, 0x177E, 0x7C0E, 0x4786, 0x7C0F, 0x3A66, 0x7C11, 0x1773,
- 0x7C12, 0x10EA, 0x7C13, 0x177A, 0x7C14, 0x1774, 0x7C17, 0x177D,
- 0x7C1E, 0x1E3B, 0x7C1F, 0x1783, 0x7C20, 0x3A67, 0x7C21, 0x0606,
- 0x7C23, 0x1780, 0x7C26, 0x3A68, 0x7C27, 0x1781, 0x7C28, 0x4CBD,
- 0x7C2A, 0x1782, 0x7C2B, 0x1785, 0x7C2F, 0x4CBE, 0x7C31, 0x3A69,
- 0x7C33, 0x4288, 0x7C36, 0x3A6A, 0x7C37, 0x1784, 0x7C38, 0x0D8A,
- 0x7C3D, 0x1786, 0x7C3E, 0x0FC4, 0x7C3F, 0x0E3D, 0x7C40, 0x178B,
- 0x7C42, 0x4CBF, 0x7C43, 0x1788, 0x7C45, 0x4787, 0x7C4A, 0x4788,
- 0x7C4C, 0x1787, 0x7C4D, 0x0A76, 0x7C4F, 0x178A, 0x7C50, 0x178C,
- 0x7C51, 0x3A6B, 0x7C52, 0x4CC0, 0x7C53, 0x4CC1, 0x7C54, 0x1789,
- 0x7C56, 0x1790, 0x7C57, 0x4789, 0x7C58, 0x178D, 0x7C59, 0x3A6C,
- 0x7C5B, 0x4CC2, 0x7C5C, 0x4CC3, 0x7C5D, 0x4CC4, 0x7C5E, 0x478A,
- 0x7C5F, 0x178E, 0x7C60, 0x1777, 0x7C61, 0x478B, 0x7C64, 0x178F,
- 0x7C65, 0x1791, 0x7C67, 0x3A6D, 0x7C69, 0x478C, 0x7C6C, 0x1792,
- 0x7C6D, 0x428A, 0x7C6E, 0x3A6E, 0x7C6F, 0x478D, 0x7C70, 0x3A6F,
- 0x7C72, 0x4CC5, 0x7C73, 0x0E16, 0x7C75, 0x1793, 0x7C79, 0x428B,
- 0x7C7B, 0x370E, 0x7C7D, 0x4CC6, 0x7C7E, 0x0EEE, 0x7C81, 0x06C6,
- 0x7C82, 0x06FF, 0x7C83, 0x1794, 0x7C87, 0x4CC7, 0x7C89, 0x0E04,
- 0x7C8B, 0x0A2E, 0x7C8D, 0x0EBC, 0x7C8F, 0x428C, 0x7C90, 0x1795,
- 0x7C92, 0x0F7B, 0x7C94, 0x428D, 0x7C95, 0x0D2A, 0x7C97, 0x0AC8,
- 0x7C98, 0x0CEA, 0x7C9B, 0x0957, 0x7C9E, 0x4CC8, 0x7C9F, 0x0484,
- 0x7CA0, 0x428E, 0x7CA1, 0x179A, 0x7CA2, 0x1798, 0x7CA4, 0x1796,
- 0x7CA5, 0x05DD, 0x7CA6, 0x4791, 0x7CA7, 0x09B9, 0x7CA8, 0x179B,
- 0x7CAB, 0x1799, 0x7CAD, 0x1797, 0x7CAE, 0x179F, 0x7CB1, 0x179E,
- 0x7CB2, 0x179D, 0x7CB3, 0x179C, 0x7CB6, 0x4793, 0x7CB7, 0x4794,
- 0x7CB9, 0x17A0, 0x7CBA, 0x4CC9, 0x7CBC, 0x3A70, 0x7CBD, 0x17A1,
- 0x7CBE, 0x0A5E, 0x7CBF, 0x3A71, 0x7CC0, 0x17A2, 0x7CC2, 0x17A4,
- 0x7CC4, 0x4796, 0x7CC5, 0x17A3, 0x7CC7, 0x4CCA, 0x7CC8, 0x3A72,
- 0x7CC9, 0x3A73, 0x7CCA, 0x0786, 0x7CCD, 0x4798, 0x7CCE, 0x0ABA,
- 0x7CD2, 0x17A6, 0x7CD3, 0x4CCB, 0x7CD5, 0x428F, 0x7CD6, 0x0C76,
- 0x7CD7, 0x3A74, 0x7CD8, 0x17A5, 0x7CD9, 0x3A75, 0x7CDA, 0x4CCC,
- 0x7CDC, 0x17A7, 0x7CDD, 0x3A76, 0x7CDE, 0x0E05, 0x7CDF, 0x0AEE,
- 0x7CE0, 0x07D9, 0x7CE2, 0x17A8, 0x7CE6, 0x479B, 0x7CE7, 0x0F90,
- 0x7CEB, 0x3A77, 0x7CEF, 0x17AA, 0x7CF2, 0x17AB, 0x7CF4, 0x17AC,
- 0x7CF5, 0x479D, 0x7CF6, 0x17AD, 0x7CF8, 0x08B3, 0x7CFA, 0x17AE,
- 0x7CFB, 0x0725, 0x7CFE, 0x0684, 0x7D00, 0x0644, 0x7D02, 0x17B0,
- 0x7D03, 0x479E, 0x7D04, 0x0EFF, 0x7D05, 0x07DA, 0x7D06, 0x17AF,
- 0x7D07, 0x3A78, 0x7D08, 0x3A79, 0x7D09, 0x3A7A, 0x7D0A, 0x17B3,
- 0x7D0B, 0x0EF2, 0x7D0D, 0x0CF2, 0x7D10, 0x0DA5, 0x7D12, 0x47A0,
- 0x7D13, 0x3A7B, 0x7D14, 0x096D, 0x7D15, 0x17B2, 0x7D17, 0x08FF,
- 0x7D18, 0x07DB, 0x7D19, 0x08B4, 0x7D1A, 0x0683, 0x7D1B, 0x0E06,
- 0x7D1C, 0x17B1, 0x7D1D, 0x3A7C, 0x7D1E, 0x47A1, 0x7D20, 0x0AC9,
- 0x7D21, 0x0E70, 0x7D22, 0x0867, 0x7D23, 0x3A7D, 0x7D2B, 0x08B5,
- 0x7D2C, 0x0BF9, 0x7D2E, 0x17B6, 0x7D2F, 0x0FA7, 0x7D30, 0x0849,
- 0x7D31, 0x4290, 0x7D32, 0x17B7, 0x7D33, 0x0A08, 0x7D35, 0x17B9,
- 0x7D39, 0x09BA, 0x7D3A, 0x0820, 0x7D3C, 0x4CCD, 0x7D3D, 0x47A4,
- 0x7D3E, 0x47A5, 0x7D3F, 0x17B8, 0x7D40, 0x47A6, 0x7D41, 0x3A7E,
- 0x7D42, 0x0934, 0x7D43, 0x0772, 0x7D44, 0x0ACA, 0x7D45, 0x17B4,
- 0x7D46, 0x17BA, 0x7D47, 0x47A7, 0x7D48, 0x218F, 0x7D4B, 0x17B5,
- 0x7D4C, 0x0726, 0x7D4D, 0x4CCE, 0x7D4E, 0x17BD, 0x7D4F, 0x17C1,
- 0x7D50, 0x0741, 0x7D53, 0x3A7F, 0x7D55, 0x363A, 0x7D56, 0x17BC,
- 0x7D59, 0x3A80, 0x7D5A, 0x47AB, 0x7D5B, 0x17C5, 0x7D5C, 0x4291,
- 0x7D5D, 0x3A81, 0x7D5E, 0x07DC, 0x7D61, 0x0F57, 0x7D62, 0x0480,
- 0x7D63, 0x17C2, 0x7D66, 0x0685, 0x7D68, 0x17BF, 0x7D6A, 0x47AC,
- 0x7D6E, 0x17C0, 0x7D70, 0x47AD, 0x7D71, 0x0C77, 0x7D72, 0x17BE,
- 0x7D73, 0x17BB, 0x7D75, 0x0586, 0x7D76, 0x0A88, 0x7D79, 0x075C,
- 0x7D7A, 0x3A82, 0x7D7D, 0x17C7, 0x7D7F, 0x47AF, 0x7D82, 0x4CCF,
- 0x7D83, 0x4292, 0x7D85, 0x4CD0, 0x7D86, 0x3A83, 0x7D88, 0x47B1,
- 0x7D89, 0x17C4, 0x7D8B, 0x3A84, 0x7D8C, 0x3A85, 0x7D8D, 0x4CD1,
- 0x7D8F, 0x17C6, 0x7D91, 0x4CD2, 0x7D93, 0x17C3, 0x7D97, 0x47B2,
- 0x7D99, 0x0727, 0x7D9A, 0x0B13, 0x7D9B, 0x17C8, 0x7D9C, 0x0AF0,
- 0x7D9D, 0x47B4, 0x7D9E, 0x4CD3, 0x7D9F, 0x17D5, 0x7DA0, 0x2192,
- 0x7DA2, 0x17D1, 0x7DA3, 0x17CB, 0x7DA6, 0x4293, 0x7DA7, 0x47B5,
- 0x7DAA, 0x47B6, 0x7DAB, 0x17CF, 0x7DAC, 0x0926, 0x7DAD, 0x04A1,
- 0x7DAE, 0x17CA, 0x7DAF, 0x17D2, 0x7DB0, 0x17D6, 0x7DB1, 0x07DD,
- 0x7DB2, 0x0EE2, 0x7DB3, 0x4CD4, 0x7DB4, 0x0BF2, 0x7DB5, 0x17CC,
- 0x7DB6, 0x47B7, 0x7DB7, 0x2191, 0x7DB8, 0x17D4, 0x7DB9, 0x4CD5,
- 0x7DBA, 0x17C9, 0x7DBB, 0x0B7C, 0x7DBD, 0x17CE, 0x7DBE, 0x0481,
- 0x7DBF, 0x0ED6, 0x7DC0, 0x47B8, 0x7DC2, 0x4294, 0x7DC7, 0x17CD,
- 0x7DCA, 0x06D3, 0x7DCB, 0x0D80, 0x7DCC, 0x3A86, 0x7DCF, 0x0AEF,
- 0x7DD0, 0x4CD6, 0x7DD1, 0x0F98, 0x7DD2, 0x0979, 0x7DD5, 0x17FD,
- 0x7DD6, 0x2193, 0x7DD7, 0x47B9, 0x7DD8, 0x17D7, 0x7DD9, 0x47BA,
- 0x7DDA, 0x0AA2, 0x7DDC, 0x17D3, 0x7DDD, 0x17D8, 0x7DDE, 0x17DA,
- 0x7DE0, 0x0C15, 0x7DE1, 0x17DD, 0x7DE3, 0x340A, 0x7DE4, 0x17D9,
- 0x7DE5, 0x4CD7, 0x7DE6, 0x47BB, 0x7DE8, 0x0E24, 0x7DE9, 0x0607,
- 0x7DEB, 0x3A87, 0x7DEC, 0x0ED7, 0x7DEF, 0x04A2, 0x7DF1, 0x3A88,
- 0x7DF2, 0x17DC, 0x7DF4, 0x0FC5, 0x7DF5, 0x4CD8, 0x7DF6, 0x4CD9,
- 0x7DF9, 0x3A89, 0x7DFB, 0x17DB, 0x7E01, 0x0511, 0x7E04, 0x0CC4,
- 0x7E05, 0x17DE, 0x7E08, 0x3A8A, 0x7E09, 0x17E5, 0x7E0A, 0x17DF,
- 0x7E0B, 0x17E6, 0x7E10, 0x47BF, 0x7E11, 0x3A8B, 0x7E12, 0x17E2,
- 0x7E15, 0x3A8C, 0x7E17, 0x47C0, 0x7E1B, 0x0D31, 0x7E1D, 0x47C1,
- 0x7E1E, 0x08F6, 0x7E1F, 0x17E4, 0x7E20, 0x3A8D, 0x7E21, 0x17E1,
- 0x7E22, 0x17E7, 0x7E23, 0x17E0, 0x7E26, 0x094E, 0x7E27, 0x47C2,
- 0x7E28, 0x4295, 0x7E2B, 0x0E53, 0x7E2C, 0x47C3, 0x7E2E, 0x0956,
- 0x7E2F, 0x4CDA, 0x7E31, 0x17E3, 0x7E32, 0x17EF, 0x7E35, 0x17EB,
- 0x7E36, 0x4CDB, 0x7E37, 0x17EE, 0x7E39, 0x17EC, 0x7E3A, 0x17F0,
- 0x7E3B, 0x17EA, 0x7E3D, 0x17D0, 0x7E3E, 0x0A77, 0x7E41, 0x0D5F,
- 0x7E43, 0x17ED, 0x7E44, 0x4CDC, 0x7E45, 0x47C4, 0x7E46, 0x17E8,
- 0x7E47, 0x3A8E, 0x7E48, 0x3767, 0x7E4A, 0x0AA3, 0x7E4B, 0x0728,
- 0x7E4D, 0x0935, 0x7E52, 0x2194, 0x7E54, 0x09EB, 0x7E55, 0x0AB8,
- 0x7E56, 0x17F3, 0x7E59, 0x17F5, 0x7E5A, 0x17F6, 0x7E5D, 0x17F2,
- 0x7E5E, 0x17F4, 0x7E61, 0x1E11, 0x7E62, 0x3A8F, 0x7E66, 0x17E9,
- 0x7E67, 0x17F1, 0x7E69, 0x17F9, 0x7E6A, 0x17F8, 0x7E6B, 0x1DF7,
- 0x7E6D, 0x0EA8, 0x7E6E, 0x3A90, 0x7E6F, 0x4CDD, 0x7E70, 0x0701,
- 0x7E73, 0x3A91, 0x7E75, 0x47C5, 0x7E78, 0x4CDE, 0x7E79, 0x17F7,
- 0x7E7B, 0x17FB, 0x7E7C, 0x17FA, 0x7E7D, 0x17FE, 0x7E7E, 0x47C6,
- 0x7E7F, 0x1800, 0x7E81, 0x4CDF, 0x7E82, 0x088A, 0x7E83, 0x17FC,
- 0x7E86, 0x47C7, 0x7E87, 0x47C8, 0x7E88, 0x1801, 0x7E89, 0x1802,
- 0x7E8A, 0x20A7, 0x7E8C, 0x1803, 0x7E8D, 0x3A92, 0x7E8E, 0x1809,
- 0x7E8F, 0x0C35, 0x7E90, 0x1805, 0x7E91, 0x3A93, 0x7E92, 0x1804,
- 0x7E93, 0x1806, 0x7E94, 0x1807, 0x7E96, 0x1808, 0x7E98, 0x3A94,
- 0x7E9A, 0x47CA, 0x7E9B, 0x180A, 0x7E9C, 0x180B, 0x7F36, 0x0608,
- 0x7F38, 0x180C, 0x7F3A, 0x180D, 0x7F3B, 0x47CD, 0x7F3C, 0x47CC,
- 0x7F3D, 0x4CE0, 0x7F3E, 0x47CE, 0x7F43, 0x47CF, 0x7F44, 0x3A95,
- 0x7F45, 0x180E, 0x7F47, 0x2195, 0x7F4C, 0x180F, 0x7F4D, 0x1810,
- 0x7F4E, 0x1811, 0x7F4F, 0x3A96, 0x7F50, 0x1812, 0x7F51, 0x1813,
- 0x7F52, 0x3A97, 0x7F53, 0x3A98, 0x7F54, 0x1815, 0x7F55, 0x1814,
- 0x7F58, 0x1816, 0x7F5B, 0x4CE1, 0x7F5D, 0x4CE2, 0x7F5F, 0x1817,
- 0x7F60, 0x1818, 0x7F61, 0x3A99, 0x7F63, 0x47D3, 0x7F64, 0x47D4,
- 0x7F65, 0x4CE3, 0x7F67, 0x181B, 0x7F68, 0x1819, 0x7F69, 0x181A,
- 0x7F6A, 0x0851, 0x7F6B, 0x0729, 0x7F6D, 0x47D5, 0x7F6E, 0x0B94,
- 0x7F70, 0x0D47, 0x7F71, 0x4CE4, 0x7F72, 0x097A, 0x7F75, 0x0D03,
- 0x7F77, 0x0D81, 0x7F78, 0x181C, 0x7F79, 0x1336, 0x7F7D, 0x47D6,
- 0x7F7E, 0x47D7, 0x7F7F, 0x4CE5, 0x7F80, 0x4CE6, 0x7F82, 0x181D,
- 0x7F83, 0x181F, 0x7F85, 0x0F4F, 0x7F86, 0x181E, 0x7F87, 0x1821,
- 0x7F88, 0x1820, 0x7F8A, 0x0F3D, 0x7F8B, 0x4CE7, 0x7F8C, 0x1822,
- 0x7F8E, 0x0D92, 0x7F90, 0x47D8, 0x7F91, 0x3A9A, 0x7F94, 0x1823,
- 0x7F96, 0x47DB, 0x7F97, 0x4296, 0x7F9A, 0x1826, 0x7F9C, 0x47DC,
- 0x7F9D, 0x1825, 0x7F9E, 0x1824, 0x7FA1, 0x2196, 0x7FA2, 0x4CE8,
- 0x7FA3, 0x1827, 0x7FA4, 0x0708, 0x7FA8, 0x0AA4, 0x7FA9, 0x065B,
- 0x7FAD, 0x47DD, 0x7FAE, 0x182B, 0x7FAF, 0x1828, 0x7FB2, 0x1829,
- 0x7FB6, 0x182C, 0x7FB8, 0x182D, 0x7FB9, 0x182A, 0x7FBD, 0x04CB,
- 0x7FBF, 0x3A9B, 0x7FC1, 0x0527, 0x7FC3, 0x47DF, 0x7FC5, 0x182F,
- 0x7FC6, 0x1830, 0x7FCA, 0x1831, 0x7FCC, 0x0F4C, 0x7FCE, 0x3A9C,
- 0x7FCF, 0x47E0, 0x7FD2, 0x0936, 0x7FD4, 0x1833, 0x7FD5, 0x1832,
- 0x7FDB, 0x4297, 0x7FDF, 0x3A9D, 0x7FE0, 0x0A2F, 0x7FE1, 0x1834,
- 0x7FE3, 0x47E1, 0x7FE5, 0x3A9E, 0x7FE6, 0x1835, 0x7FE9, 0x1836,
- 0x7FEB, 0x0621, 0x7FEC, 0x3A9F, 0x7FEE, 0x3AA0, 0x7FEF, 0x3AA1,
- 0x7FF0, 0x0609, 0x7FF2, 0x47E2, 0x7FF3, 0x1837, 0x7FF9, 0x1838,
- 0x7FFA, 0x3AA2, 0x7FFB, 0x0E8B, 0x7FFC, 0x0F4D, 0x7FFD, 0x4CE9,
- 0x7FFE, 0x4CEA, 0x7FFF, 0x4CEB, 0x8000, 0x0F3E, 0x8001, 0x0FDD,
- 0x8002, 0x3713, 0x8003, 0x07DF, 0x8004, 0x183B, 0x8005, 0x0900,
- 0x8006, 0x183A, 0x8007, 0x4CEC, 0x8008, 0x47E4, 0x800A, 0x47E3,
- 0x800B, 0x183C, 0x800C, 0x08D5, 0x800D, 0x4CED, 0x800E, 0x3AA3,
- 0x8010, 0x0B31, 0x8011, 0x3AA4, 0x8012, 0x183D, 0x8014, 0x3AA5,
- 0x8015, 0x07DE, 0x8016, 0x47E5, 0x8017, 0x0EE3, 0x8018, 0x183E,
- 0x8019, 0x183F, 0x801C, 0x1840, 0x801E, 0x4CEE, 0x8021, 0x1841,
- 0x8024, 0x3AA6, 0x8026, 0x3AA7, 0x8028, 0x1842, 0x802C, 0x47E6,
- 0x8030, 0x47E7, 0x8033, 0x08D6, 0x8035, 0x4298, 0x8036, 0x0EF9,
- 0x8037, 0x4299, 0x8039, 0x4CEF, 0x803A, 0x3AA8, 0x803B, 0x1844,
- 0x803C, 0x3AA9, 0x803D, 0x0B7D, 0x803F, 0x1843, 0x8043, 0x47E8,
- 0x8046, 0x1846, 0x804A, 0x1845, 0x8052, 0x1847, 0x8056, 0x0A5F,
- 0x8058, 0x1848, 0x805A, 0x1849, 0x805E, 0x0E09, 0x805F, 0x184A,
- 0x8060, 0x3AAA, 0x8061, 0x0AF1, 0x8062, 0x184B, 0x8066, 0x47E9,
- 0x8068, 0x184C, 0x806F, 0x0FC6, 0x8070, 0x184F, 0x8071, 0x3AAB,
- 0x8072, 0x184E, 0x8073, 0x184D, 0x8074, 0x0BCC, 0x8075, 0x3AAC,
- 0x8076, 0x1850, 0x8077, 0x09EC, 0x8079, 0x1851, 0x807B, 0x47EA,
- 0x807D, 0x1852, 0x807E, 0x0FDE, 0x807F, 0x1853, 0x8084, 0x1854,
- 0x8085, 0x1856, 0x8086, 0x1855, 0x8087, 0x0D39, 0x8088, 0x4CF0,
- 0x8089, 0x0CD1, 0x808B, 0x0FE4, 0x808C, 0x0D3D, 0x808E, 0x4CF1,
- 0x8093, 0x1858, 0x8096, 0x09BB, 0x8098, 0x0D9C, 0x8099, 0x47EB,
- 0x809A, 0x1859, 0x809B, 0x1857, 0x809C, 0x47EC, 0x809D, 0x060A,
- 0x809E, 0x3AAD, 0x80A1, 0x0788, 0x80A2, 0x08B6, 0x80A4, 0x47ED,
- 0x80A5, 0x0D82, 0x80A6, 0x3AAE, 0x80A7, 0x47EE, 0x80A9, 0x075E,
- 0x80AA, 0x0E71, 0x80AB, 0x3AAF, 0x80AC, 0x185C, 0x80AD, 0x185A,
- 0x80AF, 0x07E0, 0x80B1, 0x07E1, 0x80B2, 0x04AD, 0x80B4, 0x0858,
- 0x80B8, 0x47EF, 0x80BA, 0x0D0F, 0x80C3, 0x04A3, 0x80C4, 0x1861,
- 0x80C5, 0x47F1, 0x80C6, 0x0B7E, 0x80CA, 0x429A, 0x80CC, 0x0D0E,
- 0x80CE, 0x0B3B, 0x80CF, 0x4CF2, 0x80D4, 0x4CF3, 0x80D5, 0x47F2,
- 0x80D6, 0x1863, 0x80D7, 0x3AB0, 0x80D8, 0x3AB1, 0x80D9, 0x185F,
- 0x80DA, 0x1862, 0x80DB, 0x185D, 0x80DD, 0x1860, 0x80DE, 0x0E54,
- 0x80E0, 0x429B, 0x80E1, 0x0789, 0x80E4, 0x04C1, 0x80E5, 0x185E,
- 0x80E6, 0x47F3, 0x80ED, 0x4CF4, 0x80EF, 0x1865, 0x80F0, 0x4CF5,
- 0x80F1, 0x1866, 0x80F3, 0x429C, 0x80F4, 0x0C91, 0x80F5, 0x47F5,
- 0x80F7, 0x4CF6, 0x80F8, 0x06B3, 0x80FA, 0x4CF7, 0x80FB, 0x47F6,
- 0x80FC, 0x1871, 0x80FD, 0x0CF3, 0x80FE, 0x4CF8, 0x8102, 0x08B7,
- 0x8103, 0x4CF9, 0x8105, 0x06B4, 0x8106, 0x0A6C, 0x8107, 0x0FEC,
- 0x8108, 0x0EBA, 0x8109, 0x1864, 0x810A, 0x0A78, 0x810D, 0x47F4,
- 0x8116, 0x3AB2, 0x8117, 0x4CFA, 0x8118, 0x3AB3, 0x811A, 0x066D,
- 0x811B, 0x1867, 0x811E, 0x47F9, 0x8123, 0x1869, 0x8124, 0x47FB,
- 0x8127, 0x47FC, 0x8129, 0x1868, 0x812B, 0x3659, 0x812C, 0x47FD,
- 0x812F, 0x186A, 0x8130, 0x4CFB, 0x8131, 0x0B64, 0x8133, 0x0CF4,
- 0x8135, 0x47F8, 0x8139, 0x0BCD, 0x813A, 0x3AB4, 0x813D, 0x47FF,
- 0x813E, 0x186E, 0x8141, 0x3772, 0x8146, 0x186D, 0x814A, 0x3AB5,
- 0x814B, 0x186B, 0x814C, 0x3AB6, 0x814E, 0x0A1B, 0x8150, 0x0DD7,
- 0x8151, 0x1870, 0x8153, 0x186F, 0x8154, 0x07E2, 0x8155, 0x0FF9,
- 0x8157, 0x4CFC, 0x815F, 0x1880, 0x8160, 0x429D, 0x8165, 0x1874,
- 0x8166, 0x1875, 0x8167, 0x429E, 0x8168, 0x429F, 0x8169, 0x4801,
- 0x816B, 0x091C, 0x816D, 0x42A0, 0x816E, 0x1873, 0x816F, 0x4CFD,
- 0x8170, 0x080A, 0x8171, 0x1872, 0x8173, 0x4CFE, 0x8174, 0x1876,
- 0x8178, 0x0BCE, 0x8179, 0x0DF2, 0x817A, 0x0AA5, 0x817F, 0x0B3C,
- 0x8180, 0x187A, 0x8181, 0x3AB7, 0x8182, 0x187B, 0x8183, 0x1877,
- 0x8184, 0x3AB8, 0x8185, 0x4804, 0x8188, 0x1878, 0x818A, 0x1879,
- 0x818B, 0x4CFF, 0x818F, 0x07E3, 0x8190, 0x4D00, 0x8193, 0x1881,
- 0x8195, 0x187D, 0x8198, 0x4806, 0x819A, 0x0DD8, 0x819B, 0x4D01,
- 0x819C, 0x0E9A, 0x819D, 0x0D9A, 0x819E, 0x4D02, 0x81A0, 0x187C,
- 0x81A3, 0x187F, 0x81A4, 0x187E, 0x81A8, 0x0E72, 0x81A9, 0x1882,
- 0x81B0, 0x1883, 0x81B2, 0x4807, 0x81B3, 0x0AB9, 0x81B4, 0x3AB9,
- 0x81B5, 0x1884, 0x81B8, 0x1886, 0x81BA, 0x188A, 0x81BB, 0x42A1,
- 0x81BD, 0x1887, 0x81BE, 0x1885, 0x81BF, 0x0CF5, 0x81C0, 0x1888,
- 0x81C1, 0x4808, 0x81C2, 0x1889, 0x81C3, 0x4809, 0x81C6, 0x0532,
- 0x81C8, 0x1890, 0x81C9, 0x188B, 0x81CA, 0x42A2, 0x81CB, 0x4D03,
- 0x81CD, 0x188C, 0x81CF, 0x3ABA, 0x81D1, 0x188D, 0x81D3, 0x0B01,
- 0x81D5, 0x4D04, 0x81D6, 0x480A, 0x81D7, 0x42A3, 0x81D8, 0x188F,
- 0x81D9, 0x188E, 0x81DA, 0x1891, 0x81DB, 0x480B, 0x81DD, 0x4D05,
- 0x81DE, 0x4D06, 0x81DF, 0x1892, 0x81E0, 0x1893, 0x81E1, 0x4D07,
- 0x81E3, 0x0A09, 0x81E4, 0x480D, 0x81E5, 0x0569, 0x81E7, 0x1894,
- 0x81E8, 0x0F9F, 0x81EA, 0x08D7, 0x81EC, 0x480F, 0x81ED, 0x0937,
- 0x81EF, 0x4D08, 0x81F3, 0x08B8, 0x81F4, 0x0B95, 0x81F6, 0x4D09,
- 0x81F9, 0x3ABB, 0x81FA, 0x1895, 0x81FB, 0x1896, 0x81FC, 0x04D3,
- 0x81FD, 0x4810, 0x81FE, 0x1897, 0x81FF, 0x4811, 0x8200, 0x4D0A,
- 0x8201, 0x1898, 0x8202, 0x1899, 0x8203, 0x3ABC, 0x8204, 0x4813,
- 0x8205, 0x189A, 0x8207, 0x189B, 0x8208, 0x06B5, 0x8209, 0x13AF,
- 0x820A, 0x189C, 0x820B, 0x4D0B, 0x820C, 0x0A89, 0x820D, 0x189D,
- 0x820E, 0x08F7, 0x8210, 0x189E, 0x8212, 0x1009, 0x8213, 0x4D0C,
- 0x8214, 0x4D0D, 0x8216, 0x189F, 0x8217, 0x0E2E, 0x8218, 0x0618,
- 0x8219, 0x4815, 0x821A, 0x4D0E, 0x821B, 0x0AA6, 0x821C, 0x0962,
- 0x821E, 0x0DE3, 0x821F, 0x0938, 0x8221, 0x3ABD, 0x8222, 0x4816,
- 0x8229, 0x18A0, 0x822A, 0x07E4, 0x822B, 0x18A1, 0x822C, 0x0D60,
- 0x822E, 0x18AF, 0x8232, 0x3ABE, 0x8233, 0x18A3, 0x8234, 0x3ABF,
- 0x8235, 0x0B29, 0x8236, 0x0D2B, 0x8237, 0x0773, 0x8238, 0x18A2,
- 0x8239, 0x0AA7, 0x823A, 0x4D0F, 0x823C, 0x4818, 0x8240, 0x18A4,
- 0x8244, 0x4D10, 0x8245, 0x481A, 0x8246, 0x3AC0, 0x8247, 0x0C16,
- 0x8249, 0x4819, 0x824B, 0x3AC1, 0x824F, 0x3AC2, 0x8257, 0x481E,
- 0x8258, 0x18A6, 0x8259, 0x18A5, 0x825A, 0x18A8, 0x825C, 0x4820,
- 0x825D, 0x18A7, 0x825F, 0x18A9, 0x8260, 0x42A5, 0x8262, 0x18AB,
- 0x8263, 0x4821, 0x8264, 0x18AA, 0x8266, 0x060B, 0x8268, 0x18AC,
- 0x826A, 0x18AD, 0x826B, 0x18AE, 0x826D, 0x4D11, 0x826E, 0x0821,
- 0x826F, 0x0F91, 0x8271, 0x18B0, 0x8272, 0x09ED, 0x8274, 0x42A6,
- 0x8276, 0x0512, 0x8277, 0x18B1, 0x8278, 0x18B2, 0x8279, 0x3775,
- 0x827D, 0x4824, 0x827E, 0x18B3, 0x827F, 0x4825, 0x8283, 0x4826,
- 0x8284, 0x4D12, 0x8289, 0x4D13, 0x828A, 0x4827, 0x828B, 0x04B6,
- 0x828D, 0x18B4, 0x828E, 0x3AC3, 0x8291, 0x4D14, 0x8292, 0x18B5,
- 0x8293, 0x4828, 0x8299, 0x0DD9, 0x829D, 0x08F3, 0x829F, 0x18B7,
- 0x82A1, 0x42A8, 0x82A3, 0x42A9, 0x82A4, 0x42AA, 0x82A5, 0x0587,
- 0x82A6, 0x0476, 0x82A7, 0x4829, 0x82A8, 0x482A, 0x82A9, 0x42AB,
- 0x82AA, 0x4D15, 0x82AB, 0x18B6, 0x82AC, 0x18B9, 0x82AD, 0x0D04,
- 0x82AE, 0x3AC4, 0x82AF, 0x0A0A, 0x82B0, 0x4D16, 0x82B1, 0x0556,
- 0x82B2, 0x482B, 0x82B3, 0x0E55, 0x82B4, 0x482C, 0x82B7, 0x3AC5,
- 0x82B8, 0x0733, 0x82B9, 0x06D4, 0x82BA, 0x482D, 0x82BB, 0x18B8,
- 0x82BC, 0x482E, 0x82BD, 0x056A, 0x82BE, 0x3AC6, 0x82BF, 0x42AC,
- 0x82C5, 0x05DF, 0x82C6, 0x3AC7, 0x82D0, 0x4D17, 0x82D1, 0x0513,
- 0x82D2, 0x18BD, 0x82D3, 0x0FB2, 0x82D4, 0x0B3D, 0x82D5, 0x42AD,
- 0x82D7, 0x0DB6, 0x82D9, 0x18C9, 0x82DB, 0x0557, 0x82DC, 0x18C7,
- 0x82DE, 0x18C5, 0x82DF, 0x18BC, 0x82E1, 0x18BA, 0x82E2, 0x482F,
- 0x82E3, 0x18BB, 0x82E5, 0x090F, 0x82E6, 0x06E4, 0x82E7, 0x0BB5,
- 0x82E8, 0x4830, 0x82EA, 0x4D18, 0x82EB, 0x0CA9, 0x82EF, 0x4D19,
- 0x82F1, 0x04F3, 0x82F3, 0x18BF, 0x82F4, 0x18BE, 0x82F6, 0x4D1A,
- 0x82F7, 0x4831, 0x82F9, 0x18C4, 0x82FA, 0x18C0, 0x82FB, 0x18C3,
- 0x82FD, 0x42AE, 0x82FE, 0x3AC8, 0x8300, 0x42AF, 0x8301, 0x2198,
- 0x8302, 0x0EDC, 0x8303, 0x18C2, 0x8304, 0x0558, 0x8305, 0x05DB,
- 0x8306, 0x18C6, 0x8307, 0x4832, 0x8308, 0x4833, 0x8309, 0x18C8,
- 0x830C, 0x4834, 0x830E, 0x072A, 0x8316, 0x18CC, 0x8317, 0x18D5,
- 0x8318, 0x18D6, 0x831B, 0x4836, 0x831C, 0x046F, 0x831D, 0x4837,
- 0x8322, 0x42B0, 0x8323, 0x18DD, 0x8328, 0x04B5, 0x832B, 0x18D4,
- 0x832D, 0x42B1, 0x832F, 0x18D3, 0x8330, 0x4838, 0x8331, 0x18CE,
- 0x8332, 0x18CD, 0x8334, 0x18CB, 0x8335, 0x18CA, 0x8336, 0x0BA1,
- 0x8338, 0x0B5B, 0x8339, 0x18D0, 0x833A, 0x42B2, 0x833C, 0x4839,
- 0x8340, 0x18CF, 0x8343, 0x3AC9, 0x8344, 0x483A, 0x8345, 0x18D2,
- 0x8346, 0x1DF8, 0x8347, 0x42B3, 0x8349, 0x0AF2, 0x834A, 0x072B,
- 0x834F, 0x04E3, 0x8350, 0x18D1, 0x8351, 0x3ACA, 0x8352, 0x07E5,
- 0x8354, 0x4835, 0x8355, 0x3ACB, 0x8356, 0x4D1B, 0x8357, 0x483B,
- 0x8358, 0x0AF3, 0x835A, 0x377A, 0x8362, 0x2199, 0x8363, 0x456F,
- 0x8373, 0x18E3, 0x8375, 0x18E4, 0x8377, 0x0559, 0x8378, 0x4D1C,
- 0x837B, 0x052E, 0x837C, 0x18E1, 0x837D, 0x42B4, 0x837F, 0x219A,
- 0x8385, 0x18D7, 0x8386, 0x3ACC, 0x8387, 0x18DF, 0x8389, 0x18E6,
- 0x838A, 0x18E0, 0x838D, 0x3ACD, 0x838E, 0x18DE, 0x8392, 0x3ACE,
- 0x8393, 0x18C1, 0x8394, 0x483F, 0x8395, 0x4840, 0x8396, 0x18DC,
- 0x8398, 0x3ACF, 0x839A, 0x18D8, 0x839B, 0x4841, 0x839D, 0x4842,
- 0x839E, 0x060C, 0x839F, 0x18DA, 0x83A0, 0x18E5, 0x83A2, 0x18DB,
- 0x83A7, 0x42B5, 0x83A8, 0x18E7, 0x83A9, 0x3AD0, 0x83AA, 0x18D9,
- 0x83AB, 0x0D32, 0x83B1, 0x0F53, 0x83B5, 0x18E2, 0x83BD, 0x18F8,
- 0x83BF, 0x3AD1, 0x83C0, 0x3AD2, 0x83C1, 0x18F0, 0x83C5, 0x0A41,
- 0x83C7, 0x219B, 0x83C9, 0x4843, 0x83CA, 0x0660, 0x83CC, 0x06D5,
- 0x83CE, 0x18EB, 0x83CF, 0x42B6, 0x83D0, 0x4844, 0x83D1, 0x42B7,
- 0x83D3, 0x055B, 0x83D4, 0x4845, 0x83D6, 0x09BC, 0x83D8, 0x18EE,
- 0x83DC, 0x084A, 0x83DD, 0x4846, 0x83DF, 0x0C4B, 0x83E0, 0x18F3,
- 0x83E1, 0x42B8, 0x83E5, 0x4847, 0x83E9, 0x0E3E, 0x83EA, 0x3AD3,
- 0x83EB, 0x18EA, 0x83EF, 0x055A, 0x83F0, 0x078A, 0x83F1, 0x0D9B,
- 0x83F2, 0x18F4, 0x83F4, 0x18E8, 0x83F6, 0x219C, 0x83F7, 0x18F1,
- 0x83F8, 0x4D1D, 0x83F9, 0x4848, 0x83FB, 0x18FB, 0x83FC, 0x4D1E,
- 0x83FD, 0x18EC, 0x8401, 0x42B9, 0x8403, 0x18ED, 0x8404, 0x0C92,
- 0x8406, 0x42BA, 0x8407, 0x18F2, 0x840A, 0x1E7F, 0x840B, 0x18EF,
- 0x840C, 0x0E56, 0x840D, 0x18F5, 0x840E, 0x04A4, 0x840F, 0x3AD4,
- 0x8411, 0x3AD5, 0x8413, 0x18E9, 0x8415, 0x4849, 0x8417, 0x484B,
- 0x8420, 0x18F7, 0x8422, 0x18F6, 0x8429, 0x0D21, 0x842A, 0x18FD,
- 0x842C, 0x1908, 0x8431, 0x05DC, 0x8435, 0x190B, 0x8438, 0x18F9,
- 0x8439, 0x484C, 0x843C, 0x18FE, 0x843D, 0x0F58, 0x8446, 0x1907,
- 0x8448, 0x219D, 0x8449, 0x0F3F, 0x844A, 0x3AD6, 0x844E, 0x0F72,
- 0x844F, 0x484D, 0x8451, 0x484E, 0x8452, 0x484F, 0x8457, 0x0BB6,
- 0x8458, 0x4D1F, 0x8459, 0x4850, 0x845A, 0x4851, 0x845B, 0x05C9,
- 0x845C, 0x4852, 0x845F, 0x42BB, 0x8461, 0x0DE4, 0x8462, 0x190D,
- 0x8463, 0x0C79, 0x8465, 0x4854, 0x8466, 0x0475, 0x8469, 0x1906,
- 0x846B, 0x1902, 0x846C, 0x0AF4, 0x846D, 0x18FC, 0x846E, 0x1904,
- 0x846F, 0x1909, 0x8470, 0x42BC, 0x8471, 0x0CE2, 0x8473, 0x42BD,
- 0x8475, 0x046E, 0x8476, 0x3AD7, 0x8477, 0x1901, 0x8478, 0x4855,
- 0x8479, 0x190A, 0x847A, 0x0DEA, 0x847C, 0x4856, 0x8481, 0x4857,
- 0x8482, 0x1905, 0x8484, 0x1900, 0x8485, 0x42BE, 0x848B, 0x09BD,
- 0x8490, 0x0939, 0x8493, 0x4D20, 0x8494, 0x08D8, 0x8497, 0x4859,
- 0x8499, 0x0EE4, 0x849C, 0x0DB9, 0x849E, 0x42BF, 0x849F, 0x1910,
- 0x84A1, 0x1919, 0x84A6, 0x485A, 0x84A8, 0x3AD8, 0x84AD, 0x1903,
- 0x84AF, 0x3AD9, 0x84B1, 0x4D21, 0x84B2, 0x05D5, 0x84B4, 0x219E,
- 0x84B8, 0x09E0, 0x84B9, 0x190E, 0x84BA, 0x42C0, 0x84BB, 0x1913,
- 0x84BC, 0x0AF5, 0x84BD, 0x4D22, 0x84BE, 0x485B, 0x84BF, 0x190F,
- 0x84C0, 0x3ADA, 0x84C1, 0x1916, 0x84C2, 0x3ADB, 0x84C4, 0x0B9D,
- 0x84C6, 0x1917, 0x84C9, 0x0F40, 0x84CA, 0x190C, 0x84CB, 0x0596,
- 0x84CD, 0x1912, 0x84CE, 0x485D, 0x84CF, 0x485E, 0x84D0, 0x1915,
- 0x84D1, 0x0EB8, 0x84D3, 0x485F, 0x84D6, 0x1918, 0x84D9, 0x1911,
- 0x84DA, 0x1914, 0x84DC, 0x20AB, 0x84E7, 0x4861, 0x84EA, 0x4862,
- 0x84EC, 0x0E57, 0x84EE, 0x0FC7, 0x84EF, 0x4863, 0x84F0, 0x3ADC,
- 0x84F1, 0x4864, 0x84F4, 0x191C, 0x84FA, 0x4865, 0x84FB, 0x4D23,
- 0x84FC, 0x1923, 0x84FD, 0x3ADD, 0x84FF, 0x191B, 0x8500, 0x08EF,
- 0x8506, 0x18FA, 0x850C, 0x3ADE, 0x8511, 0x0E1E, 0x8513, 0x0EAE,
- 0x8514, 0x1922, 0x8515, 0x1921, 0x8517, 0x191D, 0x8518, 0x191E,
- 0x851A, 0x04D8, 0x851B, 0x4866, 0x851E, 0x42C3, 0x851F, 0x1920,
- 0x8521, 0x191A, 0x8523, 0x1E1A, 0x8524, 0x4867, 0x8525, 0x4868,
- 0x8526, 0x0BF1, 0x852B, 0x4869, 0x852C, 0x191F, 0x852D, 0x04C2,
- 0x852F, 0x42C4, 0x8532, 0x42C2, 0x8534, 0x3ADF, 0x8535, 0x0B02,
- 0x853D, 0x0E13, 0x853E, 0x1EB5, 0x8540, 0x1924, 0x8541, 0x1928,
- 0x8543, 0x0D6D, 0x8546, 0x4D24, 0x8548, 0x1927, 0x8549, 0x09BE,
- 0x854A, 0x08F5, 0x854B, 0x192A, 0x854E, 0x06B6, 0x854F, 0x486A,
- 0x8551, 0x486D, 0x8553, 0x219F, 0x8555, 0x192B, 0x8556, 0x4D25,
- 0x8557, 0x0DEB, 0x8558, 0x1926, 0x8559, 0x21A0, 0x855A, 0x18FF,
- 0x855D, 0x4D26, 0x855E, 0x3AE0, 0x8561, 0x486E, 0x8562, 0x486F,
- 0x8563, 0x1925, 0x8564, 0x42C5, 0x8568, 0x0FF5, 0x8569, 0x0C7A,
- 0x856A, 0x0DE5, 0x856B, 0x21A1, 0x856D, 0x1932, 0x856F, 0x486B,
- 0x8577, 0x1938, 0x857A, 0x42C6, 0x857B, 0x4871, 0x857D, 0x4872,
- 0x857E, 0x1939, 0x857F, 0x4873, 0x8580, 0x192C, 0x8581, 0x4874,
- 0x8584, 0x0D2C, 0x8585, 0x4D27, 0x8586, 0x4875, 0x8587, 0x1936,
- 0x8588, 0x192E, 0x858A, 0x1930, 0x858C, 0x42C7, 0x858F, 0x3AE1,
- 0x8590, 0x193A, 0x8591, 0x192F, 0x8593, 0x4876, 0x8594, 0x1933,
- 0x8597, 0x0514, 0x8598, 0x4D28, 0x8599, 0x0CBD, 0x859B, 0x1934,
- 0x859C, 0x1937, 0x859D, 0x4877, 0x859F, 0x4878, 0x85A2, 0x42C8,
- 0x85A4, 0x192D, 0x85A6, 0x0AA8, 0x85A8, 0x1931, 0x85A9, 0x0875,
- 0x85AA, 0x0A0B, 0x85AB, 0x0706, 0x85AC, 0x0F00, 0x85AD, 0x3AE4,
- 0x85AE, 0x0F05, 0x85AF, 0x097C, 0x85B0, 0x21A3, 0x85B7, 0x3AE2,
- 0x85B9, 0x193E, 0x85BA, 0x193C, 0x85BC, 0x487C, 0x85C1, 0x0FF4,
- 0x85C7, 0x487D, 0x85C9, 0x193B, 0x85CA, 0x487E, 0x85CB, 0x42C9,
- 0x85CD, 0x0F5F, 0x85CE, 0x3AE3, 0x85CF, 0x193D, 0x85D0, 0x193F,
- 0x85D5, 0x1940, 0x85D8, 0x487F, 0x85D9, 0x4880, 0x85DC, 0x1943,
- 0x85DD, 0x1941, 0x85DF, 0x4881, 0x85E1, 0x4882, 0x85E4, 0x0C7B,
- 0x85E5, 0x1942, 0x85E6, 0x4883, 0x85E9, 0x0D61, 0x85EA, 0x1935,
- 0x85ED, 0x42CA, 0x85F4, 0x3780, 0x85F6, 0x4884, 0x85F7, 0x097D,
- 0x85F9, 0x1944, 0x85FA, 0x1949, 0x85FB, 0x0AF6, 0x85FE, 0x1948,
- 0x85FF, 0x42CB, 0x8600, 0x4885, 0x8602, 0x1929, 0x8604, 0x42CC,
- 0x8605, 0x42CD, 0x8606, 0x194A, 0x8607, 0x0ACB, 0x860A, 0x1945,
- 0x860B, 0x1947, 0x8610, 0x42CE, 0x8611, 0x4886, 0x8612, 0x3AE5,
- 0x8613, 0x1946, 0x8616, 0x14D0, 0x8617, 0x14C1, 0x8618, 0x42D0,
- 0x861A, 0x194C, 0x861E, 0x4887, 0x8621, 0x4888, 0x8622, 0x194B,
- 0x8624, 0x4889, 0x8627, 0x488A, 0x8629, 0x3AE6, 0x862D, 0x0F60,
- 0x862F, 0x16B1, 0x8630, 0x194D, 0x8638, 0x42D1, 0x8639, 0x488C,
- 0x863C, 0x488D, 0x863F, 0x194E, 0x8640, 0x488F, 0x8641, 0x41B8,
- 0x8642, 0x4D29, 0x8646, 0x4D2A, 0x864D, 0x194F, 0x864E, 0x078B,
- 0x8650, 0x066E, 0x8652, 0x3AE7, 0x8653, 0x4890, 0x8654, 0x1951,
- 0x8655, 0x1094, 0x8656, 0x4891, 0x8657, 0x42D2, 0x865A, 0x068F,
- 0x865B, 0x3418, 0x865C, 0x0F82, 0x865E, 0x06EB, 0x865F, 0x1952,
- 0x8662, 0x42D3, 0x8663, 0x3AE8, 0x8667, 0x1953, 0x866B, 0x0BAC,
- 0x866C, 0x3AE9, 0x866F, 0x3AEA, 0x8671, 0x1954, 0x8675, 0x42D5,
- 0x8677, 0x4892, 0x8679, 0x0CD2, 0x867A, 0x3AEB, 0x867B, 0x047E,
- 0x867D, 0x3786, 0x8687, 0x4893, 0x8689, 0x4894, 0x868A, 0x0563,
- 0x868B, 0x1959, 0x868C, 0x195A, 0x868D, 0x3AEC, 0x8691, 0x3AED,
- 0x8693, 0x1955, 0x8695, 0x088B, 0x8698, 0x3AEE, 0x869C, 0x4895,
- 0x869D, 0x4896, 0x86A3, 0x1956, 0x86A4, 0x0CF8, 0x86A7, 0x3AEF,
- 0x86A8, 0x3AF0, 0x86A9, 0x1957, 0x86AA, 0x1958, 0x86AB, 0x1962,
- 0x86AF, 0x195C, 0x86B0, 0x195F, 0x86B1, 0x4897, 0x86B3, 0x4898,
- 0x86B6, 0x195B, 0x86B8, 0x42D6, 0x86C0, 0x4D2B, 0x86C1, 0x4899,
- 0x86C3, 0x489A, 0x86C4, 0x195D, 0x86C6, 0x195E, 0x86C7, 0x0904,
- 0x86C9, 0x1960, 0x86CB, 0x0B7F, 0x86CD, 0x072C, 0x86CE, 0x05A0,
- 0x86D1, 0x489B, 0x86D4, 0x1963, 0x86D5, 0x489C, 0x86D7, 0x489D,
- 0x86D9, 0x059D, 0x86DB, 0x1968, 0x86DE, 0x1964, 0x86DF, 0x1967,
- 0x86E3, 0x489E, 0x86E4, 0x0D4E, 0x86E6, 0x489F, 0x86E9, 0x1965,
- 0x86EC, 0x1966, 0x86ED, 0x0DBA, 0x86EE, 0x0D6E, 0x86EF, 0x1969,
- 0x86F8, 0x0B5D, 0x86F9, 0x1973, 0x86FA, 0x3AF1, 0x86FB, 0x196F,
- 0x86FC, 0x42D7, 0x86FD, 0x3AF2, 0x86FE, 0x056B, 0x8700, 0x196D,
- 0x8702, 0x0E58, 0x8703, 0x196E, 0x8705, 0x48A1, 0x8706, 0x196B,
- 0x8707, 0x48A2, 0x8708, 0x196C, 0x8709, 0x1971, 0x870A, 0x1974,
- 0x870B, 0x3AF3, 0x870D, 0x1972, 0x870E, 0x48A3, 0x8710, 0x48A4,
- 0x8711, 0x1970, 0x8712, 0x196A, 0x8713, 0x3AF4, 0x8714, 0x4D2C,
- 0x8718, 0x0B96, 0x8719, 0x3AF5, 0x871A, 0x197B, 0x871C, 0x0EB6,
- 0x871E, 0x3AF6, 0x871F, 0x48A5, 0x8721, 0x48A6, 0x8722, 0x4D2D,
- 0x8723, 0x48A7, 0x8725, 0x1979, 0x8728, 0x3AF7, 0x8729, 0x197A,
- 0x872E, 0x4D2E, 0x8731, 0x48A8, 0x8734, 0x1975, 0x8737, 0x1977,
- 0x8739, 0x4D2F, 0x873A, 0x48A9, 0x873B, 0x1978, 0x873E, 0x3AF8,
- 0x873F, 0x1976, 0x8740, 0x48AA, 0x8743, 0x48AB, 0x8749, 0x0A8A,
- 0x874B, 0x0FDF, 0x874C, 0x197F, 0x874E, 0x1980, 0x8751, 0x48AC,
- 0x8753, 0x1986, 0x8755, 0x09F0, 0x8757, 0x1982, 0x8758, 0x48AD,
- 0x8759, 0x1985, 0x875D, 0x4D30, 0x875F, 0x197D, 0x8760, 0x197C,
- 0x8763, 0x1987, 0x8764, 0x48AE, 0x8765, 0x48AF, 0x8766, 0x055C,
- 0x8768, 0x1983, 0x876A, 0x1988, 0x876E, 0x1984, 0x8771, 0x3AF9,
- 0x8772, 0x48B0, 0x8774, 0x1981, 0x8776, 0x0BCF, 0x8778, 0x197E,
- 0x877B, 0x4D31, 0x877C, 0x48B1, 0x877F, 0x0D1E, 0x8782, 0x198C,
- 0x8787, 0x42D8, 0x8788, 0x3AFA, 0x8789, 0x48B5, 0x878B, 0x48B6,
- 0x878C, 0x4D32, 0x878D, 0x0F25, 0x878E, 0x4D33, 0x8793, 0x48B7,
- 0x8797, 0x4D34, 0x8798, 0x4D35, 0x8799, 0x3AFB, 0x879E, 0x4D36,
- 0x879F, 0x198B, 0x87A0, 0x48B8, 0x87A2, 0x198A, 0x87A3, 0x4D37,
- 0x87A7, 0x48B4, 0x87AB, 0x1993, 0x87AC, 0x3AFC, 0x87AD, 0x3AFD,
- 0x87AE, 0x4D38, 0x87AF, 0x198D, 0x87B3, 0x1995, 0x87B5, 0x3AFE,
- 0x87BA, 0x0F50, 0x87BB, 0x1998, 0x87BD, 0x198F, 0x87BE, 0x48BB,
- 0x87BF, 0x4D39, 0x87C0, 0x1990, 0x87C1, 0x48BD, 0x87C4, 0x1994,
- 0x87C6, 0x1997, 0x87C7, 0x1996, 0x87C9, 0x4D3A, 0x87CB, 0x198E,
- 0x87CE, 0x48BE, 0x87D0, 0x1991, 0x87D2, 0x19A2, 0x87D6, 0x3AFF,
- 0x87DA, 0x4D3B, 0x87DF, 0x48BF, 0x87E0, 0x199B, 0x87E3, 0x48C1,
- 0x87E5, 0x48C2, 0x87E6, 0x48C3, 0x87EA, 0x48C4, 0x87EB, 0x3B00,
- 0x87EC, 0x1E23, 0x87ED, 0x3B01, 0x87EF, 0x1999, 0x87F2, 0x199A,
- 0x87F5, 0x3C3D, 0x87F6, 0x199F, 0x87F7, 0x19A0, 0x87F9, 0x0588,
- 0x87FB, 0x065C, 0x87FE, 0x199E, 0x8801, 0x3B02, 0x8803, 0x4F58,
- 0x8805, 0x1989, 0x8806, 0x3B04, 0x8807, 0x21A6, 0x880A, 0x42DA,
- 0x880B, 0x3B05, 0x880D, 0x199D, 0x880E, 0x19A1, 0x880F, 0x199C,
- 0x8810, 0x42DB, 0x8811, 0x19A3, 0x8813, 0x48C5, 0x8814, 0x3B06,
- 0x8815, 0x19A5, 0x8816, 0x19A4, 0x8818, 0x4D3C, 0x881B, 0x4D3D,
- 0x881C, 0x3B07, 0x881F, 0x1E85, 0x8821, 0x19A7, 0x8822, 0x19A6,
- 0x8823, 0x1961, 0x8827, 0x19AB, 0x8828, 0x48C6, 0x882D, 0x4D3E,
- 0x882E, 0x48C7, 0x8831, 0x19A8, 0x8832, 0x48C8, 0x8836, 0x19A9,
- 0x8839, 0x19AA, 0x883A, 0x4D3F, 0x883B, 0x19AC, 0x883C, 0x48C9,
- 0x8840, 0x0742, 0x8842, 0x19AE, 0x8844, 0x19AD, 0x8845, 0x4D40,
- 0x8846, 0x093A, 0x884A, 0x48CB, 0x884B, 0x4D41, 0x884C, 0x07E6,
- 0x884D, 0x1524, 0x884E, 0x4D42, 0x8852, 0x19AF, 0x8853, 0x095B,
- 0x8855, 0x4D43, 0x8856, 0x3B08, 0x8857, 0x0597, 0x8858, 0x48CC,
- 0x8859, 0x19B0, 0x885A, 0x4D44, 0x885B, 0x04F4, 0x885D, 0x09BF,
- 0x885E, 0x19B1, 0x885F, 0x3B09, 0x8861, 0x07E7, 0x8862, 0x19B2,
- 0x8863, 0x04A5, 0x8864, 0x3B0A, 0x8868, 0x0DAF, 0x8869, 0x48CF,
- 0x886B, 0x19B3, 0x886E, 0x4D45, 0x886F, 0x48D1, 0x8870, 0x0A30,
- 0x8872, 0x19BA, 0x8875, 0x19B7, 0x8877, 0x0BAD, 0x887D, 0x19B8,
- 0x887E, 0x19B5, 0x887F, 0x06D6, 0x8881, 0x19B4, 0x8882, 0x19BB,
- 0x8888, 0x070C, 0x888B, 0x0B3E, 0x888D, 0x19C1, 0x8892, 0x19BD,
- 0x8896, 0x0B15, 0x8897, 0x19BC, 0x8898, 0x3B0B, 0x8899, 0x19BF,
- 0x889A, 0x4D46, 0x889B, 0x4D47, 0x889C, 0x4D48, 0x889E, 0x19B6,
- 0x88A0, 0x48D2, 0x88A2, 0x19C0, 0x88A4, 0x19C2, 0x88AA, 0x3B0C,
- 0x88AB, 0x0D83, 0x88AE, 0x19BE, 0x88B0, 0x19C3, 0x88B1, 0x19C5,
- 0x88B4, 0x0787, 0x88B5, 0x19B9, 0x88B7, 0x0485, 0x88BC, 0x48D3,
- 0x88BD, 0x3B0D, 0x88BE, 0x3B0E, 0x88BF, 0x19C4, 0x88C0, 0x48D4,
- 0x88C1, 0x084B, 0x88C2, 0x0FBE, 0x88C3, 0x19C6, 0x88C4, 0x19C7,
- 0x88C5, 0x0AF7, 0x88C6, 0x3789, 0x88CA, 0x3B0F, 0x88CD, 0x4D49,
- 0x88CE, 0x42DC, 0x88CF, 0x0F6A, 0x88D1, 0x48D6, 0x88D2, 0x3B10,
- 0x88D3, 0x48D7, 0x88D4, 0x19C8, 0x88D5, 0x0F1F, 0x88D8, 0x19C9,
- 0x88D9, 0x19CA, 0x88DB, 0x3B11, 0x88DC, 0x0E34, 0x88DD, 0x19CB,
- 0x88DF, 0x0830, 0x88E0, 0x4D4A, 0x88E1, 0x0F6B, 0x88E8, 0x19D0,
- 0x88EF, 0x4D4B, 0x88F0, 0x3B12, 0x88F1, 0x3B13, 0x88F2, 0x19D1,
- 0x88F3, 0x09C0, 0x88F4, 0x19CF, 0x88F5, 0x21A7, 0x88F8, 0x0F51,
- 0x88F9, 0x19CC, 0x88FC, 0x19CE, 0x88FD, 0x0A61, 0x88FE, 0x0A44,
- 0x8901, 0x48D9, 0x8902, 0x19CD, 0x8904, 0x19D2, 0x8906, 0x3B14,
- 0x8907, 0x0DF3, 0x890A, 0x19D4, 0x890C, 0x19D3, 0x890E, 0x4D4C,
- 0x890F, 0x4D4D, 0x8910, 0x05CA, 0x8912, 0x0E59, 0x8913, 0x19D5,
- 0x8918, 0x3B15, 0x8919, 0x3B16, 0x891A, 0x3B17, 0x891C, 0x20A8,
- 0x891D, 0x19E1, 0x891E, 0x19D7, 0x8925, 0x19D8, 0x8926, 0x4D4E,
- 0x8927, 0x3B18, 0x892A, 0x19D9, 0x892B, 0x19DA, 0x8930, 0x3B19,
- 0x8932, 0x42DE, 0x8935, 0x4D4F, 0x8936, 0x19DE, 0x8937, 0x48DB,
- 0x8938, 0x19DF, 0x8939, 0x42DF, 0x893B, 0x19DD, 0x893E, 0x3B1A,
- 0x8940, 0x42E0, 0x8941, 0x19DB, 0x8942, 0x48DD, 0x8943, 0x19D6,
- 0x8944, 0x19DC, 0x8945, 0x48DE, 0x8949, 0x48DF, 0x894C, 0x19E0,
- 0x894D, 0x1BD0, 0x8956, 0x0528, 0x895A, 0x4D50, 0x895C, 0x4D51,
- 0x895E, 0x19E3, 0x895F, 0x06D7, 0x8960, 0x19E2, 0x8962, 0x48E1,
- 0x8964, 0x19E5, 0x8966, 0x19E4, 0x896A, 0x19E7, 0x896B, 0x4D52,
- 0x896D, 0x19E6, 0x896F, 0x19E8, 0x8970, 0x4D53, 0x8972, 0x093B,
- 0x8974, 0x19E9, 0x8977, 0x19EA, 0x897B, 0x3B1B, 0x897C, 0x4D54,
- 0x897E, 0x19EB, 0x897F, 0x0A62, 0x8980, 0x362E, 0x8981, 0x0F41,
- 0x8983, 0x19EC, 0x8986, 0x0DF4, 0x8987, 0x0CFC, 0x8988, 0x19ED,
- 0x8989, 0x48E2, 0x898A, 0x19EE, 0x898B, 0x075F, 0x898F, 0x0646,
- 0x8990, 0x48E3, 0x8993, 0x19EF, 0x8994, 0x42E1, 0x8996, 0x08B9,
- 0x8997, 0x0CF7, 0x8998, 0x19F0, 0x899A, 0x05AE, 0x899F, 0x48E4,
- 0x89A1, 0x19F1, 0x89A5, 0x4D55, 0x89A6, 0x19F3, 0x89A7, 0x0F61,
- 0x89A9, 0x19F2, 0x89AA, 0x0A0C, 0x89AC, 0x19F4, 0x89AF, 0x19F5,
- 0x89B0, 0x48E5, 0x89B2, 0x19F6, 0x89B3, 0x060D, 0x89B5, 0x4D56,
- 0x89B7, 0x48E6, 0x89BA, 0x19F7, 0x89BC, 0x4D57, 0x89BD, 0x19F8,
- 0x89BF, 0x19F9, 0x89C0, 0x19FA, 0x89D2, 0x05AF, 0x89D4, 0x3B1C,
- 0x89D5, 0x4D58, 0x89D6, 0x3B1D, 0x89D8, 0x48E7, 0x89DA, 0x19FB,
- 0x89DC, 0x19FC, 0x89DD, 0x19FD, 0x89E3, 0x0572, 0x89E5, 0x3B1E,
- 0x89E6, 0x09EE, 0x89E7, 0x19FE, 0x89EB, 0x48E8, 0x89F1, 0x3B1F,
- 0x89F3, 0x48EA, 0x89F4, 0x19FF, 0x89F6, 0x42E2, 0x89F8, 0x1A00,
- 0x89FD, 0x48EB, 0x89FF, 0x48EC, 0x8A00, 0x0774, 0x8A01, 0x35BC,
- 0x8A02, 0x0C17, 0x8A03, 0x1A01, 0x8A07, 0x3B20, 0x8A08, 0x072D,
- 0x8A0A, 0x0A1C, 0x8A0C, 0x1A04, 0x8A0E, 0x0C7C, 0x8A0F, 0x3B21,
- 0x8A10, 0x1A03, 0x8A11, 0x48EE, 0x8A12, 0x21A8, 0x8A13, 0x0707,
- 0x8A14, 0x48EF, 0x8A15, 0x3B22, 0x8A16, 0x1A02, 0x8A17, 0x0B57,
- 0x8A18, 0x0647, 0x8A1B, 0x1A05, 0x8A1D, 0x1A06, 0x8A1F, 0x09C1,
- 0x8A21, 0x48F1, 0x8A22, 0x3B23, 0x8A23, 0x0743, 0x8A25, 0x1A07,
- 0x8A2A, 0x0E5A, 0x8A2D, 0x0A83, 0x8A31, 0x0690, 0x8A33, 0x0F01,
- 0x8A34, 0x0ACC, 0x8A35, 0x48F2, 0x8A36, 0x1A08, 0x8A37, 0x21A9,
- 0x8A3A, 0x0A0D, 0x8A3B, 0x0BAE, 0x8A3C, 0x09C2, 0x8A3E, 0x48F3,
- 0x8A41, 0x1A09, 0x8A45, 0x48F4, 0x8A46, 0x1A0C, 0x8A47, 0x42E3,
- 0x8A48, 0x1A0D, 0x8A49, 0x4D59, 0x8A4D, 0x48F5, 0x8A4E, 0x3B24,
- 0x8A50, 0x082E, 0x8A51, 0x0B22, 0x8A52, 0x1A0B, 0x8A54, 0x09C3,
- 0x8A55, 0x0DB0, 0x8A57, 0x4D5A, 0x8A58, 0x48F6, 0x8A5B, 0x1A0A,
- 0x8A5D, 0x42E4, 0x8A5E, 0x08BA, 0x8A60, 0x04F5, 0x8A61, 0x42E5,
- 0x8A62, 0x1A11, 0x8A63, 0x072E, 0x8A66, 0x08BC, 0x8A67, 0x4D5B,
- 0x8A69, 0x08BB, 0x8A6B, 0x0FF3, 0x8A6C, 0x1A10, 0x8A6D, 0x1A0F,
- 0x8A6E, 0x0AA9, 0x8A70, 0x0667, 0x8A71, 0x0FE9, 0x8A72, 0x0598,
- 0x8A73, 0x09C4, 0x8A75, 0x42E6, 0x8A79, 0x21AA, 0x8A7C, 0x1A0E,
- 0x8A7E, 0x4D5C, 0x8A7F, 0x3B25, 0x8A82, 0x1A13, 0x8A84, 0x1A14,
- 0x8A85, 0x1A12, 0x8A86, 0x4D5D, 0x8A87, 0x078C, 0x8A89, 0x0F2A,
- 0x8A8C, 0x08BD, 0x8A8D, 0x0CDD, 0x8A90, 0x48F8, 0x8A91, 0x1A17,
- 0x8A93, 0x0A64, 0x8A95, 0x0B80, 0x8A96, 0x4D5E, 0x8A98, 0x0F20,
- 0x8A9A, 0x1A1A, 0x8A9E, 0x07A0, 0x8AA0, 0x0A63, 0x8AA1, 0x1A16,
- 0x8AA3, 0x1A1B, 0x8AA4, 0x07A1, 0x8AA5, 0x1A18, 0x8AA6, 0x1A19,
- 0x8AA7, 0x21AB, 0x8AA8, 0x1A15, 0x8AAA, 0x3638, 0x8AAC, 0x0A86,
- 0x8AAD, 0x0CA1, 0x8AAE, 0x48F7, 0x8AB0, 0x0B6D, 0x8AB2, 0x055D,
- 0x8AB6, 0x4D5F, 0x8AB7, 0x48F9, 0x8AB9, 0x0D84, 0x8ABC, 0x065D,
- 0x8ABE, 0x21AC, 0x8ABF, 0x0BD0, 0x8AC2, 0x1A1E, 0x8AC4, 0x1A1C,
- 0x8AC7, 0x0B8A, 0x8AC9, 0x4D60, 0x8ACB, 0x0A65, 0x8ACC, 0x060E,
- 0x8ACD, 0x1A1D, 0x8ACF, 0x0A21, 0x8AD0, 0x42E7, 0x8AD1, 0x4D61,
- 0x8AD2, 0x0F92, 0x8AD6, 0x0FE6, 0x8AD7, 0x48FA, 0x8ADA, 0x1A1F,
- 0x8ADB, 0x1A2A, 0x8ADC, 0x0BD1, 0x8ADD, 0x4D62, 0x8ADE, 0x1A29,
- 0x8ADF, 0x21AD, 0x8AE0, 0x1A26, 0x8AE1, 0x1A2E, 0x8AE2, 0x1A27,
- 0x8AE4, 0x1A23, 0x8AE6, 0x0C18, 0x8AE7, 0x1A22, 0x8AEB, 0x1A20,
- 0x8AEC, 0x4D63, 0x8AED, 0x0F0B, 0x8AEE, 0x08BE, 0x8AF1, 0x1A24,
- 0x8AF3, 0x1A21, 0x8AF4, 0x3B26, 0x8AF5, 0x4D64, 0x8AF6, 0x21AF,
- 0x8AF7, 0x1A28, 0x8AF8, 0x097E, 0x8AFA, 0x0775, 0x8AFC, 0x48FB,
- 0x8AFE, 0x0B5A, 0x8B00, 0x0E73, 0x8B01, 0x04FC, 0x8B02, 0x04A6,
- 0x8B04, 0x0C7D, 0x8B05, 0x48FE, 0x8B06, 0x4D65, 0x8B07, 0x1A2C,
- 0x8B0A, 0x48FD, 0x8B0C, 0x1A2B, 0x8B0D, 0x48FF, 0x8B0E, 0x0CBE,
- 0x8B0F, 0x4D66, 0x8B10, 0x1A30, 0x8B11, 0x4D67, 0x8B14, 0x1A25,
- 0x8B16, 0x1A2F, 0x8B17, 0x1A31, 0x8B19, 0x0760, 0x8B1A, 0x1A2D,
- 0x8B1B, 0x07E8, 0x8B1C, 0x4900, 0x8B1D, 0x0901, 0x8B1F, 0x3B27,
- 0x8B20, 0x1A32, 0x8B21, 0x0F42, 0x8B26, 0x1A35, 0x8B28, 0x1A38,
- 0x8B2B, 0x1A36, 0x8B2C, 0x0DA7, 0x8B2D, 0x4901, 0x8B33, 0x1A33,
- 0x8B37, 0x3B28, 0x8B39, 0x06D8, 0x8B3E, 0x1A37, 0x8B41, 0x1A39,
- 0x8B43, 0x3B29, 0x8B44, 0x3B2A, 0x8B45, 0x4D68, 0x8B46, 0x42E8,
- 0x8B49, 0x1A3D, 0x8B4C, 0x1A3A, 0x8B4E, 0x1A3C, 0x8B4F, 0x1A3B,
- 0x8B51, 0x4903, 0x8B52, 0x4D69, 0x8B53, 0x21B0, 0x8B54, 0x3B2B,
- 0x8B56, 0x1A3E, 0x8B58, 0x08DD, 0x8B59, 0x42E9, 0x8B5A, 0x1A40,
- 0x8B5B, 0x1A3F, 0x8B5C, 0x0DDA, 0x8B5E, 0x4904, 0x8B5F, 0x1A42,
- 0x8B66, 0x072F, 0x8B69, 0x42EA, 0x8B6B, 0x1A41, 0x8B6C, 0x1A43,
- 0x8B6D, 0x4D6A, 0x8B6F, 0x1A44, 0x8B70, 0x065E, 0x8B71, 0x182E,
- 0x8B72, 0x09E1, 0x8B74, 0x1A45, 0x8B76, 0x4905, 0x8B77, 0x07A2,
- 0x8B78, 0x4D6B, 0x8B7C, 0x4D6C, 0x8B7D, 0x1A46, 0x8B7E, 0x4D6D,
- 0x8B7F, 0x21B1, 0x8B80, 0x1A47, 0x8B81, 0x4906, 0x8B83, 0x088C,
- 0x8B85, 0x4D6E, 0x8B8A, 0x13D3, 0x8B8B, 0x4907, 0x8B8C, 0x1A48,
- 0x8B8E, 0x1A49, 0x8B90, 0x093C, 0x8B92, 0x1A4A, 0x8B93, 0x1A4B,
- 0x8B94, 0x4908, 0x8B95, 0x4909, 0x8B96, 0x1A4C, 0x8B99, 0x1A4D,
- 0x8B9A, 0x1A4E, 0x8B9C, 0x3B2C, 0x8B9D, 0x42EB, 0x8B9E, 0x3B2D,
- 0x8B9F, 0x4D6F, 0x8C37, 0x0B69, 0x8C39, 0x490A, 0x8C3A, 0x1A4F,
- 0x8C3D, 0x490C, 0x8C3F, 0x1A51, 0x8C41, 0x1A50, 0x8C45, 0x490F,
- 0x8C46, 0x0C7E, 0x8C47, 0x3B2E, 0x8C48, 0x1A52, 0x8C49, 0x42EC,
- 0x8C4A, 0x0E5B, 0x8C4B, 0x4D70, 0x8C4C, 0x1A53, 0x8C4E, 0x1A54,
- 0x8C4F, 0x4910, 0x8C50, 0x1A55, 0x8C53, 0x4D71, 0x8C54, 0x3B2F,
- 0x8C55, 0x1A56, 0x8C57, 0x4911, 0x8C5A, 0x0CB2, 0x8C61, 0x09C5,
- 0x8C62, 0x1A57, 0x8C68, 0x42ED, 0x8C69, 0x4912, 0x8C6A, 0x07FD,
- 0x8C6B, 0x1007, 0x8C6C, 0x1A58, 0x8C6D, 0x4913, 0x8C73, 0x3B30,
- 0x8C78, 0x1A59, 0x8C79, 0x0DB1, 0x8C7A, 0x1A5A, 0x8C7B, 0x4D72,
- 0x8C7C, 0x1A62, 0x8C82, 0x1A5B, 0x8C85, 0x1A5D, 0x8C89, 0x1A5C,
- 0x8C8A, 0x1A5E, 0x8C8C, 0x0E74, 0x8C8D, 0x1A5F, 0x8C8E, 0x1A60,
- 0x8C92, 0x4916, 0x8C93, 0x4915, 0x8C94, 0x1A61, 0x8C98, 0x1A63,
- 0x8C99, 0x4917, 0x8C9B, 0x4919, 0x8C9D, 0x058B, 0x8C9E, 0x0C03,
- 0x8C9F, 0x354C, 0x8CA0, 0x0DDB, 0x8CA1, 0x0852, 0x8CA2, 0x07E9,
- 0x8CA4, 0x3B31, 0x8CA7, 0x0DC1, 0x8CA8, 0x055F, 0x8CA9, 0x0D62,
- 0x8CAA, 0x1A66, 0x8CAB, 0x060F, 0x8CAC, 0x0A79, 0x8CAD, 0x1A65,
- 0x8CAE, 0x1A6A, 0x8CAF, 0x0BB7, 0x8CB0, 0x0EEF, 0x8CB2, 0x1A68,
- 0x8CB3, 0x1A69, 0x8CB4, 0x0648, 0x8CB6, 0x1A6B, 0x8CB7, 0x0D19,
- 0x8CB8, 0x0B3F, 0x8CBA, 0x4D73, 0x8CBB, 0x0D85, 0x8CBC, 0x0C37,
- 0x8CBD, 0x1A67, 0x8CBF, 0x0E75, 0x8CC0, 0x056C, 0x8CC1, 0x1A6D,
- 0x8CC2, 0x0FCE, 0x8CC3, 0x0BDE, 0x8CC4, 0x0FEB, 0x8CC5, 0x4D74,
- 0x8CC7, 0x08BF, 0x8CC8, 0x1A6C, 0x8CC9, 0x4D75, 0x8CCA, 0x0B11,
- 0x8CCD, 0x1A7D, 0x8CCE, 0x0AAA, 0x8CD1, 0x0CD0, 0x8CD2, 0x4D76,
- 0x8CD3, 0x0DC2, 0x8CD5, 0x491B, 0x8CD6, 0x491A, 0x8CD9, 0x3B32,
- 0x8CDA, 0x1A70, 0x8CDB, 0x088D, 0x8CDC, 0x08C0, 0x8CDE, 0x09C6,
- 0x8CE0, 0x0D1B, 0x8CE1, 0x3B33, 0x8CE2, 0x0761, 0x8CE3, 0x1A6F,
- 0x8CE4, 0x1A6E, 0x8CE6, 0x0DDC, 0x8CEA, 0x08ED, 0x8CEC, 0x4D77,
- 0x8CED, 0x0C4C, 0x8CF0, 0x21B2, 0x8CF1, 0x491D, 0x8CF4, 0x21B3,
- 0x8CF5, 0x4D78, 0x8CF7, 0x4D79, 0x8CF8, 0x3B34, 0x8CFA, 0x1A72,
- 0x8CFB, 0x1A73, 0x8CFC, 0x07EA, 0x8CFD, 0x1A71, 0x8CFE, 0x3B35,
- 0x8D01, 0x4D7A, 0x8D03, 0x4D7B, 0x8D04, 0x1A74, 0x8D05, 0x1A75,
- 0x8D07, 0x1A77, 0x8D08, 0x0B03, 0x8D09, 0x491F, 0x8D0A, 0x1A76,
- 0x8D0B, 0x0622, 0x8D0D, 0x1A79, 0x8D0E, 0x4920, 0x8D0F, 0x1A78,
- 0x8D10, 0x1A7A, 0x8D12, 0x21B4, 0x8D13, 0x1A7C, 0x8D14, 0x1A7E,
- 0x8D16, 0x1A7F, 0x8D17, 0x4D7C, 0x8D1B, 0x3B36, 0x8D1C, 0x4D7D,
- 0x8D64, 0x0A7A, 0x8D66, 0x08FB, 0x8D67, 0x1A80, 0x8D69, 0x3B37,
- 0x8D6B, 0x05B0, 0x8D6C, 0x3B38, 0x8D6D, 0x1A81, 0x8D6E, 0x4D7E,
- 0x8D70, 0x0AF8, 0x8D71, 0x1A82, 0x8D73, 0x1A83, 0x8D74, 0x0DDD,
- 0x8D76, 0x21B5, 0x8D77, 0x0649, 0x8D81, 0x1A84, 0x8D84, 0x3B39,
- 0x8D85, 0x0BD2, 0x8D8A, 0x04FD, 0x8D8D, 0x3B3A, 0x8D91, 0x4D7F,
- 0x8D95, 0x3B3B, 0x8D99, 0x1A85, 0x8D9F, 0x4D80, 0x8DA3, 0x091D,
- 0x8DA6, 0x3B3C, 0x8DA8, 0x0A3C, 0x8DAB, 0x4D81, 0x8DAF, 0x42EE,
- 0x8DB2, 0x4D82, 0x8DB3, 0x0B0D, 0x8DBA, 0x1A88, 0x8DBE, 0x1A87,
- 0x8DC2, 0x1A86, 0x8DC6, 0x3B3D, 0x8DC8, 0x4921, 0x8DCB, 0x1A8E,
- 0x8DCC, 0x1A8C, 0x8DCE, 0x3B3E, 0x8DCF, 0x1A89, 0x8DD1, 0x42EF,
- 0x8DD5, 0x4D83, 0x8DD6, 0x1A8B, 0x8DD7, 0x42F0, 0x8DD9, 0x4922,
- 0x8DDA, 0x1A8A, 0x8DDB, 0x1A8D, 0x8DDD, 0x0691, 0x8DDF, 0x1A91,
- 0x8DE1, 0x0A7B, 0x8DE3, 0x1A92, 0x8DE4, 0x3B3F, 0x8DE7, 0x4D84,
- 0x8DE8, 0x078D, 0x8DEA, 0x1A8F, 0x8DEB, 0x1A90, 0x8DEC, 0x3B40,
- 0x8DEF, 0x0FCF, 0x8DF1, 0x4D85, 0x8DF2, 0x4D86, 0x8DF3, 0x0BD3,
- 0x8DF4, 0x4D87, 0x8DF5, 0x0AAB, 0x8DFC, 0x1A93, 0x8DFD, 0x4925,
- 0x8DFF, 0x1A96, 0x8E01, 0x4D88, 0x8E06, 0x4926, 0x8E08, 0x1A94,
- 0x8E09, 0x1A95, 0x8E0A, 0x0F43, 0x8E0B, 0x4D89, 0x8E0C, 0x4923,
- 0x8E0F, 0x0C7F, 0x8E10, 0x1A99, 0x8E14, 0x4928, 0x8E16, 0x4929,
- 0x8E1D, 0x1A97, 0x8E1E, 0x1A98, 0x8E1F, 0x1A9A, 0x8E20, 0x3B41,
- 0x8E21, 0x492A, 0x8E22, 0x492B, 0x8E23, 0x42F1, 0x8E26, 0x4D8A,
- 0x8E27, 0x492C, 0x8E2A, 0x1AA8, 0x8E30, 0x1A9D, 0x8E31, 0x4D8B,
- 0x8E34, 0x1A9E, 0x8E35, 0x1A9C, 0x8E36, 0x492F, 0x8E39, 0x4930,
- 0x8E3D, 0x42F2, 0x8E40, 0x4D8C, 0x8E41, 0x4D8D, 0x8E42, 0x1A9B,
- 0x8E44, 0x0C19, 0x8E47, 0x1AA0, 0x8E48, 0x1AA4, 0x8E49, 0x1AA1,
- 0x8E4A, 0x1A9F, 0x8E4B, 0x3B42, 0x8E4C, 0x1AA2, 0x8E4D, 0x4D8E,
- 0x8E4F, 0x4D8F, 0x8E50, 0x1AA3, 0x8E54, 0x4931, 0x8E55, 0x1AAA,
- 0x8E59, 0x1AA5, 0x8E5C, 0x4D90, 0x8E5F, 0x0A7C, 0x8E60, 0x1AA7,
- 0x8E61, 0x4D91, 0x8E62, 0x4932, 0x8E63, 0x1AA9, 0x8E64, 0x1AA6,
- 0x8E69, 0x4D92, 0x8E6C, 0x3B43, 0x8E6D, 0x4933, 0x8E6F, 0x4934,
- 0x8E70, 0x3B44, 0x8E71, 0x4D93, 0x8E72, 0x1AAC, 0x8E74, 0x093D,
- 0x8E75, 0x4D94, 0x8E76, 0x1AAB, 0x8E77, 0x4D95, 0x8E7A, 0x3B45,
- 0x8E7B, 0x42F3, 0x8E7C, 0x1AAD, 0x8E81, 0x1AAE, 0x8E84, 0x1AB1,
- 0x8E85, 0x1AB0, 0x8E87, 0x1AAF, 0x8E89, 0x4D96, 0x8E8A, 0x1AB3,
- 0x8E8B, 0x1AB2, 0x8E8D, 0x0F02, 0x8E90, 0x4D97, 0x8E91, 0x1AB5,
- 0x8E92, 0x3B46, 0x8E93, 0x1AB4, 0x8E94, 0x1AB6, 0x8E95, 0x4D98,
- 0x8E98, 0x4935, 0x8E99, 0x1AB7, 0x8E9A, 0x4D99, 0x8E9E, 0x4936,
- 0x8EA1, 0x1AB9, 0x8EA7, 0x4D9A, 0x8EA9, 0x4D9B, 0x8EAA, 0x1AB8,
- 0x8EAB, 0x0A0E, 0x8EAC, 0x1ABA, 0x8EAD, 0x4D9C, 0x8EAE, 0x3B47,
- 0x8EAF, 0x06E5, 0x8EB0, 0x1ABB, 0x8EB1, 0x1ABD, 0x8EB3, 0x3B48,
- 0x8EB5, 0x4937, 0x8EB6, 0x3703, 0x8EBB, 0x4938, 0x8EBE, 0x1ABE,
- 0x8EC0, 0x1DEF, 0x8EC5, 0x1ABF, 0x8EC6, 0x1ABC, 0x8EC8, 0x1AC0,
- 0x8ECA, 0x0902, 0x8ECB, 0x1AC1, 0x8ECC, 0x064A, 0x8ECD, 0x0709,
- 0x8ECF, 0x21B7, 0x8ED1, 0x3B49, 0x8ED2, 0x0762, 0x8ED4, 0x3B4A,
- 0x8EDB, 0x1AC2, 0x8EDF, 0x0CC8, 0x8EE2, 0x0C38, 0x8EE3, 0x1AC3,
- 0x8EE8, 0x4D9D, 0x8EEB, 0x1AC6, 0x8EF0, 0x4D9E, 0x8EF8, 0x08E0,
- 0x8EF9, 0x3B4B, 0x8EFA, 0x42F6, 0x8EFB, 0x1AC5, 0x8EFC, 0x1AC4,
- 0x8EFD, 0x0730, 0x8EFE, 0x1AC7, 0x8F00, 0x493C, 0x8F03, 0x05B1,
- 0x8F05, 0x1AC9, 0x8F07, 0x4D9F, 0x8F08, 0x493D, 0x8F09, 0x084C,
- 0x8F0A, 0x1AC8, 0x8F0C, 0x1AD1, 0x8F12, 0x1ACB, 0x8F13, 0x1ACD,
- 0x8F14, 0x0E35, 0x8F15, 0x1ACA, 0x8F17, 0x3B4C, 0x8F18, 0x4DA0,
- 0x8F19, 0x1ACC, 0x8F1B, 0x1AD0, 0x8F1C, 0x1ACE, 0x8F1D, 0x064B,
- 0x8F1E, 0x42F7, 0x8F1F, 0x1ACF, 0x8F25, 0x4DA1, 0x8F26, 0x1AD2,
- 0x8F27, 0x4DA2, 0x8F29, 0x0D10, 0x8F2A, 0x0FA0, 0x8F2B, 0x493E,
- 0x8F2C, 0x4DA3, 0x8F2D, 0x42F8, 0x8F2F, 0x093E, 0x8F33, 0x1AD3,
- 0x8F35, 0x4DA4, 0x8F36, 0x3B4D, 0x8F38, 0x0F0C, 0x8F39, 0x1AD5,
- 0x8F3A, 0x4DA5, 0x8F3B, 0x1AD4, 0x8F3E, 0x1AD8, 0x8F3F, 0x0F2B,
- 0x8F40, 0x493F, 0x8F42, 0x1AD7, 0x8F43, 0x4DA6, 0x8F44, 0x05CB,
- 0x8F45, 0x1AD6, 0x8F46, 0x1ADB, 0x8F47, 0x4DA7, 0x8F49, 0x1ADA,
- 0x8F4A, 0x4940, 0x8F4C, 0x1AD9, 0x8F4D, 0x0C2C, 0x8F4E, 0x1ADC,
- 0x8F51, 0x4DA8, 0x8F54, 0x42F9, 0x8F55, 0x4DA9, 0x8F57, 0x1ADD,
- 0x8F58, 0x4941, 0x8F5C, 0x1ADE, 0x8F5F, 0x07FE, 0x8F61, 0x06FB,
- 0x8F62, 0x1ADF, 0x8F63, 0x1AE0, 0x8F64, 0x1AE1, 0x8F9B, 0x0A0F,
- 0x8F9C, 0x1AE2, 0x8F9E, 0x08D9, 0x8F9F, 0x1AE3, 0x8FA0, 0x4DAA,
- 0x8FA1, 0x4DAB, 0x8FA2, 0x4DAC, 0x8FA3, 0x1AE4, 0x8FA4, 0x4943,
- 0x8FA5, 0x4DAD, 0x8FA6, 0x3B4E, 0x8FA7, 0x10B6, 0x8FA8, 0x10B5,
- 0x8FAD, 0x1AE5, 0x8FAE, 0x17FF, 0x8FAF, 0x1AE6, 0x8FB0, 0x0B62,
- 0x8FB1, 0x09F1, 0x8FB2, 0x0CF6, 0x8FB4, 0x4944, 0x8FB5, 0x3B4F,
- 0x8FB6, 0x3B50, 0x8FB7, 0x1AE7, 0x8FBA, 0x0E25, 0x8FBB, 0x0BF0,
- 0x8FBC, 0x0810, 0x8FBF, 0x0B67, 0x8FC1, 0x4946, 0x8FC2, 0x04CC,
- 0x8FC4, 0x0EA6, 0x8FC5, 0x0A1D, 0x8FC6, 0x4947, 0x8FC8, 0x3799,
- 0x8FCA, 0x4949, 0x8FCD, 0x494A, 0x8FCE, 0x0734, 0x8FD1, 0x06D9,
- 0x8FD3, 0x494B, 0x8FD4, 0x0E26, 0x8FD5, 0x494C, 0x8FDA, 0x1AE8,
- 0x8FE0, 0x3B52, 0x8FE2, 0x1AEA, 0x8FE4, 0x3B53, 0x8FE5, 0x1AE9,
- 0x8FE6, 0x0560, 0x8FE8, 0x42FB, 0x8FE9, 0x0CCE, 0x8FEA, 0x1AEB,
- 0x8FEB, 0x0D2D, 0x8FED, 0x0C2D, 0x8FEE, 0x42FC, 0x8FEF, 0x1AEC,
- 0x8FF0, 0x095C, 0x8FF1, 0x494D, 0x8FF4, 0x1AEE, 0x8FF5, 0x494E,
- 0x8FF6, 0x3B54, 0x8FF7, 0x0ECE, 0x8FF8, 0x1AFD, 0x8FF9, 0x1AF0,
- 0x8FFA, 0x1AF1, 0x8FFB, 0x494F, 0x8FFD, 0x0BE5, 0x9000, 0x0B40,
- 0x9001, 0x0AF9, 0x9002, 0x3B55, 0x9003, 0x0C80, 0x9004, 0x4DAE,
- 0x9005, 0x1AEF, 0x9006, 0x066F, 0x9008, 0x42FD, 0x900B, 0x1AF8,
- 0x900C, 0x4950, 0x900D, 0x1AF5, 0x900E, 0x1B02, 0x900F, 0x0C81,
- 0x9010, 0x0B9E, 0x9011, 0x1AF2, 0x9013, 0x0C1A, 0x9014, 0x0C4D,
- 0x9015, 0x1AF3, 0x9016, 0x1AF7, 0x9017, 0x0A26, 0x9019, 0x0D1D,
- 0x901A, 0x0BE8, 0x901B, 0x4DAF, 0x901D, 0x0A66, 0x901E, 0x1AF6,
- 0x901F, 0x0B0E, 0x9020, 0x0B04, 0x9021, 0x1AF4, 0x9022, 0x046D,
- 0x9023, 0x0FC8, 0x9027, 0x1AF9, 0x902C, 0x3B56, 0x902D, 0x42FE,
- 0x902E, 0x0B41, 0x902F, 0x4DB0, 0x9031, 0x093F, 0x9032, 0x0A10,
- 0x9035, 0x1AFB, 0x9036, 0x1AFA, 0x9037, 0x4951, 0x9038, 0x04B3,
- 0x9039, 0x1AFC, 0x903C, 0x0DA1, 0x903E, 0x1B04, 0x9041, 0x0CB3,
- 0x9042, 0x0A31, 0x9043, 0x4953, 0x9044, 0x3B57, 0x9045, 0x0B97,
- 0x9047, 0x06F0, 0x9049, 0x1B03, 0x904A, 0x0F21, 0x904B, 0x04E1,
- 0x904C, 0x4DB1, 0x904D, 0x0E27, 0x904E, 0x0561, 0x904F, 0x1AFE,
- 0x9050, 0x1AFF, 0x9051, 0x1B00, 0x9052, 0x1B01, 0x9053, 0x0C93,
- 0x9054, 0x0B61, 0x9055, 0x04A7, 0x9056, 0x1B05, 0x9058, 0x1B06,
- 0x9059, 0x1D34, 0x905B, 0x4DB2, 0x905C, 0x0B1D, 0x905D, 0x4954,
- 0x905E, 0x1B07, 0x9060, 0x0515, 0x9061, 0x0ACE, 0x9063, 0x0763,
- 0x9065, 0x0F44, 0x9067, 0x21BA, 0x9068, 0x1B08, 0x9069, 0x0C26,
- 0x906D, 0x0AFA, 0x906E, 0x0903, 0x906F, 0x1B09, 0x9070, 0x4DB3,
- 0x9072, 0x1B0C, 0x9074, 0x4DB4, 0x9075, 0x096F, 0x9076, 0x1B0A,
- 0x9077, 0x0AAD, 0x9078, 0x0AAC, 0x9079, 0x4DB5, 0x907A, 0x04A8,
- 0x907C, 0x0F93, 0x907D, 0x1B0E, 0x907F, 0x0D86, 0x9080, 0x1B10,
- 0x9081, 0x1B0F, 0x9082, 0x1B0D, 0x9083, 0x1737, 0x9084, 0x0610,
- 0x9085, 0x4957, 0x9087, 0x1AED, 0x9088, 0x3B58, 0x9089, 0x1B12,
- 0x908A, 0x1B11, 0x908B, 0x4DB6, 0x908C, 0x4958, 0x908F, 0x1B13,
- 0x9090, 0x4959, 0x9091, 0x0F22, 0x9095, 0x3B59, 0x9097, 0x42FF,
- 0x9098, 0x4DB7, 0x9099, 0x3B5A, 0x909B, 0x3B5B, 0x90A0, 0x4DB8,
- 0x90A1, 0x495A, 0x90A2, 0x3B5C, 0x90A3, 0x0CB9, 0x90A6, 0x0E5C,
- 0x90A8, 0x1B14, 0x90AA, 0x0905, 0x90AF, 0x1B15, 0x90B0, 0x495C,
- 0x90B1, 0x1B16, 0x90B2, 0x4DB9, 0x90B3, 0x4300, 0x90B4, 0x3B5D,
- 0x90B5, 0x1B17, 0x90B6, 0x495D, 0x90B8, 0x0C1B, 0x90BD, 0x4DBA,
- 0x90BE, 0x4301, 0x90C1, 0x04AE, 0x90C3, 0x495E, 0x90C4, 0x4302,
- 0x90C5, 0x4303, 0x90C7, 0x4304, 0x90C8, 0x495F, 0x90C9, 0x4DBB,
- 0x90CA, 0x07EB, 0x90CE, 0x0FE0, 0x90D7, 0x3B5E, 0x90DB, 0x1B1B,
- 0x90DC, 0x4961, 0x90DD, 0x3B5F, 0x90DE, 0x21BB, 0x90DF, 0x4962,
- 0x90E1, 0x070A, 0x90E2, 0x1B18, 0x90E4, 0x1B19, 0x90E8, 0x0DE6,
- 0x90EB, 0x4967, 0x90ED, 0x05B2, 0x90EF, 0x4305, 0x90F0, 0x4DBC,
- 0x90F2, 0x4965, 0x90F4, 0x3B60, 0x90F5, 0x0F23, 0x90F6, 0x4964,
- 0x90F7, 0x06B7, 0x90FD, 0x0C4E, 0x90FE, 0x4968, 0x90FF, 0x4969,
- 0x9100, 0x4966, 0x9102, 0x1B1C, 0x9104, 0x496A, 0x9105, 0x4DBD,
- 0x9106, 0x496B, 0x9112, 0x1B1D, 0x9114, 0x4306, 0x9115, 0x21BD,
- 0x9116, 0x4307, 0x9117, 0x3B61, 0x9118, 0x496C, 0x9119, 0x1B1E,
- 0x911C, 0x3B62, 0x911E, 0x496D, 0x9122, 0x4308, 0x9123, 0x4309,
- 0x9125, 0x4DBE, 0x9127, 0x21BE, 0x912D, 0x0C1C, 0x912F, 0x430A,
- 0x9130, 0x1B20, 0x9131, 0x3B63, 0x9132, 0x1B1F, 0x9134, 0x430B,
- 0x9137, 0x496E, 0x9139, 0x496F, 0x913A, 0x3B64, 0x913D, 0x3B65,
- 0x9146, 0x4970, 0x9147, 0x4971, 0x9148, 0x3B66, 0x9149, 0x0CAB,
- 0x914A, 0x1B21, 0x914B, 0x0940, 0x914C, 0x090C, 0x914D, 0x0D11,
- 0x914E, 0x0BAF, 0x9152, 0x091E, 0x9154, 0x0A32, 0x9156, 0x1B22,
- 0x9157, 0x4972, 0x9158, 0x1B23, 0x9159, 0x4973, 0x915A, 0x4DBF,
- 0x915B, 0x3B67, 0x9161, 0x3B68, 0x9162, 0x0A23, 0x9163, 0x1B24,
- 0x9164, 0x3B69, 0x9165, 0x1B25, 0x9167, 0x4DC0, 0x9169, 0x1B26,
- 0x916A, 0x0F59, 0x916C, 0x0941, 0x9172, 0x1B28, 0x9173, 0x1B27,
- 0x9174, 0x4974, 0x9175, 0x07EC, 0x9177, 0x0805, 0x9178, 0x088E,
- 0x9179, 0x4975, 0x917A, 0x4DC1, 0x9182, 0x1B2B, 0x9183, 0x430C,
- 0x9185, 0x4976, 0x9187, 0x0970, 0x9189, 0x1B2A, 0x918A, 0x4DC2,
- 0x918B, 0x1B29, 0x918D, 0x0B49, 0x918E, 0x3B6A, 0x9190, 0x07A3,
- 0x9191, 0x4DC3, 0x9192, 0x0A67, 0x9195, 0x4DC4, 0x9197, 0x0D44,
- 0x919C, 0x0943, 0x919E, 0x3B6B, 0x91A2, 0x1B2C, 0x91A4, 0x09C7,
- 0x91A8, 0x3B6C, 0x91AA, 0x1B2F, 0x91AB, 0x1B2D, 0x91AC, 0x1E1B,
- 0x91AD, 0x3B6D, 0x91AE, 0x3B6E, 0x91AF, 0x1B2E, 0x91B0, 0x4DC5,
- 0x91B1, 0x1E61, 0x91B2, 0x3B6F, 0x91B3, 0x4977, 0x91B4, 0x1B31,
- 0x91B5, 0x1B30, 0x91B6, 0x4978, 0x91B8, 0x09E2, 0x91BA, 0x1B32,
- 0x91BB, 0x4DC6, 0x91BC, 0x3B70, 0x91BD, 0x4DC7, 0x91C0, 0x1B33,
- 0x91C1, 0x1B34, 0x91C2, 0x4DC8, 0x91C3, 0x4979, 0x91C4, 0x497A,
- 0x91C5, 0x4DC9, 0x91C6, 0x0D64, 0x91C7, 0x0843, 0x91C8, 0x090D,
- 0x91C9, 0x1B35, 0x91CB, 0x1B36, 0x91CC, 0x0F6C, 0x91CD, 0x094F,
- 0x91CE, 0x0EFA, 0x91CF, 0x0F94, 0x91D0, 0x1B37, 0x91D1, 0x06DA,
- 0x91D6, 0x1B38, 0x91D7, 0x21C0, 0x91D8, 0x0C1D, 0x91DA, 0x21BF,
- 0x91DB, 0x1B3B, 0x91DC, 0x05D6, 0x91DD, 0x0A11, 0x91DE, 0x21C1,
- 0x91DF, 0x1B39, 0x91E1, 0x1B3A, 0x91E3, 0x0BFC, 0x91E4, 0x21C4,
- 0x91E5, 0x21C5, 0x91E6, 0x0E83, 0x91E7, 0x06F4, 0x91EC, 0x497D,
- 0x91ED, 0x21C2, 0x91EE, 0x21C3, 0x91F0, 0x3B71, 0x91F1, 0x430D,
- 0x91F5, 0x1B3D, 0x91F6, 0x1B3E, 0x91F7, 0x3B72, 0x91FB, 0x3B73,
- 0x91FC, 0x1B3C, 0x91FF, 0x1B40, 0x9200, 0x4DCA, 0x9201, 0x497E,
- 0x9206, 0x21C6, 0x9207, 0x3B74, 0x9209, 0x4DCB, 0x920A, 0x21C8,
- 0x920D, 0x0CB7, 0x920E, 0x05A1, 0x9210, 0x21C7, 0x9211, 0x1B44,
- 0x9214, 0x1B41, 0x9215, 0x1B43, 0x9216, 0x497F, 0x9217, 0x4980,
- 0x921E, 0x1B3F, 0x9223, 0x4DCC, 0x9228, 0x3B75, 0x9229, 0x1B8A,
- 0x922C, 0x1B42, 0x9233, 0x3B76, 0x9234, 0x0FB3, 0x9237, 0x078E,
- 0x9238, 0x3B77, 0x9239, 0x21CF, 0x923A, 0x21C9, 0x923C, 0x21CB,
- 0x923F, 0x1B4C, 0x9240, 0x21CA, 0x9242, 0x4982, 0x9243, 0x3B78,
- 0x9244, 0x0C2E, 0x9245, 0x1B47, 0x9247, 0x3B79, 0x9248, 0x1B4A,
- 0x9249, 0x1B48, 0x924A, 0x4983, 0x924B, 0x1B4D, 0x924E, 0x21CC,
- 0x924F, 0x3B7A, 0x9250, 0x1B4E, 0x9251, 0x21CE, 0x9256, 0x4984,
- 0x9257, 0x1B46, 0x9259, 0x21CD, 0x925A, 0x1B53, 0x925B, 0x0516,
- 0x925E, 0x1B45, 0x9260, 0x3B7B, 0x9261, 0x4985, 0x9262, 0x0D41,
- 0x9264, 0x1B49, 0x9265, 0x4986, 0x9266, 0x09C8, 0x9267, 0x21D0,
- 0x9268, 0x4987, 0x9271, 0x07ED, 0x9276, 0x4DCD, 0x9277, 0x21D2,
- 0x9278, 0x21D3, 0x927C, 0x4989, 0x927D, 0x498A, 0x927E, 0x0E76,
- 0x927F, 0x498B, 0x9280, 0x06DC, 0x9283, 0x0950, 0x9285, 0x0C94,
- 0x9288, 0x20AA, 0x9289, 0x498C, 0x928D, 0x498D, 0x928E, 0x4DCE,
- 0x9291, 0x0AAF, 0x9293, 0x1B51, 0x9295, 0x1B4B, 0x9296, 0x1B50,
- 0x9297, 0x498E, 0x9298, 0x0ECF, 0x9299, 0x498F, 0x929A, 0x0BD4,
- 0x929B, 0x1B52, 0x929C, 0x1B4F, 0x929F, 0x4990, 0x92A7, 0x21D1,
- 0x92AB, 0x4991, 0x92AD, 0x0AAE, 0x92AF, 0x4DCF, 0x92B2, 0x4994,
- 0x92B3, 0x3554, 0x92B7, 0x1B56, 0x92B9, 0x1B55, 0x92BB, 0x4DD0,
- 0x92BC, 0x4DD1, 0x92BF, 0x4995, 0x92C0, 0x4996, 0x92C1, 0x4DD2,
- 0x92C2, 0x3B7C, 0x92C3, 0x4DD3, 0x92C5, 0x4DD4, 0x92C6, 0x4997,
- 0x92C8, 0x4DD5, 0x92CB, 0x3B7D, 0x92CC, 0x3B7E, 0x92CE, 0x4998,
- 0x92CF, 0x1B54, 0x92D0, 0x21D7, 0x92D2, 0x0E5D, 0x92D3, 0x21DB,
- 0x92D5, 0x21D9, 0x92D7, 0x21D5, 0x92D9, 0x21D6, 0x92DF, 0x3B7F,
- 0x92E0, 0x21DA, 0x92E4, 0x0985, 0x92E5, 0x4999, 0x92E7, 0x21D4,
- 0x92E9, 0x1B57, 0x92EA, 0x0E2F, 0x92ED, 0x04F6, 0x92F2, 0x0DB8,
- 0x92F3, 0x0BB0, 0x92F7, 0x499D, 0x92F8, 0x0692, 0x92F9, 0x20B0,
- 0x92FA, 0x1B59, 0x92FB, 0x21DE, 0x92FC, 0x07EF, 0x92FF, 0x21E1,
- 0x9302, 0x21E3, 0x9304, 0x345A, 0x9306, 0x087A, 0x930D, 0x3B80,
- 0x930F, 0x1B58, 0x9310, 0x0A33, 0x9311, 0x499A, 0x9314, 0x4DD6,
- 0x9315, 0x3B81, 0x9318, 0x0A34, 0x9319, 0x1B5C, 0x931A, 0x1B5E,
- 0x931D, 0x21E2, 0x931E, 0x21E0, 0x931F, 0x3B82, 0x9320, 0x09E3,
- 0x9321, 0x21DD, 0x9322, 0x1B5D, 0x9323, 0x1B5F, 0x9325, 0x21DC,
- 0x9326, 0x06CB, 0x9327, 0x3B83, 0x9328, 0x0DB7, 0x9329, 0x499E,
- 0x932B, 0x090E, 0x932C, 0x0FC9, 0x932E, 0x1B5B, 0x932F, 0x0868,
- 0x9332, 0x0FE5, 0x9333, 0x4DD7, 0x9335, 0x1B61, 0x9336, 0x4DD8,
- 0x933A, 0x1B60, 0x933B, 0x1B62, 0x9344, 0x1B5A, 0x9347, 0x3B84,
- 0x9348, 0x20A9, 0x9349, 0x430E, 0x934A, 0x3458, 0x934B, 0x0CC1,
- 0x934D, 0x0C4F, 0x9351, 0x49A1, 0x9352, 0x3B85, 0x9354, 0x0BF3,
- 0x9356, 0x1B67, 0x9357, 0x21E5, 0x9358, 0x4DD9, 0x935A, 0x49A2,
- 0x935B, 0x0B81, 0x935C, 0x1B63, 0x9360, 0x1B64, 0x9364, 0x430F,
- 0x9365, 0x4310, 0x936A, 0x3B87, 0x936B, 0x49A3, 0x936C, 0x0703,
- 0x936D, 0x3B88, 0x936E, 0x1B66, 0x9370, 0x21E4, 0x9371, 0x49A4,
- 0x9373, 0x49A5, 0x9375, 0x0764, 0x937C, 0x1B65, 0x937E, 0x09C9,
- 0x937F, 0x4DDA, 0x9382, 0x4DDB, 0x9388, 0x49A9, 0x938A, 0x4DDC,
- 0x938B, 0x49AA, 0x938C, 0x05D7, 0x938F, 0x49AB, 0x9394, 0x1B6B,
- 0x9396, 0x082F, 0x9397, 0x0AFB, 0x939A, 0x0BE6, 0x939B, 0x3B89,
- 0x939E, 0x49AC, 0x93A1, 0x49A6, 0x93A3, 0x4311, 0x93A4, 0x21E6,
- 0x93A7, 0x0599, 0x93A9, 0x3B8B, 0x93AC, 0x1B69, 0x93AD, 0x1B6A,
- 0x93AE, 0x0BDF, 0x93B0, 0x1B68, 0x93B9, 0x1B6C, 0x93BA, 0x3B8A,
- 0x93BB, 0x4DDD, 0x93C1, 0x3B8C, 0x93C3, 0x1B72, 0x93C6, 0x21E7,
- 0x93C7, 0x49B1, 0x93C8, 0x1B75, 0x93CA, 0x3B8D, 0x93CC, 0x4DDE,
- 0x93D0, 0x1B74, 0x93D1, 0x0C27, 0x93D6, 0x1B6D, 0x93D7, 0x1B6E,
- 0x93D8, 0x1B71, 0x93DC, 0x49B2, 0x93DD, 0x1B73, 0x93DE, 0x21E8,
- 0x93DF, 0x4312, 0x93E1, 0x06B8, 0x93E2, 0x3B8E, 0x93E4, 0x1B76,
- 0x93E5, 0x1B70, 0x93E6, 0x4DDF, 0x93E7, 0x49B3, 0x93E8, 0x1B6F,
- 0x93F1, 0x49B0, 0x93F5, 0x49AD, 0x93F8, 0x21E9, 0x93F9, 0x4DE0,
- 0x93FA, 0x3B8F, 0x93FB, 0x49B7, 0x93FD, 0x3B90, 0x9402, 0x4DE1,
- 0x9403, 0x1B7A, 0x9404, 0x4313, 0x9407, 0x1B7B, 0x9409, 0x49B4,
- 0x940D, 0x4DE2, 0x940E, 0x4DE3, 0x940F, 0x3B91, 0x9410, 0x1B7C,
- 0x9413, 0x1B79, 0x9414, 0x1B78, 0x9416, 0x49B5, 0x9417, 0x49B6,
- 0x9418, 0x09CA, 0x9419, 0x0C82, 0x941A, 0x1B77, 0x9421, 0x1B80,
- 0x942B, 0x1B7E, 0x942E, 0x4DE4, 0x9431, 0x21EA, 0x9432, 0x49B8,
- 0x9433, 0x4314, 0x9434, 0x3B92, 0x9435, 0x1B7F, 0x9436, 0x1B7D,
- 0x9438, 0x0B58, 0x943A, 0x1B81, 0x943B, 0x49B9, 0x943F, 0x3B93,
- 0x9441, 0x1B82, 0x9444, 0x1B84, 0x9445, 0x21EB, 0x9448, 0x21EC,
- 0x944A, 0x4315, 0x944C, 0x4DE5, 0x9451, 0x0611, 0x9452, 0x1B83,
- 0x9453, 0x0F06, 0x9455, 0x3B94, 0x945A, 0x1B8F, 0x945B, 0x1B85,
- 0x945E, 0x1B88, 0x9460, 0x1B86, 0x9462, 0x1B87, 0x9463, 0x4316,
- 0x946A, 0x1B89, 0x946B, 0x3B95, 0x946D, 0x49BC, 0x946F, 0x49BD,
- 0x9470, 0x1B8B, 0x9471, 0x4317, 0x9472, 0x3B96, 0x9475, 0x1B8C,
- 0x9477, 0x1B8D, 0x947C, 0x1B90, 0x947D, 0x1B8E, 0x947E, 0x1B91,
- 0x947F, 0x1B93, 0x9481, 0x1B92, 0x9577, 0x0BD5, 0x9578, 0x3B97,
- 0x9579, 0x49BE, 0x9580, 0x0EF3, 0x9582, 0x1B94, 0x9583, 0x0AB0,
- 0x9586, 0x49BF, 0x9587, 0x1B95, 0x9588, 0x4DE6, 0x9589, 0x0E14,
- 0x958A, 0x1B96, 0x958B, 0x0589, 0x958C, 0x49C0, 0x958D, 0x49C1,
- 0x958E, 0x4318, 0x958F, 0x04DE, 0x9591, 0x0613, 0x9592, 0x21ED,
- 0x9593, 0x0612, 0x9594, 0x1B97, 0x9596, 0x1B98, 0x9598, 0x1B99,
- 0x9599, 0x1B9A, 0x959F, 0x4319, 0x95A0, 0x1B9B, 0x95A1, 0x4DE7,
- 0x95A2, 0x0614, 0x95A3, 0x05B3, 0x95A4, 0x07F0, 0x95A5, 0x0D4A,
- 0x95A6, 0x3B98, 0x95A7, 0x1B9D, 0x95A8, 0x1B9C, 0x95A9, 0x3B99,
- 0x95AB, 0x4F59, 0x95AC, 0x431A, 0x95AD, 0x1B9E, 0x95B1, 0x3555,
- 0x95B2, 0x04FE, 0x95B4, 0x3B9B, 0x95B6, 0x431B, 0x95B9, 0x1BA1,
- 0x95BB, 0x1BA0, 0x95BC, 0x1B9F, 0x95BD, 0x3B9C, 0x95BE, 0x1BA2,
- 0x95BF, 0x4DE8, 0x95C3, 0x1BA5, 0x95C6, 0x4DE9, 0x95C7, 0x048B,
- 0x95C8, 0x49C4, 0x95C9, 0x4DEA, 0x95CA, 0x1BA3, 0x95CB, 0x431C,
- 0x95CC, 0x1BA7, 0x95CD, 0x1BA6, 0x95D0, 0x431D, 0x95D1, 0x4DEB,
- 0x95D2, 0x4DEC, 0x95D3, 0x431E, 0x95D4, 0x1BA9, 0x95D5, 0x1BA8,
- 0x95D6, 0x1BAA, 0x95D8, 0x0C86, 0x95DA, 0x3B9D, 0x95DC, 0x1BAB,
- 0x95DE, 0x4320, 0x95E0, 0x4DED, 0x95E1, 0x1BAC, 0x95E2, 0x1BAE,
- 0x95E4, 0x4DEE, 0x95E5, 0x1BAD, 0x95E6, 0x4DEF, 0x961C, 0x0DDE,
- 0x961D, 0x3B9E, 0x9621, 0x1BAF, 0x9624, 0x4DF0, 0x9628, 0x1BB0,
- 0x962A, 0x0855, 0x962C, 0x49C7, 0x962E, 0x1BB1, 0x962F, 0x1BB2,
- 0x9631, 0x4DF1, 0x9632, 0x0E77, 0x9633, 0x49C8, 0x9634, 0x49C9,
- 0x9638, 0x4DF2, 0x963B, 0x0ACD, 0x963C, 0x49CB, 0x963D, 0x4DF3,
- 0x963F, 0x0468, 0x9640, 0x0B2B, 0x9641, 0x3B9F, 0x9642, 0x1BB3,
- 0x9644, 0x0DDF, 0x964B, 0x1BB6, 0x964C, 0x1BB4, 0x964D, 0x07F1,
- 0x964F, 0x1BB5, 0x9650, 0x0776, 0x9654, 0x4DF4, 0x9658, 0x3BA0,
- 0x965B, 0x0E15, 0x965C, 0x1BB8, 0x965D, 0x1BBA, 0x965E, 0x1BB9,
- 0x965F, 0x1BBB, 0x9661, 0x49CC, 0x9662, 0x04C3, 0x9663, 0x0A1E,
- 0x9664, 0x0986, 0x9665, 0x0615, 0x9666, 0x1BBC, 0x966A, 0x0D1C,
- 0x966C, 0x1BBE, 0x9670, 0x04C4, 0x9672, 0x1BBD, 0x9673, 0x0BE0,
- 0x9674, 0x4DF5, 0x9675, 0x0F95, 0x9676, 0x0C83, 0x9677, 0x1BB7,
- 0x9678, 0x0F6E, 0x967A, 0x0765, 0x967B, 0x4DF6, 0x967D, 0x0F45,
- 0x967F, 0x4DF7, 0x9681, 0x4DF8, 0x9682, 0x49CE, 0x9683, 0x4DF9,
- 0x9684, 0x3BA1, 0x9685, 0x06F1, 0x9686, 0x0F7C, 0x9688, 0x06FE,
- 0x9689, 0x4DFA, 0x968A, 0x0B42, 0x968B, 0x186C, 0x968D, 0x1BBF,
- 0x968E, 0x058A, 0x968F, 0x0A35, 0x9694, 0x05B4, 0x9695, 0x1BC1,
- 0x9696, 0x4DFB, 0x9697, 0x1BC2, 0x9698, 0x1BC0, 0x9699, 0x073A,
- 0x969A, 0x49D0, 0x969B, 0x084D, 0x969C, 0x09CB, 0x969D, 0x21F0,
- 0x96A0, 0x04C5, 0x96A3, 0x0FA1, 0x96A4, 0x3BA2, 0x96A5, 0x4321,
- 0x96A7, 0x1BC4, 0x96A8, 0x1B0B, 0x96A9, 0x3BA3, 0x96AA, 0x1BC3,
- 0x96AE, 0x4DFC, 0x96AF, 0x21F1, 0x96B0, 0x1BC7, 0x96B1, 0x1BC5,
- 0x96B2, 0x1BC6, 0x96B3, 0x49D3, 0x96B4, 0x1BC8, 0x96B6, 0x1BC9,
- 0x96B7, 0x0FB4, 0x96B8, 0x1BCA, 0x96B9, 0x1BCB, 0x96BA, 0x49D4,
- 0x96BB, 0x0A6D, 0x96BC, 0x0D4F, 0x96BD, 0x49D5, 0x96C0, 0x0A43,
- 0x96C1, 0x0623, 0x96C4, 0x0F24, 0x96C5, 0x056D, 0x96C6, 0x0942,
- 0x96C7, 0x078F, 0x96C9, 0x1BCE, 0x96CB, 0x1BCD, 0x96CC, 0x08C1,
- 0x96CD, 0x1BCF, 0x96CE, 0x1BCC, 0x96D1, 0x0876, 0x96D2, 0x3BA4,
- 0x96D5, 0x1BD3, 0x96D6, 0x1992, 0x96D8, 0x49D8, 0x96D9, 0x10EB,
- 0x96DA, 0x49D9, 0x96DB, 0x0A3D, 0x96DC, 0x1BD1, 0x96DD, 0x49DA,
- 0x96DE, 0x3BA6, 0x96E2, 0x0F6D, 0x96E3, 0x0CC9, 0x96E8, 0x04CD,
- 0x96E9, 0x3BA7, 0x96EA, 0x0A87, 0x96EB, 0x08E2, 0x96EF, 0x4322,
- 0x96F0, 0x0E07, 0x96F1, 0x3BA8, 0x96F2, 0x04E2, 0x96F6, 0x0FB5,
- 0x96F7, 0x0F55, 0x96F9, 0x1BD4, 0x96FB, 0x0C3F, 0x9700, 0x0927,
- 0x9702, 0x3BA9, 0x9703, 0x4DFD, 0x9704, 0x1BD5, 0x9706, 0x1BD6,
- 0x9707, 0x0A12, 0x9708, 0x1BD7, 0x9709, 0x3BAA, 0x970A, 0x0FB6,
- 0x970D, 0x1BD2, 0x970E, 0x1BD9, 0x970F, 0x1BDB, 0x9711, 0x1BDA,
- 0x9713, 0x1BD8, 0x9714, 0x49DC, 0x9716, 0x1BDC, 0x9719, 0x1BDD,
- 0x971B, 0x4DFE, 0x971C, 0x0AFC, 0x971E, 0x0562, 0x9721, 0x4DFF,
- 0x9722, 0x4E00, 0x9723, 0x49DD, 0x9724, 0x1BDE, 0x9727, 0x0EC4,
- 0x9728, 0x4E01, 0x972A, 0x1BDF, 0x9730, 0x1BE0, 0x9731, 0x4E02,
- 0x9732, 0x0FD0, 0x9733, 0x21F2, 0x9736, 0x49DF, 0x9738, 0x1414,
- 0x9739, 0x1BE1, 0x973B, 0x21F3, 0x973D, 0x1BE2, 0x973E, 0x1BE3,
- 0x9741, 0x49E0, 0x9742, 0x1BE7, 0x9743, 0x21F4, 0x9744, 0x1BE4,
- 0x9746, 0x1BE5, 0x9747, 0x49E1, 0x9748, 0x1BE6, 0x9749, 0x1BE8,
- 0x974D, 0x21F5, 0x974E, 0x4323, 0x974F, 0x21F6, 0x9751, 0x21F7,
- 0x9752, 0x0A68, 0x9755, 0x4F5A, 0x9756, 0x0F03, 0x9757, 0x49E2,
- 0x9759, 0x0A69, 0x975A, 0x3BAB, 0x975B, 0x49E3, 0x975C, 0x1BE9,
- 0x975E, 0x0D87, 0x9760, 0x1BEA, 0x9761, 0x1D06, 0x9762, 0x0ED8,
- 0x9763, 0x3BAC, 0x9764, 0x1BEB, 0x9766, 0x1BEC, 0x9767, 0x4E03,
- 0x9768, 0x1BED, 0x9769, 0x05B5, 0x976A, 0x49E4, 0x976B, 0x1BEF,
- 0x976D, 0x0A1F, 0x976E, 0x3BAD, 0x9771, 0x1BF0, 0x9773, 0x3BAE,
- 0x9774, 0x06FA, 0x9776, 0x4E04, 0x9779, 0x1BF1, 0x977A, 0x1BF5,
- 0x977C, 0x1BF3, 0x977D, 0x4E05, 0x977F, 0x4E06, 0x9781, 0x1BF4,
- 0x9784, 0x05D1, 0x9785, 0x1BF2, 0x9786, 0x1BF6, 0x978B, 0x1BF7,
- 0x978D, 0x048C, 0x978F, 0x1BF8, 0x9790, 0x1BF9, 0x9795, 0x4324,
- 0x9796, 0x49E7, 0x9798, 0x09CC, 0x9799, 0x4E07, 0x979A, 0x3BAF,
- 0x979C, 0x1BFA, 0x979E, 0x49E8, 0x979F, 0x4E08, 0x97A0, 0x0661,
- 0x97A2, 0x3BB0, 0x97A3, 0x1BFD, 0x97A6, 0x1BFC, 0x97A8, 0x1BFB,
- 0x97AB, 0x1A34, 0x97AC, 0x4E09, 0x97AD, 0x0E2C, 0x97AE, 0x4325,
- 0x97B1, 0x49E9, 0x97B2, 0x49EA, 0x97B3, 0x1BFE, 0x97B4, 0x1BFF,
- 0x97B5, 0x3BB1, 0x97B6, 0x3BB2, 0x97B9, 0x4E0A, 0x97BA, 0x4326,
- 0x97BE, 0x49EB, 0x97C1, 0x4327, 0x97C3, 0x1C00, 0x97C6, 0x1C01,
- 0x97C8, 0x1C02, 0x97C9, 0x4328, 0x97CB, 0x1C03, 0x97CC, 0x49EC,
- 0x97CD, 0x4E0B, 0x97D1, 0x49ED, 0x97D3, 0x0616, 0x97D4, 0x49EE,
- 0x97D8, 0x49EF, 0x97D9, 0x3BB3, 0x97DB, 0x4329, 0x97DC, 0x1C04,
- 0x97DE, 0x3BB4, 0x97E0, 0x4E0C, 0x97E1, 0x49F0, 0x97ED, 0x1C05,
- 0x97EE, 0x0CD9, 0x97EF, 0x4E0D, 0x97F1, 0x49F1, 0x97F2, 0x1C07,
- 0x97F3, 0x053B, 0x97F4, 0x3BB5, 0x97F5, 0x1C0A, 0x97F6, 0x1C09,
- 0x97FB, 0x04C6, 0x97FF, 0x06B9, 0x9801, 0x0E17, 0x9802, 0x0BD6,
- 0x9803, 0x0812, 0x9804, 0x49F2, 0x9805, 0x07F2, 0x9806, 0x0971,
- 0x9807, 0x4E0E, 0x9808, 0x0A22, 0x980A, 0x3BB6, 0x980C, 0x1C0C,
- 0x980D, 0x49F3, 0x980E, 0x3BB7, 0x980F, 0x1C0B, 0x9810, 0x0F2C,
- 0x9811, 0x0624, 0x9812, 0x0D66, 0x9813, 0x0CB4, 0x9814, 0x49F4,
- 0x9816, 0x49F5, 0x9817, 0x0A42, 0x9818, 0x0F96, 0x981A, 0x0731,
- 0x981E, 0x3BB8, 0x9821, 0x1C0F, 0x9823, 0x3BB9, 0x9824, 0x1C0E,
- 0x9825, 0x49FA, 0x9826, 0x4E0F, 0x982B, 0x3BBA, 0x982C, 0x0E79,
- 0x982D, 0x0C84, 0x982E, 0x4E10, 0x9830, 0x1E73, 0x9832, 0x49F8,
- 0x9833, 0x49F9, 0x9834, 0x04F2, 0x9837, 0x1C10, 0x9838, 0x1C0D,
- 0x9839, 0x37B3, 0x983B, 0x0DC3, 0x983C, 0x0F54, 0x983D, 0x1C11,
- 0x983E, 0x3BBB, 0x9846, 0x1C12, 0x9847, 0x49FB, 0x984B, 0x1C14,
- 0x984C, 0x0B4A, 0x984D, 0x05B9, 0x984E, 0x05BA, 0x984F, 0x1C13,
- 0x9852, 0x3BBC, 0x9853, 0x3BBD, 0x9854, 0x0625, 0x9855, 0x0766,
- 0x9856, 0x432A, 0x9857, 0x21F9, 0x9858, 0x0626, 0x9859, 0x3BBE,
- 0x985A, 0x1E48, 0x985B, 0x0C39, 0x985E, 0x0FA8, 0x9862, 0x4E11,
- 0x9863, 0x4E12, 0x9865, 0x21FA, 0x9866, 0x49FC, 0x9867, 0x0790,
- 0x986B, 0x1C15, 0x986C, 0x3BBF, 0x986F, 0x1C16, 0x9870, 0x1C17,
- 0x9871, 0x1C18, 0x9873, 0x1C1A, 0x9874, 0x1C19, 0x98A8, 0x0DE9,
- 0x98AA, 0x1C1B, 0x98AB, 0x49FD, 0x98AD, 0x49FE, 0x98AF, 0x1C1C,
- 0x98B0, 0x49FF, 0x98B1, 0x1C1D, 0x98B4, 0x4E13, 0x98B6, 0x1C1E,
- 0x98B7, 0x4A01, 0x98B8, 0x3BC0, 0x98BA, 0x3BC1, 0x98BB, 0x4A02,
- 0x98BC, 0x4A03, 0x98BF, 0x3BC2, 0x98C2, 0x4A04, 0x98C3, 0x1C20,
- 0x98C4, 0x1C1F, 0x98C5, 0x4E14, 0x98C6, 0x1C21, 0x98C7, 0x4A05,
- 0x98C8, 0x3BC3, 0x98CB, 0x4A06, 0x98DB, 0x0D88, 0x98DC, 0x1839,
- 0x98DF, 0x09EF, 0x98E0, 0x3618, 0x98E1, 0x4A07, 0x98E2, 0x064C,
- 0x98E3, 0x4A08, 0x98E5, 0x3BC4, 0x98E7, 0x432B, 0x98E9, 0x1C22,
- 0x98EA, 0x4A09, 0x98EB, 0x1C23, 0x98ED, 0x10C1, 0x98EE, 0x14DA,
- 0x98EF, 0x0D67, 0x98F0, 0x4A0A, 0x98F1, 0x4A0B, 0x98F2, 0x04BF,
- 0x98F3, 0x4A0C, 0x98F4, 0x047F, 0x98FC, 0x08C2, 0x98FD, 0x0E5E,
- 0x98FE, 0x09E6, 0x9902, 0x4E15, 0x9903, 0x1C24, 0x9905, 0x0EEB,
- 0x9908, 0x4A0D, 0x9909, 0x1C25, 0x990A, 0x0F46, 0x990C, 0x04E4,
- 0x9910, 0x088F, 0x9911, 0x4E16, 0x9912, 0x1C26, 0x9913, 0x056E,
- 0x9914, 0x1C27, 0x9915, 0x4E17, 0x9916, 0x4A10, 0x9917, 0x4A11,
- 0x9918, 0x1C28, 0x991A, 0x4A13, 0x991B, 0x4A14, 0x991C, 0x4A15,
- 0x991D, 0x1C2A, 0x991E, 0x1C2B, 0x9920, 0x1C2D, 0x9921, 0x1C29,
- 0x9924, 0x1C2C, 0x9927, 0x21FD, 0x9928, 0x0617, 0x992C, 0x1C2E,
- 0x992E, 0x1C2F, 0x9931, 0x4A17, 0x9932, 0x3BC5, 0x9933, 0x3BC6,
- 0x9935, 0x4E18, 0x993A, 0x4A18, 0x993B, 0x4A19, 0x993C, 0x4A1A,
- 0x993D, 0x1C30, 0x993E, 0x1C31, 0x9940, 0x3BC7, 0x9941, 0x4A1B,
- 0x9942, 0x1C32, 0x9945, 0x1C34, 0x9946, 0x4A1C, 0x9948, 0x4E19,
- 0x9949, 0x1C33, 0x994B, 0x1C36, 0x994C, 0x1C39, 0x994D, 0x3BC8,
- 0x994E, 0x4A1D, 0x9950, 0x1C35, 0x9951, 0x1C37, 0x9952, 0x1C38,
- 0x9954, 0x4E1A, 0x9955, 0x1C3A, 0x9957, 0x06BA, 0x9958, 0x432C,
- 0x995C, 0x3BC9, 0x995E, 0x4E1B, 0x995F, 0x3BCA, 0x9960, 0x4A1E,
- 0x9996, 0x091F, 0x9997, 0x1C3B, 0x9998, 0x1C3C, 0x9999, 0x07F3,
- 0x999E, 0x21FF, 0x99A3, 0x4A1F, 0x99A5, 0x1C3D, 0x99A6, 0x4A20,
- 0x99A8, 0x059C, 0x99AC, 0x0D05, 0x99AD, 0x1C3E, 0x99AE, 0x1C3F,
- 0x99B1, 0x3BCB, 0x99B3, 0x0B98, 0x99B4, 0x0CC3, 0x99B9, 0x3BCC,
- 0x99BA, 0x3BCD, 0x99BC, 0x1C40, 0x99BD, 0x4A21, 0x99BF, 0x4A22,
- 0x99C1, 0x0D33, 0x99C3, 0x4A23, 0x99C4, 0x0B2C, 0x99C5, 0x04FA,
- 0x99C6, 0x06E6, 0x99C8, 0x06E7, 0x99C9, 0x3BCE, 0x99D0, 0x0BB1,
- 0x99D1, 0x1C45, 0x99D2, 0x06E8, 0x99D4, 0x4A24, 0x99D5, 0x056F,
- 0x99D8, 0x1C44, 0x99D9, 0x4A25, 0x99DB, 0x1C42, 0x99DD, 0x1C43,
- 0x99DE, 0x4A26, 0x99DF, 0x1C41, 0x99E1, 0x4E1C, 0x99E2, 0x1C4F,
- 0x99ED, 0x1C46, 0x99EE, 0x1C47, 0x99F0, 0x4A28, 0x99F1, 0x1C48,
- 0x99F2, 0x1C49, 0x99F8, 0x1C4B, 0x99F9, 0x4A29, 0x99FB, 0x1C4A,
- 0x99FC, 0x4A2A, 0x99FF, 0x0963, 0x9A01, 0x1C4C, 0x9A02, 0x3BCF,
- 0x9A03, 0x432D, 0x9A05, 0x1C4E, 0x9A08, 0x37BA, 0x9A0A, 0x4A2B,
- 0x9A0C, 0x4E1D, 0x9A0E, 0x064D, 0x9A0F, 0x1C4D, 0x9A10, 0x4E1E,
- 0x9A11, 0x4A2C, 0x9A12, 0x0AFD, 0x9A13, 0x0767, 0x9A16, 0x3BD0,
- 0x9A19, 0x1C50, 0x9A1A, 0x4A2D, 0x9A20, 0x4A2E, 0x9A23, 0x4E1F,
- 0x9A24, 0x3BD1, 0x9A27, 0x3BD2, 0x9A28, 0x0B2D, 0x9A2B, 0x1C51,
- 0x9A2D, 0x3BD3, 0x9A2E, 0x3BD4, 0x9A30, 0x0C85, 0x9A31, 0x4A2F,
- 0x9A36, 0x3BD5, 0x9A37, 0x1C52, 0x9A38, 0x3BD6, 0x9A3E, 0x1C57,
- 0x9A40, 0x1C55, 0x9A41, 0x4E20, 0x9A42, 0x1C54, 0x9A43, 0x1C56,
- 0x9A44, 0x4A30, 0x9A45, 0x1C53, 0x9A4A, 0x3BD7, 0x9A4C, 0x4A31,
- 0x9A4D, 0x1C59, 0x9A4E, 0x2200, 0x9A51, 0x4E21, 0x9A52, 0x1E2F,
- 0x9A55, 0x1C58, 0x9A56, 0x3BD8, 0x9A57, 0x1C5B, 0x9A58, 0x4A32,
- 0x9A5A, 0x06BB, 0x9A5B, 0x1C5A, 0x9A5F, 0x1C5C, 0x9A62, 0x1C5D,
- 0x9A64, 0x1C5F, 0x9A65, 0x1C5E, 0x9A69, 0x1C60, 0x9A6A, 0x1C62,
- 0x9A6B, 0x1C61, 0x9AA8, 0x080E, 0x9AAD, 0x1C63, 0x9AAF, 0x4A34,
- 0x9AB0, 0x1C64, 0x9AB5, 0x3BD9, 0x9AB6, 0x3BDA, 0x9AB7, 0x4A36,
- 0x9AB8, 0x059A, 0x9AB9, 0x4A38, 0x9ABC, 0x1C65, 0x9ABD, 0x4E22,
- 0x9ABE, 0x4E23, 0x9AC0, 0x1C66, 0x9AC1, 0x432E, 0x9AC3, 0x432F,
- 0x9AC4, 0x0A37, 0x9AC6, 0x4A3A, 0x9ACE, 0x4330, 0x9ACF, 0x1C67,
- 0x9AD0, 0x4A3B, 0x9AD1, 0x1C68, 0x9AD2, 0x4A3C, 0x9AD3, 0x1C69,
- 0x9AD4, 0x1C6A, 0x9AD5, 0x4A3D, 0x9AD6, 0x4331, 0x9AD8, 0x07F4,
- 0x9AD9, 0x2201, 0x9ADC, 0x2202, 0x9ADE, 0x1C6B, 0x9ADF, 0x1C6C,
- 0x9AE0, 0x4A3E, 0x9AE2, 0x1C6D, 0x9AE3, 0x1C6E, 0x9AE5, 0x4A3F,
- 0x9AE6, 0x1C6F, 0x9AE9, 0x4A40, 0x9AEA, 0x0D45, 0x9AEB, 0x1C71,
- 0x9AED, 0x0D98, 0x9AEE, 0x1C72, 0x9AEF, 0x1C70, 0x9AF1, 0x1C74,
- 0x9AF4, 0x1C73, 0x9AF7, 0x1C75, 0x9AF9, 0x3BDB, 0x9AFB, 0x1C76,
- 0x9B01, 0x4E24, 0x9B02, 0x4332, 0x9B03, 0x3BDC, 0x9B06, 0x1C77,
- 0x9B08, 0x4333, 0x9B09, 0x4E25, 0x9B0B, 0x4E26, 0x9B0C, 0x4A41,
- 0x9B0D, 0x4E27, 0x9B0E, 0x4E28, 0x9B10, 0x4A42, 0x9B12, 0x4A43,
- 0x9B16, 0x4A44, 0x9B18, 0x1C78, 0x9B19, 0x4E29, 0x9B1A, 0x1C79,
- 0x9B1C, 0x4A45, 0x9B1D, 0x4F49, 0x9B1F, 0x1C7A, 0x9B20, 0x3BDD,
- 0x9B22, 0x1C7B, 0x9B23, 0x1C7C, 0x9B25, 0x1C7D, 0x9B27, 0x1C7E,
- 0x9B28, 0x1C7F, 0x9B29, 0x1C80, 0x9B2A, 0x1C81, 0x9B2B, 0x4A46,
- 0x9B2C, 0x4F4A, 0x9B2D, 0x4335, 0x9B2E, 0x1C82, 0x9B2F, 0x1C83,
- 0x9B31, 0x14D4, 0x9B32, 0x1C84, 0x9B33, 0x3BDE, 0x9B34, 0x3BDF,
- 0x9B35, 0x4E2A, 0x9B3B, 0x17A9, 0x9B3C, 0x064E, 0x9B3D, 0x4A47,
- 0x9B41, 0x057F, 0x9B42, 0x0822, 0x9B43, 0x1C86, 0x9B44, 0x1C85,
- 0x9B45, 0x0EB1, 0x9B48, 0x4E2B, 0x9B4B, 0x4A49, 0x9B4D, 0x1C88,
- 0x9B4E, 0x1C89, 0x9B4F, 0x1C87, 0x9B51, 0x1C8A, 0x9B54, 0x0E90,
- 0x9B55, 0x4E2C, 0x9B58, 0x1C8B, 0x9B5A, 0x0695, 0x9B5E, 0x4336,
- 0x9B63, 0x4A4A, 0x9B65, 0x4A4B, 0x9B66, 0x4337, 0x9B68, 0x4E2D,
- 0x9B6B, 0x4A4C, 0x9B6C, 0x4A4D, 0x9B6F, 0x0FCB, 0x9B72, 0x2204,
- 0x9B73, 0x3BE0, 0x9B74, 0x1C8C, 0x9B75, 0x2203, 0x9B76, 0x4A4E,
- 0x9B77, 0x4A4F, 0x9B79, 0x3BE1, 0x9B80, 0x4E2E, 0x9B83, 0x1C8E,
- 0x9B84, 0x4338, 0x9B86, 0x4E2F, 0x9B8A, 0x4339, 0x9B8E, 0x0482,
- 0x9B8F, 0x2205, 0x9B90, 0x4E30, 0x9B91, 0x1C8F, 0x9B92, 0x0DFB,
- 0x9B93, 0x1C8D, 0x9B96, 0x1C90, 0x9B97, 0x1C91, 0x9B9D, 0x4E31,
- 0x9B9E, 0x433A, 0x9B9F, 0x1C92, 0x9BA0, 0x1C93, 0x9BA6, 0x4A50,
- 0x9BA7, 0x3BE2, 0x9BA8, 0x1C94, 0x9BAA, 0x0E9C, 0x9BAB, 0x087B,
- 0x9BAC, 0x4A51, 0x9BAD, 0x086A, 0x9BAE, 0x0AB1, 0x9BB0, 0x4E32,
- 0x9BB1, 0x2206, 0x9BB2, 0x4A53, 0x9BB4, 0x1C95, 0x9BB8, 0x4A54,
- 0x9BB9, 0x1C98, 0x9BBB, 0x2207, 0x9BBE, 0x4A55, 0x9BBF, 0x4E33,
- 0x9BC0, 0x1C96, 0x9BC1, 0x3BE3, 0x9BC6, 0x1C99, 0x9BC7, 0x3BE4,
- 0x9BC8, 0x4E34, 0x9BC9, 0x07A5, 0x9BCA, 0x1C97, 0x9BCE, 0x433B,
- 0x9BCF, 0x1C9A, 0x9BD1, 0x1C9B, 0x9BD2, 0x1C9C, 0x9BD4, 0x1CA0,
- 0x9BD6, 0x0878, 0x9BD7, 0x3BE5, 0x9BD8, 0x4A57, 0x9BDB, 0x0B44,
- 0x9BDD, 0x4A58, 0x9BDF, 0x37BF, 0x9BE1, 0x1CA1, 0x9BE2, 0x1C9E,
- 0x9BE3, 0x1C9D, 0x9BE4, 0x1C9F, 0x9BE5, 0x433C, 0x9BE7, 0x3BE6,
- 0x9BE8, 0x0735, 0x9BEA, 0x4A59, 0x9BEB, 0x3BE7, 0x9BEE, 0x4A5B,
- 0x9BEF, 0x4A5A, 0x9BF0, 0x1CA5, 0x9BF1, 0x1CA4, 0x9BF2, 0x1CA3,
- 0x9BF3, 0x4A56, 0x9BF5, 0x0477, 0x9BF7, 0x3BE8, 0x9BF8, 0x433D,
- 0x9BFA, 0x3BE9, 0x9BFD, 0x3BEA, 0x9BFF, 0x4E35, 0x9C00, 0x2208,
- 0x9C02, 0x4E36, 0x9C04, 0x1CAF, 0x9C06, 0x1CAB, 0x9C08, 0x1CAC,
- 0x9C09, 0x1CA8, 0x9C0A, 0x1CAE, 0x9C0B, 0x3BEB, 0x9C0C, 0x1CAA,
- 0x9C0D, 0x05C0, 0x9C10, 0x0FF2, 0x9C12, 0x1CAD, 0x9C13, 0x1CA9,
- 0x9C14, 0x1CA7, 0x9C15, 0x1CA6, 0x9C16, 0x4A5F, 0x9C18, 0x4A60,
- 0x9C19, 0x4A61, 0x9C1A, 0x4A62, 0x9C1B, 0x1CB1, 0x9C1C, 0x4E37,
- 0x9C1D, 0x4A63, 0x9C21, 0x1CB4, 0x9C22, 0x4A64, 0x9C23, 0x433E,
- 0x9C24, 0x1CB3, 0x9C25, 0x1CB2, 0x9C27, 0x3BEC, 0x9C29, 0x4A65,
- 0x9C2A, 0x3BED, 0x9C2D, 0x0DBB, 0x9C2E, 0x1CB0, 0x9C2F, 0x04B7,
- 0x9C30, 0x1CB5, 0x9C31, 0x4A67, 0x9C32, 0x1CB7, 0x9C35, 0x4E38,
- 0x9C36, 0x3BEE, 0x9C37, 0x4A68, 0x9C39, 0x05CD, 0x9C3A, 0x1CA2,
- 0x9C3B, 0x04D9, 0x9C3E, 0x1CB9, 0x9C41, 0x3BEF, 0x9C44, 0x4E39,
- 0x9C45, 0x4A69, 0x9C46, 0x1CB8, 0x9C47, 0x1CB6, 0x9C48, 0x0B6B,
- 0x9C49, 0x4A6C, 0x9C4A, 0x4A6D, 0x9C4F, 0x433F, 0x9C50, 0x4340,
- 0x9C52, 0x0E9E, 0x9C53, 0x3BF0, 0x9C54, 0x4A6F, 0x9C56, 0x4E3A,
- 0x9C57, 0x0FA2, 0x9C58, 0x4A70, 0x9C5A, 0x1CBA, 0x9C5B, 0x4A71,
- 0x9C5C, 0x4A6A, 0x9C5D, 0x4A72, 0x9C5F, 0x4A73, 0x9C60, 0x1CBB,
- 0x9C61, 0x4E3B, 0x9C63, 0x3BF1, 0x9C65, 0x4341, 0x9C67, 0x1CBC,
- 0x9C68, 0x4E3C, 0x9C69, 0x4A74, 0x9C6A, 0x4A75, 0x9C6B, 0x4A76,
- 0x9C6D, 0x4A77, 0x9C6E, 0x4A78, 0x9C70, 0x3BF2, 0x9C72, 0x4A79,
- 0x9C75, 0x4A7A, 0x9C76, 0x1CBD, 0x9C77, 0x3BF3, 0x9C78, 0x1CBE,
- 0x9C7A, 0x4A7B, 0x9CE5, 0x0BD7, 0x9CE6, 0x4A7C, 0x9CE7, 0x1CBF,
- 0x9CE9, 0x0D4B, 0x9CEB, 0x1CC4, 0x9CEC, 0x1CC0, 0x9CF0, 0x1CC1,
- 0x9CF2, 0x4A7D, 0x9CF3, 0x0E5F, 0x9CF4, 0x0ED0, 0x9CF6, 0x0CA8,
- 0x9D02, 0x3BF4, 0x9D03, 0x1CC5, 0x9D06, 0x1CC6, 0x9D07, 0x0C96,
- 0x9D08, 0x1CC3, 0x9D09, 0x1CC2, 0x9D0B, 0x4A7E, 0x9D0E, 0x052A,
- 0x9D11, 0x4A80, 0x9D12, 0x1CCE, 0x9D15, 0x1CCD, 0x9D17, 0x4A81,
- 0x9D18, 0x4A82, 0x9D1B, 0x0517, 0x9D1D, 0x4342, 0x9D1E, 0x4343,
- 0x9D1F, 0x1CCB, 0x9D23, 0x1CCA, 0x9D26, 0x1CC8, 0x9D28, 0x05D9,
- 0x9D2A, 0x1CC7, 0x9D2B, 0x08DE, 0x9D2C, 0x0529, 0x9D30, 0x4E3D,
- 0x9D32, 0x4A86, 0x9D3B, 0x07F5, 0x9D3D, 0x4E3E, 0x9D3E, 0x1CD1,
- 0x9D3F, 0x1CD0, 0x9D41, 0x1CCF, 0x9D42, 0x3BF5, 0x9D43, 0x4344,
- 0x9D44, 0x1CCC, 0x9D46, 0x1CD2, 0x9D47, 0x3BF6, 0x9D48, 0x1CD3,
- 0x9D4A, 0x4A88, 0x9D50, 0x1CD8, 0x9D51, 0x1CD7, 0x9D52, 0x4345,
- 0x9D59, 0x1CD9, 0x9D5C, 0x04CF, 0x9D5D, 0x1CD4, 0x9D5E, 0x1CD5,
- 0x9D5F, 0x4A89, 0x9D60, 0x0806, 0x9D61, 0x0EC5, 0x9D62, 0x4A8A,
- 0x9D63, 0x3BF7, 0x9D64, 0x1CD6, 0x9D69, 0x3BF8, 0x9D6A, 0x4E3F,
- 0x9D6B, 0x220A, 0x9D6C, 0x0E60, 0x9D6F, 0x1CDE, 0x9D70, 0x2209,
- 0x9D72, 0x1CDA, 0x9D73, 0x4A8D, 0x9D76, 0x4A8E, 0x9D77, 0x4A8F,
- 0x9D7A, 0x1CDF, 0x9D7B, 0x4E40, 0x9D7C, 0x3BF9, 0x9D7E, 0x3BFA,
- 0x9D84, 0x4A90, 0x9D87, 0x1CDC, 0x9D89, 0x1CDB, 0x9D8A, 0x4346,
- 0x9D8D, 0x3BFB, 0x9D8F, 0x0732, 0x9D96, 0x4347, 0x9D99, 0x4A91,
- 0x9D9A, 0x1CE0, 0x9DA1, 0x4A92, 0x9DA4, 0x1CE1, 0x9DA9, 0x1CE2,
- 0x9DAB, 0x1CDD, 0x9DAC, 0x4349, 0x9DAF, 0x1CC9, 0x9DB1, 0x3BFC,
- 0x9DB2, 0x1CE3, 0x9DB4, 0x0BFD, 0x9DB5, 0x4A94, 0x9DB8, 0x1CE7,
- 0x9DB9, 0x4A95, 0x9DBA, 0x1CE8, 0x9DBB, 0x1CE6, 0x9DBC, 0x434A,
- 0x9DBD, 0x4A96, 0x9DBF, 0x4A93, 0x9DC0, 0x4348, 0x9DC1, 0x1CE5,
- 0x9DC2, 0x1CEB, 0x9DC3, 0x3BFD, 0x9DC4, 0x1CE4, 0x9DC6, 0x1CE9,
- 0x9DC7, 0x3BFE, 0x9DC9, 0x4A97, 0x9DCF, 0x1CEA, 0x9DD3, 0x1CED,
- 0x9DD6, 0x3BFF, 0x9DD7, 0x1DDE, 0x9DD9, 0x1CEC, 0x9DDA, 0x4A98,
- 0x9DDF, 0x3C00, 0x9DE0, 0x4A99, 0x9DE3, 0x4A9A, 0x9DE5, 0x4E41,
- 0x9DE6, 0x1CEF, 0x9DE7, 0x434C, 0x9DE9, 0x4E42, 0x9DEB, 0x3C01,
- 0x9DED, 0x1CF0, 0x9DEF, 0x1CF1, 0x9DF2, 0x0FEF, 0x9DF3, 0x4E43,
- 0x9DF4, 0x3C02, 0x9DF8, 0x1CEE, 0x9DF9, 0x0B4B, 0x9DFA, 0x085D,
- 0x9DFD, 0x1CF2, 0x9E02, 0x4A9D, 0x9E07, 0x434D, 0x9E0A, 0x4A9C,
- 0x9E0D, 0x4A9E, 0x9E15, 0x3C03, 0x9E19, 0x220C, 0x9E1A, 0x1CF3,
- 0x9E1B, 0x1CF4, 0x9E1C, 0x4A9F, 0x9E1D, 0x3C04, 0x9E1E, 0x1CF5,
- 0x9E75, 0x1CF6, 0x9E78, 0x0768, 0x9E79, 0x1CF7, 0x9E7A, 0x4E44,
- 0x9E7B, 0x4AA0, 0x9E7C, 0x1DFD, 0x9E7D, 0x1CF8, 0x9E7F, 0x08DB,
- 0x9E80, 0x4AA2, 0x9E81, 0x1CF9, 0x9E82, 0x4E45, 0x9E83, 0x4E46,
- 0x9E84, 0x4E47, 0x9E85, 0x4AA3, 0x9E88, 0x1CFA, 0x9E8B, 0x1CFB,
- 0x9E8C, 0x1CFC, 0x9E91, 0x1CFF, 0x9E92, 0x1CFD, 0x9E93, 0x0FE2,
- 0x9E95, 0x1CFE, 0x9E97, 0x0FB7, 0x9E9B, 0x4AA4, 0x9E9D, 0x1D00,
- 0x9E9E, 0x434E, 0x9E9F, 0x0FA3, 0x9EA4, 0x3C05, 0x9EA5, 0x1D01,
- 0x9EA6, 0x0D34, 0x9EA8, 0x3C06, 0x9EA9, 0x1D02, 0x9EAA, 0x1D04,
- 0x9EAC, 0x3C07, 0x9EAD, 0x1D05, 0x9EAF, 0x434F, 0x9EB0, 0x4E48,
- 0x9EB4, 0x1E02, 0x9EB5, 0x1E75, 0x9EB8, 0x1D03, 0x9EB9, 0x07FF,
- 0x9EBA, 0x0ED9, 0x9EBB, 0x0E91, 0x9EBC, 0x1284, 0x9EBD, 0x4AA6,
- 0x9EBE, 0x14FF, 0x9EBF, 0x0EA9, 0x9EC3, 0x340B, 0x9EC4, 0x052B,
- 0x9ECC, 0x1D07, 0x9ECD, 0x066A, 0x9ECE, 0x1D08, 0x9ECF, 0x1D09,
- 0x9ED0, 0x1D0A, 0x9ED1, 0x220D, 0x9ED2, 0x0807, 0x9ED4, 0x1D0B,
- 0x9ED8, 0x160D, 0x9ED9, 0x0EE7, 0x9EDB, 0x0B43, 0x9EDC, 0x1D0C,
- 0x9EDD, 0x1D0E, 0x9EDE, 0x1D0D, 0x9EDF, 0x4AA8, 0x9EE0, 0x1D0F,
- 0x9EE4, 0x4E49, 0x9EE5, 0x1D10, 0x9EE7, 0x3C08, 0x9EE8, 0x1D11,
- 0x9EEE, 0x3C09, 0x9EEF, 0x1D12, 0x9EF0, 0x4E4A, 0x9EF2, 0x4E4B,
- 0x9EF4, 0x1D13, 0x9EF6, 0x1D14, 0x9EF7, 0x1D15, 0x9EF9, 0x1D16,
- 0x9EFB, 0x1D17, 0x9EFC, 0x1D18, 0x9EFD, 0x1D19, 0x9EFF, 0x4AA9,
- 0x9F02, 0x4AAA, 0x9F03, 0x4AAC, 0x9F07, 0x1D1A, 0x9F08, 0x1D1B,
- 0x9F09, 0x4E4C, 0x9F0E, 0x0C1E, 0x9F0F, 0x4E4D, 0x9F10, 0x3C0A,
- 0x9F12, 0x3C0B, 0x9F13, 0x0791, 0x9F14, 0x4E4E, 0x9F15, 0x1D1D,
- 0x9F17, 0x3C0C, 0x9F19, 0x3C0D, 0x9F1B, 0x4E4F, 0x9F20, 0x0ACF,
- 0x9F21, 0x1D1E, 0x9F22, 0x4E50, 0x9F26, 0x4E51, 0x9F2A, 0x4E52,
- 0x9F2B, 0x4E53, 0x9F2C, 0x1D1F, 0x9F2F, 0x3C0E, 0x9F34, 0x4E54,
- 0x9F37, 0x3C0F, 0x9F39, 0x3C10, 0x9F3A, 0x4AAD, 0x9F3B, 0x0D93,
- 0x9F3D, 0x4AAE, 0x9F3E, 0x1D20, 0x9F41, 0x3C11, 0x9F45, 0x3C12,
- 0x9F46, 0x4AAF, 0x9F4A, 0x1D21, 0x9F4B, 0x170A, 0x9F4E, 0x1A7B,
- 0x9F4F, 0x1C06, 0x9F52, 0x1D22, 0x9F53, 0x4AB0, 0x9F54, 0x1D23,
- 0x9F55, 0x4AB1, 0x9F57, 0x3C13, 0x9F58, 0x4AB2, 0x9F5A, 0x4E55,
- 0x9F5D, 0x4AB4, 0x9F5F, 0x1D25, 0x9F60, 0x1D26, 0x9F61, 0x1D27,
- 0x9F62, 0x0FB8, 0x9F63, 0x1D24, 0x9F66, 0x1D28, 0x9F67, 0x1D29,
- 0x9F68, 0x3C14, 0x9F69, 0x4AB6, 0x9F6A, 0x1D2B, 0x9F6C, 0x1D2A,
- 0x9F6D, 0x4AB7, 0x9F6F, 0x4E56, 0x9F70, 0x4AB8, 0x9F71, 0x3C15,
- 0x9F72, 0x1D2D, 0x9F75, 0x3C16, 0x9F76, 0x1D2E, 0x9F77, 0x1D2C,
- 0x9F8D, 0x0F7E, 0x9F90, 0x3C17, 0x9F94, 0x3C18, 0x9F95, 0x1D2F,
- 0x9F97, 0x4350, 0x9F9C, 0x1D30, 0x9F9D, 0x1727, 0x9F9E, 0x4E57,
- 0x9FA0, 0x1D31, 0x9FA2, 0x3C19, 0x9FA5, 0x4E58, 0xF860, 0x3C54,
- 0xF861, 0x3C55, 0xF862, 0x3C56, 0xF87A, 0x3C57, 0xF87F, 0x3C58,
- 0xF909, 0x35AB, 0xF91D, 0x3450, 0xF91F, 0x3704, 0xF928, 0x4F4F,
- 0xF929, 0x4F51, 0xF936, 0x3452, 0xF95F, 0x3693, 0xF970, 0x3420,
- 0xF983, 0x3708, 0xF992, 0x1E81, 0xF993, 0x1E82, 0xF999, 0x1E83,
- 0xF99A, 0x3711, 0xF9A2, 0x370F, 0xF9C3, 0x1E80, 0xF9D0, 0x3454,
- 0xF9DC, 0x3451, 0xF9EC, 0x1E46, 0xFA03, 0x3684, 0xFA0E, 0x20DA,
- 0xFA0F, 0x20E5, 0xFA10, 0x1E42, 0xFA11, 0x37D2, 0xFA12, 0x2121,
- 0xFA13, 0x2131, 0xFA14, 0x2133, 0xFA15, 0x4F53, 0xFA16, 0x2164,
- 0xFA17, 0x217B, 0xFA18, 0x2183, 0xFA19, 0x2184, 0xFA1A, 0x2185,
- 0xFA1B, 0x2187, 0xFA1C, 0x218B, 0xFA1D, 0x218E, 0xFA1E, 0x2197,
- 0xFA1F, 0x21A2, 0xFA20, 0x21A4, 0xFA21, 0x21A5, 0xFA22, 0x21AE,
- 0xFA23, 0x21B6, 0xFA24, 0x4948, 0xFA25, 0x21B9, 0xFA26, 0x21BC,
- 0xFA27, 0x21D8, 0xFA28, 0x21DF, 0xFA29, 0x21EF, 0xFA2A, 0x21FB,
- 0xFA2B, 0x21FC, 0xFA2C, 0x21FE, 0xFA2D, 0x220B, 0xFA30, 0x3446,
- 0xFA31, 0x3430, 0xFA32, 0x344D, 0xFA33, 0x3449, 0xFA34, 0x341A,
- 0xFA35, 0x3442, 0xFA36, 0x1DE3, 0xFA37, 0x3436, 0xFA38, 0x3415,
- 0xFA39, 0x3448, 0xFA3A, 0x344B, 0xFA3B, 0x3431, 0xFA3C, 0x41C5,
- 0xFA3D, 0x340E, 0xFA3E, 0x3410, 0xFA3F, 0x3433, 0xFA40, 0x3439,
- 0xFA41, 0x3445, 0xFA42, 0x3416, 0xFA43, 0x3428, 0xFA44, 0x343F,
- 0xFA45, 0x340F, 0xFA46, 0x1E14, 0xFA47, 0x3414, 0xFA48, 0x3423,
- 0xFA49, 0x3C26, 0xFA4A, 0x1E34, 0xFA4B, 0x3443, 0xFA4C, 0x3424,
- 0xFA4D, 0x3421, 0xFA4E, 0x3417, 0xFA4F, 0x344F, 0xFA50, 0x342F,
- 0xFA51, 0x3427, 0xFA52, 0x340D, 0xFA53, 0x343B, 0xFA54, 0x341F,
- 0xFA55, 0x343D, 0xFA56, 0x342E, 0xFA57, 0x3457, 0xFA58, 0x47BE,
- 0xFA59, 0x3440, 0xFA5A, 0x3429, 0xFA5B, 0x3425, 0xFA5C, 0x3426,
- 0xFA5D, 0x3777, 0xFA5E, 0x3776, 0xFA5F, 0x3437, 0xFA60, 0x3413,
- 0xFA61, 0x3422, 0xFA62, 0x3409, 0xFA63, 0x341B, 0xFA64, 0x3444,
- 0xFA65, 0x3434, 0xFA66, 0x3C2B, 0xFA67, 0x3408, 0xFA68, 0x343E,
- 0xFA69, 0x3419, 0xFA6A, 0x1E6C, 0xFB00, 0x248E, 0xFB01, 0x0070,
- 0xFB02, 0x0071, 0xFB03, 0x248F, 0xFB04, 0x2490, 0xFE30, 0x1EDA,
- 0xFE31, 0x1ED4, 0xFE32, 0x1ED5, 0xFE33, 0x1ED2, 0xFE35, 0x1EDB,
- 0xFE36, 0x1EDC, 0xFE37, 0x1EE1, 0xFE38, 0x1EE2, 0xFE39, 0x1EDD,
- 0xFE3A, 0x1EDE, 0xFE3B, 0x1EEB, 0xFE3C, 0x1EEC, 0xFE3D, 0x1EE5,
- 0xFE3E, 0x1EE6, 0xFE3F, 0x1EE3, 0xFE40, 0x1EE4, 0xFE41, 0x1EE7,
- 0xFE42, 0x1EE8, 0xFE43, 0x1EE9, 0xFE44, 0x1EEA, 0xFE45, 0x315F,
- 0xFE46, 0x3160, 0xFE47, 0x1EDF, 0xFE48, 0x1EE0, 0xFF01, 0x0282,
- 0xFF02, 0x1F47, 0xFF03, 0x02CC, 0xFF04, 0x02C8, 0xFF05, 0x02CB,
- 0xFF06, 0x02CD, 0xFF07, 0x1F46, 0xFF08, 0x02A2, 0xFF09, 0x02A3,
- 0xFF0A, 0x02CE, 0xFF0B, 0x02B4, 0xFF0C, 0x027C, 0xFF0D, 0x02B5,
- 0xFF0E, 0x027D, 0xFF0F, 0x0297, 0xFF10, 0x030C, 0xFF11, 0x030D,
- 0xFF12, 0x030E, 0xFF13, 0x030F, 0xFF14, 0x0310, 0xFF15, 0x0311,
- 0xFF16, 0x0312, 0xFF17, 0x0313, 0xFF18, 0x0314, 0xFF19, 0x0315,
- 0xFF1A, 0x027F, 0xFF1B, 0x0280, 0xFF1C, 0x02BB, 0xFF1D, 0x02B9,
- 0xFF1E, 0x02BC, 0xFF1F, 0x0281, 0xFF20, 0x02CF, 0xFF21, 0x0316,
- 0xFF22, 0x0317, 0xFF23, 0x0318, 0xFF24, 0x0319, 0xFF25, 0x031A,
- 0xFF26, 0x031B, 0xFF27, 0x031C, 0xFF28, 0x031D, 0xFF29, 0x031E,
- 0xFF2A, 0x031F, 0xFF2B, 0x0320, 0xFF2C, 0x0321, 0xFF2D, 0x0322,
- 0xFF2E, 0x0323, 0xFF2F, 0x0324, 0xFF30, 0x0325, 0xFF31, 0x0326,
- 0xFF32, 0x0327, 0xFF33, 0x0328, 0xFF34, 0x0329, 0xFF35, 0x032A,
- 0xFF36, 0x032B, 0xFF37, 0x032C, 0xFF38, 0x032D, 0xFF39, 0x032E,
- 0xFF3A, 0x032F, 0xFF3B, 0x02A6, 0xFF3C, 0x0298, 0xFF3D, 0x02A7,
- 0xFF3E, 0x0288, 0xFF3F, 0x028A, 0xFF40, 0x0286, 0xFF41, 0x0330,
- 0xFF42, 0x0331, 0xFF43, 0x0332, 0xFF44, 0x0333, 0xFF45, 0x0334,
- 0xFF46, 0x0335, 0xFF47, 0x0336, 0xFF48, 0x0337, 0xFF49, 0x0338,
- 0xFF4A, 0x0339, 0xFF4B, 0x033A, 0xFF4C, 0x033B, 0xFF4D, 0x033C,
- 0xFF4E, 0x033D, 0xFF4F, 0x033E, 0xFF50, 0x033F, 0xFF51, 0x0340,
- 0xFF52, 0x0341, 0xFF53, 0x0342, 0xFF54, 0x0343, 0xFF55, 0x0344,
- 0xFF56, 0x0345, 0xFF57, 0x0346, 0xFF58, 0x0347, 0xFF59, 0x0348,
- 0xFF5A, 0x0349, 0xFF5B, 0x02A8, 0xFF5C, 0x029B, 0xFF5D, 0x02A9,
- 0xFF5E, 0x0299, 0xFF5F, 0x2F63, 0xFF60, 0x2F64, 0xFF61, 0x0147,
- 0xFF62, 0x0148, 0xFF63, 0x0149, 0xFF64, 0x014A, 0xFF65, 0x014B,
- 0xFF66, 0x014C, 0xFF67, 0x014D, 0xFF68, 0x014E, 0xFF69, 0x014F,
- 0xFF6A, 0x0150, 0xFF6B, 0x0151, 0xFF6C, 0x0152, 0xFF6D, 0x0153,
- 0xFF6E, 0x0154, 0xFF6F, 0x0155, 0xFF70, 0x0156, 0xFF71, 0x0157,
- 0xFF72, 0x0158, 0xFF73, 0x0159, 0xFF74, 0x015A, 0xFF75, 0x015B,
- 0xFF76, 0x015C, 0xFF77, 0x015D, 0xFF78, 0x015E, 0xFF79, 0x015F,
- 0xFF7A, 0x0160, 0xFF7B, 0x0161, 0xFF7C, 0x0162, 0xFF7D, 0x0163,
- 0xFF7E, 0x0164, 0xFF7F, 0x0165, 0xFF80, 0x0166, 0xFF81, 0x0167,
- 0xFF82, 0x0168, 0xFF83, 0x0169, 0xFF84, 0x016A, 0xFF85, 0x016B,
- 0xFF86, 0x016C, 0xFF87, 0x016D, 0xFF88, 0x016E, 0xFF89, 0x016F,
- 0xFF8A, 0x0170, 0xFF8B, 0x0171, 0xFF8C, 0x0172, 0xFF8D, 0x0173,
- 0xFF8E, 0x0174, 0xFF8F, 0x0175, 0xFF90, 0x0176, 0xFF91, 0x0177,
- 0xFF92, 0x0178, 0xFF93, 0x0179, 0xFF94, 0x017A, 0xFF95, 0x017B,
- 0xFF96, 0x017C, 0xFF97, 0x017D, 0xFF98, 0x017E, 0xFF99, 0x017F,
- 0xFF9A, 0x0180, 0xFF9B, 0x0181, 0xFF9C, 0x0182, 0xFF9D, 0x0183,
- 0xFF9E, 0x0184, 0xFF9F, 0x0185, 0xFFE0, 0x02C9, 0xFFE1, 0x02CA,
- 0xFFE2, 0x02EF, 0xFFE3, 0x0289, 0xFFE4, 0x1F45, 0xFFE5, 0x02C7,
- 0xFFE8, 0x0143,
-};
-extern const unsigned short g_FXCMAP_UniJIS_UTF16_H_5_DWord[384 * 3] = {
- 0xD840, 0xDC0B, 0x360F, 0xD840, 0xDC89, 0x4351, 0xD840, 0xDC8A, 0x371C,
- 0xD840, 0xDCA2, 0x4358, 0xD840, 0xDCA4, 0x435B, 0xD840, 0xDCB0, 0x3781,
- 0xD840, 0xDCF5, 0x4E59, 0xD840, 0xDD58, 0x4E6B, 0xD840, 0xDDA2, 0x3621,
- 0xD840, 0xDE13, 0x436B, 0xD840, 0xDF2B, 0x4382, 0xD840, 0xDF71, 0x438B,
- 0xD840, 0xDF81, 0x4389, 0xD840, 0xDFF9, 0x438F, 0xD841, 0xDC4A, 0x4391,
- 0xD841, 0xDD09, 0x4393, 0xD841, 0xDDB1, 0x4E70, 0xD841, 0xDDD6, 0x439C,
- 0xD841, 0xDE11, 0x37D6, 0xD841, 0xDE28, 0x3719, 0xD841, 0xDEEC, 0x4E73,
- 0xD841, 0xDF4F, 0x43A0, 0xD842, 0xDC07, 0x43A7, 0xD842, 0xDC3A, 0x43A9,
- 0xD842, 0xDCB9, 0x43AF, 0xD842, 0xDD0E, 0x34D3, 0xD842, 0xDD7C, 0x43B3,
- 0xD842, 0xDD9D, 0x43B4, 0xD842, 0xDE64, 0x35BB, 0xD842, 0xDED3, 0x43B9,
- 0xD842, 0xDF1D, 0x43BC, 0xD842, 0xDF9F, 0x35EB, 0xD842, 0xDFB7, 0x358A,
- 0xD843, 0xDD45, 0x43CF, 0xD843, 0xDD58, 0x4E7A, 0xD843, 0xDDE1, 0x43DD,
- 0xD843, 0xDE64, 0x43EC, 0xD843, 0xDE6D, 0x43E4, 0xD843, 0xDE95, 0x43E3,
- 0xD843, 0xDF5F, 0x43EF, 0xD844, 0xDE01, 0x4406, 0xD844, 0xDE3D, 0x3681,
- 0xD844, 0xDE55, 0x4407, 0xD844, 0xDE74, 0x440D, 0xD844, 0xDE7B, 0x4409,
- 0xD844, 0xDED7, 0x4415, 0xD844, 0xDEE4, 0x4414, 0xD844, 0xDEFD, 0x441B,
- 0xD844, 0xDF1B, 0x41B0, 0xD844, 0xDF36, 0x441D, 0xD844, 0xDF44, 0x441E,
- 0xD844, 0xDFC4, 0x4429, 0xD845, 0xDC6D, 0x4436, 0xD845, 0xDC6E, 0x41B5,
- 0xD845, 0xDDD7, 0x4440, 0xD845, 0xDE47, 0x4448, 0xD845, 0xDEB4, 0x41C6,
- 0xD845, 0xDF06, 0x4454, 0xD845, 0xDF42, 0x4455, 0xD846, 0xDCBD, 0x41C1,
- 0xD846, 0xDDC3, 0x4475, 0xD846, 0xDE1A, 0x1E91, 0xD847, 0xDC56, 0x4483,
- 0xD847, 0xDD2D, 0x4488, 0xD847, 0xDD45, 0x4489, 0xD847, 0xDD62, 0x448B,
- 0xD847, 0xDD78, 0x448A, 0xD847, 0xDD92, 0x4494, 0xD847, 0xDD9C, 0x4490,
- 0xD847, 0xDDA1, 0x448F, 0xD847, 0xDDB7, 0x4497, 0xD847, 0xDDE0, 0x4499,
- 0xD847, 0xDE33, 0x449A, 0xD847, 0xDE34, 0x41CD, 0xD847, 0xDF1E, 0x44A7,
- 0xD847, 0xDF76, 0x44AE, 0xD847, 0xDFFA, 0x44B1, 0xD848, 0xDD7B, 0x44BF,
- 0xD848, 0xDE18, 0x4AA1, 0xD848, 0xDF1E, 0x44C5, 0xD848, 0xDFAD, 0x44C8,
- 0xD849, 0xDE09, 0x3C53, 0xD849, 0xDEF3, 0x44E0, 0xD84A, 0xDC5B, 0x44EF,
- 0xD84A, 0xDCAB, 0x44F5, 0xD84A, 0xDD8F, 0x44F9, 0xD84A, 0xDEB8, 0x4503,
- 0xD84A, 0xDF46, 0x4510, 0xD84A, 0xDF4F, 0x4507, 0xD84A, 0xDF50, 0x4508,
- 0xD84A, 0xDFA6, 0x4513, 0xD84B, 0xDC1D, 0x4512, 0xD84B, 0xDC24, 0x4516,
- 0xD84B, 0xDDE1, 0x452E, 0xD84B, 0xDE42, 0x4E9C, 0xD84B, 0xDFEB, 0x4EA2,
- 0xD84C, 0xDDB6, 0x4550, 0xD84C, 0xDDC3, 0x454E, 0xD84C, 0xDDC4, 0x41F8,
- 0xD84C, 0xDDF5, 0x454F, 0xD84C, 0xDF72, 0x4561, 0xD84C, 0xDFD0, 0x4568,
- 0xD84C, 0xDFD2, 0x4564, 0xD84C, 0xDFD3, 0x4563, 0xD84C, 0xDFD5, 0x456A,
- 0xD84C, 0xDFDA, 0x456C, 0xD84C, 0xDFDF, 0x456E, 0xD84C, 0xDFE4, 0x4569,
- 0xD84C, 0xDFFE, 0x3C3E, 0xD84D, 0xDC4A, 0x4576, 0xD84D, 0xDC4B, 0x4578,
- 0xD84D, 0xDC51, 0x4577, 0xD84D, 0xDC65, 0x457C, 0xD84D, 0xDCE4, 0x4596,
- 0xD84D, 0xDD5A, 0x4597, 0xD84D, 0xDD94, 0x45A3, 0xD84D, 0xDDC4, 0x4209,
- 0xD84D, 0xDE38, 0x45B3, 0xD84D, 0xDE39, 0x45B1, 0xD84D, 0xDE3A, 0x3C21,
- 0xD84D, 0xDE47, 0x45B2, 0xD84D, 0xDF0C, 0x45C7, 0xD84D, 0xDF1C, 0x45BE,
- 0xD84D, 0xDF3F, 0x4212, 0xD84D, 0xDF63, 0x4214, 0xD84D, 0xDF64, 0x45CB,
- 0xD84D, 0xDFE7, 0x45D3, 0xD84D, 0xDFFF, 0x45D2, 0xD84E, 0xDC24, 0x45D8,
- 0xD84E, 0xDC3D, 0x45DD, 0xD84E, 0xDE98, 0x45E9, 0xD84F, 0xDC7F, 0x45F6,
- 0xD84F, 0xDCBE, 0x37D5, 0xD84F, 0xDCFE, 0x3650, 0xD84F, 0xDD00, 0x4605,
- 0xD84F, 0xDD0E, 0x47DA, 0xD84F, 0xDD40, 0x4616, 0xD84F, 0xDDD3, 0x4619,
- 0xD84F, 0xDDF9, 0x4618, 0xD84F, 0xDDFA, 0x4617, 0xD84F, 0xDF7E, 0x463F,
- 0xD850, 0xDC4B, 0x4EC8, 0xD850, 0xDC96, 0x464E, 0xD850, 0xDD03, 0x4653,
- 0xD850, 0xDDC6, 0x465F, 0xD850, 0xDDFE, 0x4662, 0xD850, 0xDEEE, 0x37CA,
- 0xD850, 0xDFBC, 0x4677, 0xD850, 0xDFD0, 0x1E9E, 0xD851, 0xDE29, 0x4681,
- 0xD851, 0xDEA5, 0x4687, 0xD851, 0xDFF1, 0x424A, 0xD852, 0xDC96, 0x469D,
- 0xD852, 0xDE4D, 0x46B8, 0xD852, 0xDF56, 0x46C5, 0xD852, 0xDF6F, 0x46C7,
- 0xD853, 0xDC16, 0x46CC, 0xD853, 0xDD14, 0x36AB, 0xD853, 0xDE04, 0x4E5A,
- 0xD853, 0xDE0E, 0x46EE, 0xD853, 0xDE37, 0x46F2, 0xD853, 0xDE6A, 0x46F7,
- 0xD853, 0xDE8B, 0x46FA, 0xD853, 0xDFF2, 0x4E5B, 0xD854, 0xDC4A, 0x4705,
- 0xD854, 0xDC55, 0x4707, 0xD854, 0xDD22, 0x4709, 0xD854, 0xDDA9, 0x470E,
- 0xD854, 0xDDCD, 0x4711, 0xD854, 0xDDE5, 0x4710, 0xD854, 0xDE1E, 0x4713,
- 0xD854, 0xDE4C, 0x4715, 0xD855, 0xDC2E, 0x4721, 0xD855, 0xDC8E, 0x426D,
- 0xD855, 0xDCD9, 0x4729, 0xD855, 0xDD0E, 0x4271, 0xD855, 0xDDA7, 0x4735,
- 0xD855, 0xDE7F, 0x36FB, 0xD855, 0xDF71, 0x427A, 0xD855, 0xDFA9, 0x4748,
- 0xD855, 0xDFB4, 0x4749, 0xD856, 0xDC74, 0x1DF6, 0xD856, 0xDDC4, 0x4280,
- 0xD856, 0xDDCC, 0x4E90, 0xD856, 0xDDD4, 0x475C, 0xD856, 0xDEE3, 0x4765,
- 0xD856, 0xDEE4, 0x4764, 0xD856, 0xDEF1, 0x4766, 0xD856, 0xDFB2, 0x4775,
- 0xD857, 0xDC4B, 0x477E, 0xD857, 0xDC64, 0x477F, 0xD857, 0xDDA1, 0x4289,
- 0xD857, 0xDE2E, 0x478E, 0xD857, 0xDE56, 0x478F, 0xD857, 0xDE62, 0x4792,
- 0xD857, 0xDE65, 0x4790, 0xD857, 0xDEC2, 0x4797, 0xD857, 0xDED8, 0x4795,
- 0xD857, 0xDEE8, 0x4799, 0xD857, 0xDF23, 0x479A, 0xD857, 0xDF5C, 0x479C,
- 0xD857, 0xDFD4, 0x47A3, 0xD857, 0xDFE0, 0x47A2, 0xD857, 0xDFFB, 0x47A9,
- 0xD858, 0xDC0C, 0x47A8, 0xD858, 0xDC17, 0x47B0, 0xD858, 0xDC60, 0x47B3,
- 0xD858, 0xDCED, 0x47BD, 0xD858, 0xDE70, 0x47D1, 0xD858, 0xDE86, 0x47D2,
- 0xD858, 0xDF4C, 0x4F57, 0xD859, 0xDC02, 0x47DE, 0xD859, 0xDE7E, 0x47F0,
- 0xD859, 0xDEB0, 0x3714, 0xD859, 0xDF1D, 0x47FE, 0xD85A, 0xDCDD, 0x480C,
- 0xD85A, 0xDCEA, 0x480E, 0xD85A, 0xDD51, 0x354E, 0xD85A, 0xDD6F, 0x4812,
- 0xD85A, 0xDD99, 0x3736, 0xD85A, 0xDDDD, 0x4814, 0xD85A, 0xDE1E, 0x4817,
- 0xD85A, 0xDE58, 0x481B, 0xD85A, 0xDE8C, 0x481F, 0xD85A, 0xDEB7, 0x4822,
- 0xD85A, 0xDEFF, 0x42A7, 0xD85B, 0xDC29, 0x4446, 0xD85B, 0xDC73, 0x484A,
- 0xD85B, 0xDC9E, 0x4EEE, 0xD85B, 0xDCDD, 0x4853, 0xD85B, 0xDE40, 0x42C1,
- 0xD85B, 0xDE65, 0x4860, 0xD85B, 0xDF94, 0x4870, 0xD85B, 0xDFF6, 0x487A,
- 0xD85B, 0xDFF7, 0x487B, 0xD85B, 0xDFF8, 0x4879, 0xD85C, 0xDCF4, 0x42CF,
- 0xD85C, 0xDD0D, 0x488B, 0xD85C, 0xDD39, 0x488E, 0xD85C, 0xDFDA, 0x48B3,
- 0xD85C, 0xDFDB, 0x48B2, 0xD85C, 0xDFFE, 0x48B9, 0xD85D, 0xDC10, 0x48BC,
- 0xD85D, 0xDC49, 0x48C0, 0xD85D, 0xDE14, 0x48CE, 0xD85D, 0xDE15, 0x48CD,
- 0xD85D, 0xDE31, 0x48D0, 0xD85D, 0xDE84, 0x42DD, 0xD85D, 0xDE93, 0x48D5,
- 0xD85D, 0xDF0E, 0x48DA, 0xD85D, 0xDF23, 0x48DC, 0xD85D, 0xDF52, 0x48E0,
- 0xD85E, 0xDD85, 0x48F0, 0xD85E, 0xDDB4, 0x4EA5, 0xD85E, 0xDE84, 0x48FC,
- 0xD85E, 0xDFB3, 0x490B, 0xD85E, 0xDFBE, 0x490D, 0xD85E, 0xDFC7, 0x490E,
- 0xD85F, 0xDC3C, 0x4EFC, 0xD85F, 0xDCB8, 0x4914, 0xD85F, 0xDD73, 0x4E5C,
- 0xD85F, 0xDDA0, 0x491C, 0xD85F, 0xDE10, 0x491E, 0xD85F, 0xDFB7, 0x364A,
- 0xD860, 0xDC8A, 0x4927, 0xD860, 0xDCBB, 0x492D, 0xD860, 0xDE77, 0x42F4,
- 0xD860, 0xDE82, 0x4939, 0xD860, 0xDEF3, 0x493B, 0xD860, 0xDFCD, 0x42FA,
- 0xD861, 0xDC0C, 0x4942, 0xD861, 0xDC55, 0x4945, 0xD861, 0xDD6B, 0x4952,
- 0xD861, 0xDDC8, 0x4955, 0xD861, 0xDDC9, 0x4956, 0xD861, 0xDED7, 0x4960,
- 0xD861, 0xDEFA, 0x4963, 0xD862, 0xDD46, 0x497C, 0xD862, 0xDD49, 0x497B,
- 0xD862, 0xDD6B, 0x4981, 0xD862, 0xDD87, 0x37AD, 0xD862, 0xDD88, 0x4988,
- 0xD862, 0xDDBA, 0x4992, 0xD862, 0xDDBB, 0x4993, 0xD862, 0xDE1E, 0x499B,
- 0xD862, 0xDE29, 0x499C, 0xD862, 0xDE43, 0x49A0, 0xD862, 0xDE71, 0x499F,
- 0xD862, 0xDE99, 0x49A7, 0xD862, 0xDECD, 0x49A8, 0xD862, 0xDEDD, 0x49AF,
- 0xD862, 0xDEE4, 0x49AE, 0xD862, 0xDFC1, 0x49BA, 0xD862, 0xDFEF, 0x49BB,
- 0xD863, 0xDCDD, 0x1DD9, 0xD863, 0xDD10, 0x49C2, 0xD863, 0xDD71, 0x49C3,
- 0xD863, 0xDDFB, 0x49C5, 0xD863, 0xDE17, 0x37B0, 0xD863, 0xDE1F, 0x49C6,
- 0xD863, 0xDE36, 0x49CA, 0xD863, 0xDE89, 0x49CD, 0xD863, 0xDEEB, 0x49CF,
- 0xD863, 0xDEF6, 0x1DF9, 0xD863, 0xDF32, 0x49D1, 0xD863, 0xDFF8, 0x49D7,
- 0xD864, 0xDEA0, 0x49E5, 0xD864, 0xDEB1, 0x49E6, 0xD865, 0xDC90, 0x49F7,
- 0xD865, 0xDDCF, 0x4A00, 0xD865, 0xDE7F, 0x3619, 0xD865, 0xDEF0, 0x4A0F,
- 0xD865, 0xDF19, 0x4A12, 0xD865, 0xDF50, 0x4A16, 0xD866, 0xDCC6, 0x4A27,
- 0xD866, 0xDE72, 0x4A39, 0xD867, 0xDD4B, 0x3595, 0xD867, 0xDDDB, 0x4A52,
- 0xD867, 0xDE15, 0x4A5C, 0xD867, 0xDE3D, 0x4F5B, 0xD867, 0xDE49, 0x4A5E,
- 0xD867, 0xDE8A, 0x4A5D, 0xD867, 0xDEC4, 0x4A66, 0xD867, 0xDEDB, 0x4A6E,
- 0xD867, 0xDEE9, 0x4A6B, 0xD867, 0xDFCE, 0x4A7F, 0xD867, 0xDFD7, 0x4A7F,
- 0xD868, 0xDC1A, 0x4A85, 0xD868, 0xDC2F, 0x4A83, 0xD868, 0xDC82, 0x4A8C,
- 0xD868, 0xDCF9, 0x4A8B, 0xD868, 0xDD90, 0x434B, 0xD868, 0xDEB2, 0x4E68,
- 0xD868, 0xDF8C, 0x4AA5, 0xD869, 0xDC37, 0x4AA7, 0xD869, 0xDDF1, 0x4AB3,
- 0xD869, 0xDE02, 0x4AB5, 0xD869, 0xDE1A, 0x4F5C, 0xD869, 0xDEB2, 0x4AB9,
- 0xD87E, 0xDC04, 0x3C1C, 0xD87E, 0xDC0F, 0x1E86, 0xD87E, 0xDC15, 0x4E5D,
- 0xD87E, 0xDC18, 0x1E89, 0xD87E, 0xDC1A, 0x3682, 0xD87E, 0xDC22, 0x3574,
- 0xD87E, 0xDC28, 0x35EF, 0xD87E, 0xDC2C, 0x371D, 0xD87E, 0xDC33, 0x3597,
- 0xD87E, 0xDC3F, 0x35F7, 0xD87E, 0xDC46, 0x4E5E, 0xD87E, 0xDC52, 0x3611,
- 0xD87E, 0xDC62, 0x36AE, 0xD87E, 0xDC6D, 0x3729, 0xD87E, 0xDC73, 0x3608,
- 0xD87E, 0xDC77, 0x1E4A, 0xD87E, 0xDC84, 0x1E36, 0xD87E, 0xDC99, 0x4E5F,
- 0xD87E, 0xDC9A, 0x3668, 0xD87E, 0xDCA6, 0x4E60, 0xD87E, 0xDCAC, 0x35B6,
- 0xD87E, 0xDCB2, 0x362B, 0xD87E, 0xDCB6, 0x3731, 0xD87E, 0xDCD3, 0x1E88,
- 0xD87E, 0xDCDB, 0x373C, 0xD87E, 0xDCDC, 0x1E0F, 0xD87E, 0xDCE1, 0x37D3,
- 0xD87E, 0xDCE5, 0x4E61, 0xD87E, 0xDCEA, 0x356F, 0xD87E, 0xDCED, 0x1DF1,
- 0xD87E, 0xDCFC, 0x3558, 0xD87E, 0xDD03, 0x35C8, 0xD87E, 0xDD0B, 0x35E9,
- 0xD87E, 0xDD0F, 0x366C, 0xD87E, 0xDD1A, 0x365C, 0xD87E, 0xDD20, 0x1E9F,
- 0xD87E, 0xDD21, 0x35F1, 0xD87E, 0xDD45, 0x342D, 0xD87E, 0xDD47, 0x361E,
- 0xD87E, 0xDD6C, 0x3764, 0xD87E, 0xDD95, 0x3566, 0xD87E, 0xDDD0, 0x36F4,
- 0xD87E, 0xDDDE, 0x4E62, 0xD87E, 0xDDDF, 0x36F5, 0xD87E, 0xDDF4, 0x3BA5,
-};
+// 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
+
+extern const unsigned short g_FXCMAP_UniJIS_UTF16_H_5[13241 * 2] = {
+ 0x0020, 0x0001, 0x0021, 0x0002, 0x0022, 0x0003, 0x0023, 0x0004,
+ 0x0024, 0x0005, 0x0025, 0x0006, 0x0026, 0x0007, 0x0027, 0x0008,
+ 0x0028, 0x0009, 0x0029, 0x000A, 0x002A, 0x000B, 0x002B, 0x000C,
+ 0x002C, 0x000D, 0x002D, 0x000E, 0x002E, 0x000F, 0x002F, 0x0010,
+ 0x0030, 0x0011, 0x0031, 0x0012, 0x0032, 0x0013, 0x0033, 0x0014,
+ 0x0034, 0x0015, 0x0035, 0x0016, 0x0036, 0x0017, 0x0037, 0x0018,
+ 0x0038, 0x0019, 0x0039, 0x001A, 0x003A, 0x001B, 0x003B, 0x001C,
+ 0x003C, 0x001D, 0x003D, 0x001E, 0x003E, 0x001F, 0x003F, 0x0020,
+ 0x0040, 0x0021, 0x0041, 0x0022, 0x0042, 0x0023, 0x0043, 0x0024,
+ 0x0044, 0x0025, 0x0045, 0x0026, 0x0046, 0x0027, 0x0047, 0x0028,
+ 0x0048, 0x0029, 0x0049, 0x002A, 0x004A, 0x002B, 0x004B, 0x002C,
+ 0x004C, 0x002D, 0x004D, 0x002E, 0x004E, 0x002F, 0x004F, 0x0030,
+ 0x0050, 0x0031, 0x0051, 0x0032, 0x0052, 0x0033, 0x0053, 0x0034,
+ 0x0054, 0x0035, 0x0055, 0x0036, 0x0056, 0x0037, 0x0057, 0x0038,
+ 0x0058, 0x0039, 0x0059, 0x003A, 0x005A, 0x003B, 0x005B, 0x003C,
+ 0x005C, 0x0061, 0x005D, 0x003E, 0x005E, 0x003F, 0x005F, 0x0040,
+ 0x0060, 0x0041, 0x0061, 0x0042, 0x0062, 0x0043, 0x0063, 0x0044,
+ 0x0064, 0x0045, 0x0065, 0x0046, 0x0066, 0x0047, 0x0067, 0x0048,
+ 0x0068, 0x0049, 0x0069, 0x004A, 0x006A, 0x004B, 0x006B, 0x004C,
+ 0x006C, 0x004D, 0x006D, 0x004E, 0x006E, 0x004F, 0x006F, 0x0050,
+ 0x0070, 0x0051, 0x0071, 0x0052, 0x0072, 0x0053, 0x0073, 0x0054,
+ 0x0074, 0x0055, 0x0075, 0x0056, 0x0076, 0x0057, 0x0077, 0x0058,
+ 0x0078, 0x0059, 0x0079, 0x005A, 0x007A, 0x005B, 0x007B, 0x005C,
+ 0x007C, 0x0063, 0x007D, 0x005E, 0x007E, 0x0064, 0x00A0, 0x0001,
+ 0x00A1, 0x0065, 0x00A2, 0x0066, 0x00A3, 0x0067, 0x00A4, 0x006B,
+ 0x00A5, 0x003D, 0x00A6, 0x005D, 0x00A7, 0x02D0, 0x00A8, 0x0287,
+ 0x00A9, 0x0098, 0x00AA, 0x008C, 0x00AB, 0x006D, 0x00AC, 0x0099,
+ 0x00AD, 0x0097, 0x00AE, 0x009A, 0x00AF, 0x0081, 0x00B0, 0x02C3,
+ 0x00B1, 0x02B6, 0x00B2, 0x009D, 0x00B3, 0x009E, 0x00B4, 0x0285,
+ 0x00B5, 0x009F, 0x00B6, 0x030A, 0x00B7, 0x0075, 0x00B8, 0x0086,
+ 0x00B9, 0x00A0, 0x00BA, 0x0090, 0x00BB, 0x007B, 0x00BC, 0x00A1,
+ 0x00BD, 0x00A2, 0x00BE, 0x00A3, 0x00BF, 0x007E, 0x00C0, 0x00A4,
+ 0x00C1, 0x00A5, 0x00C2, 0x00A6, 0x00C3, 0x00A7, 0x00C4, 0x00A8,
+ 0x00C5, 0x00A9, 0x00C6, 0x008B, 0x00C7, 0x00AA, 0x00C8, 0x00AB,
+ 0x00C9, 0x00AC, 0x00CA, 0x00AD, 0x00CB, 0x00AE, 0x00CC, 0x00AF,
+ 0x00CD, 0x00B0, 0x00CE, 0x00B1, 0x00CF, 0x00B2, 0x00D0, 0x00B3,
+ 0x00D1, 0x00B4, 0x00D2, 0x00B5, 0x00D3, 0x00B6, 0x00D4, 0x00B7,
+ 0x00D5, 0x00B8, 0x00D6, 0x00B9, 0x00D7, 0x02B7, 0x00D8, 0x008E,
+ 0x00D9, 0x00BB, 0x00DA, 0x00BC, 0x00DB, 0x00BD, 0x00DC, 0x00BE,
+ 0x00DD, 0x00BF, 0x00DE, 0x00C0, 0x00DF, 0x0096, 0x00E0, 0x00C1,
+ 0x00E1, 0x00C2, 0x00E2, 0x00C3, 0x00E3, 0x00C4, 0x00E4, 0x00C5,
+ 0x00E5, 0x00C6, 0x00E6, 0x0091, 0x00E7, 0x00C7, 0x00E8, 0x00C8,
+ 0x00E9, 0x00C9, 0x00EA, 0x00CA, 0x00EB, 0x00CB, 0x00EC, 0x00CC,
+ 0x00ED, 0x00CD, 0x00EE, 0x00CE, 0x00EF, 0x00CF, 0x00F0, 0x00D0,
+ 0x00F1, 0x00D1, 0x00F2, 0x00D2, 0x00F3, 0x00D3, 0x00F4, 0x00D4,
+ 0x00F5, 0x00D5, 0x00F6, 0x00D6, 0x00F7, 0x02B8, 0x00F8, 0x0094,
+ 0x00F9, 0x00D8, 0x00FA, 0x00D9, 0x00FB, 0x00DA, 0x00FC, 0x00DB,
+ 0x00FD, 0x00DC, 0x00FE, 0x00DD, 0x00FF, 0x00DE, 0x0100, 0x2496,
+ 0x0101, 0x2491, 0x0102, 0x3D8C, 0x0103, 0x3D99, 0x0104, 0x3D79,
+ 0x0105, 0x3D81, 0x0106, 0x3D8E, 0x0107, 0x3D9B, 0x0108, 0x3DA7,
+ 0x0109, 0x3DAD, 0x010C, 0x3D8F, 0x010D, 0x3D9C, 0x010E, 0x3D91,
+ 0x010F, 0x3D9E, 0x0111, 0x3D9F, 0x0112, 0x2499, 0x0113, 0x2494,
+ 0x0118, 0x3D90, 0x0119, 0x3D9D, 0x011A, 0x24B3, 0x011B, 0x24BF,
+ 0x011C, 0x3DA8, 0x011D, 0x3DAE, 0x0124, 0x3DA9, 0x0125, 0x3DAF,
+ 0x0127, 0x3DC8, 0x0128, 0x24B8, 0x0129, 0x24C4, 0x012A, 0x2497,
+ 0x012B, 0x2492, 0x0131, 0x0092, 0x0134, 0x3DAA, 0x0135, 0x3DB0,
+ 0x0139, 0x3D8D, 0x013A, 0x3D9A, 0x013D, 0x3D7B, 0x013E, 0x3D83,
+ 0x0141, 0x008D, 0x0142, 0x0093, 0x0143, 0x3D92, 0x0144, 0x3DA0,
+ 0x0147, 0x3D93, 0x0148, 0x3DA1, 0x014B, 0x24DC, 0x014C, 0x249A,
+ 0x014D, 0x2495, 0x0150, 0x3D94, 0x0151, 0x3DA2, 0x0152, 0x008F,
+ 0x0153, 0x0095, 0x0154, 0x3D8B, 0x0155, 0x3D98, 0x0158, 0x3D95,
+ 0x0159, 0x3DA3, 0x015A, 0x3D7C, 0x015B, 0x3D84, 0x015C, 0x3DAB,
+ 0x015D, 0x3DB1, 0x015E, 0x3D7D, 0x015F, 0x3D86, 0x0160, 0x00DF,
+ 0x0161, 0x00E3, 0x0162, 0x3D97, 0x0163, 0x3DA5, 0x0164, 0x3D7E,
+ 0x0165, 0x3D87, 0x0168, 0x24BD, 0x0169, 0x24C9, 0x016A, 0x2498,
+ 0x016B, 0x2493, 0x016C, 0x3DAC, 0x016D, 0x3DB2, 0x016E, 0x24BC,
+ 0x016F, 0x24C8, 0x0170, 0x3D96, 0x0171, 0x3DA4, 0x0178, 0x00E0,
+ 0x0179, 0x3D7F, 0x017A, 0x3D88, 0x017B, 0x3D80, 0x017C, 0x3D8A,
+ 0x017D, 0x00E1, 0x017E, 0x00E5, 0x0192, 0x0069, 0x0193, 0x3DD2,
+ 0x01C2, 0x3DCD, 0x01CD, 0x24B2, 0x01CE, 0x24BE, 0x01CF, 0x24B6,
+ 0x01D0, 0x24C2, 0x01D1, 0x24B9, 0x01D2, 0x24C5, 0x01D3, 0x24BB,
+ 0x01D4, 0x24C7, 0x01D6, 0x3D75, 0x01D8, 0x3D76, 0x01DA, 0x3D77,
+ 0x01DC, 0x3D78, 0x01F8, 0x3D73, 0x01F9, 0x3D74, 0x01FD, 0x24CD,
+ 0x0250, 0x3DD8, 0x0251, 0x24CA, 0x0252, 0x3DDC, 0x0253, 0x3DCE,
+ 0x0254, 0x24CF, 0x0255, 0x3DE1, 0x0256, 0x3DBA, 0x0257, 0x3DCF,
+ 0x0258, 0x3DD5, 0x0259, 0x24D2, 0x025A, 0x24D5, 0x025B, 0x24D8,
+ 0x025C, 0x3DD6, 0x025E, 0x3DD7, 0x025F, 0x3DC1, 0x0260, 0x3DD1,
+ 0x0261, 0x3DC5, 0x0262, 0x3E0B, 0x0263, 0x3E0C, 0x0264, 0x3DDB,
+ 0x0265, 0x3DDE, 0x0266, 0x3DCB, 0x0267, 0x3DE4, 0x0268, 0x3DD3,
+ 0x026A, 0x3E0D, 0x026C, 0x3DB6, 0x026D, 0x3DC0, 0x026E, 0x3DB7,
+ 0x026F, 0x3DD9, 0x0270, 0x3DC6, 0x0271, 0x3DB3, 0x0272, 0x3DC2,
+ 0x0273, 0x3DBB, 0x0274, 0x3E0E, 0x0275, 0x24DD, 0x0276, 0x3E0F,
+ 0x0278, 0x3E10, 0x0279, 0x3DB8, 0x027A, 0x3DE3, 0x027B, 0x3DBF,
+ 0x027D, 0x3DBC, 0x027E, 0x3DB5, 0x0280, 0x3E11, 0x0281, 0x3DC7,
+ 0x0282, 0x3DBD, 0x0283, 0x24E2, 0x0284, 0x3DD0, 0x0288, 0x3DB9,
+ 0x0289, 0x3DD4, 0x028A, 0x3DDA, 0x028B, 0x3DB4, 0x028C, 0x24DE,
+ 0x028D, 0x3DDD, 0x028E, 0x3DC4, 0x028F, 0x3E12, 0x0290, 0x3DBE,
+ 0x0291, 0x3DE2, 0x0292, 0x24E1, 0x0294, 0x3DCA, 0x0295, 0x3DC9,
+ 0x0298, 0x3DCC, 0x0299, 0x3E13, 0x029C, 0x3E14, 0x029D, 0x3DC3,
+ 0x029F, 0x3E15, 0x02A1, 0x3DE0, 0x02A2, 0x3DDF, 0x02B0, 0x3E16,
+ 0x02B2, 0x3E17, 0x02B7, 0x3E18, 0x02BB, 0x0062, 0x02BC, 0x0060,
+ 0x02C1, 0x3E19, 0x02C6, 0x0080, 0x02C7, 0x3D85, 0x02C8, 0x3DE6,
+ 0x02CC, 0x3DE7, 0x02D0, 0x24E3, 0x02D1, 0x3DE8, 0x02D8, 0x3D7A,
+ 0x02D9, 0x3DA6, 0x02DA, 0x0085, 0x02DB, 0x3D82, 0x02DC, 0x005F,
+ 0x02DD, 0x3D89, 0x02DE, 0x3DFB, 0x02E0, 0x3E1A, 0x02E1, 0x3E1B,
+ 0x02E5, 0x3DEB, 0x02E6, 0x3DEC, 0x02E7, 0x3DED, 0x02E8, 0x3DEE,
+ 0x02E9, 0x3DEF, 0x0300, 0x0041, 0x0301, 0x007F, 0x0302, 0x0080,
+ 0x0303, 0x005F, 0x0304, 0x0081, 0x0305, 0x00E2, 0x0306, 0x0082,
+ 0x0307, 0x0083, 0x0308, 0x0084, 0x030A, 0x0085, 0x030B, 0x0087,
+ 0x030C, 0x0089, 0x030F, 0x3DEA, 0x0318, 0x3E02, 0x0319, 0x3E03,
+ 0x031A, 0x3E07, 0x031C, 0x3DF5, 0x031D, 0x3E00, 0x031E, 0x3E01,
+ 0x031F, 0x3DF6, 0x0320, 0x3DF7, 0x0324, 0x3DFC, 0x0325, 0x3DF2,
+ 0x0327, 0x0086, 0x0328, 0x0088, 0x0329, 0x3DF9, 0x032A, 0x3E04,
+ 0x032C, 0x3DF3, 0x032F, 0x3DFA, 0x0330, 0x3DFD, 0x0332, 0x0040,
+ 0x0334, 0x3DFF, 0x0336, 0x008A, 0x0339, 0x3DF4, 0x033A, 0x3E05,
+ 0x033B, 0x3E06, 0x033C, 0x3DFE, 0x033D, 0x3DF8, 0x0361, 0x3DE5,
+ 0x0391, 0x03F3, 0x0392, 0x03F4, 0x0393, 0x03F5, 0x0394, 0x03F6,
+ 0x0395, 0x03F7, 0x0396, 0x03F8, 0x0397, 0x03F9, 0x0398, 0x03FA,
+ 0x0399, 0x03FB, 0x039A, 0x03FC, 0x039B, 0x03FD, 0x039C, 0x03FE,
+ 0x039D, 0x03FF, 0x039E, 0x0400, 0x039F, 0x0401, 0x03A0, 0x0402,
+ 0x03A1, 0x0403, 0x03A3, 0x0404, 0x03A4, 0x0405, 0x03A5, 0x0406,
+ 0x03A6, 0x0407, 0x03A7, 0x0408, 0x03A8, 0x0409, 0x03A9, 0x040A,
+ 0x03B1, 0x040B, 0x03B2, 0x040C, 0x03B3, 0x040D, 0x03B4, 0x040E,
+ 0x03B5, 0x040F, 0x03B6, 0x0410, 0x03B7, 0x0411, 0x03B8, 0x0412,
+ 0x03B9, 0x0413, 0x03BA, 0x0414, 0x03BB, 0x0415, 0x03BC, 0x0416,
+ 0x03BD, 0x0417, 0x03BE, 0x0418, 0x03BF, 0x0419, 0x03C0, 0x041A,
+ 0x03C1, 0x041B, 0x03C2, 0x3F5E, 0x03C3, 0x041C, 0x03C4, 0x041D,
+ 0x03C5, 0x041E, 0x03C6, 0x041F, 0x03C7, 0x0420, 0x03C8, 0x0421,
+ 0x03C9, 0x0422, 0x03D0, 0x2F3A, 0x03D1, 0x2F40, 0x03D5, 0x2F3E,
+ 0x03DB, 0x2F3F, 0x0401, 0x0429, 0x0410, 0x0423, 0x0411, 0x0424,
+ 0x0412, 0x0425, 0x0413, 0x0426, 0x0414, 0x0427, 0x0415, 0x0428,
+ 0x0416, 0x042A, 0x0417, 0x042B, 0x0418, 0x042C, 0x0419, 0x042D,
+ 0x041A, 0x042E, 0x041B, 0x042F, 0x041C, 0x0430, 0x041D, 0x0431,
+ 0x041E, 0x0432, 0x041F, 0x0433, 0x0420, 0x0434, 0x0421, 0x0435,
+ 0x0422, 0x0436, 0x0423, 0x0437, 0x0424, 0x0438, 0x0425, 0x0439,
+ 0x0426, 0x043A, 0x0427, 0x043B, 0x0428, 0x043C, 0x0429, 0x043D,
+ 0x042A, 0x043E, 0x042B, 0x043F, 0x042C, 0x0440, 0x042D, 0x0441,
+ 0x042E, 0x0442, 0x042F, 0x0443, 0x0430, 0x0444, 0x0431, 0x0445,
+ 0x0432, 0x0446, 0x0433, 0x0447, 0x0434, 0x0448, 0x0435, 0x0449,
+ 0x0436, 0x044B, 0x0437, 0x044C, 0x0438, 0x044D, 0x0439, 0x044E,
+ 0x043A, 0x044F, 0x043B, 0x0450, 0x043C, 0x0451, 0x043D, 0x0452,
+ 0x043E, 0x0453, 0x043F, 0x0454, 0x0440, 0x0455, 0x0441, 0x0456,
+ 0x0442, 0x0457, 0x0443, 0x0458, 0x0444, 0x0459, 0x0445, 0x045A,
+ 0x0446, 0x045B, 0x0447, 0x045C, 0x0448, 0x045D, 0x0449, 0x045E,
+ 0x044A, 0x045F, 0x044B, 0x0460, 0x044C, 0x0461, 0x044D, 0x0462,
+ 0x044E, 0x0463, 0x044F, 0x0464, 0x0451, 0x044A, 0x1E3E, 0x3D71,
+ 0x1E3F, 0x3D72, 0x1EBC, 0x24B5, 0x1EBD, 0x24C1, 0x1F70, 0x24CC,
+ 0x1F71, 0x24CB, 0x1F72, 0x24DA, 0x1F73, 0x24D9, 0x2002, 0x00E7,
+ 0x2003, 0x0279, 0x2010, 0x0296, 0x2011, 0x000E, 0x2012, 0x0072,
+ 0x2013, 0x0072, 0x2014, 0x008A, 0x2015, 0x0295, 0x2016, 0x029A,
+ 0x2018, 0x0062, 0x2019, 0x0060, 0x201A, 0x0078, 0x201C, 0x006C,
+ 0x201D, 0x007A, 0x201E, 0x0079, 0x2020, 0x0308, 0x2021, 0x0309,
+ 0x2022, 0x0077, 0x2025, 0x029D, 0x2026, 0x029C, 0x2030, 0x0304,
+ 0x2032, 0x02C4, 0x2033, 0x02C5, 0x2039, 0x006E, 0x203A, 0x006F,
+ 0x203B, 0x02DE, 0x203C, 0x2F4F, 0x203E, 0x00E2, 0x203F, 0x3DE9,
+ 0x2042, 0x3F9A, 0x2044, 0x0068, 0x2047, 0x3F96, 0x2048, 0x3F97,
+ 0x2049, 0x2F50, 0x2051, 0x3F99, 0x2070, 0x24A1, 0x2074, 0x24A2,
+ 0x2075, 0x24A3, 0x2076, 0x24A4, 0x2077, 0x24A5, 0x2078, 0x24A6,
+ 0x2079, 0x24A7, 0x2080, 0x24A8, 0x2081, 0x24A9, 0x2082, 0x24AA,
+ 0x2083, 0x24AB, 0x2084, 0x24AC, 0x2085, 0x24AD, 0x2086, 0x24AE,
+ 0x2087, 0x24AF, 0x2088, 0x24B0, 0x2089, 0x24B1, 0x20AC, 0x248A,
+ 0x20DD, 0x3FC8, 0x20DE, 0x2B1B, 0x2100, 0x2E4F, 0x2103, 0x02C6,
+ 0x2105, 0x2E53, 0x2109, 0x2071, 0x210A, 0x2070, 0x210F, 0x2F3C,
+ 0x2113, 0x1F59, 0x2116, 0x1DBA, 0x2121, 0x1F77, 0x2122, 0x00E4,
+ 0x2126, 0x248B, 0x2127, 0x3C9B, 0x212B, 0x0303, 0x2135, 0x2F39,
+ 0x213B, 0x2073, 0x2153, 0x249F, 0x2154, 0x24A0, 0x2155, 0x3D6F,
+ 0x2156, 0x2639, 0x2157, 0x263A, 0x2158, 0x263B, 0x2159, 0x263C,
+ 0x215A, 0x263D, 0x215B, 0x249B, 0x215C, 0x249C, 0x215D, 0x249D,
+ 0x215E, 0x249E, 0x2160, 0x1D97, 0x2161, 0x1D98, 0x2162, 0x1D99,
+ 0x2163, 0x1D9A, 0x2164, 0x1D9B, 0x2165, 0x1D9C, 0x2166, 0x1D9D,
+ 0x2167, 0x1D9E, 0x2168, 0x1D9F, 0x2169, 0x1DA0, 0x216A, 0x2021,
+ 0x216B, 0x2022, 0x2170, 0x1F9C, 0x2171, 0x1F9D, 0x2172, 0x1F9E,
+ 0x2173, 0x1F9F, 0x2174, 0x1FA0, 0x2175, 0x1FA1, 0x2176, 0x1FA2,
+ 0x2177, 0x1FA3, 0x2178, 0x1FA4, 0x2179, 0x1FA5, 0x217A, 0x206A,
+ 0x217B, 0x206B, 0x217F, 0x206F, 0x2190, 0x02E1, 0x2191, 0x02E2,
+ 0x2192, 0x02E0, 0x2193, 0x02E3, 0x2194, 0x2FA9, 0x2196, 0x2FAC,
+ 0x2197, 0x2FAD, 0x2198, 0x2FAA, 0x2199, 0x2FAB, 0x21C4, 0x2076,
+ 0x21C5, 0x2077, 0x21C6, 0x2075, 0x21CB, 0x2FAF, 0x21CC, 0x2FAE,
+ 0x21D0, 0x2FA8, 0x21D2, 0x02F0, 0x21D4, 0x02F1, 0x21E6, 0x1F4D,
+ 0x21E7, 0x1F4C, 0x21E8, 0x1F4E, 0x21E9, 0x1F4B, 0x2200, 0x02F2,
+ 0x2202, 0x02F7, 0x2203, 0x02F3, 0x2205, 0x2F98, 0x2207, 0x02F8,
+ 0x2208, 0x02E5, 0x2209, 0x3C74, 0x220A, 0x2F3B, 0x220B, 0x02E6,
+ 0x2211, 0x1DC9, 0x2212, 0x02B5, 0x2213, 0x2F56, 0x2219, 0x0075,
+ 0x221A, 0x02FD, 0x221D, 0x02FF, 0x221E, 0x02BF, 0x221F, 0x1DCD,
+ 0x2220, 0x02F4, 0x2225, 0x3C81, 0x2226, 0x3C82, 0x2227, 0x02ED,
+ 0x2228, 0x02EE, 0x2229, 0x02EC, 0x222A, 0x02EB, 0x222B, 0x0301,
+ 0x222C, 0x0302, 0x222D, 0x2003, 0x222E, 0x1DC8, 0x2234, 0x02C0,
+ 0x2235, 0x0300, 0x223C, 0x0064, 0x223D, 0x02FE, 0x2243, 0x2F58,
+ 0x2245, 0x3C93, 0x2248, 0x3C94, 0x2252, 0x02FA, 0x2260, 0x02BA,
+ 0x2261, 0x02F9, 0x2262, 0x3C91, 0x2266, 0x02BD, 0x2267, 0x02BE,
+ 0x226A, 0x02FB, 0x226B, 0x02FC, 0x2272, 0x2F59, 0x2273, 0x2F5A,
+ 0x2276, 0x3C95, 0x2277, 0x3C96, 0x2282, 0x02E9, 0x2283, 0x02EA,
+ 0x2284, 0x3C70, 0x2285, 0x3C71, 0x2286, 0x02E7, 0x2287, 0x02E8,
+ 0x228A, 0x3C72, 0x228B, 0x3C73, 0x2295, 0x2F9C, 0x2296, 0x2F9A,
+ 0x2297, 0x2F9D, 0x2298, 0x2F9B, 0x229E, 0x3E22, 0x22A0, 0x2F99,
+ 0x22A5, 0x02F5, 0x22BF, 0x1DCE, 0x22DA, 0x3D6D, 0x22DB, 0x3D6E,
+ 0x2305, 0x3C76, 0x2306, 0x3C77, 0x2307, 0x2FBB, 0x2312, 0x02F6,
+ 0x2318, 0x3D70, 0x239B, 0x2F6F, 0x239C, 0x2F87, 0x239D, 0x2F70,
+ 0x239E, 0x2F71, 0x239F, 0x2F87, 0x23A0, 0x2F72, 0x23A1, 0x2F77,
+ 0x23A2, 0x2F87, 0x23A3, 0x2F78, 0x23A4, 0x2F79, 0x23A5, 0x2F87,
+ 0x23A6, 0x2F7A, 0x23A7, 0x1FF2, 0x23A8, 0x1FF3, 0x23A9, 0x1FF4,
+ 0x23AA, 0x2F87, 0x23AB, 0x1FEE, 0x23AC, 0x1FEF, 0x23AD, 0x1FF0,
+ 0x23B0, 0x3FB8, 0x23B1, 0x3FB9, 0x23BE, 0x3F7D, 0x23BF, 0x3F7E,
+ 0x23C0, 0x3F7F, 0x23C1, 0x3F80, 0x23C2, 0x3F81, 0x23C3, 0x3F82,
+ 0x23C4, 0x3F83, 0x23C5, 0x3F84, 0x23C6, 0x3F85, 0x23C7, 0x3F86,
+ 0x23C8, 0x3F87, 0x23C9, 0x3F88, 0x23CA, 0x3F89, 0x23CB, 0x3F8A,
+ 0x23CC, 0x3F8B, 0x23CE, 0x3F91, 0x2423, 0x3F90, 0x2460, 0x1D83,
+ 0x2461, 0x1D84, 0x2462, 0x1D85, 0x2463, 0x1D86, 0x2464, 0x1D87,
+ 0x2465, 0x1D88, 0x2466, 0x1D89, 0x2467, 0x1D8A, 0x2468, 0x1D8B,
+ 0x2469, 0x1D8C, 0x246A, 0x1D8D, 0x246B, 0x1D8E, 0x246C, 0x1D8F,
+ 0x246D, 0x1D90, 0x246E, 0x1D91, 0x246F, 0x1D92, 0x2470, 0x1D93,
+ 0x2471, 0x1D94, 0x2472, 0x1D95, 0x2473, 0x1D96, 0x2474, 0x1F87,
+ 0x2475, 0x1F88, 0x2476, 0x1F89, 0x2477, 0x1F8A, 0x2478, 0x1F8B,
+ 0x2479, 0x1F8C, 0x247A, 0x1F8D, 0x247B, 0x1F8E, 0x247C, 0x1F8F,
+ 0x247D, 0x1F90, 0x247E, 0x1F91, 0x247F, 0x1F92, 0x2480, 0x1F93,
+ 0x2481, 0x1F94, 0x2482, 0x1F95, 0x2483, 0x1F96, 0x2484, 0x1F97,
+ 0x2485, 0x1F98, 0x2486, 0x1F99, 0x2487, 0x1F9A, 0x2488, 0x1F7E,
+ 0x2489, 0x1F7F, 0x248A, 0x1F80, 0x248B, 0x1F81, 0x248C, 0x1F82,
+ 0x248D, 0x1F83, 0x248E, 0x1F84, 0x248F, 0x1F85, 0x2490, 0x1F86,
+ 0x249C, 0x1FB0, 0x249D, 0x1FB1, 0x249E, 0x1FB2, 0x249F, 0x1FB3,
+ 0x24A0, 0x1FB4, 0x24A1, 0x1FB5, 0x24A2, 0x1FB6, 0x24A3, 0x1FB7,
+ 0x24A4, 0x1FB8, 0x24A5, 0x1FB9, 0x24A6, 0x1FBA, 0x24A7, 0x1FBB,
+ 0x24A8, 0x1FBC, 0x24A9, 0x1FBD, 0x24AA, 0x1FBE, 0x24AB, 0x1FBF,
+ 0x24AC, 0x1FC0, 0x24AD, 0x1FC1, 0x24AE, 0x1FC2, 0x24AF, 0x1FC3,
+ 0x24B0, 0x1FC4, 0x24B1, 0x1FC5, 0x24B2, 0x1FC6, 0x24B3, 0x1FC7,
+ 0x24B4, 0x1FC8, 0x24B5, 0x1FC9, 0x24B6, 0x2863, 0x24B7, 0x2864,
+ 0x24B8, 0x2865, 0x24B9, 0x2866, 0x24BA, 0x2867, 0x24BB, 0x2868,
+ 0x24BC, 0x2869, 0x24BD, 0x286A, 0x24BE, 0x286B, 0x24BF, 0x286C,
+ 0x24C0, 0x286D, 0x24C1, 0x286E, 0x24C2, 0x286F, 0x24C3, 0x2870,
+ 0x24C4, 0x2871, 0x24C5, 0x2872, 0x24C6, 0x2873, 0x24C7, 0x2874,
+ 0x24C8, 0x2875, 0x24C9, 0x2876, 0x24CA, 0x2877, 0x24CB, 0x2878,
+ 0x24CC, 0x2879, 0x24CD, 0x287A, 0x24CE, 0x287B, 0x24CF, 0x287C,
+ 0x24D0, 0x2849, 0x24D1, 0x284A, 0x24D2, 0x284B, 0x24D3, 0x284C,
+ 0x24D4, 0x284D, 0x24D5, 0x284E, 0x24D6, 0x284F, 0x24D7, 0x2850,
+ 0x24D8, 0x2851, 0x24D9, 0x2852, 0x24DA, 0x2853, 0x24DB, 0x2854,
+ 0x24DC, 0x2855, 0x24DD, 0x2856, 0x24DE, 0x2857, 0x24DF, 0x2858,
+ 0x24E0, 0x2859, 0x24E1, 0x285A, 0x24E2, 0x285B, 0x24E3, 0x285C,
+ 0x24E4, 0x285D, 0x24E5, 0x285E, 0x24E6, 0x285F, 0x24E7, 0x2860,
+ 0x24E8, 0x2861, 0x24E9, 0x2862, 0x24EA, 0x2020, 0x24EB, 0x2913,
+ 0x24EC, 0x2914, 0x24ED, 0x2915, 0x24EE, 0x2916, 0x24EF, 0x2917,
+ 0x24F0, 0x2918, 0x24F1, 0x2919, 0x24F2, 0x291A, 0x24F3, 0x291B,
+ 0x24F4, 0x291C, 0x24F5, 0x3F5F, 0x24F6, 0x3F60, 0x24F7, 0x3F61,
+ 0x24F8, 0x3F62, 0x24F9, 0x3F63, 0x24FA, 0x3F64, 0x24FB, 0x3F65,
+ 0x24FC, 0x3F66, 0x24FD, 0x3F67, 0x24FE, 0x3F68, 0x24FF, 0x2907,
+ 0x2500, 0x1D37, 0x2501, 0x1D38, 0x2502, 0x1D39, 0x2503, 0x1D3A,
+ 0x2504, 0x1D3B, 0x2505, 0x1D3C, 0x2506, 0x1D3D, 0x2507, 0x1D3E,
+ 0x2508, 0x1D3F, 0x2509, 0x1D40, 0x250A, 0x1D41, 0x250B, 0x1D42,
+ 0x250C, 0x1D43, 0x250D, 0x1D44, 0x250E, 0x1D45, 0x250F, 0x1D46,
+ 0x2510, 0x1D47, 0x2511, 0x1D48, 0x2512, 0x1D49, 0x2513, 0x1D4A,
+ 0x2514, 0x1D4B, 0x2515, 0x1D4C, 0x2516, 0x1D4D, 0x2517, 0x1D4E,
+ 0x2518, 0x1D4F, 0x2519, 0x1D50, 0x251A, 0x1D51, 0x251B, 0x1D52,
+ 0x251C, 0x1D53, 0x251D, 0x1D54, 0x251E, 0x1D55, 0x251F, 0x1D56,
+ 0x2520, 0x1D57, 0x2521, 0x1D58, 0x2522, 0x1D59, 0x2523, 0x1D5A,
+ 0x2524, 0x1D5B, 0x2525, 0x1D5C, 0x2526, 0x1D5D, 0x2527, 0x1D5E,
+ 0x2528, 0x1D5F, 0x2529, 0x1D60, 0x252A, 0x1D61, 0x252B, 0x1D62,
+ 0x252C, 0x1D63, 0x252D, 0x1D64, 0x252E, 0x1D65, 0x252F, 0x1D66,
+ 0x2530, 0x1D67, 0x2531, 0x1D68, 0x2532, 0x1D69, 0x2533, 0x1D6A,
+ 0x2534, 0x1D6B, 0x2535, 0x1D6C, 0x2536, 0x1D6D, 0x2537, 0x1D6E,
+ 0x2538, 0x1D6F, 0x2539, 0x1D70, 0x253A, 0x1D71, 0x253B, 0x1D72,
+ 0x253C, 0x1D73, 0x253D, 0x1D74, 0x253E, 0x1D75, 0x253F, 0x1D76,
+ 0x2540, 0x1D77, 0x2541, 0x1D78, 0x2542, 0x1D79, 0x2543, 0x1D7A,
+ 0x2544, 0x1D7B, 0x2545, 0x1D7C, 0x2546, 0x1D7D, 0x2547, 0x1D7E,
+ 0x2548, 0x1D7F, 0x2549, 0x1D80, 0x254A, 0x1D81, 0x254B, 0x1D82,
+ 0x2550, 0x203B, 0x255E, 0x203C, 0x2561, 0x203E, 0x256A, 0x203D,
+ 0x256D, 0x2037, 0x256E, 0x2038, 0x256F, 0x203A, 0x2570, 0x2039,
+ 0x2571, 0x2045, 0x2572, 0x2046, 0x2573, 0x2047, 0x2581, 0x2026,
+ 0x2582, 0x2027, 0x2583, 0x2028, 0x2584, 0x2029, 0x2585, 0x202A,
+ 0x2586, 0x202B, 0x2587, 0x202C, 0x2588, 0x202D, 0x2589, 0x2034,
+ 0x258A, 0x2033, 0x258B, 0x2032, 0x258C, 0x2031, 0x258D, 0x2030,
+ 0x258E, 0x202F, 0x258F, 0x202E, 0x2594, 0x2035, 0x2595, 0x2036,
+ 0x25A0, 0x02D9, 0x25A1, 0x02D8, 0x25A2, 0x1F4F, 0x25AA, 0x2FCF,
+ 0x25AB, 0x2FCD, 0x25B1, 0x3F6B, 0x25B2, 0x02DB, 0x25B3, 0x02DA,
+ 0x25B6, 0x2FA3, 0x25B7, 0x1F4A, 0x25BC, 0x02DD, 0x25BD, 0x02DC,
+ 0x25C0, 0x2FA2, 0x25C1, 0x1F49, 0x25C6, 0x02D7, 0x25C7, 0x02D6,
+ 0x25C9, 0x2012, 0x25CB, 0x02D3, 0x25CC, 0x2906, 0x25CE, 0x02D5,
+ 0x25CF, 0x02D4, 0x25D0, 0x3F92, 0x25D1, 0x3F93, 0x25D2, 0x3F94,
+ 0x25D3, 0x3F95, 0x25E2, 0x203F, 0x25E3, 0x2040, 0x25E4, 0x2042,
+ 0x25E5, 0x2041, 0x25E6, 0x2FDE, 0x25EF, 0x030B, 0x2600, 0x2017,
+ 0x2601, 0x2018, 0x2602, 0x2019, 0x2603, 0x201A, 0x2605, 0x02D2,
+ 0x2606, 0x02D1, 0x260E, 0x1F78, 0x2616, 0x3F69, 0x2617, 0x3F6A,
+ 0x261C, 0x201C, 0x261D, 0x201D, 0x261E, 0x201B, 0x261F, 0x201E,
+ 0x2640, 0x02C2, 0x2642, 0x02C1, 0x2660, 0x2013, 0x2661, 0x1F51,
+ 0x2662, 0x1F53, 0x2663, 0x2015, 0x2664, 0x1F52, 0x2665, 0x2014,
+ 0x2666, 0x2016, 0x2667, 0x1F50, 0x2668, 0x2F42, 0x2669, 0x2F43,
+ 0x266A, 0x0307, 0x266B, 0x3F48, 0x266C, 0x2F44, 0x266D, 0x0306,
+ 0x266E, 0x3F47, 0x266F, 0x0305, 0x2672, 0x3FBA, 0x2673, 0x3FBB,
+ 0x2674, 0x3FBC, 0x2675, 0x3FBD, 0x2676, 0x3FBE, 0x2677, 0x3FBF,
+ 0x2678, 0x3FC0, 0x2679, 0x3FC1, 0x267A, 0x3FC2, 0x267B, 0x3FC3,
+ 0x267C, 0x3FC4, 0x267D, 0x3FC5, 0x26A0, 0x2FA0, 0x2702, 0x2F90,
+ 0x2713, 0x3F8E, 0x271A, 0x2FD1, 0x273F, 0x2FC5, 0x2740, 0x2FC4,
+ 0x2756, 0x2FE3, 0x2776, 0x205E, 0x2777, 0x205F, 0x2778, 0x2060,
+ 0x2779, 0x2061, 0x277A, 0x2062, 0x277B, 0x2063, 0x277C, 0x2064,
+ 0x277D, 0x2065, 0x277E, 0x2066, 0x277F, 0x2912, 0x27A1, 0x200E,
+ 0x2934, 0x3F49, 0x2935, 0x3F4A, 0x29BF, 0x3F4B, 0x29FA, 0x3F4F,
+ 0x29FB, 0x3F50, 0x2B05, 0x200F, 0x2B06, 0x2010, 0x2B07, 0x2011,
+ 0x2E83, 0x37E1, 0x2E85, 0x3620, 0x2E87, 0x3719, 0x2E89, 0x3814,
+ 0x2E8B, 0x371E, 0x2E8C, 0x3609, 0x2E8D, 0x360A, 0x2E8E, 0x1071,
+ 0x2E8F, 0x388C, 0x2E90, 0x1226, 0x2E92, 0x0EB2, 0x2E93, 0x1283,
+ 0x2E94, 0x12AB, 0x2E95, 0x3C1F, 0x2E96, 0x38C2, 0x2E97, 0x361C,
+ 0x2E98, 0x38E1, 0x2E99, 0x13C3, 0x2E9B, 0x13E1, 0x2E9E, 0x45E5,
+ 0x2E9F, 0x0E3C, 0x2EA0, 0x0EBD, 0x2EA1, 0x3961, 0x2EA2, 0x3962,
+ 0x2EA3, 0x399D, 0x2EA4, 0x3C26, 0x2EA6, 0x374D, 0x2EA8, 0x39BC,
+ 0x2EA9, 0x35A1, 0x2EAA, 0x36AB, 0x2EAB, 0x3A97, 0x2EAC, 0x4ABA,
+ 0x2EAD, 0x3A39, 0x2EAE, 0x3662, 0x2EB1, 0x3A98, 0x2EB2, 0x3A97,
+ 0x2EB3, 0x376D, 0x2EB7, 0x36FE, 0x2EB9, 0x3713, 0x2EBC, 0x35B3,
+ 0x2EBD, 0x354E, 0x2EBE, 0x3775, 0x2EBF, 0x3776, 0x2EC0, 0x3777,
+ 0x2EC1, 0x078B, 0x2EC2, 0x3B0A, 0x2EC3, 0x362E, 0x2EC4, 0x0A62,
+ 0x2EC6, 0x3572, 0x2ECA, 0x364A, 0x2ECC, 0x3C2B, 0x2ECD, 0x3B50,
+ 0x2ECF, 0x3B9E, 0x2ED1, 0x0BD5, 0x2ED2, 0x3B97, 0x2ED6, 0x3B9E,
+ 0x2ED7, 0x354D, 0x2ED8, 0x0A68, 0x2EDD, 0x3617, 0x2EDE, 0x3619,
+ 0x2EDF, 0x3618, 0x2EE4, 0x064E, 0x2EE8, 0x0D34, 0x2EE9, 0x052B,
+ 0x2EEB, 0x0A6A, 0x2EED, 0x08C3, 0x2EEF, 0x0F7D, 0x2EF2, 0x064F,
+ 0x2F00, 0x04B0, 0x2F01, 0x20B3, 0x2F02, 0x0FFF, 0x2F03, 0x1001,
+ 0x2F04, 0x0535, 0x2F05, 0x1006, 0x2F06, 0x0CCB, 0x2F07, 0x100E,
+ 0x2F08, 0x0A13, 0x2F09, 0x1070, 0x2F0A, 0x0CD6, 0x2F0B, 0x0D40,
+ 0x2F0C, 0x107B, 0x2F0D, 0x1083, 0x2F0E, 0x1089, 0x2F0F, 0x1093,
+ 0x2F10, 0x1098, 0x2F11, 0x0C5B, 0x2F12, 0x0F97, 0x2F13, 0x10C6,
+ 0x2F14, 0x10CD, 0x2F15, 0x10CE, 0x2F16, 0x10D3, 0x2F17, 0x0947,
+ 0x2F18, 0x0E7C, 0x2F19, 0x10DC, 0x2F1A, 0x10E1, 0x2F1B, 0x10E8,
+ 0x2F1C, 0x0EA2, 0x2F1D, 0x07B1, 0x2F1E, 0x116B, 0x2F1F, 0x0C54,
+ 0x2F20, 0x089C, 0x2F21, 0x11BA, 0x2F22, 0x11BB, 0x2F23, 0x0F26,
+ 0x2F24, 0x0B47, 0x2F25, 0x0981, 0x2F26, 0x08A0, 0x2F27, 0x120E,
+ 0x2F28, 0x0A47, 0x2F29, 0x0996, 0x2F2A, 0x1226, 0x2F2B, 0x1228,
+ 0x2F2C, 0x1232, 0x2F2D, 0x0881, 0x2F2E, 0x126C, 0x2F2F, 0x07BB,
+ 0x2F30, 0x077E, 0x2F31, 0x06CA, 0x2F32, 0x05EF, 0x2F33, 0x1283,
+ 0x2F34, 0x1285, 0x2F35, 0x1299, 0x2F36, 0x129B, 0x2F37, 0x12A0,
+ 0x2F38, 0x0677, 0x2F39, 0x38B9, 0x2F3A, 0x12AF, 0x2F3B, 0x12B1,
+ 0x2F3C, 0x09FA, 0x2F3D, 0x1342, 0x2F3E, 0x0781, 0x2F3F, 0x0916,
+ 0x2F40, 0x08A7, 0x2F41, 0x13C2, 0x2F42, 0x0E08, 0x2F43, 0x0C47,
+ 0x2F44, 0x06CC, 0x2F45, 0x0E4D, 0x2F46, 0x13E0, 0x2F47, 0x0CD4,
+ 0x2F48, 0x140C, 0x2F49, 0x0744, 0x2F4A, 0x0EE6, 0x2F4B, 0x073D,
+ 0x2F4C, 0x08AD, 0x2F4D, 0x14E5, 0x2F4E, 0x14F4, 0x2F4F, 0x14F8,
+ 0x2F50, 0x0D7A, 0x2F51, 0x0EDF, 0x2F52, 0x08AF, 0x2F53, 0x1502,
+ 0x2F54, 0x0A2B, 0x2F55, 0x0550, 0x2F56, 0x0BFA, 0x2F57, 0x0DD5,
+ 0x2F58, 0x15E4, 0x2F59, 0x15E6, 0x2F5A, 0x0E22, 0x2F5B, 0x0567,
+ 0x2F5C, 0x0687, 0x2F5D, 0x0758, 0x2F5E, 0x0770, 0x2F5F, 0x06C4,
+ 0x2F60, 0x04DD, 0x2F61, 0x05E0, 0x2F62, 0x0601, 0x2F63, 0x0A5C,
+ 0x2F64, 0x0F3B, 0x2F65, 0x0C3E, 0x2F66, 0x0D97, 0x2F67, 0x3A00,
+ 0x2F68, 0x1697, 0x2F69, 0x0D28, 0x2F6A, 0x0D7D, 0x2F6B, 0x087C,
+ 0x2F6C, 0x0EE8, 0x2F6D, 0x0EC3, 0x2F6E, 0x0EFC, 0x2F6F, 0x0A74,
+ 0x2F70, 0x08D4, 0x2F71, 0x3A41, 0x2F72, 0x0553, 0x2F73, 0x0740,
+ 0x2F74, 0x0F71, 0x2F75, 0x0B9B, 0x2F76, 0x0E16, 0x2F77, 0x08B3,
+ 0x2F78, 0x0608, 0x2F79, 0x1813, 0x2F7A, 0x0F3D, 0x2F7B, 0x04CB,
+ 0x2F7C, 0x0FDD, 0x2F7D, 0x08D5, 0x2F7E, 0x183D, 0x2F7F, 0x08D6,
+ 0x2F80, 0x1853, 0x2F81, 0x0CD1, 0x2F82, 0x0A09, 0x2F83, 0x08D7,
+ 0x2F84, 0x08B8, 0x2F85, 0x04D3, 0x2F86, 0x0A89, 0x2F87, 0x0AA6,
+ 0x2F88, 0x0938, 0x2F89, 0x0821, 0x2F8A, 0x09ED, 0x2F8B, 0x18B2,
+ 0x2F8C, 0x194F, 0x2F8D, 0x0BAC, 0x2F8E, 0x0742, 0x2F8F, 0x07E6,
+ 0x2F90, 0x04A5, 0x2F91, 0x19EB, 0x2F92, 0x075F, 0x2F93, 0x05AF,
+ 0x2F94, 0x0774, 0x2F95, 0x0B69, 0x2F96, 0x0C7E, 0x2F97, 0x1A56,
+ 0x2F98, 0x1A59, 0x2F99, 0x058B, 0x2F9A, 0x0A7A, 0x2F9B, 0x0AF8,
+ 0x2F9C, 0x0B0D, 0x2F9D, 0x0A0E, 0x2F9E, 0x0902, 0x2F9F, 0x0A0F,
+ 0x2FA0, 0x0B62, 0x2FA1, 0x3B4F, 0x2FA2, 0x0F22, 0x2FA3, 0x0CAB,
+ 0x2FA4, 0x0D64, 0x2FA5, 0x0F6C, 0x2FA6, 0x06DA, 0x2FA7, 0x0BD5,
+ 0x2FA8, 0x0EF3, 0x2FA9, 0x0DDE, 0x2FAA, 0x1BC9, 0x2FAB, 0x1BCB,
+ 0x2FAC, 0x04CD, 0x2FAD, 0x21F7, 0x2FAE, 0x0D87, 0x2FAF, 0x0ED8,
+ 0x2FB0, 0x05B5, 0x2FB1, 0x1C03, 0x2FB2, 0x1C05, 0x2FB3, 0x053B,
+ 0x2FB4, 0x0E17, 0x2FB5, 0x0DE9, 0x2FB6, 0x0D88, 0x2FB7, 0x09EF,
+ 0x2FB8, 0x091F, 0x2FB9, 0x07F3, 0x2FBA, 0x0D05, 0x2FBB, 0x080E,
+ 0x2FBC, 0x07F4, 0x2FBD, 0x1C6C, 0x2FBE, 0x1C7D, 0x2FBF, 0x1C83,
+ 0x2FC0, 0x1C84, 0x2FC1, 0x064E, 0x2FC2, 0x0695, 0x2FC3, 0x0BD7,
+ 0x2FC4, 0x1CF6, 0x2FC5, 0x08DB, 0x2FC6, 0x1D01, 0x2FC7, 0x0E91,
+ 0x2FC8, 0x340B, 0x2FC9, 0x066A, 0x2FCA, 0x0807, 0x2FCB, 0x1D16,
+ 0x2FCC, 0x1D19, 0x2FCD, 0x0C1E, 0x2FCE, 0x0791, 0x2FCF, 0x0ACF,
+ 0x2FD0, 0x0D93, 0x2FD1, 0x1D21, 0x2FD2, 0x1D22, 0x2FD3, 0x0F7E,
+ 0x2FD4, 0x1D30, 0x2FD5, 0x1D31, 0x3000, 0x0279, 0x3001, 0x027A,
+ 0x3002, 0x027B, 0x3003, 0x028F, 0x3004, 0x2074, 0x3005, 0x0291,
+ 0x3006, 0x0292, 0x3007, 0x0293, 0x3008, 0x02AA, 0x3009, 0x02AB,
+ 0x300A, 0x02AC, 0x300B, 0x02AD, 0x300C, 0x02AE, 0x300D, 0x02AF,
+ 0x300E, 0x02B0, 0x300F, 0x02B1, 0x3010, 0x02B2, 0x3011, 0x02B3,
+ 0x3012, 0x02DF, 0x3013, 0x02E4, 0x3014, 0x02A4, 0x3015, 0x02A5,
+ 0x3016, 0x3F45, 0x3017, 0x3F46, 0x3018, 0x2F61, 0x3019, 0x2F62,
+ 0x301C, 0x0299, 0x301D, 0x1DB8, 0x301F, 0x1DB9, 0x3020, 0x1F7A,
+ 0x3030, 0x2FBA, 0x3033, 0x2F4C, 0x3034, 0x2F4D, 0x3035, 0x2F4E,
+ 0x3036, 0x1F79, 0x303B, 0x2F4A, 0x303C, 0x3F42, 0x303D, 0x2F93,
+ 0x3041, 0x034A, 0x3042, 0x034B, 0x3043, 0x034C, 0x3044, 0x034D,
+ 0x3045, 0x034E, 0x3046, 0x034F, 0x3047, 0x0350, 0x3048, 0x0351,
+ 0x3049, 0x0352, 0x304A, 0x0353, 0x304B, 0x0354, 0x304C, 0x0355,
+ 0x304D, 0x0356, 0x304E, 0x0357, 0x304F, 0x0358, 0x3050, 0x0359,
+ 0x3051, 0x035A, 0x3052, 0x035B, 0x3053, 0x035C, 0x3054, 0x035D,
+ 0x3055, 0x035E, 0x3056, 0x035F, 0x3057, 0x0360, 0x3058, 0x0361,
+ 0x3059, 0x0362, 0x305A, 0x0363, 0x305B, 0x0364, 0x305C, 0x0365,
+ 0x305D, 0x0366, 0x305E, 0x0367, 0x305F, 0x0368, 0x3060, 0x0369,
+ 0x3061, 0x036A, 0x3062, 0x036B, 0x3063, 0x036C, 0x3064, 0x036D,
+ 0x3065, 0x036E, 0x3066, 0x036F, 0x3067, 0x0370, 0x3068, 0x0371,
+ 0x3069, 0x0372, 0x306A, 0x0373, 0x306B, 0x0374, 0x306C, 0x0375,
+ 0x306D, 0x0376, 0x306E, 0x0377, 0x306F, 0x0378, 0x3070, 0x0379,
+ 0x3071, 0x037A, 0x3072, 0x037B, 0x3073, 0x037C, 0x3074, 0x037D,
+ 0x3075, 0x037E, 0x3076, 0x037F, 0x3077, 0x0380, 0x3078, 0x0381,
+ 0x3079, 0x0382, 0x307A, 0x0383, 0x307B, 0x0384, 0x307C, 0x0385,
+ 0x307D, 0x0386, 0x307E, 0x0387, 0x307F, 0x0388, 0x3080, 0x0389,
+ 0x3081, 0x038A, 0x3082, 0x038B, 0x3083, 0x038C, 0x3084, 0x038D,
+ 0x3085, 0x038E, 0x3086, 0x038F, 0x3087, 0x0390, 0x3088, 0x0391,
+ 0x3089, 0x0392, 0x308A, 0x0393, 0x308B, 0x0394, 0x308C, 0x0395,
+ 0x308D, 0x0396, 0x308E, 0x0397, 0x308F, 0x0398, 0x3090, 0x0399,
+ 0x3091, 0x039A, 0x3092, 0x039B, 0x3093, 0x039C, 0x3094, 0x1F16,
+ 0x3095, 0x1F17, 0x3096, 0x1F18, 0x3099, 0x3FC6, 0x309A, 0x3FC7,
+ 0x309B, 0x0283, 0x309C, 0x0284, 0x309D, 0x028D, 0x309E, 0x028E,
+ 0x309F, 0x2F95, 0x30A0, 0x3F4D, 0x30A1, 0x039D, 0x30A2, 0x039E,
+ 0x30A3, 0x039F, 0x30A4, 0x03A0, 0x30A5, 0x03A1, 0x30A6, 0x03A2,
+ 0x30A7, 0x03A3, 0x30A8, 0x03A4, 0x30A9, 0x03A5, 0x30AA, 0x03A6,
+ 0x30AB, 0x03A7, 0x30AC, 0x03A8, 0x30AD, 0x03A9, 0x30AE, 0x03AA,
+ 0x30AF, 0x03AB, 0x30B0, 0x03AC, 0x30B1, 0x03AD, 0x30B2, 0x03AE,
+ 0x30B3, 0x03AF, 0x30B4, 0x03B0, 0x30B5, 0x03B1, 0x30B6, 0x03B2,
+ 0x30B7, 0x03B3, 0x30B8, 0x03B4, 0x30B9, 0x03B5, 0x30BA, 0x03B6,
+ 0x30BB, 0x03B7, 0x30BC, 0x03B8, 0x30BD, 0x03B9, 0x30BE, 0x03BA,
+ 0x30BF, 0x03BB, 0x30C0, 0x03BC, 0x30C1, 0x03BD, 0x30C2, 0x03BE,
+ 0x30C3, 0x03BF, 0x30C4, 0x03C0, 0x30C5, 0x03C1, 0x30C6, 0x03C2,
+ 0x30C7, 0x03C3, 0x30C8, 0x03C4, 0x30C9, 0x03C5, 0x30CA, 0x03C6,
+ 0x30CB, 0x03C7, 0x30CC, 0x03C8, 0x30CD, 0x03C9, 0x30CE, 0x03CA,
+ 0x30CF, 0x03CB, 0x30D0, 0x03CC, 0x30D1, 0x03CD, 0x30D2, 0x03CE,
+ 0x30D3, 0x03CF, 0x30D4, 0x03D0, 0x30D5, 0x03D1, 0x30D6, 0x03D2,
+ 0x30D7, 0x03D3, 0x30D8, 0x03D4, 0x30D9, 0x03D5, 0x30DA, 0x03D6,
+ 0x30DB, 0x03D7, 0x30DC, 0x03D8, 0x30DD, 0x03D9, 0x30DE, 0x03DA,
+ 0x30DF, 0x03DB, 0x30E0, 0x03DC, 0x30E1, 0x03DD, 0x30E2, 0x03DE,
+ 0x30E3, 0x03DF, 0x30E4, 0x03E0, 0x30E5, 0x03E1, 0x30E6, 0x03E2,
+ 0x30E7, 0x03E3, 0x30E8, 0x03E4, 0x30E9, 0x03E5, 0x30EA, 0x03E6,
+ 0x30EB, 0x03E7, 0x30EC, 0x03E8, 0x30ED, 0x03E9, 0x30EE, 0x03EA,
+ 0x30EF, 0x03EB, 0x30F0, 0x03EC, 0x30F1, 0x03ED, 0x30F2, 0x03EE,
+ 0x30F3, 0x03EF, 0x30F4, 0x03F0, 0x30F5, 0x03F1, 0x30F6, 0x03F2,
+ 0x30F7, 0x2079, 0x30F8, 0x207A, 0x30F9, 0x207B, 0x30FA, 0x207C,
+ 0x30FB, 0x027E, 0x30FC, 0x0294, 0x30FD, 0x028B, 0x30FE, 0x028C,
+ 0x30FF, 0x3F43, 0x3190, 0x3F9B, 0x3191, 0x3F9C, 0x3192, 0x3F9D,
+ 0x3193, 0x3F9E, 0x3194, 0x3F9F, 0x3195, 0x3FA0, 0x3196, 0x3FA1,
+ 0x3197, 0x3FA2, 0x3198, 0x3FA3, 0x3199, 0x3FA4, 0x319A, 0x3FA5,
+ 0x319B, 0x3FA6, 0x319C, 0x3FA7, 0x319D, 0x3FA8, 0x319E, 0x3FA9,
+ 0x319F, 0x3FAA, 0x31F0, 0x3F6C, 0x31F1, 0x3F6D, 0x31F2, 0x3F6E,
+ 0x31F3, 0x3F6F, 0x31F4, 0x3F70, 0x31F5, 0x3F71, 0x31F6, 0x3F72,
+ 0x31F7, 0x3F73, 0x31F8, 0x3F74, 0x31F9, 0x3F75, 0x31FA, 0x3F77,
+ 0x31FB, 0x3F78, 0x31FC, 0x3F79, 0x31FD, 0x3F7A, 0x31FE, 0x3F7B,
+ 0x31FF, 0x3F7C, 0x3220, 0x278E, 0x3221, 0x278F, 0x3222, 0x2790,
+ 0x3223, 0x2791, 0x3224, 0x2792, 0x3225, 0x2793, 0x3226, 0x2794,
+ 0x3227, 0x2795, 0x3228, 0x2796, 0x3229, 0x2797, 0x322A, 0x2006,
+ 0x322B, 0x2007, 0x322C, 0x2008, 0x322D, 0x2009, 0x322E, 0x200A,
+ 0x322F, 0x200B, 0x3230, 0x2005, 0x3231, 0x1DC2, 0x3232, 0x1DC3,
+ 0x3233, 0x1FCF, 0x3234, 0x1FCD, 0x3235, 0x1FD4, 0x3236, 0x1FD3,
+ 0x3237, 0x200C, 0x3238, 0x1FCE, 0x3239, 0x1DC4, 0x323A, 0x1FD7,
+ 0x323B, 0x1FD5, 0x323C, 0x1FD0, 0x323D, 0x1FCB, 0x323E, 0x1FD2,
+ 0x323F, 0x1FCC, 0x3240, 0x1FD6, 0x3241, 0x200D, 0x3242, 0x1FD1,
+ 0x3243, 0x1FCA, 0x3251, 0x1F9B, 0x3252, 0x1FA6, 0x3253, 0x1FA7,
+ 0x3254, 0x1FA8, 0x3255, 0x1FA9, 0x3256, 0x1FAA, 0x3257, 0x1FAB,
+ 0x3258, 0x1FAC, 0x3259, 0x1FAD, 0x325A, 0x1FAE, 0x325B, 0x1FAF,
+ 0x325C, 0x2804, 0x325D, 0x2805, 0x325E, 0x2806, 0x325F, 0x2807,
+ 0x3280, 0x28DD, 0x3281, 0x28DE, 0x3282, 0x28DF, 0x3283, 0x28E0,
+ 0x3284, 0x28E1, 0x3285, 0x28E2, 0x3286, 0x28E3, 0x3287, 0x28E4,
+ 0x3288, 0x28E5, 0x3289, 0x28E6, 0x328A, 0x28E8, 0x328B, 0x28E9,
+ 0x328C, 0x28EA, 0x328D, 0x28EB, 0x328E, 0x28EC, 0x328F, 0x28ED,
+ 0x3290, 0x28E7, 0x3291, 0x1FE1, 0x3292, 0x1FE0, 0x3293, 0x1FE2,
+ 0x3294, 0x1FDC, 0x3295, 0x28FF, 0x3296, 0x1FE5, 0x3297, 0x28FC,
+ 0x3298, 0x1FDE, 0x3299, 0x201F, 0x329A, 0x28F9, 0x329B, 0x28F8,
+ 0x329C, 0x28FE, 0x329D, 0x207F, 0x329E, 0x1FFF, 0x329F, 0x28EF,
+ 0x32A0, 0x28F6, 0x32A1, 0x28F7, 0x32A2, 0x28FB, 0x32A3, 0x28FA,
+ 0x32A4, 0x1DBD, 0x32A5, 0x1DBE, 0x32A6, 0x1DBF, 0x32A7, 0x1DC0,
+ 0x32A8, 0x1DC1, 0x32A9, 0x1FDA, 0x32AA, 0x1FDD, 0x32AB, 0x1FDF,
+ 0x32AC, 0x1FE3, 0x32AD, 0x1FD9, 0x32AE, 0x1FE4, 0x32AF, 0x1FDB,
+ 0x32B0, 0x1FD8, 0x32B1, 0x2808, 0x32B2, 0x2809, 0x32B3, 0x280A,
+ 0x32B4, 0x280B, 0x32B5, 0x280C, 0x32B6, 0x280D, 0x32B7, 0x280E,
+ 0x32B8, 0x280F, 0x32B9, 0x2810, 0x32BA, 0x2811, 0x32BB, 0x2812,
+ 0x32BC, 0x2813, 0x32BD, 0x2814, 0x32BE, 0x2815, 0x32BF, 0x2816,
+ 0x32D0, 0x28AD, 0x32D1, 0x28AE, 0x32D2, 0x28AF, 0x32D3, 0x28B0,
+ 0x32D4, 0x28B1, 0x32D5, 0x28B2, 0x32D6, 0x28B3, 0x32D7, 0x28B4,
+ 0x32D8, 0x28B5, 0x32D9, 0x28B6, 0x32DA, 0x28B7, 0x32DB, 0x28B8,
+ 0x32DC, 0x28B9, 0x32DD, 0x28BA, 0x32DE, 0x28BB, 0x32DF, 0x28BC,
+ 0x32E0, 0x28BD, 0x32E1, 0x28BE, 0x32E2, 0x28BF, 0x32E3, 0x28C0,
+ 0x32E4, 0x28C1, 0x32E5, 0x28C2, 0x32E6, 0x28C3, 0x32E7, 0x28C4,
+ 0x32E8, 0x28C5, 0x32E9, 0x28C6, 0x32EA, 0x28C7, 0x32EB, 0x28C8,
+ 0x32EC, 0x28C9, 0x32ED, 0x28CA, 0x32EE, 0x28CB, 0x32EF, 0x28CC,
+ 0x32F0, 0x28CD, 0x32F1, 0x28CE, 0x32F2, 0x28CF, 0x32F3, 0x28D0,
+ 0x32F4, 0x28D1, 0x32F5, 0x28D2, 0x32F6, 0x28D3, 0x32F7, 0x28D4,
+ 0x32F8, 0x28D5, 0x32F9, 0x28D6, 0x32FA, 0x28D7, 0x32FB, 0x28D8,
+ 0x32FC, 0x28D9, 0x32FD, 0x28DA, 0x32FE, 0x28DB, 0x3300, 0x1F70,
+ 0x3301, 0x2E62, 0x3302, 0x2E63, 0x3303, 0x1F6A, 0x3304, 0x2E64,
+ 0x3305, 0x1FF7, 0x3306, 0x2E65, 0x3307, 0x2E69, 0x3308, 0x2E67,
+ 0x3309, 0x2E6C, 0x330A, 0x2E6A, 0x330B, 0x2E6E, 0x330C, 0x2E70,
+ 0x330D, 0x1DAB, 0x330E, 0x2E71, 0x330F, 0x2E72, 0x3310, 0x2E73,
+ 0x3311, 0x2E74, 0x3312, 0x2E75, 0x3313, 0x2E76, 0x3314, 0x1DA2,
+ 0x3315, 0x1F69, 0x3316, 0x1F67, 0x3317, 0x2E78, 0x3318, 0x1F68,
+ 0x3319, 0x2E7A, 0x331A, 0x2E7C, 0x331B, 0x2E7D, 0x331C, 0x2E7E,
+ 0x331D, 0x2E7F, 0x331E, 0x1F73, 0x331F, 0x2E80, 0x3320, 0x2E81,
+ 0x3321, 0x2E82, 0x3322, 0x1F66, 0x3323, 0x1F6B, 0x3324, 0x2E83,
+ 0x3325, 0x2E85, 0x3326, 0x1DAC, 0x3327, 0x1DA6, 0x3328, 0x2E88,
+ 0x3329, 0x2E89, 0x332A, 0x1F74, 0x332B, 0x1DAE, 0x332D, 0x2E8B,
+ 0x332E, 0x2E8E, 0x332F, 0x2E8F, 0x3330, 0x2E90, 0x3331, 0x1F71,
+ 0x3332, 0x2E91, 0x3333, 0x2087, 0x3334, 0x2E94, 0x3335, 0x2E95,
+ 0x3336, 0x1DA8, 0x3337, 0x2E9A, 0x3338, 0x2E9C, 0x3339, 0x1F6E,
+ 0x333A, 0x2E9D, 0x333B, 0x1F6F, 0x333C, 0x2E96, 0x333D, 0x2E9E,
+ 0x333E, 0x2EA0, 0x333F, 0x2EA1, 0x3340, 0x2EA2, 0x3341, 0x2E9F,
+ 0x3342, 0x1F6D, 0x3343, 0x2EA3, 0x3344, 0x2EA4, 0x3345, 0x2EA5,
+ 0x3346, 0x2EA6, 0x3347, 0x1F72, 0x3348, 0x2EA7, 0x3349, 0x1DA1,
+ 0x334A, 0x1DAF, 0x334B, 0x2EA8, 0x334C, 0x2EA9, 0x334D, 0x1DA4,
+ 0x334E, 0x2088, 0x334F, 0x2EAA, 0x3350, 0x2EAB, 0x3351, 0x1DA9,
+ 0x3352, 0x2EAE, 0x3353, 0x2EB2, 0x3354, 0x2EAF, 0x3355, 0x2EB3,
+ 0x3356, 0x2EB4, 0x3357, 0x1F6C, 0x3371, 0x2E55, 0x337B, 0x2083,
+ 0x337C, 0x1DC7, 0x337D, 0x1DC6, 0x337E, 0x1DC5, 0x337F, 0x1F76,
+ 0x3385, 0x1F5F, 0x3386, 0x1F60, 0x3387, 0x1F61, 0x3388, 0x2000,
+ 0x3389, 0x2001, 0x338D, 0x2E58, 0x338E, 0x1DB4, 0x338F, 0x1DB5,
+ 0x3390, 0x1F63, 0x3396, 0x1F65, 0x3397, 0x1F58, 0x3398, 0x1F5A,
+ 0x339B, 0x2E59, 0x339C, 0x1DB1, 0x339D, 0x1DB2, 0x339E, 0x1DB3,
+ 0x339F, 0x1FFA, 0x33A0, 0x1F54, 0x33A1, 0x1DB7, 0x33A2, 0x1F55,
+ 0x33A3, 0x1FFB, 0x33A4, 0x1F56, 0x33A5, 0x1F57, 0x33A6, 0x1FFC,
+ 0x33B0, 0x1F5E, 0x33B1, 0x1F5D, 0x33B2, 0x1F5C, 0x33B3, 0x1F5B,
+ 0x33C2, 0x2E50, 0x33C4, 0x1DB6, 0x33C8, 0x2002, 0x33CB, 0x1F62,
+ 0x33CC, 0x1FF6, 0x33CD, 0x1DBB, 0x33D4, 0x1F64, 0x33D7, 0x2E5D,
+ 0x33D8, 0x2E5E, 0x33DA, 0x2E4B, 0x3402, 0x3582, 0x3405, 0x3C1B,
+ 0x3406, 0x435A, 0x3427, 0x3656, 0x342C, 0x435E, 0x342E, 0x3788,
+ 0x3468, 0x36DF, 0x346A, 0x4375, 0x3488, 0x3C52, 0x3492, 0x438E,
+ 0x34B5, 0x4199, 0x34BC, 0x4397, 0x34C1, 0x47D0, 0x34C7, 0x439B,
+ 0x34DB, 0x3C41, 0x351F, 0x3629, 0x353E, 0x371E, 0x355D, 0x43BD,
+ 0x355E, 0x43BE, 0x3563, 0x43C0, 0x356E, 0x43C4, 0x35A6, 0x43D9,
+ 0x35A8, 0x43DB, 0x35C5, 0x43E1, 0x35DA, 0x43EA, 0x35DE, 0x4E63,
+ 0x35F4, 0x43F3, 0x3605, 0x43FA, 0x3614, 0x4ABB, 0x364A, 0x4421,
+ 0x3691, 0x4441, 0x3696, 0x4445, 0x3699, 0x4443, 0x36CF, 0x4456,
+ 0x3761, 0x4478, 0x3762, 0x4479, 0x376B, 0x447D, 0x376C, 0x447C,
+ 0x3775, 0x4480, 0x378D, 0x361A, 0x37C1, 0x448E, 0x37E2, 0x372B,
+ 0x37E8, 0x44A2, 0x37F4, 0x44A5, 0x37FD, 0x44A8, 0x3800, 0x44AA,
+ 0x382F, 0x44B4, 0x3836, 0x44B5, 0x3840, 0x44B6, 0x385C, 0x44BA,
+ 0x3861, 0x44BC, 0x38A1, 0x4ECB, 0x38AD, 0x4ABC, 0x38FA, 0x361C,
+ 0x3917, 0x44D9, 0x391A, 0x44DC, 0x396F, 0x44EB, 0x39A4, 0x4E9A,
+ 0x39B8, 0x4E9B, 0x3A5C, 0x4E9F, 0x3A6E, 0x4531, 0x3A73, 0x4534,
+ 0x3A85, 0x4EAE, 0x3AC4, 0x4EA7, 0x3ACB, 0x4EA8, 0x3AD6, 0x4543,
+ 0x3AD7, 0x455E, 0x3AEA, 0x454D, 0x3AF3, 0x3C40, 0x3B0E, 0x4558,
+ 0x3B1A, 0x455C, 0x3B1C, 0x455D, 0x3B22, 0x3C49, 0x3B6D, 0x458C,
+ 0x3B77, 0x4585, 0x3B87, 0x45A2, 0x3B88, 0x368D, 0x3B8D, 0x45A4,
+ 0x3BA4, 0x45AA, 0x3BB6, 0x420E, 0x3BC3, 0x420F, 0x3BCD, 0x45B8,
+ 0x3BF0, 0x45C9, 0x3BF3, 0x4EB7, 0x3C0F, 0x4217, 0x3C26, 0x45DF,
+ 0x3CC3, 0x45FC, 0x3CD2, 0x4601, 0x3D11, 0x4625, 0x3D1E, 0x4630,
+ 0x3D31, 0x4EBE, 0x3D4E, 0x1DE7, 0x3D64, 0x464A, 0x3D9A, 0x4658,
+ 0x3DC0, 0x466A, 0x3DCC, 0x4ABD, 0x3DD4, 0x466F, 0x3E05, 0x467B,
+ 0x3E3F, 0x4248, 0x3E40, 0x4ECA, 0x3E60, 0x468B, 0x3E66, 0x468D,
+ 0x3E68, 0x468E, 0x3E83, 0x4695, 0x3E8A, 0x3C43, 0x3E94, 0x469B,
+ 0x3EDA, 0x3C48, 0x3F57, 0x46CB, 0x3F72, 0x4258, 0x3F75, 0x46D9,
+ 0x3F77, 0x46DB, 0x3FAE, 0x46ED, 0x3FB1, 0x3754, 0x3FC9, 0x46F8,
+ 0x3FD7, 0x46FD, 0x3FDC, 0x4ABE, 0x4039, 0x470F, 0x4058, 0x4716,
+ 0x4093, 0x3C4C, 0x4103, 0x3C4F, 0x4105, 0x473B, 0x4148, 0x4747,
+ 0x414F, 0x474A, 0x4163, 0x474E, 0x41B4, 0x475D, 0x41BF, 0x4760,
+ 0x41E6, 0x476B, 0x41EE, 0x476F, 0x41F3, 0x476C, 0x4207, 0x4776,
+ 0x420E, 0x4779, 0x4264, 0x3760, 0x4293, 0x3C50, 0x42C6, 0x479F,
+ 0x42D6, 0x47AA, 0x42DD, 0x47AE, 0x4302, 0x47BC, 0x432B, 0x47C9,
+ 0x4343, 0x47CB, 0x43EE, 0x47F7, 0x43F0, 0x47FA, 0x4408, 0x4800,
+ 0x440C, 0x3C42, 0x4417, 0x4802, 0x441C, 0x4803, 0x4422, 0x4805,
+ 0x4453, 0x3773, 0x445B, 0x42A4, 0x4476, 0x481C, 0x447A, 0x481D,
+ 0x4491, 0x4823, 0x44B3, 0x483E, 0x44BE, 0x483C, 0x44D4, 0x483D,
+ 0x4508, 0x485C, 0x450D, 0x4858, 0x4525, 0x377E, 0x4543, 0x486C,
+ 0x457A, 0x3C4B, 0x459D, 0x42D4, 0x45B8, 0x48A0, 0x45BE, 0x4ABF,
+ 0x45E5, 0x48BA, 0x45EA, 0x42D9, 0x460F, 0x48CA, 0x4610, 0x4AC0,
+ 0x4641, 0x48D8, 0x4665, 0x3C4E, 0x46A1, 0x48E9, 0x46AE, 0x3C51,
+ 0x46AF, 0x48ED, 0x470C, 0x4902, 0x471F, 0x4EFB, 0x4764, 0x4918,
+ 0x47E6, 0x3790, 0x47FD, 0x4924, 0x4816, 0x492E, 0x481E, 0x4F01,
+ 0x4844, 0x42F5, 0x484E, 0x493A, 0x48B5, 0x495B, 0x49B0, 0x431F,
+ 0x49E7, 0x49D2, 0x49FA, 0x49D6, 0x4A04, 0x49DB, 0x4A29, 0x49DE,
+ 0x4ABC, 0x49F6, 0x4B38, 0x35DF, 0x4B3B, 0x4A0E, 0x4B7E, 0x4AC1,
+ 0x4BC2, 0x4A33, 0x4BCA, 0x4A35, 0x4BD2, 0x4A37, 0x4BE8, 0x3C46,
+ 0x4C17, 0x4334, 0x4C20, 0x4A48, 0x4C38, 0x4AC2, 0x4CC4, 0x4A84,
+ 0x4CD1, 0x4A87, 0x4CE1, 0x4AC3, 0x4D07, 0x4A9B, 0x4D77, 0x4AAB,
+ 0x4E00, 0x04B0, 0x4E01, 0x0BB8, 0x4E02, 0x4352, 0x4E03, 0x08E3,
+ 0x4E04, 0x37D8, 0x4E05, 0x37D9, 0x4E07, 0x0EAA, 0x4E08, 0x09CE,
+ 0x4E09, 0x087E, 0x4E0A, 0x09CD, 0x4E0B, 0x053C, 0x4E0C, 0x4AC4,
+ 0x4E0D, 0x0DC6, 0x4E0E, 0x0F29, 0x4E0F, 0x4353, 0x4E10, 0x0FFB,
+ 0x4E11, 0x04D1, 0x4E12, 0x4354, 0x4E14, 0x05CC, 0x4E15, 0x0FFC,
+ 0x4E16, 0x0A48, 0x4E17, 0x10D7, 0x4E18, 0x0670, 0x4E19, 0x0E0A,
+ 0x4E1E, 0x09CF, 0x4E1F, 0x37DA, 0x4E21, 0x0F86, 0x4E23, 0x4AC5,
+ 0x4E24, 0x4AC6, 0x4E26, 0x0E12, 0x4E28, 0x20B3, 0x4E29, 0x4355,
+ 0x4E2A, 0x0FFD, 0x4E2B, 0x37DB, 0x4E2C, 0x374D, 0x4E2D, 0x0BA4,
+ 0x4E2E, 0x4356, 0x4E2F, 0x37DC, 0x4E30, 0x37DD, 0x4E31, 0x0FFE,
+ 0x4E32, 0x06F2, 0x4E36, 0x0FFF, 0x4E37, 0x369D, 0x4E38, 0x0619,
+ 0x4E39, 0x0B6E, 0x4E3B, 0x0913, 0x4E3C, 0x1000, 0x4E3F, 0x1001,
+ 0x4E40, 0x37DE, 0x4E41, 0x37DF, 0x4E42, 0x1002, 0x4E43, 0x0CEB,
+ 0x4E44, 0x37E0, 0x4E45, 0x0671, 0x4E47, 0x4357, 0x4E48, 0x372E,
+ 0x4E4B, 0x0CED, 0x4E4D, 0x0CBB, 0x4E4E, 0x0777, 0x4E4F, 0x0E61,
+ 0x4E51, 0x4359, 0x4E55, 0x1950, 0x4E56, 0x1003, 0x4E57, 0x09D0,
+ 0x4E58, 0x1004, 0x4E59, 0x0535, 0x4E5A, 0x37E1, 0x4E5D, 0x06DD,
+ 0x4E5E, 0x07A4, 0x4E5F, 0x0EF5, 0x4E62, 0x1233, 0x4E69, 0x435C,
+ 0x4E71, 0x0F5A, 0x4E73, 0x0CD5, 0x4E79, 0x4AC7, 0x4E7E, 0x05E1,
+ 0x4E7F, 0x37E2, 0x4E80, 0x064F, 0x4E82, 0x1005, 0x4E85, 0x1006,
+ 0x4E86, 0x0F83, 0x4E88, 0x0F27, 0x4E89, 0x0AEA, 0x4E8A, 0x1008,
+ 0x4E8B, 0x08C4, 0x4E8C, 0x0CCB, 0x4E8D, 0x37E3, 0x4E8E, 0x100B,
+ 0x4E91, 0x04E0, 0x4E92, 0x0793, 0x4E94, 0x0792, 0x4E95, 0x04AA,
+ 0x4E96, 0x37E4, 0x4E98, 0x0FF1, 0x4E99, 0x0FF0, 0x4E9B, 0x0823,
+ 0x4E9C, 0x0465, 0x4E9D, 0x435D, 0x4E9E, 0x100C, 0x4E9F, 0x100D,
+ 0x4EA0, 0x100E, 0x4EA1, 0x0E62, 0x4EA2, 0x100F, 0x4EA4, 0x07A6,
+ 0x4EA5, 0x04AB, 0x4EA6, 0x0EA0, 0x4EA8, 0x0696, 0x4EAB, 0x0697,
+ 0x4EAC, 0x0698, 0x4EAD, 0x0BFE, 0x4EAE, 0x0F84, 0x4EB0, 0x1010,
+ 0x4EB3, 0x1011, 0x4EB6, 0x1012, 0x4EB9, 0x37E5, 0x4EBA, 0x0A13,
+ 0x4EBB, 0x3620, 0x4EBC, 0x435F, 0x4EC0, 0x0944, 0x4EC1, 0x0A14,
+ 0x4EC2, 0x1017, 0x4EC3, 0x4360, 0x4EC4, 0x1015, 0x4EC6, 0x1016,
+ 0x4EC7, 0x0672, 0x4EC8, 0x4361, 0x4ECA, 0x0813, 0x4ECB, 0x0570,
+ 0x4ECD, 0x1014, 0x4ECE, 0x1013, 0x4ECF, 0x0DF9, 0x4ED0, 0x37E6,
+ 0x4ED4, 0x0894, 0x4ED5, 0x0893, 0x4ED6, 0x0B1E, 0x4ED7, 0x1018,
+ 0x4ED8, 0x0DC7, 0x4ED9, 0x0A8B, 0x4EDA, 0x4363, 0x4EDD, 0x0290,
+ 0x4EDE, 0x1019, 0x4EDF, 0x101B, 0x4EE0, 0x37E7, 0x4EE1, 0x20B4,
+ 0x4EE3, 0x0B45, 0x4EE4, 0x0FA9, 0x4EE5, 0x048E, 0x4EEB, 0x4362,
+ 0x4EED, 0x101A, 0x4EEE, 0x053E, 0x4EF0, 0x06BC, 0x4EF1, 0x4364,
+ 0x4EF2, 0x0BA5, 0x4EF3, 0x4AC8, 0x4EF5, 0x4365, 0x4EF6, 0x0745,
+ 0x4EF7, 0x101C, 0x4EFB, 0x0CDA, 0x4EFC, 0x20B5, 0x4EFD, 0x37E8,
+ 0x4EFF, 0x37E9, 0x4F00, 0x20B6, 0x4F01, 0x0627, 0x4F03, 0x20B7,
+ 0x4F09, 0x101D, 0x4F0A, 0x048F, 0x4F0B, 0x37EA, 0x4F0C, 0x4AC9,
+ 0x4F0D, 0x0794, 0x4F0E, 0x0628, 0x4F0F, 0x0DEC, 0x4F10, 0x0D46,
+ 0x4F11, 0x0673, 0x4F15, 0x37EB, 0x4F16, 0x4366, 0x4F19, 0x4ACA,
+ 0x4F1A, 0x0571, 0x4F1C, 0x1040, 0x4F1D, 0x0C3B, 0x4F2B, 0x4ACB,
+ 0x4F2E, 0x4ACC, 0x4F2F, 0x0D22, 0x4F30, 0x101F, 0x4F31, 0x4ACD,
+ 0x4F34, 0x0D50, 0x4F36, 0x0FAA, 0x4F37, 0x4368, 0x4F38, 0x09F3,
+ 0x4F39, 0x20B8, 0x4F3A, 0x0895, 0x4F3B, 0x37ED, 0x4F3C, 0x08C5,
+ 0x4F3D, 0x0540, 0x4F3E, 0x4369, 0x4F43, 0x0BED, 0x4F46, 0x0B60,
+ 0x4F47, 0x1023, 0x4F48, 0x418B, 0x4F49, 0x37EE, 0x4F4D, 0x0490,
+ 0x4F4E, 0x0BFF, 0x4F4F, 0x0945, 0x4F50, 0x0824, 0x4F51, 0x0F0E,
+ 0x4F53, 0x0B2E, 0x4F54, 0x37EF, 0x4F55, 0x053F, 0x4F56, 0x20B9,
+ 0x4F57, 0x1022, 0x4F58, 0x436A, 0x4F59, 0x0F28, 0x4F5A, 0x101E,
+ 0x4F5B, 0x1020, 0x4F5C, 0x085E, 0x4F5D, 0x1021, 0x4F5E, 0x11D3,
+ 0x4F5F, 0x418C, 0x4F60, 0x37EC, 0x4F64, 0x4367, 0x4F69, 0x1029,
+ 0x4F6A, 0x418D, 0x4F6C, 0x418E, 0x4F6F, 0x102C, 0x4F70, 0x102A,
+ 0x4F73, 0x0542, 0x4F75, 0x0E0B, 0x4F76, 0x1024, 0x4F77, 0x436C,
+ 0x4F78, 0x436D, 0x4F7A, 0x37F0, 0x4F7B, 0x1028, 0x4F7C, 0x07A7,
+ 0x4F7D, 0x37F1, 0x4F7E, 0x37F2, 0x4F7F, 0x0896, 0x4F82, 0x436E,
+ 0x4F83, 0x05E2, 0x4F84, 0x4ACE, 0x4F85, 0x436F, 0x4F86, 0x102D,
+ 0x4F88, 0x1025, 0x4F8A, 0x20BB, 0x4F8B, 0x0FAB, 0x4F8D, 0x08C6,
+ 0x4F8F, 0x1026, 0x4F91, 0x102B, 0x4F92, 0x20BA, 0x4F94, 0x20BD,
+ 0x4F96, 0x102E, 0x4F97, 0x37F3, 0x4F98, 0x1027, 0x4F9A, 0x20BC,
+ 0x4F9B, 0x0699, 0x4F9D, 0x0491, 0x4F9E, 0x4ACF, 0x4FA0, 0x069A,
+ 0x4FA1, 0x0541, 0x4FAB, 0x11D4, 0x4FAD, 0x0EA7, 0x4FAE, 0x0DE0,
+ 0x4FAF, 0x07A8, 0x4FB2, 0x4371, 0x4FB5, 0x09F5, 0x4FB6, 0x0F7F,
+ 0x4FB7, 0x4AD0, 0x4FBE, 0x37F4, 0x4FBF, 0x0E28, 0x4FC2, 0x070E,
+ 0x4FC3, 0x0B05, 0x4FC4, 0x0564, 0x4FC5, 0x4372, 0x4FC9, 0x20AC,
+ 0x4FCA, 0x095D, 0x4FCB, 0x4373, 0x4FCD, 0x20BE, 0x4FCE, 0x1032,
+ 0x4FCF, 0x37F5, 0x4FD0, 0x1037, 0x4FD1, 0x1035, 0x4FD2, 0x4374,
+ 0x4FD3, 0x3C2F, 0x4FD4, 0x1030, 0x4FD7, 0x0B0F, 0x4FD8, 0x1033,
+ 0x4FDA, 0x1036, 0x4FDB, 0x1034, 0x4FDD, 0x0E2D, 0x4FDF, 0x1031,
+ 0x4FE0, 0x1DEC, 0x4FE1, 0x09F4, 0x4FE3, 0x0EA1, 0x4FE4, 0x1038,
+ 0x4FE5, 0x1039, 0x4FE6, 0x4370, 0x4FEE, 0x092E, 0x4FEF, 0x1046,
+ 0x4FF1, 0x35A3, 0x4FF2, 0x4376, 0x4FF3, 0x0D06, 0x4FF5, 0x0DA8,
+ 0x4FF6, 0x1041, 0x4FF8, 0x0E40, 0x4FFA, 0x0536, 0x4FFD, 0x37F6,
+ 0x4FFE, 0x1045, 0x4FFF, 0x20C1, 0x5000, 0x37F7, 0x5001, 0x37F8,
+ 0x5002, 0x4F4B, 0x5004, 0x4AD1, 0x5005, 0x103F, 0x5006, 0x1048,
+ 0x5009, 0x0AD4, 0x500B, 0x0778, 0x500C, 0x4AD2, 0x500D, 0x0D12,
+ 0x500E, 0x418F, 0x500F, 0x1600, 0x5010, 0x37F9, 0x5011, 0x1047,
+ 0x5012, 0x0C57, 0x5013, 0x4377, 0x5014, 0x103C, 0x5016, 0x07AA,
+ 0x5018, 0x4190, 0x5019, 0x07A9, 0x501A, 0x103A, 0x501B, 0x37FA,
+ 0x501C, 0x4378, 0x501E, 0x20C2, 0x501F, 0x0906, 0x5021, 0x1042,
+ 0x5022, 0x20C0, 0x5023, 0x0E3F, 0x5024, 0x0B8B, 0x5025, 0x103E,
+ 0x5026, 0x0747, 0x5027, 0x37FB, 0x5028, 0x103B, 0x5029, 0x1043,
+ 0x502A, 0x103D, 0x502B, 0x0F99, 0x502C, 0x1044, 0x502D, 0x0FE7,
+ 0x502E, 0x37FC, 0x5036, 0x06DE, 0x5039, 0x0746, 0x503B, 0x3800,
+ 0x5040, 0x20BF, 0x5041, 0x4191, 0x5042, 0x20C5, 0x5043, 0x1049,
+ 0x5046, 0x20C3, 0x5047, 0x104A, 0x5048, 0x104E, 0x5049, 0x0492,
+ 0x504C, 0x4AD3, 0x504E, 0x4379, 0x504F, 0x0E20, 0x5050, 0x104D,
+ 0x5053, 0x437A, 0x5055, 0x104C, 0x5056, 0x1050, 0x5057, 0x37FD,
+ 0x505A, 0x104F, 0x505C, 0x0C00, 0x505F, 0x4AD4, 0x5062, 0x4AD5,
+ 0x5063, 0x437B, 0x5065, 0x0748, 0x5066, 0x37FE, 0x506A, 0x37FF,
+ 0x506C, 0x1051, 0x5070, 0x20C4, 0x5072, 0x08F1, 0x5074, 0x0B06,
+ 0x5075, 0x0C01, 0x5076, 0x06EE, 0x5077, 0x4AD6, 0x5078, 0x1052,
+ 0x507D, 0x0650, 0x5080, 0x1053, 0x5085, 0x1055, 0x5088, 0x437D,
+ 0x508D, 0x0E63, 0x508E, 0x4AD7, 0x508F, 0x3801, 0x5091, 0x073C,
+ 0x5092, 0x437E, 0x5093, 0x437F, 0x5094, 0x20C6, 0x5095, 0x4380,
+ 0x5096, 0x3802, 0x5098, 0x087F, 0x5099, 0x0D8B, 0x509A, 0x1054,
+ 0x509C, 0x3803, 0x509E, 0x4AD8, 0x50A2, 0x4AD9, 0x50A3, 0x437C,
+ 0x50AA, 0x4381, 0x50AC, 0x0835, 0x50AD, 0x0F2D, 0x50B1, 0x4383,
+ 0x50B2, 0x1057, 0x50B3, 0x105A, 0x50B4, 0x1056, 0x50B5, 0x0834,
+ 0x50B7, 0x0987, 0x50BA, 0x4384, 0x50BB, 0x4385, 0x50BE, 0x070F,
+ 0x50C2, 0x105B, 0x50C3, 0x4ADA, 0x50C4, 0x4386, 0x50C5, 0x06C7,
+ 0x50C7, 0x4387, 0x50C9, 0x1058, 0x50CA, 0x1059, 0x50CC, 0x3804,
+ 0x50CD, 0x0C87, 0x50CE, 0x438A, 0x50CF, 0x0AFE, 0x50D0, 0x4193,
+ 0x50D1, 0x069B, 0x50D4, 0x438C, 0x50D5, 0x0E7B, 0x50D6, 0x105C,
+ 0x50D8, 0x20C8, 0x50D9, 0x3C30, 0x50DA, 0x0F85, 0x50DE, 0x105D,
+ 0x50E1, 0x438D, 0x50E3, 0x1060, 0x50E5, 0x105E, 0x50E6, 0x3805,
+ 0x50E7, 0x0AD0, 0x50E8, 0x4ADB, 0x50E9, 0x3806, 0x50ED, 0x105F,
+ 0x50EE, 0x1061, 0x50EF, 0x3807, 0x50F0, 0x3C31, 0x50F1, 0x4ADC,
+ 0x50F2, 0x4192, 0x50F3, 0x4388, 0x50F4, 0x20C7, 0x50F5, 0x1063,
+ 0x50F9, 0x1062, 0x50FB, 0x0E18, 0x50FE, 0x4ADD, 0x5100, 0x0651,
+ 0x5101, 0x1065, 0x5102, 0x1066, 0x5103, 0x4195, 0x5104, 0x052F,
+ 0x5106, 0x4194, 0x5107, 0x4ADE, 0x5108, 0x3808, 0x5109, 0x1064,
+ 0x510B, 0x3809, 0x510C, 0x4ADF, 0x510D, 0x4AE0, 0x510E, 0x4AE1,
+ 0x5110, 0x380A, 0x5112, 0x0920, 0x5114, 0x1069, 0x5115, 0x1068,
+ 0x5116, 0x1067, 0x5117, 0x4390, 0x5118, 0x102F, 0x511A, 0x106A,
+ 0x511B, 0x380B, 0x511E, 0x380C, 0x511F, 0x0988, 0x5121, 0x106B,
+ 0x512A, 0x0F0F, 0x5132, 0x0EE5, 0x5133, 0x4AE2, 0x5135, 0x4196,
+ 0x5137, 0x106D, 0x5138, 0x4AE3, 0x513A, 0x106C, 0x513B, 0x106F,
+ 0x513C, 0x106E, 0x513F, 0x1070, 0x5140, 0x1071, 0x5141, 0x04B8,
+ 0x5143, 0x0769, 0x5144, 0x0711, 0x5145, 0x0946, 0x5146, 0x0BB9,
+ 0x5147, 0x069C, 0x5148, 0x0A8C, 0x5149, 0x07AB, 0x514A, 0x20C9,
+ 0x514B, 0x0800, 0x514C, 0x1073, 0x514D, 0x0ED4, 0x514E, 0x0C40,
+ 0x5150, 0x08C7, 0x5152, 0x1072, 0x5154, 0x1074, 0x5155, 0x4197,
+ 0x5157, 0x4198, 0x515A, 0x0C58, 0x515C, 0x05D3, 0x515F, 0x380D,
+ 0x5160, 0x4392, 0x5162, 0x1075, 0x5164, 0x20CA, 0x5165, 0x0CD6,
+ 0x5167, 0x368E, 0x5168, 0x0AB6, 0x5169, 0x1077, 0x516A, 0x1078,
+ 0x516B, 0x0D40, 0x516C, 0x07AC, 0x516D, 0x0FE1, 0x516E, 0x1079,
+ 0x5171, 0x069E, 0x5173, 0x4394, 0x5174, 0x4AE4, 0x5175, 0x0E0C,
+ 0x5176, 0x0B16, 0x5177, 0x06E9, 0x5178, 0x0C2F, 0x5179, 0x3779,
+ 0x517B, 0x47D9, 0x517C, 0x0749, 0x5180, 0x107A, 0x5182, 0x107B,
+ 0x5183, 0x4395, 0x5184, 0x4AE5, 0x5185, 0x0CBA, 0x5186, 0x0501,
+ 0x5189, 0x107E, 0x518A, 0x086D, 0x518B, 0x4396, 0x518C, 0x107D,
+ 0x518D, 0x0836, 0x518F, 0x107F, 0x5190, 0x185B, 0x5191, 0x1080,
+ 0x5192, 0x0E6F, 0x5193, 0x1081, 0x5195, 0x1082, 0x5196, 0x1083,
+ 0x5197, 0x09D1, 0x5198, 0x4398, 0x5199, 0x08F8, 0x519D, 0x20CB,
+ 0x51A0, 0x05E3, 0x51A1, 0x380E, 0x51A2, 0x1086, 0x51A3, 0x4399,
+ 0x51A4, 0x1084, 0x51A5, 0x0EC9, 0x51A6, 0x1085, 0x51A8, 0x0DCC,
+ 0x51A9, 0x1087, 0x51AA, 0x1088, 0x51AB, 0x1089, 0x51AC, 0x0C59,
+ 0x51AD, 0x439A, 0x51B0, 0x108D, 0x51B1, 0x108B, 0x51B2, 0x108C,
+ 0x51B3, 0x108A, 0x51B4, 0x0853, 0x51B5, 0x108E, 0x51B6, 0x0EF6,
+ 0x51B7, 0x0FAC, 0x51B8, 0x4AE6, 0x51BA, 0x4AE7, 0x51BC, 0x380F,
+ 0x51BD, 0x108F, 0x51BE, 0x20CC, 0x51C3, 0x3C32, 0x51C4, 0x0A4C,
+ 0x51C5, 0x1090, 0x51C6, 0x0964, 0x51C8, 0x4AE8, 0x51C9, 0x1091,
+ 0x51CA, 0x419A, 0x51CB, 0x0BBA, 0x51CC, 0x0F87, 0x51CD, 0x0C5A,
+ 0x51CF, 0x4AE9, 0x51D1, 0x4AEA, 0x51D3, 0x4AEB, 0x51D4, 0x4AEC,
+ 0x51D6, 0x10DA, 0x51D8, 0x4AED, 0x51DB, 0x1092, 0x51DC, 0x205C,
+ 0x51DD, 0x06BD, 0x51DE, 0x4F4C, 0x51DF, 0x4AEE, 0x51E0, 0x1093,
+ 0x51E1, 0x0E8C, 0x51E2, 0x419B, 0x51E6, 0x0972, 0x51E7, 0x0B5C,
+ 0x51E9, 0x1095, 0x51EA, 0x0CBC, 0x51EC, 0x20CD, 0x51ED, 0x1096,
+ 0x51EE, 0x3811, 0x51F0, 0x1097, 0x51F1, 0x058C, 0x51F3, 0x439D,
+ 0x51F4, 0x3812, 0x51F5, 0x1098, 0x51F6, 0x069F, 0x51F8, 0x0CA4,
+ 0x51F9, 0x051C, 0x51FA, 0x095A, 0x51FD, 0x0D35, 0x51FE, 0x1099,
+ 0x5200, 0x0C5B, 0x5201, 0x3813, 0x5202, 0x3814, 0x5203, 0x0A15,
+ 0x5204, 0x109A, 0x5205, 0x4AEF, 0x5206, 0x0DFC, 0x5207, 0x0A7E,
+ 0x5208, 0x05DE, 0x520A, 0x05E5, 0x520B, 0x109B, 0x520E, 0x109D,
+ 0x5211, 0x0710, 0x5212, 0x439E, 0x5213, 0x3815, 0x5214, 0x109C,
+ 0x5215, 0x20CE, 0x5216, 0x439F, 0x5217, 0x0FBB, 0x521D, 0x0973,
+ 0x5224, 0x0D51, 0x5225, 0x0E1C, 0x5226, 0x4AF0, 0x5227, 0x109E,
+ 0x5228, 0x4AF1, 0x5229, 0x0F62, 0x522A, 0x109F, 0x522B, 0x4AF2,
+ 0x522E, 0x10A0, 0x5230, 0x0C78, 0x5231, 0x4AF3, 0x5232, 0x4AF4,
+ 0x5233, 0x10A1, 0x5235, 0x4AF5, 0x5236, 0x0A4D, 0x5237, 0x086E,
+ 0x5238, 0x074A, 0x5239, 0x10A2, 0x523A, 0x0897, 0x523B, 0x0801,
+ 0x523C, 0x4AF6, 0x5243, 0x0C02, 0x5244, 0x10A4, 0x5247, 0x0B07,
+ 0x5249, 0x3816, 0x524A, 0x085F, 0x524B, 0x10A5, 0x524C, 0x10A6,
+ 0x524D, 0x0AB2, 0x524F, 0x10A3, 0x5254, 0x10A8, 0x5255, 0x43A1,
+ 0x5256, 0x0E64, 0x5257, 0x419C, 0x525A, 0x4AF7, 0x525B, 0x07F6,
+ 0x525C, 0x43A2, 0x525D, 0x1E5E, 0x525E, 0x10A7, 0x5260, 0x4AF8,
+ 0x5261, 0x3817, 0x5263, 0x074B, 0x5264, 0x084E, 0x5265, 0x0D23,
+ 0x5266, 0x3818, 0x5269, 0x10AB, 0x526A, 0x10A9, 0x526C, 0x43A3,
+ 0x526E, 0x4AF9, 0x526F, 0x0DED, 0x5270, 0x09D2, 0x5271, 0x10B2,
+ 0x5272, 0x05C2, 0x5273, 0x10AC, 0x5274, 0x10AA, 0x5275, 0x0AD1,
+ 0x5277, 0x43A4, 0x5278, 0x4AFA, 0x5279, 0x4AFB, 0x527D, 0x10AE,
+ 0x527F, 0x10AD, 0x5282, 0x43A6, 0x5283, 0x05A2, 0x5284, 0x43A5,
+ 0x5287, 0x0736, 0x5288, 0x10B3, 0x5289, 0x0F75, 0x528A, 0x4AFC,
+ 0x528C, 0x4AFD, 0x528D, 0x10AF, 0x5291, 0x10B4, 0x5292, 0x10B1,
+ 0x5293, 0x3819, 0x5294, 0x10B0, 0x5298, 0x43A8, 0x529B, 0x0F97,
+ 0x529C, 0x20CF, 0x529F, 0x07AD, 0x52A0, 0x0543, 0x52A3, 0x0FBC,
+ 0x52A4, 0x43AA, 0x52A6, 0x20D0, 0x52A9, 0x097F, 0x52AA, 0x0C52,
+ 0x52AB, 0x07F7, 0x52AC, 0x10B7, 0x52AD, 0x10B8, 0x52AF, 0x217D,
+ 0x52B1, 0x0FAD, 0x52B4, 0x0FD1, 0x52B5, 0x10BA, 0x52B9, 0x07AE,
+ 0x52BA, 0x43AB, 0x52BB, 0x43AC, 0x52BC, 0x10B9, 0x52BE, 0x058D,
+ 0x52C0, 0x20D1, 0x52C1, 0x10BB, 0x52C3, 0x0E84, 0x52C5, 0x0BD8,
+ 0x52C7, 0x0F10, 0x52C8, 0x381A, 0x52C9, 0x0E29, 0x52CA, 0x43AD,
+ 0x52CC, 0x419D, 0x52CD, 0x10BC, 0x52D0, 0x36E8, 0x52D1, 0x43AE,
+ 0x52D2, 0x1BEE, 0x52D5, 0x0C88, 0x52D6, 0x419E, 0x52D7, 0x10BD,
+ 0x52D8, 0x05E6, 0x52D9, 0x0EBF, 0x52DB, 0x20D2, 0x52DD, 0x0989,
+ 0x52DE, 0x10BE, 0x52DF, 0x0E37, 0x52E0, 0x10C2, 0x52E1, 0x4AFE,
+ 0x52E2, 0x0A4E, 0x52E3, 0x10BF, 0x52E4, 0x06C8, 0x52E6, 0x10C0,
+ 0x52E7, 0x05E7, 0x52E9, 0x4AFF, 0x52F0, 0x381B, 0x52F1, 0x4B00,
+ 0x52F2, 0x0704, 0x52F3, 0x10C3, 0x52F5, 0x10C4, 0x52F7, 0x43B0,
+ 0x52F8, 0x10C5, 0x52F9, 0x10C6, 0x52FA, 0x0907, 0x52FB, 0x419F,
+ 0x52FE, 0x07AF, 0x52FF, 0x0EEA, 0x5300, 0x20D3, 0x5301, 0x0EF4,
+ 0x5302, 0x0CCF, 0x5303, 0x4B01, 0x5305, 0x0E41, 0x5306, 0x10C7,
+ 0x5307, 0x4F4D, 0x5308, 0x10C8, 0x530A, 0x381C, 0x530B, 0x381D,
+ 0x530D, 0x10CA, 0x530F, 0x10CC, 0x5310, 0x10CB, 0x5311, 0x4B02,
+ 0x5315, 0x10CD, 0x5316, 0x053D, 0x5317, 0x0E7A, 0x5319, 0x086C,
+ 0x531A, 0x10CE, 0x531C, 0x41A0, 0x531D, 0x0ADB, 0x531F, 0x4B03,
+ 0x5320, 0x098A, 0x5321, 0x06A1, 0x5323, 0x10CF, 0x5324, 0x20D5,
+ 0x532A, 0x0D6F, 0x532D, 0x4B04, 0x532F, 0x10D0, 0x5331, 0x10D1,
+ 0x5332, 0x4B05, 0x5333, 0x10D2, 0x5335, 0x43B1, 0x5338, 0x10D3,
+ 0x5339, 0x0D96, 0x533A, 0x06E0, 0x533B, 0x04A9, 0x533D, 0x4B06,
+ 0x533E, 0x381E, 0x533F, 0x0C97, 0x5340, 0x10D4, 0x5341, 0x0947,
+ 0x5342, 0x43B2, 0x5343, 0x0A8D, 0x5345, 0x10D6, 0x5346, 0x10D5,
+ 0x5347, 0x098B, 0x5348, 0x0795, 0x5349, 0x10D8, 0x534A, 0x0D52,
+ 0x534B, 0x3820, 0x534C, 0x381F, 0x534D, 0x10D9, 0x5351, 0x0D70,
+ 0x5352, 0x0B14, 0x5353, 0x0B4E, 0x5354, 0x06A0, 0x5357, 0x0CC6,
+ 0x5358, 0x0B6F, 0x535A, 0x0D24, 0x535C, 0x0E7C, 0x535E, 0x10DB,
+ 0x5360, 0x0A8E, 0x5361, 0x3821, 0x5363, 0x41A1, 0x5365, 0x4B07,
+ 0x5366, 0x070B, 0x5367, 0x43B5, 0x5369, 0x10DC, 0x536C, 0x3822,
+ 0x536D, 0x4B08, 0x536E, 0x10DD, 0x536F, 0x04CE, 0x5370, 0x04B9,
+ 0x5371, 0x0629, 0x5372, 0x20D6, 0x5373, 0x0B08, 0x5374, 0x066B,
+ 0x5375, 0x0F5B, 0x5377, 0x10E0, 0x5378, 0x0537, 0x5379, 0x4B09,
+ 0x537A, 0x43B6, 0x537B, 0x10DF, 0x537D, 0x3435, 0x537E, 0x4B0A,
+ 0x537F, 0x06A2, 0x5382, 0x10E1, 0x5384, 0x0EFD, 0x5389, 0x37D0,
+ 0x5393, 0x20D7, 0x5394, 0x4B0B, 0x5396, 0x10E2, 0x5398, 0x0F9A,
+ 0x5399, 0x4B0C, 0x539A, 0x07B0, 0x539D, 0x41A2, 0x539F, 0x076A,
+ 0x53A0, 0x10E3, 0x53A4, 0x43B7, 0x53A5, 0x10E5, 0x53A6, 0x10E4,
+ 0x53A8, 0x0A25, 0x53A9, 0x04DB, 0x53AA, 0x4B0D, 0x53AB, 0x3823,
+ 0x53AD, 0x0500, 0x53AE, 0x10E6, 0x53AF, 0x4B0E, 0x53B0, 0x10E7,
+ 0x53B2, 0x20D8, 0x53B3, 0x076B, 0x53B4, 0x43B8, 0x53B6, 0x10E8,
+ 0x53B7, 0x43BA, 0x53BA, 0x4B0F, 0x53BB, 0x0688, 0x53C0, 0x43BB,
+ 0x53C1, 0x4B10, 0x53C2, 0x0880, 0x53C3, 0x10E9, 0x53C4, 0x4B11,
+ 0x53C5, 0x4B12, 0x53C8, 0x0EA2, 0x53C9, 0x0825, 0x53CA, 0x0674,
+ 0x53CB, 0x0F11, 0x53CC, 0x0AD2, 0x53CD, 0x0D53, 0x53CE, 0x0929,
+ 0x53D4, 0x0951, 0x53D5, 0x43BF, 0x53D6, 0x0914, 0x53D7, 0x0921,
+ 0x53D9, 0x0980, 0x53DA, 0x3824, 0x53DB, 0x0D54, 0x53DD, 0x20D9,
+ 0x53DF, 0x10EC, 0x53E0, 0x4B13, 0x53E1, 0x04E5, 0x53E2, 0x0AD3,
+ 0x53E3, 0x07B1, 0x53E4, 0x0779, 0x53E5, 0x06DF, 0x53E6, 0x3825,
+ 0x53E8, 0x10F0, 0x53E9, 0x0B5F, 0x53EA, 0x0B5E, 0x53EB, 0x06A3,
+ 0x53EC, 0x098C, 0x53ED, 0x10F1, 0x53EE, 0x10EF, 0x53EF, 0x0544,
+ 0x53F0, 0x0B46, 0x53F1, 0x08E4, 0x53F2, 0x0899, 0x53F3, 0x04C8,
+ 0x53F4, 0x43C1, 0x53F5, 0x3826, 0x53F6, 0x05CE, 0x53F7, 0x07F8,
+ 0x53F8, 0x0898, 0x53FA, 0x10F2, 0x5401, 0x10F3, 0x5403, 0x0663,
+ 0x5404, 0x05A4, 0x5408, 0x07F9, 0x5409, 0x0662, 0x540A, 0x0BFB,
+ 0x540B, 0x04C7, 0x540C, 0x0C89, 0x540D, 0x0ECA, 0x540E, 0x07B3,
+ 0x540F, 0x0F63, 0x5410, 0x0C41, 0x5411, 0x07B2, 0x5412, 0x41A3,
+ 0x5413, 0x4B14, 0x541B, 0x0705, 0x541D, 0x10FC, 0x541E, 0x368C,
+ 0x541F, 0x06DB, 0x5420, 0x0E78, 0x5424, 0x43C2, 0x5426, 0x0D71,
+ 0x5427, 0x3827, 0x5428, 0x43C3, 0x5429, 0x10FB, 0x542A, 0x4B15,
+ 0x542B, 0x061A, 0x542C, 0x10F6, 0x542D, 0x10F7, 0x542E, 0x10F9,
+ 0x5431, 0x4B16, 0x5433, 0x35C0, 0x5434, 0x4B17, 0x5435, 0x4B18,
+ 0x5436, 0x10FA, 0x5438, 0x0675, 0x5439, 0x0A27, 0x543B, 0x0DFD,
+ 0x543C, 0x10F8, 0x543D, 0x10F4, 0x543E, 0x0797, 0x543F, 0x35CF,
+ 0x5440, 0x10F5, 0x5442, 0x0FCA, 0x5443, 0x43C5, 0x5446, 0x0E42,
+ 0x5448, 0x0C04, 0x5449, 0x0796, 0x544A, 0x0802, 0x544C, 0x4B19,
+ 0x544D, 0x3828, 0x544E, 0x10FD, 0x5451, 0x0CB5, 0x5455, 0x3723,
+ 0x545F, 0x1101, 0x5462, 0x43C6, 0x5466, 0x3829, 0x5468, 0x092A,
+ 0x546A, 0x0922, 0x546B, 0x382A, 0x546C, 0x43C7, 0x5470, 0x1104,
+ 0x5471, 0x1102, 0x5473, 0x0EAF, 0x5474, 0x382B, 0x5475, 0x10FF,
+ 0x5476, 0x1108, 0x5477, 0x1103, 0x547B, 0x1106, 0x547C, 0x077A,
+ 0x547D, 0x0ECB, 0x547F, 0x41A4, 0x5480, 0x1107, 0x5484, 0x1109,
+ 0x5486, 0x110B, 0x5488, 0x41A5, 0x548A, 0x20DC, 0x548B, 0x0860,
+ 0x548C, 0x0FE8, 0x548D, 0x382C, 0x548E, 0x1100, 0x548F, 0x10FE,
+ 0x5490, 0x110A, 0x5492, 0x1105, 0x5495, 0x43C8, 0x5496, 0x382D,
+ 0x549C, 0x20DB, 0x54A0, 0x43C9, 0x54A1, 0x382E, 0x54A2, 0x110D,
+ 0x54A4, 0x1116, 0x54A5, 0x110F, 0x54A6, 0x43CA, 0x54A7, 0x4B1A,
+ 0x54A8, 0x1113, 0x54A9, 0x20DD, 0x54AA, 0x4B1B, 0x54AB, 0x1114,
+ 0x54AC, 0x1110, 0x54AD, 0x382F, 0x54AE, 0x43CB, 0x54AF, 0x1131,
+ 0x54B1, 0x4B1C, 0x54B2, 0x0859, 0x54B3, 0x058F, 0x54B7, 0x43CC,
+ 0x54B8, 0x110E, 0x54B9, 0x3830, 0x54BA, 0x43CD, 0x54BB, 0x4B1D,
+ 0x54BC, 0x1118, 0x54BD, 0x04BA, 0x54BE, 0x1117, 0x54BF, 0x3831,
+ 0x54C0, 0x0469, 0x54C1, 0x0DBC, 0x54C2, 0x1115, 0x54C3, 0x43CE,
+ 0x54C4, 0x1111, 0x54C6, 0x3832, 0x54C7, 0x110C, 0x54C8, 0x1112,
+ 0x54C9, 0x0838, 0x54CD, 0x3833, 0x54CE, 0x4B1E, 0x54D8, 0x1119,
+ 0x54E1, 0x04BB, 0x54E2, 0x1122, 0x54E5, 0x111A, 0x54E6, 0x111B,
+ 0x54E8, 0x098D, 0x54E9, 0x0E97, 0x54EA, 0x4B1F, 0x54EC, 0x43D0,
+ 0x54ED, 0x1120, 0x54EE, 0x111F, 0x54EF, 0x43D1, 0x54F1, 0x43D2,
+ 0x54F2, 0x0C29, 0x54F3, 0x43D3, 0x54FA, 0x1121, 0x54FC, 0x4B20,
+ 0x54FD, 0x111E, 0x54FF, 0x20DE, 0x5500, 0x43D4, 0x5501, 0x43D5,
+ 0x5504, 0x04D6, 0x5505, 0x4B21, 0x5506, 0x0826, 0x5507, 0x09F6,
+ 0x5508, 0x4B22, 0x5509, 0x43D6, 0x550E, 0x3834, 0x550F, 0x111C,
+ 0x5510, 0x0C5C, 0x5514, 0x111D, 0x5515, 0x4B23, 0x5516, 0x0466,
+ 0x5527, 0x4B24, 0x552A, 0x4B25, 0x552B, 0x3835, 0x552E, 0x1127,
+ 0x552F, 0x0F0D, 0x5531, 0x098F, 0x5533, 0x112D, 0x5535, 0x3836,
+ 0x5536, 0x4B26, 0x5538, 0x112C, 0x5539, 0x1123, 0x553C, 0x43D7,
+ 0x553E, 0x0B23, 0x5540, 0x1124, 0x5541, 0x43D8, 0x5544, 0x0B4F,
+ 0x5545, 0x1129, 0x5546, 0x098E, 0x5547, 0x43DA, 0x554A, 0x3837,
+ 0x554C, 0x1126, 0x554F, 0x0EF0, 0x5550, 0x41A6, 0x5551, 0x4B27,
+ 0x5553, 0x0712, 0x5556, 0x112A, 0x5557, 0x112B, 0x555C, 0x1128,
+ 0x555D, 0x112E, 0x555E, 0x1DD1, 0x5560, 0x3838, 0x5561, 0x4F54,
+ 0x5563, 0x1125, 0x5564, 0x43DC, 0x5566, 0x4B28, 0x557B, 0x1134,
+ 0x557C, 0x1139, 0x557D, 0x43DE, 0x557E, 0x1135, 0x5580, 0x1130,
+ 0x5581, 0x41A7, 0x5582, 0x43DF, 0x5583, 0x113A, 0x5584, 0x0AB3,
+ 0x5586, 0x20DF, 0x5587, 0x113C, 0x5588, 0x383A, 0x5589, 0x07B4,
+ 0x558A, 0x1132, 0x558B, 0x0BBB, 0x558E, 0x383B, 0x558F, 0x4B29,
+ 0x5591, 0x43E0, 0x5592, 0x4B2A, 0x5594, 0x4B2B, 0x5598, 0x1136,
+ 0x5599, 0x112F, 0x559A, 0x05E9, 0x559C, 0x062A, 0x559D, 0x05C3,
+ 0x559E, 0x1137, 0x559F, 0x1133, 0x55A4, 0x4B2C, 0x55A7, 0x074C,
+ 0x55A8, 0x113D, 0x55A9, 0x113B, 0x55AA, 0x0AD5, 0x55AB, 0x0664,
+ 0x55AC, 0x06A4, 0x55AD, 0x41A8, 0x55AE, 0x1138, 0x55B0, 0x06EC,
+ 0x55B2, 0x4B2D, 0x55B6, 0x04E6, 0x55BF, 0x43E5, 0x55C3, 0x4B2E,
+ 0x55C4, 0x1141, 0x55C5, 0x113F, 0x55C6, 0x4B2F, 0x55C7, 0x1178,
+ 0x55C9, 0x43E6, 0x55CC, 0x43E7, 0x55CE, 0x41A9, 0x55D1, 0x43E8,
+ 0x55D2, 0x43E2, 0x55D3, 0x4B30, 0x55D4, 0x1144, 0x55DA, 0x113E,
+ 0x55DB, 0x4B31, 0x55DC, 0x1142, 0x55DD, 0x43E9, 0x55DF, 0x1140,
+ 0x55E2, 0x43EB, 0x55E3, 0x089A, 0x55E4, 0x1143, 0x55E9, 0x43ED,
+ 0x55EC, 0x4B32, 0x55EE, 0x4B33, 0x55F1, 0x4B34, 0x55F6, 0x4B35,
+ 0x55F7, 0x1146, 0x55F8, 0x4B36, 0x55F9, 0x114B, 0x55FD, 0x1149,
+ 0x55FE, 0x1148, 0x5605, 0x4B37, 0x5606, 0x0B70, 0x5607, 0x43F0,
+ 0x5608, 0x383C, 0x5609, 0x0545, 0x560D, 0x4B38, 0x560E, 0x383D,
+ 0x560F, 0x383E, 0x5610, 0x43F1, 0x5611, 0x4B39, 0x5612, 0x4B3A,
+ 0x5614, 0x1145, 0x5616, 0x1147, 0x5617, 0x0990, 0x5618, 0x04D5,
+ 0x561B, 0x114A, 0x5620, 0x3C1D, 0x5628, 0x43EE, 0x5629, 0x055E,
+ 0x562C, 0x4B3B, 0x562F, 0x1155, 0x5630, 0x43F2, 0x5631, 0x09E4,
+ 0x5632, 0x1151, 0x5634, 0x114F, 0x5635, 0x4B3C, 0x5636, 0x1150,
+ 0x5637, 0x383F, 0x5638, 0x1152, 0x5639, 0x4B3D, 0x563B, 0x41AA,
+ 0x563D, 0x43F4, 0x563F, 0x3840, 0x5640, 0x43F5, 0x5642, 0x04DF,
+ 0x5647, 0x43F6, 0x5649, 0x3841, 0x564B, 0x3842, 0x564C, 0x0ABB,
+ 0x564D, 0x4B3E, 0x564E, 0x114C, 0x564F, 0x3843, 0x5650, 0x114D,
+ 0x5653, 0x1F1B, 0x5654, 0x4B3F, 0x565B, 0x05D8, 0x565E, 0x43F7,
+ 0x5660, 0x43F8, 0x5664, 0x1154, 0x5666, 0x3844, 0x5668, 0x062B,
+ 0x5669, 0x3845, 0x566A, 0x1157, 0x566B, 0x1153, 0x566C, 0x1156,
+ 0x566D, 0x43F9, 0x566F, 0x3846, 0x5671, 0x3847, 0x5672, 0x3848,
+ 0x5674, 0x0DFE, 0x5676, 0x3C33, 0x5678, 0x0CAD, 0x567A, 0x0D4C,
+ 0x5680, 0x1159, 0x5685, 0x4B40, 0x5686, 0x1158, 0x5687, 0x05A3,
+ 0x5688, 0x43FB, 0x568A, 0x115A, 0x568C, 0x43FC, 0x568F, 0x115D,
+ 0x5694, 0x115C, 0x5695, 0x3849, 0x5699, 0x1DE6, 0x569A, 0x384A,
+ 0x569D, 0x43FD, 0x569E, 0x41AB, 0x569F, 0x4B41, 0x56A0, 0x115B,
+ 0x56A2, 0x0CEF, 0x56A5, 0x115E, 0x56A6, 0x4B42, 0x56A8, 0x43FE,
+ 0x56A9, 0x41AC, 0x56AC, 0x384B, 0x56AD, 0x384C, 0x56AE, 0x115F,
+ 0x56B1, 0x384D, 0x56B2, 0x43FF, 0x56B3, 0x41AD, 0x56B4, 0x1161,
+ 0x56B6, 0x1160, 0x56B7, 0x4B43, 0x56BC, 0x1163, 0x56C0, 0x1166,
+ 0x56C1, 0x1164, 0x56C2, 0x1162, 0x56C3, 0x1165, 0x56C5, 0x4400,
+ 0x56C8, 0x1167, 0x56C9, 0x384E, 0x56CA, 0x1E5A, 0x56CC, 0x4B44,
+ 0x56CD, 0x4401, 0x56CE, 0x1168, 0x56CF, 0x4B45, 0x56D1, 0x1169,
+ 0x56D3, 0x116A, 0x56D7, 0x116B, 0x56D8, 0x107C, 0x56D9, 0x4B46,
+ 0x56DA, 0x0928, 0x56DB, 0x089B, 0x56DD, 0x384F, 0x56DE, 0x0573,
+ 0x56DF, 0x4402, 0x56E0, 0x04BC, 0x56E1, 0x4B47, 0x56E3, 0x0B82,
+ 0x56E4, 0x3850, 0x56E8, 0x4403, 0x56EB, 0x4B48, 0x56ED, 0x4B49,
+ 0x56EE, 0x116C, 0x56F0, 0x0814, 0x56F1, 0x4B4A, 0x56F2, 0x0493,
+ 0x56F3, 0x0A24, 0x56F6, 0x4404, 0x56F7, 0x4405, 0x56F9, 0x116D,
+ 0x56FA, 0x077B, 0x56FD, 0x0803, 0x56FF, 0x116F, 0x5700, 0x116E,
+ 0x5703, 0x0E30, 0x5704, 0x1170, 0x5707, 0x4B4B, 0x5708, 0x1172,
+ 0x5709, 0x1171, 0x570A, 0x3851, 0x570B, 0x1173, 0x570C, 0x4B4C,
+ 0x570D, 0x1174, 0x570F, 0x074D, 0x5712, 0x0502, 0x5713, 0x1175,
+ 0x5715, 0x3852, 0x5716, 0x1177, 0x5718, 0x1176, 0x571A, 0x4B4D,
+ 0x571B, 0x4B4E, 0x571C, 0x1179, 0x571D, 0x4B4F, 0x571F, 0x0C54,
+ 0x5721, 0x3680, 0x5723, 0x3853, 0x5726, 0x117A, 0x5727, 0x0479,
+ 0x5728, 0x084F, 0x5729, 0x4408, 0x572C, 0x4B50, 0x572D, 0x0713,
+ 0x572E, 0x4B51, 0x572F, 0x3854, 0x5730, 0x0B8D, 0x5733, 0x3855,
+ 0x5734, 0x3856, 0x5737, 0x117B, 0x5738, 0x117C, 0x573B, 0x117E,
+ 0x573D, 0x4B52, 0x573E, 0x4B53, 0x5740, 0x117F, 0x5742, 0x0854,
+ 0x5745, 0x440A, 0x5746, 0x440B, 0x5747, 0x06C9, 0x574A, 0x0E65,
+ 0x574C, 0x3857, 0x574D, 0x440C, 0x574E, 0x117D, 0x574F, 0x1180,
+ 0x5750, 0x0831, 0x5751, 0x07B5, 0x5759, 0x20E0, 0x575F, 0x4B54,
+ 0x5761, 0x1184, 0x5764, 0x0815, 0x5765, 0x20E1, 0x5766, 0x0B71,
+ 0x5768, 0x440E, 0x5769, 0x1181, 0x576A, 0x0BF6, 0x576B, 0x4B55,
+ 0x576D, 0x4B56, 0x576F, 0x440F, 0x5770, 0x3858, 0x5773, 0x4410,
+ 0x5774, 0x4411, 0x5775, 0x4412, 0x5777, 0x41AE, 0x577A, 0x4B57,
+ 0x577B, 0x4413, 0x577C, 0x41AF, 0x577F, 0x1185, 0x5782, 0x0A28,
+ 0x5783, 0x4B58, 0x5788, 0x1183, 0x5789, 0x1186, 0x578B, 0x0715,
+ 0x578C, 0x3859, 0x5793, 0x1187, 0x5797, 0x4B59, 0x579A, 0x4416,
+ 0x579C, 0x385A, 0x579D, 0x4417, 0x579E, 0x4418, 0x57A0, 0x1188,
+ 0x57A2, 0x07B6, 0x57A3, 0x059E, 0x57A4, 0x118A, 0x57A8, 0x4419,
+ 0x57AA, 0x118B, 0x57AC, 0x20E2, 0x57AE, 0x4B5A, 0x57B0, 0x118C,
+ 0x57B3, 0x1189, 0x57B8, 0x385B, 0x57C0, 0x1182, 0x57C3, 0x118D,
+ 0x57C6, 0x118E, 0x57C7, 0x20E4, 0x57C8, 0x20E3, 0x57CB, 0x0E92,
+ 0x57CC, 0x441C, 0x57CE, 0x09D3, 0x57CF, 0x41B1, 0x57D2, 0x1190,
+ 0x57D3, 0x1191, 0x57D4, 0x118F, 0x57D5, 0x4B5B, 0x57D6, 0x1193,
+ 0x57D7, 0x441A, 0x57DC, 0x0CEE, 0x57DE, 0x441F, 0x57DF, 0x04AC,
+ 0x57E0, 0x0DC8, 0x57E3, 0x1194, 0x57E4, 0x41B2, 0x57E6, 0x385C,
+ 0x57E7, 0x4B5C, 0x57ED, 0x385D, 0x57F0, 0x4420, 0x57F4, 0x09E5,
+ 0x57F5, 0x385E, 0x57F6, 0x385F, 0x57F7, 0x08E5, 0x57F8, 0x4422,
+ 0x57F9, 0x0D13, 0x57FA, 0x062C, 0x57FB, 0x4423, 0x57FC, 0x085B,
+ 0x57FD, 0x4424, 0x57FF, 0x3860, 0x5800, 0x0E87, 0x5802, 0x0C8A,
+ 0x5804, 0x4425, 0x5805, 0x074E, 0x5806, 0x0B2F, 0x5809, 0x3861,
+ 0x580A, 0x1192, 0x580B, 0x1195, 0x580D, 0x4B5D, 0x5815, 0x0B24,
+ 0x5819, 0x1196, 0x581D, 0x1197, 0x581E, 0x4426, 0x5820, 0x3862,
+ 0x5821, 0x1199, 0x5824, 0x0C05, 0x5826, 0x4B5E, 0x5827, 0x4427,
+ 0x582A, 0x05EA, 0x582F, 0x1D32, 0x5830, 0x0503, 0x5831, 0x0E43,
+ 0x5832, 0x3863, 0x5834, 0x09D4, 0x5835, 0x0C42, 0x5839, 0x4428,
+ 0x583A, 0x0856, 0x583D, 0x119F, 0x5840, 0x0E0D, 0x5841, 0x0FA5,
+ 0x5849, 0x442A, 0x584A, 0x0574, 0x584B, 0x119B, 0x584C, 0x442B,
+ 0x584D, 0x4B5F, 0x584F, 0x4B60, 0x5851, 0x0ABC, 0x5852, 0x119E,
+ 0x5854, 0x0C5D, 0x5857, 0x0C43, 0x5858, 0x0C5E, 0x5859, 0x0D4D,
+ 0x585A, 0x0BE9, 0x585E, 0x0839, 0x585F, 0x4B61, 0x5861, 0x1E47,
+ 0x5862, 0x119A, 0x5864, 0x41B3, 0x5867, 0x442C, 0x5869, 0x0518,
+ 0x586B, 0x0C30, 0x586D, 0x4B62, 0x5870, 0x119C, 0x5872, 0x1198,
+ 0x5875, 0x0A16, 0x5879, 0x11A0, 0x587C, 0x3864, 0x587E, 0x0958,
+ 0x587F, 0x4B63, 0x5880, 0x3865, 0x5881, 0x4B64, 0x5883, 0x06A5,
+ 0x5885, 0x11A1, 0x5889, 0x41B4, 0x588A, 0x442D, 0x588B, 0x442E,
+ 0x588D, 0x442F, 0x588F, 0x4430, 0x5890, 0x4431, 0x5893, 0x0E38,
+ 0x5894, 0x4432, 0x5897, 0x0AFF, 0x5898, 0x4B65, 0x589C, 0x0BE2,
+ 0x589D, 0x4433, 0x589E, 0x20E7, 0x589F, 0x11A3, 0x58A8, 0x0E7D,
+ 0x58A9, 0x3866, 0x58AA, 0x4434, 0x58AB, 0x11A4, 0x58AE, 0x11A9,
+ 0x58B1, 0x4435, 0x58B2, 0x20E8, 0x58B3, 0x0DFF, 0x58B8, 0x11A8,
+ 0x58B9, 0x11A2, 0x58BA, 0x11A5, 0x58BB, 0x11A7, 0x58BC, 0x4B66,
+ 0x58BE, 0x0816, 0x58C1, 0x0E19, 0x58C3, 0x4437, 0x58C5, 0x11AA,
+ 0x58C7, 0x0B83, 0x58CA, 0x0575, 0x58CC, 0x09D5, 0x58CD, 0x4438,
+ 0x58CE, 0x3867, 0x58D0, 0x3868, 0x58D1, 0x11AC, 0x58D2, 0x41B6,
+ 0x58D3, 0x11AB, 0x58D4, 0x3869, 0x58D5, 0x07FA, 0x58D7, 0x11AD,
+ 0x58D8, 0x11AF, 0x58D9, 0x11AE, 0x58DA, 0x386A, 0x58DC, 0x11B1,
+ 0x58DE, 0x11A6, 0x58DF, 0x11B3, 0x58E0, 0x41B7, 0x58E2, 0x4439,
+ 0x58E4, 0x11B2, 0x58E5, 0x11B0, 0x58E9, 0x386B, 0x58EB, 0x089C,
+ 0x58EC, 0x0A17, 0x58EE, 0x0AD6, 0x58EF, 0x11B4, 0x58F0, 0x0A60,
+ 0x58F1, 0x04B1, 0x58F2, 0x0D1A, 0x58F3, 0x443A, 0x58F4, 0x443B,
+ 0x58F7, 0x0BF7, 0x58F9, 0x11B6, 0x58FA, 0x11B5, 0x58FB, 0x11B7,
+ 0x58FC, 0x11B8, 0x58FD, 0x11B9, 0x5902, 0x11BA, 0x5905, 0x443C,
+ 0x5906, 0x443D, 0x5909, 0x0E21, 0x590A, 0x11BB, 0x590B, 0x20E9,
+ 0x590C, 0x386C, 0x590D, 0x443E, 0x590F, 0x0546, 0x5910, 0x11BC,
+ 0x5914, 0x443F, 0x5915, 0x0F26, 0x5916, 0x058E, 0x5918, 0x10DE,
+ 0x5919, 0x0952, 0x591A, 0x0B1F, 0x591B, 0x11BD, 0x591C, 0x0EF7,
+ 0x591F, 0x4B67, 0x5922, 0x0EC0, 0x5923, 0x4B68, 0x5924, 0x386D,
+ 0x5925, 0x11BF, 0x5927, 0x0B47, 0x5929, 0x0C31, 0x592A, 0x0B20,
+ 0x592B, 0x0DC9, 0x592C, 0x11C0, 0x592D, 0x11C1, 0x592E, 0x051D,
+ 0x592F, 0x386E, 0x5931, 0x08E6, 0x5932, 0x11C2, 0x5937, 0x0494,
+ 0x5938, 0x11C3, 0x5939, 0x3725, 0x593D, 0x4442, 0x593E, 0x11C4,
+ 0x5944, 0x0504, 0x5946, 0x4444, 0x5947, 0x062D, 0x5948, 0x0CB8,
+ 0x5949, 0x0E44, 0x594E, 0x11C8, 0x594F, 0x0AD7, 0x5950, 0x11C7,
+ 0x5951, 0x0716, 0x5953, 0x20EA, 0x5954, 0x0E89, 0x5955, 0x11C6,
+ 0x5957, 0x0C5F, 0x5958, 0x11CA, 0x5959, 0x4B69, 0x595A, 0x11C9,
+ 0x595B, 0x20EB, 0x595D, 0x20EC, 0x595F, 0x4447, 0x5960, 0x11CC,
+ 0x5961, 0x386F, 0x5962, 0x11CB, 0x5963, 0x20ED, 0x5965, 0x051E,
+ 0x5967, 0x11CD, 0x5968, 0x0991, 0x5969, 0x11CF, 0x596A, 0x0B63,
+ 0x596C, 0x11CE, 0x596D, 0x3870, 0x596E, 0x0E03, 0x5973, 0x0981,
+ 0x5974, 0x0C55, 0x5975, 0x4449, 0x5976, 0x444A, 0x5978, 0x11D0,
+ 0x5979, 0x4B6A, 0x597C, 0x444B, 0x597D, 0x07B7, 0x5981, 0x11D1,
+ 0x5982, 0x0CD7, 0x5983, 0x0D72, 0x5984, 0x0EDD, 0x598A, 0x0CDB,
+ 0x598B, 0x41B9, 0x598D, 0x11DA, 0x5992, 0x41BA, 0x5993, 0x0652,
+ 0x5996, 0x0F2F, 0x5997, 0x4B6B, 0x5999, 0x0EBB, 0x599B, 0x1239,
+ 0x599D, 0x11D2, 0x599F, 0x444C, 0x59A3, 0x11D5, 0x59A4, 0x20EE,
+ 0x59A5, 0x0B25, 0x59A8, 0x0E66, 0x59AC, 0x0C44, 0x59AE, 0x444D,
+ 0x59AF, 0x4B6C, 0x59B2, 0x11D6, 0x59B3, 0x4B6D, 0x59B9, 0x0E93,
+ 0x59BA, 0x20EF, 0x59BB, 0x083A, 0x59BC, 0x444E, 0x59BE, 0x0992,
+ 0x59C3, 0x41BB, 0x59C6, 0x11D7, 0x59C8, 0x444F, 0x59C9, 0x089E,
+ 0x59CA, 0x3871, 0x59CB, 0x089D, 0x59CD, 0x4450, 0x59D0, 0x047D,
+ 0x59D1, 0x077C, 0x59D2, 0x3872, 0x59D3, 0x0A4F, 0x59D4, 0x0495,
+ 0x59D9, 0x11DB, 0x59DA, 0x11DC, 0x59DC, 0x11D9, 0x59DD, 0x3873,
+ 0x59DE, 0x4451, 0x59DF, 0x4B6E, 0x59E3, 0x3874, 0x59E4, 0x3875,
+ 0x59E5, 0x04DA, 0x59E6, 0x05EB, 0x59E7, 0x4452, 0x59E8, 0x11D8,
+ 0x59EA, 0x0ED1, 0x59EB, 0x0DA3, 0x59EC, 0x36AD, 0x59EE, 0x4453,
+ 0x59F1, 0x4B6F, 0x59F6, 0x046C, 0x59F8, 0x4B70, 0x59FB, 0x04BD,
+ 0x59FF, 0x089F, 0x5A01, 0x0496, 0x5A03, 0x0467, 0x5A04, 0x3876,
+ 0x5A09, 0x11E1, 0x5A0C, 0x3877, 0x5A0D, 0x4457, 0x5A11, 0x11DF,
+ 0x5A13, 0x41BC, 0x5A17, 0x4458, 0x5A18, 0x0EC8, 0x5A1A, 0x11E2,
+ 0x5A1B, 0x35C1, 0x5A1C, 0x11E0, 0x5A1F, 0x11DE, 0x5A20, 0x09F7,
+ 0x5A23, 0x3878, 0x5A25, 0x11DD, 0x5A27, 0x4459, 0x5A29, 0x0E2A,
+ 0x5A2D, 0x445A, 0x5A2F, 0x0798, 0x5A35, 0x11E6, 0x5A36, 0x11E7,
+ 0x5A3C, 0x0993, 0x5A40, 0x11E3, 0x5A41, 0x0FD2, 0x5A46, 0x0D02,
+ 0x5A47, 0x3879, 0x5A49, 0x11E5, 0x5A55, 0x387A, 0x5A5A, 0x0817,
+ 0x5A62, 0x11E8, 0x5A63, 0x387B, 0x5A65, 0x445B, 0x5A66, 0x0DCA,
+ 0x5A67, 0x41BD, 0x5A6A, 0x11E9, 0x5A6C, 0x11E4, 0x5A6D, 0x387C,
+ 0x5A77, 0x41BE, 0x5A7A, 0x445C, 0x5A7E, 0x387D, 0x5A7F, 0x0EC7,
+ 0x5A84, 0x41BF, 0x5A8B, 0x445D, 0x5A92, 0x0D14, 0x5A9A, 0x11EA,
+ 0x5A9B, 0x0DA4, 0x5A9C, 0x445E, 0x5A9E, 0x387E, 0x5A9F, 0x445F,
+ 0x5AA0, 0x4460, 0x5AA2, 0x4461, 0x5AA7, 0x387F, 0x5AAC, 0x3880,
+ 0x5AB1, 0x4462, 0x5AB2, 0x4B71, 0x5AB3, 0x3881, 0x5AB5, 0x4463,
+ 0x5AB8, 0x4B72, 0x5ABA, 0x4464, 0x5ABC, 0x11EB, 0x5ABD, 0x11EF,
+ 0x5ABE, 0x11EC, 0x5ABF, 0x4465, 0x5AC1, 0x0547, 0x5AC2, 0x11EE,
+ 0x5AC4, 0x41C0, 0x5AC9, 0x08E7, 0x5ACB, 0x11ED, 0x5ACC, 0x074F,
+ 0x5AD0, 0x11FB, 0x5AD6, 0x11F4, 0x5AD7, 0x11F1, 0x5ADA, 0x4466,
+ 0x5ADC, 0x4467, 0x5AE0, 0x3882, 0x5AE1, 0x0BA2, 0x5AE3, 0x11F0,
+ 0x5AE5, 0x4468, 0x5AE6, 0x11F2, 0x5AE9, 0x11F3, 0x5AEA, 0x4B73,
+ 0x5AEE, 0x446A, 0x5AF0, 0x4469, 0x5AF5, 0x446B, 0x5AF6, 0x4B74,
+ 0x5AFA, 0x11F5, 0x5AFB, 0x11F6, 0x5B00, 0x3883, 0x5B08, 0x446C,
+ 0x5B09, 0x062E, 0x5B0B, 0x11F8, 0x5B0C, 0x11F7, 0x5B16, 0x11F9,
+ 0x5B17, 0x446D, 0x5B19, 0x3884, 0x5B1B, 0x4B75, 0x5B1D, 0x4B76,
+ 0x5B21, 0x4B77, 0x5B22, 0x09D6, 0x5B25, 0x3885, 0x5B2A, 0x11FC,
+ 0x5B2C, 0x0BF8, 0x5B2D, 0x3886, 0x5B30, 0x04E7, 0x5B32, 0x11FA,
+ 0x5B34, 0x446E, 0x5B36, 0x11FD, 0x5B38, 0x4B78, 0x5B3E, 0x11FE,
+ 0x5B40, 0x1201, 0x5B41, 0x3887, 0x5B43, 0x11FF, 0x5B45, 0x1200,
+ 0x5B4C, 0x446F, 0x5B50, 0x08A0, 0x5B51, 0x1202, 0x5B52, 0x4470,
+ 0x5B54, 0x07B8, 0x5B55, 0x1203, 0x5B56, 0x20F0, 0x5B57, 0x08C8,
+ 0x5B58, 0x0B18, 0x5B5A, 0x1204, 0x5B5B, 0x1205, 0x5B5C, 0x08A8,
+ 0x5B5D, 0x07B9, 0x5B5F, 0x0EDE, 0x5B63, 0x0642, 0x5B64, 0x077D,
+ 0x5B65, 0x1206, 0x5B66, 0x05B6, 0x5B68, 0x4471, 0x5B69, 0x1207,
+ 0x5B6B, 0x0B19, 0x5B6F, 0x4472, 0x5B70, 0x1208, 0x5B71, 0x1230,
+ 0x5B73, 0x1209, 0x5B75, 0x120A, 0x5B76, 0x3728, 0x5B78, 0x120B,
+ 0x5B7A, 0x120D, 0x5B7C, 0x3888, 0x5B7D, 0x41C2, 0x5B7E, 0x3889,
+ 0x5B7F, 0x388A, 0x5B80, 0x120E, 0x5B81, 0x4473, 0x5B82, 0x3610,
+ 0x5B83, 0x120F, 0x5B84, 0x4474, 0x5B85, 0x0B50, 0x5B87, 0x04C9,
+ 0x5B88, 0x0915, 0x5B89, 0x0486, 0x5B8A, 0x388B, 0x5B8B, 0x0AD9,
+ 0x5B8C, 0x05EC, 0x5B8D, 0x08E1, 0x5B8F, 0x07BA, 0x5B93, 0x41C3,
+ 0x5B95, 0x0C60, 0x5B96, 0x4476, 0x5B97, 0x092B, 0x5B98, 0x05ED,
+ 0x5B99, 0x0BA6, 0x5B9A, 0x0C06, 0x5B9B, 0x047C, 0x5B9C, 0x0653,
+ 0x5B9D, 0x0E45, 0x5B9F, 0x08EE, 0x5BA2, 0x066C, 0x5BA3, 0x0A8F,
+ 0x5BA4, 0x08E8, 0x5BA5, 0x0F12, 0x5BA6, 0x1210, 0x5BAC, 0x4477,
+ 0x5BAE, 0x0676, 0x5BB0, 0x083B, 0x5BB3, 0x0590, 0x5BB4, 0x0505,
+ 0x5BB5, 0x0994, 0x5BB6, 0x0548, 0x5BB7, 0x4B79, 0x5BB8, 0x1211,
+ 0x5BB9, 0x0F30, 0x5BBF, 0x0953, 0x5BC0, 0x20F1, 0x5BC2, 0x0910,
+ 0x5BC3, 0x1212, 0x5BC4, 0x062F, 0x5BC5, 0x0CAA, 0x5BC6, 0x0EB5,
+ 0x5BC7, 0x1213, 0x5BC9, 0x1214, 0x5BCC, 0x0DCB, 0x5BCE, 0x447A,
+ 0x5BD0, 0x1216, 0x5BD2, 0x05E4, 0x5BD3, 0x06EF, 0x5BD4, 0x1215,
+ 0x5BD6, 0x447B, 0x5BD7, 0x4B7A, 0x5BD8, 0x20F3, 0x5BDB, 0x05EE,
+ 0x5BDD, 0x09F8, 0x5BDE, 0x121A, 0x5BDF, 0x086F, 0x5BE0, 0x4B7B,
+ 0x5BE1, 0x0549, 0x5BE2, 0x1219, 0x5BE4, 0x1217, 0x5BE5, 0x121B,
+ 0x5BE6, 0x1218, 0x5BE7, 0x0CE1, 0x5BE8, 0x148E, 0x5BE9, 0x09F9,
+ 0x5BEB, 0x121C, 0x5BEC, 0x4F4E, 0x5BEE, 0x0F88, 0x5BF0, 0x121D,
+ 0x5BF1, 0x447E, 0x5BF3, 0x121F, 0x5BF5, 0x0BBC, 0x5BF6, 0x121E,
+ 0x5BF8, 0x0A47, 0x5BFA, 0x08C9, 0x5BFD, 0x447F, 0x5BFE, 0x0B30,
+ 0x5BFF, 0x0923, 0x5C01, 0x0DE7, 0x5C02, 0x0A90, 0x5C03, 0x4481,
+ 0x5C04, 0x08F9, 0x5C05, 0x1220, 0x5C06, 0x0995, 0x5C07, 0x1221,
+ 0x5C08, 0x1222, 0x5C09, 0x0497, 0x5C0A, 0x0B1A, 0x5C0B, 0x0A18,
+ 0x5C0D, 0x1223, 0x5C0E, 0x0C8B, 0x5C0F, 0x0996, 0x5C11, 0x0997,
+ 0x5C12, 0x41C4, 0x5C13, 0x1224, 0x5C14, 0x372A, 0x5C16, 0x0A91,
+ 0x5C19, 0x360B, 0x5C1A, 0x0998, 0x5C1E, 0x20F5, 0x5C1F, 0x4B7C,
+ 0x5C20, 0x1225, 0x5C22, 0x1226, 0x5C23, 0x388C, 0x5C24, 0x0EEC,
+ 0x5C28, 0x1227, 0x5C29, 0x4482, 0x5C2A, 0x4B7D, 0x5C2B, 0x388D,
+ 0x5C2C, 0x4B7E, 0x5C2D, 0x06BE, 0x5C30, 0x388E, 0x5C31, 0x092C,
+ 0x5C36, 0x4B7F, 0x5C38, 0x1228, 0x5C39, 0x1229, 0x5C3A, 0x0908,
+ 0x5C3B, 0x09F2, 0x5C3C, 0x0CCC, 0x5C3D, 0x0A1A, 0x5C3E, 0x0D8C,
+ 0x5C3F, 0x0CD8, 0x5C40, 0x06C1, 0x5C41, 0x122A, 0x5C45, 0x0689,
+ 0x5C46, 0x122B, 0x5C48, 0x06F6, 0x5C4A, 0x0CA7, 0x5C4B, 0x0530,
+ 0x5C4D, 0x08A1, 0x5C4E, 0x122C, 0x5C4F, 0x122F, 0x5C50, 0x122E,
+ 0x5C51, 0x06F5, 0x5C53, 0x122D, 0x5C55, 0x0C32, 0x5C59, 0x4B80,
+ 0x5C5B, 0x1E92, 0x5C5C, 0x4B81, 0x5C5E, 0x0B10, 0x5C5F, 0x4484,
+ 0x5C60, 0x0C45, 0x5C61, 0x08F4, 0x5C62, 0x1E0D, 0x5C63, 0x388F,
+ 0x5C64, 0x0ADA, 0x5C65, 0x0F64, 0x5C67, 0x4485, 0x5C68, 0x4486,
+ 0x5C69, 0x3890, 0x5C6C, 0x1231, 0x5C6D, 0x4B82, 0x5C6E, 0x1232,
+ 0x5C6F, 0x0CAE, 0x5C70, 0x4487, 0x5C71, 0x0881, 0x5C76, 0x1234,
+ 0x5C79, 0x1235, 0x5C7A, 0x41C7, 0x5C7C, 0x3891, 0x5C88, 0x448C,
+ 0x5C8A, 0x448D, 0x5C8C, 0x1236, 0x5C8F, 0x41C8, 0x5C90, 0x0630,
+ 0x5C91, 0x1237, 0x5C94, 0x1238, 0x5C9F, 0x41C9, 0x5CA0, 0x4491,
+ 0x5CA1, 0x052C, 0x5CA2, 0x4492, 0x5CA3, 0x41CA, 0x5CA6, 0x20F6,
+ 0x5CA7, 0x4493, 0x5CA8, 0x0ABD, 0x5CA9, 0x0620, 0x5CAA, 0x41CB,
+ 0x5CAB, 0x123A, 0x5CAC, 0x0EB4, 0x5CAD, 0x4495, 0x5CB1, 0x0B32,
+ 0x5CB3, 0x05B7, 0x5CB5, 0x4496, 0x5CB6, 0x123C, 0x5CB7, 0x123E,
+ 0x5CB8, 0x061B, 0x5CBA, 0x20F7, 0x5CBB, 0x123B, 0x5CBC, 0x123D,
+ 0x5CBE, 0x1240, 0x5CC5, 0x123F, 0x5CC7, 0x1241, 0x5CC9, 0x4498,
+ 0x5CCB, 0x3892, 0x5CD0, 0x41CC, 0x5CD2, 0x3893, 0x5CD9, 0x1242,
+ 0x5CDD, 0x4B83, 0x5CE0, 0x0C95, 0x5CE1, 0x06A6, 0x5CE6, 0x372C,
+ 0x5CE8, 0x0565, 0x5CE9, 0x1243, 0x5CEA, 0x1248, 0x5CED, 0x1246,
+ 0x5CEF, 0x0E47, 0x5CF0, 0x0E46, 0x5CF4, 0x3894, 0x5CF5, 0x20F8,
+ 0x5CF6, 0x0C61, 0x5CFA, 0x1245, 0x5CFB, 0x095E, 0x5CFD, 0x1244,
+ 0x5D01, 0x4B84, 0x5D06, 0x449B, 0x5D07, 0x0A38, 0x5D0B, 0x1249,
+ 0x5D0D, 0x41CE, 0x5D0E, 0x085A, 0x5D10, 0x449C, 0x5D11, 0x124F,
+ 0x5D14, 0x1250, 0x5D15, 0x124A, 0x5D16, 0x0591, 0x5D17, 0x124B,
+ 0x5D18, 0x1254, 0x5D19, 0x1253, 0x5D1A, 0x1252, 0x5D1B, 0x124E,
+ 0x5D1D, 0x449E, 0x5D1F, 0x124D, 0x5D20, 0x449F, 0x5D22, 0x1251,
+ 0x5D24, 0x3895, 0x5D26, 0x3896, 0x5D27, 0x20F9, 0x5D29, 0x0E48,
+ 0x5D2B, 0x449D, 0x5D31, 0x44A0, 0x5D34, 0x4B85, 0x5D39, 0x44A1,
+ 0x5D3D, 0x4B86, 0x5D42, 0x20FC, 0x5D43, 0x3897, 0x5D46, 0x3898,
+ 0x5D47, 0x41CF, 0x5D4A, 0x3899, 0x5D4B, 0x1258, 0x5D4C, 0x1255,
+ 0x5D4E, 0x1257, 0x5D50, 0x0F5C, 0x5D52, 0x1256, 0x5D53, 0x20FA,
+ 0x5D59, 0x4B87, 0x5D5C, 0x124C, 0x5D61, 0x44A3, 0x5D69, 0x0A39,
+ 0x5D6A, 0x44A4, 0x5D6C, 0x1259, 0x5D6D, 0x20FD, 0x5D6F, 0x0827,
+ 0x5D70, 0x44A6, 0x5D73, 0x125A, 0x5D76, 0x125B, 0x5D7E, 0x4B88,
+ 0x5D81, 0x41D0, 0x5D82, 0x125E, 0x5D83, 0x4B89, 0x5D84, 0x125D,
+ 0x5D87, 0x125C, 0x5D88, 0x44A9, 0x5D8B, 0x0C62, 0x5D8C, 0x1247,
+ 0x5D90, 0x1264, 0x5D92, 0x389A, 0x5D94, 0x389B, 0x5D97, 0x44AB,
+ 0x5D99, 0x389C, 0x5D9D, 0x1260, 0x5DA0, 0x389D, 0x5DA2, 0x125F,
+ 0x5DA4, 0x41D1, 0x5DA7, 0x41D2, 0x5DAC, 0x1261, 0x5DAE, 0x1262,
+ 0x5DB0, 0x44AC, 0x5DB2, 0x3C2D, 0x5DB4, 0x44AD, 0x5DB7, 0x1265,
+ 0x5DB8, 0x20FE, 0x5DB9, 0x20FF, 0x5DBA, 0x0FAE, 0x5DBC, 0x1266,
+ 0x5DBD, 0x1263, 0x5DC7, 0x4B8A, 0x5DC9, 0x1267, 0x5DCB, 0x41D3,
+ 0x5DCC, 0x061C, 0x5DCD, 0x1268, 0x5DD0, 0x2100, 0x5DD1, 0x44AF,
+ 0x5DD2, 0x126A, 0x5DD3, 0x1269, 0x5DD6, 0x126B, 0x5DD7, 0x44B0,
+ 0x5DD8, 0x389E, 0x5DDB, 0x126C, 0x5DDD, 0x0A92, 0x5DDE, 0x092D,
+ 0x5DE0, 0x389F, 0x5DE1, 0x096E, 0x5DE2, 0x3432, 0x5DE3, 0x0AE5,
+ 0x5DE4, 0x44B2, 0x5DE5, 0x07BB, 0x5DE6, 0x0828, 0x5DE7, 0x07BC,
+ 0x5DE8, 0x068A, 0x5DE9, 0x44B3, 0x5DEB, 0x126D, 0x5DEE, 0x0829,
+ 0x5DF1, 0x077E, 0x5DF2, 0x126E, 0x5DF3, 0x0EB2, 0x5DF4, 0x0CF9,
+ 0x5DF5, 0x126F, 0x5DF7, 0x07BD, 0x5DF8, 0x38A0, 0x5DF9, 0x4B8B,
+ 0x5DFB, 0x05E8, 0x5DFD, 0x0B65, 0x5DFE, 0x06CA, 0x5DFF, 0x35E2,
+ 0x5E00, 0x38A1, 0x5E02, 0x08A2, 0x5E03, 0x0DCD, 0x5E06, 0x0D55,
+ 0x5E0B, 0x1270, 0x5E0C, 0x0631, 0x5E11, 0x1273, 0x5E12, 0x38A2,
+ 0x5E14, 0x38A3, 0x5E15, 0x38A4, 0x5E16, 0x0BBD, 0x5E18, 0x38A5,
+ 0x5E19, 0x1272, 0x5E1A, 0x1271, 0x5E1B, 0x1274, 0x5E1D, 0x0C07,
+ 0x5E1F, 0x44B7, 0x5E25, 0x0A29, 0x5E28, 0x4B8C, 0x5E2B, 0x08A3,
+ 0x5E2D, 0x0A6E, 0x5E2E, 0x38A6, 0x5E2F, 0x0B33, 0x5E30, 0x063C,
+ 0x5E32, 0x4B8D, 0x5E33, 0x0BBE, 0x5E35, 0x4B8E, 0x5E36, 0x1275,
+ 0x5E37, 0x1276, 0x5E38, 0x09D7, 0x5E3D, 0x0E67, 0x5E3E, 0x44B8,
+ 0x5E40, 0x1279, 0x5E43, 0x1278, 0x5E44, 0x1277, 0x5E45, 0x0DEF,
+ 0x5E47, 0x1280, 0x5E49, 0x44B9, 0x5E4C, 0x0E88, 0x5E4E, 0x127A,
+ 0x5E54, 0x127C, 0x5E55, 0x0E99, 0x5E56, 0x44BB, 0x5E57, 0x127B,
+ 0x5E58, 0x38A7, 0x5E5B, 0x4B8F, 0x5E5E, 0x41D4, 0x5E5F, 0x127D,
+ 0x5E61, 0x0D3C, 0x5E62, 0x127E, 0x5E63, 0x0E0E, 0x5E64, 0x127F,
+ 0x5E68, 0x4B90, 0x5E6A, 0x4B91, 0x5E6B, 0x38A8, 0x5E6C, 0x38A9,
+ 0x5E6D, 0x44BD, 0x5E6E, 0x44BE, 0x5E72, 0x05EF, 0x5E73, 0x0E0F,
+ 0x5E74, 0x0CE5, 0x5E75, 0x1281, 0x5E76, 0x1282, 0x5E77, 0x4B92,
+ 0x5E78, 0x07BE, 0x5E79, 0x05F0, 0x5E7A, 0x1283, 0x5E7B, 0x076C,
+ 0x5E7C, 0x0F2E, 0x5E7D, 0x0F13, 0x5E7E, 0x0632, 0x5E7F, 0x1285,
+ 0x5E80, 0x4B93, 0x5E81, 0x0BBF, 0x5E83, 0x07BF, 0x5E84, 0x0999,
+ 0x5E87, 0x0D73, 0x5E8A, 0x099A, 0x5E8B, 0x4B94, 0x5E8F, 0x0982,
+ 0x5E95, 0x0C08, 0x5E96, 0x0E49, 0x5E97, 0x0C33, 0x5E99, 0x36B0,
+ 0x5E9A, 0x07C0, 0x5E9C, 0x0DCE, 0x5EA0, 0x1286, 0x5EA5, 0x44C0,
+ 0x5EA6, 0x0C53, 0x5EA7, 0x0832, 0x5EA8, 0x38AA, 0x5EAA, 0x38AB,
+ 0x5EAB, 0x077F, 0x5EAC, 0x44C1, 0x5EAD, 0x0C09, 0x5EB3, 0x4B95,
+ 0x5EB5, 0x0487, 0x5EB6, 0x0978, 0x5EB7, 0x07C1, 0x5EB8, 0x0F31,
+ 0x5EB9, 0x44C2, 0x5EBD, 0x4B96, 0x5EBE, 0x38AC, 0x5EBF, 0x38AD,
+ 0x5EC1, 0x1287, 0x5EC2, 0x1288, 0x5EC3, 0x0D07, 0x5EC6, 0x44C3,
+ 0x5EC8, 0x1289, 0x5EC9, 0x0FBF, 0x5ECA, 0x0FD3, 0x5ECB, 0x3C1E,
+ 0x5ECF, 0x128B, 0x5ED0, 0x128A, 0x5ED1, 0x4B97, 0x5ED2, 0x38AF,
+ 0x5ED3, 0x05A5, 0x5ED4, 0x4B98, 0x5ED5, 0x4B99, 0x5ED6, 0x128C,
+ 0x5ED9, 0x44C4, 0x5EDA, 0x128F, 0x5EDB, 0x1290, 0x5EDD, 0x128E,
+ 0x5EDF, 0x0DB2, 0x5EE0, 0x099B, 0x5EE1, 0x1292, 0x5EE2, 0x1291,
+ 0x5EE3, 0x128D, 0x5EE8, 0x1293, 0x5EE9, 0x1294, 0x5EEC, 0x1295,
+ 0x5EF0, 0x1298, 0x5EF1, 0x1296, 0x5EF3, 0x1297, 0x5EF4, 0x1299,
+ 0x5EF6, 0x0506, 0x5EF7, 0x0C0A, 0x5EF8, 0x129A, 0x5EF9, 0x41D5,
+ 0x5EFA, 0x0750, 0x5EFB, 0x0576, 0x5EFC, 0x0CEC, 0x5EFD, 0x44C6,
+ 0x5EFE, 0x129B, 0x5EFF, 0x0CD3, 0x5F00, 0x41D6, 0x5F01, 0x0E2B,
+ 0x5F02, 0x41D7, 0x5F03, 0x129C, 0x5F04, 0x0FD4, 0x5F07, 0x38B0,
+ 0x5F08, 0x44C7, 0x5F09, 0x129D, 0x5F0A, 0x0E10, 0x5F0B, 0x12A0,
+ 0x5F0C, 0x0FFA, 0x5F0D, 0x100A, 0x5F0E, 0x38B1, 0x5F0F, 0x08DC,
+ 0x5F10, 0x0CCD, 0x5F11, 0x12A1, 0x5F13, 0x0677, 0x5F14, 0x0BC0,
+ 0x5F15, 0x04BE, 0x5F16, 0x12A2, 0x5F17, 0x0DF6, 0x5F18, 0x07C2,
+ 0x5F1B, 0x0B8E, 0x5F1C, 0x38B2, 0x5F1D, 0x38B3, 0x5F1E, 0x44C9,
+ 0x5F1F, 0x0C0B, 0x5F21, 0x2101, 0x5F22, 0x38B4, 0x5F23, 0x41D8,
+ 0x5F25, 0x0EFB, 0x5F26, 0x076D, 0x5F27, 0x0780, 0x5F28, 0x38B5,
+ 0x5F29, 0x12A3, 0x5F2D, 0x12A4, 0x5F2F, 0x12AA, 0x5F31, 0x0911,
+ 0x5F34, 0x2102, 0x5F35, 0x0BC1, 0x5F36, 0x38B6, 0x5F37, 0x06A7,
+ 0x5F38, 0x12A5, 0x5F3A, 0x3598, 0x5F3B, 0x38B7, 0x5F3C, 0x0D9D,
+ 0x5F3D, 0x41D9, 0x5F3E, 0x0B84, 0x5F40, 0x38B8, 0x5F41, 0x12A6,
+ 0x5F45, 0x20B2, 0x5F47, 0x44CA, 0x5F48, 0x12A7, 0x5F4A, 0x06A8,
+ 0x5F4C, 0x12A8, 0x5F4D, 0x4B9A, 0x5F4E, 0x12A9, 0x5F50, 0x38B9,
+ 0x5F51, 0x12AB, 0x5F53, 0x0C70, 0x5F54, 0x41DA, 0x5F56, 0x12AC,
+ 0x5F57, 0x12AD, 0x5F58, 0x38BA, 0x5F59, 0x12AE, 0x5F5C, 0x129F,
+ 0x5F5D, 0x129E, 0x5F61, 0x12AF, 0x5F62, 0x0717, 0x5F63, 0x44CB,
+ 0x5F64, 0x38BB, 0x5F65, 0x36AC, 0x5F66, 0x0D99, 0x5F67, 0x2103,
+ 0x5F69, 0x083C, 0x5F6A, 0x0DA9, 0x5F6B, 0x0BC2, 0x5F6C, 0x0DBD,
+ 0x5F6D, 0x12B0, 0x5F70, 0x099C, 0x5F71, 0x04E8, 0x5F72, 0x44CC,
+ 0x5F73, 0x12B1, 0x5F77, 0x12B2, 0x5F79, 0x0EFE, 0x5F7C, 0x0D74,
+ 0x5F7D, 0x41DB, 0x5F7E, 0x44CD, 0x5F7F, 0x12B5, 0x5F80, 0x051F,
+ 0x5F81, 0x0A50, 0x5F82, 0x12B4, 0x5F83, 0x12B3, 0x5F84, 0x0718,
+ 0x5F85, 0x0B34, 0x5F87, 0x12B9, 0x5F88, 0x12B7, 0x5F89, 0x38BC,
+ 0x5F8A, 0x12B6, 0x5F8B, 0x0F6F, 0x5F8C, 0x0799, 0x5F8F, 0x44CE,
+ 0x5F90, 0x0983, 0x5F91, 0x12B8, 0x5F92, 0x0C46, 0x5F93, 0x0948,
+ 0x5F97, 0x0C98, 0x5F98, 0x12BC, 0x5F99, 0x12BB, 0x5F9C, 0x38BD,
+ 0x5F9E, 0x12BA, 0x5FA0, 0x12BD, 0x5FA1, 0x079A, 0x5FA2, 0x44CF,
+ 0x5FA4, 0x38BF, 0x5FA7, 0x38BE, 0x5FA8, 0x12BE, 0x5FA9, 0x0DEE,
+ 0x5FAA, 0x0965, 0x5FAC, 0x4B9B, 0x5FAD, 0x12BF, 0x5FAE, 0x0D8D,
+ 0x5FAF, 0x38C0, 0x5FB3, 0x0C99, 0x5FB4, 0x0BC3, 0x5FB5, 0x3438,
+ 0x5FB7, 0x2104, 0x5FB8, 0x38C1, 0x5FB9, 0x0C2A, 0x5FBC, 0x12C0,
+ 0x5FBD, 0x0645, 0x5FC3, 0x09FA, 0x5FC4, 0x38C2, 0x5FC5, 0x0D9E,
+ 0x5FC7, 0x44D0, 0x5FC9, 0x38C3, 0x5FCB, 0x44D1, 0x5FCC, 0x0633,
+ 0x5FCD, 0x0CDC, 0x5FD2, 0x44D2, 0x5FD3, 0x44D3, 0x5FD4, 0x44D4,
+ 0x5FD6, 0x12C1, 0x5FD7, 0x08A4, 0x5FD8, 0x0E68, 0x5FD9, 0x0E69,
+ 0x5FDC, 0x0520, 0x5FDD, 0x12C6, 0x5FDE, 0x2105, 0x5FE0, 0x0BA7,
+ 0x5FE1, 0x38C4, 0x5FE2, 0x44D5, 0x5FE4, 0x12C3, 0x5FE9, 0x38C5,
+ 0x5FEA, 0x4B9C, 0x5FEB, 0x0577, 0x5FED, 0x38C6, 0x5FEE, 0x44D6,
+ 0x5FEF, 0x44D7, 0x5FF0, 0x12F6, 0x5FF1, 0x12C5, 0x5FF3, 0x44D8,
+ 0x5FF5, 0x0CE6, 0x5FF8, 0x12C4, 0x5FFB, 0x12C2, 0x5FFC, 0x38C7,
+ 0x5FFD, 0x080C, 0x5FFF, 0x12C8, 0x6007, 0x4B9D, 0x600D, 0x41DC,
+ 0x600E, 0x12CE, 0x600F, 0x12D4, 0x6010, 0x12CC, 0x6012, 0x0C56,
+ 0x6014, 0x41DD, 0x6015, 0x12D1, 0x6016, 0x0DCF, 0x6017, 0x38C8,
+ 0x6018, 0x41DE, 0x6019, 0x12CB, 0x601A, 0x38C9, 0x601B, 0x12D0,
+ 0x601C, 0x0FAF, 0x601D, 0x08A5, 0x6020, 0x0B35, 0x6021, 0x12C9,
+ 0x6022, 0x44DA, 0x6024, 0x44DB, 0x6025, 0x0678, 0x6026, 0x12D3,
+ 0x6027, 0x0A51, 0x6028, 0x0507, 0x6029, 0x12CD, 0x602A, 0x0578,
+ 0x602B, 0x12D2, 0x602F, 0x06A9, 0x6031, 0x12CF, 0x6033, 0x38CA,
+ 0x6035, 0x41DF, 0x603A, 0x12D5, 0x6041, 0x12D7, 0x6042, 0x12E1,
+ 0x6043, 0x12DF, 0x6046, 0x12DC, 0x6047, 0x41E0, 0x6049, 0x4B9E,
+ 0x604A, 0x12DB, 0x604B, 0x0FC0, 0x604C, 0x44DD, 0x604D, 0x12DD,
+ 0x6050, 0x06AA, 0x6052, 0x07C3, 0x6054, 0x4B9F, 0x6055, 0x0984,
+ 0x6059, 0x12E4, 0x605A, 0x12D6, 0x605D, 0x2106, 0x605F, 0x12DA,
+ 0x6060, 0x12CA, 0x6061, 0x38CB, 0x6062, 0x057A, 0x6063, 0x12DE,
+ 0x6064, 0x12E0, 0x6065, 0x0B8F, 0x6067, 0x4BA0, 0x6068, 0x0818,
+ 0x6069, 0x0538, 0x606A, 0x12D8, 0x606B, 0x12E3, 0x606C, 0x12E2,
+ 0x606D, 0x06AB, 0x606F, 0x0B09, 0x6070, 0x05C4, 0x6075, 0x0719,
+ 0x6077, 0x12D9, 0x607F, 0x38CC, 0x6081, 0x12E5, 0x6083, 0x12E8,
+ 0x6084, 0x12EA, 0x6085, 0x2107, 0x6089, 0x08E9, 0x608A, 0x2108,
+ 0x608B, 0x12F0, 0x608C, 0x0C0C, 0x608D, 0x12E6, 0x6092, 0x12EE,
+ 0x6094, 0x0579, 0x6095, 0x44DE, 0x6096, 0x12EC, 0x6097, 0x12ED,
+ 0x609A, 0x12E9, 0x609B, 0x12EB, 0x609D, 0x41E1, 0x609E, 0x38CD,
+ 0x609F, 0x079B, 0x60A0, 0x0F14, 0x60A3, 0x05F1, 0x60A4, 0x38CE,
+ 0x60A6, 0x04FB, 0x60A7, 0x12EF, 0x60A8, 0x44DF, 0x60A9, 0x0CF0,
+ 0x60AA, 0x0471, 0x60B0, 0x38CF, 0x60B1, 0x44E1, 0x60B2, 0x0D75,
+ 0x60B3, 0x12C7, 0x60B4, 0x12F5, 0x60B5, 0x12F9, 0x60B6, 0x0EF1,
+ 0x60B8, 0x12F2, 0x60BB, 0x4BA1, 0x60BC, 0x0C63, 0x60BD, 0x12F7,
+ 0x60BE, 0x44E2, 0x60C4, 0x4BA2, 0x60C5, 0x09D8, 0x60C6, 0x12F8,
+ 0x60C7, 0x0CAF, 0x60C8, 0x44E3, 0x60CB, 0x38D0, 0x60D1, 0x0FED,
+ 0x60D3, 0x12F4, 0x60D4, 0x41E2, 0x60D5, 0x210A, 0x60D8, 0x12FA,
+ 0x60D9, 0x44E4, 0x60DA, 0x080D, 0x60DB, 0x38D1, 0x60DC, 0x0A6F,
+ 0x60DD, 0x41E3, 0x60DE, 0x2109, 0x60DF, 0x0498, 0x60E0, 0x12F3,
+ 0x60E1, 0x12F1, 0x60E3, 0x0ADC, 0x60E7, 0x12E7, 0x60E8, 0x0882,
+ 0x60EE, 0x44E5, 0x60F0, 0x0B26, 0x60F1, 0x1306, 0x60F2, 0x210C,
+ 0x60F3, 0x0ADD, 0x60F4, 0x1301, 0x60F5, 0x44E6, 0x60F6, 0x12FE,
+ 0x60F7, 0x12FF, 0x60F8, 0x38D2, 0x60F9, 0x0912, 0x60FA, 0x1302,
+ 0x60FB, 0x1305, 0x60FD, 0x4BA3, 0x6100, 0x1300, 0x6101, 0x092F,
+ 0x6103, 0x1303, 0x6106, 0x12FD, 0x6108, 0x0F08, 0x6109, 0x0F07,
+ 0x610A, 0x4BA4, 0x610D, 0x1307, 0x610E, 0x1308, 0x610F, 0x0499,
+ 0x6110, 0x44E7, 0x6111, 0x210D, 0x6112, 0x38D3, 0x6113, 0x38D4,
+ 0x6114, 0x38D5, 0x6115, 0x12FC, 0x6116, 0x4BA5, 0x6119, 0x44E8,
+ 0x611A, 0x06EA, 0x611B, 0x046A, 0x611C, 0x38D6, 0x611E, 0x44E9,
+ 0x611F, 0x05F2, 0x6120, 0x210B, 0x6121, 0x1304, 0x6127, 0x130C,
+ 0x6128, 0x130B, 0x612A, 0x4BA6, 0x612B, 0x41E4, 0x612C, 0x1310,
+ 0x6130, 0x210F, 0x6134, 0x1311, 0x6136, 0x4BA7, 0x6137, 0x210E,
+ 0x613A, 0x44EA, 0x613C, 0x130F, 0x613D, 0x1312, 0x613E, 0x130A,
+ 0x613F, 0x130E, 0x6141, 0x44EC, 0x6142, 0x1313, 0x6144, 0x1314,
+ 0x6146, 0x44ED, 0x6147, 0x1309, 0x6148, 0x08CA, 0x614A, 0x130D,
+ 0x614B, 0x0B36, 0x614C, 0x07C4, 0x614D, 0x12FB, 0x614E, 0x09FB,
+ 0x6153, 0x1321, 0x6155, 0x0E39, 0x6158, 0x1317, 0x6159, 0x1318,
+ 0x615A, 0x1319, 0x615D, 0x1320, 0x615E, 0x4BA8, 0x615F, 0x131F,
+ 0x6160, 0x44EE, 0x6162, 0x0EAB, 0x6163, 0x05F3, 0x6164, 0x4BA9,
+ 0x6165, 0x131D, 0x6167, 0x071B, 0x6168, 0x0592, 0x616B, 0x131A,
+ 0x616E, 0x0F80, 0x616F, 0x131C, 0x6170, 0x049A, 0x6171, 0x131E,
+ 0x6173, 0x1315, 0x6174, 0x131B, 0x6175, 0x1322, 0x6176, 0x071A,
+ 0x6177, 0x1316, 0x617B, 0x4BAA, 0x617C, 0x38D7, 0x617D, 0x4BAB,
+ 0x617E, 0x0F47, 0x617F, 0x4BAC, 0x6182, 0x0F15, 0x6187, 0x1325,
+ 0x618A, 0x1329, 0x618D, 0x38D8, 0x618E, 0x0B00, 0x6190, 0x0FC1,
+ 0x6191, 0x132A, 0x6192, 0x44F0, 0x6193, 0x44F1, 0x6194, 0x1327,
+ 0x6196, 0x1324, 0x6197, 0x44F2, 0x6198, 0x2110, 0x6199, 0x1323,
+ 0x619A, 0x1328, 0x619D, 0x4BAD, 0x619F, 0x38D9, 0x61A4, 0x0E00,
+ 0x61A5, 0x44F3, 0x61A7, 0x0C8C, 0x61A8, 0x38DA, 0x61A9, 0x071C,
+ 0x61AB, 0x132B, 0x61AC, 0x1326, 0x61AD, 0x44F4, 0x61AE, 0x132C,
+ 0x61B2, 0x0751, 0x61B6, 0x0531, 0x61B8, 0x4BAE, 0x61B9, 0x41E6,
+ 0x61BA, 0x1334, 0x61BC, 0x41E5, 0x61BE, 0x05F4, 0x61C2, 0x38DB,
+ 0x61C3, 0x1332, 0x61C6, 0x1333, 0x61C7, 0x0819, 0x61C8, 0x1331,
+ 0x61C9, 0x132F, 0x61CA, 0x132E, 0x61CB, 0x1335, 0x61CC, 0x132D,
+ 0x61CD, 0x1337, 0x61D0, 0x057B, 0x61D5, 0x44F6, 0x61DC, 0x4BAF,
+ 0x61DD, 0x44F7, 0x61DF, 0x38DC, 0x61E2, 0x4BB0, 0x61E3, 0x1339,
+ 0x61E5, 0x4BB1, 0x61E6, 0x1338, 0x61E8, 0x4BB2, 0x61F2, 0x0BC4,
+ 0x61F4, 0x133C, 0x61F5, 0x44F8, 0x61F6, 0x133A, 0x61F7, 0x1330,
+ 0x61F8, 0x0752, 0x61FA, 0x133B, 0x61FC, 0x133F, 0x61FD, 0x133E,
+ 0x61FE, 0x1340, 0x61FF, 0x133D, 0x6200, 0x1341, 0x6204, 0x4BB3,
+ 0x6207, 0x4BB4, 0x6208, 0x1342, 0x6209, 0x1343, 0x620A, 0x0E3A,
+ 0x620C, 0x1345, 0x620D, 0x1344, 0x620E, 0x0949, 0x6210, 0x0A52,
+ 0x6211, 0x0566, 0x6212, 0x057C, 0x6213, 0x2111, 0x6214, 0x1346,
+ 0x6215, 0x38DD, 0x6216, 0x0483, 0x621A, 0x0A70, 0x621B, 0x1347,
+ 0x621D, 0x1A64, 0x621E, 0x1348, 0x621F, 0x0737, 0x6221, 0x1349,
+ 0x6222, 0x41E7, 0x6223, 0x44FA, 0x6226, 0x0A93, 0x6229, 0x38DE,
+ 0x622A, 0x134A, 0x622E, 0x134B, 0x622F, 0x0654, 0x6230, 0x134C,
+ 0x6231, 0x4BB5, 0x6232, 0x134D, 0x6233, 0x134E, 0x6234, 0x0B37,
+ 0x6236, 0x35BD, 0x6238, 0x0781, 0x6239, 0x4BB6, 0x623B, 0x0EED,
+ 0x623D, 0x4BB7, 0x623E, 0x344E, 0x623F, 0x0E6A, 0x6240, 0x0974,
+ 0x6241, 0x134F, 0x6243, 0x38DF, 0x6246, 0x38E0, 0x6247, 0x0A94,
+ 0x6248, 0x1B1A, 0x6249, 0x0D76, 0x624B, 0x0916, 0x624C, 0x38E1,
+ 0x624D, 0x083D, 0x624E, 0x1350, 0x6251, 0x38E2, 0x6252, 0x44FB,
+ 0x6253, 0x0B27, 0x6255, 0x0DF7, 0x6256, 0x38E3, 0x6258, 0x0B51,
+ 0x625A, 0x41E8, 0x625B, 0x1353, 0x625E, 0x1351, 0x6260, 0x1354,
+ 0x6261, 0x44FC, 0x6263, 0x1352, 0x6264, 0x44FD, 0x6268, 0x1355,
+ 0x626D, 0x44FF, 0x626E, 0x0E01, 0x626F, 0x41E9, 0x6271, 0x047B,
+ 0x6273, 0x4500, 0x6276, 0x0DD0, 0x6279, 0x0D77, 0x627A, 0x4BB8,
+ 0x627B, 0x44FE, 0x627C, 0x1356, 0x627E, 0x1359, 0x627F, 0x099D,
+ 0x6280, 0x0655, 0x6282, 0x1357, 0x6283, 0x135E, 0x6284, 0x099E,
+ 0x6285, 0x35C5, 0x6289, 0x1358, 0x628A, 0x0CFA, 0x6290, 0x4BB9,
+ 0x6291, 0x0F48, 0x6292, 0x135A, 0x6293, 0x135B, 0x6294, 0x135F,
+ 0x6295, 0x0C64, 0x6296, 0x135C, 0x6297, 0x07C5, 0x6298, 0x0A82,
+ 0x6299, 0x4501, 0x629B, 0x136D, 0x629C, 0x0D48, 0x629E, 0x0B52,
+ 0x62A6, 0x2112, 0x62A8, 0x4BBA, 0x62AB, 0x0D78, 0x62AC, 0x13B2,
+ 0x62B1, 0x0E4A, 0x62B5, 0x0C0D, 0x62B9, 0x0EA3, 0x62BB, 0x1362,
+ 0x62BC, 0x0521, 0x62BD, 0x0BA8, 0x62C2, 0x136B, 0x62C4, 0x38E4,
+ 0x62C5, 0x0B72, 0x62C6, 0x1365, 0x62C7, 0x136C, 0x62C8, 0x1367,
+ 0x62C9, 0x136E, 0x62CA, 0x136A, 0x62CC, 0x1369, 0x62CD, 0x0D25,
+ 0x62CF, 0x1363, 0x62D0, 0x057D, 0x62D1, 0x1361, 0x62D2, 0x068B,
+ 0x62D3, 0x0B53, 0x62D4, 0x135D, 0x62D5, 0x4502, 0x62D6, 0x41EA,
+ 0x62D7, 0x1360, 0x62D8, 0x07C6, 0x62D9, 0x0A7F, 0x62DA, 0x4BBB,
+ 0x62DB, 0x099F, 0x62DC, 0x1368, 0x62DD, 0x0D08, 0x62E0, 0x068C,
+ 0x62E1, 0x05A6, 0x62EC, 0x05C5, 0x62ED, 0x09E7, 0x62EE, 0x1370,
+ 0x62EF, 0x1375, 0x62F1, 0x1371, 0x62F3, 0x0753, 0x62F4, 0x4BBC,
+ 0x62F5, 0x1376, 0x62F6, 0x0870, 0x62F7, 0x07FB, 0x62FC, 0x38E5,
+ 0x62FD, 0x4504, 0x62FE, 0x0930, 0x62FF, 0x1364, 0x6301, 0x08CB,
+ 0x6302, 0x1373, 0x6303, 0x4505, 0x6307, 0x08A6, 0x6308, 0x1374,
+ 0x6309, 0x0488, 0x630A, 0x38E6, 0x630C, 0x136F, 0x630D, 0x38E7,
+ 0x6310, 0x4506, 0x6311, 0x0BC5, 0x6316, 0x4BBD, 0x6318, 0x38E8,
+ 0x6319, 0x068D, 0x631B, 0x3737, 0x631F, 0x06AC, 0x6327, 0x1372,
+ 0x6328, 0x046B, 0x632A, 0x4BBE, 0x632B, 0x0833, 0x632F, 0x09FC,
+ 0x6332, 0x4509, 0x6335, 0x450A, 0x6336, 0x4BBF, 0x6339, 0x38E9,
+ 0x633A, 0x0C0E, 0x633B, 0x450B, 0x633C, 0x450C, 0x633D, 0x0D68,
+ 0x633E, 0x1378, 0x633F, 0x0AE0, 0x6341, 0x450D, 0x6342, 0x38EA,
+ 0x6343, 0x38EB, 0x6344, 0x450E, 0x6346, 0x4BC0, 0x6349, 0x0B0A,
+ 0x634B, 0x4BC1, 0x634C, 0x0879, 0x634D, 0x1379, 0x634E, 0x450F,
+ 0x634F, 0x137B, 0x6350, 0x1377, 0x6353, 0x4BC2, 0x6355, 0x0E31,
+ 0x6357, 0x0BD9, 0x6359, 0x4511, 0x635C, 0x0ADE, 0x6365, 0x38EC,
+ 0x6367, 0x0E4B, 0x6368, 0x08FA, 0x6369, 0x1387, 0x636B, 0x1386,
+ 0x636C, 0x4514, 0x636E, 0x0A3E, 0x6371, 0x4BC3, 0x6372, 0x0754,
+ 0x6374, 0x38ED, 0x6375, 0x4BC4, 0x6376, 0x1380, 0x6377, 0x09A1,
+ 0x637A, 0x0CC0, 0x637B, 0x0CE7, 0x637C, 0x41EB, 0x637D, 0x38EE,
+ 0x637F, 0x4BC5, 0x6380, 0x137E, 0x6382, 0x4BC6, 0x6383, 0x0ADF,
+ 0x6384, 0x38EF, 0x6387, 0x38F0, 0x6388, 0x0924, 0x6389, 0x1383,
+ 0x638A, 0x4BC7, 0x638C, 0x09A0, 0x638E, 0x137D, 0x638F, 0x1382,
+ 0x6390, 0x38F1, 0x6392, 0x0D09, 0x6394, 0x4517, 0x6396, 0x137C,
+ 0x6398, 0x06F7, 0x6399, 0x4515, 0x639B, 0x05BB, 0x639E, 0x38F2,
+ 0x639F, 0x1384, 0x63A0, 0x0F73, 0x63A1, 0x083E, 0x63A2, 0x0B73,
+ 0x63A3, 0x1381, 0x63A5, 0x0A80, 0x63A7, 0x07C7, 0x63A8, 0x0A2A,
+ 0x63A9, 0x0508, 0x63AA, 0x0ABE, 0x63AB, 0x137F, 0x63AC, 0x065F,
+ 0x63AE, 0x4BC8, 0x63AF, 0x4BC9, 0x63B2, 0x071D, 0x63B4, 0x0BEB,
+ 0x63B5, 0x1385, 0x63BB, 0x0AE1, 0x63BD, 0x4518, 0x63BE, 0x1388,
+ 0x63C0, 0x138A, 0x63C3, 0x0B17, 0x63C4, 0x1390, 0x63C6, 0x138B,
+ 0x63C9, 0x138D, 0x63CF, 0x0DB3, 0x63D0, 0x0C0F, 0x63D1, 0x38F3,
+ 0x63D2, 0x138E, 0x63D4, 0x4519, 0x63D5, 0x451A, 0x63D6, 0x0F16,
+ 0x63DA, 0x0F32, 0x63DB, 0x05F5, 0x63DC, 0x38F4, 0x63E0, 0x451B,
+ 0x63E1, 0x0472, 0x63E3, 0x138C, 0x63E5, 0x41EC, 0x63E9, 0x1389,
+ 0x63EA, 0x4BCA, 0x63EB, 0x451C, 0x63EC, 0x451D, 0x63ED, 0x341C,
+ 0x63EE, 0x0634, 0x63F2, 0x451E, 0x63F4, 0x0509, 0x63F5, 0x2113,
+ 0x63F6, 0x138F, 0x63F7, 0x3644, 0x63F8, 0x4BCB, 0x63F9, 0x4BCC,
+ 0x63FA, 0x0F33, 0x6406, 0x1393, 0x6409, 0x38F5, 0x640D, 0x0B1B,
+ 0x640F, 0x139A, 0x6410, 0x38F6, 0x6412, 0x4BCD, 0x6413, 0x1394,
+ 0x6414, 0x1E2C, 0x6416, 0x1391, 0x6417, 0x1398, 0x6418, 0x4BCE,
+ 0x641C, 0x137A, 0x641E, 0x451F, 0x6420, 0x4BCF, 0x6422, 0x38F7,
+ 0x6424, 0x4BD0, 0x6425, 0x4520, 0x6426, 0x1395, 0x6428, 0x1399,
+ 0x6429, 0x4521, 0x642A, 0x4BD1, 0x642C, 0x0D56, 0x642D, 0x0C65,
+ 0x642F, 0x4522, 0x6434, 0x1392, 0x6435, 0x4BD2, 0x6436, 0x1396,
+ 0x643A, 0x071E, 0x643D, 0x4BD3, 0x643E, 0x0861, 0x643F, 0x4BD4,
+ 0x6442, 0x0A81, 0x644E, 0x139E, 0x6451, 0x1E43, 0x6452, 0x4BD5,
+ 0x6454, 0x38F8, 0x6458, 0x0C20, 0x645A, 0x4523, 0x645B, 0x38F9,
+ 0x645D, 0x4524, 0x645F, 0x4BD6, 0x6460, 0x2114, 0x6467, 0x139B,
+ 0x6469, 0x0E8E, 0x646D, 0x38FA, 0x646F, 0x139C, 0x6473, 0x4525,
+ 0x6474, 0x4BD7, 0x6476, 0x139D, 0x6478, 0x0EDA, 0x6479, 0x41ED,
+ 0x647A, 0x0A46, 0x647B, 0x38FB, 0x647D, 0x4526, 0x6483, 0x0738,
+ 0x6487, 0x4527, 0x6488, 0x13A4, 0x6490, 0x4BD8, 0x6491, 0x4528,
+ 0x6492, 0x0883, 0x6493, 0x13A1, 0x6495, 0x13A0, 0x6498, 0x4BD9,
+ 0x6499, 0x4BDA, 0x649A, 0x0CE8, 0x649D, 0x2115, 0x649E, 0x0C8D,
+ 0x649F, 0x4529, 0x64A4, 0x0C2B, 0x64A5, 0x13A2, 0x64A9, 0x13A3,
+ 0x64AB, 0x0DE1, 0x64AC, 0x4BDB, 0x64AD, 0x0CFB, 0x64AE, 0x0871,
+ 0x64B0, 0x0A95, 0x64B2, 0x0E7E, 0x64B3, 0x4BDC, 0x64B9, 0x05A7,
+ 0x64BB, 0x13AA, 0x64BC, 0x13A5, 0x64BE, 0x38FC, 0x64BF, 0x38FD,
+ 0x64C1, 0x0F34, 0x64C2, 0x13AC, 0x64C4, 0x41EE, 0x64C5, 0x13A8,
+ 0x64C7, 0x13A9, 0x64CA, 0x341D, 0x64CB, 0x452A, 0x64CC, 0x452B,
+ 0x64CD, 0x0AE2, 0x64CE, 0x2116, 0x64D0, 0x41EF, 0x64D2, 0x13A7,
+ 0x64D4, 0x1366, 0x64D5, 0x452C, 0x64D7, 0x452D, 0x64D8, 0x13AB,
+ 0x64DA, 0x13A6, 0x64E0, 0x13B0, 0x64E1, 0x13B1, 0x64E2, 0x0C21,
+ 0x64E3, 0x13B3, 0x64E4, 0x452F, 0x64E5, 0x38FE, 0x64E6, 0x0872,
+ 0x64E7, 0x13AE, 0x64EC, 0x0656, 0x64ED, 0x4BDD, 0x64EF, 0x13B4,
+ 0x64F0, 0x4BDE, 0x64F1, 0x13AD, 0x64F2, 0x13B8, 0x64F4, 0x13B7,
+ 0x64F6, 0x13B6, 0x64F7, 0x38FF, 0x64FA, 0x13B9, 0x64FB, 0x3900,
+ 0x64FD, 0x13BB, 0x64FE, 0x09D9, 0x64FF, 0x4530, 0x6500, 0x13BA,
+ 0x6504, 0x3901, 0x6505, 0x13BE, 0x650F, 0x4532, 0x6514, 0x4533,
+ 0x6516, 0x3902, 0x6518, 0x13BC, 0x6519, 0x3903, 0x651B, 0x4BDF,
+ 0x651C, 0x13BD, 0x651D, 0x1397, 0x651E, 0x4535, 0x651F, 0x4BE0,
+ 0x6522, 0x1E97, 0x6523, 0x13C0, 0x6524, 0x13BF, 0x6529, 0x41F0,
+ 0x652A, 0x139F, 0x652B, 0x13C1, 0x652C, 0x13B5, 0x652E, 0x4BE1,
+ 0x652F, 0x08A7, 0x6532, 0x4536, 0x6534, 0x13C2, 0x6535, 0x13C3,
+ 0x6536, 0x13C5, 0x6537, 0x13C4, 0x6538, 0x13C6, 0x6539, 0x057E,
+ 0x653B, 0x07C8, 0x653E, 0x0E4C, 0x653F, 0x0A53, 0x6544, 0x4537,
+ 0x6545, 0x0782, 0x6547, 0x3904, 0x6548, 0x13C8, 0x6549, 0x4BE2,
+ 0x654D, 0x13CB, 0x654E, 0x2117, 0x654F, 0x0DC4, 0x6551, 0x0679,
+ 0x6554, 0x4538, 0x6555, 0x13CA, 0x6556, 0x13C9, 0x6557, 0x0D0A,
+ 0x6558, 0x13CC, 0x6559, 0x06AD, 0x655D, 0x13CE, 0x655E, 0x13CD,
+ 0x6560, 0x4BE3, 0x6562, 0x05F6, 0x6563, 0x0884, 0x6566, 0x0CB0,
+ 0x6567, 0x3905, 0x656B, 0x4539, 0x656C, 0x071F, 0x6570, 0x0A3A,
+ 0x6572, 0x13CF, 0x6574, 0x0A54, 0x6575, 0x0C22, 0x6577, 0x0DD1,
+ 0x6578, 0x13D0, 0x657A, 0x453A, 0x6581, 0x3906, 0x6582, 0x13D1,
+ 0x6583, 0x13D2, 0x6584, 0x453B, 0x6585, 0x3907, 0x6587, 0x0E08,
+ 0x6588, 0x120C, 0x6589, 0x0A6A, 0x658A, 0x453C, 0x658C, 0x0DBE,
+ 0x658E, 0x0848, 0x6590, 0x0D79, 0x6591, 0x0D57, 0x6592, 0x4BE4,
+ 0x6595, 0x4BE5, 0x6597, 0x0C47, 0x6599, 0x0F89, 0x659B, 0x13D4,
+ 0x659C, 0x08FC, 0x659D, 0x41F1, 0x659F, 0x13D5, 0x65A1, 0x047A,
+ 0x65A4, 0x06CC, 0x65A5, 0x0A71, 0x65A7, 0x0DD2, 0x65AB, 0x13D6,
+ 0x65AC, 0x0890, 0x65AD, 0x0B85, 0x65AF, 0x08A9, 0x65B0, 0x09FD,
+ 0x65B2, 0x453D, 0x65B4, 0x4BE6, 0x65B5, 0x453E, 0x65B7, 0x13D7,
+ 0x65B8, 0x453F, 0x65B9, 0x0E4D, 0x65BC, 0x0519, 0x65BD, 0x08AA,
+ 0x65BE, 0x4BE7, 0x65BF, 0x4540, 0x65C1, 0x13DA, 0x65C2, 0x3908,
+ 0x65C3, 0x13D8, 0x65C4, 0x13DB, 0x65C5, 0x0F81, 0x65C6, 0x13D9,
+ 0x65C8, 0x4BE8, 0x65C9, 0x4541, 0x65CB, 0x0A9F, 0x65CC, 0x13DC,
+ 0x65CE, 0x4BE9, 0x65CF, 0x0B12, 0x65D0, 0x4BEA, 0x65D2, 0x13DD,
+ 0x65D4, 0x4542, 0x65D7, 0x0636, 0x65D9, 0x13DF, 0x65DB, 0x13DE,
+ 0x65DF, 0x4BEB, 0x65E0, 0x13E0, 0x65E1, 0x13E1, 0x65E2, 0x0637,
+ 0x65E3, 0x3585, 0x65E5, 0x0CD4, 0x65E6, 0x0B74, 0x65E7, 0x0686,
+ 0x65E8, 0x08AB, 0x65E9, 0x0AE3, 0x65EC, 0x0966, 0x65ED, 0x0474,
+ 0x65F0, 0x3909, 0x65F1, 0x13E2, 0x65F2, 0x390A, 0x65F9, 0x4544,
+ 0x65FA, 0x0522, 0x65FB, 0x13E6, 0x65FC, 0x4545, 0x6600, 0x2118,
+ 0x6602, 0x07C9, 0x6603, 0x13E5, 0x6604, 0x4546, 0x6606, 0x081B,
+ 0x6607, 0x09A2, 0x6608, 0x4547, 0x6609, 0x211A, 0x660A, 0x13E4,
+ 0x660C, 0x09A3, 0x660E, 0x0ECC, 0x660F, 0x081A, 0x6613, 0x049B,
+ 0x6614, 0x0A72, 0x6615, 0x2119, 0x661C, 0x13EB, 0x661E, 0x4F50,
+ 0x661F, 0x0A55, 0x6620, 0x04E9, 0x6621, 0x4548, 0x6622, 0x41F3,
+ 0x6624, 0x211D, 0x6625, 0x095F, 0x6627, 0x0E94, 0x6628, 0x0862,
+ 0x662A, 0x4549, 0x662B, 0x41F4, 0x662C, 0x390B, 0x662D, 0x09A4,
+ 0x662E, 0x211B, 0x662F, 0x0A4B, 0x6630, 0x41F5, 0x6631, 0x20AE,
+ 0x6633, 0x41F6, 0x6634, 0x13EA, 0x6635, 0x13E8, 0x6636, 0x13E9,
+ 0x663A, 0x41F2, 0x663B, 0x1E00, 0x663C, 0x0BA9, 0x663F, 0x1409,
+ 0x6641, 0x13EF, 0x6642, 0x08CC, 0x6643, 0x07CA, 0x6644, 0x13ED,
+ 0x6645, 0x454A, 0x6648, 0x41F7, 0x6649, 0x13EE, 0x664B, 0x09FE,
+ 0x664C, 0x390C, 0x664E, 0x454C, 0x664F, 0x13EC, 0x6651, 0x454B,
+ 0x6652, 0x087D, 0x6657, 0x211F, 0x6659, 0x2120, 0x665A, 0x3441,
+ 0x665B, 0x390D, 0x665C, 0x390E, 0x665D, 0x13F1, 0x665E, 0x13F0,
+ 0x665F, 0x13F5, 0x6661, 0x390F, 0x6662, 0x13F6, 0x6663, 0x373A,
+ 0x6664, 0x13F2, 0x6665, 0x211E, 0x6666, 0x0580, 0x6667, 0x13F3,
+ 0x6668, 0x13F4, 0x6669, 0x0D69, 0x666A, 0x4551, 0x666B, 0x3910,
+ 0x666C, 0x4552, 0x666D, 0x4553, 0x666E, 0x0DD3, 0x666F, 0x0720,
+ 0x6670, 0x13F7, 0x6673, 0x2122, 0x6674, 0x0A56, 0x6676, 0x09A5,
+ 0x6677, 0x41F9, 0x6678, 0x41FA, 0x667A, 0x0B90, 0x667B, 0x4554,
+ 0x667E, 0x4BEC, 0x6680, 0x4555, 0x6681, 0x06BF, 0x6683, 0x13F8,
+ 0x6684, 0x13FC, 0x6687, 0x054B, 0x6688, 0x13F9, 0x6689, 0x13FB,
+ 0x668B, 0x4BED, 0x668C, 0x4BEE, 0x668D, 0x41FB, 0x668E, 0x13FA,
+ 0x6690, 0x4556, 0x6691, 0x0975, 0x6692, 0x4557, 0x6696, 0x0B86,
+ 0x6697, 0x0489, 0x6698, 0x13FD, 0x6699, 0x2123, 0x669D, 0x13FE,
+ 0x66A0, 0x2124, 0x66A2, 0x0BC6, 0x66A4, 0x3912, 0x66A6, 0x0FB9,
+ 0x66AB, 0x0891, 0x66AD, 0x4559, 0x66AE, 0x0E3B, 0x66B1, 0x455A,
+ 0x66B2, 0x2125, 0x66B3, 0x4BEF, 0x66B4, 0x0E6B, 0x66B5, 0x455B,
+ 0x66B8, 0x1405, 0x66B9, 0x1400, 0x66BB, 0x41FC, 0x66BC, 0x1403,
+ 0x66BE, 0x1402, 0x66BF, 0x2126, 0x66C0, 0x4BF0, 0x66C1, 0x13FF,
+ 0x66C4, 0x1404, 0x66C6, 0x3455, 0x66C7, 0x0CB6, 0x66C8, 0x3913,
+ 0x66C9, 0x1401, 0x66CF, 0x4BF1, 0x66D6, 0x1406, 0x66D9, 0x0976,
+ 0x66DA, 0x1407, 0x66DB, 0x41FD, 0x66DC, 0x0F35, 0x66DD, 0x0D2E,
+ 0x66E0, 0x1408, 0x66E6, 0x140A, 0x66E8, 0x41FE, 0x66E9, 0x140B,
+ 0x66EC, 0x3914, 0x66F0, 0x140C, 0x66F2, 0x06C2, 0x66F3, 0x04EA,
+ 0x66F4, 0x07CB, 0x66F5, 0x140D, 0x66F7, 0x140E, 0x66F8, 0x097B,
+ 0x66F9, 0x0AE4, 0x66FA, 0x2127, 0x66FB, 0x20B1, 0x66FC, 0x10ED,
+ 0x66FD, 0x0AC0, 0x66FE, 0x0ABF, 0x66FF, 0x0B38, 0x6700, 0x0837,
+ 0x6701, 0x455F, 0x6703, 0x104B, 0x6705, 0x3915, 0x6708, 0x0744,
+ 0x6709, 0x0F17, 0x670B, 0x0E4E, 0x670D, 0x0DF0, 0x670E, 0x2128,
+ 0x670F, 0x140F, 0x6712, 0x4560, 0x6713, 0x3916, 0x6714, 0x0863,
+ 0x6715, 0x0BDB, 0x6716, 0x1410, 0x6717, 0x0FD5, 0x6719, 0x4562,
+ 0x671B, 0x0E6C, 0x671D, 0x0BC7, 0x671E, 0x1411, 0x671F, 0x0638,
+ 0x6725, 0x4BF2, 0x6726, 0x1412, 0x6727, 0x1413, 0x6728, 0x0EE6,
+ 0x672A, 0x0EB0, 0x672B, 0x0EA4, 0x672C, 0x0E8A, 0x672D, 0x0873,
+ 0x672E, 0x1415, 0x6731, 0x0917, 0x6733, 0x3917, 0x6734, 0x0E7F,
+ 0x6735, 0x4BF3, 0x6736, 0x1417, 0x6737, 0x141A, 0x6738, 0x1419,
+ 0x673A, 0x0635, 0x673D, 0x067A, 0x673F, 0x1416, 0x6741, 0x1418,
+ 0x6743, 0x35B7, 0x6746, 0x141B, 0x6747, 0x41FF, 0x6748, 0x3918,
+ 0x6749, 0x0A3F, 0x674C, 0x3919, 0x674D, 0x4565, 0x674E, 0x0F65,
+ 0x674F, 0x048D, 0x6750, 0x0850, 0x6751, 0x0B1C, 0x6753, 0x0909,
+ 0x6754, 0x4566, 0x6755, 0x4BF4, 0x6756, 0x09DB, 0x6759, 0x141E,
+ 0x675C, 0x0C48, 0x675D, 0x4567, 0x675E, 0x141C, 0x675F, 0x0B0B,
+ 0x6760, 0x141D, 0x6761, 0x09DA, 0x6762, 0x0EE9, 0x6763, 0x141F,
+ 0x6764, 0x1420, 0x6765, 0x0F52, 0x6766, 0x212A, 0x676A, 0x1425,
+ 0x676D, 0x07CC, 0x676E, 0x3571, 0x676F, 0x0D0B, 0x6770, 0x1422,
+ 0x6771, 0x0C66, 0x6772, 0x13E3, 0x6773, 0x13E7, 0x6774, 0x456B,
+ 0x6775, 0x0669, 0x6776, 0x391A, 0x6777, 0x0CFD, 0x677B, 0x391B,
+ 0x677C, 0x1424, 0x677E, 0x09A6, 0x677F, 0x0D58, 0x6780, 0x4BF5,
+ 0x6781, 0x4200, 0x6785, 0x142A, 0x6787, 0x0D8E, 0x6789, 0x1421,
+ 0x678B, 0x1427, 0x678C, 0x1426, 0x678F, 0x4BF6, 0x6790, 0x0A73,
+ 0x6791, 0x4BF7, 0x6792, 0x456D, 0x6793, 0x4201, 0x6795, 0x0E9B,
+ 0x6797, 0x0F9B, 0x6798, 0x4202, 0x679A, 0x0E95, 0x679B, 0x4203,
+ 0x679C, 0x054C, 0x679D, 0x08AC, 0x67A0, 0x0FEE, 0x67A1, 0x1429,
+ 0x67A2, 0x0A3B, 0x67A4, 0x4BF8, 0x67A6, 0x1428, 0x67A9, 0x1423,
+ 0x67AF, 0x0783, 0x67B0, 0x391C, 0x67B1, 0x4BF9, 0x67B2, 0x391D,
+ 0x67B3, 0x142F, 0x67B4, 0x142D, 0x67B5, 0x4BFA, 0x67B6, 0x054D,
+ 0x67B7, 0x142B, 0x67B8, 0x1431, 0x67B9, 0x1437, 0x67BB, 0x212B,
+ 0x67BE, 0x4BFB, 0x67C0, 0x212D, 0x67C1, 0x0B28, 0x67C3, 0x4571,
+ 0x67C4, 0x0E11, 0x67C6, 0x1439, 0x67C8, 0x4572, 0x67CA, 0x0D94,
+ 0x67CE, 0x1438, 0x67CF, 0x0D26, 0x67D0, 0x0E6D, 0x67D1, 0x05F7,
+ 0x67D2, 0x4573, 0x67D3, 0x0A9B, 0x67D4, 0x094A, 0x67D7, 0x391F,
+ 0x67D8, 0x0BEF, 0x67D9, 0x3920, 0x67DA, 0x0F18, 0x67DB, 0x4574,
+ 0x67DD, 0x1434, 0x67DE, 0x1433, 0x67E2, 0x1435, 0x67E4, 0x1432,
+ 0x67E7, 0x143A, 0x67E9, 0x1430, 0x67EC, 0x142E, 0x67EE, 0x1436,
+ 0x67EF, 0x142C, 0x67F0, 0x3921, 0x67F1, 0x0BAA, 0x67F3, 0x0F04,
+ 0x67F4, 0x08F2, 0x67F5, 0x0864, 0x67F7, 0x4575, 0x67F9, 0x391E,
+ 0x67FA, 0x1E9A, 0x67FB, 0x082A, 0x67FC, 0x4204, 0x67FE, 0x0E9D,
+ 0x67FF, 0x059F, 0x6801, 0x36F2, 0x6802, 0x0BEA, 0x6803, 0x0CA2,
+ 0x6804, 0x04EB, 0x6805, 0x1E07, 0x6810, 0x4570, 0x6813, 0x0A96,
+ 0x6816, 0x0A58, 0x6817, 0x0700, 0x6818, 0x4579, 0x681D, 0x4205,
+ 0x681E, 0x143C, 0x681F, 0x457A, 0x6821, 0x07CD, 0x6822, 0x05DA,
+ 0x6828, 0x4BFC, 0x6829, 0x143E, 0x682A, 0x05D2, 0x682B, 0x1444,
+ 0x682C, 0x3922, 0x682D, 0x457B, 0x6830, 0x3923, 0x6831, 0x3924,
+ 0x6832, 0x1441, 0x6833, 0x457D, 0x6834, 0x0A97, 0x6838, 0x05A9,
+ 0x6839, 0x081C, 0x683B, 0x457E, 0x683C, 0x05A8, 0x683D, 0x083F,
+ 0x683E, 0x457F, 0x6840, 0x143F, 0x6841, 0x073B, 0x6842, 0x0721,
+ 0x6843, 0x0C67, 0x6844, 0x212F, 0x6845, 0x4580, 0x6846, 0x143D,
+ 0x6848, 0x048A, 0x6849, 0x4581, 0x684C, 0x4582, 0x684D, 0x1440,
+ 0x684E, 0x1442, 0x6850, 0x06C5, 0x6851, 0x0702, 0x6852, 0x212C,
+ 0x6853, 0x05F8, 0x6854, 0x0665, 0x6855, 0x4583, 0x6857, 0x4584,
+ 0x6859, 0x1445, 0x685B, 0x3925, 0x685C, 0x0869, 0x685D, 0x0E9F,
+ 0x685F, 0x0885, 0x6863, 0x1446, 0x6867, 0x0DA2, 0x686B, 0x4586,
+ 0x686E, 0x4587, 0x6872, 0x3926, 0x6874, 0x1452, 0x6875, 0x3927,
+ 0x6876, 0x0533, 0x6877, 0x1447, 0x687A, 0x3928, 0x687C, 0x4588,
+ 0x687E, 0x1458, 0x687F, 0x1448, 0x6881, 0x0F8A, 0x6882, 0x4589,
+ 0x6883, 0x144F, 0x6884, 0x3929, 0x6885, 0x0D15, 0x6886, 0x4BFD,
+ 0x688D, 0x1457, 0x688E, 0x1E9C, 0x688F, 0x144A, 0x6890, 0x458A,
+ 0x6893, 0x0478, 0x6894, 0x144C, 0x6896, 0x458B, 0x6897, 0x07CE,
+ 0x6898, 0x458D, 0x6899, 0x458E, 0x689A, 0x458F, 0x689B, 0x144E,
+ 0x689C, 0x4590, 0x689D, 0x144D, 0x689F, 0x1449, 0x68A0, 0x1454,
+ 0x68A2, 0x09A7, 0x68A3, 0x4206, 0x68A5, 0x392A, 0x68A6, 0x11BE,
+ 0x68A7, 0x079C, 0x68A8, 0x0F66, 0x68AA, 0x4591, 0x68AB, 0x4592,
+ 0x68AD, 0x144B, 0x68AF, 0x0C10, 0x68B0, 0x0581, 0x68B1, 0x081D,
+ 0x68B2, 0x392B, 0x68B3, 0x1443, 0x68B4, 0x4593, 0x68B5, 0x1453,
+ 0x68B6, 0x05BF, 0x68B9, 0x1451, 0x68BA, 0x1455, 0x68BB, 0x4594,
+ 0x68BC, 0x0C68, 0x68C3, 0x4598, 0x68C4, 0x063A, 0x68C5, 0x4599,
+ 0x68C6, 0x1473, 0x68C8, 0x20AF, 0x68C9, 0x0ED5, 0x68CA, 0x145A,
+ 0x68CB, 0x0639, 0x68CC, 0x459A, 0x68CD, 0x1461, 0x68CF, 0x2130,
+ 0x68D0, 0x392C, 0x68D2, 0x0E6E, 0x68D4, 0x1462, 0x68D5, 0x1464,
+ 0x68D6, 0x392D, 0x68D7, 0x1468, 0x68D8, 0x145C, 0x68D9, 0x459B,
+ 0x68DA, 0x0B68, 0x68DF, 0x0C69, 0x68E0, 0x146C, 0x68E1, 0x145F,
+ 0x68E3, 0x1469, 0x68E4, 0x459C, 0x68E5, 0x459D, 0x68E7, 0x1463,
+ 0x68E8, 0x392E, 0x68EB, 0x4BFE, 0x68EC, 0x459E, 0x68ED, 0x392F,
+ 0x68EE, 0x09FF, 0x68EF, 0x146D, 0x68F0, 0x3930, 0x68F1, 0x3931,
+ 0x68F2, 0x0A57, 0x68F5, 0x4BFF, 0x68F7, 0x459F, 0x68F9, 0x146B,
+ 0x68FA, 0x05F9, 0x68FB, 0x4595, 0x68FC, 0x3932, 0x6900, 0x0FF6,
+ 0x6901, 0x1459, 0x6903, 0x45A0, 0x6904, 0x1467, 0x6905, 0x049C,
+ 0x6907, 0x45A1, 0x6908, 0x145B, 0x690A, 0x4207, 0x690B, 0x0EC6,
+ 0x690C, 0x1460, 0x690D, 0x09E8, 0x690E, 0x0BE3, 0x690F, 0x1456,
+ 0x6911, 0x3933, 0x6912, 0x1466, 0x6913, 0x3934, 0x6917, 0x4C00,
+ 0x6919, 0x0A40, 0x691A, 0x1470, 0x691B, 0x05CF, 0x691C, 0x0755,
+ 0x6921, 0x1472, 0x6922, 0x145D, 0x6923, 0x1471, 0x6925, 0x146A,
+ 0x6926, 0x145E, 0x6928, 0x146E, 0x692A, 0x146F, 0x6930, 0x1480,
+ 0x6933, 0x4C01, 0x6934, 0x0CA6, 0x6935, 0x3935, 0x6936, 0x1465,
+ 0x6938, 0x4C02, 0x6939, 0x147C, 0x693B, 0x3936, 0x693D, 0x147E,
+ 0x693F, 0x0BF4, 0x6942, 0x420A, 0x6946, 0x45A5, 0x6949, 0x4208,
+ 0x694A, 0x0F36, 0x6953, 0x0DE8, 0x6954, 0x1479, 0x6955, 0x0B2A,
+ 0x6957, 0x3937, 0x6959, 0x147F, 0x695A, 0x0AC1, 0x695B, 0x4C03,
+ 0x695C, 0x1476, 0x695D, 0x1483, 0x695E, 0x1482, 0x6960, 0x0CC7,
+ 0x6961, 0x1481, 0x6962, 0x0CC2, 0x6963, 0x3938, 0x6964, 0x420B,
+ 0x6965, 0x4C04, 0x6968, 0x2132, 0x6969, 0x45A6, 0x696A, 0x1485,
+ 0x696B, 0x1478, 0x696C, 0x45A7, 0x696D, 0x06C0, 0x696E, 0x147B,
+ 0x696F, 0x0967, 0x6972, 0x3939, 0x6973, 0x0D16, 0x6974, 0x147D,
+ 0x6975, 0x06C3, 0x6977, 0x1475, 0x6978, 0x1477, 0x6979, 0x1474,
+ 0x697A, 0x45A8, 0x697C, 0x0FD6, 0x697D, 0x05B8, 0x697E, 0x147A,
+ 0x697F, 0x393A, 0x6980, 0x393B, 0x6981, 0x1484, 0x6982, 0x0593,
+ 0x6986, 0x3740, 0x698A, 0x0857, 0x698E, 0x04FF, 0x6991, 0x1495,
+ 0x6992, 0x45A9, 0x6994, 0x0FD7, 0x6995, 0x1498, 0x6996, 0x45AB,
+ 0x6998, 0x2134, 0x699B, 0x0A00, 0x699C, 0x1497, 0x69A0, 0x1496,
+ 0x69A5, 0x420C, 0x69A6, 0x393C, 0x69A7, 0x1493, 0x69A8, 0x4C05,
+ 0x69AB, 0x4C06, 0x69AD, 0x393D, 0x69AE, 0x1487, 0x69AF, 0x4C07,
+ 0x69B0, 0x45AC, 0x69B1, 0x14A4, 0x69B2, 0x1486, 0x69B4, 0x1499,
+ 0x69B7, 0x393E, 0x69BA, 0x45AD, 0x69BB, 0x1491, 0x69BC, 0x45AE,
+ 0x69BE, 0x148C, 0x69BF, 0x1489, 0x69C0, 0x45AF, 0x69C1, 0x148A,
+ 0x69C3, 0x1492, 0x69C7, 0x1D33, 0x69CA, 0x148F, 0x69CB, 0x07CF,
+ 0x69CC, 0x0BE4, 0x69CD, 0x0AE6, 0x69CE, 0x148D, 0x69CF, 0x420D,
+ 0x69D0, 0x1488, 0x69D1, 0x45B0, 0x69D3, 0x148B, 0x69D6, 0x393F,
+ 0x69D7, 0x3940, 0x69D8, 0x0F37, 0x69D9, 0x0E98, 0x69DD, 0x1490,
+ 0x69DE, 0x149A, 0x69E2, 0x2135, 0x69E3, 0x45B4, 0x69E5, 0x4C08,
+ 0x69E7, 0x14A2, 0x69E8, 0x149B, 0x69E9, 0x4210, 0x69EA, 0x3411,
+ 0x69EB, 0x14A8, 0x69ED, 0x14A6, 0x69EE, 0x45B5, 0x69EF, 0x45B6,
+ 0x69F1, 0x4C09, 0x69F2, 0x14A1, 0x69F3, 0x45B7, 0x69F4, 0x45B9,
+ 0x69F5, 0x4211, 0x69F6, 0x373F, 0x69F9, 0x14A0, 0x69FB, 0x0BEC,
+ 0x69FD, 0x0AE7, 0x69FE, 0x45BA, 0x69FF, 0x149E, 0x6A01, 0x3941,
+ 0x6A02, 0x149C, 0x6A05, 0x14A3, 0x6A0A, 0x14A9, 0x6A0B, 0x0D89,
+ 0x6A0C, 0x14AF, 0x6A0F, 0x3942, 0x6A11, 0x45BB, 0x6A12, 0x14AA,
+ 0x6A13, 0x14AD, 0x6A14, 0x14A7, 0x6A15, 0x3943, 0x6A17, 0x0BB2,
+ 0x6A19, 0x0DAA, 0x6A1A, 0x45BC, 0x6A1B, 0x149D, 0x6A1D, 0x45BD,
+ 0x6A1E, 0x14A5, 0x6A1F, 0x09A8, 0x6A21, 0x0EDB, 0x6A22, 0x14B9,
+ 0x6A23, 0x14AC, 0x6A28, 0x3944, 0x6A29, 0x0756, 0x6A2A, 0x0523,
+ 0x6A2B, 0x05BD, 0x6A2E, 0x1494, 0x6A30, 0x2136, 0x6A32, 0x45BF,
+ 0x6A33, 0x45C0, 0x6A34, 0x3945, 0x6A35, 0x09A9, 0x6A36, 0x14B1,
+ 0x6A38, 0x14B8, 0x6A39, 0x0925, 0x6A3A, 0x05D0, 0x6A3B, 0x4213,
+ 0x6A3D, 0x0B6C, 0x6A3E, 0x3946, 0x6A3F, 0x45C1, 0x6A44, 0x14AE,
+ 0x6A45, 0x3947, 0x6A46, 0x2138, 0x6A47, 0x14B3, 0x6A48, 0x14B7,
+ 0x6A49, 0x45C2, 0x6A4A, 0x4C0A, 0x6A4B, 0x06AE, 0x6A4E, 0x45C4,
+ 0x6A50, 0x3948, 0x6A51, 0x3949, 0x6A52, 0x45C5, 0x6A54, 0x3C34,
+ 0x6A55, 0x4C0B, 0x6A56, 0x394A, 0x6A58, 0x0666, 0x6A59, 0x14B5,
+ 0x6A5B, 0x394B, 0x6A5F, 0x063B, 0x6A61, 0x0CA3, 0x6A62, 0x14B4,
+ 0x6A64, 0x45C6, 0x6A66, 0x14B6, 0x6A67, 0x4C0C, 0x6A6B, 0x2137,
+ 0x6A71, 0x4C0D, 0x6A72, 0x14B0, 0x6A73, 0x2139, 0x6A78, 0x14B2,
+ 0x6A7A, 0x45C3, 0x6A7E, 0x213A, 0x6A7F, 0x05BE, 0x6A80, 0x0B87,
+ 0x6A83, 0x394C, 0x6A84, 0x14BD, 0x6A89, 0x394D, 0x6A8B, 0x45C8,
+ 0x6A8D, 0x14BB, 0x6A8E, 0x079D, 0x6A90, 0x14BA, 0x6A91, 0x394E,
+ 0x6A94, 0x4215, 0x6A97, 0x14C0, 0x6A9C, 0x143B, 0x6A9D, 0x394F,
+ 0x6A9E, 0x3950, 0x6A9F, 0x3951, 0x6AA0, 0x14BC, 0x6AA1, 0x45CA,
+ 0x6AA2, 0x14BE, 0x6AA3, 0x14BF, 0x6AA5, 0x4216, 0x6AAA, 0x14CB,
+ 0x6AAB, 0x45CC, 0x6AAC, 0x14C7, 0x6AAE, 0x1450, 0x6AAF, 0x4C0E,
+ 0x6AB3, 0x14C6, 0x6AB8, 0x14C5, 0x6ABB, 0x14C2, 0x6ABD, 0x45CD,
+ 0x6AC1, 0x14AB, 0x6AC2, 0x14C4, 0x6AC3, 0x14C3, 0x6AC6, 0x45CE,
+ 0x6AC8, 0x4C0F, 0x6AC9, 0x4C10, 0x6AD0, 0x45D0, 0x6AD1, 0x14C9,
+ 0x6AD3, 0x0FCC, 0x6AD4, 0x45CF, 0x6ADA, 0x14CC, 0x6ADB, 0x06F3,
+ 0x6ADC, 0x3952, 0x6ADD, 0x45D1, 0x6ADE, 0x14C8, 0x6ADF, 0x14CA,
+ 0x6AE2, 0x213B, 0x6AE4, 0x213C, 0x6AE7, 0x3953, 0x6AE8, 0x0D3B,
+ 0x6AEA, 0x14CD, 0x6AEC, 0x3954, 0x6AF1, 0x45D4, 0x6AF2, 0x45D5,
+ 0x6AF3, 0x45D6, 0x6AF8, 0x4EB8, 0x6AFA, 0x14D1, 0x6AFB, 0x14CE,
+ 0x6AFD, 0x45D7, 0x6B03, 0x4C11, 0x6B04, 0x0F5D, 0x6B05, 0x14CF,
+ 0x6B0A, 0x149F, 0x6B0B, 0x45D9, 0x6B0F, 0x45DA, 0x6B10, 0x45DB,
+ 0x6B11, 0x45DC, 0x6B12, 0x14D2, 0x6B16, 0x14D3, 0x6B17, 0x45DE,
+ 0x6B1B, 0x4218, 0x6B1D, 0x04D7, 0x6B1E, 0x3955, 0x6B1F, 0x14D5,
+ 0x6B20, 0x073D, 0x6B21, 0x08CD, 0x6B23, 0x06CD, 0x6B24, 0x3956,
+ 0x6B27, 0x0524, 0x6B2C, 0x4219, 0x6B2F, 0x45E0, 0x6B32, 0x0F49,
+ 0x6B35, 0x3957, 0x6B37, 0x14D7, 0x6B38, 0x14D6, 0x6B39, 0x14D9,
+ 0x6B3A, 0x0657, 0x6B3B, 0x4C12, 0x6B3D, 0x06CE, 0x6B3E, 0x05FA,
+ 0x6B3F, 0x4C13, 0x6B43, 0x14DC, 0x6B46, 0x3958, 0x6B47, 0x14DB,
+ 0x6B49, 0x14DD, 0x6B4A, 0x45E1, 0x6B4C, 0x054E, 0x6B4E, 0x0B75,
+ 0x6B50, 0x14DE, 0x6B53, 0x05FB, 0x6B54, 0x14E0, 0x6B56, 0x3959,
+ 0x6B58, 0x45E2, 0x6B59, 0x14DF, 0x6B5B, 0x14E1, 0x6B5F, 0x14E2,
+ 0x6B60, 0x395A, 0x6B61, 0x14E3, 0x6B62, 0x08AD, 0x6B63, 0x0A59,
+ 0x6B64, 0x0811, 0x6B65, 0x344A, 0x6B66, 0x0DE2, 0x6B67, 0x421A,
+ 0x6B69, 0x0E32, 0x6B6A, 0x0FEA, 0x6B6C, 0x45E3, 0x6B6F, 0x08C3,
+ 0x6B72, 0x35D9, 0x6B73, 0x0840, 0x6B74, 0x0FBA, 0x6B75, 0x45E4,
+ 0x6B77, 0x3456, 0x6B78, 0x14E4, 0x6B79, 0x14E5, 0x6B7A, 0x45E5,
+ 0x6B7B, 0x08AE, 0x6B7D, 0x4C14, 0x6B7E, 0x4C15, 0x6B7F, 0x14E6,
+ 0x6B80, 0x14E7, 0x6B81, 0x45E6, 0x6B82, 0x395B, 0x6B83, 0x14E9,
+ 0x6B84, 0x14E8, 0x6B86, 0x0E86, 0x6B89, 0x0968, 0x6B8A, 0x0918,
+ 0x6B8B, 0x0892, 0x6B8D, 0x14EA, 0x6B95, 0x14EC, 0x6B96, 0x09E9,
+ 0x6B98, 0x14EB, 0x6B9B, 0x45E7, 0x6B9E, 0x14ED, 0x6BA4, 0x14EE,
+ 0x6BA9, 0x421B, 0x6BAA, 0x14EF, 0x6BAB, 0x14F0, 0x6BAD, 0x421C,
+ 0x6BAE, 0x45E8, 0x6BAF, 0x14F1, 0x6BB0, 0x4C16, 0x6BB1, 0x14F3,
+ 0x6BB2, 0x14F2, 0x6BB3, 0x14F4, 0x6BB4, 0x0525, 0x6BB5, 0x0B88,
+ 0x6BB7, 0x14F5, 0x6BBA, 0x0874, 0x6BBB, 0x05AA, 0x6BBC, 0x14F6,
+ 0x6BBD, 0x45EA, 0x6BBE, 0x395C, 0x6BBF, 0x0C3C, 0x6BC0, 0x119D,
+ 0x6BC5, 0x063D, 0x6BC6, 0x14F7, 0x6BC7, 0x45EB, 0x6BC8, 0x45EC,
+ 0x6BC9, 0x45ED, 0x6BCB, 0x14F8, 0x6BCC, 0x3744, 0x6BCD, 0x0E3C,
+ 0x6BCE, 0x0E96, 0x6BCF, 0x344C, 0x6BD2, 0x0C9F, 0x6BD3, 0x14F9,
+ 0x6BD4, 0x0D7A, 0x6BD6, 0x213D, 0x6BD7, 0x421D, 0x6BD8, 0x0D8F,
+ 0x6BDA, 0x45EE, 0x6BDB, 0x0EDF, 0x6BDF, 0x14FA, 0x6BE1, 0x395D,
+ 0x6BE6, 0x45EF, 0x6BE7, 0x45F0, 0x6BEB, 0x14FC, 0x6BEC, 0x14FB,
+ 0x6BEE, 0x45F1, 0x6BEF, 0x14FE, 0x6BF1, 0x395E, 0x6BF3, 0x14FD,
+ 0x6BF7, 0x4C17, 0x6BF9, 0x4C18, 0x6BFF, 0x421E, 0x6C02, 0x45F2,
+ 0x6C04, 0x4C19, 0x6C05, 0x421F, 0x6C08, 0x1500, 0x6C09, 0x4C1A,
+ 0x6C0A, 0x45F3, 0x6C0D, 0x4C1B, 0x6C0E, 0x45F4, 0x6C0F, 0x08AF,
+ 0x6C10, 0x395F, 0x6C11, 0x0EBD, 0x6C13, 0x1501, 0x6C14, 0x1502,
+ 0x6C17, 0x063E, 0x6C1B, 0x1503, 0x6C23, 0x1505, 0x6C24, 0x1504,
+ 0x6C2C, 0x4C1C, 0x6C33, 0x3960, 0x6C34, 0x0A2B, 0x6C35, 0x3961,
+ 0x6C36, 0x45F5, 0x6C37, 0x0DAB, 0x6C38, 0x04EC, 0x6C3A, 0x4F55,
+ 0x6C3E, 0x0D59, 0x6C3F, 0x213E, 0x6C40, 0x0C11, 0x6C41, 0x094B,
+ 0x6C42, 0x067B, 0x6C4A, 0x4C1D, 0x6C4D, 0x45F7, 0x6C4E, 0x0D5A,
+ 0x6C50, 0x08DA, 0x6C52, 0x4C1E, 0x6C54, 0x4C1F, 0x6C55, 0x1507,
+ 0x6C57, 0x05FC, 0x6C59, 0x3963, 0x6C5A, 0x051A, 0x6C5B, 0x45F8,
+ 0x6C5C, 0x213F, 0x6C5D, 0x0CCA, 0x6C5E, 0x1506, 0x6C5F, 0x07D0,
+ 0x6C60, 0x0B91, 0x6C62, 0x1508, 0x6C67, 0x460A, 0x6C68, 0x1510,
+ 0x6C6A, 0x1509, 0x6C6D, 0x45F9, 0x6C6F, 0x2141, 0x6C70, 0x0B21,
+ 0x6C72, 0x067C, 0x6C73, 0x1511, 0x6C74, 0x4220, 0x6C76, 0x3964,
+ 0x6C79, 0x4C20, 0x6C7A, 0x073E, 0x6C7B, 0x3965, 0x6C7D, 0x063F,
+ 0x6C7E, 0x150F, 0x6C81, 0x150D, 0x6C82, 0x150A, 0x6C83, 0x0F4A,
+ 0x6C84, 0x45FA, 0x6C85, 0x3966, 0x6C86, 0x2140, 0x6C88, 0x0BDC,
+ 0x6C89, 0x45FB, 0x6C8C, 0x0CB1, 0x6C8D, 0x150B, 0x6C90, 0x1513,
+ 0x6C92, 0x1512, 0x6C93, 0x06F9, 0x6C94, 0x45FD, 0x6C95, 0x3967,
+ 0x6C96, 0x052D, 0x6C97, 0x45FE, 0x6C98, 0x4221, 0x6C99, 0x082B,
+ 0x6C9A, 0x150C, 0x6C9B, 0x150E, 0x6C9C, 0x3968, 0x6CA1, 0x0E85,
+ 0x6CA2, 0x0B54, 0x6CAA, 0x3749, 0x6CAB, 0x0EA5, 0x6CAC, 0x4C21,
+ 0x6CAD, 0x45FF, 0x6CAE, 0x151B, 0x6CB1, 0x151C, 0x6CB3, 0x054F,
+ 0x6CB4, 0x4C22, 0x6CB8, 0x0DF8, 0x6CB9, 0x0F09, 0x6CBA, 0x151E,
+ 0x6CBB, 0x08CF, 0x6CBC, 0x09AA, 0x6CBD, 0x1517, 0x6CBE, 0x151D,
+ 0x6CBF, 0x050A, 0x6CC1, 0x06AF, 0x6CC2, 0x4600, 0x6CC4, 0x1514,
+ 0x6CC5, 0x1519, 0x6CC6, 0x4223, 0x6CC9, 0x0A98, 0x6CCA, 0x0D27,
+ 0x6CCC, 0x0D7B, 0x6CD0, 0x3969, 0x6CD2, 0x4C23, 0x6CD3, 0x1516,
+ 0x6CD4, 0x396A, 0x6CD5, 0x0E4F, 0x6CD6, 0x396B, 0x6CD7, 0x1518,
+ 0x6CD9, 0x1521, 0x6CDA, 0x2142, 0x6CDB, 0x151F, 0x6CDC, 0x4602,
+ 0x6CDD, 0x151A, 0x6CE0, 0x396C, 0x6CE1, 0x0E50, 0x6CE2, 0x0CFE,
+ 0x6CE3, 0x067D, 0x6CE5, 0x0C1F, 0x6CE8, 0x0BAB, 0x6CE9, 0x4603,
+ 0x6CEA, 0x1522, 0x6CEB, 0x396D, 0x6CEC, 0x396E, 0x6CED, 0x4604,
+ 0x6CEE, 0x396F, 0x6CEF, 0x1520, 0x6CF0, 0x0B39, 0x6CF1, 0x1515,
+ 0x6CF3, 0x04ED, 0x6CFB, 0x4222, 0x6D00, 0x4606, 0x6D01, 0x3C35,
+ 0x6D04, 0x2143, 0x6D0A, 0x3970, 0x6D0B, 0x0F38, 0x6D0C, 0x152D,
+ 0x6D0E, 0x3971, 0x6D11, 0x3972, 0x6D12, 0x152C, 0x6D17, 0x0A9A,
+ 0x6D19, 0x1529, 0x6D1B, 0x0F56, 0x6D1E, 0x0C8E, 0x6D1F, 0x1523,
+ 0x6D24, 0x4607, 0x6D25, 0x0BE1, 0x6D26, 0x4608, 0x6D27, 0x4609,
+ 0x6D29, 0x04EE, 0x6D2A, 0x07D1, 0x6D2B, 0x1526, 0x6D2E, 0x3973,
+ 0x6D2F, 0x460B, 0x6D31, 0x4224, 0x6D32, 0x0931, 0x6D33, 0x152B,
+ 0x6D34, 0x461E, 0x6D35, 0x152A, 0x6D36, 0x1525, 0x6D38, 0x1528,
+ 0x6D39, 0x4225, 0x6D3B, 0x05C6, 0x6D3C, 0x460C, 0x6D3D, 0x1527,
+ 0x6D3E, 0x0CFF, 0x6D3F, 0x4226, 0x6D41, 0x0F76, 0x6D44, 0x09DC,
+ 0x6D45, 0x0A99, 0x6D57, 0x3974, 0x6D58, 0x4227, 0x6D59, 0x1533,
+ 0x6D5A, 0x1531, 0x6D5B, 0x460D, 0x6D5C, 0x0DBF, 0x6D5E, 0x3975,
+ 0x6D60, 0x460E, 0x6D61, 0x4C24, 0x6D63, 0x152E, 0x6D64, 0x1530,
+ 0x6D65, 0x3976, 0x6D66, 0x04DC, 0x6D69, 0x07D2, 0x6D6A, 0x0FD8,
+ 0x6D6C, 0x059B, 0x6D6E, 0x0DD4, 0x6D6F, 0x2145, 0x6D70, 0x460F,
+ 0x6D74, 0x0F4B, 0x6D77, 0x0582, 0x6D78, 0x0A01, 0x6D79, 0x1532,
+ 0x6D7C, 0x4C25, 0x6D80, 0x4610, 0x6D81, 0x4611, 0x6D82, 0x3977,
+ 0x6D85, 0x1537, 0x6D87, 0x2144, 0x6D88, 0x09AB, 0x6D89, 0x342A,
+ 0x6D8A, 0x4612, 0x6D8C, 0x0F1A, 0x6D8D, 0x4613, 0x6D8E, 0x1534,
+ 0x6D91, 0x4614, 0x6D93, 0x152F, 0x6D94, 0x4228, 0x6D95, 0x1535,
+ 0x6D96, 0x2146, 0x6D98, 0x4615, 0x6D99, 0x0FA6, 0x6D9B, 0x0C6D,
+ 0x6D9C, 0x0C9A, 0x6DAA, 0x4229, 0x6DAB, 0x461A, 0x6DAC, 0x2147,
+ 0x6DAE, 0x461B, 0x6DAF, 0x0594, 0x6DB2, 0x04F7, 0x6DB4, 0x461C,
+ 0x6DB5, 0x153B, 0x6DB8, 0x153E, 0x6DB9, 0x4C26, 0x6DBC, 0x0F8B,
+ 0x6DBF, 0x3978, 0x6DC0, 0x0F4E, 0x6DC2, 0x461D, 0x6DC4, 0x3979,
+ 0x6DC5, 0x1545, 0x6DC6, 0x153F, 0x6DC7, 0x153C, 0x6DC8, 0x461F,
+ 0x6DCA, 0x397A, 0x6DCB, 0x0F9C, 0x6DCC, 0x1542, 0x6DCE, 0x4620,
+ 0x6DCF, 0x2148, 0x6DD0, 0x3C36, 0x6DD1, 0x0954, 0x6DD2, 0x1544,
+ 0x6DD5, 0x1549, 0x6DD6, 0x397B, 0x6DD8, 0x0C6B, 0x6DD9, 0x1547,
+ 0x6DDA, 0x3453, 0x6DDB, 0x422A, 0x6DDD, 0x422B, 0x6DDE, 0x1541,
+ 0x6DDF, 0x4621, 0x6DE1, 0x0B76, 0x6DE4, 0x1548, 0x6DE6, 0x153D,
+ 0x6DE8, 0x1543, 0x6DE9, 0x397C, 0x6DEA, 0x154A, 0x6DEB, 0x04C0,
+ 0x6DEC, 0x1540, 0x6DEE, 0x154B, 0x6DF0, 0x4C27, 0x6DF1, 0x0A02,
+ 0x6DF2, 0x214A, 0x6DF3, 0x0969, 0x6DF5, 0x0DF5, 0x6DF6, 0x4622,
+ 0x6DF7, 0x081E, 0x6DF8, 0x2149, 0x6DF9, 0x1538, 0x6DFA, 0x1546,
+ 0x6DFB, 0x0C34, 0x6DFC, 0x214B, 0x6E05, 0x0A5A, 0x6E07, 0x05C7,
+ 0x6E08, 0x0841, 0x6E09, 0x09AC, 0x6E0A, 0x153A, 0x6E0B, 0x094C,
+ 0x6E13, 0x0722, 0x6E15, 0x1539, 0x6E17, 0x3746, 0x6E19, 0x154F,
+ 0x6E1A, 0x0977, 0x6E1B, 0x076E, 0x6E1D, 0x155E, 0x6E1E, 0x4624,
+ 0x6E1F, 0x1558, 0x6E20, 0x068E, 0x6E21, 0x0C49, 0x6E22, 0x397D,
+ 0x6E23, 0x1553, 0x6E24, 0x155C, 0x6E25, 0x0473, 0x6E26, 0x04D4,
+ 0x6E27, 0x214E, 0x6E29, 0x0539, 0x6E2B, 0x1555, 0x6E2C, 0x0B0C,
+ 0x6E2D, 0x154C, 0x6E2E, 0x154E, 0x6E2F, 0x07D3, 0x6E32, 0x4626,
+ 0x6E34, 0x3412, 0x6E36, 0x4623, 0x6E38, 0x155F, 0x6E39, 0x214C,
+ 0x6E3A, 0x155A, 0x6E3C, 0x214F, 0x6E3E, 0x1552, 0x6E42, 0x3C37,
+ 0x6E43, 0x1559, 0x6E44, 0x422C, 0x6E45, 0x4C28, 0x6E48, 0x4627,
+ 0x6E49, 0x4628, 0x6E4A, 0x0EB7, 0x6E4B, 0x4629, 0x6E4C, 0x462A,
+ 0x6E4D, 0x1557, 0x6E4E, 0x155B, 0x6E4F, 0x462B, 0x6E51, 0x397E,
+ 0x6E53, 0x462C, 0x6E54, 0x462D, 0x6E56, 0x0784, 0x6E57, 0x462E,
+ 0x6E58, 0x09AD, 0x6E5B, 0x0B77, 0x6E5C, 0x214D, 0x6E5E, 0x422D,
+ 0x6E5F, 0x1551, 0x6E63, 0x462F, 0x6E67, 0x0F19, 0x6E6B, 0x1554,
+ 0x6E6E, 0x154D, 0x6E6F, 0x0C6C, 0x6E72, 0x1550, 0x6E73, 0x4C29,
+ 0x6E76, 0x1556, 0x6E7B, 0x4C2A, 0x6E7D, 0x4C2B, 0x6E7E, 0x0FF7,
+ 0x6E7F, 0x08EA, 0x6E80, 0x0EAC, 0x6E82, 0x1560, 0x6E89, 0x4C2C,
+ 0x6E8C, 0x0D42, 0x6E8F, 0x156C, 0x6E90, 0x076F, 0x6E93, 0x4631,
+ 0x6E96, 0x096A, 0x6E98, 0x1562, 0x6E9C, 0x0F77, 0x6E9D, 0x07D4,
+ 0x6E9F, 0x156F, 0x6EA2, 0x04B2, 0x6EA5, 0x156D, 0x6EA7, 0x4632,
+ 0x6EAA, 0x1561, 0x6EAB, 0x340C, 0x6EAF, 0x1567, 0x6EB1, 0x422E,
+ 0x6EB2, 0x1569, 0x6EB4, 0x4633, 0x6EB6, 0x0F39, 0x6EB7, 0x1564,
+ 0x6EBA, 0x0C28, 0x6EBC, 0x4C2D, 0x6EBD, 0x1566, 0x6EBF, 0x2150,
+ 0x6EC1, 0x422F, 0x6EC2, 0x156E, 0x6EC3, 0x4634, 0x6EC4, 0x1568,
+ 0x6EC5, 0x0ED3, 0x6EC7, 0x397F, 0x6EC9, 0x1563, 0x6ECA, 0x3980,
+ 0x6ECB, 0x08CE, 0x6ECC, 0x157B, 0x6ECE, 0x3981, 0x6ED1, 0x05C8,
+ 0x6ED3, 0x1565, 0x6ED4, 0x156A, 0x6ED5, 0x156B, 0x6ED9, 0x3C38,
+ 0x6EDA, 0x4C2E, 0x6EDB, 0x4C2F, 0x6EDD, 0x0B4C, 0x6EDE, 0x0B3A,
+ 0x6EE6, 0x3C24, 0x6EEB, 0x4636, 0x6EEC, 0x1573, 0x6EEF, 0x1579,
+ 0x6EF2, 0x1577, 0x6EF4, 0x0C23, 0x6EF7, 0x157E, 0x6EF8, 0x1574,
+ 0x6EF9, 0x4637, 0x6EFB, 0x4638, 0x6EFD, 0x3982, 0x6EFE, 0x1575,
+ 0x6EFF, 0x155D, 0x6F01, 0x0693, 0x6F02, 0x0DAC, 0x6F06, 0x08EB,
+ 0x6F09, 0x0809, 0x6F0A, 0x4639, 0x6F0C, 0x463A, 0x6F0F, 0x0FD9,
+ 0x6F10, 0x4230, 0x6F11, 0x1571, 0x6F13, 0x157D, 0x6F14, 0x050B,
+ 0x6F15, 0x0AE8, 0x6F18, 0x463B, 0x6F1A, 0x3983, 0x6F20, 0x0D2F,
+ 0x6F22, 0x05FD, 0x6F23, 0x0FC2, 0x6F25, 0x463C, 0x6F26, 0x4C30,
+ 0x6F29, 0x4C31, 0x6F2A, 0x3984, 0x6F2B, 0x0EAD, 0x6F2C, 0x0BEE,
+ 0x6F2F, 0x3985, 0x6F30, 0x4C32, 0x6F31, 0x1578, 0x6F32, 0x157A,
+ 0x6F33, 0x3986, 0x6F35, 0x4635, 0x6F36, 0x463D, 0x6F38, 0x0AB4,
+ 0x6F3C, 0x463E, 0x6F3E, 0x157C, 0x6F3F, 0x1576, 0x6F41, 0x1570,
+ 0x6F45, 0x05FF, 0x6F51, 0x1E60, 0x6F52, 0x4640, 0x6F54, 0x073F,
+ 0x6F57, 0x4641, 0x6F58, 0x158A, 0x6F59, 0x4231, 0x6F5A, 0x3987,
+ 0x6F5B, 0x1585, 0x6F5C, 0x0A9C, 0x6F5E, 0x3988, 0x6F5F, 0x05C1,
+ 0x6F60, 0x4642, 0x6F61, 0x4232, 0x6F62, 0x3989, 0x6F64, 0x096B,
+ 0x6F66, 0x158E, 0x6F68, 0x4643, 0x6F6D, 0x1587, 0x6F6E, 0x0BC8,
+ 0x6F6F, 0x1584, 0x6F70, 0x0BF5, 0x6F74, 0x15A7, 0x6F78, 0x1581,
+ 0x6F7A, 0x1580, 0x6F7C, 0x1589, 0x6F7D, 0x398A, 0x6F7E, 0x4233,
+ 0x6F80, 0x1583, 0x6F81, 0x1582, 0x6F82, 0x1588, 0x6F84, 0x0A45,
+ 0x6F86, 0x157F, 0x6F87, 0x4C33, 0x6F88, 0x2151, 0x6F8B, 0x398B,
+ 0x6F8C, 0x4234, 0x6F8D, 0x398C, 0x6F8E, 0x158B, 0x6F90, 0x4644,
+ 0x6F91, 0x158C, 0x6F92, 0x398D, 0x6F94, 0x398E, 0x6F96, 0x4645,
+ 0x6F97, 0x05FE, 0x6F98, 0x363C, 0x6F9A, 0x398F, 0x6F9D, 0x4C34,
+ 0x6F9F, 0x4647, 0x6FA0, 0x4235, 0x6FA1, 0x1591, 0x6FA3, 0x1590,
+ 0x6FA4, 0x1592, 0x6FA5, 0x4648, 0x6FA7, 0x3990, 0x6FA8, 0x3991,
+ 0x6FAA, 0x1595, 0x6FAE, 0x4C35, 0x6FAF, 0x4649, 0x6FB1, 0x0C3D,
+ 0x6FB3, 0x158F, 0x6FB5, 0x2152, 0x6FB6, 0x3992, 0x6FB7, 0x4C36,
+ 0x6FB9, 0x1593, 0x6FBC, 0x4236, 0x6FBE, 0x4646, 0x6FC0, 0x0739,
+ 0x6FC1, 0x0B59, 0x6FC2, 0x158D, 0x6FC3, 0x0CF1, 0x6FC6, 0x1594,
+ 0x6FC7, 0x4237, 0x6FC8, 0x464B, 0x6FC9, 0x464C, 0x6FCA, 0x4238,
+ 0x6FD4, 0x1599, 0x6FD5, 0x1597, 0x6FD8, 0x159A, 0x6FDA, 0x3993,
+ 0x6FDB, 0x159D, 0x6FDE, 0x3994, 0x6FDF, 0x1596, 0x6FE0, 0x07FC,
+ 0x6FE1, 0x0CDE, 0x6FE4, 0x1536, 0x6FE9, 0x464D, 0x6FEB, 0x0F5E,
+ 0x6FEC, 0x1598, 0x6FEE, 0x159C, 0x6FEF, 0x0B55, 0x6FF0, 0x4239,
+ 0x6FF1, 0x159B, 0x6FF3, 0x1586, 0x6FF5, 0x2153, 0x6FF6, 0x1BA4,
+ 0x6FF9, 0x3C23, 0x6FFA, 0x15A0, 0x6FFC, 0x464F, 0x6FFE, 0x15A4,
+ 0x7000, 0x4650, 0x7001, 0x15A2, 0x7005, 0x2154, 0x7006, 0x1E50,
+ 0x7007, 0x2155, 0x7009, 0x159E, 0x700A, 0x4651, 0x700B, 0x159F,
+ 0x700D, 0x4C37, 0x700F, 0x15A3, 0x7011, 0x15A1, 0x7015, 0x0DC0,
+ 0x7018, 0x15A9, 0x701A, 0x15A6, 0x701B, 0x15A5, 0x701D, 0x15A8,
+ 0x701E, 0x0CAC, 0x701F, 0x15AA, 0x7020, 0x4C38, 0x7023, 0x4652,
+ 0x7026, 0x0BB3, 0x7027, 0x0B4D, 0x7028, 0x2156, 0x702C, 0x0A49,
+ 0x7030, 0x15AB, 0x7032, 0x15AD, 0x7039, 0x3996, 0x703A, 0x4654,
+ 0x703C, 0x3997, 0x703E, 0x15AC, 0x7043, 0x4655, 0x7047, 0x4656,
+ 0x7049, 0x4C39, 0x704A, 0x4F52, 0x704B, 0x4657, 0x704C, 0x1572,
+ 0x704E, 0x423A, 0x7051, 0x15AE, 0x7054, 0x3999, 0x7058, 0x0CBF,
+ 0x705D, 0x399A, 0x705E, 0x399B, 0x7063, 0x15AF, 0x7064, 0x399C,
+ 0x7065, 0x4659, 0x7069, 0x465A, 0x706B, 0x0550, 0x706C, 0x399D,
+ 0x706E, 0x465B, 0x706F, 0x0C6E, 0x7070, 0x0583, 0x7075, 0x423B,
+ 0x7076, 0x465C, 0x7078, 0x067E, 0x707C, 0x090A, 0x707D, 0x0842,
+ 0x707E, 0x399E, 0x7081, 0x399F, 0x7085, 0x2157, 0x7086, 0x465D,
+ 0x7089, 0x0FCD, 0x708A, 0x0A2C, 0x708E, 0x050C, 0x7092, 0x15B1,
+ 0x7095, 0x39A0, 0x7097, 0x465E, 0x7098, 0x4C3A, 0x7099, 0x15B0,
+ 0x709F, 0x4660, 0x70A4, 0x423C, 0x70AB, 0x2158, 0x70AC, 0x15B4,
+ 0x70AD, 0x0B78, 0x70AE, 0x15B7, 0x70AF, 0x15B2, 0x70B0, 0x4C3B,
+ 0x70B1, 0x4661, 0x70B3, 0x15B6, 0x70B7, 0x39A1, 0x70B8, 0x15B5,
+ 0x70B9, 0x0C3A, 0x70BA, 0x049D, 0x70BB, 0x20AD, 0x70C8, 0x0FBD,
+ 0x70CA, 0x4664, 0x70CB, 0x15B9, 0x70CF, 0x04CA, 0x70D1, 0x4665,
+ 0x70D3, 0x39A2, 0x70D4, 0x39A3, 0x70D5, 0x4C3C, 0x70D6, 0x4C3D,
+ 0x70D8, 0x39A4, 0x70D9, 0x15BB, 0x70DC, 0x39A5, 0x70DD, 0x15BA,
+ 0x70DF, 0x15B8, 0x70E4, 0x423D, 0x70EC, 0x4663, 0x70F1, 0x15B3,
+ 0x70F9, 0x0E51, 0x70FD, 0x15BD, 0x7103, 0x4666, 0x7104, 0x215A,
+ 0x7106, 0x4667, 0x7107, 0x39A6, 0x7108, 0x4668, 0x7109, 0x15BC,
+ 0x710C, 0x4669, 0x710F, 0x2159, 0x7114, 0x050D, 0x7119, 0x15BF,
+ 0x711A, 0x0E02, 0x711C, 0x15BE, 0x711E, 0x423F, 0x7120, 0x39A7,
+ 0x7121, 0x0EC1, 0x7126, 0x09AF, 0x712B, 0x423E, 0x712E, 0x4240,
+ 0x712F, 0x466B, 0x7130, 0x1DDC, 0x7131, 0x39A8, 0x7136, 0x0AB5,
+ 0x713C, 0x09AE, 0x7145, 0x4C3E, 0x7146, 0x215C, 0x7147, 0x215D,
+ 0x7149, 0x0FC3, 0x714A, 0x39A9, 0x714C, 0x15C5, 0x714E, 0x0A9D,
+ 0x7150, 0x466C, 0x7151, 0x4241, 0x7152, 0x39AA, 0x7153, 0x466D,
+ 0x7155, 0x15C1, 0x7156, 0x15C6, 0x7159, 0x050E, 0x715C, 0x215B,
+ 0x715E, 0x466E, 0x7160, 0x39AB, 0x7162, 0x15C4, 0x7164, 0x0D17,
+ 0x7165, 0x15C0, 0x7166, 0x15C3, 0x7167, 0x09B0, 0x7168, 0x4242,
+ 0x7169, 0x0D65, 0x716C, 0x15C7, 0x716E, 0x08FD, 0x7179, 0x39AC,
+ 0x717D, 0x0A9E, 0x7180, 0x4671, 0x7184, 0x15CA, 0x7185, 0x4243,
+ 0x7187, 0x4244, 0x7188, 0x15C2, 0x718A, 0x06FD, 0x718F, 0x15C8,
+ 0x7192, 0x39AD, 0x7194, 0x0F3A, 0x7195, 0x15CB, 0x7196, 0x4670,
+ 0x7199, 0x205D, 0x719B, 0x4672, 0x719F, 0x0959, 0x71A0, 0x4673,
+ 0x71A2, 0x4674, 0x71A8, 0x15CC, 0x71AC, 0x15CD, 0x71AE, 0x4675,
+ 0x71AF, 0x4676, 0x71B1, 0x0CE4, 0x71B2, 0x4C3F, 0x71B3, 0x3C25,
+ 0x71B9, 0x15CF, 0x71BA, 0x4245, 0x71BE, 0x15D0, 0x71C1, 0x215F,
+ 0x71C3, 0x0CE9, 0x71C4, 0x4246, 0x71C8, 0x0C6F, 0x71C9, 0x15D2,
+ 0x71CB, 0x39AF, 0x71CE, 0x15D4, 0x71D0, 0x0F9D, 0x71D2, 0x15D1,
+ 0x71D3, 0x39B0, 0x71D4, 0x15D3, 0x71D5, 0x050F, 0x71D6, 0x39B1,
+ 0x71D7, 0x15CE, 0x71D9, 0x4678, 0x71DC, 0x4679, 0x71DF, 0x114E,
+ 0x71E0, 0x15D5, 0x71E5, 0x0AE9, 0x71E6, 0x0886, 0x71E7, 0x15D7,
+ 0x71EC, 0x15D6, 0x71ED, 0x09EA, 0x71EE, 0x10EE, 0x71F4, 0x4C40,
+ 0x71F5, 0x15D8, 0x71F9, 0x15DA, 0x71FB, 0x15C9, 0x71FC, 0x15D9,
+ 0x71FE, 0x2160, 0x71FF, 0x15DB, 0x7200, 0x39B2, 0x7206, 0x0D30,
+ 0x7207, 0x467A, 0x720D, 0x15DC, 0x7210, 0x15DD, 0x7215, 0x4247,
+ 0x7217, 0x4C41, 0x721B, 0x15DE, 0x721D, 0x39B3, 0x721F, 0x4C42,
+ 0x7228, 0x15DF, 0x722A, 0x0BFA, 0x722B, 0x39B4, 0x722C, 0x15E1,
+ 0x722D, 0x15E0, 0x7230, 0x15E2, 0x7232, 0x15E3, 0x7234, 0x467C,
+ 0x7235, 0x090B, 0x7236, 0x0DD5, 0x7238, 0x39B5, 0x7239, 0x467D,
+ 0x723A, 0x0EF8, 0x723B, 0x15E4, 0x723C, 0x15E5, 0x723D, 0x0AD8,
+ 0x723E, 0x08D0, 0x723F, 0x15E6, 0x7240, 0x15E7, 0x7241, 0x39B6,
+ 0x7242, 0x467E, 0x7243, 0x4C43, 0x7246, 0x15E8, 0x7247, 0x0E22,
+ 0x7248, 0x0D5B, 0x724B, 0x15E9, 0x724C, 0x0D0D, 0x724F, 0x4C44,
+ 0x7250, 0x4C45, 0x7252, 0x0BC9, 0x7253, 0x39B7, 0x7255, 0x39B8,
+ 0x7256, 0x39B9, 0x7257, 0x467F, 0x7258, 0x15EA, 0x7259, 0x0567,
+ 0x725A, 0x4C46, 0x725B, 0x0687, 0x725C, 0x39BA, 0x725D, 0x0ED2,
+ 0x725F, 0x0EC2, 0x7260, 0x4C47, 0x7261, 0x0534, 0x7262, 0x0FDA,
+ 0x7263, 0x4680, 0x7267, 0x0E80, 0x7268, 0x4C48, 0x7269, 0x0DFA,
+ 0x726E, 0x4682, 0x726F, 0x4683, 0x7272, 0x0A5B, 0x7274, 0x15EB,
+ 0x7277, 0x4C49, 0x7278, 0x4684, 0x7279, 0x0C9B, 0x727D, 0x0757,
+ 0x727E, 0x15EC, 0x727F, 0x4685, 0x7280, 0x0844, 0x7281, 0x15EE,
+ 0x7282, 0x15ED, 0x7284, 0x4C4A, 0x7287, 0x15EF, 0x728D, 0x39BB,
+ 0x728E, 0x4686, 0x7292, 0x15F0, 0x7296, 0x15F1, 0x729B, 0x4249,
+ 0x72A0, 0x0658, 0x72A2, 0x15F2, 0x72A7, 0x15F3, 0x72AC, 0x0758,
+ 0x72AD, 0x39BC, 0x72AE, 0x4688, 0x72AF, 0x0D5C, 0x72B0, 0x4689,
+ 0x72B1, 0x2161, 0x72B2, 0x15F5, 0x72B4, 0x39BD, 0x72B6, 0x09DD,
+ 0x72B9, 0x15F4, 0x72BE, 0x2162, 0x72C0, 0x342B, 0x72C1, 0x468A,
+ 0x72C2, 0x06B0, 0x72C3, 0x15F6, 0x72C4, 0x15F8, 0x72C6, 0x15F7,
+ 0x72C7, 0x39BE, 0x72C9, 0x4C4B, 0x72CC, 0x468C, 0x72CE, 0x15F9,
+ 0x72D0, 0x0785, 0x72D2, 0x15FA, 0x72D7, 0x06E1, 0x72D9, 0x0AC2,
+ 0x72DB, 0x080F, 0x72E0, 0x15FC, 0x72E1, 0x15FD, 0x72E2, 0x15FB,
+ 0x72E5, 0x4C4C, 0x72E9, 0x0919, 0x72EC, 0x0CA0, 0x72ED, 0x06B1,
+ 0x72F3, 0x468F, 0x72F4, 0x4C4D, 0x72F7, 0x15FF, 0x72F8, 0x0B6A,
+ 0x72F9, 0x15FE, 0x72FA, 0x4690, 0x72FB, 0x39BF, 0x72FC, 0x0FDB,
+ 0x72FD, 0x0D18, 0x7302, 0x4C4E, 0x7304, 0x39C0, 0x7305, 0x39C1,
+ 0x7307, 0x4691, 0x730A, 0x1602, 0x730B, 0x4C4F, 0x7312, 0x4692,
+ 0x7316, 0x1604, 0x7317, 0x1601, 0x7318, 0x4693, 0x7319, 0x4694,
+ 0x731B, 0x0EE0, 0x731C, 0x1603, 0x731D, 0x1605, 0x731E, 0x4C50,
+ 0x731F, 0x0F8C, 0x7322, 0x4C51, 0x7324, 0x2163, 0x7325, 0x1609,
+ 0x7327, 0x424B, 0x7328, 0x39C2, 0x7329, 0x1608, 0x732A, 0x0BB4,
+ 0x732B, 0x0CE3, 0x732C, 0x4697, 0x732E, 0x0759, 0x732F, 0x1607,
+ 0x7331, 0x39C3, 0x7333, 0x4698, 0x7334, 0x1606, 0x7336, 0x0F1B,
+ 0x7337, 0x0F1C, 0x7339, 0x4696, 0x733A, 0x4C52, 0x733B, 0x4C53,
+ 0x733D, 0x4699, 0x733E, 0x160A, 0x733F, 0x0510, 0x7343, 0x39C4,
+ 0x7344, 0x0808, 0x7345, 0x08B0, 0x734D, 0x4C54, 0x734E, 0x160B,
+ 0x734F, 0x160C, 0x7350, 0x424C, 0x7352, 0x469A, 0x7357, 0x160E,
+ 0x7358, 0x4C55, 0x7363, 0x094D, 0x7366, 0x424D, 0x7367, 0x4C56,
+ 0x7368, 0x1610, 0x736A, 0x160F, 0x736B, 0x469C, 0x736C, 0x39C5,
+ 0x736E, 0x469E, 0x736F, 0x469F, 0x7370, 0x1611, 0x7371, 0x46A0,
+ 0x7372, 0x05AB, 0x7375, 0x1613, 0x7377, 0x2165, 0x7378, 0x1612,
+ 0x737A, 0x1615, 0x737B, 0x1614, 0x737C, 0x39C6, 0x7381, 0x46A1,
+ 0x7383, 0x39C7, 0x7384, 0x0770, 0x7385, 0x39C8, 0x7386, 0x39C9,
+ 0x7387, 0x0F70, 0x7389, 0x06C4, 0x738A, 0x46A2, 0x738B, 0x0526,
+ 0x7394, 0x46A3, 0x7395, 0x39CA, 0x7396, 0x06E2, 0x7398, 0x46A4,
+ 0x739C, 0x46A5, 0x739E, 0x39CB, 0x739F, 0x39CC, 0x73A0, 0x39CD,
+ 0x73A2, 0x424E, 0x73A5, 0x46A6, 0x73A6, 0x39CE, 0x73A8, 0x3C3F,
+ 0x73A9, 0x061D, 0x73AB, 0x39CF, 0x73B2, 0x0FB0, 0x73B3, 0x1617,
+ 0x73B5, 0x39D0, 0x73B7, 0x39D1, 0x73B9, 0x46A7, 0x73BA, 0x35EA,
+ 0x73BB, 0x1619, 0x73BC, 0x39D2, 0x73BD, 0x2166, 0x73BF, 0x46A8,
+ 0x73C0, 0x161A, 0x73C2, 0x0551, 0x73C5, 0x46A9, 0x73C8, 0x1616,
+ 0x73C9, 0x2167, 0x73CA, 0x0887, 0x73CB, 0x46AA, 0x73CD, 0x0BDD,
+ 0x73CE, 0x1618, 0x73CF, 0x39D3, 0x73D2, 0x216A, 0x73D6, 0x2168,
+ 0x73D9, 0x39D4, 0x73DE, 0x161D, 0x73E0, 0x091A, 0x73E1, 0x46AB,
+ 0x73E3, 0x2169, 0x73E4, 0x3C39, 0x73E5, 0x161B, 0x73E7, 0x46AC,
+ 0x73E9, 0x39D5, 0x73EA, 0x0714, 0x73ED, 0x0D5D, 0x73EE, 0x161C,
+ 0x73F1, 0x1637, 0x73F4, 0x39D6, 0x73F5, 0x216C, 0x73F8, 0x1622,
+ 0x73F9, 0x46AD, 0x73FA, 0x46AF, 0x73FD, 0x39D7, 0x73FE, 0x0771,
+ 0x7401, 0x46B0, 0x7403, 0x067F, 0x7404, 0x39D8, 0x7405, 0x161F,
+ 0x7406, 0x0F67, 0x7407, 0x216B, 0x7409, 0x0F78, 0x740A, 0x39D9,
+ 0x7413, 0x46AE, 0x741A, 0x39DA, 0x741B, 0x39DB, 0x7421, 0x3C3A,
+ 0x7422, 0x0B56, 0x7424, 0x39DC, 0x7425, 0x1621, 0x7426, 0x216D,
+ 0x7428, 0x39DD, 0x7429, 0x216F, 0x742A, 0x216E, 0x742B, 0x424F,
+ 0x742C, 0x39DE, 0x742E, 0x2170, 0x742F, 0x39DF, 0x7430, 0x39E0,
+ 0x7431, 0x39E1, 0x7432, 0x1623, 0x7433, 0x0F9E, 0x7434, 0x06CF,
+ 0x7435, 0x0D90, 0x7436, 0x0D00, 0x7439, 0x39E2, 0x743A, 0x1624,
+ 0x743F, 0x1626, 0x7440, 0x46B2, 0x7441, 0x1629, 0x7443, 0x46B3,
+ 0x7444, 0x39E3, 0x7446, 0x4250, 0x7447, 0x39E4, 0x744B, 0x39E5,
+ 0x744D, 0x39E6, 0x7451, 0x39E7, 0x7452, 0x46B4, 0x7453, 0x46B1,
+ 0x7455, 0x1625, 0x7457, 0x39E8, 0x7459, 0x1628, 0x745A, 0x079E,
+ 0x745B, 0x04EF, 0x745C, 0x162A, 0x745D, 0x46B5, 0x745E, 0x0A36,
+ 0x745F, 0x1627, 0x7460, 0x0FA4, 0x7462, 0x4251, 0x7463, 0x162D,
+ 0x7464, 0x1D35, 0x7466, 0x39E9, 0x7469, 0x162B, 0x746A, 0x162E,
+ 0x746B, 0x39EA, 0x746D, 0x4252, 0x746F, 0x1620, 0x7470, 0x162C,
+ 0x7471, 0x39EB, 0x7472, 0x4C57, 0x7473, 0x082C, 0x7476, 0x162F,
+ 0x747E, 0x1630, 0x7480, 0x39EC, 0x7481, 0x46B6, 0x7483, 0x0F68,
+ 0x7485, 0x39ED, 0x7486, 0x39EE, 0x7487, 0x39EF, 0x7488, 0x46B7,
+ 0x7489, 0x2172, 0x748B, 0x1631, 0x7490, 0x39F0, 0x7492, 0x46B9,
+ 0x7497, 0x46BA, 0x7498, 0x39F1, 0x7499, 0x46BB, 0x749C, 0x39F2,
+ 0x749E, 0x1632, 0x749F, 0x2173, 0x74A0, 0x39F3, 0x74A1, 0x46BC,
+ 0x74A2, 0x161E, 0x74A3, 0x39F4, 0x74A5, 0x46BD, 0x74A6, 0x4253,
+ 0x74A7, 0x1633, 0x74A8, 0x39F5, 0x74A9, 0x4254, 0x74AA, 0x46BE,
+ 0x74AB, 0x39F6, 0x74AF, 0x4C58, 0x74B0, 0x0600, 0x74B5, 0x39F7,
+ 0x74B9, 0x46BF, 0x74BA, 0x46C1, 0x74BB, 0x46C0, 0x74BD, 0x08D1,
+ 0x74BF, 0x39F8, 0x74C8, 0x39F9, 0x74C9, 0x4255, 0x74CA, 0x1634,
+ 0x74CF, 0x1635, 0x74D4, 0x1636, 0x74D6, 0x46C2, 0x74D8, 0x46C3,
+ 0x74DA, 0x39FA, 0x74DC, 0x04DD, 0x74DE, 0x39FB, 0x74DF, 0x4C59,
+ 0x74E0, 0x1638, 0x74E2, 0x0DAD, 0x74E3, 0x1639, 0x74E4, 0x4C5A,
+ 0x74E6, 0x05E0, 0x74E7, 0x163A, 0x74E9, 0x163B, 0x74EB, 0x46C4,
+ 0x74EE, 0x163C, 0x74EF, 0x3750, 0x74F0, 0x163E, 0x74F1, 0x163F,
+ 0x74F2, 0x163D, 0x74F4, 0x4C5B, 0x74F6, 0x0DC5, 0x74F7, 0x1641,
+ 0x74F8, 0x1640, 0x74FA, 0x46C6, 0x74FB, 0x4C5C, 0x74FF, 0x4256,
+ 0x7501, 0x2174, 0x7503, 0x1643, 0x7504, 0x1642, 0x7505, 0x1644,
+ 0x750C, 0x1645, 0x750D, 0x1647, 0x750E, 0x1646, 0x7511, 0x080B,
+ 0x7513, 0x1649, 0x7515, 0x1648, 0x7516, 0x4C5D, 0x7517, 0x4257,
+ 0x7518, 0x0601, 0x751A, 0x0A19, 0x751C, 0x0C36, 0x751E, 0x164A,
+ 0x751F, 0x0A5C, 0x7520, 0x46C8, 0x7521, 0x4C5E, 0x7522, 0x35DE,
+ 0x7523, 0x0888, 0x7524, 0x46C9, 0x7525, 0x051B, 0x7526, 0x164B,
+ 0x7528, 0x0F3B, 0x752A, 0x46CA, 0x752B, 0x0E33, 0x752C, 0x164C,
+ 0x752F, 0x20F2, 0x7530, 0x0C3E, 0x7531, 0x0F1D, 0x7532, 0x07D5,
+ 0x7533, 0x0A03, 0x7537, 0x0B89, 0x7538, 0x10C9, 0x753A, 0x0BCA,
+ 0x753B, 0x0568, 0x753C, 0x164D, 0x753D, 0x46CD, 0x753E, 0x46CE,
+ 0x753F, 0x4C5F, 0x7540, 0x46CF, 0x7544, 0x164E, 0x7546, 0x1653,
+ 0x7548, 0x46D0, 0x7549, 0x1651, 0x754A, 0x1650, 0x754B, 0x13C7,
+ 0x754C, 0x0584, 0x754D, 0x164F, 0x754E, 0x39FC, 0x754F, 0x049E,
+ 0x7550, 0x46D1, 0x7551, 0x0D3E, 0x7552, 0x46D2, 0x7554, 0x0D5E,
+ 0x7559, 0x0F79, 0x755A, 0x1654, 0x755B, 0x1652, 0x755C, 0x0B9A,
+ 0x755D, 0x0A4A, 0x755E, 0x4C60, 0x7560, 0x0D3F, 0x7562, 0x0D9F,
+ 0x7564, 0x1656, 0x7565, 0x0F74, 0x7566, 0x0723, 0x7567, 0x1657,
+ 0x7569, 0x1655, 0x756A, 0x0D6A, 0x756B, 0x1658, 0x756C, 0x3C3B,
+ 0x756D, 0x1659, 0x756F, 0x2175, 0x7570, 0x049F, 0x7571, 0x46D4,
+ 0x7572, 0x46D3, 0x7573, 0x09DE, 0x7574, 0x165E, 0x7575, 0x3751,
+ 0x7576, 0x165B, 0x7577, 0x0CC5, 0x7578, 0x165A, 0x7579, 0x39FD,
+ 0x757A, 0x46D5, 0x757D, 0x46D6, 0x757E, 0x46D7, 0x757F, 0x0640,
+ 0x7581, 0x39FE, 0x7582, 0x1661, 0x7586, 0x165C, 0x7587, 0x165D,
+ 0x7589, 0x1660, 0x758A, 0x165F, 0x758B, 0x0D97, 0x758C, 0x46D8,
+ 0x758E, 0x0AC4, 0x758F, 0x0AC3, 0x7590, 0x39FF, 0x7591, 0x0659,
+ 0x7592, 0x3A00, 0x7593, 0x3A01, 0x7594, 0x1662, 0x7599, 0x4C61,
+ 0x759A, 0x1663, 0x759D, 0x1664, 0x75A2, 0x46DA, 0x75A3, 0x1666,
+ 0x75A4, 0x4C62, 0x75A5, 0x1665, 0x75AB, 0x04F8, 0x75B0, 0x46DC,
+ 0x75B1, 0x166E, 0x75B2, 0x0D7C, 0x75B3, 0x1668, 0x75B4, 0x3A02,
+ 0x75B5, 0x166A, 0x75B7, 0x46DD, 0x75B8, 0x166C, 0x75B9, 0x0A04,
+ 0x75BC, 0x166D, 0x75BD, 0x166B, 0x75BE, 0x08EC, 0x75BF, 0x46DE,
+ 0x75C0, 0x46DF, 0x75C1, 0x4C63, 0x75C2, 0x1667, 0x75C3, 0x1669,
+ 0x75C4, 0x4C64, 0x75C5, 0x0DB4, 0x75C6, 0x46E0, 0x75C7, 0x09B1,
+ 0x75CA, 0x1670, 0x75CC, 0x4C65, 0x75CD, 0x166F, 0x75CE, 0x4259,
+ 0x75CF, 0x46E1, 0x75D2, 0x1671, 0x75D3, 0x46E2, 0x75D4, 0x08D2,
+ 0x75D5, 0x081F, 0x75D7, 0x4C66, 0x75D8, 0x0C71, 0x75D9, 0x1672,
+ 0x75DB, 0x0BE7, 0x75DC, 0x4C67, 0x75DD, 0x46E3, 0x75DE, 0x1674,
+ 0x75DF, 0x46E4, 0x75E0, 0x46E5, 0x75E1, 0x4C68, 0x75E2, 0x0F69,
+ 0x75E3, 0x1673, 0x75E4, 0x3A03, 0x75E7, 0x46E6, 0x75E9, 0x0AEB,
+ 0x75EC, 0x3752, 0x75EE, 0x46E7, 0x75EF, 0x4C69, 0x75F0, 0x1679,
+ 0x75F1, 0x46E8, 0x75F2, 0x167B, 0x75F3, 0x167C, 0x75F4, 0x0B92,
+ 0x75F9, 0x3A04, 0x75FA, 0x167A, 0x75FC, 0x1677, 0x75FE, 0x1675,
+ 0x75FF, 0x1676, 0x7600, 0x3A05, 0x7601, 0x1678, 0x7602, 0x425A,
+ 0x7603, 0x46E9, 0x7604, 0x4C6A, 0x7607, 0x46EB, 0x7608, 0x425B,
+ 0x7609, 0x167F, 0x760A, 0x3A06, 0x760B, 0x167D, 0x760C, 0x4C6B,
+ 0x760D, 0x167E, 0x760F, 0x46EC, 0x7613, 0x46EF, 0x7615, 0x3A07,
+ 0x7616, 0x3A08, 0x7618, 0x46EA, 0x7619, 0x3A09, 0x761B, 0x46F0,
+ 0x761C, 0x46F1, 0x761D, 0x4C6C, 0x761E, 0x3A0A, 0x761F, 0x1680,
+ 0x7620, 0x1682, 0x7621, 0x1683, 0x7622, 0x1684, 0x7624, 0x1685,
+ 0x7625, 0x46F3, 0x7626, 0x3645, 0x7627, 0x1681, 0x7628, 0x46F4,
+ 0x762D, 0x3A0B, 0x7630, 0x1687, 0x7632, 0x4C6D, 0x7633, 0x46F6,
+ 0x7634, 0x1686, 0x7635, 0x3A0C, 0x7638, 0x4C6E, 0x763B, 0x1688,
+ 0x763C, 0x46F5, 0x7641, 0x46F9, 0x7642, 0x0F8D, 0x7643, 0x3A0D,
+ 0x7645, 0x4C6F, 0x7646, 0x168B, 0x7647, 0x1689, 0x7648, 0x168A,
+ 0x7649, 0x46FB, 0x764A, 0x4C70, 0x764B, 0x3A0E, 0x764C, 0x061E,
+ 0x764E, 0x3753, 0x7652, 0x0F0A, 0x7655, 0x46FC, 0x7656, 0x0E1A,
+ 0x7658, 0x168D, 0x765C, 0x168C, 0x765F, 0x4C71, 0x7661, 0x168E,
+ 0x7662, 0x168F, 0x7664, 0x425C, 0x7665, 0x3A0F, 0x7667, 0x1693,
+ 0x7668, 0x1690, 0x7669, 0x1691, 0x766A, 0x1692, 0x766C, 0x1694,
+ 0x766D, 0x3A10, 0x766E, 0x46FE, 0x766F, 0x3A11, 0x7670, 0x1695,
+ 0x7671, 0x3A12, 0x7672, 0x1696, 0x7674, 0x3A13, 0x7676, 0x1697,
+ 0x7678, 0x1698, 0x767A, 0x0D43, 0x767B, 0x0C4A, 0x767C, 0x1699,
+ 0x767D, 0x0D28, 0x767E, 0x0DA6, 0x7680, 0x169A, 0x7681, 0x425D,
+ 0x7682, 0x2176, 0x7683, 0x169B, 0x7684, 0x0C24, 0x7686, 0x0585,
+ 0x7687, 0x07D6, 0x7688, 0x169C, 0x768B, 0x169D, 0x768E, 0x169E,
+ 0x7690, 0x0877, 0x7693, 0x16A0, 0x7695, 0x46FF, 0x7696, 0x169F,
+ 0x7699, 0x16A1, 0x769A, 0x16A2, 0x769B, 0x2179, 0x769C, 0x2177,
+ 0x769D, 0x425E, 0x769E, 0x2178, 0x76A0, 0x4701, 0x76A1, 0x4700,
+ 0x76A4, 0x3A14, 0x76A5, 0x3A15, 0x76A6, 0x217A, 0x76A7, 0x4702,
+ 0x76A8, 0x4703, 0x76AA, 0x425F, 0x76AD, 0x4C72, 0x76AE, 0x0D7D,
+ 0x76AF, 0x4704, 0x76B0, 0x16A3, 0x76B4, 0x16A4, 0x76B6, 0x4260,
+ 0x76B7, 0x1D1C, 0x76B8, 0x16A5, 0x76B9, 0x16A6, 0x76BA, 0x16A7,
+ 0x76BD, 0x4C73, 0x76BF, 0x087C, 0x76C2, 0x16A8, 0x76C3, 0x0D0C,
+ 0x76C5, 0x3A16, 0x76C6, 0x0E8D, 0x76C8, 0x04F0, 0x76C9, 0x4706,
+ 0x76CA, 0x04F9, 0x76CC, 0x3A17, 0x76CD, 0x16A9, 0x76CE, 0x4261,
+ 0x76D2, 0x16AB, 0x76D4, 0x4262, 0x76D6, 0x16AA, 0x76D7, 0x0C6A,
+ 0x76D9, 0x4C74, 0x76DB, 0x0A5D, 0x76DC, 0x14D8, 0x76DE, 0x16AC,
+ 0x76DF, 0x0ECD, 0x76E1, 0x16AD, 0x76E3, 0x0602, 0x76E4, 0x0D6B,
+ 0x76E5, 0x16AE, 0x76E6, 0x4263, 0x76E7, 0x16AF, 0x76E8, 0x4708,
+ 0x76EA, 0x16B0, 0x76EB, 0x4C75, 0x76EC, 0x3A18, 0x76EE, 0x0EE8,
+ 0x76F0, 0x4C76, 0x76F1, 0x4264, 0x76F2, 0x0EE1, 0x76F4, 0x0BDA,
+ 0x76F8, 0x0AEC, 0x76F9, 0x4C77, 0x76FB, 0x16B2, 0x76FC, 0x3A19,
+ 0x76FE, 0x096C, 0x7700, 0x4C78, 0x7701, 0x09B2, 0x7704, 0x16B5,
+ 0x7707, 0x16B4, 0x7708, 0x16B3, 0x7709, 0x0D91, 0x770A, 0x4265,
+ 0x770B, 0x0603, 0x770C, 0x075D, 0x770E, 0x4C79, 0x7717, 0x470A,
+ 0x7719, 0x4266, 0x771A, 0x470B, 0x771B, 0x16BB, 0x771E, 0x16B8,
+ 0x771F, 0x0A05, 0x7720, 0x0EBE, 0x7722, 0x4C7A, 0x7724, 0x16B7,
+ 0x7725, 0x16B9, 0x7726, 0x16BA, 0x7728, 0x4C7B, 0x7729, 0x16B6,
+ 0x772D, 0x470C, 0x772F, 0x4C7C, 0x7734, 0x3A1A, 0x7735, 0x470D,
+ 0x7736, 0x3A1B, 0x7737, 0x16BC, 0x7738, 0x16BD, 0x7739, 0x4C7D,
+ 0x773A, 0x0BCB, 0x773C, 0x061F, 0x773E, 0x4C7E, 0x7740, 0x0BA3,
+ 0x7745, 0x4C7F, 0x7746, 0x217C, 0x7747, 0x16BE, 0x774A, 0x4C80,
+ 0x774D, 0x4267, 0x774E, 0x4268, 0x774F, 0x4C81, 0x7758, 0x4712,
+ 0x775A, 0x16BF, 0x775B, 0x16C2, 0x775C, 0x3A1C, 0x775E, 0x4C82,
+ 0x775F, 0x3A1D, 0x7760, 0x3A1E, 0x7761, 0x0A2D, 0x7762, 0x1EC5,
+ 0x7763, 0x0C9C, 0x7764, 0x4C83, 0x7765, 0x16C3, 0x7766, 0x0E81,
+ 0x7767, 0x4C84, 0x7768, 0x16C0, 0x776A, 0x3755, 0x776B, 0x16C1,
+ 0x776C, 0x4C85, 0x7772, 0x3A1F, 0x7779, 0x16C6, 0x777A, 0x4269,
+ 0x777C, 0x4714, 0x777D, 0x3A20, 0x777E, 0x16C5, 0x777F, 0x16C4,
+ 0x7780, 0x426A, 0x7784, 0x4C86, 0x778B, 0x16C8, 0x778C, 0x4C87,
+ 0x778D, 0x4C88, 0x778E, 0x16C7, 0x7791, 0x16C9, 0x7794, 0x426B,
+ 0x7795, 0x3A21, 0x7796, 0x4C89, 0x779A, 0x4717, 0x779E, 0x16CB,
+ 0x779F, 0x4718, 0x77A0, 0x16CA, 0x77A2, 0x4719, 0x77A4, 0x471A,
+ 0x77A5, 0x0E1D, 0x77A7, 0x4C8A, 0x77A9, 0x3756, 0x77AA, 0x3A22,
+ 0x77AC, 0x0960, 0x77AD, 0x0F8E, 0x77AF, 0x4C8B, 0x77B0, 0x16CC,
+ 0x77B3, 0x0C8F, 0x77B6, 0x16CD, 0x77B7, 0x4C8C, 0x77B9, 0x16CE,
+ 0x77BB, 0x16D2, 0x77BC, 0x16D0, 0x77BD, 0x16D1, 0x77BE, 0x4C8D,
+ 0x77BF, 0x16CF, 0x77C7, 0x16D3, 0x77C9, 0x4C8E, 0x77CD, 0x16D4,
+ 0x77D1, 0x4C8F, 0x77D7, 0x16D5, 0x77D9, 0x4C90, 0x77DA, 0x16D6,
+ 0x77DB, 0x0EC3, 0x77DC, 0x16D7, 0x77DE, 0x471B, 0x77DF, 0x471C,
+ 0x77E0, 0x426C, 0x77E2, 0x0EFC, 0x77E3, 0x16D8, 0x77E4, 0x471D,
+ 0x77E5, 0x0B8C, 0x77E6, 0x3A23, 0x77E7, 0x0D20, 0x77E9, 0x06E3,
+ 0x77EA, 0x471E, 0x77EC, 0x471F, 0x77ED, 0x0B79, 0x77EE, 0x16D9,
+ 0x77EF, 0x06B2, 0x77F0, 0x3A24, 0x77F1, 0x4C91, 0x77F3, 0x0A74,
+ 0x77F4, 0x3A25, 0x77FB, 0x4720, 0x77FC, 0x16DA, 0x7802, 0x082D,
+ 0x7805, 0x4722, 0x7806, 0x3A26, 0x7809, 0x4723, 0x780C, 0x16DB,
+ 0x780D, 0x4724, 0x7812, 0x16DC, 0x7814, 0x075A, 0x7815, 0x0845,
+ 0x7819, 0x4725, 0x7820, 0x16DE, 0x7821, 0x217E, 0x7822, 0x3A27,
+ 0x7825, 0x0C50, 0x7826, 0x0846, 0x7827, 0x0668, 0x782C, 0x4726,
+ 0x782D, 0x3A28, 0x782E, 0x3A29, 0x7830, 0x3A2A, 0x7832, 0x0E52,
+ 0x7834, 0x0D01, 0x7835, 0x3A2B, 0x7837, 0x4C92, 0x783A, 0x0C51,
+ 0x783F, 0x07EE, 0x7843, 0x426E, 0x7845, 0x16E0, 0x7847, 0x4727,
+ 0x784E, 0x217F, 0x784F, 0x341E, 0x7851, 0x3C3C, 0x785C, 0x4C93,
+ 0x785D, 0x09B3, 0x7864, 0x2180, 0x7868, 0x3A2C, 0x786A, 0x4728,
+ 0x786B, 0x0F7A, 0x786C, 0x07D7, 0x786E, 0x426F, 0x786F, 0x075B,
+ 0x7872, 0x0D37, 0x7874, 0x16E2, 0x787A, 0x2181, 0x787C, 0x16E4,
+ 0x787E, 0x4C94, 0x7881, 0x079F, 0x7886, 0x16E3, 0x7887, 0x0C12,
+ 0x788A, 0x472A, 0x788C, 0x16E6, 0x788D, 0x0595, 0x788E, 0x16E1,
+ 0x7891, 0x0D7E, 0x7893, 0x04D2, 0x7894, 0x472B, 0x7895, 0x085C,
+ 0x7897, 0x0FF8, 0x7898, 0x4C95, 0x789A, 0x16E5, 0x789D, 0x472D,
+ 0x789E, 0x3A2D, 0x789F, 0x472E, 0x78A1, 0x4C96, 0x78A3, 0x16E7,
+ 0x78A4, 0x472C, 0x78A7, 0x0E1B, 0x78A9, 0x0A7D, 0x78AA, 0x16E9,
+ 0x78AD, 0x4272, 0x78AF, 0x16EA, 0x78B0, 0x4270, 0x78B1, 0x4C97,
+ 0x78B3, 0x4C98, 0x78B5, 0x16E8, 0x78BA, 0x05AC, 0x78BB, 0x472F,
+ 0x78BC, 0x16F0, 0x78BE, 0x16EF, 0x78C1, 0x08D3, 0x78C5, 0x16F1,
+ 0x78C6, 0x16EC, 0x78C8, 0x3A2E, 0x78C9, 0x4C99, 0x78CA, 0x16F2,
+ 0x78CB, 0x16ED, 0x78CC, 0x3A2F, 0x78CE, 0x3A30, 0x78D0, 0x0D6C,
+ 0x78D1, 0x16EB, 0x78D3, 0x4C9A, 0x78D4, 0x16EE, 0x78D5, 0x4730,
+ 0x78DA, 0x16F5, 0x78E0, 0x3A32, 0x78E1, 0x3A33, 0x78E4, 0x3A31,
+ 0x78E6, 0x4731, 0x78E7, 0x16F4, 0x78E8, 0x0E8F, 0x78EC, 0x16F3,
+ 0x78EF, 0x04AF, 0x78F2, 0x3A34, 0x78F4, 0x16F7, 0x78F7, 0x3A35,
+ 0x78F9, 0x4732, 0x78FA, 0x4733, 0x78FB, 0x3A36, 0x78FD, 0x16F6,
+ 0x78FE, 0x4734, 0x7900, 0x4273, 0x7901, 0x09B4, 0x7907, 0x16F8,
+ 0x790C, 0x4C9B, 0x790E, 0x0AC5, 0x7910, 0x4736, 0x7911, 0x16FA,
+ 0x7912, 0x16F9, 0x7919, 0x16FB, 0x791B, 0x4737, 0x791C, 0x4274,
+ 0x791F, 0x4C9C, 0x7925, 0x4738, 0x7926, 0x16DD, 0x7927, 0x4C9D,
+ 0x7928, 0x4C9E, 0x792A, 0x16DF, 0x792B, 0x16FD, 0x792C, 0x16FC,
+ 0x792E, 0x4275, 0x7930, 0x2182, 0x7931, 0x3A37, 0x7934, 0x4276,
+ 0x793A, 0x08D4, 0x793B, 0x3A39, 0x793C, 0x0FB1, 0x793D, 0x3A3A,
+ 0x793E, 0x08FE, 0x793F, 0x4C9F, 0x7940, 0x16FE, 0x7941, 0x070D,
+ 0x7942, 0x4CA0, 0x7945, 0x3A3B, 0x7946, 0x4277, 0x7947, 0x065A,
+ 0x7948, 0x0641, 0x7949, 0x08B1, 0x794A, 0x4739, 0x7950, 0x0F1E,
+ 0x7953, 0x1704, 0x7954, 0x4CA1, 0x7955, 0x1703, 0x7956, 0x0AC6,
+ 0x7957, 0x1700, 0x7958, 0x473A, 0x795A, 0x1702, 0x795B, 0x3A3C,
+ 0x795C, 0x3A3D, 0x795D, 0x0955, 0x795E, 0x0A06, 0x795F, 0x1701,
+ 0x7960, 0x16FF, 0x7962, 0x0CE0, 0x7965, 0x09B5, 0x7967, 0x473C,
+ 0x7968, 0x0DAE, 0x796B, 0x4CA2, 0x796D, 0x0847, 0x7972, 0x473D,
+ 0x7977, 0x0C72, 0x7979, 0x4278, 0x797A, 0x1705, 0x797C, 0x4CA3,
+ 0x797F, 0x1706, 0x7980, 0x171C, 0x7981, 0x06D0, 0x7984, 0x0FE3,
+ 0x7985, 0x0AB7, 0x798A, 0x1707, 0x798B, 0x3A3E, 0x798D, 0x0552,
+ 0x798E, 0x0C13, 0x798F, 0x0DF1, 0x7994, 0x2186, 0x7995, 0x473E,
+ 0x7996, 0x3A3F, 0x7998, 0x3A40, 0x799B, 0x2188, 0x799D, 0x1708,
+ 0x79A1, 0x473F, 0x79A6, 0x0694, 0x79A7, 0x1709, 0x79A9, 0x4740,
+ 0x79AA, 0x170B, 0x79AB, 0x4CA4, 0x79AE, 0x170C, 0x79B0, 0x0CDF,
+ 0x79B1, 0x1E4E, 0x79B3, 0x170D, 0x79B4, 0x4741, 0x79B8, 0x3A41,
+ 0x79B9, 0x170E, 0x79BA, 0x170F, 0x79BB, 0x3A42, 0x79BD, 0x06D1,
+ 0x79BE, 0x0553, 0x79BF, 0x0C9D, 0x79C0, 0x0932, 0x79C1, 0x08B2,
+ 0x79C2, 0x4742, 0x79C4, 0x4CA5, 0x79C7, 0x4743, 0x79C8, 0x4279,
+ 0x79C9, 0x1710, 0x79CA, 0x3A43, 0x79CB, 0x0933, 0x79CC, 0x4744,
+ 0x79CD, 0x4745, 0x79D1, 0x054A, 0x79D2, 0x0DB5, 0x79D4, 0x427B,
+ 0x79D5, 0x1711, 0x79D6, 0x4746, 0x79D8, 0x0D7F, 0x79DA, 0x3A44,
+ 0x79DE, 0x427C, 0x79DF, 0x0AC7, 0x79E1, 0x1714, 0x79E3, 0x1715,
+ 0x79E4, 0x0D1F, 0x79E6, 0x0A07, 0x79E7, 0x1712, 0x79E9, 0x0B9F,
+ 0x79EA, 0x4CA6, 0x79EB, 0x427D, 0x79EC, 0x1713, 0x79ED, 0x427E,
+ 0x79F0, 0x09B6, 0x79FB, 0x04A0, 0x7A00, 0x0643, 0x7A02, 0x4CA7,
+ 0x7A03, 0x3A45, 0x7A05, 0x3633, 0x7A08, 0x1716, 0x7A09, 0x3A46,
+ 0x7A0A, 0x474B, 0x7A0B, 0x0C14, 0x7A0C, 0x4CA8, 0x7A0D, 0x1717,
+ 0x7A0E, 0x0A6B, 0x7A11, 0x3A47, 0x7A14, 0x0EB9, 0x7A15, 0x474C,
+ 0x7A17, 0x0D95, 0x7A18, 0x1718, 0x7A19, 0x1719, 0x7A1A, 0x0B93,
+ 0x7A1B, 0x474D, 0x7A1C, 0x0F8F, 0x7A1E, 0x3A48, 0x7A1F, 0x171B,
+ 0x7A20, 0x171A, 0x7A2D, 0x3A49, 0x7A2E, 0x091B, 0x7A30, 0x4CA9,
+ 0x7A31, 0x171D, 0x7A32, 0x04B4, 0x7A37, 0x1720, 0x7A38, 0x474F,
+ 0x7A39, 0x3A4A, 0x7A3A, 0x4CAA, 0x7A3B, 0x171E, 0x7A3C, 0x0554,
+ 0x7A3D, 0x0724, 0x7A3E, 0x171F, 0x7A3F, 0x07D8, 0x7A40, 0x0804,
+ 0x7A42, 0x0E36, 0x7A43, 0x1721, 0x7A44, 0x4CAB, 0x7A45, 0x3A4B,
+ 0x7A46, 0x0E82, 0x7A47, 0x4750, 0x7A49, 0x1723, 0x7A4C, 0x3A4C,
+ 0x7A4D, 0x0A75, 0x7A4E, 0x04F1, 0x7A4F, 0x053A, 0x7A50, 0x0470,
+ 0x7A56, 0x4751, 0x7A57, 0x1722, 0x7A59, 0x4752, 0x7A5C, 0x4753,
+ 0x7A5D, 0x3A4D, 0x7A5F, 0x4754, 0x7A60, 0x4F56, 0x7A61, 0x1724,
+ 0x7A62, 0x1725, 0x7A63, 0x09DF, 0x7A67, 0x4755, 0x7A69, 0x1726,
+ 0x7A6A, 0x4756, 0x7A6B, 0x05AD, 0x7A6D, 0x3A4F, 0x7A70, 0x1728,
+ 0x7A74, 0x0740, 0x7A75, 0x4757, 0x7A76, 0x0680, 0x7A78, 0x3A50,
+ 0x7A79, 0x1729, 0x7A7A, 0x06ED, 0x7A7D, 0x172A, 0x7A7F, 0x0AA0,
+ 0x7A80, 0x4CAC, 0x7A81, 0x0CA5, 0x7A82, 0x4758, 0x7A83, 0x0A84,
+ 0x7A84, 0x0865, 0x7A85, 0x427F, 0x7A86, 0x4CAD, 0x7A88, 0x172B,
+ 0x7A8A, 0x4759, 0x7A90, 0x475A, 0x7A92, 0x0BA0, 0x7A93, 0x0AED,
+ 0x7A94, 0x4CAE, 0x7A95, 0x172D, 0x7A96, 0x172F, 0x7A97, 0x172C,
+ 0x7A98, 0x172E, 0x7A9F, 0x06F8, 0x7AA0, 0x3A51, 0x7AA3, 0x3A52,
+ 0x7AA9, 0x1730, 0x7AAA, 0x06FC, 0x7AAC, 0x475B, 0x7AAE, 0x0681,
+ 0x7AAF, 0x0F3C, 0x7AB0, 0x1732, 0x7AB3, 0x3A53, 0x7AB5, 0x4CAF,
+ 0x7AB6, 0x1733, 0x7AB9, 0x475E, 0x7ABA, 0x04D0, 0x7ABB, 0x3A54,
+ 0x7ABC, 0x3A55, 0x7ABD, 0x4CB0, 0x7ABE, 0x475F, 0x7ABF, 0x1736,
+ 0x7AC3, 0x05D4, 0x7AC4, 0x1735, 0x7AC5, 0x1734, 0x7AC6, 0x3A56,
+ 0x7AC7, 0x1738, 0x7AC8, 0x1731, 0x7ACA, 0x1739, 0x7ACB, 0x0F71,
+ 0x7ACC, 0x4761, 0x7ACD, 0x173A, 0x7ACE, 0x4281, 0x7ACF, 0x173B,
+ 0x7AD1, 0x2189, 0x7AD2, 0x11C5, 0x7AD3, 0x173D, 0x7AD5, 0x173C,
+ 0x7AD9, 0x173E, 0x7ADA, 0x173F, 0x7ADC, 0x0F7D, 0x7ADD, 0x1740,
+ 0x7ADF, 0x1C08, 0x7AE0, 0x09B7, 0x7AE1, 0x1741, 0x7AE2, 0x1742,
+ 0x7AE3, 0x0961, 0x7AE5, 0x0C90, 0x7AE6, 0x1743, 0x7AE7, 0x218A,
+ 0x7AE8, 0x4762, 0x7AEA, 0x0B66, 0x7AEB, 0x218C, 0x7AED, 0x1744,
+ 0x7AEF, 0x0B7A, 0x7AF0, 0x1745, 0x7AF4, 0x4763, 0x7AF6, 0x069D,
+ 0x7AF8, 0x1076, 0x7AF9, 0x0B9B, 0x7AFA, 0x08DF, 0x7AFD, 0x4282,
+ 0x7AFE, 0x4CB1, 0x7AFF, 0x0604, 0x7B02, 0x1746, 0x7B04, 0x1753,
+ 0x7B06, 0x1749, 0x7B07, 0x3A57, 0x7B08, 0x0682, 0x7B0A, 0x1748,
+ 0x7B0B, 0x1755, 0x7B0F, 0x1747, 0x7B11, 0x09B8, 0x7B12, 0x4283,
+ 0x7B14, 0x3A58, 0x7B18, 0x174B, 0x7B19, 0x174C, 0x7B1B, 0x0C25,
+ 0x7B1E, 0x174D, 0x7B20, 0x05BC, 0x7B25, 0x0A20, 0x7B26, 0x0DD6,
+ 0x7B27, 0x3A59, 0x7B28, 0x174F, 0x7B2A, 0x4768, 0x7B2B, 0x4CB2,
+ 0x7B2C, 0x0B48, 0x7B2D, 0x4284, 0x7B2E, 0x4769, 0x7B2F, 0x476A,
+ 0x7B31, 0x3A5A, 0x7B33, 0x174A, 0x7B35, 0x174E, 0x7B36, 0x1750,
+ 0x7B39, 0x086B, 0x7B3B, 0x4285, 0x7B3D, 0x4767, 0x7B41, 0x476E,
+ 0x7B45, 0x1757, 0x7B46, 0x0DA0, 0x7B47, 0x3A5B, 0x7B48, 0x0D3A,
+ 0x7B49, 0x0C73, 0x7B4B, 0x06D2, 0x7B4C, 0x1756, 0x7B4D, 0x1754,
+ 0x7B4E, 0x3A5C, 0x7B4F, 0x0D49, 0x7B50, 0x1751, 0x7B51, 0x0B9C,
+ 0x7B52, 0x0C75, 0x7B53, 0x375D, 0x7B54, 0x0C74, 0x7B55, 0x4770,
+ 0x7B56, 0x0866, 0x7B5D, 0x1769, 0x7B60, 0x3A5D, 0x7B64, 0x4772,
+ 0x7B65, 0x1759, 0x7B66, 0x4773, 0x7B67, 0x175B, 0x7B69, 0x3A5E,
+ 0x7B6C, 0x175E, 0x7B6D, 0x3A5F, 0x7B6E, 0x175F, 0x7B6F, 0x4286,
+ 0x7B70, 0x175C, 0x7B71, 0x175D, 0x7B72, 0x3A60, 0x7B73, 0x4774,
+ 0x7B74, 0x175A, 0x7B75, 0x1758, 0x7B77, 0x4CB3, 0x7B79, 0x4771,
+ 0x7B7A, 0x1752, 0x7B7F, 0x476D, 0x7B86, 0x0E1F, 0x7B87, 0x0555,
+ 0x7B8B, 0x1766, 0x7B8D, 0x1763, 0x7B8F, 0x1768, 0x7B90, 0x4777,
+ 0x7B91, 0x3A61, 0x7B92, 0x1767, 0x7B94, 0x0D29, 0x7B95, 0x0EB3,
+ 0x7B97, 0x0889, 0x7B98, 0x1761, 0x7B99, 0x176A, 0x7B9A, 0x1765,
+ 0x7B9B, 0x4778, 0x7B9C, 0x1764, 0x7B9D, 0x1760, 0x7B9E, 0x218D,
+ 0x7B9F, 0x1762, 0x7BA0, 0x4CB4, 0x7BA1, 0x0605, 0x7BAA, 0x0B7B,
+ 0x7BAC, 0x4CB5, 0x7BAD, 0x0AA1, 0x7BAF, 0x3A62, 0x7BB0, 0x4CB6,
+ 0x7BB1, 0x0D36, 0x7BB4, 0x176F, 0x7BB5, 0x477A, 0x7BB8, 0x0D38,
+ 0x7BBC, 0x477B, 0x7BC0, 0x0A85, 0x7BC1, 0x176C, 0x7BC4, 0x0D63,
+ 0x7BC5, 0x477C, 0x7BC6, 0x1770, 0x7BC7, 0x0E23, 0x7BC9, 0x0B99,
+ 0x7BCA, 0x477D, 0x7BCB, 0x176B, 0x7BCC, 0x176D, 0x7BCF, 0x176E,
+ 0x7BD4, 0x4780, 0x7BD6, 0x4781, 0x7BD7, 0x3A63, 0x7BD9, 0x3A64,
+ 0x7BDA, 0x4782, 0x7BDD, 0x1771, 0x7BE0, 0x08F0, 0x7BE4, 0x0C9E,
+ 0x7BE5, 0x1776, 0x7BE6, 0x1775, 0x7BE8, 0x4CB7, 0x7BE9, 0x1772,
+ 0x7BEA, 0x4783, 0x7BED, 0x0FDC, 0x7BF0, 0x4784, 0x7BF2, 0x4CB8,
+ 0x7BF3, 0x177B, 0x7BF6, 0x177F, 0x7BF7, 0x177C, 0x7BF8, 0x4CB9,
+ 0x7BFC, 0x4CBA, 0x7BFE, 0x4CBB, 0x7C00, 0x1778, 0x7C01, 0x4287,
+ 0x7C03, 0x4785, 0x7C07, 0x1779, 0x7C09, 0x4CBC, 0x7C0B, 0x3A65,
+ 0x7C0D, 0x177E, 0x7C0E, 0x4786, 0x7C0F, 0x3A66, 0x7C11, 0x1773,
+ 0x7C12, 0x10EA, 0x7C13, 0x177A, 0x7C14, 0x1774, 0x7C17, 0x177D,
+ 0x7C1E, 0x1E3B, 0x7C1F, 0x1783, 0x7C20, 0x3A67, 0x7C21, 0x0606,
+ 0x7C23, 0x1780, 0x7C26, 0x3A68, 0x7C27, 0x1781, 0x7C28, 0x4CBD,
+ 0x7C2A, 0x1782, 0x7C2B, 0x1785, 0x7C2F, 0x4CBE, 0x7C31, 0x3A69,
+ 0x7C33, 0x4288, 0x7C36, 0x3A6A, 0x7C37, 0x1784, 0x7C38, 0x0D8A,
+ 0x7C3D, 0x1786, 0x7C3E, 0x0FC4, 0x7C3F, 0x0E3D, 0x7C40, 0x178B,
+ 0x7C42, 0x4CBF, 0x7C43, 0x1788, 0x7C45, 0x4787, 0x7C4A, 0x4788,
+ 0x7C4C, 0x1787, 0x7C4D, 0x0A76, 0x7C4F, 0x178A, 0x7C50, 0x178C,
+ 0x7C51, 0x3A6B, 0x7C52, 0x4CC0, 0x7C53, 0x4CC1, 0x7C54, 0x1789,
+ 0x7C56, 0x1790, 0x7C57, 0x4789, 0x7C58, 0x178D, 0x7C59, 0x3A6C,
+ 0x7C5B, 0x4CC2, 0x7C5C, 0x4CC3, 0x7C5D, 0x4CC4, 0x7C5E, 0x478A,
+ 0x7C5F, 0x178E, 0x7C60, 0x1777, 0x7C61, 0x478B, 0x7C64, 0x178F,
+ 0x7C65, 0x1791, 0x7C67, 0x3A6D, 0x7C69, 0x478C, 0x7C6C, 0x1792,
+ 0x7C6D, 0x428A, 0x7C6E, 0x3A6E, 0x7C6F, 0x478D, 0x7C70, 0x3A6F,
+ 0x7C72, 0x4CC5, 0x7C73, 0x0E16, 0x7C75, 0x1793, 0x7C79, 0x428B,
+ 0x7C7B, 0x370E, 0x7C7D, 0x4CC6, 0x7C7E, 0x0EEE, 0x7C81, 0x06C6,
+ 0x7C82, 0x06FF, 0x7C83, 0x1794, 0x7C87, 0x4CC7, 0x7C89, 0x0E04,
+ 0x7C8B, 0x0A2E, 0x7C8D, 0x0EBC, 0x7C8F, 0x428C, 0x7C90, 0x1795,
+ 0x7C92, 0x0F7B, 0x7C94, 0x428D, 0x7C95, 0x0D2A, 0x7C97, 0x0AC8,
+ 0x7C98, 0x0CEA, 0x7C9B, 0x0957, 0x7C9E, 0x4CC8, 0x7C9F, 0x0484,
+ 0x7CA0, 0x428E, 0x7CA1, 0x179A, 0x7CA2, 0x1798, 0x7CA4, 0x1796,
+ 0x7CA5, 0x05DD, 0x7CA6, 0x4791, 0x7CA7, 0x09B9, 0x7CA8, 0x179B,
+ 0x7CAB, 0x1799, 0x7CAD, 0x1797, 0x7CAE, 0x179F, 0x7CB1, 0x179E,
+ 0x7CB2, 0x179D, 0x7CB3, 0x179C, 0x7CB6, 0x4793, 0x7CB7, 0x4794,
+ 0x7CB9, 0x17A0, 0x7CBA, 0x4CC9, 0x7CBC, 0x3A70, 0x7CBD, 0x17A1,
+ 0x7CBE, 0x0A5E, 0x7CBF, 0x3A71, 0x7CC0, 0x17A2, 0x7CC2, 0x17A4,
+ 0x7CC4, 0x4796, 0x7CC5, 0x17A3, 0x7CC7, 0x4CCA, 0x7CC8, 0x3A72,
+ 0x7CC9, 0x3A73, 0x7CCA, 0x0786, 0x7CCD, 0x4798, 0x7CCE, 0x0ABA,
+ 0x7CD2, 0x17A6, 0x7CD3, 0x4CCB, 0x7CD5, 0x428F, 0x7CD6, 0x0C76,
+ 0x7CD7, 0x3A74, 0x7CD8, 0x17A5, 0x7CD9, 0x3A75, 0x7CDA, 0x4CCC,
+ 0x7CDC, 0x17A7, 0x7CDD, 0x3A76, 0x7CDE, 0x0E05, 0x7CDF, 0x0AEE,
+ 0x7CE0, 0x07D9, 0x7CE2, 0x17A8, 0x7CE6, 0x479B, 0x7CE7, 0x0F90,
+ 0x7CEB, 0x3A77, 0x7CEF, 0x17AA, 0x7CF2, 0x17AB, 0x7CF4, 0x17AC,
+ 0x7CF5, 0x479D, 0x7CF6, 0x17AD, 0x7CF8, 0x08B3, 0x7CFA, 0x17AE,
+ 0x7CFB, 0x0725, 0x7CFE, 0x0684, 0x7D00, 0x0644, 0x7D02, 0x17B0,
+ 0x7D03, 0x479E, 0x7D04, 0x0EFF, 0x7D05, 0x07DA, 0x7D06, 0x17AF,
+ 0x7D07, 0x3A78, 0x7D08, 0x3A79, 0x7D09, 0x3A7A, 0x7D0A, 0x17B3,
+ 0x7D0B, 0x0EF2, 0x7D0D, 0x0CF2, 0x7D10, 0x0DA5, 0x7D12, 0x47A0,
+ 0x7D13, 0x3A7B, 0x7D14, 0x096D, 0x7D15, 0x17B2, 0x7D17, 0x08FF,
+ 0x7D18, 0x07DB, 0x7D19, 0x08B4, 0x7D1A, 0x0683, 0x7D1B, 0x0E06,
+ 0x7D1C, 0x17B1, 0x7D1D, 0x3A7C, 0x7D1E, 0x47A1, 0x7D20, 0x0AC9,
+ 0x7D21, 0x0E70, 0x7D22, 0x0867, 0x7D23, 0x3A7D, 0x7D2B, 0x08B5,
+ 0x7D2C, 0x0BF9, 0x7D2E, 0x17B6, 0x7D2F, 0x0FA7, 0x7D30, 0x0849,
+ 0x7D31, 0x4290, 0x7D32, 0x17B7, 0x7D33, 0x0A08, 0x7D35, 0x17B9,
+ 0x7D39, 0x09BA, 0x7D3A, 0x0820, 0x7D3C, 0x4CCD, 0x7D3D, 0x47A4,
+ 0x7D3E, 0x47A5, 0x7D3F, 0x17B8, 0x7D40, 0x47A6, 0x7D41, 0x3A7E,
+ 0x7D42, 0x0934, 0x7D43, 0x0772, 0x7D44, 0x0ACA, 0x7D45, 0x17B4,
+ 0x7D46, 0x17BA, 0x7D47, 0x47A7, 0x7D48, 0x218F, 0x7D4B, 0x17B5,
+ 0x7D4C, 0x0726, 0x7D4D, 0x4CCE, 0x7D4E, 0x17BD, 0x7D4F, 0x17C1,
+ 0x7D50, 0x0741, 0x7D53, 0x3A7F, 0x7D55, 0x363A, 0x7D56, 0x17BC,
+ 0x7D59, 0x3A80, 0x7D5A, 0x47AB, 0x7D5B, 0x17C5, 0x7D5C, 0x4291,
+ 0x7D5D, 0x3A81, 0x7D5E, 0x07DC, 0x7D61, 0x0F57, 0x7D62, 0x0480,
+ 0x7D63, 0x17C2, 0x7D66, 0x0685, 0x7D68, 0x17BF, 0x7D6A, 0x47AC,
+ 0x7D6E, 0x17C0, 0x7D70, 0x47AD, 0x7D71, 0x0C77, 0x7D72, 0x17BE,
+ 0x7D73, 0x17BB, 0x7D75, 0x0586, 0x7D76, 0x0A88, 0x7D79, 0x075C,
+ 0x7D7A, 0x3A82, 0x7D7D, 0x17C7, 0x7D7F, 0x47AF, 0x7D82, 0x4CCF,
+ 0x7D83, 0x4292, 0x7D85, 0x4CD0, 0x7D86, 0x3A83, 0x7D88, 0x47B1,
+ 0x7D89, 0x17C4, 0x7D8B, 0x3A84, 0x7D8C, 0x3A85, 0x7D8D, 0x4CD1,
+ 0x7D8F, 0x17C6, 0x7D91, 0x4CD2, 0x7D93, 0x17C3, 0x7D97, 0x47B2,
+ 0x7D99, 0x0727, 0x7D9A, 0x0B13, 0x7D9B, 0x17C8, 0x7D9C, 0x0AF0,
+ 0x7D9D, 0x47B4, 0x7D9E, 0x4CD3, 0x7D9F, 0x17D5, 0x7DA0, 0x2192,
+ 0x7DA2, 0x17D1, 0x7DA3, 0x17CB, 0x7DA6, 0x4293, 0x7DA7, 0x47B5,
+ 0x7DAA, 0x47B6, 0x7DAB, 0x17CF, 0x7DAC, 0x0926, 0x7DAD, 0x04A1,
+ 0x7DAE, 0x17CA, 0x7DAF, 0x17D2, 0x7DB0, 0x17D6, 0x7DB1, 0x07DD,
+ 0x7DB2, 0x0EE2, 0x7DB3, 0x4CD4, 0x7DB4, 0x0BF2, 0x7DB5, 0x17CC,
+ 0x7DB6, 0x47B7, 0x7DB7, 0x2191, 0x7DB8, 0x17D4, 0x7DB9, 0x4CD5,
+ 0x7DBA, 0x17C9, 0x7DBB, 0x0B7C, 0x7DBD, 0x17CE, 0x7DBE, 0x0481,
+ 0x7DBF, 0x0ED6, 0x7DC0, 0x47B8, 0x7DC2, 0x4294, 0x7DC7, 0x17CD,
+ 0x7DCA, 0x06D3, 0x7DCB, 0x0D80, 0x7DCC, 0x3A86, 0x7DCF, 0x0AEF,
+ 0x7DD0, 0x4CD6, 0x7DD1, 0x0F98, 0x7DD2, 0x0979, 0x7DD5, 0x17FD,
+ 0x7DD6, 0x2193, 0x7DD7, 0x47B9, 0x7DD8, 0x17D7, 0x7DD9, 0x47BA,
+ 0x7DDA, 0x0AA2, 0x7DDC, 0x17D3, 0x7DDD, 0x17D8, 0x7DDE, 0x17DA,
+ 0x7DE0, 0x0C15, 0x7DE1, 0x17DD, 0x7DE3, 0x340A, 0x7DE4, 0x17D9,
+ 0x7DE5, 0x4CD7, 0x7DE6, 0x47BB, 0x7DE8, 0x0E24, 0x7DE9, 0x0607,
+ 0x7DEB, 0x3A87, 0x7DEC, 0x0ED7, 0x7DEF, 0x04A2, 0x7DF1, 0x3A88,
+ 0x7DF2, 0x17DC, 0x7DF4, 0x0FC5, 0x7DF5, 0x4CD8, 0x7DF6, 0x4CD9,
+ 0x7DF9, 0x3A89, 0x7DFB, 0x17DB, 0x7E01, 0x0511, 0x7E04, 0x0CC4,
+ 0x7E05, 0x17DE, 0x7E08, 0x3A8A, 0x7E09, 0x17E5, 0x7E0A, 0x17DF,
+ 0x7E0B, 0x17E6, 0x7E10, 0x47BF, 0x7E11, 0x3A8B, 0x7E12, 0x17E2,
+ 0x7E15, 0x3A8C, 0x7E17, 0x47C0, 0x7E1B, 0x0D31, 0x7E1D, 0x47C1,
+ 0x7E1E, 0x08F6, 0x7E1F, 0x17E4, 0x7E20, 0x3A8D, 0x7E21, 0x17E1,
+ 0x7E22, 0x17E7, 0x7E23, 0x17E0, 0x7E26, 0x094E, 0x7E27, 0x47C2,
+ 0x7E28, 0x4295, 0x7E2B, 0x0E53, 0x7E2C, 0x47C3, 0x7E2E, 0x0956,
+ 0x7E2F, 0x4CDA, 0x7E31, 0x17E3, 0x7E32, 0x17EF, 0x7E35, 0x17EB,
+ 0x7E36, 0x4CDB, 0x7E37, 0x17EE, 0x7E39, 0x17EC, 0x7E3A, 0x17F0,
+ 0x7E3B, 0x17EA, 0x7E3D, 0x17D0, 0x7E3E, 0x0A77, 0x7E41, 0x0D5F,
+ 0x7E43, 0x17ED, 0x7E44, 0x4CDC, 0x7E45, 0x47C4, 0x7E46, 0x17E8,
+ 0x7E47, 0x3A8E, 0x7E48, 0x3767, 0x7E4A, 0x0AA3, 0x7E4B, 0x0728,
+ 0x7E4D, 0x0935, 0x7E52, 0x2194, 0x7E54, 0x09EB, 0x7E55, 0x0AB8,
+ 0x7E56, 0x17F3, 0x7E59, 0x17F5, 0x7E5A, 0x17F6, 0x7E5D, 0x17F2,
+ 0x7E5E, 0x17F4, 0x7E61, 0x1E11, 0x7E62, 0x3A8F, 0x7E66, 0x17E9,
+ 0x7E67, 0x17F1, 0x7E69, 0x17F9, 0x7E6A, 0x17F8, 0x7E6B, 0x1DF7,
+ 0x7E6D, 0x0EA8, 0x7E6E, 0x3A90, 0x7E6F, 0x4CDD, 0x7E70, 0x0701,
+ 0x7E73, 0x3A91, 0x7E75, 0x47C5, 0x7E78, 0x4CDE, 0x7E79, 0x17F7,
+ 0x7E7B, 0x17FB, 0x7E7C, 0x17FA, 0x7E7D, 0x17FE, 0x7E7E, 0x47C6,
+ 0x7E7F, 0x1800, 0x7E81, 0x4CDF, 0x7E82, 0x088A, 0x7E83, 0x17FC,
+ 0x7E86, 0x47C7, 0x7E87, 0x47C8, 0x7E88, 0x1801, 0x7E89, 0x1802,
+ 0x7E8A, 0x20A7, 0x7E8C, 0x1803, 0x7E8D, 0x3A92, 0x7E8E, 0x1809,
+ 0x7E8F, 0x0C35, 0x7E90, 0x1805, 0x7E91, 0x3A93, 0x7E92, 0x1804,
+ 0x7E93, 0x1806, 0x7E94, 0x1807, 0x7E96, 0x1808, 0x7E98, 0x3A94,
+ 0x7E9A, 0x47CA, 0x7E9B, 0x180A, 0x7E9C, 0x180B, 0x7F36, 0x0608,
+ 0x7F38, 0x180C, 0x7F3A, 0x180D, 0x7F3B, 0x47CD, 0x7F3C, 0x47CC,
+ 0x7F3D, 0x4CE0, 0x7F3E, 0x47CE, 0x7F43, 0x47CF, 0x7F44, 0x3A95,
+ 0x7F45, 0x180E, 0x7F47, 0x2195, 0x7F4C, 0x180F, 0x7F4D, 0x1810,
+ 0x7F4E, 0x1811, 0x7F4F, 0x3A96, 0x7F50, 0x1812, 0x7F51, 0x1813,
+ 0x7F52, 0x3A97, 0x7F53, 0x3A98, 0x7F54, 0x1815, 0x7F55, 0x1814,
+ 0x7F58, 0x1816, 0x7F5B, 0x4CE1, 0x7F5D, 0x4CE2, 0x7F5F, 0x1817,
+ 0x7F60, 0x1818, 0x7F61, 0x3A99, 0x7F63, 0x47D3, 0x7F64, 0x47D4,
+ 0x7F65, 0x4CE3, 0x7F67, 0x181B, 0x7F68, 0x1819, 0x7F69, 0x181A,
+ 0x7F6A, 0x0851, 0x7F6B, 0x0729, 0x7F6D, 0x47D5, 0x7F6E, 0x0B94,
+ 0x7F70, 0x0D47, 0x7F71, 0x4CE4, 0x7F72, 0x097A, 0x7F75, 0x0D03,
+ 0x7F77, 0x0D81, 0x7F78, 0x181C, 0x7F79, 0x1336, 0x7F7D, 0x47D6,
+ 0x7F7E, 0x47D7, 0x7F7F, 0x4CE5, 0x7F80, 0x4CE6, 0x7F82, 0x181D,
+ 0x7F83, 0x181F, 0x7F85, 0x0F4F, 0x7F86, 0x181E, 0x7F87, 0x1821,
+ 0x7F88, 0x1820, 0x7F8A, 0x0F3D, 0x7F8B, 0x4CE7, 0x7F8C, 0x1822,
+ 0x7F8E, 0x0D92, 0x7F90, 0x47D8, 0x7F91, 0x3A9A, 0x7F94, 0x1823,
+ 0x7F96, 0x47DB, 0x7F97, 0x4296, 0x7F9A, 0x1826, 0x7F9C, 0x47DC,
+ 0x7F9D, 0x1825, 0x7F9E, 0x1824, 0x7FA1, 0x2196, 0x7FA2, 0x4CE8,
+ 0x7FA3, 0x1827, 0x7FA4, 0x0708, 0x7FA8, 0x0AA4, 0x7FA9, 0x065B,
+ 0x7FAD, 0x47DD, 0x7FAE, 0x182B, 0x7FAF, 0x1828, 0x7FB2, 0x1829,
+ 0x7FB6, 0x182C, 0x7FB8, 0x182D, 0x7FB9, 0x182A, 0x7FBD, 0x04CB,
+ 0x7FBF, 0x3A9B, 0x7FC1, 0x0527, 0x7FC3, 0x47DF, 0x7FC5, 0x182F,
+ 0x7FC6, 0x1830, 0x7FCA, 0x1831, 0x7FCC, 0x0F4C, 0x7FCE, 0x3A9C,
+ 0x7FCF, 0x47E0, 0x7FD2, 0x0936, 0x7FD4, 0x1833, 0x7FD5, 0x1832,
+ 0x7FDB, 0x4297, 0x7FDF, 0x3A9D, 0x7FE0, 0x0A2F, 0x7FE1, 0x1834,
+ 0x7FE3, 0x47E1, 0x7FE5, 0x3A9E, 0x7FE6, 0x1835, 0x7FE9, 0x1836,
+ 0x7FEB, 0x0621, 0x7FEC, 0x3A9F, 0x7FEE, 0x3AA0, 0x7FEF, 0x3AA1,
+ 0x7FF0, 0x0609, 0x7FF2, 0x47E2, 0x7FF3, 0x1837, 0x7FF9, 0x1838,
+ 0x7FFA, 0x3AA2, 0x7FFB, 0x0E8B, 0x7FFC, 0x0F4D, 0x7FFD, 0x4CE9,
+ 0x7FFE, 0x4CEA, 0x7FFF, 0x4CEB, 0x8000, 0x0F3E, 0x8001, 0x0FDD,
+ 0x8002, 0x3713, 0x8003, 0x07DF, 0x8004, 0x183B, 0x8005, 0x0900,
+ 0x8006, 0x183A, 0x8007, 0x4CEC, 0x8008, 0x47E4, 0x800A, 0x47E3,
+ 0x800B, 0x183C, 0x800C, 0x08D5, 0x800D, 0x4CED, 0x800E, 0x3AA3,
+ 0x8010, 0x0B31, 0x8011, 0x3AA4, 0x8012, 0x183D, 0x8014, 0x3AA5,
+ 0x8015, 0x07DE, 0x8016, 0x47E5, 0x8017, 0x0EE3, 0x8018, 0x183E,
+ 0x8019, 0x183F, 0x801C, 0x1840, 0x801E, 0x4CEE, 0x8021, 0x1841,
+ 0x8024, 0x3AA6, 0x8026, 0x3AA7, 0x8028, 0x1842, 0x802C, 0x47E6,
+ 0x8030, 0x47E7, 0x8033, 0x08D6, 0x8035, 0x4298, 0x8036, 0x0EF9,
+ 0x8037, 0x4299, 0x8039, 0x4CEF, 0x803A, 0x3AA8, 0x803B, 0x1844,
+ 0x803C, 0x3AA9, 0x803D, 0x0B7D, 0x803F, 0x1843, 0x8043, 0x47E8,
+ 0x8046, 0x1846, 0x804A, 0x1845, 0x8052, 0x1847, 0x8056, 0x0A5F,
+ 0x8058, 0x1848, 0x805A, 0x1849, 0x805E, 0x0E09, 0x805F, 0x184A,
+ 0x8060, 0x3AAA, 0x8061, 0x0AF1, 0x8062, 0x184B, 0x8066, 0x47E9,
+ 0x8068, 0x184C, 0x806F, 0x0FC6, 0x8070, 0x184F, 0x8071, 0x3AAB,
+ 0x8072, 0x184E, 0x8073, 0x184D, 0x8074, 0x0BCC, 0x8075, 0x3AAC,
+ 0x8076, 0x1850, 0x8077, 0x09EC, 0x8079, 0x1851, 0x807B, 0x47EA,
+ 0x807D, 0x1852, 0x807E, 0x0FDE, 0x807F, 0x1853, 0x8084, 0x1854,
+ 0x8085, 0x1856, 0x8086, 0x1855, 0x8087, 0x0D39, 0x8088, 0x4CF0,
+ 0x8089, 0x0CD1, 0x808B, 0x0FE4, 0x808C, 0x0D3D, 0x808E, 0x4CF1,
+ 0x8093, 0x1858, 0x8096, 0x09BB, 0x8098, 0x0D9C, 0x8099, 0x47EB,
+ 0x809A, 0x1859, 0x809B, 0x1857, 0x809C, 0x47EC, 0x809D, 0x060A,
+ 0x809E, 0x3AAD, 0x80A1, 0x0788, 0x80A2, 0x08B6, 0x80A4, 0x47ED,
+ 0x80A5, 0x0D82, 0x80A6, 0x3AAE, 0x80A7, 0x47EE, 0x80A9, 0x075E,
+ 0x80AA, 0x0E71, 0x80AB, 0x3AAF, 0x80AC, 0x185C, 0x80AD, 0x185A,
+ 0x80AF, 0x07E0, 0x80B1, 0x07E1, 0x80B2, 0x04AD, 0x80B4, 0x0858,
+ 0x80B8, 0x47EF, 0x80BA, 0x0D0F, 0x80C3, 0x04A3, 0x80C4, 0x1861,
+ 0x80C5, 0x47F1, 0x80C6, 0x0B7E, 0x80CA, 0x429A, 0x80CC, 0x0D0E,
+ 0x80CE, 0x0B3B, 0x80CF, 0x4CF2, 0x80D4, 0x4CF3, 0x80D5, 0x47F2,
+ 0x80D6, 0x1863, 0x80D7, 0x3AB0, 0x80D8, 0x3AB1, 0x80D9, 0x185F,
+ 0x80DA, 0x1862, 0x80DB, 0x185D, 0x80DD, 0x1860, 0x80DE, 0x0E54,
+ 0x80E0, 0x429B, 0x80E1, 0x0789, 0x80E4, 0x04C1, 0x80E5, 0x185E,
+ 0x80E6, 0x47F3, 0x80ED, 0x4CF4, 0x80EF, 0x1865, 0x80F0, 0x4CF5,
+ 0x80F1, 0x1866, 0x80F3, 0x429C, 0x80F4, 0x0C91, 0x80F5, 0x47F5,
+ 0x80F7, 0x4CF6, 0x80F8, 0x06B3, 0x80FA, 0x4CF7, 0x80FB, 0x47F6,
+ 0x80FC, 0x1871, 0x80FD, 0x0CF3, 0x80FE, 0x4CF8, 0x8102, 0x08B7,
+ 0x8103, 0x4CF9, 0x8105, 0x06B4, 0x8106, 0x0A6C, 0x8107, 0x0FEC,
+ 0x8108, 0x0EBA, 0x8109, 0x1864, 0x810A, 0x0A78, 0x810D, 0x47F4,
+ 0x8116, 0x3AB2, 0x8117, 0x4CFA, 0x8118, 0x3AB3, 0x811A, 0x066D,
+ 0x811B, 0x1867, 0x811E, 0x47F9, 0x8123, 0x1869, 0x8124, 0x47FB,
+ 0x8127, 0x47FC, 0x8129, 0x1868, 0x812B, 0x3659, 0x812C, 0x47FD,
+ 0x812F, 0x186A, 0x8130, 0x4CFB, 0x8131, 0x0B64, 0x8133, 0x0CF4,
+ 0x8135, 0x47F8, 0x8139, 0x0BCD, 0x813A, 0x3AB4, 0x813D, 0x47FF,
+ 0x813E, 0x186E, 0x8141, 0x3772, 0x8146, 0x186D, 0x814A, 0x3AB5,
+ 0x814B, 0x186B, 0x814C, 0x3AB6, 0x814E, 0x0A1B, 0x8150, 0x0DD7,
+ 0x8151, 0x1870, 0x8153, 0x186F, 0x8154, 0x07E2, 0x8155, 0x0FF9,
+ 0x8157, 0x4CFC, 0x815F, 0x1880, 0x8160, 0x429D, 0x8165, 0x1874,
+ 0x8166, 0x1875, 0x8167, 0x429E, 0x8168, 0x429F, 0x8169, 0x4801,
+ 0x816B, 0x091C, 0x816D, 0x42A0, 0x816E, 0x1873, 0x816F, 0x4CFD,
+ 0x8170, 0x080A, 0x8171, 0x1872, 0x8173, 0x4CFE, 0x8174, 0x1876,
+ 0x8178, 0x0BCE, 0x8179, 0x0DF2, 0x817A, 0x0AA5, 0x817F, 0x0B3C,
+ 0x8180, 0x187A, 0x8181, 0x3AB7, 0x8182, 0x187B, 0x8183, 0x1877,
+ 0x8184, 0x3AB8, 0x8185, 0x4804, 0x8188, 0x1878, 0x818A, 0x1879,
+ 0x818B, 0x4CFF, 0x818F, 0x07E3, 0x8190, 0x4D00, 0x8193, 0x1881,
+ 0x8195, 0x187D, 0x8198, 0x4806, 0x819A, 0x0DD8, 0x819B, 0x4D01,
+ 0x819C, 0x0E9A, 0x819D, 0x0D9A, 0x819E, 0x4D02, 0x81A0, 0x187C,
+ 0x81A3, 0x187F, 0x81A4, 0x187E, 0x81A8, 0x0E72, 0x81A9, 0x1882,
+ 0x81B0, 0x1883, 0x81B2, 0x4807, 0x81B3, 0x0AB9, 0x81B4, 0x3AB9,
+ 0x81B5, 0x1884, 0x81B8, 0x1886, 0x81BA, 0x188A, 0x81BB, 0x42A1,
+ 0x81BD, 0x1887, 0x81BE, 0x1885, 0x81BF, 0x0CF5, 0x81C0, 0x1888,
+ 0x81C1, 0x4808, 0x81C2, 0x1889, 0x81C3, 0x4809, 0x81C6, 0x0532,
+ 0x81C8, 0x1890, 0x81C9, 0x188B, 0x81CA, 0x42A2, 0x81CB, 0x4D03,
+ 0x81CD, 0x188C, 0x81CF, 0x3ABA, 0x81D1, 0x188D, 0x81D3, 0x0B01,
+ 0x81D5, 0x4D04, 0x81D6, 0x480A, 0x81D7, 0x42A3, 0x81D8, 0x188F,
+ 0x81D9, 0x188E, 0x81DA, 0x1891, 0x81DB, 0x480B, 0x81DD, 0x4D05,
+ 0x81DE, 0x4D06, 0x81DF, 0x1892, 0x81E0, 0x1893, 0x81E1, 0x4D07,
+ 0x81E3, 0x0A09, 0x81E4, 0x480D, 0x81E5, 0x0569, 0x81E7, 0x1894,
+ 0x81E8, 0x0F9F, 0x81EA, 0x08D7, 0x81EC, 0x480F, 0x81ED, 0x0937,
+ 0x81EF, 0x4D08, 0x81F3, 0x08B8, 0x81F4, 0x0B95, 0x81F6, 0x4D09,
+ 0x81F9, 0x3ABB, 0x81FA, 0x1895, 0x81FB, 0x1896, 0x81FC, 0x04D3,
+ 0x81FD, 0x4810, 0x81FE, 0x1897, 0x81FF, 0x4811, 0x8200, 0x4D0A,
+ 0x8201, 0x1898, 0x8202, 0x1899, 0x8203, 0x3ABC, 0x8204, 0x4813,
+ 0x8205, 0x189A, 0x8207, 0x189B, 0x8208, 0x06B5, 0x8209, 0x13AF,
+ 0x820A, 0x189C, 0x820B, 0x4D0B, 0x820C, 0x0A89, 0x820D, 0x189D,
+ 0x820E, 0x08F7, 0x8210, 0x189E, 0x8212, 0x1009, 0x8213, 0x4D0C,
+ 0x8214, 0x4D0D, 0x8216, 0x189F, 0x8217, 0x0E2E, 0x8218, 0x0618,
+ 0x8219, 0x4815, 0x821A, 0x4D0E, 0x821B, 0x0AA6, 0x821C, 0x0962,
+ 0x821E, 0x0DE3, 0x821F, 0x0938, 0x8221, 0x3ABD, 0x8222, 0x4816,
+ 0x8229, 0x18A0, 0x822A, 0x07E4, 0x822B, 0x18A1, 0x822C, 0x0D60,
+ 0x822E, 0x18AF, 0x8232, 0x3ABE, 0x8233, 0x18A3, 0x8234, 0x3ABF,
+ 0x8235, 0x0B29, 0x8236, 0x0D2B, 0x8237, 0x0773, 0x8238, 0x18A2,
+ 0x8239, 0x0AA7, 0x823A, 0x4D0F, 0x823C, 0x4818, 0x8240, 0x18A4,
+ 0x8244, 0x4D10, 0x8245, 0x481A, 0x8246, 0x3AC0, 0x8247, 0x0C16,
+ 0x8249, 0x4819, 0x824B, 0x3AC1, 0x824F, 0x3AC2, 0x8257, 0x481E,
+ 0x8258, 0x18A6, 0x8259, 0x18A5, 0x825A, 0x18A8, 0x825C, 0x4820,
+ 0x825D, 0x18A7, 0x825F, 0x18A9, 0x8260, 0x42A5, 0x8262, 0x18AB,
+ 0x8263, 0x4821, 0x8264, 0x18AA, 0x8266, 0x060B, 0x8268, 0x18AC,
+ 0x826A, 0x18AD, 0x826B, 0x18AE, 0x826D, 0x4D11, 0x826E, 0x0821,
+ 0x826F, 0x0F91, 0x8271, 0x18B0, 0x8272, 0x09ED, 0x8274, 0x42A6,
+ 0x8276, 0x0512, 0x8277, 0x18B1, 0x8278, 0x18B2, 0x8279, 0x3775,
+ 0x827D, 0x4824, 0x827E, 0x18B3, 0x827F, 0x4825, 0x8283, 0x4826,
+ 0x8284, 0x4D12, 0x8289, 0x4D13, 0x828A, 0x4827, 0x828B, 0x04B6,
+ 0x828D, 0x18B4, 0x828E, 0x3AC3, 0x8291, 0x4D14, 0x8292, 0x18B5,
+ 0x8293, 0x4828, 0x8299, 0x0DD9, 0x829D, 0x08F3, 0x829F, 0x18B7,
+ 0x82A1, 0x42A8, 0x82A3, 0x42A9, 0x82A4, 0x42AA, 0x82A5, 0x0587,
+ 0x82A6, 0x0476, 0x82A7, 0x4829, 0x82A8, 0x482A, 0x82A9, 0x42AB,
+ 0x82AA, 0x4D15, 0x82AB, 0x18B6, 0x82AC, 0x18B9, 0x82AD, 0x0D04,
+ 0x82AE, 0x3AC4, 0x82AF, 0x0A0A, 0x82B0, 0x4D16, 0x82B1, 0x0556,
+ 0x82B2, 0x482B, 0x82B3, 0x0E55, 0x82B4, 0x482C, 0x82B7, 0x3AC5,
+ 0x82B8, 0x0733, 0x82B9, 0x06D4, 0x82BA, 0x482D, 0x82BB, 0x18B8,
+ 0x82BC, 0x482E, 0x82BD, 0x056A, 0x82BE, 0x3AC6, 0x82BF, 0x42AC,
+ 0x82C5, 0x05DF, 0x82C6, 0x3AC7, 0x82D0, 0x4D17, 0x82D1, 0x0513,
+ 0x82D2, 0x18BD, 0x82D3, 0x0FB2, 0x82D4, 0x0B3D, 0x82D5, 0x42AD,
+ 0x82D7, 0x0DB6, 0x82D9, 0x18C9, 0x82DB, 0x0557, 0x82DC, 0x18C7,
+ 0x82DE, 0x18C5, 0x82DF, 0x18BC, 0x82E1, 0x18BA, 0x82E2, 0x482F,
+ 0x82E3, 0x18BB, 0x82E5, 0x090F, 0x82E6, 0x06E4, 0x82E7, 0x0BB5,
+ 0x82E8, 0x4830, 0x82EA, 0x4D18, 0x82EB, 0x0CA9, 0x82EF, 0x4D19,
+ 0x82F1, 0x04F3, 0x82F3, 0x18BF, 0x82F4, 0x18BE, 0x82F6, 0x4D1A,
+ 0x82F7, 0x4831, 0x82F9, 0x18C4, 0x82FA, 0x18C0, 0x82FB, 0x18C3,
+ 0x82FD, 0x42AE, 0x82FE, 0x3AC8, 0x8300, 0x42AF, 0x8301, 0x2198,
+ 0x8302, 0x0EDC, 0x8303, 0x18C2, 0x8304, 0x0558, 0x8305, 0x05DB,
+ 0x8306, 0x18C6, 0x8307, 0x4832, 0x8308, 0x4833, 0x8309, 0x18C8,
+ 0x830C, 0x4834, 0x830E, 0x072A, 0x8316, 0x18CC, 0x8317, 0x18D5,
+ 0x8318, 0x18D6, 0x831B, 0x4836, 0x831C, 0x046F, 0x831D, 0x4837,
+ 0x8322, 0x42B0, 0x8323, 0x18DD, 0x8328, 0x04B5, 0x832B, 0x18D4,
+ 0x832D, 0x42B1, 0x832F, 0x18D3, 0x8330, 0x4838, 0x8331, 0x18CE,
+ 0x8332, 0x18CD, 0x8334, 0x18CB, 0x8335, 0x18CA, 0x8336, 0x0BA1,
+ 0x8338, 0x0B5B, 0x8339, 0x18D0, 0x833A, 0x42B2, 0x833C, 0x4839,
+ 0x8340, 0x18CF, 0x8343, 0x3AC9, 0x8344, 0x483A, 0x8345, 0x18D2,
+ 0x8346, 0x1DF8, 0x8347, 0x42B3, 0x8349, 0x0AF2, 0x834A, 0x072B,
+ 0x834F, 0x04E3, 0x8350, 0x18D1, 0x8351, 0x3ACA, 0x8352, 0x07E5,
+ 0x8354, 0x4835, 0x8355, 0x3ACB, 0x8356, 0x4D1B, 0x8357, 0x483B,
+ 0x8358, 0x0AF3, 0x835A, 0x377A, 0x8362, 0x2199, 0x8363, 0x456F,
+ 0x8373, 0x18E3, 0x8375, 0x18E4, 0x8377, 0x0559, 0x8378, 0x4D1C,
+ 0x837B, 0x052E, 0x837C, 0x18E1, 0x837D, 0x42B4, 0x837F, 0x219A,
+ 0x8385, 0x18D7, 0x8386, 0x3ACC, 0x8387, 0x18DF, 0x8389, 0x18E6,
+ 0x838A, 0x18E0, 0x838D, 0x3ACD, 0x838E, 0x18DE, 0x8392, 0x3ACE,
+ 0x8393, 0x18C1, 0x8394, 0x483F, 0x8395, 0x4840, 0x8396, 0x18DC,
+ 0x8398, 0x3ACF, 0x839A, 0x18D8, 0x839B, 0x4841, 0x839D, 0x4842,
+ 0x839E, 0x060C, 0x839F, 0x18DA, 0x83A0, 0x18E5, 0x83A2, 0x18DB,
+ 0x83A7, 0x42B5, 0x83A8, 0x18E7, 0x83A9, 0x3AD0, 0x83AA, 0x18D9,
+ 0x83AB, 0x0D32, 0x83B1, 0x0F53, 0x83B5, 0x18E2, 0x83BD, 0x18F8,
+ 0x83BF, 0x3AD1, 0x83C0, 0x3AD2, 0x83C1, 0x18F0, 0x83C5, 0x0A41,
+ 0x83C7, 0x219B, 0x83C9, 0x4843, 0x83CA, 0x0660, 0x83CC, 0x06D5,
+ 0x83CE, 0x18EB, 0x83CF, 0x42B6, 0x83D0, 0x4844, 0x83D1, 0x42B7,
+ 0x83D3, 0x055B, 0x83D4, 0x4845, 0x83D6, 0x09BC, 0x83D8, 0x18EE,
+ 0x83DC, 0x084A, 0x83DD, 0x4846, 0x83DF, 0x0C4B, 0x83E0, 0x18F3,
+ 0x83E1, 0x42B8, 0x83E5, 0x4847, 0x83E9, 0x0E3E, 0x83EA, 0x3AD3,
+ 0x83EB, 0x18EA, 0x83EF, 0x055A, 0x83F0, 0x078A, 0x83F1, 0x0D9B,
+ 0x83F2, 0x18F4, 0x83F4, 0x18E8, 0x83F6, 0x219C, 0x83F7, 0x18F1,
+ 0x83F8, 0x4D1D, 0x83F9, 0x4848, 0x83FB, 0x18FB, 0x83FC, 0x4D1E,
+ 0x83FD, 0x18EC, 0x8401, 0x42B9, 0x8403, 0x18ED, 0x8404, 0x0C92,
+ 0x8406, 0x42BA, 0x8407, 0x18F2, 0x840A, 0x1E7F, 0x840B, 0x18EF,
+ 0x840C, 0x0E56, 0x840D, 0x18F5, 0x840E, 0x04A4, 0x840F, 0x3AD4,
+ 0x8411, 0x3AD5, 0x8413, 0x18E9, 0x8415, 0x4849, 0x8417, 0x484B,
+ 0x8420, 0x18F7, 0x8422, 0x18F6, 0x8429, 0x0D21, 0x842A, 0x18FD,
+ 0x842C, 0x1908, 0x8431, 0x05DC, 0x8435, 0x190B, 0x8438, 0x18F9,
+ 0x8439, 0x484C, 0x843C, 0x18FE, 0x843D, 0x0F58, 0x8446, 0x1907,
+ 0x8448, 0x219D, 0x8449, 0x0F3F, 0x844A, 0x3AD6, 0x844E, 0x0F72,
+ 0x844F, 0x484D, 0x8451, 0x484E, 0x8452, 0x484F, 0x8457, 0x0BB6,
+ 0x8458, 0x4D1F, 0x8459, 0x4850, 0x845A, 0x4851, 0x845B, 0x05C9,
+ 0x845C, 0x4852, 0x845F, 0x42BB, 0x8461, 0x0DE4, 0x8462, 0x190D,
+ 0x8463, 0x0C79, 0x8465, 0x4854, 0x8466, 0x0475, 0x8469, 0x1906,
+ 0x846B, 0x1902, 0x846C, 0x0AF4, 0x846D, 0x18FC, 0x846E, 0x1904,
+ 0x846F, 0x1909, 0x8470, 0x42BC, 0x8471, 0x0CE2, 0x8473, 0x42BD,
+ 0x8475, 0x046E, 0x8476, 0x3AD7, 0x8477, 0x1901, 0x8478, 0x4855,
+ 0x8479, 0x190A, 0x847A, 0x0DEA, 0x847C, 0x4856, 0x8481, 0x4857,
+ 0x8482, 0x1905, 0x8484, 0x1900, 0x8485, 0x42BE, 0x848B, 0x09BD,
+ 0x8490, 0x0939, 0x8493, 0x4D20, 0x8494, 0x08D8, 0x8497, 0x4859,
+ 0x8499, 0x0EE4, 0x849C, 0x0DB9, 0x849E, 0x42BF, 0x849F, 0x1910,
+ 0x84A1, 0x1919, 0x84A6, 0x485A, 0x84A8, 0x3AD8, 0x84AD, 0x1903,
+ 0x84AF, 0x3AD9, 0x84B1, 0x4D21, 0x84B2, 0x05D5, 0x84B4, 0x219E,
+ 0x84B8, 0x09E0, 0x84B9, 0x190E, 0x84BA, 0x42C0, 0x84BB, 0x1913,
+ 0x84BC, 0x0AF5, 0x84BD, 0x4D22, 0x84BE, 0x485B, 0x84BF, 0x190F,
+ 0x84C0, 0x3ADA, 0x84C1, 0x1916, 0x84C2, 0x3ADB, 0x84C4, 0x0B9D,
+ 0x84C6, 0x1917, 0x84C9, 0x0F40, 0x84CA, 0x190C, 0x84CB, 0x0596,
+ 0x84CD, 0x1912, 0x84CE, 0x485D, 0x84CF, 0x485E, 0x84D0, 0x1915,
+ 0x84D1, 0x0EB8, 0x84D3, 0x485F, 0x84D6, 0x1918, 0x84D9, 0x1911,
+ 0x84DA, 0x1914, 0x84DC, 0x20AB, 0x84E7, 0x4861, 0x84EA, 0x4862,
+ 0x84EC, 0x0E57, 0x84EE, 0x0FC7, 0x84EF, 0x4863, 0x84F0, 0x3ADC,
+ 0x84F1, 0x4864, 0x84F4, 0x191C, 0x84FA, 0x4865, 0x84FB, 0x4D23,
+ 0x84FC, 0x1923, 0x84FD, 0x3ADD, 0x84FF, 0x191B, 0x8500, 0x08EF,
+ 0x8506, 0x18FA, 0x850C, 0x3ADE, 0x8511, 0x0E1E, 0x8513, 0x0EAE,
+ 0x8514, 0x1922, 0x8515, 0x1921, 0x8517, 0x191D, 0x8518, 0x191E,
+ 0x851A, 0x04D8, 0x851B, 0x4866, 0x851E, 0x42C3, 0x851F, 0x1920,
+ 0x8521, 0x191A, 0x8523, 0x1E1A, 0x8524, 0x4867, 0x8525, 0x4868,
+ 0x8526, 0x0BF1, 0x852B, 0x4869, 0x852C, 0x191F, 0x852D, 0x04C2,
+ 0x852F, 0x42C4, 0x8532, 0x42C2, 0x8534, 0x3ADF, 0x8535, 0x0B02,
+ 0x853D, 0x0E13, 0x853E, 0x1EB5, 0x8540, 0x1924, 0x8541, 0x1928,
+ 0x8543, 0x0D6D, 0x8546, 0x4D24, 0x8548, 0x1927, 0x8549, 0x09BE,
+ 0x854A, 0x08F5, 0x854B, 0x192A, 0x854E, 0x06B6, 0x854F, 0x486A,
+ 0x8551, 0x486D, 0x8553, 0x219F, 0x8555, 0x192B, 0x8556, 0x4D25,
+ 0x8557, 0x0DEB, 0x8558, 0x1926, 0x8559, 0x21A0, 0x855A, 0x18FF,
+ 0x855D, 0x4D26, 0x855E, 0x3AE0, 0x8561, 0x486E, 0x8562, 0x486F,
+ 0x8563, 0x1925, 0x8564, 0x42C5, 0x8568, 0x0FF5, 0x8569, 0x0C7A,
+ 0x856A, 0x0DE5, 0x856B, 0x21A1, 0x856D, 0x1932, 0x856F, 0x486B,
+ 0x8577, 0x1938, 0x857A, 0x42C6, 0x857B, 0x4871, 0x857D, 0x4872,
+ 0x857E, 0x1939, 0x857F, 0x4873, 0x8580, 0x192C, 0x8581, 0x4874,
+ 0x8584, 0x0D2C, 0x8585, 0x4D27, 0x8586, 0x4875, 0x8587, 0x1936,
+ 0x8588, 0x192E, 0x858A, 0x1930, 0x858C, 0x42C7, 0x858F, 0x3AE1,
+ 0x8590, 0x193A, 0x8591, 0x192F, 0x8593, 0x4876, 0x8594, 0x1933,
+ 0x8597, 0x0514, 0x8598, 0x4D28, 0x8599, 0x0CBD, 0x859B, 0x1934,
+ 0x859C, 0x1937, 0x859D, 0x4877, 0x859F, 0x4878, 0x85A2, 0x42C8,
+ 0x85A4, 0x192D, 0x85A6, 0x0AA8, 0x85A8, 0x1931, 0x85A9, 0x0875,
+ 0x85AA, 0x0A0B, 0x85AB, 0x0706, 0x85AC, 0x0F00, 0x85AD, 0x3AE4,
+ 0x85AE, 0x0F05, 0x85AF, 0x097C, 0x85B0, 0x21A3, 0x85B7, 0x3AE2,
+ 0x85B9, 0x193E, 0x85BA, 0x193C, 0x85BC, 0x487C, 0x85C1, 0x0FF4,
+ 0x85C7, 0x487D, 0x85C9, 0x193B, 0x85CA, 0x487E, 0x85CB, 0x42C9,
+ 0x85CD, 0x0F5F, 0x85CE, 0x3AE3, 0x85CF, 0x193D, 0x85D0, 0x193F,
+ 0x85D5, 0x1940, 0x85D8, 0x487F, 0x85D9, 0x4880, 0x85DC, 0x1943,
+ 0x85DD, 0x1941, 0x85DF, 0x4881, 0x85E1, 0x4882, 0x85E4, 0x0C7B,
+ 0x85E5, 0x1942, 0x85E6, 0x4883, 0x85E9, 0x0D61, 0x85EA, 0x1935,
+ 0x85ED, 0x42CA, 0x85F4, 0x3780, 0x85F6, 0x4884, 0x85F7, 0x097D,
+ 0x85F9, 0x1944, 0x85FA, 0x1949, 0x85FB, 0x0AF6, 0x85FE, 0x1948,
+ 0x85FF, 0x42CB, 0x8600, 0x4885, 0x8602, 0x1929, 0x8604, 0x42CC,
+ 0x8605, 0x42CD, 0x8606, 0x194A, 0x8607, 0x0ACB, 0x860A, 0x1945,
+ 0x860B, 0x1947, 0x8610, 0x42CE, 0x8611, 0x4886, 0x8612, 0x3AE5,
+ 0x8613, 0x1946, 0x8616, 0x14D0, 0x8617, 0x14C1, 0x8618, 0x42D0,
+ 0x861A, 0x194C, 0x861E, 0x4887, 0x8621, 0x4888, 0x8622, 0x194B,
+ 0x8624, 0x4889, 0x8627, 0x488A, 0x8629, 0x3AE6, 0x862D, 0x0F60,
+ 0x862F, 0x16B1, 0x8630, 0x194D, 0x8638, 0x42D1, 0x8639, 0x488C,
+ 0x863C, 0x488D, 0x863F, 0x194E, 0x8640, 0x488F, 0x8641, 0x41B8,
+ 0x8642, 0x4D29, 0x8646, 0x4D2A, 0x864D, 0x194F, 0x864E, 0x078B,
+ 0x8650, 0x066E, 0x8652, 0x3AE7, 0x8653, 0x4890, 0x8654, 0x1951,
+ 0x8655, 0x1094, 0x8656, 0x4891, 0x8657, 0x42D2, 0x865A, 0x068F,
+ 0x865B, 0x3418, 0x865C, 0x0F82, 0x865E, 0x06EB, 0x865F, 0x1952,
+ 0x8662, 0x42D3, 0x8663, 0x3AE8, 0x8667, 0x1953, 0x866B, 0x0BAC,
+ 0x866C, 0x3AE9, 0x866F, 0x3AEA, 0x8671, 0x1954, 0x8675, 0x42D5,
+ 0x8677, 0x4892, 0x8679, 0x0CD2, 0x867A, 0x3AEB, 0x867B, 0x047E,
+ 0x867D, 0x3786, 0x8687, 0x4893, 0x8689, 0x4894, 0x868A, 0x0563,
+ 0x868B, 0x1959, 0x868C, 0x195A, 0x868D, 0x3AEC, 0x8691, 0x3AED,
+ 0x8693, 0x1955, 0x8695, 0x088B, 0x8698, 0x3AEE, 0x869C, 0x4895,
+ 0x869D, 0x4896, 0x86A3, 0x1956, 0x86A4, 0x0CF8, 0x86A7, 0x3AEF,
+ 0x86A8, 0x3AF0, 0x86A9, 0x1957, 0x86AA, 0x1958, 0x86AB, 0x1962,
+ 0x86AF, 0x195C, 0x86B0, 0x195F, 0x86B1, 0x4897, 0x86B3, 0x4898,
+ 0x86B6, 0x195B, 0x86B8, 0x42D6, 0x86C0, 0x4D2B, 0x86C1, 0x4899,
+ 0x86C3, 0x489A, 0x86C4, 0x195D, 0x86C6, 0x195E, 0x86C7, 0x0904,
+ 0x86C9, 0x1960, 0x86CB, 0x0B7F, 0x86CD, 0x072C, 0x86CE, 0x05A0,
+ 0x86D1, 0x489B, 0x86D4, 0x1963, 0x86D5, 0x489C, 0x86D7, 0x489D,
+ 0x86D9, 0x059D, 0x86DB, 0x1968, 0x86DE, 0x1964, 0x86DF, 0x1967,
+ 0x86E3, 0x489E, 0x86E4, 0x0D4E, 0x86E6, 0x489F, 0x86E9, 0x1965,
+ 0x86EC, 0x1966, 0x86ED, 0x0DBA, 0x86EE, 0x0D6E, 0x86EF, 0x1969,
+ 0x86F8, 0x0B5D, 0x86F9, 0x1973, 0x86FA, 0x3AF1, 0x86FB, 0x196F,
+ 0x86FC, 0x42D7, 0x86FD, 0x3AF2, 0x86FE, 0x056B, 0x8700, 0x196D,
+ 0x8702, 0x0E58, 0x8703, 0x196E, 0x8705, 0x48A1, 0x8706, 0x196B,
+ 0x8707, 0x48A2, 0x8708, 0x196C, 0x8709, 0x1971, 0x870A, 0x1974,
+ 0x870B, 0x3AF3, 0x870D, 0x1972, 0x870E, 0x48A3, 0x8710, 0x48A4,
+ 0x8711, 0x1970, 0x8712, 0x196A, 0x8713, 0x3AF4, 0x8714, 0x4D2C,
+ 0x8718, 0x0B96, 0x8719, 0x3AF5, 0x871A, 0x197B, 0x871C, 0x0EB6,
+ 0x871E, 0x3AF6, 0x871F, 0x48A5, 0x8721, 0x48A6, 0x8722, 0x4D2D,
+ 0x8723, 0x48A7, 0x8725, 0x1979, 0x8728, 0x3AF7, 0x8729, 0x197A,
+ 0x872E, 0x4D2E, 0x8731, 0x48A8, 0x8734, 0x1975, 0x8737, 0x1977,
+ 0x8739, 0x4D2F, 0x873A, 0x48A9, 0x873B, 0x1978, 0x873E, 0x3AF8,
+ 0x873F, 0x1976, 0x8740, 0x48AA, 0x8743, 0x48AB, 0x8749, 0x0A8A,
+ 0x874B, 0x0FDF, 0x874C, 0x197F, 0x874E, 0x1980, 0x8751, 0x48AC,
+ 0x8753, 0x1986, 0x8755, 0x09F0, 0x8757, 0x1982, 0x8758, 0x48AD,
+ 0x8759, 0x1985, 0x875D, 0x4D30, 0x875F, 0x197D, 0x8760, 0x197C,
+ 0x8763, 0x1987, 0x8764, 0x48AE, 0x8765, 0x48AF, 0x8766, 0x055C,
+ 0x8768, 0x1983, 0x876A, 0x1988, 0x876E, 0x1984, 0x8771, 0x3AF9,
+ 0x8772, 0x48B0, 0x8774, 0x1981, 0x8776, 0x0BCF, 0x8778, 0x197E,
+ 0x877B, 0x4D31, 0x877C, 0x48B1, 0x877F, 0x0D1E, 0x8782, 0x198C,
+ 0x8787, 0x42D8, 0x8788, 0x3AFA, 0x8789, 0x48B5, 0x878B, 0x48B6,
+ 0x878C, 0x4D32, 0x878D, 0x0F25, 0x878E, 0x4D33, 0x8793, 0x48B7,
+ 0x8797, 0x4D34, 0x8798, 0x4D35, 0x8799, 0x3AFB, 0x879E, 0x4D36,
+ 0x879F, 0x198B, 0x87A0, 0x48B8, 0x87A2, 0x198A, 0x87A3, 0x4D37,
+ 0x87A7, 0x48B4, 0x87AB, 0x1993, 0x87AC, 0x3AFC, 0x87AD, 0x3AFD,
+ 0x87AE, 0x4D38, 0x87AF, 0x198D, 0x87B3, 0x1995, 0x87B5, 0x3AFE,
+ 0x87BA, 0x0F50, 0x87BB, 0x1998, 0x87BD, 0x198F, 0x87BE, 0x48BB,
+ 0x87BF, 0x4D39, 0x87C0, 0x1990, 0x87C1, 0x48BD, 0x87C4, 0x1994,
+ 0x87C6, 0x1997, 0x87C7, 0x1996, 0x87C9, 0x4D3A, 0x87CB, 0x198E,
+ 0x87CE, 0x48BE, 0x87D0, 0x1991, 0x87D2, 0x19A2, 0x87D6, 0x3AFF,
+ 0x87DA, 0x4D3B, 0x87DF, 0x48BF, 0x87E0, 0x199B, 0x87E3, 0x48C1,
+ 0x87E5, 0x48C2, 0x87E6, 0x48C3, 0x87EA, 0x48C4, 0x87EB, 0x3B00,
+ 0x87EC, 0x1E23, 0x87ED, 0x3B01, 0x87EF, 0x1999, 0x87F2, 0x199A,
+ 0x87F5, 0x3C3D, 0x87F6, 0x199F, 0x87F7, 0x19A0, 0x87F9, 0x0588,
+ 0x87FB, 0x065C, 0x87FE, 0x199E, 0x8801, 0x3B02, 0x8803, 0x4F58,
+ 0x8805, 0x1989, 0x8806, 0x3B04, 0x8807, 0x21A6, 0x880A, 0x42DA,
+ 0x880B, 0x3B05, 0x880D, 0x199D, 0x880E, 0x19A1, 0x880F, 0x199C,
+ 0x8810, 0x42DB, 0x8811, 0x19A3, 0x8813, 0x48C5, 0x8814, 0x3B06,
+ 0x8815, 0x19A5, 0x8816, 0x19A4, 0x8818, 0x4D3C, 0x881B, 0x4D3D,
+ 0x881C, 0x3B07, 0x881F, 0x1E85, 0x8821, 0x19A7, 0x8822, 0x19A6,
+ 0x8823, 0x1961, 0x8827, 0x19AB, 0x8828, 0x48C6, 0x882D, 0x4D3E,
+ 0x882E, 0x48C7, 0x8831, 0x19A8, 0x8832, 0x48C8, 0x8836, 0x19A9,
+ 0x8839, 0x19AA, 0x883A, 0x4D3F, 0x883B, 0x19AC, 0x883C, 0x48C9,
+ 0x8840, 0x0742, 0x8842, 0x19AE, 0x8844, 0x19AD, 0x8845, 0x4D40,
+ 0x8846, 0x093A, 0x884A, 0x48CB, 0x884B, 0x4D41, 0x884C, 0x07E6,
+ 0x884D, 0x1524, 0x884E, 0x4D42, 0x8852, 0x19AF, 0x8853, 0x095B,
+ 0x8855, 0x4D43, 0x8856, 0x3B08, 0x8857, 0x0597, 0x8858, 0x48CC,
+ 0x8859, 0x19B0, 0x885A, 0x4D44, 0x885B, 0x04F4, 0x885D, 0x09BF,
+ 0x885E, 0x19B1, 0x885F, 0x3B09, 0x8861, 0x07E7, 0x8862, 0x19B2,
+ 0x8863, 0x04A5, 0x8864, 0x3B0A, 0x8868, 0x0DAF, 0x8869, 0x48CF,
+ 0x886B, 0x19B3, 0x886E, 0x4D45, 0x886F, 0x48D1, 0x8870, 0x0A30,
+ 0x8872, 0x19BA, 0x8875, 0x19B7, 0x8877, 0x0BAD, 0x887D, 0x19B8,
+ 0x887E, 0x19B5, 0x887F, 0x06D6, 0x8881, 0x19B4, 0x8882, 0x19BB,
+ 0x8888, 0x070C, 0x888B, 0x0B3E, 0x888D, 0x19C1, 0x8892, 0x19BD,
+ 0x8896, 0x0B15, 0x8897, 0x19BC, 0x8898, 0x3B0B, 0x8899, 0x19BF,
+ 0x889A, 0x4D46, 0x889B, 0x4D47, 0x889C, 0x4D48, 0x889E, 0x19B6,
+ 0x88A0, 0x48D2, 0x88A2, 0x19C0, 0x88A4, 0x19C2, 0x88AA, 0x3B0C,
+ 0x88AB, 0x0D83, 0x88AE, 0x19BE, 0x88B0, 0x19C3, 0x88B1, 0x19C5,
+ 0x88B4, 0x0787, 0x88B5, 0x19B9, 0x88B7, 0x0485, 0x88BC, 0x48D3,
+ 0x88BD, 0x3B0D, 0x88BE, 0x3B0E, 0x88BF, 0x19C4, 0x88C0, 0x48D4,
+ 0x88C1, 0x084B, 0x88C2, 0x0FBE, 0x88C3, 0x19C6, 0x88C4, 0x19C7,
+ 0x88C5, 0x0AF7, 0x88C6, 0x3789, 0x88CA, 0x3B0F, 0x88CD, 0x4D49,
+ 0x88CE, 0x42DC, 0x88CF, 0x0F6A, 0x88D1, 0x48D6, 0x88D2, 0x3B10,
+ 0x88D3, 0x48D7, 0x88D4, 0x19C8, 0x88D5, 0x0F1F, 0x88D8, 0x19C9,
+ 0x88D9, 0x19CA, 0x88DB, 0x3B11, 0x88DC, 0x0E34, 0x88DD, 0x19CB,
+ 0x88DF, 0x0830, 0x88E0, 0x4D4A, 0x88E1, 0x0F6B, 0x88E8, 0x19D0,
+ 0x88EF, 0x4D4B, 0x88F0, 0x3B12, 0x88F1, 0x3B13, 0x88F2, 0x19D1,
+ 0x88F3, 0x09C0, 0x88F4, 0x19CF, 0x88F5, 0x21A7, 0x88F8, 0x0F51,
+ 0x88F9, 0x19CC, 0x88FC, 0x19CE, 0x88FD, 0x0A61, 0x88FE, 0x0A44,
+ 0x8901, 0x48D9, 0x8902, 0x19CD, 0x8904, 0x19D2, 0x8906, 0x3B14,
+ 0x8907, 0x0DF3, 0x890A, 0x19D4, 0x890C, 0x19D3, 0x890E, 0x4D4C,
+ 0x890F, 0x4D4D, 0x8910, 0x05CA, 0x8912, 0x0E59, 0x8913, 0x19D5,
+ 0x8918, 0x3B15, 0x8919, 0x3B16, 0x891A, 0x3B17, 0x891C, 0x20A8,
+ 0x891D, 0x19E1, 0x891E, 0x19D7, 0x8925, 0x19D8, 0x8926, 0x4D4E,
+ 0x8927, 0x3B18, 0x892A, 0x19D9, 0x892B, 0x19DA, 0x8930, 0x3B19,
+ 0x8932, 0x42DE, 0x8935, 0x4D4F, 0x8936, 0x19DE, 0x8937, 0x48DB,
+ 0x8938, 0x19DF, 0x8939, 0x42DF, 0x893B, 0x19DD, 0x893E, 0x3B1A,
+ 0x8940, 0x42E0, 0x8941, 0x19DB, 0x8942, 0x48DD, 0x8943, 0x19D6,
+ 0x8944, 0x19DC, 0x8945, 0x48DE, 0x8949, 0x48DF, 0x894C, 0x19E0,
+ 0x894D, 0x1BD0, 0x8956, 0x0528, 0x895A, 0x4D50, 0x895C, 0x4D51,
+ 0x895E, 0x19E3, 0x895F, 0x06D7, 0x8960, 0x19E2, 0x8962, 0x48E1,
+ 0x8964, 0x19E5, 0x8966, 0x19E4, 0x896A, 0x19E7, 0x896B, 0x4D52,
+ 0x896D, 0x19E6, 0x896F, 0x19E8, 0x8970, 0x4D53, 0x8972, 0x093B,
+ 0x8974, 0x19E9, 0x8977, 0x19EA, 0x897B, 0x3B1B, 0x897C, 0x4D54,
+ 0x897E, 0x19EB, 0x897F, 0x0A62, 0x8980, 0x362E, 0x8981, 0x0F41,
+ 0x8983, 0x19EC, 0x8986, 0x0DF4, 0x8987, 0x0CFC, 0x8988, 0x19ED,
+ 0x8989, 0x48E2, 0x898A, 0x19EE, 0x898B, 0x075F, 0x898F, 0x0646,
+ 0x8990, 0x48E3, 0x8993, 0x19EF, 0x8994, 0x42E1, 0x8996, 0x08B9,
+ 0x8997, 0x0CF7, 0x8998, 0x19F0, 0x899A, 0x05AE, 0x899F, 0x48E4,
+ 0x89A1, 0x19F1, 0x89A5, 0x4D55, 0x89A6, 0x19F3, 0x89A7, 0x0F61,
+ 0x89A9, 0x19F2, 0x89AA, 0x0A0C, 0x89AC, 0x19F4, 0x89AF, 0x19F5,
+ 0x89B0, 0x48E5, 0x89B2, 0x19F6, 0x89B3, 0x060D, 0x89B5, 0x4D56,
+ 0x89B7, 0x48E6, 0x89BA, 0x19F7, 0x89BC, 0x4D57, 0x89BD, 0x19F8,
+ 0x89BF, 0x19F9, 0x89C0, 0x19FA, 0x89D2, 0x05AF, 0x89D4, 0x3B1C,
+ 0x89D5, 0x4D58, 0x89D6, 0x3B1D, 0x89D8, 0x48E7, 0x89DA, 0x19FB,
+ 0x89DC, 0x19FC, 0x89DD, 0x19FD, 0x89E3, 0x0572, 0x89E5, 0x3B1E,
+ 0x89E6, 0x09EE, 0x89E7, 0x19FE, 0x89EB, 0x48E8, 0x89F1, 0x3B1F,
+ 0x89F3, 0x48EA, 0x89F4, 0x19FF, 0x89F6, 0x42E2, 0x89F8, 0x1A00,
+ 0x89FD, 0x48EB, 0x89FF, 0x48EC, 0x8A00, 0x0774, 0x8A01, 0x35BC,
+ 0x8A02, 0x0C17, 0x8A03, 0x1A01, 0x8A07, 0x3B20, 0x8A08, 0x072D,
+ 0x8A0A, 0x0A1C, 0x8A0C, 0x1A04, 0x8A0E, 0x0C7C, 0x8A0F, 0x3B21,
+ 0x8A10, 0x1A03, 0x8A11, 0x48EE, 0x8A12, 0x21A8, 0x8A13, 0x0707,
+ 0x8A14, 0x48EF, 0x8A15, 0x3B22, 0x8A16, 0x1A02, 0x8A17, 0x0B57,
+ 0x8A18, 0x0647, 0x8A1B, 0x1A05, 0x8A1D, 0x1A06, 0x8A1F, 0x09C1,
+ 0x8A21, 0x48F1, 0x8A22, 0x3B23, 0x8A23, 0x0743, 0x8A25, 0x1A07,
+ 0x8A2A, 0x0E5A, 0x8A2D, 0x0A83, 0x8A31, 0x0690, 0x8A33, 0x0F01,
+ 0x8A34, 0x0ACC, 0x8A35, 0x48F2, 0x8A36, 0x1A08, 0x8A37, 0x21A9,
+ 0x8A3A, 0x0A0D, 0x8A3B, 0x0BAE, 0x8A3C, 0x09C2, 0x8A3E, 0x48F3,
+ 0x8A41, 0x1A09, 0x8A45, 0x48F4, 0x8A46, 0x1A0C, 0x8A47, 0x42E3,
+ 0x8A48, 0x1A0D, 0x8A49, 0x4D59, 0x8A4D, 0x48F5, 0x8A4E, 0x3B24,
+ 0x8A50, 0x082E, 0x8A51, 0x0B22, 0x8A52, 0x1A0B, 0x8A54, 0x09C3,
+ 0x8A55, 0x0DB0, 0x8A57, 0x4D5A, 0x8A58, 0x48F6, 0x8A5B, 0x1A0A,
+ 0x8A5D, 0x42E4, 0x8A5E, 0x08BA, 0x8A60, 0x04F5, 0x8A61, 0x42E5,
+ 0x8A62, 0x1A11, 0x8A63, 0x072E, 0x8A66, 0x08BC, 0x8A67, 0x4D5B,
+ 0x8A69, 0x08BB, 0x8A6B, 0x0FF3, 0x8A6C, 0x1A10, 0x8A6D, 0x1A0F,
+ 0x8A6E, 0x0AA9, 0x8A70, 0x0667, 0x8A71, 0x0FE9, 0x8A72, 0x0598,
+ 0x8A73, 0x09C4, 0x8A75, 0x42E6, 0x8A79, 0x21AA, 0x8A7C, 0x1A0E,
+ 0x8A7E, 0x4D5C, 0x8A7F, 0x3B25, 0x8A82, 0x1A13, 0x8A84, 0x1A14,
+ 0x8A85, 0x1A12, 0x8A86, 0x4D5D, 0x8A87, 0x078C, 0x8A89, 0x0F2A,
+ 0x8A8C, 0x08BD, 0x8A8D, 0x0CDD, 0x8A90, 0x48F8, 0x8A91, 0x1A17,
+ 0x8A93, 0x0A64, 0x8A95, 0x0B80, 0x8A96, 0x4D5E, 0x8A98, 0x0F20,
+ 0x8A9A, 0x1A1A, 0x8A9E, 0x07A0, 0x8AA0, 0x0A63, 0x8AA1, 0x1A16,
+ 0x8AA3, 0x1A1B, 0x8AA4, 0x07A1, 0x8AA5, 0x1A18, 0x8AA6, 0x1A19,
+ 0x8AA7, 0x21AB, 0x8AA8, 0x1A15, 0x8AAA, 0x3638, 0x8AAC, 0x0A86,
+ 0x8AAD, 0x0CA1, 0x8AAE, 0x48F7, 0x8AB0, 0x0B6D, 0x8AB2, 0x055D,
+ 0x8AB6, 0x4D5F, 0x8AB7, 0x48F9, 0x8AB9, 0x0D84, 0x8ABC, 0x065D,
+ 0x8ABE, 0x21AC, 0x8ABF, 0x0BD0, 0x8AC2, 0x1A1E, 0x8AC4, 0x1A1C,
+ 0x8AC7, 0x0B8A, 0x8AC9, 0x4D60, 0x8ACB, 0x0A65, 0x8ACC, 0x060E,
+ 0x8ACD, 0x1A1D, 0x8ACF, 0x0A21, 0x8AD0, 0x42E7, 0x8AD1, 0x4D61,
+ 0x8AD2, 0x0F92, 0x8AD6, 0x0FE6, 0x8AD7, 0x48FA, 0x8ADA, 0x1A1F,
+ 0x8ADB, 0x1A2A, 0x8ADC, 0x0BD1, 0x8ADD, 0x4D62, 0x8ADE, 0x1A29,
+ 0x8ADF, 0x21AD, 0x8AE0, 0x1A26, 0x8AE1, 0x1A2E, 0x8AE2, 0x1A27,
+ 0x8AE4, 0x1A23, 0x8AE6, 0x0C18, 0x8AE7, 0x1A22, 0x8AEB, 0x1A20,
+ 0x8AEC, 0x4D63, 0x8AED, 0x0F0B, 0x8AEE, 0x08BE, 0x8AF1, 0x1A24,
+ 0x8AF3, 0x1A21, 0x8AF4, 0x3B26, 0x8AF5, 0x4D64, 0x8AF6, 0x21AF,
+ 0x8AF7, 0x1A28, 0x8AF8, 0x097E, 0x8AFA, 0x0775, 0x8AFC, 0x48FB,
+ 0x8AFE, 0x0B5A, 0x8B00, 0x0E73, 0x8B01, 0x04FC, 0x8B02, 0x04A6,
+ 0x8B04, 0x0C7D, 0x8B05, 0x48FE, 0x8B06, 0x4D65, 0x8B07, 0x1A2C,
+ 0x8B0A, 0x48FD, 0x8B0C, 0x1A2B, 0x8B0D, 0x48FF, 0x8B0E, 0x0CBE,
+ 0x8B0F, 0x4D66, 0x8B10, 0x1A30, 0x8B11, 0x4D67, 0x8B14, 0x1A25,
+ 0x8B16, 0x1A2F, 0x8B17, 0x1A31, 0x8B19, 0x0760, 0x8B1A, 0x1A2D,
+ 0x8B1B, 0x07E8, 0x8B1C, 0x4900, 0x8B1D, 0x0901, 0x8B1F, 0x3B27,
+ 0x8B20, 0x1A32, 0x8B21, 0x0F42, 0x8B26, 0x1A35, 0x8B28, 0x1A38,
+ 0x8B2B, 0x1A36, 0x8B2C, 0x0DA7, 0x8B2D, 0x4901, 0x8B33, 0x1A33,
+ 0x8B37, 0x3B28, 0x8B39, 0x06D8, 0x8B3E, 0x1A37, 0x8B41, 0x1A39,
+ 0x8B43, 0x3B29, 0x8B44, 0x3B2A, 0x8B45, 0x4D68, 0x8B46, 0x42E8,
+ 0x8B49, 0x1A3D, 0x8B4C, 0x1A3A, 0x8B4E, 0x1A3C, 0x8B4F, 0x1A3B,
+ 0x8B51, 0x4903, 0x8B52, 0x4D69, 0x8B53, 0x21B0, 0x8B54, 0x3B2B,
+ 0x8B56, 0x1A3E, 0x8B58, 0x08DD, 0x8B59, 0x42E9, 0x8B5A, 0x1A40,
+ 0x8B5B, 0x1A3F, 0x8B5C, 0x0DDA, 0x8B5E, 0x4904, 0x8B5F, 0x1A42,
+ 0x8B66, 0x072F, 0x8B69, 0x42EA, 0x8B6B, 0x1A41, 0x8B6C, 0x1A43,
+ 0x8B6D, 0x4D6A, 0x8B6F, 0x1A44, 0x8B70, 0x065E, 0x8B71, 0x182E,
+ 0x8B72, 0x09E1, 0x8B74, 0x1A45, 0x8B76, 0x4905, 0x8B77, 0x07A2,
+ 0x8B78, 0x4D6B, 0x8B7C, 0x4D6C, 0x8B7D, 0x1A46, 0x8B7E, 0x4D6D,
+ 0x8B7F, 0x21B1, 0x8B80, 0x1A47, 0x8B81, 0x4906, 0x8B83, 0x088C,
+ 0x8B85, 0x4D6E, 0x8B8A, 0x13D3, 0x8B8B, 0x4907, 0x8B8C, 0x1A48,
+ 0x8B8E, 0x1A49, 0x8B90, 0x093C, 0x8B92, 0x1A4A, 0x8B93, 0x1A4B,
+ 0x8B94, 0x4908, 0x8B95, 0x4909, 0x8B96, 0x1A4C, 0x8B99, 0x1A4D,
+ 0x8B9A, 0x1A4E, 0x8B9C, 0x3B2C, 0x8B9D, 0x42EB, 0x8B9E, 0x3B2D,
+ 0x8B9F, 0x4D6F, 0x8C37, 0x0B69, 0x8C39, 0x490A, 0x8C3A, 0x1A4F,
+ 0x8C3D, 0x490C, 0x8C3F, 0x1A51, 0x8C41, 0x1A50, 0x8C45, 0x490F,
+ 0x8C46, 0x0C7E, 0x8C47, 0x3B2E, 0x8C48, 0x1A52, 0x8C49, 0x42EC,
+ 0x8C4A, 0x0E5B, 0x8C4B, 0x4D70, 0x8C4C, 0x1A53, 0x8C4E, 0x1A54,
+ 0x8C4F, 0x4910, 0x8C50, 0x1A55, 0x8C53, 0x4D71, 0x8C54, 0x3B2F,
+ 0x8C55, 0x1A56, 0x8C57, 0x4911, 0x8C5A, 0x0CB2, 0x8C61, 0x09C5,
+ 0x8C62, 0x1A57, 0x8C68, 0x42ED, 0x8C69, 0x4912, 0x8C6A, 0x07FD,
+ 0x8C6B, 0x1007, 0x8C6C, 0x1A58, 0x8C6D, 0x4913, 0x8C73, 0x3B30,
+ 0x8C78, 0x1A59, 0x8C79, 0x0DB1, 0x8C7A, 0x1A5A, 0x8C7B, 0x4D72,
+ 0x8C7C, 0x1A62, 0x8C82, 0x1A5B, 0x8C85, 0x1A5D, 0x8C89, 0x1A5C,
+ 0x8C8A, 0x1A5E, 0x8C8C, 0x0E74, 0x8C8D, 0x1A5F, 0x8C8E, 0x1A60,
+ 0x8C92, 0x4916, 0x8C93, 0x4915, 0x8C94, 0x1A61, 0x8C98, 0x1A63,
+ 0x8C99, 0x4917, 0x8C9B, 0x4919, 0x8C9D, 0x058B, 0x8C9E, 0x0C03,
+ 0x8C9F, 0x354C, 0x8CA0, 0x0DDB, 0x8CA1, 0x0852, 0x8CA2, 0x07E9,
+ 0x8CA4, 0x3B31, 0x8CA7, 0x0DC1, 0x8CA8, 0x055F, 0x8CA9, 0x0D62,
+ 0x8CAA, 0x1A66, 0x8CAB, 0x060F, 0x8CAC, 0x0A79, 0x8CAD, 0x1A65,
+ 0x8CAE, 0x1A6A, 0x8CAF, 0x0BB7, 0x8CB0, 0x0EEF, 0x8CB2, 0x1A68,
+ 0x8CB3, 0x1A69, 0x8CB4, 0x0648, 0x8CB6, 0x1A6B, 0x8CB7, 0x0D19,
+ 0x8CB8, 0x0B3F, 0x8CBA, 0x4D73, 0x8CBB, 0x0D85, 0x8CBC, 0x0C37,
+ 0x8CBD, 0x1A67, 0x8CBF, 0x0E75, 0x8CC0, 0x056C, 0x8CC1, 0x1A6D,
+ 0x8CC2, 0x0FCE, 0x8CC3, 0x0BDE, 0x8CC4, 0x0FEB, 0x8CC5, 0x4D74,
+ 0x8CC7, 0x08BF, 0x8CC8, 0x1A6C, 0x8CC9, 0x4D75, 0x8CCA, 0x0B11,
+ 0x8CCD, 0x1A7D, 0x8CCE, 0x0AAA, 0x8CD1, 0x0CD0, 0x8CD2, 0x4D76,
+ 0x8CD3, 0x0DC2, 0x8CD5, 0x491B, 0x8CD6, 0x491A, 0x8CD9, 0x3B32,
+ 0x8CDA, 0x1A70, 0x8CDB, 0x088D, 0x8CDC, 0x08C0, 0x8CDE, 0x09C6,
+ 0x8CE0, 0x0D1B, 0x8CE1, 0x3B33, 0x8CE2, 0x0761, 0x8CE3, 0x1A6F,
+ 0x8CE4, 0x1A6E, 0x8CE6, 0x0DDC, 0x8CEA, 0x08ED, 0x8CEC, 0x4D77,
+ 0x8CED, 0x0C4C, 0x8CF0, 0x21B2, 0x8CF1, 0x491D, 0x8CF4, 0x21B3,
+ 0x8CF5, 0x4D78, 0x8CF7, 0x4D79, 0x8CF8, 0x3B34, 0x8CFA, 0x1A72,
+ 0x8CFB, 0x1A73, 0x8CFC, 0x07EA, 0x8CFD, 0x1A71, 0x8CFE, 0x3B35,
+ 0x8D01, 0x4D7A, 0x8D03, 0x4D7B, 0x8D04, 0x1A74, 0x8D05, 0x1A75,
+ 0x8D07, 0x1A77, 0x8D08, 0x0B03, 0x8D09, 0x491F, 0x8D0A, 0x1A76,
+ 0x8D0B, 0x0622, 0x8D0D, 0x1A79, 0x8D0E, 0x4920, 0x8D0F, 0x1A78,
+ 0x8D10, 0x1A7A, 0x8D12, 0x21B4, 0x8D13, 0x1A7C, 0x8D14, 0x1A7E,
+ 0x8D16, 0x1A7F, 0x8D17, 0x4D7C, 0x8D1B, 0x3B36, 0x8D1C, 0x4D7D,
+ 0x8D64, 0x0A7A, 0x8D66, 0x08FB, 0x8D67, 0x1A80, 0x8D69, 0x3B37,
+ 0x8D6B, 0x05B0, 0x8D6C, 0x3B38, 0x8D6D, 0x1A81, 0x8D6E, 0x4D7E,
+ 0x8D70, 0x0AF8, 0x8D71, 0x1A82, 0x8D73, 0x1A83, 0x8D74, 0x0DDD,
+ 0x8D76, 0x21B5, 0x8D77, 0x0649, 0x8D81, 0x1A84, 0x8D84, 0x3B39,
+ 0x8D85, 0x0BD2, 0x8D8A, 0x04FD, 0x8D8D, 0x3B3A, 0x8D91, 0x4D7F,
+ 0x8D95, 0x3B3B, 0x8D99, 0x1A85, 0x8D9F, 0x4D80, 0x8DA3, 0x091D,
+ 0x8DA6, 0x3B3C, 0x8DA8, 0x0A3C, 0x8DAB, 0x4D81, 0x8DAF, 0x42EE,
+ 0x8DB2, 0x4D82, 0x8DB3, 0x0B0D, 0x8DBA, 0x1A88, 0x8DBE, 0x1A87,
+ 0x8DC2, 0x1A86, 0x8DC6, 0x3B3D, 0x8DC8, 0x4921, 0x8DCB, 0x1A8E,
+ 0x8DCC, 0x1A8C, 0x8DCE, 0x3B3E, 0x8DCF, 0x1A89, 0x8DD1, 0x42EF,
+ 0x8DD5, 0x4D83, 0x8DD6, 0x1A8B, 0x8DD7, 0x42F0, 0x8DD9, 0x4922,
+ 0x8DDA, 0x1A8A, 0x8DDB, 0x1A8D, 0x8DDD, 0x0691, 0x8DDF, 0x1A91,
+ 0x8DE1, 0x0A7B, 0x8DE3, 0x1A92, 0x8DE4, 0x3B3F, 0x8DE7, 0x4D84,
+ 0x8DE8, 0x078D, 0x8DEA, 0x1A8F, 0x8DEB, 0x1A90, 0x8DEC, 0x3B40,
+ 0x8DEF, 0x0FCF, 0x8DF1, 0x4D85, 0x8DF2, 0x4D86, 0x8DF3, 0x0BD3,
+ 0x8DF4, 0x4D87, 0x8DF5, 0x0AAB, 0x8DFC, 0x1A93, 0x8DFD, 0x4925,
+ 0x8DFF, 0x1A96, 0x8E01, 0x4D88, 0x8E06, 0x4926, 0x8E08, 0x1A94,
+ 0x8E09, 0x1A95, 0x8E0A, 0x0F43, 0x8E0B, 0x4D89, 0x8E0C, 0x4923,
+ 0x8E0F, 0x0C7F, 0x8E10, 0x1A99, 0x8E14, 0x4928, 0x8E16, 0x4929,
+ 0x8E1D, 0x1A97, 0x8E1E, 0x1A98, 0x8E1F, 0x1A9A, 0x8E20, 0x3B41,
+ 0x8E21, 0x492A, 0x8E22, 0x492B, 0x8E23, 0x42F1, 0x8E26, 0x4D8A,
+ 0x8E27, 0x492C, 0x8E2A, 0x1AA8, 0x8E30, 0x1A9D, 0x8E31, 0x4D8B,
+ 0x8E34, 0x1A9E, 0x8E35, 0x1A9C, 0x8E36, 0x492F, 0x8E39, 0x4930,
+ 0x8E3D, 0x42F2, 0x8E40, 0x4D8C, 0x8E41, 0x4D8D, 0x8E42, 0x1A9B,
+ 0x8E44, 0x0C19, 0x8E47, 0x1AA0, 0x8E48, 0x1AA4, 0x8E49, 0x1AA1,
+ 0x8E4A, 0x1A9F, 0x8E4B, 0x3B42, 0x8E4C, 0x1AA2, 0x8E4D, 0x4D8E,
+ 0x8E4F, 0x4D8F, 0x8E50, 0x1AA3, 0x8E54, 0x4931, 0x8E55, 0x1AAA,
+ 0x8E59, 0x1AA5, 0x8E5C, 0x4D90, 0x8E5F, 0x0A7C, 0x8E60, 0x1AA7,
+ 0x8E61, 0x4D91, 0x8E62, 0x4932, 0x8E63, 0x1AA9, 0x8E64, 0x1AA6,
+ 0x8E69, 0x4D92, 0x8E6C, 0x3B43, 0x8E6D, 0x4933, 0x8E6F, 0x4934,
+ 0x8E70, 0x3B44, 0x8E71, 0x4D93, 0x8E72, 0x1AAC, 0x8E74, 0x093D,
+ 0x8E75, 0x4D94, 0x8E76, 0x1AAB, 0x8E77, 0x4D95, 0x8E7A, 0x3B45,
+ 0x8E7B, 0x42F3, 0x8E7C, 0x1AAD, 0x8E81, 0x1AAE, 0x8E84, 0x1AB1,
+ 0x8E85, 0x1AB0, 0x8E87, 0x1AAF, 0x8E89, 0x4D96, 0x8E8A, 0x1AB3,
+ 0x8E8B, 0x1AB2, 0x8E8D, 0x0F02, 0x8E90, 0x4D97, 0x8E91, 0x1AB5,
+ 0x8E92, 0x3B46, 0x8E93, 0x1AB4, 0x8E94, 0x1AB6, 0x8E95, 0x4D98,
+ 0x8E98, 0x4935, 0x8E99, 0x1AB7, 0x8E9A, 0x4D99, 0x8E9E, 0x4936,
+ 0x8EA1, 0x1AB9, 0x8EA7, 0x4D9A, 0x8EA9, 0x4D9B, 0x8EAA, 0x1AB8,
+ 0x8EAB, 0x0A0E, 0x8EAC, 0x1ABA, 0x8EAD, 0x4D9C, 0x8EAE, 0x3B47,
+ 0x8EAF, 0x06E5, 0x8EB0, 0x1ABB, 0x8EB1, 0x1ABD, 0x8EB3, 0x3B48,
+ 0x8EB5, 0x4937, 0x8EB6, 0x3703, 0x8EBB, 0x4938, 0x8EBE, 0x1ABE,
+ 0x8EC0, 0x1DEF, 0x8EC5, 0x1ABF, 0x8EC6, 0x1ABC, 0x8EC8, 0x1AC0,
+ 0x8ECA, 0x0902, 0x8ECB, 0x1AC1, 0x8ECC, 0x064A, 0x8ECD, 0x0709,
+ 0x8ECF, 0x21B7, 0x8ED1, 0x3B49, 0x8ED2, 0x0762, 0x8ED4, 0x3B4A,
+ 0x8EDB, 0x1AC2, 0x8EDF, 0x0CC8, 0x8EE2, 0x0C38, 0x8EE3, 0x1AC3,
+ 0x8EE8, 0x4D9D, 0x8EEB, 0x1AC6, 0x8EF0, 0x4D9E, 0x8EF8, 0x08E0,
+ 0x8EF9, 0x3B4B, 0x8EFA, 0x42F6, 0x8EFB, 0x1AC5, 0x8EFC, 0x1AC4,
+ 0x8EFD, 0x0730, 0x8EFE, 0x1AC7, 0x8F00, 0x493C, 0x8F03, 0x05B1,
+ 0x8F05, 0x1AC9, 0x8F07, 0x4D9F, 0x8F08, 0x493D, 0x8F09, 0x084C,
+ 0x8F0A, 0x1AC8, 0x8F0C, 0x1AD1, 0x8F12, 0x1ACB, 0x8F13, 0x1ACD,
+ 0x8F14, 0x0E35, 0x8F15, 0x1ACA, 0x8F17, 0x3B4C, 0x8F18, 0x4DA0,
+ 0x8F19, 0x1ACC, 0x8F1B, 0x1AD0, 0x8F1C, 0x1ACE, 0x8F1D, 0x064B,
+ 0x8F1E, 0x42F7, 0x8F1F, 0x1ACF, 0x8F25, 0x4DA1, 0x8F26, 0x1AD2,
+ 0x8F27, 0x4DA2, 0x8F29, 0x0D10, 0x8F2A, 0x0FA0, 0x8F2B, 0x493E,
+ 0x8F2C, 0x4DA3, 0x8F2D, 0x42F8, 0x8F2F, 0x093E, 0x8F33, 0x1AD3,
+ 0x8F35, 0x4DA4, 0x8F36, 0x3B4D, 0x8F38, 0x0F0C, 0x8F39, 0x1AD5,
+ 0x8F3A, 0x4DA5, 0x8F3B, 0x1AD4, 0x8F3E, 0x1AD8, 0x8F3F, 0x0F2B,
+ 0x8F40, 0x493F, 0x8F42, 0x1AD7, 0x8F43, 0x4DA6, 0x8F44, 0x05CB,
+ 0x8F45, 0x1AD6, 0x8F46, 0x1ADB, 0x8F47, 0x4DA7, 0x8F49, 0x1ADA,
+ 0x8F4A, 0x4940, 0x8F4C, 0x1AD9, 0x8F4D, 0x0C2C, 0x8F4E, 0x1ADC,
+ 0x8F51, 0x4DA8, 0x8F54, 0x42F9, 0x8F55, 0x4DA9, 0x8F57, 0x1ADD,
+ 0x8F58, 0x4941, 0x8F5C, 0x1ADE, 0x8F5F, 0x07FE, 0x8F61, 0x06FB,
+ 0x8F62, 0x1ADF, 0x8F63, 0x1AE0, 0x8F64, 0x1AE1, 0x8F9B, 0x0A0F,
+ 0x8F9C, 0x1AE2, 0x8F9E, 0x08D9, 0x8F9F, 0x1AE3, 0x8FA0, 0x4DAA,
+ 0x8FA1, 0x4DAB, 0x8FA2, 0x4DAC, 0x8FA3, 0x1AE4, 0x8FA4, 0x4943,
+ 0x8FA5, 0x4DAD, 0x8FA6, 0x3B4E, 0x8FA7, 0x10B6, 0x8FA8, 0x10B5,
+ 0x8FAD, 0x1AE5, 0x8FAE, 0x17FF, 0x8FAF, 0x1AE6, 0x8FB0, 0x0B62,
+ 0x8FB1, 0x09F1, 0x8FB2, 0x0CF6, 0x8FB4, 0x4944, 0x8FB5, 0x3B4F,
+ 0x8FB6, 0x3B50, 0x8FB7, 0x1AE7, 0x8FBA, 0x0E25, 0x8FBB, 0x0BF0,
+ 0x8FBC, 0x0810, 0x8FBF, 0x0B67, 0x8FC1, 0x4946, 0x8FC2, 0x04CC,
+ 0x8FC4, 0x0EA6, 0x8FC5, 0x0A1D, 0x8FC6, 0x4947, 0x8FC8, 0x3799,
+ 0x8FCA, 0x4949, 0x8FCD, 0x494A, 0x8FCE, 0x0734, 0x8FD1, 0x06D9,
+ 0x8FD3, 0x494B, 0x8FD4, 0x0E26, 0x8FD5, 0x494C, 0x8FDA, 0x1AE8,
+ 0x8FE0, 0x3B52, 0x8FE2, 0x1AEA, 0x8FE4, 0x3B53, 0x8FE5, 0x1AE9,
+ 0x8FE6, 0x0560, 0x8FE8, 0x42FB, 0x8FE9, 0x0CCE, 0x8FEA, 0x1AEB,
+ 0x8FEB, 0x0D2D, 0x8FED, 0x0C2D, 0x8FEE, 0x42FC, 0x8FEF, 0x1AEC,
+ 0x8FF0, 0x095C, 0x8FF1, 0x494D, 0x8FF4, 0x1AEE, 0x8FF5, 0x494E,
+ 0x8FF6, 0x3B54, 0x8FF7, 0x0ECE, 0x8FF8, 0x1AFD, 0x8FF9, 0x1AF0,
+ 0x8FFA, 0x1AF1, 0x8FFB, 0x494F, 0x8FFD, 0x0BE5, 0x9000, 0x0B40,
+ 0x9001, 0x0AF9, 0x9002, 0x3B55, 0x9003, 0x0C80, 0x9004, 0x4DAE,
+ 0x9005, 0x1AEF, 0x9006, 0x066F, 0x9008, 0x42FD, 0x900B, 0x1AF8,
+ 0x900C, 0x4950, 0x900D, 0x1AF5, 0x900E, 0x1B02, 0x900F, 0x0C81,
+ 0x9010, 0x0B9E, 0x9011, 0x1AF2, 0x9013, 0x0C1A, 0x9014, 0x0C4D,
+ 0x9015, 0x1AF3, 0x9016, 0x1AF7, 0x9017, 0x0A26, 0x9019, 0x0D1D,
+ 0x901A, 0x0BE8, 0x901B, 0x4DAF, 0x901D, 0x0A66, 0x901E, 0x1AF6,
+ 0x901F, 0x0B0E, 0x9020, 0x0B04, 0x9021, 0x1AF4, 0x9022, 0x046D,
+ 0x9023, 0x0FC8, 0x9027, 0x1AF9, 0x902C, 0x3B56, 0x902D, 0x42FE,
+ 0x902E, 0x0B41, 0x902F, 0x4DB0, 0x9031, 0x093F, 0x9032, 0x0A10,
+ 0x9035, 0x1AFB, 0x9036, 0x1AFA, 0x9037, 0x4951, 0x9038, 0x04B3,
+ 0x9039, 0x1AFC, 0x903C, 0x0DA1, 0x903E, 0x1B04, 0x9041, 0x0CB3,
+ 0x9042, 0x0A31, 0x9043, 0x4953, 0x9044, 0x3B57, 0x9045, 0x0B97,
+ 0x9047, 0x06F0, 0x9049, 0x1B03, 0x904A, 0x0F21, 0x904B, 0x04E1,
+ 0x904C, 0x4DB1, 0x904D, 0x0E27, 0x904E, 0x0561, 0x904F, 0x1AFE,
+ 0x9050, 0x1AFF, 0x9051, 0x1B00, 0x9052, 0x1B01, 0x9053, 0x0C93,
+ 0x9054, 0x0B61, 0x9055, 0x04A7, 0x9056, 0x1B05, 0x9058, 0x1B06,
+ 0x9059, 0x1D34, 0x905B, 0x4DB2, 0x905C, 0x0B1D, 0x905D, 0x4954,
+ 0x905E, 0x1B07, 0x9060, 0x0515, 0x9061, 0x0ACE, 0x9063, 0x0763,
+ 0x9065, 0x0F44, 0x9067, 0x21BA, 0x9068, 0x1B08, 0x9069, 0x0C26,
+ 0x906D, 0x0AFA, 0x906E, 0x0903, 0x906F, 0x1B09, 0x9070, 0x4DB3,
+ 0x9072, 0x1B0C, 0x9074, 0x4DB4, 0x9075, 0x096F, 0x9076, 0x1B0A,
+ 0x9077, 0x0AAD, 0x9078, 0x0AAC, 0x9079, 0x4DB5, 0x907A, 0x04A8,
+ 0x907C, 0x0F93, 0x907D, 0x1B0E, 0x907F, 0x0D86, 0x9080, 0x1B10,
+ 0x9081, 0x1B0F, 0x9082, 0x1B0D, 0x9083, 0x1737, 0x9084, 0x0610,
+ 0x9085, 0x4957, 0x9087, 0x1AED, 0x9088, 0x3B58, 0x9089, 0x1B12,
+ 0x908A, 0x1B11, 0x908B, 0x4DB6, 0x908C, 0x4958, 0x908F, 0x1B13,
+ 0x9090, 0x4959, 0x9091, 0x0F22, 0x9095, 0x3B59, 0x9097, 0x42FF,
+ 0x9098, 0x4DB7, 0x9099, 0x3B5A, 0x909B, 0x3B5B, 0x90A0, 0x4DB8,
+ 0x90A1, 0x495A, 0x90A2, 0x3B5C, 0x90A3, 0x0CB9, 0x90A6, 0x0E5C,
+ 0x90A8, 0x1B14, 0x90AA, 0x0905, 0x90AF, 0x1B15, 0x90B0, 0x495C,
+ 0x90B1, 0x1B16, 0x90B2, 0x4DB9, 0x90B3, 0x4300, 0x90B4, 0x3B5D,
+ 0x90B5, 0x1B17, 0x90B6, 0x495D, 0x90B8, 0x0C1B, 0x90BD, 0x4DBA,
+ 0x90BE, 0x4301, 0x90C1, 0x04AE, 0x90C3, 0x495E, 0x90C4, 0x4302,
+ 0x90C5, 0x4303, 0x90C7, 0x4304, 0x90C8, 0x495F, 0x90C9, 0x4DBB,
+ 0x90CA, 0x07EB, 0x90CE, 0x0FE0, 0x90D7, 0x3B5E, 0x90DB, 0x1B1B,
+ 0x90DC, 0x4961, 0x90DD, 0x3B5F, 0x90DE, 0x21BB, 0x90DF, 0x4962,
+ 0x90E1, 0x070A, 0x90E2, 0x1B18, 0x90E4, 0x1B19, 0x90E8, 0x0DE6,
+ 0x90EB, 0x4967, 0x90ED, 0x05B2, 0x90EF, 0x4305, 0x90F0, 0x4DBC,
+ 0x90F2, 0x4965, 0x90F4, 0x3B60, 0x90F5, 0x0F23, 0x90F6, 0x4964,
+ 0x90F7, 0x06B7, 0x90FD, 0x0C4E, 0x90FE, 0x4968, 0x90FF, 0x4969,
+ 0x9100, 0x4966, 0x9102, 0x1B1C, 0x9104, 0x496A, 0x9105, 0x4DBD,
+ 0x9106, 0x496B, 0x9112, 0x1B1D, 0x9114, 0x4306, 0x9115, 0x21BD,
+ 0x9116, 0x4307, 0x9117, 0x3B61, 0x9118, 0x496C, 0x9119, 0x1B1E,
+ 0x911C, 0x3B62, 0x911E, 0x496D, 0x9122, 0x4308, 0x9123, 0x4309,
+ 0x9125, 0x4DBE, 0x9127, 0x21BE, 0x912D, 0x0C1C, 0x912F, 0x430A,
+ 0x9130, 0x1B20, 0x9131, 0x3B63, 0x9132, 0x1B1F, 0x9134, 0x430B,
+ 0x9137, 0x496E, 0x9139, 0x496F, 0x913A, 0x3B64, 0x913D, 0x3B65,
+ 0x9146, 0x4970, 0x9147, 0x4971, 0x9148, 0x3B66, 0x9149, 0x0CAB,
+ 0x914A, 0x1B21, 0x914B, 0x0940, 0x914C, 0x090C, 0x914D, 0x0D11,
+ 0x914E, 0x0BAF, 0x9152, 0x091E, 0x9154, 0x0A32, 0x9156, 0x1B22,
+ 0x9157, 0x4972, 0x9158, 0x1B23, 0x9159, 0x4973, 0x915A, 0x4DBF,
+ 0x915B, 0x3B67, 0x9161, 0x3B68, 0x9162, 0x0A23, 0x9163, 0x1B24,
+ 0x9164, 0x3B69, 0x9165, 0x1B25, 0x9167, 0x4DC0, 0x9169, 0x1B26,
+ 0x916A, 0x0F59, 0x916C, 0x0941, 0x9172, 0x1B28, 0x9173, 0x1B27,
+ 0x9174, 0x4974, 0x9175, 0x07EC, 0x9177, 0x0805, 0x9178, 0x088E,
+ 0x9179, 0x4975, 0x917A, 0x4DC1, 0x9182, 0x1B2B, 0x9183, 0x430C,
+ 0x9185, 0x4976, 0x9187, 0x0970, 0x9189, 0x1B2A, 0x918A, 0x4DC2,
+ 0x918B, 0x1B29, 0x918D, 0x0B49, 0x918E, 0x3B6A, 0x9190, 0x07A3,
+ 0x9191, 0x4DC3, 0x9192, 0x0A67, 0x9195, 0x4DC4, 0x9197, 0x0D44,
+ 0x919C, 0x0943, 0x919E, 0x3B6B, 0x91A2, 0x1B2C, 0x91A4, 0x09C7,
+ 0x91A8, 0x3B6C, 0x91AA, 0x1B2F, 0x91AB, 0x1B2D, 0x91AC, 0x1E1B,
+ 0x91AD, 0x3B6D, 0x91AE, 0x3B6E, 0x91AF, 0x1B2E, 0x91B0, 0x4DC5,
+ 0x91B1, 0x1E61, 0x91B2, 0x3B6F, 0x91B3, 0x4977, 0x91B4, 0x1B31,
+ 0x91B5, 0x1B30, 0x91B6, 0x4978, 0x91B8, 0x09E2, 0x91BA, 0x1B32,
+ 0x91BB, 0x4DC6, 0x91BC, 0x3B70, 0x91BD, 0x4DC7, 0x91C0, 0x1B33,
+ 0x91C1, 0x1B34, 0x91C2, 0x4DC8, 0x91C3, 0x4979, 0x91C4, 0x497A,
+ 0x91C5, 0x4DC9, 0x91C6, 0x0D64, 0x91C7, 0x0843, 0x91C8, 0x090D,
+ 0x91C9, 0x1B35, 0x91CB, 0x1B36, 0x91CC, 0x0F6C, 0x91CD, 0x094F,
+ 0x91CE, 0x0EFA, 0x91CF, 0x0F94, 0x91D0, 0x1B37, 0x91D1, 0x06DA,
+ 0x91D6, 0x1B38, 0x91D7, 0x21C0, 0x91D8, 0x0C1D, 0x91DA, 0x21BF,
+ 0x91DB, 0x1B3B, 0x91DC, 0x05D6, 0x91DD, 0x0A11, 0x91DE, 0x21C1,
+ 0x91DF, 0x1B39, 0x91E1, 0x1B3A, 0x91E3, 0x0BFC, 0x91E4, 0x21C4,
+ 0x91E5, 0x21C5, 0x91E6, 0x0E83, 0x91E7, 0x06F4, 0x91EC, 0x497D,
+ 0x91ED, 0x21C2, 0x91EE, 0x21C3, 0x91F0, 0x3B71, 0x91F1, 0x430D,
+ 0x91F5, 0x1B3D, 0x91F6, 0x1B3E, 0x91F7, 0x3B72, 0x91FB, 0x3B73,
+ 0x91FC, 0x1B3C, 0x91FF, 0x1B40, 0x9200, 0x4DCA, 0x9201, 0x497E,
+ 0x9206, 0x21C6, 0x9207, 0x3B74, 0x9209, 0x4DCB, 0x920A, 0x21C8,
+ 0x920D, 0x0CB7, 0x920E, 0x05A1, 0x9210, 0x21C7, 0x9211, 0x1B44,
+ 0x9214, 0x1B41, 0x9215, 0x1B43, 0x9216, 0x497F, 0x9217, 0x4980,
+ 0x921E, 0x1B3F, 0x9223, 0x4DCC, 0x9228, 0x3B75, 0x9229, 0x1B8A,
+ 0x922C, 0x1B42, 0x9233, 0x3B76, 0x9234, 0x0FB3, 0x9237, 0x078E,
+ 0x9238, 0x3B77, 0x9239, 0x21CF, 0x923A, 0x21C9, 0x923C, 0x21CB,
+ 0x923F, 0x1B4C, 0x9240, 0x21CA, 0x9242, 0x4982, 0x9243, 0x3B78,
+ 0x9244, 0x0C2E, 0x9245, 0x1B47, 0x9247, 0x3B79, 0x9248, 0x1B4A,
+ 0x9249, 0x1B48, 0x924A, 0x4983, 0x924B, 0x1B4D, 0x924E, 0x21CC,
+ 0x924F, 0x3B7A, 0x9250, 0x1B4E, 0x9251, 0x21CE, 0x9256, 0x4984,
+ 0x9257, 0x1B46, 0x9259, 0x21CD, 0x925A, 0x1B53, 0x925B, 0x0516,
+ 0x925E, 0x1B45, 0x9260, 0x3B7B, 0x9261, 0x4985, 0x9262, 0x0D41,
+ 0x9264, 0x1B49, 0x9265, 0x4986, 0x9266, 0x09C8, 0x9267, 0x21D0,
+ 0x9268, 0x4987, 0x9271, 0x07ED, 0x9276, 0x4DCD, 0x9277, 0x21D2,
+ 0x9278, 0x21D3, 0x927C, 0x4989, 0x927D, 0x498A, 0x927E, 0x0E76,
+ 0x927F, 0x498B, 0x9280, 0x06DC, 0x9283, 0x0950, 0x9285, 0x0C94,
+ 0x9288, 0x20AA, 0x9289, 0x498C, 0x928D, 0x498D, 0x928E, 0x4DCE,
+ 0x9291, 0x0AAF, 0x9293, 0x1B51, 0x9295, 0x1B4B, 0x9296, 0x1B50,
+ 0x9297, 0x498E, 0x9298, 0x0ECF, 0x9299, 0x498F, 0x929A, 0x0BD4,
+ 0x929B, 0x1B52, 0x929C, 0x1B4F, 0x929F, 0x4990, 0x92A7, 0x21D1,
+ 0x92AB, 0x4991, 0x92AD, 0x0AAE, 0x92AF, 0x4DCF, 0x92B2, 0x4994,
+ 0x92B3, 0x3554, 0x92B7, 0x1B56, 0x92B9, 0x1B55, 0x92BB, 0x4DD0,
+ 0x92BC, 0x4DD1, 0x92BF, 0x4995, 0x92C0, 0x4996, 0x92C1, 0x4DD2,
+ 0x92C2, 0x3B7C, 0x92C3, 0x4DD3, 0x92C5, 0x4DD4, 0x92C6, 0x4997,
+ 0x92C8, 0x4DD5, 0x92CB, 0x3B7D, 0x92CC, 0x3B7E, 0x92CE, 0x4998,
+ 0x92CF, 0x1B54, 0x92D0, 0x21D7, 0x92D2, 0x0E5D, 0x92D3, 0x21DB,
+ 0x92D5, 0x21D9, 0x92D7, 0x21D5, 0x92D9, 0x21D6, 0x92DF, 0x3B7F,
+ 0x92E0, 0x21DA, 0x92E4, 0x0985, 0x92E5, 0x4999, 0x92E7, 0x21D4,
+ 0x92E9, 0x1B57, 0x92EA, 0x0E2F, 0x92ED, 0x04F6, 0x92F2, 0x0DB8,
+ 0x92F3, 0x0BB0, 0x92F7, 0x499D, 0x92F8, 0x0692, 0x92F9, 0x20B0,
+ 0x92FA, 0x1B59, 0x92FB, 0x21DE, 0x92FC, 0x07EF, 0x92FF, 0x21E1,
+ 0x9302, 0x21E3, 0x9304, 0x345A, 0x9306, 0x087A, 0x930D, 0x3B80,
+ 0x930F, 0x1B58, 0x9310, 0x0A33, 0x9311, 0x499A, 0x9314, 0x4DD6,
+ 0x9315, 0x3B81, 0x9318, 0x0A34, 0x9319, 0x1B5C, 0x931A, 0x1B5E,
+ 0x931D, 0x21E2, 0x931E, 0x21E0, 0x931F, 0x3B82, 0x9320, 0x09E3,
+ 0x9321, 0x21DD, 0x9322, 0x1B5D, 0x9323, 0x1B5F, 0x9325, 0x21DC,
+ 0x9326, 0x06CB, 0x9327, 0x3B83, 0x9328, 0x0DB7, 0x9329, 0x499E,
+ 0x932B, 0x090E, 0x932C, 0x0FC9, 0x932E, 0x1B5B, 0x932F, 0x0868,
+ 0x9332, 0x0FE5, 0x9333, 0x4DD7, 0x9335, 0x1B61, 0x9336, 0x4DD8,
+ 0x933A, 0x1B60, 0x933B, 0x1B62, 0x9344, 0x1B5A, 0x9347, 0x3B84,
+ 0x9348, 0x20A9, 0x9349, 0x430E, 0x934A, 0x3458, 0x934B, 0x0CC1,
+ 0x934D, 0x0C4F, 0x9351, 0x49A1, 0x9352, 0x3B85, 0x9354, 0x0BF3,
+ 0x9356, 0x1B67, 0x9357, 0x21E5, 0x9358, 0x4DD9, 0x935A, 0x49A2,
+ 0x935B, 0x0B81, 0x935C, 0x1B63, 0x9360, 0x1B64, 0x9364, 0x430F,
+ 0x9365, 0x4310, 0x936A, 0x3B87, 0x936B, 0x49A3, 0x936C, 0x0703,
+ 0x936D, 0x3B88, 0x936E, 0x1B66, 0x9370, 0x21E4, 0x9371, 0x49A4,
+ 0x9373, 0x49A5, 0x9375, 0x0764, 0x937C, 0x1B65, 0x937E, 0x09C9,
+ 0x937F, 0x4DDA, 0x9382, 0x4DDB, 0x9388, 0x49A9, 0x938A, 0x4DDC,
+ 0x938B, 0x49AA, 0x938C, 0x05D7, 0x938F, 0x49AB, 0x9394, 0x1B6B,
+ 0x9396, 0x082F, 0x9397, 0x0AFB, 0x939A, 0x0BE6, 0x939B, 0x3B89,
+ 0x939E, 0x49AC, 0x93A1, 0x49A6, 0x93A3, 0x4311, 0x93A4, 0x21E6,
+ 0x93A7, 0x0599, 0x93A9, 0x3B8B, 0x93AC, 0x1B69, 0x93AD, 0x1B6A,
+ 0x93AE, 0x0BDF, 0x93B0, 0x1B68, 0x93B9, 0x1B6C, 0x93BA, 0x3B8A,
+ 0x93BB, 0x4DDD, 0x93C1, 0x3B8C, 0x93C3, 0x1B72, 0x93C6, 0x21E7,
+ 0x93C7, 0x49B1, 0x93C8, 0x1B75, 0x93CA, 0x3B8D, 0x93CC, 0x4DDE,
+ 0x93D0, 0x1B74, 0x93D1, 0x0C27, 0x93D6, 0x1B6D, 0x93D7, 0x1B6E,
+ 0x93D8, 0x1B71, 0x93DC, 0x49B2, 0x93DD, 0x1B73, 0x93DE, 0x21E8,
+ 0x93DF, 0x4312, 0x93E1, 0x06B8, 0x93E2, 0x3B8E, 0x93E4, 0x1B76,
+ 0x93E5, 0x1B70, 0x93E6, 0x4DDF, 0x93E7, 0x49B3, 0x93E8, 0x1B6F,
+ 0x93F1, 0x49B0, 0x93F5, 0x49AD, 0x93F8, 0x21E9, 0x93F9, 0x4DE0,
+ 0x93FA, 0x3B8F, 0x93FB, 0x49B7, 0x93FD, 0x3B90, 0x9402, 0x4DE1,
+ 0x9403, 0x1B7A, 0x9404, 0x4313, 0x9407, 0x1B7B, 0x9409, 0x49B4,
+ 0x940D, 0x4DE2, 0x940E, 0x4DE3, 0x940F, 0x3B91, 0x9410, 0x1B7C,
+ 0x9413, 0x1B79, 0x9414, 0x1B78, 0x9416, 0x49B5, 0x9417, 0x49B6,
+ 0x9418, 0x09CA, 0x9419, 0x0C82, 0x941A, 0x1B77, 0x9421, 0x1B80,
+ 0x942B, 0x1B7E, 0x942E, 0x4DE4, 0x9431, 0x21EA, 0x9432, 0x49B8,
+ 0x9433, 0x4314, 0x9434, 0x3B92, 0x9435, 0x1B7F, 0x9436, 0x1B7D,
+ 0x9438, 0x0B58, 0x943A, 0x1B81, 0x943B, 0x49B9, 0x943F, 0x3B93,
+ 0x9441, 0x1B82, 0x9444, 0x1B84, 0x9445, 0x21EB, 0x9448, 0x21EC,
+ 0x944A, 0x4315, 0x944C, 0x4DE5, 0x9451, 0x0611, 0x9452, 0x1B83,
+ 0x9453, 0x0F06, 0x9455, 0x3B94, 0x945A, 0x1B8F, 0x945B, 0x1B85,
+ 0x945E, 0x1B88, 0x9460, 0x1B86, 0x9462, 0x1B87, 0x9463, 0x4316,
+ 0x946A, 0x1B89, 0x946B, 0x3B95, 0x946D, 0x49BC, 0x946F, 0x49BD,
+ 0x9470, 0x1B8B, 0x9471, 0x4317, 0x9472, 0x3B96, 0x9475, 0x1B8C,
+ 0x9477, 0x1B8D, 0x947C, 0x1B90, 0x947D, 0x1B8E, 0x947E, 0x1B91,
+ 0x947F, 0x1B93, 0x9481, 0x1B92, 0x9577, 0x0BD5, 0x9578, 0x3B97,
+ 0x9579, 0x49BE, 0x9580, 0x0EF3, 0x9582, 0x1B94, 0x9583, 0x0AB0,
+ 0x9586, 0x49BF, 0x9587, 0x1B95, 0x9588, 0x4DE6, 0x9589, 0x0E14,
+ 0x958A, 0x1B96, 0x958B, 0x0589, 0x958C, 0x49C0, 0x958D, 0x49C1,
+ 0x958E, 0x4318, 0x958F, 0x04DE, 0x9591, 0x0613, 0x9592, 0x21ED,
+ 0x9593, 0x0612, 0x9594, 0x1B97, 0x9596, 0x1B98, 0x9598, 0x1B99,
+ 0x9599, 0x1B9A, 0x959F, 0x4319, 0x95A0, 0x1B9B, 0x95A1, 0x4DE7,
+ 0x95A2, 0x0614, 0x95A3, 0x05B3, 0x95A4, 0x07F0, 0x95A5, 0x0D4A,
+ 0x95A6, 0x3B98, 0x95A7, 0x1B9D, 0x95A8, 0x1B9C, 0x95A9, 0x3B99,
+ 0x95AB, 0x4F59, 0x95AC, 0x431A, 0x95AD, 0x1B9E, 0x95B1, 0x3555,
+ 0x95B2, 0x04FE, 0x95B4, 0x3B9B, 0x95B6, 0x431B, 0x95B9, 0x1BA1,
+ 0x95BB, 0x1BA0, 0x95BC, 0x1B9F, 0x95BD, 0x3B9C, 0x95BE, 0x1BA2,
+ 0x95BF, 0x4DE8, 0x95C3, 0x1BA5, 0x95C6, 0x4DE9, 0x95C7, 0x048B,
+ 0x95C8, 0x49C4, 0x95C9, 0x4DEA, 0x95CA, 0x1BA3, 0x95CB, 0x431C,
+ 0x95CC, 0x1BA7, 0x95CD, 0x1BA6, 0x95D0, 0x431D, 0x95D1, 0x4DEB,
+ 0x95D2, 0x4DEC, 0x95D3, 0x431E, 0x95D4, 0x1BA9, 0x95D5, 0x1BA8,
+ 0x95D6, 0x1BAA, 0x95D8, 0x0C86, 0x95DA, 0x3B9D, 0x95DC, 0x1BAB,
+ 0x95DE, 0x4320, 0x95E0, 0x4DED, 0x95E1, 0x1BAC, 0x95E2, 0x1BAE,
+ 0x95E4, 0x4DEE, 0x95E5, 0x1BAD, 0x95E6, 0x4DEF, 0x961C, 0x0DDE,
+ 0x961D, 0x3B9E, 0x9621, 0x1BAF, 0x9624, 0x4DF0, 0x9628, 0x1BB0,
+ 0x962A, 0x0855, 0x962C, 0x49C7, 0x962E, 0x1BB1, 0x962F, 0x1BB2,
+ 0x9631, 0x4DF1, 0x9632, 0x0E77, 0x9633, 0x49C8, 0x9634, 0x49C9,
+ 0x9638, 0x4DF2, 0x963B, 0x0ACD, 0x963C, 0x49CB, 0x963D, 0x4DF3,
+ 0x963F, 0x0468, 0x9640, 0x0B2B, 0x9641, 0x3B9F, 0x9642, 0x1BB3,
+ 0x9644, 0x0DDF, 0x964B, 0x1BB6, 0x964C, 0x1BB4, 0x964D, 0x07F1,
+ 0x964F, 0x1BB5, 0x9650, 0x0776, 0x9654, 0x4DF4, 0x9658, 0x3BA0,
+ 0x965B, 0x0E15, 0x965C, 0x1BB8, 0x965D, 0x1BBA, 0x965E, 0x1BB9,
+ 0x965F, 0x1BBB, 0x9661, 0x49CC, 0x9662, 0x04C3, 0x9663, 0x0A1E,
+ 0x9664, 0x0986, 0x9665, 0x0615, 0x9666, 0x1BBC, 0x966A, 0x0D1C,
+ 0x966C, 0x1BBE, 0x9670, 0x04C4, 0x9672, 0x1BBD, 0x9673, 0x0BE0,
+ 0x9674, 0x4DF5, 0x9675, 0x0F95, 0x9676, 0x0C83, 0x9677, 0x1BB7,
+ 0x9678, 0x0F6E, 0x967A, 0x0765, 0x967B, 0x4DF6, 0x967D, 0x0F45,
+ 0x967F, 0x4DF7, 0x9681, 0x4DF8, 0x9682, 0x49CE, 0x9683, 0x4DF9,
+ 0x9684, 0x3BA1, 0x9685, 0x06F1, 0x9686, 0x0F7C, 0x9688, 0x06FE,
+ 0x9689, 0x4DFA, 0x968A, 0x0B42, 0x968B, 0x186C, 0x968D, 0x1BBF,
+ 0x968E, 0x058A, 0x968F, 0x0A35, 0x9694, 0x05B4, 0x9695, 0x1BC1,
+ 0x9696, 0x4DFB, 0x9697, 0x1BC2, 0x9698, 0x1BC0, 0x9699, 0x073A,
+ 0x969A, 0x49D0, 0x969B, 0x084D, 0x969C, 0x09CB, 0x969D, 0x21F0,
+ 0x96A0, 0x04C5, 0x96A3, 0x0FA1, 0x96A4, 0x3BA2, 0x96A5, 0x4321,
+ 0x96A7, 0x1BC4, 0x96A8, 0x1B0B, 0x96A9, 0x3BA3, 0x96AA, 0x1BC3,
+ 0x96AE, 0x4DFC, 0x96AF, 0x21F1, 0x96B0, 0x1BC7, 0x96B1, 0x1BC5,
+ 0x96B2, 0x1BC6, 0x96B3, 0x49D3, 0x96B4, 0x1BC8, 0x96B6, 0x1BC9,
+ 0x96B7, 0x0FB4, 0x96B8, 0x1BCA, 0x96B9, 0x1BCB, 0x96BA, 0x49D4,
+ 0x96BB, 0x0A6D, 0x96BC, 0x0D4F, 0x96BD, 0x49D5, 0x96C0, 0x0A43,
+ 0x96C1, 0x0623, 0x96C4, 0x0F24, 0x96C5, 0x056D, 0x96C6, 0x0942,
+ 0x96C7, 0x078F, 0x96C9, 0x1BCE, 0x96CB, 0x1BCD, 0x96CC, 0x08C1,
+ 0x96CD, 0x1BCF, 0x96CE, 0x1BCC, 0x96D1, 0x0876, 0x96D2, 0x3BA4,
+ 0x96D5, 0x1BD3, 0x96D6, 0x1992, 0x96D8, 0x49D8, 0x96D9, 0x10EB,
+ 0x96DA, 0x49D9, 0x96DB, 0x0A3D, 0x96DC, 0x1BD1, 0x96DD, 0x49DA,
+ 0x96DE, 0x3BA6, 0x96E2, 0x0F6D, 0x96E3, 0x0CC9, 0x96E8, 0x04CD,
+ 0x96E9, 0x3BA7, 0x96EA, 0x0A87, 0x96EB, 0x08E2, 0x96EF, 0x4322,
+ 0x96F0, 0x0E07, 0x96F1, 0x3BA8, 0x96F2, 0x04E2, 0x96F6, 0x0FB5,
+ 0x96F7, 0x0F55, 0x96F9, 0x1BD4, 0x96FB, 0x0C3F, 0x9700, 0x0927,
+ 0x9702, 0x3BA9, 0x9703, 0x4DFD, 0x9704, 0x1BD5, 0x9706, 0x1BD6,
+ 0x9707, 0x0A12, 0x9708, 0x1BD7, 0x9709, 0x3BAA, 0x970A, 0x0FB6,
+ 0x970D, 0x1BD2, 0x970E, 0x1BD9, 0x970F, 0x1BDB, 0x9711, 0x1BDA,
+ 0x9713, 0x1BD8, 0x9714, 0x49DC, 0x9716, 0x1BDC, 0x9719, 0x1BDD,
+ 0x971B, 0x4DFE, 0x971C, 0x0AFC, 0x971E, 0x0562, 0x9721, 0x4DFF,
+ 0x9722, 0x4E00, 0x9723, 0x49DD, 0x9724, 0x1BDE, 0x9727, 0x0EC4,
+ 0x9728, 0x4E01, 0x972A, 0x1BDF, 0x9730, 0x1BE0, 0x9731, 0x4E02,
+ 0x9732, 0x0FD0, 0x9733, 0x21F2, 0x9736, 0x49DF, 0x9738, 0x1414,
+ 0x9739, 0x1BE1, 0x973B, 0x21F3, 0x973D, 0x1BE2, 0x973E, 0x1BE3,
+ 0x9741, 0x49E0, 0x9742, 0x1BE7, 0x9743, 0x21F4, 0x9744, 0x1BE4,
+ 0x9746, 0x1BE5, 0x9747, 0x49E1, 0x9748, 0x1BE6, 0x9749, 0x1BE8,
+ 0x974D, 0x21F5, 0x974E, 0x4323, 0x974F, 0x21F6, 0x9751, 0x21F7,
+ 0x9752, 0x0A68, 0x9755, 0x4F5A, 0x9756, 0x0F03, 0x9757, 0x49E2,
+ 0x9759, 0x0A69, 0x975A, 0x3BAB, 0x975B, 0x49E3, 0x975C, 0x1BE9,
+ 0x975E, 0x0D87, 0x9760, 0x1BEA, 0x9761, 0x1D06, 0x9762, 0x0ED8,
+ 0x9763, 0x3BAC, 0x9764, 0x1BEB, 0x9766, 0x1BEC, 0x9767, 0x4E03,
+ 0x9768, 0x1BED, 0x9769, 0x05B5, 0x976A, 0x49E4, 0x976B, 0x1BEF,
+ 0x976D, 0x0A1F, 0x976E, 0x3BAD, 0x9771, 0x1BF0, 0x9773, 0x3BAE,
+ 0x9774, 0x06FA, 0x9776, 0x4E04, 0x9779, 0x1BF1, 0x977A, 0x1BF5,
+ 0x977C, 0x1BF3, 0x977D, 0x4E05, 0x977F, 0x4E06, 0x9781, 0x1BF4,
+ 0x9784, 0x05D1, 0x9785, 0x1BF2, 0x9786, 0x1BF6, 0x978B, 0x1BF7,
+ 0x978D, 0x048C, 0x978F, 0x1BF8, 0x9790, 0x1BF9, 0x9795, 0x4324,
+ 0x9796, 0x49E7, 0x9798, 0x09CC, 0x9799, 0x4E07, 0x979A, 0x3BAF,
+ 0x979C, 0x1BFA, 0x979E, 0x49E8, 0x979F, 0x4E08, 0x97A0, 0x0661,
+ 0x97A2, 0x3BB0, 0x97A3, 0x1BFD, 0x97A6, 0x1BFC, 0x97A8, 0x1BFB,
+ 0x97AB, 0x1A34, 0x97AC, 0x4E09, 0x97AD, 0x0E2C, 0x97AE, 0x4325,
+ 0x97B1, 0x49E9, 0x97B2, 0x49EA, 0x97B3, 0x1BFE, 0x97B4, 0x1BFF,
+ 0x97B5, 0x3BB1, 0x97B6, 0x3BB2, 0x97B9, 0x4E0A, 0x97BA, 0x4326,
+ 0x97BE, 0x49EB, 0x97C1, 0x4327, 0x97C3, 0x1C00, 0x97C6, 0x1C01,
+ 0x97C8, 0x1C02, 0x97C9, 0x4328, 0x97CB, 0x1C03, 0x97CC, 0x49EC,
+ 0x97CD, 0x4E0B, 0x97D1, 0x49ED, 0x97D3, 0x0616, 0x97D4, 0x49EE,
+ 0x97D8, 0x49EF, 0x97D9, 0x3BB3, 0x97DB, 0x4329, 0x97DC, 0x1C04,
+ 0x97DE, 0x3BB4, 0x97E0, 0x4E0C, 0x97E1, 0x49F0, 0x97ED, 0x1C05,
+ 0x97EE, 0x0CD9, 0x97EF, 0x4E0D, 0x97F1, 0x49F1, 0x97F2, 0x1C07,
+ 0x97F3, 0x053B, 0x97F4, 0x3BB5, 0x97F5, 0x1C0A, 0x97F6, 0x1C09,
+ 0x97FB, 0x04C6, 0x97FF, 0x06B9, 0x9801, 0x0E17, 0x9802, 0x0BD6,
+ 0x9803, 0x0812, 0x9804, 0x49F2, 0x9805, 0x07F2, 0x9806, 0x0971,
+ 0x9807, 0x4E0E, 0x9808, 0x0A22, 0x980A, 0x3BB6, 0x980C, 0x1C0C,
+ 0x980D, 0x49F3, 0x980E, 0x3BB7, 0x980F, 0x1C0B, 0x9810, 0x0F2C,
+ 0x9811, 0x0624, 0x9812, 0x0D66, 0x9813, 0x0CB4, 0x9814, 0x49F4,
+ 0x9816, 0x49F5, 0x9817, 0x0A42, 0x9818, 0x0F96, 0x981A, 0x0731,
+ 0x981E, 0x3BB8, 0x9821, 0x1C0F, 0x9823, 0x3BB9, 0x9824, 0x1C0E,
+ 0x9825, 0x49FA, 0x9826, 0x4E0F, 0x982B, 0x3BBA, 0x982C, 0x0E79,
+ 0x982D, 0x0C84, 0x982E, 0x4E10, 0x9830, 0x1E73, 0x9832, 0x49F8,
+ 0x9833, 0x49F9, 0x9834, 0x04F2, 0x9837, 0x1C10, 0x9838, 0x1C0D,
+ 0x9839, 0x37B3, 0x983B, 0x0DC3, 0x983C, 0x0F54, 0x983D, 0x1C11,
+ 0x983E, 0x3BBB, 0x9846, 0x1C12, 0x9847, 0x49FB, 0x984B, 0x1C14,
+ 0x984C, 0x0B4A, 0x984D, 0x05B9, 0x984E, 0x05BA, 0x984F, 0x1C13,
+ 0x9852, 0x3BBC, 0x9853, 0x3BBD, 0x9854, 0x0625, 0x9855, 0x0766,
+ 0x9856, 0x432A, 0x9857, 0x21F9, 0x9858, 0x0626, 0x9859, 0x3BBE,
+ 0x985A, 0x1E48, 0x985B, 0x0C39, 0x985E, 0x0FA8, 0x9862, 0x4E11,
+ 0x9863, 0x4E12, 0x9865, 0x21FA, 0x9866, 0x49FC, 0x9867, 0x0790,
+ 0x986B, 0x1C15, 0x986C, 0x3BBF, 0x986F, 0x1C16, 0x9870, 0x1C17,
+ 0x9871, 0x1C18, 0x9873, 0x1C1A, 0x9874, 0x1C19, 0x98A8, 0x0DE9,
+ 0x98AA, 0x1C1B, 0x98AB, 0x49FD, 0x98AD, 0x49FE, 0x98AF, 0x1C1C,
+ 0x98B0, 0x49FF, 0x98B1, 0x1C1D, 0x98B4, 0x4E13, 0x98B6, 0x1C1E,
+ 0x98B7, 0x4A01, 0x98B8, 0x3BC0, 0x98BA, 0x3BC1, 0x98BB, 0x4A02,
+ 0x98BC, 0x4A03, 0x98BF, 0x3BC2, 0x98C2, 0x4A04, 0x98C3, 0x1C20,
+ 0x98C4, 0x1C1F, 0x98C5, 0x4E14, 0x98C6, 0x1C21, 0x98C7, 0x4A05,
+ 0x98C8, 0x3BC3, 0x98CB, 0x4A06, 0x98DB, 0x0D88, 0x98DC, 0x1839,
+ 0x98DF, 0x09EF, 0x98E0, 0x3618, 0x98E1, 0x4A07, 0x98E2, 0x064C,
+ 0x98E3, 0x4A08, 0x98E5, 0x3BC4, 0x98E7, 0x432B, 0x98E9, 0x1C22,
+ 0x98EA, 0x4A09, 0x98EB, 0x1C23, 0x98ED, 0x10C1, 0x98EE, 0x14DA,
+ 0x98EF, 0x0D67, 0x98F0, 0x4A0A, 0x98F1, 0x4A0B, 0x98F2, 0x04BF,
+ 0x98F3, 0x4A0C, 0x98F4, 0x047F, 0x98FC, 0x08C2, 0x98FD, 0x0E5E,
+ 0x98FE, 0x09E6, 0x9902, 0x4E15, 0x9903, 0x1C24, 0x9905, 0x0EEB,
+ 0x9908, 0x4A0D, 0x9909, 0x1C25, 0x990A, 0x0F46, 0x990C, 0x04E4,
+ 0x9910, 0x088F, 0x9911, 0x4E16, 0x9912, 0x1C26, 0x9913, 0x056E,
+ 0x9914, 0x1C27, 0x9915, 0x4E17, 0x9916, 0x4A10, 0x9917, 0x4A11,
+ 0x9918, 0x1C28, 0x991A, 0x4A13, 0x991B, 0x4A14, 0x991C, 0x4A15,
+ 0x991D, 0x1C2A, 0x991E, 0x1C2B, 0x9920, 0x1C2D, 0x9921, 0x1C29,
+ 0x9924, 0x1C2C, 0x9927, 0x21FD, 0x9928, 0x0617, 0x992C, 0x1C2E,
+ 0x992E, 0x1C2F, 0x9931, 0x4A17, 0x9932, 0x3BC5, 0x9933, 0x3BC6,
+ 0x9935, 0x4E18, 0x993A, 0x4A18, 0x993B, 0x4A19, 0x993C, 0x4A1A,
+ 0x993D, 0x1C30, 0x993E, 0x1C31, 0x9940, 0x3BC7, 0x9941, 0x4A1B,
+ 0x9942, 0x1C32, 0x9945, 0x1C34, 0x9946, 0x4A1C, 0x9948, 0x4E19,
+ 0x9949, 0x1C33, 0x994B, 0x1C36, 0x994C, 0x1C39, 0x994D, 0x3BC8,
+ 0x994E, 0x4A1D, 0x9950, 0x1C35, 0x9951, 0x1C37, 0x9952, 0x1C38,
+ 0x9954, 0x4E1A, 0x9955, 0x1C3A, 0x9957, 0x06BA, 0x9958, 0x432C,
+ 0x995C, 0x3BC9, 0x995E, 0x4E1B, 0x995F, 0x3BCA, 0x9960, 0x4A1E,
+ 0x9996, 0x091F, 0x9997, 0x1C3B, 0x9998, 0x1C3C, 0x9999, 0x07F3,
+ 0x999E, 0x21FF, 0x99A3, 0x4A1F, 0x99A5, 0x1C3D, 0x99A6, 0x4A20,
+ 0x99A8, 0x059C, 0x99AC, 0x0D05, 0x99AD, 0x1C3E, 0x99AE, 0x1C3F,
+ 0x99B1, 0x3BCB, 0x99B3, 0x0B98, 0x99B4, 0x0CC3, 0x99B9, 0x3BCC,
+ 0x99BA, 0x3BCD, 0x99BC, 0x1C40, 0x99BD, 0x4A21, 0x99BF, 0x4A22,
+ 0x99C1, 0x0D33, 0x99C3, 0x4A23, 0x99C4, 0x0B2C, 0x99C5, 0x04FA,
+ 0x99C6, 0x06E6, 0x99C8, 0x06E7, 0x99C9, 0x3BCE, 0x99D0, 0x0BB1,
+ 0x99D1, 0x1C45, 0x99D2, 0x06E8, 0x99D4, 0x4A24, 0x99D5, 0x056F,
+ 0x99D8, 0x1C44, 0x99D9, 0x4A25, 0x99DB, 0x1C42, 0x99DD, 0x1C43,
+ 0x99DE, 0x4A26, 0x99DF, 0x1C41, 0x99E1, 0x4E1C, 0x99E2, 0x1C4F,
+ 0x99ED, 0x1C46, 0x99EE, 0x1C47, 0x99F0, 0x4A28, 0x99F1, 0x1C48,
+ 0x99F2, 0x1C49, 0x99F8, 0x1C4B, 0x99F9, 0x4A29, 0x99FB, 0x1C4A,
+ 0x99FC, 0x4A2A, 0x99FF, 0x0963, 0x9A01, 0x1C4C, 0x9A02, 0x3BCF,
+ 0x9A03, 0x432D, 0x9A05, 0x1C4E, 0x9A08, 0x37BA, 0x9A0A, 0x4A2B,
+ 0x9A0C, 0x4E1D, 0x9A0E, 0x064D, 0x9A0F, 0x1C4D, 0x9A10, 0x4E1E,
+ 0x9A11, 0x4A2C, 0x9A12, 0x0AFD, 0x9A13, 0x0767, 0x9A16, 0x3BD0,
+ 0x9A19, 0x1C50, 0x9A1A, 0x4A2D, 0x9A20, 0x4A2E, 0x9A23, 0x4E1F,
+ 0x9A24, 0x3BD1, 0x9A27, 0x3BD2, 0x9A28, 0x0B2D, 0x9A2B, 0x1C51,
+ 0x9A2D, 0x3BD3, 0x9A2E, 0x3BD4, 0x9A30, 0x0C85, 0x9A31, 0x4A2F,
+ 0x9A36, 0x3BD5, 0x9A37, 0x1C52, 0x9A38, 0x3BD6, 0x9A3E, 0x1C57,
+ 0x9A40, 0x1C55, 0x9A41, 0x4E20, 0x9A42, 0x1C54, 0x9A43, 0x1C56,
+ 0x9A44, 0x4A30, 0x9A45, 0x1C53, 0x9A4A, 0x3BD7, 0x9A4C, 0x4A31,
+ 0x9A4D, 0x1C59, 0x9A4E, 0x2200, 0x9A51, 0x4E21, 0x9A52, 0x1E2F,
+ 0x9A55, 0x1C58, 0x9A56, 0x3BD8, 0x9A57, 0x1C5B, 0x9A58, 0x4A32,
+ 0x9A5A, 0x06BB, 0x9A5B, 0x1C5A, 0x9A5F, 0x1C5C, 0x9A62, 0x1C5D,
+ 0x9A64, 0x1C5F, 0x9A65, 0x1C5E, 0x9A69, 0x1C60, 0x9A6A, 0x1C62,
+ 0x9A6B, 0x1C61, 0x9AA8, 0x080E, 0x9AAD, 0x1C63, 0x9AAF, 0x4A34,
+ 0x9AB0, 0x1C64, 0x9AB5, 0x3BD9, 0x9AB6, 0x3BDA, 0x9AB7, 0x4A36,
+ 0x9AB8, 0x059A, 0x9AB9, 0x4A38, 0x9ABC, 0x1C65, 0x9ABD, 0x4E22,
+ 0x9ABE, 0x4E23, 0x9AC0, 0x1C66, 0x9AC1, 0x432E, 0x9AC3, 0x432F,
+ 0x9AC4, 0x0A37, 0x9AC6, 0x4A3A, 0x9ACE, 0x4330, 0x9ACF, 0x1C67,
+ 0x9AD0, 0x4A3B, 0x9AD1, 0x1C68, 0x9AD2, 0x4A3C, 0x9AD3, 0x1C69,
+ 0x9AD4, 0x1C6A, 0x9AD5, 0x4A3D, 0x9AD6, 0x4331, 0x9AD8, 0x07F4,
+ 0x9AD9, 0x2201, 0x9ADC, 0x2202, 0x9ADE, 0x1C6B, 0x9ADF, 0x1C6C,
+ 0x9AE0, 0x4A3E, 0x9AE2, 0x1C6D, 0x9AE3, 0x1C6E, 0x9AE5, 0x4A3F,
+ 0x9AE6, 0x1C6F, 0x9AE9, 0x4A40, 0x9AEA, 0x0D45, 0x9AEB, 0x1C71,
+ 0x9AED, 0x0D98, 0x9AEE, 0x1C72, 0x9AEF, 0x1C70, 0x9AF1, 0x1C74,
+ 0x9AF4, 0x1C73, 0x9AF7, 0x1C75, 0x9AF9, 0x3BDB, 0x9AFB, 0x1C76,
+ 0x9B01, 0x4E24, 0x9B02, 0x4332, 0x9B03, 0x3BDC, 0x9B06, 0x1C77,
+ 0x9B08, 0x4333, 0x9B09, 0x4E25, 0x9B0B, 0x4E26, 0x9B0C, 0x4A41,
+ 0x9B0D, 0x4E27, 0x9B0E, 0x4E28, 0x9B10, 0x4A42, 0x9B12, 0x4A43,
+ 0x9B16, 0x4A44, 0x9B18, 0x1C78, 0x9B19, 0x4E29, 0x9B1A, 0x1C79,
+ 0x9B1C, 0x4A45, 0x9B1D, 0x4F49, 0x9B1F, 0x1C7A, 0x9B20, 0x3BDD,
+ 0x9B22, 0x1C7B, 0x9B23, 0x1C7C, 0x9B25, 0x1C7D, 0x9B27, 0x1C7E,
+ 0x9B28, 0x1C7F, 0x9B29, 0x1C80, 0x9B2A, 0x1C81, 0x9B2B, 0x4A46,
+ 0x9B2C, 0x4F4A, 0x9B2D, 0x4335, 0x9B2E, 0x1C82, 0x9B2F, 0x1C83,
+ 0x9B31, 0x14D4, 0x9B32, 0x1C84, 0x9B33, 0x3BDE, 0x9B34, 0x3BDF,
+ 0x9B35, 0x4E2A, 0x9B3B, 0x17A9, 0x9B3C, 0x064E, 0x9B3D, 0x4A47,
+ 0x9B41, 0x057F, 0x9B42, 0x0822, 0x9B43, 0x1C86, 0x9B44, 0x1C85,
+ 0x9B45, 0x0EB1, 0x9B48, 0x4E2B, 0x9B4B, 0x4A49, 0x9B4D, 0x1C88,
+ 0x9B4E, 0x1C89, 0x9B4F, 0x1C87, 0x9B51, 0x1C8A, 0x9B54, 0x0E90,
+ 0x9B55, 0x4E2C, 0x9B58, 0x1C8B, 0x9B5A, 0x0695, 0x9B5E, 0x4336,
+ 0x9B63, 0x4A4A, 0x9B65, 0x4A4B, 0x9B66, 0x4337, 0x9B68, 0x4E2D,
+ 0x9B6B, 0x4A4C, 0x9B6C, 0x4A4D, 0x9B6F, 0x0FCB, 0x9B72, 0x2204,
+ 0x9B73, 0x3BE0, 0x9B74, 0x1C8C, 0x9B75, 0x2203, 0x9B76, 0x4A4E,
+ 0x9B77, 0x4A4F, 0x9B79, 0x3BE1, 0x9B80, 0x4E2E, 0x9B83, 0x1C8E,
+ 0x9B84, 0x4338, 0x9B86, 0x4E2F, 0x9B8A, 0x4339, 0x9B8E, 0x0482,
+ 0x9B8F, 0x2205, 0x9B90, 0x4E30, 0x9B91, 0x1C8F, 0x9B92, 0x0DFB,
+ 0x9B93, 0x1C8D, 0x9B96, 0x1C90, 0x9B97, 0x1C91, 0x9B9D, 0x4E31,
+ 0x9B9E, 0x433A, 0x9B9F, 0x1C92, 0x9BA0, 0x1C93, 0x9BA6, 0x4A50,
+ 0x9BA7, 0x3BE2, 0x9BA8, 0x1C94, 0x9BAA, 0x0E9C, 0x9BAB, 0x087B,
+ 0x9BAC, 0x4A51, 0x9BAD, 0x086A, 0x9BAE, 0x0AB1, 0x9BB0, 0x4E32,
+ 0x9BB1, 0x2206, 0x9BB2, 0x4A53, 0x9BB4, 0x1C95, 0x9BB8, 0x4A54,
+ 0x9BB9, 0x1C98, 0x9BBB, 0x2207, 0x9BBE, 0x4A55, 0x9BBF, 0x4E33,
+ 0x9BC0, 0x1C96, 0x9BC1, 0x3BE3, 0x9BC6, 0x1C99, 0x9BC7, 0x3BE4,
+ 0x9BC8, 0x4E34, 0x9BC9, 0x07A5, 0x9BCA, 0x1C97, 0x9BCE, 0x433B,
+ 0x9BCF, 0x1C9A, 0x9BD1, 0x1C9B, 0x9BD2, 0x1C9C, 0x9BD4, 0x1CA0,
+ 0x9BD6, 0x0878, 0x9BD7, 0x3BE5, 0x9BD8, 0x4A57, 0x9BDB, 0x0B44,
+ 0x9BDD, 0x4A58, 0x9BDF, 0x37BF, 0x9BE1, 0x1CA1, 0x9BE2, 0x1C9E,
+ 0x9BE3, 0x1C9D, 0x9BE4, 0x1C9F, 0x9BE5, 0x433C, 0x9BE7, 0x3BE6,
+ 0x9BE8, 0x0735, 0x9BEA, 0x4A59, 0x9BEB, 0x3BE7, 0x9BEE, 0x4A5B,
+ 0x9BEF, 0x4A5A, 0x9BF0, 0x1CA5, 0x9BF1, 0x1CA4, 0x9BF2, 0x1CA3,
+ 0x9BF3, 0x4A56, 0x9BF5, 0x0477, 0x9BF7, 0x3BE8, 0x9BF8, 0x433D,
+ 0x9BFA, 0x3BE9, 0x9BFD, 0x3BEA, 0x9BFF, 0x4E35, 0x9C00, 0x2208,
+ 0x9C02, 0x4E36, 0x9C04, 0x1CAF, 0x9C06, 0x1CAB, 0x9C08, 0x1CAC,
+ 0x9C09, 0x1CA8, 0x9C0A, 0x1CAE, 0x9C0B, 0x3BEB, 0x9C0C, 0x1CAA,
+ 0x9C0D, 0x05C0, 0x9C10, 0x0FF2, 0x9C12, 0x1CAD, 0x9C13, 0x1CA9,
+ 0x9C14, 0x1CA7, 0x9C15, 0x1CA6, 0x9C16, 0x4A5F, 0x9C18, 0x4A60,
+ 0x9C19, 0x4A61, 0x9C1A, 0x4A62, 0x9C1B, 0x1CB1, 0x9C1C, 0x4E37,
+ 0x9C1D, 0x4A63, 0x9C21, 0x1CB4, 0x9C22, 0x4A64, 0x9C23, 0x433E,
+ 0x9C24, 0x1CB3, 0x9C25, 0x1CB2, 0x9C27, 0x3BEC, 0x9C29, 0x4A65,
+ 0x9C2A, 0x3BED, 0x9C2D, 0x0DBB, 0x9C2E, 0x1CB0, 0x9C2F, 0x04B7,
+ 0x9C30, 0x1CB5, 0x9C31, 0x4A67, 0x9C32, 0x1CB7, 0x9C35, 0x4E38,
+ 0x9C36, 0x3BEE, 0x9C37, 0x4A68, 0x9C39, 0x05CD, 0x9C3A, 0x1CA2,
+ 0x9C3B, 0x04D9, 0x9C3E, 0x1CB9, 0x9C41, 0x3BEF, 0x9C44, 0x4E39,
+ 0x9C45, 0x4A69, 0x9C46, 0x1CB8, 0x9C47, 0x1CB6, 0x9C48, 0x0B6B,
+ 0x9C49, 0x4A6C, 0x9C4A, 0x4A6D, 0x9C4F, 0x433F, 0x9C50, 0x4340,
+ 0x9C52, 0x0E9E, 0x9C53, 0x3BF0, 0x9C54, 0x4A6F, 0x9C56, 0x4E3A,
+ 0x9C57, 0x0FA2, 0x9C58, 0x4A70, 0x9C5A, 0x1CBA, 0x9C5B, 0x4A71,
+ 0x9C5C, 0x4A6A, 0x9C5D, 0x4A72, 0x9C5F, 0x4A73, 0x9C60, 0x1CBB,
+ 0x9C61, 0x4E3B, 0x9C63, 0x3BF1, 0x9C65, 0x4341, 0x9C67, 0x1CBC,
+ 0x9C68, 0x4E3C, 0x9C69, 0x4A74, 0x9C6A, 0x4A75, 0x9C6B, 0x4A76,
+ 0x9C6D, 0x4A77, 0x9C6E, 0x4A78, 0x9C70, 0x3BF2, 0x9C72, 0x4A79,
+ 0x9C75, 0x4A7A, 0x9C76, 0x1CBD, 0x9C77, 0x3BF3, 0x9C78, 0x1CBE,
+ 0x9C7A, 0x4A7B, 0x9CE5, 0x0BD7, 0x9CE6, 0x4A7C, 0x9CE7, 0x1CBF,
+ 0x9CE9, 0x0D4B, 0x9CEB, 0x1CC4, 0x9CEC, 0x1CC0, 0x9CF0, 0x1CC1,
+ 0x9CF2, 0x4A7D, 0x9CF3, 0x0E5F, 0x9CF4, 0x0ED0, 0x9CF6, 0x0CA8,
+ 0x9D02, 0x3BF4, 0x9D03, 0x1CC5, 0x9D06, 0x1CC6, 0x9D07, 0x0C96,
+ 0x9D08, 0x1CC3, 0x9D09, 0x1CC2, 0x9D0B, 0x4A7E, 0x9D0E, 0x052A,
+ 0x9D11, 0x4A80, 0x9D12, 0x1CCE, 0x9D15, 0x1CCD, 0x9D17, 0x4A81,
+ 0x9D18, 0x4A82, 0x9D1B, 0x0517, 0x9D1D, 0x4342, 0x9D1E, 0x4343,
+ 0x9D1F, 0x1CCB, 0x9D23, 0x1CCA, 0x9D26, 0x1CC8, 0x9D28, 0x05D9,
+ 0x9D2A, 0x1CC7, 0x9D2B, 0x08DE, 0x9D2C, 0x0529, 0x9D30, 0x4E3D,
+ 0x9D32, 0x4A86, 0x9D3B, 0x07F5, 0x9D3D, 0x4E3E, 0x9D3E, 0x1CD1,
+ 0x9D3F, 0x1CD0, 0x9D41, 0x1CCF, 0x9D42, 0x3BF5, 0x9D43, 0x4344,
+ 0x9D44, 0x1CCC, 0x9D46, 0x1CD2, 0x9D47, 0x3BF6, 0x9D48, 0x1CD3,
+ 0x9D4A, 0x4A88, 0x9D50, 0x1CD8, 0x9D51, 0x1CD7, 0x9D52, 0x4345,
+ 0x9D59, 0x1CD9, 0x9D5C, 0x04CF, 0x9D5D, 0x1CD4, 0x9D5E, 0x1CD5,
+ 0x9D5F, 0x4A89, 0x9D60, 0x0806, 0x9D61, 0x0EC5, 0x9D62, 0x4A8A,
+ 0x9D63, 0x3BF7, 0x9D64, 0x1CD6, 0x9D69, 0x3BF8, 0x9D6A, 0x4E3F,
+ 0x9D6B, 0x220A, 0x9D6C, 0x0E60, 0x9D6F, 0x1CDE, 0x9D70, 0x2209,
+ 0x9D72, 0x1CDA, 0x9D73, 0x4A8D, 0x9D76, 0x4A8E, 0x9D77, 0x4A8F,
+ 0x9D7A, 0x1CDF, 0x9D7B, 0x4E40, 0x9D7C, 0x3BF9, 0x9D7E, 0x3BFA,
+ 0x9D84, 0x4A90, 0x9D87, 0x1CDC, 0x9D89, 0x1CDB, 0x9D8A, 0x4346,
+ 0x9D8D, 0x3BFB, 0x9D8F, 0x0732, 0x9D96, 0x4347, 0x9D99, 0x4A91,
+ 0x9D9A, 0x1CE0, 0x9DA1, 0x4A92, 0x9DA4, 0x1CE1, 0x9DA9, 0x1CE2,
+ 0x9DAB, 0x1CDD, 0x9DAC, 0x4349, 0x9DAF, 0x1CC9, 0x9DB1, 0x3BFC,
+ 0x9DB2, 0x1CE3, 0x9DB4, 0x0BFD, 0x9DB5, 0x4A94, 0x9DB8, 0x1CE7,
+ 0x9DB9, 0x4A95, 0x9DBA, 0x1CE8, 0x9DBB, 0x1CE6, 0x9DBC, 0x434A,
+ 0x9DBD, 0x4A96, 0x9DBF, 0x4A93, 0x9DC0, 0x4348, 0x9DC1, 0x1CE5,
+ 0x9DC2, 0x1CEB, 0x9DC3, 0x3BFD, 0x9DC4, 0x1CE4, 0x9DC6, 0x1CE9,
+ 0x9DC7, 0x3BFE, 0x9DC9, 0x4A97, 0x9DCF, 0x1CEA, 0x9DD3, 0x1CED,
+ 0x9DD6, 0x3BFF, 0x9DD7, 0x1DDE, 0x9DD9, 0x1CEC, 0x9DDA, 0x4A98,
+ 0x9DDF, 0x3C00, 0x9DE0, 0x4A99, 0x9DE3, 0x4A9A, 0x9DE5, 0x4E41,
+ 0x9DE6, 0x1CEF, 0x9DE7, 0x434C, 0x9DE9, 0x4E42, 0x9DEB, 0x3C01,
+ 0x9DED, 0x1CF0, 0x9DEF, 0x1CF1, 0x9DF2, 0x0FEF, 0x9DF3, 0x4E43,
+ 0x9DF4, 0x3C02, 0x9DF8, 0x1CEE, 0x9DF9, 0x0B4B, 0x9DFA, 0x085D,
+ 0x9DFD, 0x1CF2, 0x9E02, 0x4A9D, 0x9E07, 0x434D, 0x9E0A, 0x4A9C,
+ 0x9E0D, 0x4A9E, 0x9E15, 0x3C03, 0x9E19, 0x220C, 0x9E1A, 0x1CF3,
+ 0x9E1B, 0x1CF4, 0x9E1C, 0x4A9F, 0x9E1D, 0x3C04, 0x9E1E, 0x1CF5,
+ 0x9E75, 0x1CF6, 0x9E78, 0x0768, 0x9E79, 0x1CF7, 0x9E7A, 0x4E44,
+ 0x9E7B, 0x4AA0, 0x9E7C, 0x1DFD, 0x9E7D, 0x1CF8, 0x9E7F, 0x08DB,
+ 0x9E80, 0x4AA2, 0x9E81, 0x1CF9, 0x9E82, 0x4E45, 0x9E83, 0x4E46,
+ 0x9E84, 0x4E47, 0x9E85, 0x4AA3, 0x9E88, 0x1CFA, 0x9E8B, 0x1CFB,
+ 0x9E8C, 0x1CFC, 0x9E91, 0x1CFF, 0x9E92, 0x1CFD, 0x9E93, 0x0FE2,
+ 0x9E95, 0x1CFE, 0x9E97, 0x0FB7, 0x9E9B, 0x4AA4, 0x9E9D, 0x1D00,
+ 0x9E9E, 0x434E, 0x9E9F, 0x0FA3, 0x9EA4, 0x3C05, 0x9EA5, 0x1D01,
+ 0x9EA6, 0x0D34, 0x9EA8, 0x3C06, 0x9EA9, 0x1D02, 0x9EAA, 0x1D04,
+ 0x9EAC, 0x3C07, 0x9EAD, 0x1D05, 0x9EAF, 0x434F, 0x9EB0, 0x4E48,
+ 0x9EB4, 0x1E02, 0x9EB5, 0x1E75, 0x9EB8, 0x1D03, 0x9EB9, 0x07FF,
+ 0x9EBA, 0x0ED9, 0x9EBB, 0x0E91, 0x9EBC, 0x1284, 0x9EBD, 0x4AA6,
+ 0x9EBE, 0x14FF, 0x9EBF, 0x0EA9, 0x9EC3, 0x340B, 0x9EC4, 0x052B,
+ 0x9ECC, 0x1D07, 0x9ECD, 0x066A, 0x9ECE, 0x1D08, 0x9ECF, 0x1D09,
+ 0x9ED0, 0x1D0A, 0x9ED1, 0x220D, 0x9ED2, 0x0807, 0x9ED4, 0x1D0B,
+ 0x9ED8, 0x160D, 0x9ED9, 0x0EE7, 0x9EDB, 0x0B43, 0x9EDC, 0x1D0C,
+ 0x9EDD, 0x1D0E, 0x9EDE, 0x1D0D, 0x9EDF, 0x4AA8, 0x9EE0, 0x1D0F,
+ 0x9EE4, 0x4E49, 0x9EE5, 0x1D10, 0x9EE7, 0x3C08, 0x9EE8, 0x1D11,
+ 0x9EEE, 0x3C09, 0x9EEF, 0x1D12, 0x9EF0, 0x4E4A, 0x9EF2, 0x4E4B,
+ 0x9EF4, 0x1D13, 0x9EF6, 0x1D14, 0x9EF7, 0x1D15, 0x9EF9, 0x1D16,
+ 0x9EFB, 0x1D17, 0x9EFC, 0x1D18, 0x9EFD, 0x1D19, 0x9EFF, 0x4AA9,
+ 0x9F02, 0x4AAA, 0x9F03, 0x4AAC, 0x9F07, 0x1D1A, 0x9F08, 0x1D1B,
+ 0x9F09, 0x4E4C, 0x9F0E, 0x0C1E, 0x9F0F, 0x4E4D, 0x9F10, 0x3C0A,
+ 0x9F12, 0x3C0B, 0x9F13, 0x0791, 0x9F14, 0x4E4E, 0x9F15, 0x1D1D,
+ 0x9F17, 0x3C0C, 0x9F19, 0x3C0D, 0x9F1B, 0x4E4F, 0x9F20, 0x0ACF,
+ 0x9F21, 0x1D1E, 0x9F22, 0x4E50, 0x9F26, 0x4E51, 0x9F2A, 0x4E52,
+ 0x9F2B, 0x4E53, 0x9F2C, 0x1D1F, 0x9F2F, 0x3C0E, 0x9F34, 0x4E54,
+ 0x9F37, 0x3C0F, 0x9F39, 0x3C10, 0x9F3A, 0x4AAD, 0x9F3B, 0x0D93,
+ 0x9F3D, 0x4AAE, 0x9F3E, 0x1D20, 0x9F41, 0x3C11, 0x9F45, 0x3C12,
+ 0x9F46, 0x4AAF, 0x9F4A, 0x1D21, 0x9F4B, 0x170A, 0x9F4E, 0x1A7B,
+ 0x9F4F, 0x1C06, 0x9F52, 0x1D22, 0x9F53, 0x4AB0, 0x9F54, 0x1D23,
+ 0x9F55, 0x4AB1, 0x9F57, 0x3C13, 0x9F58, 0x4AB2, 0x9F5A, 0x4E55,
+ 0x9F5D, 0x4AB4, 0x9F5F, 0x1D25, 0x9F60, 0x1D26, 0x9F61, 0x1D27,
+ 0x9F62, 0x0FB8, 0x9F63, 0x1D24, 0x9F66, 0x1D28, 0x9F67, 0x1D29,
+ 0x9F68, 0x3C14, 0x9F69, 0x4AB6, 0x9F6A, 0x1D2B, 0x9F6C, 0x1D2A,
+ 0x9F6D, 0x4AB7, 0x9F6F, 0x4E56, 0x9F70, 0x4AB8, 0x9F71, 0x3C15,
+ 0x9F72, 0x1D2D, 0x9F75, 0x3C16, 0x9F76, 0x1D2E, 0x9F77, 0x1D2C,
+ 0x9F8D, 0x0F7E, 0x9F90, 0x3C17, 0x9F94, 0x3C18, 0x9F95, 0x1D2F,
+ 0x9F97, 0x4350, 0x9F9C, 0x1D30, 0x9F9D, 0x1727, 0x9F9E, 0x4E57,
+ 0x9FA0, 0x1D31, 0x9FA2, 0x3C19, 0x9FA5, 0x4E58, 0xF860, 0x3C54,
+ 0xF861, 0x3C55, 0xF862, 0x3C56, 0xF87A, 0x3C57, 0xF87F, 0x3C58,
+ 0xF909, 0x35AB, 0xF91D, 0x3450, 0xF91F, 0x3704, 0xF928, 0x4F4F,
+ 0xF929, 0x4F51, 0xF936, 0x3452, 0xF95F, 0x3693, 0xF970, 0x3420,
+ 0xF983, 0x3708, 0xF992, 0x1E81, 0xF993, 0x1E82, 0xF999, 0x1E83,
+ 0xF99A, 0x3711, 0xF9A2, 0x370F, 0xF9C3, 0x1E80, 0xF9D0, 0x3454,
+ 0xF9DC, 0x3451, 0xF9EC, 0x1E46, 0xFA03, 0x3684, 0xFA0E, 0x20DA,
+ 0xFA0F, 0x20E5, 0xFA10, 0x1E42, 0xFA11, 0x37D2, 0xFA12, 0x2121,
+ 0xFA13, 0x2131, 0xFA14, 0x2133, 0xFA15, 0x4F53, 0xFA16, 0x2164,
+ 0xFA17, 0x217B, 0xFA18, 0x2183, 0xFA19, 0x2184, 0xFA1A, 0x2185,
+ 0xFA1B, 0x2187, 0xFA1C, 0x218B, 0xFA1D, 0x218E, 0xFA1E, 0x2197,
+ 0xFA1F, 0x21A2, 0xFA20, 0x21A4, 0xFA21, 0x21A5, 0xFA22, 0x21AE,
+ 0xFA23, 0x21B6, 0xFA24, 0x4948, 0xFA25, 0x21B9, 0xFA26, 0x21BC,
+ 0xFA27, 0x21D8, 0xFA28, 0x21DF, 0xFA29, 0x21EF, 0xFA2A, 0x21FB,
+ 0xFA2B, 0x21FC, 0xFA2C, 0x21FE, 0xFA2D, 0x220B, 0xFA30, 0x3446,
+ 0xFA31, 0x3430, 0xFA32, 0x344D, 0xFA33, 0x3449, 0xFA34, 0x341A,
+ 0xFA35, 0x3442, 0xFA36, 0x1DE3, 0xFA37, 0x3436, 0xFA38, 0x3415,
+ 0xFA39, 0x3448, 0xFA3A, 0x344B, 0xFA3B, 0x3431, 0xFA3C, 0x41C5,
+ 0xFA3D, 0x340E, 0xFA3E, 0x3410, 0xFA3F, 0x3433, 0xFA40, 0x3439,
+ 0xFA41, 0x3445, 0xFA42, 0x3416, 0xFA43, 0x3428, 0xFA44, 0x343F,
+ 0xFA45, 0x340F, 0xFA46, 0x1E14, 0xFA47, 0x3414, 0xFA48, 0x3423,
+ 0xFA49, 0x3C26, 0xFA4A, 0x1E34, 0xFA4B, 0x3443, 0xFA4C, 0x3424,
+ 0xFA4D, 0x3421, 0xFA4E, 0x3417, 0xFA4F, 0x344F, 0xFA50, 0x342F,
+ 0xFA51, 0x3427, 0xFA52, 0x340D, 0xFA53, 0x343B, 0xFA54, 0x341F,
+ 0xFA55, 0x343D, 0xFA56, 0x342E, 0xFA57, 0x3457, 0xFA58, 0x47BE,
+ 0xFA59, 0x3440, 0xFA5A, 0x3429, 0xFA5B, 0x3425, 0xFA5C, 0x3426,
+ 0xFA5D, 0x3777, 0xFA5E, 0x3776, 0xFA5F, 0x3437, 0xFA60, 0x3413,
+ 0xFA61, 0x3422, 0xFA62, 0x3409, 0xFA63, 0x341B, 0xFA64, 0x3444,
+ 0xFA65, 0x3434, 0xFA66, 0x3C2B, 0xFA67, 0x3408, 0xFA68, 0x343E,
+ 0xFA69, 0x3419, 0xFA6A, 0x1E6C, 0xFB00, 0x248E, 0xFB01, 0x0070,
+ 0xFB02, 0x0071, 0xFB03, 0x248F, 0xFB04, 0x2490, 0xFE30, 0x1EDA,
+ 0xFE31, 0x1ED4, 0xFE32, 0x1ED5, 0xFE33, 0x1ED2, 0xFE35, 0x1EDB,
+ 0xFE36, 0x1EDC, 0xFE37, 0x1EE1, 0xFE38, 0x1EE2, 0xFE39, 0x1EDD,
+ 0xFE3A, 0x1EDE, 0xFE3B, 0x1EEB, 0xFE3C, 0x1EEC, 0xFE3D, 0x1EE5,
+ 0xFE3E, 0x1EE6, 0xFE3F, 0x1EE3, 0xFE40, 0x1EE4, 0xFE41, 0x1EE7,
+ 0xFE42, 0x1EE8, 0xFE43, 0x1EE9, 0xFE44, 0x1EEA, 0xFE45, 0x315F,
+ 0xFE46, 0x3160, 0xFE47, 0x1EDF, 0xFE48, 0x1EE0, 0xFF01, 0x0282,
+ 0xFF02, 0x1F47, 0xFF03, 0x02CC, 0xFF04, 0x02C8, 0xFF05, 0x02CB,
+ 0xFF06, 0x02CD, 0xFF07, 0x1F46, 0xFF08, 0x02A2, 0xFF09, 0x02A3,
+ 0xFF0A, 0x02CE, 0xFF0B, 0x02B4, 0xFF0C, 0x027C, 0xFF0D, 0x02B5,
+ 0xFF0E, 0x027D, 0xFF0F, 0x0297, 0xFF10, 0x030C, 0xFF11, 0x030D,
+ 0xFF12, 0x030E, 0xFF13, 0x030F, 0xFF14, 0x0310, 0xFF15, 0x0311,
+ 0xFF16, 0x0312, 0xFF17, 0x0313, 0xFF18, 0x0314, 0xFF19, 0x0315,
+ 0xFF1A, 0x027F, 0xFF1B, 0x0280, 0xFF1C, 0x02BB, 0xFF1D, 0x02B9,
+ 0xFF1E, 0x02BC, 0xFF1F, 0x0281, 0xFF20, 0x02CF, 0xFF21, 0x0316,
+ 0xFF22, 0x0317, 0xFF23, 0x0318, 0xFF24, 0x0319, 0xFF25, 0x031A,
+ 0xFF26, 0x031B, 0xFF27, 0x031C, 0xFF28, 0x031D, 0xFF29, 0x031E,
+ 0xFF2A, 0x031F, 0xFF2B, 0x0320, 0xFF2C, 0x0321, 0xFF2D, 0x0322,
+ 0xFF2E, 0x0323, 0xFF2F, 0x0324, 0xFF30, 0x0325, 0xFF31, 0x0326,
+ 0xFF32, 0x0327, 0xFF33, 0x0328, 0xFF34, 0x0329, 0xFF35, 0x032A,
+ 0xFF36, 0x032B, 0xFF37, 0x032C, 0xFF38, 0x032D, 0xFF39, 0x032E,
+ 0xFF3A, 0x032F, 0xFF3B, 0x02A6, 0xFF3C, 0x0298, 0xFF3D, 0x02A7,
+ 0xFF3E, 0x0288, 0xFF3F, 0x028A, 0xFF40, 0x0286, 0xFF41, 0x0330,
+ 0xFF42, 0x0331, 0xFF43, 0x0332, 0xFF44, 0x0333, 0xFF45, 0x0334,
+ 0xFF46, 0x0335, 0xFF47, 0x0336, 0xFF48, 0x0337, 0xFF49, 0x0338,
+ 0xFF4A, 0x0339, 0xFF4B, 0x033A, 0xFF4C, 0x033B, 0xFF4D, 0x033C,
+ 0xFF4E, 0x033D, 0xFF4F, 0x033E, 0xFF50, 0x033F, 0xFF51, 0x0340,
+ 0xFF52, 0x0341, 0xFF53, 0x0342, 0xFF54, 0x0343, 0xFF55, 0x0344,
+ 0xFF56, 0x0345, 0xFF57, 0x0346, 0xFF58, 0x0347, 0xFF59, 0x0348,
+ 0xFF5A, 0x0349, 0xFF5B, 0x02A8, 0xFF5C, 0x029B, 0xFF5D, 0x02A9,
+ 0xFF5E, 0x0299, 0xFF5F, 0x2F63, 0xFF60, 0x2F64, 0xFF61, 0x0147,
+ 0xFF62, 0x0148, 0xFF63, 0x0149, 0xFF64, 0x014A, 0xFF65, 0x014B,
+ 0xFF66, 0x014C, 0xFF67, 0x014D, 0xFF68, 0x014E, 0xFF69, 0x014F,
+ 0xFF6A, 0x0150, 0xFF6B, 0x0151, 0xFF6C, 0x0152, 0xFF6D, 0x0153,
+ 0xFF6E, 0x0154, 0xFF6F, 0x0155, 0xFF70, 0x0156, 0xFF71, 0x0157,
+ 0xFF72, 0x0158, 0xFF73, 0x0159, 0xFF74, 0x015A, 0xFF75, 0x015B,
+ 0xFF76, 0x015C, 0xFF77, 0x015D, 0xFF78, 0x015E, 0xFF79, 0x015F,
+ 0xFF7A, 0x0160, 0xFF7B, 0x0161, 0xFF7C, 0x0162, 0xFF7D, 0x0163,
+ 0xFF7E, 0x0164, 0xFF7F, 0x0165, 0xFF80, 0x0166, 0xFF81, 0x0167,
+ 0xFF82, 0x0168, 0xFF83, 0x0169, 0xFF84, 0x016A, 0xFF85, 0x016B,
+ 0xFF86, 0x016C, 0xFF87, 0x016D, 0xFF88, 0x016E, 0xFF89, 0x016F,
+ 0xFF8A, 0x0170, 0xFF8B, 0x0171, 0xFF8C, 0x0172, 0xFF8D, 0x0173,
+ 0xFF8E, 0x0174, 0xFF8F, 0x0175, 0xFF90, 0x0176, 0xFF91, 0x0177,
+ 0xFF92, 0x0178, 0xFF93, 0x0179, 0xFF94, 0x017A, 0xFF95, 0x017B,
+ 0xFF96, 0x017C, 0xFF97, 0x017D, 0xFF98, 0x017E, 0xFF99, 0x017F,
+ 0xFF9A, 0x0180, 0xFF9B, 0x0181, 0xFF9C, 0x0182, 0xFF9D, 0x0183,
+ 0xFF9E, 0x0184, 0xFF9F, 0x0185, 0xFFE0, 0x02C9, 0xFFE1, 0x02CA,
+ 0xFFE2, 0x02EF, 0xFFE3, 0x0289, 0xFFE4, 0x1F45, 0xFFE5, 0x02C7,
+ 0xFFE8, 0x0143,
+};
+extern const unsigned short g_FXCMAP_UniJIS_UTF16_H_5_DWord[384 * 3] = {
+ 0xD840, 0xDC0B, 0x360F, 0xD840, 0xDC89, 0x4351, 0xD840, 0xDC8A, 0x371C,
+ 0xD840, 0xDCA2, 0x4358, 0xD840, 0xDCA4, 0x435B, 0xD840, 0xDCB0, 0x3781,
+ 0xD840, 0xDCF5, 0x4E59, 0xD840, 0xDD58, 0x4E6B, 0xD840, 0xDDA2, 0x3621,
+ 0xD840, 0xDE13, 0x436B, 0xD840, 0xDF2B, 0x4382, 0xD840, 0xDF71, 0x438B,
+ 0xD840, 0xDF81, 0x4389, 0xD840, 0xDFF9, 0x438F, 0xD841, 0xDC4A, 0x4391,
+ 0xD841, 0xDD09, 0x4393, 0xD841, 0xDDB1, 0x4E70, 0xD841, 0xDDD6, 0x439C,
+ 0xD841, 0xDE11, 0x37D6, 0xD841, 0xDE28, 0x3719, 0xD841, 0xDEEC, 0x4E73,
+ 0xD841, 0xDF4F, 0x43A0, 0xD842, 0xDC07, 0x43A7, 0xD842, 0xDC3A, 0x43A9,
+ 0xD842, 0xDCB9, 0x43AF, 0xD842, 0xDD0E, 0x34D3, 0xD842, 0xDD7C, 0x43B3,
+ 0xD842, 0xDD9D, 0x43B4, 0xD842, 0xDE64, 0x35BB, 0xD842, 0xDED3, 0x43B9,
+ 0xD842, 0xDF1D, 0x43BC, 0xD842, 0xDF9F, 0x35EB, 0xD842, 0xDFB7, 0x358A,
+ 0xD843, 0xDD45, 0x43CF, 0xD843, 0xDD58, 0x4E7A, 0xD843, 0xDDE1, 0x43DD,
+ 0xD843, 0xDE64, 0x43EC, 0xD843, 0xDE6D, 0x43E4, 0xD843, 0xDE95, 0x43E3,
+ 0xD843, 0xDF5F, 0x43EF, 0xD844, 0xDE01, 0x4406, 0xD844, 0xDE3D, 0x3681,
+ 0xD844, 0xDE55, 0x4407, 0xD844, 0xDE74, 0x440D, 0xD844, 0xDE7B, 0x4409,
+ 0xD844, 0xDED7, 0x4415, 0xD844, 0xDEE4, 0x4414, 0xD844, 0xDEFD, 0x441B,
+ 0xD844, 0xDF1B, 0x41B0, 0xD844, 0xDF36, 0x441D, 0xD844, 0xDF44, 0x441E,
+ 0xD844, 0xDFC4, 0x4429, 0xD845, 0xDC6D, 0x4436, 0xD845, 0xDC6E, 0x41B5,
+ 0xD845, 0xDDD7, 0x4440, 0xD845, 0xDE47, 0x4448, 0xD845, 0xDEB4, 0x41C6,
+ 0xD845, 0xDF06, 0x4454, 0xD845, 0xDF42, 0x4455, 0xD846, 0xDCBD, 0x41C1,
+ 0xD846, 0xDDC3, 0x4475, 0xD846, 0xDE1A, 0x1E91, 0xD847, 0xDC56, 0x4483,
+ 0xD847, 0xDD2D, 0x4488, 0xD847, 0xDD45, 0x4489, 0xD847, 0xDD62, 0x448B,
+ 0xD847, 0xDD78, 0x448A, 0xD847, 0xDD92, 0x4494, 0xD847, 0xDD9C, 0x4490,
+ 0xD847, 0xDDA1, 0x448F, 0xD847, 0xDDB7, 0x4497, 0xD847, 0xDDE0, 0x4499,
+ 0xD847, 0xDE33, 0x449A, 0xD847, 0xDE34, 0x41CD, 0xD847, 0xDF1E, 0x44A7,
+ 0xD847, 0xDF76, 0x44AE, 0xD847, 0xDFFA, 0x44B1, 0xD848, 0xDD7B, 0x44BF,
+ 0xD848, 0xDE18, 0x4AA1, 0xD848, 0xDF1E, 0x44C5, 0xD848, 0xDFAD, 0x44C8,
+ 0xD849, 0xDE09, 0x3C53, 0xD849, 0xDEF3, 0x44E0, 0xD84A, 0xDC5B, 0x44EF,
+ 0xD84A, 0xDCAB, 0x44F5, 0xD84A, 0xDD8F, 0x44F9, 0xD84A, 0xDEB8, 0x4503,
+ 0xD84A, 0xDF46, 0x4510, 0xD84A, 0xDF4F, 0x4507, 0xD84A, 0xDF50, 0x4508,
+ 0xD84A, 0xDFA6, 0x4513, 0xD84B, 0xDC1D, 0x4512, 0xD84B, 0xDC24, 0x4516,
+ 0xD84B, 0xDDE1, 0x452E, 0xD84B, 0xDE42, 0x4E9C, 0xD84B, 0xDFEB, 0x4EA2,
+ 0xD84C, 0xDDB6, 0x4550, 0xD84C, 0xDDC3, 0x454E, 0xD84C, 0xDDC4, 0x41F8,
+ 0xD84C, 0xDDF5, 0x454F, 0xD84C, 0xDF72, 0x4561, 0xD84C, 0xDFD0, 0x4568,
+ 0xD84C, 0xDFD2, 0x4564, 0xD84C, 0xDFD3, 0x4563, 0xD84C, 0xDFD5, 0x456A,
+ 0xD84C, 0xDFDA, 0x456C, 0xD84C, 0xDFDF, 0x456E, 0xD84C, 0xDFE4, 0x4569,
+ 0xD84C, 0xDFFE, 0x3C3E, 0xD84D, 0xDC4A, 0x4576, 0xD84D, 0xDC4B, 0x4578,
+ 0xD84D, 0xDC51, 0x4577, 0xD84D, 0xDC65, 0x457C, 0xD84D, 0xDCE4, 0x4596,
+ 0xD84D, 0xDD5A, 0x4597, 0xD84D, 0xDD94, 0x45A3, 0xD84D, 0xDDC4, 0x4209,
+ 0xD84D, 0xDE38, 0x45B3, 0xD84D, 0xDE39, 0x45B1, 0xD84D, 0xDE3A, 0x3C21,
+ 0xD84D, 0xDE47, 0x45B2, 0xD84D, 0xDF0C, 0x45C7, 0xD84D, 0xDF1C, 0x45BE,
+ 0xD84D, 0xDF3F, 0x4212, 0xD84D, 0xDF63, 0x4214, 0xD84D, 0xDF64, 0x45CB,
+ 0xD84D, 0xDFE7, 0x45D3, 0xD84D, 0xDFFF, 0x45D2, 0xD84E, 0xDC24, 0x45D8,
+ 0xD84E, 0xDC3D, 0x45DD, 0xD84E, 0xDE98, 0x45E9, 0xD84F, 0xDC7F, 0x45F6,
+ 0xD84F, 0xDCBE, 0x37D5, 0xD84F, 0xDCFE, 0x3650, 0xD84F, 0xDD00, 0x4605,
+ 0xD84F, 0xDD0E, 0x47DA, 0xD84F, 0xDD40, 0x4616, 0xD84F, 0xDDD3, 0x4619,
+ 0xD84F, 0xDDF9, 0x4618, 0xD84F, 0xDDFA, 0x4617, 0xD84F, 0xDF7E, 0x463F,
+ 0xD850, 0xDC4B, 0x4EC8, 0xD850, 0xDC96, 0x464E, 0xD850, 0xDD03, 0x4653,
+ 0xD850, 0xDDC6, 0x465F, 0xD850, 0xDDFE, 0x4662, 0xD850, 0xDEEE, 0x37CA,
+ 0xD850, 0xDFBC, 0x4677, 0xD850, 0xDFD0, 0x1E9E, 0xD851, 0xDE29, 0x4681,
+ 0xD851, 0xDEA5, 0x4687, 0xD851, 0xDFF1, 0x424A, 0xD852, 0xDC96, 0x469D,
+ 0xD852, 0xDE4D, 0x46B8, 0xD852, 0xDF56, 0x46C5, 0xD852, 0xDF6F, 0x46C7,
+ 0xD853, 0xDC16, 0x46CC, 0xD853, 0xDD14, 0x36AB, 0xD853, 0xDE04, 0x4E5A,
+ 0xD853, 0xDE0E, 0x46EE, 0xD853, 0xDE37, 0x46F2, 0xD853, 0xDE6A, 0x46F7,
+ 0xD853, 0xDE8B, 0x46FA, 0xD853, 0xDFF2, 0x4E5B, 0xD854, 0xDC4A, 0x4705,
+ 0xD854, 0xDC55, 0x4707, 0xD854, 0xDD22, 0x4709, 0xD854, 0xDDA9, 0x470E,
+ 0xD854, 0xDDCD, 0x4711, 0xD854, 0xDDE5, 0x4710, 0xD854, 0xDE1E, 0x4713,
+ 0xD854, 0xDE4C, 0x4715, 0xD855, 0xDC2E, 0x4721, 0xD855, 0xDC8E, 0x426D,
+ 0xD855, 0xDCD9, 0x4729, 0xD855, 0xDD0E, 0x4271, 0xD855, 0xDDA7, 0x4735,
+ 0xD855, 0xDE7F, 0x36FB, 0xD855, 0xDF71, 0x427A, 0xD855, 0xDFA9, 0x4748,
+ 0xD855, 0xDFB4, 0x4749, 0xD856, 0xDC74, 0x1DF6, 0xD856, 0xDDC4, 0x4280,
+ 0xD856, 0xDDCC, 0x4E90, 0xD856, 0xDDD4, 0x475C, 0xD856, 0xDEE3, 0x4765,
+ 0xD856, 0xDEE4, 0x4764, 0xD856, 0xDEF1, 0x4766, 0xD856, 0xDFB2, 0x4775,
+ 0xD857, 0xDC4B, 0x477E, 0xD857, 0xDC64, 0x477F, 0xD857, 0xDDA1, 0x4289,
+ 0xD857, 0xDE2E, 0x478E, 0xD857, 0xDE56, 0x478F, 0xD857, 0xDE62, 0x4792,
+ 0xD857, 0xDE65, 0x4790, 0xD857, 0xDEC2, 0x4797, 0xD857, 0xDED8, 0x4795,
+ 0xD857, 0xDEE8, 0x4799, 0xD857, 0xDF23, 0x479A, 0xD857, 0xDF5C, 0x479C,
+ 0xD857, 0xDFD4, 0x47A3, 0xD857, 0xDFE0, 0x47A2, 0xD857, 0xDFFB, 0x47A9,
+ 0xD858, 0xDC0C, 0x47A8, 0xD858, 0xDC17, 0x47B0, 0xD858, 0xDC60, 0x47B3,
+ 0xD858, 0xDCED, 0x47BD, 0xD858, 0xDE70, 0x47D1, 0xD858, 0xDE86, 0x47D2,
+ 0xD858, 0xDF4C, 0x4F57, 0xD859, 0xDC02, 0x47DE, 0xD859, 0xDE7E, 0x47F0,
+ 0xD859, 0xDEB0, 0x3714, 0xD859, 0xDF1D, 0x47FE, 0xD85A, 0xDCDD, 0x480C,
+ 0xD85A, 0xDCEA, 0x480E, 0xD85A, 0xDD51, 0x354E, 0xD85A, 0xDD6F, 0x4812,
+ 0xD85A, 0xDD99, 0x3736, 0xD85A, 0xDDDD, 0x4814, 0xD85A, 0xDE1E, 0x4817,
+ 0xD85A, 0xDE58, 0x481B, 0xD85A, 0xDE8C, 0x481F, 0xD85A, 0xDEB7, 0x4822,
+ 0xD85A, 0xDEFF, 0x42A7, 0xD85B, 0xDC29, 0x4446, 0xD85B, 0xDC73, 0x484A,
+ 0xD85B, 0xDC9E, 0x4EEE, 0xD85B, 0xDCDD, 0x4853, 0xD85B, 0xDE40, 0x42C1,
+ 0xD85B, 0xDE65, 0x4860, 0xD85B, 0xDF94, 0x4870, 0xD85B, 0xDFF6, 0x487A,
+ 0xD85B, 0xDFF7, 0x487B, 0xD85B, 0xDFF8, 0x4879, 0xD85C, 0xDCF4, 0x42CF,
+ 0xD85C, 0xDD0D, 0x488B, 0xD85C, 0xDD39, 0x488E, 0xD85C, 0xDFDA, 0x48B3,
+ 0xD85C, 0xDFDB, 0x48B2, 0xD85C, 0xDFFE, 0x48B9, 0xD85D, 0xDC10, 0x48BC,
+ 0xD85D, 0xDC49, 0x48C0, 0xD85D, 0xDE14, 0x48CE, 0xD85D, 0xDE15, 0x48CD,
+ 0xD85D, 0xDE31, 0x48D0, 0xD85D, 0xDE84, 0x42DD, 0xD85D, 0xDE93, 0x48D5,
+ 0xD85D, 0xDF0E, 0x48DA, 0xD85D, 0xDF23, 0x48DC, 0xD85D, 0xDF52, 0x48E0,
+ 0xD85E, 0xDD85, 0x48F0, 0xD85E, 0xDDB4, 0x4EA5, 0xD85E, 0xDE84, 0x48FC,
+ 0xD85E, 0xDFB3, 0x490B, 0xD85E, 0xDFBE, 0x490D, 0xD85E, 0xDFC7, 0x490E,
+ 0xD85F, 0xDC3C, 0x4EFC, 0xD85F, 0xDCB8, 0x4914, 0xD85F, 0xDD73, 0x4E5C,
+ 0xD85F, 0xDDA0, 0x491C, 0xD85F, 0xDE10, 0x491E, 0xD85F, 0xDFB7, 0x364A,
+ 0xD860, 0xDC8A, 0x4927, 0xD860, 0xDCBB, 0x492D, 0xD860, 0xDE77, 0x42F4,
+ 0xD860, 0xDE82, 0x4939, 0xD860, 0xDEF3, 0x493B, 0xD860, 0xDFCD, 0x42FA,
+ 0xD861, 0xDC0C, 0x4942, 0xD861, 0xDC55, 0x4945, 0xD861, 0xDD6B, 0x4952,
+ 0xD861, 0xDDC8, 0x4955, 0xD861, 0xDDC9, 0x4956, 0xD861, 0xDED7, 0x4960,
+ 0xD861, 0xDEFA, 0x4963, 0xD862, 0xDD46, 0x497C, 0xD862, 0xDD49, 0x497B,
+ 0xD862, 0xDD6B, 0x4981, 0xD862, 0xDD87, 0x37AD, 0xD862, 0xDD88, 0x4988,
+ 0xD862, 0xDDBA, 0x4992, 0xD862, 0xDDBB, 0x4993, 0xD862, 0xDE1E, 0x499B,
+ 0xD862, 0xDE29, 0x499C, 0xD862, 0xDE43, 0x49A0, 0xD862, 0xDE71, 0x499F,
+ 0xD862, 0xDE99, 0x49A7, 0xD862, 0xDECD, 0x49A8, 0xD862, 0xDEDD, 0x49AF,
+ 0xD862, 0xDEE4, 0x49AE, 0xD862, 0xDFC1, 0x49BA, 0xD862, 0xDFEF, 0x49BB,
+ 0xD863, 0xDCDD, 0x1DD9, 0xD863, 0xDD10, 0x49C2, 0xD863, 0xDD71, 0x49C3,
+ 0xD863, 0xDDFB, 0x49C5, 0xD863, 0xDE17, 0x37B0, 0xD863, 0xDE1F, 0x49C6,
+ 0xD863, 0xDE36, 0x49CA, 0xD863, 0xDE89, 0x49CD, 0xD863, 0xDEEB, 0x49CF,
+ 0xD863, 0xDEF6, 0x1DF9, 0xD863, 0xDF32, 0x49D1, 0xD863, 0xDFF8, 0x49D7,
+ 0xD864, 0xDEA0, 0x49E5, 0xD864, 0xDEB1, 0x49E6, 0xD865, 0xDC90, 0x49F7,
+ 0xD865, 0xDDCF, 0x4A00, 0xD865, 0xDE7F, 0x3619, 0xD865, 0xDEF0, 0x4A0F,
+ 0xD865, 0xDF19, 0x4A12, 0xD865, 0xDF50, 0x4A16, 0xD866, 0xDCC6, 0x4A27,
+ 0xD866, 0xDE72, 0x4A39, 0xD867, 0xDD4B, 0x3595, 0xD867, 0xDDDB, 0x4A52,
+ 0xD867, 0xDE15, 0x4A5C, 0xD867, 0xDE3D, 0x4F5B, 0xD867, 0xDE49, 0x4A5E,
+ 0xD867, 0xDE8A, 0x4A5D, 0xD867, 0xDEC4, 0x4A66, 0xD867, 0xDEDB, 0x4A6E,
+ 0xD867, 0xDEE9, 0x4A6B, 0xD867, 0xDFCE, 0x4A7F, 0xD867, 0xDFD7, 0x4A7F,
+ 0xD868, 0xDC1A, 0x4A85, 0xD868, 0xDC2F, 0x4A83, 0xD868, 0xDC82, 0x4A8C,
+ 0xD868, 0xDCF9, 0x4A8B, 0xD868, 0xDD90, 0x434B, 0xD868, 0xDEB2, 0x4E68,
+ 0xD868, 0xDF8C, 0x4AA5, 0xD869, 0xDC37, 0x4AA7, 0xD869, 0xDDF1, 0x4AB3,
+ 0xD869, 0xDE02, 0x4AB5, 0xD869, 0xDE1A, 0x4F5C, 0xD869, 0xDEB2, 0x4AB9,
+ 0xD87E, 0xDC04, 0x3C1C, 0xD87E, 0xDC0F, 0x1E86, 0xD87E, 0xDC15, 0x4E5D,
+ 0xD87E, 0xDC18, 0x1E89, 0xD87E, 0xDC1A, 0x3682, 0xD87E, 0xDC22, 0x3574,
+ 0xD87E, 0xDC28, 0x35EF, 0xD87E, 0xDC2C, 0x371D, 0xD87E, 0xDC33, 0x3597,
+ 0xD87E, 0xDC3F, 0x35F7, 0xD87E, 0xDC46, 0x4E5E, 0xD87E, 0xDC52, 0x3611,
+ 0xD87E, 0xDC62, 0x36AE, 0xD87E, 0xDC6D, 0x3729, 0xD87E, 0xDC73, 0x3608,
+ 0xD87E, 0xDC77, 0x1E4A, 0xD87E, 0xDC84, 0x1E36, 0xD87E, 0xDC99, 0x4E5F,
+ 0xD87E, 0xDC9A, 0x3668, 0xD87E, 0xDCA6, 0x4E60, 0xD87E, 0xDCAC, 0x35B6,
+ 0xD87E, 0xDCB2, 0x362B, 0xD87E, 0xDCB6, 0x3731, 0xD87E, 0xDCD3, 0x1E88,
+ 0xD87E, 0xDCDB, 0x373C, 0xD87E, 0xDCDC, 0x1E0F, 0xD87E, 0xDCE1, 0x37D3,
+ 0xD87E, 0xDCE5, 0x4E61, 0xD87E, 0xDCEA, 0x356F, 0xD87E, 0xDCED, 0x1DF1,
+ 0xD87E, 0xDCFC, 0x3558, 0xD87E, 0xDD03, 0x35C8, 0xD87E, 0xDD0B, 0x35E9,
+ 0xD87E, 0xDD0F, 0x366C, 0xD87E, 0xDD1A, 0x365C, 0xD87E, 0xDD20, 0x1E9F,
+ 0xD87E, 0xDD21, 0x35F1, 0xD87E, 0xDD45, 0x342D, 0xD87E, 0xDD47, 0x361E,
+ 0xD87E, 0xDD6C, 0x3764, 0xD87E, 0xDD95, 0x3566, 0xD87E, 0xDDD0, 0x36F4,
+ 0xD87E, 0xDDDE, 0x4E62, 0xD87E, 0xDDDF, 0x36F5, 0xD87E, 0xDDF4, 0x3BA5,
+};
diff --git a/core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UTF16-V_5.cpp b/core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UTF16-V_5.cpp
index ac83c75aec..c0073d717c 100644
--- a/core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UTF16-V_5.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UTF16-V_5.cpp
@@ -1,81 +1,81 @@
-// 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
-
-extern const unsigned short g_FXCMAP_UniJIS_UTF16_V_5[289 * 2] = {
- 0x00B0, 0x204D, 0x2010, 0x1ED5, 0x2015, 0x1ED4, 0x2016, 0x1ED7,
- 0x2025, 0x1EDA, 0x2026, 0x1ED9, 0x2032, 0x2051, 0x2033, 0x205B,
- 0x2190, 0x02E2, 0x2191, 0x02E0, 0x2192, 0x02E3, 0x2193, 0x02E1,
- 0x21C4, 0x2077, 0x21C5, 0x2076, 0x21C6, 0x2078, 0x21E6, 0x1F4C,
- 0x21E7, 0x1F4E, 0x21E8, 0x1F4B, 0x21E9, 0x1F4D, 0x239B, 0x2F74,
- 0x239C, 0x2F88, 0x239D, 0x2F73, 0x239E, 0x2F76, 0x239F, 0x2F88,
- 0x23A0, 0x2F75, 0x23A1, 0x2F7C, 0x23A2, 0x2F88, 0x23A3, 0x2F7B,
- 0x23A4, 0x2F7E, 0x23A5, 0x2F88, 0x23A6, 0x2F7D, 0x23A7, 0x1FE8,
- 0x23A8, 0x1FE7, 0x23A9, 0x1FE6, 0x23AA, 0x2F88, 0x23AB, 0x1FEC,
- 0x23AC, 0x1FEB, 0x23AD, 0x1FEA, 0x23B0, 0x3FDE, 0x23B1, 0x3FDF,
- 0x2500, 0x1D39, 0x2501, 0x1D3A, 0x2502, 0x1D37, 0x2503, 0x1D38,
- 0x2504, 0x1D3D, 0x2505, 0x1D3E, 0x2506, 0x1D3B, 0x2507, 0x1D3C,
- 0x2508, 0x1D41, 0x2509, 0x1D42, 0x250A, 0x1D3F, 0x250B, 0x1D40,
- 0x250C, 0x1D47, 0x250D, 0x1D49, 0x250E, 0x1D48, 0x250F, 0x1D4A,
- 0x2510, 0x1D4F, 0x2511, 0x1D51, 0x2512, 0x1D50, 0x2513, 0x1D52,
- 0x2514, 0x1D43, 0x2515, 0x1D45, 0x2516, 0x1D44, 0x2517, 0x1D46,
- 0x2518, 0x1D4B, 0x2519, 0x1D4D, 0x251A, 0x1D4C, 0x251B, 0x1D4E,
- 0x251C, 0x1D63, 0x251D, 0x1D67, 0x251E, 0x1D65, 0x251F, 0x1D64,
- 0x2520, 0x1D66, 0x2521, 0x1D69, 0x2522, 0x1D68, 0x2523, 0x1D6A,
- 0x2524, 0x1D6B, 0x2525, 0x1D6F, 0x2526, 0x1D6D, 0x2527, 0x1D6C,
- 0x2528, 0x1D6E, 0x2529, 0x1D71, 0x252A, 0x1D70, 0x252B, 0x1D72,
- 0x252C, 0x1D5B, 0x252D, 0x1D5D, 0x252E, 0x1D5E, 0x252F, 0x1D5F,
- 0x2530, 0x1D5C, 0x2531, 0x1D60, 0x2532, 0x1D61, 0x2533, 0x1D62,
- 0x2534, 0x1D53, 0x2535, 0x1D55, 0x2536, 0x1D56, 0x2537, 0x1D57,
- 0x2538, 0x1D54, 0x2539, 0x1D58, 0x253A, 0x1D59, 0x253B, 0x1D5A,
- 0x253D, 0x1D77, 0x253E, 0x1D78, 0x253F, 0x1D79, 0x2540, 0x1D75,
- 0x2541, 0x1D74, 0x2542, 0x1D76, 0x2543, 0x1D7B, 0x2544, 0x1D7D,
- 0x2545, 0x1D7A, 0x2546, 0x1D7C, 0x2547, 0x1D81, 0x2548, 0x1D80,
- 0x2549, 0x1D7E, 0x254A, 0x1D7F, 0x261C, 0x201D, 0x261D, 0x201B,
- 0x261E, 0x201E, 0x261F, 0x201C, 0x2702, 0x2F92, 0x27A1, 0x2011,
- 0x3001, 0x1ECF, 0x3002, 0x1ED0, 0x3008, 0x1EE3, 0x3009, 0x1EE4,
- 0x300A, 0x1EE5, 0x300B, 0x1EE6, 0x300C, 0x1EE7, 0x300D, 0x1EE8,
- 0x300E, 0x1EE9, 0x300F, 0x1EEA, 0x3010, 0x1EEB, 0x3011, 0x1EEC,
- 0x3014, 0x1EDD, 0x3015, 0x1EDE, 0x3016, 0x3FC9, 0x3017, 0x3FCA,
- 0x3018, 0x2F6B, 0x3019, 0x2F6C, 0x301C, 0x1ED6, 0x301D, 0x1F14,
- 0x301F, 0x1F15, 0x303B, 0x2F4B, 0x3041, 0x1EEE, 0x3043, 0x1EEF,
- 0x3045, 0x1EF0, 0x3047, 0x1EF1, 0x3049, 0x1EF2, 0x3063, 0x1EF3,
- 0x3083, 0x1EF4, 0x3085, 0x1EF5, 0x3087, 0x1EF6, 0x308E, 0x1EF7,
- 0x3095, 0x2048, 0x3096, 0x2049, 0x309B, 0x2050, 0x309C, 0x204F,
- 0x30A0, 0x3FCB, 0x30A1, 0x1EF8, 0x30A3, 0x1EF9, 0x30A5, 0x1EFA,
- 0x30A7, 0x1EFB, 0x30A9, 0x1EFC, 0x30C3, 0x1EFD, 0x30E3, 0x1EFE,
- 0x30E5, 0x1EFF, 0x30E7, 0x1F00, 0x30EE, 0x1F01, 0x30F5, 0x1F02,
- 0x30F6, 0x1F03, 0x30FC, 0x1ED3, 0x31F0, 0x3FCD, 0x31F1, 0x3FCE,
- 0x31F2, 0x3FCF, 0x31F3, 0x3FD0, 0x31F4, 0x3FD1, 0x31F5, 0x3FD2,
- 0x31F6, 0x3FD3, 0x31F7, 0x3FD4, 0x31F8, 0x3FD5, 0x31F9, 0x3FD6,
- 0x31FA, 0x3FD8, 0x31FB, 0x3FD9, 0x31FC, 0x3FDA, 0x31FD, 0x3FDB,
- 0x31FE, 0x3FDC, 0x31FF, 0x3FDD, 0x3300, 0x209E, 0x3301, 0x2EB6,
- 0x3302, 0x2EB7, 0x3303, 0x2092, 0x3304, 0x2EB8, 0x3305, 0x208D,
- 0x3306, 0x2EB9, 0x3307, 0x2EBD, 0x3308, 0x2EBB, 0x3309, 0x2EC0,
- 0x330A, 0x2EBE, 0x330B, 0x2EC2, 0x330C, 0x2EC4, 0x330D, 0x1F0E,
- 0x330E, 0x2EC5, 0x330F, 0x2EC6, 0x3310, 0x2EC7, 0x3311, 0x2EC8,
- 0x3312, 0x2EC9, 0x3313, 0x2ECA, 0x3314, 0x1F05, 0x3315, 0x2094,
- 0x3316, 0x208A, 0x3317, 0x2ECC, 0x3318, 0x2093, 0x3319, 0x2ECE,
- 0x331A, 0x2ED0, 0x331B, 0x2ED1, 0x331C, 0x2ED2, 0x331D, 0x2ED3,
- 0x331E, 0x20A1, 0x331F, 0x2ED4, 0x3320, 0x2ED5, 0x3321, 0x2ED6,
- 0x3322, 0x2089, 0x3323, 0x209C, 0x3324, 0x2ED7, 0x3325, 0x2ED9,
- 0x3326, 0x1F0F, 0x3327, 0x1F09, 0x3328, 0x2EDC, 0x3329, 0x2EDD,
- 0x332A, 0x20A4, 0x332B, 0x1F11, 0x332D, 0x2EDF, 0x332E, 0x2EE2,
- 0x332F, 0x2EE3, 0x3330, 0x2EE4, 0x3331, 0x20A6, 0x3332, 0x2EE5,
- 0x3333, 0x208E, 0x3334, 0x2EE8, 0x3335, 0x2EE9, 0x3336, 0x1F0B,
- 0x3337, 0x2EEE, 0x3338, 0x2EF0, 0x3339, 0x2097, 0x333A, 0x2EF1,
- 0x333B, 0x209D, 0x333C, 0x2EEA, 0x333D, 0x2EF2, 0x333E, 0x2EF4,
- 0x333F, 0x2EF5, 0x3340, 0x2EF6, 0x3341, 0x2EF3, 0x3342, 0x209B,
- 0x3343, 0x2EF7, 0x3344, 0x2EF8, 0x3345, 0x2EF9, 0x3346, 0x2EFA,
- 0x3347, 0x20A5, 0x3348, 0x2EFB, 0x3349, 0x1F04, 0x334A, 0x1F12,
- 0x334B, 0x2EFC, 0x334C, 0x2EFD, 0x334D, 0x1F07, 0x334E, 0x2091,
- 0x334F, 0x2EFE, 0x3350, 0x2EFF, 0x3351, 0x1F0C, 0x3352, 0x2F02,
- 0x3353, 0x2F06, 0x3354, 0x2F03, 0x3355, 0x2F07, 0x3356, 0x2F08,
- 0x3357, 0x2098, 0x337F, 0x2084, 0xFF08, 0x1EDB, 0xFF09, 0x1EDC,
- 0xFF0C, 0x204C, 0xFF0E, 0x2052, 0xFF1D, 0x1EED, 0xFF3B, 0x1EDF,
- 0xFF3D, 0x1EE0, 0xFF3F, 0x1ED2, 0xFF5B, 0x1EE1, 0xFF5C, 0x1ED8,
- 0xFF5D, 0x1EE2, 0xFF5E, 0x1ED6, 0xFF5F, 0x2F6D, 0xFF60, 0x2F6E,
- 0xFFE3, 0x1ED1,
-};
+// 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
+
+extern const unsigned short g_FXCMAP_UniJIS_UTF16_V_5[289 * 2] = {
+ 0x00B0, 0x204D, 0x2010, 0x1ED5, 0x2015, 0x1ED4, 0x2016, 0x1ED7,
+ 0x2025, 0x1EDA, 0x2026, 0x1ED9, 0x2032, 0x2051, 0x2033, 0x205B,
+ 0x2190, 0x02E2, 0x2191, 0x02E0, 0x2192, 0x02E3, 0x2193, 0x02E1,
+ 0x21C4, 0x2077, 0x21C5, 0x2076, 0x21C6, 0x2078, 0x21E6, 0x1F4C,
+ 0x21E7, 0x1F4E, 0x21E8, 0x1F4B, 0x21E9, 0x1F4D, 0x239B, 0x2F74,
+ 0x239C, 0x2F88, 0x239D, 0x2F73, 0x239E, 0x2F76, 0x239F, 0x2F88,
+ 0x23A0, 0x2F75, 0x23A1, 0x2F7C, 0x23A2, 0x2F88, 0x23A3, 0x2F7B,
+ 0x23A4, 0x2F7E, 0x23A5, 0x2F88, 0x23A6, 0x2F7D, 0x23A7, 0x1FE8,
+ 0x23A8, 0x1FE7, 0x23A9, 0x1FE6, 0x23AA, 0x2F88, 0x23AB, 0x1FEC,
+ 0x23AC, 0x1FEB, 0x23AD, 0x1FEA, 0x23B0, 0x3FDE, 0x23B1, 0x3FDF,
+ 0x2500, 0x1D39, 0x2501, 0x1D3A, 0x2502, 0x1D37, 0x2503, 0x1D38,
+ 0x2504, 0x1D3D, 0x2505, 0x1D3E, 0x2506, 0x1D3B, 0x2507, 0x1D3C,
+ 0x2508, 0x1D41, 0x2509, 0x1D42, 0x250A, 0x1D3F, 0x250B, 0x1D40,
+ 0x250C, 0x1D47, 0x250D, 0x1D49, 0x250E, 0x1D48, 0x250F, 0x1D4A,
+ 0x2510, 0x1D4F, 0x2511, 0x1D51, 0x2512, 0x1D50, 0x2513, 0x1D52,
+ 0x2514, 0x1D43, 0x2515, 0x1D45, 0x2516, 0x1D44, 0x2517, 0x1D46,
+ 0x2518, 0x1D4B, 0x2519, 0x1D4D, 0x251A, 0x1D4C, 0x251B, 0x1D4E,
+ 0x251C, 0x1D63, 0x251D, 0x1D67, 0x251E, 0x1D65, 0x251F, 0x1D64,
+ 0x2520, 0x1D66, 0x2521, 0x1D69, 0x2522, 0x1D68, 0x2523, 0x1D6A,
+ 0x2524, 0x1D6B, 0x2525, 0x1D6F, 0x2526, 0x1D6D, 0x2527, 0x1D6C,
+ 0x2528, 0x1D6E, 0x2529, 0x1D71, 0x252A, 0x1D70, 0x252B, 0x1D72,
+ 0x252C, 0x1D5B, 0x252D, 0x1D5D, 0x252E, 0x1D5E, 0x252F, 0x1D5F,
+ 0x2530, 0x1D5C, 0x2531, 0x1D60, 0x2532, 0x1D61, 0x2533, 0x1D62,
+ 0x2534, 0x1D53, 0x2535, 0x1D55, 0x2536, 0x1D56, 0x2537, 0x1D57,
+ 0x2538, 0x1D54, 0x2539, 0x1D58, 0x253A, 0x1D59, 0x253B, 0x1D5A,
+ 0x253D, 0x1D77, 0x253E, 0x1D78, 0x253F, 0x1D79, 0x2540, 0x1D75,
+ 0x2541, 0x1D74, 0x2542, 0x1D76, 0x2543, 0x1D7B, 0x2544, 0x1D7D,
+ 0x2545, 0x1D7A, 0x2546, 0x1D7C, 0x2547, 0x1D81, 0x2548, 0x1D80,
+ 0x2549, 0x1D7E, 0x254A, 0x1D7F, 0x261C, 0x201D, 0x261D, 0x201B,
+ 0x261E, 0x201E, 0x261F, 0x201C, 0x2702, 0x2F92, 0x27A1, 0x2011,
+ 0x3001, 0x1ECF, 0x3002, 0x1ED0, 0x3008, 0x1EE3, 0x3009, 0x1EE4,
+ 0x300A, 0x1EE5, 0x300B, 0x1EE6, 0x300C, 0x1EE7, 0x300D, 0x1EE8,
+ 0x300E, 0x1EE9, 0x300F, 0x1EEA, 0x3010, 0x1EEB, 0x3011, 0x1EEC,
+ 0x3014, 0x1EDD, 0x3015, 0x1EDE, 0x3016, 0x3FC9, 0x3017, 0x3FCA,
+ 0x3018, 0x2F6B, 0x3019, 0x2F6C, 0x301C, 0x1ED6, 0x301D, 0x1F14,
+ 0x301F, 0x1F15, 0x303B, 0x2F4B, 0x3041, 0x1EEE, 0x3043, 0x1EEF,
+ 0x3045, 0x1EF0, 0x3047, 0x1EF1, 0x3049, 0x1EF2, 0x3063, 0x1EF3,
+ 0x3083, 0x1EF4, 0x3085, 0x1EF5, 0x3087, 0x1EF6, 0x308E, 0x1EF7,
+ 0x3095, 0x2048, 0x3096, 0x2049, 0x309B, 0x2050, 0x309C, 0x204F,
+ 0x30A0, 0x3FCB, 0x30A1, 0x1EF8, 0x30A3, 0x1EF9, 0x30A5, 0x1EFA,
+ 0x30A7, 0x1EFB, 0x30A9, 0x1EFC, 0x30C3, 0x1EFD, 0x30E3, 0x1EFE,
+ 0x30E5, 0x1EFF, 0x30E7, 0x1F00, 0x30EE, 0x1F01, 0x30F5, 0x1F02,
+ 0x30F6, 0x1F03, 0x30FC, 0x1ED3, 0x31F0, 0x3FCD, 0x31F1, 0x3FCE,
+ 0x31F2, 0x3FCF, 0x31F3, 0x3FD0, 0x31F4, 0x3FD1, 0x31F5, 0x3FD2,
+ 0x31F6, 0x3FD3, 0x31F7, 0x3FD4, 0x31F8, 0x3FD5, 0x31F9, 0x3FD6,
+ 0x31FA, 0x3FD8, 0x31FB, 0x3FD9, 0x31FC, 0x3FDA, 0x31FD, 0x3FDB,
+ 0x31FE, 0x3FDC, 0x31FF, 0x3FDD, 0x3300, 0x209E, 0x3301, 0x2EB6,
+ 0x3302, 0x2EB7, 0x3303, 0x2092, 0x3304, 0x2EB8, 0x3305, 0x208D,
+ 0x3306, 0x2EB9, 0x3307, 0x2EBD, 0x3308, 0x2EBB, 0x3309, 0x2EC0,
+ 0x330A, 0x2EBE, 0x330B, 0x2EC2, 0x330C, 0x2EC4, 0x330D, 0x1F0E,
+ 0x330E, 0x2EC5, 0x330F, 0x2EC6, 0x3310, 0x2EC7, 0x3311, 0x2EC8,
+ 0x3312, 0x2EC9, 0x3313, 0x2ECA, 0x3314, 0x1F05, 0x3315, 0x2094,
+ 0x3316, 0x208A, 0x3317, 0x2ECC, 0x3318, 0x2093, 0x3319, 0x2ECE,
+ 0x331A, 0x2ED0, 0x331B, 0x2ED1, 0x331C, 0x2ED2, 0x331D, 0x2ED3,
+ 0x331E, 0x20A1, 0x331F, 0x2ED4, 0x3320, 0x2ED5, 0x3321, 0x2ED6,
+ 0x3322, 0x2089, 0x3323, 0x209C, 0x3324, 0x2ED7, 0x3325, 0x2ED9,
+ 0x3326, 0x1F0F, 0x3327, 0x1F09, 0x3328, 0x2EDC, 0x3329, 0x2EDD,
+ 0x332A, 0x20A4, 0x332B, 0x1F11, 0x332D, 0x2EDF, 0x332E, 0x2EE2,
+ 0x332F, 0x2EE3, 0x3330, 0x2EE4, 0x3331, 0x20A6, 0x3332, 0x2EE5,
+ 0x3333, 0x208E, 0x3334, 0x2EE8, 0x3335, 0x2EE9, 0x3336, 0x1F0B,
+ 0x3337, 0x2EEE, 0x3338, 0x2EF0, 0x3339, 0x2097, 0x333A, 0x2EF1,
+ 0x333B, 0x209D, 0x333C, 0x2EEA, 0x333D, 0x2EF2, 0x333E, 0x2EF4,
+ 0x333F, 0x2EF5, 0x3340, 0x2EF6, 0x3341, 0x2EF3, 0x3342, 0x209B,
+ 0x3343, 0x2EF7, 0x3344, 0x2EF8, 0x3345, 0x2EF9, 0x3346, 0x2EFA,
+ 0x3347, 0x20A5, 0x3348, 0x2EFB, 0x3349, 0x1F04, 0x334A, 0x1F12,
+ 0x334B, 0x2EFC, 0x334C, 0x2EFD, 0x334D, 0x1F07, 0x334E, 0x2091,
+ 0x334F, 0x2EFE, 0x3350, 0x2EFF, 0x3351, 0x1F0C, 0x3352, 0x2F02,
+ 0x3353, 0x2F06, 0x3354, 0x2F03, 0x3355, 0x2F07, 0x3356, 0x2F08,
+ 0x3357, 0x2098, 0x337F, 0x2084, 0xFF08, 0x1EDB, 0xFF09, 0x1EDC,
+ 0xFF0C, 0x204C, 0xFF0E, 0x2052, 0xFF1D, 0x1EED, 0xFF3B, 0x1EDF,
+ 0xFF3D, 0x1EE0, 0xFF3F, 0x1ED2, 0xFF5B, 0x1EE1, 0xFF5C, 0x1ED8,
+ 0xFF5D, 0x1EE2, 0xFF5E, 0x1ED6, 0xFF5F, 0x2F6D, 0xFF60, 0x2F6E,
+ 0xFFE3, 0x1ED1,
+};
diff --git a/core/src/fpdfapi/fpdf_cmaps/Korea1/Adobe-Korea1-UCS2_2.cpp b/core/src/fpdfapi/fpdf_cmaps/Korea1/Adobe-Korea1-UCS2_2.cpp
index f5f7a99b61..837b3ea559 100644
--- a/core/src/fpdfapi/fpdf_cmaps/Korea1/Adobe-Korea1-UCS2_2.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/Korea1/Adobe-Korea1-UCS2_2.cpp
@@ -1,2302 +1,2302 @@
-// 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
-
-extern const unsigned short g_FXCMAP_Korea1CID2Unicode_2[18352] = {
- 0xFFFD, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026,
- 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E,
- 0x002F, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036,
- 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E,
- 0x003F, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046,
- 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E,
- 0x004F, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056,
- 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E,
- 0x005F, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066,
- 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E,
- 0x006F, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076,
- 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E,
- 0x20A9, 0x2010, 0x00A9, 0x2122, 0x22EF, 0x3000, 0x3001, 0x3002,
- 0x00B7, 0x2025, 0x2026, 0x00A8, 0x3003, 0x2013, 0x2014, 0x2016,
- 0xFF3C, 0x223C, 0x2018, 0x2019, 0x201C, 0x201D, 0x3014, 0x3015,
- 0x3008, 0x3009, 0x300A, 0x300B, 0x300C, 0x300D, 0x300E, 0x300F,
- 0x3010, 0x3011, 0x00B1, 0x00D7, 0x00F7, 0x2260, 0x2264, 0x2265,
- 0x221E, 0x2234, 0x00B0, 0x2032, 0x2033, 0x2103, 0x212B, 0xFFE0,
- 0xFFE1, 0xFFE5, 0x2642, 0x2640, 0x2220, 0x22A5, 0x2312, 0x2202,
- 0x2207, 0x2261, 0x2252, 0x00A7, 0x203B, 0x2606, 0x2605, 0x25CB,
- 0x25CF, 0x25CE, 0x25C7, 0x25C6, 0x25A1, 0x25A0, 0x25B3, 0x25B2,
- 0x25BD, 0x25BC, 0x2192, 0x2190, 0x2191, 0x2193, 0x2194, 0x3013,
- 0x226A, 0x226B, 0x221A, 0x223D, 0x221D, 0x2235, 0x222B, 0x222C,
- 0x2208, 0x220B, 0x2286, 0x2287, 0x2282, 0x2283, 0x222A, 0x2229,
- 0x2227, 0x2228, 0xFFE2, 0x21D2, 0x21D4, 0x2200, 0x2203, 0x00B4,
- 0x02DC, 0x02C7, 0x02D8, 0x02DD, 0x02DA, 0x02D9, 0x00B8, 0x02DB,
- 0x00A1, 0x00BF, 0x2236, 0x222E, 0x2211, 0x220F, 0x00A4, 0x2109,
- 0x2030, 0x25C1, 0x25C0, 0x25B7, 0x25B6, 0x2664, 0x2660, 0x2661,
- 0x2665, 0x2667, 0x2663, 0x2299, 0x25C8, 0x25A3, 0x25D0, 0x25D1,
- 0x2592, 0x25A4, 0x25A5, 0x25A8, 0x25A7, 0x25A6, 0x25A9, 0x2668,
- 0x260F, 0x260E, 0x261C, 0x261E, 0x00B6, 0x2020, 0x2021, 0x2195,
- 0x2197, 0x2199, 0x2196, 0x2198, 0x266D, 0x2669, 0x266A, 0x266C,
- 0x327F, 0x321C, 0x2116, 0x33C7, 0x2122, 0x33C2, 0x33D8, 0x2121,
- 0xFF01, 0xFF02, 0xFF03, 0xFF04, 0xFF05, 0xFF06, 0xFF07, 0xFF08,
- 0xFF09, 0xFF0A, 0xFF0B, 0xFF0C, 0xFF0D, 0xFF0E, 0xFF0F, 0xFF10,
- 0xFF11, 0xFF12, 0xFF13, 0xFF14, 0xFF15, 0xFF16, 0xFF17, 0xFF18,
- 0xFF19, 0xFF1A, 0xFF1B, 0xFF1C, 0xFF1D, 0xFF1E, 0xFF1F, 0xFF20,
- 0xFF21, 0xFF22, 0xFF23, 0xFF24, 0xFF25, 0xFF26, 0xFF27, 0xFF28,
- 0xFF29, 0xFF2A, 0xFF2B, 0xFF2C, 0xFF2D, 0xFF2E, 0xFF2F, 0xFF30,
- 0xFF31, 0xFF32, 0xFF33, 0xFF34, 0xFF35, 0xFF36, 0xFF37, 0xFF38,
- 0xFF39, 0xFF3A, 0xFF3B, 0xFFE6, 0xFF3D, 0xFF3E, 0xFF3F, 0xFF40,
- 0xFF41, 0xFF42, 0xFF43, 0xFF44, 0xFF45, 0xFF46, 0xFF47, 0xFF48,
- 0xFF49, 0xFF4A, 0xFF4B, 0xFF4C, 0xFF4D, 0xFF4E, 0xFF4F, 0xFF50,
- 0xFF51, 0xFF52, 0xFF53, 0xFF54, 0xFF55, 0xFF56, 0xFF57, 0xFF58,
- 0xFF59, 0xFF5A, 0xFF5B, 0xFF5C, 0xFF5D, 0xFFE3, 0x3131, 0x3132,
- 0x3133, 0x3134, 0x3135, 0x3136, 0x3137, 0x3138, 0x3139, 0x313A,
- 0x313B, 0x313C, 0x313D, 0x313E, 0x313F, 0x3140, 0x3141, 0x3142,
- 0x3143, 0x3144, 0x3145, 0x3146, 0x3147, 0x3148, 0x3149, 0x314A,
- 0x314B, 0x314C, 0x314D, 0x314E, 0x314F, 0x3150, 0x3151, 0x3152,
- 0x3153, 0x3154, 0x3155, 0x3156, 0x3157, 0x3158, 0x3159, 0x315A,
- 0x315B, 0x315C, 0x315D, 0x315E, 0x315F, 0x3160, 0x3161, 0x3162,
- 0x3163, 0x3165, 0x3166, 0x3167, 0x3168, 0x3169, 0x316A, 0x316B,
- 0x316C, 0x316D, 0x316E, 0x316F, 0x3170, 0x3171, 0x3172, 0x3173,
- 0x3174, 0x3175, 0x3176, 0x3177, 0x3178, 0x3179, 0x317A, 0x317B,
- 0x317C, 0x317D, 0x317E, 0x317F, 0x3180, 0x3181, 0x3182, 0x3183,
- 0x3184, 0x3185, 0x3186, 0x3187, 0x3188, 0x3189, 0x318A, 0x318B,
- 0x318C, 0x318D, 0x318E, 0x2170, 0x2171, 0x2172, 0x2173, 0x2174,
- 0x2175, 0x2176, 0x2177, 0x2178, 0x2179, 0x2160, 0x2161, 0x2162,
- 0x2163, 0x2164, 0x2165, 0x2166, 0x2167, 0x2168, 0x2169, 0x0391,
- 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, 0x0398, 0x0399,
- 0x039A, 0x039B, 0x039C, 0x039D, 0x039E, 0x039F, 0x03A0, 0x03A1,
- 0x03A3, 0x03A4, 0x03A5, 0x03A6, 0x03A7, 0x03A8, 0x03A9, 0x03B1,
- 0x03B2, 0x03B3, 0x03B4, 0x03B5, 0x03B6, 0x03B7, 0x03B8, 0x03B9,
- 0x03BA, 0x03BB, 0x03BC, 0x03BD, 0x03BE, 0x03BF, 0x03C0, 0x03C1,
- 0x03C3, 0x03C4, 0x03C5, 0x03C6, 0x03C7, 0x03C8, 0x03C9, 0x2500,
- 0x2502, 0x250C, 0x2510, 0x2518, 0x2514, 0x251C, 0x252C, 0x2524,
- 0x2534, 0x253C, 0x2501, 0x2503, 0x250F, 0x2513, 0x251B, 0x2517,
- 0x2523, 0x2533, 0x252B, 0x253B, 0x254B, 0x2520, 0x252F, 0x2528,
- 0x2537, 0x253F, 0x251D, 0x2530, 0x2525, 0x2538, 0x2542, 0x2512,
- 0x2511, 0x251A, 0x2519, 0x2516, 0x2515, 0x250E, 0x250D, 0x251E,
- 0x251F, 0x2521, 0x2522, 0x2526, 0x2527, 0x2529, 0x252A, 0x252D,
- 0x252E, 0x2531, 0x2532, 0x2535, 0x2536, 0x2539, 0x253A, 0x253D,
- 0x253E, 0x2540, 0x2541, 0x2543, 0x2544, 0x2545, 0x2546, 0x2547,
- 0x2548, 0x2549, 0x254A, 0x3395, 0x3396, 0x3397, 0x2113, 0x3398,
- 0x33C4, 0x33A3, 0x33A4, 0x33A5, 0x33A6, 0x3399, 0x339A, 0x339B,
- 0x339C, 0x339D, 0x339E, 0x339F, 0x33A0, 0x33A1, 0x33A2, 0x33CA,
- 0x338D, 0x338E, 0x338F, 0x33CF, 0x3388, 0x3389, 0x33C8, 0x33A7,
- 0x33A8, 0x33B0, 0x33B1, 0x33B2, 0x33B3, 0x33B4, 0x33B5, 0x33B6,
- 0x33B7, 0x33B8, 0x33B9, 0x3380, 0x3381, 0x3382, 0x3383, 0x3384,
- 0x33BA, 0x33BB, 0x33BC, 0x33BD, 0x33BE, 0x33BF, 0x3390, 0x3391,
- 0x3392, 0x3393, 0x3394, 0x2126, 0x33C0, 0x33C1, 0x338A, 0x338B,
- 0x338C, 0x33D6, 0x33C5, 0x33AD, 0x33AE, 0x33AF, 0x33DB, 0x33A9,
- 0x33AA, 0x33AB, 0x33AC, 0x33DD, 0x33D0, 0x33D3, 0x33C3, 0x33C9,
- 0x33DC, 0x33C6, 0x00C6, 0x00D0, 0x00AA, 0x0126, 0x0132, 0x013F,
- 0x0141, 0x00D8, 0x0152, 0x00BA, 0x00DE, 0x0166, 0x014A, 0x3260,
- 0x3261, 0x3262, 0x3263, 0x3264, 0x3265, 0x3266, 0x3267, 0x3268,
- 0x3269, 0x326A, 0x326B, 0x326C, 0x326D, 0x326E, 0x326F, 0x3270,
- 0x3271, 0x3272, 0x3273, 0x3274, 0x3275, 0x3276, 0x3277, 0x3278,
- 0x3279, 0x327A, 0x327B, 0x24D0, 0x24D1, 0x24D2, 0x24D3, 0x24D4,
- 0x24D5, 0x24D6, 0x24D7, 0x24D8, 0x24D9, 0x24DA, 0x24DB, 0x24DC,
- 0x24DD, 0x24DE, 0x24DF, 0x24E0, 0x24E1, 0x24E2, 0x24E3, 0x24E4,
- 0x24E5, 0x24E6, 0x24E7, 0x24E8, 0x24E9, 0x2460, 0x2461, 0x2462,
- 0x2463, 0x2464, 0x2465, 0x2466, 0x2467, 0x2468, 0x2469, 0x246A,
- 0x246B, 0x246C, 0x246D, 0x246E, 0x00BD, 0x2153, 0x2154, 0x00BC,
- 0x00BE, 0x215B, 0x215C, 0x215D, 0x215E, 0x00E6, 0x0111, 0x00F0,
- 0x0127, 0x0131, 0x0133, 0x0138, 0x0140, 0x0142, 0x00F8, 0x0153,
- 0x00DF, 0x00FE, 0x0167, 0x014B, 0x0149, 0x3200, 0x3201, 0x3202,
- 0x3203, 0x3204, 0x3205, 0x3206, 0x3207, 0x3208, 0x3209, 0x320A,
- 0x320B, 0x320C, 0x320D, 0x320E, 0x320F, 0x3210, 0x3211, 0x3212,
- 0x3213, 0x3214, 0x3215, 0x3216, 0x3217, 0x3218, 0x3219, 0x321A,
- 0x321B, 0x249C, 0x249D, 0x249E, 0x249F, 0x24A0, 0x24A1, 0x24A2,
- 0x24A3, 0x24A4, 0x24A5, 0x24A6, 0x24A7, 0x24A8, 0x24A9, 0x24AA,
- 0x24AB, 0x24AC, 0x24AD, 0x24AE, 0x24AF, 0x24B0, 0x24B1, 0x24B2,
- 0x24B3, 0x24B4, 0x24B5, 0x2474, 0x2475, 0x2476, 0x2477, 0x2478,
- 0x2479, 0x247A, 0x247B, 0x247C, 0x247D, 0x247E, 0x247F, 0x2480,
- 0x2481, 0x2482, 0x00B9, 0x00B2, 0x00B3, 0x2074, 0x207F, 0x2081,
- 0x2082, 0x2083, 0x2084, 0x3041, 0x3042, 0x3043, 0x3044, 0x3045,
- 0x3046, 0x3047, 0x3048, 0x3049, 0x304A, 0x304B, 0x304C, 0x304D,
- 0x304E, 0x304F, 0x3050, 0x3051, 0x3052, 0x3053, 0x3054, 0x3055,
- 0x3056, 0x3057, 0x3058, 0x3059, 0x305A, 0x305B, 0x305C, 0x305D,
- 0x305E, 0x305F, 0x3060, 0x3061, 0x3062, 0x3063, 0x3064, 0x3065,
- 0x3066, 0x3067, 0x3068, 0x3069, 0x306A, 0x306B, 0x306C, 0x306D,
- 0x306E, 0x306F, 0x3070, 0x3071, 0x3072, 0x3073, 0x3074, 0x3075,
- 0x3076, 0x3077, 0x3078, 0x3079, 0x307A, 0x307B, 0x307C, 0x307D,
- 0x307E, 0x307F, 0x3080, 0x3081, 0x3082, 0x3083, 0x3084, 0x3085,
- 0x3086, 0x3087, 0x3088, 0x3089, 0x308A, 0x308B, 0x308C, 0x308D,
- 0x308E, 0x308F, 0x3090, 0x3091, 0x3092, 0x3093, 0x30A1, 0x30A2,
- 0x30A3, 0x30A4, 0x30A5, 0x30A6, 0x30A7, 0x30A8, 0x30A9, 0x30AA,
- 0x30AB, 0x30AC, 0x30AD, 0x30AE, 0x30AF, 0x30B0, 0x30B1, 0x30B2,
- 0x30B3, 0x30B4, 0x30B5, 0x30B6, 0x30B7, 0x30B8, 0x30B9, 0x30BA,
- 0x30BB, 0x30BC, 0x30BD, 0x30BE, 0x30BF, 0x30C0, 0x30C1, 0x30C2,
- 0x30C3, 0x30C4, 0x30C5, 0x30C6, 0x30C7, 0x30C8, 0x30C9, 0x30CA,
- 0x30CB, 0x30CC, 0x30CD, 0x30CE, 0x30CF, 0x30D0, 0x30D1, 0x30D2,
- 0x30D3, 0x30D4, 0x30D5, 0x30D6, 0x30D7, 0x30D8, 0x30D9, 0x30DA,
- 0x30DB, 0x30DC, 0x30DD, 0x30DE, 0x30DF, 0x30E0, 0x30E1, 0x30E2,
- 0x30E3, 0x30E4, 0x30E5, 0x30E6, 0x30E7, 0x30E8, 0x30E9, 0x30EA,
- 0x30EB, 0x30EC, 0x30ED, 0x30EE, 0x30EF, 0x30F0, 0x30F1, 0x30F2,
- 0x30F3, 0x30F4, 0x30F5, 0x30F6, 0x0410, 0x0411, 0x0412, 0x0413,
- 0x0414, 0x0415, 0x0401, 0x0416, 0x0417, 0x0418, 0x0419, 0x041A,
- 0x041B, 0x041C, 0x041D, 0x041E, 0x041F, 0x0420, 0x0421, 0x0422,
- 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, 0x0428, 0x0429, 0x042A,
- 0x042B, 0x042C, 0x042D, 0x042E, 0x042F, 0x0430, 0x0431, 0x0432,
- 0x0433, 0x0434, 0x0435, 0x0451, 0x0436, 0x0437, 0x0438, 0x0439,
- 0x043A, 0x043B, 0x043C, 0x043D, 0x043E, 0x043F, 0x0440, 0x0441,
- 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, 0x0448, 0x0449,
- 0x044A, 0x044B, 0x044C, 0x044D, 0x044E, 0x044F, 0xAC00, 0xAC01,
- 0xAC04, 0xAC07, 0xAC08, 0xAC09, 0xAC0A, 0xAC10, 0xAC11, 0xAC12,
- 0xAC13, 0xAC14, 0xAC15, 0xAC16, 0xAC17, 0xAC19, 0xAC1A, 0xAC1B,
- 0xAC1C, 0xAC1D, 0xAC20, 0xAC24, 0xAC2C, 0xAC2D, 0xAC2F, 0xAC30,
- 0xAC31, 0xAC38, 0xAC39, 0xAC3C, 0xAC40, 0xAC4B, 0xAC4D, 0xAC54,
- 0xAC58, 0xAC5C, 0xAC70, 0xAC71, 0xAC74, 0xAC77, 0xAC78, 0xAC7A,
- 0xAC80, 0xAC81, 0xAC83, 0xAC84, 0xAC85, 0xAC86, 0xAC89, 0xAC8A,
- 0xAC8B, 0xAC8C, 0xAC90, 0xAC94, 0xAC9C, 0xAC9D, 0xAC9F, 0xACA0,
- 0xACA1, 0xACA8, 0xACA9, 0xACAA, 0xACAC, 0xACAF, 0xACB0, 0xACB8,
- 0xACB9, 0xACBB, 0xACBC, 0xACBD, 0xACC1, 0xACC4, 0xACC8, 0xACCC,
- 0xACD5, 0xACD7, 0xACE0, 0xACE1, 0xACE4, 0xACE7, 0xACE8, 0xACEA,
- 0xACEC, 0xACEF, 0xACF0, 0xACF1, 0xACF3, 0xACF5, 0xACF6, 0xACFC,
- 0xACFD, 0xAD00, 0xAD04, 0xAD06, 0xAD0C, 0xAD0D, 0xAD0F, 0xAD11,
- 0xAD18, 0xAD1C, 0xAD20, 0xAD29, 0xAD2C, 0xAD2D, 0xAD34, 0xAD35,
- 0xAD38, 0xAD3C, 0xAD44, 0xAD45, 0xAD47, 0xAD49, 0xAD50, 0xAD54,
- 0xAD58, 0xAD61, 0xAD63, 0xAD6C, 0xAD6D, 0xAD70, 0xAD73, 0xAD74,
- 0xAD75, 0xAD76, 0xAD7B, 0xAD7C, 0xAD7D, 0xAD7F, 0xAD81, 0xAD82,
- 0xAD88, 0xAD89, 0xAD8C, 0xAD90, 0xAD9C, 0xAD9D, 0xADA4, 0xADB7,
- 0xADC0, 0xADC1, 0xADC4, 0xADC8, 0xADD0, 0xADD1, 0xADD3, 0xADDC,
- 0xADE0, 0xADE4, 0xADF8, 0xADF9, 0xADFC, 0xADFF, 0xAE00, 0xAE01,
- 0xAE08, 0xAE09, 0xAE0B, 0xAE0D, 0xAE14, 0xAE30, 0xAE31, 0xAE34,
- 0xAE37, 0xAE38, 0xAE3A, 0xAE40, 0xAE41, 0xAE43, 0xAE45, 0xAE46,
- 0xAE4A, 0xAE4C, 0xAE4D, 0xAE4E, 0xAE50, 0xAE54, 0xAE56, 0xAE5C,
- 0xAE5D, 0xAE5F, 0xAE60, 0xAE61, 0xAE65, 0xAE68, 0xAE69, 0xAE6C,
- 0xAE70, 0xAE78, 0xAE79, 0xAE7B, 0xAE7C, 0xAE7D, 0xAE84, 0xAE85,
- 0xAE8C, 0xAEBC, 0xAEBD, 0xAEBE, 0xAEC0, 0xAEC4, 0xAECC, 0xAECD,
- 0xAECF, 0xAED0, 0xAED1, 0xAED8, 0xAED9, 0xAEDC, 0xAEE8, 0xAEEB,
- 0xAEED, 0xAEF4, 0xAEF8, 0xAEFC, 0xAF07, 0xAF08, 0xAF0D, 0xAF10,
- 0xAF2C, 0xAF2D, 0xAF30, 0xAF32, 0xAF34, 0xAF3C, 0xAF3D, 0xAF3F,
- 0xAF41, 0xAF42, 0xAF43, 0xAF48, 0xAF49, 0xAF50, 0xAF5C, 0xAF5D,
- 0xAF64, 0xAF65, 0xAF79, 0xAF80, 0xAF84, 0xAF88, 0xAF90, 0xAF91,
- 0xAF95, 0xAF9C, 0xAFB8, 0xAFB9, 0xAFBC, 0xAFC0, 0xAFC7, 0xAFC8,
- 0xAFC9, 0xAFCB, 0xAFCD, 0xAFCE, 0xAFD4, 0xAFDC, 0xAFE8, 0xAFE9,
- 0xAFF0, 0xAFF1, 0xAFF4, 0xAFF8, 0xB000, 0xB001, 0xB004, 0xB00C,
- 0xB010, 0xB014, 0xB01C, 0xB01D, 0xB028, 0xB044, 0xB045, 0xB048,
- 0xB04A, 0xB04C, 0xB04E, 0xB053, 0xB054, 0xB055, 0xB057, 0xB059,
- 0xB05D, 0xB07C, 0xB07D, 0xB080, 0xB084, 0xB08C, 0xB08D, 0xB08F,
- 0xB091, 0xB098, 0xB099, 0xB09A, 0xB09C, 0xB09F, 0xB0A0, 0xB0A1,
- 0xB0A2, 0xB0A8, 0xB0A9, 0xB0AB, 0xB0AC, 0xB0AD, 0xB0AE, 0xB0AF,
- 0xB0B1, 0xB0B3, 0xB0B4, 0xB0B5, 0xB0B8, 0xB0BC, 0xB0C4, 0xB0C5,
- 0xB0C7, 0xB0C8, 0xB0C9, 0xB0D0, 0xB0D1, 0xB0D4, 0xB0D8, 0xB0E0,
- 0xB0E5, 0xB108, 0xB109, 0xB10B, 0xB10C, 0xB110, 0xB112, 0xB113,
- 0xB118, 0xB119, 0xB11B, 0xB11C, 0xB11D, 0xB123, 0xB124, 0xB125,
- 0xB128, 0xB12C, 0xB134, 0xB135, 0xB137, 0xB138, 0xB139, 0xB140,
- 0xB141, 0xB144, 0xB148, 0xB150, 0xB151, 0xB154, 0xB155, 0xB158,
- 0xB15C, 0xB160, 0xB178, 0xB179, 0xB17C, 0xB180, 0xB182, 0xB188,
- 0xB189, 0xB18B, 0xB18D, 0xB192, 0xB193, 0xB194, 0xB198, 0xB19C,
- 0xB1A8, 0xB1CC, 0xB1D0, 0xB1D4, 0xB1DC, 0xB1DD, 0xB1DF, 0xB1E8,
- 0xB1E9, 0xB1EC, 0xB1F0, 0xB1F9, 0xB1FB, 0xB1FD, 0xB204, 0xB205,
- 0xB208, 0xB20B, 0xB20C, 0xB214, 0xB215, 0xB217, 0xB219, 0xB220,
- 0xB234, 0xB23C, 0xB258, 0xB25C, 0xB260, 0xB268, 0xB269, 0xB274,
- 0xB275, 0xB27C, 0xB284, 0xB285, 0xB289, 0xB290, 0xB291, 0xB294,
- 0xB298, 0xB299, 0xB29A, 0xB2A0, 0xB2A1, 0xB2A3, 0xB2A5, 0xB2A6,
- 0xB2AA, 0xB2AC, 0xB2B0, 0xB2B4, 0xB2C8, 0xB2C9, 0xB2CC, 0xB2D0,
- 0xB2D2, 0xB2D8, 0xB2D9, 0xB2DB, 0xB2DD, 0xB2E2, 0xB2E4, 0xB2E5,
- 0xB2E6, 0xB2E8, 0xB2EB, 0xB2EC, 0xB2ED, 0xB2EE, 0xB2EF, 0xB2F3,
- 0xB2F4, 0xB2F5, 0xB2F7, 0xB2F8, 0xB2F9, 0xB2FA, 0xB2FB, 0xB2FF,
- 0xB300, 0xB301, 0xB304, 0xB308, 0xB310, 0xB311, 0xB313, 0xB314,
- 0xB315, 0xB31C, 0xB354, 0xB355, 0xB356, 0xB358, 0xB35B, 0xB35C,
- 0xB35E, 0xB35F, 0xB364, 0xB365, 0xB367, 0xB369, 0xB36B, 0xB36E,
- 0xB370, 0xB371, 0xB374, 0xB378, 0xB380, 0xB381, 0xB383, 0xB384,
- 0xB385, 0xB38C, 0xB390, 0xB394, 0xB3A0, 0xB3A1, 0xB3A8, 0xB3AC,
- 0xB3C4, 0xB3C5, 0xB3C8, 0xB3CB, 0xB3CC, 0xB3CE, 0xB3D0, 0xB3D4,
- 0xB3D5, 0xB3D7, 0xB3D9, 0xB3DB, 0xB3DD, 0xB3E0, 0xB3E4, 0xB3E8,
- 0xB3FC, 0xB410, 0xB418, 0xB41C, 0xB420, 0xB428, 0xB429, 0xB42B,
- 0xB434, 0xB450, 0xB451, 0xB454, 0xB458, 0xB460, 0xB461, 0xB463,
- 0xB465, 0xB46C, 0xB480, 0xB488, 0xB49D, 0xB4A4, 0xB4A8, 0xB4AC,
- 0xB4B5, 0xB4B7, 0xB4B9, 0xB4C0, 0xB4C4, 0xB4C8, 0xB4D0, 0xB4D5,
- 0xB4DC, 0xB4DD, 0xB4E0, 0xB4E3, 0xB4E4, 0xB4E6, 0xB4EC, 0xB4ED,
- 0xB4EF, 0xB4F1, 0xB4F8, 0xB514, 0xB515, 0xB518, 0xB51B, 0xB51C,
- 0xB524, 0xB525, 0xB527, 0xB528, 0xB529, 0xB52A, 0xB530, 0xB531,
- 0xB534, 0xB538, 0xB540, 0xB541, 0xB543, 0xB544, 0xB545, 0xB54B,
- 0xB54C, 0xB54D, 0xB550, 0xB554, 0xB55C, 0xB55D, 0xB55F, 0xB560,
- 0xB561, 0xB5A0, 0xB5A1, 0xB5A4, 0xB5A8, 0xB5AA, 0xB5AB, 0xB5B0,
- 0xB5B1, 0xB5B3, 0xB5B4, 0xB5B5, 0xB5BB, 0xB5BC, 0xB5BD, 0xB5C0,
- 0xB5C4, 0xB5CC, 0xB5CD, 0xB5CF, 0xB5D0, 0xB5D1, 0xB5D8, 0xB5EC,
- 0xB610, 0xB611, 0xB614, 0xB618, 0xB625, 0xB62C, 0xB634, 0xB648,
- 0xB664, 0xB668, 0xB69C, 0xB69D, 0xB6A0, 0xB6A4, 0xB6AB, 0xB6AC,
- 0xB6B1, 0xB6D4, 0xB6F0, 0xB6F4, 0xB6F8, 0xB700, 0xB701, 0xB705,
- 0xB728, 0xB729, 0xB72C, 0xB72F, 0xB730, 0xB738, 0xB739, 0xB73B,
- 0xB744, 0xB748, 0xB74C, 0xB754, 0xB755, 0xB760, 0xB764, 0xB768,
- 0xB770, 0xB771, 0xB773, 0xB775, 0xB77C, 0xB77D, 0xB780, 0xB784,
- 0xB78C, 0xB78D, 0xB78F, 0xB790, 0xB791, 0xB792, 0xB796, 0xB797,
- 0xB798, 0xB799, 0xB79C, 0xB7A0, 0xB7A8, 0xB7A9, 0xB7AB, 0xB7AC,
- 0xB7AD, 0xB7B4, 0xB7B5, 0xB7B8, 0xB7C7, 0xB7C9, 0xB7EC, 0xB7ED,
- 0xB7F0, 0xB7F4, 0xB7FC, 0xB7FD, 0xB7FF, 0xB800, 0xB801, 0xB807,
- 0xB808, 0xB809, 0xB80C, 0xB810, 0xB818, 0xB819, 0xB81B, 0xB81D,
- 0xB824, 0xB825, 0xB828, 0xB82C, 0xB834, 0xB835, 0xB837, 0xB838,
- 0xB839, 0xB840, 0xB844, 0xB851, 0xB853, 0xB85C, 0xB85D, 0xB860,
- 0xB864, 0xB86C, 0xB86D, 0xB86F, 0xB871, 0xB878, 0xB87C, 0xB88D,
- 0xB8A8, 0xB8B0, 0xB8B4, 0xB8B8, 0xB8C0, 0xB8C1, 0xB8C3, 0xB8C5,
- 0xB8CC, 0xB8D0, 0xB8D4, 0xB8DD, 0xB8DF, 0xB8E1, 0xB8E8, 0xB8E9,
- 0xB8EC, 0xB8F0, 0xB8F8, 0xB8F9, 0xB8FB, 0xB8FD, 0xB904, 0xB918,
- 0xB920, 0xB93C, 0xB93D, 0xB940, 0xB944, 0xB94C, 0xB94F, 0xB951,
- 0xB958, 0xB959, 0xB95C, 0xB960, 0xB968, 0xB969, 0xB96B, 0xB96D,
- 0xB974, 0xB975, 0xB978, 0xB97C, 0xB984, 0xB985, 0xB987, 0xB989,
- 0xB98A, 0xB98D, 0xB98E, 0xB9AC, 0xB9AD, 0xB9B0, 0xB9B4, 0xB9BC,
- 0xB9BD, 0xB9BF, 0xB9C1, 0xB9C8, 0xB9C9, 0xB9CC, 0xB9CE, 0xB9CF,
- 0xB9D0, 0xB9D1, 0xB9D2, 0xB9D8, 0xB9D9, 0xB9DB, 0xB9DD, 0xB9DE,
- 0xB9E1, 0xB9E3, 0xB9E4, 0xB9E5, 0xB9E8, 0xB9EC, 0xB9F4, 0xB9F5,
- 0xB9F7, 0xB9F8, 0xB9F9, 0xB9FA, 0xBA00, 0xBA01, 0xBA08, 0xBA15,
- 0xBA38, 0xBA39, 0xBA3C, 0xBA40, 0xBA42, 0xBA48, 0xBA49, 0xBA4B,
- 0xBA4D, 0xBA4E, 0xBA53, 0xBA54, 0xBA55, 0xBA58, 0xBA5C, 0xBA64,
- 0xBA65, 0xBA67, 0xBA68, 0xBA69, 0xBA70, 0xBA71, 0xBA74, 0xBA78,
- 0xBA83, 0xBA84, 0xBA85, 0xBA87, 0xBA8C, 0xBAA8, 0xBAA9, 0xBAAB,
- 0xBAAC, 0xBAB0, 0xBAB2, 0xBAB8, 0xBAB9, 0xBABB, 0xBABD, 0xBAC4,
- 0xBAC8, 0xBAD8, 0xBAD9, 0xBAFC, 0xBB00, 0xBB04, 0xBB0D, 0xBB0F,
- 0xBB11, 0xBB18, 0xBB1C, 0xBB20, 0xBB29, 0xBB2B, 0xBB34, 0xBB35,
- 0xBB36, 0xBB38, 0xBB3B, 0xBB3C, 0xBB3D, 0xBB3E, 0xBB44, 0xBB45,
- 0xBB47, 0xBB49, 0xBB4D, 0xBB4F, 0xBB50, 0xBB54, 0xBB58, 0xBB61,
- 0xBB63, 0xBB6C, 0xBB88, 0xBB8C, 0xBB90, 0xBBA4, 0xBBA8, 0xBBAC,
- 0xBBB4, 0xBBB7, 0xBBC0, 0xBBC4, 0xBBC8, 0xBBD0, 0xBBD3, 0xBBF8,
- 0xBBF9, 0xBBFC, 0xBBFF, 0xBC00, 0xBC02, 0xBC08, 0xBC09, 0xBC0B,
- 0xBC0C, 0xBC0D, 0xBC0F, 0xBC11, 0xBC14, 0xBC15, 0xBC16, 0xBC17,
- 0xBC18, 0xBC1B, 0xBC1C, 0xBC1D, 0xBC1E, 0xBC1F, 0xBC24, 0xBC25,
- 0xBC27, 0xBC29, 0xBC2D, 0xBC30, 0xBC31, 0xBC34, 0xBC38, 0xBC40,
- 0xBC41, 0xBC43, 0xBC44, 0xBC45, 0xBC49, 0xBC4C, 0xBC4D, 0xBC50,
- 0xBC5D, 0xBC84, 0xBC85, 0xBC88, 0xBC8B, 0xBC8C, 0xBC8E, 0xBC94,
- 0xBC95, 0xBC97, 0xBC99, 0xBC9A, 0xBCA0, 0xBCA1, 0xBCA4, 0xBCA7,
- 0xBCA8, 0xBCB0, 0xBCB1, 0xBCB3, 0xBCB4, 0xBCB5, 0xBCBC, 0xBCBD,
- 0xBCC0, 0xBCC4, 0xBCCD, 0xBCCF, 0xBCD0, 0xBCD1, 0xBCD5, 0xBCD8,
- 0xBCDC, 0xBCF4, 0xBCF5, 0xBCF6, 0xBCF8, 0xBCFC, 0xBD04, 0xBD05,
- 0xBD07, 0xBD09, 0xBD10, 0xBD14, 0xBD24, 0xBD2C, 0xBD40, 0xBD48,
- 0xBD49, 0xBD4C, 0xBD50, 0xBD58, 0xBD59, 0xBD64, 0xBD68, 0xBD80,
- 0xBD81, 0xBD84, 0xBD87, 0xBD88, 0xBD89, 0xBD8A, 0xBD90, 0xBD91,
- 0xBD93, 0xBD95, 0xBD99, 0xBD9A, 0xBD9C, 0xBDA4, 0xBDB0, 0xBDB8,
- 0xBDD4, 0xBDD5, 0xBDD8, 0xBDDC, 0xBDE9, 0xBDF0, 0xBDF4, 0xBDF8,
- 0xBE00, 0xBE03, 0xBE05, 0xBE0C, 0xBE0D, 0xBE10, 0xBE14, 0xBE1C,
- 0xBE1D, 0xBE1F, 0xBE44, 0xBE45, 0xBE48, 0xBE4C, 0xBE4E, 0xBE54,
- 0xBE55, 0xBE57, 0xBE59, 0xBE5A, 0xBE5B, 0xBE60, 0xBE61, 0xBE64,
- 0xBE68, 0xBE6A, 0xBE70, 0xBE71, 0xBE73, 0xBE74, 0xBE75, 0xBE7B,
- 0xBE7C, 0xBE7D, 0xBE80, 0xBE84, 0xBE8C, 0xBE8D, 0xBE8F, 0xBE90,
- 0xBE91, 0xBE98, 0xBE99, 0xBEA8, 0xBED0, 0xBED1, 0xBED4, 0xBED7,
- 0xBED8, 0xBEE0, 0xBEE3, 0xBEE4, 0xBEE5, 0xBEEC, 0xBF01, 0xBF08,
- 0xBF09, 0xBF18, 0xBF19, 0xBF1B, 0xBF1C, 0xBF1D, 0xBF40, 0xBF41,
- 0xBF44, 0xBF48, 0xBF50, 0xBF51, 0xBF55, 0xBF94, 0xBFB0, 0xBFC5,
- 0xBFCC, 0xBFCD, 0xBFD0, 0xBFD4, 0xBFDC, 0xBFDF, 0xBFE1, 0xC03C,
- 0xC051, 0xC058, 0xC05C, 0xC060, 0xC068, 0xC069, 0xC090, 0xC091,
- 0xC094, 0xC098, 0xC0A0, 0xC0A1, 0xC0A3, 0xC0A5, 0xC0AC, 0xC0AD,
- 0xC0AF, 0xC0B0, 0xC0B3, 0xC0B4, 0xC0B5, 0xC0B6, 0xC0BC, 0xC0BD,
- 0xC0BF, 0xC0C0, 0xC0C1, 0xC0C5, 0xC0C8, 0xC0C9, 0xC0CC, 0xC0D0,
- 0xC0D8, 0xC0D9, 0xC0DB, 0xC0DC, 0xC0DD, 0xC0E4, 0xC0E5, 0xC0E8,
- 0xC0EC, 0xC0F4, 0xC0F5, 0xC0F7, 0xC0F9, 0xC100, 0xC104, 0xC108,
- 0xC110, 0xC115, 0xC11C, 0xC11D, 0xC11E, 0xC11F, 0xC120, 0xC123,
- 0xC124, 0xC126, 0xC127, 0xC12C, 0xC12D, 0xC12F, 0xC130, 0xC131,
- 0xC136, 0xC138, 0xC139, 0xC13C, 0xC140, 0xC148, 0xC149, 0xC14B,
- 0xC14C, 0xC14D, 0xC154, 0xC155, 0xC158, 0xC15C, 0xC164, 0xC165,
- 0xC167, 0xC168, 0xC169, 0xC170, 0xC174, 0xC178, 0xC185, 0xC18C,
- 0xC18D, 0xC18E, 0xC190, 0xC194, 0xC196, 0xC19C, 0xC19D, 0xC19F,
- 0xC1A1, 0xC1A5, 0xC1A8, 0xC1A9, 0xC1AC, 0xC1B0, 0xC1BD, 0xC1C4,
- 0xC1C8, 0xC1CC, 0xC1D4, 0xC1D7, 0xC1D8, 0xC1E0, 0xC1E4, 0xC1E8,
- 0xC1F0, 0xC1F1, 0xC1F3, 0xC1FC, 0xC1FD, 0xC200, 0xC204, 0xC20C,
- 0xC20D, 0xC20F, 0xC211, 0xC218, 0xC219, 0xC21C, 0xC21F, 0xC220,
- 0xC228, 0xC229, 0xC22B, 0xC22D, 0xC22F, 0xC231, 0xC232, 0xC234,
- 0xC248, 0xC250, 0xC251, 0xC254, 0xC258, 0xC260, 0xC265, 0xC26C,
- 0xC26D, 0xC270, 0xC274, 0xC27C, 0xC27D, 0xC27F, 0xC281, 0xC288,
- 0xC289, 0xC290, 0xC298, 0xC29B, 0xC29D, 0xC2A4, 0xC2A5, 0xC2A8,
- 0xC2AC, 0xC2AD, 0xC2B4, 0xC2B5, 0xC2B7, 0xC2B9, 0xC2DC, 0xC2DD,
- 0xC2E0, 0xC2E3, 0xC2E4, 0xC2EB, 0xC2EC, 0xC2ED, 0xC2EF, 0xC2F1,
- 0xC2F6, 0xC2F8, 0xC2F9, 0xC2FB, 0xC2FC, 0xC300, 0xC308, 0xC309,
- 0xC30C, 0xC30D, 0xC313, 0xC314, 0xC315, 0xC318, 0xC31C, 0xC324,
- 0xC325, 0xC328, 0xC329, 0xC345, 0xC368, 0xC369, 0xC36C, 0xC370,
- 0xC372, 0xC378, 0xC379, 0xC37C, 0xC37D, 0xC384, 0xC388, 0xC38C,
- 0xC3C0, 0xC3D8, 0xC3D9, 0xC3DC, 0xC3DF, 0xC3E0, 0xC3E2, 0xC3E8,
- 0xC3E9, 0xC3ED, 0xC3F4, 0xC3F5, 0xC3F8, 0xC408, 0xC410, 0xC424,
- 0xC42C, 0xC430, 0xC434, 0xC43C, 0xC43D, 0xC448, 0xC464, 0xC465,
- 0xC468, 0xC46C, 0xC474, 0xC475, 0xC479, 0xC480, 0xC494, 0xC49C,
- 0xC4B8, 0xC4BC, 0xC4E9, 0xC4F0, 0xC4F1, 0xC4F4, 0xC4F8, 0xC4FA,
- 0xC4FF, 0xC500, 0xC501, 0xC50C, 0xC510, 0xC514, 0xC51C, 0xC528,
- 0xC529, 0xC52C, 0xC530, 0xC538, 0xC539, 0xC53B, 0xC53D, 0xC544,
- 0xC545, 0xC548, 0xC549, 0xC54A, 0xC54C, 0xC54D, 0xC54E, 0xC553,
- 0xC554, 0xC555, 0xC557, 0xC558, 0xC559, 0xC55D, 0xC55E, 0xC560,
- 0xC561, 0xC564, 0xC568, 0xC570, 0xC571, 0xC573, 0xC574, 0xC575,
- 0xC57C, 0xC57D, 0xC580, 0xC584, 0xC587, 0xC58C, 0xC58D, 0xC58F,
- 0xC591, 0xC595, 0xC597, 0xC598, 0xC59C, 0xC5A0, 0xC5A9, 0xC5B4,
- 0xC5B5, 0xC5B8, 0xC5B9, 0xC5BB, 0xC5BC, 0xC5BD, 0xC5BE, 0xC5C4,
- 0xC5C5, 0xC5C6, 0xC5C7, 0xC5C8, 0xC5C9, 0xC5CA, 0xC5CC, 0xC5CE,
- 0xC5D0, 0xC5D1, 0xC5D4, 0xC5D8, 0xC5E0, 0xC5E1, 0xC5E3, 0xC5E5,
- 0xC5EC, 0xC5ED, 0xC5EE, 0xC5F0, 0xC5F4, 0xC5F6, 0xC5F7, 0xC5FC,
- 0xC5FD, 0xC5FE, 0xC5FF, 0xC600, 0xC601, 0xC605, 0xC606, 0xC607,
- 0xC608, 0xC60C, 0xC610, 0xC618, 0xC619, 0xC61B, 0xC61C, 0xC624,
- 0xC625, 0xC628, 0xC62C, 0xC62D, 0xC62E, 0xC630, 0xC633, 0xC634,
- 0xC635, 0xC637, 0xC639, 0xC63B, 0xC640, 0xC641, 0xC644, 0xC648,
- 0xC650, 0xC651, 0xC653, 0xC654, 0xC655, 0xC65C, 0xC65D, 0xC660,
- 0xC66C, 0xC66F, 0xC671, 0xC678, 0xC679, 0xC67C, 0xC680, 0xC688,
- 0xC689, 0xC68B, 0xC68D, 0xC694, 0xC695, 0xC698, 0xC69C, 0xC6A4,
- 0xC6A5, 0xC6A7, 0xC6A9, 0xC6B0, 0xC6B1, 0xC6B4, 0xC6B8, 0xC6B9,
- 0xC6BA, 0xC6C0, 0xC6C1, 0xC6C3, 0xC6C5, 0xC6CC, 0xC6CD, 0xC6D0,
- 0xC6D4, 0xC6DC, 0xC6DD, 0xC6E0, 0xC6E1, 0xC6E8, 0xC6E9, 0xC6EC,
- 0xC6F0, 0xC6F8, 0xC6F9, 0xC6FD, 0xC704, 0xC705, 0xC708, 0xC70C,
- 0xC714, 0xC715, 0xC717, 0xC719, 0xC720, 0xC721, 0xC724, 0xC728,
- 0xC730, 0xC731, 0xC733, 0xC735, 0xC737, 0xC73C, 0xC73D, 0xC740,
- 0xC744, 0xC74A, 0xC74C, 0xC74D, 0xC74F, 0xC751, 0xC752, 0xC753,
- 0xC754, 0xC755, 0xC756, 0xC757, 0xC758, 0xC75C, 0xC760, 0xC768,
- 0xC76B, 0xC774, 0xC775, 0xC778, 0xC77C, 0xC77D, 0xC77E, 0xC783,
- 0xC784, 0xC785, 0xC787, 0xC788, 0xC789, 0xC78A, 0xC78E, 0xC790,
- 0xC791, 0xC794, 0xC796, 0xC797, 0xC798, 0xC79A, 0xC7A0, 0xC7A1,
- 0xC7A3, 0xC7A4, 0xC7A5, 0xC7A6, 0xC7AC, 0xC7AD, 0xC7B0, 0xC7B4,
- 0xC7BC, 0xC7BD, 0xC7BF, 0xC7C0, 0xC7C1, 0xC7C8, 0xC7C9, 0xC7CC,
- 0xC7CE, 0xC7D0, 0xC7D8, 0xC7DD, 0xC7E4, 0xC7E8, 0xC7EC, 0xC800,
- 0xC801, 0xC804, 0xC808, 0xC80A, 0xC810, 0xC811, 0xC813, 0xC815,
- 0xC816, 0xC81C, 0xC81D, 0xC820, 0xC824, 0xC82C, 0xC82D, 0xC82F,
- 0xC831, 0xC838, 0xC83C, 0xC840, 0xC848, 0xC849, 0xC84C, 0xC84D,
- 0xC854, 0xC870, 0xC871, 0xC874, 0xC878, 0xC87A, 0xC880, 0xC881,
- 0xC883, 0xC885, 0xC886, 0xC887, 0xC88B, 0xC88C, 0xC88D, 0xC894,
- 0xC89D, 0xC89F, 0xC8A1, 0xC8A8, 0xC8BC, 0xC8BD, 0xC8C4, 0xC8C8,
- 0xC8CC, 0xC8D4, 0xC8D5, 0xC8D7, 0xC8D9, 0xC8E0, 0xC8E1, 0xC8E4,
- 0xC8F5, 0xC8FC, 0xC8FD, 0xC900, 0xC904, 0xC905, 0xC906, 0xC90C,
- 0xC90D, 0xC90F, 0xC911, 0xC918, 0xC92C, 0xC934, 0xC950, 0xC951,
- 0xC954, 0xC958, 0xC960, 0xC961, 0xC963, 0xC96C, 0xC970, 0xC974,
- 0xC97C, 0xC988, 0xC989, 0xC98C, 0xC990, 0xC998, 0xC999, 0xC99B,
- 0xC99D, 0xC9C0, 0xC9C1, 0xC9C4, 0xC9C7, 0xC9C8, 0xC9CA, 0xC9D0,
- 0xC9D1, 0xC9D3, 0xC9D5, 0xC9D6, 0xC9D9, 0xC9DA, 0xC9DC, 0xC9DD,
- 0xC9E0, 0xC9E2, 0xC9E4, 0xC9E7, 0xC9EC, 0xC9ED, 0xC9EF, 0xC9F0,
- 0xC9F1, 0xC9F8, 0xC9F9, 0xC9FC, 0xCA00, 0xCA08, 0xCA09, 0xCA0B,
- 0xCA0C, 0xCA0D, 0xCA14, 0xCA18, 0xCA29, 0xCA4C, 0xCA4D, 0xCA50,
- 0xCA54, 0xCA5C, 0xCA5D, 0xCA5F, 0xCA60, 0xCA61, 0xCA68, 0xCA7D,
- 0xCA84, 0xCA98, 0xCABC, 0xCABD, 0xCAC0, 0xCAC4, 0xCACC, 0xCACD,
- 0xCACF, 0xCAD1, 0xCAD3, 0xCAD8, 0xCAD9, 0xCAE0, 0xCAEC, 0xCAF4,
- 0xCB08, 0xCB10, 0xCB14, 0xCB18, 0xCB20, 0xCB21, 0xCB41, 0xCB48,
- 0xCB49, 0xCB4C, 0xCB50, 0xCB58, 0xCB59, 0xCB5D, 0xCB64, 0xCB78,
- 0xCB79, 0xCB9C, 0xCBB8, 0xCBD4, 0xCBE4, 0xCBE7, 0xCBE9, 0xCC0C,
- 0xCC0D, 0xCC10, 0xCC14, 0xCC1C, 0xCC1D, 0xCC21, 0xCC22, 0xCC27,
- 0xCC28, 0xCC29, 0xCC2C, 0xCC2E, 0xCC30, 0xCC38, 0xCC39, 0xCC3B,
- 0xCC3C, 0xCC3D, 0xCC3E, 0xCC44, 0xCC45, 0xCC48, 0xCC4C, 0xCC54,
- 0xCC55, 0xCC57, 0xCC58, 0xCC59, 0xCC60, 0xCC64, 0xCC66, 0xCC68,
- 0xCC70, 0xCC75, 0xCC98, 0xCC99, 0xCC9C, 0xCCA0, 0xCCA8, 0xCCA9,
- 0xCCAB, 0xCCAC, 0xCCAD, 0xCCB4, 0xCCB5, 0xCCB8, 0xCCBC, 0xCCC4,
- 0xCCC5, 0xCCC7, 0xCCC9, 0xCCD0, 0xCCD4, 0xCCE4, 0xCCEC, 0xCCF0,
- 0xCD01, 0xCD08, 0xCD09, 0xCD0C, 0xCD10, 0xCD18, 0xCD19, 0xCD1B,
- 0xCD1D, 0xCD24, 0xCD28, 0xCD2C, 0xCD39, 0xCD5C, 0xCD60, 0xCD64,
- 0xCD6C, 0xCD6D, 0xCD6F, 0xCD71, 0xCD78, 0xCD88, 0xCD94, 0xCD95,
- 0xCD98, 0xCD9C, 0xCDA4, 0xCDA5, 0xCDA7, 0xCDA9, 0xCDB0, 0xCDC4,
- 0xCDCC, 0xCDD0, 0xCDE8, 0xCDEC, 0xCDF0, 0xCDF8, 0xCDF9, 0xCDFB,
- 0xCDFD, 0xCE04, 0xCE08, 0xCE0C, 0xCE14, 0xCE19, 0xCE20, 0xCE21,
- 0xCE24, 0xCE28, 0xCE30, 0xCE31, 0xCE33, 0xCE35, 0xCE58, 0xCE59,
- 0xCE5C, 0xCE5F, 0xCE60, 0xCE61, 0xCE68, 0xCE69, 0xCE6B, 0xCE6D,
- 0xCE74, 0xCE75, 0xCE78, 0xCE7C, 0xCE84, 0xCE85, 0xCE87, 0xCE89,
- 0xCE90, 0xCE91, 0xCE94, 0xCE98, 0xCEA0, 0xCEA1, 0xCEA3, 0xCEA4,
- 0xCEA5, 0xCEAC, 0xCEAD, 0xCEC1, 0xCEE4, 0xCEE5, 0xCEE8, 0xCEEB,
- 0xCEEC, 0xCEF4, 0xCEF5, 0xCEF7, 0xCEF8, 0xCEF9, 0xCF00, 0xCF01,
- 0xCF04, 0xCF08, 0xCF10, 0xCF11, 0xCF13, 0xCF15, 0xCF1C, 0xCF20,
- 0xCF24, 0xCF2C, 0xCF2D, 0xCF2F, 0xCF30, 0xCF31, 0xCF38, 0xCF54,
- 0xCF55, 0xCF58, 0xCF5C, 0xCF64, 0xCF65, 0xCF67, 0xCF69, 0xCF70,
- 0xCF71, 0xCF74, 0xCF78, 0xCF80, 0xCF85, 0xCF8C, 0xCFA1, 0xCFA8,
- 0xCFB0, 0xCFC4, 0xCFE0, 0xCFE1, 0xCFE4, 0xCFE8, 0xCFF0, 0xCFF1,
- 0xCFF3, 0xCFF5, 0xCFFC, 0xD000, 0xD004, 0xD011, 0xD018, 0xD02D,
- 0xD034, 0xD035, 0xD038, 0xD03C, 0xD044, 0xD045, 0xD047, 0xD049,
- 0xD050, 0xD054, 0xD058, 0xD060, 0xD06C, 0xD06D, 0xD070, 0xD074,
- 0xD07C, 0xD07D, 0xD081, 0xD0A4, 0xD0A5, 0xD0A8, 0xD0AC, 0xD0B4,
- 0xD0B5, 0xD0B7, 0xD0B9, 0xD0C0, 0xD0C1, 0xD0C4, 0xD0C8, 0xD0C9,
- 0xD0D0, 0xD0D1, 0xD0D3, 0xD0D4, 0xD0D5, 0xD0DC, 0xD0DD, 0xD0E0,
- 0xD0E4, 0xD0EC, 0xD0ED, 0xD0EF, 0xD0F0, 0xD0F1, 0xD0F8, 0xD10D,
- 0xD130, 0xD131, 0xD134, 0xD138, 0xD13A, 0xD140, 0xD141, 0xD143,
- 0xD144, 0xD145, 0xD14C, 0xD14D, 0xD150, 0xD154, 0xD15C, 0xD15D,
- 0xD15F, 0xD161, 0xD168, 0xD16C, 0xD17C, 0xD184, 0xD188, 0xD1A0,
- 0xD1A1, 0xD1A4, 0xD1A8, 0xD1B0, 0xD1B1, 0xD1B3, 0xD1B5, 0xD1BA,
- 0xD1BC, 0xD1C0, 0xD1D8, 0xD1F4, 0xD1F8, 0xD207, 0xD209, 0xD210,
- 0xD22C, 0xD22D, 0xD230, 0xD234, 0xD23C, 0xD23D, 0xD23F, 0xD241,
- 0xD248, 0xD25C, 0xD264, 0xD280, 0xD281, 0xD284, 0xD288, 0xD290,
- 0xD291, 0xD295, 0xD29C, 0xD2A0, 0xD2A4, 0xD2AC, 0xD2B1, 0xD2B8,
- 0xD2B9, 0xD2BC, 0xD2BF, 0xD2C0, 0xD2C2, 0xD2C8, 0xD2C9, 0xD2CB,
- 0xD2D4, 0xD2D8, 0xD2DC, 0xD2E4, 0xD2E5, 0xD2F0, 0xD2F1, 0xD2F4,
- 0xD2F8, 0xD300, 0xD301, 0xD303, 0xD305, 0xD30C, 0xD30D, 0xD30E,
- 0xD310, 0xD314, 0xD316, 0xD31C, 0xD31D, 0xD31F, 0xD320, 0xD321,
- 0xD325, 0xD328, 0xD329, 0xD32C, 0xD330, 0xD338, 0xD339, 0xD33B,
- 0xD33C, 0xD33D, 0xD344, 0xD345, 0xD37C, 0xD37D, 0xD380, 0xD384,
- 0xD38C, 0xD38D, 0xD38F, 0xD390, 0xD391, 0xD398, 0xD399, 0xD39C,
- 0xD3A0, 0xD3A8, 0xD3A9, 0xD3AB, 0xD3AD, 0xD3B4, 0xD3B8, 0xD3BC,
- 0xD3C4, 0xD3C5, 0xD3C8, 0xD3C9, 0xD3D0, 0xD3D8, 0xD3E1, 0xD3E3,
- 0xD3EC, 0xD3ED, 0xD3F0, 0xD3F4, 0xD3FC, 0xD3FD, 0xD3FF, 0xD401,
- 0xD408, 0xD41D, 0xD440, 0xD444, 0xD45C, 0xD460, 0xD464, 0xD46D,
- 0xD46F, 0xD478, 0xD479, 0xD47C, 0xD47F, 0xD480, 0xD482, 0xD488,
- 0xD489, 0xD48B, 0xD48D, 0xD494, 0xD4A9, 0xD4CC, 0xD4D0, 0xD4D4,
- 0xD4DC, 0xD4DF, 0xD4E8, 0xD4EC, 0xD4F0, 0xD4F8, 0xD4FB, 0xD4FD,
- 0xD504, 0xD508, 0xD50C, 0xD514, 0xD515, 0xD517, 0xD53C, 0xD53D,
- 0xD540, 0xD544, 0xD54C, 0xD54D, 0xD54F, 0xD551, 0xD558, 0xD559,
- 0xD55C, 0xD560, 0xD565, 0xD568, 0xD569, 0xD56B, 0xD56D, 0xD574,
- 0xD575, 0xD578, 0xD57C, 0xD584, 0xD585, 0xD587, 0xD588, 0xD589,
- 0xD590, 0xD5A5, 0xD5C8, 0xD5C9, 0xD5CC, 0xD5D0, 0xD5D2, 0xD5D8,
- 0xD5D9, 0xD5DB, 0xD5DD, 0xD5E4, 0xD5E5, 0xD5E8, 0xD5EC, 0xD5F4,
- 0xD5F5, 0xD5F7, 0xD5F9, 0xD600, 0xD601, 0xD604, 0xD608, 0xD610,
- 0xD611, 0xD613, 0xD614, 0xD615, 0xD61C, 0xD620, 0xD624, 0xD62D,
- 0xD638, 0xD639, 0xD63C, 0xD640, 0xD645, 0xD648, 0xD649, 0xD64B,
- 0xD64D, 0xD651, 0xD654, 0xD655, 0xD658, 0xD65C, 0xD667, 0xD669,
- 0xD670, 0xD671, 0xD674, 0xD683, 0xD685, 0xD68C, 0xD68D, 0xD690,
- 0xD694, 0xD69D, 0xD69F, 0xD6A1, 0xD6A8, 0xD6AC, 0xD6B0, 0xD6B9,
- 0xD6BB, 0xD6C4, 0xD6C5, 0xD6C8, 0xD6CC, 0xD6D1, 0xD6D4, 0xD6D7,
- 0xD6D9, 0xD6E0, 0xD6E4, 0xD6E8, 0xD6F0, 0xD6F5, 0xD6FC, 0xD6FD,
- 0xD700, 0xD704, 0xD711, 0xD718, 0xD719, 0xD71C, 0xD720, 0xD728,
- 0xD729, 0xD72B, 0xD72D, 0xD734, 0xD735, 0xD738, 0xD73C, 0xD744,
- 0xD747, 0xD749, 0xD750, 0xD751, 0xD754, 0xD756, 0xD757, 0xD758,
- 0xD759, 0xD760, 0xD761, 0xD763, 0xD765, 0xD769, 0xD76C, 0xD770,
- 0xD774, 0xD77C, 0xD77D, 0xD781, 0xD788, 0xD789, 0xD78C, 0xD790,
- 0xD798, 0xD799, 0xD79B, 0xD79D, 0x4F3D, 0x4F73, 0x5047, 0x50F9,
- 0x52A0, 0x53EF, 0x5475, 0x54E5, 0x5609, 0x5AC1, 0x5BB6, 0x6687,
- 0x67B6, 0x67B7, 0x67EF, 0x6B4C, 0x73C2, 0x75C2, 0x7A3C, 0x82DB,
- 0x8304, 0x8857, 0x8888, 0x8A36, 0x8CC8, 0x8DCF, 0x8EFB, 0x8FE6,
- 0x99D5, 0x523B, 0x5374, 0x5404, 0x606A, 0x6164, 0x6BBC, 0x73CF,
- 0x811A, 0x89BA, 0x89D2, 0x95A3, 0x4F83, 0x520A, 0x58BE, 0x5978,
- 0x59E6, 0x5E72, 0x5E79, 0x61C7, 0x63C0, 0x6746, 0x67EC, 0x687F,
- 0x6F97, 0x764E, 0x770B, 0x78F5, 0x7A08, 0x7AFF, 0x7C21, 0x809D,
- 0x826E, 0x8271, 0x8AEB, 0x9593, 0x4E6B, 0x559D, 0x66F7, 0x6E34,
- 0x78A3, 0x7AED, 0x845B, 0x8910, 0x874E, 0x97A8, 0x52D8, 0x574E,
- 0x582A, 0x5D4C, 0x611F, 0x61BE, 0x6221, 0x6562, 0x67D1, 0x6A44,
- 0x6E1B, 0x7518, 0x75B3, 0x76E3, 0x77B0, 0x7D3A, 0x90AF, 0x9451,
- 0x9452, 0x9F95, 0x5323, 0x5CAC, 0x7532, 0x80DB, 0x9240, 0x9598,
- 0x525B, 0x5808, 0x59DC, 0x5CA1, 0x5D17, 0x5EB7, 0x5F3A, 0x5F4A,
- 0x6177, 0x6C5F, 0x757A, 0x7586, 0x7CE0, 0x7D73, 0x7DB1, 0x7F8C,
- 0x8154, 0x8221, 0x8591, 0x8941, 0x8B1B, 0x92FC, 0x964D, 0x9C47,
- 0x4ECB, 0x4EF7, 0x500B, 0x51F1, 0x584F, 0x6137, 0x613E, 0x6168,
- 0x6539, 0x69EA, 0x6F11, 0x75A5, 0x7686, 0x76D6, 0x7B87, 0x82A5,
- 0x84CB, 0x93A7, 0x958B, 0x5580, 0x5BA2, 0x5751, 0x7CB3, 0x7FB9,
- 0x91B5, 0x5028, 0x53BB, 0x5C45, 0x5DE8, 0x62D2, 0x636E, 0x64DA,
- 0x64E7, 0x6E20, 0x70AC, 0x795B, 0x8DDD, 0x8E1E, 0x907D, 0x9245,
- 0x92F8, 0x4E7E, 0x4EF6, 0x5065, 0x5DFE, 0x5EFA, 0x6106, 0x6957,
- 0x8171, 0x8654, 0x8E47, 0x9375, 0x9A2B, 0x4E5E, 0x5091, 0x6770,
- 0x6840, 0x5109, 0x528D, 0x5292, 0x6AA2, 0x77BC, 0x9210, 0x9ED4,
- 0x52AB, 0x602F, 0x8FF2, 0x5048, 0x61A9, 0x63ED, 0x64CA, 0x683C,
- 0x6A84, 0x6FC0, 0x8188, 0x89A1, 0x9694, 0x5805, 0x727D, 0x72AC,
- 0x7504, 0x7D79, 0x7E6D, 0x80A9, 0x898B, 0x8B74, 0x9063, 0x9D51,
- 0x6289, 0x6C7A, 0x6F54, 0x7D50, 0x7F3A, 0x8A23, 0x517C, 0x614A,
- 0x7B9D, 0x8B19, 0x9257, 0x938C, 0x4EAC, 0x4FD3, 0x501E, 0x50BE,
- 0x5106, 0x52C1, 0x52CD, 0x537F, 0x5770, 0x5883, 0x5E9A, 0x5F91,
- 0x6176, 0x61AC, 0x64CE, 0x656C, 0x666F, 0x66BB, 0x66F4, 0x6897,
- 0x6D87, 0x7085, 0x70F1, 0x749F, 0x74A5, 0x74CA, 0x75D9, 0x786C,
- 0x78EC, 0x7ADF, 0x7AF6, 0x7D45, 0x7D93, 0x8015, 0x803F, 0x811B,
- 0x8396, 0x8B66, 0x8F15, 0x9015, 0x93E1, 0x9803, 0x9838, 0x9A5A,
- 0x9BE8, 0x4FC2, 0x5553, 0x583A, 0x5951, 0x5B63, 0x5C46, 0x60B8,
- 0x6212, 0x6842, 0x68B0, 0x68E8, 0x6EAA, 0x754C, 0x7678, 0x78CE,
- 0x7A3D, 0x7CFB, 0x7E6B, 0x7E7C, 0x8A08, 0x8AA1, 0x8C3F, 0x968E,
- 0x9DC4, 0x53E4, 0x53E9, 0x544A, 0x5471, 0x56FA, 0x59D1, 0x5B64,
- 0x5C3B, 0x5EAB, 0x62F7, 0x6537, 0x6545, 0x6572, 0x66A0, 0x67AF,
- 0x69C1, 0x6CBD, 0x75FC, 0x7690, 0x777E, 0x7A3F, 0x7F94, 0x8003,
- 0x80A1, 0x818F, 0x82E6, 0x82FD, 0x83F0, 0x85C1, 0x8831, 0x88B4,
- 0x8AA5, 0x8F9C, 0x932E, 0x96C7, 0x9867, 0x9AD8, 0x9F13, 0x54ED,
- 0x659B, 0x66F2, 0x688F, 0x7A40, 0x8C37, 0x9D60, 0x56F0, 0x5764,
- 0x5D11, 0x6606, 0x68B1, 0x68CD, 0x6EFE, 0x7428, 0x889E, 0x9BE4,
- 0x6C68, 0x9AA8, 0x4F9B, 0x516C, 0x5171, 0x529F, 0x5B54, 0x5DE5,
- 0x6050, 0x606D, 0x62F1, 0x63A7, 0x653B, 0x73D9, 0x7A7A, 0x86A3,
- 0x8CA2, 0x978F, 0x4E32, 0x5BE1, 0x6208, 0x679C, 0x74DC, 0x79D1,
- 0x83D3, 0x8A87, 0x8AB2, 0x8DE8, 0x904E, 0x934B, 0x9846, 0x5ED3,
- 0x69E8, 0x85FF, 0x90ED, 0x51A0, 0x5B98, 0x5BEC, 0x6163, 0x68FA,
- 0x6B3E, 0x704C, 0x742F, 0x74D8, 0x7BA1, 0x7F50, 0x83C5, 0x89C0,
- 0x8CAB, 0x95DC, 0x9928, 0x522E, 0x605D, 0x62EC, 0x9002, 0x4F8A,
- 0x5149, 0x5321, 0x58D9, 0x5EE3, 0x66E0, 0x6D38, 0x709A, 0x72C2,
- 0x73D6, 0x7B50, 0x80F1, 0x945B, 0x5366, 0x639B, 0x7F6B, 0x4E56,
- 0x5080, 0x584A, 0x58DE, 0x602A, 0x6127, 0x62D0, 0x69D0, 0x9B41,
- 0x5B8F, 0x7D18, 0x80B1, 0x8F5F, 0x4EA4, 0x50D1, 0x54AC, 0x55AC,
- 0x5B0C, 0x5DA0, 0x5DE7, 0x652A, 0x654E, 0x6821, 0x6A4B, 0x72E1,
- 0x768E, 0x77EF, 0x7D5E, 0x7FF9, 0x81A0, 0x854E, 0x86DF, 0x8F03,
- 0x8F4E, 0x90CA, 0x9903, 0x9A55, 0x9BAB, 0x4E18, 0x4E45, 0x4E5D,
- 0x4EC7, 0x4FF1, 0x5177, 0x52FE, 0x5340, 0x53E3, 0x53E5, 0x548E,
- 0x5614, 0x5775, 0x57A2, 0x5BC7, 0x5D87, 0x5ED0, 0x61FC, 0x62D8,
- 0x6551, 0x67B8, 0x67E9, 0x69CB, 0x6B50, 0x6BC6, 0x6BEC, 0x6C42,
- 0x6E9D, 0x7078, 0x72D7, 0x7396, 0x7403, 0x77BF, 0x77E9, 0x7A76,
- 0x7D7F, 0x8009, 0x81FC, 0x8205, 0x820A, 0x82DF, 0x8862, 0x8B33,
- 0x8CFC, 0x8EC0, 0x9011, 0x90B1, 0x9264, 0x92B6, 0x99D2, 0x9A45,
- 0x9CE9, 0x9DD7, 0x9F9C, 0x570B, 0x5C40, 0x83CA, 0x97A0, 0x97AB,
- 0x9EB4, 0x541B, 0x7A98, 0x7FA4, 0x88D9, 0x8ECD, 0x90E1, 0x5800,
- 0x5C48, 0x6398, 0x7A9F, 0x5BAE, 0x5F13, 0x7A79, 0x7AAE, 0x828E,
- 0x8EAC, 0x5026, 0x5238, 0x52F8, 0x5377, 0x5708, 0x62F3, 0x6372,
- 0x6B0A, 0x6DC3, 0x7737, 0x53A5, 0x7357, 0x8568, 0x8E76, 0x95D5,
- 0x673A, 0x6AC3, 0x6F70, 0x8A6D, 0x8ECC, 0x994B, 0x6677, 0x6B78,
- 0x8CB4, 0x9B3C, 0x53EB, 0x572D, 0x594E, 0x63C6, 0x69FB, 0x73EA,
- 0x7845, 0x7ABA, 0x7AC5, 0x7CFE, 0x8475, 0x898F, 0x8D73, 0x9035,
- 0x95A8, 0x52FB, 0x5747, 0x7547, 0x7B60, 0x83CC, 0x921E, 0x6A58,
- 0x514B, 0x524B, 0x5287, 0x621F, 0x68D8, 0x6975, 0x9699, 0x50C5,
- 0x52A4, 0x52E4, 0x61C3, 0x65A4, 0x6839, 0x69FF, 0x747E, 0x7B4B,
- 0x82B9, 0x83EB, 0x89B2, 0x8B39, 0x8FD1, 0x9949, 0x4ECA, 0x5997,
- 0x64D2, 0x6611, 0x6A8E, 0x7434, 0x7981, 0x79BD, 0x82A9, 0x887E,
- 0x887F, 0x895F, 0x9326, 0x4F0B, 0x53CA, 0x6025, 0x6271, 0x6C72,
- 0x7D1A, 0x7D66, 0x4E98, 0x5162, 0x77DC, 0x80AF, 0x4F01, 0x4F0E,
- 0x5176, 0x5180, 0x55DC, 0x5668, 0x573B, 0x57FA, 0x57FC, 0x5914,
- 0x5947, 0x5993, 0x5BC4, 0x5C90, 0x5D0E, 0x5DF1, 0x5E7E, 0x5FCC,
- 0x6280, 0x65D7, 0x65E3, 0x671E, 0x671F, 0x675E, 0x68CB, 0x68C4,
- 0x6A5F, 0x6B3A, 0x6C23, 0x6C7D, 0x6C82, 0x6DC7, 0x7398, 0x7426,
- 0x742A, 0x7482, 0x74A3, 0x7578, 0x757F, 0x7881, 0x78EF, 0x7941,
- 0x7947, 0x7948, 0x797A, 0x7B95, 0x7D00, 0x7DBA, 0x7F88, 0x8006,
- 0x802D, 0x808C, 0x8A18, 0x8B4F, 0x8C48, 0x8D77, 0x9321, 0x9324,
- 0x98E2, 0x9951, 0x9A0E, 0x9A0F, 0x9A65, 0x9E92, 0x7DCA, 0x4F76,
- 0x5409, 0x62EE, 0x6854, 0x91D1, 0x55AB, 0x513A, 0x5A1C, 0x61E6,
- 0x62CF, 0x62FF, 0x90A3, 0x8AFE, 0x6696, 0x7156, 0x96E3, 0x634F,
- 0x637A, 0x5357, 0x678F, 0x6960, 0x6E73, 0x7537, 0x7D0D, 0x8872,
- 0x56CA, 0x5A18, 0x4E43, 0x5167, 0x5948, 0x67F0, 0x8010, 0x5973,
- 0x5E74, 0x649A, 0x79CA, 0x5FF5, 0x606C, 0x62C8, 0x637B, 0x5BE7,
- 0x5BD7, 0x52AA, 0x5974, 0x5F29, 0x6012, 0x7459, 0x99D1, 0x6FC3,
- 0x81BF, 0x8FB2, 0x60F1, 0x8166, 0x5C3F, 0x5AE9, 0x8A25, 0x677B,
- 0x7D10, 0x80FD, 0x5C3C, 0x6CE5, 0x533F, 0x6EBA, 0x591A, 0x8336,
- 0x4E39, 0x4EB6, 0x4F46, 0x55AE, 0x5718, 0x58C7, 0x5F56, 0x65B7,
- 0x65E6, 0x6A80, 0x6BB5, 0x6E4D, 0x77ED, 0x7AEF, 0x7C1E, 0x7DDE,
- 0x86CB, 0x8892, 0x9132, 0x935B, 0x64BB, 0x6FBE, 0x737A, 0x75B8,
- 0x9054, 0x5556, 0x574D, 0x61BA, 0x64D4, 0x66C7, 0x6DE1, 0x6E5B,
- 0x6F6D, 0x6FB9, 0x75F0, 0x8043, 0x81BD, 0x8541, 0x8983, 0x8AC7,
- 0x8B5A, 0x931F, 0x6C93, 0x7553, 0x7B54, 0x8E0F, 0x905D, 0x5510,
- 0x5802, 0x5858, 0x5E62, 0x6207, 0x649E, 0x68E0, 0x7576, 0x7CD6,
- 0x87B3, 0x9EE8, 0x4EE3, 0x5788, 0x576E, 0x5927, 0x5C0D, 0x5CB1,
- 0x5E36, 0x5F85, 0x6234, 0x64E1, 0x73B3, 0x81FA, 0x888B, 0x8CB8,
- 0x968A, 0x9EDB, 0x5B85, 0x5FB7, 0x60B3, 0x5012, 0x5200, 0x5230,
- 0x5716, 0x5835, 0x5857, 0x5C0E, 0x5C60, 0x5CF6, 0x5D8B, 0x5EA6,
- 0x5F92, 0x60BC, 0x6311, 0x6389, 0x6417, 0x6843, 0x68F9, 0x6AC2,
- 0x6DD8, 0x6E21, 0x6ED4, 0x6FE4, 0x71FE, 0x76DC, 0x7779, 0x79B1,
- 0x7A3B, 0x8404, 0x89A9, 0x8CED, 0x8DF3, 0x8E48, 0x9003, 0x9014,
- 0x9053, 0x90FD, 0x934D, 0x9676, 0x97DC, 0x6BD2, 0x7006, 0x7258,
- 0x72A2, 0x7368, 0x7763, 0x79BF, 0x7BE4, 0x7E9B, 0x8B80, 0x58A9,
- 0x60C7, 0x6566, 0x65FD, 0x66BE, 0x6C8C, 0x711E, 0x71C9, 0x8C5A,
- 0x9813, 0x4E6D, 0x7A81, 0x4EDD, 0x51AC, 0x51CD, 0x52D5, 0x540C,
- 0x61A7, 0x6771, 0x6850, 0x68DF, 0x6D1E, 0x6F7C, 0x75BC, 0x77B3,
- 0x7AE5, 0x80F4, 0x8463, 0x9285, 0x515C, 0x6597, 0x675C, 0x6793,
- 0x75D8, 0x7AC7, 0x8373, 0x8C46, 0x9017, 0x982D, 0x5C6F, 0x81C0,
- 0x829A, 0x9041, 0x906F, 0x920D, 0x5F97, 0x5D9D, 0x6A59, 0x71C8,
- 0x767B, 0x7B49, 0x85E4, 0x8B04, 0x9127, 0x9A30, 0x5587, 0x61F6,
- 0x7669, 0x7F85, 0x863F, 0x87BA, 0x88F8, 0x908F, 0x6D1B, 0x70D9,
- 0x73DE, 0x7D61, 0x843D, 0x916A, 0x99F1, 0x4E82, 0x5375, 0x6B04,
- 0x6B12, 0x703E, 0x721B, 0x862D, 0x9E1E, 0x524C, 0x8FA3, 0x5D50,
- 0x64E5, 0x652C, 0x6B16, 0x6FEB, 0x7C43, 0x7E9C, 0x85CD, 0x8964,
- 0x89BD, 0x62C9, 0x81D8, 0x881F, 0x5ECA, 0x6717, 0x6D6A, 0x72FC,
- 0x7405, 0x746F, 0x8782, 0x90DE, 0x4F86, 0x5D0D, 0x5FA0, 0x840A,
- 0x51B7, 0x63A0, 0x7565, 0x4EAE, 0x5006, 0x5169, 0x51C9, 0x6881,
- 0x6A11, 0x7CAE, 0x7CB1, 0x7CE7, 0x826F, 0x8AD2, 0x8F1B, 0x91CF,
- 0x4FB6, 0x5137, 0x52F5, 0x5442, 0x5EEC, 0x616E, 0x623E, 0x65C5,
- 0x6ADA, 0x6FFE, 0x792A, 0x85DC, 0x8823, 0x95AD, 0x9A62, 0x9A6A,
- 0x9E97, 0x9ECE, 0x529B, 0x66C6, 0x6B77, 0x701D, 0x792B, 0x8F62,
- 0x9742, 0x6190, 0x6200, 0x6523, 0x6F23, 0x7149, 0x7489, 0x7DF4,
- 0x806F, 0x84EE, 0x8F26, 0x9023, 0x934A, 0x51BD, 0x5217, 0x52A3,
- 0x6D0C, 0x70C8, 0x88C2, 0x5EC9, 0x6582, 0x6BAE, 0x6FC2, 0x7C3E,
- 0x7375, 0x4EE4, 0x4F36, 0x56F9, 0x5CBA, 0x5DBA, 0x601C, 0x73B2,
- 0x7B2D, 0x7F9A, 0x7FCE, 0x8046, 0x901E, 0x9234, 0x96F6, 0x9748,
- 0x9818, 0x9F61, 0x4F8B, 0x6FA7, 0x79AE, 0x91B4, 0x96B7, 0x52DE,
- 0x6488, 0x64C4, 0x6AD3, 0x6F5E, 0x7018, 0x7210, 0x76E7, 0x8001,
- 0x8606, 0x865C, 0x8DEF, 0x8F05, 0x9732, 0x9B6F, 0x9DFA, 0x9E75,
- 0x788C, 0x797F, 0x7DA0, 0x83C9, 0x9304, 0x9E7F, 0x9E93, 0x8AD6,
- 0x58DF, 0x5F04, 0x6727, 0x7027, 0x74CF, 0x7C60, 0x807E, 0x5121,
- 0x7028, 0x7262, 0x78CA, 0x8CC2, 0x8CDA, 0x8CF4, 0x96F7, 0x4E86,
- 0x50DA, 0x5BEE, 0x5ED6, 0x6599, 0x71CE, 0x7642, 0x77AD, 0x804A,
- 0x84FC, 0x907C, 0x9B27, 0x9F8D, 0x58D8, 0x5A41, 0x5C62, 0x6A13,
- 0x6DDA, 0x6F0F, 0x763B, 0x7D2F, 0x7E37, 0x851E, 0x8938, 0x93E4,
- 0x964B, 0x5289, 0x65D2, 0x67F3, 0x69B4, 0x6D41, 0x6E9C, 0x700F,
- 0x7409, 0x7460, 0x7559, 0x7624, 0x786B, 0x8B2C, 0x985E, 0x516D,
- 0x622E, 0x9678, 0x4F96, 0x502B, 0x5D19, 0x6DEA, 0x7DB8, 0x8F2A,
- 0x5F8B, 0x6144, 0x6817, 0x9686, 0x52D2, 0x808B, 0x51DC, 0x51CC,
- 0x695E, 0x7A1C, 0x7DBE, 0x83F1, 0x9675, 0x4FDA, 0x5229, 0x5398,
- 0x540F, 0x550E, 0x5C65, 0x60A7, 0x674E, 0x68A8, 0x6D6C, 0x7281,
- 0x72F8, 0x7406, 0x7483, 0x75E2, 0x7C6C, 0x7F79, 0x7FB8, 0x8389,
- 0x88CF, 0x88E1, 0x91CC, 0x91D0, 0x96E2, 0x9BC9, 0x541D, 0x6F7E,
- 0x71D0, 0x7498, 0x85FA, 0x8EAA, 0x96A3, 0x9C57, 0x9E9F, 0x6797,
- 0x6DCB, 0x7433, 0x81E8, 0x9716, 0x782C, 0x7ACB, 0x7B20, 0x7C92,
- 0x6469, 0x746A, 0x75F2, 0x78BC, 0x78E8, 0x99AC, 0x9B54, 0x9EBB,
- 0x5BDE, 0x5E55, 0x6F20, 0x819C, 0x83AB, 0x9088, 0x4E07, 0x534D,
- 0x5A29, 0x5DD2, 0x5F4E, 0x6162, 0x633D, 0x6669, 0x66FC, 0x6EFF,
- 0x6F2B, 0x7063, 0x779E, 0x842C, 0x8513, 0x883B, 0x8F13, 0x9945,
- 0x9C3B, 0x551C, 0x62B9, 0x672B, 0x6CAB, 0x8309, 0x896A, 0x977A,
- 0x4EA1, 0x5984, 0x5FD8, 0x5FD9, 0x671B, 0x7DB2, 0x7F54, 0x8292,
- 0x832B, 0x83BD, 0x8F1E, 0x9099, 0x57CB, 0x59B9, 0x5A92, 0x5BD0,
- 0x6627, 0x679A, 0x6885, 0x6BCF, 0x7164, 0x7F75, 0x8CB7, 0x8CE3,
- 0x9081, 0x9B45, 0x8108, 0x8C8A, 0x964C, 0x9A40, 0x9EA5, 0x5B5F,
- 0x6C13, 0x731B, 0x76F2, 0x76DF, 0x840C, 0x51AA, 0x8993, 0x514D,
- 0x5195, 0x52C9, 0x68C9, 0x6C94, 0x7704, 0x7720, 0x7DBF, 0x7DEC,
- 0x9762, 0x9EB5, 0x6EC5, 0x8511, 0x51A5, 0x540D, 0x547D, 0x660E,
- 0x669D, 0x6927, 0x6E9F, 0x76BF, 0x7791, 0x8317, 0x84C2, 0x879F,
- 0x9169, 0x9298, 0x9CF4, 0x8882, 0x4FAE, 0x5192, 0x52DF, 0x59C6,
- 0x5E3D, 0x6155, 0x6478, 0x6479, 0x66AE, 0x67D0, 0x6A21, 0x6BCD,
- 0x6BDB, 0x725F, 0x7261, 0x7441, 0x7738, 0x77DB, 0x8017, 0x82BC,
- 0x8305, 0x8B00, 0x8B28, 0x8C8C, 0x6728, 0x6C90, 0x7267, 0x76EE,
- 0x7766, 0x7A46, 0x9DA9, 0x6B7F, 0x6C92, 0x5922, 0x6726, 0x8499,
- 0x536F, 0x5893, 0x5999, 0x5EDF, 0x63CF, 0x6634, 0x6773, 0x6E3A,
- 0x732B, 0x7AD7, 0x82D7, 0x9328, 0x52D9, 0x5DEB, 0x61AE, 0x61CB,
- 0x620A, 0x62C7, 0x64AB, 0x65E0, 0x6959, 0x6B66, 0x6BCB, 0x7121,
- 0x73F7, 0x755D, 0x7E46, 0x821E, 0x8302, 0x856A, 0x8AA3, 0x8CBF,
- 0x9727, 0x9D61, 0x58A8, 0x9ED8, 0x5011, 0x520E, 0x543B, 0x554F,
- 0x6587, 0x6C76, 0x7D0A, 0x7D0B, 0x805E, 0x868A, 0x9580, 0x96EF,
- 0x52FF, 0x6C95, 0x7269, 0x5473, 0x5A9A, 0x5C3E, 0x5D4B, 0x5F4C,
- 0x5FAE, 0x672A, 0x68B6, 0x6963, 0x6E3C, 0x6E44, 0x7709, 0x7C73,
- 0x7F8E, 0x8587, 0x8B0E, 0x8FF7, 0x9761, 0x9EF4, 0x5CB7, 0x60B6,
- 0x610D, 0x61AB, 0x654F, 0x65FB, 0x65FC, 0x6C11, 0x6CEF, 0x739F,
- 0x73C9, 0x7DE1, 0x9594, 0x5BC6, 0x871C, 0x8B10, 0x525D, 0x535A,
- 0x62CD, 0x640F, 0x64B2, 0x6734, 0x6A38, 0x6CCA, 0x73C0, 0x749E,
- 0x7B94, 0x7C95, 0x7E1B, 0x818A, 0x8236, 0x8584, 0x8FEB, 0x96F9,
- 0x99C1, 0x4F34, 0x534A, 0x53CD, 0x53DB, 0x62CC, 0x642C, 0x6500,
- 0x6591, 0x69C3, 0x6CEE, 0x6F58, 0x73ED, 0x7554, 0x7622, 0x76E4,
- 0x76FC, 0x78D0, 0x78FB, 0x792C, 0x7D46, 0x822C, 0x87E0, 0x8FD4,
- 0x9812, 0x98EF, 0x52C3, 0x62D4, 0x64A5, 0x6E24, 0x6F51, 0x767C,
- 0x8DCB, 0x91B1, 0x9262, 0x9AEE, 0x9B43, 0x5023, 0x508D, 0x574A,
- 0x59A8, 0x5C28, 0x5E47, 0x5F77, 0x623F, 0x653E, 0x65B9, 0x65C1,
- 0x6609, 0x678B, 0x699C, 0x6EC2, 0x78C5, 0x7D21, 0x80AA, 0x8180,
- 0x822B, 0x82B3, 0x84A1, 0x868C, 0x8A2A, 0x8B17, 0x90A6, 0x9632,
- 0x9F90, 0x500D, 0x4FF3, 0x57F9, 0x5F98, 0x62DC, 0x6392, 0x676F,
- 0x6E43, 0x7119, 0x76C3, 0x80CC, 0x80DA, 0x88F4, 0x88F5, 0x8919,
- 0x8CE0, 0x8F29, 0x914D, 0x966A, 0x4F2F, 0x4F70, 0x5E1B, 0x67CF,
- 0x6822, 0x767D, 0x767E, 0x9B44, 0x5E61, 0x6A0A, 0x7169, 0x71D4,
- 0x756A, 0x7E41, 0x8543, 0x85E9, 0x98DC, 0x4F10, 0x7B4F, 0x7F70,
- 0x95A5, 0x51E1, 0x5E06, 0x68B5, 0x6C3E, 0x6C4E, 0x6CDB, 0x72AF,
- 0x7BC4, 0x8303, 0x6CD5, 0x743A, 0x50FB, 0x5288, 0x58C1, 0x64D8,
- 0x6A97, 0x74A7, 0x7656, 0x78A7, 0x8617, 0x95E2, 0x9739, 0x535E,
- 0x5F01, 0x8B8A, 0x8FA8, 0x8FAF, 0x908A, 0x5225, 0x77A5, 0x9C49,
- 0x9F08, 0x4E19, 0x5002, 0x5175, 0x5C5B, 0x5E77, 0x661E, 0x663A,
- 0x67C4, 0x68C5, 0x70B3, 0x7501, 0x75C5, 0x79C9, 0x7ADD, 0x8F27,
- 0x9920, 0x9A08, 0x4FDD, 0x5821, 0x5831, 0x5BF6, 0x666E, 0x6B65,
- 0x6D11, 0x6E7A, 0x6F7D, 0x73E4, 0x752B, 0x83E9, 0x88DC, 0x8913,
- 0x8B5C, 0x8F14, 0x4F0F, 0x50D5, 0x5310, 0x535C, 0x5B93, 0x5FA9,
- 0x670D, 0x798F, 0x8179, 0x832F, 0x8514, 0x8907, 0x8986, 0x8F39,
- 0x8F3B, 0x99A5, 0x9C12, 0x672C, 0x4E76, 0x4FF8, 0x5949, 0x5C01,
- 0x5CEF, 0x5CF0, 0x6367, 0x68D2, 0x70FD, 0x71A2, 0x742B, 0x7E2B,
- 0x84EC, 0x8702, 0x9022, 0x92D2, 0x9CF3, 0x4E0D, 0x4ED8, 0x4FEF,
- 0x5085, 0x5256, 0x526F, 0x5426, 0x5490, 0x57E0, 0x592B, 0x5A66,
- 0x5B5A, 0x5B75, 0x5BCC, 0x5E9C, 0x6276, 0x6577, 0x65A7, 0x6D6E,
- 0x6EA5, 0x7236, 0x7B26, 0x7C3F, 0x7F36, 0x8150, 0x8151, 0x819A,
- 0x8240, 0x8299, 0x83A9, 0x8A03, 0x8CA0, 0x8CE6, 0x8CFB, 0x8D74,
- 0x8DBA, 0x90E8, 0x91DC, 0x961C, 0x9644, 0x99D9, 0x9CE7, 0x5317,
- 0x5206, 0x5429, 0x5674, 0x58B3, 0x5954, 0x596E, 0x5FFF, 0x61A4,
- 0x626E, 0x6610, 0x6C7E, 0x711A, 0x76C6, 0x7C89, 0x7CDE, 0x7D1B,
- 0x82AC, 0x8CC1, 0x96F0, 0x4F5B, 0x5F17, 0x5F7F, 0x62C2, 0x5D29,
- 0x670B, 0x68DA, 0x787C, 0x7E43, 0x9D6C, 0x4E15, 0x5099, 0x5315,
- 0x532A, 0x5351, 0x5983, 0x5A62, 0x5E87, 0x60B2, 0x618A, 0x6249,
- 0x6279, 0x6590, 0x6787, 0x69A7, 0x6BD4, 0x6BD6, 0x6BD7, 0x6BD8,
- 0x6CB8, 0x7435, 0x75FA, 0x7812, 0x7891, 0x79D5, 0x79D8, 0x7C83,
- 0x7DCB, 0x7FE1, 0x80A5, 0x813E, 0x81C2, 0x83F2, 0x871A, 0x88E8,
- 0x8AB9, 0x8B6C, 0x8CBB, 0x9119, 0x975E, 0x98DB, 0x9F3B, 0x56AC,
- 0x5B2A, 0x5F6C, 0x658C, 0x6AB3, 0x6BAF, 0x6D5C, 0x6FF1, 0x7015,
- 0x725D, 0x73AD, 0x8CA7, 0x8CD3, 0x983B, 0x6191, 0x6C37, 0x8058,
- 0x9A01, 0x4E4D, 0x4E8B, 0x4E9B, 0x4ED5, 0x4F3A, 0x4F3C, 0x4F7F,
- 0x4FDF, 0x50FF, 0x53F2, 0x53F8, 0x5506, 0x55E3, 0x56DB, 0x58EB,
- 0x5962, 0x5A11, 0x5BEB, 0x5BFA, 0x5C04, 0x5DF3, 0x5E2B, 0x5F99,
- 0x601D, 0x6368, 0x659C, 0x65AF, 0x67F6, 0x67FB, 0x68AD, 0x6B7B,
- 0x6C99, 0x6CD7, 0x6E23, 0x7009, 0x7345, 0x7802, 0x793E, 0x7940,
- 0x7960, 0x79C1, 0x7BE9, 0x7D17, 0x7D72, 0x8086, 0x820D, 0x838E,
- 0x84D1, 0x86C7, 0x88DF, 0x8A50, 0x8A5E, 0x8B1D, 0x8CDC, 0x8D66,
- 0x8FAD, 0x90AA, 0x98FC, 0x99DF, 0x9E9D, 0x524A, 0x6714, 0x5098,
- 0x522A, 0x5C71, 0x6563, 0x6C55, 0x73CA, 0x7523, 0x759D, 0x7B97,
- 0x849C, 0x9178, 0x9730, 0x4E77, 0x6492, 0x6BBA, 0x715E, 0x85A9,
- 0x4E09, 0x6749, 0x68EE, 0x6E17, 0x829F, 0x8518, 0x886B, 0x63F7,
- 0x6F81, 0x9212, 0x98AF, 0x4E0A, 0x50B7, 0x50CF, 0x511F, 0x5546,
- 0x55AA, 0x5617, 0x5B40, 0x5C19, 0x5CE0, 0x5E38, 0x5E8A, 0x5EA0,
- 0x5EC2, 0x60F3, 0x6851, 0x6A61, 0x6E58, 0x723D, 0x7240, 0x72C0,
- 0x76F8, 0x7965, 0x7BB1, 0x7FD4, 0x88F3, 0x89F4, 0x8A73, 0x8C61,
- 0x8CDE, 0x971C, 0x585E, 0x74BD, 0x8CFD, 0x55C7, 0x7A61, 0x7D22,
- 0x8272, 0x7272, 0x751F, 0x7525, 0x7B19, 0x5885, 0x58FB, 0x5DBC,
- 0x5E8F, 0x5EB6, 0x5F90, 0x6055, 0x6292, 0x637F, 0x654D, 0x6691,
- 0x66D9, 0x66F8, 0x6816, 0x68F2, 0x7280, 0x745E, 0x7B6E, 0x7D6E,
- 0x7DD6, 0x7F72, 0x80E5, 0x8212, 0x85AF, 0x897F, 0x8A93, 0x901D,
- 0x92E4, 0x9ECD, 0x9F20, 0x5915, 0x596D, 0x5E2D, 0x60DC, 0x6614,
- 0x6673, 0x6790, 0x6C50, 0x6DC5, 0x6F5F, 0x77F3, 0x78A9, 0x84C6,
- 0x91CB, 0x932B, 0x4ED9, 0x50CA, 0x5148, 0x5584, 0x5B0B, 0x5BA3,
- 0x6247, 0x657E, 0x65CB, 0x6E32, 0x717D, 0x7401, 0x7444, 0x7487,
- 0x74BF, 0x766C, 0x79AA, 0x7DDA, 0x7E55, 0x7FA8, 0x817A, 0x81B3,
- 0x8239, 0x861A, 0x87EC, 0x8A75, 0x8DE3, 0x9078, 0x9291, 0x9425,
- 0x994D, 0x9BAE, 0x5368, 0x5C51, 0x6954, 0x6CC4, 0x6D29, 0x6E2B,
- 0x820C, 0x859B, 0x893B, 0x8A2D, 0x8AAA, 0x96EA, 0x9F67, 0x5261,
- 0x66B9, 0x6BB2, 0x7E96, 0x87FE, 0x8D0D, 0x9583, 0x965D, 0x651D,
- 0x6D89, 0x71EE, 0x57CE, 0x59D3, 0x5BAC, 0x6027, 0x60FA, 0x6210,
- 0x661F, 0x665F, 0x7329, 0x73F9, 0x76DB, 0x7701, 0x7B6C, 0x8056,
- 0x8072, 0x8165, 0x8AA0, 0x9192, 0x4E16, 0x52E2, 0x6B72, 0x6D17,
- 0x7A05, 0x7B39, 0x7D30, 0x8CB0, 0x53EC, 0x562F, 0x5851, 0x5BB5,
- 0x5C0F, 0x5C11, 0x5DE2, 0x6240, 0x6383, 0x6414, 0x662D, 0x68B3,
- 0x6CBC, 0x6D88, 0x6EAF, 0x701F, 0x70A4, 0x71D2, 0x7526, 0x758F,
- 0x758E, 0x7619, 0x7B11, 0x7BE0, 0x7C2B, 0x7D20, 0x7D39, 0x852C,
- 0x856D, 0x8607, 0x8A34, 0x900D, 0x9061, 0x90B5, 0x92B7, 0x97F6,
- 0x9A37, 0x4FD7, 0x5C6C, 0x675F, 0x6D91, 0x7C9F, 0x7E8C, 0x8B16,
- 0x8D16, 0x901F, 0x5B6B, 0x5DFD, 0x640D, 0x84C0, 0x905C, 0x98E1,
- 0x7387, 0x5B8B, 0x609A, 0x677E, 0x6DDE, 0x8A1F, 0x8AA6, 0x9001,
- 0x980C, 0x5237, 0x7051, 0x788E, 0x9396, 0x8870, 0x91D7, 0x4FEE,
- 0x53D7, 0x55FD, 0x56DA, 0x5782, 0x58FD, 0x5AC2, 0x5B88, 0x5CAB,
- 0x5CC0, 0x5E25, 0x6101, 0x620D, 0x624B, 0x6388, 0x641C, 0x6536,
- 0x6578, 0x6A39, 0x6B8A, 0x6C34, 0x6D19, 0x6F31, 0x71E7, 0x72E9,
- 0x7378, 0x7407, 0x74B2, 0x7626, 0x7761, 0x79C0, 0x7A57, 0x7AEA,
- 0x7CB9, 0x7D8F, 0x7DAC, 0x7E61, 0x7F9E, 0x8129, 0x8331, 0x8490,
- 0x84DA, 0x85EA, 0x8896, 0x8AB0, 0x8B90, 0x8F38, 0x9042, 0x9083,
- 0x916C, 0x9296, 0x92B9, 0x968B, 0x96A7, 0x96A8, 0x96D6, 0x9700,
- 0x9808, 0x9996, 0x9AD3, 0x9B1A, 0x53D4, 0x587E, 0x5919, 0x5B70,
- 0x5BBF, 0x6DD1, 0x6F5A, 0x719F, 0x7421, 0x74B9, 0x8085, 0x83FD,
- 0x5DE1, 0x5F87, 0x5FAA, 0x6042, 0x65EC, 0x6812, 0x696F, 0x6A53,
- 0x6B89, 0x6D35, 0x6DF3, 0x73E3, 0x76FE, 0x77AC, 0x7B4D, 0x7D14,
- 0x8123, 0x821C, 0x8340, 0x84F4, 0x8563, 0x8A62, 0x8AC4, 0x9187,
- 0x931E, 0x9806, 0x99B4, 0x620C, 0x8853, 0x8FF0, 0x9265, 0x5D07,
- 0x5D27, 0x5D69, 0x745F, 0x819D, 0x8768, 0x6FD5, 0x62FE, 0x7FD2,
- 0x8936, 0x8972, 0x4E1E, 0x4E58, 0x50E7, 0x52DD, 0x5347, 0x627F,
- 0x6607, 0x7E69, 0x8805, 0x965E, 0x4F8D, 0x5319, 0x5636, 0x59CB,
- 0x5AA4, 0x5C38, 0x5C4E, 0x5C4D, 0x5E02, 0x5F11, 0x6043, 0x65BD,
- 0x662F, 0x6642, 0x67BE, 0x67F4, 0x731C, 0x77E2, 0x793A, 0x7FC5,
- 0x8494, 0x84CD, 0x8996, 0x8A66, 0x8A69, 0x8AE1, 0x8C55, 0x8C7A,
- 0x57F4, 0x5BD4, 0x5F0F, 0x606F, 0x62ED, 0x690D, 0x6B96, 0x6E5C,
- 0x7184, 0x7BD2, 0x8755, 0x8B58, 0x8EFE, 0x98DF, 0x98FE, 0x4F38,
- 0x4F81, 0x4FE1, 0x547B, 0x5A20, 0x5BB8, 0x613C, 0x65B0, 0x6668,
- 0x71FC, 0x7533, 0x795E, 0x7D33, 0x814E, 0x81E3, 0x8398, 0x85AA,
- 0x85CE, 0x8703, 0x8A0A, 0x8EAB, 0x8F9B, 0x8FC5, 0x5931, 0x5BA4,
- 0x5BE6, 0x6089, 0x5BE9, 0x5C0B, 0x5FC3, 0x6C81, 0x6DF1, 0x700B,
- 0x751A, 0x82AF, 0x8AF6, 0x4EC0, 0x5341, 0x96D9, 0x6C0F, 0x4E9E,
- 0x4FC4, 0x5152, 0x555E, 0x5A25, 0x5CE8, 0x6211, 0x7259, 0x82BD,
- 0x83AA, 0x86FE, 0x8859, 0x8A1D, 0x963F, 0x96C5, 0x9913, 0x9D09,
- 0x9D5D, 0x580A, 0x5CB3, 0x5DBD, 0x5E44, 0x60E1, 0x6115, 0x63E1,
- 0x6A02, 0x6E25, 0x9102, 0x9354, 0x984E, 0x9C10, 0x9F77, 0x5B89,
- 0x5CB8, 0x6309, 0x664F, 0x6848, 0x773C, 0x96C1, 0x978D, 0x9854,
- 0x9B9F, 0x65A1, 0x8B01, 0x8ECB, 0x95BC, 0x5535, 0x5CA9, 0x5DD6,
- 0x5EB5, 0x6697, 0x764C, 0x83F4, 0x95C7, 0x58D3, 0x62BC, 0x72CE,
- 0x9D28, 0x4EF0, 0x592E, 0x600F, 0x663B, 0x6B83, 0x79E7, 0x9D26,
- 0x5393, 0x54C0, 0x57C3, 0x5D16, 0x611B, 0x66D6, 0x6DAF, 0x788D,
- 0x827E, 0x9698, 0x9744, 0x5384, 0x627C, 0x6396, 0x6DB2, 0x7E0A,
- 0x814B, 0x984D, 0x6AFB, 0x7F4C, 0x9DAF, 0x9E1A, 0x4E5F, 0x503B,
- 0x51B6, 0x591C, 0x60F9, 0x63F6, 0x6930, 0x723A, 0x8036, 0x91CE,
- 0x5F31, 0x7D04, 0x82E5, 0x846F, 0x84BB, 0x85E5, 0x8E8D, 0x4F6F,
- 0x58E4, 0x5B43, 0x6059, 0x63DA, 0x6518, 0x656D, 0x6698, 0x694A,
- 0x6A23, 0x6D0B, 0x7001, 0x716C, 0x75D2, 0x760D, 0x79B3, 0x7A70,
- 0x7F8A, 0x8944, 0x8B93, 0x91C0, 0x967D, 0x990A, 0x5704, 0x5FA1,
- 0x65BC, 0x6F01, 0x7600, 0x79A6, 0x8A9E, 0x99AD, 0x9B5A, 0x9F6C,
- 0x5104, 0x61B6, 0x6291, 0x6A8D, 0x81C6, 0x5043, 0x5830, 0x5F66,
- 0x7109, 0x8A00, 0x8AFA, 0x5B7C, 0x8616, 0x4FFA, 0x513C, 0x56B4,
- 0x5944, 0x63A9, 0x6DF9, 0x5DAA, 0x696D, 0x5186, 0x4E88, 0x4F59,
- 0x5982, 0x6B5F, 0x6C5D, 0x74B5, 0x7916, 0x8207, 0x8245, 0x8339,
- 0x8F3F, 0x8F5D, 0x9918, 0x4EA6, 0x57DF, 0x5F79, 0x6613, 0x75AB,
- 0x7E79, 0x8B6F, 0x9006, 0x9A5B, 0x56A5, 0x5827, 0x59F8, 0x5A1F,
- 0x5BB4, 0x5EF6, 0x6350, 0x633B, 0x693D, 0x6C87, 0x6CBF, 0x6D8E,
- 0x6D93, 0x6DF5, 0x6F14, 0x70DF, 0x7136, 0x7159, 0x71C3, 0x71D5,
- 0x784F, 0x786F, 0x7B75, 0x7DE3, 0x7E2F, 0x884D, 0x8EDF, 0x925B,
- 0x9CF6, 0x6085, 0x6D85, 0x71B1, 0x95B1, 0x53AD, 0x67D3, 0x708E,
- 0x7130, 0x7430, 0x8276, 0x82D2, 0x95BB, 0x9AE5, 0x9E7D, 0x66C4,
- 0x71C1, 0x8449, 0x584B, 0x5DB8, 0x5F71, 0x6620, 0x668E, 0x6979,
- 0x69AE, 0x6C38, 0x6CF3, 0x6E36, 0x6F41, 0x6FDA, 0x701B, 0x702F,
- 0x7150, 0x71DF, 0x7370, 0x745B, 0x74D4, 0x76C8, 0x7A4E, 0x7E93,
- 0x82F1, 0x8A60, 0x8FCE, 0x9348, 0x9719, 0x4E42, 0x502A, 0x5208,
- 0x53E1, 0x66F3, 0x6C6D, 0x6FCA, 0x730A, 0x777F, 0x7A62, 0x82AE,
- 0x85DD, 0x8602, 0x88D4, 0x8A63, 0x8B7D, 0x8C6B, 0x92B3, 0x9713,
- 0x9810, 0x4E94, 0x4F0D, 0x4FC9, 0x50B2, 0x5348, 0x543E, 0x5433,
- 0x55DA, 0x5862, 0x58BA, 0x5967, 0x5A1B, 0x5BE4, 0x609F, 0x61CA,
- 0x6556, 0x65FF, 0x6664, 0x68A7, 0x6C5A, 0x6FB3, 0x70CF, 0x71AC,
- 0x7352, 0x7B7D, 0x8708, 0x8AA4, 0x9C32, 0x9F07, 0x5C4B, 0x6C83,
- 0x7344, 0x7389, 0x923A, 0x6EAB, 0x7465, 0x761F, 0x7A69, 0x7E15,
- 0x860A, 0x5140, 0x58C5, 0x64C1, 0x74EE, 0x7515, 0x7670, 0x7FC1,
- 0x9095, 0x96CD, 0x9954, 0x6E26, 0x74E6, 0x7AA9, 0x7AAA, 0x81E5,
- 0x86D9, 0x8778, 0x8A1B, 0x5A49, 0x5B8C, 0x5B9B, 0x68A1, 0x6900,
- 0x6D63, 0x73A9, 0x7413, 0x742C, 0x7897, 0x7DE9, 0x7FEB, 0x8118,
- 0x8155, 0x839E, 0x8C4C, 0x962E, 0x9811, 0x66F0, 0x5F80, 0x65FA,
- 0x6789, 0x6C6A, 0x738B, 0x502D, 0x5A03, 0x6B6A, 0x77EE, 0x5916,
- 0x5D6C, 0x5DCD, 0x7325, 0x754F, 0x50E5, 0x51F9, 0x582F, 0x592D,
- 0x5996, 0x59DA, 0x5BE5, 0x5DA2, 0x62D7, 0x6416, 0x6493, 0x64FE,
- 0x66DC, 0x6A48, 0x71FF, 0x7464, 0x7A88, 0x7AAF, 0x7E47, 0x7E5E,
- 0x8000, 0x8170, 0x87EF, 0x8981, 0x8B20, 0x9059, 0x9080, 0x9952,
- 0x617E, 0x6B32, 0x6D74, 0x7E1F, 0x8925, 0x8FB1, 0x4FD1, 0x50AD,
- 0x5197, 0x52C7, 0x57C7, 0x5889, 0x5BB9, 0x5EB8, 0x6142, 0x6995,
- 0x6D8C, 0x6E67, 0x6EB6, 0x7194, 0x7462, 0x7528, 0x752C, 0x8073,
- 0x8338, 0x84C9, 0x8E0A, 0x9394, 0x93DE, 0x4E8E, 0x4F51, 0x5076,
- 0x512A, 0x53C8, 0x53CB, 0x53F3, 0x5B87, 0x5BD3, 0x5C24, 0x611A,
- 0x6182, 0x65F4, 0x725B, 0x7397, 0x7440, 0x76C2, 0x7950, 0x7991,
- 0x79B9, 0x7D06, 0x7FBD, 0x828B, 0x85D5, 0x865E, 0x8FC2, 0x9047,
- 0x90F5, 0x91EA, 0x9685, 0x96E8, 0x96E9, 0x52D6, 0x5F67, 0x65ED,
- 0x6631, 0x682F, 0x715C, 0x7A36, 0x90C1, 0x980A, 0x4E91, 0x6A52,
- 0x6B9E, 0x6F90, 0x7189, 0x8018, 0x82B8, 0x8553, 0x904B, 0x9695,
- 0x96F2, 0x97FB, 0x851A, 0x9B31, 0x4E90, 0x718A, 0x96C4, 0x5143,
- 0x539F, 0x54E1, 0x5713, 0x5712, 0x57A3, 0x5A9B, 0x5AC4, 0x5BC3,
- 0x6028, 0x613F, 0x63F4, 0x6C85, 0x6D39, 0x6E72, 0x6E90, 0x7230,
- 0x733F, 0x7457, 0x82D1, 0x8881, 0x8F45, 0x9060, 0x9662, 0x9858,
- 0x9D1B, 0x6708, 0x8D8A, 0x925E, 0x4F4D, 0x5049, 0x50DE, 0x5371,
- 0x570D, 0x59D4, 0x5A01, 0x5C09, 0x6170, 0x6690, 0x6E2D, 0x7232,
- 0x744B, 0x7DEF, 0x80C3, 0x840E, 0x8466, 0x853F, 0x875F, 0x885B,
- 0x8918, 0x8B02, 0x9055, 0x97CB, 0x9B4F, 0x4E73, 0x4F91, 0x5112,
- 0x516A, 0x552F, 0x55A9, 0x5B7A, 0x5BA5, 0x5E7C, 0x5E7D, 0x5EBE,
- 0x60A0, 0x60DF, 0x6108, 0x6109, 0x63C4, 0x6538, 0x6709, 0x67D4,
- 0x67DA, 0x6961, 0x6962, 0x6CB9, 0x6D27, 0x6E38, 0x6FE1, 0x7336,
- 0x7337, 0x745C, 0x7531, 0x7652, 0x7DAD, 0x81FE, 0x8438, 0x88D5,
- 0x8A98, 0x8ADB, 0x8AED, 0x8E30, 0x8E42, 0x904A, 0x903E, 0x907A,
- 0x9149, 0x91C9, 0x936E, 0x5809, 0x6BD3, 0x8089, 0x80B2, 0x5141,
- 0x596B, 0x5C39, 0x6F64, 0x73A7, 0x80E4, 0x8D07, 0x9217, 0x958F,
- 0x807F, 0x620E, 0x701C, 0x7D68, 0x878D, 0x57A0, 0x6069, 0x6147,
- 0x6BB7, 0x8ABE, 0x9280, 0x96B1, 0x4E59, 0x541F, 0x6DEB, 0x852D,
- 0x9670, 0x97F3, 0x98EE, 0x63D6, 0x6CE3, 0x9091, 0x51DD, 0x61C9,
- 0x81BA, 0x9DF9, 0x4F9D, 0x501A, 0x5100, 0x5B9C, 0x610F, 0x61FF,
- 0x64EC, 0x6905, 0x6BC5, 0x7591, 0x77E3, 0x7FA9, 0x8264, 0x858F,
- 0x87FB, 0x8863, 0x8ABC, 0x8B70, 0x91AB, 0x4E8C, 0x4EE5, 0x4F0A,
- 0x5937, 0x59E8, 0x5DF2, 0x5F1B, 0x5F5B, 0x6021, 0x723E, 0x73E5,
- 0x7570, 0x75CD, 0x79FB, 0x800C, 0x8033, 0x8084, 0x82E1, 0x8351,
- 0x8CBD, 0x8CB3, 0x9087, 0x98F4, 0x990C, 0x7037, 0x76CA, 0x7FCA,
- 0x7FCC, 0x7FFC, 0x8B1A, 0x4EBA, 0x4EC1, 0x5203, 0x5370, 0x54BD,
- 0x56E0, 0x59FB, 0x5BC5, 0x5F15, 0x5FCD, 0x6E6E, 0x7D6A, 0x8335,
- 0x8693, 0x8A8D, 0x976D, 0x9777, 0x4E00, 0x4F5A, 0x4F7E, 0x58F9,
- 0x65E5, 0x6EA2, 0x9038, 0x93B0, 0x99B9, 0x4EFB, 0x58EC, 0x598A,
- 0x59D9, 0x6041, 0x7A14, 0x834F, 0x8CC3, 0x5165, 0x5344, 0x4ECD,
- 0x5269, 0x5B55, 0x82BF, 0x4ED4, 0x523A, 0x54A8, 0x59C9, 0x59FF,
- 0x5B50, 0x5B57, 0x5B5C, 0x6063, 0x6148, 0x6ECB, 0x7099, 0x716E,
- 0x7386, 0x74F7, 0x75B5, 0x78C1, 0x7D2B, 0x8005, 0x81EA, 0x8328,
- 0x8517, 0x85C9, 0x8AEE, 0x8CC7, 0x96CC, 0x4F5C, 0x52FA, 0x56BC,
- 0x65AB, 0x6628, 0x707C, 0x70B8, 0x7235, 0x7DBD, 0x828D, 0x914C,
- 0x96C0, 0x9D72, 0x5B71, 0x68E7, 0x6B98, 0x6F7A, 0x76DE, 0x5C91,
- 0x66AB, 0x6F5B, 0x7BB4, 0x7C2A, 0x8836, 0x96DC, 0x4E08, 0x4ED7,
- 0x5320, 0x5834, 0x58BB, 0x58EF, 0x596C, 0x5C07, 0x5E33, 0x5E84,
- 0x5F35, 0x638C, 0x66B2, 0x6756, 0x6A1F, 0x6AA3, 0x6B0C, 0x6F3F,
- 0x7246, 0x7350, 0x748B, 0x7AE0, 0x7CA7, 0x8178, 0x81DF, 0x81E7,
- 0x838A, 0x846C, 0x8523, 0x8594, 0x85CF, 0x88DD, 0x8D13, 0x91AC,
- 0x9577, 0x969C, 0x518D, 0x54C9, 0x5728, 0x5BB0, 0x624D, 0x6750,
- 0x683D, 0x6893, 0x6E3D, 0x6ED3, 0x707D, 0x7E21, 0x88C1, 0x8CA1,
- 0x8F09, 0x9F4B, 0x9F4E, 0x722D, 0x7B8F, 0x8ACD, 0x931A, 0x4F47,
- 0x4F4E, 0x5132, 0x5480, 0x59D0, 0x5E95, 0x62B5, 0x6775, 0x696E,
- 0x6A17, 0x6CAE, 0x6E1A, 0x72D9, 0x732A, 0x75BD, 0x7BB8, 0x7D35,
- 0x82E7, 0x83F9, 0x8457, 0x85F7, 0x8A5B, 0x8CAF, 0x8E87, 0x9019,
- 0x90B8, 0x96CE, 0x9F5F, 0x52E3, 0x540A, 0x5AE1, 0x5BC2, 0x6458,
- 0x6575, 0x6EF4, 0x72C4, 0x7684, 0x7A4D, 0x7B1B, 0x7C4D, 0x7E3E,
- 0x7FDF, 0x837B, 0x8B2B, 0x8CCA, 0x8D64, 0x8DE1, 0x8E5F, 0x8FEA,
- 0x8FF9, 0x9069, 0x93D1, 0x4F43, 0x4F7A, 0x50B3, 0x5168, 0x5178,
- 0x524D, 0x526A, 0x5861, 0x587C, 0x5960, 0x5C08, 0x5C55, 0x5EDB,
- 0x609B, 0x6230, 0x6813, 0x6BBF, 0x6C08, 0x6FB1, 0x714E, 0x7420,
- 0x7530, 0x7538, 0x7551, 0x7672, 0x7B4C, 0x7B8B, 0x7BAD, 0x7BC6,
- 0x7E8F, 0x8A6E, 0x8F3E, 0x8F49, 0x923F, 0x9293, 0x9322, 0x942B,
- 0x96FB, 0x985A, 0x986B, 0x991E, 0x5207, 0x622A, 0x6298, 0x6D59,
- 0x7664, 0x7ACA, 0x7BC0, 0x7D76, 0x5360, 0x5CBE, 0x5E97, 0x6F38,
- 0x70B9, 0x7C98, 0x9711, 0x9B8E, 0x9EDE, 0x63A5, 0x647A, 0x8776,
- 0x4E01, 0x4E95, 0x4EAD, 0x505C, 0x5075, 0x5448, 0x59C3, 0x5B9A,
- 0x5E40, 0x5EAD, 0x5EF7, 0x5F81, 0x60C5, 0x633A, 0x653F, 0x6574,
- 0x65CC, 0x6676, 0x6678, 0x67FE, 0x6968, 0x6A89, 0x6B63, 0x6C40,
- 0x6DC0, 0x6DE8, 0x6E1F, 0x6E5E, 0x701E, 0x70A1, 0x738E, 0x73FD,
- 0x753A, 0x775B, 0x7887, 0x798E, 0x7A0B, 0x7A7D, 0x7CBE, 0x7D8E,
- 0x8247, 0x8A02, 0x8AEA, 0x8C9E, 0x912D, 0x914A, 0x91D8, 0x9266,
- 0x92CC, 0x9320, 0x9706, 0x9756, 0x975C, 0x9802, 0x9F0E, 0x5236,
- 0x5291, 0x557C, 0x5824, 0x5E1D, 0x5F1F, 0x608C, 0x63D0, 0x68AF,
- 0x6FDF, 0x796D, 0x7B2C, 0x81CD, 0x85BA, 0x88FD, 0x8AF8, 0x8E44,
- 0x918D, 0x9664, 0x969B, 0x973D, 0x984C, 0x9F4A, 0x4FCE, 0x5146,
- 0x51CB, 0x52A9, 0x5632, 0x5F14, 0x5F6B, 0x63AA, 0x64CD, 0x65E9,
- 0x6641, 0x66FA, 0x66F9, 0x671D, 0x689D, 0x68D7, 0x69FD, 0x6F15,
- 0x6F6E, 0x7167, 0x71E5, 0x722A, 0x74AA, 0x773A, 0x7956, 0x795A,
- 0x79DF, 0x7A20, 0x7A95, 0x7C97, 0x7CDF, 0x7D44, 0x7E70, 0x8087,
- 0x85FB, 0x86A4, 0x8A54, 0x8ABF, 0x8D99, 0x8E81, 0x9020, 0x906D,
- 0x91E3, 0x963B, 0x96D5, 0x9CE5, 0x65CF, 0x7C07, 0x8DB3, 0x93C3,
- 0x5B58, 0x5C0A, 0x5352, 0x62D9, 0x731D, 0x5027, 0x5B97, 0x5F9E,
- 0x60B0, 0x616B, 0x68D5, 0x6DD9, 0x742E, 0x7A2E, 0x7D42, 0x7D9C,
- 0x7E31, 0x816B, 0x8E2A, 0x8E35, 0x937E, 0x9418, 0x4F50, 0x5750,
- 0x5DE6, 0x5EA7, 0x632B, 0x7F6A, 0x4E3B, 0x4F4F, 0x4F8F, 0x505A,
- 0x59DD, 0x80C4, 0x546A, 0x5468, 0x55FE, 0x594F, 0x5B99, 0x5DDE,
- 0x5EDA, 0x665D, 0x6731, 0x67F1, 0x682A, 0x6CE8, 0x6D32, 0x6E4A,
- 0x6F8D, 0x70B7, 0x73E0, 0x7587, 0x7C4C, 0x7D02, 0x7D2C, 0x7DA2,
- 0x821F, 0x86DB, 0x8A3B, 0x8A85, 0x8D70, 0x8E8A, 0x8F33, 0x9031,
- 0x914E, 0x9152, 0x9444, 0x99D0, 0x7AF9, 0x7CA5, 0x4FCA, 0x5101,
- 0x51C6, 0x57C8, 0x5BEF, 0x5CFB, 0x6659, 0x6A3D, 0x6D5A, 0x6E96,
- 0x6FEC, 0x710C, 0x756F, 0x7AE3, 0x8822, 0x9021, 0x9075, 0x96CB,
- 0x99FF, 0x8301, 0x4E2D, 0x4EF2, 0x8846, 0x91CD, 0x537D, 0x6ADB,
- 0x696B, 0x6C41, 0x847A, 0x589E, 0x618E, 0x66FE, 0x62EF, 0x70DD,
- 0x7511, 0x75C7, 0x7E52, 0x84B8, 0x8B49, 0x8D08, 0x4E4B, 0x53EA,
- 0x54AB, 0x5730, 0x5740, 0x5FD7, 0x6301, 0x6307, 0x646F, 0x652F,
- 0x65E8, 0x667A, 0x679D, 0x67B3, 0x6B62, 0x6C60, 0x6C9A, 0x6F2C,
- 0x77E5, 0x7825, 0x7949, 0x7957, 0x7D19, 0x80A2, 0x8102, 0x81F3,
- 0x829D, 0x82B7, 0x8718, 0x8A8C, 0x8D04, 0x8DBE, 0x9072, 0x76F4,
- 0x7A19, 0x7A37, 0x7E54, 0x8077, 0x5507, 0x55D4, 0x5875, 0x632F,
- 0x6422, 0x6649, 0x664B, 0x686D, 0x699B, 0x6B84, 0x6D25, 0x6EB1,
- 0x73CD, 0x7468, 0x74A1, 0x755B, 0x75B9, 0x76E1, 0x771E, 0x778B,
- 0x79E6, 0x7E09, 0x7E1D, 0x81FB, 0x852F, 0x8897, 0x8A3A, 0x8CD1,
- 0x8EEB, 0x8FB0, 0x9032, 0x93AD, 0x9663, 0x9673, 0x9707, 0x4F84,
- 0x53F1, 0x59EA, 0x5AC9, 0x5E19, 0x684E, 0x74C6, 0x75BE, 0x79E9,
- 0x7A92, 0x81A3, 0x86ED, 0x8CEA, 0x8DCC, 0x8FED, 0x659F, 0x6715,
- 0x57F7, 0x6F57, 0x7DDD, 0x8F2F, 0x93F6, 0x96C6, 0x5FB5, 0x61F2,
- 0x6F84, 0x4E14, 0x4F98, 0x501F, 0x53C9, 0x55DF, 0x5D6F, 0x5DEE,
- 0x6B21, 0x6B64, 0x78CB, 0x7B9A, 0x8E49, 0x8ECA, 0x906E, 0x6349,
- 0x643E, 0x7740, 0x7A84, 0x932F, 0x947F, 0x9F6A, 0x64B0, 0x6FAF,
- 0x71E6, 0x74A8, 0x74DA, 0x7AC4, 0x7C12, 0x7E82, 0x7CB2, 0x7E98,
- 0x8B9A, 0x8D0A, 0x947D, 0x9910, 0x994C, 0x5239, 0x5BDF, 0x64E6,
- 0x672D, 0x7D2E, 0x50ED, 0x53C3, 0x5879, 0x6158, 0x6159, 0x61FA,
- 0x65AC, 0x7AD9, 0x8B92, 0x8B96, 0x5009, 0x5021, 0x5275, 0x5531,
- 0x5A3C, 0x5EE0, 0x5F70, 0x6134, 0x655E, 0x660C, 0x6636, 0x66A2,
- 0x69CD, 0x6EC4, 0x6F32, 0x7316, 0x7621, 0x7A93, 0x8139, 0x8259,
- 0x83D6, 0x84BC, 0x50B5, 0x57F0, 0x5BC0, 0x5BE8, 0x5F69, 0x63A1,
- 0x7826, 0x7DB5, 0x83DC, 0x8521, 0x91C7, 0x91F5, 0x518A, 0x67F5,
- 0x7B56, 0x8CAC, 0x51C4, 0x59BB, 0x60BD, 0x8655, 0x501C, 0x5254,
- 0x5C3A, 0x617D, 0x621A, 0x62D3, 0x64F2, 0x65A5, 0x6ECC, 0x7620,
- 0x810A, 0x8E60, 0x965F, 0x96BB, 0x4EDF, 0x5343, 0x5598, 0x5929,
- 0x5DDD, 0x64C5, 0x6CC9, 0x6DFA, 0x7394, 0x7A7F, 0x821B, 0x85A6,
- 0x8CE4, 0x8E10, 0x9077, 0x91E7, 0x95E1, 0x9621, 0x97C6, 0x51F8,
- 0x54F2, 0x5586, 0x5FB9, 0x64A4, 0x6F88, 0x7DB4, 0x8F1F, 0x8F4D,
- 0x9435, 0x50C9, 0x5C16, 0x6CBE, 0x6DFB, 0x751B, 0x77BB, 0x7C3D,
- 0x7C64, 0x8A79, 0x8AC2, 0x581E, 0x59BE, 0x5E16, 0x6377, 0x7252,
- 0x758A, 0x776B, 0x8ADC, 0x8CBC, 0x8F12, 0x5EF3, 0x6674, 0x6DF8,
- 0x807D, 0x83C1, 0x8ACB, 0x9751, 0x9BD6, 0x5243, 0x66FF, 0x6D95,
- 0x6EEF, 0x7DE0, 0x8AE6, 0x902E, 0x905E, 0x9AD4, 0x521D, 0x527F,
- 0x54E8, 0x6194, 0x6284, 0x62DB, 0x68A2, 0x6912, 0x695A, 0x6A35,
- 0x7092, 0x7126, 0x785D, 0x7901, 0x790E, 0x79D2, 0x7A0D, 0x8096,
- 0x8278, 0x82D5, 0x8349, 0x8549, 0x8C82, 0x8D85, 0x9162, 0x918B,
- 0x91AE, 0x4FC3, 0x56D1, 0x71ED, 0x77D7, 0x8700, 0x89F8, 0x5BF8,
- 0x5FD6, 0x6751, 0x90A8, 0x53E2, 0x585A, 0x5BF5, 0x60A4, 0x6181,
- 0x6460, 0x7E3D, 0x8070, 0x8525, 0x9283, 0x64AE, 0x50AC, 0x5D14,
- 0x6700, 0x589C, 0x62BD, 0x63A8, 0x690E, 0x6978, 0x6A1E, 0x6E6B,
- 0x76BA, 0x79CB, 0x82BB, 0x8429, 0x8ACF, 0x8DA8, 0x8FFD, 0x9112,
- 0x914B, 0x919C, 0x9310, 0x9318, 0x939A, 0x96DB, 0x9A36, 0x9C0D,
- 0x4E11, 0x755C, 0x795D, 0x7AFA, 0x7B51, 0x7BC9, 0x7E2E, 0x84C4,
- 0x8E59, 0x8E74, 0x8EF8, 0x9010, 0x6625, 0x693F, 0x7443, 0x51FA,
- 0x672E, 0x9EDC, 0x5145, 0x5FE0, 0x6C96, 0x87F2, 0x885D, 0x8877,
- 0x60B4, 0x81B5, 0x8403, 0x8D05, 0x53D6, 0x5439, 0x5634, 0x5A36,
- 0x5C31, 0x708A, 0x7FE0, 0x805A, 0x8106, 0x81ED, 0x8DA3, 0x9189,
- 0x9A5F, 0x9DF2, 0x5074, 0x4EC4, 0x53A0, 0x60FB, 0x6E2C, 0x5C64,
- 0x4F88, 0x5024, 0x55E4, 0x5CD9, 0x5E5F, 0x6065, 0x6894, 0x6CBB,
- 0x6DC4, 0x71BE, 0x75D4, 0x75F4, 0x7661, 0x7A1A, 0x7A49, 0x7DC7,
- 0x7DFB, 0x7F6E, 0x81F4, 0x86A9, 0x8F1C, 0x96C9, 0x99B3, 0x9F52,
- 0x5247, 0x52C5, 0x98ED, 0x89AA, 0x4E03, 0x67D2, 0x6F06, 0x4FB5,
- 0x5BE2, 0x6795, 0x6C88, 0x6D78, 0x741B, 0x7827, 0x91DD, 0x937C,
- 0x87C4, 0x79E4, 0x7A31, 0x5FEB, 0x4ED6, 0x54A4, 0x553E, 0x58AE,
- 0x59A5, 0x60F0, 0x6253, 0x62D6, 0x6736, 0x6955, 0x8235, 0x9640,
- 0x99B1, 0x99DD, 0x502C, 0x5353, 0x5544, 0x577C, 0x6258, 0x64E2,
- 0x666B, 0x67DD, 0x6FC1, 0x6FEF, 0x7422, 0x7438, 0x8A17, 0x9438,
- 0x5451, 0x5606, 0x5766, 0x5F48, 0x619A, 0x6B4E, 0x7058, 0x70AD,
- 0x7DBB, 0x8A95, 0x596A, 0x812B, 0x63A2, 0x7708, 0x803D, 0x8CAA,
- 0x5854, 0x642D, 0x69BB, 0x5B95, 0x5E11, 0x6E6F, 0x8569, 0x514C,
- 0x53F0, 0x592A, 0x6020, 0x614B, 0x6B86, 0x6C70, 0x6CF0, 0x7B1E,
- 0x80CE, 0x82D4, 0x8DC6, 0x90B0, 0x98B1, 0x64C7, 0x6FA4, 0x6491,
- 0x6504, 0x514E, 0x5410, 0x571F, 0x8A0E, 0x615F, 0x6876, 0x75DB,
- 0x7B52, 0x7D71, 0x901A, 0x5806, 0x69CC, 0x817F, 0x892A, 0x9000,
- 0x9839, 0x5078, 0x5957, 0x59AC, 0x6295, 0x900F, 0x9B2A, 0x615D,
- 0x7279, 0x95D6, 0x5761, 0x5A46, 0x5DF4, 0x628A, 0x64AD, 0x64FA,
- 0x6777, 0x6CE2, 0x6D3E, 0x722C, 0x7436, 0x7834, 0x7F77, 0x82AD,
- 0x8DDB, 0x9817, 0x5224, 0x5742, 0x677F, 0x7248, 0x74E3, 0x8CA9,
- 0x8FA6, 0x9211, 0x962A, 0x516B, 0x53ED, 0x634C, 0x4F69, 0x5504,
- 0x6096, 0x6557, 0x6C9B, 0x6D7F, 0x724C, 0x72FD, 0x7A17, 0x8987,
- 0x8C9D, 0x5F6D, 0x6F8E, 0x70F9, 0x81A8, 0x610E, 0x4FBF, 0x504F,
- 0x6241, 0x7247, 0x7BC7, 0x7DE8, 0x7FE9, 0x904D, 0x97AD, 0x9A19,
- 0x8CB6, 0x576A, 0x5E73, 0x67B0, 0x840D, 0x8A55, 0x5420, 0x5B16,
- 0x5E63, 0x5EE2, 0x5F0A, 0x6583, 0x80BA, 0x853D, 0x9589, 0x965B,
- 0x4F48, 0x5305, 0x530D, 0x530F, 0x5486, 0x54FA, 0x5703, 0x5E03,
- 0x6016, 0x629B, 0x62B1, 0x6355, 0x6CE1, 0x6D66, 0x75B1, 0x7832,
- 0x80DE, 0x812F, 0x82DE, 0x8461, 0x84B2, 0x888D, 0x8912, 0x900B,
- 0x92EA, 0x98FD, 0x9B91, 0x5E45, 0x66B4, 0x66DD, 0x7011, 0x7206,
- 0x4FF5, 0x527D, 0x5F6A, 0x6153, 0x6753, 0x6A19, 0x6F02, 0x74E2,
- 0x7968, 0x8868, 0x8C79, 0x98C7, 0x98C4, 0x9A43, 0x54C1, 0x7A1F,
- 0x6953, 0x8AF7, 0x8C4A, 0x98A8, 0x99AE, 0x5F7C, 0x62AB, 0x75B2,
- 0x76AE, 0x88AB, 0x907F, 0x9642, 0x5339, 0x5F3C, 0x5FC5, 0x6CCC,
- 0x73CC, 0x7562, 0x758B, 0x7B46, 0x82FE, 0x999D, 0x4E4F, 0x903C,
- 0x4E0B, 0x4F55, 0x53A6, 0x590F, 0x5EC8, 0x6630, 0x6CB3, 0x7455,
- 0x8377, 0x8766, 0x8CC0, 0x9050, 0x971E, 0x9C15, 0x58D1, 0x5B78,
- 0x8650, 0x8B14, 0x9DB4, 0x5BD2, 0x6068, 0x608D, 0x65F1, 0x6C57,
- 0x6F22, 0x6FA3, 0x701A, 0x7F55, 0x7FF0, 0x9591, 0x9592, 0x9650,
- 0x97D3, 0x5272, 0x8F44, 0x51FD, 0x542B, 0x54B8, 0x5563, 0x558A,
- 0x6ABB, 0x6DB5, 0x7DD8, 0x8266, 0x929C, 0x9677, 0x9E79, 0x5408,
- 0x54C8, 0x76D2, 0x86E4, 0x95A4, 0x95D4, 0x965C, 0x4EA2, 0x4F09,
- 0x59EE, 0x5AE6, 0x5DF7, 0x6052, 0x6297, 0x676D, 0x6841, 0x6C86,
- 0x6E2F, 0x7F38, 0x809B, 0x822A, 0x9805, 0x4EA5, 0x5055, 0x54B3,
- 0x5793, 0x595A, 0x5B69, 0x5BB3, 0x61C8, 0x6977, 0x6D77, 0x7023,
- 0x87F9, 0x89E3, 0x8A72, 0x8AE7, 0x9082, 0x99ED, 0x9AB8, 0x52BE,
- 0x6838, 0x5016, 0x5E78, 0x674F, 0x8347, 0x884C, 0x4EAB, 0x5411,
- 0x56AE, 0x73E6, 0x9115, 0x97FF, 0x9909, 0x9957, 0x9999, 0x5653,
- 0x589F, 0x865B, 0x8A31, 0x61B2, 0x6AF6, 0x737B, 0x8ED2, 0x6B47,
- 0x96AA, 0x9A57, 0x5955, 0x7200, 0x8D6B, 0x9769, 0x4FD4, 0x5CF4,
- 0x5F26, 0x61F8, 0x665B, 0x6CEB, 0x70AB, 0x7384, 0x73B9, 0x73FE,
- 0x7729, 0x774D, 0x7D43, 0x7D62, 0x7E23, 0x8237, 0x8852, 0x8CE2,
- 0x9249, 0x986F, 0x5B51, 0x7A74, 0x8840, 0x9801, 0x5ACC, 0x4FE0,
- 0x5354, 0x593E, 0x5CFD, 0x633E, 0x6D79, 0x72F9, 0x8105, 0x8107,
- 0x83A2, 0x92CF, 0x9830, 0x4EA8, 0x5144, 0x5211, 0x578B, 0x5F62,
- 0x6CC2, 0x6ECE, 0x7005, 0x7050, 0x70AF, 0x7192, 0x73E9, 0x7469,
- 0x834A, 0x87A2, 0x8861, 0x9008, 0x90A2, 0x93A3, 0x99A8, 0x516E,
- 0x5F57, 0x60E0, 0x6167, 0x66B3, 0x8559, 0x8E4A, 0x91AF, 0x978B,
- 0x4E4E, 0x4E92, 0x547C, 0x58D5, 0x58FA, 0x597D, 0x5CB5, 0x5F27,
- 0x6236, 0x6248, 0x660A, 0x6667, 0x6BEB, 0x6D69, 0x6DCF, 0x6E56,
- 0x6EF8, 0x6F94, 0x6FE0, 0x6FE9, 0x705D, 0x72D0, 0x7425, 0x745A,
- 0x74E0, 0x7693, 0x795C, 0x7CCA, 0x7E1E, 0x80E1, 0x82A6, 0x846B,
- 0x84BF, 0x864E, 0x865F, 0x8774, 0x8B77, 0x8C6A, 0x93AC, 0x9800,
- 0x9865, 0x60D1, 0x6216, 0x9177, 0x5A5A, 0x660F, 0x6DF7, 0x6E3E,
- 0x743F, 0x9B42, 0x5FFD, 0x60DA, 0x7B0F, 0x54C4, 0x5F18, 0x6C5E,
- 0x6CD3, 0x6D2A, 0x70D8, 0x7D05, 0x8679, 0x8A0C, 0x9D3B, 0x5316,
- 0x548C, 0x5B05, 0x6A3A, 0x706B, 0x7575, 0x798D, 0x79BE, 0x82B1,
- 0x83EF, 0x8A71, 0x8B41, 0x8CA8, 0x9774, 0x64F4, 0x652B, 0x78BA,
- 0x78BB, 0x7A6B, 0x4E38, 0x559A, 0x5950, 0x5BA6, 0x5E7B, 0x60A3,
- 0x63DB, 0x6B61, 0x6665, 0x6853, 0x6E19, 0x7165, 0x74B0, 0x7D08,
- 0x9084, 0x9A69, 0x9C25, 0x6D3B, 0x6ED1, 0x733E, 0x8C41, 0x95CA,
- 0x51F0, 0x5E4C, 0x5FA8, 0x604D, 0x60F6, 0x6130, 0x614C, 0x6643,
- 0x6644, 0x69A5, 0x6CC1, 0x6E5F, 0x6EC9, 0x6F62, 0x714C, 0x749C,
- 0x7687, 0x7BC1, 0x7C27, 0x8352, 0x8757, 0x9051, 0x968D, 0x9EC3,
- 0x532F, 0x56DE, 0x5EFB, 0x5F8A, 0x6062, 0x6094, 0x61F7, 0x6666,
- 0x6703, 0x6A9C, 0x6DEE, 0x6FAE, 0x7070, 0x736A, 0x7E6A, 0x81BE,
- 0x8334, 0x86D4, 0x8AA8, 0x8CC4, 0x5283, 0x7372, 0x5B96, 0x6A6B,
- 0x9404, 0x54EE, 0x5686, 0x5B5D, 0x6548, 0x6585, 0x66C9, 0x689F,
- 0x6D8D, 0x6DC6, 0x723B, 0x80B4, 0x9175, 0x9A4D, 0x4FAF, 0x5019,
- 0x539A, 0x540E, 0x543C, 0x5589, 0x55C5, 0x5E3F, 0x5F8C, 0x673D,
- 0x7166, 0x73DD, 0x9005, 0x52DB, 0x52F3, 0x5864, 0x58CE, 0x7104,
- 0x718F, 0x71FB, 0x85B0, 0x8A13, 0x6688, 0x85A8, 0x55A7, 0x6684,
- 0x714A, 0x8431, 0x5349, 0x5599, 0x6BC1, 0x5F59, 0x5FBD, 0x63EE,
- 0x6689, 0x7147, 0x8AF1, 0x8F1D, 0x9EBE, 0x4F11, 0x643A, 0x70CB,
- 0x7566, 0x8667, 0x6064, 0x8B4E, 0x9DF8, 0x5147, 0x51F6, 0x5308,
- 0x6D36, 0x80F8, 0x9ED1, 0x6615, 0x6B23, 0x7098, 0x75D5, 0x5403,
- 0x5C79, 0x7D07, 0x8A16, 0x6B20, 0x6B3D, 0x6B46, 0x5438, 0x6070,
- 0x6D3D, 0x7FD5, 0x8208, 0x50D6, 0x51DE, 0x559C, 0x566B, 0x56CD,
- 0x59EC, 0x5B09, 0x5E0C, 0x6199, 0x6198, 0x6231, 0x665E, 0x66E6,
- 0x7199, 0x71B9, 0x71BA, 0x72A7, 0x79A7, 0x7A00, 0x7FB2, 0x8A70,
- 0x3001, 0x3002, 0x2025, 0x00AD, 0x2015, 0x2225, 0xFF5E, 0x3014,
- 0x3015, 0x3008, 0x3009, 0x300A, 0x300B, 0x300C, 0x300D, 0x300E,
- 0x300F, 0x3010, 0x3011, 0x3013, 0xFF01, 0xFF08, 0xFF09, 0xFF0C,
- 0xFF0E, 0xFF1A, 0xFF1B, 0xFF1C, 0xFF1D, 0xFF1E, 0xFF1F, 0xFF3B,
- 0xFF3D, 0xFF3F, 0xFF5B, 0xFF5C, 0xFF5D, 0xFF5E, 0x0020, 0x0021,
- 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029,
- 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 0x0030, 0x0031,
- 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039,
- 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 0x0040, 0x0041,
- 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049,
- 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051,
- 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059,
- 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, 0x0060, 0x0061,
- 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069,
- 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071,
- 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079,
- 0x007A, 0x007B, 0x007C, 0x007D, 0x203E, 0x007E, 0x005C, 0x231C,
- 0x231F, 0x0000, 0x0000, 0x0000, 0x0000, 0x300E, 0x300F, 0x300A,
- 0x300B, 0x3008, 0x3009, 0x0028, 0x0029, 0x0000, 0x0000, 0x0028,
- 0x0029, 0x0028, 0x0029, 0x0000, 0x0000, 0x0028, 0x0029, 0x0000,
- 0x0000, 0x3016, 0x3017, 0x3016, 0x3017, 0x3018, 0x3019, 0x005B,
- 0x005D, 0x0000, 0x0000, 0x263E, 0x263D, 0x2021, 0x2021, 0x2020,
- 0x2021, 0x0000, 0x2217, 0x0000, 0x0000, 0x201F, 0x201B, 0x02D6,
- 0x02D7, 0x00D7, 0x221E, 0x0000, 0x00B1, 0x2213, 0x003E, 0x003C,
- 0x003D, 0x2260, 0x207D, 0x207E, 0x007B, 0x007D, 0x0000, 0x0000,
- 0x2229, 0x222A, 0x2282, 0x2208, 0x03A3, 0x0021, 0x0000, 0x3021,
- 0x3022, 0x3023, 0x0000, 0x0000, 0x0000, 0x4E03, 0x0000, 0x0000,
- 0x5341, 0x0000, 0x0000, 0x0027, 0x3014, 0x3015, 0x002A, 0x0000,
- 0x2217, 0x002A, 0xCDCD, 0x3001, 0x3002, 0x0028, 0x0029, 0x0028,
- 0x0029, 0x0028, 0x0029, 0x3016, 0x3017, 0x3010, 0x3011, 0x0000,
- 0x0000, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE,
- 0x20DE, 0x20DE, 0x005D, 0x005D, 0x005D, 0x005D, 0x005D, 0x005D,
- 0x005D, 0x005D, 0x005D, 0x005D, 0x005D, 0x00B6, 0x0000, 0x0000,
- 0x22EF, 0x2237, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE,
- 0x20DE, 0x20DE, 0x20DE, 0x005D, 0x005D, 0x005D, 0x005D, 0x005D,
- 0x005D, 0x005D, 0x005D, 0x005D, 0x005D, 0x005D, 0x278A, 0x278B,
- 0x278C, 0x278D, 0x278E, 0x278F, 0x2790, 0x2791, 0x2792, 0x2793,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029,
- 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029,
- 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029,
- 0x0029, 0x0029, 0x0029, 0x0029, 0x24B6, 0x24B7, 0x24B8, 0x24B9,
- 0x24BA, 0x24BB, 0x24BC, 0x24BD, 0x24BE, 0x24BF, 0x24C0, 0x24C1,
- 0x24C2, 0x24C3, 0x24C4, 0x24C5, 0x24C6, 0x24C7, 0x24C8, 0x24C9,
- 0x24CA, 0x24CB, 0x24CC, 0x24CD, 0x24CE, 0x24CF, 0x20DE, 0x20DE,
- 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x005D,
- 0x005D, 0x005D, 0x005D, 0x005D, 0x005D, 0x005D, 0x005D, 0x005D,
- 0x005D, 0x005D, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE,
- 0x20DE, 0x20DE, 0x20DE, 0x005D, 0x005D, 0x005D, 0x005D, 0x005D,
- 0x005D, 0x005D, 0x005D, 0x005D, 0x005D, 0x005D, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x22CF, 0x22CE, 0x22CF, 0x22CE, 0x2280,
- 0x2281, 0x2270, 0x2271, 0x2272, 0x2273, 0x0000, 0x228A, 0x0000,
- 0x228B, 0x2276, 0x2277, 0x2279, 0x22DA, 0x22DB, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x2221, 0x2245, 0x2243, 0x2248, 0x0000, 0x22A4,
- 0x22AB, 0x0000, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE,
- 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x0000, 0x2460, 0x2461, 0x2462,
- 0x2463, 0x2464, 0x2465, 0x2466, 0x2467, 0x2468, 0x0029, 0x0029,
- 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029,
- 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029,
- 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029,
- 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029,
- 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029,
- 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029,
- 0x0029, 0x0029, 0x0021, 0x00B0, 0x0027, 0x0022, 0x2034, 0x0029,
- 0x0029, 0x0029, 0x0029, 0x0000, 0x0000, 0x2020, 0x2020, 0x2021,
- 0x2020, 0x00A7, 0x0023, 0x002A, 0x002A, 0x0000, 0x0000, 0x2042,
- 0x002A, 0x0000, 0x0000, 0x2042, 0x002A, 0x0000, 0x0000, 0x2022,
- 0x20DF, 0x20DF, 0x0000, 0x20DF, 0x3008, 0x3009, 0x300A, 0x300B,
- 0x261C, 0x261E, 0x0000, 0x0000, 0x20DE, 0x0000, 0x20DE, 0x20DE,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x20DD, 0x20DD, 0x271A, 0x2716,
- 0x0000, 0x25EF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x25CC,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x20A9, 0x0000, 0x0000,
- 0x262F, 0x0000, 0x262F, 0x262F, 0x0000, 0x0000, 0x0000, 0x3020,
- 0x0000, 0x2776, 0x2777, 0x2778, 0x2779, 0x277A, 0x277B, 0x277C,
- 0x277D, 0x277E, 0x277F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0029, 0x0029, 0x0029,
- 0x0029, 0x0029, 0x0029, 0x2642, 0x22A9, 0x3036, 0x25CB, 0x25D3,
- 0x25A1, 0x2302, 0x0000, 0x25AD, 0x25AD, 0x0000, 0x0000, 0x0000,
- 0x25C7, 0x0000, 0x0000, 0x2206, 0x22BF, 0x231E, 0x0000, 0x2225,
- 0x2226, 0x0000, 0x2253, 0x2251, 0x2266, 0x2267, 0x2213, 0x2295,
- 0x2296, 0x2297, 0x20DD, 0x2314, 0x0000, 0x0000, 0x2262, 0x0000,
- 0x25B1, 0x0000, 0x2222, 0x2250, 0x00D8, 0x234A, 0x22A3, 0x0338,
- 0x0000, 0x226E, 0x226F, 0x2285, 0x2284, 0x2209, 0x220C, 0x22BB,
- 0x0016, 0x225A, 0x2306, 0x0024, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x329E, 0x0000, 0x203C, 0x003F, 0x0000, 0x003F, 0x22C4,
- 0x25C7, 0x22C4, 0x25C6, 0x25AB, 0x25A1, 0x25AB, 0x25A0, 0x25E6,
- 0x25CB, 0x25E6, 0x25CF, 0x25BD, 0x25B3, 0x25B7, 0x25C1, 0x2726,
- 0x25CF, 0x25A0, 0x0000, 0x25CA, 0x3231, 0x3239, 0x33CB, 0x2483,
- 0x2494, 0x2495, 0x2496, 0x2497, 0x0029, 0x0029, 0x0029, 0x0029,
- 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x2192, 0x2190,
- 0x2191, 0x2193, 0x2196, 0x2197, 0x2198, 0x2199, 0x21D0, 0x21CF,
- 0x21CD, 0x21D4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x2794, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x279C, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x27BA, 0x0000, 0x0000, 0x0000, 0x0000, 0x21D1, 0x21D3,
- 0x0000, 0x279E, 0x0000, 0x0000, 0x0000, 0x279E, 0x0000, 0x0000,
- 0x21B5, 0x21B1, 0x0000, 0x21B4, 0x21B0, 0x21B3, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x21E6, 0x21E8, 0x21E7, 0x21E9, 0x21BC, 0x21C0, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x21C0, 0x21BC, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x21C4, 0x21C5, 0x002E, 0x002E, 0x002E, 0x002E, 0x002E, 0x002E,
- 0x002E, 0x002E, 0x002E, 0x002E, 0x002E, 0x002E, 0x002E, 0x002E,
- 0x002E, 0x002E, 0x002E, 0x002E, 0x002E, 0x002E, 0x002E, 0x002E,
- 0x002E, 0x002E, 0x002E, 0x002E, 0x002E, 0x002E, 0x002E, 0x002E,
- 0x002E, 0x002E, 0x002E, 0x002E, 0x002E, 0x002E, 0x002E, 0x002E,
- 0x002E, 0x002E, 0x002E, 0x002E, 0x002E, 0x002E, 0x002E, 0x002E,
- 0x002E, 0x002E, 0x002E, 0x002E, 0x002E, 0x002E, 0x20DE, 0x20DE,
- 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE,
- 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE,
- 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE,
- 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE,
- 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE,
- 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE,
- 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE,
- 0x20DE, 0x20DE, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD,
- 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD,
- 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD,
- 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD,
- 0x20DD, 0x20DD, 0x2483, 0x2484, 0x2485, 0x2486, 0x2487, 0x0029,
- 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x20DD, 0x20DD, 0x20DD,
- 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD,
- 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD,
- 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD,
- 0x3294, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD,
- 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD,
- 0x32A5, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD,
- 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD,
- 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD,
- 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD,
- 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD,
- 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD,
- 0x20DD, 0x0029, 0x0029, 0x0029, 0x0029, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x2794, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x21E0, 0x21E1,
- 0x21E2, 0x21E3, 0x0000, 0x27A1, 0x0000, 0x0000, 0x21E6, 0x21E8,
- 0x21E7, 0x21E9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x261D, 0x261F,
- 0x0000, 0x0000, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD,
- 0x20DD, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE,
- 0x20DE, 0x20DE, 0x005D, 0x005D, 0x005D, 0x005D, 0x005D, 0x005D,
- 0x005D, 0x005D, 0x005D, 0x005D, 0x005D, 0x20DE, 0x20DE, 0x20DE,
- 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x005D,
- 0x005D, 0x005D, 0x005D, 0x005D, 0x005D, 0x005D, 0x005D, 0x005D,
- 0x005D, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE,
- 0x20DE, 0x20DE, 0x20DE, 0x005D, 0x005D, 0x005D, 0x005D, 0x005D,
- 0x005D, 0x005D, 0x005D, 0x005D, 0x005D, 0x20DE, 0x20DE, 0x20DE,
- 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x3290, 0x328A, 0x328B, 0x328C,
- 0x328D, 0x328E, 0x328F, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE,
- 0x20DE, 0x20DE, 0x300C, 0x300D, 0x300E, 0x300F, 0x21E8, 0x21E6,
- 0x21E7, 0x21E9, 0x0022, 0x301F, 0x301D, 0x2036, 0x0060, 0x3001,
- 0x0000, 0x0021, 0x3021, 0x002C, 0x3002, 0xAC02, 0xAC03, 0xAC05,
- 0xAC06, 0xAC0B, 0xAC0C, 0xAC0D, 0xAC0E, 0xAC0F, 0xAC18, 0xAC1E,
- 0xAC1F, 0xAC21, 0xAC22, 0xAC23, 0xAC25, 0xAC26, 0xAC27, 0xAC28,
- 0xAC29, 0xAC2A, 0xAC2B, 0xAC2E, 0xAC32, 0xAC33, 0xAC34, 0xAC35,
- 0xAC36, 0xAC37, 0xAC3A, 0xAC3B, 0xAC3D, 0xAC3E, 0xAC3F, 0xAC41,
- 0xAC42, 0xAC43, 0xAC44, 0xAC45, 0xAC46, 0xAC47, 0xAC48, 0xAC49,
- 0xAC4A, 0xAC4C, 0xAC4E, 0xAC4F, 0xAC50, 0xAC51, 0xAC52, 0xAC53,
- 0xAC55, 0xAC56, 0xAC57, 0xAC59, 0xAC5A, 0xAC5B, 0xAC5D, 0xAC5E,
- 0xAC5F, 0xAC60, 0xAC61, 0xAC62, 0xAC63, 0xAC64, 0xAC65, 0xAC66,
- 0xAC67, 0xAC68, 0xAC69, 0xAC6A, 0xAC6B, 0xAC6C, 0xAC6D, 0xAC6E,
- 0xAC6F, 0xAC72, 0xAC73, 0xAC75, 0xAC76, 0xAC79, 0xAC7B, 0xAC7C,
- 0xAC7D, 0xAC7E, 0xAC7F, 0xAC82, 0xAC87, 0xAC88, 0xAC8D, 0xAC8E,
- 0xAC8F, 0xAC91, 0xAC92, 0xAC93, 0xAC95, 0xAC96, 0xAC97, 0xAC98,
- 0xAC99, 0xAC9A, 0xAC9B, 0xAC9E, 0xACA2, 0xACA3, 0xACA4, 0xACA5,
- 0xACA6, 0xACA7, 0xACAB, 0xACAD, 0xACAE, 0xACB1, 0xACB2, 0xACB3,
- 0xACB4, 0xACB5, 0xACB6, 0xACB7, 0xACBA, 0xACBE, 0xACBF, 0xACC0,
- 0xACC2, 0xACC3, 0xACC5, 0xACC6, 0xACC7, 0xACC9, 0xACCA, 0xACCB,
- 0xACCD, 0xACCE, 0xACCF, 0xACD0, 0xACD1, 0xACD2, 0xACD3, 0xACD4,
- 0xACD6, 0xACD8, 0xACD9, 0xACDA, 0xACDB, 0xACDC, 0xACDD, 0xACDE,
- 0xACDF, 0xACE2, 0xACE3, 0xACE5, 0xACE6, 0xACE9, 0xACEB, 0xACED,
- 0xACEE, 0xACF2, 0xACF4, 0xACF7, 0xACF8, 0xACF9, 0xACFA, 0xACFB,
- 0xACFE, 0xACFF, 0xAD01, 0xAD02, 0xAD03, 0xAD05, 0xAD07, 0xAD08,
- 0xAD09, 0xAD0A, 0xAD0B, 0xAD0E, 0xAD10, 0xAD12, 0xAD13, 0xAD14,
- 0xAD15, 0xAD16, 0xAD17, 0xAD19, 0xAD1A, 0xAD1B, 0xAD1D, 0xAD1E,
- 0xAD1F, 0xAD21, 0xAD22, 0xAD23, 0xAD24, 0xAD25, 0xAD26, 0xAD27,
- 0xAD28, 0xAD2A, 0xAD2B, 0xAD2E, 0xAD2F, 0xAD30, 0xAD31, 0xAD32,
- 0xAD33, 0xAD36, 0xAD37, 0xAD39, 0xAD3A, 0xAD3B, 0xAD3D, 0xAD3E,
- 0xAD3F, 0xAD40, 0xAD41, 0xAD42, 0xAD43, 0xAD46, 0xAD48, 0xAD4A,
- 0xAD4B, 0xAD4C, 0xAD4D, 0xAD4E, 0xAD4F, 0xAD51, 0xAD52, 0xAD53,
- 0xAD55, 0xAD56, 0xAD57, 0xAD59, 0xAD5A, 0xAD5B, 0xAD5C, 0xAD5D,
- 0xAD5E, 0xAD5F, 0xAD60, 0xAD62, 0xAD64, 0xAD65, 0xAD66, 0xAD67,
- 0xAD68, 0xAD69, 0xAD6A, 0xAD6B, 0xAD6E, 0xAD6F, 0xAD71, 0xAD72,
- 0xAD77, 0xAD78, 0xAD79, 0xAD7A, 0xAD7E, 0xAD80, 0xAD83, 0xAD84,
- 0xAD85, 0xAD86, 0xAD87, 0xAD8A, 0xAD8B, 0xAD8D, 0xAD8E, 0xAD8F,
- 0xAD91, 0xAD92, 0xAD93, 0xAD94, 0xAD95, 0xAD96, 0xAD97, 0xAD98,
- 0xAD99, 0xAD9A, 0xAD9B, 0xAD9E, 0xAD9F, 0xADA0, 0xADA1, 0xADA2,
- 0xADA3, 0xADA5, 0xADA6, 0xADA7, 0xADA8, 0xADA9, 0xADAA, 0xADAB,
- 0xADAC, 0xADAD, 0xADAE, 0xADAF, 0xADB0, 0xADB1, 0xADB2, 0xADB3,
- 0xADB4, 0xADB5, 0xADB6, 0xADB8, 0xADB9, 0xADBA, 0xADBB, 0xADBC,
- 0xADBD, 0xADBE, 0xADBF, 0xADC2, 0xADC3, 0xADC5, 0xADC6, 0xADC7,
- 0xADC9, 0xADCA, 0xADCB, 0xADCC, 0xADCD, 0xADCE, 0xADCF, 0xADD2,
- 0xADD4, 0xADD5, 0xADD6, 0xADD7, 0xADD8, 0xADD9, 0xADDA, 0xADDB,
- 0xADDD, 0xADDE, 0xADDF, 0xADE1, 0xADE2, 0xADE3, 0xADE5, 0xADE6,
- 0xADE7, 0xADE8, 0xADE9, 0xADEA, 0xADEB, 0xADEC, 0xADED, 0xADEE,
- 0xADEF, 0xADF0, 0xADF1, 0xADF2, 0xADF3, 0xADF4, 0xADF5, 0xADF6,
- 0xADF7, 0xADFA, 0xADFB, 0xADFD, 0xADFE, 0xAE02, 0xAE03, 0xAE04,
- 0xAE05, 0xAE06, 0xAE07, 0xAE0A, 0xAE0C, 0xAE0E, 0xAE0F, 0xAE10,
- 0xAE11, 0xAE12, 0xAE13, 0xAE15, 0xAE16, 0xAE17, 0xAE18, 0xAE19,
- 0xAE1A, 0xAE1B, 0xAE1C, 0xAE1D, 0xAE1E, 0xAE1F, 0xAE20, 0xAE21,
- 0xAE22, 0xAE23, 0xAE24, 0xAE25, 0xAE26, 0xAE27, 0xAE28, 0xAE29,
- 0xAE2A, 0xAE2B, 0xAE2C, 0xAE2D, 0xAE2E, 0xAE2F, 0xAE32, 0xAE33,
- 0xAE35, 0xAE36, 0xAE39, 0xAE3B, 0xAE3C, 0xAE3D, 0xAE3E, 0xAE3F,
- 0xAE42, 0xAE44, 0xAE47, 0xAE48, 0xAE49, 0xAE4B, 0xAE4F, 0xAE51,
- 0xAE52, 0xAE53, 0xAE55, 0xAE57, 0xAE58, 0xAE59, 0xAE5A, 0xAE5B,
- 0xAE5E, 0xAE62, 0xAE63, 0xAE64, 0xAE66, 0xAE67, 0xAE6A, 0xAE6B,
- 0xAE6D, 0xAE6E, 0xAE6F, 0xAE71, 0xAE72, 0xAE73, 0xAE74, 0xAE75,
- 0xAE76, 0xAE77, 0xAE7A, 0xAE7E, 0xAE7F, 0xAE80, 0xAE81, 0xAE82,
- 0xAE83, 0xAE86, 0xAE87, 0xAE88, 0xAE89, 0xAE8A, 0xAE8B, 0xAE8D,
- 0xAE8E, 0xAE8F, 0xAE90, 0xAE91, 0xAE92, 0xAE93, 0xAE94, 0xAE95,
- 0xAE96, 0xAE97, 0xAE98, 0xAE99, 0xAE9A, 0xAE9B, 0xAE9C, 0xAE9D,
- 0xAE9E, 0xAE9F, 0xAEA0, 0xAEA1, 0xAEA2, 0xAEA3, 0xAEA4, 0xAEA5,
- 0xAEA6, 0xAEA7, 0xAEA8, 0xAEA9, 0xAEAA, 0xAEAB, 0xAEAC, 0xAEAD,
- 0xAEAE, 0xAEAF, 0xAEB0, 0xAEB1, 0xAEB2, 0xAEB3, 0xAEB4, 0xAEB5,
- 0xAEB6, 0xAEB7, 0xAEB8, 0xAEB9, 0xAEBA, 0xAEBB, 0xAEBF, 0xAEC1,
- 0xAEC2, 0xAEC3, 0xAEC5, 0xAEC6, 0xAEC7, 0xAEC8, 0xAEC9, 0xAECA,
- 0xAECB, 0xAECE, 0xAED2, 0xAED3, 0xAED4, 0xAED5, 0xAED6, 0xAED7,
- 0xAEDA, 0xAEDB, 0xAEDD, 0xAEDE, 0xAEDF, 0xAEE0, 0xAEE1, 0xAEE2,
- 0xAEE3, 0xAEE4, 0xAEE5, 0xAEE6, 0xAEE7, 0xAEE9, 0xAEEA, 0xAEEC,
- 0xAEEE, 0xAEEF, 0xAEF0, 0xAEF1, 0xAEF2, 0xAEF3, 0xAEF5, 0xAEF6,
- 0xAEF7, 0xAEF9, 0xAEFA, 0xAEFB, 0xAEFD, 0xAEFE, 0xAEFF, 0xAF00,
- 0xAF01, 0xAF02, 0xAF03, 0xAF04, 0xAF05, 0xAF06, 0xAF09, 0xAF0A,
- 0xAF0B, 0xAF0C, 0xAF0E, 0xAF0F, 0xAF11, 0xAF12, 0xAF13, 0xAF14,
- 0xAF15, 0xAF16, 0xAF17, 0xAF18, 0xAF19, 0xAF1A, 0xAF1B, 0xAF1C,
- 0xAF1D, 0xAF1E, 0xAF1F, 0xAF20, 0xAF21, 0xAF22, 0xAF23, 0xAF24,
- 0xAF25, 0xAF26, 0xAF27, 0xAF28, 0xAF29, 0xAF2A, 0xAF2B, 0xAF2E,
- 0xAF2F, 0xAF31, 0xAF33, 0xAF35, 0xAF36, 0xAF37, 0xAF38, 0xAF39,
- 0xAF3A, 0xAF3B, 0xAF3E, 0xAF40, 0xAF44, 0xAF45, 0xAF46, 0xAF47,
- 0xAF4A, 0xAF4B, 0xAF4C, 0xAF4D, 0xAF4E, 0xAF4F, 0xAF51, 0xAF52,
- 0xAF53, 0xAF54, 0xAF55, 0xAF56, 0xAF57, 0xAF58, 0xAF59, 0xAF5A,
- 0xAF5B, 0xAF5E, 0xAF5F, 0xAF60, 0xAF61, 0xAF62, 0xAF63, 0xAF66,
- 0xAF67, 0xAF68, 0xAF69, 0xAF6A, 0xAF6B, 0xAF6C, 0xAF6D, 0xAF6E,
- 0xAF6F, 0xAF70, 0xAF71, 0xAF72, 0xAF73, 0xAF74, 0xAF75, 0xAF76,
- 0xAF77, 0xAF78, 0xAF7A, 0xAF7B, 0xAF7C, 0xAF7D, 0xAF7E, 0xAF7F,
- 0xAF81, 0xAF82, 0xAF83, 0xAF85, 0xAF86, 0xAF87, 0xAF89, 0xAF8A,
- 0xAF8B, 0xAF8C, 0xAF8D, 0xAF8E, 0xAF8F, 0xAF92, 0xAF93, 0xAF94,
- 0xAF96, 0xAF97, 0xAF98, 0xAF99, 0xAF9A, 0xAF9B, 0xAF9D, 0xAF9E,
- 0xAF9F, 0xAFA0, 0xAFA1, 0xAFA2, 0xAFA3, 0xAFA4, 0xAFA5, 0xAFA6,
- 0xAFA7, 0xAFA8, 0xAFA9, 0xAFAA, 0xAFAB, 0xAFAC, 0xAFAD, 0xAFAE,
- 0xAFAF, 0xAFB0, 0xAFB1, 0xAFB2, 0xAFB3, 0xAFB4, 0xAFB5, 0xAFB6,
- 0xAFB7, 0xAFBA, 0xAFBB, 0xAFBD, 0xAFBE, 0xAFBF, 0xAFC1, 0xAFC2,
- 0xAFC3, 0xAFC4, 0xAFC5, 0xAFC6, 0xAFCA, 0xAFCC, 0xAFCF, 0xAFD0,
- 0xAFD1, 0xAFD2, 0xAFD3, 0xAFD5, 0xAFD6, 0xAFD7, 0xAFD8, 0xAFD9,
- 0xAFDA, 0xAFDB, 0xAFDD, 0xAFDE, 0xAFDF, 0xAFE0, 0xAFE1, 0xAFE2,
- 0xAFE3, 0xAFE4, 0xAFE5, 0xAFE6, 0xAFE7, 0xAFEA, 0xAFEB, 0xAFEC,
- 0xAFED, 0xAFEE, 0xAFEF, 0xAFF2, 0xAFF3, 0xAFF5, 0xAFF6, 0xAFF7,
- 0xAFF9, 0xAFFA, 0xAFFB, 0xAFFC, 0xAFFD, 0xAFFE, 0xAFFF, 0xB002,
- 0xB003, 0xB005, 0xB006, 0xB007, 0xB008, 0xB009, 0xB00A, 0xB00B,
- 0xB00D, 0xB00E, 0xB00F, 0xB011, 0xB012, 0xB013, 0xB015, 0xB016,
- 0xB017, 0xB018, 0xB019, 0xB01A, 0xB01B, 0xB01E, 0xB01F, 0xB020,
- 0xB021, 0xB022, 0xB023, 0xB024, 0xB025, 0xB026, 0xB027, 0xB029,
- 0xB02A, 0xB02B, 0xB02C, 0xB02D, 0xB02E, 0xB02F, 0xB030, 0xB031,
- 0xB032, 0xB033, 0xB034, 0xB035, 0xB036, 0xB037, 0xB038, 0xB039,
- 0xB03A, 0xB03B, 0xB03C, 0xB03D, 0xB03E, 0xB03F, 0xB040, 0xB041,
- 0xB042, 0xB043, 0xB046, 0xB047, 0xB049, 0xB04B, 0xB04D, 0xB04F,
- 0xB050, 0xB051, 0xB052, 0xB056, 0xB058, 0xB05A, 0xB05B, 0xB05C,
- 0xB05E, 0xB05F, 0xB060, 0xB061, 0xB062, 0xB063, 0xB064, 0xB065,
- 0xB066, 0xB067, 0xB068, 0xB069, 0xB06A, 0xB06B, 0xB06C, 0xB06D,
- 0xB06E, 0xB06F, 0xB070, 0xB071, 0xB072, 0xB073, 0xB074, 0xB075,
- 0xB076, 0xB077, 0xB078, 0xB079, 0xB07A, 0xB07B, 0xB07E, 0xB07F,
- 0xB081, 0xB082, 0xB083, 0xB085, 0xB086, 0xB087, 0xB088, 0xB089,
- 0xB08A, 0xB08B, 0xB08E, 0xB090, 0xB092, 0xB093, 0xB094, 0xB095,
- 0xB096, 0xB097, 0xB09B, 0xB09D, 0xB09E, 0xB0A3, 0xB0A4, 0xB0A5,
- 0xB0A6, 0xB0A7, 0xB0AA, 0xB0B0, 0xB0B2, 0xB0B6, 0xB0B7, 0xB0B9,
- 0xB0BA, 0xB0BB, 0xB0BD, 0xB0BE, 0xB0BF, 0xB0C0, 0xB0C1, 0xB0C2,
- 0xB0C3, 0xB0C6, 0xB0CA, 0xB0CB, 0xB0CC, 0xB0CD, 0xB0CE, 0xB0CF,
- 0xB0D2, 0xB0D3, 0xB0D5, 0xB0D6, 0xB0D7, 0xB0D9, 0xB0DA, 0xB0DB,
- 0xB0DC, 0xB0DD, 0xB0DE, 0xB0DF, 0xB0E1, 0xB0E2, 0xB0E3, 0xB0E4,
- 0xB0E6, 0xB0E7, 0xB0E8, 0xB0E9, 0xB0EA, 0xB0EB, 0xB0EC, 0xB0ED,
- 0xB0EE, 0xB0EF, 0xB0F0, 0xB0F1, 0xB0F2, 0xB0F3, 0xB0F4, 0xB0F5,
- 0xB0F6, 0xB0F7, 0xB0F8, 0xB0F9, 0xB0FA, 0xB0FB, 0xB0FC, 0xB0FD,
- 0xB0FE, 0xB0FF, 0xB100, 0xB101, 0xB102, 0xB103, 0xB104, 0xB105,
- 0xB106, 0xB107, 0xB10A, 0xB10D, 0xB10E, 0xB10F, 0xB111, 0xB114,
- 0xB115, 0xB116, 0xB117, 0xB11A, 0xB11E, 0xB11F, 0xB120, 0xB121,
- 0xB122, 0xB126, 0xB127, 0xB129, 0xB12A, 0xB12B, 0xB12D, 0xB12E,
- 0xB12F, 0xB130, 0xB131, 0xB132, 0xB133, 0xB136, 0xB13A, 0xB13B,
- 0xB13C, 0xB13D, 0xB13E, 0xB13F, 0xB142, 0xB143, 0xB145, 0xB146,
- 0xB147, 0xB149, 0xB14A, 0xB14B, 0xB14C, 0xB14D, 0xB14E, 0xB14F,
- 0xB152, 0xB153, 0xB156, 0xB157, 0xB159, 0xB15A, 0xB15B, 0xB15D,
- 0xB15E, 0xB15F, 0xB161, 0xB162, 0xB163, 0xB164, 0xB165, 0xB166,
- 0xB167, 0xB168, 0xB169, 0xB16A, 0xB16B, 0xB16C, 0xB16D, 0xB16E,
- 0xB16F, 0xB170, 0xB171, 0xB172, 0xB173, 0xB174, 0xB175, 0xB176,
- 0xB177, 0xB17A, 0xB17B, 0xB17D, 0xB17E, 0xB17F, 0xB181, 0xB183,
- 0xB184, 0xB185, 0xB186, 0xB187, 0xB18A, 0xB18C, 0xB18E, 0xB18F,
- 0xB190, 0xB191, 0xB195, 0xB196, 0xB197, 0xB199, 0xB19A, 0xB19B,
- 0xB19D, 0xB19E, 0xB19F, 0xB1A0, 0xB1A1, 0xB1A2, 0xB1A3, 0xB1A4,
- 0xB1A5, 0xB1A6, 0xB1A7, 0xB1A9, 0xB1AA, 0xB1AB, 0xB1AC, 0xB1AD,
- 0xB1AE, 0xB1AF, 0xB1B0, 0xB1B1, 0xB1B2, 0xB1B3, 0xB1B4, 0xB1B5,
- 0xB1B6, 0xB1B7, 0xB1B8, 0xB1B9, 0xB1BA, 0xB1BB, 0xB1BC, 0xB1BD,
- 0xB1BE, 0xB1BF, 0xB1C0, 0xB1C1, 0xB1C2, 0xB1C3, 0xB1C4, 0xB1C5,
- 0xB1C6, 0xB1C7, 0xB1C8, 0xB1C9, 0xB1CA, 0xB1CB, 0xB1CD, 0xB1CE,
- 0xB1CF, 0xB1D1, 0xB1D2, 0xB1D3, 0xB1D5, 0xB1D6, 0xB1D7, 0xB1D8,
- 0xB1D9, 0xB1DA, 0xB1DB, 0xB1DE, 0xB1E0, 0xB1E1, 0xB1E2, 0xB1E3,
- 0xB1E4, 0xB1E5, 0xB1E6, 0xB1E7, 0xB1EA, 0xB1EB, 0xB1ED, 0xB1EE,
- 0xB1EF, 0xB1F1, 0xB1F2, 0xB1F3, 0xB1F4, 0xB1F5, 0xB1F6, 0xB1F7,
- 0xB1F8, 0xB1FA, 0xB1FC, 0xB1FE, 0xB1FF, 0xB200, 0xB201, 0xB202,
- 0xB203, 0xB206, 0xB207, 0xB209, 0xB20A, 0xB20D, 0xB20E, 0xB20F,
- 0xB210, 0xB211, 0xB212, 0xB213, 0xB216, 0xB218, 0xB21A, 0xB21B,
- 0xB21C, 0xB21D, 0xB21E, 0xB21F, 0xB221, 0xB222, 0xB223, 0xB224,
- 0xB225, 0xB226, 0xB227, 0xB228, 0xB229, 0xB22A, 0xB22B, 0xB22C,
- 0xB22D, 0xB22E, 0xB22F, 0xB230, 0xB231, 0xB232, 0xB233, 0xB235,
- 0xB236, 0xB237, 0xB238, 0xB239, 0xB23A, 0xB23B, 0xB23D, 0xB23E,
- 0xB23F, 0xB240, 0xB241, 0xB242, 0xB243, 0xB244, 0xB245, 0xB246,
- 0xB247, 0xB248, 0xB249, 0xB24A, 0xB24B, 0xB24C, 0xB24D, 0xB24E,
- 0xB24F, 0xB250, 0xB251, 0xB252, 0xB253, 0xB254, 0xB255, 0xB256,
- 0xB257, 0xB259, 0xB25A, 0xB25B, 0xB25D, 0xB25E, 0xB25F, 0xB261,
- 0xB262, 0xB263, 0xB264, 0xB265, 0xB266, 0xB267, 0xB26A, 0xB26B,
- 0xB26C, 0xB26D, 0xB26E, 0xB26F, 0xB270, 0xB271, 0xB272, 0xB273,
- 0xB276, 0xB277, 0xB278, 0xB279, 0xB27A, 0xB27B, 0xB27D, 0xB27E,
- 0xB27F, 0xB280, 0xB281, 0xB282, 0xB283, 0xB286, 0xB287, 0xB288,
- 0xB28A, 0xB28B, 0xB28C, 0xB28D, 0xB28E, 0xB28F, 0xB292, 0xB293,
- 0xB295, 0xB296, 0xB297, 0xB29B, 0xB29C, 0xB29D, 0xB29E, 0xB29F,
- 0xB2A2, 0xB2A4, 0xB2A7, 0xB2A8, 0xB2A9, 0xB2AB, 0xB2AD, 0xB2AE,
- 0xB2AF, 0xB2B1, 0xB2B2, 0xB2B3, 0xB2B5, 0xB2B6, 0xB2B7, 0xB2B8,
- 0xB2B9, 0xB2BA, 0xB2BB, 0xB2BC, 0xB2BD, 0xB2BE, 0xB2BF, 0xB2C0,
- 0xB2C1, 0xB2C2, 0xB2C3, 0xB2C4, 0xB2C5, 0xB2C6, 0xB2C7, 0xB2CA,
- 0xB2CB, 0xB2CD, 0xB2CE, 0xB2CF, 0xB2D1, 0xB2D3, 0xB2D4, 0xB2D5,
- 0xB2D6, 0xB2D7, 0xB2DA, 0xB2DC, 0xB2DE, 0xB2DF, 0xB2E0, 0xB2E1,
- 0xB2E3, 0xB2E7, 0xB2E9, 0xB2EA, 0xB2F0, 0xB2F1, 0xB2F2, 0xB2F6,
- 0xB2FC, 0xB2FD, 0xB2FE, 0xB302, 0xB303, 0xB305, 0xB306, 0xB307,
- 0xB309, 0xB30A, 0xB30B, 0xB30C, 0xB30D, 0xB30E, 0xB30F, 0xB312,
- 0xB316, 0xB317, 0xB318, 0xB319, 0xB31A, 0xB31B, 0xB31D, 0xB31E,
- 0xB31F, 0xB320, 0xB321, 0xB322, 0xB323, 0xB324, 0xB325, 0xB326,
- 0xB327, 0xB328, 0xB329, 0xB32A, 0xB32B, 0xB32C, 0xB32D, 0xB32E,
- 0xB32F, 0xB330, 0xB331, 0xB332, 0xB333, 0xB334, 0xB335, 0xB336,
- 0xB337, 0xB338, 0xB339, 0xB33A, 0xB33B, 0xB33C, 0xB33D, 0xB33E,
- 0xB33F, 0xB340, 0xB341, 0xB342, 0xB343, 0xB344, 0xB345, 0xB346,
- 0xB347, 0xB348, 0xB349, 0xB34A, 0xB34B, 0xB34C, 0xB34D, 0xB34E,
- 0xB34F, 0xB350, 0xB351, 0xB352, 0xB353, 0xB357, 0xB359, 0xB35A,
- 0xB35D, 0xB360, 0xB361, 0xB362, 0xB363, 0xB366, 0xB368, 0xB36A,
- 0xB36C, 0xB36D, 0xB36F, 0xB372, 0xB373, 0xB375, 0xB376, 0xB377,
- 0xB379, 0xB37A, 0xB37B, 0xB37C, 0xB37D, 0xB37E, 0xB37F, 0xB382,
- 0xB386, 0xB387, 0xB388, 0xB389, 0xB38A, 0xB38B, 0xB38D, 0xB38E,
- 0xB38F, 0xB391, 0xB392, 0xB393, 0xB395, 0xB396, 0xB397, 0xB398,
- 0xB399, 0xB39A, 0xB39B, 0xB39C, 0xB39D, 0xB39E, 0xB39F, 0xB3A2,
- 0xB3A3, 0xB3A4, 0xB3A5, 0xB3A6, 0xB3A7, 0xB3A9, 0xB3AA, 0xB3AB,
- 0xB3AD, 0xB3AE, 0xB3AF, 0xB3B0, 0xB3B1, 0xB3B2, 0xB3B3, 0xB3B4,
- 0xB3B5, 0xB3B6, 0xB3B7, 0xB3B8, 0xB3B9, 0xB3BA, 0xB3BB, 0xB3BC,
- 0xB3BD, 0xB3BE, 0xB3BF, 0xB3C0, 0xB3C1, 0xB3C2, 0xB3C3, 0xB3C6,
- 0xB3C7, 0xB3C9, 0xB3CA, 0xB3CD, 0xB3CF, 0xB3D1, 0xB3D2, 0xB3D3,
- 0xB3D6, 0xB3D8, 0xB3DA, 0xB3DC, 0xB3DE, 0xB3DF, 0xB3E1, 0xB3E2,
- 0xB3E3, 0xB3E5, 0xB3E6, 0xB3E7, 0xB3E9, 0xB3EA, 0xB3EB, 0xB3EC,
- 0xB3ED, 0xB3EE, 0xB3EF, 0xB3F0, 0xB3F1, 0xB3F2, 0xB3F3, 0xB3F4,
- 0xB3F5, 0xB3F6, 0xB3F7, 0xB3F8, 0xB3F9, 0xB3FA, 0xB3FB, 0xB3FD,
- 0xB3FE, 0xB3FF, 0xB400, 0xB401, 0xB402, 0xB403, 0xB404, 0xB405,
- 0xB406, 0xB407, 0xB408, 0xB409, 0xB40A, 0xB40B, 0xB40C, 0xB40D,
- 0xB40E, 0xB40F, 0xB411, 0xB412, 0xB413, 0xB414, 0xB415, 0xB416,
- 0xB417, 0xB419, 0xB41A, 0xB41B, 0xB41D, 0xB41E, 0xB41F, 0xB421,
- 0xB422, 0xB423, 0xB424, 0xB425, 0xB426, 0xB427, 0xB42A, 0xB42C,
- 0xB42D, 0xB42E, 0xB42F, 0xB430, 0xB431, 0xB432, 0xB433, 0xB435,
- 0xB436, 0xB437, 0xB438, 0xB439, 0xB43A, 0xB43B, 0xB43C, 0xB43D,
- 0xB43E, 0xB43F, 0xB440, 0xB441, 0xB442, 0xB443, 0xB444, 0xB445,
- 0xB446, 0xB447, 0xB448, 0xB449, 0xB44A, 0xB44B, 0xB44C, 0xB44D,
- 0xB44E, 0xB44F, 0xB452, 0xB453, 0xB455, 0xB456, 0xB457, 0xB459,
- 0xB45A, 0xB45B, 0xB45C, 0xB45D, 0xB45E, 0xB45F, 0xB462, 0xB464,
- 0xB466, 0xB467, 0xB468, 0xB469, 0xB46A, 0xB46B, 0xB46D, 0xB46E,
- 0xB46F, 0xB470, 0xB471, 0xB472, 0xB473, 0xB474, 0xB475, 0xB476,
- 0xB477, 0xB478, 0xB479, 0xB47A, 0xB47B, 0xB47C, 0xB47D, 0xB47E,
- 0xB47F, 0xB481, 0xB482, 0xB483, 0xB484, 0xB485, 0xB486, 0xB487,
- 0xB489, 0xB48A, 0xB48B, 0xB48C, 0xB48D, 0xB48E, 0xB48F, 0xB490,
- 0xB491, 0xB492, 0xB493, 0xB494, 0xB495, 0xB496, 0xB497, 0xB498,
- 0xB499, 0xB49A, 0xB49B, 0xB49C, 0xB49E, 0xB49F, 0xB4A0, 0xB4A1,
- 0xB4A2, 0xB4A3, 0xB4A5, 0xB4A6, 0xB4A7, 0xB4A9, 0xB4AA, 0xB4AB,
- 0xB4AD, 0xB4AE, 0xB4AF, 0xB4B0, 0xB4B1, 0xB4B2, 0xB4B3, 0xB4B4,
- 0xB4B6, 0xB4B8, 0xB4BA, 0xB4BB, 0xB4BC, 0xB4BD, 0xB4BE, 0xB4BF,
- 0xB4C1, 0xB4C2, 0xB4C3, 0xB4C5, 0xB4C6, 0xB4C7, 0xB4C9, 0xB4CA,
- 0xB4CB, 0xB4CC, 0xB4CD, 0xB4CE, 0xB4CF, 0xB4D1, 0xB4D2, 0xB4D3,
- 0xB4D4, 0xB4D6, 0xB4D7, 0xB4D8, 0xB4D9, 0xB4DA, 0xB4DB, 0xB4DE,
- 0xB4DF, 0xB4E1, 0xB4E2, 0xB4E5, 0xB4E7, 0xB4E8, 0xB4E9, 0xB4EA,
- 0xB4EB, 0xB4EE, 0xB4F0, 0xB4F2, 0xB4F3, 0xB4F4, 0xB4F5, 0xB4F6,
- 0xB4F7, 0xB4F9, 0xB4FA, 0xB4FB, 0xB4FC, 0xB4FD, 0xB4FE, 0xB4FF,
- 0xB500, 0xB501, 0xB502, 0xB503, 0xB504, 0xB505, 0xB506, 0xB507,
- 0xB508, 0xB509, 0xB50A, 0xB50B, 0xB50C, 0xB50D, 0xB50E, 0xB50F,
- 0xB510, 0xB511, 0xB512, 0xB513, 0xB516, 0xB517, 0xB519, 0xB51A,
- 0xB51D, 0xB51E, 0xB51F, 0xB520, 0xB521, 0xB522, 0xB523, 0xB526,
- 0xB52B, 0xB52C, 0xB52D, 0xB52E, 0xB52F, 0xB532, 0xB533, 0xB535,
- 0xB536, 0xB537, 0xB539, 0xB53A, 0xB53B, 0xB53C, 0xB53D, 0xB53E,
- 0xB53F, 0xB542, 0xB546, 0xB547, 0xB548, 0xB549, 0xB54A, 0xB54E,
- 0xB54F, 0xB551, 0xB552, 0xB553, 0xB555, 0xB556, 0xB557, 0xB558,
- 0xB559, 0xB55A, 0xB55B, 0xB55E, 0xB562, 0xB563, 0xB564, 0xB565,
- 0xB566, 0xB567, 0xB568, 0xB569, 0xB56A, 0xB56B, 0xB56C, 0xB56D,
- 0xB56E, 0xB56F, 0xB570, 0xB571, 0xB572, 0xB573, 0xB574, 0xB575,
- 0xB576, 0xB577, 0xB578, 0xB579, 0xB57A, 0xB57B, 0xB57C, 0xB57D,
- 0xB57E, 0xB57F, 0xB580, 0xB581, 0xB582, 0xB583, 0xB584, 0xB585,
- 0xB586, 0xB587, 0xB588, 0xB589, 0xB58A, 0xB58B, 0xB58C, 0xB58D,
- 0xB58E, 0xB58F, 0xB590, 0xB591, 0xB592, 0xB593, 0xB594, 0xB595,
- 0xB596, 0xB597, 0xB598, 0xB599, 0xB59A, 0xB59B, 0xB59C, 0xB59D,
- 0xB59E, 0xB59F, 0xB5A2, 0xB5A3, 0xB5A5, 0xB5A6, 0xB5A7, 0xB5A9,
- 0xB5AC, 0xB5AD, 0xB5AE, 0xB5AF, 0xB5B2, 0xB5B6, 0xB5B7, 0xB5B8,
- 0xB5B9, 0xB5BA, 0xB5BE, 0xB5BF, 0xB5C1, 0xB5C2, 0xB5C3, 0xB5C5,
- 0xB5C6, 0xB5C7, 0xB5C8, 0xB5C9, 0xB5CA, 0xB5CB, 0xB5CE, 0xB5D2,
- 0xB5D3, 0xB5D4, 0xB5D5, 0xB5D6, 0xB5D7, 0xB5D9, 0xB5DA, 0xB5DB,
- 0xB5DC, 0xB5DD, 0xB5DE, 0xB5DF, 0xB5E0, 0xB5E1, 0xB5E2, 0xB5E3,
- 0xB5E4, 0xB5E5, 0xB5E6, 0xB5E7, 0xB5E8, 0xB5E9, 0xB5EA, 0xB5EB,
- 0xB5ED, 0xB5EE, 0xB5EF, 0xB5F0, 0xB5F1, 0xB5F2, 0xB5F3, 0xB5F4,
- 0xB5F5, 0xB5F6, 0xB5F7, 0xB5F8, 0xB5F9, 0xB5FA, 0xB5FB, 0xB5FC,
- 0xB5FD, 0xB5FE, 0xB5FF, 0xB600, 0xB601, 0xB602, 0xB603, 0xB604,
- 0xB605, 0xB606, 0xB607, 0xB608, 0xB609, 0xB60A, 0xB60B, 0xB60C,
- 0xB60D, 0xB60E, 0xB60F, 0xB612, 0xB613, 0xB615, 0xB616, 0xB617,
- 0xB619, 0xB61A, 0xB61B, 0xB61C, 0xB61D, 0xB61E, 0xB61F, 0xB620,
- 0xB621, 0xB622, 0xB623, 0xB624, 0xB626, 0xB627, 0xB628, 0xB629,
- 0xB62A, 0xB62B, 0xB62D, 0xB62E, 0xB62F, 0xB630, 0xB631, 0xB632,
- 0xB633, 0xB635, 0xB636, 0xB637, 0xB638, 0xB639, 0xB63A, 0xB63B,
- 0xB63C, 0xB63D, 0xB63E, 0xB63F, 0xB640, 0xB641, 0xB642, 0xB643,
- 0xB644, 0xB645, 0xB646, 0xB647, 0xB649, 0xB64A, 0xB64B, 0xB64C,
- 0xB64D, 0xB64E, 0xB64F, 0xB650, 0xB651, 0xB652, 0xB653, 0xB654,
- 0xB655, 0xB656, 0xB657, 0xB658, 0xB659, 0xB65A, 0xB65B, 0xB65C,
- 0xB65D, 0xB65E, 0xB65F, 0xB660, 0xB661, 0xB662, 0xB663, 0xB665,
- 0xB666, 0xB667, 0xB669, 0xB66A, 0xB66B, 0xB66C, 0xB66D, 0xB66E,
- 0xB66F, 0xB670, 0xB671, 0xB672, 0xB673, 0xB674, 0xB675, 0xB676,
- 0xB677, 0xB678, 0xB679, 0xB67A, 0xB67B, 0xB67C, 0xB67D, 0xB67E,
- 0xB67F, 0xB680, 0xB681, 0xB682, 0xB683, 0xB684, 0xB685, 0xB686,
- 0xB687, 0xB688, 0xB689, 0xB68A, 0xB68B, 0xB68C, 0xB68D, 0xB68E,
- 0xB68F, 0xB690, 0xB691, 0xB692, 0xB693, 0xB694, 0xB695, 0xB696,
- 0xB697, 0xB698, 0xB699, 0xB69A, 0xB69B, 0xB69E, 0xB69F, 0xB6A1,
- 0xB6A2, 0xB6A3, 0xB6A5, 0xB6A6, 0xB6A7, 0xB6A8, 0xB6A9, 0xB6AA,
- 0xB6AD, 0xB6AE, 0xB6AF, 0xB6B0, 0xB6B2, 0xB6B3, 0xB6B4, 0xB6B5,
- 0xB6B6, 0xB6B7, 0xB6B8, 0xB6B9, 0xB6BA, 0xB6BB, 0xB6BC, 0xB6BD,
- 0xB6BE, 0xB6BF, 0xB6C0, 0xB6C1, 0xB6C2, 0xB6C3, 0xB6C4, 0xB6C5,
- 0xB6C6, 0xB6C7, 0xB6C8, 0xB6C9, 0xB6CA, 0xB6CB, 0xB6CC, 0xB6CD,
- 0xB6CE, 0xB6CF, 0xB6D0, 0xB6D1, 0xB6D2, 0xB6D3, 0xB6D5, 0xB6D6,
- 0xB6D7, 0xB6D8, 0xB6D9, 0xB6DA, 0xB6DB, 0xB6DC, 0xB6DD, 0xB6DE,
- 0xB6DF, 0xB6E0, 0xB6E1, 0xB6E2, 0xB6E3, 0xB6E4, 0xB6E5, 0xB6E6,
- 0xB6E7, 0xB6E8, 0xB6E9, 0xB6EA, 0xB6EB, 0xB6EC, 0xB6ED, 0xB6EE,
- 0xB6EF, 0xB6F1, 0xB6F2, 0xB6F3, 0xB6F5, 0xB6F6, 0xB6F7, 0xB6F9,
- 0xB6FA, 0xB6FB, 0xB6FC, 0xB6FD, 0xB6FE, 0xB6FF, 0xB702, 0xB703,
- 0xB704, 0xB706, 0xB707, 0xB708, 0xB709, 0xB70A, 0xB70B, 0xB70C,
- 0xB70D, 0xB70E, 0xB70F, 0xB710, 0xB711, 0xB712, 0xB713, 0xB714,
- 0xB715, 0xB716, 0xB717, 0xB718, 0xB719, 0xB71A, 0xB71B, 0xB71C,
- 0xB71D, 0xB71E, 0xB71F, 0xB720, 0xB721, 0xB722, 0xB723, 0xB724,
- 0xB725, 0xB726, 0xB727, 0xB72A, 0xB72B, 0xB72D, 0xB72E, 0xB731,
- 0xB732, 0xB733, 0xB734, 0xB735, 0xB736, 0xB737, 0xB73A, 0xB73C,
- 0xB73D, 0xB73E, 0xB73F, 0xB740, 0xB741, 0xB742, 0xB743, 0xB745,
- 0xB746, 0xB747, 0xB749, 0xB74A, 0xB74B, 0xB74D, 0xB74E, 0xB74F,
- 0xB750, 0xB751, 0xB752, 0xB753, 0xB756, 0xB757, 0xB758, 0xB759,
- 0xB75A, 0xB75B, 0xB75C, 0xB75D, 0xB75E, 0xB75F, 0xB761, 0xB762,
- 0xB763, 0xB765, 0xB766, 0xB767, 0xB769, 0xB76A, 0xB76B, 0xB76C,
- 0xB76D, 0xB76E, 0xB76F, 0xB772, 0xB774, 0xB776, 0xB777, 0xB778,
- 0xB779, 0xB77A, 0xB77B, 0xB77E, 0xB77F, 0xB781, 0xB782, 0xB783,
- 0xB785, 0xB786, 0xB787, 0xB788, 0xB789, 0xB78A, 0xB78B, 0xB78E,
- 0xB793, 0xB794, 0xB795, 0xB79A, 0xB79B, 0xB79D, 0xB79E, 0xB79F,
- 0xB7A1, 0xB7A2, 0xB7A3, 0xB7A4, 0xB7A5, 0xB7A6, 0xB7A7, 0xB7AA,
- 0xB7AE, 0xB7AF, 0xB7B0, 0xB7B1, 0xB7B2, 0xB7B3, 0xB7B6, 0xB7B7,
- 0xB7B9, 0xB7BA, 0xB7BB, 0xB7BC, 0xB7BD, 0xB7BE, 0xB7BF, 0xB7C0,
- 0xB7C1, 0xB7C2, 0xB7C3, 0xB7C4, 0xB7C5, 0xB7C6, 0xB7C8, 0xB7CA,
- 0xB7CB, 0xB7CC, 0xB7CD, 0xB7CE, 0xB7CF, 0xB7D0, 0xB7D1, 0xB7D2,
- 0xB7D3, 0xB7D4, 0xB7D5, 0xB7D6, 0xB7D7, 0xB7D8, 0xB7D9, 0xB7DA,
- 0xB7DB, 0xB7DC, 0xB7DD, 0xB7DE, 0xB7DF, 0xB7E0, 0xB7E1, 0xB7E2,
- 0xB7E3, 0xB7E4, 0xB7E5, 0xB7E6, 0xB7E7, 0xB7E8, 0xB7E9, 0xB7EA,
- 0xB7EB, 0xB7EE, 0xB7EF, 0xB7F1, 0xB7F2, 0xB7F3, 0xB7F5, 0xB7F6,
- 0xB7F7, 0xB7F8, 0xB7F9, 0xB7FA, 0xB7FB, 0xB7FE, 0xB802, 0xB803,
- 0xB804, 0xB805, 0xB806, 0xB80A, 0xB80B, 0xB80D, 0xB80E, 0xB80F,
- 0xB811, 0xB812, 0xB813, 0xB814, 0xB815, 0xB816, 0xB817, 0xB81A,
- 0xB81C, 0xB81E, 0xB81F, 0xB820, 0xB821, 0xB822, 0xB823, 0xB826,
- 0xB827, 0xB829, 0xB82A, 0xB82B, 0xB82D, 0xB82E, 0xB82F, 0xB830,
- 0xB831, 0xB832, 0xB833, 0xB836, 0xB83A, 0xB83B, 0xB83C, 0xB83D,
- 0xB83E, 0xB83F, 0xB841, 0xB842, 0xB843, 0xB845, 0xB846, 0xB847,
- 0xB848, 0xB849, 0xB84A, 0xB84B, 0xB84C, 0xB84D, 0xB84E, 0xB84F,
- 0xB850, 0xB852, 0xB854, 0xB855, 0xB856, 0xB857, 0xB858, 0xB859,
- 0xB85A, 0xB85B, 0xB85E, 0xB85F, 0xB861, 0xB862, 0xB863, 0xB865,
- 0xB866, 0xB867, 0xB868, 0xB869, 0xB86A, 0xB86B, 0xB86E, 0xB870,
- 0xB872, 0xB873, 0xB874, 0xB875, 0xB876, 0xB877, 0xB879, 0xB87A,
- 0xB87B, 0xB87D, 0xB87E, 0xB87F, 0xB880, 0xB881, 0xB882, 0xB883,
- 0xB884, 0xB885, 0xB886, 0xB887, 0xB888, 0xB889, 0xB88A, 0xB88B,
- 0xB88C, 0xB88E, 0xB88F, 0xB890, 0xB891, 0xB892, 0xB893, 0xB894,
- 0xB895, 0xB896, 0xB897, 0xB898, 0xB899, 0xB89A, 0xB89B, 0xB89C,
- 0xB89D, 0xB89E, 0xB89F, 0xB8A0, 0xB8A1, 0xB8A2, 0xB8A3, 0xB8A4,
- 0xB8A5, 0xB8A6, 0xB8A7, 0xB8A9, 0xB8AA, 0xB8AB, 0xB8AC, 0xB8AD,
- 0xB8AE, 0xB8AF, 0xB8B1, 0xB8B2, 0xB8B3, 0xB8B5, 0xB8B6, 0xB8B7,
- 0xB8B9, 0xB8BA, 0xB8BB, 0xB8BC, 0xB8BD, 0xB8BE, 0xB8BF, 0xB8C2,
- 0xB8C4, 0xB8C6, 0xB8C7, 0xB8C8, 0xB8C9, 0xB8CA, 0xB8CB, 0xB8CD,
- 0xB8CE, 0xB8CF, 0xB8D1, 0xB8D2, 0xB8D3, 0xB8D5, 0xB8D6, 0xB8D7,
- 0xB8D8, 0xB8D9, 0xB8DA, 0xB8DB, 0xB8DC, 0xB8DE, 0xB8E0, 0xB8E2,
- 0xB8E3, 0xB8E4, 0xB8E5, 0xB8E6, 0xB8E7, 0xB8EA, 0xB8EB, 0xB8ED,
- 0xB8EE, 0xB8EF, 0xB8F1, 0xB8F2, 0xB8F3, 0xB8F4, 0xB8F5, 0xB8F6,
- 0xB8F7, 0xB8FA, 0xB8FC, 0xB8FE, 0xB8FF, 0xB900, 0xB901, 0xB902,
- 0xB903, 0xB905, 0xB906, 0xB907, 0xB908, 0xB909, 0xB90A, 0xB90B,
- 0xB90C, 0xB90D, 0xB90E, 0xB90F, 0xB910, 0xB911, 0xB912, 0xB913,
- 0xB914, 0xB915, 0xB916, 0xB917, 0xB919, 0xB91A, 0xB91B, 0xB91C,
- 0xB91D, 0xB91E, 0xB91F, 0xB921, 0xB922, 0xB923, 0xB924, 0xB925,
- 0xB926, 0xB927, 0xB928, 0xB929, 0xB92A, 0xB92B, 0xB92C, 0xB92D,
- 0xB92E, 0xB92F, 0xB930, 0xB931, 0xB932, 0xB933, 0xB934, 0xB935,
- 0xB936, 0xB937, 0xB938, 0xB939, 0xB93A, 0xB93B, 0xB93E, 0xB93F,
- 0xB941, 0xB942, 0xB943, 0xB945, 0xB946, 0xB947, 0xB948, 0xB949,
- 0xB94A, 0xB94B, 0xB94D, 0xB94E, 0xB950, 0xB952, 0xB953, 0xB954,
- 0xB955, 0xB956, 0xB957, 0xB95A, 0xB95B, 0xB95D, 0xB95E, 0xB95F,
- 0xB961, 0xB962, 0xB963, 0xB964, 0xB965, 0xB966, 0xB967, 0xB96A,
- 0xB96C, 0xB96E, 0xB96F, 0xB970, 0xB971, 0xB972, 0xB973, 0xB976,
- 0xB977, 0xB979, 0xB97A, 0xB97B, 0xB97D, 0xB97E, 0xB97F, 0xB980,
- 0xB981, 0xB982, 0xB983, 0xB986, 0xB988, 0xB98B, 0xB98C, 0xB98F,
- 0xB990, 0xB991, 0xB992, 0xB993, 0xB994, 0xB995, 0xB996, 0xB997,
- 0xB998, 0xB999, 0xB99A, 0xB99B, 0xB99C, 0xB99D, 0xB99E, 0xB99F,
- 0xB9A0, 0xB9A1, 0xB9A2, 0xB9A3, 0xB9A4, 0xB9A5, 0xB9A6, 0xB9A7,
- 0xB9A8, 0xB9A9, 0xB9AA, 0xB9AB, 0xB9AE, 0xB9AF, 0xB9B1, 0xB9B2,
- 0xB9B3, 0xB9B5, 0xB9B6, 0xB9B7, 0xB9B8, 0xB9B9, 0xB9BA, 0xB9BB,
- 0xB9BE, 0xB9C0, 0xB9C2, 0xB9C3, 0xB9C4, 0xB9C5, 0xB9C6, 0xB9C7,
- 0xB9CA, 0xB9CB, 0xB9CD, 0xB9D3, 0xB9D4, 0xB9D5, 0xB9D6, 0xB9D7,
- 0xB9DA, 0xB9DC, 0xB9DF, 0xB9E0, 0xB9E2, 0xB9E6, 0xB9E7, 0xB9E9,
- 0xB9EA, 0xB9EB, 0xB9ED, 0xB9EE, 0xB9EF, 0xB9F0, 0xB9F1, 0xB9F2,
- 0xB9F3, 0xB9F6, 0xB9FB, 0xB9FC, 0xB9FD, 0xB9FE, 0xB9FF, 0xBA02,
- 0xBA03, 0xBA04, 0xBA05, 0xBA06, 0xBA07, 0xBA09, 0xBA0A, 0xBA0B,
- 0xBA0C, 0xBA0D, 0xBA0E, 0xBA0F, 0xBA10, 0xBA11, 0xBA12, 0xBA13,
- 0xBA14, 0xBA16, 0xBA17, 0xBA18, 0xBA19, 0xBA1A, 0xBA1B, 0xBA1C,
- 0xBA1D, 0xBA1E, 0xBA1F, 0xBA20, 0xBA21, 0xBA22, 0xBA23, 0xBA24,
- 0xBA25, 0xBA26, 0xBA27, 0xBA28, 0xBA29, 0xBA2A, 0xBA2B, 0xBA2C,
- 0xBA2D, 0xBA2E, 0xBA2F, 0xBA30, 0xBA31, 0xBA32, 0xBA33, 0xBA34,
- 0xBA35, 0xBA36, 0xBA37, 0xBA3A, 0xBA3B, 0xBA3D, 0xBA3E, 0xBA3F,
- 0xBA41, 0xBA43, 0xBA44, 0xBA45, 0xBA46, 0xBA47, 0xBA4A, 0xBA4C,
- 0xBA4F, 0xBA50, 0xBA51, 0xBA52, 0xBA56, 0xBA57, 0xBA59, 0xBA5A,
- 0xBA5B, 0xBA5D, 0xBA5E, 0xBA5F, 0xBA60, 0xBA61, 0xBA62, 0xBA63,
- 0xBA66, 0xBA6A, 0xBA6B, 0xBA6C, 0xBA6D, 0xBA6E, 0xBA6F, 0xBA72,
- 0xBA73, 0xBA75, 0xBA76, 0xBA77, 0xBA79, 0xBA7A, 0xBA7B, 0xBA7C,
- 0xBA7D, 0xBA7E, 0xBA7F, 0xBA80, 0xBA81, 0xBA82, 0xBA86, 0xBA88,
- 0xBA89, 0xBA8A, 0xBA8B, 0xBA8D, 0xBA8E, 0xBA8F, 0xBA90, 0xBA91,
- 0xBA92, 0xBA93, 0xBA94, 0xBA95, 0xBA96, 0xBA97, 0xBA98, 0xBA99,
- 0xBA9A, 0xBA9B, 0xBA9C, 0xBA9D, 0xBA9E, 0xBA9F, 0xBAA0, 0xBAA1,
- 0xBAA2, 0xBAA3, 0xBAA4, 0xBAA5, 0xBAA6, 0xBAA7, 0xBAAA, 0xBAAD,
- 0xBAAE, 0xBAAF, 0xBAB1, 0xBAB3, 0xBAB4, 0xBAB5, 0xBAB6, 0xBAB7,
- 0xBABA, 0xBABC, 0xBABE, 0xBABF, 0xBAC0, 0xBAC1, 0xBAC2, 0xBAC3,
- 0xBAC5, 0xBAC6, 0xBAC7, 0xBAC9, 0xBACA, 0xBACB, 0xBACC, 0xBACD,
- 0xBACE, 0xBACF, 0xBAD0, 0xBAD1, 0xBAD2, 0xBAD3, 0xBAD4, 0xBAD5,
- 0xBAD6, 0xBAD7, 0xBADA, 0xBADB, 0xBADC, 0xBADD, 0xBADE, 0xBADF,
- 0xBAE0, 0xBAE1, 0xBAE2, 0xBAE3, 0xBAE4, 0xBAE5, 0xBAE6, 0xBAE7,
- 0xBAE8, 0xBAE9, 0xBAEA, 0xBAEB, 0xBAEC, 0xBAED, 0xBAEE, 0xBAEF,
- 0xBAF0, 0xBAF1, 0xBAF2, 0xBAF3, 0xBAF4, 0xBAF5, 0xBAF6, 0xBAF7,
- 0xBAF8, 0xBAF9, 0xBAFA, 0xBAFB, 0xBAFD, 0xBAFE, 0xBAFF, 0xBB01,
- 0xBB02, 0xBB03, 0xBB05, 0xBB06, 0xBB07, 0xBB08, 0xBB09, 0xBB0A,
- 0xBB0B, 0xBB0C, 0xBB0E, 0xBB10, 0xBB12, 0xBB13, 0xBB14, 0xBB15,
- 0xBB16, 0xBB17, 0xBB19, 0xBB1A, 0xBB1B, 0xBB1D, 0xBB1E, 0xBB1F,
- 0xBB21, 0xBB22, 0xBB23, 0xBB24, 0xBB25, 0xBB26, 0xBB27, 0xBB28,
- 0xBB2A, 0xBB2C, 0xBB2D, 0xBB2E, 0xBB2F, 0xBB30, 0xBB31, 0xBB32,
- 0xBB33, 0xBB37, 0xBB39, 0xBB3A, 0xBB3F, 0xBB40, 0xBB41, 0xBB42,
- 0xBB43, 0xBB46, 0xBB48, 0xBB4A, 0xBB4B, 0xBB4C, 0xBB4E, 0xBB51,
- 0xBB52, 0xBB53, 0xBB55, 0xBB56, 0xBB57, 0xBB59, 0xBB5A, 0xBB5B,
- 0xBB5C, 0xBB5D, 0xBB5E, 0xBB5F, 0xBB60, 0xBB62, 0xBB64, 0xBB65,
- 0xBB66, 0xBB67, 0xBB68, 0xBB69, 0xBB6A, 0xBB6B, 0xBB6D, 0xBB6E,
- 0xBB6F, 0xBB70, 0xBB71, 0xBB72, 0xBB73, 0xBB74, 0xBB75, 0xBB76,
- 0xBB77, 0xBB78, 0xBB79, 0xBB7A, 0xBB7B, 0xBB7C, 0xBB7D, 0xBB7E,
- 0xBB7F, 0xBB80, 0xBB81, 0xBB82, 0xBB83, 0xBB84, 0xBB85, 0xBB86,
- 0xBB87, 0xBB89, 0xBB8A, 0xBB8B, 0xBB8D, 0xBB8E, 0xBB8F, 0xBB91,
- 0xBB92, 0xBB93, 0xBB94, 0xBB95, 0xBB96, 0xBB97, 0xBB98, 0xBB99,
- 0xBB9A, 0xBB9B, 0xBB9C, 0xBB9D, 0xBB9E, 0xBB9F, 0xBBA0, 0xBBA1,
- 0xBBA2, 0xBBA3, 0xBBA5, 0xBBA6, 0xBBA7, 0xBBA9, 0xBBAA, 0xBBAB,
- 0xBBAD, 0xBBAE, 0xBBAF, 0xBBB0, 0xBBB1, 0xBBB2, 0xBBB3, 0xBBB5,
- 0xBBB6, 0xBBB8, 0xBBB9, 0xBBBA, 0xBBBB, 0xBBBC, 0xBBBD, 0xBBBE,
- 0xBBBF, 0xBBC1, 0xBBC2, 0xBBC3, 0xBBC5, 0xBBC6, 0xBBC7, 0xBBC9,
- 0xBBCA, 0xBBCB, 0xBBCC, 0xBBCD, 0xBBCE, 0xBBCF, 0xBBD1, 0xBBD2,
- 0xBBD4, 0xBBD5, 0xBBD6, 0xBBD7, 0xBBD8, 0xBBD9, 0xBBDA, 0xBBDB,
- 0xBBDC, 0xBBDD, 0xBBDE, 0xBBDF, 0xBBE0, 0xBBE1, 0xBBE2, 0xBBE3,
- 0xBBE4, 0xBBE5, 0xBBE6, 0xBBE7, 0xBBE8, 0xBBE9, 0xBBEA, 0xBBEB,
- 0xBBEC, 0xBBED, 0xBBEE, 0xBBEF, 0xBBF0, 0xBBF1, 0xBBF2, 0xBBF3,
- 0xBBF4, 0xBBF5, 0xBBF6, 0xBBF7, 0xBBFA, 0xBBFB, 0xBBFD, 0xBBFE,
- 0xBC01, 0xBC03, 0xBC04, 0xBC05, 0xBC06, 0xBC07, 0xBC0A, 0xBC0E,
- 0xBC10, 0xBC12, 0xBC13, 0xBC19, 0xBC1A, 0xBC20, 0xBC21, 0xBC22,
- 0xBC23, 0xBC26, 0xBC28, 0xBC2A, 0xBC2B, 0xBC2C, 0xBC2E, 0xBC2F,
- 0xBC32, 0xBC33, 0xBC35, 0xBC36, 0xBC37, 0xBC39, 0xBC3A, 0xBC3B,
- 0xBC3C, 0xBC3D, 0xBC3E, 0xBC3F, 0xBC42, 0xBC46, 0xBC47, 0xBC48,
- 0xBC4A, 0xBC4B, 0xBC4E, 0xBC4F, 0xBC51, 0xBC52, 0xBC53, 0xBC54,
- 0xBC55, 0xBC56, 0xBC57, 0xBC58, 0xBC59, 0xBC5A, 0xBC5B, 0xBC5C,
- 0xBC5E, 0xBC5F, 0xBC60, 0xBC61, 0xBC62, 0xBC63, 0xBC64, 0xBC65,
- 0xBC66, 0xBC67, 0xBC68, 0xBC69, 0xBC6A, 0xBC6B, 0xBC6C, 0xBC6D,
- 0xBC6E, 0xBC6F, 0xBC70, 0xBC71, 0xBC72, 0xBC73, 0xBC74, 0xBC75,
- 0xBC76, 0xBC77, 0xBC78, 0xBC79, 0xBC7A, 0xBC7B, 0xBC7C, 0xBC7D,
- 0xBC7E, 0xBC7F, 0xBC80, 0xBC81, 0xBC82, 0xBC83, 0xBC86, 0xBC87,
- 0xBC89, 0xBC8A, 0xBC8D, 0xBC8F, 0xBC90, 0xBC91, 0xBC92, 0xBC93,
- 0xBC96, 0xBC98, 0xBC9B, 0xBC9C, 0xBC9D, 0xBC9E, 0xBC9F, 0xBCA2,
- 0xBCA3, 0xBCA5, 0xBCA6, 0xBCA9, 0xBCAA, 0xBCAB, 0xBCAC, 0xBCAD,
- 0xBCAE, 0xBCAF, 0xBCB2, 0xBCB6, 0xBCB7, 0xBCB8, 0xBCB9, 0xBCBA,
- 0xBCBB, 0xBCBE, 0xBCBF, 0xBCC1, 0xBCC2, 0xBCC3, 0xBCC5, 0xBCC6,
- 0xBCC7, 0xBCC8, 0xBCC9, 0xBCCA, 0xBCCB, 0xBCCC, 0xBCCE, 0xBCD2,
- 0xBCD3, 0xBCD4, 0xBCD6, 0xBCD7, 0xBCD9, 0xBCDA, 0xBCDB, 0xBCDD,
- 0xBCDE, 0xBCDF, 0xBCE0, 0xBCE1, 0xBCE2, 0xBCE3, 0xBCE4, 0xBCE5,
- 0xBCE6, 0xBCE7, 0xBCE8, 0xBCE9, 0xBCEA, 0xBCEB, 0xBCEC, 0xBCED,
- 0xBCEE, 0xBCEF, 0xBCF0, 0xBCF1, 0xBCF2, 0xBCF3, 0xBCF7, 0xBCF9,
- 0xBCFA, 0xBCFB, 0xBCFD, 0xBCFE, 0xBCFF, 0xBD00, 0xBD01, 0xBD02,
- 0xBD03, 0xBD06, 0xBD08, 0xBD0A, 0xBD0B, 0xBD0C, 0xBD0D, 0xBD0E,
- 0xBD0F, 0xBD11, 0xBD12, 0xBD13, 0xBD15, 0xBD16, 0xBD17, 0xBD18,
- 0xBD19, 0xBD1A, 0xBD1B, 0xBD1C, 0xBD1D, 0xBD1E, 0xBD1F, 0xBD20,
- 0xBD21, 0xBD22, 0xBD23, 0xBD25, 0xBD26, 0xBD27, 0xBD28, 0xBD29,
- 0xBD2A, 0xBD2B, 0xBD2D, 0xBD2E, 0xBD2F, 0xBD30, 0xBD31, 0xBD32,
- 0xBD33, 0xBD34, 0xBD35, 0xBD36, 0xBD37, 0xBD38, 0xBD39, 0xBD3A,
- 0xBD3B, 0xBD3C, 0xBD3D, 0xBD3E, 0xBD3F, 0xBD41, 0xBD42, 0xBD43,
- 0xBD44, 0xBD45, 0xBD46, 0xBD47, 0xBD4A, 0xBD4B, 0xBD4D, 0xBD4E,
- 0xBD4F, 0xBD51, 0xBD52, 0xBD53, 0xBD54, 0xBD55, 0xBD56, 0xBD57,
- 0xBD5A, 0xBD5B, 0xBD5C, 0xBD5D, 0xBD5E, 0xBD5F, 0xBD60, 0xBD61,
- 0xBD62, 0xBD63, 0xBD65, 0xBD66, 0xBD67, 0xBD69, 0xBD6A, 0xBD6B,
- 0xBD6C, 0xBD6D, 0xBD6E, 0xBD6F, 0xBD70, 0xBD71, 0xBD72, 0xBD73,
- 0xBD74, 0xBD75, 0xBD76, 0xBD77, 0xBD78, 0xBD79, 0xBD7A, 0xBD7B,
- 0xBD7C, 0xBD7D, 0xBD7E, 0xBD7F, 0xBD82, 0xBD83, 0xBD85, 0xBD86,
- 0xBD8B, 0xBD8C, 0xBD8D, 0xBD8E, 0xBD8F, 0xBD92, 0xBD94, 0xBD96,
- 0xBD97, 0xBD98, 0xBD9B, 0xBD9D, 0xBD9E, 0xBD9F, 0xBDA0, 0xBDA1,
- 0xBDA2, 0xBDA3, 0xBDA5, 0xBDA6, 0xBDA7, 0xBDA8, 0xBDA9, 0xBDAA,
- 0xBDAB, 0xBDAC, 0xBDAD, 0xBDAE, 0xBDAF, 0xBDB1, 0xBDB2, 0xBDB3,
- 0xBDB4, 0xBDB5, 0xBDB6, 0xBDB7, 0xBDB9, 0xBDBA, 0xBDBB, 0xBDBC,
- 0xBDBD, 0xBDBE, 0xBDBF, 0xBDC0, 0xBDC1, 0xBDC2, 0xBDC3, 0xBDC4,
- 0xBDC5, 0xBDC6, 0xBDC7, 0xBDC8, 0xBDC9, 0xBDCA, 0xBDCB, 0xBDCC,
- 0xBDCD, 0xBDCE, 0xBDCF, 0xBDD0, 0xBDD1, 0xBDD2, 0xBDD3, 0xBDD6,
- 0xBDD7, 0xBDD9, 0xBDDA, 0xBDDB, 0xBDDD, 0xBDDE, 0xBDDF, 0xBDE0,
- 0xBDE1, 0xBDE2, 0xBDE3, 0xBDE4, 0xBDE5, 0xBDE6, 0xBDE7, 0xBDE8,
- 0xBDEA, 0xBDEB, 0xBDEC, 0xBDED, 0xBDEE, 0xBDEF, 0xBDF1, 0xBDF2,
- 0xBDF3, 0xBDF5, 0xBDF6, 0xBDF7, 0xBDF9, 0xBDFA, 0xBDFB, 0xBDFC,
- 0xBDFD, 0xBDFE, 0xBDFF, 0xBE01, 0xBE02, 0xBE04, 0xBE06, 0xBE07,
- 0xBE08, 0xBE09, 0xBE0A, 0xBE0B, 0xBE0E, 0xBE0F, 0xBE11, 0xBE12,
- 0xBE13, 0xBE15, 0xBE16, 0xBE17, 0xBE18, 0xBE19, 0xBE1A, 0xBE1B,
- 0xBE1E, 0xBE20, 0xBE21, 0xBE22, 0xBE23, 0xBE24, 0xBE25, 0xBE26,
- 0xBE27, 0xBE28, 0xBE29, 0xBE2A, 0xBE2B, 0xBE2C, 0xBE2D, 0xBE2E,
- 0xBE2F, 0xBE30, 0xBE31, 0xBE32, 0xBE33, 0xBE34, 0xBE35, 0xBE36,
- 0xBE37, 0xBE38, 0xBE39, 0xBE3A, 0xBE3B, 0xBE3C, 0xBE3D, 0xBE3E,
- 0xBE3F, 0xBE40, 0xBE41, 0xBE42, 0xBE43, 0xBE46, 0xBE47, 0xBE49,
- 0xBE4A, 0xBE4B, 0xBE4D, 0xBE4F, 0xBE50, 0xBE51, 0xBE52, 0xBE53,
- 0xBE56, 0xBE58, 0xBE5C, 0xBE5D, 0xBE5E, 0xBE5F, 0xBE62, 0xBE63,
- 0xBE65, 0xBE66, 0xBE67, 0xBE69, 0xBE6B, 0xBE6C, 0xBE6D, 0xBE6E,
- 0xBE6F, 0xBE72, 0xBE76, 0xBE77, 0xBE78, 0xBE79, 0xBE7A, 0xBE7E,
- 0xBE7F, 0xBE81, 0xBE82, 0xBE83, 0xBE85, 0xBE86, 0xBE87, 0xBE88,
- 0xBE89, 0xBE8A, 0xBE8B, 0xBE8E, 0xBE92, 0xBE93, 0xBE94, 0xBE95,
- 0xBE96, 0xBE97, 0xBE9A, 0xBE9B, 0xBE9C, 0xBE9D, 0xBE9E, 0xBE9F,
- 0xBEA0, 0xBEA1, 0xBEA2, 0xBEA3, 0xBEA4, 0xBEA5, 0xBEA6, 0xBEA7,
- 0xBEA9, 0xBEAA, 0xBEAB, 0xBEAC, 0xBEAD, 0xBEAE, 0xBEAF, 0xBEB0,
- 0xBEB1, 0xBEB2, 0xBEB3, 0xBEB4, 0xBEB5, 0xBEB6, 0xBEB7, 0xBEB8,
- 0xBEB9, 0xBEBA, 0xBEBB, 0xBEBC, 0xBEBD, 0xBEBE, 0xBEBF, 0xBEC0,
- 0xBEC1, 0xBEC2, 0xBEC3, 0xBEC4, 0xBEC5, 0xBEC6, 0xBEC7, 0xBEC8,
- 0xBEC9, 0xBECA, 0xBECB, 0xBECC, 0xBECD, 0xBECE, 0xBECF, 0xBED2,
- 0xBED3, 0xBED5, 0xBED6, 0xBED9, 0xBEDA, 0xBEDB, 0xBEDC, 0xBEDD,
- 0xBEDE, 0xBEDF, 0xBEE1, 0xBEE2, 0xBEE6, 0xBEE7, 0xBEE8, 0xBEE9,
- 0xBEEA, 0xBEEB, 0xBEED, 0xBEEE, 0xBEEF, 0xBEF0, 0xBEF1, 0xBEF2,
- 0xBEF3, 0xBEF4, 0xBEF5, 0xBEF6, 0xBEF7, 0xBEF8, 0xBEF9, 0xBEFA,
- 0xBEFB, 0xBEFC, 0xBEFD, 0xBEFE, 0xBEFF, 0xBF00, 0xBF02, 0xBF03,
- 0xBF04, 0xBF05, 0xBF06, 0xBF07, 0xBF0A, 0xBF0B, 0xBF0C, 0xBF0D,
- 0xBF0E, 0xBF0F, 0xBF10, 0xBF11, 0xBF12, 0xBF13, 0xBF14, 0xBF15,
- 0xBF16, 0xBF17, 0xBF1A, 0xBF1E, 0xBF1F, 0xBF20, 0xBF21, 0xBF22,
- 0xBF23, 0xBF24, 0xBF25, 0xBF26, 0xBF27, 0xBF28, 0xBF29, 0xBF2A,
- 0xBF2B, 0xBF2C, 0xBF2D, 0xBF2E, 0xBF2F, 0xBF30, 0xBF31, 0xBF32,
- 0xBF33, 0xBF34, 0xBF35, 0xBF36, 0xBF37, 0xBF38, 0xBF39, 0xBF3A,
- 0xBF3B, 0xBF3C, 0xBF3D, 0xBF3E, 0xBF3F, 0xBF42, 0xBF43, 0xBF45,
- 0xBF46, 0xBF47, 0xBF49, 0xBF4A, 0xBF4B, 0xBF4C, 0xBF4D, 0xBF4E,
- 0xBF4F, 0xBF52, 0xBF53, 0xBF54, 0xBF56, 0xBF57, 0xBF58, 0xBF59,
- 0xBF5A, 0xBF5B, 0xBF5C, 0xBF5D, 0xBF5E, 0xBF5F, 0xBF60, 0xBF61,
- 0xBF62, 0xBF63, 0xBF64, 0xBF65, 0xBF66, 0xBF67, 0xBF68, 0xBF69,
- 0xBF6A, 0xBF6B, 0xBF6C, 0xBF6D, 0xBF6E, 0xBF6F, 0xBF70, 0xBF71,
- 0xBF72, 0xBF73, 0xBF74, 0xBF75, 0xBF76, 0xBF77, 0xBF78, 0xBF79,
- 0xBF7A, 0xBF7B, 0xBF7C, 0xBF7D, 0xBF7E, 0xBF7F, 0xBF80, 0xBF81,
- 0xBF82, 0xBF83, 0xBF84, 0xBF85, 0xBF86, 0xBF87, 0xBF88, 0xBF89,
- 0xBF8A, 0xBF8B, 0xBF8C, 0xBF8D, 0xBF8E, 0xBF8F, 0xBF90, 0xBF91,
- 0xBF92, 0xBF93, 0xBF95, 0xBF96, 0xBF97, 0xBF98, 0xBF99, 0xBF9A,
- 0xBF9B, 0xBF9C, 0xBF9D, 0xBF9E, 0xBF9F, 0xBFA0, 0xBFA1, 0xBFA2,
- 0xBFA3, 0xBFA4, 0xBFA5, 0xBFA6, 0xBFA7, 0xBFA8, 0xBFA9, 0xBFAA,
- 0xBFAB, 0xBFAC, 0xBFAD, 0xBFAE, 0xBFAF, 0xBFB1, 0xBFB2, 0xBFB3,
- 0xBFB4, 0xBFB5, 0xBFB6, 0xBFB7, 0xBFB8, 0xBFB9, 0xBFBA, 0xBFBB,
- 0xBFBC, 0xBFBD, 0xBFBE, 0xBFBF, 0xBFC0, 0xBFC1, 0xBFC2, 0xBFC3,
- 0xBFC4, 0xBFC6, 0xBFC7, 0xBFC8, 0xBFC9, 0xBFCA, 0xBFCB, 0xBFCE,
- 0xBFCF, 0xBFD1, 0xBFD2, 0xBFD3, 0xBFD5, 0xBFD6, 0xBFD7, 0xBFD8,
- 0xBFD9, 0xBFDA, 0xBFDB, 0xBFDD, 0xBFDE, 0xBFE0, 0xBFE2, 0xBFE3,
- 0xBFE4, 0xBFE5, 0xBFE6, 0xBFE7, 0xBFE8, 0xBFE9, 0xBFEA, 0xBFEB,
- 0xBFEC, 0xBFED, 0xBFEE, 0xBFEF, 0xBFF0, 0xBFF1, 0xBFF2, 0xBFF3,
- 0xBFF4, 0xBFF5, 0xBFF6, 0xBFF7, 0xBFF8, 0xBFF9, 0xBFFA, 0xBFFB,
- 0xBFFC, 0xBFFD, 0xBFFE, 0xBFFF, 0xC000, 0xC001, 0xC002, 0xC003,
- 0xC004, 0xC005, 0xC006, 0xC007, 0xC008, 0xC009, 0xC00A, 0xC00B,
- 0xC00C, 0xC00D, 0xC00E, 0xC00F, 0xC010, 0xC011, 0xC012, 0xC013,
- 0xC014, 0xC015, 0xC016, 0xC017, 0xC018, 0xC019, 0xC01A, 0xC01B,
- 0xC01C, 0xC01D, 0xC01E, 0xC01F, 0xC020, 0xC021, 0xC022, 0xC023,
- 0xC024, 0xC025, 0xC026, 0xC027, 0xC028, 0xC029, 0xC02A, 0xC02B,
- 0xC02C, 0xC02D, 0xC02E, 0xC02F, 0xC030, 0xC031, 0xC032, 0xC033,
- 0xC034, 0xC035, 0xC036, 0xC037, 0xC038, 0xC039, 0xC03A, 0xC03B,
- 0xC03D, 0xC03E, 0xC03F, 0xC040, 0xC041, 0xC042, 0xC043, 0xC044,
- 0xC045, 0xC046, 0xC047, 0xC048, 0xC049, 0xC04A, 0xC04B, 0xC04C,
- 0xC04D, 0xC04E, 0xC04F, 0xC050, 0xC052, 0xC053, 0xC054, 0xC055,
- 0xC056, 0xC057, 0xC059, 0xC05A, 0xC05B, 0xC05D, 0xC05E, 0xC05F,
- 0xC061, 0xC062, 0xC063, 0xC064, 0xC065, 0xC066, 0xC067, 0xC06A,
- 0xC06B, 0xC06C, 0xC06D, 0xC06E, 0xC06F, 0xC070, 0xC071, 0xC072,
- 0xC073, 0xC074, 0xC075, 0xC076, 0xC077, 0xC078, 0xC079, 0xC07A,
- 0xC07B, 0xC07C, 0xC07D, 0xC07E, 0xC07F, 0xC080, 0xC081, 0xC082,
- 0xC083, 0xC084, 0xC085, 0xC086, 0xC087, 0xC088, 0xC089, 0xC08A,
- 0xC08B, 0xC08C, 0xC08D, 0xC08E, 0xC08F, 0xC092, 0xC093, 0xC095,
- 0xC096, 0xC097, 0xC099, 0xC09A, 0xC09B, 0xC09C, 0xC09D, 0xC09E,
- 0xC09F, 0xC0A2, 0xC0A4, 0xC0A6, 0xC0A7, 0xC0A8, 0xC0A9, 0xC0AA,
- 0xC0AB, 0xC0AE, 0xC0B1, 0xC0B2, 0xC0B7, 0xC0B8, 0xC0B9, 0xC0BA,
- 0xC0BB, 0xC0BE, 0xC0C2, 0xC0C3, 0xC0C4, 0xC0C6, 0xC0C7, 0xC0CA,
- 0xC0CB, 0xC0CD, 0xC0CE, 0xC0CF, 0xC0D1, 0xC0D2, 0xC0D3, 0xC0D4,
- 0xC0D5, 0xC0D6, 0xC0D7, 0xC0DA, 0xC0DE, 0xC0DF, 0xC0E0, 0xC0E1,
- 0xC0E2, 0xC0E3, 0xC0E6, 0xC0E7, 0xC0E9, 0xC0EA, 0xC0EB, 0xC0ED,
- 0xC0EE, 0xC0EF, 0xC0F0, 0xC0F1, 0xC0F2, 0xC0F3, 0xC0F6, 0xC0F8,
- 0xC0FA, 0xC0FB, 0xC0FC, 0xC0FD, 0xC0FE, 0xC0FF, 0xC101, 0xC102,
- 0xC103, 0xC105, 0xC106, 0xC107, 0xC109, 0xC10A, 0xC10B, 0xC10C,
- 0xC10D, 0xC10E, 0xC10F, 0xC111, 0xC112, 0xC113, 0xC114, 0xC116,
- 0xC117, 0xC118, 0xC119, 0xC11A, 0xC11B, 0xC121, 0xC122, 0xC125,
- 0xC128, 0xC129, 0xC12A, 0xC12B, 0xC12E, 0xC132, 0xC133, 0xC134,
- 0xC135, 0xC137, 0xC13A, 0xC13B, 0xC13D, 0xC13E, 0xC13F, 0xC141,
- 0xC142, 0xC143, 0xC144, 0xC145, 0xC146, 0xC147, 0xC14A, 0xC14E,
- 0xC14F, 0xC150, 0xC151, 0xC152, 0xC153, 0xC156, 0xC157, 0xC159,
- 0xC15A, 0xC15B, 0xC15D, 0xC15E, 0xC15F, 0xC160, 0xC161, 0xC162,
- 0xC163, 0xC166, 0xC16A, 0xC16B, 0xC16C, 0xC16D, 0xC16E, 0xC16F,
- 0xC171, 0xC172, 0xC173, 0xC175, 0xC176, 0xC177, 0xC179, 0xC17A,
- 0xC17B, 0xC17C, 0xC17D, 0xC17E, 0xC17F, 0xC180, 0xC181, 0xC182,
- 0xC183, 0xC184, 0xC186, 0xC187, 0xC188, 0xC189, 0xC18A, 0xC18B,
- 0xC18F, 0xC191, 0xC192, 0xC193, 0xC195, 0xC197, 0xC198, 0xC199,
- 0xC19A, 0xC19B, 0xC19E, 0xC1A0, 0xC1A2, 0xC1A3, 0xC1A4, 0xC1A6,
- 0xC1A7, 0xC1AA, 0xC1AB, 0xC1AD, 0xC1AE, 0xC1AF, 0xC1B1, 0xC1B2,
- 0xC1B3, 0xC1B4, 0xC1B5, 0xC1B6, 0xC1B7, 0xC1B8, 0xC1B9, 0xC1BA,
- 0xC1BB, 0xC1BC, 0xC1BE, 0xC1BF, 0xC1C0, 0xC1C1, 0xC1C2, 0xC1C3,
- 0xC1C5, 0xC1C6, 0xC1C7, 0xC1C9, 0xC1CA, 0xC1CB, 0xC1CD, 0xC1CE,
- 0xC1CF, 0xC1D0, 0xC1D1, 0xC1D2, 0xC1D3, 0xC1D5, 0xC1D6, 0xC1D9,
- 0xC1DA, 0xC1DB, 0xC1DC, 0xC1DD, 0xC1DE, 0xC1DF, 0xC1E1, 0xC1E2,
- 0xC1E3, 0xC1E5, 0xC1E6, 0xC1E7, 0xC1E9, 0xC1EA, 0xC1EB, 0xC1EC,
- 0xC1ED, 0xC1EE, 0xC1EF, 0xC1F2, 0xC1F4, 0xC1F5, 0xC1F6, 0xC1F7,
- 0xC1F8, 0xC1F9, 0xC1FA, 0xC1FB, 0xC1FE, 0xC1FF, 0xC201, 0xC202,
- 0xC203, 0xC205, 0xC206, 0xC207, 0xC208, 0xC209, 0xC20A, 0xC20B,
- 0xC20E, 0xC210, 0xC212, 0xC213, 0xC214, 0xC215, 0xC216, 0xC217,
- 0xC21A, 0xC21B, 0xC21D, 0xC21E, 0xC221, 0xC222, 0xC223, 0xC224,
- 0xC225, 0xC226, 0xC227, 0xC22A, 0xC22C, 0xC22E, 0xC230, 0xC233,
- 0xC235, 0xC236, 0xC237, 0xC238, 0xC239, 0xC23A, 0xC23B, 0xC23C,
- 0xC23D, 0xC23E, 0xC23F, 0xC240, 0xC241, 0xC242, 0xC243, 0xC244,
- 0xC245, 0xC246, 0xC247, 0xC249, 0xC24A, 0xC24B, 0xC24C, 0xC24D,
- 0xC24E, 0xC24F, 0xC252, 0xC253, 0xC255, 0xC256, 0xC257, 0xC259,
- 0xC25A, 0xC25B, 0xC25C, 0xC25D, 0xC25E, 0xC25F, 0xC261, 0xC262,
- 0xC263, 0xC264, 0xC266, 0xC267, 0xC268, 0xC269, 0xC26A, 0xC26B,
- 0xC26E, 0xC26F, 0xC271, 0xC272, 0xC273, 0xC275, 0xC276, 0xC277,
- 0xC278, 0xC279, 0xC27A, 0xC27B, 0xC27E, 0xC280, 0xC282, 0xC283,
- 0xC284, 0xC285, 0xC286, 0xC287, 0xC28A, 0xC28B, 0xC28C, 0xC28D,
- 0xC28E, 0xC28F, 0xC291, 0xC292, 0xC293, 0xC294, 0xC295, 0xC296,
- 0xC297, 0xC299, 0xC29A, 0xC29C, 0xC29E, 0xC29F, 0xC2A0, 0xC2A1,
- 0xC2A2, 0xC2A3, 0xC2A6, 0xC2A7, 0xC2A9, 0xC2AA, 0xC2AB, 0xC2AE,
- 0xC2AF, 0xC2B0, 0xC2B1, 0xC2B2, 0xC2B3, 0xC2B6, 0xC2B8, 0xC2BA,
- 0xC2BB, 0xC2BC, 0xC2BD, 0xC2BE, 0xC2BF, 0xC2C0, 0xC2C1, 0xC2C2,
- 0xC2C3, 0xC2C4, 0xC2C5, 0xC2C6, 0xC2C7, 0xC2C8, 0xC2C9, 0xC2CA,
- 0xC2CB, 0xC2CC, 0xC2CD, 0xC2CE, 0xC2CF, 0xC2D0, 0xC2D1, 0xC2D2,
- 0xC2D3, 0xC2D4, 0xC2D5, 0xC2D6, 0xC2D7, 0xC2D8, 0xC2D9, 0xC2DA,
- 0xC2DB, 0xC2DE, 0xC2DF, 0xC2E1, 0xC2E2, 0xC2E5, 0xC2E6, 0xC2E7,
- 0xC2E8, 0xC2E9, 0xC2EA, 0xC2EE, 0xC2F0, 0xC2F2, 0xC2F3, 0xC2F4,
- 0xC2F5, 0xC2F7, 0xC2FA, 0xC2FD, 0xC2FE, 0xC2FF, 0xC301, 0xC302,
- 0xC303, 0xC304, 0xC305, 0xC306, 0xC307, 0xC30A, 0xC30B, 0xC30E,
- 0xC30F, 0xC310, 0xC311, 0xC312, 0xC316, 0xC317, 0xC319, 0xC31A,
- 0xC31B, 0xC31D, 0xC31E, 0xC31F, 0xC320, 0xC321, 0xC322, 0xC323,
- 0xC326, 0xC327, 0xC32A, 0xC32B, 0xC32C, 0xC32D, 0xC32E, 0xC32F,
- 0xC330, 0xC331, 0xC332, 0xC333, 0xC334, 0xC335, 0xC336, 0xC337,
- 0xC338, 0xC339, 0xC33A, 0xC33B, 0xC33C, 0xC33D, 0xC33E, 0xC33F,
- 0xC340, 0xC341, 0xC342, 0xC343, 0xC344, 0xC346, 0xC347, 0xC348,
- 0xC349, 0xC34A, 0xC34B, 0xC34C, 0xC34D, 0xC34E, 0xC34F, 0xC350,
- 0xC351, 0xC352, 0xC353, 0xC354, 0xC355, 0xC356, 0xC357, 0xC358,
- 0xC359, 0xC35A, 0xC35B, 0xC35C, 0xC35D, 0xC35E, 0xC35F, 0xC360,
- 0xC361, 0xC362, 0xC363, 0xC364, 0xC365, 0xC366, 0xC367, 0xC36A,
- 0xC36B, 0xC36D, 0xC36E, 0xC36F, 0xC371, 0xC373, 0xC374, 0xC375,
- 0xC376, 0xC377, 0xC37A, 0xC37B, 0xC37E, 0xC37F, 0xC380, 0xC381,
- 0xC382, 0xC383, 0xC385, 0xC386, 0xC387, 0xC389, 0xC38A, 0xC38B,
- 0xC38D, 0xC38E, 0xC38F, 0xC390, 0xC391, 0xC392, 0xC393, 0xC394,
- 0xC395, 0xC396, 0xC397, 0xC398, 0xC399, 0xC39A, 0xC39B, 0xC39C,
- 0xC39D, 0xC39E, 0xC39F, 0xC3A0, 0xC3A1, 0xC3A2, 0xC3A3, 0xC3A4,
- 0xC3A5, 0xC3A6, 0xC3A7, 0xC3A8, 0xC3A9, 0xC3AA, 0xC3AB, 0xC3AC,
- 0xC3AD, 0xC3AE, 0xC3AF, 0xC3B0, 0xC3B1, 0xC3B2, 0xC3B3, 0xC3B4,
- 0xC3B5, 0xC3B6, 0xC3B7, 0xC3B8, 0xC3B9, 0xC3BA, 0xC3BB, 0xC3BC,
- 0xC3BD, 0xC3BE, 0xC3BF, 0xC3C1, 0xC3C2, 0xC3C3, 0xC3C4, 0xC3C5,
- 0xC3C6, 0xC3C7, 0xC3C8, 0xC3C9, 0xC3CA, 0xC3CB, 0xC3CC, 0xC3CD,
- 0xC3CE, 0xC3CF, 0xC3D0, 0xC3D1, 0xC3D2, 0xC3D3, 0xC3D4, 0xC3D5,
- 0xC3D6, 0xC3D7, 0xC3DA, 0xC3DB, 0xC3DD, 0xC3DE, 0xC3E1, 0xC3E3,
- 0xC3E4, 0xC3E5, 0xC3E6, 0xC3E7, 0xC3EA, 0xC3EB, 0xC3EC, 0xC3EE,
- 0xC3EF, 0xC3F0, 0xC3F1, 0xC3F2, 0xC3F3, 0xC3F6, 0xC3F7, 0xC3F9,
- 0xC3FA, 0xC3FB, 0xC3FC, 0xC3FD, 0xC3FE, 0xC3FF, 0xC400, 0xC401,
- 0xC402, 0xC403, 0xC404, 0xC405, 0xC406, 0xC407, 0xC409, 0xC40A,
- 0xC40B, 0xC40C, 0xC40D, 0xC40E, 0xC40F, 0xC411, 0xC412, 0xC413,
- 0xC414, 0xC415, 0xC416, 0xC417, 0xC418, 0xC419, 0xC41A, 0xC41B,
- 0xC41C, 0xC41D, 0xC41E, 0xC41F, 0xC420, 0xC421, 0xC422, 0xC423,
- 0xC425, 0xC426, 0xC427, 0xC428, 0xC429, 0xC42A, 0xC42B, 0xC42D,
- 0xC42E, 0xC42F, 0xC431, 0xC432, 0xC433, 0xC435, 0xC436, 0xC437,
- 0xC438, 0xC439, 0xC43A, 0xC43B, 0xC43E, 0xC43F, 0xC440, 0xC441,
- 0xC442, 0xC443, 0xC444, 0xC445, 0xC446, 0xC447, 0xC449, 0xC44A,
- 0xC44B, 0xC44C, 0xC44D, 0xC44E, 0xC44F, 0xC450, 0xC451, 0xC452,
- 0xC453, 0xC454, 0xC455, 0xC456, 0xC457, 0xC458, 0xC459, 0xC45A,
- 0xC45B, 0xC45C, 0xC45D, 0xC45E, 0xC45F, 0xC460, 0xC461, 0xC462,
- 0xC463, 0xC466, 0xC467, 0xC469, 0xC46A, 0xC46B, 0xC46D, 0xC46E,
- 0xC46F, 0xC470, 0xC471, 0xC472, 0xC473, 0xC476, 0xC477, 0xC478,
- 0xC47A, 0xC47B, 0xC47C, 0xC47D, 0xC47E, 0xC47F, 0xC481, 0xC482,
- 0xC483, 0xC484, 0xC485, 0xC486, 0xC487, 0xC488, 0xC489, 0xC48A,
- 0xC48B, 0xC48C, 0xC48D, 0xC48E, 0xC48F, 0xC490, 0xC491, 0xC492,
- 0xC493, 0xC495, 0xC496, 0xC497, 0xC498, 0xC499, 0xC49A, 0xC49B,
- 0xC49D, 0xC49E, 0xC49F, 0xC4A0, 0xC4A1, 0xC4A2, 0xC4A3, 0xC4A4,
- 0xC4A5, 0xC4A6, 0xC4A7, 0xC4A8, 0xC4A9, 0xC4AA, 0xC4AB, 0xC4AC,
- 0xC4AD, 0xC4AE, 0xC4AF, 0xC4B0, 0xC4B1, 0xC4B2, 0xC4B3, 0xC4B4,
- 0xC4B5, 0xC4B6, 0xC4B7, 0xC4B9, 0xC4BA, 0xC4BB, 0xC4BD, 0xC4BE,
- 0xC4BF, 0xC4C0, 0xC4C1, 0xC4C2, 0xC4C3, 0xC4C4, 0xC4C5, 0xC4C6,
- 0xC4C7, 0xC4C8, 0xC4C9, 0xC4CA, 0xC4CB, 0xC4CC, 0xC4CD, 0xC4CE,
- 0xC4CF, 0xC4D0, 0xC4D1, 0xC4D2, 0xC4D3, 0xC4D4, 0xC4D5, 0xC4D6,
- 0xC4D7, 0xC4D8, 0xC4D9, 0xC4DA, 0xC4DB, 0xC4DC, 0xC4DD, 0xC4DE,
- 0xC4DF, 0xC4E0, 0xC4E1, 0xC4E2, 0xC4E3, 0xC4E4, 0xC4E5, 0xC4E6,
- 0xC4E7, 0xC4E8, 0xC4EA, 0xC4EB, 0xC4EC, 0xC4ED, 0xC4EE, 0xC4EF,
- 0xC4F2, 0xC4F3, 0xC4F5, 0xC4F6, 0xC4F7, 0xC4F9, 0xC4FB, 0xC4FC,
- 0xC4FD, 0xC4FE, 0xC502, 0xC503, 0xC504, 0xC505, 0xC506, 0xC507,
- 0xC508, 0xC509, 0xC50A, 0xC50B, 0xC50D, 0xC50E, 0xC50F, 0xC511,
- 0xC512, 0xC513, 0xC515, 0xC516, 0xC517, 0xC518, 0xC519, 0xC51A,
- 0xC51B, 0xC51D, 0xC51E, 0xC51F, 0xC520, 0xC521, 0xC522, 0xC523,
- 0xC524, 0xC525, 0xC526, 0xC527, 0xC52A, 0xC52B, 0xC52D, 0xC52E,
- 0xC52F, 0xC531, 0xC532, 0xC533, 0xC534, 0xC535, 0xC536, 0xC537,
- 0xC53A, 0xC53C, 0xC53E, 0xC53F, 0xC540, 0xC541, 0xC542, 0xC543,
- 0xC546, 0xC547, 0xC54B, 0xC54F, 0xC550, 0xC551, 0xC552, 0xC556,
- 0xC55A, 0xC55B, 0xC55C, 0xC55F, 0xC562, 0xC563, 0xC565, 0xC566,
- 0xC567, 0xC569, 0xC56A, 0xC56B, 0xC56C, 0xC56D, 0xC56E, 0xC56F,
- 0xC572, 0xC576, 0xC577, 0xC578, 0xC579, 0xC57A, 0xC57B, 0xC57E,
- 0xC57F, 0xC581, 0xC582, 0xC583, 0xC585, 0xC586, 0xC588, 0xC589,
- 0xC58A, 0xC58B, 0xC58E, 0xC590, 0xC592, 0xC593, 0xC594, 0xC596,
- 0xC599, 0xC59A, 0xC59B, 0xC59D, 0xC59E, 0xC59F, 0xC5A1, 0xC5A2,
- 0xC5A3, 0xC5A4, 0xC5A5, 0xC5A6, 0xC5A7, 0xC5A8, 0xC5AA, 0xC5AB,
- 0xC5AC, 0xC5AD, 0xC5AE, 0xC5AF, 0xC5B0, 0xC5B1, 0xC5B2, 0xC5B3,
- 0xC5B6, 0xC5B7, 0xC5BA, 0xC5BF, 0xC5C0, 0xC5C1, 0xC5C2, 0xC5C3,
- 0xC5CB, 0xC5CD, 0xC5CF, 0xC5D2, 0xC5D3, 0xC5D5, 0xC5D6, 0xC5D7,
- 0xC5D9, 0xC5DA, 0xC5DB, 0xC5DC, 0xC5DD, 0xC5DE, 0xC5DF, 0xC5E2,
- 0xC5E4, 0xC5E6, 0xC5E7, 0xC5E8, 0xC5E9, 0xC5EA, 0xC5EB, 0xC5EF,
- 0xC5F1, 0xC5F2, 0xC5F3, 0xC5F5, 0xC5F8, 0xC5F9, 0xC5FA, 0xC5FB,
- 0xC602, 0xC603, 0xC604, 0xC609, 0xC60A, 0xC60B, 0xC60D, 0xC60E,
- 0xC60F, 0xC611, 0xC612, 0xC613, 0xC614, 0xC615, 0xC616, 0xC617,
- 0xC61A, 0xC61D, 0xC61E, 0xC61F, 0xC620, 0xC621, 0xC622, 0xC623,
- 0xC626, 0xC627, 0xC629, 0xC62A, 0xC62B, 0xC62F, 0xC631, 0xC632,
- 0xC636, 0xC638, 0xC63A, 0xC63C, 0xC63D, 0xC63E, 0xC63F, 0xC642,
- 0xC643, 0xC645, 0xC646, 0xC647, 0xC649, 0xC64A, 0xC64B, 0xC64C,
- 0xC64D, 0xC64E, 0xC64F, 0xC652, 0xC656, 0xC657, 0xC658, 0xC659,
- 0xC65A, 0xC65B, 0xC65E, 0xC65F, 0xC661, 0xC662, 0xC663, 0xC664,
- 0xC665, 0xC666, 0xC667, 0xC668, 0xC669, 0xC66A, 0xC66B, 0xC66D,
- 0xC66E, 0xC670, 0xC672, 0xC673, 0xC674, 0xC675, 0xC676, 0xC677,
- 0xC67A, 0xC67B, 0xC67D, 0xC67E, 0xC67F, 0xC681, 0xC682, 0xC683,
- 0xC684, 0xC685, 0xC686, 0xC687, 0xC68A, 0xC68C, 0xC68E, 0xC68F,
- 0xC690, 0xC691, 0xC692, 0xC693, 0xC696, 0xC697, 0xC699, 0xC69A,
- 0xC69B, 0xC69D, 0xC69E, 0xC69F, 0xC6A0, 0xC6A1, 0xC6A2, 0xC6A3,
- 0xC6A6, 0xC6A8, 0xC6AA, 0xC6AB, 0xC6AC, 0xC6AD, 0xC6AE, 0xC6AF,
- 0xC6B2, 0xC6B3, 0xC6B5, 0xC6B6, 0xC6B7, 0xC6BB, 0xC6BC, 0xC6BD,
- 0xC6BE, 0xC6BF, 0xC6C2, 0xC6C4, 0xC6C6, 0xC6C7, 0xC6C8, 0xC6C9,
- 0xC6CA, 0xC6CB, 0xC6CE, 0xC6CF, 0xC6D1, 0xC6D2, 0xC6D3, 0xC6D5,
- 0xC6D6, 0xC6D7, 0xC6D8, 0xC6D9, 0xC6DA, 0xC6DB, 0xC6DE, 0xC6DF,
- 0xC6E2, 0xC6E3, 0xC6E4, 0xC6E5, 0xC6E6, 0xC6E7, 0xC6EA, 0xC6EB,
- 0xC6ED, 0xC6EE, 0xC6EF, 0xC6F1, 0xC6F2, 0xC6F3, 0xC6F4, 0xC6F5,
- 0xC6F6, 0xC6F7, 0xC6FA, 0xC6FB, 0xC6FC, 0xC6FE, 0xC6FF, 0xC700,
- 0xC701, 0xC702, 0xC703, 0xC706, 0xC707, 0xC709, 0xC70A, 0xC70B,
- 0xC70D, 0xC70E, 0xC70F, 0xC710, 0xC711, 0xC712, 0xC713, 0xC716,
- 0xC718, 0xC71A, 0xC71B, 0xC71C, 0xC71D, 0xC71E, 0xC71F, 0xC722,
- 0xC723, 0xC725, 0xC726, 0xC727, 0xC729, 0xC72A, 0xC72B, 0xC72C,
- 0xC72D, 0xC72E, 0xC72F, 0xC732, 0xC734, 0xC736, 0xC738, 0xC739,
- 0xC73A, 0xC73B, 0xC73E, 0xC73F, 0xC741, 0xC742, 0xC743, 0xC745,
- 0xC746, 0xC747, 0xC748, 0xC749, 0xC74B, 0xC74E, 0xC750, 0xC759,
- 0xC75A, 0xC75B, 0xC75D, 0xC75E, 0xC75F, 0xC761, 0xC762, 0xC763,
- 0xC764, 0xC765, 0xC766, 0xC767, 0xC769, 0xC76A, 0xC76C, 0xC76D,
- 0xC76E, 0xC76F, 0xC770, 0xC771, 0xC772, 0xC773, 0xC776, 0xC777,
- 0xC779, 0xC77A, 0xC77B, 0xC77F, 0xC780, 0xC781, 0xC782, 0xC786,
- 0xC78B, 0xC78C, 0xC78D, 0xC78F, 0xC792, 0xC793, 0xC795, 0xC799,
- 0xC79B, 0xC79C, 0xC79D, 0xC79E, 0xC79F, 0xC7A2, 0xC7A7, 0xC7A8,
- 0xC7A9, 0xC7AA, 0xC7AB, 0xC7AE, 0xC7AF, 0xC7B1, 0xC7B2, 0xC7B3,
- 0xC7B5, 0xC7B6, 0xC7B7, 0xC7B8, 0xC7B9, 0xC7BA, 0xC7BB, 0xC7BE,
- 0xC7C2, 0xC7C3, 0xC7C4, 0xC7C5, 0xC7C6, 0xC7C7, 0xC7CA, 0xC7CB,
- 0xC7CD, 0xC7CF, 0xC7D1, 0xC7D2, 0xC7D3, 0xC7D4, 0xC7D5, 0xC7D6,
- 0xC7D7, 0xC7D9, 0xC7DA, 0xC7DB, 0xC7DC, 0xC7DE, 0xC7DF, 0xC7E0,
- 0xC7E1, 0xC7E2, 0xC7E3, 0xC7E5, 0xC7E6, 0xC7E7, 0xC7E9, 0xC7EA,
- 0xC7EB, 0xC7ED, 0xC7EE, 0xC7EF, 0xC7F0, 0xC7F1, 0xC7F2, 0xC7F3,
- 0xC7F4, 0xC7F5, 0xC7F6, 0xC7F7, 0xC7F8, 0xC7F9, 0xC7FA, 0xC7FB,
- 0xC7FC, 0xC7FD, 0xC7FE, 0xC7FF, 0xC802, 0xC803, 0xC805, 0xC806,
- 0xC807, 0xC809, 0xC80B, 0xC80C, 0xC80D, 0xC80E, 0xC80F, 0xC812,
- 0xC814, 0xC817, 0xC818, 0xC819, 0xC81A, 0xC81B, 0xC81E, 0xC81F,
- 0xC821, 0xC822, 0xC823, 0xC825, 0xC826, 0xC827, 0xC828, 0xC829,
- 0xC82A, 0xC82B, 0xC82E, 0xC830, 0xC832, 0xC833, 0xC834, 0xC835,
- 0xC836, 0xC837, 0xC839, 0xC83A, 0xC83B, 0xC83D, 0xC83E, 0xC83F,
- 0xC841, 0xC842, 0xC843, 0xC844, 0xC845, 0xC846, 0xC847, 0xC84A,
- 0xC84B, 0xC84E, 0xC84F, 0xC850, 0xC851, 0xC852, 0xC853, 0xC855,
- 0xC856, 0xC857, 0xC858, 0xC859, 0xC85A, 0xC85B, 0xC85C, 0xC85D,
- 0xC85E, 0xC85F, 0xC860, 0xC861, 0xC862, 0xC863, 0xC864, 0xC865,
- 0xC866, 0xC867, 0xC868, 0xC869, 0xC86A, 0xC86B, 0xC86C, 0xC86D,
- 0xC86E, 0xC86F, 0xC872, 0xC873, 0xC875, 0xC876, 0xC877, 0xC879,
- 0xC87B, 0xC87C, 0xC87D, 0xC87E, 0xC87F, 0xC882, 0xC884, 0xC888,
- 0xC889, 0xC88A, 0xC88E, 0xC88F, 0xC890, 0xC891, 0xC892, 0xC893,
- 0xC895, 0xC896, 0xC897, 0xC898, 0xC899, 0xC89A, 0xC89B, 0xC89C,
- 0xC89E, 0xC8A0, 0xC8A2, 0xC8A3, 0xC8A4, 0xC8A5, 0xC8A6, 0xC8A7,
- 0xC8A9, 0xC8AA, 0xC8AB, 0xC8AC, 0xC8AD, 0xC8AE, 0xC8AF, 0xC8B0,
- 0xC8B1, 0xC8B2, 0xC8B3, 0xC8B4, 0xC8B5, 0xC8B6, 0xC8B7, 0xC8B8,
- 0xC8B9, 0xC8BA, 0xC8BB, 0xC8BE, 0xC8BF, 0xC8C0, 0xC8C1, 0xC8C2,
- 0xC8C3, 0xC8C5, 0xC8C6, 0xC8C7, 0xC8C9, 0xC8CA, 0xC8CB, 0xC8CD,
- 0xC8CE, 0xC8CF, 0xC8D0, 0xC8D1, 0xC8D2, 0xC8D3, 0xC8D6, 0xC8D8,
- 0xC8DA, 0xC8DB, 0xC8DC, 0xC8DD, 0xC8DE, 0xC8DF, 0xC8E2, 0xC8E3,
- 0xC8E5, 0xC8E6, 0xC8E7, 0xC8E8, 0xC8E9, 0xC8EA, 0xC8EB, 0xC8EC,
- 0xC8ED, 0xC8EE, 0xC8EF, 0xC8F0, 0xC8F1, 0xC8F2, 0xC8F3, 0xC8F4,
- 0xC8F6, 0xC8F7, 0xC8F8, 0xC8F9, 0xC8FA, 0xC8FB, 0xC8FE, 0xC8FF,
- 0xC901, 0xC902, 0xC903, 0xC907, 0xC908, 0xC909, 0xC90A, 0xC90B,
- 0xC90E, 0xC910, 0xC912, 0xC913, 0xC914, 0xC915, 0xC916, 0xC917,
- 0xC919, 0xC91A, 0xC91B, 0xC91C, 0xC91D, 0xC91E, 0xC91F, 0xC920,
- 0xC921, 0xC922, 0xC923, 0xC924, 0xC925, 0xC926, 0xC927, 0xC928,
- 0xC929, 0xC92A, 0xC92B, 0xC92D, 0xC92E, 0xC92F, 0xC930, 0xC931,
- 0xC932, 0xC933, 0xC935, 0xC936, 0xC937, 0xC938, 0xC939, 0xC93A,
- 0xC93B, 0xC93C, 0xC93D, 0xC93E, 0xC93F, 0xC940, 0xC941, 0xC942,
- 0xC943, 0xC944, 0xC945, 0xC946, 0xC947, 0xC948, 0xC949, 0xC94A,
- 0xC94B, 0xC94C, 0xC94D, 0xC94E, 0xC94F, 0xC952, 0xC953, 0xC955,
- 0xC956, 0xC957, 0xC959, 0xC95A, 0xC95B, 0xC95C, 0xC95D, 0xC95E,
- 0xC95F, 0xC962, 0xC964, 0xC965, 0xC966, 0xC967, 0xC968, 0xC969,
- 0xC96A, 0xC96B, 0xC96D, 0xC96E, 0xC96F, 0xC971, 0xC972, 0xC973,
- 0xC975, 0xC976, 0xC977, 0xC978, 0xC979, 0xC97A, 0xC97B, 0xC97D,
- 0xC97E, 0xC97F, 0xC980, 0xC981, 0xC982, 0xC983, 0xC984, 0xC985,
- 0xC986, 0xC987, 0xC98A, 0xC98B, 0xC98D, 0xC98E, 0xC98F, 0xC991,
- 0xC992, 0xC993, 0xC994, 0xC995, 0xC996, 0xC997, 0xC99A, 0xC99C,
- 0xC99E, 0xC99F, 0xC9A0, 0xC9A1, 0xC9A2, 0xC9A3, 0xC9A4, 0xC9A5,
- 0xC9A6, 0xC9A7, 0xC9A8, 0xC9A9, 0xC9AA, 0xC9AB, 0xC9AC, 0xC9AD,
- 0xC9AE, 0xC9AF, 0xC9B0, 0xC9B1, 0xC9B2, 0xC9B3, 0xC9B4, 0xC9B5,
- 0xC9B6, 0xC9B7, 0xC9B8, 0xC9B9, 0xC9BA, 0xC9BB, 0xC9BC, 0xC9BD,
- 0xC9BE, 0xC9BF, 0xC9C2, 0xC9C3, 0xC9C5, 0xC9C6, 0xC9C9, 0xC9CB,
- 0xC9CC, 0xC9CD, 0xC9CE, 0xC9CF, 0xC9D2, 0xC9D4, 0xC9D7, 0xC9D8,
- 0xC9DB, 0xC9DE, 0xC9DF, 0xC9E1, 0xC9E3, 0xC9E5, 0xC9E6, 0xC9E8,
- 0xC9E9, 0xC9EA, 0xC9EB, 0xC9EE, 0xC9F2, 0xC9F3, 0xC9F4, 0xC9F5,
- 0xC9F6, 0xC9F7, 0xC9FA, 0xC9FB, 0xC9FD, 0xC9FE, 0xC9FF, 0xCA01,
- 0xCA02, 0xCA03, 0xCA04, 0xCA05, 0xCA06, 0xCA07, 0xCA0A, 0xCA0E,
- 0xCA0F, 0xCA10, 0xCA11, 0xCA12, 0xCA13, 0xCA15, 0xCA16, 0xCA17,
- 0xCA19, 0xCA1A, 0xCA1B, 0xCA1C, 0xCA1D, 0xCA1E, 0xCA1F, 0xCA20,
- 0xCA21, 0xCA22, 0xCA23, 0xCA24, 0xCA25, 0xCA26, 0xCA27, 0xCA28,
- 0xCA2A, 0xCA2B, 0xCA2C, 0xCA2D, 0xCA2E, 0xCA2F, 0xCA30, 0xCA31,
- 0xCA32, 0xCA33, 0xCA34, 0xCA35, 0xCA36, 0xCA37, 0xCA38, 0xCA39,
- 0xCA3A, 0xCA3B, 0xCA3C, 0xCA3D, 0xCA3E, 0xCA3F, 0xCA40, 0xCA41,
- 0xCA42, 0xCA43, 0xCA44, 0xCA45, 0xCA46, 0xCA47, 0xCA48, 0xCA49,
- 0xCA4A, 0xCA4B, 0xCA4E, 0xCA4F, 0xCA51, 0xCA52, 0xCA53, 0xCA55,
- 0xCA56, 0xCA57, 0xCA58, 0xCA59, 0xCA5A, 0xCA5B, 0xCA5E, 0xCA62,
- 0xCA63, 0xCA64, 0xCA65, 0xCA66, 0xCA67, 0xCA69, 0xCA6A, 0xCA6B,
- 0xCA6C, 0xCA6D, 0xCA6E, 0xCA6F, 0xCA70, 0xCA71, 0xCA72, 0xCA73,
- 0xCA74, 0xCA75, 0xCA76, 0xCA77, 0xCA78, 0xCA79, 0xCA7A, 0xCA7B,
- 0xCA7C, 0xCA7E, 0xCA7F, 0xCA80, 0xCA81, 0xCA82, 0xCA83, 0xCA85,
- 0xCA86, 0xCA87, 0xCA88, 0xCA89, 0xCA8A, 0xCA8B, 0xCA8C, 0xCA8D,
- 0xCA8E, 0xCA8F, 0xCA90, 0xCA91, 0xCA92, 0xCA93, 0xCA94, 0xCA95,
- 0xCA96, 0xCA97, 0xCA99, 0xCA9A, 0xCA9B, 0xCA9C, 0xCA9D, 0xCA9E,
- 0xCA9F, 0xCAA0, 0xCAA1, 0xCAA2, 0xCAA3, 0xCAA4, 0xCAA5, 0xCAA6,
- 0xCAA7, 0xCAA8, 0xCAA9, 0xCAAA, 0xCAAB, 0xCAAC, 0xCAAD, 0xCAAE,
- 0xCAAF, 0xCAB0, 0xCAB1, 0xCAB2, 0xCAB3, 0xCAB4, 0xCAB5, 0xCAB6,
- 0xCAB7, 0xCAB8, 0xCAB9, 0xCABA, 0xCABB, 0xCABE, 0xCABF, 0xCAC1,
- 0xCAC2, 0xCAC3, 0xCAC5, 0xCAC6, 0xCAC7, 0xCAC8, 0xCAC9, 0xCACA,
- 0xCACB, 0xCACE, 0xCAD0, 0xCAD2, 0xCAD4, 0xCAD5, 0xCAD6, 0xCAD7,
- 0xCADA, 0xCADB, 0xCADC, 0xCADD, 0xCADE, 0xCADF, 0xCAE1, 0xCAE2,
- 0xCAE3, 0xCAE4, 0xCAE5, 0xCAE6, 0xCAE7, 0xCAE8, 0xCAE9, 0xCAEA,
- 0xCAEB, 0xCAED, 0xCAEE, 0xCAEF, 0xCAF0, 0xCAF1, 0xCAF2, 0xCAF3,
- 0xCAF5, 0xCAF6, 0xCAF7, 0xCAF8, 0xCAF9, 0xCAFA, 0xCAFB, 0xCAFC,
- 0xCAFD, 0xCAFE, 0xCAFF, 0xCB00, 0xCB01, 0xCB02, 0xCB03, 0xCB04,
- 0xCB05, 0xCB06, 0xCB07, 0xCB09, 0xCB0A, 0xCB0B, 0xCB0C, 0xCB0D,
- 0xCB0E, 0xCB0F, 0xCB11, 0xCB12, 0xCB13, 0xCB15, 0xCB16, 0xCB17,
- 0xCB19, 0xCB1A, 0xCB1B, 0xCB1C, 0xCB1D, 0xCB1E, 0xCB1F, 0xCB22,
- 0xCB23, 0xCB24, 0xCB25, 0xCB26, 0xCB27, 0xCB28, 0xCB29, 0xCB2A,
- 0xCB2B, 0xCB2C, 0xCB2D, 0xCB2E, 0xCB2F, 0xCB30, 0xCB31, 0xCB32,
- 0xCB33, 0xCB34, 0xCB35, 0xCB36, 0xCB37, 0xCB38, 0xCB39, 0xCB3A,
- 0xCB3B, 0xCB3C, 0xCB3D, 0xCB3E, 0xCB3F, 0xCB40, 0xCB42, 0xCB43,
- 0xCB44, 0xCB45, 0xCB46, 0xCB47, 0xCB4A, 0xCB4B, 0xCB4D, 0xCB4E,
- 0xCB4F, 0xCB51, 0xCB52, 0xCB53, 0xCB54, 0xCB55, 0xCB56, 0xCB57,
- 0xCB5A, 0xCB5B, 0xCB5C, 0xCB5E, 0xCB5F, 0xCB60, 0xCB61, 0xCB62,
- 0xCB63, 0xCB65, 0xCB66, 0xCB67, 0xCB68, 0xCB69, 0xCB6A, 0xCB6B,
- 0xCB6C, 0xCB6D, 0xCB6E, 0xCB6F, 0xCB70, 0xCB71, 0xCB72, 0xCB73,
- 0xCB74, 0xCB75, 0xCB76, 0xCB77, 0xCB7A, 0xCB7B, 0xCB7C, 0xCB7D,
- 0xCB7E, 0xCB7F, 0xCB80, 0xCB81, 0xCB82, 0xCB83, 0xCB84, 0xCB85,
- 0xCB86, 0xCB87, 0xCB88, 0xCB89, 0xCB8A, 0xCB8B, 0xCB8C, 0xCB8D,
- 0xCB8E, 0xCB8F, 0xCB90, 0xCB91, 0xCB92, 0xCB93, 0xCB94, 0xCB95,
- 0xCB96, 0xCB97, 0xCB98, 0xCB99, 0xCB9A, 0xCB9B, 0xCB9D, 0xCB9E,
- 0xCB9F, 0xCBA0, 0xCBA1, 0xCBA2, 0xCBA3, 0xCBA4, 0xCBA5, 0xCBA6,
- 0xCBA7, 0xCBA8, 0xCBA9, 0xCBAA, 0xCBAB, 0xCBAC, 0xCBAD, 0xCBAE,
- 0xCBAF, 0xCBB0, 0xCBB1, 0xCBB2, 0xCBB3, 0xCBB4, 0xCBB5, 0xCBB6,
- 0xCBB7, 0xCBB9, 0xCBBA, 0xCBBB, 0xCBBC, 0xCBBD, 0xCBBE, 0xCBBF,
- 0xCBC0, 0xCBC1, 0xCBC2, 0xCBC3, 0xCBC4, 0xCBC5, 0xCBC6, 0xCBC7,
- 0xCBC8, 0xCBC9, 0xCBCA, 0xCBCB, 0xCBCC, 0xCBCD, 0xCBCE, 0xCBCF,
- 0xCBD0, 0xCBD1, 0xCBD2, 0xCBD3, 0xCBD5, 0xCBD6, 0xCBD7, 0xCBD8,
- 0xCBD9, 0xCBDA, 0xCBDB, 0xCBDC, 0xCBDD, 0xCBDE, 0xCBDF, 0xCBE0,
- 0xCBE1, 0xCBE2, 0xCBE3, 0xCBE5, 0xCBE6, 0xCBE8, 0xCBEA, 0xCBEB,
- 0xCBEC, 0xCBED, 0xCBEE, 0xCBEF, 0xCBF0, 0xCBF1, 0xCBF2, 0xCBF3,
- 0xCBF4, 0xCBF5, 0xCBF6, 0xCBF7, 0xCBF8, 0xCBF9, 0xCBFA, 0xCBFB,
- 0xCBFC, 0xCBFD, 0xCBFE, 0xCBFF, 0xCC00, 0xCC01, 0xCC02, 0xCC03,
- 0xCC04, 0xCC05, 0xCC06, 0xCC07, 0xCC08, 0xCC09, 0xCC0A, 0xCC0B,
- 0xCC0E, 0xCC0F, 0xCC11, 0xCC12, 0xCC13, 0xCC15, 0xCC16, 0xCC17,
- 0xCC18, 0xCC19, 0xCC1A, 0xCC1B, 0xCC1E, 0xCC1F, 0xCC20, 0xCC23,
- 0xCC24, 0xCC25, 0xCC26, 0xCC2A, 0xCC2B, 0xCC2D, 0xCC2F, 0xCC31,
- 0xCC32, 0xCC33, 0xCC34, 0xCC35, 0xCC36, 0xCC37, 0xCC3A, 0xCC3F,
- 0xCC40, 0xCC41, 0xCC42, 0xCC43, 0xCC46, 0xCC47, 0xCC49, 0xCC4A,
- 0xCC4B, 0xCC4D, 0xCC4E, 0xCC4F, 0xCC50, 0xCC51, 0xCC52, 0xCC53,
- 0xCC56, 0xCC5A, 0xCC5B, 0xCC5C, 0xCC5D, 0xCC5E, 0xCC5F, 0xCC61,
- 0xCC62, 0xCC63, 0xCC65, 0xCC67, 0xCC69, 0xCC6A, 0xCC6B, 0xCC6C,
- 0xCC6D, 0xCC6E, 0xCC6F, 0xCC71, 0xCC72, 0xCC73, 0xCC74, 0xCC76,
- 0xCC77, 0xCC78, 0xCC79, 0xCC7A, 0xCC7B, 0xCC7C, 0xCC7D, 0xCC7E,
- 0xCC7F, 0xCC80, 0xCC81, 0xCC82, 0xCC83, 0xCC84, 0xCC85, 0xCC86,
- 0xCC87, 0xCC88, 0xCC89, 0xCC8A, 0xCC8B, 0xCC8C, 0xCC8D, 0xCC8E,
- 0xCC8F, 0xCC90, 0xCC91, 0xCC92, 0xCC93, 0xCC94, 0xCC95, 0xCC96,
- 0xCC97, 0xCC9A, 0xCC9B, 0xCC9D, 0xCC9E, 0xCC9F, 0xCCA1, 0xCCA2,
- 0xCCA3, 0xCCA4, 0xCCA5, 0xCCA6, 0xCCA7, 0xCCAA, 0xCCAE, 0xCCAF,
- 0xCCB0, 0xCCB1, 0xCCB2, 0xCCB3, 0xCCB6, 0xCCB7, 0xCCB9, 0xCCBA,
- 0xCCBB, 0xCCBD, 0xCCBE, 0xCCBF, 0xCCC0, 0xCCC1, 0xCCC2, 0xCCC3,
- 0xCCC6, 0xCCC8, 0xCCCA, 0xCCCB, 0xCCCC, 0xCCCD, 0xCCCE, 0xCCCF,
- 0xCCD1, 0xCCD2, 0xCCD3, 0xCCD5, 0xCCD6, 0xCCD7, 0xCCD8, 0xCCD9,
- 0xCCDA, 0xCCDB, 0xCCDC, 0xCCDD, 0xCCDE, 0xCCDF, 0xCCE0, 0xCCE1,
- 0xCCE2, 0xCCE3, 0xCCE5, 0xCCE6, 0xCCE7, 0xCCE8, 0xCCE9, 0xCCEA,
- 0xCCEB, 0xCCED, 0xCCEE, 0xCCEF, 0xCCF1, 0xCCF2, 0xCCF3, 0xCCF4,
- 0xCCF5, 0xCCF6, 0xCCF7, 0xCCF8, 0xCCF9, 0xCCFA, 0xCCFB, 0xCCFC,
- 0xCCFD, 0xCCFE, 0xCCFF, 0xCD00, 0xCD02, 0xCD03, 0xCD04, 0xCD05,
- 0xCD06, 0xCD07, 0xCD0A, 0xCD0B, 0xCD0D, 0xCD0E, 0xCD0F, 0xCD11,
- 0xCD12, 0xCD13, 0xCD14, 0xCD15, 0xCD16, 0xCD17, 0xCD1A, 0xCD1C,
- 0xCD1E, 0xCD1F, 0xCD20, 0xCD21, 0xCD22, 0xCD23, 0xCD25, 0xCD26,
- 0xCD27, 0xCD29, 0xCD2A, 0xCD2B, 0xCD2D, 0xCD2E, 0xCD2F, 0xCD30,
- 0xCD31, 0xCD32, 0xCD33, 0xCD34, 0xCD35, 0xCD36, 0xCD37, 0xCD38,
- 0xCD3A, 0xCD3B, 0xCD3C, 0xCD3D, 0xCD3E, 0xCD3F, 0xCD40, 0xCD41,
- 0xCD42, 0xCD43, 0xCD44, 0xCD45, 0xCD46, 0xCD47, 0xCD48, 0xCD49,
- 0xCD4A, 0xCD4B, 0xCD4C, 0xCD4D, 0xCD4E, 0xCD4F, 0xCD50, 0xCD51,
- 0xCD52, 0xCD53, 0xCD54, 0xCD55, 0xCD56, 0xCD57, 0xCD58, 0xCD59,
- 0xCD5A, 0xCD5B, 0xCD5D, 0xCD5E, 0xCD5F, 0xCD61, 0xCD62, 0xCD63,
- 0xCD65, 0xCD66, 0xCD67, 0xCD68, 0xCD69, 0xCD6A, 0xCD6B, 0xCD6E,
- 0xCD70, 0xCD72, 0xCD73, 0xCD74, 0xCD75, 0xCD76, 0xCD77, 0xCD79,
- 0xCD7A, 0xCD7B, 0xCD7C, 0xCD7D, 0xCD7E, 0xCD7F, 0xCD80, 0xCD81,
- 0xCD82, 0xCD83, 0xCD84, 0xCD85, 0xCD86, 0xCD87, 0xCD89, 0xCD8A,
- 0xCD8B, 0xCD8C, 0xCD8D, 0xCD8E, 0xCD8F, 0xCD90, 0xCD91, 0xCD92,
- 0xCD93, 0xCD96, 0xCD97, 0xCD99, 0xCD9A, 0xCD9B, 0xCD9D, 0xCD9E,
- 0xCD9F, 0xCDA0, 0xCDA1, 0xCDA2, 0xCDA3, 0xCDA6, 0xCDA8, 0xCDAA,
- 0xCDAB, 0xCDAC, 0xCDAD, 0xCDAE, 0xCDAF, 0xCDB1, 0xCDB2, 0xCDB3,
- 0xCDB4, 0xCDB5, 0xCDB6, 0xCDB7, 0xCDB8, 0xCDB9, 0xCDBA, 0xCDBB,
- 0xCDBC, 0xCDBD, 0xCDBE, 0xCDBF, 0xCDC0, 0xCDC1, 0xCDC2, 0xCDC3,
- 0xCDC5, 0xCDC6, 0xCDC7, 0xCDC8, 0xCDC9, 0xCDCA, 0xCDCB, 0xCDCD,
- 0xCDCE, 0xCDCF, 0xCDD1, 0xCDD2, 0xCDD3, 0xCDD4, 0xCDD5, 0xCDD6,
- 0xCDD7, 0xCDD8, 0xCDD9, 0xCDDA, 0xCDDB, 0xCDDC, 0xCDDD, 0xCDDE,
- 0xCDDF, 0xCDE0, 0xCDE1, 0xCDE2, 0xCDE3, 0xCDE4, 0xCDE5, 0xCDE6,
- 0xCDE7, 0xCDE9, 0xCDEA, 0xCDEB, 0xCDED, 0xCDEE, 0xCDEF, 0xCDF1,
- 0xCDF2, 0xCDF3, 0xCDF4, 0xCDF5, 0xCDF6, 0xCDF7, 0xCDFA, 0xCDFC,
- 0xCDFE, 0xCDFF, 0xCE00, 0xCE01, 0xCE02, 0xCE03, 0xCE05, 0xCE06,
- 0xCE07, 0xCE09, 0xCE0A, 0xCE0B, 0xCE0D, 0xCE0E, 0xCE0F, 0xCE10,
- 0xCE11, 0xCE12, 0xCE13, 0xCE15, 0xCE16, 0xCE17, 0xCE18, 0xCE1A,
- 0xCE1B, 0xCE1C, 0xCE1D, 0xCE1E, 0xCE1F, 0xCE22, 0xCE23, 0xCE25,
- 0xCE26, 0xCE27, 0xCE29, 0xCE2A, 0xCE2B, 0xCE2C, 0xCE2D, 0xCE2E,
- 0xCE2F, 0xCE32, 0xCE34, 0xCE36, 0xCE37, 0xCE38, 0xCE39, 0xCE3A,
- 0xCE3B, 0xCE3C, 0xCE3D, 0xCE3E, 0xCE3F, 0xCE40, 0xCE41, 0xCE42,
- 0xCE43, 0xCE44, 0xCE45, 0xCE46, 0xCE47, 0xCE48, 0xCE49, 0xCE4A,
- 0xCE4B, 0xCE4C, 0xCE4D, 0xCE4E, 0xCE4F, 0xCE50, 0xCE51, 0xCE52,
- 0xCE53, 0xCE54, 0xCE55, 0xCE56, 0xCE57, 0xCE5A, 0xCE5B, 0xCE5D,
- 0xCE5E, 0xCE62, 0xCE63, 0xCE64, 0xCE65, 0xCE66, 0xCE67, 0xCE6A,
- 0xCE6C, 0xCE6E, 0xCE6F, 0xCE70, 0xCE71, 0xCE72, 0xCE73, 0xCE76,
- 0xCE77, 0xCE79, 0xCE7A, 0xCE7B, 0xCE7D, 0xCE7E, 0xCE7F, 0xCE80,
- 0xCE81, 0xCE82, 0xCE83, 0xCE86, 0xCE88, 0xCE8A, 0xCE8B, 0xCE8C,
- 0xCE8D, 0xCE8E, 0xCE8F, 0xCE92, 0xCE93, 0xCE95, 0xCE96, 0xCE97,
- 0xCE99, 0xCE9A, 0xCE9B, 0xCE9C, 0xCE9D, 0xCE9E, 0xCE9F, 0xCEA2,
- 0xCEA6, 0xCEA7, 0xCEA8, 0xCEA9, 0xCEAA, 0xCEAB, 0xCEAE, 0xCEAF,
- 0xCEB0, 0xCEB1, 0xCEB2, 0xCEB3, 0xCEB4, 0xCEB5, 0xCEB6, 0xCEB7,
- 0xCEB8, 0xCEB9, 0xCEBA, 0xCEBB, 0xCEBC, 0xCEBD, 0xCEBE, 0xCEBF,
- 0xCEC0, 0xCEC2, 0xCEC3, 0xCEC4, 0xCEC5, 0xCEC6, 0xCEC7, 0xCEC8,
- 0xCEC9, 0xCECA, 0xCECB, 0xCECC, 0xCECD, 0xCECE, 0xCECF, 0xCED0,
- 0xCED1, 0xCED2, 0xCED3, 0xCED4, 0xCED5, 0xCED6, 0xCED7, 0xCED8,
- 0xCED9, 0xCEDA, 0xCEDB, 0xCEDC, 0xCEDD, 0xCEDE, 0xCEDF, 0xCEE0,
- 0xCEE1, 0xCEE2, 0xCEE3, 0xCEE6, 0xCEE7, 0xCEE9, 0xCEEA, 0xCEED,
- 0xCEEE, 0xCEEF, 0xCEF0, 0xCEF1, 0xCEF2, 0xCEF3, 0xCEF6, 0xCEFA,
- 0xCEFB, 0xCEFC, 0xCEFD, 0xCEFE, 0xCEFF, 0xCF02, 0xCF03, 0xCF05,
- 0xCF06, 0xCF07, 0xCF09, 0xCF0A, 0xCF0B, 0xCF0C, 0xCF0D, 0xCF0E,
- 0xCF0F, 0xCF12, 0xCF14, 0xCF16, 0xCF17, 0xCF18, 0xCF19, 0xCF1A,
- 0xCF1B, 0xCF1D, 0xCF1E, 0xCF1F, 0xCF21, 0xCF22, 0xCF23, 0xCF25,
- 0xCF26, 0xCF27, 0xCF28, 0xCF29, 0xCF2A, 0xCF2B, 0xCF2E, 0xCF32,
- 0xCF33, 0xCF34, 0xCF35, 0xCF36, 0xCF37, 0xCF39, 0xCF3A, 0xCF3B,
- 0xCF3C, 0xCF3D, 0xCF3E, 0xCF3F, 0xCF40, 0xCF41, 0xCF42, 0xCF43,
- 0xCF44, 0xCF45, 0xCF46, 0xCF47, 0xCF48, 0xCF49, 0xCF4A, 0xCF4B,
- 0xCF4C, 0xCF4D, 0xCF4E, 0xCF4F, 0xCF50, 0xCF51, 0xCF52, 0xCF53,
- 0xCF56, 0xCF57, 0xCF59, 0xCF5A, 0xCF5B, 0xCF5D, 0xCF5E, 0xCF5F,
- 0xCF60, 0xCF61, 0xCF62, 0xCF63, 0xCF66, 0xCF68, 0xCF6A, 0xCF6B,
- 0xCF6C, 0xCF6D, 0xCF6E, 0xCF6F, 0xCF72, 0xCF73, 0xCF75, 0xCF76,
- 0xCF77, 0xCF79, 0xCF7A, 0xCF7B, 0xCF7C, 0xCF7D, 0xCF7E, 0xCF7F,
- 0xCF81, 0xCF82, 0xCF83, 0xCF84, 0xCF86, 0xCF87, 0xCF88, 0xCF89,
- 0xCF8A, 0xCF8B, 0xCF8D, 0xCF8E, 0xCF8F, 0xCF90, 0xCF91, 0xCF92,
- 0xCF93, 0xCF94, 0xCF95, 0xCF96, 0xCF97, 0xCF98, 0xCF99, 0xCF9A,
- 0xCF9B, 0xCF9C, 0xCF9D, 0xCF9E, 0xCF9F, 0xCFA0, 0xCFA2, 0xCFA3,
- 0xCFA4, 0xCFA5, 0xCFA6, 0xCFA7, 0xCFA9, 0xCFAA, 0xCFAB, 0xCFAC,
- 0xCFAD, 0xCFAE, 0xCFAF, 0xCFB1, 0xCFB2, 0xCFB3, 0xCFB4, 0xCFB5,
- 0xCFB6, 0xCFB7, 0xCFB8, 0xCFB9, 0xCFBA, 0xCFBB, 0xCFBC, 0xCFBD,
- 0xCFBE, 0xCFBF, 0xCFC0, 0xCFC1, 0xCFC2, 0xCFC3, 0xCFC5, 0xCFC6,
- 0xCFC7, 0xCFC8, 0xCFC9, 0xCFCA, 0xCFCB, 0xCFCC, 0xCFCD, 0xCFCE,
- 0xCFCF, 0xCFD0, 0xCFD1, 0xCFD2, 0xCFD3, 0xCFD4, 0xCFD5, 0xCFD6,
- 0xCFD7, 0xCFD8, 0xCFD9, 0xCFDA, 0xCFDB, 0xCFDC, 0xCFDD, 0xCFDE,
- 0xCFDF, 0xCFE2, 0xCFE3, 0xCFE5, 0xCFE6, 0xCFE7, 0xCFE9, 0xCFEA,
- 0xCFEB, 0xCFEC, 0xCFED, 0xCFEE, 0xCFEF, 0xCFF2, 0xCFF4, 0xCFF6,
- 0xCFF7, 0xCFF8, 0xCFF9, 0xCFFA, 0xCFFB, 0xCFFD, 0xCFFE, 0xCFFF,
- 0xD001, 0xD002, 0xD003, 0xD005, 0xD006, 0xD007, 0xD008, 0xD009,
- 0xD00A, 0xD00B, 0xD00C, 0xD00D, 0xD00E, 0xD00F, 0xD010, 0xD012,
- 0xD013, 0xD014, 0xD015, 0xD016, 0xD017, 0xD019, 0xD01A, 0xD01B,
- 0xD01C, 0xD01D, 0xD01E, 0xD01F, 0xD020, 0xD021, 0xD022, 0xD023,
- 0xD024, 0xD025, 0xD026, 0xD027, 0xD028, 0xD029, 0xD02A, 0xD02B,
- 0xD02C, 0xD02E, 0xD02F, 0xD030, 0xD031, 0xD032, 0xD033, 0xD036,
- 0xD037, 0xD039, 0xD03A, 0xD03B, 0xD03D, 0xD03E, 0xD03F, 0xD040,
- 0xD041, 0xD042, 0xD043, 0xD046, 0xD048, 0xD04A, 0xD04B, 0xD04C,
- 0xD04D, 0xD04E, 0xD04F, 0xD051, 0xD052, 0xD053, 0xD055, 0xD056,
- 0xD057, 0xD059, 0xD05A, 0xD05B, 0xD05C, 0xD05D, 0xD05E, 0xD05F,
- 0xD061, 0xD062, 0xD063, 0xD064, 0xD065, 0xD066, 0xD067, 0xD068,
- 0xD069, 0xD06A, 0xD06B, 0xD06E, 0xD06F, 0xD071, 0xD072, 0xD073,
- 0xD075, 0xD076, 0xD077, 0xD078, 0xD079, 0xD07A, 0xD07B, 0xD07E,
- 0xD07F, 0xD080, 0xD082, 0xD083, 0xD084, 0xD085, 0xD086, 0xD087,
- 0xD088, 0xD089, 0xD08A, 0xD08B, 0xD08C, 0xD08D, 0xD08E, 0xD08F,
- 0xD090, 0xD091, 0xD092, 0xD093, 0xD094, 0xD095, 0xD096, 0xD097,
- 0xD098, 0xD099, 0xD09A, 0xD09B, 0xD09C, 0xD09D, 0xD09E, 0xD09F,
- 0xD0A0, 0xD0A1, 0xD0A2, 0xD0A3, 0xD0A6, 0xD0A7, 0xD0A9, 0xD0AA,
- 0xD0AB, 0xD0AD, 0xD0AE, 0xD0AF, 0xD0B0, 0xD0B1, 0xD0B2, 0xD0B3,
- 0xD0B6, 0xD0B8, 0xD0BA, 0xD0BB, 0xD0BC, 0xD0BD, 0xD0BE, 0xD0BF,
- 0xD0C2, 0xD0C3, 0xD0C5, 0xD0C6, 0xD0C7, 0xD0CA, 0xD0CB, 0xD0CC,
- 0xD0CD, 0xD0CE, 0xD0CF, 0xD0D2, 0xD0D6, 0xD0D7, 0xD0D8, 0xD0D9,
- 0xD0DA, 0xD0DB, 0xD0DE, 0xD0DF, 0xD0E1, 0xD0E2, 0xD0E3, 0xD0E5,
- 0xD0E6, 0xD0E7, 0xD0E8, 0xD0E9, 0xD0EA, 0xD0EB, 0xD0EE, 0xD0F2,
- 0xD0F3, 0xD0F4, 0xD0F5, 0xD0F6, 0xD0F7, 0xD0F9, 0xD0FA, 0xD0FB,
- 0xD0FC, 0xD0FD, 0xD0FE, 0xD0FF, 0xD100, 0xD101, 0xD102, 0xD103,
- 0xD104, 0xD105, 0xD106, 0xD107, 0xD108, 0xD109, 0xD10A, 0xD10B,
- 0xD10C, 0xD10E, 0xD10F, 0xD110, 0xD111, 0xD112, 0xD113, 0xD114,
- 0xD115, 0xD116, 0xD117, 0xD118, 0xD119, 0xD11A, 0xD11B, 0xD11C,
- 0xD11D, 0xD11E, 0xD11F, 0xD120, 0xD121, 0xD122, 0xD123, 0xD124,
- 0xD125, 0xD126, 0xD127, 0xD128, 0xD129, 0xD12A, 0xD12B, 0xD12C,
- 0xD12D, 0xD12E, 0xD12F, 0xD132, 0xD133, 0xD135, 0xD136, 0xD137,
- 0xD139, 0xD13B, 0xD13C, 0xD13D, 0xD13E, 0xD13F, 0xD142, 0xD146,
- 0xD147, 0xD148, 0xD149, 0xD14A, 0xD14B, 0xD14E, 0xD14F, 0xD151,
- 0xD152, 0xD153, 0xD155, 0xD156, 0xD157, 0xD158, 0xD159, 0xD15A,
- 0xD15B, 0xD15E, 0xD160, 0xD162, 0xD163, 0xD164, 0xD165, 0xD166,
- 0xD167, 0xD169, 0xD16A, 0xD16B, 0xD16D, 0xD16E, 0xD16F, 0xD170,
- 0xD171, 0xD172, 0xD173, 0xD174, 0xD175, 0xD176, 0xD177, 0xD178,
- 0xD179, 0xD17A, 0xD17B, 0xD17D, 0xD17E, 0xD17F, 0xD180, 0xD181,
- 0xD182, 0xD183, 0xD185, 0xD186, 0xD187, 0xD189, 0xD18A, 0xD18B,
- 0xD18C, 0xD18D, 0xD18E, 0xD18F, 0xD190, 0xD191, 0xD192, 0xD193,
- 0xD194, 0xD195, 0xD196, 0xD197, 0xD198, 0xD199, 0xD19A, 0xD19B,
- 0xD19C, 0xD19D, 0xD19E, 0xD19F, 0xD1A2, 0xD1A3, 0xD1A5, 0xD1A6,
- 0xD1A7, 0xD1A9, 0xD1AA, 0xD1AB, 0xD1AC, 0xD1AD, 0xD1AE, 0xD1AF,
- 0xD1B2, 0xD1B4, 0xD1B6, 0xD1B7, 0xD1B8, 0xD1B9, 0xD1BB, 0xD1BD,
- 0xD1BE, 0xD1BF, 0xD1C1, 0xD1C2, 0xD1C3, 0xD1C4, 0xD1C5, 0xD1C6,
- 0xD1C7, 0xD1C8, 0xD1C9, 0xD1CA, 0xD1CB, 0xD1CC, 0xD1CD, 0xD1CE,
- 0xD1CF, 0xD1D0, 0xD1D1, 0xD1D2, 0xD1D3, 0xD1D4, 0xD1D5, 0xD1D6,
- 0xD1D7, 0xD1D9, 0xD1DA, 0xD1DB, 0xD1DC, 0xD1DD, 0xD1DE, 0xD1DF,
- 0xD1E0, 0xD1E1, 0xD1E2, 0xD1E3, 0xD1E4, 0xD1E5, 0xD1E6, 0xD1E7,
- 0xD1E8, 0xD1E9, 0xD1EA, 0xD1EB, 0xD1EC, 0xD1ED, 0xD1EE, 0xD1EF,
- 0xD1F0, 0xD1F1, 0xD1F2, 0xD1F3, 0xD1F5, 0xD1F6, 0xD1F7, 0xD1F9,
- 0xD1FA, 0xD1FB, 0xD1FC, 0xD1FD, 0xD1FE, 0xD1FF, 0xD200, 0xD201,
- 0xD202, 0xD203, 0xD204, 0xD205, 0xD206, 0xD208, 0xD20A, 0xD20B,
- 0xD20C, 0xD20D, 0xD20E, 0xD20F, 0xD211, 0xD212, 0xD213, 0xD214,
- 0xD215, 0xD216, 0xD217, 0xD218, 0xD219, 0xD21A, 0xD21B, 0xD21C,
- 0xD21D, 0xD21E, 0xD21F, 0xD220, 0xD221, 0xD222, 0xD223, 0xD224,
- 0xD225, 0xD226, 0xD227, 0xD228, 0xD229, 0xD22A, 0xD22B, 0xD22E,
- 0xD22F, 0xD231, 0xD232, 0xD233, 0xD235, 0xD236, 0xD237, 0xD238,
- 0xD239, 0xD23A, 0xD23B, 0xD23E, 0xD240, 0xD242, 0xD243, 0xD244,
- 0xD245, 0xD246, 0xD247, 0xD249, 0xD24A, 0xD24B, 0xD24C, 0xD24D,
- 0xD24E, 0xD24F, 0xD250, 0xD251, 0xD252, 0xD253, 0xD254, 0xD255,
- 0xD256, 0xD257, 0xD258, 0xD259, 0xD25A, 0xD25B, 0xD25D, 0xD25E,
- 0xD25F, 0xD260, 0xD261, 0xD262, 0xD263, 0xD265, 0xD266, 0xD267,
- 0xD268, 0xD269, 0xD26A, 0xD26B, 0xD26C, 0xD26D, 0xD26E, 0xD26F,
- 0xD270, 0xD271, 0xD272, 0xD273, 0xD274, 0xD275, 0xD276, 0xD277,
- 0xD278, 0xD279, 0xD27A, 0xD27B, 0xD27C, 0xD27D, 0xD27E, 0xD27F,
- 0xD282, 0xD283, 0xD285, 0xD286, 0xD287, 0xD289, 0xD28A, 0xD28B,
- 0xD28C, 0xD28D, 0xD28E, 0xD28F, 0xD292, 0xD293, 0xD294, 0xD296,
- 0xD297, 0xD298, 0xD299, 0xD29A, 0xD29B, 0xD29D, 0xD29E, 0xD29F,
- 0xD2A1, 0xD2A2, 0xD2A3, 0xD2A5, 0xD2A6, 0xD2A7, 0xD2A8, 0xD2A9,
- 0xD2AA, 0xD2AB, 0xD2AD, 0xD2AE, 0xD2AF, 0xD2B0, 0xD2B2, 0xD2B3,
- 0xD2B4, 0xD2B5, 0xD2B6, 0xD2B7, 0xD2BA, 0xD2BB, 0xD2BD, 0xD2BE,
- 0xD2C1, 0xD2C3, 0xD2C4, 0xD2C5, 0xD2C6, 0xD2C7, 0xD2CA, 0xD2CC,
- 0xD2CD, 0xD2CE, 0xD2CF, 0xD2D0, 0xD2D1, 0xD2D2, 0xD2D3, 0xD2D5,
- 0xD2D6, 0xD2D7, 0xD2D9, 0xD2DA, 0xD2DB, 0xD2DD, 0xD2DE, 0xD2DF,
- 0xD2E0, 0xD2E1, 0xD2E2, 0xD2E3, 0xD2E6, 0xD2E7, 0xD2E8, 0xD2E9,
- 0xD2EA, 0xD2EB, 0xD2EC, 0xD2ED, 0xD2EE, 0xD2EF, 0xD2F2, 0xD2F3,
- 0xD2F5, 0xD2F6, 0xD2F7, 0xD2F9, 0xD2FA, 0xD2FB, 0xD2FC, 0xD2FD,
- 0xD2FE, 0xD2FF, 0xD302, 0xD304, 0xD306, 0xD307, 0xD308, 0xD309,
- 0xD30A, 0xD30B, 0xD30F, 0xD311, 0xD312, 0xD313, 0xD315, 0xD317,
- 0xD318, 0xD319, 0xD31A, 0xD31B, 0xD31E, 0xD322, 0xD323, 0xD324,
- 0xD326, 0xD327, 0xD32A, 0xD32B, 0xD32D, 0xD32E, 0xD32F, 0xD331,
- 0xD332, 0xD333, 0xD334, 0xD335, 0xD336, 0xD337, 0xD33A, 0xD33E,
- 0xD33F, 0xD340, 0xD341, 0xD342, 0xD343, 0xD346, 0xD347, 0xD348,
- 0xD349, 0xD34A, 0xD34B, 0xD34C, 0xD34D, 0xD34E, 0xD34F, 0xD350,
- 0xD351, 0xD352, 0xD353, 0xD354, 0xD355, 0xD356, 0xD357, 0xD358,
- 0xD359, 0xD35A, 0xD35B, 0xD35C, 0xD35D, 0xD35E, 0xD35F, 0xD360,
- 0xD361, 0xD362, 0xD363, 0xD364, 0xD365, 0xD366, 0xD367, 0xD368,
- 0xD369, 0xD36A, 0xD36B, 0xD36C, 0xD36D, 0xD36E, 0xD36F, 0xD370,
- 0xD371, 0xD372, 0xD373, 0xD374, 0xD375, 0xD376, 0xD377, 0xD378,
- 0xD379, 0xD37A, 0xD37B, 0xD37E, 0xD37F, 0xD381, 0xD382, 0xD383,
- 0xD385, 0xD386, 0xD387, 0xD388, 0xD389, 0xD38A, 0xD38B, 0xD38E,
- 0xD392, 0xD393, 0xD394, 0xD395, 0xD396, 0xD397, 0xD39A, 0xD39B,
- 0xD39D, 0xD39E, 0xD39F, 0xD3A1, 0xD3A2, 0xD3A3, 0xD3A4, 0xD3A5,
- 0xD3A6, 0xD3A7, 0xD3AA, 0xD3AC, 0xD3AE, 0xD3AF, 0xD3B0, 0xD3B1,
- 0xD3B2, 0xD3B3, 0xD3B5, 0xD3B6, 0xD3B7, 0xD3B9, 0xD3BA, 0xD3BB,
- 0xD3BD, 0xD3BE, 0xD3BF, 0xD3C0, 0xD3C1, 0xD3C2, 0xD3C3, 0xD3C6,
- 0xD3C7, 0xD3CA, 0xD3CB, 0xD3CC, 0xD3CD, 0xD3CE, 0xD3CF, 0xD3D1,
- 0xD3D2, 0xD3D3, 0xD3D4, 0xD3D5, 0xD3D6, 0xD3D7, 0xD3D9, 0xD3DA,
- 0xD3DB, 0xD3DC, 0xD3DD, 0xD3DE, 0xD3DF, 0xD3E0, 0xD3E2, 0xD3E4,
- 0xD3E5, 0xD3E6, 0xD3E7, 0xD3E8, 0xD3E9, 0xD3EA, 0xD3EB, 0xD3EE,
- 0xD3EF, 0xD3F1, 0xD3F2, 0xD3F3, 0xD3F5, 0xD3F6, 0xD3F7, 0xD3F8,
- 0xD3F9, 0xD3FA, 0xD3FB, 0xD3FE, 0xD400, 0xD402, 0xD403, 0xD404,
- 0xD405, 0xD406, 0xD407, 0xD409, 0xD40A, 0xD40B, 0xD40C, 0xD40D,
- 0xD40E, 0xD40F, 0xD410, 0xD411, 0xD412, 0xD413, 0xD414, 0xD415,
- 0xD416, 0xD417, 0xD418, 0xD419, 0xD41A, 0xD41B, 0xD41C, 0xD41E,
- 0xD41F, 0xD420, 0xD421, 0xD422, 0xD423, 0xD424, 0xD425, 0xD426,
- 0xD427, 0xD428, 0xD429, 0xD42A, 0xD42B, 0xD42C, 0xD42D, 0xD42E,
- 0xD42F, 0xD430, 0xD431, 0xD432, 0xD433, 0xD434, 0xD435, 0xD436,
- 0xD437, 0xD438, 0xD439, 0xD43A, 0xD43B, 0xD43C, 0xD43D, 0xD43E,
- 0xD43F, 0xD441, 0xD442, 0xD443, 0xD445, 0xD446, 0xD447, 0xD448,
- 0xD449, 0xD44A, 0xD44B, 0xD44C, 0xD44D, 0xD44E, 0xD44F, 0xD450,
- 0xD451, 0xD452, 0xD453, 0xD454, 0xD455, 0xD456, 0xD457, 0xD458,
- 0xD459, 0xD45A, 0xD45B, 0xD45D, 0xD45E, 0xD45F, 0xD461, 0xD462,
- 0xD463, 0xD465, 0xD466, 0xD467, 0xD468, 0xD469, 0xD46A, 0xD46B,
- 0xD46C, 0xD46E, 0xD470, 0xD471, 0xD472, 0xD473, 0xD474, 0xD475,
- 0xD476, 0xD477, 0xD47A, 0xD47B, 0xD47D, 0xD47E, 0xD481, 0xD483,
- 0xD484, 0xD485, 0xD486, 0xD487, 0xD48A, 0xD48C, 0xD48E, 0xD48F,
- 0xD490, 0xD491, 0xD492, 0xD493, 0xD495, 0xD496, 0xD497, 0xD498,
- 0xD499, 0xD49A, 0xD49B, 0xD49C, 0xD49D, 0xD49E, 0xD49F, 0xD4A0,
- 0xD4A1, 0xD4A2, 0xD4A3, 0xD4A4, 0xD4A5, 0xD4A6, 0xD4A7, 0xD4A8,
- 0xD4AA, 0xD4AB, 0xD4AC, 0xD4AD, 0xD4AE, 0xD4AF, 0xD4B0, 0xD4B1,
- 0xD4B2, 0xD4B3, 0xD4B4, 0xD4B5, 0xD4B6, 0xD4B7, 0xD4B8, 0xD4B9,
- 0xD4BA, 0xD4BB, 0xD4BC, 0xD4BD, 0xD4BE, 0xD4BF, 0xD4C0, 0xD4C1,
- 0xD4C2, 0xD4C3, 0xD4C4, 0xD4C5, 0xD4C6, 0xD4C7, 0xD4C8, 0xD4C9,
- 0xD4CA, 0xD4CB, 0xD4CD, 0xD4CE, 0xD4CF, 0xD4D1, 0xD4D2, 0xD4D3,
- 0xD4D5, 0xD4D6, 0xD4D7, 0xD4D8, 0xD4D9, 0xD4DA, 0xD4DB, 0xD4DD,
- 0xD4DE, 0xD4E0, 0xD4E1, 0xD4E2, 0xD4E3, 0xD4E4, 0xD4E5, 0xD4E6,
- 0xD4E7, 0xD4E9, 0xD4EA, 0xD4EB, 0xD4ED, 0xD4EE, 0xD4EF, 0xD4F1,
- 0xD4F2, 0xD4F3, 0xD4F4, 0xD4F5, 0xD4F6, 0xD4F7, 0xD4F9, 0xD4FA,
- 0xD4FC, 0xD4FE, 0xD4FF, 0xD500, 0xD501, 0xD502, 0xD503, 0xD505,
- 0xD506, 0xD507, 0xD509, 0xD50A, 0xD50B, 0xD50D, 0xD50E, 0xD50F,
- 0xD510, 0xD511, 0xD512, 0xD513, 0xD516, 0xD518, 0xD519, 0xD51A,
- 0xD51B, 0xD51C, 0xD51D, 0xD51E, 0xD51F, 0xD520, 0xD521, 0xD522,
- 0xD523, 0xD524, 0xD525, 0xD526, 0xD527, 0xD528, 0xD529, 0xD52A,
- 0xD52B, 0xD52C, 0xD52D, 0xD52E, 0xD52F, 0xD530, 0xD531, 0xD532,
- 0xD533, 0xD534, 0xD535, 0xD536, 0xD537, 0xD538, 0xD539, 0xD53A,
- 0xD53B, 0xD53E, 0xD53F, 0xD541, 0xD542, 0xD543, 0xD545, 0xD546,
- 0xD547, 0xD548, 0xD549, 0xD54A, 0xD54B, 0xD54E, 0xD550, 0xD552,
- 0xD553, 0xD554, 0xD555, 0xD556, 0xD557, 0xD55A, 0xD55B, 0xD55D,
- 0xD55E, 0xD55F, 0xD561, 0xD562, 0xD563, 0xD564, 0xD566, 0xD567,
- 0xD56A, 0xD56C, 0xD56E, 0xD56F, 0xD570, 0xD571, 0xD572, 0xD573,
- 0xD576, 0xD577, 0xD579, 0xD57A, 0xD57B, 0xD57D, 0xD57E, 0xD57F,
- 0xD580, 0xD581, 0xD582, 0xD583, 0xD586, 0xD58A, 0xD58B, 0xD58C,
- 0xD58D, 0xD58E, 0xD58F, 0xD591, 0xD592, 0xD593, 0xD594, 0xD595,
- 0xD596, 0xD597, 0xD598, 0xD599, 0xD59A, 0xD59B, 0xD59C, 0xD59D,
- 0xD59E, 0xD59F, 0xD5A0, 0xD5A1, 0xD5A2, 0xD5A3, 0xD5A4, 0xD5A6,
- 0xD5A7, 0xD5A8, 0xD5A9, 0xD5AA, 0xD5AB, 0xD5AC, 0xD5AD, 0xD5AE,
- 0xD5AF, 0xD5B0, 0xD5B1, 0xD5B2, 0xD5B3, 0xD5B4, 0xD5B5, 0xD5B6,
- 0xD5B7, 0xD5B8, 0xD5B9, 0xD5BA, 0xD5BB, 0xD5BC, 0xD5BD, 0xD5BE,
- 0xD5BF, 0xD5C0, 0xD5C1, 0xD5C2, 0xD5C3, 0xD5C4, 0xD5C5, 0xD5C6,
- 0xD5C7, 0xD5CA, 0xD5CB, 0xD5CD, 0xD5CE, 0xD5CF, 0xD5D1, 0xD5D3,
- 0xD5D4, 0xD5D5, 0xD5D6, 0xD5D7, 0xD5DA, 0xD5DC, 0xD5DE, 0xD5DF,
- 0xD5E0, 0xD5E1, 0xD5E2, 0xD5E3, 0xD5E6, 0xD5E7, 0xD5E9, 0xD5EA,
- 0xD5EB, 0xD5ED, 0xD5EE, 0xD5EF, 0xD5F0, 0xD5F1, 0xD5F2, 0xD5F3,
- 0xD5F6, 0xD5F8, 0xD5FA, 0xD5FB, 0xD5FC, 0xD5FD, 0xD5FE, 0xD5FF,
- 0xD602, 0xD603, 0xD605, 0xD606, 0xD607, 0xD609, 0xD60A, 0xD60B,
- 0xD60C, 0xD60D, 0xD60E, 0xD60F, 0xD612, 0xD616, 0xD617, 0xD618,
- 0xD619, 0xD61A, 0xD61B, 0xD61D, 0xD61E, 0xD61F, 0xD621, 0xD622,
- 0xD623, 0xD625, 0xD626, 0xD627, 0xD628, 0xD629, 0xD62A, 0xD62B,
- 0xD62C, 0xD62E, 0xD62F, 0xD630, 0xD631, 0xD632, 0xD633, 0xD634,
- 0xD635, 0xD636, 0xD637, 0xD63A, 0xD63B, 0xD63D, 0xD63E, 0xD63F,
- 0xD641, 0xD642, 0xD643, 0xD644, 0xD646, 0xD647, 0xD64A, 0xD64C,
- 0xD64E, 0xD64F, 0xD650, 0xD652, 0xD653, 0xD656, 0xD657, 0xD659,
- 0xD65A, 0xD65B, 0xD65D, 0xD65E, 0xD65F, 0xD660, 0xD661, 0xD662,
- 0xD663, 0xD664, 0xD665, 0xD666, 0xD668, 0xD66A, 0xD66B, 0xD66C,
- 0xD66D, 0xD66E, 0xD66F, 0xD672, 0xD673, 0xD675, 0xD676, 0xD677,
- 0xD678, 0xD679, 0xD67A, 0xD67B, 0xD67C, 0xD67D, 0xD67E, 0xD67F,
- 0xD680, 0xD681, 0xD682, 0xD684, 0xD686, 0xD687, 0xD688, 0xD689,
- 0xD68A, 0xD68B, 0xD68E, 0xD68F, 0xD691, 0xD692, 0xD693, 0xD695,
- 0xD696, 0xD697, 0xD698, 0xD699, 0xD69A, 0xD69B, 0xD69C, 0xD69E,
- 0xD6A0, 0xD6A2, 0xD6A3, 0xD6A4, 0xD6A5, 0xD6A6, 0xD6A7, 0xD6A9,
- 0xD6AA, 0xD6AB, 0xD6AD, 0xD6AE, 0xD6AF, 0xD6B1, 0xD6B2, 0xD6B3,
- 0xD6B4, 0xD6B5, 0xD6B6, 0xD6B7, 0xD6B8, 0xD6BA, 0xD6BC, 0xD6BD,
- 0xD6BE, 0xD6BF, 0xD6C0, 0xD6C1, 0xD6C2, 0xD6C3, 0xD6C6, 0xD6C7,
- 0xD6C9, 0xD6CA, 0xD6CB, 0xD6CD, 0xD6CE, 0xD6CF, 0xD6D0, 0xD6D2,
- 0xD6D3, 0xD6D5, 0xD6D6, 0xD6D8, 0xD6DA, 0xD6DB, 0xD6DC, 0xD6DD,
- 0xD6DE, 0xD6DF, 0xD6E1, 0xD6E2, 0xD6E3, 0xD6E5, 0xD6E6, 0xD6E7,
- 0xD6E9, 0xD6EA, 0xD6EB, 0xD6EC, 0xD6ED, 0xD6EE, 0xD6EF, 0xD6F1,
- 0xD6F2, 0xD6F3, 0xD6F4, 0xD6F6, 0xD6F7, 0xD6F8, 0xD6F9, 0xD6FA,
- 0xD6FB, 0xD6FE, 0xD6FF, 0xD701, 0xD702, 0xD703, 0xD705, 0xD706,
- 0xD707, 0xD708, 0xD709, 0xD70A, 0xD70B, 0xD70C, 0xD70D, 0xD70E,
- 0xD70F, 0xD710, 0xD712, 0xD713, 0xD714, 0xD715, 0xD716, 0xD717,
- 0xD71A, 0xD71B, 0xD71D, 0xD71E, 0xD71F, 0xD721, 0xD722, 0xD723,
- 0xD724, 0xD725, 0xD726, 0xD727, 0xD72A, 0xD72C, 0xD72E, 0xD72F,
- 0xD730, 0xD731, 0xD732, 0xD733, 0xD736, 0xD737, 0xD739, 0xD73A,
- 0xD73B, 0xD73D, 0xD73E, 0xD73F, 0xD740, 0xD741, 0xD742, 0xD743,
- 0xD745, 0xD746, 0xD748, 0xD74A, 0xD74B, 0xD74C, 0xD74D, 0xD74E,
- 0xD74F, 0xD752, 0xD753, 0xD755, 0xD75A, 0xD75B, 0xD75C, 0xD75D,
- 0xD75E, 0xD75F, 0xD762, 0xD764, 0xD766, 0xD767, 0xD768, 0xD76A,
- 0xD76B, 0xD76D, 0xD76E, 0xD76F, 0xD771, 0xD772, 0xD773, 0xD775,
- 0xD776, 0xD777, 0xD778, 0xD779, 0xD77A, 0xD77B, 0xD77E, 0xD77F,
- 0xD780, 0xD782, 0xD783, 0xD784, 0xD785, 0xD786, 0xD787, 0xD78A,
- 0xD78B, 0xD78D, 0xD78E, 0xD78F, 0xD791, 0xD792, 0xD793, 0xD794,
- 0xD795, 0xD796, 0xD797, 0xD79A, 0xD79C, 0xD79E, 0xD79F, 0xD7A0,
- 0xD7A1, 0xD7A2, 0xD7A3, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024,
- 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C,
- 0x002D, 0x002E, 0x002F, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034,
- 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C,
- 0x003D, 0x003E, 0x003F, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044,
- 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C,
- 0x004D, 0x004E, 0x004F, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054,
- 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C,
- 0x005D, 0x005E, 0x005F, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064,
- 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C,
- 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074,
- 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C,
- 0x007D, 0x007E, 0x20A9, 0x2010, 0x00A9, 0x2122, 0x22EF, 0x0020,
- 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028,
- 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 0x0030,
- 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038,
- 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 0x0040,
- 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048,
- 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050,
- 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058,
- 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, 0x0060,
- 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068,
- 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070,
- 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078,
- 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x203E, 0x007E, 0x005C,
-};
+// 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
+
+extern const unsigned short g_FXCMAP_Korea1CID2Unicode_2[18352] = {
+ 0xFFFD, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026,
+ 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E,
+ 0x002F, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036,
+ 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E,
+ 0x003F, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046,
+ 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E,
+ 0x004F, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056,
+ 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E,
+ 0x005F, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066,
+ 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E,
+ 0x006F, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076,
+ 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E,
+ 0x20A9, 0x2010, 0x00A9, 0x2122, 0x22EF, 0x3000, 0x3001, 0x3002,
+ 0x00B7, 0x2025, 0x2026, 0x00A8, 0x3003, 0x2013, 0x2014, 0x2016,
+ 0xFF3C, 0x223C, 0x2018, 0x2019, 0x201C, 0x201D, 0x3014, 0x3015,
+ 0x3008, 0x3009, 0x300A, 0x300B, 0x300C, 0x300D, 0x300E, 0x300F,
+ 0x3010, 0x3011, 0x00B1, 0x00D7, 0x00F7, 0x2260, 0x2264, 0x2265,
+ 0x221E, 0x2234, 0x00B0, 0x2032, 0x2033, 0x2103, 0x212B, 0xFFE0,
+ 0xFFE1, 0xFFE5, 0x2642, 0x2640, 0x2220, 0x22A5, 0x2312, 0x2202,
+ 0x2207, 0x2261, 0x2252, 0x00A7, 0x203B, 0x2606, 0x2605, 0x25CB,
+ 0x25CF, 0x25CE, 0x25C7, 0x25C6, 0x25A1, 0x25A0, 0x25B3, 0x25B2,
+ 0x25BD, 0x25BC, 0x2192, 0x2190, 0x2191, 0x2193, 0x2194, 0x3013,
+ 0x226A, 0x226B, 0x221A, 0x223D, 0x221D, 0x2235, 0x222B, 0x222C,
+ 0x2208, 0x220B, 0x2286, 0x2287, 0x2282, 0x2283, 0x222A, 0x2229,
+ 0x2227, 0x2228, 0xFFE2, 0x21D2, 0x21D4, 0x2200, 0x2203, 0x00B4,
+ 0x02DC, 0x02C7, 0x02D8, 0x02DD, 0x02DA, 0x02D9, 0x00B8, 0x02DB,
+ 0x00A1, 0x00BF, 0x2236, 0x222E, 0x2211, 0x220F, 0x00A4, 0x2109,
+ 0x2030, 0x25C1, 0x25C0, 0x25B7, 0x25B6, 0x2664, 0x2660, 0x2661,
+ 0x2665, 0x2667, 0x2663, 0x2299, 0x25C8, 0x25A3, 0x25D0, 0x25D1,
+ 0x2592, 0x25A4, 0x25A5, 0x25A8, 0x25A7, 0x25A6, 0x25A9, 0x2668,
+ 0x260F, 0x260E, 0x261C, 0x261E, 0x00B6, 0x2020, 0x2021, 0x2195,
+ 0x2197, 0x2199, 0x2196, 0x2198, 0x266D, 0x2669, 0x266A, 0x266C,
+ 0x327F, 0x321C, 0x2116, 0x33C7, 0x2122, 0x33C2, 0x33D8, 0x2121,
+ 0xFF01, 0xFF02, 0xFF03, 0xFF04, 0xFF05, 0xFF06, 0xFF07, 0xFF08,
+ 0xFF09, 0xFF0A, 0xFF0B, 0xFF0C, 0xFF0D, 0xFF0E, 0xFF0F, 0xFF10,
+ 0xFF11, 0xFF12, 0xFF13, 0xFF14, 0xFF15, 0xFF16, 0xFF17, 0xFF18,
+ 0xFF19, 0xFF1A, 0xFF1B, 0xFF1C, 0xFF1D, 0xFF1E, 0xFF1F, 0xFF20,
+ 0xFF21, 0xFF22, 0xFF23, 0xFF24, 0xFF25, 0xFF26, 0xFF27, 0xFF28,
+ 0xFF29, 0xFF2A, 0xFF2B, 0xFF2C, 0xFF2D, 0xFF2E, 0xFF2F, 0xFF30,
+ 0xFF31, 0xFF32, 0xFF33, 0xFF34, 0xFF35, 0xFF36, 0xFF37, 0xFF38,
+ 0xFF39, 0xFF3A, 0xFF3B, 0xFFE6, 0xFF3D, 0xFF3E, 0xFF3F, 0xFF40,
+ 0xFF41, 0xFF42, 0xFF43, 0xFF44, 0xFF45, 0xFF46, 0xFF47, 0xFF48,
+ 0xFF49, 0xFF4A, 0xFF4B, 0xFF4C, 0xFF4D, 0xFF4E, 0xFF4F, 0xFF50,
+ 0xFF51, 0xFF52, 0xFF53, 0xFF54, 0xFF55, 0xFF56, 0xFF57, 0xFF58,
+ 0xFF59, 0xFF5A, 0xFF5B, 0xFF5C, 0xFF5D, 0xFFE3, 0x3131, 0x3132,
+ 0x3133, 0x3134, 0x3135, 0x3136, 0x3137, 0x3138, 0x3139, 0x313A,
+ 0x313B, 0x313C, 0x313D, 0x313E, 0x313F, 0x3140, 0x3141, 0x3142,
+ 0x3143, 0x3144, 0x3145, 0x3146, 0x3147, 0x3148, 0x3149, 0x314A,
+ 0x314B, 0x314C, 0x314D, 0x314E, 0x314F, 0x3150, 0x3151, 0x3152,
+ 0x3153, 0x3154, 0x3155, 0x3156, 0x3157, 0x3158, 0x3159, 0x315A,
+ 0x315B, 0x315C, 0x315D, 0x315E, 0x315F, 0x3160, 0x3161, 0x3162,
+ 0x3163, 0x3165, 0x3166, 0x3167, 0x3168, 0x3169, 0x316A, 0x316B,
+ 0x316C, 0x316D, 0x316E, 0x316F, 0x3170, 0x3171, 0x3172, 0x3173,
+ 0x3174, 0x3175, 0x3176, 0x3177, 0x3178, 0x3179, 0x317A, 0x317B,
+ 0x317C, 0x317D, 0x317E, 0x317F, 0x3180, 0x3181, 0x3182, 0x3183,
+ 0x3184, 0x3185, 0x3186, 0x3187, 0x3188, 0x3189, 0x318A, 0x318B,
+ 0x318C, 0x318D, 0x318E, 0x2170, 0x2171, 0x2172, 0x2173, 0x2174,
+ 0x2175, 0x2176, 0x2177, 0x2178, 0x2179, 0x2160, 0x2161, 0x2162,
+ 0x2163, 0x2164, 0x2165, 0x2166, 0x2167, 0x2168, 0x2169, 0x0391,
+ 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, 0x0398, 0x0399,
+ 0x039A, 0x039B, 0x039C, 0x039D, 0x039E, 0x039F, 0x03A0, 0x03A1,
+ 0x03A3, 0x03A4, 0x03A5, 0x03A6, 0x03A7, 0x03A8, 0x03A9, 0x03B1,
+ 0x03B2, 0x03B3, 0x03B4, 0x03B5, 0x03B6, 0x03B7, 0x03B8, 0x03B9,
+ 0x03BA, 0x03BB, 0x03BC, 0x03BD, 0x03BE, 0x03BF, 0x03C0, 0x03C1,
+ 0x03C3, 0x03C4, 0x03C5, 0x03C6, 0x03C7, 0x03C8, 0x03C9, 0x2500,
+ 0x2502, 0x250C, 0x2510, 0x2518, 0x2514, 0x251C, 0x252C, 0x2524,
+ 0x2534, 0x253C, 0x2501, 0x2503, 0x250F, 0x2513, 0x251B, 0x2517,
+ 0x2523, 0x2533, 0x252B, 0x253B, 0x254B, 0x2520, 0x252F, 0x2528,
+ 0x2537, 0x253F, 0x251D, 0x2530, 0x2525, 0x2538, 0x2542, 0x2512,
+ 0x2511, 0x251A, 0x2519, 0x2516, 0x2515, 0x250E, 0x250D, 0x251E,
+ 0x251F, 0x2521, 0x2522, 0x2526, 0x2527, 0x2529, 0x252A, 0x252D,
+ 0x252E, 0x2531, 0x2532, 0x2535, 0x2536, 0x2539, 0x253A, 0x253D,
+ 0x253E, 0x2540, 0x2541, 0x2543, 0x2544, 0x2545, 0x2546, 0x2547,
+ 0x2548, 0x2549, 0x254A, 0x3395, 0x3396, 0x3397, 0x2113, 0x3398,
+ 0x33C4, 0x33A3, 0x33A4, 0x33A5, 0x33A6, 0x3399, 0x339A, 0x339B,
+ 0x339C, 0x339D, 0x339E, 0x339F, 0x33A0, 0x33A1, 0x33A2, 0x33CA,
+ 0x338D, 0x338E, 0x338F, 0x33CF, 0x3388, 0x3389, 0x33C8, 0x33A7,
+ 0x33A8, 0x33B0, 0x33B1, 0x33B2, 0x33B3, 0x33B4, 0x33B5, 0x33B6,
+ 0x33B7, 0x33B8, 0x33B9, 0x3380, 0x3381, 0x3382, 0x3383, 0x3384,
+ 0x33BA, 0x33BB, 0x33BC, 0x33BD, 0x33BE, 0x33BF, 0x3390, 0x3391,
+ 0x3392, 0x3393, 0x3394, 0x2126, 0x33C0, 0x33C1, 0x338A, 0x338B,
+ 0x338C, 0x33D6, 0x33C5, 0x33AD, 0x33AE, 0x33AF, 0x33DB, 0x33A9,
+ 0x33AA, 0x33AB, 0x33AC, 0x33DD, 0x33D0, 0x33D3, 0x33C3, 0x33C9,
+ 0x33DC, 0x33C6, 0x00C6, 0x00D0, 0x00AA, 0x0126, 0x0132, 0x013F,
+ 0x0141, 0x00D8, 0x0152, 0x00BA, 0x00DE, 0x0166, 0x014A, 0x3260,
+ 0x3261, 0x3262, 0x3263, 0x3264, 0x3265, 0x3266, 0x3267, 0x3268,
+ 0x3269, 0x326A, 0x326B, 0x326C, 0x326D, 0x326E, 0x326F, 0x3270,
+ 0x3271, 0x3272, 0x3273, 0x3274, 0x3275, 0x3276, 0x3277, 0x3278,
+ 0x3279, 0x327A, 0x327B, 0x24D0, 0x24D1, 0x24D2, 0x24D3, 0x24D4,
+ 0x24D5, 0x24D6, 0x24D7, 0x24D8, 0x24D9, 0x24DA, 0x24DB, 0x24DC,
+ 0x24DD, 0x24DE, 0x24DF, 0x24E0, 0x24E1, 0x24E2, 0x24E3, 0x24E4,
+ 0x24E5, 0x24E6, 0x24E7, 0x24E8, 0x24E9, 0x2460, 0x2461, 0x2462,
+ 0x2463, 0x2464, 0x2465, 0x2466, 0x2467, 0x2468, 0x2469, 0x246A,
+ 0x246B, 0x246C, 0x246D, 0x246E, 0x00BD, 0x2153, 0x2154, 0x00BC,
+ 0x00BE, 0x215B, 0x215C, 0x215D, 0x215E, 0x00E6, 0x0111, 0x00F0,
+ 0x0127, 0x0131, 0x0133, 0x0138, 0x0140, 0x0142, 0x00F8, 0x0153,
+ 0x00DF, 0x00FE, 0x0167, 0x014B, 0x0149, 0x3200, 0x3201, 0x3202,
+ 0x3203, 0x3204, 0x3205, 0x3206, 0x3207, 0x3208, 0x3209, 0x320A,
+ 0x320B, 0x320C, 0x320D, 0x320E, 0x320F, 0x3210, 0x3211, 0x3212,
+ 0x3213, 0x3214, 0x3215, 0x3216, 0x3217, 0x3218, 0x3219, 0x321A,
+ 0x321B, 0x249C, 0x249D, 0x249E, 0x249F, 0x24A0, 0x24A1, 0x24A2,
+ 0x24A3, 0x24A4, 0x24A5, 0x24A6, 0x24A7, 0x24A8, 0x24A9, 0x24AA,
+ 0x24AB, 0x24AC, 0x24AD, 0x24AE, 0x24AF, 0x24B0, 0x24B1, 0x24B2,
+ 0x24B3, 0x24B4, 0x24B5, 0x2474, 0x2475, 0x2476, 0x2477, 0x2478,
+ 0x2479, 0x247A, 0x247B, 0x247C, 0x247D, 0x247E, 0x247F, 0x2480,
+ 0x2481, 0x2482, 0x00B9, 0x00B2, 0x00B3, 0x2074, 0x207F, 0x2081,
+ 0x2082, 0x2083, 0x2084, 0x3041, 0x3042, 0x3043, 0x3044, 0x3045,
+ 0x3046, 0x3047, 0x3048, 0x3049, 0x304A, 0x304B, 0x304C, 0x304D,
+ 0x304E, 0x304F, 0x3050, 0x3051, 0x3052, 0x3053, 0x3054, 0x3055,
+ 0x3056, 0x3057, 0x3058, 0x3059, 0x305A, 0x305B, 0x305C, 0x305D,
+ 0x305E, 0x305F, 0x3060, 0x3061, 0x3062, 0x3063, 0x3064, 0x3065,
+ 0x3066, 0x3067, 0x3068, 0x3069, 0x306A, 0x306B, 0x306C, 0x306D,
+ 0x306E, 0x306F, 0x3070, 0x3071, 0x3072, 0x3073, 0x3074, 0x3075,
+ 0x3076, 0x3077, 0x3078, 0x3079, 0x307A, 0x307B, 0x307C, 0x307D,
+ 0x307E, 0x307F, 0x3080, 0x3081, 0x3082, 0x3083, 0x3084, 0x3085,
+ 0x3086, 0x3087, 0x3088, 0x3089, 0x308A, 0x308B, 0x308C, 0x308D,
+ 0x308E, 0x308F, 0x3090, 0x3091, 0x3092, 0x3093, 0x30A1, 0x30A2,
+ 0x30A3, 0x30A4, 0x30A5, 0x30A6, 0x30A7, 0x30A8, 0x30A9, 0x30AA,
+ 0x30AB, 0x30AC, 0x30AD, 0x30AE, 0x30AF, 0x30B0, 0x30B1, 0x30B2,
+ 0x30B3, 0x30B4, 0x30B5, 0x30B6, 0x30B7, 0x30B8, 0x30B9, 0x30BA,
+ 0x30BB, 0x30BC, 0x30BD, 0x30BE, 0x30BF, 0x30C0, 0x30C1, 0x30C2,
+ 0x30C3, 0x30C4, 0x30C5, 0x30C6, 0x30C7, 0x30C8, 0x30C9, 0x30CA,
+ 0x30CB, 0x30CC, 0x30CD, 0x30CE, 0x30CF, 0x30D0, 0x30D1, 0x30D2,
+ 0x30D3, 0x30D4, 0x30D5, 0x30D6, 0x30D7, 0x30D8, 0x30D9, 0x30DA,
+ 0x30DB, 0x30DC, 0x30DD, 0x30DE, 0x30DF, 0x30E0, 0x30E1, 0x30E2,
+ 0x30E3, 0x30E4, 0x30E5, 0x30E6, 0x30E7, 0x30E8, 0x30E9, 0x30EA,
+ 0x30EB, 0x30EC, 0x30ED, 0x30EE, 0x30EF, 0x30F0, 0x30F1, 0x30F2,
+ 0x30F3, 0x30F4, 0x30F5, 0x30F6, 0x0410, 0x0411, 0x0412, 0x0413,
+ 0x0414, 0x0415, 0x0401, 0x0416, 0x0417, 0x0418, 0x0419, 0x041A,
+ 0x041B, 0x041C, 0x041D, 0x041E, 0x041F, 0x0420, 0x0421, 0x0422,
+ 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, 0x0428, 0x0429, 0x042A,
+ 0x042B, 0x042C, 0x042D, 0x042E, 0x042F, 0x0430, 0x0431, 0x0432,
+ 0x0433, 0x0434, 0x0435, 0x0451, 0x0436, 0x0437, 0x0438, 0x0439,
+ 0x043A, 0x043B, 0x043C, 0x043D, 0x043E, 0x043F, 0x0440, 0x0441,
+ 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, 0x0448, 0x0449,
+ 0x044A, 0x044B, 0x044C, 0x044D, 0x044E, 0x044F, 0xAC00, 0xAC01,
+ 0xAC04, 0xAC07, 0xAC08, 0xAC09, 0xAC0A, 0xAC10, 0xAC11, 0xAC12,
+ 0xAC13, 0xAC14, 0xAC15, 0xAC16, 0xAC17, 0xAC19, 0xAC1A, 0xAC1B,
+ 0xAC1C, 0xAC1D, 0xAC20, 0xAC24, 0xAC2C, 0xAC2D, 0xAC2F, 0xAC30,
+ 0xAC31, 0xAC38, 0xAC39, 0xAC3C, 0xAC40, 0xAC4B, 0xAC4D, 0xAC54,
+ 0xAC58, 0xAC5C, 0xAC70, 0xAC71, 0xAC74, 0xAC77, 0xAC78, 0xAC7A,
+ 0xAC80, 0xAC81, 0xAC83, 0xAC84, 0xAC85, 0xAC86, 0xAC89, 0xAC8A,
+ 0xAC8B, 0xAC8C, 0xAC90, 0xAC94, 0xAC9C, 0xAC9D, 0xAC9F, 0xACA0,
+ 0xACA1, 0xACA8, 0xACA9, 0xACAA, 0xACAC, 0xACAF, 0xACB0, 0xACB8,
+ 0xACB9, 0xACBB, 0xACBC, 0xACBD, 0xACC1, 0xACC4, 0xACC8, 0xACCC,
+ 0xACD5, 0xACD7, 0xACE0, 0xACE1, 0xACE4, 0xACE7, 0xACE8, 0xACEA,
+ 0xACEC, 0xACEF, 0xACF0, 0xACF1, 0xACF3, 0xACF5, 0xACF6, 0xACFC,
+ 0xACFD, 0xAD00, 0xAD04, 0xAD06, 0xAD0C, 0xAD0D, 0xAD0F, 0xAD11,
+ 0xAD18, 0xAD1C, 0xAD20, 0xAD29, 0xAD2C, 0xAD2D, 0xAD34, 0xAD35,
+ 0xAD38, 0xAD3C, 0xAD44, 0xAD45, 0xAD47, 0xAD49, 0xAD50, 0xAD54,
+ 0xAD58, 0xAD61, 0xAD63, 0xAD6C, 0xAD6D, 0xAD70, 0xAD73, 0xAD74,
+ 0xAD75, 0xAD76, 0xAD7B, 0xAD7C, 0xAD7D, 0xAD7F, 0xAD81, 0xAD82,
+ 0xAD88, 0xAD89, 0xAD8C, 0xAD90, 0xAD9C, 0xAD9D, 0xADA4, 0xADB7,
+ 0xADC0, 0xADC1, 0xADC4, 0xADC8, 0xADD0, 0xADD1, 0xADD3, 0xADDC,
+ 0xADE0, 0xADE4, 0xADF8, 0xADF9, 0xADFC, 0xADFF, 0xAE00, 0xAE01,
+ 0xAE08, 0xAE09, 0xAE0B, 0xAE0D, 0xAE14, 0xAE30, 0xAE31, 0xAE34,
+ 0xAE37, 0xAE38, 0xAE3A, 0xAE40, 0xAE41, 0xAE43, 0xAE45, 0xAE46,
+ 0xAE4A, 0xAE4C, 0xAE4D, 0xAE4E, 0xAE50, 0xAE54, 0xAE56, 0xAE5C,
+ 0xAE5D, 0xAE5F, 0xAE60, 0xAE61, 0xAE65, 0xAE68, 0xAE69, 0xAE6C,
+ 0xAE70, 0xAE78, 0xAE79, 0xAE7B, 0xAE7C, 0xAE7D, 0xAE84, 0xAE85,
+ 0xAE8C, 0xAEBC, 0xAEBD, 0xAEBE, 0xAEC0, 0xAEC4, 0xAECC, 0xAECD,
+ 0xAECF, 0xAED0, 0xAED1, 0xAED8, 0xAED9, 0xAEDC, 0xAEE8, 0xAEEB,
+ 0xAEED, 0xAEF4, 0xAEF8, 0xAEFC, 0xAF07, 0xAF08, 0xAF0D, 0xAF10,
+ 0xAF2C, 0xAF2D, 0xAF30, 0xAF32, 0xAF34, 0xAF3C, 0xAF3D, 0xAF3F,
+ 0xAF41, 0xAF42, 0xAF43, 0xAF48, 0xAF49, 0xAF50, 0xAF5C, 0xAF5D,
+ 0xAF64, 0xAF65, 0xAF79, 0xAF80, 0xAF84, 0xAF88, 0xAF90, 0xAF91,
+ 0xAF95, 0xAF9C, 0xAFB8, 0xAFB9, 0xAFBC, 0xAFC0, 0xAFC7, 0xAFC8,
+ 0xAFC9, 0xAFCB, 0xAFCD, 0xAFCE, 0xAFD4, 0xAFDC, 0xAFE8, 0xAFE9,
+ 0xAFF0, 0xAFF1, 0xAFF4, 0xAFF8, 0xB000, 0xB001, 0xB004, 0xB00C,
+ 0xB010, 0xB014, 0xB01C, 0xB01D, 0xB028, 0xB044, 0xB045, 0xB048,
+ 0xB04A, 0xB04C, 0xB04E, 0xB053, 0xB054, 0xB055, 0xB057, 0xB059,
+ 0xB05D, 0xB07C, 0xB07D, 0xB080, 0xB084, 0xB08C, 0xB08D, 0xB08F,
+ 0xB091, 0xB098, 0xB099, 0xB09A, 0xB09C, 0xB09F, 0xB0A0, 0xB0A1,
+ 0xB0A2, 0xB0A8, 0xB0A9, 0xB0AB, 0xB0AC, 0xB0AD, 0xB0AE, 0xB0AF,
+ 0xB0B1, 0xB0B3, 0xB0B4, 0xB0B5, 0xB0B8, 0xB0BC, 0xB0C4, 0xB0C5,
+ 0xB0C7, 0xB0C8, 0xB0C9, 0xB0D0, 0xB0D1, 0xB0D4, 0xB0D8, 0xB0E0,
+ 0xB0E5, 0xB108, 0xB109, 0xB10B, 0xB10C, 0xB110, 0xB112, 0xB113,
+ 0xB118, 0xB119, 0xB11B, 0xB11C, 0xB11D, 0xB123, 0xB124, 0xB125,
+ 0xB128, 0xB12C, 0xB134, 0xB135, 0xB137, 0xB138, 0xB139, 0xB140,
+ 0xB141, 0xB144, 0xB148, 0xB150, 0xB151, 0xB154, 0xB155, 0xB158,
+ 0xB15C, 0xB160, 0xB178, 0xB179, 0xB17C, 0xB180, 0xB182, 0xB188,
+ 0xB189, 0xB18B, 0xB18D, 0xB192, 0xB193, 0xB194, 0xB198, 0xB19C,
+ 0xB1A8, 0xB1CC, 0xB1D0, 0xB1D4, 0xB1DC, 0xB1DD, 0xB1DF, 0xB1E8,
+ 0xB1E9, 0xB1EC, 0xB1F0, 0xB1F9, 0xB1FB, 0xB1FD, 0xB204, 0xB205,
+ 0xB208, 0xB20B, 0xB20C, 0xB214, 0xB215, 0xB217, 0xB219, 0xB220,
+ 0xB234, 0xB23C, 0xB258, 0xB25C, 0xB260, 0xB268, 0xB269, 0xB274,
+ 0xB275, 0xB27C, 0xB284, 0xB285, 0xB289, 0xB290, 0xB291, 0xB294,
+ 0xB298, 0xB299, 0xB29A, 0xB2A0, 0xB2A1, 0xB2A3, 0xB2A5, 0xB2A6,
+ 0xB2AA, 0xB2AC, 0xB2B0, 0xB2B4, 0xB2C8, 0xB2C9, 0xB2CC, 0xB2D0,
+ 0xB2D2, 0xB2D8, 0xB2D9, 0xB2DB, 0xB2DD, 0xB2E2, 0xB2E4, 0xB2E5,
+ 0xB2E6, 0xB2E8, 0xB2EB, 0xB2EC, 0xB2ED, 0xB2EE, 0xB2EF, 0xB2F3,
+ 0xB2F4, 0xB2F5, 0xB2F7, 0xB2F8, 0xB2F9, 0xB2FA, 0xB2FB, 0xB2FF,
+ 0xB300, 0xB301, 0xB304, 0xB308, 0xB310, 0xB311, 0xB313, 0xB314,
+ 0xB315, 0xB31C, 0xB354, 0xB355, 0xB356, 0xB358, 0xB35B, 0xB35C,
+ 0xB35E, 0xB35F, 0xB364, 0xB365, 0xB367, 0xB369, 0xB36B, 0xB36E,
+ 0xB370, 0xB371, 0xB374, 0xB378, 0xB380, 0xB381, 0xB383, 0xB384,
+ 0xB385, 0xB38C, 0xB390, 0xB394, 0xB3A0, 0xB3A1, 0xB3A8, 0xB3AC,
+ 0xB3C4, 0xB3C5, 0xB3C8, 0xB3CB, 0xB3CC, 0xB3CE, 0xB3D0, 0xB3D4,
+ 0xB3D5, 0xB3D7, 0xB3D9, 0xB3DB, 0xB3DD, 0xB3E0, 0xB3E4, 0xB3E8,
+ 0xB3FC, 0xB410, 0xB418, 0xB41C, 0xB420, 0xB428, 0xB429, 0xB42B,
+ 0xB434, 0xB450, 0xB451, 0xB454, 0xB458, 0xB460, 0xB461, 0xB463,
+ 0xB465, 0xB46C, 0xB480, 0xB488, 0xB49D, 0xB4A4, 0xB4A8, 0xB4AC,
+ 0xB4B5, 0xB4B7, 0xB4B9, 0xB4C0, 0xB4C4, 0xB4C8, 0xB4D0, 0xB4D5,
+ 0xB4DC, 0xB4DD, 0xB4E0, 0xB4E3, 0xB4E4, 0xB4E6, 0xB4EC, 0xB4ED,
+ 0xB4EF, 0xB4F1, 0xB4F8, 0xB514, 0xB515, 0xB518, 0xB51B, 0xB51C,
+ 0xB524, 0xB525, 0xB527, 0xB528, 0xB529, 0xB52A, 0xB530, 0xB531,
+ 0xB534, 0xB538, 0xB540, 0xB541, 0xB543, 0xB544, 0xB545, 0xB54B,
+ 0xB54C, 0xB54D, 0xB550, 0xB554, 0xB55C, 0xB55D, 0xB55F, 0xB560,
+ 0xB561, 0xB5A0, 0xB5A1, 0xB5A4, 0xB5A8, 0xB5AA, 0xB5AB, 0xB5B0,
+ 0xB5B1, 0xB5B3, 0xB5B4, 0xB5B5, 0xB5BB, 0xB5BC, 0xB5BD, 0xB5C0,
+ 0xB5C4, 0xB5CC, 0xB5CD, 0xB5CF, 0xB5D0, 0xB5D1, 0xB5D8, 0xB5EC,
+ 0xB610, 0xB611, 0xB614, 0xB618, 0xB625, 0xB62C, 0xB634, 0xB648,
+ 0xB664, 0xB668, 0xB69C, 0xB69D, 0xB6A0, 0xB6A4, 0xB6AB, 0xB6AC,
+ 0xB6B1, 0xB6D4, 0xB6F0, 0xB6F4, 0xB6F8, 0xB700, 0xB701, 0xB705,
+ 0xB728, 0xB729, 0xB72C, 0xB72F, 0xB730, 0xB738, 0xB739, 0xB73B,
+ 0xB744, 0xB748, 0xB74C, 0xB754, 0xB755, 0xB760, 0xB764, 0xB768,
+ 0xB770, 0xB771, 0xB773, 0xB775, 0xB77C, 0xB77D, 0xB780, 0xB784,
+ 0xB78C, 0xB78D, 0xB78F, 0xB790, 0xB791, 0xB792, 0xB796, 0xB797,
+ 0xB798, 0xB799, 0xB79C, 0xB7A0, 0xB7A8, 0xB7A9, 0xB7AB, 0xB7AC,
+ 0xB7AD, 0xB7B4, 0xB7B5, 0xB7B8, 0xB7C7, 0xB7C9, 0xB7EC, 0xB7ED,
+ 0xB7F0, 0xB7F4, 0xB7FC, 0xB7FD, 0xB7FF, 0xB800, 0xB801, 0xB807,
+ 0xB808, 0xB809, 0xB80C, 0xB810, 0xB818, 0xB819, 0xB81B, 0xB81D,
+ 0xB824, 0xB825, 0xB828, 0xB82C, 0xB834, 0xB835, 0xB837, 0xB838,
+ 0xB839, 0xB840, 0xB844, 0xB851, 0xB853, 0xB85C, 0xB85D, 0xB860,
+ 0xB864, 0xB86C, 0xB86D, 0xB86F, 0xB871, 0xB878, 0xB87C, 0xB88D,
+ 0xB8A8, 0xB8B0, 0xB8B4, 0xB8B8, 0xB8C0, 0xB8C1, 0xB8C3, 0xB8C5,
+ 0xB8CC, 0xB8D0, 0xB8D4, 0xB8DD, 0xB8DF, 0xB8E1, 0xB8E8, 0xB8E9,
+ 0xB8EC, 0xB8F0, 0xB8F8, 0xB8F9, 0xB8FB, 0xB8FD, 0xB904, 0xB918,
+ 0xB920, 0xB93C, 0xB93D, 0xB940, 0xB944, 0xB94C, 0xB94F, 0xB951,
+ 0xB958, 0xB959, 0xB95C, 0xB960, 0xB968, 0xB969, 0xB96B, 0xB96D,
+ 0xB974, 0xB975, 0xB978, 0xB97C, 0xB984, 0xB985, 0xB987, 0xB989,
+ 0xB98A, 0xB98D, 0xB98E, 0xB9AC, 0xB9AD, 0xB9B0, 0xB9B4, 0xB9BC,
+ 0xB9BD, 0xB9BF, 0xB9C1, 0xB9C8, 0xB9C9, 0xB9CC, 0xB9CE, 0xB9CF,
+ 0xB9D0, 0xB9D1, 0xB9D2, 0xB9D8, 0xB9D9, 0xB9DB, 0xB9DD, 0xB9DE,
+ 0xB9E1, 0xB9E3, 0xB9E4, 0xB9E5, 0xB9E8, 0xB9EC, 0xB9F4, 0xB9F5,
+ 0xB9F7, 0xB9F8, 0xB9F9, 0xB9FA, 0xBA00, 0xBA01, 0xBA08, 0xBA15,
+ 0xBA38, 0xBA39, 0xBA3C, 0xBA40, 0xBA42, 0xBA48, 0xBA49, 0xBA4B,
+ 0xBA4D, 0xBA4E, 0xBA53, 0xBA54, 0xBA55, 0xBA58, 0xBA5C, 0xBA64,
+ 0xBA65, 0xBA67, 0xBA68, 0xBA69, 0xBA70, 0xBA71, 0xBA74, 0xBA78,
+ 0xBA83, 0xBA84, 0xBA85, 0xBA87, 0xBA8C, 0xBAA8, 0xBAA9, 0xBAAB,
+ 0xBAAC, 0xBAB0, 0xBAB2, 0xBAB8, 0xBAB9, 0xBABB, 0xBABD, 0xBAC4,
+ 0xBAC8, 0xBAD8, 0xBAD9, 0xBAFC, 0xBB00, 0xBB04, 0xBB0D, 0xBB0F,
+ 0xBB11, 0xBB18, 0xBB1C, 0xBB20, 0xBB29, 0xBB2B, 0xBB34, 0xBB35,
+ 0xBB36, 0xBB38, 0xBB3B, 0xBB3C, 0xBB3D, 0xBB3E, 0xBB44, 0xBB45,
+ 0xBB47, 0xBB49, 0xBB4D, 0xBB4F, 0xBB50, 0xBB54, 0xBB58, 0xBB61,
+ 0xBB63, 0xBB6C, 0xBB88, 0xBB8C, 0xBB90, 0xBBA4, 0xBBA8, 0xBBAC,
+ 0xBBB4, 0xBBB7, 0xBBC0, 0xBBC4, 0xBBC8, 0xBBD0, 0xBBD3, 0xBBF8,
+ 0xBBF9, 0xBBFC, 0xBBFF, 0xBC00, 0xBC02, 0xBC08, 0xBC09, 0xBC0B,
+ 0xBC0C, 0xBC0D, 0xBC0F, 0xBC11, 0xBC14, 0xBC15, 0xBC16, 0xBC17,
+ 0xBC18, 0xBC1B, 0xBC1C, 0xBC1D, 0xBC1E, 0xBC1F, 0xBC24, 0xBC25,
+ 0xBC27, 0xBC29, 0xBC2D, 0xBC30, 0xBC31, 0xBC34, 0xBC38, 0xBC40,
+ 0xBC41, 0xBC43, 0xBC44, 0xBC45, 0xBC49, 0xBC4C, 0xBC4D, 0xBC50,
+ 0xBC5D, 0xBC84, 0xBC85, 0xBC88, 0xBC8B, 0xBC8C, 0xBC8E, 0xBC94,
+ 0xBC95, 0xBC97, 0xBC99, 0xBC9A, 0xBCA0, 0xBCA1, 0xBCA4, 0xBCA7,
+ 0xBCA8, 0xBCB0, 0xBCB1, 0xBCB3, 0xBCB4, 0xBCB5, 0xBCBC, 0xBCBD,
+ 0xBCC0, 0xBCC4, 0xBCCD, 0xBCCF, 0xBCD0, 0xBCD1, 0xBCD5, 0xBCD8,
+ 0xBCDC, 0xBCF4, 0xBCF5, 0xBCF6, 0xBCF8, 0xBCFC, 0xBD04, 0xBD05,
+ 0xBD07, 0xBD09, 0xBD10, 0xBD14, 0xBD24, 0xBD2C, 0xBD40, 0xBD48,
+ 0xBD49, 0xBD4C, 0xBD50, 0xBD58, 0xBD59, 0xBD64, 0xBD68, 0xBD80,
+ 0xBD81, 0xBD84, 0xBD87, 0xBD88, 0xBD89, 0xBD8A, 0xBD90, 0xBD91,
+ 0xBD93, 0xBD95, 0xBD99, 0xBD9A, 0xBD9C, 0xBDA4, 0xBDB0, 0xBDB8,
+ 0xBDD4, 0xBDD5, 0xBDD8, 0xBDDC, 0xBDE9, 0xBDF0, 0xBDF4, 0xBDF8,
+ 0xBE00, 0xBE03, 0xBE05, 0xBE0C, 0xBE0D, 0xBE10, 0xBE14, 0xBE1C,
+ 0xBE1D, 0xBE1F, 0xBE44, 0xBE45, 0xBE48, 0xBE4C, 0xBE4E, 0xBE54,
+ 0xBE55, 0xBE57, 0xBE59, 0xBE5A, 0xBE5B, 0xBE60, 0xBE61, 0xBE64,
+ 0xBE68, 0xBE6A, 0xBE70, 0xBE71, 0xBE73, 0xBE74, 0xBE75, 0xBE7B,
+ 0xBE7C, 0xBE7D, 0xBE80, 0xBE84, 0xBE8C, 0xBE8D, 0xBE8F, 0xBE90,
+ 0xBE91, 0xBE98, 0xBE99, 0xBEA8, 0xBED0, 0xBED1, 0xBED4, 0xBED7,
+ 0xBED8, 0xBEE0, 0xBEE3, 0xBEE4, 0xBEE5, 0xBEEC, 0xBF01, 0xBF08,
+ 0xBF09, 0xBF18, 0xBF19, 0xBF1B, 0xBF1C, 0xBF1D, 0xBF40, 0xBF41,
+ 0xBF44, 0xBF48, 0xBF50, 0xBF51, 0xBF55, 0xBF94, 0xBFB0, 0xBFC5,
+ 0xBFCC, 0xBFCD, 0xBFD0, 0xBFD4, 0xBFDC, 0xBFDF, 0xBFE1, 0xC03C,
+ 0xC051, 0xC058, 0xC05C, 0xC060, 0xC068, 0xC069, 0xC090, 0xC091,
+ 0xC094, 0xC098, 0xC0A0, 0xC0A1, 0xC0A3, 0xC0A5, 0xC0AC, 0xC0AD,
+ 0xC0AF, 0xC0B0, 0xC0B3, 0xC0B4, 0xC0B5, 0xC0B6, 0xC0BC, 0xC0BD,
+ 0xC0BF, 0xC0C0, 0xC0C1, 0xC0C5, 0xC0C8, 0xC0C9, 0xC0CC, 0xC0D0,
+ 0xC0D8, 0xC0D9, 0xC0DB, 0xC0DC, 0xC0DD, 0xC0E4, 0xC0E5, 0xC0E8,
+ 0xC0EC, 0xC0F4, 0xC0F5, 0xC0F7, 0xC0F9, 0xC100, 0xC104, 0xC108,
+ 0xC110, 0xC115, 0xC11C, 0xC11D, 0xC11E, 0xC11F, 0xC120, 0xC123,
+ 0xC124, 0xC126, 0xC127, 0xC12C, 0xC12D, 0xC12F, 0xC130, 0xC131,
+ 0xC136, 0xC138, 0xC139, 0xC13C, 0xC140, 0xC148, 0xC149, 0xC14B,
+ 0xC14C, 0xC14D, 0xC154, 0xC155, 0xC158, 0xC15C, 0xC164, 0xC165,
+ 0xC167, 0xC168, 0xC169, 0xC170, 0xC174, 0xC178, 0xC185, 0xC18C,
+ 0xC18D, 0xC18E, 0xC190, 0xC194, 0xC196, 0xC19C, 0xC19D, 0xC19F,
+ 0xC1A1, 0xC1A5, 0xC1A8, 0xC1A9, 0xC1AC, 0xC1B0, 0xC1BD, 0xC1C4,
+ 0xC1C8, 0xC1CC, 0xC1D4, 0xC1D7, 0xC1D8, 0xC1E0, 0xC1E4, 0xC1E8,
+ 0xC1F0, 0xC1F1, 0xC1F3, 0xC1FC, 0xC1FD, 0xC200, 0xC204, 0xC20C,
+ 0xC20D, 0xC20F, 0xC211, 0xC218, 0xC219, 0xC21C, 0xC21F, 0xC220,
+ 0xC228, 0xC229, 0xC22B, 0xC22D, 0xC22F, 0xC231, 0xC232, 0xC234,
+ 0xC248, 0xC250, 0xC251, 0xC254, 0xC258, 0xC260, 0xC265, 0xC26C,
+ 0xC26D, 0xC270, 0xC274, 0xC27C, 0xC27D, 0xC27F, 0xC281, 0xC288,
+ 0xC289, 0xC290, 0xC298, 0xC29B, 0xC29D, 0xC2A4, 0xC2A5, 0xC2A8,
+ 0xC2AC, 0xC2AD, 0xC2B4, 0xC2B5, 0xC2B7, 0xC2B9, 0xC2DC, 0xC2DD,
+ 0xC2E0, 0xC2E3, 0xC2E4, 0xC2EB, 0xC2EC, 0xC2ED, 0xC2EF, 0xC2F1,
+ 0xC2F6, 0xC2F8, 0xC2F9, 0xC2FB, 0xC2FC, 0xC300, 0xC308, 0xC309,
+ 0xC30C, 0xC30D, 0xC313, 0xC314, 0xC315, 0xC318, 0xC31C, 0xC324,
+ 0xC325, 0xC328, 0xC329, 0xC345, 0xC368, 0xC369, 0xC36C, 0xC370,
+ 0xC372, 0xC378, 0xC379, 0xC37C, 0xC37D, 0xC384, 0xC388, 0xC38C,
+ 0xC3C0, 0xC3D8, 0xC3D9, 0xC3DC, 0xC3DF, 0xC3E0, 0xC3E2, 0xC3E8,
+ 0xC3E9, 0xC3ED, 0xC3F4, 0xC3F5, 0xC3F8, 0xC408, 0xC410, 0xC424,
+ 0xC42C, 0xC430, 0xC434, 0xC43C, 0xC43D, 0xC448, 0xC464, 0xC465,
+ 0xC468, 0xC46C, 0xC474, 0xC475, 0xC479, 0xC480, 0xC494, 0xC49C,
+ 0xC4B8, 0xC4BC, 0xC4E9, 0xC4F0, 0xC4F1, 0xC4F4, 0xC4F8, 0xC4FA,
+ 0xC4FF, 0xC500, 0xC501, 0xC50C, 0xC510, 0xC514, 0xC51C, 0xC528,
+ 0xC529, 0xC52C, 0xC530, 0xC538, 0xC539, 0xC53B, 0xC53D, 0xC544,
+ 0xC545, 0xC548, 0xC549, 0xC54A, 0xC54C, 0xC54D, 0xC54E, 0xC553,
+ 0xC554, 0xC555, 0xC557, 0xC558, 0xC559, 0xC55D, 0xC55E, 0xC560,
+ 0xC561, 0xC564, 0xC568, 0xC570, 0xC571, 0xC573, 0xC574, 0xC575,
+ 0xC57C, 0xC57D, 0xC580, 0xC584, 0xC587, 0xC58C, 0xC58D, 0xC58F,
+ 0xC591, 0xC595, 0xC597, 0xC598, 0xC59C, 0xC5A0, 0xC5A9, 0xC5B4,
+ 0xC5B5, 0xC5B8, 0xC5B9, 0xC5BB, 0xC5BC, 0xC5BD, 0xC5BE, 0xC5C4,
+ 0xC5C5, 0xC5C6, 0xC5C7, 0xC5C8, 0xC5C9, 0xC5CA, 0xC5CC, 0xC5CE,
+ 0xC5D0, 0xC5D1, 0xC5D4, 0xC5D8, 0xC5E0, 0xC5E1, 0xC5E3, 0xC5E5,
+ 0xC5EC, 0xC5ED, 0xC5EE, 0xC5F0, 0xC5F4, 0xC5F6, 0xC5F7, 0xC5FC,
+ 0xC5FD, 0xC5FE, 0xC5FF, 0xC600, 0xC601, 0xC605, 0xC606, 0xC607,
+ 0xC608, 0xC60C, 0xC610, 0xC618, 0xC619, 0xC61B, 0xC61C, 0xC624,
+ 0xC625, 0xC628, 0xC62C, 0xC62D, 0xC62E, 0xC630, 0xC633, 0xC634,
+ 0xC635, 0xC637, 0xC639, 0xC63B, 0xC640, 0xC641, 0xC644, 0xC648,
+ 0xC650, 0xC651, 0xC653, 0xC654, 0xC655, 0xC65C, 0xC65D, 0xC660,
+ 0xC66C, 0xC66F, 0xC671, 0xC678, 0xC679, 0xC67C, 0xC680, 0xC688,
+ 0xC689, 0xC68B, 0xC68D, 0xC694, 0xC695, 0xC698, 0xC69C, 0xC6A4,
+ 0xC6A5, 0xC6A7, 0xC6A9, 0xC6B0, 0xC6B1, 0xC6B4, 0xC6B8, 0xC6B9,
+ 0xC6BA, 0xC6C0, 0xC6C1, 0xC6C3, 0xC6C5, 0xC6CC, 0xC6CD, 0xC6D0,
+ 0xC6D4, 0xC6DC, 0xC6DD, 0xC6E0, 0xC6E1, 0xC6E8, 0xC6E9, 0xC6EC,
+ 0xC6F0, 0xC6F8, 0xC6F9, 0xC6FD, 0xC704, 0xC705, 0xC708, 0xC70C,
+ 0xC714, 0xC715, 0xC717, 0xC719, 0xC720, 0xC721, 0xC724, 0xC728,
+ 0xC730, 0xC731, 0xC733, 0xC735, 0xC737, 0xC73C, 0xC73D, 0xC740,
+ 0xC744, 0xC74A, 0xC74C, 0xC74D, 0xC74F, 0xC751, 0xC752, 0xC753,
+ 0xC754, 0xC755, 0xC756, 0xC757, 0xC758, 0xC75C, 0xC760, 0xC768,
+ 0xC76B, 0xC774, 0xC775, 0xC778, 0xC77C, 0xC77D, 0xC77E, 0xC783,
+ 0xC784, 0xC785, 0xC787, 0xC788, 0xC789, 0xC78A, 0xC78E, 0xC790,
+ 0xC791, 0xC794, 0xC796, 0xC797, 0xC798, 0xC79A, 0xC7A0, 0xC7A1,
+ 0xC7A3, 0xC7A4, 0xC7A5, 0xC7A6, 0xC7AC, 0xC7AD, 0xC7B0, 0xC7B4,
+ 0xC7BC, 0xC7BD, 0xC7BF, 0xC7C0, 0xC7C1, 0xC7C8, 0xC7C9, 0xC7CC,
+ 0xC7CE, 0xC7D0, 0xC7D8, 0xC7DD, 0xC7E4, 0xC7E8, 0xC7EC, 0xC800,
+ 0xC801, 0xC804, 0xC808, 0xC80A, 0xC810, 0xC811, 0xC813, 0xC815,
+ 0xC816, 0xC81C, 0xC81D, 0xC820, 0xC824, 0xC82C, 0xC82D, 0xC82F,
+ 0xC831, 0xC838, 0xC83C, 0xC840, 0xC848, 0xC849, 0xC84C, 0xC84D,
+ 0xC854, 0xC870, 0xC871, 0xC874, 0xC878, 0xC87A, 0xC880, 0xC881,
+ 0xC883, 0xC885, 0xC886, 0xC887, 0xC88B, 0xC88C, 0xC88D, 0xC894,
+ 0xC89D, 0xC89F, 0xC8A1, 0xC8A8, 0xC8BC, 0xC8BD, 0xC8C4, 0xC8C8,
+ 0xC8CC, 0xC8D4, 0xC8D5, 0xC8D7, 0xC8D9, 0xC8E0, 0xC8E1, 0xC8E4,
+ 0xC8F5, 0xC8FC, 0xC8FD, 0xC900, 0xC904, 0xC905, 0xC906, 0xC90C,
+ 0xC90D, 0xC90F, 0xC911, 0xC918, 0xC92C, 0xC934, 0xC950, 0xC951,
+ 0xC954, 0xC958, 0xC960, 0xC961, 0xC963, 0xC96C, 0xC970, 0xC974,
+ 0xC97C, 0xC988, 0xC989, 0xC98C, 0xC990, 0xC998, 0xC999, 0xC99B,
+ 0xC99D, 0xC9C0, 0xC9C1, 0xC9C4, 0xC9C7, 0xC9C8, 0xC9CA, 0xC9D0,
+ 0xC9D1, 0xC9D3, 0xC9D5, 0xC9D6, 0xC9D9, 0xC9DA, 0xC9DC, 0xC9DD,
+ 0xC9E0, 0xC9E2, 0xC9E4, 0xC9E7, 0xC9EC, 0xC9ED, 0xC9EF, 0xC9F0,
+ 0xC9F1, 0xC9F8, 0xC9F9, 0xC9FC, 0xCA00, 0xCA08, 0xCA09, 0xCA0B,
+ 0xCA0C, 0xCA0D, 0xCA14, 0xCA18, 0xCA29, 0xCA4C, 0xCA4D, 0xCA50,
+ 0xCA54, 0xCA5C, 0xCA5D, 0xCA5F, 0xCA60, 0xCA61, 0xCA68, 0xCA7D,
+ 0xCA84, 0xCA98, 0xCABC, 0xCABD, 0xCAC0, 0xCAC4, 0xCACC, 0xCACD,
+ 0xCACF, 0xCAD1, 0xCAD3, 0xCAD8, 0xCAD9, 0xCAE0, 0xCAEC, 0xCAF4,
+ 0xCB08, 0xCB10, 0xCB14, 0xCB18, 0xCB20, 0xCB21, 0xCB41, 0xCB48,
+ 0xCB49, 0xCB4C, 0xCB50, 0xCB58, 0xCB59, 0xCB5D, 0xCB64, 0xCB78,
+ 0xCB79, 0xCB9C, 0xCBB8, 0xCBD4, 0xCBE4, 0xCBE7, 0xCBE9, 0xCC0C,
+ 0xCC0D, 0xCC10, 0xCC14, 0xCC1C, 0xCC1D, 0xCC21, 0xCC22, 0xCC27,
+ 0xCC28, 0xCC29, 0xCC2C, 0xCC2E, 0xCC30, 0xCC38, 0xCC39, 0xCC3B,
+ 0xCC3C, 0xCC3D, 0xCC3E, 0xCC44, 0xCC45, 0xCC48, 0xCC4C, 0xCC54,
+ 0xCC55, 0xCC57, 0xCC58, 0xCC59, 0xCC60, 0xCC64, 0xCC66, 0xCC68,
+ 0xCC70, 0xCC75, 0xCC98, 0xCC99, 0xCC9C, 0xCCA0, 0xCCA8, 0xCCA9,
+ 0xCCAB, 0xCCAC, 0xCCAD, 0xCCB4, 0xCCB5, 0xCCB8, 0xCCBC, 0xCCC4,
+ 0xCCC5, 0xCCC7, 0xCCC9, 0xCCD0, 0xCCD4, 0xCCE4, 0xCCEC, 0xCCF0,
+ 0xCD01, 0xCD08, 0xCD09, 0xCD0C, 0xCD10, 0xCD18, 0xCD19, 0xCD1B,
+ 0xCD1D, 0xCD24, 0xCD28, 0xCD2C, 0xCD39, 0xCD5C, 0xCD60, 0xCD64,
+ 0xCD6C, 0xCD6D, 0xCD6F, 0xCD71, 0xCD78, 0xCD88, 0xCD94, 0xCD95,
+ 0xCD98, 0xCD9C, 0xCDA4, 0xCDA5, 0xCDA7, 0xCDA9, 0xCDB0, 0xCDC4,
+ 0xCDCC, 0xCDD0, 0xCDE8, 0xCDEC, 0xCDF0, 0xCDF8, 0xCDF9, 0xCDFB,
+ 0xCDFD, 0xCE04, 0xCE08, 0xCE0C, 0xCE14, 0xCE19, 0xCE20, 0xCE21,
+ 0xCE24, 0xCE28, 0xCE30, 0xCE31, 0xCE33, 0xCE35, 0xCE58, 0xCE59,
+ 0xCE5C, 0xCE5F, 0xCE60, 0xCE61, 0xCE68, 0xCE69, 0xCE6B, 0xCE6D,
+ 0xCE74, 0xCE75, 0xCE78, 0xCE7C, 0xCE84, 0xCE85, 0xCE87, 0xCE89,
+ 0xCE90, 0xCE91, 0xCE94, 0xCE98, 0xCEA0, 0xCEA1, 0xCEA3, 0xCEA4,
+ 0xCEA5, 0xCEAC, 0xCEAD, 0xCEC1, 0xCEE4, 0xCEE5, 0xCEE8, 0xCEEB,
+ 0xCEEC, 0xCEF4, 0xCEF5, 0xCEF7, 0xCEF8, 0xCEF9, 0xCF00, 0xCF01,
+ 0xCF04, 0xCF08, 0xCF10, 0xCF11, 0xCF13, 0xCF15, 0xCF1C, 0xCF20,
+ 0xCF24, 0xCF2C, 0xCF2D, 0xCF2F, 0xCF30, 0xCF31, 0xCF38, 0xCF54,
+ 0xCF55, 0xCF58, 0xCF5C, 0xCF64, 0xCF65, 0xCF67, 0xCF69, 0xCF70,
+ 0xCF71, 0xCF74, 0xCF78, 0xCF80, 0xCF85, 0xCF8C, 0xCFA1, 0xCFA8,
+ 0xCFB0, 0xCFC4, 0xCFE0, 0xCFE1, 0xCFE4, 0xCFE8, 0xCFF0, 0xCFF1,
+ 0xCFF3, 0xCFF5, 0xCFFC, 0xD000, 0xD004, 0xD011, 0xD018, 0xD02D,
+ 0xD034, 0xD035, 0xD038, 0xD03C, 0xD044, 0xD045, 0xD047, 0xD049,
+ 0xD050, 0xD054, 0xD058, 0xD060, 0xD06C, 0xD06D, 0xD070, 0xD074,
+ 0xD07C, 0xD07D, 0xD081, 0xD0A4, 0xD0A5, 0xD0A8, 0xD0AC, 0xD0B4,
+ 0xD0B5, 0xD0B7, 0xD0B9, 0xD0C0, 0xD0C1, 0xD0C4, 0xD0C8, 0xD0C9,
+ 0xD0D0, 0xD0D1, 0xD0D3, 0xD0D4, 0xD0D5, 0xD0DC, 0xD0DD, 0xD0E0,
+ 0xD0E4, 0xD0EC, 0xD0ED, 0xD0EF, 0xD0F0, 0xD0F1, 0xD0F8, 0xD10D,
+ 0xD130, 0xD131, 0xD134, 0xD138, 0xD13A, 0xD140, 0xD141, 0xD143,
+ 0xD144, 0xD145, 0xD14C, 0xD14D, 0xD150, 0xD154, 0xD15C, 0xD15D,
+ 0xD15F, 0xD161, 0xD168, 0xD16C, 0xD17C, 0xD184, 0xD188, 0xD1A0,
+ 0xD1A1, 0xD1A4, 0xD1A8, 0xD1B0, 0xD1B1, 0xD1B3, 0xD1B5, 0xD1BA,
+ 0xD1BC, 0xD1C0, 0xD1D8, 0xD1F4, 0xD1F8, 0xD207, 0xD209, 0xD210,
+ 0xD22C, 0xD22D, 0xD230, 0xD234, 0xD23C, 0xD23D, 0xD23F, 0xD241,
+ 0xD248, 0xD25C, 0xD264, 0xD280, 0xD281, 0xD284, 0xD288, 0xD290,
+ 0xD291, 0xD295, 0xD29C, 0xD2A0, 0xD2A4, 0xD2AC, 0xD2B1, 0xD2B8,
+ 0xD2B9, 0xD2BC, 0xD2BF, 0xD2C0, 0xD2C2, 0xD2C8, 0xD2C9, 0xD2CB,
+ 0xD2D4, 0xD2D8, 0xD2DC, 0xD2E4, 0xD2E5, 0xD2F0, 0xD2F1, 0xD2F4,
+ 0xD2F8, 0xD300, 0xD301, 0xD303, 0xD305, 0xD30C, 0xD30D, 0xD30E,
+ 0xD310, 0xD314, 0xD316, 0xD31C, 0xD31D, 0xD31F, 0xD320, 0xD321,
+ 0xD325, 0xD328, 0xD329, 0xD32C, 0xD330, 0xD338, 0xD339, 0xD33B,
+ 0xD33C, 0xD33D, 0xD344, 0xD345, 0xD37C, 0xD37D, 0xD380, 0xD384,
+ 0xD38C, 0xD38D, 0xD38F, 0xD390, 0xD391, 0xD398, 0xD399, 0xD39C,
+ 0xD3A0, 0xD3A8, 0xD3A9, 0xD3AB, 0xD3AD, 0xD3B4, 0xD3B8, 0xD3BC,
+ 0xD3C4, 0xD3C5, 0xD3C8, 0xD3C9, 0xD3D0, 0xD3D8, 0xD3E1, 0xD3E3,
+ 0xD3EC, 0xD3ED, 0xD3F0, 0xD3F4, 0xD3FC, 0xD3FD, 0xD3FF, 0xD401,
+ 0xD408, 0xD41D, 0xD440, 0xD444, 0xD45C, 0xD460, 0xD464, 0xD46D,
+ 0xD46F, 0xD478, 0xD479, 0xD47C, 0xD47F, 0xD480, 0xD482, 0xD488,
+ 0xD489, 0xD48B, 0xD48D, 0xD494, 0xD4A9, 0xD4CC, 0xD4D0, 0xD4D4,
+ 0xD4DC, 0xD4DF, 0xD4E8, 0xD4EC, 0xD4F0, 0xD4F8, 0xD4FB, 0xD4FD,
+ 0xD504, 0xD508, 0xD50C, 0xD514, 0xD515, 0xD517, 0xD53C, 0xD53D,
+ 0xD540, 0xD544, 0xD54C, 0xD54D, 0xD54F, 0xD551, 0xD558, 0xD559,
+ 0xD55C, 0xD560, 0xD565, 0xD568, 0xD569, 0xD56B, 0xD56D, 0xD574,
+ 0xD575, 0xD578, 0xD57C, 0xD584, 0xD585, 0xD587, 0xD588, 0xD589,
+ 0xD590, 0xD5A5, 0xD5C8, 0xD5C9, 0xD5CC, 0xD5D0, 0xD5D2, 0xD5D8,
+ 0xD5D9, 0xD5DB, 0xD5DD, 0xD5E4, 0xD5E5, 0xD5E8, 0xD5EC, 0xD5F4,
+ 0xD5F5, 0xD5F7, 0xD5F9, 0xD600, 0xD601, 0xD604, 0xD608, 0xD610,
+ 0xD611, 0xD613, 0xD614, 0xD615, 0xD61C, 0xD620, 0xD624, 0xD62D,
+ 0xD638, 0xD639, 0xD63C, 0xD640, 0xD645, 0xD648, 0xD649, 0xD64B,
+ 0xD64D, 0xD651, 0xD654, 0xD655, 0xD658, 0xD65C, 0xD667, 0xD669,
+ 0xD670, 0xD671, 0xD674, 0xD683, 0xD685, 0xD68C, 0xD68D, 0xD690,
+ 0xD694, 0xD69D, 0xD69F, 0xD6A1, 0xD6A8, 0xD6AC, 0xD6B0, 0xD6B9,
+ 0xD6BB, 0xD6C4, 0xD6C5, 0xD6C8, 0xD6CC, 0xD6D1, 0xD6D4, 0xD6D7,
+ 0xD6D9, 0xD6E0, 0xD6E4, 0xD6E8, 0xD6F0, 0xD6F5, 0xD6FC, 0xD6FD,
+ 0xD700, 0xD704, 0xD711, 0xD718, 0xD719, 0xD71C, 0xD720, 0xD728,
+ 0xD729, 0xD72B, 0xD72D, 0xD734, 0xD735, 0xD738, 0xD73C, 0xD744,
+ 0xD747, 0xD749, 0xD750, 0xD751, 0xD754, 0xD756, 0xD757, 0xD758,
+ 0xD759, 0xD760, 0xD761, 0xD763, 0xD765, 0xD769, 0xD76C, 0xD770,
+ 0xD774, 0xD77C, 0xD77D, 0xD781, 0xD788, 0xD789, 0xD78C, 0xD790,
+ 0xD798, 0xD799, 0xD79B, 0xD79D, 0x4F3D, 0x4F73, 0x5047, 0x50F9,
+ 0x52A0, 0x53EF, 0x5475, 0x54E5, 0x5609, 0x5AC1, 0x5BB6, 0x6687,
+ 0x67B6, 0x67B7, 0x67EF, 0x6B4C, 0x73C2, 0x75C2, 0x7A3C, 0x82DB,
+ 0x8304, 0x8857, 0x8888, 0x8A36, 0x8CC8, 0x8DCF, 0x8EFB, 0x8FE6,
+ 0x99D5, 0x523B, 0x5374, 0x5404, 0x606A, 0x6164, 0x6BBC, 0x73CF,
+ 0x811A, 0x89BA, 0x89D2, 0x95A3, 0x4F83, 0x520A, 0x58BE, 0x5978,
+ 0x59E6, 0x5E72, 0x5E79, 0x61C7, 0x63C0, 0x6746, 0x67EC, 0x687F,
+ 0x6F97, 0x764E, 0x770B, 0x78F5, 0x7A08, 0x7AFF, 0x7C21, 0x809D,
+ 0x826E, 0x8271, 0x8AEB, 0x9593, 0x4E6B, 0x559D, 0x66F7, 0x6E34,
+ 0x78A3, 0x7AED, 0x845B, 0x8910, 0x874E, 0x97A8, 0x52D8, 0x574E,
+ 0x582A, 0x5D4C, 0x611F, 0x61BE, 0x6221, 0x6562, 0x67D1, 0x6A44,
+ 0x6E1B, 0x7518, 0x75B3, 0x76E3, 0x77B0, 0x7D3A, 0x90AF, 0x9451,
+ 0x9452, 0x9F95, 0x5323, 0x5CAC, 0x7532, 0x80DB, 0x9240, 0x9598,
+ 0x525B, 0x5808, 0x59DC, 0x5CA1, 0x5D17, 0x5EB7, 0x5F3A, 0x5F4A,
+ 0x6177, 0x6C5F, 0x757A, 0x7586, 0x7CE0, 0x7D73, 0x7DB1, 0x7F8C,
+ 0x8154, 0x8221, 0x8591, 0x8941, 0x8B1B, 0x92FC, 0x964D, 0x9C47,
+ 0x4ECB, 0x4EF7, 0x500B, 0x51F1, 0x584F, 0x6137, 0x613E, 0x6168,
+ 0x6539, 0x69EA, 0x6F11, 0x75A5, 0x7686, 0x76D6, 0x7B87, 0x82A5,
+ 0x84CB, 0x93A7, 0x958B, 0x5580, 0x5BA2, 0x5751, 0x7CB3, 0x7FB9,
+ 0x91B5, 0x5028, 0x53BB, 0x5C45, 0x5DE8, 0x62D2, 0x636E, 0x64DA,
+ 0x64E7, 0x6E20, 0x70AC, 0x795B, 0x8DDD, 0x8E1E, 0x907D, 0x9245,
+ 0x92F8, 0x4E7E, 0x4EF6, 0x5065, 0x5DFE, 0x5EFA, 0x6106, 0x6957,
+ 0x8171, 0x8654, 0x8E47, 0x9375, 0x9A2B, 0x4E5E, 0x5091, 0x6770,
+ 0x6840, 0x5109, 0x528D, 0x5292, 0x6AA2, 0x77BC, 0x9210, 0x9ED4,
+ 0x52AB, 0x602F, 0x8FF2, 0x5048, 0x61A9, 0x63ED, 0x64CA, 0x683C,
+ 0x6A84, 0x6FC0, 0x8188, 0x89A1, 0x9694, 0x5805, 0x727D, 0x72AC,
+ 0x7504, 0x7D79, 0x7E6D, 0x80A9, 0x898B, 0x8B74, 0x9063, 0x9D51,
+ 0x6289, 0x6C7A, 0x6F54, 0x7D50, 0x7F3A, 0x8A23, 0x517C, 0x614A,
+ 0x7B9D, 0x8B19, 0x9257, 0x938C, 0x4EAC, 0x4FD3, 0x501E, 0x50BE,
+ 0x5106, 0x52C1, 0x52CD, 0x537F, 0x5770, 0x5883, 0x5E9A, 0x5F91,
+ 0x6176, 0x61AC, 0x64CE, 0x656C, 0x666F, 0x66BB, 0x66F4, 0x6897,
+ 0x6D87, 0x7085, 0x70F1, 0x749F, 0x74A5, 0x74CA, 0x75D9, 0x786C,
+ 0x78EC, 0x7ADF, 0x7AF6, 0x7D45, 0x7D93, 0x8015, 0x803F, 0x811B,
+ 0x8396, 0x8B66, 0x8F15, 0x9015, 0x93E1, 0x9803, 0x9838, 0x9A5A,
+ 0x9BE8, 0x4FC2, 0x5553, 0x583A, 0x5951, 0x5B63, 0x5C46, 0x60B8,
+ 0x6212, 0x6842, 0x68B0, 0x68E8, 0x6EAA, 0x754C, 0x7678, 0x78CE,
+ 0x7A3D, 0x7CFB, 0x7E6B, 0x7E7C, 0x8A08, 0x8AA1, 0x8C3F, 0x968E,
+ 0x9DC4, 0x53E4, 0x53E9, 0x544A, 0x5471, 0x56FA, 0x59D1, 0x5B64,
+ 0x5C3B, 0x5EAB, 0x62F7, 0x6537, 0x6545, 0x6572, 0x66A0, 0x67AF,
+ 0x69C1, 0x6CBD, 0x75FC, 0x7690, 0x777E, 0x7A3F, 0x7F94, 0x8003,
+ 0x80A1, 0x818F, 0x82E6, 0x82FD, 0x83F0, 0x85C1, 0x8831, 0x88B4,
+ 0x8AA5, 0x8F9C, 0x932E, 0x96C7, 0x9867, 0x9AD8, 0x9F13, 0x54ED,
+ 0x659B, 0x66F2, 0x688F, 0x7A40, 0x8C37, 0x9D60, 0x56F0, 0x5764,
+ 0x5D11, 0x6606, 0x68B1, 0x68CD, 0x6EFE, 0x7428, 0x889E, 0x9BE4,
+ 0x6C68, 0x9AA8, 0x4F9B, 0x516C, 0x5171, 0x529F, 0x5B54, 0x5DE5,
+ 0x6050, 0x606D, 0x62F1, 0x63A7, 0x653B, 0x73D9, 0x7A7A, 0x86A3,
+ 0x8CA2, 0x978F, 0x4E32, 0x5BE1, 0x6208, 0x679C, 0x74DC, 0x79D1,
+ 0x83D3, 0x8A87, 0x8AB2, 0x8DE8, 0x904E, 0x934B, 0x9846, 0x5ED3,
+ 0x69E8, 0x85FF, 0x90ED, 0x51A0, 0x5B98, 0x5BEC, 0x6163, 0x68FA,
+ 0x6B3E, 0x704C, 0x742F, 0x74D8, 0x7BA1, 0x7F50, 0x83C5, 0x89C0,
+ 0x8CAB, 0x95DC, 0x9928, 0x522E, 0x605D, 0x62EC, 0x9002, 0x4F8A,
+ 0x5149, 0x5321, 0x58D9, 0x5EE3, 0x66E0, 0x6D38, 0x709A, 0x72C2,
+ 0x73D6, 0x7B50, 0x80F1, 0x945B, 0x5366, 0x639B, 0x7F6B, 0x4E56,
+ 0x5080, 0x584A, 0x58DE, 0x602A, 0x6127, 0x62D0, 0x69D0, 0x9B41,
+ 0x5B8F, 0x7D18, 0x80B1, 0x8F5F, 0x4EA4, 0x50D1, 0x54AC, 0x55AC,
+ 0x5B0C, 0x5DA0, 0x5DE7, 0x652A, 0x654E, 0x6821, 0x6A4B, 0x72E1,
+ 0x768E, 0x77EF, 0x7D5E, 0x7FF9, 0x81A0, 0x854E, 0x86DF, 0x8F03,
+ 0x8F4E, 0x90CA, 0x9903, 0x9A55, 0x9BAB, 0x4E18, 0x4E45, 0x4E5D,
+ 0x4EC7, 0x4FF1, 0x5177, 0x52FE, 0x5340, 0x53E3, 0x53E5, 0x548E,
+ 0x5614, 0x5775, 0x57A2, 0x5BC7, 0x5D87, 0x5ED0, 0x61FC, 0x62D8,
+ 0x6551, 0x67B8, 0x67E9, 0x69CB, 0x6B50, 0x6BC6, 0x6BEC, 0x6C42,
+ 0x6E9D, 0x7078, 0x72D7, 0x7396, 0x7403, 0x77BF, 0x77E9, 0x7A76,
+ 0x7D7F, 0x8009, 0x81FC, 0x8205, 0x820A, 0x82DF, 0x8862, 0x8B33,
+ 0x8CFC, 0x8EC0, 0x9011, 0x90B1, 0x9264, 0x92B6, 0x99D2, 0x9A45,
+ 0x9CE9, 0x9DD7, 0x9F9C, 0x570B, 0x5C40, 0x83CA, 0x97A0, 0x97AB,
+ 0x9EB4, 0x541B, 0x7A98, 0x7FA4, 0x88D9, 0x8ECD, 0x90E1, 0x5800,
+ 0x5C48, 0x6398, 0x7A9F, 0x5BAE, 0x5F13, 0x7A79, 0x7AAE, 0x828E,
+ 0x8EAC, 0x5026, 0x5238, 0x52F8, 0x5377, 0x5708, 0x62F3, 0x6372,
+ 0x6B0A, 0x6DC3, 0x7737, 0x53A5, 0x7357, 0x8568, 0x8E76, 0x95D5,
+ 0x673A, 0x6AC3, 0x6F70, 0x8A6D, 0x8ECC, 0x994B, 0x6677, 0x6B78,
+ 0x8CB4, 0x9B3C, 0x53EB, 0x572D, 0x594E, 0x63C6, 0x69FB, 0x73EA,
+ 0x7845, 0x7ABA, 0x7AC5, 0x7CFE, 0x8475, 0x898F, 0x8D73, 0x9035,
+ 0x95A8, 0x52FB, 0x5747, 0x7547, 0x7B60, 0x83CC, 0x921E, 0x6A58,
+ 0x514B, 0x524B, 0x5287, 0x621F, 0x68D8, 0x6975, 0x9699, 0x50C5,
+ 0x52A4, 0x52E4, 0x61C3, 0x65A4, 0x6839, 0x69FF, 0x747E, 0x7B4B,
+ 0x82B9, 0x83EB, 0x89B2, 0x8B39, 0x8FD1, 0x9949, 0x4ECA, 0x5997,
+ 0x64D2, 0x6611, 0x6A8E, 0x7434, 0x7981, 0x79BD, 0x82A9, 0x887E,
+ 0x887F, 0x895F, 0x9326, 0x4F0B, 0x53CA, 0x6025, 0x6271, 0x6C72,
+ 0x7D1A, 0x7D66, 0x4E98, 0x5162, 0x77DC, 0x80AF, 0x4F01, 0x4F0E,
+ 0x5176, 0x5180, 0x55DC, 0x5668, 0x573B, 0x57FA, 0x57FC, 0x5914,
+ 0x5947, 0x5993, 0x5BC4, 0x5C90, 0x5D0E, 0x5DF1, 0x5E7E, 0x5FCC,
+ 0x6280, 0x65D7, 0x65E3, 0x671E, 0x671F, 0x675E, 0x68CB, 0x68C4,
+ 0x6A5F, 0x6B3A, 0x6C23, 0x6C7D, 0x6C82, 0x6DC7, 0x7398, 0x7426,
+ 0x742A, 0x7482, 0x74A3, 0x7578, 0x757F, 0x7881, 0x78EF, 0x7941,
+ 0x7947, 0x7948, 0x797A, 0x7B95, 0x7D00, 0x7DBA, 0x7F88, 0x8006,
+ 0x802D, 0x808C, 0x8A18, 0x8B4F, 0x8C48, 0x8D77, 0x9321, 0x9324,
+ 0x98E2, 0x9951, 0x9A0E, 0x9A0F, 0x9A65, 0x9E92, 0x7DCA, 0x4F76,
+ 0x5409, 0x62EE, 0x6854, 0x91D1, 0x55AB, 0x513A, 0x5A1C, 0x61E6,
+ 0x62CF, 0x62FF, 0x90A3, 0x8AFE, 0x6696, 0x7156, 0x96E3, 0x634F,
+ 0x637A, 0x5357, 0x678F, 0x6960, 0x6E73, 0x7537, 0x7D0D, 0x8872,
+ 0x56CA, 0x5A18, 0x4E43, 0x5167, 0x5948, 0x67F0, 0x8010, 0x5973,
+ 0x5E74, 0x649A, 0x79CA, 0x5FF5, 0x606C, 0x62C8, 0x637B, 0x5BE7,
+ 0x5BD7, 0x52AA, 0x5974, 0x5F29, 0x6012, 0x7459, 0x99D1, 0x6FC3,
+ 0x81BF, 0x8FB2, 0x60F1, 0x8166, 0x5C3F, 0x5AE9, 0x8A25, 0x677B,
+ 0x7D10, 0x80FD, 0x5C3C, 0x6CE5, 0x533F, 0x6EBA, 0x591A, 0x8336,
+ 0x4E39, 0x4EB6, 0x4F46, 0x55AE, 0x5718, 0x58C7, 0x5F56, 0x65B7,
+ 0x65E6, 0x6A80, 0x6BB5, 0x6E4D, 0x77ED, 0x7AEF, 0x7C1E, 0x7DDE,
+ 0x86CB, 0x8892, 0x9132, 0x935B, 0x64BB, 0x6FBE, 0x737A, 0x75B8,
+ 0x9054, 0x5556, 0x574D, 0x61BA, 0x64D4, 0x66C7, 0x6DE1, 0x6E5B,
+ 0x6F6D, 0x6FB9, 0x75F0, 0x8043, 0x81BD, 0x8541, 0x8983, 0x8AC7,
+ 0x8B5A, 0x931F, 0x6C93, 0x7553, 0x7B54, 0x8E0F, 0x905D, 0x5510,
+ 0x5802, 0x5858, 0x5E62, 0x6207, 0x649E, 0x68E0, 0x7576, 0x7CD6,
+ 0x87B3, 0x9EE8, 0x4EE3, 0x5788, 0x576E, 0x5927, 0x5C0D, 0x5CB1,
+ 0x5E36, 0x5F85, 0x6234, 0x64E1, 0x73B3, 0x81FA, 0x888B, 0x8CB8,
+ 0x968A, 0x9EDB, 0x5B85, 0x5FB7, 0x60B3, 0x5012, 0x5200, 0x5230,
+ 0x5716, 0x5835, 0x5857, 0x5C0E, 0x5C60, 0x5CF6, 0x5D8B, 0x5EA6,
+ 0x5F92, 0x60BC, 0x6311, 0x6389, 0x6417, 0x6843, 0x68F9, 0x6AC2,
+ 0x6DD8, 0x6E21, 0x6ED4, 0x6FE4, 0x71FE, 0x76DC, 0x7779, 0x79B1,
+ 0x7A3B, 0x8404, 0x89A9, 0x8CED, 0x8DF3, 0x8E48, 0x9003, 0x9014,
+ 0x9053, 0x90FD, 0x934D, 0x9676, 0x97DC, 0x6BD2, 0x7006, 0x7258,
+ 0x72A2, 0x7368, 0x7763, 0x79BF, 0x7BE4, 0x7E9B, 0x8B80, 0x58A9,
+ 0x60C7, 0x6566, 0x65FD, 0x66BE, 0x6C8C, 0x711E, 0x71C9, 0x8C5A,
+ 0x9813, 0x4E6D, 0x7A81, 0x4EDD, 0x51AC, 0x51CD, 0x52D5, 0x540C,
+ 0x61A7, 0x6771, 0x6850, 0x68DF, 0x6D1E, 0x6F7C, 0x75BC, 0x77B3,
+ 0x7AE5, 0x80F4, 0x8463, 0x9285, 0x515C, 0x6597, 0x675C, 0x6793,
+ 0x75D8, 0x7AC7, 0x8373, 0x8C46, 0x9017, 0x982D, 0x5C6F, 0x81C0,
+ 0x829A, 0x9041, 0x906F, 0x920D, 0x5F97, 0x5D9D, 0x6A59, 0x71C8,
+ 0x767B, 0x7B49, 0x85E4, 0x8B04, 0x9127, 0x9A30, 0x5587, 0x61F6,
+ 0x7669, 0x7F85, 0x863F, 0x87BA, 0x88F8, 0x908F, 0x6D1B, 0x70D9,
+ 0x73DE, 0x7D61, 0x843D, 0x916A, 0x99F1, 0x4E82, 0x5375, 0x6B04,
+ 0x6B12, 0x703E, 0x721B, 0x862D, 0x9E1E, 0x524C, 0x8FA3, 0x5D50,
+ 0x64E5, 0x652C, 0x6B16, 0x6FEB, 0x7C43, 0x7E9C, 0x85CD, 0x8964,
+ 0x89BD, 0x62C9, 0x81D8, 0x881F, 0x5ECA, 0x6717, 0x6D6A, 0x72FC,
+ 0x7405, 0x746F, 0x8782, 0x90DE, 0x4F86, 0x5D0D, 0x5FA0, 0x840A,
+ 0x51B7, 0x63A0, 0x7565, 0x4EAE, 0x5006, 0x5169, 0x51C9, 0x6881,
+ 0x6A11, 0x7CAE, 0x7CB1, 0x7CE7, 0x826F, 0x8AD2, 0x8F1B, 0x91CF,
+ 0x4FB6, 0x5137, 0x52F5, 0x5442, 0x5EEC, 0x616E, 0x623E, 0x65C5,
+ 0x6ADA, 0x6FFE, 0x792A, 0x85DC, 0x8823, 0x95AD, 0x9A62, 0x9A6A,
+ 0x9E97, 0x9ECE, 0x529B, 0x66C6, 0x6B77, 0x701D, 0x792B, 0x8F62,
+ 0x9742, 0x6190, 0x6200, 0x6523, 0x6F23, 0x7149, 0x7489, 0x7DF4,
+ 0x806F, 0x84EE, 0x8F26, 0x9023, 0x934A, 0x51BD, 0x5217, 0x52A3,
+ 0x6D0C, 0x70C8, 0x88C2, 0x5EC9, 0x6582, 0x6BAE, 0x6FC2, 0x7C3E,
+ 0x7375, 0x4EE4, 0x4F36, 0x56F9, 0x5CBA, 0x5DBA, 0x601C, 0x73B2,
+ 0x7B2D, 0x7F9A, 0x7FCE, 0x8046, 0x901E, 0x9234, 0x96F6, 0x9748,
+ 0x9818, 0x9F61, 0x4F8B, 0x6FA7, 0x79AE, 0x91B4, 0x96B7, 0x52DE,
+ 0x6488, 0x64C4, 0x6AD3, 0x6F5E, 0x7018, 0x7210, 0x76E7, 0x8001,
+ 0x8606, 0x865C, 0x8DEF, 0x8F05, 0x9732, 0x9B6F, 0x9DFA, 0x9E75,
+ 0x788C, 0x797F, 0x7DA0, 0x83C9, 0x9304, 0x9E7F, 0x9E93, 0x8AD6,
+ 0x58DF, 0x5F04, 0x6727, 0x7027, 0x74CF, 0x7C60, 0x807E, 0x5121,
+ 0x7028, 0x7262, 0x78CA, 0x8CC2, 0x8CDA, 0x8CF4, 0x96F7, 0x4E86,
+ 0x50DA, 0x5BEE, 0x5ED6, 0x6599, 0x71CE, 0x7642, 0x77AD, 0x804A,
+ 0x84FC, 0x907C, 0x9B27, 0x9F8D, 0x58D8, 0x5A41, 0x5C62, 0x6A13,
+ 0x6DDA, 0x6F0F, 0x763B, 0x7D2F, 0x7E37, 0x851E, 0x8938, 0x93E4,
+ 0x964B, 0x5289, 0x65D2, 0x67F3, 0x69B4, 0x6D41, 0x6E9C, 0x700F,
+ 0x7409, 0x7460, 0x7559, 0x7624, 0x786B, 0x8B2C, 0x985E, 0x516D,
+ 0x622E, 0x9678, 0x4F96, 0x502B, 0x5D19, 0x6DEA, 0x7DB8, 0x8F2A,
+ 0x5F8B, 0x6144, 0x6817, 0x9686, 0x52D2, 0x808B, 0x51DC, 0x51CC,
+ 0x695E, 0x7A1C, 0x7DBE, 0x83F1, 0x9675, 0x4FDA, 0x5229, 0x5398,
+ 0x540F, 0x550E, 0x5C65, 0x60A7, 0x674E, 0x68A8, 0x6D6C, 0x7281,
+ 0x72F8, 0x7406, 0x7483, 0x75E2, 0x7C6C, 0x7F79, 0x7FB8, 0x8389,
+ 0x88CF, 0x88E1, 0x91CC, 0x91D0, 0x96E2, 0x9BC9, 0x541D, 0x6F7E,
+ 0x71D0, 0x7498, 0x85FA, 0x8EAA, 0x96A3, 0x9C57, 0x9E9F, 0x6797,
+ 0x6DCB, 0x7433, 0x81E8, 0x9716, 0x782C, 0x7ACB, 0x7B20, 0x7C92,
+ 0x6469, 0x746A, 0x75F2, 0x78BC, 0x78E8, 0x99AC, 0x9B54, 0x9EBB,
+ 0x5BDE, 0x5E55, 0x6F20, 0x819C, 0x83AB, 0x9088, 0x4E07, 0x534D,
+ 0x5A29, 0x5DD2, 0x5F4E, 0x6162, 0x633D, 0x6669, 0x66FC, 0x6EFF,
+ 0x6F2B, 0x7063, 0x779E, 0x842C, 0x8513, 0x883B, 0x8F13, 0x9945,
+ 0x9C3B, 0x551C, 0x62B9, 0x672B, 0x6CAB, 0x8309, 0x896A, 0x977A,
+ 0x4EA1, 0x5984, 0x5FD8, 0x5FD9, 0x671B, 0x7DB2, 0x7F54, 0x8292,
+ 0x832B, 0x83BD, 0x8F1E, 0x9099, 0x57CB, 0x59B9, 0x5A92, 0x5BD0,
+ 0x6627, 0x679A, 0x6885, 0x6BCF, 0x7164, 0x7F75, 0x8CB7, 0x8CE3,
+ 0x9081, 0x9B45, 0x8108, 0x8C8A, 0x964C, 0x9A40, 0x9EA5, 0x5B5F,
+ 0x6C13, 0x731B, 0x76F2, 0x76DF, 0x840C, 0x51AA, 0x8993, 0x514D,
+ 0x5195, 0x52C9, 0x68C9, 0x6C94, 0x7704, 0x7720, 0x7DBF, 0x7DEC,
+ 0x9762, 0x9EB5, 0x6EC5, 0x8511, 0x51A5, 0x540D, 0x547D, 0x660E,
+ 0x669D, 0x6927, 0x6E9F, 0x76BF, 0x7791, 0x8317, 0x84C2, 0x879F,
+ 0x9169, 0x9298, 0x9CF4, 0x8882, 0x4FAE, 0x5192, 0x52DF, 0x59C6,
+ 0x5E3D, 0x6155, 0x6478, 0x6479, 0x66AE, 0x67D0, 0x6A21, 0x6BCD,
+ 0x6BDB, 0x725F, 0x7261, 0x7441, 0x7738, 0x77DB, 0x8017, 0x82BC,
+ 0x8305, 0x8B00, 0x8B28, 0x8C8C, 0x6728, 0x6C90, 0x7267, 0x76EE,
+ 0x7766, 0x7A46, 0x9DA9, 0x6B7F, 0x6C92, 0x5922, 0x6726, 0x8499,
+ 0x536F, 0x5893, 0x5999, 0x5EDF, 0x63CF, 0x6634, 0x6773, 0x6E3A,
+ 0x732B, 0x7AD7, 0x82D7, 0x9328, 0x52D9, 0x5DEB, 0x61AE, 0x61CB,
+ 0x620A, 0x62C7, 0x64AB, 0x65E0, 0x6959, 0x6B66, 0x6BCB, 0x7121,
+ 0x73F7, 0x755D, 0x7E46, 0x821E, 0x8302, 0x856A, 0x8AA3, 0x8CBF,
+ 0x9727, 0x9D61, 0x58A8, 0x9ED8, 0x5011, 0x520E, 0x543B, 0x554F,
+ 0x6587, 0x6C76, 0x7D0A, 0x7D0B, 0x805E, 0x868A, 0x9580, 0x96EF,
+ 0x52FF, 0x6C95, 0x7269, 0x5473, 0x5A9A, 0x5C3E, 0x5D4B, 0x5F4C,
+ 0x5FAE, 0x672A, 0x68B6, 0x6963, 0x6E3C, 0x6E44, 0x7709, 0x7C73,
+ 0x7F8E, 0x8587, 0x8B0E, 0x8FF7, 0x9761, 0x9EF4, 0x5CB7, 0x60B6,
+ 0x610D, 0x61AB, 0x654F, 0x65FB, 0x65FC, 0x6C11, 0x6CEF, 0x739F,
+ 0x73C9, 0x7DE1, 0x9594, 0x5BC6, 0x871C, 0x8B10, 0x525D, 0x535A,
+ 0x62CD, 0x640F, 0x64B2, 0x6734, 0x6A38, 0x6CCA, 0x73C0, 0x749E,
+ 0x7B94, 0x7C95, 0x7E1B, 0x818A, 0x8236, 0x8584, 0x8FEB, 0x96F9,
+ 0x99C1, 0x4F34, 0x534A, 0x53CD, 0x53DB, 0x62CC, 0x642C, 0x6500,
+ 0x6591, 0x69C3, 0x6CEE, 0x6F58, 0x73ED, 0x7554, 0x7622, 0x76E4,
+ 0x76FC, 0x78D0, 0x78FB, 0x792C, 0x7D46, 0x822C, 0x87E0, 0x8FD4,
+ 0x9812, 0x98EF, 0x52C3, 0x62D4, 0x64A5, 0x6E24, 0x6F51, 0x767C,
+ 0x8DCB, 0x91B1, 0x9262, 0x9AEE, 0x9B43, 0x5023, 0x508D, 0x574A,
+ 0x59A8, 0x5C28, 0x5E47, 0x5F77, 0x623F, 0x653E, 0x65B9, 0x65C1,
+ 0x6609, 0x678B, 0x699C, 0x6EC2, 0x78C5, 0x7D21, 0x80AA, 0x8180,
+ 0x822B, 0x82B3, 0x84A1, 0x868C, 0x8A2A, 0x8B17, 0x90A6, 0x9632,
+ 0x9F90, 0x500D, 0x4FF3, 0x57F9, 0x5F98, 0x62DC, 0x6392, 0x676F,
+ 0x6E43, 0x7119, 0x76C3, 0x80CC, 0x80DA, 0x88F4, 0x88F5, 0x8919,
+ 0x8CE0, 0x8F29, 0x914D, 0x966A, 0x4F2F, 0x4F70, 0x5E1B, 0x67CF,
+ 0x6822, 0x767D, 0x767E, 0x9B44, 0x5E61, 0x6A0A, 0x7169, 0x71D4,
+ 0x756A, 0x7E41, 0x8543, 0x85E9, 0x98DC, 0x4F10, 0x7B4F, 0x7F70,
+ 0x95A5, 0x51E1, 0x5E06, 0x68B5, 0x6C3E, 0x6C4E, 0x6CDB, 0x72AF,
+ 0x7BC4, 0x8303, 0x6CD5, 0x743A, 0x50FB, 0x5288, 0x58C1, 0x64D8,
+ 0x6A97, 0x74A7, 0x7656, 0x78A7, 0x8617, 0x95E2, 0x9739, 0x535E,
+ 0x5F01, 0x8B8A, 0x8FA8, 0x8FAF, 0x908A, 0x5225, 0x77A5, 0x9C49,
+ 0x9F08, 0x4E19, 0x5002, 0x5175, 0x5C5B, 0x5E77, 0x661E, 0x663A,
+ 0x67C4, 0x68C5, 0x70B3, 0x7501, 0x75C5, 0x79C9, 0x7ADD, 0x8F27,
+ 0x9920, 0x9A08, 0x4FDD, 0x5821, 0x5831, 0x5BF6, 0x666E, 0x6B65,
+ 0x6D11, 0x6E7A, 0x6F7D, 0x73E4, 0x752B, 0x83E9, 0x88DC, 0x8913,
+ 0x8B5C, 0x8F14, 0x4F0F, 0x50D5, 0x5310, 0x535C, 0x5B93, 0x5FA9,
+ 0x670D, 0x798F, 0x8179, 0x832F, 0x8514, 0x8907, 0x8986, 0x8F39,
+ 0x8F3B, 0x99A5, 0x9C12, 0x672C, 0x4E76, 0x4FF8, 0x5949, 0x5C01,
+ 0x5CEF, 0x5CF0, 0x6367, 0x68D2, 0x70FD, 0x71A2, 0x742B, 0x7E2B,
+ 0x84EC, 0x8702, 0x9022, 0x92D2, 0x9CF3, 0x4E0D, 0x4ED8, 0x4FEF,
+ 0x5085, 0x5256, 0x526F, 0x5426, 0x5490, 0x57E0, 0x592B, 0x5A66,
+ 0x5B5A, 0x5B75, 0x5BCC, 0x5E9C, 0x6276, 0x6577, 0x65A7, 0x6D6E,
+ 0x6EA5, 0x7236, 0x7B26, 0x7C3F, 0x7F36, 0x8150, 0x8151, 0x819A,
+ 0x8240, 0x8299, 0x83A9, 0x8A03, 0x8CA0, 0x8CE6, 0x8CFB, 0x8D74,
+ 0x8DBA, 0x90E8, 0x91DC, 0x961C, 0x9644, 0x99D9, 0x9CE7, 0x5317,
+ 0x5206, 0x5429, 0x5674, 0x58B3, 0x5954, 0x596E, 0x5FFF, 0x61A4,
+ 0x626E, 0x6610, 0x6C7E, 0x711A, 0x76C6, 0x7C89, 0x7CDE, 0x7D1B,
+ 0x82AC, 0x8CC1, 0x96F0, 0x4F5B, 0x5F17, 0x5F7F, 0x62C2, 0x5D29,
+ 0x670B, 0x68DA, 0x787C, 0x7E43, 0x9D6C, 0x4E15, 0x5099, 0x5315,
+ 0x532A, 0x5351, 0x5983, 0x5A62, 0x5E87, 0x60B2, 0x618A, 0x6249,
+ 0x6279, 0x6590, 0x6787, 0x69A7, 0x6BD4, 0x6BD6, 0x6BD7, 0x6BD8,
+ 0x6CB8, 0x7435, 0x75FA, 0x7812, 0x7891, 0x79D5, 0x79D8, 0x7C83,
+ 0x7DCB, 0x7FE1, 0x80A5, 0x813E, 0x81C2, 0x83F2, 0x871A, 0x88E8,
+ 0x8AB9, 0x8B6C, 0x8CBB, 0x9119, 0x975E, 0x98DB, 0x9F3B, 0x56AC,
+ 0x5B2A, 0x5F6C, 0x658C, 0x6AB3, 0x6BAF, 0x6D5C, 0x6FF1, 0x7015,
+ 0x725D, 0x73AD, 0x8CA7, 0x8CD3, 0x983B, 0x6191, 0x6C37, 0x8058,
+ 0x9A01, 0x4E4D, 0x4E8B, 0x4E9B, 0x4ED5, 0x4F3A, 0x4F3C, 0x4F7F,
+ 0x4FDF, 0x50FF, 0x53F2, 0x53F8, 0x5506, 0x55E3, 0x56DB, 0x58EB,
+ 0x5962, 0x5A11, 0x5BEB, 0x5BFA, 0x5C04, 0x5DF3, 0x5E2B, 0x5F99,
+ 0x601D, 0x6368, 0x659C, 0x65AF, 0x67F6, 0x67FB, 0x68AD, 0x6B7B,
+ 0x6C99, 0x6CD7, 0x6E23, 0x7009, 0x7345, 0x7802, 0x793E, 0x7940,
+ 0x7960, 0x79C1, 0x7BE9, 0x7D17, 0x7D72, 0x8086, 0x820D, 0x838E,
+ 0x84D1, 0x86C7, 0x88DF, 0x8A50, 0x8A5E, 0x8B1D, 0x8CDC, 0x8D66,
+ 0x8FAD, 0x90AA, 0x98FC, 0x99DF, 0x9E9D, 0x524A, 0x6714, 0x5098,
+ 0x522A, 0x5C71, 0x6563, 0x6C55, 0x73CA, 0x7523, 0x759D, 0x7B97,
+ 0x849C, 0x9178, 0x9730, 0x4E77, 0x6492, 0x6BBA, 0x715E, 0x85A9,
+ 0x4E09, 0x6749, 0x68EE, 0x6E17, 0x829F, 0x8518, 0x886B, 0x63F7,
+ 0x6F81, 0x9212, 0x98AF, 0x4E0A, 0x50B7, 0x50CF, 0x511F, 0x5546,
+ 0x55AA, 0x5617, 0x5B40, 0x5C19, 0x5CE0, 0x5E38, 0x5E8A, 0x5EA0,
+ 0x5EC2, 0x60F3, 0x6851, 0x6A61, 0x6E58, 0x723D, 0x7240, 0x72C0,
+ 0x76F8, 0x7965, 0x7BB1, 0x7FD4, 0x88F3, 0x89F4, 0x8A73, 0x8C61,
+ 0x8CDE, 0x971C, 0x585E, 0x74BD, 0x8CFD, 0x55C7, 0x7A61, 0x7D22,
+ 0x8272, 0x7272, 0x751F, 0x7525, 0x7B19, 0x5885, 0x58FB, 0x5DBC,
+ 0x5E8F, 0x5EB6, 0x5F90, 0x6055, 0x6292, 0x637F, 0x654D, 0x6691,
+ 0x66D9, 0x66F8, 0x6816, 0x68F2, 0x7280, 0x745E, 0x7B6E, 0x7D6E,
+ 0x7DD6, 0x7F72, 0x80E5, 0x8212, 0x85AF, 0x897F, 0x8A93, 0x901D,
+ 0x92E4, 0x9ECD, 0x9F20, 0x5915, 0x596D, 0x5E2D, 0x60DC, 0x6614,
+ 0x6673, 0x6790, 0x6C50, 0x6DC5, 0x6F5F, 0x77F3, 0x78A9, 0x84C6,
+ 0x91CB, 0x932B, 0x4ED9, 0x50CA, 0x5148, 0x5584, 0x5B0B, 0x5BA3,
+ 0x6247, 0x657E, 0x65CB, 0x6E32, 0x717D, 0x7401, 0x7444, 0x7487,
+ 0x74BF, 0x766C, 0x79AA, 0x7DDA, 0x7E55, 0x7FA8, 0x817A, 0x81B3,
+ 0x8239, 0x861A, 0x87EC, 0x8A75, 0x8DE3, 0x9078, 0x9291, 0x9425,
+ 0x994D, 0x9BAE, 0x5368, 0x5C51, 0x6954, 0x6CC4, 0x6D29, 0x6E2B,
+ 0x820C, 0x859B, 0x893B, 0x8A2D, 0x8AAA, 0x96EA, 0x9F67, 0x5261,
+ 0x66B9, 0x6BB2, 0x7E96, 0x87FE, 0x8D0D, 0x9583, 0x965D, 0x651D,
+ 0x6D89, 0x71EE, 0x57CE, 0x59D3, 0x5BAC, 0x6027, 0x60FA, 0x6210,
+ 0x661F, 0x665F, 0x7329, 0x73F9, 0x76DB, 0x7701, 0x7B6C, 0x8056,
+ 0x8072, 0x8165, 0x8AA0, 0x9192, 0x4E16, 0x52E2, 0x6B72, 0x6D17,
+ 0x7A05, 0x7B39, 0x7D30, 0x8CB0, 0x53EC, 0x562F, 0x5851, 0x5BB5,
+ 0x5C0F, 0x5C11, 0x5DE2, 0x6240, 0x6383, 0x6414, 0x662D, 0x68B3,
+ 0x6CBC, 0x6D88, 0x6EAF, 0x701F, 0x70A4, 0x71D2, 0x7526, 0x758F,
+ 0x758E, 0x7619, 0x7B11, 0x7BE0, 0x7C2B, 0x7D20, 0x7D39, 0x852C,
+ 0x856D, 0x8607, 0x8A34, 0x900D, 0x9061, 0x90B5, 0x92B7, 0x97F6,
+ 0x9A37, 0x4FD7, 0x5C6C, 0x675F, 0x6D91, 0x7C9F, 0x7E8C, 0x8B16,
+ 0x8D16, 0x901F, 0x5B6B, 0x5DFD, 0x640D, 0x84C0, 0x905C, 0x98E1,
+ 0x7387, 0x5B8B, 0x609A, 0x677E, 0x6DDE, 0x8A1F, 0x8AA6, 0x9001,
+ 0x980C, 0x5237, 0x7051, 0x788E, 0x9396, 0x8870, 0x91D7, 0x4FEE,
+ 0x53D7, 0x55FD, 0x56DA, 0x5782, 0x58FD, 0x5AC2, 0x5B88, 0x5CAB,
+ 0x5CC0, 0x5E25, 0x6101, 0x620D, 0x624B, 0x6388, 0x641C, 0x6536,
+ 0x6578, 0x6A39, 0x6B8A, 0x6C34, 0x6D19, 0x6F31, 0x71E7, 0x72E9,
+ 0x7378, 0x7407, 0x74B2, 0x7626, 0x7761, 0x79C0, 0x7A57, 0x7AEA,
+ 0x7CB9, 0x7D8F, 0x7DAC, 0x7E61, 0x7F9E, 0x8129, 0x8331, 0x8490,
+ 0x84DA, 0x85EA, 0x8896, 0x8AB0, 0x8B90, 0x8F38, 0x9042, 0x9083,
+ 0x916C, 0x9296, 0x92B9, 0x968B, 0x96A7, 0x96A8, 0x96D6, 0x9700,
+ 0x9808, 0x9996, 0x9AD3, 0x9B1A, 0x53D4, 0x587E, 0x5919, 0x5B70,
+ 0x5BBF, 0x6DD1, 0x6F5A, 0x719F, 0x7421, 0x74B9, 0x8085, 0x83FD,
+ 0x5DE1, 0x5F87, 0x5FAA, 0x6042, 0x65EC, 0x6812, 0x696F, 0x6A53,
+ 0x6B89, 0x6D35, 0x6DF3, 0x73E3, 0x76FE, 0x77AC, 0x7B4D, 0x7D14,
+ 0x8123, 0x821C, 0x8340, 0x84F4, 0x8563, 0x8A62, 0x8AC4, 0x9187,
+ 0x931E, 0x9806, 0x99B4, 0x620C, 0x8853, 0x8FF0, 0x9265, 0x5D07,
+ 0x5D27, 0x5D69, 0x745F, 0x819D, 0x8768, 0x6FD5, 0x62FE, 0x7FD2,
+ 0x8936, 0x8972, 0x4E1E, 0x4E58, 0x50E7, 0x52DD, 0x5347, 0x627F,
+ 0x6607, 0x7E69, 0x8805, 0x965E, 0x4F8D, 0x5319, 0x5636, 0x59CB,
+ 0x5AA4, 0x5C38, 0x5C4E, 0x5C4D, 0x5E02, 0x5F11, 0x6043, 0x65BD,
+ 0x662F, 0x6642, 0x67BE, 0x67F4, 0x731C, 0x77E2, 0x793A, 0x7FC5,
+ 0x8494, 0x84CD, 0x8996, 0x8A66, 0x8A69, 0x8AE1, 0x8C55, 0x8C7A,
+ 0x57F4, 0x5BD4, 0x5F0F, 0x606F, 0x62ED, 0x690D, 0x6B96, 0x6E5C,
+ 0x7184, 0x7BD2, 0x8755, 0x8B58, 0x8EFE, 0x98DF, 0x98FE, 0x4F38,
+ 0x4F81, 0x4FE1, 0x547B, 0x5A20, 0x5BB8, 0x613C, 0x65B0, 0x6668,
+ 0x71FC, 0x7533, 0x795E, 0x7D33, 0x814E, 0x81E3, 0x8398, 0x85AA,
+ 0x85CE, 0x8703, 0x8A0A, 0x8EAB, 0x8F9B, 0x8FC5, 0x5931, 0x5BA4,
+ 0x5BE6, 0x6089, 0x5BE9, 0x5C0B, 0x5FC3, 0x6C81, 0x6DF1, 0x700B,
+ 0x751A, 0x82AF, 0x8AF6, 0x4EC0, 0x5341, 0x96D9, 0x6C0F, 0x4E9E,
+ 0x4FC4, 0x5152, 0x555E, 0x5A25, 0x5CE8, 0x6211, 0x7259, 0x82BD,
+ 0x83AA, 0x86FE, 0x8859, 0x8A1D, 0x963F, 0x96C5, 0x9913, 0x9D09,
+ 0x9D5D, 0x580A, 0x5CB3, 0x5DBD, 0x5E44, 0x60E1, 0x6115, 0x63E1,
+ 0x6A02, 0x6E25, 0x9102, 0x9354, 0x984E, 0x9C10, 0x9F77, 0x5B89,
+ 0x5CB8, 0x6309, 0x664F, 0x6848, 0x773C, 0x96C1, 0x978D, 0x9854,
+ 0x9B9F, 0x65A1, 0x8B01, 0x8ECB, 0x95BC, 0x5535, 0x5CA9, 0x5DD6,
+ 0x5EB5, 0x6697, 0x764C, 0x83F4, 0x95C7, 0x58D3, 0x62BC, 0x72CE,
+ 0x9D28, 0x4EF0, 0x592E, 0x600F, 0x663B, 0x6B83, 0x79E7, 0x9D26,
+ 0x5393, 0x54C0, 0x57C3, 0x5D16, 0x611B, 0x66D6, 0x6DAF, 0x788D,
+ 0x827E, 0x9698, 0x9744, 0x5384, 0x627C, 0x6396, 0x6DB2, 0x7E0A,
+ 0x814B, 0x984D, 0x6AFB, 0x7F4C, 0x9DAF, 0x9E1A, 0x4E5F, 0x503B,
+ 0x51B6, 0x591C, 0x60F9, 0x63F6, 0x6930, 0x723A, 0x8036, 0x91CE,
+ 0x5F31, 0x7D04, 0x82E5, 0x846F, 0x84BB, 0x85E5, 0x8E8D, 0x4F6F,
+ 0x58E4, 0x5B43, 0x6059, 0x63DA, 0x6518, 0x656D, 0x6698, 0x694A,
+ 0x6A23, 0x6D0B, 0x7001, 0x716C, 0x75D2, 0x760D, 0x79B3, 0x7A70,
+ 0x7F8A, 0x8944, 0x8B93, 0x91C0, 0x967D, 0x990A, 0x5704, 0x5FA1,
+ 0x65BC, 0x6F01, 0x7600, 0x79A6, 0x8A9E, 0x99AD, 0x9B5A, 0x9F6C,
+ 0x5104, 0x61B6, 0x6291, 0x6A8D, 0x81C6, 0x5043, 0x5830, 0x5F66,
+ 0x7109, 0x8A00, 0x8AFA, 0x5B7C, 0x8616, 0x4FFA, 0x513C, 0x56B4,
+ 0x5944, 0x63A9, 0x6DF9, 0x5DAA, 0x696D, 0x5186, 0x4E88, 0x4F59,
+ 0x5982, 0x6B5F, 0x6C5D, 0x74B5, 0x7916, 0x8207, 0x8245, 0x8339,
+ 0x8F3F, 0x8F5D, 0x9918, 0x4EA6, 0x57DF, 0x5F79, 0x6613, 0x75AB,
+ 0x7E79, 0x8B6F, 0x9006, 0x9A5B, 0x56A5, 0x5827, 0x59F8, 0x5A1F,
+ 0x5BB4, 0x5EF6, 0x6350, 0x633B, 0x693D, 0x6C87, 0x6CBF, 0x6D8E,
+ 0x6D93, 0x6DF5, 0x6F14, 0x70DF, 0x7136, 0x7159, 0x71C3, 0x71D5,
+ 0x784F, 0x786F, 0x7B75, 0x7DE3, 0x7E2F, 0x884D, 0x8EDF, 0x925B,
+ 0x9CF6, 0x6085, 0x6D85, 0x71B1, 0x95B1, 0x53AD, 0x67D3, 0x708E,
+ 0x7130, 0x7430, 0x8276, 0x82D2, 0x95BB, 0x9AE5, 0x9E7D, 0x66C4,
+ 0x71C1, 0x8449, 0x584B, 0x5DB8, 0x5F71, 0x6620, 0x668E, 0x6979,
+ 0x69AE, 0x6C38, 0x6CF3, 0x6E36, 0x6F41, 0x6FDA, 0x701B, 0x702F,
+ 0x7150, 0x71DF, 0x7370, 0x745B, 0x74D4, 0x76C8, 0x7A4E, 0x7E93,
+ 0x82F1, 0x8A60, 0x8FCE, 0x9348, 0x9719, 0x4E42, 0x502A, 0x5208,
+ 0x53E1, 0x66F3, 0x6C6D, 0x6FCA, 0x730A, 0x777F, 0x7A62, 0x82AE,
+ 0x85DD, 0x8602, 0x88D4, 0x8A63, 0x8B7D, 0x8C6B, 0x92B3, 0x9713,
+ 0x9810, 0x4E94, 0x4F0D, 0x4FC9, 0x50B2, 0x5348, 0x543E, 0x5433,
+ 0x55DA, 0x5862, 0x58BA, 0x5967, 0x5A1B, 0x5BE4, 0x609F, 0x61CA,
+ 0x6556, 0x65FF, 0x6664, 0x68A7, 0x6C5A, 0x6FB3, 0x70CF, 0x71AC,
+ 0x7352, 0x7B7D, 0x8708, 0x8AA4, 0x9C32, 0x9F07, 0x5C4B, 0x6C83,
+ 0x7344, 0x7389, 0x923A, 0x6EAB, 0x7465, 0x761F, 0x7A69, 0x7E15,
+ 0x860A, 0x5140, 0x58C5, 0x64C1, 0x74EE, 0x7515, 0x7670, 0x7FC1,
+ 0x9095, 0x96CD, 0x9954, 0x6E26, 0x74E6, 0x7AA9, 0x7AAA, 0x81E5,
+ 0x86D9, 0x8778, 0x8A1B, 0x5A49, 0x5B8C, 0x5B9B, 0x68A1, 0x6900,
+ 0x6D63, 0x73A9, 0x7413, 0x742C, 0x7897, 0x7DE9, 0x7FEB, 0x8118,
+ 0x8155, 0x839E, 0x8C4C, 0x962E, 0x9811, 0x66F0, 0x5F80, 0x65FA,
+ 0x6789, 0x6C6A, 0x738B, 0x502D, 0x5A03, 0x6B6A, 0x77EE, 0x5916,
+ 0x5D6C, 0x5DCD, 0x7325, 0x754F, 0x50E5, 0x51F9, 0x582F, 0x592D,
+ 0x5996, 0x59DA, 0x5BE5, 0x5DA2, 0x62D7, 0x6416, 0x6493, 0x64FE,
+ 0x66DC, 0x6A48, 0x71FF, 0x7464, 0x7A88, 0x7AAF, 0x7E47, 0x7E5E,
+ 0x8000, 0x8170, 0x87EF, 0x8981, 0x8B20, 0x9059, 0x9080, 0x9952,
+ 0x617E, 0x6B32, 0x6D74, 0x7E1F, 0x8925, 0x8FB1, 0x4FD1, 0x50AD,
+ 0x5197, 0x52C7, 0x57C7, 0x5889, 0x5BB9, 0x5EB8, 0x6142, 0x6995,
+ 0x6D8C, 0x6E67, 0x6EB6, 0x7194, 0x7462, 0x7528, 0x752C, 0x8073,
+ 0x8338, 0x84C9, 0x8E0A, 0x9394, 0x93DE, 0x4E8E, 0x4F51, 0x5076,
+ 0x512A, 0x53C8, 0x53CB, 0x53F3, 0x5B87, 0x5BD3, 0x5C24, 0x611A,
+ 0x6182, 0x65F4, 0x725B, 0x7397, 0x7440, 0x76C2, 0x7950, 0x7991,
+ 0x79B9, 0x7D06, 0x7FBD, 0x828B, 0x85D5, 0x865E, 0x8FC2, 0x9047,
+ 0x90F5, 0x91EA, 0x9685, 0x96E8, 0x96E9, 0x52D6, 0x5F67, 0x65ED,
+ 0x6631, 0x682F, 0x715C, 0x7A36, 0x90C1, 0x980A, 0x4E91, 0x6A52,
+ 0x6B9E, 0x6F90, 0x7189, 0x8018, 0x82B8, 0x8553, 0x904B, 0x9695,
+ 0x96F2, 0x97FB, 0x851A, 0x9B31, 0x4E90, 0x718A, 0x96C4, 0x5143,
+ 0x539F, 0x54E1, 0x5713, 0x5712, 0x57A3, 0x5A9B, 0x5AC4, 0x5BC3,
+ 0x6028, 0x613F, 0x63F4, 0x6C85, 0x6D39, 0x6E72, 0x6E90, 0x7230,
+ 0x733F, 0x7457, 0x82D1, 0x8881, 0x8F45, 0x9060, 0x9662, 0x9858,
+ 0x9D1B, 0x6708, 0x8D8A, 0x925E, 0x4F4D, 0x5049, 0x50DE, 0x5371,
+ 0x570D, 0x59D4, 0x5A01, 0x5C09, 0x6170, 0x6690, 0x6E2D, 0x7232,
+ 0x744B, 0x7DEF, 0x80C3, 0x840E, 0x8466, 0x853F, 0x875F, 0x885B,
+ 0x8918, 0x8B02, 0x9055, 0x97CB, 0x9B4F, 0x4E73, 0x4F91, 0x5112,
+ 0x516A, 0x552F, 0x55A9, 0x5B7A, 0x5BA5, 0x5E7C, 0x5E7D, 0x5EBE,
+ 0x60A0, 0x60DF, 0x6108, 0x6109, 0x63C4, 0x6538, 0x6709, 0x67D4,
+ 0x67DA, 0x6961, 0x6962, 0x6CB9, 0x6D27, 0x6E38, 0x6FE1, 0x7336,
+ 0x7337, 0x745C, 0x7531, 0x7652, 0x7DAD, 0x81FE, 0x8438, 0x88D5,
+ 0x8A98, 0x8ADB, 0x8AED, 0x8E30, 0x8E42, 0x904A, 0x903E, 0x907A,
+ 0x9149, 0x91C9, 0x936E, 0x5809, 0x6BD3, 0x8089, 0x80B2, 0x5141,
+ 0x596B, 0x5C39, 0x6F64, 0x73A7, 0x80E4, 0x8D07, 0x9217, 0x958F,
+ 0x807F, 0x620E, 0x701C, 0x7D68, 0x878D, 0x57A0, 0x6069, 0x6147,
+ 0x6BB7, 0x8ABE, 0x9280, 0x96B1, 0x4E59, 0x541F, 0x6DEB, 0x852D,
+ 0x9670, 0x97F3, 0x98EE, 0x63D6, 0x6CE3, 0x9091, 0x51DD, 0x61C9,
+ 0x81BA, 0x9DF9, 0x4F9D, 0x501A, 0x5100, 0x5B9C, 0x610F, 0x61FF,
+ 0x64EC, 0x6905, 0x6BC5, 0x7591, 0x77E3, 0x7FA9, 0x8264, 0x858F,
+ 0x87FB, 0x8863, 0x8ABC, 0x8B70, 0x91AB, 0x4E8C, 0x4EE5, 0x4F0A,
+ 0x5937, 0x59E8, 0x5DF2, 0x5F1B, 0x5F5B, 0x6021, 0x723E, 0x73E5,
+ 0x7570, 0x75CD, 0x79FB, 0x800C, 0x8033, 0x8084, 0x82E1, 0x8351,
+ 0x8CBD, 0x8CB3, 0x9087, 0x98F4, 0x990C, 0x7037, 0x76CA, 0x7FCA,
+ 0x7FCC, 0x7FFC, 0x8B1A, 0x4EBA, 0x4EC1, 0x5203, 0x5370, 0x54BD,
+ 0x56E0, 0x59FB, 0x5BC5, 0x5F15, 0x5FCD, 0x6E6E, 0x7D6A, 0x8335,
+ 0x8693, 0x8A8D, 0x976D, 0x9777, 0x4E00, 0x4F5A, 0x4F7E, 0x58F9,
+ 0x65E5, 0x6EA2, 0x9038, 0x93B0, 0x99B9, 0x4EFB, 0x58EC, 0x598A,
+ 0x59D9, 0x6041, 0x7A14, 0x834F, 0x8CC3, 0x5165, 0x5344, 0x4ECD,
+ 0x5269, 0x5B55, 0x82BF, 0x4ED4, 0x523A, 0x54A8, 0x59C9, 0x59FF,
+ 0x5B50, 0x5B57, 0x5B5C, 0x6063, 0x6148, 0x6ECB, 0x7099, 0x716E,
+ 0x7386, 0x74F7, 0x75B5, 0x78C1, 0x7D2B, 0x8005, 0x81EA, 0x8328,
+ 0x8517, 0x85C9, 0x8AEE, 0x8CC7, 0x96CC, 0x4F5C, 0x52FA, 0x56BC,
+ 0x65AB, 0x6628, 0x707C, 0x70B8, 0x7235, 0x7DBD, 0x828D, 0x914C,
+ 0x96C0, 0x9D72, 0x5B71, 0x68E7, 0x6B98, 0x6F7A, 0x76DE, 0x5C91,
+ 0x66AB, 0x6F5B, 0x7BB4, 0x7C2A, 0x8836, 0x96DC, 0x4E08, 0x4ED7,
+ 0x5320, 0x5834, 0x58BB, 0x58EF, 0x596C, 0x5C07, 0x5E33, 0x5E84,
+ 0x5F35, 0x638C, 0x66B2, 0x6756, 0x6A1F, 0x6AA3, 0x6B0C, 0x6F3F,
+ 0x7246, 0x7350, 0x748B, 0x7AE0, 0x7CA7, 0x8178, 0x81DF, 0x81E7,
+ 0x838A, 0x846C, 0x8523, 0x8594, 0x85CF, 0x88DD, 0x8D13, 0x91AC,
+ 0x9577, 0x969C, 0x518D, 0x54C9, 0x5728, 0x5BB0, 0x624D, 0x6750,
+ 0x683D, 0x6893, 0x6E3D, 0x6ED3, 0x707D, 0x7E21, 0x88C1, 0x8CA1,
+ 0x8F09, 0x9F4B, 0x9F4E, 0x722D, 0x7B8F, 0x8ACD, 0x931A, 0x4F47,
+ 0x4F4E, 0x5132, 0x5480, 0x59D0, 0x5E95, 0x62B5, 0x6775, 0x696E,
+ 0x6A17, 0x6CAE, 0x6E1A, 0x72D9, 0x732A, 0x75BD, 0x7BB8, 0x7D35,
+ 0x82E7, 0x83F9, 0x8457, 0x85F7, 0x8A5B, 0x8CAF, 0x8E87, 0x9019,
+ 0x90B8, 0x96CE, 0x9F5F, 0x52E3, 0x540A, 0x5AE1, 0x5BC2, 0x6458,
+ 0x6575, 0x6EF4, 0x72C4, 0x7684, 0x7A4D, 0x7B1B, 0x7C4D, 0x7E3E,
+ 0x7FDF, 0x837B, 0x8B2B, 0x8CCA, 0x8D64, 0x8DE1, 0x8E5F, 0x8FEA,
+ 0x8FF9, 0x9069, 0x93D1, 0x4F43, 0x4F7A, 0x50B3, 0x5168, 0x5178,
+ 0x524D, 0x526A, 0x5861, 0x587C, 0x5960, 0x5C08, 0x5C55, 0x5EDB,
+ 0x609B, 0x6230, 0x6813, 0x6BBF, 0x6C08, 0x6FB1, 0x714E, 0x7420,
+ 0x7530, 0x7538, 0x7551, 0x7672, 0x7B4C, 0x7B8B, 0x7BAD, 0x7BC6,
+ 0x7E8F, 0x8A6E, 0x8F3E, 0x8F49, 0x923F, 0x9293, 0x9322, 0x942B,
+ 0x96FB, 0x985A, 0x986B, 0x991E, 0x5207, 0x622A, 0x6298, 0x6D59,
+ 0x7664, 0x7ACA, 0x7BC0, 0x7D76, 0x5360, 0x5CBE, 0x5E97, 0x6F38,
+ 0x70B9, 0x7C98, 0x9711, 0x9B8E, 0x9EDE, 0x63A5, 0x647A, 0x8776,
+ 0x4E01, 0x4E95, 0x4EAD, 0x505C, 0x5075, 0x5448, 0x59C3, 0x5B9A,
+ 0x5E40, 0x5EAD, 0x5EF7, 0x5F81, 0x60C5, 0x633A, 0x653F, 0x6574,
+ 0x65CC, 0x6676, 0x6678, 0x67FE, 0x6968, 0x6A89, 0x6B63, 0x6C40,
+ 0x6DC0, 0x6DE8, 0x6E1F, 0x6E5E, 0x701E, 0x70A1, 0x738E, 0x73FD,
+ 0x753A, 0x775B, 0x7887, 0x798E, 0x7A0B, 0x7A7D, 0x7CBE, 0x7D8E,
+ 0x8247, 0x8A02, 0x8AEA, 0x8C9E, 0x912D, 0x914A, 0x91D8, 0x9266,
+ 0x92CC, 0x9320, 0x9706, 0x9756, 0x975C, 0x9802, 0x9F0E, 0x5236,
+ 0x5291, 0x557C, 0x5824, 0x5E1D, 0x5F1F, 0x608C, 0x63D0, 0x68AF,
+ 0x6FDF, 0x796D, 0x7B2C, 0x81CD, 0x85BA, 0x88FD, 0x8AF8, 0x8E44,
+ 0x918D, 0x9664, 0x969B, 0x973D, 0x984C, 0x9F4A, 0x4FCE, 0x5146,
+ 0x51CB, 0x52A9, 0x5632, 0x5F14, 0x5F6B, 0x63AA, 0x64CD, 0x65E9,
+ 0x6641, 0x66FA, 0x66F9, 0x671D, 0x689D, 0x68D7, 0x69FD, 0x6F15,
+ 0x6F6E, 0x7167, 0x71E5, 0x722A, 0x74AA, 0x773A, 0x7956, 0x795A,
+ 0x79DF, 0x7A20, 0x7A95, 0x7C97, 0x7CDF, 0x7D44, 0x7E70, 0x8087,
+ 0x85FB, 0x86A4, 0x8A54, 0x8ABF, 0x8D99, 0x8E81, 0x9020, 0x906D,
+ 0x91E3, 0x963B, 0x96D5, 0x9CE5, 0x65CF, 0x7C07, 0x8DB3, 0x93C3,
+ 0x5B58, 0x5C0A, 0x5352, 0x62D9, 0x731D, 0x5027, 0x5B97, 0x5F9E,
+ 0x60B0, 0x616B, 0x68D5, 0x6DD9, 0x742E, 0x7A2E, 0x7D42, 0x7D9C,
+ 0x7E31, 0x816B, 0x8E2A, 0x8E35, 0x937E, 0x9418, 0x4F50, 0x5750,
+ 0x5DE6, 0x5EA7, 0x632B, 0x7F6A, 0x4E3B, 0x4F4F, 0x4F8F, 0x505A,
+ 0x59DD, 0x80C4, 0x546A, 0x5468, 0x55FE, 0x594F, 0x5B99, 0x5DDE,
+ 0x5EDA, 0x665D, 0x6731, 0x67F1, 0x682A, 0x6CE8, 0x6D32, 0x6E4A,
+ 0x6F8D, 0x70B7, 0x73E0, 0x7587, 0x7C4C, 0x7D02, 0x7D2C, 0x7DA2,
+ 0x821F, 0x86DB, 0x8A3B, 0x8A85, 0x8D70, 0x8E8A, 0x8F33, 0x9031,
+ 0x914E, 0x9152, 0x9444, 0x99D0, 0x7AF9, 0x7CA5, 0x4FCA, 0x5101,
+ 0x51C6, 0x57C8, 0x5BEF, 0x5CFB, 0x6659, 0x6A3D, 0x6D5A, 0x6E96,
+ 0x6FEC, 0x710C, 0x756F, 0x7AE3, 0x8822, 0x9021, 0x9075, 0x96CB,
+ 0x99FF, 0x8301, 0x4E2D, 0x4EF2, 0x8846, 0x91CD, 0x537D, 0x6ADB,
+ 0x696B, 0x6C41, 0x847A, 0x589E, 0x618E, 0x66FE, 0x62EF, 0x70DD,
+ 0x7511, 0x75C7, 0x7E52, 0x84B8, 0x8B49, 0x8D08, 0x4E4B, 0x53EA,
+ 0x54AB, 0x5730, 0x5740, 0x5FD7, 0x6301, 0x6307, 0x646F, 0x652F,
+ 0x65E8, 0x667A, 0x679D, 0x67B3, 0x6B62, 0x6C60, 0x6C9A, 0x6F2C,
+ 0x77E5, 0x7825, 0x7949, 0x7957, 0x7D19, 0x80A2, 0x8102, 0x81F3,
+ 0x829D, 0x82B7, 0x8718, 0x8A8C, 0x8D04, 0x8DBE, 0x9072, 0x76F4,
+ 0x7A19, 0x7A37, 0x7E54, 0x8077, 0x5507, 0x55D4, 0x5875, 0x632F,
+ 0x6422, 0x6649, 0x664B, 0x686D, 0x699B, 0x6B84, 0x6D25, 0x6EB1,
+ 0x73CD, 0x7468, 0x74A1, 0x755B, 0x75B9, 0x76E1, 0x771E, 0x778B,
+ 0x79E6, 0x7E09, 0x7E1D, 0x81FB, 0x852F, 0x8897, 0x8A3A, 0x8CD1,
+ 0x8EEB, 0x8FB0, 0x9032, 0x93AD, 0x9663, 0x9673, 0x9707, 0x4F84,
+ 0x53F1, 0x59EA, 0x5AC9, 0x5E19, 0x684E, 0x74C6, 0x75BE, 0x79E9,
+ 0x7A92, 0x81A3, 0x86ED, 0x8CEA, 0x8DCC, 0x8FED, 0x659F, 0x6715,
+ 0x57F7, 0x6F57, 0x7DDD, 0x8F2F, 0x93F6, 0x96C6, 0x5FB5, 0x61F2,
+ 0x6F84, 0x4E14, 0x4F98, 0x501F, 0x53C9, 0x55DF, 0x5D6F, 0x5DEE,
+ 0x6B21, 0x6B64, 0x78CB, 0x7B9A, 0x8E49, 0x8ECA, 0x906E, 0x6349,
+ 0x643E, 0x7740, 0x7A84, 0x932F, 0x947F, 0x9F6A, 0x64B0, 0x6FAF,
+ 0x71E6, 0x74A8, 0x74DA, 0x7AC4, 0x7C12, 0x7E82, 0x7CB2, 0x7E98,
+ 0x8B9A, 0x8D0A, 0x947D, 0x9910, 0x994C, 0x5239, 0x5BDF, 0x64E6,
+ 0x672D, 0x7D2E, 0x50ED, 0x53C3, 0x5879, 0x6158, 0x6159, 0x61FA,
+ 0x65AC, 0x7AD9, 0x8B92, 0x8B96, 0x5009, 0x5021, 0x5275, 0x5531,
+ 0x5A3C, 0x5EE0, 0x5F70, 0x6134, 0x655E, 0x660C, 0x6636, 0x66A2,
+ 0x69CD, 0x6EC4, 0x6F32, 0x7316, 0x7621, 0x7A93, 0x8139, 0x8259,
+ 0x83D6, 0x84BC, 0x50B5, 0x57F0, 0x5BC0, 0x5BE8, 0x5F69, 0x63A1,
+ 0x7826, 0x7DB5, 0x83DC, 0x8521, 0x91C7, 0x91F5, 0x518A, 0x67F5,
+ 0x7B56, 0x8CAC, 0x51C4, 0x59BB, 0x60BD, 0x8655, 0x501C, 0x5254,
+ 0x5C3A, 0x617D, 0x621A, 0x62D3, 0x64F2, 0x65A5, 0x6ECC, 0x7620,
+ 0x810A, 0x8E60, 0x965F, 0x96BB, 0x4EDF, 0x5343, 0x5598, 0x5929,
+ 0x5DDD, 0x64C5, 0x6CC9, 0x6DFA, 0x7394, 0x7A7F, 0x821B, 0x85A6,
+ 0x8CE4, 0x8E10, 0x9077, 0x91E7, 0x95E1, 0x9621, 0x97C6, 0x51F8,
+ 0x54F2, 0x5586, 0x5FB9, 0x64A4, 0x6F88, 0x7DB4, 0x8F1F, 0x8F4D,
+ 0x9435, 0x50C9, 0x5C16, 0x6CBE, 0x6DFB, 0x751B, 0x77BB, 0x7C3D,
+ 0x7C64, 0x8A79, 0x8AC2, 0x581E, 0x59BE, 0x5E16, 0x6377, 0x7252,
+ 0x758A, 0x776B, 0x8ADC, 0x8CBC, 0x8F12, 0x5EF3, 0x6674, 0x6DF8,
+ 0x807D, 0x83C1, 0x8ACB, 0x9751, 0x9BD6, 0x5243, 0x66FF, 0x6D95,
+ 0x6EEF, 0x7DE0, 0x8AE6, 0x902E, 0x905E, 0x9AD4, 0x521D, 0x527F,
+ 0x54E8, 0x6194, 0x6284, 0x62DB, 0x68A2, 0x6912, 0x695A, 0x6A35,
+ 0x7092, 0x7126, 0x785D, 0x7901, 0x790E, 0x79D2, 0x7A0D, 0x8096,
+ 0x8278, 0x82D5, 0x8349, 0x8549, 0x8C82, 0x8D85, 0x9162, 0x918B,
+ 0x91AE, 0x4FC3, 0x56D1, 0x71ED, 0x77D7, 0x8700, 0x89F8, 0x5BF8,
+ 0x5FD6, 0x6751, 0x90A8, 0x53E2, 0x585A, 0x5BF5, 0x60A4, 0x6181,
+ 0x6460, 0x7E3D, 0x8070, 0x8525, 0x9283, 0x64AE, 0x50AC, 0x5D14,
+ 0x6700, 0x589C, 0x62BD, 0x63A8, 0x690E, 0x6978, 0x6A1E, 0x6E6B,
+ 0x76BA, 0x79CB, 0x82BB, 0x8429, 0x8ACF, 0x8DA8, 0x8FFD, 0x9112,
+ 0x914B, 0x919C, 0x9310, 0x9318, 0x939A, 0x96DB, 0x9A36, 0x9C0D,
+ 0x4E11, 0x755C, 0x795D, 0x7AFA, 0x7B51, 0x7BC9, 0x7E2E, 0x84C4,
+ 0x8E59, 0x8E74, 0x8EF8, 0x9010, 0x6625, 0x693F, 0x7443, 0x51FA,
+ 0x672E, 0x9EDC, 0x5145, 0x5FE0, 0x6C96, 0x87F2, 0x885D, 0x8877,
+ 0x60B4, 0x81B5, 0x8403, 0x8D05, 0x53D6, 0x5439, 0x5634, 0x5A36,
+ 0x5C31, 0x708A, 0x7FE0, 0x805A, 0x8106, 0x81ED, 0x8DA3, 0x9189,
+ 0x9A5F, 0x9DF2, 0x5074, 0x4EC4, 0x53A0, 0x60FB, 0x6E2C, 0x5C64,
+ 0x4F88, 0x5024, 0x55E4, 0x5CD9, 0x5E5F, 0x6065, 0x6894, 0x6CBB,
+ 0x6DC4, 0x71BE, 0x75D4, 0x75F4, 0x7661, 0x7A1A, 0x7A49, 0x7DC7,
+ 0x7DFB, 0x7F6E, 0x81F4, 0x86A9, 0x8F1C, 0x96C9, 0x99B3, 0x9F52,
+ 0x5247, 0x52C5, 0x98ED, 0x89AA, 0x4E03, 0x67D2, 0x6F06, 0x4FB5,
+ 0x5BE2, 0x6795, 0x6C88, 0x6D78, 0x741B, 0x7827, 0x91DD, 0x937C,
+ 0x87C4, 0x79E4, 0x7A31, 0x5FEB, 0x4ED6, 0x54A4, 0x553E, 0x58AE,
+ 0x59A5, 0x60F0, 0x6253, 0x62D6, 0x6736, 0x6955, 0x8235, 0x9640,
+ 0x99B1, 0x99DD, 0x502C, 0x5353, 0x5544, 0x577C, 0x6258, 0x64E2,
+ 0x666B, 0x67DD, 0x6FC1, 0x6FEF, 0x7422, 0x7438, 0x8A17, 0x9438,
+ 0x5451, 0x5606, 0x5766, 0x5F48, 0x619A, 0x6B4E, 0x7058, 0x70AD,
+ 0x7DBB, 0x8A95, 0x596A, 0x812B, 0x63A2, 0x7708, 0x803D, 0x8CAA,
+ 0x5854, 0x642D, 0x69BB, 0x5B95, 0x5E11, 0x6E6F, 0x8569, 0x514C,
+ 0x53F0, 0x592A, 0x6020, 0x614B, 0x6B86, 0x6C70, 0x6CF0, 0x7B1E,
+ 0x80CE, 0x82D4, 0x8DC6, 0x90B0, 0x98B1, 0x64C7, 0x6FA4, 0x6491,
+ 0x6504, 0x514E, 0x5410, 0x571F, 0x8A0E, 0x615F, 0x6876, 0x75DB,
+ 0x7B52, 0x7D71, 0x901A, 0x5806, 0x69CC, 0x817F, 0x892A, 0x9000,
+ 0x9839, 0x5078, 0x5957, 0x59AC, 0x6295, 0x900F, 0x9B2A, 0x615D,
+ 0x7279, 0x95D6, 0x5761, 0x5A46, 0x5DF4, 0x628A, 0x64AD, 0x64FA,
+ 0x6777, 0x6CE2, 0x6D3E, 0x722C, 0x7436, 0x7834, 0x7F77, 0x82AD,
+ 0x8DDB, 0x9817, 0x5224, 0x5742, 0x677F, 0x7248, 0x74E3, 0x8CA9,
+ 0x8FA6, 0x9211, 0x962A, 0x516B, 0x53ED, 0x634C, 0x4F69, 0x5504,
+ 0x6096, 0x6557, 0x6C9B, 0x6D7F, 0x724C, 0x72FD, 0x7A17, 0x8987,
+ 0x8C9D, 0x5F6D, 0x6F8E, 0x70F9, 0x81A8, 0x610E, 0x4FBF, 0x504F,
+ 0x6241, 0x7247, 0x7BC7, 0x7DE8, 0x7FE9, 0x904D, 0x97AD, 0x9A19,
+ 0x8CB6, 0x576A, 0x5E73, 0x67B0, 0x840D, 0x8A55, 0x5420, 0x5B16,
+ 0x5E63, 0x5EE2, 0x5F0A, 0x6583, 0x80BA, 0x853D, 0x9589, 0x965B,
+ 0x4F48, 0x5305, 0x530D, 0x530F, 0x5486, 0x54FA, 0x5703, 0x5E03,
+ 0x6016, 0x629B, 0x62B1, 0x6355, 0x6CE1, 0x6D66, 0x75B1, 0x7832,
+ 0x80DE, 0x812F, 0x82DE, 0x8461, 0x84B2, 0x888D, 0x8912, 0x900B,
+ 0x92EA, 0x98FD, 0x9B91, 0x5E45, 0x66B4, 0x66DD, 0x7011, 0x7206,
+ 0x4FF5, 0x527D, 0x5F6A, 0x6153, 0x6753, 0x6A19, 0x6F02, 0x74E2,
+ 0x7968, 0x8868, 0x8C79, 0x98C7, 0x98C4, 0x9A43, 0x54C1, 0x7A1F,
+ 0x6953, 0x8AF7, 0x8C4A, 0x98A8, 0x99AE, 0x5F7C, 0x62AB, 0x75B2,
+ 0x76AE, 0x88AB, 0x907F, 0x9642, 0x5339, 0x5F3C, 0x5FC5, 0x6CCC,
+ 0x73CC, 0x7562, 0x758B, 0x7B46, 0x82FE, 0x999D, 0x4E4F, 0x903C,
+ 0x4E0B, 0x4F55, 0x53A6, 0x590F, 0x5EC8, 0x6630, 0x6CB3, 0x7455,
+ 0x8377, 0x8766, 0x8CC0, 0x9050, 0x971E, 0x9C15, 0x58D1, 0x5B78,
+ 0x8650, 0x8B14, 0x9DB4, 0x5BD2, 0x6068, 0x608D, 0x65F1, 0x6C57,
+ 0x6F22, 0x6FA3, 0x701A, 0x7F55, 0x7FF0, 0x9591, 0x9592, 0x9650,
+ 0x97D3, 0x5272, 0x8F44, 0x51FD, 0x542B, 0x54B8, 0x5563, 0x558A,
+ 0x6ABB, 0x6DB5, 0x7DD8, 0x8266, 0x929C, 0x9677, 0x9E79, 0x5408,
+ 0x54C8, 0x76D2, 0x86E4, 0x95A4, 0x95D4, 0x965C, 0x4EA2, 0x4F09,
+ 0x59EE, 0x5AE6, 0x5DF7, 0x6052, 0x6297, 0x676D, 0x6841, 0x6C86,
+ 0x6E2F, 0x7F38, 0x809B, 0x822A, 0x9805, 0x4EA5, 0x5055, 0x54B3,
+ 0x5793, 0x595A, 0x5B69, 0x5BB3, 0x61C8, 0x6977, 0x6D77, 0x7023,
+ 0x87F9, 0x89E3, 0x8A72, 0x8AE7, 0x9082, 0x99ED, 0x9AB8, 0x52BE,
+ 0x6838, 0x5016, 0x5E78, 0x674F, 0x8347, 0x884C, 0x4EAB, 0x5411,
+ 0x56AE, 0x73E6, 0x9115, 0x97FF, 0x9909, 0x9957, 0x9999, 0x5653,
+ 0x589F, 0x865B, 0x8A31, 0x61B2, 0x6AF6, 0x737B, 0x8ED2, 0x6B47,
+ 0x96AA, 0x9A57, 0x5955, 0x7200, 0x8D6B, 0x9769, 0x4FD4, 0x5CF4,
+ 0x5F26, 0x61F8, 0x665B, 0x6CEB, 0x70AB, 0x7384, 0x73B9, 0x73FE,
+ 0x7729, 0x774D, 0x7D43, 0x7D62, 0x7E23, 0x8237, 0x8852, 0x8CE2,
+ 0x9249, 0x986F, 0x5B51, 0x7A74, 0x8840, 0x9801, 0x5ACC, 0x4FE0,
+ 0x5354, 0x593E, 0x5CFD, 0x633E, 0x6D79, 0x72F9, 0x8105, 0x8107,
+ 0x83A2, 0x92CF, 0x9830, 0x4EA8, 0x5144, 0x5211, 0x578B, 0x5F62,
+ 0x6CC2, 0x6ECE, 0x7005, 0x7050, 0x70AF, 0x7192, 0x73E9, 0x7469,
+ 0x834A, 0x87A2, 0x8861, 0x9008, 0x90A2, 0x93A3, 0x99A8, 0x516E,
+ 0x5F57, 0x60E0, 0x6167, 0x66B3, 0x8559, 0x8E4A, 0x91AF, 0x978B,
+ 0x4E4E, 0x4E92, 0x547C, 0x58D5, 0x58FA, 0x597D, 0x5CB5, 0x5F27,
+ 0x6236, 0x6248, 0x660A, 0x6667, 0x6BEB, 0x6D69, 0x6DCF, 0x6E56,
+ 0x6EF8, 0x6F94, 0x6FE0, 0x6FE9, 0x705D, 0x72D0, 0x7425, 0x745A,
+ 0x74E0, 0x7693, 0x795C, 0x7CCA, 0x7E1E, 0x80E1, 0x82A6, 0x846B,
+ 0x84BF, 0x864E, 0x865F, 0x8774, 0x8B77, 0x8C6A, 0x93AC, 0x9800,
+ 0x9865, 0x60D1, 0x6216, 0x9177, 0x5A5A, 0x660F, 0x6DF7, 0x6E3E,
+ 0x743F, 0x9B42, 0x5FFD, 0x60DA, 0x7B0F, 0x54C4, 0x5F18, 0x6C5E,
+ 0x6CD3, 0x6D2A, 0x70D8, 0x7D05, 0x8679, 0x8A0C, 0x9D3B, 0x5316,
+ 0x548C, 0x5B05, 0x6A3A, 0x706B, 0x7575, 0x798D, 0x79BE, 0x82B1,
+ 0x83EF, 0x8A71, 0x8B41, 0x8CA8, 0x9774, 0x64F4, 0x652B, 0x78BA,
+ 0x78BB, 0x7A6B, 0x4E38, 0x559A, 0x5950, 0x5BA6, 0x5E7B, 0x60A3,
+ 0x63DB, 0x6B61, 0x6665, 0x6853, 0x6E19, 0x7165, 0x74B0, 0x7D08,
+ 0x9084, 0x9A69, 0x9C25, 0x6D3B, 0x6ED1, 0x733E, 0x8C41, 0x95CA,
+ 0x51F0, 0x5E4C, 0x5FA8, 0x604D, 0x60F6, 0x6130, 0x614C, 0x6643,
+ 0x6644, 0x69A5, 0x6CC1, 0x6E5F, 0x6EC9, 0x6F62, 0x714C, 0x749C,
+ 0x7687, 0x7BC1, 0x7C27, 0x8352, 0x8757, 0x9051, 0x968D, 0x9EC3,
+ 0x532F, 0x56DE, 0x5EFB, 0x5F8A, 0x6062, 0x6094, 0x61F7, 0x6666,
+ 0x6703, 0x6A9C, 0x6DEE, 0x6FAE, 0x7070, 0x736A, 0x7E6A, 0x81BE,
+ 0x8334, 0x86D4, 0x8AA8, 0x8CC4, 0x5283, 0x7372, 0x5B96, 0x6A6B,
+ 0x9404, 0x54EE, 0x5686, 0x5B5D, 0x6548, 0x6585, 0x66C9, 0x689F,
+ 0x6D8D, 0x6DC6, 0x723B, 0x80B4, 0x9175, 0x9A4D, 0x4FAF, 0x5019,
+ 0x539A, 0x540E, 0x543C, 0x5589, 0x55C5, 0x5E3F, 0x5F8C, 0x673D,
+ 0x7166, 0x73DD, 0x9005, 0x52DB, 0x52F3, 0x5864, 0x58CE, 0x7104,
+ 0x718F, 0x71FB, 0x85B0, 0x8A13, 0x6688, 0x85A8, 0x55A7, 0x6684,
+ 0x714A, 0x8431, 0x5349, 0x5599, 0x6BC1, 0x5F59, 0x5FBD, 0x63EE,
+ 0x6689, 0x7147, 0x8AF1, 0x8F1D, 0x9EBE, 0x4F11, 0x643A, 0x70CB,
+ 0x7566, 0x8667, 0x6064, 0x8B4E, 0x9DF8, 0x5147, 0x51F6, 0x5308,
+ 0x6D36, 0x80F8, 0x9ED1, 0x6615, 0x6B23, 0x7098, 0x75D5, 0x5403,
+ 0x5C79, 0x7D07, 0x8A16, 0x6B20, 0x6B3D, 0x6B46, 0x5438, 0x6070,
+ 0x6D3D, 0x7FD5, 0x8208, 0x50D6, 0x51DE, 0x559C, 0x566B, 0x56CD,
+ 0x59EC, 0x5B09, 0x5E0C, 0x6199, 0x6198, 0x6231, 0x665E, 0x66E6,
+ 0x7199, 0x71B9, 0x71BA, 0x72A7, 0x79A7, 0x7A00, 0x7FB2, 0x8A70,
+ 0x3001, 0x3002, 0x2025, 0x00AD, 0x2015, 0x2225, 0xFF5E, 0x3014,
+ 0x3015, 0x3008, 0x3009, 0x300A, 0x300B, 0x300C, 0x300D, 0x300E,
+ 0x300F, 0x3010, 0x3011, 0x3013, 0xFF01, 0xFF08, 0xFF09, 0xFF0C,
+ 0xFF0E, 0xFF1A, 0xFF1B, 0xFF1C, 0xFF1D, 0xFF1E, 0xFF1F, 0xFF3B,
+ 0xFF3D, 0xFF3F, 0xFF5B, 0xFF5C, 0xFF5D, 0xFF5E, 0x0020, 0x0021,
+ 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029,
+ 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 0x0030, 0x0031,
+ 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039,
+ 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 0x0040, 0x0041,
+ 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049,
+ 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051,
+ 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059,
+ 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, 0x0060, 0x0061,
+ 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069,
+ 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071,
+ 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079,
+ 0x007A, 0x007B, 0x007C, 0x007D, 0x203E, 0x007E, 0x005C, 0x231C,
+ 0x231F, 0x0000, 0x0000, 0x0000, 0x0000, 0x300E, 0x300F, 0x300A,
+ 0x300B, 0x3008, 0x3009, 0x0028, 0x0029, 0x0000, 0x0000, 0x0028,
+ 0x0029, 0x0028, 0x0029, 0x0000, 0x0000, 0x0028, 0x0029, 0x0000,
+ 0x0000, 0x3016, 0x3017, 0x3016, 0x3017, 0x3018, 0x3019, 0x005B,
+ 0x005D, 0x0000, 0x0000, 0x263E, 0x263D, 0x2021, 0x2021, 0x2020,
+ 0x2021, 0x0000, 0x2217, 0x0000, 0x0000, 0x201F, 0x201B, 0x02D6,
+ 0x02D7, 0x00D7, 0x221E, 0x0000, 0x00B1, 0x2213, 0x003E, 0x003C,
+ 0x003D, 0x2260, 0x207D, 0x207E, 0x007B, 0x007D, 0x0000, 0x0000,
+ 0x2229, 0x222A, 0x2282, 0x2208, 0x03A3, 0x0021, 0x0000, 0x3021,
+ 0x3022, 0x3023, 0x0000, 0x0000, 0x0000, 0x4E03, 0x0000, 0x0000,
+ 0x5341, 0x0000, 0x0000, 0x0027, 0x3014, 0x3015, 0x002A, 0x0000,
+ 0x2217, 0x002A, 0xCDCD, 0x3001, 0x3002, 0x0028, 0x0029, 0x0028,
+ 0x0029, 0x0028, 0x0029, 0x3016, 0x3017, 0x3010, 0x3011, 0x0000,
+ 0x0000, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE,
+ 0x20DE, 0x20DE, 0x005D, 0x005D, 0x005D, 0x005D, 0x005D, 0x005D,
+ 0x005D, 0x005D, 0x005D, 0x005D, 0x005D, 0x00B6, 0x0000, 0x0000,
+ 0x22EF, 0x2237, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE,
+ 0x20DE, 0x20DE, 0x20DE, 0x005D, 0x005D, 0x005D, 0x005D, 0x005D,
+ 0x005D, 0x005D, 0x005D, 0x005D, 0x005D, 0x005D, 0x278A, 0x278B,
+ 0x278C, 0x278D, 0x278E, 0x278F, 0x2790, 0x2791, 0x2792, 0x2793,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029,
+ 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029,
+ 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029,
+ 0x0029, 0x0029, 0x0029, 0x0029, 0x24B6, 0x24B7, 0x24B8, 0x24B9,
+ 0x24BA, 0x24BB, 0x24BC, 0x24BD, 0x24BE, 0x24BF, 0x24C0, 0x24C1,
+ 0x24C2, 0x24C3, 0x24C4, 0x24C5, 0x24C6, 0x24C7, 0x24C8, 0x24C9,
+ 0x24CA, 0x24CB, 0x24CC, 0x24CD, 0x24CE, 0x24CF, 0x20DE, 0x20DE,
+ 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x005D,
+ 0x005D, 0x005D, 0x005D, 0x005D, 0x005D, 0x005D, 0x005D, 0x005D,
+ 0x005D, 0x005D, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE,
+ 0x20DE, 0x20DE, 0x20DE, 0x005D, 0x005D, 0x005D, 0x005D, 0x005D,
+ 0x005D, 0x005D, 0x005D, 0x005D, 0x005D, 0x005D, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x22CF, 0x22CE, 0x22CF, 0x22CE, 0x2280,
+ 0x2281, 0x2270, 0x2271, 0x2272, 0x2273, 0x0000, 0x228A, 0x0000,
+ 0x228B, 0x2276, 0x2277, 0x2279, 0x22DA, 0x22DB, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x2221, 0x2245, 0x2243, 0x2248, 0x0000, 0x22A4,
+ 0x22AB, 0x0000, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE,
+ 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x0000, 0x2460, 0x2461, 0x2462,
+ 0x2463, 0x2464, 0x2465, 0x2466, 0x2467, 0x2468, 0x0029, 0x0029,
+ 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029,
+ 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029,
+ 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029,
+ 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029,
+ 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029,
+ 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029,
+ 0x0029, 0x0029, 0x0021, 0x00B0, 0x0027, 0x0022, 0x2034, 0x0029,
+ 0x0029, 0x0029, 0x0029, 0x0000, 0x0000, 0x2020, 0x2020, 0x2021,
+ 0x2020, 0x00A7, 0x0023, 0x002A, 0x002A, 0x0000, 0x0000, 0x2042,
+ 0x002A, 0x0000, 0x0000, 0x2042, 0x002A, 0x0000, 0x0000, 0x2022,
+ 0x20DF, 0x20DF, 0x0000, 0x20DF, 0x3008, 0x3009, 0x300A, 0x300B,
+ 0x261C, 0x261E, 0x0000, 0x0000, 0x20DE, 0x0000, 0x20DE, 0x20DE,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x20DD, 0x20DD, 0x271A, 0x2716,
+ 0x0000, 0x25EF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x25CC,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x20A9, 0x0000, 0x0000,
+ 0x262F, 0x0000, 0x262F, 0x262F, 0x0000, 0x0000, 0x0000, 0x3020,
+ 0x0000, 0x2776, 0x2777, 0x2778, 0x2779, 0x277A, 0x277B, 0x277C,
+ 0x277D, 0x277E, 0x277F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0029, 0x0029, 0x0029,
+ 0x0029, 0x0029, 0x0029, 0x2642, 0x22A9, 0x3036, 0x25CB, 0x25D3,
+ 0x25A1, 0x2302, 0x0000, 0x25AD, 0x25AD, 0x0000, 0x0000, 0x0000,
+ 0x25C7, 0x0000, 0x0000, 0x2206, 0x22BF, 0x231E, 0x0000, 0x2225,
+ 0x2226, 0x0000, 0x2253, 0x2251, 0x2266, 0x2267, 0x2213, 0x2295,
+ 0x2296, 0x2297, 0x20DD, 0x2314, 0x0000, 0x0000, 0x2262, 0x0000,
+ 0x25B1, 0x0000, 0x2222, 0x2250, 0x00D8, 0x234A, 0x22A3, 0x0338,
+ 0x0000, 0x226E, 0x226F, 0x2285, 0x2284, 0x2209, 0x220C, 0x22BB,
+ 0x0016, 0x225A, 0x2306, 0x0024, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x329E, 0x0000, 0x203C, 0x003F, 0x0000, 0x003F, 0x22C4,
+ 0x25C7, 0x22C4, 0x25C6, 0x25AB, 0x25A1, 0x25AB, 0x25A0, 0x25E6,
+ 0x25CB, 0x25E6, 0x25CF, 0x25BD, 0x25B3, 0x25B7, 0x25C1, 0x2726,
+ 0x25CF, 0x25A0, 0x0000, 0x25CA, 0x3231, 0x3239, 0x33CB, 0x2483,
+ 0x2494, 0x2495, 0x2496, 0x2497, 0x0029, 0x0029, 0x0029, 0x0029,
+ 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x2192, 0x2190,
+ 0x2191, 0x2193, 0x2196, 0x2197, 0x2198, 0x2199, 0x21D0, 0x21CF,
+ 0x21CD, 0x21D4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x2794, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x279C, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x27BA, 0x0000, 0x0000, 0x0000, 0x0000, 0x21D1, 0x21D3,
+ 0x0000, 0x279E, 0x0000, 0x0000, 0x0000, 0x279E, 0x0000, 0x0000,
+ 0x21B5, 0x21B1, 0x0000, 0x21B4, 0x21B0, 0x21B3, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x21E6, 0x21E8, 0x21E7, 0x21E9, 0x21BC, 0x21C0, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x21C0, 0x21BC, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x21C4, 0x21C5, 0x002E, 0x002E, 0x002E, 0x002E, 0x002E, 0x002E,
+ 0x002E, 0x002E, 0x002E, 0x002E, 0x002E, 0x002E, 0x002E, 0x002E,
+ 0x002E, 0x002E, 0x002E, 0x002E, 0x002E, 0x002E, 0x002E, 0x002E,
+ 0x002E, 0x002E, 0x002E, 0x002E, 0x002E, 0x002E, 0x002E, 0x002E,
+ 0x002E, 0x002E, 0x002E, 0x002E, 0x002E, 0x002E, 0x002E, 0x002E,
+ 0x002E, 0x002E, 0x002E, 0x002E, 0x002E, 0x002E, 0x002E, 0x002E,
+ 0x002E, 0x002E, 0x002E, 0x002E, 0x002E, 0x002E, 0x20DE, 0x20DE,
+ 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE,
+ 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE,
+ 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE,
+ 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE,
+ 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE,
+ 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE,
+ 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE,
+ 0x20DE, 0x20DE, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD,
+ 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD,
+ 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD,
+ 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD,
+ 0x20DD, 0x20DD, 0x2483, 0x2484, 0x2485, 0x2486, 0x2487, 0x0029,
+ 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x20DD, 0x20DD, 0x20DD,
+ 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD,
+ 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD,
+ 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD,
+ 0x3294, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD,
+ 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD,
+ 0x32A5, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD,
+ 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD,
+ 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD,
+ 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD,
+ 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD,
+ 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD,
+ 0x20DD, 0x0029, 0x0029, 0x0029, 0x0029, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x2794, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x21E0, 0x21E1,
+ 0x21E2, 0x21E3, 0x0000, 0x27A1, 0x0000, 0x0000, 0x21E6, 0x21E8,
+ 0x21E7, 0x21E9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x261D, 0x261F,
+ 0x0000, 0x0000, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD, 0x20DD,
+ 0x20DD, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE,
+ 0x20DE, 0x20DE, 0x005D, 0x005D, 0x005D, 0x005D, 0x005D, 0x005D,
+ 0x005D, 0x005D, 0x005D, 0x005D, 0x005D, 0x20DE, 0x20DE, 0x20DE,
+ 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x005D,
+ 0x005D, 0x005D, 0x005D, 0x005D, 0x005D, 0x005D, 0x005D, 0x005D,
+ 0x005D, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE,
+ 0x20DE, 0x20DE, 0x20DE, 0x005D, 0x005D, 0x005D, 0x005D, 0x005D,
+ 0x005D, 0x005D, 0x005D, 0x005D, 0x005D, 0x20DE, 0x20DE, 0x20DE,
+ 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x3290, 0x328A, 0x328B, 0x328C,
+ 0x328D, 0x328E, 0x328F, 0x20DE, 0x20DE, 0x20DE, 0x20DE, 0x20DE,
+ 0x20DE, 0x20DE, 0x300C, 0x300D, 0x300E, 0x300F, 0x21E8, 0x21E6,
+ 0x21E7, 0x21E9, 0x0022, 0x301F, 0x301D, 0x2036, 0x0060, 0x3001,
+ 0x0000, 0x0021, 0x3021, 0x002C, 0x3002, 0xAC02, 0xAC03, 0xAC05,
+ 0xAC06, 0xAC0B, 0xAC0C, 0xAC0D, 0xAC0E, 0xAC0F, 0xAC18, 0xAC1E,
+ 0xAC1F, 0xAC21, 0xAC22, 0xAC23, 0xAC25, 0xAC26, 0xAC27, 0xAC28,
+ 0xAC29, 0xAC2A, 0xAC2B, 0xAC2E, 0xAC32, 0xAC33, 0xAC34, 0xAC35,
+ 0xAC36, 0xAC37, 0xAC3A, 0xAC3B, 0xAC3D, 0xAC3E, 0xAC3F, 0xAC41,
+ 0xAC42, 0xAC43, 0xAC44, 0xAC45, 0xAC46, 0xAC47, 0xAC48, 0xAC49,
+ 0xAC4A, 0xAC4C, 0xAC4E, 0xAC4F, 0xAC50, 0xAC51, 0xAC52, 0xAC53,
+ 0xAC55, 0xAC56, 0xAC57, 0xAC59, 0xAC5A, 0xAC5B, 0xAC5D, 0xAC5E,
+ 0xAC5F, 0xAC60, 0xAC61, 0xAC62, 0xAC63, 0xAC64, 0xAC65, 0xAC66,
+ 0xAC67, 0xAC68, 0xAC69, 0xAC6A, 0xAC6B, 0xAC6C, 0xAC6D, 0xAC6E,
+ 0xAC6F, 0xAC72, 0xAC73, 0xAC75, 0xAC76, 0xAC79, 0xAC7B, 0xAC7C,
+ 0xAC7D, 0xAC7E, 0xAC7F, 0xAC82, 0xAC87, 0xAC88, 0xAC8D, 0xAC8E,
+ 0xAC8F, 0xAC91, 0xAC92, 0xAC93, 0xAC95, 0xAC96, 0xAC97, 0xAC98,
+ 0xAC99, 0xAC9A, 0xAC9B, 0xAC9E, 0xACA2, 0xACA3, 0xACA4, 0xACA5,
+ 0xACA6, 0xACA7, 0xACAB, 0xACAD, 0xACAE, 0xACB1, 0xACB2, 0xACB3,
+ 0xACB4, 0xACB5, 0xACB6, 0xACB7, 0xACBA, 0xACBE, 0xACBF, 0xACC0,
+ 0xACC2, 0xACC3, 0xACC5, 0xACC6, 0xACC7, 0xACC9, 0xACCA, 0xACCB,
+ 0xACCD, 0xACCE, 0xACCF, 0xACD0, 0xACD1, 0xACD2, 0xACD3, 0xACD4,
+ 0xACD6, 0xACD8, 0xACD9, 0xACDA, 0xACDB, 0xACDC, 0xACDD, 0xACDE,
+ 0xACDF, 0xACE2, 0xACE3, 0xACE5, 0xACE6, 0xACE9, 0xACEB, 0xACED,
+ 0xACEE, 0xACF2, 0xACF4, 0xACF7, 0xACF8, 0xACF9, 0xACFA, 0xACFB,
+ 0xACFE, 0xACFF, 0xAD01, 0xAD02, 0xAD03, 0xAD05, 0xAD07, 0xAD08,
+ 0xAD09, 0xAD0A, 0xAD0B, 0xAD0E, 0xAD10, 0xAD12, 0xAD13, 0xAD14,
+ 0xAD15, 0xAD16, 0xAD17, 0xAD19, 0xAD1A, 0xAD1B, 0xAD1D, 0xAD1E,
+ 0xAD1F, 0xAD21, 0xAD22, 0xAD23, 0xAD24, 0xAD25, 0xAD26, 0xAD27,
+ 0xAD28, 0xAD2A, 0xAD2B, 0xAD2E, 0xAD2F, 0xAD30, 0xAD31, 0xAD32,
+ 0xAD33, 0xAD36, 0xAD37, 0xAD39, 0xAD3A, 0xAD3B, 0xAD3D, 0xAD3E,
+ 0xAD3F, 0xAD40, 0xAD41, 0xAD42, 0xAD43, 0xAD46, 0xAD48, 0xAD4A,
+ 0xAD4B, 0xAD4C, 0xAD4D, 0xAD4E, 0xAD4F, 0xAD51, 0xAD52, 0xAD53,
+ 0xAD55, 0xAD56, 0xAD57, 0xAD59, 0xAD5A, 0xAD5B, 0xAD5C, 0xAD5D,
+ 0xAD5E, 0xAD5F, 0xAD60, 0xAD62, 0xAD64, 0xAD65, 0xAD66, 0xAD67,
+ 0xAD68, 0xAD69, 0xAD6A, 0xAD6B, 0xAD6E, 0xAD6F, 0xAD71, 0xAD72,
+ 0xAD77, 0xAD78, 0xAD79, 0xAD7A, 0xAD7E, 0xAD80, 0xAD83, 0xAD84,
+ 0xAD85, 0xAD86, 0xAD87, 0xAD8A, 0xAD8B, 0xAD8D, 0xAD8E, 0xAD8F,
+ 0xAD91, 0xAD92, 0xAD93, 0xAD94, 0xAD95, 0xAD96, 0xAD97, 0xAD98,
+ 0xAD99, 0xAD9A, 0xAD9B, 0xAD9E, 0xAD9F, 0xADA0, 0xADA1, 0xADA2,
+ 0xADA3, 0xADA5, 0xADA6, 0xADA7, 0xADA8, 0xADA9, 0xADAA, 0xADAB,
+ 0xADAC, 0xADAD, 0xADAE, 0xADAF, 0xADB0, 0xADB1, 0xADB2, 0xADB3,
+ 0xADB4, 0xADB5, 0xADB6, 0xADB8, 0xADB9, 0xADBA, 0xADBB, 0xADBC,
+ 0xADBD, 0xADBE, 0xADBF, 0xADC2, 0xADC3, 0xADC5, 0xADC6, 0xADC7,
+ 0xADC9, 0xADCA, 0xADCB, 0xADCC, 0xADCD, 0xADCE, 0xADCF, 0xADD2,
+ 0xADD4, 0xADD5, 0xADD6, 0xADD7, 0xADD8, 0xADD9, 0xADDA, 0xADDB,
+ 0xADDD, 0xADDE, 0xADDF, 0xADE1, 0xADE2, 0xADE3, 0xADE5, 0xADE6,
+ 0xADE7, 0xADE8, 0xADE9, 0xADEA, 0xADEB, 0xADEC, 0xADED, 0xADEE,
+ 0xADEF, 0xADF0, 0xADF1, 0xADF2, 0xADF3, 0xADF4, 0xADF5, 0xADF6,
+ 0xADF7, 0xADFA, 0xADFB, 0xADFD, 0xADFE, 0xAE02, 0xAE03, 0xAE04,
+ 0xAE05, 0xAE06, 0xAE07, 0xAE0A, 0xAE0C, 0xAE0E, 0xAE0F, 0xAE10,
+ 0xAE11, 0xAE12, 0xAE13, 0xAE15, 0xAE16, 0xAE17, 0xAE18, 0xAE19,
+ 0xAE1A, 0xAE1B, 0xAE1C, 0xAE1D, 0xAE1E, 0xAE1F, 0xAE20, 0xAE21,
+ 0xAE22, 0xAE23, 0xAE24, 0xAE25, 0xAE26, 0xAE27, 0xAE28, 0xAE29,
+ 0xAE2A, 0xAE2B, 0xAE2C, 0xAE2D, 0xAE2E, 0xAE2F, 0xAE32, 0xAE33,
+ 0xAE35, 0xAE36, 0xAE39, 0xAE3B, 0xAE3C, 0xAE3D, 0xAE3E, 0xAE3F,
+ 0xAE42, 0xAE44, 0xAE47, 0xAE48, 0xAE49, 0xAE4B, 0xAE4F, 0xAE51,
+ 0xAE52, 0xAE53, 0xAE55, 0xAE57, 0xAE58, 0xAE59, 0xAE5A, 0xAE5B,
+ 0xAE5E, 0xAE62, 0xAE63, 0xAE64, 0xAE66, 0xAE67, 0xAE6A, 0xAE6B,
+ 0xAE6D, 0xAE6E, 0xAE6F, 0xAE71, 0xAE72, 0xAE73, 0xAE74, 0xAE75,
+ 0xAE76, 0xAE77, 0xAE7A, 0xAE7E, 0xAE7F, 0xAE80, 0xAE81, 0xAE82,
+ 0xAE83, 0xAE86, 0xAE87, 0xAE88, 0xAE89, 0xAE8A, 0xAE8B, 0xAE8D,
+ 0xAE8E, 0xAE8F, 0xAE90, 0xAE91, 0xAE92, 0xAE93, 0xAE94, 0xAE95,
+ 0xAE96, 0xAE97, 0xAE98, 0xAE99, 0xAE9A, 0xAE9B, 0xAE9C, 0xAE9D,
+ 0xAE9E, 0xAE9F, 0xAEA0, 0xAEA1, 0xAEA2, 0xAEA3, 0xAEA4, 0xAEA5,
+ 0xAEA6, 0xAEA7, 0xAEA8, 0xAEA9, 0xAEAA, 0xAEAB, 0xAEAC, 0xAEAD,
+ 0xAEAE, 0xAEAF, 0xAEB0, 0xAEB1, 0xAEB2, 0xAEB3, 0xAEB4, 0xAEB5,
+ 0xAEB6, 0xAEB7, 0xAEB8, 0xAEB9, 0xAEBA, 0xAEBB, 0xAEBF, 0xAEC1,
+ 0xAEC2, 0xAEC3, 0xAEC5, 0xAEC6, 0xAEC7, 0xAEC8, 0xAEC9, 0xAECA,
+ 0xAECB, 0xAECE, 0xAED2, 0xAED3, 0xAED4, 0xAED5, 0xAED6, 0xAED7,
+ 0xAEDA, 0xAEDB, 0xAEDD, 0xAEDE, 0xAEDF, 0xAEE0, 0xAEE1, 0xAEE2,
+ 0xAEE3, 0xAEE4, 0xAEE5, 0xAEE6, 0xAEE7, 0xAEE9, 0xAEEA, 0xAEEC,
+ 0xAEEE, 0xAEEF, 0xAEF0, 0xAEF1, 0xAEF2, 0xAEF3, 0xAEF5, 0xAEF6,
+ 0xAEF7, 0xAEF9, 0xAEFA, 0xAEFB, 0xAEFD, 0xAEFE, 0xAEFF, 0xAF00,
+ 0xAF01, 0xAF02, 0xAF03, 0xAF04, 0xAF05, 0xAF06, 0xAF09, 0xAF0A,
+ 0xAF0B, 0xAF0C, 0xAF0E, 0xAF0F, 0xAF11, 0xAF12, 0xAF13, 0xAF14,
+ 0xAF15, 0xAF16, 0xAF17, 0xAF18, 0xAF19, 0xAF1A, 0xAF1B, 0xAF1C,
+ 0xAF1D, 0xAF1E, 0xAF1F, 0xAF20, 0xAF21, 0xAF22, 0xAF23, 0xAF24,
+ 0xAF25, 0xAF26, 0xAF27, 0xAF28, 0xAF29, 0xAF2A, 0xAF2B, 0xAF2E,
+ 0xAF2F, 0xAF31, 0xAF33, 0xAF35, 0xAF36, 0xAF37, 0xAF38, 0xAF39,
+ 0xAF3A, 0xAF3B, 0xAF3E, 0xAF40, 0xAF44, 0xAF45, 0xAF46, 0xAF47,
+ 0xAF4A, 0xAF4B, 0xAF4C, 0xAF4D, 0xAF4E, 0xAF4F, 0xAF51, 0xAF52,
+ 0xAF53, 0xAF54, 0xAF55, 0xAF56, 0xAF57, 0xAF58, 0xAF59, 0xAF5A,
+ 0xAF5B, 0xAF5E, 0xAF5F, 0xAF60, 0xAF61, 0xAF62, 0xAF63, 0xAF66,
+ 0xAF67, 0xAF68, 0xAF69, 0xAF6A, 0xAF6B, 0xAF6C, 0xAF6D, 0xAF6E,
+ 0xAF6F, 0xAF70, 0xAF71, 0xAF72, 0xAF73, 0xAF74, 0xAF75, 0xAF76,
+ 0xAF77, 0xAF78, 0xAF7A, 0xAF7B, 0xAF7C, 0xAF7D, 0xAF7E, 0xAF7F,
+ 0xAF81, 0xAF82, 0xAF83, 0xAF85, 0xAF86, 0xAF87, 0xAF89, 0xAF8A,
+ 0xAF8B, 0xAF8C, 0xAF8D, 0xAF8E, 0xAF8F, 0xAF92, 0xAF93, 0xAF94,
+ 0xAF96, 0xAF97, 0xAF98, 0xAF99, 0xAF9A, 0xAF9B, 0xAF9D, 0xAF9E,
+ 0xAF9F, 0xAFA0, 0xAFA1, 0xAFA2, 0xAFA3, 0xAFA4, 0xAFA5, 0xAFA6,
+ 0xAFA7, 0xAFA8, 0xAFA9, 0xAFAA, 0xAFAB, 0xAFAC, 0xAFAD, 0xAFAE,
+ 0xAFAF, 0xAFB0, 0xAFB1, 0xAFB2, 0xAFB3, 0xAFB4, 0xAFB5, 0xAFB6,
+ 0xAFB7, 0xAFBA, 0xAFBB, 0xAFBD, 0xAFBE, 0xAFBF, 0xAFC1, 0xAFC2,
+ 0xAFC3, 0xAFC4, 0xAFC5, 0xAFC6, 0xAFCA, 0xAFCC, 0xAFCF, 0xAFD0,
+ 0xAFD1, 0xAFD2, 0xAFD3, 0xAFD5, 0xAFD6, 0xAFD7, 0xAFD8, 0xAFD9,
+ 0xAFDA, 0xAFDB, 0xAFDD, 0xAFDE, 0xAFDF, 0xAFE0, 0xAFE1, 0xAFE2,
+ 0xAFE3, 0xAFE4, 0xAFE5, 0xAFE6, 0xAFE7, 0xAFEA, 0xAFEB, 0xAFEC,
+ 0xAFED, 0xAFEE, 0xAFEF, 0xAFF2, 0xAFF3, 0xAFF5, 0xAFF6, 0xAFF7,
+ 0xAFF9, 0xAFFA, 0xAFFB, 0xAFFC, 0xAFFD, 0xAFFE, 0xAFFF, 0xB002,
+ 0xB003, 0xB005, 0xB006, 0xB007, 0xB008, 0xB009, 0xB00A, 0xB00B,
+ 0xB00D, 0xB00E, 0xB00F, 0xB011, 0xB012, 0xB013, 0xB015, 0xB016,
+ 0xB017, 0xB018, 0xB019, 0xB01A, 0xB01B, 0xB01E, 0xB01F, 0xB020,
+ 0xB021, 0xB022, 0xB023, 0xB024, 0xB025, 0xB026, 0xB027, 0xB029,
+ 0xB02A, 0xB02B, 0xB02C, 0xB02D, 0xB02E, 0xB02F, 0xB030, 0xB031,
+ 0xB032, 0xB033, 0xB034, 0xB035, 0xB036, 0xB037, 0xB038, 0xB039,
+ 0xB03A, 0xB03B, 0xB03C, 0xB03D, 0xB03E, 0xB03F, 0xB040, 0xB041,
+ 0xB042, 0xB043, 0xB046, 0xB047, 0xB049, 0xB04B, 0xB04D, 0xB04F,
+ 0xB050, 0xB051, 0xB052, 0xB056, 0xB058, 0xB05A, 0xB05B, 0xB05C,
+ 0xB05E, 0xB05F, 0xB060, 0xB061, 0xB062, 0xB063, 0xB064, 0xB065,
+ 0xB066, 0xB067, 0xB068, 0xB069, 0xB06A, 0xB06B, 0xB06C, 0xB06D,
+ 0xB06E, 0xB06F, 0xB070, 0xB071, 0xB072, 0xB073, 0xB074, 0xB075,
+ 0xB076, 0xB077, 0xB078, 0xB079, 0xB07A, 0xB07B, 0xB07E, 0xB07F,
+ 0xB081, 0xB082, 0xB083, 0xB085, 0xB086, 0xB087, 0xB088, 0xB089,
+ 0xB08A, 0xB08B, 0xB08E, 0xB090, 0xB092, 0xB093, 0xB094, 0xB095,
+ 0xB096, 0xB097, 0xB09B, 0xB09D, 0xB09E, 0xB0A3, 0xB0A4, 0xB0A5,
+ 0xB0A6, 0xB0A7, 0xB0AA, 0xB0B0, 0xB0B2, 0xB0B6, 0xB0B7, 0xB0B9,
+ 0xB0BA, 0xB0BB, 0xB0BD, 0xB0BE, 0xB0BF, 0xB0C0, 0xB0C1, 0xB0C2,
+ 0xB0C3, 0xB0C6, 0xB0CA, 0xB0CB, 0xB0CC, 0xB0CD, 0xB0CE, 0xB0CF,
+ 0xB0D2, 0xB0D3, 0xB0D5, 0xB0D6, 0xB0D7, 0xB0D9, 0xB0DA, 0xB0DB,
+ 0xB0DC, 0xB0DD, 0xB0DE, 0xB0DF, 0xB0E1, 0xB0E2, 0xB0E3, 0xB0E4,
+ 0xB0E6, 0xB0E7, 0xB0E8, 0xB0E9, 0xB0EA, 0xB0EB, 0xB0EC, 0xB0ED,
+ 0xB0EE, 0xB0EF, 0xB0F0, 0xB0F1, 0xB0F2, 0xB0F3, 0xB0F4, 0xB0F5,
+ 0xB0F6, 0xB0F7, 0xB0F8, 0xB0F9, 0xB0FA, 0xB0FB, 0xB0FC, 0xB0FD,
+ 0xB0FE, 0xB0FF, 0xB100, 0xB101, 0xB102, 0xB103, 0xB104, 0xB105,
+ 0xB106, 0xB107, 0xB10A, 0xB10D, 0xB10E, 0xB10F, 0xB111, 0xB114,
+ 0xB115, 0xB116, 0xB117, 0xB11A, 0xB11E, 0xB11F, 0xB120, 0xB121,
+ 0xB122, 0xB126, 0xB127, 0xB129, 0xB12A, 0xB12B, 0xB12D, 0xB12E,
+ 0xB12F, 0xB130, 0xB131, 0xB132, 0xB133, 0xB136, 0xB13A, 0xB13B,
+ 0xB13C, 0xB13D, 0xB13E, 0xB13F, 0xB142, 0xB143, 0xB145, 0xB146,
+ 0xB147, 0xB149, 0xB14A, 0xB14B, 0xB14C, 0xB14D, 0xB14E, 0xB14F,
+ 0xB152, 0xB153, 0xB156, 0xB157, 0xB159, 0xB15A, 0xB15B, 0xB15D,
+ 0xB15E, 0xB15F, 0xB161, 0xB162, 0xB163, 0xB164, 0xB165, 0xB166,
+ 0xB167, 0xB168, 0xB169, 0xB16A, 0xB16B, 0xB16C, 0xB16D, 0xB16E,
+ 0xB16F, 0xB170, 0xB171, 0xB172, 0xB173, 0xB174, 0xB175, 0xB176,
+ 0xB177, 0xB17A, 0xB17B, 0xB17D, 0xB17E, 0xB17F, 0xB181, 0xB183,
+ 0xB184, 0xB185, 0xB186, 0xB187, 0xB18A, 0xB18C, 0xB18E, 0xB18F,
+ 0xB190, 0xB191, 0xB195, 0xB196, 0xB197, 0xB199, 0xB19A, 0xB19B,
+ 0xB19D, 0xB19E, 0xB19F, 0xB1A0, 0xB1A1, 0xB1A2, 0xB1A3, 0xB1A4,
+ 0xB1A5, 0xB1A6, 0xB1A7, 0xB1A9, 0xB1AA, 0xB1AB, 0xB1AC, 0xB1AD,
+ 0xB1AE, 0xB1AF, 0xB1B0, 0xB1B1, 0xB1B2, 0xB1B3, 0xB1B4, 0xB1B5,
+ 0xB1B6, 0xB1B7, 0xB1B8, 0xB1B9, 0xB1BA, 0xB1BB, 0xB1BC, 0xB1BD,
+ 0xB1BE, 0xB1BF, 0xB1C0, 0xB1C1, 0xB1C2, 0xB1C3, 0xB1C4, 0xB1C5,
+ 0xB1C6, 0xB1C7, 0xB1C8, 0xB1C9, 0xB1CA, 0xB1CB, 0xB1CD, 0xB1CE,
+ 0xB1CF, 0xB1D1, 0xB1D2, 0xB1D3, 0xB1D5, 0xB1D6, 0xB1D7, 0xB1D8,
+ 0xB1D9, 0xB1DA, 0xB1DB, 0xB1DE, 0xB1E0, 0xB1E1, 0xB1E2, 0xB1E3,
+ 0xB1E4, 0xB1E5, 0xB1E6, 0xB1E7, 0xB1EA, 0xB1EB, 0xB1ED, 0xB1EE,
+ 0xB1EF, 0xB1F1, 0xB1F2, 0xB1F3, 0xB1F4, 0xB1F5, 0xB1F6, 0xB1F7,
+ 0xB1F8, 0xB1FA, 0xB1FC, 0xB1FE, 0xB1FF, 0xB200, 0xB201, 0xB202,
+ 0xB203, 0xB206, 0xB207, 0xB209, 0xB20A, 0xB20D, 0xB20E, 0xB20F,
+ 0xB210, 0xB211, 0xB212, 0xB213, 0xB216, 0xB218, 0xB21A, 0xB21B,
+ 0xB21C, 0xB21D, 0xB21E, 0xB21F, 0xB221, 0xB222, 0xB223, 0xB224,
+ 0xB225, 0xB226, 0xB227, 0xB228, 0xB229, 0xB22A, 0xB22B, 0xB22C,
+ 0xB22D, 0xB22E, 0xB22F, 0xB230, 0xB231, 0xB232, 0xB233, 0xB235,
+ 0xB236, 0xB237, 0xB238, 0xB239, 0xB23A, 0xB23B, 0xB23D, 0xB23E,
+ 0xB23F, 0xB240, 0xB241, 0xB242, 0xB243, 0xB244, 0xB245, 0xB246,
+ 0xB247, 0xB248, 0xB249, 0xB24A, 0xB24B, 0xB24C, 0xB24D, 0xB24E,
+ 0xB24F, 0xB250, 0xB251, 0xB252, 0xB253, 0xB254, 0xB255, 0xB256,
+ 0xB257, 0xB259, 0xB25A, 0xB25B, 0xB25D, 0xB25E, 0xB25F, 0xB261,
+ 0xB262, 0xB263, 0xB264, 0xB265, 0xB266, 0xB267, 0xB26A, 0xB26B,
+ 0xB26C, 0xB26D, 0xB26E, 0xB26F, 0xB270, 0xB271, 0xB272, 0xB273,
+ 0xB276, 0xB277, 0xB278, 0xB279, 0xB27A, 0xB27B, 0xB27D, 0xB27E,
+ 0xB27F, 0xB280, 0xB281, 0xB282, 0xB283, 0xB286, 0xB287, 0xB288,
+ 0xB28A, 0xB28B, 0xB28C, 0xB28D, 0xB28E, 0xB28F, 0xB292, 0xB293,
+ 0xB295, 0xB296, 0xB297, 0xB29B, 0xB29C, 0xB29D, 0xB29E, 0xB29F,
+ 0xB2A2, 0xB2A4, 0xB2A7, 0xB2A8, 0xB2A9, 0xB2AB, 0xB2AD, 0xB2AE,
+ 0xB2AF, 0xB2B1, 0xB2B2, 0xB2B3, 0xB2B5, 0xB2B6, 0xB2B7, 0xB2B8,
+ 0xB2B9, 0xB2BA, 0xB2BB, 0xB2BC, 0xB2BD, 0xB2BE, 0xB2BF, 0xB2C0,
+ 0xB2C1, 0xB2C2, 0xB2C3, 0xB2C4, 0xB2C5, 0xB2C6, 0xB2C7, 0xB2CA,
+ 0xB2CB, 0xB2CD, 0xB2CE, 0xB2CF, 0xB2D1, 0xB2D3, 0xB2D4, 0xB2D5,
+ 0xB2D6, 0xB2D7, 0xB2DA, 0xB2DC, 0xB2DE, 0xB2DF, 0xB2E0, 0xB2E1,
+ 0xB2E3, 0xB2E7, 0xB2E9, 0xB2EA, 0xB2F0, 0xB2F1, 0xB2F2, 0xB2F6,
+ 0xB2FC, 0xB2FD, 0xB2FE, 0xB302, 0xB303, 0xB305, 0xB306, 0xB307,
+ 0xB309, 0xB30A, 0xB30B, 0xB30C, 0xB30D, 0xB30E, 0xB30F, 0xB312,
+ 0xB316, 0xB317, 0xB318, 0xB319, 0xB31A, 0xB31B, 0xB31D, 0xB31E,
+ 0xB31F, 0xB320, 0xB321, 0xB322, 0xB323, 0xB324, 0xB325, 0xB326,
+ 0xB327, 0xB328, 0xB329, 0xB32A, 0xB32B, 0xB32C, 0xB32D, 0xB32E,
+ 0xB32F, 0xB330, 0xB331, 0xB332, 0xB333, 0xB334, 0xB335, 0xB336,
+ 0xB337, 0xB338, 0xB339, 0xB33A, 0xB33B, 0xB33C, 0xB33D, 0xB33E,
+ 0xB33F, 0xB340, 0xB341, 0xB342, 0xB343, 0xB344, 0xB345, 0xB346,
+ 0xB347, 0xB348, 0xB349, 0xB34A, 0xB34B, 0xB34C, 0xB34D, 0xB34E,
+ 0xB34F, 0xB350, 0xB351, 0xB352, 0xB353, 0xB357, 0xB359, 0xB35A,
+ 0xB35D, 0xB360, 0xB361, 0xB362, 0xB363, 0xB366, 0xB368, 0xB36A,
+ 0xB36C, 0xB36D, 0xB36F, 0xB372, 0xB373, 0xB375, 0xB376, 0xB377,
+ 0xB379, 0xB37A, 0xB37B, 0xB37C, 0xB37D, 0xB37E, 0xB37F, 0xB382,
+ 0xB386, 0xB387, 0xB388, 0xB389, 0xB38A, 0xB38B, 0xB38D, 0xB38E,
+ 0xB38F, 0xB391, 0xB392, 0xB393, 0xB395, 0xB396, 0xB397, 0xB398,
+ 0xB399, 0xB39A, 0xB39B, 0xB39C, 0xB39D, 0xB39E, 0xB39F, 0xB3A2,
+ 0xB3A3, 0xB3A4, 0xB3A5, 0xB3A6, 0xB3A7, 0xB3A9, 0xB3AA, 0xB3AB,
+ 0xB3AD, 0xB3AE, 0xB3AF, 0xB3B0, 0xB3B1, 0xB3B2, 0xB3B3, 0xB3B4,
+ 0xB3B5, 0xB3B6, 0xB3B7, 0xB3B8, 0xB3B9, 0xB3BA, 0xB3BB, 0xB3BC,
+ 0xB3BD, 0xB3BE, 0xB3BF, 0xB3C0, 0xB3C1, 0xB3C2, 0xB3C3, 0xB3C6,
+ 0xB3C7, 0xB3C9, 0xB3CA, 0xB3CD, 0xB3CF, 0xB3D1, 0xB3D2, 0xB3D3,
+ 0xB3D6, 0xB3D8, 0xB3DA, 0xB3DC, 0xB3DE, 0xB3DF, 0xB3E1, 0xB3E2,
+ 0xB3E3, 0xB3E5, 0xB3E6, 0xB3E7, 0xB3E9, 0xB3EA, 0xB3EB, 0xB3EC,
+ 0xB3ED, 0xB3EE, 0xB3EF, 0xB3F0, 0xB3F1, 0xB3F2, 0xB3F3, 0xB3F4,
+ 0xB3F5, 0xB3F6, 0xB3F7, 0xB3F8, 0xB3F9, 0xB3FA, 0xB3FB, 0xB3FD,
+ 0xB3FE, 0xB3FF, 0xB400, 0xB401, 0xB402, 0xB403, 0xB404, 0xB405,
+ 0xB406, 0xB407, 0xB408, 0xB409, 0xB40A, 0xB40B, 0xB40C, 0xB40D,
+ 0xB40E, 0xB40F, 0xB411, 0xB412, 0xB413, 0xB414, 0xB415, 0xB416,
+ 0xB417, 0xB419, 0xB41A, 0xB41B, 0xB41D, 0xB41E, 0xB41F, 0xB421,
+ 0xB422, 0xB423, 0xB424, 0xB425, 0xB426, 0xB427, 0xB42A, 0xB42C,
+ 0xB42D, 0xB42E, 0xB42F, 0xB430, 0xB431, 0xB432, 0xB433, 0xB435,
+ 0xB436, 0xB437, 0xB438, 0xB439, 0xB43A, 0xB43B, 0xB43C, 0xB43D,
+ 0xB43E, 0xB43F, 0xB440, 0xB441, 0xB442, 0xB443, 0xB444, 0xB445,
+ 0xB446, 0xB447, 0xB448, 0xB449, 0xB44A, 0xB44B, 0xB44C, 0xB44D,
+ 0xB44E, 0xB44F, 0xB452, 0xB453, 0xB455, 0xB456, 0xB457, 0xB459,
+ 0xB45A, 0xB45B, 0xB45C, 0xB45D, 0xB45E, 0xB45F, 0xB462, 0xB464,
+ 0xB466, 0xB467, 0xB468, 0xB469, 0xB46A, 0xB46B, 0xB46D, 0xB46E,
+ 0xB46F, 0xB470, 0xB471, 0xB472, 0xB473, 0xB474, 0xB475, 0xB476,
+ 0xB477, 0xB478, 0xB479, 0xB47A, 0xB47B, 0xB47C, 0xB47D, 0xB47E,
+ 0xB47F, 0xB481, 0xB482, 0xB483, 0xB484, 0xB485, 0xB486, 0xB487,
+ 0xB489, 0xB48A, 0xB48B, 0xB48C, 0xB48D, 0xB48E, 0xB48F, 0xB490,
+ 0xB491, 0xB492, 0xB493, 0xB494, 0xB495, 0xB496, 0xB497, 0xB498,
+ 0xB499, 0xB49A, 0xB49B, 0xB49C, 0xB49E, 0xB49F, 0xB4A0, 0xB4A1,
+ 0xB4A2, 0xB4A3, 0xB4A5, 0xB4A6, 0xB4A7, 0xB4A9, 0xB4AA, 0xB4AB,
+ 0xB4AD, 0xB4AE, 0xB4AF, 0xB4B0, 0xB4B1, 0xB4B2, 0xB4B3, 0xB4B4,
+ 0xB4B6, 0xB4B8, 0xB4BA, 0xB4BB, 0xB4BC, 0xB4BD, 0xB4BE, 0xB4BF,
+ 0xB4C1, 0xB4C2, 0xB4C3, 0xB4C5, 0xB4C6, 0xB4C7, 0xB4C9, 0xB4CA,
+ 0xB4CB, 0xB4CC, 0xB4CD, 0xB4CE, 0xB4CF, 0xB4D1, 0xB4D2, 0xB4D3,
+ 0xB4D4, 0xB4D6, 0xB4D7, 0xB4D8, 0xB4D9, 0xB4DA, 0xB4DB, 0xB4DE,
+ 0xB4DF, 0xB4E1, 0xB4E2, 0xB4E5, 0xB4E7, 0xB4E8, 0xB4E9, 0xB4EA,
+ 0xB4EB, 0xB4EE, 0xB4F0, 0xB4F2, 0xB4F3, 0xB4F4, 0xB4F5, 0xB4F6,
+ 0xB4F7, 0xB4F9, 0xB4FA, 0xB4FB, 0xB4FC, 0xB4FD, 0xB4FE, 0xB4FF,
+ 0xB500, 0xB501, 0xB502, 0xB503, 0xB504, 0xB505, 0xB506, 0xB507,
+ 0xB508, 0xB509, 0xB50A, 0xB50B, 0xB50C, 0xB50D, 0xB50E, 0xB50F,
+ 0xB510, 0xB511, 0xB512, 0xB513, 0xB516, 0xB517, 0xB519, 0xB51A,
+ 0xB51D, 0xB51E, 0xB51F, 0xB520, 0xB521, 0xB522, 0xB523, 0xB526,
+ 0xB52B, 0xB52C, 0xB52D, 0xB52E, 0xB52F, 0xB532, 0xB533, 0xB535,
+ 0xB536, 0xB537, 0xB539, 0xB53A, 0xB53B, 0xB53C, 0xB53D, 0xB53E,
+ 0xB53F, 0xB542, 0xB546, 0xB547, 0xB548, 0xB549, 0xB54A, 0xB54E,
+ 0xB54F, 0xB551, 0xB552, 0xB553, 0xB555, 0xB556, 0xB557, 0xB558,
+ 0xB559, 0xB55A, 0xB55B, 0xB55E, 0xB562, 0xB563, 0xB564, 0xB565,
+ 0xB566, 0xB567, 0xB568, 0xB569, 0xB56A, 0xB56B, 0xB56C, 0xB56D,
+ 0xB56E, 0xB56F, 0xB570, 0xB571, 0xB572, 0xB573, 0xB574, 0xB575,
+ 0xB576, 0xB577, 0xB578, 0xB579, 0xB57A, 0xB57B, 0xB57C, 0xB57D,
+ 0xB57E, 0xB57F, 0xB580, 0xB581, 0xB582, 0xB583, 0xB584, 0xB585,
+ 0xB586, 0xB587, 0xB588, 0xB589, 0xB58A, 0xB58B, 0xB58C, 0xB58D,
+ 0xB58E, 0xB58F, 0xB590, 0xB591, 0xB592, 0xB593, 0xB594, 0xB595,
+ 0xB596, 0xB597, 0xB598, 0xB599, 0xB59A, 0xB59B, 0xB59C, 0xB59D,
+ 0xB59E, 0xB59F, 0xB5A2, 0xB5A3, 0xB5A5, 0xB5A6, 0xB5A7, 0xB5A9,
+ 0xB5AC, 0xB5AD, 0xB5AE, 0xB5AF, 0xB5B2, 0xB5B6, 0xB5B7, 0xB5B8,
+ 0xB5B9, 0xB5BA, 0xB5BE, 0xB5BF, 0xB5C1, 0xB5C2, 0xB5C3, 0xB5C5,
+ 0xB5C6, 0xB5C7, 0xB5C8, 0xB5C9, 0xB5CA, 0xB5CB, 0xB5CE, 0xB5D2,
+ 0xB5D3, 0xB5D4, 0xB5D5, 0xB5D6, 0xB5D7, 0xB5D9, 0xB5DA, 0xB5DB,
+ 0xB5DC, 0xB5DD, 0xB5DE, 0xB5DF, 0xB5E0, 0xB5E1, 0xB5E2, 0xB5E3,
+ 0xB5E4, 0xB5E5, 0xB5E6, 0xB5E7, 0xB5E8, 0xB5E9, 0xB5EA, 0xB5EB,
+ 0xB5ED, 0xB5EE, 0xB5EF, 0xB5F0, 0xB5F1, 0xB5F2, 0xB5F3, 0xB5F4,
+ 0xB5F5, 0xB5F6, 0xB5F7, 0xB5F8, 0xB5F9, 0xB5FA, 0xB5FB, 0xB5FC,
+ 0xB5FD, 0xB5FE, 0xB5FF, 0xB600, 0xB601, 0xB602, 0xB603, 0xB604,
+ 0xB605, 0xB606, 0xB607, 0xB608, 0xB609, 0xB60A, 0xB60B, 0xB60C,
+ 0xB60D, 0xB60E, 0xB60F, 0xB612, 0xB613, 0xB615, 0xB616, 0xB617,
+ 0xB619, 0xB61A, 0xB61B, 0xB61C, 0xB61D, 0xB61E, 0xB61F, 0xB620,
+ 0xB621, 0xB622, 0xB623, 0xB624, 0xB626, 0xB627, 0xB628, 0xB629,
+ 0xB62A, 0xB62B, 0xB62D, 0xB62E, 0xB62F, 0xB630, 0xB631, 0xB632,
+ 0xB633, 0xB635, 0xB636, 0xB637, 0xB638, 0xB639, 0xB63A, 0xB63B,
+ 0xB63C, 0xB63D, 0xB63E, 0xB63F, 0xB640, 0xB641, 0xB642, 0xB643,
+ 0xB644, 0xB645, 0xB646, 0xB647, 0xB649, 0xB64A, 0xB64B, 0xB64C,
+ 0xB64D, 0xB64E, 0xB64F, 0xB650, 0xB651, 0xB652, 0xB653, 0xB654,
+ 0xB655, 0xB656, 0xB657, 0xB658, 0xB659, 0xB65A, 0xB65B, 0xB65C,
+ 0xB65D, 0xB65E, 0xB65F, 0xB660, 0xB661, 0xB662, 0xB663, 0xB665,
+ 0xB666, 0xB667, 0xB669, 0xB66A, 0xB66B, 0xB66C, 0xB66D, 0xB66E,
+ 0xB66F, 0xB670, 0xB671, 0xB672, 0xB673, 0xB674, 0xB675, 0xB676,
+ 0xB677, 0xB678, 0xB679, 0xB67A, 0xB67B, 0xB67C, 0xB67D, 0xB67E,
+ 0xB67F, 0xB680, 0xB681, 0xB682, 0xB683, 0xB684, 0xB685, 0xB686,
+ 0xB687, 0xB688, 0xB689, 0xB68A, 0xB68B, 0xB68C, 0xB68D, 0xB68E,
+ 0xB68F, 0xB690, 0xB691, 0xB692, 0xB693, 0xB694, 0xB695, 0xB696,
+ 0xB697, 0xB698, 0xB699, 0xB69A, 0xB69B, 0xB69E, 0xB69F, 0xB6A1,
+ 0xB6A2, 0xB6A3, 0xB6A5, 0xB6A6, 0xB6A7, 0xB6A8, 0xB6A9, 0xB6AA,
+ 0xB6AD, 0xB6AE, 0xB6AF, 0xB6B0, 0xB6B2, 0xB6B3, 0xB6B4, 0xB6B5,
+ 0xB6B6, 0xB6B7, 0xB6B8, 0xB6B9, 0xB6BA, 0xB6BB, 0xB6BC, 0xB6BD,
+ 0xB6BE, 0xB6BF, 0xB6C0, 0xB6C1, 0xB6C2, 0xB6C3, 0xB6C4, 0xB6C5,
+ 0xB6C6, 0xB6C7, 0xB6C8, 0xB6C9, 0xB6CA, 0xB6CB, 0xB6CC, 0xB6CD,
+ 0xB6CE, 0xB6CF, 0xB6D0, 0xB6D1, 0xB6D2, 0xB6D3, 0xB6D5, 0xB6D6,
+ 0xB6D7, 0xB6D8, 0xB6D9, 0xB6DA, 0xB6DB, 0xB6DC, 0xB6DD, 0xB6DE,
+ 0xB6DF, 0xB6E0, 0xB6E1, 0xB6E2, 0xB6E3, 0xB6E4, 0xB6E5, 0xB6E6,
+ 0xB6E7, 0xB6E8, 0xB6E9, 0xB6EA, 0xB6EB, 0xB6EC, 0xB6ED, 0xB6EE,
+ 0xB6EF, 0xB6F1, 0xB6F2, 0xB6F3, 0xB6F5, 0xB6F6, 0xB6F7, 0xB6F9,
+ 0xB6FA, 0xB6FB, 0xB6FC, 0xB6FD, 0xB6FE, 0xB6FF, 0xB702, 0xB703,
+ 0xB704, 0xB706, 0xB707, 0xB708, 0xB709, 0xB70A, 0xB70B, 0xB70C,
+ 0xB70D, 0xB70E, 0xB70F, 0xB710, 0xB711, 0xB712, 0xB713, 0xB714,
+ 0xB715, 0xB716, 0xB717, 0xB718, 0xB719, 0xB71A, 0xB71B, 0xB71C,
+ 0xB71D, 0xB71E, 0xB71F, 0xB720, 0xB721, 0xB722, 0xB723, 0xB724,
+ 0xB725, 0xB726, 0xB727, 0xB72A, 0xB72B, 0xB72D, 0xB72E, 0xB731,
+ 0xB732, 0xB733, 0xB734, 0xB735, 0xB736, 0xB737, 0xB73A, 0xB73C,
+ 0xB73D, 0xB73E, 0xB73F, 0xB740, 0xB741, 0xB742, 0xB743, 0xB745,
+ 0xB746, 0xB747, 0xB749, 0xB74A, 0xB74B, 0xB74D, 0xB74E, 0xB74F,
+ 0xB750, 0xB751, 0xB752, 0xB753, 0xB756, 0xB757, 0xB758, 0xB759,
+ 0xB75A, 0xB75B, 0xB75C, 0xB75D, 0xB75E, 0xB75F, 0xB761, 0xB762,
+ 0xB763, 0xB765, 0xB766, 0xB767, 0xB769, 0xB76A, 0xB76B, 0xB76C,
+ 0xB76D, 0xB76E, 0xB76F, 0xB772, 0xB774, 0xB776, 0xB777, 0xB778,
+ 0xB779, 0xB77A, 0xB77B, 0xB77E, 0xB77F, 0xB781, 0xB782, 0xB783,
+ 0xB785, 0xB786, 0xB787, 0xB788, 0xB789, 0xB78A, 0xB78B, 0xB78E,
+ 0xB793, 0xB794, 0xB795, 0xB79A, 0xB79B, 0xB79D, 0xB79E, 0xB79F,
+ 0xB7A1, 0xB7A2, 0xB7A3, 0xB7A4, 0xB7A5, 0xB7A6, 0xB7A7, 0xB7AA,
+ 0xB7AE, 0xB7AF, 0xB7B0, 0xB7B1, 0xB7B2, 0xB7B3, 0xB7B6, 0xB7B7,
+ 0xB7B9, 0xB7BA, 0xB7BB, 0xB7BC, 0xB7BD, 0xB7BE, 0xB7BF, 0xB7C0,
+ 0xB7C1, 0xB7C2, 0xB7C3, 0xB7C4, 0xB7C5, 0xB7C6, 0xB7C8, 0xB7CA,
+ 0xB7CB, 0xB7CC, 0xB7CD, 0xB7CE, 0xB7CF, 0xB7D0, 0xB7D1, 0xB7D2,
+ 0xB7D3, 0xB7D4, 0xB7D5, 0xB7D6, 0xB7D7, 0xB7D8, 0xB7D9, 0xB7DA,
+ 0xB7DB, 0xB7DC, 0xB7DD, 0xB7DE, 0xB7DF, 0xB7E0, 0xB7E1, 0xB7E2,
+ 0xB7E3, 0xB7E4, 0xB7E5, 0xB7E6, 0xB7E7, 0xB7E8, 0xB7E9, 0xB7EA,
+ 0xB7EB, 0xB7EE, 0xB7EF, 0xB7F1, 0xB7F2, 0xB7F3, 0xB7F5, 0xB7F6,
+ 0xB7F7, 0xB7F8, 0xB7F9, 0xB7FA, 0xB7FB, 0xB7FE, 0xB802, 0xB803,
+ 0xB804, 0xB805, 0xB806, 0xB80A, 0xB80B, 0xB80D, 0xB80E, 0xB80F,
+ 0xB811, 0xB812, 0xB813, 0xB814, 0xB815, 0xB816, 0xB817, 0xB81A,
+ 0xB81C, 0xB81E, 0xB81F, 0xB820, 0xB821, 0xB822, 0xB823, 0xB826,
+ 0xB827, 0xB829, 0xB82A, 0xB82B, 0xB82D, 0xB82E, 0xB82F, 0xB830,
+ 0xB831, 0xB832, 0xB833, 0xB836, 0xB83A, 0xB83B, 0xB83C, 0xB83D,
+ 0xB83E, 0xB83F, 0xB841, 0xB842, 0xB843, 0xB845, 0xB846, 0xB847,
+ 0xB848, 0xB849, 0xB84A, 0xB84B, 0xB84C, 0xB84D, 0xB84E, 0xB84F,
+ 0xB850, 0xB852, 0xB854, 0xB855, 0xB856, 0xB857, 0xB858, 0xB859,
+ 0xB85A, 0xB85B, 0xB85E, 0xB85F, 0xB861, 0xB862, 0xB863, 0xB865,
+ 0xB866, 0xB867, 0xB868, 0xB869, 0xB86A, 0xB86B, 0xB86E, 0xB870,
+ 0xB872, 0xB873, 0xB874, 0xB875, 0xB876, 0xB877, 0xB879, 0xB87A,
+ 0xB87B, 0xB87D, 0xB87E, 0xB87F, 0xB880, 0xB881, 0xB882, 0xB883,
+ 0xB884, 0xB885, 0xB886, 0xB887, 0xB888, 0xB889, 0xB88A, 0xB88B,
+ 0xB88C, 0xB88E, 0xB88F, 0xB890, 0xB891, 0xB892, 0xB893, 0xB894,
+ 0xB895, 0xB896, 0xB897, 0xB898, 0xB899, 0xB89A, 0xB89B, 0xB89C,
+ 0xB89D, 0xB89E, 0xB89F, 0xB8A0, 0xB8A1, 0xB8A2, 0xB8A3, 0xB8A4,
+ 0xB8A5, 0xB8A6, 0xB8A7, 0xB8A9, 0xB8AA, 0xB8AB, 0xB8AC, 0xB8AD,
+ 0xB8AE, 0xB8AF, 0xB8B1, 0xB8B2, 0xB8B3, 0xB8B5, 0xB8B6, 0xB8B7,
+ 0xB8B9, 0xB8BA, 0xB8BB, 0xB8BC, 0xB8BD, 0xB8BE, 0xB8BF, 0xB8C2,
+ 0xB8C4, 0xB8C6, 0xB8C7, 0xB8C8, 0xB8C9, 0xB8CA, 0xB8CB, 0xB8CD,
+ 0xB8CE, 0xB8CF, 0xB8D1, 0xB8D2, 0xB8D3, 0xB8D5, 0xB8D6, 0xB8D7,
+ 0xB8D8, 0xB8D9, 0xB8DA, 0xB8DB, 0xB8DC, 0xB8DE, 0xB8E0, 0xB8E2,
+ 0xB8E3, 0xB8E4, 0xB8E5, 0xB8E6, 0xB8E7, 0xB8EA, 0xB8EB, 0xB8ED,
+ 0xB8EE, 0xB8EF, 0xB8F1, 0xB8F2, 0xB8F3, 0xB8F4, 0xB8F5, 0xB8F6,
+ 0xB8F7, 0xB8FA, 0xB8FC, 0xB8FE, 0xB8FF, 0xB900, 0xB901, 0xB902,
+ 0xB903, 0xB905, 0xB906, 0xB907, 0xB908, 0xB909, 0xB90A, 0xB90B,
+ 0xB90C, 0xB90D, 0xB90E, 0xB90F, 0xB910, 0xB911, 0xB912, 0xB913,
+ 0xB914, 0xB915, 0xB916, 0xB917, 0xB919, 0xB91A, 0xB91B, 0xB91C,
+ 0xB91D, 0xB91E, 0xB91F, 0xB921, 0xB922, 0xB923, 0xB924, 0xB925,
+ 0xB926, 0xB927, 0xB928, 0xB929, 0xB92A, 0xB92B, 0xB92C, 0xB92D,
+ 0xB92E, 0xB92F, 0xB930, 0xB931, 0xB932, 0xB933, 0xB934, 0xB935,
+ 0xB936, 0xB937, 0xB938, 0xB939, 0xB93A, 0xB93B, 0xB93E, 0xB93F,
+ 0xB941, 0xB942, 0xB943, 0xB945, 0xB946, 0xB947, 0xB948, 0xB949,
+ 0xB94A, 0xB94B, 0xB94D, 0xB94E, 0xB950, 0xB952, 0xB953, 0xB954,
+ 0xB955, 0xB956, 0xB957, 0xB95A, 0xB95B, 0xB95D, 0xB95E, 0xB95F,
+ 0xB961, 0xB962, 0xB963, 0xB964, 0xB965, 0xB966, 0xB967, 0xB96A,
+ 0xB96C, 0xB96E, 0xB96F, 0xB970, 0xB971, 0xB972, 0xB973, 0xB976,
+ 0xB977, 0xB979, 0xB97A, 0xB97B, 0xB97D, 0xB97E, 0xB97F, 0xB980,
+ 0xB981, 0xB982, 0xB983, 0xB986, 0xB988, 0xB98B, 0xB98C, 0xB98F,
+ 0xB990, 0xB991, 0xB992, 0xB993, 0xB994, 0xB995, 0xB996, 0xB997,
+ 0xB998, 0xB999, 0xB99A, 0xB99B, 0xB99C, 0xB99D, 0xB99E, 0xB99F,
+ 0xB9A0, 0xB9A1, 0xB9A2, 0xB9A3, 0xB9A4, 0xB9A5, 0xB9A6, 0xB9A7,
+ 0xB9A8, 0xB9A9, 0xB9AA, 0xB9AB, 0xB9AE, 0xB9AF, 0xB9B1, 0xB9B2,
+ 0xB9B3, 0xB9B5, 0xB9B6, 0xB9B7, 0xB9B8, 0xB9B9, 0xB9BA, 0xB9BB,
+ 0xB9BE, 0xB9C0, 0xB9C2, 0xB9C3, 0xB9C4, 0xB9C5, 0xB9C6, 0xB9C7,
+ 0xB9CA, 0xB9CB, 0xB9CD, 0xB9D3, 0xB9D4, 0xB9D5, 0xB9D6, 0xB9D7,
+ 0xB9DA, 0xB9DC, 0xB9DF, 0xB9E0, 0xB9E2, 0xB9E6, 0xB9E7, 0xB9E9,
+ 0xB9EA, 0xB9EB, 0xB9ED, 0xB9EE, 0xB9EF, 0xB9F0, 0xB9F1, 0xB9F2,
+ 0xB9F3, 0xB9F6, 0xB9FB, 0xB9FC, 0xB9FD, 0xB9FE, 0xB9FF, 0xBA02,
+ 0xBA03, 0xBA04, 0xBA05, 0xBA06, 0xBA07, 0xBA09, 0xBA0A, 0xBA0B,
+ 0xBA0C, 0xBA0D, 0xBA0E, 0xBA0F, 0xBA10, 0xBA11, 0xBA12, 0xBA13,
+ 0xBA14, 0xBA16, 0xBA17, 0xBA18, 0xBA19, 0xBA1A, 0xBA1B, 0xBA1C,
+ 0xBA1D, 0xBA1E, 0xBA1F, 0xBA20, 0xBA21, 0xBA22, 0xBA23, 0xBA24,
+ 0xBA25, 0xBA26, 0xBA27, 0xBA28, 0xBA29, 0xBA2A, 0xBA2B, 0xBA2C,
+ 0xBA2D, 0xBA2E, 0xBA2F, 0xBA30, 0xBA31, 0xBA32, 0xBA33, 0xBA34,
+ 0xBA35, 0xBA36, 0xBA37, 0xBA3A, 0xBA3B, 0xBA3D, 0xBA3E, 0xBA3F,
+ 0xBA41, 0xBA43, 0xBA44, 0xBA45, 0xBA46, 0xBA47, 0xBA4A, 0xBA4C,
+ 0xBA4F, 0xBA50, 0xBA51, 0xBA52, 0xBA56, 0xBA57, 0xBA59, 0xBA5A,
+ 0xBA5B, 0xBA5D, 0xBA5E, 0xBA5F, 0xBA60, 0xBA61, 0xBA62, 0xBA63,
+ 0xBA66, 0xBA6A, 0xBA6B, 0xBA6C, 0xBA6D, 0xBA6E, 0xBA6F, 0xBA72,
+ 0xBA73, 0xBA75, 0xBA76, 0xBA77, 0xBA79, 0xBA7A, 0xBA7B, 0xBA7C,
+ 0xBA7D, 0xBA7E, 0xBA7F, 0xBA80, 0xBA81, 0xBA82, 0xBA86, 0xBA88,
+ 0xBA89, 0xBA8A, 0xBA8B, 0xBA8D, 0xBA8E, 0xBA8F, 0xBA90, 0xBA91,
+ 0xBA92, 0xBA93, 0xBA94, 0xBA95, 0xBA96, 0xBA97, 0xBA98, 0xBA99,
+ 0xBA9A, 0xBA9B, 0xBA9C, 0xBA9D, 0xBA9E, 0xBA9F, 0xBAA0, 0xBAA1,
+ 0xBAA2, 0xBAA3, 0xBAA4, 0xBAA5, 0xBAA6, 0xBAA7, 0xBAAA, 0xBAAD,
+ 0xBAAE, 0xBAAF, 0xBAB1, 0xBAB3, 0xBAB4, 0xBAB5, 0xBAB6, 0xBAB7,
+ 0xBABA, 0xBABC, 0xBABE, 0xBABF, 0xBAC0, 0xBAC1, 0xBAC2, 0xBAC3,
+ 0xBAC5, 0xBAC6, 0xBAC7, 0xBAC9, 0xBACA, 0xBACB, 0xBACC, 0xBACD,
+ 0xBACE, 0xBACF, 0xBAD0, 0xBAD1, 0xBAD2, 0xBAD3, 0xBAD4, 0xBAD5,
+ 0xBAD6, 0xBAD7, 0xBADA, 0xBADB, 0xBADC, 0xBADD, 0xBADE, 0xBADF,
+ 0xBAE0, 0xBAE1, 0xBAE2, 0xBAE3, 0xBAE4, 0xBAE5, 0xBAE6, 0xBAE7,
+ 0xBAE8, 0xBAE9, 0xBAEA, 0xBAEB, 0xBAEC, 0xBAED, 0xBAEE, 0xBAEF,
+ 0xBAF0, 0xBAF1, 0xBAF2, 0xBAF3, 0xBAF4, 0xBAF5, 0xBAF6, 0xBAF7,
+ 0xBAF8, 0xBAF9, 0xBAFA, 0xBAFB, 0xBAFD, 0xBAFE, 0xBAFF, 0xBB01,
+ 0xBB02, 0xBB03, 0xBB05, 0xBB06, 0xBB07, 0xBB08, 0xBB09, 0xBB0A,
+ 0xBB0B, 0xBB0C, 0xBB0E, 0xBB10, 0xBB12, 0xBB13, 0xBB14, 0xBB15,
+ 0xBB16, 0xBB17, 0xBB19, 0xBB1A, 0xBB1B, 0xBB1D, 0xBB1E, 0xBB1F,
+ 0xBB21, 0xBB22, 0xBB23, 0xBB24, 0xBB25, 0xBB26, 0xBB27, 0xBB28,
+ 0xBB2A, 0xBB2C, 0xBB2D, 0xBB2E, 0xBB2F, 0xBB30, 0xBB31, 0xBB32,
+ 0xBB33, 0xBB37, 0xBB39, 0xBB3A, 0xBB3F, 0xBB40, 0xBB41, 0xBB42,
+ 0xBB43, 0xBB46, 0xBB48, 0xBB4A, 0xBB4B, 0xBB4C, 0xBB4E, 0xBB51,
+ 0xBB52, 0xBB53, 0xBB55, 0xBB56, 0xBB57, 0xBB59, 0xBB5A, 0xBB5B,
+ 0xBB5C, 0xBB5D, 0xBB5E, 0xBB5F, 0xBB60, 0xBB62, 0xBB64, 0xBB65,
+ 0xBB66, 0xBB67, 0xBB68, 0xBB69, 0xBB6A, 0xBB6B, 0xBB6D, 0xBB6E,
+ 0xBB6F, 0xBB70, 0xBB71, 0xBB72, 0xBB73, 0xBB74, 0xBB75, 0xBB76,
+ 0xBB77, 0xBB78, 0xBB79, 0xBB7A, 0xBB7B, 0xBB7C, 0xBB7D, 0xBB7E,
+ 0xBB7F, 0xBB80, 0xBB81, 0xBB82, 0xBB83, 0xBB84, 0xBB85, 0xBB86,
+ 0xBB87, 0xBB89, 0xBB8A, 0xBB8B, 0xBB8D, 0xBB8E, 0xBB8F, 0xBB91,
+ 0xBB92, 0xBB93, 0xBB94, 0xBB95, 0xBB96, 0xBB97, 0xBB98, 0xBB99,
+ 0xBB9A, 0xBB9B, 0xBB9C, 0xBB9D, 0xBB9E, 0xBB9F, 0xBBA0, 0xBBA1,
+ 0xBBA2, 0xBBA3, 0xBBA5, 0xBBA6, 0xBBA7, 0xBBA9, 0xBBAA, 0xBBAB,
+ 0xBBAD, 0xBBAE, 0xBBAF, 0xBBB0, 0xBBB1, 0xBBB2, 0xBBB3, 0xBBB5,
+ 0xBBB6, 0xBBB8, 0xBBB9, 0xBBBA, 0xBBBB, 0xBBBC, 0xBBBD, 0xBBBE,
+ 0xBBBF, 0xBBC1, 0xBBC2, 0xBBC3, 0xBBC5, 0xBBC6, 0xBBC7, 0xBBC9,
+ 0xBBCA, 0xBBCB, 0xBBCC, 0xBBCD, 0xBBCE, 0xBBCF, 0xBBD1, 0xBBD2,
+ 0xBBD4, 0xBBD5, 0xBBD6, 0xBBD7, 0xBBD8, 0xBBD9, 0xBBDA, 0xBBDB,
+ 0xBBDC, 0xBBDD, 0xBBDE, 0xBBDF, 0xBBE0, 0xBBE1, 0xBBE2, 0xBBE3,
+ 0xBBE4, 0xBBE5, 0xBBE6, 0xBBE7, 0xBBE8, 0xBBE9, 0xBBEA, 0xBBEB,
+ 0xBBEC, 0xBBED, 0xBBEE, 0xBBEF, 0xBBF0, 0xBBF1, 0xBBF2, 0xBBF3,
+ 0xBBF4, 0xBBF5, 0xBBF6, 0xBBF7, 0xBBFA, 0xBBFB, 0xBBFD, 0xBBFE,
+ 0xBC01, 0xBC03, 0xBC04, 0xBC05, 0xBC06, 0xBC07, 0xBC0A, 0xBC0E,
+ 0xBC10, 0xBC12, 0xBC13, 0xBC19, 0xBC1A, 0xBC20, 0xBC21, 0xBC22,
+ 0xBC23, 0xBC26, 0xBC28, 0xBC2A, 0xBC2B, 0xBC2C, 0xBC2E, 0xBC2F,
+ 0xBC32, 0xBC33, 0xBC35, 0xBC36, 0xBC37, 0xBC39, 0xBC3A, 0xBC3B,
+ 0xBC3C, 0xBC3D, 0xBC3E, 0xBC3F, 0xBC42, 0xBC46, 0xBC47, 0xBC48,
+ 0xBC4A, 0xBC4B, 0xBC4E, 0xBC4F, 0xBC51, 0xBC52, 0xBC53, 0xBC54,
+ 0xBC55, 0xBC56, 0xBC57, 0xBC58, 0xBC59, 0xBC5A, 0xBC5B, 0xBC5C,
+ 0xBC5E, 0xBC5F, 0xBC60, 0xBC61, 0xBC62, 0xBC63, 0xBC64, 0xBC65,
+ 0xBC66, 0xBC67, 0xBC68, 0xBC69, 0xBC6A, 0xBC6B, 0xBC6C, 0xBC6D,
+ 0xBC6E, 0xBC6F, 0xBC70, 0xBC71, 0xBC72, 0xBC73, 0xBC74, 0xBC75,
+ 0xBC76, 0xBC77, 0xBC78, 0xBC79, 0xBC7A, 0xBC7B, 0xBC7C, 0xBC7D,
+ 0xBC7E, 0xBC7F, 0xBC80, 0xBC81, 0xBC82, 0xBC83, 0xBC86, 0xBC87,
+ 0xBC89, 0xBC8A, 0xBC8D, 0xBC8F, 0xBC90, 0xBC91, 0xBC92, 0xBC93,
+ 0xBC96, 0xBC98, 0xBC9B, 0xBC9C, 0xBC9D, 0xBC9E, 0xBC9F, 0xBCA2,
+ 0xBCA3, 0xBCA5, 0xBCA6, 0xBCA9, 0xBCAA, 0xBCAB, 0xBCAC, 0xBCAD,
+ 0xBCAE, 0xBCAF, 0xBCB2, 0xBCB6, 0xBCB7, 0xBCB8, 0xBCB9, 0xBCBA,
+ 0xBCBB, 0xBCBE, 0xBCBF, 0xBCC1, 0xBCC2, 0xBCC3, 0xBCC5, 0xBCC6,
+ 0xBCC7, 0xBCC8, 0xBCC9, 0xBCCA, 0xBCCB, 0xBCCC, 0xBCCE, 0xBCD2,
+ 0xBCD3, 0xBCD4, 0xBCD6, 0xBCD7, 0xBCD9, 0xBCDA, 0xBCDB, 0xBCDD,
+ 0xBCDE, 0xBCDF, 0xBCE0, 0xBCE1, 0xBCE2, 0xBCE3, 0xBCE4, 0xBCE5,
+ 0xBCE6, 0xBCE7, 0xBCE8, 0xBCE9, 0xBCEA, 0xBCEB, 0xBCEC, 0xBCED,
+ 0xBCEE, 0xBCEF, 0xBCF0, 0xBCF1, 0xBCF2, 0xBCF3, 0xBCF7, 0xBCF9,
+ 0xBCFA, 0xBCFB, 0xBCFD, 0xBCFE, 0xBCFF, 0xBD00, 0xBD01, 0xBD02,
+ 0xBD03, 0xBD06, 0xBD08, 0xBD0A, 0xBD0B, 0xBD0C, 0xBD0D, 0xBD0E,
+ 0xBD0F, 0xBD11, 0xBD12, 0xBD13, 0xBD15, 0xBD16, 0xBD17, 0xBD18,
+ 0xBD19, 0xBD1A, 0xBD1B, 0xBD1C, 0xBD1D, 0xBD1E, 0xBD1F, 0xBD20,
+ 0xBD21, 0xBD22, 0xBD23, 0xBD25, 0xBD26, 0xBD27, 0xBD28, 0xBD29,
+ 0xBD2A, 0xBD2B, 0xBD2D, 0xBD2E, 0xBD2F, 0xBD30, 0xBD31, 0xBD32,
+ 0xBD33, 0xBD34, 0xBD35, 0xBD36, 0xBD37, 0xBD38, 0xBD39, 0xBD3A,
+ 0xBD3B, 0xBD3C, 0xBD3D, 0xBD3E, 0xBD3F, 0xBD41, 0xBD42, 0xBD43,
+ 0xBD44, 0xBD45, 0xBD46, 0xBD47, 0xBD4A, 0xBD4B, 0xBD4D, 0xBD4E,
+ 0xBD4F, 0xBD51, 0xBD52, 0xBD53, 0xBD54, 0xBD55, 0xBD56, 0xBD57,
+ 0xBD5A, 0xBD5B, 0xBD5C, 0xBD5D, 0xBD5E, 0xBD5F, 0xBD60, 0xBD61,
+ 0xBD62, 0xBD63, 0xBD65, 0xBD66, 0xBD67, 0xBD69, 0xBD6A, 0xBD6B,
+ 0xBD6C, 0xBD6D, 0xBD6E, 0xBD6F, 0xBD70, 0xBD71, 0xBD72, 0xBD73,
+ 0xBD74, 0xBD75, 0xBD76, 0xBD77, 0xBD78, 0xBD79, 0xBD7A, 0xBD7B,
+ 0xBD7C, 0xBD7D, 0xBD7E, 0xBD7F, 0xBD82, 0xBD83, 0xBD85, 0xBD86,
+ 0xBD8B, 0xBD8C, 0xBD8D, 0xBD8E, 0xBD8F, 0xBD92, 0xBD94, 0xBD96,
+ 0xBD97, 0xBD98, 0xBD9B, 0xBD9D, 0xBD9E, 0xBD9F, 0xBDA0, 0xBDA1,
+ 0xBDA2, 0xBDA3, 0xBDA5, 0xBDA6, 0xBDA7, 0xBDA8, 0xBDA9, 0xBDAA,
+ 0xBDAB, 0xBDAC, 0xBDAD, 0xBDAE, 0xBDAF, 0xBDB1, 0xBDB2, 0xBDB3,
+ 0xBDB4, 0xBDB5, 0xBDB6, 0xBDB7, 0xBDB9, 0xBDBA, 0xBDBB, 0xBDBC,
+ 0xBDBD, 0xBDBE, 0xBDBF, 0xBDC0, 0xBDC1, 0xBDC2, 0xBDC3, 0xBDC4,
+ 0xBDC5, 0xBDC6, 0xBDC7, 0xBDC8, 0xBDC9, 0xBDCA, 0xBDCB, 0xBDCC,
+ 0xBDCD, 0xBDCE, 0xBDCF, 0xBDD0, 0xBDD1, 0xBDD2, 0xBDD3, 0xBDD6,
+ 0xBDD7, 0xBDD9, 0xBDDA, 0xBDDB, 0xBDDD, 0xBDDE, 0xBDDF, 0xBDE0,
+ 0xBDE1, 0xBDE2, 0xBDE3, 0xBDE4, 0xBDE5, 0xBDE6, 0xBDE7, 0xBDE8,
+ 0xBDEA, 0xBDEB, 0xBDEC, 0xBDED, 0xBDEE, 0xBDEF, 0xBDF1, 0xBDF2,
+ 0xBDF3, 0xBDF5, 0xBDF6, 0xBDF7, 0xBDF9, 0xBDFA, 0xBDFB, 0xBDFC,
+ 0xBDFD, 0xBDFE, 0xBDFF, 0xBE01, 0xBE02, 0xBE04, 0xBE06, 0xBE07,
+ 0xBE08, 0xBE09, 0xBE0A, 0xBE0B, 0xBE0E, 0xBE0F, 0xBE11, 0xBE12,
+ 0xBE13, 0xBE15, 0xBE16, 0xBE17, 0xBE18, 0xBE19, 0xBE1A, 0xBE1B,
+ 0xBE1E, 0xBE20, 0xBE21, 0xBE22, 0xBE23, 0xBE24, 0xBE25, 0xBE26,
+ 0xBE27, 0xBE28, 0xBE29, 0xBE2A, 0xBE2B, 0xBE2C, 0xBE2D, 0xBE2E,
+ 0xBE2F, 0xBE30, 0xBE31, 0xBE32, 0xBE33, 0xBE34, 0xBE35, 0xBE36,
+ 0xBE37, 0xBE38, 0xBE39, 0xBE3A, 0xBE3B, 0xBE3C, 0xBE3D, 0xBE3E,
+ 0xBE3F, 0xBE40, 0xBE41, 0xBE42, 0xBE43, 0xBE46, 0xBE47, 0xBE49,
+ 0xBE4A, 0xBE4B, 0xBE4D, 0xBE4F, 0xBE50, 0xBE51, 0xBE52, 0xBE53,
+ 0xBE56, 0xBE58, 0xBE5C, 0xBE5D, 0xBE5E, 0xBE5F, 0xBE62, 0xBE63,
+ 0xBE65, 0xBE66, 0xBE67, 0xBE69, 0xBE6B, 0xBE6C, 0xBE6D, 0xBE6E,
+ 0xBE6F, 0xBE72, 0xBE76, 0xBE77, 0xBE78, 0xBE79, 0xBE7A, 0xBE7E,
+ 0xBE7F, 0xBE81, 0xBE82, 0xBE83, 0xBE85, 0xBE86, 0xBE87, 0xBE88,
+ 0xBE89, 0xBE8A, 0xBE8B, 0xBE8E, 0xBE92, 0xBE93, 0xBE94, 0xBE95,
+ 0xBE96, 0xBE97, 0xBE9A, 0xBE9B, 0xBE9C, 0xBE9D, 0xBE9E, 0xBE9F,
+ 0xBEA0, 0xBEA1, 0xBEA2, 0xBEA3, 0xBEA4, 0xBEA5, 0xBEA6, 0xBEA7,
+ 0xBEA9, 0xBEAA, 0xBEAB, 0xBEAC, 0xBEAD, 0xBEAE, 0xBEAF, 0xBEB0,
+ 0xBEB1, 0xBEB2, 0xBEB3, 0xBEB4, 0xBEB5, 0xBEB6, 0xBEB7, 0xBEB8,
+ 0xBEB9, 0xBEBA, 0xBEBB, 0xBEBC, 0xBEBD, 0xBEBE, 0xBEBF, 0xBEC0,
+ 0xBEC1, 0xBEC2, 0xBEC3, 0xBEC4, 0xBEC5, 0xBEC6, 0xBEC7, 0xBEC8,
+ 0xBEC9, 0xBECA, 0xBECB, 0xBECC, 0xBECD, 0xBECE, 0xBECF, 0xBED2,
+ 0xBED3, 0xBED5, 0xBED6, 0xBED9, 0xBEDA, 0xBEDB, 0xBEDC, 0xBEDD,
+ 0xBEDE, 0xBEDF, 0xBEE1, 0xBEE2, 0xBEE6, 0xBEE7, 0xBEE8, 0xBEE9,
+ 0xBEEA, 0xBEEB, 0xBEED, 0xBEEE, 0xBEEF, 0xBEF0, 0xBEF1, 0xBEF2,
+ 0xBEF3, 0xBEF4, 0xBEF5, 0xBEF6, 0xBEF7, 0xBEF8, 0xBEF9, 0xBEFA,
+ 0xBEFB, 0xBEFC, 0xBEFD, 0xBEFE, 0xBEFF, 0xBF00, 0xBF02, 0xBF03,
+ 0xBF04, 0xBF05, 0xBF06, 0xBF07, 0xBF0A, 0xBF0B, 0xBF0C, 0xBF0D,
+ 0xBF0E, 0xBF0F, 0xBF10, 0xBF11, 0xBF12, 0xBF13, 0xBF14, 0xBF15,
+ 0xBF16, 0xBF17, 0xBF1A, 0xBF1E, 0xBF1F, 0xBF20, 0xBF21, 0xBF22,
+ 0xBF23, 0xBF24, 0xBF25, 0xBF26, 0xBF27, 0xBF28, 0xBF29, 0xBF2A,
+ 0xBF2B, 0xBF2C, 0xBF2D, 0xBF2E, 0xBF2F, 0xBF30, 0xBF31, 0xBF32,
+ 0xBF33, 0xBF34, 0xBF35, 0xBF36, 0xBF37, 0xBF38, 0xBF39, 0xBF3A,
+ 0xBF3B, 0xBF3C, 0xBF3D, 0xBF3E, 0xBF3F, 0xBF42, 0xBF43, 0xBF45,
+ 0xBF46, 0xBF47, 0xBF49, 0xBF4A, 0xBF4B, 0xBF4C, 0xBF4D, 0xBF4E,
+ 0xBF4F, 0xBF52, 0xBF53, 0xBF54, 0xBF56, 0xBF57, 0xBF58, 0xBF59,
+ 0xBF5A, 0xBF5B, 0xBF5C, 0xBF5D, 0xBF5E, 0xBF5F, 0xBF60, 0xBF61,
+ 0xBF62, 0xBF63, 0xBF64, 0xBF65, 0xBF66, 0xBF67, 0xBF68, 0xBF69,
+ 0xBF6A, 0xBF6B, 0xBF6C, 0xBF6D, 0xBF6E, 0xBF6F, 0xBF70, 0xBF71,
+ 0xBF72, 0xBF73, 0xBF74, 0xBF75, 0xBF76, 0xBF77, 0xBF78, 0xBF79,
+ 0xBF7A, 0xBF7B, 0xBF7C, 0xBF7D, 0xBF7E, 0xBF7F, 0xBF80, 0xBF81,
+ 0xBF82, 0xBF83, 0xBF84, 0xBF85, 0xBF86, 0xBF87, 0xBF88, 0xBF89,
+ 0xBF8A, 0xBF8B, 0xBF8C, 0xBF8D, 0xBF8E, 0xBF8F, 0xBF90, 0xBF91,
+ 0xBF92, 0xBF93, 0xBF95, 0xBF96, 0xBF97, 0xBF98, 0xBF99, 0xBF9A,
+ 0xBF9B, 0xBF9C, 0xBF9D, 0xBF9E, 0xBF9F, 0xBFA0, 0xBFA1, 0xBFA2,
+ 0xBFA3, 0xBFA4, 0xBFA5, 0xBFA6, 0xBFA7, 0xBFA8, 0xBFA9, 0xBFAA,
+ 0xBFAB, 0xBFAC, 0xBFAD, 0xBFAE, 0xBFAF, 0xBFB1, 0xBFB2, 0xBFB3,
+ 0xBFB4, 0xBFB5, 0xBFB6, 0xBFB7, 0xBFB8, 0xBFB9, 0xBFBA, 0xBFBB,
+ 0xBFBC, 0xBFBD, 0xBFBE, 0xBFBF, 0xBFC0, 0xBFC1, 0xBFC2, 0xBFC3,
+ 0xBFC4, 0xBFC6, 0xBFC7, 0xBFC8, 0xBFC9, 0xBFCA, 0xBFCB, 0xBFCE,
+ 0xBFCF, 0xBFD1, 0xBFD2, 0xBFD3, 0xBFD5, 0xBFD6, 0xBFD7, 0xBFD8,
+ 0xBFD9, 0xBFDA, 0xBFDB, 0xBFDD, 0xBFDE, 0xBFE0, 0xBFE2, 0xBFE3,
+ 0xBFE4, 0xBFE5, 0xBFE6, 0xBFE7, 0xBFE8, 0xBFE9, 0xBFEA, 0xBFEB,
+ 0xBFEC, 0xBFED, 0xBFEE, 0xBFEF, 0xBFF0, 0xBFF1, 0xBFF2, 0xBFF3,
+ 0xBFF4, 0xBFF5, 0xBFF6, 0xBFF7, 0xBFF8, 0xBFF9, 0xBFFA, 0xBFFB,
+ 0xBFFC, 0xBFFD, 0xBFFE, 0xBFFF, 0xC000, 0xC001, 0xC002, 0xC003,
+ 0xC004, 0xC005, 0xC006, 0xC007, 0xC008, 0xC009, 0xC00A, 0xC00B,
+ 0xC00C, 0xC00D, 0xC00E, 0xC00F, 0xC010, 0xC011, 0xC012, 0xC013,
+ 0xC014, 0xC015, 0xC016, 0xC017, 0xC018, 0xC019, 0xC01A, 0xC01B,
+ 0xC01C, 0xC01D, 0xC01E, 0xC01F, 0xC020, 0xC021, 0xC022, 0xC023,
+ 0xC024, 0xC025, 0xC026, 0xC027, 0xC028, 0xC029, 0xC02A, 0xC02B,
+ 0xC02C, 0xC02D, 0xC02E, 0xC02F, 0xC030, 0xC031, 0xC032, 0xC033,
+ 0xC034, 0xC035, 0xC036, 0xC037, 0xC038, 0xC039, 0xC03A, 0xC03B,
+ 0xC03D, 0xC03E, 0xC03F, 0xC040, 0xC041, 0xC042, 0xC043, 0xC044,
+ 0xC045, 0xC046, 0xC047, 0xC048, 0xC049, 0xC04A, 0xC04B, 0xC04C,
+ 0xC04D, 0xC04E, 0xC04F, 0xC050, 0xC052, 0xC053, 0xC054, 0xC055,
+ 0xC056, 0xC057, 0xC059, 0xC05A, 0xC05B, 0xC05D, 0xC05E, 0xC05F,
+ 0xC061, 0xC062, 0xC063, 0xC064, 0xC065, 0xC066, 0xC067, 0xC06A,
+ 0xC06B, 0xC06C, 0xC06D, 0xC06E, 0xC06F, 0xC070, 0xC071, 0xC072,
+ 0xC073, 0xC074, 0xC075, 0xC076, 0xC077, 0xC078, 0xC079, 0xC07A,
+ 0xC07B, 0xC07C, 0xC07D, 0xC07E, 0xC07F, 0xC080, 0xC081, 0xC082,
+ 0xC083, 0xC084, 0xC085, 0xC086, 0xC087, 0xC088, 0xC089, 0xC08A,
+ 0xC08B, 0xC08C, 0xC08D, 0xC08E, 0xC08F, 0xC092, 0xC093, 0xC095,
+ 0xC096, 0xC097, 0xC099, 0xC09A, 0xC09B, 0xC09C, 0xC09D, 0xC09E,
+ 0xC09F, 0xC0A2, 0xC0A4, 0xC0A6, 0xC0A7, 0xC0A8, 0xC0A9, 0xC0AA,
+ 0xC0AB, 0xC0AE, 0xC0B1, 0xC0B2, 0xC0B7, 0xC0B8, 0xC0B9, 0xC0BA,
+ 0xC0BB, 0xC0BE, 0xC0C2, 0xC0C3, 0xC0C4, 0xC0C6, 0xC0C7, 0xC0CA,
+ 0xC0CB, 0xC0CD, 0xC0CE, 0xC0CF, 0xC0D1, 0xC0D2, 0xC0D3, 0xC0D4,
+ 0xC0D5, 0xC0D6, 0xC0D7, 0xC0DA, 0xC0DE, 0xC0DF, 0xC0E0, 0xC0E1,
+ 0xC0E2, 0xC0E3, 0xC0E6, 0xC0E7, 0xC0E9, 0xC0EA, 0xC0EB, 0xC0ED,
+ 0xC0EE, 0xC0EF, 0xC0F0, 0xC0F1, 0xC0F2, 0xC0F3, 0xC0F6, 0xC0F8,
+ 0xC0FA, 0xC0FB, 0xC0FC, 0xC0FD, 0xC0FE, 0xC0FF, 0xC101, 0xC102,
+ 0xC103, 0xC105, 0xC106, 0xC107, 0xC109, 0xC10A, 0xC10B, 0xC10C,
+ 0xC10D, 0xC10E, 0xC10F, 0xC111, 0xC112, 0xC113, 0xC114, 0xC116,
+ 0xC117, 0xC118, 0xC119, 0xC11A, 0xC11B, 0xC121, 0xC122, 0xC125,
+ 0xC128, 0xC129, 0xC12A, 0xC12B, 0xC12E, 0xC132, 0xC133, 0xC134,
+ 0xC135, 0xC137, 0xC13A, 0xC13B, 0xC13D, 0xC13E, 0xC13F, 0xC141,
+ 0xC142, 0xC143, 0xC144, 0xC145, 0xC146, 0xC147, 0xC14A, 0xC14E,
+ 0xC14F, 0xC150, 0xC151, 0xC152, 0xC153, 0xC156, 0xC157, 0xC159,
+ 0xC15A, 0xC15B, 0xC15D, 0xC15E, 0xC15F, 0xC160, 0xC161, 0xC162,
+ 0xC163, 0xC166, 0xC16A, 0xC16B, 0xC16C, 0xC16D, 0xC16E, 0xC16F,
+ 0xC171, 0xC172, 0xC173, 0xC175, 0xC176, 0xC177, 0xC179, 0xC17A,
+ 0xC17B, 0xC17C, 0xC17D, 0xC17E, 0xC17F, 0xC180, 0xC181, 0xC182,
+ 0xC183, 0xC184, 0xC186, 0xC187, 0xC188, 0xC189, 0xC18A, 0xC18B,
+ 0xC18F, 0xC191, 0xC192, 0xC193, 0xC195, 0xC197, 0xC198, 0xC199,
+ 0xC19A, 0xC19B, 0xC19E, 0xC1A0, 0xC1A2, 0xC1A3, 0xC1A4, 0xC1A6,
+ 0xC1A7, 0xC1AA, 0xC1AB, 0xC1AD, 0xC1AE, 0xC1AF, 0xC1B1, 0xC1B2,
+ 0xC1B3, 0xC1B4, 0xC1B5, 0xC1B6, 0xC1B7, 0xC1B8, 0xC1B9, 0xC1BA,
+ 0xC1BB, 0xC1BC, 0xC1BE, 0xC1BF, 0xC1C0, 0xC1C1, 0xC1C2, 0xC1C3,
+ 0xC1C5, 0xC1C6, 0xC1C7, 0xC1C9, 0xC1CA, 0xC1CB, 0xC1CD, 0xC1CE,
+ 0xC1CF, 0xC1D0, 0xC1D1, 0xC1D2, 0xC1D3, 0xC1D5, 0xC1D6, 0xC1D9,
+ 0xC1DA, 0xC1DB, 0xC1DC, 0xC1DD, 0xC1DE, 0xC1DF, 0xC1E1, 0xC1E2,
+ 0xC1E3, 0xC1E5, 0xC1E6, 0xC1E7, 0xC1E9, 0xC1EA, 0xC1EB, 0xC1EC,
+ 0xC1ED, 0xC1EE, 0xC1EF, 0xC1F2, 0xC1F4, 0xC1F5, 0xC1F6, 0xC1F7,
+ 0xC1F8, 0xC1F9, 0xC1FA, 0xC1FB, 0xC1FE, 0xC1FF, 0xC201, 0xC202,
+ 0xC203, 0xC205, 0xC206, 0xC207, 0xC208, 0xC209, 0xC20A, 0xC20B,
+ 0xC20E, 0xC210, 0xC212, 0xC213, 0xC214, 0xC215, 0xC216, 0xC217,
+ 0xC21A, 0xC21B, 0xC21D, 0xC21E, 0xC221, 0xC222, 0xC223, 0xC224,
+ 0xC225, 0xC226, 0xC227, 0xC22A, 0xC22C, 0xC22E, 0xC230, 0xC233,
+ 0xC235, 0xC236, 0xC237, 0xC238, 0xC239, 0xC23A, 0xC23B, 0xC23C,
+ 0xC23D, 0xC23E, 0xC23F, 0xC240, 0xC241, 0xC242, 0xC243, 0xC244,
+ 0xC245, 0xC246, 0xC247, 0xC249, 0xC24A, 0xC24B, 0xC24C, 0xC24D,
+ 0xC24E, 0xC24F, 0xC252, 0xC253, 0xC255, 0xC256, 0xC257, 0xC259,
+ 0xC25A, 0xC25B, 0xC25C, 0xC25D, 0xC25E, 0xC25F, 0xC261, 0xC262,
+ 0xC263, 0xC264, 0xC266, 0xC267, 0xC268, 0xC269, 0xC26A, 0xC26B,
+ 0xC26E, 0xC26F, 0xC271, 0xC272, 0xC273, 0xC275, 0xC276, 0xC277,
+ 0xC278, 0xC279, 0xC27A, 0xC27B, 0xC27E, 0xC280, 0xC282, 0xC283,
+ 0xC284, 0xC285, 0xC286, 0xC287, 0xC28A, 0xC28B, 0xC28C, 0xC28D,
+ 0xC28E, 0xC28F, 0xC291, 0xC292, 0xC293, 0xC294, 0xC295, 0xC296,
+ 0xC297, 0xC299, 0xC29A, 0xC29C, 0xC29E, 0xC29F, 0xC2A0, 0xC2A1,
+ 0xC2A2, 0xC2A3, 0xC2A6, 0xC2A7, 0xC2A9, 0xC2AA, 0xC2AB, 0xC2AE,
+ 0xC2AF, 0xC2B0, 0xC2B1, 0xC2B2, 0xC2B3, 0xC2B6, 0xC2B8, 0xC2BA,
+ 0xC2BB, 0xC2BC, 0xC2BD, 0xC2BE, 0xC2BF, 0xC2C0, 0xC2C1, 0xC2C2,
+ 0xC2C3, 0xC2C4, 0xC2C5, 0xC2C6, 0xC2C7, 0xC2C8, 0xC2C9, 0xC2CA,
+ 0xC2CB, 0xC2CC, 0xC2CD, 0xC2CE, 0xC2CF, 0xC2D0, 0xC2D1, 0xC2D2,
+ 0xC2D3, 0xC2D4, 0xC2D5, 0xC2D6, 0xC2D7, 0xC2D8, 0xC2D9, 0xC2DA,
+ 0xC2DB, 0xC2DE, 0xC2DF, 0xC2E1, 0xC2E2, 0xC2E5, 0xC2E6, 0xC2E7,
+ 0xC2E8, 0xC2E9, 0xC2EA, 0xC2EE, 0xC2F0, 0xC2F2, 0xC2F3, 0xC2F4,
+ 0xC2F5, 0xC2F7, 0xC2FA, 0xC2FD, 0xC2FE, 0xC2FF, 0xC301, 0xC302,
+ 0xC303, 0xC304, 0xC305, 0xC306, 0xC307, 0xC30A, 0xC30B, 0xC30E,
+ 0xC30F, 0xC310, 0xC311, 0xC312, 0xC316, 0xC317, 0xC319, 0xC31A,
+ 0xC31B, 0xC31D, 0xC31E, 0xC31F, 0xC320, 0xC321, 0xC322, 0xC323,
+ 0xC326, 0xC327, 0xC32A, 0xC32B, 0xC32C, 0xC32D, 0xC32E, 0xC32F,
+ 0xC330, 0xC331, 0xC332, 0xC333, 0xC334, 0xC335, 0xC336, 0xC337,
+ 0xC338, 0xC339, 0xC33A, 0xC33B, 0xC33C, 0xC33D, 0xC33E, 0xC33F,
+ 0xC340, 0xC341, 0xC342, 0xC343, 0xC344, 0xC346, 0xC347, 0xC348,
+ 0xC349, 0xC34A, 0xC34B, 0xC34C, 0xC34D, 0xC34E, 0xC34F, 0xC350,
+ 0xC351, 0xC352, 0xC353, 0xC354, 0xC355, 0xC356, 0xC357, 0xC358,
+ 0xC359, 0xC35A, 0xC35B, 0xC35C, 0xC35D, 0xC35E, 0xC35F, 0xC360,
+ 0xC361, 0xC362, 0xC363, 0xC364, 0xC365, 0xC366, 0xC367, 0xC36A,
+ 0xC36B, 0xC36D, 0xC36E, 0xC36F, 0xC371, 0xC373, 0xC374, 0xC375,
+ 0xC376, 0xC377, 0xC37A, 0xC37B, 0xC37E, 0xC37F, 0xC380, 0xC381,
+ 0xC382, 0xC383, 0xC385, 0xC386, 0xC387, 0xC389, 0xC38A, 0xC38B,
+ 0xC38D, 0xC38E, 0xC38F, 0xC390, 0xC391, 0xC392, 0xC393, 0xC394,
+ 0xC395, 0xC396, 0xC397, 0xC398, 0xC399, 0xC39A, 0xC39B, 0xC39C,
+ 0xC39D, 0xC39E, 0xC39F, 0xC3A0, 0xC3A1, 0xC3A2, 0xC3A3, 0xC3A4,
+ 0xC3A5, 0xC3A6, 0xC3A7, 0xC3A8, 0xC3A9, 0xC3AA, 0xC3AB, 0xC3AC,
+ 0xC3AD, 0xC3AE, 0xC3AF, 0xC3B0, 0xC3B1, 0xC3B2, 0xC3B3, 0xC3B4,
+ 0xC3B5, 0xC3B6, 0xC3B7, 0xC3B8, 0xC3B9, 0xC3BA, 0xC3BB, 0xC3BC,
+ 0xC3BD, 0xC3BE, 0xC3BF, 0xC3C1, 0xC3C2, 0xC3C3, 0xC3C4, 0xC3C5,
+ 0xC3C6, 0xC3C7, 0xC3C8, 0xC3C9, 0xC3CA, 0xC3CB, 0xC3CC, 0xC3CD,
+ 0xC3CE, 0xC3CF, 0xC3D0, 0xC3D1, 0xC3D2, 0xC3D3, 0xC3D4, 0xC3D5,
+ 0xC3D6, 0xC3D7, 0xC3DA, 0xC3DB, 0xC3DD, 0xC3DE, 0xC3E1, 0xC3E3,
+ 0xC3E4, 0xC3E5, 0xC3E6, 0xC3E7, 0xC3EA, 0xC3EB, 0xC3EC, 0xC3EE,
+ 0xC3EF, 0xC3F0, 0xC3F1, 0xC3F2, 0xC3F3, 0xC3F6, 0xC3F7, 0xC3F9,
+ 0xC3FA, 0xC3FB, 0xC3FC, 0xC3FD, 0xC3FE, 0xC3FF, 0xC400, 0xC401,
+ 0xC402, 0xC403, 0xC404, 0xC405, 0xC406, 0xC407, 0xC409, 0xC40A,
+ 0xC40B, 0xC40C, 0xC40D, 0xC40E, 0xC40F, 0xC411, 0xC412, 0xC413,
+ 0xC414, 0xC415, 0xC416, 0xC417, 0xC418, 0xC419, 0xC41A, 0xC41B,
+ 0xC41C, 0xC41D, 0xC41E, 0xC41F, 0xC420, 0xC421, 0xC422, 0xC423,
+ 0xC425, 0xC426, 0xC427, 0xC428, 0xC429, 0xC42A, 0xC42B, 0xC42D,
+ 0xC42E, 0xC42F, 0xC431, 0xC432, 0xC433, 0xC435, 0xC436, 0xC437,
+ 0xC438, 0xC439, 0xC43A, 0xC43B, 0xC43E, 0xC43F, 0xC440, 0xC441,
+ 0xC442, 0xC443, 0xC444, 0xC445, 0xC446, 0xC447, 0xC449, 0xC44A,
+ 0xC44B, 0xC44C, 0xC44D, 0xC44E, 0xC44F, 0xC450, 0xC451, 0xC452,
+ 0xC453, 0xC454, 0xC455, 0xC456, 0xC457, 0xC458, 0xC459, 0xC45A,
+ 0xC45B, 0xC45C, 0xC45D, 0xC45E, 0xC45F, 0xC460, 0xC461, 0xC462,
+ 0xC463, 0xC466, 0xC467, 0xC469, 0xC46A, 0xC46B, 0xC46D, 0xC46E,
+ 0xC46F, 0xC470, 0xC471, 0xC472, 0xC473, 0xC476, 0xC477, 0xC478,
+ 0xC47A, 0xC47B, 0xC47C, 0xC47D, 0xC47E, 0xC47F, 0xC481, 0xC482,
+ 0xC483, 0xC484, 0xC485, 0xC486, 0xC487, 0xC488, 0xC489, 0xC48A,
+ 0xC48B, 0xC48C, 0xC48D, 0xC48E, 0xC48F, 0xC490, 0xC491, 0xC492,
+ 0xC493, 0xC495, 0xC496, 0xC497, 0xC498, 0xC499, 0xC49A, 0xC49B,
+ 0xC49D, 0xC49E, 0xC49F, 0xC4A0, 0xC4A1, 0xC4A2, 0xC4A3, 0xC4A4,
+ 0xC4A5, 0xC4A6, 0xC4A7, 0xC4A8, 0xC4A9, 0xC4AA, 0xC4AB, 0xC4AC,
+ 0xC4AD, 0xC4AE, 0xC4AF, 0xC4B0, 0xC4B1, 0xC4B2, 0xC4B3, 0xC4B4,
+ 0xC4B5, 0xC4B6, 0xC4B7, 0xC4B9, 0xC4BA, 0xC4BB, 0xC4BD, 0xC4BE,
+ 0xC4BF, 0xC4C0, 0xC4C1, 0xC4C2, 0xC4C3, 0xC4C4, 0xC4C5, 0xC4C6,
+ 0xC4C7, 0xC4C8, 0xC4C9, 0xC4CA, 0xC4CB, 0xC4CC, 0xC4CD, 0xC4CE,
+ 0xC4CF, 0xC4D0, 0xC4D1, 0xC4D2, 0xC4D3, 0xC4D4, 0xC4D5, 0xC4D6,
+ 0xC4D7, 0xC4D8, 0xC4D9, 0xC4DA, 0xC4DB, 0xC4DC, 0xC4DD, 0xC4DE,
+ 0xC4DF, 0xC4E0, 0xC4E1, 0xC4E2, 0xC4E3, 0xC4E4, 0xC4E5, 0xC4E6,
+ 0xC4E7, 0xC4E8, 0xC4EA, 0xC4EB, 0xC4EC, 0xC4ED, 0xC4EE, 0xC4EF,
+ 0xC4F2, 0xC4F3, 0xC4F5, 0xC4F6, 0xC4F7, 0xC4F9, 0xC4FB, 0xC4FC,
+ 0xC4FD, 0xC4FE, 0xC502, 0xC503, 0xC504, 0xC505, 0xC506, 0xC507,
+ 0xC508, 0xC509, 0xC50A, 0xC50B, 0xC50D, 0xC50E, 0xC50F, 0xC511,
+ 0xC512, 0xC513, 0xC515, 0xC516, 0xC517, 0xC518, 0xC519, 0xC51A,
+ 0xC51B, 0xC51D, 0xC51E, 0xC51F, 0xC520, 0xC521, 0xC522, 0xC523,
+ 0xC524, 0xC525, 0xC526, 0xC527, 0xC52A, 0xC52B, 0xC52D, 0xC52E,
+ 0xC52F, 0xC531, 0xC532, 0xC533, 0xC534, 0xC535, 0xC536, 0xC537,
+ 0xC53A, 0xC53C, 0xC53E, 0xC53F, 0xC540, 0xC541, 0xC542, 0xC543,
+ 0xC546, 0xC547, 0xC54B, 0xC54F, 0xC550, 0xC551, 0xC552, 0xC556,
+ 0xC55A, 0xC55B, 0xC55C, 0xC55F, 0xC562, 0xC563, 0xC565, 0xC566,
+ 0xC567, 0xC569, 0xC56A, 0xC56B, 0xC56C, 0xC56D, 0xC56E, 0xC56F,
+ 0xC572, 0xC576, 0xC577, 0xC578, 0xC579, 0xC57A, 0xC57B, 0xC57E,
+ 0xC57F, 0xC581, 0xC582, 0xC583, 0xC585, 0xC586, 0xC588, 0xC589,
+ 0xC58A, 0xC58B, 0xC58E, 0xC590, 0xC592, 0xC593, 0xC594, 0xC596,
+ 0xC599, 0xC59A, 0xC59B, 0xC59D, 0xC59E, 0xC59F, 0xC5A1, 0xC5A2,
+ 0xC5A3, 0xC5A4, 0xC5A5, 0xC5A6, 0xC5A7, 0xC5A8, 0xC5AA, 0xC5AB,
+ 0xC5AC, 0xC5AD, 0xC5AE, 0xC5AF, 0xC5B0, 0xC5B1, 0xC5B2, 0xC5B3,
+ 0xC5B6, 0xC5B7, 0xC5BA, 0xC5BF, 0xC5C0, 0xC5C1, 0xC5C2, 0xC5C3,
+ 0xC5CB, 0xC5CD, 0xC5CF, 0xC5D2, 0xC5D3, 0xC5D5, 0xC5D6, 0xC5D7,
+ 0xC5D9, 0xC5DA, 0xC5DB, 0xC5DC, 0xC5DD, 0xC5DE, 0xC5DF, 0xC5E2,
+ 0xC5E4, 0xC5E6, 0xC5E7, 0xC5E8, 0xC5E9, 0xC5EA, 0xC5EB, 0xC5EF,
+ 0xC5F1, 0xC5F2, 0xC5F3, 0xC5F5, 0xC5F8, 0xC5F9, 0xC5FA, 0xC5FB,
+ 0xC602, 0xC603, 0xC604, 0xC609, 0xC60A, 0xC60B, 0xC60D, 0xC60E,
+ 0xC60F, 0xC611, 0xC612, 0xC613, 0xC614, 0xC615, 0xC616, 0xC617,
+ 0xC61A, 0xC61D, 0xC61E, 0xC61F, 0xC620, 0xC621, 0xC622, 0xC623,
+ 0xC626, 0xC627, 0xC629, 0xC62A, 0xC62B, 0xC62F, 0xC631, 0xC632,
+ 0xC636, 0xC638, 0xC63A, 0xC63C, 0xC63D, 0xC63E, 0xC63F, 0xC642,
+ 0xC643, 0xC645, 0xC646, 0xC647, 0xC649, 0xC64A, 0xC64B, 0xC64C,
+ 0xC64D, 0xC64E, 0xC64F, 0xC652, 0xC656, 0xC657, 0xC658, 0xC659,
+ 0xC65A, 0xC65B, 0xC65E, 0xC65F, 0xC661, 0xC662, 0xC663, 0xC664,
+ 0xC665, 0xC666, 0xC667, 0xC668, 0xC669, 0xC66A, 0xC66B, 0xC66D,
+ 0xC66E, 0xC670, 0xC672, 0xC673, 0xC674, 0xC675, 0xC676, 0xC677,
+ 0xC67A, 0xC67B, 0xC67D, 0xC67E, 0xC67F, 0xC681, 0xC682, 0xC683,
+ 0xC684, 0xC685, 0xC686, 0xC687, 0xC68A, 0xC68C, 0xC68E, 0xC68F,
+ 0xC690, 0xC691, 0xC692, 0xC693, 0xC696, 0xC697, 0xC699, 0xC69A,
+ 0xC69B, 0xC69D, 0xC69E, 0xC69F, 0xC6A0, 0xC6A1, 0xC6A2, 0xC6A3,
+ 0xC6A6, 0xC6A8, 0xC6AA, 0xC6AB, 0xC6AC, 0xC6AD, 0xC6AE, 0xC6AF,
+ 0xC6B2, 0xC6B3, 0xC6B5, 0xC6B6, 0xC6B7, 0xC6BB, 0xC6BC, 0xC6BD,
+ 0xC6BE, 0xC6BF, 0xC6C2, 0xC6C4, 0xC6C6, 0xC6C7, 0xC6C8, 0xC6C9,
+ 0xC6CA, 0xC6CB, 0xC6CE, 0xC6CF, 0xC6D1, 0xC6D2, 0xC6D3, 0xC6D5,
+ 0xC6D6, 0xC6D7, 0xC6D8, 0xC6D9, 0xC6DA, 0xC6DB, 0xC6DE, 0xC6DF,
+ 0xC6E2, 0xC6E3, 0xC6E4, 0xC6E5, 0xC6E6, 0xC6E7, 0xC6EA, 0xC6EB,
+ 0xC6ED, 0xC6EE, 0xC6EF, 0xC6F1, 0xC6F2, 0xC6F3, 0xC6F4, 0xC6F5,
+ 0xC6F6, 0xC6F7, 0xC6FA, 0xC6FB, 0xC6FC, 0xC6FE, 0xC6FF, 0xC700,
+ 0xC701, 0xC702, 0xC703, 0xC706, 0xC707, 0xC709, 0xC70A, 0xC70B,
+ 0xC70D, 0xC70E, 0xC70F, 0xC710, 0xC711, 0xC712, 0xC713, 0xC716,
+ 0xC718, 0xC71A, 0xC71B, 0xC71C, 0xC71D, 0xC71E, 0xC71F, 0xC722,
+ 0xC723, 0xC725, 0xC726, 0xC727, 0xC729, 0xC72A, 0xC72B, 0xC72C,
+ 0xC72D, 0xC72E, 0xC72F, 0xC732, 0xC734, 0xC736, 0xC738, 0xC739,
+ 0xC73A, 0xC73B, 0xC73E, 0xC73F, 0xC741, 0xC742, 0xC743, 0xC745,
+ 0xC746, 0xC747, 0xC748, 0xC749, 0xC74B, 0xC74E, 0xC750, 0xC759,
+ 0xC75A, 0xC75B, 0xC75D, 0xC75E, 0xC75F, 0xC761, 0xC762, 0xC763,
+ 0xC764, 0xC765, 0xC766, 0xC767, 0xC769, 0xC76A, 0xC76C, 0xC76D,
+ 0xC76E, 0xC76F, 0xC770, 0xC771, 0xC772, 0xC773, 0xC776, 0xC777,
+ 0xC779, 0xC77A, 0xC77B, 0xC77F, 0xC780, 0xC781, 0xC782, 0xC786,
+ 0xC78B, 0xC78C, 0xC78D, 0xC78F, 0xC792, 0xC793, 0xC795, 0xC799,
+ 0xC79B, 0xC79C, 0xC79D, 0xC79E, 0xC79F, 0xC7A2, 0xC7A7, 0xC7A8,
+ 0xC7A9, 0xC7AA, 0xC7AB, 0xC7AE, 0xC7AF, 0xC7B1, 0xC7B2, 0xC7B3,
+ 0xC7B5, 0xC7B6, 0xC7B7, 0xC7B8, 0xC7B9, 0xC7BA, 0xC7BB, 0xC7BE,
+ 0xC7C2, 0xC7C3, 0xC7C4, 0xC7C5, 0xC7C6, 0xC7C7, 0xC7CA, 0xC7CB,
+ 0xC7CD, 0xC7CF, 0xC7D1, 0xC7D2, 0xC7D3, 0xC7D4, 0xC7D5, 0xC7D6,
+ 0xC7D7, 0xC7D9, 0xC7DA, 0xC7DB, 0xC7DC, 0xC7DE, 0xC7DF, 0xC7E0,
+ 0xC7E1, 0xC7E2, 0xC7E3, 0xC7E5, 0xC7E6, 0xC7E7, 0xC7E9, 0xC7EA,
+ 0xC7EB, 0xC7ED, 0xC7EE, 0xC7EF, 0xC7F0, 0xC7F1, 0xC7F2, 0xC7F3,
+ 0xC7F4, 0xC7F5, 0xC7F6, 0xC7F7, 0xC7F8, 0xC7F9, 0xC7FA, 0xC7FB,
+ 0xC7FC, 0xC7FD, 0xC7FE, 0xC7FF, 0xC802, 0xC803, 0xC805, 0xC806,
+ 0xC807, 0xC809, 0xC80B, 0xC80C, 0xC80D, 0xC80E, 0xC80F, 0xC812,
+ 0xC814, 0xC817, 0xC818, 0xC819, 0xC81A, 0xC81B, 0xC81E, 0xC81F,
+ 0xC821, 0xC822, 0xC823, 0xC825, 0xC826, 0xC827, 0xC828, 0xC829,
+ 0xC82A, 0xC82B, 0xC82E, 0xC830, 0xC832, 0xC833, 0xC834, 0xC835,
+ 0xC836, 0xC837, 0xC839, 0xC83A, 0xC83B, 0xC83D, 0xC83E, 0xC83F,
+ 0xC841, 0xC842, 0xC843, 0xC844, 0xC845, 0xC846, 0xC847, 0xC84A,
+ 0xC84B, 0xC84E, 0xC84F, 0xC850, 0xC851, 0xC852, 0xC853, 0xC855,
+ 0xC856, 0xC857, 0xC858, 0xC859, 0xC85A, 0xC85B, 0xC85C, 0xC85D,
+ 0xC85E, 0xC85F, 0xC860, 0xC861, 0xC862, 0xC863, 0xC864, 0xC865,
+ 0xC866, 0xC867, 0xC868, 0xC869, 0xC86A, 0xC86B, 0xC86C, 0xC86D,
+ 0xC86E, 0xC86F, 0xC872, 0xC873, 0xC875, 0xC876, 0xC877, 0xC879,
+ 0xC87B, 0xC87C, 0xC87D, 0xC87E, 0xC87F, 0xC882, 0xC884, 0xC888,
+ 0xC889, 0xC88A, 0xC88E, 0xC88F, 0xC890, 0xC891, 0xC892, 0xC893,
+ 0xC895, 0xC896, 0xC897, 0xC898, 0xC899, 0xC89A, 0xC89B, 0xC89C,
+ 0xC89E, 0xC8A0, 0xC8A2, 0xC8A3, 0xC8A4, 0xC8A5, 0xC8A6, 0xC8A7,
+ 0xC8A9, 0xC8AA, 0xC8AB, 0xC8AC, 0xC8AD, 0xC8AE, 0xC8AF, 0xC8B0,
+ 0xC8B1, 0xC8B2, 0xC8B3, 0xC8B4, 0xC8B5, 0xC8B6, 0xC8B7, 0xC8B8,
+ 0xC8B9, 0xC8BA, 0xC8BB, 0xC8BE, 0xC8BF, 0xC8C0, 0xC8C1, 0xC8C2,
+ 0xC8C3, 0xC8C5, 0xC8C6, 0xC8C7, 0xC8C9, 0xC8CA, 0xC8CB, 0xC8CD,
+ 0xC8CE, 0xC8CF, 0xC8D0, 0xC8D1, 0xC8D2, 0xC8D3, 0xC8D6, 0xC8D8,
+ 0xC8DA, 0xC8DB, 0xC8DC, 0xC8DD, 0xC8DE, 0xC8DF, 0xC8E2, 0xC8E3,
+ 0xC8E5, 0xC8E6, 0xC8E7, 0xC8E8, 0xC8E9, 0xC8EA, 0xC8EB, 0xC8EC,
+ 0xC8ED, 0xC8EE, 0xC8EF, 0xC8F0, 0xC8F1, 0xC8F2, 0xC8F3, 0xC8F4,
+ 0xC8F6, 0xC8F7, 0xC8F8, 0xC8F9, 0xC8FA, 0xC8FB, 0xC8FE, 0xC8FF,
+ 0xC901, 0xC902, 0xC903, 0xC907, 0xC908, 0xC909, 0xC90A, 0xC90B,
+ 0xC90E, 0xC910, 0xC912, 0xC913, 0xC914, 0xC915, 0xC916, 0xC917,
+ 0xC919, 0xC91A, 0xC91B, 0xC91C, 0xC91D, 0xC91E, 0xC91F, 0xC920,
+ 0xC921, 0xC922, 0xC923, 0xC924, 0xC925, 0xC926, 0xC927, 0xC928,
+ 0xC929, 0xC92A, 0xC92B, 0xC92D, 0xC92E, 0xC92F, 0xC930, 0xC931,
+ 0xC932, 0xC933, 0xC935, 0xC936, 0xC937, 0xC938, 0xC939, 0xC93A,
+ 0xC93B, 0xC93C, 0xC93D, 0xC93E, 0xC93F, 0xC940, 0xC941, 0xC942,
+ 0xC943, 0xC944, 0xC945, 0xC946, 0xC947, 0xC948, 0xC949, 0xC94A,
+ 0xC94B, 0xC94C, 0xC94D, 0xC94E, 0xC94F, 0xC952, 0xC953, 0xC955,
+ 0xC956, 0xC957, 0xC959, 0xC95A, 0xC95B, 0xC95C, 0xC95D, 0xC95E,
+ 0xC95F, 0xC962, 0xC964, 0xC965, 0xC966, 0xC967, 0xC968, 0xC969,
+ 0xC96A, 0xC96B, 0xC96D, 0xC96E, 0xC96F, 0xC971, 0xC972, 0xC973,
+ 0xC975, 0xC976, 0xC977, 0xC978, 0xC979, 0xC97A, 0xC97B, 0xC97D,
+ 0xC97E, 0xC97F, 0xC980, 0xC981, 0xC982, 0xC983, 0xC984, 0xC985,
+ 0xC986, 0xC987, 0xC98A, 0xC98B, 0xC98D, 0xC98E, 0xC98F, 0xC991,
+ 0xC992, 0xC993, 0xC994, 0xC995, 0xC996, 0xC997, 0xC99A, 0xC99C,
+ 0xC99E, 0xC99F, 0xC9A0, 0xC9A1, 0xC9A2, 0xC9A3, 0xC9A4, 0xC9A5,
+ 0xC9A6, 0xC9A7, 0xC9A8, 0xC9A9, 0xC9AA, 0xC9AB, 0xC9AC, 0xC9AD,
+ 0xC9AE, 0xC9AF, 0xC9B0, 0xC9B1, 0xC9B2, 0xC9B3, 0xC9B4, 0xC9B5,
+ 0xC9B6, 0xC9B7, 0xC9B8, 0xC9B9, 0xC9BA, 0xC9BB, 0xC9BC, 0xC9BD,
+ 0xC9BE, 0xC9BF, 0xC9C2, 0xC9C3, 0xC9C5, 0xC9C6, 0xC9C9, 0xC9CB,
+ 0xC9CC, 0xC9CD, 0xC9CE, 0xC9CF, 0xC9D2, 0xC9D4, 0xC9D7, 0xC9D8,
+ 0xC9DB, 0xC9DE, 0xC9DF, 0xC9E1, 0xC9E3, 0xC9E5, 0xC9E6, 0xC9E8,
+ 0xC9E9, 0xC9EA, 0xC9EB, 0xC9EE, 0xC9F2, 0xC9F3, 0xC9F4, 0xC9F5,
+ 0xC9F6, 0xC9F7, 0xC9FA, 0xC9FB, 0xC9FD, 0xC9FE, 0xC9FF, 0xCA01,
+ 0xCA02, 0xCA03, 0xCA04, 0xCA05, 0xCA06, 0xCA07, 0xCA0A, 0xCA0E,
+ 0xCA0F, 0xCA10, 0xCA11, 0xCA12, 0xCA13, 0xCA15, 0xCA16, 0xCA17,
+ 0xCA19, 0xCA1A, 0xCA1B, 0xCA1C, 0xCA1D, 0xCA1E, 0xCA1F, 0xCA20,
+ 0xCA21, 0xCA22, 0xCA23, 0xCA24, 0xCA25, 0xCA26, 0xCA27, 0xCA28,
+ 0xCA2A, 0xCA2B, 0xCA2C, 0xCA2D, 0xCA2E, 0xCA2F, 0xCA30, 0xCA31,
+ 0xCA32, 0xCA33, 0xCA34, 0xCA35, 0xCA36, 0xCA37, 0xCA38, 0xCA39,
+ 0xCA3A, 0xCA3B, 0xCA3C, 0xCA3D, 0xCA3E, 0xCA3F, 0xCA40, 0xCA41,
+ 0xCA42, 0xCA43, 0xCA44, 0xCA45, 0xCA46, 0xCA47, 0xCA48, 0xCA49,
+ 0xCA4A, 0xCA4B, 0xCA4E, 0xCA4F, 0xCA51, 0xCA52, 0xCA53, 0xCA55,
+ 0xCA56, 0xCA57, 0xCA58, 0xCA59, 0xCA5A, 0xCA5B, 0xCA5E, 0xCA62,
+ 0xCA63, 0xCA64, 0xCA65, 0xCA66, 0xCA67, 0xCA69, 0xCA6A, 0xCA6B,
+ 0xCA6C, 0xCA6D, 0xCA6E, 0xCA6F, 0xCA70, 0xCA71, 0xCA72, 0xCA73,
+ 0xCA74, 0xCA75, 0xCA76, 0xCA77, 0xCA78, 0xCA79, 0xCA7A, 0xCA7B,
+ 0xCA7C, 0xCA7E, 0xCA7F, 0xCA80, 0xCA81, 0xCA82, 0xCA83, 0xCA85,
+ 0xCA86, 0xCA87, 0xCA88, 0xCA89, 0xCA8A, 0xCA8B, 0xCA8C, 0xCA8D,
+ 0xCA8E, 0xCA8F, 0xCA90, 0xCA91, 0xCA92, 0xCA93, 0xCA94, 0xCA95,
+ 0xCA96, 0xCA97, 0xCA99, 0xCA9A, 0xCA9B, 0xCA9C, 0xCA9D, 0xCA9E,
+ 0xCA9F, 0xCAA0, 0xCAA1, 0xCAA2, 0xCAA3, 0xCAA4, 0xCAA5, 0xCAA6,
+ 0xCAA7, 0xCAA8, 0xCAA9, 0xCAAA, 0xCAAB, 0xCAAC, 0xCAAD, 0xCAAE,
+ 0xCAAF, 0xCAB0, 0xCAB1, 0xCAB2, 0xCAB3, 0xCAB4, 0xCAB5, 0xCAB6,
+ 0xCAB7, 0xCAB8, 0xCAB9, 0xCABA, 0xCABB, 0xCABE, 0xCABF, 0xCAC1,
+ 0xCAC2, 0xCAC3, 0xCAC5, 0xCAC6, 0xCAC7, 0xCAC8, 0xCAC9, 0xCACA,
+ 0xCACB, 0xCACE, 0xCAD0, 0xCAD2, 0xCAD4, 0xCAD5, 0xCAD6, 0xCAD7,
+ 0xCADA, 0xCADB, 0xCADC, 0xCADD, 0xCADE, 0xCADF, 0xCAE1, 0xCAE2,
+ 0xCAE3, 0xCAE4, 0xCAE5, 0xCAE6, 0xCAE7, 0xCAE8, 0xCAE9, 0xCAEA,
+ 0xCAEB, 0xCAED, 0xCAEE, 0xCAEF, 0xCAF0, 0xCAF1, 0xCAF2, 0xCAF3,
+ 0xCAF5, 0xCAF6, 0xCAF7, 0xCAF8, 0xCAF9, 0xCAFA, 0xCAFB, 0xCAFC,
+ 0xCAFD, 0xCAFE, 0xCAFF, 0xCB00, 0xCB01, 0xCB02, 0xCB03, 0xCB04,
+ 0xCB05, 0xCB06, 0xCB07, 0xCB09, 0xCB0A, 0xCB0B, 0xCB0C, 0xCB0D,
+ 0xCB0E, 0xCB0F, 0xCB11, 0xCB12, 0xCB13, 0xCB15, 0xCB16, 0xCB17,
+ 0xCB19, 0xCB1A, 0xCB1B, 0xCB1C, 0xCB1D, 0xCB1E, 0xCB1F, 0xCB22,
+ 0xCB23, 0xCB24, 0xCB25, 0xCB26, 0xCB27, 0xCB28, 0xCB29, 0xCB2A,
+ 0xCB2B, 0xCB2C, 0xCB2D, 0xCB2E, 0xCB2F, 0xCB30, 0xCB31, 0xCB32,
+ 0xCB33, 0xCB34, 0xCB35, 0xCB36, 0xCB37, 0xCB38, 0xCB39, 0xCB3A,
+ 0xCB3B, 0xCB3C, 0xCB3D, 0xCB3E, 0xCB3F, 0xCB40, 0xCB42, 0xCB43,
+ 0xCB44, 0xCB45, 0xCB46, 0xCB47, 0xCB4A, 0xCB4B, 0xCB4D, 0xCB4E,
+ 0xCB4F, 0xCB51, 0xCB52, 0xCB53, 0xCB54, 0xCB55, 0xCB56, 0xCB57,
+ 0xCB5A, 0xCB5B, 0xCB5C, 0xCB5E, 0xCB5F, 0xCB60, 0xCB61, 0xCB62,
+ 0xCB63, 0xCB65, 0xCB66, 0xCB67, 0xCB68, 0xCB69, 0xCB6A, 0xCB6B,
+ 0xCB6C, 0xCB6D, 0xCB6E, 0xCB6F, 0xCB70, 0xCB71, 0xCB72, 0xCB73,
+ 0xCB74, 0xCB75, 0xCB76, 0xCB77, 0xCB7A, 0xCB7B, 0xCB7C, 0xCB7D,
+ 0xCB7E, 0xCB7F, 0xCB80, 0xCB81, 0xCB82, 0xCB83, 0xCB84, 0xCB85,
+ 0xCB86, 0xCB87, 0xCB88, 0xCB89, 0xCB8A, 0xCB8B, 0xCB8C, 0xCB8D,
+ 0xCB8E, 0xCB8F, 0xCB90, 0xCB91, 0xCB92, 0xCB93, 0xCB94, 0xCB95,
+ 0xCB96, 0xCB97, 0xCB98, 0xCB99, 0xCB9A, 0xCB9B, 0xCB9D, 0xCB9E,
+ 0xCB9F, 0xCBA0, 0xCBA1, 0xCBA2, 0xCBA3, 0xCBA4, 0xCBA5, 0xCBA6,
+ 0xCBA7, 0xCBA8, 0xCBA9, 0xCBAA, 0xCBAB, 0xCBAC, 0xCBAD, 0xCBAE,
+ 0xCBAF, 0xCBB0, 0xCBB1, 0xCBB2, 0xCBB3, 0xCBB4, 0xCBB5, 0xCBB6,
+ 0xCBB7, 0xCBB9, 0xCBBA, 0xCBBB, 0xCBBC, 0xCBBD, 0xCBBE, 0xCBBF,
+ 0xCBC0, 0xCBC1, 0xCBC2, 0xCBC3, 0xCBC4, 0xCBC5, 0xCBC6, 0xCBC7,
+ 0xCBC8, 0xCBC9, 0xCBCA, 0xCBCB, 0xCBCC, 0xCBCD, 0xCBCE, 0xCBCF,
+ 0xCBD0, 0xCBD1, 0xCBD2, 0xCBD3, 0xCBD5, 0xCBD6, 0xCBD7, 0xCBD8,
+ 0xCBD9, 0xCBDA, 0xCBDB, 0xCBDC, 0xCBDD, 0xCBDE, 0xCBDF, 0xCBE0,
+ 0xCBE1, 0xCBE2, 0xCBE3, 0xCBE5, 0xCBE6, 0xCBE8, 0xCBEA, 0xCBEB,
+ 0xCBEC, 0xCBED, 0xCBEE, 0xCBEF, 0xCBF0, 0xCBF1, 0xCBF2, 0xCBF3,
+ 0xCBF4, 0xCBF5, 0xCBF6, 0xCBF7, 0xCBF8, 0xCBF9, 0xCBFA, 0xCBFB,
+ 0xCBFC, 0xCBFD, 0xCBFE, 0xCBFF, 0xCC00, 0xCC01, 0xCC02, 0xCC03,
+ 0xCC04, 0xCC05, 0xCC06, 0xCC07, 0xCC08, 0xCC09, 0xCC0A, 0xCC0B,
+ 0xCC0E, 0xCC0F, 0xCC11, 0xCC12, 0xCC13, 0xCC15, 0xCC16, 0xCC17,
+ 0xCC18, 0xCC19, 0xCC1A, 0xCC1B, 0xCC1E, 0xCC1F, 0xCC20, 0xCC23,
+ 0xCC24, 0xCC25, 0xCC26, 0xCC2A, 0xCC2B, 0xCC2D, 0xCC2F, 0xCC31,
+ 0xCC32, 0xCC33, 0xCC34, 0xCC35, 0xCC36, 0xCC37, 0xCC3A, 0xCC3F,
+ 0xCC40, 0xCC41, 0xCC42, 0xCC43, 0xCC46, 0xCC47, 0xCC49, 0xCC4A,
+ 0xCC4B, 0xCC4D, 0xCC4E, 0xCC4F, 0xCC50, 0xCC51, 0xCC52, 0xCC53,
+ 0xCC56, 0xCC5A, 0xCC5B, 0xCC5C, 0xCC5D, 0xCC5E, 0xCC5F, 0xCC61,
+ 0xCC62, 0xCC63, 0xCC65, 0xCC67, 0xCC69, 0xCC6A, 0xCC6B, 0xCC6C,
+ 0xCC6D, 0xCC6E, 0xCC6F, 0xCC71, 0xCC72, 0xCC73, 0xCC74, 0xCC76,
+ 0xCC77, 0xCC78, 0xCC79, 0xCC7A, 0xCC7B, 0xCC7C, 0xCC7D, 0xCC7E,
+ 0xCC7F, 0xCC80, 0xCC81, 0xCC82, 0xCC83, 0xCC84, 0xCC85, 0xCC86,
+ 0xCC87, 0xCC88, 0xCC89, 0xCC8A, 0xCC8B, 0xCC8C, 0xCC8D, 0xCC8E,
+ 0xCC8F, 0xCC90, 0xCC91, 0xCC92, 0xCC93, 0xCC94, 0xCC95, 0xCC96,
+ 0xCC97, 0xCC9A, 0xCC9B, 0xCC9D, 0xCC9E, 0xCC9F, 0xCCA1, 0xCCA2,
+ 0xCCA3, 0xCCA4, 0xCCA5, 0xCCA6, 0xCCA7, 0xCCAA, 0xCCAE, 0xCCAF,
+ 0xCCB0, 0xCCB1, 0xCCB2, 0xCCB3, 0xCCB6, 0xCCB7, 0xCCB9, 0xCCBA,
+ 0xCCBB, 0xCCBD, 0xCCBE, 0xCCBF, 0xCCC0, 0xCCC1, 0xCCC2, 0xCCC3,
+ 0xCCC6, 0xCCC8, 0xCCCA, 0xCCCB, 0xCCCC, 0xCCCD, 0xCCCE, 0xCCCF,
+ 0xCCD1, 0xCCD2, 0xCCD3, 0xCCD5, 0xCCD6, 0xCCD7, 0xCCD8, 0xCCD9,
+ 0xCCDA, 0xCCDB, 0xCCDC, 0xCCDD, 0xCCDE, 0xCCDF, 0xCCE0, 0xCCE1,
+ 0xCCE2, 0xCCE3, 0xCCE5, 0xCCE6, 0xCCE7, 0xCCE8, 0xCCE9, 0xCCEA,
+ 0xCCEB, 0xCCED, 0xCCEE, 0xCCEF, 0xCCF1, 0xCCF2, 0xCCF3, 0xCCF4,
+ 0xCCF5, 0xCCF6, 0xCCF7, 0xCCF8, 0xCCF9, 0xCCFA, 0xCCFB, 0xCCFC,
+ 0xCCFD, 0xCCFE, 0xCCFF, 0xCD00, 0xCD02, 0xCD03, 0xCD04, 0xCD05,
+ 0xCD06, 0xCD07, 0xCD0A, 0xCD0B, 0xCD0D, 0xCD0E, 0xCD0F, 0xCD11,
+ 0xCD12, 0xCD13, 0xCD14, 0xCD15, 0xCD16, 0xCD17, 0xCD1A, 0xCD1C,
+ 0xCD1E, 0xCD1F, 0xCD20, 0xCD21, 0xCD22, 0xCD23, 0xCD25, 0xCD26,
+ 0xCD27, 0xCD29, 0xCD2A, 0xCD2B, 0xCD2D, 0xCD2E, 0xCD2F, 0xCD30,
+ 0xCD31, 0xCD32, 0xCD33, 0xCD34, 0xCD35, 0xCD36, 0xCD37, 0xCD38,
+ 0xCD3A, 0xCD3B, 0xCD3C, 0xCD3D, 0xCD3E, 0xCD3F, 0xCD40, 0xCD41,
+ 0xCD42, 0xCD43, 0xCD44, 0xCD45, 0xCD46, 0xCD47, 0xCD48, 0xCD49,
+ 0xCD4A, 0xCD4B, 0xCD4C, 0xCD4D, 0xCD4E, 0xCD4F, 0xCD50, 0xCD51,
+ 0xCD52, 0xCD53, 0xCD54, 0xCD55, 0xCD56, 0xCD57, 0xCD58, 0xCD59,
+ 0xCD5A, 0xCD5B, 0xCD5D, 0xCD5E, 0xCD5F, 0xCD61, 0xCD62, 0xCD63,
+ 0xCD65, 0xCD66, 0xCD67, 0xCD68, 0xCD69, 0xCD6A, 0xCD6B, 0xCD6E,
+ 0xCD70, 0xCD72, 0xCD73, 0xCD74, 0xCD75, 0xCD76, 0xCD77, 0xCD79,
+ 0xCD7A, 0xCD7B, 0xCD7C, 0xCD7D, 0xCD7E, 0xCD7F, 0xCD80, 0xCD81,
+ 0xCD82, 0xCD83, 0xCD84, 0xCD85, 0xCD86, 0xCD87, 0xCD89, 0xCD8A,
+ 0xCD8B, 0xCD8C, 0xCD8D, 0xCD8E, 0xCD8F, 0xCD90, 0xCD91, 0xCD92,
+ 0xCD93, 0xCD96, 0xCD97, 0xCD99, 0xCD9A, 0xCD9B, 0xCD9D, 0xCD9E,
+ 0xCD9F, 0xCDA0, 0xCDA1, 0xCDA2, 0xCDA3, 0xCDA6, 0xCDA8, 0xCDAA,
+ 0xCDAB, 0xCDAC, 0xCDAD, 0xCDAE, 0xCDAF, 0xCDB1, 0xCDB2, 0xCDB3,
+ 0xCDB4, 0xCDB5, 0xCDB6, 0xCDB7, 0xCDB8, 0xCDB9, 0xCDBA, 0xCDBB,
+ 0xCDBC, 0xCDBD, 0xCDBE, 0xCDBF, 0xCDC0, 0xCDC1, 0xCDC2, 0xCDC3,
+ 0xCDC5, 0xCDC6, 0xCDC7, 0xCDC8, 0xCDC9, 0xCDCA, 0xCDCB, 0xCDCD,
+ 0xCDCE, 0xCDCF, 0xCDD1, 0xCDD2, 0xCDD3, 0xCDD4, 0xCDD5, 0xCDD6,
+ 0xCDD7, 0xCDD8, 0xCDD9, 0xCDDA, 0xCDDB, 0xCDDC, 0xCDDD, 0xCDDE,
+ 0xCDDF, 0xCDE0, 0xCDE1, 0xCDE2, 0xCDE3, 0xCDE4, 0xCDE5, 0xCDE6,
+ 0xCDE7, 0xCDE9, 0xCDEA, 0xCDEB, 0xCDED, 0xCDEE, 0xCDEF, 0xCDF1,
+ 0xCDF2, 0xCDF3, 0xCDF4, 0xCDF5, 0xCDF6, 0xCDF7, 0xCDFA, 0xCDFC,
+ 0xCDFE, 0xCDFF, 0xCE00, 0xCE01, 0xCE02, 0xCE03, 0xCE05, 0xCE06,
+ 0xCE07, 0xCE09, 0xCE0A, 0xCE0B, 0xCE0D, 0xCE0E, 0xCE0F, 0xCE10,
+ 0xCE11, 0xCE12, 0xCE13, 0xCE15, 0xCE16, 0xCE17, 0xCE18, 0xCE1A,
+ 0xCE1B, 0xCE1C, 0xCE1D, 0xCE1E, 0xCE1F, 0xCE22, 0xCE23, 0xCE25,
+ 0xCE26, 0xCE27, 0xCE29, 0xCE2A, 0xCE2B, 0xCE2C, 0xCE2D, 0xCE2E,
+ 0xCE2F, 0xCE32, 0xCE34, 0xCE36, 0xCE37, 0xCE38, 0xCE39, 0xCE3A,
+ 0xCE3B, 0xCE3C, 0xCE3D, 0xCE3E, 0xCE3F, 0xCE40, 0xCE41, 0xCE42,
+ 0xCE43, 0xCE44, 0xCE45, 0xCE46, 0xCE47, 0xCE48, 0xCE49, 0xCE4A,
+ 0xCE4B, 0xCE4C, 0xCE4D, 0xCE4E, 0xCE4F, 0xCE50, 0xCE51, 0xCE52,
+ 0xCE53, 0xCE54, 0xCE55, 0xCE56, 0xCE57, 0xCE5A, 0xCE5B, 0xCE5D,
+ 0xCE5E, 0xCE62, 0xCE63, 0xCE64, 0xCE65, 0xCE66, 0xCE67, 0xCE6A,
+ 0xCE6C, 0xCE6E, 0xCE6F, 0xCE70, 0xCE71, 0xCE72, 0xCE73, 0xCE76,
+ 0xCE77, 0xCE79, 0xCE7A, 0xCE7B, 0xCE7D, 0xCE7E, 0xCE7F, 0xCE80,
+ 0xCE81, 0xCE82, 0xCE83, 0xCE86, 0xCE88, 0xCE8A, 0xCE8B, 0xCE8C,
+ 0xCE8D, 0xCE8E, 0xCE8F, 0xCE92, 0xCE93, 0xCE95, 0xCE96, 0xCE97,
+ 0xCE99, 0xCE9A, 0xCE9B, 0xCE9C, 0xCE9D, 0xCE9E, 0xCE9F, 0xCEA2,
+ 0xCEA6, 0xCEA7, 0xCEA8, 0xCEA9, 0xCEAA, 0xCEAB, 0xCEAE, 0xCEAF,
+ 0xCEB0, 0xCEB1, 0xCEB2, 0xCEB3, 0xCEB4, 0xCEB5, 0xCEB6, 0xCEB7,
+ 0xCEB8, 0xCEB9, 0xCEBA, 0xCEBB, 0xCEBC, 0xCEBD, 0xCEBE, 0xCEBF,
+ 0xCEC0, 0xCEC2, 0xCEC3, 0xCEC4, 0xCEC5, 0xCEC6, 0xCEC7, 0xCEC8,
+ 0xCEC9, 0xCECA, 0xCECB, 0xCECC, 0xCECD, 0xCECE, 0xCECF, 0xCED0,
+ 0xCED1, 0xCED2, 0xCED3, 0xCED4, 0xCED5, 0xCED6, 0xCED7, 0xCED8,
+ 0xCED9, 0xCEDA, 0xCEDB, 0xCEDC, 0xCEDD, 0xCEDE, 0xCEDF, 0xCEE0,
+ 0xCEE1, 0xCEE2, 0xCEE3, 0xCEE6, 0xCEE7, 0xCEE9, 0xCEEA, 0xCEED,
+ 0xCEEE, 0xCEEF, 0xCEF0, 0xCEF1, 0xCEF2, 0xCEF3, 0xCEF6, 0xCEFA,
+ 0xCEFB, 0xCEFC, 0xCEFD, 0xCEFE, 0xCEFF, 0xCF02, 0xCF03, 0xCF05,
+ 0xCF06, 0xCF07, 0xCF09, 0xCF0A, 0xCF0B, 0xCF0C, 0xCF0D, 0xCF0E,
+ 0xCF0F, 0xCF12, 0xCF14, 0xCF16, 0xCF17, 0xCF18, 0xCF19, 0xCF1A,
+ 0xCF1B, 0xCF1D, 0xCF1E, 0xCF1F, 0xCF21, 0xCF22, 0xCF23, 0xCF25,
+ 0xCF26, 0xCF27, 0xCF28, 0xCF29, 0xCF2A, 0xCF2B, 0xCF2E, 0xCF32,
+ 0xCF33, 0xCF34, 0xCF35, 0xCF36, 0xCF37, 0xCF39, 0xCF3A, 0xCF3B,
+ 0xCF3C, 0xCF3D, 0xCF3E, 0xCF3F, 0xCF40, 0xCF41, 0xCF42, 0xCF43,
+ 0xCF44, 0xCF45, 0xCF46, 0xCF47, 0xCF48, 0xCF49, 0xCF4A, 0xCF4B,
+ 0xCF4C, 0xCF4D, 0xCF4E, 0xCF4F, 0xCF50, 0xCF51, 0xCF52, 0xCF53,
+ 0xCF56, 0xCF57, 0xCF59, 0xCF5A, 0xCF5B, 0xCF5D, 0xCF5E, 0xCF5F,
+ 0xCF60, 0xCF61, 0xCF62, 0xCF63, 0xCF66, 0xCF68, 0xCF6A, 0xCF6B,
+ 0xCF6C, 0xCF6D, 0xCF6E, 0xCF6F, 0xCF72, 0xCF73, 0xCF75, 0xCF76,
+ 0xCF77, 0xCF79, 0xCF7A, 0xCF7B, 0xCF7C, 0xCF7D, 0xCF7E, 0xCF7F,
+ 0xCF81, 0xCF82, 0xCF83, 0xCF84, 0xCF86, 0xCF87, 0xCF88, 0xCF89,
+ 0xCF8A, 0xCF8B, 0xCF8D, 0xCF8E, 0xCF8F, 0xCF90, 0xCF91, 0xCF92,
+ 0xCF93, 0xCF94, 0xCF95, 0xCF96, 0xCF97, 0xCF98, 0xCF99, 0xCF9A,
+ 0xCF9B, 0xCF9C, 0xCF9D, 0xCF9E, 0xCF9F, 0xCFA0, 0xCFA2, 0xCFA3,
+ 0xCFA4, 0xCFA5, 0xCFA6, 0xCFA7, 0xCFA9, 0xCFAA, 0xCFAB, 0xCFAC,
+ 0xCFAD, 0xCFAE, 0xCFAF, 0xCFB1, 0xCFB2, 0xCFB3, 0xCFB4, 0xCFB5,
+ 0xCFB6, 0xCFB7, 0xCFB8, 0xCFB9, 0xCFBA, 0xCFBB, 0xCFBC, 0xCFBD,
+ 0xCFBE, 0xCFBF, 0xCFC0, 0xCFC1, 0xCFC2, 0xCFC3, 0xCFC5, 0xCFC6,
+ 0xCFC7, 0xCFC8, 0xCFC9, 0xCFCA, 0xCFCB, 0xCFCC, 0xCFCD, 0xCFCE,
+ 0xCFCF, 0xCFD0, 0xCFD1, 0xCFD2, 0xCFD3, 0xCFD4, 0xCFD5, 0xCFD6,
+ 0xCFD7, 0xCFD8, 0xCFD9, 0xCFDA, 0xCFDB, 0xCFDC, 0xCFDD, 0xCFDE,
+ 0xCFDF, 0xCFE2, 0xCFE3, 0xCFE5, 0xCFE6, 0xCFE7, 0xCFE9, 0xCFEA,
+ 0xCFEB, 0xCFEC, 0xCFED, 0xCFEE, 0xCFEF, 0xCFF2, 0xCFF4, 0xCFF6,
+ 0xCFF7, 0xCFF8, 0xCFF9, 0xCFFA, 0xCFFB, 0xCFFD, 0xCFFE, 0xCFFF,
+ 0xD001, 0xD002, 0xD003, 0xD005, 0xD006, 0xD007, 0xD008, 0xD009,
+ 0xD00A, 0xD00B, 0xD00C, 0xD00D, 0xD00E, 0xD00F, 0xD010, 0xD012,
+ 0xD013, 0xD014, 0xD015, 0xD016, 0xD017, 0xD019, 0xD01A, 0xD01B,
+ 0xD01C, 0xD01D, 0xD01E, 0xD01F, 0xD020, 0xD021, 0xD022, 0xD023,
+ 0xD024, 0xD025, 0xD026, 0xD027, 0xD028, 0xD029, 0xD02A, 0xD02B,
+ 0xD02C, 0xD02E, 0xD02F, 0xD030, 0xD031, 0xD032, 0xD033, 0xD036,
+ 0xD037, 0xD039, 0xD03A, 0xD03B, 0xD03D, 0xD03E, 0xD03F, 0xD040,
+ 0xD041, 0xD042, 0xD043, 0xD046, 0xD048, 0xD04A, 0xD04B, 0xD04C,
+ 0xD04D, 0xD04E, 0xD04F, 0xD051, 0xD052, 0xD053, 0xD055, 0xD056,
+ 0xD057, 0xD059, 0xD05A, 0xD05B, 0xD05C, 0xD05D, 0xD05E, 0xD05F,
+ 0xD061, 0xD062, 0xD063, 0xD064, 0xD065, 0xD066, 0xD067, 0xD068,
+ 0xD069, 0xD06A, 0xD06B, 0xD06E, 0xD06F, 0xD071, 0xD072, 0xD073,
+ 0xD075, 0xD076, 0xD077, 0xD078, 0xD079, 0xD07A, 0xD07B, 0xD07E,
+ 0xD07F, 0xD080, 0xD082, 0xD083, 0xD084, 0xD085, 0xD086, 0xD087,
+ 0xD088, 0xD089, 0xD08A, 0xD08B, 0xD08C, 0xD08D, 0xD08E, 0xD08F,
+ 0xD090, 0xD091, 0xD092, 0xD093, 0xD094, 0xD095, 0xD096, 0xD097,
+ 0xD098, 0xD099, 0xD09A, 0xD09B, 0xD09C, 0xD09D, 0xD09E, 0xD09F,
+ 0xD0A0, 0xD0A1, 0xD0A2, 0xD0A3, 0xD0A6, 0xD0A7, 0xD0A9, 0xD0AA,
+ 0xD0AB, 0xD0AD, 0xD0AE, 0xD0AF, 0xD0B0, 0xD0B1, 0xD0B2, 0xD0B3,
+ 0xD0B6, 0xD0B8, 0xD0BA, 0xD0BB, 0xD0BC, 0xD0BD, 0xD0BE, 0xD0BF,
+ 0xD0C2, 0xD0C3, 0xD0C5, 0xD0C6, 0xD0C7, 0xD0CA, 0xD0CB, 0xD0CC,
+ 0xD0CD, 0xD0CE, 0xD0CF, 0xD0D2, 0xD0D6, 0xD0D7, 0xD0D8, 0xD0D9,
+ 0xD0DA, 0xD0DB, 0xD0DE, 0xD0DF, 0xD0E1, 0xD0E2, 0xD0E3, 0xD0E5,
+ 0xD0E6, 0xD0E7, 0xD0E8, 0xD0E9, 0xD0EA, 0xD0EB, 0xD0EE, 0xD0F2,
+ 0xD0F3, 0xD0F4, 0xD0F5, 0xD0F6, 0xD0F7, 0xD0F9, 0xD0FA, 0xD0FB,
+ 0xD0FC, 0xD0FD, 0xD0FE, 0xD0FF, 0xD100, 0xD101, 0xD102, 0xD103,
+ 0xD104, 0xD105, 0xD106, 0xD107, 0xD108, 0xD109, 0xD10A, 0xD10B,
+ 0xD10C, 0xD10E, 0xD10F, 0xD110, 0xD111, 0xD112, 0xD113, 0xD114,
+ 0xD115, 0xD116, 0xD117, 0xD118, 0xD119, 0xD11A, 0xD11B, 0xD11C,
+ 0xD11D, 0xD11E, 0xD11F, 0xD120, 0xD121, 0xD122, 0xD123, 0xD124,
+ 0xD125, 0xD126, 0xD127, 0xD128, 0xD129, 0xD12A, 0xD12B, 0xD12C,
+ 0xD12D, 0xD12E, 0xD12F, 0xD132, 0xD133, 0xD135, 0xD136, 0xD137,
+ 0xD139, 0xD13B, 0xD13C, 0xD13D, 0xD13E, 0xD13F, 0xD142, 0xD146,
+ 0xD147, 0xD148, 0xD149, 0xD14A, 0xD14B, 0xD14E, 0xD14F, 0xD151,
+ 0xD152, 0xD153, 0xD155, 0xD156, 0xD157, 0xD158, 0xD159, 0xD15A,
+ 0xD15B, 0xD15E, 0xD160, 0xD162, 0xD163, 0xD164, 0xD165, 0xD166,
+ 0xD167, 0xD169, 0xD16A, 0xD16B, 0xD16D, 0xD16E, 0xD16F, 0xD170,
+ 0xD171, 0xD172, 0xD173, 0xD174, 0xD175, 0xD176, 0xD177, 0xD178,
+ 0xD179, 0xD17A, 0xD17B, 0xD17D, 0xD17E, 0xD17F, 0xD180, 0xD181,
+ 0xD182, 0xD183, 0xD185, 0xD186, 0xD187, 0xD189, 0xD18A, 0xD18B,
+ 0xD18C, 0xD18D, 0xD18E, 0xD18F, 0xD190, 0xD191, 0xD192, 0xD193,
+ 0xD194, 0xD195, 0xD196, 0xD197, 0xD198, 0xD199, 0xD19A, 0xD19B,
+ 0xD19C, 0xD19D, 0xD19E, 0xD19F, 0xD1A2, 0xD1A3, 0xD1A5, 0xD1A6,
+ 0xD1A7, 0xD1A9, 0xD1AA, 0xD1AB, 0xD1AC, 0xD1AD, 0xD1AE, 0xD1AF,
+ 0xD1B2, 0xD1B4, 0xD1B6, 0xD1B7, 0xD1B8, 0xD1B9, 0xD1BB, 0xD1BD,
+ 0xD1BE, 0xD1BF, 0xD1C1, 0xD1C2, 0xD1C3, 0xD1C4, 0xD1C5, 0xD1C6,
+ 0xD1C7, 0xD1C8, 0xD1C9, 0xD1CA, 0xD1CB, 0xD1CC, 0xD1CD, 0xD1CE,
+ 0xD1CF, 0xD1D0, 0xD1D1, 0xD1D2, 0xD1D3, 0xD1D4, 0xD1D5, 0xD1D6,
+ 0xD1D7, 0xD1D9, 0xD1DA, 0xD1DB, 0xD1DC, 0xD1DD, 0xD1DE, 0xD1DF,
+ 0xD1E0, 0xD1E1, 0xD1E2, 0xD1E3, 0xD1E4, 0xD1E5, 0xD1E6, 0xD1E7,
+ 0xD1E8, 0xD1E9, 0xD1EA, 0xD1EB, 0xD1EC, 0xD1ED, 0xD1EE, 0xD1EF,
+ 0xD1F0, 0xD1F1, 0xD1F2, 0xD1F3, 0xD1F5, 0xD1F6, 0xD1F7, 0xD1F9,
+ 0xD1FA, 0xD1FB, 0xD1FC, 0xD1FD, 0xD1FE, 0xD1FF, 0xD200, 0xD201,
+ 0xD202, 0xD203, 0xD204, 0xD205, 0xD206, 0xD208, 0xD20A, 0xD20B,
+ 0xD20C, 0xD20D, 0xD20E, 0xD20F, 0xD211, 0xD212, 0xD213, 0xD214,
+ 0xD215, 0xD216, 0xD217, 0xD218, 0xD219, 0xD21A, 0xD21B, 0xD21C,
+ 0xD21D, 0xD21E, 0xD21F, 0xD220, 0xD221, 0xD222, 0xD223, 0xD224,
+ 0xD225, 0xD226, 0xD227, 0xD228, 0xD229, 0xD22A, 0xD22B, 0xD22E,
+ 0xD22F, 0xD231, 0xD232, 0xD233, 0xD235, 0xD236, 0xD237, 0xD238,
+ 0xD239, 0xD23A, 0xD23B, 0xD23E, 0xD240, 0xD242, 0xD243, 0xD244,
+ 0xD245, 0xD246, 0xD247, 0xD249, 0xD24A, 0xD24B, 0xD24C, 0xD24D,
+ 0xD24E, 0xD24F, 0xD250, 0xD251, 0xD252, 0xD253, 0xD254, 0xD255,
+ 0xD256, 0xD257, 0xD258, 0xD259, 0xD25A, 0xD25B, 0xD25D, 0xD25E,
+ 0xD25F, 0xD260, 0xD261, 0xD262, 0xD263, 0xD265, 0xD266, 0xD267,
+ 0xD268, 0xD269, 0xD26A, 0xD26B, 0xD26C, 0xD26D, 0xD26E, 0xD26F,
+ 0xD270, 0xD271, 0xD272, 0xD273, 0xD274, 0xD275, 0xD276, 0xD277,
+ 0xD278, 0xD279, 0xD27A, 0xD27B, 0xD27C, 0xD27D, 0xD27E, 0xD27F,
+ 0xD282, 0xD283, 0xD285, 0xD286, 0xD287, 0xD289, 0xD28A, 0xD28B,
+ 0xD28C, 0xD28D, 0xD28E, 0xD28F, 0xD292, 0xD293, 0xD294, 0xD296,
+ 0xD297, 0xD298, 0xD299, 0xD29A, 0xD29B, 0xD29D, 0xD29E, 0xD29F,
+ 0xD2A1, 0xD2A2, 0xD2A3, 0xD2A5, 0xD2A6, 0xD2A7, 0xD2A8, 0xD2A9,
+ 0xD2AA, 0xD2AB, 0xD2AD, 0xD2AE, 0xD2AF, 0xD2B0, 0xD2B2, 0xD2B3,
+ 0xD2B4, 0xD2B5, 0xD2B6, 0xD2B7, 0xD2BA, 0xD2BB, 0xD2BD, 0xD2BE,
+ 0xD2C1, 0xD2C3, 0xD2C4, 0xD2C5, 0xD2C6, 0xD2C7, 0xD2CA, 0xD2CC,
+ 0xD2CD, 0xD2CE, 0xD2CF, 0xD2D0, 0xD2D1, 0xD2D2, 0xD2D3, 0xD2D5,
+ 0xD2D6, 0xD2D7, 0xD2D9, 0xD2DA, 0xD2DB, 0xD2DD, 0xD2DE, 0xD2DF,
+ 0xD2E0, 0xD2E1, 0xD2E2, 0xD2E3, 0xD2E6, 0xD2E7, 0xD2E8, 0xD2E9,
+ 0xD2EA, 0xD2EB, 0xD2EC, 0xD2ED, 0xD2EE, 0xD2EF, 0xD2F2, 0xD2F3,
+ 0xD2F5, 0xD2F6, 0xD2F7, 0xD2F9, 0xD2FA, 0xD2FB, 0xD2FC, 0xD2FD,
+ 0xD2FE, 0xD2FF, 0xD302, 0xD304, 0xD306, 0xD307, 0xD308, 0xD309,
+ 0xD30A, 0xD30B, 0xD30F, 0xD311, 0xD312, 0xD313, 0xD315, 0xD317,
+ 0xD318, 0xD319, 0xD31A, 0xD31B, 0xD31E, 0xD322, 0xD323, 0xD324,
+ 0xD326, 0xD327, 0xD32A, 0xD32B, 0xD32D, 0xD32E, 0xD32F, 0xD331,
+ 0xD332, 0xD333, 0xD334, 0xD335, 0xD336, 0xD337, 0xD33A, 0xD33E,
+ 0xD33F, 0xD340, 0xD341, 0xD342, 0xD343, 0xD346, 0xD347, 0xD348,
+ 0xD349, 0xD34A, 0xD34B, 0xD34C, 0xD34D, 0xD34E, 0xD34F, 0xD350,
+ 0xD351, 0xD352, 0xD353, 0xD354, 0xD355, 0xD356, 0xD357, 0xD358,
+ 0xD359, 0xD35A, 0xD35B, 0xD35C, 0xD35D, 0xD35E, 0xD35F, 0xD360,
+ 0xD361, 0xD362, 0xD363, 0xD364, 0xD365, 0xD366, 0xD367, 0xD368,
+ 0xD369, 0xD36A, 0xD36B, 0xD36C, 0xD36D, 0xD36E, 0xD36F, 0xD370,
+ 0xD371, 0xD372, 0xD373, 0xD374, 0xD375, 0xD376, 0xD377, 0xD378,
+ 0xD379, 0xD37A, 0xD37B, 0xD37E, 0xD37F, 0xD381, 0xD382, 0xD383,
+ 0xD385, 0xD386, 0xD387, 0xD388, 0xD389, 0xD38A, 0xD38B, 0xD38E,
+ 0xD392, 0xD393, 0xD394, 0xD395, 0xD396, 0xD397, 0xD39A, 0xD39B,
+ 0xD39D, 0xD39E, 0xD39F, 0xD3A1, 0xD3A2, 0xD3A3, 0xD3A4, 0xD3A5,
+ 0xD3A6, 0xD3A7, 0xD3AA, 0xD3AC, 0xD3AE, 0xD3AF, 0xD3B0, 0xD3B1,
+ 0xD3B2, 0xD3B3, 0xD3B5, 0xD3B6, 0xD3B7, 0xD3B9, 0xD3BA, 0xD3BB,
+ 0xD3BD, 0xD3BE, 0xD3BF, 0xD3C0, 0xD3C1, 0xD3C2, 0xD3C3, 0xD3C6,
+ 0xD3C7, 0xD3CA, 0xD3CB, 0xD3CC, 0xD3CD, 0xD3CE, 0xD3CF, 0xD3D1,
+ 0xD3D2, 0xD3D3, 0xD3D4, 0xD3D5, 0xD3D6, 0xD3D7, 0xD3D9, 0xD3DA,
+ 0xD3DB, 0xD3DC, 0xD3DD, 0xD3DE, 0xD3DF, 0xD3E0, 0xD3E2, 0xD3E4,
+ 0xD3E5, 0xD3E6, 0xD3E7, 0xD3E8, 0xD3E9, 0xD3EA, 0xD3EB, 0xD3EE,
+ 0xD3EF, 0xD3F1, 0xD3F2, 0xD3F3, 0xD3F5, 0xD3F6, 0xD3F7, 0xD3F8,
+ 0xD3F9, 0xD3FA, 0xD3FB, 0xD3FE, 0xD400, 0xD402, 0xD403, 0xD404,
+ 0xD405, 0xD406, 0xD407, 0xD409, 0xD40A, 0xD40B, 0xD40C, 0xD40D,
+ 0xD40E, 0xD40F, 0xD410, 0xD411, 0xD412, 0xD413, 0xD414, 0xD415,
+ 0xD416, 0xD417, 0xD418, 0xD419, 0xD41A, 0xD41B, 0xD41C, 0xD41E,
+ 0xD41F, 0xD420, 0xD421, 0xD422, 0xD423, 0xD424, 0xD425, 0xD426,
+ 0xD427, 0xD428, 0xD429, 0xD42A, 0xD42B, 0xD42C, 0xD42D, 0xD42E,
+ 0xD42F, 0xD430, 0xD431, 0xD432, 0xD433, 0xD434, 0xD435, 0xD436,
+ 0xD437, 0xD438, 0xD439, 0xD43A, 0xD43B, 0xD43C, 0xD43D, 0xD43E,
+ 0xD43F, 0xD441, 0xD442, 0xD443, 0xD445, 0xD446, 0xD447, 0xD448,
+ 0xD449, 0xD44A, 0xD44B, 0xD44C, 0xD44D, 0xD44E, 0xD44F, 0xD450,
+ 0xD451, 0xD452, 0xD453, 0xD454, 0xD455, 0xD456, 0xD457, 0xD458,
+ 0xD459, 0xD45A, 0xD45B, 0xD45D, 0xD45E, 0xD45F, 0xD461, 0xD462,
+ 0xD463, 0xD465, 0xD466, 0xD467, 0xD468, 0xD469, 0xD46A, 0xD46B,
+ 0xD46C, 0xD46E, 0xD470, 0xD471, 0xD472, 0xD473, 0xD474, 0xD475,
+ 0xD476, 0xD477, 0xD47A, 0xD47B, 0xD47D, 0xD47E, 0xD481, 0xD483,
+ 0xD484, 0xD485, 0xD486, 0xD487, 0xD48A, 0xD48C, 0xD48E, 0xD48F,
+ 0xD490, 0xD491, 0xD492, 0xD493, 0xD495, 0xD496, 0xD497, 0xD498,
+ 0xD499, 0xD49A, 0xD49B, 0xD49C, 0xD49D, 0xD49E, 0xD49F, 0xD4A0,
+ 0xD4A1, 0xD4A2, 0xD4A3, 0xD4A4, 0xD4A5, 0xD4A6, 0xD4A7, 0xD4A8,
+ 0xD4AA, 0xD4AB, 0xD4AC, 0xD4AD, 0xD4AE, 0xD4AF, 0xD4B0, 0xD4B1,
+ 0xD4B2, 0xD4B3, 0xD4B4, 0xD4B5, 0xD4B6, 0xD4B7, 0xD4B8, 0xD4B9,
+ 0xD4BA, 0xD4BB, 0xD4BC, 0xD4BD, 0xD4BE, 0xD4BF, 0xD4C0, 0xD4C1,
+ 0xD4C2, 0xD4C3, 0xD4C4, 0xD4C5, 0xD4C6, 0xD4C7, 0xD4C8, 0xD4C9,
+ 0xD4CA, 0xD4CB, 0xD4CD, 0xD4CE, 0xD4CF, 0xD4D1, 0xD4D2, 0xD4D3,
+ 0xD4D5, 0xD4D6, 0xD4D7, 0xD4D8, 0xD4D9, 0xD4DA, 0xD4DB, 0xD4DD,
+ 0xD4DE, 0xD4E0, 0xD4E1, 0xD4E2, 0xD4E3, 0xD4E4, 0xD4E5, 0xD4E6,
+ 0xD4E7, 0xD4E9, 0xD4EA, 0xD4EB, 0xD4ED, 0xD4EE, 0xD4EF, 0xD4F1,
+ 0xD4F2, 0xD4F3, 0xD4F4, 0xD4F5, 0xD4F6, 0xD4F7, 0xD4F9, 0xD4FA,
+ 0xD4FC, 0xD4FE, 0xD4FF, 0xD500, 0xD501, 0xD502, 0xD503, 0xD505,
+ 0xD506, 0xD507, 0xD509, 0xD50A, 0xD50B, 0xD50D, 0xD50E, 0xD50F,
+ 0xD510, 0xD511, 0xD512, 0xD513, 0xD516, 0xD518, 0xD519, 0xD51A,
+ 0xD51B, 0xD51C, 0xD51D, 0xD51E, 0xD51F, 0xD520, 0xD521, 0xD522,
+ 0xD523, 0xD524, 0xD525, 0xD526, 0xD527, 0xD528, 0xD529, 0xD52A,
+ 0xD52B, 0xD52C, 0xD52D, 0xD52E, 0xD52F, 0xD530, 0xD531, 0xD532,
+ 0xD533, 0xD534, 0xD535, 0xD536, 0xD537, 0xD538, 0xD539, 0xD53A,
+ 0xD53B, 0xD53E, 0xD53F, 0xD541, 0xD542, 0xD543, 0xD545, 0xD546,
+ 0xD547, 0xD548, 0xD549, 0xD54A, 0xD54B, 0xD54E, 0xD550, 0xD552,
+ 0xD553, 0xD554, 0xD555, 0xD556, 0xD557, 0xD55A, 0xD55B, 0xD55D,
+ 0xD55E, 0xD55F, 0xD561, 0xD562, 0xD563, 0xD564, 0xD566, 0xD567,
+ 0xD56A, 0xD56C, 0xD56E, 0xD56F, 0xD570, 0xD571, 0xD572, 0xD573,
+ 0xD576, 0xD577, 0xD579, 0xD57A, 0xD57B, 0xD57D, 0xD57E, 0xD57F,
+ 0xD580, 0xD581, 0xD582, 0xD583, 0xD586, 0xD58A, 0xD58B, 0xD58C,
+ 0xD58D, 0xD58E, 0xD58F, 0xD591, 0xD592, 0xD593, 0xD594, 0xD595,
+ 0xD596, 0xD597, 0xD598, 0xD599, 0xD59A, 0xD59B, 0xD59C, 0xD59D,
+ 0xD59E, 0xD59F, 0xD5A0, 0xD5A1, 0xD5A2, 0xD5A3, 0xD5A4, 0xD5A6,
+ 0xD5A7, 0xD5A8, 0xD5A9, 0xD5AA, 0xD5AB, 0xD5AC, 0xD5AD, 0xD5AE,
+ 0xD5AF, 0xD5B0, 0xD5B1, 0xD5B2, 0xD5B3, 0xD5B4, 0xD5B5, 0xD5B6,
+ 0xD5B7, 0xD5B8, 0xD5B9, 0xD5BA, 0xD5BB, 0xD5BC, 0xD5BD, 0xD5BE,
+ 0xD5BF, 0xD5C0, 0xD5C1, 0xD5C2, 0xD5C3, 0xD5C4, 0xD5C5, 0xD5C6,
+ 0xD5C7, 0xD5CA, 0xD5CB, 0xD5CD, 0xD5CE, 0xD5CF, 0xD5D1, 0xD5D3,
+ 0xD5D4, 0xD5D5, 0xD5D6, 0xD5D7, 0xD5DA, 0xD5DC, 0xD5DE, 0xD5DF,
+ 0xD5E0, 0xD5E1, 0xD5E2, 0xD5E3, 0xD5E6, 0xD5E7, 0xD5E9, 0xD5EA,
+ 0xD5EB, 0xD5ED, 0xD5EE, 0xD5EF, 0xD5F0, 0xD5F1, 0xD5F2, 0xD5F3,
+ 0xD5F6, 0xD5F8, 0xD5FA, 0xD5FB, 0xD5FC, 0xD5FD, 0xD5FE, 0xD5FF,
+ 0xD602, 0xD603, 0xD605, 0xD606, 0xD607, 0xD609, 0xD60A, 0xD60B,
+ 0xD60C, 0xD60D, 0xD60E, 0xD60F, 0xD612, 0xD616, 0xD617, 0xD618,
+ 0xD619, 0xD61A, 0xD61B, 0xD61D, 0xD61E, 0xD61F, 0xD621, 0xD622,
+ 0xD623, 0xD625, 0xD626, 0xD627, 0xD628, 0xD629, 0xD62A, 0xD62B,
+ 0xD62C, 0xD62E, 0xD62F, 0xD630, 0xD631, 0xD632, 0xD633, 0xD634,
+ 0xD635, 0xD636, 0xD637, 0xD63A, 0xD63B, 0xD63D, 0xD63E, 0xD63F,
+ 0xD641, 0xD642, 0xD643, 0xD644, 0xD646, 0xD647, 0xD64A, 0xD64C,
+ 0xD64E, 0xD64F, 0xD650, 0xD652, 0xD653, 0xD656, 0xD657, 0xD659,
+ 0xD65A, 0xD65B, 0xD65D, 0xD65E, 0xD65F, 0xD660, 0xD661, 0xD662,
+ 0xD663, 0xD664, 0xD665, 0xD666, 0xD668, 0xD66A, 0xD66B, 0xD66C,
+ 0xD66D, 0xD66E, 0xD66F, 0xD672, 0xD673, 0xD675, 0xD676, 0xD677,
+ 0xD678, 0xD679, 0xD67A, 0xD67B, 0xD67C, 0xD67D, 0xD67E, 0xD67F,
+ 0xD680, 0xD681, 0xD682, 0xD684, 0xD686, 0xD687, 0xD688, 0xD689,
+ 0xD68A, 0xD68B, 0xD68E, 0xD68F, 0xD691, 0xD692, 0xD693, 0xD695,
+ 0xD696, 0xD697, 0xD698, 0xD699, 0xD69A, 0xD69B, 0xD69C, 0xD69E,
+ 0xD6A0, 0xD6A2, 0xD6A3, 0xD6A4, 0xD6A5, 0xD6A6, 0xD6A7, 0xD6A9,
+ 0xD6AA, 0xD6AB, 0xD6AD, 0xD6AE, 0xD6AF, 0xD6B1, 0xD6B2, 0xD6B3,
+ 0xD6B4, 0xD6B5, 0xD6B6, 0xD6B7, 0xD6B8, 0xD6BA, 0xD6BC, 0xD6BD,
+ 0xD6BE, 0xD6BF, 0xD6C0, 0xD6C1, 0xD6C2, 0xD6C3, 0xD6C6, 0xD6C7,
+ 0xD6C9, 0xD6CA, 0xD6CB, 0xD6CD, 0xD6CE, 0xD6CF, 0xD6D0, 0xD6D2,
+ 0xD6D3, 0xD6D5, 0xD6D6, 0xD6D8, 0xD6DA, 0xD6DB, 0xD6DC, 0xD6DD,
+ 0xD6DE, 0xD6DF, 0xD6E1, 0xD6E2, 0xD6E3, 0xD6E5, 0xD6E6, 0xD6E7,
+ 0xD6E9, 0xD6EA, 0xD6EB, 0xD6EC, 0xD6ED, 0xD6EE, 0xD6EF, 0xD6F1,
+ 0xD6F2, 0xD6F3, 0xD6F4, 0xD6F6, 0xD6F7, 0xD6F8, 0xD6F9, 0xD6FA,
+ 0xD6FB, 0xD6FE, 0xD6FF, 0xD701, 0xD702, 0xD703, 0xD705, 0xD706,
+ 0xD707, 0xD708, 0xD709, 0xD70A, 0xD70B, 0xD70C, 0xD70D, 0xD70E,
+ 0xD70F, 0xD710, 0xD712, 0xD713, 0xD714, 0xD715, 0xD716, 0xD717,
+ 0xD71A, 0xD71B, 0xD71D, 0xD71E, 0xD71F, 0xD721, 0xD722, 0xD723,
+ 0xD724, 0xD725, 0xD726, 0xD727, 0xD72A, 0xD72C, 0xD72E, 0xD72F,
+ 0xD730, 0xD731, 0xD732, 0xD733, 0xD736, 0xD737, 0xD739, 0xD73A,
+ 0xD73B, 0xD73D, 0xD73E, 0xD73F, 0xD740, 0xD741, 0xD742, 0xD743,
+ 0xD745, 0xD746, 0xD748, 0xD74A, 0xD74B, 0xD74C, 0xD74D, 0xD74E,
+ 0xD74F, 0xD752, 0xD753, 0xD755, 0xD75A, 0xD75B, 0xD75C, 0xD75D,
+ 0xD75E, 0xD75F, 0xD762, 0xD764, 0xD766, 0xD767, 0xD768, 0xD76A,
+ 0xD76B, 0xD76D, 0xD76E, 0xD76F, 0xD771, 0xD772, 0xD773, 0xD775,
+ 0xD776, 0xD777, 0xD778, 0xD779, 0xD77A, 0xD77B, 0xD77E, 0xD77F,
+ 0xD780, 0xD782, 0xD783, 0xD784, 0xD785, 0xD786, 0xD787, 0xD78A,
+ 0xD78B, 0xD78D, 0xD78E, 0xD78F, 0xD791, 0xD792, 0xD793, 0xD794,
+ 0xD795, 0xD796, 0xD797, 0xD79A, 0xD79C, 0xD79E, 0xD79F, 0xD7A0,
+ 0xD7A1, 0xD7A2, 0xD7A3, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024,
+ 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C,
+ 0x002D, 0x002E, 0x002F, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034,
+ 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C,
+ 0x003D, 0x003E, 0x003F, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044,
+ 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C,
+ 0x004D, 0x004E, 0x004F, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054,
+ 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C,
+ 0x005D, 0x005E, 0x005F, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064,
+ 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C,
+ 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074,
+ 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C,
+ 0x007D, 0x007E, 0x20A9, 0x2010, 0x00A9, 0x2122, 0x22EF, 0x0020,
+ 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028,
+ 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 0x0030,
+ 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038,
+ 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 0x0040,
+ 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048,
+ 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050,
+ 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058,
+ 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, 0x0060,
+ 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068,
+ 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070,
+ 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078,
+ 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x203E, 0x007E, 0x005C,
+};
diff --git a/core/src/fpdfapi/fpdf_cmaps/Korea1/KSC-EUC-H_0.cpp b/core/src/fpdfapi/fpdf_cmaps/Korea1/KSC-EUC-H_0.cpp
index cd261239ee..80ec35fb35 100644
--- a/core/src/fpdfapi/fpdf_cmaps/Korea1/KSC-EUC-H_0.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/Korea1/KSC-EUC-H_0.cpp
@@ -1,164 +1,164 @@
-// 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
-
-extern const unsigned short g_FXCMAP_KSC_EUC_H_0[467 * 3] = {
- 0x0020, 0x007E, 0x1F9E, 0xA1A1, 0xA1FE, 0x0065, 0xA2A1, 0xA2E5, 0x00C3,
- 0xA3A1, 0xA3FE, 0x0108, 0xA4A1, 0xA4D3, 0x0166, 0xA4D5, 0xA4FE, 0x0199,
- 0xA5A1, 0xA5AA, 0x01C3, 0xA5B0, 0xA5B9, 0x01CD, 0xA5C1, 0xA5D8, 0x01D7,
- 0xA5E1, 0xA5F8, 0x01EF, 0xA6A1, 0xA6E4, 0x0207, 0xA7A1, 0xA7EF, 0x024B,
- 0xA8A1, 0xA8A4, 0x029A, 0xA8A6, 0xA8A6, 0x029E, 0xA8A8, 0xA8AF, 0x029F,
- 0xA8B1, 0xA8FE, 0x02A7, 0xA9A1, 0xA9FE, 0x02F5, 0xAAA1, 0xAAF3, 0x0353,
- 0xABA1, 0xABF6, 0x03A6, 0xACA1, 0xACC1, 0x03FC, 0xACD1, 0xACF1, 0x041D,
- 0xB0A1, 0xB0FE, 0x043E, 0xB1A1, 0xB1FE, 0x049C, 0xB2A1, 0xB2FE, 0x04FA,
- 0xB3A1, 0xB3FE, 0x0558, 0xB4A1, 0xB4FE, 0x05B6, 0xB5A1, 0xB5FE, 0x0614,
- 0xB6A1, 0xB6FE, 0x0672, 0xB7A1, 0xB7FE, 0x06D0, 0xB8A1, 0xB8FE, 0x072E,
- 0xB9A1, 0xB9FE, 0x078C, 0xBAA1, 0xBAFE, 0x07EA, 0xBBA1, 0xBBFE, 0x0848,
- 0xBCA1, 0xBCFE, 0x08A6, 0xBDA1, 0xBDFE, 0x0904, 0xBEA1, 0xBEFE, 0x0962,
- 0xBFA1, 0xBFFE, 0x09C0, 0xC0A1, 0xC0FE, 0x0A1E, 0xC1A1, 0xC1FE, 0x0A7C,
- 0xC2A1, 0xC2FE, 0x0ADA, 0xC3A1, 0xC3FE, 0x0B38, 0xC4A1, 0xC4FE, 0x0B96,
- 0xC5A1, 0xC5FE, 0x0BF4, 0xC6A1, 0xC6FE, 0x0C52, 0xC7A1, 0xC7FE, 0x0CB0,
- 0xC8A1, 0xC8FE, 0x0D0E, 0xCAA1, 0xCAFE, 0x0D6C, 0xCBA1, 0xCBCF, 0x0DCA,
- 0xCBD0, 0xCBD0, 0x1014, 0xCBD1, 0xCBD5, 0x0DF9, 0xCBD6, 0xCBD6, 0x0E5E,
- 0xCBD7, 0xCBE6, 0x0DFE, 0xCBE7, 0xCBE7, 0x1B8D, 0xCBE8, 0xCBFE, 0x0E0E,
- 0xCCA1, 0xCCFE, 0x0E25, 0xCDA1, 0xCDCE, 0x0E83, 0xCDCF, 0xCDCF, 0x0D84,
- 0xCDD0, 0xCDE7, 0x0EB1, 0xCDE8, 0xCDE8, 0x1EDC, 0xCDE9, 0xCDFE, 0x0EC9,
- 0xCEA1, 0xCEAC, 0x0EDF, 0xCEAD, 0xCEAD, 0x0EDA, 0xCEAE, 0xCEFE, 0x0EEB,
- 0xCFA1, 0xCFFA, 0x0F3C, 0xCFFB, 0xCFFB, 0x0F3E, 0xCFFC, 0xCFFE, 0x0F96,
- 0xD0A1, 0xD0A1, 0x0F99, 0xD0A2, 0xD0A2, 0x0F6A, 0xD0A3, 0xD0B7, 0x0F9A,
- 0xD0B8, 0xD0B8, 0x0F6A, 0xD0B9, 0xD0CF, 0x0FAF, 0xD0D0, 0xD0D0, 0x0E7C,
- 0xD0D1, 0xD0DC, 0x0FC6, 0xD0DD, 0xD0DD, 0x1023, 0xD0DE, 0xD0FE, 0x0FD2,
- 0xD1A1, 0xD1D3, 0x0FF3, 0xD1D4, 0xD1D4, 0x1116, 0xD1D5, 0xD1D5, 0x103C,
- 0xD1D6, 0xD1D7, 0x1026, 0xD1D8, 0xD1D8, 0x1117, 0xD1D9, 0xD1DA, 0x1028,
- 0xD1DB, 0xD1E0, 0x1118, 0xD1E1, 0xD1E1, 0x102A, 0xD1E2, 0xD1E2, 0x16A8,
- 0xD1E3, 0xD1E5, 0x111E, 0xD1E6, 0xD1E6, 0x1122, 0xD1E7, 0xD1E7, 0x102B,
- 0xD1E8, 0xD1EB, 0x1123, 0xD1EC, 0xD1EC, 0x102C, 0xD1ED, 0xD1ED, 0x1127,
- 0xD1EE, 0xD1EE, 0x102D, 0xD1EF, 0xD1F0, 0x112A, 0xD1F1, 0xD1F1, 0x102E,
- 0xD1F2, 0xD1F2, 0x112C, 0xD1F3, 0xD1F5, 0x102F, 0xD1F6, 0xD1F6, 0x112F,
- 0xD1F7, 0xD1F9, 0x1032, 0xD1FA, 0xD1FA, 0x1133, 0xD1FB, 0xD1FB, 0x1035,
- 0xD1FC, 0xD1FD, 0x1136, 0xD1FE, 0xD1FE, 0x1139, 0xD2A1, 0xD2A1, 0x1036,
- 0xD2A2, 0xD2A3, 0x113A, 0xD2A4, 0xD2A6, 0x1037, 0xD2A7, 0xD2AA, 0x113C,
- 0xD2AB, 0xD2AB, 0x1143, 0xD2AC, 0xD2AC, 0x103A, 0xD2AD, 0xD2AD, 0x1144,
- 0xD2AE, 0xD2B1, 0x103B, 0xD2B2, 0xD2B2, 0x1148, 0xD2B3, 0xD2BD, 0x103F,
- 0xD2BE, 0xD2BE, 0x119F, 0xD2BF, 0xD2C1, 0x104A, 0xD2C2, 0xD2C3, 0x11A1,
- 0xD2C4, 0xD2C4, 0x11A5, 0xD2C5, 0xD2C5, 0x104D, 0xD2C6, 0xD2CA, 0x11A6,
- 0xD2CB, 0xD2CB, 0x11AC, 0xD2CC, 0xD2CC, 0x104E, 0xD2CD, 0xD2CE, 0x11AD,
- 0xD2CF, 0xD2D4, 0x11B0, 0xD2D5, 0xD2D7, 0x11B7, 0xD2D8, 0xD2D8, 0x104F,
- 0xD2D9, 0xD2DA, 0x11BD, 0xD2DB, 0xD2DD, 0x1050, 0xD2DE, 0xD2DF, 0x11C1,
- 0xD2E0, 0xD2E0, 0x1053, 0xD2E1, 0xD2E1, 0x11C3, 0xD2E2, 0xD2E2, 0x11C6,
- 0xD2E3, 0xD2E3, 0x1054, 0xD2E4, 0xD2E4, 0x11D4, 0xD2E5, 0xD2E8, 0x11D6,
- 0xD2E9, 0xD2EA, 0x11DB, 0xD2EB, 0xD2EB, 0x11E0, 0xD2EC, 0xD2EF, 0x1055,
- 0xD2F0, 0xD2F3, 0x11FC, 0xD2F4, 0xD2F5, 0x1201, 0xD2F6, 0xD2F6, 0x1059,
- 0xD2F7, 0xD2F8, 0x1203, 0xD2F9, 0xD2FE, 0x105A, 0xD3A1, 0xD3FE, 0x1060,
- 0xD4A1, 0xD4E5, 0x10BE, 0xD4E6, 0xD4E6, 0x10DE, 0xD4E7, 0xD4FB, 0x1103,
- 0xD4FC, 0xD4FC, 0x1028, 0xD4FD, 0xD4FE, 0x1118, 0xD5A1, 0xD5A4, 0x111A,
- 0xD5A5, 0xD5A5, 0x16A8, 0xD5A6, 0xD5AA, 0x111E, 0xD5AB, 0xD5AB, 0x102B,
- 0xD5AC, 0xD5AD, 0x1123, 0xD5AE, 0xD5AE, 0x1060, 0xD5AF, 0xD5FE, 0x1125,
- 0xD6A1, 0xD6B7, 0x1175, 0xD6B8, 0xD6B8, 0x1047, 0xD6B9, 0xD6CC, 0x118C,
- 0xD6CD, 0xD6CD, 0x104C, 0xD6CE, 0xD6FE, 0x11A0, 0xD7A1, 0xD7CA, 0x11D1,
- 0xD7CB, 0xD7CB, 0x15B0, 0xD7CC, 0xD7E3, 0x11FB, 0xD7E4, 0xD7E4, 0x1918,
- 0xD7E5, 0xD7FE, 0x1213, 0xD8A1, 0xD8FE, 0x122D, 0xD9A1, 0xD9FE, 0x128B,
- 0xDAA1, 0xDAFE, 0x12E9, 0xDBA1, 0xDBC4, 0x1347, 0xDBC5, 0xDBC5, 0x141F,
- 0xDBC6, 0xDBE3, 0x136B, 0xDBE4, 0xDBE4, 0x133A, 0xDBE5, 0xDBFE, 0x1389,
- 0xDCA1, 0xDCA4, 0x13A3, 0xDCA5, 0xDCA5, 0x1D5E, 0xDCA6, 0xDCFE, 0x13A7,
- 0xDDA1, 0xDDA4, 0x1400, 0xDDA5, 0xDDA5, 0x13D7, 0xDDA6, 0xDDD4, 0x1404,
- 0xDDD5, 0xDDD5, 0x13F5, 0xDDD6, 0xDDF3, 0x1433, 0xDDF4, 0xDDF4, 0x1DB7,
- 0xDDF5, 0xDDFE, 0x1451, 0xDEA1, 0xDEFB, 0x145B, 0xDEFC, 0xDEFC, 0x15D0,
- 0xDEFD, 0xDEFD, 0x14B6, 0xDEFE, 0xDEFE, 0x14F7, 0xDFA1, 0xDFB2, 0x14B7,
- 0xDFB3, 0xDFB3, 0x1BAB, 0xDFB4, 0xDFE0, 0x14C9, 0xDFE1, 0xDFE1, 0x14F2,
- 0xDFE2, 0xDFE7, 0x14F6, 0xDFE8, 0xDFE8, 0x156D, 0xDFE9, 0xDFFE, 0x14FC,
- 0xE0A1, 0xE0F0, 0x1512, 0xE0F1, 0xE0F1, 0x1771, 0xE0F2, 0xE0FE, 0x1562,
- 0xE1A1, 0xE1AC, 0x156F, 0xE1AD, 0xE1AD, 0x1554, 0xE1AE, 0xE1EC, 0x157B,
- 0xE1ED, 0xE1ED, 0x14C5, 0xE1EE, 0xE1FE, 0x15BA, 0xE2A1, 0xE2FE, 0x15CB,
- 0xE3A1, 0xE3F4, 0x1629, 0xE3F5, 0xE3F5, 0x1B61, 0xE3F6, 0xE3FE, 0x167D,
- 0xE4A1, 0xE4A1, 0x1CCA, 0xE4A2, 0xE4A8, 0x1686, 0xE4A9, 0xE4A9, 0x162E,
- 0xE4AA, 0xE4FE, 0x168D, 0xE5A1, 0xE5AD, 0x16E2, 0xE5AE, 0xE5AE, 0x16F2,
- 0xE5AF, 0xE5B0, 0x16EF, 0xE5B1, 0xE5B2, 0x1149, 0xE5B3, 0xE5B8, 0x16F1,
- 0xE5B9, 0xE5B9, 0x114B, 0xE5BA, 0xE5BA, 0x16F7, 0xE5BB, 0xE5BC, 0x114D,
- 0xE5BD, 0xE5C3, 0x16F8, 0xE5C4, 0xE5C4, 0x114F, 0xE5C5, 0xE5CD, 0x16FF,
- 0xE5CE, 0xE5CE, 0x1153, 0xE5CF, 0xE5CF, 0x1708, 0xE5D0, 0xE5D0, 0x1154,
- 0xE5D1, 0xE5D1, 0x1709, 0xE5D2, 0xE5D2, 0x1155, 0xE5D3, 0xE5D5, 0x170A,
- 0xE5D6, 0xE5D6, 0x1157, 0xE5D7, 0xE5F9, 0x170D, 0xE5FA, 0xE5FB, 0x115A,
- 0xE5FC, 0xE5FC, 0x103F, 0xE5FD, 0xE5FD, 0x1730, 0xE5FE, 0xE5FE, 0x115C,
- 0xE6A1, 0xE6A1, 0x115F, 0xE6A2, 0xE6A3, 0x1731, 0xE6A4, 0xE6A4, 0x1161,
- 0xE6A5, 0xE6A6, 0x1733, 0xE6A7, 0xE6A7, 0x1162, 0xE6A8, 0xE6AC, 0x1735,
- 0xE6AD, 0xE6AD, 0x1165, 0xE6AE, 0xE6AE, 0x173A, 0xE6AF, 0xE6B1, 0x1167,
- 0xE6B2, 0xE6B2, 0x173B, 0xE6B3, 0xE6B3, 0x116A, 0xE6B4, 0xE6B6, 0x173C,
- 0xE6B7, 0xE6B8, 0x116B, 0xE6B9, 0xE6BB, 0x173F, 0xE6BC, 0xE6BC, 0x116F,
- 0xE6BD, 0xE6C3, 0x1742, 0xE6C4, 0xE6C4, 0x1040, 0xE6C5, 0xE6C5, 0x1749,
- 0xE6C6, 0xE6C7, 0x1171, 0xE6C8, 0xE6C9, 0x174A, 0xE6CA, 0xE6CA, 0x1041,
- 0xE6CB, 0xE6D1, 0x174C, 0xE6D2, 0xE6D2, 0x1174, 0xE6D3, 0xE6D5, 0x1753,
- 0xE6D6, 0xE6D6, 0x1175, 0xE6D7, 0xE6D8, 0x1756, 0xE6D9, 0xE6D9, 0x1176,
- 0xE6DA, 0xE6DB, 0x1758, 0xE6DC, 0xE6DC, 0x1042, 0xE6DD, 0xE6DE, 0x175A,
- 0xE6DF, 0xE6DF, 0x1177, 0xE6E0, 0xE6E0, 0x175C, 0xE6E1, 0xE6E1, 0x1178,
- 0xE6E2, 0xE6E3, 0x175D, 0xE6E4, 0xE6E4, 0x117A, 0xE6E5, 0xE6E5, 0x1179,
- 0xE6E6, 0xE6E6, 0x117B, 0xE6E7, 0xE6E7, 0x175F, 0xE6E8, 0xE6E8, 0x117C,
- 0xE6E9, 0xE6E9, 0x1760, 0xE6EA, 0xE6EB, 0x117E, 0xE6EC, 0xE6EC, 0x192F,
- 0xE6ED, 0xE6EE, 0x1761, 0xE6EF, 0xE6EF, 0x1181, 0xE6F0, 0xE6F0, 0x1763,
- 0xE6F1, 0xE6F1, 0x1182, 0xE6F2, 0xE6F2, 0x1554, 0xE6F3, 0xE6F4, 0x1764,
- 0xE6F5, 0xE6F5, 0x1183, 0xE6F6, 0xE6F6, 0x1043, 0xE6F7, 0xE6F7, 0x1046,
- 0xE6F8, 0xE6F8, 0x1766, 0xE6F9, 0xE6F9, 0x1185, 0xE6FA, 0xE6FE, 0x1767,
- 0xE7A1, 0xE7A1, 0x1187, 0xE7A2, 0xE7A5, 0x176C, 0xE7A6, 0xE7A6, 0x1188,
- 0xE7A7, 0xE7A8, 0x1770, 0xE7A9, 0xE7A9, 0x1189, 0xE7AA, 0xE7AA, 0x118B,
- 0xE7AB, 0xE7AB, 0x1772, 0xE7AC, 0xE7AC, 0x1047, 0xE7AD, 0xE7AD, 0x118D,
- 0xE7AE, 0xE7AF, 0x1773, 0xE7B0, 0xE7B0, 0x118E, 0xE7B1, 0xE7BE, 0x1775,
- 0xE7BF, 0xE7BF, 0x118F, 0xE7C0, 0xE7C0, 0x1783, 0xE7C1, 0xE7C1, 0x1E67,
- 0xE7C2, 0xE7C5, 0x1784, 0xE7C6, 0xE7C6, 0x1191, 0xE7C7, 0xE7C7, 0x1193,
- 0xE7C8, 0xE7CA, 0x1788, 0xE7CB, 0xE7CB, 0x1195, 0xE7CC, 0xE7CC, 0x178B,
- 0xE7CD, 0xE7CD, 0x1196, 0xE7CE, 0xE7CE, 0x178C, 0xE7CF, 0xE7D0, 0x1197,
- 0xE7D1, 0xE7D2, 0x178D, 0xE7D3, 0xE7D3, 0x119A, 0xE7D4, 0xE7DE, 0x178F,
- 0xE7DF, 0xE7DF, 0x119C, 0xE7E0, 0xE7E3, 0x179A, 0xE7E4, 0xE7E4, 0x119D,
- 0xE7E5, 0xE7E5, 0x179E, 0xE7E6, 0xE7E6, 0x119E, 0xE7E7, 0xE7F6, 0x179F,
- 0xE7F7, 0xE7F7, 0x16A5, 0xE7F8, 0xE7FE, 0x17AF, 0xE8A1, 0xE8E6, 0x17B6,
- 0xE8E7, 0xE8E8, 0x11C7, 0xE8E9, 0xE8EF, 0x17FC, 0xE8F0, 0xE8F0, 0x11C9,
- 0xE8F1, 0xE8F1, 0x1054, 0xE8F2, 0xE8F6, 0x1803, 0xE8F7, 0xE8F7, 0x11CB,
- 0xE8F8, 0xE8F8, 0x1808, 0xE8F9, 0xE8F9, 0x16A8, 0xE8FA, 0xE8FA, 0x1809,
- 0xE8FB, 0xE8FB, 0x11CC, 0xE8FC, 0xE8FD, 0x180A, 0xE8FE, 0xE8FE, 0x11CD,
- 0xE9A1, 0xE9A6, 0x180C, 0xE9A7, 0xE9A7, 0x11D0, 0xE9A8, 0xE9AB, 0x1812,
- 0xE9AC, 0xE9AC, 0x11D1, 0xE9AD, 0xE9CB, 0x1816, 0xE9CC, 0xE9CC, 0x11D3,
- 0xE9CD, 0xE9F6, 0x1835, 0xE9F7, 0xE9F7, 0x1F34, 0xE9F8, 0xE9FE, 0x185F,
- 0xEAA1, 0xEAC0, 0x1866, 0xEAC1, 0xEAC1, 0x17EB, 0xEAC2, 0xEAE4, 0x1886,
- 0xEAE5, 0xEAE5, 0x11E1, 0xEAE6, 0xEAF3, 0x18A9, 0xEAF4, 0xEAF4, 0x1057,
- 0xEAF5, 0xEAF6, 0x18B7, 0xEAF7, 0xEAF7, 0x11E3, 0xEAF8, 0xEAFB, 0x18B9,
- 0xEAFC, 0xEAFC, 0x11E5, 0xEAFD, 0xEAFD, 0x18BD, 0xEAFE, 0xEAFE, 0x11E6,
- 0xEBA1, 0xEBA3, 0x18BE, 0xEBA4, 0xEBA4, 0x11E8, 0xEBA5, 0xEBA6, 0x18C1,
- 0xEBA7, 0xEBA7, 0x11EA, 0xEBA8, 0xEBA8, 0x18C3, 0xEBA9, 0xEBA9, 0x11EC,
- 0xEBAA, 0xEBAA, 0x1058, 0xEBAB, 0xEBB9, 0x18C4, 0xEBBA, 0xEBBB, 0x11EE,
- 0xEBBC, 0xEBBC, 0x18D3, 0xEBBD, 0xEBBD, 0x11F0, 0xEBBE, 0xEBC0, 0x18D4,
- 0xEBC1, 0xEBC1, 0x11F1, 0xEBC2, 0xEBC2, 0x11F3, 0xEBC3, 0xEBC5, 0x18D7,
- 0xEBC6, 0xEBC7, 0x11F4, 0xEBC8, 0xEBCB, 0x18DA, 0xEBCC, 0xEBCC, 0x11F7,
- 0xEBCD, 0xEBCE, 0x18DE, 0xEBCF, 0xEBD1, 0x11F8, 0xEBD2, 0xEBD2, 0x15B0,
- 0xEBD3, 0xEBD7, 0x18E0, 0xEBD8, 0xEBD8, 0x11FB, 0xEBD9, 0xEBFE, 0x18E5,
- 0xECA1, 0xECA5, 0x190B, 0xECA6, 0xECA6, 0x1206, 0xECA7, 0xECA7, 0x1208,
- 0xECA8, 0xECA9, 0x1910, 0xECAA, 0xECAA, 0x120A, 0xECAB, 0xECAE, 0x1912,
- 0xECAF, 0xECAF, 0x173E, 0xECB0, 0xECB1, 0x120C, 0xECB2, 0xECB2, 0x105B,
- 0xECB3, 0xECB4, 0x1916, 0xECB5, 0xECB5, 0x1211, 0xECB6, 0xECB7, 0x1918,
- 0xECB8, 0xECB8, 0x1213, 0xECB9, 0xECB9, 0x191A, 0xECBA, 0xECBA, 0x1215,
- 0xECBB, 0xECBF, 0x191B, 0xECC0, 0xECC1, 0x1218, 0xECC2, 0xECC4, 0x1920,
- 0xECC5, 0xECC5, 0x121A, 0xECC6, 0xECC6, 0x121C, 0xECC7, 0xECC8, 0x1923,
- 0xECC9, 0xECCA, 0x105C, 0xECCB, 0xECD4, 0x1925, 0xECD5, 0xECD5, 0x121E,
- 0xECD6, 0xECDC, 0x192F, 0xECDD, 0xECDE, 0x1220, 0xECDF, 0xECE0, 0x1936,
- 0xECE1, 0xECE1, 0x1222, 0xECE2, 0xECE3, 0x1938, 0xECE4, 0xECE4, 0x1224,
- 0xECE5, 0xECE6, 0x193A, 0xECE7, 0xECE8, 0x1225, 0xECE9, 0xECF6, 0x193C,
- 0xECF7, 0xECF8, 0x1227, 0xECF9, 0xECF9, 0x194A, 0xECFA, 0xECFA, 0x122A,
- 0xECFB, 0xECFE, 0x194B, 0xEDA1, 0xEDA3, 0x122D, 0xEDA4, 0xEDED, 0x194F,
- 0xEDEE, 0xEDEE, 0x14E7, 0xEDEF, 0xEDFE, 0x1999, 0xEEA1, 0xEEDA, 0x19A9,
- 0xEEDB, 0xEEDB, 0x195E, 0xEEDC, 0xEEFE, 0x19E3, 0xEFA1, 0xEFFE, 0x1A06,
- 0xF0A1, 0xF0FE, 0x1A64, 0xF1A1, 0xF1FE, 0x1AC2, 0xF2A1, 0xF2BC, 0x1B20,
- 0xF2BD, 0xF2BD, 0x1663, 0xF2BE, 0xF2F9, 0x1B3C, 0xF2FA, 0xF2FA, 0x168B,
- 0xF2FB, 0xF2FE, 0x1B78, 0xF3A1, 0xF3B0, 0x1B7C, 0xF3B1, 0xF3B1, 0x105F,
- 0xF3B2, 0xF3FE, 0x1B8C, 0xF4A1, 0xF4A6, 0x1BD9, 0xF4A7, 0xF4A7, 0x1954,
- 0xF4A8, 0xF4ED, 0x1BDF, 0xF4EE, 0xF4EE, 0x1A1C, 0xF4EF, 0xF4FE, 0x1C25,
- 0xF5A1, 0xF5FE, 0x1C35, 0xF6A1, 0xF6F3, 0x1C93, 0xF6F4, 0xF6F4, 0x10B7,
- 0xF6F5, 0xF6F5, 0x1CE6, 0xF6F6, 0xF6F6, 0x1BE3, 0xF6F7, 0xF6FE, 0x1CE7,
- 0xF7A1, 0xF7B7, 0x1CEF, 0xF7B8, 0xF7B8, 0x1097, 0xF7B9, 0xF7C7, 0x1D06,
- 0xF7C8, 0xF7C8, 0x10AA, 0xF7C9, 0xF7D2, 0x1D15, 0xF7D3, 0xF7D3, 0x10F4,
- 0xF7D4, 0xF7FE, 0x1D1F, 0xF8A1, 0xF8DA, 0x1D4A, 0xF8DB, 0xF8DB, 0x1D94,
- 0xF8DC, 0xF8EF, 0x1D84, 0xF8F0, 0xF8F0, 0x13E0, 0xF8F1, 0xF8FE, 0x1D98,
- 0xF9A1, 0xF9FE, 0x1DA6, 0xFAA1, 0xFAA1, 0x1E1D, 0xFAA2, 0xFAA2, 0x0DE6,
- 0xFAA3, 0xFAE5, 0x1E04, 0xFAE6, 0xFAE6, 0x0E3C, 0xFAE7, 0xFAFE, 0x1E47,
- 0xFBA1, 0xFBFE, 0x1E5F, 0xFCA1, 0xFCA8, 0x1EBD, 0xFCA9, 0xFCA9, 0x0EE7,
- 0xFCAA, 0xFCFE, 0x1EC5, 0xFDA1, 0xFDFE, 0x1F1A,
-};
+// 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
+
+extern const unsigned short g_FXCMAP_KSC_EUC_H_0[467 * 3] = {
+ 0x0020, 0x007E, 0x1F9E, 0xA1A1, 0xA1FE, 0x0065, 0xA2A1, 0xA2E5, 0x00C3,
+ 0xA3A1, 0xA3FE, 0x0108, 0xA4A1, 0xA4D3, 0x0166, 0xA4D5, 0xA4FE, 0x0199,
+ 0xA5A1, 0xA5AA, 0x01C3, 0xA5B0, 0xA5B9, 0x01CD, 0xA5C1, 0xA5D8, 0x01D7,
+ 0xA5E1, 0xA5F8, 0x01EF, 0xA6A1, 0xA6E4, 0x0207, 0xA7A1, 0xA7EF, 0x024B,
+ 0xA8A1, 0xA8A4, 0x029A, 0xA8A6, 0xA8A6, 0x029E, 0xA8A8, 0xA8AF, 0x029F,
+ 0xA8B1, 0xA8FE, 0x02A7, 0xA9A1, 0xA9FE, 0x02F5, 0xAAA1, 0xAAF3, 0x0353,
+ 0xABA1, 0xABF6, 0x03A6, 0xACA1, 0xACC1, 0x03FC, 0xACD1, 0xACF1, 0x041D,
+ 0xB0A1, 0xB0FE, 0x043E, 0xB1A1, 0xB1FE, 0x049C, 0xB2A1, 0xB2FE, 0x04FA,
+ 0xB3A1, 0xB3FE, 0x0558, 0xB4A1, 0xB4FE, 0x05B6, 0xB5A1, 0xB5FE, 0x0614,
+ 0xB6A1, 0xB6FE, 0x0672, 0xB7A1, 0xB7FE, 0x06D0, 0xB8A1, 0xB8FE, 0x072E,
+ 0xB9A1, 0xB9FE, 0x078C, 0xBAA1, 0xBAFE, 0x07EA, 0xBBA1, 0xBBFE, 0x0848,
+ 0xBCA1, 0xBCFE, 0x08A6, 0xBDA1, 0xBDFE, 0x0904, 0xBEA1, 0xBEFE, 0x0962,
+ 0xBFA1, 0xBFFE, 0x09C0, 0xC0A1, 0xC0FE, 0x0A1E, 0xC1A1, 0xC1FE, 0x0A7C,
+ 0xC2A1, 0xC2FE, 0x0ADA, 0xC3A1, 0xC3FE, 0x0B38, 0xC4A1, 0xC4FE, 0x0B96,
+ 0xC5A1, 0xC5FE, 0x0BF4, 0xC6A1, 0xC6FE, 0x0C52, 0xC7A1, 0xC7FE, 0x0CB0,
+ 0xC8A1, 0xC8FE, 0x0D0E, 0xCAA1, 0xCAFE, 0x0D6C, 0xCBA1, 0xCBCF, 0x0DCA,
+ 0xCBD0, 0xCBD0, 0x1014, 0xCBD1, 0xCBD5, 0x0DF9, 0xCBD6, 0xCBD6, 0x0E5E,
+ 0xCBD7, 0xCBE6, 0x0DFE, 0xCBE7, 0xCBE7, 0x1B8D, 0xCBE8, 0xCBFE, 0x0E0E,
+ 0xCCA1, 0xCCFE, 0x0E25, 0xCDA1, 0xCDCE, 0x0E83, 0xCDCF, 0xCDCF, 0x0D84,
+ 0xCDD0, 0xCDE7, 0x0EB1, 0xCDE8, 0xCDE8, 0x1EDC, 0xCDE9, 0xCDFE, 0x0EC9,
+ 0xCEA1, 0xCEAC, 0x0EDF, 0xCEAD, 0xCEAD, 0x0EDA, 0xCEAE, 0xCEFE, 0x0EEB,
+ 0xCFA1, 0xCFFA, 0x0F3C, 0xCFFB, 0xCFFB, 0x0F3E, 0xCFFC, 0xCFFE, 0x0F96,
+ 0xD0A1, 0xD0A1, 0x0F99, 0xD0A2, 0xD0A2, 0x0F6A, 0xD0A3, 0xD0B7, 0x0F9A,
+ 0xD0B8, 0xD0B8, 0x0F6A, 0xD0B9, 0xD0CF, 0x0FAF, 0xD0D0, 0xD0D0, 0x0E7C,
+ 0xD0D1, 0xD0DC, 0x0FC6, 0xD0DD, 0xD0DD, 0x1023, 0xD0DE, 0xD0FE, 0x0FD2,
+ 0xD1A1, 0xD1D3, 0x0FF3, 0xD1D4, 0xD1D4, 0x1116, 0xD1D5, 0xD1D5, 0x103C,
+ 0xD1D6, 0xD1D7, 0x1026, 0xD1D8, 0xD1D8, 0x1117, 0xD1D9, 0xD1DA, 0x1028,
+ 0xD1DB, 0xD1E0, 0x1118, 0xD1E1, 0xD1E1, 0x102A, 0xD1E2, 0xD1E2, 0x16A8,
+ 0xD1E3, 0xD1E5, 0x111E, 0xD1E6, 0xD1E6, 0x1122, 0xD1E7, 0xD1E7, 0x102B,
+ 0xD1E8, 0xD1EB, 0x1123, 0xD1EC, 0xD1EC, 0x102C, 0xD1ED, 0xD1ED, 0x1127,
+ 0xD1EE, 0xD1EE, 0x102D, 0xD1EF, 0xD1F0, 0x112A, 0xD1F1, 0xD1F1, 0x102E,
+ 0xD1F2, 0xD1F2, 0x112C, 0xD1F3, 0xD1F5, 0x102F, 0xD1F6, 0xD1F6, 0x112F,
+ 0xD1F7, 0xD1F9, 0x1032, 0xD1FA, 0xD1FA, 0x1133, 0xD1FB, 0xD1FB, 0x1035,
+ 0xD1FC, 0xD1FD, 0x1136, 0xD1FE, 0xD1FE, 0x1139, 0xD2A1, 0xD2A1, 0x1036,
+ 0xD2A2, 0xD2A3, 0x113A, 0xD2A4, 0xD2A6, 0x1037, 0xD2A7, 0xD2AA, 0x113C,
+ 0xD2AB, 0xD2AB, 0x1143, 0xD2AC, 0xD2AC, 0x103A, 0xD2AD, 0xD2AD, 0x1144,
+ 0xD2AE, 0xD2B1, 0x103B, 0xD2B2, 0xD2B2, 0x1148, 0xD2B3, 0xD2BD, 0x103F,
+ 0xD2BE, 0xD2BE, 0x119F, 0xD2BF, 0xD2C1, 0x104A, 0xD2C2, 0xD2C3, 0x11A1,
+ 0xD2C4, 0xD2C4, 0x11A5, 0xD2C5, 0xD2C5, 0x104D, 0xD2C6, 0xD2CA, 0x11A6,
+ 0xD2CB, 0xD2CB, 0x11AC, 0xD2CC, 0xD2CC, 0x104E, 0xD2CD, 0xD2CE, 0x11AD,
+ 0xD2CF, 0xD2D4, 0x11B0, 0xD2D5, 0xD2D7, 0x11B7, 0xD2D8, 0xD2D8, 0x104F,
+ 0xD2D9, 0xD2DA, 0x11BD, 0xD2DB, 0xD2DD, 0x1050, 0xD2DE, 0xD2DF, 0x11C1,
+ 0xD2E0, 0xD2E0, 0x1053, 0xD2E1, 0xD2E1, 0x11C3, 0xD2E2, 0xD2E2, 0x11C6,
+ 0xD2E3, 0xD2E3, 0x1054, 0xD2E4, 0xD2E4, 0x11D4, 0xD2E5, 0xD2E8, 0x11D6,
+ 0xD2E9, 0xD2EA, 0x11DB, 0xD2EB, 0xD2EB, 0x11E0, 0xD2EC, 0xD2EF, 0x1055,
+ 0xD2F0, 0xD2F3, 0x11FC, 0xD2F4, 0xD2F5, 0x1201, 0xD2F6, 0xD2F6, 0x1059,
+ 0xD2F7, 0xD2F8, 0x1203, 0xD2F9, 0xD2FE, 0x105A, 0xD3A1, 0xD3FE, 0x1060,
+ 0xD4A1, 0xD4E5, 0x10BE, 0xD4E6, 0xD4E6, 0x10DE, 0xD4E7, 0xD4FB, 0x1103,
+ 0xD4FC, 0xD4FC, 0x1028, 0xD4FD, 0xD4FE, 0x1118, 0xD5A1, 0xD5A4, 0x111A,
+ 0xD5A5, 0xD5A5, 0x16A8, 0xD5A6, 0xD5AA, 0x111E, 0xD5AB, 0xD5AB, 0x102B,
+ 0xD5AC, 0xD5AD, 0x1123, 0xD5AE, 0xD5AE, 0x1060, 0xD5AF, 0xD5FE, 0x1125,
+ 0xD6A1, 0xD6B7, 0x1175, 0xD6B8, 0xD6B8, 0x1047, 0xD6B9, 0xD6CC, 0x118C,
+ 0xD6CD, 0xD6CD, 0x104C, 0xD6CE, 0xD6FE, 0x11A0, 0xD7A1, 0xD7CA, 0x11D1,
+ 0xD7CB, 0xD7CB, 0x15B0, 0xD7CC, 0xD7E3, 0x11FB, 0xD7E4, 0xD7E4, 0x1918,
+ 0xD7E5, 0xD7FE, 0x1213, 0xD8A1, 0xD8FE, 0x122D, 0xD9A1, 0xD9FE, 0x128B,
+ 0xDAA1, 0xDAFE, 0x12E9, 0xDBA1, 0xDBC4, 0x1347, 0xDBC5, 0xDBC5, 0x141F,
+ 0xDBC6, 0xDBE3, 0x136B, 0xDBE4, 0xDBE4, 0x133A, 0xDBE5, 0xDBFE, 0x1389,
+ 0xDCA1, 0xDCA4, 0x13A3, 0xDCA5, 0xDCA5, 0x1D5E, 0xDCA6, 0xDCFE, 0x13A7,
+ 0xDDA1, 0xDDA4, 0x1400, 0xDDA5, 0xDDA5, 0x13D7, 0xDDA6, 0xDDD4, 0x1404,
+ 0xDDD5, 0xDDD5, 0x13F5, 0xDDD6, 0xDDF3, 0x1433, 0xDDF4, 0xDDF4, 0x1DB7,
+ 0xDDF5, 0xDDFE, 0x1451, 0xDEA1, 0xDEFB, 0x145B, 0xDEFC, 0xDEFC, 0x15D0,
+ 0xDEFD, 0xDEFD, 0x14B6, 0xDEFE, 0xDEFE, 0x14F7, 0xDFA1, 0xDFB2, 0x14B7,
+ 0xDFB3, 0xDFB3, 0x1BAB, 0xDFB4, 0xDFE0, 0x14C9, 0xDFE1, 0xDFE1, 0x14F2,
+ 0xDFE2, 0xDFE7, 0x14F6, 0xDFE8, 0xDFE8, 0x156D, 0xDFE9, 0xDFFE, 0x14FC,
+ 0xE0A1, 0xE0F0, 0x1512, 0xE0F1, 0xE0F1, 0x1771, 0xE0F2, 0xE0FE, 0x1562,
+ 0xE1A1, 0xE1AC, 0x156F, 0xE1AD, 0xE1AD, 0x1554, 0xE1AE, 0xE1EC, 0x157B,
+ 0xE1ED, 0xE1ED, 0x14C5, 0xE1EE, 0xE1FE, 0x15BA, 0xE2A1, 0xE2FE, 0x15CB,
+ 0xE3A1, 0xE3F4, 0x1629, 0xE3F5, 0xE3F5, 0x1B61, 0xE3F6, 0xE3FE, 0x167D,
+ 0xE4A1, 0xE4A1, 0x1CCA, 0xE4A2, 0xE4A8, 0x1686, 0xE4A9, 0xE4A9, 0x162E,
+ 0xE4AA, 0xE4FE, 0x168D, 0xE5A1, 0xE5AD, 0x16E2, 0xE5AE, 0xE5AE, 0x16F2,
+ 0xE5AF, 0xE5B0, 0x16EF, 0xE5B1, 0xE5B2, 0x1149, 0xE5B3, 0xE5B8, 0x16F1,
+ 0xE5B9, 0xE5B9, 0x114B, 0xE5BA, 0xE5BA, 0x16F7, 0xE5BB, 0xE5BC, 0x114D,
+ 0xE5BD, 0xE5C3, 0x16F8, 0xE5C4, 0xE5C4, 0x114F, 0xE5C5, 0xE5CD, 0x16FF,
+ 0xE5CE, 0xE5CE, 0x1153, 0xE5CF, 0xE5CF, 0x1708, 0xE5D0, 0xE5D0, 0x1154,
+ 0xE5D1, 0xE5D1, 0x1709, 0xE5D2, 0xE5D2, 0x1155, 0xE5D3, 0xE5D5, 0x170A,
+ 0xE5D6, 0xE5D6, 0x1157, 0xE5D7, 0xE5F9, 0x170D, 0xE5FA, 0xE5FB, 0x115A,
+ 0xE5FC, 0xE5FC, 0x103F, 0xE5FD, 0xE5FD, 0x1730, 0xE5FE, 0xE5FE, 0x115C,
+ 0xE6A1, 0xE6A1, 0x115F, 0xE6A2, 0xE6A3, 0x1731, 0xE6A4, 0xE6A4, 0x1161,
+ 0xE6A5, 0xE6A6, 0x1733, 0xE6A7, 0xE6A7, 0x1162, 0xE6A8, 0xE6AC, 0x1735,
+ 0xE6AD, 0xE6AD, 0x1165, 0xE6AE, 0xE6AE, 0x173A, 0xE6AF, 0xE6B1, 0x1167,
+ 0xE6B2, 0xE6B2, 0x173B, 0xE6B3, 0xE6B3, 0x116A, 0xE6B4, 0xE6B6, 0x173C,
+ 0xE6B7, 0xE6B8, 0x116B, 0xE6B9, 0xE6BB, 0x173F, 0xE6BC, 0xE6BC, 0x116F,
+ 0xE6BD, 0xE6C3, 0x1742, 0xE6C4, 0xE6C4, 0x1040, 0xE6C5, 0xE6C5, 0x1749,
+ 0xE6C6, 0xE6C7, 0x1171, 0xE6C8, 0xE6C9, 0x174A, 0xE6CA, 0xE6CA, 0x1041,
+ 0xE6CB, 0xE6D1, 0x174C, 0xE6D2, 0xE6D2, 0x1174, 0xE6D3, 0xE6D5, 0x1753,
+ 0xE6D6, 0xE6D6, 0x1175, 0xE6D7, 0xE6D8, 0x1756, 0xE6D9, 0xE6D9, 0x1176,
+ 0xE6DA, 0xE6DB, 0x1758, 0xE6DC, 0xE6DC, 0x1042, 0xE6DD, 0xE6DE, 0x175A,
+ 0xE6DF, 0xE6DF, 0x1177, 0xE6E0, 0xE6E0, 0x175C, 0xE6E1, 0xE6E1, 0x1178,
+ 0xE6E2, 0xE6E3, 0x175D, 0xE6E4, 0xE6E4, 0x117A, 0xE6E5, 0xE6E5, 0x1179,
+ 0xE6E6, 0xE6E6, 0x117B, 0xE6E7, 0xE6E7, 0x175F, 0xE6E8, 0xE6E8, 0x117C,
+ 0xE6E9, 0xE6E9, 0x1760, 0xE6EA, 0xE6EB, 0x117E, 0xE6EC, 0xE6EC, 0x192F,
+ 0xE6ED, 0xE6EE, 0x1761, 0xE6EF, 0xE6EF, 0x1181, 0xE6F0, 0xE6F0, 0x1763,
+ 0xE6F1, 0xE6F1, 0x1182, 0xE6F2, 0xE6F2, 0x1554, 0xE6F3, 0xE6F4, 0x1764,
+ 0xE6F5, 0xE6F5, 0x1183, 0xE6F6, 0xE6F6, 0x1043, 0xE6F7, 0xE6F7, 0x1046,
+ 0xE6F8, 0xE6F8, 0x1766, 0xE6F9, 0xE6F9, 0x1185, 0xE6FA, 0xE6FE, 0x1767,
+ 0xE7A1, 0xE7A1, 0x1187, 0xE7A2, 0xE7A5, 0x176C, 0xE7A6, 0xE7A6, 0x1188,
+ 0xE7A7, 0xE7A8, 0x1770, 0xE7A9, 0xE7A9, 0x1189, 0xE7AA, 0xE7AA, 0x118B,
+ 0xE7AB, 0xE7AB, 0x1772, 0xE7AC, 0xE7AC, 0x1047, 0xE7AD, 0xE7AD, 0x118D,
+ 0xE7AE, 0xE7AF, 0x1773, 0xE7B0, 0xE7B0, 0x118E, 0xE7B1, 0xE7BE, 0x1775,
+ 0xE7BF, 0xE7BF, 0x118F, 0xE7C0, 0xE7C0, 0x1783, 0xE7C1, 0xE7C1, 0x1E67,
+ 0xE7C2, 0xE7C5, 0x1784, 0xE7C6, 0xE7C6, 0x1191, 0xE7C7, 0xE7C7, 0x1193,
+ 0xE7C8, 0xE7CA, 0x1788, 0xE7CB, 0xE7CB, 0x1195, 0xE7CC, 0xE7CC, 0x178B,
+ 0xE7CD, 0xE7CD, 0x1196, 0xE7CE, 0xE7CE, 0x178C, 0xE7CF, 0xE7D0, 0x1197,
+ 0xE7D1, 0xE7D2, 0x178D, 0xE7D3, 0xE7D3, 0x119A, 0xE7D4, 0xE7DE, 0x178F,
+ 0xE7DF, 0xE7DF, 0x119C, 0xE7E0, 0xE7E3, 0x179A, 0xE7E4, 0xE7E4, 0x119D,
+ 0xE7E5, 0xE7E5, 0x179E, 0xE7E6, 0xE7E6, 0x119E, 0xE7E7, 0xE7F6, 0x179F,
+ 0xE7F7, 0xE7F7, 0x16A5, 0xE7F8, 0xE7FE, 0x17AF, 0xE8A1, 0xE8E6, 0x17B6,
+ 0xE8E7, 0xE8E8, 0x11C7, 0xE8E9, 0xE8EF, 0x17FC, 0xE8F0, 0xE8F0, 0x11C9,
+ 0xE8F1, 0xE8F1, 0x1054, 0xE8F2, 0xE8F6, 0x1803, 0xE8F7, 0xE8F7, 0x11CB,
+ 0xE8F8, 0xE8F8, 0x1808, 0xE8F9, 0xE8F9, 0x16A8, 0xE8FA, 0xE8FA, 0x1809,
+ 0xE8FB, 0xE8FB, 0x11CC, 0xE8FC, 0xE8FD, 0x180A, 0xE8FE, 0xE8FE, 0x11CD,
+ 0xE9A1, 0xE9A6, 0x180C, 0xE9A7, 0xE9A7, 0x11D0, 0xE9A8, 0xE9AB, 0x1812,
+ 0xE9AC, 0xE9AC, 0x11D1, 0xE9AD, 0xE9CB, 0x1816, 0xE9CC, 0xE9CC, 0x11D3,
+ 0xE9CD, 0xE9F6, 0x1835, 0xE9F7, 0xE9F7, 0x1F34, 0xE9F8, 0xE9FE, 0x185F,
+ 0xEAA1, 0xEAC0, 0x1866, 0xEAC1, 0xEAC1, 0x17EB, 0xEAC2, 0xEAE4, 0x1886,
+ 0xEAE5, 0xEAE5, 0x11E1, 0xEAE6, 0xEAF3, 0x18A9, 0xEAF4, 0xEAF4, 0x1057,
+ 0xEAF5, 0xEAF6, 0x18B7, 0xEAF7, 0xEAF7, 0x11E3, 0xEAF8, 0xEAFB, 0x18B9,
+ 0xEAFC, 0xEAFC, 0x11E5, 0xEAFD, 0xEAFD, 0x18BD, 0xEAFE, 0xEAFE, 0x11E6,
+ 0xEBA1, 0xEBA3, 0x18BE, 0xEBA4, 0xEBA4, 0x11E8, 0xEBA5, 0xEBA6, 0x18C1,
+ 0xEBA7, 0xEBA7, 0x11EA, 0xEBA8, 0xEBA8, 0x18C3, 0xEBA9, 0xEBA9, 0x11EC,
+ 0xEBAA, 0xEBAA, 0x1058, 0xEBAB, 0xEBB9, 0x18C4, 0xEBBA, 0xEBBB, 0x11EE,
+ 0xEBBC, 0xEBBC, 0x18D3, 0xEBBD, 0xEBBD, 0x11F0, 0xEBBE, 0xEBC0, 0x18D4,
+ 0xEBC1, 0xEBC1, 0x11F1, 0xEBC2, 0xEBC2, 0x11F3, 0xEBC3, 0xEBC5, 0x18D7,
+ 0xEBC6, 0xEBC7, 0x11F4, 0xEBC8, 0xEBCB, 0x18DA, 0xEBCC, 0xEBCC, 0x11F7,
+ 0xEBCD, 0xEBCE, 0x18DE, 0xEBCF, 0xEBD1, 0x11F8, 0xEBD2, 0xEBD2, 0x15B0,
+ 0xEBD3, 0xEBD7, 0x18E0, 0xEBD8, 0xEBD8, 0x11FB, 0xEBD9, 0xEBFE, 0x18E5,
+ 0xECA1, 0xECA5, 0x190B, 0xECA6, 0xECA6, 0x1206, 0xECA7, 0xECA7, 0x1208,
+ 0xECA8, 0xECA9, 0x1910, 0xECAA, 0xECAA, 0x120A, 0xECAB, 0xECAE, 0x1912,
+ 0xECAF, 0xECAF, 0x173E, 0xECB0, 0xECB1, 0x120C, 0xECB2, 0xECB2, 0x105B,
+ 0xECB3, 0xECB4, 0x1916, 0xECB5, 0xECB5, 0x1211, 0xECB6, 0xECB7, 0x1918,
+ 0xECB8, 0xECB8, 0x1213, 0xECB9, 0xECB9, 0x191A, 0xECBA, 0xECBA, 0x1215,
+ 0xECBB, 0xECBF, 0x191B, 0xECC0, 0xECC1, 0x1218, 0xECC2, 0xECC4, 0x1920,
+ 0xECC5, 0xECC5, 0x121A, 0xECC6, 0xECC6, 0x121C, 0xECC7, 0xECC8, 0x1923,
+ 0xECC9, 0xECCA, 0x105C, 0xECCB, 0xECD4, 0x1925, 0xECD5, 0xECD5, 0x121E,
+ 0xECD6, 0xECDC, 0x192F, 0xECDD, 0xECDE, 0x1220, 0xECDF, 0xECE0, 0x1936,
+ 0xECE1, 0xECE1, 0x1222, 0xECE2, 0xECE3, 0x1938, 0xECE4, 0xECE4, 0x1224,
+ 0xECE5, 0xECE6, 0x193A, 0xECE7, 0xECE8, 0x1225, 0xECE9, 0xECF6, 0x193C,
+ 0xECF7, 0xECF8, 0x1227, 0xECF9, 0xECF9, 0x194A, 0xECFA, 0xECFA, 0x122A,
+ 0xECFB, 0xECFE, 0x194B, 0xEDA1, 0xEDA3, 0x122D, 0xEDA4, 0xEDED, 0x194F,
+ 0xEDEE, 0xEDEE, 0x14E7, 0xEDEF, 0xEDFE, 0x1999, 0xEEA1, 0xEEDA, 0x19A9,
+ 0xEEDB, 0xEEDB, 0x195E, 0xEEDC, 0xEEFE, 0x19E3, 0xEFA1, 0xEFFE, 0x1A06,
+ 0xF0A1, 0xF0FE, 0x1A64, 0xF1A1, 0xF1FE, 0x1AC2, 0xF2A1, 0xF2BC, 0x1B20,
+ 0xF2BD, 0xF2BD, 0x1663, 0xF2BE, 0xF2F9, 0x1B3C, 0xF2FA, 0xF2FA, 0x168B,
+ 0xF2FB, 0xF2FE, 0x1B78, 0xF3A1, 0xF3B0, 0x1B7C, 0xF3B1, 0xF3B1, 0x105F,
+ 0xF3B2, 0xF3FE, 0x1B8C, 0xF4A1, 0xF4A6, 0x1BD9, 0xF4A7, 0xF4A7, 0x1954,
+ 0xF4A8, 0xF4ED, 0x1BDF, 0xF4EE, 0xF4EE, 0x1A1C, 0xF4EF, 0xF4FE, 0x1C25,
+ 0xF5A1, 0xF5FE, 0x1C35, 0xF6A1, 0xF6F3, 0x1C93, 0xF6F4, 0xF6F4, 0x10B7,
+ 0xF6F5, 0xF6F5, 0x1CE6, 0xF6F6, 0xF6F6, 0x1BE3, 0xF6F7, 0xF6FE, 0x1CE7,
+ 0xF7A1, 0xF7B7, 0x1CEF, 0xF7B8, 0xF7B8, 0x1097, 0xF7B9, 0xF7C7, 0x1D06,
+ 0xF7C8, 0xF7C8, 0x10AA, 0xF7C9, 0xF7D2, 0x1D15, 0xF7D3, 0xF7D3, 0x10F4,
+ 0xF7D4, 0xF7FE, 0x1D1F, 0xF8A1, 0xF8DA, 0x1D4A, 0xF8DB, 0xF8DB, 0x1D94,
+ 0xF8DC, 0xF8EF, 0x1D84, 0xF8F0, 0xF8F0, 0x13E0, 0xF8F1, 0xF8FE, 0x1D98,
+ 0xF9A1, 0xF9FE, 0x1DA6, 0xFAA1, 0xFAA1, 0x1E1D, 0xFAA2, 0xFAA2, 0x0DE6,
+ 0xFAA3, 0xFAE5, 0x1E04, 0xFAE6, 0xFAE6, 0x0E3C, 0xFAE7, 0xFAFE, 0x1E47,
+ 0xFBA1, 0xFBFE, 0x1E5F, 0xFCA1, 0xFCA8, 0x1EBD, 0xFCA9, 0xFCA9, 0x0EE7,
+ 0xFCAA, 0xFCFE, 0x1EC5, 0xFDA1, 0xFDFE, 0x1F1A,
+};
diff --git a/core/src/fpdfapi/fpdf_cmaps/Korea1/KSC-EUC-V_0.cpp b/core/src/fpdfapi/fpdf_cmaps/Korea1/KSC-EUC-V_0.cpp
index e75a6a3b4f..5ff44154b4 100644
--- a/core/src/fpdfapi/fpdf_cmaps/Korea1/KSC-EUC-V_0.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/Korea1/KSC-EUC-V_0.cpp
@@ -1,14 +1,14 @@
-// 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
-
-extern const unsigned short g_FXCMAP_KSC_EUC_V_0[16 * 3] = {
- 0xA1A2, 0xA1A3, 0x1F78, 0xA1A5, 0xA1A5, 0x1F7A, 0xA1A6, 0xA1A6, 0x2080,
- 0xA1A9, 0xA1AB, 0x1F7B, 0xA1AD, 0xA1AD, 0x1F7E, 0xA1B2, 0xA1BD, 0x1F7F,
- 0xA1EB, 0xA1EB, 0x1F8B, 0xA3A1, 0xA3A1, 0x1F8C, 0xA3A8, 0xA3A9, 0x1F8D,
- 0xA3AC, 0xA3AC, 0x1F8F, 0xA3AE, 0xA3AE, 0x1F90, 0xA3BA, 0xA3BF, 0x1F91,
- 0xA3DB, 0xA3DB, 0x1F97, 0xA3DD, 0xA3DD, 0x1F98, 0xA3DF, 0xA3DF, 0x1F99,
- 0xA3FB, 0xA3FE, 0x1F9A,
-};
+// 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
+
+extern const unsigned short g_FXCMAP_KSC_EUC_V_0[16 * 3] = {
+ 0xA1A2, 0xA1A3, 0x1F78, 0xA1A5, 0xA1A5, 0x1F7A, 0xA1A6, 0xA1A6, 0x2080,
+ 0xA1A9, 0xA1AB, 0x1F7B, 0xA1AD, 0xA1AD, 0x1F7E, 0xA1B2, 0xA1BD, 0x1F7F,
+ 0xA1EB, 0xA1EB, 0x1F8B, 0xA3A1, 0xA3A1, 0x1F8C, 0xA3A8, 0xA3A9, 0x1F8D,
+ 0xA3AC, 0xA3AC, 0x1F8F, 0xA3AE, 0xA3AE, 0x1F90, 0xA3BA, 0xA3BF, 0x1F91,
+ 0xA3DB, 0xA3DB, 0x1F97, 0xA3DD, 0xA3DD, 0x1F98, 0xA3DF, 0xA3DF, 0x1F99,
+ 0xA3FB, 0xA3FE, 0x1F9A,
+};
diff --git a/core/src/fpdfapi/fpdf_cmaps/Korea1/KSCms-UHC-HW-H_1.cpp b/core/src/fpdfapi/fpdf_cmaps/Korea1/KSCms-UHC-HW-H_1.cpp
index d95bab8287..d49e9f4813 100644
--- a/core/src/fpdfapi/fpdf_cmaps/Korea1/KSCms-UHC-HW-H_1.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/Korea1/KSCms-UHC-HW-H_1.cpp
@@ -1,233 +1,233 @@
-// 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
-
-extern const unsigned short g_FXCMAP_KSCms_UHC_HW_H_1[675 * 3] = {
- 0x0020, 0x007E, 0x1F9E, 0x8141, 0x815A, 0x2475, 0x8161, 0x817A, 0x248F,
- 0x8181, 0x81FE, 0x24A9, 0x8241, 0x825A, 0x2527, 0x8261, 0x827A, 0x2541,
- 0x8281, 0x82FE, 0x255B, 0x8341, 0x835A, 0x25D9, 0x8361, 0x837A, 0x25F3,
- 0x8381, 0x83FE, 0x260D, 0x8441, 0x845A, 0x268B, 0x8461, 0x847A, 0x26A5,
- 0x8481, 0x84FE, 0x26BF, 0x8541, 0x855A, 0x273D, 0x8561, 0x857A, 0x2757,
- 0x8581, 0x85FE, 0x2771, 0x8641, 0x865A, 0x27EF, 0x8661, 0x867A, 0x2809,
- 0x8681, 0x86FE, 0x2823, 0x8741, 0x875A, 0x28A1, 0x8761, 0x877A, 0x28BB,
- 0x8781, 0x87FE, 0x28D5, 0x8841, 0x885A, 0x2953, 0x8861, 0x887A, 0x296D,
- 0x8881, 0x88FE, 0x2987, 0x8941, 0x895A, 0x2A05, 0x8961, 0x897A, 0x2A1F,
- 0x8981, 0x89FE, 0x2A39, 0x8A41, 0x8A5A, 0x2AB7, 0x8A61, 0x8A7A, 0x2AD1,
- 0x8A81, 0x8AFE, 0x2AEB, 0x8B41, 0x8B5A, 0x2B69, 0x8B61, 0x8B7A, 0x2B83,
- 0x8B81, 0x8BFE, 0x2B9D, 0x8C41, 0x8C5A, 0x2C1B, 0x8C61, 0x8C7A, 0x2C35,
- 0x8C81, 0x8CFE, 0x2C4F, 0x8D41, 0x8D5A, 0x2CCD, 0x8D61, 0x8D7A, 0x2CE7,
- 0x8D81, 0x8DFE, 0x2D01, 0x8E41, 0x8E5A, 0x2D7F, 0x8E61, 0x8E7A, 0x2D99,
- 0x8E81, 0x8EFE, 0x2DB3, 0x8F41, 0x8F5A, 0x2E31, 0x8F61, 0x8F7A, 0x2E4B,
- 0x8F81, 0x8FFE, 0x2E65, 0x9041, 0x905A, 0x2EE3, 0x9061, 0x907A, 0x2EFD,
- 0x9081, 0x90FE, 0x2F17, 0x9141, 0x915A, 0x2F95, 0x9161, 0x917A, 0x2FAF,
- 0x9181, 0x91FE, 0x2FC9, 0x9241, 0x925A, 0x3047, 0x9261, 0x927A, 0x3061,
- 0x9281, 0x92FE, 0x307B, 0x9341, 0x935A, 0x30F9, 0x9361, 0x937A, 0x3113,
- 0x9381, 0x93FE, 0x312D, 0x9441, 0x945A, 0x31AB, 0x9461, 0x947A, 0x31C5,
- 0x9481, 0x94FE, 0x31DF, 0x9541, 0x955A, 0x325D, 0x9561, 0x957A, 0x3277,
- 0x9581, 0x95FE, 0x3291, 0x9641, 0x965A, 0x330F, 0x9661, 0x967A, 0x3329,
- 0x9681, 0x96FE, 0x3343, 0x9741, 0x975A, 0x33C1, 0x9761, 0x977A, 0x33DB,
- 0x9781, 0x97FE, 0x33F5, 0x9841, 0x985A, 0x3473, 0x9861, 0x987A, 0x348D,
- 0x9881, 0x98FE, 0x34A7, 0x9941, 0x995A, 0x3525, 0x9961, 0x997A, 0x353F,
- 0x9981, 0x99FE, 0x3559, 0x9A41, 0x9A5A, 0x35D7, 0x9A61, 0x9A7A, 0x35F1,
- 0x9A81, 0x9AFE, 0x360B, 0x9B41, 0x9B5A, 0x3689, 0x9B61, 0x9B7A, 0x36A3,
- 0x9B81, 0x9BFE, 0x36BD, 0x9C41, 0x9C5A, 0x373B, 0x9C61, 0x9C7A, 0x3755,
- 0x9C81, 0x9CFE, 0x376F, 0x9D41, 0x9D5A, 0x37ED, 0x9D61, 0x9D7A, 0x3807,
- 0x9D81, 0x9DFE, 0x3821, 0x9E41, 0x9E5A, 0x389F, 0x9E61, 0x9E7A, 0x38B9,
- 0x9E81, 0x9EFE, 0x38D3, 0x9F41, 0x9F5A, 0x3951, 0x9F61, 0x9F7A, 0x396B,
- 0x9F81, 0x9FFE, 0x3985, 0xA041, 0xA05A, 0x3A03, 0xA061, 0xA07A, 0x3A1D,
- 0xA081, 0xA0FE, 0x3A37, 0xA141, 0xA15A, 0x3AB5, 0xA161, 0xA17A, 0x3ACF,
- 0xA181, 0xA1A0, 0x3AE9, 0xA1A1, 0xA1FE, 0x0065, 0xA241, 0xA25A, 0x3B09,
- 0xA261, 0xA27A, 0x3B23, 0xA281, 0xA2A0, 0x3B3D, 0xA2A1, 0xA2E5, 0x00C3,
- 0xA341, 0xA35A, 0x3B5D, 0xA361, 0xA37A, 0x3B77, 0xA381, 0xA3A0, 0x3B91,
- 0xA3A1, 0xA3FE, 0x0108, 0xA441, 0xA45A, 0x3BB1, 0xA461, 0xA47A, 0x3BCB,
- 0xA481, 0xA4A0, 0x3BE5, 0xA4A1, 0xA4D3, 0x0166, 0xA4D5, 0xA4FE, 0x0199,
- 0xA541, 0xA55A, 0x3C05, 0xA561, 0xA57A, 0x3C1F, 0xA581, 0xA5A0, 0x3C39,
- 0xA5A1, 0xA5AA, 0x01C3, 0xA5B0, 0xA5B9, 0x01CD, 0xA5C1, 0xA5D8, 0x01D7,
- 0xA5E1, 0xA5F8, 0x01EF, 0xA641, 0xA65A, 0x3C59, 0xA661, 0xA67A, 0x3C73,
- 0xA681, 0xA6A0, 0x3C8D, 0xA6A1, 0xA6E4, 0x0207, 0xA741, 0xA75A, 0x3CAD,
- 0xA761, 0xA77A, 0x3CC7, 0xA781, 0xA7A0, 0x3CE1, 0xA7A1, 0xA7EF, 0x024B,
- 0xA841, 0xA85A, 0x3D01, 0xA861, 0xA87A, 0x3D1B, 0xA881, 0xA8A0, 0x3D35,
- 0xA8A1, 0xA8A4, 0x029A, 0xA8A6, 0xA8A6, 0x029E, 0xA8A8, 0xA8AF, 0x029F,
- 0xA8B1, 0xA8FE, 0x02A7, 0xA941, 0xA95A, 0x3D55, 0xA961, 0xA97A, 0x3D6F,
- 0xA981, 0xA9A0, 0x3D89, 0xA9A1, 0xA9FE, 0x02F5, 0xAA41, 0xAA5A, 0x3DA9,
- 0xAA61, 0xAA7A, 0x3DC3, 0xAA81, 0xAAA0, 0x3DDD, 0xAAA1, 0xAAF3, 0x0353,
- 0xAB41, 0xAB5A, 0x3DFD, 0xAB61, 0xAB7A, 0x3E17, 0xAB81, 0xABA0, 0x3E31,
- 0xABA1, 0xABF6, 0x03A6, 0xAC41, 0xAC5A, 0x3E51, 0xAC61, 0xAC7A, 0x3E6B,
- 0xAC81, 0xACA0, 0x3E85, 0xACA1, 0xACC1, 0x03FC, 0xACD1, 0xACF1, 0x041D,
- 0xAD41, 0xAD5A, 0x3EA5, 0xAD61, 0xAD7A, 0x3EBF, 0xAD81, 0xADA0, 0x3ED9,
- 0xAE41, 0xAE5A, 0x3EF9, 0xAE61, 0xAE7A, 0x3F13, 0xAE81, 0xAEA0, 0x3F2D,
- 0xAF41, 0xAF5A, 0x3F4D, 0xAF61, 0xAF7A, 0x3F67, 0xAF81, 0xAFA0, 0x3F81,
- 0xB041, 0xB05A, 0x3FA1, 0xB061, 0xB07A, 0x3FBB, 0xB081, 0xB0A0, 0x3FD5,
- 0xB0A1, 0xB0FE, 0x043E, 0xB141, 0xB15A, 0x3FF5, 0xB161, 0xB17A, 0x400F,
- 0xB181, 0xB1A0, 0x4029, 0xB1A1, 0xB1FE, 0x049C, 0xB241, 0xB25A, 0x4049,
- 0xB261, 0xB27A, 0x4063, 0xB281, 0xB2A0, 0x407D, 0xB2A1, 0xB2FE, 0x04FA,
- 0xB341, 0xB35A, 0x409D, 0xB361, 0xB37A, 0x40B7, 0xB381, 0xB3A0, 0x40D1,
- 0xB3A1, 0xB3FE, 0x0558, 0xB441, 0xB45A, 0x40F1, 0xB461, 0xB47A, 0x410B,
- 0xB481, 0xB4A0, 0x4125, 0xB4A1, 0xB4FE, 0x05B6, 0xB541, 0xB55A, 0x4145,
- 0xB561, 0xB57A, 0x415F, 0xB581, 0xB5A0, 0x4179, 0xB5A1, 0xB5FE, 0x0614,
- 0xB641, 0xB65A, 0x4199, 0xB661, 0xB67A, 0x41B3, 0xB681, 0xB6A0, 0x41CD,
- 0xB6A1, 0xB6FE, 0x0672, 0xB741, 0xB75A, 0x41ED, 0xB761, 0xB77A, 0x4207,
- 0xB781, 0xB7A0, 0x4221, 0xB7A1, 0xB7FE, 0x06D0, 0xB841, 0xB85A, 0x4241,
- 0xB861, 0xB87A, 0x425B, 0xB881, 0xB8A0, 0x4275, 0xB8A1, 0xB8FE, 0x072E,
- 0xB941, 0xB95A, 0x4295, 0xB961, 0xB97A, 0x42AF, 0xB981, 0xB9A0, 0x42C9,
- 0xB9A1, 0xB9FE, 0x078C, 0xBA41, 0xBA5A, 0x42E9, 0xBA61, 0xBA7A, 0x4303,
- 0xBA81, 0xBAA0, 0x431D, 0xBAA1, 0xBAFE, 0x07EA, 0xBB41, 0xBB5A, 0x433D,
- 0xBB61, 0xBB7A, 0x4357, 0xBB81, 0xBBA0, 0x4371, 0xBBA1, 0xBBFE, 0x0848,
- 0xBC41, 0xBC5A, 0x4391, 0xBC61, 0xBC7A, 0x43AB, 0xBC81, 0xBCA0, 0x43C5,
- 0xBCA1, 0xBCFE, 0x08A6, 0xBD41, 0xBD5A, 0x43E5, 0xBD61, 0xBD7A, 0x43FF,
- 0xBD81, 0xBDA0, 0x4419, 0xBDA1, 0xBDFE, 0x0904, 0xBE41, 0xBE5A, 0x4439,
- 0xBE61, 0xBE7A, 0x4453, 0xBE81, 0xBEA0, 0x446D, 0xBEA1, 0xBEFE, 0x0962,
- 0xBF41, 0xBF5A, 0x448D, 0xBF61, 0xBF7A, 0x44A7, 0xBF81, 0xBFA0, 0x44C1,
- 0xBFA1, 0xBFFE, 0x09C0, 0xC041, 0xC05A, 0x44E1, 0xC061, 0xC07A, 0x44FB,
- 0xC081, 0xC0A0, 0x4515, 0xC0A1, 0xC0FE, 0x0A1E, 0xC141, 0xC15A, 0x4535,
- 0xC161, 0xC17A, 0x454F, 0xC181, 0xC1A0, 0x4569, 0xC1A1, 0xC1FE, 0x0A7C,
- 0xC241, 0xC25A, 0x4589, 0xC261, 0xC27A, 0x45A3, 0xC281, 0xC2A0, 0x45BD,
- 0xC2A1, 0xC2FE, 0x0ADA, 0xC341, 0xC35A, 0x45DD, 0xC361, 0xC37A, 0x45F7,
- 0xC381, 0xC3A0, 0x4611, 0xC3A1, 0xC3FE, 0x0B38, 0xC441, 0xC45A, 0x4631,
- 0xC461, 0xC47A, 0x464B, 0xC481, 0xC4A0, 0x4665, 0xC4A1, 0xC4FE, 0x0B96,
- 0xC541, 0xC55A, 0x4685, 0xC561, 0xC57A, 0x469F, 0xC581, 0xC5A0, 0x46B9,
- 0xC5A1, 0xC5FE, 0x0BF4, 0xC641, 0xC652, 0x46D9, 0xC6A1, 0xC6FE, 0x0C52,
- 0xC7A1, 0xC7FE, 0x0CB0, 0xC8A1, 0xC8FE, 0x0D0E, 0xCAA1, 0xCAFE, 0x0D6C,
- 0xCBA1, 0xCBCF, 0x0DCA, 0xCBD0, 0xCBD0, 0x1014, 0xCBD1, 0xCBD5, 0x0DF9,
- 0xCBD6, 0xCBD6, 0x0E5E, 0xCBD7, 0xCBE6, 0x0DFE, 0xCBE7, 0xCBE7, 0x1B8D,
- 0xCBE8, 0xCBFE, 0x0E0E, 0xCCA1, 0xCCFE, 0x0E25, 0xCDA1, 0xCDCE, 0x0E83,
- 0xCDCF, 0xCDCF, 0x0D84, 0xCDD0, 0xCDE7, 0x0EB1, 0xCDE8, 0xCDE8, 0x1EDC,
- 0xCDE9, 0xCDFE, 0x0EC9, 0xCEA1, 0xCEAC, 0x0EDF, 0xCEAD, 0xCEAD, 0x0EDA,
- 0xCEAE, 0xCEFE, 0x0EEB, 0xCFA1, 0xCFFA, 0x0F3C, 0xCFFB, 0xCFFB, 0x0F3E,
- 0xCFFC, 0xCFFE, 0x0F96, 0xD0A1, 0xD0A1, 0x0F99, 0xD0A2, 0xD0A2, 0x0F6A,
- 0xD0A3, 0xD0B7, 0x0F9A, 0xD0B8, 0xD0B8, 0x0F6A, 0xD0B9, 0xD0CF, 0x0FAF,
- 0xD0D0, 0xD0D0, 0x0E7C, 0xD0D1, 0xD0DC, 0x0FC6, 0xD0DD, 0xD0DD, 0x1023,
- 0xD0DE, 0xD0FE, 0x0FD2, 0xD1A1, 0xD1D3, 0x0FF3, 0xD1D4, 0xD1D4, 0x1116,
- 0xD1D5, 0xD1D5, 0x103C, 0xD1D6, 0xD1D7, 0x1026, 0xD1D8, 0xD1D8, 0x1117,
- 0xD1D9, 0xD1DA, 0x1028, 0xD1DB, 0xD1E0, 0x1118, 0xD1E1, 0xD1E1, 0x102A,
- 0xD1E2, 0xD1E2, 0x16A8, 0xD1E3, 0xD1E5, 0x111E, 0xD1E6, 0xD1E6, 0x1122,
- 0xD1E7, 0xD1E7, 0x102B, 0xD1E8, 0xD1EB, 0x1123, 0xD1EC, 0xD1EC, 0x102C,
- 0xD1ED, 0xD1ED, 0x1127, 0xD1EE, 0xD1EE, 0x102D, 0xD1EF, 0xD1F0, 0x112A,
- 0xD1F1, 0xD1F1, 0x102E, 0xD1F2, 0xD1F2, 0x112C, 0xD1F3, 0xD1F5, 0x102F,
- 0xD1F6, 0xD1F6, 0x112F, 0xD1F7, 0xD1F9, 0x1032, 0xD1FA, 0xD1FA, 0x1133,
- 0xD1FB, 0xD1FB, 0x1035, 0xD1FC, 0xD1FD, 0x1136, 0xD1FE, 0xD1FE, 0x1139,
- 0xD2A1, 0xD2A1, 0x1036, 0xD2A2, 0xD2A3, 0x113A, 0xD2A4, 0xD2A6, 0x1037,
- 0xD2A7, 0xD2AA, 0x113C, 0xD2AB, 0xD2AB, 0x1143, 0xD2AC, 0xD2AC, 0x103A,
- 0xD2AD, 0xD2AD, 0x1144, 0xD2AE, 0xD2B1, 0x103B, 0xD2B2, 0xD2B2, 0x1148,
- 0xD2B3, 0xD2BD, 0x103F, 0xD2BE, 0xD2BE, 0x119F, 0xD2BF, 0xD2C1, 0x104A,
- 0xD2C2, 0xD2C3, 0x11A1, 0xD2C4, 0xD2C4, 0x11A5, 0xD2C5, 0xD2C5, 0x104D,
- 0xD2C6, 0xD2CA, 0x11A6, 0xD2CB, 0xD2CB, 0x11AC, 0xD2CC, 0xD2CC, 0x104E,
- 0xD2CD, 0xD2CE, 0x11AD, 0xD2CF, 0xD2D4, 0x11B0, 0xD2D5, 0xD2D7, 0x11B7,
- 0xD2D8, 0xD2D8, 0x104F, 0xD2D9, 0xD2DA, 0x11BD, 0xD2DB, 0xD2DD, 0x1050,
- 0xD2DE, 0xD2DF, 0x11C1, 0xD2E0, 0xD2E0, 0x1053, 0xD2E1, 0xD2E1, 0x11C3,
- 0xD2E2, 0xD2E2, 0x11C6, 0xD2E3, 0xD2E3, 0x1054, 0xD2E4, 0xD2E4, 0x11D4,
- 0xD2E5, 0xD2E8, 0x11D6, 0xD2E9, 0xD2EA, 0x11DB, 0xD2EB, 0xD2EB, 0x11E0,
- 0xD2EC, 0xD2EF, 0x1055, 0xD2F0, 0xD2F3, 0x11FC, 0xD2F4, 0xD2F5, 0x1201,
- 0xD2F6, 0xD2F6, 0x1059, 0xD2F7, 0xD2F8, 0x1203, 0xD2F9, 0xD2FE, 0x105A,
- 0xD3A1, 0xD3FE, 0x1060, 0xD4A1, 0xD4E5, 0x10BE, 0xD4E6, 0xD4E6, 0x10DE,
- 0xD4E7, 0xD4FB, 0x1103, 0xD4FC, 0xD4FC, 0x1028, 0xD4FD, 0xD4FE, 0x1118,
- 0xD5A1, 0xD5A4, 0x111A, 0xD5A5, 0xD5A5, 0x16A8, 0xD5A6, 0xD5AA, 0x111E,
- 0xD5AB, 0xD5AB, 0x102B, 0xD5AC, 0xD5AD, 0x1123, 0xD5AE, 0xD5AE, 0x1060,
- 0xD5AF, 0xD5FE, 0x1125, 0xD6A1, 0xD6B7, 0x1175, 0xD6B8, 0xD6B8, 0x1047,
- 0xD6B9, 0xD6CC, 0x118C, 0xD6CD, 0xD6CD, 0x104C, 0xD6CE, 0xD6FE, 0x11A0,
- 0xD7A1, 0xD7CA, 0x11D1, 0xD7CB, 0xD7CB, 0x15B0, 0xD7CC, 0xD7E3, 0x11FB,
- 0xD7E4, 0xD7E4, 0x1918, 0xD7E5, 0xD7FE, 0x1213, 0xD8A1, 0xD8FE, 0x122D,
- 0xD9A1, 0xD9FE, 0x128B, 0xDAA1, 0xDAFE, 0x12E9, 0xDBA1, 0xDBC4, 0x1347,
- 0xDBC5, 0xDBC5, 0x141F, 0xDBC6, 0xDBE3, 0x136B, 0xDBE4, 0xDBE4, 0x133A,
- 0xDBE5, 0xDBFE, 0x1389, 0xDCA1, 0xDCA4, 0x13A3, 0xDCA5, 0xDCA5, 0x1D5E,
- 0xDCA6, 0xDCFE, 0x13A7, 0xDDA1, 0xDDA4, 0x1400, 0xDDA5, 0xDDA5, 0x13D7,
- 0xDDA6, 0xDDD4, 0x1404, 0xDDD5, 0xDDD5, 0x13F5, 0xDDD6, 0xDDF3, 0x1433,
- 0xDDF4, 0xDDF4, 0x1DB7, 0xDDF5, 0xDDFE, 0x1451, 0xDEA1, 0xDEFB, 0x145B,
- 0xDEFC, 0xDEFC, 0x15D0, 0xDEFD, 0xDEFD, 0x14B6, 0xDEFE, 0xDEFE, 0x14F7,
- 0xDFA1, 0xDFB2, 0x14B7, 0xDFB3, 0xDFB3, 0x1BAB, 0xDFB4, 0xDFE0, 0x14C9,
- 0xDFE1, 0xDFE1, 0x14F2, 0xDFE2, 0xDFE7, 0x14F6, 0xDFE8, 0xDFE8, 0x156D,
- 0xDFE9, 0xDFFE, 0x14FC, 0xE0A1, 0xE0F0, 0x1512, 0xE0F1, 0xE0F1, 0x1771,
- 0xE0F2, 0xE0FE, 0x1562, 0xE1A1, 0xE1AC, 0x156F, 0xE1AD, 0xE1AD, 0x1554,
- 0xE1AE, 0xE1EC, 0x157B, 0xE1ED, 0xE1ED, 0x14C5, 0xE1EE, 0xE1FE, 0x15BA,
- 0xE2A1, 0xE2FE, 0x15CB, 0xE3A1, 0xE3F4, 0x1629, 0xE3F5, 0xE3F5, 0x1B61,
- 0xE3F6, 0xE3FE, 0x167D, 0xE4A1, 0xE4A1, 0x1CCA, 0xE4A2, 0xE4A8, 0x1686,
- 0xE4A9, 0xE4A9, 0x162E, 0xE4AA, 0xE4FE, 0x168D, 0xE5A1, 0xE5AD, 0x16E2,
- 0xE5AE, 0xE5AE, 0x16F2, 0xE5AF, 0xE5B0, 0x16EF, 0xE5B1, 0xE5B2, 0x1149,
- 0xE5B3, 0xE5B8, 0x16F1, 0xE5B9, 0xE5B9, 0x114B, 0xE5BA, 0xE5BA, 0x16F7,
- 0xE5BB, 0xE5BC, 0x114D, 0xE5BD, 0xE5C3, 0x16F8, 0xE5C4, 0xE5C4, 0x114F,
- 0xE5C5, 0xE5CD, 0x16FF, 0xE5CE, 0xE5CE, 0x1153, 0xE5CF, 0xE5CF, 0x1708,
- 0xE5D0, 0xE5D0, 0x1154, 0xE5D1, 0xE5D1, 0x1709, 0xE5D2, 0xE5D2, 0x1155,
- 0xE5D3, 0xE5D5, 0x170A, 0xE5D6, 0xE5D6, 0x1157, 0xE5D7, 0xE5F9, 0x170D,
- 0xE5FA, 0xE5FB, 0x115A, 0xE5FC, 0xE5FC, 0x103F, 0xE5FD, 0xE5FD, 0x1730,
- 0xE5FE, 0xE5FE, 0x115C, 0xE6A1, 0xE6A1, 0x115F, 0xE6A2, 0xE6A3, 0x1731,
- 0xE6A4, 0xE6A4, 0x1161, 0xE6A5, 0xE6A6, 0x1733, 0xE6A7, 0xE6A7, 0x1162,
- 0xE6A8, 0xE6AC, 0x1735, 0xE6AD, 0xE6AD, 0x1165, 0xE6AE, 0xE6AE, 0x173A,
- 0xE6AF, 0xE6B1, 0x1167, 0xE6B2, 0xE6B2, 0x173B, 0xE6B3, 0xE6B3, 0x116A,
- 0xE6B4, 0xE6B6, 0x173C, 0xE6B7, 0xE6B8, 0x116B, 0xE6B9, 0xE6BB, 0x173F,
- 0xE6BC, 0xE6BC, 0x116F, 0xE6BD, 0xE6C3, 0x1742, 0xE6C4, 0xE6C4, 0x1040,
- 0xE6C5, 0xE6C5, 0x1749, 0xE6C6, 0xE6C7, 0x1171, 0xE6C8, 0xE6C9, 0x174A,
- 0xE6CA, 0xE6CA, 0x1041, 0xE6CB, 0xE6D1, 0x174C, 0xE6D2, 0xE6D2, 0x1174,
- 0xE6D3, 0xE6D5, 0x1753, 0xE6D6, 0xE6D6, 0x1175, 0xE6D7, 0xE6D8, 0x1756,
- 0xE6D9, 0xE6D9, 0x1176, 0xE6DA, 0xE6DB, 0x1758, 0xE6DC, 0xE6DC, 0x1042,
- 0xE6DD, 0xE6DE, 0x175A, 0xE6DF, 0xE6DF, 0x1177, 0xE6E0, 0xE6E0, 0x175C,
- 0xE6E1, 0xE6E1, 0x1178, 0xE6E2, 0xE6E3, 0x175D, 0xE6E4, 0xE6E4, 0x117A,
- 0xE6E5, 0xE6E5, 0x1179, 0xE6E6, 0xE6E6, 0x117B, 0xE6E7, 0xE6E7, 0x175F,
- 0xE6E8, 0xE6E8, 0x117C, 0xE6E9, 0xE6E9, 0x1760, 0xE6EA, 0xE6EB, 0x117E,
- 0xE6EC, 0xE6EC, 0x192F, 0xE6ED, 0xE6EE, 0x1761, 0xE6EF, 0xE6EF, 0x1181,
- 0xE6F0, 0xE6F0, 0x1763, 0xE6F1, 0xE6F1, 0x1182, 0xE6F2, 0xE6F2, 0x1554,
- 0xE6F3, 0xE6F4, 0x1764, 0xE6F5, 0xE6F5, 0x1183, 0xE6F6, 0xE6F6, 0x1043,
- 0xE6F7, 0xE6F7, 0x1046, 0xE6F8, 0xE6F8, 0x1766, 0xE6F9, 0xE6F9, 0x1185,
- 0xE6FA, 0xE6FE, 0x1767, 0xE7A1, 0xE7A1, 0x1187, 0xE7A2, 0xE7A5, 0x176C,
- 0xE7A6, 0xE7A6, 0x1188, 0xE7A7, 0xE7A8, 0x1770, 0xE7A9, 0xE7A9, 0x1189,
- 0xE7AA, 0xE7AA, 0x118B, 0xE7AB, 0xE7AB, 0x1772, 0xE7AC, 0xE7AC, 0x1047,
- 0xE7AD, 0xE7AD, 0x118D, 0xE7AE, 0xE7AF, 0x1773, 0xE7B0, 0xE7B0, 0x118E,
- 0xE7B1, 0xE7BE, 0x1775, 0xE7BF, 0xE7BF, 0x118F, 0xE7C0, 0xE7C0, 0x1783,
- 0xE7C1, 0xE7C1, 0x1E67, 0xE7C2, 0xE7C5, 0x1784, 0xE7C6, 0xE7C6, 0x1191,
- 0xE7C7, 0xE7C7, 0x1193, 0xE7C8, 0xE7CA, 0x1788, 0xE7CB, 0xE7CB, 0x1195,
- 0xE7CC, 0xE7CC, 0x178B, 0xE7CD, 0xE7CD, 0x1196, 0xE7CE, 0xE7CE, 0x178C,
- 0xE7CF, 0xE7D0, 0x1197, 0xE7D1, 0xE7D2, 0x178D, 0xE7D3, 0xE7D3, 0x119A,
- 0xE7D4, 0xE7DE, 0x178F, 0xE7DF, 0xE7DF, 0x119C, 0xE7E0, 0xE7E3, 0x179A,
- 0xE7E4, 0xE7E4, 0x119D, 0xE7E5, 0xE7E5, 0x179E, 0xE7E6, 0xE7E6, 0x119E,
- 0xE7E7, 0xE7F6, 0x179F, 0xE7F7, 0xE7F7, 0x16A5, 0xE7F8, 0xE7FE, 0x17AF,
- 0xE8A1, 0xE8E6, 0x17B6, 0xE8E7, 0xE8E8, 0x11C7, 0xE8E9, 0xE8EF, 0x17FC,
- 0xE8F0, 0xE8F0, 0x11C9, 0xE8F1, 0xE8F1, 0x1054, 0xE8F2, 0xE8F6, 0x1803,
- 0xE8F7, 0xE8F7, 0x11CB, 0xE8F8, 0xE8F8, 0x1808, 0xE8F9, 0xE8F9, 0x16A8,
- 0xE8FA, 0xE8FA, 0x1809, 0xE8FB, 0xE8FB, 0x11CC, 0xE8FC, 0xE8FD, 0x180A,
- 0xE8FE, 0xE8FE, 0x11CD, 0xE9A1, 0xE9A6, 0x180C, 0xE9A7, 0xE9A7, 0x11D0,
- 0xE9A8, 0xE9AB, 0x1812, 0xE9AC, 0xE9AC, 0x11D1, 0xE9AD, 0xE9CB, 0x1816,
- 0xE9CC, 0xE9CC, 0x11D3, 0xE9CD, 0xE9F6, 0x1835, 0xE9F7, 0xE9F7, 0x1F34,
- 0xE9F8, 0xE9FE, 0x185F, 0xEAA1, 0xEAC0, 0x1866, 0xEAC1, 0xEAC1, 0x17EB,
- 0xEAC2, 0xEAE4, 0x1886, 0xEAE5, 0xEAE5, 0x11E1, 0xEAE6, 0xEAF3, 0x18A9,
- 0xEAF4, 0xEAF4, 0x1057, 0xEAF5, 0xEAF6, 0x18B7, 0xEAF7, 0xEAF7, 0x11E3,
- 0xEAF8, 0xEAFB, 0x18B9, 0xEAFC, 0xEAFC, 0x11E5, 0xEAFD, 0xEAFD, 0x18BD,
- 0xEAFE, 0xEAFE, 0x11E6, 0xEBA1, 0xEBA3, 0x18BE, 0xEBA4, 0xEBA4, 0x11E8,
- 0xEBA5, 0xEBA6, 0x18C1, 0xEBA7, 0xEBA7, 0x11EA, 0xEBA8, 0xEBA8, 0x18C3,
- 0xEBA9, 0xEBA9, 0x11EC, 0xEBAA, 0xEBAA, 0x1058, 0xEBAB, 0xEBB9, 0x18C4,
- 0xEBBA, 0xEBBB, 0x11EE, 0xEBBC, 0xEBBC, 0x18D3, 0xEBBD, 0xEBBD, 0x11F0,
- 0xEBBE, 0xEBC0, 0x18D4, 0xEBC1, 0xEBC1, 0x11F1, 0xEBC2, 0xEBC2, 0x11F3,
- 0xEBC3, 0xEBC5, 0x18D7, 0xEBC6, 0xEBC7, 0x11F4, 0xEBC8, 0xEBCB, 0x18DA,
- 0xEBCC, 0xEBCC, 0x11F7, 0xEBCD, 0xEBCE, 0x18DE, 0xEBCF, 0xEBD1, 0x11F8,
- 0xEBD2, 0xEBD2, 0x15B0, 0xEBD3, 0xEBD7, 0x18E0, 0xEBD8, 0xEBD8, 0x11FB,
- 0xEBD9, 0xEBFE, 0x18E5, 0xECA1, 0xECA5, 0x190B, 0xECA6, 0xECA6, 0x1206,
- 0xECA7, 0xECA7, 0x1208, 0xECA8, 0xECA9, 0x1910, 0xECAA, 0xECAA, 0x120A,
- 0xECAB, 0xECAE, 0x1912, 0xECAF, 0xECAF, 0x173E, 0xECB0, 0xECB1, 0x120C,
- 0xECB2, 0xECB2, 0x105B, 0xECB3, 0xECB4, 0x1916, 0xECB5, 0xECB5, 0x1211,
- 0xECB6, 0xECB7, 0x1918, 0xECB8, 0xECB8, 0x1213, 0xECB9, 0xECB9, 0x191A,
- 0xECBA, 0xECBA, 0x1215, 0xECBB, 0xECBF, 0x191B, 0xECC0, 0xECC1, 0x1218,
- 0xECC2, 0xECC4, 0x1920, 0xECC5, 0xECC5, 0x121A, 0xECC6, 0xECC6, 0x121C,
- 0xECC7, 0xECC8, 0x1923, 0xECC9, 0xECCA, 0x105C, 0xECCB, 0xECD4, 0x1925,
- 0xECD5, 0xECD5, 0x121E, 0xECD6, 0xECDC, 0x192F, 0xECDD, 0xECDE, 0x1220,
- 0xECDF, 0xECE0, 0x1936, 0xECE1, 0xECE1, 0x1222, 0xECE2, 0xECE3, 0x1938,
- 0xECE4, 0xECE4, 0x1224, 0xECE5, 0xECE6, 0x193A, 0xECE7, 0xECE8, 0x1225,
- 0xECE9, 0xECF6, 0x193C, 0xECF7, 0xECF8, 0x1227, 0xECF9, 0xECF9, 0x194A,
- 0xECFA, 0xECFA, 0x122A, 0xECFB, 0xECFE, 0x194B, 0xEDA1, 0xEDA3, 0x122D,
- 0xEDA4, 0xEDED, 0x194F, 0xEDEE, 0xEDEE, 0x14E7, 0xEDEF, 0xEDFE, 0x1999,
- 0xEEA1, 0xEEDA, 0x19A9, 0xEEDB, 0xEEDB, 0x195E, 0xEEDC, 0xEEFE, 0x19E3,
- 0xEFA1, 0xEFFE, 0x1A06, 0xF0A1, 0xF0FE, 0x1A64, 0xF1A1, 0xF1FE, 0x1AC2,
- 0xF2A1, 0xF2BC, 0x1B20, 0xF2BD, 0xF2BD, 0x1663, 0xF2BE, 0xF2F9, 0x1B3C,
- 0xF2FA, 0xF2FA, 0x168B, 0xF2FB, 0xF2FE, 0x1B78, 0xF3A1, 0xF3B0, 0x1B7C,
- 0xF3B1, 0xF3B1, 0x105F, 0xF3B2, 0xF3FE, 0x1B8C, 0xF4A1, 0xF4A6, 0x1BD9,
- 0xF4A7, 0xF4A7, 0x1954, 0xF4A8, 0xF4ED, 0x1BDF, 0xF4EE, 0xF4EE, 0x1A1C,
- 0xF4EF, 0xF4FE, 0x1C25, 0xF5A1, 0xF5FE, 0x1C35, 0xF6A1, 0xF6F3, 0x1C93,
- 0xF6F4, 0xF6F4, 0x10B7, 0xF6F5, 0xF6F5, 0x1CE6, 0xF6F6, 0xF6F6, 0x1BE3,
- 0xF6F7, 0xF6FE, 0x1CE7, 0xF7A1, 0xF7B7, 0x1CEF, 0xF7B8, 0xF7B8, 0x1097,
- 0xF7B9, 0xF7C7, 0x1D06, 0xF7C8, 0xF7C8, 0x10AA, 0xF7C9, 0xF7D2, 0x1D15,
- 0xF7D3, 0xF7D3, 0x10F4, 0xF7D4, 0xF7FE, 0x1D1F, 0xF8A1, 0xF8DA, 0x1D4A,
- 0xF8DB, 0xF8DB, 0x1D94, 0xF8DC, 0xF8EF, 0x1D84, 0xF8F0, 0xF8F0, 0x13E0,
- 0xF8F1, 0xF8FE, 0x1D98, 0xF9A1, 0xF9FE, 0x1DA6, 0xFAA1, 0xFAA1, 0x1E1D,
- 0xFAA2, 0xFAA2, 0x0DE6, 0xFAA3, 0xFAE5, 0x1E04, 0xFAE6, 0xFAE6, 0x0E3C,
- 0xFAE7, 0xFAFE, 0x1E47, 0xFBA1, 0xFBFE, 0x1E5F, 0xFCA1, 0xFCA8, 0x1EBD,
- 0xFCA9, 0xFCA9, 0x0EE7, 0xFCAA, 0xFCFE, 0x1EC5, 0xFDA1, 0xFDFE, 0x1F1A,
-};
+// 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
+
+extern const unsigned short g_FXCMAP_KSCms_UHC_HW_H_1[675 * 3] = {
+ 0x0020, 0x007E, 0x1F9E, 0x8141, 0x815A, 0x2475, 0x8161, 0x817A, 0x248F,
+ 0x8181, 0x81FE, 0x24A9, 0x8241, 0x825A, 0x2527, 0x8261, 0x827A, 0x2541,
+ 0x8281, 0x82FE, 0x255B, 0x8341, 0x835A, 0x25D9, 0x8361, 0x837A, 0x25F3,
+ 0x8381, 0x83FE, 0x260D, 0x8441, 0x845A, 0x268B, 0x8461, 0x847A, 0x26A5,
+ 0x8481, 0x84FE, 0x26BF, 0x8541, 0x855A, 0x273D, 0x8561, 0x857A, 0x2757,
+ 0x8581, 0x85FE, 0x2771, 0x8641, 0x865A, 0x27EF, 0x8661, 0x867A, 0x2809,
+ 0x8681, 0x86FE, 0x2823, 0x8741, 0x875A, 0x28A1, 0x8761, 0x877A, 0x28BB,
+ 0x8781, 0x87FE, 0x28D5, 0x8841, 0x885A, 0x2953, 0x8861, 0x887A, 0x296D,
+ 0x8881, 0x88FE, 0x2987, 0x8941, 0x895A, 0x2A05, 0x8961, 0x897A, 0x2A1F,
+ 0x8981, 0x89FE, 0x2A39, 0x8A41, 0x8A5A, 0x2AB7, 0x8A61, 0x8A7A, 0x2AD1,
+ 0x8A81, 0x8AFE, 0x2AEB, 0x8B41, 0x8B5A, 0x2B69, 0x8B61, 0x8B7A, 0x2B83,
+ 0x8B81, 0x8BFE, 0x2B9D, 0x8C41, 0x8C5A, 0x2C1B, 0x8C61, 0x8C7A, 0x2C35,
+ 0x8C81, 0x8CFE, 0x2C4F, 0x8D41, 0x8D5A, 0x2CCD, 0x8D61, 0x8D7A, 0x2CE7,
+ 0x8D81, 0x8DFE, 0x2D01, 0x8E41, 0x8E5A, 0x2D7F, 0x8E61, 0x8E7A, 0x2D99,
+ 0x8E81, 0x8EFE, 0x2DB3, 0x8F41, 0x8F5A, 0x2E31, 0x8F61, 0x8F7A, 0x2E4B,
+ 0x8F81, 0x8FFE, 0x2E65, 0x9041, 0x905A, 0x2EE3, 0x9061, 0x907A, 0x2EFD,
+ 0x9081, 0x90FE, 0x2F17, 0x9141, 0x915A, 0x2F95, 0x9161, 0x917A, 0x2FAF,
+ 0x9181, 0x91FE, 0x2FC9, 0x9241, 0x925A, 0x3047, 0x9261, 0x927A, 0x3061,
+ 0x9281, 0x92FE, 0x307B, 0x9341, 0x935A, 0x30F9, 0x9361, 0x937A, 0x3113,
+ 0x9381, 0x93FE, 0x312D, 0x9441, 0x945A, 0x31AB, 0x9461, 0x947A, 0x31C5,
+ 0x9481, 0x94FE, 0x31DF, 0x9541, 0x955A, 0x325D, 0x9561, 0x957A, 0x3277,
+ 0x9581, 0x95FE, 0x3291, 0x9641, 0x965A, 0x330F, 0x9661, 0x967A, 0x3329,
+ 0x9681, 0x96FE, 0x3343, 0x9741, 0x975A, 0x33C1, 0x9761, 0x977A, 0x33DB,
+ 0x9781, 0x97FE, 0x33F5, 0x9841, 0x985A, 0x3473, 0x9861, 0x987A, 0x348D,
+ 0x9881, 0x98FE, 0x34A7, 0x9941, 0x995A, 0x3525, 0x9961, 0x997A, 0x353F,
+ 0x9981, 0x99FE, 0x3559, 0x9A41, 0x9A5A, 0x35D7, 0x9A61, 0x9A7A, 0x35F1,
+ 0x9A81, 0x9AFE, 0x360B, 0x9B41, 0x9B5A, 0x3689, 0x9B61, 0x9B7A, 0x36A3,
+ 0x9B81, 0x9BFE, 0x36BD, 0x9C41, 0x9C5A, 0x373B, 0x9C61, 0x9C7A, 0x3755,
+ 0x9C81, 0x9CFE, 0x376F, 0x9D41, 0x9D5A, 0x37ED, 0x9D61, 0x9D7A, 0x3807,
+ 0x9D81, 0x9DFE, 0x3821, 0x9E41, 0x9E5A, 0x389F, 0x9E61, 0x9E7A, 0x38B9,
+ 0x9E81, 0x9EFE, 0x38D3, 0x9F41, 0x9F5A, 0x3951, 0x9F61, 0x9F7A, 0x396B,
+ 0x9F81, 0x9FFE, 0x3985, 0xA041, 0xA05A, 0x3A03, 0xA061, 0xA07A, 0x3A1D,
+ 0xA081, 0xA0FE, 0x3A37, 0xA141, 0xA15A, 0x3AB5, 0xA161, 0xA17A, 0x3ACF,
+ 0xA181, 0xA1A0, 0x3AE9, 0xA1A1, 0xA1FE, 0x0065, 0xA241, 0xA25A, 0x3B09,
+ 0xA261, 0xA27A, 0x3B23, 0xA281, 0xA2A0, 0x3B3D, 0xA2A1, 0xA2E5, 0x00C3,
+ 0xA341, 0xA35A, 0x3B5D, 0xA361, 0xA37A, 0x3B77, 0xA381, 0xA3A0, 0x3B91,
+ 0xA3A1, 0xA3FE, 0x0108, 0xA441, 0xA45A, 0x3BB1, 0xA461, 0xA47A, 0x3BCB,
+ 0xA481, 0xA4A0, 0x3BE5, 0xA4A1, 0xA4D3, 0x0166, 0xA4D5, 0xA4FE, 0x0199,
+ 0xA541, 0xA55A, 0x3C05, 0xA561, 0xA57A, 0x3C1F, 0xA581, 0xA5A0, 0x3C39,
+ 0xA5A1, 0xA5AA, 0x01C3, 0xA5B0, 0xA5B9, 0x01CD, 0xA5C1, 0xA5D8, 0x01D7,
+ 0xA5E1, 0xA5F8, 0x01EF, 0xA641, 0xA65A, 0x3C59, 0xA661, 0xA67A, 0x3C73,
+ 0xA681, 0xA6A0, 0x3C8D, 0xA6A1, 0xA6E4, 0x0207, 0xA741, 0xA75A, 0x3CAD,
+ 0xA761, 0xA77A, 0x3CC7, 0xA781, 0xA7A0, 0x3CE1, 0xA7A1, 0xA7EF, 0x024B,
+ 0xA841, 0xA85A, 0x3D01, 0xA861, 0xA87A, 0x3D1B, 0xA881, 0xA8A0, 0x3D35,
+ 0xA8A1, 0xA8A4, 0x029A, 0xA8A6, 0xA8A6, 0x029E, 0xA8A8, 0xA8AF, 0x029F,
+ 0xA8B1, 0xA8FE, 0x02A7, 0xA941, 0xA95A, 0x3D55, 0xA961, 0xA97A, 0x3D6F,
+ 0xA981, 0xA9A0, 0x3D89, 0xA9A1, 0xA9FE, 0x02F5, 0xAA41, 0xAA5A, 0x3DA9,
+ 0xAA61, 0xAA7A, 0x3DC3, 0xAA81, 0xAAA0, 0x3DDD, 0xAAA1, 0xAAF3, 0x0353,
+ 0xAB41, 0xAB5A, 0x3DFD, 0xAB61, 0xAB7A, 0x3E17, 0xAB81, 0xABA0, 0x3E31,
+ 0xABA1, 0xABF6, 0x03A6, 0xAC41, 0xAC5A, 0x3E51, 0xAC61, 0xAC7A, 0x3E6B,
+ 0xAC81, 0xACA0, 0x3E85, 0xACA1, 0xACC1, 0x03FC, 0xACD1, 0xACF1, 0x041D,
+ 0xAD41, 0xAD5A, 0x3EA5, 0xAD61, 0xAD7A, 0x3EBF, 0xAD81, 0xADA0, 0x3ED9,
+ 0xAE41, 0xAE5A, 0x3EF9, 0xAE61, 0xAE7A, 0x3F13, 0xAE81, 0xAEA0, 0x3F2D,
+ 0xAF41, 0xAF5A, 0x3F4D, 0xAF61, 0xAF7A, 0x3F67, 0xAF81, 0xAFA0, 0x3F81,
+ 0xB041, 0xB05A, 0x3FA1, 0xB061, 0xB07A, 0x3FBB, 0xB081, 0xB0A0, 0x3FD5,
+ 0xB0A1, 0xB0FE, 0x043E, 0xB141, 0xB15A, 0x3FF5, 0xB161, 0xB17A, 0x400F,
+ 0xB181, 0xB1A0, 0x4029, 0xB1A1, 0xB1FE, 0x049C, 0xB241, 0xB25A, 0x4049,
+ 0xB261, 0xB27A, 0x4063, 0xB281, 0xB2A0, 0x407D, 0xB2A1, 0xB2FE, 0x04FA,
+ 0xB341, 0xB35A, 0x409D, 0xB361, 0xB37A, 0x40B7, 0xB381, 0xB3A0, 0x40D1,
+ 0xB3A1, 0xB3FE, 0x0558, 0xB441, 0xB45A, 0x40F1, 0xB461, 0xB47A, 0x410B,
+ 0xB481, 0xB4A0, 0x4125, 0xB4A1, 0xB4FE, 0x05B6, 0xB541, 0xB55A, 0x4145,
+ 0xB561, 0xB57A, 0x415F, 0xB581, 0xB5A0, 0x4179, 0xB5A1, 0xB5FE, 0x0614,
+ 0xB641, 0xB65A, 0x4199, 0xB661, 0xB67A, 0x41B3, 0xB681, 0xB6A0, 0x41CD,
+ 0xB6A1, 0xB6FE, 0x0672, 0xB741, 0xB75A, 0x41ED, 0xB761, 0xB77A, 0x4207,
+ 0xB781, 0xB7A0, 0x4221, 0xB7A1, 0xB7FE, 0x06D0, 0xB841, 0xB85A, 0x4241,
+ 0xB861, 0xB87A, 0x425B, 0xB881, 0xB8A0, 0x4275, 0xB8A1, 0xB8FE, 0x072E,
+ 0xB941, 0xB95A, 0x4295, 0xB961, 0xB97A, 0x42AF, 0xB981, 0xB9A0, 0x42C9,
+ 0xB9A1, 0xB9FE, 0x078C, 0xBA41, 0xBA5A, 0x42E9, 0xBA61, 0xBA7A, 0x4303,
+ 0xBA81, 0xBAA0, 0x431D, 0xBAA1, 0xBAFE, 0x07EA, 0xBB41, 0xBB5A, 0x433D,
+ 0xBB61, 0xBB7A, 0x4357, 0xBB81, 0xBBA0, 0x4371, 0xBBA1, 0xBBFE, 0x0848,
+ 0xBC41, 0xBC5A, 0x4391, 0xBC61, 0xBC7A, 0x43AB, 0xBC81, 0xBCA0, 0x43C5,
+ 0xBCA1, 0xBCFE, 0x08A6, 0xBD41, 0xBD5A, 0x43E5, 0xBD61, 0xBD7A, 0x43FF,
+ 0xBD81, 0xBDA0, 0x4419, 0xBDA1, 0xBDFE, 0x0904, 0xBE41, 0xBE5A, 0x4439,
+ 0xBE61, 0xBE7A, 0x4453, 0xBE81, 0xBEA0, 0x446D, 0xBEA1, 0xBEFE, 0x0962,
+ 0xBF41, 0xBF5A, 0x448D, 0xBF61, 0xBF7A, 0x44A7, 0xBF81, 0xBFA0, 0x44C1,
+ 0xBFA1, 0xBFFE, 0x09C0, 0xC041, 0xC05A, 0x44E1, 0xC061, 0xC07A, 0x44FB,
+ 0xC081, 0xC0A0, 0x4515, 0xC0A1, 0xC0FE, 0x0A1E, 0xC141, 0xC15A, 0x4535,
+ 0xC161, 0xC17A, 0x454F, 0xC181, 0xC1A0, 0x4569, 0xC1A1, 0xC1FE, 0x0A7C,
+ 0xC241, 0xC25A, 0x4589, 0xC261, 0xC27A, 0x45A3, 0xC281, 0xC2A0, 0x45BD,
+ 0xC2A1, 0xC2FE, 0x0ADA, 0xC341, 0xC35A, 0x45DD, 0xC361, 0xC37A, 0x45F7,
+ 0xC381, 0xC3A0, 0x4611, 0xC3A1, 0xC3FE, 0x0B38, 0xC441, 0xC45A, 0x4631,
+ 0xC461, 0xC47A, 0x464B, 0xC481, 0xC4A0, 0x4665, 0xC4A1, 0xC4FE, 0x0B96,
+ 0xC541, 0xC55A, 0x4685, 0xC561, 0xC57A, 0x469F, 0xC581, 0xC5A0, 0x46B9,
+ 0xC5A1, 0xC5FE, 0x0BF4, 0xC641, 0xC652, 0x46D9, 0xC6A1, 0xC6FE, 0x0C52,
+ 0xC7A1, 0xC7FE, 0x0CB0, 0xC8A1, 0xC8FE, 0x0D0E, 0xCAA1, 0xCAFE, 0x0D6C,
+ 0xCBA1, 0xCBCF, 0x0DCA, 0xCBD0, 0xCBD0, 0x1014, 0xCBD1, 0xCBD5, 0x0DF9,
+ 0xCBD6, 0xCBD6, 0x0E5E, 0xCBD7, 0xCBE6, 0x0DFE, 0xCBE7, 0xCBE7, 0x1B8D,
+ 0xCBE8, 0xCBFE, 0x0E0E, 0xCCA1, 0xCCFE, 0x0E25, 0xCDA1, 0xCDCE, 0x0E83,
+ 0xCDCF, 0xCDCF, 0x0D84, 0xCDD0, 0xCDE7, 0x0EB1, 0xCDE8, 0xCDE8, 0x1EDC,
+ 0xCDE9, 0xCDFE, 0x0EC9, 0xCEA1, 0xCEAC, 0x0EDF, 0xCEAD, 0xCEAD, 0x0EDA,
+ 0xCEAE, 0xCEFE, 0x0EEB, 0xCFA1, 0xCFFA, 0x0F3C, 0xCFFB, 0xCFFB, 0x0F3E,
+ 0xCFFC, 0xCFFE, 0x0F96, 0xD0A1, 0xD0A1, 0x0F99, 0xD0A2, 0xD0A2, 0x0F6A,
+ 0xD0A3, 0xD0B7, 0x0F9A, 0xD0B8, 0xD0B8, 0x0F6A, 0xD0B9, 0xD0CF, 0x0FAF,
+ 0xD0D0, 0xD0D0, 0x0E7C, 0xD0D1, 0xD0DC, 0x0FC6, 0xD0DD, 0xD0DD, 0x1023,
+ 0xD0DE, 0xD0FE, 0x0FD2, 0xD1A1, 0xD1D3, 0x0FF3, 0xD1D4, 0xD1D4, 0x1116,
+ 0xD1D5, 0xD1D5, 0x103C, 0xD1D6, 0xD1D7, 0x1026, 0xD1D8, 0xD1D8, 0x1117,
+ 0xD1D9, 0xD1DA, 0x1028, 0xD1DB, 0xD1E0, 0x1118, 0xD1E1, 0xD1E1, 0x102A,
+ 0xD1E2, 0xD1E2, 0x16A8, 0xD1E3, 0xD1E5, 0x111E, 0xD1E6, 0xD1E6, 0x1122,
+ 0xD1E7, 0xD1E7, 0x102B, 0xD1E8, 0xD1EB, 0x1123, 0xD1EC, 0xD1EC, 0x102C,
+ 0xD1ED, 0xD1ED, 0x1127, 0xD1EE, 0xD1EE, 0x102D, 0xD1EF, 0xD1F0, 0x112A,
+ 0xD1F1, 0xD1F1, 0x102E, 0xD1F2, 0xD1F2, 0x112C, 0xD1F3, 0xD1F5, 0x102F,
+ 0xD1F6, 0xD1F6, 0x112F, 0xD1F7, 0xD1F9, 0x1032, 0xD1FA, 0xD1FA, 0x1133,
+ 0xD1FB, 0xD1FB, 0x1035, 0xD1FC, 0xD1FD, 0x1136, 0xD1FE, 0xD1FE, 0x1139,
+ 0xD2A1, 0xD2A1, 0x1036, 0xD2A2, 0xD2A3, 0x113A, 0xD2A4, 0xD2A6, 0x1037,
+ 0xD2A7, 0xD2AA, 0x113C, 0xD2AB, 0xD2AB, 0x1143, 0xD2AC, 0xD2AC, 0x103A,
+ 0xD2AD, 0xD2AD, 0x1144, 0xD2AE, 0xD2B1, 0x103B, 0xD2B2, 0xD2B2, 0x1148,
+ 0xD2B3, 0xD2BD, 0x103F, 0xD2BE, 0xD2BE, 0x119F, 0xD2BF, 0xD2C1, 0x104A,
+ 0xD2C2, 0xD2C3, 0x11A1, 0xD2C4, 0xD2C4, 0x11A5, 0xD2C5, 0xD2C5, 0x104D,
+ 0xD2C6, 0xD2CA, 0x11A6, 0xD2CB, 0xD2CB, 0x11AC, 0xD2CC, 0xD2CC, 0x104E,
+ 0xD2CD, 0xD2CE, 0x11AD, 0xD2CF, 0xD2D4, 0x11B0, 0xD2D5, 0xD2D7, 0x11B7,
+ 0xD2D8, 0xD2D8, 0x104F, 0xD2D9, 0xD2DA, 0x11BD, 0xD2DB, 0xD2DD, 0x1050,
+ 0xD2DE, 0xD2DF, 0x11C1, 0xD2E0, 0xD2E0, 0x1053, 0xD2E1, 0xD2E1, 0x11C3,
+ 0xD2E2, 0xD2E2, 0x11C6, 0xD2E3, 0xD2E3, 0x1054, 0xD2E4, 0xD2E4, 0x11D4,
+ 0xD2E5, 0xD2E8, 0x11D6, 0xD2E9, 0xD2EA, 0x11DB, 0xD2EB, 0xD2EB, 0x11E0,
+ 0xD2EC, 0xD2EF, 0x1055, 0xD2F0, 0xD2F3, 0x11FC, 0xD2F4, 0xD2F5, 0x1201,
+ 0xD2F6, 0xD2F6, 0x1059, 0xD2F7, 0xD2F8, 0x1203, 0xD2F9, 0xD2FE, 0x105A,
+ 0xD3A1, 0xD3FE, 0x1060, 0xD4A1, 0xD4E5, 0x10BE, 0xD4E6, 0xD4E6, 0x10DE,
+ 0xD4E7, 0xD4FB, 0x1103, 0xD4FC, 0xD4FC, 0x1028, 0xD4FD, 0xD4FE, 0x1118,
+ 0xD5A1, 0xD5A4, 0x111A, 0xD5A5, 0xD5A5, 0x16A8, 0xD5A6, 0xD5AA, 0x111E,
+ 0xD5AB, 0xD5AB, 0x102B, 0xD5AC, 0xD5AD, 0x1123, 0xD5AE, 0xD5AE, 0x1060,
+ 0xD5AF, 0xD5FE, 0x1125, 0xD6A1, 0xD6B7, 0x1175, 0xD6B8, 0xD6B8, 0x1047,
+ 0xD6B9, 0xD6CC, 0x118C, 0xD6CD, 0xD6CD, 0x104C, 0xD6CE, 0xD6FE, 0x11A0,
+ 0xD7A1, 0xD7CA, 0x11D1, 0xD7CB, 0xD7CB, 0x15B0, 0xD7CC, 0xD7E3, 0x11FB,
+ 0xD7E4, 0xD7E4, 0x1918, 0xD7E5, 0xD7FE, 0x1213, 0xD8A1, 0xD8FE, 0x122D,
+ 0xD9A1, 0xD9FE, 0x128B, 0xDAA1, 0xDAFE, 0x12E9, 0xDBA1, 0xDBC4, 0x1347,
+ 0xDBC5, 0xDBC5, 0x141F, 0xDBC6, 0xDBE3, 0x136B, 0xDBE4, 0xDBE4, 0x133A,
+ 0xDBE5, 0xDBFE, 0x1389, 0xDCA1, 0xDCA4, 0x13A3, 0xDCA5, 0xDCA5, 0x1D5E,
+ 0xDCA6, 0xDCFE, 0x13A7, 0xDDA1, 0xDDA4, 0x1400, 0xDDA5, 0xDDA5, 0x13D7,
+ 0xDDA6, 0xDDD4, 0x1404, 0xDDD5, 0xDDD5, 0x13F5, 0xDDD6, 0xDDF3, 0x1433,
+ 0xDDF4, 0xDDF4, 0x1DB7, 0xDDF5, 0xDDFE, 0x1451, 0xDEA1, 0xDEFB, 0x145B,
+ 0xDEFC, 0xDEFC, 0x15D0, 0xDEFD, 0xDEFD, 0x14B6, 0xDEFE, 0xDEFE, 0x14F7,
+ 0xDFA1, 0xDFB2, 0x14B7, 0xDFB3, 0xDFB3, 0x1BAB, 0xDFB4, 0xDFE0, 0x14C9,
+ 0xDFE1, 0xDFE1, 0x14F2, 0xDFE2, 0xDFE7, 0x14F6, 0xDFE8, 0xDFE8, 0x156D,
+ 0xDFE9, 0xDFFE, 0x14FC, 0xE0A1, 0xE0F0, 0x1512, 0xE0F1, 0xE0F1, 0x1771,
+ 0xE0F2, 0xE0FE, 0x1562, 0xE1A1, 0xE1AC, 0x156F, 0xE1AD, 0xE1AD, 0x1554,
+ 0xE1AE, 0xE1EC, 0x157B, 0xE1ED, 0xE1ED, 0x14C5, 0xE1EE, 0xE1FE, 0x15BA,
+ 0xE2A1, 0xE2FE, 0x15CB, 0xE3A1, 0xE3F4, 0x1629, 0xE3F5, 0xE3F5, 0x1B61,
+ 0xE3F6, 0xE3FE, 0x167D, 0xE4A1, 0xE4A1, 0x1CCA, 0xE4A2, 0xE4A8, 0x1686,
+ 0xE4A9, 0xE4A9, 0x162E, 0xE4AA, 0xE4FE, 0x168D, 0xE5A1, 0xE5AD, 0x16E2,
+ 0xE5AE, 0xE5AE, 0x16F2, 0xE5AF, 0xE5B0, 0x16EF, 0xE5B1, 0xE5B2, 0x1149,
+ 0xE5B3, 0xE5B8, 0x16F1, 0xE5B9, 0xE5B9, 0x114B, 0xE5BA, 0xE5BA, 0x16F7,
+ 0xE5BB, 0xE5BC, 0x114D, 0xE5BD, 0xE5C3, 0x16F8, 0xE5C4, 0xE5C4, 0x114F,
+ 0xE5C5, 0xE5CD, 0x16FF, 0xE5CE, 0xE5CE, 0x1153, 0xE5CF, 0xE5CF, 0x1708,
+ 0xE5D0, 0xE5D0, 0x1154, 0xE5D1, 0xE5D1, 0x1709, 0xE5D2, 0xE5D2, 0x1155,
+ 0xE5D3, 0xE5D5, 0x170A, 0xE5D6, 0xE5D6, 0x1157, 0xE5D7, 0xE5F9, 0x170D,
+ 0xE5FA, 0xE5FB, 0x115A, 0xE5FC, 0xE5FC, 0x103F, 0xE5FD, 0xE5FD, 0x1730,
+ 0xE5FE, 0xE5FE, 0x115C, 0xE6A1, 0xE6A1, 0x115F, 0xE6A2, 0xE6A3, 0x1731,
+ 0xE6A4, 0xE6A4, 0x1161, 0xE6A5, 0xE6A6, 0x1733, 0xE6A7, 0xE6A7, 0x1162,
+ 0xE6A8, 0xE6AC, 0x1735, 0xE6AD, 0xE6AD, 0x1165, 0xE6AE, 0xE6AE, 0x173A,
+ 0xE6AF, 0xE6B1, 0x1167, 0xE6B2, 0xE6B2, 0x173B, 0xE6B3, 0xE6B3, 0x116A,
+ 0xE6B4, 0xE6B6, 0x173C, 0xE6B7, 0xE6B8, 0x116B, 0xE6B9, 0xE6BB, 0x173F,
+ 0xE6BC, 0xE6BC, 0x116F, 0xE6BD, 0xE6C3, 0x1742, 0xE6C4, 0xE6C4, 0x1040,
+ 0xE6C5, 0xE6C5, 0x1749, 0xE6C6, 0xE6C7, 0x1171, 0xE6C8, 0xE6C9, 0x174A,
+ 0xE6CA, 0xE6CA, 0x1041, 0xE6CB, 0xE6D1, 0x174C, 0xE6D2, 0xE6D2, 0x1174,
+ 0xE6D3, 0xE6D5, 0x1753, 0xE6D6, 0xE6D6, 0x1175, 0xE6D7, 0xE6D8, 0x1756,
+ 0xE6D9, 0xE6D9, 0x1176, 0xE6DA, 0xE6DB, 0x1758, 0xE6DC, 0xE6DC, 0x1042,
+ 0xE6DD, 0xE6DE, 0x175A, 0xE6DF, 0xE6DF, 0x1177, 0xE6E0, 0xE6E0, 0x175C,
+ 0xE6E1, 0xE6E1, 0x1178, 0xE6E2, 0xE6E3, 0x175D, 0xE6E4, 0xE6E4, 0x117A,
+ 0xE6E5, 0xE6E5, 0x1179, 0xE6E6, 0xE6E6, 0x117B, 0xE6E7, 0xE6E7, 0x175F,
+ 0xE6E8, 0xE6E8, 0x117C, 0xE6E9, 0xE6E9, 0x1760, 0xE6EA, 0xE6EB, 0x117E,
+ 0xE6EC, 0xE6EC, 0x192F, 0xE6ED, 0xE6EE, 0x1761, 0xE6EF, 0xE6EF, 0x1181,
+ 0xE6F0, 0xE6F0, 0x1763, 0xE6F1, 0xE6F1, 0x1182, 0xE6F2, 0xE6F2, 0x1554,
+ 0xE6F3, 0xE6F4, 0x1764, 0xE6F5, 0xE6F5, 0x1183, 0xE6F6, 0xE6F6, 0x1043,
+ 0xE6F7, 0xE6F7, 0x1046, 0xE6F8, 0xE6F8, 0x1766, 0xE6F9, 0xE6F9, 0x1185,
+ 0xE6FA, 0xE6FE, 0x1767, 0xE7A1, 0xE7A1, 0x1187, 0xE7A2, 0xE7A5, 0x176C,
+ 0xE7A6, 0xE7A6, 0x1188, 0xE7A7, 0xE7A8, 0x1770, 0xE7A9, 0xE7A9, 0x1189,
+ 0xE7AA, 0xE7AA, 0x118B, 0xE7AB, 0xE7AB, 0x1772, 0xE7AC, 0xE7AC, 0x1047,
+ 0xE7AD, 0xE7AD, 0x118D, 0xE7AE, 0xE7AF, 0x1773, 0xE7B0, 0xE7B0, 0x118E,
+ 0xE7B1, 0xE7BE, 0x1775, 0xE7BF, 0xE7BF, 0x118F, 0xE7C0, 0xE7C0, 0x1783,
+ 0xE7C1, 0xE7C1, 0x1E67, 0xE7C2, 0xE7C5, 0x1784, 0xE7C6, 0xE7C6, 0x1191,
+ 0xE7C7, 0xE7C7, 0x1193, 0xE7C8, 0xE7CA, 0x1788, 0xE7CB, 0xE7CB, 0x1195,
+ 0xE7CC, 0xE7CC, 0x178B, 0xE7CD, 0xE7CD, 0x1196, 0xE7CE, 0xE7CE, 0x178C,
+ 0xE7CF, 0xE7D0, 0x1197, 0xE7D1, 0xE7D2, 0x178D, 0xE7D3, 0xE7D3, 0x119A,
+ 0xE7D4, 0xE7DE, 0x178F, 0xE7DF, 0xE7DF, 0x119C, 0xE7E0, 0xE7E3, 0x179A,
+ 0xE7E4, 0xE7E4, 0x119D, 0xE7E5, 0xE7E5, 0x179E, 0xE7E6, 0xE7E6, 0x119E,
+ 0xE7E7, 0xE7F6, 0x179F, 0xE7F7, 0xE7F7, 0x16A5, 0xE7F8, 0xE7FE, 0x17AF,
+ 0xE8A1, 0xE8E6, 0x17B6, 0xE8E7, 0xE8E8, 0x11C7, 0xE8E9, 0xE8EF, 0x17FC,
+ 0xE8F0, 0xE8F0, 0x11C9, 0xE8F1, 0xE8F1, 0x1054, 0xE8F2, 0xE8F6, 0x1803,
+ 0xE8F7, 0xE8F7, 0x11CB, 0xE8F8, 0xE8F8, 0x1808, 0xE8F9, 0xE8F9, 0x16A8,
+ 0xE8FA, 0xE8FA, 0x1809, 0xE8FB, 0xE8FB, 0x11CC, 0xE8FC, 0xE8FD, 0x180A,
+ 0xE8FE, 0xE8FE, 0x11CD, 0xE9A1, 0xE9A6, 0x180C, 0xE9A7, 0xE9A7, 0x11D0,
+ 0xE9A8, 0xE9AB, 0x1812, 0xE9AC, 0xE9AC, 0x11D1, 0xE9AD, 0xE9CB, 0x1816,
+ 0xE9CC, 0xE9CC, 0x11D3, 0xE9CD, 0xE9F6, 0x1835, 0xE9F7, 0xE9F7, 0x1F34,
+ 0xE9F8, 0xE9FE, 0x185F, 0xEAA1, 0xEAC0, 0x1866, 0xEAC1, 0xEAC1, 0x17EB,
+ 0xEAC2, 0xEAE4, 0x1886, 0xEAE5, 0xEAE5, 0x11E1, 0xEAE6, 0xEAF3, 0x18A9,
+ 0xEAF4, 0xEAF4, 0x1057, 0xEAF5, 0xEAF6, 0x18B7, 0xEAF7, 0xEAF7, 0x11E3,
+ 0xEAF8, 0xEAFB, 0x18B9, 0xEAFC, 0xEAFC, 0x11E5, 0xEAFD, 0xEAFD, 0x18BD,
+ 0xEAFE, 0xEAFE, 0x11E6, 0xEBA1, 0xEBA3, 0x18BE, 0xEBA4, 0xEBA4, 0x11E8,
+ 0xEBA5, 0xEBA6, 0x18C1, 0xEBA7, 0xEBA7, 0x11EA, 0xEBA8, 0xEBA8, 0x18C3,
+ 0xEBA9, 0xEBA9, 0x11EC, 0xEBAA, 0xEBAA, 0x1058, 0xEBAB, 0xEBB9, 0x18C4,
+ 0xEBBA, 0xEBBB, 0x11EE, 0xEBBC, 0xEBBC, 0x18D3, 0xEBBD, 0xEBBD, 0x11F0,
+ 0xEBBE, 0xEBC0, 0x18D4, 0xEBC1, 0xEBC1, 0x11F1, 0xEBC2, 0xEBC2, 0x11F3,
+ 0xEBC3, 0xEBC5, 0x18D7, 0xEBC6, 0xEBC7, 0x11F4, 0xEBC8, 0xEBCB, 0x18DA,
+ 0xEBCC, 0xEBCC, 0x11F7, 0xEBCD, 0xEBCE, 0x18DE, 0xEBCF, 0xEBD1, 0x11F8,
+ 0xEBD2, 0xEBD2, 0x15B0, 0xEBD3, 0xEBD7, 0x18E0, 0xEBD8, 0xEBD8, 0x11FB,
+ 0xEBD9, 0xEBFE, 0x18E5, 0xECA1, 0xECA5, 0x190B, 0xECA6, 0xECA6, 0x1206,
+ 0xECA7, 0xECA7, 0x1208, 0xECA8, 0xECA9, 0x1910, 0xECAA, 0xECAA, 0x120A,
+ 0xECAB, 0xECAE, 0x1912, 0xECAF, 0xECAF, 0x173E, 0xECB0, 0xECB1, 0x120C,
+ 0xECB2, 0xECB2, 0x105B, 0xECB3, 0xECB4, 0x1916, 0xECB5, 0xECB5, 0x1211,
+ 0xECB6, 0xECB7, 0x1918, 0xECB8, 0xECB8, 0x1213, 0xECB9, 0xECB9, 0x191A,
+ 0xECBA, 0xECBA, 0x1215, 0xECBB, 0xECBF, 0x191B, 0xECC0, 0xECC1, 0x1218,
+ 0xECC2, 0xECC4, 0x1920, 0xECC5, 0xECC5, 0x121A, 0xECC6, 0xECC6, 0x121C,
+ 0xECC7, 0xECC8, 0x1923, 0xECC9, 0xECCA, 0x105C, 0xECCB, 0xECD4, 0x1925,
+ 0xECD5, 0xECD5, 0x121E, 0xECD6, 0xECDC, 0x192F, 0xECDD, 0xECDE, 0x1220,
+ 0xECDF, 0xECE0, 0x1936, 0xECE1, 0xECE1, 0x1222, 0xECE2, 0xECE3, 0x1938,
+ 0xECE4, 0xECE4, 0x1224, 0xECE5, 0xECE6, 0x193A, 0xECE7, 0xECE8, 0x1225,
+ 0xECE9, 0xECF6, 0x193C, 0xECF7, 0xECF8, 0x1227, 0xECF9, 0xECF9, 0x194A,
+ 0xECFA, 0xECFA, 0x122A, 0xECFB, 0xECFE, 0x194B, 0xEDA1, 0xEDA3, 0x122D,
+ 0xEDA4, 0xEDED, 0x194F, 0xEDEE, 0xEDEE, 0x14E7, 0xEDEF, 0xEDFE, 0x1999,
+ 0xEEA1, 0xEEDA, 0x19A9, 0xEEDB, 0xEEDB, 0x195E, 0xEEDC, 0xEEFE, 0x19E3,
+ 0xEFA1, 0xEFFE, 0x1A06, 0xF0A1, 0xF0FE, 0x1A64, 0xF1A1, 0xF1FE, 0x1AC2,
+ 0xF2A1, 0xF2BC, 0x1B20, 0xF2BD, 0xF2BD, 0x1663, 0xF2BE, 0xF2F9, 0x1B3C,
+ 0xF2FA, 0xF2FA, 0x168B, 0xF2FB, 0xF2FE, 0x1B78, 0xF3A1, 0xF3B0, 0x1B7C,
+ 0xF3B1, 0xF3B1, 0x105F, 0xF3B2, 0xF3FE, 0x1B8C, 0xF4A1, 0xF4A6, 0x1BD9,
+ 0xF4A7, 0xF4A7, 0x1954, 0xF4A8, 0xF4ED, 0x1BDF, 0xF4EE, 0xF4EE, 0x1A1C,
+ 0xF4EF, 0xF4FE, 0x1C25, 0xF5A1, 0xF5FE, 0x1C35, 0xF6A1, 0xF6F3, 0x1C93,
+ 0xF6F4, 0xF6F4, 0x10B7, 0xF6F5, 0xF6F5, 0x1CE6, 0xF6F6, 0xF6F6, 0x1BE3,
+ 0xF6F7, 0xF6FE, 0x1CE7, 0xF7A1, 0xF7B7, 0x1CEF, 0xF7B8, 0xF7B8, 0x1097,
+ 0xF7B9, 0xF7C7, 0x1D06, 0xF7C8, 0xF7C8, 0x10AA, 0xF7C9, 0xF7D2, 0x1D15,
+ 0xF7D3, 0xF7D3, 0x10F4, 0xF7D4, 0xF7FE, 0x1D1F, 0xF8A1, 0xF8DA, 0x1D4A,
+ 0xF8DB, 0xF8DB, 0x1D94, 0xF8DC, 0xF8EF, 0x1D84, 0xF8F0, 0xF8F0, 0x13E0,
+ 0xF8F1, 0xF8FE, 0x1D98, 0xF9A1, 0xF9FE, 0x1DA6, 0xFAA1, 0xFAA1, 0x1E1D,
+ 0xFAA2, 0xFAA2, 0x0DE6, 0xFAA3, 0xFAE5, 0x1E04, 0xFAE6, 0xFAE6, 0x0E3C,
+ 0xFAE7, 0xFAFE, 0x1E47, 0xFBA1, 0xFBFE, 0x1E5F, 0xFCA1, 0xFCA8, 0x1EBD,
+ 0xFCA9, 0xFCA9, 0x0EE7, 0xFCAA, 0xFCFE, 0x1EC5, 0xFDA1, 0xFDFE, 0x1F1A,
+};
diff --git a/core/src/fpdfapi/fpdf_cmaps/Korea1/KSCms-UHC-H_1.cpp b/core/src/fpdfapi/fpdf_cmaps/Korea1/KSCms-UHC-H_1.cpp
index 6464f2f5e9..af28a4d523 100644
--- a/core/src/fpdfapi/fpdf_cmaps/Korea1/KSCms-UHC-H_1.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/Korea1/KSCms-UHC-H_1.cpp
@@ -1,233 +1,233 @@
-// 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
-
-extern const unsigned short g_FXCMAP_KSCms_UHC_H_1[675 * 3] = {
- 0x0020, 0x007E, 0x0001, 0x8141, 0x815A, 0x2475, 0x8161, 0x817A, 0x248F,
- 0x8181, 0x81FE, 0x24A9, 0x8241, 0x825A, 0x2527, 0x8261, 0x827A, 0x2541,
- 0x8281, 0x82FE, 0x255B, 0x8341, 0x835A, 0x25D9, 0x8361, 0x837A, 0x25F3,
- 0x8381, 0x83FE, 0x260D, 0x8441, 0x845A, 0x268B, 0x8461, 0x847A, 0x26A5,
- 0x8481, 0x84FE, 0x26BF, 0x8541, 0x855A, 0x273D, 0x8561, 0x857A, 0x2757,
- 0x8581, 0x85FE, 0x2771, 0x8641, 0x865A, 0x27EF, 0x8661, 0x867A, 0x2809,
- 0x8681, 0x86FE, 0x2823, 0x8741, 0x875A, 0x28A1, 0x8761, 0x877A, 0x28BB,
- 0x8781, 0x87FE, 0x28D5, 0x8841, 0x885A, 0x2953, 0x8861, 0x887A, 0x296D,
- 0x8881, 0x88FE, 0x2987, 0x8941, 0x895A, 0x2A05, 0x8961, 0x897A, 0x2A1F,
- 0x8981, 0x89FE, 0x2A39, 0x8A41, 0x8A5A, 0x2AB7, 0x8A61, 0x8A7A, 0x2AD1,
- 0x8A81, 0x8AFE, 0x2AEB, 0x8B41, 0x8B5A, 0x2B69, 0x8B61, 0x8B7A, 0x2B83,
- 0x8B81, 0x8BFE, 0x2B9D, 0x8C41, 0x8C5A, 0x2C1B, 0x8C61, 0x8C7A, 0x2C35,
- 0x8C81, 0x8CFE, 0x2C4F, 0x8D41, 0x8D5A, 0x2CCD, 0x8D61, 0x8D7A, 0x2CE7,
- 0x8D81, 0x8DFE, 0x2D01, 0x8E41, 0x8E5A, 0x2D7F, 0x8E61, 0x8E7A, 0x2D99,
- 0x8E81, 0x8EFE, 0x2DB3, 0x8F41, 0x8F5A, 0x2E31, 0x8F61, 0x8F7A, 0x2E4B,
- 0x8F81, 0x8FFE, 0x2E65, 0x9041, 0x905A, 0x2EE3, 0x9061, 0x907A, 0x2EFD,
- 0x9081, 0x90FE, 0x2F17, 0x9141, 0x915A, 0x2F95, 0x9161, 0x917A, 0x2FAF,
- 0x9181, 0x91FE, 0x2FC9, 0x9241, 0x925A, 0x3047, 0x9261, 0x927A, 0x3061,
- 0x9281, 0x92FE, 0x307B, 0x9341, 0x935A, 0x30F9, 0x9361, 0x937A, 0x3113,
- 0x9381, 0x93FE, 0x312D, 0x9441, 0x945A, 0x31AB, 0x9461, 0x947A, 0x31C5,
- 0x9481, 0x94FE, 0x31DF, 0x9541, 0x955A, 0x325D, 0x9561, 0x957A, 0x3277,
- 0x9581, 0x95FE, 0x3291, 0x9641, 0x965A, 0x330F, 0x9661, 0x967A, 0x3329,
- 0x9681, 0x96FE, 0x3343, 0x9741, 0x975A, 0x33C1, 0x9761, 0x977A, 0x33DB,
- 0x9781, 0x97FE, 0x33F5, 0x9841, 0x985A, 0x3473, 0x9861, 0x987A, 0x348D,
- 0x9881, 0x98FE, 0x34A7, 0x9941, 0x995A, 0x3525, 0x9961, 0x997A, 0x353F,
- 0x9981, 0x99FE, 0x3559, 0x9A41, 0x9A5A, 0x35D7, 0x9A61, 0x9A7A, 0x35F1,
- 0x9A81, 0x9AFE, 0x360B, 0x9B41, 0x9B5A, 0x3689, 0x9B61, 0x9B7A, 0x36A3,
- 0x9B81, 0x9BFE, 0x36BD, 0x9C41, 0x9C5A, 0x373B, 0x9C61, 0x9C7A, 0x3755,
- 0x9C81, 0x9CFE, 0x376F, 0x9D41, 0x9D5A, 0x37ED, 0x9D61, 0x9D7A, 0x3807,
- 0x9D81, 0x9DFE, 0x3821, 0x9E41, 0x9E5A, 0x389F, 0x9E61, 0x9E7A, 0x38B9,
- 0x9E81, 0x9EFE, 0x38D3, 0x9F41, 0x9F5A, 0x3951, 0x9F61, 0x9F7A, 0x396B,
- 0x9F81, 0x9FFE, 0x3985, 0xA041, 0xA05A, 0x3A03, 0xA061, 0xA07A, 0x3A1D,
- 0xA081, 0xA0FE, 0x3A37, 0xA141, 0xA15A, 0x3AB5, 0xA161, 0xA17A, 0x3ACF,
- 0xA181, 0xA1A0, 0x3AE9, 0xA1A1, 0xA1FE, 0x0065, 0xA241, 0xA25A, 0x3B09,
- 0xA261, 0xA27A, 0x3B23, 0xA281, 0xA2A0, 0x3B3D, 0xA2A1, 0xA2E5, 0x00C3,
- 0xA341, 0xA35A, 0x3B5D, 0xA361, 0xA37A, 0x3B77, 0xA381, 0xA3A0, 0x3B91,
- 0xA3A1, 0xA3FE, 0x0108, 0xA441, 0xA45A, 0x3BB1, 0xA461, 0xA47A, 0x3BCB,
- 0xA481, 0xA4A0, 0x3BE5, 0xA4A1, 0xA4D3, 0x0166, 0xA4D5, 0xA4FE, 0x0199,
- 0xA541, 0xA55A, 0x3C05, 0xA561, 0xA57A, 0x3C1F, 0xA581, 0xA5A0, 0x3C39,
- 0xA5A1, 0xA5AA, 0x01C3, 0xA5B0, 0xA5B9, 0x01CD, 0xA5C1, 0xA5D8, 0x01D7,
- 0xA5E1, 0xA5F8, 0x01EF, 0xA641, 0xA65A, 0x3C59, 0xA661, 0xA67A, 0x3C73,
- 0xA681, 0xA6A0, 0x3C8D, 0xA6A1, 0xA6E4, 0x0207, 0xA741, 0xA75A, 0x3CAD,
- 0xA761, 0xA77A, 0x3CC7, 0xA781, 0xA7A0, 0x3CE1, 0xA7A1, 0xA7EF, 0x024B,
- 0xA841, 0xA85A, 0x3D01, 0xA861, 0xA87A, 0x3D1B, 0xA881, 0xA8A0, 0x3D35,
- 0xA8A1, 0xA8A4, 0x029A, 0xA8A6, 0xA8A6, 0x029E, 0xA8A8, 0xA8AF, 0x029F,
- 0xA8B1, 0xA8FE, 0x02A7, 0xA941, 0xA95A, 0x3D55, 0xA961, 0xA97A, 0x3D6F,
- 0xA981, 0xA9A0, 0x3D89, 0xA9A1, 0xA9FE, 0x02F5, 0xAA41, 0xAA5A, 0x3DA9,
- 0xAA61, 0xAA7A, 0x3DC3, 0xAA81, 0xAAA0, 0x3DDD, 0xAAA1, 0xAAF3, 0x0353,
- 0xAB41, 0xAB5A, 0x3DFD, 0xAB61, 0xAB7A, 0x3E17, 0xAB81, 0xABA0, 0x3E31,
- 0xABA1, 0xABF6, 0x03A6, 0xAC41, 0xAC5A, 0x3E51, 0xAC61, 0xAC7A, 0x3E6B,
- 0xAC81, 0xACA0, 0x3E85, 0xACA1, 0xACC1, 0x03FC, 0xACD1, 0xACF1, 0x041D,
- 0xAD41, 0xAD5A, 0x3EA5, 0xAD61, 0xAD7A, 0x3EBF, 0xAD81, 0xADA0, 0x3ED9,
- 0xAE41, 0xAE5A, 0x3EF9, 0xAE61, 0xAE7A, 0x3F13, 0xAE81, 0xAEA0, 0x3F2D,
- 0xAF41, 0xAF5A, 0x3F4D, 0xAF61, 0xAF7A, 0x3F67, 0xAF81, 0xAFA0, 0x3F81,
- 0xB041, 0xB05A, 0x3FA1, 0xB061, 0xB07A, 0x3FBB, 0xB081, 0xB0A0, 0x3FD5,
- 0xB0A1, 0xB0FE, 0x043E, 0xB141, 0xB15A, 0x3FF5, 0xB161, 0xB17A, 0x400F,
- 0xB181, 0xB1A0, 0x4029, 0xB1A1, 0xB1FE, 0x049C, 0xB241, 0xB25A, 0x4049,
- 0xB261, 0xB27A, 0x4063, 0xB281, 0xB2A0, 0x407D, 0xB2A1, 0xB2FE, 0x04FA,
- 0xB341, 0xB35A, 0x409D, 0xB361, 0xB37A, 0x40B7, 0xB381, 0xB3A0, 0x40D1,
- 0xB3A1, 0xB3FE, 0x0558, 0xB441, 0xB45A, 0x40F1, 0xB461, 0xB47A, 0x410B,
- 0xB481, 0xB4A0, 0x4125, 0xB4A1, 0xB4FE, 0x05B6, 0xB541, 0xB55A, 0x4145,
- 0xB561, 0xB57A, 0x415F, 0xB581, 0xB5A0, 0x4179, 0xB5A1, 0xB5FE, 0x0614,
- 0xB641, 0xB65A, 0x4199, 0xB661, 0xB67A, 0x41B3, 0xB681, 0xB6A0, 0x41CD,
- 0xB6A1, 0xB6FE, 0x0672, 0xB741, 0xB75A, 0x41ED, 0xB761, 0xB77A, 0x4207,
- 0xB781, 0xB7A0, 0x4221, 0xB7A1, 0xB7FE, 0x06D0, 0xB841, 0xB85A, 0x4241,
- 0xB861, 0xB87A, 0x425B, 0xB881, 0xB8A0, 0x4275, 0xB8A1, 0xB8FE, 0x072E,
- 0xB941, 0xB95A, 0x4295, 0xB961, 0xB97A, 0x42AF, 0xB981, 0xB9A0, 0x42C9,
- 0xB9A1, 0xB9FE, 0x078C, 0xBA41, 0xBA5A, 0x42E9, 0xBA61, 0xBA7A, 0x4303,
- 0xBA81, 0xBAA0, 0x431D, 0xBAA1, 0xBAFE, 0x07EA, 0xBB41, 0xBB5A, 0x433D,
- 0xBB61, 0xBB7A, 0x4357, 0xBB81, 0xBBA0, 0x4371, 0xBBA1, 0xBBFE, 0x0848,
- 0xBC41, 0xBC5A, 0x4391, 0xBC61, 0xBC7A, 0x43AB, 0xBC81, 0xBCA0, 0x43C5,
- 0xBCA1, 0xBCFE, 0x08A6, 0xBD41, 0xBD5A, 0x43E5, 0xBD61, 0xBD7A, 0x43FF,
- 0xBD81, 0xBDA0, 0x4419, 0xBDA1, 0xBDFE, 0x0904, 0xBE41, 0xBE5A, 0x4439,
- 0xBE61, 0xBE7A, 0x4453, 0xBE81, 0xBEA0, 0x446D, 0xBEA1, 0xBEFE, 0x0962,
- 0xBF41, 0xBF5A, 0x448D, 0xBF61, 0xBF7A, 0x44A7, 0xBF81, 0xBFA0, 0x44C1,
- 0xBFA1, 0xBFFE, 0x09C0, 0xC041, 0xC05A, 0x44E1, 0xC061, 0xC07A, 0x44FB,
- 0xC081, 0xC0A0, 0x4515, 0xC0A1, 0xC0FE, 0x0A1E, 0xC141, 0xC15A, 0x4535,
- 0xC161, 0xC17A, 0x454F, 0xC181, 0xC1A0, 0x4569, 0xC1A1, 0xC1FE, 0x0A7C,
- 0xC241, 0xC25A, 0x4589, 0xC261, 0xC27A, 0x45A3, 0xC281, 0xC2A0, 0x45BD,
- 0xC2A1, 0xC2FE, 0x0ADA, 0xC341, 0xC35A, 0x45DD, 0xC361, 0xC37A, 0x45F7,
- 0xC381, 0xC3A0, 0x4611, 0xC3A1, 0xC3FE, 0x0B38, 0xC441, 0xC45A, 0x4631,
- 0xC461, 0xC47A, 0x464B, 0xC481, 0xC4A0, 0x4665, 0xC4A1, 0xC4FE, 0x0B96,
- 0xC541, 0xC55A, 0x4685, 0xC561, 0xC57A, 0x469F, 0xC581, 0xC5A0, 0x46B9,
- 0xC5A1, 0xC5FE, 0x0BF4, 0xC641, 0xC652, 0x46D9, 0xC6A1, 0xC6FE, 0x0C52,
- 0xC7A1, 0xC7FE, 0x0CB0, 0xC8A1, 0xC8FE, 0x0D0E, 0xCAA1, 0xCAFE, 0x0D6C,
- 0xCBA1, 0xCBCF, 0x0DCA, 0xCBD0, 0xCBD0, 0x1014, 0xCBD1, 0xCBD5, 0x0DF9,
- 0xCBD6, 0xCBD6, 0x0E5E, 0xCBD7, 0xCBE6, 0x0DFE, 0xCBE7, 0xCBE7, 0x1B8D,
- 0xCBE8, 0xCBFE, 0x0E0E, 0xCCA1, 0xCCFE, 0x0E25, 0xCDA1, 0xCDCE, 0x0E83,
- 0xCDCF, 0xCDCF, 0x0D84, 0xCDD0, 0xCDE7, 0x0EB1, 0xCDE8, 0xCDE8, 0x1EDC,
- 0xCDE9, 0xCDFE, 0x0EC9, 0xCEA1, 0xCEAC, 0x0EDF, 0xCEAD, 0xCEAD, 0x0EDA,
- 0xCEAE, 0xCEFE, 0x0EEB, 0xCFA1, 0xCFFA, 0x0F3C, 0xCFFB, 0xCFFB, 0x0F3E,
- 0xCFFC, 0xCFFE, 0x0F96, 0xD0A1, 0xD0A1, 0x0F99, 0xD0A2, 0xD0A2, 0x0F6A,
- 0xD0A3, 0xD0B7, 0x0F9A, 0xD0B8, 0xD0B8, 0x0F6A, 0xD0B9, 0xD0CF, 0x0FAF,
- 0xD0D0, 0xD0D0, 0x0E7C, 0xD0D1, 0xD0DC, 0x0FC6, 0xD0DD, 0xD0DD, 0x1023,
- 0xD0DE, 0xD0FE, 0x0FD2, 0xD1A1, 0xD1D3, 0x0FF3, 0xD1D4, 0xD1D4, 0x1116,
- 0xD1D5, 0xD1D5, 0x103C, 0xD1D6, 0xD1D7, 0x1026, 0xD1D8, 0xD1D8, 0x1117,
- 0xD1D9, 0xD1DA, 0x1028, 0xD1DB, 0xD1E0, 0x1118, 0xD1E1, 0xD1E1, 0x102A,
- 0xD1E2, 0xD1E2, 0x16A8, 0xD1E3, 0xD1E5, 0x111E, 0xD1E6, 0xD1E6, 0x1122,
- 0xD1E7, 0xD1E7, 0x102B, 0xD1E8, 0xD1EB, 0x1123, 0xD1EC, 0xD1EC, 0x102C,
- 0xD1ED, 0xD1ED, 0x1127, 0xD1EE, 0xD1EE, 0x102D, 0xD1EF, 0xD1F0, 0x112A,
- 0xD1F1, 0xD1F1, 0x102E, 0xD1F2, 0xD1F2, 0x112C, 0xD1F3, 0xD1F5, 0x102F,
- 0xD1F6, 0xD1F6, 0x112F, 0xD1F7, 0xD1F9, 0x1032, 0xD1FA, 0xD1FA, 0x1133,
- 0xD1FB, 0xD1FB, 0x1035, 0xD1FC, 0xD1FD, 0x1136, 0xD1FE, 0xD1FE, 0x1139,
- 0xD2A1, 0xD2A1, 0x1036, 0xD2A2, 0xD2A3, 0x113A, 0xD2A4, 0xD2A6, 0x1037,
- 0xD2A7, 0xD2AA, 0x113C, 0xD2AB, 0xD2AB, 0x1143, 0xD2AC, 0xD2AC, 0x103A,
- 0xD2AD, 0xD2AD, 0x1144, 0xD2AE, 0xD2B1, 0x103B, 0xD2B2, 0xD2B2, 0x1148,
- 0xD2B3, 0xD2BD, 0x103F, 0xD2BE, 0xD2BE, 0x119F, 0xD2BF, 0xD2C1, 0x104A,
- 0xD2C2, 0xD2C3, 0x11A1, 0xD2C4, 0xD2C4, 0x11A5, 0xD2C5, 0xD2C5, 0x104D,
- 0xD2C6, 0xD2CA, 0x11A6, 0xD2CB, 0xD2CB, 0x11AC, 0xD2CC, 0xD2CC, 0x104E,
- 0xD2CD, 0xD2CE, 0x11AD, 0xD2CF, 0xD2D4, 0x11B0, 0xD2D5, 0xD2D7, 0x11B7,
- 0xD2D8, 0xD2D8, 0x104F, 0xD2D9, 0xD2DA, 0x11BD, 0xD2DB, 0xD2DD, 0x1050,
- 0xD2DE, 0xD2DF, 0x11C1, 0xD2E0, 0xD2E0, 0x1053, 0xD2E1, 0xD2E1, 0x11C3,
- 0xD2E2, 0xD2E2, 0x11C6, 0xD2E3, 0xD2E3, 0x1054, 0xD2E4, 0xD2E4, 0x11D4,
- 0xD2E5, 0xD2E8, 0x11D6, 0xD2E9, 0xD2EA, 0x11DB, 0xD2EB, 0xD2EB, 0x11E0,
- 0xD2EC, 0xD2EF, 0x1055, 0xD2F0, 0xD2F3, 0x11FC, 0xD2F4, 0xD2F5, 0x1201,
- 0xD2F6, 0xD2F6, 0x1059, 0xD2F7, 0xD2F8, 0x1203, 0xD2F9, 0xD2FE, 0x105A,
- 0xD3A1, 0xD3FE, 0x1060, 0xD4A1, 0xD4E5, 0x10BE, 0xD4E6, 0xD4E6, 0x10DE,
- 0xD4E7, 0xD4FB, 0x1103, 0xD4FC, 0xD4FC, 0x1028, 0xD4FD, 0xD4FE, 0x1118,
- 0xD5A1, 0xD5A4, 0x111A, 0xD5A5, 0xD5A5, 0x16A8, 0xD5A6, 0xD5AA, 0x111E,
- 0xD5AB, 0xD5AB, 0x102B, 0xD5AC, 0xD5AD, 0x1123, 0xD5AE, 0xD5AE, 0x1060,
- 0xD5AF, 0xD5FE, 0x1125, 0xD6A1, 0xD6B7, 0x1175, 0xD6B8, 0xD6B8, 0x1047,
- 0xD6B9, 0xD6CC, 0x118C, 0xD6CD, 0xD6CD, 0x104C, 0xD6CE, 0xD6FE, 0x11A0,
- 0xD7A1, 0xD7CA, 0x11D1, 0xD7CB, 0xD7CB, 0x15B0, 0xD7CC, 0xD7E3, 0x11FB,
- 0xD7E4, 0xD7E4, 0x1918, 0xD7E5, 0xD7FE, 0x1213, 0xD8A1, 0xD8FE, 0x122D,
- 0xD9A1, 0xD9FE, 0x128B, 0xDAA1, 0xDAFE, 0x12E9, 0xDBA1, 0xDBC4, 0x1347,
- 0xDBC5, 0xDBC5, 0x141F, 0xDBC6, 0xDBE3, 0x136B, 0xDBE4, 0xDBE4, 0x133A,
- 0xDBE5, 0xDBFE, 0x1389, 0xDCA1, 0xDCA4, 0x13A3, 0xDCA5, 0xDCA5, 0x1D5E,
- 0xDCA6, 0xDCFE, 0x13A7, 0xDDA1, 0xDDA4, 0x1400, 0xDDA5, 0xDDA5, 0x13D7,
- 0xDDA6, 0xDDD4, 0x1404, 0xDDD5, 0xDDD5, 0x13F5, 0xDDD6, 0xDDF3, 0x1433,
- 0xDDF4, 0xDDF4, 0x1DB7, 0xDDF5, 0xDDFE, 0x1451, 0xDEA1, 0xDEFB, 0x145B,
- 0xDEFC, 0xDEFC, 0x15D0, 0xDEFD, 0xDEFD, 0x14B6, 0xDEFE, 0xDEFE, 0x14F7,
- 0xDFA1, 0xDFB2, 0x14B7, 0xDFB3, 0xDFB3, 0x1BAB, 0xDFB4, 0xDFE0, 0x14C9,
- 0xDFE1, 0xDFE1, 0x14F2, 0xDFE2, 0xDFE7, 0x14F6, 0xDFE8, 0xDFE8, 0x156D,
- 0xDFE9, 0xDFFE, 0x14FC, 0xE0A1, 0xE0F0, 0x1512, 0xE0F1, 0xE0F1, 0x1771,
- 0xE0F2, 0xE0FE, 0x1562, 0xE1A1, 0xE1AC, 0x156F, 0xE1AD, 0xE1AD, 0x1554,
- 0xE1AE, 0xE1EC, 0x157B, 0xE1ED, 0xE1ED, 0x14C5, 0xE1EE, 0xE1FE, 0x15BA,
- 0xE2A1, 0xE2FE, 0x15CB, 0xE3A1, 0xE3F4, 0x1629, 0xE3F5, 0xE3F5, 0x1B61,
- 0xE3F6, 0xE3FE, 0x167D, 0xE4A1, 0xE4A1, 0x1CCA, 0xE4A2, 0xE4A8, 0x1686,
- 0xE4A9, 0xE4A9, 0x162E, 0xE4AA, 0xE4FE, 0x168D, 0xE5A1, 0xE5AD, 0x16E2,
- 0xE5AE, 0xE5AE, 0x16F2, 0xE5AF, 0xE5B0, 0x16EF, 0xE5B1, 0xE5B2, 0x1149,
- 0xE5B3, 0xE5B8, 0x16F1, 0xE5B9, 0xE5B9, 0x114B, 0xE5BA, 0xE5BA, 0x16F7,
- 0xE5BB, 0xE5BC, 0x114D, 0xE5BD, 0xE5C3, 0x16F8, 0xE5C4, 0xE5C4, 0x114F,
- 0xE5C5, 0xE5CD, 0x16FF, 0xE5CE, 0xE5CE, 0x1153, 0xE5CF, 0xE5CF, 0x1708,
- 0xE5D0, 0xE5D0, 0x1154, 0xE5D1, 0xE5D1, 0x1709, 0xE5D2, 0xE5D2, 0x1155,
- 0xE5D3, 0xE5D5, 0x170A, 0xE5D6, 0xE5D6, 0x1157, 0xE5D7, 0xE5F9, 0x170D,
- 0xE5FA, 0xE5FB, 0x115A, 0xE5FC, 0xE5FC, 0x103F, 0xE5FD, 0xE5FD, 0x1730,
- 0xE5FE, 0xE5FE, 0x115C, 0xE6A1, 0xE6A1, 0x115F, 0xE6A2, 0xE6A3, 0x1731,
- 0xE6A4, 0xE6A4, 0x1161, 0xE6A5, 0xE6A6, 0x1733, 0xE6A7, 0xE6A7, 0x1162,
- 0xE6A8, 0xE6AC, 0x1735, 0xE6AD, 0xE6AD, 0x1165, 0xE6AE, 0xE6AE, 0x173A,
- 0xE6AF, 0xE6B1, 0x1167, 0xE6B2, 0xE6B2, 0x173B, 0xE6B3, 0xE6B3, 0x116A,
- 0xE6B4, 0xE6B6, 0x173C, 0xE6B7, 0xE6B8, 0x116B, 0xE6B9, 0xE6BB, 0x173F,
- 0xE6BC, 0xE6BC, 0x116F, 0xE6BD, 0xE6C3, 0x1742, 0xE6C4, 0xE6C4, 0x1040,
- 0xE6C5, 0xE6C5, 0x1749, 0xE6C6, 0xE6C7, 0x1171, 0xE6C8, 0xE6C9, 0x174A,
- 0xE6CA, 0xE6CA, 0x1041, 0xE6CB, 0xE6D1, 0x174C, 0xE6D2, 0xE6D2, 0x1174,
- 0xE6D3, 0xE6D5, 0x1753, 0xE6D6, 0xE6D6, 0x1175, 0xE6D7, 0xE6D8, 0x1756,
- 0xE6D9, 0xE6D9, 0x1176, 0xE6DA, 0xE6DB, 0x1758, 0xE6DC, 0xE6DC, 0x1042,
- 0xE6DD, 0xE6DE, 0x175A, 0xE6DF, 0xE6DF, 0x1177, 0xE6E0, 0xE6E0, 0x175C,
- 0xE6E1, 0xE6E1, 0x1178, 0xE6E2, 0xE6E3, 0x175D, 0xE6E4, 0xE6E4, 0x117A,
- 0xE6E5, 0xE6E5, 0x1179, 0xE6E6, 0xE6E6, 0x117B, 0xE6E7, 0xE6E7, 0x175F,
- 0xE6E8, 0xE6E8, 0x117C, 0xE6E9, 0xE6E9, 0x1760, 0xE6EA, 0xE6EB, 0x117E,
- 0xE6EC, 0xE6EC, 0x192F, 0xE6ED, 0xE6EE, 0x1761, 0xE6EF, 0xE6EF, 0x1181,
- 0xE6F0, 0xE6F0, 0x1763, 0xE6F1, 0xE6F1, 0x1182, 0xE6F2, 0xE6F2, 0x1554,
- 0xE6F3, 0xE6F4, 0x1764, 0xE6F5, 0xE6F5, 0x1183, 0xE6F6, 0xE6F6, 0x1043,
- 0xE6F7, 0xE6F7, 0x1046, 0xE6F8, 0xE6F8, 0x1766, 0xE6F9, 0xE6F9, 0x1185,
- 0xE6FA, 0xE6FE, 0x1767, 0xE7A1, 0xE7A1, 0x1187, 0xE7A2, 0xE7A5, 0x176C,
- 0xE7A6, 0xE7A6, 0x1188, 0xE7A7, 0xE7A8, 0x1770, 0xE7A9, 0xE7A9, 0x1189,
- 0xE7AA, 0xE7AA, 0x118B, 0xE7AB, 0xE7AB, 0x1772, 0xE7AC, 0xE7AC, 0x1047,
- 0xE7AD, 0xE7AD, 0x118D, 0xE7AE, 0xE7AF, 0x1773, 0xE7B0, 0xE7B0, 0x118E,
- 0xE7B1, 0xE7BE, 0x1775, 0xE7BF, 0xE7BF, 0x118F, 0xE7C0, 0xE7C0, 0x1783,
- 0xE7C1, 0xE7C1, 0x1E67, 0xE7C2, 0xE7C5, 0x1784, 0xE7C6, 0xE7C6, 0x1191,
- 0xE7C7, 0xE7C7, 0x1193, 0xE7C8, 0xE7CA, 0x1788, 0xE7CB, 0xE7CB, 0x1195,
- 0xE7CC, 0xE7CC, 0x178B, 0xE7CD, 0xE7CD, 0x1196, 0xE7CE, 0xE7CE, 0x178C,
- 0xE7CF, 0xE7D0, 0x1197, 0xE7D1, 0xE7D2, 0x178D, 0xE7D3, 0xE7D3, 0x119A,
- 0xE7D4, 0xE7DE, 0x178F, 0xE7DF, 0xE7DF, 0x119C, 0xE7E0, 0xE7E3, 0x179A,
- 0xE7E4, 0xE7E4, 0x119D, 0xE7E5, 0xE7E5, 0x179E, 0xE7E6, 0xE7E6, 0x119E,
- 0xE7E7, 0xE7F6, 0x179F, 0xE7F7, 0xE7F7, 0x16A5, 0xE7F8, 0xE7FE, 0x17AF,
- 0xE8A1, 0xE8E6, 0x17B6, 0xE8E7, 0xE8E8, 0x11C7, 0xE8E9, 0xE8EF, 0x17FC,
- 0xE8F0, 0xE8F0, 0x11C9, 0xE8F1, 0xE8F1, 0x1054, 0xE8F2, 0xE8F6, 0x1803,
- 0xE8F7, 0xE8F7, 0x11CB, 0xE8F8, 0xE8F8, 0x1808, 0xE8F9, 0xE8F9, 0x16A8,
- 0xE8FA, 0xE8FA, 0x1809, 0xE8FB, 0xE8FB, 0x11CC, 0xE8FC, 0xE8FD, 0x180A,
- 0xE8FE, 0xE8FE, 0x11CD, 0xE9A1, 0xE9A6, 0x180C, 0xE9A7, 0xE9A7, 0x11D0,
- 0xE9A8, 0xE9AB, 0x1812, 0xE9AC, 0xE9AC, 0x11D1, 0xE9AD, 0xE9CB, 0x1816,
- 0xE9CC, 0xE9CC, 0x11D3, 0xE9CD, 0xE9F6, 0x1835, 0xE9F7, 0xE9F7, 0x1F34,
- 0xE9F8, 0xE9FE, 0x185F, 0xEAA1, 0xEAC0, 0x1866, 0xEAC1, 0xEAC1, 0x17EB,
- 0xEAC2, 0xEAE4, 0x1886, 0xEAE5, 0xEAE5, 0x11E1, 0xEAE6, 0xEAF3, 0x18A9,
- 0xEAF4, 0xEAF4, 0x1057, 0xEAF5, 0xEAF6, 0x18B7, 0xEAF7, 0xEAF7, 0x11E3,
- 0xEAF8, 0xEAFB, 0x18B9, 0xEAFC, 0xEAFC, 0x11E5, 0xEAFD, 0xEAFD, 0x18BD,
- 0xEAFE, 0xEAFE, 0x11E6, 0xEBA1, 0xEBA3, 0x18BE, 0xEBA4, 0xEBA4, 0x11E8,
- 0xEBA5, 0xEBA6, 0x18C1, 0xEBA7, 0xEBA7, 0x11EA, 0xEBA8, 0xEBA8, 0x18C3,
- 0xEBA9, 0xEBA9, 0x11EC, 0xEBAA, 0xEBAA, 0x1058, 0xEBAB, 0xEBB9, 0x18C4,
- 0xEBBA, 0xEBBB, 0x11EE, 0xEBBC, 0xEBBC, 0x18D3, 0xEBBD, 0xEBBD, 0x11F0,
- 0xEBBE, 0xEBC0, 0x18D4, 0xEBC1, 0xEBC1, 0x11F1, 0xEBC2, 0xEBC2, 0x11F3,
- 0xEBC3, 0xEBC5, 0x18D7, 0xEBC6, 0xEBC7, 0x11F4, 0xEBC8, 0xEBCB, 0x18DA,
- 0xEBCC, 0xEBCC, 0x11F7, 0xEBCD, 0xEBCE, 0x18DE, 0xEBCF, 0xEBD1, 0x11F8,
- 0xEBD2, 0xEBD2, 0x15B0, 0xEBD3, 0xEBD7, 0x18E0, 0xEBD8, 0xEBD8, 0x11FB,
- 0xEBD9, 0xEBFE, 0x18E5, 0xECA1, 0xECA5, 0x190B, 0xECA6, 0xECA6, 0x1206,
- 0xECA7, 0xECA7, 0x1208, 0xECA8, 0xECA9, 0x1910, 0xECAA, 0xECAA, 0x120A,
- 0xECAB, 0xECAE, 0x1912, 0xECAF, 0xECAF, 0x173E, 0xECB0, 0xECB1, 0x120C,
- 0xECB2, 0xECB2, 0x105B, 0xECB3, 0xECB4, 0x1916, 0xECB5, 0xECB5, 0x1211,
- 0xECB6, 0xECB7, 0x1918, 0xECB8, 0xECB8, 0x1213, 0xECB9, 0xECB9, 0x191A,
- 0xECBA, 0xECBA, 0x1215, 0xECBB, 0xECBF, 0x191B, 0xECC0, 0xECC1, 0x1218,
- 0xECC2, 0xECC4, 0x1920, 0xECC5, 0xECC5, 0x121A, 0xECC6, 0xECC6, 0x121C,
- 0xECC7, 0xECC8, 0x1923, 0xECC9, 0xECCA, 0x105C, 0xECCB, 0xECD4, 0x1925,
- 0xECD5, 0xECD5, 0x121E, 0xECD6, 0xECDC, 0x192F, 0xECDD, 0xECDE, 0x1220,
- 0xECDF, 0xECE0, 0x1936, 0xECE1, 0xECE1, 0x1222, 0xECE2, 0xECE3, 0x1938,
- 0xECE4, 0xECE4, 0x1224, 0xECE5, 0xECE6, 0x193A, 0xECE7, 0xECE8, 0x1225,
- 0xECE9, 0xECF6, 0x193C, 0xECF7, 0xECF8, 0x1227, 0xECF9, 0xECF9, 0x194A,
- 0xECFA, 0xECFA, 0x122A, 0xECFB, 0xECFE, 0x194B, 0xEDA1, 0xEDA3, 0x122D,
- 0xEDA4, 0xEDED, 0x194F, 0xEDEE, 0xEDEE, 0x14E7, 0xEDEF, 0xEDFE, 0x1999,
- 0xEEA1, 0xEEDA, 0x19A9, 0xEEDB, 0xEEDB, 0x195E, 0xEEDC, 0xEEFE, 0x19E3,
- 0xEFA1, 0xEFFE, 0x1A06, 0xF0A1, 0xF0FE, 0x1A64, 0xF1A1, 0xF1FE, 0x1AC2,
- 0xF2A1, 0xF2BC, 0x1B20, 0xF2BD, 0xF2BD, 0x1663, 0xF2BE, 0xF2F9, 0x1B3C,
- 0xF2FA, 0xF2FA, 0x168B, 0xF2FB, 0xF2FE, 0x1B78, 0xF3A1, 0xF3B0, 0x1B7C,
- 0xF3B1, 0xF3B1, 0x105F, 0xF3B2, 0xF3FE, 0x1B8C, 0xF4A1, 0xF4A6, 0x1BD9,
- 0xF4A7, 0xF4A7, 0x1954, 0xF4A8, 0xF4ED, 0x1BDF, 0xF4EE, 0xF4EE, 0x1A1C,
- 0xF4EF, 0xF4FE, 0x1C25, 0xF5A1, 0xF5FE, 0x1C35, 0xF6A1, 0xF6F3, 0x1C93,
- 0xF6F4, 0xF6F4, 0x10B7, 0xF6F5, 0xF6F5, 0x1CE6, 0xF6F6, 0xF6F6, 0x1BE3,
- 0xF6F7, 0xF6FE, 0x1CE7, 0xF7A1, 0xF7B7, 0x1CEF, 0xF7B8, 0xF7B8, 0x1097,
- 0xF7B9, 0xF7C7, 0x1D06, 0xF7C8, 0xF7C8, 0x10AA, 0xF7C9, 0xF7D2, 0x1D15,
- 0xF7D3, 0xF7D3, 0x10F4, 0xF7D4, 0xF7FE, 0x1D1F, 0xF8A1, 0xF8DA, 0x1D4A,
- 0xF8DB, 0xF8DB, 0x1D94, 0xF8DC, 0xF8EF, 0x1D84, 0xF8F0, 0xF8F0, 0x13E0,
- 0xF8F1, 0xF8FE, 0x1D98, 0xF9A1, 0xF9FE, 0x1DA6, 0xFAA1, 0xFAA1, 0x1E1D,
- 0xFAA2, 0xFAA2, 0x0DE6, 0xFAA3, 0xFAE5, 0x1E04, 0xFAE6, 0xFAE6, 0x0E3C,
- 0xFAE7, 0xFAFE, 0x1E47, 0xFBA1, 0xFBFE, 0x1E5F, 0xFCA1, 0xFCA8, 0x1EBD,
- 0xFCA9, 0xFCA9, 0x0EE7, 0xFCAA, 0xFCFE, 0x1EC5, 0xFDA1, 0xFDFE, 0x1F1A,
-};
+// 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
+
+extern const unsigned short g_FXCMAP_KSCms_UHC_H_1[675 * 3] = {
+ 0x0020, 0x007E, 0x0001, 0x8141, 0x815A, 0x2475, 0x8161, 0x817A, 0x248F,
+ 0x8181, 0x81FE, 0x24A9, 0x8241, 0x825A, 0x2527, 0x8261, 0x827A, 0x2541,
+ 0x8281, 0x82FE, 0x255B, 0x8341, 0x835A, 0x25D9, 0x8361, 0x837A, 0x25F3,
+ 0x8381, 0x83FE, 0x260D, 0x8441, 0x845A, 0x268B, 0x8461, 0x847A, 0x26A5,
+ 0x8481, 0x84FE, 0x26BF, 0x8541, 0x855A, 0x273D, 0x8561, 0x857A, 0x2757,
+ 0x8581, 0x85FE, 0x2771, 0x8641, 0x865A, 0x27EF, 0x8661, 0x867A, 0x2809,
+ 0x8681, 0x86FE, 0x2823, 0x8741, 0x875A, 0x28A1, 0x8761, 0x877A, 0x28BB,
+ 0x8781, 0x87FE, 0x28D5, 0x8841, 0x885A, 0x2953, 0x8861, 0x887A, 0x296D,
+ 0x8881, 0x88FE, 0x2987, 0x8941, 0x895A, 0x2A05, 0x8961, 0x897A, 0x2A1F,
+ 0x8981, 0x89FE, 0x2A39, 0x8A41, 0x8A5A, 0x2AB7, 0x8A61, 0x8A7A, 0x2AD1,
+ 0x8A81, 0x8AFE, 0x2AEB, 0x8B41, 0x8B5A, 0x2B69, 0x8B61, 0x8B7A, 0x2B83,
+ 0x8B81, 0x8BFE, 0x2B9D, 0x8C41, 0x8C5A, 0x2C1B, 0x8C61, 0x8C7A, 0x2C35,
+ 0x8C81, 0x8CFE, 0x2C4F, 0x8D41, 0x8D5A, 0x2CCD, 0x8D61, 0x8D7A, 0x2CE7,
+ 0x8D81, 0x8DFE, 0x2D01, 0x8E41, 0x8E5A, 0x2D7F, 0x8E61, 0x8E7A, 0x2D99,
+ 0x8E81, 0x8EFE, 0x2DB3, 0x8F41, 0x8F5A, 0x2E31, 0x8F61, 0x8F7A, 0x2E4B,
+ 0x8F81, 0x8FFE, 0x2E65, 0x9041, 0x905A, 0x2EE3, 0x9061, 0x907A, 0x2EFD,
+ 0x9081, 0x90FE, 0x2F17, 0x9141, 0x915A, 0x2F95, 0x9161, 0x917A, 0x2FAF,
+ 0x9181, 0x91FE, 0x2FC9, 0x9241, 0x925A, 0x3047, 0x9261, 0x927A, 0x3061,
+ 0x9281, 0x92FE, 0x307B, 0x9341, 0x935A, 0x30F9, 0x9361, 0x937A, 0x3113,
+ 0x9381, 0x93FE, 0x312D, 0x9441, 0x945A, 0x31AB, 0x9461, 0x947A, 0x31C5,
+ 0x9481, 0x94FE, 0x31DF, 0x9541, 0x955A, 0x325D, 0x9561, 0x957A, 0x3277,
+ 0x9581, 0x95FE, 0x3291, 0x9641, 0x965A, 0x330F, 0x9661, 0x967A, 0x3329,
+ 0x9681, 0x96FE, 0x3343, 0x9741, 0x975A, 0x33C1, 0x9761, 0x977A, 0x33DB,
+ 0x9781, 0x97FE, 0x33F5, 0x9841, 0x985A, 0x3473, 0x9861, 0x987A, 0x348D,
+ 0x9881, 0x98FE, 0x34A7, 0x9941, 0x995A, 0x3525, 0x9961, 0x997A, 0x353F,
+ 0x9981, 0x99FE, 0x3559, 0x9A41, 0x9A5A, 0x35D7, 0x9A61, 0x9A7A, 0x35F1,
+ 0x9A81, 0x9AFE, 0x360B, 0x9B41, 0x9B5A, 0x3689, 0x9B61, 0x9B7A, 0x36A3,
+ 0x9B81, 0x9BFE, 0x36BD, 0x9C41, 0x9C5A, 0x373B, 0x9C61, 0x9C7A, 0x3755,
+ 0x9C81, 0x9CFE, 0x376F, 0x9D41, 0x9D5A, 0x37ED, 0x9D61, 0x9D7A, 0x3807,
+ 0x9D81, 0x9DFE, 0x3821, 0x9E41, 0x9E5A, 0x389F, 0x9E61, 0x9E7A, 0x38B9,
+ 0x9E81, 0x9EFE, 0x38D3, 0x9F41, 0x9F5A, 0x3951, 0x9F61, 0x9F7A, 0x396B,
+ 0x9F81, 0x9FFE, 0x3985, 0xA041, 0xA05A, 0x3A03, 0xA061, 0xA07A, 0x3A1D,
+ 0xA081, 0xA0FE, 0x3A37, 0xA141, 0xA15A, 0x3AB5, 0xA161, 0xA17A, 0x3ACF,
+ 0xA181, 0xA1A0, 0x3AE9, 0xA1A1, 0xA1FE, 0x0065, 0xA241, 0xA25A, 0x3B09,
+ 0xA261, 0xA27A, 0x3B23, 0xA281, 0xA2A0, 0x3B3D, 0xA2A1, 0xA2E5, 0x00C3,
+ 0xA341, 0xA35A, 0x3B5D, 0xA361, 0xA37A, 0x3B77, 0xA381, 0xA3A0, 0x3B91,
+ 0xA3A1, 0xA3FE, 0x0108, 0xA441, 0xA45A, 0x3BB1, 0xA461, 0xA47A, 0x3BCB,
+ 0xA481, 0xA4A0, 0x3BE5, 0xA4A1, 0xA4D3, 0x0166, 0xA4D5, 0xA4FE, 0x0199,
+ 0xA541, 0xA55A, 0x3C05, 0xA561, 0xA57A, 0x3C1F, 0xA581, 0xA5A0, 0x3C39,
+ 0xA5A1, 0xA5AA, 0x01C3, 0xA5B0, 0xA5B9, 0x01CD, 0xA5C1, 0xA5D8, 0x01D7,
+ 0xA5E1, 0xA5F8, 0x01EF, 0xA641, 0xA65A, 0x3C59, 0xA661, 0xA67A, 0x3C73,
+ 0xA681, 0xA6A0, 0x3C8D, 0xA6A1, 0xA6E4, 0x0207, 0xA741, 0xA75A, 0x3CAD,
+ 0xA761, 0xA77A, 0x3CC7, 0xA781, 0xA7A0, 0x3CE1, 0xA7A1, 0xA7EF, 0x024B,
+ 0xA841, 0xA85A, 0x3D01, 0xA861, 0xA87A, 0x3D1B, 0xA881, 0xA8A0, 0x3D35,
+ 0xA8A1, 0xA8A4, 0x029A, 0xA8A6, 0xA8A6, 0x029E, 0xA8A8, 0xA8AF, 0x029F,
+ 0xA8B1, 0xA8FE, 0x02A7, 0xA941, 0xA95A, 0x3D55, 0xA961, 0xA97A, 0x3D6F,
+ 0xA981, 0xA9A0, 0x3D89, 0xA9A1, 0xA9FE, 0x02F5, 0xAA41, 0xAA5A, 0x3DA9,
+ 0xAA61, 0xAA7A, 0x3DC3, 0xAA81, 0xAAA0, 0x3DDD, 0xAAA1, 0xAAF3, 0x0353,
+ 0xAB41, 0xAB5A, 0x3DFD, 0xAB61, 0xAB7A, 0x3E17, 0xAB81, 0xABA0, 0x3E31,
+ 0xABA1, 0xABF6, 0x03A6, 0xAC41, 0xAC5A, 0x3E51, 0xAC61, 0xAC7A, 0x3E6B,
+ 0xAC81, 0xACA0, 0x3E85, 0xACA1, 0xACC1, 0x03FC, 0xACD1, 0xACF1, 0x041D,
+ 0xAD41, 0xAD5A, 0x3EA5, 0xAD61, 0xAD7A, 0x3EBF, 0xAD81, 0xADA0, 0x3ED9,
+ 0xAE41, 0xAE5A, 0x3EF9, 0xAE61, 0xAE7A, 0x3F13, 0xAE81, 0xAEA0, 0x3F2D,
+ 0xAF41, 0xAF5A, 0x3F4D, 0xAF61, 0xAF7A, 0x3F67, 0xAF81, 0xAFA0, 0x3F81,
+ 0xB041, 0xB05A, 0x3FA1, 0xB061, 0xB07A, 0x3FBB, 0xB081, 0xB0A0, 0x3FD5,
+ 0xB0A1, 0xB0FE, 0x043E, 0xB141, 0xB15A, 0x3FF5, 0xB161, 0xB17A, 0x400F,
+ 0xB181, 0xB1A0, 0x4029, 0xB1A1, 0xB1FE, 0x049C, 0xB241, 0xB25A, 0x4049,
+ 0xB261, 0xB27A, 0x4063, 0xB281, 0xB2A0, 0x407D, 0xB2A1, 0xB2FE, 0x04FA,
+ 0xB341, 0xB35A, 0x409D, 0xB361, 0xB37A, 0x40B7, 0xB381, 0xB3A0, 0x40D1,
+ 0xB3A1, 0xB3FE, 0x0558, 0xB441, 0xB45A, 0x40F1, 0xB461, 0xB47A, 0x410B,
+ 0xB481, 0xB4A0, 0x4125, 0xB4A1, 0xB4FE, 0x05B6, 0xB541, 0xB55A, 0x4145,
+ 0xB561, 0xB57A, 0x415F, 0xB581, 0xB5A0, 0x4179, 0xB5A1, 0xB5FE, 0x0614,
+ 0xB641, 0xB65A, 0x4199, 0xB661, 0xB67A, 0x41B3, 0xB681, 0xB6A0, 0x41CD,
+ 0xB6A1, 0xB6FE, 0x0672, 0xB741, 0xB75A, 0x41ED, 0xB761, 0xB77A, 0x4207,
+ 0xB781, 0xB7A0, 0x4221, 0xB7A1, 0xB7FE, 0x06D0, 0xB841, 0xB85A, 0x4241,
+ 0xB861, 0xB87A, 0x425B, 0xB881, 0xB8A0, 0x4275, 0xB8A1, 0xB8FE, 0x072E,
+ 0xB941, 0xB95A, 0x4295, 0xB961, 0xB97A, 0x42AF, 0xB981, 0xB9A0, 0x42C9,
+ 0xB9A1, 0xB9FE, 0x078C, 0xBA41, 0xBA5A, 0x42E9, 0xBA61, 0xBA7A, 0x4303,
+ 0xBA81, 0xBAA0, 0x431D, 0xBAA1, 0xBAFE, 0x07EA, 0xBB41, 0xBB5A, 0x433D,
+ 0xBB61, 0xBB7A, 0x4357, 0xBB81, 0xBBA0, 0x4371, 0xBBA1, 0xBBFE, 0x0848,
+ 0xBC41, 0xBC5A, 0x4391, 0xBC61, 0xBC7A, 0x43AB, 0xBC81, 0xBCA0, 0x43C5,
+ 0xBCA1, 0xBCFE, 0x08A6, 0xBD41, 0xBD5A, 0x43E5, 0xBD61, 0xBD7A, 0x43FF,
+ 0xBD81, 0xBDA0, 0x4419, 0xBDA1, 0xBDFE, 0x0904, 0xBE41, 0xBE5A, 0x4439,
+ 0xBE61, 0xBE7A, 0x4453, 0xBE81, 0xBEA0, 0x446D, 0xBEA1, 0xBEFE, 0x0962,
+ 0xBF41, 0xBF5A, 0x448D, 0xBF61, 0xBF7A, 0x44A7, 0xBF81, 0xBFA0, 0x44C1,
+ 0xBFA1, 0xBFFE, 0x09C0, 0xC041, 0xC05A, 0x44E1, 0xC061, 0xC07A, 0x44FB,
+ 0xC081, 0xC0A0, 0x4515, 0xC0A1, 0xC0FE, 0x0A1E, 0xC141, 0xC15A, 0x4535,
+ 0xC161, 0xC17A, 0x454F, 0xC181, 0xC1A0, 0x4569, 0xC1A1, 0xC1FE, 0x0A7C,
+ 0xC241, 0xC25A, 0x4589, 0xC261, 0xC27A, 0x45A3, 0xC281, 0xC2A0, 0x45BD,
+ 0xC2A1, 0xC2FE, 0x0ADA, 0xC341, 0xC35A, 0x45DD, 0xC361, 0xC37A, 0x45F7,
+ 0xC381, 0xC3A0, 0x4611, 0xC3A1, 0xC3FE, 0x0B38, 0xC441, 0xC45A, 0x4631,
+ 0xC461, 0xC47A, 0x464B, 0xC481, 0xC4A0, 0x4665, 0xC4A1, 0xC4FE, 0x0B96,
+ 0xC541, 0xC55A, 0x4685, 0xC561, 0xC57A, 0x469F, 0xC581, 0xC5A0, 0x46B9,
+ 0xC5A1, 0xC5FE, 0x0BF4, 0xC641, 0xC652, 0x46D9, 0xC6A1, 0xC6FE, 0x0C52,
+ 0xC7A1, 0xC7FE, 0x0CB0, 0xC8A1, 0xC8FE, 0x0D0E, 0xCAA1, 0xCAFE, 0x0D6C,
+ 0xCBA1, 0xCBCF, 0x0DCA, 0xCBD0, 0xCBD0, 0x1014, 0xCBD1, 0xCBD5, 0x0DF9,
+ 0xCBD6, 0xCBD6, 0x0E5E, 0xCBD7, 0xCBE6, 0x0DFE, 0xCBE7, 0xCBE7, 0x1B8D,
+ 0xCBE8, 0xCBFE, 0x0E0E, 0xCCA1, 0xCCFE, 0x0E25, 0xCDA1, 0xCDCE, 0x0E83,
+ 0xCDCF, 0xCDCF, 0x0D84, 0xCDD0, 0xCDE7, 0x0EB1, 0xCDE8, 0xCDE8, 0x1EDC,
+ 0xCDE9, 0xCDFE, 0x0EC9, 0xCEA1, 0xCEAC, 0x0EDF, 0xCEAD, 0xCEAD, 0x0EDA,
+ 0xCEAE, 0xCEFE, 0x0EEB, 0xCFA1, 0xCFFA, 0x0F3C, 0xCFFB, 0xCFFB, 0x0F3E,
+ 0xCFFC, 0xCFFE, 0x0F96, 0xD0A1, 0xD0A1, 0x0F99, 0xD0A2, 0xD0A2, 0x0F6A,
+ 0xD0A3, 0xD0B7, 0x0F9A, 0xD0B8, 0xD0B8, 0x0F6A, 0xD0B9, 0xD0CF, 0x0FAF,
+ 0xD0D0, 0xD0D0, 0x0E7C, 0xD0D1, 0xD0DC, 0x0FC6, 0xD0DD, 0xD0DD, 0x1023,
+ 0xD0DE, 0xD0FE, 0x0FD2, 0xD1A1, 0xD1D3, 0x0FF3, 0xD1D4, 0xD1D4, 0x1116,
+ 0xD1D5, 0xD1D5, 0x103C, 0xD1D6, 0xD1D7, 0x1026, 0xD1D8, 0xD1D8, 0x1117,
+ 0xD1D9, 0xD1DA, 0x1028, 0xD1DB, 0xD1E0, 0x1118, 0xD1E1, 0xD1E1, 0x102A,
+ 0xD1E2, 0xD1E2, 0x16A8, 0xD1E3, 0xD1E5, 0x111E, 0xD1E6, 0xD1E6, 0x1122,
+ 0xD1E7, 0xD1E7, 0x102B, 0xD1E8, 0xD1EB, 0x1123, 0xD1EC, 0xD1EC, 0x102C,
+ 0xD1ED, 0xD1ED, 0x1127, 0xD1EE, 0xD1EE, 0x102D, 0xD1EF, 0xD1F0, 0x112A,
+ 0xD1F1, 0xD1F1, 0x102E, 0xD1F2, 0xD1F2, 0x112C, 0xD1F3, 0xD1F5, 0x102F,
+ 0xD1F6, 0xD1F6, 0x112F, 0xD1F7, 0xD1F9, 0x1032, 0xD1FA, 0xD1FA, 0x1133,
+ 0xD1FB, 0xD1FB, 0x1035, 0xD1FC, 0xD1FD, 0x1136, 0xD1FE, 0xD1FE, 0x1139,
+ 0xD2A1, 0xD2A1, 0x1036, 0xD2A2, 0xD2A3, 0x113A, 0xD2A4, 0xD2A6, 0x1037,
+ 0xD2A7, 0xD2AA, 0x113C, 0xD2AB, 0xD2AB, 0x1143, 0xD2AC, 0xD2AC, 0x103A,
+ 0xD2AD, 0xD2AD, 0x1144, 0xD2AE, 0xD2B1, 0x103B, 0xD2B2, 0xD2B2, 0x1148,
+ 0xD2B3, 0xD2BD, 0x103F, 0xD2BE, 0xD2BE, 0x119F, 0xD2BF, 0xD2C1, 0x104A,
+ 0xD2C2, 0xD2C3, 0x11A1, 0xD2C4, 0xD2C4, 0x11A5, 0xD2C5, 0xD2C5, 0x104D,
+ 0xD2C6, 0xD2CA, 0x11A6, 0xD2CB, 0xD2CB, 0x11AC, 0xD2CC, 0xD2CC, 0x104E,
+ 0xD2CD, 0xD2CE, 0x11AD, 0xD2CF, 0xD2D4, 0x11B0, 0xD2D5, 0xD2D7, 0x11B7,
+ 0xD2D8, 0xD2D8, 0x104F, 0xD2D9, 0xD2DA, 0x11BD, 0xD2DB, 0xD2DD, 0x1050,
+ 0xD2DE, 0xD2DF, 0x11C1, 0xD2E0, 0xD2E0, 0x1053, 0xD2E1, 0xD2E1, 0x11C3,
+ 0xD2E2, 0xD2E2, 0x11C6, 0xD2E3, 0xD2E3, 0x1054, 0xD2E4, 0xD2E4, 0x11D4,
+ 0xD2E5, 0xD2E8, 0x11D6, 0xD2E9, 0xD2EA, 0x11DB, 0xD2EB, 0xD2EB, 0x11E0,
+ 0xD2EC, 0xD2EF, 0x1055, 0xD2F0, 0xD2F3, 0x11FC, 0xD2F4, 0xD2F5, 0x1201,
+ 0xD2F6, 0xD2F6, 0x1059, 0xD2F7, 0xD2F8, 0x1203, 0xD2F9, 0xD2FE, 0x105A,
+ 0xD3A1, 0xD3FE, 0x1060, 0xD4A1, 0xD4E5, 0x10BE, 0xD4E6, 0xD4E6, 0x10DE,
+ 0xD4E7, 0xD4FB, 0x1103, 0xD4FC, 0xD4FC, 0x1028, 0xD4FD, 0xD4FE, 0x1118,
+ 0xD5A1, 0xD5A4, 0x111A, 0xD5A5, 0xD5A5, 0x16A8, 0xD5A6, 0xD5AA, 0x111E,
+ 0xD5AB, 0xD5AB, 0x102B, 0xD5AC, 0xD5AD, 0x1123, 0xD5AE, 0xD5AE, 0x1060,
+ 0xD5AF, 0xD5FE, 0x1125, 0xD6A1, 0xD6B7, 0x1175, 0xD6B8, 0xD6B8, 0x1047,
+ 0xD6B9, 0xD6CC, 0x118C, 0xD6CD, 0xD6CD, 0x104C, 0xD6CE, 0xD6FE, 0x11A0,
+ 0xD7A1, 0xD7CA, 0x11D1, 0xD7CB, 0xD7CB, 0x15B0, 0xD7CC, 0xD7E3, 0x11FB,
+ 0xD7E4, 0xD7E4, 0x1918, 0xD7E5, 0xD7FE, 0x1213, 0xD8A1, 0xD8FE, 0x122D,
+ 0xD9A1, 0xD9FE, 0x128B, 0xDAA1, 0xDAFE, 0x12E9, 0xDBA1, 0xDBC4, 0x1347,
+ 0xDBC5, 0xDBC5, 0x141F, 0xDBC6, 0xDBE3, 0x136B, 0xDBE4, 0xDBE4, 0x133A,
+ 0xDBE5, 0xDBFE, 0x1389, 0xDCA1, 0xDCA4, 0x13A3, 0xDCA5, 0xDCA5, 0x1D5E,
+ 0xDCA6, 0xDCFE, 0x13A7, 0xDDA1, 0xDDA4, 0x1400, 0xDDA5, 0xDDA5, 0x13D7,
+ 0xDDA6, 0xDDD4, 0x1404, 0xDDD5, 0xDDD5, 0x13F5, 0xDDD6, 0xDDF3, 0x1433,
+ 0xDDF4, 0xDDF4, 0x1DB7, 0xDDF5, 0xDDFE, 0x1451, 0xDEA1, 0xDEFB, 0x145B,
+ 0xDEFC, 0xDEFC, 0x15D0, 0xDEFD, 0xDEFD, 0x14B6, 0xDEFE, 0xDEFE, 0x14F7,
+ 0xDFA1, 0xDFB2, 0x14B7, 0xDFB3, 0xDFB3, 0x1BAB, 0xDFB4, 0xDFE0, 0x14C9,
+ 0xDFE1, 0xDFE1, 0x14F2, 0xDFE2, 0xDFE7, 0x14F6, 0xDFE8, 0xDFE8, 0x156D,
+ 0xDFE9, 0xDFFE, 0x14FC, 0xE0A1, 0xE0F0, 0x1512, 0xE0F1, 0xE0F1, 0x1771,
+ 0xE0F2, 0xE0FE, 0x1562, 0xE1A1, 0xE1AC, 0x156F, 0xE1AD, 0xE1AD, 0x1554,
+ 0xE1AE, 0xE1EC, 0x157B, 0xE1ED, 0xE1ED, 0x14C5, 0xE1EE, 0xE1FE, 0x15BA,
+ 0xE2A1, 0xE2FE, 0x15CB, 0xE3A1, 0xE3F4, 0x1629, 0xE3F5, 0xE3F5, 0x1B61,
+ 0xE3F6, 0xE3FE, 0x167D, 0xE4A1, 0xE4A1, 0x1CCA, 0xE4A2, 0xE4A8, 0x1686,
+ 0xE4A9, 0xE4A9, 0x162E, 0xE4AA, 0xE4FE, 0x168D, 0xE5A1, 0xE5AD, 0x16E2,
+ 0xE5AE, 0xE5AE, 0x16F2, 0xE5AF, 0xE5B0, 0x16EF, 0xE5B1, 0xE5B2, 0x1149,
+ 0xE5B3, 0xE5B8, 0x16F1, 0xE5B9, 0xE5B9, 0x114B, 0xE5BA, 0xE5BA, 0x16F7,
+ 0xE5BB, 0xE5BC, 0x114D, 0xE5BD, 0xE5C3, 0x16F8, 0xE5C4, 0xE5C4, 0x114F,
+ 0xE5C5, 0xE5CD, 0x16FF, 0xE5CE, 0xE5CE, 0x1153, 0xE5CF, 0xE5CF, 0x1708,
+ 0xE5D0, 0xE5D0, 0x1154, 0xE5D1, 0xE5D1, 0x1709, 0xE5D2, 0xE5D2, 0x1155,
+ 0xE5D3, 0xE5D5, 0x170A, 0xE5D6, 0xE5D6, 0x1157, 0xE5D7, 0xE5F9, 0x170D,
+ 0xE5FA, 0xE5FB, 0x115A, 0xE5FC, 0xE5FC, 0x103F, 0xE5FD, 0xE5FD, 0x1730,
+ 0xE5FE, 0xE5FE, 0x115C, 0xE6A1, 0xE6A1, 0x115F, 0xE6A2, 0xE6A3, 0x1731,
+ 0xE6A4, 0xE6A4, 0x1161, 0xE6A5, 0xE6A6, 0x1733, 0xE6A7, 0xE6A7, 0x1162,
+ 0xE6A8, 0xE6AC, 0x1735, 0xE6AD, 0xE6AD, 0x1165, 0xE6AE, 0xE6AE, 0x173A,
+ 0xE6AF, 0xE6B1, 0x1167, 0xE6B2, 0xE6B2, 0x173B, 0xE6B3, 0xE6B3, 0x116A,
+ 0xE6B4, 0xE6B6, 0x173C, 0xE6B7, 0xE6B8, 0x116B, 0xE6B9, 0xE6BB, 0x173F,
+ 0xE6BC, 0xE6BC, 0x116F, 0xE6BD, 0xE6C3, 0x1742, 0xE6C4, 0xE6C4, 0x1040,
+ 0xE6C5, 0xE6C5, 0x1749, 0xE6C6, 0xE6C7, 0x1171, 0xE6C8, 0xE6C9, 0x174A,
+ 0xE6CA, 0xE6CA, 0x1041, 0xE6CB, 0xE6D1, 0x174C, 0xE6D2, 0xE6D2, 0x1174,
+ 0xE6D3, 0xE6D5, 0x1753, 0xE6D6, 0xE6D6, 0x1175, 0xE6D7, 0xE6D8, 0x1756,
+ 0xE6D9, 0xE6D9, 0x1176, 0xE6DA, 0xE6DB, 0x1758, 0xE6DC, 0xE6DC, 0x1042,
+ 0xE6DD, 0xE6DE, 0x175A, 0xE6DF, 0xE6DF, 0x1177, 0xE6E0, 0xE6E0, 0x175C,
+ 0xE6E1, 0xE6E1, 0x1178, 0xE6E2, 0xE6E3, 0x175D, 0xE6E4, 0xE6E4, 0x117A,
+ 0xE6E5, 0xE6E5, 0x1179, 0xE6E6, 0xE6E6, 0x117B, 0xE6E7, 0xE6E7, 0x175F,
+ 0xE6E8, 0xE6E8, 0x117C, 0xE6E9, 0xE6E9, 0x1760, 0xE6EA, 0xE6EB, 0x117E,
+ 0xE6EC, 0xE6EC, 0x192F, 0xE6ED, 0xE6EE, 0x1761, 0xE6EF, 0xE6EF, 0x1181,
+ 0xE6F0, 0xE6F0, 0x1763, 0xE6F1, 0xE6F1, 0x1182, 0xE6F2, 0xE6F2, 0x1554,
+ 0xE6F3, 0xE6F4, 0x1764, 0xE6F5, 0xE6F5, 0x1183, 0xE6F6, 0xE6F6, 0x1043,
+ 0xE6F7, 0xE6F7, 0x1046, 0xE6F8, 0xE6F8, 0x1766, 0xE6F9, 0xE6F9, 0x1185,
+ 0xE6FA, 0xE6FE, 0x1767, 0xE7A1, 0xE7A1, 0x1187, 0xE7A2, 0xE7A5, 0x176C,
+ 0xE7A6, 0xE7A6, 0x1188, 0xE7A7, 0xE7A8, 0x1770, 0xE7A9, 0xE7A9, 0x1189,
+ 0xE7AA, 0xE7AA, 0x118B, 0xE7AB, 0xE7AB, 0x1772, 0xE7AC, 0xE7AC, 0x1047,
+ 0xE7AD, 0xE7AD, 0x118D, 0xE7AE, 0xE7AF, 0x1773, 0xE7B0, 0xE7B0, 0x118E,
+ 0xE7B1, 0xE7BE, 0x1775, 0xE7BF, 0xE7BF, 0x118F, 0xE7C0, 0xE7C0, 0x1783,
+ 0xE7C1, 0xE7C1, 0x1E67, 0xE7C2, 0xE7C5, 0x1784, 0xE7C6, 0xE7C6, 0x1191,
+ 0xE7C7, 0xE7C7, 0x1193, 0xE7C8, 0xE7CA, 0x1788, 0xE7CB, 0xE7CB, 0x1195,
+ 0xE7CC, 0xE7CC, 0x178B, 0xE7CD, 0xE7CD, 0x1196, 0xE7CE, 0xE7CE, 0x178C,
+ 0xE7CF, 0xE7D0, 0x1197, 0xE7D1, 0xE7D2, 0x178D, 0xE7D3, 0xE7D3, 0x119A,
+ 0xE7D4, 0xE7DE, 0x178F, 0xE7DF, 0xE7DF, 0x119C, 0xE7E0, 0xE7E3, 0x179A,
+ 0xE7E4, 0xE7E4, 0x119D, 0xE7E5, 0xE7E5, 0x179E, 0xE7E6, 0xE7E6, 0x119E,
+ 0xE7E7, 0xE7F6, 0x179F, 0xE7F7, 0xE7F7, 0x16A5, 0xE7F8, 0xE7FE, 0x17AF,
+ 0xE8A1, 0xE8E6, 0x17B6, 0xE8E7, 0xE8E8, 0x11C7, 0xE8E9, 0xE8EF, 0x17FC,
+ 0xE8F0, 0xE8F0, 0x11C9, 0xE8F1, 0xE8F1, 0x1054, 0xE8F2, 0xE8F6, 0x1803,
+ 0xE8F7, 0xE8F7, 0x11CB, 0xE8F8, 0xE8F8, 0x1808, 0xE8F9, 0xE8F9, 0x16A8,
+ 0xE8FA, 0xE8FA, 0x1809, 0xE8FB, 0xE8FB, 0x11CC, 0xE8FC, 0xE8FD, 0x180A,
+ 0xE8FE, 0xE8FE, 0x11CD, 0xE9A1, 0xE9A6, 0x180C, 0xE9A7, 0xE9A7, 0x11D0,
+ 0xE9A8, 0xE9AB, 0x1812, 0xE9AC, 0xE9AC, 0x11D1, 0xE9AD, 0xE9CB, 0x1816,
+ 0xE9CC, 0xE9CC, 0x11D3, 0xE9CD, 0xE9F6, 0x1835, 0xE9F7, 0xE9F7, 0x1F34,
+ 0xE9F8, 0xE9FE, 0x185F, 0xEAA1, 0xEAC0, 0x1866, 0xEAC1, 0xEAC1, 0x17EB,
+ 0xEAC2, 0xEAE4, 0x1886, 0xEAE5, 0xEAE5, 0x11E1, 0xEAE6, 0xEAF3, 0x18A9,
+ 0xEAF4, 0xEAF4, 0x1057, 0xEAF5, 0xEAF6, 0x18B7, 0xEAF7, 0xEAF7, 0x11E3,
+ 0xEAF8, 0xEAFB, 0x18B9, 0xEAFC, 0xEAFC, 0x11E5, 0xEAFD, 0xEAFD, 0x18BD,
+ 0xEAFE, 0xEAFE, 0x11E6, 0xEBA1, 0xEBA3, 0x18BE, 0xEBA4, 0xEBA4, 0x11E8,
+ 0xEBA5, 0xEBA6, 0x18C1, 0xEBA7, 0xEBA7, 0x11EA, 0xEBA8, 0xEBA8, 0x18C3,
+ 0xEBA9, 0xEBA9, 0x11EC, 0xEBAA, 0xEBAA, 0x1058, 0xEBAB, 0xEBB9, 0x18C4,
+ 0xEBBA, 0xEBBB, 0x11EE, 0xEBBC, 0xEBBC, 0x18D3, 0xEBBD, 0xEBBD, 0x11F0,
+ 0xEBBE, 0xEBC0, 0x18D4, 0xEBC1, 0xEBC1, 0x11F1, 0xEBC2, 0xEBC2, 0x11F3,
+ 0xEBC3, 0xEBC5, 0x18D7, 0xEBC6, 0xEBC7, 0x11F4, 0xEBC8, 0xEBCB, 0x18DA,
+ 0xEBCC, 0xEBCC, 0x11F7, 0xEBCD, 0xEBCE, 0x18DE, 0xEBCF, 0xEBD1, 0x11F8,
+ 0xEBD2, 0xEBD2, 0x15B0, 0xEBD3, 0xEBD7, 0x18E0, 0xEBD8, 0xEBD8, 0x11FB,
+ 0xEBD9, 0xEBFE, 0x18E5, 0xECA1, 0xECA5, 0x190B, 0xECA6, 0xECA6, 0x1206,
+ 0xECA7, 0xECA7, 0x1208, 0xECA8, 0xECA9, 0x1910, 0xECAA, 0xECAA, 0x120A,
+ 0xECAB, 0xECAE, 0x1912, 0xECAF, 0xECAF, 0x173E, 0xECB0, 0xECB1, 0x120C,
+ 0xECB2, 0xECB2, 0x105B, 0xECB3, 0xECB4, 0x1916, 0xECB5, 0xECB5, 0x1211,
+ 0xECB6, 0xECB7, 0x1918, 0xECB8, 0xECB8, 0x1213, 0xECB9, 0xECB9, 0x191A,
+ 0xECBA, 0xECBA, 0x1215, 0xECBB, 0xECBF, 0x191B, 0xECC0, 0xECC1, 0x1218,
+ 0xECC2, 0xECC4, 0x1920, 0xECC5, 0xECC5, 0x121A, 0xECC6, 0xECC6, 0x121C,
+ 0xECC7, 0xECC8, 0x1923, 0xECC9, 0xECCA, 0x105C, 0xECCB, 0xECD4, 0x1925,
+ 0xECD5, 0xECD5, 0x121E, 0xECD6, 0xECDC, 0x192F, 0xECDD, 0xECDE, 0x1220,
+ 0xECDF, 0xECE0, 0x1936, 0xECE1, 0xECE1, 0x1222, 0xECE2, 0xECE3, 0x1938,
+ 0xECE4, 0xECE4, 0x1224, 0xECE5, 0xECE6, 0x193A, 0xECE7, 0xECE8, 0x1225,
+ 0xECE9, 0xECF6, 0x193C, 0xECF7, 0xECF8, 0x1227, 0xECF9, 0xECF9, 0x194A,
+ 0xECFA, 0xECFA, 0x122A, 0xECFB, 0xECFE, 0x194B, 0xEDA1, 0xEDA3, 0x122D,
+ 0xEDA4, 0xEDED, 0x194F, 0xEDEE, 0xEDEE, 0x14E7, 0xEDEF, 0xEDFE, 0x1999,
+ 0xEEA1, 0xEEDA, 0x19A9, 0xEEDB, 0xEEDB, 0x195E, 0xEEDC, 0xEEFE, 0x19E3,
+ 0xEFA1, 0xEFFE, 0x1A06, 0xF0A1, 0xF0FE, 0x1A64, 0xF1A1, 0xF1FE, 0x1AC2,
+ 0xF2A1, 0xF2BC, 0x1B20, 0xF2BD, 0xF2BD, 0x1663, 0xF2BE, 0xF2F9, 0x1B3C,
+ 0xF2FA, 0xF2FA, 0x168B, 0xF2FB, 0xF2FE, 0x1B78, 0xF3A1, 0xF3B0, 0x1B7C,
+ 0xF3B1, 0xF3B1, 0x105F, 0xF3B2, 0xF3FE, 0x1B8C, 0xF4A1, 0xF4A6, 0x1BD9,
+ 0xF4A7, 0xF4A7, 0x1954, 0xF4A8, 0xF4ED, 0x1BDF, 0xF4EE, 0xF4EE, 0x1A1C,
+ 0xF4EF, 0xF4FE, 0x1C25, 0xF5A1, 0xF5FE, 0x1C35, 0xF6A1, 0xF6F3, 0x1C93,
+ 0xF6F4, 0xF6F4, 0x10B7, 0xF6F5, 0xF6F5, 0x1CE6, 0xF6F6, 0xF6F6, 0x1BE3,
+ 0xF6F7, 0xF6FE, 0x1CE7, 0xF7A1, 0xF7B7, 0x1CEF, 0xF7B8, 0xF7B8, 0x1097,
+ 0xF7B9, 0xF7C7, 0x1D06, 0xF7C8, 0xF7C8, 0x10AA, 0xF7C9, 0xF7D2, 0x1D15,
+ 0xF7D3, 0xF7D3, 0x10F4, 0xF7D4, 0xF7FE, 0x1D1F, 0xF8A1, 0xF8DA, 0x1D4A,
+ 0xF8DB, 0xF8DB, 0x1D94, 0xF8DC, 0xF8EF, 0x1D84, 0xF8F0, 0xF8F0, 0x13E0,
+ 0xF8F1, 0xF8FE, 0x1D98, 0xF9A1, 0xF9FE, 0x1DA6, 0xFAA1, 0xFAA1, 0x1E1D,
+ 0xFAA2, 0xFAA2, 0x0DE6, 0xFAA3, 0xFAE5, 0x1E04, 0xFAE6, 0xFAE6, 0x0E3C,
+ 0xFAE7, 0xFAFE, 0x1E47, 0xFBA1, 0xFBFE, 0x1E5F, 0xFCA1, 0xFCA8, 0x1EBD,
+ 0xFCA9, 0xFCA9, 0x0EE7, 0xFCAA, 0xFCFE, 0x1EC5, 0xFDA1, 0xFDFE, 0x1F1A,
+};
diff --git a/core/src/fpdfapi/fpdf_cmaps/Korea1/KSCpc-EUC-H_0.cpp b/core/src/fpdfapi/fpdf_cmaps/Korea1/KSCpc-EUC-H_0.cpp
index b062fc6316..9cb420d74e 100644
--- a/core/src/fpdfapi/fpdf_cmaps/Korea1/KSCpc-EUC-H_0.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/Korea1/KSCpc-EUC-H_0.cpp
@@ -1,178 +1,178 @@
-// 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
-
-extern const unsigned short g_FXCMAP_KSCpc_EUC_H_0[509 * 3] = {
- 0x0020, 0x007E, 0x0001, 0x0081, 0x0083, 0x0060, 0x00FE, 0x00FF, 0x0063,
- 0xA141, 0xA17D, 0x1FFF, 0xA181, 0xA19A, 0x203C, 0xA19C, 0xA1A0, 0x2056,
- 0xA1A1, 0xA1A1, 0x0065, 0xA1A2, 0xA1A3, 0x205B, 0xA1A4, 0xA1FE, 0x0068,
- 0xA241, 0xA24C, 0x205D, 0xA2A1, 0xA2E5, 0x00C3, 0xA2E6, 0xA2FE, 0x2069,
- 0xA341, 0xA37D, 0x2082, 0xA381, 0xA39F, 0x20BF, 0xA3A1, 0xA3FE, 0x0108,
- 0xA441, 0xA47D, 0x20DE, 0xA481, 0xA49F, 0x211B, 0xA4A1, 0xA4D3, 0x0166,
- 0xA4D5, 0xA4FE, 0x0199, 0xA541, 0xA57D, 0x213A, 0xA581, 0xA58B, 0x2177,
- 0xA5A1, 0xA5AA, 0x01C3, 0xA5B0, 0xA5B9, 0x01CD, 0xA5C1, 0xA5D8, 0x01D7,
- 0xA5DA, 0xA5DE, 0x2182, 0xA5E1, 0xA5F8, 0x01EF, 0xA5F9, 0xA5FC, 0x2187,
- 0xA641, 0xA67D, 0x218B, 0xA681, 0xA68A, 0x21C8, 0xA68D, 0xA693, 0x21D2,
- 0xA696, 0xA69B, 0x21D9, 0xA69E, 0xA69F, 0x21DF, 0xA6A1, 0xA6E4, 0x0207,
- 0xA6E5, 0xA6FE, 0x21E1, 0xA741, 0xA77D, 0x21FB, 0xA781, 0xA79F, 0x2238,
- 0xA7A1, 0xA7EF, 0x024B, 0xA7F0, 0xA7FE, 0x2257, 0xA841, 0xA87D, 0x2266,
- 0xA881, 0xA89F, 0x22A3, 0xA8A1, 0xA8A4, 0x029A, 0xA8A6, 0xA8A6, 0x029E,
- 0xA8A8, 0xA8AF, 0x029F, 0xA8B1, 0xA8FE, 0x02A7, 0xA941, 0xA974, 0x22C2,
- 0xA9A1, 0xA9FE, 0x02F5, 0xAA41, 0xAA7D, 0x22F6, 0xAA81, 0xAA9F, 0x2333,
- 0xAAA1, 0xAAF3, 0x0353, 0xAAF4, 0xAAFE, 0x2352, 0xAB41, 0xAB7D, 0x235D,
- 0xAB81, 0xAB9F, 0x239A, 0xABA1, 0xABF6, 0x03A6, 0xABF7, 0xABFA, 0x23B9,
- 0xABFB, 0xABFD, 0x2472, 0xAC41, 0xAC7D, 0x23BD, 0xAC81, 0xAC97, 0x23FA,
- 0xACA1, 0xACC1, 0x03FC, 0xACC2, 0xACD0, 0x2411, 0xACD1, 0xACF1, 0x041D,
- 0xACF2, 0xACF6, 0x2420, 0xAD41, 0xAD7D, 0x2425, 0xADA1, 0xADB0, 0x2462,
- 0xB0A1, 0xB0FE, 0x043E, 0xB1A1, 0xB1FE, 0x049C, 0xB2A1, 0xB2FE, 0x04FA,
- 0xB3A1, 0xB3FE, 0x0558, 0xB4A1, 0xB4FE, 0x05B6, 0xB5A1, 0xB5FE, 0x0614,
- 0xB6A1, 0xB6FE, 0x0672, 0xB7A1, 0xB7FE, 0x06D0, 0xB8A1, 0xB8FE, 0x072E,
- 0xB9A1, 0xB9FE, 0x078C, 0xBAA1, 0xBAFE, 0x07EA, 0xBBA1, 0xBBFE, 0x0848,
- 0xBCA1, 0xBCFE, 0x08A6, 0xBDA1, 0xBDFE, 0x0904, 0xBEA1, 0xBEFE, 0x0962,
- 0xBFA1, 0xBFFE, 0x09C0, 0xC0A1, 0xC0FE, 0x0A1E, 0xC1A1, 0xC1FE, 0x0A7C,
- 0xC2A1, 0xC2FE, 0x0ADA, 0xC3A1, 0xC3FE, 0x0B38, 0xC4A1, 0xC4FE, 0x0B96,
- 0xC5A1, 0xC5FE, 0x0BF4, 0xC6A1, 0xC6FE, 0x0C52, 0xC7A1, 0xC7FE, 0x0CB0,
- 0xC8A1, 0xC8FE, 0x0D0E, 0xCAA1, 0xCAFE, 0x0D6C, 0xCBA1, 0xCBCF, 0x0DCA,
- 0xCBD0, 0xCBD0, 0x1014, 0xCBD1, 0xCBD5, 0x0DF9, 0xCBD6, 0xCBD6, 0x0E5E,
- 0xCBD7, 0xCBE6, 0x0DFE, 0xCBE7, 0xCBE7, 0x1B8D, 0xCBE8, 0xCBFE, 0x0E0E,
- 0xCCA1, 0xCCFE, 0x0E25, 0xCDA1, 0xCDCE, 0x0E83, 0xCDCF, 0xCDCF, 0x0D84,
- 0xCDD0, 0xCDE7, 0x0EB1, 0xCDE8, 0xCDE8, 0x1EDC, 0xCDE9, 0xCDFE, 0x0EC9,
- 0xCEA1, 0xCEAC, 0x0EDF, 0xCEAD, 0xCEAD, 0x0EDA, 0xCEAE, 0xCEFE, 0x0EEB,
- 0xCFA1, 0xCFFA, 0x0F3C, 0xCFFB, 0xCFFB, 0x0F3E, 0xCFFC, 0xCFFE, 0x0F96,
- 0xD0A1, 0xD0A1, 0x0F99, 0xD0A2, 0xD0A2, 0x0F6A, 0xD0A3, 0xD0B7, 0x0F9A,
- 0xD0B8, 0xD0B8, 0x0F6A, 0xD0B9, 0xD0CF, 0x0FAF, 0xD0D0, 0xD0D0, 0x0E7C,
- 0xD0D1, 0xD0DC, 0x0FC6, 0xD0DD, 0xD0DD, 0x1023, 0xD0DE, 0xD0FE, 0x0FD2,
- 0xD1A1, 0xD1D3, 0x0FF3, 0xD1D4, 0xD1D4, 0x1116, 0xD1D5, 0xD1D5, 0x103C,
- 0xD1D6, 0xD1D7, 0x1026, 0xD1D8, 0xD1D8, 0x1117, 0xD1D9, 0xD1DA, 0x1028,
- 0xD1DB, 0xD1E0, 0x1118, 0xD1E1, 0xD1E1, 0x102A, 0xD1E2, 0xD1E2, 0x16A8,
- 0xD1E3, 0xD1E5, 0x111E, 0xD1E6, 0xD1E6, 0x1122, 0xD1E7, 0xD1E7, 0x102B,
- 0xD1E8, 0xD1EB, 0x1123, 0xD1EC, 0xD1EC, 0x102C, 0xD1ED, 0xD1ED, 0x1127,
- 0xD1EE, 0xD1EE, 0x102D, 0xD1EF, 0xD1F0, 0x112A, 0xD1F1, 0xD1F1, 0x102E,
- 0xD1F2, 0xD1F2, 0x112C, 0xD1F3, 0xD1F5, 0x102F, 0xD1F6, 0xD1F6, 0x112F,
- 0xD1F7, 0xD1F9, 0x1032, 0xD1FA, 0xD1FA, 0x1133, 0xD1FB, 0xD1FB, 0x1035,
- 0xD1FC, 0xD1FD, 0x1136, 0xD1FE, 0xD1FE, 0x1139, 0xD2A1, 0xD2A1, 0x1036,
- 0xD2A2, 0xD2A3, 0x113A, 0xD2A4, 0xD2A6, 0x1037, 0xD2A7, 0xD2AA, 0x113C,
- 0xD2AB, 0xD2AB, 0x1143, 0xD2AC, 0xD2AC, 0x103A, 0xD2AD, 0xD2AD, 0x1144,
- 0xD2AE, 0xD2B1, 0x103B, 0xD2B2, 0xD2B2, 0x1148, 0xD2B3, 0xD2BD, 0x103F,
- 0xD2BE, 0xD2BE, 0x119F, 0xD2BF, 0xD2C1, 0x104A, 0xD2C2, 0xD2C3, 0x11A1,
- 0xD2C4, 0xD2C4, 0x11A5, 0xD2C5, 0xD2C5, 0x104D, 0xD2C6, 0xD2CA, 0x11A6,
- 0xD2CB, 0xD2CB, 0x11AC, 0xD2CC, 0xD2CC, 0x104E, 0xD2CD, 0xD2CE, 0x11AD,
- 0xD2CF, 0xD2D4, 0x11B0, 0xD2D5, 0xD2D7, 0x11B7, 0xD2D8, 0xD2D8, 0x104F,
- 0xD2D9, 0xD2DA, 0x11BD, 0xD2DB, 0xD2DD, 0x1050, 0xD2DE, 0xD2DF, 0x11C1,
- 0xD2E0, 0xD2E0, 0x1053, 0xD2E1, 0xD2E1, 0x11C3, 0xD2E2, 0xD2E2, 0x11C6,
- 0xD2E3, 0xD2E3, 0x1054, 0xD2E4, 0xD2E4, 0x11D4, 0xD2E5, 0xD2E8, 0x11D6,
- 0xD2E9, 0xD2EA, 0x11DB, 0xD2EB, 0xD2EB, 0x11E0, 0xD2EC, 0xD2EF, 0x1055,
- 0xD2F0, 0xD2F3, 0x11FC, 0xD2F4, 0xD2F5, 0x1201, 0xD2F6, 0xD2F6, 0x1059,
- 0xD2F7, 0xD2F8, 0x1203, 0xD2F9, 0xD2FE, 0x105A, 0xD3A1, 0xD3FE, 0x1060,
- 0xD4A1, 0xD4E5, 0x10BE, 0xD4E6, 0xD4E6, 0x10DE, 0xD4E7, 0xD4FB, 0x1103,
- 0xD4FC, 0xD4FC, 0x1028, 0xD4FD, 0xD4FE, 0x1118, 0xD5A1, 0xD5A4, 0x111A,
- 0xD5A5, 0xD5A5, 0x16A8, 0xD5A6, 0xD5AA, 0x111E, 0xD5AB, 0xD5AB, 0x102B,
- 0xD5AC, 0xD5AD, 0x1123, 0xD5AE, 0xD5AE, 0x1060, 0xD5AF, 0xD5FE, 0x1125,
- 0xD6A1, 0xD6B7, 0x1175, 0xD6B8, 0xD6B8, 0x1047, 0xD6B9, 0xD6CC, 0x118C,
- 0xD6CD, 0xD6CD, 0x104C, 0xD6CE, 0xD6FE, 0x11A0, 0xD7A1, 0xD7CA, 0x11D1,
- 0xD7CB, 0xD7CB, 0x15B0, 0xD7CC, 0xD7E3, 0x11FB, 0xD7E4, 0xD7E4, 0x1918,
- 0xD7E5, 0xD7FE, 0x1213, 0xD8A1, 0xD8FE, 0x122D, 0xD9A1, 0xD9FE, 0x128B,
- 0xDAA1, 0xDAFE, 0x12E9, 0xDBA1, 0xDBC4, 0x1347, 0xDBC5, 0xDBC5, 0x141F,
- 0xDBC6, 0xDBE3, 0x136B, 0xDBE4, 0xDBE4, 0x133A, 0xDBE5, 0xDBFE, 0x1389,
- 0xDCA1, 0xDCA4, 0x13A3, 0xDCA5, 0xDCA5, 0x1D5E, 0xDCA6, 0xDCFE, 0x13A7,
- 0xDDA1, 0xDDA4, 0x1400, 0xDDA5, 0xDDA5, 0x13D7, 0xDDA6, 0xDDD4, 0x1404,
- 0xDDD5, 0xDDD5, 0x13F5, 0xDDD6, 0xDDF3, 0x1433, 0xDDF4, 0xDDF4, 0x1DB7,
- 0xDDF5, 0xDDFE, 0x1451, 0xDEA1, 0xDEFB, 0x145B, 0xDEFC, 0xDEFC, 0x15D0,
- 0xDEFD, 0xDEFD, 0x14B6, 0xDEFE, 0xDEFE, 0x14F7, 0xDFA1, 0xDFB2, 0x14B7,
- 0xDFB3, 0xDFB3, 0x1BAB, 0xDFB4, 0xDFE0, 0x14C9, 0xDFE1, 0xDFE1, 0x14F2,
- 0xDFE2, 0xDFE7, 0x14F6, 0xDFE8, 0xDFE8, 0x156D, 0xDFE9, 0xDFFE, 0x14FC,
- 0xE0A1, 0xE0F0, 0x1512, 0xE0F1, 0xE0F1, 0x1771, 0xE0F2, 0xE0FE, 0x1562,
- 0xE1A1, 0xE1AC, 0x156F, 0xE1AD, 0xE1AD, 0x1554, 0xE1AE, 0xE1EC, 0x157B,
- 0xE1ED, 0xE1ED, 0x14C5, 0xE1EE, 0xE1FE, 0x15BA, 0xE2A1, 0xE2FE, 0x15CB,
- 0xE3A1, 0xE3F4, 0x1629, 0xE3F5, 0xE3F5, 0x1B61, 0xE3F6, 0xE3FE, 0x167D,
- 0xE4A1, 0xE4A1, 0x1CCA, 0xE4A2, 0xE4A8, 0x1686, 0xE4A9, 0xE4A9, 0x162E,
- 0xE4AA, 0xE4FE, 0x168D, 0xE5A1, 0xE5AD, 0x16E2, 0xE5AE, 0xE5AE, 0x16F2,
- 0xE5AF, 0xE5B0, 0x16EF, 0xE5B1, 0xE5B2, 0x1149, 0xE5B3, 0xE5B8, 0x16F1,
- 0xE5B9, 0xE5B9, 0x114B, 0xE5BA, 0xE5BA, 0x16F7, 0xE5BB, 0xE5BC, 0x114D,
- 0xE5BD, 0xE5C3, 0x16F8, 0xE5C4, 0xE5C4, 0x114F, 0xE5C5, 0xE5CD, 0x16FF,
- 0xE5CE, 0xE5CE, 0x1153, 0xE5CF, 0xE5CF, 0x1708, 0xE5D0, 0xE5D0, 0x1154,
- 0xE5D1, 0xE5D1, 0x1709, 0xE5D2, 0xE5D2, 0x1155, 0xE5D3, 0xE5D5, 0x170A,
- 0xE5D6, 0xE5D6, 0x1157, 0xE5D7, 0xE5F9, 0x170D, 0xE5FA, 0xE5FB, 0x115A,
- 0xE5FC, 0xE5FC, 0x103F, 0xE5FD, 0xE5FD, 0x1730, 0xE5FE, 0xE5FE, 0x115C,
- 0xE6A1, 0xE6A1, 0x115F, 0xE6A2, 0xE6A3, 0x1731, 0xE6A4, 0xE6A4, 0x1161,
- 0xE6A5, 0xE6A6, 0x1733, 0xE6A7, 0xE6A7, 0x1162, 0xE6A8, 0xE6AC, 0x1735,
- 0xE6AD, 0xE6AD, 0x1165, 0xE6AE, 0xE6AE, 0x173A, 0xE6AF, 0xE6B1, 0x1167,
- 0xE6B2, 0xE6B2, 0x173B, 0xE6B3, 0xE6B3, 0x116A, 0xE6B4, 0xE6B6, 0x173C,
- 0xE6B7, 0xE6B8, 0x116B, 0xE6B9, 0xE6BB, 0x173F, 0xE6BC, 0xE6BC, 0x116F,
- 0xE6BD, 0xE6C3, 0x1742, 0xE6C4, 0xE6C4, 0x1040, 0xE6C5, 0xE6C5, 0x1749,
- 0xE6C6, 0xE6C7, 0x1171, 0xE6C8, 0xE6C9, 0x174A, 0xE6CA, 0xE6CA, 0x1041,
- 0xE6CB, 0xE6D1, 0x174C, 0xE6D2, 0xE6D2, 0x1174, 0xE6D3, 0xE6D5, 0x1753,
- 0xE6D6, 0xE6D6, 0x1175, 0xE6D7, 0xE6D8, 0x1756, 0xE6D9, 0xE6D9, 0x1176,
- 0xE6DA, 0xE6DB, 0x1758, 0xE6DC, 0xE6DC, 0x1042, 0xE6DD, 0xE6DE, 0x175A,
- 0xE6DF, 0xE6DF, 0x1177, 0xE6E0, 0xE6E0, 0x175C, 0xE6E1, 0xE6E1, 0x1178,
- 0xE6E2, 0xE6E3, 0x175D, 0xE6E4, 0xE6E4, 0x117A, 0xE6E5, 0xE6E5, 0x1179,
- 0xE6E6, 0xE6E6, 0x117B, 0xE6E7, 0xE6E7, 0x175F, 0xE6E8, 0xE6E8, 0x117C,
- 0xE6E9, 0xE6E9, 0x1760, 0xE6EA, 0xE6EB, 0x117E, 0xE6EC, 0xE6EC, 0x192F,
- 0xE6ED, 0xE6EE, 0x1761, 0xE6EF, 0xE6EF, 0x1181, 0xE6F0, 0xE6F0, 0x1763,
- 0xE6F1, 0xE6F1, 0x1182, 0xE6F2, 0xE6F2, 0x1554, 0xE6F3, 0xE6F4, 0x1764,
- 0xE6F5, 0xE6F5, 0x1183, 0xE6F6, 0xE6F6, 0x1043, 0xE6F7, 0xE6F7, 0x1046,
- 0xE6F8, 0xE6F8, 0x1766, 0xE6F9, 0xE6F9, 0x1185, 0xE6FA, 0xE6FE, 0x1767,
- 0xE7A1, 0xE7A1, 0x1187, 0xE7A2, 0xE7A5, 0x176C, 0xE7A6, 0xE7A6, 0x1188,
- 0xE7A7, 0xE7A8, 0x1770, 0xE7A9, 0xE7A9, 0x1189, 0xE7AA, 0xE7AA, 0x118B,
- 0xE7AB, 0xE7AB, 0x1772, 0xE7AC, 0xE7AC, 0x1047, 0xE7AD, 0xE7AD, 0x118D,
- 0xE7AE, 0xE7AF, 0x1773, 0xE7B0, 0xE7B0, 0x118E, 0xE7B1, 0xE7BE, 0x1775,
- 0xE7BF, 0xE7BF, 0x118F, 0xE7C0, 0xE7C0, 0x1783, 0xE7C1, 0xE7C1, 0x1E67,
- 0xE7C2, 0xE7C5, 0x1784, 0xE7C6, 0xE7C6, 0x1191, 0xE7C7, 0xE7C7, 0x1193,
- 0xE7C8, 0xE7CA, 0x1788, 0xE7CB, 0xE7CB, 0x1195, 0xE7CC, 0xE7CC, 0x178B,
- 0xE7CD, 0xE7CD, 0x1196, 0xE7CE, 0xE7CE, 0x178C, 0xE7CF, 0xE7D0, 0x1197,
- 0xE7D1, 0xE7D2, 0x178D, 0xE7D3, 0xE7D3, 0x119A, 0xE7D4, 0xE7DE, 0x178F,
- 0xE7DF, 0xE7DF, 0x119C, 0xE7E0, 0xE7E3, 0x179A, 0xE7E4, 0xE7E4, 0x119D,
- 0xE7E5, 0xE7E5, 0x179E, 0xE7E6, 0xE7E6, 0x119E, 0xE7E7, 0xE7F6, 0x179F,
- 0xE7F7, 0xE7F7, 0x16A5, 0xE7F8, 0xE7FE, 0x17AF, 0xE8A1, 0xE8E6, 0x17B6,
- 0xE8E7, 0xE8E8, 0x11C7, 0xE8E9, 0xE8EF, 0x17FC, 0xE8F0, 0xE8F0, 0x11C9,
- 0xE8F1, 0xE8F1, 0x1054, 0xE8F2, 0xE8F6, 0x1803, 0xE8F7, 0xE8F7, 0x11CB,
- 0xE8F8, 0xE8F8, 0x1808, 0xE8F9, 0xE8F9, 0x16A8, 0xE8FA, 0xE8FA, 0x1809,
- 0xE8FB, 0xE8FB, 0x11CC, 0xE8FC, 0xE8FD, 0x180A, 0xE8FE, 0xE8FE, 0x11CD,
- 0xE9A1, 0xE9A6, 0x180C, 0xE9A7, 0xE9A7, 0x11D0, 0xE9A8, 0xE9AB, 0x1812,
- 0xE9AC, 0xE9AC, 0x11D1, 0xE9AD, 0xE9CB, 0x1816, 0xE9CC, 0xE9CC, 0x11D3,
- 0xE9CD, 0xE9F6, 0x1835, 0xE9F7, 0xE9F7, 0x1F34, 0xE9F8, 0xE9FE, 0x185F,
- 0xEAA1, 0xEAC0, 0x1866, 0xEAC1, 0xEAC1, 0x17EB, 0xEAC2, 0xEAE4, 0x1886,
- 0xEAE5, 0xEAE5, 0x11E1, 0xEAE6, 0xEAF3, 0x18A9, 0xEAF4, 0xEAF4, 0x1057,
- 0xEAF5, 0xEAF6, 0x18B7, 0xEAF7, 0xEAF7, 0x11E3, 0xEAF8, 0xEAFB, 0x18B9,
- 0xEAFC, 0xEAFC, 0x11E5, 0xEAFD, 0xEAFD, 0x18BD, 0xEAFE, 0xEAFE, 0x11E6,
- 0xEBA1, 0xEBA3, 0x18BE, 0xEBA4, 0xEBA4, 0x11E8, 0xEBA5, 0xEBA6, 0x18C1,
- 0xEBA7, 0xEBA7, 0x11EA, 0xEBA8, 0xEBA8, 0x18C3, 0xEBA9, 0xEBA9, 0x11EC,
- 0xEBAA, 0xEBAA, 0x1058, 0xEBAB, 0xEBB9, 0x18C4, 0xEBBA, 0xEBBB, 0x11EE,
- 0xEBBC, 0xEBBC, 0x18D3, 0xEBBD, 0xEBBD, 0x11F0, 0xEBBE, 0xEBC0, 0x18D4,
- 0xEBC1, 0xEBC1, 0x11F1, 0xEBC2, 0xEBC2, 0x11F3, 0xEBC3, 0xEBC5, 0x18D7,
- 0xEBC6, 0xEBC7, 0x11F4, 0xEBC8, 0xEBCB, 0x18DA, 0xEBCC, 0xEBCC, 0x11F7,
- 0xEBCD, 0xEBCE, 0x18DE, 0xEBCF, 0xEBD1, 0x11F8, 0xEBD2, 0xEBD2, 0x15B0,
- 0xEBD3, 0xEBD7, 0x18E0, 0xEBD8, 0xEBD8, 0x11FB, 0xEBD9, 0xEBFE, 0x18E5,
- 0xECA1, 0xECA5, 0x190B, 0xECA6, 0xECA6, 0x1206, 0xECA7, 0xECA7, 0x1208,
- 0xECA8, 0xECA9, 0x1910, 0xECAA, 0xECAA, 0x120A, 0xECAB, 0xECAE, 0x1912,
- 0xECAF, 0xECAF, 0x173E, 0xECB0, 0xECB1, 0x120C, 0xECB2, 0xECB2, 0x105B,
- 0xECB3, 0xECB4, 0x1916, 0xECB5, 0xECB5, 0x1211, 0xECB6, 0xECB7, 0x1918,
- 0xECB8, 0xECB8, 0x1213, 0xECB9, 0xECB9, 0x191A, 0xECBA, 0xECBA, 0x1215,
- 0xECBB, 0xECBF, 0x191B, 0xECC0, 0xECC1, 0x1218, 0xECC2, 0xECC4, 0x1920,
- 0xECC5, 0xECC5, 0x121A, 0xECC6, 0xECC6, 0x121C, 0xECC7, 0xECC8, 0x1923,
- 0xECC9, 0xECCA, 0x105C, 0xECCB, 0xECD4, 0x1925, 0xECD5, 0xECD5, 0x121E,
- 0xECD6, 0xECDC, 0x192F, 0xECDD, 0xECDE, 0x1220, 0xECDF, 0xECE0, 0x1936,
- 0xECE1, 0xECE1, 0x1222, 0xECE2, 0xECE3, 0x1938, 0xECE4, 0xECE4, 0x1224,
- 0xECE5, 0xECE6, 0x193A, 0xECE7, 0xECE8, 0x1225, 0xECE9, 0xECF6, 0x193C,
- 0xECF7, 0xECF8, 0x1227, 0xECF9, 0xECF9, 0x194A, 0xECFA, 0xECFA, 0x122A,
- 0xECFB, 0xECFE, 0x194B, 0xEDA1, 0xEDA3, 0x122D, 0xEDA4, 0xEDED, 0x194F,
- 0xEDEE, 0xEDEE, 0x14E7, 0xEDEF, 0xEDFE, 0x1999, 0xEEA1, 0xEEDA, 0x19A9,
- 0xEEDB, 0xEEDB, 0x195E, 0xEEDC, 0xEEFE, 0x19E3, 0xEFA1, 0xEFFE, 0x1A06,
- 0xF0A1, 0xF0FE, 0x1A64, 0xF1A1, 0xF1FE, 0x1AC2, 0xF2A1, 0xF2BC, 0x1B20,
- 0xF2BD, 0xF2BD, 0x1663, 0xF2BE, 0xF2F9, 0x1B3C, 0xF2FA, 0xF2FA, 0x168B,
- 0xF2FB, 0xF2FE, 0x1B78, 0xF3A1, 0xF3B0, 0x1B7C, 0xF3B1, 0xF3B1, 0x105F,
- 0xF3B2, 0xF3FE, 0x1B8C, 0xF4A1, 0xF4A6, 0x1BD9, 0xF4A7, 0xF4A7, 0x1954,
- 0xF4A8, 0xF4ED, 0x1BDF, 0xF4EE, 0xF4EE, 0x1A1C, 0xF4EF, 0xF4FE, 0x1C25,
- 0xF5A1, 0xF5FE, 0x1C35, 0xF6A1, 0xF6F3, 0x1C93, 0xF6F4, 0xF6F4, 0x10B7,
- 0xF6F5, 0xF6F5, 0x1CE6, 0xF6F6, 0xF6F6, 0x1BE3, 0xF6F7, 0xF6FE, 0x1CE7,
- 0xF7A1, 0xF7B7, 0x1CEF, 0xF7B8, 0xF7B8, 0x1097, 0xF7B9, 0xF7C7, 0x1D06,
- 0xF7C8, 0xF7C8, 0x10AA, 0xF7C9, 0xF7D2, 0x1D15, 0xF7D3, 0xF7D3, 0x10F4,
- 0xF7D4, 0xF7FE, 0x1D1F, 0xF8A1, 0xF8DA, 0x1D4A, 0xF8DB, 0xF8DB, 0x1D94,
- 0xF8DC, 0xF8EF, 0x1D84, 0xF8F0, 0xF8F0, 0x13E0, 0xF8F1, 0xF8FE, 0x1D98,
- 0xF9A1, 0xF9FE, 0x1DA6, 0xFAA1, 0xFAA1, 0x1E1D, 0xFAA2, 0xFAA2, 0x0DE6,
- 0xFAA3, 0xFAE5, 0x1E04, 0xFAE6, 0xFAE6, 0x0E3C, 0xFAE7, 0xFAFE, 0x1E47,
- 0xFBA1, 0xFBFE, 0x1E5F, 0xFCA1, 0xFCA8, 0x1EBD, 0xFCA9, 0xFCA9, 0x0EE7,
- 0xFCAA, 0xFCFE, 0x1EC5, 0xFDA1, 0xFDFE, 0x1F1A,
-};
+// 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
+
+extern const unsigned short g_FXCMAP_KSCpc_EUC_H_0[509 * 3] = {
+ 0x0020, 0x007E, 0x0001, 0x0081, 0x0083, 0x0060, 0x00FE, 0x00FF, 0x0063,
+ 0xA141, 0xA17D, 0x1FFF, 0xA181, 0xA19A, 0x203C, 0xA19C, 0xA1A0, 0x2056,
+ 0xA1A1, 0xA1A1, 0x0065, 0xA1A2, 0xA1A3, 0x205B, 0xA1A4, 0xA1FE, 0x0068,
+ 0xA241, 0xA24C, 0x205D, 0xA2A1, 0xA2E5, 0x00C3, 0xA2E6, 0xA2FE, 0x2069,
+ 0xA341, 0xA37D, 0x2082, 0xA381, 0xA39F, 0x20BF, 0xA3A1, 0xA3FE, 0x0108,
+ 0xA441, 0xA47D, 0x20DE, 0xA481, 0xA49F, 0x211B, 0xA4A1, 0xA4D3, 0x0166,
+ 0xA4D5, 0xA4FE, 0x0199, 0xA541, 0xA57D, 0x213A, 0xA581, 0xA58B, 0x2177,
+ 0xA5A1, 0xA5AA, 0x01C3, 0xA5B0, 0xA5B9, 0x01CD, 0xA5C1, 0xA5D8, 0x01D7,
+ 0xA5DA, 0xA5DE, 0x2182, 0xA5E1, 0xA5F8, 0x01EF, 0xA5F9, 0xA5FC, 0x2187,
+ 0xA641, 0xA67D, 0x218B, 0xA681, 0xA68A, 0x21C8, 0xA68D, 0xA693, 0x21D2,
+ 0xA696, 0xA69B, 0x21D9, 0xA69E, 0xA69F, 0x21DF, 0xA6A1, 0xA6E4, 0x0207,
+ 0xA6E5, 0xA6FE, 0x21E1, 0xA741, 0xA77D, 0x21FB, 0xA781, 0xA79F, 0x2238,
+ 0xA7A1, 0xA7EF, 0x024B, 0xA7F0, 0xA7FE, 0x2257, 0xA841, 0xA87D, 0x2266,
+ 0xA881, 0xA89F, 0x22A3, 0xA8A1, 0xA8A4, 0x029A, 0xA8A6, 0xA8A6, 0x029E,
+ 0xA8A8, 0xA8AF, 0x029F, 0xA8B1, 0xA8FE, 0x02A7, 0xA941, 0xA974, 0x22C2,
+ 0xA9A1, 0xA9FE, 0x02F5, 0xAA41, 0xAA7D, 0x22F6, 0xAA81, 0xAA9F, 0x2333,
+ 0xAAA1, 0xAAF3, 0x0353, 0xAAF4, 0xAAFE, 0x2352, 0xAB41, 0xAB7D, 0x235D,
+ 0xAB81, 0xAB9F, 0x239A, 0xABA1, 0xABF6, 0x03A6, 0xABF7, 0xABFA, 0x23B9,
+ 0xABFB, 0xABFD, 0x2472, 0xAC41, 0xAC7D, 0x23BD, 0xAC81, 0xAC97, 0x23FA,
+ 0xACA1, 0xACC1, 0x03FC, 0xACC2, 0xACD0, 0x2411, 0xACD1, 0xACF1, 0x041D,
+ 0xACF2, 0xACF6, 0x2420, 0xAD41, 0xAD7D, 0x2425, 0xADA1, 0xADB0, 0x2462,
+ 0xB0A1, 0xB0FE, 0x043E, 0xB1A1, 0xB1FE, 0x049C, 0xB2A1, 0xB2FE, 0x04FA,
+ 0xB3A1, 0xB3FE, 0x0558, 0xB4A1, 0xB4FE, 0x05B6, 0xB5A1, 0xB5FE, 0x0614,
+ 0xB6A1, 0xB6FE, 0x0672, 0xB7A1, 0xB7FE, 0x06D0, 0xB8A1, 0xB8FE, 0x072E,
+ 0xB9A1, 0xB9FE, 0x078C, 0xBAA1, 0xBAFE, 0x07EA, 0xBBA1, 0xBBFE, 0x0848,
+ 0xBCA1, 0xBCFE, 0x08A6, 0xBDA1, 0xBDFE, 0x0904, 0xBEA1, 0xBEFE, 0x0962,
+ 0xBFA1, 0xBFFE, 0x09C0, 0xC0A1, 0xC0FE, 0x0A1E, 0xC1A1, 0xC1FE, 0x0A7C,
+ 0xC2A1, 0xC2FE, 0x0ADA, 0xC3A1, 0xC3FE, 0x0B38, 0xC4A1, 0xC4FE, 0x0B96,
+ 0xC5A1, 0xC5FE, 0x0BF4, 0xC6A1, 0xC6FE, 0x0C52, 0xC7A1, 0xC7FE, 0x0CB0,
+ 0xC8A1, 0xC8FE, 0x0D0E, 0xCAA1, 0xCAFE, 0x0D6C, 0xCBA1, 0xCBCF, 0x0DCA,
+ 0xCBD0, 0xCBD0, 0x1014, 0xCBD1, 0xCBD5, 0x0DF9, 0xCBD6, 0xCBD6, 0x0E5E,
+ 0xCBD7, 0xCBE6, 0x0DFE, 0xCBE7, 0xCBE7, 0x1B8D, 0xCBE8, 0xCBFE, 0x0E0E,
+ 0xCCA1, 0xCCFE, 0x0E25, 0xCDA1, 0xCDCE, 0x0E83, 0xCDCF, 0xCDCF, 0x0D84,
+ 0xCDD0, 0xCDE7, 0x0EB1, 0xCDE8, 0xCDE8, 0x1EDC, 0xCDE9, 0xCDFE, 0x0EC9,
+ 0xCEA1, 0xCEAC, 0x0EDF, 0xCEAD, 0xCEAD, 0x0EDA, 0xCEAE, 0xCEFE, 0x0EEB,
+ 0xCFA1, 0xCFFA, 0x0F3C, 0xCFFB, 0xCFFB, 0x0F3E, 0xCFFC, 0xCFFE, 0x0F96,
+ 0xD0A1, 0xD0A1, 0x0F99, 0xD0A2, 0xD0A2, 0x0F6A, 0xD0A3, 0xD0B7, 0x0F9A,
+ 0xD0B8, 0xD0B8, 0x0F6A, 0xD0B9, 0xD0CF, 0x0FAF, 0xD0D0, 0xD0D0, 0x0E7C,
+ 0xD0D1, 0xD0DC, 0x0FC6, 0xD0DD, 0xD0DD, 0x1023, 0xD0DE, 0xD0FE, 0x0FD2,
+ 0xD1A1, 0xD1D3, 0x0FF3, 0xD1D4, 0xD1D4, 0x1116, 0xD1D5, 0xD1D5, 0x103C,
+ 0xD1D6, 0xD1D7, 0x1026, 0xD1D8, 0xD1D8, 0x1117, 0xD1D9, 0xD1DA, 0x1028,
+ 0xD1DB, 0xD1E0, 0x1118, 0xD1E1, 0xD1E1, 0x102A, 0xD1E2, 0xD1E2, 0x16A8,
+ 0xD1E3, 0xD1E5, 0x111E, 0xD1E6, 0xD1E6, 0x1122, 0xD1E7, 0xD1E7, 0x102B,
+ 0xD1E8, 0xD1EB, 0x1123, 0xD1EC, 0xD1EC, 0x102C, 0xD1ED, 0xD1ED, 0x1127,
+ 0xD1EE, 0xD1EE, 0x102D, 0xD1EF, 0xD1F0, 0x112A, 0xD1F1, 0xD1F1, 0x102E,
+ 0xD1F2, 0xD1F2, 0x112C, 0xD1F3, 0xD1F5, 0x102F, 0xD1F6, 0xD1F6, 0x112F,
+ 0xD1F7, 0xD1F9, 0x1032, 0xD1FA, 0xD1FA, 0x1133, 0xD1FB, 0xD1FB, 0x1035,
+ 0xD1FC, 0xD1FD, 0x1136, 0xD1FE, 0xD1FE, 0x1139, 0xD2A1, 0xD2A1, 0x1036,
+ 0xD2A2, 0xD2A3, 0x113A, 0xD2A4, 0xD2A6, 0x1037, 0xD2A7, 0xD2AA, 0x113C,
+ 0xD2AB, 0xD2AB, 0x1143, 0xD2AC, 0xD2AC, 0x103A, 0xD2AD, 0xD2AD, 0x1144,
+ 0xD2AE, 0xD2B1, 0x103B, 0xD2B2, 0xD2B2, 0x1148, 0xD2B3, 0xD2BD, 0x103F,
+ 0xD2BE, 0xD2BE, 0x119F, 0xD2BF, 0xD2C1, 0x104A, 0xD2C2, 0xD2C3, 0x11A1,
+ 0xD2C4, 0xD2C4, 0x11A5, 0xD2C5, 0xD2C5, 0x104D, 0xD2C6, 0xD2CA, 0x11A6,
+ 0xD2CB, 0xD2CB, 0x11AC, 0xD2CC, 0xD2CC, 0x104E, 0xD2CD, 0xD2CE, 0x11AD,
+ 0xD2CF, 0xD2D4, 0x11B0, 0xD2D5, 0xD2D7, 0x11B7, 0xD2D8, 0xD2D8, 0x104F,
+ 0xD2D9, 0xD2DA, 0x11BD, 0xD2DB, 0xD2DD, 0x1050, 0xD2DE, 0xD2DF, 0x11C1,
+ 0xD2E0, 0xD2E0, 0x1053, 0xD2E1, 0xD2E1, 0x11C3, 0xD2E2, 0xD2E2, 0x11C6,
+ 0xD2E3, 0xD2E3, 0x1054, 0xD2E4, 0xD2E4, 0x11D4, 0xD2E5, 0xD2E8, 0x11D6,
+ 0xD2E9, 0xD2EA, 0x11DB, 0xD2EB, 0xD2EB, 0x11E0, 0xD2EC, 0xD2EF, 0x1055,
+ 0xD2F0, 0xD2F3, 0x11FC, 0xD2F4, 0xD2F5, 0x1201, 0xD2F6, 0xD2F6, 0x1059,
+ 0xD2F7, 0xD2F8, 0x1203, 0xD2F9, 0xD2FE, 0x105A, 0xD3A1, 0xD3FE, 0x1060,
+ 0xD4A1, 0xD4E5, 0x10BE, 0xD4E6, 0xD4E6, 0x10DE, 0xD4E7, 0xD4FB, 0x1103,
+ 0xD4FC, 0xD4FC, 0x1028, 0xD4FD, 0xD4FE, 0x1118, 0xD5A1, 0xD5A4, 0x111A,
+ 0xD5A5, 0xD5A5, 0x16A8, 0xD5A6, 0xD5AA, 0x111E, 0xD5AB, 0xD5AB, 0x102B,
+ 0xD5AC, 0xD5AD, 0x1123, 0xD5AE, 0xD5AE, 0x1060, 0xD5AF, 0xD5FE, 0x1125,
+ 0xD6A1, 0xD6B7, 0x1175, 0xD6B8, 0xD6B8, 0x1047, 0xD6B9, 0xD6CC, 0x118C,
+ 0xD6CD, 0xD6CD, 0x104C, 0xD6CE, 0xD6FE, 0x11A0, 0xD7A1, 0xD7CA, 0x11D1,
+ 0xD7CB, 0xD7CB, 0x15B0, 0xD7CC, 0xD7E3, 0x11FB, 0xD7E4, 0xD7E4, 0x1918,
+ 0xD7E5, 0xD7FE, 0x1213, 0xD8A1, 0xD8FE, 0x122D, 0xD9A1, 0xD9FE, 0x128B,
+ 0xDAA1, 0xDAFE, 0x12E9, 0xDBA1, 0xDBC4, 0x1347, 0xDBC5, 0xDBC5, 0x141F,
+ 0xDBC6, 0xDBE3, 0x136B, 0xDBE4, 0xDBE4, 0x133A, 0xDBE5, 0xDBFE, 0x1389,
+ 0xDCA1, 0xDCA4, 0x13A3, 0xDCA5, 0xDCA5, 0x1D5E, 0xDCA6, 0xDCFE, 0x13A7,
+ 0xDDA1, 0xDDA4, 0x1400, 0xDDA5, 0xDDA5, 0x13D7, 0xDDA6, 0xDDD4, 0x1404,
+ 0xDDD5, 0xDDD5, 0x13F5, 0xDDD6, 0xDDF3, 0x1433, 0xDDF4, 0xDDF4, 0x1DB7,
+ 0xDDF5, 0xDDFE, 0x1451, 0xDEA1, 0xDEFB, 0x145B, 0xDEFC, 0xDEFC, 0x15D0,
+ 0xDEFD, 0xDEFD, 0x14B6, 0xDEFE, 0xDEFE, 0x14F7, 0xDFA1, 0xDFB2, 0x14B7,
+ 0xDFB3, 0xDFB3, 0x1BAB, 0xDFB4, 0xDFE0, 0x14C9, 0xDFE1, 0xDFE1, 0x14F2,
+ 0xDFE2, 0xDFE7, 0x14F6, 0xDFE8, 0xDFE8, 0x156D, 0xDFE9, 0xDFFE, 0x14FC,
+ 0xE0A1, 0xE0F0, 0x1512, 0xE0F1, 0xE0F1, 0x1771, 0xE0F2, 0xE0FE, 0x1562,
+ 0xE1A1, 0xE1AC, 0x156F, 0xE1AD, 0xE1AD, 0x1554, 0xE1AE, 0xE1EC, 0x157B,
+ 0xE1ED, 0xE1ED, 0x14C5, 0xE1EE, 0xE1FE, 0x15BA, 0xE2A1, 0xE2FE, 0x15CB,
+ 0xE3A1, 0xE3F4, 0x1629, 0xE3F5, 0xE3F5, 0x1B61, 0xE3F6, 0xE3FE, 0x167D,
+ 0xE4A1, 0xE4A1, 0x1CCA, 0xE4A2, 0xE4A8, 0x1686, 0xE4A9, 0xE4A9, 0x162E,
+ 0xE4AA, 0xE4FE, 0x168D, 0xE5A1, 0xE5AD, 0x16E2, 0xE5AE, 0xE5AE, 0x16F2,
+ 0xE5AF, 0xE5B0, 0x16EF, 0xE5B1, 0xE5B2, 0x1149, 0xE5B3, 0xE5B8, 0x16F1,
+ 0xE5B9, 0xE5B9, 0x114B, 0xE5BA, 0xE5BA, 0x16F7, 0xE5BB, 0xE5BC, 0x114D,
+ 0xE5BD, 0xE5C3, 0x16F8, 0xE5C4, 0xE5C4, 0x114F, 0xE5C5, 0xE5CD, 0x16FF,
+ 0xE5CE, 0xE5CE, 0x1153, 0xE5CF, 0xE5CF, 0x1708, 0xE5D0, 0xE5D0, 0x1154,
+ 0xE5D1, 0xE5D1, 0x1709, 0xE5D2, 0xE5D2, 0x1155, 0xE5D3, 0xE5D5, 0x170A,
+ 0xE5D6, 0xE5D6, 0x1157, 0xE5D7, 0xE5F9, 0x170D, 0xE5FA, 0xE5FB, 0x115A,
+ 0xE5FC, 0xE5FC, 0x103F, 0xE5FD, 0xE5FD, 0x1730, 0xE5FE, 0xE5FE, 0x115C,
+ 0xE6A1, 0xE6A1, 0x115F, 0xE6A2, 0xE6A3, 0x1731, 0xE6A4, 0xE6A4, 0x1161,
+ 0xE6A5, 0xE6A6, 0x1733, 0xE6A7, 0xE6A7, 0x1162, 0xE6A8, 0xE6AC, 0x1735,
+ 0xE6AD, 0xE6AD, 0x1165, 0xE6AE, 0xE6AE, 0x173A, 0xE6AF, 0xE6B1, 0x1167,
+ 0xE6B2, 0xE6B2, 0x173B, 0xE6B3, 0xE6B3, 0x116A, 0xE6B4, 0xE6B6, 0x173C,
+ 0xE6B7, 0xE6B8, 0x116B, 0xE6B9, 0xE6BB, 0x173F, 0xE6BC, 0xE6BC, 0x116F,
+ 0xE6BD, 0xE6C3, 0x1742, 0xE6C4, 0xE6C4, 0x1040, 0xE6C5, 0xE6C5, 0x1749,
+ 0xE6C6, 0xE6C7, 0x1171, 0xE6C8, 0xE6C9, 0x174A, 0xE6CA, 0xE6CA, 0x1041,
+ 0xE6CB, 0xE6D1, 0x174C, 0xE6D2, 0xE6D2, 0x1174, 0xE6D3, 0xE6D5, 0x1753,
+ 0xE6D6, 0xE6D6, 0x1175, 0xE6D7, 0xE6D8, 0x1756, 0xE6D9, 0xE6D9, 0x1176,
+ 0xE6DA, 0xE6DB, 0x1758, 0xE6DC, 0xE6DC, 0x1042, 0xE6DD, 0xE6DE, 0x175A,
+ 0xE6DF, 0xE6DF, 0x1177, 0xE6E0, 0xE6E0, 0x175C, 0xE6E1, 0xE6E1, 0x1178,
+ 0xE6E2, 0xE6E3, 0x175D, 0xE6E4, 0xE6E4, 0x117A, 0xE6E5, 0xE6E5, 0x1179,
+ 0xE6E6, 0xE6E6, 0x117B, 0xE6E7, 0xE6E7, 0x175F, 0xE6E8, 0xE6E8, 0x117C,
+ 0xE6E9, 0xE6E9, 0x1760, 0xE6EA, 0xE6EB, 0x117E, 0xE6EC, 0xE6EC, 0x192F,
+ 0xE6ED, 0xE6EE, 0x1761, 0xE6EF, 0xE6EF, 0x1181, 0xE6F0, 0xE6F0, 0x1763,
+ 0xE6F1, 0xE6F1, 0x1182, 0xE6F2, 0xE6F2, 0x1554, 0xE6F3, 0xE6F4, 0x1764,
+ 0xE6F5, 0xE6F5, 0x1183, 0xE6F6, 0xE6F6, 0x1043, 0xE6F7, 0xE6F7, 0x1046,
+ 0xE6F8, 0xE6F8, 0x1766, 0xE6F9, 0xE6F9, 0x1185, 0xE6FA, 0xE6FE, 0x1767,
+ 0xE7A1, 0xE7A1, 0x1187, 0xE7A2, 0xE7A5, 0x176C, 0xE7A6, 0xE7A6, 0x1188,
+ 0xE7A7, 0xE7A8, 0x1770, 0xE7A9, 0xE7A9, 0x1189, 0xE7AA, 0xE7AA, 0x118B,
+ 0xE7AB, 0xE7AB, 0x1772, 0xE7AC, 0xE7AC, 0x1047, 0xE7AD, 0xE7AD, 0x118D,
+ 0xE7AE, 0xE7AF, 0x1773, 0xE7B0, 0xE7B0, 0x118E, 0xE7B1, 0xE7BE, 0x1775,
+ 0xE7BF, 0xE7BF, 0x118F, 0xE7C0, 0xE7C0, 0x1783, 0xE7C1, 0xE7C1, 0x1E67,
+ 0xE7C2, 0xE7C5, 0x1784, 0xE7C6, 0xE7C6, 0x1191, 0xE7C7, 0xE7C7, 0x1193,
+ 0xE7C8, 0xE7CA, 0x1788, 0xE7CB, 0xE7CB, 0x1195, 0xE7CC, 0xE7CC, 0x178B,
+ 0xE7CD, 0xE7CD, 0x1196, 0xE7CE, 0xE7CE, 0x178C, 0xE7CF, 0xE7D0, 0x1197,
+ 0xE7D1, 0xE7D2, 0x178D, 0xE7D3, 0xE7D3, 0x119A, 0xE7D4, 0xE7DE, 0x178F,
+ 0xE7DF, 0xE7DF, 0x119C, 0xE7E0, 0xE7E3, 0x179A, 0xE7E4, 0xE7E4, 0x119D,
+ 0xE7E5, 0xE7E5, 0x179E, 0xE7E6, 0xE7E6, 0x119E, 0xE7E7, 0xE7F6, 0x179F,
+ 0xE7F7, 0xE7F7, 0x16A5, 0xE7F8, 0xE7FE, 0x17AF, 0xE8A1, 0xE8E6, 0x17B6,
+ 0xE8E7, 0xE8E8, 0x11C7, 0xE8E9, 0xE8EF, 0x17FC, 0xE8F0, 0xE8F0, 0x11C9,
+ 0xE8F1, 0xE8F1, 0x1054, 0xE8F2, 0xE8F6, 0x1803, 0xE8F7, 0xE8F7, 0x11CB,
+ 0xE8F8, 0xE8F8, 0x1808, 0xE8F9, 0xE8F9, 0x16A8, 0xE8FA, 0xE8FA, 0x1809,
+ 0xE8FB, 0xE8FB, 0x11CC, 0xE8FC, 0xE8FD, 0x180A, 0xE8FE, 0xE8FE, 0x11CD,
+ 0xE9A1, 0xE9A6, 0x180C, 0xE9A7, 0xE9A7, 0x11D0, 0xE9A8, 0xE9AB, 0x1812,
+ 0xE9AC, 0xE9AC, 0x11D1, 0xE9AD, 0xE9CB, 0x1816, 0xE9CC, 0xE9CC, 0x11D3,
+ 0xE9CD, 0xE9F6, 0x1835, 0xE9F7, 0xE9F7, 0x1F34, 0xE9F8, 0xE9FE, 0x185F,
+ 0xEAA1, 0xEAC0, 0x1866, 0xEAC1, 0xEAC1, 0x17EB, 0xEAC2, 0xEAE4, 0x1886,
+ 0xEAE5, 0xEAE5, 0x11E1, 0xEAE6, 0xEAF3, 0x18A9, 0xEAF4, 0xEAF4, 0x1057,
+ 0xEAF5, 0xEAF6, 0x18B7, 0xEAF7, 0xEAF7, 0x11E3, 0xEAF8, 0xEAFB, 0x18B9,
+ 0xEAFC, 0xEAFC, 0x11E5, 0xEAFD, 0xEAFD, 0x18BD, 0xEAFE, 0xEAFE, 0x11E6,
+ 0xEBA1, 0xEBA3, 0x18BE, 0xEBA4, 0xEBA4, 0x11E8, 0xEBA5, 0xEBA6, 0x18C1,
+ 0xEBA7, 0xEBA7, 0x11EA, 0xEBA8, 0xEBA8, 0x18C3, 0xEBA9, 0xEBA9, 0x11EC,
+ 0xEBAA, 0xEBAA, 0x1058, 0xEBAB, 0xEBB9, 0x18C4, 0xEBBA, 0xEBBB, 0x11EE,
+ 0xEBBC, 0xEBBC, 0x18D3, 0xEBBD, 0xEBBD, 0x11F0, 0xEBBE, 0xEBC0, 0x18D4,
+ 0xEBC1, 0xEBC1, 0x11F1, 0xEBC2, 0xEBC2, 0x11F3, 0xEBC3, 0xEBC5, 0x18D7,
+ 0xEBC6, 0xEBC7, 0x11F4, 0xEBC8, 0xEBCB, 0x18DA, 0xEBCC, 0xEBCC, 0x11F7,
+ 0xEBCD, 0xEBCE, 0x18DE, 0xEBCF, 0xEBD1, 0x11F8, 0xEBD2, 0xEBD2, 0x15B0,
+ 0xEBD3, 0xEBD7, 0x18E0, 0xEBD8, 0xEBD8, 0x11FB, 0xEBD9, 0xEBFE, 0x18E5,
+ 0xECA1, 0xECA5, 0x190B, 0xECA6, 0xECA6, 0x1206, 0xECA7, 0xECA7, 0x1208,
+ 0xECA8, 0xECA9, 0x1910, 0xECAA, 0xECAA, 0x120A, 0xECAB, 0xECAE, 0x1912,
+ 0xECAF, 0xECAF, 0x173E, 0xECB0, 0xECB1, 0x120C, 0xECB2, 0xECB2, 0x105B,
+ 0xECB3, 0xECB4, 0x1916, 0xECB5, 0xECB5, 0x1211, 0xECB6, 0xECB7, 0x1918,
+ 0xECB8, 0xECB8, 0x1213, 0xECB9, 0xECB9, 0x191A, 0xECBA, 0xECBA, 0x1215,
+ 0xECBB, 0xECBF, 0x191B, 0xECC0, 0xECC1, 0x1218, 0xECC2, 0xECC4, 0x1920,
+ 0xECC5, 0xECC5, 0x121A, 0xECC6, 0xECC6, 0x121C, 0xECC7, 0xECC8, 0x1923,
+ 0xECC9, 0xECCA, 0x105C, 0xECCB, 0xECD4, 0x1925, 0xECD5, 0xECD5, 0x121E,
+ 0xECD6, 0xECDC, 0x192F, 0xECDD, 0xECDE, 0x1220, 0xECDF, 0xECE0, 0x1936,
+ 0xECE1, 0xECE1, 0x1222, 0xECE2, 0xECE3, 0x1938, 0xECE4, 0xECE4, 0x1224,
+ 0xECE5, 0xECE6, 0x193A, 0xECE7, 0xECE8, 0x1225, 0xECE9, 0xECF6, 0x193C,
+ 0xECF7, 0xECF8, 0x1227, 0xECF9, 0xECF9, 0x194A, 0xECFA, 0xECFA, 0x122A,
+ 0xECFB, 0xECFE, 0x194B, 0xEDA1, 0xEDA3, 0x122D, 0xEDA4, 0xEDED, 0x194F,
+ 0xEDEE, 0xEDEE, 0x14E7, 0xEDEF, 0xEDFE, 0x1999, 0xEEA1, 0xEEDA, 0x19A9,
+ 0xEEDB, 0xEEDB, 0x195E, 0xEEDC, 0xEEFE, 0x19E3, 0xEFA1, 0xEFFE, 0x1A06,
+ 0xF0A1, 0xF0FE, 0x1A64, 0xF1A1, 0xF1FE, 0x1AC2, 0xF2A1, 0xF2BC, 0x1B20,
+ 0xF2BD, 0xF2BD, 0x1663, 0xF2BE, 0xF2F9, 0x1B3C, 0xF2FA, 0xF2FA, 0x168B,
+ 0xF2FB, 0xF2FE, 0x1B78, 0xF3A1, 0xF3B0, 0x1B7C, 0xF3B1, 0xF3B1, 0x105F,
+ 0xF3B2, 0xF3FE, 0x1B8C, 0xF4A1, 0xF4A6, 0x1BD9, 0xF4A7, 0xF4A7, 0x1954,
+ 0xF4A8, 0xF4ED, 0x1BDF, 0xF4EE, 0xF4EE, 0x1A1C, 0xF4EF, 0xF4FE, 0x1C25,
+ 0xF5A1, 0xF5FE, 0x1C35, 0xF6A1, 0xF6F3, 0x1C93, 0xF6F4, 0xF6F4, 0x10B7,
+ 0xF6F5, 0xF6F5, 0x1CE6, 0xF6F6, 0xF6F6, 0x1BE3, 0xF6F7, 0xF6FE, 0x1CE7,
+ 0xF7A1, 0xF7B7, 0x1CEF, 0xF7B8, 0xF7B8, 0x1097, 0xF7B9, 0xF7C7, 0x1D06,
+ 0xF7C8, 0xF7C8, 0x10AA, 0xF7C9, 0xF7D2, 0x1D15, 0xF7D3, 0xF7D3, 0x10F4,
+ 0xF7D4, 0xF7FE, 0x1D1F, 0xF8A1, 0xF8DA, 0x1D4A, 0xF8DB, 0xF8DB, 0x1D94,
+ 0xF8DC, 0xF8EF, 0x1D84, 0xF8F0, 0xF8F0, 0x13E0, 0xF8F1, 0xF8FE, 0x1D98,
+ 0xF9A1, 0xF9FE, 0x1DA6, 0xFAA1, 0xFAA1, 0x1E1D, 0xFAA2, 0xFAA2, 0x0DE6,
+ 0xFAA3, 0xFAE5, 0x1E04, 0xFAE6, 0xFAE6, 0x0E3C, 0xFAE7, 0xFAFE, 0x1E47,
+ 0xFBA1, 0xFBFE, 0x1E5F, 0xFCA1, 0xFCA8, 0x1EBD, 0xFCA9, 0xFCA9, 0x0EE7,
+ 0xFCAA, 0xFCFE, 0x1EC5, 0xFDA1, 0xFDFE, 0x1F1A,
+};
diff --git a/core/src/fpdfapi/fpdf_cmaps/Korea1/UniKS-UCS2-H_1.cpp b/core/src/fpdfapi/fpdf_cmaps/Korea1/UniKS-UCS2-H_1.cpp
index 62b6ea57ef..daf98271b1 100644
--- a/core/src/fpdfapi/fpdf_cmaps/Korea1/UniKS-UCS2-H_1.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/Korea1/UniKS-UCS2-H_1.cpp
@@ -1,2806 +1,2806 @@
-// 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
-
-extern const unsigned short g_FXCMAP_UniKS_UCS2_H_1[8394 * 3] = {
- 0x0020, 0x007E, 0x0001, 0x00A1, 0x00A1, 0x00D0, 0x00A4, 0x00A4, 0x00D6,
- 0x00A7, 0x00A7, 0x009B, 0x00A8, 0x00A8, 0x006B, 0x00AA, 0x00AA, 0x029C,
- 0x00AB, 0x00AB, 0x00B0, 0x00B0, 0x00B0, 0x008A, 0x00B1, 0x00B1, 0x0082,
- 0x00B2, 0x00B3, 0x034B, 0x00B4, 0x00B4, 0x00C7, 0x00B6, 0x00B6, 0x00F4,
- 0x00B8, 0x00B8, 0x00CE, 0x00B9, 0x00B9, 0x034A, 0x00BA, 0x00BA, 0x02A3,
- 0x00BB, 0x00BB, 0x00B1, 0x00BC, 0x00BC, 0x02EF, 0x00BD, 0x00BD, 0x02EC,
- 0x00BE, 0x00BE, 0x02F0, 0x00BF, 0x00BF, 0x00D1, 0x00C6, 0x00C6, 0x029A,
- 0x00D0, 0x00D0, 0x029B, 0x00D7, 0x00D7, 0x0083, 0x00D8, 0x00D8, 0x02A1,
- 0x00DE, 0x00DE, 0x02A4, 0x00DF, 0x00DF, 0x0300, 0x00E6, 0x00E6, 0x02F5,
- 0x00F0, 0x00F0, 0x02F7, 0x00F7, 0x00F7, 0x0084, 0x00F8, 0x00F8, 0x02FE,
- 0x00FE, 0x00FE, 0x0301, 0x0111, 0x0111, 0x02F6, 0x0126, 0x0126, 0x029D,
- 0x0127, 0x0127, 0x02F8, 0x0131, 0x0131, 0x02F9, 0x0132, 0x0132, 0x029E,
- 0x0133, 0x0133, 0x02FA, 0x0138, 0x0138, 0x02FB, 0x013F, 0x013F, 0x029F,
- 0x0140, 0x0140, 0x02FC, 0x0141, 0x0141, 0x02A0, 0x0142, 0x0142, 0x02FD,
- 0x0149, 0x0149, 0x0304, 0x014A, 0x014A, 0x02A6, 0x014B, 0x014B, 0x0303,
- 0x0152, 0x0152, 0x02A2, 0x0153, 0x0153, 0x02FF, 0x0166, 0x0166, 0x02A5,
- 0x0167, 0x0167, 0x0302, 0x02BC, 0x02BC, 0x2053, 0x02C7, 0x02C7, 0x00C9,
- 0x02D8, 0x02D8, 0x00CA, 0x02D9, 0x02D9, 0x00CD, 0x02DA, 0x02DA, 0x00CC,
- 0x02DB, 0x02DB, 0x00CF, 0x02DC, 0x02DC, 0x00C8, 0x02DD, 0x02DD, 0x00CB,
- 0x0391, 0x03A1, 0x01D7, 0x03A3, 0x03A9, 0x01E8, 0x03B1, 0x03C1, 0x01EF,
- 0x03C3, 0x03C9, 0x0200, 0x0401, 0x0401, 0x0402, 0x0410, 0x0415, 0x03FC,
- 0x0416, 0x0435, 0x0403, 0x0436, 0x044F, 0x0424, 0x0451, 0x0451, 0x0423,
- 0x2013, 0x2014, 0x006D, 0x2016, 0x2016, 0x006F, 0x2018, 0x2019, 0x0072,
- 0x201B, 0x201B, 0x202E, 0x201C, 0x201D, 0x0074, 0x201F, 0x201F, 0x202D,
- 0x2020, 0x2021, 0x00F5, 0x2022, 0x2022, 0x219F, 0x2025, 0x2026, 0x0069,
- 0x2030, 0x2030, 0x00D8, 0x2032, 0x2033, 0x008B, 0x2034, 0x2034, 0x2186,
- 0x2035, 0x2035, 0x246E, 0x2036, 0x2036, 0x246C, 0x2039, 0x203A, 0x21A4,
- 0x203B, 0x203B, 0x009C, 0x203C, 0x203C, 0x223B, 0x2042, 0x2042, 0x2197,
- 0x2074, 0x2074, 0x034D, 0x207A, 0x207B, 0x202F, 0x207C, 0x207C, 0x2038,
- 0x207D, 0x207E, 0x203A, 0x207F, 0x207F, 0x034E, 0x2081, 0x2084, 0x034F,
- 0x2103, 0x2103, 0x008D, 0x2109, 0x2109, 0x00D7, 0x2113, 0x2113, 0x024E,
- 0x2116, 0x2116, 0x0102, 0x2121, 0x2121, 0x0107, 0x2122, 0x2122, 0x0104,
- 0x2126, 0x2126, 0x0283, 0x212B, 0x212B, 0x008E, 0x2153, 0x2154, 0x02ED,
- 0x215B, 0x215E, 0x02F1, 0x2160, 0x2169, 0x01CD, 0x2170, 0x2179, 0x01C3,
- 0x2190, 0x2191, 0x00AB, 0x2192, 0x2192, 0x00AA, 0x2193, 0x2194, 0x00AD,
- 0x2195, 0x2195, 0x00F7, 0x2196, 0x2196, 0x00FA, 0x2197, 0x2197, 0x00F8,
- 0x2198, 0x2198, 0x00FB, 0x2199, 0x2199, 0x00F9, 0x21B0, 0x21B0, 0x22A4,
- 0x21B1, 0x21B1, 0x22A1, 0x21B2, 0x21B2, 0x22A0, 0x21B3, 0x21B3, 0x22A5,
- 0x21B4, 0x21B4, 0x22A3, 0x21BC, 0x21BC, 0x22B4, 0x21C0, 0x21C0, 0x22B5,
- 0x21C4, 0x21C5, 0x22C0, 0x21CD, 0x21CD, 0x2270, 0x21CF, 0x21CF, 0x226F,
- 0x21D0, 0x21D0, 0x226E, 0x21D1, 0x21D1, 0x2296, 0x21D2, 0x21D2, 0x00C3,
- 0x21D3, 0x21D3, 0x2297, 0x21D4, 0x21D4, 0x00C4, 0x21E0, 0x21E0, 0x23E6,
- 0x21E1, 0x21E1, 0x23E8, 0x21E2, 0x21E2, 0x23E7, 0x21E3, 0x21E3, 0x23E9,
- 0x21E6, 0x21E6, 0x23EE, 0x21E7, 0x21E7, 0x23F0, 0x21E8, 0x21E8, 0x23EF,
- 0x21E9, 0x21E9, 0x23F1, 0x2200, 0x2200, 0x00C5, 0x2202, 0x2202, 0x0097,
- 0x2203, 0x2203, 0x00C6, 0x2206, 0x2206, 0x220B, 0x2207, 0x2207, 0x0098,
- 0x2208, 0x2208, 0x00B8, 0x2209, 0x2209, 0x222D, 0x220B, 0x220B, 0x00B9,
- 0x220C, 0x220C, 0x222E, 0x220F, 0x220F, 0x00D5, 0x2211, 0x2211, 0x00D4,
- 0x2213, 0x2213, 0x2216, 0x221A, 0x221A, 0x00B2, 0x221D, 0x221D, 0x00B4,
- 0x221E, 0x221E, 0x0088, 0x221F, 0x221F, 0x220D, 0x2220, 0x2220, 0x0094,
- 0x2222, 0x2222, 0x2222, 0x2225, 0x2226, 0x220F, 0x2227, 0x2228, 0x00C0,
- 0x2229, 0x2229, 0x00BF, 0x222A, 0x222A, 0x00BE, 0x222B, 0x222C, 0x00B6,
- 0x222E, 0x222E, 0x00D3, 0x2234, 0x2234, 0x0089, 0x2235, 0x2235, 0x00B5,
- 0x2236, 0x2236, 0x00D2, 0x2237, 0x2237, 0x2081, 0x223D, 0x223D, 0x00B3,
- 0x2243, 0x2243, 0x2134, 0x2245, 0x2245, 0x2133, 0x2248, 0x2248, 0x2135,
- 0x2250, 0x2250, 0x2223, 0x2251, 0x2251, 0x2213, 0x2252, 0x2252, 0x009A,
- 0x2253, 0x2253, 0x2212, 0x225A, 0x225A, 0x2231, 0x2260, 0x2260, 0x0085,
- 0x2261, 0x2261, 0x0099, 0x2262, 0x2262, 0x221E, 0x2264, 0x2265, 0x0086,
- 0x2266, 0x2267, 0x2214, 0x226E, 0x226F, 0x2229, 0x2270, 0x2273, 0x2121,
- 0x2276, 0x2277, 0x2129, 0x2279, 0x2279, 0x212B, 0x227A, 0x227B, 0x211B,
- 0x2280, 0x2281, 0x211F, 0x2282, 0x2283, 0x00BC, 0x2284, 0x2284, 0x222C,
- 0x2285, 0x2285, 0x222B, 0x2286, 0x2287, 0x00BA, 0x228A, 0x228A, 0x2126,
- 0x228B, 0x228B, 0x2128, 0x2295, 0x2297, 0x2217, 0x22A3, 0x22A3, 0x2226,
- 0x22A4, 0x22A4, 0x2137, 0x22A5, 0x22A5, 0x0095, 0x22BB, 0x22BC, 0x222F,
- 0x22CE, 0x22CF, 0x211D, 0x22DA, 0x22DB, 0x212C, 0x22EE, 0x22EE, 0x2080,
- 0x22EF, 0x22EF, 0x006A, 0x2306, 0x2306, 0x2232, 0x2312, 0x2312, 0x0096,
- 0x2314, 0x2314, 0x221B, 0x2460, 0x246E, 0x02DD, 0x246F, 0x2473, 0x2257,
- 0x2474, 0x2482, 0x033B, 0x2483, 0x2487, 0x2352, 0x249C, 0x24B5, 0x0321,
- 0x24B6, 0x24CF, 0x20C4, 0x24D0, 0x24E9, 0x02C3, 0x2500, 0x2500, 0x0207,
- 0x2501, 0x2501, 0x0212, 0x2502, 0x2502, 0x0208, 0x2503, 0x2503, 0x0213,
- 0x250C, 0x250C, 0x0209, 0x250D, 0x250D, 0x022E, 0x250E, 0x250E, 0x022D,
- 0x250F, 0x250F, 0x0214, 0x2510, 0x2510, 0x020A, 0x2511, 0x2511, 0x0228,
- 0x2512, 0x2512, 0x0227, 0x2513, 0x2513, 0x0215, 0x2514, 0x2514, 0x020C,
- 0x2515, 0x2515, 0x022C, 0x2516, 0x2516, 0x022B, 0x2517, 0x2517, 0x0217,
- 0x2518, 0x2518, 0x020B, 0x2519, 0x2519, 0x022A, 0x251A, 0x251A, 0x0229,
- 0x251B, 0x251B, 0x0216, 0x251C, 0x251C, 0x020D, 0x251D, 0x251D, 0x0222,
- 0x251E, 0x251F, 0x022F, 0x2520, 0x2520, 0x021D, 0x2521, 0x2522, 0x0231,
- 0x2523, 0x2523, 0x0218, 0x2524, 0x2524, 0x020F, 0x2525, 0x2525, 0x0224,
- 0x2526, 0x2527, 0x0233, 0x2528, 0x2528, 0x021F, 0x2529, 0x252A, 0x0235,
- 0x252B, 0x252B, 0x021A, 0x252C, 0x252C, 0x020E, 0x252D, 0x252E, 0x0237,
- 0x252F, 0x252F, 0x021E, 0x2530, 0x2530, 0x0223, 0x2531, 0x2532, 0x0239,
- 0x2533, 0x2533, 0x0219, 0x2534, 0x2534, 0x0210, 0x2535, 0x2536, 0x023B,
- 0x2537, 0x2537, 0x0220, 0x2538, 0x2538, 0x0225, 0x2539, 0x253A, 0x023D,
- 0x253B, 0x253B, 0x021B, 0x253C, 0x253C, 0x0211, 0x253D, 0x253E, 0x023F,
- 0x253F, 0x253F, 0x0221, 0x2540, 0x2541, 0x0241, 0x2542, 0x2542, 0x0226,
- 0x2543, 0x254A, 0x0243, 0x254B, 0x254B, 0x021C, 0x2592, 0x2592, 0x00E8,
- 0x25A0, 0x25A0, 0x00A5, 0x25A1, 0x25A1, 0x00A4, 0x25A3, 0x25A3, 0x00E5,
- 0x25A4, 0x25A5, 0x00E9, 0x25A6, 0x25A6, 0x00ED, 0x25A7, 0x25A7, 0x00EC,
- 0x25A8, 0x25A8, 0x00EB, 0x25A9, 0x25A9, 0x00EE, 0x25B1, 0x25B1, 0x2220,
- 0x25B2, 0x25B2, 0x00A7, 0x25B3, 0x25B3, 0x00A6, 0x25B5, 0x25B5, 0x224C,
- 0x25B6, 0x25B6, 0x00DC, 0x25B7, 0x25B7, 0x00DB, 0x25B9, 0x25B9, 0x224D,
- 0x25BC, 0x25BC, 0x00A9, 0x25BD, 0x25BD, 0x00A8, 0x25BF, 0x25BF, 0x224B,
- 0x25C0, 0x25C0, 0x00DA, 0x25C1, 0x25C1, 0x00D9, 0x25C3, 0x25C3, 0x224E,
- 0x25C6, 0x25C6, 0x00A3, 0x25C7, 0x25C7, 0x00A2, 0x25C8, 0x25C8, 0x00E4,
- 0x25C9, 0x25C9, 0x00E3, 0x25CA, 0x25CA, 0x2253, 0x25CB, 0x25CB, 0x009F,
- 0x25CC, 0x25CC, 0x21BF, 0x25CE, 0x25CE, 0x00A1, 0x25CF, 0x25CF, 0x00A0,
- 0x25D0, 0x25D1, 0x00E6, 0x25E6, 0x25E6, 0x2247, 0x25EF, 0x25EF, 0x21B9,
- 0x2605, 0x2605, 0x009E, 0x2606, 0x2606, 0x009D, 0x260E, 0x260E, 0x00F1,
- 0x260F, 0x260F, 0x00F0, 0x261C, 0x261C, 0x00F2, 0x261D, 0x261D, 0x2406,
- 0x261E, 0x261E, 0x00F3, 0x261F, 0x261F, 0x2407, 0x262F, 0x262F, 0x21D8,
- 0x2640, 0x2640, 0x0093, 0x2642, 0x2642, 0x0092, 0x2660, 0x2661, 0x00DE,
- 0x2663, 0x2663, 0x00E2, 0x2664, 0x2664, 0x00DD, 0x2665, 0x2665, 0x00E0,
- 0x2667, 0x2667, 0x00E1, 0x2668, 0x2668, 0x00EF, 0x2669, 0x266A, 0x00FD,
- 0x266C, 0x266C, 0x00FF, 0x266D, 0x266D, 0x00FC, 0x266F, 0x266F, 0x2192,
- 0x2716, 0x2716, 0x21B7, 0x271A, 0x271A, 0x21B6, 0x273D, 0x273D, 0x219C,
- 0x2756, 0x2756, 0x21BD, 0x2776, 0x277F, 0x21E1, 0x278A, 0x2793, 0x2096,
- 0x3000, 0x3002, 0x0065, 0x3003, 0x3003, 0x006C, 0x3008, 0x3011, 0x0078,
- 0x3012, 0x3012, 0x21FC, 0x3013, 0x3013, 0x00AF, 0x3014, 0x3015, 0x0076,
- 0x3016, 0x3019, 0x201B, 0x301E, 0x301F, 0x246A, 0x3020, 0x3020, 0x21DF,
- 0x3036, 0x3036, 0x21FD, 0x3041, 0x3093, 0x0353, 0x30A1, 0x30F6, 0x03A6,
- 0x30FB, 0x30FB, 0x0068, 0x30FC, 0x30FC, 0x2472, 0x3131, 0x3163, 0x0166,
- 0x3164, 0x3164, 0x0065, 0x3165, 0x318E, 0x0199, 0x3200, 0x321B, 0x0305,
- 0x321C, 0x321C, 0x0101, 0x3231, 0x3231, 0x2254, 0x3239, 0x3239, 0x2255,
- 0x3260, 0x327B, 0x02A7, 0x327F, 0x327F, 0x0100, 0x328A, 0x328F, 0x2455,
- 0x3290, 0x3290, 0x2454, 0x3294, 0x3294, 0x2378, 0x329E, 0x329E, 0x2239,
- 0x32A5, 0x32A5, 0x2388, 0x3380, 0x3384, 0x0273, 0x3388, 0x3389, 0x0264,
- 0x338A, 0x338C, 0x0286, 0x338D, 0x338F, 0x0260, 0x3390, 0x3394, 0x027E,
- 0x3395, 0x3397, 0x024B, 0x3398, 0x3398, 0x024F, 0x3399, 0x33A2, 0x0255,
- 0x33A3, 0x33A6, 0x0251, 0x33A7, 0x33A8, 0x0267, 0x33A9, 0x33AC, 0x028F,
- 0x33AD, 0x33AF, 0x028B, 0x33B0, 0x33B9, 0x0269, 0x33BA, 0x33BF, 0x0278,
- 0x33C0, 0x33C1, 0x0284, 0x33C2, 0x33C2, 0x0105, 0x33C3, 0x33C3, 0x0296,
- 0x33C4, 0x33C4, 0x0250, 0x33C5, 0x33C5, 0x028A, 0x33C6, 0x33C6, 0x0299,
- 0x33C7, 0x33C7, 0x0103, 0x33C8, 0x33C8, 0x0266, 0x33C9, 0x33C9, 0x0297,
- 0x33CA, 0x33CA, 0x025F, 0x33CB, 0x33CB, 0x2256, 0x33CF, 0x33CF, 0x0263,
- 0x33D0, 0x33D0, 0x0294, 0x33D3, 0x33D3, 0x0295, 0x33D6, 0x33D6, 0x0289,
- 0x33D8, 0x33D8, 0x0106, 0x33DB, 0x33DB, 0x028E, 0x33DC, 0x33DC, 0x0298,
- 0x33DD, 0x33DD, 0x0293, 0x4E00, 0x4E00, 0x193C, 0x4E01, 0x4E01, 0x1A30,
- 0x4E03, 0x4E03, 0x1CC4, 0x4E07, 0x4E07, 0x123E, 0x4E08, 0x4E08, 0x1986,
- 0x4E09, 0x4E09, 0x14C8, 0x4E0A, 0x4E0A, 0x14D3, 0x4E0B, 0x4E0B, 0x1DC0,
- 0x4E0D, 0x4E0D, 0x13F5, 0x4E11, 0x4E11, 0x1C78, 0x4E14, 0x4E14, 0x1B81,
- 0x4E15, 0x4E15, 0x143D, 0x4E16, 0x4E16, 0x1574, 0x4E18, 0x4E18, 0x0F35,
- 0x4E19, 0x4E19, 0x13B1, 0x4E1E, 0x4E1E, 0x1632, 0x4E2D, 0x4E2D, 0x1B0A,
- 0x4E32, 0x4E32, 0x0EDA, 0x4E38, 0x4E38, 0x1ECA, 0x4E39, 0x4E39, 0x1060,
- 0x4E3B, 0x4E3B, 0x1ACC, 0x4E42, 0x4E42, 0x178D, 0x4E43, 0x4E43, 0x103A,
- 0x4E45, 0x4E45, 0x0F36, 0x4E4B, 0x4E4B, 0x1B1E, 0x4E4D, 0x4E4D, 0x1479,
- 0x4E4E, 0x4E4E, 0x1E78, 0x4E4F, 0x4E4F, 0x1DBE, 0x4E56, 0x4E56, 0x0F0F,
- 0x4E58, 0x4E58, 0x1633, 0x4E59, 0x4E59, 0x18EC, 0x4E5D, 0x4E5D, 0x0F37,
- 0x4E5E, 0x4E5E, 0x0E1D, 0x4E5F, 0x4E5F, 0x16E6, 0x4E6B, 0x4E6B, 0x0DAC,
- 0x4E6D, 0x4E6D, 0x10E9, 0x4E73, 0x4E73, 0x18A5, 0x4E76, 0x4E76, 0x13E4,
- 0x4E77, 0x4E77, 0x14C3, 0x4E7E, 0x4E7E, 0x0E11, 0x4E82, 0x4E82, 0x1125,
- 0x4E86, 0x4E86, 0x11C7, 0x4E88, 0x4E88, 0x172E, 0x4E8B, 0x4E8B, 0x147A,
- 0x4E8C, 0x4E8C, 0x190D, 0x4E8E, 0x4E8E, 0x1835, 0x4E90, 0x4E90, 0x186C,
- 0x4E91, 0x4E91, 0x185E, 0x4E92, 0x4E92, 0x1E79, 0x4E94, 0x4E94, 0x17A1,
- 0x4E95, 0x4E95, 0x1A31, 0x4E98, 0x4E98, 0x0FDA, 0x4E9B, 0x4E9B, 0x147B,
- 0x4E9E, 0x4E9E, 0x168F, 0x4EA1, 0x4EA1, 0x1258, 0x4EA2, 0x4EA2, 0x1DF6,
- 0x4EA4, 0x4EA4, 0x0F1C, 0x4EA5, 0x4EA5, 0x1E05, 0x4EA6, 0x4EA6, 0x173B,
- 0x4EA8, 0x4EA8, 0x1E5B, 0x4EAB, 0x4EAB, 0x1E1E, 0x4EAC, 0x4EAC, 0x0E4C,
- 0x4EAD, 0x4EAD, 0x1A32, 0x4EAE, 0x4EAE, 0x114B, 0x4EB6, 0x4EB6, 0x1061,
- 0x4EBA, 0x4EBA, 0x192B, 0x4EC0, 0x4EC0, 0x168B, 0x4EC1, 0x4EC1, 0x192C,
- 0x4EC4, 0x4EC4, 0x1CA3, 0x4EC7, 0x4EC7, 0x0F38, 0x4ECA, 0x4ECA, 0x0FC6,
- 0x4ECB, 0x4ECB, 0x0DE8, 0x4ECD, 0x4ECD, 0x194F, 0x4ED4, 0x4ED4, 0x1953,
- 0x4ED5, 0x4ED5, 0x147C, 0x4ED6, 0x4ED6, 0x1CD4, 0x4ED7, 0x4ED7, 0x1987,
- 0x4ED8, 0x4ED8, 0x13F6, 0x4ED9, 0x4ED9, 0x152A, 0x4EDD, 0x4EDD, 0x10EB,
- 0x4EDF, 0x4EDF, 0x1BEC, 0x4EE3, 0x4EE3, 0x109A, 0x4EE4, 0x4EE4, 0x1189,
- 0x4EE5, 0x4EE5, 0x190E, 0x4EF0, 0x4EF0, 0x16C9, 0x4EF2, 0x4EF2, 0x1B0B,
- 0x4EF6, 0x4EF6, 0x0E12, 0x4EF7, 0x4EF7, 0x0DE9, 0x4EFB, 0x4EFB, 0x1945,
- 0x4F01, 0x4F01, 0x0FDE, 0x4F09, 0x4F09, 0x1DF7, 0x4F0A, 0x4F0A, 0x190F,
- 0x4F0B, 0x4F0B, 0x0FD3, 0x4F0D, 0x4F0D, 0x17A2, 0x4F0E, 0x4F0E, 0x0FDF,
- 0x4F0F, 0x4F0F, 0x13D2, 0x4F10, 0x4F10, 0x138D, 0x4F11, 0x4F11, 0x1F45,
- 0x4F2F, 0x4F2F, 0x137C, 0x4F34, 0x4F34, 0x1329, 0x4F36, 0x4F36, 0x118A,
- 0x4F38, 0x4F38, 0x1667, 0x4F3A, 0x4F3A, 0x147D, 0x4F3C, 0x4F3C, 0x147E,
- 0x4F3D, 0x4F3D, 0x0D6C, 0x4F43, 0x4F43, 0x19F3, 0x4F46, 0x4F46, 0x1062,
- 0x4F47, 0x4F47, 0x19BF, 0x4F48, 0x4F48, 0x1D78, 0x4F4D, 0x4F4D, 0x188C,
- 0x4F4E, 0x4F4E, 0x19C0, 0x4F4F, 0x4F4F, 0x1ACD, 0x4F50, 0x4F50, 0x1AC6,
- 0x4F51, 0x4F51, 0x1836, 0x4F55, 0x4F55, 0x1DC1, 0x4F59, 0x4F59, 0x172F,
- 0x4F5A, 0x4F5A, 0x193D, 0x4F5B, 0x4F5B, 0x1433, 0x4F5C, 0x4F5C, 0x196D,
- 0x4F69, 0x4F69, 0x1D4E, 0x4F6F, 0x4F6F, 0x16F7, 0x4F70, 0x4F70, 0x137D,
- 0x4F73, 0x4F73, 0x0D6D, 0x4F76, 0x4F76, 0x101F, 0x4F7A, 0x4F7A, 0x19F4,
- 0x4F7E, 0x4F7E, 0x193E, 0x4F7F, 0x4F7F, 0x147F, 0x4F81, 0x4F81, 0x1668,
- 0x4F83, 0x4F83, 0x0D94, 0x4F84, 0x4F84, 0x1B67, 0x4F86, 0x4F86, 0x1144,
- 0x4F88, 0x4F88, 0x1CA8, 0x4F8A, 0x4F8A, 0x0EFF, 0x4F8B, 0x4F8B, 0x119A,
- 0x4F8D, 0x4F8D, 0x163C, 0x4F8F, 0x4F8F, 0x1ACE, 0x4F91, 0x4F91, 0x18A6,
- 0x4F96, 0x4F96, 0x11F2, 0x4F98, 0x4F98, 0x1B82, 0x4F9B, 0x4F9B, 0x0ECA,
- 0x4F9D, 0x4F9D, 0x18FA, 0x4FAE, 0x4FAE, 0x129C, 0x4FAF, 0x4FAF, 0x1F1E,
- 0x4FB5, 0x4FB5, 0x1CC7, 0x4FB6, 0x4FB6, 0x1158, 0x4FBF, 0x4FBF, 0x1D5E,
- 0x4FC2, 0x4FC2, 0x0E79, 0x4FC3, 0x4FC3, 0x1C49, 0x4FC4, 0x4FC4, 0x1690,
- 0x4FC9, 0x4FC9, 0x17A3, 0x4FCA, 0x4FCA, 0x1AF6, 0x4FCE, 0x4FCE, 0x1A7E,
- 0x4FD1, 0x4FD1, 0x181E, 0x4FD3, 0x4FD3, 0x0E4D, 0x4FD4, 0x4FD4, 0x1E36,
- 0x4FD7, 0x4FD7, 0x15A1, 0x4FDA, 0x4FDA, 0x1205, 0x4FDD, 0x4FDD, 0x13C2,
- 0x4FDF, 0x4FDF, 0x1480, 0x4FE0, 0x4FE0, 0x1E4F, 0x4FE1, 0x4FE1, 0x1669,
- 0x4FEE, 0x4FEE, 0x15BF, 0x4FEF, 0x4FEF, 0x13F7, 0x4FF1, 0x4FF1, 0x0F39,
- 0x4FF3, 0x4FF3, 0x136A, 0x4FF5, 0x4FF5, 0x1D98, 0x4FF8, 0x4FF8, 0x13E5,
- 0x4FFA, 0x4FFA, 0x1725, 0x5002, 0x5002, 0x13B2, 0x5006, 0x5006, 0x114C,
- 0x5009, 0x5009, 0x1BB4, 0x500B, 0x500B, 0x0DEA, 0x500D, 0x500D, 0x1369,
- 0x5011, 0x5011, 0x12E4, 0x5012, 0x5012, 0x10AD, 0x5016, 0x5016, 0x1E19,
- 0x5019, 0x5019, 0x1F1F, 0x501A, 0x501A, 0x18FB, 0x501C, 0x501C, 0x1BDE,
- 0x501E, 0x501E, 0x0E4E, 0x501F, 0x501F, 0x1B83, 0x5021, 0x5021, 0x1BB5,
- 0x5023, 0x5023, 0x134D, 0x5024, 0x5024, 0x1CA9, 0x5026, 0x5026, 0x0F81,
- 0x5027, 0x5027, 0x1AB5, 0x5028, 0x5028, 0x0E01, 0x502A, 0x502A, 0x178E,
- 0x502B, 0x502B, 0x11F3, 0x502C, 0x502C, 0x1CE2, 0x502D, 0x502D, 0x17F3,
- 0x503B, 0x503B, 0x16E7, 0x5043, 0x5043, 0x171D, 0x5047, 0x5047, 0x0D6E,
- 0x5048, 0x5048, 0x0E2B, 0x5049, 0x5049, 0x188D, 0x504F, 0x504F, 0x1D5F,
- 0x5055, 0x5055, 0x1E06, 0x505A, 0x505A, 0x1ACF, 0x505C, 0x505C, 0x1A33,
- 0x5065, 0x5065, 0x0E13, 0x5074, 0x5074, 0x1CA2, 0x5075, 0x5075, 0x1A34,
- 0x5076, 0x5076, 0x1837, 0x5078, 0x5078, 0x1D29, 0x5080, 0x5080, 0x0F10,
- 0x5085, 0x5085, 0x13F8, 0x508D, 0x508D, 0x134E, 0x5091, 0x5091, 0x0E1E,
- 0x5098, 0x5098, 0x14B7, 0x5099, 0x5099, 0x143E, 0x50AC, 0x50AC, 0x1C5E,
- 0x50AD, 0x50AD, 0x181F, 0x50B2, 0x50B2, 0x17A4, 0x50B3, 0x50B3, 0x19F5,
- 0x50B5, 0x50B5, 0x1BCA, 0x50B7, 0x50B7, 0x14D4, 0x50BE, 0x50BE, 0x0E4F,
- 0x50C5, 0x50C5, 0x0FB7, 0x50C9, 0x50C9, 0x1C09, 0x50CA, 0x50CA, 0x152B,
- 0x50CF, 0x50CF, 0x14D5, 0x50D1, 0x50D1, 0x0F1D, 0x50D5, 0x50D5, 0x13D3,
- 0x50D6, 0x50D6, 0x1F63, 0x50DA, 0x50DA, 0x11C8, 0x50DE, 0x50DE, 0x188E,
- 0x50E5, 0x50E5, 0x17FC, 0x50E7, 0x50E7, 0x1634, 0x50ED, 0x50ED, 0x1BAA,
- 0x50F9, 0x50F9, 0x0D6F, 0x50FB, 0x50FB, 0x139C, 0x50FF, 0x50FF, 0x1481,
- 0x5100, 0x5100, 0x18FC, 0x5101, 0x5101, 0x1AF7, 0x5104, 0x5104, 0x1718,
- 0x5106, 0x5106, 0x0E50, 0x5109, 0x5109, 0x0E21, 0x5112, 0x5112, 0x18A7,
- 0x511F, 0x511F, 0x14D6, 0x5121, 0x5121, 0x11BF, 0x512A, 0x512A, 0x1838,
- 0x5132, 0x5132, 0x19C1, 0x5137, 0x5137, 0x1159, 0x513A, 0x513A, 0x1025,
- 0x513C, 0x513C, 0x1726, 0x5140, 0x5140, 0x17C9, 0x5141, 0x5141, 0x18D7,
- 0x5143, 0x5143, 0x186F, 0x5144, 0x5144, 0x1E5C, 0x5145, 0x5145, 0x1C8A,
- 0x5146, 0x5146, 0x1A7F, 0x5147, 0x5147, 0x1F4D, 0x5148, 0x5148, 0x152C,
- 0x5149, 0x5149, 0x0F00, 0x514B, 0x514B, 0x0FB0, 0x514C, 0x514C, 0x1D07,
- 0x514D, 0x514D, 0x127F, 0x514E, 0x514E, 0x1D19, 0x5152, 0x5152, 0x1691,
- 0x515C, 0x515C, 0x10FC, 0x5162, 0x5162, 0x0FDB, 0x5165, 0x5165, 0x194D,
- 0x5167, 0x5167, 0x103B, 0x5168, 0x5168, 0x19F6, 0x5169, 0x5169, 0x114D,
- 0x516A, 0x516A, 0x18A8, 0x516B, 0x516B, 0x1D4B, 0x516C, 0x516C, 0x0ECB,
- 0x516D, 0x516D, 0x11EF, 0x516E, 0x516E, 0x1E6F, 0x5171, 0x5171, 0x0ECC,
- 0x5175, 0x5175, 0x13B3, 0x5176, 0x5176, 0x0FE0, 0x5177, 0x5177, 0x0F3A,
- 0x5178, 0x5178, 0x19F7, 0x517C, 0x517C, 0x0E46, 0x5180, 0x5180, 0x0FE1,
- 0x5186, 0x5186, 0x172D, 0x518A, 0x518A, 0x1BD6, 0x518D, 0x518D, 0x19AA,
- 0x5192, 0x5192, 0x129D, 0x5195, 0x5195, 0x1280, 0x5197, 0x5197, 0x1820,
- 0x51A0, 0x51A0, 0x0EEB, 0x51A5, 0x51A5, 0x128C, 0x51AA, 0x51AA, 0x127D,
- 0x51AC, 0x51AC, 0x10EC, 0x51B6, 0x51B6, 0x16E8, 0x51B7, 0x51B7, 0x1148,
- 0x51BD, 0x51BD, 0x117D, 0x51C4, 0x51C4, 0x1BDA, 0x51C6, 0x51C6, 0x1AF8,
- 0x51C9, 0x51C9, 0x114E, 0x51CB, 0x51CB, 0x1A80, 0x51CC, 0x51CC, 0x11FF,
- 0x51CD, 0x51CD, 0x10ED, 0x51DC, 0x51DC, 0x11FE, 0x51DD, 0x51DD, 0x18F6,
- 0x51DE, 0x51DE, 0x1F64, 0x51E1, 0x51E1, 0x1391, 0x51F0, 0x51F0, 0x1EE0,
- 0x51F1, 0x51F1, 0x0DEB, 0x51F6, 0x51F6, 0x1F4E, 0x51F8, 0x51F8, 0x1BFF,
- 0x51F9, 0x51F9, 0x17FD, 0x51FA, 0x51FA, 0x1C87, 0x51FD, 0x51FD, 0x1DE3,
- 0x5200, 0x5200, 0x10AE, 0x5203, 0x5203, 0x192D, 0x5206, 0x5206, 0x1420,
- 0x5207, 0x5207, 0x1A1C, 0x5208, 0x5208, 0x178F, 0x520A, 0x520A, 0x0D95,
- 0x520E, 0x520E, 0x12E5, 0x5211, 0x5211, 0x1E5D, 0x5217, 0x5217, 0x117E,
- 0x521D, 0x521D, 0x1C2E, 0x5224, 0x5224, 0x1D42, 0x5225, 0x5225, 0x13AD,
- 0x5229, 0x5229, 0x1206, 0x522A, 0x522A, 0x14B8, 0x522E, 0x522E, 0x0EFB,
- 0x5230, 0x5230, 0x10AF, 0x5236, 0x5236, 0x1A67, 0x5237, 0x5237, 0x15B9,
- 0x5238, 0x5238, 0x0F82, 0x5239, 0x5239, 0x1BA5, 0x523A, 0x523A, 0x1954,
- 0x523B, 0x523B, 0x0D89, 0x5243, 0x5243, 0x1C25, 0x5247, 0x5247, 0x1CC0,
- 0x524A, 0x524A, 0x14B5, 0x524B, 0x524B, 0x0FB1, 0x524C, 0x524C, 0x112D,
- 0x524D, 0x524D, 0x19F8, 0x5254, 0x5254, 0x1BDF, 0x5256, 0x5256, 0x13F9,
- 0x525B, 0x525B, 0x0DD0, 0x525D, 0x525D, 0x1316, 0x5261, 0x5261, 0x1557,
- 0x5269, 0x5269, 0x1950, 0x526A, 0x526A, 0x19F9, 0x526F, 0x526F, 0x13FA,
- 0x5272, 0x5272, 0x1DE1, 0x5275, 0x5275, 0x1BB6, 0x527D, 0x527D, 0x1D99,
- 0x527F, 0x527F, 0x1C2F, 0x5283, 0x5283, 0x1F0C, 0x5287, 0x5287, 0x0FB2,
- 0x5288, 0x5288, 0x139D, 0x5289, 0x5289, 0x11E1, 0x528D, 0x528D, 0x0E22,
- 0x5291, 0x5291, 0x1A68, 0x5292, 0x5292, 0x0E23, 0x529B, 0x529B, 0x116A,
- 0x529F, 0x529F, 0x0ECD, 0x52A0, 0x52A0, 0x0D70, 0x52A3, 0x52A3, 0x117F,
- 0x52A4, 0x52A4, 0x0FB8, 0x52A9, 0x52A9, 0x1A81, 0x52AA, 0x52AA, 0x1049,
- 0x52AB, 0x52AB, 0x0E28, 0x52BE, 0x52BE, 0x1E17, 0x52C1, 0x52C1, 0x0E51,
- 0x52C3, 0x52C3, 0x1342, 0x52C5, 0x52C5, 0x1CC1, 0x52C7, 0x52C7, 0x1821,
- 0x52C9, 0x52C9, 0x1281, 0x52CD, 0x52CD, 0x0E52, 0x52D2, 0x52D2, 0x11FC,
- 0x52D5, 0x52D5, 0x10EE, 0x52D6, 0x52D6, 0x1855, 0x52D8, 0x52D8, 0x0DB6,
- 0x52D9, 0x52D9, 0x12CC, 0x52DB, 0x52DB, 0x1F2B, 0x52DD, 0x52DD, 0x1635,
- 0x52DE, 0x52DE, 0x119F, 0x52DF, 0x52DF, 0x129E, 0x52E2, 0x52E2, 0x1575,
- 0x52E3, 0x52E3, 0x19DB, 0x52E4, 0x52E4, 0x0FB9, 0x52F3, 0x52F3, 0x1F2C,
- 0x52F5, 0x52F5, 0x115A, 0x52F8, 0x52F8, 0x0F83, 0x52FA, 0x52FA, 0x196E,
- 0x52FB, 0x52FB, 0x0FA9, 0x52FE, 0x52FE, 0x0F3B, 0x52FF, 0x52FF, 0x12F0,
- 0x5305, 0x5305, 0x1D79, 0x5308, 0x5308, 0x1F4F, 0x530D, 0x530D, 0x1D7A,
- 0x530F, 0x530F, 0x1D7B, 0x5310, 0x5310, 0x13D4, 0x5315, 0x5315, 0x143F,
- 0x5316, 0x5316, 0x1EB7, 0x5317, 0x5317, 0x141F, 0x5319, 0x5319, 0x163D,
- 0x5320, 0x5320, 0x1988, 0x5321, 0x5321, 0x0F01, 0x5323, 0x5323, 0x0DCA,
- 0x532A, 0x532A, 0x1440, 0x532F, 0x532F, 0x1EF8, 0x5339, 0x5339, 0x1DB4,
- 0x533F, 0x533F, 0x105C, 0x5340, 0x5340, 0x0F3C, 0x5341, 0x5341, 0x168C,
- 0x5343, 0x5343, 0x1BED, 0x5344, 0x5344, 0x194E, 0x5347, 0x5347, 0x1636,
- 0x5348, 0x5348, 0x17A5, 0x5349, 0x5349, 0x1F3A, 0x534A, 0x534A, 0x132A,
- 0x534D, 0x534D, 0x123F, 0x5351, 0x5351, 0x1441, 0x5352, 0x5352, 0x1AB2,
- 0x5353, 0x5353, 0x1CE3, 0x5354, 0x5354, 0x1E50, 0x5357, 0x5357, 0x1031,
- 0x535A, 0x535A, 0x1317, 0x535C, 0x535C, 0x13D5, 0x535E, 0x535E, 0x13A7,
- 0x5360, 0x5360, 0x1A24, 0x5366, 0x5366, 0x0F0C, 0x5368, 0x5368, 0x154A,
- 0x536F, 0x536F, 0x12C0, 0x5370, 0x5370, 0x192E, 0x5371, 0x5371, 0x188F,
- 0x5374, 0x5374, 0x0D8A, 0x5375, 0x5375, 0x1126, 0x5377, 0x5377, 0x0F84,
- 0x537D, 0x537D, 0x1B0E, 0x537F, 0x537F, 0x0E53, 0x5384, 0x5384, 0x16DB,
- 0x5393, 0x5393, 0x16D0, 0x5398, 0x5398, 0x1207, 0x539A, 0x539A, 0x1F20,
- 0x539F, 0x539F, 0x1870, 0x53A0, 0x53A0, 0x1CA4, 0x53A5, 0x53A5, 0x0F8B,
- 0x53A6, 0x53A6, 0x1DC2, 0x53AD, 0x53AD, 0x1765, 0x53BB, 0x53BB, 0x0E02,
- 0x53C3, 0x53C3, 0x1BAB, 0x53C8, 0x53C8, 0x1839, 0x53C9, 0x53C9, 0x1B84,
- 0x53CA, 0x53CA, 0x0FD4, 0x53CB, 0x53CB, 0x183A, 0x53CD, 0x53CD, 0x132B,
- 0x53D4, 0x53D4, 0x15FC, 0x53D6, 0x53D6, 0x1C94, 0x53D7, 0x53D7, 0x15C0,
- 0x53DB, 0x53DB, 0x132C, 0x53E1, 0x53E1, 0x1790, 0x53E2, 0x53E2, 0x1C53,
- 0x53E3, 0x53E3, 0x0F3D, 0x53E4, 0x53E4, 0x0E91, 0x53E5, 0x53E5, 0x0F3E,
- 0x53E9, 0x53E9, 0x0E92, 0x53EA, 0x53EA, 0x1B1F, 0x53EB, 0x53EB, 0x0F9A,
- 0x53EC, 0x53EC, 0x157C, 0x53ED, 0x53ED, 0x1D4C, 0x53EF, 0x53EF, 0x0D71,
- 0x53F0, 0x53F0, 0x1D08, 0x53F1, 0x53F1, 0x1B68, 0x53F2, 0x53F2, 0x1482,
- 0x53F3, 0x53F3, 0x183B, 0x53F8, 0x53F8, 0x1483, 0x5403, 0x5403, 0x1F57,
- 0x5404, 0x5404, 0x0D8B, 0x5408, 0x5408, 0x1DEF, 0x5409, 0x5409, 0x1020,
- 0x540A, 0x540A, 0x19DC, 0x540C, 0x540C, 0x10EF, 0x540D, 0x540D, 0x128D,
- 0x540E, 0x540E, 0x1F21, 0x540F, 0x540F, 0x1208, 0x5410, 0x5410, 0x1D1A,
- 0x5411, 0x5411, 0x1E1F, 0x541B, 0x541B, 0x0F71, 0x541D, 0x541D, 0x121E,
- 0x541F, 0x541F, 0x18ED, 0x5420, 0x5420, 0x1D6E, 0x5426, 0x5426, 0x13FB,
- 0x5429, 0x5429, 0x1421, 0x542B, 0x542B, 0x1DE4, 0x5433, 0x5433, 0x17A7,
- 0x5438, 0x5438, 0x1F5E, 0x5439, 0x5439, 0x1C95, 0x543B, 0x543B, 0x12E6,
- 0x543C, 0x543C, 0x1F22, 0x543E, 0x543E, 0x17A6, 0x5442, 0x5442, 0x115B,
- 0x5448, 0x5448, 0x1A35, 0x544A, 0x544A, 0x0E93, 0x5451, 0x5451, 0x1CF0,
- 0x5468, 0x5468, 0x1AD3, 0x546A, 0x546A, 0x1AD2, 0x5471, 0x5471, 0x0E94,
- 0x5473, 0x5473, 0x12F3, 0x5475, 0x5475, 0x0D72, 0x547B, 0x547B, 0x166A,
- 0x547C, 0x547C, 0x1E7A, 0x547D, 0x547D, 0x128E, 0x5480, 0x5480, 0x19C2,
- 0x5486, 0x5486, 0x1D7C, 0x548C, 0x548C, 0x1EB8, 0x548E, 0x548E, 0x0F3F,
- 0x5490, 0x5490, 0x13FC, 0x54A4, 0x54A4, 0x1CD5, 0x54A8, 0x54A8, 0x1955,
- 0x54AB, 0x54AB, 0x1B20, 0x54AC, 0x54AC, 0x0F1E, 0x54B3, 0x54B3, 0x1E07,
- 0x54B8, 0x54B8, 0x1DE5, 0x54BD, 0x54BD, 0x192F, 0x54C0, 0x54C0, 0x16D1,
- 0x54C1, 0x54C1, 0x1DA6, 0x54C4, 0x54C4, 0x1EAD, 0x54C8, 0x54C8, 0x1DF0,
- 0x54C9, 0x54C9, 0x19AB, 0x54E1, 0x54E1, 0x1871, 0x54E5, 0x54E5, 0x0D73,
- 0x54E8, 0x54E8, 0x1C30, 0x54ED, 0x54ED, 0x0EB7, 0x54EE, 0x54EE, 0x1F11,
- 0x54F2, 0x54F2, 0x1C00, 0x54FA, 0x54FA, 0x1D7D, 0x5504, 0x5504, 0x1D4F,
- 0x5506, 0x5506, 0x1484, 0x5507, 0x5507, 0x1B44, 0x550E, 0x550E, 0x1209,
- 0x5510, 0x5510, 0x108F, 0x551C, 0x551C, 0x1251, 0x552F, 0x552F, 0x18A9,
- 0x5531, 0x5531, 0x1BB7, 0x5535, 0x5535, 0x16BD, 0x553E, 0x553E, 0x1CD6,
- 0x5544, 0x5544, 0x1CE4, 0x5546, 0x5546, 0x14D7, 0x554F, 0x554F, 0x12E7,
- 0x5553, 0x5553, 0x0E7A, 0x5556, 0x5556, 0x1079, 0x555E, 0x555E, 0x1692,
- 0x5563, 0x5563, 0x1DE6, 0x557C, 0x557C, 0x1A69, 0x5580, 0x5580, 0x0DFB,
- 0x5584, 0x5584, 0x152D, 0x5586, 0x5586, 0x1C01, 0x5587, 0x5587, 0x1116,
- 0x5589, 0x5589, 0x1F23, 0x558A, 0x558A, 0x1DE7, 0x5598, 0x5598, 0x1BEE,
- 0x5599, 0x5599, 0x1F3B, 0x559A, 0x559A, 0x1ECB, 0x559C, 0x559C, 0x1F65,
- 0x559D, 0x559D, 0x0DAD, 0x55A7, 0x55A7, 0x1F36, 0x55A9, 0x55A9, 0x18AA,
- 0x55AA, 0x55AA, 0x14D8, 0x55AB, 0x55AB, 0x1024, 0x55AC, 0x55AC, 0x0F1F,
- 0x55AE, 0x55AE, 0x1063, 0x55C5, 0x55C5, 0x1F24, 0x55C7, 0x55C7, 0x14F5,
- 0x55D4, 0x55D4, 0x1B45, 0x55DA, 0x55DA, 0x17A8, 0x55DC, 0x55DC, 0x0FE2,
- 0x55DF, 0x55DF, 0x1B85, 0x55E3, 0x55E3, 0x1485, 0x55E4, 0x55E4, 0x1CAA,
- 0x55FD, 0x55FD, 0x15C1, 0x55FE, 0x55FE, 0x1AD4, 0x5606, 0x5606, 0x1CF1,
- 0x5609, 0x5609, 0x0D74, 0x5614, 0x5614, 0x0F40, 0x5617, 0x5617, 0x14D9,
- 0x562F, 0x562F, 0x157D, 0x5632, 0x5632, 0x1A82, 0x5634, 0x5634, 0x1C96,
- 0x5636, 0x5636, 0x163E, 0x5653, 0x5653, 0x1E27, 0x5668, 0x5668, 0x0FE3,
- 0x566B, 0x566B, 0x1F66, 0x5674, 0x5674, 0x1422, 0x5686, 0x5686, 0x1F12,
- 0x56A5, 0x56A5, 0x1744, 0x56AC, 0x56AC, 0x1467, 0x56AE, 0x56AE, 0x1E20,
- 0x56B4, 0x56B4, 0x1727, 0x56BC, 0x56BC, 0x196F, 0x56CA, 0x56CA, 0x1038,
- 0x56CD, 0x56CD, 0x1F67, 0x56D1, 0x56D1, 0x1C4A, 0x56DA, 0x56DA, 0x15C2,
- 0x56DB, 0x56DB, 0x1486, 0x56DE, 0x56DE, 0x1EF9, 0x56E0, 0x56E0, 0x1930,
- 0x56F0, 0x56F0, 0x0EBE, 0x56F9, 0x56F9, 0x118B, 0x56FA, 0x56FA, 0x0E95,
- 0x5703, 0x5703, 0x1D7E, 0x5704, 0x5704, 0x170E, 0x5708, 0x5708, 0x0F85,
- 0x570B, 0x570B, 0x0F6B, 0x570D, 0x570D, 0x1890, 0x5712, 0x5712, 0x1873,
- 0x5713, 0x5713, 0x1872, 0x5716, 0x5716, 0x10B0, 0x5718, 0x5718, 0x1064,
- 0x571F, 0x571F, 0x1D1B, 0x5728, 0x5728, 0x19AC, 0x572D, 0x572D, 0x0F9B,
- 0x5730, 0x5730, 0x1B21, 0x573B, 0x573B, 0x0FE4, 0x5740, 0x5740, 0x1B22,
- 0x5742, 0x5742, 0x1D43, 0x5747, 0x5747, 0x0FAA, 0x574A, 0x574A, 0x134F,
- 0x574D, 0x574D, 0x107A, 0x574E, 0x574E, 0x0DB7, 0x5750, 0x5750, 0x1AC7,
- 0x5751, 0x5751, 0x0DFD, 0x5761, 0x5761, 0x1D32, 0x5764, 0x5764, 0x0EBF,
- 0x5766, 0x5766, 0x1CF2, 0x576A, 0x576A, 0x1D69, 0x576E, 0x576E, 0x109C,
- 0x5770, 0x5770, 0x0E54, 0x5775, 0x5775, 0x0F41, 0x577C, 0x577C, 0x1CE5,
- 0x5782, 0x5782, 0x15C3, 0x5788, 0x5788, 0x109B, 0x578B, 0x578B, 0x1E5E,
- 0x5793, 0x5793, 0x1E08, 0x57A0, 0x57A0, 0x18E5, 0x57A2, 0x57A2, 0x0F42,
- 0x57A3, 0x57A3, 0x1874, 0x57C3, 0x57C3, 0x16D2, 0x57C7, 0x57C7, 0x1822,
- 0x57C8, 0x57C8, 0x1AF9, 0x57CB, 0x57CB, 0x1264, 0x57CE, 0x57CE, 0x1562,
- 0x57DF, 0x57DF, 0x173C, 0x57E0, 0x57E0, 0x13FD, 0x57F0, 0x57F0, 0x1BCB,
- 0x57F4, 0x57F4, 0x1658, 0x57F7, 0x57F7, 0x1B78, 0x57F9, 0x57F9, 0x136B,
- 0x57FA, 0x57FA, 0x0FE5, 0x57FC, 0x57FC, 0x0FE6, 0x5800, 0x5800, 0x0F77,
- 0x5802, 0x5802, 0x1090, 0x5805, 0x5805, 0x0E35, 0x5806, 0x5806, 0x1D23,
- 0x5808, 0x5808, 0x0DD1, 0x5809, 0x5809, 0x18D3, 0x580A, 0x580A, 0x16A1,
- 0x581E, 0x581E, 0x1C13, 0x5821, 0x5821, 0x13C3, 0x5824, 0x5824, 0x1A6A,
- 0x5827, 0x5827, 0x1745, 0x582A, 0x582A, 0x0DB8, 0x582F, 0x582F, 0x17FE,
- 0x5830, 0x5830, 0x171E, 0x5831, 0x5831, 0x13C4, 0x5834, 0x5834, 0x1989,
- 0x5835, 0x5835, 0x10B1, 0x583A, 0x583A, 0x0E7B, 0x584A, 0x584A, 0x0F11,
- 0x584B, 0x584B, 0x1772, 0x584F, 0x584F, 0x0DEC, 0x5851, 0x5851, 0x157E,
- 0x5854, 0x5854, 0x1D00, 0x5857, 0x5857, 0x10B2, 0x5858, 0x5858, 0x1091,
- 0x585A, 0x585A, 0x1C54, 0x585E, 0x585E, 0x14F2, 0x5861, 0x5861, 0x19FA,
- 0x5862, 0x5862, 0x17A9, 0x5864, 0x5864, 0x1F2D, 0x5875, 0x5875, 0x1B46,
- 0x5879, 0x5879, 0x1BAC, 0x587C, 0x587C, 0x19FB, 0x587E, 0x587E, 0x15FD,
- 0x5883, 0x5883, 0x0E55, 0x5885, 0x5885, 0x14FD, 0x5889, 0x5889, 0x1823,
- 0x5893, 0x5893, 0x12C1, 0x589C, 0x589C, 0x1C61, 0x589E, 0x589E, 0x1B13,
- 0x589F, 0x589F, 0x1E28, 0x58A8, 0x58A8, 0x12E2, 0x58A9, 0x58A9, 0x10DF,
- 0x58AE, 0x58AE, 0x1CD7, 0x58B3, 0x58B3, 0x1423, 0x58BA, 0x58BA, 0x17AA,
- 0x58BB, 0x58BB, 0x198A, 0x58BE, 0x58BE, 0x0D96, 0x58C1, 0x58C1, 0x139E,
- 0x58C5, 0x58C5, 0x17CA, 0x58C7, 0x58C7, 0x1065, 0x58CE, 0x58CE, 0x1F2E,
- 0x58D1, 0x58D1, 0x1DCE, 0x58D3, 0x58D3, 0x16C5, 0x58D5, 0x58D5, 0x1E7B,
- 0x58D8, 0x58D8, 0x11D4, 0x58D9, 0x58D9, 0x0F02, 0x58DE, 0x58DE, 0x0F12,
- 0x58DF, 0x58DF, 0x11B8, 0x58E4, 0x58E4, 0x16F8, 0x58EB, 0x58EB, 0x1487,
- 0x58EC, 0x58EC, 0x1946, 0x58EF, 0x58EF, 0x198B, 0x58F9, 0x58F9, 0x193F,
- 0x58FA, 0x58FA, 0x1E7C, 0x58FB, 0x58FB, 0x14FE, 0x58FD, 0x58FD, 0x15C4,
- 0x590F, 0x590F, 0x1DC3, 0x5914, 0x5914, 0x0FE7, 0x5915, 0x5915, 0x151B,
- 0x5916, 0x5916, 0x17F7, 0x5919, 0x5919, 0x15FE, 0x591A, 0x591A, 0x105E,
- 0x591C, 0x591C, 0x16E9, 0x5922, 0x5922, 0x12BD, 0x5927, 0x5927, 0x109D,
- 0x5929, 0x5929, 0x1BEF, 0x592A, 0x592A, 0x1D09, 0x592B, 0x592B, 0x13FE,
- 0x592D, 0x592D, 0x17FF, 0x592E, 0x592E, 0x16CA, 0x5931, 0x5931, 0x167E,
- 0x5937, 0x5937, 0x1910, 0x593E, 0x593E, 0x1E51, 0x5944, 0x5944, 0x1728,
- 0x5947, 0x5947, 0x0FE8, 0x5948, 0x5948, 0x103C, 0x5949, 0x5949, 0x13E6,
- 0x594E, 0x594E, 0x0F9C, 0x594F, 0x594F, 0x1AD5, 0x5950, 0x5950, 0x1ECC,
- 0x5951, 0x5951, 0x0E7C, 0x5954, 0x5954, 0x1424, 0x5955, 0x5955, 0x1E32,
- 0x5957, 0x5957, 0x1D2A, 0x595A, 0x595A, 0x1E09, 0x5960, 0x5960, 0x19FC,
- 0x5962, 0x5962, 0x1488, 0x5967, 0x5967, 0x17AB, 0x596A, 0x596A, 0x1CFA,
- 0x596B, 0x596B, 0x18D8, 0x596C, 0x596C, 0x198C, 0x596D, 0x596D, 0x151C,
- 0x596E, 0x596E, 0x1425, 0x5973, 0x5973, 0x103F, 0x5974, 0x5974, 0x104A,
- 0x5978, 0x5978, 0x0D97, 0x597D, 0x597D, 0x1E7D, 0x5982, 0x5982, 0x1730,
- 0x5983, 0x5983, 0x1442, 0x5984, 0x5984, 0x1259, 0x598A, 0x598A, 0x1947,
- 0x5993, 0x5993, 0x0FE9, 0x5996, 0x5996, 0x1800, 0x5997, 0x5997, 0x0FC7,
- 0x5999, 0x5999, 0x12C2, 0x59A5, 0x59A5, 0x1CD8, 0x59A8, 0x59A8, 0x1350,
- 0x59AC, 0x59AC, 0x1D2B, 0x59B9, 0x59B9, 0x1265, 0x59BB, 0x59BB, 0x1BDB,
- 0x59BE, 0x59BE, 0x1C14, 0x59C3, 0x59C3, 0x1A36, 0x59C6, 0x59C6, 0x129F,
- 0x59C9, 0x59C9, 0x1956, 0x59CB, 0x59CB, 0x163F, 0x59D0, 0x59D0, 0x19C3,
- 0x59D1, 0x59D1, 0x0E96, 0x59D3, 0x59D3, 0x1563, 0x59D4, 0x59D4, 0x1891,
- 0x59D9, 0x59D9, 0x1948, 0x59DA, 0x59DA, 0x1801, 0x59DC, 0x59DC, 0x0DD2,
- 0x59DD, 0x59DD, 0x1AD0, 0x59E6, 0x59E6, 0x0D98, 0x59E8, 0x59E8, 0x1911,
- 0x59EA, 0x59EA, 0x1B69, 0x59EC, 0x59EC, 0x1F68, 0x59EE, 0x59EE, 0x1DF8,
- 0x59F8, 0x59F8, 0x1746, 0x59FB, 0x59FB, 0x1931, 0x59FF, 0x59FF, 0x1957,
- 0x5A01, 0x5A01, 0x1892, 0x5A03, 0x5A03, 0x17F4, 0x5A11, 0x5A11, 0x1489,
- 0x5A18, 0x5A18, 0x1039, 0x5A1B, 0x5A1B, 0x17AC, 0x5A1C, 0x5A1C, 0x1026,
- 0x5A1F, 0x5A1F, 0x1747, 0x5A20, 0x5A20, 0x166B, 0x5A25, 0x5A25, 0x1693,
- 0x5A29, 0x5A29, 0x1240, 0x5A36, 0x5A36, 0x1C97, 0x5A3C, 0x5A3C, 0x1BB8,
- 0x5A41, 0x5A41, 0x11D5, 0x5A46, 0x5A46, 0x1D33, 0x5A49, 0x5A49, 0x17DB,
- 0x5A5A, 0x5A5A, 0x1EA4, 0x5A62, 0x5A62, 0x1443, 0x5A66, 0x5A66, 0x13FF,
- 0x5A92, 0x5A92, 0x1266, 0x5A9A, 0x5A9A, 0x12F4, 0x5A9B, 0x5A9B, 0x1875,
- 0x5AA4, 0x5AA4, 0x1640, 0x5AC1, 0x5AC1, 0x0D75, 0x5AC2, 0x5AC2, 0x15C5,
- 0x5AC4, 0x5AC4, 0x1876, 0x5AC9, 0x5AC9, 0x1B6A, 0x5ACC, 0x5ACC, 0x1E4E,
- 0x5AE1, 0x5AE1, 0x19DD, 0x5AE6, 0x5AE6, 0x1DF9, 0x5AE9, 0x5AE9, 0x1055,
- 0x5B05, 0x5B05, 0x1EB9, 0x5B09, 0x5B09, 0x1F69, 0x5B0B, 0x5B0B, 0x152E,
- 0x5B0C, 0x5B0C, 0x0F20, 0x5B16, 0x5B16, 0x1D6F, 0x5B2A, 0x5B2A, 0x1468,
- 0x5B40, 0x5B40, 0x14DA, 0x5B43, 0x5B43, 0x16F9, 0x5B50, 0x5B50, 0x1958,
- 0x5B51, 0x5B51, 0x1E4A, 0x5B54, 0x5B54, 0x0ECE, 0x5B55, 0x5B55, 0x1951,
- 0x5B57, 0x5B57, 0x1959, 0x5B58, 0x5B58, 0x1AB0, 0x5B5A, 0x5B5A, 0x1400,
- 0x5B5C, 0x5B5C, 0x195A, 0x5B5D, 0x5B5D, 0x1F13, 0x5B5F, 0x5B5F, 0x1277,
- 0x5B63, 0x5B63, 0x0E7D, 0x5B64, 0x5B64, 0x0E97, 0x5B69, 0x5B69, 0x1E0A,
- 0x5B6B, 0x5B6B, 0x15AA, 0x5B70, 0x5B70, 0x15FF, 0x5B71, 0x5B71, 0x197A,
- 0x5B75, 0x5B75, 0x1401, 0x5B78, 0x5B78, 0x1DCF, 0x5B7A, 0x5B7A, 0x18AB,
- 0x5B7C, 0x5B7C, 0x1723, 0x5B85, 0x5B85, 0x10AA, 0x5B87, 0x5B87, 0x183C,
- 0x5B88, 0x5B88, 0x15C6, 0x5B89, 0x5B89, 0x16AF, 0x5B8B, 0x5B8B, 0x15B1,
- 0x5B8C, 0x5B8C, 0x17DC, 0x5B8F, 0x5B8F, 0x0F18, 0x5B93, 0x5B93, 0x13D6,
- 0x5B95, 0x5B95, 0x1D03, 0x5B96, 0x5B96, 0x1F0E, 0x5B97, 0x5B97, 0x1AB6,
- 0x5B98, 0x5B98, 0x0EEC, 0x5B99, 0x5B99, 0x1AD6, 0x5B9A, 0x5B9A, 0x1A37,
- 0x5B9B, 0x5B9B, 0x17DD, 0x5B9C, 0x5B9C, 0x18FD, 0x5BA2, 0x5BA2, 0x0DFC,
- 0x5BA3, 0x5BA3, 0x152F, 0x5BA4, 0x5BA4, 0x167F, 0x5BA5, 0x5BA5, 0x18AC,
- 0x5BA6, 0x5BA6, 0x1ECD, 0x5BAC, 0x5BAC, 0x1564, 0x5BAE, 0x5BAE, 0x0F7B,
- 0x5BB0, 0x5BB0, 0x19AD, 0x5BB3, 0x5BB3, 0x1E0B, 0x5BB4, 0x5BB4, 0x1748,
- 0x5BB5, 0x5BB5, 0x157F, 0x5BB6, 0x5BB6, 0x0D76, 0x5BB8, 0x5BB8, 0x166C,
- 0x5BB9, 0x5BB9, 0x1824, 0x5BBF, 0x5BBF, 0x1600, 0x5BC0, 0x5BC0, 0x1BCC,
- 0x5BC2, 0x5BC2, 0x19DE, 0x5BC3, 0x5BC3, 0x1877, 0x5BC4, 0x5BC4, 0x0FEA,
- 0x5BC5, 0x5BC5, 0x1932, 0x5BC6, 0x5BC6, 0x1313, 0x5BC7, 0x5BC7, 0x0F43,
- 0x5BCC, 0x5BCC, 0x1402, 0x5BD0, 0x5BD0, 0x1267, 0x5BD2, 0x5BD2, 0x1DD3,
- 0x5BD3, 0x5BD3, 0x183D, 0x5BD4, 0x5BD4, 0x1659, 0x5BD7, 0x5BD7, 0x1048,
- 0x5BDE, 0x5BDE, 0x1238, 0x5BDF, 0x5BDF, 0x1BA6, 0x5BE1, 0x5BE1, 0x0EDB,
- 0x5BE2, 0x5BE2, 0x1CC8, 0x5BE4, 0x5BE4, 0x17AD, 0x5BE5, 0x5BE5, 0x1802,
- 0x5BE6, 0x5BE6, 0x1680, 0x5BE7, 0x5BE7, 0x1047, 0x5BE8, 0x5BE8, 0x1BCD,
- 0x5BE9, 0x5BE9, 0x1682, 0x5BEB, 0x5BEB, 0x148A, 0x5BEC, 0x5BEC, 0x0EED,
- 0x5BEE, 0x5BEE, 0x11C9, 0x5BEF, 0x5BEF, 0x1AFA, 0x5BF5, 0x5BF5, 0x1C55,
- 0x5BF6, 0x5BF6, 0x13C5, 0x5BF8, 0x5BF8, 0x1C4F, 0x5BFA, 0x5BFA, 0x148B,
- 0x5C01, 0x5C01, 0x13E7, 0x5C04, 0x5C04, 0x148C, 0x5C07, 0x5C07, 0x198D,
- 0x5C08, 0x5C08, 0x19FD, 0x5C09, 0x5C09, 0x1893, 0x5C0A, 0x5C0A, 0x1AB1,
- 0x5C0B, 0x5C0B, 0x1683, 0x5C0D, 0x5C0D, 0x109E, 0x5C0E, 0x5C0E, 0x10B3,
- 0x5C0F, 0x5C0F, 0x1580, 0x5C11, 0x5C11, 0x1581, 0x5C16, 0x5C16, 0x1C0A,
- 0x5C19, 0x5C19, 0x14DB, 0x5C24, 0x5C24, 0x183E, 0x5C28, 0x5C28, 0x1351,
- 0x5C31, 0x5C31, 0x1C98, 0x5C38, 0x5C38, 0x1641, 0x5C39, 0x5C39, 0x18D9,
- 0x5C3A, 0x5C3A, 0x1BE0, 0x5C3B, 0x5C3B, 0x0E98, 0x5C3C, 0x5C3C, 0x105A,
- 0x5C3E, 0x5C3E, 0x12F5, 0x5C3F, 0x5C3F, 0x1054, 0x5C40, 0x5C40, 0x0F6C,
- 0x5C45, 0x5C45, 0x0E03, 0x5C46, 0x5C46, 0x0E7E, 0x5C48, 0x5C48, 0x0F78,
- 0x5C4B, 0x5C4B, 0x17BE, 0x5C4D, 0x5C4D, 0x1643, 0x5C4E, 0x5C4E, 0x1642,
- 0x5C51, 0x5C51, 0x154B, 0x5C55, 0x5C55, 0x19FE, 0x5C5B, 0x5C5B, 0x13B4,
- 0x5C60, 0x5C60, 0x10B4, 0x5C62, 0x5C62, 0x11D6, 0x5C64, 0x5C64, 0x1CA7,
- 0x5C65, 0x5C65, 0x120A, 0x5C6C, 0x5C6C, 0x15A2, 0x5C6F, 0x5C6F, 0x1106,
- 0x5C71, 0x5C71, 0x14B9, 0x5C79, 0x5C79, 0x1F58, 0x5C90, 0x5C90, 0x0FEB,
- 0x5C91, 0x5C91, 0x197F, 0x5CA1, 0x5CA1, 0x0DD3, 0x5CA9, 0x5CA9, 0x16BE,
- 0x5CAB, 0x5CAB, 0x15C7, 0x5CAC, 0x5CAC, 0x0DCB, 0x5CB1, 0x5CB1, 0x109F,
- 0x5CB3, 0x5CB3, 0x16A2, 0x5CB5, 0x5CB5, 0x1E7E, 0x5CB7, 0x5CB7, 0x1306,
- 0x5CB8, 0x5CB8, 0x16B0, 0x5CBA, 0x5CBA, 0x118C, 0x5CBE, 0x5CBE, 0x1A25,
- 0x5CC0, 0x5CC0, 0x15C8, 0x5CD9, 0x5CD9, 0x1CAB, 0x5CE0, 0x5CE0, 0x14DC,
- 0x5CE8, 0x5CE8, 0x1694, 0x5CEF, 0x5CF0, 0x13E8, 0x5CF4, 0x5CF4, 0x1E37,
- 0x5CF6, 0x5CF6, 0x10B5, 0x5CFB, 0x5CFB, 0x1AFB, 0x5CFD, 0x5CFD, 0x1E52,
- 0x5D07, 0x5D07, 0x1627, 0x5D0D, 0x5D0D, 0x1145, 0x5D0E, 0x5D0E, 0x0FEC,
- 0x5D11, 0x5D11, 0x0EC0, 0x5D14, 0x5D14, 0x1C5F, 0x5D16, 0x5D16, 0x16D3,
- 0x5D17, 0x5D17, 0x0DD4, 0x5D19, 0x5D19, 0x11F4, 0x5D27, 0x5D27, 0x1628,
- 0x5D29, 0x5D29, 0x1437, 0x5D4B, 0x5D4B, 0x12F6, 0x5D4C, 0x5D4C, 0x0DB9,
- 0x5D50, 0x5D50, 0x112F, 0x5D69, 0x5D69, 0x1629, 0x5D6C, 0x5D6C, 0x17F8,
- 0x5D6F, 0x5D6F, 0x1B86, 0x5D87, 0x5D87, 0x0F44, 0x5D8B, 0x5D8B, 0x10B6,
- 0x5D9D, 0x5D9D, 0x110D, 0x5DA0, 0x5DA0, 0x0F21, 0x5DA2, 0x5DA2, 0x1803,
- 0x5DAA, 0x5DAA, 0x172B, 0x5DB8, 0x5DB8, 0x1773, 0x5DBA, 0x5DBA, 0x118D,
- 0x5DBC, 0x5DBC, 0x14FF, 0x5DBD, 0x5DBD, 0x16A3, 0x5DCD, 0x5DCD, 0x17F9,
- 0x5DD2, 0x5DD2, 0x1241, 0x5DD6, 0x5DD6, 0x16BF, 0x5DDD, 0x5DDD, 0x1BF0,
- 0x5DDE, 0x5DDE, 0x1AD7, 0x5DE1, 0x5DE1, 0x1608, 0x5DE2, 0x5DE2, 0x1582,
- 0x5DE5, 0x5DE5, 0x0ECF, 0x5DE6, 0x5DE6, 0x1AC8, 0x5DE7, 0x5DE7, 0x0F22,
- 0x5DE8, 0x5DE8, 0x0E04, 0x5DEB, 0x5DEB, 0x12CD, 0x5DEE, 0x5DEE, 0x1B87,
- 0x5DF1, 0x5DF1, 0x0FED, 0x5DF2, 0x5DF2, 0x1912, 0x5DF3, 0x5DF3, 0x148D,
- 0x5DF4, 0x5DF4, 0x1D34, 0x5DF7, 0x5DF7, 0x1DFA, 0x5DFD, 0x5DFD, 0x15AB,
- 0x5DFE, 0x5DFE, 0x0E14, 0x5E02, 0x5E02, 0x1644, 0x5E03, 0x5E03, 0x1D7F,
- 0x5E06, 0x5E06, 0x1392, 0x5E0C, 0x5E0C, 0x1F6A, 0x5E11, 0x5E11, 0x1D04,
- 0x5E16, 0x5E16, 0x1C15, 0x5E19, 0x5E19, 0x1B6B, 0x5E1B, 0x5E1B, 0x137E,
- 0x5E1D, 0x5E1D, 0x1A6B, 0x5E25, 0x5E25, 0x15C9, 0x5E2B, 0x5E2B, 0x148E,
- 0x5E2D, 0x5E2D, 0x151D, 0x5E33, 0x5E33, 0x198E, 0x5E36, 0x5E36, 0x10A0,
- 0x5E38, 0x5E38, 0x14DD, 0x5E3D, 0x5E3D, 0x12A0, 0x5E3F, 0x5E3F, 0x1F25,
- 0x5E40, 0x5E40, 0x1A38, 0x5E44, 0x5E44, 0x16A4, 0x5E45, 0x5E45, 0x1D93,
- 0x5E47, 0x5E47, 0x1352, 0x5E4C, 0x5E4C, 0x1EE1, 0x5E55, 0x5E55, 0x1239,
- 0x5E5F, 0x5E5F, 0x1CAC, 0x5E61, 0x5E61, 0x1384, 0x5E62, 0x5E62, 0x1092,
- 0x5E63, 0x5E63, 0x1D70, 0x5E72, 0x5E72, 0x0D99, 0x5E73, 0x5E73, 0x1D6A,
- 0x5E74, 0x5E74, 0x1040, 0x5E77, 0x5E77, 0x13B5, 0x5E78, 0x5E78, 0x1E1A,
- 0x5E79, 0x5E79, 0x0D9A, 0x5E7B, 0x5E7B, 0x1ECE, 0x5E7C, 0x5E7D, 0x18AD,
- 0x5E7E, 0x5E7E, 0x0FEE, 0x5E84, 0x5E84, 0x198F, 0x5E87, 0x5E87, 0x1444,
- 0x5E8A, 0x5E8A, 0x14DE, 0x5E8F, 0x5E8F, 0x1500, 0x5E95, 0x5E95, 0x19C4,
- 0x5E97, 0x5E97, 0x1A26, 0x5E9A, 0x5E9A, 0x0E56, 0x5E9C, 0x5E9C, 0x1403,
- 0x5EA0, 0x5EA0, 0x14DF, 0x5EA6, 0x5EA6, 0x10B7, 0x5EA7, 0x5EA7, 0x1AC9,
- 0x5EAB, 0x5EAB, 0x0E99, 0x5EAD, 0x5EAD, 0x1A39, 0x5EB5, 0x5EB5, 0x16C0,
- 0x5EB6, 0x5EB6, 0x1501, 0x5EB7, 0x5EB7, 0x0DD5, 0x5EB8, 0x5EB8, 0x1825,
- 0x5EBE, 0x5EBE, 0x18AF, 0x5EC2, 0x5EC2, 0x14E0, 0x5EC8, 0x5EC8, 0x1DC4,
- 0x5EC9, 0x5EC9, 0x1183, 0x5ECA, 0x5ECA, 0x113C, 0x5ED0, 0x5ED0, 0x0F45,
- 0x5ED3, 0x5ED3, 0x0EE7, 0x5ED6, 0x5ED6, 0x11CA, 0x5EDA, 0x5EDA, 0x1AD8,
- 0x5EDB, 0x5EDB, 0x19FF, 0x5EDF, 0x5EDF, 0x12C3, 0x5EE0, 0x5EE0, 0x1BB9,
- 0x5EE2, 0x5EE2, 0x1D71, 0x5EE3, 0x5EE3, 0x0F03, 0x5EEC, 0x5EEC, 0x115C,
- 0x5EF3, 0x5EF3, 0x1C1D, 0x5EF6, 0x5EF6, 0x1749, 0x5EF7, 0x5EF7, 0x1A3A,
- 0x5EFA, 0x5EFA, 0x0E15, 0x5EFB, 0x5EFB, 0x1EFA, 0x5F01, 0x5F01, 0x13A8,
- 0x5F04, 0x5F04, 0x11B9, 0x5F0A, 0x5F0A, 0x1D72, 0x5F0F, 0x5F0F, 0x165A,
- 0x5F11, 0x5F11, 0x1645, 0x5F13, 0x5F13, 0x0F7C, 0x5F14, 0x5F14, 0x1A83,
- 0x5F15, 0x5F15, 0x1933, 0x5F17, 0x5F17, 0x1434, 0x5F18, 0x5F18, 0x1EAE,
- 0x5F1B, 0x5F1B, 0x1913, 0x5F1F, 0x5F1F, 0x1A6C, 0x5F26, 0x5F26, 0x1E38,
- 0x5F27, 0x5F27, 0x1E7F, 0x5F29, 0x5F29, 0x104B, 0x5F31, 0x5F31, 0x16F0,
- 0x5F35, 0x5F35, 0x1990, 0x5F3A, 0x5F3A, 0x0DD6, 0x5F3C, 0x5F3C, 0x1DB5,
- 0x5F48, 0x5F48, 0x1CF3, 0x5F4A, 0x5F4A, 0x0DD7, 0x5F4C, 0x5F4C, 0x12F7,
- 0x5F4E, 0x5F4E, 0x1242, 0x5F56, 0x5F56, 0x1066, 0x5F57, 0x5F57, 0x1E70,
- 0x5F59, 0x5F59, 0x1F3D, 0x5F5B, 0x5F5B, 0x1914, 0x5F62, 0x5F62, 0x1E5F,
- 0x5F66, 0x5F66, 0x171F, 0x5F67, 0x5F67, 0x1856, 0x5F69, 0x5F69, 0x1BCE,
- 0x5F6A, 0x5F6A, 0x1D9A, 0x5F6B, 0x5F6B, 0x1A84, 0x5F6C, 0x5F6C, 0x1469,
- 0x5F6D, 0x5F6D, 0x1D59, 0x5F70, 0x5F70, 0x1BBA, 0x5F71, 0x5F71, 0x1774,
- 0x5F77, 0x5F77, 0x1353, 0x5F79, 0x5F79, 0x173D, 0x5F7C, 0x5F7C, 0x1DAD,
- 0x5F7F, 0x5F7F, 0x1435, 0x5F80, 0x5F80, 0x17EE, 0x5F81, 0x5F81, 0x1A3B,
- 0x5F85, 0x5F85, 0x10A1, 0x5F87, 0x5F87, 0x1609, 0x5F8A, 0x5F8A, 0x1EFB,
- 0x5F8B, 0x5F8B, 0x11F8, 0x5F8C, 0x5F8C, 0x1F26, 0x5F90, 0x5F90, 0x1502,
- 0x5F91, 0x5F91, 0x0E57, 0x5F92, 0x5F92, 0x10B8, 0x5F97, 0x5F97, 0x110C,
- 0x5F98, 0x5F98, 0x136C, 0x5F99, 0x5F99, 0x148F, 0x5F9E, 0x5F9E, 0x1AB7,
- 0x5FA0, 0x5FA0, 0x1146, 0x5FA1, 0x5FA1, 0x170F, 0x5FA8, 0x5FA8, 0x1EE2,
- 0x5FA9, 0x5FA9, 0x13D7, 0x5FAA, 0x5FAA, 0x160A, 0x5FAE, 0x5FAE, 0x12F8,
- 0x5FB5, 0x5FB5, 0x1B7E, 0x5FB7, 0x5FB7, 0x10AB, 0x5FB9, 0x5FB9, 0x1C02,
- 0x5FBD, 0x5FBD, 0x1F3E, 0x5FC3, 0x5FC3, 0x1684, 0x5FC5, 0x5FC5, 0x1DB6,
- 0x5FCC, 0x5FCC, 0x0FEF, 0x5FCD, 0x5FCD, 0x1934, 0x5FD6, 0x5FD6, 0x1C50,
- 0x5FD7, 0x5FD7, 0x1B23, 0x5FD8, 0x5FD9, 0x125A, 0x5FE0, 0x5FE0, 0x1C8B,
- 0x5FEB, 0x5FEB, 0x1CD3, 0x5FF5, 0x5FF5, 0x1043, 0x5FFD, 0x5FFD, 0x1EAA,
- 0x5FFF, 0x5FFF, 0x1426, 0x600F, 0x600F, 0x16CB, 0x6012, 0x6012, 0x104C,
- 0x6016, 0x6016, 0x1D80, 0x601C, 0x601C, 0x118E, 0x601D, 0x601D, 0x1490,
- 0x6020, 0x6020, 0x1D0A, 0x6021, 0x6021, 0x1915, 0x6025, 0x6025, 0x0FD5,
- 0x6027, 0x6027, 0x1565, 0x6028, 0x6028, 0x1878, 0x602A, 0x602A, 0x0F13,
- 0x602F, 0x602F, 0x0E29, 0x6041, 0x6041, 0x1949, 0x6042, 0x6042, 0x160B,
- 0x6043, 0x6043, 0x1646, 0x604D, 0x604D, 0x1EE3, 0x6050, 0x6050, 0x0ED0,
- 0x6052, 0x6052, 0x1DFB, 0x6055, 0x6055, 0x1503, 0x6059, 0x6059, 0x16FA,
- 0x605D, 0x605D, 0x0EFC, 0x6062, 0x6062, 0x1EFC, 0x6063, 0x6063, 0x195B,
- 0x6064, 0x6064, 0x1F4A, 0x6065, 0x6065, 0x1CAD, 0x6068, 0x6068, 0x1DD4,
- 0x6069, 0x6069, 0x18E6, 0x606A, 0x606A, 0x0D8C, 0x606C, 0x606C, 0x1044,
- 0x606D, 0x606D, 0x0ED1, 0x606F, 0x606F, 0x165B, 0x6070, 0x6070, 0x1F5F,
- 0x6085, 0x6085, 0x1761, 0x6089, 0x6089, 0x1681, 0x608C, 0x608C, 0x1A6D,
- 0x608D, 0x608D, 0x1DD5, 0x6094, 0x6094, 0x1EFD, 0x6096, 0x6096, 0x1D50,
- 0x609A, 0x609A, 0x15B2, 0x609B, 0x609B, 0x1A00, 0x609F, 0x609F, 0x17AE,
- 0x60A0, 0x60A0, 0x18B0, 0x60A3, 0x60A3, 0x1ECF, 0x60A4, 0x60A4, 0x1C56,
- 0x60A7, 0x60A7, 0x120B, 0x60B0, 0x60B0, 0x1AB8, 0x60B2, 0x60B2, 0x1445,
- 0x60B3, 0x60B3, 0x10AC, 0x60B4, 0x60B4, 0x1C90, 0x60B6, 0x60B6, 0x1307,
- 0x60B8, 0x60B8, 0x0E7F, 0x60BC, 0x60BC, 0x10B9, 0x60BD, 0x60BD, 0x1BDC,
- 0x60C5, 0x60C5, 0x1A3C, 0x60C7, 0x60C7, 0x10E0, 0x60D1, 0x60D1, 0x1EA1,
- 0x60DA, 0x60DA, 0x1EAB, 0x60DC, 0x60DC, 0x151E, 0x60DF, 0x60DF, 0x18B1,
- 0x60E0, 0x60E0, 0x1E71, 0x60E1, 0x60E1, 0x16A5, 0x60F0, 0x60F0, 0x1CD9,
- 0x60F1, 0x60F1, 0x1052, 0x60F3, 0x60F3, 0x14E1, 0x60F6, 0x60F6, 0x1EE4,
- 0x60F9, 0x60F9, 0x16EA, 0x60FA, 0x60FA, 0x1566, 0x60FB, 0x60FB, 0x1CA5,
- 0x6101, 0x6101, 0x15CA, 0x6106, 0x6106, 0x0E16, 0x6108, 0x6109, 0x18B2,
- 0x610D, 0x610D, 0x1308, 0x610E, 0x610E, 0x1D5D, 0x610F, 0x610F, 0x18FE,
- 0x6115, 0x6115, 0x16A6, 0x611A, 0x611A, 0x183F, 0x611B, 0x611B, 0x16D4,
- 0x611F, 0x611F, 0x0DBA, 0x6127, 0x6127, 0x0F14, 0x6130, 0x6130, 0x1EE5,
- 0x6134, 0x6134, 0x1BBB, 0x6137, 0x6137, 0x0DED, 0x613C, 0x613C, 0x166D,
- 0x613E, 0x613E, 0x0DEE, 0x613F, 0x613F, 0x1879, 0x6142, 0x6142, 0x1826,
- 0x6144, 0x6144, 0x11F9, 0x6147, 0x6147, 0x18E7, 0x6148, 0x6148, 0x195C,
- 0x614A, 0x614A, 0x0E47, 0x614B, 0x614B, 0x1D0B, 0x614C, 0x614C, 0x1EE6,
- 0x6153, 0x6153, 0x1D9B, 0x6155, 0x6155, 0x12A1, 0x6158, 0x6159, 0x1BAD,
- 0x615D, 0x615D, 0x1D2F, 0x615F, 0x615F, 0x1D1D, 0x6162, 0x6162, 0x1243,
- 0x6163, 0x6163, 0x0EEE, 0x6164, 0x6164, 0x0D8D, 0x6167, 0x6167, 0x1E72,
- 0x6168, 0x6168, 0x0DEF, 0x616B, 0x616B, 0x1AB9, 0x616E, 0x616E, 0x115D,
- 0x6170, 0x6170, 0x1894, 0x6176, 0x6176, 0x0E58, 0x6177, 0x6177, 0x0DD8,
- 0x617D, 0x617D, 0x1BE1, 0x617E, 0x617E, 0x1818, 0x6181, 0x6181, 0x1C57,
- 0x6182, 0x6182, 0x1840, 0x618A, 0x618A, 0x1446, 0x618E, 0x618E, 0x1B14,
- 0x6190, 0x6190, 0x1171, 0x6191, 0x6191, 0x1475, 0x6194, 0x6194, 0x1C31,
- 0x6198, 0x6198, 0x1F6C, 0x6199, 0x6199, 0x1F6B, 0x619A, 0x619A, 0x1CF4,
- 0x61A4, 0x61A4, 0x1427, 0x61A7, 0x61A7, 0x10F0, 0x61A9, 0x61A9, 0x0E2C,
- 0x61AB, 0x61AB, 0x1309, 0x61AC, 0x61AC, 0x0E59, 0x61AE, 0x61AE, 0x12CE,
- 0x61B2, 0x61B2, 0x1E2B, 0x61B6, 0x61B6, 0x1719, 0x61BA, 0x61BA, 0x107B,
- 0x61BE, 0x61BE, 0x0DBB, 0x61C3, 0x61C3, 0x0FBA, 0x61C7, 0x61C7, 0x0D9B,
- 0x61C8, 0x61C8, 0x1E0C, 0x61C9, 0x61C9, 0x18F7, 0x61CA, 0x61CA, 0x17AF,
- 0x61CB, 0x61CB, 0x12CF, 0x61E6, 0x61E6, 0x1027, 0x61F2, 0x61F2, 0x1B7F,
- 0x61F6, 0x61F6, 0x1117, 0x61F7, 0x61F7, 0x1EFE, 0x61F8, 0x61F8, 0x1E39,
- 0x61FA, 0x61FA, 0x1BAF, 0x61FC, 0x61FC, 0x0F46, 0x61FF, 0x61FF, 0x18FF,
- 0x6200, 0x6200, 0x1172, 0x6207, 0x6207, 0x1093, 0x6208, 0x6208, 0x0EDC,
- 0x620A, 0x620A, 0x12D0, 0x620C, 0x620C, 0x1623, 0x620D, 0x620D, 0x15CB,
- 0x620E, 0x620E, 0x18E1, 0x6210, 0x6210, 0x1567, 0x6211, 0x6211, 0x1695,
- 0x6212, 0x6212, 0x0E80, 0x6216, 0x6216, 0x1EA2, 0x621A, 0x621A, 0x1BE2,
- 0x621F, 0x621F, 0x0FB3, 0x6221, 0x6221, 0x0DBC, 0x622A, 0x622A, 0x1A1D,
- 0x622E, 0x622E, 0x11F0, 0x6230, 0x6230, 0x1A01, 0x6231, 0x6231, 0x1F6D,
- 0x6234, 0x6234, 0x10A2, 0x6236, 0x6236, 0x1E80, 0x623E, 0x623E, 0x115E,
- 0x623F, 0x623F, 0x1354, 0x6240, 0x6240, 0x1583, 0x6241, 0x6241, 0x1D60,
- 0x6247, 0x6247, 0x1530, 0x6248, 0x6248, 0x1E81, 0x6249, 0x6249, 0x1447,
- 0x624B, 0x624B, 0x15CC, 0x624D, 0x624D, 0x19AE, 0x6253, 0x6253, 0x1CDA,
- 0x6258, 0x6258, 0x1CE6, 0x626E, 0x626E, 0x1428, 0x6271, 0x6271, 0x0FD6,
- 0x6276, 0x6276, 0x1404, 0x6279, 0x6279, 0x1448, 0x627C, 0x627C, 0x16DC,
- 0x627F, 0x627F, 0x1637, 0x6280, 0x6280, 0x0FF0, 0x6284, 0x6284, 0x1C32,
- 0x6289, 0x6289, 0x0E40, 0x628A, 0x628A, 0x1D35, 0x6291, 0x6291, 0x171A,
- 0x6292, 0x6292, 0x1504, 0x6295, 0x6295, 0x1D2C, 0x6297, 0x6297, 0x1DFC,
- 0x6298, 0x6298, 0x1A1E, 0x629B, 0x629B, 0x1D81, 0x62AB, 0x62AB, 0x1DAE,
- 0x62B1, 0x62B1, 0x1D82, 0x62B5, 0x62B5, 0x19C5, 0x62B9, 0x62B9, 0x1252,
- 0x62BC, 0x62BC, 0x16C6, 0x62BD, 0x62BD, 0x1C62, 0x62C2, 0x62C2, 0x1436,
- 0x62C7, 0x62C7, 0x12D1, 0x62C8, 0x62C8, 0x1045, 0x62C9, 0x62C9, 0x1139,
- 0x62CC, 0x62CC, 0x132D, 0x62CD, 0x62CD, 0x1318, 0x62CF, 0x62CF, 0x1028,
- 0x62D0, 0x62D0, 0x0F15, 0x62D2, 0x62D2, 0x0E05, 0x62D3, 0x62D3, 0x1BE3,
- 0x62D4, 0x62D4, 0x1343, 0x62D6, 0x62D6, 0x1CDB, 0x62D7, 0x62D7, 0x1804,
- 0x62D8, 0x62D8, 0x0F47, 0x62D9, 0x62D9, 0x1AB3, 0x62DB, 0x62DB, 0x1C33,
- 0x62DC, 0x62DC, 0x136D, 0x62EC, 0x62EC, 0x0EFD, 0x62ED, 0x62ED, 0x165C,
- 0x62EE, 0x62EE, 0x1021, 0x62EF, 0x62EF, 0x1B16, 0x62F1, 0x62F1, 0x0ED2,
- 0x62F3, 0x62F3, 0x0F86, 0x62F7, 0x62F7, 0x0E9A, 0x62FE, 0x62FE, 0x162E,
- 0x62FF, 0x62FF, 0x1029, 0x6301, 0x6301, 0x1B24, 0x6307, 0x6307, 0x1B25,
- 0x6309, 0x6309, 0x16B1, 0x6311, 0x6311, 0x10BA, 0x632B, 0x632B, 0x1ACA,
- 0x632F, 0x632F, 0x1B47, 0x633A, 0x633A, 0x1A3D, 0x633B, 0x633B, 0x174B,
- 0x633D, 0x633D, 0x1244, 0x633E, 0x633E, 0x1E53, 0x6349, 0x6349, 0x1B8F,
- 0x634C, 0x634C, 0x1D4D, 0x634F, 0x634F, 0x102F, 0x6350, 0x6350, 0x174A,
- 0x6355, 0x6355, 0x1D83, 0x6367, 0x6367, 0x13EA, 0x6368, 0x6368, 0x1491,
- 0x636E, 0x636E, 0x0E06, 0x6372, 0x6372, 0x0F87, 0x6377, 0x6377, 0x1C16,
- 0x637A, 0x637A, 0x1030, 0x637B, 0x637B, 0x1046, 0x637F, 0x637F, 0x1505,
- 0x6383, 0x6383, 0x1584, 0x6388, 0x6388, 0x15CD, 0x6389, 0x6389, 0x10BB,
- 0x638C, 0x638C, 0x1991, 0x6392, 0x6392, 0x136E, 0x6396, 0x6396, 0x16DD,
- 0x6398, 0x6398, 0x0F79, 0x639B, 0x639B, 0x0F0D, 0x63A0, 0x63A0, 0x1149,
- 0x63A1, 0x63A1, 0x1BCF, 0x63A2, 0x63A2, 0x1CFC, 0x63A5, 0x63A5, 0x1A2D,
- 0x63A7, 0x63A7, 0x0ED3, 0x63A8, 0x63A8, 0x1C63, 0x63A9, 0x63A9, 0x1729,
- 0x63AA, 0x63AA, 0x1A85, 0x63C0, 0x63C0, 0x0D9C, 0x63C4, 0x63C4, 0x18B4,
- 0x63C6, 0x63C6, 0x0F9D, 0x63CF, 0x63CF, 0x12C4, 0x63D0, 0x63D0, 0x1A6E,
- 0x63D6, 0x63D6, 0x18F3, 0x63DA, 0x63DA, 0x16FB, 0x63DB, 0x63DB, 0x1ED0,
- 0x63E1, 0x63E1, 0x16A7, 0x63ED, 0x63ED, 0x0E2D, 0x63EE, 0x63EE, 0x1F3F,
- 0x63F4, 0x63F4, 0x187A, 0x63F6, 0x63F6, 0x16EB, 0x63F7, 0x63F7, 0x14CF,
- 0x640D, 0x640D, 0x15AC, 0x640F, 0x640F, 0x1319, 0x6414, 0x6414, 0x1585,
- 0x6416, 0x6416, 0x1805, 0x6417, 0x6417, 0x10BC, 0x641C, 0x641C, 0x15CE,
- 0x6422, 0x6422, 0x1B48, 0x642C, 0x642C, 0x132E, 0x642D, 0x642D, 0x1D01,
- 0x643A, 0x643A, 0x1F46, 0x643E, 0x643E, 0x1B90, 0x6458, 0x6458, 0x19DF,
- 0x6460, 0x6460, 0x1C58, 0x6469, 0x6469, 0x1230, 0x646F, 0x646F, 0x1B26,
- 0x6478, 0x6479, 0x12A2, 0x647A, 0x647A, 0x1A2E, 0x6488, 0x6488, 0x11A0,
- 0x6491, 0x6491, 0x1D17, 0x6492, 0x6492, 0x14C4, 0x6493, 0x6493, 0x1806,
- 0x649A, 0x649A, 0x1041, 0x649E, 0x649E, 0x1094, 0x64A4, 0x64A4, 0x1C03,
- 0x64A5, 0x64A5, 0x1344, 0x64AB, 0x64AB, 0x12D2, 0x64AD, 0x64AD, 0x1D36,
- 0x64AE, 0x64AE, 0x1C5D, 0x64B0, 0x64B0, 0x1B96, 0x64B2, 0x64B2, 0x131A,
- 0x64BB, 0x64BB, 0x1074, 0x64C1, 0x64C1, 0x17CB, 0x64C4, 0x64C4, 0x11A1,
- 0x64C5, 0x64C5, 0x1BF1, 0x64C7, 0x64C7, 0x1D15, 0x64CA, 0x64CA, 0x0E2E,
- 0x64CD, 0x64CD, 0x1A86, 0x64CE, 0x64CE, 0x0E5A, 0x64D2, 0x64D2, 0x0FC8,
- 0x64D4, 0x64D4, 0x107C, 0x64D8, 0x64D8, 0x139F, 0x64DA, 0x64DA, 0x0E07,
- 0x64E1, 0x64E1, 0x10A3, 0x64E2, 0x64E2, 0x1CE7, 0x64E5, 0x64E5, 0x1130,
- 0x64E6, 0x64E6, 0x1BA7, 0x64E7, 0x64E7, 0x0E08, 0x64EC, 0x64EC, 0x1900,
- 0x64F2, 0x64F2, 0x1BE4, 0x64F4, 0x64F4, 0x1EC5, 0x64FA, 0x64FA, 0x1D37,
- 0x64FE, 0x64FE, 0x1807, 0x6500, 0x6500, 0x132F, 0x6504, 0x6504, 0x1D18,
- 0x6518, 0x6518, 0x16FC, 0x651D, 0x651D, 0x155F, 0x6523, 0x6523, 0x1173,
- 0x652A, 0x652A, 0x0F23, 0x652B, 0x652B, 0x1EC6, 0x652C, 0x652C, 0x1131,
- 0x652F, 0x652F, 0x1B27, 0x6536, 0x6536, 0x15CF, 0x6537, 0x6537, 0x0E9B,
- 0x6538, 0x6538, 0x18B5, 0x6539, 0x6539, 0x0DF0, 0x653B, 0x653B, 0x0ED4,
- 0x653E, 0x653E, 0x1355, 0x653F, 0x653F, 0x1A3E, 0x6545, 0x6545, 0x0E9C,
- 0x6548, 0x6548, 0x1F14, 0x654D, 0x654D, 0x1506, 0x654E, 0x654E, 0x0F24,
- 0x654F, 0x654F, 0x130A, 0x6551, 0x6551, 0x0F48, 0x6556, 0x6556, 0x17B0,
- 0x6557, 0x6557, 0x1D51, 0x655E, 0x655E, 0x1BBC, 0x6562, 0x6562, 0x0DBD,
- 0x6563, 0x6563, 0x14BA, 0x6566, 0x6566, 0x10E1, 0x656C, 0x656C, 0x0E5B,
- 0x656D, 0x656D, 0x16FD, 0x6572, 0x6572, 0x0E9D, 0x6574, 0x6574, 0x1A3F,
- 0x6575, 0x6575, 0x19E0, 0x6577, 0x6577, 0x1405, 0x6578, 0x6578, 0x15D0,
- 0x657E, 0x657E, 0x1531, 0x6582, 0x6582, 0x1184, 0x6583, 0x6583, 0x1D73,
- 0x6585, 0x6585, 0x1F15, 0x6587, 0x6587, 0x12E8, 0x658C, 0x658C, 0x146A,
- 0x6590, 0x6590, 0x1449, 0x6591, 0x6591, 0x1330, 0x6597, 0x6597, 0x10FD,
- 0x6599, 0x6599, 0x11CB, 0x659B, 0x659B, 0x0EB8, 0x659C, 0x659C, 0x1492,
- 0x659F, 0x659F, 0x1B76, 0x65A1, 0x65A1, 0x16B9, 0x65A4, 0x65A4, 0x0FBB,
- 0x65A5, 0x65A5, 0x1BE5, 0x65A7, 0x65A7, 0x1406, 0x65AB, 0x65AB, 0x1970,
- 0x65AC, 0x65AC, 0x1BB0, 0x65AF, 0x65AF, 0x1493, 0x65B0, 0x65B0, 0x166E,
- 0x65B7, 0x65B7, 0x1067, 0x65B9, 0x65B9, 0x1356, 0x65BC, 0x65BC, 0x1710,
- 0x65BD, 0x65BD, 0x1647, 0x65C1, 0x65C1, 0x1357, 0x65C5, 0x65C5, 0x115F,
- 0x65CB, 0x65CB, 0x1532, 0x65CC, 0x65CC, 0x1A40, 0x65CF, 0x65CF, 0x1AAC,
- 0x65D2, 0x65D2, 0x11E2, 0x65D7, 0x65D7, 0x0FF1, 0x65E0, 0x65E0, 0x12D3,
- 0x65E3, 0x65E3, 0x0FF2, 0x65E5, 0x65E5, 0x1940, 0x65E6, 0x65E6, 0x1068,
- 0x65E8, 0x65E8, 0x1B28, 0x65E9, 0x65E9, 0x1A87, 0x65EC, 0x65EC, 0x160C,
- 0x65ED, 0x65ED, 0x1857, 0x65F1, 0x65F1, 0x1DD6, 0x65F4, 0x65F4, 0x1841,
- 0x65FA, 0x65FA, 0x17EF, 0x65FB, 0x65FC, 0x130B, 0x65FD, 0x65FD, 0x10E2,
- 0x65FF, 0x65FF, 0x17B1, 0x6606, 0x6606, 0x0EC1, 0x6607, 0x6607, 0x1638,
- 0x6609, 0x6609, 0x1358, 0x660A, 0x660A, 0x1E82, 0x660C, 0x660C, 0x1BBD,
- 0x660E, 0x660E, 0x128F, 0x660F, 0x660F, 0x1EA5, 0x6610, 0x6610, 0x1429,
- 0x6611, 0x6611, 0x0FC9, 0x6613, 0x6613, 0x173E, 0x6614, 0x6614, 0x151F,
- 0x6615, 0x6615, 0x1F53, 0x661E, 0x661E, 0x13B6, 0x661F, 0x661F, 0x1568,
- 0x6620, 0x6620, 0x1775, 0x6625, 0x6625, 0x1C84, 0x6627, 0x6627, 0x1268,
- 0x6628, 0x6628, 0x1971, 0x662D, 0x662D, 0x1586, 0x662F, 0x662F, 0x1648,
- 0x6630, 0x6630, 0x1DC5, 0x6631, 0x6631, 0x1858, 0x6634, 0x6634, 0x12C5,
- 0x6636, 0x6636, 0x1BBE, 0x663A, 0x663A, 0x13B7, 0x663B, 0x663B, 0x16CC,
- 0x6641, 0x6641, 0x1A88, 0x6642, 0x6642, 0x1649, 0x6643, 0x6644, 0x1EE7,
- 0x6649, 0x6649, 0x1B49, 0x664B, 0x664B, 0x1B4A, 0x664F, 0x664F, 0x16B2,
- 0x6659, 0x6659, 0x1AFC, 0x665B, 0x665B, 0x1E3A, 0x665D, 0x665D, 0x1AD9,
- 0x665E, 0x665E, 0x1F6E, 0x665F, 0x665F, 0x1569, 0x6664, 0x6664, 0x17B2,
- 0x6665, 0x6665, 0x1ED2, 0x6666, 0x6666, 0x1EFF, 0x6667, 0x6667, 0x1E83,
- 0x6668, 0x6668, 0x166F, 0x6669, 0x6669, 0x1245, 0x666B, 0x666B, 0x1CE8,
- 0x666E, 0x666E, 0x13C6, 0x666F, 0x666F, 0x0E5C, 0x6673, 0x6673, 0x1520,
- 0x6674, 0x6674, 0x1C1E, 0x6676, 0x6676, 0x1A41, 0x6677, 0x6677, 0x0F96,
- 0x6678, 0x6678, 0x1A42, 0x667A, 0x667A, 0x1B29, 0x6684, 0x6684, 0x1F37,
- 0x6687, 0x6687, 0x0D77, 0x6688, 0x6688, 0x1F34, 0x6689, 0x6689, 0x1F40,
- 0x668E, 0x668E, 0x1776, 0x6690, 0x6690, 0x1895, 0x6691, 0x6691, 0x1507,
- 0x6696, 0x6696, 0x102C, 0x6697, 0x6697, 0x16C1, 0x6698, 0x6698, 0x16FE,
- 0x669D, 0x669D, 0x1290, 0x66A0, 0x66A0, 0x0E9E, 0x66A2, 0x66A2, 0x1BBF,
- 0x66AB, 0x66AB, 0x1980, 0x66AE, 0x66AE, 0x12A4, 0x66B2, 0x66B2, 0x1992,
- 0x66B3, 0x66B3, 0x1E73, 0x66B4, 0x66B4, 0x1D94, 0x66B9, 0x66B9, 0x1558,
- 0x66BB, 0x66BB, 0x0E5D, 0x66BE, 0x66BE, 0x10E3, 0x66C4, 0x66C4, 0x176F,
- 0x66C6, 0x66C6, 0x116B, 0x66C7, 0x66C7, 0x107D, 0x66C9, 0x66C9, 0x1F16,
- 0x66D6, 0x66D6, 0x16D5, 0x66D9, 0x66D9, 0x1508, 0x66DC, 0x66DC, 0x1808,
- 0x66DD, 0x66DD, 0x1D95, 0x66E0, 0x66E0, 0x0F04, 0x66E6, 0x66E6, 0x1F6F,
- 0x66F0, 0x66F0, 0x17ED, 0x66F2, 0x66F2, 0x0EB9, 0x66F3, 0x66F3, 0x1791,
- 0x66F4, 0x66F4, 0x0E5E, 0x66F7, 0x66F7, 0x0DAE, 0x66F8, 0x66F8, 0x1509,
- 0x66F9, 0x66F9, 0x1A8A, 0x66FA, 0x66FA, 0x1A89, 0x66FC, 0x66FC, 0x1246,
- 0x66FE, 0x66FE, 0x1B15, 0x66FF, 0x66FF, 0x1C26, 0x6700, 0x6700, 0x1C60,
- 0x6703, 0x6703, 0x1F00, 0x6708, 0x6708, 0x1889, 0x6709, 0x6709, 0x18B6,
- 0x670B, 0x670B, 0x1438, 0x670D, 0x670D, 0x13D8, 0x6714, 0x6714, 0x14B6,
- 0x6715, 0x6715, 0x1B77, 0x6717, 0x6717, 0x113D, 0x671B, 0x671B, 0x125C,
- 0x671D, 0x671D, 0x1A8B, 0x671E, 0x671F, 0x0FF3, 0x6726, 0x6726, 0x12BE,
- 0x6727, 0x6727, 0x11BA, 0x6728, 0x6728, 0x12B4, 0x672A, 0x672A, 0x12F9,
- 0x672B, 0x672B, 0x1253, 0x672C, 0x672C, 0x13E3, 0x672D, 0x672D, 0x1BA8,
- 0x672E, 0x672E, 0x1C88, 0x6731, 0x6731, 0x1ADA, 0x6734, 0x6734, 0x131B,
- 0x6736, 0x6736, 0x1CDC, 0x673A, 0x673A, 0x0F90, 0x673D, 0x673D, 0x1F27,
- 0x6746, 0x6746, 0x0D9D, 0x6749, 0x6749, 0x14C9, 0x674E, 0x674E, 0x120C,
- 0x674F, 0x674F, 0x1E1B, 0x6750, 0x6750, 0x19AF, 0x6751, 0x6751, 0x1C51,
- 0x6753, 0x6753, 0x1D9C, 0x6756, 0x6756, 0x1993, 0x675C, 0x675C, 0x10FE,
- 0x675E, 0x675E, 0x0FF5, 0x675F, 0x675F, 0x15A3, 0x676D, 0x676D, 0x1DFD,
- 0x676F, 0x676F, 0x136F, 0x6770, 0x6770, 0x0E1F, 0x6771, 0x6771, 0x10F1,
- 0x6773, 0x6773, 0x12C6, 0x6775, 0x6775, 0x19C6, 0x6777, 0x6777, 0x1D38,
- 0x677B, 0x677B, 0x1057, 0x677E, 0x677E, 0x15B3, 0x677F, 0x677F, 0x1D44,
- 0x6787, 0x6787, 0x144A, 0x6789, 0x6789, 0x17F0, 0x678B, 0x678B, 0x1359,
- 0x678F, 0x678F, 0x1032, 0x6790, 0x6790, 0x1521, 0x6793, 0x6793, 0x10FF,
- 0x6795, 0x6795, 0x1CC9, 0x6797, 0x6797, 0x1227, 0x679A, 0x679A, 0x1269,
- 0x679C, 0x679C, 0x0EDD, 0x679D, 0x679D, 0x1B2A, 0x67AF, 0x67AF, 0x0E9F,
- 0x67B0, 0x67B0, 0x1D6B, 0x67B3, 0x67B3, 0x1B2B, 0x67B6, 0x67B7, 0x0D78,
- 0x67B8, 0x67B8, 0x0F49, 0x67BE, 0x67BE, 0x164A, 0x67C4, 0x67C4, 0x13B8,
- 0x67CF, 0x67CF, 0x137F, 0x67D0, 0x67D0, 0x12A5, 0x67D1, 0x67D1, 0x0DBE,
- 0x67D2, 0x67D2, 0x1CC5, 0x67D3, 0x67D3, 0x1766, 0x67D4, 0x67D4, 0x18B7,
- 0x67DA, 0x67DA, 0x18B8, 0x67DD, 0x67DD, 0x1CE9, 0x67E9, 0x67E9, 0x0F4A,
- 0x67EC, 0x67EC, 0x0D9E, 0x67EF, 0x67EF, 0x0D7A, 0x67F0, 0x67F0, 0x103D,
- 0x67F1, 0x67F1, 0x1ADB, 0x67F3, 0x67F3, 0x11E3, 0x67F4, 0x67F4, 0x164B,
- 0x67F5, 0x67F5, 0x1BD7, 0x67F6, 0x67F6, 0x1494, 0x67FB, 0x67FB, 0x1495,
- 0x67FE, 0x67FE, 0x1A43, 0x6812, 0x6812, 0x160D, 0x6813, 0x6813, 0x1A02,
- 0x6816, 0x6816, 0x150A, 0x6817, 0x6817, 0x11FA, 0x6821, 0x6821, 0x0F25,
- 0x6822, 0x6822, 0x1380, 0x682A, 0x682A, 0x1ADC, 0x682F, 0x682F, 0x1859,
- 0x6838, 0x6838, 0x1E18, 0x6839, 0x6839, 0x0FBC, 0x683C, 0x683C, 0x0E2F,
- 0x683D, 0x683D, 0x19B0, 0x6840, 0x6840, 0x0E20, 0x6841, 0x6841, 0x1DFE,
- 0x6842, 0x6842, 0x0E81, 0x6843, 0x6843, 0x10BD, 0x6848, 0x6848, 0x16B3,
- 0x684E, 0x684E, 0x1B6C, 0x6850, 0x6850, 0x10F2, 0x6851, 0x6851, 0x14E2,
- 0x6853, 0x6853, 0x1ED3, 0x6854, 0x6854, 0x1022, 0x686D, 0x686D, 0x1B4B,
- 0x6876, 0x6876, 0x1D1E, 0x687F, 0x687F, 0x0D9F, 0x6881, 0x6881, 0x114F,
- 0x6885, 0x6885, 0x126A, 0x688F, 0x688F, 0x0EBA, 0x6893, 0x6893, 0x19B1,
- 0x6894, 0x6894, 0x1CAE, 0x6897, 0x6897, 0x0E5F, 0x689D, 0x689D, 0x1A8C,
- 0x689F, 0x689F, 0x1F17, 0x68A1, 0x68A1, 0x17DE, 0x68A2, 0x68A2, 0x1C34,
- 0x68A7, 0x68A7, 0x17B3, 0x68A8, 0x68A8, 0x120D, 0x68AD, 0x68AD, 0x1496,
- 0x68AF, 0x68AF, 0x1A6F, 0x68B0, 0x68B0, 0x0E82, 0x68B1, 0x68B1, 0x0EC2,
- 0x68B3, 0x68B3, 0x1587, 0x68B5, 0x68B5, 0x1393, 0x68B6, 0x68B6, 0x12FA,
- 0x68C4, 0x68C4, 0x0FF7, 0x68C5, 0x68C5, 0x13B9, 0x68C9, 0x68C9, 0x1282,
- 0x68CB, 0x68CB, 0x0FF6, 0x68CD, 0x68CD, 0x0EC3, 0x68D2, 0x68D2, 0x13EB,
- 0x68D5, 0x68D5, 0x1ABA, 0x68D7, 0x68D7, 0x1A8D, 0x68D8, 0x68D8, 0x0FB4,
- 0x68DA, 0x68DA, 0x1439, 0x68DF, 0x68DF, 0x10F3, 0x68E0, 0x68E0, 0x1095,
- 0x68E7, 0x68E7, 0x197B, 0x68E8, 0x68E8, 0x0E83, 0x68EE, 0x68EE, 0x14CA,
- 0x68F2, 0x68F2, 0x150B, 0x68F9, 0x68F9, 0x10BE, 0x68FA, 0x68FA, 0x0EEF,
- 0x6900, 0x6900, 0x17DF, 0x6905, 0x6905, 0x1901, 0x690D, 0x690D, 0x165D,
- 0x690E, 0x690E, 0x1C64, 0x6912, 0x6912, 0x1C35, 0x6927, 0x6927, 0x1291,
- 0x6930, 0x6930, 0x16EC, 0x693D, 0x693D, 0x174C, 0x693F, 0x693F, 0x1C85,
- 0x694A, 0x694A, 0x16FF, 0x6953, 0x6953, 0x1DA8, 0x6954, 0x6954, 0x154C,
- 0x6955, 0x6955, 0x1CDD, 0x6957, 0x6957, 0x0E17, 0x6959, 0x6959, 0x12D4,
- 0x695A, 0x695A, 0x1C36, 0x695E, 0x695E, 0x1200, 0x6960, 0x6960, 0x1033,
- 0x6961, 0x6962, 0x18B9, 0x6963, 0x6963, 0x12FB, 0x6968, 0x6968, 0x1A44,
- 0x696B, 0x696B, 0x1B10, 0x696D, 0x696D, 0x172C, 0x696E, 0x696E, 0x19C7,
- 0x696F, 0x696F, 0x160E, 0x6975, 0x6975, 0x0FB5, 0x6977, 0x6977, 0x1E0D,
- 0x6978, 0x6978, 0x1C65, 0x6979, 0x6979, 0x1777, 0x6995, 0x6995, 0x1827,
- 0x699B, 0x699B, 0x1B4C, 0x699C, 0x699C, 0x135A, 0x69A5, 0x69A5, 0x1EE9,
- 0x69A7, 0x69A7, 0x144B, 0x69AE, 0x69AE, 0x1778, 0x69B4, 0x69B4, 0x11E4,
- 0x69BB, 0x69BB, 0x1D02, 0x69C1, 0x69C1, 0x0EA0, 0x69C3, 0x69C3, 0x1331,
- 0x69CB, 0x69CB, 0x0F4B, 0x69CC, 0x69CC, 0x1D24, 0x69CD, 0x69CD, 0x1BC0,
- 0x69D0, 0x69D0, 0x0F16, 0x69E8, 0x69E8, 0x0EE8, 0x69EA, 0x69EA, 0x0DF1,
- 0x69FB, 0x69FB, 0x0F9E, 0x69FD, 0x69FD, 0x1A8E, 0x69FF, 0x69FF, 0x0FBD,
- 0x6A02, 0x6A02, 0x16A8, 0x6A0A, 0x6A0A, 0x1385, 0x6A11, 0x6A11, 0x1150,
- 0x6A13, 0x6A13, 0x11D7, 0x6A17, 0x6A17, 0x19C8, 0x6A19, 0x6A19, 0x1D9D,
- 0x6A1E, 0x6A1E, 0x1C66, 0x6A1F, 0x6A1F, 0x1994, 0x6A21, 0x6A21, 0x12A6,
- 0x6A23, 0x6A23, 0x1700, 0x6A35, 0x6A35, 0x1C37, 0x6A38, 0x6A38, 0x131C,
- 0x6A39, 0x6A39, 0x15D1, 0x6A3A, 0x6A3A, 0x1EBA, 0x6A3D, 0x6A3D, 0x1AFD,
- 0x6A44, 0x6A44, 0x0DBF, 0x6A48, 0x6A48, 0x1809, 0x6A4B, 0x6A4B, 0x0F26,
- 0x6A52, 0x6A52, 0x185F, 0x6A53, 0x6A53, 0x160F, 0x6A58, 0x6A58, 0x0FAF,
- 0x6A59, 0x6A59, 0x110E, 0x6A5F, 0x6A5F, 0x0FF8, 0x6A61, 0x6A61, 0x14E3,
- 0x6A6B, 0x6A6B, 0x1F0F, 0x6A80, 0x6A80, 0x1069, 0x6A84, 0x6A84, 0x0E30,
- 0x6A89, 0x6A89, 0x1A45, 0x6A8D, 0x6A8D, 0x171B, 0x6A8E, 0x6A8E, 0x0FCA,
- 0x6A97, 0x6A97, 0x13A0, 0x6A9C, 0x6A9C, 0x1F01, 0x6AA2, 0x6AA2, 0x0E24,
- 0x6AA3, 0x6AA3, 0x1995, 0x6AB3, 0x6AB3, 0x146B, 0x6ABB, 0x6ABB, 0x1DE8,
- 0x6AC2, 0x6AC2, 0x10BF, 0x6AC3, 0x6AC3, 0x0F91, 0x6AD3, 0x6AD3, 0x11A2,
- 0x6ADA, 0x6ADA, 0x1160, 0x6ADB, 0x6ADB, 0x1B0F, 0x6AF6, 0x6AF6, 0x1E2C,
- 0x6AFB, 0x6AFB, 0x16E2, 0x6B04, 0x6B04, 0x1127, 0x6B0A, 0x6B0A, 0x0F88,
- 0x6B0C, 0x6B0C, 0x1996, 0x6B12, 0x6B12, 0x1128, 0x6B16, 0x6B16, 0x1132,
- 0x6B20, 0x6B20, 0x1F5B, 0x6B21, 0x6B21, 0x1B88, 0x6B23, 0x6B23, 0x1F54,
- 0x6B32, 0x6B32, 0x1819, 0x6B3A, 0x6B3A, 0x0FF9, 0x6B3D, 0x6B3D, 0x1F5C,
- 0x6B3E, 0x6B3E, 0x0EF0, 0x6B46, 0x6B46, 0x1F5D, 0x6B47, 0x6B47, 0x1E2F,
- 0x6B4C, 0x6B4C, 0x0D7B, 0x6B4E, 0x6B4E, 0x1CF5, 0x6B50, 0x6B50, 0x0F4C,
- 0x6B5F, 0x6B5F, 0x1731, 0x6B61, 0x6B61, 0x1ED1, 0x6B62, 0x6B62, 0x1B2C,
- 0x6B63, 0x6B63, 0x1A46, 0x6B64, 0x6B64, 0x1B89, 0x6B65, 0x6B65, 0x13C7,
- 0x6B66, 0x6B66, 0x12D5, 0x6B6A, 0x6B6A, 0x17F5, 0x6B72, 0x6B72, 0x1576,
- 0x6B77, 0x6B77, 0x116C, 0x6B78, 0x6B78, 0x0F97, 0x6B7B, 0x6B7B, 0x1497,
- 0x6B7F, 0x6B7F, 0x12BB, 0x6B83, 0x6B83, 0x16CD, 0x6B84, 0x6B84, 0x1B4D,
- 0x6B86, 0x6B86, 0x1D0C, 0x6B89, 0x6B89, 0x1610, 0x6B8A, 0x6B8A, 0x15D2,
- 0x6B96, 0x6B96, 0x165E, 0x6B98, 0x6B98, 0x197C, 0x6B9E, 0x6B9E, 0x1860,
- 0x6BAE, 0x6BAE, 0x1185, 0x6BAF, 0x6BAF, 0x146C, 0x6BB2, 0x6BB2, 0x1559,
- 0x6BB5, 0x6BB5, 0x106A, 0x6BB7, 0x6BB7, 0x18E8, 0x6BBA, 0x6BBA, 0x14C5,
- 0x6BBC, 0x6BBC, 0x0D8E, 0x6BBF, 0x6BBF, 0x1A03, 0x6BC1, 0x6BC1, 0x1F3C,
- 0x6BC5, 0x6BC5, 0x1902, 0x6BC6, 0x6BC6, 0x0F4D, 0x6BCB, 0x6BCB, 0x12D6,
- 0x6BCD, 0x6BCD, 0x12A7, 0x6BCF, 0x6BCF, 0x126B, 0x6BD2, 0x6BD2, 0x10D5,
- 0x6BD3, 0x6BD3, 0x18D4, 0x6BD4, 0x6BD4, 0x144C, 0x6BD6, 0x6BD8, 0x144D,
- 0x6BDB, 0x6BDB, 0x12A8, 0x6BEB, 0x6BEB, 0x1E84, 0x6BEC, 0x6BEC, 0x0F4E,
- 0x6C08, 0x6C08, 0x1A04, 0x6C0F, 0x6C0F, 0x168E, 0x6C11, 0x6C11, 0x130D,
- 0x6C13, 0x6C13, 0x1278, 0x6C23, 0x6C23, 0x0FFA, 0x6C34, 0x6C34, 0x15D3,
- 0x6C37, 0x6C37, 0x1476, 0x6C38, 0x6C38, 0x1779, 0x6C3E, 0x6C3E, 0x1394,
- 0x6C40, 0x6C40, 0x1A47, 0x6C41, 0x6C41, 0x1B11, 0x6C42, 0x6C42, 0x0F4F,
- 0x6C4E, 0x6C4E, 0x1395, 0x6C50, 0x6C50, 0x1522, 0x6C55, 0x6C55, 0x14BB,
- 0x6C57, 0x6C57, 0x1DD7, 0x6C5A, 0x6C5A, 0x17B4, 0x6C5D, 0x6C5D, 0x1732,
- 0x6C5E, 0x6C5E, 0x1EAF, 0x6C5F, 0x6C5F, 0x0DD9, 0x6C60, 0x6C60, 0x1B2D,
- 0x6C68, 0x6C68, 0x0EC8, 0x6C6A, 0x6C6A, 0x17F1, 0x6C6D, 0x6C6D, 0x1792,
- 0x6C70, 0x6C70, 0x1D0D, 0x6C72, 0x6C72, 0x0FD7, 0x6C76, 0x6C76, 0x12E9,
- 0x6C7A, 0x6C7A, 0x0E41, 0x6C7D, 0x6C7D, 0x0FFB, 0x6C7E, 0x6C7E, 0x142A,
- 0x6C81, 0x6C81, 0x1685, 0x6C82, 0x6C82, 0x0FFC, 0x6C83, 0x6C83, 0x17BF,
- 0x6C85, 0x6C85, 0x187B, 0x6C86, 0x6C86, 0x1DFF, 0x6C87, 0x6C87, 0x174D,
- 0x6C88, 0x6C88, 0x1CCA, 0x6C8C, 0x6C8C, 0x10E4, 0x6C90, 0x6C90, 0x12B5,
- 0x6C92, 0x6C92, 0x12BC, 0x6C93, 0x6C93, 0x108A, 0x6C94, 0x6C94, 0x1283,
- 0x6C95, 0x6C95, 0x12F1, 0x6C96, 0x6C96, 0x1C8C, 0x6C99, 0x6C99, 0x1498,
- 0x6C9A, 0x6C9A, 0x1B2E, 0x6C9B, 0x6C9B, 0x1D52, 0x6CAB, 0x6CAB, 0x1254,
- 0x6CAE, 0x6CAE, 0x19C9, 0x6CB3, 0x6CB3, 0x1DC6, 0x6CB8, 0x6CB8, 0x1450,
- 0x6CB9, 0x6CB9, 0x18BB, 0x6CBB, 0x6CBB, 0x1CAF, 0x6CBC, 0x6CBC, 0x1588,
- 0x6CBD, 0x6CBD, 0x0EA1, 0x6CBE, 0x6CBE, 0x1C0B, 0x6CBF, 0x6CBF, 0x174E,
- 0x6CC1, 0x6CC1, 0x1EEA, 0x6CC2, 0x6CC2, 0x1E60, 0x6CC4, 0x6CC4, 0x154D,
- 0x6CC9, 0x6CC9, 0x1BF2, 0x6CCA, 0x6CCA, 0x131D, 0x6CCC, 0x6CCC, 0x1DB7,
- 0x6CD3, 0x6CD3, 0x1EB0, 0x6CD5, 0x6CD5, 0x139A, 0x6CD7, 0x6CD7, 0x1499,
- 0x6CDB, 0x6CDB, 0x1396, 0x6CE1, 0x6CE1, 0x1D84, 0x6CE2, 0x6CE2, 0x1D39,
- 0x6CE3, 0x6CE3, 0x18F4, 0x6CE5, 0x6CE5, 0x105B, 0x6CE8, 0x6CE8, 0x1ADD,
- 0x6CEB, 0x6CEB, 0x1E3B, 0x6CEE, 0x6CEE, 0x1332, 0x6CEF, 0x6CEF, 0x130E,
- 0x6CF0, 0x6CF0, 0x1D0E, 0x6CF3, 0x6CF3, 0x177A, 0x6D0B, 0x6D0B, 0x1701,
- 0x6D0C, 0x6D0C, 0x1180, 0x6D11, 0x6D11, 0x13C8, 0x6D17, 0x6D17, 0x1577,
- 0x6D19, 0x6D19, 0x15D4, 0x6D1B, 0x6D1B, 0x111E, 0x6D1E, 0x6D1E, 0x10F4,
- 0x6D25, 0x6D25, 0x1B4E, 0x6D27, 0x6D27, 0x18BC, 0x6D29, 0x6D29, 0x154E,
- 0x6D2A, 0x6D2A, 0x1EB1, 0x6D32, 0x6D32, 0x1ADE, 0x6D35, 0x6D35, 0x1611,
- 0x6D36, 0x6D36, 0x1F50, 0x6D38, 0x6D38, 0x0F05, 0x6D39, 0x6D39, 0x187C,
- 0x6D3B, 0x6D3B, 0x1EDB, 0x6D3D, 0x6D3D, 0x1F60, 0x6D3E, 0x6D3E, 0x1D3A,
- 0x6D41, 0x6D41, 0x11E5, 0x6D59, 0x6D59, 0x1A1F, 0x6D5A, 0x6D5A, 0x1AFE,
- 0x6D5C, 0x6D5C, 0x146D, 0x6D63, 0x6D63, 0x17E0, 0x6D66, 0x6D66, 0x1D85,
- 0x6D69, 0x6D69, 0x1E85, 0x6D6A, 0x6D6A, 0x113E, 0x6D6C, 0x6D6C, 0x120E,
- 0x6D6E, 0x6D6E, 0x1407, 0x6D74, 0x6D74, 0x181A, 0x6D77, 0x6D77, 0x1E0E,
- 0x6D78, 0x6D78, 0x1CCB, 0x6D79, 0x6D79, 0x1E54, 0x6D7F, 0x6D7F, 0x1D53,
- 0x6D85, 0x6D85, 0x1762, 0x6D87, 0x6D87, 0x0E60, 0x6D88, 0x6D88, 0x1589,
- 0x6D89, 0x6D89, 0x1560, 0x6D8C, 0x6D8C, 0x1828, 0x6D8D, 0x6D8D, 0x1F18,
- 0x6D8E, 0x6D8E, 0x174F, 0x6D91, 0x6D91, 0x15A4, 0x6D93, 0x6D93, 0x1750,
- 0x6D95, 0x6D95, 0x1C27, 0x6DAF, 0x6DAF, 0x16D6, 0x6DB2, 0x6DB2, 0x16DE,
- 0x6DB5, 0x6DB5, 0x1DE9, 0x6DC0, 0x6DC0, 0x1A48, 0x6DC3, 0x6DC3, 0x0F89,
- 0x6DC4, 0x6DC4, 0x1CB0, 0x6DC5, 0x6DC5, 0x1523, 0x6DC6, 0x6DC6, 0x1F19,
- 0x6DC7, 0x6DC7, 0x0FFD, 0x6DCB, 0x6DCB, 0x1228, 0x6DCF, 0x6DCF, 0x1E86,
- 0x6DD1, 0x6DD1, 0x1601, 0x6DD8, 0x6DD8, 0x10C0, 0x6DD9, 0x6DD9, 0x1ABB,
- 0x6DDA, 0x6DDA, 0x11D8, 0x6DDE, 0x6DDE, 0x15B4, 0x6DE1, 0x6DE1, 0x107E,
- 0x6DE8, 0x6DE8, 0x1A49, 0x6DEA, 0x6DEA, 0x11F5, 0x6DEB, 0x6DEB, 0x18EE,
- 0x6DEE, 0x6DEE, 0x1F02, 0x6DF1, 0x6DF1, 0x1686, 0x6DF3, 0x6DF3, 0x1612,
- 0x6DF5, 0x6DF5, 0x1751, 0x6DF7, 0x6DF7, 0x1EA6, 0x6DF8, 0x6DF8, 0x1C1F,
- 0x6DF9, 0x6DF9, 0x172A, 0x6DFA, 0x6DFA, 0x1BF3, 0x6DFB, 0x6DFB, 0x1C0C,
- 0x6E17, 0x6E17, 0x14CB, 0x6E19, 0x6E19, 0x1ED4, 0x6E1A, 0x6E1A, 0x19CA,
- 0x6E1B, 0x6E1B, 0x0DC0, 0x6E1F, 0x6E1F, 0x1A4A, 0x6E20, 0x6E20, 0x0E09,
- 0x6E21, 0x6E21, 0x10C1, 0x6E23, 0x6E23, 0x149A, 0x6E24, 0x6E24, 0x1345,
- 0x6E25, 0x6E25, 0x16A9, 0x6E26, 0x6E26, 0x17D3, 0x6E2B, 0x6E2B, 0x154F,
- 0x6E2C, 0x6E2C, 0x1CA6, 0x6E2D, 0x6E2D, 0x1896, 0x6E2F, 0x6E2F, 0x1E00,
- 0x6E32, 0x6E32, 0x1533, 0x6E34, 0x6E34, 0x0DAF, 0x6E36, 0x6E36, 0x177B,
- 0x6E38, 0x6E38, 0x18BD, 0x6E3A, 0x6E3A, 0x12C7, 0x6E3C, 0x6E3C, 0x12FC,
- 0x6E3D, 0x6E3D, 0x19B2, 0x6E3E, 0x6E3E, 0x1EA7, 0x6E43, 0x6E43, 0x1370,
- 0x6E44, 0x6E44, 0x12FD, 0x6E4A, 0x6E4A, 0x1ADF, 0x6E4D, 0x6E4D, 0x106B,
- 0x6E56, 0x6E56, 0x1E87, 0x6E58, 0x6E58, 0x14E4, 0x6E5B, 0x6E5B, 0x107F,
- 0x6E5C, 0x6E5C, 0x165F, 0x6E5E, 0x6E5E, 0x1A4B, 0x6E5F, 0x6E5F, 0x1EEB,
- 0x6E67, 0x6E67, 0x1829, 0x6E6B, 0x6E6B, 0x1C67, 0x6E6E, 0x6E6E, 0x1935,
- 0x6E6F, 0x6E6F, 0x1D05, 0x6E72, 0x6E72, 0x187D, 0x6E73, 0x6E73, 0x1034,
- 0x6E7A, 0x6E7A, 0x13C9, 0x6E90, 0x6E90, 0x187E, 0x6E96, 0x6E96, 0x1AFF,
- 0x6E9C, 0x6E9C, 0x11E6, 0x6E9D, 0x6E9D, 0x0F50, 0x6E9F, 0x6E9F, 0x1292,
- 0x6EA2, 0x6EA2, 0x1941, 0x6EA5, 0x6EA5, 0x1408, 0x6EAA, 0x6EAA, 0x0E84,
- 0x6EAB, 0x6EAB, 0x17C3, 0x6EAF, 0x6EAF, 0x158A, 0x6EB1, 0x6EB1, 0x1B4F,
- 0x6EB6, 0x6EB6, 0x182A, 0x6EBA, 0x6EBA, 0x105D, 0x6EC2, 0x6EC2, 0x135B,
- 0x6EC4, 0x6EC4, 0x1BC1, 0x6EC5, 0x6EC5, 0x128A, 0x6EC9, 0x6EC9, 0x1EEC,
- 0x6ECB, 0x6ECB, 0x195D, 0x6ECC, 0x6ECC, 0x1BE6, 0x6ECE, 0x6ECE, 0x1E61,
- 0x6ED1, 0x6ED1, 0x1EDC, 0x6ED3, 0x6ED3, 0x19B3, 0x6ED4, 0x6ED4, 0x10C2,
- 0x6EEF, 0x6EEF, 0x1C28, 0x6EF4, 0x6EF4, 0x19E1, 0x6EF8, 0x6EF8, 0x1E88,
- 0x6EFE, 0x6EFE, 0x0EC4, 0x6EFF, 0x6EFF, 0x1247, 0x6F01, 0x6F01, 0x1711,
- 0x6F02, 0x6F02, 0x1D9E, 0x6F06, 0x6F06, 0x1CC6, 0x6F0F, 0x6F0F, 0x11D9,
- 0x6F11, 0x6F11, 0x0DF2, 0x6F14, 0x6F14, 0x1752, 0x6F15, 0x6F15, 0x1A8F,
- 0x6F20, 0x6F20, 0x123A, 0x6F22, 0x6F22, 0x1DD8, 0x6F23, 0x6F23, 0x1174,
- 0x6F2B, 0x6F2B, 0x1248, 0x6F2C, 0x6F2C, 0x1B2F, 0x6F31, 0x6F31, 0x15D5,
- 0x6F32, 0x6F32, 0x1BC2, 0x6F38, 0x6F38, 0x1A27, 0x6F3F, 0x6F3F, 0x1997,
- 0x6F41, 0x6F41, 0x177C, 0x6F51, 0x6F51, 0x1346, 0x6F54, 0x6F54, 0x0E42,
- 0x6F57, 0x6F57, 0x1B79, 0x6F58, 0x6F58, 0x1333, 0x6F5A, 0x6F5A, 0x1602,
- 0x6F5B, 0x6F5B, 0x1981, 0x6F5E, 0x6F5E, 0x11A3, 0x6F5F, 0x6F5F, 0x1524,
- 0x6F62, 0x6F62, 0x1EED, 0x6F64, 0x6F64, 0x18DA, 0x6F6D, 0x6F6D, 0x1080,
- 0x6F6E, 0x6F6E, 0x1A90, 0x6F70, 0x6F70, 0x0F92, 0x6F7A, 0x6F7A, 0x197D,
- 0x6F7C, 0x6F7C, 0x10F5, 0x6F7D, 0x6F7D, 0x13CA, 0x6F7E, 0x6F7E, 0x121F,
- 0x6F81, 0x6F81, 0x14D0, 0x6F84, 0x6F84, 0x1B80, 0x6F88, 0x6F88, 0x1C04,
- 0x6F8D, 0x6F8D, 0x1AE0, 0x6F8E, 0x6F8E, 0x1D5A, 0x6F90, 0x6F90, 0x1861,
- 0x6F94, 0x6F94, 0x1E89, 0x6F97, 0x6F97, 0x0DA0, 0x6FA3, 0x6FA3, 0x1DD9,
- 0x6FA4, 0x6FA4, 0x1D16, 0x6FA7, 0x6FA7, 0x119B, 0x6FAE, 0x6FAE, 0x1F03,
- 0x6FAF, 0x6FAF, 0x1B97, 0x6FB1, 0x6FB1, 0x1A05, 0x6FB3, 0x6FB3, 0x17B5,
- 0x6FB9, 0x6FB9, 0x1081, 0x6FBE, 0x6FBE, 0x1075, 0x6FC0, 0x6FC0, 0x0E31,
- 0x6FC1, 0x6FC1, 0x1CEA, 0x6FC2, 0x6FC2, 0x1186, 0x6FC3, 0x6FC3, 0x104F,
- 0x6FCA, 0x6FCA, 0x1793, 0x6FD5, 0x6FD5, 0x162D, 0x6FDA, 0x6FDA, 0x177D,
- 0x6FDF, 0x6FDF, 0x1A70, 0x6FE0, 0x6FE0, 0x1E8A, 0x6FE1, 0x6FE1, 0x18BE,
- 0x6FE4, 0x6FE4, 0x10C3, 0x6FE9, 0x6FE9, 0x1E8B, 0x6FEB, 0x6FEB, 0x1133,
- 0x6FEC, 0x6FEC, 0x1B00, 0x6FEF, 0x6FEF, 0x1CEB, 0x6FF1, 0x6FF1, 0x146E,
- 0x6FFE, 0x6FFE, 0x1161, 0x7001, 0x7001, 0x1702, 0x7005, 0x7005, 0x1E62,
- 0x7006, 0x7006, 0x10D6, 0x7009, 0x7009, 0x149B, 0x700B, 0x700B, 0x1687,
- 0x700F, 0x700F, 0x11E7, 0x7011, 0x7011, 0x1D96, 0x7015, 0x7015, 0x146F,
- 0x7018, 0x7018, 0x11A4, 0x701A, 0x701A, 0x1DDA, 0x701B, 0x701B, 0x177E,
- 0x701C, 0x701C, 0x18E2, 0x701D, 0x701D, 0x116D, 0x701E, 0x701E, 0x1A4C,
- 0x701F, 0x701F, 0x158B, 0x7023, 0x7023, 0x1E0F, 0x7027, 0x7027, 0x11BB,
- 0x7028, 0x7028, 0x11C0, 0x702F, 0x702F, 0x177F, 0x7037, 0x7037, 0x1925,
- 0x703E, 0x703E, 0x1129, 0x704C, 0x704C, 0x0EF1, 0x7050, 0x7050, 0x1E63,
- 0x7051, 0x7051, 0x15BA, 0x7058, 0x7058, 0x1CF6, 0x705D, 0x705D, 0x1E8C,
- 0x7063, 0x7063, 0x1249, 0x706B, 0x706B, 0x1EBB, 0x7070, 0x7070, 0x1F04,
- 0x7078, 0x7078, 0x0F51, 0x707C, 0x707C, 0x1972, 0x707D, 0x707D, 0x19B4,
- 0x7085, 0x7085, 0x0E61, 0x708A, 0x708A, 0x1C99, 0x708E, 0x708E, 0x1767,
- 0x7092, 0x7092, 0x1C38, 0x7098, 0x7098, 0x1F55, 0x7099, 0x7099, 0x195E,
- 0x709A, 0x709A, 0x0F06, 0x70A1, 0x70A1, 0x1A4D, 0x70A4, 0x70A4, 0x158C,
- 0x70AB, 0x70AB, 0x1E3C, 0x70AC, 0x70AC, 0x0E0A, 0x70AD, 0x70AD, 0x1CF7,
- 0x70AF, 0x70AF, 0x1E64, 0x70B3, 0x70B3, 0x13BA, 0x70B7, 0x70B7, 0x1AE1,
- 0x70B8, 0x70B8, 0x1973, 0x70B9, 0x70B9, 0x1A28, 0x70C8, 0x70C8, 0x1181,
- 0x70CB, 0x70CB, 0x1F47, 0x70CF, 0x70CF, 0x17B6, 0x70D8, 0x70D8, 0x1EB2,
- 0x70D9, 0x70D9, 0x111F, 0x70DD, 0x70DD, 0x1B17, 0x70DF, 0x70DF, 0x1753,
- 0x70F1, 0x70F1, 0x0E62, 0x70F9, 0x70F9, 0x1D5B, 0x70FD, 0x70FD, 0x13EC,
- 0x7104, 0x7104, 0x1F2F, 0x7109, 0x7109, 0x1720, 0x710C, 0x710C, 0x1B01,
- 0x7119, 0x7119, 0x1371, 0x711A, 0x711A, 0x142B, 0x711E, 0x711E, 0x10E5,
- 0x7121, 0x7121, 0x12D7, 0x7126, 0x7126, 0x1C39, 0x7130, 0x7130, 0x1768,
- 0x7136, 0x7136, 0x1754, 0x7147, 0x7147, 0x1F41, 0x7149, 0x7149, 0x1175,
- 0x714A, 0x714A, 0x1F38, 0x714C, 0x714C, 0x1EEE, 0x714E, 0x714E, 0x1A06,
- 0x7150, 0x7150, 0x1780, 0x7156, 0x7156, 0x102D, 0x7159, 0x7159, 0x1755,
- 0x715C, 0x715C, 0x185A, 0x715E, 0x715E, 0x14C6, 0x7164, 0x7164, 0x126C,
- 0x7165, 0x7165, 0x1ED5, 0x7166, 0x7166, 0x1F28, 0x7167, 0x7167, 0x1A91,
- 0x7169, 0x7169, 0x1386, 0x716C, 0x716C, 0x1703, 0x716E, 0x716E, 0x195F,
- 0x717D, 0x717D, 0x1534, 0x7184, 0x7184, 0x1660, 0x7189, 0x7189, 0x1862,
- 0x718A, 0x718A, 0x186D, 0x718F, 0x718F, 0x1F30, 0x7192, 0x7192, 0x1E65,
- 0x7194, 0x7194, 0x182B, 0x7199, 0x7199, 0x1F70, 0x719F, 0x719F, 0x1603,
- 0x71A2, 0x71A2, 0x13ED, 0x71AC, 0x71AC, 0x17B7, 0x71B1, 0x71B1, 0x1763,
- 0x71B9, 0x71BA, 0x1F71, 0x71BE, 0x71BE, 0x1CB1, 0x71C1, 0x71C1, 0x1770,
- 0x71C3, 0x71C3, 0x1756, 0x71C8, 0x71C8, 0x110F, 0x71C9, 0x71C9, 0x10E6,
- 0x71CE, 0x71CE, 0x11CC, 0x71D0, 0x71D0, 0x1220, 0x71D2, 0x71D2, 0x158D,
- 0x71D4, 0x71D4, 0x1387, 0x71D5, 0x71D5, 0x1757, 0x71DF, 0x71DF, 0x1781,
- 0x71E5, 0x71E5, 0x1A92, 0x71E6, 0x71E6, 0x1B98, 0x71E7, 0x71E7, 0x15D6,
- 0x71ED, 0x71ED, 0x1C4B, 0x71EE, 0x71EE, 0x1561, 0x71FB, 0x71FB, 0x1F31,
- 0x71FC, 0x71FC, 0x1670, 0x71FE, 0x71FE, 0x10C4, 0x71FF, 0x71FF, 0x180A,
- 0x7200, 0x7200, 0x1E33, 0x7206, 0x7206, 0x1D97, 0x7210, 0x7210, 0x11A5,
- 0x721B, 0x721B, 0x112A, 0x722A, 0x722A, 0x1A93, 0x722C, 0x722C, 0x1D3B,
- 0x722D, 0x722D, 0x19BB, 0x7230, 0x7230, 0x187F, 0x7232, 0x7232, 0x1897,
- 0x7235, 0x7235, 0x1974, 0x7236, 0x7236, 0x1409, 0x723A, 0x723A, 0x16ED,
- 0x723B, 0x723B, 0x1F1A, 0x723D, 0x723D, 0x14E5, 0x723E, 0x723E, 0x1916,
- 0x7240, 0x7240, 0x14E6, 0x7246, 0x7246, 0x1998, 0x7247, 0x7247, 0x1D61,
- 0x7248, 0x7248, 0x1D45, 0x724C, 0x724C, 0x1D54, 0x7252, 0x7252, 0x1C17,
- 0x7258, 0x7258, 0x10D7, 0x7259, 0x7259, 0x1696, 0x725B, 0x725B, 0x1842,
- 0x725D, 0x725D, 0x1470, 0x725F, 0x725F, 0x12A9, 0x7261, 0x7261, 0x12AA,
- 0x7262, 0x7262, 0x11C1, 0x7267, 0x7267, 0x12B6, 0x7269, 0x7269, 0x12F2,
- 0x7272, 0x7272, 0x14F9, 0x7279, 0x7279, 0x1D30, 0x727D, 0x727D, 0x0E36,
- 0x7280, 0x7280, 0x150C, 0x7281, 0x7281, 0x120F, 0x72A2, 0x72A2, 0x10D8,
- 0x72A7, 0x72A7, 0x1F73, 0x72AC, 0x72AC, 0x0E37, 0x72AF, 0x72AF, 0x1397,
- 0x72C0, 0x72C0, 0x14E7, 0x72C2, 0x72C2, 0x0F07, 0x72C4, 0x72C4, 0x19E2,
- 0x72CE, 0x72CE, 0x16C7, 0x72D0, 0x72D0, 0x1E8D, 0x72D7, 0x72D7, 0x0F52,
- 0x72D9, 0x72D9, 0x19CB, 0x72E1, 0x72E1, 0x0F27, 0x72E9, 0x72E9, 0x15D7,
- 0x72F8, 0x72F8, 0x1210, 0x72F9, 0x72F9, 0x1E55, 0x72FC, 0x72FC, 0x113F,
- 0x72FD, 0x72FD, 0x1D55, 0x730A, 0x730A, 0x1794, 0x7316, 0x7316, 0x1BC3,
- 0x731B, 0x731B, 0x1279, 0x731C, 0x731C, 0x164C, 0x731D, 0x731D, 0x1AB4,
- 0x7325, 0x7325, 0x17FA, 0x7329, 0x7329, 0x156A, 0x732A, 0x732A, 0x19CC,
- 0x732B, 0x732B, 0x12C8, 0x7336, 0x7337, 0x18BF, 0x733E, 0x733E, 0x1EDD,
- 0x733F, 0x733F, 0x1880, 0x7344, 0x7344, 0x17C0, 0x7345, 0x7345, 0x149C,
- 0x7350, 0x7350, 0x1999, 0x7352, 0x7352, 0x17B8, 0x7357, 0x7357, 0x0F8C,
- 0x7368, 0x7368, 0x10D9, 0x736A, 0x736A, 0x1F05, 0x7370, 0x7370, 0x1782,
- 0x7372, 0x7372, 0x1F0D, 0x7375, 0x7375, 0x1188, 0x7378, 0x7378, 0x15D8,
- 0x737A, 0x737A, 0x1076, 0x737B, 0x737B, 0x1E2D, 0x7384, 0x7384, 0x1E3D,
- 0x7386, 0x7386, 0x1960, 0x7387, 0x7387, 0x15B0, 0x7389, 0x7389, 0x17C1,
- 0x738B, 0x738B, 0x17F2, 0x738E, 0x738E, 0x1A4E, 0x7394, 0x7394, 0x1BF4,
- 0x7396, 0x7396, 0x0F53, 0x7397, 0x7397, 0x1843, 0x7398, 0x7398, 0x0FFE,
- 0x739F, 0x739F, 0x130F, 0x73A7, 0x73A7, 0x18DB, 0x73A9, 0x73A9, 0x17E1,
- 0x73AD, 0x73AD, 0x1471, 0x73B2, 0x73B2, 0x118F, 0x73B3, 0x73B3, 0x10A4,
- 0x73B9, 0x73B9, 0x1E3E, 0x73C0, 0x73C0, 0x131E, 0x73C2, 0x73C2, 0x0D7C,
- 0x73C9, 0x73C9, 0x1310, 0x73CA, 0x73CA, 0x14BC, 0x73CC, 0x73CC, 0x1DB8,
- 0x73CD, 0x73CD, 0x1B50, 0x73CF, 0x73CF, 0x0D8F, 0x73D6, 0x73D6, 0x0F08,
- 0x73D9, 0x73D9, 0x0ED5, 0x73DD, 0x73DD, 0x1F29, 0x73DE, 0x73DE, 0x1120,
- 0x73E0, 0x73E0, 0x1AE2, 0x73E3, 0x73E3, 0x1613, 0x73E4, 0x73E4, 0x13CB,
- 0x73E5, 0x73E5, 0x1917, 0x73E6, 0x73E6, 0x1E21, 0x73E9, 0x73E9, 0x1E66,
- 0x73EA, 0x73EA, 0x0F9F, 0x73ED, 0x73ED, 0x1334, 0x73F7, 0x73F7, 0x12D8,
- 0x73F9, 0x73F9, 0x156B, 0x73FD, 0x73FD, 0x1A4F, 0x73FE, 0x73FE, 0x1E3F,
- 0x7401, 0x7401, 0x1535, 0x7403, 0x7403, 0x0F54, 0x7405, 0x7405, 0x1140,
- 0x7406, 0x7406, 0x1211, 0x7407, 0x7407, 0x15D9, 0x7409, 0x7409, 0x11E8,
- 0x7413, 0x7413, 0x17E2, 0x741B, 0x741B, 0x1CCC, 0x7420, 0x7420, 0x1A07,
- 0x7421, 0x7421, 0x1604, 0x7422, 0x7422, 0x1CEC, 0x7425, 0x7425, 0x1E8E,
- 0x7426, 0x7426, 0x0FFF, 0x7428, 0x7428, 0x0EC5, 0x742A, 0x742A, 0x1000,
- 0x742B, 0x742B, 0x13EE, 0x742C, 0x742C, 0x17E3, 0x742E, 0x742E, 0x1ABC,
- 0x742F, 0x742F, 0x0EF2, 0x7430, 0x7430, 0x1769, 0x7433, 0x7433, 0x1229,
- 0x7434, 0x7434, 0x0FCB, 0x7435, 0x7435, 0x1451, 0x7436, 0x7436, 0x1D3C,
- 0x7438, 0x7438, 0x1CED, 0x743A, 0x743A, 0x139B, 0x743F, 0x743F, 0x1EA8,
- 0x7440, 0x7440, 0x1844, 0x7441, 0x7441, 0x12AB, 0x7443, 0x7443, 0x1C86,
- 0x7444, 0x7444, 0x1536, 0x744B, 0x744B, 0x1898, 0x7455, 0x7455, 0x1DC7,
- 0x7457, 0x7457, 0x1881, 0x7459, 0x7459, 0x104D, 0x745A, 0x745A, 0x1E8F,
- 0x745B, 0x745B, 0x1783, 0x745C, 0x745C, 0x18C1, 0x745E, 0x745E, 0x150D,
- 0x745F, 0x745F, 0x162A, 0x7460, 0x7460, 0x11E9, 0x7462, 0x7462, 0x182C,
- 0x7464, 0x7464, 0x180B, 0x7465, 0x7465, 0x17C4, 0x7468, 0x7468, 0x1B51,
- 0x7469, 0x7469, 0x1E67, 0x746A, 0x746A, 0x1231, 0x746F, 0x746F, 0x1141,
- 0x747E, 0x747E, 0x0FBE, 0x7482, 0x7482, 0x1001, 0x7483, 0x7483, 0x1212,
- 0x7487, 0x7487, 0x1537, 0x7489, 0x7489, 0x1176, 0x748B, 0x748B, 0x199A,
- 0x7498, 0x7498, 0x1221, 0x749C, 0x749C, 0x1EEF, 0x749E, 0x749E, 0x131F,
- 0x749F, 0x749F, 0x0E63, 0x74A1, 0x74A1, 0x1B52, 0x74A3, 0x74A3, 0x1002,
- 0x74A5, 0x74A5, 0x0E64, 0x74A7, 0x74A7, 0x13A1, 0x74A8, 0x74A8, 0x1B99,
- 0x74AA, 0x74AA, 0x1A94, 0x74B0, 0x74B0, 0x1ED6, 0x74B2, 0x74B2, 0x15DA,
- 0x74B5, 0x74B5, 0x1733, 0x74B9, 0x74B9, 0x1605, 0x74BD, 0x74BD, 0x14F3,
- 0x74BF, 0x74BF, 0x1538, 0x74C6, 0x74C6, 0x1B6D, 0x74CA, 0x74CA, 0x0E65,
- 0x74CF, 0x74CF, 0x11BC, 0x74D4, 0x74D4, 0x1784, 0x74D8, 0x74D8, 0x0EF3,
- 0x74DA, 0x74DA, 0x1B9A, 0x74DC, 0x74DC, 0x0EDE, 0x74E0, 0x74E0, 0x1E90,
- 0x74E2, 0x74E2, 0x1D9F, 0x74E3, 0x74E3, 0x1D46, 0x74E6, 0x74E6, 0x17D4,
- 0x74EE, 0x74EE, 0x17CC, 0x74F7, 0x74F7, 0x1961, 0x7501, 0x7501, 0x13BB,
- 0x7504, 0x7504, 0x0E38, 0x7511, 0x7511, 0x1B18, 0x7515, 0x7515, 0x17CD,
- 0x7518, 0x7518, 0x0DC1, 0x751A, 0x751A, 0x1688, 0x751B, 0x751B, 0x1C0D,
- 0x751F, 0x751F, 0x14FA, 0x7523, 0x7523, 0x14BD, 0x7525, 0x7525, 0x14FB,
- 0x7526, 0x7526, 0x158E, 0x7528, 0x7528, 0x182D, 0x752B, 0x752B, 0x13CC,
- 0x752C, 0x752C, 0x182E, 0x7530, 0x7530, 0x1A08, 0x7531, 0x7531, 0x18C2,
- 0x7532, 0x7532, 0x0DCC, 0x7533, 0x7533, 0x1671, 0x7537, 0x7537, 0x1035,
- 0x7538, 0x7538, 0x1A09, 0x753A, 0x753A, 0x1A50, 0x7547, 0x7547, 0x0FAB,
- 0x754C, 0x754C, 0x0E85, 0x754F, 0x754F, 0x17FB, 0x7551, 0x7551, 0x1A0A,
- 0x7553, 0x7553, 0x108B, 0x7554, 0x7554, 0x1335, 0x7559, 0x7559, 0x11EA,
- 0x755B, 0x755B, 0x1B53, 0x755C, 0x755C, 0x1C79, 0x755D, 0x755D, 0x12D9,
- 0x7562, 0x7562, 0x1DB9, 0x7565, 0x7565, 0x114A, 0x7566, 0x7566, 0x1F48,
- 0x756A, 0x756A, 0x1388, 0x756F, 0x756F, 0x1B02, 0x7570, 0x7570, 0x1918,
- 0x7575, 0x7575, 0x1EBC, 0x7576, 0x7576, 0x1096, 0x7578, 0x7578, 0x1003,
- 0x757A, 0x757A, 0x0DDA, 0x757F, 0x757F, 0x1004, 0x7586, 0x7586, 0x0DDB,
- 0x7587, 0x7587, 0x1AE3, 0x758A, 0x758A, 0x1C18, 0x758B, 0x758B, 0x1DBA,
- 0x758E, 0x758E, 0x1590, 0x758F, 0x758F, 0x158F, 0x7591, 0x7591, 0x1903,
- 0x759D, 0x759D, 0x14BE, 0x75A5, 0x75A5, 0x0DF3, 0x75AB, 0x75AB, 0x173F,
- 0x75B1, 0x75B1, 0x1D86, 0x75B2, 0x75B2, 0x1DAF, 0x75B3, 0x75B3, 0x0DC2,
- 0x75B5, 0x75B5, 0x1962, 0x75B8, 0x75B8, 0x1077, 0x75B9, 0x75B9, 0x1B54,
- 0x75BC, 0x75BC, 0x10F6, 0x75BD, 0x75BD, 0x19CD, 0x75BE, 0x75BE, 0x1B6E,
- 0x75C2, 0x75C2, 0x0D7D, 0x75C5, 0x75C5, 0x13BC, 0x75C7, 0x75C7, 0x1B19,
- 0x75CD, 0x75CD, 0x1919, 0x75D2, 0x75D2, 0x1704, 0x75D4, 0x75D4, 0x1CB2,
- 0x75D5, 0x75D5, 0x1F56, 0x75D8, 0x75D8, 0x1100, 0x75D9, 0x75D9, 0x0E66,
- 0x75DB, 0x75DB, 0x1D1F, 0x75E2, 0x75E2, 0x1213, 0x75F0, 0x75F0, 0x1082,
- 0x75F2, 0x75F2, 0x1232, 0x75F4, 0x75F4, 0x1CB3, 0x75FA, 0x75FA, 0x1452,
- 0x75FC, 0x75FC, 0x0EA2, 0x7600, 0x7600, 0x1712, 0x760D, 0x760D, 0x1705,
- 0x7619, 0x7619, 0x1591, 0x761F, 0x761F, 0x17C5, 0x7620, 0x7620, 0x1BE7,
- 0x7621, 0x7621, 0x1BC4, 0x7622, 0x7622, 0x1336, 0x7624, 0x7624, 0x11EB,
- 0x7626, 0x7626, 0x15DB, 0x763B, 0x763B, 0x11DA, 0x7642, 0x7642, 0x11CD,
- 0x764C, 0x764C, 0x16C2, 0x764E, 0x764E, 0x0DA1, 0x7652, 0x7652, 0x18C3,
- 0x7656, 0x7656, 0x13A2, 0x7661, 0x7661, 0x1CB4, 0x7664, 0x7664, 0x1A20,
- 0x7669, 0x7669, 0x1118, 0x766C, 0x766C, 0x1539, 0x7670, 0x7670, 0x17CE,
- 0x7672, 0x7672, 0x1A0B, 0x7678, 0x7678, 0x0E86, 0x767B, 0x767B, 0x1110,
- 0x767C, 0x767C, 0x1347, 0x767D, 0x767E, 0x1381, 0x7684, 0x7684, 0x19E3,
- 0x7686, 0x7686, 0x0DF4, 0x7687, 0x7687, 0x1EF0, 0x768E, 0x768E, 0x0F28,
- 0x7690, 0x7690, 0x0EA3, 0x7693, 0x7693, 0x1E91, 0x76AE, 0x76AE, 0x1DB0,
- 0x76BA, 0x76BA, 0x1C68, 0x76BF, 0x76BF, 0x1293, 0x76C2, 0x76C2, 0x1845,
- 0x76C3, 0x76C3, 0x1372, 0x76C6, 0x76C6, 0x142C, 0x76C8, 0x76C8, 0x1785,
- 0x76CA, 0x76CA, 0x1926, 0x76D2, 0x76D2, 0x1DF1, 0x76D6, 0x76D6, 0x0DF5,
- 0x76DB, 0x76DB, 0x156C, 0x76DC, 0x76DC, 0x10C5, 0x76DE, 0x76DE, 0x197E,
- 0x76DF, 0x76DF, 0x127B, 0x76E1, 0x76E1, 0x1B55, 0x76E3, 0x76E3, 0x0DC3,
- 0x76E4, 0x76E4, 0x1337, 0x76E7, 0x76E7, 0x11A6, 0x76EE, 0x76EE, 0x12B7,
- 0x76F2, 0x76F2, 0x127A, 0x76F4, 0x76F4, 0x1B3F, 0x76F8, 0x76F8, 0x14E8,
- 0x76FC, 0x76FC, 0x1338, 0x76FE, 0x76FE, 0x1614, 0x7701, 0x7701, 0x156D,
- 0x7704, 0x7704, 0x1284, 0x7708, 0x7708, 0x1CFD, 0x7709, 0x7709, 0x12FE,
- 0x770B, 0x770B, 0x0DA2, 0x771E, 0x771E, 0x1B56, 0x7720, 0x7720, 0x1285,
- 0x7729, 0x7729, 0x1E40, 0x7737, 0x7737, 0x0F8A, 0x7738, 0x7738, 0x12AC,
- 0x773A, 0x773A, 0x1A95, 0x773C, 0x773C, 0x16B4, 0x7740, 0x7740, 0x1B91,
- 0x774D, 0x774D, 0x1E41, 0x775B, 0x775B, 0x1A51, 0x7761, 0x7761, 0x15DC,
- 0x7763, 0x7763, 0x10DA, 0x7766, 0x7766, 0x12B8, 0x776B, 0x776B, 0x1C19,
- 0x7779, 0x7779, 0x10C6, 0x777E, 0x777E, 0x0EA4, 0x777F, 0x777F, 0x1795,
- 0x778B, 0x778B, 0x1B57, 0x7791, 0x7791, 0x1294, 0x779E, 0x779E, 0x124A,
- 0x77A5, 0x77A5, 0x13AE, 0x77AC, 0x77AC, 0x1615, 0x77AD, 0x77AD, 0x11CE,
- 0x77B0, 0x77B0, 0x0DC4, 0x77B3, 0x77B3, 0x10F7, 0x77BB, 0x77BB, 0x1C0E,
- 0x77BC, 0x77BC, 0x0E25, 0x77BF, 0x77BF, 0x0F55, 0x77D7, 0x77D7, 0x1C4C,
- 0x77DB, 0x77DB, 0x12AD, 0x77DC, 0x77DC, 0x0FDC, 0x77E2, 0x77E2, 0x164D,
- 0x77E3, 0x77E3, 0x1904, 0x77E5, 0x77E5, 0x1B30, 0x77E9, 0x77E9, 0x0F56,
- 0x77ED, 0x77ED, 0x106C, 0x77EE, 0x77EE, 0x17F6, 0x77EF, 0x77EF, 0x0F29,
- 0x77F3, 0x77F3, 0x1525, 0x7802, 0x7802, 0x149D, 0x7812, 0x7812, 0x1453,
- 0x7825, 0x7825, 0x1B31, 0x7826, 0x7826, 0x1BD0, 0x7827, 0x7827, 0x1CCD,
- 0x782C, 0x782C, 0x122C, 0x7832, 0x7832, 0x1D87, 0x7834, 0x7834, 0x1D3D,
- 0x7845, 0x7845, 0x0FA0, 0x784F, 0x784F, 0x1758, 0x785D, 0x785D, 0x1C3A,
- 0x786B, 0x786B, 0x11EC, 0x786C, 0x786C, 0x0E67, 0x786F, 0x786F, 0x1759,
- 0x787C, 0x787C, 0x143A, 0x7881, 0x7881, 0x1005, 0x7887, 0x7887, 0x1A52,
- 0x788C, 0x788C, 0x11B0, 0x788D, 0x788D, 0x16D7, 0x788E, 0x788E, 0x15BB,
- 0x7891, 0x7891, 0x1454, 0x7897, 0x7897, 0x17E4, 0x78A3, 0x78A3, 0x0DB0,
- 0x78A7, 0x78A7, 0x13A3, 0x78A9, 0x78A9, 0x1526, 0x78BA, 0x78BB, 0x1EC7,
- 0x78BC, 0x78BC, 0x1233, 0x78C1, 0x78C1, 0x1963, 0x78C5, 0x78C5, 0x135C,
- 0x78CA, 0x78CA, 0x11C2, 0x78CB, 0x78CB, 0x1B8A, 0x78CE, 0x78CE, 0x0E87,
- 0x78D0, 0x78D0, 0x1339, 0x78E8, 0x78E8, 0x1234, 0x78EC, 0x78EC, 0x0E68,
- 0x78EF, 0x78EF, 0x1006, 0x78F5, 0x78F5, 0x0DA3, 0x78FB, 0x78FB, 0x133A,
- 0x7901, 0x7901, 0x1C3B, 0x790E, 0x790E, 0x1C3C, 0x7916, 0x7916, 0x1734,
- 0x792A, 0x792A, 0x1162, 0x792B, 0x792B, 0x116E, 0x792C, 0x792C, 0x133B,
- 0x793A, 0x793A, 0x164E, 0x793E, 0x793E, 0x149E, 0x7940, 0x7940, 0x149F,
- 0x7941, 0x7941, 0x1007, 0x7947, 0x7948, 0x1008, 0x7949, 0x7949, 0x1B32,
- 0x7950, 0x7950, 0x1846, 0x7956, 0x7956, 0x1A96, 0x7957, 0x7957, 0x1B33,
- 0x795A, 0x795A, 0x1A97, 0x795B, 0x795B, 0x0E0B, 0x795C, 0x795C, 0x1E92,
- 0x795D, 0x795D, 0x1C7A, 0x795E, 0x795E, 0x1672, 0x7960, 0x7960, 0x14A0,
- 0x7965, 0x7965, 0x14E9, 0x7968, 0x7968, 0x1DA0, 0x796D, 0x796D, 0x1A71,
- 0x797A, 0x797A, 0x100A, 0x797F, 0x797F, 0x11B1, 0x7981, 0x7981, 0x0FCC,
- 0x798D, 0x798D, 0x1EBD, 0x798E, 0x798E, 0x1A53, 0x798F, 0x798F, 0x13D9,
- 0x7991, 0x7991, 0x1847, 0x79A6, 0x79A6, 0x1713, 0x79A7, 0x79A7, 0x1F74,
- 0x79AA, 0x79AA, 0x153A, 0x79AE, 0x79AE, 0x119C, 0x79B1, 0x79B1, 0x10C7,
- 0x79B3, 0x79B3, 0x1706, 0x79B9, 0x79B9, 0x1848, 0x79BD, 0x79BD, 0x0FCD,
- 0x79BE, 0x79BE, 0x1EBE, 0x79BF, 0x79BF, 0x10DB, 0x79C0, 0x79C0, 0x15DD,
- 0x79C1, 0x79C1, 0x14A1, 0x79C9, 0x79C9, 0x13BD, 0x79CA, 0x79CA, 0x1042,
- 0x79CB, 0x79CB, 0x1C69, 0x79D1, 0x79D1, 0x0EDF, 0x79D2, 0x79D2, 0x1C3D,
- 0x79D5, 0x79D5, 0x1455, 0x79D8, 0x79D8, 0x1456, 0x79DF, 0x79DF, 0x1A98,
- 0x79E4, 0x79E4, 0x1CD1, 0x79E6, 0x79E6, 0x1B58, 0x79E7, 0x79E7, 0x16CE,
- 0x79E9, 0x79E9, 0x1B6F, 0x79FB, 0x79FB, 0x191A, 0x7A00, 0x7A00, 0x1F75,
- 0x7A05, 0x7A05, 0x1578, 0x7A08, 0x7A08, 0x0DA4, 0x7A0B, 0x7A0B, 0x1A54,
- 0x7A0D, 0x7A0D, 0x1C3E, 0x7A14, 0x7A14, 0x194A, 0x7A17, 0x7A17, 0x1D56,
- 0x7A19, 0x7A19, 0x1B40, 0x7A1A, 0x7A1A, 0x1CB5, 0x7A1C, 0x7A1C, 0x1201,
- 0x7A1F, 0x7A1F, 0x1DA7, 0x7A20, 0x7A20, 0x1A99, 0x7A2E, 0x7A2E, 0x1ABD,
- 0x7A31, 0x7A31, 0x1CD2, 0x7A36, 0x7A36, 0x185B, 0x7A37, 0x7A37, 0x1B41,
- 0x7A3B, 0x7A3B, 0x10C8, 0x7A3C, 0x7A3C, 0x0D7E, 0x7A3D, 0x7A3D, 0x0E88,
- 0x7A3F, 0x7A3F, 0x0EA5, 0x7A40, 0x7A40, 0x0EBB, 0x7A46, 0x7A46, 0x12B9,
- 0x7A49, 0x7A49, 0x1CB6, 0x7A4D, 0x7A4D, 0x19E4, 0x7A4E, 0x7A4E, 0x1786,
- 0x7A57, 0x7A57, 0x15DE, 0x7A61, 0x7A61, 0x14F6, 0x7A62, 0x7A62, 0x1796,
- 0x7A69, 0x7A69, 0x17C6, 0x7A6B, 0x7A6B, 0x1EC9, 0x7A70, 0x7A70, 0x1707,
- 0x7A74, 0x7A74, 0x1E4B, 0x7A76, 0x7A76, 0x0F57, 0x7A79, 0x7A79, 0x0F7D,
- 0x7A7A, 0x7A7A, 0x0ED6, 0x7A7D, 0x7A7D, 0x1A55, 0x7A7F, 0x7A7F, 0x1BF5,
- 0x7A81, 0x7A81, 0x10EA, 0x7A84, 0x7A84, 0x1B92, 0x7A88, 0x7A88, 0x180C,
- 0x7A92, 0x7A92, 0x1B70, 0x7A93, 0x7A93, 0x1BC5, 0x7A95, 0x7A95, 0x1A9A,
- 0x7A98, 0x7A98, 0x0F72, 0x7A9F, 0x7A9F, 0x0F7A, 0x7AA9, 0x7AAA, 0x17D5,
- 0x7AAE, 0x7AAE, 0x0F7E, 0x7AAF, 0x7AAF, 0x180D, 0x7ABA, 0x7ABA, 0x0FA1,
- 0x7AC4, 0x7AC4, 0x1B9B, 0x7AC5, 0x7AC5, 0x0FA2, 0x7AC7, 0x7AC7, 0x1101,
- 0x7ACA, 0x7ACA, 0x1A21, 0x7ACB, 0x7ACB, 0x122D, 0x7AD7, 0x7AD7, 0x12C9,
- 0x7AD9, 0x7AD9, 0x1BB1, 0x7ADD, 0x7ADD, 0x13BE, 0x7ADF, 0x7ADF, 0x0E69,
- 0x7AE0, 0x7AE0, 0x199B, 0x7AE3, 0x7AE3, 0x1B03, 0x7AE5, 0x7AE5, 0x10F8,
- 0x7AEA, 0x7AEA, 0x15DF, 0x7AED, 0x7AED, 0x0DB1, 0x7AEF, 0x7AEF, 0x106D,
- 0x7AF6, 0x7AF6, 0x0E6A, 0x7AF9, 0x7AF9, 0x1AF4, 0x7AFA, 0x7AFA, 0x1C7B,
- 0x7AFF, 0x7AFF, 0x0DA5, 0x7B0F, 0x7B0F, 0x1EAC, 0x7B11, 0x7B11, 0x1592,
- 0x7B19, 0x7B19, 0x14FC, 0x7B1B, 0x7B1B, 0x19E5, 0x7B1E, 0x7B1E, 0x1D0F,
- 0x7B20, 0x7B20, 0x122E, 0x7B26, 0x7B26, 0x140A, 0x7B2C, 0x7B2C, 0x1A72,
- 0x7B2D, 0x7B2D, 0x1190, 0x7B39, 0x7B39, 0x1579, 0x7B46, 0x7B46, 0x1DBB,
- 0x7B49, 0x7B49, 0x1111, 0x7B4B, 0x7B4B, 0x0FBF, 0x7B4C, 0x7B4C, 0x1A0C,
- 0x7B4D, 0x7B4D, 0x1616, 0x7B4F, 0x7B4F, 0x138E, 0x7B50, 0x7B50, 0x0F09,
- 0x7B51, 0x7B51, 0x1C7C, 0x7B52, 0x7B52, 0x1D20, 0x7B54, 0x7B54, 0x108C,
- 0x7B56, 0x7B56, 0x1BD8, 0x7B60, 0x7B60, 0x0FAC, 0x7B6C, 0x7B6C, 0x156E,
- 0x7B6E, 0x7B6E, 0x150E, 0x7B75, 0x7B75, 0x175A, 0x7B7D, 0x7B7D, 0x17B9,
- 0x7B87, 0x7B87, 0x0DF6, 0x7B8B, 0x7B8B, 0x1A0D, 0x7B8F, 0x7B8F, 0x19BC,
- 0x7B94, 0x7B94, 0x1320, 0x7B95, 0x7B95, 0x100B, 0x7B97, 0x7B97, 0x14BF,
- 0x7B9A, 0x7B9A, 0x1B8B, 0x7B9D, 0x7B9D, 0x0E48, 0x7BA1, 0x7BA1, 0x0EF4,
- 0x7BAD, 0x7BAD, 0x1A0E, 0x7BB1, 0x7BB1, 0x14EA, 0x7BB4, 0x7BB4, 0x1982,
- 0x7BB8, 0x7BB8, 0x19CE, 0x7BC0, 0x7BC0, 0x1A22, 0x7BC1, 0x7BC1, 0x1EF1,
- 0x7BC4, 0x7BC4, 0x1398, 0x7BC6, 0x7BC6, 0x1A0F, 0x7BC7, 0x7BC7, 0x1D62,
- 0x7BC9, 0x7BC9, 0x1C7D, 0x7BD2, 0x7BD2, 0x1661, 0x7BE0, 0x7BE0, 0x1593,
- 0x7BE4, 0x7BE4, 0x10DC, 0x7BE9, 0x7BE9, 0x14A2, 0x7C07, 0x7C07, 0x1AAD,
- 0x7C12, 0x7C12, 0x1B9C, 0x7C1E, 0x7C1E, 0x106E, 0x7C21, 0x7C21, 0x0DA6,
- 0x7C27, 0x7C27, 0x1EF2, 0x7C2A, 0x7C2A, 0x1983, 0x7C2B, 0x7C2B, 0x1594,
- 0x7C3D, 0x7C3D, 0x1C0F, 0x7C3E, 0x7C3E, 0x1187, 0x7C3F, 0x7C3F, 0x140B,
- 0x7C43, 0x7C43, 0x1134, 0x7C4C, 0x7C4C, 0x1AE4, 0x7C4D, 0x7C4D, 0x19E6,
- 0x7C60, 0x7C60, 0x11BD, 0x7C64, 0x7C64, 0x1C10, 0x7C6C, 0x7C6C, 0x1214,
- 0x7C73, 0x7C73, 0x12FF, 0x7C83, 0x7C83, 0x1457, 0x7C89, 0x7C89, 0x142D,
- 0x7C92, 0x7C92, 0x122F, 0x7C95, 0x7C95, 0x1321, 0x7C97, 0x7C97, 0x1A9B,
- 0x7C98, 0x7C98, 0x1A29, 0x7C9F, 0x7C9F, 0x15A5, 0x7CA5, 0x7CA5, 0x1AF5,
- 0x7CA7, 0x7CA7, 0x199C, 0x7CAE, 0x7CAE, 0x1151, 0x7CB1, 0x7CB1, 0x1152,
- 0x7CB2, 0x7CB2, 0x1B9E, 0x7CB3, 0x7CB3, 0x0DFE, 0x7CB9, 0x7CB9, 0x15E0,
- 0x7CBE, 0x7CBE, 0x1A56, 0x7CCA, 0x7CCA, 0x1E93, 0x7CD6, 0x7CD6, 0x1097,
- 0x7CDE, 0x7CDE, 0x142E, 0x7CDF, 0x7CDF, 0x1A9C, 0x7CE0, 0x7CE0, 0x0DDC,
- 0x7CE7, 0x7CE7, 0x1153, 0x7CFB, 0x7CFB, 0x0E89, 0x7CFE, 0x7CFE, 0x0FA3,
- 0x7D00, 0x7D00, 0x100C, 0x7D02, 0x7D02, 0x1AE5, 0x7D04, 0x7D04, 0x16F1,
- 0x7D05, 0x7D05, 0x1EB3, 0x7D06, 0x7D06, 0x1849, 0x7D07, 0x7D07, 0x1F59,
- 0x7D08, 0x7D08, 0x1ED7, 0x7D0A, 0x7D0B, 0x12EA, 0x7D0D, 0x7D0D, 0x1036,
- 0x7D10, 0x7D10, 0x1058, 0x7D14, 0x7D14, 0x1617, 0x7D17, 0x7D17, 0x14A3,
- 0x7D18, 0x7D18, 0x0F19, 0x7D19, 0x7D19, 0x1B34, 0x7D1A, 0x7D1A, 0x0FD8,
- 0x7D1B, 0x7D1B, 0x142F, 0x7D20, 0x7D20, 0x1595, 0x7D21, 0x7D21, 0x135D,
- 0x7D22, 0x7D22, 0x14F7, 0x7D2B, 0x7D2B, 0x1964, 0x7D2C, 0x7D2C, 0x1AE6,
- 0x7D2E, 0x7D2E, 0x1BA9, 0x7D2F, 0x7D2F, 0x11DB, 0x7D30, 0x7D30, 0x157A,
- 0x7D33, 0x7D33, 0x1673, 0x7D35, 0x7D35, 0x19CF, 0x7D39, 0x7D39, 0x1596,
- 0x7D3A, 0x7D3A, 0x0DC5, 0x7D42, 0x7D42, 0x1ABE, 0x7D43, 0x7D43, 0x1E42,
- 0x7D44, 0x7D44, 0x1A9D, 0x7D45, 0x7D45, 0x0E6B, 0x7D46, 0x7D46, 0x133C,
- 0x7D50, 0x7D50, 0x0E43, 0x7D5E, 0x7D5E, 0x0F2A, 0x7D61, 0x7D61, 0x1121,
- 0x7D62, 0x7D62, 0x1E43, 0x7D66, 0x7D66, 0x0FD9, 0x7D68, 0x7D68, 0x18E3,
- 0x7D6A, 0x7D6A, 0x1936, 0x7D6E, 0x7D6E, 0x150F, 0x7D71, 0x7D71, 0x1D21,
- 0x7D72, 0x7D72, 0x14A4, 0x7D73, 0x7D73, 0x0DDD, 0x7D76, 0x7D76, 0x1A23,
- 0x7D79, 0x7D79, 0x0E39, 0x7D7F, 0x7D7F, 0x0F58, 0x7D8E, 0x7D8E, 0x1A57,
- 0x7D8F, 0x7D8F, 0x15E1, 0x7D93, 0x7D93, 0x0E6C, 0x7D9C, 0x7D9C, 0x1ABF,
- 0x7DA0, 0x7DA0, 0x11B2, 0x7DA2, 0x7DA2, 0x1AE7, 0x7DAC, 0x7DAC, 0x15E2,
- 0x7DAD, 0x7DAD, 0x18C4, 0x7DB1, 0x7DB1, 0x0DDE, 0x7DB2, 0x7DB2, 0x125D,
- 0x7DB4, 0x7DB4, 0x1C05, 0x7DB5, 0x7DB5, 0x1BD1, 0x7DB8, 0x7DB8, 0x11F6,
- 0x7DBA, 0x7DBA, 0x100D, 0x7DBB, 0x7DBB, 0x1CF8, 0x7DBD, 0x7DBD, 0x1975,
- 0x7DBE, 0x7DBE, 0x1202, 0x7DBF, 0x7DBF, 0x1286, 0x7DC7, 0x7DC7, 0x1CB7,
- 0x7DCA, 0x7DCA, 0x101E, 0x7DCB, 0x7DCB, 0x1458, 0x7DD6, 0x7DD6, 0x1510,
- 0x7DD8, 0x7DD8, 0x1DEA, 0x7DDA, 0x7DDA, 0x153B, 0x7DDD, 0x7DDD, 0x1B7A,
- 0x7DDE, 0x7DDE, 0x106F, 0x7DE0, 0x7DE0, 0x1C29, 0x7DE1, 0x7DE1, 0x1311,
- 0x7DE3, 0x7DE3, 0x175B, 0x7DE8, 0x7DE8, 0x1D63, 0x7DE9, 0x7DE9, 0x17E5,
- 0x7DEC, 0x7DEC, 0x1287, 0x7DEF, 0x7DEF, 0x1899, 0x7DF4, 0x7DF4, 0x1177,
- 0x7DFB, 0x7DFB, 0x1CB8, 0x7E09, 0x7E09, 0x1B59, 0x7E0A, 0x7E0A, 0x16DF,
- 0x7E15, 0x7E15, 0x17C7, 0x7E1B, 0x7E1B, 0x1322, 0x7E1D, 0x7E1D, 0x1B5A,
- 0x7E1E, 0x7E1E, 0x1E94, 0x7E1F, 0x7E1F, 0x181B, 0x7E21, 0x7E21, 0x19B5,
- 0x7E23, 0x7E23, 0x1E44, 0x7E2B, 0x7E2B, 0x13EF, 0x7E2E, 0x7E2E, 0x1C7E,
- 0x7E2F, 0x7E2F, 0x175C, 0x7E31, 0x7E31, 0x1AC0, 0x7E37, 0x7E37, 0x11DC,
- 0x7E3D, 0x7E3D, 0x1C59, 0x7E3E, 0x7E3E, 0x19E7, 0x7E41, 0x7E41, 0x1389,
- 0x7E43, 0x7E43, 0x143B, 0x7E46, 0x7E46, 0x12DA, 0x7E47, 0x7E47, 0x180E,
- 0x7E52, 0x7E52, 0x1B1A, 0x7E54, 0x7E54, 0x1B42, 0x7E55, 0x7E55, 0x153C,
- 0x7E5E, 0x7E5E, 0x180F, 0x7E61, 0x7E61, 0x15E3, 0x7E69, 0x7E69, 0x1639,
- 0x7E6A, 0x7E6A, 0x1F06, 0x7E6B, 0x7E6B, 0x0E8A, 0x7E6D, 0x7E6D, 0x0E3A,
- 0x7E70, 0x7E70, 0x1A9E, 0x7E79, 0x7E79, 0x1740, 0x7E7C, 0x7E7C, 0x0E8B,
- 0x7E82, 0x7E82, 0x1B9D, 0x7E8C, 0x7E8C, 0x15A6, 0x7E8F, 0x7E8F, 0x1A10,
- 0x7E93, 0x7E93, 0x1787, 0x7E96, 0x7E96, 0x155A, 0x7E98, 0x7E98, 0x1B9F,
- 0x7E9B, 0x7E9B, 0x10DD, 0x7E9C, 0x7E9C, 0x1135, 0x7F36, 0x7F36, 0x140C,
- 0x7F38, 0x7F38, 0x1E01, 0x7F3A, 0x7F3A, 0x0E44, 0x7F4C, 0x7F4C, 0x16E3,
- 0x7F50, 0x7F50, 0x0EF5, 0x7F54, 0x7F54, 0x125E, 0x7F55, 0x7F55, 0x1DDB,
- 0x7F6A, 0x7F6A, 0x1ACB, 0x7F6B, 0x7F6B, 0x0F0E, 0x7F6E, 0x7F6E, 0x1CB9,
- 0x7F70, 0x7F70, 0x138F, 0x7F72, 0x7F72, 0x1511, 0x7F75, 0x7F75, 0x126D,
- 0x7F77, 0x7F77, 0x1D3E, 0x7F79, 0x7F79, 0x1215, 0x7F85, 0x7F85, 0x1119,
- 0x7F88, 0x7F88, 0x100E, 0x7F8A, 0x7F8A, 0x1708, 0x7F8C, 0x7F8C, 0x0DDF,
- 0x7F8E, 0x7F8E, 0x1300, 0x7F94, 0x7F94, 0x0EA6, 0x7F9A, 0x7F9A, 0x1191,
- 0x7F9E, 0x7F9E, 0x15E4, 0x7FA4, 0x7FA4, 0x0F73, 0x7FA8, 0x7FA8, 0x153D,
- 0x7FA9, 0x7FA9, 0x1905, 0x7FB2, 0x7FB2, 0x1F76, 0x7FB8, 0x7FB8, 0x1216,
- 0x7FB9, 0x7FB9, 0x0DFF, 0x7FBD, 0x7FBD, 0x184A, 0x7FC1, 0x7FC1, 0x17CF,
- 0x7FC5, 0x7FC5, 0x164F, 0x7FCA, 0x7FCA, 0x1927, 0x7FCC, 0x7FCC, 0x1928,
- 0x7FCE, 0x7FCE, 0x1192, 0x7FD2, 0x7FD2, 0x162F, 0x7FD4, 0x7FD4, 0x14EB,
- 0x7FD5, 0x7FD5, 0x1F61, 0x7FDF, 0x7FDF, 0x19E8, 0x7FE0, 0x7FE0, 0x1C9A,
- 0x7FE1, 0x7FE1, 0x1459, 0x7FE9, 0x7FE9, 0x1D64, 0x7FEB, 0x7FEB, 0x17E6,
- 0x7FF0, 0x7FF0, 0x1DDC, 0x7FF9, 0x7FF9, 0x0F2B, 0x7FFC, 0x7FFC, 0x1929,
- 0x8000, 0x8000, 0x1810, 0x8001, 0x8001, 0x11A7, 0x8003, 0x8003, 0x0EA7,
- 0x8005, 0x8005, 0x1965, 0x8006, 0x8006, 0x100F, 0x8009, 0x8009, 0x0F59,
- 0x800C, 0x800C, 0x191B, 0x8010, 0x8010, 0x103E, 0x8015, 0x8015, 0x0E6D,
- 0x8017, 0x8017, 0x12AE, 0x8018, 0x8018, 0x1863, 0x802D, 0x802D, 0x1010,
- 0x8033, 0x8033, 0x191C, 0x8036, 0x8036, 0x16EE, 0x803D, 0x803D, 0x1CFE,
- 0x803F, 0x803F, 0x0E6E, 0x8043, 0x8043, 0x1083, 0x8046, 0x8046, 0x1193,
- 0x804A, 0x804A, 0x11CF, 0x8056, 0x8056, 0x156F, 0x8058, 0x8058, 0x1477,
- 0x805A, 0x805A, 0x1C9B, 0x805E, 0x805E, 0x12EC, 0x806F, 0x806F, 0x1178,
- 0x8070, 0x8070, 0x1C5A, 0x8072, 0x8072, 0x1570, 0x8073, 0x8073, 0x182F,
- 0x8077, 0x8077, 0x1B43, 0x807D, 0x807D, 0x1C20, 0x807E, 0x807E, 0x11BE,
- 0x807F, 0x807F, 0x18E0, 0x8084, 0x8084, 0x191D, 0x8085, 0x8085, 0x1606,
- 0x8086, 0x8086, 0x14A5, 0x8087, 0x8087, 0x1A9F, 0x8089, 0x8089, 0x18D5,
- 0x808B, 0x808B, 0x11FD, 0x808C, 0x808C, 0x1011, 0x8096, 0x8096, 0x1C3F,
- 0x809B, 0x809B, 0x1E02, 0x809D, 0x809D, 0x0DA7, 0x80A1, 0x80A1, 0x0EA8,
- 0x80A2, 0x80A2, 0x1B35, 0x80A5, 0x80A5, 0x145A, 0x80A9, 0x80A9, 0x0E3B,
- 0x80AA, 0x80AA, 0x135E, 0x80AF, 0x80AF, 0x0FDD, 0x80B1, 0x80B1, 0x0F1A,
- 0x80B2, 0x80B2, 0x18D6, 0x80B4, 0x80B4, 0x1F1B, 0x80BA, 0x80BA, 0x1D74,
- 0x80C3, 0x80C3, 0x189A, 0x80C4, 0x80C4, 0x1AD1, 0x80CC, 0x80CC, 0x1373,
- 0x80CE, 0x80CE, 0x1D10, 0x80DA, 0x80DA, 0x1374, 0x80DB, 0x80DB, 0x0DCD,
- 0x80DE, 0x80DE, 0x1D88, 0x80E1, 0x80E1, 0x1E95, 0x80E4, 0x80E4, 0x18DC,
- 0x80E5, 0x80E5, 0x1512, 0x80F1, 0x80F1, 0x0F0A, 0x80F4, 0x80F4, 0x10F9,
- 0x80F8, 0x80F8, 0x1F51, 0x80FD, 0x80FD, 0x1059, 0x8102, 0x8102, 0x1B36,
- 0x8105, 0x8105, 0x1E56, 0x8106, 0x8106, 0x1C9C, 0x8107, 0x8107, 0x1E57,
- 0x8108, 0x8108, 0x1272, 0x810A, 0x810A, 0x1BE8, 0x8118, 0x8118, 0x17E7,
- 0x811A, 0x811A, 0x0D90, 0x811B, 0x811B, 0x0E6F, 0x8123, 0x8123, 0x1618,
- 0x8129, 0x8129, 0x15E5, 0x812B, 0x812B, 0x1CFB, 0x812F, 0x812F, 0x1D89,
- 0x8139, 0x8139, 0x1BC6, 0x813E, 0x813E, 0x145B, 0x814B, 0x814B, 0x16E0,
- 0x814E, 0x814E, 0x1674, 0x8150, 0x8151, 0x140D, 0x8154, 0x8154, 0x0DE0,
- 0x8155, 0x8155, 0x17E8, 0x8165, 0x8165, 0x1571, 0x8166, 0x8166, 0x1053,
- 0x816B, 0x816B, 0x1AC1, 0x8170, 0x8170, 0x1811, 0x8171, 0x8171, 0x0E18,
- 0x8178, 0x8178, 0x199D, 0x8179, 0x8179, 0x13DA, 0x817A, 0x817A, 0x153E,
- 0x817F, 0x817F, 0x1D25, 0x8180, 0x8180, 0x135F, 0x8188, 0x8188, 0x0E32,
- 0x818A, 0x818A, 0x1323, 0x818F, 0x818F, 0x0EA9, 0x819A, 0x819A, 0x140F,
- 0x819C, 0x819C, 0x123B, 0x819D, 0x819D, 0x162B, 0x81A0, 0x81A0, 0x0F2C,
- 0x81A3, 0x81A3, 0x1B71, 0x81A8, 0x81A8, 0x1D5C, 0x81B3, 0x81B3, 0x153F,
- 0x81B5, 0x81B5, 0x1C91, 0x81BA, 0x81BA, 0x18F8, 0x81BD, 0x81BD, 0x1084,
- 0x81BE, 0x81BE, 0x1F07, 0x81BF, 0x81BF, 0x1050, 0x81C0, 0x81C0, 0x1107,
- 0x81C2, 0x81C2, 0x145C, 0x81C6, 0x81C6, 0x171C, 0x81CD, 0x81CD, 0x1A73,
- 0x81D8, 0x81D8, 0x113A, 0x81DF, 0x81DF, 0x199E, 0x81E3, 0x81E3, 0x1675,
- 0x81E5, 0x81E5, 0x17D7, 0x81E7, 0x81E7, 0x199F, 0x81E8, 0x81E8, 0x122A,
- 0x81EA, 0x81EA, 0x1966, 0x81ED, 0x81ED, 0x1C9D, 0x81F3, 0x81F3, 0x1B37,
- 0x81F4, 0x81F4, 0x1CBA, 0x81FA, 0x81FA, 0x10A5, 0x81FB, 0x81FB, 0x1B5B,
- 0x81FC, 0x81FC, 0x0F5A, 0x81FE, 0x81FE, 0x18C5, 0x8205, 0x8205, 0x0F5B,
- 0x8207, 0x8207, 0x1735, 0x8208, 0x8208, 0x1F62, 0x820A, 0x820A, 0x0F5C,
- 0x820C, 0x820C, 0x1550, 0x820D, 0x820D, 0x14A6, 0x8212, 0x8212, 0x1513,
- 0x821B, 0x821B, 0x1BF6, 0x821C, 0x821C, 0x1619, 0x821E, 0x821E, 0x12DB,
- 0x821F, 0x821F, 0x1AE8, 0x8221, 0x8221, 0x0DE1, 0x822A, 0x822A, 0x1E03,
- 0x822B, 0x822B, 0x1360, 0x822C, 0x822C, 0x133D, 0x8235, 0x8235, 0x1CDE,
- 0x8236, 0x8236, 0x1324, 0x8237, 0x8237, 0x1E45, 0x8239, 0x8239, 0x1540,
- 0x8240, 0x8240, 0x1410, 0x8245, 0x8245, 0x1736, 0x8247, 0x8247, 0x1A58,
- 0x8259, 0x8259, 0x1BC7, 0x8264, 0x8264, 0x1906, 0x8266, 0x8266, 0x1DEB,
- 0x826E, 0x826E, 0x0DA8, 0x826F, 0x826F, 0x1154, 0x8271, 0x8271, 0x0DA9,
- 0x8272, 0x8272, 0x14F8, 0x8276, 0x8276, 0x176A, 0x8278, 0x8278, 0x1C40,
- 0x827E, 0x827E, 0x16D8, 0x828B, 0x828B, 0x184B, 0x828D, 0x828D, 0x1976,
- 0x828E, 0x828E, 0x0F7F, 0x8292, 0x8292, 0x125F, 0x8299, 0x8299, 0x1411,
- 0x829A, 0x829A, 0x1108, 0x829D, 0x829D, 0x1B38, 0x829F, 0x829F, 0x14CC,
- 0x82A5, 0x82A5, 0x0DF7, 0x82A6, 0x82A6, 0x1E96, 0x82A9, 0x82A9, 0x0FCE,
- 0x82AC, 0x82AC, 0x1430, 0x82AD, 0x82AD, 0x1D3F, 0x82AE, 0x82AE, 0x1797,
- 0x82AF, 0x82AF, 0x1689, 0x82B1, 0x82B1, 0x1EBF, 0x82B3, 0x82B3, 0x1361,
- 0x82B7, 0x82B7, 0x1B39, 0x82B8, 0x82B8, 0x1864, 0x82B9, 0x82B9, 0x0FC0,
- 0x82BB, 0x82BB, 0x1C6A, 0x82BC, 0x82BC, 0x12AF, 0x82BD, 0x82BD, 0x1697,
- 0x82BF, 0x82BF, 0x1952, 0x82D1, 0x82D1, 0x1882, 0x82D2, 0x82D2, 0x176B,
- 0x82D4, 0x82D4, 0x1D11, 0x82D5, 0x82D5, 0x1C41, 0x82D7, 0x82D7, 0x12CA,
- 0x82DB, 0x82DB, 0x0D7F, 0x82DE, 0x82DE, 0x1D8A, 0x82DF, 0x82DF, 0x0F5D,
- 0x82E1, 0x82E1, 0x191E, 0x82E5, 0x82E5, 0x16F2, 0x82E6, 0x82E6, 0x0EAA,
- 0x82E7, 0x82E7, 0x19D0, 0x82F1, 0x82F1, 0x1788, 0x82FD, 0x82FD, 0x0EAB,
- 0x82FE, 0x82FE, 0x1DBC, 0x8301, 0x8301, 0x1B09, 0x8302, 0x8302, 0x12DC,
- 0x8303, 0x8303, 0x1399, 0x8304, 0x8304, 0x0D80, 0x8305, 0x8305, 0x12B0,
- 0x8309, 0x8309, 0x1255, 0x8317, 0x8317, 0x1295, 0x8328, 0x8328, 0x1967,
- 0x832B, 0x832B, 0x1260, 0x832F, 0x832F, 0x13DB, 0x8331, 0x8331, 0x15E6,
- 0x8334, 0x8334, 0x1F08, 0x8335, 0x8335, 0x1937, 0x8336, 0x8336, 0x105F,
- 0x8338, 0x8338, 0x1830, 0x8339, 0x8339, 0x1737, 0x8340, 0x8340, 0x161A,
- 0x8347, 0x8347, 0x1E1C, 0x8349, 0x8349, 0x1C42, 0x834A, 0x834A, 0x1E68,
- 0x834F, 0x834F, 0x194B, 0x8351, 0x8351, 0x191F, 0x8352, 0x8352, 0x1EF3,
- 0x8373, 0x8373, 0x1102, 0x8377, 0x8377, 0x1DC8, 0x837B, 0x837B, 0x19E9,
- 0x8389, 0x8389, 0x1217, 0x838A, 0x838A, 0x19A0, 0x838E, 0x838E, 0x14A7,
- 0x8396, 0x8396, 0x0E70, 0x8398, 0x8398, 0x1676, 0x839E, 0x839E, 0x17E9,
- 0x83A2, 0x83A2, 0x1E58, 0x83A9, 0x83A9, 0x1412, 0x83AA, 0x83AA, 0x1698,
- 0x83AB, 0x83AB, 0x123C, 0x83BD, 0x83BD, 0x1261, 0x83C1, 0x83C1, 0x1C21,
- 0x83C5, 0x83C5, 0x0EF6, 0x83C9, 0x83C9, 0x11B3, 0x83CA, 0x83CA, 0x0F6D,
- 0x83CC, 0x83CC, 0x0FAD, 0x83D3, 0x83D3, 0x0EE0, 0x83D6, 0x83D6, 0x1BC8,
- 0x83DC, 0x83DC, 0x1BD2, 0x83E9, 0x83E9, 0x13CD, 0x83EB, 0x83EB, 0x0FC1,
- 0x83EF, 0x83EF, 0x1EC0, 0x83F0, 0x83F0, 0x0EAC, 0x83F1, 0x83F1, 0x1203,
- 0x83F2, 0x83F2, 0x145D, 0x83F4, 0x83F4, 0x16C3, 0x83F9, 0x83F9, 0x19D1,
- 0x83FD, 0x83FD, 0x1607, 0x8403, 0x8403, 0x1C92, 0x8404, 0x8404, 0x10C9,
- 0x840A, 0x840A, 0x1147, 0x840C, 0x840C, 0x127C, 0x840D, 0x840D, 0x1D6C,
- 0x840E, 0x840E, 0x189B, 0x8429, 0x8429, 0x1C6B, 0x842C, 0x842C, 0x124B,
- 0x8431, 0x8431, 0x1F39, 0x8438, 0x8438, 0x18C6, 0x843D, 0x843D, 0x1122,
- 0x8449, 0x8449, 0x1771, 0x8457, 0x8457, 0x19D2, 0x845B, 0x845B, 0x0DB2,
- 0x8461, 0x8461, 0x1D8B, 0x8463, 0x8463, 0x10FA, 0x8466, 0x8466, 0x189C,
- 0x846B, 0x846B, 0x1E97, 0x846C, 0x846C, 0x19A1, 0x846F, 0x846F, 0x16F3,
- 0x8475, 0x8475, 0x0FA4, 0x847A, 0x847A, 0x1B12, 0x8490, 0x8490, 0x15E7,
- 0x8494, 0x8494, 0x1650, 0x8499, 0x8499, 0x12BF, 0x849C, 0x849C, 0x14C0,
- 0x84A1, 0x84A1, 0x1362, 0x84B2, 0x84B2, 0x1D8C, 0x84B8, 0x84B8, 0x1B1B,
- 0x84BB, 0x84BB, 0x16F4, 0x84BC, 0x84BC, 0x1BC9, 0x84BF, 0x84BF, 0x1E98,
- 0x84C0, 0x84C0, 0x15AD, 0x84C2, 0x84C2, 0x1296, 0x84C4, 0x84C4, 0x1C7F,
- 0x84C6, 0x84C6, 0x1527, 0x84C9, 0x84C9, 0x1831, 0x84CB, 0x84CB, 0x0DF8,
- 0x84CD, 0x84CD, 0x1651, 0x84D1, 0x84D1, 0x14A8, 0x84DA, 0x84DA, 0x15E8,
- 0x84EC, 0x84EC, 0x13F0, 0x84EE, 0x84EE, 0x1179, 0x84F4, 0x84F4, 0x161B,
- 0x84FC, 0x84FC, 0x11D0, 0x8511, 0x8511, 0x128B, 0x8513, 0x8513, 0x124C,
- 0x8514, 0x8514, 0x13DC, 0x8517, 0x8517, 0x1968, 0x8518, 0x8518, 0x14CD,
- 0x851A, 0x851A, 0x186A, 0x851E, 0x851E, 0x11DD, 0x8521, 0x8521, 0x1BD3,
- 0x8523, 0x8523, 0x19A2, 0x8525, 0x8525, 0x1C5B, 0x852C, 0x852C, 0x1597,
- 0x852D, 0x852D, 0x18EF, 0x852F, 0x852F, 0x1B5C, 0x853D, 0x853D, 0x1D75,
- 0x853F, 0x853F, 0x189D, 0x8541, 0x8541, 0x1085, 0x8543, 0x8543, 0x138A,
- 0x8549, 0x8549, 0x1C43, 0x854E, 0x854E, 0x0F2D, 0x8553, 0x8553, 0x1865,
- 0x8559, 0x8559, 0x1E74, 0x8563, 0x8563, 0x161C, 0x8568, 0x8568, 0x0F8D,
- 0x8569, 0x8569, 0x1D06, 0x856A, 0x856A, 0x12DD, 0x856D, 0x856D, 0x1598,
- 0x8584, 0x8584, 0x1325, 0x8587, 0x8587, 0x1301, 0x858F, 0x858F, 0x1907,
- 0x8591, 0x8591, 0x0DE2, 0x8594, 0x8594, 0x19A3, 0x859B, 0x859B, 0x1551,
- 0x85A6, 0x85A6, 0x1BF7, 0x85A8, 0x85A8, 0x1F35, 0x85A9, 0x85A9, 0x14C7,
- 0x85AA, 0x85AA, 0x1677, 0x85AF, 0x85AF, 0x1514, 0x85B0, 0x85B0, 0x1F32,
- 0x85BA, 0x85BA, 0x1A74, 0x85C1, 0x85C1, 0x0EAD, 0x85C9, 0x85C9, 0x1969,
- 0x85CD, 0x85CD, 0x1136, 0x85CE, 0x85CE, 0x1678, 0x85CF, 0x85CF, 0x19A4,
- 0x85D5, 0x85D5, 0x184C, 0x85DC, 0x85DC, 0x1163, 0x85DD, 0x85DD, 0x1798,
- 0x85E4, 0x85E4, 0x1112, 0x85E5, 0x85E5, 0x16F5, 0x85E9, 0x85E9, 0x138B,
- 0x85EA, 0x85EA, 0x15E9, 0x85F7, 0x85F7, 0x19D3, 0x85FA, 0x85FA, 0x1222,
- 0x85FB, 0x85FB, 0x1AA0, 0x85FF, 0x85FF, 0x0EE9, 0x8602, 0x8602, 0x1799,
- 0x8606, 0x8606, 0x11A8, 0x8607, 0x8607, 0x1599, 0x860A, 0x860A, 0x17C8,
- 0x8616, 0x8616, 0x1724, 0x8617, 0x8617, 0x13A4, 0x861A, 0x861A, 0x1541,
- 0x862D, 0x862D, 0x112B, 0x863F, 0x863F, 0x111A, 0x864E, 0x864E, 0x1E99,
- 0x8650, 0x8650, 0x1DD0, 0x8654, 0x8654, 0x0E19, 0x8655, 0x8655, 0x1BDD,
- 0x865B, 0x865B, 0x1E29, 0x865C, 0x865C, 0x11A9, 0x865E, 0x865E, 0x184D,
- 0x865F, 0x865F, 0x1E9A, 0x8667, 0x8667, 0x1F49, 0x8679, 0x8679, 0x1EB4,
- 0x868A, 0x868A, 0x12ED, 0x868C, 0x868C, 0x1363, 0x8693, 0x8693, 0x1938,
- 0x86A3, 0x86A3, 0x0ED7, 0x86A4, 0x86A4, 0x1AA1, 0x86A9, 0x86A9, 0x1CBB,
- 0x86C7, 0x86C7, 0x14A9, 0x86CB, 0x86CB, 0x1070, 0x86D4, 0x86D4, 0x1F09,
- 0x86D9, 0x86D9, 0x17D8, 0x86DB, 0x86DB, 0x1AE9, 0x86DF, 0x86DF, 0x0F2E,
- 0x86E4, 0x86E4, 0x1DF2, 0x86ED, 0x86ED, 0x1B72, 0x86FE, 0x86FE, 0x1699,
- 0x8700, 0x8700, 0x1C4D, 0x8702, 0x8702, 0x13F1, 0x8703, 0x8703, 0x1679,
- 0x8708, 0x8708, 0x17BA, 0x8718, 0x8718, 0x1B3A, 0x871A, 0x871A, 0x145E,
- 0x871C, 0x871C, 0x1314, 0x874E, 0x874E, 0x0DB4, 0x8755, 0x8755, 0x1662,
- 0x8757, 0x8757, 0x1EF4, 0x875F, 0x875F, 0x189E, 0x8766, 0x8766, 0x1DC9,
- 0x8768, 0x8768, 0x162C, 0x8774, 0x8774, 0x1E9B, 0x8776, 0x8776, 0x1A2F,
- 0x8778, 0x8778, 0x17D9, 0x8782, 0x8782, 0x1142, 0x878D, 0x878D, 0x18E4,
- 0x879F, 0x879F, 0x1297, 0x87A2, 0x87A2, 0x1E69, 0x87B3, 0x87B3, 0x1098,
- 0x87BA, 0x87BA, 0x111B, 0x87C4, 0x87C4, 0x1CD0, 0x87E0, 0x87E0, 0x133E,
- 0x87EC, 0x87EC, 0x1542, 0x87EF, 0x87EF, 0x1812, 0x87F2, 0x87F2, 0x1C8D,
- 0x87F9, 0x87F9, 0x1E10, 0x87FB, 0x87FB, 0x1908, 0x87FE, 0x87FE, 0x155B,
- 0x8805, 0x8805, 0x163A, 0x881F, 0x881F, 0x113B, 0x8822, 0x8822, 0x1B04,
- 0x8823, 0x8823, 0x1164, 0x8831, 0x8831, 0x0EAE, 0x8836, 0x8836, 0x1984,
- 0x883B, 0x883B, 0x124D, 0x8840, 0x8840, 0x1E4C, 0x8846, 0x8846, 0x1B0C,
- 0x884C, 0x884C, 0x1E1D, 0x884D, 0x884D, 0x175D, 0x8852, 0x8852, 0x1E46,
- 0x8853, 0x8853, 0x1624, 0x8857, 0x8857, 0x0D81, 0x8859, 0x8859, 0x169A,
- 0x885B, 0x885B, 0x189F, 0x885D, 0x885D, 0x1C8E, 0x8861, 0x8861, 0x1E6A,
- 0x8862, 0x8862, 0x0F5E, 0x8863, 0x8863, 0x1909, 0x8868, 0x8868, 0x1DA1,
- 0x886B, 0x886B, 0x14CE, 0x8870, 0x8870, 0x15BD, 0x8872, 0x8872, 0x1037,
- 0x8877, 0x8877, 0x1C8F, 0x887E, 0x887F, 0x0FCF, 0x8881, 0x8881, 0x1883,
- 0x8882, 0x8882, 0x129B, 0x8888, 0x8888, 0x0D82, 0x888B, 0x888B, 0x10A6,
- 0x888D, 0x888D, 0x1D8D, 0x8892, 0x8892, 0x1071, 0x8896, 0x8896, 0x15EA,
- 0x8897, 0x8897, 0x1B5D, 0x889E, 0x889E, 0x0EC6, 0x88AB, 0x88AB, 0x1DB1,
- 0x88B4, 0x88B4, 0x0EAF, 0x88C1, 0x88C1, 0x19B6, 0x88C2, 0x88C2, 0x1182,
- 0x88CF, 0x88CF, 0x1218, 0x88D4, 0x88D4, 0x179A, 0x88D5, 0x88D5, 0x18C7,
- 0x88D9, 0x88D9, 0x0F74, 0x88DC, 0x88DC, 0x13CE, 0x88DD, 0x88DD, 0x19A5,
- 0x88DF, 0x88DF, 0x14AA, 0x88E1, 0x88E1, 0x1219, 0x88E8, 0x88E8, 0x145F,
- 0x88F3, 0x88F3, 0x14EC, 0x88F4, 0x88F5, 0x1375, 0x88F8, 0x88F8, 0x111C,
- 0x88FD, 0x88FD, 0x1A75, 0x8907, 0x8907, 0x13DD, 0x8910, 0x8910, 0x0DB3,
- 0x8912, 0x8912, 0x1D8E, 0x8913, 0x8913, 0x13CF, 0x8918, 0x8918, 0x18A0,
- 0x8919, 0x8919, 0x1377, 0x8925, 0x8925, 0x181C, 0x892A, 0x892A, 0x1D26,
- 0x8936, 0x8936, 0x1630, 0x8938, 0x8938, 0x11DE, 0x893B, 0x893B, 0x1552,
- 0x8941, 0x8941, 0x0DE3, 0x8944, 0x8944, 0x1709, 0x895F, 0x895F, 0x0FD1,
- 0x8964, 0x8964, 0x1137, 0x896A, 0x896A, 0x1256, 0x8972, 0x8972, 0x1631,
- 0x897F, 0x897F, 0x1515, 0x8981, 0x8981, 0x1813, 0x8983, 0x8983, 0x1086,
- 0x8986, 0x8986, 0x13DE, 0x8987, 0x8987, 0x1D57, 0x898B, 0x898B, 0x0E3C,
- 0x898F, 0x898F, 0x0FA5, 0x8993, 0x8993, 0x127E, 0x8996, 0x8996, 0x1652,
- 0x89A1, 0x89A1, 0x0E33, 0x89A9, 0x89A9, 0x10CA, 0x89AA, 0x89AA, 0x1CC3,
- 0x89B2, 0x89B2, 0x0FC2, 0x89BA, 0x89BA, 0x0D91, 0x89BD, 0x89BD, 0x1138,
- 0x89C0, 0x89C0, 0x0EF7, 0x89D2, 0x89D2, 0x0D92, 0x89E3, 0x89E3, 0x1E11,
- 0x89F4, 0x89F4, 0x14ED, 0x89F8, 0x89F8, 0x1C4E, 0x8A00, 0x8A00, 0x1721,
- 0x8A02, 0x8A02, 0x1A59, 0x8A03, 0x8A03, 0x1413, 0x8A08, 0x8A08, 0x0E8C,
- 0x8A0A, 0x8A0A, 0x167A, 0x8A0C, 0x8A0C, 0x1EB5, 0x8A0E, 0x8A0E, 0x1D1C,
- 0x8A13, 0x8A13, 0x1F33, 0x8A16, 0x8A16, 0x1F5A, 0x8A17, 0x8A17, 0x1CEE,
- 0x8A18, 0x8A18, 0x1012, 0x8A1B, 0x8A1B, 0x17DA, 0x8A1D, 0x8A1D, 0x169B,
- 0x8A1F, 0x8A1F, 0x15B5, 0x8A23, 0x8A23, 0x0E45, 0x8A25, 0x8A25, 0x1056,
- 0x8A2A, 0x8A2A, 0x1364, 0x8A2D, 0x8A2D, 0x1553, 0x8A31, 0x8A31, 0x1E2A,
- 0x8A34, 0x8A34, 0x159A, 0x8A36, 0x8A36, 0x0D83, 0x8A3A, 0x8A3A, 0x1B5E,
- 0x8A3B, 0x8A3B, 0x1AEA, 0x8A50, 0x8A50, 0x14AB, 0x8A54, 0x8A54, 0x1AA2,
- 0x8A55, 0x8A55, 0x1D6D, 0x8A5B, 0x8A5B, 0x19D4, 0x8A5E, 0x8A5E, 0x14AC,
- 0x8A60, 0x8A60, 0x1789, 0x8A62, 0x8A62, 0x161D, 0x8A63, 0x8A63, 0x179B,
- 0x8A66, 0x8A66, 0x1653, 0x8A69, 0x8A69, 0x1654, 0x8A6D, 0x8A6D, 0x0F93,
- 0x8A6E, 0x8A6E, 0x1A11, 0x8A70, 0x8A70, 0x1F77, 0x8A71, 0x8A71, 0x1EC1,
- 0x8A72, 0x8A72, 0x1E12, 0x8A73, 0x8A73, 0x14EE, 0x8A75, 0x8A75, 0x1543,
- 0x8A79, 0x8A79, 0x1C11, 0x8A85, 0x8A85, 0x1AEB, 0x8A87, 0x8A87, 0x0EE1,
- 0x8A8C, 0x8A8C, 0x1B3B, 0x8A8D, 0x8A8D, 0x1939, 0x8A93, 0x8A93, 0x1516,
- 0x8A95, 0x8A95, 0x1CF9, 0x8A98, 0x8A98, 0x18C8, 0x8A9E, 0x8A9E, 0x1714,
- 0x8AA0, 0x8AA0, 0x1572, 0x8AA1, 0x8AA1, 0x0E8D, 0x8AA3, 0x8AA3, 0x12DE,
- 0x8AA4, 0x8AA4, 0x17BB, 0x8AA5, 0x8AA5, 0x0EB0, 0x8AA6, 0x8AA6, 0x15B6,
- 0x8AA8, 0x8AA8, 0x1F0A, 0x8AAA, 0x8AAA, 0x1554, 0x8AB0, 0x8AB0, 0x15EB,
- 0x8AB2, 0x8AB2, 0x0EE2, 0x8AB9, 0x8AB9, 0x1460, 0x8ABC, 0x8ABC, 0x190A,
- 0x8ABE, 0x8ABE, 0x18E9, 0x8ABF, 0x8ABF, 0x1AA3, 0x8AC2, 0x8AC2, 0x1C12,
- 0x8AC4, 0x8AC4, 0x161E, 0x8AC7, 0x8AC7, 0x1087, 0x8ACB, 0x8ACB, 0x1C22,
- 0x8ACD, 0x8ACD, 0x19BD, 0x8ACF, 0x8ACF, 0x1C6C, 0x8AD2, 0x8AD2, 0x1155,
- 0x8AD6, 0x8AD6, 0x11B7, 0x8ADB, 0x8ADB, 0x18C9, 0x8ADC, 0x8ADC, 0x1C1A,
- 0x8AE1, 0x8AE1, 0x1655, 0x8AE6, 0x8AE6, 0x1C2A, 0x8AE7, 0x8AE7, 0x1E13,
- 0x8AEA, 0x8AEA, 0x1A5A, 0x8AEB, 0x8AEB, 0x0DAA, 0x8AED, 0x8AED, 0x18CA,
- 0x8AEE, 0x8AEE, 0x196A, 0x8AF1, 0x8AF1, 0x1F42, 0x8AF6, 0x8AF6, 0x168A,
- 0x8AF7, 0x8AF7, 0x1DA9, 0x8AF8, 0x8AF8, 0x1A76, 0x8AFA, 0x8AFA, 0x1722,
- 0x8AFE, 0x8AFE, 0x102B, 0x8B00, 0x8B00, 0x12B1, 0x8B01, 0x8B01, 0x16BA,
- 0x8B02, 0x8B02, 0x18A1, 0x8B04, 0x8B04, 0x1113, 0x8B0E, 0x8B0E, 0x1302,
- 0x8B10, 0x8B10, 0x1315, 0x8B14, 0x8B14, 0x1DD1, 0x8B16, 0x8B16, 0x15A7,
- 0x8B17, 0x8B17, 0x1365, 0x8B19, 0x8B19, 0x0E49, 0x8B1A, 0x8B1A, 0x192A,
- 0x8B1B, 0x8B1B, 0x0DE4, 0x8B1D, 0x8B1D, 0x14AD, 0x8B20, 0x8B20, 0x1814,
- 0x8B28, 0x8B28, 0x12B2, 0x8B2B, 0x8B2B, 0x19EA, 0x8B2C, 0x8B2C, 0x11ED,
- 0x8B33, 0x8B33, 0x0F5F, 0x8B39, 0x8B39, 0x0FC3, 0x8B41, 0x8B41, 0x1EC2,
- 0x8B49, 0x8B49, 0x1B1C, 0x8B4E, 0x8B4E, 0x1F4B, 0x8B4F, 0x8B4F, 0x1013,
- 0x8B58, 0x8B58, 0x1663, 0x8B5A, 0x8B5A, 0x1088, 0x8B5C, 0x8B5C, 0x13D0,
- 0x8B66, 0x8B66, 0x0E71, 0x8B6C, 0x8B6C, 0x1461, 0x8B6F, 0x8B6F, 0x1741,
- 0x8B70, 0x8B70, 0x190B, 0x8B74, 0x8B74, 0x0E3D, 0x8B77, 0x8B77, 0x1E9C,
- 0x8B7D, 0x8B7D, 0x179C, 0x8B80, 0x8B80, 0x10DE, 0x8B8A, 0x8B8A, 0x13A9,
- 0x8B90, 0x8B90, 0x15EC, 0x8B92, 0x8B92, 0x1BB2, 0x8B93, 0x8B93, 0x170A,
- 0x8B96, 0x8B96, 0x1BB3, 0x8B9A, 0x8B9A, 0x1BA0, 0x8C37, 0x8C37, 0x0EBC,
- 0x8C3F, 0x8C3F, 0x0E8E, 0x8C41, 0x8C41, 0x1EDE, 0x8C46, 0x8C46, 0x1103,
- 0x8C48, 0x8C48, 0x1014, 0x8C4A, 0x8C4A, 0x1DAA, 0x8C4C, 0x8C4C, 0x17EA,
- 0x8C55, 0x8C55, 0x1656, 0x8C5A, 0x8C5A, 0x10E7, 0x8C61, 0x8C61, 0x14EF,
- 0x8C6A, 0x8C6A, 0x1E9D, 0x8C6B, 0x8C6B, 0x179D, 0x8C79, 0x8C79, 0x1DA2,
- 0x8C7A, 0x8C7A, 0x1657, 0x8C82, 0x8C82, 0x1C44, 0x8C8A, 0x8C8A, 0x1273,
- 0x8C8C, 0x8C8C, 0x12B3, 0x8C9D, 0x8C9D, 0x1D58, 0x8C9E, 0x8C9E, 0x1A5B,
- 0x8CA0, 0x8CA0, 0x1414, 0x8CA1, 0x8CA1, 0x19B7, 0x8CA2, 0x8CA2, 0x0ED8,
- 0x8CA7, 0x8CA7, 0x1472, 0x8CA8, 0x8CA8, 0x1EC3, 0x8CA9, 0x8CA9, 0x1D47,
- 0x8CAA, 0x8CAA, 0x1CFF, 0x8CAB, 0x8CAB, 0x0EF8, 0x8CAC, 0x8CAC, 0x1BD9,
- 0x8CAF, 0x8CAF, 0x19D5, 0x8CB0, 0x8CB0, 0x157B, 0x8CB3, 0x8CB3, 0x1921,
- 0x8CB4, 0x8CB4, 0x0F98, 0x8CB6, 0x8CB6, 0x1D68, 0x8CB7, 0x8CB7, 0x126E,
- 0x8CB8, 0x8CB8, 0x10A7, 0x8CBB, 0x8CBB, 0x1462, 0x8CBC, 0x8CBC, 0x1C1B,
- 0x8CBD, 0x8CBD, 0x1920, 0x8CBF, 0x8CBF, 0x12DF, 0x8CC0, 0x8CC0, 0x1DCA,
- 0x8CC1, 0x8CC1, 0x1431, 0x8CC2, 0x8CC2, 0x11C3, 0x8CC3, 0x8CC3, 0x194C,
- 0x8CC4, 0x8CC4, 0x1F0B, 0x8CC7, 0x8CC7, 0x196B, 0x8CC8, 0x8CC8, 0x0D84,
- 0x8CCA, 0x8CCA, 0x19EB, 0x8CD1, 0x8CD1, 0x1B5F, 0x8CD3, 0x8CD3, 0x1473,
- 0x8CDA, 0x8CDA, 0x11C4, 0x8CDC, 0x8CDC, 0x14AE, 0x8CDE, 0x8CDE, 0x14F0,
- 0x8CE0, 0x8CE0, 0x1378, 0x8CE2, 0x8CE2, 0x1E47, 0x8CE3, 0x8CE3, 0x126F,
- 0x8CE4, 0x8CE4, 0x1BF8, 0x8CE6, 0x8CE6, 0x1415, 0x8CEA, 0x8CEA, 0x1B73,
- 0x8CED, 0x8CED, 0x10CB, 0x8CF4, 0x8CF4, 0x11C5, 0x8CFB, 0x8CFB, 0x1416,
- 0x8CFC, 0x8CFC, 0x0F60, 0x8CFD, 0x8CFD, 0x14F4, 0x8D04, 0x8D04, 0x1B3C,
- 0x8D05, 0x8D05, 0x1C93, 0x8D07, 0x8D07, 0x18DD, 0x8D08, 0x8D08, 0x1B1D,
- 0x8D0A, 0x8D0A, 0x1BA1, 0x8D0D, 0x8D0D, 0x155C, 0x8D13, 0x8D13, 0x19A6,
- 0x8D16, 0x8D16, 0x15A8, 0x8D64, 0x8D64, 0x19EC, 0x8D66, 0x8D66, 0x14AF,
- 0x8D6B, 0x8D6B, 0x1E34, 0x8D70, 0x8D70, 0x1AEC, 0x8D73, 0x8D73, 0x0FA6,
- 0x8D74, 0x8D74, 0x1417, 0x8D77, 0x8D77, 0x1015, 0x8D85, 0x8D85, 0x1C45,
- 0x8D8A, 0x8D8A, 0x188A, 0x8D99, 0x8D99, 0x1AA4, 0x8DA3, 0x8DA3, 0x1C9E,
- 0x8DA8, 0x8DA8, 0x1C6D, 0x8DB3, 0x8DB3, 0x1AAE, 0x8DBA, 0x8DBA, 0x1418,
- 0x8DBE, 0x8DBE, 0x1B3D, 0x8DC6, 0x8DC6, 0x1D12, 0x8DCB, 0x8DCB, 0x1348,
- 0x8DCC, 0x8DCC, 0x1B74, 0x8DCF, 0x8DCF, 0x0D85, 0x8DDB, 0x8DDB, 0x1D40,
- 0x8DDD, 0x8DDD, 0x0E0C, 0x8DE1, 0x8DE1, 0x19ED, 0x8DE3, 0x8DE3, 0x1544,
- 0x8DE8, 0x8DE8, 0x0EE3, 0x8DEF, 0x8DEF, 0x11AA, 0x8DF3, 0x8DF3, 0x10CC,
- 0x8E0A, 0x8E0A, 0x1832, 0x8E0F, 0x8E0F, 0x108D, 0x8E10, 0x8E10, 0x1BF9,
- 0x8E1E, 0x8E1E, 0x0E0D, 0x8E2A, 0x8E2A, 0x1AC2, 0x8E30, 0x8E30, 0x18CB,
- 0x8E35, 0x8E35, 0x1AC3, 0x8E42, 0x8E42, 0x18CC, 0x8E44, 0x8E44, 0x1A77,
- 0x8E47, 0x8E47, 0x0E1A, 0x8E48, 0x8E48, 0x10CD, 0x8E49, 0x8E49, 0x1B8C,
- 0x8E4A, 0x8E4A, 0x1E75, 0x8E59, 0x8E59, 0x1C80, 0x8E5F, 0x8E5F, 0x19EE,
- 0x8E60, 0x8E60, 0x1BE9, 0x8E74, 0x8E74, 0x1C81, 0x8E76, 0x8E76, 0x0F8E,
- 0x8E81, 0x8E81, 0x1AA5, 0x8E87, 0x8E87, 0x19D6, 0x8E8A, 0x8E8A, 0x1AED,
- 0x8E8D, 0x8E8D, 0x16F6, 0x8EAA, 0x8EAA, 0x1223, 0x8EAB, 0x8EAB, 0x167B,
- 0x8EAC, 0x8EAC, 0x0F80, 0x8EC0, 0x8EC0, 0x0F61, 0x8ECA, 0x8ECA, 0x1B8D,
- 0x8ECB, 0x8ECB, 0x16BB, 0x8ECC, 0x8ECC, 0x0F94, 0x8ECD, 0x8ECD, 0x0F75,
- 0x8ED2, 0x8ED2, 0x1E2E, 0x8EDF, 0x8EDF, 0x175E, 0x8EEB, 0x8EEB, 0x1B60,
- 0x8EF8, 0x8EF8, 0x1C82, 0x8EFB, 0x8EFB, 0x0D86, 0x8EFE, 0x8EFE, 0x1664,
- 0x8F03, 0x8F03, 0x0F2F, 0x8F05, 0x8F05, 0x11AB, 0x8F09, 0x8F09, 0x19B8,
- 0x8F12, 0x8F12, 0x1C1C, 0x8F13, 0x8F13, 0x124E, 0x8F14, 0x8F14, 0x13D1,
- 0x8F15, 0x8F15, 0x0E72, 0x8F1B, 0x8F1B, 0x1156, 0x8F1C, 0x8F1C, 0x1CBC,
- 0x8F1D, 0x8F1D, 0x1F43, 0x8F1E, 0x8F1E, 0x1262, 0x8F1F, 0x8F1F, 0x1C06,
- 0x8F26, 0x8F26, 0x117A, 0x8F27, 0x8F27, 0x13BF, 0x8F29, 0x8F29, 0x1379,
- 0x8F2A, 0x8F2A, 0x11F7, 0x8F2F, 0x8F2F, 0x1B7B, 0x8F33, 0x8F33, 0x1AEE,
- 0x8F38, 0x8F38, 0x15ED, 0x8F39, 0x8F39, 0x13DF, 0x8F3B, 0x8F3B, 0x13E0,
- 0x8F3E, 0x8F3E, 0x1A12, 0x8F3F, 0x8F3F, 0x1738, 0x8F44, 0x8F44, 0x1DE2,
- 0x8F45, 0x8F45, 0x1884, 0x8F49, 0x8F49, 0x1A13, 0x8F4D, 0x8F4D, 0x1C07,
- 0x8F4E, 0x8F4E, 0x0F30, 0x8F5D, 0x8F5D, 0x1739, 0x8F5F, 0x8F5F, 0x0F1B,
- 0x8F62, 0x8F62, 0x116F, 0x8F9B, 0x8F9B, 0x167C, 0x8F9C, 0x8F9C, 0x0EB1,
- 0x8FA3, 0x8FA3, 0x112E, 0x8FA6, 0x8FA6, 0x1D48, 0x8FA8, 0x8FA8, 0x13AA,
- 0x8FAD, 0x8FAD, 0x14B0, 0x8FAF, 0x8FAF, 0x13AB, 0x8FB0, 0x8FB0, 0x1B61,
- 0x8FB1, 0x8FB1, 0x181D, 0x8FB2, 0x8FB2, 0x1051, 0x8FC2, 0x8FC2, 0x184E,
- 0x8FC5, 0x8FC5, 0x167D, 0x8FCE, 0x8FCE, 0x178A, 0x8FD1, 0x8FD1, 0x0FC4,
- 0x8FD4, 0x8FD4, 0x133F, 0x8FE6, 0x8FE6, 0x0D87, 0x8FEA, 0x8FEA, 0x19EF,
- 0x8FEB, 0x8FEB, 0x1326, 0x8FED, 0x8FED, 0x1B75, 0x8FF0, 0x8FF0, 0x1625,
- 0x8FF2, 0x8FF2, 0x0E2A, 0x8FF7, 0x8FF7, 0x1303, 0x8FF9, 0x8FF9, 0x19F0,
- 0x8FFD, 0x8FFD, 0x1C6E, 0x9000, 0x9000, 0x1D27, 0x9001, 0x9001, 0x15B7,
- 0x9002, 0x9002, 0x0EFE, 0x9003, 0x9003, 0x10CE, 0x9005, 0x9005, 0x1F2A,
- 0x9006, 0x9006, 0x1742, 0x9008, 0x9008, 0x1E6B, 0x900B, 0x900B, 0x1D8F,
- 0x900D, 0x900D, 0x159B, 0x900F, 0x900F, 0x1D2D, 0x9010, 0x9010, 0x1C83,
- 0x9011, 0x9011, 0x0F62, 0x9014, 0x9014, 0x10CF, 0x9015, 0x9015, 0x0E73,
- 0x9017, 0x9017, 0x1104, 0x9019, 0x9019, 0x19D7, 0x901A, 0x901A, 0x1D22,
- 0x901D, 0x901D, 0x1517, 0x901E, 0x901E, 0x1194, 0x901F, 0x901F, 0x15A9,
- 0x9020, 0x9020, 0x1AA6, 0x9021, 0x9021, 0x1B05, 0x9022, 0x9022, 0x13F2,
- 0x9023, 0x9023, 0x117B, 0x902E, 0x902E, 0x1C2B, 0x9031, 0x9031, 0x1AEF,
- 0x9032, 0x9032, 0x1B62, 0x9035, 0x9035, 0x0FA7, 0x9038, 0x9038, 0x1942,
- 0x903C, 0x903C, 0x1DBF, 0x903E, 0x903E, 0x18CE, 0x9041, 0x9041, 0x1109,
- 0x9042, 0x9042, 0x15EE, 0x9047, 0x9047, 0x184F, 0x904A, 0x904A, 0x18CD,
- 0x904B, 0x904B, 0x1866, 0x904D, 0x904D, 0x1D65, 0x904E, 0x904E, 0x0EE4,
- 0x9050, 0x9050, 0x1DCB, 0x9051, 0x9051, 0x1EF5, 0x9053, 0x9053, 0x10D0,
- 0x9054, 0x9054, 0x1078, 0x9055, 0x9055, 0x18A2, 0x9059, 0x9059, 0x1815,
- 0x905C, 0x905C, 0x15AE, 0x905D, 0x905D, 0x108E, 0x905E, 0x905E, 0x1C2C,
- 0x9060, 0x9060, 0x1885, 0x9061, 0x9061, 0x159C, 0x9063, 0x9063, 0x0E3E,
- 0x9069, 0x9069, 0x19F1, 0x906D, 0x906D, 0x1AA7, 0x906E, 0x906E, 0x1B8E,
- 0x906F, 0x906F, 0x110A, 0x9072, 0x9072, 0x1B3E, 0x9075, 0x9075, 0x1B06,
- 0x9077, 0x9077, 0x1BFA, 0x9078, 0x9078, 0x1545, 0x907A, 0x907A, 0x18CF,
- 0x907C, 0x907C, 0x11D1, 0x907D, 0x907D, 0x0E0E, 0x907F, 0x907F, 0x1DB2,
- 0x9080, 0x9080, 0x1816, 0x9081, 0x9081, 0x1270, 0x9082, 0x9082, 0x1E14,
- 0x9083, 0x9083, 0x15EF, 0x9084, 0x9084, 0x1ED8, 0x9087, 0x9087, 0x1922,
- 0x9088, 0x9088, 0x123D, 0x908A, 0x908A, 0x13AC, 0x908F, 0x908F, 0x111D,
- 0x9091, 0x9091, 0x18F5, 0x9095, 0x9095, 0x17D0, 0x9099, 0x9099, 0x1263,
- 0x90A2, 0x90A2, 0x1E6C, 0x90A3, 0x90A3, 0x102A, 0x90A6, 0x90A6, 0x1366,
- 0x90A8, 0x90A8, 0x1C52, 0x90AA, 0x90AA, 0x14B1, 0x90AF, 0x90AF, 0x0DC6,
- 0x90B0, 0x90B0, 0x1D13, 0x90B1, 0x90B1, 0x0F63, 0x90B5, 0x90B5, 0x159D,
- 0x90B8, 0x90B8, 0x19D8, 0x90C1, 0x90C1, 0x185C, 0x90CA, 0x90CA, 0x0F31,
- 0x90DE, 0x90DE, 0x1143, 0x90E1, 0x90E1, 0x0F76, 0x90E8, 0x90E8, 0x1419,
- 0x90ED, 0x90ED, 0x0EEA, 0x90F5, 0x90F5, 0x1850, 0x90FD, 0x90FD, 0x10D1,
- 0x9102, 0x9102, 0x16AA, 0x9112, 0x9112, 0x1C6F, 0x9115, 0x9115, 0x1E22,
- 0x9119, 0x9119, 0x1463, 0x9127, 0x9127, 0x1114, 0x912D, 0x912D, 0x1A5C,
- 0x9132, 0x9132, 0x1072, 0x9149, 0x9149, 0x18D0, 0x914A, 0x914A, 0x1A5D,
- 0x914B, 0x914B, 0x1C70, 0x914C, 0x914C, 0x1977, 0x914D, 0x914D, 0x137A,
- 0x914E, 0x914E, 0x1AF0, 0x9152, 0x9152, 0x1AF1, 0x9162, 0x9162, 0x1C46,
- 0x9169, 0x9169, 0x1298, 0x916A, 0x916A, 0x1123, 0x916C, 0x916C, 0x15F0,
- 0x9175, 0x9175, 0x1F1C, 0x9177, 0x9177, 0x1EA3, 0x9178, 0x9178, 0x14C1,
- 0x9187, 0x9187, 0x161F, 0x9189, 0x9189, 0x1C9F, 0x918B, 0x918B, 0x1C47,
- 0x918D, 0x918D, 0x1A78, 0x9192, 0x9192, 0x1573, 0x919C, 0x919C, 0x1C71,
- 0x91AB, 0x91AB, 0x190C, 0x91AC, 0x91AC, 0x19A7, 0x91AE, 0x91AE, 0x1C48,
- 0x91AF, 0x91AF, 0x1E76, 0x91B1, 0x91B1, 0x1349, 0x91B4, 0x91B4, 0x119D,
- 0x91B5, 0x91B5, 0x0E00, 0x91C0, 0x91C0, 0x170B, 0x91C7, 0x91C7, 0x1BD4,
- 0x91C9, 0x91C9, 0x18D1, 0x91CB, 0x91CB, 0x1528, 0x91CC, 0x91CC, 0x121A,
- 0x91CD, 0x91CD, 0x1B0D, 0x91CE, 0x91CE, 0x16EF, 0x91CF, 0x91CF, 0x1157,
- 0x91D0, 0x91D0, 0x121B, 0x91D1, 0x91D1, 0x1023, 0x91D7, 0x91D7, 0x15BE,
- 0x91D8, 0x91D8, 0x1A5E, 0x91DC, 0x91DC, 0x141A, 0x91DD, 0x91DD, 0x1CCE,
- 0x91E3, 0x91E3, 0x1AA8, 0x91E7, 0x91E7, 0x1BFB, 0x91EA, 0x91EA, 0x1851,
- 0x91F5, 0x91F5, 0x1BD5, 0x920D, 0x920D, 0x110B, 0x9210, 0x9210, 0x0E26,
- 0x9211, 0x9211, 0x1D49, 0x9212, 0x9212, 0x14D1, 0x9217, 0x9217, 0x18DE,
- 0x921E, 0x921E, 0x0FAE, 0x9234, 0x9234, 0x1195, 0x923A, 0x923A, 0x17C2,
- 0x923F, 0x923F, 0x1A14, 0x9240, 0x9240, 0x0DCE, 0x9245, 0x9245, 0x0E0F,
- 0x9249, 0x9249, 0x1E48, 0x9257, 0x9257, 0x0E4A, 0x925B, 0x925B, 0x175F,
- 0x925E, 0x925E, 0x188B, 0x9262, 0x9262, 0x134A, 0x9264, 0x9264, 0x0F64,
- 0x9265, 0x9265, 0x1626, 0x9266, 0x9266, 0x1A5F, 0x9280, 0x9280, 0x18EA,
- 0x9283, 0x9283, 0x1C5C, 0x9285, 0x9285, 0x10FB, 0x9291, 0x9291, 0x1546,
- 0x9293, 0x9293, 0x1A15, 0x9296, 0x9296, 0x15F1, 0x9298, 0x9298, 0x1299,
- 0x929C, 0x929C, 0x1DEC, 0x92B3, 0x92B3, 0x179E, 0x92B6, 0x92B6, 0x0F65,
- 0x92B7, 0x92B7, 0x159E, 0x92B9, 0x92B9, 0x15F2, 0x92CC, 0x92CC, 0x1A60,
- 0x92CF, 0x92CF, 0x1E59, 0x92D2, 0x92D2, 0x13F3, 0x92E4, 0x92E4, 0x1518,
- 0x92EA, 0x92EA, 0x1D90, 0x92F8, 0x92F8, 0x0E10, 0x92FC, 0x92FC, 0x0DE5,
- 0x9304, 0x9304, 0x11B4, 0x9310, 0x9310, 0x1C72, 0x9318, 0x9318, 0x1C73,
- 0x931A, 0x931A, 0x19BE, 0x931E, 0x931E, 0x1620, 0x931F, 0x931F, 0x1089,
- 0x9320, 0x9320, 0x1A61, 0x9321, 0x9321, 0x1016, 0x9322, 0x9322, 0x1A16,
- 0x9324, 0x9324, 0x1017, 0x9326, 0x9326, 0x0FD2, 0x9328, 0x9328, 0x12CB,
- 0x932B, 0x932B, 0x1529, 0x932E, 0x932E, 0x0EB2, 0x932F, 0x932F, 0x1B93,
- 0x9348, 0x9348, 0x178B, 0x934A, 0x934A, 0x117C, 0x934B, 0x934B, 0x0EE5,
- 0x934D, 0x934D, 0x10D2, 0x9354, 0x9354, 0x16AB, 0x935B, 0x935B, 0x1073,
- 0x936E, 0x936E, 0x18D2, 0x9375, 0x9375, 0x0E1B, 0x937C, 0x937C, 0x1CCF,
- 0x937E, 0x937E, 0x1AC4, 0x938C, 0x938C, 0x0E4B, 0x9394, 0x9394, 0x1833,
- 0x9396, 0x9396, 0x15BC, 0x939A, 0x939A, 0x1C74, 0x93A3, 0x93A3, 0x1E6D,
- 0x93A7, 0x93A7, 0x0DF9, 0x93AC, 0x93AC, 0x1E9E, 0x93AD, 0x93AD, 0x1B63,
- 0x93B0, 0x93B0, 0x1943, 0x93C3, 0x93C3, 0x1AAF, 0x93D1, 0x93D1, 0x19F2,
- 0x93DE, 0x93DE, 0x1834, 0x93E1, 0x93E1, 0x0E74, 0x93E4, 0x93E4, 0x11DF,
- 0x93F6, 0x93F6, 0x1B7C, 0x9404, 0x9404, 0x1F10, 0x9418, 0x9418, 0x1AC5,
- 0x9425, 0x9425, 0x1547, 0x942B, 0x942B, 0x1A17, 0x9435, 0x9435, 0x1C08,
- 0x9438, 0x9438, 0x1CEF, 0x9444, 0x9444, 0x1AF2, 0x9451, 0x9452, 0x0DC7,
- 0x945B, 0x945B, 0x0F0B, 0x947D, 0x947D, 0x1BA2, 0x947F, 0x947F, 0x1B94,
- 0x9577, 0x9577, 0x19A8, 0x9580, 0x9580, 0x12EE, 0x9583, 0x9583, 0x155D,
- 0x9589, 0x9589, 0x1D76, 0x958B, 0x958B, 0x0DFA, 0x958F, 0x958F, 0x18DF,
- 0x9591, 0x9592, 0x1DDD, 0x9593, 0x9593, 0x0DAB, 0x9594, 0x9594, 0x1312,
- 0x9598, 0x9598, 0x0DCF, 0x95A3, 0x95A3, 0x0D93, 0x95A4, 0x95A4, 0x1DF3,
- 0x95A5, 0x95A5, 0x1390, 0x95A8, 0x95A8, 0x0FA8, 0x95AD, 0x95AD, 0x1165,
- 0x95B1, 0x95B1, 0x1764, 0x95BB, 0x95BB, 0x176C, 0x95BC, 0x95BC, 0x16BC,
- 0x95C7, 0x95C7, 0x16C4, 0x95CA, 0x95CA, 0x1EDF, 0x95D4, 0x95D4, 0x1DF4,
- 0x95D5, 0x95D5, 0x0F8F, 0x95D6, 0x95D6, 0x1D31, 0x95DC, 0x95DC, 0x0EF9,
- 0x95E1, 0x95E1, 0x1BFC, 0x95E2, 0x95E2, 0x13A5, 0x961C, 0x961C, 0x141B,
- 0x9621, 0x9621, 0x1BFD, 0x962A, 0x962A, 0x1D4A, 0x962E, 0x962E, 0x17EB,
- 0x9632, 0x9632, 0x1367, 0x963B, 0x963B, 0x1AA9, 0x963F, 0x963F, 0x169C,
- 0x9640, 0x9640, 0x1CDF, 0x9642, 0x9642, 0x1DB3, 0x9644, 0x9644, 0x141C,
- 0x964B, 0x964B, 0x11E0, 0x964C, 0x964C, 0x1274, 0x964D, 0x964D, 0x0DE6,
- 0x9650, 0x9650, 0x1DDF, 0x965B, 0x965B, 0x1D77, 0x965C, 0x965C, 0x1DF5,
- 0x965D, 0x965D, 0x155E, 0x965E, 0x965E, 0x163B, 0x965F, 0x965F, 0x1BEA,
- 0x9662, 0x9662, 0x1886, 0x9663, 0x9663, 0x1B64, 0x9664, 0x9664, 0x1A79,
- 0x966A, 0x966A, 0x137B, 0x9670, 0x9670, 0x18F0, 0x9673, 0x9673, 0x1B65,
- 0x9675, 0x9675, 0x1204, 0x9676, 0x9676, 0x10D3, 0x9677, 0x9677, 0x1DED,
- 0x9678, 0x9678, 0x11F1, 0x967D, 0x967D, 0x170C, 0x9685, 0x9685, 0x1852,
- 0x9686, 0x9686, 0x11FB, 0x968A, 0x968A, 0x10A8, 0x968B, 0x968B, 0x15F3,
- 0x968D, 0x968D, 0x1EF6, 0x968E, 0x968E, 0x0E8F, 0x9694, 0x9694, 0x0E34,
- 0x9695, 0x9695, 0x1867, 0x9698, 0x9698, 0x16D9, 0x9699, 0x9699, 0x0FB6,
- 0x969B, 0x969B, 0x1A7A, 0x969C, 0x969C, 0x19A9, 0x96A3, 0x96A3, 0x1224,
- 0x96A7, 0x96A8, 0x15F4, 0x96AA, 0x96AA, 0x1E30, 0x96B1, 0x96B1, 0x18EB,
- 0x96B7, 0x96B7, 0x119E, 0x96BB, 0x96BB, 0x1BEB, 0x96C0, 0x96C0, 0x1978,
- 0x96C1, 0x96C1, 0x16B5, 0x96C4, 0x96C4, 0x186E, 0x96C5, 0x96C5, 0x169D,
- 0x96C6, 0x96C6, 0x1B7D, 0x96C7, 0x96C7, 0x0EB3, 0x96C9, 0x96C9, 0x1CBD,
- 0x96CB, 0x96CB, 0x1B07, 0x96CC, 0x96CC, 0x196C, 0x96CD, 0x96CD, 0x17D1,
- 0x96CE, 0x96CE, 0x19D9, 0x96D5, 0x96D5, 0x1AAA, 0x96D6, 0x96D6, 0x15F6,
- 0x96D9, 0x96D9, 0x168D, 0x96DB, 0x96DB, 0x1C75, 0x96DC, 0x96DC, 0x1985,
- 0x96E2, 0x96E2, 0x121C, 0x96E3, 0x96E3, 0x102E, 0x96E8, 0x96E9, 0x1853,
- 0x96EA, 0x96EA, 0x1555, 0x96EF, 0x96EF, 0x12EF, 0x96F0, 0x96F0, 0x1432,
- 0x96F2, 0x96F2, 0x1868, 0x96F6, 0x96F6, 0x1196, 0x96F7, 0x96F7, 0x11C6,
- 0x96F9, 0x96F9, 0x1327, 0x96FB, 0x96FB, 0x1A18, 0x9700, 0x9700, 0x15F7,
- 0x9706, 0x9706, 0x1A62, 0x9707, 0x9707, 0x1B66, 0x9711, 0x9711, 0x1A2A,
- 0x9713, 0x9713, 0x179F, 0x9716, 0x9716, 0x122B, 0x9719, 0x9719, 0x178C,
- 0x971C, 0x971C, 0x14F1, 0x971E, 0x971E, 0x1DCC, 0x9727, 0x9727, 0x12E0,
- 0x9730, 0x9730, 0x14C2, 0x9732, 0x9732, 0x11AC, 0x9739, 0x9739, 0x13A6,
- 0x973D, 0x973D, 0x1A7B, 0x9742, 0x9742, 0x1170, 0x9744, 0x9744, 0x16DA,
- 0x9748, 0x9748, 0x1197, 0x9751, 0x9751, 0x1C23, 0x9756, 0x9756, 0x1A63,
- 0x975C, 0x975C, 0x1A64, 0x975E, 0x975E, 0x1464, 0x9761, 0x9761, 0x1304,
- 0x9762, 0x9762, 0x1288, 0x9769, 0x9769, 0x1E35, 0x976D, 0x976D, 0x193A,
- 0x9774, 0x9774, 0x1EC4, 0x9777, 0x9777, 0x193B, 0x977A, 0x977A, 0x1257,
- 0x978B, 0x978B, 0x1E77, 0x978D, 0x978D, 0x16B6, 0x978F, 0x978F, 0x0ED9,
- 0x97A0, 0x97A0, 0x0F6E, 0x97A8, 0x97A8, 0x0DB5, 0x97AB, 0x97AB, 0x0F6F,
- 0x97AD, 0x97AD, 0x1D66, 0x97C6, 0x97C6, 0x1BFE, 0x97CB, 0x97CB, 0x18A3,
- 0x97D3, 0x97D3, 0x1DE0, 0x97DC, 0x97DC, 0x10D4, 0x97F3, 0x97F3, 0x18F1,
- 0x97F6, 0x97F6, 0x159F, 0x97FB, 0x97FB, 0x1869, 0x97FF, 0x97FF, 0x1E23,
- 0x9800, 0x9800, 0x1E9F, 0x9801, 0x9801, 0x1E4D, 0x9802, 0x9802, 0x1A65,
- 0x9803, 0x9803, 0x0E75, 0x9805, 0x9805, 0x1E04, 0x9806, 0x9806, 0x1621,
- 0x9808, 0x9808, 0x15F8, 0x980A, 0x980A, 0x185D, 0x980C, 0x980C, 0x15B8,
- 0x9810, 0x9810, 0x17A0, 0x9811, 0x9811, 0x17EC, 0x9812, 0x9812, 0x1340,
- 0x9813, 0x9813, 0x10E8, 0x9817, 0x9817, 0x1D41, 0x9818, 0x9818, 0x1198,
- 0x982D, 0x982D, 0x1105, 0x9830, 0x9830, 0x1E5A, 0x9838, 0x9838, 0x0E76,
- 0x9839, 0x9839, 0x1D28, 0x983B, 0x983B, 0x1474, 0x9846, 0x9846, 0x0EE6,
- 0x984C, 0x984C, 0x1A7C, 0x984D, 0x984D, 0x16E1, 0x984E, 0x984E, 0x16AC,
- 0x9854, 0x9854, 0x16B7, 0x9858, 0x9858, 0x1887, 0x985A, 0x985A, 0x1A19,
- 0x985E, 0x985E, 0x11EE, 0x9865, 0x9865, 0x1EA0, 0x9867, 0x9867, 0x0EB4,
- 0x986B, 0x986B, 0x1A1A, 0x986F, 0x986F, 0x1E49, 0x98A8, 0x98A8, 0x1DAB,
- 0x98AF, 0x98AF, 0x14D2, 0x98B1, 0x98B1, 0x1D14, 0x98C4, 0x98C4, 0x1DA4,
- 0x98C7, 0x98C7, 0x1DA3, 0x98DB, 0x98DB, 0x1465, 0x98DC, 0x98DC, 0x138C,
- 0x98DF, 0x98DF, 0x1665, 0x98E1, 0x98E1, 0x15AF, 0x98E2, 0x98E2, 0x1018,
- 0x98ED, 0x98ED, 0x1CC2, 0x98EE, 0x98EE, 0x18F2, 0x98EF, 0x98EF, 0x1341,
- 0x98F4, 0x98F4, 0x1923, 0x98FC, 0x98FC, 0x14B2, 0x98FD, 0x98FD, 0x1D91,
- 0x98FE, 0x98FE, 0x1666, 0x9903, 0x9903, 0x0F32, 0x9909, 0x9909, 0x1E24,
- 0x990A, 0x990A, 0x170D, 0x990C, 0x990C, 0x1924, 0x9910, 0x9910, 0x1BA3,
- 0x9913, 0x9913, 0x169E, 0x9918, 0x9918, 0x173A, 0x991E, 0x991E, 0x1A1B,
- 0x9920, 0x9920, 0x13C0, 0x9928, 0x9928, 0x0EFA, 0x9945, 0x9945, 0x124F,
- 0x9949, 0x9949, 0x0FC5, 0x994B, 0x994B, 0x0F95, 0x994C, 0x994C, 0x1BA4,
- 0x994D, 0x994D, 0x1548, 0x9951, 0x9951, 0x1019, 0x9952, 0x9952, 0x1817,
- 0x9954, 0x9954, 0x17D2, 0x9957, 0x9957, 0x1E25, 0x9996, 0x9996, 0x15F9,
- 0x9999, 0x9999, 0x1E26, 0x999D, 0x999D, 0x1DBD, 0x99A5, 0x99A5, 0x13E1,
- 0x99A8, 0x99A8, 0x1E6E, 0x99AC, 0x99AC, 0x1235, 0x99AD, 0x99AD, 0x1715,
- 0x99AE, 0x99AE, 0x1DAC, 0x99B1, 0x99B1, 0x1CE0, 0x99B3, 0x99B3, 0x1CBE,
- 0x99B4, 0x99B4, 0x1622, 0x99B9, 0x99B9, 0x1944, 0x99C1, 0x99C1, 0x1328,
- 0x99D0, 0x99D0, 0x1AF3, 0x99D1, 0x99D1, 0x104E, 0x99D2, 0x99D2, 0x0F66,
- 0x99D5, 0x99D5, 0x0D88, 0x99D9, 0x99D9, 0x141D, 0x99DD, 0x99DD, 0x1CE1,
- 0x99DF, 0x99DF, 0x14B3, 0x99ED, 0x99ED, 0x1E15, 0x99F1, 0x99F1, 0x1124,
- 0x99FF, 0x99FF, 0x1B08, 0x9A01, 0x9A01, 0x1478, 0x9A08, 0x9A08, 0x13C1,
- 0x9A0E, 0x9A0F, 0x101A, 0x9A19, 0x9A19, 0x1D67, 0x9A2B, 0x9A2B, 0x0E1C,
- 0x9A30, 0x9A30, 0x1115, 0x9A36, 0x9A36, 0x1C76, 0x9A37, 0x9A37, 0x15A0,
- 0x9A40, 0x9A40, 0x1275, 0x9A43, 0x9A43, 0x1DA5, 0x9A45, 0x9A45, 0x0F67,
- 0x9A4D, 0x9A4D, 0x1F1D, 0x9A55, 0x9A55, 0x0F33, 0x9A57, 0x9A57, 0x1E31,
- 0x9A5A, 0x9A5A, 0x0E77, 0x9A5B, 0x9A5B, 0x1743, 0x9A5F, 0x9A5F, 0x1CA0,
- 0x9A62, 0x9A62, 0x1166, 0x9A65, 0x9A65, 0x101C, 0x9A69, 0x9A69, 0x1ED9,
- 0x9A6A, 0x9A6A, 0x1167, 0x9AA8, 0x9AA8, 0x0EC9, 0x9AB8, 0x9AB8, 0x1E16,
- 0x9AD3, 0x9AD3, 0x15FA, 0x9AD4, 0x9AD4, 0x1C2D, 0x9AD8, 0x9AD8, 0x0EB5,
- 0x9AE5, 0x9AE5, 0x176D, 0x9AEE, 0x9AEE, 0x134B, 0x9B1A, 0x9B1A, 0x15FB,
- 0x9B27, 0x9B27, 0x11D2, 0x9B2A, 0x9B2A, 0x1D2E, 0x9B31, 0x9B31, 0x186B,
- 0x9B3C, 0x9B3C, 0x0F99, 0x9B41, 0x9B41, 0x0F17, 0x9B42, 0x9B42, 0x1EA9,
- 0x9B43, 0x9B43, 0x134C, 0x9B44, 0x9B44, 0x1383, 0x9B45, 0x9B45, 0x1271,
- 0x9B4F, 0x9B4F, 0x18A4, 0x9B54, 0x9B54, 0x1236, 0x9B5A, 0x9B5A, 0x1716,
- 0x9B6F, 0x9B6F, 0x11AD, 0x9B8E, 0x9B8E, 0x1A2B, 0x9B91, 0x9B91, 0x1D92,
- 0x9B9F, 0x9B9F, 0x16B8, 0x9BAB, 0x9BAB, 0x0F34, 0x9BAE, 0x9BAE, 0x1549,
- 0x9BC9, 0x9BC9, 0x121D, 0x9BD6, 0x9BD6, 0x1C24, 0x9BE4, 0x9BE4, 0x0EC7,
- 0x9BE8, 0x9BE8, 0x0E78, 0x9C0D, 0x9C0D, 0x1C77, 0x9C10, 0x9C10, 0x16AD,
- 0x9C12, 0x9C12, 0x13E2, 0x9C15, 0x9C15, 0x1DCD, 0x9C25, 0x9C25, 0x1EDA,
- 0x9C32, 0x9C32, 0x17BC, 0x9C3B, 0x9C3B, 0x1250, 0x9C47, 0x9C47, 0x0DE7,
- 0x9C49, 0x9C49, 0x13AF, 0x9C57, 0x9C57, 0x1225, 0x9CE5, 0x9CE5, 0x1AAB,
- 0x9CE7, 0x9CE7, 0x141E, 0x9CE9, 0x9CE9, 0x0F68, 0x9CF3, 0x9CF3, 0x13F4,
- 0x9CF4, 0x9CF4, 0x129A, 0x9CF6, 0x9CF6, 0x1760, 0x9D09, 0x9D09, 0x169F,
- 0x9D1B, 0x9D1B, 0x1888, 0x9D26, 0x9D26, 0x16CF, 0x9D28, 0x9D28, 0x16C8,
- 0x9D3B, 0x9D3B, 0x1EB6, 0x9D51, 0x9D51, 0x0E3F, 0x9D5D, 0x9D5D, 0x16A0,
- 0x9D60, 0x9D60, 0x0EBD, 0x9D61, 0x9D61, 0x12E1, 0x9D6C, 0x9D6C, 0x143C,
- 0x9D72, 0x9D72, 0x1979, 0x9DA9, 0x9DA9, 0x12BA, 0x9DAF, 0x9DAF, 0x16E4,
- 0x9DB4, 0x9DB4, 0x1DD2, 0x9DC4, 0x9DC4, 0x0E90, 0x9DD7, 0x9DD7, 0x0F69,
- 0x9DF2, 0x9DF2, 0x1CA1, 0x9DF8, 0x9DF8, 0x1F4C, 0x9DF9, 0x9DF9, 0x18F9,
- 0x9DFA, 0x9DFA, 0x11AE, 0x9E1A, 0x9E1A, 0x16E5, 0x9E1E, 0x9E1E, 0x112C,
- 0x9E75, 0x9E75, 0x11AF, 0x9E79, 0x9E79, 0x1DEE, 0x9E7D, 0x9E7D, 0x176E,
- 0x9E7F, 0x9E7F, 0x11B5, 0x9E92, 0x9E92, 0x101D, 0x9E93, 0x9E93, 0x11B6,
- 0x9E97, 0x9E97, 0x1168, 0x9E9D, 0x9E9D, 0x14B4, 0x9E9F, 0x9E9F, 0x1226,
- 0x9EA5, 0x9EA5, 0x1276, 0x9EB4, 0x9EB4, 0x0F70, 0x9EB5, 0x9EB5, 0x1289,
- 0x9EBB, 0x9EBB, 0x1237, 0x9EBE, 0x9EBE, 0x1F44, 0x9EC3, 0x9EC3, 0x1EF7,
- 0x9ECD, 0x9ECD, 0x1519, 0x9ECE, 0x9ECE, 0x1169, 0x9ED1, 0x9ED1, 0x1F52,
- 0x9ED4, 0x9ED4, 0x0E27, 0x9ED8, 0x9ED8, 0x12E3, 0x9EDB, 0x9EDB, 0x10A9,
- 0x9EDC, 0x9EDC, 0x1C89, 0x9EDE, 0x9EDE, 0x1A2C, 0x9EE8, 0x9EE8, 0x1099,
- 0x9EF4, 0x9EF4, 0x1305, 0x9F07, 0x9F07, 0x17BD, 0x9F08, 0x9F08, 0x13B0,
- 0x9F0E, 0x9F0E, 0x1A66, 0x9F13, 0x9F13, 0x0EB6, 0x9F20, 0x9F20, 0x151A,
- 0x9F3B, 0x9F3B, 0x1466, 0x9F4A, 0x9F4A, 0x1A7D, 0x9F4B, 0x9F4B, 0x19B9,
- 0x9F4E, 0x9F4E, 0x19BA, 0x9F52, 0x9F52, 0x1CBF, 0x9F5F, 0x9F5F, 0x19DA,
- 0x9F61, 0x9F61, 0x1199, 0x9F67, 0x9F67, 0x1556, 0x9F6A, 0x9F6A, 0x1B95,
- 0x9F6C, 0x9F6C, 0x1717, 0x9F77, 0x9F77, 0x16AE, 0x9F8D, 0x9F8D, 0x11D3,
- 0x9F90, 0x9F90, 0x1368, 0x9F95, 0x9F95, 0x0DC9, 0x9F9C, 0x9F9C, 0x0F6A,
- 0xAC00, 0xAC01, 0x043E, 0xAC02, 0xAC03, 0x2475, 0xAC04, 0xAC04, 0x0440,
- 0xAC05, 0xAC06, 0x2477, 0xAC07, 0xAC0A, 0x0441, 0xAC0B, 0xAC0F, 0x2479,
- 0xAC10, 0xAC17, 0x0445, 0xAC18, 0xAC18, 0x247E, 0xAC19, 0xAC1D, 0x044D,
- 0xAC1E, 0xAC1F, 0x247F, 0xAC20, 0xAC20, 0x0452, 0xAC21, 0xAC23, 0x2481,
- 0xAC24, 0xAC24, 0x0453, 0xAC25, 0xAC2B, 0x2484, 0xAC2C, 0xAC2D, 0x0454,
- 0xAC2E, 0xAC2E, 0x248B, 0xAC2F, 0xAC31, 0x0456, 0xAC32, 0xAC37, 0x248C,
- 0xAC38, 0xAC39, 0x0459, 0xAC3A, 0xAC3B, 0x2492, 0xAC3C, 0xAC3C, 0x045B,
- 0xAC3D, 0xAC3F, 0x2494, 0xAC40, 0xAC40, 0x045C, 0xAC41, 0xAC4A, 0x2497,
- 0xAC4B, 0xAC4B, 0x045D, 0xAC4C, 0xAC4C, 0x24A1, 0xAC4D, 0xAC4D, 0x045E,
- 0xAC4E, 0xAC53, 0x24A2, 0xAC54, 0xAC54, 0x045F, 0xAC55, 0xAC57, 0x24A8,
- 0xAC58, 0xAC58, 0x0460, 0xAC59, 0xAC5B, 0x24AB, 0xAC5C, 0xAC5C, 0x0461,
- 0xAC5D, 0xAC6F, 0x24AE, 0xAC70, 0xAC71, 0x0462, 0xAC72, 0xAC73, 0x24C1,
- 0xAC74, 0xAC74, 0x0464, 0xAC75, 0xAC76, 0x24C3, 0xAC77, 0xAC78, 0x0465,
- 0xAC79, 0xAC79, 0x24C5, 0xAC7A, 0xAC7A, 0x0467, 0xAC7B, 0xAC7F, 0x24C6,
- 0xAC80, 0xAC81, 0x0468, 0xAC82, 0xAC82, 0x24CB, 0xAC83, 0xAC86, 0x046A,
- 0xAC87, 0xAC88, 0x24CC, 0xAC89, 0xAC8C, 0x046E, 0xAC8D, 0xAC8F, 0x24CE,
- 0xAC90, 0xAC90, 0x0472, 0xAC91, 0xAC93, 0x24D1, 0xAC94, 0xAC94, 0x0473,
- 0xAC95, 0xAC9B, 0x24D4, 0xAC9C, 0xAC9D, 0x0474, 0xAC9E, 0xAC9E, 0x24DB,
- 0xAC9F, 0xACA1, 0x0476, 0xACA2, 0xACA7, 0x24DC, 0xACA8, 0xACAA, 0x0479,
- 0xACAB, 0xACAB, 0x24E2, 0xACAC, 0xACAC, 0x047C, 0xACAD, 0xACAE, 0x24E3,
- 0xACAF, 0xACB0, 0x047D, 0xACB1, 0xACB7, 0x24E5, 0xACB8, 0xACB9, 0x047F,
- 0xACBA, 0xACBA, 0x24EC, 0xACBB, 0xACBD, 0x0481, 0xACBE, 0xACC0, 0x24ED,
- 0xACC1, 0xACC1, 0x0484, 0xACC2, 0xACC3, 0x24F0, 0xACC4, 0xACC4, 0x0485,
- 0xACC5, 0xACC7, 0x24F2, 0xACC8, 0xACC8, 0x0486, 0xACC9, 0xACCB, 0x24F5,
- 0xACCC, 0xACCC, 0x0487, 0xACCD, 0xACD4, 0x24F8, 0xACD5, 0xACD5, 0x0488,
- 0xACD6, 0xACD6, 0x2500, 0xACD7, 0xACD7, 0x0489, 0xACD8, 0xACDF, 0x2501,
- 0xACE0, 0xACE1, 0x048A, 0xACE2, 0xACE3, 0x2509, 0xACE4, 0xACE4, 0x048C,
- 0xACE5, 0xACE6, 0x250B, 0xACE7, 0xACE8, 0x048D, 0xACE9, 0xACE9, 0x250D,
- 0xACEA, 0xACEA, 0x048F, 0xACEB, 0xACEB, 0x250E, 0xACEC, 0xACEC, 0x0490,
- 0xACED, 0xACEE, 0x250F, 0xACEF, 0xACF1, 0x0491, 0xACF2, 0xACF2, 0x2511,
- 0xACF3, 0xACF3, 0x0494, 0xACF4, 0xACF4, 0x2512, 0xACF5, 0xACF6, 0x0495,
- 0xACF7, 0xACFB, 0x2513, 0xACFC, 0xACFD, 0x0497, 0xACFE, 0xACFF, 0x2518,
- 0xAD00, 0xAD00, 0x0499, 0xAD01, 0xAD03, 0x251A, 0xAD04, 0xAD04, 0x049A,
- 0xAD05, 0xAD05, 0x251D, 0xAD06, 0xAD06, 0x049B, 0xAD07, 0xAD0B, 0x251E,
- 0xAD0C, 0xAD0D, 0x049C, 0xAD0E, 0xAD0E, 0x2523, 0xAD0F, 0xAD0F, 0x049E,
- 0xAD10, 0xAD10, 0x2524, 0xAD11, 0xAD11, 0x049F, 0xAD12, 0xAD17, 0x2525,
- 0xAD18, 0xAD18, 0x04A0, 0xAD19, 0xAD1B, 0x252B, 0xAD1C, 0xAD1C, 0x04A1,
- 0xAD1D, 0xAD1F, 0x252E, 0xAD20, 0xAD20, 0x04A2, 0xAD21, 0xAD28, 0x2531,
- 0xAD29, 0xAD29, 0x04A3, 0xAD2A, 0xAD2B, 0x2539, 0xAD2C, 0xAD2D, 0x04A4,
- 0xAD2E, 0xAD33, 0x253B, 0xAD34, 0xAD35, 0x04A6, 0xAD36, 0xAD37, 0x2541,
- 0xAD38, 0xAD38, 0x04A8, 0xAD39, 0xAD3B, 0x2543, 0xAD3C, 0xAD3C, 0x04A9,
- 0xAD3D, 0xAD43, 0x2546, 0xAD44, 0xAD45, 0x04AA, 0xAD46, 0xAD46, 0x254D,
- 0xAD47, 0xAD47, 0x04AC, 0xAD48, 0xAD48, 0x254E, 0xAD49, 0xAD49, 0x04AD,
- 0xAD4A, 0xAD4F, 0x254F, 0xAD50, 0xAD50, 0x04AE, 0xAD51, 0xAD53, 0x2555,
- 0xAD54, 0xAD54, 0x04AF, 0xAD55, 0xAD57, 0x2558, 0xAD58, 0xAD58, 0x04B0,
- 0xAD59, 0xAD60, 0x255B, 0xAD61, 0xAD61, 0x04B1, 0xAD62, 0xAD62, 0x2563,
- 0xAD63, 0xAD63, 0x04B2, 0xAD64, 0xAD6B, 0x2564, 0xAD6C, 0xAD6D, 0x04B3,
- 0xAD6E, 0xAD6F, 0x256C, 0xAD70, 0xAD70, 0x04B5, 0xAD71, 0xAD72, 0x256E,
- 0xAD73, 0xAD76, 0x04B6, 0xAD77, 0xAD7A, 0x2570, 0xAD7B, 0xAD7D, 0x04BA,
- 0xAD7E, 0xAD7E, 0x2574, 0xAD7F, 0xAD7F, 0x04BD, 0xAD80, 0xAD80, 0x2575,
- 0xAD81, 0xAD82, 0x04BE, 0xAD83, 0xAD87, 0x2576, 0xAD88, 0xAD89, 0x04C0,
- 0xAD8A, 0xAD8B, 0x257B, 0xAD8C, 0xAD8C, 0x04C2, 0xAD8D, 0xAD8F, 0x257D,
- 0xAD90, 0xAD90, 0x04C3, 0xAD91, 0xAD9B, 0x2580, 0xAD9C, 0xAD9D, 0x04C4,
- 0xAD9E, 0xADA3, 0x258B, 0xADA4, 0xADA4, 0x04C6, 0xADA5, 0xADB6, 0x2591,
- 0xADB7, 0xADB7, 0x04C7, 0xADB8, 0xADBF, 0x25A3, 0xADC0, 0xADC1, 0x04C8,
- 0xADC2, 0xADC3, 0x25AB, 0xADC4, 0xADC4, 0x04CA, 0xADC5, 0xADC7, 0x25AD,
- 0xADC8, 0xADC8, 0x04CB, 0xADC9, 0xADCF, 0x25B0, 0xADD0, 0xADD1, 0x04CC,
- 0xADD2, 0xADD2, 0x25B7, 0xADD3, 0xADD3, 0x04CE, 0xADD4, 0xADDB, 0x25B8,
- 0xADDC, 0xADDC, 0x04CF, 0xADDD, 0xADDF, 0x25C0, 0xADE0, 0xADE0, 0x04D0,
- 0xADE1, 0xADE3, 0x25C3, 0xADE4, 0xADE4, 0x04D1, 0xADE5, 0xADF7, 0x25C6,
- 0xADF8, 0xADF9, 0x04D2, 0xADFA, 0xADFB, 0x25D9, 0xADFC, 0xADFC, 0x04D4,
- 0xADFD, 0xADFE, 0x25DB, 0xADFF, 0xADFF, 0x04D5, 0xAE00, 0xAE01, 0x04D6,
- 0xAE02, 0xAE07, 0x25DD, 0xAE08, 0xAE09, 0x04D8, 0xAE0A, 0xAE0A, 0x25E3,
- 0xAE0B, 0xAE0B, 0x04DA, 0xAE0C, 0xAE0C, 0x25E4, 0xAE0D, 0xAE0D, 0x04DB,
- 0xAE0E, 0xAE13, 0x25E5, 0xAE14, 0xAE14, 0x04DC, 0xAE15, 0xAE2F, 0x25EB,
- 0xAE30, 0xAE31, 0x04DD, 0xAE32, 0xAE33, 0x2606, 0xAE34, 0xAE34, 0x04DF,
- 0xAE35, 0xAE36, 0x2608, 0xAE37, 0xAE38, 0x04E0, 0xAE39, 0xAE39, 0x260A,
- 0xAE3A, 0xAE3A, 0x04E2, 0xAE3B, 0xAE3F, 0x260B, 0xAE40, 0xAE41, 0x04E3,
- 0xAE42, 0xAE42, 0x2610, 0xAE43, 0xAE43, 0x04E5, 0xAE44, 0xAE44, 0x2611,
- 0xAE45, 0xAE46, 0x04E6, 0xAE47, 0xAE49, 0x2612, 0xAE4A, 0xAE4A, 0x04E8,
- 0xAE4B, 0xAE4B, 0x2615, 0xAE4C, 0xAE4E, 0x04E9, 0xAE4F, 0xAE4F, 0x2616,
- 0xAE50, 0xAE50, 0x04EC, 0xAE51, 0xAE53, 0x2617, 0xAE54, 0xAE54, 0x04ED,
- 0xAE55, 0xAE55, 0x261A, 0xAE56, 0xAE56, 0x04EE, 0xAE57, 0xAE5B, 0x261B,
- 0xAE5C, 0xAE5D, 0x04EF, 0xAE5E, 0xAE5E, 0x2620, 0xAE5F, 0xAE61, 0x04F1,
- 0xAE62, 0xAE64, 0x2621, 0xAE65, 0xAE65, 0x04F4, 0xAE66, 0xAE67, 0x2624,
- 0xAE68, 0xAE69, 0x04F5, 0xAE6A, 0xAE6B, 0x2626, 0xAE6C, 0xAE6C, 0x04F7,
- 0xAE6D, 0xAE6F, 0x2628, 0xAE70, 0xAE70, 0x04F8, 0xAE71, 0xAE77, 0x262B,
- 0xAE78, 0xAE79, 0x04F9, 0xAE7A, 0xAE7A, 0x2632, 0xAE7B, 0xAE7D, 0x04FB,
- 0xAE7E, 0xAE83, 0x2633, 0xAE84, 0xAE85, 0x04FE, 0xAE86, 0xAE8B, 0x2639,
- 0xAE8C, 0xAE8C, 0x0500, 0xAE8D, 0xAEBB, 0x263F, 0xAEBC, 0xAEBE, 0x0501,
- 0xAEBF, 0xAEBF, 0x266E, 0xAEC0, 0xAEC0, 0x0504, 0xAEC1, 0xAEC3, 0x266F,
- 0xAEC4, 0xAEC4, 0x0505, 0xAEC5, 0xAECB, 0x2672, 0xAECC, 0xAECD, 0x0506,
- 0xAECE, 0xAECE, 0x2679, 0xAECF, 0xAED1, 0x0508, 0xAED2, 0xAED7, 0x267A,
- 0xAED8, 0xAED9, 0x050B, 0xAEDA, 0xAEDB, 0x2680, 0xAEDC, 0xAEDC, 0x050D,
- 0xAEDD, 0xAEE7, 0x2682, 0xAEE8, 0xAEE8, 0x050E, 0xAEE9, 0xAEEA, 0x268D,
- 0xAEEB, 0xAEEB, 0x050F, 0xAEEC, 0xAEEC, 0x268F, 0xAEED, 0xAEED, 0x0510,
- 0xAEEE, 0xAEF3, 0x2690, 0xAEF4, 0xAEF4, 0x0511, 0xAEF5, 0xAEF7, 0x2696,
- 0xAEF8, 0xAEF8, 0x0512, 0xAEF9, 0xAEFB, 0x2699, 0xAEFC, 0xAEFC, 0x0513,
- 0xAEFD, 0xAEFF, 0x269C, 0xAF00, 0xAF06, 0x269F, 0xAF07, 0xAF08, 0x0514,
- 0xAF09, 0xAF0C, 0x26A6, 0xAF0D, 0xAF0D, 0x0516, 0xAF0E, 0xAF0F, 0x26AA,
- 0xAF10, 0xAF10, 0x0517, 0xAF11, 0xAF2B, 0x26AC, 0xAF2C, 0xAF2D, 0x0518,
- 0xAF2E, 0xAF2F, 0x26C7, 0xAF30, 0xAF30, 0x051A, 0xAF31, 0xAF31, 0x26C9,
- 0xAF32, 0xAF32, 0x051B, 0xAF33, 0xAF33, 0x26CA, 0xAF34, 0xAF34, 0x051C,
- 0xAF35, 0xAF3B, 0x26CB, 0xAF3C, 0xAF3D, 0x051D, 0xAF3E, 0xAF3E, 0x26D2,
- 0xAF3F, 0xAF3F, 0x051F, 0xAF40, 0xAF40, 0x26D3, 0xAF41, 0xAF43, 0x0520,
- 0xAF44, 0xAF47, 0x26D4, 0xAF48, 0xAF49, 0x0523, 0xAF4A, 0xAF4F, 0x26D8,
- 0xAF50, 0xAF50, 0x0525, 0xAF51, 0xAF5B, 0x26DE, 0xAF5C, 0xAF5D, 0x0526,
- 0xAF5E, 0xAF63, 0x26E9, 0xAF64, 0xAF65, 0x0528, 0xAF66, 0xAF78, 0x26EF,
- 0xAF79, 0xAF79, 0x052A, 0xAF7A, 0xAF7F, 0x2702, 0xAF80, 0xAF80, 0x052B,
- 0xAF81, 0xAF83, 0x2708, 0xAF84, 0xAF84, 0x052C, 0xAF85, 0xAF87, 0x270B,
- 0xAF88, 0xAF88, 0x052D, 0xAF89, 0xAF8F, 0x270E, 0xAF90, 0xAF91, 0x052E,
- 0xAF92, 0xAF94, 0x2715, 0xAF95, 0xAF95, 0x0530, 0xAF96, 0xAF9B, 0x2718,
- 0xAF9C, 0xAF9C, 0x0531, 0xAF9D, 0xAFB7, 0x271E, 0xAFB8, 0xAFB9, 0x0532,
- 0xAFBA, 0xAFBB, 0x2739, 0xAFBC, 0xAFBC, 0x0534, 0xAFBD, 0xAFBF, 0x273B,
- 0xAFC0, 0xAFC0, 0x0535, 0xAFC1, 0xAFC6, 0x273E, 0xAFC7, 0xAFC9, 0x0536,
- 0xAFCA, 0xAFCA, 0x2744, 0xAFCB, 0xAFCB, 0x0539, 0xAFCC, 0xAFCC, 0x2745,
- 0xAFCD, 0xAFCE, 0x053A, 0xAFCF, 0xAFD3, 0x2746, 0xAFD4, 0xAFD4, 0x053C,
- 0xAFD5, 0xAFDB, 0x274B, 0xAFDC, 0xAFDC, 0x053D, 0xAFDD, 0xAFE7, 0x2752,
- 0xAFE8, 0xAFE9, 0x053E, 0xAFEA, 0xAFEF, 0x275D, 0xAFF0, 0xAFF1, 0x0540,
- 0xAFF2, 0xAFF3, 0x2763, 0xAFF4, 0xAFF4, 0x0542, 0xAFF5, 0xAFF7, 0x2765,
- 0xAFF8, 0xAFF8, 0x0543, 0xAFF9, 0xAFFF, 0x2768, 0xB000, 0xB001, 0x0544,
- 0xB002, 0xB003, 0x276F, 0xB004, 0xB004, 0x0546, 0xB005, 0xB00B, 0x2771,
- 0xB00C, 0xB00C, 0x0547, 0xB00D, 0xB00F, 0x2778, 0xB010, 0xB010, 0x0548,
- 0xB011, 0xB013, 0x277B, 0xB014, 0xB014, 0x0549, 0xB015, 0xB01B, 0x277E,
- 0xB01C, 0xB01D, 0x054A, 0xB01E, 0xB027, 0x2785, 0xB028, 0xB028, 0x054C,
- 0xB029, 0xB043, 0x278F, 0xB044, 0xB045, 0x054D, 0xB046, 0xB047, 0x27AA,
- 0xB048, 0xB048, 0x054F, 0xB049, 0xB049, 0x27AC, 0xB04A, 0xB04A, 0x0550,
- 0xB04B, 0xB04B, 0x27AD, 0xB04C, 0xB04C, 0x0551, 0xB04D, 0xB04D, 0x27AE,
- 0xB04E, 0xB04E, 0x0552, 0xB04F, 0xB052, 0x27AF, 0xB053, 0xB055, 0x0553,
- 0xB056, 0xB056, 0x27B3, 0xB057, 0xB057, 0x0556, 0xB058, 0xB058, 0x27B4,
- 0xB059, 0xB059, 0x0557, 0xB05A, 0xB05C, 0x27B5, 0xB05D, 0xB05D, 0x0558,
- 0xB05E, 0xB07B, 0x27B8, 0xB07C, 0xB07D, 0x0559, 0xB07E, 0xB07F, 0x27D6,
- 0xB080, 0xB080, 0x055B, 0xB081, 0xB083, 0x27D8, 0xB084, 0xB084, 0x055C,
- 0xB085, 0xB08B, 0x27DB, 0xB08C, 0xB08D, 0x055D, 0xB08E, 0xB08E, 0x27E2,
- 0xB08F, 0xB08F, 0x055F, 0xB090, 0xB090, 0x27E3, 0xB091, 0xB091, 0x0560,
- 0xB092, 0xB097, 0x27E4, 0xB098, 0xB09A, 0x0561, 0xB09B, 0xB09B, 0x27EA,
- 0xB09C, 0xB09C, 0x0564, 0xB09D, 0xB09E, 0x27EB, 0xB09F, 0xB0A2, 0x0565,
- 0xB0A3, 0xB0A7, 0x27ED, 0xB0A8, 0xB0A9, 0x0569, 0xB0AA, 0xB0AA, 0x27F2,
- 0xB0AB, 0xB0AF, 0x056B, 0xB0B0, 0xB0B0, 0x27F3, 0xB0B1, 0xB0B1, 0x0570,
- 0xB0B2, 0xB0B2, 0x27F4, 0xB0B3, 0xB0B5, 0x0571, 0xB0B6, 0xB0B7, 0x27F5,
- 0xB0B8, 0xB0B8, 0x0574, 0xB0B9, 0xB0BB, 0x27F7, 0xB0BC, 0xB0BC, 0x0575,
- 0xB0BD, 0xB0C3, 0x27FA, 0xB0C4, 0xB0C5, 0x0576, 0xB0C6, 0xB0C6, 0x2801,
- 0xB0C7, 0xB0C9, 0x0578, 0xB0CA, 0xB0CF, 0x2802, 0xB0D0, 0xB0D1, 0x057B,
- 0xB0D2, 0xB0D3, 0x2808, 0xB0D4, 0xB0D4, 0x057D, 0xB0D5, 0xB0D7, 0x280A,
- 0xB0D8, 0xB0D8, 0x057E, 0xB0D9, 0xB0DF, 0x280D, 0xB0E0, 0xB0E0, 0x057F,
- 0xB0E1, 0xB0E4, 0x2814, 0xB0E5, 0xB0E5, 0x0580, 0xB0E6, 0xB0FF, 0x2818,
- 0xB100, 0xB107, 0x2832, 0xB108, 0xB109, 0x0581, 0xB10A, 0xB10A, 0x283A,
- 0xB10B, 0xB10C, 0x0583, 0xB10D, 0xB10F, 0x283B, 0xB110, 0xB110, 0x0585,
- 0xB111, 0xB111, 0x283E, 0xB112, 0xB113, 0x0586, 0xB114, 0xB117, 0x283F,
- 0xB118, 0xB119, 0x0588, 0xB11A, 0xB11A, 0x2843, 0xB11B, 0xB11D, 0x058A,
- 0xB11E, 0xB122, 0x2844, 0xB123, 0xB125, 0x058D, 0xB126, 0xB127, 0x2849,
- 0xB128, 0xB128, 0x0590, 0xB129, 0xB12B, 0x284B, 0xB12C, 0xB12C, 0x0591,
- 0xB12D, 0xB133, 0x284E, 0xB134, 0xB135, 0x0592, 0xB136, 0xB136, 0x2855,
- 0xB137, 0xB139, 0x0594, 0xB13A, 0xB13F, 0x2856, 0xB140, 0xB141, 0x0597,
- 0xB142, 0xB143, 0x285C, 0xB144, 0xB144, 0x0599, 0xB145, 0xB147, 0x285E,
- 0xB148, 0xB148, 0x059A, 0xB149, 0xB14F, 0x2861, 0xB150, 0xB151, 0x059B,
- 0xB152, 0xB153, 0x2868, 0xB154, 0xB155, 0x059D, 0xB156, 0xB157, 0x286A,
- 0xB158, 0xB158, 0x059F, 0xB159, 0xB15B, 0x286C, 0xB15C, 0xB15C, 0x05A0,
- 0xB15D, 0xB15F, 0x286F, 0xB160, 0xB160, 0x05A1, 0xB161, 0xB177, 0x2872,
- 0xB178, 0xB179, 0x05A2, 0xB17A, 0xB17B, 0x2889, 0xB17C, 0xB17C, 0x05A4,
- 0xB17D, 0xB17F, 0x288B, 0xB180, 0xB180, 0x05A5, 0xB181, 0xB181, 0x288E,
- 0xB182, 0xB182, 0x05A6, 0xB183, 0xB187, 0x288F, 0xB188, 0xB189, 0x05A7,
- 0xB18A, 0xB18A, 0x2894, 0xB18B, 0xB18B, 0x05A9, 0xB18C, 0xB18C, 0x2895,
- 0xB18D, 0xB18D, 0x05AA, 0xB18E, 0xB191, 0x2896, 0xB192, 0xB194, 0x05AB,
- 0xB195, 0xB197, 0x289A, 0xB198, 0xB198, 0x05AE, 0xB199, 0xB19B, 0x289D,
- 0xB19C, 0xB19C, 0x05AF, 0xB19D, 0xB1A7, 0x28A0, 0xB1A8, 0xB1A8, 0x05B0,
- 0xB1A9, 0xB1CB, 0x28AB, 0xB1CC, 0xB1CC, 0x05B1, 0xB1CD, 0xB1CF, 0x28CE,
- 0xB1D0, 0xB1D0, 0x05B2, 0xB1D1, 0xB1D3, 0x28D1, 0xB1D4, 0xB1D4, 0x05B3,
- 0xB1D5, 0xB1DB, 0x28D4, 0xB1DC, 0xB1DD, 0x05B4, 0xB1DE, 0xB1DE, 0x28DB,
- 0xB1DF, 0xB1DF, 0x05B6, 0xB1E0, 0xB1E7, 0x28DC, 0xB1E8, 0xB1E9, 0x05B7,
- 0xB1EA, 0xB1EB, 0x28E4, 0xB1EC, 0xB1EC, 0x05B9, 0xB1ED, 0xB1EF, 0x28E6,
- 0xB1F0, 0xB1F0, 0x05BA, 0xB1F1, 0xB1F8, 0x28E9, 0xB1F9, 0xB1F9, 0x05BB,
- 0xB1FA, 0xB1FA, 0x28F1, 0xB1FB, 0xB1FB, 0x05BC, 0xB1FC, 0xB1FC, 0x28F2,
- 0xB1FD, 0xB1FD, 0x05BD, 0xB1FE, 0xB1FF, 0x28F3, 0xB200, 0xB203, 0x28F5,
- 0xB204, 0xB205, 0x05BE, 0xB206, 0xB207, 0x28F9, 0xB208, 0xB208, 0x05C0,
- 0xB209, 0xB20A, 0x28FB, 0xB20B, 0xB20C, 0x05C1, 0xB20D, 0xB213, 0x28FD,
- 0xB214, 0xB215, 0x05C3, 0xB216, 0xB216, 0x2904, 0xB217, 0xB217, 0x05C5,
- 0xB218, 0xB218, 0x2905, 0xB219, 0xB219, 0x05C6, 0xB21A, 0xB21F, 0x2906,
- 0xB220, 0xB220, 0x05C7, 0xB221, 0xB233, 0x290C, 0xB234, 0xB234, 0x05C8,
- 0xB235, 0xB23B, 0x291F, 0xB23C, 0xB23C, 0x05C9, 0xB23D, 0xB257, 0x2926,
- 0xB258, 0xB258, 0x05CA, 0xB259, 0xB25B, 0x2941, 0xB25C, 0xB25C, 0x05CB,
- 0xB25D, 0xB25F, 0x2944, 0xB260, 0xB260, 0x05CC, 0xB261, 0xB267, 0x2947,
- 0xB268, 0xB269, 0x05CD, 0xB26A, 0xB273, 0x294E, 0xB274, 0xB275, 0x05CF,
- 0xB276, 0xB27B, 0x2958, 0xB27C, 0xB27C, 0x05D1, 0xB27D, 0xB283, 0x295E,
- 0xB284, 0xB285, 0x05D2, 0xB286, 0xB288, 0x2965, 0xB289, 0xB289, 0x05D4,
- 0xB28A, 0xB28F, 0x2968, 0xB290, 0xB291, 0x05D5, 0xB292, 0xB293, 0x296E,
- 0xB294, 0xB294, 0x05D7, 0xB295, 0xB297, 0x2970, 0xB298, 0xB29A, 0x05D8,
- 0xB29B, 0xB29F, 0x2973, 0xB2A0, 0xB2A1, 0x05DB, 0xB2A2, 0xB2A2, 0x2978,
- 0xB2A3, 0xB2A3, 0x05DD, 0xB2A4, 0xB2A4, 0x2979, 0xB2A5, 0xB2A6, 0x05DE,
- 0xB2A7, 0xB2A9, 0x297A, 0xB2AA, 0xB2AA, 0x05E0, 0xB2AB, 0xB2AB, 0x297D,
- 0xB2AC, 0xB2AC, 0x05E1, 0xB2AD, 0xB2AF, 0x297E, 0xB2B0, 0xB2B0, 0x05E2,
- 0xB2B1, 0xB2B3, 0x2981, 0xB2B4, 0xB2B4, 0x05E3, 0xB2B5, 0xB2C7, 0x2984,
- 0xB2C8, 0xB2C9, 0x05E4, 0xB2CA, 0xB2CB, 0x2997, 0xB2CC, 0xB2CC, 0x05E6,
- 0xB2CD, 0xB2CF, 0x2999, 0xB2D0, 0xB2D0, 0x05E7, 0xB2D1, 0xB2D1, 0x299C,
- 0xB2D2, 0xB2D2, 0x05E8, 0xB2D3, 0xB2D7, 0x299D, 0xB2D8, 0xB2D9, 0x05E9,
- 0xB2DA, 0xB2DA, 0x29A2, 0xB2DB, 0xB2DB, 0x05EB, 0xB2DC, 0xB2DC, 0x29A3,
- 0xB2DD, 0xB2DD, 0x05EC, 0xB2DE, 0xB2E1, 0x29A4, 0xB2E2, 0xB2E2, 0x05ED,
- 0xB2E3, 0xB2E3, 0x29A8, 0xB2E4, 0xB2E6, 0x05EE, 0xB2E7, 0xB2E7, 0x29A9,
- 0xB2E8, 0xB2E8, 0x05F1, 0xB2E9, 0xB2EA, 0x29AA, 0xB2EB, 0xB2EF, 0x05F2,
- 0xB2F0, 0xB2F2, 0x29AC, 0xB2F3, 0xB2F5, 0x05F7, 0xB2F6, 0xB2F6, 0x29AF,
- 0xB2F7, 0xB2FB, 0x05FA, 0xB2FC, 0xB2FE, 0x29B0, 0xB2FF, 0xB2FF, 0x05FF,
- 0xB300, 0xB301, 0x0600, 0xB302, 0xB303, 0x29B3, 0xB304, 0xB304, 0x0602,
- 0xB305, 0xB307, 0x29B5, 0xB308, 0xB308, 0x0603, 0xB309, 0xB30F, 0x29B8,
- 0xB310, 0xB311, 0x0604, 0xB312, 0xB312, 0x29BF, 0xB313, 0xB315, 0x0606,
- 0xB316, 0xB31B, 0x29C0, 0xB31C, 0xB31C, 0x0609, 0xB31D, 0xB353, 0x29C6,
- 0xB354, 0xB356, 0x060A, 0xB357, 0xB357, 0x29FD, 0xB358, 0xB358, 0x060D,
- 0xB359, 0xB35A, 0x29FE, 0xB35B, 0xB35C, 0x060E, 0xB35D, 0xB35D, 0x2A00,
- 0xB35E, 0xB35F, 0x0610, 0xB360, 0xB363, 0x2A01, 0xB364, 0xB365, 0x0612,
- 0xB366, 0xB366, 0x2A05, 0xB367, 0xB367, 0x0614, 0xB368, 0xB368, 0x2A06,
- 0xB369, 0xB369, 0x0615, 0xB36A, 0xB36A, 0x2A07, 0xB36B, 0xB36B, 0x0616,
- 0xB36C, 0xB36D, 0x2A08, 0xB36E, 0xB36E, 0x0617, 0xB36F, 0xB36F, 0x2A0A,
- 0xB370, 0xB371, 0x0618, 0xB372, 0xB373, 0x2A0B, 0xB374, 0xB374, 0x061A,
- 0xB375, 0xB377, 0x2A0D, 0xB378, 0xB378, 0x061B, 0xB379, 0xB37F, 0x2A10,
- 0xB380, 0xB381, 0x061C, 0xB382, 0xB382, 0x2A17, 0xB383, 0xB385, 0x061E,
- 0xB386, 0xB38B, 0x2A18, 0xB38C, 0xB38C, 0x0621, 0xB38D, 0xB38F, 0x2A1E,
- 0xB390, 0xB390, 0x0622, 0xB391, 0xB393, 0x2A21, 0xB394, 0xB394, 0x0623,
- 0xB395, 0xB39F, 0x2A24, 0xB3A0, 0xB3A1, 0x0624, 0xB3A2, 0xB3A7, 0x2A2F,
- 0xB3A8, 0xB3A8, 0x0626, 0xB3A9, 0xB3AB, 0x2A35, 0xB3AC, 0xB3AC, 0x0627,
- 0xB3AD, 0xB3C3, 0x2A38, 0xB3C4, 0xB3C5, 0x0628, 0xB3C6, 0xB3C7, 0x2A4F,
- 0xB3C8, 0xB3C8, 0x062A, 0xB3C9, 0xB3CA, 0x2A51, 0xB3CB, 0xB3CC, 0x062B,
- 0xB3CD, 0xB3CD, 0x2A53, 0xB3CE, 0xB3CE, 0x062D, 0xB3CF, 0xB3CF, 0x2A54,
- 0xB3D0, 0xB3D0, 0x062E, 0xB3D1, 0xB3D3, 0x2A55, 0xB3D4, 0xB3D5, 0x062F,
- 0xB3D6, 0xB3D6, 0x2A58, 0xB3D7, 0xB3D7, 0x0631, 0xB3D8, 0xB3D8, 0x2A59,
- 0xB3D9, 0xB3D9, 0x0632, 0xB3DA, 0xB3DA, 0x2A5A, 0xB3DB, 0xB3DB, 0x0633,
- 0xB3DC, 0xB3DC, 0x2A5B, 0xB3DD, 0xB3DD, 0x0634, 0xB3DE, 0xB3DF, 0x2A5C,
- 0xB3E0, 0xB3E0, 0x0635, 0xB3E1, 0xB3E3, 0x2A5E, 0xB3E4, 0xB3E4, 0x0636,
- 0xB3E5, 0xB3E7, 0x2A61, 0xB3E8, 0xB3E8, 0x0637, 0xB3E9, 0xB3FB, 0x2A64,
- 0xB3FC, 0xB3FC, 0x0638, 0xB3FD, 0xB3FF, 0x2A77, 0xB400, 0xB40F, 0x2A7A,
- 0xB410, 0xB410, 0x0639, 0xB411, 0xB417, 0x2A8A, 0xB418, 0xB418, 0x063A,
- 0xB419, 0xB41B, 0x2A91, 0xB41C, 0xB41C, 0x063B, 0xB41D, 0xB41F, 0x2A94,
- 0xB420, 0xB420, 0x063C, 0xB421, 0xB427, 0x2A97, 0xB428, 0xB429, 0x063D,
- 0xB42A, 0xB42A, 0x2A9E, 0xB42B, 0xB42B, 0x063F, 0xB42C, 0xB433, 0x2A9F,
- 0xB434, 0xB434, 0x0640, 0xB435, 0xB44F, 0x2AA7, 0xB450, 0xB451, 0x0641,
- 0xB452, 0xB453, 0x2AC2, 0xB454, 0xB454, 0x0643, 0xB455, 0xB457, 0x2AC4,
- 0xB458, 0xB458, 0x0644, 0xB459, 0xB45F, 0x2AC7, 0xB460, 0xB461, 0x0645,
- 0xB462, 0xB462, 0x2ACE, 0xB463, 0xB463, 0x0647, 0xB464, 0xB464, 0x2ACF,
- 0xB465, 0xB465, 0x0648, 0xB466, 0xB46B, 0x2AD0, 0xB46C, 0xB46C, 0x0649,
- 0xB46D, 0xB47F, 0x2AD6, 0xB480, 0xB480, 0x064A, 0xB481, 0xB487, 0x2AE9,
- 0xB488, 0xB488, 0x064B, 0xB489, 0xB49C, 0x2AF0, 0xB49D, 0xB49D, 0x064C,
- 0xB49E, 0xB4A3, 0x2B04, 0xB4A4, 0xB4A4, 0x064D, 0xB4A5, 0xB4A7, 0x2B0A,
- 0xB4A8, 0xB4A8, 0x064E, 0xB4A9, 0xB4AB, 0x2B0D, 0xB4AC, 0xB4AC, 0x064F,
- 0xB4AD, 0xB4B4, 0x2B10, 0xB4B5, 0xB4B5, 0x0650, 0xB4B6, 0xB4B6, 0x2B18,
- 0xB4B7, 0xB4B7, 0x0651, 0xB4B8, 0xB4B8, 0x2B19, 0xB4B9, 0xB4B9, 0x0652,
- 0xB4BA, 0xB4BF, 0x2B1A, 0xB4C0, 0xB4C0, 0x0653, 0xB4C1, 0xB4C3, 0x2B20,
- 0xB4C4, 0xB4C4, 0x0654, 0xB4C5, 0xB4C7, 0x2B23, 0xB4C8, 0xB4C8, 0x0655,
- 0xB4C9, 0xB4CF, 0x2B26, 0xB4D0, 0xB4D0, 0x0656, 0xB4D1, 0xB4D4, 0x2B2D,
- 0xB4D5, 0xB4D5, 0x0657, 0xB4D6, 0xB4DB, 0x2B31, 0xB4DC, 0xB4DD, 0x0658,
- 0xB4DE, 0xB4DF, 0x2B37, 0xB4E0, 0xB4E0, 0x065A, 0xB4E1, 0xB4E2, 0x2B39,
- 0xB4E3, 0xB4E4, 0x065B, 0xB4E5, 0xB4E5, 0x2B3B, 0xB4E6, 0xB4E6, 0x065D,
- 0xB4E7, 0xB4EB, 0x2B3C, 0xB4EC, 0xB4ED, 0x065E, 0xB4EE, 0xB4EE, 0x2B41,
- 0xB4EF, 0xB4EF, 0x0660, 0xB4F0, 0xB4F0, 0x2B42, 0xB4F1, 0xB4F1, 0x0661,
- 0xB4F2, 0xB4F7, 0x2B43, 0xB4F8, 0xB4F8, 0x0662, 0xB4F9, 0xB4FF, 0x2B49,
- 0xB500, 0xB513, 0x2B50, 0xB514, 0xB515, 0x0663, 0xB516, 0xB517, 0x2B64,
- 0xB518, 0xB518, 0x0665, 0xB519, 0xB51A, 0x2B66, 0xB51B, 0xB51C, 0x0666,
- 0xB51D, 0xB523, 0x2B68, 0xB524, 0xB525, 0x0668, 0xB526, 0xB526, 0x2B6F,
- 0xB527, 0xB52A, 0x066A, 0xB52B, 0xB52F, 0x2B70, 0xB530, 0xB531, 0x066E,
- 0xB532, 0xB533, 0x2B75, 0xB534, 0xB534, 0x0670, 0xB535, 0xB537, 0x2B77,
- 0xB538, 0xB538, 0x0671, 0xB539, 0xB53F, 0x2B7A, 0xB540, 0xB541, 0x0672,
- 0xB542, 0xB542, 0x2B81, 0xB543, 0xB545, 0x0674, 0xB546, 0xB54A, 0x2B82,
- 0xB54B, 0xB54D, 0x0677, 0xB54E, 0xB54F, 0x2B87, 0xB550, 0xB550, 0x067A,
- 0xB551, 0xB553, 0x2B89, 0xB554, 0xB554, 0x067B, 0xB555, 0xB55B, 0x2B8C,
- 0xB55C, 0xB55D, 0x067C, 0xB55E, 0xB55E, 0x2B93, 0xB55F, 0xB561, 0x067E,
- 0xB562, 0xB59F, 0x2B94, 0xB5A0, 0xB5A1, 0x0681, 0xB5A2, 0xB5A3, 0x2BD2,
- 0xB5A4, 0xB5A4, 0x0683, 0xB5A5, 0xB5A7, 0x2BD4, 0xB5A8, 0xB5A8, 0x0684,
- 0xB5A9, 0xB5A9, 0x2BD7, 0xB5AA, 0xB5AB, 0x0685, 0xB5AC, 0xB5AF, 0x2BD8,
- 0xB5B0, 0xB5B1, 0x0687, 0xB5B2, 0xB5B2, 0x2BDC, 0xB5B3, 0xB5B5, 0x0689,
- 0xB5B6, 0xB5BA, 0x2BDD, 0xB5BB, 0xB5BD, 0x068C, 0xB5BE, 0xB5BF, 0x2BE2,
- 0xB5C0, 0xB5C0, 0x068F, 0xB5C1, 0xB5C3, 0x2BE4, 0xB5C4, 0xB5C4, 0x0690,
- 0xB5C5, 0xB5CB, 0x2BE7, 0xB5CC, 0xB5CD, 0x0691, 0xB5CE, 0xB5CE, 0x2BEE,
- 0xB5CF, 0xB5D1, 0x0693, 0xB5D2, 0xB5D7, 0x2BEF, 0xB5D8, 0xB5D8, 0x0696,
- 0xB5D9, 0xB5EB, 0x2BF5, 0xB5EC, 0xB5EC, 0x0697, 0xB5ED, 0xB5FF, 0x2C08,
- 0xB600, 0xB60F, 0x2C1B, 0xB610, 0xB611, 0x0698, 0xB612, 0xB613, 0x2C2B,
- 0xB614, 0xB614, 0x069A, 0xB615, 0xB617, 0x2C2D, 0xB618, 0xB618, 0x069B,
- 0xB619, 0xB624, 0x2C30, 0xB625, 0xB625, 0x069C, 0xB626, 0xB62B, 0x2C3C,
- 0xB62C, 0xB62C, 0x069D, 0xB62D, 0xB633, 0x2C42, 0xB634, 0xB634, 0x069E,
- 0xB635, 0xB647, 0x2C49, 0xB648, 0xB648, 0x069F, 0xB649, 0xB663, 0x2C5C,
- 0xB664, 0xB664, 0x06A0, 0xB665, 0xB667, 0x2C77, 0xB668, 0xB668, 0x06A1,
- 0xB669, 0xB69B, 0x2C7A, 0xB69C, 0xB69D, 0x06A2, 0xB69E, 0xB69F, 0x2CAD,
- 0xB6A0, 0xB6A0, 0x06A4, 0xB6A1, 0xB6A3, 0x2CAF, 0xB6A4, 0xB6A4, 0x06A5,
- 0xB6A5, 0xB6AA, 0x2CB2, 0xB6AB, 0xB6AC, 0x06A6, 0xB6AD, 0xB6B0, 0x2CB8,
- 0xB6B1, 0xB6B1, 0x06A8, 0xB6B2, 0xB6D3, 0x2CBC, 0xB6D4, 0xB6D4, 0x06A9,
- 0xB6D5, 0xB6EF, 0x2CDE, 0xB6F0, 0xB6F0, 0x06AA, 0xB6F1, 0xB6F3, 0x2CF9,
- 0xB6F4, 0xB6F4, 0x06AB, 0xB6F5, 0xB6F7, 0x2CFC, 0xB6F8, 0xB6F8, 0x06AC,
- 0xB6F9, 0xB6FF, 0x2CFF, 0xB700, 0xB701, 0x06AD, 0xB702, 0xB704, 0x2D06,
- 0xB705, 0xB705, 0x06AF, 0xB706, 0xB727, 0x2D09, 0xB728, 0xB729, 0x06B0,
- 0xB72A, 0xB72B, 0x2D2B, 0xB72C, 0xB72C, 0x06B2, 0xB72D, 0xB72E, 0x2D2D,
- 0xB72F, 0xB730, 0x06B3, 0xB731, 0xB737, 0x2D2F, 0xB738, 0xB739, 0x06B5,
- 0xB73A, 0xB73A, 0x2D36, 0xB73B, 0xB73B, 0x06B7, 0xB73C, 0xB743, 0x2D37,
- 0xB744, 0xB744, 0x06B8, 0xB745, 0xB747, 0x2D3F, 0xB748, 0xB748, 0x06B9,
- 0xB749, 0xB74B, 0x2D42, 0xB74C, 0xB74C, 0x06BA, 0xB74D, 0xB753, 0x2D45,
- 0xB754, 0xB755, 0x06BB, 0xB756, 0xB75F, 0x2D4C, 0xB760, 0xB760, 0x06BD,
- 0xB761, 0xB763, 0x2D56, 0xB764, 0xB764, 0x06BE, 0xB765, 0xB767, 0x2D59,
- 0xB768, 0xB768, 0x06BF, 0xB769, 0xB76F, 0x2D5C, 0xB770, 0xB771, 0x06C0,
- 0xB772, 0xB772, 0x2D63, 0xB773, 0xB773, 0x06C2, 0xB774, 0xB774, 0x2D64,
- 0xB775, 0xB775, 0x06C3, 0xB776, 0xB77B, 0x2D65, 0xB77C, 0xB77D, 0x06C4,
- 0xB77E, 0xB77F, 0x2D6B, 0xB780, 0xB780, 0x06C6, 0xB781, 0xB783, 0x2D6D,
- 0xB784, 0xB784, 0x06C7, 0xB785, 0xB78B, 0x2D70, 0xB78C, 0xB78D, 0x06C8,
- 0xB78E, 0xB78E, 0x2D77, 0xB78F, 0xB792, 0x06CA, 0xB793, 0xB795, 0x2D78,
- 0xB796, 0xB799, 0x06CE, 0xB79A, 0xB79B, 0x2D7B, 0xB79C, 0xB79C, 0x06D2,
- 0xB79D, 0xB79F, 0x2D7D, 0xB7A0, 0xB7A0, 0x06D3, 0xB7A1, 0xB7A7, 0x2D80,
- 0xB7A8, 0xB7A9, 0x06D4, 0xB7AA, 0xB7AA, 0x2D87, 0xB7AB, 0xB7AD, 0x06D6,
- 0xB7AE, 0xB7B3, 0x2D88, 0xB7B4, 0xB7B5, 0x06D9, 0xB7B6, 0xB7B7, 0x2D8E,
- 0xB7B8, 0xB7B8, 0x06DB, 0xB7B9, 0xB7C6, 0x2D90, 0xB7C7, 0xB7C7, 0x06DC,
- 0xB7C8, 0xB7C8, 0x2D9E, 0xB7C9, 0xB7C9, 0x06DD, 0xB7CA, 0xB7EB, 0x2D9F,
- 0xB7EC, 0xB7ED, 0x06DE, 0xB7EE, 0xB7EF, 0x2DC1, 0xB7F0, 0xB7F0, 0x06E0,
- 0xB7F1, 0xB7F3, 0x2DC3, 0xB7F4, 0xB7F4, 0x06E1, 0xB7F5, 0xB7FB, 0x2DC6,
- 0xB7FC, 0xB7FD, 0x06E2, 0xB7FE, 0xB7FE, 0x2DCD, 0xB7FF, 0xB7FF, 0x06E4,
- 0xB800, 0xB801, 0x06E5, 0xB802, 0xB806, 0x2DCE, 0xB807, 0xB809, 0x06E7,
- 0xB80A, 0xB80B, 0x2DD3, 0xB80C, 0xB80C, 0x06EA, 0xB80D, 0xB80F, 0x2DD5,
- 0xB810, 0xB810, 0x06EB, 0xB811, 0xB817, 0x2DD8, 0xB818, 0xB819, 0x06EC,
- 0xB81A, 0xB81A, 0x2DDF, 0xB81B, 0xB81B, 0x06EE, 0xB81C, 0xB81C, 0x2DE0,
- 0xB81D, 0xB81D, 0x06EF, 0xB81E, 0xB823, 0x2DE1, 0xB824, 0xB825, 0x06F0,
- 0xB826, 0xB827, 0x2DE7, 0xB828, 0xB828, 0x06F2, 0xB829, 0xB82B, 0x2DE9,
- 0xB82C, 0xB82C, 0x06F3, 0xB82D, 0xB833, 0x2DEC, 0xB834, 0xB835, 0x06F4,
- 0xB836, 0xB836, 0x2DF3, 0xB837, 0xB839, 0x06F6, 0xB83A, 0xB83F, 0x2DF4,
- 0xB840, 0xB840, 0x06F9, 0xB841, 0xB843, 0x2DFA, 0xB844, 0xB844, 0x06FA,
- 0xB845, 0xB850, 0x2DFD, 0xB851, 0xB851, 0x06FB, 0xB852, 0xB852, 0x2E09,
- 0xB853, 0xB853, 0x06FC, 0xB854, 0xB85B, 0x2E0A, 0xB85C, 0xB85D, 0x06FD,
- 0xB85E, 0xB85F, 0x2E12, 0xB860, 0xB860, 0x06FF, 0xB861, 0xB863, 0x2E14,
- 0xB864, 0xB864, 0x0700, 0xB865, 0xB86B, 0x2E17, 0xB86C, 0xB86D, 0x0701,
- 0xB86E, 0xB86E, 0x2E1E, 0xB86F, 0xB86F, 0x0703, 0xB870, 0xB870, 0x2E1F,
- 0xB871, 0xB871, 0x0704, 0xB872, 0xB877, 0x2E20, 0xB878, 0xB878, 0x0705,
- 0xB879, 0xB87B, 0x2E26, 0xB87C, 0xB87C, 0x0706, 0xB87D, 0xB88C, 0x2E29,
- 0xB88D, 0xB88D, 0x0707, 0xB88E, 0xB8A7, 0x2E39, 0xB8A8, 0xB8A8, 0x0708,
- 0xB8A9, 0xB8AF, 0x2E53, 0xB8B0, 0xB8B0, 0x0709, 0xB8B1, 0xB8B3, 0x2E5A,
- 0xB8B4, 0xB8B4, 0x070A, 0xB8B5, 0xB8B7, 0x2E5D, 0xB8B8, 0xB8B8, 0x070B,
- 0xB8B9, 0xB8BF, 0x2E60, 0xB8C0, 0xB8C1, 0x070C, 0xB8C2, 0xB8C2, 0x2E67,
- 0xB8C3, 0xB8C3, 0x070E, 0xB8C4, 0xB8C4, 0x2E68, 0xB8C5, 0xB8C5, 0x070F,
- 0xB8C6, 0xB8CB, 0x2E69, 0xB8CC, 0xB8CC, 0x0710, 0xB8CD, 0xB8CF, 0x2E6F,
- 0xB8D0, 0xB8D0, 0x0711, 0xB8D1, 0xB8D3, 0x2E72, 0xB8D4, 0xB8D4, 0x0712,
- 0xB8D5, 0xB8DC, 0x2E75, 0xB8DD, 0xB8DD, 0x0713, 0xB8DE, 0xB8DE, 0x2E7D,
- 0xB8DF, 0xB8DF, 0x0714, 0xB8E0, 0xB8E0, 0x2E7E, 0xB8E1, 0xB8E1, 0x0715,
- 0xB8E2, 0xB8E7, 0x2E7F, 0xB8E8, 0xB8E9, 0x0716, 0xB8EA, 0xB8EB, 0x2E85,
- 0xB8EC, 0xB8EC, 0x0718, 0xB8ED, 0xB8EF, 0x2E87, 0xB8F0, 0xB8F0, 0x0719,
- 0xB8F1, 0xB8F7, 0x2E8A, 0xB8F8, 0xB8F9, 0x071A, 0xB8FA, 0xB8FA, 0x2E91,
- 0xB8FB, 0xB8FB, 0x071C, 0xB8FC, 0xB8FC, 0x2E92, 0xB8FD, 0xB8FD, 0x071D,
- 0xB8FE, 0xB8FF, 0x2E93, 0xB900, 0xB903, 0x2E95, 0xB904, 0xB904, 0x071E,
- 0xB905, 0xB917, 0x2E99, 0xB918, 0xB918, 0x071F, 0xB919, 0xB91F, 0x2EAC,
- 0xB920, 0xB920, 0x0720, 0xB921, 0xB93B, 0x2EB3, 0xB93C, 0xB93D, 0x0721,
- 0xB93E, 0xB93F, 0x2ECE, 0xB940, 0xB940, 0x0723, 0xB941, 0xB943, 0x2ED0,
- 0xB944, 0xB944, 0x0724, 0xB945, 0xB94B, 0x2ED3, 0xB94C, 0xB94C, 0x0725,
- 0xB94D, 0xB94E, 0x2EDA, 0xB94F, 0xB94F, 0x0726, 0xB950, 0xB950, 0x2EDC,
- 0xB951, 0xB951, 0x0727, 0xB952, 0xB957, 0x2EDD, 0xB958, 0xB959, 0x0728,
- 0xB95A, 0xB95B, 0x2EE3, 0xB95C, 0xB95C, 0x072A, 0xB95D, 0xB95F, 0x2EE5,
- 0xB960, 0xB960, 0x072B, 0xB961, 0xB967, 0x2EE8, 0xB968, 0xB969, 0x072C,
- 0xB96A, 0xB96A, 0x2EEF, 0xB96B, 0xB96B, 0x072E, 0xB96C, 0xB96C, 0x2EF0,
- 0xB96D, 0xB96D, 0x072F, 0xB96E, 0xB973, 0x2EF1, 0xB974, 0xB975, 0x0730,
- 0xB976, 0xB977, 0x2EF7, 0xB978, 0xB978, 0x0732, 0xB979, 0xB97B, 0x2EF9,
- 0xB97C, 0xB97C, 0x0733, 0xB97D, 0xB983, 0x2EFC, 0xB984, 0xB985, 0x0734,
- 0xB986, 0xB986, 0x2F03, 0xB987, 0xB987, 0x0736, 0xB988, 0xB988, 0x2F04,
- 0xB989, 0xB98A, 0x0737, 0xB98B, 0xB98C, 0x2F05, 0xB98D, 0xB98E, 0x0739,
- 0xB98F, 0xB9AB, 0x2F07, 0xB9AC, 0xB9AD, 0x073B, 0xB9AE, 0xB9AF, 0x2F24,
- 0xB9B0, 0xB9B0, 0x073D, 0xB9B1, 0xB9B3, 0x2F26, 0xB9B4, 0xB9B4, 0x073E,
- 0xB9B5, 0xB9BB, 0x2F29, 0xB9BC, 0xB9BD, 0x073F, 0xB9BE, 0xB9BE, 0x2F30,
- 0xB9BF, 0xB9BF, 0x0741, 0xB9C0, 0xB9C0, 0x2F31, 0xB9C1, 0xB9C1, 0x0742,
- 0xB9C2, 0xB9C7, 0x2F32, 0xB9C8, 0xB9C9, 0x0743, 0xB9CA, 0xB9CB, 0x2F38,
- 0xB9CC, 0xB9CC, 0x0745, 0xB9CD, 0xB9CD, 0x2F3A, 0xB9CE, 0xB9D2, 0x0746,
- 0xB9D3, 0xB9D7, 0x2F3B, 0xB9D8, 0xB9D9, 0x074B, 0xB9DA, 0xB9DA, 0x2F40,
- 0xB9DB, 0xB9DB, 0x074D, 0xB9DC, 0xB9DC, 0x2F41, 0xB9DD, 0xB9DE, 0x074E,
- 0xB9DF, 0xB9E0, 0x2F42, 0xB9E1, 0xB9E1, 0x0750, 0xB9E2, 0xB9E2, 0x2F44,
- 0xB9E3, 0xB9E5, 0x0751, 0xB9E6, 0xB9E7, 0x2F45, 0xB9E8, 0xB9E8, 0x0754,
- 0xB9E9, 0xB9EB, 0x2F47, 0xB9EC, 0xB9EC, 0x0755, 0xB9ED, 0xB9F3, 0x2F4A,
- 0xB9F4, 0xB9F5, 0x0756, 0xB9F6, 0xB9F6, 0x2F51, 0xB9F7, 0xB9FA, 0x0758,
- 0xB9FB, 0xB9FF, 0x2F52, 0xBA00, 0xBA01, 0x075C, 0xBA02, 0xBA07, 0x2F57,
- 0xBA08, 0xBA08, 0x075E, 0xBA09, 0xBA14, 0x2F5D, 0xBA15, 0xBA15, 0x075F,
- 0xBA16, 0xBA37, 0x2F69, 0xBA38, 0xBA39, 0x0760, 0xBA3A, 0xBA3B, 0x2F8B,
- 0xBA3C, 0xBA3C, 0x0762, 0xBA3D, 0xBA3F, 0x2F8D, 0xBA40, 0xBA40, 0x0763,
- 0xBA41, 0xBA41, 0x2F90, 0xBA42, 0xBA42, 0x0764, 0xBA43, 0xBA47, 0x2F91,
- 0xBA48, 0xBA49, 0x0765, 0xBA4A, 0xBA4A, 0x2F96, 0xBA4B, 0xBA4B, 0x0767,
- 0xBA4C, 0xBA4C, 0x2F97, 0xBA4D, 0xBA4E, 0x0768, 0xBA4F, 0xBA52, 0x2F98,
- 0xBA53, 0xBA55, 0x076A, 0xBA56, 0xBA57, 0x2F9C, 0xBA58, 0xBA58, 0x076D,
- 0xBA59, 0xBA5B, 0x2F9E, 0xBA5C, 0xBA5C, 0x076E, 0xBA5D, 0xBA63, 0x2FA1,
- 0xBA64, 0xBA65, 0x076F, 0xBA66, 0xBA66, 0x2FA8, 0xBA67, 0xBA69, 0x0771,
- 0xBA6A, 0xBA6F, 0x2FA9, 0xBA70, 0xBA71, 0x0774, 0xBA72, 0xBA73, 0x2FAF,
- 0xBA74, 0xBA74, 0x0776, 0xBA75, 0xBA77, 0x2FB1, 0xBA78, 0xBA78, 0x0777,
- 0xBA79, 0xBA82, 0x2FB4, 0xBA83, 0xBA85, 0x0778, 0xBA86, 0xBA86, 0x2FBE,
- 0xBA87, 0xBA87, 0x077B, 0xBA88, 0xBA8B, 0x2FBF, 0xBA8C, 0xBA8C, 0x077C,
- 0xBA8D, 0xBAA7, 0x2FC3, 0xBAA8, 0xBAA9, 0x077D, 0xBAAA, 0xBAAA, 0x2FDE,
- 0xBAAB, 0xBAAC, 0x077F, 0xBAAD, 0xBAAF, 0x2FDF, 0xBAB0, 0xBAB0, 0x0781,
- 0xBAB1, 0xBAB1, 0x2FE2, 0xBAB2, 0xBAB2, 0x0782, 0xBAB3, 0xBAB7, 0x2FE3,
- 0xBAB8, 0xBAB9, 0x0783, 0xBABA, 0xBABA, 0x2FE8, 0xBABB, 0xBABB, 0x0785,
- 0xBABC, 0xBABC, 0x2FE9, 0xBABD, 0xBABD, 0x0786, 0xBABE, 0xBAC3, 0x2FEA,
- 0xBAC4, 0xBAC4, 0x0787, 0xBAC5, 0xBAC7, 0x2FF0, 0xBAC8, 0xBAC8, 0x0788,
- 0xBAC9, 0xBAD7, 0x2FF3, 0xBAD8, 0xBAD9, 0x0789, 0xBADA, 0xBAFB, 0x3002,
- 0xBAFC, 0xBAFC, 0x078B, 0xBAFD, 0xBAFF, 0x3024, 0xBB00, 0xBB00, 0x078C,
- 0xBB01, 0xBB03, 0x3027, 0xBB04, 0xBB04, 0x078D, 0xBB05, 0xBB0C, 0x302A,
- 0xBB0D, 0xBB0D, 0x078E, 0xBB0E, 0xBB0E, 0x3032, 0xBB0F, 0xBB0F, 0x078F,
- 0xBB10, 0xBB10, 0x3033, 0xBB11, 0xBB11, 0x0790, 0xBB12, 0xBB17, 0x3034,
- 0xBB18, 0xBB18, 0x0791, 0xBB19, 0xBB1B, 0x303A, 0xBB1C, 0xBB1C, 0x0792,
- 0xBB1D, 0xBB1F, 0x303D, 0xBB20, 0xBB20, 0x0793, 0xBB21, 0xBB28, 0x3040,
- 0xBB29, 0xBB29, 0x0794, 0xBB2A, 0xBB2A, 0x3048, 0xBB2B, 0xBB2B, 0x0795,
- 0xBB2C, 0xBB33, 0x3049, 0xBB34, 0xBB36, 0x0796, 0xBB37, 0xBB37, 0x3051,
- 0xBB38, 0xBB38, 0x0799, 0xBB39, 0xBB3A, 0x3052, 0xBB3B, 0xBB3E, 0x079A,
- 0xBB3F, 0xBB43, 0x3054, 0xBB44, 0xBB45, 0x079E, 0xBB46, 0xBB46, 0x3059,
- 0xBB47, 0xBB47, 0x07A0, 0xBB48, 0xBB48, 0x305A, 0xBB49, 0xBB49, 0x07A1,
- 0xBB4A, 0xBB4C, 0x305B, 0xBB4D, 0xBB4D, 0x07A2, 0xBB4E, 0xBB4E, 0x305E,
- 0xBB4F, 0xBB50, 0x07A3, 0xBB51, 0xBB53, 0x305F, 0xBB54, 0xBB54, 0x07A5,
- 0xBB55, 0xBB57, 0x3062, 0xBB58, 0xBB58, 0x07A6, 0xBB59, 0xBB60, 0x3065,
- 0xBB61, 0xBB61, 0x07A7, 0xBB62, 0xBB62, 0x306D, 0xBB63, 0xBB63, 0x07A8,
- 0xBB64, 0xBB6B, 0x306E, 0xBB6C, 0xBB6C, 0x07A9, 0xBB6D, 0xBB87, 0x3076,
- 0xBB88, 0xBB88, 0x07AA, 0xBB89, 0xBB8B, 0x3091, 0xBB8C, 0xBB8C, 0x07AB,
- 0xBB8D, 0xBB8F, 0x3094, 0xBB90, 0xBB90, 0x07AC, 0xBB91, 0xBBA3, 0x3097,
- 0xBBA4, 0xBBA4, 0x07AD, 0xBBA5, 0xBBA7, 0x30AA, 0xBBA8, 0xBBA8, 0x07AE,
- 0xBBA9, 0xBBAB, 0x30AD, 0xBBAC, 0xBBAC, 0x07AF, 0xBBAD, 0xBBB3, 0x30B0,
- 0xBBB4, 0xBBB4, 0x07B0, 0xBBB5, 0xBBB6, 0x30B7, 0xBBB7, 0xBBB7, 0x07B1,
- 0xBBB8, 0xBBBF, 0x30B9, 0xBBC0, 0xBBC0, 0x07B2, 0xBBC1, 0xBBC3, 0x30C1,
- 0xBBC4, 0xBBC4, 0x07B3, 0xBBC5, 0xBBC7, 0x30C4, 0xBBC8, 0xBBC8, 0x07B4,
- 0xBBC9, 0xBBCF, 0x30C7, 0xBBD0, 0xBBD0, 0x07B5, 0xBBD1, 0xBBD2, 0x30CE,
- 0xBBD3, 0xBBD3, 0x07B6, 0xBBD4, 0xBBF7, 0x30D0, 0xBBF8, 0xBBF9, 0x07B7,
- 0xBBFA, 0xBBFB, 0x30F4, 0xBBFC, 0xBBFC, 0x07B9, 0xBBFD, 0xBBFE, 0x30F6,
- 0xBBFF, 0xBBFF, 0x07BA, 0xBC00, 0xBC00, 0x07BB, 0xBC01, 0xBC01, 0x30F8,
- 0xBC02, 0xBC02, 0x07BC, 0xBC03, 0xBC07, 0x30F9, 0xBC08, 0xBC09, 0x07BD,
- 0xBC0A, 0xBC0A, 0x30FE, 0xBC0B, 0xBC0D, 0x07BF, 0xBC0E, 0xBC0E, 0x30FF,
- 0xBC0F, 0xBC0F, 0x07C2, 0xBC10, 0xBC10, 0x3100, 0xBC11, 0xBC11, 0x07C3,
- 0xBC12, 0xBC13, 0x3101, 0xBC14, 0xBC18, 0x07C4, 0xBC19, 0xBC1A, 0x3103,
- 0xBC1B, 0xBC1F, 0x07C9, 0xBC20, 0xBC23, 0x3105, 0xBC24, 0xBC25, 0x07CE,
- 0xBC26, 0xBC26, 0x3109, 0xBC27, 0xBC27, 0x07D0, 0xBC28, 0xBC28, 0x310A,
- 0xBC29, 0xBC29, 0x07D1, 0xBC2A, 0xBC2C, 0x310B, 0xBC2D, 0xBC2D, 0x07D2,
- 0xBC2E, 0xBC2F, 0x310E, 0xBC30, 0xBC31, 0x07D3, 0xBC32, 0xBC33, 0x3110,
- 0xBC34, 0xBC34, 0x07D5, 0xBC35, 0xBC37, 0x3112, 0xBC38, 0xBC38, 0x07D6,
- 0xBC39, 0xBC3F, 0x3115, 0xBC40, 0xBC41, 0x07D7, 0xBC42, 0xBC42, 0x311C,
- 0xBC43, 0xBC45, 0x07D9, 0xBC46, 0xBC48, 0x311D, 0xBC49, 0xBC49, 0x07DC,
- 0xBC4A, 0xBC4B, 0x3120, 0xBC4C, 0xBC4D, 0x07DD, 0xBC4E, 0xBC4F, 0x3122,
- 0xBC50, 0xBC50, 0x07DF, 0xBC51, 0xBC5C, 0x3124, 0xBC5D, 0xBC5D, 0x07E0,
- 0xBC5E, 0xBC83, 0x3130, 0xBC84, 0xBC85, 0x07E1, 0xBC86, 0xBC87, 0x3156,
- 0xBC88, 0xBC88, 0x07E3, 0xBC89, 0xBC8A, 0x3158, 0xBC8B, 0xBC8C, 0x07E4,
- 0xBC8D, 0xBC8D, 0x315A, 0xBC8E, 0xBC8E, 0x07E6, 0xBC8F, 0xBC93, 0x315B,
- 0xBC94, 0xBC95, 0x07E7, 0xBC96, 0xBC96, 0x3160, 0xBC97, 0xBC97, 0x07E9,
- 0xBC98, 0xBC98, 0x3161, 0xBC99, 0xBC9A, 0x07EA, 0xBC9B, 0xBC9F, 0x3162,
- 0xBCA0, 0xBCA1, 0x07EC, 0xBCA2, 0xBCA3, 0x3167, 0xBCA4, 0xBCA4, 0x07EE,
- 0xBCA5, 0xBCA6, 0x3169, 0xBCA7, 0xBCA8, 0x07EF, 0xBCA9, 0xBCAF, 0x316B,
- 0xBCB0, 0xBCB1, 0x07F1, 0xBCB2, 0xBCB2, 0x3172, 0xBCB3, 0xBCB5, 0x07F3,
- 0xBCB6, 0xBCBB, 0x3173, 0xBCBC, 0xBCBD, 0x07F6, 0xBCBE, 0xBCBF, 0x3179,
- 0xBCC0, 0xBCC0, 0x07F8, 0xBCC1, 0xBCC3, 0x317B, 0xBCC4, 0xBCC4, 0x07F9,
- 0xBCC5, 0xBCCC, 0x317E, 0xBCCD, 0xBCCD, 0x07FA, 0xBCCE, 0xBCCE, 0x3186,
- 0xBCCF, 0xBCD1, 0x07FB, 0xBCD2, 0xBCD4, 0x3187, 0xBCD5, 0xBCD5, 0x07FE,
- 0xBCD6, 0xBCD7, 0x318A, 0xBCD8, 0xBCD8, 0x07FF, 0xBCD9, 0xBCDB, 0x318C,
- 0xBCDC, 0xBCDC, 0x0800, 0xBCDD, 0xBCF3, 0x318F, 0xBCF4, 0xBCF6, 0x0801,
- 0xBCF7, 0xBCF7, 0x31A6, 0xBCF8, 0xBCF8, 0x0804, 0xBCF9, 0xBCFB, 0x31A7,
- 0xBCFC, 0xBCFC, 0x0805, 0xBCFD, 0xBCFF, 0x31AA, 0xBD00, 0xBD03, 0x31AD,
- 0xBD04, 0xBD05, 0x0806, 0xBD06, 0xBD06, 0x31B1, 0xBD07, 0xBD07, 0x0808,
- 0xBD08, 0xBD08, 0x31B2, 0xBD09, 0xBD09, 0x0809, 0xBD0A, 0xBD0F, 0x31B3,
- 0xBD10, 0xBD10, 0x080A, 0xBD11, 0xBD13, 0x31B9, 0xBD14, 0xBD14, 0x080B,
- 0xBD15, 0xBD23, 0x31BC, 0xBD24, 0xBD24, 0x080C, 0xBD25, 0xBD2B, 0x31CB,
- 0xBD2C, 0xBD2C, 0x080D, 0xBD2D, 0xBD3F, 0x31D2, 0xBD40, 0xBD40, 0x080E,
- 0xBD41, 0xBD47, 0x31E5, 0xBD48, 0xBD49, 0x080F, 0xBD4A, 0xBD4B, 0x31EC,
- 0xBD4C, 0xBD4C, 0x0811, 0xBD4D, 0xBD4F, 0x31EE, 0xBD50, 0xBD50, 0x0812,
- 0xBD51, 0xBD57, 0x31F1, 0xBD58, 0xBD59, 0x0813, 0xBD5A, 0xBD63, 0x31F8,
- 0xBD64, 0xBD64, 0x0815, 0xBD65, 0xBD67, 0x3202, 0xBD68, 0xBD68, 0x0816,
- 0xBD69, 0xBD7F, 0x3205, 0xBD80, 0xBD81, 0x0817, 0xBD82, 0xBD83, 0x321C,
- 0xBD84, 0xBD84, 0x0819, 0xBD85, 0xBD86, 0x321E, 0xBD87, 0xBD8A, 0x081A,
- 0xBD8B, 0xBD8F, 0x3220, 0xBD90, 0xBD91, 0x081E, 0xBD92, 0xBD92, 0x3225,
- 0xBD93, 0xBD93, 0x0820, 0xBD94, 0xBD94, 0x3226, 0xBD95, 0xBD95, 0x0821,
- 0xBD96, 0xBD98, 0x3227, 0xBD99, 0xBD9A, 0x0822, 0xBD9B, 0xBD9B, 0x322A,
- 0xBD9C, 0xBD9C, 0x0824, 0xBD9D, 0xBDA3, 0x322B, 0xBDA4, 0xBDA4, 0x0825,
- 0xBDA5, 0xBDAF, 0x3232, 0xBDB0, 0xBDB0, 0x0826, 0xBDB1, 0xBDB7, 0x323D,
- 0xBDB8, 0xBDB8, 0x0827, 0xBDB9, 0xBDD3, 0x3244, 0xBDD4, 0xBDD5, 0x0828,
- 0xBDD6, 0xBDD7, 0x325F, 0xBDD8, 0xBDD8, 0x082A, 0xBDD9, 0xBDDB, 0x3261,
- 0xBDDC, 0xBDDC, 0x082B, 0xBDDD, 0xBDE8, 0x3264, 0xBDE9, 0xBDE9, 0x082C,
- 0xBDEA, 0xBDEF, 0x3270, 0xBDF0, 0xBDF0, 0x082D, 0xBDF1, 0xBDF3, 0x3276,
- 0xBDF4, 0xBDF4, 0x082E, 0xBDF5, 0xBDF7, 0x3279, 0xBDF8, 0xBDF8, 0x082F,
- 0xBDF9, 0xBDFF, 0x327C, 0xBE00, 0xBE00, 0x0830, 0xBE01, 0xBE02, 0x3283,
- 0xBE03, 0xBE03, 0x0831, 0xBE04, 0xBE04, 0x3285, 0xBE05, 0xBE05, 0x0832,
- 0xBE06, 0xBE0B, 0x3286, 0xBE0C, 0xBE0D, 0x0833, 0xBE0E, 0xBE0F, 0x328C,
- 0xBE10, 0xBE10, 0x0835, 0xBE11, 0xBE13, 0x328E, 0xBE14, 0xBE14, 0x0836,
- 0xBE15, 0xBE1B, 0x3291, 0xBE1C, 0xBE1D, 0x0837, 0xBE1E, 0xBE1E, 0x3298,
- 0xBE1F, 0xBE1F, 0x0839, 0xBE20, 0xBE43, 0x3299, 0xBE44, 0xBE45, 0x083A,
- 0xBE46, 0xBE47, 0x32BD, 0xBE48, 0xBE48, 0x083C, 0xBE49, 0xBE4B, 0x32BF,
- 0xBE4C, 0xBE4C, 0x083D, 0xBE4D, 0xBE4D, 0x32C2, 0xBE4E, 0xBE4E, 0x083E,
- 0xBE4F, 0xBE53, 0x32C3, 0xBE54, 0xBE55, 0x083F, 0xBE56, 0xBE56, 0x32C8,
- 0xBE57, 0xBE57, 0x0841, 0xBE58, 0xBE58, 0x32C9, 0xBE59, 0xBE5B, 0x0842,
- 0xBE5C, 0xBE5F, 0x32CA, 0xBE60, 0xBE61, 0x0845, 0xBE62, 0xBE63, 0x32CE,
- 0xBE64, 0xBE64, 0x0847, 0xBE65, 0xBE67, 0x32D0, 0xBE68, 0xBE68, 0x0848,
- 0xBE69, 0xBE69, 0x32D3, 0xBE6A, 0xBE6A, 0x0849, 0xBE6B, 0xBE6F, 0x32D4,
- 0xBE70, 0xBE71, 0x084A, 0xBE72, 0xBE72, 0x32D9, 0xBE73, 0xBE75, 0x084C,
- 0xBE76, 0xBE7A, 0x32DA, 0xBE7B, 0xBE7D, 0x084F, 0xBE7E, 0xBE7F, 0x32DF,
- 0xBE80, 0xBE80, 0x0852, 0xBE81, 0xBE83, 0x32E1, 0xBE84, 0xBE84, 0x0853,
- 0xBE85, 0xBE8B, 0x32E4, 0xBE8C, 0xBE8D, 0x0854, 0xBE8E, 0xBE8E, 0x32EB,
- 0xBE8F, 0xBE91, 0x0856, 0xBE92, 0xBE97, 0x32EC, 0xBE98, 0xBE99, 0x0859,
- 0xBE9A, 0xBEA7, 0x32F2, 0xBEA8, 0xBEA8, 0x085B, 0xBEA9, 0xBECF, 0x3300,
- 0xBED0, 0xBED1, 0x085C, 0xBED2, 0xBED3, 0x3327, 0xBED4, 0xBED4, 0x085E,
- 0xBED5, 0xBED6, 0x3329, 0xBED7, 0xBED8, 0x085F, 0xBED9, 0xBEDF, 0x332B,
- 0xBEE0, 0xBEE0, 0x0861, 0xBEE1, 0xBEE2, 0x3332, 0xBEE3, 0xBEE5, 0x0862,
- 0xBEE6, 0xBEEB, 0x3334, 0xBEEC, 0xBEEC, 0x0865, 0xBEED, 0xBEFF, 0x333A,
- 0xBF00, 0xBF00, 0x334D, 0xBF01, 0xBF01, 0x0866, 0xBF02, 0xBF07, 0x334E,
- 0xBF08, 0xBF09, 0x0867, 0xBF0A, 0xBF17, 0x3354, 0xBF18, 0xBF19, 0x0869,
- 0xBF1A, 0xBF1A, 0x3362, 0xBF1B, 0xBF1D, 0x086B, 0xBF1E, 0xBF3F, 0x3363,
- 0xBF40, 0xBF41, 0x086E, 0xBF42, 0xBF43, 0x3385, 0xBF44, 0xBF44, 0x0870,
- 0xBF45, 0xBF47, 0x3387, 0xBF48, 0xBF48, 0x0871, 0xBF49, 0xBF4F, 0x338A,
- 0xBF50, 0xBF51, 0x0872, 0xBF52, 0xBF54, 0x3391, 0xBF55, 0xBF55, 0x0874,
- 0xBF56, 0xBF93, 0x3394, 0xBF94, 0xBF94, 0x0875, 0xBF95, 0xBFAF, 0x33D2,
- 0xBFB0, 0xBFB0, 0x0876, 0xBFB1, 0xBFC4, 0x33ED, 0xBFC5, 0xBFC5, 0x0877,
- 0xBFC6, 0xBFCB, 0x3401, 0xBFCC, 0xBFCD, 0x0878, 0xBFCE, 0xBFCF, 0x3407,
- 0xBFD0, 0xBFD0, 0x087A, 0xBFD1, 0xBFD3, 0x3409, 0xBFD4, 0xBFD4, 0x087B,
- 0xBFD5, 0xBFDB, 0x340C, 0xBFDC, 0xBFDC, 0x087C, 0xBFDD, 0xBFDE, 0x3413,
- 0xBFDF, 0xBFDF, 0x087D, 0xBFE0, 0xBFE0, 0x3415, 0xBFE1, 0xBFE1, 0x087E,
- 0xBFE2, 0xBFFF, 0x3416, 0xC000, 0xC03B, 0x3434, 0xC03C, 0xC03C, 0x087F,
- 0xC03D, 0xC050, 0x3470, 0xC051, 0xC051, 0x0880, 0xC052, 0xC057, 0x3484,
- 0xC058, 0xC058, 0x0881, 0xC059, 0xC05B, 0x348A, 0xC05C, 0xC05C, 0x0882,
- 0xC05D, 0xC05F, 0x348D, 0xC060, 0xC060, 0x0883, 0xC061, 0xC067, 0x3490,
- 0xC068, 0xC069, 0x0884, 0xC06A, 0xC08F, 0x3497, 0xC090, 0xC091, 0x0886,
- 0xC092, 0xC093, 0x34BD, 0xC094, 0xC094, 0x0888, 0xC095, 0xC097, 0x34BF,
- 0xC098, 0xC098, 0x0889, 0xC099, 0xC09F, 0x34C2, 0xC0A0, 0xC0A1, 0x088A,
- 0xC0A2, 0xC0A2, 0x34C9, 0xC0A3, 0xC0A3, 0x088C, 0xC0A4, 0xC0A4, 0x34CA,
- 0xC0A5, 0xC0A5, 0x088D, 0xC0A6, 0xC0AB, 0x34CB, 0xC0AC, 0xC0AD, 0x088E,
- 0xC0AE, 0xC0AE, 0x34D1, 0xC0AF, 0xC0B0, 0x0890, 0xC0B1, 0xC0B2, 0x34D2,
- 0xC0B3, 0xC0B6, 0x0892, 0xC0B7, 0xC0BB, 0x34D4, 0xC0BC, 0xC0BD, 0x0896,
- 0xC0BE, 0xC0BE, 0x34D9, 0xC0BF, 0xC0C1, 0x0898, 0xC0C2, 0xC0C4, 0x34DA,
- 0xC0C5, 0xC0C5, 0x089B, 0xC0C6, 0xC0C7, 0x34DD, 0xC0C8, 0xC0C9, 0x089C,
- 0xC0CA, 0xC0CB, 0x34DF, 0xC0CC, 0xC0CC, 0x089E, 0xC0CD, 0xC0CF, 0x34E1,
- 0xC0D0, 0xC0D0, 0x089F, 0xC0D1, 0xC0D7, 0x34E4, 0xC0D8, 0xC0D9, 0x08A0,
- 0xC0DA, 0xC0DA, 0x34EB, 0xC0DB, 0xC0DD, 0x08A2, 0xC0DE, 0xC0E3, 0x34EC,
- 0xC0E4, 0xC0E5, 0x08A5, 0xC0E6, 0xC0E7, 0x34F2, 0xC0E8, 0xC0E8, 0x08A7,
- 0xC0E9, 0xC0EB, 0x34F4, 0xC0EC, 0xC0EC, 0x08A8, 0xC0ED, 0xC0F3, 0x34F7,
- 0xC0F4, 0xC0F5, 0x08A9, 0xC0F6, 0xC0F6, 0x34FE, 0xC0F7, 0xC0F7, 0x08AB,
- 0xC0F8, 0xC0F8, 0x34FF, 0xC0F9, 0xC0F9, 0x08AC, 0xC0FA, 0xC0FF, 0x3500,
- 0xC100, 0xC100, 0x08AD, 0xC101, 0xC103, 0x3506, 0xC104, 0xC104, 0x08AE,
- 0xC105, 0xC107, 0x3509, 0xC108, 0xC108, 0x08AF, 0xC109, 0xC10F, 0x350C,
- 0xC110, 0xC110, 0x08B0, 0xC111, 0xC114, 0x3513, 0xC115, 0xC115, 0x08B1,
- 0xC116, 0xC11B, 0x3517, 0xC11C, 0xC120, 0x08B2, 0xC121, 0xC122, 0x351D,
- 0xC123, 0xC124, 0x08B7, 0xC125, 0xC125, 0x351F, 0xC126, 0xC127, 0x08B9,
- 0xC128, 0xC12B, 0x3520, 0xC12C, 0xC12D, 0x08BB, 0xC12E, 0xC12E, 0x3524,
- 0xC12F, 0xC131, 0x08BD, 0xC132, 0xC135, 0x3525, 0xC136, 0xC136, 0x08C0,
- 0xC137, 0xC137, 0x3529, 0xC138, 0xC139, 0x08C1, 0xC13A, 0xC13B, 0x352A,
- 0xC13C, 0xC13C, 0x08C3, 0xC13D, 0xC13F, 0x352C, 0xC140, 0xC140, 0x08C4,
- 0xC141, 0xC147, 0x352F, 0xC148, 0xC149, 0x08C5, 0xC14A, 0xC14A, 0x3536,
- 0xC14B, 0xC14D, 0x08C7, 0xC14E, 0xC153, 0x3537, 0xC154, 0xC155, 0x08CA,
- 0xC156, 0xC157, 0x353D, 0xC158, 0xC158, 0x08CC, 0xC159, 0xC15B, 0x353F,
- 0xC15C, 0xC15C, 0x08CD, 0xC15D, 0xC163, 0x3542, 0xC164, 0xC165, 0x08CE,
- 0xC166, 0xC166, 0x3549, 0xC167, 0xC169, 0x08D0, 0xC16A, 0xC16F, 0x354A,
- 0xC170, 0xC170, 0x08D3, 0xC171, 0xC173, 0x3550, 0xC174, 0xC174, 0x08D4,
- 0xC175, 0xC177, 0x3553, 0xC178, 0xC178, 0x08D5, 0xC179, 0xC184, 0x3556,
- 0xC185, 0xC185, 0x08D6, 0xC186, 0xC18B, 0x3562, 0xC18C, 0xC18E, 0x08D7,
- 0xC18F, 0xC18F, 0x3568, 0xC190, 0xC190, 0x08DA, 0xC191, 0xC193, 0x3569,
- 0xC194, 0xC194, 0x08DB, 0xC195, 0xC195, 0x356C, 0xC196, 0xC196, 0x08DC,
- 0xC197, 0xC19B, 0x356D, 0xC19C, 0xC19D, 0x08DD, 0xC19E, 0xC19E, 0x3572,
- 0xC19F, 0xC19F, 0x08DF, 0xC1A0, 0xC1A0, 0x3573, 0xC1A1, 0xC1A1, 0x08E0,
- 0xC1A2, 0xC1A4, 0x3574, 0xC1A5, 0xC1A5, 0x08E1, 0xC1A6, 0xC1A7, 0x3577,
- 0xC1A8, 0xC1A9, 0x08E2, 0xC1AA, 0xC1AB, 0x3579, 0xC1AC, 0xC1AC, 0x08E4,
- 0xC1AD, 0xC1AF, 0x357B, 0xC1B0, 0xC1B0, 0x08E5, 0xC1B1, 0xC1BC, 0x357E,
- 0xC1BD, 0xC1BD, 0x08E6, 0xC1BE, 0xC1C3, 0x358A, 0xC1C4, 0xC1C4, 0x08E7,
- 0xC1C5, 0xC1C7, 0x3590, 0xC1C8, 0xC1C8, 0x08E8, 0xC1C9, 0xC1CB, 0x3593,
- 0xC1CC, 0xC1CC, 0x08E9, 0xC1CD, 0xC1D3, 0x3596, 0xC1D4, 0xC1D4, 0x08EA,
- 0xC1D5, 0xC1D6, 0x359D, 0xC1D7, 0xC1D8, 0x08EB, 0xC1D9, 0xC1DF, 0x359F,
- 0xC1E0, 0xC1E0, 0x08ED, 0xC1E1, 0xC1E3, 0x35A6, 0xC1E4, 0xC1E4, 0x08EE,
- 0xC1E5, 0xC1E7, 0x35A9, 0xC1E8, 0xC1E8, 0x08EF, 0xC1E9, 0xC1EF, 0x35AC,
- 0xC1F0, 0xC1F1, 0x08F0, 0xC1F2, 0xC1F2, 0x35B3, 0xC1F3, 0xC1F3, 0x08F2,
- 0xC1F4, 0xC1FB, 0x35B4, 0xC1FC, 0xC1FD, 0x08F3, 0xC1FE, 0xC1FF, 0x35BC,
- 0xC200, 0xC200, 0x08F5, 0xC201, 0xC203, 0x35BE, 0xC204, 0xC204, 0x08F6,
- 0xC205, 0xC20B, 0x35C1, 0xC20C, 0xC20D, 0x08F7, 0xC20E, 0xC20E, 0x35C8,
- 0xC20F, 0xC20F, 0x08F9, 0xC210, 0xC210, 0x35C9, 0xC211, 0xC211, 0x08FA,
- 0xC212, 0xC217, 0x35CA, 0xC218, 0xC219, 0x08FB, 0xC21A, 0xC21B, 0x35D0,
- 0xC21C, 0xC21C, 0x08FD, 0xC21D, 0xC21E, 0x35D2, 0xC21F, 0xC220, 0x08FE,
- 0xC221, 0xC227, 0x35D4, 0xC228, 0xC229, 0x0900, 0xC22A, 0xC22A, 0x35DB,
- 0xC22B, 0xC22B, 0x0902, 0xC22C, 0xC22C, 0x35DC, 0xC22D, 0xC22D, 0x0903,
- 0xC22E, 0xC22E, 0x35DD, 0xC22F, 0xC22F, 0x0904, 0xC230, 0xC230, 0x35DE,
- 0xC231, 0xC232, 0x0905, 0xC233, 0xC233, 0x35DF, 0xC234, 0xC234, 0x0907,
- 0xC235, 0xC247, 0x35E0, 0xC248, 0xC248, 0x0908, 0xC249, 0xC24F, 0x35F3,
- 0xC250, 0xC251, 0x0909, 0xC252, 0xC253, 0x35FA, 0xC254, 0xC254, 0x090B,
- 0xC255, 0xC257, 0x35FC, 0xC258, 0xC258, 0x090C, 0xC259, 0xC25F, 0x35FF,
- 0xC260, 0xC260, 0x090D, 0xC261, 0xC264, 0x3606, 0xC265, 0xC265, 0x090E,
- 0xC266, 0xC26B, 0x360A, 0xC26C, 0xC26D, 0x090F, 0xC26E, 0xC26F, 0x3610,
- 0xC270, 0xC270, 0x0911, 0xC271, 0xC273, 0x3612, 0xC274, 0xC274, 0x0912,
- 0xC275, 0xC27B, 0x3615, 0xC27C, 0xC27D, 0x0913, 0xC27E, 0xC27E, 0x361C,
- 0xC27F, 0xC27F, 0x0915, 0xC280, 0xC280, 0x361D, 0xC281, 0xC281, 0x0916,
- 0xC282, 0xC287, 0x361E, 0xC288, 0xC289, 0x0917, 0xC28A, 0xC28F, 0x3624,
- 0xC290, 0xC290, 0x0919, 0xC291, 0xC297, 0x362A, 0xC298, 0xC298, 0x091A,
- 0xC299, 0xC29A, 0x3631, 0xC29B, 0xC29B, 0x091B, 0xC29C, 0xC29C, 0x3633,
- 0xC29D, 0xC29D, 0x091C, 0xC29E, 0xC2A3, 0x3634, 0xC2A4, 0xC2A5, 0x091D,
- 0xC2A6, 0xC2A7, 0x363A, 0xC2A8, 0xC2A8, 0x091F, 0xC2A9, 0xC2AB, 0x363C,
- 0xC2AC, 0xC2AD, 0x0920, 0xC2AE, 0xC2B3, 0x363F, 0xC2B4, 0xC2B5, 0x0922,
- 0xC2B6, 0xC2B6, 0x3645, 0xC2B7, 0xC2B7, 0x0924, 0xC2B8, 0xC2B8, 0x3646,
- 0xC2B9, 0xC2B9, 0x0925, 0xC2BA, 0xC2DB, 0x3647, 0xC2DC, 0xC2DD, 0x0926,
- 0xC2DE, 0xC2DF, 0x3669, 0xC2E0, 0xC2E0, 0x0928, 0xC2E1, 0xC2E2, 0x366B,
- 0xC2E3, 0xC2E4, 0x0929, 0xC2E5, 0xC2EA, 0x366D, 0xC2EB, 0xC2ED, 0x092B,
- 0xC2EE, 0xC2EE, 0x3673, 0xC2EF, 0xC2EF, 0x092E, 0xC2F0, 0xC2F0, 0x3674,
- 0xC2F1, 0xC2F1, 0x092F, 0xC2F2, 0xC2F5, 0x3675, 0xC2F6, 0xC2F6, 0x0930,
- 0xC2F7, 0xC2F7, 0x3679, 0xC2F8, 0xC2F9, 0x0931, 0xC2FA, 0xC2FA, 0x367A,
- 0xC2FB, 0xC2FC, 0x0933, 0xC2FD, 0xC2FF, 0x367B, 0xC300, 0xC300, 0x0935,
- 0xC301, 0xC307, 0x367E, 0xC308, 0xC309, 0x0936, 0xC30A, 0xC30B, 0x3685,
- 0xC30C, 0xC30D, 0x0938, 0xC30E, 0xC312, 0x3687, 0xC313, 0xC315, 0x093A,
- 0xC316, 0xC317, 0x368C, 0xC318, 0xC318, 0x093D, 0xC319, 0xC31B, 0x368E,
- 0xC31C, 0xC31C, 0x093E, 0xC31D, 0xC323, 0x3691, 0xC324, 0xC325, 0x093F,
- 0xC326, 0xC327, 0x3698, 0xC328, 0xC329, 0x0941, 0xC32A, 0xC344, 0x369A,
- 0xC345, 0xC345, 0x0943, 0xC346, 0xC367, 0x36B5, 0xC368, 0xC369, 0x0944,
- 0xC36A, 0xC36B, 0x36D7, 0xC36C, 0xC36C, 0x0946, 0xC36D, 0xC36F, 0x36D9,
- 0xC370, 0xC370, 0x0947, 0xC371, 0xC371, 0x36DC, 0xC372, 0xC372, 0x0948,
- 0xC373, 0xC377, 0x36DD, 0xC378, 0xC379, 0x0949, 0xC37A, 0xC37B, 0x36E2,
- 0xC37C, 0xC37D, 0x094B, 0xC37E, 0xC383, 0x36E4, 0xC384, 0xC384, 0x094D,
- 0xC385, 0xC387, 0x36EA, 0xC388, 0xC388, 0x094E, 0xC389, 0xC38B, 0x36ED,
- 0xC38C, 0xC38C, 0x094F, 0xC38D, 0xC3BF, 0x36F0, 0xC3C0, 0xC3C0, 0x0950,
- 0xC3C1, 0xC3D7, 0x3723, 0xC3D8, 0xC3D9, 0x0951, 0xC3DA, 0xC3DB, 0x373A,
- 0xC3DC, 0xC3DC, 0x0953, 0xC3DD, 0xC3DE, 0x373C, 0xC3DF, 0xC3E0, 0x0954,
- 0xC3E1, 0xC3E1, 0x373E, 0xC3E2, 0xC3E2, 0x0956, 0xC3E3, 0xC3E7, 0x373F,
- 0xC3E8, 0xC3E9, 0x0957, 0xC3EA, 0xC3EC, 0x3744, 0xC3ED, 0xC3ED, 0x0959,
- 0xC3EE, 0xC3F3, 0x3747, 0xC3F4, 0xC3F5, 0x095A, 0xC3F6, 0xC3F7, 0x374D,
- 0xC3F8, 0xC3F8, 0x095C, 0xC3F9, 0xC3FF, 0x374F, 0xC400, 0xC407, 0x3756,
- 0xC408, 0xC408, 0x095D, 0xC409, 0xC40F, 0x375E, 0xC410, 0xC410, 0x095E,
- 0xC411, 0xC423, 0x3765, 0xC424, 0xC424, 0x095F, 0xC425, 0xC42B, 0x3778,
- 0xC42C, 0xC42C, 0x0960, 0xC42D, 0xC42F, 0x377F, 0xC430, 0xC430, 0x0961,
- 0xC431, 0xC433, 0x3782, 0xC434, 0xC434, 0x0962, 0xC435, 0xC43B, 0x3785,
- 0xC43C, 0xC43D, 0x0963, 0xC43E, 0xC447, 0x378C, 0xC448, 0xC448, 0x0965,
- 0xC449, 0xC463, 0x3796, 0xC464, 0xC465, 0x0966, 0xC466, 0xC467, 0x37B1,
- 0xC468, 0xC468, 0x0968, 0xC469, 0xC46B, 0x37B3, 0xC46C, 0xC46C, 0x0969,
- 0xC46D, 0xC473, 0x37B6, 0xC474, 0xC475, 0x096A, 0xC476, 0xC478, 0x37BD,
- 0xC479, 0xC479, 0x096C, 0xC47A, 0xC47F, 0x37C0, 0xC480, 0xC480, 0x096D,
- 0xC481, 0xC493, 0x37C6, 0xC494, 0xC494, 0x096E, 0xC495, 0xC49B, 0x37D9,
- 0xC49C, 0xC49C, 0x096F, 0xC49D, 0xC4B7, 0x37E0, 0xC4B8, 0xC4B8, 0x0970,
- 0xC4B9, 0xC4BB, 0x37FB, 0xC4BC, 0xC4BC, 0x0971, 0xC4BD, 0xC4E8, 0x37FE,
- 0xC4E9, 0xC4E9, 0x0972, 0xC4EA, 0xC4EF, 0x382A, 0xC4F0, 0xC4F1, 0x0973,
- 0xC4F2, 0xC4F3, 0x3830, 0xC4F4, 0xC4F4, 0x0975, 0xC4F5, 0xC4F7, 0x3832,
- 0xC4F8, 0xC4F8, 0x0976, 0xC4F9, 0xC4F9, 0x3835, 0xC4FA, 0xC4FA, 0x0977,
- 0xC4FB, 0xC4FE, 0x3836, 0xC4FF, 0xC4FF, 0x0978, 0xC500, 0xC501, 0x0979,
- 0xC502, 0xC50B, 0x383A, 0xC50C, 0xC50C, 0x097B, 0xC50D, 0xC50F, 0x3844,
- 0xC510, 0xC510, 0x097C, 0xC511, 0xC513, 0x3847, 0xC514, 0xC514, 0x097D,
- 0xC515, 0xC51B, 0x384A, 0xC51C, 0xC51C, 0x097E, 0xC51D, 0xC527, 0x3851,
- 0xC528, 0xC529, 0x097F, 0xC52A, 0xC52B, 0x385C, 0xC52C, 0xC52C, 0x0981,
- 0xC52D, 0xC52F, 0x385E, 0xC530, 0xC530, 0x0982, 0xC531, 0xC537, 0x3861,
- 0xC538, 0xC539, 0x0983, 0xC53A, 0xC53A, 0x3868, 0xC53B, 0xC53B, 0x0985,
- 0xC53C, 0xC53C, 0x3869, 0xC53D, 0xC53D, 0x0986, 0xC53E, 0xC543, 0x386A,
- 0xC544, 0xC545, 0x0987, 0xC546, 0xC547, 0x3870, 0xC548, 0xC54A, 0x0989,
- 0xC54B, 0xC54B, 0x3872, 0xC54C, 0xC54E, 0x098C, 0xC54F, 0xC552, 0x3873,
- 0xC553, 0xC555, 0x098F, 0xC556, 0xC556, 0x3877, 0xC557, 0xC559, 0x0992,
- 0xC55A, 0xC55C, 0x3878, 0xC55D, 0xC55E, 0x0995, 0xC55F, 0xC55F, 0x387B,
- 0xC560, 0xC561, 0x0997, 0xC562, 0xC563, 0x387C, 0xC564, 0xC564, 0x0999,
- 0xC565, 0xC567, 0x387E, 0xC568, 0xC568, 0x099A, 0xC569, 0xC56F, 0x3881,
- 0xC570, 0xC571, 0x099B, 0xC572, 0xC572, 0x3888, 0xC573, 0xC575, 0x099D,
- 0xC576, 0xC57B, 0x3889, 0xC57C, 0xC57D, 0x09A0, 0xC57E, 0xC57F, 0x388F,
- 0xC580, 0xC580, 0x09A2, 0xC581, 0xC583, 0x3891, 0xC584, 0xC584, 0x09A3,
- 0xC585, 0xC586, 0x3894, 0xC587, 0xC587, 0x09A4, 0xC588, 0xC58B, 0x3896,
- 0xC58C, 0xC58D, 0x09A5, 0xC58E, 0xC58E, 0x389A, 0xC58F, 0xC58F, 0x09A7,
- 0xC590, 0xC590, 0x389B, 0xC591, 0xC591, 0x09A8, 0xC592, 0xC594, 0x389C,
- 0xC595, 0xC595, 0x09A9, 0xC596, 0xC596, 0x389F, 0xC597, 0xC598, 0x09AA,
- 0xC599, 0xC59B, 0x38A0, 0xC59C, 0xC59C, 0x09AC, 0xC59D, 0xC59F, 0x38A3,
- 0xC5A0, 0xC5A0, 0x09AD, 0xC5A1, 0xC5A8, 0x38A6, 0xC5A9, 0xC5A9, 0x09AE,
- 0xC5AA, 0xC5B3, 0x38AE, 0xC5B4, 0xC5B5, 0x09AF, 0xC5B6, 0xC5B7, 0x38B8,
- 0xC5B8, 0xC5B9, 0x09B1, 0xC5BA, 0xC5BA, 0x38BA, 0xC5BB, 0xC5BE, 0x09B3,
- 0xC5BF, 0xC5C3, 0x38BB, 0xC5C4, 0xC5CA, 0x09B7, 0xC5CB, 0xC5CB, 0x38C0,
- 0xC5CC, 0xC5CC, 0x09BE, 0xC5CD, 0xC5CD, 0x38C1, 0xC5CE, 0xC5CE, 0x09BF,
- 0xC5CF, 0xC5CF, 0x38C2, 0xC5D0, 0xC5D1, 0x09C0, 0xC5D2, 0xC5D3, 0x38C3,
- 0xC5D4, 0xC5D4, 0x09C2, 0xC5D5, 0xC5D7, 0x38C5, 0xC5D8, 0xC5D8, 0x09C3,
- 0xC5D9, 0xC5DF, 0x38C8, 0xC5E0, 0xC5E1, 0x09C4, 0xC5E2, 0xC5E2, 0x38CF,
- 0xC5E3, 0xC5E3, 0x09C6, 0xC5E4, 0xC5E4, 0x38D0, 0xC5E5, 0xC5E5, 0x09C7,
- 0xC5E6, 0xC5EB, 0x38D1, 0xC5EC, 0xC5EE, 0x09C8, 0xC5EF, 0xC5EF, 0x38D7,
- 0xC5F0, 0xC5F0, 0x09CB, 0xC5F1, 0xC5F3, 0x38D8, 0xC5F4, 0xC5F4, 0x09CC,
- 0xC5F5, 0xC5F5, 0x38DB, 0xC5F6, 0xC5F7, 0x09CD, 0xC5F8, 0xC5FB, 0x38DC,
- 0xC5FC, 0xC5FF, 0x09CF, 0xC600, 0xC601, 0x09D3, 0xC602, 0xC604, 0x38E0,
- 0xC605, 0xC608, 0x09D5, 0xC609, 0xC60B, 0x38E3, 0xC60C, 0xC60C, 0x09D9,
- 0xC60D, 0xC60F, 0x38E6, 0xC610, 0xC610, 0x09DA, 0xC611, 0xC617, 0x38E9,
- 0xC618, 0xC619, 0x09DB, 0xC61A, 0xC61A, 0x38F0, 0xC61B, 0xC61C, 0x09DD,
- 0xC61D, 0xC623, 0x38F1, 0xC624, 0xC625, 0x09DF, 0xC626, 0xC627, 0x38F8,
- 0xC628, 0xC628, 0x09E1, 0xC629, 0xC62B, 0x38FA, 0xC62C, 0xC62E, 0x09E2,
- 0xC62F, 0xC62F, 0x38FD, 0xC630, 0xC630, 0x09E5, 0xC631, 0xC632, 0x38FE,
- 0xC633, 0xC635, 0x09E6, 0xC636, 0xC636, 0x3900, 0xC637, 0xC637, 0x09E9,
- 0xC638, 0xC638, 0x3901, 0xC639, 0xC639, 0x09EA, 0xC63A, 0xC63A, 0x3902,
- 0xC63B, 0xC63B, 0x09EB, 0xC63C, 0xC63F, 0x3903, 0xC640, 0xC641, 0x09EC,
- 0xC642, 0xC643, 0x3907, 0xC644, 0xC644, 0x09EE, 0xC645, 0xC647, 0x3909,
- 0xC648, 0xC648, 0x09EF, 0xC649, 0xC64F, 0x390C, 0xC650, 0xC651, 0x09F0,
- 0xC652, 0xC652, 0x3913, 0xC653, 0xC655, 0x09F2, 0xC656, 0xC65B, 0x3914,
- 0xC65C, 0xC65D, 0x09F5, 0xC65E, 0xC65F, 0x391A, 0xC660, 0xC660, 0x09F7,
- 0xC661, 0xC66B, 0x391C, 0xC66C, 0xC66C, 0x09F8, 0xC66D, 0xC66E, 0x3927,
- 0xC66F, 0xC66F, 0x09F9, 0xC670, 0xC670, 0x3929, 0xC671, 0xC671, 0x09FA,
- 0xC672, 0xC677, 0x392A, 0xC678, 0xC679, 0x09FB, 0xC67A, 0xC67B, 0x3930,
- 0xC67C, 0xC67C, 0x09FD, 0xC67D, 0xC67F, 0x3932, 0xC680, 0xC680, 0x09FE,
- 0xC681, 0xC687, 0x3935, 0xC688, 0xC689, 0x09FF, 0xC68A, 0xC68A, 0x393C,
- 0xC68B, 0xC68B, 0x0A01, 0xC68C, 0xC68C, 0x393D, 0xC68D, 0xC68D, 0x0A02,
- 0xC68E, 0xC693, 0x393E, 0xC694, 0xC695, 0x0A03, 0xC696, 0xC697, 0x3944,
- 0xC698, 0xC698, 0x0A05, 0xC699, 0xC69B, 0x3946, 0xC69C, 0xC69C, 0x0A06,
- 0xC69D, 0xC6A3, 0x3949, 0xC6A4, 0xC6A5, 0x0A07, 0xC6A6, 0xC6A6, 0x3950,
- 0xC6A7, 0xC6A7, 0x0A09, 0xC6A8, 0xC6A8, 0x3951, 0xC6A9, 0xC6A9, 0x0A0A,
- 0xC6AA, 0xC6AF, 0x3952, 0xC6B0, 0xC6B1, 0x0A0B, 0xC6B2, 0xC6B3, 0x3958,
- 0xC6B4, 0xC6B4, 0x0A0D, 0xC6B5, 0xC6B7, 0x395A, 0xC6B8, 0xC6BA, 0x0A0E,
- 0xC6BB, 0xC6BF, 0x395D, 0xC6C0, 0xC6C1, 0x0A11, 0xC6C2, 0xC6C2, 0x3962,
- 0xC6C3, 0xC6C3, 0x0A13, 0xC6C4, 0xC6C4, 0x3963, 0xC6C5, 0xC6C5, 0x0A14,
- 0xC6C6, 0xC6CB, 0x3964, 0xC6CC, 0xC6CD, 0x0A15, 0xC6CE, 0xC6CF, 0x396A,
- 0xC6D0, 0xC6D0, 0x0A17, 0xC6D1, 0xC6D3, 0x396C, 0xC6D4, 0xC6D4, 0x0A18,
- 0xC6D5, 0xC6DB, 0x396F, 0xC6DC, 0xC6DD, 0x0A19, 0xC6DE, 0xC6DF, 0x3976,
- 0xC6E0, 0xC6E1, 0x0A1B, 0xC6E2, 0xC6E7, 0x3978, 0xC6E8, 0xC6E9, 0x0A1D,
- 0xC6EA, 0xC6EB, 0x397E, 0xC6EC, 0xC6EC, 0x0A1F, 0xC6ED, 0xC6EF, 0x3980,
- 0xC6F0, 0xC6F0, 0x0A20, 0xC6F1, 0xC6F7, 0x3983, 0xC6F8, 0xC6F9, 0x0A21,
- 0xC6FA, 0xC6FC, 0x398A, 0xC6FD, 0xC6FD, 0x0A23, 0xC6FE, 0xC6FF, 0x398D,
- 0xC700, 0xC703, 0x398F, 0xC704, 0xC705, 0x0A24, 0xC706, 0xC707, 0x3993,
- 0xC708, 0xC708, 0x0A26, 0xC709, 0xC70B, 0x3995, 0xC70C, 0xC70C, 0x0A27,
- 0xC70D, 0xC713, 0x3998, 0xC714, 0xC715, 0x0A28, 0xC716, 0xC716, 0x399F,
- 0xC717, 0xC717, 0x0A2A, 0xC718, 0xC718, 0x39A0, 0xC719, 0xC719, 0x0A2B,
- 0xC71A, 0xC71F, 0x39A1, 0xC720, 0xC721, 0x0A2C, 0xC722, 0xC723, 0x39A7,
- 0xC724, 0xC724, 0x0A2E, 0xC725, 0xC727, 0x39A9, 0xC728, 0xC728, 0x0A2F,
- 0xC729, 0xC72F, 0x39AC, 0xC730, 0xC731, 0x0A30, 0xC732, 0xC732, 0x39B3,
- 0xC733, 0xC733, 0x0A32, 0xC734, 0xC734, 0x39B4, 0xC735, 0xC735, 0x0A33,
- 0xC736, 0xC736, 0x39B5, 0xC737, 0xC737, 0x0A34, 0xC738, 0xC73B, 0x39B6,
- 0xC73C, 0xC73D, 0x0A35, 0xC73E, 0xC73F, 0x39BA, 0xC740, 0xC740, 0x0A37,
- 0xC741, 0xC743, 0x39BC, 0xC744, 0xC744, 0x0A38, 0xC745, 0xC749, 0x39BF,
- 0xC74A, 0xC74A, 0x0A39, 0xC74B, 0xC74B, 0x39C4, 0xC74C, 0xC74D, 0x0A3A,
- 0xC74E, 0xC74E, 0x39C5, 0xC74F, 0xC74F, 0x0A3C, 0xC750, 0xC750, 0x39C6,
- 0xC751, 0xC758, 0x0A3D, 0xC759, 0xC75B, 0x39C7, 0xC75C, 0xC75C, 0x0A45,
- 0xC75D, 0xC75F, 0x39CA, 0xC760, 0xC760, 0x0A46, 0xC761, 0xC767, 0x39CD,
- 0xC768, 0xC768, 0x0A47, 0xC769, 0xC76A, 0x39D4, 0xC76B, 0xC76B, 0x0A48,
- 0xC76C, 0xC773, 0x39D6, 0xC774, 0xC775, 0x0A49, 0xC776, 0xC777, 0x39DE,
- 0xC778, 0xC778, 0x0A4B, 0xC779, 0xC77B, 0x39E0, 0xC77C, 0xC77E, 0x0A4C,
- 0xC77F, 0xC782, 0x39E3, 0xC783, 0xC785, 0x0A4F, 0xC786, 0xC786, 0x39E7,
- 0xC787, 0xC78A, 0x0A52, 0xC78B, 0xC78D, 0x39E8, 0xC78E, 0xC78E, 0x0A56,
- 0xC78F, 0xC78F, 0x39EB, 0xC790, 0xC791, 0x0A57, 0xC792, 0xC793, 0x39EC,
- 0xC794, 0xC794, 0x0A59, 0xC795, 0xC795, 0x39EE, 0xC796, 0xC798, 0x0A5A,
- 0xC799, 0xC799, 0x39EF, 0xC79A, 0xC79A, 0x0A5D, 0xC79B, 0xC79F, 0x39F0,
- 0xC7A0, 0xC7A1, 0x0A5E, 0xC7A2, 0xC7A2, 0x39F5, 0xC7A3, 0xC7A6, 0x0A60,
- 0xC7A7, 0xC7AB, 0x39F6, 0xC7AC, 0xC7AD, 0x0A64, 0xC7AE, 0xC7AF, 0x39FB,
- 0xC7B0, 0xC7B0, 0x0A66, 0xC7B1, 0xC7B3, 0x39FD, 0xC7B4, 0xC7B4, 0x0A67,
- 0xC7B5, 0xC7BB, 0x3A00, 0xC7BC, 0xC7BD, 0x0A68, 0xC7BE, 0xC7BE, 0x3A07,
- 0xC7BF, 0xC7C1, 0x0A6A, 0xC7C2, 0xC7C7, 0x3A08, 0xC7C8, 0xC7C9, 0x0A6D,
- 0xC7CA, 0xC7CB, 0x3A0E, 0xC7CC, 0xC7CC, 0x0A6F, 0xC7CD, 0xC7CD, 0x3A10,
- 0xC7CE, 0xC7CE, 0x0A70, 0xC7CF, 0xC7CF, 0x3A11, 0xC7D0, 0xC7D0, 0x0A71,
- 0xC7D1, 0xC7D7, 0x3A12, 0xC7D8, 0xC7D8, 0x0A72, 0xC7D9, 0xC7DC, 0x3A19,
- 0xC7DD, 0xC7DD, 0x0A73, 0xC7DE, 0xC7E3, 0x3A1D, 0xC7E4, 0xC7E4, 0x0A74,
- 0xC7E5, 0xC7E7, 0x3A23, 0xC7E8, 0xC7E8, 0x0A75, 0xC7E9, 0xC7EB, 0x3A26,
- 0xC7EC, 0xC7EC, 0x0A76, 0xC7ED, 0xC7FF, 0x3A29, 0xC800, 0xC801, 0x0A77,
- 0xC802, 0xC803, 0x3A3C, 0xC804, 0xC804, 0x0A79, 0xC805, 0xC807, 0x3A3E,
- 0xC808, 0xC808, 0x0A7A, 0xC809, 0xC809, 0x3A41, 0xC80A, 0xC80A, 0x0A7B,
- 0xC80B, 0xC80F, 0x3A42, 0xC810, 0xC811, 0x0A7C, 0xC812, 0xC812, 0x3A47,
- 0xC813, 0xC813, 0x0A7E, 0xC814, 0xC814, 0x3A48, 0xC815, 0xC816, 0x0A7F,
- 0xC817, 0xC81B, 0x3A49, 0xC81C, 0xC81D, 0x0A81, 0xC81E, 0xC81F, 0x3A4E,
- 0xC820, 0xC820, 0x0A83, 0xC821, 0xC823, 0x3A50, 0xC824, 0xC824, 0x0A84,
- 0xC825, 0xC82B, 0x3A53, 0xC82C, 0xC82D, 0x0A85, 0xC82E, 0xC82E, 0x3A5A,
- 0xC82F, 0xC82F, 0x0A87, 0xC830, 0xC830, 0x3A5B, 0xC831, 0xC831, 0x0A88,
- 0xC832, 0xC837, 0x3A5C, 0xC838, 0xC838, 0x0A89, 0xC839, 0xC83B, 0x3A62,
- 0xC83C, 0xC83C, 0x0A8A, 0xC83D, 0xC83F, 0x3A65, 0xC840, 0xC840, 0x0A8B,
- 0xC841, 0xC847, 0x3A68, 0xC848, 0xC849, 0x0A8C, 0xC84A, 0xC84B, 0x3A6F,
- 0xC84C, 0xC84D, 0x0A8E, 0xC84E, 0xC853, 0x3A71, 0xC854, 0xC854, 0x0A90,
- 0xC855, 0xC86F, 0x3A77, 0xC870, 0xC871, 0x0A91, 0xC872, 0xC873, 0x3A92,
- 0xC874, 0xC874, 0x0A93, 0xC875, 0xC877, 0x3A94, 0xC878, 0xC878, 0x0A94,
- 0xC879, 0xC879, 0x3A97, 0xC87A, 0xC87A, 0x0A95, 0xC87B, 0xC87F, 0x3A98,
- 0xC880, 0xC881, 0x0A96, 0xC882, 0xC882, 0x3A9D, 0xC883, 0xC883, 0x0A98,
- 0xC884, 0xC884, 0x3A9E, 0xC885, 0xC887, 0x0A99, 0xC888, 0xC88A, 0x3A9F,
- 0xC88B, 0xC88D, 0x0A9C, 0xC88E, 0xC893, 0x3AA2, 0xC894, 0xC894, 0x0A9F,
- 0xC895, 0xC89C, 0x3AA8, 0xC89D, 0xC89D, 0x0AA0, 0xC89E, 0xC89E, 0x3AB0,
- 0xC89F, 0xC89F, 0x0AA1, 0xC8A0, 0xC8A0, 0x3AB1, 0xC8A1, 0xC8A1, 0x0AA2,
- 0xC8A2, 0xC8A7, 0x3AB2, 0xC8A8, 0xC8A8, 0x0AA3, 0xC8A9, 0xC8BB, 0x3AB8,
- 0xC8BC, 0xC8BD, 0x0AA4, 0xC8BE, 0xC8C3, 0x3ACB, 0xC8C4, 0xC8C4, 0x0AA6,
- 0xC8C5, 0xC8C7, 0x3AD1, 0xC8C8, 0xC8C8, 0x0AA7, 0xC8C9, 0xC8CB, 0x3AD4,
- 0xC8CC, 0xC8CC, 0x0AA8, 0xC8CD, 0xC8D3, 0x3AD7, 0xC8D4, 0xC8D5, 0x0AA9,
- 0xC8D6, 0xC8D6, 0x3ADE, 0xC8D7, 0xC8D7, 0x0AAB, 0xC8D8, 0xC8D8, 0x3ADF,
- 0xC8D9, 0xC8D9, 0x0AAC, 0xC8DA, 0xC8DF, 0x3AE0, 0xC8E0, 0xC8E1, 0x0AAD,
- 0xC8E2, 0xC8E3, 0x3AE6, 0xC8E4, 0xC8E4, 0x0AAF, 0xC8E5, 0xC8F4, 0x3AE8,
- 0xC8F5, 0xC8F5, 0x0AB0, 0xC8F6, 0xC8FB, 0x3AF8, 0xC8FC, 0xC8FD, 0x0AB1,
- 0xC8FE, 0xC8FF, 0x3AFE, 0xC900, 0xC900, 0x0AB3, 0xC901, 0xC903, 0x3B00,
- 0xC904, 0xC906, 0x0AB4, 0xC907, 0xC90B, 0x3B03, 0xC90C, 0xC90D, 0x0AB7,
- 0xC90E, 0xC90E, 0x3B08, 0xC90F, 0xC90F, 0x0AB9, 0xC910, 0xC910, 0x3B09,
- 0xC911, 0xC911, 0x0ABA, 0xC912, 0xC917, 0x3B0A, 0xC918, 0xC918, 0x0ABB,
- 0xC919, 0xC92B, 0x3B10, 0xC92C, 0xC92C, 0x0ABC, 0xC92D, 0xC933, 0x3B23,
- 0xC934, 0xC934, 0x0ABD, 0xC935, 0xC94F, 0x3B2A, 0xC950, 0xC951, 0x0ABE,
- 0xC952, 0xC953, 0x3B45, 0xC954, 0xC954, 0x0AC0, 0xC955, 0xC957, 0x3B47,
- 0xC958, 0xC958, 0x0AC1, 0xC959, 0xC95F, 0x3B4A, 0xC960, 0xC961, 0x0AC2,
- 0xC962, 0xC962, 0x3B51, 0xC963, 0xC963, 0x0AC4, 0xC964, 0xC96B, 0x3B52,
- 0xC96C, 0xC96C, 0x0AC5, 0xC96D, 0xC96F, 0x3B5A, 0xC970, 0xC970, 0x0AC6,
- 0xC971, 0xC973, 0x3B5D, 0xC974, 0xC974, 0x0AC7, 0xC975, 0xC97B, 0x3B60,
- 0xC97C, 0xC97C, 0x0AC8, 0xC97D, 0xC987, 0x3B67, 0xC988, 0xC989, 0x0AC9,
- 0xC98A, 0xC98B, 0x3B72, 0xC98C, 0xC98C, 0x0ACB, 0xC98D, 0xC98F, 0x3B74,
- 0xC990, 0xC990, 0x0ACC, 0xC991, 0xC997, 0x3B77, 0xC998, 0xC999, 0x0ACD,
- 0xC99A, 0xC99A, 0x3B7E, 0xC99B, 0xC99B, 0x0ACF, 0xC99C, 0xC99C, 0x3B7F,
- 0xC99D, 0xC99D, 0x0AD0, 0xC99E, 0xC9BF, 0x3B80, 0xC9C0, 0xC9C1, 0x0AD1,
- 0xC9C2, 0xC9C3, 0x3BA2, 0xC9C4, 0xC9C4, 0x0AD3, 0xC9C5, 0xC9C6, 0x3BA4,
- 0xC9C7, 0xC9C8, 0x0AD4, 0xC9C9, 0xC9C9, 0x3BA6, 0xC9CA, 0xC9CA, 0x0AD6,
- 0xC9CB, 0xC9CF, 0x3BA7, 0xC9D0, 0xC9D1, 0x0AD7, 0xC9D2, 0xC9D2, 0x3BAC,
- 0xC9D3, 0xC9D3, 0x0AD9, 0xC9D4, 0xC9D4, 0x3BAD, 0xC9D5, 0xC9D6, 0x0ADA,
- 0xC9D7, 0xC9D8, 0x3BAE, 0xC9D9, 0xC9DA, 0x0ADC, 0xC9DB, 0xC9DB, 0x3BB0,
- 0xC9DC, 0xC9DD, 0x0ADE, 0xC9DE, 0xC9DF, 0x3BB1, 0xC9E0, 0xC9E0, 0x0AE0,
- 0xC9E1, 0xC9E1, 0x3BB3, 0xC9E2, 0xC9E2, 0x0AE1, 0xC9E3, 0xC9E3, 0x3BB4,
- 0xC9E4, 0xC9E4, 0x0AE2, 0xC9E5, 0xC9E6, 0x3BB5, 0xC9E7, 0xC9E7, 0x0AE3,
- 0xC9E8, 0xC9EB, 0x3BB7, 0xC9EC, 0xC9ED, 0x0AE4, 0xC9EE, 0xC9EE, 0x3BBB,
- 0xC9EF, 0xC9F1, 0x0AE6, 0xC9F2, 0xC9F7, 0x3BBC, 0xC9F8, 0xC9F9, 0x0AE9,
- 0xC9FA, 0xC9FB, 0x3BC2, 0xC9FC, 0xC9FC, 0x0AEB, 0xC9FD, 0xC9FF, 0x3BC4,
- 0xCA00, 0xCA00, 0x0AEC, 0xCA01, 0xCA07, 0x3BC7, 0xCA08, 0xCA09, 0x0AED,
- 0xCA0A, 0xCA0A, 0x3BCE, 0xCA0B, 0xCA0D, 0x0AEF, 0xCA0E, 0xCA13, 0x3BCF,
- 0xCA14, 0xCA14, 0x0AF2, 0xCA15, 0xCA17, 0x3BD5, 0xCA18, 0xCA18, 0x0AF3,
- 0xCA19, 0xCA28, 0x3BD8, 0xCA29, 0xCA29, 0x0AF4, 0xCA2A, 0xCA4B, 0x3BE8,
- 0xCA4C, 0xCA4D, 0x0AF5, 0xCA4E, 0xCA4F, 0x3C0A, 0xCA50, 0xCA50, 0x0AF7,
- 0xCA51, 0xCA53, 0x3C0C, 0xCA54, 0xCA54, 0x0AF8, 0xCA55, 0xCA5B, 0x3C0F,
- 0xCA5C, 0xCA5D, 0x0AF9, 0xCA5E, 0xCA5E, 0x3C16, 0xCA5F, 0xCA61, 0x0AFB,
- 0xCA62, 0xCA67, 0x3C17, 0xCA68, 0xCA68, 0x0AFE, 0xCA69, 0xCA7C, 0x3C1D,
- 0xCA7D, 0xCA7D, 0x0AFF, 0xCA7E, 0xCA83, 0x3C31, 0xCA84, 0xCA84, 0x0B00,
- 0xCA85, 0xCA97, 0x3C37, 0xCA98, 0xCA98, 0x0B01, 0xCA99, 0xCABB, 0x3C4A,
- 0xCABC, 0xCABD, 0x0B02, 0xCABE, 0xCABF, 0x3C6D, 0xCAC0, 0xCAC0, 0x0B04,
- 0xCAC1, 0xCAC3, 0x3C6F, 0xCAC4, 0xCAC4, 0x0B05, 0xCAC5, 0xCACB, 0x3C72,
- 0xCACC, 0xCACD, 0x0B06, 0xCACE, 0xCACE, 0x3C79, 0xCACF, 0xCACF, 0x0B08,
- 0xCAD0, 0xCAD0, 0x3C7A, 0xCAD1, 0xCAD1, 0x0B09, 0xCAD2, 0xCAD2, 0x3C7B,
- 0xCAD3, 0xCAD3, 0x0B0A, 0xCAD4, 0xCAD7, 0x3C7C, 0xCAD8, 0xCAD9, 0x0B0B,
- 0xCADA, 0xCADF, 0x3C80, 0xCAE0, 0xCAE0, 0x0B0D, 0xCAE1, 0xCAEB, 0x3C86,
- 0xCAEC, 0xCAEC, 0x0B0E, 0xCAED, 0xCAF3, 0x3C91, 0xCAF4, 0xCAF4, 0x0B0F,
- 0xCAF5, 0xCAFF, 0x3C98, 0xCB00, 0xCB07, 0x3CA3, 0xCB08, 0xCB08, 0x0B10,
- 0xCB09, 0xCB0F, 0x3CAB, 0xCB10, 0xCB10, 0x0B11, 0xCB11, 0xCB13, 0x3CB2,
- 0xCB14, 0xCB14, 0x0B12, 0xCB15, 0xCB17, 0x3CB5, 0xCB18, 0xCB18, 0x0B13,
- 0xCB19, 0xCB1F, 0x3CB8, 0xCB20, 0xCB21, 0x0B14, 0xCB22, 0xCB40, 0x3CBF,
- 0xCB41, 0xCB41, 0x0B16, 0xCB42, 0xCB47, 0x3CDE, 0xCB48, 0xCB49, 0x0B17,
- 0xCB4A, 0xCB4B, 0x3CE4, 0xCB4C, 0xCB4C, 0x0B19, 0xCB4D, 0xCB4F, 0x3CE6,
- 0xCB50, 0xCB50, 0x0B1A, 0xCB51, 0xCB57, 0x3CE9, 0xCB58, 0xCB59, 0x0B1B,
- 0xCB5A, 0xCB5C, 0x3CF0, 0xCB5D, 0xCB5D, 0x0B1D, 0xCB5E, 0xCB63, 0x3CF3,
- 0xCB64, 0xCB64, 0x0B1E, 0xCB65, 0xCB77, 0x3CF9, 0xCB78, 0xCB79, 0x0B1F,
- 0xCB7A, 0xCB9B, 0x3D0C, 0xCB9C, 0xCB9C, 0x0B21, 0xCB9D, 0xCBB7, 0x3D2E,
- 0xCBB8, 0xCBB8, 0x0B22, 0xCBB9, 0xCBD3, 0x3D49, 0xCBD4, 0xCBD4, 0x0B23,
- 0xCBD5, 0xCBE3, 0x3D64, 0xCBE4, 0xCBE4, 0x0B24, 0xCBE5, 0xCBE6, 0x3D73,
- 0xCBE7, 0xCBE7, 0x0B25, 0xCBE8, 0xCBE8, 0x3D75, 0xCBE9, 0xCBE9, 0x0B26,
- 0xCBEA, 0xCBFF, 0x3D76, 0xCC00, 0xCC0B, 0x3D8C, 0xCC0C, 0xCC0D, 0x0B27,
- 0xCC0E, 0xCC0F, 0x3D98, 0xCC10, 0xCC10, 0x0B29, 0xCC11, 0xCC13, 0x3D9A,
- 0xCC14, 0xCC14, 0x0B2A, 0xCC15, 0xCC1B, 0x3D9D, 0xCC1C, 0xCC1D, 0x0B2B,
- 0xCC1E, 0xCC20, 0x3DA4, 0xCC21, 0xCC22, 0x0B2D, 0xCC23, 0xCC26, 0x3DA7,
- 0xCC27, 0xCC29, 0x0B2F, 0xCC2A, 0xCC2B, 0x3DAB, 0xCC2C, 0xCC2C, 0x0B32,
- 0xCC2D, 0xCC2D, 0x3DAD, 0xCC2E, 0xCC2E, 0x0B33, 0xCC2F, 0xCC2F, 0x3DAE,
- 0xCC30, 0xCC30, 0x0B34, 0xCC31, 0xCC37, 0x3DAF, 0xCC38, 0xCC39, 0x0B35,
- 0xCC3A, 0xCC3A, 0x3DB6, 0xCC3B, 0xCC3E, 0x0B37, 0xCC3F, 0xCC43, 0x3DB7,
- 0xCC44, 0xCC45, 0x0B3B, 0xCC46, 0xCC47, 0x3DBC, 0xCC48, 0xCC48, 0x0B3D,
- 0xCC49, 0xCC4B, 0x3DBE, 0xCC4C, 0xCC4C, 0x0B3E, 0xCC4D, 0xCC53, 0x3DC1,
- 0xCC54, 0xCC55, 0x0B3F, 0xCC56, 0xCC56, 0x3DC8, 0xCC57, 0xCC59, 0x0B41,
- 0xCC5A, 0xCC5F, 0x3DC9, 0xCC60, 0xCC60, 0x0B44, 0xCC61, 0xCC63, 0x3DCF,
- 0xCC64, 0xCC64, 0x0B45, 0xCC65, 0xCC65, 0x3DD2, 0xCC66, 0xCC66, 0x0B46,
- 0xCC67, 0xCC67, 0x3DD3, 0xCC68, 0xCC68, 0x0B47, 0xCC69, 0xCC6F, 0x3DD4,
- 0xCC70, 0xCC70, 0x0B48, 0xCC71, 0xCC74, 0x3DDB, 0xCC75, 0xCC75, 0x0B49,
- 0xCC76, 0xCC97, 0x3DDF, 0xCC98, 0xCC99, 0x0B4A, 0xCC9A, 0xCC9B, 0x3E01,
- 0xCC9C, 0xCC9C, 0x0B4C, 0xCC9D, 0xCC9F, 0x3E03, 0xCCA0, 0xCCA0, 0x0B4D,
- 0xCCA1, 0xCCA7, 0x3E06, 0xCCA8, 0xCCA9, 0x0B4E, 0xCCAA, 0xCCAA, 0x3E0D,
- 0xCCAB, 0xCCAD, 0x0B50, 0xCCAE, 0xCCB3, 0x3E0E, 0xCCB4, 0xCCB5, 0x0B53,
- 0xCCB6, 0xCCB7, 0x3E14, 0xCCB8, 0xCCB8, 0x0B55, 0xCCB9, 0xCCBB, 0x3E16,
- 0xCCBC, 0xCCBC, 0x0B56, 0xCCBD, 0xCCC3, 0x3E19, 0xCCC4, 0xCCC5, 0x0B57,
- 0xCCC6, 0xCCC6, 0x3E20, 0xCCC7, 0xCCC7, 0x0B59, 0xCCC8, 0xCCC8, 0x3E21,
- 0xCCC9, 0xCCC9, 0x0B5A, 0xCCCA, 0xCCCF, 0x3E22, 0xCCD0, 0xCCD0, 0x0B5B,
- 0xCCD1, 0xCCD3, 0x3E28, 0xCCD4, 0xCCD4, 0x0B5C, 0xCCD5, 0xCCE3, 0x3E2B,
- 0xCCE4, 0xCCE4, 0x0B5D, 0xCCE5, 0xCCEB, 0x3E3A, 0xCCEC, 0xCCEC, 0x0B5E,
- 0xCCED, 0xCCEF, 0x3E41, 0xCCF0, 0xCCF0, 0x0B5F, 0xCCF1, 0xCCFF, 0x3E44,
- 0xCD00, 0xCD00, 0x3E53, 0xCD01, 0xCD01, 0x0B60, 0xCD02, 0xCD07, 0x3E54,
- 0xCD08, 0xCD09, 0x0B61, 0xCD0A, 0xCD0B, 0x3E5A, 0xCD0C, 0xCD0C, 0x0B63,
- 0xCD0D, 0xCD0F, 0x3E5C, 0xCD10, 0xCD10, 0x0B64, 0xCD11, 0xCD17, 0x3E5F,
- 0xCD18, 0xCD19, 0x0B65, 0xCD1A, 0xCD1A, 0x3E66, 0xCD1B, 0xCD1B, 0x0B67,
- 0xCD1C, 0xCD1C, 0x3E67, 0xCD1D, 0xCD1D, 0x0B68, 0xCD1E, 0xCD23, 0x3E68,
- 0xCD24, 0xCD24, 0x0B69, 0xCD25, 0xCD27, 0x3E6E, 0xCD28, 0xCD28, 0x0B6A,
- 0xCD29, 0xCD2B, 0x3E71, 0xCD2C, 0xCD2C, 0x0B6B, 0xCD2D, 0xCD38, 0x3E74,
- 0xCD39, 0xCD39, 0x0B6C, 0xCD3A, 0xCD5B, 0x3E80, 0xCD5C, 0xCD5C, 0x0B6D,
- 0xCD5D, 0xCD5F, 0x3EA2, 0xCD60, 0xCD60, 0x0B6E, 0xCD61, 0xCD63, 0x3EA5,
- 0xCD64, 0xCD64, 0x0B6F, 0xCD65, 0xCD6B, 0x3EA8, 0xCD6C, 0xCD6D, 0x0B70,
- 0xCD6E, 0xCD6E, 0x3EAF, 0xCD6F, 0xCD6F, 0x0B72, 0xCD70, 0xCD70, 0x3EB0,
- 0xCD71, 0xCD71, 0x0B73, 0xCD72, 0xCD77, 0x3EB1, 0xCD78, 0xCD78, 0x0B74,
- 0xCD79, 0xCD87, 0x3EB7, 0xCD88, 0xCD88, 0x0B75, 0xCD89, 0xCD93, 0x3EC6,
- 0xCD94, 0xCD95, 0x0B76, 0xCD96, 0xCD97, 0x3ED1, 0xCD98, 0xCD98, 0x0B78,
- 0xCD99, 0xCD9B, 0x3ED3, 0xCD9C, 0xCD9C, 0x0B79, 0xCD9D, 0xCDA3, 0x3ED6,
- 0xCDA4, 0xCDA5, 0x0B7A, 0xCDA6, 0xCDA6, 0x3EDD, 0xCDA7, 0xCDA7, 0x0B7C,
- 0xCDA8, 0xCDA8, 0x3EDE, 0xCDA9, 0xCDA9, 0x0B7D, 0xCDAA, 0xCDAF, 0x3EDF,
- 0xCDB0, 0xCDB0, 0x0B7E, 0xCDB1, 0xCDC3, 0x3EE5, 0xCDC4, 0xCDC4, 0x0B7F,
- 0xCDC5, 0xCDCB, 0x3EF8, 0xCDCC, 0xCDCC, 0x0B80, 0xCDCD, 0xCDCF, 0x3EFF,
- 0xCDD0, 0xCDD0, 0x0B81, 0xCDD1, 0xCDE7, 0x3F02, 0xCDE8, 0xCDE8, 0x0B82,
- 0xCDE9, 0xCDEB, 0x3F19, 0xCDEC, 0xCDEC, 0x0B83, 0xCDED, 0xCDEF, 0x3F1C,
- 0xCDF0, 0xCDF0, 0x0B84, 0xCDF1, 0xCDF7, 0x3F1F, 0xCDF8, 0xCDF9, 0x0B85,
- 0xCDFA, 0xCDFA, 0x3F26, 0xCDFB, 0xCDFB, 0x0B87, 0xCDFC, 0xCDFC, 0x3F27,
- 0xCDFD, 0xCDFD, 0x0B88, 0xCDFE, 0xCDFF, 0x3F28, 0xCE00, 0xCE03, 0x3F2A,
- 0xCE04, 0xCE04, 0x0B89, 0xCE05, 0xCE07, 0x3F2E, 0xCE08, 0xCE08, 0x0B8A,
- 0xCE09, 0xCE0B, 0x3F31, 0xCE0C, 0xCE0C, 0x0B8B, 0xCE0D, 0xCE13, 0x3F34,
- 0xCE14, 0xCE14, 0x0B8C, 0xCE15, 0xCE18, 0x3F3B, 0xCE19, 0xCE19, 0x0B8D,
- 0xCE1A, 0xCE1F, 0x3F3F, 0xCE20, 0xCE21, 0x0B8E, 0xCE22, 0xCE23, 0x3F45,
- 0xCE24, 0xCE24, 0x0B90, 0xCE25, 0xCE27, 0x3F47, 0xCE28, 0xCE28, 0x0B91,
- 0xCE29, 0xCE2F, 0x3F4A, 0xCE30, 0xCE31, 0x0B92, 0xCE32, 0xCE32, 0x3F51,
- 0xCE33, 0xCE33, 0x0B94, 0xCE34, 0xCE34, 0x3F52, 0xCE35, 0xCE35, 0x0B95,
- 0xCE36, 0xCE57, 0x3F53, 0xCE58, 0xCE59, 0x0B96, 0xCE5A, 0xCE5B, 0x3F75,
- 0xCE5C, 0xCE5C, 0x0B98, 0xCE5D, 0xCE5E, 0x3F77, 0xCE5F, 0xCE61, 0x0B99,
- 0xCE62, 0xCE67, 0x3F79, 0xCE68, 0xCE69, 0x0B9C, 0xCE6A, 0xCE6A, 0x3F7F,
- 0xCE6B, 0xCE6B, 0x0B9E, 0xCE6C, 0xCE6C, 0x3F80, 0xCE6D, 0xCE6D, 0x0B9F,
- 0xCE6E, 0xCE73, 0x3F81, 0xCE74, 0xCE75, 0x0BA0, 0xCE76, 0xCE77, 0x3F87,
- 0xCE78, 0xCE78, 0x0BA2, 0xCE79, 0xCE7B, 0x3F89, 0xCE7C, 0xCE7C, 0x0BA3,
- 0xCE7D, 0xCE83, 0x3F8C, 0xCE84, 0xCE85, 0x0BA4, 0xCE86, 0xCE86, 0x3F93,
- 0xCE87, 0xCE87, 0x0BA6, 0xCE88, 0xCE88, 0x3F94, 0xCE89, 0xCE89, 0x0BA7,
- 0xCE8A, 0xCE8F, 0x3F95, 0xCE90, 0xCE91, 0x0BA8, 0xCE92, 0xCE93, 0x3F9B,
- 0xCE94, 0xCE94, 0x0BAA, 0xCE95, 0xCE97, 0x3F9D, 0xCE98, 0xCE98, 0x0BAB,
- 0xCE99, 0xCE9F, 0x3FA0, 0xCEA0, 0xCEA1, 0x0BAC, 0xCEA2, 0xCEA2, 0x3FA7,
- 0xCEA3, 0xCEA5, 0x0BAE, 0xCEA6, 0xCEAB, 0x3FA8, 0xCEAC, 0xCEAD, 0x0BB1,
- 0xCEAE, 0xCEC0, 0x3FAE, 0xCEC1, 0xCEC1, 0x0BB3, 0xCEC2, 0xCEE3, 0x3FC1,
- 0xCEE4, 0xCEE5, 0x0BB4, 0xCEE6, 0xCEE7, 0x3FE3, 0xCEE8, 0xCEE8, 0x0BB6,
- 0xCEE9, 0xCEEA, 0x3FE5, 0xCEEB, 0xCEEC, 0x0BB7, 0xCEED, 0xCEF3, 0x3FE7,
- 0xCEF4, 0xCEF5, 0x0BB9, 0xCEF6, 0xCEF6, 0x3FEE, 0xCEF7, 0xCEF9, 0x0BBB,
- 0xCEFA, 0xCEFF, 0x3FEF, 0xCF00, 0xCF01, 0x0BBE, 0xCF02, 0xCF03, 0x3FF5,
- 0xCF04, 0xCF04, 0x0BC0, 0xCF05, 0xCF07, 0x3FF7, 0xCF08, 0xCF08, 0x0BC1,
- 0xCF09, 0xCF0F, 0x3FFA, 0xCF10, 0xCF11, 0x0BC2, 0xCF12, 0xCF12, 0x4001,
- 0xCF13, 0xCF13, 0x0BC4, 0xCF14, 0xCF14, 0x4002, 0xCF15, 0xCF15, 0x0BC5,
- 0xCF16, 0xCF1B, 0x4003, 0xCF1C, 0xCF1C, 0x0BC6, 0xCF1D, 0xCF1F, 0x4009,
- 0xCF20, 0xCF20, 0x0BC7, 0xCF21, 0xCF23, 0x400C, 0xCF24, 0xCF24, 0x0BC8,
- 0xCF25, 0xCF2B, 0x400F, 0xCF2C, 0xCF2D, 0x0BC9, 0xCF2E, 0xCF2E, 0x4016,
- 0xCF2F, 0xCF31, 0x0BCB, 0xCF32, 0xCF37, 0x4017, 0xCF38, 0xCF38, 0x0BCE,
- 0xCF39, 0xCF53, 0x401D, 0xCF54, 0xCF55, 0x0BCF, 0xCF56, 0xCF57, 0x4038,
- 0xCF58, 0xCF58, 0x0BD1, 0xCF59, 0xCF5B, 0x403A, 0xCF5C, 0xCF5C, 0x0BD2,
- 0xCF5D, 0xCF63, 0x403D, 0xCF64, 0xCF65, 0x0BD3, 0xCF66, 0xCF66, 0x4044,
- 0xCF67, 0xCF67, 0x0BD5, 0xCF68, 0xCF68, 0x4045, 0xCF69, 0xCF69, 0x0BD6,
- 0xCF6A, 0xCF6F, 0x4046, 0xCF70, 0xCF71, 0x0BD7, 0xCF72, 0xCF73, 0x404C,
- 0xCF74, 0xCF74, 0x0BD9, 0xCF75, 0xCF77, 0x404E, 0xCF78, 0xCF78, 0x0BDA,
- 0xCF79, 0xCF7F, 0x4051, 0xCF80, 0xCF80, 0x0BDB, 0xCF81, 0xCF84, 0x4058,
- 0xCF85, 0xCF85, 0x0BDC, 0xCF86, 0xCF8B, 0x405C, 0xCF8C, 0xCF8C, 0x0BDD,
- 0xCF8D, 0xCFA0, 0x4062, 0xCFA1, 0xCFA1, 0x0BDE, 0xCFA2, 0xCFA7, 0x4076,
- 0xCFA8, 0xCFA8, 0x0BDF, 0xCFA9, 0xCFAF, 0x407C, 0xCFB0, 0xCFB0, 0x0BE0,
- 0xCFB1, 0xCFC3, 0x4083, 0xCFC4, 0xCFC4, 0x0BE1, 0xCFC5, 0xCFDF, 0x4096,
- 0xCFE0, 0xCFE1, 0x0BE2, 0xCFE2, 0xCFE3, 0x40B1, 0xCFE4, 0xCFE4, 0x0BE4,
- 0xCFE5, 0xCFE7, 0x40B3, 0xCFE8, 0xCFE8, 0x0BE5, 0xCFE9, 0xCFEF, 0x40B6,
- 0xCFF0, 0xCFF1, 0x0BE6, 0xCFF2, 0xCFF2, 0x40BD, 0xCFF3, 0xCFF3, 0x0BE8,
- 0xCFF4, 0xCFF4, 0x40BE, 0xCFF5, 0xCFF5, 0x0BE9, 0xCFF6, 0xCFFB, 0x40BF,
- 0xCFFC, 0xCFFC, 0x0BEA, 0xCFFD, 0xCFFF, 0x40C5, 0xD000, 0xD000, 0x0BEB,
- 0xD001, 0xD003, 0x40C8, 0xD004, 0xD004, 0x0BEC, 0xD005, 0xD010, 0x40CB,
- 0xD011, 0xD011, 0x0BED, 0xD012, 0xD017, 0x40D7, 0xD018, 0xD018, 0x0BEE,
- 0xD019, 0xD02C, 0x40DD, 0xD02D, 0xD02D, 0x0BEF, 0xD02E, 0xD033, 0x40F1,
- 0xD034, 0xD035, 0x0BF0, 0xD036, 0xD037, 0x40F7, 0xD038, 0xD038, 0x0BF2,
- 0xD039, 0xD03B, 0x40F9, 0xD03C, 0xD03C, 0x0BF3, 0xD03D, 0xD043, 0x40FC,
- 0xD044, 0xD045, 0x0BF4, 0xD046, 0xD046, 0x4103, 0xD047, 0xD047, 0x0BF6,
- 0xD048, 0xD048, 0x4104, 0xD049, 0xD049, 0x0BF7, 0xD04A, 0xD04F, 0x4105,
- 0xD050, 0xD050, 0x0BF8, 0xD051, 0xD053, 0x410B, 0xD054, 0xD054, 0x0BF9,
- 0xD055, 0xD057, 0x410E, 0xD058, 0xD058, 0x0BFA, 0xD059, 0xD05F, 0x4111,
- 0xD060, 0xD060, 0x0BFB, 0xD061, 0xD06B, 0x4118, 0xD06C, 0xD06D, 0x0BFC,
- 0xD06E, 0xD06F, 0x4123, 0xD070, 0xD070, 0x0BFE, 0xD071, 0xD073, 0x4125,
- 0xD074, 0xD074, 0x0BFF, 0xD075, 0xD07B, 0x4128, 0xD07C, 0xD07D, 0x0C00,
- 0xD07E, 0xD080, 0x412F, 0xD081, 0xD081, 0x0C02, 0xD082, 0xD0A3, 0x4132,
- 0xD0A4, 0xD0A5, 0x0C03, 0xD0A6, 0xD0A7, 0x4154, 0xD0A8, 0xD0A8, 0x0C05,
- 0xD0A9, 0xD0AB, 0x4156, 0xD0AC, 0xD0AC, 0x0C06, 0xD0AD, 0xD0B3, 0x4159,
- 0xD0B4, 0xD0B5, 0x0C07, 0xD0B6, 0xD0B6, 0x4160, 0xD0B7, 0xD0B7, 0x0C09,
- 0xD0B8, 0xD0B8, 0x4161, 0xD0B9, 0xD0B9, 0x0C0A, 0xD0BA, 0xD0BF, 0x4162,
- 0xD0C0, 0xD0C1, 0x0C0B, 0xD0C2, 0xD0C3, 0x4168, 0xD0C4, 0xD0C4, 0x0C0D,
- 0xD0C5, 0xD0C7, 0x416A, 0xD0C8, 0xD0C9, 0x0C0E, 0xD0CA, 0xD0CF, 0x416D,
- 0xD0D0, 0xD0D1, 0x0C10, 0xD0D2, 0xD0D2, 0x4173, 0xD0D3, 0xD0D5, 0x0C12,
- 0xD0D6, 0xD0DB, 0x4174, 0xD0DC, 0xD0DD, 0x0C15, 0xD0DE, 0xD0DF, 0x417A,
- 0xD0E0, 0xD0E0, 0x0C17, 0xD0E1, 0xD0E3, 0x417C, 0xD0E4, 0xD0E4, 0x0C18,
- 0xD0E5, 0xD0EB, 0x417F, 0xD0EC, 0xD0ED, 0x0C19, 0xD0EE, 0xD0EE, 0x4186,
- 0xD0EF, 0xD0F1, 0x0C1B, 0xD0F2, 0xD0F7, 0x4187, 0xD0F8, 0xD0F8, 0x0C1E,
- 0xD0F9, 0xD0FF, 0x418D, 0xD100, 0xD10C, 0x4194, 0xD10D, 0xD10D, 0x0C1F,
- 0xD10E, 0xD12F, 0x41A1, 0xD130, 0xD131, 0x0C20, 0xD132, 0xD133, 0x41C3,
- 0xD134, 0xD134, 0x0C22, 0xD135, 0xD137, 0x41C5, 0xD138, 0xD138, 0x0C23,
- 0xD139, 0xD139, 0x41C8, 0xD13A, 0xD13A, 0x0C24, 0xD13B, 0xD13F, 0x41C9,
- 0xD140, 0xD141, 0x0C25, 0xD142, 0xD142, 0x41CE, 0xD143, 0xD145, 0x0C27,
- 0xD146, 0xD14B, 0x41CF, 0xD14C, 0xD14D, 0x0C2A, 0xD14E, 0xD14F, 0x41D5,
- 0xD150, 0xD150, 0x0C2C, 0xD151, 0xD153, 0x41D7, 0xD154, 0xD154, 0x0C2D,
- 0xD155, 0xD15B, 0x41DA, 0xD15C, 0xD15D, 0x0C2E, 0xD15E, 0xD15E, 0x41E1,
- 0xD15F, 0xD15F, 0x0C30, 0xD160, 0xD160, 0x41E2, 0xD161, 0xD161, 0x0C31,
- 0xD162, 0xD167, 0x41E3, 0xD168, 0xD168, 0x0C32, 0xD169, 0xD16B, 0x41E9,
- 0xD16C, 0xD16C, 0x0C33, 0xD16D, 0xD17B, 0x41EC, 0xD17C, 0xD17C, 0x0C34,
- 0xD17D, 0xD183, 0x41FB, 0xD184, 0xD184, 0x0C35, 0xD185, 0xD187, 0x4202,
- 0xD188, 0xD188, 0x0C36, 0xD189, 0xD19F, 0x4205, 0xD1A0, 0xD1A1, 0x0C37,
- 0xD1A2, 0xD1A3, 0x421C, 0xD1A4, 0xD1A4, 0x0C39, 0xD1A5, 0xD1A7, 0x421E,
- 0xD1A8, 0xD1A8, 0x0C3A, 0xD1A9, 0xD1AF, 0x4221, 0xD1B0, 0xD1B1, 0x0C3B,
- 0xD1B2, 0xD1B2, 0x4228, 0xD1B3, 0xD1B3, 0x0C3D, 0xD1B4, 0xD1B4, 0x4229,
- 0xD1B5, 0xD1B5, 0x0C3E, 0xD1B6, 0xD1B9, 0x422A, 0xD1BA, 0xD1BA, 0x0C3F,
- 0xD1BB, 0xD1BB, 0x422E, 0xD1BC, 0xD1BC, 0x0C40, 0xD1BD, 0xD1BF, 0x422F,
- 0xD1C0, 0xD1C0, 0x0C41, 0xD1C1, 0xD1D7, 0x4232, 0xD1D8, 0xD1D8, 0x0C42,
- 0xD1D9, 0xD1F3, 0x4249, 0xD1F4, 0xD1F4, 0x0C43, 0xD1F5, 0xD1F7, 0x4264,
- 0xD1F8, 0xD1F8, 0x0C44, 0xD1F9, 0xD1FF, 0x4267, 0xD200, 0xD206, 0x426E,
- 0xD207, 0xD207, 0x0C45, 0xD208, 0xD208, 0x4275, 0xD209, 0xD209, 0x0C46,
- 0xD20A, 0xD20F, 0x4276, 0xD210, 0xD210, 0x0C47, 0xD211, 0xD22B, 0x427C,
- 0xD22C, 0xD22D, 0x0C48, 0xD22E, 0xD22F, 0x4297, 0xD230, 0xD230, 0x0C4A,
- 0xD231, 0xD233, 0x4299, 0xD234, 0xD234, 0x0C4B, 0xD235, 0xD23B, 0x429C,
- 0xD23C, 0xD23D, 0x0C4C, 0xD23E, 0xD23E, 0x42A3, 0xD23F, 0xD23F, 0x0C4E,
- 0xD240, 0xD240, 0x42A4, 0xD241, 0xD241, 0x0C4F, 0xD242, 0xD247, 0x42A5,
- 0xD248, 0xD248, 0x0C50, 0xD249, 0xD25B, 0x42AB, 0xD25C, 0xD25C, 0x0C51,
- 0xD25D, 0xD263, 0x42BE, 0xD264, 0xD264, 0x0C52, 0xD265, 0xD27F, 0x42C5,
- 0xD280, 0xD281, 0x0C53, 0xD282, 0xD283, 0x42E0, 0xD284, 0xD284, 0x0C55,
- 0xD285, 0xD287, 0x42E2, 0xD288, 0xD288, 0x0C56, 0xD289, 0xD28F, 0x42E5,
- 0xD290, 0xD291, 0x0C57, 0xD292, 0xD294, 0x42EC, 0xD295, 0xD295, 0x0C59,
- 0xD296, 0xD29B, 0x42EF, 0xD29C, 0xD29C, 0x0C5A, 0xD29D, 0xD29F, 0x42F5,
- 0xD2A0, 0xD2A0, 0x0C5B, 0xD2A1, 0xD2A3, 0x42F8, 0xD2A4, 0xD2A4, 0x0C5C,
- 0xD2A5, 0xD2AB, 0x42FB, 0xD2AC, 0xD2AC, 0x0C5D, 0xD2AD, 0xD2B0, 0x4302,
- 0xD2B1, 0xD2B1, 0x0C5E, 0xD2B2, 0xD2B7, 0x4306, 0xD2B8, 0xD2B9, 0x0C5F,
- 0xD2BA, 0xD2BB, 0x430C, 0xD2BC, 0xD2BC, 0x0C61, 0xD2BD, 0xD2BE, 0x430E,
- 0xD2BF, 0xD2C0, 0x0C62, 0xD2C1, 0xD2C1, 0x4310, 0xD2C2, 0xD2C2, 0x0C64,
- 0xD2C3, 0xD2C7, 0x4311, 0xD2C8, 0xD2C9, 0x0C65, 0xD2CA, 0xD2CA, 0x4316,
- 0xD2CB, 0xD2CB, 0x0C67, 0xD2CC, 0xD2D3, 0x4317, 0xD2D4, 0xD2D4, 0x0C68,
- 0xD2D5, 0xD2D7, 0x431F, 0xD2D8, 0xD2D8, 0x0C69, 0xD2D9, 0xD2DB, 0x4322,
- 0xD2DC, 0xD2DC, 0x0C6A, 0xD2DD, 0xD2E3, 0x4325, 0xD2E4, 0xD2E5, 0x0C6B,
- 0xD2E6, 0xD2EF, 0x432C, 0xD2F0, 0xD2F1, 0x0C6D, 0xD2F2, 0xD2F3, 0x4336,
- 0xD2F4, 0xD2F4, 0x0C6F, 0xD2F5, 0xD2F7, 0x4338, 0xD2F8, 0xD2F8, 0x0C70,
- 0xD2F9, 0xD2FF, 0x433B, 0xD300, 0xD301, 0x0C71, 0xD302, 0xD302, 0x4342,
- 0xD303, 0xD303, 0x0C73, 0xD304, 0xD304, 0x4343, 0xD305, 0xD305, 0x0C74,
- 0xD306, 0xD30B, 0x4344, 0xD30C, 0xD30E, 0x0C75, 0xD30F, 0xD30F, 0x434A,
- 0xD310, 0xD310, 0x0C78, 0xD311, 0xD313, 0x434B, 0xD314, 0xD314, 0x0C79,
- 0xD315, 0xD315, 0x434E, 0xD316, 0xD316, 0x0C7A, 0xD317, 0xD31B, 0x434F,
- 0xD31C, 0xD31D, 0x0C7B, 0xD31E, 0xD31E, 0x4354, 0xD31F, 0xD321, 0x0C7D,
- 0xD322, 0xD324, 0x4355, 0xD325, 0xD325, 0x0C80, 0xD326, 0xD327, 0x4358,
- 0xD328, 0xD329, 0x0C81, 0xD32A, 0xD32B, 0x435A, 0xD32C, 0xD32C, 0x0C83,
- 0xD32D, 0xD32F, 0x435C, 0xD330, 0xD330, 0x0C84, 0xD331, 0xD337, 0x435F,
- 0xD338, 0xD339, 0x0C85, 0xD33A, 0xD33A, 0x4366, 0xD33B, 0xD33D, 0x0C87,
- 0xD33E, 0xD343, 0x4367, 0xD344, 0xD345, 0x0C8A, 0xD346, 0xD37B, 0x436D,
- 0xD37C, 0xD37D, 0x0C8C, 0xD37E, 0xD37F, 0x43A3, 0xD380, 0xD380, 0x0C8E,
- 0xD381, 0xD383, 0x43A5, 0xD384, 0xD384, 0x0C8F, 0xD385, 0xD38B, 0x43A8,
- 0xD38C, 0xD38D, 0x0C90, 0xD38E, 0xD38E, 0x43AF, 0xD38F, 0xD391, 0x0C92,
- 0xD392, 0xD397, 0x43B0, 0xD398, 0xD399, 0x0C95, 0xD39A, 0xD39B, 0x43B6,
- 0xD39C, 0xD39C, 0x0C97, 0xD39D, 0xD39F, 0x43B8, 0xD3A0, 0xD3A0, 0x0C98,
- 0xD3A1, 0xD3A7, 0x43BB, 0xD3A8, 0xD3A9, 0x0C99, 0xD3AA, 0xD3AA, 0x43C2,
- 0xD3AB, 0xD3AB, 0x0C9B, 0xD3AC, 0xD3AC, 0x43C3, 0xD3AD, 0xD3AD, 0x0C9C,
- 0xD3AE, 0xD3B3, 0x43C4, 0xD3B4, 0xD3B4, 0x0C9D, 0xD3B5, 0xD3B7, 0x43CA,
- 0xD3B8, 0xD3B8, 0x0C9E, 0xD3B9, 0xD3BB, 0x43CD, 0xD3BC, 0xD3BC, 0x0C9F,
- 0xD3BD, 0xD3C3, 0x43D0, 0xD3C4, 0xD3C5, 0x0CA0, 0xD3C6, 0xD3C7, 0x43D7,
- 0xD3C8, 0xD3C9, 0x0CA2, 0xD3CA, 0xD3CF, 0x43D9, 0xD3D0, 0xD3D0, 0x0CA4,
- 0xD3D1, 0xD3D7, 0x43DF, 0xD3D8, 0xD3D8, 0x0CA5, 0xD3D9, 0xD3E0, 0x43E6,
- 0xD3E1, 0xD3E1, 0x0CA6, 0xD3E2, 0xD3E2, 0x43EE, 0xD3E3, 0xD3E3, 0x0CA7,
- 0xD3E4, 0xD3EB, 0x43EF, 0xD3EC, 0xD3ED, 0x0CA8, 0xD3EE, 0xD3EF, 0x43F7,
- 0xD3F0, 0xD3F0, 0x0CAA, 0xD3F1, 0xD3F3, 0x43F9, 0xD3F4, 0xD3F4, 0x0CAB,
- 0xD3F5, 0xD3FB, 0x43FC, 0xD3FC, 0xD3FD, 0x0CAC, 0xD3FE, 0xD3FE, 0x4403,
- 0xD3FF, 0xD3FF, 0x0CAE, 0xD400, 0xD400, 0x4404, 0xD401, 0xD401, 0x0CAF,
- 0xD402, 0xD407, 0x4405, 0xD408, 0xD408, 0x0CB0, 0xD409, 0xD41C, 0x440B,
- 0xD41D, 0xD41D, 0x0CB1, 0xD41E, 0xD43F, 0x441F, 0xD440, 0xD440, 0x0CB2,
- 0xD441, 0xD443, 0x4441, 0xD444, 0xD444, 0x0CB3, 0xD445, 0xD45B, 0x4444,
- 0xD45C, 0xD45C, 0x0CB4, 0xD45D, 0xD45F, 0x445B, 0xD460, 0xD460, 0x0CB5,
- 0xD461, 0xD463, 0x445E, 0xD464, 0xD464, 0x0CB6, 0xD465, 0xD46C, 0x4461,
- 0xD46D, 0xD46D, 0x0CB7, 0xD46E, 0xD46E, 0x4469, 0xD46F, 0xD46F, 0x0CB8,
- 0xD470, 0xD477, 0x446A, 0xD478, 0xD479, 0x0CB9, 0xD47A, 0xD47B, 0x4472,
- 0xD47C, 0xD47C, 0x0CBB, 0xD47D, 0xD47E, 0x4474, 0xD47F, 0xD480, 0x0CBC,
- 0xD481, 0xD481, 0x4476, 0xD482, 0xD482, 0x0CBE, 0xD483, 0xD487, 0x4477,
- 0xD488, 0xD489, 0x0CBF, 0xD48A, 0xD48A, 0x447C, 0xD48B, 0xD48B, 0x0CC1,
- 0xD48C, 0xD48C, 0x447D, 0xD48D, 0xD48D, 0x0CC2, 0xD48E, 0xD493, 0x447E,
- 0xD494, 0xD494, 0x0CC3, 0xD495, 0xD4A8, 0x4484, 0xD4A9, 0xD4A9, 0x0CC4,
- 0xD4AA, 0xD4CB, 0x4498, 0xD4CC, 0xD4CC, 0x0CC5, 0xD4CD, 0xD4CF, 0x44BA,
- 0xD4D0, 0xD4D0, 0x0CC6, 0xD4D1, 0xD4D3, 0x44BD, 0xD4D4, 0xD4D4, 0x0CC7,
- 0xD4D5, 0xD4DB, 0x44C0, 0xD4DC, 0xD4DC, 0x0CC8, 0xD4DD, 0xD4DE, 0x44C7,
- 0xD4DF, 0xD4DF, 0x0CC9, 0xD4E0, 0xD4E7, 0x44C9, 0xD4E8, 0xD4E8, 0x0CCA,
- 0xD4E9, 0xD4EB, 0x44D1, 0xD4EC, 0xD4EC, 0x0CCB, 0xD4ED, 0xD4EF, 0x44D4,
- 0xD4F0, 0xD4F0, 0x0CCC, 0xD4F1, 0xD4F7, 0x44D7, 0xD4F8, 0xD4F8, 0x0CCD,
- 0xD4F9, 0xD4FA, 0x44DE, 0xD4FB, 0xD4FB, 0x0CCE, 0xD4FC, 0xD4FC, 0x44E0,
- 0xD4FD, 0xD4FD, 0x0CCF, 0xD4FE, 0xD4FF, 0x44E1, 0xD500, 0xD503, 0x44E3,
- 0xD504, 0xD504, 0x0CD0, 0xD505, 0xD507, 0x44E7, 0xD508, 0xD508, 0x0CD1,
- 0xD509, 0xD50B, 0x44EA, 0xD50C, 0xD50C, 0x0CD2, 0xD50D, 0xD513, 0x44ED,
- 0xD514, 0xD515, 0x0CD3, 0xD516, 0xD516, 0x44F4, 0xD517, 0xD517, 0x0CD5,
- 0xD518, 0xD53B, 0x44F5, 0xD53C, 0xD53D, 0x0CD6, 0xD53E, 0xD53F, 0x4519,
- 0xD540, 0xD540, 0x0CD8, 0xD541, 0xD543, 0x451B, 0xD544, 0xD544, 0x0CD9,
- 0xD545, 0xD54B, 0x451E, 0xD54C, 0xD54D, 0x0CDA, 0xD54E, 0xD54E, 0x4525,
- 0xD54F, 0xD54F, 0x0CDC, 0xD550, 0xD550, 0x4526, 0xD551, 0xD551, 0x0CDD,
- 0xD552, 0xD557, 0x4527, 0xD558, 0xD559, 0x0CDE, 0xD55A, 0xD55B, 0x452D,
- 0xD55C, 0xD55C, 0x0CE0, 0xD55D, 0xD55F, 0x452F, 0xD560, 0xD560, 0x0CE1,
- 0xD561, 0xD564, 0x4532, 0xD565, 0xD565, 0x0CE2, 0xD566, 0xD567, 0x4536,
- 0xD568, 0xD569, 0x0CE3, 0xD56A, 0xD56A, 0x4538, 0xD56B, 0xD56B, 0x0CE5,
- 0xD56C, 0xD56C, 0x4539, 0xD56D, 0xD56D, 0x0CE6, 0xD56E, 0xD573, 0x453A,
- 0xD574, 0xD575, 0x0CE7, 0xD576, 0xD577, 0x4540, 0xD578, 0xD578, 0x0CE9,
- 0xD579, 0xD57B, 0x4542, 0xD57C, 0xD57C, 0x0CEA, 0xD57D, 0xD583, 0x4545,
- 0xD584, 0xD585, 0x0CEB, 0xD586, 0xD586, 0x454C, 0xD587, 0xD589, 0x0CED,
- 0xD58A, 0xD58F, 0x454D, 0xD590, 0xD590, 0x0CF0, 0xD591, 0xD5A4, 0x4553,
- 0xD5A5, 0xD5A5, 0x0CF1, 0xD5A6, 0xD5C7, 0x4567, 0xD5C8, 0xD5C9, 0x0CF2,
- 0xD5CA, 0xD5CB, 0x4589, 0xD5CC, 0xD5CC, 0x0CF4, 0xD5CD, 0xD5CF, 0x458B,
- 0xD5D0, 0xD5D0, 0x0CF5, 0xD5D1, 0xD5D1, 0x458E, 0xD5D2, 0xD5D2, 0x0CF6,
- 0xD5D3, 0xD5D7, 0x458F, 0xD5D8, 0xD5D9, 0x0CF7, 0xD5DA, 0xD5DA, 0x4594,
- 0xD5DB, 0xD5DB, 0x0CF9, 0xD5DC, 0xD5DC, 0x4595, 0xD5DD, 0xD5DD, 0x0CFA,
- 0xD5DE, 0xD5E3, 0x4596, 0xD5E4, 0xD5E5, 0x0CFB, 0xD5E6, 0xD5E7, 0x459C,
- 0xD5E8, 0xD5E8, 0x0CFD, 0xD5E9, 0xD5EB, 0x459E, 0xD5EC, 0xD5EC, 0x0CFE,
- 0xD5ED, 0xD5F3, 0x45A1, 0xD5F4, 0xD5F5, 0x0CFF, 0xD5F6, 0xD5F6, 0x45A8,
- 0xD5F7, 0xD5F7, 0x0D01, 0xD5F8, 0xD5F8, 0x45A9, 0xD5F9, 0xD5F9, 0x0D02,
- 0xD5FA, 0xD5FF, 0x45AA, 0xD600, 0xD601, 0x0D03, 0xD602, 0xD603, 0x45B0,
- 0xD604, 0xD604, 0x0D05, 0xD605, 0xD607, 0x45B2, 0xD608, 0xD608, 0x0D06,
- 0xD609, 0xD60F, 0x45B5, 0xD610, 0xD611, 0x0D07, 0xD612, 0xD612, 0x45BC,
- 0xD613, 0xD615, 0x0D09, 0xD616, 0xD61B, 0x45BD, 0xD61C, 0xD61C, 0x0D0C,
- 0xD61D, 0xD61F, 0x45C3, 0xD620, 0xD620, 0x0D0D, 0xD621, 0xD623, 0x45C6,
- 0xD624, 0xD624, 0x0D0E, 0xD625, 0xD62C, 0x45C9, 0xD62D, 0xD62D, 0x0D0F,
- 0xD62E, 0xD637, 0x45D1, 0xD638, 0xD639, 0x0D10, 0xD63A, 0xD63B, 0x45DB,
- 0xD63C, 0xD63C, 0x0D12, 0xD63D, 0xD63F, 0x45DD, 0xD640, 0xD640, 0x0D13,
- 0xD641, 0xD644, 0x45E0, 0xD645, 0xD645, 0x0D14, 0xD646, 0xD647, 0x45E4,
- 0xD648, 0xD649, 0x0D15, 0xD64A, 0xD64A, 0x45E6, 0xD64B, 0xD64B, 0x0D17,
- 0xD64C, 0xD64C, 0x45E7, 0xD64D, 0xD64D, 0x0D18, 0xD64E, 0xD650, 0x45E8,
- 0xD651, 0xD651, 0x0D19, 0xD652, 0xD653, 0x45EB, 0xD654, 0xD655, 0x0D1A,
- 0xD656, 0xD657, 0x45ED, 0xD658, 0xD658, 0x0D1C, 0xD659, 0xD65B, 0x45EF,
- 0xD65C, 0xD65C, 0x0D1D, 0xD65D, 0xD666, 0x45F2, 0xD667, 0xD667, 0x0D1E,
- 0xD668, 0xD668, 0x45FC, 0xD669, 0xD669, 0x0D1F, 0xD66A, 0xD66F, 0x45FD,
- 0xD670, 0xD671, 0x0D20, 0xD672, 0xD673, 0x4603, 0xD674, 0xD674, 0x0D22,
- 0xD675, 0xD682, 0x4605, 0xD683, 0xD683, 0x0D23, 0xD684, 0xD684, 0x4613,
- 0xD685, 0xD685, 0x0D24, 0xD686, 0xD68B, 0x4614, 0xD68C, 0xD68D, 0x0D25,
- 0xD68E, 0xD68F, 0x461A, 0xD690, 0xD690, 0x0D27, 0xD691, 0xD693, 0x461C,
- 0xD694, 0xD694, 0x0D28, 0xD695, 0xD69C, 0x461F, 0xD69D, 0xD69D, 0x0D29,
- 0xD69E, 0xD69E, 0x4627, 0xD69F, 0xD69F, 0x0D2A, 0xD6A0, 0xD6A0, 0x4628,
- 0xD6A1, 0xD6A1, 0x0D2B, 0xD6A2, 0xD6A7, 0x4629, 0xD6A8, 0xD6A8, 0x0D2C,
- 0xD6A9, 0xD6AB, 0x462F, 0xD6AC, 0xD6AC, 0x0D2D, 0xD6AD, 0xD6AF, 0x4632,
- 0xD6B0, 0xD6B0, 0x0D2E, 0xD6B1, 0xD6B8, 0x4635, 0xD6B9, 0xD6B9, 0x0D2F,
- 0xD6BA, 0xD6BA, 0x463D, 0xD6BB, 0xD6BB, 0x0D30, 0xD6BC, 0xD6C3, 0x463E,
- 0xD6C4, 0xD6C5, 0x0D31, 0xD6C6, 0xD6C7, 0x4646, 0xD6C8, 0xD6C8, 0x0D33,
- 0xD6C9, 0xD6CB, 0x4648, 0xD6CC, 0xD6CC, 0x0D34, 0xD6CD, 0xD6D0, 0x464B,
- 0xD6D1, 0xD6D1, 0x0D35, 0xD6D2, 0xD6D3, 0x464F, 0xD6D4, 0xD6D4, 0x0D36,
- 0xD6D5, 0xD6D6, 0x4651, 0xD6D7, 0xD6D7, 0x0D37, 0xD6D8, 0xD6D8, 0x4653,
- 0xD6D9, 0xD6D9, 0x0D38, 0xD6DA, 0xD6DF, 0x4654, 0xD6E0, 0xD6E0, 0x0D39,
- 0xD6E1, 0xD6E3, 0x465A, 0xD6E4, 0xD6E4, 0x0D3A, 0xD6E5, 0xD6E7, 0x465D,
- 0xD6E8, 0xD6E8, 0x0D3B, 0xD6E9, 0xD6EF, 0x4660, 0xD6F0, 0xD6F0, 0x0D3C,
- 0xD6F1, 0xD6F4, 0x4667, 0xD6F5, 0xD6F5, 0x0D3D, 0xD6F6, 0xD6FB, 0x466B,
- 0xD6FC, 0xD6FD, 0x0D3E, 0xD6FE, 0xD6FF, 0x4671, 0xD700, 0xD700, 0x0D40,
- 0xD701, 0xD703, 0x4673, 0xD704, 0xD704, 0x0D41, 0xD705, 0xD710, 0x4676,
- 0xD711, 0xD711, 0x0D42, 0xD712, 0xD717, 0x4682, 0xD718, 0xD719, 0x0D43,
- 0xD71A, 0xD71B, 0x4688, 0xD71C, 0xD71C, 0x0D45, 0xD71D, 0xD71F, 0x468A,
- 0xD720, 0xD720, 0x0D46, 0xD721, 0xD727, 0x468D, 0xD728, 0xD729, 0x0D47,
- 0xD72A, 0xD72A, 0x4694, 0xD72B, 0xD72B, 0x0D49, 0xD72C, 0xD72C, 0x4695,
- 0xD72D, 0xD72D, 0x0D4A, 0xD72E, 0xD733, 0x4696, 0xD734, 0xD735, 0x0D4B,
- 0xD736, 0xD737, 0x469C, 0xD738, 0xD738, 0x0D4D, 0xD739, 0xD73B, 0x469E,
- 0xD73C, 0xD73C, 0x0D4E, 0xD73D, 0xD743, 0x46A1, 0xD744, 0xD744, 0x0D4F,
- 0xD745, 0xD746, 0x46A8, 0xD747, 0xD747, 0x0D50, 0xD748, 0xD748, 0x46AA,
- 0xD749, 0xD749, 0x0D51, 0xD74A, 0xD74F, 0x46AB, 0xD750, 0xD751, 0x0D52,
- 0xD752, 0xD753, 0x46B1, 0xD754, 0xD754, 0x0D54, 0xD755, 0xD755, 0x46B3,
- 0xD756, 0xD759, 0x0D55, 0xD75A, 0xD75F, 0x46B4, 0xD760, 0xD761, 0x0D59,
- 0xD762, 0xD762, 0x46BA, 0xD763, 0xD763, 0x0D5B, 0xD764, 0xD764, 0x46BB,
- 0xD765, 0xD765, 0x0D5C, 0xD766, 0xD768, 0x46BC, 0xD769, 0xD769, 0x0D5D,
- 0xD76A, 0xD76B, 0x46BF, 0xD76C, 0xD76C, 0x0D5E, 0xD76D, 0xD76F, 0x46C1,
- 0xD770, 0xD770, 0x0D5F, 0xD771, 0xD773, 0x46C4, 0xD774, 0xD774, 0x0D60,
- 0xD775, 0xD77B, 0x46C7, 0xD77C, 0xD77D, 0x0D61, 0xD77E, 0xD780, 0x46CE,
- 0xD781, 0xD781, 0x0D63, 0xD782, 0xD787, 0x46D1, 0xD788, 0xD789, 0x0D64,
- 0xD78A, 0xD78B, 0x46D7, 0xD78C, 0xD78C, 0x0D66, 0xD78D, 0xD78F, 0x46D9,
- 0xD790, 0xD790, 0x0D67, 0xD791, 0xD797, 0x46DC, 0xD798, 0xD799, 0x0D68,
- 0xD79A, 0xD79A, 0x46E3, 0xD79B, 0xD79B, 0x0D6A, 0xD79C, 0xD79C, 0x46E4,
- 0xD79D, 0xD79D, 0x0D6B, 0xD79E, 0xD7A3, 0x46E5, 0xF900, 0xF900, 0x1014,
- 0xF901, 0xF901, 0x0E5E, 0xF902, 0xF902, 0x1B8D, 0xF903, 0xF903, 0x0D84,
- 0xF904, 0xF904, 0x1EDC, 0xF905, 0xF905, 0x0EDA, 0xF906, 0xF906, 0x0F3E,
- 0xF907, 0xF907, 0x0F6A, 0xF908, 0xF908, 0x0F6A, 0xF909, 0xF909, 0x0E7C,
- 0xF90A, 0xF90A, 0x1023, 0xF90B, 0xF90B, 0x1116, 0xF90C, 0xF90C, 0x103C,
- 0xF90D, 0xF913, 0x1117, 0xF914, 0xF914, 0x16A8, 0xF915, 0xF917, 0x111E,
- 0xF918, 0xF91D, 0x1122, 0xF91E, 0xF920, 0x112A, 0xF921, 0xF921, 0x112F,
- 0xF922, 0xF922, 0x1133, 0xF923, 0xF924, 0x1136, 0xF925, 0xF92B, 0x1139,
- 0xF92C, 0xF92D, 0x1143, 0xF92E, 0xF92E, 0x1148, 0xF92F, 0xF92F, 0x119F,
- 0xF930, 0xF931, 0x11A1, 0xF932, 0xF937, 0x11A5, 0xF938, 0xF93A, 0x11AC,
- 0xF93B, 0xF940, 0x11B0, 0xF941, 0xF943, 0x11B7, 0xF944, 0xF945, 0x11BD,
- 0xF946, 0xF948, 0x11C1, 0xF949, 0xF949, 0x11C6, 0xF94A, 0xF94A, 0x11D4,
- 0xF94B, 0xF94E, 0x11D6, 0xF94F, 0xF950, 0x11DB, 0xF951, 0xF951, 0x11E0,
- 0xF952, 0xF955, 0x11FC, 0xF956, 0xF959, 0x1201, 0xF95A, 0xF95A, 0x10DE,
- 0xF95B, 0xF95B, 0x1028, 0xF95C, 0xF95C, 0x16A8, 0xF95D, 0xF95D, 0x102B,
- 0xF95E, 0xF95E, 0x1060, 0xF95F, 0xF95F, 0x1047, 0xF960, 0xF960, 0x104C,
- 0xF961, 0xF961, 0x15B0, 0xF962, 0xF962, 0x1918, 0xF963, 0xF963, 0x141F,
- 0xF964, 0xF964, 0x133A, 0xF965, 0xF965, 0x1D5E, 0xF966, 0xF966, 0x13D7,
- 0xF967, 0xF967, 0x13F5, 0xF968, 0xF968, 0x1DB7, 0xF969, 0xF969, 0x15D0,
- 0xF96A, 0xF96A, 0x14F7, 0xF96B, 0xF96B, 0x1BAB, 0xF96C, 0xF96C, 0x14F2,
- 0xF96D, 0xF96D, 0x156D, 0xF96E, 0xF96E, 0x1771, 0xF96F, 0xF96F, 0x1554,
- 0xF970, 0xF970, 0x14C5, 0xF971, 0xF971, 0x1B61, 0xF972, 0xF972, 0x1CCA,
- 0xF973, 0xF973, 0x162E, 0xF974, 0xF974, 0x16F2, 0xF975, 0xF977, 0x1149,
- 0xF978, 0xF97A, 0x114D, 0xF97B, 0xF97D, 0x1153, 0xF97E, 0xF97E, 0x1157,
- 0xF97F, 0xF980, 0x115A, 0xF981, 0xF981, 0x103F, 0xF982, 0xF982, 0x115C,
- 0xF983, 0xF983, 0x115F, 0xF984, 0xF985, 0x1161, 0xF986, 0xF986, 0x1165,
- 0xF987, 0xF98C, 0x1167, 0xF98D, 0xF98D, 0x116F, 0xF98E, 0xF98E, 0x1040,
- 0xF98F, 0xF990, 0x1171, 0xF991, 0xF991, 0x1041, 0xF992, 0xF994, 0x1174,
- 0xF995, 0xF995, 0x1042, 0xF996, 0xF997, 0x1177, 0xF998, 0xF998, 0x117A,
- 0xF999, 0xF999, 0x1179, 0xF99A, 0xF99B, 0x117B, 0xF99C, 0xF99D, 0x117E,
- 0xF99E, 0xF99E, 0x192F, 0xF99F, 0xF9A0, 0x1181, 0xF9A1, 0xF9A1, 0x1554,
- 0xF9A2, 0xF9A2, 0x1183, 0xF9A3, 0xF9A3, 0x1043, 0xF9A4, 0xF9A4, 0x1046,
- 0xF9A5, 0xF9A5, 0x1185, 0xF9A6, 0xF9A8, 0x1187, 0xF9A9, 0xF9A9, 0x118B,
- 0xF9AA, 0xF9AA, 0x1047, 0xF9AB, 0xF9AD, 0x118D, 0xF9AE, 0xF9AE, 0x1E67,
- 0xF9AF, 0xF9AF, 0x1191, 0xF9B0, 0xF9B0, 0x1193, 0xF9B1, 0xF9B4, 0x1195,
- 0xF9B5, 0xF9B5, 0x119A, 0xF9B6, 0xF9B8, 0x119C, 0xF9B9, 0xF9B9, 0x16A5,
- 0xF9BA, 0xF9BC, 0x11C7, 0xF9BD, 0xF9BD, 0x1054, 0xF9BE, 0xF9BE, 0x11CB,
- 0xF9BF, 0xF9BF, 0x16A8, 0xF9C0, 0xF9C1, 0x11CC, 0xF9C2, 0xF9C3, 0x11D0,
- 0xF9C4, 0xF9C4, 0x11D3, 0xF9C5, 0xF9C5, 0x1F34, 0xF9C6, 0xF9C6, 0x17EB,
- 0xF9C7, 0xF9C7, 0x11E1, 0xF9C8, 0xF9C8, 0x1057, 0xF9C9, 0xF9C9, 0x11E3,
- 0xF9CA, 0xF9CB, 0x11E5, 0xF9CC, 0xF9CC, 0x11E8, 0xF9CD, 0xF9CD, 0x11EA,
- 0xF9CE, 0xF9CE, 0x11EC, 0xF9CF, 0xF9CF, 0x1058, 0xF9D0, 0xF9D3, 0x11EE,
- 0xF9D4, 0xF9D6, 0x11F3, 0xF9D7, 0xF9DA, 0x11F7, 0xF9DB, 0xF9DB, 0x15B0,
- 0xF9DC, 0xF9DC, 0x11FB, 0xF9DD, 0xF9DD, 0x1206, 0xF9DE, 0xF9DE, 0x1208,
- 0xF9DF, 0xF9DF, 0x120A, 0xF9E0, 0xF9E0, 0x173E, 0xF9E1, 0xF9E2, 0x120C,
- 0xF9E3, 0xF9E3, 0x105B, 0xF9E4, 0xF9E4, 0x1211, 0xF9E5, 0xF9E5, 0x1213,
- 0xF9E6, 0xF9E6, 0x1215, 0xF9E7, 0xF9E9, 0x1218, 0xF9EA, 0xF9EA, 0x121C,
- 0xF9EB, 0xF9EC, 0x105C, 0xF9ED, 0xF9ED, 0x121E, 0xF9EE, 0xF9F0, 0x1220,
- 0xF9F1, 0xF9F5, 0x1224, 0xF9F6, 0xF9F6, 0x122A, 0xF9F7, 0xF9F9, 0x122D,
- 0xF9FA, 0xF9FA, 0x14E7, 0xF9FB, 0xF9FB, 0x195E, 0xF9FC, 0xF9FC, 0x1663,
- 0xF9FD, 0xF9FD, 0x168B, 0xF9FE, 0xF9FE, 0x105F, 0xF9FF, 0xF9FF, 0x1954,
- 0xFA00, 0xFA00, 0x1A1C, 0xFA01, 0xFA01, 0x10B7, 0xFA02, 0xFA02, 0x1BE3,
- 0xFA03, 0xFA03, 0x1097, 0xFA04, 0xFA04, 0x10AA, 0xFA05, 0xFA05, 0x10F4,
- 0xFA06, 0xFA06, 0x1D94, 0xFA07, 0xFA07, 0x13E0, 0xFA08, 0xFA08, 0x1E1D,
- 0xFA09, 0xFA09, 0x0DE6, 0xFA0A, 0xFA0A, 0x0E3C, 0xFA0B, 0xFA0B, 0x0EE7,
- 0xFF01, 0xFF3B, 0x0108, 0xFF3C, 0xFF3C, 0x0070, 0xFF3D, 0xFF5D, 0x0144,
- 0xFF5E, 0xFF5E, 0x0071, 0xFFE0, 0xFFE1, 0x008F, 0xFFE2, 0xFFE2, 0x00C2,
- 0xFFE3, 0xFFE3, 0x0165, 0xFFE5, 0xFFE5, 0x0091, 0xFFE6, 0xFFE6, 0x0143,
-};
+// 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
+
+extern const unsigned short g_FXCMAP_UniKS_UCS2_H_1[8394 * 3] = {
+ 0x0020, 0x007E, 0x0001, 0x00A1, 0x00A1, 0x00D0, 0x00A4, 0x00A4, 0x00D6,
+ 0x00A7, 0x00A7, 0x009B, 0x00A8, 0x00A8, 0x006B, 0x00AA, 0x00AA, 0x029C,
+ 0x00AB, 0x00AB, 0x00B0, 0x00B0, 0x00B0, 0x008A, 0x00B1, 0x00B1, 0x0082,
+ 0x00B2, 0x00B3, 0x034B, 0x00B4, 0x00B4, 0x00C7, 0x00B6, 0x00B6, 0x00F4,
+ 0x00B8, 0x00B8, 0x00CE, 0x00B9, 0x00B9, 0x034A, 0x00BA, 0x00BA, 0x02A3,
+ 0x00BB, 0x00BB, 0x00B1, 0x00BC, 0x00BC, 0x02EF, 0x00BD, 0x00BD, 0x02EC,
+ 0x00BE, 0x00BE, 0x02F0, 0x00BF, 0x00BF, 0x00D1, 0x00C6, 0x00C6, 0x029A,
+ 0x00D0, 0x00D0, 0x029B, 0x00D7, 0x00D7, 0x0083, 0x00D8, 0x00D8, 0x02A1,
+ 0x00DE, 0x00DE, 0x02A4, 0x00DF, 0x00DF, 0x0300, 0x00E6, 0x00E6, 0x02F5,
+ 0x00F0, 0x00F0, 0x02F7, 0x00F7, 0x00F7, 0x0084, 0x00F8, 0x00F8, 0x02FE,
+ 0x00FE, 0x00FE, 0x0301, 0x0111, 0x0111, 0x02F6, 0x0126, 0x0126, 0x029D,
+ 0x0127, 0x0127, 0x02F8, 0x0131, 0x0131, 0x02F9, 0x0132, 0x0132, 0x029E,
+ 0x0133, 0x0133, 0x02FA, 0x0138, 0x0138, 0x02FB, 0x013F, 0x013F, 0x029F,
+ 0x0140, 0x0140, 0x02FC, 0x0141, 0x0141, 0x02A0, 0x0142, 0x0142, 0x02FD,
+ 0x0149, 0x0149, 0x0304, 0x014A, 0x014A, 0x02A6, 0x014B, 0x014B, 0x0303,
+ 0x0152, 0x0152, 0x02A2, 0x0153, 0x0153, 0x02FF, 0x0166, 0x0166, 0x02A5,
+ 0x0167, 0x0167, 0x0302, 0x02BC, 0x02BC, 0x2053, 0x02C7, 0x02C7, 0x00C9,
+ 0x02D8, 0x02D8, 0x00CA, 0x02D9, 0x02D9, 0x00CD, 0x02DA, 0x02DA, 0x00CC,
+ 0x02DB, 0x02DB, 0x00CF, 0x02DC, 0x02DC, 0x00C8, 0x02DD, 0x02DD, 0x00CB,
+ 0x0391, 0x03A1, 0x01D7, 0x03A3, 0x03A9, 0x01E8, 0x03B1, 0x03C1, 0x01EF,
+ 0x03C3, 0x03C9, 0x0200, 0x0401, 0x0401, 0x0402, 0x0410, 0x0415, 0x03FC,
+ 0x0416, 0x0435, 0x0403, 0x0436, 0x044F, 0x0424, 0x0451, 0x0451, 0x0423,
+ 0x2013, 0x2014, 0x006D, 0x2016, 0x2016, 0x006F, 0x2018, 0x2019, 0x0072,
+ 0x201B, 0x201B, 0x202E, 0x201C, 0x201D, 0x0074, 0x201F, 0x201F, 0x202D,
+ 0x2020, 0x2021, 0x00F5, 0x2022, 0x2022, 0x219F, 0x2025, 0x2026, 0x0069,
+ 0x2030, 0x2030, 0x00D8, 0x2032, 0x2033, 0x008B, 0x2034, 0x2034, 0x2186,
+ 0x2035, 0x2035, 0x246E, 0x2036, 0x2036, 0x246C, 0x2039, 0x203A, 0x21A4,
+ 0x203B, 0x203B, 0x009C, 0x203C, 0x203C, 0x223B, 0x2042, 0x2042, 0x2197,
+ 0x2074, 0x2074, 0x034D, 0x207A, 0x207B, 0x202F, 0x207C, 0x207C, 0x2038,
+ 0x207D, 0x207E, 0x203A, 0x207F, 0x207F, 0x034E, 0x2081, 0x2084, 0x034F,
+ 0x2103, 0x2103, 0x008D, 0x2109, 0x2109, 0x00D7, 0x2113, 0x2113, 0x024E,
+ 0x2116, 0x2116, 0x0102, 0x2121, 0x2121, 0x0107, 0x2122, 0x2122, 0x0104,
+ 0x2126, 0x2126, 0x0283, 0x212B, 0x212B, 0x008E, 0x2153, 0x2154, 0x02ED,
+ 0x215B, 0x215E, 0x02F1, 0x2160, 0x2169, 0x01CD, 0x2170, 0x2179, 0x01C3,
+ 0x2190, 0x2191, 0x00AB, 0x2192, 0x2192, 0x00AA, 0x2193, 0x2194, 0x00AD,
+ 0x2195, 0x2195, 0x00F7, 0x2196, 0x2196, 0x00FA, 0x2197, 0x2197, 0x00F8,
+ 0x2198, 0x2198, 0x00FB, 0x2199, 0x2199, 0x00F9, 0x21B0, 0x21B0, 0x22A4,
+ 0x21B1, 0x21B1, 0x22A1, 0x21B2, 0x21B2, 0x22A0, 0x21B3, 0x21B3, 0x22A5,
+ 0x21B4, 0x21B4, 0x22A3, 0x21BC, 0x21BC, 0x22B4, 0x21C0, 0x21C0, 0x22B5,
+ 0x21C4, 0x21C5, 0x22C0, 0x21CD, 0x21CD, 0x2270, 0x21CF, 0x21CF, 0x226F,
+ 0x21D0, 0x21D0, 0x226E, 0x21D1, 0x21D1, 0x2296, 0x21D2, 0x21D2, 0x00C3,
+ 0x21D3, 0x21D3, 0x2297, 0x21D4, 0x21D4, 0x00C4, 0x21E0, 0x21E0, 0x23E6,
+ 0x21E1, 0x21E1, 0x23E8, 0x21E2, 0x21E2, 0x23E7, 0x21E3, 0x21E3, 0x23E9,
+ 0x21E6, 0x21E6, 0x23EE, 0x21E7, 0x21E7, 0x23F0, 0x21E8, 0x21E8, 0x23EF,
+ 0x21E9, 0x21E9, 0x23F1, 0x2200, 0x2200, 0x00C5, 0x2202, 0x2202, 0x0097,
+ 0x2203, 0x2203, 0x00C6, 0x2206, 0x2206, 0x220B, 0x2207, 0x2207, 0x0098,
+ 0x2208, 0x2208, 0x00B8, 0x2209, 0x2209, 0x222D, 0x220B, 0x220B, 0x00B9,
+ 0x220C, 0x220C, 0x222E, 0x220F, 0x220F, 0x00D5, 0x2211, 0x2211, 0x00D4,
+ 0x2213, 0x2213, 0x2216, 0x221A, 0x221A, 0x00B2, 0x221D, 0x221D, 0x00B4,
+ 0x221E, 0x221E, 0x0088, 0x221F, 0x221F, 0x220D, 0x2220, 0x2220, 0x0094,
+ 0x2222, 0x2222, 0x2222, 0x2225, 0x2226, 0x220F, 0x2227, 0x2228, 0x00C0,
+ 0x2229, 0x2229, 0x00BF, 0x222A, 0x222A, 0x00BE, 0x222B, 0x222C, 0x00B6,
+ 0x222E, 0x222E, 0x00D3, 0x2234, 0x2234, 0x0089, 0x2235, 0x2235, 0x00B5,
+ 0x2236, 0x2236, 0x00D2, 0x2237, 0x2237, 0x2081, 0x223D, 0x223D, 0x00B3,
+ 0x2243, 0x2243, 0x2134, 0x2245, 0x2245, 0x2133, 0x2248, 0x2248, 0x2135,
+ 0x2250, 0x2250, 0x2223, 0x2251, 0x2251, 0x2213, 0x2252, 0x2252, 0x009A,
+ 0x2253, 0x2253, 0x2212, 0x225A, 0x225A, 0x2231, 0x2260, 0x2260, 0x0085,
+ 0x2261, 0x2261, 0x0099, 0x2262, 0x2262, 0x221E, 0x2264, 0x2265, 0x0086,
+ 0x2266, 0x2267, 0x2214, 0x226E, 0x226F, 0x2229, 0x2270, 0x2273, 0x2121,
+ 0x2276, 0x2277, 0x2129, 0x2279, 0x2279, 0x212B, 0x227A, 0x227B, 0x211B,
+ 0x2280, 0x2281, 0x211F, 0x2282, 0x2283, 0x00BC, 0x2284, 0x2284, 0x222C,
+ 0x2285, 0x2285, 0x222B, 0x2286, 0x2287, 0x00BA, 0x228A, 0x228A, 0x2126,
+ 0x228B, 0x228B, 0x2128, 0x2295, 0x2297, 0x2217, 0x22A3, 0x22A3, 0x2226,
+ 0x22A4, 0x22A4, 0x2137, 0x22A5, 0x22A5, 0x0095, 0x22BB, 0x22BC, 0x222F,
+ 0x22CE, 0x22CF, 0x211D, 0x22DA, 0x22DB, 0x212C, 0x22EE, 0x22EE, 0x2080,
+ 0x22EF, 0x22EF, 0x006A, 0x2306, 0x2306, 0x2232, 0x2312, 0x2312, 0x0096,
+ 0x2314, 0x2314, 0x221B, 0x2460, 0x246E, 0x02DD, 0x246F, 0x2473, 0x2257,
+ 0x2474, 0x2482, 0x033B, 0x2483, 0x2487, 0x2352, 0x249C, 0x24B5, 0x0321,
+ 0x24B6, 0x24CF, 0x20C4, 0x24D0, 0x24E9, 0x02C3, 0x2500, 0x2500, 0x0207,
+ 0x2501, 0x2501, 0x0212, 0x2502, 0x2502, 0x0208, 0x2503, 0x2503, 0x0213,
+ 0x250C, 0x250C, 0x0209, 0x250D, 0x250D, 0x022E, 0x250E, 0x250E, 0x022D,
+ 0x250F, 0x250F, 0x0214, 0x2510, 0x2510, 0x020A, 0x2511, 0x2511, 0x0228,
+ 0x2512, 0x2512, 0x0227, 0x2513, 0x2513, 0x0215, 0x2514, 0x2514, 0x020C,
+ 0x2515, 0x2515, 0x022C, 0x2516, 0x2516, 0x022B, 0x2517, 0x2517, 0x0217,
+ 0x2518, 0x2518, 0x020B, 0x2519, 0x2519, 0x022A, 0x251A, 0x251A, 0x0229,
+ 0x251B, 0x251B, 0x0216, 0x251C, 0x251C, 0x020D, 0x251D, 0x251D, 0x0222,
+ 0x251E, 0x251F, 0x022F, 0x2520, 0x2520, 0x021D, 0x2521, 0x2522, 0x0231,
+ 0x2523, 0x2523, 0x0218, 0x2524, 0x2524, 0x020F, 0x2525, 0x2525, 0x0224,
+ 0x2526, 0x2527, 0x0233, 0x2528, 0x2528, 0x021F, 0x2529, 0x252A, 0x0235,
+ 0x252B, 0x252B, 0x021A, 0x252C, 0x252C, 0x020E, 0x252D, 0x252E, 0x0237,
+ 0x252F, 0x252F, 0x021E, 0x2530, 0x2530, 0x0223, 0x2531, 0x2532, 0x0239,
+ 0x2533, 0x2533, 0x0219, 0x2534, 0x2534, 0x0210, 0x2535, 0x2536, 0x023B,
+ 0x2537, 0x2537, 0x0220, 0x2538, 0x2538, 0x0225, 0x2539, 0x253A, 0x023D,
+ 0x253B, 0x253B, 0x021B, 0x253C, 0x253C, 0x0211, 0x253D, 0x253E, 0x023F,
+ 0x253F, 0x253F, 0x0221, 0x2540, 0x2541, 0x0241, 0x2542, 0x2542, 0x0226,
+ 0x2543, 0x254A, 0x0243, 0x254B, 0x254B, 0x021C, 0x2592, 0x2592, 0x00E8,
+ 0x25A0, 0x25A0, 0x00A5, 0x25A1, 0x25A1, 0x00A4, 0x25A3, 0x25A3, 0x00E5,
+ 0x25A4, 0x25A5, 0x00E9, 0x25A6, 0x25A6, 0x00ED, 0x25A7, 0x25A7, 0x00EC,
+ 0x25A8, 0x25A8, 0x00EB, 0x25A9, 0x25A9, 0x00EE, 0x25B1, 0x25B1, 0x2220,
+ 0x25B2, 0x25B2, 0x00A7, 0x25B3, 0x25B3, 0x00A6, 0x25B5, 0x25B5, 0x224C,
+ 0x25B6, 0x25B6, 0x00DC, 0x25B7, 0x25B7, 0x00DB, 0x25B9, 0x25B9, 0x224D,
+ 0x25BC, 0x25BC, 0x00A9, 0x25BD, 0x25BD, 0x00A8, 0x25BF, 0x25BF, 0x224B,
+ 0x25C0, 0x25C0, 0x00DA, 0x25C1, 0x25C1, 0x00D9, 0x25C3, 0x25C3, 0x224E,
+ 0x25C6, 0x25C6, 0x00A3, 0x25C7, 0x25C7, 0x00A2, 0x25C8, 0x25C8, 0x00E4,
+ 0x25C9, 0x25C9, 0x00E3, 0x25CA, 0x25CA, 0x2253, 0x25CB, 0x25CB, 0x009F,
+ 0x25CC, 0x25CC, 0x21BF, 0x25CE, 0x25CE, 0x00A1, 0x25CF, 0x25CF, 0x00A0,
+ 0x25D0, 0x25D1, 0x00E6, 0x25E6, 0x25E6, 0x2247, 0x25EF, 0x25EF, 0x21B9,
+ 0x2605, 0x2605, 0x009E, 0x2606, 0x2606, 0x009D, 0x260E, 0x260E, 0x00F1,
+ 0x260F, 0x260F, 0x00F0, 0x261C, 0x261C, 0x00F2, 0x261D, 0x261D, 0x2406,
+ 0x261E, 0x261E, 0x00F3, 0x261F, 0x261F, 0x2407, 0x262F, 0x262F, 0x21D8,
+ 0x2640, 0x2640, 0x0093, 0x2642, 0x2642, 0x0092, 0x2660, 0x2661, 0x00DE,
+ 0x2663, 0x2663, 0x00E2, 0x2664, 0x2664, 0x00DD, 0x2665, 0x2665, 0x00E0,
+ 0x2667, 0x2667, 0x00E1, 0x2668, 0x2668, 0x00EF, 0x2669, 0x266A, 0x00FD,
+ 0x266C, 0x266C, 0x00FF, 0x266D, 0x266D, 0x00FC, 0x266F, 0x266F, 0x2192,
+ 0x2716, 0x2716, 0x21B7, 0x271A, 0x271A, 0x21B6, 0x273D, 0x273D, 0x219C,
+ 0x2756, 0x2756, 0x21BD, 0x2776, 0x277F, 0x21E1, 0x278A, 0x2793, 0x2096,
+ 0x3000, 0x3002, 0x0065, 0x3003, 0x3003, 0x006C, 0x3008, 0x3011, 0x0078,
+ 0x3012, 0x3012, 0x21FC, 0x3013, 0x3013, 0x00AF, 0x3014, 0x3015, 0x0076,
+ 0x3016, 0x3019, 0x201B, 0x301E, 0x301F, 0x246A, 0x3020, 0x3020, 0x21DF,
+ 0x3036, 0x3036, 0x21FD, 0x3041, 0x3093, 0x0353, 0x30A1, 0x30F6, 0x03A6,
+ 0x30FB, 0x30FB, 0x0068, 0x30FC, 0x30FC, 0x2472, 0x3131, 0x3163, 0x0166,
+ 0x3164, 0x3164, 0x0065, 0x3165, 0x318E, 0x0199, 0x3200, 0x321B, 0x0305,
+ 0x321C, 0x321C, 0x0101, 0x3231, 0x3231, 0x2254, 0x3239, 0x3239, 0x2255,
+ 0x3260, 0x327B, 0x02A7, 0x327F, 0x327F, 0x0100, 0x328A, 0x328F, 0x2455,
+ 0x3290, 0x3290, 0x2454, 0x3294, 0x3294, 0x2378, 0x329E, 0x329E, 0x2239,
+ 0x32A5, 0x32A5, 0x2388, 0x3380, 0x3384, 0x0273, 0x3388, 0x3389, 0x0264,
+ 0x338A, 0x338C, 0x0286, 0x338D, 0x338F, 0x0260, 0x3390, 0x3394, 0x027E,
+ 0x3395, 0x3397, 0x024B, 0x3398, 0x3398, 0x024F, 0x3399, 0x33A2, 0x0255,
+ 0x33A3, 0x33A6, 0x0251, 0x33A7, 0x33A8, 0x0267, 0x33A9, 0x33AC, 0x028F,
+ 0x33AD, 0x33AF, 0x028B, 0x33B0, 0x33B9, 0x0269, 0x33BA, 0x33BF, 0x0278,
+ 0x33C0, 0x33C1, 0x0284, 0x33C2, 0x33C2, 0x0105, 0x33C3, 0x33C3, 0x0296,
+ 0x33C4, 0x33C4, 0x0250, 0x33C5, 0x33C5, 0x028A, 0x33C6, 0x33C6, 0x0299,
+ 0x33C7, 0x33C7, 0x0103, 0x33C8, 0x33C8, 0x0266, 0x33C9, 0x33C9, 0x0297,
+ 0x33CA, 0x33CA, 0x025F, 0x33CB, 0x33CB, 0x2256, 0x33CF, 0x33CF, 0x0263,
+ 0x33D0, 0x33D0, 0x0294, 0x33D3, 0x33D3, 0x0295, 0x33D6, 0x33D6, 0x0289,
+ 0x33D8, 0x33D8, 0x0106, 0x33DB, 0x33DB, 0x028E, 0x33DC, 0x33DC, 0x0298,
+ 0x33DD, 0x33DD, 0x0293, 0x4E00, 0x4E00, 0x193C, 0x4E01, 0x4E01, 0x1A30,
+ 0x4E03, 0x4E03, 0x1CC4, 0x4E07, 0x4E07, 0x123E, 0x4E08, 0x4E08, 0x1986,
+ 0x4E09, 0x4E09, 0x14C8, 0x4E0A, 0x4E0A, 0x14D3, 0x4E0B, 0x4E0B, 0x1DC0,
+ 0x4E0D, 0x4E0D, 0x13F5, 0x4E11, 0x4E11, 0x1C78, 0x4E14, 0x4E14, 0x1B81,
+ 0x4E15, 0x4E15, 0x143D, 0x4E16, 0x4E16, 0x1574, 0x4E18, 0x4E18, 0x0F35,
+ 0x4E19, 0x4E19, 0x13B1, 0x4E1E, 0x4E1E, 0x1632, 0x4E2D, 0x4E2D, 0x1B0A,
+ 0x4E32, 0x4E32, 0x0EDA, 0x4E38, 0x4E38, 0x1ECA, 0x4E39, 0x4E39, 0x1060,
+ 0x4E3B, 0x4E3B, 0x1ACC, 0x4E42, 0x4E42, 0x178D, 0x4E43, 0x4E43, 0x103A,
+ 0x4E45, 0x4E45, 0x0F36, 0x4E4B, 0x4E4B, 0x1B1E, 0x4E4D, 0x4E4D, 0x1479,
+ 0x4E4E, 0x4E4E, 0x1E78, 0x4E4F, 0x4E4F, 0x1DBE, 0x4E56, 0x4E56, 0x0F0F,
+ 0x4E58, 0x4E58, 0x1633, 0x4E59, 0x4E59, 0x18EC, 0x4E5D, 0x4E5D, 0x0F37,
+ 0x4E5E, 0x4E5E, 0x0E1D, 0x4E5F, 0x4E5F, 0x16E6, 0x4E6B, 0x4E6B, 0x0DAC,
+ 0x4E6D, 0x4E6D, 0x10E9, 0x4E73, 0x4E73, 0x18A5, 0x4E76, 0x4E76, 0x13E4,
+ 0x4E77, 0x4E77, 0x14C3, 0x4E7E, 0x4E7E, 0x0E11, 0x4E82, 0x4E82, 0x1125,
+ 0x4E86, 0x4E86, 0x11C7, 0x4E88, 0x4E88, 0x172E, 0x4E8B, 0x4E8B, 0x147A,
+ 0x4E8C, 0x4E8C, 0x190D, 0x4E8E, 0x4E8E, 0x1835, 0x4E90, 0x4E90, 0x186C,
+ 0x4E91, 0x4E91, 0x185E, 0x4E92, 0x4E92, 0x1E79, 0x4E94, 0x4E94, 0x17A1,
+ 0x4E95, 0x4E95, 0x1A31, 0x4E98, 0x4E98, 0x0FDA, 0x4E9B, 0x4E9B, 0x147B,
+ 0x4E9E, 0x4E9E, 0x168F, 0x4EA1, 0x4EA1, 0x1258, 0x4EA2, 0x4EA2, 0x1DF6,
+ 0x4EA4, 0x4EA4, 0x0F1C, 0x4EA5, 0x4EA5, 0x1E05, 0x4EA6, 0x4EA6, 0x173B,
+ 0x4EA8, 0x4EA8, 0x1E5B, 0x4EAB, 0x4EAB, 0x1E1E, 0x4EAC, 0x4EAC, 0x0E4C,
+ 0x4EAD, 0x4EAD, 0x1A32, 0x4EAE, 0x4EAE, 0x114B, 0x4EB6, 0x4EB6, 0x1061,
+ 0x4EBA, 0x4EBA, 0x192B, 0x4EC0, 0x4EC0, 0x168B, 0x4EC1, 0x4EC1, 0x192C,
+ 0x4EC4, 0x4EC4, 0x1CA3, 0x4EC7, 0x4EC7, 0x0F38, 0x4ECA, 0x4ECA, 0x0FC6,
+ 0x4ECB, 0x4ECB, 0x0DE8, 0x4ECD, 0x4ECD, 0x194F, 0x4ED4, 0x4ED4, 0x1953,
+ 0x4ED5, 0x4ED5, 0x147C, 0x4ED6, 0x4ED6, 0x1CD4, 0x4ED7, 0x4ED7, 0x1987,
+ 0x4ED8, 0x4ED8, 0x13F6, 0x4ED9, 0x4ED9, 0x152A, 0x4EDD, 0x4EDD, 0x10EB,
+ 0x4EDF, 0x4EDF, 0x1BEC, 0x4EE3, 0x4EE3, 0x109A, 0x4EE4, 0x4EE4, 0x1189,
+ 0x4EE5, 0x4EE5, 0x190E, 0x4EF0, 0x4EF0, 0x16C9, 0x4EF2, 0x4EF2, 0x1B0B,
+ 0x4EF6, 0x4EF6, 0x0E12, 0x4EF7, 0x4EF7, 0x0DE9, 0x4EFB, 0x4EFB, 0x1945,
+ 0x4F01, 0x4F01, 0x0FDE, 0x4F09, 0x4F09, 0x1DF7, 0x4F0A, 0x4F0A, 0x190F,
+ 0x4F0B, 0x4F0B, 0x0FD3, 0x4F0D, 0x4F0D, 0x17A2, 0x4F0E, 0x4F0E, 0x0FDF,
+ 0x4F0F, 0x4F0F, 0x13D2, 0x4F10, 0x4F10, 0x138D, 0x4F11, 0x4F11, 0x1F45,
+ 0x4F2F, 0x4F2F, 0x137C, 0x4F34, 0x4F34, 0x1329, 0x4F36, 0x4F36, 0x118A,
+ 0x4F38, 0x4F38, 0x1667, 0x4F3A, 0x4F3A, 0x147D, 0x4F3C, 0x4F3C, 0x147E,
+ 0x4F3D, 0x4F3D, 0x0D6C, 0x4F43, 0x4F43, 0x19F3, 0x4F46, 0x4F46, 0x1062,
+ 0x4F47, 0x4F47, 0x19BF, 0x4F48, 0x4F48, 0x1D78, 0x4F4D, 0x4F4D, 0x188C,
+ 0x4F4E, 0x4F4E, 0x19C0, 0x4F4F, 0x4F4F, 0x1ACD, 0x4F50, 0x4F50, 0x1AC6,
+ 0x4F51, 0x4F51, 0x1836, 0x4F55, 0x4F55, 0x1DC1, 0x4F59, 0x4F59, 0x172F,
+ 0x4F5A, 0x4F5A, 0x193D, 0x4F5B, 0x4F5B, 0x1433, 0x4F5C, 0x4F5C, 0x196D,
+ 0x4F69, 0x4F69, 0x1D4E, 0x4F6F, 0x4F6F, 0x16F7, 0x4F70, 0x4F70, 0x137D,
+ 0x4F73, 0x4F73, 0x0D6D, 0x4F76, 0x4F76, 0x101F, 0x4F7A, 0x4F7A, 0x19F4,
+ 0x4F7E, 0x4F7E, 0x193E, 0x4F7F, 0x4F7F, 0x147F, 0x4F81, 0x4F81, 0x1668,
+ 0x4F83, 0x4F83, 0x0D94, 0x4F84, 0x4F84, 0x1B67, 0x4F86, 0x4F86, 0x1144,
+ 0x4F88, 0x4F88, 0x1CA8, 0x4F8A, 0x4F8A, 0x0EFF, 0x4F8B, 0x4F8B, 0x119A,
+ 0x4F8D, 0x4F8D, 0x163C, 0x4F8F, 0x4F8F, 0x1ACE, 0x4F91, 0x4F91, 0x18A6,
+ 0x4F96, 0x4F96, 0x11F2, 0x4F98, 0x4F98, 0x1B82, 0x4F9B, 0x4F9B, 0x0ECA,
+ 0x4F9D, 0x4F9D, 0x18FA, 0x4FAE, 0x4FAE, 0x129C, 0x4FAF, 0x4FAF, 0x1F1E,
+ 0x4FB5, 0x4FB5, 0x1CC7, 0x4FB6, 0x4FB6, 0x1158, 0x4FBF, 0x4FBF, 0x1D5E,
+ 0x4FC2, 0x4FC2, 0x0E79, 0x4FC3, 0x4FC3, 0x1C49, 0x4FC4, 0x4FC4, 0x1690,
+ 0x4FC9, 0x4FC9, 0x17A3, 0x4FCA, 0x4FCA, 0x1AF6, 0x4FCE, 0x4FCE, 0x1A7E,
+ 0x4FD1, 0x4FD1, 0x181E, 0x4FD3, 0x4FD3, 0x0E4D, 0x4FD4, 0x4FD4, 0x1E36,
+ 0x4FD7, 0x4FD7, 0x15A1, 0x4FDA, 0x4FDA, 0x1205, 0x4FDD, 0x4FDD, 0x13C2,
+ 0x4FDF, 0x4FDF, 0x1480, 0x4FE0, 0x4FE0, 0x1E4F, 0x4FE1, 0x4FE1, 0x1669,
+ 0x4FEE, 0x4FEE, 0x15BF, 0x4FEF, 0x4FEF, 0x13F7, 0x4FF1, 0x4FF1, 0x0F39,
+ 0x4FF3, 0x4FF3, 0x136A, 0x4FF5, 0x4FF5, 0x1D98, 0x4FF8, 0x4FF8, 0x13E5,
+ 0x4FFA, 0x4FFA, 0x1725, 0x5002, 0x5002, 0x13B2, 0x5006, 0x5006, 0x114C,
+ 0x5009, 0x5009, 0x1BB4, 0x500B, 0x500B, 0x0DEA, 0x500D, 0x500D, 0x1369,
+ 0x5011, 0x5011, 0x12E4, 0x5012, 0x5012, 0x10AD, 0x5016, 0x5016, 0x1E19,
+ 0x5019, 0x5019, 0x1F1F, 0x501A, 0x501A, 0x18FB, 0x501C, 0x501C, 0x1BDE,
+ 0x501E, 0x501E, 0x0E4E, 0x501F, 0x501F, 0x1B83, 0x5021, 0x5021, 0x1BB5,
+ 0x5023, 0x5023, 0x134D, 0x5024, 0x5024, 0x1CA9, 0x5026, 0x5026, 0x0F81,
+ 0x5027, 0x5027, 0x1AB5, 0x5028, 0x5028, 0x0E01, 0x502A, 0x502A, 0x178E,
+ 0x502B, 0x502B, 0x11F3, 0x502C, 0x502C, 0x1CE2, 0x502D, 0x502D, 0x17F3,
+ 0x503B, 0x503B, 0x16E7, 0x5043, 0x5043, 0x171D, 0x5047, 0x5047, 0x0D6E,
+ 0x5048, 0x5048, 0x0E2B, 0x5049, 0x5049, 0x188D, 0x504F, 0x504F, 0x1D5F,
+ 0x5055, 0x5055, 0x1E06, 0x505A, 0x505A, 0x1ACF, 0x505C, 0x505C, 0x1A33,
+ 0x5065, 0x5065, 0x0E13, 0x5074, 0x5074, 0x1CA2, 0x5075, 0x5075, 0x1A34,
+ 0x5076, 0x5076, 0x1837, 0x5078, 0x5078, 0x1D29, 0x5080, 0x5080, 0x0F10,
+ 0x5085, 0x5085, 0x13F8, 0x508D, 0x508D, 0x134E, 0x5091, 0x5091, 0x0E1E,
+ 0x5098, 0x5098, 0x14B7, 0x5099, 0x5099, 0x143E, 0x50AC, 0x50AC, 0x1C5E,
+ 0x50AD, 0x50AD, 0x181F, 0x50B2, 0x50B2, 0x17A4, 0x50B3, 0x50B3, 0x19F5,
+ 0x50B5, 0x50B5, 0x1BCA, 0x50B7, 0x50B7, 0x14D4, 0x50BE, 0x50BE, 0x0E4F,
+ 0x50C5, 0x50C5, 0x0FB7, 0x50C9, 0x50C9, 0x1C09, 0x50CA, 0x50CA, 0x152B,
+ 0x50CF, 0x50CF, 0x14D5, 0x50D1, 0x50D1, 0x0F1D, 0x50D5, 0x50D5, 0x13D3,
+ 0x50D6, 0x50D6, 0x1F63, 0x50DA, 0x50DA, 0x11C8, 0x50DE, 0x50DE, 0x188E,
+ 0x50E5, 0x50E5, 0x17FC, 0x50E7, 0x50E7, 0x1634, 0x50ED, 0x50ED, 0x1BAA,
+ 0x50F9, 0x50F9, 0x0D6F, 0x50FB, 0x50FB, 0x139C, 0x50FF, 0x50FF, 0x1481,
+ 0x5100, 0x5100, 0x18FC, 0x5101, 0x5101, 0x1AF7, 0x5104, 0x5104, 0x1718,
+ 0x5106, 0x5106, 0x0E50, 0x5109, 0x5109, 0x0E21, 0x5112, 0x5112, 0x18A7,
+ 0x511F, 0x511F, 0x14D6, 0x5121, 0x5121, 0x11BF, 0x512A, 0x512A, 0x1838,
+ 0x5132, 0x5132, 0x19C1, 0x5137, 0x5137, 0x1159, 0x513A, 0x513A, 0x1025,
+ 0x513C, 0x513C, 0x1726, 0x5140, 0x5140, 0x17C9, 0x5141, 0x5141, 0x18D7,
+ 0x5143, 0x5143, 0x186F, 0x5144, 0x5144, 0x1E5C, 0x5145, 0x5145, 0x1C8A,
+ 0x5146, 0x5146, 0x1A7F, 0x5147, 0x5147, 0x1F4D, 0x5148, 0x5148, 0x152C,
+ 0x5149, 0x5149, 0x0F00, 0x514B, 0x514B, 0x0FB0, 0x514C, 0x514C, 0x1D07,
+ 0x514D, 0x514D, 0x127F, 0x514E, 0x514E, 0x1D19, 0x5152, 0x5152, 0x1691,
+ 0x515C, 0x515C, 0x10FC, 0x5162, 0x5162, 0x0FDB, 0x5165, 0x5165, 0x194D,
+ 0x5167, 0x5167, 0x103B, 0x5168, 0x5168, 0x19F6, 0x5169, 0x5169, 0x114D,
+ 0x516A, 0x516A, 0x18A8, 0x516B, 0x516B, 0x1D4B, 0x516C, 0x516C, 0x0ECB,
+ 0x516D, 0x516D, 0x11EF, 0x516E, 0x516E, 0x1E6F, 0x5171, 0x5171, 0x0ECC,
+ 0x5175, 0x5175, 0x13B3, 0x5176, 0x5176, 0x0FE0, 0x5177, 0x5177, 0x0F3A,
+ 0x5178, 0x5178, 0x19F7, 0x517C, 0x517C, 0x0E46, 0x5180, 0x5180, 0x0FE1,
+ 0x5186, 0x5186, 0x172D, 0x518A, 0x518A, 0x1BD6, 0x518D, 0x518D, 0x19AA,
+ 0x5192, 0x5192, 0x129D, 0x5195, 0x5195, 0x1280, 0x5197, 0x5197, 0x1820,
+ 0x51A0, 0x51A0, 0x0EEB, 0x51A5, 0x51A5, 0x128C, 0x51AA, 0x51AA, 0x127D,
+ 0x51AC, 0x51AC, 0x10EC, 0x51B6, 0x51B6, 0x16E8, 0x51B7, 0x51B7, 0x1148,
+ 0x51BD, 0x51BD, 0x117D, 0x51C4, 0x51C4, 0x1BDA, 0x51C6, 0x51C6, 0x1AF8,
+ 0x51C9, 0x51C9, 0x114E, 0x51CB, 0x51CB, 0x1A80, 0x51CC, 0x51CC, 0x11FF,
+ 0x51CD, 0x51CD, 0x10ED, 0x51DC, 0x51DC, 0x11FE, 0x51DD, 0x51DD, 0x18F6,
+ 0x51DE, 0x51DE, 0x1F64, 0x51E1, 0x51E1, 0x1391, 0x51F0, 0x51F0, 0x1EE0,
+ 0x51F1, 0x51F1, 0x0DEB, 0x51F6, 0x51F6, 0x1F4E, 0x51F8, 0x51F8, 0x1BFF,
+ 0x51F9, 0x51F9, 0x17FD, 0x51FA, 0x51FA, 0x1C87, 0x51FD, 0x51FD, 0x1DE3,
+ 0x5200, 0x5200, 0x10AE, 0x5203, 0x5203, 0x192D, 0x5206, 0x5206, 0x1420,
+ 0x5207, 0x5207, 0x1A1C, 0x5208, 0x5208, 0x178F, 0x520A, 0x520A, 0x0D95,
+ 0x520E, 0x520E, 0x12E5, 0x5211, 0x5211, 0x1E5D, 0x5217, 0x5217, 0x117E,
+ 0x521D, 0x521D, 0x1C2E, 0x5224, 0x5224, 0x1D42, 0x5225, 0x5225, 0x13AD,
+ 0x5229, 0x5229, 0x1206, 0x522A, 0x522A, 0x14B8, 0x522E, 0x522E, 0x0EFB,
+ 0x5230, 0x5230, 0x10AF, 0x5236, 0x5236, 0x1A67, 0x5237, 0x5237, 0x15B9,
+ 0x5238, 0x5238, 0x0F82, 0x5239, 0x5239, 0x1BA5, 0x523A, 0x523A, 0x1954,
+ 0x523B, 0x523B, 0x0D89, 0x5243, 0x5243, 0x1C25, 0x5247, 0x5247, 0x1CC0,
+ 0x524A, 0x524A, 0x14B5, 0x524B, 0x524B, 0x0FB1, 0x524C, 0x524C, 0x112D,
+ 0x524D, 0x524D, 0x19F8, 0x5254, 0x5254, 0x1BDF, 0x5256, 0x5256, 0x13F9,
+ 0x525B, 0x525B, 0x0DD0, 0x525D, 0x525D, 0x1316, 0x5261, 0x5261, 0x1557,
+ 0x5269, 0x5269, 0x1950, 0x526A, 0x526A, 0x19F9, 0x526F, 0x526F, 0x13FA,
+ 0x5272, 0x5272, 0x1DE1, 0x5275, 0x5275, 0x1BB6, 0x527D, 0x527D, 0x1D99,
+ 0x527F, 0x527F, 0x1C2F, 0x5283, 0x5283, 0x1F0C, 0x5287, 0x5287, 0x0FB2,
+ 0x5288, 0x5288, 0x139D, 0x5289, 0x5289, 0x11E1, 0x528D, 0x528D, 0x0E22,
+ 0x5291, 0x5291, 0x1A68, 0x5292, 0x5292, 0x0E23, 0x529B, 0x529B, 0x116A,
+ 0x529F, 0x529F, 0x0ECD, 0x52A0, 0x52A0, 0x0D70, 0x52A3, 0x52A3, 0x117F,
+ 0x52A4, 0x52A4, 0x0FB8, 0x52A9, 0x52A9, 0x1A81, 0x52AA, 0x52AA, 0x1049,
+ 0x52AB, 0x52AB, 0x0E28, 0x52BE, 0x52BE, 0x1E17, 0x52C1, 0x52C1, 0x0E51,
+ 0x52C3, 0x52C3, 0x1342, 0x52C5, 0x52C5, 0x1CC1, 0x52C7, 0x52C7, 0x1821,
+ 0x52C9, 0x52C9, 0x1281, 0x52CD, 0x52CD, 0x0E52, 0x52D2, 0x52D2, 0x11FC,
+ 0x52D5, 0x52D5, 0x10EE, 0x52D6, 0x52D6, 0x1855, 0x52D8, 0x52D8, 0x0DB6,
+ 0x52D9, 0x52D9, 0x12CC, 0x52DB, 0x52DB, 0x1F2B, 0x52DD, 0x52DD, 0x1635,
+ 0x52DE, 0x52DE, 0x119F, 0x52DF, 0x52DF, 0x129E, 0x52E2, 0x52E2, 0x1575,
+ 0x52E3, 0x52E3, 0x19DB, 0x52E4, 0x52E4, 0x0FB9, 0x52F3, 0x52F3, 0x1F2C,
+ 0x52F5, 0x52F5, 0x115A, 0x52F8, 0x52F8, 0x0F83, 0x52FA, 0x52FA, 0x196E,
+ 0x52FB, 0x52FB, 0x0FA9, 0x52FE, 0x52FE, 0x0F3B, 0x52FF, 0x52FF, 0x12F0,
+ 0x5305, 0x5305, 0x1D79, 0x5308, 0x5308, 0x1F4F, 0x530D, 0x530D, 0x1D7A,
+ 0x530F, 0x530F, 0x1D7B, 0x5310, 0x5310, 0x13D4, 0x5315, 0x5315, 0x143F,
+ 0x5316, 0x5316, 0x1EB7, 0x5317, 0x5317, 0x141F, 0x5319, 0x5319, 0x163D,
+ 0x5320, 0x5320, 0x1988, 0x5321, 0x5321, 0x0F01, 0x5323, 0x5323, 0x0DCA,
+ 0x532A, 0x532A, 0x1440, 0x532F, 0x532F, 0x1EF8, 0x5339, 0x5339, 0x1DB4,
+ 0x533F, 0x533F, 0x105C, 0x5340, 0x5340, 0x0F3C, 0x5341, 0x5341, 0x168C,
+ 0x5343, 0x5343, 0x1BED, 0x5344, 0x5344, 0x194E, 0x5347, 0x5347, 0x1636,
+ 0x5348, 0x5348, 0x17A5, 0x5349, 0x5349, 0x1F3A, 0x534A, 0x534A, 0x132A,
+ 0x534D, 0x534D, 0x123F, 0x5351, 0x5351, 0x1441, 0x5352, 0x5352, 0x1AB2,
+ 0x5353, 0x5353, 0x1CE3, 0x5354, 0x5354, 0x1E50, 0x5357, 0x5357, 0x1031,
+ 0x535A, 0x535A, 0x1317, 0x535C, 0x535C, 0x13D5, 0x535E, 0x535E, 0x13A7,
+ 0x5360, 0x5360, 0x1A24, 0x5366, 0x5366, 0x0F0C, 0x5368, 0x5368, 0x154A,
+ 0x536F, 0x536F, 0x12C0, 0x5370, 0x5370, 0x192E, 0x5371, 0x5371, 0x188F,
+ 0x5374, 0x5374, 0x0D8A, 0x5375, 0x5375, 0x1126, 0x5377, 0x5377, 0x0F84,
+ 0x537D, 0x537D, 0x1B0E, 0x537F, 0x537F, 0x0E53, 0x5384, 0x5384, 0x16DB,
+ 0x5393, 0x5393, 0x16D0, 0x5398, 0x5398, 0x1207, 0x539A, 0x539A, 0x1F20,
+ 0x539F, 0x539F, 0x1870, 0x53A0, 0x53A0, 0x1CA4, 0x53A5, 0x53A5, 0x0F8B,
+ 0x53A6, 0x53A6, 0x1DC2, 0x53AD, 0x53AD, 0x1765, 0x53BB, 0x53BB, 0x0E02,
+ 0x53C3, 0x53C3, 0x1BAB, 0x53C8, 0x53C8, 0x1839, 0x53C9, 0x53C9, 0x1B84,
+ 0x53CA, 0x53CA, 0x0FD4, 0x53CB, 0x53CB, 0x183A, 0x53CD, 0x53CD, 0x132B,
+ 0x53D4, 0x53D4, 0x15FC, 0x53D6, 0x53D6, 0x1C94, 0x53D7, 0x53D7, 0x15C0,
+ 0x53DB, 0x53DB, 0x132C, 0x53E1, 0x53E1, 0x1790, 0x53E2, 0x53E2, 0x1C53,
+ 0x53E3, 0x53E3, 0x0F3D, 0x53E4, 0x53E4, 0x0E91, 0x53E5, 0x53E5, 0x0F3E,
+ 0x53E9, 0x53E9, 0x0E92, 0x53EA, 0x53EA, 0x1B1F, 0x53EB, 0x53EB, 0x0F9A,
+ 0x53EC, 0x53EC, 0x157C, 0x53ED, 0x53ED, 0x1D4C, 0x53EF, 0x53EF, 0x0D71,
+ 0x53F0, 0x53F0, 0x1D08, 0x53F1, 0x53F1, 0x1B68, 0x53F2, 0x53F2, 0x1482,
+ 0x53F3, 0x53F3, 0x183B, 0x53F8, 0x53F8, 0x1483, 0x5403, 0x5403, 0x1F57,
+ 0x5404, 0x5404, 0x0D8B, 0x5408, 0x5408, 0x1DEF, 0x5409, 0x5409, 0x1020,
+ 0x540A, 0x540A, 0x19DC, 0x540C, 0x540C, 0x10EF, 0x540D, 0x540D, 0x128D,
+ 0x540E, 0x540E, 0x1F21, 0x540F, 0x540F, 0x1208, 0x5410, 0x5410, 0x1D1A,
+ 0x5411, 0x5411, 0x1E1F, 0x541B, 0x541B, 0x0F71, 0x541D, 0x541D, 0x121E,
+ 0x541F, 0x541F, 0x18ED, 0x5420, 0x5420, 0x1D6E, 0x5426, 0x5426, 0x13FB,
+ 0x5429, 0x5429, 0x1421, 0x542B, 0x542B, 0x1DE4, 0x5433, 0x5433, 0x17A7,
+ 0x5438, 0x5438, 0x1F5E, 0x5439, 0x5439, 0x1C95, 0x543B, 0x543B, 0x12E6,
+ 0x543C, 0x543C, 0x1F22, 0x543E, 0x543E, 0x17A6, 0x5442, 0x5442, 0x115B,
+ 0x5448, 0x5448, 0x1A35, 0x544A, 0x544A, 0x0E93, 0x5451, 0x5451, 0x1CF0,
+ 0x5468, 0x5468, 0x1AD3, 0x546A, 0x546A, 0x1AD2, 0x5471, 0x5471, 0x0E94,
+ 0x5473, 0x5473, 0x12F3, 0x5475, 0x5475, 0x0D72, 0x547B, 0x547B, 0x166A,
+ 0x547C, 0x547C, 0x1E7A, 0x547D, 0x547D, 0x128E, 0x5480, 0x5480, 0x19C2,
+ 0x5486, 0x5486, 0x1D7C, 0x548C, 0x548C, 0x1EB8, 0x548E, 0x548E, 0x0F3F,
+ 0x5490, 0x5490, 0x13FC, 0x54A4, 0x54A4, 0x1CD5, 0x54A8, 0x54A8, 0x1955,
+ 0x54AB, 0x54AB, 0x1B20, 0x54AC, 0x54AC, 0x0F1E, 0x54B3, 0x54B3, 0x1E07,
+ 0x54B8, 0x54B8, 0x1DE5, 0x54BD, 0x54BD, 0x192F, 0x54C0, 0x54C0, 0x16D1,
+ 0x54C1, 0x54C1, 0x1DA6, 0x54C4, 0x54C4, 0x1EAD, 0x54C8, 0x54C8, 0x1DF0,
+ 0x54C9, 0x54C9, 0x19AB, 0x54E1, 0x54E1, 0x1871, 0x54E5, 0x54E5, 0x0D73,
+ 0x54E8, 0x54E8, 0x1C30, 0x54ED, 0x54ED, 0x0EB7, 0x54EE, 0x54EE, 0x1F11,
+ 0x54F2, 0x54F2, 0x1C00, 0x54FA, 0x54FA, 0x1D7D, 0x5504, 0x5504, 0x1D4F,
+ 0x5506, 0x5506, 0x1484, 0x5507, 0x5507, 0x1B44, 0x550E, 0x550E, 0x1209,
+ 0x5510, 0x5510, 0x108F, 0x551C, 0x551C, 0x1251, 0x552F, 0x552F, 0x18A9,
+ 0x5531, 0x5531, 0x1BB7, 0x5535, 0x5535, 0x16BD, 0x553E, 0x553E, 0x1CD6,
+ 0x5544, 0x5544, 0x1CE4, 0x5546, 0x5546, 0x14D7, 0x554F, 0x554F, 0x12E7,
+ 0x5553, 0x5553, 0x0E7A, 0x5556, 0x5556, 0x1079, 0x555E, 0x555E, 0x1692,
+ 0x5563, 0x5563, 0x1DE6, 0x557C, 0x557C, 0x1A69, 0x5580, 0x5580, 0x0DFB,
+ 0x5584, 0x5584, 0x152D, 0x5586, 0x5586, 0x1C01, 0x5587, 0x5587, 0x1116,
+ 0x5589, 0x5589, 0x1F23, 0x558A, 0x558A, 0x1DE7, 0x5598, 0x5598, 0x1BEE,
+ 0x5599, 0x5599, 0x1F3B, 0x559A, 0x559A, 0x1ECB, 0x559C, 0x559C, 0x1F65,
+ 0x559D, 0x559D, 0x0DAD, 0x55A7, 0x55A7, 0x1F36, 0x55A9, 0x55A9, 0x18AA,
+ 0x55AA, 0x55AA, 0x14D8, 0x55AB, 0x55AB, 0x1024, 0x55AC, 0x55AC, 0x0F1F,
+ 0x55AE, 0x55AE, 0x1063, 0x55C5, 0x55C5, 0x1F24, 0x55C7, 0x55C7, 0x14F5,
+ 0x55D4, 0x55D4, 0x1B45, 0x55DA, 0x55DA, 0x17A8, 0x55DC, 0x55DC, 0x0FE2,
+ 0x55DF, 0x55DF, 0x1B85, 0x55E3, 0x55E3, 0x1485, 0x55E4, 0x55E4, 0x1CAA,
+ 0x55FD, 0x55FD, 0x15C1, 0x55FE, 0x55FE, 0x1AD4, 0x5606, 0x5606, 0x1CF1,
+ 0x5609, 0x5609, 0x0D74, 0x5614, 0x5614, 0x0F40, 0x5617, 0x5617, 0x14D9,
+ 0x562F, 0x562F, 0x157D, 0x5632, 0x5632, 0x1A82, 0x5634, 0x5634, 0x1C96,
+ 0x5636, 0x5636, 0x163E, 0x5653, 0x5653, 0x1E27, 0x5668, 0x5668, 0x0FE3,
+ 0x566B, 0x566B, 0x1F66, 0x5674, 0x5674, 0x1422, 0x5686, 0x5686, 0x1F12,
+ 0x56A5, 0x56A5, 0x1744, 0x56AC, 0x56AC, 0x1467, 0x56AE, 0x56AE, 0x1E20,
+ 0x56B4, 0x56B4, 0x1727, 0x56BC, 0x56BC, 0x196F, 0x56CA, 0x56CA, 0x1038,
+ 0x56CD, 0x56CD, 0x1F67, 0x56D1, 0x56D1, 0x1C4A, 0x56DA, 0x56DA, 0x15C2,
+ 0x56DB, 0x56DB, 0x1486, 0x56DE, 0x56DE, 0x1EF9, 0x56E0, 0x56E0, 0x1930,
+ 0x56F0, 0x56F0, 0x0EBE, 0x56F9, 0x56F9, 0x118B, 0x56FA, 0x56FA, 0x0E95,
+ 0x5703, 0x5703, 0x1D7E, 0x5704, 0x5704, 0x170E, 0x5708, 0x5708, 0x0F85,
+ 0x570B, 0x570B, 0x0F6B, 0x570D, 0x570D, 0x1890, 0x5712, 0x5712, 0x1873,
+ 0x5713, 0x5713, 0x1872, 0x5716, 0x5716, 0x10B0, 0x5718, 0x5718, 0x1064,
+ 0x571F, 0x571F, 0x1D1B, 0x5728, 0x5728, 0x19AC, 0x572D, 0x572D, 0x0F9B,
+ 0x5730, 0x5730, 0x1B21, 0x573B, 0x573B, 0x0FE4, 0x5740, 0x5740, 0x1B22,
+ 0x5742, 0x5742, 0x1D43, 0x5747, 0x5747, 0x0FAA, 0x574A, 0x574A, 0x134F,
+ 0x574D, 0x574D, 0x107A, 0x574E, 0x574E, 0x0DB7, 0x5750, 0x5750, 0x1AC7,
+ 0x5751, 0x5751, 0x0DFD, 0x5761, 0x5761, 0x1D32, 0x5764, 0x5764, 0x0EBF,
+ 0x5766, 0x5766, 0x1CF2, 0x576A, 0x576A, 0x1D69, 0x576E, 0x576E, 0x109C,
+ 0x5770, 0x5770, 0x0E54, 0x5775, 0x5775, 0x0F41, 0x577C, 0x577C, 0x1CE5,
+ 0x5782, 0x5782, 0x15C3, 0x5788, 0x5788, 0x109B, 0x578B, 0x578B, 0x1E5E,
+ 0x5793, 0x5793, 0x1E08, 0x57A0, 0x57A0, 0x18E5, 0x57A2, 0x57A2, 0x0F42,
+ 0x57A3, 0x57A3, 0x1874, 0x57C3, 0x57C3, 0x16D2, 0x57C7, 0x57C7, 0x1822,
+ 0x57C8, 0x57C8, 0x1AF9, 0x57CB, 0x57CB, 0x1264, 0x57CE, 0x57CE, 0x1562,
+ 0x57DF, 0x57DF, 0x173C, 0x57E0, 0x57E0, 0x13FD, 0x57F0, 0x57F0, 0x1BCB,
+ 0x57F4, 0x57F4, 0x1658, 0x57F7, 0x57F7, 0x1B78, 0x57F9, 0x57F9, 0x136B,
+ 0x57FA, 0x57FA, 0x0FE5, 0x57FC, 0x57FC, 0x0FE6, 0x5800, 0x5800, 0x0F77,
+ 0x5802, 0x5802, 0x1090, 0x5805, 0x5805, 0x0E35, 0x5806, 0x5806, 0x1D23,
+ 0x5808, 0x5808, 0x0DD1, 0x5809, 0x5809, 0x18D3, 0x580A, 0x580A, 0x16A1,
+ 0x581E, 0x581E, 0x1C13, 0x5821, 0x5821, 0x13C3, 0x5824, 0x5824, 0x1A6A,
+ 0x5827, 0x5827, 0x1745, 0x582A, 0x582A, 0x0DB8, 0x582F, 0x582F, 0x17FE,
+ 0x5830, 0x5830, 0x171E, 0x5831, 0x5831, 0x13C4, 0x5834, 0x5834, 0x1989,
+ 0x5835, 0x5835, 0x10B1, 0x583A, 0x583A, 0x0E7B, 0x584A, 0x584A, 0x0F11,
+ 0x584B, 0x584B, 0x1772, 0x584F, 0x584F, 0x0DEC, 0x5851, 0x5851, 0x157E,
+ 0x5854, 0x5854, 0x1D00, 0x5857, 0x5857, 0x10B2, 0x5858, 0x5858, 0x1091,
+ 0x585A, 0x585A, 0x1C54, 0x585E, 0x585E, 0x14F2, 0x5861, 0x5861, 0x19FA,
+ 0x5862, 0x5862, 0x17A9, 0x5864, 0x5864, 0x1F2D, 0x5875, 0x5875, 0x1B46,
+ 0x5879, 0x5879, 0x1BAC, 0x587C, 0x587C, 0x19FB, 0x587E, 0x587E, 0x15FD,
+ 0x5883, 0x5883, 0x0E55, 0x5885, 0x5885, 0x14FD, 0x5889, 0x5889, 0x1823,
+ 0x5893, 0x5893, 0x12C1, 0x589C, 0x589C, 0x1C61, 0x589E, 0x589E, 0x1B13,
+ 0x589F, 0x589F, 0x1E28, 0x58A8, 0x58A8, 0x12E2, 0x58A9, 0x58A9, 0x10DF,
+ 0x58AE, 0x58AE, 0x1CD7, 0x58B3, 0x58B3, 0x1423, 0x58BA, 0x58BA, 0x17AA,
+ 0x58BB, 0x58BB, 0x198A, 0x58BE, 0x58BE, 0x0D96, 0x58C1, 0x58C1, 0x139E,
+ 0x58C5, 0x58C5, 0x17CA, 0x58C7, 0x58C7, 0x1065, 0x58CE, 0x58CE, 0x1F2E,
+ 0x58D1, 0x58D1, 0x1DCE, 0x58D3, 0x58D3, 0x16C5, 0x58D5, 0x58D5, 0x1E7B,
+ 0x58D8, 0x58D8, 0x11D4, 0x58D9, 0x58D9, 0x0F02, 0x58DE, 0x58DE, 0x0F12,
+ 0x58DF, 0x58DF, 0x11B8, 0x58E4, 0x58E4, 0x16F8, 0x58EB, 0x58EB, 0x1487,
+ 0x58EC, 0x58EC, 0x1946, 0x58EF, 0x58EF, 0x198B, 0x58F9, 0x58F9, 0x193F,
+ 0x58FA, 0x58FA, 0x1E7C, 0x58FB, 0x58FB, 0x14FE, 0x58FD, 0x58FD, 0x15C4,
+ 0x590F, 0x590F, 0x1DC3, 0x5914, 0x5914, 0x0FE7, 0x5915, 0x5915, 0x151B,
+ 0x5916, 0x5916, 0x17F7, 0x5919, 0x5919, 0x15FE, 0x591A, 0x591A, 0x105E,
+ 0x591C, 0x591C, 0x16E9, 0x5922, 0x5922, 0x12BD, 0x5927, 0x5927, 0x109D,
+ 0x5929, 0x5929, 0x1BEF, 0x592A, 0x592A, 0x1D09, 0x592B, 0x592B, 0x13FE,
+ 0x592D, 0x592D, 0x17FF, 0x592E, 0x592E, 0x16CA, 0x5931, 0x5931, 0x167E,
+ 0x5937, 0x5937, 0x1910, 0x593E, 0x593E, 0x1E51, 0x5944, 0x5944, 0x1728,
+ 0x5947, 0x5947, 0x0FE8, 0x5948, 0x5948, 0x103C, 0x5949, 0x5949, 0x13E6,
+ 0x594E, 0x594E, 0x0F9C, 0x594F, 0x594F, 0x1AD5, 0x5950, 0x5950, 0x1ECC,
+ 0x5951, 0x5951, 0x0E7C, 0x5954, 0x5954, 0x1424, 0x5955, 0x5955, 0x1E32,
+ 0x5957, 0x5957, 0x1D2A, 0x595A, 0x595A, 0x1E09, 0x5960, 0x5960, 0x19FC,
+ 0x5962, 0x5962, 0x1488, 0x5967, 0x5967, 0x17AB, 0x596A, 0x596A, 0x1CFA,
+ 0x596B, 0x596B, 0x18D8, 0x596C, 0x596C, 0x198C, 0x596D, 0x596D, 0x151C,
+ 0x596E, 0x596E, 0x1425, 0x5973, 0x5973, 0x103F, 0x5974, 0x5974, 0x104A,
+ 0x5978, 0x5978, 0x0D97, 0x597D, 0x597D, 0x1E7D, 0x5982, 0x5982, 0x1730,
+ 0x5983, 0x5983, 0x1442, 0x5984, 0x5984, 0x1259, 0x598A, 0x598A, 0x1947,
+ 0x5993, 0x5993, 0x0FE9, 0x5996, 0x5996, 0x1800, 0x5997, 0x5997, 0x0FC7,
+ 0x5999, 0x5999, 0x12C2, 0x59A5, 0x59A5, 0x1CD8, 0x59A8, 0x59A8, 0x1350,
+ 0x59AC, 0x59AC, 0x1D2B, 0x59B9, 0x59B9, 0x1265, 0x59BB, 0x59BB, 0x1BDB,
+ 0x59BE, 0x59BE, 0x1C14, 0x59C3, 0x59C3, 0x1A36, 0x59C6, 0x59C6, 0x129F,
+ 0x59C9, 0x59C9, 0x1956, 0x59CB, 0x59CB, 0x163F, 0x59D0, 0x59D0, 0x19C3,
+ 0x59D1, 0x59D1, 0x0E96, 0x59D3, 0x59D3, 0x1563, 0x59D4, 0x59D4, 0x1891,
+ 0x59D9, 0x59D9, 0x1948, 0x59DA, 0x59DA, 0x1801, 0x59DC, 0x59DC, 0x0DD2,
+ 0x59DD, 0x59DD, 0x1AD0, 0x59E6, 0x59E6, 0x0D98, 0x59E8, 0x59E8, 0x1911,
+ 0x59EA, 0x59EA, 0x1B69, 0x59EC, 0x59EC, 0x1F68, 0x59EE, 0x59EE, 0x1DF8,
+ 0x59F8, 0x59F8, 0x1746, 0x59FB, 0x59FB, 0x1931, 0x59FF, 0x59FF, 0x1957,
+ 0x5A01, 0x5A01, 0x1892, 0x5A03, 0x5A03, 0x17F4, 0x5A11, 0x5A11, 0x1489,
+ 0x5A18, 0x5A18, 0x1039, 0x5A1B, 0x5A1B, 0x17AC, 0x5A1C, 0x5A1C, 0x1026,
+ 0x5A1F, 0x5A1F, 0x1747, 0x5A20, 0x5A20, 0x166B, 0x5A25, 0x5A25, 0x1693,
+ 0x5A29, 0x5A29, 0x1240, 0x5A36, 0x5A36, 0x1C97, 0x5A3C, 0x5A3C, 0x1BB8,
+ 0x5A41, 0x5A41, 0x11D5, 0x5A46, 0x5A46, 0x1D33, 0x5A49, 0x5A49, 0x17DB,
+ 0x5A5A, 0x5A5A, 0x1EA4, 0x5A62, 0x5A62, 0x1443, 0x5A66, 0x5A66, 0x13FF,
+ 0x5A92, 0x5A92, 0x1266, 0x5A9A, 0x5A9A, 0x12F4, 0x5A9B, 0x5A9B, 0x1875,
+ 0x5AA4, 0x5AA4, 0x1640, 0x5AC1, 0x5AC1, 0x0D75, 0x5AC2, 0x5AC2, 0x15C5,
+ 0x5AC4, 0x5AC4, 0x1876, 0x5AC9, 0x5AC9, 0x1B6A, 0x5ACC, 0x5ACC, 0x1E4E,
+ 0x5AE1, 0x5AE1, 0x19DD, 0x5AE6, 0x5AE6, 0x1DF9, 0x5AE9, 0x5AE9, 0x1055,
+ 0x5B05, 0x5B05, 0x1EB9, 0x5B09, 0x5B09, 0x1F69, 0x5B0B, 0x5B0B, 0x152E,
+ 0x5B0C, 0x5B0C, 0x0F20, 0x5B16, 0x5B16, 0x1D6F, 0x5B2A, 0x5B2A, 0x1468,
+ 0x5B40, 0x5B40, 0x14DA, 0x5B43, 0x5B43, 0x16F9, 0x5B50, 0x5B50, 0x1958,
+ 0x5B51, 0x5B51, 0x1E4A, 0x5B54, 0x5B54, 0x0ECE, 0x5B55, 0x5B55, 0x1951,
+ 0x5B57, 0x5B57, 0x1959, 0x5B58, 0x5B58, 0x1AB0, 0x5B5A, 0x5B5A, 0x1400,
+ 0x5B5C, 0x5B5C, 0x195A, 0x5B5D, 0x5B5D, 0x1F13, 0x5B5F, 0x5B5F, 0x1277,
+ 0x5B63, 0x5B63, 0x0E7D, 0x5B64, 0x5B64, 0x0E97, 0x5B69, 0x5B69, 0x1E0A,
+ 0x5B6B, 0x5B6B, 0x15AA, 0x5B70, 0x5B70, 0x15FF, 0x5B71, 0x5B71, 0x197A,
+ 0x5B75, 0x5B75, 0x1401, 0x5B78, 0x5B78, 0x1DCF, 0x5B7A, 0x5B7A, 0x18AB,
+ 0x5B7C, 0x5B7C, 0x1723, 0x5B85, 0x5B85, 0x10AA, 0x5B87, 0x5B87, 0x183C,
+ 0x5B88, 0x5B88, 0x15C6, 0x5B89, 0x5B89, 0x16AF, 0x5B8B, 0x5B8B, 0x15B1,
+ 0x5B8C, 0x5B8C, 0x17DC, 0x5B8F, 0x5B8F, 0x0F18, 0x5B93, 0x5B93, 0x13D6,
+ 0x5B95, 0x5B95, 0x1D03, 0x5B96, 0x5B96, 0x1F0E, 0x5B97, 0x5B97, 0x1AB6,
+ 0x5B98, 0x5B98, 0x0EEC, 0x5B99, 0x5B99, 0x1AD6, 0x5B9A, 0x5B9A, 0x1A37,
+ 0x5B9B, 0x5B9B, 0x17DD, 0x5B9C, 0x5B9C, 0x18FD, 0x5BA2, 0x5BA2, 0x0DFC,
+ 0x5BA3, 0x5BA3, 0x152F, 0x5BA4, 0x5BA4, 0x167F, 0x5BA5, 0x5BA5, 0x18AC,
+ 0x5BA6, 0x5BA6, 0x1ECD, 0x5BAC, 0x5BAC, 0x1564, 0x5BAE, 0x5BAE, 0x0F7B,
+ 0x5BB0, 0x5BB0, 0x19AD, 0x5BB3, 0x5BB3, 0x1E0B, 0x5BB4, 0x5BB4, 0x1748,
+ 0x5BB5, 0x5BB5, 0x157F, 0x5BB6, 0x5BB6, 0x0D76, 0x5BB8, 0x5BB8, 0x166C,
+ 0x5BB9, 0x5BB9, 0x1824, 0x5BBF, 0x5BBF, 0x1600, 0x5BC0, 0x5BC0, 0x1BCC,
+ 0x5BC2, 0x5BC2, 0x19DE, 0x5BC3, 0x5BC3, 0x1877, 0x5BC4, 0x5BC4, 0x0FEA,
+ 0x5BC5, 0x5BC5, 0x1932, 0x5BC6, 0x5BC6, 0x1313, 0x5BC7, 0x5BC7, 0x0F43,
+ 0x5BCC, 0x5BCC, 0x1402, 0x5BD0, 0x5BD0, 0x1267, 0x5BD2, 0x5BD2, 0x1DD3,
+ 0x5BD3, 0x5BD3, 0x183D, 0x5BD4, 0x5BD4, 0x1659, 0x5BD7, 0x5BD7, 0x1048,
+ 0x5BDE, 0x5BDE, 0x1238, 0x5BDF, 0x5BDF, 0x1BA6, 0x5BE1, 0x5BE1, 0x0EDB,
+ 0x5BE2, 0x5BE2, 0x1CC8, 0x5BE4, 0x5BE4, 0x17AD, 0x5BE5, 0x5BE5, 0x1802,
+ 0x5BE6, 0x5BE6, 0x1680, 0x5BE7, 0x5BE7, 0x1047, 0x5BE8, 0x5BE8, 0x1BCD,
+ 0x5BE9, 0x5BE9, 0x1682, 0x5BEB, 0x5BEB, 0x148A, 0x5BEC, 0x5BEC, 0x0EED,
+ 0x5BEE, 0x5BEE, 0x11C9, 0x5BEF, 0x5BEF, 0x1AFA, 0x5BF5, 0x5BF5, 0x1C55,
+ 0x5BF6, 0x5BF6, 0x13C5, 0x5BF8, 0x5BF8, 0x1C4F, 0x5BFA, 0x5BFA, 0x148B,
+ 0x5C01, 0x5C01, 0x13E7, 0x5C04, 0x5C04, 0x148C, 0x5C07, 0x5C07, 0x198D,
+ 0x5C08, 0x5C08, 0x19FD, 0x5C09, 0x5C09, 0x1893, 0x5C0A, 0x5C0A, 0x1AB1,
+ 0x5C0B, 0x5C0B, 0x1683, 0x5C0D, 0x5C0D, 0x109E, 0x5C0E, 0x5C0E, 0x10B3,
+ 0x5C0F, 0x5C0F, 0x1580, 0x5C11, 0x5C11, 0x1581, 0x5C16, 0x5C16, 0x1C0A,
+ 0x5C19, 0x5C19, 0x14DB, 0x5C24, 0x5C24, 0x183E, 0x5C28, 0x5C28, 0x1351,
+ 0x5C31, 0x5C31, 0x1C98, 0x5C38, 0x5C38, 0x1641, 0x5C39, 0x5C39, 0x18D9,
+ 0x5C3A, 0x5C3A, 0x1BE0, 0x5C3B, 0x5C3B, 0x0E98, 0x5C3C, 0x5C3C, 0x105A,
+ 0x5C3E, 0x5C3E, 0x12F5, 0x5C3F, 0x5C3F, 0x1054, 0x5C40, 0x5C40, 0x0F6C,
+ 0x5C45, 0x5C45, 0x0E03, 0x5C46, 0x5C46, 0x0E7E, 0x5C48, 0x5C48, 0x0F78,
+ 0x5C4B, 0x5C4B, 0x17BE, 0x5C4D, 0x5C4D, 0x1643, 0x5C4E, 0x5C4E, 0x1642,
+ 0x5C51, 0x5C51, 0x154B, 0x5C55, 0x5C55, 0x19FE, 0x5C5B, 0x5C5B, 0x13B4,
+ 0x5C60, 0x5C60, 0x10B4, 0x5C62, 0x5C62, 0x11D6, 0x5C64, 0x5C64, 0x1CA7,
+ 0x5C65, 0x5C65, 0x120A, 0x5C6C, 0x5C6C, 0x15A2, 0x5C6F, 0x5C6F, 0x1106,
+ 0x5C71, 0x5C71, 0x14B9, 0x5C79, 0x5C79, 0x1F58, 0x5C90, 0x5C90, 0x0FEB,
+ 0x5C91, 0x5C91, 0x197F, 0x5CA1, 0x5CA1, 0x0DD3, 0x5CA9, 0x5CA9, 0x16BE,
+ 0x5CAB, 0x5CAB, 0x15C7, 0x5CAC, 0x5CAC, 0x0DCB, 0x5CB1, 0x5CB1, 0x109F,
+ 0x5CB3, 0x5CB3, 0x16A2, 0x5CB5, 0x5CB5, 0x1E7E, 0x5CB7, 0x5CB7, 0x1306,
+ 0x5CB8, 0x5CB8, 0x16B0, 0x5CBA, 0x5CBA, 0x118C, 0x5CBE, 0x5CBE, 0x1A25,
+ 0x5CC0, 0x5CC0, 0x15C8, 0x5CD9, 0x5CD9, 0x1CAB, 0x5CE0, 0x5CE0, 0x14DC,
+ 0x5CE8, 0x5CE8, 0x1694, 0x5CEF, 0x5CF0, 0x13E8, 0x5CF4, 0x5CF4, 0x1E37,
+ 0x5CF6, 0x5CF6, 0x10B5, 0x5CFB, 0x5CFB, 0x1AFB, 0x5CFD, 0x5CFD, 0x1E52,
+ 0x5D07, 0x5D07, 0x1627, 0x5D0D, 0x5D0D, 0x1145, 0x5D0E, 0x5D0E, 0x0FEC,
+ 0x5D11, 0x5D11, 0x0EC0, 0x5D14, 0x5D14, 0x1C5F, 0x5D16, 0x5D16, 0x16D3,
+ 0x5D17, 0x5D17, 0x0DD4, 0x5D19, 0x5D19, 0x11F4, 0x5D27, 0x5D27, 0x1628,
+ 0x5D29, 0x5D29, 0x1437, 0x5D4B, 0x5D4B, 0x12F6, 0x5D4C, 0x5D4C, 0x0DB9,
+ 0x5D50, 0x5D50, 0x112F, 0x5D69, 0x5D69, 0x1629, 0x5D6C, 0x5D6C, 0x17F8,
+ 0x5D6F, 0x5D6F, 0x1B86, 0x5D87, 0x5D87, 0x0F44, 0x5D8B, 0x5D8B, 0x10B6,
+ 0x5D9D, 0x5D9D, 0x110D, 0x5DA0, 0x5DA0, 0x0F21, 0x5DA2, 0x5DA2, 0x1803,
+ 0x5DAA, 0x5DAA, 0x172B, 0x5DB8, 0x5DB8, 0x1773, 0x5DBA, 0x5DBA, 0x118D,
+ 0x5DBC, 0x5DBC, 0x14FF, 0x5DBD, 0x5DBD, 0x16A3, 0x5DCD, 0x5DCD, 0x17F9,
+ 0x5DD2, 0x5DD2, 0x1241, 0x5DD6, 0x5DD6, 0x16BF, 0x5DDD, 0x5DDD, 0x1BF0,
+ 0x5DDE, 0x5DDE, 0x1AD7, 0x5DE1, 0x5DE1, 0x1608, 0x5DE2, 0x5DE2, 0x1582,
+ 0x5DE5, 0x5DE5, 0x0ECF, 0x5DE6, 0x5DE6, 0x1AC8, 0x5DE7, 0x5DE7, 0x0F22,
+ 0x5DE8, 0x5DE8, 0x0E04, 0x5DEB, 0x5DEB, 0x12CD, 0x5DEE, 0x5DEE, 0x1B87,
+ 0x5DF1, 0x5DF1, 0x0FED, 0x5DF2, 0x5DF2, 0x1912, 0x5DF3, 0x5DF3, 0x148D,
+ 0x5DF4, 0x5DF4, 0x1D34, 0x5DF7, 0x5DF7, 0x1DFA, 0x5DFD, 0x5DFD, 0x15AB,
+ 0x5DFE, 0x5DFE, 0x0E14, 0x5E02, 0x5E02, 0x1644, 0x5E03, 0x5E03, 0x1D7F,
+ 0x5E06, 0x5E06, 0x1392, 0x5E0C, 0x5E0C, 0x1F6A, 0x5E11, 0x5E11, 0x1D04,
+ 0x5E16, 0x5E16, 0x1C15, 0x5E19, 0x5E19, 0x1B6B, 0x5E1B, 0x5E1B, 0x137E,
+ 0x5E1D, 0x5E1D, 0x1A6B, 0x5E25, 0x5E25, 0x15C9, 0x5E2B, 0x5E2B, 0x148E,
+ 0x5E2D, 0x5E2D, 0x151D, 0x5E33, 0x5E33, 0x198E, 0x5E36, 0x5E36, 0x10A0,
+ 0x5E38, 0x5E38, 0x14DD, 0x5E3D, 0x5E3D, 0x12A0, 0x5E3F, 0x5E3F, 0x1F25,
+ 0x5E40, 0x5E40, 0x1A38, 0x5E44, 0x5E44, 0x16A4, 0x5E45, 0x5E45, 0x1D93,
+ 0x5E47, 0x5E47, 0x1352, 0x5E4C, 0x5E4C, 0x1EE1, 0x5E55, 0x5E55, 0x1239,
+ 0x5E5F, 0x5E5F, 0x1CAC, 0x5E61, 0x5E61, 0x1384, 0x5E62, 0x5E62, 0x1092,
+ 0x5E63, 0x5E63, 0x1D70, 0x5E72, 0x5E72, 0x0D99, 0x5E73, 0x5E73, 0x1D6A,
+ 0x5E74, 0x5E74, 0x1040, 0x5E77, 0x5E77, 0x13B5, 0x5E78, 0x5E78, 0x1E1A,
+ 0x5E79, 0x5E79, 0x0D9A, 0x5E7B, 0x5E7B, 0x1ECE, 0x5E7C, 0x5E7D, 0x18AD,
+ 0x5E7E, 0x5E7E, 0x0FEE, 0x5E84, 0x5E84, 0x198F, 0x5E87, 0x5E87, 0x1444,
+ 0x5E8A, 0x5E8A, 0x14DE, 0x5E8F, 0x5E8F, 0x1500, 0x5E95, 0x5E95, 0x19C4,
+ 0x5E97, 0x5E97, 0x1A26, 0x5E9A, 0x5E9A, 0x0E56, 0x5E9C, 0x5E9C, 0x1403,
+ 0x5EA0, 0x5EA0, 0x14DF, 0x5EA6, 0x5EA6, 0x10B7, 0x5EA7, 0x5EA7, 0x1AC9,
+ 0x5EAB, 0x5EAB, 0x0E99, 0x5EAD, 0x5EAD, 0x1A39, 0x5EB5, 0x5EB5, 0x16C0,
+ 0x5EB6, 0x5EB6, 0x1501, 0x5EB7, 0x5EB7, 0x0DD5, 0x5EB8, 0x5EB8, 0x1825,
+ 0x5EBE, 0x5EBE, 0x18AF, 0x5EC2, 0x5EC2, 0x14E0, 0x5EC8, 0x5EC8, 0x1DC4,
+ 0x5EC9, 0x5EC9, 0x1183, 0x5ECA, 0x5ECA, 0x113C, 0x5ED0, 0x5ED0, 0x0F45,
+ 0x5ED3, 0x5ED3, 0x0EE7, 0x5ED6, 0x5ED6, 0x11CA, 0x5EDA, 0x5EDA, 0x1AD8,
+ 0x5EDB, 0x5EDB, 0x19FF, 0x5EDF, 0x5EDF, 0x12C3, 0x5EE0, 0x5EE0, 0x1BB9,
+ 0x5EE2, 0x5EE2, 0x1D71, 0x5EE3, 0x5EE3, 0x0F03, 0x5EEC, 0x5EEC, 0x115C,
+ 0x5EF3, 0x5EF3, 0x1C1D, 0x5EF6, 0x5EF6, 0x1749, 0x5EF7, 0x5EF7, 0x1A3A,
+ 0x5EFA, 0x5EFA, 0x0E15, 0x5EFB, 0x5EFB, 0x1EFA, 0x5F01, 0x5F01, 0x13A8,
+ 0x5F04, 0x5F04, 0x11B9, 0x5F0A, 0x5F0A, 0x1D72, 0x5F0F, 0x5F0F, 0x165A,
+ 0x5F11, 0x5F11, 0x1645, 0x5F13, 0x5F13, 0x0F7C, 0x5F14, 0x5F14, 0x1A83,
+ 0x5F15, 0x5F15, 0x1933, 0x5F17, 0x5F17, 0x1434, 0x5F18, 0x5F18, 0x1EAE,
+ 0x5F1B, 0x5F1B, 0x1913, 0x5F1F, 0x5F1F, 0x1A6C, 0x5F26, 0x5F26, 0x1E38,
+ 0x5F27, 0x5F27, 0x1E7F, 0x5F29, 0x5F29, 0x104B, 0x5F31, 0x5F31, 0x16F0,
+ 0x5F35, 0x5F35, 0x1990, 0x5F3A, 0x5F3A, 0x0DD6, 0x5F3C, 0x5F3C, 0x1DB5,
+ 0x5F48, 0x5F48, 0x1CF3, 0x5F4A, 0x5F4A, 0x0DD7, 0x5F4C, 0x5F4C, 0x12F7,
+ 0x5F4E, 0x5F4E, 0x1242, 0x5F56, 0x5F56, 0x1066, 0x5F57, 0x5F57, 0x1E70,
+ 0x5F59, 0x5F59, 0x1F3D, 0x5F5B, 0x5F5B, 0x1914, 0x5F62, 0x5F62, 0x1E5F,
+ 0x5F66, 0x5F66, 0x171F, 0x5F67, 0x5F67, 0x1856, 0x5F69, 0x5F69, 0x1BCE,
+ 0x5F6A, 0x5F6A, 0x1D9A, 0x5F6B, 0x5F6B, 0x1A84, 0x5F6C, 0x5F6C, 0x1469,
+ 0x5F6D, 0x5F6D, 0x1D59, 0x5F70, 0x5F70, 0x1BBA, 0x5F71, 0x5F71, 0x1774,
+ 0x5F77, 0x5F77, 0x1353, 0x5F79, 0x5F79, 0x173D, 0x5F7C, 0x5F7C, 0x1DAD,
+ 0x5F7F, 0x5F7F, 0x1435, 0x5F80, 0x5F80, 0x17EE, 0x5F81, 0x5F81, 0x1A3B,
+ 0x5F85, 0x5F85, 0x10A1, 0x5F87, 0x5F87, 0x1609, 0x5F8A, 0x5F8A, 0x1EFB,
+ 0x5F8B, 0x5F8B, 0x11F8, 0x5F8C, 0x5F8C, 0x1F26, 0x5F90, 0x5F90, 0x1502,
+ 0x5F91, 0x5F91, 0x0E57, 0x5F92, 0x5F92, 0x10B8, 0x5F97, 0x5F97, 0x110C,
+ 0x5F98, 0x5F98, 0x136C, 0x5F99, 0x5F99, 0x148F, 0x5F9E, 0x5F9E, 0x1AB7,
+ 0x5FA0, 0x5FA0, 0x1146, 0x5FA1, 0x5FA1, 0x170F, 0x5FA8, 0x5FA8, 0x1EE2,
+ 0x5FA9, 0x5FA9, 0x13D7, 0x5FAA, 0x5FAA, 0x160A, 0x5FAE, 0x5FAE, 0x12F8,
+ 0x5FB5, 0x5FB5, 0x1B7E, 0x5FB7, 0x5FB7, 0x10AB, 0x5FB9, 0x5FB9, 0x1C02,
+ 0x5FBD, 0x5FBD, 0x1F3E, 0x5FC3, 0x5FC3, 0x1684, 0x5FC5, 0x5FC5, 0x1DB6,
+ 0x5FCC, 0x5FCC, 0x0FEF, 0x5FCD, 0x5FCD, 0x1934, 0x5FD6, 0x5FD6, 0x1C50,
+ 0x5FD7, 0x5FD7, 0x1B23, 0x5FD8, 0x5FD9, 0x125A, 0x5FE0, 0x5FE0, 0x1C8B,
+ 0x5FEB, 0x5FEB, 0x1CD3, 0x5FF5, 0x5FF5, 0x1043, 0x5FFD, 0x5FFD, 0x1EAA,
+ 0x5FFF, 0x5FFF, 0x1426, 0x600F, 0x600F, 0x16CB, 0x6012, 0x6012, 0x104C,
+ 0x6016, 0x6016, 0x1D80, 0x601C, 0x601C, 0x118E, 0x601D, 0x601D, 0x1490,
+ 0x6020, 0x6020, 0x1D0A, 0x6021, 0x6021, 0x1915, 0x6025, 0x6025, 0x0FD5,
+ 0x6027, 0x6027, 0x1565, 0x6028, 0x6028, 0x1878, 0x602A, 0x602A, 0x0F13,
+ 0x602F, 0x602F, 0x0E29, 0x6041, 0x6041, 0x1949, 0x6042, 0x6042, 0x160B,
+ 0x6043, 0x6043, 0x1646, 0x604D, 0x604D, 0x1EE3, 0x6050, 0x6050, 0x0ED0,
+ 0x6052, 0x6052, 0x1DFB, 0x6055, 0x6055, 0x1503, 0x6059, 0x6059, 0x16FA,
+ 0x605D, 0x605D, 0x0EFC, 0x6062, 0x6062, 0x1EFC, 0x6063, 0x6063, 0x195B,
+ 0x6064, 0x6064, 0x1F4A, 0x6065, 0x6065, 0x1CAD, 0x6068, 0x6068, 0x1DD4,
+ 0x6069, 0x6069, 0x18E6, 0x606A, 0x606A, 0x0D8C, 0x606C, 0x606C, 0x1044,
+ 0x606D, 0x606D, 0x0ED1, 0x606F, 0x606F, 0x165B, 0x6070, 0x6070, 0x1F5F,
+ 0x6085, 0x6085, 0x1761, 0x6089, 0x6089, 0x1681, 0x608C, 0x608C, 0x1A6D,
+ 0x608D, 0x608D, 0x1DD5, 0x6094, 0x6094, 0x1EFD, 0x6096, 0x6096, 0x1D50,
+ 0x609A, 0x609A, 0x15B2, 0x609B, 0x609B, 0x1A00, 0x609F, 0x609F, 0x17AE,
+ 0x60A0, 0x60A0, 0x18B0, 0x60A3, 0x60A3, 0x1ECF, 0x60A4, 0x60A4, 0x1C56,
+ 0x60A7, 0x60A7, 0x120B, 0x60B0, 0x60B0, 0x1AB8, 0x60B2, 0x60B2, 0x1445,
+ 0x60B3, 0x60B3, 0x10AC, 0x60B4, 0x60B4, 0x1C90, 0x60B6, 0x60B6, 0x1307,
+ 0x60B8, 0x60B8, 0x0E7F, 0x60BC, 0x60BC, 0x10B9, 0x60BD, 0x60BD, 0x1BDC,
+ 0x60C5, 0x60C5, 0x1A3C, 0x60C7, 0x60C7, 0x10E0, 0x60D1, 0x60D1, 0x1EA1,
+ 0x60DA, 0x60DA, 0x1EAB, 0x60DC, 0x60DC, 0x151E, 0x60DF, 0x60DF, 0x18B1,
+ 0x60E0, 0x60E0, 0x1E71, 0x60E1, 0x60E1, 0x16A5, 0x60F0, 0x60F0, 0x1CD9,
+ 0x60F1, 0x60F1, 0x1052, 0x60F3, 0x60F3, 0x14E1, 0x60F6, 0x60F6, 0x1EE4,
+ 0x60F9, 0x60F9, 0x16EA, 0x60FA, 0x60FA, 0x1566, 0x60FB, 0x60FB, 0x1CA5,
+ 0x6101, 0x6101, 0x15CA, 0x6106, 0x6106, 0x0E16, 0x6108, 0x6109, 0x18B2,
+ 0x610D, 0x610D, 0x1308, 0x610E, 0x610E, 0x1D5D, 0x610F, 0x610F, 0x18FE,
+ 0x6115, 0x6115, 0x16A6, 0x611A, 0x611A, 0x183F, 0x611B, 0x611B, 0x16D4,
+ 0x611F, 0x611F, 0x0DBA, 0x6127, 0x6127, 0x0F14, 0x6130, 0x6130, 0x1EE5,
+ 0x6134, 0x6134, 0x1BBB, 0x6137, 0x6137, 0x0DED, 0x613C, 0x613C, 0x166D,
+ 0x613E, 0x613E, 0x0DEE, 0x613F, 0x613F, 0x1879, 0x6142, 0x6142, 0x1826,
+ 0x6144, 0x6144, 0x11F9, 0x6147, 0x6147, 0x18E7, 0x6148, 0x6148, 0x195C,
+ 0x614A, 0x614A, 0x0E47, 0x614B, 0x614B, 0x1D0B, 0x614C, 0x614C, 0x1EE6,
+ 0x6153, 0x6153, 0x1D9B, 0x6155, 0x6155, 0x12A1, 0x6158, 0x6159, 0x1BAD,
+ 0x615D, 0x615D, 0x1D2F, 0x615F, 0x615F, 0x1D1D, 0x6162, 0x6162, 0x1243,
+ 0x6163, 0x6163, 0x0EEE, 0x6164, 0x6164, 0x0D8D, 0x6167, 0x6167, 0x1E72,
+ 0x6168, 0x6168, 0x0DEF, 0x616B, 0x616B, 0x1AB9, 0x616E, 0x616E, 0x115D,
+ 0x6170, 0x6170, 0x1894, 0x6176, 0x6176, 0x0E58, 0x6177, 0x6177, 0x0DD8,
+ 0x617D, 0x617D, 0x1BE1, 0x617E, 0x617E, 0x1818, 0x6181, 0x6181, 0x1C57,
+ 0x6182, 0x6182, 0x1840, 0x618A, 0x618A, 0x1446, 0x618E, 0x618E, 0x1B14,
+ 0x6190, 0x6190, 0x1171, 0x6191, 0x6191, 0x1475, 0x6194, 0x6194, 0x1C31,
+ 0x6198, 0x6198, 0x1F6C, 0x6199, 0x6199, 0x1F6B, 0x619A, 0x619A, 0x1CF4,
+ 0x61A4, 0x61A4, 0x1427, 0x61A7, 0x61A7, 0x10F0, 0x61A9, 0x61A9, 0x0E2C,
+ 0x61AB, 0x61AB, 0x1309, 0x61AC, 0x61AC, 0x0E59, 0x61AE, 0x61AE, 0x12CE,
+ 0x61B2, 0x61B2, 0x1E2B, 0x61B6, 0x61B6, 0x1719, 0x61BA, 0x61BA, 0x107B,
+ 0x61BE, 0x61BE, 0x0DBB, 0x61C3, 0x61C3, 0x0FBA, 0x61C7, 0x61C7, 0x0D9B,
+ 0x61C8, 0x61C8, 0x1E0C, 0x61C9, 0x61C9, 0x18F7, 0x61CA, 0x61CA, 0x17AF,
+ 0x61CB, 0x61CB, 0x12CF, 0x61E6, 0x61E6, 0x1027, 0x61F2, 0x61F2, 0x1B7F,
+ 0x61F6, 0x61F6, 0x1117, 0x61F7, 0x61F7, 0x1EFE, 0x61F8, 0x61F8, 0x1E39,
+ 0x61FA, 0x61FA, 0x1BAF, 0x61FC, 0x61FC, 0x0F46, 0x61FF, 0x61FF, 0x18FF,
+ 0x6200, 0x6200, 0x1172, 0x6207, 0x6207, 0x1093, 0x6208, 0x6208, 0x0EDC,
+ 0x620A, 0x620A, 0x12D0, 0x620C, 0x620C, 0x1623, 0x620D, 0x620D, 0x15CB,
+ 0x620E, 0x620E, 0x18E1, 0x6210, 0x6210, 0x1567, 0x6211, 0x6211, 0x1695,
+ 0x6212, 0x6212, 0x0E80, 0x6216, 0x6216, 0x1EA2, 0x621A, 0x621A, 0x1BE2,
+ 0x621F, 0x621F, 0x0FB3, 0x6221, 0x6221, 0x0DBC, 0x622A, 0x622A, 0x1A1D,
+ 0x622E, 0x622E, 0x11F0, 0x6230, 0x6230, 0x1A01, 0x6231, 0x6231, 0x1F6D,
+ 0x6234, 0x6234, 0x10A2, 0x6236, 0x6236, 0x1E80, 0x623E, 0x623E, 0x115E,
+ 0x623F, 0x623F, 0x1354, 0x6240, 0x6240, 0x1583, 0x6241, 0x6241, 0x1D60,
+ 0x6247, 0x6247, 0x1530, 0x6248, 0x6248, 0x1E81, 0x6249, 0x6249, 0x1447,
+ 0x624B, 0x624B, 0x15CC, 0x624D, 0x624D, 0x19AE, 0x6253, 0x6253, 0x1CDA,
+ 0x6258, 0x6258, 0x1CE6, 0x626E, 0x626E, 0x1428, 0x6271, 0x6271, 0x0FD6,
+ 0x6276, 0x6276, 0x1404, 0x6279, 0x6279, 0x1448, 0x627C, 0x627C, 0x16DC,
+ 0x627F, 0x627F, 0x1637, 0x6280, 0x6280, 0x0FF0, 0x6284, 0x6284, 0x1C32,
+ 0x6289, 0x6289, 0x0E40, 0x628A, 0x628A, 0x1D35, 0x6291, 0x6291, 0x171A,
+ 0x6292, 0x6292, 0x1504, 0x6295, 0x6295, 0x1D2C, 0x6297, 0x6297, 0x1DFC,
+ 0x6298, 0x6298, 0x1A1E, 0x629B, 0x629B, 0x1D81, 0x62AB, 0x62AB, 0x1DAE,
+ 0x62B1, 0x62B1, 0x1D82, 0x62B5, 0x62B5, 0x19C5, 0x62B9, 0x62B9, 0x1252,
+ 0x62BC, 0x62BC, 0x16C6, 0x62BD, 0x62BD, 0x1C62, 0x62C2, 0x62C2, 0x1436,
+ 0x62C7, 0x62C7, 0x12D1, 0x62C8, 0x62C8, 0x1045, 0x62C9, 0x62C9, 0x1139,
+ 0x62CC, 0x62CC, 0x132D, 0x62CD, 0x62CD, 0x1318, 0x62CF, 0x62CF, 0x1028,
+ 0x62D0, 0x62D0, 0x0F15, 0x62D2, 0x62D2, 0x0E05, 0x62D3, 0x62D3, 0x1BE3,
+ 0x62D4, 0x62D4, 0x1343, 0x62D6, 0x62D6, 0x1CDB, 0x62D7, 0x62D7, 0x1804,
+ 0x62D8, 0x62D8, 0x0F47, 0x62D9, 0x62D9, 0x1AB3, 0x62DB, 0x62DB, 0x1C33,
+ 0x62DC, 0x62DC, 0x136D, 0x62EC, 0x62EC, 0x0EFD, 0x62ED, 0x62ED, 0x165C,
+ 0x62EE, 0x62EE, 0x1021, 0x62EF, 0x62EF, 0x1B16, 0x62F1, 0x62F1, 0x0ED2,
+ 0x62F3, 0x62F3, 0x0F86, 0x62F7, 0x62F7, 0x0E9A, 0x62FE, 0x62FE, 0x162E,
+ 0x62FF, 0x62FF, 0x1029, 0x6301, 0x6301, 0x1B24, 0x6307, 0x6307, 0x1B25,
+ 0x6309, 0x6309, 0x16B1, 0x6311, 0x6311, 0x10BA, 0x632B, 0x632B, 0x1ACA,
+ 0x632F, 0x632F, 0x1B47, 0x633A, 0x633A, 0x1A3D, 0x633B, 0x633B, 0x174B,
+ 0x633D, 0x633D, 0x1244, 0x633E, 0x633E, 0x1E53, 0x6349, 0x6349, 0x1B8F,
+ 0x634C, 0x634C, 0x1D4D, 0x634F, 0x634F, 0x102F, 0x6350, 0x6350, 0x174A,
+ 0x6355, 0x6355, 0x1D83, 0x6367, 0x6367, 0x13EA, 0x6368, 0x6368, 0x1491,
+ 0x636E, 0x636E, 0x0E06, 0x6372, 0x6372, 0x0F87, 0x6377, 0x6377, 0x1C16,
+ 0x637A, 0x637A, 0x1030, 0x637B, 0x637B, 0x1046, 0x637F, 0x637F, 0x1505,
+ 0x6383, 0x6383, 0x1584, 0x6388, 0x6388, 0x15CD, 0x6389, 0x6389, 0x10BB,
+ 0x638C, 0x638C, 0x1991, 0x6392, 0x6392, 0x136E, 0x6396, 0x6396, 0x16DD,
+ 0x6398, 0x6398, 0x0F79, 0x639B, 0x639B, 0x0F0D, 0x63A0, 0x63A0, 0x1149,
+ 0x63A1, 0x63A1, 0x1BCF, 0x63A2, 0x63A2, 0x1CFC, 0x63A5, 0x63A5, 0x1A2D,
+ 0x63A7, 0x63A7, 0x0ED3, 0x63A8, 0x63A8, 0x1C63, 0x63A9, 0x63A9, 0x1729,
+ 0x63AA, 0x63AA, 0x1A85, 0x63C0, 0x63C0, 0x0D9C, 0x63C4, 0x63C4, 0x18B4,
+ 0x63C6, 0x63C6, 0x0F9D, 0x63CF, 0x63CF, 0x12C4, 0x63D0, 0x63D0, 0x1A6E,
+ 0x63D6, 0x63D6, 0x18F3, 0x63DA, 0x63DA, 0x16FB, 0x63DB, 0x63DB, 0x1ED0,
+ 0x63E1, 0x63E1, 0x16A7, 0x63ED, 0x63ED, 0x0E2D, 0x63EE, 0x63EE, 0x1F3F,
+ 0x63F4, 0x63F4, 0x187A, 0x63F6, 0x63F6, 0x16EB, 0x63F7, 0x63F7, 0x14CF,
+ 0x640D, 0x640D, 0x15AC, 0x640F, 0x640F, 0x1319, 0x6414, 0x6414, 0x1585,
+ 0x6416, 0x6416, 0x1805, 0x6417, 0x6417, 0x10BC, 0x641C, 0x641C, 0x15CE,
+ 0x6422, 0x6422, 0x1B48, 0x642C, 0x642C, 0x132E, 0x642D, 0x642D, 0x1D01,
+ 0x643A, 0x643A, 0x1F46, 0x643E, 0x643E, 0x1B90, 0x6458, 0x6458, 0x19DF,
+ 0x6460, 0x6460, 0x1C58, 0x6469, 0x6469, 0x1230, 0x646F, 0x646F, 0x1B26,
+ 0x6478, 0x6479, 0x12A2, 0x647A, 0x647A, 0x1A2E, 0x6488, 0x6488, 0x11A0,
+ 0x6491, 0x6491, 0x1D17, 0x6492, 0x6492, 0x14C4, 0x6493, 0x6493, 0x1806,
+ 0x649A, 0x649A, 0x1041, 0x649E, 0x649E, 0x1094, 0x64A4, 0x64A4, 0x1C03,
+ 0x64A5, 0x64A5, 0x1344, 0x64AB, 0x64AB, 0x12D2, 0x64AD, 0x64AD, 0x1D36,
+ 0x64AE, 0x64AE, 0x1C5D, 0x64B0, 0x64B0, 0x1B96, 0x64B2, 0x64B2, 0x131A,
+ 0x64BB, 0x64BB, 0x1074, 0x64C1, 0x64C1, 0x17CB, 0x64C4, 0x64C4, 0x11A1,
+ 0x64C5, 0x64C5, 0x1BF1, 0x64C7, 0x64C7, 0x1D15, 0x64CA, 0x64CA, 0x0E2E,
+ 0x64CD, 0x64CD, 0x1A86, 0x64CE, 0x64CE, 0x0E5A, 0x64D2, 0x64D2, 0x0FC8,
+ 0x64D4, 0x64D4, 0x107C, 0x64D8, 0x64D8, 0x139F, 0x64DA, 0x64DA, 0x0E07,
+ 0x64E1, 0x64E1, 0x10A3, 0x64E2, 0x64E2, 0x1CE7, 0x64E5, 0x64E5, 0x1130,
+ 0x64E6, 0x64E6, 0x1BA7, 0x64E7, 0x64E7, 0x0E08, 0x64EC, 0x64EC, 0x1900,
+ 0x64F2, 0x64F2, 0x1BE4, 0x64F4, 0x64F4, 0x1EC5, 0x64FA, 0x64FA, 0x1D37,
+ 0x64FE, 0x64FE, 0x1807, 0x6500, 0x6500, 0x132F, 0x6504, 0x6504, 0x1D18,
+ 0x6518, 0x6518, 0x16FC, 0x651D, 0x651D, 0x155F, 0x6523, 0x6523, 0x1173,
+ 0x652A, 0x652A, 0x0F23, 0x652B, 0x652B, 0x1EC6, 0x652C, 0x652C, 0x1131,
+ 0x652F, 0x652F, 0x1B27, 0x6536, 0x6536, 0x15CF, 0x6537, 0x6537, 0x0E9B,
+ 0x6538, 0x6538, 0x18B5, 0x6539, 0x6539, 0x0DF0, 0x653B, 0x653B, 0x0ED4,
+ 0x653E, 0x653E, 0x1355, 0x653F, 0x653F, 0x1A3E, 0x6545, 0x6545, 0x0E9C,
+ 0x6548, 0x6548, 0x1F14, 0x654D, 0x654D, 0x1506, 0x654E, 0x654E, 0x0F24,
+ 0x654F, 0x654F, 0x130A, 0x6551, 0x6551, 0x0F48, 0x6556, 0x6556, 0x17B0,
+ 0x6557, 0x6557, 0x1D51, 0x655E, 0x655E, 0x1BBC, 0x6562, 0x6562, 0x0DBD,
+ 0x6563, 0x6563, 0x14BA, 0x6566, 0x6566, 0x10E1, 0x656C, 0x656C, 0x0E5B,
+ 0x656D, 0x656D, 0x16FD, 0x6572, 0x6572, 0x0E9D, 0x6574, 0x6574, 0x1A3F,
+ 0x6575, 0x6575, 0x19E0, 0x6577, 0x6577, 0x1405, 0x6578, 0x6578, 0x15D0,
+ 0x657E, 0x657E, 0x1531, 0x6582, 0x6582, 0x1184, 0x6583, 0x6583, 0x1D73,
+ 0x6585, 0x6585, 0x1F15, 0x6587, 0x6587, 0x12E8, 0x658C, 0x658C, 0x146A,
+ 0x6590, 0x6590, 0x1449, 0x6591, 0x6591, 0x1330, 0x6597, 0x6597, 0x10FD,
+ 0x6599, 0x6599, 0x11CB, 0x659B, 0x659B, 0x0EB8, 0x659C, 0x659C, 0x1492,
+ 0x659F, 0x659F, 0x1B76, 0x65A1, 0x65A1, 0x16B9, 0x65A4, 0x65A4, 0x0FBB,
+ 0x65A5, 0x65A5, 0x1BE5, 0x65A7, 0x65A7, 0x1406, 0x65AB, 0x65AB, 0x1970,
+ 0x65AC, 0x65AC, 0x1BB0, 0x65AF, 0x65AF, 0x1493, 0x65B0, 0x65B0, 0x166E,
+ 0x65B7, 0x65B7, 0x1067, 0x65B9, 0x65B9, 0x1356, 0x65BC, 0x65BC, 0x1710,
+ 0x65BD, 0x65BD, 0x1647, 0x65C1, 0x65C1, 0x1357, 0x65C5, 0x65C5, 0x115F,
+ 0x65CB, 0x65CB, 0x1532, 0x65CC, 0x65CC, 0x1A40, 0x65CF, 0x65CF, 0x1AAC,
+ 0x65D2, 0x65D2, 0x11E2, 0x65D7, 0x65D7, 0x0FF1, 0x65E0, 0x65E0, 0x12D3,
+ 0x65E3, 0x65E3, 0x0FF2, 0x65E5, 0x65E5, 0x1940, 0x65E6, 0x65E6, 0x1068,
+ 0x65E8, 0x65E8, 0x1B28, 0x65E9, 0x65E9, 0x1A87, 0x65EC, 0x65EC, 0x160C,
+ 0x65ED, 0x65ED, 0x1857, 0x65F1, 0x65F1, 0x1DD6, 0x65F4, 0x65F4, 0x1841,
+ 0x65FA, 0x65FA, 0x17EF, 0x65FB, 0x65FC, 0x130B, 0x65FD, 0x65FD, 0x10E2,
+ 0x65FF, 0x65FF, 0x17B1, 0x6606, 0x6606, 0x0EC1, 0x6607, 0x6607, 0x1638,
+ 0x6609, 0x6609, 0x1358, 0x660A, 0x660A, 0x1E82, 0x660C, 0x660C, 0x1BBD,
+ 0x660E, 0x660E, 0x128F, 0x660F, 0x660F, 0x1EA5, 0x6610, 0x6610, 0x1429,
+ 0x6611, 0x6611, 0x0FC9, 0x6613, 0x6613, 0x173E, 0x6614, 0x6614, 0x151F,
+ 0x6615, 0x6615, 0x1F53, 0x661E, 0x661E, 0x13B6, 0x661F, 0x661F, 0x1568,
+ 0x6620, 0x6620, 0x1775, 0x6625, 0x6625, 0x1C84, 0x6627, 0x6627, 0x1268,
+ 0x6628, 0x6628, 0x1971, 0x662D, 0x662D, 0x1586, 0x662F, 0x662F, 0x1648,
+ 0x6630, 0x6630, 0x1DC5, 0x6631, 0x6631, 0x1858, 0x6634, 0x6634, 0x12C5,
+ 0x6636, 0x6636, 0x1BBE, 0x663A, 0x663A, 0x13B7, 0x663B, 0x663B, 0x16CC,
+ 0x6641, 0x6641, 0x1A88, 0x6642, 0x6642, 0x1649, 0x6643, 0x6644, 0x1EE7,
+ 0x6649, 0x6649, 0x1B49, 0x664B, 0x664B, 0x1B4A, 0x664F, 0x664F, 0x16B2,
+ 0x6659, 0x6659, 0x1AFC, 0x665B, 0x665B, 0x1E3A, 0x665D, 0x665D, 0x1AD9,
+ 0x665E, 0x665E, 0x1F6E, 0x665F, 0x665F, 0x1569, 0x6664, 0x6664, 0x17B2,
+ 0x6665, 0x6665, 0x1ED2, 0x6666, 0x6666, 0x1EFF, 0x6667, 0x6667, 0x1E83,
+ 0x6668, 0x6668, 0x166F, 0x6669, 0x6669, 0x1245, 0x666B, 0x666B, 0x1CE8,
+ 0x666E, 0x666E, 0x13C6, 0x666F, 0x666F, 0x0E5C, 0x6673, 0x6673, 0x1520,
+ 0x6674, 0x6674, 0x1C1E, 0x6676, 0x6676, 0x1A41, 0x6677, 0x6677, 0x0F96,
+ 0x6678, 0x6678, 0x1A42, 0x667A, 0x667A, 0x1B29, 0x6684, 0x6684, 0x1F37,
+ 0x6687, 0x6687, 0x0D77, 0x6688, 0x6688, 0x1F34, 0x6689, 0x6689, 0x1F40,
+ 0x668E, 0x668E, 0x1776, 0x6690, 0x6690, 0x1895, 0x6691, 0x6691, 0x1507,
+ 0x6696, 0x6696, 0x102C, 0x6697, 0x6697, 0x16C1, 0x6698, 0x6698, 0x16FE,
+ 0x669D, 0x669D, 0x1290, 0x66A0, 0x66A0, 0x0E9E, 0x66A2, 0x66A2, 0x1BBF,
+ 0x66AB, 0x66AB, 0x1980, 0x66AE, 0x66AE, 0x12A4, 0x66B2, 0x66B2, 0x1992,
+ 0x66B3, 0x66B3, 0x1E73, 0x66B4, 0x66B4, 0x1D94, 0x66B9, 0x66B9, 0x1558,
+ 0x66BB, 0x66BB, 0x0E5D, 0x66BE, 0x66BE, 0x10E3, 0x66C4, 0x66C4, 0x176F,
+ 0x66C6, 0x66C6, 0x116B, 0x66C7, 0x66C7, 0x107D, 0x66C9, 0x66C9, 0x1F16,
+ 0x66D6, 0x66D6, 0x16D5, 0x66D9, 0x66D9, 0x1508, 0x66DC, 0x66DC, 0x1808,
+ 0x66DD, 0x66DD, 0x1D95, 0x66E0, 0x66E0, 0x0F04, 0x66E6, 0x66E6, 0x1F6F,
+ 0x66F0, 0x66F0, 0x17ED, 0x66F2, 0x66F2, 0x0EB9, 0x66F3, 0x66F3, 0x1791,
+ 0x66F4, 0x66F4, 0x0E5E, 0x66F7, 0x66F7, 0x0DAE, 0x66F8, 0x66F8, 0x1509,
+ 0x66F9, 0x66F9, 0x1A8A, 0x66FA, 0x66FA, 0x1A89, 0x66FC, 0x66FC, 0x1246,
+ 0x66FE, 0x66FE, 0x1B15, 0x66FF, 0x66FF, 0x1C26, 0x6700, 0x6700, 0x1C60,
+ 0x6703, 0x6703, 0x1F00, 0x6708, 0x6708, 0x1889, 0x6709, 0x6709, 0x18B6,
+ 0x670B, 0x670B, 0x1438, 0x670D, 0x670D, 0x13D8, 0x6714, 0x6714, 0x14B6,
+ 0x6715, 0x6715, 0x1B77, 0x6717, 0x6717, 0x113D, 0x671B, 0x671B, 0x125C,
+ 0x671D, 0x671D, 0x1A8B, 0x671E, 0x671F, 0x0FF3, 0x6726, 0x6726, 0x12BE,
+ 0x6727, 0x6727, 0x11BA, 0x6728, 0x6728, 0x12B4, 0x672A, 0x672A, 0x12F9,
+ 0x672B, 0x672B, 0x1253, 0x672C, 0x672C, 0x13E3, 0x672D, 0x672D, 0x1BA8,
+ 0x672E, 0x672E, 0x1C88, 0x6731, 0x6731, 0x1ADA, 0x6734, 0x6734, 0x131B,
+ 0x6736, 0x6736, 0x1CDC, 0x673A, 0x673A, 0x0F90, 0x673D, 0x673D, 0x1F27,
+ 0x6746, 0x6746, 0x0D9D, 0x6749, 0x6749, 0x14C9, 0x674E, 0x674E, 0x120C,
+ 0x674F, 0x674F, 0x1E1B, 0x6750, 0x6750, 0x19AF, 0x6751, 0x6751, 0x1C51,
+ 0x6753, 0x6753, 0x1D9C, 0x6756, 0x6756, 0x1993, 0x675C, 0x675C, 0x10FE,
+ 0x675E, 0x675E, 0x0FF5, 0x675F, 0x675F, 0x15A3, 0x676D, 0x676D, 0x1DFD,
+ 0x676F, 0x676F, 0x136F, 0x6770, 0x6770, 0x0E1F, 0x6771, 0x6771, 0x10F1,
+ 0x6773, 0x6773, 0x12C6, 0x6775, 0x6775, 0x19C6, 0x6777, 0x6777, 0x1D38,
+ 0x677B, 0x677B, 0x1057, 0x677E, 0x677E, 0x15B3, 0x677F, 0x677F, 0x1D44,
+ 0x6787, 0x6787, 0x144A, 0x6789, 0x6789, 0x17F0, 0x678B, 0x678B, 0x1359,
+ 0x678F, 0x678F, 0x1032, 0x6790, 0x6790, 0x1521, 0x6793, 0x6793, 0x10FF,
+ 0x6795, 0x6795, 0x1CC9, 0x6797, 0x6797, 0x1227, 0x679A, 0x679A, 0x1269,
+ 0x679C, 0x679C, 0x0EDD, 0x679D, 0x679D, 0x1B2A, 0x67AF, 0x67AF, 0x0E9F,
+ 0x67B0, 0x67B0, 0x1D6B, 0x67B3, 0x67B3, 0x1B2B, 0x67B6, 0x67B7, 0x0D78,
+ 0x67B8, 0x67B8, 0x0F49, 0x67BE, 0x67BE, 0x164A, 0x67C4, 0x67C4, 0x13B8,
+ 0x67CF, 0x67CF, 0x137F, 0x67D0, 0x67D0, 0x12A5, 0x67D1, 0x67D1, 0x0DBE,
+ 0x67D2, 0x67D2, 0x1CC5, 0x67D3, 0x67D3, 0x1766, 0x67D4, 0x67D4, 0x18B7,
+ 0x67DA, 0x67DA, 0x18B8, 0x67DD, 0x67DD, 0x1CE9, 0x67E9, 0x67E9, 0x0F4A,
+ 0x67EC, 0x67EC, 0x0D9E, 0x67EF, 0x67EF, 0x0D7A, 0x67F0, 0x67F0, 0x103D,
+ 0x67F1, 0x67F1, 0x1ADB, 0x67F3, 0x67F3, 0x11E3, 0x67F4, 0x67F4, 0x164B,
+ 0x67F5, 0x67F5, 0x1BD7, 0x67F6, 0x67F6, 0x1494, 0x67FB, 0x67FB, 0x1495,
+ 0x67FE, 0x67FE, 0x1A43, 0x6812, 0x6812, 0x160D, 0x6813, 0x6813, 0x1A02,
+ 0x6816, 0x6816, 0x150A, 0x6817, 0x6817, 0x11FA, 0x6821, 0x6821, 0x0F25,
+ 0x6822, 0x6822, 0x1380, 0x682A, 0x682A, 0x1ADC, 0x682F, 0x682F, 0x1859,
+ 0x6838, 0x6838, 0x1E18, 0x6839, 0x6839, 0x0FBC, 0x683C, 0x683C, 0x0E2F,
+ 0x683D, 0x683D, 0x19B0, 0x6840, 0x6840, 0x0E20, 0x6841, 0x6841, 0x1DFE,
+ 0x6842, 0x6842, 0x0E81, 0x6843, 0x6843, 0x10BD, 0x6848, 0x6848, 0x16B3,
+ 0x684E, 0x684E, 0x1B6C, 0x6850, 0x6850, 0x10F2, 0x6851, 0x6851, 0x14E2,
+ 0x6853, 0x6853, 0x1ED3, 0x6854, 0x6854, 0x1022, 0x686D, 0x686D, 0x1B4B,
+ 0x6876, 0x6876, 0x1D1E, 0x687F, 0x687F, 0x0D9F, 0x6881, 0x6881, 0x114F,
+ 0x6885, 0x6885, 0x126A, 0x688F, 0x688F, 0x0EBA, 0x6893, 0x6893, 0x19B1,
+ 0x6894, 0x6894, 0x1CAE, 0x6897, 0x6897, 0x0E5F, 0x689D, 0x689D, 0x1A8C,
+ 0x689F, 0x689F, 0x1F17, 0x68A1, 0x68A1, 0x17DE, 0x68A2, 0x68A2, 0x1C34,
+ 0x68A7, 0x68A7, 0x17B3, 0x68A8, 0x68A8, 0x120D, 0x68AD, 0x68AD, 0x1496,
+ 0x68AF, 0x68AF, 0x1A6F, 0x68B0, 0x68B0, 0x0E82, 0x68B1, 0x68B1, 0x0EC2,
+ 0x68B3, 0x68B3, 0x1587, 0x68B5, 0x68B5, 0x1393, 0x68B6, 0x68B6, 0x12FA,
+ 0x68C4, 0x68C4, 0x0FF7, 0x68C5, 0x68C5, 0x13B9, 0x68C9, 0x68C9, 0x1282,
+ 0x68CB, 0x68CB, 0x0FF6, 0x68CD, 0x68CD, 0x0EC3, 0x68D2, 0x68D2, 0x13EB,
+ 0x68D5, 0x68D5, 0x1ABA, 0x68D7, 0x68D7, 0x1A8D, 0x68D8, 0x68D8, 0x0FB4,
+ 0x68DA, 0x68DA, 0x1439, 0x68DF, 0x68DF, 0x10F3, 0x68E0, 0x68E0, 0x1095,
+ 0x68E7, 0x68E7, 0x197B, 0x68E8, 0x68E8, 0x0E83, 0x68EE, 0x68EE, 0x14CA,
+ 0x68F2, 0x68F2, 0x150B, 0x68F9, 0x68F9, 0x10BE, 0x68FA, 0x68FA, 0x0EEF,
+ 0x6900, 0x6900, 0x17DF, 0x6905, 0x6905, 0x1901, 0x690D, 0x690D, 0x165D,
+ 0x690E, 0x690E, 0x1C64, 0x6912, 0x6912, 0x1C35, 0x6927, 0x6927, 0x1291,
+ 0x6930, 0x6930, 0x16EC, 0x693D, 0x693D, 0x174C, 0x693F, 0x693F, 0x1C85,
+ 0x694A, 0x694A, 0x16FF, 0x6953, 0x6953, 0x1DA8, 0x6954, 0x6954, 0x154C,
+ 0x6955, 0x6955, 0x1CDD, 0x6957, 0x6957, 0x0E17, 0x6959, 0x6959, 0x12D4,
+ 0x695A, 0x695A, 0x1C36, 0x695E, 0x695E, 0x1200, 0x6960, 0x6960, 0x1033,
+ 0x6961, 0x6962, 0x18B9, 0x6963, 0x6963, 0x12FB, 0x6968, 0x6968, 0x1A44,
+ 0x696B, 0x696B, 0x1B10, 0x696D, 0x696D, 0x172C, 0x696E, 0x696E, 0x19C7,
+ 0x696F, 0x696F, 0x160E, 0x6975, 0x6975, 0x0FB5, 0x6977, 0x6977, 0x1E0D,
+ 0x6978, 0x6978, 0x1C65, 0x6979, 0x6979, 0x1777, 0x6995, 0x6995, 0x1827,
+ 0x699B, 0x699B, 0x1B4C, 0x699C, 0x699C, 0x135A, 0x69A5, 0x69A5, 0x1EE9,
+ 0x69A7, 0x69A7, 0x144B, 0x69AE, 0x69AE, 0x1778, 0x69B4, 0x69B4, 0x11E4,
+ 0x69BB, 0x69BB, 0x1D02, 0x69C1, 0x69C1, 0x0EA0, 0x69C3, 0x69C3, 0x1331,
+ 0x69CB, 0x69CB, 0x0F4B, 0x69CC, 0x69CC, 0x1D24, 0x69CD, 0x69CD, 0x1BC0,
+ 0x69D0, 0x69D0, 0x0F16, 0x69E8, 0x69E8, 0x0EE8, 0x69EA, 0x69EA, 0x0DF1,
+ 0x69FB, 0x69FB, 0x0F9E, 0x69FD, 0x69FD, 0x1A8E, 0x69FF, 0x69FF, 0x0FBD,
+ 0x6A02, 0x6A02, 0x16A8, 0x6A0A, 0x6A0A, 0x1385, 0x6A11, 0x6A11, 0x1150,
+ 0x6A13, 0x6A13, 0x11D7, 0x6A17, 0x6A17, 0x19C8, 0x6A19, 0x6A19, 0x1D9D,
+ 0x6A1E, 0x6A1E, 0x1C66, 0x6A1F, 0x6A1F, 0x1994, 0x6A21, 0x6A21, 0x12A6,
+ 0x6A23, 0x6A23, 0x1700, 0x6A35, 0x6A35, 0x1C37, 0x6A38, 0x6A38, 0x131C,
+ 0x6A39, 0x6A39, 0x15D1, 0x6A3A, 0x6A3A, 0x1EBA, 0x6A3D, 0x6A3D, 0x1AFD,
+ 0x6A44, 0x6A44, 0x0DBF, 0x6A48, 0x6A48, 0x1809, 0x6A4B, 0x6A4B, 0x0F26,
+ 0x6A52, 0x6A52, 0x185F, 0x6A53, 0x6A53, 0x160F, 0x6A58, 0x6A58, 0x0FAF,
+ 0x6A59, 0x6A59, 0x110E, 0x6A5F, 0x6A5F, 0x0FF8, 0x6A61, 0x6A61, 0x14E3,
+ 0x6A6B, 0x6A6B, 0x1F0F, 0x6A80, 0x6A80, 0x1069, 0x6A84, 0x6A84, 0x0E30,
+ 0x6A89, 0x6A89, 0x1A45, 0x6A8D, 0x6A8D, 0x171B, 0x6A8E, 0x6A8E, 0x0FCA,
+ 0x6A97, 0x6A97, 0x13A0, 0x6A9C, 0x6A9C, 0x1F01, 0x6AA2, 0x6AA2, 0x0E24,
+ 0x6AA3, 0x6AA3, 0x1995, 0x6AB3, 0x6AB3, 0x146B, 0x6ABB, 0x6ABB, 0x1DE8,
+ 0x6AC2, 0x6AC2, 0x10BF, 0x6AC3, 0x6AC3, 0x0F91, 0x6AD3, 0x6AD3, 0x11A2,
+ 0x6ADA, 0x6ADA, 0x1160, 0x6ADB, 0x6ADB, 0x1B0F, 0x6AF6, 0x6AF6, 0x1E2C,
+ 0x6AFB, 0x6AFB, 0x16E2, 0x6B04, 0x6B04, 0x1127, 0x6B0A, 0x6B0A, 0x0F88,
+ 0x6B0C, 0x6B0C, 0x1996, 0x6B12, 0x6B12, 0x1128, 0x6B16, 0x6B16, 0x1132,
+ 0x6B20, 0x6B20, 0x1F5B, 0x6B21, 0x6B21, 0x1B88, 0x6B23, 0x6B23, 0x1F54,
+ 0x6B32, 0x6B32, 0x1819, 0x6B3A, 0x6B3A, 0x0FF9, 0x6B3D, 0x6B3D, 0x1F5C,
+ 0x6B3E, 0x6B3E, 0x0EF0, 0x6B46, 0x6B46, 0x1F5D, 0x6B47, 0x6B47, 0x1E2F,
+ 0x6B4C, 0x6B4C, 0x0D7B, 0x6B4E, 0x6B4E, 0x1CF5, 0x6B50, 0x6B50, 0x0F4C,
+ 0x6B5F, 0x6B5F, 0x1731, 0x6B61, 0x6B61, 0x1ED1, 0x6B62, 0x6B62, 0x1B2C,
+ 0x6B63, 0x6B63, 0x1A46, 0x6B64, 0x6B64, 0x1B89, 0x6B65, 0x6B65, 0x13C7,
+ 0x6B66, 0x6B66, 0x12D5, 0x6B6A, 0x6B6A, 0x17F5, 0x6B72, 0x6B72, 0x1576,
+ 0x6B77, 0x6B77, 0x116C, 0x6B78, 0x6B78, 0x0F97, 0x6B7B, 0x6B7B, 0x1497,
+ 0x6B7F, 0x6B7F, 0x12BB, 0x6B83, 0x6B83, 0x16CD, 0x6B84, 0x6B84, 0x1B4D,
+ 0x6B86, 0x6B86, 0x1D0C, 0x6B89, 0x6B89, 0x1610, 0x6B8A, 0x6B8A, 0x15D2,
+ 0x6B96, 0x6B96, 0x165E, 0x6B98, 0x6B98, 0x197C, 0x6B9E, 0x6B9E, 0x1860,
+ 0x6BAE, 0x6BAE, 0x1185, 0x6BAF, 0x6BAF, 0x146C, 0x6BB2, 0x6BB2, 0x1559,
+ 0x6BB5, 0x6BB5, 0x106A, 0x6BB7, 0x6BB7, 0x18E8, 0x6BBA, 0x6BBA, 0x14C5,
+ 0x6BBC, 0x6BBC, 0x0D8E, 0x6BBF, 0x6BBF, 0x1A03, 0x6BC1, 0x6BC1, 0x1F3C,
+ 0x6BC5, 0x6BC5, 0x1902, 0x6BC6, 0x6BC6, 0x0F4D, 0x6BCB, 0x6BCB, 0x12D6,
+ 0x6BCD, 0x6BCD, 0x12A7, 0x6BCF, 0x6BCF, 0x126B, 0x6BD2, 0x6BD2, 0x10D5,
+ 0x6BD3, 0x6BD3, 0x18D4, 0x6BD4, 0x6BD4, 0x144C, 0x6BD6, 0x6BD8, 0x144D,
+ 0x6BDB, 0x6BDB, 0x12A8, 0x6BEB, 0x6BEB, 0x1E84, 0x6BEC, 0x6BEC, 0x0F4E,
+ 0x6C08, 0x6C08, 0x1A04, 0x6C0F, 0x6C0F, 0x168E, 0x6C11, 0x6C11, 0x130D,
+ 0x6C13, 0x6C13, 0x1278, 0x6C23, 0x6C23, 0x0FFA, 0x6C34, 0x6C34, 0x15D3,
+ 0x6C37, 0x6C37, 0x1476, 0x6C38, 0x6C38, 0x1779, 0x6C3E, 0x6C3E, 0x1394,
+ 0x6C40, 0x6C40, 0x1A47, 0x6C41, 0x6C41, 0x1B11, 0x6C42, 0x6C42, 0x0F4F,
+ 0x6C4E, 0x6C4E, 0x1395, 0x6C50, 0x6C50, 0x1522, 0x6C55, 0x6C55, 0x14BB,
+ 0x6C57, 0x6C57, 0x1DD7, 0x6C5A, 0x6C5A, 0x17B4, 0x6C5D, 0x6C5D, 0x1732,
+ 0x6C5E, 0x6C5E, 0x1EAF, 0x6C5F, 0x6C5F, 0x0DD9, 0x6C60, 0x6C60, 0x1B2D,
+ 0x6C68, 0x6C68, 0x0EC8, 0x6C6A, 0x6C6A, 0x17F1, 0x6C6D, 0x6C6D, 0x1792,
+ 0x6C70, 0x6C70, 0x1D0D, 0x6C72, 0x6C72, 0x0FD7, 0x6C76, 0x6C76, 0x12E9,
+ 0x6C7A, 0x6C7A, 0x0E41, 0x6C7D, 0x6C7D, 0x0FFB, 0x6C7E, 0x6C7E, 0x142A,
+ 0x6C81, 0x6C81, 0x1685, 0x6C82, 0x6C82, 0x0FFC, 0x6C83, 0x6C83, 0x17BF,
+ 0x6C85, 0x6C85, 0x187B, 0x6C86, 0x6C86, 0x1DFF, 0x6C87, 0x6C87, 0x174D,
+ 0x6C88, 0x6C88, 0x1CCA, 0x6C8C, 0x6C8C, 0x10E4, 0x6C90, 0x6C90, 0x12B5,
+ 0x6C92, 0x6C92, 0x12BC, 0x6C93, 0x6C93, 0x108A, 0x6C94, 0x6C94, 0x1283,
+ 0x6C95, 0x6C95, 0x12F1, 0x6C96, 0x6C96, 0x1C8C, 0x6C99, 0x6C99, 0x1498,
+ 0x6C9A, 0x6C9A, 0x1B2E, 0x6C9B, 0x6C9B, 0x1D52, 0x6CAB, 0x6CAB, 0x1254,
+ 0x6CAE, 0x6CAE, 0x19C9, 0x6CB3, 0x6CB3, 0x1DC6, 0x6CB8, 0x6CB8, 0x1450,
+ 0x6CB9, 0x6CB9, 0x18BB, 0x6CBB, 0x6CBB, 0x1CAF, 0x6CBC, 0x6CBC, 0x1588,
+ 0x6CBD, 0x6CBD, 0x0EA1, 0x6CBE, 0x6CBE, 0x1C0B, 0x6CBF, 0x6CBF, 0x174E,
+ 0x6CC1, 0x6CC1, 0x1EEA, 0x6CC2, 0x6CC2, 0x1E60, 0x6CC4, 0x6CC4, 0x154D,
+ 0x6CC9, 0x6CC9, 0x1BF2, 0x6CCA, 0x6CCA, 0x131D, 0x6CCC, 0x6CCC, 0x1DB7,
+ 0x6CD3, 0x6CD3, 0x1EB0, 0x6CD5, 0x6CD5, 0x139A, 0x6CD7, 0x6CD7, 0x1499,
+ 0x6CDB, 0x6CDB, 0x1396, 0x6CE1, 0x6CE1, 0x1D84, 0x6CE2, 0x6CE2, 0x1D39,
+ 0x6CE3, 0x6CE3, 0x18F4, 0x6CE5, 0x6CE5, 0x105B, 0x6CE8, 0x6CE8, 0x1ADD,
+ 0x6CEB, 0x6CEB, 0x1E3B, 0x6CEE, 0x6CEE, 0x1332, 0x6CEF, 0x6CEF, 0x130E,
+ 0x6CF0, 0x6CF0, 0x1D0E, 0x6CF3, 0x6CF3, 0x177A, 0x6D0B, 0x6D0B, 0x1701,
+ 0x6D0C, 0x6D0C, 0x1180, 0x6D11, 0x6D11, 0x13C8, 0x6D17, 0x6D17, 0x1577,
+ 0x6D19, 0x6D19, 0x15D4, 0x6D1B, 0x6D1B, 0x111E, 0x6D1E, 0x6D1E, 0x10F4,
+ 0x6D25, 0x6D25, 0x1B4E, 0x6D27, 0x6D27, 0x18BC, 0x6D29, 0x6D29, 0x154E,
+ 0x6D2A, 0x6D2A, 0x1EB1, 0x6D32, 0x6D32, 0x1ADE, 0x6D35, 0x6D35, 0x1611,
+ 0x6D36, 0x6D36, 0x1F50, 0x6D38, 0x6D38, 0x0F05, 0x6D39, 0x6D39, 0x187C,
+ 0x6D3B, 0x6D3B, 0x1EDB, 0x6D3D, 0x6D3D, 0x1F60, 0x6D3E, 0x6D3E, 0x1D3A,
+ 0x6D41, 0x6D41, 0x11E5, 0x6D59, 0x6D59, 0x1A1F, 0x6D5A, 0x6D5A, 0x1AFE,
+ 0x6D5C, 0x6D5C, 0x146D, 0x6D63, 0x6D63, 0x17E0, 0x6D66, 0x6D66, 0x1D85,
+ 0x6D69, 0x6D69, 0x1E85, 0x6D6A, 0x6D6A, 0x113E, 0x6D6C, 0x6D6C, 0x120E,
+ 0x6D6E, 0x6D6E, 0x1407, 0x6D74, 0x6D74, 0x181A, 0x6D77, 0x6D77, 0x1E0E,
+ 0x6D78, 0x6D78, 0x1CCB, 0x6D79, 0x6D79, 0x1E54, 0x6D7F, 0x6D7F, 0x1D53,
+ 0x6D85, 0x6D85, 0x1762, 0x6D87, 0x6D87, 0x0E60, 0x6D88, 0x6D88, 0x1589,
+ 0x6D89, 0x6D89, 0x1560, 0x6D8C, 0x6D8C, 0x1828, 0x6D8D, 0x6D8D, 0x1F18,
+ 0x6D8E, 0x6D8E, 0x174F, 0x6D91, 0x6D91, 0x15A4, 0x6D93, 0x6D93, 0x1750,
+ 0x6D95, 0x6D95, 0x1C27, 0x6DAF, 0x6DAF, 0x16D6, 0x6DB2, 0x6DB2, 0x16DE,
+ 0x6DB5, 0x6DB5, 0x1DE9, 0x6DC0, 0x6DC0, 0x1A48, 0x6DC3, 0x6DC3, 0x0F89,
+ 0x6DC4, 0x6DC4, 0x1CB0, 0x6DC5, 0x6DC5, 0x1523, 0x6DC6, 0x6DC6, 0x1F19,
+ 0x6DC7, 0x6DC7, 0x0FFD, 0x6DCB, 0x6DCB, 0x1228, 0x6DCF, 0x6DCF, 0x1E86,
+ 0x6DD1, 0x6DD1, 0x1601, 0x6DD8, 0x6DD8, 0x10C0, 0x6DD9, 0x6DD9, 0x1ABB,
+ 0x6DDA, 0x6DDA, 0x11D8, 0x6DDE, 0x6DDE, 0x15B4, 0x6DE1, 0x6DE1, 0x107E,
+ 0x6DE8, 0x6DE8, 0x1A49, 0x6DEA, 0x6DEA, 0x11F5, 0x6DEB, 0x6DEB, 0x18EE,
+ 0x6DEE, 0x6DEE, 0x1F02, 0x6DF1, 0x6DF1, 0x1686, 0x6DF3, 0x6DF3, 0x1612,
+ 0x6DF5, 0x6DF5, 0x1751, 0x6DF7, 0x6DF7, 0x1EA6, 0x6DF8, 0x6DF8, 0x1C1F,
+ 0x6DF9, 0x6DF9, 0x172A, 0x6DFA, 0x6DFA, 0x1BF3, 0x6DFB, 0x6DFB, 0x1C0C,
+ 0x6E17, 0x6E17, 0x14CB, 0x6E19, 0x6E19, 0x1ED4, 0x6E1A, 0x6E1A, 0x19CA,
+ 0x6E1B, 0x6E1B, 0x0DC0, 0x6E1F, 0x6E1F, 0x1A4A, 0x6E20, 0x6E20, 0x0E09,
+ 0x6E21, 0x6E21, 0x10C1, 0x6E23, 0x6E23, 0x149A, 0x6E24, 0x6E24, 0x1345,
+ 0x6E25, 0x6E25, 0x16A9, 0x6E26, 0x6E26, 0x17D3, 0x6E2B, 0x6E2B, 0x154F,
+ 0x6E2C, 0x6E2C, 0x1CA6, 0x6E2D, 0x6E2D, 0x1896, 0x6E2F, 0x6E2F, 0x1E00,
+ 0x6E32, 0x6E32, 0x1533, 0x6E34, 0x6E34, 0x0DAF, 0x6E36, 0x6E36, 0x177B,
+ 0x6E38, 0x6E38, 0x18BD, 0x6E3A, 0x6E3A, 0x12C7, 0x6E3C, 0x6E3C, 0x12FC,
+ 0x6E3D, 0x6E3D, 0x19B2, 0x6E3E, 0x6E3E, 0x1EA7, 0x6E43, 0x6E43, 0x1370,
+ 0x6E44, 0x6E44, 0x12FD, 0x6E4A, 0x6E4A, 0x1ADF, 0x6E4D, 0x6E4D, 0x106B,
+ 0x6E56, 0x6E56, 0x1E87, 0x6E58, 0x6E58, 0x14E4, 0x6E5B, 0x6E5B, 0x107F,
+ 0x6E5C, 0x6E5C, 0x165F, 0x6E5E, 0x6E5E, 0x1A4B, 0x6E5F, 0x6E5F, 0x1EEB,
+ 0x6E67, 0x6E67, 0x1829, 0x6E6B, 0x6E6B, 0x1C67, 0x6E6E, 0x6E6E, 0x1935,
+ 0x6E6F, 0x6E6F, 0x1D05, 0x6E72, 0x6E72, 0x187D, 0x6E73, 0x6E73, 0x1034,
+ 0x6E7A, 0x6E7A, 0x13C9, 0x6E90, 0x6E90, 0x187E, 0x6E96, 0x6E96, 0x1AFF,
+ 0x6E9C, 0x6E9C, 0x11E6, 0x6E9D, 0x6E9D, 0x0F50, 0x6E9F, 0x6E9F, 0x1292,
+ 0x6EA2, 0x6EA2, 0x1941, 0x6EA5, 0x6EA5, 0x1408, 0x6EAA, 0x6EAA, 0x0E84,
+ 0x6EAB, 0x6EAB, 0x17C3, 0x6EAF, 0x6EAF, 0x158A, 0x6EB1, 0x6EB1, 0x1B4F,
+ 0x6EB6, 0x6EB6, 0x182A, 0x6EBA, 0x6EBA, 0x105D, 0x6EC2, 0x6EC2, 0x135B,
+ 0x6EC4, 0x6EC4, 0x1BC1, 0x6EC5, 0x6EC5, 0x128A, 0x6EC9, 0x6EC9, 0x1EEC,
+ 0x6ECB, 0x6ECB, 0x195D, 0x6ECC, 0x6ECC, 0x1BE6, 0x6ECE, 0x6ECE, 0x1E61,
+ 0x6ED1, 0x6ED1, 0x1EDC, 0x6ED3, 0x6ED3, 0x19B3, 0x6ED4, 0x6ED4, 0x10C2,
+ 0x6EEF, 0x6EEF, 0x1C28, 0x6EF4, 0x6EF4, 0x19E1, 0x6EF8, 0x6EF8, 0x1E88,
+ 0x6EFE, 0x6EFE, 0x0EC4, 0x6EFF, 0x6EFF, 0x1247, 0x6F01, 0x6F01, 0x1711,
+ 0x6F02, 0x6F02, 0x1D9E, 0x6F06, 0x6F06, 0x1CC6, 0x6F0F, 0x6F0F, 0x11D9,
+ 0x6F11, 0x6F11, 0x0DF2, 0x6F14, 0x6F14, 0x1752, 0x6F15, 0x6F15, 0x1A8F,
+ 0x6F20, 0x6F20, 0x123A, 0x6F22, 0x6F22, 0x1DD8, 0x6F23, 0x6F23, 0x1174,
+ 0x6F2B, 0x6F2B, 0x1248, 0x6F2C, 0x6F2C, 0x1B2F, 0x6F31, 0x6F31, 0x15D5,
+ 0x6F32, 0x6F32, 0x1BC2, 0x6F38, 0x6F38, 0x1A27, 0x6F3F, 0x6F3F, 0x1997,
+ 0x6F41, 0x6F41, 0x177C, 0x6F51, 0x6F51, 0x1346, 0x6F54, 0x6F54, 0x0E42,
+ 0x6F57, 0x6F57, 0x1B79, 0x6F58, 0x6F58, 0x1333, 0x6F5A, 0x6F5A, 0x1602,
+ 0x6F5B, 0x6F5B, 0x1981, 0x6F5E, 0x6F5E, 0x11A3, 0x6F5F, 0x6F5F, 0x1524,
+ 0x6F62, 0x6F62, 0x1EED, 0x6F64, 0x6F64, 0x18DA, 0x6F6D, 0x6F6D, 0x1080,
+ 0x6F6E, 0x6F6E, 0x1A90, 0x6F70, 0x6F70, 0x0F92, 0x6F7A, 0x6F7A, 0x197D,
+ 0x6F7C, 0x6F7C, 0x10F5, 0x6F7D, 0x6F7D, 0x13CA, 0x6F7E, 0x6F7E, 0x121F,
+ 0x6F81, 0x6F81, 0x14D0, 0x6F84, 0x6F84, 0x1B80, 0x6F88, 0x6F88, 0x1C04,
+ 0x6F8D, 0x6F8D, 0x1AE0, 0x6F8E, 0x6F8E, 0x1D5A, 0x6F90, 0x6F90, 0x1861,
+ 0x6F94, 0x6F94, 0x1E89, 0x6F97, 0x6F97, 0x0DA0, 0x6FA3, 0x6FA3, 0x1DD9,
+ 0x6FA4, 0x6FA4, 0x1D16, 0x6FA7, 0x6FA7, 0x119B, 0x6FAE, 0x6FAE, 0x1F03,
+ 0x6FAF, 0x6FAF, 0x1B97, 0x6FB1, 0x6FB1, 0x1A05, 0x6FB3, 0x6FB3, 0x17B5,
+ 0x6FB9, 0x6FB9, 0x1081, 0x6FBE, 0x6FBE, 0x1075, 0x6FC0, 0x6FC0, 0x0E31,
+ 0x6FC1, 0x6FC1, 0x1CEA, 0x6FC2, 0x6FC2, 0x1186, 0x6FC3, 0x6FC3, 0x104F,
+ 0x6FCA, 0x6FCA, 0x1793, 0x6FD5, 0x6FD5, 0x162D, 0x6FDA, 0x6FDA, 0x177D,
+ 0x6FDF, 0x6FDF, 0x1A70, 0x6FE0, 0x6FE0, 0x1E8A, 0x6FE1, 0x6FE1, 0x18BE,
+ 0x6FE4, 0x6FE4, 0x10C3, 0x6FE9, 0x6FE9, 0x1E8B, 0x6FEB, 0x6FEB, 0x1133,
+ 0x6FEC, 0x6FEC, 0x1B00, 0x6FEF, 0x6FEF, 0x1CEB, 0x6FF1, 0x6FF1, 0x146E,
+ 0x6FFE, 0x6FFE, 0x1161, 0x7001, 0x7001, 0x1702, 0x7005, 0x7005, 0x1E62,
+ 0x7006, 0x7006, 0x10D6, 0x7009, 0x7009, 0x149B, 0x700B, 0x700B, 0x1687,
+ 0x700F, 0x700F, 0x11E7, 0x7011, 0x7011, 0x1D96, 0x7015, 0x7015, 0x146F,
+ 0x7018, 0x7018, 0x11A4, 0x701A, 0x701A, 0x1DDA, 0x701B, 0x701B, 0x177E,
+ 0x701C, 0x701C, 0x18E2, 0x701D, 0x701D, 0x116D, 0x701E, 0x701E, 0x1A4C,
+ 0x701F, 0x701F, 0x158B, 0x7023, 0x7023, 0x1E0F, 0x7027, 0x7027, 0x11BB,
+ 0x7028, 0x7028, 0x11C0, 0x702F, 0x702F, 0x177F, 0x7037, 0x7037, 0x1925,
+ 0x703E, 0x703E, 0x1129, 0x704C, 0x704C, 0x0EF1, 0x7050, 0x7050, 0x1E63,
+ 0x7051, 0x7051, 0x15BA, 0x7058, 0x7058, 0x1CF6, 0x705D, 0x705D, 0x1E8C,
+ 0x7063, 0x7063, 0x1249, 0x706B, 0x706B, 0x1EBB, 0x7070, 0x7070, 0x1F04,
+ 0x7078, 0x7078, 0x0F51, 0x707C, 0x707C, 0x1972, 0x707D, 0x707D, 0x19B4,
+ 0x7085, 0x7085, 0x0E61, 0x708A, 0x708A, 0x1C99, 0x708E, 0x708E, 0x1767,
+ 0x7092, 0x7092, 0x1C38, 0x7098, 0x7098, 0x1F55, 0x7099, 0x7099, 0x195E,
+ 0x709A, 0x709A, 0x0F06, 0x70A1, 0x70A1, 0x1A4D, 0x70A4, 0x70A4, 0x158C,
+ 0x70AB, 0x70AB, 0x1E3C, 0x70AC, 0x70AC, 0x0E0A, 0x70AD, 0x70AD, 0x1CF7,
+ 0x70AF, 0x70AF, 0x1E64, 0x70B3, 0x70B3, 0x13BA, 0x70B7, 0x70B7, 0x1AE1,
+ 0x70B8, 0x70B8, 0x1973, 0x70B9, 0x70B9, 0x1A28, 0x70C8, 0x70C8, 0x1181,
+ 0x70CB, 0x70CB, 0x1F47, 0x70CF, 0x70CF, 0x17B6, 0x70D8, 0x70D8, 0x1EB2,
+ 0x70D9, 0x70D9, 0x111F, 0x70DD, 0x70DD, 0x1B17, 0x70DF, 0x70DF, 0x1753,
+ 0x70F1, 0x70F1, 0x0E62, 0x70F9, 0x70F9, 0x1D5B, 0x70FD, 0x70FD, 0x13EC,
+ 0x7104, 0x7104, 0x1F2F, 0x7109, 0x7109, 0x1720, 0x710C, 0x710C, 0x1B01,
+ 0x7119, 0x7119, 0x1371, 0x711A, 0x711A, 0x142B, 0x711E, 0x711E, 0x10E5,
+ 0x7121, 0x7121, 0x12D7, 0x7126, 0x7126, 0x1C39, 0x7130, 0x7130, 0x1768,
+ 0x7136, 0x7136, 0x1754, 0x7147, 0x7147, 0x1F41, 0x7149, 0x7149, 0x1175,
+ 0x714A, 0x714A, 0x1F38, 0x714C, 0x714C, 0x1EEE, 0x714E, 0x714E, 0x1A06,
+ 0x7150, 0x7150, 0x1780, 0x7156, 0x7156, 0x102D, 0x7159, 0x7159, 0x1755,
+ 0x715C, 0x715C, 0x185A, 0x715E, 0x715E, 0x14C6, 0x7164, 0x7164, 0x126C,
+ 0x7165, 0x7165, 0x1ED5, 0x7166, 0x7166, 0x1F28, 0x7167, 0x7167, 0x1A91,
+ 0x7169, 0x7169, 0x1386, 0x716C, 0x716C, 0x1703, 0x716E, 0x716E, 0x195F,
+ 0x717D, 0x717D, 0x1534, 0x7184, 0x7184, 0x1660, 0x7189, 0x7189, 0x1862,
+ 0x718A, 0x718A, 0x186D, 0x718F, 0x718F, 0x1F30, 0x7192, 0x7192, 0x1E65,
+ 0x7194, 0x7194, 0x182B, 0x7199, 0x7199, 0x1F70, 0x719F, 0x719F, 0x1603,
+ 0x71A2, 0x71A2, 0x13ED, 0x71AC, 0x71AC, 0x17B7, 0x71B1, 0x71B1, 0x1763,
+ 0x71B9, 0x71BA, 0x1F71, 0x71BE, 0x71BE, 0x1CB1, 0x71C1, 0x71C1, 0x1770,
+ 0x71C3, 0x71C3, 0x1756, 0x71C8, 0x71C8, 0x110F, 0x71C9, 0x71C9, 0x10E6,
+ 0x71CE, 0x71CE, 0x11CC, 0x71D0, 0x71D0, 0x1220, 0x71D2, 0x71D2, 0x158D,
+ 0x71D4, 0x71D4, 0x1387, 0x71D5, 0x71D5, 0x1757, 0x71DF, 0x71DF, 0x1781,
+ 0x71E5, 0x71E5, 0x1A92, 0x71E6, 0x71E6, 0x1B98, 0x71E7, 0x71E7, 0x15D6,
+ 0x71ED, 0x71ED, 0x1C4B, 0x71EE, 0x71EE, 0x1561, 0x71FB, 0x71FB, 0x1F31,
+ 0x71FC, 0x71FC, 0x1670, 0x71FE, 0x71FE, 0x10C4, 0x71FF, 0x71FF, 0x180A,
+ 0x7200, 0x7200, 0x1E33, 0x7206, 0x7206, 0x1D97, 0x7210, 0x7210, 0x11A5,
+ 0x721B, 0x721B, 0x112A, 0x722A, 0x722A, 0x1A93, 0x722C, 0x722C, 0x1D3B,
+ 0x722D, 0x722D, 0x19BB, 0x7230, 0x7230, 0x187F, 0x7232, 0x7232, 0x1897,
+ 0x7235, 0x7235, 0x1974, 0x7236, 0x7236, 0x1409, 0x723A, 0x723A, 0x16ED,
+ 0x723B, 0x723B, 0x1F1A, 0x723D, 0x723D, 0x14E5, 0x723E, 0x723E, 0x1916,
+ 0x7240, 0x7240, 0x14E6, 0x7246, 0x7246, 0x1998, 0x7247, 0x7247, 0x1D61,
+ 0x7248, 0x7248, 0x1D45, 0x724C, 0x724C, 0x1D54, 0x7252, 0x7252, 0x1C17,
+ 0x7258, 0x7258, 0x10D7, 0x7259, 0x7259, 0x1696, 0x725B, 0x725B, 0x1842,
+ 0x725D, 0x725D, 0x1470, 0x725F, 0x725F, 0x12A9, 0x7261, 0x7261, 0x12AA,
+ 0x7262, 0x7262, 0x11C1, 0x7267, 0x7267, 0x12B6, 0x7269, 0x7269, 0x12F2,
+ 0x7272, 0x7272, 0x14F9, 0x7279, 0x7279, 0x1D30, 0x727D, 0x727D, 0x0E36,
+ 0x7280, 0x7280, 0x150C, 0x7281, 0x7281, 0x120F, 0x72A2, 0x72A2, 0x10D8,
+ 0x72A7, 0x72A7, 0x1F73, 0x72AC, 0x72AC, 0x0E37, 0x72AF, 0x72AF, 0x1397,
+ 0x72C0, 0x72C0, 0x14E7, 0x72C2, 0x72C2, 0x0F07, 0x72C4, 0x72C4, 0x19E2,
+ 0x72CE, 0x72CE, 0x16C7, 0x72D0, 0x72D0, 0x1E8D, 0x72D7, 0x72D7, 0x0F52,
+ 0x72D9, 0x72D9, 0x19CB, 0x72E1, 0x72E1, 0x0F27, 0x72E9, 0x72E9, 0x15D7,
+ 0x72F8, 0x72F8, 0x1210, 0x72F9, 0x72F9, 0x1E55, 0x72FC, 0x72FC, 0x113F,
+ 0x72FD, 0x72FD, 0x1D55, 0x730A, 0x730A, 0x1794, 0x7316, 0x7316, 0x1BC3,
+ 0x731B, 0x731B, 0x1279, 0x731C, 0x731C, 0x164C, 0x731D, 0x731D, 0x1AB4,
+ 0x7325, 0x7325, 0x17FA, 0x7329, 0x7329, 0x156A, 0x732A, 0x732A, 0x19CC,
+ 0x732B, 0x732B, 0x12C8, 0x7336, 0x7337, 0x18BF, 0x733E, 0x733E, 0x1EDD,
+ 0x733F, 0x733F, 0x1880, 0x7344, 0x7344, 0x17C0, 0x7345, 0x7345, 0x149C,
+ 0x7350, 0x7350, 0x1999, 0x7352, 0x7352, 0x17B8, 0x7357, 0x7357, 0x0F8C,
+ 0x7368, 0x7368, 0x10D9, 0x736A, 0x736A, 0x1F05, 0x7370, 0x7370, 0x1782,
+ 0x7372, 0x7372, 0x1F0D, 0x7375, 0x7375, 0x1188, 0x7378, 0x7378, 0x15D8,
+ 0x737A, 0x737A, 0x1076, 0x737B, 0x737B, 0x1E2D, 0x7384, 0x7384, 0x1E3D,
+ 0x7386, 0x7386, 0x1960, 0x7387, 0x7387, 0x15B0, 0x7389, 0x7389, 0x17C1,
+ 0x738B, 0x738B, 0x17F2, 0x738E, 0x738E, 0x1A4E, 0x7394, 0x7394, 0x1BF4,
+ 0x7396, 0x7396, 0x0F53, 0x7397, 0x7397, 0x1843, 0x7398, 0x7398, 0x0FFE,
+ 0x739F, 0x739F, 0x130F, 0x73A7, 0x73A7, 0x18DB, 0x73A9, 0x73A9, 0x17E1,
+ 0x73AD, 0x73AD, 0x1471, 0x73B2, 0x73B2, 0x118F, 0x73B3, 0x73B3, 0x10A4,
+ 0x73B9, 0x73B9, 0x1E3E, 0x73C0, 0x73C0, 0x131E, 0x73C2, 0x73C2, 0x0D7C,
+ 0x73C9, 0x73C9, 0x1310, 0x73CA, 0x73CA, 0x14BC, 0x73CC, 0x73CC, 0x1DB8,
+ 0x73CD, 0x73CD, 0x1B50, 0x73CF, 0x73CF, 0x0D8F, 0x73D6, 0x73D6, 0x0F08,
+ 0x73D9, 0x73D9, 0x0ED5, 0x73DD, 0x73DD, 0x1F29, 0x73DE, 0x73DE, 0x1120,
+ 0x73E0, 0x73E0, 0x1AE2, 0x73E3, 0x73E3, 0x1613, 0x73E4, 0x73E4, 0x13CB,
+ 0x73E5, 0x73E5, 0x1917, 0x73E6, 0x73E6, 0x1E21, 0x73E9, 0x73E9, 0x1E66,
+ 0x73EA, 0x73EA, 0x0F9F, 0x73ED, 0x73ED, 0x1334, 0x73F7, 0x73F7, 0x12D8,
+ 0x73F9, 0x73F9, 0x156B, 0x73FD, 0x73FD, 0x1A4F, 0x73FE, 0x73FE, 0x1E3F,
+ 0x7401, 0x7401, 0x1535, 0x7403, 0x7403, 0x0F54, 0x7405, 0x7405, 0x1140,
+ 0x7406, 0x7406, 0x1211, 0x7407, 0x7407, 0x15D9, 0x7409, 0x7409, 0x11E8,
+ 0x7413, 0x7413, 0x17E2, 0x741B, 0x741B, 0x1CCC, 0x7420, 0x7420, 0x1A07,
+ 0x7421, 0x7421, 0x1604, 0x7422, 0x7422, 0x1CEC, 0x7425, 0x7425, 0x1E8E,
+ 0x7426, 0x7426, 0x0FFF, 0x7428, 0x7428, 0x0EC5, 0x742A, 0x742A, 0x1000,
+ 0x742B, 0x742B, 0x13EE, 0x742C, 0x742C, 0x17E3, 0x742E, 0x742E, 0x1ABC,
+ 0x742F, 0x742F, 0x0EF2, 0x7430, 0x7430, 0x1769, 0x7433, 0x7433, 0x1229,
+ 0x7434, 0x7434, 0x0FCB, 0x7435, 0x7435, 0x1451, 0x7436, 0x7436, 0x1D3C,
+ 0x7438, 0x7438, 0x1CED, 0x743A, 0x743A, 0x139B, 0x743F, 0x743F, 0x1EA8,
+ 0x7440, 0x7440, 0x1844, 0x7441, 0x7441, 0x12AB, 0x7443, 0x7443, 0x1C86,
+ 0x7444, 0x7444, 0x1536, 0x744B, 0x744B, 0x1898, 0x7455, 0x7455, 0x1DC7,
+ 0x7457, 0x7457, 0x1881, 0x7459, 0x7459, 0x104D, 0x745A, 0x745A, 0x1E8F,
+ 0x745B, 0x745B, 0x1783, 0x745C, 0x745C, 0x18C1, 0x745E, 0x745E, 0x150D,
+ 0x745F, 0x745F, 0x162A, 0x7460, 0x7460, 0x11E9, 0x7462, 0x7462, 0x182C,
+ 0x7464, 0x7464, 0x180B, 0x7465, 0x7465, 0x17C4, 0x7468, 0x7468, 0x1B51,
+ 0x7469, 0x7469, 0x1E67, 0x746A, 0x746A, 0x1231, 0x746F, 0x746F, 0x1141,
+ 0x747E, 0x747E, 0x0FBE, 0x7482, 0x7482, 0x1001, 0x7483, 0x7483, 0x1212,
+ 0x7487, 0x7487, 0x1537, 0x7489, 0x7489, 0x1176, 0x748B, 0x748B, 0x199A,
+ 0x7498, 0x7498, 0x1221, 0x749C, 0x749C, 0x1EEF, 0x749E, 0x749E, 0x131F,
+ 0x749F, 0x749F, 0x0E63, 0x74A1, 0x74A1, 0x1B52, 0x74A3, 0x74A3, 0x1002,
+ 0x74A5, 0x74A5, 0x0E64, 0x74A7, 0x74A7, 0x13A1, 0x74A8, 0x74A8, 0x1B99,
+ 0x74AA, 0x74AA, 0x1A94, 0x74B0, 0x74B0, 0x1ED6, 0x74B2, 0x74B2, 0x15DA,
+ 0x74B5, 0x74B5, 0x1733, 0x74B9, 0x74B9, 0x1605, 0x74BD, 0x74BD, 0x14F3,
+ 0x74BF, 0x74BF, 0x1538, 0x74C6, 0x74C6, 0x1B6D, 0x74CA, 0x74CA, 0x0E65,
+ 0x74CF, 0x74CF, 0x11BC, 0x74D4, 0x74D4, 0x1784, 0x74D8, 0x74D8, 0x0EF3,
+ 0x74DA, 0x74DA, 0x1B9A, 0x74DC, 0x74DC, 0x0EDE, 0x74E0, 0x74E0, 0x1E90,
+ 0x74E2, 0x74E2, 0x1D9F, 0x74E3, 0x74E3, 0x1D46, 0x74E6, 0x74E6, 0x17D4,
+ 0x74EE, 0x74EE, 0x17CC, 0x74F7, 0x74F7, 0x1961, 0x7501, 0x7501, 0x13BB,
+ 0x7504, 0x7504, 0x0E38, 0x7511, 0x7511, 0x1B18, 0x7515, 0x7515, 0x17CD,
+ 0x7518, 0x7518, 0x0DC1, 0x751A, 0x751A, 0x1688, 0x751B, 0x751B, 0x1C0D,
+ 0x751F, 0x751F, 0x14FA, 0x7523, 0x7523, 0x14BD, 0x7525, 0x7525, 0x14FB,
+ 0x7526, 0x7526, 0x158E, 0x7528, 0x7528, 0x182D, 0x752B, 0x752B, 0x13CC,
+ 0x752C, 0x752C, 0x182E, 0x7530, 0x7530, 0x1A08, 0x7531, 0x7531, 0x18C2,
+ 0x7532, 0x7532, 0x0DCC, 0x7533, 0x7533, 0x1671, 0x7537, 0x7537, 0x1035,
+ 0x7538, 0x7538, 0x1A09, 0x753A, 0x753A, 0x1A50, 0x7547, 0x7547, 0x0FAB,
+ 0x754C, 0x754C, 0x0E85, 0x754F, 0x754F, 0x17FB, 0x7551, 0x7551, 0x1A0A,
+ 0x7553, 0x7553, 0x108B, 0x7554, 0x7554, 0x1335, 0x7559, 0x7559, 0x11EA,
+ 0x755B, 0x755B, 0x1B53, 0x755C, 0x755C, 0x1C79, 0x755D, 0x755D, 0x12D9,
+ 0x7562, 0x7562, 0x1DB9, 0x7565, 0x7565, 0x114A, 0x7566, 0x7566, 0x1F48,
+ 0x756A, 0x756A, 0x1388, 0x756F, 0x756F, 0x1B02, 0x7570, 0x7570, 0x1918,
+ 0x7575, 0x7575, 0x1EBC, 0x7576, 0x7576, 0x1096, 0x7578, 0x7578, 0x1003,
+ 0x757A, 0x757A, 0x0DDA, 0x757F, 0x757F, 0x1004, 0x7586, 0x7586, 0x0DDB,
+ 0x7587, 0x7587, 0x1AE3, 0x758A, 0x758A, 0x1C18, 0x758B, 0x758B, 0x1DBA,
+ 0x758E, 0x758E, 0x1590, 0x758F, 0x758F, 0x158F, 0x7591, 0x7591, 0x1903,
+ 0x759D, 0x759D, 0x14BE, 0x75A5, 0x75A5, 0x0DF3, 0x75AB, 0x75AB, 0x173F,
+ 0x75B1, 0x75B1, 0x1D86, 0x75B2, 0x75B2, 0x1DAF, 0x75B3, 0x75B3, 0x0DC2,
+ 0x75B5, 0x75B5, 0x1962, 0x75B8, 0x75B8, 0x1077, 0x75B9, 0x75B9, 0x1B54,
+ 0x75BC, 0x75BC, 0x10F6, 0x75BD, 0x75BD, 0x19CD, 0x75BE, 0x75BE, 0x1B6E,
+ 0x75C2, 0x75C2, 0x0D7D, 0x75C5, 0x75C5, 0x13BC, 0x75C7, 0x75C7, 0x1B19,
+ 0x75CD, 0x75CD, 0x1919, 0x75D2, 0x75D2, 0x1704, 0x75D4, 0x75D4, 0x1CB2,
+ 0x75D5, 0x75D5, 0x1F56, 0x75D8, 0x75D8, 0x1100, 0x75D9, 0x75D9, 0x0E66,
+ 0x75DB, 0x75DB, 0x1D1F, 0x75E2, 0x75E2, 0x1213, 0x75F0, 0x75F0, 0x1082,
+ 0x75F2, 0x75F2, 0x1232, 0x75F4, 0x75F4, 0x1CB3, 0x75FA, 0x75FA, 0x1452,
+ 0x75FC, 0x75FC, 0x0EA2, 0x7600, 0x7600, 0x1712, 0x760D, 0x760D, 0x1705,
+ 0x7619, 0x7619, 0x1591, 0x761F, 0x761F, 0x17C5, 0x7620, 0x7620, 0x1BE7,
+ 0x7621, 0x7621, 0x1BC4, 0x7622, 0x7622, 0x1336, 0x7624, 0x7624, 0x11EB,
+ 0x7626, 0x7626, 0x15DB, 0x763B, 0x763B, 0x11DA, 0x7642, 0x7642, 0x11CD,
+ 0x764C, 0x764C, 0x16C2, 0x764E, 0x764E, 0x0DA1, 0x7652, 0x7652, 0x18C3,
+ 0x7656, 0x7656, 0x13A2, 0x7661, 0x7661, 0x1CB4, 0x7664, 0x7664, 0x1A20,
+ 0x7669, 0x7669, 0x1118, 0x766C, 0x766C, 0x1539, 0x7670, 0x7670, 0x17CE,
+ 0x7672, 0x7672, 0x1A0B, 0x7678, 0x7678, 0x0E86, 0x767B, 0x767B, 0x1110,
+ 0x767C, 0x767C, 0x1347, 0x767D, 0x767E, 0x1381, 0x7684, 0x7684, 0x19E3,
+ 0x7686, 0x7686, 0x0DF4, 0x7687, 0x7687, 0x1EF0, 0x768E, 0x768E, 0x0F28,
+ 0x7690, 0x7690, 0x0EA3, 0x7693, 0x7693, 0x1E91, 0x76AE, 0x76AE, 0x1DB0,
+ 0x76BA, 0x76BA, 0x1C68, 0x76BF, 0x76BF, 0x1293, 0x76C2, 0x76C2, 0x1845,
+ 0x76C3, 0x76C3, 0x1372, 0x76C6, 0x76C6, 0x142C, 0x76C8, 0x76C8, 0x1785,
+ 0x76CA, 0x76CA, 0x1926, 0x76D2, 0x76D2, 0x1DF1, 0x76D6, 0x76D6, 0x0DF5,
+ 0x76DB, 0x76DB, 0x156C, 0x76DC, 0x76DC, 0x10C5, 0x76DE, 0x76DE, 0x197E,
+ 0x76DF, 0x76DF, 0x127B, 0x76E1, 0x76E1, 0x1B55, 0x76E3, 0x76E3, 0x0DC3,
+ 0x76E4, 0x76E4, 0x1337, 0x76E7, 0x76E7, 0x11A6, 0x76EE, 0x76EE, 0x12B7,
+ 0x76F2, 0x76F2, 0x127A, 0x76F4, 0x76F4, 0x1B3F, 0x76F8, 0x76F8, 0x14E8,
+ 0x76FC, 0x76FC, 0x1338, 0x76FE, 0x76FE, 0x1614, 0x7701, 0x7701, 0x156D,
+ 0x7704, 0x7704, 0x1284, 0x7708, 0x7708, 0x1CFD, 0x7709, 0x7709, 0x12FE,
+ 0x770B, 0x770B, 0x0DA2, 0x771E, 0x771E, 0x1B56, 0x7720, 0x7720, 0x1285,
+ 0x7729, 0x7729, 0x1E40, 0x7737, 0x7737, 0x0F8A, 0x7738, 0x7738, 0x12AC,
+ 0x773A, 0x773A, 0x1A95, 0x773C, 0x773C, 0x16B4, 0x7740, 0x7740, 0x1B91,
+ 0x774D, 0x774D, 0x1E41, 0x775B, 0x775B, 0x1A51, 0x7761, 0x7761, 0x15DC,
+ 0x7763, 0x7763, 0x10DA, 0x7766, 0x7766, 0x12B8, 0x776B, 0x776B, 0x1C19,
+ 0x7779, 0x7779, 0x10C6, 0x777E, 0x777E, 0x0EA4, 0x777F, 0x777F, 0x1795,
+ 0x778B, 0x778B, 0x1B57, 0x7791, 0x7791, 0x1294, 0x779E, 0x779E, 0x124A,
+ 0x77A5, 0x77A5, 0x13AE, 0x77AC, 0x77AC, 0x1615, 0x77AD, 0x77AD, 0x11CE,
+ 0x77B0, 0x77B0, 0x0DC4, 0x77B3, 0x77B3, 0x10F7, 0x77BB, 0x77BB, 0x1C0E,
+ 0x77BC, 0x77BC, 0x0E25, 0x77BF, 0x77BF, 0x0F55, 0x77D7, 0x77D7, 0x1C4C,
+ 0x77DB, 0x77DB, 0x12AD, 0x77DC, 0x77DC, 0x0FDC, 0x77E2, 0x77E2, 0x164D,
+ 0x77E3, 0x77E3, 0x1904, 0x77E5, 0x77E5, 0x1B30, 0x77E9, 0x77E9, 0x0F56,
+ 0x77ED, 0x77ED, 0x106C, 0x77EE, 0x77EE, 0x17F6, 0x77EF, 0x77EF, 0x0F29,
+ 0x77F3, 0x77F3, 0x1525, 0x7802, 0x7802, 0x149D, 0x7812, 0x7812, 0x1453,
+ 0x7825, 0x7825, 0x1B31, 0x7826, 0x7826, 0x1BD0, 0x7827, 0x7827, 0x1CCD,
+ 0x782C, 0x782C, 0x122C, 0x7832, 0x7832, 0x1D87, 0x7834, 0x7834, 0x1D3D,
+ 0x7845, 0x7845, 0x0FA0, 0x784F, 0x784F, 0x1758, 0x785D, 0x785D, 0x1C3A,
+ 0x786B, 0x786B, 0x11EC, 0x786C, 0x786C, 0x0E67, 0x786F, 0x786F, 0x1759,
+ 0x787C, 0x787C, 0x143A, 0x7881, 0x7881, 0x1005, 0x7887, 0x7887, 0x1A52,
+ 0x788C, 0x788C, 0x11B0, 0x788D, 0x788D, 0x16D7, 0x788E, 0x788E, 0x15BB,
+ 0x7891, 0x7891, 0x1454, 0x7897, 0x7897, 0x17E4, 0x78A3, 0x78A3, 0x0DB0,
+ 0x78A7, 0x78A7, 0x13A3, 0x78A9, 0x78A9, 0x1526, 0x78BA, 0x78BB, 0x1EC7,
+ 0x78BC, 0x78BC, 0x1233, 0x78C1, 0x78C1, 0x1963, 0x78C5, 0x78C5, 0x135C,
+ 0x78CA, 0x78CA, 0x11C2, 0x78CB, 0x78CB, 0x1B8A, 0x78CE, 0x78CE, 0x0E87,
+ 0x78D0, 0x78D0, 0x1339, 0x78E8, 0x78E8, 0x1234, 0x78EC, 0x78EC, 0x0E68,
+ 0x78EF, 0x78EF, 0x1006, 0x78F5, 0x78F5, 0x0DA3, 0x78FB, 0x78FB, 0x133A,
+ 0x7901, 0x7901, 0x1C3B, 0x790E, 0x790E, 0x1C3C, 0x7916, 0x7916, 0x1734,
+ 0x792A, 0x792A, 0x1162, 0x792B, 0x792B, 0x116E, 0x792C, 0x792C, 0x133B,
+ 0x793A, 0x793A, 0x164E, 0x793E, 0x793E, 0x149E, 0x7940, 0x7940, 0x149F,
+ 0x7941, 0x7941, 0x1007, 0x7947, 0x7948, 0x1008, 0x7949, 0x7949, 0x1B32,
+ 0x7950, 0x7950, 0x1846, 0x7956, 0x7956, 0x1A96, 0x7957, 0x7957, 0x1B33,
+ 0x795A, 0x795A, 0x1A97, 0x795B, 0x795B, 0x0E0B, 0x795C, 0x795C, 0x1E92,
+ 0x795D, 0x795D, 0x1C7A, 0x795E, 0x795E, 0x1672, 0x7960, 0x7960, 0x14A0,
+ 0x7965, 0x7965, 0x14E9, 0x7968, 0x7968, 0x1DA0, 0x796D, 0x796D, 0x1A71,
+ 0x797A, 0x797A, 0x100A, 0x797F, 0x797F, 0x11B1, 0x7981, 0x7981, 0x0FCC,
+ 0x798D, 0x798D, 0x1EBD, 0x798E, 0x798E, 0x1A53, 0x798F, 0x798F, 0x13D9,
+ 0x7991, 0x7991, 0x1847, 0x79A6, 0x79A6, 0x1713, 0x79A7, 0x79A7, 0x1F74,
+ 0x79AA, 0x79AA, 0x153A, 0x79AE, 0x79AE, 0x119C, 0x79B1, 0x79B1, 0x10C7,
+ 0x79B3, 0x79B3, 0x1706, 0x79B9, 0x79B9, 0x1848, 0x79BD, 0x79BD, 0x0FCD,
+ 0x79BE, 0x79BE, 0x1EBE, 0x79BF, 0x79BF, 0x10DB, 0x79C0, 0x79C0, 0x15DD,
+ 0x79C1, 0x79C1, 0x14A1, 0x79C9, 0x79C9, 0x13BD, 0x79CA, 0x79CA, 0x1042,
+ 0x79CB, 0x79CB, 0x1C69, 0x79D1, 0x79D1, 0x0EDF, 0x79D2, 0x79D2, 0x1C3D,
+ 0x79D5, 0x79D5, 0x1455, 0x79D8, 0x79D8, 0x1456, 0x79DF, 0x79DF, 0x1A98,
+ 0x79E4, 0x79E4, 0x1CD1, 0x79E6, 0x79E6, 0x1B58, 0x79E7, 0x79E7, 0x16CE,
+ 0x79E9, 0x79E9, 0x1B6F, 0x79FB, 0x79FB, 0x191A, 0x7A00, 0x7A00, 0x1F75,
+ 0x7A05, 0x7A05, 0x1578, 0x7A08, 0x7A08, 0x0DA4, 0x7A0B, 0x7A0B, 0x1A54,
+ 0x7A0D, 0x7A0D, 0x1C3E, 0x7A14, 0x7A14, 0x194A, 0x7A17, 0x7A17, 0x1D56,
+ 0x7A19, 0x7A19, 0x1B40, 0x7A1A, 0x7A1A, 0x1CB5, 0x7A1C, 0x7A1C, 0x1201,
+ 0x7A1F, 0x7A1F, 0x1DA7, 0x7A20, 0x7A20, 0x1A99, 0x7A2E, 0x7A2E, 0x1ABD,
+ 0x7A31, 0x7A31, 0x1CD2, 0x7A36, 0x7A36, 0x185B, 0x7A37, 0x7A37, 0x1B41,
+ 0x7A3B, 0x7A3B, 0x10C8, 0x7A3C, 0x7A3C, 0x0D7E, 0x7A3D, 0x7A3D, 0x0E88,
+ 0x7A3F, 0x7A3F, 0x0EA5, 0x7A40, 0x7A40, 0x0EBB, 0x7A46, 0x7A46, 0x12B9,
+ 0x7A49, 0x7A49, 0x1CB6, 0x7A4D, 0x7A4D, 0x19E4, 0x7A4E, 0x7A4E, 0x1786,
+ 0x7A57, 0x7A57, 0x15DE, 0x7A61, 0x7A61, 0x14F6, 0x7A62, 0x7A62, 0x1796,
+ 0x7A69, 0x7A69, 0x17C6, 0x7A6B, 0x7A6B, 0x1EC9, 0x7A70, 0x7A70, 0x1707,
+ 0x7A74, 0x7A74, 0x1E4B, 0x7A76, 0x7A76, 0x0F57, 0x7A79, 0x7A79, 0x0F7D,
+ 0x7A7A, 0x7A7A, 0x0ED6, 0x7A7D, 0x7A7D, 0x1A55, 0x7A7F, 0x7A7F, 0x1BF5,
+ 0x7A81, 0x7A81, 0x10EA, 0x7A84, 0x7A84, 0x1B92, 0x7A88, 0x7A88, 0x180C,
+ 0x7A92, 0x7A92, 0x1B70, 0x7A93, 0x7A93, 0x1BC5, 0x7A95, 0x7A95, 0x1A9A,
+ 0x7A98, 0x7A98, 0x0F72, 0x7A9F, 0x7A9F, 0x0F7A, 0x7AA9, 0x7AAA, 0x17D5,
+ 0x7AAE, 0x7AAE, 0x0F7E, 0x7AAF, 0x7AAF, 0x180D, 0x7ABA, 0x7ABA, 0x0FA1,
+ 0x7AC4, 0x7AC4, 0x1B9B, 0x7AC5, 0x7AC5, 0x0FA2, 0x7AC7, 0x7AC7, 0x1101,
+ 0x7ACA, 0x7ACA, 0x1A21, 0x7ACB, 0x7ACB, 0x122D, 0x7AD7, 0x7AD7, 0x12C9,
+ 0x7AD9, 0x7AD9, 0x1BB1, 0x7ADD, 0x7ADD, 0x13BE, 0x7ADF, 0x7ADF, 0x0E69,
+ 0x7AE0, 0x7AE0, 0x199B, 0x7AE3, 0x7AE3, 0x1B03, 0x7AE5, 0x7AE5, 0x10F8,
+ 0x7AEA, 0x7AEA, 0x15DF, 0x7AED, 0x7AED, 0x0DB1, 0x7AEF, 0x7AEF, 0x106D,
+ 0x7AF6, 0x7AF6, 0x0E6A, 0x7AF9, 0x7AF9, 0x1AF4, 0x7AFA, 0x7AFA, 0x1C7B,
+ 0x7AFF, 0x7AFF, 0x0DA5, 0x7B0F, 0x7B0F, 0x1EAC, 0x7B11, 0x7B11, 0x1592,
+ 0x7B19, 0x7B19, 0x14FC, 0x7B1B, 0x7B1B, 0x19E5, 0x7B1E, 0x7B1E, 0x1D0F,
+ 0x7B20, 0x7B20, 0x122E, 0x7B26, 0x7B26, 0x140A, 0x7B2C, 0x7B2C, 0x1A72,
+ 0x7B2D, 0x7B2D, 0x1190, 0x7B39, 0x7B39, 0x1579, 0x7B46, 0x7B46, 0x1DBB,
+ 0x7B49, 0x7B49, 0x1111, 0x7B4B, 0x7B4B, 0x0FBF, 0x7B4C, 0x7B4C, 0x1A0C,
+ 0x7B4D, 0x7B4D, 0x1616, 0x7B4F, 0x7B4F, 0x138E, 0x7B50, 0x7B50, 0x0F09,
+ 0x7B51, 0x7B51, 0x1C7C, 0x7B52, 0x7B52, 0x1D20, 0x7B54, 0x7B54, 0x108C,
+ 0x7B56, 0x7B56, 0x1BD8, 0x7B60, 0x7B60, 0x0FAC, 0x7B6C, 0x7B6C, 0x156E,
+ 0x7B6E, 0x7B6E, 0x150E, 0x7B75, 0x7B75, 0x175A, 0x7B7D, 0x7B7D, 0x17B9,
+ 0x7B87, 0x7B87, 0x0DF6, 0x7B8B, 0x7B8B, 0x1A0D, 0x7B8F, 0x7B8F, 0x19BC,
+ 0x7B94, 0x7B94, 0x1320, 0x7B95, 0x7B95, 0x100B, 0x7B97, 0x7B97, 0x14BF,
+ 0x7B9A, 0x7B9A, 0x1B8B, 0x7B9D, 0x7B9D, 0x0E48, 0x7BA1, 0x7BA1, 0x0EF4,
+ 0x7BAD, 0x7BAD, 0x1A0E, 0x7BB1, 0x7BB1, 0x14EA, 0x7BB4, 0x7BB4, 0x1982,
+ 0x7BB8, 0x7BB8, 0x19CE, 0x7BC0, 0x7BC0, 0x1A22, 0x7BC1, 0x7BC1, 0x1EF1,
+ 0x7BC4, 0x7BC4, 0x1398, 0x7BC6, 0x7BC6, 0x1A0F, 0x7BC7, 0x7BC7, 0x1D62,
+ 0x7BC9, 0x7BC9, 0x1C7D, 0x7BD2, 0x7BD2, 0x1661, 0x7BE0, 0x7BE0, 0x1593,
+ 0x7BE4, 0x7BE4, 0x10DC, 0x7BE9, 0x7BE9, 0x14A2, 0x7C07, 0x7C07, 0x1AAD,
+ 0x7C12, 0x7C12, 0x1B9C, 0x7C1E, 0x7C1E, 0x106E, 0x7C21, 0x7C21, 0x0DA6,
+ 0x7C27, 0x7C27, 0x1EF2, 0x7C2A, 0x7C2A, 0x1983, 0x7C2B, 0x7C2B, 0x1594,
+ 0x7C3D, 0x7C3D, 0x1C0F, 0x7C3E, 0x7C3E, 0x1187, 0x7C3F, 0x7C3F, 0x140B,
+ 0x7C43, 0x7C43, 0x1134, 0x7C4C, 0x7C4C, 0x1AE4, 0x7C4D, 0x7C4D, 0x19E6,
+ 0x7C60, 0x7C60, 0x11BD, 0x7C64, 0x7C64, 0x1C10, 0x7C6C, 0x7C6C, 0x1214,
+ 0x7C73, 0x7C73, 0x12FF, 0x7C83, 0x7C83, 0x1457, 0x7C89, 0x7C89, 0x142D,
+ 0x7C92, 0x7C92, 0x122F, 0x7C95, 0x7C95, 0x1321, 0x7C97, 0x7C97, 0x1A9B,
+ 0x7C98, 0x7C98, 0x1A29, 0x7C9F, 0x7C9F, 0x15A5, 0x7CA5, 0x7CA5, 0x1AF5,
+ 0x7CA7, 0x7CA7, 0x199C, 0x7CAE, 0x7CAE, 0x1151, 0x7CB1, 0x7CB1, 0x1152,
+ 0x7CB2, 0x7CB2, 0x1B9E, 0x7CB3, 0x7CB3, 0x0DFE, 0x7CB9, 0x7CB9, 0x15E0,
+ 0x7CBE, 0x7CBE, 0x1A56, 0x7CCA, 0x7CCA, 0x1E93, 0x7CD6, 0x7CD6, 0x1097,
+ 0x7CDE, 0x7CDE, 0x142E, 0x7CDF, 0x7CDF, 0x1A9C, 0x7CE0, 0x7CE0, 0x0DDC,
+ 0x7CE7, 0x7CE7, 0x1153, 0x7CFB, 0x7CFB, 0x0E89, 0x7CFE, 0x7CFE, 0x0FA3,
+ 0x7D00, 0x7D00, 0x100C, 0x7D02, 0x7D02, 0x1AE5, 0x7D04, 0x7D04, 0x16F1,
+ 0x7D05, 0x7D05, 0x1EB3, 0x7D06, 0x7D06, 0x1849, 0x7D07, 0x7D07, 0x1F59,
+ 0x7D08, 0x7D08, 0x1ED7, 0x7D0A, 0x7D0B, 0x12EA, 0x7D0D, 0x7D0D, 0x1036,
+ 0x7D10, 0x7D10, 0x1058, 0x7D14, 0x7D14, 0x1617, 0x7D17, 0x7D17, 0x14A3,
+ 0x7D18, 0x7D18, 0x0F19, 0x7D19, 0x7D19, 0x1B34, 0x7D1A, 0x7D1A, 0x0FD8,
+ 0x7D1B, 0x7D1B, 0x142F, 0x7D20, 0x7D20, 0x1595, 0x7D21, 0x7D21, 0x135D,
+ 0x7D22, 0x7D22, 0x14F7, 0x7D2B, 0x7D2B, 0x1964, 0x7D2C, 0x7D2C, 0x1AE6,
+ 0x7D2E, 0x7D2E, 0x1BA9, 0x7D2F, 0x7D2F, 0x11DB, 0x7D30, 0x7D30, 0x157A,
+ 0x7D33, 0x7D33, 0x1673, 0x7D35, 0x7D35, 0x19CF, 0x7D39, 0x7D39, 0x1596,
+ 0x7D3A, 0x7D3A, 0x0DC5, 0x7D42, 0x7D42, 0x1ABE, 0x7D43, 0x7D43, 0x1E42,
+ 0x7D44, 0x7D44, 0x1A9D, 0x7D45, 0x7D45, 0x0E6B, 0x7D46, 0x7D46, 0x133C,
+ 0x7D50, 0x7D50, 0x0E43, 0x7D5E, 0x7D5E, 0x0F2A, 0x7D61, 0x7D61, 0x1121,
+ 0x7D62, 0x7D62, 0x1E43, 0x7D66, 0x7D66, 0x0FD9, 0x7D68, 0x7D68, 0x18E3,
+ 0x7D6A, 0x7D6A, 0x1936, 0x7D6E, 0x7D6E, 0x150F, 0x7D71, 0x7D71, 0x1D21,
+ 0x7D72, 0x7D72, 0x14A4, 0x7D73, 0x7D73, 0x0DDD, 0x7D76, 0x7D76, 0x1A23,
+ 0x7D79, 0x7D79, 0x0E39, 0x7D7F, 0x7D7F, 0x0F58, 0x7D8E, 0x7D8E, 0x1A57,
+ 0x7D8F, 0x7D8F, 0x15E1, 0x7D93, 0x7D93, 0x0E6C, 0x7D9C, 0x7D9C, 0x1ABF,
+ 0x7DA0, 0x7DA0, 0x11B2, 0x7DA2, 0x7DA2, 0x1AE7, 0x7DAC, 0x7DAC, 0x15E2,
+ 0x7DAD, 0x7DAD, 0x18C4, 0x7DB1, 0x7DB1, 0x0DDE, 0x7DB2, 0x7DB2, 0x125D,
+ 0x7DB4, 0x7DB4, 0x1C05, 0x7DB5, 0x7DB5, 0x1BD1, 0x7DB8, 0x7DB8, 0x11F6,
+ 0x7DBA, 0x7DBA, 0x100D, 0x7DBB, 0x7DBB, 0x1CF8, 0x7DBD, 0x7DBD, 0x1975,
+ 0x7DBE, 0x7DBE, 0x1202, 0x7DBF, 0x7DBF, 0x1286, 0x7DC7, 0x7DC7, 0x1CB7,
+ 0x7DCA, 0x7DCA, 0x101E, 0x7DCB, 0x7DCB, 0x1458, 0x7DD6, 0x7DD6, 0x1510,
+ 0x7DD8, 0x7DD8, 0x1DEA, 0x7DDA, 0x7DDA, 0x153B, 0x7DDD, 0x7DDD, 0x1B7A,
+ 0x7DDE, 0x7DDE, 0x106F, 0x7DE0, 0x7DE0, 0x1C29, 0x7DE1, 0x7DE1, 0x1311,
+ 0x7DE3, 0x7DE3, 0x175B, 0x7DE8, 0x7DE8, 0x1D63, 0x7DE9, 0x7DE9, 0x17E5,
+ 0x7DEC, 0x7DEC, 0x1287, 0x7DEF, 0x7DEF, 0x1899, 0x7DF4, 0x7DF4, 0x1177,
+ 0x7DFB, 0x7DFB, 0x1CB8, 0x7E09, 0x7E09, 0x1B59, 0x7E0A, 0x7E0A, 0x16DF,
+ 0x7E15, 0x7E15, 0x17C7, 0x7E1B, 0x7E1B, 0x1322, 0x7E1D, 0x7E1D, 0x1B5A,
+ 0x7E1E, 0x7E1E, 0x1E94, 0x7E1F, 0x7E1F, 0x181B, 0x7E21, 0x7E21, 0x19B5,
+ 0x7E23, 0x7E23, 0x1E44, 0x7E2B, 0x7E2B, 0x13EF, 0x7E2E, 0x7E2E, 0x1C7E,
+ 0x7E2F, 0x7E2F, 0x175C, 0x7E31, 0x7E31, 0x1AC0, 0x7E37, 0x7E37, 0x11DC,
+ 0x7E3D, 0x7E3D, 0x1C59, 0x7E3E, 0x7E3E, 0x19E7, 0x7E41, 0x7E41, 0x1389,
+ 0x7E43, 0x7E43, 0x143B, 0x7E46, 0x7E46, 0x12DA, 0x7E47, 0x7E47, 0x180E,
+ 0x7E52, 0x7E52, 0x1B1A, 0x7E54, 0x7E54, 0x1B42, 0x7E55, 0x7E55, 0x153C,
+ 0x7E5E, 0x7E5E, 0x180F, 0x7E61, 0x7E61, 0x15E3, 0x7E69, 0x7E69, 0x1639,
+ 0x7E6A, 0x7E6A, 0x1F06, 0x7E6B, 0x7E6B, 0x0E8A, 0x7E6D, 0x7E6D, 0x0E3A,
+ 0x7E70, 0x7E70, 0x1A9E, 0x7E79, 0x7E79, 0x1740, 0x7E7C, 0x7E7C, 0x0E8B,
+ 0x7E82, 0x7E82, 0x1B9D, 0x7E8C, 0x7E8C, 0x15A6, 0x7E8F, 0x7E8F, 0x1A10,
+ 0x7E93, 0x7E93, 0x1787, 0x7E96, 0x7E96, 0x155A, 0x7E98, 0x7E98, 0x1B9F,
+ 0x7E9B, 0x7E9B, 0x10DD, 0x7E9C, 0x7E9C, 0x1135, 0x7F36, 0x7F36, 0x140C,
+ 0x7F38, 0x7F38, 0x1E01, 0x7F3A, 0x7F3A, 0x0E44, 0x7F4C, 0x7F4C, 0x16E3,
+ 0x7F50, 0x7F50, 0x0EF5, 0x7F54, 0x7F54, 0x125E, 0x7F55, 0x7F55, 0x1DDB,
+ 0x7F6A, 0x7F6A, 0x1ACB, 0x7F6B, 0x7F6B, 0x0F0E, 0x7F6E, 0x7F6E, 0x1CB9,
+ 0x7F70, 0x7F70, 0x138F, 0x7F72, 0x7F72, 0x1511, 0x7F75, 0x7F75, 0x126D,
+ 0x7F77, 0x7F77, 0x1D3E, 0x7F79, 0x7F79, 0x1215, 0x7F85, 0x7F85, 0x1119,
+ 0x7F88, 0x7F88, 0x100E, 0x7F8A, 0x7F8A, 0x1708, 0x7F8C, 0x7F8C, 0x0DDF,
+ 0x7F8E, 0x7F8E, 0x1300, 0x7F94, 0x7F94, 0x0EA6, 0x7F9A, 0x7F9A, 0x1191,
+ 0x7F9E, 0x7F9E, 0x15E4, 0x7FA4, 0x7FA4, 0x0F73, 0x7FA8, 0x7FA8, 0x153D,
+ 0x7FA9, 0x7FA9, 0x1905, 0x7FB2, 0x7FB2, 0x1F76, 0x7FB8, 0x7FB8, 0x1216,
+ 0x7FB9, 0x7FB9, 0x0DFF, 0x7FBD, 0x7FBD, 0x184A, 0x7FC1, 0x7FC1, 0x17CF,
+ 0x7FC5, 0x7FC5, 0x164F, 0x7FCA, 0x7FCA, 0x1927, 0x7FCC, 0x7FCC, 0x1928,
+ 0x7FCE, 0x7FCE, 0x1192, 0x7FD2, 0x7FD2, 0x162F, 0x7FD4, 0x7FD4, 0x14EB,
+ 0x7FD5, 0x7FD5, 0x1F61, 0x7FDF, 0x7FDF, 0x19E8, 0x7FE0, 0x7FE0, 0x1C9A,
+ 0x7FE1, 0x7FE1, 0x1459, 0x7FE9, 0x7FE9, 0x1D64, 0x7FEB, 0x7FEB, 0x17E6,
+ 0x7FF0, 0x7FF0, 0x1DDC, 0x7FF9, 0x7FF9, 0x0F2B, 0x7FFC, 0x7FFC, 0x1929,
+ 0x8000, 0x8000, 0x1810, 0x8001, 0x8001, 0x11A7, 0x8003, 0x8003, 0x0EA7,
+ 0x8005, 0x8005, 0x1965, 0x8006, 0x8006, 0x100F, 0x8009, 0x8009, 0x0F59,
+ 0x800C, 0x800C, 0x191B, 0x8010, 0x8010, 0x103E, 0x8015, 0x8015, 0x0E6D,
+ 0x8017, 0x8017, 0x12AE, 0x8018, 0x8018, 0x1863, 0x802D, 0x802D, 0x1010,
+ 0x8033, 0x8033, 0x191C, 0x8036, 0x8036, 0x16EE, 0x803D, 0x803D, 0x1CFE,
+ 0x803F, 0x803F, 0x0E6E, 0x8043, 0x8043, 0x1083, 0x8046, 0x8046, 0x1193,
+ 0x804A, 0x804A, 0x11CF, 0x8056, 0x8056, 0x156F, 0x8058, 0x8058, 0x1477,
+ 0x805A, 0x805A, 0x1C9B, 0x805E, 0x805E, 0x12EC, 0x806F, 0x806F, 0x1178,
+ 0x8070, 0x8070, 0x1C5A, 0x8072, 0x8072, 0x1570, 0x8073, 0x8073, 0x182F,
+ 0x8077, 0x8077, 0x1B43, 0x807D, 0x807D, 0x1C20, 0x807E, 0x807E, 0x11BE,
+ 0x807F, 0x807F, 0x18E0, 0x8084, 0x8084, 0x191D, 0x8085, 0x8085, 0x1606,
+ 0x8086, 0x8086, 0x14A5, 0x8087, 0x8087, 0x1A9F, 0x8089, 0x8089, 0x18D5,
+ 0x808B, 0x808B, 0x11FD, 0x808C, 0x808C, 0x1011, 0x8096, 0x8096, 0x1C3F,
+ 0x809B, 0x809B, 0x1E02, 0x809D, 0x809D, 0x0DA7, 0x80A1, 0x80A1, 0x0EA8,
+ 0x80A2, 0x80A2, 0x1B35, 0x80A5, 0x80A5, 0x145A, 0x80A9, 0x80A9, 0x0E3B,
+ 0x80AA, 0x80AA, 0x135E, 0x80AF, 0x80AF, 0x0FDD, 0x80B1, 0x80B1, 0x0F1A,
+ 0x80B2, 0x80B2, 0x18D6, 0x80B4, 0x80B4, 0x1F1B, 0x80BA, 0x80BA, 0x1D74,
+ 0x80C3, 0x80C3, 0x189A, 0x80C4, 0x80C4, 0x1AD1, 0x80CC, 0x80CC, 0x1373,
+ 0x80CE, 0x80CE, 0x1D10, 0x80DA, 0x80DA, 0x1374, 0x80DB, 0x80DB, 0x0DCD,
+ 0x80DE, 0x80DE, 0x1D88, 0x80E1, 0x80E1, 0x1E95, 0x80E4, 0x80E4, 0x18DC,
+ 0x80E5, 0x80E5, 0x1512, 0x80F1, 0x80F1, 0x0F0A, 0x80F4, 0x80F4, 0x10F9,
+ 0x80F8, 0x80F8, 0x1F51, 0x80FD, 0x80FD, 0x1059, 0x8102, 0x8102, 0x1B36,
+ 0x8105, 0x8105, 0x1E56, 0x8106, 0x8106, 0x1C9C, 0x8107, 0x8107, 0x1E57,
+ 0x8108, 0x8108, 0x1272, 0x810A, 0x810A, 0x1BE8, 0x8118, 0x8118, 0x17E7,
+ 0x811A, 0x811A, 0x0D90, 0x811B, 0x811B, 0x0E6F, 0x8123, 0x8123, 0x1618,
+ 0x8129, 0x8129, 0x15E5, 0x812B, 0x812B, 0x1CFB, 0x812F, 0x812F, 0x1D89,
+ 0x8139, 0x8139, 0x1BC6, 0x813E, 0x813E, 0x145B, 0x814B, 0x814B, 0x16E0,
+ 0x814E, 0x814E, 0x1674, 0x8150, 0x8151, 0x140D, 0x8154, 0x8154, 0x0DE0,
+ 0x8155, 0x8155, 0x17E8, 0x8165, 0x8165, 0x1571, 0x8166, 0x8166, 0x1053,
+ 0x816B, 0x816B, 0x1AC1, 0x8170, 0x8170, 0x1811, 0x8171, 0x8171, 0x0E18,
+ 0x8178, 0x8178, 0x199D, 0x8179, 0x8179, 0x13DA, 0x817A, 0x817A, 0x153E,
+ 0x817F, 0x817F, 0x1D25, 0x8180, 0x8180, 0x135F, 0x8188, 0x8188, 0x0E32,
+ 0x818A, 0x818A, 0x1323, 0x818F, 0x818F, 0x0EA9, 0x819A, 0x819A, 0x140F,
+ 0x819C, 0x819C, 0x123B, 0x819D, 0x819D, 0x162B, 0x81A0, 0x81A0, 0x0F2C,
+ 0x81A3, 0x81A3, 0x1B71, 0x81A8, 0x81A8, 0x1D5C, 0x81B3, 0x81B3, 0x153F,
+ 0x81B5, 0x81B5, 0x1C91, 0x81BA, 0x81BA, 0x18F8, 0x81BD, 0x81BD, 0x1084,
+ 0x81BE, 0x81BE, 0x1F07, 0x81BF, 0x81BF, 0x1050, 0x81C0, 0x81C0, 0x1107,
+ 0x81C2, 0x81C2, 0x145C, 0x81C6, 0x81C6, 0x171C, 0x81CD, 0x81CD, 0x1A73,
+ 0x81D8, 0x81D8, 0x113A, 0x81DF, 0x81DF, 0x199E, 0x81E3, 0x81E3, 0x1675,
+ 0x81E5, 0x81E5, 0x17D7, 0x81E7, 0x81E7, 0x199F, 0x81E8, 0x81E8, 0x122A,
+ 0x81EA, 0x81EA, 0x1966, 0x81ED, 0x81ED, 0x1C9D, 0x81F3, 0x81F3, 0x1B37,
+ 0x81F4, 0x81F4, 0x1CBA, 0x81FA, 0x81FA, 0x10A5, 0x81FB, 0x81FB, 0x1B5B,
+ 0x81FC, 0x81FC, 0x0F5A, 0x81FE, 0x81FE, 0x18C5, 0x8205, 0x8205, 0x0F5B,
+ 0x8207, 0x8207, 0x1735, 0x8208, 0x8208, 0x1F62, 0x820A, 0x820A, 0x0F5C,
+ 0x820C, 0x820C, 0x1550, 0x820D, 0x820D, 0x14A6, 0x8212, 0x8212, 0x1513,
+ 0x821B, 0x821B, 0x1BF6, 0x821C, 0x821C, 0x1619, 0x821E, 0x821E, 0x12DB,
+ 0x821F, 0x821F, 0x1AE8, 0x8221, 0x8221, 0x0DE1, 0x822A, 0x822A, 0x1E03,
+ 0x822B, 0x822B, 0x1360, 0x822C, 0x822C, 0x133D, 0x8235, 0x8235, 0x1CDE,
+ 0x8236, 0x8236, 0x1324, 0x8237, 0x8237, 0x1E45, 0x8239, 0x8239, 0x1540,
+ 0x8240, 0x8240, 0x1410, 0x8245, 0x8245, 0x1736, 0x8247, 0x8247, 0x1A58,
+ 0x8259, 0x8259, 0x1BC7, 0x8264, 0x8264, 0x1906, 0x8266, 0x8266, 0x1DEB,
+ 0x826E, 0x826E, 0x0DA8, 0x826F, 0x826F, 0x1154, 0x8271, 0x8271, 0x0DA9,
+ 0x8272, 0x8272, 0x14F8, 0x8276, 0x8276, 0x176A, 0x8278, 0x8278, 0x1C40,
+ 0x827E, 0x827E, 0x16D8, 0x828B, 0x828B, 0x184B, 0x828D, 0x828D, 0x1976,
+ 0x828E, 0x828E, 0x0F7F, 0x8292, 0x8292, 0x125F, 0x8299, 0x8299, 0x1411,
+ 0x829A, 0x829A, 0x1108, 0x829D, 0x829D, 0x1B38, 0x829F, 0x829F, 0x14CC,
+ 0x82A5, 0x82A5, 0x0DF7, 0x82A6, 0x82A6, 0x1E96, 0x82A9, 0x82A9, 0x0FCE,
+ 0x82AC, 0x82AC, 0x1430, 0x82AD, 0x82AD, 0x1D3F, 0x82AE, 0x82AE, 0x1797,
+ 0x82AF, 0x82AF, 0x1689, 0x82B1, 0x82B1, 0x1EBF, 0x82B3, 0x82B3, 0x1361,
+ 0x82B7, 0x82B7, 0x1B39, 0x82B8, 0x82B8, 0x1864, 0x82B9, 0x82B9, 0x0FC0,
+ 0x82BB, 0x82BB, 0x1C6A, 0x82BC, 0x82BC, 0x12AF, 0x82BD, 0x82BD, 0x1697,
+ 0x82BF, 0x82BF, 0x1952, 0x82D1, 0x82D1, 0x1882, 0x82D2, 0x82D2, 0x176B,
+ 0x82D4, 0x82D4, 0x1D11, 0x82D5, 0x82D5, 0x1C41, 0x82D7, 0x82D7, 0x12CA,
+ 0x82DB, 0x82DB, 0x0D7F, 0x82DE, 0x82DE, 0x1D8A, 0x82DF, 0x82DF, 0x0F5D,
+ 0x82E1, 0x82E1, 0x191E, 0x82E5, 0x82E5, 0x16F2, 0x82E6, 0x82E6, 0x0EAA,
+ 0x82E7, 0x82E7, 0x19D0, 0x82F1, 0x82F1, 0x1788, 0x82FD, 0x82FD, 0x0EAB,
+ 0x82FE, 0x82FE, 0x1DBC, 0x8301, 0x8301, 0x1B09, 0x8302, 0x8302, 0x12DC,
+ 0x8303, 0x8303, 0x1399, 0x8304, 0x8304, 0x0D80, 0x8305, 0x8305, 0x12B0,
+ 0x8309, 0x8309, 0x1255, 0x8317, 0x8317, 0x1295, 0x8328, 0x8328, 0x1967,
+ 0x832B, 0x832B, 0x1260, 0x832F, 0x832F, 0x13DB, 0x8331, 0x8331, 0x15E6,
+ 0x8334, 0x8334, 0x1F08, 0x8335, 0x8335, 0x1937, 0x8336, 0x8336, 0x105F,
+ 0x8338, 0x8338, 0x1830, 0x8339, 0x8339, 0x1737, 0x8340, 0x8340, 0x161A,
+ 0x8347, 0x8347, 0x1E1C, 0x8349, 0x8349, 0x1C42, 0x834A, 0x834A, 0x1E68,
+ 0x834F, 0x834F, 0x194B, 0x8351, 0x8351, 0x191F, 0x8352, 0x8352, 0x1EF3,
+ 0x8373, 0x8373, 0x1102, 0x8377, 0x8377, 0x1DC8, 0x837B, 0x837B, 0x19E9,
+ 0x8389, 0x8389, 0x1217, 0x838A, 0x838A, 0x19A0, 0x838E, 0x838E, 0x14A7,
+ 0x8396, 0x8396, 0x0E70, 0x8398, 0x8398, 0x1676, 0x839E, 0x839E, 0x17E9,
+ 0x83A2, 0x83A2, 0x1E58, 0x83A9, 0x83A9, 0x1412, 0x83AA, 0x83AA, 0x1698,
+ 0x83AB, 0x83AB, 0x123C, 0x83BD, 0x83BD, 0x1261, 0x83C1, 0x83C1, 0x1C21,
+ 0x83C5, 0x83C5, 0x0EF6, 0x83C9, 0x83C9, 0x11B3, 0x83CA, 0x83CA, 0x0F6D,
+ 0x83CC, 0x83CC, 0x0FAD, 0x83D3, 0x83D3, 0x0EE0, 0x83D6, 0x83D6, 0x1BC8,
+ 0x83DC, 0x83DC, 0x1BD2, 0x83E9, 0x83E9, 0x13CD, 0x83EB, 0x83EB, 0x0FC1,
+ 0x83EF, 0x83EF, 0x1EC0, 0x83F0, 0x83F0, 0x0EAC, 0x83F1, 0x83F1, 0x1203,
+ 0x83F2, 0x83F2, 0x145D, 0x83F4, 0x83F4, 0x16C3, 0x83F9, 0x83F9, 0x19D1,
+ 0x83FD, 0x83FD, 0x1607, 0x8403, 0x8403, 0x1C92, 0x8404, 0x8404, 0x10C9,
+ 0x840A, 0x840A, 0x1147, 0x840C, 0x840C, 0x127C, 0x840D, 0x840D, 0x1D6C,
+ 0x840E, 0x840E, 0x189B, 0x8429, 0x8429, 0x1C6B, 0x842C, 0x842C, 0x124B,
+ 0x8431, 0x8431, 0x1F39, 0x8438, 0x8438, 0x18C6, 0x843D, 0x843D, 0x1122,
+ 0x8449, 0x8449, 0x1771, 0x8457, 0x8457, 0x19D2, 0x845B, 0x845B, 0x0DB2,
+ 0x8461, 0x8461, 0x1D8B, 0x8463, 0x8463, 0x10FA, 0x8466, 0x8466, 0x189C,
+ 0x846B, 0x846B, 0x1E97, 0x846C, 0x846C, 0x19A1, 0x846F, 0x846F, 0x16F3,
+ 0x8475, 0x8475, 0x0FA4, 0x847A, 0x847A, 0x1B12, 0x8490, 0x8490, 0x15E7,
+ 0x8494, 0x8494, 0x1650, 0x8499, 0x8499, 0x12BF, 0x849C, 0x849C, 0x14C0,
+ 0x84A1, 0x84A1, 0x1362, 0x84B2, 0x84B2, 0x1D8C, 0x84B8, 0x84B8, 0x1B1B,
+ 0x84BB, 0x84BB, 0x16F4, 0x84BC, 0x84BC, 0x1BC9, 0x84BF, 0x84BF, 0x1E98,
+ 0x84C0, 0x84C0, 0x15AD, 0x84C2, 0x84C2, 0x1296, 0x84C4, 0x84C4, 0x1C7F,
+ 0x84C6, 0x84C6, 0x1527, 0x84C9, 0x84C9, 0x1831, 0x84CB, 0x84CB, 0x0DF8,
+ 0x84CD, 0x84CD, 0x1651, 0x84D1, 0x84D1, 0x14A8, 0x84DA, 0x84DA, 0x15E8,
+ 0x84EC, 0x84EC, 0x13F0, 0x84EE, 0x84EE, 0x1179, 0x84F4, 0x84F4, 0x161B,
+ 0x84FC, 0x84FC, 0x11D0, 0x8511, 0x8511, 0x128B, 0x8513, 0x8513, 0x124C,
+ 0x8514, 0x8514, 0x13DC, 0x8517, 0x8517, 0x1968, 0x8518, 0x8518, 0x14CD,
+ 0x851A, 0x851A, 0x186A, 0x851E, 0x851E, 0x11DD, 0x8521, 0x8521, 0x1BD3,
+ 0x8523, 0x8523, 0x19A2, 0x8525, 0x8525, 0x1C5B, 0x852C, 0x852C, 0x1597,
+ 0x852D, 0x852D, 0x18EF, 0x852F, 0x852F, 0x1B5C, 0x853D, 0x853D, 0x1D75,
+ 0x853F, 0x853F, 0x189D, 0x8541, 0x8541, 0x1085, 0x8543, 0x8543, 0x138A,
+ 0x8549, 0x8549, 0x1C43, 0x854E, 0x854E, 0x0F2D, 0x8553, 0x8553, 0x1865,
+ 0x8559, 0x8559, 0x1E74, 0x8563, 0x8563, 0x161C, 0x8568, 0x8568, 0x0F8D,
+ 0x8569, 0x8569, 0x1D06, 0x856A, 0x856A, 0x12DD, 0x856D, 0x856D, 0x1598,
+ 0x8584, 0x8584, 0x1325, 0x8587, 0x8587, 0x1301, 0x858F, 0x858F, 0x1907,
+ 0x8591, 0x8591, 0x0DE2, 0x8594, 0x8594, 0x19A3, 0x859B, 0x859B, 0x1551,
+ 0x85A6, 0x85A6, 0x1BF7, 0x85A8, 0x85A8, 0x1F35, 0x85A9, 0x85A9, 0x14C7,
+ 0x85AA, 0x85AA, 0x1677, 0x85AF, 0x85AF, 0x1514, 0x85B0, 0x85B0, 0x1F32,
+ 0x85BA, 0x85BA, 0x1A74, 0x85C1, 0x85C1, 0x0EAD, 0x85C9, 0x85C9, 0x1969,
+ 0x85CD, 0x85CD, 0x1136, 0x85CE, 0x85CE, 0x1678, 0x85CF, 0x85CF, 0x19A4,
+ 0x85D5, 0x85D5, 0x184C, 0x85DC, 0x85DC, 0x1163, 0x85DD, 0x85DD, 0x1798,
+ 0x85E4, 0x85E4, 0x1112, 0x85E5, 0x85E5, 0x16F5, 0x85E9, 0x85E9, 0x138B,
+ 0x85EA, 0x85EA, 0x15E9, 0x85F7, 0x85F7, 0x19D3, 0x85FA, 0x85FA, 0x1222,
+ 0x85FB, 0x85FB, 0x1AA0, 0x85FF, 0x85FF, 0x0EE9, 0x8602, 0x8602, 0x1799,
+ 0x8606, 0x8606, 0x11A8, 0x8607, 0x8607, 0x1599, 0x860A, 0x860A, 0x17C8,
+ 0x8616, 0x8616, 0x1724, 0x8617, 0x8617, 0x13A4, 0x861A, 0x861A, 0x1541,
+ 0x862D, 0x862D, 0x112B, 0x863F, 0x863F, 0x111A, 0x864E, 0x864E, 0x1E99,
+ 0x8650, 0x8650, 0x1DD0, 0x8654, 0x8654, 0x0E19, 0x8655, 0x8655, 0x1BDD,
+ 0x865B, 0x865B, 0x1E29, 0x865C, 0x865C, 0x11A9, 0x865E, 0x865E, 0x184D,
+ 0x865F, 0x865F, 0x1E9A, 0x8667, 0x8667, 0x1F49, 0x8679, 0x8679, 0x1EB4,
+ 0x868A, 0x868A, 0x12ED, 0x868C, 0x868C, 0x1363, 0x8693, 0x8693, 0x1938,
+ 0x86A3, 0x86A3, 0x0ED7, 0x86A4, 0x86A4, 0x1AA1, 0x86A9, 0x86A9, 0x1CBB,
+ 0x86C7, 0x86C7, 0x14A9, 0x86CB, 0x86CB, 0x1070, 0x86D4, 0x86D4, 0x1F09,
+ 0x86D9, 0x86D9, 0x17D8, 0x86DB, 0x86DB, 0x1AE9, 0x86DF, 0x86DF, 0x0F2E,
+ 0x86E4, 0x86E4, 0x1DF2, 0x86ED, 0x86ED, 0x1B72, 0x86FE, 0x86FE, 0x1699,
+ 0x8700, 0x8700, 0x1C4D, 0x8702, 0x8702, 0x13F1, 0x8703, 0x8703, 0x1679,
+ 0x8708, 0x8708, 0x17BA, 0x8718, 0x8718, 0x1B3A, 0x871A, 0x871A, 0x145E,
+ 0x871C, 0x871C, 0x1314, 0x874E, 0x874E, 0x0DB4, 0x8755, 0x8755, 0x1662,
+ 0x8757, 0x8757, 0x1EF4, 0x875F, 0x875F, 0x189E, 0x8766, 0x8766, 0x1DC9,
+ 0x8768, 0x8768, 0x162C, 0x8774, 0x8774, 0x1E9B, 0x8776, 0x8776, 0x1A2F,
+ 0x8778, 0x8778, 0x17D9, 0x8782, 0x8782, 0x1142, 0x878D, 0x878D, 0x18E4,
+ 0x879F, 0x879F, 0x1297, 0x87A2, 0x87A2, 0x1E69, 0x87B3, 0x87B3, 0x1098,
+ 0x87BA, 0x87BA, 0x111B, 0x87C4, 0x87C4, 0x1CD0, 0x87E0, 0x87E0, 0x133E,
+ 0x87EC, 0x87EC, 0x1542, 0x87EF, 0x87EF, 0x1812, 0x87F2, 0x87F2, 0x1C8D,
+ 0x87F9, 0x87F9, 0x1E10, 0x87FB, 0x87FB, 0x1908, 0x87FE, 0x87FE, 0x155B,
+ 0x8805, 0x8805, 0x163A, 0x881F, 0x881F, 0x113B, 0x8822, 0x8822, 0x1B04,
+ 0x8823, 0x8823, 0x1164, 0x8831, 0x8831, 0x0EAE, 0x8836, 0x8836, 0x1984,
+ 0x883B, 0x883B, 0x124D, 0x8840, 0x8840, 0x1E4C, 0x8846, 0x8846, 0x1B0C,
+ 0x884C, 0x884C, 0x1E1D, 0x884D, 0x884D, 0x175D, 0x8852, 0x8852, 0x1E46,
+ 0x8853, 0x8853, 0x1624, 0x8857, 0x8857, 0x0D81, 0x8859, 0x8859, 0x169A,
+ 0x885B, 0x885B, 0x189F, 0x885D, 0x885D, 0x1C8E, 0x8861, 0x8861, 0x1E6A,
+ 0x8862, 0x8862, 0x0F5E, 0x8863, 0x8863, 0x1909, 0x8868, 0x8868, 0x1DA1,
+ 0x886B, 0x886B, 0x14CE, 0x8870, 0x8870, 0x15BD, 0x8872, 0x8872, 0x1037,
+ 0x8877, 0x8877, 0x1C8F, 0x887E, 0x887F, 0x0FCF, 0x8881, 0x8881, 0x1883,
+ 0x8882, 0x8882, 0x129B, 0x8888, 0x8888, 0x0D82, 0x888B, 0x888B, 0x10A6,
+ 0x888D, 0x888D, 0x1D8D, 0x8892, 0x8892, 0x1071, 0x8896, 0x8896, 0x15EA,
+ 0x8897, 0x8897, 0x1B5D, 0x889E, 0x889E, 0x0EC6, 0x88AB, 0x88AB, 0x1DB1,
+ 0x88B4, 0x88B4, 0x0EAF, 0x88C1, 0x88C1, 0x19B6, 0x88C2, 0x88C2, 0x1182,
+ 0x88CF, 0x88CF, 0x1218, 0x88D4, 0x88D4, 0x179A, 0x88D5, 0x88D5, 0x18C7,
+ 0x88D9, 0x88D9, 0x0F74, 0x88DC, 0x88DC, 0x13CE, 0x88DD, 0x88DD, 0x19A5,
+ 0x88DF, 0x88DF, 0x14AA, 0x88E1, 0x88E1, 0x1219, 0x88E8, 0x88E8, 0x145F,
+ 0x88F3, 0x88F3, 0x14EC, 0x88F4, 0x88F5, 0x1375, 0x88F8, 0x88F8, 0x111C,
+ 0x88FD, 0x88FD, 0x1A75, 0x8907, 0x8907, 0x13DD, 0x8910, 0x8910, 0x0DB3,
+ 0x8912, 0x8912, 0x1D8E, 0x8913, 0x8913, 0x13CF, 0x8918, 0x8918, 0x18A0,
+ 0x8919, 0x8919, 0x1377, 0x8925, 0x8925, 0x181C, 0x892A, 0x892A, 0x1D26,
+ 0x8936, 0x8936, 0x1630, 0x8938, 0x8938, 0x11DE, 0x893B, 0x893B, 0x1552,
+ 0x8941, 0x8941, 0x0DE3, 0x8944, 0x8944, 0x1709, 0x895F, 0x895F, 0x0FD1,
+ 0x8964, 0x8964, 0x1137, 0x896A, 0x896A, 0x1256, 0x8972, 0x8972, 0x1631,
+ 0x897F, 0x897F, 0x1515, 0x8981, 0x8981, 0x1813, 0x8983, 0x8983, 0x1086,
+ 0x8986, 0x8986, 0x13DE, 0x8987, 0x8987, 0x1D57, 0x898B, 0x898B, 0x0E3C,
+ 0x898F, 0x898F, 0x0FA5, 0x8993, 0x8993, 0x127E, 0x8996, 0x8996, 0x1652,
+ 0x89A1, 0x89A1, 0x0E33, 0x89A9, 0x89A9, 0x10CA, 0x89AA, 0x89AA, 0x1CC3,
+ 0x89B2, 0x89B2, 0x0FC2, 0x89BA, 0x89BA, 0x0D91, 0x89BD, 0x89BD, 0x1138,
+ 0x89C0, 0x89C0, 0x0EF7, 0x89D2, 0x89D2, 0x0D92, 0x89E3, 0x89E3, 0x1E11,
+ 0x89F4, 0x89F4, 0x14ED, 0x89F8, 0x89F8, 0x1C4E, 0x8A00, 0x8A00, 0x1721,
+ 0x8A02, 0x8A02, 0x1A59, 0x8A03, 0x8A03, 0x1413, 0x8A08, 0x8A08, 0x0E8C,
+ 0x8A0A, 0x8A0A, 0x167A, 0x8A0C, 0x8A0C, 0x1EB5, 0x8A0E, 0x8A0E, 0x1D1C,
+ 0x8A13, 0x8A13, 0x1F33, 0x8A16, 0x8A16, 0x1F5A, 0x8A17, 0x8A17, 0x1CEE,
+ 0x8A18, 0x8A18, 0x1012, 0x8A1B, 0x8A1B, 0x17DA, 0x8A1D, 0x8A1D, 0x169B,
+ 0x8A1F, 0x8A1F, 0x15B5, 0x8A23, 0x8A23, 0x0E45, 0x8A25, 0x8A25, 0x1056,
+ 0x8A2A, 0x8A2A, 0x1364, 0x8A2D, 0x8A2D, 0x1553, 0x8A31, 0x8A31, 0x1E2A,
+ 0x8A34, 0x8A34, 0x159A, 0x8A36, 0x8A36, 0x0D83, 0x8A3A, 0x8A3A, 0x1B5E,
+ 0x8A3B, 0x8A3B, 0x1AEA, 0x8A50, 0x8A50, 0x14AB, 0x8A54, 0x8A54, 0x1AA2,
+ 0x8A55, 0x8A55, 0x1D6D, 0x8A5B, 0x8A5B, 0x19D4, 0x8A5E, 0x8A5E, 0x14AC,
+ 0x8A60, 0x8A60, 0x1789, 0x8A62, 0x8A62, 0x161D, 0x8A63, 0x8A63, 0x179B,
+ 0x8A66, 0x8A66, 0x1653, 0x8A69, 0x8A69, 0x1654, 0x8A6D, 0x8A6D, 0x0F93,
+ 0x8A6E, 0x8A6E, 0x1A11, 0x8A70, 0x8A70, 0x1F77, 0x8A71, 0x8A71, 0x1EC1,
+ 0x8A72, 0x8A72, 0x1E12, 0x8A73, 0x8A73, 0x14EE, 0x8A75, 0x8A75, 0x1543,
+ 0x8A79, 0x8A79, 0x1C11, 0x8A85, 0x8A85, 0x1AEB, 0x8A87, 0x8A87, 0x0EE1,
+ 0x8A8C, 0x8A8C, 0x1B3B, 0x8A8D, 0x8A8D, 0x1939, 0x8A93, 0x8A93, 0x1516,
+ 0x8A95, 0x8A95, 0x1CF9, 0x8A98, 0x8A98, 0x18C8, 0x8A9E, 0x8A9E, 0x1714,
+ 0x8AA0, 0x8AA0, 0x1572, 0x8AA1, 0x8AA1, 0x0E8D, 0x8AA3, 0x8AA3, 0x12DE,
+ 0x8AA4, 0x8AA4, 0x17BB, 0x8AA5, 0x8AA5, 0x0EB0, 0x8AA6, 0x8AA6, 0x15B6,
+ 0x8AA8, 0x8AA8, 0x1F0A, 0x8AAA, 0x8AAA, 0x1554, 0x8AB0, 0x8AB0, 0x15EB,
+ 0x8AB2, 0x8AB2, 0x0EE2, 0x8AB9, 0x8AB9, 0x1460, 0x8ABC, 0x8ABC, 0x190A,
+ 0x8ABE, 0x8ABE, 0x18E9, 0x8ABF, 0x8ABF, 0x1AA3, 0x8AC2, 0x8AC2, 0x1C12,
+ 0x8AC4, 0x8AC4, 0x161E, 0x8AC7, 0x8AC7, 0x1087, 0x8ACB, 0x8ACB, 0x1C22,
+ 0x8ACD, 0x8ACD, 0x19BD, 0x8ACF, 0x8ACF, 0x1C6C, 0x8AD2, 0x8AD2, 0x1155,
+ 0x8AD6, 0x8AD6, 0x11B7, 0x8ADB, 0x8ADB, 0x18C9, 0x8ADC, 0x8ADC, 0x1C1A,
+ 0x8AE1, 0x8AE1, 0x1655, 0x8AE6, 0x8AE6, 0x1C2A, 0x8AE7, 0x8AE7, 0x1E13,
+ 0x8AEA, 0x8AEA, 0x1A5A, 0x8AEB, 0x8AEB, 0x0DAA, 0x8AED, 0x8AED, 0x18CA,
+ 0x8AEE, 0x8AEE, 0x196A, 0x8AF1, 0x8AF1, 0x1F42, 0x8AF6, 0x8AF6, 0x168A,
+ 0x8AF7, 0x8AF7, 0x1DA9, 0x8AF8, 0x8AF8, 0x1A76, 0x8AFA, 0x8AFA, 0x1722,
+ 0x8AFE, 0x8AFE, 0x102B, 0x8B00, 0x8B00, 0x12B1, 0x8B01, 0x8B01, 0x16BA,
+ 0x8B02, 0x8B02, 0x18A1, 0x8B04, 0x8B04, 0x1113, 0x8B0E, 0x8B0E, 0x1302,
+ 0x8B10, 0x8B10, 0x1315, 0x8B14, 0x8B14, 0x1DD1, 0x8B16, 0x8B16, 0x15A7,
+ 0x8B17, 0x8B17, 0x1365, 0x8B19, 0x8B19, 0x0E49, 0x8B1A, 0x8B1A, 0x192A,
+ 0x8B1B, 0x8B1B, 0x0DE4, 0x8B1D, 0x8B1D, 0x14AD, 0x8B20, 0x8B20, 0x1814,
+ 0x8B28, 0x8B28, 0x12B2, 0x8B2B, 0x8B2B, 0x19EA, 0x8B2C, 0x8B2C, 0x11ED,
+ 0x8B33, 0x8B33, 0x0F5F, 0x8B39, 0x8B39, 0x0FC3, 0x8B41, 0x8B41, 0x1EC2,
+ 0x8B49, 0x8B49, 0x1B1C, 0x8B4E, 0x8B4E, 0x1F4B, 0x8B4F, 0x8B4F, 0x1013,
+ 0x8B58, 0x8B58, 0x1663, 0x8B5A, 0x8B5A, 0x1088, 0x8B5C, 0x8B5C, 0x13D0,
+ 0x8B66, 0x8B66, 0x0E71, 0x8B6C, 0x8B6C, 0x1461, 0x8B6F, 0x8B6F, 0x1741,
+ 0x8B70, 0x8B70, 0x190B, 0x8B74, 0x8B74, 0x0E3D, 0x8B77, 0x8B77, 0x1E9C,
+ 0x8B7D, 0x8B7D, 0x179C, 0x8B80, 0x8B80, 0x10DE, 0x8B8A, 0x8B8A, 0x13A9,
+ 0x8B90, 0x8B90, 0x15EC, 0x8B92, 0x8B92, 0x1BB2, 0x8B93, 0x8B93, 0x170A,
+ 0x8B96, 0x8B96, 0x1BB3, 0x8B9A, 0x8B9A, 0x1BA0, 0x8C37, 0x8C37, 0x0EBC,
+ 0x8C3F, 0x8C3F, 0x0E8E, 0x8C41, 0x8C41, 0x1EDE, 0x8C46, 0x8C46, 0x1103,
+ 0x8C48, 0x8C48, 0x1014, 0x8C4A, 0x8C4A, 0x1DAA, 0x8C4C, 0x8C4C, 0x17EA,
+ 0x8C55, 0x8C55, 0x1656, 0x8C5A, 0x8C5A, 0x10E7, 0x8C61, 0x8C61, 0x14EF,
+ 0x8C6A, 0x8C6A, 0x1E9D, 0x8C6B, 0x8C6B, 0x179D, 0x8C79, 0x8C79, 0x1DA2,
+ 0x8C7A, 0x8C7A, 0x1657, 0x8C82, 0x8C82, 0x1C44, 0x8C8A, 0x8C8A, 0x1273,
+ 0x8C8C, 0x8C8C, 0x12B3, 0x8C9D, 0x8C9D, 0x1D58, 0x8C9E, 0x8C9E, 0x1A5B,
+ 0x8CA0, 0x8CA0, 0x1414, 0x8CA1, 0x8CA1, 0x19B7, 0x8CA2, 0x8CA2, 0x0ED8,
+ 0x8CA7, 0x8CA7, 0x1472, 0x8CA8, 0x8CA8, 0x1EC3, 0x8CA9, 0x8CA9, 0x1D47,
+ 0x8CAA, 0x8CAA, 0x1CFF, 0x8CAB, 0x8CAB, 0x0EF8, 0x8CAC, 0x8CAC, 0x1BD9,
+ 0x8CAF, 0x8CAF, 0x19D5, 0x8CB0, 0x8CB0, 0x157B, 0x8CB3, 0x8CB3, 0x1921,
+ 0x8CB4, 0x8CB4, 0x0F98, 0x8CB6, 0x8CB6, 0x1D68, 0x8CB7, 0x8CB7, 0x126E,
+ 0x8CB8, 0x8CB8, 0x10A7, 0x8CBB, 0x8CBB, 0x1462, 0x8CBC, 0x8CBC, 0x1C1B,
+ 0x8CBD, 0x8CBD, 0x1920, 0x8CBF, 0x8CBF, 0x12DF, 0x8CC0, 0x8CC0, 0x1DCA,
+ 0x8CC1, 0x8CC1, 0x1431, 0x8CC2, 0x8CC2, 0x11C3, 0x8CC3, 0x8CC3, 0x194C,
+ 0x8CC4, 0x8CC4, 0x1F0B, 0x8CC7, 0x8CC7, 0x196B, 0x8CC8, 0x8CC8, 0x0D84,
+ 0x8CCA, 0x8CCA, 0x19EB, 0x8CD1, 0x8CD1, 0x1B5F, 0x8CD3, 0x8CD3, 0x1473,
+ 0x8CDA, 0x8CDA, 0x11C4, 0x8CDC, 0x8CDC, 0x14AE, 0x8CDE, 0x8CDE, 0x14F0,
+ 0x8CE0, 0x8CE0, 0x1378, 0x8CE2, 0x8CE2, 0x1E47, 0x8CE3, 0x8CE3, 0x126F,
+ 0x8CE4, 0x8CE4, 0x1BF8, 0x8CE6, 0x8CE6, 0x1415, 0x8CEA, 0x8CEA, 0x1B73,
+ 0x8CED, 0x8CED, 0x10CB, 0x8CF4, 0x8CF4, 0x11C5, 0x8CFB, 0x8CFB, 0x1416,
+ 0x8CFC, 0x8CFC, 0x0F60, 0x8CFD, 0x8CFD, 0x14F4, 0x8D04, 0x8D04, 0x1B3C,
+ 0x8D05, 0x8D05, 0x1C93, 0x8D07, 0x8D07, 0x18DD, 0x8D08, 0x8D08, 0x1B1D,
+ 0x8D0A, 0x8D0A, 0x1BA1, 0x8D0D, 0x8D0D, 0x155C, 0x8D13, 0x8D13, 0x19A6,
+ 0x8D16, 0x8D16, 0x15A8, 0x8D64, 0x8D64, 0x19EC, 0x8D66, 0x8D66, 0x14AF,
+ 0x8D6B, 0x8D6B, 0x1E34, 0x8D70, 0x8D70, 0x1AEC, 0x8D73, 0x8D73, 0x0FA6,
+ 0x8D74, 0x8D74, 0x1417, 0x8D77, 0x8D77, 0x1015, 0x8D85, 0x8D85, 0x1C45,
+ 0x8D8A, 0x8D8A, 0x188A, 0x8D99, 0x8D99, 0x1AA4, 0x8DA3, 0x8DA3, 0x1C9E,
+ 0x8DA8, 0x8DA8, 0x1C6D, 0x8DB3, 0x8DB3, 0x1AAE, 0x8DBA, 0x8DBA, 0x1418,
+ 0x8DBE, 0x8DBE, 0x1B3D, 0x8DC6, 0x8DC6, 0x1D12, 0x8DCB, 0x8DCB, 0x1348,
+ 0x8DCC, 0x8DCC, 0x1B74, 0x8DCF, 0x8DCF, 0x0D85, 0x8DDB, 0x8DDB, 0x1D40,
+ 0x8DDD, 0x8DDD, 0x0E0C, 0x8DE1, 0x8DE1, 0x19ED, 0x8DE3, 0x8DE3, 0x1544,
+ 0x8DE8, 0x8DE8, 0x0EE3, 0x8DEF, 0x8DEF, 0x11AA, 0x8DF3, 0x8DF3, 0x10CC,
+ 0x8E0A, 0x8E0A, 0x1832, 0x8E0F, 0x8E0F, 0x108D, 0x8E10, 0x8E10, 0x1BF9,
+ 0x8E1E, 0x8E1E, 0x0E0D, 0x8E2A, 0x8E2A, 0x1AC2, 0x8E30, 0x8E30, 0x18CB,
+ 0x8E35, 0x8E35, 0x1AC3, 0x8E42, 0x8E42, 0x18CC, 0x8E44, 0x8E44, 0x1A77,
+ 0x8E47, 0x8E47, 0x0E1A, 0x8E48, 0x8E48, 0x10CD, 0x8E49, 0x8E49, 0x1B8C,
+ 0x8E4A, 0x8E4A, 0x1E75, 0x8E59, 0x8E59, 0x1C80, 0x8E5F, 0x8E5F, 0x19EE,
+ 0x8E60, 0x8E60, 0x1BE9, 0x8E74, 0x8E74, 0x1C81, 0x8E76, 0x8E76, 0x0F8E,
+ 0x8E81, 0x8E81, 0x1AA5, 0x8E87, 0x8E87, 0x19D6, 0x8E8A, 0x8E8A, 0x1AED,
+ 0x8E8D, 0x8E8D, 0x16F6, 0x8EAA, 0x8EAA, 0x1223, 0x8EAB, 0x8EAB, 0x167B,
+ 0x8EAC, 0x8EAC, 0x0F80, 0x8EC0, 0x8EC0, 0x0F61, 0x8ECA, 0x8ECA, 0x1B8D,
+ 0x8ECB, 0x8ECB, 0x16BB, 0x8ECC, 0x8ECC, 0x0F94, 0x8ECD, 0x8ECD, 0x0F75,
+ 0x8ED2, 0x8ED2, 0x1E2E, 0x8EDF, 0x8EDF, 0x175E, 0x8EEB, 0x8EEB, 0x1B60,
+ 0x8EF8, 0x8EF8, 0x1C82, 0x8EFB, 0x8EFB, 0x0D86, 0x8EFE, 0x8EFE, 0x1664,
+ 0x8F03, 0x8F03, 0x0F2F, 0x8F05, 0x8F05, 0x11AB, 0x8F09, 0x8F09, 0x19B8,
+ 0x8F12, 0x8F12, 0x1C1C, 0x8F13, 0x8F13, 0x124E, 0x8F14, 0x8F14, 0x13D1,
+ 0x8F15, 0x8F15, 0x0E72, 0x8F1B, 0x8F1B, 0x1156, 0x8F1C, 0x8F1C, 0x1CBC,
+ 0x8F1D, 0x8F1D, 0x1F43, 0x8F1E, 0x8F1E, 0x1262, 0x8F1F, 0x8F1F, 0x1C06,
+ 0x8F26, 0x8F26, 0x117A, 0x8F27, 0x8F27, 0x13BF, 0x8F29, 0x8F29, 0x1379,
+ 0x8F2A, 0x8F2A, 0x11F7, 0x8F2F, 0x8F2F, 0x1B7B, 0x8F33, 0x8F33, 0x1AEE,
+ 0x8F38, 0x8F38, 0x15ED, 0x8F39, 0x8F39, 0x13DF, 0x8F3B, 0x8F3B, 0x13E0,
+ 0x8F3E, 0x8F3E, 0x1A12, 0x8F3F, 0x8F3F, 0x1738, 0x8F44, 0x8F44, 0x1DE2,
+ 0x8F45, 0x8F45, 0x1884, 0x8F49, 0x8F49, 0x1A13, 0x8F4D, 0x8F4D, 0x1C07,
+ 0x8F4E, 0x8F4E, 0x0F30, 0x8F5D, 0x8F5D, 0x1739, 0x8F5F, 0x8F5F, 0x0F1B,
+ 0x8F62, 0x8F62, 0x116F, 0x8F9B, 0x8F9B, 0x167C, 0x8F9C, 0x8F9C, 0x0EB1,
+ 0x8FA3, 0x8FA3, 0x112E, 0x8FA6, 0x8FA6, 0x1D48, 0x8FA8, 0x8FA8, 0x13AA,
+ 0x8FAD, 0x8FAD, 0x14B0, 0x8FAF, 0x8FAF, 0x13AB, 0x8FB0, 0x8FB0, 0x1B61,
+ 0x8FB1, 0x8FB1, 0x181D, 0x8FB2, 0x8FB2, 0x1051, 0x8FC2, 0x8FC2, 0x184E,
+ 0x8FC5, 0x8FC5, 0x167D, 0x8FCE, 0x8FCE, 0x178A, 0x8FD1, 0x8FD1, 0x0FC4,
+ 0x8FD4, 0x8FD4, 0x133F, 0x8FE6, 0x8FE6, 0x0D87, 0x8FEA, 0x8FEA, 0x19EF,
+ 0x8FEB, 0x8FEB, 0x1326, 0x8FED, 0x8FED, 0x1B75, 0x8FF0, 0x8FF0, 0x1625,
+ 0x8FF2, 0x8FF2, 0x0E2A, 0x8FF7, 0x8FF7, 0x1303, 0x8FF9, 0x8FF9, 0x19F0,
+ 0x8FFD, 0x8FFD, 0x1C6E, 0x9000, 0x9000, 0x1D27, 0x9001, 0x9001, 0x15B7,
+ 0x9002, 0x9002, 0x0EFE, 0x9003, 0x9003, 0x10CE, 0x9005, 0x9005, 0x1F2A,
+ 0x9006, 0x9006, 0x1742, 0x9008, 0x9008, 0x1E6B, 0x900B, 0x900B, 0x1D8F,
+ 0x900D, 0x900D, 0x159B, 0x900F, 0x900F, 0x1D2D, 0x9010, 0x9010, 0x1C83,
+ 0x9011, 0x9011, 0x0F62, 0x9014, 0x9014, 0x10CF, 0x9015, 0x9015, 0x0E73,
+ 0x9017, 0x9017, 0x1104, 0x9019, 0x9019, 0x19D7, 0x901A, 0x901A, 0x1D22,
+ 0x901D, 0x901D, 0x1517, 0x901E, 0x901E, 0x1194, 0x901F, 0x901F, 0x15A9,
+ 0x9020, 0x9020, 0x1AA6, 0x9021, 0x9021, 0x1B05, 0x9022, 0x9022, 0x13F2,
+ 0x9023, 0x9023, 0x117B, 0x902E, 0x902E, 0x1C2B, 0x9031, 0x9031, 0x1AEF,
+ 0x9032, 0x9032, 0x1B62, 0x9035, 0x9035, 0x0FA7, 0x9038, 0x9038, 0x1942,
+ 0x903C, 0x903C, 0x1DBF, 0x903E, 0x903E, 0x18CE, 0x9041, 0x9041, 0x1109,
+ 0x9042, 0x9042, 0x15EE, 0x9047, 0x9047, 0x184F, 0x904A, 0x904A, 0x18CD,
+ 0x904B, 0x904B, 0x1866, 0x904D, 0x904D, 0x1D65, 0x904E, 0x904E, 0x0EE4,
+ 0x9050, 0x9050, 0x1DCB, 0x9051, 0x9051, 0x1EF5, 0x9053, 0x9053, 0x10D0,
+ 0x9054, 0x9054, 0x1078, 0x9055, 0x9055, 0x18A2, 0x9059, 0x9059, 0x1815,
+ 0x905C, 0x905C, 0x15AE, 0x905D, 0x905D, 0x108E, 0x905E, 0x905E, 0x1C2C,
+ 0x9060, 0x9060, 0x1885, 0x9061, 0x9061, 0x159C, 0x9063, 0x9063, 0x0E3E,
+ 0x9069, 0x9069, 0x19F1, 0x906D, 0x906D, 0x1AA7, 0x906E, 0x906E, 0x1B8E,
+ 0x906F, 0x906F, 0x110A, 0x9072, 0x9072, 0x1B3E, 0x9075, 0x9075, 0x1B06,
+ 0x9077, 0x9077, 0x1BFA, 0x9078, 0x9078, 0x1545, 0x907A, 0x907A, 0x18CF,
+ 0x907C, 0x907C, 0x11D1, 0x907D, 0x907D, 0x0E0E, 0x907F, 0x907F, 0x1DB2,
+ 0x9080, 0x9080, 0x1816, 0x9081, 0x9081, 0x1270, 0x9082, 0x9082, 0x1E14,
+ 0x9083, 0x9083, 0x15EF, 0x9084, 0x9084, 0x1ED8, 0x9087, 0x9087, 0x1922,
+ 0x9088, 0x9088, 0x123D, 0x908A, 0x908A, 0x13AC, 0x908F, 0x908F, 0x111D,
+ 0x9091, 0x9091, 0x18F5, 0x9095, 0x9095, 0x17D0, 0x9099, 0x9099, 0x1263,
+ 0x90A2, 0x90A2, 0x1E6C, 0x90A3, 0x90A3, 0x102A, 0x90A6, 0x90A6, 0x1366,
+ 0x90A8, 0x90A8, 0x1C52, 0x90AA, 0x90AA, 0x14B1, 0x90AF, 0x90AF, 0x0DC6,
+ 0x90B0, 0x90B0, 0x1D13, 0x90B1, 0x90B1, 0x0F63, 0x90B5, 0x90B5, 0x159D,
+ 0x90B8, 0x90B8, 0x19D8, 0x90C1, 0x90C1, 0x185C, 0x90CA, 0x90CA, 0x0F31,
+ 0x90DE, 0x90DE, 0x1143, 0x90E1, 0x90E1, 0x0F76, 0x90E8, 0x90E8, 0x1419,
+ 0x90ED, 0x90ED, 0x0EEA, 0x90F5, 0x90F5, 0x1850, 0x90FD, 0x90FD, 0x10D1,
+ 0x9102, 0x9102, 0x16AA, 0x9112, 0x9112, 0x1C6F, 0x9115, 0x9115, 0x1E22,
+ 0x9119, 0x9119, 0x1463, 0x9127, 0x9127, 0x1114, 0x912D, 0x912D, 0x1A5C,
+ 0x9132, 0x9132, 0x1072, 0x9149, 0x9149, 0x18D0, 0x914A, 0x914A, 0x1A5D,
+ 0x914B, 0x914B, 0x1C70, 0x914C, 0x914C, 0x1977, 0x914D, 0x914D, 0x137A,
+ 0x914E, 0x914E, 0x1AF0, 0x9152, 0x9152, 0x1AF1, 0x9162, 0x9162, 0x1C46,
+ 0x9169, 0x9169, 0x1298, 0x916A, 0x916A, 0x1123, 0x916C, 0x916C, 0x15F0,
+ 0x9175, 0x9175, 0x1F1C, 0x9177, 0x9177, 0x1EA3, 0x9178, 0x9178, 0x14C1,
+ 0x9187, 0x9187, 0x161F, 0x9189, 0x9189, 0x1C9F, 0x918B, 0x918B, 0x1C47,
+ 0x918D, 0x918D, 0x1A78, 0x9192, 0x9192, 0x1573, 0x919C, 0x919C, 0x1C71,
+ 0x91AB, 0x91AB, 0x190C, 0x91AC, 0x91AC, 0x19A7, 0x91AE, 0x91AE, 0x1C48,
+ 0x91AF, 0x91AF, 0x1E76, 0x91B1, 0x91B1, 0x1349, 0x91B4, 0x91B4, 0x119D,
+ 0x91B5, 0x91B5, 0x0E00, 0x91C0, 0x91C0, 0x170B, 0x91C7, 0x91C7, 0x1BD4,
+ 0x91C9, 0x91C9, 0x18D1, 0x91CB, 0x91CB, 0x1528, 0x91CC, 0x91CC, 0x121A,
+ 0x91CD, 0x91CD, 0x1B0D, 0x91CE, 0x91CE, 0x16EF, 0x91CF, 0x91CF, 0x1157,
+ 0x91D0, 0x91D0, 0x121B, 0x91D1, 0x91D1, 0x1023, 0x91D7, 0x91D7, 0x15BE,
+ 0x91D8, 0x91D8, 0x1A5E, 0x91DC, 0x91DC, 0x141A, 0x91DD, 0x91DD, 0x1CCE,
+ 0x91E3, 0x91E3, 0x1AA8, 0x91E7, 0x91E7, 0x1BFB, 0x91EA, 0x91EA, 0x1851,
+ 0x91F5, 0x91F5, 0x1BD5, 0x920D, 0x920D, 0x110B, 0x9210, 0x9210, 0x0E26,
+ 0x9211, 0x9211, 0x1D49, 0x9212, 0x9212, 0x14D1, 0x9217, 0x9217, 0x18DE,
+ 0x921E, 0x921E, 0x0FAE, 0x9234, 0x9234, 0x1195, 0x923A, 0x923A, 0x17C2,
+ 0x923F, 0x923F, 0x1A14, 0x9240, 0x9240, 0x0DCE, 0x9245, 0x9245, 0x0E0F,
+ 0x9249, 0x9249, 0x1E48, 0x9257, 0x9257, 0x0E4A, 0x925B, 0x925B, 0x175F,
+ 0x925E, 0x925E, 0x188B, 0x9262, 0x9262, 0x134A, 0x9264, 0x9264, 0x0F64,
+ 0x9265, 0x9265, 0x1626, 0x9266, 0x9266, 0x1A5F, 0x9280, 0x9280, 0x18EA,
+ 0x9283, 0x9283, 0x1C5C, 0x9285, 0x9285, 0x10FB, 0x9291, 0x9291, 0x1546,
+ 0x9293, 0x9293, 0x1A15, 0x9296, 0x9296, 0x15F1, 0x9298, 0x9298, 0x1299,
+ 0x929C, 0x929C, 0x1DEC, 0x92B3, 0x92B3, 0x179E, 0x92B6, 0x92B6, 0x0F65,
+ 0x92B7, 0x92B7, 0x159E, 0x92B9, 0x92B9, 0x15F2, 0x92CC, 0x92CC, 0x1A60,
+ 0x92CF, 0x92CF, 0x1E59, 0x92D2, 0x92D2, 0x13F3, 0x92E4, 0x92E4, 0x1518,
+ 0x92EA, 0x92EA, 0x1D90, 0x92F8, 0x92F8, 0x0E10, 0x92FC, 0x92FC, 0x0DE5,
+ 0x9304, 0x9304, 0x11B4, 0x9310, 0x9310, 0x1C72, 0x9318, 0x9318, 0x1C73,
+ 0x931A, 0x931A, 0x19BE, 0x931E, 0x931E, 0x1620, 0x931F, 0x931F, 0x1089,
+ 0x9320, 0x9320, 0x1A61, 0x9321, 0x9321, 0x1016, 0x9322, 0x9322, 0x1A16,
+ 0x9324, 0x9324, 0x1017, 0x9326, 0x9326, 0x0FD2, 0x9328, 0x9328, 0x12CB,
+ 0x932B, 0x932B, 0x1529, 0x932E, 0x932E, 0x0EB2, 0x932F, 0x932F, 0x1B93,
+ 0x9348, 0x9348, 0x178B, 0x934A, 0x934A, 0x117C, 0x934B, 0x934B, 0x0EE5,
+ 0x934D, 0x934D, 0x10D2, 0x9354, 0x9354, 0x16AB, 0x935B, 0x935B, 0x1073,
+ 0x936E, 0x936E, 0x18D2, 0x9375, 0x9375, 0x0E1B, 0x937C, 0x937C, 0x1CCF,
+ 0x937E, 0x937E, 0x1AC4, 0x938C, 0x938C, 0x0E4B, 0x9394, 0x9394, 0x1833,
+ 0x9396, 0x9396, 0x15BC, 0x939A, 0x939A, 0x1C74, 0x93A3, 0x93A3, 0x1E6D,
+ 0x93A7, 0x93A7, 0x0DF9, 0x93AC, 0x93AC, 0x1E9E, 0x93AD, 0x93AD, 0x1B63,
+ 0x93B0, 0x93B0, 0x1943, 0x93C3, 0x93C3, 0x1AAF, 0x93D1, 0x93D1, 0x19F2,
+ 0x93DE, 0x93DE, 0x1834, 0x93E1, 0x93E1, 0x0E74, 0x93E4, 0x93E4, 0x11DF,
+ 0x93F6, 0x93F6, 0x1B7C, 0x9404, 0x9404, 0x1F10, 0x9418, 0x9418, 0x1AC5,
+ 0x9425, 0x9425, 0x1547, 0x942B, 0x942B, 0x1A17, 0x9435, 0x9435, 0x1C08,
+ 0x9438, 0x9438, 0x1CEF, 0x9444, 0x9444, 0x1AF2, 0x9451, 0x9452, 0x0DC7,
+ 0x945B, 0x945B, 0x0F0B, 0x947D, 0x947D, 0x1BA2, 0x947F, 0x947F, 0x1B94,
+ 0x9577, 0x9577, 0x19A8, 0x9580, 0x9580, 0x12EE, 0x9583, 0x9583, 0x155D,
+ 0x9589, 0x9589, 0x1D76, 0x958B, 0x958B, 0x0DFA, 0x958F, 0x958F, 0x18DF,
+ 0x9591, 0x9592, 0x1DDD, 0x9593, 0x9593, 0x0DAB, 0x9594, 0x9594, 0x1312,
+ 0x9598, 0x9598, 0x0DCF, 0x95A3, 0x95A3, 0x0D93, 0x95A4, 0x95A4, 0x1DF3,
+ 0x95A5, 0x95A5, 0x1390, 0x95A8, 0x95A8, 0x0FA8, 0x95AD, 0x95AD, 0x1165,
+ 0x95B1, 0x95B1, 0x1764, 0x95BB, 0x95BB, 0x176C, 0x95BC, 0x95BC, 0x16BC,
+ 0x95C7, 0x95C7, 0x16C4, 0x95CA, 0x95CA, 0x1EDF, 0x95D4, 0x95D4, 0x1DF4,
+ 0x95D5, 0x95D5, 0x0F8F, 0x95D6, 0x95D6, 0x1D31, 0x95DC, 0x95DC, 0x0EF9,
+ 0x95E1, 0x95E1, 0x1BFC, 0x95E2, 0x95E2, 0x13A5, 0x961C, 0x961C, 0x141B,
+ 0x9621, 0x9621, 0x1BFD, 0x962A, 0x962A, 0x1D4A, 0x962E, 0x962E, 0x17EB,
+ 0x9632, 0x9632, 0x1367, 0x963B, 0x963B, 0x1AA9, 0x963F, 0x963F, 0x169C,
+ 0x9640, 0x9640, 0x1CDF, 0x9642, 0x9642, 0x1DB3, 0x9644, 0x9644, 0x141C,
+ 0x964B, 0x964B, 0x11E0, 0x964C, 0x964C, 0x1274, 0x964D, 0x964D, 0x0DE6,
+ 0x9650, 0x9650, 0x1DDF, 0x965B, 0x965B, 0x1D77, 0x965C, 0x965C, 0x1DF5,
+ 0x965D, 0x965D, 0x155E, 0x965E, 0x965E, 0x163B, 0x965F, 0x965F, 0x1BEA,
+ 0x9662, 0x9662, 0x1886, 0x9663, 0x9663, 0x1B64, 0x9664, 0x9664, 0x1A79,
+ 0x966A, 0x966A, 0x137B, 0x9670, 0x9670, 0x18F0, 0x9673, 0x9673, 0x1B65,
+ 0x9675, 0x9675, 0x1204, 0x9676, 0x9676, 0x10D3, 0x9677, 0x9677, 0x1DED,
+ 0x9678, 0x9678, 0x11F1, 0x967D, 0x967D, 0x170C, 0x9685, 0x9685, 0x1852,
+ 0x9686, 0x9686, 0x11FB, 0x968A, 0x968A, 0x10A8, 0x968B, 0x968B, 0x15F3,
+ 0x968D, 0x968D, 0x1EF6, 0x968E, 0x968E, 0x0E8F, 0x9694, 0x9694, 0x0E34,
+ 0x9695, 0x9695, 0x1867, 0x9698, 0x9698, 0x16D9, 0x9699, 0x9699, 0x0FB6,
+ 0x969B, 0x969B, 0x1A7A, 0x969C, 0x969C, 0x19A9, 0x96A3, 0x96A3, 0x1224,
+ 0x96A7, 0x96A8, 0x15F4, 0x96AA, 0x96AA, 0x1E30, 0x96B1, 0x96B1, 0x18EB,
+ 0x96B7, 0x96B7, 0x119E, 0x96BB, 0x96BB, 0x1BEB, 0x96C0, 0x96C0, 0x1978,
+ 0x96C1, 0x96C1, 0x16B5, 0x96C4, 0x96C4, 0x186E, 0x96C5, 0x96C5, 0x169D,
+ 0x96C6, 0x96C6, 0x1B7D, 0x96C7, 0x96C7, 0x0EB3, 0x96C9, 0x96C9, 0x1CBD,
+ 0x96CB, 0x96CB, 0x1B07, 0x96CC, 0x96CC, 0x196C, 0x96CD, 0x96CD, 0x17D1,
+ 0x96CE, 0x96CE, 0x19D9, 0x96D5, 0x96D5, 0x1AAA, 0x96D6, 0x96D6, 0x15F6,
+ 0x96D9, 0x96D9, 0x168D, 0x96DB, 0x96DB, 0x1C75, 0x96DC, 0x96DC, 0x1985,
+ 0x96E2, 0x96E2, 0x121C, 0x96E3, 0x96E3, 0x102E, 0x96E8, 0x96E9, 0x1853,
+ 0x96EA, 0x96EA, 0x1555, 0x96EF, 0x96EF, 0x12EF, 0x96F0, 0x96F0, 0x1432,
+ 0x96F2, 0x96F2, 0x1868, 0x96F6, 0x96F6, 0x1196, 0x96F7, 0x96F7, 0x11C6,
+ 0x96F9, 0x96F9, 0x1327, 0x96FB, 0x96FB, 0x1A18, 0x9700, 0x9700, 0x15F7,
+ 0x9706, 0x9706, 0x1A62, 0x9707, 0x9707, 0x1B66, 0x9711, 0x9711, 0x1A2A,
+ 0x9713, 0x9713, 0x179F, 0x9716, 0x9716, 0x122B, 0x9719, 0x9719, 0x178C,
+ 0x971C, 0x971C, 0x14F1, 0x971E, 0x971E, 0x1DCC, 0x9727, 0x9727, 0x12E0,
+ 0x9730, 0x9730, 0x14C2, 0x9732, 0x9732, 0x11AC, 0x9739, 0x9739, 0x13A6,
+ 0x973D, 0x973D, 0x1A7B, 0x9742, 0x9742, 0x1170, 0x9744, 0x9744, 0x16DA,
+ 0x9748, 0x9748, 0x1197, 0x9751, 0x9751, 0x1C23, 0x9756, 0x9756, 0x1A63,
+ 0x975C, 0x975C, 0x1A64, 0x975E, 0x975E, 0x1464, 0x9761, 0x9761, 0x1304,
+ 0x9762, 0x9762, 0x1288, 0x9769, 0x9769, 0x1E35, 0x976D, 0x976D, 0x193A,
+ 0x9774, 0x9774, 0x1EC4, 0x9777, 0x9777, 0x193B, 0x977A, 0x977A, 0x1257,
+ 0x978B, 0x978B, 0x1E77, 0x978D, 0x978D, 0x16B6, 0x978F, 0x978F, 0x0ED9,
+ 0x97A0, 0x97A0, 0x0F6E, 0x97A8, 0x97A8, 0x0DB5, 0x97AB, 0x97AB, 0x0F6F,
+ 0x97AD, 0x97AD, 0x1D66, 0x97C6, 0x97C6, 0x1BFE, 0x97CB, 0x97CB, 0x18A3,
+ 0x97D3, 0x97D3, 0x1DE0, 0x97DC, 0x97DC, 0x10D4, 0x97F3, 0x97F3, 0x18F1,
+ 0x97F6, 0x97F6, 0x159F, 0x97FB, 0x97FB, 0x1869, 0x97FF, 0x97FF, 0x1E23,
+ 0x9800, 0x9800, 0x1E9F, 0x9801, 0x9801, 0x1E4D, 0x9802, 0x9802, 0x1A65,
+ 0x9803, 0x9803, 0x0E75, 0x9805, 0x9805, 0x1E04, 0x9806, 0x9806, 0x1621,
+ 0x9808, 0x9808, 0x15F8, 0x980A, 0x980A, 0x185D, 0x980C, 0x980C, 0x15B8,
+ 0x9810, 0x9810, 0x17A0, 0x9811, 0x9811, 0x17EC, 0x9812, 0x9812, 0x1340,
+ 0x9813, 0x9813, 0x10E8, 0x9817, 0x9817, 0x1D41, 0x9818, 0x9818, 0x1198,
+ 0x982D, 0x982D, 0x1105, 0x9830, 0x9830, 0x1E5A, 0x9838, 0x9838, 0x0E76,
+ 0x9839, 0x9839, 0x1D28, 0x983B, 0x983B, 0x1474, 0x9846, 0x9846, 0x0EE6,
+ 0x984C, 0x984C, 0x1A7C, 0x984D, 0x984D, 0x16E1, 0x984E, 0x984E, 0x16AC,
+ 0x9854, 0x9854, 0x16B7, 0x9858, 0x9858, 0x1887, 0x985A, 0x985A, 0x1A19,
+ 0x985E, 0x985E, 0x11EE, 0x9865, 0x9865, 0x1EA0, 0x9867, 0x9867, 0x0EB4,
+ 0x986B, 0x986B, 0x1A1A, 0x986F, 0x986F, 0x1E49, 0x98A8, 0x98A8, 0x1DAB,
+ 0x98AF, 0x98AF, 0x14D2, 0x98B1, 0x98B1, 0x1D14, 0x98C4, 0x98C4, 0x1DA4,
+ 0x98C7, 0x98C7, 0x1DA3, 0x98DB, 0x98DB, 0x1465, 0x98DC, 0x98DC, 0x138C,
+ 0x98DF, 0x98DF, 0x1665, 0x98E1, 0x98E1, 0x15AF, 0x98E2, 0x98E2, 0x1018,
+ 0x98ED, 0x98ED, 0x1CC2, 0x98EE, 0x98EE, 0x18F2, 0x98EF, 0x98EF, 0x1341,
+ 0x98F4, 0x98F4, 0x1923, 0x98FC, 0x98FC, 0x14B2, 0x98FD, 0x98FD, 0x1D91,
+ 0x98FE, 0x98FE, 0x1666, 0x9903, 0x9903, 0x0F32, 0x9909, 0x9909, 0x1E24,
+ 0x990A, 0x990A, 0x170D, 0x990C, 0x990C, 0x1924, 0x9910, 0x9910, 0x1BA3,
+ 0x9913, 0x9913, 0x169E, 0x9918, 0x9918, 0x173A, 0x991E, 0x991E, 0x1A1B,
+ 0x9920, 0x9920, 0x13C0, 0x9928, 0x9928, 0x0EFA, 0x9945, 0x9945, 0x124F,
+ 0x9949, 0x9949, 0x0FC5, 0x994B, 0x994B, 0x0F95, 0x994C, 0x994C, 0x1BA4,
+ 0x994D, 0x994D, 0x1548, 0x9951, 0x9951, 0x1019, 0x9952, 0x9952, 0x1817,
+ 0x9954, 0x9954, 0x17D2, 0x9957, 0x9957, 0x1E25, 0x9996, 0x9996, 0x15F9,
+ 0x9999, 0x9999, 0x1E26, 0x999D, 0x999D, 0x1DBD, 0x99A5, 0x99A5, 0x13E1,
+ 0x99A8, 0x99A8, 0x1E6E, 0x99AC, 0x99AC, 0x1235, 0x99AD, 0x99AD, 0x1715,
+ 0x99AE, 0x99AE, 0x1DAC, 0x99B1, 0x99B1, 0x1CE0, 0x99B3, 0x99B3, 0x1CBE,
+ 0x99B4, 0x99B4, 0x1622, 0x99B9, 0x99B9, 0x1944, 0x99C1, 0x99C1, 0x1328,
+ 0x99D0, 0x99D0, 0x1AF3, 0x99D1, 0x99D1, 0x104E, 0x99D2, 0x99D2, 0x0F66,
+ 0x99D5, 0x99D5, 0x0D88, 0x99D9, 0x99D9, 0x141D, 0x99DD, 0x99DD, 0x1CE1,
+ 0x99DF, 0x99DF, 0x14B3, 0x99ED, 0x99ED, 0x1E15, 0x99F1, 0x99F1, 0x1124,
+ 0x99FF, 0x99FF, 0x1B08, 0x9A01, 0x9A01, 0x1478, 0x9A08, 0x9A08, 0x13C1,
+ 0x9A0E, 0x9A0F, 0x101A, 0x9A19, 0x9A19, 0x1D67, 0x9A2B, 0x9A2B, 0x0E1C,
+ 0x9A30, 0x9A30, 0x1115, 0x9A36, 0x9A36, 0x1C76, 0x9A37, 0x9A37, 0x15A0,
+ 0x9A40, 0x9A40, 0x1275, 0x9A43, 0x9A43, 0x1DA5, 0x9A45, 0x9A45, 0x0F67,
+ 0x9A4D, 0x9A4D, 0x1F1D, 0x9A55, 0x9A55, 0x0F33, 0x9A57, 0x9A57, 0x1E31,
+ 0x9A5A, 0x9A5A, 0x0E77, 0x9A5B, 0x9A5B, 0x1743, 0x9A5F, 0x9A5F, 0x1CA0,
+ 0x9A62, 0x9A62, 0x1166, 0x9A65, 0x9A65, 0x101C, 0x9A69, 0x9A69, 0x1ED9,
+ 0x9A6A, 0x9A6A, 0x1167, 0x9AA8, 0x9AA8, 0x0EC9, 0x9AB8, 0x9AB8, 0x1E16,
+ 0x9AD3, 0x9AD3, 0x15FA, 0x9AD4, 0x9AD4, 0x1C2D, 0x9AD8, 0x9AD8, 0x0EB5,
+ 0x9AE5, 0x9AE5, 0x176D, 0x9AEE, 0x9AEE, 0x134B, 0x9B1A, 0x9B1A, 0x15FB,
+ 0x9B27, 0x9B27, 0x11D2, 0x9B2A, 0x9B2A, 0x1D2E, 0x9B31, 0x9B31, 0x186B,
+ 0x9B3C, 0x9B3C, 0x0F99, 0x9B41, 0x9B41, 0x0F17, 0x9B42, 0x9B42, 0x1EA9,
+ 0x9B43, 0x9B43, 0x134C, 0x9B44, 0x9B44, 0x1383, 0x9B45, 0x9B45, 0x1271,
+ 0x9B4F, 0x9B4F, 0x18A4, 0x9B54, 0x9B54, 0x1236, 0x9B5A, 0x9B5A, 0x1716,
+ 0x9B6F, 0x9B6F, 0x11AD, 0x9B8E, 0x9B8E, 0x1A2B, 0x9B91, 0x9B91, 0x1D92,
+ 0x9B9F, 0x9B9F, 0x16B8, 0x9BAB, 0x9BAB, 0x0F34, 0x9BAE, 0x9BAE, 0x1549,
+ 0x9BC9, 0x9BC9, 0x121D, 0x9BD6, 0x9BD6, 0x1C24, 0x9BE4, 0x9BE4, 0x0EC7,
+ 0x9BE8, 0x9BE8, 0x0E78, 0x9C0D, 0x9C0D, 0x1C77, 0x9C10, 0x9C10, 0x16AD,
+ 0x9C12, 0x9C12, 0x13E2, 0x9C15, 0x9C15, 0x1DCD, 0x9C25, 0x9C25, 0x1EDA,
+ 0x9C32, 0x9C32, 0x17BC, 0x9C3B, 0x9C3B, 0x1250, 0x9C47, 0x9C47, 0x0DE7,
+ 0x9C49, 0x9C49, 0x13AF, 0x9C57, 0x9C57, 0x1225, 0x9CE5, 0x9CE5, 0x1AAB,
+ 0x9CE7, 0x9CE7, 0x141E, 0x9CE9, 0x9CE9, 0x0F68, 0x9CF3, 0x9CF3, 0x13F4,
+ 0x9CF4, 0x9CF4, 0x129A, 0x9CF6, 0x9CF6, 0x1760, 0x9D09, 0x9D09, 0x169F,
+ 0x9D1B, 0x9D1B, 0x1888, 0x9D26, 0x9D26, 0x16CF, 0x9D28, 0x9D28, 0x16C8,
+ 0x9D3B, 0x9D3B, 0x1EB6, 0x9D51, 0x9D51, 0x0E3F, 0x9D5D, 0x9D5D, 0x16A0,
+ 0x9D60, 0x9D60, 0x0EBD, 0x9D61, 0x9D61, 0x12E1, 0x9D6C, 0x9D6C, 0x143C,
+ 0x9D72, 0x9D72, 0x1979, 0x9DA9, 0x9DA9, 0x12BA, 0x9DAF, 0x9DAF, 0x16E4,
+ 0x9DB4, 0x9DB4, 0x1DD2, 0x9DC4, 0x9DC4, 0x0E90, 0x9DD7, 0x9DD7, 0x0F69,
+ 0x9DF2, 0x9DF2, 0x1CA1, 0x9DF8, 0x9DF8, 0x1F4C, 0x9DF9, 0x9DF9, 0x18F9,
+ 0x9DFA, 0x9DFA, 0x11AE, 0x9E1A, 0x9E1A, 0x16E5, 0x9E1E, 0x9E1E, 0x112C,
+ 0x9E75, 0x9E75, 0x11AF, 0x9E79, 0x9E79, 0x1DEE, 0x9E7D, 0x9E7D, 0x176E,
+ 0x9E7F, 0x9E7F, 0x11B5, 0x9E92, 0x9E92, 0x101D, 0x9E93, 0x9E93, 0x11B6,
+ 0x9E97, 0x9E97, 0x1168, 0x9E9D, 0x9E9D, 0x14B4, 0x9E9F, 0x9E9F, 0x1226,
+ 0x9EA5, 0x9EA5, 0x1276, 0x9EB4, 0x9EB4, 0x0F70, 0x9EB5, 0x9EB5, 0x1289,
+ 0x9EBB, 0x9EBB, 0x1237, 0x9EBE, 0x9EBE, 0x1F44, 0x9EC3, 0x9EC3, 0x1EF7,
+ 0x9ECD, 0x9ECD, 0x1519, 0x9ECE, 0x9ECE, 0x1169, 0x9ED1, 0x9ED1, 0x1F52,
+ 0x9ED4, 0x9ED4, 0x0E27, 0x9ED8, 0x9ED8, 0x12E3, 0x9EDB, 0x9EDB, 0x10A9,
+ 0x9EDC, 0x9EDC, 0x1C89, 0x9EDE, 0x9EDE, 0x1A2C, 0x9EE8, 0x9EE8, 0x1099,
+ 0x9EF4, 0x9EF4, 0x1305, 0x9F07, 0x9F07, 0x17BD, 0x9F08, 0x9F08, 0x13B0,
+ 0x9F0E, 0x9F0E, 0x1A66, 0x9F13, 0x9F13, 0x0EB6, 0x9F20, 0x9F20, 0x151A,
+ 0x9F3B, 0x9F3B, 0x1466, 0x9F4A, 0x9F4A, 0x1A7D, 0x9F4B, 0x9F4B, 0x19B9,
+ 0x9F4E, 0x9F4E, 0x19BA, 0x9F52, 0x9F52, 0x1CBF, 0x9F5F, 0x9F5F, 0x19DA,
+ 0x9F61, 0x9F61, 0x1199, 0x9F67, 0x9F67, 0x1556, 0x9F6A, 0x9F6A, 0x1B95,
+ 0x9F6C, 0x9F6C, 0x1717, 0x9F77, 0x9F77, 0x16AE, 0x9F8D, 0x9F8D, 0x11D3,
+ 0x9F90, 0x9F90, 0x1368, 0x9F95, 0x9F95, 0x0DC9, 0x9F9C, 0x9F9C, 0x0F6A,
+ 0xAC00, 0xAC01, 0x043E, 0xAC02, 0xAC03, 0x2475, 0xAC04, 0xAC04, 0x0440,
+ 0xAC05, 0xAC06, 0x2477, 0xAC07, 0xAC0A, 0x0441, 0xAC0B, 0xAC0F, 0x2479,
+ 0xAC10, 0xAC17, 0x0445, 0xAC18, 0xAC18, 0x247E, 0xAC19, 0xAC1D, 0x044D,
+ 0xAC1E, 0xAC1F, 0x247F, 0xAC20, 0xAC20, 0x0452, 0xAC21, 0xAC23, 0x2481,
+ 0xAC24, 0xAC24, 0x0453, 0xAC25, 0xAC2B, 0x2484, 0xAC2C, 0xAC2D, 0x0454,
+ 0xAC2E, 0xAC2E, 0x248B, 0xAC2F, 0xAC31, 0x0456, 0xAC32, 0xAC37, 0x248C,
+ 0xAC38, 0xAC39, 0x0459, 0xAC3A, 0xAC3B, 0x2492, 0xAC3C, 0xAC3C, 0x045B,
+ 0xAC3D, 0xAC3F, 0x2494, 0xAC40, 0xAC40, 0x045C, 0xAC41, 0xAC4A, 0x2497,
+ 0xAC4B, 0xAC4B, 0x045D, 0xAC4C, 0xAC4C, 0x24A1, 0xAC4D, 0xAC4D, 0x045E,
+ 0xAC4E, 0xAC53, 0x24A2, 0xAC54, 0xAC54, 0x045F, 0xAC55, 0xAC57, 0x24A8,
+ 0xAC58, 0xAC58, 0x0460, 0xAC59, 0xAC5B, 0x24AB, 0xAC5C, 0xAC5C, 0x0461,
+ 0xAC5D, 0xAC6F, 0x24AE, 0xAC70, 0xAC71, 0x0462, 0xAC72, 0xAC73, 0x24C1,
+ 0xAC74, 0xAC74, 0x0464, 0xAC75, 0xAC76, 0x24C3, 0xAC77, 0xAC78, 0x0465,
+ 0xAC79, 0xAC79, 0x24C5, 0xAC7A, 0xAC7A, 0x0467, 0xAC7B, 0xAC7F, 0x24C6,
+ 0xAC80, 0xAC81, 0x0468, 0xAC82, 0xAC82, 0x24CB, 0xAC83, 0xAC86, 0x046A,
+ 0xAC87, 0xAC88, 0x24CC, 0xAC89, 0xAC8C, 0x046E, 0xAC8D, 0xAC8F, 0x24CE,
+ 0xAC90, 0xAC90, 0x0472, 0xAC91, 0xAC93, 0x24D1, 0xAC94, 0xAC94, 0x0473,
+ 0xAC95, 0xAC9B, 0x24D4, 0xAC9C, 0xAC9D, 0x0474, 0xAC9E, 0xAC9E, 0x24DB,
+ 0xAC9F, 0xACA1, 0x0476, 0xACA2, 0xACA7, 0x24DC, 0xACA8, 0xACAA, 0x0479,
+ 0xACAB, 0xACAB, 0x24E2, 0xACAC, 0xACAC, 0x047C, 0xACAD, 0xACAE, 0x24E3,
+ 0xACAF, 0xACB0, 0x047D, 0xACB1, 0xACB7, 0x24E5, 0xACB8, 0xACB9, 0x047F,
+ 0xACBA, 0xACBA, 0x24EC, 0xACBB, 0xACBD, 0x0481, 0xACBE, 0xACC0, 0x24ED,
+ 0xACC1, 0xACC1, 0x0484, 0xACC2, 0xACC3, 0x24F0, 0xACC4, 0xACC4, 0x0485,
+ 0xACC5, 0xACC7, 0x24F2, 0xACC8, 0xACC8, 0x0486, 0xACC9, 0xACCB, 0x24F5,
+ 0xACCC, 0xACCC, 0x0487, 0xACCD, 0xACD4, 0x24F8, 0xACD5, 0xACD5, 0x0488,
+ 0xACD6, 0xACD6, 0x2500, 0xACD7, 0xACD7, 0x0489, 0xACD8, 0xACDF, 0x2501,
+ 0xACE0, 0xACE1, 0x048A, 0xACE2, 0xACE3, 0x2509, 0xACE4, 0xACE4, 0x048C,
+ 0xACE5, 0xACE6, 0x250B, 0xACE7, 0xACE8, 0x048D, 0xACE9, 0xACE9, 0x250D,
+ 0xACEA, 0xACEA, 0x048F, 0xACEB, 0xACEB, 0x250E, 0xACEC, 0xACEC, 0x0490,
+ 0xACED, 0xACEE, 0x250F, 0xACEF, 0xACF1, 0x0491, 0xACF2, 0xACF2, 0x2511,
+ 0xACF3, 0xACF3, 0x0494, 0xACF4, 0xACF4, 0x2512, 0xACF5, 0xACF6, 0x0495,
+ 0xACF7, 0xACFB, 0x2513, 0xACFC, 0xACFD, 0x0497, 0xACFE, 0xACFF, 0x2518,
+ 0xAD00, 0xAD00, 0x0499, 0xAD01, 0xAD03, 0x251A, 0xAD04, 0xAD04, 0x049A,
+ 0xAD05, 0xAD05, 0x251D, 0xAD06, 0xAD06, 0x049B, 0xAD07, 0xAD0B, 0x251E,
+ 0xAD0C, 0xAD0D, 0x049C, 0xAD0E, 0xAD0E, 0x2523, 0xAD0F, 0xAD0F, 0x049E,
+ 0xAD10, 0xAD10, 0x2524, 0xAD11, 0xAD11, 0x049F, 0xAD12, 0xAD17, 0x2525,
+ 0xAD18, 0xAD18, 0x04A0, 0xAD19, 0xAD1B, 0x252B, 0xAD1C, 0xAD1C, 0x04A1,
+ 0xAD1D, 0xAD1F, 0x252E, 0xAD20, 0xAD20, 0x04A2, 0xAD21, 0xAD28, 0x2531,
+ 0xAD29, 0xAD29, 0x04A3, 0xAD2A, 0xAD2B, 0x2539, 0xAD2C, 0xAD2D, 0x04A4,
+ 0xAD2E, 0xAD33, 0x253B, 0xAD34, 0xAD35, 0x04A6, 0xAD36, 0xAD37, 0x2541,
+ 0xAD38, 0xAD38, 0x04A8, 0xAD39, 0xAD3B, 0x2543, 0xAD3C, 0xAD3C, 0x04A9,
+ 0xAD3D, 0xAD43, 0x2546, 0xAD44, 0xAD45, 0x04AA, 0xAD46, 0xAD46, 0x254D,
+ 0xAD47, 0xAD47, 0x04AC, 0xAD48, 0xAD48, 0x254E, 0xAD49, 0xAD49, 0x04AD,
+ 0xAD4A, 0xAD4F, 0x254F, 0xAD50, 0xAD50, 0x04AE, 0xAD51, 0xAD53, 0x2555,
+ 0xAD54, 0xAD54, 0x04AF, 0xAD55, 0xAD57, 0x2558, 0xAD58, 0xAD58, 0x04B0,
+ 0xAD59, 0xAD60, 0x255B, 0xAD61, 0xAD61, 0x04B1, 0xAD62, 0xAD62, 0x2563,
+ 0xAD63, 0xAD63, 0x04B2, 0xAD64, 0xAD6B, 0x2564, 0xAD6C, 0xAD6D, 0x04B3,
+ 0xAD6E, 0xAD6F, 0x256C, 0xAD70, 0xAD70, 0x04B5, 0xAD71, 0xAD72, 0x256E,
+ 0xAD73, 0xAD76, 0x04B6, 0xAD77, 0xAD7A, 0x2570, 0xAD7B, 0xAD7D, 0x04BA,
+ 0xAD7E, 0xAD7E, 0x2574, 0xAD7F, 0xAD7F, 0x04BD, 0xAD80, 0xAD80, 0x2575,
+ 0xAD81, 0xAD82, 0x04BE, 0xAD83, 0xAD87, 0x2576, 0xAD88, 0xAD89, 0x04C0,
+ 0xAD8A, 0xAD8B, 0x257B, 0xAD8C, 0xAD8C, 0x04C2, 0xAD8D, 0xAD8F, 0x257D,
+ 0xAD90, 0xAD90, 0x04C3, 0xAD91, 0xAD9B, 0x2580, 0xAD9C, 0xAD9D, 0x04C4,
+ 0xAD9E, 0xADA3, 0x258B, 0xADA4, 0xADA4, 0x04C6, 0xADA5, 0xADB6, 0x2591,
+ 0xADB7, 0xADB7, 0x04C7, 0xADB8, 0xADBF, 0x25A3, 0xADC0, 0xADC1, 0x04C8,
+ 0xADC2, 0xADC3, 0x25AB, 0xADC4, 0xADC4, 0x04CA, 0xADC5, 0xADC7, 0x25AD,
+ 0xADC8, 0xADC8, 0x04CB, 0xADC9, 0xADCF, 0x25B0, 0xADD0, 0xADD1, 0x04CC,
+ 0xADD2, 0xADD2, 0x25B7, 0xADD3, 0xADD3, 0x04CE, 0xADD4, 0xADDB, 0x25B8,
+ 0xADDC, 0xADDC, 0x04CF, 0xADDD, 0xADDF, 0x25C0, 0xADE0, 0xADE0, 0x04D0,
+ 0xADE1, 0xADE3, 0x25C3, 0xADE4, 0xADE4, 0x04D1, 0xADE5, 0xADF7, 0x25C6,
+ 0xADF8, 0xADF9, 0x04D2, 0xADFA, 0xADFB, 0x25D9, 0xADFC, 0xADFC, 0x04D4,
+ 0xADFD, 0xADFE, 0x25DB, 0xADFF, 0xADFF, 0x04D5, 0xAE00, 0xAE01, 0x04D6,
+ 0xAE02, 0xAE07, 0x25DD, 0xAE08, 0xAE09, 0x04D8, 0xAE0A, 0xAE0A, 0x25E3,
+ 0xAE0B, 0xAE0B, 0x04DA, 0xAE0C, 0xAE0C, 0x25E4, 0xAE0D, 0xAE0D, 0x04DB,
+ 0xAE0E, 0xAE13, 0x25E5, 0xAE14, 0xAE14, 0x04DC, 0xAE15, 0xAE2F, 0x25EB,
+ 0xAE30, 0xAE31, 0x04DD, 0xAE32, 0xAE33, 0x2606, 0xAE34, 0xAE34, 0x04DF,
+ 0xAE35, 0xAE36, 0x2608, 0xAE37, 0xAE38, 0x04E0, 0xAE39, 0xAE39, 0x260A,
+ 0xAE3A, 0xAE3A, 0x04E2, 0xAE3B, 0xAE3F, 0x260B, 0xAE40, 0xAE41, 0x04E3,
+ 0xAE42, 0xAE42, 0x2610, 0xAE43, 0xAE43, 0x04E5, 0xAE44, 0xAE44, 0x2611,
+ 0xAE45, 0xAE46, 0x04E6, 0xAE47, 0xAE49, 0x2612, 0xAE4A, 0xAE4A, 0x04E8,
+ 0xAE4B, 0xAE4B, 0x2615, 0xAE4C, 0xAE4E, 0x04E9, 0xAE4F, 0xAE4F, 0x2616,
+ 0xAE50, 0xAE50, 0x04EC, 0xAE51, 0xAE53, 0x2617, 0xAE54, 0xAE54, 0x04ED,
+ 0xAE55, 0xAE55, 0x261A, 0xAE56, 0xAE56, 0x04EE, 0xAE57, 0xAE5B, 0x261B,
+ 0xAE5C, 0xAE5D, 0x04EF, 0xAE5E, 0xAE5E, 0x2620, 0xAE5F, 0xAE61, 0x04F1,
+ 0xAE62, 0xAE64, 0x2621, 0xAE65, 0xAE65, 0x04F4, 0xAE66, 0xAE67, 0x2624,
+ 0xAE68, 0xAE69, 0x04F5, 0xAE6A, 0xAE6B, 0x2626, 0xAE6C, 0xAE6C, 0x04F7,
+ 0xAE6D, 0xAE6F, 0x2628, 0xAE70, 0xAE70, 0x04F8, 0xAE71, 0xAE77, 0x262B,
+ 0xAE78, 0xAE79, 0x04F9, 0xAE7A, 0xAE7A, 0x2632, 0xAE7B, 0xAE7D, 0x04FB,
+ 0xAE7E, 0xAE83, 0x2633, 0xAE84, 0xAE85, 0x04FE, 0xAE86, 0xAE8B, 0x2639,
+ 0xAE8C, 0xAE8C, 0x0500, 0xAE8D, 0xAEBB, 0x263F, 0xAEBC, 0xAEBE, 0x0501,
+ 0xAEBF, 0xAEBF, 0x266E, 0xAEC0, 0xAEC0, 0x0504, 0xAEC1, 0xAEC3, 0x266F,
+ 0xAEC4, 0xAEC4, 0x0505, 0xAEC5, 0xAECB, 0x2672, 0xAECC, 0xAECD, 0x0506,
+ 0xAECE, 0xAECE, 0x2679, 0xAECF, 0xAED1, 0x0508, 0xAED2, 0xAED7, 0x267A,
+ 0xAED8, 0xAED9, 0x050B, 0xAEDA, 0xAEDB, 0x2680, 0xAEDC, 0xAEDC, 0x050D,
+ 0xAEDD, 0xAEE7, 0x2682, 0xAEE8, 0xAEE8, 0x050E, 0xAEE9, 0xAEEA, 0x268D,
+ 0xAEEB, 0xAEEB, 0x050F, 0xAEEC, 0xAEEC, 0x268F, 0xAEED, 0xAEED, 0x0510,
+ 0xAEEE, 0xAEF3, 0x2690, 0xAEF4, 0xAEF4, 0x0511, 0xAEF5, 0xAEF7, 0x2696,
+ 0xAEF8, 0xAEF8, 0x0512, 0xAEF9, 0xAEFB, 0x2699, 0xAEFC, 0xAEFC, 0x0513,
+ 0xAEFD, 0xAEFF, 0x269C, 0xAF00, 0xAF06, 0x269F, 0xAF07, 0xAF08, 0x0514,
+ 0xAF09, 0xAF0C, 0x26A6, 0xAF0D, 0xAF0D, 0x0516, 0xAF0E, 0xAF0F, 0x26AA,
+ 0xAF10, 0xAF10, 0x0517, 0xAF11, 0xAF2B, 0x26AC, 0xAF2C, 0xAF2D, 0x0518,
+ 0xAF2E, 0xAF2F, 0x26C7, 0xAF30, 0xAF30, 0x051A, 0xAF31, 0xAF31, 0x26C9,
+ 0xAF32, 0xAF32, 0x051B, 0xAF33, 0xAF33, 0x26CA, 0xAF34, 0xAF34, 0x051C,
+ 0xAF35, 0xAF3B, 0x26CB, 0xAF3C, 0xAF3D, 0x051D, 0xAF3E, 0xAF3E, 0x26D2,
+ 0xAF3F, 0xAF3F, 0x051F, 0xAF40, 0xAF40, 0x26D3, 0xAF41, 0xAF43, 0x0520,
+ 0xAF44, 0xAF47, 0x26D4, 0xAF48, 0xAF49, 0x0523, 0xAF4A, 0xAF4F, 0x26D8,
+ 0xAF50, 0xAF50, 0x0525, 0xAF51, 0xAF5B, 0x26DE, 0xAF5C, 0xAF5D, 0x0526,
+ 0xAF5E, 0xAF63, 0x26E9, 0xAF64, 0xAF65, 0x0528, 0xAF66, 0xAF78, 0x26EF,
+ 0xAF79, 0xAF79, 0x052A, 0xAF7A, 0xAF7F, 0x2702, 0xAF80, 0xAF80, 0x052B,
+ 0xAF81, 0xAF83, 0x2708, 0xAF84, 0xAF84, 0x052C, 0xAF85, 0xAF87, 0x270B,
+ 0xAF88, 0xAF88, 0x052D, 0xAF89, 0xAF8F, 0x270E, 0xAF90, 0xAF91, 0x052E,
+ 0xAF92, 0xAF94, 0x2715, 0xAF95, 0xAF95, 0x0530, 0xAF96, 0xAF9B, 0x2718,
+ 0xAF9C, 0xAF9C, 0x0531, 0xAF9D, 0xAFB7, 0x271E, 0xAFB8, 0xAFB9, 0x0532,
+ 0xAFBA, 0xAFBB, 0x2739, 0xAFBC, 0xAFBC, 0x0534, 0xAFBD, 0xAFBF, 0x273B,
+ 0xAFC0, 0xAFC0, 0x0535, 0xAFC1, 0xAFC6, 0x273E, 0xAFC7, 0xAFC9, 0x0536,
+ 0xAFCA, 0xAFCA, 0x2744, 0xAFCB, 0xAFCB, 0x0539, 0xAFCC, 0xAFCC, 0x2745,
+ 0xAFCD, 0xAFCE, 0x053A, 0xAFCF, 0xAFD3, 0x2746, 0xAFD4, 0xAFD4, 0x053C,
+ 0xAFD5, 0xAFDB, 0x274B, 0xAFDC, 0xAFDC, 0x053D, 0xAFDD, 0xAFE7, 0x2752,
+ 0xAFE8, 0xAFE9, 0x053E, 0xAFEA, 0xAFEF, 0x275D, 0xAFF0, 0xAFF1, 0x0540,
+ 0xAFF2, 0xAFF3, 0x2763, 0xAFF4, 0xAFF4, 0x0542, 0xAFF5, 0xAFF7, 0x2765,
+ 0xAFF8, 0xAFF8, 0x0543, 0xAFF9, 0xAFFF, 0x2768, 0xB000, 0xB001, 0x0544,
+ 0xB002, 0xB003, 0x276F, 0xB004, 0xB004, 0x0546, 0xB005, 0xB00B, 0x2771,
+ 0xB00C, 0xB00C, 0x0547, 0xB00D, 0xB00F, 0x2778, 0xB010, 0xB010, 0x0548,
+ 0xB011, 0xB013, 0x277B, 0xB014, 0xB014, 0x0549, 0xB015, 0xB01B, 0x277E,
+ 0xB01C, 0xB01D, 0x054A, 0xB01E, 0xB027, 0x2785, 0xB028, 0xB028, 0x054C,
+ 0xB029, 0xB043, 0x278F, 0xB044, 0xB045, 0x054D, 0xB046, 0xB047, 0x27AA,
+ 0xB048, 0xB048, 0x054F, 0xB049, 0xB049, 0x27AC, 0xB04A, 0xB04A, 0x0550,
+ 0xB04B, 0xB04B, 0x27AD, 0xB04C, 0xB04C, 0x0551, 0xB04D, 0xB04D, 0x27AE,
+ 0xB04E, 0xB04E, 0x0552, 0xB04F, 0xB052, 0x27AF, 0xB053, 0xB055, 0x0553,
+ 0xB056, 0xB056, 0x27B3, 0xB057, 0xB057, 0x0556, 0xB058, 0xB058, 0x27B4,
+ 0xB059, 0xB059, 0x0557, 0xB05A, 0xB05C, 0x27B5, 0xB05D, 0xB05D, 0x0558,
+ 0xB05E, 0xB07B, 0x27B8, 0xB07C, 0xB07D, 0x0559, 0xB07E, 0xB07F, 0x27D6,
+ 0xB080, 0xB080, 0x055B, 0xB081, 0xB083, 0x27D8, 0xB084, 0xB084, 0x055C,
+ 0xB085, 0xB08B, 0x27DB, 0xB08C, 0xB08D, 0x055D, 0xB08E, 0xB08E, 0x27E2,
+ 0xB08F, 0xB08F, 0x055F, 0xB090, 0xB090, 0x27E3, 0xB091, 0xB091, 0x0560,
+ 0xB092, 0xB097, 0x27E4, 0xB098, 0xB09A, 0x0561, 0xB09B, 0xB09B, 0x27EA,
+ 0xB09C, 0xB09C, 0x0564, 0xB09D, 0xB09E, 0x27EB, 0xB09F, 0xB0A2, 0x0565,
+ 0xB0A3, 0xB0A7, 0x27ED, 0xB0A8, 0xB0A9, 0x0569, 0xB0AA, 0xB0AA, 0x27F2,
+ 0xB0AB, 0xB0AF, 0x056B, 0xB0B0, 0xB0B0, 0x27F3, 0xB0B1, 0xB0B1, 0x0570,
+ 0xB0B2, 0xB0B2, 0x27F4, 0xB0B3, 0xB0B5, 0x0571, 0xB0B6, 0xB0B7, 0x27F5,
+ 0xB0B8, 0xB0B8, 0x0574, 0xB0B9, 0xB0BB, 0x27F7, 0xB0BC, 0xB0BC, 0x0575,
+ 0xB0BD, 0xB0C3, 0x27FA, 0xB0C4, 0xB0C5, 0x0576, 0xB0C6, 0xB0C6, 0x2801,
+ 0xB0C7, 0xB0C9, 0x0578, 0xB0CA, 0xB0CF, 0x2802, 0xB0D0, 0xB0D1, 0x057B,
+ 0xB0D2, 0xB0D3, 0x2808, 0xB0D4, 0xB0D4, 0x057D, 0xB0D5, 0xB0D7, 0x280A,
+ 0xB0D8, 0xB0D8, 0x057E, 0xB0D9, 0xB0DF, 0x280D, 0xB0E0, 0xB0E0, 0x057F,
+ 0xB0E1, 0xB0E4, 0x2814, 0xB0E5, 0xB0E5, 0x0580, 0xB0E6, 0xB0FF, 0x2818,
+ 0xB100, 0xB107, 0x2832, 0xB108, 0xB109, 0x0581, 0xB10A, 0xB10A, 0x283A,
+ 0xB10B, 0xB10C, 0x0583, 0xB10D, 0xB10F, 0x283B, 0xB110, 0xB110, 0x0585,
+ 0xB111, 0xB111, 0x283E, 0xB112, 0xB113, 0x0586, 0xB114, 0xB117, 0x283F,
+ 0xB118, 0xB119, 0x0588, 0xB11A, 0xB11A, 0x2843, 0xB11B, 0xB11D, 0x058A,
+ 0xB11E, 0xB122, 0x2844, 0xB123, 0xB125, 0x058D, 0xB126, 0xB127, 0x2849,
+ 0xB128, 0xB128, 0x0590, 0xB129, 0xB12B, 0x284B, 0xB12C, 0xB12C, 0x0591,
+ 0xB12D, 0xB133, 0x284E, 0xB134, 0xB135, 0x0592, 0xB136, 0xB136, 0x2855,
+ 0xB137, 0xB139, 0x0594, 0xB13A, 0xB13F, 0x2856, 0xB140, 0xB141, 0x0597,
+ 0xB142, 0xB143, 0x285C, 0xB144, 0xB144, 0x0599, 0xB145, 0xB147, 0x285E,
+ 0xB148, 0xB148, 0x059A, 0xB149, 0xB14F, 0x2861, 0xB150, 0xB151, 0x059B,
+ 0xB152, 0xB153, 0x2868, 0xB154, 0xB155, 0x059D, 0xB156, 0xB157, 0x286A,
+ 0xB158, 0xB158, 0x059F, 0xB159, 0xB15B, 0x286C, 0xB15C, 0xB15C, 0x05A0,
+ 0xB15D, 0xB15F, 0x286F, 0xB160, 0xB160, 0x05A1, 0xB161, 0xB177, 0x2872,
+ 0xB178, 0xB179, 0x05A2, 0xB17A, 0xB17B, 0x2889, 0xB17C, 0xB17C, 0x05A4,
+ 0xB17D, 0xB17F, 0x288B, 0xB180, 0xB180, 0x05A5, 0xB181, 0xB181, 0x288E,
+ 0xB182, 0xB182, 0x05A6, 0xB183, 0xB187, 0x288F, 0xB188, 0xB189, 0x05A7,
+ 0xB18A, 0xB18A, 0x2894, 0xB18B, 0xB18B, 0x05A9, 0xB18C, 0xB18C, 0x2895,
+ 0xB18D, 0xB18D, 0x05AA, 0xB18E, 0xB191, 0x2896, 0xB192, 0xB194, 0x05AB,
+ 0xB195, 0xB197, 0x289A, 0xB198, 0xB198, 0x05AE, 0xB199, 0xB19B, 0x289D,
+ 0xB19C, 0xB19C, 0x05AF, 0xB19D, 0xB1A7, 0x28A0, 0xB1A8, 0xB1A8, 0x05B0,
+ 0xB1A9, 0xB1CB, 0x28AB, 0xB1CC, 0xB1CC, 0x05B1, 0xB1CD, 0xB1CF, 0x28CE,
+ 0xB1D0, 0xB1D0, 0x05B2, 0xB1D1, 0xB1D3, 0x28D1, 0xB1D4, 0xB1D4, 0x05B3,
+ 0xB1D5, 0xB1DB, 0x28D4, 0xB1DC, 0xB1DD, 0x05B4, 0xB1DE, 0xB1DE, 0x28DB,
+ 0xB1DF, 0xB1DF, 0x05B6, 0xB1E0, 0xB1E7, 0x28DC, 0xB1E8, 0xB1E9, 0x05B7,
+ 0xB1EA, 0xB1EB, 0x28E4, 0xB1EC, 0xB1EC, 0x05B9, 0xB1ED, 0xB1EF, 0x28E6,
+ 0xB1F0, 0xB1F0, 0x05BA, 0xB1F1, 0xB1F8, 0x28E9, 0xB1F9, 0xB1F9, 0x05BB,
+ 0xB1FA, 0xB1FA, 0x28F1, 0xB1FB, 0xB1FB, 0x05BC, 0xB1FC, 0xB1FC, 0x28F2,
+ 0xB1FD, 0xB1FD, 0x05BD, 0xB1FE, 0xB1FF, 0x28F3, 0xB200, 0xB203, 0x28F5,
+ 0xB204, 0xB205, 0x05BE, 0xB206, 0xB207, 0x28F9, 0xB208, 0xB208, 0x05C0,
+ 0xB209, 0xB20A, 0x28FB, 0xB20B, 0xB20C, 0x05C1, 0xB20D, 0xB213, 0x28FD,
+ 0xB214, 0xB215, 0x05C3, 0xB216, 0xB216, 0x2904, 0xB217, 0xB217, 0x05C5,
+ 0xB218, 0xB218, 0x2905, 0xB219, 0xB219, 0x05C6, 0xB21A, 0xB21F, 0x2906,
+ 0xB220, 0xB220, 0x05C7, 0xB221, 0xB233, 0x290C, 0xB234, 0xB234, 0x05C8,
+ 0xB235, 0xB23B, 0x291F, 0xB23C, 0xB23C, 0x05C9, 0xB23D, 0xB257, 0x2926,
+ 0xB258, 0xB258, 0x05CA, 0xB259, 0xB25B, 0x2941, 0xB25C, 0xB25C, 0x05CB,
+ 0xB25D, 0xB25F, 0x2944, 0xB260, 0xB260, 0x05CC, 0xB261, 0xB267, 0x2947,
+ 0xB268, 0xB269, 0x05CD, 0xB26A, 0xB273, 0x294E, 0xB274, 0xB275, 0x05CF,
+ 0xB276, 0xB27B, 0x2958, 0xB27C, 0xB27C, 0x05D1, 0xB27D, 0xB283, 0x295E,
+ 0xB284, 0xB285, 0x05D2, 0xB286, 0xB288, 0x2965, 0xB289, 0xB289, 0x05D4,
+ 0xB28A, 0xB28F, 0x2968, 0xB290, 0xB291, 0x05D5, 0xB292, 0xB293, 0x296E,
+ 0xB294, 0xB294, 0x05D7, 0xB295, 0xB297, 0x2970, 0xB298, 0xB29A, 0x05D8,
+ 0xB29B, 0xB29F, 0x2973, 0xB2A0, 0xB2A1, 0x05DB, 0xB2A2, 0xB2A2, 0x2978,
+ 0xB2A3, 0xB2A3, 0x05DD, 0xB2A4, 0xB2A4, 0x2979, 0xB2A5, 0xB2A6, 0x05DE,
+ 0xB2A7, 0xB2A9, 0x297A, 0xB2AA, 0xB2AA, 0x05E0, 0xB2AB, 0xB2AB, 0x297D,
+ 0xB2AC, 0xB2AC, 0x05E1, 0xB2AD, 0xB2AF, 0x297E, 0xB2B0, 0xB2B0, 0x05E2,
+ 0xB2B1, 0xB2B3, 0x2981, 0xB2B4, 0xB2B4, 0x05E3, 0xB2B5, 0xB2C7, 0x2984,
+ 0xB2C8, 0xB2C9, 0x05E4, 0xB2CA, 0xB2CB, 0x2997, 0xB2CC, 0xB2CC, 0x05E6,
+ 0xB2CD, 0xB2CF, 0x2999, 0xB2D0, 0xB2D0, 0x05E7, 0xB2D1, 0xB2D1, 0x299C,
+ 0xB2D2, 0xB2D2, 0x05E8, 0xB2D3, 0xB2D7, 0x299D, 0xB2D8, 0xB2D9, 0x05E9,
+ 0xB2DA, 0xB2DA, 0x29A2, 0xB2DB, 0xB2DB, 0x05EB, 0xB2DC, 0xB2DC, 0x29A3,
+ 0xB2DD, 0xB2DD, 0x05EC, 0xB2DE, 0xB2E1, 0x29A4, 0xB2E2, 0xB2E2, 0x05ED,
+ 0xB2E3, 0xB2E3, 0x29A8, 0xB2E4, 0xB2E6, 0x05EE, 0xB2E7, 0xB2E7, 0x29A9,
+ 0xB2E8, 0xB2E8, 0x05F1, 0xB2E9, 0xB2EA, 0x29AA, 0xB2EB, 0xB2EF, 0x05F2,
+ 0xB2F0, 0xB2F2, 0x29AC, 0xB2F3, 0xB2F5, 0x05F7, 0xB2F6, 0xB2F6, 0x29AF,
+ 0xB2F7, 0xB2FB, 0x05FA, 0xB2FC, 0xB2FE, 0x29B0, 0xB2FF, 0xB2FF, 0x05FF,
+ 0xB300, 0xB301, 0x0600, 0xB302, 0xB303, 0x29B3, 0xB304, 0xB304, 0x0602,
+ 0xB305, 0xB307, 0x29B5, 0xB308, 0xB308, 0x0603, 0xB309, 0xB30F, 0x29B8,
+ 0xB310, 0xB311, 0x0604, 0xB312, 0xB312, 0x29BF, 0xB313, 0xB315, 0x0606,
+ 0xB316, 0xB31B, 0x29C0, 0xB31C, 0xB31C, 0x0609, 0xB31D, 0xB353, 0x29C6,
+ 0xB354, 0xB356, 0x060A, 0xB357, 0xB357, 0x29FD, 0xB358, 0xB358, 0x060D,
+ 0xB359, 0xB35A, 0x29FE, 0xB35B, 0xB35C, 0x060E, 0xB35D, 0xB35D, 0x2A00,
+ 0xB35E, 0xB35F, 0x0610, 0xB360, 0xB363, 0x2A01, 0xB364, 0xB365, 0x0612,
+ 0xB366, 0xB366, 0x2A05, 0xB367, 0xB367, 0x0614, 0xB368, 0xB368, 0x2A06,
+ 0xB369, 0xB369, 0x0615, 0xB36A, 0xB36A, 0x2A07, 0xB36B, 0xB36B, 0x0616,
+ 0xB36C, 0xB36D, 0x2A08, 0xB36E, 0xB36E, 0x0617, 0xB36F, 0xB36F, 0x2A0A,
+ 0xB370, 0xB371, 0x0618, 0xB372, 0xB373, 0x2A0B, 0xB374, 0xB374, 0x061A,
+ 0xB375, 0xB377, 0x2A0D, 0xB378, 0xB378, 0x061B, 0xB379, 0xB37F, 0x2A10,
+ 0xB380, 0xB381, 0x061C, 0xB382, 0xB382, 0x2A17, 0xB383, 0xB385, 0x061E,
+ 0xB386, 0xB38B, 0x2A18, 0xB38C, 0xB38C, 0x0621, 0xB38D, 0xB38F, 0x2A1E,
+ 0xB390, 0xB390, 0x0622, 0xB391, 0xB393, 0x2A21, 0xB394, 0xB394, 0x0623,
+ 0xB395, 0xB39F, 0x2A24, 0xB3A0, 0xB3A1, 0x0624, 0xB3A2, 0xB3A7, 0x2A2F,
+ 0xB3A8, 0xB3A8, 0x0626, 0xB3A9, 0xB3AB, 0x2A35, 0xB3AC, 0xB3AC, 0x0627,
+ 0xB3AD, 0xB3C3, 0x2A38, 0xB3C4, 0xB3C5, 0x0628, 0xB3C6, 0xB3C7, 0x2A4F,
+ 0xB3C8, 0xB3C8, 0x062A, 0xB3C9, 0xB3CA, 0x2A51, 0xB3CB, 0xB3CC, 0x062B,
+ 0xB3CD, 0xB3CD, 0x2A53, 0xB3CE, 0xB3CE, 0x062D, 0xB3CF, 0xB3CF, 0x2A54,
+ 0xB3D0, 0xB3D0, 0x062E, 0xB3D1, 0xB3D3, 0x2A55, 0xB3D4, 0xB3D5, 0x062F,
+ 0xB3D6, 0xB3D6, 0x2A58, 0xB3D7, 0xB3D7, 0x0631, 0xB3D8, 0xB3D8, 0x2A59,
+ 0xB3D9, 0xB3D9, 0x0632, 0xB3DA, 0xB3DA, 0x2A5A, 0xB3DB, 0xB3DB, 0x0633,
+ 0xB3DC, 0xB3DC, 0x2A5B, 0xB3DD, 0xB3DD, 0x0634, 0xB3DE, 0xB3DF, 0x2A5C,
+ 0xB3E0, 0xB3E0, 0x0635, 0xB3E1, 0xB3E3, 0x2A5E, 0xB3E4, 0xB3E4, 0x0636,
+ 0xB3E5, 0xB3E7, 0x2A61, 0xB3E8, 0xB3E8, 0x0637, 0xB3E9, 0xB3FB, 0x2A64,
+ 0xB3FC, 0xB3FC, 0x0638, 0xB3FD, 0xB3FF, 0x2A77, 0xB400, 0xB40F, 0x2A7A,
+ 0xB410, 0xB410, 0x0639, 0xB411, 0xB417, 0x2A8A, 0xB418, 0xB418, 0x063A,
+ 0xB419, 0xB41B, 0x2A91, 0xB41C, 0xB41C, 0x063B, 0xB41D, 0xB41F, 0x2A94,
+ 0xB420, 0xB420, 0x063C, 0xB421, 0xB427, 0x2A97, 0xB428, 0xB429, 0x063D,
+ 0xB42A, 0xB42A, 0x2A9E, 0xB42B, 0xB42B, 0x063F, 0xB42C, 0xB433, 0x2A9F,
+ 0xB434, 0xB434, 0x0640, 0xB435, 0xB44F, 0x2AA7, 0xB450, 0xB451, 0x0641,
+ 0xB452, 0xB453, 0x2AC2, 0xB454, 0xB454, 0x0643, 0xB455, 0xB457, 0x2AC4,
+ 0xB458, 0xB458, 0x0644, 0xB459, 0xB45F, 0x2AC7, 0xB460, 0xB461, 0x0645,
+ 0xB462, 0xB462, 0x2ACE, 0xB463, 0xB463, 0x0647, 0xB464, 0xB464, 0x2ACF,
+ 0xB465, 0xB465, 0x0648, 0xB466, 0xB46B, 0x2AD0, 0xB46C, 0xB46C, 0x0649,
+ 0xB46D, 0xB47F, 0x2AD6, 0xB480, 0xB480, 0x064A, 0xB481, 0xB487, 0x2AE9,
+ 0xB488, 0xB488, 0x064B, 0xB489, 0xB49C, 0x2AF0, 0xB49D, 0xB49D, 0x064C,
+ 0xB49E, 0xB4A3, 0x2B04, 0xB4A4, 0xB4A4, 0x064D, 0xB4A5, 0xB4A7, 0x2B0A,
+ 0xB4A8, 0xB4A8, 0x064E, 0xB4A9, 0xB4AB, 0x2B0D, 0xB4AC, 0xB4AC, 0x064F,
+ 0xB4AD, 0xB4B4, 0x2B10, 0xB4B5, 0xB4B5, 0x0650, 0xB4B6, 0xB4B6, 0x2B18,
+ 0xB4B7, 0xB4B7, 0x0651, 0xB4B8, 0xB4B8, 0x2B19, 0xB4B9, 0xB4B9, 0x0652,
+ 0xB4BA, 0xB4BF, 0x2B1A, 0xB4C0, 0xB4C0, 0x0653, 0xB4C1, 0xB4C3, 0x2B20,
+ 0xB4C4, 0xB4C4, 0x0654, 0xB4C5, 0xB4C7, 0x2B23, 0xB4C8, 0xB4C8, 0x0655,
+ 0xB4C9, 0xB4CF, 0x2B26, 0xB4D0, 0xB4D0, 0x0656, 0xB4D1, 0xB4D4, 0x2B2D,
+ 0xB4D5, 0xB4D5, 0x0657, 0xB4D6, 0xB4DB, 0x2B31, 0xB4DC, 0xB4DD, 0x0658,
+ 0xB4DE, 0xB4DF, 0x2B37, 0xB4E0, 0xB4E0, 0x065A, 0xB4E1, 0xB4E2, 0x2B39,
+ 0xB4E3, 0xB4E4, 0x065B, 0xB4E5, 0xB4E5, 0x2B3B, 0xB4E6, 0xB4E6, 0x065D,
+ 0xB4E7, 0xB4EB, 0x2B3C, 0xB4EC, 0xB4ED, 0x065E, 0xB4EE, 0xB4EE, 0x2B41,
+ 0xB4EF, 0xB4EF, 0x0660, 0xB4F0, 0xB4F0, 0x2B42, 0xB4F1, 0xB4F1, 0x0661,
+ 0xB4F2, 0xB4F7, 0x2B43, 0xB4F8, 0xB4F8, 0x0662, 0xB4F9, 0xB4FF, 0x2B49,
+ 0xB500, 0xB513, 0x2B50, 0xB514, 0xB515, 0x0663, 0xB516, 0xB517, 0x2B64,
+ 0xB518, 0xB518, 0x0665, 0xB519, 0xB51A, 0x2B66, 0xB51B, 0xB51C, 0x0666,
+ 0xB51D, 0xB523, 0x2B68, 0xB524, 0xB525, 0x0668, 0xB526, 0xB526, 0x2B6F,
+ 0xB527, 0xB52A, 0x066A, 0xB52B, 0xB52F, 0x2B70, 0xB530, 0xB531, 0x066E,
+ 0xB532, 0xB533, 0x2B75, 0xB534, 0xB534, 0x0670, 0xB535, 0xB537, 0x2B77,
+ 0xB538, 0xB538, 0x0671, 0xB539, 0xB53F, 0x2B7A, 0xB540, 0xB541, 0x0672,
+ 0xB542, 0xB542, 0x2B81, 0xB543, 0xB545, 0x0674, 0xB546, 0xB54A, 0x2B82,
+ 0xB54B, 0xB54D, 0x0677, 0xB54E, 0xB54F, 0x2B87, 0xB550, 0xB550, 0x067A,
+ 0xB551, 0xB553, 0x2B89, 0xB554, 0xB554, 0x067B, 0xB555, 0xB55B, 0x2B8C,
+ 0xB55C, 0xB55D, 0x067C, 0xB55E, 0xB55E, 0x2B93, 0xB55F, 0xB561, 0x067E,
+ 0xB562, 0xB59F, 0x2B94, 0xB5A0, 0xB5A1, 0x0681, 0xB5A2, 0xB5A3, 0x2BD2,
+ 0xB5A4, 0xB5A4, 0x0683, 0xB5A5, 0xB5A7, 0x2BD4, 0xB5A8, 0xB5A8, 0x0684,
+ 0xB5A9, 0xB5A9, 0x2BD7, 0xB5AA, 0xB5AB, 0x0685, 0xB5AC, 0xB5AF, 0x2BD8,
+ 0xB5B0, 0xB5B1, 0x0687, 0xB5B2, 0xB5B2, 0x2BDC, 0xB5B3, 0xB5B5, 0x0689,
+ 0xB5B6, 0xB5BA, 0x2BDD, 0xB5BB, 0xB5BD, 0x068C, 0xB5BE, 0xB5BF, 0x2BE2,
+ 0xB5C0, 0xB5C0, 0x068F, 0xB5C1, 0xB5C3, 0x2BE4, 0xB5C4, 0xB5C4, 0x0690,
+ 0xB5C5, 0xB5CB, 0x2BE7, 0xB5CC, 0xB5CD, 0x0691, 0xB5CE, 0xB5CE, 0x2BEE,
+ 0xB5CF, 0xB5D1, 0x0693, 0xB5D2, 0xB5D7, 0x2BEF, 0xB5D8, 0xB5D8, 0x0696,
+ 0xB5D9, 0xB5EB, 0x2BF5, 0xB5EC, 0xB5EC, 0x0697, 0xB5ED, 0xB5FF, 0x2C08,
+ 0xB600, 0xB60F, 0x2C1B, 0xB610, 0xB611, 0x0698, 0xB612, 0xB613, 0x2C2B,
+ 0xB614, 0xB614, 0x069A, 0xB615, 0xB617, 0x2C2D, 0xB618, 0xB618, 0x069B,
+ 0xB619, 0xB624, 0x2C30, 0xB625, 0xB625, 0x069C, 0xB626, 0xB62B, 0x2C3C,
+ 0xB62C, 0xB62C, 0x069D, 0xB62D, 0xB633, 0x2C42, 0xB634, 0xB634, 0x069E,
+ 0xB635, 0xB647, 0x2C49, 0xB648, 0xB648, 0x069F, 0xB649, 0xB663, 0x2C5C,
+ 0xB664, 0xB664, 0x06A0, 0xB665, 0xB667, 0x2C77, 0xB668, 0xB668, 0x06A1,
+ 0xB669, 0xB69B, 0x2C7A, 0xB69C, 0xB69D, 0x06A2, 0xB69E, 0xB69F, 0x2CAD,
+ 0xB6A0, 0xB6A0, 0x06A4, 0xB6A1, 0xB6A3, 0x2CAF, 0xB6A4, 0xB6A4, 0x06A5,
+ 0xB6A5, 0xB6AA, 0x2CB2, 0xB6AB, 0xB6AC, 0x06A6, 0xB6AD, 0xB6B0, 0x2CB8,
+ 0xB6B1, 0xB6B1, 0x06A8, 0xB6B2, 0xB6D3, 0x2CBC, 0xB6D4, 0xB6D4, 0x06A9,
+ 0xB6D5, 0xB6EF, 0x2CDE, 0xB6F0, 0xB6F0, 0x06AA, 0xB6F1, 0xB6F3, 0x2CF9,
+ 0xB6F4, 0xB6F4, 0x06AB, 0xB6F5, 0xB6F7, 0x2CFC, 0xB6F8, 0xB6F8, 0x06AC,
+ 0xB6F9, 0xB6FF, 0x2CFF, 0xB700, 0xB701, 0x06AD, 0xB702, 0xB704, 0x2D06,
+ 0xB705, 0xB705, 0x06AF, 0xB706, 0xB727, 0x2D09, 0xB728, 0xB729, 0x06B0,
+ 0xB72A, 0xB72B, 0x2D2B, 0xB72C, 0xB72C, 0x06B2, 0xB72D, 0xB72E, 0x2D2D,
+ 0xB72F, 0xB730, 0x06B3, 0xB731, 0xB737, 0x2D2F, 0xB738, 0xB739, 0x06B5,
+ 0xB73A, 0xB73A, 0x2D36, 0xB73B, 0xB73B, 0x06B7, 0xB73C, 0xB743, 0x2D37,
+ 0xB744, 0xB744, 0x06B8, 0xB745, 0xB747, 0x2D3F, 0xB748, 0xB748, 0x06B9,
+ 0xB749, 0xB74B, 0x2D42, 0xB74C, 0xB74C, 0x06BA, 0xB74D, 0xB753, 0x2D45,
+ 0xB754, 0xB755, 0x06BB, 0xB756, 0xB75F, 0x2D4C, 0xB760, 0xB760, 0x06BD,
+ 0xB761, 0xB763, 0x2D56, 0xB764, 0xB764, 0x06BE, 0xB765, 0xB767, 0x2D59,
+ 0xB768, 0xB768, 0x06BF, 0xB769, 0xB76F, 0x2D5C, 0xB770, 0xB771, 0x06C0,
+ 0xB772, 0xB772, 0x2D63, 0xB773, 0xB773, 0x06C2, 0xB774, 0xB774, 0x2D64,
+ 0xB775, 0xB775, 0x06C3, 0xB776, 0xB77B, 0x2D65, 0xB77C, 0xB77D, 0x06C4,
+ 0xB77E, 0xB77F, 0x2D6B, 0xB780, 0xB780, 0x06C6, 0xB781, 0xB783, 0x2D6D,
+ 0xB784, 0xB784, 0x06C7, 0xB785, 0xB78B, 0x2D70, 0xB78C, 0xB78D, 0x06C8,
+ 0xB78E, 0xB78E, 0x2D77, 0xB78F, 0xB792, 0x06CA, 0xB793, 0xB795, 0x2D78,
+ 0xB796, 0xB799, 0x06CE, 0xB79A, 0xB79B, 0x2D7B, 0xB79C, 0xB79C, 0x06D2,
+ 0xB79D, 0xB79F, 0x2D7D, 0xB7A0, 0xB7A0, 0x06D3, 0xB7A1, 0xB7A7, 0x2D80,
+ 0xB7A8, 0xB7A9, 0x06D4, 0xB7AA, 0xB7AA, 0x2D87, 0xB7AB, 0xB7AD, 0x06D6,
+ 0xB7AE, 0xB7B3, 0x2D88, 0xB7B4, 0xB7B5, 0x06D9, 0xB7B6, 0xB7B7, 0x2D8E,
+ 0xB7B8, 0xB7B8, 0x06DB, 0xB7B9, 0xB7C6, 0x2D90, 0xB7C7, 0xB7C7, 0x06DC,
+ 0xB7C8, 0xB7C8, 0x2D9E, 0xB7C9, 0xB7C9, 0x06DD, 0xB7CA, 0xB7EB, 0x2D9F,
+ 0xB7EC, 0xB7ED, 0x06DE, 0xB7EE, 0xB7EF, 0x2DC1, 0xB7F0, 0xB7F0, 0x06E0,
+ 0xB7F1, 0xB7F3, 0x2DC3, 0xB7F4, 0xB7F4, 0x06E1, 0xB7F5, 0xB7FB, 0x2DC6,
+ 0xB7FC, 0xB7FD, 0x06E2, 0xB7FE, 0xB7FE, 0x2DCD, 0xB7FF, 0xB7FF, 0x06E4,
+ 0xB800, 0xB801, 0x06E5, 0xB802, 0xB806, 0x2DCE, 0xB807, 0xB809, 0x06E7,
+ 0xB80A, 0xB80B, 0x2DD3, 0xB80C, 0xB80C, 0x06EA, 0xB80D, 0xB80F, 0x2DD5,
+ 0xB810, 0xB810, 0x06EB, 0xB811, 0xB817, 0x2DD8, 0xB818, 0xB819, 0x06EC,
+ 0xB81A, 0xB81A, 0x2DDF, 0xB81B, 0xB81B, 0x06EE, 0xB81C, 0xB81C, 0x2DE0,
+ 0xB81D, 0xB81D, 0x06EF, 0xB81E, 0xB823, 0x2DE1, 0xB824, 0xB825, 0x06F0,
+ 0xB826, 0xB827, 0x2DE7, 0xB828, 0xB828, 0x06F2, 0xB829, 0xB82B, 0x2DE9,
+ 0xB82C, 0xB82C, 0x06F3, 0xB82D, 0xB833, 0x2DEC, 0xB834, 0xB835, 0x06F4,
+ 0xB836, 0xB836, 0x2DF3, 0xB837, 0xB839, 0x06F6, 0xB83A, 0xB83F, 0x2DF4,
+ 0xB840, 0xB840, 0x06F9, 0xB841, 0xB843, 0x2DFA, 0xB844, 0xB844, 0x06FA,
+ 0xB845, 0xB850, 0x2DFD, 0xB851, 0xB851, 0x06FB, 0xB852, 0xB852, 0x2E09,
+ 0xB853, 0xB853, 0x06FC, 0xB854, 0xB85B, 0x2E0A, 0xB85C, 0xB85D, 0x06FD,
+ 0xB85E, 0xB85F, 0x2E12, 0xB860, 0xB860, 0x06FF, 0xB861, 0xB863, 0x2E14,
+ 0xB864, 0xB864, 0x0700, 0xB865, 0xB86B, 0x2E17, 0xB86C, 0xB86D, 0x0701,
+ 0xB86E, 0xB86E, 0x2E1E, 0xB86F, 0xB86F, 0x0703, 0xB870, 0xB870, 0x2E1F,
+ 0xB871, 0xB871, 0x0704, 0xB872, 0xB877, 0x2E20, 0xB878, 0xB878, 0x0705,
+ 0xB879, 0xB87B, 0x2E26, 0xB87C, 0xB87C, 0x0706, 0xB87D, 0xB88C, 0x2E29,
+ 0xB88D, 0xB88D, 0x0707, 0xB88E, 0xB8A7, 0x2E39, 0xB8A8, 0xB8A8, 0x0708,
+ 0xB8A9, 0xB8AF, 0x2E53, 0xB8B0, 0xB8B0, 0x0709, 0xB8B1, 0xB8B3, 0x2E5A,
+ 0xB8B4, 0xB8B4, 0x070A, 0xB8B5, 0xB8B7, 0x2E5D, 0xB8B8, 0xB8B8, 0x070B,
+ 0xB8B9, 0xB8BF, 0x2E60, 0xB8C0, 0xB8C1, 0x070C, 0xB8C2, 0xB8C2, 0x2E67,
+ 0xB8C3, 0xB8C3, 0x070E, 0xB8C4, 0xB8C4, 0x2E68, 0xB8C5, 0xB8C5, 0x070F,
+ 0xB8C6, 0xB8CB, 0x2E69, 0xB8CC, 0xB8CC, 0x0710, 0xB8CD, 0xB8CF, 0x2E6F,
+ 0xB8D0, 0xB8D0, 0x0711, 0xB8D1, 0xB8D3, 0x2E72, 0xB8D4, 0xB8D4, 0x0712,
+ 0xB8D5, 0xB8DC, 0x2E75, 0xB8DD, 0xB8DD, 0x0713, 0xB8DE, 0xB8DE, 0x2E7D,
+ 0xB8DF, 0xB8DF, 0x0714, 0xB8E0, 0xB8E0, 0x2E7E, 0xB8E1, 0xB8E1, 0x0715,
+ 0xB8E2, 0xB8E7, 0x2E7F, 0xB8E8, 0xB8E9, 0x0716, 0xB8EA, 0xB8EB, 0x2E85,
+ 0xB8EC, 0xB8EC, 0x0718, 0xB8ED, 0xB8EF, 0x2E87, 0xB8F0, 0xB8F0, 0x0719,
+ 0xB8F1, 0xB8F7, 0x2E8A, 0xB8F8, 0xB8F9, 0x071A, 0xB8FA, 0xB8FA, 0x2E91,
+ 0xB8FB, 0xB8FB, 0x071C, 0xB8FC, 0xB8FC, 0x2E92, 0xB8FD, 0xB8FD, 0x071D,
+ 0xB8FE, 0xB8FF, 0x2E93, 0xB900, 0xB903, 0x2E95, 0xB904, 0xB904, 0x071E,
+ 0xB905, 0xB917, 0x2E99, 0xB918, 0xB918, 0x071F, 0xB919, 0xB91F, 0x2EAC,
+ 0xB920, 0xB920, 0x0720, 0xB921, 0xB93B, 0x2EB3, 0xB93C, 0xB93D, 0x0721,
+ 0xB93E, 0xB93F, 0x2ECE, 0xB940, 0xB940, 0x0723, 0xB941, 0xB943, 0x2ED0,
+ 0xB944, 0xB944, 0x0724, 0xB945, 0xB94B, 0x2ED3, 0xB94C, 0xB94C, 0x0725,
+ 0xB94D, 0xB94E, 0x2EDA, 0xB94F, 0xB94F, 0x0726, 0xB950, 0xB950, 0x2EDC,
+ 0xB951, 0xB951, 0x0727, 0xB952, 0xB957, 0x2EDD, 0xB958, 0xB959, 0x0728,
+ 0xB95A, 0xB95B, 0x2EE3, 0xB95C, 0xB95C, 0x072A, 0xB95D, 0xB95F, 0x2EE5,
+ 0xB960, 0xB960, 0x072B, 0xB961, 0xB967, 0x2EE8, 0xB968, 0xB969, 0x072C,
+ 0xB96A, 0xB96A, 0x2EEF, 0xB96B, 0xB96B, 0x072E, 0xB96C, 0xB96C, 0x2EF0,
+ 0xB96D, 0xB96D, 0x072F, 0xB96E, 0xB973, 0x2EF1, 0xB974, 0xB975, 0x0730,
+ 0xB976, 0xB977, 0x2EF7, 0xB978, 0xB978, 0x0732, 0xB979, 0xB97B, 0x2EF9,
+ 0xB97C, 0xB97C, 0x0733, 0xB97D, 0xB983, 0x2EFC, 0xB984, 0xB985, 0x0734,
+ 0xB986, 0xB986, 0x2F03, 0xB987, 0xB987, 0x0736, 0xB988, 0xB988, 0x2F04,
+ 0xB989, 0xB98A, 0x0737, 0xB98B, 0xB98C, 0x2F05, 0xB98D, 0xB98E, 0x0739,
+ 0xB98F, 0xB9AB, 0x2F07, 0xB9AC, 0xB9AD, 0x073B, 0xB9AE, 0xB9AF, 0x2F24,
+ 0xB9B0, 0xB9B0, 0x073D, 0xB9B1, 0xB9B3, 0x2F26, 0xB9B4, 0xB9B4, 0x073E,
+ 0xB9B5, 0xB9BB, 0x2F29, 0xB9BC, 0xB9BD, 0x073F, 0xB9BE, 0xB9BE, 0x2F30,
+ 0xB9BF, 0xB9BF, 0x0741, 0xB9C0, 0xB9C0, 0x2F31, 0xB9C1, 0xB9C1, 0x0742,
+ 0xB9C2, 0xB9C7, 0x2F32, 0xB9C8, 0xB9C9, 0x0743, 0xB9CA, 0xB9CB, 0x2F38,
+ 0xB9CC, 0xB9CC, 0x0745, 0xB9CD, 0xB9CD, 0x2F3A, 0xB9CE, 0xB9D2, 0x0746,
+ 0xB9D3, 0xB9D7, 0x2F3B, 0xB9D8, 0xB9D9, 0x074B, 0xB9DA, 0xB9DA, 0x2F40,
+ 0xB9DB, 0xB9DB, 0x074D, 0xB9DC, 0xB9DC, 0x2F41, 0xB9DD, 0xB9DE, 0x074E,
+ 0xB9DF, 0xB9E0, 0x2F42, 0xB9E1, 0xB9E1, 0x0750, 0xB9E2, 0xB9E2, 0x2F44,
+ 0xB9E3, 0xB9E5, 0x0751, 0xB9E6, 0xB9E7, 0x2F45, 0xB9E8, 0xB9E8, 0x0754,
+ 0xB9E9, 0xB9EB, 0x2F47, 0xB9EC, 0xB9EC, 0x0755, 0xB9ED, 0xB9F3, 0x2F4A,
+ 0xB9F4, 0xB9F5, 0x0756, 0xB9F6, 0xB9F6, 0x2F51, 0xB9F7, 0xB9FA, 0x0758,
+ 0xB9FB, 0xB9FF, 0x2F52, 0xBA00, 0xBA01, 0x075C, 0xBA02, 0xBA07, 0x2F57,
+ 0xBA08, 0xBA08, 0x075E, 0xBA09, 0xBA14, 0x2F5D, 0xBA15, 0xBA15, 0x075F,
+ 0xBA16, 0xBA37, 0x2F69, 0xBA38, 0xBA39, 0x0760, 0xBA3A, 0xBA3B, 0x2F8B,
+ 0xBA3C, 0xBA3C, 0x0762, 0xBA3D, 0xBA3F, 0x2F8D, 0xBA40, 0xBA40, 0x0763,
+ 0xBA41, 0xBA41, 0x2F90, 0xBA42, 0xBA42, 0x0764, 0xBA43, 0xBA47, 0x2F91,
+ 0xBA48, 0xBA49, 0x0765, 0xBA4A, 0xBA4A, 0x2F96, 0xBA4B, 0xBA4B, 0x0767,
+ 0xBA4C, 0xBA4C, 0x2F97, 0xBA4D, 0xBA4E, 0x0768, 0xBA4F, 0xBA52, 0x2F98,
+ 0xBA53, 0xBA55, 0x076A, 0xBA56, 0xBA57, 0x2F9C, 0xBA58, 0xBA58, 0x076D,
+ 0xBA59, 0xBA5B, 0x2F9E, 0xBA5C, 0xBA5C, 0x076E, 0xBA5D, 0xBA63, 0x2FA1,
+ 0xBA64, 0xBA65, 0x076F, 0xBA66, 0xBA66, 0x2FA8, 0xBA67, 0xBA69, 0x0771,
+ 0xBA6A, 0xBA6F, 0x2FA9, 0xBA70, 0xBA71, 0x0774, 0xBA72, 0xBA73, 0x2FAF,
+ 0xBA74, 0xBA74, 0x0776, 0xBA75, 0xBA77, 0x2FB1, 0xBA78, 0xBA78, 0x0777,
+ 0xBA79, 0xBA82, 0x2FB4, 0xBA83, 0xBA85, 0x0778, 0xBA86, 0xBA86, 0x2FBE,
+ 0xBA87, 0xBA87, 0x077B, 0xBA88, 0xBA8B, 0x2FBF, 0xBA8C, 0xBA8C, 0x077C,
+ 0xBA8D, 0xBAA7, 0x2FC3, 0xBAA8, 0xBAA9, 0x077D, 0xBAAA, 0xBAAA, 0x2FDE,
+ 0xBAAB, 0xBAAC, 0x077F, 0xBAAD, 0xBAAF, 0x2FDF, 0xBAB0, 0xBAB0, 0x0781,
+ 0xBAB1, 0xBAB1, 0x2FE2, 0xBAB2, 0xBAB2, 0x0782, 0xBAB3, 0xBAB7, 0x2FE3,
+ 0xBAB8, 0xBAB9, 0x0783, 0xBABA, 0xBABA, 0x2FE8, 0xBABB, 0xBABB, 0x0785,
+ 0xBABC, 0xBABC, 0x2FE9, 0xBABD, 0xBABD, 0x0786, 0xBABE, 0xBAC3, 0x2FEA,
+ 0xBAC4, 0xBAC4, 0x0787, 0xBAC5, 0xBAC7, 0x2FF0, 0xBAC8, 0xBAC8, 0x0788,
+ 0xBAC9, 0xBAD7, 0x2FF3, 0xBAD8, 0xBAD9, 0x0789, 0xBADA, 0xBAFB, 0x3002,
+ 0xBAFC, 0xBAFC, 0x078B, 0xBAFD, 0xBAFF, 0x3024, 0xBB00, 0xBB00, 0x078C,
+ 0xBB01, 0xBB03, 0x3027, 0xBB04, 0xBB04, 0x078D, 0xBB05, 0xBB0C, 0x302A,
+ 0xBB0D, 0xBB0D, 0x078E, 0xBB0E, 0xBB0E, 0x3032, 0xBB0F, 0xBB0F, 0x078F,
+ 0xBB10, 0xBB10, 0x3033, 0xBB11, 0xBB11, 0x0790, 0xBB12, 0xBB17, 0x3034,
+ 0xBB18, 0xBB18, 0x0791, 0xBB19, 0xBB1B, 0x303A, 0xBB1C, 0xBB1C, 0x0792,
+ 0xBB1D, 0xBB1F, 0x303D, 0xBB20, 0xBB20, 0x0793, 0xBB21, 0xBB28, 0x3040,
+ 0xBB29, 0xBB29, 0x0794, 0xBB2A, 0xBB2A, 0x3048, 0xBB2B, 0xBB2B, 0x0795,
+ 0xBB2C, 0xBB33, 0x3049, 0xBB34, 0xBB36, 0x0796, 0xBB37, 0xBB37, 0x3051,
+ 0xBB38, 0xBB38, 0x0799, 0xBB39, 0xBB3A, 0x3052, 0xBB3B, 0xBB3E, 0x079A,
+ 0xBB3F, 0xBB43, 0x3054, 0xBB44, 0xBB45, 0x079E, 0xBB46, 0xBB46, 0x3059,
+ 0xBB47, 0xBB47, 0x07A0, 0xBB48, 0xBB48, 0x305A, 0xBB49, 0xBB49, 0x07A1,
+ 0xBB4A, 0xBB4C, 0x305B, 0xBB4D, 0xBB4D, 0x07A2, 0xBB4E, 0xBB4E, 0x305E,
+ 0xBB4F, 0xBB50, 0x07A3, 0xBB51, 0xBB53, 0x305F, 0xBB54, 0xBB54, 0x07A5,
+ 0xBB55, 0xBB57, 0x3062, 0xBB58, 0xBB58, 0x07A6, 0xBB59, 0xBB60, 0x3065,
+ 0xBB61, 0xBB61, 0x07A7, 0xBB62, 0xBB62, 0x306D, 0xBB63, 0xBB63, 0x07A8,
+ 0xBB64, 0xBB6B, 0x306E, 0xBB6C, 0xBB6C, 0x07A9, 0xBB6D, 0xBB87, 0x3076,
+ 0xBB88, 0xBB88, 0x07AA, 0xBB89, 0xBB8B, 0x3091, 0xBB8C, 0xBB8C, 0x07AB,
+ 0xBB8D, 0xBB8F, 0x3094, 0xBB90, 0xBB90, 0x07AC, 0xBB91, 0xBBA3, 0x3097,
+ 0xBBA4, 0xBBA4, 0x07AD, 0xBBA5, 0xBBA7, 0x30AA, 0xBBA8, 0xBBA8, 0x07AE,
+ 0xBBA9, 0xBBAB, 0x30AD, 0xBBAC, 0xBBAC, 0x07AF, 0xBBAD, 0xBBB3, 0x30B0,
+ 0xBBB4, 0xBBB4, 0x07B0, 0xBBB5, 0xBBB6, 0x30B7, 0xBBB7, 0xBBB7, 0x07B1,
+ 0xBBB8, 0xBBBF, 0x30B9, 0xBBC0, 0xBBC0, 0x07B2, 0xBBC1, 0xBBC3, 0x30C1,
+ 0xBBC4, 0xBBC4, 0x07B3, 0xBBC5, 0xBBC7, 0x30C4, 0xBBC8, 0xBBC8, 0x07B4,
+ 0xBBC9, 0xBBCF, 0x30C7, 0xBBD0, 0xBBD0, 0x07B5, 0xBBD1, 0xBBD2, 0x30CE,
+ 0xBBD3, 0xBBD3, 0x07B6, 0xBBD4, 0xBBF7, 0x30D0, 0xBBF8, 0xBBF9, 0x07B7,
+ 0xBBFA, 0xBBFB, 0x30F4, 0xBBFC, 0xBBFC, 0x07B9, 0xBBFD, 0xBBFE, 0x30F6,
+ 0xBBFF, 0xBBFF, 0x07BA, 0xBC00, 0xBC00, 0x07BB, 0xBC01, 0xBC01, 0x30F8,
+ 0xBC02, 0xBC02, 0x07BC, 0xBC03, 0xBC07, 0x30F9, 0xBC08, 0xBC09, 0x07BD,
+ 0xBC0A, 0xBC0A, 0x30FE, 0xBC0B, 0xBC0D, 0x07BF, 0xBC0E, 0xBC0E, 0x30FF,
+ 0xBC0F, 0xBC0F, 0x07C2, 0xBC10, 0xBC10, 0x3100, 0xBC11, 0xBC11, 0x07C3,
+ 0xBC12, 0xBC13, 0x3101, 0xBC14, 0xBC18, 0x07C4, 0xBC19, 0xBC1A, 0x3103,
+ 0xBC1B, 0xBC1F, 0x07C9, 0xBC20, 0xBC23, 0x3105, 0xBC24, 0xBC25, 0x07CE,
+ 0xBC26, 0xBC26, 0x3109, 0xBC27, 0xBC27, 0x07D0, 0xBC28, 0xBC28, 0x310A,
+ 0xBC29, 0xBC29, 0x07D1, 0xBC2A, 0xBC2C, 0x310B, 0xBC2D, 0xBC2D, 0x07D2,
+ 0xBC2E, 0xBC2F, 0x310E, 0xBC30, 0xBC31, 0x07D3, 0xBC32, 0xBC33, 0x3110,
+ 0xBC34, 0xBC34, 0x07D5, 0xBC35, 0xBC37, 0x3112, 0xBC38, 0xBC38, 0x07D6,
+ 0xBC39, 0xBC3F, 0x3115, 0xBC40, 0xBC41, 0x07D7, 0xBC42, 0xBC42, 0x311C,
+ 0xBC43, 0xBC45, 0x07D9, 0xBC46, 0xBC48, 0x311D, 0xBC49, 0xBC49, 0x07DC,
+ 0xBC4A, 0xBC4B, 0x3120, 0xBC4C, 0xBC4D, 0x07DD, 0xBC4E, 0xBC4F, 0x3122,
+ 0xBC50, 0xBC50, 0x07DF, 0xBC51, 0xBC5C, 0x3124, 0xBC5D, 0xBC5D, 0x07E0,
+ 0xBC5E, 0xBC83, 0x3130, 0xBC84, 0xBC85, 0x07E1, 0xBC86, 0xBC87, 0x3156,
+ 0xBC88, 0xBC88, 0x07E3, 0xBC89, 0xBC8A, 0x3158, 0xBC8B, 0xBC8C, 0x07E4,
+ 0xBC8D, 0xBC8D, 0x315A, 0xBC8E, 0xBC8E, 0x07E6, 0xBC8F, 0xBC93, 0x315B,
+ 0xBC94, 0xBC95, 0x07E7, 0xBC96, 0xBC96, 0x3160, 0xBC97, 0xBC97, 0x07E9,
+ 0xBC98, 0xBC98, 0x3161, 0xBC99, 0xBC9A, 0x07EA, 0xBC9B, 0xBC9F, 0x3162,
+ 0xBCA0, 0xBCA1, 0x07EC, 0xBCA2, 0xBCA3, 0x3167, 0xBCA4, 0xBCA4, 0x07EE,
+ 0xBCA5, 0xBCA6, 0x3169, 0xBCA7, 0xBCA8, 0x07EF, 0xBCA9, 0xBCAF, 0x316B,
+ 0xBCB0, 0xBCB1, 0x07F1, 0xBCB2, 0xBCB2, 0x3172, 0xBCB3, 0xBCB5, 0x07F3,
+ 0xBCB6, 0xBCBB, 0x3173, 0xBCBC, 0xBCBD, 0x07F6, 0xBCBE, 0xBCBF, 0x3179,
+ 0xBCC0, 0xBCC0, 0x07F8, 0xBCC1, 0xBCC3, 0x317B, 0xBCC4, 0xBCC4, 0x07F9,
+ 0xBCC5, 0xBCCC, 0x317E, 0xBCCD, 0xBCCD, 0x07FA, 0xBCCE, 0xBCCE, 0x3186,
+ 0xBCCF, 0xBCD1, 0x07FB, 0xBCD2, 0xBCD4, 0x3187, 0xBCD5, 0xBCD5, 0x07FE,
+ 0xBCD6, 0xBCD7, 0x318A, 0xBCD8, 0xBCD8, 0x07FF, 0xBCD9, 0xBCDB, 0x318C,
+ 0xBCDC, 0xBCDC, 0x0800, 0xBCDD, 0xBCF3, 0x318F, 0xBCF4, 0xBCF6, 0x0801,
+ 0xBCF7, 0xBCF7, 0x31A6, 0xBCF8, 0xBCF8, 0x0804, 0xBCF9, 0xBCFB, 0x31A7,
+ 0xBCFC, 0xBCFC, 0x0805, 0xBCFD, 0xBCFF, 0x31AA, 0xBD00, 0xBD03, 0x31AD,
+ 0xBD04, 0xBD05, 0x0806, 0xBD06, 0xBD06, 0x31B1, 0xBD07, 0xBD07, 0x0808,
+ 0xBD08, 0xBD08, 0x31B2, 0xBD09, 0xBD09, 0x0809, 0xBD0A, 0xBD0F, 0x31B3,
+ 0xBD10, 0xBD10, 0x080A, 0xBD11, 0xBD13, 0x31B9, 0xBD14, 0xBD14, 0x080B,
+ 0xBD15, 0xBD23, 0x31BC, 0xBD24, 0xBD24, 0x080C, 0xBD25, 0xBD2B, 0x31CB,
+ 0xBD2C, 0xBD2C, 0x080D, 0xBD2D, 0xBD3F, 0x31D2, 0xBD40, 0xBD40, 0x080E,
+ 0xBD41, 0xBD47, 0x31E5, 0xBD48, 0xBD49, 0x080F, 0xBD4A, 0xBD4B, 0x31EC,
+ 0xBD4C, 0xBD4C, 0x0811, 0xBD4D, 0xBD4F, 0x31EE, 0xBD50, 0xBD50, 0x0812,
+ 0xBD51, 0xBD57, 0x31F1, 0xBD58, 0xBD59, 0x0813, 0xBD5A, 0xBD63, 0x31F8,
+ 0xBD64, 0xBD64, 0x0815, 0xBD65, 0xBD67, 0x3202, 0xBD68, 0xBD68, 0x0816,
+ 0xBD69, 0xBD7F, 0x3205, 0xBD80, 0xBD81, 0x0817, 0xBD82, 0xBD83, 0x321C,
+ 0xBD84, 0xBD84, 0x0819, 0xBD85, 0xBD86, 0x321E, 0xBD87, 0xBD8A, 0x081A,
+ 0xBD8B, 0xBD8F, 0x3220, 0xBD90, 0xBD91, 0x081E, 0xBD92, 0xBD92, 0x3225,
+ 0xBD93, 0xBD93, 0x0820, 0xBD94, 0xBD94, 0x3226, 0xBD95, 0xBD95, 0x0821,
+ 0xBD96, 0xBD98, 0x3227, 0xBD99, 0xBD9A, 0x0822, 0xBD9B, 0xBD9B, 0x322A,
+ 0xBD9C, 0xBD9C, 0x0824, 0xBD9D, 0xBDA3, 0x322B, 0xBDA4, 0xBDA4, 0x0825,
+ 0xBDA5, 0xBDAF, 0x3232, 0xBDB0, 0xBDB0, 0x0826, 0xBDB1, 0xBDB7, 0x323D,
+ 0xBDB8, 0xBDB8, 0x0827, 0xBDB9, 0xBDD3, 0x3244, 0xBDD4, 0xBDD5, 0x0828,
+ 0xBDD6, 0xBDD7, 0x325F, 0xBDD8, 0xBDD8, 0x082A, 0xBDD9, 0xBDDB, 0x3261,
+ 0xBDDC, 0xBDDC, 0x082B, 0xBDDD, 0xBDE8, 0x3264, 0xBDE9, 0xBDE9, 0x082C,
+ 0xBDEA, 0xBDEF, 0x3270, 0xBDF0, 0xBDF0, 0x082D, 0xBDF1, 0xBDF3, 0x3276,
+ 0xBDF4, 0xBDF4, 0x082E, 0xBDF5, 0xBDF7, 0x3279, 0xBDF8, 0xBDF8, 0x082F,
+ 0xBDF9, 0xBDFF, 0x327C, 0xBE00, 0xBE00, 0x0830, 0xBE01, 0xBE02, 0x3283,
+ 0xBE03, 0xBE03, 0x0831, 0xBE04, 0xBE04, 0x3285, 0xBE05, 0xBE05, 0x0832,
+ 0xBE06, 0xBE0B, 0x3286, 0xBE0C, 0xBE0D, 0x0833, 0xBE0E, 0xBE0F, 0x328C,
+ 0xBE10, 0xBE10, 0x0835, 0xBE11, 0xBE13, 0x328E, 0xBE14, 0xBE14, 0x0836,
+ 0xBE15, 0xBE1B, 0x3291, 0xBE1C, 0xBE1D, 0x0837, 0xBE1E, 0xBE1E, 0x3298,
+ 0xBE1F, 0xBE1F, 0x0839, 0xBE20, 0xBE43, 0x3299, 0xBE44, 0xBE45, 0x083A,
+ 0xBE46, 0xBE47, 0x32BD, 0xBE48, 0xBE48, 0x083C, 0xBE49, 0xBE4B, 0x32BF,
+ 0xBE4C, 0xBE4C, 0x083D, 0xBE4D, 0xBE4D, 0x32C2, 0xBE4E, 0xBE4E, 0x083E,
+ 0xBE4F, 0xBE53, 0x32C3, 0xBE54, 0xBE55, 0x083F, 0xBE56, 0xBE56, 0x32C8,
+ 0xBE57, 0xBE57, 0x0841, 0xBE58, 0xBE58, 0x32C9, 0xBE59, 0xBE5B, 0x0842,
+ 0xBE5C, 0xBE5F, 0x32CA, 0xBE60, 0xBE61, 0x0845, 0xBE62, 0xBE63, 0x32CE,
+ 0xBE64, 0xBE64, 0x0847, 0xBE65, 0xBE67, 0x32D0, 0xBE68, 0xBE68, 0x0848,
+ 0xBE69, 0xBE69, 0x32D3, 0xBE6A, 0xBE6A, 0x0849, 0xBE6B, 0xBE6F, 0x32D4,
+ 0xBE70, 0xBE71, 0x084A, 0xBE72, 0xBE72, 0x32D9, 0xBE73, 0xBE75, 0x084C,
+ 0xBE76, 0xBE7A, 0x32DA, 0xBE7B, 0xBE7D, 0x084F, 0xBE7E, 0xBE7F, 0x32DF,
+ 0xBE80, 0xBE80, 0x0852, 0xBE81, 0xBE83, 0x32E1, 0xBE84, 0xBE84, 0x0853,
+ 0xBE85, 0xBE8B, 0x32E4, 0xBE8C, 0xBE8D, 0x0854, 0xBE8E, 0xBE8E, 0x32EB,
+ 0xBE8F, 0xBE91, 0x0856, 0xBE92, 0xBE97, 0x32EC, 0xBE98, 0xBE99, 0x0859,
+ 0xBE9A, 0xBEA7, 0x32F2, 0xBEA8, 0xBEA8, 0x085B, 0xBEA9, 0xBECF, 0x3300,
+ 0xBED0, 0xBED1, 0x085C, 0xBED2, 0xBED3, 0x3327, 0xBED4, 0xBED4, 0x085E,
+ 0xBED5, 0xBED6, 0x3329, 0xBED7, 0xBED8, 0x085F, 0xBED9, 0xBEDF, 0x332B,
+ 0xBEE0, 0xBEE0, 0x0861, 0xBEE1, 0xBEE2, 0x3332, 0xBEE3, 0xBEE5, 0x0862,
+ 0xBEE6, 0xBEEB, 0x3334, 0xBEEC, 0xBEEC, 0x0865, 0xBEED, 0xBEFF, 0x333A,
+ 0xBF00, 0xBF00, 0x334D, 0xBF01, 0xBF01, 0x0866, 0xBF02, 0xBF07, 0x334E,
+ 0xBF08, 0xBF09, 0x0867, 0xBF0A, 0xBF17, 0x3354, 0xBF18, 0xBF19, 0x0869,
+ 0xBF1A, 0xBF1A, 0x3362, 0xBF1B, 0xBF1D, 0x086B, 0xBF1E, 0xBF3F, 0x3363,
+ 0xBF40, 0xBF41, 0x086E, 0xBF42, 0xBF43, 0x3385, 0xBF44, 0xBF44, 0x0870,
+ 0xBF45, 0xBF47, 0x3387, 0xBF48, 0xBF48, 0x0871, 0xBF49, 0xBF4F, 0x338A,
+ 0xBF50, 0xBF51, 0x0872, 0xBF52, 0xBF54, 0x3391, 0xBF55, 0xBF55, 0x0874,
+ 0xBF56, 0xBF93, 0x3394, 0xBF94, 0xBF94, 0x0875, 0xBF95, 0xBFAF, 0x33D2,
+ 0xBFB0, 0xBFB0, 0x0876, 0xBFB1, 0xBFC4, 0x33ED, 0xBFC5, 0xBFC5, 0x0877,
+ 0xBFC6, 0xBFCB, 0x3401, 0xBFCC, 0xBFCD, 0x0878, 0xBFCE, 0xBFCF, 0x3407,
+ 0xBFD0, 0xBFD0, 0x087A, 0xBFD1, 0xBFD3, 0x3409, 0xBFD4, 0xBFD4, 0x087B,
+ 0xBFD5, 0xBFDB, 0x340C, 0xBFDC, 0xBFDC, 0x087C, 0xBFDD, 0xBFDE, 0x3413,
+ 0xBFDF, 0xBFDF, 0x087D, 0xBFE0, 0xBFE0, 0x3415, 0xBFE1, 0xBFE1, 0x087E,
+ 0xBFE2, 0xBFFF, 0x3416, 0xC000, 0xC03B, 0x3434, 0xC03C, 0xC03C, 0x087F,
+ 0xC03D, 0xC050, 0x3470, 0xC051, 0xC051, 0x0880, 0xC052, 0xC057, 0x3484,
+ 0xC058, 0xC058, 0x0881, 0xC059, 0xC05B, 0x348A, 0xC05C, 0xC05C, 0x0882,
+ 0xC05D, 0xC05F, 0x348D, 0xC060, 0xC060, 0x0883, 0xC061, 0xC067, 0x3490,
+ 0xC068, 0xC069, 0x0884, 0xC06A, 0xC08F, 0x3497, 0xC090, 0xC091, 0x0886,
+ 0xC092, 0xC093, 0x34BD, 0xC094, 0xC094, 0x0888, 0xC095, 0xC097, 0x34BF,
+ 0xC098, 0xC098, 0x0889, 0xC099, 0xC09F, 0x34C2, 0xC0A0, 0xC0A1, 0x088A,
+ 0xC0A2, 0xC0A2, 0x34C9, 0xC0A3, 0xC0A3, 0x088C, 0xC0A4, 0xC0A4, 0x34CA,
+ 0xC0A5, 0xC0A5, 0x088D, 0xC0A6, 0xC0AB, 0x34CB, 0xC0AC, 0xC0AD, 0x088E,
+ 0xC0AE, 0xC0AE, 0x34D1, 0xC0AF, 0xC0B0, 0x0890, 0xC0B1, 0xC0B2, 0x34D2,
+ 0xC0B3, 0xC0B6, 0x0892, 0xC0B7, 0xC0BB, 0x34D4, 0xC0BC, 0xC0BD, 0x0896,
+ 0xC0BE, 0xC0BE, 0x34D9, 0xC0BF, 0xC0C1, 0x0898, 0xC0C2, 0xC0C4, 0x34DA,
+ 0xC0C5, 0xC0C5, 0x089B, 0xC0C6, 0xC0C7, 0x34DD, 0xC0C8, 0xC0C9, 0x089C,
+ 0xC0CA, 0xC0CB, 0x34DF, 0xC0CC, 0xC0CC, 0x089E, 0xC0CD, 0xC0CF, 0x34E1,
+ 0xC0D0, 0xC0D0, 0x089F, 0xC0D1, 0xC0D7, 0x34E4, 0xC0D8, 0xC0D9, 0x08A0,
+ 0xC0DA, 0xC0DA, 0x34EB, 0xC0DB, 0xC0DD, 0x08A2, 0xC0DE, 0xC0E3, 0x34EC,
+ 0xC0E4, 0xC0E5, 0x08A5, 0xC0E6, 0xC0E7, 0x34F2, 0xC0E8, 0xC0E8, 0x08A7,
+ 0xC0E9, 0xC0EB, 0x34F4, 0xC0EC, 0xC0EC, 0x08A8, 0xC0ED, 0xC0F3, 0x34F7,
+ 0xC0F4, 0xC0F5, 0x08A9, 0xC0F6, 0xC0F6, 0x34FE, 0xC0F7, 0xC0F7, 0x08AB,
+ 0xC0F8, 0xC0F8, 0x34FF, 0xC0F9, 0xC0F9, 0x08AC, 0xC0FA, 0xC0FF, 0x3500,
+ 0xC100, 0xC100, 0x08AD, 0xC101, 0xC103, 0x3506, 0xC104, 0xC104, 0x08AE,
+ 0xC105, 0xC107, 0x3509, 0xC108, 0xC108, 0x08AF, 0xC109, 0xC10F, 0x350C,
+ 0xC110, 0xC110, 0x08B0, 0xC111, 0xC114, 0x3513, 0xC115, 0xC115, 0x08B1,
+ 0xC116, 0xC11B, 0x3517, 0xC11C, 0xC120, 0x08B2, 0xC121, 0xC122, 0x351D,
+ 0xC123, 0xC124, 0x08B7, 0xC125, 0xC125, 0x351F, 0xC126, 0xC127, 0x08B9,
+ 0xC128, 0xC12B, 0x3520, 0xC12C, 0xC12D, 0x08BB, 0xC12E, 0xC12E, 0x3524,
+ 0xC12F, 0xC131, 0x08BD, 0xC132, 0xC135, 0x3525, 0xC136, 0xC136, 0x08C0,
+ 0xC137, 0xC137, 0x3529, 0xC138, 0xC139, 0x08C1, 0xC13A, 0xC13B, 0x352A,
+ 0xC13C, 0xC13C, 0x08C3, 0xC13D, 0xC13F, 0x352C, 0xC140, 0xC140, 0x08C4,
+ 0xC141, 0xC147, 0x352F, 0xC148, 0xC149, 0x08C5, 0xC14A, 0xC14A, 0x3536,
+ 0xC14B, 0xC14D, 0x08C7, 0xC14E, 0xC153, 0x3537, 0xC154, 0xC155, 0x08CA,
+ 0xC156, 0xC157, 0x353D, 0xC158, 0xC158, 0x08CC, 0xC159, 0xC15B, 0x353F,
+ 0xC15C, 0xC15C, 0x08CD, 0xC15D, 0xC163, 0x3542, 0xC164, 0xC165, 0x08CE,
+ 0xC166, 0xC166, 0x3549, 0xC167, 0xC169, 0x08D0, 0xC16A, 0xC16F, 0x354A,
+ 0xC170, 0xC170, 0x08D3, 0xC171, 0xC173, 0x3550, 0xC174, 0xC174, 0x08D4,
+ 0xC175, 0xC177, 0x3553, 0xC178, 0xC178, 0x08D5, 0xC179, 0xC184, 0x3556,
+ 0xC185, 0xC185, 0x08D6, 0xC186, 0xC18B, 0x3562, 0xC18C, 0xC18E, 0x08D7,
+ 0xC18F, 0xC18F, 0x3568, 0xC190, 0xC190, 0x08DA, 0xC191, 0xC193, 0x3569,
+ 0xC194, 0xC194, 0x08DB, 0xC195, 0xC195, 0x356C, 0xC196, 0xC196, 0x08DC,
+ 0xC197, 0xC19B, 0x356D, 0xC19C, 0xC19D, 0x08DD, 0xC19E, 0xC19E, 0x3572,
+ 0xC19F, 0xC19F, 0x08DF, 0xC1A0, 0xC1A0, 0x3573, 0xC1A1, 0xC1A1, 0x08E0,
+ 0xC1A2, 0xC1A4, 0x3574, 0xC1A5, 0xC1A5, 0x08E1, 0xC1A6, 0xC1A7, 0x3577,
+ 0xC1A8, 0xC1A9, 0x08E2, 0xC1AA, 0xC1AB, 0x3579, 0xC1AC, 0xC1AC, 0x08E4,
+ 0xC1AD, 0xC1AF, 0x357B, 0xC1B0, 0xC1B0, 0x08E5, 0xC1B1, 0xC1BC, 0x357E,
+ 0xC1BD, 0xC1BD, 0x08E6, 0xC1BE, 0xC1C3, 0x358A, 0xC1C4, 0xC1C4, 0x08E7,
+ 0xC1C5, 0xC1C7, 0x3590, 0xC1C8, 0xC1C8, 0x08E8, 0xC1C9, 0xC1CB, 0x3593,
+ 0xC1CC, 0xC1CC, 0x08E9, 0xC1CD, 0xC1D3, 0x3596, 0xC1D4, 0xC1D4, 0x08EA,
+ 0xC1D5, 0xC1D6, 0x359D, 0xC1D7, 0xC1D8, 0x08EB, 0xC1D9, 0xC1DF, 0x359F,
+ 0xC1E0, 0xC1E0, 0x08ED, 0xC1E1, 0xC1E3, 0x35A6, 0xC1E4, 0xC1E4, 0x08EE,
+ 0xC1E5, 0xC1E7, 0x35A9, 0xC1E8, 0xC1E8, 0x08EF, 0xC1E9, 0xC1EF, 0x35AC,
+ 0xC1F0, 0xC1F1, 0x08F0, 0xC1F2, 0xC1F2, 0x35B3, 0xC1F3, 0xC1F3, 0x08F2,
+ 0xC1F4, 0xC1FB, 0x35B4, 0xC1FC, 0xC1FD, 0x08F3, 0xC1FE, 0xC1FF, 0x35BC,
+ 0xC200, 0xC200, 0x08F5, 0xC201, 0xC203, 0x35BE, 0xC204, 0xC204, 0x08F6,
+ 0xC205, 0xC20B, 0x35C1, 0xC20C, 0xC20D, 0x08F7, 0xC20E, 0xC20E, 0x35C8,
+ 0xC20F, 0xC20F, 0x08F9, 0xC210, 0xC210, 0x35C9, 0xC211, 0xC211, 0x08FA,
+ 0xC212, 0xC217, 0x35CA, 0xC218, 0xC219, 0x08FB, 0xC21A, 0xC21B, 0x35D0,
+ 0xC21C, 0xC21C, 0x08FD, 0xC21D, 0xC21E, 0x35D2, 0xC21F, 0xC220, 0x08FE,
+ 0xC221, 0xC227, 0x35D4, 0xC228, 0xC229, 0x0900, 0xC22A, 0xC22A, 0x35DB,
+ 0xC22B, 0xC22B, 0x0902, 0xC22C, 0xC22C, 0x35DC, 0xC22D, 0xC22D, 0x0903,
+ 0xC22E, 0xC22E, 0x35DD, 0xC22F, 0xC22F, 0x0904, 0xC230, 0xC230, 0x35DE,
+ 0xC231, 0xC232, 0x0905, 0xC233, 0xC233, 0x35DF, 0xC234, 0xC234, 0x0907,
+ 0xC235, 0xC247, 0x35E0, 0xC248, 0xC248, 0x0908, 0xC249, 0xC24F, 0x35F3,
+ 0xC250, 0xC251, 0x0909, 0xC252, 0xC253, 0x35FA, 0xC254, 0xC254, 0x090B,
+ 0xC255, 0xC257, 0x35FC, 0xC258, 0xC258, 0x090C, 0xC259, 0xC25F, 0x35FF,
+ 0xC260, 0xC260, 0x090D, 0xC261, 0xC264, 0x3606, 0xC265, 0xC265, 0x090E,
+ 0xC266, 0xC26B, 0x360A, 0xC26C, 0xC26D, 0x090F, 0xC26E, 0xC26F, 0x3610,
+ 0xC270, 0xC270, 0x0911, 0xC271, 0xC273, 0x3612, 0xC274, 0xC274, 0x0912,
+ 0xC275, 0xC27B, 0x3615, 0xC27C, 0xC27D, 0x0913, 0xC27E, 0xC27E, 0x361C,
+ 0xC27F, 0xC27F, 0x0915, 0xC280, 0xC280, 0x361D, 0xC281, 0xC281, 0x0916,
+ 0xC282, 0xC287, 0x361E, 0xC288, 0xC289, 0x0917, 0xC28A, 0xC28F, 0x3624,
+ 0xC290, 0xC290, 0x0919, 0xC291, 0xC297, 0x362A, 0xC298, 0xC298, 0x091A,
+ 0xC299, 0xC29A, 0x3631, 0xC29B, 0xC29B, 0x091B, 0xC29C, 0xC29C, 0x3633,
+ 0xC29D, 0xC29D, 0x091C, 0xC29E, 0xC2A3, 0x3634, 0xC2A4, 0xC2A5, 0x091D,
+ 0xC2A6, 0xC2A7, 0x363A, 0xC2A8, 0xC2A8, 0x091F, 0xC2A9, 0xC2AB, 0x363C,
+ 0xC2AC, 0xC2AD, 0x0920, 0xC2AE, 0xC2B3, 0x363F, 0xC2B4, 0xC2B5, 0x0922,
+ 0xC2B6, 0xC2B6, 0x3645, 0xC2B7, 0xC2B7, 0x0924, 0xC2B8, 0xC2B8, 0x3646,
+ 0xC2B9, 0xC2B9, 0x0925, 0xC2BA, 0xC2DB, 0x3647, 0xC2DC, 0xC2DD, 0x0926,
+ 0xC2DE, 0xC2DF, 0x3669, 0xC2E0, 0xC2E0, 0x0928, 0xC2E1, 0xC2E2, 0x366B,
+ 0xC2E3, 0xC2E4, 0x0929, 0xC2E5, 0xC2EA, 0x366D, 0xC2EB, 0xC2ED, 0x092B,
+ 0xC2EE, 0xC2EE, 0x3673, 0xC2EF, 0xC2EF, 0x092E, 0xC2F0, 0xC2F0, 0x3674,
+ 0xC2F1, 0xC2F1, 0x092F, 0xC2F2, 0xC2F5, 0x3675, 0xC2F6, 0xC2F6, 0x0930,
+ 0xC2F7, 0xC2F7, 0x3679, 0xC2F8, 0xC2F9, 0x0931, 0xC2FA, 0xC2FA, 0x367A,
+ 0xC2FB, 0xC2FC, 0x0933, 0xC2FD, 0xC2FF, 0x367B, 0xC300, 0xC300, 0x0935,
+ 0xC301, 0xC307, 0x367E, 0xC308, 0xC309, 0x0936, 0xC30A, 0xC30B, 0x3685,
+ 0xC30C, 0xC30D, 0x0938, 0xC30E, 0xC312, 0x3687, 0xC313, 0xC315, 0x093A,
+ 0xC316, 0xC317, 0x368C, 0xC318, 0xC318, 0x093D, 0xC319, 0xC31B, 0x368E,
+ 0xC31C, 0xC31C, 0x093E, 0xC31D, 0xC323, 0x3691, 0xC324, 0xC325, 0x093F,
+ 0xC326, 0xC327, 0x3698, 0xC328, 0xC329, 0x0941, 0xC32A, 0xC344, 0x369A,
+ 0xC345, 0xC345, 0x0943, 0xC346, 0xC367, 0x36B5, 0xC368, 0xC369, 0x0944,
+ 0xC36A, 0xC36B, 0x36D7, 0xC36C, 0xC36C, 0x0946, 0xC36D, 0xC36F, 0x36D9,
+ 0xC370, 0xC370, 0x0947, 0xC371, 0xC371, 0x36DC, 0xC372, 0xC372, 0x0948,
+ 0xC373, 0xC377, 0x36DD, 0xC378, 0xC379, 0x0949, 0xC37A, 0xC37B, 0x36E2,
+ 0xC37C, 0xC37D, 0x094B, 0xC37E, 0xC383, 0x36E4, 0xC384, 0xC384, 0x094D,
+ 0xC385, 0xC387, 0x36EA, 0xC388, 0xC388, 0x094E, 0xC389, 0xC38B, 0x36ED,
+ 0xC38C, 0xC38C, 0x094F, 0xC38D, 0xC3BF, 0x36F0, 0xC3C0, 0xC3C0, 0x0950,
+ 0xC3C1, 0xC3D7, 0x3723, 0xC3D8, 0xC3D9, 0x0951, 0xC3DA, 0xC3DB, 0x373A,
+ 0xC3DC, 0xC3DC, 0x0953, 0xC3DD, 0xC3DE, 0x373C, 0xC3DF, 0xC3E0, 0x0954,
+ 0xC3E1, 0xC3E1, 0x373E, 0xC3E2, 0xC3E2, 0x0956, 0xC3E3, 0xC3E7, 0x373F,
+ 0xC3E8, 0xC3E9, 0x0957, 0xC3EA, 0xC3EC, 0x3744, 0xC3ED, 0xC3ED, 0x0959,
+ 0xC3EE, 0xC3F3, 0x3747, 0xC3F4, 0xC3F5, 0x095A, 0xC3F6, 0xC3F7, 0x374D,
+ 0xC3F8, 0xC3F8, 0x095C, 0xC3F9, 0xC3FF, 0x374F, 0xC400, 0xC407, 0x3756,
+ 0xC408, 0xC408, 0x095D, 0xC409, 0xC40F, 0x375E, 0xC410, 0xC410, 0x095E,
+ 0xC411, 0xC423, 0x3765, 0xC424, 0xC424, 0x095F, 0xC425, 0xC42B, 0x3778,
+ 0xC42C, 0xC42C, 0x0960, 0xC42D, 0xC42F, 0x377F, 0xC430, 0xC430, 0x0961,
+ 0xC431, 0xC433, 0x3782, 0xC434, 0xC434, 0x0962, 0xC435, 0xC43B, 0x3785,
+ 0xC43C, 0xC43D, 0x0963, 0xC43E, 0xC447, 0x378C, 0xC448, 0xC448, 0x0965,
+ 0xC449, 0xC463, 0x3796, 0xC464, 0xC465, 0x0966, 0xC466, 0xC467, 0x37B1,
+ 0xC468, 0xC468, 0x0968, 0xC469, 0xC46B, 0x37B3, 0xC46C, 0xC46C, 0x0969,
+ 0xC46D, 0xC473, 0x37B6, 0xC474, 0xC475, 0x096A, 0xC476, 0xC478, 0x37BD,
+ 0xC479, 0xC479, 0x096C, 0xC47A, 0xC47F, 0x37C0, 0xC480, 0xC480, 0x096D,
+ 0xC481, 0xC493, 0x37C6, 0xC494, 0xC494, 0x096E, 0xC495, 0xC49B, 0x37D9,
+ 0xC49C, 0xC49C, 0x096F, 0xC49D, 0xC4B7, 0x37E0, 0xC4B8, 0xC4B8, 0x0970,
+ 0xC4B9, 0xC4BB, 0x37FB, 0xC4BC, 0xC4BC, 0x0971, 0xC4BD, 0xC4E8, 0x37FE,
+ 0xC4E9, 0xC4E9, 0x0972, 0xC4EA, 0xC4EF, 0x382A, 0xC4F0, 0xC4F1, 0x0973,
+ 0xC4F2, 0xC4F3, 0x3830, 0xC4F4, 0xC4F4, 0x0975, 0xC4F5, 0xC4F7, 0x3832,
+ 0xC4F8, 0xC4F8, 0x0976, 0xC4F9, 0xC4F9, 0x3835, 0xC4FA, 0xC4FA, 0x0977,
+ 0xC4FB, 0xC4FE, 0x3836, 0xC4FF, 0xC4FF, 0x0978, 0xC500, 0xC501, 0x0979,
+ 0xC502, 0xC50B, 0x383A, 0xC50C, 0xC50C, 0x097B, 0xC50D, 0xC50F, 0x3844,
+ 0xC510, 0xC510, 0x097C, 0xC511, 0xC513, 0x3847, 0xC514, 0xC514, 0x097D,
+ 0xC515, 0xC51B, 0x384A, 0xC51C, 0xC51C, 0x097E, 0xC51D, 0xC527, 0x3851,
+ 0xC528, 0xC529, 0x097F, 0xC52A, 0xC52B, 0x385C, 0xC52C, 0xC52C, 0x0981,
+ 0xC52D, 0xC52F, 0x385E, 0xC530, 0xC530, 0x0982, 0xC531, 0xC537, 0x3861,
+ 0xC538, 0xC539, 0x0983, 0xC53A, 0xC53A, 0x3868, 0xC53B, 0xC53B, 0x0985,
+ 0xC53C, 0xC53C, 0x3869, 0xC53D, 0xC53D, 0x0986, 0xC53E, 0xC543, 0x386A,
+ 0xC544, 0xC545, 0x0987, 0xC546, 0xC547, 0x3870, 0xC548, 0xC54A, 0x0989,
+ 0xC54B, 0xC54B, 0x3872, 0xC54C, 0xC54E, 0x098C, 0xC54F, 0xC552, 0x3873,
+ 0xC553, 0xC555, 0x098F, 0xC556, 0xC556, 0x3877, 0xC557, 0xC559, 0x0992,
+ 0xC55A, 0xC55C, 0x3878, 0xC55D, 0xC55E, 0x0995, 0xC55F, 0xC55F, 0x387B,
+ 0xC560, 0xC561, 0x0997, 0xC562, 0xC563, 0x387C, 0xC564, 0xC564, 0x0999,
+ 0xC565, 0xC567, 0x387E, 0xC568, 0xC568, 0x099A, 0xC569, 0xC56F, 0x3881,
+ 0xC570, 0xC571, 0x099B, 0xC572, 0xC572, 0x3888, 0xC573, 0xC575, 0x099D,
+ 0xC576, 0xC57B, 0x3889, 0xC57C, 0xC57D, 0x09A0, 0xC57E, 0xC57F, 0x388F,
+ 0xC580, 0xC580, 0x09A2, 0xC581, 0xC583, 0x3891, 0xC584, 0xC584, 0x09A3,
+ 0xC585, 0xC586, 0x3894, 0xC587, 0xC587, 0x09A4, 0xC588, 0xC58B, 0x3896,
+ 0xC58C, 0xC58D, 0x09A5, 0xC58E, 0xC58E, 0x389A, 0xC58F, 0xC58F, 0x09A7,
+ 0xC590, 0xC590, 0x389B, 0xC591, 0xC591, 0x09A8, 0xC592, 0xC594, 0x389C,
+ 0xC595, 0xC595, 0x09A9, 0xC596, 0xC596, 0x389F, 0xC597, 0xC598, 0x09AA,
+ 0xC599, 0xC59B, 0x38A0, 0xC59C, 0xC59C, 0x09AC, 0xC59D, 0xC59F, 0x38A3,
+ 0xC5A0, 0xC5A0, 0x09AD, 0xC5A1, 0xC5A8, 0x38A6, 0xC5A9, 0xC5A9, 0x09AE,
+ 0xC5AA, 0xC5B3, 0x38AE, 0xC5B4, 0xC5B5, 0x09AF, 0xC5B6, 0xC5B7, 0x38B8,
+ 0xC5B8, 0xC5B9, 0x09B1, 0xC5BA, 0xC5BA, 0x38BA, 0xC5BB, 0xC5BE, 0x09B3,
+ 0xC5BF, 0xC5C3, 0x38BB, 0xC5C4, 0xC5CA, 0x09B7, 0xC5CB, 0xC5CB, 0x38C0,
+ 0xC5CC, 0xC5CC, 0x09BE, 0xC5CD, 0xC5CD, 0x38C1, 0xC5CE, 0xC5CE, 0x09BF,
+ 0xC5CF, 0xC5CF, 0x38C2, 0xC5D0, 0xC5D1, 0x09C0, 0xC5D2, 0xC5D3, 0x38C3,
+ 0xC5D4, 0xC5D4, 0x09C2, 0xC5D5, 0xC5D7, 0x38C5, 0xC5D8, 0xC5D8, 0x09C3,
+ 0xC5D9, 0xC5DF, 0x38C8, 0xC5E0, 0xC5E1, 0x09C4, 0xC5E2, 0xC5E2, 0x38CF,
+ 0xC5E3, 0xC5E3, 0x09C6, 0xC5E4, 0xC5E4, 0x38D0, 0xC5E5, 0xC5E5, 0x09C7,
+ 0xC5E6, 0xC5EB, 0x38D1, 0xC5EC, 0xC5EE, 0x09C8, 0xC5EF, 0xC5EF, 0x38D7,
+ 0xC5F0, 0xC5F0, 0x09CB, 0xC5F1, 0xC5F3, 0x38D8, 0xC5F4, 0xC5F4, 0x09CC,
+ 0xC5F5, 0xC5F5, 0x38DB, 0xC5F6, 0xC5F7, 0x09CD, 0xC5F8, 0xC5FB, 0x38DC,
+ 0xC5FC, 0xC5FF, 0x09CF, 0xC600, 0xC601, 0x09D3, 0xC602, 0xC604, 0x38E0,
+ 0xC605, 0xC608, 0x09D5, 0xC609, 0xC60B, 0x38E3, 0xC60C, 0xC60C, 0x09D9,
+ 0xC60D, 0xC60F, 0x38E6, 0xC610, 0xC610, 0x09DA, 0xC611, 0xC617, 0x38E9,
+ 0xC618, 0xC619, 0x09DB, 0xC61A, 0xC61A, 0x38F0, 0xC61B, 0xC61C, 0x09DD,
+ 0xC61D, 0xC623, 0x38F1, 0xC624, 0xC625, 0x09DF, 0xC626, 0xC627, 0x38F8,
+ 0xC628, 0xC628, 0x09E1, 0xC629, 0xC62B, 0x38FA, 0xC62C, 0xC62E, 0x09E2,
+ 0xC62F, 0xC62F, 0x38FD, 0xC630, 0xC630, 0x09E5, 0xC631, 0xC632, 0x38FE,
+ 0xC633, 0xC635, 0x09E6, 0xC636, 0xC636, 0x3900, 0xC637, 0xC637, 0x09E9,
+ 0xC638, 0xC638, 0x3901, 0xC639, 0xC639, 0x09EA, 0xC63A, 0xC63A, 0x3902,
+ 0xC63B, 0xC63B, 0x09EB, 0xC63C, 0xC63F, 0x3903, 0xC640, 0xC641, 0x09EC,
+ 0xC642, 0xC643, 0x3907, 0xC644, 0xC644, 0x09EE, 0xC645, 0xC647, 0x3909,
+ 0xC648, 0xC648, 0x09EF, 0xC649, 0xC64F, 0x390C, 0xC650, 0xC651, 0x09F0,
+ 0xC652, 0xC652, 0x3913, 0xC653, 0xC655, 0x09F2, 0xC656, 0xC65B, 0x3914,
+ 0xC65C, 0xC65D, 0x09F5, 0xC65E, 0xC65F, 0x391A, 0xC660, 0xC660, 0x09F7,
+ 0xC661, 0xC66B, 0x391C, 0xC66C, 0xC66C, 0x09F8, 0xC66D, 0xC66E, 0x3927,
+ 0xC66F, 0xC66F, 0x09F9, 0xC670, 0xC670, 0x3929, 0xC671, 0xC671, 0x09FA,
+ 0xC672, 0xC677, 0x392A, 0xC678, 0xC679, 0x09FB, 0xC67A, 0xC67B, 0x3930,
+ 0xC67C, 0xC67C, 0x09FD, 0xC67D, 0xC67F, 0x3932, 0xC680, 0xC680, 0x09FE,
+ 0xC681, 0xC687, 0x3935, 0xC688, 0xC689, 0x09FF, 0xC68A, 0xC68A, 0x393C,
+ 0xC68B, 0xC68B, 0x0A01, 0xC68C, 0xC68C, 0x393D, 0xC68D, 0xC68D, 0x0A02,
+ 0xC68E, 0xC693, 0x393E, 0xC694, 0xC695, 0x0A03, 0xC696, 0xC697, 0x3944,
+ 0xC698, 0xC698, 0x0A05, 0xC699, 0xC69B, 0x3946, 0xC69C, 0xC69C, 0x0A06,
+ 0xC69D, 0xC6A3, 0x3949, 0xC6A4, 0xC6A5, 0x0A07, 0xC6A6, 0xC6A6, 0x3950,
+ 0xC6A7, 0xC6A7, 0x0A09, 0xC6A8, 0xC6A8, 0x3951, 0xC6A9, 0xC6A9, 0x0A0A,
+ 0xC6AA, 0xC6AF, 0x3952, 0xC6B0, 0xC6B1, 0x0A0B, 0xC6B2, 0xC6B3, 0x3958,
+ 0xC6B4, 0xC6B4, 0x0A0D, 0xC6B5, 0xC6B7, 0x395A, 0xC6B8, 0xC6BA, 0x0A0E,
+ 0xC6BB, 0xC6BF, 0x395D, 0xC6C0, 0xC6C1, 0x0A11, 0xC6C2, 0xC6C2, 0x3962,
+ 0xC6C3, 0xC6C3, 0x0A13, 0xC6C4, 0xC6C4, 0x3963, 0xC6C5, 0xC6C5, 0x0A14,
+ 0xC6C6, 0xC6CB, 0x3964, 0xC6CC, 0xC6CD, 0x0A15, 0xC6CE, 0xC6CF, 0x396A,
+ 0xC6D0, 0xC6D0, 0x0A17, 0xC6D1, 0xC6D3, 0x396C, 0xC6D4, 0xC6D4, 0x0A18,
+ 0xC6D5, 0xC6DB, 0x396F, 0xC6DC, 0xC6DD, 0x0A19, 0xC6DE, 0xC6DF, 0x3976,
+ 0xC6E0, 0xC6E1, 0x0A1B, 0xC6E2, 0xC6E7, 0x3978, 0xC6E8, 0xC6E9, 0x0A1D,
+ 0xC6EA, 0xC6EB, 0x397E, 0xC6EC, 0xC6EC, 0x0A1F, 0xC6ED, 0xC6EF, 0x3980,
+ 0xC6F0, 0xC6F0, 0x0A20, 0xC6F1, 0xC6F7, 0x3983, 0xC6F8, 0xC6F9, 0x0A21,
+ 0xC6FA, 0xC6FC, 0x398A, 0xC6FD, 0xC6FD, 0x0A23, 0xC6FE, 0xC6FF, 0x398D,
+ 0xC700, 0xC703, 0x398F, 0xC704, 0xC705, 0x0A24, 0xC706, 0xC707, 0x3993,
+ 0xC708, 0xC708, 0x0A26, 0xC709, 0xC70B, 0x3995, 0xC70C, 0xC70C, 0x0A27,
+ 0xC70D, 0xC713, 0x3998, 0xC714, 0xC715, 0x0A28, 0xC716, 0xC716, 0x399F,
+ 0xC717, 0xC717, 0x0A2A, 0xC718, 0xC718, 0x39A0, 0xC719, 0xC719, 0x0A2B,
+ 0xC71A, 0xC71F, 0x39A1, 0xC720, 0xC721, 0x0A2C, 0xC722, 0xC723, 0x39A7,
+ 0xC724, 0xC724, 0x0A2E, 0xC725, 0xC727, 0x39A9, 0xC728, 0xC728, 0x0A2F,
+ 0xC729, 0xC72F, 0x39AC, 0xC730, 0xC731, 0x0A30, 0xC732, 0xC732, 0x39B3,
+ 0xC733, 0xC733, 0x0A32, 0xC734, 0xC734, 0x39B4, 0xC735, 0xC735, 0x0A33,
+ 0xC736, 0xC736, 0x39B5, 0xC737, 0xC737, 0x0A34, 0xC738, 0xC73B, 0x39B6,
+ 0xC73C, 0xC73D, 0x0A35, 0xC73E, 0xC73F, 0x39BA, 0xC740, 0xC740, 0x0A37,
+ 0xC741, 0xC743, 0x39BC, 0xC744, 0xC744, 0x0A38, 0xC745, 0xC749, 0x39BF,
+ 0xC74A, 0xC74A, 0x0A39, 0xC74B, 0xC74B, 0x39C4, 0xC74C, 0xC74D, 0x0A3A,
+ 0xC74E, 0xC74E, 0x39C5, 0xC74F, 0xC74F, 0x0A3C, 0xC750, 0xC750, 0x39C6,
+ 0xC751, 0xC758, 0x0A3D, 0xC759, 0xC75B, 0x39C7, 0xC75C, 0xC75C, 0x0A45,
+ 0xC75D, 0xC75F, 0x39CA, 0xC760, 0xC760, 0x0A46, 0xC761, 0xC767, 0x39CD,
+ 0xC768, 0xC768, 0x0A47, 0xC769, 0xC76A, 0x39D4, 0xC76B, 0xC76B, 0x0A48,
+ 0xC76C, 0xC773, 0x39D6, 0xC774, 0xC775, 0x0A49, 0xC776, 0xC777, 0x39DE,
+ 0xC778, 0xC778, 0x0A4B, 0xC779, 0xC77B, 0x39E0, 0xC77C, 0xC77E, 0x0A4C,
+ 0xC77F, 0xC782, 0x39E3, 0xC783, 0xC785, 0x0A4F, 0xC786, 0xC786, 0x39E7,
+ 0xC787, 0xC78A, 0x0A52, 0xC78B, 0xC78D, 0x39E8, 0xC78E, 0xC78E, 0x0A56,
+ 0xC78F, 0xC78F, 0x39EB, 0xC790, 0xC791, 0x0A57, 0xC792, 0xC793, 0x39EC,
+ 0xC794, 0xC794, 0x0A59, 0xC795, 0xC795, 0x39EE, 0xC796, 0xC798, 0x0A5A,
+ 0xC799, 0xC799, 0x39EF, 0xC79A, 0xC79A, 0x0A5D, 0xC79B, 0xC79F, 0x39F0,
+ 0xC7A0, 0xC7A1, 0x0A5E, 0xC7A2, 0xC7A2, 0x39F5, 0xC7A3, 0xC7A6, 0x0A60,
+ 0xC7A7, 0xC7AB, 0x39F6, 0xC7AC, 0xC7AD, 0x0A64, 0xC7AE, 0xC7AF, 0x39FB,
+ 0xC7B0, 0xC7B0, 0x0A66, 0xC7B1, 0xC7B3, 0x39FD, 0xC7B4, 0xC7B4, 0x0A67,
+ 0xC7B5, 0xC7BB, 0x3A00, 0xC7BC, 0xC7BD, 0x0A68, 0xC7BE, 0xC7BE, 0x3A07,
+ 0xC7BF, 0xC7C1, 0x0A6A, 0xC7C2, 0xC7C7, 0x3A08, 0xC7C8, 0xC7C9, 0x0A6D,
+ 0xC7CA, 0xC7CB, 0x3A0E, 0xC7CC, 0xC7CC, 0x0A6F, 0xC7CD, 0xC7CD, 0x3A10,
+ 0xC7CE, 0xC7CE, 0x0A70, 0xC7CF, 0xC7CF, 0x3A11, 0xC7D0, 0xC7D0, 0x0A71,
+ 0xC7D1, 0xC7D7, 0x3A12, 0xC7D8, 0xC7D8, 0x0A72, 0xC7D9, 0xC7DC, 0x3A19,
+ 0xC7DD, 0xC7DD, 0x0A73, 0xC7DE, 0xC7E3, 0x3A1D, 0xC7E4, 0xC7E4, 0x0A74,
+ 0xC7E5, 0xC7E7, 0x3A23, 0xC7E8, 0xC7E8, 0x0A75, 0xC7E9, 0xC7EB, 0x3A26,
+ 0xC7EC, 0xC7EC, 0x0A76, 0xC7ED, 0xC7FF, 0x3A29, 0xC800, 0xC801, 0x0A77,
+ 0xC802, 0xC803, 0x3A3C, 0xC804, 0xC804, 0x0A79, 0xC805, 0xC807, 0x3A3E,
+ 0xC808, 0xC808, 0x0A7A, 0xC809, 0xC809, 0x3A41, 0xC80A, 0xC80A, 0x0A7B,
+ 0xC80B, 0xC80F, 0x3A42, 0xC810, 0xC811, 0x0A7C, 0xC812, 0xC812, 0x3A47,
+ 0xC813, 0xC813, 0x0A7E, 0xC814, 0xC814, 0x3A48, 0xC815, 0xC816, 0x0A7F,
+ 0xC817, 0xC81B, 0x3A49, 0xC81C, 0xC81D, 0x0A81, 0xC81E, 0xC81F, 0x3A4E,
+ 0xC820, 0xC820, 0x0A83, 0xC821, 0xC823, 0x3A50, 0xC824, 0xC824, 0x0A84,
+ 0xC825, 0xC82B, 0x3A53, 0xC82C, 0xC82D, 0x0A85, 0xC82E, 0xC82E, 0x3A5A,
+ 0xC82F, 0xC82F, 0x0A87, 0xC830, 0xC830, 0x3A5B, 0xC831, 0xC831, 0x0A88,
+ 0xC832, 0xC837, 0x3A5C, 0xC838, 0xC838, 0x0A89, 0xC839, 0xC83B, 0x3A62,
+ 0xC83C, 0xC83C, 0x0A8A, 0xC83D, 0xC83F, 0x3A65, 0xC840, 0xC840, 0x0A8B,
+ 0xC841, 0xC847, 0x3A68, 0xC848, 0xC849, 0x0A8C, 0xC84A, 0xC84B, 0x3A6F,
+ 0xC84C, 0xC84D, 0x0A8E, 0xC84E, 0xC853, 0x3A71, 0xC854, 0xC854, 0x0A90,
+ 0xC855, 0xC86F, 0x3A77, 0xC870, 0xC871, 0x0A91, 0xC872, 0xC873, 0x3A92,
+ 0xC874, 0xC874, 0x0A93, 0xC875, 0xC877, 0x3A94, 0xC878, 0xC878, 0x0A94,
+ 0xC879, 0xC879, 0x3A97, 0xC87A, 0xC87A, 0x0A95, 0xC87B, 0xC87F, 0x3A98,
+ 0xC880, 0xC881, 0x0A96, 0xC882, 0xC882, 0x3A9D, 0xC883, 0xC883, 0x0A98,
+ 0xC884, 0xC884, 0x3A9E, 0xC885, 0xC887, 0x0A99, 0xC888, 0xC88A, 0x3A9F,
+ 0xC88B, 0xC88D, 0x0A9C, 0xC88E, 0xC893, 0x3AA2, 0xC894, 0xC894, 0x0A9F,
+ 0xC895, 0xC89C, 0x3AA8, 0xC89D, 0xC89D, 0x0AA0, 0xC89E, 0xC89E, 0x3AB0,
+ 0xC89F, 0xC89F, 0x0AA1, 0xC8A0, 0xC8A0, 0x3AB1, 0xC8A1, 0xC8A1, 0x0AA2,
+ 0xC8A2, 0xC8A7, 0x3AB2, 0xC8A8, 0xC8A8, 0x0AA3, 0xC8A9, 0xC8BB, 0x3AB8,
+ 0xC8BC, 0xC8BD, 0x0AA4, 0xC8BE, 0xC8C3, 0x3ACB, 0xC8C4, 0xC8C4, 0x0AA6,
+ 0xC8C5, 0xC8C7, 0x3AD1, 0xC8C8, 0xC8C8, 0x0AA7, 0xC8C9, 0xC8CB, 0x3AD4,
+ 0xC8CC, 0xC8CC, 0x0AA8, 0xC8CD, 0xC8D3, 0x3AD7, 0xC8D4, 0xC8D5, 0x0AA9,
+ 0xC8D6, 0xC8D6, 0x3ADE, 0xC8D7, 0xC8D7, 0x0AAB, 0xC8D8, 0xC8D8, 0x3ADF,
+ 0xC8D9, 0xC8D9, 0x0AAC, 0xC8DA, 0xC8DF, 0x3AE0, 0xC8E0, 0xC8E1, 0x0AAD,
+ 0xC8E2, 0xC8E3, 0x3AE6, 0xC8E4, 0xC8E4, 0x0AAF, 0xC8E5, 0xC8F4, 0x3AE8,
+ 0xC8F5, 0xC8F5, 0x0AB0, 0xC8F6, 0xC8FB, 0x3AF8, 0xC8FC, 0xC8FD, 0x0AB1,
+ 0xC8FE, 0xC8FF, 0x3AFE, 0xC900, 0xC900, 0x0AB3, 0xC901, 0xC903, 0x3B00,
+ 0xC904, 0xC906, 0x0AB4, 0xC907, 0xC90B, 0x3B03, 0xC90C, 0xC90D, 0x0AB7,
+ 0xC90E, 0xC90E, 0x3B08, 0xC90F, 0xC90F, 0x0AB9, 0xC910, 0xC910, 0x3B09,
+ 0xC911, 0xC911, 0x0ABA, 0xC912, 0xC917, 0x3B0A, 0xC918, 0xC918, 0x0ABB,
+ 0xC919, 0xC92B, 0x3B10, 0xC92C, 0xC92C, 0x0ABC, 0xC92D, 0xC933, 0x3B23,
+ 0xC934, 0xC934, 0x0ABD, 0xC935, 0xC94F, 0x3B2A, 0xC950, 0xC951, 0x0ABE,
+ 0xC952, 0xC953, 0x3B45, 0xC954, 0xC954, 0x0AC0, 0xC955, 0xC957, 0x3B47,
+ 0xC958, 0xC958, 0x0AC1, 0xC959, 0xC95F, 0x3B4A, 0xC960, 0xC961, 0x0AC2,
+ 0xC962, 0xC962, 0x3B51, 0xC963, 0xC963, 0x0AC4, 0xC964, 0xC96B, 0x3B52,
+ 0xC96C, 0xC96C, 0x0AC5, 0xC96D, 0xC96F, 0x3B5A, 0xC970, 0xC970, 0x0AC6,
+ 0xC971, 0xC973, 0x3B5D, 0xC974, 0xC974, 0x0AC7, 0xC975, 0xC97B, 0x3B60,
+ 0xC97C, 0xC97C, 0x0AC8, 0xC97D, 0xC987, 0x3B67, 0xC988, 0xC989, 0x0AC9,
+ 0xC98A, 0xC98B, 0x3B72, 0xC98C, 0xC98C, 0x0ACB, 0xC98D, 0xC98F, 0x3B74,
+ 0xC990, 0xC990, 0x0ACC, 0xC991, 0xC997, 0x3B77, 0xC998, 0xC999, 0x0ACD,
+ 0xC99A, 0xC99A, 0x3B7E, 0xC99B, 0xC99B, 0x0ACF, 0xC99C, 0xC99C, 0x3B7F,
+ 0xC99D, 0xC99D, 0x0AD0, 0xC99E, 0xC9BF, 0x3B80, 0xC9C0, 0xC9C1, 0x0AD1,
+ 0xC9C2, 0xC9C3, 0x3BA2, 0xC9C4, 0xC9C4, 0x0AD3, 0xC9C5, 0xC9C6, 0x3BA4,
+ 0xC9C7, 0xC9C8, 0x0AD4, 0xC9C9, 0xC9C9, 0x3BA6, 0xC9CA, 0xC9CA, 0x0AD6,
+ 0xC9CB, 0xC9CF, 0x3BA7, 0xC9D0, 0xC9D1, 0x0AD7, 0xC9D2, 0xC9D2, 0x3BAC,
+ 0xC9D3, 0xC9D3, 0x0AD9, 0xC9D4, 0xC9D4, 0x3BAD, 0xC9D5, 0xC9D6, 0x0ADA,
+ 0xC9D7, 0xC9D8, 0x3BAE, 0xC9D9, 0xC9DA, 0x0ADC, 0xC9DB, 0xC9DB, 0x3BB0,
+ 0xC9DC, 0xC9DD, 0x0ADE, 0xC9DE, 0xC9DF, 0x3BB1, 0xC9E0, 0xC9E0, 0x0AE0,
+ 0xC9E1, 0xC9E1, 0x3BB3, 0xC9E2, 0xC9E2, 0x0AE1, 0xC9E3, 0xC9E3, 0x3BB4,
+ 0xC9E4, 0xC9E4, 0x0AE2, 0xC9E5, 0xC9E6, 0x3BB5, 0xC9E7, 0xC9E7, 0x0AE3,
+ 0xC9E8, 0xC9EB, 0x3BB7, 0xC9EC, 0xC9ED, 0x0AE4, 0xC9EE, 0xC9EE, 0x3BBB,
+ 0xC9EF, 0xC9F1, 0x0AE6, 0xC9F2, 0xC9F7, 0x3BBC, 0xC9F8, 0xC9F9, 0x0AE9,
+ 0xC9FA, 0xC9FB, 0x3BC2, 0xC9FC, 0xC9FC, 0x0AEB, 0xC9FD, 0xC9FF, 0x3BC4,
+ 0xCA00, 0xCA00, 0x0AEC, 0xCA01, 0xCA07, 0x3BC7, 0xCA08, 0xCA09, 0x0AED,
+ 0xCA0A, 0xCA0A, 0x3BCE, 0xCA0B, 0xCA0D, 0x0AEF, 0xCA0E, 0xCA13, 0x3BCF,
+ 0xCA14, 0xCA14, 0x0AF2, 0xCA15, 0xCA17, 0x3BD5, 0xCA18, 0xCA18, 0x0AF3,
+ 0xCA19, 0xCA28, 0x3BD8, 0xCA29, 0xCA29, 0x0AF4, 0xCA2A, 0xCA4B, 0x3BE8,
+ 0xCA4C, 0xCA4D, 0x0AF5, 0xCA4E, 0xCA4F, 0x3C0A, 0xCA50, 0xCA50, 0x0AF7,
+ 0xCA51, 0xCA53, 0x3C0C, 0xCA54, 0xCA54, 0x0AF8, 0xCA55, 0xCA5B, 0x3C0F,
+ 0xCA5C, 0xCA5D, 0x0AF9, 0xCA5E, 0xCA5E, 0x3C16, 0xCA5F, 0xCA61, 0x0AFB,
+ 0xCA62, 0xCA67, 0x3C17, 0xCA68, 0xCA68, 0x0AFE, 0xCA69, 0xCA7C, 0x3C1D,
+ 0xCA7D, 0xCA7D, 0x0AFF, 0xCA7E, 0xCA83, 0x3C31, 0xCA84, 0xCA84, 0x0B00,
+ 0xCA85, 0xCA97, 0x3C37, 0xCA98, 0xCA98, 0x0B01, 0xCA99, 0xCABB, 0x3C4A,
+ 0xCABC, 0xCABD, 0x0B02, 0xCABE, 0xCABF, 0x3C6D, 0xCAC0, 0xCAC0, 0x0B04,
+ 0xCAC1, 0xCAC3, 0x3C6F, 0xCAC4, 0xCAC4, 0x0B05, 0xCAC5, 0xCACB, 0x3C72,
+ 0xCACC, 0xCACD, 0x0B06, 0xCACE, 0xCACE, 0x3C79, 0xCACF, 0xCACF, 0x0B08,
+ 0xCAD0, 0xCAD0, 0x3C7A, 0xCAD1, 0xCAD1, 0x0B09, 0xCAD2, 0xCAD2, 0x3C7B,
+ 0xCAD3, 0xCAD3, 0x0B0A, 0xCAD4, 0xCAD7, 0x3C7C, 0xCAD8, 0xCAD9, 0x0B0B,
+ 0xCADA, 0xCADF, 0x3C80, 0xCAE0, 0xCAE0, 0x0B0D, 0xCAE1, 0xCAEB, 0x3C86,
+ 0xCAEC, 0xCAEC, 0x0B0E, 0xCAED, 0xCAF3, 0x3C91, 0xCAF4, 0xCAF4, 0x0B0F,
+ 0xCAF5, 0xCAFF, 0x3C98, 0xCB00, 0xCB07, 0x3CA3, 0xCB08, 0xCB08, 0x0B10,
+ 0xCB09, 0xCB0F, 0x3CAB, 0xCB10, 0xCB10, 0x0B11, 0xCB11, 0xCB13, 0x3CB2,
+ 0xCB14, 0xCB14, 0x0B12, 0xCB15, 0xCB17, 0x3CB5, 0xCB18, 0xCB18, 0x0B13,
+ 0xCB19, 0xCB1F, 0x3CB8, 0xCB20, 0xCB21, 0x0B14, 0xCB22, 0xCB40, 0x3CBF,
+ 0xCB41, 0xCB41, 0x0B16, 0xCB42, 0xCB47, 0x3CDE, 0xCB48, 0xCB49, 0x0B17,
+ 0xCB4A, 0xCB4B, 0x3CE4, 0xCB4C, 0xCB4C, 0x0B19, 0xCB4D, 0xCB4F, 0x3CE6,
+ 0xCB50, 0xCB50, 0x0B1A, 0xCB51, 0xCB57, 0x3CE9, 0xCB58, 0xCB59, 0x0B1B,
+ 0xCB5A, 0xCB5C, 0x3CF0, 0xCB5D, 0xCB5D, 0x0B1D, 0xCB5E, 0xCB63, 0x3CF3,
+ 0xCB64, 0xCB64, 0x0B1E, 0xCB65, 0xCB77, 0x3CF9, 0xCB78, 0xCB79, 0x0B1F,
+ 0xCB7A, 0xCB9B, 0x3D0C, 0xCB9C, 0xCB9C, 0x0B21, 0xCB9D, 0xCBB7, 0x3D2E,
+ 0xCBB8, 0xCBB8, 0x0B22, 0xCBB9, 0xCBD3, 0x3D49, 0xCBD4, 0xCBD4, 0x0B23,
+ 0xCBD5, 0xCBE3, 0x3D64, 0xCBE4, 0xCBE4, 0x0B24, 0xCBE5, 0xCBE6, 0x3D73,
+ 0xCBE7, 0xCBE7, 0x0B25, 0xCBE8, 0xCBE8, 0x3D75, 0xCBE9, 0xCBE9, 0x0B26,
+ 0xCBEA, 0xCBFF, 0x3D76, 0xCC00, 0xCC0B, 0x3D8C, 0xCC0C, 0xCC0D, 0x0B27,
+ 0xCC0E, 0xCC0F, 0x3D98, 0xCC10, 0xCC10, 0x0B29, 0xCC11, 0xCC13, 0x3D9A,
+ 0xCC14, 0xCC14, 0x0B2A, 0xCC15, 0xCC1B, 0x3D9D, 0xCC1C, 0xCC1D, 0x0B2B,
+ 0xCC1E, 0xCC20, 0x3DA4, 0xCC21, 0xCC22, 0x0B2D, 0xCC23, 0xCC26, 0x3DA7,
+ 0xCC27, 0xCC29, 0x0B2F, 0xCC2A, 0xCC2B, 0x3DAB, 0xCC2C, 0xCC2C, 0x0B32,
+ 0xCC2D, 0xCC2D, 0x3DAD, 0xCC2E, 0xCC2E, 0x0B33, 0xCC2F, 0xCC2F, 0x3DAE,
+ 0xCC30, 0xCC30, 0x0B34, 0xCC31, 0xCC37, 0x3DAF, 0xCC38, 0xCC39, 0x0B35,
+ 0xCC3A, 0xCC3A, 0x3DB6, 0xCC3B, 0xCC3E, 0x0B37, 0xCC3F, 0xCC43, 0x3DB7,
+ 0xCC44, 0xCC45, 0x0B3B, 0xCC46, 0xCC47, 0x3DBC, 0xCC48, 0xCC48, 0x0B3D,
+ 0xCC49, 0xCC4B, 0x3DBE, 0xCC4C, 0xCC4C, 0x0B3E, 0xCC4D, 0xCC53, 0x3DC1,
+ 0xCC54, 0xCC55, 0x0B3F, 0xCC56, 0xCC56, 0x3DC8, 0xCC57, 0xCC59, 0x0B41,
+ 0xCC5A, 0xCC5F, 0x3DC9, 0xCC60, 0xCC60, 0x0B44, 0xCC61, 0xCC63, 0x3DCF,
+ 0xCC64, 0xCC64, 0x0B45, 0xCC65, 0xCC65, 0x3DD2, 0xCC66, 0xCC66, 0x0B46,
+ 0xCC67, 0xCC67, 0x3DD3, 0xCC68, 0xCC68, 0x0B47, 0xCC69, 0xCC6F, 0x3DD4,
+ 0xCC70, 0xCC70, 0x0B48, 0xCC71, 0xCC74, 0x3DDB, 0xCC75, 0xCC75, 0x0B49,
+ 0xCC76, 0xCC97, 0x3DDF, 0xCC98, 0xCC99, 0x0B4A, 0xCC9A, 0xCC9B, 0x3E01,
+ 0xCC9C, 0xCC9C, 0x0B4C, 0xCC9D, 0xCC9F, 0x3E03, 0xCCA0, 0xCCA0, 0x0B4D,
+ 0xCCA1, 0xCCA7, 0x3E06, 0xCCA8, 0xCCA9, 0x0B4E, 0xCCAA, 0xCCAA, 0x3E0D,
+ 0xCCAB, 0xCCAD, 0x0B50, 0xCCAE, 0xCCB3, 0x3E0E, 0xCCB4, 0xCCB5, 0x0B53,
+ 0xCCB6, 0xCCB7, 0x3E14, 0xCCB8, 0xCCB8, 0x0B55, 0xCCB9, 0xCCBB, 0x3E16,
+ 0xCCBC, 0xCCBC, 0x0B56, 0xCCBD, 0xCCC3, 0x3E19, 0xCCC4, 0xCCC5, 0x0B57,
+ 0xCCC6, 0xCCC6, 0x3E20, 0xCCC7, 0xCCC7, 0x0B59, 0xCCC8, 0xCCC8, 0x3E21,
+ 0xCCC9, 0xCCC9, 0x0B5A, 0xCCCA, 0xCCCF, 0x3E22, 0xCCD0, 0xCCD0, 0x0B5B,
+ 0xCCD1, 0xCCD3, 0x3E28, 0xCCD4, 0xCCD4, 0x0B5C, 0xCCD5, 0xCCE3, 0x3E2B,
+ 0xCCE4, 0xCCE4, 0x0B5D, 0xCCE5, 0xCCEB, 0x3E3A, 0xCCEC, 0xCCEC, 0x0B5E,
+ 0xCCED, 0xCCEF, 0x3E41, 0xCCF0, 0xCCF0, 0x0B5F, 0xCCF1, 0xCCFF, 0x3E44,
+ 0xCD00, 0xCD00, 0x3E53, 0xCD01, 0xCD01, 0x0B60, 0xCD02, 0xCD07, 0x3E54,
+ 0xCD08, 0xCD09, 0x0B61, 0xCD0A, 0xCD0B, 0x3E5A, 0xCD0C, 0xCD0C, 0x0B63,
+ 0xCD0D, 0xCD0F, 0x3E5C, 0xCD10, 0xCD10, 0x0B64, 0xCD11, 0xCD17, 0x3E5F,
+ 0xCD18, 0xCD19, 0x0B65, 0xCD1A, 0xCD1A, 0x3E66, 0xCD1B, 0xCD1B, 0x0B67,
+ 0xCD1C, 0xCD1C, 0x3E67, 0xCD1D, 0xCD1D, 0x0B68, 0xCD1E, 0xCD23, 0x3E68,
+ 0xCD24, 0xCD24, 0x0B69, 0xCD25, 0xCD27, 0x3E6E, 0xCD28, 0xCD28, 0x0B6A,
+ 0xCD29, 0xCD2B, 0x3E71, 0xCD2C, 0xCD2C, 0x0B6B, 0xCD2D, 0xCD38, 0x3E74,
+ 0xCD39, 0xCD39, 0x0B6C, 0xCD3A, 0xCD5B, 0x3E80, 0xCD5C, 0xCD5C, 0x0B6D,
+ 0xCD5D, 0xCD5F, 0x3EA2, 0xCD60, 0xCD60, 0x0B6E, 0xCD61, 0xCD63, 0x3EA5,
+ 0xCD64, 0xCD64, 0x0B6F, 0xCD65, 0xCD6B, 0x3EA8, 0xCD6C, 0xCD6D, 0x0B70,
+ 0xCD6E, 0xCD6E, 0x3EAF, 0xCD6F, 0xCD6F, 0x0B72, 0xCD70, 0xCD70, 0x3EB0,
+ 0xCD71, 0xCD71, 0x0B73, 0xCD72, 0xCD77, 0x3EB1, 0xCD78, 0xCD78, 0x0B74,
+ 0xCD79, 0xCD87, 0x3EB7, 0xCD88, 0xCD88, 0x0B75, 0xCD89, 0xCD93, 0x3EC6,
+ 0xCD94, 0xCD95, 0x0B76, 0xCD96, 0xCD97, 0x3ED1, 0xCD98, 0xCD98, 0x0B78,
+ 0xCD99, 0xCD9B, 0x3ED3, 0xCD9C, 0xCD9C, 0x0B79, 0xCD9D, 0xCDA3, 0x3ED6,
+ 0xCDA4, 0xCDA5, 0x0B7A, 0xCDA6, 0xCDA6, 0x3EDD, 0xCDA7, 0xCDA7, 0x0B7C,
+ 0xCDA8, 0xCDA8, 0x3EDE, 0xCDA9, 0xCDA9, 0x0B7D, 0xCDAA, 0xCDAF, 0x3EDF,
+ 0xCDB0, 0xCDB0, 0x0B7E, 0xCDB1, 0xCDC3, 0x3EE5, 0xCDC4, 0xCDC4, 0x0B7F,
+ 0xCDC5, 0xCDCB, 0x3EF8, 0xCDCC, 0xCDCC, 0x0B80, 0xCDCD, 0xCDCF, 0x3EFF,
+ 0xCDD0, 0xCDD0, 0x0B81, 0xCDD1, 0xCDE7, 0x3F02, 0xCDE8, 0xCDE8, 0x0B82,
+ 0xCDE9, 0xCDEB, 0x3F19, 0xCDEC, 0xCDEC, 0x0B83, 0xCDED, 0xCDEF, 0x3F1C,
+ 0xCDF0, 0xCDF0, 0x0B84, 0xCDF1, 0xCDF7, 0x3F1F, 0xCDF8, 0xCDF9, 0x0B85,
+ 0xCDFA, 0xCDFA, 0x3F26, 0xCDFB, 0xCDFB, 0x0B87, 0xCDFC, 0xCDFC, 0x3F27,
+ 0xCDFD, 0xCDFD, 0x0B88, 0xCDFE, 0xCDFF, 0x3F28, 0xCE00, 0xCE03, 0x3F2A,
+ 0xCE04, 0xCE04, 0x0B89, 0xCE05, 0xCE07, 0x3F2E, 0xCE08, 0xCE08, 0x0B8A,
+ 0xCE09, 0xCE0B, 0x3F31, 0xCE0C, 0xCE0C, 0x0B8B, 0xCE0D, 0xCE13, 0x3F34,
+ 0xCE14, 0xCE14, 0x0B8C, 0xCE15, 0xCE18, 0x3F3B, 0xCE19, 0xCE19, 0x0B8D,
+ 0xCE1A, 0xCE1F, 0x3F3F, 0xCE20, 0xCE21, 0x0B8E, 0xCE22, 0xCE23, 0x3F45,
+ 0xCE24, 0xCE24, 0x0B90, 0xCE25, 0xCE27, 0x3F47, 0xCE28, 0xCE28, 0x0B91,
+ 0xCE29, 0xCE2F, 0x3F4A, 0xCE30, 0xCE31, 0x0B92, 0xCE32, 0xCE32, 0x3F51,
+ 0xCE33, 0xCE33, 0x0B94, 0xCE34, 0xCE34, 0x3F52, 0xCE35, 0xCE35, 0x0B95,
+ 0xCE36, 0xCE57, 0x3F53, 0xCE58, 0xCE59, 0x0B96, 0xCE5A, 0xCE5B, 0x3F75,
+ 0xCE5C, 0xCE5C, 0x0B98, 0xCE5D, 0xCE5E, 0x3F77, 0xCE5F, 0xCE61, 0x0B99,
+ 0xCE62, 0xCE67, 0x3F79, 0xCE68, 0xCE69, 0x0B9C, 0xCE6A, 0xCE6A, 0x3F7F,
+ 0xCE6B, 0xCE6B, 0x0B9E, 0xCE6C, 0xCE6C, 0x3F80, 0xCE6D, 0xCE6D, 0x0B9F,
+ 0xCE6E, 0xCE73, 0x3F81, 0xCE74, 0xCE75, 0x0BA0, 0xCE76, 0xCE77, 0x3F87,
+ 0xCE78, 0xCE78, 0x0BA2, 0xCE79, 0xCE7B, 0x3F89, 0xCE7C, 0xCE7C, 0x0BA3,
+ 0xCE7D, 0xCE83, 0x3F8C, 0xCE84, 0xCE85, 0x0BA4, 0xCE86, 0xCE86, 0x3F93,
+ 0xCE87, 0xCE87, 0x0BA6, 0xCE88, 0xCE88, 0x3F94, 0xCE89, 0xCE89, 0x0BA7,
+ 0xCE8A, 0xCE8F, 0x3F95, 0xCE90, 0xCE91, 0x0BA8, 0xCE92, 0xCE93, 0x3F9B,
+ 0xCE94, 0xCE94, 0x0BAA, 0xCE95, 0xCE97, 0x3F9D, 0xCE98, 0xCE98, 0x0BAB,
+ 0xCE99, 0xCE9F, 0x3FA0, 0xCEA0, 0xCEA1, 0x0BAC, 0xCEA2, 0xCEA2, 0x3FA7,
+ 0xCEA3, 0xCEA5, 0x0BAE, 0xCEA6, 0xCEAB, 0x3FA8, 0xCEAC, 0xCEAD, 0x0BB1,
+ 0xCEAE, 0xCEC0, 0x3FAE, 0xCEC1, 0xCEC1, 0x0BB3, 0xCEC2, 0xCEE3, 0x3FC1,
+ 0xCEE4, 0xCEE5, 0x0BB4, 0xCEE6, 0xCEE7, 0x3FE3, 0xCEE8, 0xCEE8, 0x0BB6,
+ 0xCEE9, 0xCEEA, 0x3FE5, 0xCEEB, 0xCEEC, 0x0BB7, 0xCEED, 0xCEF3, 0x3FE7,
+ 0xCEF4, 0xCEF5, 0x0BB9, 0xCEF6, 0xCEF6, 0x3FEE, 0xCEF7, 0xCEF9, 0x0BBB,
+ 0xCEFA, 0xCEFF, 0x3FEF, 0xCF00, 0xCF01, 0x0BBE, 0xCF02, 0xCF03, 0x3FF5,
+ 0xCF04, 0xCF04, 0x0BC0, 0xCF05, 0xCF07, 0x3FF7, 0xCF08, 0xCF08, 0x0BC1,
+ 0xCF09, 0xCF0F, 0x3FFA, 0xCF10, 0xCF11, 0x0BC2, 0xCF12, 0xCF12, 0x4001,
+ 0xCF13, 0xCF13, 0x0BC4, 0xCF14, 0xCF14, 0x4002, 0xCF15, 0xCF15, 0x0BC5,
+ 0xCF16, 0xCF1B, 0x4003, 0xCF1C, 0xCF1C, 0x0BC6, 0xCF1D, 0xCF1F, 0x4009,
+ 0xCF20, 0xCF20, 0x0BC7, 0xCF21, 0xCF23, 0x400C, 0xCF24, 0xCF24, 0x0BC8,
+ 0xCF25, 0xCF2B, 0x400F, 0xCF2C, 0xCF2D, 0x0BC9, 0xCF2E, 0xCF2E, 0x4016,
+ 0xCF2F, 0xCF31, 0x0BCB, 0xCF32, 0xCF37, 0x4017, 0xCF38, 0xCF38, 0x0BCE,
+ 0xCF39, 0xCF53, 0x401D, 0xCF54, 0xCF55, 0x0BCF, 0xCF56, 0xCF57, 0x4038,
+ 0xCF58, 0xCF58, 0x0BD1, 0xCF59, 0xCF5B, 0x403A, 0xCF5C, 0xCF5C, 0x0BD2,
+ 0xCF5D, 0xCF63, 0x403D, 0xCF64, 0xCF65, 0x0BD3, 0xCF66, 0xCF66, 0x4044,
+ 0xCF67, 0xCF67, 0x0BD5, 0xCF68, 0xCF68, 0x4045, 0xCF69, 0xCF69, 0x0BD6,
+ 0xCF6A, 0xCF6F, 0x4046, 0xCF70, 0xCF71, 0x0BD7, 0xCF72, 0xCF73, 0x404C,
+ 0xCF74, 0xCF74, 0x0BD9, 0xCF75, 0xCF77, 0x404E, 0xCF78, 0xCF78, 0x0BDA,
+ 0xCF79, 0xCF7F, 0x4051, 0xCF80, 0xCF80, 0x0BDB, 0xCF81, 0xCF84, 0x4058,
+ 0xCF85, 0xCF85, 0x0BDC, 0xCF86, 0xCF8B, 0x405C, 0xCF8C, 0xCF8C, 0x0BDD,
+ 0xCF8D, 0xCFA0, 0x4062, 0xCFA1, 0xCFA1, 0x0BDE, 0xCFA2, 0xCFA7, 0x4076,
+ 0xCFA8, 0xCFA8, 0x0BDF, 0xCFA9, 0xCFAF, 0x407C, 0xCFB0, 0xCFB0, 0x0BE0,
+ 0xCFB1, 0xCFC3, 0x4083, 0xCFC4, 0xCFC4, 0x0BE1, 0xCFC5, 0xCFDF, 0x4096,
+ 0xCFE0, 0xCFE1, 0x0BE2, 0xCFE2, 0xCFE3, 0x40B1, 0xCFE4, 0xCFE4, 0x0BE4,
+ 0xCFE5, 0xCFE7, 0x40B3, 0xCFE8, 0xCFE8, 0x0BE5, 0xCFE9, 0xCFEF, 0x40B6,
+ 0xCFF0, 0xCFF1, 0x0BE6, 0xCFF2, 0xCFF2, 0x40BD, 0xCFF3, 0xCFF3, 0x0BE8,
+ 0xCFF4, 0xCFF4, 0x40BE, 0xCFF5, 0xCFF5, 0x0BE9, 0xCFF6, 0xCFFB, 0x40BF,
+ 0xCFFC, 0xCFFC, 0x0BEA, 0xCFFD, 0xCFFF, 0x40C5, 0xD000, 0xD000, 0x0BEB,
+ 0xD001, 0xD003, 0x40C8, 0xD004, 0xD004, 0x0BEC, 0xD005, 0xD010, 0x40CB,
+ 0xD011, 0xD011, 0x0BED, 0xD012, 0xD017, 0x40D7, 0xD018, 0xD018, 0x0BEE,
+ 0xD019, 0xD02C, 0x40DD, 0xD02D, 0xD02D, 0x0BEF, 0xD02E, 0xD033, 0x40F1,
+ 0xD034, 0xD035, 0x0BF0, 0xD036, 0xD037, 0x40F7, 0xD038, 0xD038, 0x0BF2,
+ 0xD039, 0xD03B, 0x40F9, 0xD03C, 0xD03C, 0x0BF3, 0xD03D, 0xD043, 0x40FC,
+ 0xD044, 0xD045, 0x0BF4, 0xD046, 0xD046, 0x4103, 0xD047, 0xD047, 0x0BF6,
+ 0xD048, 0xD048, 0x4104, 0xD049, 0xD049, 0x0BF7, 0xD04A, 0xD04F, 0x4105,
+ 0xD050, 0xD050, 0x0BF8, 0xD051, 0xD053, 0x410B, 0xD054, 0xD054, 0x0BF9,
+ 0xD055, 0xD057, 0x410E, 0xD058, 0xD058, 0x0BFA, 0xD059, 0xD05F, 0x4111,
+ 0xD060, 0xD060, 0x0BFB, 0xD061, 0xD06B, 0x4118, 0xD06C, 0xD06D, 0x0BFC,
+ 0xD06E, 0xD06F, 0x4123, 0xD070, 0xD070, 0x0BFE, 0xD071, 0xD073, 0x4125,
+ 0xD074, 0xD074, 0x0BFF, 0xD075, 0xD07B, 0x4128, 0xD07C, 0xD07D, 0x0C00,
+ 0xD07E, 0xD080, 0x412F, 0xD081, 0xD081, 0x0C02, 0xD082, 0xD0A3, 0x4132,
+ 0xD0A4, 0xD0A5, 0x0C03, 0xD0A6, 0xD0A7, 0x4154, 0xD0A8, 0xD0A8, 0x0C05,
+ 0xD0A9, 0xD0AB, 0x4156, 0xD0AC, 0xD0AC, 0x0C06, 0xD0AD, 0xD0B3, 0x4159,
+ 0xD0B4, 0xD0B5, 0x0C07, 0xD0B6, 0xD0B6, 0x4160, 0xD0B7, 0xD0B7, 0x0C09,
+ 0xD0B8, 0xD0B8, 0x4161, 0xD0B9, 0xD0B9, 0x0C0A, 0xD0BA, 0xD0BF, 0x4162,
+ 0xD0C0, 0xD0C1, 0x0C0B, 0xD0C2, 0xD0C3, 0x4168, 0xD0C4, 0xD0C4, 0x0C0D,
+ 0xD0C5, 0xD0C7, 0x416A, 0xD0C8, 0xD0C9, 0x0C0E, 0xD0CA, 0xD0CF, 0x416D,
+ 0xD0D0, 0xD0D1, 0x0C10, 0xD0D2, 0xD0D2, 0x4173, 0xD0D3, 0xD0D5, 0x0C12,
+ 0xD0D6, 0xD0DB, 0x4174, 0xD0DC, 0xD0DD, 0x0C15, 0xD0DE, 0xD0DF, 0x417A,
+ 0xD0E0, 0xD0E0, 0x0C17, 0xD0E1, 0xD0E3, 0x417C, 0xD0E4, 0xD0E4, 0x0C18,
+ 0xD0E5, 0xD0EB, 0x417F, 0xD0EC, 0xD0ED, 0x0C19, 0xD0EE, 0xD0EE, 0x4186,
+ 0xD0EF, 0xD0F1, 0x0C1B, 0xD0F2, 0xD0F7, 0x4187, 0xD0F8, 0xD0F8, 0x0C1E,
+ 0xD0F9, 0xD0FF, 0x418D, 0xD100, 0xD10C, 0x4194, 0xD10D, 0xD10D, 0x0C1F,
+ 0xD10E, 0xD12F, 0x41A1, 0xD130, 0xD131, 0x0C20, 0xD132, 0xD133, 0x41C3,
+ 0xD134, 0xD134, 0x0C22, 0xD135, 0xD137, 0x41C5, 0xD138, 0xD138, 0x0C23,
+ 0xD139, 0xD139, 0x41C8, 0xD13A, 0xD13A, 0x0C24, 0xD13B, 0xD13F, 0x41C9,
+ 0xD140, 0xD141, 0x0C25, 0xD142, 0xD142, 0x41CE, 0xD143, 0xD145, 0x0C27,
+ 0xD146, 0xD14B, 0x41CF, 0xD14C, 0xD14D, 0x0C2A, 0xD14E, 0xD14F, 0x41D5,
+ 0xD150, 0xD150, 0x0C2C, 0xD151, 0xD153, 0x41D7, 0xD154, 0xD154, 0x0C2D,
+ 0xD155, 0xD15B, 0x41DA, 0xD15C, 0xD15D, 0x0C2E, 0xD15E, 0xD15E, 0x41E1,
+ 0xD15F, 0xD15F, 0x0C30, 0xD160, 0xD160, 0x41E2, 0xD161, 0xD161, 0x0C31,
+ 0xD162, 0xD167, 0x41E3, 0xD168, 0xD168, 0x0C32, 0xD169, 0xD16B, 0x41E9,
+ 0xD16C, 0xD16C, 0x0C33, 0xD16D, 0xD17B, 0x41EC, 0xD17C, 0xD17C, 0x0C34,
+ 0xD17D, 0xD183, 0x41FB, 0xD184, 0xD184, 0x0C35, 0xD185, 0xD187, 0x4202,
+ 0xD188, 0xD188, 0x0C36, 0xD189, 0xD19F, 0x4205, 0xD1A0, 0xD1A1, 0x0C37,
+ 0xD1A2, 0xD1A3, 0x421C, 0xD1A4, 0xD1A4, 0x0C39, 0xD1A5, 0xD1A7, 0x421E,
+ 0xD1A8, 0xD1A8, 0x0C3A, 0xD1A9, 0xD1AF, 0x4221, 0xD1B0, 0xD1B1, 0x0C3B,
+ 0xD1B2, 0xD1B2, 0x4228, 0xD1B3, 0xD1B3, 0x0C3D, 0xD1B4, 0xD1B4, 0x4229,
+ 0xD1B5, 0xD1B5, 0x0C3E, 0xD1B6, 0xD1B9, 0x422A, 0xD1BA, 0xD1BA, 0x0C3F,
+ 0xD1BB, 0xD1BB, 0x422E, 0xD1BC, 0xD1BC, 0x0C40, 0xD1BD, 0xD1BF, 0x422F,
+ 0xD1C0, 0xD1C0, 0x0C41, 0xD1C1, 0xD1D7, 0x4232, 0xD1D8, 0xD1D8, 0x0C42,
+ 0xD1D9, 0xD1F3, 0x4249, 0xD1F4, 0xD1F4, 0x0C43, 0xD1F5, 0xD1F7, 0x4264,
+ 0xD1F8, 0xD1F8, 0x0C44, 0xD1F9, 0xD1FF, 0x4267, 0xD200, 0xD206, 0x426E,
+ 0xD207, 0xD207, 0x0C45, 0xD208, 0xD208, 0x4275, 0xD209, 0xD209, 0x0C46,
+ 0xD20A, 0xD20F, 0x4276, 0xD210, 0xD210, 0x0C47, 0xD211, 0xD22B, 0x427C,
+ 0xD22C, 0xD22D, 0x0C48, 0xD22E, 0xD22F, 0x4297, 0xD230, 0xD230, 0x0C4A,
+ 0xD231, 0xD233, 0x4299, 0xD234, 0xD234, 0x0C4B, 0xD235, 0xD23B, 0x429C,
+ 0xD23C, 0xD23D, 0x0C4C, 0xD23E, 0xD23E, 0x42A3, 0xD23F, 0xD23F, 0x0C4E,
+ 0xD240, 0xD240, 0x42A4, 0xD241, 0xD241, 0x0C4F, 0xD242, 0xD247, 0x42A5,
+ 0xD248, 0xD248, 0x0C50, 0xD249, 0xD25B, 0x42AB, 0xD25C, 0xD25C, 0x0C51,
+ 0xD25D, 0xD263, 0x42BE, 0xD264, 0xD264, 0x0C52, 0xD265, 0xD27F, 0x42C5,
+ 0xD280, 0xD281, 0x0C53, 0xD282, 0xD283, 0x42E0, 0xD284, 0xD284, 0x0C55,
+ 0xD285, 0xD287, 0x42E2, 0xD288, 0xD288, 0x0C56, 0xD289, 0xD28F, 0x42E5,
+ 0xD290, 0xD291, 0x0C57, 0xD292, 0xD294, 0x42EC, 0xD295, 0xD295, 0x0C59,
+ 0xD296, 0xD29B, 0x42EF, 0xD29C, 0xD29C, 0x0C5A, 0xD29D, 0xD29F, 0x42F5,
+ 0xD2A0, 0xD2A0, 0x0C5B, 0xD2A1, 0xD2A3, 0x42F8, 0xD2A4, 0xD2A4, 0x0C5C,
+ 0xD2A5, 0xD2AB, 0x42FB, 0xD2AC, 0xD2AC, 0x0C5D, 0xD2AD, 0xD2B0, 0x4302,
+ 0xD2B1, 0xD2B1, 0x0C5E, 0xD2B2, 0xD2B7, 0x4306, 0xD2B8, 0xD2B9, 0x0C5F,
+ 0xD2BA, 0xD2BB, 0x430C, 0xD2BC, 0xD2BC, 0x0C61, 0xD2BD, 0xD2BE, 0x430E,
+ 0xD2BF, 0xD2C0, 0x0C62, 0xD2C1, 0xD2C1, 0x4310, 0xD2C2, 0xD2C2, 0x0C64,
+ 0xD2C3, 0xD2C7, 0x4311, 0xD2C8, 0xD2C9, 0x0C65, 0xD2CA, 0xD2CA, 0x4316,
+ 0xD2CB, 0xD2CB, 0x0C67, 0xD2CC, 0xD2D3, 0x4317, 0xD2D4, 0xD2D4, 0x0C68,
+ 0xD2D5, 0xD2D7, 0x431F, 0xD2D8, 0xD2D8, 0x0C69, 0xD2D9, 0xD2DB, 0x4322,
+ 0xD2DC, 0xD2DC, 0x0C6A, 0xD2DD, 0xD2E3, 0x4325, 0xD2E4, 0xD2E5, 0x0C6B,
+ 0xD2E6, 0xD2EF, 0x432C, 0xD2F0, 0xD2F1, 0x0C6D, 0xD2F2, 0xD2F3, 0x4336,
+ 0xD2F4, 0xD2F4, 0x0C6F, 0xD2F5, 0xD2F7, 0x4338, 0xD2F8, 0xD2F8, 0x0C70,
+ 0xD2F9, 0xD2FF, 0x433B, 0xD300, 0xD301, 0x0C71, 0xD302, 0xD302, 0x4342,
+ 0xD303, 0xD303, 0x0C73, 0xD304, 0xD304, 0x4343, 0xD305, 0xD305, 0x0C74,
+ 0xD306, 0xD30B, 0x4344, 0xD30C, 0xD30E, 0x0C75, 0xD30F, 0xD30F, 0x434A,
+ 0xD310, 0xD310, 0x0C78, 0xD311, 0xD313, 0x434B, 0xD314, 0xD314, 0x0C79,
+ 0xD315, 0xD315, 0x434E, 0xD316, 0xD316, 0x0C7A, 0xD317, 0xD31B, 0x434F,
+ 0xD31C, 0xD31D, 0x0C7B, 0xD31E, 0xD31E, 0x4354, 0xD31F, 0xD321, 0x0C7D,
+ 0xD322, 0xD324, 0x4355, 0xD325, 0xD325, 0x0C80, 0xD326, 0xD327, 0x4358,
+ 0xD328, 0xD329, 0x0C81, 0xD32A, 0xD32B, 0x435A, 0xD32C, 0xD32C, 0x0C83,
+ 0xD32D, 0xD32F, 0x435C, 0xD330, 0xD330, 0x0C84, 0xD331, 0xD337, 0x435F,
+ 0xD338, 0xD339, 0x0C85, 0xD33A, 0xD33A, 0x4366, 0xD33B, 0xD33D, 0x0C87,
+ 0xD33E, 0xD343, 0x4367, 0xD344, 0xD345, 0x0C8A, 0xD346, 0xD37B, 0x436D,
+ 0xD37C, 0xD37D, 0x0C8C, 0xD37E, 0xD37F, 0x43A3, 0xD380, 0xD380, 0x0C8E,
+ 0xD381, 0xD383, 0x43A5, 0xD384, 0xD384, 0x0C8F, 0xD385, 0xD38B, 0x43A8,
+ 0xD38C, 0xD38D, 0x0C90, 0xD38E, 0xD38E, 0x43AF, 0xD38F, 0xD391, 0x0C92,
+ 0xD392, 0xD397, 0x43B0, 0xD398, 0xD399, 0x0C95, 0xD39A, 0xD39B, 0x43B6,
+ 0xD39C, 0xD39C, 0x0C97, 0xD39D, 0xD39F, 0x43B8, 0xD3A0, 0xD3A0, 0x0C98,
+ 0xD3A1, 0xD3A7, 0x43BB, 0xD3A8, 0xD3A9, 0x0C99, 0xD3AA, 0xD3AA, 0x43C2,
+ 0xD3AB, 0xD3AB, 0x0C9B, 0xD3AC, 0xD3AC, 0x43C3, 0xD3AD, 0xD3AD, 0x0C9C,
+ 0xD3AE, 0xD3B3, 0x43C4, 0xD3B4, 0xD3B4, 0x0C9D, 0xD3B5, 0xD3B7, 0x43CA,
+ 0xD3B8, 0xD3B8, 0x0C9E, 0xD3B9, 0xD3BB, 0x43CD, 0xD3BC, 0xD3BC, 0x0C9F,
+ 0xD3BD, 0xD3C3, 0x43D0, 0xD3C4, 0xD3C5, 0x0CA0, 0xD3C6, 0xD3C7, 0x43D7,
+ 0xD3C8, 0xD3C9, 0x0CA2, 0xD3CA, 0xD3CF, 0x43D9, 0xD3D0, 0xD3D0, 0x0CA4,
+ 0xD3D1, 0xD3D7, 0x43DF, 0xD3D8, 0xD3D8, 0x0CA5, 0xD3D9, 0xD3E0, 0x43E6,
+ 0xD3E1, 0xD3E1, 0x0CA6, 0xD3E2, 0xD3E2, 0x43EE, 0xD3E3, 0xD3E3, 0x0CA7,
+ 0xD3E4, 0xD3EB, 0x43EF, 0xD3EC, 0xD3ED, 0x0CA8, 0xD3EE, 0xD3EF, 0x43F7,
+ 0xD3F0, 0xD3F0, 0x0CAA, 0xD3F1, 0xD3F3, 0x43F9, 0xD3F4, 0xD3F4, 0x0CAB,
+ 0xD3F5, 0xD3FB, 0x43FC, 0xD3FC, 0xD3FD, 0x0CAC, 0xD3FE, 0xD3FE, 0x4403,
+ 0xD3FF, 0xD3FF, 0x0CAE, 0xD400, 0xD400, 0x4404, 0xD401, 0xD401, 0x0CAF,
+ 0xD402, 0xD407, 0x4405, 0xD408, 0xD408, 0x0CB0, 0xD409, 0xD41C, 0x440B,
+ 0xD41D, 0xD41D, 0x0CB1, 0xD41E, 0xD43F, 0x441F, 0xD440, 0xD440, 0x0CB2,
+ 0xD441, 0xD443, 0x4441, 0xD444, 0xD444, 0x0CB3, 0xD445, 0xD45B, 0x4444,
+ 0xD45C, 0xD45C, 0x0CB4, 0xD45D, 0xD45F, 0x445B, 0xD460, 0xD460, 0x0CB5,
+ 0xD461, 0xD463, 0x445E, 0xD464, 0xD464, 0x0CB6, 0xD465, 0xD46C, 0x4461,
+ 0xD46D, 0xD46D, 0x0CB7, 0xD46E, 0xD46E, 0x4469, 0xD46F, 0xD46F, 0x0CB8,
+ 0xD470, 0xD477, 0x446A, 0xD478, 0xD479, 0x0CB9, 0xD47A, 0xD47B, 0x4472,
+ 0xD47C, 0xD47C, 0x0CBB, 0xD47D, 0xD47E, 0x4474, 0xD47F, 0xD480, 0x0CBC,
+ 0xD481, 0xD481, 0x4476, 0xD482, 0xD482, 0x0CBE, 0xD483, 0xD487, 0x4477,
+ 0xD488, 0xD489, 0x0CBF, 0xD48A, 0xD48A, 0x447C, 0xD48B, 0xD48B, 0x0CC1,
+ 0xD48C, 0xD48C, 0x447D, 0xD48D, 0xD48D, 0x0CC2, 0xD48E, 0xD493, 0x447E,
+ 0xD494, 0xD494, 0x0CC3, 0xD495, 0xD4A8, 0x4484, 0xD4A9, 0xD4A9, 0x0CC4,
+ 0xD4AA, 0xD4CB, 0x4498, 0xD4CC, 0xD4CC, 0x0CC5, 0xD4CD, 0xD4CF, 0x44BA,
+ 0xD4D0, 0xD4D0, 0x0CC6, 0xD4D1, 0xD4D3, 0x44BD, 0xD4D4, 0xD4D4, 0x0CC7,
+ 0xD4D5, 0xD4DB, 0x44C0, 0xD4DC, 0xD4DC, 0x0CC8, 0xD4DD, 0xD4DE, 0x44C7,
+ 0xD4DF, 0xD4DF, 0x0CC9, 0xD4E0, 0xD4E7, 0x44C9, 0xD4E8, 0xD4E8, 0x0CCA,
+ 0xD4E9, 0xD4EB, 0x44D1, 0xD4EC, 0xD4EC, 0x0CCB, 0xD4ED, 0xD4EF, 0x44D4,
+ 0xD4F0, 0xD4F0, 0x0CCC, 0xD4F1, 0xD4F7, 0x44D7, 0xD4F8, 0xD4F8, 0x0CCD,
+ 0xD4F9, 0xD4FA, 0x44DE, 0xD4FB, 0xD4FB, 0x0CCE, 0xD4FC, 0xD4FC, 0x44E0,
+ 0xD4FD, 0xD4FD, 0x0CCF, 0xD4FE, 0xD4FF, 0x44E1, 0xD500, 0xD503, 0x44E3,
+ 0xD504, 0xD504, 0x0CD0, 0xD505, 0xD507, 0x44E7, 0xD508, 0xD508, 0x0CD1,
+ 0xD509, 0xD50B, 0x44EA, 0xD50C, 0xD50C, 0x0CD2, 0xD50D, 0xD513, 0x44ED,
+ 0xD514, 0xD515, 0x0CD3, 0xD516, 0xD516, 0x44F4, 0xD517, 0xD517, 0x0CD5,
+ 0xD518, 0xD53B, 0x44F5, 0xD53C, 0xD53D, 0x0CD6, 0xD53E, 0xD53F, 0x4519,
+ 0xD540, 0xD540, 0x0CD8, 0xD541, 0xD543, 0x451B, 0xD544, 0xD544, 0x0CD9,
+ 0xD545, 0xD54B, 0x451E, 0xD54C, 0xD54D, 0x0CDA, 0xD54E, 0xD54E, 0x4525,
+ 0xD54F, 0xD54F, 0x0CDC, 0xD550, 0xD550, 0x4526, 0xD551, 0xD551, 0x0CDD,
+ 0xD552, 0xD557, 0x4527, 0xD558, 0xD559, 0x0CDE, 0xD55A, 0xD55B, 0x452D,
+ 0xD55C, 0xD55C, 0x0CE0, 0xD55D, 0xD55F, 0x452F, 0xD560, 0xD560, 0x0CE1,
+ 0xD561, 0xD564, 0x4532, 0xD565, 0xD565, 0x0CE2, 0xD566, 0xD567, 0x4536,
+ 0xD568, 0xD569, 0x0CE3, 0xD56A, 0xD56A, 0x4538, 0xD56B, 0xD56B, 0x0CE5,
+ 0xD56C, 0xD56C, 0x4539, 0xD56D, 0xD56D, 0x0CE6, 0xD56E, 0xD573, 0x453A,
+ 0xD574, 0xD575, 0x0CE7, 0xD576, 0xD577, 0x4540, 0xD578, 0xD578, 0x0CE9,
+ 0xD579, 0xD57B, 0x4542, 0xD57C, 0xD57C, 0x0CEA, 0xD57D, 0xD583, 0x4545,
+ 0xD584, 0xD585, 0x0CEB, 0xD586, 0xD586, 0x454C, 0xD587, 0xD589, 0x0CED,
+ 0xD58A, 0xD58F, 0x454D, 0xD590, 0xD590, 0x0CF0, 0xD591, 0xD5A4, 0x4553,
+ 0xD5A5, 0xD5A5, 0x0CF1, 0xD5A6, 0xD5C7, 0x4567, 0xD5C8, 0xD5C9, 0x0CF2,
+ 0xD5CA, 0xD5CB, 0x4589, 0xD5CC, 0xD5CC, 0x0CF4, 0xD5CD, 0xD5CF, 0x458B,
+ 0xD5D0, 0xD5D0, 0x0CF5, 0xD5D1, 0xD5D1, 0x458E, 0xD5D2, 0xD5D2, 0x0CF6,
+ 0xD5D3, 0xD5D7, 0x458F, 0xD5D8, 0xD5D9, 0x0CF7, 0xD5DA, 0xD5DA, 0x4594,
+ 0xD5DB, 0xD5DB, 0x0CF9, 0xD5DC, 0xD5DC, 0x4595, 0xD5DD, 0xD5DD, 0x0CFA,
+ 0xD5DE, 0xD5E3, 0x4596, 0xD5E4, 0xD5E5, 0x0CFB, 0xD5E6, 0xD5E7, 0x459C,
+ 0xD5E8, 0xD5E8, 0x0CFD, 0xD5E9, 0xD5EB, 0x459E, 0xD5EC, 0xD5EC, 0x0CFE,
+ 0xD5ED, 0xD5F3, 0x45A1, 0xD5F4, 0xD5F5, 0x0CFF, 0xD5F6, 0xD5F6, 0x45A8,
+ 0xD5F7, 0xD5F7, 0x0D01, 0xD5F8, 0xD5F8, 0x45A9, 0xD5F9, 0xD5F9, 0x0D02,
+ 0xD5FA, 0xD5FF, 0x45AA, 0xD600, 0xD601, 0x0D03, 0xD602, 0xD603, 0x45B0,
+ 0xD604, 0xD604, 0x0D05, 0xD605, 0xD607, 0x45B2, 0xD608, 0xD608, 0x0D06,
+ 0xD609, 0xD60F, 0x45B5, 0xD610, 0xD611, 0x0D07, 0xD612, 0xD612, 0x45BC,
+ 0xD613, 0xD615, 0x0D09, 0xD616, 0xD61B, 0x45BD, 0xD61C, 0xD61C, 0x0D0C,
+ 0xD61D, 0xD61F, 0x45C3, 0xD620, 0xD620, 0x0D0D, 0xD621, 0xD623, 0x45C6,
+ 0xD624, 0xD624, 0x0D0E, 0xD625, 0xD62C, 0x45C9, 0xD62D, 0xD62D, 0x0D0F,
+ 0xD62E, 0xD637, 0x45D1, 0xD638, 0xD639, 0x0D10, 0xD63A, 0xD63B, 0x45DB,
+ 0xD63C, 0xD63C, 0x0D12, 0xD63D, 0xD63F, 0x45DD, 0xD640, 0xD640, 0x0D13,
+ 0xD641, 0xD644, 0x45E0, 0xD645, 0xD645, 0x0D14, 0xD646, 0xD647, 0x45E4,
+ 0xD648, 0xD649, 0x0D15, 0xD64A, 0xD64A, 0x45E6, 0xD64B, 0xD64B, 0x0D17,
+ 0xD64C, 0xD64C, 0x45E7, 0xD64D, 0xD64D, 0x0D18, 0xD64E, 0xD650, 0x45E8,
+ 0xD651, 0xD651, 0x0D19, 0xD652, 0xD653, 0x45EB, 0xD654, 0xD655, 0x0D1A,
+ 0xD656, 0xD657, 0x45ED, 0xD658, 0xD658, 0x0D1C, 0xD659, 0xD65B, 0x45EF,
+ 0xD65C, 0xD65C, 0x0D1D, 0xD65D, 0xD666, 0x45F2, 0xD667, 0xD667, 0x0D1E,
+ 0xD668, 0xD668, 0x45FC, 0xD669, 0xD669, 0x0D1F, 0xD66A, 0xD66F, 0x45FD,
+ 0xD670, 0xD671, 0x0D20, 0xD672, 0xD673, 0x4603, 0xD674, 0xD674, 0x0D22,
+ 0xD675, 0xD682, 0x4605, 0xD683, 0xD683, 0x0D23, 0xD684, 0xD684, 0x4613,
+ 0xD685, 0xD685, 0x0D24, 0xD686, 0xD68B, 0x4614, 0xD68C, 0xD68D, 0x0D25,
+ 0xD68E, 0xD68F, 0x461A, 0xD690, 0xD690, 0x0D27, 0xD691, 0xD693, 0x461C,
+ 0xD694, 0xD694, 0x0D28, 0xD695, 0xD69C, 0x461F, 0xD69D, 0xD69D, 0x0D29,
+ 0xD69E, 0xD69E, 0x4627, 0xD69F, 0xD69F, 0x0D2A, 0xD6A0, 0xD6A0, 0x4628,
+ 0xD6A1, 0xD6A1, 0x0D2B, 0xD6A2, 0xD6A7, 0x4629, 0xD6A8, 0xD6A8, 0x0D2C,
+ 0xD6A9, 0xD6AB, 0x462F, 0xD6AC, 0xD6AC, 0x0D2D, 0xD6AD, 0xD6AF, 0x4632,
+ 0xD6B0, 0xD6B0, 0x0D2E, 0xD6B1, 0xD6B8, 0x4635, 0xD6B9, 0xD6B9, 0x0D2F,
+ 0xD6BA, 0xD6BA, 0x463D, 0xD6BB, 0xD6BB, 0x0D30, 0xD6BC, 0xD6C3, 0x463E,
+ 0xD6C4, 0xD6C5, 0x0D31, 0xD6C6, 0xD6C7, 0x4646, 0xD6C8, 0xD6C8, 0x0D33,
+ 0xD6C9, 0xD6CB, 0x4648, 0xD6CC, 0xD6CC, 0x0D34, 0xD6CD, 0xD6D0, 0x464B,
+ 0xD6D1, 0xD6D1, 0x0D35, 0xD6D2, 0xD6D3, 0x464F, 0xD6D4, 0xD6D4, 0x0D36,
+ 0xD6D5, 0xD6D6, 0x4651, 0xD6D7, 0xD6D7, 0x0D37, 0xD6D8, 0xD6D8, 0x4653,
+ 0xD6D9, 0xD6D9, 0x0D38, 0xD6DA, 0xD6DF, 0x4654, 0xD6E0, 0xD6E0, 0x0D39,
+ 0xD6E1, 0xD6E3, 0x465A, 0xD6E4, 0xD6E4, 0x0D3A, 0xD6E5, 0xD6E7, 0x465D,
+ 0xD6E8, 0xD6E8, 0x0D3B, 0xD6E9, 0xD6EF, 0x4660, 0xD6F0, 0xD6F0, 0x0D3C,
+ 0xD6F1, 0xD6F4, 0x4667, 0xD6F5, 0xD6F5, 0x0D3D, 0xD6F6, 0xD6FB, 0x466B,
+ 0xD6FC, 0xD6FD, 0x0D3E, 0xD6FE, 0xD6FF, 0x4671, 0xD700, 0xD700, 0x0D40,
+ 0xD701, 0xD703, 0x4673, 0xD704, 0xD704, 0x0D41, 0xD705, 0xD710, 0x4676,
+ 0xD711, 0xD711, 0x0D42, 0xD712, 0xD717, 0x4682, 0xD718, 0xD719, 0x0D43,
+ 0xD71A, 0xD71B, 0x4688, 0xD71C, 0xD71C, 0x0D45, 0xD71D, 0xD71F, 0x468A,
+ 0xD720, 0xD720, 0x0D46, 0xD721, 0xD727, 0x468D, 0xD728, 0xD729, 0x0D47,
+ 0xD72A, 0xD72A, 0x4694, 0xD72B, 0xD72B, 0x0D49, 0xD72C, 0xD72C, 0x4695,
+ 0xD72D, 0xD72D, 0x0D4A, 0xD72E, 0xD733, 0x4696, 0xD734, 0xD735, 0x0D4B,
+ 0xD736, 0xD737, 0x469C, 0xD738, 0xD738, 0x0D4D, 0xD739, 0xD73B, 0x469E,
+ 0xD73C, 0xD73C, 0x0D4E, 0xD73D, 0xD743, 0x46A1, 0xD744, 0xD744, 0x0D4F,
+ 0xD745, 0xD746, 0x46A8, 0xD747, 0xD747, 0x0D50, 0xD748, 0xD748, 0x46AA,
+ 0xD749, 0xD749, 0x0D51, 0xD74A, 0xD74F, 0x46AB, 0xD750, 0xD751, 0x0D52,
+ 0xD752, 0xD753, 0x46B1, 0xD754, 0xD754, 0x0D54, 0xD755, 0xD755, 0x46B3,
+ 0xD756, 0xD759, 0x0D55, 0xD75A, 0xD75F, 0x46B4, 0xD760, 0xD761, 0x0D59,
+ 0xD762, 0xD762, 0x46BA, 0xD763, 0xD763, 0x0D5B, 0xD764, 0xD764, 0x46BB,
+ 0xD765, 0xD765, 0x0D5C, 0xD766, 0xD768, 0x46BC, 0xD769, 0xD769, 0x0D5D,
+ 0xD76A, 0xD76B, 0x46BF, 0xD76C, 0xD76C, 0x0D5E, 0xD76D, 0xD76F, 0x46C1,
+ 0xD770, 0xD770, 0x0D5F, 0xD771, 0xD773, 0x46C4, 0xD774, 0xD774, 0x0D60,
+ 0xD775, 0xD77B, 0x46C7, 0xD77C, 0xD77D, 0x0D61, 0xD77E, 0xD780, 0x46CE,
+ 0xD781, 0xD781, 0x0D63, 0xD782, 0xD787, 0x46D1, 0xD788, 0xD789, 0x0D64,
+ 0xD78A, 0xD78B, 0x46D7, 0xD78C, 0xD78C, 0x0D66, 0xD78D, 0xD78F, 0x46D9,
+ 0xD790, 0xD790, 0x0D67, 0xD791, 0xD797, 0x46DC, 0xD798, 0xD799, 0x0D68,
+ 0xD79A, 0xD79A, 0x46E3, 0xD79B, 0xD79B, 0x0D6A, 0xD79C, 0xD79C, 0x46E4,
+ 0xD79D, 0xD79D, 0x0D6B, 0xD79E, 0xD7A3, 0x46E5, 0xF900, 0xF900, 0x1014,
+ 0xF901, 0xF901, 0x0E5E, 0xF902, 0xF902, 0x1B8D, 0xF903, 0xF903, 0x0D84,
+ 0xF904, 0xF904, 0x1EDC, 0xF905, 0xF905, 0x0EDA, 0xF906, 0xF906, 0x0F3E,
+ 0xF907, 0xF907, 0x0F6A, 0xF908, 0xF908, 0x0F6A, 0xF909, 0xF909, 0x0E7C,
+ 0xF90A, 0xF90A, 0x1023, 0xF90B, 0xF90B, 0x1116, 0xF90C, 0xF90C, 0x103C,
+ 0xF90D, 0xF913, 0x1117, 0xF914, 0xF914, 0x16A8, 0xF915, 0xF917, 0x111E,
+ 0xF918, 0xF91D, 0x1122, 0xF91E, 0xF920, 0x112A, 0xF921, 0xF921, 0x112F,
+ 0xF922, 0xF922, 0x1133, 0xF923, 0xF924, 0x1136, 0xF925, 0xF92B, 0x1139,
+ 0xF92C, 0xF92D, 0x1143, 0xF92E, 0xF92E, 0x1148, 0xF92F, 0xF92F, 0x119F,
+ 0xF930, 0xF931, 0x11A1, 0xF932, 0xF937, 0x11A5, 0xF938, 0xF93A, 0x11AC,
+ 0xF93B, 0xF940, 0x11B0, 0xF941, 0xF943, 0x11B7, 0xF944, 0xF945, 0x11BD,
+ 0xF946, 0xF948, 0x11C1, 0xF949, 0xF949, 0x11C6, 0xF94A, 0xF94A, 0x11D4,
+ 0xF94B, 0xF94E, 0x11D6, 0xF94F, 0xF950, 0x11DB, 0xF951, 0xF951, 0x11E0,
+ 0xF952, 0xF955, 0x11FC, 0xF956, 0xF959, 0x1201, 0xF95A, 0xF95A, 0x10DE,
+ 0xF95B, 0xF95B, 0x1028, 0xF95C, 0xF95C, 0x16A8, 0xF95D, 0xF95D, 0x102B,
+ 0xF95E, 0xF95E, 0x1060, 0xF95F, 0xF95F, 0x1047, 0xF960, 0xF960, 0x104C,
+ 0xF961, 0xF961, 0x15B0, 0xF962, 0xF962, 0x1918, 0xF963, 0xF963, 0x141F,
+ 0xF964, 0xF964, 0x133A, 0xF965, 0xF965, 0x1D5E, 0xF966, 0xF966, 0x13D7,
+ 0xF967, 0xF967, 0x13F5, 0xF968, 0xF968, 0x1DB7, 0xF969, 0xF969, 0x15D0,
+ 0xF96A, 0xF96A, 0x14F7, 0xF96B, 0xF96B, 0x1BAB, 0xF96C, 0xF96C, 0x14F2,
+ 0xF96D, 0xF96D, 0x156D, 0xF96E, 0xF96E, 0x1771, 0xF96F, 0xF96F, 0x1554,
+ 0xF970, 0xF970, 0x14C5, 0xF971, 0xF971, 0x1B61, 0xF972, 0xF972, 0x1CCA,
+ 0xF973, 0xF973, 0x162E, 0xF974, 0xF974, 0x16F2, 0xF975, 0xF977, 0x1149,
+ 0xF978, 0xF97A, 0x114D, 0xF97B, 0xF97D, 0x1153, 0xF97E, 0xF97E, 0x1157,
+ 0xF97F, 0xF980, 0x115A, 0xF981, 0xF981, 0x103F, 0xF982, 0xF982, 0x115C,
+ 0xF983, 0xF983, 0x115F, 0xF984, 0xF985, 0x1161, 0xF986, 0xF986, 0x1165,
+ 0xF987, 0xF98C, 0x1167, 0xF98D, 0xF98D, 0x116F, 0xF98E, 0xF98E, 0x1040,
+ 0xF98F, 0xF990, 0x1171, 0xF991, 0xF991, 0x1041, 0xF992, 0xF994, 0x1174,
+ 0xF995, 0xF995, 0x1042, 0xF996, 0xF997, 0x1177, 0xF998, 0xF998, 0x117A,
+ 0xF999, 0xF999, 0x1179, 0xF99A, 0xF99B, 0x117B, 0xF99C, 0xF99D, 0x117E,
+ 0xF99E, 0xF99E, 0x192F, 0xF99F, 0xF9A0, 0x1181, 0xF9A1, 0xF9A1, 0x1554,
+ 0xF9A2, 0xF9A2, 0x1183, 0xF9A3, 0xF9A3, 0x1043, 0xF9A4, 0xF9A4, 0x1046,
+ 0xF9A5, 0xF9A5, 0x1185, 0xF9A6, 0xF9A8, 0x1187, 0xF9A9, 0xF9A9, 0x118B,
+ 0xF9AA, 0xF9AA, 0x1047, 0xF9AB, 0xF9AD, 0x118D, 0xF9AE, 0xF9AE, 0x1E67,
+ 0xF9AF, 0xF9AF, 0x1191, 0xF9B0, 0xF9B0, 0x1193, 0xF9B1, 0xF9B4, 0x1195,
+ 0xF9B5, 0xF9B5, 0x119A, 0xF9B6, 0xF9B8, 0x119C, 0xF9B9, 0xF9B9, 0x16A5,
+ 0xF9BA, 0xF9BC, 0x11C7, 0xF9BD, 0xF9BD, 0x1054, 0xF9BE, 0xF9BE, 0x11CB,
+ 0xF9BF, 0xF9BF, 0x16A8, 0xF9C0, 0xF9C1, 0x11CC, 0xF9C2, 0xF9C3, 0x11D0,
+ 0xF9C4, 0xF9C4, 0x11D3, 0xF9C5, 0xF9C5, 0x1F34, 0xF9C6, 0xF9C6, 0x17EB,
+ 0xF9C7, 0xF9C7, 0x11E1, 0xF9C8, 0xF9C8, 0x1057, 0xF9C9, 0xF9C9, 0x11E3,
+ 0xF9CA, 0xF9CB, 0x11E5, 0xF9CC, 0xF9CC, 0x11E8, 0xF9CD, 0xF9CD, 0x11EA,
+ 0xF9CE, 0xF9CE, 0x11EC, 0xF9CF, 0xF9CF, 0x1058, 0xF9D0, 0xF9D3, 0x11EE,
+ 0xF9D4, 0xF9D6, 0x11F3, 0xF9D7, 0xF9DA, 0x11F7, 0xF9DB, 0xF9DB, 0x15B0,
+ 0xF9DC, 0xF9DC, 0x11FB, 0xF9DD, 0xF9DD, 0x1206, 0xF9DE, 0xF9DE, 0x1208,
+ 0xF9DF, 0xF9DF, 0x120A, 0xF9E0, 0xF9E0, 0x173E, 0xF9E1, 0xF9E2, 0x120C,
+ 0xF9E3, 0xF9E3, 0x105B, 0xF9E4, 0xF9E4, 0x1211, 0xF9E5, 0xF9E5, 0x1213,
+ 0xF9E6, 0xF9E6, 0x1215, 0xF9E7, 0xF9E9, 0x1218, 0xF9EA, 0xF9EA, 0x121C,
+ 0xF9EB, 0xF9EC, 0x105C, 0xF9ED, 0xF9ED, 0x121E, 0xF9EE, 0xF9F0, 0x1220,
+ 0xF9F1, 0xF9F5, 0x1224, 0xF9F6, 0xF9F6, 0x122A, 0xF9F7, 0xF9F9, 0x122D,
+ 0xF9FA, 0xF9FA, 0x14E7, 0xF9FB, 0xF9FB, 0x195E, 0xF9FC, 0xF9FC, 0x1663,
+ 0xF9FD, 0xF9FD, 0x168B, 0xF9FE, 0xF9FE, 0x105F, 0xF9FF, 0xF9FF, 0x1954,
+ 0xFA00, 0xFA00, 0x1A1C, 0xFA01, 0xFA01, 0x10B7, 0xFA02, 0xFA02, 0x1BE3,
+ 0xFA03, 0xFA03, 0x1097, 0xFA04, 0xFA04, 0x10AA, 0xFA05, 0xFA05, 0x10F4,
+ 0xFA06, 0xFA06, 0x1D94, 0xFA07, 0xFA07, 0x13E0, 0xFA08, 0xFA08, 0x1E1D,
+ 0xFA09, 0xFA09, 0x0DE6, 0xFA0A, 0xFA0A, 0x0E3C, 0xFA0B, 0xFA0B, 0x0EE7,
+ 0xFF01, 0xFF3B, 0x0108, 0xFF3C, 0xFF3C, 0x0070, 0xFF3D, 0xFF5D, 0x0144,
+ 0xFF5E, 0xFF5E, 0x0071, 0xFFE0, 0xFFE1, 0x008F, 0xFFE2, 0xFFE2, 0x00C2,
+ 0xFFE3, 0xFFE3, 0x0165, 0xFFE5, 0xFFE5, 0x0091, 0xFFE6, 0xFFE6, 0x0143,
+};
diff --git a/core/src/fpdfapi/fpdf_cmaps/Korea1/UniKS-UTF16-H_0.cpp b/core/src/fpdfapi/fpdf_cmaps/Korea1/UniKS-UTF16-H_0.cpp
index 1154f553eb..c977e86f98 100644
--- a/core/src/fpdfapi/fpdf_cmaps/Korea1/UniKS-UTF16-H_0.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/Korea1/UniKS-UTF16-H_0.cpp
@@ -1,48 +1,48 @@
-// 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
-
-extern const unsigned short g_FXCMAP_UniKS_UTF16_H_0[158 * 2] = {
- 0x00A9, 0x0062, 0x2010, 0x0061, 0x20A9, 0x0060, 0x2F00, 0x193C,
- 0x2F04, 0x18EC, 0x2F06, 0x190D, 0x2F08, 0x192B, 0x2F0A, 0x194D,
- 0x2F0B, 0x1D4B, 0x2F11, 0x10AE, 0x2F12, 0x116A, 0x2F14, 0x143F,
- 0x2F17, 0x168C, 0x2F18, 0x13D5, 0x2F1C, 0x1839, 0x2F1D, 0x0F3D,
- 0x2F1F, 0x1D1B, 0x2F20, 0x1487, 0x2F23, 0x151B, 0x2F24, 0x109D,
- 0x2F25, 0x103F, 0x2F26, 0x1958, 0x2F28, 0x1C4F, 0x2F29, 0x1580,
- 0x2F2B, 0x1641, 0x2F2D, 0x14B9, 0x2F2F, 0x0ECF, 0x2F30, 0x0FED,
- 0x2F31, 0x0E14, 0x2F32, 0x0D99, 0x2F38, 0x0F7C, 0x2F3C, 0x1684,
- 0x2F3D, 0x0EDC, 0x2F3E, 0x1E80, 0x2F3F, 0x15CC, 0x2F40, 0x1B27,
- 0x2F42, 0x12E8, 0x2F43, 0x10FD, 0x2F44, 0x0FBB, 0x2F45, 0x1356,
- 0x2F46, 0x12D3, 0x2F47, 0x1940, 0x2F48, 0x17ED, 0x2F49, 0x1889,
- 0x2F4A, 0x12B4, 0x2F4B, 0x1F5B, 0x2F4C, 0x1B2C, 0x2F4F, 0x12D6,
- 0x2F50, 0x144C, 0x2F51, 0x12A8, 0x2F52, 0x168E, 0x2F54, 0x15D3,
- 0x2F55, 0x1EBB, 0x2F56, 0x1A93, 0x2F57, 0x1409, 0x2F58, 0x1F1A,
- 0x2F5A, 0x1D61, 0x2F5B, 0x1696, 0x2F5C, 0x1842, 0x2F5D, 0x0E37,
- 0x2F5E, 0x1E3D, 0x2F5F, 0x17C1, 0x2F60, 0x0EDE, 0x2F61, 0x17D4,
- 0x2F62, 0x0DC1, 0x2F63, 0x14FA, 0x2F64, 0x182D, 0x2F65, 0x1A08,
- 0x2F66, 0x1DBA, 0x2F69, 0x1381, 0x2F6A, 0x1DB0, 0x2F6B, 0x1293,
- 0x2F6C, 0x12B7, 0x2F6D, 0x12AD, 0x2F6E, 0x164D, 0x2F6F, 0x1525,
- 0x2F70, 0x164E, 0x2F72, 0x1EBE, 0x2F73, 0x1E4B, 0x2F74, 0x122D,
- 0x2F75, 0x1AF4, 0x2F76, 0x12FF, 0x2F78, 0x140C, 0x2F7A, 0x1708,
- 0x2F7B, 0x184A, 0x2F7C, 0x11A7, 0x2F7D, 0x191B, 0x2F7F, 0x191C,
- 0x2F80, 0x18E0, 0x2F81, 0x18D5, 0x2F82, 0x1675, 0x2F83, 0x1966,
- 0x2F84, 0x1B37, 0x2F85, 0x0F5A, 0x2F86, 0x1550, 0x2F87, 0x1BF6,
- 0x2F88, 0x1AE8, 0x2F89, 0x0DA8, 0x2F8A, 0x14F8, 0x2F8B, 0x1C40,
- 0x2F8E, 0x1E4C, 0x2F8F, 0x1E1D, 0x2F90, 0x1909, 0x2F92, 0x0E3C,
- 0x2F93, 0x0D92, 0x2F94, 0x1721, 0x2F95, 0x0EBC, 0x2F96, 0x1103,
- 0x2F97, 0x1656, 0x2F99, 0x1D58, 0x2F9A, 0x19EC, 0x2F9B, 0x1AEC,
- 0x2F9C, 0x1AAE, 0x2F9D, 0x167B, 0x2F9E, 0x1B8D, 0x2F9F, 0x167C,
- 0x2FA0, 0x1B61, 0x2FA2, 0x18F5, 0x2FA3, 0x18D0, 0x2FA5, 0x121A,
- 0x2FA6, 0x1023, 0x2FA7, 0x19A8, 0x2FA8, 0x12EE, 0x2FA9, 0x141B,
- 0x2FAC, 0x1853, 0x2FAD, 0x1C23, 0x2FAE, 0x1464, 0x2FAF, 0x1288,
- 0x2FB0, 0x1E35, 0x2FB1, 0x18A3, 0x2FB3, 0x18F1, 0x2FB4, 0x1E4D,
- 0x2FB5, 0x1DAB, 0x2FB6, 0x1465, 0x2FB7, 0x1665, 0x2FB8, 0x15F9,
- 0x2FB9, 0x1E26, 0x2FBA, 0x1235, 0x2FBB, 0x0EC9, 0x2FBC, 0x0EB5,
- 0x2FC1, 0x0F99, 0x2FC2, 0x1716, 0x2FC3, 0x1AAB, 0x2FC4, 0x11AF,
- 0x2FC5, 0x11B5, 0x2FC6, 0x1276, 0x2FC7, 0x1237, 0x2FC8, 0x1EF7,
- 0x2FC9, 0x1519, 0x2FCA, 0x1F52, 0x2FCD, 0x1A66, 0x2FCE, 0x0EB6,
- 0x2FCF, 0x151A, 0x2FD0, 0x1466, 0x2FD1, 0x1A7D, 0x2FD2, 0x1CBF,
- 0x2FD3, 0x11D3, 0x2FD4, 0x0F6A,
-};
+// 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
+
+extern const unsigned short g_FXCMAP_UniKS_UTF16_H_0[158 * 2] = {
+ 0x00A9, 0x0062, 0x2010, 0x0061, 0x20A9, 0x0060, 0x2F00, 0x193C,
+ 0x2F04, 0x18EC, 0x2F06, 0x190D, 0x2F08, 0x192B, 0x2F0A, 0x194D,
+ 0x2F0B, 0x1D4B, 0x2F11, 0x10AE, 0x2F12, 0x116A, 0x2F14, 0x143F,
+ 0x2F17, 0x168C, 0x2F18, 0x13D5, 0x2F1C, 0x1839, 0x2F1D, 0x0F3D,
+ 0x2F1F, 0x1D1B, 0x2F20, 0x1487, 0x2F23, 0x151B, 0x2F24, 0x109D,
+ 0x2F25, 0x103F, 0x2F26, 0x1958, 0x2F28, 0x1C4F, 0x2F29, 0x1580,
+ 0x2F2B, 0x1641, 0x2F2D, 0x14B9, 0x2F2F, 0x0ECF, 0x2F30, 0x0FED,
+ 0x2F31, 0x0E14, 0x2F32, 0x0D99, 0x2F38, 0x0F7C, 0x2F3C, 0x1684,
+ 0x2F3D, 0x0EDC, 0x2F3E, 0x1E80, 0x2F3F, 0x15CC, 0x2F40, 0x1B27,
+ 0x2F42, 0x12E8, 0x2F43, 0x10FD, 0x2F44, 0x0FBB, 0x2F45, 0x1356,
+ 0x2F46, 0x12D3, 0x2F47, 0x1940, 0x2F48, 0x17ED, 0x2F49, 0x1889,
+ 0x2F4A, 0x12B4, 0x2F4B, 0x1F5B, 0x2F4C, 0x1B2C, 0x2F4F, 0x12D6,
+ 0x2F50, 0x144C, 0x2F51, 0x12A8, 0x2F52, 0x168E, 0x2F54, 0x15D3,
+ 0x2F55, 0x1EBB, 0x2F56, 0x1A93, 0x2F57, 0x1409, 0x2F58, 0x1F1A,
+ 0x2F5A, 0x1D61, 0x2F5B, 0x1696, 0x2F5C, 0x1842, 0x2F5D, 0x0E37,
+ 0x2F5E, 0x1E3D, 0x2F5F, 0x17C1, 0x2F60, 0x0EDE, 0x2F61, 0x17D4,
+ 0x2F62, 0x0DC1, 0x2F63, 0x14FA, 0x2F64, 0x182D, 0x2F65, 0x1A08,
+ 0x2F66, 0x1DBA, 0x2F69, 0x1381, 0x2F6A, 0x1DB0, 0x2F6B, 0x1293,
+ 0x2F6C, 0x12B7, 0x2F6D, 0x12AD, 0x2F6E, 0x164D, 0x2F6F, 0x1525,
+ 0x2F70, 0x164E, 0x2F72, 0x1EBE, 0x2F73, 0x1E4B, 0x2F74, 0x122D,
+ 0x2F75, 0x1AF4, 0x2F76, 0x12FF, 0x2F78, 0x140C, 0x2F7A, 0x1708,
+ 0x2F7B, 0x184A, 0x2F7C, 0x11A7, 0x2F7D, 0x191B, 0x2F7F, 0x191C,
+ 0x2F80, 0x18E0, 0x2F81, 0x18D5, 0x2F82, 0x1675, 0x2F83, 0x1966,
+ 0x2F84, 0x1B37, 0x2F85, 0x0F5A, 0x2F86, 0x1550, 0x2F87, 0x1BF6,
+ 0x2F88, 0x1AE8, 0x2F89, 0x0DA8, 0x2F8A, 0x14F8, 0x2F8B, 0x1C40,
+ 0x2F8E, 0x1E4C, 0x2F8F, 0x1E1D, 0x2F90, 0x1909, 0x2F92, 0x0E3C,
+ 0x2F93, 0x0D92, 0x2F94, 0x1721, 0x2F95, 0x0EBC, 0x2F96, 0x1103,
+ 0x2F97, 0x1656, 0x2F99, 0x1D58, 0x2F9A, 0x19EC, 0x2F9B, 0x1AEC,
+ 0x2F9C, 0x1AAE, 0x2F9D, 0x167B, 0x2F9E, 0x1B8D, 0x2F9F, 0x167C,
+ 0x2FA0, 0x1B61, 0x2FA2, 0x18F5, 0x2FA3, 0x18D0, 0x2FA5, 0x121A,
+ 0x2FA6, 0x1023, 0x2FA7, 0x19A8, 0x2FA8, 0x12EE, 0x2FA9, 0x141B,
+ 0x2FAC, 0x1853, 0x2FAD, 0x1C23, 0x2FAE, 0x1464, 0x2FAF, 0x1288,
+ 0x2FB0, 0x1E35, 0x2FB1, 0x18A3, 0x2FB3, 0x18F1, 0x2FB4, 0x1E4D,
+ 0x2FB5, 0x1DAB, 0x2FB6, 0x1465, 0x2FB7, 0x1665, 0x2FB8, 0x15F9,
+ 0x2FB9, 0x1E26, 0x2FBA, 0x1235, 0x2FBB, 0x0EC9, 0x2FBC, 0x0EB5,
+ 0x2FC1, 0x0F99, 0x2FC2, 0x1716, 0x2FC3, 0x1AAB, 0x2FC4, 0x11AF,
+ 0x2FC5, 0x11B5, 0x2FC6, 0x1276, 0x2FC7, 0x1237, 0x2FC8, 0x1EF7,
+ 0x2FC9, 0x1519, 0x2FCA, 0x1F52, 0x2FCD, 0x1A66, 0x2FCE, 0x0EB6,
+ 0x2FCF, 0x151A, 0x2FD0, 0x1466, 0x2FD1, 0x1A7D, 0x2FD2, 0x1CBF,
+ 0x2FD3, 0x11D3, 0x2FD4, 0x0F6A,
+};
diff --git a/core/src/fpdfapi/fpdf_cmaps/cmap_int.h b/core/src/fpdfapi/fpdf_cmaps/cmap_int.h
index 2ce1522dd0..c7dcfc9bf1 100644
--- a/core/src/fpdfapi/fpdf_cmaps/cmap_int.h
+++ b/core/src/fpdfapi/fpdf_cmaps/cmap_int.h
@@ -1,20 +1,20 @@
-// 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 _FPDFAPI_CMAP_INT_H_
-#define _FPDFAPI_CMAP_INT_H_
-struct FXCMAP_CMap {
- typedef enum { None, Single, Range, Reverse } MapType;
- const char* m_Name;
- MapType m_WordMapType;
- const FX_WORD* m_pWordMap;
- int m_WordCount;
- MapType m_DWordMapType;
- const FX_WORD* m_pDWordMap;
- int m_DWordCount;
- int m_UseOffset;
-};
-#endif
+// 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 _FPDFAPI_CMAP_INT_H_
+#define _FPDFAPI_CMAP_INT_H_
+struct FXCMAP_CMap {
+ typedef enum { None, Single, Range, Reverse } MapType;
+ const char* m_Name;
+ MapType m_WordMapType;
+ const FX_WORD* m_pWordMap;
+ int m_WordCount;
+ MapType m_DWordMapType;
+ const FX_WORD* m_pDWordMap;
+ int m_DWordCount;
+ int m_UseOffset;
+};
+#endif
diff --git a/core/src/fpdfapi/fpdf_cmaps/fpdf_cmaps.cpp b/core/src/fpdfapi/fpdf_cmaps/fpdf_cmaps.cpp
index 9ab324b666..afa5131f66 100644
--- a/core/src/fpdfapi/fpdf_cmaps/fpdf_cmaps.cpp
+++ b/core/src/fpdfapi/fpdf_cmaps/fpdf_cmaps.cpp
@@ -1,183 +1,183 @@
-// 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
-
-#include "../../../include/fpdfapi/fpdf_resource.h"
-#include "../../../include/fpdfapi/fpdf_module.h"
-#include "../fpdf_font/font_int.h"
-#include "cmap_int.h"
-void FPDFAPI_FindEmbeddedCMap(const char* name, int charset, int coding, const FXCMAP_CMap*& pMap)
-{
- pMap = NULL;
- CPDF_FontGlobals* pFontGlobals = CPDF_ModuleMgr::Get()->GetPageModule()->GetFontGlobals();
- const FXCMAP_CMap* pCMaps = pFontGlobals->m_EmbeddedCharsets[charset].m_pMapList;
- int nCMaps = pFontGlobals->m_EmbeddedCharsets[charset].m_Count;
- for (int i = 0; i < nCMaps; i ++) {
- if (FXSYS_strcmp(name, pCMaps[i].m_Name)) {
- continue;
- }
- pMap = &pCMaps[i];
- break;
- }
-}
-extern "C" {
- static int compareWord(const void* p1, const void* p2)
- {
- return (*(FX_WORD*)p1) - (*(FX_WORD*)p2);
- }
-};
-extern "C" {
- static int compareWordRange(const void* key, const void* element)
- {
- if (*(FX_WORD*)key < * (FX_WORD*)element) {
- return -1;
- }
- if (*(FX_WORD*)key > ((FX_WORD*)element)[1]) {
- return 1;
- }
- return 0;
- }
-};
-extern "C" {
- static int compareDWordRange(const void* p1, const void* p2)
- {
- FX_DWORD key = *(FX_DWORD*)p1;
- FX_WORD hiword = (FX_WORD)(key >> 16);
- FX_WORD* element = (FX_WORD*)p2;
- if (hiword < element[0]) {
- return -1;
- }
- if (hiword > element[0]) {
- return 1;
- }
- FX_WORD loword = (FX_WORD)key;
- if (loword < element[1]) {
- return -1;
- }
- if (loword > element[2]) {
- return 1;
- }
- return 0;
- }
-};
-extern "C" {
- static int compareDWordSingle(const void* p1, const void* p2)
- {
- FX_DWORD key = *(FX_DWORD*)p1;
- FX_DWORD value = ((*(FX_WORD*)p2) << 16) | ((FX_WORD*)p2)[1];
- if (key < value) {
- return -1;
- }
- if (key > value) {
- return 1;
- }
- return 0;
- }
-};
-FX_WORD FPDFAPI_CIDFromCharCode(const FXCMAP_CMap* pMap, FX_DWORD charcode)
-{
- if (charcode >> 16) {
- while (1) {
- if (pMap->m_DWordMapType == FXCMAP_CMap::Range) {
- FX_WORD* found = (FX_WORD*)FXSYS_bsearch(&charcode, pMap->m_pDWordMap, pMap->m_DWordCount, 8, compareDWordRange);
- if (found) {
- return found[3] + (FX_WORD)charcode - found[1];
- }
- } else if (pMap->m_DWordMapType == FXCMAP_CMap::Single) {
- FX_WORD* found = (FX_WORD*)FXSYS_bsearch(&charcode, pMap->m_pDWordMap, pMap->m_DWordCount, 6, compareDWordSingle);
- if (found) {
- return found[2];
- }
- }
- if (pMap->m_UseOffset == 0) {
- return 0;
- }
- pMap = pMap + pMap->m_UseOffset;
- }
- return 0;
- }
- FX_WORD code = (FX_WORD)charcode;
- while (1) {
- if (pMap->m_pWordMap == NULL) {
- return 0;
- }
- if (pMap->m_WordMapType == FXCMAP_CMap::Single) {
- FX_WORD* found = (FX_WORD*)FXSYS_bsearch(&code, pMap->m_pWordMap, pMap->m_WordCount, 4, compareWord);
- if (found) {
- return found[1];
- }
- } else if (pMap->m_WordMapType == FXCMAP_CMap::Range) {
- FX_WORD* found = (FX_WORD*)FXSYS_bsearch(&code, pMap->m_pWordMap, pMap->m_WordCount, 6, compareWordRange);
- if (found) {
- return found[2] + code - found[0];
- }
- }
- if (pMap->m_UseOffset == 0) {
- return 0;
- }
- pMap = pMap + pMap->m_UseOffset;
- }
- return 0;
-}
-FX_DWORD FPDFAPI_CharCodeFromCID(const FXCMAP_CMap* pMap, FX_WORD cid)
-{
- while (1) {
- if (pMap->m_WordMapType == FXCMAP_CMap::Single) {
- const FX_WORD *pCur = pMap->m_pWordMap;
- const FX_WORD *pEnd = pMap->m_pWordMap + pMap->m_WordCount * 2;
- while (pCur < pEnd) {
- if (pCur[1] == cid) {
- return pCur[0];
- }
- pCur += 2;
- }
- } else if (pMap->m_WordMapType == FXCMAP_CMap::Range) {
- const FX_WORD *pCur = pMap->m_pWordMap;
- const FX_WORD *pEnd = pMap->m_pWordMap + pMap->m_WordCount * 3;
- while (pCur < pEnd) {
- if (cid >= pCur[2] && cid <= pCur[2] + pCur[1] - pCur[0]) {
- return pCur[0] + cid - pCur[2];
- }
- pCur += 3;
- }
- }
- if (pMap->m_UseOffset == 0) {
- return 0;
- }
- pMap = pMap + pMap->m_UseOffset;
- }
- while (1) {
- if (pMap->m_DWordMapType == FXCMAP_CMap::Range) {
- const FX_WORD *pCur = pMap->m_pDWordMap;
- const FX_WORD *pEnd = pMap->m_pDWordMap + pMap->m_DWordCount * 4;
- while (pCur < pEnd) {
- if (cid >= pCur[3] && cid <= pCur[3] + pCur[2] - pCur[1]) {
- return (((FX_DWORD)pCur[0] << 16) | pCur[1]) + cid - pCur[3];
- }
- pCur += 4;
- }
- } else if (pMap->m_DWordMapType == FXCMAP_CMap::Single) {
- const FX_WORD *pCur = pMap->m_pDWordMap;
- const FX_WORD *pEnd = pMap->m_pDWordMap + pMap->m_DWordCount * 3;
- while (pCur < pEnd) {
- if (pCur[2] == cid) {
- return ((FX_DWORD)pCur[0] << 16) | pCur[1];
- }
- pCur += 3;
- }
- }
- if (pMap->m_UseOffset == 0) {
- return 0;
- }
- pMap = pMap + pMap->m_UseOffset;
- }
- return 0;
-}
-void FPDFAPI_LoadCID2UnicodeMap(int charset, const FX_WORD*& pMap, FX_DWORD& count)
-{
- CPDF_FontGlobals* pFontGlobals = CPDF_ModuleMgr::Get()->GetPageModule()->GetFontGlobals();
- pMap = pFontGlobals->m_EmbeddedToUnicodes[charset].m_pMap;
- count = pFontGlobals->m_EmbeddedToUnicodes[charset].m_Count;
-}
+// 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
+
+#include "../../../include/fpdfapi/fpdf_resource.h"
+#include "../../../include/fpdfapi/fpdf_module.h"
+#include "../fpdf_font/font_int.h"
+#include "cmap_int.h"
+void FPDFAPI_FindEmbeddedCMap(const char* name, int charset, int coding, const FXCMAP_CMap*& pMap)
+{
+ pMap = NULL;
+ CPDF_FontGlobals* pFontGlobals = CPDF_ModuleMgr::Get()->GetPageModule()->GetFontGlobals();
+ const FXCMAP_CMap* pCMaps = pFontGlobals->m_EmbeddedCharsets[charset].m_pMapList;
+ int nCMaps = pFontGlobals->m_EmbeddedCharsets[charset].m_Count;
+ for (int i = 0; i < nCMaps; i ++) {
+ if (FXSYS_strcmp(name, pCMaps[i].m_Name)) {
+ continue;
+ }
+ pMap = &pCMaps[i];
+ break;
+ }
+}
+extern "C" {
+ static int compareWord(const void* p1, const void* p2)
+ {
+ return (*(FX_WORD*)p1) - (*(FX_WORD*)p2);
+ }
+};
+extern "C" {
+ static int compareWordRange(const void* key, const void* element)
+ {
+ if (*(FX_WORD*)key < * (FX_WORD*)element) {
+ return -1;
+ }
+ if (*(FX_WORD*)key > ((FX_WORD*)element)[1]) {
+ return 1;
+ }
+ return 0;
+ }
+};
+extern "C" {
+ static int compareDWordRange(const void* p1, const void* p2)
+ {
+ FX_DWORD key = *(FX_DWORD*)p1;
+ FX_WORD hiword = (FX_WORD)(key >> 16);
+ FX_WORD* element = (FX_WORD*)p2;
+ if (hiword < element[0]) {
+ return -1;
+ }
+ if (hiword > element[0]) {
+ return 1;
+ }
+ FX_WORD loword = (FX_WORD)key;
+ if (loword < element[1]) {
+ return -1;
+ }
+ if (loword > element[2]) {
+ return 1;
+ }
+ return 0;
+ }
+};
+extern "C" {
+ static int compareDWordSingle(const void* p1, const void* p2)
+ {
+ FX_DWORD key = *(FX_DWORD*)p1;
+ FX_DWORD value = ((*(FX_WORD*)p2) << 16) | ((FX_WORD*)p2)[1];
+ if (key < value) {
+ return -1;
+ }
+ if (key > value) {
+ return 1;
+ }
+ return 0;
+ }
+};
+FX_WORD FPDFAPI_CIDFromCharCode(const FXCMAP_CMap* pMap, FX_DWORD charcode)
+{
+ if (charcode >> 16) {
+ while (1) {
+ if (pMap->m_DWordMapType == FXCMAP_CMap::Range) {
+ FX_WORD* found = (FX_WORD*)FXSYS_bsearch(&charcode, pMap->m_pDWordMap, pMap->m_DWordCount, 8, compareDWordRange);
+ if (found) {
+ return found[3] + (FX_WORD)charcode - found[1];
+ }
+ } else if (pMap->m_DWordMapType == FXCMAP_CMap::Single) {
+ FX_WORD* found = (FX_WORD*)FXSYS_bsearch(&charcode, pMap->m_pDWordMap, pMap->m_DWordCount, 6, compareDWordSingle);
+ if (found) {
+ return found[2];
+ }
+ }
+ if (pMap->m_UseOffset == 0) {
+ return 0;
+ }
+ pMap = pMap + pMap->m_UseOffset;
+ }
+ return 0;
+ }
+ FX_WORD code = (FX_WORD)charcode;
+ while (1) {
+ if (pMap->m_pWordMap == NULL) {
+ return 0;
+ }
+ if (pMap->m_WordMapType == FXCMAP_CMap::Single) {
+ FX_WORD* found = (FX_WORD*)FXSYS_bsearch(&code, pMap->m_pWordMap, pMap->m_WordCount, 4, compareWord);
+ if (found) {
+ return found[1];
+ }
+ } else if (pMap->m_WordMapType == FXCMAP_CMap::Range) {
+ FX_WORD* found = (FX_WORD*)FXSYS_bsearch(&code, pMap->m_pWordMap, pMap->m_WordCount, 6, compareWordRange);
+ if (found) {
+ return found[2] + code - found[0];
+ }
+ }
+ if (pMap->m_UseOffset == 0) {
+ return 0;
+ }
+ pMap = pMap + pMap->m_UseOffset;
+ }
+ return 0;
+}
+FX_DWORD FPDFAPI_CharCodeFromCID(const FXCMAP_CMap* pMap, FX_WORD cid)
+{
+ while (1) {
+ if (pMap->m_WordMapType == FXCMAP_CMap::Single) {
+ const FX_WORD *pCur = pMap->m_pWordMap;
+ const FX_WORD *pEnd = pMap->m_pWordMap + pMap->m_WordCount * 2;
+ while (pCur < pEnd) {
+ if (pCur[1] == cid) {
+ return pCur[0];
+ }
+ pCur += 2;
+ }
+ } else if (pMap->m_WordMapType == FXCMAP_CMap::Range) {
+ const FX_WORD *pCur = pMap->m_pWordMap;
+ const FX_WORD *pEnd = pMap->m_pWordMap + pMap->m_WordCount * 3;
+ while (pCur < pEnd) {
+ if (cid >= pCur[2] && cid <= pCur[2] + pCur[1] - pCur[0]) {
+ return pCur[0] + cid - pCur[2];
+ }
+ pCur += 3;
+ }
+ }
+ if (pMap->m_UseOffset == 0) {
+ return 0;
+ }
+ pMap = pMap + pMap->m_UseOffset;
+ }
+ while (1) {
+ if (pMap->m_DWordMapType == FXCMAP_CMap::Range) {
+ const FX_WORD *pCur = pMap->m_pDWordMap;
+ const FX_WORD *pEnd = pMap->m_pDWordMap + pMap->m_DWordCount * 4;
+ while (pCur < pEnd) {
+ if (cid >= pCur[3] && cid <= pCur[3] + pCur[2] - pCur[1]) {
+ return (((FX_DWORD)pCur[0] << 16) | pCur[1]) + cid - pCur[3];
+ }
+ pCur += 4;
+ }
+ } else if (pMap->m_DWordMapType == FXCMAP_CMap::Single) {
+ const FX_WORD *pCur = pMap->m_pDWordMap;
+ const FX_WORD *pEnd = pMap->m_pDWordMap + pMap->m_DWordCount * 3;
+ while (pCur < pEnd) {
+ if (pCur[2] == cid) {
+ return ((FX_DWORD)pCur[0] << 16) | pCur[1];
+ }
+ pCur += 3;
+ }
+ }
+ if (pMap->m_UseOffset == 0) {
+ return 0;
+ }
+ pMap = pMap + pMap->m_UseOffset;
+ }
+ return 0;
+}
+void FPDFAPI_LoadCID2UnicodeMap(int charset, const FX_WORD*& pMap, FX_DWORD& count)
+{
+ CPDF_FontGlobals* pFontGlobals = CPDF_ModuleMgr::Get()->GetPageModule()->GetFontGlobals();
+ pMap = pFontGlobals->m_EmbeddedToUnicodes[charset].m_pMap;
+ count = pFontGlobals->m_EmbeddedToUnicodes[charset].m_Count;
+}
diff --git a/core/src/fpdfapi/fpdf_edit/editint.h b/core/src/fpdfapi/fpdf_edit/editint.h
index bceba1a745..6346f06136 100644
--- a/core/src/fpdfapi/fpdf_edit/editint.h
+++ b/core/src/fpdfapi/fpdf_edit/editint.h
@@ -1,59 +1,59 @@
-// 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 _FPDF_EDITINT_
-#define _FPDF_EDITINT_
-class CPDF_ObjectStream : public CFX_Object
-{
-public:
- CPDF_ObjectStream();
-
- FX_BOOL Start();
-
- FX_INT32 CompressIndirectObject(FX_DWORD dwObjNum, const CPDF_Object *pObj);
- FX_INT32 CompressIndirectObject(FX_DWORD dwObjNum, FX_LPCBYTE pBuffer, FX_DWORD dwSize);
-
- FX_FILESIZE End(CPDF_Creator* pCreator);
-
- CFX_DWordArray m_ObjNumArray;
-
- CFX_ByteTextBuf m_Buffer;
- FX_DWORD m_dwObjNum;
- FX_INT32 m_index;
-protected:
-
- CFX_DWordArray m_OffsetArray;
-};
-class CPDF_XRefStream : public CFX_Object
-{
-public:
-
- CPDF_XRefStream();
-
- FX_BOOL Start();
-
- FX_INT32 CompressIndirectObject(FX_DWORD dwObjNum, const CPDF_Object *pObj, CPDF_Creator *pCreator);
-
- FX_INT32 CompressIndirectObject(FX_DWORD dwObjNum, FX_LPCBYTE pBuffer, FX_DWORD dwSize, CPDF_Creator *pCreator);
-
- FX_BOOL End(CPDF_Creator *pCreator, FX_BOOL bEOF = FALSE);
- FX_BOOL AddObjectNumberToIndexArray(FX_DWORD objnum);
- FX_BOOL EndXRefStream(CPDF_Creator* pCreator);
-
-
- CFX_DWordArray m_IndexArray;
-
- FX_FILESIZE m_PrevOffset;
- FX_DWORD m_dwTempObjNum;
-
-protected:
- FX_INT32 EndObjectStream(CPDF_Creator *pCreator, FX_BOOL bEOF = TRUE);
- FX_BOOL GenerateXRefStream(CPDF_Creator* pCreator, FX_BOOL bEOF);
- FX_INT32 m_iSeg;
- CPDF_ObjectStream m_ObjStream;
- CFX_ByteTextBuf m_Buffer;
-};
-#endif
+// 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 _FPDF_EDITINT_
+#define _FPDF_EDITINT_
+class CPDF_ObjectStream : public CFX_Object
+{
+public:
+ CPDF_ObjectStream();
+
+ FX_BOOL Start();
+
+ FX_INT32 CompressIndirectObject(FX_DWORD dwObjNum, const CPDF_Object *pObj);
+ FX_INT32 CompressIndirectObject(FX_DWORD dwObjNum, FX_LPCBYTE pBuffer, FX_DWORD dwSize);
+
+ FX_FILESIZE End(CPDF_Creator* pCreator);
+
+ CFX_DWordArray m_ObjNumArray;
+
+ CFX_ByteTextBuf m_Buffer;
+ FX_DWORD m_dwObjNum;
+ FX_INT32 m_index;
+protected:
+
+ CFX_DWordArray m_OffsetArray;
+};
+class CPDF_XRefStream : public CFX_Object
+{
+public:
+
+ CPDF_XRefStream();
+
+ FX_BOOL Start();
+
+ FX_INT32 CompressIndirectObject(FX_DWORD dwObjNum, const CPDF_Object *pObj, CPDF_Creator *pCreator);
+
+ FX_INT32 CompressIndirectObject(FX_DWORD dwObjNum, FX_LPCBYTE pBuffer, FX_DWORD dwSize, CPDF_Creator *pCreator);
+
+ FX_BOOL End(CPDF_Creator *pCreator, FX_BOOL bEOF = FALSE);
+ FX_BOOL AddObjectNumberToIndexArray(FX_DWORD objnum);
+ FX_BOOL EndXRefStream(CPDF_Creator* pCreator);
+
+
+ CFX_DWordArray m_IndexArray;
+
+ FX_FILESIZE m_PrevOffset;
+ FX_DWORD m_dwTempObjNum;
+
+protected:
+ FX_INT32 EndObjectStream(CPDF_Creator *pCreator, FX_BOOL bEOF = TRUE);
+ FX_BOOL GenerateXRefStream(CPDF_Creator* pCreator, FX_BOOL bEOF);
+ FX_INT32 m_iSeg;
+ CPDF_ObjectStream m_ObjStream;
+ CFX_ByteTextBuf m_Buffer;
+};
+#endif
diff --git a/core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp b/core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp
index 798c77261b..243c23fabf 100644
--- a/core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp
+++ b/core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp
@@ -1,164 +1,164 @@
-// 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
-
-#include "../../../include/fpdfapi/fpdf_page.h"
-#include "../../../include/fpdfapi/fpdf_serial.h"
-#include "../../../include/fpdfapi/fpdf_module.h"
-#include "../../../include/fxcodec/fx_codec.h"
-#include "../fpdf_page/pageint.h"
-CFX_ByteTextBuf& operator << (CFX_ByteTextBuf& ar, CFX_AffineMatrix& matrix)
-{
- ar << matrix.a << " " << matrix.b << " " << matrix.c << " " << matrix.d << " " << matrix.e << " " << matrix.f;
- return ar;
-}
-CPDF_PageContentGenerate::CPDF_PageContentGenerate(CPDF_Page* pPage) : m_pPage(pPage)
-{
- m_pDocument = NULL;
- if (m_pPage) {
- m_pDocument = m_pPage->m_pDocument;
- }
-}
-CPDF_PageContentGenerate::~CPDF_PageContentGenerate()
-{
- for (int i = 0; i < m_pageObjects.GetSize(); ++i) {
- CPDF_PageObject* pPageObj = (CPDF_PageObject*)m_pageObjects[i];
- if (pPageObj) {
- pPageObj->Release();
- }
- }
-}
-FX_BOOL CPDF_PageContentGenerate::InsertPageObject(CPDF_PageObject* pPageObject)
-{
- if (!pPageObject) {
- return FALSE;
- }
- return m_pageObjects.Add(pPageObject);
-}
-void CPDF_PageContentGenerate::GenerateContent()
-{
- CFX_ByteTextBuf buf;
- CPDF_Dictionary* pPageDict = m_pPage->m_pFormDict;
- for (int i = 0; i < m_pageObjects.GetSize(); ++i) {
- CPDF_PageObject* pPageObj = (CPDF_PageObject*)m_pageObjects[i];
- if (!pPageObj || pPageObj->m_Type != PDFPAGE_IMAGE) {
- continue;
- }
- ProcessImage(buf, (CPDF_ImageObject*)pPageObj);
- }
- CPDF_Object* pContent = pPageDict->GetElementValue("Contents");
- if (pContent != NULL) {
- pPageDict->RemoveAt("Contents");
- }
- CPDF_Stream* pStream = FX_NEW CPDF_Stream(NULL, 0, NULL);
- pStream->SetData(buf.GetBuffer(), buf.GetLength(), FALSE, FALSE);
- m_pDocument->AddIndirectObject(pStream);
- pPageDict->SetAtReference("Contents", m_pDocument, pStream->GetObjNum());
-}
-CFX_ByteString CPDF_PageContentGenerate::RealizeResource(CPDF_Object* pResourceObj, const FX_CHAR* szType)
-{
- if (m_pPage->m_pResources == NULL) {
- m_pPage->m_pResources = FX_NEW CPDF_Dictionary;
- int objnum = m_pDocument->AddIndirectObject(m_pPage->m_pResources);
- m_pPage->m_pFormDict->SetAtReference("Resources", m_pDocument, objnum);
- }
- CPDF_Dictionary* pResList = m_pPage->m_pResources->GetDict(szType);
- if (pResList == NULL) {
- pResList = FX_NEW CPDF_Dictionary;
- m_pPage->m_pResources->SetAt(szType, pResList);
- }
- m_pDocument->AddIndirectObject(pResourceObj);
- CFX_ByteString name;
- int idnum = 1;
- while (1) {
- name.Format("FX%c%d", szType[0], idnum);
- if (!pResList->KeyExist(name)) {
- break;
- }
- idnum ++;
- }
- pResList->AddReference(name, m_pDocument, pResourceObj->GetObjNum());
- return name;
-}
-void CPDF_PageContentGenerate::ProcessImage(CFX_ByteTextBuf& buf, CPDF_ImageObject* pImageObj)
-{
- if ((pImageObj->m_Matrix.a == 0 && pImageObj->m_Matrix.b == 0) ||
- (pImageObj->m_Matrix.c == 0 && pImageObj->m_Matrix.d == 0)) {
- return;
- }
- buf << "q " << pImageObj->m_Matrix << " cm ";
- if (!pImageObj->m_pImage->IsInline()) {
- CPDF_Stream* pStream = pImageObj->m_pImage->GetStream();
- FX_DWORD dwSavedObjNum = pStream->GetObjNum();
- CFX_ByteString name = RealizeResource(pStream, "XObject");
- if (dwSavedObjNum == 0) {
- pImageObj->m_pImage->Release();
- pImageObj->m_pImage = m_pDocument->GetPageData()->GetImage(pStream);
- }
- buf << "/" << PDF_NameEncode(name) << " Do Q\n";
- }
-}
-void CPDF_PageContentGenerate::ProcessForm(CFX_ByteTextBuf& buf, FX_LPCBYTE data, FX_DWORD size, CFX_Matrix& matrix)
-{
- if (!data || !size) {
- return;
- }
- CPDF_Stream* pStream = FX_NEW CPDF_Stream(NULL, 0, NULL);
- CPDF_Dictionary* pFormDict = CPDF_Dictionary::Create();
- pFormDict->SetAtName(FX_BSTR("Type"), FX_BSTR("XObject"));
- pFormDict->SetAtName(FX_BSTR("Subtype"), FX_BSTR("Form"));
- CFX_FloatRect bbox = m_pPage->GetPageBBox();
- matrix.TransformRect(bbox);
- pFormDict->SetAtRect(FX_BSTR("BBox"), bbox);
- pStream->InitStream((FX_LPBYTE)data, size, pFormDict);
- buf << "q " << matrix << " cm ";
- CFX_ByteString name = RealizeResource(pStream, "XObject");
- buf << "/" << PDF_NameEncode(name) << " Do Q\n";
-}
-void CPDF_PageContentGenerate::TransformContent(CFX_Matrix& matrix)
-{
- CPDF_Object* pContent = m_pPage->m_pFormDict->GetElementValue("Contents");
- if (!pContent) {
- return;
- }
- CFX_ByteTextBuf buf;
- int type = pContent->GetType();
- if (type == PDFOBJ_ARRAY) {
- CPDF_Array* pArray = (CPDF_Array*)pContent;
- int iCount = pArray->GetCount();
- CPDF_StreamAcc** pContentArray = (CPDF_StreamAcc**)FX_Alloc(CPDF_StreamAcc*, iCount);
- int size = 0;
- int i = 0;
- for (i = 0; i < iCount; ++i) {
- pContent = pArray->GetElement(i);
- if (!pContent || pContent->GetType() != PDFOBJ_STREAM) {
- continue;
- }
- CPDF_StreamAcc* pStream = FX_NEW CPDF_StreamAcc();
- pStream->LoadAllData((CPDF_Stream*)pContent);
- pContentArray[i] = pStream;
- size += pContentArray[i]->GetSize() + 1;
- }
- int pos = 0;
- FX_LPBYTE pBuf = FX_Alloc(FX_BYTE, size);
- for (i = 0; i < iCount; ++i) {
- FXSYS_memcpy32(pBuf + pos, pContentArray[i]->GetData(), pContentArray[i]->GetSize());
- pos += pContentArray[i]->GetSize() + 1;
- pBuf[pos - 1] = ' ';
- delete pContentArray[i];
- }
- ProcessForm(buf, pBuf, size, matrix);
- FX_Free(pBuf);
- FX_Free(pContentArray);
- } else if (type == PDFOBJ_STREAM) {
- CPDF_StreamAcc contentStream;
- contentStream.LoadAllData((CPDF_Stream*)pContent);
- ProcessForm(buf, contentStream.GetData(), contentStream.GetSize(), matrix);
- }
- CPDF_Stream* pStream = FX_NEW CPDF_Stream(NULL, 0, NULL);
- pStream->SetData(buf.GetBuffer(), buf.GetLength(), FALSE, FALSE);
- m_pDocument->AddIndirectObject(pStream);
- m_pPage->m_pFormDict->SetAtReference("Contents", m_pDocument, pStream->GetObjNum());
-}
+// 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
+
+#include "../../../include/fpdfapi/fpdf_page.h"
+#include "../../../include/fpdfapi/fpdf_serial.h"
+#include "../../../include/fpdfapi/fpdf_module.h"
+#include "../../../include/fxcodec/fx_codec.h"
+#include "../fpdf_page/pageint.h"
+CFX_ByteTextBuf& operator << (CFX_ByteTextBuf& ar, CFX_AffineMatrix& matrix)
+{
+ ar << matrix.a << " " << matrix.b << " " << matrix.c << " " << matrix.d << " " << matrix.e << " " << matrix.f;
+ return ar;
+}
+CPDF_PageContentGenerate::CPDF_PageContentGenerate(CPDF_Page* pPage) : m_pPage(pPage)
+{
+ m_pDocument = NULL;
+ if (m_pPage) {
+ m_pDocument = m_pPage->m_pDocument;
+ }
+}
+CPDF_PageContentGenerate::~CPDF_PageContentGenerate()
+{
+ for (int i = 0; i < m_pageObjects.GetSize(); ++i) {
+ CPDF_PageObject* pPageObj = (CPDF_PageObject*)m_pageObjects[i];
+ if (pPageObj) {
+ pPageObj->Release();
+ }
+ }
+}
+FX_BOOL CPDF_PageContentGenerate::InsertPageObject(CPDF_PageObject* pPageObject)
+{
+ if (!pPageObject) {
+ return FALSE;
+ }
+ return m_pageObjects.Add(pPageObject);
+}
+void CPDF_PageContentGenerate::GenerateContent()
+{
+ CFX_ByteTextBuf buf;
+ CPDF_Dictionary* pPageDict = m_pPage->m_pFormDict;
+ for (int i = 0; i < m_pageObjects.GetSize(); ++i) {
+ CPDF_PageObject* pPageObj = (CPDF_PageObject*)m_pageObjects[i];
+ if (!pPageObj || pPageObj->m_Type != PDFPAGE_IMAGE) {
+ continue;
+ }
+ ProcessImage(buf, (CPDF_ImageObject*)pPageObj);
+ }
+ CPDF_Object* pContent = pPageDict->GetElementValue("Contents");
+ if (pContent != NULL) {
+ pPageDict->RemoveAt("Contents");
+ }
+ CPDF_Stream* pStream = FX_NEW CPDF_Stream(NULL, 0, NULL);
+ pStream->SetData(buf.GetBuffer(), buf.GetLength(), FALSE, FALSE);
+ m_pDocument->AddIndirectObject(pStream);
+ pPageDict->SetAtReference("Contents", m_pDocument, pStream->GetObjNum());
+}
+CFX_ByteString CPDF_PageContentGenerate::RealizeResource(CPDF_Object* pResourceObj, const FX_CHAR* szType)
+{
+ if (m_pPage->m_pResources == NULL) {
+ m_pPage->m_pResources = FX_NEW CPDF_Dictionary;
+ int objnum = m_pDocument->AddIndirectObject(m_pPage->m_pResources);
+ m_pPage->m_pFormDict->SetAtReference("Resources", m_pDocument, objnum);
+ }
+ CPDF_Dictionary* pResList = m_pPage->m_pResources->GetDict(szType);
+ if (pResList == NULL) {
+ pResList = FX_NEW CPDF_Dictionary;
+ m_pPage->m_pResources->SetAt(szType, pResList);
+ }
+ m_pDocument->AddIndirectObject(pResourceObj);
+ CFX_ByteString name;
+ int idnum = 1;
+ while (1) {
+ name.Format("FX%c%d", szType[0], idnum);
+ if (!pResList->KeyExist(name)) {
+ break;
+ }
+ idnum ++;
+ }
+ pResList->AddReference(name, m_pDocument, pResourceObj->GetObjNum());
+ return name;
+}
+void CPDF_PageContentGenerate::ProcessImage(CFX_ByteTextBuf& buf, CPDF_ImageObject* pImageObj)
+{
+ if ((pImageObj->m_Matrix.a == 0 && pImageObj->m_Matrix.b == 0) ||
+ (pImageObj->m_Matrix.c == 0 && pImageObj->m_Matrix.d == 0)) {
+ return;
+ }
+ buf << "q " << pImageObj->m_Matrix << " cm ";
+ if (!pImageObj->m_pImage->IsInline()) {
+ CPDF_Stream* pStream = pImageObj->m_pImage->GetStream();
+ FX_DWORD dwSavedObjNum = pStream->GetObjNum();
+ CFX_ByteString name = RealizeResource(pStream, "XObject");
+ if (dwSavedObjNum == 0) {
+ pImageObj->m_pImage->Release();
+ pImageObj->m_pImage = m_pDocument->GetPageData()->GetImage(pStream);
+ }
+ buf << "/" << PDF_NameEncode(name) << " Do Q\n";
+ }
+}
+void CPDF_PageContentGenerate::ProcessForm(CFX_ByteTextBuf& buf, FX_LPCBYTE data, FX_DWORD size, CFX_Matrix& matrix)
+{
+ if (!data || !size) {
+ return;
+ }
+ CPDF_Stream* pStream = FX_NEW CPDF_Stream(NULL, 0, NULL);
+ CPDF_Dictionary* pFormDict = CPDF_Dictionary::Create();
+ pFormDict->SetAtName(FX_BSTR("Type"), FX_BSTR("XObject"));
+ pFormDict->SetAtName(FX_BSTR("Subtype"), FX_BSTR("Form"));
+ CFX_FloatRect bbox = m_pPage->GetPageBBox();
+ matrix.TransformRect(bbox);
+ pFormDict->SetAtRect(FX_BSTR("BBox"), bbox);
+ pStream->InitStream((FX_LPBYTE)data, size, pFormDict);
+ buf << "q " << matrix << " cm ";
+ CFX_ByteString name = RealizeResource(pStream, "XObject");
+ buf << "/" << PDF_NameEncode(name) << " Do Q\n";
+}
+void CPDF_PageContentGenerate::TransformContent(CFX_Matrix& matrix)
+{
+ CPDF_Object* pContent = m_pPage->m_pFormDict->GetElementValue("Contents");
+ if (!pContent) {
+ return;
+ }
+ CFX_ByteTextBuf buf;
+ int type = pContent->GetType();
+ if (type == PDFOBJ_ARRAY) {
+ CPDF_Array* pArray = (CPDF_Array*)pContent;
+ int iCount = pArray->GetCount();
+ CPDF_StreamAcc** pContentArray = (CPDF_StreamAcc**)FX_Alloc(CPDF_StreamAcc*, iCount);
+ int size = 0;
+ int i = 0;
+ for (i = 0; i < iCount; ++i) {
+ pContent = pArray->GetElement(i);
+ if (!pContent || pContent->GetType() != PDFOBJ_STREAM) {
+ continue;
+ }
+ CPDF_StreamAcc* pStream = FX_NEW CPDF_StreamAcc();
+ pStream->LoadAllData((CPDF_Stream*)pContent);
+ pContentArray[i] = pStream;
+ size += pContentArray[i]->GetSize() + 1;
+ }
+ int pos = 0;
+ FX_LPBYTE pBuf = FX_Alloc(FX_BYTE, size);
+ for (i = 0; i < iCount; ++i) {
+ FXSYS_memcpy32(pBuf + pos, pContentArray[i]->GetData(), pContentArray[i]->GetSize());
+ pos += pContentArray[i]->GetSize() + 1;
+ pBuf[pos - 1] = ' ';
+ delete pContentArray[i];
+ }
+ ProcessForm(buf, pBuf, size, matrix);
+ FX_Free(pBuf);
+ FX_Free(pContentArray);
+ } else if (type == PDFOBJ_STREAM) {
+ CPDF_StreamAcc contentStream;
+ contentStream.LoadAllData((CPDF_Stream*)pContent);
+ ProcessForm(buf, contentStream.GetData(), contentStream.GetSize(), matrix);
+ }
+ CPDF_Stream* pStream = FX_NEW CPDF_Stream(NULL, 0, NULL);
+ pStream->SetData(buf.GetBuffer(), buf.GetLength(), FALSE, FALSE);
+ m_pDocument->AddIndirectObject(pStream);
+ m_pPage->m_pFormDict->SetAtReference("Contents", m_pDocument, pStream->GetObjNum());
+}
diff --git a/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp b/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp
index 4ec3aa6e5e..e5bb1cf985 100644
--- a/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp
+++ b/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp
@@ -1,2131 +1,2131 @@
-// 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
-
-#include "../../../include/fpdfapi/fpdf_serial.h"
-#include "editint.h"
-#define PDF_OBJECTSTREAM_MAXLENGTH (256 * 1024)
-#define PDF_XREFSTREAM_MAXSIZE 10000
-extern void FlateEncode(const FX_BYTE* src_buf, FX_DWORD src_data, FX_LPBYTE& dest_buf, FX_DWORD& dest_size);
-extern void FlateEncode(FX_LPCBYTE src_buf, FX_DWORD src_size, int predictor, int Colors, int BitsPerComponent, int Columns,
- FX_LPBYTE& dest_buf, FX_DWORD& dest_size);
-extern FX_BOOL IsSignatureDict(const CPDF_Dictionary* pDict);
-FX_INT32 PDF_CreatorAppendObject(const CPDF_Object* pObj, CFX_FileBufferArchive *pFile, FX_FILESIZE& offset)
-{
- FX_INT32 len = 0;
- if (pObj == NULL) {
- if (pFile->AppendString(FX_BSTRC(" null")) < 0) {
- return -1;
- }
- offset += 5;
- return 1;
- }
- switch (pObj->GetType()) {
- case PDFOBJ_NULL:
- if (pFile->AppendString(FX_BSTRC(" null")) < 0) {
- return -1;
- }
- offset += 5;
- break;
- case PDFOBJ_BOOLEAN:
- case PDFOBJ_NUMBER:
- if (pFile->AppendString(FX_BSTRC(" ")) < 0) {
- return -1;
- }
- if ((len = pFile->AppendString(pObj->GetString())) < 0) {
- return -1;
- }
- offset += len + 1;
- break;
- case PDFOBJ_STRING: {
- CFX_ByteString str = pObj->GetString();
- FX_BOOL bHex = ((CPDF_String*)pObj)->IsHex();
- if ((len = pFile->AppendString(PDF_EncodeString(str, bHex))) < 0) {
- return -1;
- }
- offset += len;
- break;
- }
- case PDFOBJ_NAME: {
- if (pFile->AppendString(FX_BSTRC("/")) < 0) {
- return -1;
- }
- CFX_ByteString str = pObj->GetString();
- if ((len = pFile->AppendString(PDF_NameEncode(str))) < 0) {
- return -1;
- }
- offset += len + 1;
- break;
- }
- case PDFOBJ_REFERENCE: {
- if (pFile->AppendString(FX_BSTRC(" ")) < 0) {
- return -1;
- }
- CPDF_Reference* p = (CPDF_Reference*)pObj;
- if ((len = pFile->AppendDWord(p->GetRefObjNum())) < 0) {
- return -1;
- }
- if (pFile->AppendString(FX_BSTRC(" 0 R ")) < 0) {
- return -1;
- }
- offset += len + 6;
- break;
- }
- case PDFOBJ_ARRAY: {
- if (pFile->AppendString(FX_BSTRC("[")) < 0) {
- return -1;
- }
- offset += 1;
- CPDF_Array* p = (CPDF_Array*)pObj;
- for (FX_DWORD i = 0; i < p->GetCount(); i ++) {
- CPDF_Object* pElement = p->GetElement(i);
- if (pElement->GetObjNum()) {
- if (pFile->AppendString(FX_BSTRC(" ")) < 0) {
- return -1;
- }
- if ((len = pFile->AppendDWord(pElement->GetObjNum())) < 0) {
- return -1;
- }
- if (pFile->AppendString(FX_BSTRC(" 0 R")) < 0) {
- return -1;
- }
- offset += len + 5;
- } else {
- if (PDF_CreatorAppendObject(pElement, pFile, offset) < 0) {
- return -1;
- }
- }
- }
- if (pFile->AppendString(FX_BSTRC("]")) < 0) {
- return -1;
- }
- offset += 1;
- break;
- }
- case PDFOBJ_DICTIONARY: {
- if (pFile->AppendString(FX_BSTRC("<<")) < 0) {
- return -1;
- }
- offset += 2;
- CPDF_Dictionary* p = (CPDF_Dictionary*)pObj;
- FX_POSITION pos = p->GetStartPos();
- while (pos) {
- CFX_ByteString key;
- CPDF_Object* pValue = p->GetNextElement(pos, key);
- if (pFile->AppendString(FX_BSTRC("/")) < 0) {
- return -1;
- }
- if ((len = pFile->AppendString(PDF_NameEncode(key))) < 0) {
- return -1;
- }
- offset += len + 1;
- if (pValue->GetObjNum()) {
- if (pFile->AppendString(FX_BSTRC(" ")) < 0) {
- return -1;
- }
- if ((len = pFile->AppendDWord(pValue->GetObjNum())) < 0) {
- return -1;
- }
- if (pFile->AppendString(FX_BSTRC(" 0 R")) < 0) {
- return -1;
- }
- offset += len + 5;
- } else {
- if (PDF_CreatorAppendObject(pValue, pFile, offset) < 0) {
- return -1;
- }
- }
- }
- if (pFile->AppendString(FX_BSTRC(">>")) < 0) {
- return -1;
- }
- offset += 2;
- break;
- }
- case PDFOBJ_STREAM: {
- CPDF_Stream* p = (CPDF_Stream*)pObj;
- if (PDF_CreatorAppendObject(p->GetDict(), pFile, offset) < 0) {
- return -1;
- }
- if (pFile->AppendString(FX_BSTRC("stream\r\n")) < 0) {
- return -1;
- }
- offset += 8;
- CPDF_StreamAcc acc;
- acc.LoadAllData(p, TRUE);
- if (pFile->AppendBlock(acc.GetData(), acc.GetSize()) < 0) {
- return -1;
- }
- offset += acc.GetSize();
- if ((len = pFile->AppendString(FX_BSTRC("\r\nendstream"))) < 0) {
- return -1;
- }
- offset += len;
- break;
- }
- default:
- ASSERT(FALSE);
- break;
- }
- return 1;
-}
-FX_INT32 PDF_CreatorWriteTrailer(CPDF_Document* pDocument, CFX_FileBufferArchive* pFile, CPDF_Array* pIDArray, FX_BOOL bCompress)
-{
- FX_FILESIZE offset = 0;
- FX_INT32 len = 0;
- FXSYS_assert(pDocument && pFile);
- CPDF_Parser *pParser = (CPDF_Parser*)pDocument->GetParser();
- if (pParser) {
- CPDF_Dictionary* p = pParser->GetTrailer();
- FX_POSITION pos = p->GetStartPos();
- while (pos) {
- CFX_ByteString key;
- CPDF_Object* pValue = p->GetNextElement(pos, key);
- if (key == FX_BSTRC("Encrypt") || key == FX_BSTRC("Size") || key == FX_BSTRC("Filter") ||
- key == FX_BSTRC("Index") || key == FX_BSTRC("Length") || key == FX_BSTRC("Prev") ||
- key == FX_BSTRC("W") || key == FX_BSTRC("XRefStm") || key == FX_BSTRC("Type") || key == FX_BSTRC("ID")) {
- continue;
- }
- if (bCompress && key == FX_BSTRC("DecodeParms")) {
- continue;
- }
- if (pFile->AppendString((FX_BSTRC("/"))) < 0) {
- return -1;
- }
- if ((len = pFile->AppendString(PDF_NameEncode(key))) < 0) {
- return -1;
- }
- offset += len + 1;
- if (pValue->GetObjNum()) {
- if (pFile->AppendString(FX_BSTRC(" ")) < 0) {
- return -1;
- }
- if ((len = pFile->AppendDWord(pValue->GetObjNum())) < 0) {
- return -1;
- }
- if (pFile->AppendString(FX_BSTRC(" 0 R ")) < 0) {
- return -1;
- }
- offset += len + 6;
- } else {
- if (PDF_CreatorAppendObject(pValue, pFile, offset) < 0) {
- return -1;
- }
- }
- }
- if (pIDArray) {
- if (pFile->AppendString((FX_BSTRC("/ID"))) < 0) {
- return -1;
- }
- offset += 3;
- if (PDF_CreatorAppendObject(pIDArray, pFile, offset) < 0) {
- return -1;
- }
- }
- return offset;
- }
- if (pFile->AppendString(FX_BSTRC("\r\n/Root ")) < 0) {
- return -1;
- }
- if ((len = pFile->AppendDWord(pDocument->GetRoot()->GetObjNum())) < 0) {
- return -1;
- }
- if (pFile->AppendString(FX_BSTRC(" 0 R\r\n")) < 0) {
- return -1;
- }
- offset += len + 14;
- if (pDocument->GetInfo()) {
- if (pFile->AppendString(FX_BSTRC("/Info ")) < 0) {
- return -1;
- }
- if ((len = pFile->AppendDWord(pDocument->GetInfo()->GetObjNum())) < 0) {
- return -1;
- }
- if (pFile->AppendString(FX_BSTRC(" 0 R\r\n")) < 0) {
- return -1;
- }
- offset += len + 12;
- }
- if (pIDArray) {
- if (pFile->AppendString((FX_BSTRC("/ID"))) < 0) {
- return -1;
- }
- offset += 3;
- if (PDF_CreatorAppendObject(pIDArray, pFile, offset) < 0) {
- return -1;
- }
- }
- return offset;
-}
-FX_INT32 PDF_CreatorWriteEncrypt(const CPDF_Dictionary* pEncryptDict, FX_DWORD dwObjNum, CFX_FileBufferArchive *pFile)
-{
- if (!pEncryptDict) {
- return 0;
- }
- FXSYS_assert(pFile);
- FX_FILESIZE offset = 0;
- FX_INT32 len = 0;
- if (pFile->AppendString(FX_BSTRC("/Encrypt")) < 0) {
- return -1;
- }
- offset += 8;
- if (pFile->AppendString(FX_BSTRC(" ")) < 0) {
- return -1;
- }
- if ((len = pFile->AppendDWord(dwObjNum)) < 0) {
- return -1;
- }
- if (pFile->AppendString(FX_BSTRC(" 0 R ")) < 0) {
- return -1;
- }
- offset += len + 6;
- return offset;
-}
-FX_BOOL PDF_GenerateFileID(FX_DWORD dwSeed1, FX_DWORD dwSeed2, FX_LPDWORD pBuffer)
-{
- if (!pBuffer) {
- return FALSE;
- }
- FX_LPVOID pContext = FX_Random_MT_Start(dwSeed1);
- FX_INT32 i = 0;
- for (i = 0; i < 2; i++) {
- *pBuffer++ = FX_Random_MT_Generate(pContext);
- }
- FX_Random_MT_Close(pContext);
- pContext = FX_Random_MT_Start(dwSeed2);
- for (i = 0; i < 2; i++) {
- *pBuffer++ = FX_Random_MT_Generate(pContext);
- }
- FX_Random_MT_Close(pContext);
- return TRUE;
-}
-class CPDF_FlateEncoder
-{
-public:
- CPDF_FlateEncoder();
- ~CPDF_FlateEncoder();
- FX_BOOL Initialize(CPDF_Stream* pStream, FX_BOOL bFlateEncode);
- FX_BOOL Initialize(FX_LPCBYTE pBuffer, FX_DWORD size, FX_BOOL bFlateEncode, FX_BOOL bXRefStream = FALSE);
- void CloneDict();
- FX_LPBYTE m_pData;
- FX_DWORD m_dwSize;
- CPDF_Dictionary* m_pDict;
- FX_BOOL m_bCloned;
- FX_BOOL m_bNewData;
- CPDF_StreamAcc m_Acc;
-};
-CPDF_FlateEncoder::CPDF_FlateEncoder()
-{
- m_pData = NULL;
- m_dwSize = 0;
- m_pDict = NULL;
- m_bCloned = FALSE;
- m_bNewData = FALSE;
-}
-void CPDF_FlateEncoder::CloneDict()
-{
- if (!m_bCloned) {
- m_pDict = (CPDF_Dictionary*)m_pDict->Clone();
- m_bCloned = TRUE;
- }
-}
-FX_BOOL CPDF_FlateEncoder::Initialize(CPDF_Stream* pStream, FX_BOOL bFlateEncode)
-{
- m_Acc.LoadAllData(pStream, TRUE);
- if (pStream->GetDict()->KeyExist("Filter") || !bFlateEncode) {
- if (pStream->GetDict()->KeyExist("Filter") && !bFlateEncode) {
- CPDF_StreamAcc destAcc;
- destAcc.LoadAllData(pStream);
- m_dwSize = destAcc.GetSize();
- m_pData = (FX_LPBYTE)destAcc.DetachData();
- m_pDict = (CPDF_Dictionary*)pStream->GetDict()->Clone();
- m_pDict->RemoveAt(FX_BSTRC("Filter"));
- m_bNewData = TRUE;
- m_bCloned = TRUE;
- } else {
- m_pData = (FX_LPBYTE)m_Acc.GetData();
- m_dwSize = m_Acc.GetSize();
- m_pDict = pStream->GetDict();
- }
- return TRUE;
- }
- m_pData = NULL;
- m_dwSize = 0;
- m_bNewData = TRUE;
- m_bCloned = TRUE;
- ::FlateEncode(m_Acc.GetData(), m_Acc.GetSize(), m_pData, m_dwSize);
- m_pDict = (CPDF_Dictionary*)pStream->GetDict()->Clone();
- m_pDict->SetAtInteger("Length", m_dwSize);
- m_pDict->SetAtName("Filter", "FlateDecode");
- m_pDict->RemoveAt("DecodeParms");
- return TRUE;
-}
-FX_BOOL CPDF_FlateEncoder::Initialize(FX_LPCBYTE pBuffer, FX_DWORD size, FX_BOOL bFlateEncode, FX_BOOL bXRefStream)
-{
- if (!bFlateEncode) {
- m_pData = (FX_LPBYTE)pBuffer;
- m_dwSize = size;
- return TRUE;
- }
- m_bNewData = TRUE;
- if (bXRefStream) {
- ::FlateEncode(pBuffer, size, 12, 1, 8, 7, m_pData, m_dwSize);
- } else {
- ::FlateEncode(pBuffer, size, m_pData, m_dwSize);
- }
- return TRUE;
-}
-CPDF_FlateEncoder::~CPDF_FlateEncoder()
-{
- if (m_bCloned && m_pDict) {
- m_pDict->Release();
- }
- if (m_bNewData && m_pData) {
- FX_Free(m_pData);
- }
-}
-class CPDF_Encryptor
-{
-public:
- CPDF_Encryptor();
- ~CPDF_Encryptor();
- FX_BOOL Initialize(CPDF_CryptoHandler* pHandler, int objnum, FX_LPBYTE src_data, FX_DWORD src_size);
- FX_LPBYTE m_pData;
- FX_DWORD m_dwSize;
- FX_BOOL m_bNewBuf;
-};
-CPDF_Encryptor::CPDF_Encryptor()
-{
- m_pData = NULL;
- m_dwSize = 0;
- m_bNewBuf = FALSE;
-}
-FX_BOOL CPDF_Encryptor::Initialize(CPDF_CryptoHandler* pHandler, int objnum, FX_LPBYTE src_data, FX_DWORD src_size)
-{
- if (src_size == 0) {
- return TRUE;
- }
- if (pHandler == NULL) {
- m_pData = (FX_LPBYTE)src_data;
- m_dwSize = src_size;
- m_bNewBuf = FALSE;
- return TRUE;
- }
- m_dwSize = pHandler->EncryptGetSize(objnum, 0, src_data, src_size);
- m_pData = FX_Alloc(FX_BYTE, m_dwSize);
- if(!m_pData) {
- return FALSE;
- }
- pHandler->EncryptContent(objnum, 0, src_data, src_size, m_pData, m_dwSize);
- m_bNewBuf = TRUE;
- return TRUE;
-}
-CPDF_Encryptor::~CPDF_Encryptor()
-{
- if (m_bNewBuf) {
- FX_Free(m_pData);
- }
-}
-CPDF_ObjectStream::CPDF_ObjectStream()
- : m_dwObjNum(0)
- , m_index(0)
-{
-}
-FX_BOOL CPDF_ObjectStream::Start()
-{
- m_ObjNumArray.RemoveAll();
- m_OffsetArray.RemoveAll();
- m_Buffer.Clear();
- m_dwObjNum = 0;
- m_index = 0;
- return TRUE;
-}
-FX_INT32 CPDF_ObjectStream::CompressIndirectObject(FX_DWORD dwObjNum, const CPDF_Object *pObj)
-{
- m_ObjNumArray.Add(dwObjNum);
- m_OffsetArray.Add(m_Buffer.GetLength());
- m_Buffer << pObj;
- return 1;
-}
-FX_INT32 CPDF_ObjectStream::CompressIndirectObject(FX_DWORD dwObjNum, FX_LPCBYTE pBuffer, FX_DWORD dwSize)
-{
- m_ObjNumArray.Add(dwObjNum);
- m_OffsetArray.Add(m_Buffer.GetLength());
- m_Buffer.AppendBlock(pBuffer, dwSize);
- return 1;
-}
-FX_FILESIZE CPDF_ObjectStream::End(CPDF_Creator* pCreator)
-{
- FXSYS_assert(pCreator);
- if (m_ObjNumArray.GetSize() == 0) {
- return 0;
- }
- CFX_FileBufferArchive *pFile = &pCreator->m_File;
- CPDF_CryptoHandler *pHandler = pCreator->m_pCryptoHandler;
- FX_FILESIZE ObjOffset = pCreator->m_Offset;
- if (!m_dwObjNum) {
- m_dwObjNum = ++pCreator->m_dwLastObjNum;
- }
- CFX_ByteTextBuf tempBuffer;
- FX_INT32 iCount = m_ObjNumArray.GetSize();
- for (FX_INT32 i = 0; i < iCount; i++) {
- tempBuffer << m_ObjNumArray.ElementAt(i) << FX_BSTRC(" ") << m_OffsetArray.ElementAt(i) << FX_BSTRC(" ");
- }
- FX_FILESIZE &offset = pCreator->m_Offset;
- FX_INT32 len = pFile->AppendDWord(m_dwObjNum);
- if (len < 0) {
- return -1;
- }
- offset += len;
- if ((len = pFile->AppendString(FX_BSTRC(" 0 obj\r\n<</Type /ObjStm /N "))) < 0) {
- return -1;
- }
- offset += len;
- if ((len = pFile->AppendDWord((FX_DWORD)iCount)) < 0) {
- return -1;
- }
- offset += len;
- if (pFile->AppendString(FX_BSTRC("/First ")) < 0) {
- return -1;
- }
- if ((len = pFile->AppendDWord((FX_DWORD)tempBuffer.GetLength())) < 0) {
- return -1;
- }
- if (pFile->AppendString(FX_BSTRC("/Length ")) < 0) {
- return -1;
- }
- offset += len + 15;
- if (!pCreator->m_bCompress && !pHandler) {
- if ((len = pFile->AppendDWord((FX_DWORD)(tempBuffer.GetLength() + m_Buffer.GetLength()))) < 0) {
- return -1;
- }
- offset += len;
- if ((len = pFile->AppendString(FX_BSTRC(">>stream\r\n"))) < 0) {
- return -1;
- }
- if (pFile->AppendBlock(tempBuffer.GetBuffer(), tempBuffer.GetLength()) < 0) {
- return -1;
- }
- if (pFile->AppendBlock(m_Buffer.GetBuffer(), m_Buffer.GetLength()) < 0) {
- return -1;
- }
- offset += len + tempBuffer.GetLength() + m_Buffer.GetLength();
- } else {
- tempBuffer << m_Buffer;
- CPDF_FlateEncoder encoder;
- encoder.Initialize(tempBuffer.GetBuffer(), tempBuffer.GetLength(), pCreator->m_bCompress);
- CPDF_Encryptor encryptor;
- encryptor.Initialize(pHandler, m_dwObjNum, encoder.m_pData, encoder.m_dwSize);
- if ((len = pFile->AppendDWord(encryptor.m_dwSize)) < 0) {
- return -1;
- }
- offset += len;
- if (pCreator->m_bCompress) {
- if (pFile->AppendString(FX_BSTRC("/Filter /FlateDecode")) < 0) {
- return -1;
- }
- offset += 20;
- }
- if ((len = pFile->AppendString(FX_BSTRC(">>stream\r\n"))) < 0) {
- return -1;
- }
- if (pFile->AppendBlock(encryptor.m_pData, encryptor.m_dwSize) < 0) {
- return -1;
- }
- offset += len + encryptor.m_dwSize;
- }
- if ((len = pFile->AppendString(FX_BSTRC("\r\nendstream\r\nendobj\r\n"))) < 0) {
- return -1;
- }
- offset += len;
- return ObjOffset;
-}
-CPDF_XRefStream::CPDF_XRefStream()
- : m_PrevOffset(0)
- , m_iSeg(0)
- , m_dwTempObjNum(0)
-{
-}
-FX_BOOL CPDF_XRefStream::Start()
-{
- m_IndexArray.RemoveAll();
- m_Buffer.Clear();
- m_iSeg = 0;
- return TRUE;
-}
-FX_INT32 CPDF_XRefStream::CompressIndirectObject(FX_DWORD dwObjNum, const CPDF_Object *pObj, CPDF_Creator *pCreator)
-{
- if (!pCreator) {
- return 0;
- }
- m_ObjStream.CompressIndirectObject(dwObjNum, pObj);
- if (m_ObjStream.m_ObjNumArray.GetSize() < pCreator->m_ObjectStreamSize &&
- m_ObjStream.m_Buffer.GetLength() < PDF_OBJECTSTREAM_MAXLENGTH) {
- return 1;
- }
- return EndObjectStream(pCreator);
-}
-FX_INT32 CPDF_XRefStream::CompressIndirectObject(FX_DWORD dwObjNum, FX_LPCBYTE pBuffer, FX_DWORD dwSize, CPDF_Creator *pCreator)
-{
- if (!pCreator) {
- return 0;
- }
- m_ObjStream.CompressIndirectObject(dwObjNum, pBuffer, dwSize);
- if (m_ObjStream.m_ObjNumArray.GetSize() < pCreator->m_ObjectStreamSize &&
- m_ObjStream.m_Buffer.GetLength() < PDF_OBJECTSTREAM_MAXLENGTH) {
- return 1;
- }
- return EndObjectStream(pCreator);
-}
-static void _AppendIndex0(CFX_ByteTextBuf& buffer, FX_BOOL bFirstObject = TRUE)
-{
- buffer.AppendByte(0);
- buffer.AppendByte(0);
- buffer.AppendByte(0);
- buffer.AppendByte(0);
- buffer.AppendByte(0);
- if (bFirstObject) {
- buffer.AppendByte(0xFF);
- buffer.AppendByte(0xFF);
- } else {
- buffer.AppendByte(0);
- buffer.AppendByte(0);
- }
-}
-static void _AppendIndex1(CFX_ByteTextBuf& buffer, FX_FILESIZE offset)
-{
- buffer.AppendByte(1);
- buffer.AppendByte(FX_GETBYTEOFFSET24(offset));
- buffer.AppendByte(FX_GETBYTEOFFSET16(offset));
- buffer.AppendByte(FX_GETBYTEOFFSET8(offset));
- buffer.AppendByte(FX_GETBYTEOFFSET0(offset));
- buffer.AppendByte(0);
- buffer.AppendByte(0);
-}
-static void _AppendIndex2(CFX_ByteTextBuf& buffer, FX_DWORD objnum, FX_INT32 index)
-{
- buffer.AppendByte(2);
- buffer.AppendByte(FX_GETBYTEOFFSET24(objnum));
- buffer.AppendByte(FX_GETBYTEOFFSET16(objnum));
- buffer.AppendByte(FX_GETBYTEOFFSET8(objnum));
- buffer.AppendByte(FX_GETBYTEOFFSET0(objnum));
- buffer.AppendByte(FX_GETBYTEOFFSET8(index));
- buffer.AppendByte(FX_GETBYTEOFFSET0(index));
-}
-FX_INT32 CPDF_XRefStream::EndObjectStream(CPDF_Creator *pCreator, FX_BOOL bEOF)
-{
- FX_FILESIZE objOffset = 0;
- if (bEOF) {
- objOffset = m_ObjStream.End(pCreator);
- if (objOffset < 0) {
- return -1;
- }
- }
- FX_DWORD &dwObjStmNum = m_ObjStream.m_dwObjNum;
- if (!dwObjStmNum) {
- dwObjStmNum = ++pCreator->m_dwLastObjNum;
- }
- FX_INT32 iSize = m_ObjStream.m_ObjNumArray.GetSize();
- FX_INT32 iSeg = m_IndexArray.GetSize() / 2;
- if (!(pCreator->m_dwFlags & FPDFCREATE_INCREMENTAL)) {
- if (m_dwTempObjNum == 0) {
- _AppendIndex0(m_Buffer);
- m_dwTempObjNum++;
- }
- FX_DWORD end_num = m_IndexArray.GetAt((iSeg - 1) * 2) + m_IndexArray.GetAt((iSeg - 1) * 2 + 1);
- int index = 0;
- for (; m_dwTempObjNum < end_num; m_dwTempObjNum++) {
- FX_FILESIZE* offset = pCreator->m_ObjectOffset.GetPtrAt(m_dwTempObjNum);
- if (offset) {
- if (index >= iSize || m_dwTempObjNum != m_ObjStream.m_ObjNumArray[index]) {
- _AppendIndex1(m_Buffer, *offset);
- } else {
- _AppendIndex2(m_Buffer, dwObjStmNum, index++);
- }
- } else {
- _AppendIndex0(m_Buffer, FALSE);
- }
- }
- if (iSize > 0 && bEOF) {
- pCreator->m_ObjectOffset.Add(dwObjStmNum, 1);
- pCreator->m_ObjectSize.Add(dwObjStmNum, 1);
- pCreator->m_ObjectOffset[dwObjStmNum] = objOffset;
- }
- m_iSeg = iSeg;
- if (bEOF) {
- m_ObjStream.Start();
- }
- return 1;
- }
- FX_INT32 &j = m_ObjStream.m_index;
- for (int i = m_iSeg; i < iSeg; i++) {
- FX_DWORD start = m_IndexArray.ElementAt(i * 2);
- FX_DWORD end = m_IndexArray.ElementAt(i * 2 + 1) + start;
- for (FX_DWORD m = start; m < end; m++) {
- if (j >= iSize || m != m_ObjStream.m_ObjNumArray.ElementAt(j)) {
- _AppendIndex1(m_Buffer, pCreator->m_ObjectOffset[m]);
- } else {
- _AppendIndex2(m_Buffer, dwObjStmNum, j++);
- }
- }
- }
- if (iSize > 0 && bEOF) {
- _AppendIndex1(m_Buffer, objOffset);
- m_IndexArray.Add(dwObjStmNum);
- m_IndexArray.Add(1);
- iSeg += 1;
- }
- m_iSeg = iSeg;
- if (bEOF) {
- m_ObjStream.Start();
- }
- return 1;
-}
-FX_BOOL CPDF_XRefStream::GenerateXRefStream(CPDF_Creator* pCreator, FX_BOOL bEOF)
-{
- FX_FILESIZE offset_tmp = pCreator->m_Offset;
- FX_DWORD objnum = ++pCreator->m_dwLastObjNum;
- CFX_FileBufferArchive *pFile = &pCreator->m_File;
- FX_BOOL bIncremental = (pCreator->m_dwFlags & FPDFCREATE_INCREMENTAL) != 0;
- if (bIncremental) {
- AddObjectNumberToIndexArray(objnum);
- } else {
- for (; m_dwTempObjNum < pCreator->m_dwLastObjNum; m_dwTempObjNum++) {
- FX_FILESIZE* offset = pCreator->m_ObjectOffset.GetPtrAt(m_dwTempObjNum);
- if (offset) {
- _AppendIndex1(m_Buffer, *offset);
- } else {
- _AppendIndex0(m_Buffer, FALSE);
- }
- }
- }
- _AppendIndex1(m_Buffer, offset_tmp);
- FX_FILESIZE &offset = pCreator->m_Offset;
- FX_INT32 len = pFile->AppendDWord(objnum);
- if (len < 0) {
- return FALSE;
- }
- offset += len;
- if ((len = pFile->AppendString(FX_BSTRC(" 0 obj\r\n<</Type /XRef/W[1 4 2]/Index["))) < 0) {
- return FALSE;
- }
- offset += len;
- if (!bIncremental) {
- if ((len = pFile->AppendDWord(0)) < 0) {
- return FALSE;
- }
- if ((len = pFile->AppendString(FX_BSTRC(" "))) < 0) {
- return FALSE;
- }
- offset += len + 1;
- if ((len = pFile->AppendDWord(objnum + 1)) < 0) {
- return FALSE;
- }
- offset += len;
- } else {
- FX_INT32 iSeg = m_IndexArray.GetSize() / 2;
- for (FX_INT32 i = 0; i < iSeg; i++) {
- if ((len = pFile->AppendDWord(m_IndexArray.ElementAt(i * 2))) < 0) {
- return FALSE;
- }
- if (pFile->AppendString(FX_BSTRC(" ")) < 0) {
- return FALSE;
- }
- offset += len + 1;
- if ((len = pFile->AppendDWord(m_IndexArray.ElementAt(i * 2 + 1))) < 0) {
- return FALSE;
- }
- if (pFile->AppendString(FX_BSTRC(" ")) < 0) {
- return FALSE;
- }
- offset += len + 1;
- }
- }
- if (pFile->AppendString(FX_BSTRC("]/Size ")) < 0) {
- return FALSE;
- }
- if ((len = pFile->AppendDWord(objnum + 1)) < 0) {
- return FALSE;
- }
- offset += len + 7;
- if (m_PrevOffset > 0) {
- if (pFile->AppendString(FX_BSTRC("/Prev ")) < 0) {
- return -1;
- }
- FX_CHAR offset_buf[20];
- FXSYS_memset32(offset_buf, 0, sizeof(offset_buf));
- FXSYS_i64toa(m_PrevOffset, offset_buf, 10);
- FX_INT32 len = (FX_INT32)FXSYS_strlen(offset_buf);
- if (pFile->AppendBlock(offset_buf, len) < 0) {
- return -1;
- }
- offset += len + 6;
- }
- FX_BOOL bPredictor = TRUE;
- CPDF_FlateEncoder encoder;
- encoder.Initialize(m_Buffer.GetBuffer(), m_Buffer.GetLength(), pCreator->m_bCompress, bPredictor);
- if (pCreator->m_bCompress) {
- if (pFile->AppendString(FX_BSTRC("/Filter /FlateDecode")) < 0) {
- return FALSE;
- }
- offset += 20;
- if (bPredictor) {
- if ((len = pFile->AppendString(FX_BSTRC("/DecodeParms<</Columns 7/Predictor 12>>"))) < 0) {
- return FALSE;
- }
- offset += len;
- }
- }
- if (pFile->AppendString(FX_BSTRC("/Length ")) < 0) {
- return FALSE;
- }
- if ((len = pFile->AppendDWord(encoder.m_dwSize)) < 0) {
- return FALSE;
- }
- offset += len + 8;
- if (bEOF) {
- if ((len = PDF_CreatorWriteTrailer(pCreator->m_pDocument, pFile, pCreator->m_pIDArray, pCreator->m_bCompress)) < 0) {
- return -1;
- }
- offset += len;
- if (pCreator->m_pEncryptDict) {
- FX_DWORD dwEncryptObjNum = pCreator->m_pEncryptDict->GetObjNum();
- if (dwEncryptObjNum == 0) {
- dwEncryptObjNum = pCreator->m_dwEnryptObjNum;
- }
- if ((len = PDF_CreatorWriteEncrypt(pCreator->m_pEncryptDict, dwEncryptObjNum, pFile)) < 0) {
- return -1;
- }
- offset += len;
- }
- }
- if ((len = pFile->AppendString(FX_BSTRC(">>stream\r\n"))) < 0) {
- return FALSE;
- }
- offset += len;
- if (pFile->AppendBlock(encoder.m_pData, encoder.m_dwSize) < 0) {
- return FALSE;
- }
- if ((len = pFile->AppendString(FX_BSTRC("\r\nendstream\r\nendobj\r\n"))) < 0) {
- return FALSE;
- }
- offset += encoder.m_dwSize + len;
- m_PrevOffset = offset_tmp;
- return TRUE;
-}
-FX_BOOL CPDF_XRefStream::End(CPDF_Creator *pCreator, FX_BOOL bEOF )
-{
- if (EndObjectStream(pCreator, bEOF) < 0) {
- return FALSE;
- }
- return GenerateXRefStream(pCreator, bEOF);
-}
-FX_BOOL CPDF_XRefStream::EndXRefStream(CPDF_Creator* pCreator)
-{
- if (!(pCreator->m_dwFlags & FPDFCREATE_INCREMENTAL)) {
- _AppendIndex0(m_Buffer);
- for (FX_DWORD i = 1; i < pCreator->m_dwLastObjNum + 1; i++) {
- FX_FILESIZE* offset = pCreator->m_ObjectOffset.GetPtrAt(i);
- if (offset) {
- _AppendIndex1(m_Buffer, *offset);
- } else {
- _AppendIndex0(m_Buffer, FALSE);
- }
- }
- } else {
- FX_INT32 iSeg = m_IndexArray.GetSize() / 2;
- for (int i = 0; i < iSeg; i++) {
- FX_DWORD start = m_IndexArray.ElementAt(i * 2);
- FX_DWORD end = m_IndexArray.ElementAt(i * 2 + 1) + start;
- for (FX_DWORD j = start; j < end; j++) {
- _AppendIndex1(m_Buffer, pCreator->m_ObjectOffset[j]);
- }
- }
- }
- return GenerateXRefStream(pCreator, FALSE);
-}
-FX_BOOL CPDF_XRefStream::AddObjectNumberToIndexArray(FX_DWORD objnum)
-{
- FX_INT32 iSize = m_IndexArray.GetSize();
- if (iSize == 0) {
- m_IndexArray.Add(objnum);
- m_IndexArray.Add(1);
- } else {
- FXSYS_assert(iSize > 1);
- FX_DWORD startobjnum = m_IndexArray.ElementAt(iSize - 2);
- FX_INT32 iCount = m_IndexArray.ElementAt(iSize - 1);
- if (objnum == startobjnum + iCount) {
- m_IndexArray[iSize - 1] = iCount + 1;
- } else {
- m_IndexArray.Add(objnum);
- m_IndexArray.Add(1);
- }
- }
- return TRUE;
-}
-CPDF_Creator::CPDF_Creator(CPDF_Document* pDoc)
-{
- m_pDocument = pDoc;
- m_pParser = (CPDF_Parser*)pDoc->m_pParser;
- m_bCompress = TRUE;
- if (m_pParser) {
- m_pEncryptDict = m_pParser->GetEncryptDict();
- m_pCryptoHandler = m_pParser->GetCryptoHandler();
- } else {
- m_pEncryptDict = NULL;
- m_pCryptoHandler = NULL;
- }
- m_bSecurityChanged = FALSE;
- m_bStandardSecurity = FALSE;
- m_pMetadata = NULL;
- m_bEncryptCloned = FALSE;
- m_bEncryptMetadata = FALSE;
- m_Offset = 0;
- m_iStage = -1;
- m_dwFlags = 0;
- m_Pos = NULL;
- m_XrefStart = 0;
- m_pXRefStream = NULL;
- m_ObjectStreamSize = 200;
- m_dwLastObjNum = m_pDocument->GetLastObjNum();
- m_pIDArray = NULL;
- m_FileVersion = 0;
- m_dwEnryptObjNum = 0;
- m_bNewCrypto = FALSE;
-}
-CPDF_Creator::~CPDF_Creator()
-{
- ResetStandardSecurity();
- if (m_bEncryptCloned && m_pEncryptDict) {
- m_pEncryptDict->Release();
- m_pEncryptDict = NULL;
- }
- Clear();
-}
-static FX_BOOL _IsXRefNeedEnd(CPDF_XRefStream* pXRef, FX_DWORD flag)
-{
- if (!(flag & FPDFCREATE_INCREMENTAL)) {
- return FALSE;
- }
- FX_INT32 iSize = pXRef->m_IndexArray.GetSize() / 2;
- FX_INT32 iCount = 0;
- for (FX_INT32 i = 0; i < iSize; i++) {
- iCount += pXRef->m_IndexArray.ElementAt(i * 2 + 1);
- }
- return (iCount >= PDF_XREFSTREAM_MAXSIZE);
-}
-FX_INT32 CPDF_Creator::WriteIndirectObjectToStream(const CPDF_Object* pObj)
-{
- if (!m_pXRefStream) {
- return 1;
- }
- FX_DWORD objnum = pObj->GetObjNum();
- if (m_pParser && m_pParser->m_ObjVersion.GetSize() > (FX_INT32)objnum && m_pParser->m_ObjVersion[objnum] > 0) {
- return 1;
- }
- if (pObj->GetType() == PDFOBJ_NUMBER) {
- return 1;
- }
- CPDF_Dictionary *pDict = pObj->GetDict();
- if (pObj->GetType() == PDFOBJ_STREAM) {
- if (pDict && pDict->GetString(FX_BSTRC("Type")) == FX_BSTRC("XRef")) {
- return 0;
- }
- return 1;
- }
- if (pDict) {
- if (pDict == m_pDocument->m_pRootDict || pDict == m_pEncryptDict) {
- return 1;
- }
- if (IsSignatureDict(pDict)) {
- return 1;
- }
- if (pDict->GetString(FX_BSTRC("Type")) == FX_BSTRC("Page")) {
- return 1;
- }
- }
- m_pXRefStream->AddObjectNumberToIndexArray(objnum);
- if (m_pXRefStream->CompressIndirectObject(objnum, pObj, this) < 0) {
- return -1;
- }
- if (!_IsXRefNeedEnd(m_pXRefStream, m_dwFlags)) {
- return 0;
- }
- if (!m_pXRefStream->End(this)) {
- return -1;
- }
- if (!m_pXRefStream->Start()) {
- return -1;
- }
- return 0;
-}
-FX_INT32 CPDF_Creator::WriteIndirectObjectToStream(FX_DWORD objnum, FX_LPCBYTE pBuffer, FX_DWORD dwSize)
-{
- if (!m_pXRefStream) {
- return 1;
- }
- m_pXRefStream->AddObjectNumberToIndexArray(objnum);
- FX_INT32 iRet = m_pXRefStream->CompressIndirectObject(objnum, pBuffer, dwSize, this);
- if (iRet < 1) {
- return iRet;
- }
- if (!_IsXRefNeedEnd(m_pXRefStream, m_dwFlags)) {
- return 0;
- }
- if (!m_pXRefStream->End(this)) {
- return -1;
- }
- if (!m_pXRefStream->Start()) {
- return -1;
- }
- return 0;
-}
-FX_INT32 CPDF_Creator::AppendObjectNumberToXRef(FX_DWORD objnum)
-{
- if (!m_pXRefStream) {
- return 1;
- }
- m_pXRefStream->AddObjectNumberToIndexArray(objnum);
- if (!_IsXRefNeedEnd(m_pXRefStream, m_dwFlags)) {
- return 0;
- }
- if (!m_pXRefStream->End(this)) {
- return -1;
- }
- if (!m_pXRefStream->Start()) {
- return -1;
- }
- return 0;
-}
-FX_INT32 CPDF_Creator::WriteStream(const CPDF_Object* pStream, FX_DWORD objnum, CPDF_CryptoHandler* pCrypto)
-{
- CPDF_FlateEncoder encoder;
- encoder.Initialize((CPDF_Stream*)pStream, pStream == m_pMetadata ? FALSE : m_bCompress);
- CPDF_Encryptor encryptor;
- if(!encryptor.Initialize(pCrypto, objnum, encoder.m_pData, encoder.m_dwSize)) {
- return -1;
- }
- if ((FX_DWORD)encoder.m_pDict->GetInteger(FX_BSTRC("Length")) != encryptor.m_dwSize) {
- encoder.CloneDict();
- encoder.m_pDict->SetAtInteger(FX_BSTRC("Length"), encryptor.m_dwSize);
- }
- if (WriteDirectObj(objnum, encoder.m_pDict) < 0) {
- return -1;
- }
- int len = m_File.AppendString(FX_BSTRC("stream\r\n"));
- if (len < 0) {
- return -1;
- }
- m_Offset += len;
- if (m_File.AppendBlock(encryptor.m_pData, encryptor.m_dwSize) < 0) {
- return -1;
- }
- m_Offset += encryptor.m_dwSize;
- if ((len = m_File.AppendString(FX_BSTRC("\r\nendstream"))) < 0) {
- return -1;
- }
- m_Offset += len;
- return 1;
-}
-FX_INT32 CPDF_Creator::WriteIndirectObj(FX_DWORD objnum, const CPDF_Object* pObj)
-{
- FX_INT32 len = m_File.AppendDWord(objnum);
- if (len < 0) {
- return -1;
- }
- m_Offset += len;
- if ((len = m_File.AppendString(FX_BSTRC(" 0 obj\r\n"))) < 0) {
- return -1;
- }
- m_Offset += len;
- if (pObj->GetType() == PDFOBJ_STREAM) {
- CPDF_CryptoHandler *pHandler = NULL;
- pHandler = (pObj == m_pMetadata && !m_bEncryptMetadata) ? NULL : m_pCryptoHandler;
- if (WriteStream(pObj, objnum, pHandler) < 0) {
- return -1;
- }
- } else {
- if (WriteDirectObj(objnum, pObj) < 0) {
- return -1;
- }
- }
- if ((len = m_File.AppendString(FX_BSTRC("\r\nendobj\r\n"))) < 0) {
- return -1;
- }
- m_Offset += len;
- if (AppendObjectNumberToXRef(objnum) < 0) {
- return -1;
- }
- return 0;
-}
-FX_INT32 CPDF_Creator::WriteIndirectObj(const CPDF_Object* pObj)
-{
- FX_INT32 iRet = WriteIndirectObjectToStream(pObj);
- if (iRet < 1) {
- return iRet;
- }
- return WriteIndirectObj(pObj->GetObjNum(), pObj);
-}
-FX_INT32 CPDF_Creator::WriteDirectObj(FX_DWORD objnum, const CPDF_Object* pObj, FX_BOOL bEncrypt)
-{
- FX_INT32 len = 0;
- if (pObj == NULL) {
- if (m_File.AppendString(FX_BSTRC(" null")) < 0) {
- return -1;
- }
- m_Offset += 5;
- return 1;
- }
- switch (pObj->GetType()) {
- case PDFOBJ_NULL:
- if (m_File.AppendString(FX_BSTRC(" null")) < 0) {
- return -1;
- }
- m_Offset += 5;
- break;
- case PDFOBJ_BOOLEAN:
- case PDFOBJ_NUMBER:
- if (m_File.AppendString(FX_BSTRC(" ")) < 0) {
- return -1;
- }
- if ((len = m_File.AppendString(pObj->GetString())) < 0) {
- return -1;
- }
- m_Offset += len + 1;
- break;
- case PDFOBJ_STRING: {
- CFX_ByteString str = pObj->GetString();
- FX_BOOL bHex = ((CPDF_String*)pObj)->IsHex();
- if (m_pCryptoHandler == NULL || !bEncrypt) {
- CFX_ByteString content = PDF_EncodeString(str, bHex);
- if ((len = m_File.AppendString(content)) < 0) {
- return -1;
- }
- m_Offset += len;
- break;
- }
- CPDF_Encryptor encryptor;
- encryptor.Initialize(m_pCryptoHandler, objnum, (FX_LPBYTE)(FX_LPCSTR)str, str.GetLength());
- CFX_ByteString content = PDF_EncodeString(CFX_ByteString((FX_LPCSTR)encryptor.m_pData, encryptor.m_dwSize), bHex);
- if ((len = m_File.AppendString(content)) < 0) {
- return -1;
- }
- m_Offset += len;
- break;
- }
- case PDFOBJ_STREAM: {
- CPDF_FlateEncoder encoder;
- encoder.Initialize((CPDF_Stream*)pObj, m_bCompress);
- CPDF_Encryptor encryptor;
- CPDF_CryptoHandler* pHandler = m_pCryptoHandler;
- encryptor.Initialize(pHandler, objnum, encoder.m_pData, encoder.m_dwSize);
- if ((FX_DWORD)encoder.m_pDict->GetInteger(FX_BSTRC("Length")) != encryptor.m_dwSize) {
- encoder.CloneDict();
- encoder.m_pDict->SetAtInteger(FX_BSTRC("Length"), encryptor.m_dwSize);
- }
- if (WriteDirectObj(objnum, encoder.m_pDict) < 0) {
- return -1;
- }
- if ((len = m_File.AppendString(FX_BSTRC("stream\r\n"))) < 0) {
- return -1;
- }
- m_Offset += len;
- if (m_File.AppendBlock(encryptor.m_pData, encryptor.m_dwSize) < 0) {
- return -1;
- }
- m_Offset += encryptor.m_dwSize;
- if ((len = m_File.AppendString(FX_BSTRC("\r\nendstream"))) < 0) {
- return -1;
- }
- m_Offset += len;
- break;
- }
- case PDFOBJ_NAME: {
- if (m_File.AppendString(FX_BSTRC("/")) < 0) {
- return -1;
- }
- CFX_ByteString str = pObj->GetString();
- if ((len = m_File.AppendString(PDF_NameEncode(str))) < 0) {
- return -1;
- }
- m_Offset += len + 1;
- break;
- }
- case PDFOBJ_REFERENCE: {
- if (m_File.AppendString(FX_BSTRC(" ")) < 0) {
- return -1;
- }
- CPDF_Reference* p = (CPDF_Reference*)pObj;
- if ((len = m_File.AppendDWord(p->GetRefObjNum())) < 0) {
- return -1;
- }
- if (m_File.AppendString(FX_BSTRC(" 0 R")) < 0) {
- return -1;
- }
- m_Offset += len + 5;
- break;
- }
- case PDFOBJ_ARRAY: {
- if (m_File.AppendString(FX_BSTRC("[")) < 0) {
- return -1;
- }
- m_Offset += 1;
- CPDF_Array* p = (CPDF_Array*)pObj;
- for (FX_DWORD i = 0; i < p->GetCount(); i ++) {
- CPDF_Object* pElement = p->GetElement(i);
- if (pElement->GetObjNum()) {
- if (m_File.AppendString(FX_BSTRC(" ")) < 0) {
- return -1;
- }
- if ((len = m_File.AppendDWord(pElement->GetObjNum())) < 0) {
- return -1;
- }
- if (m_File.AppendString(FX_BSTRC(" 0 R")) < 0) {
- return -1;
- }
- m_Offset += len + 5;
- } else {
- if (WriteDirectObj(objnum, pElement) < 0) {
- return -1;
- }
- }
- }
- if (m_File.AppendString(FX_BSTRC("]")) < 0) {
- return -1;
- }
- m_Offset += 1;
- break;
- }
- case PDFOBJ_DICTIONARY: {
- if (m_pCryptoHandler == NULL || pObj == m_pEncryptDict) {
- return PDF_CreatorAppendObject(pObj, &m_File, m_Offset);
- }
- if (m_File.AppendString(FX_BSTRC("<<")) < 0) {
- return -1;
- }
- m_Offset += 2;
- CPDF_Dictionary* p = (CPDF_Dictionary*)pObj;
- FX_BOOL bSignDict = IsSignatureDict(p);
- FX_POSITION pos = p->GetStartPos();
- while (pos) {
- FX_BOOL bSignValue = FALSE;
- CFX_ByteString key;
- CPDF_Object* pValue = p->GetNextElement(pos, key);
- if (m_File.AppendString(FX_BSTRC("/")) < 0) {
- return -1;
- }
- if ((len = m_File.AppendString(PDF_NameEncode(key))) < 0) {
- return -1;
- }
- m_Offset += len + 1;
- if (bSignDict && key == FX_BSTRC("Contents")) {
- bSignValue = TRUE;
- }
- if (pValue->GetObjNum()) {
- if (m_File.AppendString(FX_BSTRC(" ")) < 0) {
- return -1;
- }
- if ((len = m_File.AppendDWord(pValue->GetObjNum())) < 0) {
- return -1;
- }
- if (m_File.AppendString(FX_BSTRC(" 0 R ")) < 0) {
- return -1;
- }
- m_Offset += len + 6;
- } else {
- if (WriteDirectObj(objnum, pValue, !bSignValue) < 0) {
- return -1;
- }
- }
- }
- if (m_File.AppendString(FX_BSTRC(">>")) < 0) {
- return -1;
- }
- m_Offset += 2;
- break;
- }
- }
- return 1;
-}
-FX_INT32 CPDF_Creator::WriteOldIndirectObject(FX_DWORD objnum)
-{
- if(m_pParser->m_V5Type[objnum] == 0 || m_pParser->m_V5Type[objnum] == 255) {
- return 0;
- }
- m_ObjectOffset[objnum] = m_Offset;
- FX_LPVOID valuetemp = NULL;
- FX_BOOL bExistInMap = m_pDocument->m_IndirectObjs.Lookup((FX_LPVOID)(FX_UINTPTR)objnum, valuetemp);
- FX_BOOL bObjStm = (m_pParser->m_V5Type[objnum] == 2) && m_pEncryptDict && !m_pXRefStream;
- if(m_pParser->m_bVersionUpdated || m_bSecurityChanged || bExistInMap || bObjStm) {
- CPDF_Object* pObj = m_pDocument->GetIndirectObject(objnum);
- if (pObj == NULL) {
- m_ObjectOffset[objnum] = 0;
- m_ObjectSize[objnum] = 0;
- return 0;
- }
- if (WriteIndirectObj(pObj)) {
- return -1;
- }
- if (!bExistInMap) {
- m_pDocument->ReleaseIndirectObject(objnum);
- }
- } else {
- FX_BYTE* pBuffer;
- FX_DWORD size;
- m_pParser->GetIndirectBinary(objnum, pBuffer, size);
- if (pBuffer == NULL) {
- return 0;
- }
- if (m_pParser->m_V5Type[objnum] == 2) {
- if (m_pXRefStream) {
- if (WriteIndirectObjectToStream(objnum, pBuffer, size) < 0) {
- FX_Free(pBuffer);
- return -1;
- }
- } else {
- FX_INT32 len = m_File.AppendDWord(objnum);
- if (len < 0) {
- return -1;
- }
- if (m_File.AppendString(FX_BSTRC(" 0 obj ")) < 0) {
- return -1;
- }
- m_Offset += len + 7;
- if (m_File.AppendBlock(pBuffer, size) < 0) {
- return -1;
- }
- m_Offset += size;
- if (m_File.AppendString(FX_BSTRC("\r\nendobj\r\n")) < 0) {
- return -1;
- }
- m_Offset += 10;
- }
- } else {
- if (m_File.AppendBlock(pBuffer, size) < 0) {
- return -1;
- }
- m_Offset += size;
- if(AppendObjectNumberToXRef(objnum) < 0) {
- return -1;
- }
- }
- FX_Free(pBuffer);
- }
- return 1;
-}
-FX_INT32 CPDF_Creator::WriteOldObjs(IFX_Pause *pPause)
-{
- FX_DWORD nOldSize = m_pParser->m_CrossRef.GetSize();
- FX_DWORD objnum = (FX_DWORD)(FX_UINTPTR)m_Pos;
- for(; objnum < nOldSize; objnum ++) {
- FX_INT32 iRet = WriteOldIndirectObject(objnum);
- if (!iRet) {
- continue;
- }
- if (iRet < 0) {
- return iRet;
- }
- m_ObjectSize[objnum] = (FX_DWORD)(m_Offset - m_ObjectOffset[objnum]);
- if (pPause && pPause->NeedToPauseNow()) {
- m_Pos = (FX_LPVOID)(FX_UINTPTR)(objnum + 1);
- return 1;
- }
- }
- return 0;
-}
-FX_INT32 CPDF_Creator::WriteNewObjs(FX_BOOL bIncremental, IFX_Pause *pPause)
-{
- FX_INT32 iCount = m_NewObjNumArray.GetSize();
- FX_INT32 index = (FX_INT32)(FX_UINTPTR)m_Pos;
- while (index < iCount) {
- FX_DWORD objnum = m_NewObjNumArray.ElementAt(index);
- CPDF_Object *pObj = NULL;
- m_pDocument->m_IndirectObjs.Lookup((FX_LPVOID)(FX_UINTPTR)objnum, (FX_LPVOID&)pObj);
- if (NULL == pObj) {
- ++index;
- continue;
- }
- m_ObjectOffset[objnum] = m_Offset;
- if (WriteIndirectObj(pObj)) {
- return -1;
- }
- m_ObjectSize[objnum] = (FX_DWORD)(m_Offset - m_ObjectOffset[objnum]);
- index++;
- if (pPause && pPause->NeedToPauseNow()) {
- m_Pos = (FX_POSITION)(FX_UINTPTR)index;
- return 1;
- }
- }
- return 0;
-}
-void CPDF_Creator::InitOldObjNumOffsets()
-{
- if (!m_pParser) {
- return;
- }
- FX_DWORD j = 0;
- FX_DWORD dwStart = 0;
- FX_DWORD dwEnd = m_pParser->GetLastObjNum();
- while (dwStart <= dwEnd) {
- while (dwStart <= dwEnd && (m_pParser->m_V5Type[dwStart] == 0 || m_pParser->m_V5Type[dwStart] == 255)) {
- dwStart++;
- }
- if (dwStart > dwEnd) {
- break;
- }
- j = dwStart;
- while (j <= dwEnd && m_pParser->m_V5Type[j] != 0 && m_pParser->m_V5Type[j] != 255) {
- j++;
- }
- m_ObjectOffset.Add(dwStart, j - dwStart);
- m_ObjectSize.Add(dwStart, j - dwStart);
- dwStart = j;
- }
-}
-void CPDF_Creator::InitNewObjNumOffsets()
-{
- FX_BOOL bIncremental = (m_dwFlags & FPDFCREATE_INCREMENTAL) != 0;
- FX_BOOL bNoOriginal = (m_dwFlags & FPDFCREATE_NO_ORIGINAL) != 0;
- FX_DWORD nOldSize = m_pParser ? m_pParser->m_CrossRef.GetSize() : 0;
- FX_POSITION pos = m_pDocument->m_IndirectObjs.GetStartPosition();
- while (pos) {
- size_t key = 0;
- CPDF_Object* pObj;
- m_pDocument->m_IndirectObjs.GetNextAssoc(pos, (FX_LPVOID&)key, (FX_LPVOID&)pObj);
- FX_DWORD objnum = (FX_DWORD)key;
- if (pObj->GetObjNum() == -1) {
- continue;
- }
- if (bIncremental) {
- if (!pObj->IsModified()) {
- continue;
- }
- } else {
- if (objnum < nOldSize && m_pParser->m_V5Type[objnum] != 0) {
- continue;
- }
- }
- AppendNewObjNum(objnum);
- }
- FX_INT32 iCount = m_NewObjNumArray.GetSize();
- if (iCount == 0) {
- return;
- }
- FX_INT32 i = 0;
- FX_DWORD dwStartObjNum = 0;
- FX_BOOL bCrossRefValid = m_pParser && m_pParser->GetLastXRefOffset() > 0;
- while (i < iCount) {
- dwStartObjNum = m_NewObjNumArray.ElementAt(i);
- if ((bIncremental && (bNoOriginal || bCrossRefValid)) || !m_ObjectOffset.GetPtrAt(dwStartObjNum)) {
- break;
- }
- i++;
- }
- if (i >= iCount) {
- return;
- }
- FX_DWORD dwLastObjNum = dwStartObjNum;
- i++;
- FX_BOOL bNewStart = FALSE;
- for (; i < iCount; i++) {
- FX_DWORD dwCurObjNum = m_NewObjNumArray.ElementAt(i);
- FX_BOOL bExist = (dwCurObjNum < nOldSize && m_ObjectOffset.GetPtrAt(dwCurObjNum) != NULL);
- if (bExist || dwCurObjNum - dwLastObjNum > 1) {
- if (!bNewStart) {
- m_ObjectOffset.Add(dwStartObjNum, dwLastObjNum - dwStartObjNum + 1);
- m_ObjectSize.Add(dwStartObjNum, dwLastObjNum - dwStartObjNum + 1);
- }
- dwStartObjNum = dwCurObjNum;
- }
- if (bNewStart) {
- dwStartObjNum = dwCurObjNum;
- }
- bNewStart = bExist;
- dwLastObjNum = dwCurObjNum;
- }
- m_ObjectOffset.Add(dwStartObjNum, dwLastObjNum - dwStartObjNum + 1);
- m_ObjectSize.Add(dwStartObjNum, dwLastObjNum - dwStartObjNum + 1);
-}
-void CPDF_Creator::AppendNewObjNum(FX_DWORD objbum)
-{
- FX_INT32 iStart = 0, iFind = 0;
- FX_INT32 iEnd = m_NewObjNumArray.GetUpperBound();
- while (iStart <= iEnd) {
- FX_INT32 iMid = (iStart + iEnd) / 2;
- FX_DWORD dwMid = m_NewObjNumArray.ElementAt(iMid);
- if (objbum < dwMid) {
- iEnd = iMid - 1;
- } else {
- if (iMid == iEnd) {
- iFind = iMid + 1;
- break;
- }
- FX_DWORD dwNext = m_NewObjNumArray.ElementAt(iMid + 1);
- if (objbum < dwNext) {
- iFind = iMid + 1;
- break;
- }
- iStart = iMid + 1;
- }
- }
- m_NewObjNumArray.InsertAt(iFind, objbum);
-}
-FX_INT32 CPDF_Creator::WriteDoc_Stage1(IFX_Pause *pPause)
-{
- FXSYS_assert(m_iStage > -1 || m_iStage < 20);
- if (m_iStage == 0) {
- if (m_pParser == NULL) {
- m_dwFlags &= ~FPDFCREATE_INCREMENTAL;
- }
- if (m_bSecurityChanged && (m_dwFlags & FPDFCREATE_NO_ORIGINAL) == 0) {
- m_dwFlags &= ~FPDFCREATE_INCREMENTAL;
- }
- m_pMetadata = m_pDocument->GetRoot()->GetElementValue(FX_BSTRC("Metadata"));
- if (m_dwFlags & FPDFCREATE_OBJECTSTREAM) {
- m_pXRefStream = FX_NEW CPDF_XRefStream;
- m_pXRefStream->Start();
- if ((m_dwFlags & FPDFCREATE_INCREMENTAL) != 0 && m_pParser) {
- FX_FILESIZE prev = m_pParser->GetLastXRefOffset();
- m_pXRefStream->m_PrevOffset = prev;
- }
- }
- m_iStage = 10;
- }
- if (m_iStage == 10) {
- if ((m_dwFlags & FPDFCREATE_INCREMENTAL) == 0) {
- if (m_File.AppendString(FX_BSTRC("%PDF-1.")) < 0) {
- return -1;
- }
- m_Offset += 7;
- FX_INT32 version = 7;
- if (m_FileVersion) {
- version = m_FileVersion;
- } else if (m_pParser) {
- version = m_pParser->GetFileVersion();
- }
- FX_INT32 len = m_File.AppendDWord(version % 10);
- if (len < 0) {
- return -1;
- }
- m_Offset += len;
- if ((len = m_File.AppendString(FX_BSTRC("\r\n%\xA1\xB3\xC5\xD7\r\n"))) < 0) {
- return -1;
- }
- m_Offset += len;
- InitOldObjNumOffsets();
- m_iStage = 20;
- } else {
- IFX_FileRead* pSrcFile = m_pParser->GetFileAccess();
- m_Offset = pSrcFile->GetSize();
- m_Pos = (FX_LPVOID)(FX_UINTPTR)m_Offset;
- m_iStage = 15;
- }
- }
- if (m_iStage == 15) {
- if ((m_dwFlags & FPDFCREATE_NO_ORIGINAL) == 0 && m_Pos) {
- IFX_FileRead* pSrcFile = m_pParser->GetFileAccess();
- FX_BYTE buffer[4096];
- FX_DWORD src_size = (FX_DWORD)(FX_UINTPTR)m_Pos;
- while (src_size) {
- FX_DWORD block_size = src_size > 4096 ? 4096 : src_size;
- if (!pSrcFile->ReadBlock(buffer, m_Offset - src_size, block_size)) {
- return -1;
- }
- if (m_File.AppendBlock(buffer, block_size) < 0) {
- return -1;
- }
- src_size -= block_size;
- if (pPause && pPause->NeedToPauseNow()) {
- m_Pos = (FX_LPVOID)(FX_UINTPTR)src_size;
- return 1;
- }
- }
- }
- if ((m_dwFlags & FPDFCREATE_NO_ORIGINAL) == 0 && m_pParser->GetLastXRefOffset() == 0) {
- InitOldObjNumOffsets();
- FX_DWORD dwEnd = m_pParser->GetLastObjNum();
- FX_BOOL bObjStm = (m_dwFlags & FPDFCREATE_OBJECTSTREAM) != 0;
- for (FX_DWORD objnum = 0; objnum <= dwEnd; objnum++) {
- if (m_pParser->m_V5Type[objnum] == 0 || m_pParser->m_V5Type[objnum] == 255) {
- continue;
- }
- m_ObjectOffset[objnum] = m_pParser->m_CrossRef[objnum];
- if (bObjStm) {
- m_pXRefStream->AddObjectNumberToIndexArray(objnum);
- }
- }
- if (bObjStm) {
- m_pXRefStream->EndXRefStream(this);
- m_pXRefStream->Start();
- }
- }
- m_iStage = 20;
- }
- InitNewObjNumOffsets();
- return m_iStage;
-}
-FX_INT32 CPDF_Creator::WriteDoc_Stage2(IFX_Pause *pPause)
-{
- FXSYS_assert(m_iStage >= 20 || m_iStage < 30);
- if (m_iStage == 20) {
- if ((m_dwFlags & FPDFCREATE_INCREMENTAL) == 0 && m_pParser) {
- m_Pos = (FX_LPVOID)(FX_UINTPTR)0;
- m_iStage = 21;
- } else {
- m_iStage = 25;
- }
- }
- if (m_iStage == 21) {
- FX_INT32 iRet = WriteOldObjs(pPause);
- if (iRet) {
- return iRet;
- }
- m_iStage = 25;
- }
- if (m_iStage == 25) {
- m_Pos = (FX_LPVOID)(FX_UINTPTR)0;
- m_iStage = 26;
- }
- if (m_iStage == 26) {
- FX_INT32 iRet = WriteNewObjs((m_dwFlags & FPDFCREATE_INCREMENTAL) != 0, pPause);
- if (iRet) {
- return iRet;
- }
- m_iStage = 27;
- }
- if (m_iStage == 27) {
- if (NULL != m_pEncryptDict && 0 == m_pEncryptDict->GetObjNum()) {
- m_dwLastObjNum += 1;
- FX_FILESIZE saveOffset = m_Offset;
- if (WriteIndirectObj(m_dwLastObjNum, m_pEncryptDict) < 0) {
- return -1;
- }
- m_ObjectOffset.Add(m_dwLastObjNum, 1);
- m_ObjectOffset[m_dwLastObjNum] = saveOffset;
- m_ObjectSize.Add(m_dwLastObjNum, 1);
- m_ObjectSize[m_dwLastObjNum] = m_Offset - saveOffset;
- m_dwEnryptObjNum = m_dwLastObjNum;
- if (m_dwFlags & FPDFCREATE_INCREMENTAL) {
- m_NewObjNumArray.Add(m_dwLastObjNum);
- }
- }
- m_iStage = 80;
- }
- return m_iStage;
-}
-FX_INT32 CPDF_Creator::WriteDoc_Stage3(IFX_Pause *pPause)
-{
- FXSYS_assert(m_iStage >= 80 || m_iStage < 90);
- FX_DWORD dwLastObjNum = m_dwLastObjNum;
- if (m_iStage == 80) {
- m_XrefStart = m_Offset;
- if (m_dwFlags & FPDFCREATE_OBJECTSTREAM) {
- m_pXRefStream->End(this, TRUE);
- m_XrefStart = m_pXRefStream->m_PrevOffset;
- m_iStage = 90;
- } else if ((m_dwFlags & FPDFCREATE_INCREMENTAL) == 0 || !m_pParser->IsXRefStream()) {
- if ((m_dwFlags & FPDFCREATE_INCREMENTAL) == 0 || m_pParser->GetLastXRefOffset() == 0) {
- CFX_ByteString str;
- str = m_ObjectOffset.GetPtrAt(1) ? FX_BSTRC("xref\r\n") : FX_BSTRC("xref\r\n0 1\r\n0000000000 65536 f\r\n");
- if (m_File.AppendString(str) < 0) {
- return -1;
- }
- m_Pos = (FX_LPVOID)(FX_UINTPTR)1;
- m_iStage = 81;
- } else {
- if (m_File.AppendString(FX_BSTRC("xref\r\n")) < 0) {
- return -1;
- }
- m_Pos = (FX_LPVOID)(FX_UINTPTR)0;
- m_iStage = 82;
- }
- } else {
- m_iStage = 90;
- }
- }
- if (m_iStage == 81) {
- CFX_ByteString str;
- FX_DWORD i = (FX_DWORD)(FX_UINTPTR)m_Pos, j;
- while (i <= dwLastObjNum) {
- while (i <= dwLastObjNum && !m_ObjectOffset.GetPtrAt(i)) {
- i++;
- }
- if (i > dwLastObjNum) {
- break;
- }
- j = i;
- while (j <= dwLastObjNum && m_ObjectOffset.GetPtrAt(j)) {
- j++;
- }
- if (i == 1) {
- str.Format("0 %d\r\n0000000000 65536 f\r\n", j);
- } else {
- str.Format("%d %d\r\n", i, j - i);
- }
- if (m_File.AppendBlock((FX_LPCSTR)str, str.GetLength()) < 0) {
- return -1;
- }
- while (i < j) {
- str.Format("%010d 00000 n\r\n", m_ObjectOffset[i ++]);
- if (m_File.AppendBlock((FX_LPCSTR)str, str.GetLength()) < 0) {
- return -1;
- }
- }
- if (i > dwLastObjNum) {
- break;
- }
- if (pPause && pPause->NeedToPauseNow()) {
- m_Pos = (FX_LPVOID)(FX_UINTPTR)i;
- return 1;
- }
- }
- m_iStage = 90;
- }
- if (m_iStage == 82) {
- CFX_ByteString str;
- FX_INT32 iCount = m_NewObjNumArray.GetSize();
- FX_INT32 i = (FX_INT32)(FX_UINTPTR)m_Pos;
- while (i < iCount) {
- FX_INT32 j = i;
- FX_DWORD objnum = m_NewObjNumArray.ElementAt(i);
- while (j < iCount) {
- if (++j == iCount) {
- break;
- }
- FX_DWORD dwCurrent = m_NewObjNumArray.ElementAt(j);
- if (dwCurrent - objnum > 1) {
- break;
- }
- objnum = dwCurrent;
- }
- objnum = m_NewObjNumArray.ElementAt(i);
- if (objnum == 1) {
- str.Format("0 %d\r\n0000000000 65536 f\r\n", j - i + 1);
- } else {
- str.Format("%d %d\r\n", objnum, j - i);
- }
- if (m_File.AppendBlock((FX_LPCSTR)str, str.GetLength()) < 0) {
- return -1;
- }
- while (i < j) {
- objnum = m_NewObjNumArray.ElementAt(i++);
- str.Format("%010d 00000 n\r\n", m_ObjectOffset[objnum]);
- if (m_File.AppendBlock((FX_LPCSTR)str, str.GetLength()) < 0) {
- return -1;
- }
- }
- if (pPause && (i % 100) == 0 && pPause->NeedToPauseNow()) {
- m_Pos = (FX_LPVOID)(FX_UINTPTR)i;
- return 1;
- }
- }
- m_iStage = 90;
- }
- return m_iStage;
-}
-static FX_INT32 _OutPutIndex(CFX_FileBufferArchive* pFile, FX_FILESIZE offset)
-{
- FXSYS_assert(pFile);
- if (sizeof(offset) > 4) {
- if (FX_GETBYTEOFFSET32(offset)) {
- if (pFile->AppendByte(FX_GETBYTEOFFSET56(offset)) < 0) {
- return -1;
- }
- if (pFile->AppendByte(FX_GETBYTEOFFSET48(offset)) < 0) {
- return -1;
- }
- if (pFile->AppendByte(FX_GETBYTEOFFSET40(offset)) < 0) {
- return -1;
- }
- if (pFile->AppendByte(FX_GETBYTEOFFSET32(offset)) < 0) {
- return -1;
- }
- }
- }
- if (pFile->AppendByte(FX_GETBYTEOFFSET24(offset)) < 0) {
- return -1;
- }
- if (pFile->AppendByte(FX_GETBYTEOFFSET16(offset)) < 0) {
- return -1;
- }
- if (pFile->AppendByte(FX_GETBYTEOFFSET8(offset)) < 0) {
- return -1;
- }
- if (pFile->AppendByte(FX_GETBYTEOFFSET0(offset)) < 0) {
- return -1;
- }
- if (pFile->AppendByte(0) < 0) {
- return -1;
- }
- return 0;
-}
-FX_INT32 CPDF_Creator::WriteDoc_Stage4(IFX_Pause *pPause)
-{
- FXSYS_assert(m_iStage >= 90);
- if ((m_dwFlags & FPDFCREATE_OBJECTSTREAM) == 0) {
- FX_BOOL bXRefStream = (m_dwFlags & FPDFCREATE_INCREMENTAL) != 0 && m_pParser->IsXRefStream();
- if (!bXRefStream) {
- if (m_File.AppendString(FX_BSTRC("trailer\r\n<<")) < 0) {
- return -1;
- }
- } else {
- if (m_File.AppendDWord(m_pDocument->m_LastObjNum + 1) < 0) {
- return -1;
- }
- if (m_File.AppendString(FX_BSTRC(" 0 obj <<")) < 0) {
- return -1;
- }
- }
- if (m_pParser) {
- CPDF_Dictionary* p = m_pParser->m_pTrailer;
- FX_POSITION pos = p->GetStartPos();
- while (pos) {
- CFX_ByteString key;
- CPDF_Object* pValue = p->GetNextElement(pos, key);
- if (key == FX_BSTRC("Encrypt") || key == FX_BSTRC("Size") || key == FX_BSTRC("Filter") ||
- key == FX_BSTRC("Index") || key == FX_BSTRC("Length") || key == FX_BSTRC("Prev") ||
- key == FX_BSTRC("W") || key == FX_BSTRC("XRefStm") || key == FX_BSTRC("ID")) {
- continue;
- }
- if (m_File.AppendString((FX_BSTRC("/"))) < 0) {
- return -1;
- }
- if (m_File.AppendString(PDF_NameEncode(key)) < 0) {
- return -1;
- }
- if (pValue->GetObjNum()) {
- if (m_File.AppendString(FX_BSTRC(" ")) < 0) {
- return -1;
- }
- if (m_File.AppendDWord(pValue->GetObjNum()) < 0) {
- return -1;
- }
- if (m_File.AppendString(FX_BSTRC(" 0 R ")) < 0) {
- return -1;
- }
- } else {
- FX_FILESIZE offset = 0;
- if (PDF_CreatorAppendObject(pValue, &m_File, offset) < 0) {
- return -1;
- }
- }
- }
- } else {
- if (m_File.AppendString(FX_BSTRC("\r\n/Root ")) < 0) {
- return -1;
- }
- if (m_File.AppendDWord(m_pDocument->m_pRootDict->GetObjNum()) < 0) {
- return -1;
- }
- if (m_File.AppendString(FX_BSTRC(" 0 R\r\n")) < 0) {
- return -1;
- }
- if (m_pDocument->m_pInfoDict) {
- if (m_File.AppendString(FX_BSTRC("/Info ")) < 0) {
- return -1;
- }
- if (m_File.AppendDWord(m_pDocument->m_pInfoDict->GetObjNum()) < 0) {
- return -1;
- }
- if (m_File.AppendString(FX_BSTRC(" 0 R\r\n")) < 0) {
- return -1;
- }
- }
- }
- if (m_pEncryptDict) {
- if (m_File.AppendString(FX_BSTRC("/Encrypt")) < 0) {
- return -1;
- }
- FX_DWORD dwObjNum = m_pEncryptDict->GetObjNum();
- if (dwObjNum == 0) {
- dwObjNum = m_pDocument->GetLastObjNum() + 1;
- }
- if (m_File.AppendString(FX_BSTRC(" ")) < 0) {
- return -1;
- }
- if (m_File.AppendDWord(dwObjNum) < 0) {
- return -1;
- }
- if (m_File.AppendString(FX_BSTRC(" 0 R ")) < 0) {
- return -1;
- }
- }
- if (m_File.AppendString(FX_BSTRC("/Size ")) < 0) {
- return -1;
- }
- if (m_File.AppendDWord(m_dwLastObjNum + (bXRefStream ? 2 : 1)) < 0) {
- return -1;
- }
- if ((m_dwFlags & FPDFCREATE_INCREMENTAL) != 0) {
- FX_FILESIZE prev = m_pParser->GetLastXRefOffset();
- if (prev) {
- if (m_File.AppendString(FX_BSTRC("/Prev ")) < 0) {
- return -1;
- }
- FX_CHAR offset_buf[20];
- FXSYS_memset32(offset_buf, 0, sizeof(offset_buf));
- FXSYS_i64toa(prev, offset_buf, 10);
- if (m_File.AppendBlock(offset_buf, FXSYS_strlen(offset_buf)) < 0) {
- return -1;
- }
- }
- }
- if (m_pIDArray) {
- if (m_File.AppendString((FX_BSTRC("/ID"))) < 0) {
- return -1;
- }
- FX_FILESIZE offset = 0;
- if (PDF_CreatorAppendObject(m_pIDArray, &m_File, offset) < 0) {
- return -1;
- }
- }
- if (!bXRefStream) {
- if (m_File.AppendString(FX_BSTRC(">>")) < 0) {
- return -1;
- }
- } else {
- if (m_File.AppendString(FX_BSTRC("/W[0 4 1]/Index[")) < 0) {
- return -1;
- }
- if ((m_dwFlags & FPDFCREATE_INCREMENTAL) != 0 && m_pParser && m_pParser->GetLastXRefOffset() == 0) {
- FX_DWORD i = 0;
- for (i = 0; i < m_dwLastObjNum; i++) {
- if (!m_ObjectOffset.GetPtrAt(i)) {
- continue;
- }
- if (m_File.AppendDWord(i) < 0) {
- return -1;
- }
- if (m_File.AppendString(FX_BSTRC(" 1 ")) < 0) {
- return -1;
- }
- }
- if (m_File.AppendString(FX_BSTRC("]/Length ")) < 0) {
- return -1;
- }
- if (m_File.AppendDWord(m_dwLastObjNum * 5) < 0) {
- return -1;
- }
- if (m_File.AppendString(FX_BSTRC(">>stream\r\n")) < 0) {
- return -1;
- }
- for (i = 0; i < m_dwLastObjNum; i++) {
- FX_FILESIZE* offset = m_ObjectOffset.GetPtrAt(i);
- if (!offset) {
- continue;
- }
- _OutPutIndex(&m_File, *offset);
- }
- } else {
- int count = m_NewObjNumArray.GetSize();
- FX_INT32 i = 0;
- for (i = 0; i < count; i++) {
- FX_DWORD objnum = m_NewObjNumArray.ElementAt(i);
- if (m_File.AppendDWord(objnum) < 0) {
- return -1;
- }
- if (m_File.AppendString(FX_BSTRC(" 1 ")) < 0) {
- return -1;
- }
- }
- if (m_File.AppendString(FX_BSTRC("]/Length ")) < 0) {
- return -1;
- }
- if (m_File.AppendDWord(count * 5) < 0) {
- return -1;
- }
- if (m_File.AppendString(FX_BSTRC(">>stream\r\n")) < 0) {
- return -1;
- }
- for (i = 0; i < count; i++) {
- FX_DWORD objnum = m_NewObjNumArray.ElementAt(i);
- FX_FILESIZE offset = m_ObjectOffset[objnum];
- _OutPutIndex(&m_File, offset);
- }
- }
- if (m_File.AppendString(FX_BSTRC("\r\nendstream")) < 0) {
- return -1;
- }
- }
- }
- if (m_File.AppendString(FX_BSTRC("\r\nstartxref\r\n")) < 0) {
- return -1;
- }
- FX_CHAR offset_buf[20];
- FXSYS_memset32(offset_buf, 0, sizeof(offset_buf));
- FXSYS_i64toa(m_XrefStart, offset_buf, 10);
- if (m_File.AppendBlock(offset_buf, FXSYS_strlen(offset_buf)) < 0) {
- return -1;
- }
- if (m_File.AppendString(FX_BSTRC("\r\n%%EOF\r\n")) < 0) {
- return -1;
- }
- m_File.Flush();
- return m_iStage = 100;
-}
-void CPDF_Creator::Clear()
-{
- if (m_pXRefStream) {
- delete m_pXRefStream;
- m_pXRefStream = NULL;
- }
- m_File.Clear();
- m_NewObjNumArray.RemoveAll();
- if (m_pIDArray) {
- m_pIDArray->Release();
- m_pIDArray = NULL;
- }
-}
-FX_BOOL CPDF_Creator::Create(FX_LPCSTR filename, FX_DWORD flags)
-{
- if (!m_File.AttachFile(filename)) {
- return FALSE;
- }
- FX_BOOL bRet = Create(flags);
- if (!bRet || !(flags & FPDFCREATE_PROGRESSIVE)) {
- Clear();
- }
- return bRet;
-}
-FX_BOOL CPDF_Creator::Create(FX_LPCWSTR filename, FX_DWORD flags)
-{
- if (!m_File.AttachFile(filename)) {
- return FALSE;
- }
- FX_BOOL bRet = Create(flags);
- if (!bRet || !(flags & FPDFCREATE_PROGRESSIVE)) {
- Clear();
- }
- return bRet;
-}
-FX_BOOL CPDF_Creator::Create(IFX_StreamWrite* pFile, FX_DWORD flags)
-{
- if (!pFile) {
- return FALSE;
- }
- if (!m_File.AttachFile(pFile, FALSE)) {
- return FALSE;
- }
- return Create(flags);
-}
-FX_BOOL CPDF_Creator::Create(FX_DWORD flags)
-{
- m_dwFlags = flags;
- m_iStage = 0;
- m_Offset = 0;
- m_dwLastObjNum = m_pDocument->GetLastObjNum();
- m_ObjectOffset.Clear();
- m_ObjectSize.Clear();
- m_NewObjNumArray.RemoveAll();
- InitID();
- if (flags & FPDFCREATE_PROGRESSIVE) {
- return TRUE;
- }
- return Continue(NULL) > -1;
-}
-void CPDF_Creator::InitID(FX_BOOL bDefault )
-{
- CPDF_Array* pOldIDArray = m_pParser ? m_pParser->GetIDArray() : NULL;
- FX_BOOL bNewId = !m_pIDArray;
- if (!m_pIDArray) {
- FX_LPDWORD pBuffer = NULL;
- m_pIDArray = CPDF_Array::Create();
- CPDF_Object* pID1 = pOldIDArray->GetElement(0);
- if (pID1) {
- m_pIDArray->Add(pID1->Clone());
- } else {
- pBuffer = FX_Alloc(FX_DWORD, 4);
- PDF_GenerateFileID((FX_DWORD)(FX_UINTPTR)this, m_dwLastObjNum, pBuffer);
- CFX_ByteStringC bsBuffer((FX_LPCBYTE)pBuffer, 4 * sizeof(FX_DWORD));
- m_pIDArray->Add(CPDF_String::Create(bsBuffer, TRUE), m_pDocument);
- }
- if (pBuffer) {
- FX_Free(pBuffer);
- }
- }
- if (!bDefault) {
- return;
- }
- if (pOldIDArray) {
- CPDF_Object* pID2 = pOldIDArray->GetElement(1);
- if ((m_dwFlags & FPDFCREATE_INCREMENTAL) && m_pEncryptDict && pID2) {
- m_pIDArray->Add(pID2->Clone());
- return;
- }
- FX_LPDWORD pBuffer = FX_Alloc(FX_DWORD, 4);
- PDF_GenerateFileID((FX_DWORD)(FX_UINTPTR)this, m_dwLastObjNum, pBuffer);
- CFX_ByteStringC bsBuffer((FX_LPCBYTE)pBuffer, 4 * sizeof(FX_DWORD));
- m_pIDArray->Add(CPDF_String::Create(bsBuffer, TRUE), m_pDocument);
- FX_Free(pBuffer);
- return;
- }
- m_pIDArray->Add(m_pIDArray->GetElement(0)->Clone());
- if (m_pEncryptDict && !pOldIDArray && m_pParser && bNewId) {
- if (m_pEncryptDict->GetString(FX_BSTRC("Filter")) == FX_BSTRC("Standard")) {
- CPDF_StandardSecurityHandler handler;
- CFX_ByteString user_pass = m_pParser->GetPassword();
- FX_DWORD flag = PDF_ENCRYPT_CONTENT;
- handler.OnCreate(m_pEncryptDict, m_pIDArray, (FX_LPCBYTE)user_pass, user_pass.GetLength(), flag);
- if (m_pCryptoHandler && m_bNewCrypto) {
- delete m_pCryptoHandler;
- }
- m_pCryptoHandler = FX_NEW CPDF_StandardCryptoHandler;
- m_pCryptoHandler->Init(m_pEncryptDict, &handler);
- m_bNewCrypto = TRUE;
- m_bSecurityChanged = TRUE;
- }
- }
-}
-FX_INT32 CPDF_Creator::Continue(IFX_Pause *pPause)
-{
- if (m_iStage < 0) {
- return m_iStage;
- }
- FX_INT32 iRet;
- while (m_iStage < 100) {
- if (m_iStage < 20) {
- iRet = WriteDoc_Stage1(pPause);
- } else if (m_iStage < 30) {
- iRet = WriteDoc_Stage2(pPause);
- } else if (m_iStage < 90) {
- iRet = WriteDoc_Stage3(pPause);
- } else {
- iRet = WriteDoc_Stage4(pPause);
- }
- if (iRet < m_iStage) {
- break;
- }
- }
- if (iRet < 1 || m_iStage == 100) {
- m_iStage = -1;
- Clear();
- return iRet > 99 ? 0 : (iRet < 1 ? -1 : iRet);
- }
- return m_iStage;
-}
-FX_BOOL CPDF_Creator::SetFileVersion(FX_INT32 fileVersion )
-{
- if (fileVersion < 10 || fileVersion > 17) {
- return FALSE;
- }
- m_FileVersion = fileVersion;
- return TRUE;
-}
-void CPDF_Creator::ResetStandardSecurity()
-{
- if ((m_bStandardSecurity || m_bNewCrypto) && m_pCryptoHandler) {
- delete m_pCryptoHandler;
- m_pCryptoHandler = NULL;
- }
- m_bNewCrypto = FALSE;
- if (!m_bStandardSecurity) {
- return;
- }
- if (m_pEncryptDict) {
- m_pEncryptDict->Release();
- m_pEncryptDict = NULL;
- }
- m_bStandardSecurity = FALSE;
-}
+// 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
+
+#include "../../../include/fpdfapi/fpdf_serial.h"
+#include "editint.h"
+#define PDF_OBJECTSTREAM_MAXLENGTH (256 * 1024)
+#define PDF_XREFSTREAM_MAXSIZE 10000
+extern void FlateEncode(const FX_BYTE* src_buf, FX_DWORD src_data, FX_LPBYTE& dest_buf, FX_DWORD& dest_size);
+extern void FlateEncode(FX_LPCBYTE src_buf, FX_DWORD src_size, int predictor, int Colors, int BitsPerComponent, int Columns,
+ FX_LPBYTE& dest_buf, FX_DWORD& dest_size);
+extern FX_BOOL IsSignatureDict(const CPDF_Dictionary* pDict);
+FX_INT32 PDF_CreatorAppendObject(const CPDF_Object* pObj, CFX_FileBufferArchive *pFile, FX_FILESIZE& offset)
+{
+ FX_INT32 len = 0;
+ if (pObj == NULL) {
+ if (pFile->AppendString(FX_BSTRC(" null")) < 0) {
+ return -1;
+ }
+ offset += 5;
+ return 1;
+ }
+ switch (pObj->GetType()) {
+ case PDFOBJ_NULL:
+ if (pFile->AppendString(FX_BSTRC(" null")) < 0) {
+ return -1;
+ }
+ offset += 5;
+ break;
+ case PDFOBJ_BOOLEAN:
+ case PDFOBJ_NUMBER:
+ if (pFile->AppendString(FX_BSTRC(" ")) < 0) {
+ return -1;
+ }
+ if ((len = pFile->AppendString(pObj->GetString())) < 0) {
+ return -1;
+ }
+ offset += len + 1;
+ break;
+ case PDFOBJ_STRING: {
+ CFX_ByteString str = pObj->GetString();
+ FX_BOOL bHex = ((CPDF_String*)pObj)->IsHex();
+ if ((len = pFile->AppendString(PDF_EncodeString(str, bHex))) < 0) {
+ return -1;
+ }
+ offset += len;
+ break;
+ }
+ case PDFOBJ_NAME: {
+ if (pFile->AppendString(FX_BSTRC("/")) < 0) {
+ return -1;
+ }
+ CFX_ByteString str = pObj->GetString();
+ if ((len = pFile->AppendString(PDF_NameEncode(str))) < 0) {
+ return -1;
+ }
+ offset += len + 1;
+ break;
+ }
+ case PDFOBJ_REFERENCE: {
+ if (pFile->AppendString(FX_BSTRC(" ")) < 0) {
+ return -1;
+ }
+ CPDF_Reference* p = (CPDF_Reference*)pObj;
+ if ((len = pFile->AppendDWord(p->GetRefObjNum())) < 0) {
+ return -1;
+ }
+ if (pFile->AppendString(FX_BSTRC(" 0 R ")) < 0) {
+ return -1;
+ }
+ offset += len + 6;
+ break;
+ }
+ case PDFOBJ_ARRAY: {
+ if (pFile->AppendString(FX_BSTRC("[")) < 0) {
+ return -1;
+ }
+ offset += 1;
+ CPDF_Array* p = (CPDF_Array*)pObj;
+ for (FX_DWORD i = 0; i < p->GetCount(); i ++) {
+ CPDF_Object* pElement = p->GetElement(i);
+ if (pElement->GetObjNum()) {
+ if (pFile->AppendString(FX_BSTRC(" ")) < 0) {
+ return -1;
+ }
+ if ((len = pFile->AppendDWord(pElement->GetObjNum())) < 0) {
+ return -1;
+ }
+ if (pFile->AppendString(FX_BSTRC(" 0 R")) < 0) {
+ return -1;
+ }
+ offset += len + 5;
+ } else {
+ if (PDF_CreatorAppendObject(pElement, pFile, offset) < 0) {
+ return -1;
+ }
+ }
+ }
+ if (pFile->AppendString(FX_BSTRC("]")) < 0) {
+ return -1;
+ }
+ offset += 1;
+ break;
+ }
+ case PDFOBJ_DICTIONARY: {
+ if (pFile->AppendString(FX_BSTRC("<<")) < 0) {
+ return -1;
+ }
+ offset += 2;
+ CPDF_Dictionary* p = (CPDF_Dictionary*)pObj;
+ FX_POSITION pos = p->GetStartPos();
+ while (pos) {
+ CFX_ByteString key;
+ CPDF_Object* pValue = p->GetNextElement(pos, key);
+ if (pFile->AppendString(FX_BSTRC("/")) < 0) {
+ return -1;
+ }
+ if ((len = pFile->AppendString(PDF_NameEncode(key))) < 0) {
+ return -1;
+ }
+ offset += len + 1;
+ if (pValue->GetObjNum()) {
+ if (pFile->AppendString(FX_BSTRC(" ")) < 0) {
+ return -1;
+ }
+ if ((len = pFile->AppendDWord(pValue->GetObjNum())) < 0) {
+ return -1;
+ }
+ if (pFile->AppendString(FX_BSTRC(" 0 R")) < 0) {
+ return -1;
+ }
+ offset += len + 5;
+ } else {
+ if (PDF_CreatorAppendObject(pValue, pFile, offset) < 0) {
+ return -1;
+ }
+ }
+ }
+ if (pFile->AppendString(FX_BSTRC(">>")) < 0) {
+ return -1;
+ }
+ offset += 2;
+ break;
+ }
+ case PDFOBJ_STREAM: {
+ CPDF_Stream* p = (CPDF_Stream*)pObj;
+ if (PDF_CreatorAppendObject(p->GetDict(), pFile, offset) < 0) {
+ return -1;
+ }
+ if (pFile->AppendString(FX_BSTRC("stream\r\n")) < 0) {
+ return -1;
+ }
+ offset += 8;
+ CPDF_StreamAcc acc;
+ acc.LoadAllData(p, TRUE);
+ if (pFile->AppendBlock(acc.GetData(), acc.GetSize()) < 0) {
+ return -1;
+ }
+ offset += acc.GetSize();
+ if ((len = pFile->AppendString(FX_BSTRC("\r\nendstream"))) < 0) {
+ return -1;
+ }
+ offset += len;
+ break;
+ }
+ default:
+ ASSERT(FALSE);
+ break;
+ }
+ return 1;
+}
+FX_INT32 PDF_CreatorWriteTrailer(CPDF_Document* pDocument, CFX_FileBufferArchive* pFile, CPDF_Array* pIDArray, FX_BOOL bCompress)
+{
+ FX_FILESIZE offset = 0;
+ FX_INT32 len = 0;
+ FXSYS_assert(pDocument && pFile);
+ CPDF_Parser *pParser = (CPDF_Parser*)pDocument->GetParser();
+ if (pParser) {
+ CPDF_Dictionary* p = pParser->GetTrailer();
+ FX_POSITION pos = p->GetStartPos();
+ while (pos) {
+ CFX_ByteString key;
+ CPDF_Object* pValue = p->GetNextElement(pos, key);
+ if (key == FX_BSTRC("Encrypt") || key == FX_BSTRC("Size") || key == FX_BSTRC("Filter") ||
+ key == FX_BSTRC("Index") || key == FX_BSTRC("Length") || key == FX_BSTRC("Prev") ||
+ key == FX_BSTRC("W") || key == FX_BSTRC("XRefStm") || key == FX_BSTRC("Type") || key == FX_BSTRC("ID")) {
+ continue;
+ }
+ if (bCompress && key == FX_BSTRC("DecodeParms")) {
+ continue;
+ }
+ if (pFile->AppendString((FX_BSTRC("/"))) < 0) {
+ return -1;
+ }
+ if ((len = pFile->AppendString(PDF_NameEncode(key))) < 0) {
+ return -1;
+ }
+ offset += len + 1;
+ if (pValue->GetObjNum()) {
+ if (pFile->AppendString(FX_BSTRC(" ")) < 0) {
+ return -1;
+ }
+ if ((len = pFile->AppendDWord(pValue->GetObjNum())) < 0) {
+ return -1;
+ }
+ if (pFile->AppendString(FX_BSTRC(" 0 R ")) < 0) {
+ return -1;
+ }
+ offset += len + 6;
+ } else {
+ if (PDF_CreatorAppendObject(pValue, pFile, offset) < 0) {
+ return -1;
+ }
+ }
+ }
+ if (pIDArray) {
+ if (pFile->AppendString((FX_BSTRC("/ID"))) < 0) {
+ return -1;
+ }
+ offset += 3;
+ if (PDF_CreatorAppendObject(pIDArray, pFile, offset) < 0) {
+ return -1;
+ }
+ }
+ return offset;
+ }
+ if (pFile->AppendString(FX_BSTRC("\r\n/Root ")) < 0) {
+ return -1;
+ }
+ if ((len = pFile->AppendDWord(pDocument->GetRoot()->GetObjNum())) < 0) {
+ return -1;
+ }
+ if (pFile->AppendString(FX_BSTRC(" 0 R\r\n")) < 0) {
+ return -1;
+ }
+ offset += len + 14;
+ if (pDocument->GetInfo()) {
+ if (pFile->AppendString(FX_BSTRC("/Info ")) < 0) {
+ return -1;
+ }
+ if ((len = pFile->AppendDWord(pDocument->GetInfo()->GetObjNum())) < 0) {
+ return -1;
+ }
+ if (pFile->AppendString(FX_BSTRC(" 0 R\r\n")) < 0) {
+ return -1;
+ }
+ offset += len + 12;
+ }
+ if (pIDArray) {
+ if (pFile->AppendString((FX_BSTRC("/ID"))) < 0) {
+ return -1;
+ }
+ offset += 3;
+ if (PDF_CreatorAppendObject(pIDArray, pFile, offset) < 0) {
+ return -1;
+ }
+ }
+ return offset;
+}
+FX_INT32 PDF_CreatorWriteEncrypt(const CPDF_Dictionary* pEncryptDict, FX_DWORD dwObjNum, CFX_FileBufferArchive *pFile)
+{
+ if (!pEncryptDict) {
+ return 0;
+ }
+ FXSYS_assert(pFile);
+ FX_FILESIZE offset = 0;
+ FX_INT32 len = 0;
+ if (pFile->AppendString(FX_BSTRC("/Encrypt")) < 0) {
+ return -1;
+ }
+ offset += 8;
+ if (pFile->AppendString(FX_BSTRC(" ")) < 0) {
+ return -1;
+ }
+ if ((len = pFile->AppendDWord(dwObjNum)) < 0) {
+ return -1;
+ }
+ if (pFile->AppendString(FX_BSTRC(" 0 R ")) < 0) {
+ return -1;
+ }
+ offset += len + 6;
+ return offset;
+}
+FX_BOOL PDF_GenerateFileID(FX_DWORD dwSeed1, FX_DWORD dwSeed2, FX_LPDWORD pBuffer)
+{
+ if (!pBuffer) {
+ return FALSE;
+ }
+ FX_LPVOID pContext = FX_Random_MT_Start(dwSeed1);
+ FX_INT32 i = 0;
+ for (i = 0; i < 2; i++) {
+ *pBuffer++ = FX_Random_MT_Generate(pContext);
+ }
+ FX_Random_MT_Close(pContext);
+ pContext = FX_Random_MT_Start(dwSeed2);
+ for (i = 0; i < 2; i++) {
+ *pBuffer++ = FX_Random_MT_Generate(pContext);
+ }
+ FX_Random_MT_Close(pContext);
+ return TRUE;
+}
+class CPDF_FlateEncoder
+{
+public:
+ CPDF_FlateEncoder();
+ ~CPDF_FlateEncoder();
+ FX_BOOL Initialize(CPDF_Stream* pStream, FX_BOOL bFlateEncode);
+ FX_BOOL Initialize(FX_LPCBYTE pBuffer, FX_DWORD size, FX_BOOL bFlateEncode, FX_BOOL bXRefStream = FALSE);
+ void CloneDict();
+ FX_LPBYTE m_pData;
+ FX_DWORD m_dwSize;
+ CPDF_Dictionary* m_pDict;
+ FX_BOOL m_bCloned;
+ FX_BOOL m_bNewData;
+ CPDF_StreamAcc m_Acc;
+};
+CPDF_FlateEncoder::CPDF_FlateEncoder()
+{
+ m_pData = NULL;
+ m_dwSize = 0;
+ m_pDict = NULL;
+ m_bCloned = FALSE;
+ m_bNewData = FALSE;
+}
+void CPDF_FlateEncoder::CloneDict()
+{
+ if (!m_bCloned) {
+ m_pDict = (CPDF_Dictionary*)m_pDict->Clone();
+ m_bCloned = TRUE;
+ }
+}
+FX_BOOL CPDF_FlateEncoder::Initialize(CPDF_Stream* pStream, FX_BOOL bFlateEncode)
+{
+ m_Acc.LoadAllData(pStream, TRUE);
+ if (pStream->GetDict()->KeyExist("Filter") || !bFlateEncode) {
+ if (pStream->GetDict()->KeyExist("Filter") && !bFlateEncode) {
+ CPDF_StreamAcc destAcc;
+ destAcc.LoadAllData(pStream);
+ m_dwSize = destAcc.GetSize();
+ m_pData = (FX_LPBYTE)destAcc.DetachData();
+ m_pDict = (CPDF_Dictionary*)pStream->GetDict()->Clone();
+ m_pDict->RemoveAt(FX_BSTRC("Filter"));
+ m_bNewData = TRUE;
+ m_bCloned = TRUE;
+ } else {
+ m_pData = (FX_LPBYTE)m_Acc.GetData();
+ m_dwSize = m_Acc.GetSize();
+ m_pDict = pStream->GetDict();
+ }
+ return TRUE;
+ }
+ m_pData = NULL;
+ m_dwSize = 0;
+ m_bNewData = TRUE;
+ m_bCloned = TRUE;
+ ::FlateEncode(m_Acc.GetData(), m_Acc.GetSize(), m_pData, m_dwSize);
+ m_pDict = (CPDF_Dictionary*)pStream->GetDict()->Clone();
+ m_pDict->SetAtInteger("Length", m_dwSize);
+ m_pDict->SetAtName("Filter", "FlateDecode");
+ m_pDict->RemoveAt("DecodeParms");
+ return TRUE;
+}
+FX_BOOL CPDF_FlateEncoder::Initialize(FX_LPCBYTE pBuffer, FX_DWORD size, FX_BOOL bFlateEncode, FX_BOOL bXRefStream)
+{
+ if (!bFlateEncode) {
+ m_pData = (FX_LPBYTE)pBuffer;
+ m_dwSize = size;
+ return TRUE;
+ }
+ m_bNewData = TRUE;
+ if (bXRefStream) {
+ ::FlateEncode(pBuffer, size, 12, 1, 8, 7, m_pData, m_dwSize);
+ } else {
+ ::FlateEncode(pBuffer, size, m_pData, m_dwSize);
+ }
+ return TRUE;
+}
+CPDF_FlateEncoder::~CPDF_FlateEncoder()
+{
+ if (m_bCloned && m_pDict) {
+ m_pDict->Release();
+ }
+ if (m_bNewData && m_pData) {
+ FX_Free(m_pData);
+ }
+}
+class CPDF_Encryptor
+{
+public:
+ CPDF_Encryptor();
+ ~CPDF_Encryptor();
+ FX_BOOL Initialize(CPDF_CryptoHandler* pHandler, int objnum, FX_LPBYTE src_data, FX_DWORD src_size);
+ FX_LPBYTE m_pData;
+ FX_DWORD m_dwSize;
+ FX_BOOL m_bNewBuf;
+};
+CPDF_Encryptor::CPDF_Encryptor()
+{
+ m_pData = NULL;
+ m_dwSize = 0;
+ m_bNewBuf = FALSE;
+}
+FX_BOOL CPDF_Encryptor::Initialize(CPDF_CryptoHandler* pHandler, int objnum, FX_LPBYTE src_data, FX_DWORD src_size)
+{
+ if (src_size == 0) {
+ return TRUE;
+ }
+ if (pHandler == NULL) {
+ m_pData = (FX_LPBYTE)src_data;
+ m_dwSize = src_size;
+ m_bNewBuf = FALSE;
+ return TRUE;
+ }
+ m_dwSize = pHandler->EncryptGetSize(objnum, 0, src_data, src_size);
+ m_pData = FX_Alloc(FX_BYTE, m_dwSize);
+ if(!m_pData) {
+ return FALSE;
+ }
+ pHandler->EncryptContent(objnum, 0, src_data, src_size, m_pData, m_dwSize);
+ m_bNewBuf = TRUE;
+ return TRUE;
+}
+CPDF_Encryptor::~CPDF_Encryptor()
+{
+ if (m_bNewBuf) {
+ FX_Free(m_pData);
+ }
+}
+CPDF_ObjectStream::CPDF_ObjectStream()
+ : m_dwObjNum(0)
+ , m_index(0)
+{
+}
+FX_BOOL CPDF_ObjectStream::Start()
+{
+ m_ObjNumArray.RemoveAll();
+ m_OffsetArray.RemoveAll();
+ m_Buffer.Clear();
+ m_dwObjNum = 0;
+ m_index = 0;
+ return TRUE;
+}
+FX_INT32 CPDF_ObjectStream::CompressIndirectObject(FX_DWORD dwObjNum, const CPDF_Object *pObj)
+{
+ m_ObjNumArray.Add(dwObjNum);
+ m_OffsetArray.Add(m_Buffer.GetLength());
+ m_Buffer << pObj;
+ return 1;
+}
+FX_INT32 CPDF_ObjectStream::CompressIndirectObject(FX_DWORD dwObjNum, FX_LPCBYTE pBuffer, FX_DWORD dwSize)
+{
+ m_ObjNumArray.Add(dwObjNum);
+ m_OffsetArray.Add(m_Buffer.GetLength());
+ m_Buffer.AppendBlock(pBuffer, dwSize);
+ return 1;
+}
+FX_FILESIZE CPDF_ObjectStream::End(CPDF_Creator* pCreator)
+{
+ FXSYS_assert(pCreator);
+ if (m_ObjNumArray.GetSize() == 0) {
+ return 0;
+ }
+ CFX_FileBufferArchive *pFile = &pCreator->m_File;
+ CPDF_CryptoHandler *pHandler = pCreator->m_pCryptoHandler;
+ FX_FILESIZE ObjOffset = pCreator->m_Offset;
+ if (!m_dwObjNum) {
+ m_dwObjNum = ++pCreator->m_dwLastObjNum;
+ }
+ CFX_ByteTextBuf tempBuffer;
+ FX_INT32 iCount = m_ObjNumArray.GetSize();
+ for (FX_INT32 i = 0; i < iCount; i++) {
+ tempBuffer << m_ObjNumArray.ElementAt(i) << FX_BSTRC(" ") << m_OffsetArray.ElementAt(i) << FX_BSTRC(" ");
+ }
+ FX_FILESIZE &offset = pCreator->m_Offset;
+ FX_INT32 len = pFile->AppendDWord(m_dwObjNum);
+ if (len < 0) {
+ return -1;
+ }
+ offset += len;
+ if ((len = pFile->AppendString(FX_BSTRC(" 0 obj\r\n<</Type /ObjStm /N "))) < 0) {
+ return -1;
+ }
+ offset += len;
+ if ((len = pFile->AppendDWord((FX_DWORD)iCount)) < 0) {
+ return -1;
+ }
+ offset += len;
+ if (pFile->AppendString(FX_BSTRC("/First ")) < 0) {
+ return -1;
+ }
+ if ((len = pFile->AppendDWord((FX_DWORD)tempBuffer.GetLength())) < 0) {
+ return -1;
+ }
+ if (pFile->AppendString(FX_BSTRC("/Length ")) < 0) {
+ return -1;
+ }
+ offset += len + 15;
+ if (!pCreator->m_bCompress && !pHandler) {
+ if ((len = pFile->AppendDWord((FX_DWORD)(tempBuffer.GetLength() + m_Buffer.GetLength()))) < 0) {
+ return -1;
+ }
+ offset += len;
+ if ((len = pFile->AppendString(FX_BSTRC(">>stream\r\n"))) < 0) {
+ return -1;
+ }
+ if (pFile->AppendBlock(tempBuffer.GetBuffer(), tempBuffer.GetLength()) < 0) {
+ return -1;
+ }
+ if (pFile->AppendBlock(m_Buffer.GetBuffer(), m_Buffer.GetLength()) < 0) {
+ return -1;
+ }
+ offset += len + tempBuffer.GetLength() + m_Buffer.GetLength();
+ } else {
+ tempBuffer << m_Buffer;
+ CPDF_FlateEncoder encoder;
+ encoder.Initialize(tempBuffer.GetBuffer(), tempBuffer.GetLength(), pCreator->m_bCompress);
+ CPDF_Encryptor encryptor;
+ encryptor.Initialize(pHandler, m_dwObjNum, encoder.m_pData, encoder.m_dwSize);
+ if ((len = pFile->AppendDWord(encryptor.m_dwSize)) < 0) {
+ return -1;
+ }
+ offset += len;
+ if (pCreator->m_bCompress) {
+ if (pFile->AppendString(FX_BSTRC("/Filter /FlateDecode")) < 0) {
+ return -1;
+ }
+ offset += 20;
+ }
+ if ((len = pFile->AppendString(FX_BSTRC(">>stream\r\n"))) < 0) {
+ return -1;
+ }
+ if (pFile->AppendBlock(encryptor.m_pData, encryptor.m_dwSize) < 0) {
+ return -1;
+ }
+ offset += len + encryptor.m_dwSize;
+ }
+ if ((len = pFile->AppendString(FX_BSTRC("\r\nendstream\r\nendobj\r\n"))) < 0) {
+ return -1;
+ }
+ offset += len;
+ return ObjOffset;
+}
+CPDF_XRefStream::CPDF_XRefStream()
+ : m_PrevOffset(0)
+ , m_iSeg(0)
+ , m_dwTempObjNum(0)
+{
+}
+FX_BOOL CPDF_XRefStream::Start()
+{
+ m_IndexArray.RemoveAll();
+ m_Buffer.Clear();
+ m_iSeg = 0;
+ return TRUE;
+}
+FX_INT32 CPDF_XRefStream::CompressIndirectObject(FX_DWORD dwObjNum, const CPDF_Object *pObj, CPDF_Creator *pCreator)
+{
+ if (!pCreator) {
+ return 0;
+ }
+ m_ObjStream.CompressIndirectObject(dwObjNum, pObj);
+ if (m_ObjStream.m_ObjNumArray.GetSize() < pCreator->m_ObjectStreamSize &&
+ m_ObjStream.m_Buffer.GetLength() < PDF_OBJECTSTREAM_MAXLENGTH) {
+ return 1;
+ }
+ return EndObjectStream(pCreator);
+}
+FX_INT32 CPDF_XRefStream::CompressIndirectObject(FX_DWORD dwObjNum, FX_LPCBYTE pBuffer, FX_DWORD dwSize, CPDF_Creator *pCreator)
+{
+ if (!pCreator) {
+ return 0;
+ }
+ m_ObjStream.CompressIndirectObject(dwObjNum, pBuffer, dwSize);
+ if (m_ObjStream.m_ObjNumArray.GetSize() < pCreator->m_ObjectStreamSize &&
+ m_ObjStream.m_Buffer.GetLength() < PDF_OBJECTSTREAM_MAXLENGTH) {
+ return 1;
+ }
+ return EndObjectStream(pCreator);
+}
+static void _AppendIndex0(CFX_ByteTextBuf& buffer, FX_BOOL bFirstObject = TRUE)
+{
+ buffer.AppendByte(0);
+ buffer.AppendByte(0);
+ buffer.AppendByte(0);
+ buffer.AppendByte(0);
+ buffer.AppendByte(0);
+ if (bFirstObject) {
+ buffer.AppendByte(0xFF);
+ buffer.AppendByte(0xFF);
+ } else {
+ buffer.AppendByte(0);
+ buffer.AppendByte(0);
+ }
+}
+static void _AppendIndex1(CFX_ByteTextBuf& buffer, FX_FILESIZE offset)
+{
+ buffer.AppendByte(1);
+ buffer.AppendByte(FX_GETBYTEOFFSET24(offset));
+ buffer.AppendByte(FX_GETBYTEOFFSET16(offset));
+ buffer.AppendByte(FX_GETBYTEOFFSET8(offset));
+ buffer.AppendByte(FX_GETBYTEOFFSET0(offset));
+ buffer.AppendByte(0);
+ buffer.AppendByte(0);
+}
+static void _AppendIndex2(CFX_ByteTextBuf& buffer, FX_DWORD objnum, FX_INT32 index)
+{
+ buffer.AppendByte(2);
+ buffer.AppendByte(FX_GETBYTEOFFSET24(objnum));
+ buffer.AppendByte(FX_GETBYTEOFFSET16(objnum));
+ buffer.AppendByte(FX_GETBYTEOFFSET8(objnum));
+ buffer.AppendByte(FX_GETBYTEOFFSET0(objnum));
+ buffer.AppendByte(FX_GETBYTEOFFSET8(index));
+ buffer.AppendByte(FX_GETBYTEOFFSET0(index));
+}
+FX_INT32 CPDF_XRefStream::EndObjectStream(CPDF_Creator *pCreator, FX_BOOL bEOF)
+{
+ FX_FILESIZE objOffset = 0;
+ if (bEOF) {
+ objOffset = m_ObjStream.End(pCreator);
+ if (objOffset < 0) {
+ return -1;
+ }
+ }
+ FX_DWORD &dwObjStmNum = m_ObjStream.m_dwObjNum;
+ if (!dwObjStmNum) {
+ dwObjStmNum = ++pCreator->m_dwLastObjNum;
+ }
+ FX_INT32 iSize = m_ObjStream.m_ObjNumArray.GetSize();
+ FX_INT32 iSeg = m_IndexArray.GetSize() / 2;
+ if (!(pCreator->m_dwFlags & FPDFCREATE_INCREMENTAL)) {
+ if (m_dwTempObjNum == 0) {
+ _AppendIndex0(m_Buffer);
+ m_dwTempObjNum++;
+ }
+ FX_DWORD end_num = m_IndexArray.GetAt((iSeg - 1) * 2) + m_IndexArray.GetAt((iSeg - 1) * 2 + 1);
+ int index = 0;
+ for (; m_dwTempObjNum < end_num; m_dwTempObjNum++) {
+ FX_FILESIZE* offset = pCreator->m_ObjectOffset.GetPtrAt(m_dwTempObjNum);
+ if (offset) {
+ if (index >= iSize || m_dwTempObjNum != m_ObjStream.m_ObjNumArray[index]) {
+ _AppendIndex1(m_Buffer, *offset);
+ } else {
+ _AppendIndex2(m_Buffer, dwObjStmNum, index++);
+ }
+ } else {
+ _AppendIndex0(m_Buffer, FALSE);
+ }
+ }
+ if (iSize > 0 && bEOF) {
+ pCreator->m_ObjectOffset.Add(dwObjStmNum, 1);
+ pCreator->m_ObjectSize.Add(dwObjStmNum, 1);
+ pCreator->m_ObjectOffset[dwObjStmNum] = objOffset;
+ }
+ m_iSeg = iSeg;
+ if (bEOF) {
+ m_ObjStream.Start();
+ }
+ return 1;
+ }
+ FX_INT32 &j = m_ObjStream.m_index;
+ for (int i = m_iSeg; i < iSeg; i++) {
+ FX_DWORD start = m_IndexArray.ElementAt(i * 2);
+ FX_DWORD end = m_IndexArray.ElementAt(i * 2 + 1) + start;
+ for (FX_DWORD m = start; m < end; m++) {
+ if (j >= iSize || m != m_ObjStream.m_ObjNumArray.ElementAt(j)) {
+ _AppendIndex1(m_Buffer, pCreator->m_ObjectOffset[m]);
+ } else {
+ _AppendIndex2(m_Buffer, dwObjStmNum, j++);
+ }
+ }
+ }
+ if (iSize > 0 && bEOF) {
+ _AppendIndex1(m_Buffer, objOffset);
+ m_IndexArray.Add(dwObjStmNum);
+ m_IndexArray.Add(1);
+ iSeg += 1;
+ }
+ m_iSeg = iSeg;
+ if (bEOF) {
+ m_ObjStream.Start();
+ }
+ return 1;
+}
+FX_BOOL CPDF_XRefStream::GenerateXRefStream(CPDF_Creator* pCreator, FX_BOOL bEOF)
+{
+ FX_FILESIZE offset_tmp = pCreator->m_Offset;
+ FX_DWORD objnum = ++pCreator->m_dwLastObjNum;
+ CFX_FileBufferArchive *pFile = &pCreator->m_File;
+ FX_BOOL bIncremental = (pCreator->m_dwFlags & FPDFCREATE_INCREMENTAL) != 0;
+ if (bIncremental) {
+ AddObjectNumberToIndexArray(objnum);
+ } else {
+ for (; m_dwTempObjNum < pCreator->m_dwLastObjNum; m_dwTempObjNum++) {
+ FX_FILESIZE* offset = pCreator->m_ObjectOffset.GetPtrAt(m_dwTempObjNum);
+ if (offset) {
+ _AppendIndex1(m_Buffer, *offset);
+ } else {
+ _AppendIndex0(m_Buffer, FALSE);
+ }
+ }
+ }
+ _AppendIndex1(m_Buffer, offset_tmp);
+ FX_FILESIZE &offset = pCreator->m_Offset;
+ FX_INT32 len = pFile->AppendDWord(objnum);
+ if (len < 0) {
+ return FALSE;
+ }
+ offset += len;
+ if ((len = pFile->AppendString(FX_BSTRC(" 0 obj\r\n<</Type /XRef/W[1 4 2]/Index["))) < 0) {
+ return FALSE;
+ }
+ offset += len;
+ if (!bIncremental) {
+ if ((len = pFile->AppendDWord(0)) < 0) {
+ return FALSE;
+ }
+ if ((len = pFile->AppendString(FX_BSTRC(" "))) < 0) {
+ return FALSE;
+ }
+ offset += len + 1;
+ if ((len = pFile->AppendDWord(objnum + 1)) < 0) {
+ return FALSE;
+ }
+ offset += len;
+ } else {
+ FX_INT32 iSeg = m_IndexArray.GetSize() / 2;
+ for (FX_INT32 i = 0; i < iSeg; i++) {
+ if ((len = pFile->AppendDWord(m_IndexArray.ElementAt(i * 2))) < 0) {
+ return FALSE;
+ }
+ if (pFile->AppendString(FX_BSTRC(" ")) < 0) {
+ return FALSE;
+ }
+ offset += len + 1;
+ if ((len = pFile->AppendDWord(m_IndexArray.ElementAt(i * 2 + 1))) < 0) {
+ return FALSE;
+ }
+ if (pFile->AppendString(FX_BSTRC(" ")) < 0) {
+ return FALSE;
+ }
+ offset += len + 1;
+ }
+ }
+ if (pFile->AppendString(FX_BSTRC("]/Size ")) < 0) {
+ return FALSE;
+ }
+ if ((len = pFile->AppendDWord(objnum + 1)) < 0) {
+ return FALSE;
+ }
+ offset += len + 7;
+ if (m_PrevOffset > 0) {
+ if (pFile->AppendString(FX_BSTRC("/Prev ")) < 0) {
+ return -1;
+ }
+ FX_CHAR offset_buf[20];
+ FXSYS_memset32(offset_buf, 0, sizeof(offset_buf));
+ FXSYS_i64toa(m_PrevOffset, offset_buf, 10);
+ FX_INT32 len = (FX_INT32)FXSYS_strlen(offset_buf);
+ if (pFile->AppendBlock(offset_buf, len) < 0) {
+ return -1;
+ }
+ offset += len + 6;
+ }
+ FX_BOOL bPredictor = TRUE;
+ CPDF_FlateEncoder encoder;
+ encoder.Initialize(m_Buffer.GetBuffer(), m_Buffer.GetLength(), pCreator->m_bCompress, bPredictor);
+ if (pCreator->m_bCompress) {
+ if (pFile->AppendString(FX_BSTRC("/Filter /FlateDecode")) < 0) {
+ return FALSE;
+ }
+ offset += 20;
+ if (bPredictor) {
+ if ((len = pFile->AppendString(FX_BSTRC("/DecodeParms<</Columns 7/Predictor 12>>"))) < 0) {
+ return FALSE;
+ }
+ offset += len;
+ }
+ }
+ if (pFile->AppendString(FX_BSTRC("/Length ")) < 0) {
+ return FALSE;
+ }
+ if ((len = pFile->AppendDWord(encoder.m_dwSize)) < 0) {
+ return FALSE;
+ }
+ offset += len + 8;
+ if (bEOF) {
+ if ((len = PDF_CreatorWriteTrailer(pCreator->m_pDocument, pFile, pCreator->m_pIDArray, pCreator->m_bCompress)) < 0) {
+ return -1;
+ }
+ offset += len;
+ if (pCreator->m_pEncryptDict) {
+ FX_DWORD dwEncryptObjNum = pCreator->m_pEncryptDict->GetObjNum();
+ if (dwEncryptObjNum == 0) {
+ dwEncryptObjNum = pCreator->m_dwEnryptObjNum;
+ }
+ if ((len = PDF_CreatorWriteEncrypt(pCreator->m_pEncryptDict, dwEncryptObjNum, pFile)) < 0) {
+ return -1;
+ }
+ offset += len;
+ }
+ }
+ if ((len = pFile->AppendString(FX_BSTRC(">>stream\r\n"))) < 0) {
+ return FALSE;
+ }
+ offset += len;
+ if (pFile->AppendBlock(encoder.m_pData, encoder.m_dwSize) < 0) {
+ return FALSE;
+ }
+ if ((len = pFile->AppendString(FX_BSTRC("\r\nendstream\r\nendobj\r\n"))) < 0) {
+ return FALSE;
+ }
+ offset += encoder.m_dwSize + len;
+ m_PrevOffset = offset_tmp;
+ return TRUE;
+}
+FX_BOOL CPDF_XRefStream::End(CPDF_Creator *pCreator, FX_BOOL bEOF )
+{
+ if (EndObjectStream(pCreator, bEOF) < 0) {
+ return FALSE;
+ }
+ return GenerateXRefStream(pCreator, bEOF);
+}
+FX_BOOL CPDF_XRefStream::EndXRefStream(CPDF_Creator* pCreator)
+{
+ if (!(pCreator->m_dwFlags & FPDFCREATE_INCREMENTAL)) {
+ _AppendIndex0(m_Buffer);
+ for (FX_DWORD i = 1; i < pCreator->m_dwLastObjNum + 1; i++) {
+ FX_FILESIZE* offset = pCreator->m_ObjectOffset.GetPtrAt(i);
+ if (offset) {
+ _AppendIndex1(m_Buffer, *offset);
+ } else {
+ _AppendIndex0(m_Buffer, FALSE);
+ }
+ }
+ } else {
+ FX_INT32 iSeg = m_IndexArray.GetSize() / 2;
+ for (int i = 0; i < iSeg; i++) {
+ FX_DWORD start = m_IndexArray.ElementAt(i * 2);
+ FX_DWORD end = m_IndexArray.ElementAt(i * 2 + 1) + start;
+ for (FX_DWORD j = start; j < end; j++) {
+ _AppendIndex1(m_Buffer, pCreator->m_ObjectOffset[j]);
+ }
+ }
+ }
+ return GenerateXRefStream(pCreator, FALSE);
+}
+FX_BOOL CPDF_XRefStream::AddObjectNumberToIndexArray(FX_DWORD objnum)
+{
+ FX_INT32 iSize = m_IndexArray.GetSize();
+ if (iSize == 0) {
+ m_IndexArray.Add(objnum);
+ m_IndexArray.Add(1);
+ } else {
+ FXSYS_assert(iSize > 1);
+ FX_DWORD startobjnum = m_IndexArray.ElementAt(iSize - 2);
+ FX_INT32 iCount = m_IndexArray.ElementAt(iSize - 1);
+ if (objnum == startobjnum + iCount) {
+ m_IndexArray[iSize - 1] = iCount + 1;
+ } else {
+ m_IndexArray.Add(objnum);
+ m_IndexArray.Add(1);
+ }
+ }
+ return TRUE;
+}
+CPDF_Creator::CPDF_Creator(CPDF_Document* pDoc)
+{
+ m_pDocument = pDoc;
+ m_pParser = (CPDF_Parser*)pDoc->m_pParser;
+ m_bCompress = TRUE;
+ if (m_pParser) {
+ m_pEncryptDict = m_pParser->GetEncryptDict();
+ m_pCryptoHandler = m_pParser->GetCryptoHandler();
+ } else {
+ m_pEncryptDict = NULL;
+ m_pCryptoHandler = NULL;
+ }
+ m_bSecurityChanged = FALSE;
+ m_bStandardSecurity = FALSE;
+ m_pMetadata = NULL;
+ m_bEncryptCloned = FALSE;
+ m_bEncryptMetadata = FALSE;
+ m_Offset = 0;
+ m_iStage = -1;
+ m_dwFlags = 0;
+ m_Pos = NULL;
+ m_XrefStart = 0;
+ m_pXRefStream = NULL;
+ m_ObjectStreamSize = 200;
+ m_dwLastObjNum = m_pDocument->GetLastObjNum();
+ m_pIDArray = NULL;
+ m_FileVersion = 0;
+ m_dwEnryptObjNum = 0;
+ m_bNewCrypto = FALSE;
+}
+CPDF_Creator::~CPDF_Creator()
+{
+ ResetStandardSecurity();
+ if (m_bEncryptCloned && m_pEncryptDict) {
+ m_pEncryptDict->Release();
+ m_pEncryptDict = NULL;
+ }
+ Clear();
+}
+static FX_BOOL _IsXRefNeedEnd(CPDF_XRefStream* pXRef, FX_DWORD flag)
+{
+ if (!(flag & FPDFCREATE_INCREMENTAL)) {
+ return FALSE;
+ }
+ FX_INT32 iSize = pXRef->m_IndexArray.GetSize() / 2;
+ FX_INT32 iCount = 0;
+ for (FX_INT32 i = 0; i < iSize; i++) {
+ iCount += pXRef->m_IndexArray.ElementAt(i * 2 + 1);
+ }
+ return (iCount >= PDF_XREFSTREAM_MAXSIZE);
+}
+FX_INT32 CPDF_Creator::WriteIndirectObjectToStream(const CPDF_Object* pObj)
+{
+ if (!m_pXRefStream) {
+ return 1;
+ }
+ FX_DWORD objnum = pObj->GetObjNum();
+ if (m_pParser && m_pParser->m_ObjVersion.GetSize() > (FX_INT32)objnum && m_pParser->m_ObjVersion[objnum] > 0) {
+ return 1;
+ }
+ if (pObj->GetType() == PDFOBJ_NUMBER) {
+ return 1;
+ }
+ CPDF_Dictionary *pDict = pObj->GetDict();
+ if (pObj->GetType() == PDFOBJ_STREAM) {
+ if (pDict && pDict->GetString(FX_BSTRC("Type")) == FX_BSTRC("XRef")) {
+ return 0;
+ }
+ return 1;
+ }
+ if (pDict) {
+ if (pDict == m_pDocument->m_pRootDict || pDict == m_pEncryptDict) {
+ return 1;
+ }
+ if (IsSignatureDict(pDict)) {
+ return 1;
+ }
+ if (pDict->GetString(FX_BSTRC("Type")) == FX_BSTRC("Page")) {
+ return 1;
+ }
+ }
+ m_pXRefStream->AddObjectNumberToIndexArray(objnum);
+ if (m_pXRefStream->CompressIndirectObject(objnum, pObj, this) < 0) {
+ return -1;
+ }
+ if (!_IsXRefNeedEnd(m_pXRefStream, m_dwFlags)) {
+ return 0;
+ }
+ if (!m_pXRefStream->End(this)) {
+ return -1;
+ }
+ if (!m_pXRefStream->Start()) {
+ return -1;
+ }
+ return 0;
+}
+FX_INT32 CPDF_Creator::WriteIndirectObjectToStream(FX_DWORD objnum, FX_LPCBYTE pBuffer, FX_DWORD dwSize)
+{
+ if (!m_pXRefStream) {
+ return 1;
+ }
+ m_pXRefStream->AddObjectNumberToIndexArray(objnum);
+ FX_INT32 iRet = m_pXRefStream->CompressIndirectObject(objnum, pBuffer, dwSize, this);
+ if (iRet < 1) {
+ return iRet;
+ }
+ if (!_IsXRefNeedEnd(m_pXRefStream, m_dwFlags)) {
+ return 0;
+ }
+ if (!m_pXRefStream->End(this)) {
+ return -1;
+ }
+ if (!m_pXRefStream->Start()) {
+ return -1;
+ }
+ return 0;
+}
+FX_INT32 CPDF_Creator::AppendObjectNumberToXRef(FX_DWORD objnum)
+{
+ if (!m_pXRefStream) {
+ return 1;
+ }
+ m_pXRefStream->AddObjectNumberToIndexArray(objnum);
+ if (!_IsXRefNeedEnd(m_pXRefStream, m_dwFlags)) {
+ return 0;
+ }
+ if (!m_pXRefStream->End(this)) {
+ return -1;
+ }
+ if (!m_pXRefStream->Start()) {
+ return -1;
+ }
+ return 0;
+}
+FX_INT32 CPDF_Creator::WriteStream(const CPDF_Object* pStream, FX_DWORD objnum, CPDF_CryptoHandler* pCrypto)
+{
+ CPDF_FlateEncoder encoder;
+ encoder.Initialize((CPDF_Stream*)pStream, pStream == m_pMetadata ? FALSE : m_bCompress);
+ CPDF_Encryptor encryptor;
+ if(!encryptor.Initialize(pCrypto, objnum, encoder.m_pData, encoder.m_dwSize)) {
+ return -1;
+ }
+ if ((FX_DWORD)encoder.m_pDict->GetInteger(FX_BSTRC("Length")) != encryptor.m_dwSize) {
+ encoder.CloneDict();
+ encoder.m_pDict->SetAtInteger(FX_BSTRC("Length"), encryptor.m_dwSize);
+ }
+ if (WriteDirectObj(objnum, encoder.m_pDict) < 0) {
+ return -1;
+ }
+ int len = m_File.AppendString(FX_BSTRC("stream\r\n"));
+ if (len < 0) {
+ return -1;
+ }
+ m_Offset += len;
+ if (m_File.AppendBlock(encryptor.m_pData, encryptor.m_dwSize) < 0) {
+ return -1;
+ }
+ m_Offset += encryptor.m_dwSize;
+ if ((len = m_File.AppendString(FX_BSTRC("\r\nendstream"))) < 0) {
+ return -1;
+ }
+ m_Offset += len;
+ return 1;
+}
+FX_INT32 CPDF_Creator::WriteIndirectObj(FX_DWORD objnum, const CPDF_Object* pObj)
+{
+ FX_INT32 len = m_File.AppendDWord(objnum);
+ if (len < 0) {
+ return -1;
+ }
+ m_Offset += len;
+ if ((len = m_File.AppendString(FX_BSTRC(" 0 obj\r\n"))) < 0) {
+ return -1;
+ }
+ m_Offset += len;
+ if (pObj->GetType() == PDFOBJ_STREAM) {
+ CPDF_CryptoHandler *pHandler = NULL;
+ pHandler = (pObj == m_pMetadata && !m_bEncryptMetadata) ? NULL : m_pCryptoHandler;
+ if (WriteStream(pObj, objnum, pHandler) < 0) {
+ return -1;
+ }
+ } else {
+ if (WriteDirectObj(objnum, pObj) < 0) {
+ return -1;
+ }
+ }
+ if ((len = m_File.AppendString(FX_BSTRC("\r\nendobj\r\n"))) < 0) {
+ return -1;
+ }
+ m_Offset += len;
+ if (AppendObjectNumberToXRef(objnum) < 0) {
+ return -1;
+ }
+ return 0;
+}
+FX_INT32 CPDF_Creator::WriteIndirectObj(const CPDF_Object* pObj)
+{
+ FX_INT32 iRet = WriteIndirectObjectToStream(pObj);
+ if (iRet < 1) {
+ return iRet;
+ }
+ return WriteIndirectObj(pObj->GetObjNum(), pObj);
+}
+FX_INT32 CPDF_Creator::WriteDirectObj(FX_DWORD objnum, const CPDF_Object* pObj, FX_BOOL bEncrypt)
+{
+ FX_INT32 len = 0;
+ if (pObj == NULL) {
+ if (m_File.AppendString(FX_BSTRC(" null")) < 0) {
+ return -1;
+ }
+ m_Offset += 5;
+ return 1;
+ }
+ switch (pObj->GetType()) {
+ case PDFOBJ_NULL:
+ if (m_File.AppendString(FX_BSTRC(" null")) < 0) {
+ return -1;
+ }
+ m_Offset += 5;
+ break;
+ case PDFOBJ_BOOLEAN:
+ case PDFOBJ_NUMBER:
+ if (m_File.AppendString(FX_BSTRC(" ")) < 0) {
+ return -1;
+ }
+ if ((len = m_File.AppendString(pObj->GetString())) < 0) {
+ return -1;
+ }
+ m_Offset += len + 1;
+ break;
+ case PDFOBJ_STRING: {
+ CFX_ByteString str = pObj->GetString();
+ FX_BOOL bHex = ((CPDF_String*)pObj)->IsHex();
+ if (m_pCryptoHandler == NULL || !bEncrypt) {
+ CFX_ByteString content = PDF_EncodeString(str, bHex);
+ if ((len = m_File.AppendString(content)) < 0) {
+ return -1;
+ }
+ m_Offset += len;
+ break;
+ }
+ CPDF_Encryptor encryptor;
+ encryptor.Initialize(m_pCryptoHandler, objnum, (FX_LPBYTE)(FX_LPCSTR)str, str.GetLength());
+ CFX_ByteString content = PDF_EncodeString(CFX_ByteString((FX_LPCSTR)encryptor.m_pData, encryptor.m_dwSize), bHex);
+ if ((len = m_File.AppendString(content)) < 0) {
+ return -1;
+ }
+ m_Offset += len;
+ break;
+ }
+ case PDFOBJ_STREAM: {
+ CPDF_FlateEncoder encoder;
+ encoder.Initialize((CPDF_Stream*)pObj, m_bCompress);
+ CPDF_Encryptor encryptor;
+ CPDF_CryptoHandler* pHandler = m_pCryptoHandler;
+ encryptor.Initialize(pHandler, objnum, encoder.m_pData, encoder.m_dwSize);
+ if ((FX_DWORD)encoder.m_pDict->GetInteger(FX_BSTRC("Length")) != encryptor.m_dwSize) {
+ encoder.CloneDict();
+ encoder.m_pDict->SetAtInteger(FX_BSTRC("Length"), encryptor.m_dwSize);
+ }
+ if (WriteDirectObj(objnum, encoder.m_pDict) < 0) {
+ return -1;
+ }
+ if ((len = m_File.AppendString(FX_BSTRC("stream\r\n"))) < 0) {
+ return -1;
+ }
+ m_Offset += len;
+ if (m_File.AppendBlock(encryptor.m_pData, encryptor.m_dwSize) < 0) {
+ return -1;
+ }
+ m_Offset += encryptor.m_dwSize;
+ if ((len = m_File.AppendString(FX_BSTRC("\r\nendstream"))) < 0) {
+ return -1;
+ }
+ m_Offset += len;
+ break;
+ }
+ case PDFOBJ_NAME: {
+ if (m_File.AppendString(FX_BSTRC("/")) < 0) {
+ return -1;
+ }
+ CFX_ByteString str = pObj->GetString();
+ if ((len = m_File.AppendString(PDF_NameEncode(str))) < 0) {
+ return -1;
+ }
+ m_Offset += len + 1;
+ break;
+ }
+ case PDFOBJ_REFERENCE: {
+ if (m_File.AppendString(FX_BSTRC(" ")) < 0) {
+ return -1;
+ }
+ CPDF_Reference* p = (CPDF_Reference*)pObj;
+ if ((len = m_File.AppendDWord(p->GetRefObjNum())) < 0) {
+ return -1;
+ }
+ if (m_File.AppendString(FX_BSTRC(" 0 R")) < 0) {
+ return -1;
+ }
+ m_Offset += len + 5;
+ break;
+ }
+ case PDFOBJ_ARRAY: {
+ if (m_File.AppendString(FX_BSTRC("[")) < 0) {
+ return -1;
+ }
+ m_Offset += 1;
+ CPDF_Array* p = (CPDF_Array*)pObj;
+ for (FX_DWORD i = 0; i < p->GetCount(); i ++) {
+ CPDF_Object* pElement = p->GetElement(i);
+ if (pElement->GetObjNum()) {
+ if (m_File.AppendString(FX_BSTRC(" ")) < 0) {
+ return -1;
+ }
+ if ((len = m_File.AppendDWord(pElement->GetObjNum())) < 0) {
+ return -1;
+ }
+ if (m_File.AppendString(FX_BSTRC(" 0 R")) < 0) {
+ return -1;
+ }
+ m_Offset += len + 5;
+ } else {
+ if (WriteDirectObj(objnum, pElement) < 0) {
+ return -1;
+ }
+ }
+ }
+ if (m_File.AppendString(FX_BSTRC("]")) < 0) {
+ return -1;
+ }
+ m_Offset += 1;
+ break;
+ }
+ case PDFOBJ_DICTIONARY: {
+ if (m_pCryptoHandler == NULL || pObj == m_pEncryptDict) {
+ return PDF_CreatorAppendObject(pObj, &m_File, m_Offset);
+ }
+ if (m_File.AppendString(FX_BSTRC("<<")) < 0) {
+ return -1;
+ }
+ m_Offset += 2;
+ CPDF_Dictionary* p = (CPDF_Dictionary*)pObj;
+ FX_BOOL bSignDict = IsSignatureDict(p);
+ FX_POSITION pos = p->GetStartPos();
+ while (pos) {
+ FX_BOOL bSignValue = FALSE;
+ CFX_ByteString key;
+ CPDF_Object* pValue = p->GetNextElement(pos, key);
+ if (m_File.AppendString(FX_BSTRC("/")) < 0) {
+ return -1;
+ }
+ if ((len = m_File.AppendString(PDF_NameEncode(key))) < 0) {
+ return -1;
+ }
+ m_Offset += len + 1;
+ if (bSignDict && key == FX_BSTRC("Contents")) {
+ bSignValue = TRUE;
+ }
+ if (pValue->GetObjNum()) {
+ if (m_File.AppendString(FX_BSTRC(" ")) < 0) {
+ return -1;
+ }
+ if ((len = m_File.AppendDWord(pValue->GetObjNum())) < 0) {
+ return -1;
+ }
+ if (m_File.AppendString(FX_BSTRC(" 0 R ")) < 0) {
+ return -1;
+ }
+ m_Offset += len + 6;
+ } else {
+ if (WriteDirectObj(objnum, pValue, !bSignValue) < 0) {
+ return -1;
+ }
+ }
+ }
+ if (m_File.AppendString(FX_BSTRC(">>")) < 0) {
+ return -1;
+ }
+ m_Offset += 2;
+ break;
+ }
+ }
+ return 1;
+}
+FX_INT32 CPDF_Creator::WriteOldIndirectObject(FX_DWORD objnum)
+{
+ if(m_pParser->m_V5Type[objnum] == 0 || m_pParser->m_V5Type[objnum] == 255) {
+ return 0;
+ }
+ m_ObjectOffset[objnum] = m_Offset;
+ FX_LPVOID valuetemp = NULL;
+ FX_BOOL bExistInMap = m_pDocument->m_IndirectObjs.Lookup((FX_LPVOID)(FX_UINTPTR)objnum, valuetemp);
+ FX_BOOL bObjStm = (m_pParser->m_V5Type[objnum] == 2) && m_pEncryptDict && !m_pXRefStream;
+ if(m_pParser->m_bVersionUpdated || m_bSecurityChanged || bExistInMap || bObjStm) {
+ CPDF_Object* pObj = m_pDocument->GetIndirectObject(objnum);
+ if (pObj == NULL) {
+ m_ObjectOffset[objnum] = 0;
+ m_ObjectSize[objnum] = 0;
+ return 0;
+ }
+ if (WriteIndirectObj(pObj)) {
+ return -1;
+ }
+ if (!bExistInMap) {
+ m_pDocument->ReleaseIndirectObject(objnum);
+ }
+ } else {
+ FX_BYTE* pBuffer;
+ FX_DWORD size;
+ m_pParser->GetIndirectBinary(objnum, pBuffer, size);
+ if (pBuffer == NULL) {
+ return 0;
+ }
+ if (m_pParser->m_V5Type[objnum] == 2) {
+ if (m_pXRefStream) {
+ if (WriteIndirectObjectToStream(objnum, pBuffer, size) < 0) {
+ FX_Free(pBuffer);
+ return -1;
+ }
+ } else {
+ FX_INT32 len = m_File.AppendDWord(objnum);
+ if (len < 0) {
+ return -1;
+ }
+ if (m_File.AppendString(FX_BSTRC(" 0 obj ")) < 0) {
+ return -1;
+ }
+ m_Offset += len + 7;
+ if (m_File.AppendBlock(pBuffer, size) < 0) {
+ return -1;
+ }
+ m_Offset += size;
+ if (m_File.AppendString(FX_BSTRC("\r\nendobj\r\n")) < 0) {
+ return -1;
+ }
+ m_Offset += 10;
+ }
+ } else {
+ if (m_File.AppendBlock(pBuffer, size) < 0) {
+ return -1;
+ }
+ m_Offset += size;
+ if(AppendObjectNumberToXRef(objnum) < 0) {
+ return -1;
+ }
+ }
+ FX_Free(pBuffer);
+ }
+ return 1;
+}
+FX_INT32 CPDF_Creator::WriteOldObjs(IFX_Pause *pPause)
+{
+ FX_DWORD nOldSize = m_pParser->m_CrossRef.GetSize();
+ FX_DWORD objnum = (FX_DWORD)(FX_UINTPTR)m_Pos;
+ for(; objnum < nOldSize; objnum ++) {
+ FX_INT32 iRet = WriteOldIndirectObject(objnum);
+ if (!iRet) {
+ continue;
+ }
+ if (iRet < 0) {
+ return iRet;
+ }
+ m_ObjectSize[objnum] = (FX_DWORD)(m_Offset - m_ObjectOffset[objnum]);
+ if (pPause && pPause->NeedToPauseNow()) {
+ m_Pos = (FX_LPVOID)(FX_UINTPTR)(objnum + 1);
+ return 1;
+ }
+ }
+ return 0;
+}
+FX_INT32 CPDF_Creator::WriteNewObjs(FX_BOOL bIncremental, IFX_Pause *pPause)
+{
+ FX_INT32 iCount = m_NewObjNumArray.GetSize();
+ FX_INT32 index = (FX_INT32)(FX_UINTPTR)m_Pos;
+ while (index < iCount) {
+ FX_DWORD objnum = m_NewObjNumArray.ElementAt(index);
+ CPDF_Object *pObj = NULL;
+ m_pDocument->m_IndirectObjs.Lookup((FX_LPVOID)(FX_UINTPTR)objnum, (FX_LPVOID&)pObj);
+ if (NULL == pObj) {
+ ++index;
+ continue;
+ }
+ m_ObjectOffset[objnum] = m_Offset;
+ if (WriteIndirectObj(pObj)) {
+ return -1;
+ }
+ m_ObjectSize[objnum] = (FX_DWORD)(m_Offset - m_ObjectOffset[objnum]);
+ index++;
+ if (pPause && pPause->NeedToPauseNow()) {
+ m_Pos = (FX_POSITION)(FX_UINTPTR)index;
+ return 1;
+ }
+ }
+ return 0;
+}
+void CPDF_Creator::InitOldObjNumOffsets()
+{
+ if (!m_pParser) {
+ return;
+ }
+ FX_DWORD j = 0;
+ FX_DWORD dwStart = 0;
+ FX_DWORD dwEnd = m_pParser->GetLastObjNum();
+ while (dwStart <= dwEnd) {
+ while (dwStart <= dwEnd && (m_pParser->m_V5Type[dwStart] == 0 || m_pParser->m_V5Type[dwStart] == 255)) {
+ dwStart++;
+ }
+ if (dwStart > dwEnd) {
+ break;
+ }
+ j = dwStart;
+ while (j <= dwEnd && m_pParser->m_V5Type[j] != 0 && m_pParser->m_V5Type[j] != 255) {
+ j++;
+ }
+ m_ObjectOffset.Add(dwStart, j - dwStart);
+ m_ObjectSize.Add(dwStart, j - dwStart);
+ dwStart = j;
+ }
+}
+void CPDF_Creator::InitNewObjNumOffsets()
+{
+ FX_BOOL bIncremental = (m_dwFlags & FPDFCREATE_INCREMENTAL) != 0;
+ FX_BOOL bNoOriginal = (m_dwFlags & FPDFCREATE_NO_ORIGINAL) != 0;
+ FX_DWORD nOldSize = m_pParser ? m_pParser->m_CrossRef.GetSize() : 0;
+ FX_POSITION pos = m_pDocument->m_IndirectObjs.GetStartPosition();
+ while (pos) {
+ size_t key = 0;
+ CPDF_Object* pObj;
+ m_pDocument->m_IndirectObjs.GetNextAssoc(pos, (FX_LPVOID&)key, (FX_LPVOID&)pObj);
+ FX_DWORD objnum = (FX_DWORD)key;
+ if (pObj->GetObjNum() == -1) {
+ continue;
+ }
+ if (bIncremental) {
+ if (!pObj->IsModified()) {
+ continue;
+ }
+ } else {
+ if (objnum < nOldSize && m_pParser->m_V5Type[objnum] != 0) {
+ continue;
+ }
+ }
+ AppendNewObjNum(objnum);
+ }
+ FX_INT32 iCount = m_NewObjNumArray.GetSize();
+ if (iCount == 0) {
+ return;
+ }
+ FX_INT32 i = 0;
+ FX_DWORD dwStartObjNum = 0;
+ FX_BOOL bCrossRefValid = m_pParser && m_pParser->GetLastXRefOffset() > 0;
+ while (i < iCount) {
+ dwStartObjNum = m_NewObjNumArray.ElementAt(i);
+ if ((bIncremental && (bNoOriginal || bCrossRefValid)) || !m_ObjectOffset.GetPtrAt(dwStartObjNum)) {
+ break;
+ }
+ i++;
+ }
+ if (i >= iCount) {
+ return;
+ }
+ FX_DWORD dwLastObjNum = dwStartObjNum;
+ i++;
+ FX_BOOL bNewStart = FALSE;
+ for (; i < iCount; i++) {
+ FX_DWORD dwCurObjNum = m_NewObjNumArray.ElementAt(i);
+ FX_BOOL bExist = (dwCurObjNum < nOldSize && m_ObjectOffset.GetPtrAt(dwCurObjNum) != NULL);
+ if (bExist || dwCurObjNum - dwLastObjNum > 1) {
+ if (!bNewStart) {
+ m_ObjectOffset.Add(dwStartObjNum, dwLastObjNum - dwStartObjNum + 1);
+ m_ObjectSize.Add(dwStartObjNum, dwLastObjNum - dwStartObjNum + 1);
+ }
+ dwStartObjNum = dwCurObjNum;
+ }
+ if (bNewStart) {
+ dwStartObjNum = dwCurObjNum;
+ }
+ bNewStart = bExist;
+ dwLastObjNum = dwCurObjNum;
+ }
+ m_ObjectOffset.Add(dwStartObjNum, dwLastObjNum - dwStartObjNum + 1);
+ m_ObjectSize.Add(dwStartObjNum, dwLastObjNum - dwStartObjNum + 1);
+}
+void CPDF_Creator::AppendNewObjNum(FX_DWORD objbum)
+{
+ FX_INT32 iStart = 0, iFind = 0;
+ FX_INT32 iEnd = m_NewObjNumArray.GetUpperBound();
+ while (iStart <= iEnd) {
+ FX_INT32 iMid = (iStart + iEnd) / 2;
+ FX_DWORD dwMid = m_NewObjNumArray.ElementAt(iMid);
+ if (objbum < dwMid) {
+ iEnd = iMid - 1;
+ } else {
+ if (iMid == iEnd) {
+ iFind = iMid + 1;
+ break;
+ }
+ FX_DWORD dwNext = m_NewObjNumArray.ElementAt(iMid + 1);
+ if (objbum < dwNext) {
+ iFind = iMid + 1;
+ break;
+ }
+ iStart = iMid + 1;
+ }
+ }
+ m_NewObjNumArray.InsertAt(iFind, objbum);
+}
+FX_INT32 CPDF_Creator::WriteDoc_Stage1(IFX_Pause *pPause)
+{
+ FXSYS_assert(m_iStage > -1 || m_iStage < 20);
+ if (m_iStage == 0) {
+ if (m_pParser == NULL) {
+ m_dwFlags &= ~FPDFCREATE_INCREMENTAL;
+ }
+ if (m_bSecurityChanged && (m_dwFlags & FPDFCREATE_NO_ORIGINAL) == 0) {
+ m_dwFlags &= ~FPDFCREATE_INCREMENTAL;
+ }
+ m_pMetadata = m_pDocument->GetRoot()->GetElementValue(FX_BSTRC("Metadata"));
+ if (m_dwFlags & FPDFCREATE_OBJECTSTREAM) {
+ m_pXRefStream = FX_NEW CPDF_XRefStream;
+ m_pXRefStream->Start();
+ if ((m_dwFlags & FPDFCREATE_INCREMENTAL) != 0 && m_pParser) {
+ FX_FILESIZE prev = m_pParser->GetLastXRefOffset();
+ m_pXRefStream->m_PrevOffset = prev;
+ }
+ }
+ m_iStage = 10;
+ }
+ if (m_iStage == 10) {
+ if ((m_dwFlags & FPDFCREATE_INCREMENTAL) == 0) {
+ if (m_File.AppendString(FX_BSTRC("%PDF-1.")) < 0) {
+ return -1;
+ }
+ m_Offset += 7;
+ FX_INT32 version = 7;
+ if (m_FileVersion) {
+ version = m_FileVersion;
+ } else if (m_pParser) {
+ version = m_pParser->GetFileVersion();
+ }
+ FX_INT32 len = m_File.AppendDWord(version % 10);
+ if (len < 0) {
+ return -1;
+ }
+ m_Offset += len;
+ if ((len = m_File.AppendString(FX_BSTRC("\r\n%\xA1\xB3\xC5\xD7\r\n"))) < 0) {
+ return -1;
+ }
+ m_Offset += len;
+ InitOldObjNumOffsets();
+ m_iStage = 20;
+ } else {
+ IFX_FileRead* pSrcFile = m_pParser->GetFileAccess();
+ m_Offset = pSrcFile->GetSize();
+ m_Pos = (FX_LPVOID)(FX_UINTPTR)m_Offset;
+ m_iStage = 15;
+ }
+ }
+ if (m_iStage == 15) {
+ if ((m_dwFlags & FPDFCREATE_NO_ORIGINAL) == 0 && m_Pos) {
+ IFX_FileRead* pSrcFile = m_pParser->GetFileAccess();
+ FX_BYTE buffer[4096];
+ FX_DWORD src_size = (FX_DWORD)(FX_UINTPTR)m_Pos;
+ while (src_size) {
+ FX_DWORD block_size = src_size > 4096 ? 4096 : src_size;
+ if (!pSrcFile->ReadBlock(buffer, m_Offset - src_size, block_size)) {
+ return -1;
+ }
+ if (m_File.AppendBlock(buffer, block_size) < 0) {
+ return -1;
+ }
+ src_size -= block_size;
+ if (pPause && pPause->NeedToPauseNow()) {
+ m_Pos = (FX_LPVOID)(FX_UINTPTR)src_size;
+ return 1;
+ }
+ }
+ }
+ if ((m_dwFlags & FPDFCREATE_NO_ORIGINAL) == 0 && m_pParser->GetLastXRefOffset() == 0) {
+ InitOldObjNumOffsets();
+ FX_DWORD dwEnd = m_pParser->GetLastObjNum();
+ FX_BOOL bObjStm = (m_dwFlags & FPDFCREATE_OBJECTSTREAM) != 0;
+ for (FX_DWORD objnum = 0; objnum <= dwEnd; objnum++) {
+ if (m_pParser->m_V5Type[objnum] == 0 || m_pParser->m_V5Type[objnum] == 255) {
+ continue;
+ }
+ m_ObjectOffset[objnum] = m_pParser->m_CrossRef[objnum];
+ if (bObjStm) {
+ m_pXRefStream->AddObjectNumberToIndexArray(objnum);
+ }
+ }
+ if (bObjStm) {
+ m_pXRefStream->EndXRefStream(this);
+ m_pXRefStream->Start();
+ }
+ }
+ m_iStage = 20;
+ }
+ InitNewObjNumOffsets();
+ return m_iStage;
+}
+FX_INT32 CPDF_Creator::WriteDoc_Stage2(IFX_Pause *pPause)
+{
+ FXSYS_assert(m_iStage >= 20 || m_iStage < 30);
+ if (m_iStage == 20) {
+ if ((m_dwFlags & FPDFCREATE_INCREMENTAL) == 0 && m_pParser) {
+ m_Pos = (FX_LPVOID)(FX_UINTPTR)0;
+ m_iStage = 21;
+ } else {
+ m_iStage = 25;
+ }
+ }
+ if (m_iStage == 21) {
+ FX_INT32 iRet = WriteOldObjs(pPause);
+ if (iRet) {
+ return iRet;
+ }
+ m_iStage = 25;
+ }
+ if (m_iStage == 25) {
+ m_Pos = (FX_LPVOID)(FX_UINTPTR)0;
+ m_iStage = 26;
+ }
+ if (m_iStage == 26) {
+ FX_INT32 iRet = WriteNewObjs((m_dwFlags & FPDFCREATE_INCREMENTAL) != 0, pPause);
+ if (iRet) {
+ return iRet;
+ }
+ m_iStage = 27;
+ }
+ if (m_iStage == 27) {
+ if (NULL != m_pEncryptDict && 0 == m_pEncryptDict->GetObjNum()) {
+ m_dwLastObjNum += 1;
+ FX_FILESIZE saveOffset = m_Offset;
+ if (WriteIndirectObj(m_dwLastObjNum, m_pEncryptDict) < 0) {
+ return -1;
+ }
+ m_ObjectOffset.Add(m_dwLastObjNum, 1);
+ m_ObjectOffset[m_dwLastObjNum] = saveOffset;
+ m_ObjectSize.Add(m_dwLastObjNum, 1);
+ m_ObjectSize[m_dwLastObjNum] = m_Offset - saveOffset;
+ m_dwEnryptObjNum = m_dwLastObjNum;
+ if (m_dwFlags & FPDFCREATE_INCREMENTAL) {
+ m_NewObjNumArray.Add(m_dwLastObjNum);
+ }
+ }
+ m_iStage = 80;
+ }
+ return m_iStage;
+}
+FX_INT32 CPDF_Creator::WriteDoc_Stage3(IFX_Pause *pPause)
+{
+ FXSYS_assert(m_iStage >= 80 || m_iStage < 90);
+ FX_DWORD dwLastObjNum = m_dwLastObjNum;
+ if (m_iStage == 80) {
+ m_XrefStart = m_Offset;
+ if (m_dwFlags & FPDFCREATE_OBJECTSTREAM) {
+ m_pXRefStream->End(this, TRUE);
+ m_XrefStart = m_pXRefStream->m_PrevOffset;
+ m_iStage = 90;
+ } else if ((m_dwFlags & FPDFCREATE_INCREMENTAL) == 0 || !m_pParser->IsXRefStream()) {
+ if ((m_dwFlags & FPDFCREATE_INCREMENTAL) == 0 || m_pParser->GetLastXRefOffset() == 0) {
+ CFX_ByteString str;
+ str = m_ObjectOffset.GetPtrAt(1) ? FX_BSTRC("xref\r\n") : FX_BSTRC("xref\r\n0 1\r\n0000000000 65536 f\r\n");
+ if (m_File.AppendString(str) < 0) {
+ return -1;
+ }
+ m_Pos = (FX_LPVOID)(FX_UINTPTR)1;
+ m_iStage = 81;
+ } else {
+ if (m_File.AppendString(FX_BSTRC("xref\r\n")) < 0) {
+ return -1;
+ }
+ m_Pos = (FX_LPVOID)(FX_UINTPTR)0;
+ m_iStage = 82;
+ }
+ } else {
+ m_iStage = 90;
+ }
+ }
+ if (m_iStage == 81) {
+ CFX_ByteString str;
+ FX_DWORD i = (FX_DWORD)(FX_UINTPTR)m_Pos, j;
+ while (i <= dwLastObjNum) {
+ while (i <= dwLastObjNum && !m_ObjectOffset.GetPtrAt(i)) {
+ i++;
+ }
+ if (i > dwLastObjNum) {
+ break;
+ }
+ j = i;
+ while (j <= dwLastObjNum && m_ObjectOffset.GetPtrAt(j)) {
+ j++;
+ }
+ if (i == 1) {
+ str.Format("0 %d\r\n0000000000 65536 f\r\n", j);
+ } else {
+ str.Format("%d %d\r\n", i, j - i);
+ }
+ if (m_File.AppendBlock((FX_LPCSTR)str, str.GetLength()) < 0) {
+ return -1;
+ }
+ while (i < j) {
+ str.Format("%010d 00000 n\r\n", m_ObjectOffset[i ++]);
+ if (m_File.AppendBlock((FX_LPCSTR)str, str.GetLength()) < 0) {
+ return -1;
+ }
+ }
+ if (i > dwLastObjNum) {
+ break;
+ }
+ if (pPause && pPause->NeedToPauseNow()) {
+ m_Pos = (FX_LPVOID)(FX_UINTPTR)i;
+ return 1;
+ }
+ }
+ m_iStage = 90;
+ }
+ if (m_iStage == 82) {
+ CFX_ByteString str;
+ FX_INT32 iCount = m_NewObjNumArray.GetSize();
+ FX_INT32 i = (FX_INT32)(FX_UINTPTR)m_Pos;
+ while (i < iCount) {
+ FX_INT32 j = i;
+ FX_DWORD objnum = m_NewObjNumArray.ElementAt(i);
+ while (j < iCount) {
+ if (++j == iCount) {
+ break;
+ }
+ FX_DWORD dwCurrent = m_NewObjNumArray.ElementAt(j);
+ if (dwCurrent - objnum > 1) {
+ break;
+ }
+ objnum = dwCurrent;
+ }
+ objnum = m_NewObjNumArray.ElementAt(i);
+ if (objnum == 1) {
+ str.Format("0 %d\r\n0000000000 65536 f\r\n", j - i + 1);
+ } else {
+ str.Format("%d %d\r\n", objnum, j - i);
+ }
+ if (m_File.AppendBlock((FX_LPCSTR)str, str.GetLength()) < 0) {
+ return -1;
+ }
+ while (i < j) {
+ objnum = m_NewObjNumArray.ElementAt(i++);
+ str.Format("%010d 00000 n\r\n", m_ObjectOffset[objnum]);
+ if (m_File.AppendBlock((FX_LPCSTR)str, str.GetLength()) < 0) {
+ return -1;
+ }
+ }
+ if (pPause && (i % 100) == 0 && pPause->NeedToPauseNow()) {
+ m_Pos = (FX_LPVOID)(FX_UINTPTR)i;
+ return 1;
+ }
+ }
+ m_iStage = 90;
+ }
+ return m_iStage;
+}
+static FX_INT32 _OutPutIndex(CFX_FileBufferArchive* pFile, FX_FILESIZE offset)
+{
+ FXSYS_assert(pFile);
+ if (sizeof(offset) > 4) {
+ if (FX_GETBYTEOFFSET32(offset)) {
+ if (pFile->AppendByte(FX_GETBYTEOFFSET56(offset)) < 0) {
+ return -1;
+ }
+ if (pFile->AppendByte(FX_GETBYTEOFFSET48(offset)) < 0) {
+ return -1;
+ }
+ if (pFile->AppendByte(FX_GETBYTEOFFSET40(offset)) < 0) {
+ return -1;
+ }
+ if (pFile->AppendByte(FX_GETBYTEOFFSET32(offset)) < 0) {
+ return -1;
+ }
+ }
+ }
+ if (pFile->AppendByte(FX_GETBYTEOFFSET24(offset)) < 0) {
+ return -1;
+ }
+ if (pFile->AppendByte(FX_GETBYTEOFFSET16(offset)) < 0) {
+ return -1;
+ }
+ if (pFile->AppendByte(FX_GETBYTEOFFSET8(offset)) < 0) {
+ return -1;
+ }
+ if (pFile->AppendByte(FX_GETBYTEOFFSET0(offset)) < 0) {
+ return -1;
+ }
+ if (pFile->AppendByte(0) < 0) {
+ return -1;
+ }
+ return 0;
+}
+FX_INT32 CPDF_Creator::WriteDoc_Stage4(IFX_Pause *pPause)
+{
+ FXSYS_assert(m_iStage >= 90);
+ if ((m_dwFlags & FPDFCREATE_OBJECTSTREAM) == 0) {
+ FX_BOOL bXRefStream = (m_dwFlags & FPDFCREATE_INCREMENTAL) != 0 && m_pParser->IsXRefStream();
+ if (!bXRefStream) {
+ if (m_File.AppendString(FX_BSTRC("trailer\r\n<<")) < 0) {
+ return -1;
+ }
+ } else {
+ if (m_File.AppendDWord(m_pDocument->m_LastObjNum + 1) < 0) {
+ return -1;
+ }
+ if (m_File.AppendString(FX_BSTRC(" 0 obj <<")) < 0) {
+ return -1;
+ }
+ }
+ if (m_pParser) {
+ CPDF_Dictionary* p = m_pParser->m_pTrailer;
+ FX_POSITION pos = p->GetStartPos();
+ while (pos) {
+ CFX_ByteString key;
+ CPDF_Object* pValue = p->GetNextElement(pos, key);
+ if (key == FX_BSTRC("Encrypt") || key == FX_BSTRC("Size") || key == FX_BSTRC("Filter") ||
+ key == FX_BSTRC("Index") || key == FX_BSTRC("Length") || key == FX_BSTRC("Prev") ||
+ key == FX_BSTRC("W") || key == FX_BSTRC("XRefStm") || key == FX_BSTRC("ID")) {
+ continue;
+ }
+ if (m_File.AppendString((FX_BSTRC("/"))) < 0) {
+ return -1;
+ }
+ if (m_File.AppendString(PDF_NameEncode(key)) < 0) {
+ return -1;
+ }
+ if (pValue->GetObjNum()) {
+ if (m_File.AppendString(FX_BSTRC(" ")) < 0) {
+ return -1;
+ }
+ if (m_File.AppendDWord(pValue->GetObjNum()) < 0) {
+ return -1;
+ }
+ if (m_File.AppendString(FX_BSTRC(" 0 R ")) < 0) {
+ return -1;
+ }
+ } else {
+ FX_FILESIZE offset = 0;
+ if (PDF_CreatorAppendObject(pValue, &m_File, offset) < 0) {
+ return -1;
+ }
+ }
+ }
+ } else {
+ if (m_File.AppendString(FX_BSTRC("\r\n/Root ")) < 0) {
+ return -1;
+ }
+ if (m_File.AppendDWord(m_pDocument->m_pRootDict->GetObjNum()) < 0) {
+ return -1;
+ }
+ if (m_File.AppendString(FX_BSTRC(" 0 R\r\n")) < 0) {
+ return -1;
+ }
+ if (m_pDocument->m_pInfoDict) {
+ if (m_File.AppendString(FX_BSTRC("/Info ")) < 0) {
+ return -1;
+ }
+ if (m_File.AppendDWord(m_pDocument->m_pInfoDict->GetObjNum()) < 0) {
+ return -1;
+ }
+ if (m_File.AppendString(FX_BSTRC(" 0 R\r\n")) < 0) {
+ return -1;
+ }
+ }
+ }
+ if (m_pEncryptDict) {
+ if (m_File.AppendString(FX_BSTRC("/Encrypt")) < 0) {
+ return -1;
+ }
+ FX_DWORD dwObjNum = m_pEncryptDict->GetObjNum();
+ if (dwObjNum == 0) {
+ dwObjNum = m_pDocument->GetLastObjNum() + 1;
+ }
+ if (m_File.AppendString(FX_BSTRC(" ")) < 0) {
+ return -1;
+ }
+ if (m_File.AppendDWord(dwObjNum) < 0) {
+ return -1;
+ }
+ if (m_File.AppendString(FX_BSTRC(" 0 R ")) < 0) {
+ return -1;
+ }
+ }
+ if (m_File.AppendString(FX_BSTRC("/Size ")) < 0) {
+ return -1;
+ }
+ if (m_File.AppendDWord(m_dwLastObjNum + (bXRefStream ? 2 : 1)) < 0) {
+ return -1;
+ }
+ if ((m_dwFlags & FPDFCREATE_INCREMENTAL) != 0) {
+ FX_FILESIZE prev = m_pParser->GetLastXRefOffset();
+ if (prev) {
+ if (m_File.AppendString(FX_BSTRC("/Prev ")) < 0) {
+ return -1;
+ }
+ FX_CHAR offset_buf[20];
+ FXSYS_memset32(offset_buf, 0, sizeof(offset_buf));
+ FXSYS_i64toa(prev, offset_buf, 10);
+ if (m_File.AppendBlock(offset_buf, FXSYS_strlen(offset_buf)) < 0) {
+ return -1;
+ }
+ }
+ }
+ if (m_pIDArray) {
+ if (m_File.AppendString((FX_BSTRC("/ID"))) < 0) {
+ return -1;
+ }
+ FX_FILESIZE offset = 0;
+ if (PDF_CreatorAppendObject(m_pIDArray, &m_File, offset) < 0) {
+ return -1;
+ }
+ }
+ if (!bXRefStream) {
+ if (m_File.AppendString(FX_BSTRC(">>")) < 0) {
+ return -1;
+ }
+ } else {
+ if (m_File.AppendString(FX_BSTRC("/W[0 4 1]/Index[")) < 0) {
+ return -1;
+ }
+ if ((m_dwFlags & FPDFCREATE_INCREMENTAL) != 0 && m_pParser && m_pParser->GetLastXRefOffset() == 0) {
+ FX_DWORD i = 0;
+ for (i = 0; i < m_dwLastObjNum; i++) {
+ if (!m_ObjectOffset.GetPtrAt(i)) {
+ continue;
+ }
+ if (m_File.AppendDWord(i) < 0) {
+ return -1;
+ }
+ if (m_File.AppendString(FX_BSTRC(" 1 ")) < 0) {
+ return -1;
+ }
+ }
+ if (m_File.AppendString(FX_BSTRC("]/Length ")) < 0) {
+ return -1;
+ }
+ if (m_File.AppendDWord(m_dwLastObjNum * 5) < 0) {
+ return -1;
+ }
+ if (m_File.AppendString(FX_BSTRC(">>stream\r\n")) < 0) {
+ return -1;
+ }
+ for (i = 0; i < m_dwLastObjNum; i++) {
+ FX_FILESIZE* offset = m_ObjectOffset.GetPtrAt(i);
+ if (!offset) {
+ continue;
+ }
+ _OutPutIndex(&m_File, *offset);
+ }
+ } else {
+ int count = m_NewObjNumArray.GetSize();
+ FX_INT32 i = 0;
+ for (i = 0; i < count; i++) {
+ FX_DWORD objnum = m_NewObjNumArray.ElementAt(i);
+ if (m_File.AppendDWord(objnum) < 0) {
+ return -1;
+ }
+ if (m_File.AppendString(FX_BSTRC(" 1 ")) < 0) {
+ return -1;
+ }
+ }
+ if (m_File.AppendString(FX_BSTRC("]/Length ")) < 0) {
+ return -1;
+ }
+ if (m_File.AppendDWord(count * 5) < 0) {
+ return -1;
+ }
+ if (m_File.AppendString(FX_BSTRC(">>stream\r\n")) < 0) {
+ return -1;
+ }
+ for (i = 0; i < count; i++) {
+ FX_DWORD objnum = m_NewObjNumArray.ElementAt(i);
+ FX_FILESIZE offset = m_ObjectOffset[objnum];
+ _OutPutIndex(&m_File, offset);
+ }
+ }
+ if (m_File.AppendString(FX_BSTRC("\r\nendstream")) < 0) {
+ return -1;
+ }
+ }
+ }
+ if (m_File.AppendString(FX_BSTRC("\r\nstartxref\r\n")) < 0) {
+ return -1;
+ }
+ FX_CHAR offset_buf[20];
+ FXSYS_memset32(offset_buf, 0, sizeof(offset_buf));
+ FXSYS_i64toa(m_XrefStart, offset_buf, 10);
+ if (m_File.AppendBlock(offset_buf, FXSYS_strlen(offset_buf)) < 0) {
+ return -1;
+ }
+ if (m_File.AppendString(FX_BSTRC("\r\n%%EOF\r\n")) < 0) {
+ return -1;
+ }
+ m_File.Flush();
+ return m_iStage = 100;
+}
+void CPDF_Creator::Clear()
+{
+ if (m_pXRefStream) {
+ delete m_pXRefStream;
+ m_pXRefStream = NULL;
+ }
+ m_File.Clear();
+ m_NewObjNumArray.RemoveAll();
+ if (m_pIDArray) {
+ m_pIDArray->Release();
+ m_pIDArray = NULL;
+ }
+}
+FX_BOOL CPDF_Creator::Create(FX_LPCSTR filename, FX_DWORD flags)
+{
+ if (!m_File.AttachFile(filename)) {
+ return FALSE;
+ }
+ FX_BOOL bRet = Create(flags);
+ if (!bRet || !(flags & FPDFCREATE_PROGRESSIVE)) {
+ Clear();
+ }
+ return bRet;
+}
+FX_BOOL CPDF_Creator::Create(FX_LPCWSTR filename, FX_DWORD flags)
+{
+ if (!m_File.AttachFile(filename)) {
+ return FALSE;
+ }
+ FX_BOOL bRet = Create(flags);
+ if (!bRet || !(flags & FPDFCREATE_PROGRESSIVE)) {
+ Clear();
+ }
+ return bRet;
+}
+FX_BOOL CPDF_Creator::Create(IFX_StreamWrite* pFile, FX_DWORD flags)
+{
+ if (!pFile) {
+ return FALSE;
+ }
+ if (!m_File.AttachFile(pFile, FALSE)) {
+ return FALSE;
+ }
+ return Create(flags);
+}
+FX_BOOL CPDF_Creator::Create(FX_DWORD flags)
+{
+ m_dwFlags = flags;
+ m_iStage = 0;
+ m_Offset = 0;
+ m_dwLastObjNum = m_pDocument->GetLastObjNum();
+ m_ObjectOffset.Clear();
+ m_ObjectSize.Clear();
+ m_NewObjNumArray.RemoveAll();
+ InitID();
+ if (flags & FPDFCREATE_PROGRESSIVE) {
+ return TRUE;
+ }
+ return Continue(NULL) > -1;
+}
+void CPDF_Creator::InitID(FX_BOOL bDefault )
+{
+ CPDF_Array* pOldIDArray = m_pParser ? m_pParser->GetIDArray() : NULL;
+ FX_BOOL bNewId = !m_pIDArray;
+ if (!m_pIDArray) {
+ FX_LPDWORD pBuffer = NULL;
+ m_pIDArray = CPDF_Array::Create();
+ CPDF_Object* pID1 = pOldIDArray->GetElement(0);
+ if (pID1) {
+ m_pIDArray->Add(pID1->Clone());
+ } else {
+ pBuffer = FX_Alloc(FX_DWORD, 4);
+ PDF_GenerateFileID((FX_DWORD)(FX_UINTPTR)this, m_dwLastObjNum, pBuffer);
+ CFX_ByteStringC bsBuffer((FX_LPCBYTE)pBuffer, 4 * sizeof(FX_DWORD));
+ m_pIDArray->Add(CPDF_String::Create(bsBuffer, TRUE), m_pDocument);
+ }
+ if (pBuffer) {
+ FX_Free(pBuffer);
+ }
+ }
+ if (!bDefault) {
+ return;
+ }
+ if (pOldIDArray) {
+ CPDF_Object* pID2 = pOldIDArray->GetElement(1);
+ if ((m_dwFlags & FPDFCREATE_INCREMENTAL) && m_pEncryptDict && pID2) {
+ m_pIDArray->Add(pID2->Clone());
+ return;
+ }
+ FX_LPDWORD pBuffer = FX_Alloc(FX_DWORD, 4);
+ PDF_GenerateFileID((FX_DWORD)(FX_UINTPTR)this, m_dwLastObjNum, pBuffer);
+ CFX_ByteStringC bsBuffer((FX_LPCBYTE)pBuffer, 4 * sizeof(FX_DWORD));
+ m_pIDArray->Add(CPDF_String::Create(bsBuffer, TRUE), m_pDocument);
+ FX_Free(pBuffer);
+ return;
+ }
+ m_pIDArray->Add(m_pIDArray->GetElement(0)->Clone());
+ if (m_pEncryptDict && !pOldIDArray && m_pParser && bNewId) {
+ if (m_pEncryptDict->GetString(FX_BSTRC("Filter")) == FX_BSTRC("Standard")) {
+ CPDF_StandardSecurityHandler handler;
+ CFX_ByteString user_pass = m_pParser->GetPassword();
+ FX_DWORD flag = PDF_ENCRYPT_CONTENT;
+ handler.OnCreate(m_pEncryptDict, m_pIDArray, (FX_LPCBYTE)user_pass, user_pass.GetLength(), flag);
+ if (m_pCryptoHandler && m_bNewCrypto) {
+ delete m_pCryptoHandler;
+ }
+ m_pCryptoHandler = FX_NEW CPDF_StandardCryptoHandler;
+ m_pCryptoHandler->Init(m_pEncryptDict, &handler);
+ m_bNewCrypto = TRUE;
+ m_bSecurityChanged = TRUE;
+ }
+ }
+}
+FX_INT32 CPDF_Creator::Continue(IFX_Pause *pPause)
+{
+ if (m_iStage < 0) {
+ return m_iStage;
+ }
+ FX_INT32 iRet;
+ while (m_iStage < 100) {
+ if (m_iStage < 20) {
+ iRet = WriteDoc_Stage1(pPause);
+ } else if (m_iStage < 30) {
+ iRet = WriteDoc_Stage2(pPause);
+ } else if (m_iStage < 90) {
+ iRet = WriteDoc_Stage3(pPause);
+ } else {
+ iRet = WriteDoc_Stage4(pPause);
+ }
+ if (iRet < m_iStage) {
+ break;
+ }
+ }
+ if (iRet < 1 || m_iStage == 100) {
+ m_iStage = -1;
+ Clear();
+ return iRet > 99 ? 0 : (iRet < 1 ? -1 : iRet);
+ }
+ return m_iStage;
+}
+FX_BOOL CPDF_Creator::SetFileVersion(FX_INT32 fileVersion )
+{
+ if (fileVersion < 10 || fileVersion > 17) {
+ return FALSE;
+ }
+ m_FileVersion = fileVersion;
+ return TRUE;
+}
+void CPDF_Creator::ResetStandardSecurity()
+{
+ if ((m_bStandardSecurity || m_bNewCrypto) && m_pCryptoHandler) {
+ delete m_pCryptoHandler;
+ m_pCryptoHandler = NULL;
+ }
+ m_bNewCrypto = FALSE;
+ if (!m_bStandardSecurity) {
+ return;
+ }
+ if (m_pEncryptDict) {
+ m_pEncryptDict->Release();
+ m_pEncryptDict = NULL;
+ }
+ m_bStandardSecurity = FALSE;
+}
diff --git a/core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp b/core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp
index e11d93380a..2672116e4f 100644
--- a/core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp
+++ b/core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp
@@ -1,1205 +1,1205 @@
-// 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
-
-#include "../../../include/fpdfapi/fpdf_page.h"
-#include "../../../include/fpdfapi/fpdf_module.h"
-#include "../fpdf_page/pageint.h"
-#include <limits.h>
-CPDF_Document::CPDF_Document() : CPDF_IndirectObjects(NULL)
-{
- m_pRootDict = NULL;
- m_pInfoDict = NULL;
- m_bLinearized = FALSE;
- m_dwFirstPageNo = 0;
- m_dwFirstPageObjNum = 0;
- m_pDocPage = CPDF_ModuleMgr::Get()->GetPageModule()->CreateDocData(this);
- m_pDocRender = CPDF_ModuleMgr::Get()->GetRenderModule()->CreateDocData(this);
-}
-void CPDF_Document::CreateNewDoc()
-{
- ASSERT(m_pRootDict == NULL && m_pInfoDict == NULL);
- m_pRootDict = FX_NEW CPDF_Dictionary;
- m_pRootDict->SetAtName("Type", "Catalog");
- int objnum = AddIndirectObject(m_pRootDict);
- CPDF_Dictionary* pPages = FX_NEW CPDF_Dictionary;
- pPages->SetAtName("Type", "Pages");
- pPages->SetAtNumber("Count", 0);
- pPages->SetAt("Kids", FX_NEW CPDF_Array);
- objnum = AddIndirectObject(pPages);
- m_pRootDict->SetAtReference("Pages", this, objnum);
- m_pInfoDict = FX_NEW CPDF_Dictionary;
- AddIndirectObject(m_pInfoDict);
-}
-static const FX_WCHAR g_FX_CP874Unicodes[128] = {
- 0x20AC, 0x0000, 0x0000, 0x0000, 0x0000, 0x2026, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x00A0, 0x0E01, 0x0E02, 0x0E03, 0x0E04, 0x0E05, 0x0E06, 0x0E07,
- 0x0E08, 0x0E09, 0x0E0A, 0x0E0B, 0x0E0C, 0x0E0D, 0x0E0E, 0x0E0F,
- 0x0E10, 0x0E11, 0x0E12, 0x0E13, 0x0E14, 0x0E15, 0x0E16, 0x0E17,
- 0x0E18, 0x0E19, 0x0E1A, 0x0E1B, 0x0E1C, 0x0E1D, 0x0E1E, 0x0E1F,
- 0x0E20, 0x0E21, 0x0E22, 0x0E23, 0x0E24, 0x0E25, 0x0E26, 0x0E27,
- 0x0E28, 0x0E29, 0x0E2A, 0x0E2B, 0x0E2C, 0x0E2D, 0x0E2E, 0x0E2F,
- 0x0E30, 0x0E31, 0x0E32, 0x0E33, 0x0E34, 0x0E35, 0x0E36, 0x0E37,
- 0x0E38, 0x0E39, 0x0E3A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0E3F,
- 0x0E40, 0x0E41, 0x0E42, 0x0E43, 0x0E44, 0x0E45, 0x0E46, 0x0E47,
- 0x0E48, 0x0E49, 0x0E4A, 0x0E4B, 0x0E4C, 0x0E4D, 0x0E4E, 0x0E4F,
- 0x0E50, 0x0E51, 0x0E52, 0x0E53, 0x0E54, 0x0E55, 0x0E56, 0x0E57,
- 0x0E58, 0x0E59, 0x0E5A, 0x0E5B, 0x0000, 0x0000, 0x0000, 0x0000,
-};
-static const FX_WCHAR g_FX_CP1250Unicodes[128] = {
- 0x20AC, 0x0000, 0x201A, 0x0000, 0x201E, 0x2026, 0x2020, 0x2021,
- 0x0000, 0x2030, 0x0160, 0x2039, 0x015A, 0x0164, 0x017D, 0x0179,
- 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
- 0x0000, 0x2122, 0x0161, 0x203A, 0x015B, 0x0165, 0x017E, 0x017A,
- 0x00A0, 0x02C7, 0x02D8, 0x0141, 0x00A4, 0x0104, 0x00A6, 0x00A7,
- 0x00A8, 0x00A9, 0x015E, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x017B,
- 0x00B0, 0x00B1, 0x02DB, 0x0142, 0x00B4, 0x00B5, 0x00B6, 0x00B7,
- 0x00B8, 0x0105, 0x015F, 0x00BB, 0x013D, 0x02DD, 0x013E, 0x017C,
- 0x0154, 0x00C1, 0x00C2, 0x0102, 0x00C4, 0x0139, 0x0106, 0x00C7,
- 0x010C, 0x00C9, 0x0118, 0x00CB, 0x011A, 0x00CD, 0x00CE, 0x010E,
- 0x0110, 0x0143, 0x0147, 0x00D3, 0x00D4, 0x0150, 0x00D6, 0x00D7,
- 0x0158, 0x016E, 0x00DA, 0x0170, 0x00DC, 0x00DD, 0x0162, 0x00DF,
- 0x0155, 0x00E1, 0x00E2, 0x0103, 0x00E4, 0x013A, 0x0107, 0x00E7,
- 0x010D, 0x00E9, 0x0119, 0x00EB, 0x011B, 0x00ED, 0x00EE, 0x010F,
- 0x0111, 0x0144, 0x0148, 0x00F3, 0x00F4, 0x0151, 0x00F6, 0x00F7,
- 0x0159, 0x016F, 0x00FA, 0x0171, 0x00FC, 0x00FD, 0x0163, 0x02D9,
-};
-static const FX_WCHAR g_FX_CP1251Unicodes[128] = {
- 0x0402, 0x0403, 0x201A, 0x0453, 0x201E, 0x2026, 0x2020, 0x2021,
- 0x20AC, 0x2030, 0x0409, 0x2039, 0x040A, 0x040C, 0x040B, 0x040F,
- 0x0452, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
- 0x0000, 0x2122, 0x0459, 0x203A, 0x045A, 0x045C, 0x045B, 0x045F,
- 0x00A0, 0x040E, 0x045E, 0x0408, 0x00A4, 0x0490, 0x00A6, 0x00A7,
- 0x0401, 0x00A9, 0x0404, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x0407,
- 0x00B0, 0x00B1, 0x0406, 0x0456, 0x0491, 0x00B5, 0x00B6, 0x00B7,
- 0x0451, 0x2116, 0x0454, 0x00BB, 0x0458, 0x0405, 0x0455, 0x0457,
- 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417,
- 0x0418, 0x0419, 0x041A, 0x041B, 0x041C, 0x041D, 0x041E, 0x041F,
- 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427,
- 0x0428, 0x0429, 0x042A, 0x042B, 0x042C, 0x042D, 0x042E, 0x042F,
- 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437,
- 0x0438, 0x0439, 0x043A, 0x043B, 0x043C, 0x043D, 0x043E, 0x043F,
- 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447,
- 0x0448, 0x0449, 0x044A, 0x044B, 0x044C, 0x044D, 0x044E, 0x044F,
-};
-static const FX_WCHAR g_FX_CP1253Unicodes[128] = {
- 0x20AC, 0x0000, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021,
- 0x0000, 0x2030, 0x0000, 0x2039, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
- 0x0000, 0x2122, 0x0000, 0x203A, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x00A0, 0x0385, 0x0386, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7,
- 0x00A8, 0x00A9, 0x0000, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x2015,
- 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x0384, 0x00B5, 0x00B6, 0x00B7,
- 0x0388, 0x0389, 0x038A, 0x00BB, 0x038C, 0x00BD, 0x038E, 0x038F,
- 0x0390, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397,
- 0x0398, 0x0399, 0x039A, 0x039B, 0x039C, 0x039D, 0x039E, 0x039F,
- 0x03A0, 0x03A1, 0x0000, 0x03A3, 0x03A4, 0x03A5, 0x03A6, 0x03A7,
- 0x03A8, 0x03A9, 0x03AA, 0x03AB, 0x03AC, 0x03AD, 0x03AE, 0x03AF,
- 0x03B0, 0x03B1, 0x03B2, 0x03B3, 0x03B4, 0x03B5, 0x03B6, 0x03B7,
- 0x03B8, 0x03B9, 0x03BA, 0x03BB, 0x03BC, 0x03BD, 0x03BE, 0x03BF,
- 0x03C0, 0x03C1, 0x03C2, 0x03C3, 0x03C4, 0x03C5, 0x03C6, 0x03C7,
- 0x03C8, 0x03C9, 0x03CA, 0x03CB, 0x03CC, 0x03CD, 0x03CE, 0x0000,
-};
-static const FX_WCHAR g_FX_CP1254Unicodes[128] = {
- 0x20AC, 0x0000, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021,
- 0x02C6, 0x2030, 0x0160, 0x2039, 0x0152, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
- 0x02DC, 0x2122, 0x0161, 0x203A, 0x0153, 0x0000, 0x0000, 0x0178,
- 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7,
- 0x00A8, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF,
- 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7,
- 0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF,
- 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7,
- 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF,
- 0x011E, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7,
- 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x0130, 0x015E, 0x00DF,
- 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7,
- 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF,
- 0x011F, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7,
- 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x0131, 0x015F, 0x00FF,
-};
-static const FX_WCHAR g_FX_CP1255Unicodes[128] = {
- 0x20AC, 0x0000, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021,
- 0x02C6, 0x2030, 0x0000, 0x2039, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
- 0x02DC, 0x2122, 0x0000, 0x203A, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x20AA, 0x00A5, 0x00A6, 0x00A7,
- 0x00A8, 0x00A9, 0x00D7, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF,
- 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7,
- 0x00B8, 0x00B9, 0x00F7, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF,
- 0x05B0, 0x05B1, 0x05B2, 0x05B3, 0x05B4, 0x05B5, 0x05B6, 0x05B7,
- 0x05B8, 0x05B9, 0x0000, 0x05BB, 0x05BC, 0x05BD, 0x05BE, 0x05BF,
- 0x05C0, 0x05C1, 0x05C2, 0x05C3, 0x05F0, 0x05F1, 0x05F2, 0x05F3,
- 0x05F4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x05D0, 0x05D1, 0x05D2, 0x05D3, 0x05D4, 0x05D5, 0x05D6, 0x05D7,
- 0x05D8, 0x05D9, 0x05DA, 0x05DB, 0x05DC, 0x05DD, 0x05DE, 0x05DF,
- 0x05E0, 0x05E1, 0x05E2, 0x05E3, 0x05E4, 0x05E5, 0x05E6, 0x05E7,
- 0x05E8, 0x05E9, 0x05EA, 0x0000, 0x0000, 0x200E, 0x200F, 0x0000,
-};
-static const FX_WCHAR g_FX_CP1256Unicodes[128] = {
- 0x20AC, 0x067E, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021,
- 0x02C6, 0x2030, 0x0679, 0x2039, 0x0152, 0x0686, 0x0698, 0x0688,
- 0x06AF, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
- 0x06A9, 0x2122, 0x0691, 0x203A, 0x0153, 0x200C, 0x200D, 0x06BA,
- 0x00A0, 0x060C, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7,
- 0x00A8, 0x00A9, 0x06BE, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF,
- 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7,
- 0x00B8, 0x00B9, 0x061B, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x061F,
- 0x06C1, 0x0621, 0x0622, 0x0623, 0x0624, 0x0625, 0x0626, 0x0627,
- 0x0628, 0x0629, 0x062A, 0x062B, 0x062C, 0x062D, 0x062E, 0x062F,
- 0x0630, 0x0631, 0x0632, 0x0633, 0x0634, 0x0635, 0x0636, 0x00D7,
- 0x0637, 0x0638, 0x0639, 0x063A, 0x0640, 0x0641, 0x0642, 0x0643,
- 0x00E0, 0x0644, 0x00E2, 0x0645, 0x0646, 0x0647, 0x0648, 0x00E7,
- 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x0649, 0x064A, 0x00EE, 0x00EF,
- 0x064B, 0x064C, 0x064D, 0x064E, 0x00F4, 0x064F, 0x0650, 0x00F7,
- 0x0651, 0x00F9, 0x0652, 0x00FB, 0x00FC, 0x200E, 0x200F, 0x06D2,
-};
-static const FX_WCHAR g_FX_CP1257Unicodes[128] = {
- 0x20AC, 0x0000, 0x201A, 0x0000, 0x201E, 0x2026, 0x2020, 0x2021,
- 0x0000, 0x2030, 0x0000, 0x2039, 0x0000, 0x00A8, 0x02C7, 0x00B8,
- 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
- 0x0000, 0x2122, 0x0000, 0x203A, 0x0000, 0x00AF, 0x02DB, 0x0000,
- 0x00A0, 0x0000, 0x00A2, 0x00A3, 0x00A4, 0x0000, 0x00A6, 0x00A7,
- 0x00D8, 0x00A9, 0x0156, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00C6,
- 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7,
- 0x00F8, 0x00B9, 0x0157, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00E6,
- 0x0104, 0x012E, 0x0100, 0x0106, 0x00C4, 0x00C5, 0x0118, 0x0112,
- 0x010C, 0x00C9, 0x0179, 0x0116, 0x0122, 0x0136, 0x012A, 0x013B,
- 0x0160, 0x0143, 0x0145, 0x00D3, 0x014C, 0x00D5, 0x00D6, 0x00D7,
- 0x0172, 0x0141, 0x015A, 0x016A, 0x00DC, 0x017B, 0x017D, 0x00DF,
- 0x0105, 0x012F, 0x0101, 0x0107, 0x00E4, 0x00E5, 0x0119, 0x0113,
- 0x010D, 0x00E9, 0x017A, 0x0117, 0x0123, 0x0137, 0x012B, 0x013C,
- 0x0161, 0x0144, 0x0146, 0x00F3, 0x014D, 0x00F5, 0x00F6, 0x00F7,
- 0x0173, 0x0142, 0x015B, 0x016B, 0x00FC, 0x017C, 0x017E, 0x02D9,
-};
-typedef struct {
- FX_BYTE m_Charset;
- const FX_WCHAR* m_pUnicodes;
-} FX_CharsetUnicodes;
-const FX_CharsetUnicodes g_FX_CharsetUnicodes[] = {
- { FXFONT_THAI_CHARSET, g_FX_CP874Unicodes },
- { FXFONT_EASTEUROPE_CHARSET, g_FX_CP1250Unicodes },
- { FXFONT_RUSSIAN_CHARSET, g_FX_CP1251Unicodes },
- { FXFONT_GREEK_CHARSET, g_FX_CP1253Unicodes },
- { FXFONT_TURKISH_CHARSET, g_FX_CP1254Unicodes },
- { FXFONT_HEBREW_CHARSET, g_FX_CP1255Unicodes },
- { FXFONT_ARABIC_CHARSET, g_FX_CP1256Unicodes },
- { FXFONT_BALTIC_CHARSET, g_FX_CP1257Unicodes },
-};
-#if (_FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN32_MOBILE_ || _FX_OS_ == _FX_WIN64_)
-static void _InsertWidthArray(HDC hDC, int start, int end, CPDF_Array* pWidthArray)
-{
- int size = end - start + 1;
- int* widths = FX_Alloc(int, size);
- GetCharWidth(hDC, start, end, widths);
- int i;
- for (i = 1; i < size; i ++)
- if (widths[i] != *widths) {
- break;
- }
- if (i == size) {
- int first = pWidthArray->GetInteger(pWidthArray->GetCount() - 1);
- pWidthArray->AddInteger(first + size - 1);
- pWidthArray->AddInteger(*widths);
- } else {
- CPDF_Array* pWidthArray1 = FX_NEW CPDF_Array;
- pWidthArray->Add(pWidthArray1);
- for (i = 0; i < size; i ++) {
- pWidthArray1->AddInteger(widths[i]);
- }
- }
- FX_Free(widths);
-}
-CPDF_Font* CPDF_Document::AddWindowsFont(LOGFONTW* pLogFont, FX_BOOL bVert, FX_BOOL bTranslateName)
-{
- LOGFONTA lfa;
- FXSYS_memcpy32(&lfa, pLogFont, (char*)lfa.lfFaceName - (char*)&lfa);
- CFX_ByteString face = CFX_ByteString::FromUnicode(pLogFont->lfFaceName);
- if (face.GetLength() >= LF_FACESIZE) {
- return NULL;
- }
- FXSYS_strcpy(lfa.lfFaceName, (FX_LPCSTR)face);
- return AddWindowsFont(&lfa, bVert, bTranslateName);
-}
-extern CFX_ByteString _FPDF_GetNameFromTT(FX_LPCBYTE name_table, FX_DWORD name);
-CFX_ByteString _FPDF_GetPSNameFromTT(HDC hDC)
-{
- CFX_ByteString result;
- DWORD size = ::GetFontData(hDC, 'eman', 0, NULL, 0);
- if (size != GDI_ERROR) {
- LPBYTE buffer = FX_Alloc(BYTE, size);
- ::GetFontData(hDC, 'eman', 0, buffer, size);
- result = _FPDF_GetNameFromTT(buffer, 6);
- FX_Free(buffer);
- }
- return result;
-}
-CPDF_Font* CPDF_Document::AddWindowsFont(LOGFONTA* pLogFont, FX_BOOL bVert, FX_BOOL bTranslateName)
-{
- pLogFont->lfHeight = -1000;
- pLogFont->lfWidth = 0;
- HGDIOBJ hFont = CreateFontIndirectA(pLogFont);
- HDC hDC = CreateCompatibleDC(NULL);
- hFont = SelectObject(hDC, hFont);
- int tm_size = GetOutlineTextMetrics(hDC, 0, NULL);
- if (tm_size == 0) {
- hFont = SelectObject(hDC, hFont);
- DeleteObject(hFont);
- DeleteDC(hDC);
- return NULL;
- }
- LPBYTE tm_buf = FX_Alloc(BYTE, tm_size);
- OUTLINETEXTMETRIC* ptm = (OUTLINETEXTMETRIC*)tm_buf;
- GetOutlineTextMetrics(hDC, tm_size, ptm);
- int flags = 0, italicangle, ascend, descend, capheight, bbox[4];
- if (pLogFont->lfItalic) {
- flags |= PDFFONT_ITALIC;
- }
- if ((pLogFont->lfPitchAndFamily & 3) == FIXED_PITCH) {
- flags |= PDFFONT_FIXEDPITCH;
- }
- if ((pLogFont->lfPitchAndFamily & 0xf8) == FF_ROMAN) {
- flags |= PDFFONT_SERIF;
- }
- if ((pLogFont->lfPitchAndFamily & 0xf8) == FF_SCRIPT) {
- flags |= PDFFONT_SCRIPT;
- }
- FX_BOOL bCJK = pLogFont->lfCharSet == CHINESEBIG5_CHARSET || pLogFont->lfCharSet == GB2312_CHARSET ||
- pLogFont->lfCharSet == HANGEUL_CHARSET || pLogFont->lfCharSet == SHIFTJIS_CHARSET;
- CFX_ByteString basefont;
- if (bTranslateName && bCJK) {
- basefont = _FPDF_GetPSNameFromTT(hDC);
- }
- if (basefont.IsEmpty()) {
- basefont = pLogFont->lfFaceName;
- }
- italicangle = ptm->otmItalicAngle / 10;
- ascend = ptm->otmrcFontBox.top;
- descend = ptm->otmrcFontBox.bottom;
- capheight = ptm->otmsCapEmHeight;
- bbox[0] = ptm->otmrcFontBox.left;
- bbox[1] = ptm->otmrcFontBox.bottom;
- bbox[2] = ptm->otmrcFontBox.right;
- bbox[3] = ptm->otmrcFontBox.top;
- FX_Free(tm_buf);
- basefont.Replace(" ", "");
- CPDF_Dictionary* pBaseDict = FX_NEW CPDF_Dictionary;
- pBaseDict->SetAtName("Type", "Font");
- CPDF_Dictionary* pFontDict = pBaseDict;
- if (!bCJK) {
- if (pLogFont->lfCharSet == ANSI_CHARSET || pLogFont->lfCharSet == DEFAULT_CHARSET ||
- pLogFont->lfCharSet == SYMBOL_CHARSET) {
- if (pLogFont->lfCharSet == SYMBOL_CHARSET) {
- flags |= PDFFONT_SYMBOLIC;
- } else {
- flags |= PDFFONT_NONSYMBOLIC;
- }
- pBaseDict->SetAtName(FX_BSTRC("Encoding"), "WinAnsiEncoding");
- } else {
- flags |= PDFFONT_NONSYMBOLIC;
- int i;
- for (i = 0; i < sizeof g_FX_CharsetUnicodes / sizeof(FX_CharsetUnicodes); i ++)
- if (g_FX_CharsetUnicodes[i].m_Charset == pLogFont->lfCharSet) {
- break;
- }
- if (i < sizeof g_FX_CharsetUnicodes / sizeof(FX_CharsetUnicodes)) {
- CPDF_Dictionary* pEncoding = FX_NEW CPDF_Dictionary;
- pEncoding->SetAtName(FX_BSTRC("BaseEncoding"), "WinAnsiEncoding");
- CPDF_Array* pArray = FX_NEW CPDF_Array;
- pArray->AddInteger(128);
- const FX_WCHAR* pUnicodes = g_FX_CharsetUnicodes[i].m_pUnicodes;
- for (int j = 0; j < 128; j ++) {
- CFX_ByteString name = PDF_AdobeNameFromUnicode(pUnicodes[j]);
- if (name.IsEmpty()) {
- pArray->AddName(FX_BSTRC(".notdef"));
- } else {
- pArray->AddName(name);
- }
- }
- pEncoding->SetAt(FX_BSTRC("Differences"), pArray);
- AddIndirectObject(pEncoding);
- pBaseDict->SetAtReference(FX_BSTRC("Encoding"), this, pEncoding);
- }
- }
- if (pLogFont->lfWeight > FW_MEDIUM && pLogFont->lfItalic) {
- basefont += ",BoldItalic";
- } else if (pLogFont->lfWeight > FW_MEDIUM) {
- basefont += ",Bold";
- } else if (pLogFont->lfItalic) {
- basefont += ",Italic";
- }
- pBaseDict->SetAtName("Subtype", "TrueType");
- pBaseDict->SetAtName("BaseFont", basefont);
- pBaseDict->SetAtNumber("FirstChar", 32);
- pBaseDict->SetAtNumber("LastChar", 255);
- int char_widths[224];
- GetCharWidth(hDC, 32, 255, char_widths);
- CPDF_Array* pWidths = FX_NEW CPDF_Array;
- for (int i = 0; i < 224; i ++) {
- pWidths->AddInteger(char_widths[i]);
- }
- pBaseDict->SetAt("Widths", pWidths);
- } else {
- flags |= PDFFONT_NONSYMBOLIC;
- pFontDict = FX_NEW CPDF_Dictionary;
- CFX_ByteString cmap;
- CFX_ByteString ordering;
- int supplement;
- CPDF_Array* pWidthArray = FX_NEW CPDF_Array;
- switch (pLogFont->lfCharSet) {
- case CHINESEBIG5_CHARSET:
- cmap = bVert ? "ETenms-B5-V" : "ETenms-B5-H";
- ordering = "CNS1";
- supplement = 4;
- pWidthArray->AddInteger(1);
- _InsertWidthArray(hDC, 0x20, 0x7e, pWidthArray);
- break;
- case GB2312_CHARSET:
- cmap = bVert ? "GBK-EUC-V" : "GBK-EUC-H";
- ordering = "GB1", supplement = 2;
- pWidthArray->AddInteger(7716);
- _InsertWidthArray(hDC, 0x20, 0x20, pWidthArray);
- pWidthArray->AddInteger(814);
- _InsertWidthArray(hDC, 0x21, 0x7e, pWidthArray);
- break;
- case HANGEUL_CHARSET:
- cmap = bVert ? "KSCms-UHC-V" : "KSCms-UHC-H";
- ordering = "Korea1";
- supplement = 2;
- pWidthArray->AddInteger(1);
- _InsertWidthArray(hDC, 0x20, 0x7e, pWidthArray);
- break;
- case SHIFTJIS_CHARSET:
- cmap = bVert ? "90ms-RKSJ-V" : "90ms-RKSJ-H";
- ordering = "Japan1";
- supplement = 5;
- pWidthArray->AddInteger(231);
- _InsertWidthArray(hDC, 0x20, 0x7d, pWidthArray);
- pWidthArray->AddInteger(326);
- _InsertWidthArray(hDC, 0xa0, 0xa0, pWidthArray);
- pWidthArray->AddInteger(327);
- _InsertWidthArray(hDC, 0xa1, 0xdf, pWidthArray);
- pWidthArray->AddInteger(631);
- _InsertWidthArray(hDC, 0x7e, 0x7e, pWidthArray);
- break;
- }
- pBaseDict->SetAtName("Subtype", "Type0");
- pBaseDict->SetAtName("BaseFont", basefont);
- pBaseDict->SetAtName("Encoding", cmap);
- pFontDict->SetAt("W", pWidthArray);
- pFontDict->SetAtName("Type", "Font");
- pFontDict->SetAtName("Subtype", "CIDFontType2");
- pFontDict->SetAtName("BaseFont", basefont);
- CPDF_Dictionary* pCIDSysInfo = FX_NEW CPDF_Dictionary;
- pCIDSysInfo->SetAtString("Registry", "Adobe");
- pCIDSysInfo->SetAtString("Ordering", ordering);
- pCIDSysInfo->SetAtInteger("Supplement", supplement);
- pFontDict->SetAt("CIDSystemInfo", pCIDSysInfo);
- CPDF_Array* pArray = FX_NEW CPDF_Array;
- pBaseDict->SetAt("DescendantFonts", pArray);
- AddIndirectObject(pFontDict);
- pArray->AddReference(this, pFontDict);
- }
- AddIndirectObject(pBaseDict);
- CPDF_Dictionary* pFontDesc = FX_NEW CPDF_Dictionary;
- pFontDesc->SetAtName("Type", "FontDescriptor");
- pFontDesc->SetAtName("FontName", basefont);
- pFontDesc->SetAtInteger("Flags", flags);
- CPDF_Array* pBBox = FX_NEW CPDF_Array;
- for (int i = 0; i < 4; i ++) {
- pBBox->AddInteger(bbox[i]);
- }
- pFontDesc->SetAt("FontBBox", pBBox);
- pFontDesc->SetAtInteger("ItalicAngle", italicangle);
- pFontDesc->SetAtInteger("Ascent", ascend);
- pFontDesc->SetAtInteger("Descent", descend);
- pFontDesc->SetAtInteger("CapHeight", capheight);
- pFontDesc->SetAtInteger("StemV", pLogFont->lfWeight / 5);
- AddIndirectObject(pFontDesc);
- pFontDict->SetAtReference("FontDescriptor", this, pFontDesc);
- hFont = SelectObject(hDC, hFont);
- DeleteObject(hFont);
- DeleteDC(hDC);
- return LoadFont(pBaseDict);
-}
-#endif
-#if (_FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_)
-FX_UINT32 FX_GetLangHashCode( FX_LPCSTR pStr)
-{
- FXSYS_assert( pStr != NULL);
- FX_INT32 iLength = FXSYS_strlen(pStr);
- FX_LPCSTR pStrEnd = pStr + iLength;
- FX_UINT32 uHashCode = 0;
- while ( pStr < pStrEnd) {
- uHashCode = 31 * uHashCode + tolower(*pStr++);
- }
- return uHashCode;
-}
-struct FX_LANG2CS {
- FX_DWORD uLang;
- int uCharset;
-}*FX_LPLANG2CS;
-static const FX_LANG2CS gs_FXLang2CharsetTable[] = {
- {3109, 0},
- {3121, 178},
- {3129, 162},
- {3139, 204},
- {3141, 204},
- {3166, 0},
- {3184, 238},
- {3197, 0},
- {3201, 0},
- {3239, 161},
- {3241, 0},
- {3246, 0},
- {3247, 186},
- {3248, 0},
- {3259, 178},
- {3267, 0},
- {3273, 0},
- {3276, 0},
- {3301, 0},
- {3310, 1},
- {3325, 177},
- {3329, 1},
- {3338, 238},
- {3341, 238},
- {3345, 1},
- {3355, 0},
- {3370, 0},
- {3371, 0},
- {3383, 128},
- {3424, 204},
- {3427, 1},
- {3428, 129},
- {3436, 178},
- {3464, 186},
- {3466, 186},
- {3486, 204},
- {3487, 0},
- {3493, 1},
- {3494, 0},
- {3508, 0},
- {3518, 0},
- {3520, 0},
- {3569, 1},
- {3580, 238},
- {3588, 0},
- {3645, 238},
- {3651, 204},
- {3672, 238},
- {3673, 238},
- {3678, 238},
- {3679, 238},
- {3683, 0},
- {3684, 0},
- {3693, 1},
- {3697, 1},
- {3700, 222},
- {3710, 162},
- {3734, 204},
- {3741, 178},
- {3749, 162},
- {3763, 163},
- {3886, 134},
- {105943, 0},
- {106375, 1},
- {3923451837, 134},
- {3923451838, 136},
-};
-static FX_WORD FX_GetCsFromLangCode(FX_UINT32 uCode)
-{
- FX_INT32 iStart = 0;
- FX_INT32 iEnd = sizeof(gs_FXLang2CharsetTable) / sizeof(FX_LANG2CS) - 1;
- while (iStart <= iEnd) {
- FX_INT32 iMid = (iStart + iEnd) / 2;
- const FX_LANG2CS &charset = gs_FXLang2CharsetTable[iMid];
- if (uCode == charset.uLang) {
- return charset.uCharset;
- } else if (uCode < charset.uLang) {
- iEnd = iMid - 1;
- } else {
- iStart = iMid + 1;
- }
- };
- return 0;
-}
-static FX_WORD FX_GetCharsetFromLang(FX_LPCSTR pLang, FX_INT32 iLength)
-{
- FXSYS_assert(pLang);
- if (iLength < 0) {
- iLength = FXSYS_strlen(pLang);
- }
- FX_UINT32 uHash = FX_GetLangHashCode(pLang);
- return FX_GetCsFromLangCode(uHash);
-}
-static void _CFString2CFXByteString(CFStringRef src, CFX_ByteString &dest)
-{
- SInt32 len = CFStringGetLength(src);
- CFRange range = CFRangeMake(0, len);
- CFIndex used = 0;
- UInt8* pBuffer = (UInt8*)malloc(sizeof(UInt8) * (len + 1));
- FXSYS_memset32(pBuffer, 0, sizeof(UInt8) * (len + 1));
- CFStringGetBytes(src, range, kCFStringEncodingASCII, 0, false, pBuffer, len, &used);
- dest = (FX_LPSTR)pBuffer;
- free(pBuffer);
-}
-FX_BOOL IsHasCharSet(CFArrayRef languages, const CFX_DWordArray &charSets)
-{
- int iCount = charSets.GetSize();
- for (int i = 0; i < CFArrayGetCount(languages); ++i) {
- CFStringRef language = (CFStringRef)CFArrayGetValueAtIndex(languages, i);
- FX_DWORD CharSet = FX_GetCharsetFromLang(CFStringGetCStringPtr(language, kCFStringEncodingMacRoman), -1);
- for (int j = 0; j < iCount; ++j) {
- if (CharSet == charSets[j]) {
- return TRUE;
- }
- }
- }
- return FALSE;
-}
-void FX_GetCharWidth(CTFontRef font, UniChar start, UniChar end, int* width)
-{
- CGFloat size = CTFontGetSize(font);
- for (; start <= end; ++start) {
- CGGlyph pGlyph = 0;
- CFIndex count = 1;
- CTFontGetGlyphsForCharacters(font, &start, &pGlyph, count);
- CGSize advances;
- CTFontGetAdvancesForGlyphs(font, kCTFontDefaultOrientation, &pGlyph, &advances, 1);
- *width = (int)(advances.width / size * 1000) ;
- width++;
- }
-}
-static void _InsertWidthArray(CTFontRef font, int start, int end, CPDF_Array* pWidthArray)
-{
- int size = end - start + 1;
- int* widths = FX_Alloc(int, size);
- FX_GetCharWidth(font, start, end, widths);
- int i;
- for (i = 1; i < size; i ++)
- if (widths[i] != *widths) {
- break;
- }
- if (i == size) {
- int first = pWidthArray->GetInteger(pWidthArray->GetCount() - 1);
- pWidthArray->AddInteger(first + size - 1);
- pWidthArray->AddInteger(*widths);
- } else {
- CPDF_Array* pWidthArray1 = FX_NEW CPDF_Array;
- pWidthArray->Add(pWidthArray1);
- for (i = 0; i < size; i ++) {
- pWidthArray1->AddInteger(widths[i]);
- }
- }
- FX_Free(widths);
-}
-CPDF_Font* CPDF_Document::AddMacFont(CTFontRef pFont, FX_BOOL bVert, FX_BOOL bTranslateName)
-{
- CTFontRef font = (CTFontRef)pFont;
- CTFontDescriptorRef descriptor = CTFontCopyFontDescriptor(font);
- if (descriptor == NULL) {
- return NULL;
- }
- CFX_ByteString basefont;
- FX_BOOL bCJK = FALSE;
- int flags = 0, italicangle = 0, ascend = 0, descend = 0, capheight = 0, bbox[4];
- FXSYS_memset32(bbox, 0, sizeof(int) * 4);
- CFArrayRef languages = (CFArrayRef)CTFontDescriptorCopyAttribute(descriptor, kCTFontLanguagesAttribute);
- if (languages == NULL) {
- CFRelease(descriptor);
- return NULL;
- }
- CFX_DWordArray charSets;
- charSets.Add(FXFONT_CHINESEBIG5_CHARSET);
- charSets.Add(FXFONT_GB2312_CHARSET);
- charSets.Add(FXFONT_HANGEUL_CHARSET);
- charSets.Add(FXFONT_SHIFTJIS_CHARSET);
- if (IsHasCharSet(languages, charSets)) {
- bCJK = TRUE;
- }
- CFRelease(descriptor);
- CFDictionaryRef traits = (CFDictionaryRef)CTFontCopyTraits(font);
- if (traits == NULL) {
- CFRelease(languages);
- return NULL;
- }
- CFNumberRef sybolicTrait = (CFNumberRef)CFDictionaryGetValue(traits, kCTFontSymbolicTrait);
- CTFontSymbolicTraits trait = 0;
- CFNumberGetValue(sybolicTrait, kCFNumberSInt32Type, &trait);
- if (trait & kCTFontItalicTrait) {
- flags |= PDFFONT_ITALIC;
- }
- if (trait & kCTFontMonoSpaceTrait) {
- flags |= PDFFONT_FIXEDPITCH;
- }
- if (trait & kCTFontModernSerifsClass) {
- flags |= PDFFONT_SERIF;
- }
- if (trait & kCTFontScriptsClass) {
- flags |= PDFFONT_SCRIPT;
- }
- CFNumberRef weightTrait = (CFNumberRef)CFDictionaryGetValue(traits, kCTFontWeightTrait);
- Float32 weight = 0;
- CFNumberGetValue(weightTrait, kCFNumberFloat32Type, &weight);
- italicangle = CTFontGetSlantAngle(font);
- ascend = CTFontGetAscent(font);
- descend = CTFontGetDescent(font);
- capheight = CTFontGetCapHeight(font);
- CGRect box = CTFontGetBoundingBox(font);
- bbox[0] = box.origin.x;
- bbox[1] = box.origin.y;
- bbox[2] = box.origin.x + box.size.width;
- bbox[3] = box.origin.y + box.size.height;
- if (bTranslateName && bCJK) {
- CFStringRef postName = CTFontCopyPostScriptName(font);
- _CFString2CFXByteString(postName, basefont);
- CFRelease(postName);
- }
- if (basefont.IsEmpty()) {
- CFStringRef fullName = CTFontCopyFullName(font);
- _CFString2CFXByteString(fullName, basefont);
- CFRelease(fullName);
- }
- basefont.Replace(" ", "");
- CPDF_Dictionary* pFontDict = NULL;
- CPDF_Dictionary* pBaseDict = FX_NEW CPDF_Dictionary;
- pFontDict = pBaseDict;
- if (!bCJK) {
- charSets.RemoveAll();
- charSets.Add(FXFONT_ANSI_CHARSET);
- charSets.Add(FXFONT_DEFAULT_CHARSET);
- charSets.Add(FXFONT_SYMBOL_CHARSET);
- if (IsHasCharSet(languages, charSets)) {
- charSets.RemoveAll();
- charSets.Add(FXFONT_SYMBOL_CHARSET);
- if (IsHasCharSet(languages, charSets)) {
- flags |= PDFFONT_SYMBOLIC;
- } else {
- flags |= PDFFONT_NONSYMBOLIC;
- }
- pBaseDict->SetAtName(FX_BSTRC("Encoding"), "WinAnsiEncoding");
- } else {
- flags |= PDFFONT_NONSYMBOLIC;
- int i;
- for (i = 0; i < sizeof g_FX_CharsetUnicodes / sizeof(FX_CharsetUnicodes); i ++) {
- charSets.RemoveAll();
- charSets.Add(g_FX_CharsetUnicodes[i].m_Charset);
- if (IsHasCharSet(languages, charSets)) {
- break;
- }
- }
- if (i < sizeof g_FX_CharsetUnicodes / sizeof(FX_CharsetUnicodes)) {
- CPDF_Dictionary* pEncoding = FX_NEW CPDF_Dictionary;
- pEncoding->SetAtName(FX_BSTRC("BaseEncoding"), "WinAnsiEncoding");
- CPDF_Array* pArray = FX_NEW CPDF_Array;
- pArray->AddInteger(128);
- const FX_WCHAR* pUnicodes = g_FX_CharsetUnicodes[i].m_pUnicodes;
- for (int j = 0; j < 128; j ++) {
- CFX_ByteString name = PDF_AdobeNameFromUnicode(pUnicodes[j]);
- if (name.IsEmpty()) {
- pArray->AddName(FX_BSTRC(".notdef"));
- } else {
- pArray->AddName(name);
- }
- }
- pEncoding->SetAt(FX_BSTRC("Differences"), pArray);
- AddIndirectObject(pEncoding);
- pBaseDict->SetAtReference(FX_BSTRC("Encoding"), this, pEncoding);
- }
- }
- if (weight > 0.0 && trait & kCTFontItalicTrait) {
- basefont += ",BoldItalic";
- } else if (weight > 0.0) {
- basefont += ",Bold";
- } else if (trait & kCTFontItalicTrait) {
- basefont += ",Italic";
- }
- pBaseDict->SetAtName("Subtype", "TrueType");
- pBaseDict->SetAtName("BaseFont", basefont);
- pBaseDict->SetAtNumber("FirstChar", 32);
- pBaseDict->SetAtNumber("LastChar", 255);
- int char_widths[224];
- FX_GetCharWidth(font, 32, 255, char_widths);
- CPDF_Array* pWidths = FX_NEW CPDF_Array;
- for (int i = 0; i < 224; i ++) {
- pWidths->AddInteger(char_widths[i]);
- }
- pBaseDict->SetAt("Widths", pWidths);
- } else {
- flags |= PDFFONT_NONSYMBOLIC;
- CPDF_Array* pArray = NULL;
- pFontDict = FX_NEW CPDF_Dictionary;
- CFX_ByteString cmap;
- CFX_ByteString ordering;
- int supplement;
- FX_BOOL bFound = FALSE;
- CPDF_Array* pWidthArray = FX_NEW CPDF_Array;
- charSets.RemoveAll();
- charSets.Add(FXFONT_CHINESEBIG5_CHARSET);
- if (IsHasCharSet(languages, charSets)) {
- cmap = bVert ? "ETenms-B5-V" : "ETenms-B5-H";
- ordering = "CNS1";
- supplement = 4;
- pWidthArray->AddInteger(1);
- _InsertWidthArray(font, 0x20, 0x7e, pWidthArray);
- bFound = TRUE;
- }
- charSets.RemoveAll();
- charSets.Add(FXFONT_GB2312_CHARSET);
- if (!bFound && IsHasCharSet(languages, charSets)) {
- cmap = bVert ? "GBK-EUC-V" : "GBK-EUC-H";
- ordering = "GB1", supplement = 2;
- pWidthArray->AddInteger(7716);
- _InsertWidthArray(font, 0x20, 0x20, pWidthArray);
- pWidthArray->AddInteger(814);
- _InsertWidthArray(font, 0x21, 0x7e, pWidthArray);
- bFound = TRUE;
- }
- charSets.RemoveAll();
- charSets.Add(FXFONT_HANGEUL_CHARSET);
- if (!bFound && IsHasCharSet(languages, charSets)) {
- cmap = bVert ? "KSCms-UHC-V" : "KSCms-UHC-H";
- ordering = "Korea1";
- supplement = 2;
- pWidthArray->AddInteger(1);
- _InsertWidthArray(font, 0x20, 0x7e, pWidthArray);
- bFound = TRUE;
- }
- charSets.RemoveAll();
- charSets.Add(FXFONT_SHIFTJIS_CHARSET);
- if (!bFound && IsHasCharSet(languages, charSets)) {
- cmap = bVert ? "90ms-RKSJ-V" : "90ms-RKSJ-H";
- ordering = "Japan1";
- supplement = 5;
- pWidthArray->AddInteger(231);
- _InsertWidthArray(font, 0x20, 0x7d, pWidthArray);
- pWidthArray->AddInteger(326);
- _InsertWidthArray(font, 0xa0, 0xa0, pWidthArray);
- pWidthArray->AddInteger(327);
- _InsertWidthArray(font, 0xa1, 0xdf, pWidthArray);
- pWidthArray->AddInteger(631);
- _InsertWidthArray(font, 0x7e, 0x7e, pWidthArray);
- }
- pBaseDict->SetAtName("Subtype", "Type0");
- pBaseDict->SetAtName("BaseFont", basefont);
- pBaseDict->SetAtName("Encoding", cmap);
- pFontDict->SetAt("W", pWidthArray);
- pFontDict->SetAtName("Type", "Font");
- pFontDict->SetAtName("Subtype", "CIDFontType2");
- pFontDict->SetAtName("BaseFont", basefont);
- CPDF_Dictionary* pCIDSysInfo = FX_NEW CPDF_Dictionary;
- pCIDSysInfo->SetAtString("Registry", "Adobe");
- pCIDSysInfo->SetAtString("Ordering", ordering);
- pCIDSysInfo->SetAtInteger("Supplement", supplement);
- pFontDict->SetAt("CIDSystemInfo", pCIDSysInfo);
- pArray = FX_NEW CPDF_Array;
- pBaseDict->SetAt("DescendantFonts", pArray);
- AddIndirectObject(pFontDict);
- pArray->AddReference(this, pFontDict);
- }
- AddIndirectObject(pBaseDict);
- CPDF_Dictionary* pFontDesc = FX_NEW CPDF_Dictionary;
- pFontDesc->SetAtName("Type", "FontDescriptor");
- pFontDesc->SetAtName("FontName", basefont);
- pFontDesc->SetAtInteger("Flags", flags);
- CPDF_Array* pBBox = FX_NEW CPDF_Array;
- for (int i = 0; i < 4; i ++) {
- pBBox->AddInteger(bbox[i]);
- }
- pFontDesc->SetAt("FontBBox", pBBox);
- pFontDesc->SetAtInteger("ItalicAngle", italicangle);
- pFontDesc->SetAtInteger("Ascent", ascend);
- pFontDesc->SetAtInteger("Descent", descend);
- pFontDesc->SetAtInteger("CapHeight", capheight);
- CGFloat fStemV = 0;
- int16_t min_width = SHRT_MAX;
- static const UniChar stem_chars[] = {'i', 'I', '!', '1'};
- const size_t count = sizeof(stem_chars) / sizeof(stem_chars[0]);
- CGGlyph glyphs[count];
- CGRect boundingRects[count];
- if (CTFontGetGlyphsForCharacters(font, stem_chars, glyphs, count)) {
- CTFontGetBoundingRectsForGlyphs(font, kCTFontHorizontalOrientation,
- glyphs, boundingRects, count);
- for (size_t i = 0; i < count; i++) {
- int16_t width = boundingRects[i].size.width;
- if (width > 0 && width < min_width) {
- min_width = width;
- fStemV = min_width;
- }
- }
- }
- pFontDesc->SetAtInteger("StemV", fStemV);
- AddIndirectObject(pFontDesc);
- pFontDict->SetAtReference("FontDescriptor", this, pFontDesc);
- CFRelease(traits);
- CFRelease(languages);
- return LoadFont(pBaseDict);
-}
-#endif
-static void _InsertWidthArray1(CFX_Font* pFont, IFX_FontEncoding* pEncoding, FX_WCHAR start, FX_WCHAR end, CPDF_Array* pWidthArray)
-{
- int size = end - start + 1;
- int* widths = FX_Alloc(int, size);
- int i;
- for (i = 0; i < size; i ++) {
- int glyph_index = pEncoding->GlyphFromCharCode(start + i);
- widths[i] = pFont->GetGlyphWidth(glyph_index);
- }
- for (i = 1; i < size; i ++)
- if (widths[i] != *widths) {
- break;
- }
- if (i == size) {
- int first = pWidthArray->GetInteger(pWidthArray->GetCount() - 1);
- pWidthArray->AddInteger(first + size - 1);
- pWidthArray->AddInteger(*widths);
- } else {
- CPDF_Array* pWidthArray1 = FX_NEW CPDF_Array;
- pWidthArray->Add(pWidthArray1);
- for (i = 0; i < size; i ++) {
- pWidthArray1->AddInteger(widths[i]);
- }
- }
- FX_Free(widths);
-}
-CPDF_Font* CPDF_Document::AddFont(CFX_Font* pFont, int charset, FX_BOOL bVert)
-{
- if (pFont == NULL) {
- return NULL;
- }
- FX_BOOL bCJK = charset == FXFONT_CHINESEBIG5_CHARSET || charset == FXFONT_GB2312_CHARSET ||
- charset == FXFONT_HANGEUL_CHARSET || charset == FXFONT_SHIFTJIS_CHARSET;
- CFX_ByteString basefont = pFont->GetFamilyName();
- basefont.Replace(" ", "");
- int flags = 0;
- if (pFont->IsBold()) {
- flags |= PDFFONT_FORCEBOLD;
- }
- if (pFont->IsItalic()) {
- flags |= PDFFONT_ITALIC;
- }
- if (pFont->IsFixedWidth()) {
- flags |= PDFFONT_FIXEDPITCH;
- }
- CPDF_Dictionary* pBaseDict = FX_NEW CPDF_Dictionary;
- pBaseDict->SetAtName("Type", "Font");
- IFX_FontEncoding* pEncoding = FXGE_CreateUnicodeEncoding(pFont);
- CPDF_Dictionary* pFontDict = pBaseDict;
- if (!bCJK) {
- CPDF_Array* pWidths = FX_NEW CPDF_Array;
- int charcode;
- for (charcode = 32; charcode < 128; charcode ++) {
- int glyph_index = pEncoding->GlyphFromCharCode(charcode);
- int char_width = pFont->GetGlyphWidth(glyph_index);
- pWidths->AddInteger(char_width);
- }
- if (charset == FXFONT_ANSI_CHARSET || charset == FXFONT_DEFAULT_CHARSET ||
- charset == FXFONT_SYMBOL_CHARSET) {
- if (charset == FXFONT_SYMBOL_CHARSET) {
- flags |= PDFFONT_SYMBOLIC;
- } else {
- flags |= PDFFONT_NONSYMBOLIC;
- }
- pBaseDict->SetAtName(FX_BSTRC("Encoding"), "WinAnsiEncoding");
- for (charcode = 128; charcode <= 255; charcode ++) {
- int glyph_index = pEncoding->GlyphFromCharCode(charcode);
- int char_width = pFont->GetGlyphWidth(glyph_index);
- pWidths->AddInteger(char_width);
- }
- } else {
- flags |= PDFFONT_NONSYMBOLIC;
- int i;
- for (i = 0; i < sizeof g_FX_CharsetUnicodes / sizeof(FX_CharsetUnicodes); i ++)
- if (g_FX_CharsetUnicodes[i].m_Charset == charset) {
- break;
- }
- if (i < sizeof g_FX_CharsetUnicodes / sizeof(FX_CharsetUnicodes)) {
- CPDF_Dictionary* pEncodingDict = FX_NEW CPDF_Dictionary;
- pEncodingDict->SetAtName(FX_BSTRC("BaseEncoding"), "WinAnsiEncoding");
- CPDF_Array* pArray = FX_NEW CPDF_Array;
- pArray->AddInteger(128);
- const FX_WCHAR* pUnicodes = g_FX_CharsetUnicodes[i].m_pUnicodes;
- for (int j = 0; j < 128; j ++) {
- CFX_ByteString name = PDF_AdobeNameFromUnicode(pUnicodes[j]);
- if (name.IsEmpty()) {
- pArray->AddName(FX_BSTRC(".notdef"));
- } else {
- pArray->AddName(name);
- }
- int glyph_index = pEncoding->GlyphFromCharCode(pUnicodes[j]);
- int char_width = pFont->GetGlyphWidth(glyph_index);
- pWidths->AddInteger(char_width);
- }
- pEncodingDict->SetAt(FX_BSTRC("Differences"), pArray);
- AddIndirectObject(pEncodingDict);
- pBaseDict->SetAtReference(FX_BSTRC("Encoding"), this, pEncodingDict);
- }
- }
- if (pFont->IsBold() && pFont->IsItalic()) {
- basefont += ",BoldItalic";
- } else if (pFont->IsBold()) {
- basefont += ",Bold";
- } else if (pFont->IsItalic()) {
- basefont += ",Italic";
- }
- pBaseDict->SetAtName("Subtype", "TrueType");
- pBaseDict->SetAtName("BaseFont", basefont);
- pBaseDict->SetAtNumber("FirstChar", 32);
- pBaseDict->SetAtNumber("LastChar", 255);
- pBaseDict->SetAt("Widths", pWidths);
- } else {
- flags |= PDFFONT_NONSYMBOLIC;
- pFontDict = FX_NEW CPDF_Dictionary;
- CFX_ByteString cmap;
- CFX_ByteString ordering;
- int supplement;
- CPDF_Array* pWidthArray = FX_NEW CPDF_Array;
- switch (charset) {
- case FXFONT_CHINESEBIG5_CHARSET:
- cmap = bVert ? "ETenms-B5-V" : "ETenms-B5-H";
- ordering = "CNS1";
- supplement = 4;
- pWidthArray->AddInteger(1);
- _InsertWidthArray1(pFont, pEncoding, 0x20, 0x7e, pWidthArray);
- break;
- case FXFONT_GB2312_CHARSET:
- cmap = bVert ? "GBK-EUC-V" : "GBK-EUC-H";
- ordering = "GB1", supplement = 2;
- pWidthArray->AddInteger(7716);
- _InsertWidthArray1(pFont, pEncoding, 0x20, 0x20, pWidthArray);
- pWidthArray->AddInteger(814);
- _InsertWidthArray1(pFont, pEncoding, 0x21, 0x7e, pWidthArray);
- break;
- case FXFONT_HANGEUL_CHARSET:
- cmap = bVert ? "KSCms-UHC-V" : "KSCms-UHC-H";
- ordering = "Korea1";
- supplement = 2;
- pWidthArray->AddInteger(1);
- _InsertWidthArray1(pFont, pEncoding, 0x20, 0x7e, pWidthArray);
- break;
- case FXFONT_SHIFTJIS_CHARSET:
- cmap = bVert ? "90ms-RKSJ-V" : "90ms-RKSJ-H";
- ordering = "Japan1";
- supplement = 5;
- pWidthArray->AddInteger(231);
- _InsertWidthArray1(pFont, pEncoding, 0x20, 0x7d, pWidthArray);
- pWidthArray->AddInteger(326);
- _InsertWidthArray1(pFont, pEncoding, 0xa0, 0xa0, pWidthArray);
- pWidthArray->AddInteger(327);
- _InsertWidthArray1(pFont, pEncoding, 0xa1, 0xdf, pWidthArray);
- pWidthArray->AddInteger(631);
- _InsertWidthArray1(pFont, pEncoding, 0x7e, 0x7e, pWidthArray);
- break;
- }
- pBaseDict->SetAtName("Subtype", "Type0");
- pBaseDict->SetAtName("BaseFont", basefont);
- pBaseDict->SetAtName("Encoding", cmap);
- pFontDict->SetAt("W", pWidthArray);
- pFontDict->SetAtName("Type", "Font");
- pFontDict->SetAtName("Subtype", "CIDFontType2");
- pFontDict->SetAtName("BaseFont", basefont);
- CPDF_Dictionary* pCIDSysInfo = FX_NEW CPDF_Dictionary;
- pCIDSysInfo->SetAtString("Registry", "Adobe");
- pCIDSysInfo->SetAtString("Ordering", ordering);
- pCIDSysInfo->SetAtInteger("Supplement", supplement);
- pFontDict->SetAt("CIDSystemInfo", pCIDSysInfo);
- CPDF_Array* pArray = FX_NEW CPDF_Array;
- pBaseDict->SetAt("DescendantFonts", pArray);
- AddIndirectObject(pFontDict);
- pArray->AddReference(this, pFontDict);
- }
- AddIndirectObject(pBaseDict);
- CPDF_Dictionary* pFontDesc = FX_NEW CPDF_Dictionary;
- pFontDesc->SetAtName("Type", "FontDescriptor");
- pFontDesc->SetAtName("FontName", basefont);
- pFontDesc->SetAtInteger("Flags", flags);
- pFontDesc->SetAtInteger("ItalicAngle", pFont->m_pSubstFont ? pFont->m_pSubstFont->m_ItalicAngle : 0);
- pFontDesc->SetAtInteger("Ascent", pFont->GetAscent());
- pFontDesc->SetAtInteger("Descent", pFont->GetDescent());
- FX_RECT bbox;
- pFont->GetBBox(bbox);
- CPDF_Array* pBBox = FX_NEW CPDF_Array;
- pBBox->AddInteger(bbox.left);
- pBBox->AddInteger(bbox.bottom);
- pBBox->AddInteger(bbox.right);
- pBBox->AddInteger(bbox.top);
- pFontDesc->SetAt("FontBBox", pBBox);
- FX_INT32 nStemV = 0;
- if (pFont->m_pSubstFont) {
- nStemV = pFont->m_pSubstFont->m_Weight / 5;
- } else {
- static const FX_CHAR stem_chars[] = {'i', 'I', '!', '1'};
- const size_t count = sizeof(stem_chars) / sizeof(stem_chars[0]);
- FX_DWORD glyph = pEncoding->GlyphFromCharCode(stem_chars[0]);
- nStemV = pFont->GetGlyphWidth(glyph);
- for (size_t i = 1; i < count; i++) {
- glyph = pEncoding->GlyphFromCharCode(stem_chars[i]);
- int width = pFont->GetGlyphWidth(glyph);
- if (width > 0 && width < nStemV) {
- nStemV = width;
- }
- }
- }
- if (pEncoding) {
- delete pEncoding;
- }
- pFontDesc->SetAtInteger("StemV", nStemV);
- AddIndirectObject(pFontDesc);
- pFontDict->SetAtReference("FontDescriptor", this, pFontDesc);
- return LoadFont(pBaseDict);
-}
-static CPDF_Stream* GetFormStream(CPDF_Document* pDoc, CPDF_Object* pResObj)
-{
- if (pResObj->GetType() != PDFOBJ_REFERENCE) {
- return NULL;
- }
- CPDF_Reference* pRef = (CPDF_Reference*)pResObj;
- FX_BOOL bForm;
- if (pDoc->IsFormStream(pRef->GetRefObjNum(), bForm) && !bForm) {
- return NULL;
- }
- pResObj = pRef->GetDirect();
- if (pResObj->GetType() != PDFOBJ_STREAM) {
- return NULL;
- }
- CPDF_Stream* pXObject = (CPDF_Stream*)pResObj;
- if (pXObject->GetDict()->GetString(FX_BSTRC("Subtype")) != FX_BSTRC("Form")) {
- return NULL;
- }
- return pXObject;
-}
-static int InsertDeletePDFPage(CPDF_Document* pDoc, CPDF_Dictionary* pPages,
- int nPagesToGo, CPDF_Dictionary* pPage, FX_BOOL bInsert, CFX_PtrArray& stackList)
-{
- CPDF_Array* pKidList = pPages->GetArray("Kids");
- if (!pKidList) {
- return -1;
- }
- int nKids = pKidList->GetCount();
- for (int i = 0; i < nKids; i ++) {
- CPDF_Dictionary* pKid = pKidList->GetDict(i);
- if (pKid->GetString("Type") == FX_BSTRC("Page")) {
- if (nPagesToGo == 0) {
- if (bInsert) {
- pKidList->InsertAt(i, CPDF_Reference::Create(pDoc, pPage->GetObjNum()));
- pPage->SetAtReference("Parent", pDoc, pPages->GetObjNum());
- } else {
- pKidList->RemoveAt(i);
- }
- pPages->SetAtInteger("Count", pPages->GetInteger("Count") + (bInsert ? 1 : -1));
- return 1;
- }
- nPagesToGo --;
- } else {
- int nPages = pKid->GetInteger("Count");
- if (nPagesToGo < nPages) {
- int stackCount = stackList.GetSize();
- for (int j = 0; j < stackCount; ++j) {
- if (pKid == stackList[j]) {
- return -1;
- }
- }
- stackList.Add(pKid);
- if (InsertDeletePDFPage(pDoc, pKid, nPagesToGo, pPage, bInsert, stackList) < 0) {
- return -1;
- }
- stackList.RemoveAt(stackCount);
- pPages->SetAtInteger("Count", pPages->GetInteger("Count") + (bInsert ? 1 : -1));
- return 1;
- }
- nPagesToGo -= nPages;
- }
- }
- return 0;
-}
-static int InsertNewPage(CPDF_Document* pDoc, int iPage, CPDF_Dictionary* pPageDict, CFX_DWordArray &pageList)
-{
- CPDF_Dictionary* pRoot = pDoc->GetRoot();
- if (!pRoot) {
- return -1;
- }
- CPDF_Dictionary* pPages = pRoot->GetDict(FX_BSTRC("Pages"));
- if (!pPages) {
- return -1;
- }
- int nPages = pDoc->GetPageCount();
- if (iPage < 0 || iPage > nPages) {
- return -1;
- }
- if (iPage == nPages) {
- CPDF_Array* pPagesList = pPages->GetArray(FX_BSTRC("Kids"));
- if (!pPagesList) {
- pPagesList = FX_NEW CPDF_Array;
- pPages->SetAt(FX_BSTRC("Kids"), pPagesList);
- }
- pPagesList->Add(pPageDict, pDoc);
- pPages->SetAtInteger(FX_BSTRC("Count"), nPages + 1);
- pPageDict->SetAtReference(FX_BSTRC("Parent"), pDoc, pPages->GetObjNum());
- } else {
- CFX_PtrArray stack;
- stack.Add(pPages);
- if (InsertDeletePDFPage(pDoc, pPages, iPage, pPageDict, TRUE, stack) < 0) {
- return -1;
- }
- }
- pageList.InsertAt(iPage, pPageDict->GetObjNum());
- return iPage;
-}
-CPDF_Dictionary* CPDF_Document::CreateNewPage(int iPage)
-{
- CPDF_Dictionary* pDict = FX_NEW CPDF_Dictionary;
- pDict->SetAtName("Type", "Page");
- FX_DWORD dwObjNum = AddIndirectObject(pDict);
- if (InsertNewPage(this, iPage, pDict, m_PageList) < 0) {
- ReleaseIndirectObject(dwObjNum);
- return NULL;
- }
- return pDict;
-}
-int _PDF_GetStandardFontName(CFX_ByteString& name);
-CPDF_Font* CPDF_Document::AddStandardFont(FX_LPCSTR font, CPDF_FontEncoding* pEncoding)
-{
- CFX_ByteString name(font, -1);
- if (_PDF_GetStandardFontName(name) < 0) {
- return NULL;
- }
- return GetPageData()->GetStandardFont(name, pEncoding);
-}
-void CPDF_Document::DeletePage(int iPage)
-{
- CPDF_Dictionary* pRoot = GetRoot();
- if (pRoot == NULL) {
- return;
- }
- CPDF_Dictionary* pPages = pRoot->GetDict("Pages");
- if (pPages == NULL) {
- return;
- }
- int nPages = pPages->GetInteger("Count");
- if (iPage < 0 || iPage >= nPages) {
- return;
- }
- CFX_PtrArray stack;
- stack.Add(pPages);
- if (InsertDeletePDFPage(this, pPages, iPage, NULL, FALSE, stack) < 0) {
- return;
- }
- m_PageList.RemoveAt(iPage);
-}
-CPDF_Object* FPDFAPI_GetPageAttr(CPDF_Dictionary* pPageDict, FX_BSTR name);
-void FPDFAPI_FlatPageAttr(CPDF_Dictionary* pPageDict, FX_BSTR name)
-{
- if (pPageDict->KeyExist(name)) {
- return;
- }
- CPDF_Object* pObj = FPDFAPI_GetPageAttr(pPageDict, name);
- if (pObj) {
- pPageDict->SetAt(name, pObj->Clone());
- }
-}
+// 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
+
+#include "../../../include/fpdfapi/fpdf_page.h"
+#include "../../../include/fpdfapi/fpdf_module.h"
+#include "../fpdf_page/pageint.h"
+#include <limits.h>
+CPDF_Document::CPDF_Document() : CPDF_IndirectObjects(NULL)
+{
+ m_pRootDict = NULL;
+ m_pInfoDict = NULL;
+ m_bLinearized = FALSE;
+ m_dwFirstPageNo = 0;
+ m_dwFirstPageObjNum = 0;
+ m_pDocPage = CPDF_ModuleMgr::Get()->GetPageModule()->CreateDocData(this);
+ m_pDocRender = CPDF_ModuleMgr::Get()->GetRenderModule()->CreateDocData(this);
+}
+void CPDF_Document::CreateNewDoc()
+{
+ ASSERT(m_pRootDict == NULL && m_pInfoDict == NULL);
+ m_pRootDict = FX_NEW CPDF_Dictionary;
+ m_pRootDict->SetAtName("Type", "Catalog");
+ int objnum = AddIndirectObject(m_pRootDict);
+ CPDF_Dictionary* pPages = FX_NEW CPDF_Dictionary;
+ pPages->SetAtName("Type", "Pages");
+ pPages->SetAtNumber("Count", 0);
+ pPages->SetAt("Kids", FX_NEW CPDF_Array);
+ objnum = AddIndirectObject(pPages);
+ m_pRootDict->SetAtReference("Pages", this, objnum);
+ m_pInfoDict = FX_NEW CPDF_Dictionary;
+ AddIndirectObject(m_pInfoDict);
+}
+static const FX_WCHAR g_FX_CP874Unicodes[128] = {
+ 0x20AC, 0x0000, 0x0000, 0x0000, 0x0000, 0x2026, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x00A0, 0x0E01, 0x0E02, 0x0E03, 0x0E04, 0x0E05, 0x0E06, 0x0E07,
+ 0x0E08, 0x0E09, 0x0E0A, 0x0E0B, 0x0E0C, 0x0E0D, 0x0E0E, 0x0E0F,
+ 0x0E10, 0x0E11, 0x0E12, 0x0E13, 0x0E14, 0x0E15, 0x0E16, 0x0E17,
+ 0x0E18, 0x0E19, 0x0E1A, 0x0E1B, 0x0E1C, 0x0E1D, 0x0E1E, 0x0E1F,
+ 0x0E20, 0x0E21, 0x0E22, 0x0E23, 0x0E24, 0x0E25, 0x0E26, 0x0E27,
+ 0x0E28, 0x0E29, 0x0E2A, 0x0E2B, 0x0E2C, 0x0E2D, 0x0E2E, 0x0E2F,
+ 0x0E30, 0x0E31, 0x0E32, 0x0E33, 0x0E34, 0x0E35, 0x0E36, 0x0E37,
+ 0x0E38, 0x0E39, 0x0E3A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0E3F,
+ 0x0E40, 0x0E41, 0x0E42, 0x0E43, 0x0E44, 0x0E45, 0x0E46, 0x0E47,
+ 0x0E48, 0x0E49, 0x0E4A, 0x0E4B, 0x0E4C, 0x0E4D, 0x0E4E, 0x0E4F,
+ 0x0E50, 0x0E51, 0x0E52, 0x0E53, 0x0E54, 0x0E55, 0x0E56, 0x0E57,
+ 0x0E58, 0x0E59, 0x0E5A, 0x0E5B, 0x0000, 0x0000, 0x0000, 0x0000,
+};
+static const FX_WCHAR g_FX_CP1250Unicodes[128] = {
+ 0x20AC, 0x0000, 0x201A, 0x0000, 0x201E, 0x2026, 0x2020, 0x2021,
+ 0x0000, 0x2030, 0x0160, 0x2039, 0x015A, 0x0164, 0x017D, 0x0179,
+ 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
+ 0x0000, 0x2122, 0x0161, 0x203A, 0x015B, 0x0165, 0x017E, 0x017A,
+ 0x00A0, 0x02C7, 0x02D8, 0x0141, 0x00A4, 0x0104, 0x00A6, 0x00A7,
+ 0x00A8, 0x00A9, 0x015E, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x017B,
+ 0x00B0, 0x00B1, 0x02DB, 0x0142, 0x00B4, 0x00B5, 0x00B6, 0x00B7,
+ 0x00B8, 0x0105, 0x015F, 0x00BB, 0x013D, 0x02DD, 0x013E, 0x017C,
+ 0x0154, 0x00C1, 0x00C2, 0x0102, 0x00C4, 0x0139, 0x0106, 0x00C7,
+ 0x010C, 0x00C9, 0x0118, 0x00CB, 0x011A, 0x00CD, 0x00CE, 0x010E,
+ 0x0110, 0x0143, 0x0147, 0x00D3, 0x00D4, 0x0150, 0x00D6, 0x00D7,
+ 0x0158, 0x016E, 0x00DA, 0x0170, 0x00DC, 0x00DD, 0x0162, 0x00DF,
+ 0x0155, 0x00E1, 0x00E2, 0x0103, 0x00E4, 0x013A, 0x0107, 0x00E7,
+ 0x010D, 0x00E9, 0x0119, 0x00EB, 0x011B, 0x00ED, 0x00EE, 0x010F,
+ 0x0111, 0x0144, 0x0148, 0x00F3, 0x00F4, 0x0151, 0x00F6, 0x00F7,
+ 0x0159, 0x016F, 0x00FA, 0x0171, 0x00FC, 0x00FD, 0x0163, 0x02D9,
+};
+static const FX_WCHAR g_FX_CP1251Unicodes[128] = {
+ 0x0402, 0x0403, 0x201A, 0x0453, 0x201E, 0x2026, 0x2020, 0x2021,
+ 0x20AC, 0x2030, 0x0409, 0x2039, 0x040A, 0x040C, 0x040B, 0x040F,
+ 0x0452, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
+ 0x0000, 0x2122, 0x0459, 0x203A, 0x045A, 0x045C, 0x045B, 0x045F,
+ 0x00A0, 0x040E, 0x045E, 0x0408, 0x00A4, 0x0490, 0x00A6, 0x00A7,
+ 0x0401, 0x00A9, 0x0404, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x0407,
+ 0x00B0, 0x00B1, 0x0406, 0x0456, 0x0491, 0x00B5, 0x00B6, 0x00B7,
+ 0x0451, 0x2116, 0x0454, 0x00BB, 0x0458, 0x0405, 0x0455, 0x0457,
+ 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417,
+ 0x0418, 0x0419, 0x041A, 0x041B, 0x041C, 0x041D, 0x041E, 0x041F,
+ 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427,
+ 0x0428, 0x0429, 0x042A, 0x042B, 0x042C, 0x042D, 0x042E, 0x042F,
+ 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437,
+ 0x0438, 0x0439, 0x043A, 0x043B, 0x043C, 0x043D, 0x043E, 0x043F,
+ 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447,
+ 0x0448, 0x0449, 0x044A, 0x044B, 0x044C, 0x044D, 0x044E, 0x044F,
+};
+static const FX_WCHAR g_FX_CP1253Unicodes[128] = {
+ 0x20AC, 0x0000, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021,
+ 0x0000, 0x2030, 0x0000, 0x2039, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
+ 0x0000, 0x2122, 0x0000, 0x203A, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x00A0, 0x0385, 0x0386, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7,
+ 0x00A8, 0x00A9, 0x0000, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x2015,
+ 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x0384, 0x00B5, 0x00B6, 0x00B7,
+ 0x0388, 0x0389, 0x038A, 0x00BB, 0x038C, 0x00BD, 0x038E, 0x038F,
+ 0x0390, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397,
+ 0x0398, 0x0399, 0x039A, 0x039B, 0x039C, 0x039D, 0x039E, 0x039F,
+ 0x03A0, 0x03A1, 0x0000, 0x03A3, 0x03A4, 0x03A5, 0x03A6, 0x03A7,
+ 0x03A8, 0x03A9, 0x03AA, 0x03AB, 0x03AC, 0x03AD, 0x03AE, 0x03AF,
+ 0x03B0, 0x03B1, 0x03B2, 0x03B3, 0x03B4, 0x03B5, 0x03B6, 0x03B7,
+ 0x03B8, 0x03B9, 0x03BA, 0x03BB, 0x03BC, 0x03BD, 0x03BE, 0x03BF,
+ 0x03C0, 0x03C1, 0x03C2, 0x03C3, 0x03C4, 0x03C5, 0x03C6, 0x03C7,
+ 0x03C8, 0x03C9, 0x03CA, 0x03CB, 0x03CC, 0x03CD, 0x03CE, 0x0000,
+};
+static const FX_WCHAR g_FX_CP1254Unicodes[128] = {
+ 0x20AC, 0x0000, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021,
+ 0x02C6, 0x2030, 0x0160, 0x2039, 0x0152, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
+ 0x02DC, 0x2122, 0x0161, 0x203A, 0x0153, 0x0000, 0x0000, 0x0178,
+ 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7,
+ 0x00A8, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF,
+ 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7,
+ 0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF,
+ 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7,
+ 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF,
+ 0x011E, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7,
+ 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x0130, 0x015E, 0x00DF,
+ 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7,
+ 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF,
+ 0x011F, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7,
+ 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x0131, 0x015F, 0x00FF,
+};
+static const FX_WCHAR g_FX_CP1255Unicodes[128] = {
+ 0x20AC, 0x0000, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021,
+ 0x02C6, 0x2030, 0x0000, 0x2039, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
+ 0x02DC, 0x2122, 0x0000, 0x203A, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x20AA, 0x00A5, 0x00A6, 0x00A7,
+ 0x00A8, 0x00A9, 0x00D7, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF,
+ 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7,
+ 0x00B8, 0x00B9, 0x00F7, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF,
+ 0x05B0, 0x05B1, 0x05B2, 0x05B3, 0x05B4, 0x05B5, 0x05B6, 0x05B7,
+ 0x05B8, 0x05B9, 0x0000, 0x05BB, 0x05BC, 0x05BD, 0x05BE, 0x05BF,
+ 0x05C0, 0x05C1, 0x05C2, 0x05C3, 0x05F0, 0x05F1, 0x05F2, 0x05F3,
+ 0x05F4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x05D0, 0x05D1, 0x05D2, 0x05D3, 0x05D4, 0x05D5, 0x05D6, 0x05D7,
+ 0x05D8, 0x05D9, 0x05DA, 0x05DB, 0x05DC, 0x05DD, 0x05DE, 0x05DF,
+ 0x05E0, 0x05E1, 0x05E2, 0x05E3, 0x05E4, 0x05E5, 0x05E6, 0x05E7,
+ 0x05E8, 0x05E9, 0x05EA, 0x0000, 0x0000, 0x200E, 0x200F, 0x0000,
+};
+static const FX_WCHAR g_FX_CP1256Unicodes[128] = {
+ 0x20AC, 0x067E, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021,
+ 0x02C6, 0x2030, 0x0679, 0x2039, 0x0152, 0x0686, 0x0698, 0x0688,
+ 0x06AF, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
+ 0x06A9, 0x2122, 0x0691, 0x203A, 0x0153, 0x200C, 0x200D, 0x06BA,
+ 0x00A0, 0x060C, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7,
+ 0x00A8, 0x00A9, 0x06BE, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF,
+ 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7,
+ 0x00B8, 0x00B9, 0x061B, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x061F,
+ 0x06C1, 0x0621, 0x0622, 0x0623, 0x0624, 0x0625, 0x0626, 0x0627,
+ 0x0628, 0x0629, 0x062A, 0x062B, 0x062C, 0x062D, 0x062E, 0x062F,
+ 0x0630, 0x0631, 0x0632, 0x0633, 0x0634, 0x0635, 0x0636, 0x00D7,
+ 0x0637, 0x0638, 0x0639, 0x063A, 0x0640, 0x0641, 0x0642, 0x0643,
+ 0x00E0, 0x0644, 0x00E2, 0x0645, 0x0646, 0x0647, 0x0648, 0x00E7,
+ 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x0649, 0x064A, 0x00EE, 0x00EF,
+ 0x064B, 0x064C, 0x064D, 0x064E, 0x00F4, 0x064F, 0x0650, 0x00F7,
+ 0x0651, 0x00F9, 0x0652, 0x00FB, 0x00FC, 0x200E, 0x200F, 0x06D2,
+};
+static const FX_WCHAR g_FX_CP1257Unicodes[128] = {
+ 0x20AC, 0x0000, 0x201A, 0x0000, 0x201E, 0x2026, 0x2020, 0x2021,
+ 0x0000, 0x2030, 0x0000, 0x2039, 0x0000, 0x00A8, 0x02C7, 0x00B8,
+ 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
+ 0x0000, 0x2122, 0x0000, 0x203A, 0x0000, 0x00AF, 0x02DB, 0x0000,
+ 0x00A0, 0x0000, 0x00A2, 0x00A3, 0x00A4, 0x0000, 0x00A6, 0x00A7,
+ 0x00D8, 0x00A9, 0x0156, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00C6,
+ 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7,
+ 0x00F8, 0x00B9, 0x0157, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00E6,
+ 0x0104, 0x012E, 0x0100, 0x0106, 0x00C4, 0x00C5, 0x0118, 0x0112,
+ 0x010C, 0x00C9, 0x0179, 0x0116, 0x0122, 0x0136, 0x012A, 0x013B,
+ 0x0160, 0x0143, 0x0145, 0x00D3, 0x014C, 0x00D5, 0x00D6, 0x00D7,
+ 0x0172, 0x0141, 0x015A, 0x016A, 0x00DC, 0x017B, 0x017D, 0x00DF,
+ 0x0105, 0x012F, 0x0101, 0x0107, 0x00E4, 0x00E5, 0x0119, 0x0113,
+ 0x010D, 0x00E9, 0x017A, 0x0117, 0x0123, 0x0137, 0x012B, 0x013C,
+ 0x0161, 0x0144, 0x0146, 0x00F3, 0x014D, 0x00F5, 0x00F6, 0x00F7,
+ 0x0173, 0x0142, 0x015B, 0x016B, 0x00FC, 0x017C, 0x017E, 0x02D9,
+};
+typedef struct {
+ FX_BYTE m_Charset;
+ const FX_WCHAR* m_pUnicodes;
+} FX_CharsetUnicodes;
+const FX_CharsetUnicodes g_FX_CharsetUnicodes[] = {
+ { FXFONT_THAI_CHARSET, g_FX_CP874Unicodes },
+ { FXFONT_EASTEUROPE_CHARSET, g_FX_CP1250Unicodes },
+ { FXFONT_RUSSIAN_CHARSET, g_FX_CP1251Unicodes },
+ { FXFONT_GREEK_CHARSET, g_FX_CP1253Unicodes },
+ { FXFONT_TURKISH_CHARSET, g_FX_CP1254Unicodes },
+ { FXFONT_HEBREW_CHARSET, g_FX_CP1255Unicodes },
+ { FXFONT_ARABIC_CHARSET, g_FX_CP1256Unicodes },
+ { FXFONT_BALTIC_CHARSET, g_FX_CP1257Unicodes },
+};
+#if (_FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN32_MOBILE_ || _FX_OS_ == _FX_WIN64_)
+static void _InsertWidthArray(HDC hDC, int start, int end, CPDF_Array* pWidthArray)
+{
+ int size = end - start + 1;
+ int* widths = FX_Alloc(int, size);
+ GetCharWidth(hDC, start, end, widths);
+ int i;
+ for (i = 1; i < size; i ++)
+ if (widths[i] != *widths) {
+ break;
+ }
+ if (i == size) {
+ int first = pWidthArray->GetInteger(pWidthArray->GetCount() - 1);
+ pWidthArray->AddInteger(first + size - 1);
+ pWidthArray->AddInteger(*widths);
+ } else {
+ CPDF_Array* pWidthArray1 = FX_NEW CPDF_Array;
+ pWidthArray->Add(pWidthArray1);
+ for (i = 0; i < size; i ++) {
+ pWidthArray1->AddInteger(widths[i]);
+ }
+ }
+ FX_Free(widths);
+}
+CPDF_Font* CPDF_Document::AddWindowsFont(LOGFONTW* pLogFont, FX_BOOL bVert, FX_BOOL bTranslateName)
+{
+ LOGFONTA lfa;
+ FXSYS_memcpy32(&lfa, pLogFont, (char*)lfa.lfFaceName - (char*)&lfa);
+ CFX_ByteString face = CFX_ByteString::FromUnicode(pLogFont->lfFaceName);
+ if (face.GetLength() >= LF_FACESIZE) {
+ return NULL;
+ }
+ FXSYS_strcpy(lfa.lfFaceName, (FX_LPCSTR)face);
+ return AddWindowsFont(&lfa, bVert, bTranslateName);
+}
+extern CFX_ByteString _FPDF_GetNameFromTT(FX_LPCBYTE name_table, FX_DWORD name);
+CFX_ByteString _FPDF_GetPSNameFromTT(HDC hDC)
+{
+ CFX_ByteString result;
+ DWORD size = ::GetFontData(hDC, 'eman', 0, NULL, 0);
+ if (size != GDI_ERROR) {
+ LPBYTE buffer = FX_Alloc(BYTE, size);
+ ::GetFontData(hDC, 'eman', 0, buffer, size);
+ result = _FPDF_GetNameFromTT(buffer, 6);
+ FX_Free(buffer);
+ }
+ return result;
+}
+CPDF_Font* CPDF_Document::AddWindowsFont(LOGFONTA* pLogFont, FX_BOOL bVert, FX_BOOL bTranslateName)
+{
+ pLogFont->lfHeight = -1000;
+ pLogFont->lfWidth = 0;
+ HGDIOBJ hFont = CreateFontIndirectA(pLogFont);
+ HDC hDC = CreateCompatibleDC(NULL);
+ hFont = SelectObject(hDC, hFont);
+ int tm_size = GetOutlineTextMetrics(hDC, 0, NULL);
+ if (tm_size == 0) {
+ hFont = SelectObject(hDC, hFont);
+ DeleteObject(hFont);
+ DeleteDC(hDC);
+ return NULL;
+ }
+ LPBYTE tm_buf = FX_Alloc(BYTE, tm_size);
+ OUTLINETEXTMETRIC* ptm = (OUTLINETEXTMETRIC*)tm_buf;
+ GetOutlineTextMetrics(hDC, tm_size, ptm);
+ int flags = 0, italicangle, ascend, descend, capheight, bbox[4];
+ if (pLogFont->lfItalic) {
+ flags |= PDFFONT_ITALIC;
+ }
+ if ((pLogFont->lfPitchAndFamily & 3) == FIXED_PITCH) {
+ flags |= PDFFONT_FIXEDPITCH;
+ }
+ if ((pLogFont->lfPitchAndFamily & 0xf8) == FF_ROMAN) {
+ flags |= PDFFONT_SERIF;
+ }
+ if ((pLogFont->lfPitchAndFamily & 0xf8) == FF_SCRIPT) {
+ flags |= PDFFONT_SCRIPT;
+ }
+ FX_BOOL bCJK = pLogFont->lfCharSet == CHINESEBIG5_CHARSET || pLogFont->lfCharSet == GB2312_CHARSET ||
+ pLogFont->lfCharSet == HANGEUL_CHARSET || pLogFont->lfCharSet == SHIFTJIS_CHARSET;
+ CFX_ByteString basefont;
+ if (bTranslateName && bCJK) {
+ basefont = _FPDF_GetPSNameFromTT(hDC);
+ }
+ if (basefont.IsEmpty()) {
+ basefont = pLogFont->lfFaceName;
+ }
+ italicangle = ptm->otmItalicAngle / 10;
+ ascend = ptm->otmrcFontBox.top;
+ descend = ptm->otmrcFontBox.bottom;
+ capheight = ptm->otmsCapEmHeight;
+ bbox[0] = ptm->otmrcFontBox.left;
+ bbox[1] = ptm->otmrcFontBox.bottom;
+ bbox[2] = ptm->otmrcFontBox.right;
+ bbox[3] = ptm->otmrcFontBox.top;
+ FX_Free(tm_buf);
+ basefont.Replace(" ", "");
+ CPDF_Dictionary* pBaseDict = FX_NEW CPDF_Dictionary;
+ pBaseDict->SetAtName("Type", "Font");
+ CPDF_Dictionary* pFontDict = pBaseDict;
+ if (!bCJK) {
+ if (pLogFont->lfCharSet == ANSI_CHARSET || pLogFont->lfCharSet == DEFAULT_CHARSET ||
+ pLogFont->lfCharSet == SYMBOL_CHARSET) {
+ if (pLogFont->lfCharSet == SYMBOL_CHARSET) {
+ flags |= PDFFONT_SYMBOLIC;
+ } else {
+ flags |= PDFFONT_NONSYMBOLIC;
+ }
+ pBaseDict->SetAtName(FX_BSTRC("Encoding"), "WinAnsiEncoding");
+ } else {
+ flags |= PDFFONT_NONSYMBOLIC;
+ int i;
+ for (i = 0; i < sizeof g_FX_CharsetUnicodes / sizeof(FX_CharsetUnicodes); i ++)
+ if (g_FX_CharsetUnicodes[i].m_Charset == pLogFont->lfCharSet) {
+ break;
+ }
+ if (i < sizeof g_FX_CharsetUnicodes / sizeof(FX_CharsetUnicodes)) {
+ CPDF_Dictionary* pEncoding = FX_NEW CPDF_Dictionary;
+ pEncoding->SetAtName(FX_BSTRC("BaseEncoding"), "WinAnsiEncoding");
+ CPDF_Array* pArray = FX_NEW CPDF_Array;
+ pArray->AddInteger(128);
+ const FX_WCHAR* pUnicodes = g_FX_CharsetUnicodes[i].m_pUnicodes;
+ for (int j = 0; j < 128; j ++) {
+ CFX_ByteString name = PDF_AdobeNameFromUnicode(pUnicodes[j]);
+ if (name.IsEmpty()) {
+ pArray->AddName(FX_BSTRC(".notdef"));
+ } else {
+ pArray->AddName(name);
+ }
+ }
+ pEncoding->SetAt(FX_BSTRC("Differences"), pArray);
+ AddIndirectObject(pEncoding);
+ pBaseDict->SetAtReference(FX_BSTRC("Encoding"), this, pEncoding);
+ }
+ }
+ if (pLogFont->lfWeight > FW_MEDIUM && pLogFont->lfItalic) {
+ basefont += ",BoldItalic";
+ } else if (pLogFont->lfWeight > FW_MEDIUM) {
+ basefont += ",Bold";
+ } else if (pLogFont->lfItalic) {
+ basefont += ",Italic";
+ }
+ pBaseDict->SetAtName("Subtype", "TrueType");
+ pBaseDict->SetAtName("BaseFont", basefont);
+ pBaseDict->SetAtNumber("FirstChar", 32);
+ pBaseDict->SetAtNumber("LastChar", 255);
+ int char_widths[224];
+ GetCharWidth(hDC, 32, 255, char_widths);
+ CPDF_Array* pWidths = FX_NEW CPDF_Array;
+ for (int i = 0; i < 224; i ++) {
+ pWidths->AddInteger(char_widths[i]);
+ }
+ pBaseDict->SetAt("Widths", pWidths);
+ } else {
+ flags |= PDFFONT_NONSYMBOLIC;
+ pFontDict = FX_NEW CPDF_Dictionary;
+ CFX_ByteString cmap;
+ CFX_ByteString ordering;
+ int supplement;
+ CPDF_Array* pWidthArray = FX_NEW CPDF_Array;
+ switch (pLogFont->lfCharSet) {
+ case CHINESEBIG5_CHARSET:
+ cmap = bVert ? "ETenms-B5-V" : "ETenms-B5-H";
+ ordering = "CNS1";
+ supplement = 4;
+ pWidthArray->AddInteger(1);
+ _InsertWidthArray(hDC, 0x20, 0x7e, pWidthArray);
+ break;
+ case GB2312_CHARSET:
+ cmap = bVert ? "GBK-EUC-V" : "GBK-EUC-H";
+ ordering = "GB1", supplement = 2;
+ pWidthArray->AddInteger(7716);
+ _InsertWidthArray(hDC, 0x20, 0x20, pWidthArray);
+ pWidthArray->AddInteger(814);
+ _InsertWidthArray(hDC, 0x21, 0x7e, pWidthArray);
+ break;
+ case HANGEUL_CHARSET:
+ cmap = bVert ? "KSCms-UHC-V" : "KSCms-UHC-H";
+ ordering = "Korea1";
+ supplement = 2;
+ pWidthArray->AddInteger(1);
+ _InsertWidthArray(hDC, 0x20, 0x7e, pWidthArray);
+ break;
+ case SHIFTJIS_CHARSET:
+ cmap = bVert ? "90ms-RKSJ-V" : "90ms-RKSJ-H";
+ ordering = "Japan1";
+ supplement = 5;
+ pWidthArray->AddInteger(231);
+ _InsertWidthArray(hDC, 0x20, 0x7d, pWidthArray);
+ pWidthArray->AddInteger(326);
+ _InsertWidthArray(hDC, 0xa0, 0xa0, pWidthArray);
+ pWidthArray->AddInteger(327);
+ _InsertWidthArray(hDC, 0xa1, 0xdf, pWidthArray);
+ pWidthArray->AddInteger(631);
+ _InsertWidthArray(hDC, 0x7e, 0x7e, pWidthArray);
+ break;
+ }
+ pBaseDict->SetAtName("Subtype", "Type0");
+ pBaseDict->SetAtName("BaseFont", basefont);
+ pBaseDict->SetAtName("Encoding", cmap);
+ pFontDict->SetAt("W", pWidthArray);
+ pFontDict->SetAtName("Type", "Font");
+ pFontDict->SetAtName("Subtype", "CIDFontType2");
+ pFontDict->SetAtName("BaseFont", basefont);
+ CPDF_Dictionary* pCIDSysInfo = FX_NEW CPDF_Dictionary;
+ pCIDSysInfo->SetAtString("Registry", "Adobe");
+ pCIDSysInfo->SetAtString("Ordering", ordering);
+ pCIDSysInfo->SetAtInteger("Supplement", supplement);
+ pFontDict->SetAt("CIDSystemInfo", pCIDSysInfo);
+ CPDF_Array* pArray = FX_NEW CPDF_Array;
+ pBaseDict->SetAt("DescendantFonts", pArray);
+ AddIndirectObject(pFontDict);
+ pArray->AddReference(this, pFontDict);
+ }
+ AddIndirectObject(pBaseDict);
+ CPDF_Dictionary* pFontDesc = FX_NEW CPDF_Dictionary;
+ pFontDesc->SetAtName("Type", "FontDescriptor");
+ pFontDesc->SetAtName("FontName", basefont);
+ pFontDesc->SetAtInteger("Flags", flags);
+ CPDF_Array* pBBox = FX_NEW CPDF_Array;
+ for (int i = 0; i < 4; i ++) {
+ pBBox->AddInteger(bbox[i]);
+ }
+ pFontDesc->SetAt("FontBBox", pBBox);
+ pFontDesc->SetAtInteger("ItalicAngle", italicangle);
+ pFontDesc->SetAtInteger("Ascent", ascend);
+ pFontDesc->SetAtInteger("Descent", descend);
+ pFontDesc->SetAtInteger("CapHeight", capheight);
+ pFontDesc->SetAtInteger("StemV", pLogFont->lfWeight / 5);
+ AddIndirectObject(pFontDesc);
+ pFontDict->SetAtReference("FontDescriptor", this, pFontDesc);
+ hFont = SelectObject(hDC, hFont);
+ DeleteObject(hFont);
+ DeleteDC(hDC);
+ return LoadFont(pBaseDict);
+}
+#endif
+#if (_FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_)
+FX_UINT32 FX_GetLangHashCode( FX_LPCSTR pStr)
+{
+ FXSYS_assert( pStr != NULL);
+ FX_INT32 iLength = FXSYS_strlen(pStr);
+ FX_LPCSTR pStrEnd = pStr + iLength;
+ FX_UINT32 uHashCode = 0;
+ while ( pStr < pStrEnd) {
+ uHashCode = 31 * uHashCode + tolower(*pStr++);
+ }
+ return uHashCode;
+}
+struct FX_LANG2CS {
+ FX_DWORD uLang;
+ int uCharset;
+}*FX_LPLANG2CS;
+static const FX_LANG2CS gs_FXLang2CharsetTable[] = {
+ {3109, 0},
+ {3121, 178},
+ {3129, 162},
+ {3139, 204},
+ {3141, 204},
+ {3166, 0},
+ {3184, 238},
+ {3197, 0},
+ {3201, 0},
+ {3239, 161},
+ {3241, 0},
+ {3246, 0},
+ {3247, 186},
+ {3248, 0},
+ {3259, 178},
+ {3267, 0},
+ {3273, 0},
+ {3276, 0},
+ {3301, 0},
+ {3310, 1},
+ {3325, 177},
+ {3329, 1},
+ {3338, 238},
+ {3341, 238},
+ {3345, 1},
+ {3355, 0},
+ {3370, 0},
+ {3371, 0},
+ {3383, 128},
+ {3424, 204},
+ {3427, 1},
+ {3428, 129},
+ {3436, 178},
+ {3464, 186},
+ {3466, 186},
+ {3486, 204},
+ {3487, 0},
+ {3493, 1},
+ {3494, 0},
+ {3508, 0},
+ {3518, 0},
+ {3520, 0},
+ {3569, 1},
+ {3580, 238},
+ {3588, 0},
+ {3645, 238},
+ {3651, 204},
+ {3672, 238},
+ {3673, 238},
+ {3678, 238},
+ {3679, 238},
+ {3683, 0},
+ {3684, 0},
+ {3693, 1},
+ {3697, 1},
+ {3700, 222},
+ {3710, 162},
+ {3734, 204},
+ {3741, 178},
+ {3749, 162},
+ {3763, 163},
+ {3886, 134},
+ {105943, 0},
+ {106375, 1},
+ {3923451837, 134},
+ {3923451838, 136},
+};
+static FX_WORD FX_GetCsFromLangCode(FX_UINT32 uCode)
+{
+ FX_INT32 iStart = 0;
+ FX_INT32 iEnd = sizeof(gs_FXLang2CharsetTable) / sizeof(FX_LANG2CS) - 1;
+ while (iStart <= iEnd) {
+ FX_INT32 iMid = (iStart + iEnd) / 2;
+ const FX_LANG2CS &charset = gs_FXLang2CharsetTable[iMid];
+ if (uCode == charset.uLang) {
+ return charset.uCharset;
+ } else if (uCode < charset.uLang) {
+ iEnd = iMid - 1;
+ } else {
+ iStart = iMid + 1;
+ }
+ };
+ return 0;
+}
+static FX_WORD FX_GetCharsetFromLang(FX_LPCSTR pLang, FX_INT32 iLength)
+{
+ FXSYS_assert(pLang);
+ if (iLength < 0) {
+ iLength = FXSYS_strlen(pLang);
+ }
+ FX_UINT32 uHash = FX_GetLangHashCode(pLang);
+ return FX_GetCsFromLangCode(uHash);
+}
+static void _CFString2CFXByteString(CFStringRef src, CFX_ByteString &dest)
+{
+ SInt32 len = CFStringGetLength(src);
+ CFRange range = CFRangeMake(0, len);
+ CFIndex used = 0;
+ UInt8* pBuffer = (UInt8*)malloc(sizeof(UInt8) * (len + 1));
+ FXSYS_memset32(pBuffer, 0, sizeof(UInt8) * (len + 1));
+ CFStringGetBytes(src, range, kCFStringEncodingASCII, 0, false, pBuffer, len, &used);
+ dest = (FX_LPSTR)pBuffer;
+ free(pBuffer);
+}
+FX_BOOL IsHasCharSet(CFArrayRef languages, const CFX_DWordArray &charSets)
+{
+ int iCount = charSets.GetSize();
+ for (int i = 0; i < CFArrayGetCount(languages); ++i) {
+ CFStringRef language = (CFStringRef)CFArrayGetValueAtIndex(languages, i);
+ FX_DWORD CharSet = FX_GetCharsetFromLang(CFStringGetCStringPtr(language, kCFStringEncodingMacRoman), -1);
+ for (int j = 0; j < iCount; ++j) {
+ if (CharSet == charSets[j]) {
+ return TRUE;
+ }
+ }
+ }
+ return FALSE;
+}
+void FX_GetCharWidth(CTFontRef font, UniChar start, UniChar end, int* width)
+{
+ CGFloat size = CTFontGetSize(font);
+ for (; start <= end; ++start) {
+ CGGlyph pGlyph = 0;
+ CFIndex count = 1;
+ CTFontGetGlyphsForCharacters(font, &start, &pGlyph, count);
+ CGSize advances;
+ CTFontGetAdvancesForGlyphs(font, kCTFontDefaultOrientation, &pGlyph, &advances, 1);
+ *width = (int)(advances.width / size * 1000) ;
+ width++;
+ }
+}
+static void _InsertWidthArray(CTFontRef font, int start, int end, CPDF_Array* pWidthArray)
+{
+ int size = end - start + 1;
+ int* widths = FX_Alloc(int, size);
+ FX_GetCharWidth(font, start, end, widths);
+ int i;
+ for (i = 1; i < size; i ++)
+ if (widths[i] != *widths) {
+ break;
+ }
+ if (i == size) {
+ int first = pWidthArray->GetInteger(pWidthArray->GetCount() - 1);
+ pWidthArray->AddInteger(first + size - 1);
+ pWidthArray->AddInteger(*widths);
+ } else {
+ CPDF_Array* pWidthArray1 = FX_NEW CPDF_Array;
+ pWidthArray->Add(pWidthArray1);
+ for (i = 0; i < size; i ++) {
+ pWidthArray1->AddInteger(widths[i]);
+ }
+ }
+ FX_Free(widths);
+}
+CPDF_Font* CPDF_Document::AddMacFont(CTFontRef pFont, FX_BOOL bVert, FX_BOOL bTranslateName)
+{
+ CTFontRef font = (CTFontRef)pFont;
+ CTFontDescriptorRef descriptor = CTFontCopyFontDescriptor(font);
+ if (descriptor == NULL) {
+ return NULL;
+ }
+ CFX_ByteString basefont;
+ FX_BOOL bCJK = FALSE;
+ int flags = 0, italicangle = 0, ascend = 0, descend = 0, capheight = 0, bbox[4];
+ FXSYS_memset32(bbox, 0, sizeof(int) * 4);
+ CFArrayRef languages = (CFArrayRef)CTFontDescriptorCopyAttribute(descriptor, kCTFontLanguagesAttribute);
+ if (languages == NULL) {
+ CFRelease(descriptor);
+ return NULL;
+ }
+ CFX_DWordArray charSets;
+ charSets.Add(FXFONT_CHINESEBIG5_CHARSET);
+ charSets.Add(FXFONT_GB2312_CHARSET);
+ charSets.Add(FXFONT_HANGEUL_CHARSET);
+ charSets.Add(FXFONT_SHIFTJIS_CHARSET);
+ if (IsHasCharSet(languages, charSets)) {
+ bCJK = TRUE;
+ }
+ CFRelease(descriptor);
+ CFDictionaryRef traits = (CFDictionaryRef)CTFontCopyTraits(font);
+ if (traits == NULL) {
+ CFRelease(languages);
+ return NULL;
+ }
+ CFNumberRef sybolicTrait = (CFNumberRef)CFDictionaryGetValue(traits, kCTFontSymbolicTrait);
+ CTFontSymbolicTraits trait = 0;
+ CFNumberGetValue(sybolicTrait, kCFNumberSInt32Type, &trait);
+ if (trait & kCTFontItalicTrait) {
+ flags |= PDFFONT_ITALIC;
+ }
+ if (trait & kCTFontMonoSpaceTrait) {
+ flags |= PDFFONT_FIXEDPITCH;
+ }
+ if (trait & kCTFontModernSerifsClass) {
+ flags |= PDFFONT_SERIF;
+ }
+ if (trait & kCTFontScriptsClass) {
+ flags |= PDFFONT_SCRIPT;
+ }
+ CFNumberRef weightTrait = (CFNumberRef)CFDictionaryGetValue(traits, kCTFontWeightTrait);
+ Float32 weight = 0;
+ CFNumberGetValue(weightTrait, kCFNumberFloat32Type, &weight);
+ italicangle = CTFontGetSlantAngle(font);
+ ascend = CTFontGetAscent(font);
+ descend = CTFontGetDescent(font);
+ capheight = CTFontGetCapHeight(font);
+ CGRect box = CTFontGetBoundingBox(font);
+ bbox[0] = box.origin.x;
+ bbox[1] = box.origin.y;
+ bbox[2] = box.origin.x + box.size.width;
+ bbox[3] = box.origin.y + box.size.height;
+ if (bTranslateName && bCJK) {
+ CFStringRef postName = CTFontCopyPostScriptName(font);
+ _CFString2CFXByteString(postName, basefont);
+ CFRelease(postName);
+ }
+ if (basefont.IsEmpty()) {
+ CFStringRef fullName = CTFontCopyFullName(font);
+ _CFString2CFXByteString(fullName, basefont);
+ CFRelease(fullName);
+ }
+ basefont.Replace(" ", "");
+ CPDF_Dictionary* pFontDict = NULL;
+ CPDF_Dictionary* pBaseDict = FX_NEW CPDF_Dictionary;
+ pFontDict = pBaseDict;
+ if (!bCJK) {
+ charSets.RemoveAll();
+ charSets.Add(FXFONT_ANSI_CHARSET);
+ charSets.Add(FXFONT_DEFAULT_CHARSET);
+ charSets.Add(FXFONT_SYMBOL_CHARSET);
+ if (IsHasCharSet(languages, charSets)) {
+ charSets.RemoveAll();
+ charSets.Add(FXFONT_SYMBOL_CHARSET);
+ if (IsHasCharSet(languages, charSets)) {
+ flags |= PDFFONT_SYMBOLIC;
+ } else {
+ flags |= PDFFONT_NONSYMBOLIC;
+ }
+ pBaseDict->SetAtName(FX_BSTRC("Encoding"), "WinAnsiEncoding");
+ } else {
+ flags |= PDFFONT_NONSYMBOLIC;
+ int i;
+ for (i = 0; i < sizeof g_FX_CharsetUnicodes / sizeof(FX_CharsetUnicodes); i ++) {
+ charSets.RemoveAll();
+ charSets.Add(g_FX_CharsetUnicodes[i].m_Charset);
+ if (IsHasCharSet(languages, charSets)) {
+ break;
+ }
+ }
+ if (i < sizeof g_FX_CharsetUnicodes / sizeof(FX_CharsetUnicodes)) {
+ CPDF_Dictionary* pEncoding = FX_NEW CPDF_Dictionary;
+ pEncoding->SetAtName(FX_BSTRC("BaseEncoding"), "WinAnsiEncoding");
+ CPDF_Array* pArray = FX_NEW CPDF_Array;
+ pArray->AddInteger(128);
+ const FX_WCHAR* pUnicodes = g_FX_CharsetUnicodes[i].m_pUnicodes;
+ for (int j = 0; j < 128; j ++) {
+ CFX_ByteString name = PDF_AdobeNameFromUnicode(pUnicodes[j]);
+ if (name.IsEmpty()) {
+ pArray->AddName(FX_BSTRC(".notdef"));
+ } else {
+ pArray->AddName(name);
+ }
+ }
+ pEncoding->SetAt(FX_BSTRC("Differences"), pArray);
+ AddIndirectObject(pEncoding);
+ pBaseDict->SetAtReference(FX_BSTRC("Encoding"), this, pEncoding);
+ }
+ }
+ if (weight > 0.0 && trait & kCTFontItalicTrait) {
+ basefont += ",BoldItalic";
+ } else if (weight > 0.0) {
+ basefont += ",Bold";
+ } else if (trait & kCTFontItalicTrait) {
+ basefont += ",Italic";
+ }
+ pBaseDict->SetAtName("Subtype", "TrueType");
+ pBaseDict->SetAtName("BaseFont", basefont);
+ pBaseDict->SetAtNumber("FirstChar", 32);
+ pBaseDict->SetAtNumber("LastChar", 255);
+ int char_widths[224];
+ FX_GetCharWidth(font, 32, 255, char_widths);
+ CPDF_Array* pWidths = FX_NEW CPDF_Array;
+ for (int i = 0; i < 224; i ++) {
+ pWidths->AddInteger(char_widths[i]);
+ }
+ pBaseDict->SetAt("Widths", pWidths);
+ } else {
+ flags |= PDFFONT_NONSYMBOLIC;
+ CPDF_Array* pArray = NULL;
+ pFontDict = FX_NEW CPDF_Dictionary;
+ CFX_ByteString cmap;
+ CFX_ByteString ordering;
+ int supplement;
+ FX_BOOL bFound = FALSE;
+ CPDF_Array* pWidthArray = FX_NEW CPDF_Array;
+ charSets.RemoveAll();
+ charSets.Add(FXFONT_CHINESEBIG5_CHARSET);
+ if (IsHasCharSet(languages, charSets)) {
+ cmap = bVert ? "ETenms-B5-V" : "ETenms-B5-H";
+ ordering = "CNS1";
+ supplement = 4;
+ pWidthArray->AddInteger(1);
+ _InsertWidthArray(font, 0x20, 0x7e, pWidthArray);
+ bFound = TRUE;
+ }
+ charSets.RemoveAll();
+ charSets.Add(FXFONT_GB2312_CHARSET);
+ if (!bFound && IsHasCharSet(languages, charSets)) {
+ cmap = bVert ? "GBK-EUC-V" : "GBK-EUC-H";
+ ordering = "GB1", supplement = 2;
+ pWidthArray->AddInteger(7716);
+ _InsertWidthArray(font, 0x20, 0x20, pWidthArray);
+ pWidthArray->AddInteger(814);
+ _InsertWidthArray(font, 0x21, 0x7e, pWidthArray);
+ bFound = TRUE;
+ }
+ charSets.RemoveAll();
+ charSets.Add(FXFONT_HANGEUL_CHARSET);
+ if (!bFound && IsHasCharSet(languages, charSets)) {
+ cmap = bVert ? "KSCms-UHC-V" : "KSCms-UHC-H";
+ ordering = "Korea1";
+ supplement = 2;
+ pWidthArray->AddInteger(1);
+ _InsertWidthArray(font, 0x20, 0x7e, pWidthArray);
+ bFound = TRUE;
+ }
+ charSets.RemoveAll();
+ charSets.Add(FXFONT_SHIFTJIS_CHARSET);
+ if (!bFound && IsHasCharSet(languages, charSets)) {
+ cmap = bVert ? "90ms-RKSJ-V" : "90ms-RKSJ-H";
+ ordering = "Japan1";
+ supplement = 5;
+ pWidthArray->AddInteger(231);
+ _InsertWidthArray(font, 0x20, 0x7d, pWidthArray);
+ pWidthArray->AddInteger(326);
+ _InsertWidthArray(font, 0xa0, 0xa0, pWidthArray);
+ pWidthArray->AddInteger(327);
+ _InsertWidthArray(font, 0xa1, 0xdf, pWidthArray);
+ pWidthArray->AddInteger(631);
+ _InsertWidthArray(font, 0x7e, 0x7e, pWidthArray);
+ }
+ pBaseDict->SetAtName("Subtype", "Type0");
+ pBaseDict->SetAtName("BaseFont", basefont);
+ pBaseDict->SetAtName("Encoding", cmap);
+ pFontDict->SetAt("W", pWidthArray);
+ pFontDict->SetAtName("Type", "Font");
+ pFontDict->SetAtName("Subtype", "CIDFontType2");
+ pFontDict->SetAtName("BaseFont", basefont);
+ CPDF_Dictionary* pCIDSysInfo = FX_NEW CPDF_Dictionary;
+ pCIDSysInfo->SetAtString("Registry", "Adobe");
+ pCIDSysInfo->SetAtString("Ordering", ordering);
+ pCIDSysInfo->SetAtInteger("Supplement", supplement);
+ pFontDict->SetAt("CIDSystemInfo", pCIDSysInfo);
+ pArray = FX_NEW CPDF_Array;
+ pBaseDict->SetAt("DescendantFonts", pArray);
+ AddIndirectObject(pFontDict);
+ pArray->AddReference(this, pFontDict);
+ }
+ AddIndirectObject(pBaseDict);
+ CPDF_Dictionary* pFontDesc = FX_NEW CPDF_Dictionary;
+ pFontDesc->SetAtName("Type", "FontDescriptor");
+ pFontDesc->SetAtName("FontName", basefont);
+ pFontDesc->SetAtInteger("Flags", flags);
+ CPDF_Array* pBBox = FX_NEW CPDF_Array;
+ for (int i = 0; i < 4; i ++) {
+ pBBox->AddInteger(bbox[i]);
+ }
+ pFontDesc->SetAt("FontBBox", pBBox);
+ pFontDesc->SetAtInteger("ItalicAngle", italicangle);
+ pFontDesc->SetAtInteger("Ascent", ascend);
+ pFontDesc->SetAtInteger("Descent", descend);
+ pFontDesc->SetAtInteger("CapHeight", capheight);
+ CGFloat fStemV = 0;
+ int16_t min_width = SHRT_MAX;
+ static const UniChar stem_chars[] = {'i', 'I', '!', '1'};
+ const size_t count = sizeof(stem_chars) / sizeof(stem_chars[0]);
+ CGGlyph glyphs[count];
+ CGRect boundingRects[count];
+ if (CTFontGetGlyphsForCharacters(font, stem_chars, glyphs, count)) {
+ CTFontGetBoundingRectsForGlyphs(font, kCTFontHorizontalOrientation,
+ glyphs, boundingRects, count);
+ for (size_t i = 0; i < count; i++) {
+ int16_t width = boundingRects[i].size.width;
+ if (width > 0 && width < min_width) {
+ min_width = width;
+ fStemV = min_width;
+ }
+ }
+ }
+ pFontDesc->SetAtInteger("StemV", fStemV);
+ AddIndirectObject(pFontDesc);
+ pFontDict->SetAtReference("FontDescriptor", this, pFontDesc);
+ CFRelease(traits);
+ CFRelease(languages);
+ return LoadFont(pBaseDict);
+}
+#endif
+static void _InsertWidthArray1(CFX_Font* pFont, IFX_FontEncoding* pEncoding, FX_WCHAR start, FX_WCHAR end, CPDF_Array* pWidthArray)
+{
+ int size = end - start + 1;
+ int* widths = FX_Alloc(int, size);
+ int i;
+ for (i = 0; i < size; i ++) {
+ int glyph_index = pEncoding->GlyphFromCharCode(start + i);
+ widths[i] = pFont->GetGlyphWidth(glyph_index);
+ }
+ for (i = 1; i < size; i ++)
+ if (widths[i] != *widths) {
+ break;
+ }
+ if (i == size) {
+ int first = pWidthArray->GetInteger(pWidthArray->GetCount() - 1);
+ pWidthArray->AddInteger(first + size - 1);
+ pWidthArray->AddInteger(*widths);
+ } else {
+ CPDF_Array* pWidthArray1 = FX_NEW CPDF_Array;
+ pWidthArray->Add(pWidthArray1);
+ for (i = 0; i < size; i ++) {
+ pWidthArray1->AddInteger(widths[i]);
+ }
+ }
+ FX_Free(widths);
+}
+CPDF_Font* CPDF_Document::AddFont(CFX_Font* pFont, int charset, FX_BOOL bVert)
+{
+ if (pFont == NULL) {
+ return NULL;
+ }
+ FX_BOOL bCJK = charset == FXFONT_CHINESEBIG5_CHARSET || charset == FXFONT_GB2312_CHARSET ||
+ charset == FXFONT_HANGEUL_CHARSET || charset == FXFONT_SHIFTJIS_CHARSET;
+ CFX_ByteString basefont = pFont->GetFamilyName();
+ basefont.Replace(" ", "");
+ int flags = 0;
+ if (pFont->IsBold()) {
+ flags |= PDFFONT_FORCEBOLD;
+ }
+ if (pFont->IsItalic()) {
+ flags |= PDFFONT_ITALIC;
+ }
+ if (pFont->IsFixedWidth()) {
+ flags |= PDFFONT_FIXEDPITCH;
+ }
+ CPDF_Dictionary* pBaseDict = FX_NEW CPDF_Dictionary;
+ pBaseDict->SetAtName("Type", "Font");
+ IFX_FontEncoding* pEncoding = FXGE_CreateUnicodeEncoding(pFont);
+ CPDF_Dictionary* pFontDict = pBaseDict;
+ if (!bCJK) {
+ CPDF_Array* pWidths = FX_NEW CPDF_Array;
+ int charcode;
+ for (charcode = 32; charcode < 128; charcode ++) {
+ int glyph_index = pEncoding->GlyphFromCharCode(charcode);
+ int char_width = pFont->GetGlyphWidth(glyph_index);
+ pWidths->AddInteger(char_width);
+ }
+ if (charset == FXFONT_ANSI_CHARSET || charset == FXFONT_DEFAULT_CHARSET ||
+ charset == FXFONT_SYMBOL_CHARSET) {
+ if (charset == FXFONT_SYMBOL_CHARSET) {
+ flags |= PDFFONT_SYMBOLIC;
+ } else {
+ flags |= PDFFONT_NONSYMBOLIC;
+ }
+ pBaseDict->SetAtName(FX_BSTRC("Encoding"), "WinAnsiEncoding");
+ for (charcode = 128; charcode <= 255; charcode ++) {
+ int glyph_index = pEncoding->GlyphFromCharCode(charcode);
+ int char_width = pFont->GetGlyphWidth(glyph_index);
+ pWidths->AddInteger(char_width);
+ }
+ } else {
+ flags |= PDFFONT_NONSYMBOLIC;
+ int i;
+ for (i = 0; i < sizeof g_FX_CharsetUnicodes / sizeof(FX_CharsetUnicodes); i ++)
+ if (g_FX_CharsetUnicodes[i].m_Charset == charset) {
+ break;
+ }
+ if (i < sizeof g_FX_CharsetUnicodes / sizeof(FX_CharsetUnicodes)) {
+ CPDF_Dictionary* pEncodingDict = FX_NEW CPDF_Dictionary;
+ pEncodingDict->SetAtName(FX_BSTRC("BaseEncoding"), "WinAnsiEncoding");
+ CPDF_Array* pArray = FX_NEW CPDF_Array;
+ pArray->AddInteger(128);
+ const FX_WCHAR* pUnicodes = g_FX_CharsetUnicodes[i].m_pUnicodes;
+ for (int j = 0; j < 128; j ++) {
+ CFX_ByteString name = PDF_AdobeNameFromUnicode(pUnicodes[j]);
+ if (name.IsEmpty()) {
+ pArray->AddName(FX_BSTRC(".notdef"));
+ } else {
+ pArray->AddName(name);
+ }
+ int glyph_index = pEncoding->GlyphFromCharCode(pUnicodes[j]);
+ int char_width = pFont->GetGlyphWidth(glyph_index);
+ pWidths->AddInteger(char_width);
+ }
+ pEncodingDict->SetAt(FX_BSTRC("Differences"), pArray);
+ AddIndirectObject(pEncodingDict);
+ pBaseDict->SetAtReference(FX_BSTRC("Encoding"), this, pEncodingDict);
+ }
+ }
+ if (pFont->IsBold() && pFont->IsItalic()) {
+ basefont += ",BoldItalic";
+ } else if (pFont->IsBold()) {
+ basefont += ",Bold";
+ } else if (pFont->IsItalic()) {
+ basefont += ",Italic";
+ }
+ pBaseDict->SetAtName("Subtype", "TrueType");
+ pBaseDict->SetAtName("BaseFont", basefont);
+ pBaseDict->SetAtNumber("FirstChar", 32);
+ pBaseDict->SetAtNumber("LastChar", 255);
+ pBaseDict->SetAt("Widths", pWidths);
+ } else {
+ flags |= PDFFONT_NONSYMBOLIC;
+ pFontDict = FX_NEW CPDF_Dictionary;
+ CFX_ByteString cmap;
+ CFX_ByteString ordering;
+ int supplement;
+ CPDF_Array* pWidthArray = FX_NEW CPDF_Array;
+ switch (charset) {
+ case FXFONT_CHINESEBIG5_CHARSET:
+ cmap = bVert ? "ETenms-B5-V" : "ETenms-B5-H";
+ ordering = "CNS1";
+ supplement = 4;
+ pWidthArray->AddInteger(1);
+ _InsertWidthArray1(pFont, pEncoding, 0x20, 0x7e, pWidthArray);
+ break;
+ case FXFONT_GB2312_CHARSET:
+ cmap = bVert ? "GBK-EUC-V" : "GBK-EUC-H";
+ ordering = "GB1", supplement = 2;
+ pWidthArray->AddInteger(7716);
+ _InsertWidthArray1(pFont, pEncoding, 0x20, 0x20, pWidthArray);
+ pWidthArray->AddInteger(814);
+ _InsertWidthArray1(pFont, pEncoding, 0x21, 0x7e, pWidthArray);
+ break;
+ case FXFONT_HANGEUL_CHARSET:
+ cmap = bVert ? "KSCms-UHC-V" : "KSCms-UHC-H";
+ ordering = "Korea1";
+ supplement = 2;
+ pWidthArray->AddInteger(1);
+ _InsertWidthArray1(pFont, pEncoding, 0x20, 0x7e, pWidthArray);
+ break;
+ case FXFONT_SHIFTJIS_CHARSET:
+ cmap = bVert ? "90ms-RKSJ-V" : "90ms-RKSJ-H";
+ ordering = "Japan1";
+ supplement = 5;
+ pWidthArray->AddInteger(231);
+ _InsertWidthArray1(pFont, pEncoding, 0x20, 0x7d, pWidthArray);
+ pWidthArray->AddInteger(326);
+ _InsertWidthArray1(pFont, pEncoding, 0xa0, 0xa0, pWidthArray);
+ pWidthArray->AddInteger(327);
+ _InsertWidthArray1(pFont, pEncoding, 0xa1, 0xdf, pWidthArray);
+ pWidthArray->AddInteger(631);
+ _InsertWidthArray1(pFont, pEncoding, 0x7e, 0x7e, pWidthArray);
+ break;
+ }
+ pBaseDict->SetAtName("Subtype", "Type0");
+ pBaseDict->SetAtName("BaseFont", basefont);
+ pBaseDict->SetAtName("Encoding", cmap);
+ pFontDict->SetAt("W", pWidthArray);
+ pFontDict->SetAtName("Type", "Font");
+ pFontDict->SetAtName("Subtype", "CIDFontType2");
+ pFontDict->SetAtName("BaseFont", basefont);
+ CPDF_Dictionary* pCIDSysInfo = FX_NEW CPDF_Dictionary;
+ pCIDSysInfo->SetAtString("Registry", "Adobe");
+ pCIDSysInfo->SetAtString("Ordering", ordering);
+ pCIDSysInfo->SetAtInteger("Supplement", supplement);
+ pFontDict->SetAt("CIDSystemInfo", pCIDSysInfo);
+ CPDF_Array* pArray = FX_NEW CPDF_Array;
+ pBaseDict->SetAt("DescendantFonts", pArray);
+ AddIndirectObject(pFontDict);
+ pArray->AddReference(this, pFontDict);
+ }
+ AddIndirectObject(pBaseDict);
+ CPDF_Dictionary* pFontDesc = FX_NEW CPDF_Dictionary;
+ pFontDesc->SetAtName("Type", "FontDescriptor");
+ pFontDesc->SetAtName("FontName", basefont);
+ pFontDesc->SetAtInteger("Flags", flags);
+ pFontDesc->SetAtInteger("ItalicAngle", pFont->m_pSubstFont ? pFont->m_pSubstFont->m_ItalicAngle : 0);
+ pFontDesc->SetAtInteger("Ascent", pFont->GetAscent());
+ pFontDesc->SetAtInteger("Descent", pFont->GetDescent());
+ FX_RECT bbox;
+ pFont->GetBBox(bbox);
+ CPDF_Array* pBBox = FX_NEW CPDF_Array;
+ pBBox->AddInteger(bbox.left);
+ pBBox->AddInteger(bbox.bottom);
+ pBBox->AddInteger(bbox.right);
+ pBBox->AddInteger(bbox.top);
+ pFontDesc->SetAt("FontBBox", pBBox);
+ FX_INT32 nStemV = 0;
+ if (pFont->m_pSubstFont) {
+ nStemV = pFont->m_pSubstFont->m_Weight / 5;
+ } else {
+ static const FX_CHAR stem_chars[] = {'i', 'I', '!', '1'};
+ const size_t count = sizeof(stem_chars) / sizeof(stem_chars[0]);
+ FX_DWORD glyph = pEncoding->GlyphFromCharCode(stem_chars[0]);
+ nStemV = pFont->GetGlyphWidth(glyph);
+ for (size_t i = 1; i < count; i++) {
+ glyph = pEncoding->GlyphFromCharCode(stem_chars[i]);
+ int width = pFont->GetGlyphWidth(glyph);
+ if (width > 0 && width < nStemV) {
+ nStemV = width;
+ }
+ }
+ }
+ if (pEncoding) {
+ delete pEncoding;
+ }
+ pFontDesc->SetAtInteger("StemV", nStemV);
+ AddIndirectObject(pFontDesc);
+ pFontDict->SetAtReference("FontDescriptor", this, pFontDesc);
+ return LoadFont(pBaseDict);
+}
+static CPDF_Stream* GetFormStream(CPDF_Document* pDoc, CPDF_Object* pResObj)
+{
+ if (pResObj->GetType() != PDFOBJ_REFERENCE) {
+ return NULL;
+ }
+ CPDF_Reference* pRef = (CPDF_Reference*)pResObj;
+ FX_BOOL bForm;
+ if (pDoc->IsFormStream(pRef->GetRefObjNum(), bForm) && !bForm) {
+ return NULL;
+ }
+ pResObj = pRef->GetDirect();
+ if (pResObj->GetType() != PDFOBJ_STREAM) {
+ return NULL;
+ }
+ CPDF_Stream* pXObject = (CPDF_Stream*)pResObj;
+ if (pXObject->GetDict()->GetString(FX_BSTRC("Subtype")) != FX_BSTRC("Form")) {
+ return NULL;
+ }
+ return pXObject;
+}
+static int InsertDeletePDFPage(CPDF_Document* pDoc, CPDF_Dictionary* pPages,
+ int nPagesToGo, CPDF_Dictionary* pPage, FX_BOOL bInsert, CFX_PtrArray& stackList)
+{
+ CPDF_Array* pKidList = pPages->GetArray("Kids");
+ if (!pKidList) {
+ return -1;
+ }
+ int nKids = pKidList->GetCount();
+ for (int i = 0; i < nKids; i ++) {
+ CPDF_Dictionary* pKid = pKidList->GetDict(i);
+ if (pKid->GetString("Type") == FX_BSTRC("Page")) {
+ if (nPagesToGo == 0) {
+ if (bInsert) {
+ pKidList->InsertAt(i, CPDF_Reference::Create(pDoc, pPage->GetObjNum()));
+ pPage->SetAtReference("Parent", pDoc, pPages->GetObjNum());
+ } else {
+ pKidList->RemoveAt(i);
+ }
+ pPages->SetAtInteger("Count", pPages->GetInteger("Count") + (bInsert ? 1 : -1));
+ return 1;
+ }
+ nPagesToGo --;
+ } else {
+ int nPages = pKid->GetInteger("Count");
+ if (nPagesToGo < nPages) {
+ int stackCount = stackList.GetSize();
+ for (int j = 0; j < stackCount; ++j) {
+ if (pKid == stackList[j]) {
+ return -1;
+ }
+ }
+ stackList.Add(pKid);
+ if (InsertDeletePDFPage(pDoc, pKid, nPagesToGo, pPage, bInsert, stackList) < 0) {
+ return -1;
+ }
+ stackList.RemoveAt(stackCount);
+ pPages->SetAtInteger("Count", pPages->GetInteger("Count") + (bInsert ? 1 : -1));
+ return 1;
+ }
+ nPagesToGo -= nPages;
+ }
+ }
+ return 0;
+}
+static int InsertNewPage(CPDF_Document* pDoc, int iPage, CPDF_Dictionary* pPageDict, CFX_DWordArray &pageList)
+{
+ CPDF_Dictionary* pRoot = pDoc->GetRoot();
+ if (!pRoot) {
+ return -1;
+ }
+ CPDF_Dictionary* pPages = pRoot->GetDict(FX_BSTRC("Pages"));
+ if (!pPages) {
+ return -1;
+ }
+ int nPages = pDoc->GetPageCount();
+ if (iPage < 0 || iPage > nPages) {
+ return -1;
+ }
+ if (iPage == nPages) {
+ CPDF_Array* pPagesList = pPages->GetArray(FX_BSTRC("Kids"));
+ if (!pPagesList) {
+ pPagesList = FX_NEW CPDF_Array;
+ pPages->SetAt(FX_BSTRC("Kids"), pPagesList);
+ }
+ pPagesList->Add(pPageDict, pDoc);
+ pPages->SetAtInteger(FX_BSTRC("Count"), nPages + 1);
+ pPageDict->SetAtReference(FX_BSTRC("Parent"), pDoc, pPages->GetObjNum());
+ } else {
+ CFX_PtrArray stack;
+ stack.Add(pPages);
+ if (InsertDeletePDFPage(pDoc, pPages, iPage, pPageDict, TRUE, stack) < 0) {
+ return -1;
+ }
+ }
+ pageList.InsertAt(iPage, pPageDict->GetObjNum());
+ return iPage;
+}
+CPDF_Dictionary* CPDF_Document::CreateNewPage(int iPage)
+{
+ CPDF_Dictionary* pDict = FX_NEW CPDF_Dictionary;
+ pDict->SetAtName("Type", "Page");
+ FX_DWORD dwObjNum = AddIndirectObject(pDict);
+ if (InsertNewPage(this, iPage, pDict, m_PageList) < 0) {
+ ReleaseIndirectObject(dwObjNum);
+ return NULL;
+ }
+ return pDict;
+}
+int _PDF_GetStandardFontName(CFX_ByteString& name);
+CPDF_Font* CPDF_Document::AddStandardFont(FX_LPCSTR font, CPDF_FontEncoding* pEncoding)
+{
+ CFX_ByteString name(font, -1);
+ if (_PDF_GetStandardFontName(name) < 0) {
+ return NULL;
+ }
+ return GetPageData()->GetStandardFont(name, pEncoding);
+}
+void CPDF_Document::DeletePage(int iPage)
+{
+ CPDF_Dictionary* pRoot = GetRoot();
+ if (pRoot == NULL) {
+ return;
+ }
+ CPDF_Dictionary* pPages = pRoot->GetDict("Pages");
+ if (pPages == NULL) {
+ return;
+ }
+ int nPages = pPages->GetInteger("Count");
+ if (iPage < 0 || iPage >= nPages) {
+ return;
+ }
+ CFX_PtrArray stack;
+ stack.Add(pPages);
+ if (InsertDeletePDFPage(this, pPages, iPage, NULL, FALSE, stack) < 0) {
+ return;
+ }
+ m_PageList.RemoveAt(iPage);
+}
+CPDF_Object* FPDFAPI_GetPageAttr(CPDF_Dictionary* pPageDict, FX_BSTR name);
+void FPDFAPI_FlatPageAttr(CPDF_Dictionary* pPageDict, FX_BSTR name)
+{
+ if (pPageDict->KeyExist(name)) {
+ return;
+ }
+ CPDF_Object* pObj = FPDFAPI_GetPageAttr(pPageDict, name);
+ if (pObj) {
+ pPageDict->SetAt(name, pObj->Clone());
+ }
+}
diff --git a/core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp b/core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp
index cb50601226..d73d7614da 100644
--- a/core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp
+++ b/core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp
@@ -1,374 +1,374 @@
-// 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
-
-#include "../../../include/fpdfapi/fpdf_module.h"
-#include "../../../include/fpdfapi/fpdf_page.h"
-#include "../../../include/fxcodec/fx_codec.h"
-#include "../../../include/fpdfapi/fpdf_render.h"
-#include "../fpdf_page/pageint.h"
-#include "../fpdf_render/render_int.h"
-CPDF_Dictionary* CPDF_Image::InitJPEG(FX_LPBYTE pData, FX_DWORD size)
-{
- FX_INT32 width, height, color_trans, num_comps, bits;
- if (!CPDF_ModuleMgr::Get()->GetJpegModule()->
- LoadInfo(pData, size, width, height, num_comps, bits, color_trans)) {
- return NULL;
- }
- CPDF_Dictionary* pDict = FX_NEW CPDF_Dictionary;
- pDict->SetAtName("Type", "XObject");
- pDict->SetAtName("Subtype", "Image");
- pDict->SetAtInteger("Width", width);
- pDict->SetAtInteger("Height", height);
- FX_LPCSTR csname = NULL;
- if (num_comps == 1) {
- csname = "DeviceGray";
- } else if (num_comps == 3) {
- csname = "DeviceRGB";
- } else if (num_comps == 4) {
- csname = "DeviceCMYK";
- CPDF_Array* pDecode = CPDF_Array::Create();
- for (int n = 0; n < 4; n ++) {
- pDecode->AddInteger(1);
- pDecode->AddInteger(0);
- }
- pDict->SetAt(FX_BSTRC("Decode"), pDecode);
- }
- pDict->SetAtName("ColorSpace", csname);
- pDict->SetAtInteger("BitsPerComponent", bits);
- pDict->SetAtName("Filter", "DCTDecode");
- if (!color_trans) {
- CPDF_Dictionary* pParms = FX_NEW CPDF_Dictionary;
- pDict->SetAt("DecodeParms", pParms);
- pParms->SetAtInteger("ColorTransform", 0);
- }
- m_bIsMask = FALSE;
- m_Width = width;
- m_Height = height;
- if (m_pStream == NULL) {
- m_pStream = FX_NEW CPDF_Stream(NULL, 0, NULL);
- }
- return pDict;
-}
-void CPDF_Image::SetJpegImage(FX_LPBYTE pData, FX_DWORD size)
-{
- CPDF_Dictionary *pDict = InitJPEG(pData, size);
- if (!pDict) {
- return;
- }
- m_pStream->InitStream(pData, size, pDict);
-}
-void CPDF_Image::SetJpegImage(IFX_FileRead *pFile)
-{
- FX_DWORD size = (FX_DWORD)pFile->GetSize();
- if (!size) {
- return;
- }
- FX_DWORD dwEstimateSize = size;
- if (dwEstimateSize > 8192) {
- dwEstimateSize = 8192;
- }
- FX_LPBYTE pData = FX_Alloc(FX_BYTE, dwEstimateSize);
- if (!pData) {
- return;
- }
- pFile->ReadBlock(pData, 0, dwEstimateSize);
- CPDF_Dictionary *pDict = InitJPEG(pData, dwEstimateSize);
- FX_Free(pData);
- if (!pDict && size > dwEstimateSize) {
- pData = FX_Alloc(FX_BYTE, size);
- if (!pData) {
- return;
- }
- pFile->ReadBlock(pData, 0, size);
- pDict = InitJPEG(pData, size);
- FX_Free(pData);
- }
- if (!pDict) {
- return;
- }
- m_pStream->InitStream(pFile, pDict);
-}
-void _DCTEncodeBitmap(CPDF_Dictionary *pBitmapDict, const CFX_DIBitmap* pBitmap, int quality, FX_LPBYTE &buf, FX_STRSIZE &size)
-{
-}
-void _JBIG2EncodeBitmap(CPDF_Dictionary *pBitmapDict, const CFX_DIBitmap *pBitmap, CPDF_Document *pDoc, FX_LPBYTE &buf, FX_STRSIZE &size, FX_BOOL bLossLess)
-{
-}
-void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, FX_INT32 iCompress, IFX_FileWrite *pFileWrite, IFX_FileRead *pFileRead, const CFX_DIBitmap* pMask, const CPDF_ImageSetParam* pParam)
-{
- FX_INT32 BitmapWidth = pBitmap->GetWidth();
- FX_INT32 BitmapHeight = pBitmap->GetHeight();
- if (BitmapWidth < 1 || BitmapHeight < 1) {
- return;
- }
- FX_LPBYTE src_buf = pBitmap->GetBuffer();
- FX_INT32 src_pitch = pBitmap->GetPitch();
- FX_INT32 bpp = pBitmap->GetBPP();
- FX_BOOL bUseMatte = pParam && pParam->pMatteColor && (pBitmap->GetFormat() == FXDIB_Argb);
- CPDF_Dictionary* pDict = FX_NEW CPDF_Dictionary;
- pDict->SetAtName(FX_BSTRC("Type"), FX_BSTRC("XObject"));
- pDict->SetAtName(FX_BSTRC("Subtype"), FX_BSTRC("Image"));
- pDict->SetAtInteger(FX_BSTRC("Width"), BitmapWidth);
- pDict->SetAtInteger(FX_BSTRC("Height"), BitmapHeight);
- FX_LPBYTE dest_buf = NULL;
- FX_STRSIZE dest_pitch = 0, dest_size = 0, opType = -1;
- if (bpp == 1) {
- FX_INT32 reset_a = 0, reset_r = 0, reset_g = 0, reset_b = 0;
- FX_INT32 set_a = 0, set_r = 0, set_g = 0, set_b = 0;
- if (!pBitmap->IsAlphaMask()) {
- ArgbDecode(pBitmap->GetPaletteArgb(0), reset_a, reset_r, reset_g, reset_b);
- ArgbDecode(pBitmap->GetPaletteArgb(1), set_a, set_r, set_g, set_b);
- }
- if (set_a == 0 || reset_a == 0) {
- pDict->SetAt(FX_BSTRC("ImageMask"), FX_NEW CPDF_Boolean(TRUE));
- if (reset_a == 0) {
- CPDF_Array* pArray = FX_NEW CPDF_Array;
- pArray->AddInteger(1);
- pArray->AddInteger(0);
- pDict->SetAt(FX_BSTRC("Decode"), pArray);
- }
- } else {
- CPDF_Array* pCS = FX_NEW CPDF_Array;
- pCS->AddName(FX_BSTRC("Indexed"));
- pCS->AddName(FX_BSTRC("DeviceRGB"));
- pCS->AddInteger(1);
- CFX_ByteString ct;
- FX_LPSTR pBuf = ct.GetBuffer(6);
- pBuf[0] = (FX_CHAR)reset_r;
- pBuf[1] = (FX_CHAR)reset_g;
- pBuf[2] = (FX_CHAR)reset_b;
- pBuf[3] = (FX_CHAR)set_r;
- pBuf[4] = (FX_CHAR)set_g;
- pBuf[5] = (FX_CHAR)set_b;
- ct.ReleaseBuffer(6);
- pCS->Add(CPDF_String::Create(ct, TRUE));
- pDict->SetAt(FX_BSTRC("ColorSpace"), pCS);
- }
- pDict->SetAtInteger(FX_BSTRC("BitsPerComponent"), 1);
- dest_pitch = (BitmapWidth + 7) / 8;
- if ((iCompress & 0x03) == PDF_IMAGE_NO_COMPRESS) {
- opType = 1;
- } else {
- opType = 0;
- }
- } else if (bpp == 8) {
- FX_INT32 iPalette = pBitmap->GetPaletteSize();
- if (iPalette > 0) {
- CPDF_Array* pCS = FX_NEW CPDF_Array;
- m_pDocument->AddIndirectObject(pCS);
- pCS->AddName(FX_BSTRC("Indexed"));
- pCS->AddName(FX_BSTRC("DeviceRGB"));
- pCS->AddInteger(iPalette - 1);
- FX_LPBYTE pColorTable = FX_Alloc(FX_BYTE, iPalette * 3);
- FX_LPBYTE ptr = pColorTable;
- for (FX_INT32 i = 0; i < iPalette; i ++) {
- FX_DWORD argb = pBitmap->GetPaletteArgb(i);
- ptr[0] = (FX_BYTE)(argb >> 16);
- ptr[1] = (FX_BYTE)(argb >> 8);
- ptr[2] = (FX_BYTE)argb;
- ptr += 3;
- }
- CPDF_Stream *pCTS = CPDF_Stream::Create(pColorTable, iPalette * 3, CPDF_Dictionary::Create());
- m_pDocument->AddIndirectObject(pCTS);
- pCS->AddReference(m_pDocument, pCTS);
- pDict->SetAtReference(FX_BSTRC("ColorSpace"), m_pDocument, pCS);
- } else {
- pDict->SetAtName(FX_BSTRC("ColorSpace"), FX_BSTRC("DeviceGray"));
- }
- pDict->SetAtInteger(FX_BSTRC("BitsPerComponent"), 8);
- if ((iCompress & 0x03) == PDF_IMAGE_NO_COMPRESS) {
- dest_pitch = BitmapWidth;
- opType = 1;
- } else {
- opType = 0;
- }
- } else {
- pDict->SetAtName(FX_BSTRC("ColorSpace"), FX_BSTRC("DeviceRGB"));
- pDict->SetAtInteger(FX_BSTRC("BitsPerComponent"), 8);
- if ((iCompress & 0x03) == PDF_IMAGE_NO_COMPRESS) {
- dest_pitch = BitmapWidth * 3;
- opType = 2;
- } else {
- opType = 0;
- }
- }
- const CFX_DIBitmap* pMaskBitmap = NULL;
- if (pBitmap->HasAlpha()) {
- pMaskBitmap = pBitmap->GetAlphaMask();
- }
- if (!pMaskBitmap && pMask) {
- FXDIB_Format maskFormat = pMask->GetFormat();
- if (maskFormat == FXDIB_1bppMask || maskFormat == FXDIB_8bppMask) {
- pMaskBitmap = pMask;
- }
- }
- if (pMaskBitmap) {
- FX_INT32 maskWidth = pMaskBitmap->GetWidth();
- FX_INT32 maskHeight = pMaskBitmap->GetHeight();
- FX_LPBYTE mask_buf = NULL;
- FX_STRSIZE mask_size;
- FX_BOOL bDeleteMask = TRUE;
- CPDF_Dictionary* pMaskDict = FX_NEW CPDF_Dictionary;
- pMaskDict->SetAtName(FX_BSTRC("Type"), FX_BSTRC("XObject"));
- pMaskDict->SetAtName(FX_BSTRC("Subtype"), FX_BSTRC("Image"));
- pMaskDict->SetAtInteger(FX_BSTRC("Width"), maskWidth);
- pMaskDict->SetAtInteger(FX_BSTRC("Height"), maskHeight);
- pMaskDict->SetAtName(FX_BSTRC("ColorSpace"), FX_BSTRC("DeviceGray"));
- pMaskDict->SetAtInteger(FX_BSTRC("BitsPerComponent"), 8);
- if (pMaskBitmap->GetBPP() == 8 && (iCompress & PDF_IMAGE_MASK_LOSSY_COMPRESS) != 0) {
- _DCTEncodeBitmap(pMaskDict, pMaskBitmap, pParam ? pParam->nQuality : 75, mask_buf, mask_size);
- } else if (pMaskBitmap->GetFormat() == FXDIB_1bppMask) {
- _JBIG2EncodeBitmap(pMaskDict, pMaskBitmap, m_pDocument, mask_buf, mask_size, TRUE);
- } else {
- mask_size = maskHeight * maskWidth;
- mask_buf = FX_Alloc(FX_BYTE, mask_size);
- for (FX_INT32 a = 0; a < maskHeight; a ++) {
- FXSYS_memcpy32(mask_buf + a * maskWidth, pMaskBitmap->GetScanline(a), maskWidth);
- }
- }
- if (pMaskDict) {
- pMaskDict->SetAtInteger(FX_BSTRC("Length"), mask_size);
- CPDF_Stream* pMaskStream = NULL;
- if (bUseMatte) {
- int a, r, g, b;
- ArgbDecode(*(pParam->pMatteColor), a, r, g, b);
- CPDF_Array* pMatte = FX_NEW CPDF_Array;
- pMatte->AddInteger(r);
- pMatte->AddInteger(g);
- pMatte->AddInteger(b);
- pMaskDict->SetAt(FX_BSTRC("Matte"), pMatte);
- }
- pMaskStream = FX_NEW CPDF_Stream(mask_buf, mask_size, pMaskDict);
- m_pDocument->AddIndirectObject(pMaskStream);
- bDeleteMask = FALSE;
- pDict->SetAtReference(FX_BSTRC("SMask"), m_pDocument, pMaskStream);
- }
- if (pBitmap->HasAlpha()) {
- delete pMaskBitmap;
- }
- }
- FX_BOOL bStream = pFileWrite != NULL && pFileRead != NULL;
- if (opType == 0) {
- if (iCompress & PDF_IMAGE_LOSSLESS_COMPRESS) {
- if (pBitmap->GetBPP() == 1) {
- _JBIG2EncodeBitmap(pDict, pBitmap, m_pDocument, dest_buf, dest_size, TRUE);
- }
- } else {
- if (pBitmap->GetBPP() == 1) {
- _JBIG2EncodeBitmap(pDict, pBitmap, m_pDocument, dest_buf, dest_size, FALSE);
- } else if (pBitmap->GetBPP() >= 8 && pBitmap->GetPalette() != NULL) {
- CFX_DIBitmap *pNewBitmap = FX_NEW CFX_DIBitmap();
- pNewBitmap->Copy(pBitmap);
- pNewBitmap->ConvertFormat(FXDIB_Rgb);
- SetImage(pNewBitmap, iCompress, pFileWrite, pFileRead);
- if (pDict) {
- pDict->Release();
- pDict = NULL;
- }
- if (dest_buf) {
- FX_Free(dest_buf);
- dest_buf = NULL;
- }
- dest_size = 0;
- delete pNewBitmap;
- return;
- } else {
- if (bUseMatte) {
- CFX_DIBitmap *pNewBitmap = FX_NEW CFX_DIBitmap();
- pNewBitmap->Create(BitmapWidth, BitmapHeight, FXDIB_Argb);
- FX_LPBYTE dst_buf = pNewBitmap->GetBuffer();
- FX_INT32 src_offset = 0;
- for (FX_INT32 row = 0; row < BitmapHeight; row ++) {
- src_offset = row * src_pitch;
- for (FX_INT32 column = 0; column < BitmapWidth; column ++) {
- FX_FLOAT alpha = src_buf[src_offset + 3] / 255.0f;
- dst_buf[src_offset] = (FX_BYTE)(src_buf[src_offset] * alpha);
- dst_buf[src_offset + 1] = (FX_BYTE)(src_buf[src_offset + 1] * alpha);
- dst_buf[src_offset + 2] = (FX_BYTE)(src_buf[src_offset + 2] * alpha);
- dst_buf[src_offset + 3] = (FX_BYTE)(src_buf[src_offset + 3]);
- src_offset += 4;
- }
- }
- _DCTEncodeBitmap(pDict, pNewBitmap, pParam ? pParam->nQuality : 75, dest_buf, dest_size);
- delete pNewBitmap;
- } else {
- _DCTEncodeBitmap(pDict, pBitmap, pParam ? pParam->nQuality : 75, dest_buf, dest_size);
- }
- }
- }
- if (bStream) {
- pFileWrite->WriteBlock(dest_buf, dest_size);
- FX_Free(dest_buf);
- dest_buf = NULL;
- }
- } else if (opType == 1) {
- if (!bStream) {
- dest_size = dest_pitch * BitmapHeight;
- dest_buf = FX_Alloc(FX_BYTE, dest_size);
- }
- FX_LPBYTE pDest = dest_buf;
- for (FX_INT32 i = 0; i < BitmapHeight; i ++) {
- if (!bStream) {
- FXSYS_memcpy32(pDest, src_buf, dest_pitch);
- pDest += dest_pitch;
- } else {
- pFileWrite->WriteBlock(src_buf, dest_pitch);
- }
- src_buf += src_pitch;
- }
- } else if (opType == 2) {
- if (!bStream) {
- dest_size = dest_pitch * BitmapHeight;
- dest_buf = FX_Alloc(FX_BYTE, dest_size);
- } else {
- dest_buf = FX_Alloc(FX_BYTE, dest_pitch);
- }
- FX_LPBYTE pDest = dest_buf;
- FX_INT32 src_offset = 0;
- FX_INT32 dest_offset = 0;
- for (FX_INT32 row = 0; row < BitmapHeight; row ++) {
- src_offset = row * src_pitch;
- for (FX_INT32 column = 0; column < BitmapWidth; column ++) {
- FX_FLOAT alpha = bUseMatte ? src_buf[src_offset + 3] / 255.0f : 1;
- pDest[dest_offset] = (FX_BYTE)(src_buf[src_offset + 2] * alpha);
- pDest[dest_offset + 1] = (FX_BYTE)(src_buf[src_offset + 1] * alpha);
- pDest[dest_offset + 2] = (FX_BYTE)(src_buf[src_offset] * alpha);
- dest_offset += 3;
- src_offset += bpp == 24 ? 3 : 4;
- }
- if (bStream) {
- pFileWrite->WriteBlock(pDest, dest_pitch);
- pDest = dest_buf;
- } else {
- pDest += dest_pitch;
- }
- dest_offset = 0;
- }
- if (bStream) {
- FX_Free(dest_buf);
- dest_buf = NULL;
- }
- }
- if (m_pStream == NULL) {
- m_pStream = FX_NEW CPDF_Stream(NULL, 0, NULL);
- }
- if (!bStream) {
- m_pStream->InitStream(dest_buf, dest_size, pDict);
- } else {
- pFileWrite->Flush();
- m_pStream->InitStream(pFileRead, pDict);
- }
- m_bIsMask = pBitmap->IsAlphaMask();
- m_Width = BitmapWidth;
- m_Height = BitmapHeight;
- if (dest_buf) {
- FX_Free(dest_buf);
- }
-}
-void CPDF_Image::ResetCache(CPDF_Page* pPage, const CFX_DIBitmap* pBitmap)
-{
- pPage->GetRenderCache()->ResetBitmap(m_pStream, pBitmap);
-}
+// 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
+
+#include "../../../include/fpdfapi/fpdf_module.h"
+#include "../../../include/fpdfapi/fpdf_page.h"
+#include "../../../include/fxcodec/fx_codec.h"
+#include "../../../include/fpdfapi/fpdf_render.h"
+#include "../fpdf_page/pageint.h"
+#include "../fpdf_render/render_int.h"
+CPDF_Dictionary* CPDF_Image::InitJPEG(FX_LPBYTE pData, FX_DWORD size)
+{
+ FX_INT32 width, height, color_trans, num_comps, bits;
+ if (!CPDF_ModuleMgr::Get()->GetJpegModule()->
+ LoadInfo(pData, size, width, height, num_comps, bits, color_trans)) {
+ return NULL;
+ }
+ CPDF_Dictionary* pDict = FX_NEW CPDF_Dictionary;
+ pDict->SetAtName("Type", "XObject");
+ pDict->SetAtName("Subtype", "Image");
+ pDict->SetAtInteger("Width", width);
+ pDict->SetAtInteger("Height", height);
+ FX_LPCSTR csname = NULL;
+ if (num_comps == 1) {
+ csname = "DeviceGray";
+ } else if (num_comps == 3) {
+ csname = "DeviceRGB";
+ } else if (num_comps == 4) {
+ csname = "DeviceCMYK";
+ CPDF_Array* pDecode = CPDF_Array::Create();
+ for (int n = 0; n < 4; n ++) {
+ pDecode->AddInteger(1);
+ pDecode->AddInteger(0);
+ }
+ pDict->SetAt(FX_BSTRC("Decode"), pDecode);
+ }
+ pDict->SetAtName("ColorSpace", csname);
+ pDict->SetAtInteger("BitsPerComponent", bits);
+ pDict->SetAtName("Filter", "DCTDecode");
+ if (!color_trans) {
+ CPDF_Dictionary* pParms = FX_NEW CPDF_Dictionary;
+ pDict->SetAt("DecodeParms", pParms);
+ pParms->SetAtInteger("ColorTransform", 0);
+ }
+ m_bIsMask = FALSE;
+ m_Width = width;
+ m_Height = height;
+ if (m_pStream == NULL) {
+ m_pStream = FX_NEW CPDF_Stream(NULL, 0, NULL);
+ }
+ return pDict;
+}
+void CPDF_Image::SetJpegImage(FX_LPBYTE pData, FX_DWORD size)
+{
+ CPDF_Dictionary *pDict = InitJPEG(pData, size);
+ if (!pDict) {
+ return;
+ }
+ m_pStream->InitStream(pData, size, pDict);
+}
+void CPDF_Image::SetJpegImage(IFX_FileRead *pFile)
+{
+ FX_DWORD size = (FX_DWORD)pFile->GetSize();
+ if (!size) {
+ return;
+ }
+ FX_DWORD dwEstimateSize = size;
+ if (dwEstimateSize > 8192) {
+ dwEstimateSize = 8192;
+ }
+ FX_LPBYTE pData = FX_Alloc(FX_BYTE, dwEstimateSize);
+ if (!pData) {
+ return;
+ }
+ pFile->ReadBlock(pData, 0, dwEstimateSize);
+ CPDF_Dictionary *pDict = InitJPEG(pData, dwEstimateSize);
+ FX_Free(pData);
+ if (!pDict && size > dwEstimateSize) {
+ pData = FX_Alloc(FX_BYTE, size);
+ if (!pData) {
+ return;
+ }
+ pFile->ReadBlock(pData, 0, size);
+ pDict = InitJPEG(pData, size);
+ FX_Free(pData);
+ }
+ if (!pDict) {
+ return;
+ }
+ m_pStream->InitStream(pFile, pDict);
+}
+void _DCTEncodeBitmap(CPDF_Dictionary *pBitmapDict, const CFX_DIBitmap* pBitmap, int quality, FX_LPBYTE &buf, FX_STRSIZE &size)
+{
+}
+void _JBIG2EncodeBitmap(CPDF_Dictionary *pBitmapDict, const CFX_DIBitmap *pBitmap, CPDF_Document *pDoc, FX_LPBYTE &buf, FX_STRSIZE &size, FX_BOOL bLossLess)
+{
+}
+void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, FX_INT32 iCompress, IFX_FileWrite *pFileWrite, IFX_FileRead *pFileRead, const CFX_DIBitmap* pMask, const CPDF_ImageSetParam* pParam)
+{
+ FX_INT32 BitmapWidth = pBitmap->GetWidth();
+ FX_INT32 BitmapHeight = pBitmap->GetHeight();
+ if (BitmapWidth < 1 || BitmapHeight < 1) {
+ return;
+ }
+ FX_LPBYTE src_buf = pBitmap->GetBuffer();
+ FX_INT32 src_pitch = pBitmap->GetPitch();
+ FX_INT32 bpp = pBitmap->GetBPP();
+ FX_BOOL bUseMatte = pParam && pParam->pMatteColor && (pBitmap->GetFormat() == FXDIB_Argb);
+ CPDF_Dictionary* pDict = FX_NEW CPDF_Dictionary;
+ pDict->SetAtName(FX_BSTRC("Type"), FX_BSTRC("XObject"));
+ pDict->SetAtName(FX_BSTRC("Subtype"), FX_BSTRC("Image"));
+ pDict->SetAtInteger(FX_BSTRC("Width"), BitmapWidth);
+ pDict->SetAtInteger(FX_BSTRC("Height"), BitmapHeight);
+ FX_LPBYTE dest_buf = NULL;
+ FX_STRSIZE dest_pitch = 0, dest_size = 0, opType = -1;
+ if (bpp == 1) {
+ FX_INT32 reset_a = 0, reset_r = 0, reset_g = 0, reset_b = 0;
+ FX_INT32 set_a = 0, set_r = 0, set_g = 0, set_b = 0;
+ if (!pBitmap->IsAlphaMask()) {
+ ArgbDecode(pBitmap->GetPaletteArgb(0), reset_a, reset_r, reset_g, reset_b);
+ ArgbDecode(pBitmap->GetPaletteArgb(1), set_a, set_r, set_g, set_b);
+ }
+ if (set_a == 0 || reset_a == 0) {
+ pDict->SetAt(FX_BSTRC("ImageMask"), FX_NEW CPDF_Boolean(TRUE));
+ if (reset_a == 0) {
+ CPDF_Array* pArray = FX_NEW CPDF_Array;
+ pArray->AddInteger(1);
+ pArray->AddInteger(0);
+ pDict->SetAt(FX_BSTRC("Decode"), pArray);
+ }
+ } else {
+ CPDF_Array* pCS = FX_NEW CPDF_Array;
+ pCS->AddName(FX_BSTRC("Indexed"));
+ pCS->AddName(FX_BSTRC("DeviceRGB"));
+ pCS->AddInteger(1);
+ CFX_ByteString ct;
+ FX_LPSTR pBuf = ct.GetBuffer(6);
+ pBuf[0] = (FX_CHAR)reset_r;
+ pBuf[1] = (FX_CHAR)reset_g;
+ pBuf[2] = (FX_CHAR)reset_b;
+ pBuf[3] = (FX_CHAR)set_r;
+ pBuf[4] = (FX_CHAR)set_g;
+ pBuf[5] = (FX_CHAR)set_b;
+ ct.ReleaseBuffer(6);
+ pCS->Add(CPDF_String::Create(ct, TRUE));
+ pDict->SetAt(FX_BSTRC("ColorSpace"), pCS);
+ }
+ pDict->SetAtInteger(FX_BSTRC("BitsPerComponent"), 1);
+ dest_pitch = (BitmapWidth + 7) / 8;
+ if ((iCompress & 0x03) == PDF_IMAGE_NO_COMPRESS) {
+ opType = 1;
+ } else {
+ opType = 0;
+ }
+ } else if (bpp == 8) {
+ FX_INT32 iPalette = pBitmap->GetPaletteSize();
+ if (iPalette > 0) {
+ CPDF_Array* pCS = FX_NEW CPDF_Array;
+ m_pDocument->AddIndirectObject(pCS);
+ pCS->AddName(FX_BSTRC("Indexed"));
+ pCS->AddName(FX_BSTRC("DeviceRGB"));
+ pCS->AddInteger(iPalette - 1);
+ FX_LPBYTE pColorTable = FX_Alloc(FX_BYTE, iPalette * 3);
+ FX_LPBYTE ptr = pColorTable;
+ for (FX_INT32 i = 0; i < iPalette; i ++) {
+ FX_DWORD argb = pBitmap->GetPaletteArgb(i);
+ ptr[0] = (FX_BYTE)(argb >> 16);
+ ptr[1] = (FX_BYTE)(argb >> 8);
+ ptr[2] = (FX_BYTE)argb;
+ ptr += 3;
+ }
+ CPDF_Stream *pCTS = CPDF_Stream::Create(pColorTable, iPalette * 3, CPDF_Dictionary::Create());
+ m_pDocument->AddIndirectObject(pCTS);
+ pCS->AddReference(m_pDocument, pCTS);
+ pDict->SetAtReference(FX_BSTRC("ColorSpace"), m_pDocument, pCS);
+ } else {
+ pDict->SetAtName(FX_BSTRC("ColorSpace"), FX_BSTRC("DeviceGray"));
+ }
+ pDict->SetAtInteger(FX_BSTRC("BitsPerComponent"), 8);
+ if ((iCompress & 0x03) == PDF_IMAGE_NO_COMPRESS) {
+ dest_pitch = BitmapWidth;
+ opType = 1;
+ } else {
+ opType = 0;
+ }
+ } else {
+ pDict->SetAtName(FX_BSTRC("ColorSpace"), FX_BSTRC("DeviceRGB"));
+ pDict->SetAtInteger(FX_BSTRC("BitsPerComponent"), 8);
+ if ((iCompress & 0x03) == PDF_IMAGE_NO_COMPRESS) {
+ dest_pitch = BitmapWidth * 3;
+ opType = 2;
+ } else {
+ opType = 0;
+ }
+ }
+ const CFX_DIBitmap* pMaskBitmap = NULL;
+ if (pBitmap->HasAlpha()) {
+ pMaskBitmap = pBitmap->GetAlphaMask();
+ }
+ if (!pMaskBitmap && pMask) {
+ FXDIB_Format maskFormat = pMask->GetFormat();
+ if (maskFormat == FXDIB_1bppMask || maskFormat == FXDIB_8bppMask) {
+ pMaskBitmap = pMask;
+ }
+ }
+ if (pMaskBitmap) {
+ FX_INT32 maskWidth = pMaskBitmap->GetWidth();
+ FX_INT32 maskHeight = pMaskBitmap->GetHeight();
+ FX_LPBYTE mask_buf = NULL;
+ FX_STRSIZE mask_size;
+ FX_BOOL bDeleteMask = TRUE;
+ CPDF_Dictionary* pMaskDict = FX_NEW CPDF_Dictionary;
+ pMaskDict->SetAtName(FX_BSTRC("Type"), FX_BSTRC("XObject"));
+ pMaskDict->SetAtName(FX_BSTRC("Subtype"), FX_BSTRC("Image"));
+ pMaskDict->SetAtInteger(FX_BSTRC("Width"), maskWidth);
+ pMaskDict->SetAtInteger(FX_BSTRC("Height"), maskHeight);
+ pMaskDict->SetAtName(FX_BSTRC("ColorSpace"), FX_BSTRC("DeviceGray"));
+ pMaskDict->SetAtInteger(FX_BSTRC("BitsPerComponent"), 8);
+ if (pMaskBitmap->GetBPP() == 8 && (iCompress & PDF_IMAGE_MASK_LOSSY_COMPRESS) != 0) {
+ _DCTEncodeBitmap(pMaskDict, pMaskBitmap, pParam ? pParam->nQuality : 75, mask_buf, mask_size);
+ } else if (pMaskBitmap->GetFormat() == FXDIB_1bppMask) {
+ _JBIG2EncodeBitmap(pMaskDict, pMaskBitmap, m_pDocument, mask_buf, mask_size, TRUE);
+ } else {
+ mask_size = maskHeight * maskWidth;
+ mask_buf = FX_Alloc(FX_BYTE, mask_size);
+ for (FX_INT32 a = 0; a < maskHeight; a ++) {
+ FXSYS_memcpy32(mask_buf + a * maskWidth, pMaskBitmap->GetScanline(a), maskWidth);
+ }
+ }
+ if (pMaskDict) {
+ pMaskDict->SetAtInteger(FX_BSTRC("Length"), mask_size);
+ CPDF_Stream* pMaskStream = NULL;
+ if (bUseMatte) {
+ int a, r, g, b;
+ ArgbDecode(*(pParam->pMatteColor), a, r, g, b);
+ CPDF_Array* pMatte = FX_NEW CPDF_Array;
+ pMatte->AddInteger(r);
+ pMatte->AddInteger(g);
+ pMatte->AddInteger(b);
+ pMaskDict->SetAt(FX_BSTRC("Matte"), pMatte);
+ }
+ pMaskStream = FX_NEW CPDF_Stream(mask_buf, mask_size, pMaskDict);
+ m_pDocument->AddIndirectObject(pMaskStream);
+ bDeleteMask = FALSE;
+ pDict->SetAtReference(FX_BSTRC("SMask"), m_pDocument, pMaskStream);
+ }
+ if (pBitmap->HasAlpha()) {
+ delete pMaskBitmap;
+ }
+ }
+ FX_BOOL bStream = pFileWrite != NULL && pFileRead != NULL;
+ if (opType == 0) {
+ if (iCompress & PDF_IMAGE_LOSSLESS_COMPRESS) {
+ if (pBitmap->GetBPP() == 1) {
+ _JBIG2EncodeBitmap(pDict, pBitmap, m_pDocument, dest_buf, dest_size, TRUE);
+ }
+ } else {
+ if (pBitmap->GetBPP() == 1) {
+ _JBIG2EncodeBitmap(pDict, pBitmap, m_pDocument, dest_buf, dest_size, FALSE);
+ } else if (pBitmap->GetBPP() >= 8 && pBitmap->GetPalette() != NULL) {
+ CFX_DIBitmap *pNewBitmap = FX_NEW CFX_DIBitmap();
+ pNewBitmap->Copy(pBitmap);
+ pNewBitmap->ConvertFormat(FXDIB_Rgb);
+ SetImage(pNewBitmap, iCompress, pFileWrite, pFileRead);
+ if (pDict) {
+ pDict->Release();
+ pDict = NULL;
+ }
+ if (dest_buf) {
+ FX_Free(dest_buf);
+ dest_buf = NULL;
+ }
+ dest_size = 0;
+ delete pNewBitmap;
+ return;
+ } else {
+ if (bUseMatte) {
+ CFX_DIBitmap *pNewBitmap = FX_NEW CFX_DIBitmap();
+ pNewBitmap->Create(BitmapWidth, BitmapHeight, FXDIB_Argb);
+ FX_LPBYTE dst_buf = pNewBitmap->GetBuffer();
+ FX_INT32 src_offset = 0;
+ for (FX_INT32 row = 0; row < BitmapHeight; row ++) {
+ src_offset = row * src_pitch;
+ for (FX_INT32 column = 0; column < BitmapWidth; column ++) {
+ FX_FLOAT alpha = src_buf[src_offset + 3] / 255.0f;
+ dst_buf[src_offset] = (FX_BYTE)(src_buf[src_offset] * alpha);
+ dst_buf[src_offset + 1] = (FX_BYTE)(src_buf[src_offset + 1] * alpha);
+ dst_buf[src_offset + 2] = (FX_BYTE)(src_buf[src_offset + 2] * alpha);
+ dst_buf[src_offset + 3] = (FX_BYTE)(src_buf[src_offset + 3]);
+ src_offset += 4;
+ }
+ }
+ _DCTEncodeBitmap(pDict, pNewBitmap, pParam ? pParam->nQuality : 75, dest_buf, dest_size);
+ delete pNewBitmap;
+ } else {
+ _DCTEncodeBitmap(pDict, pBitmap, pParam ? pParam->nQuality : 75, dest_buf, dest_size);
+ }
+ }
+ }
+ if (bStream) {
+ pFileWrite->WriteBlock(dest_buf, dest_size);
+ FX_Free(dest_buf);
+ dest_buf = NULL;
+ }
+ } else if (opType == 1) {
+ if (!bStream) {
+ dest_size = dest_pitch * BitmapHeight;
+ dest_buf = FX_Alloc(FX_BYTE, dest_size);
+ }
+ FX_LPBYTE pDest = dest_buf;
+ for (FX_INT32 i = 0; i < BitmapHeight; i ++) {
+ if (!bStream) {
+ FXSYS_memcpy32(pDest, src_buf, dest_pitch);
+ pDest += dest_pitch;
+ } else {
+ pFileWrite->WriteBlock(src_buf, dest_pitch);
+ }
+ src_buf += src_pitch;
+ }
+ } else if (opType == 2) {
+ if (!bStream) {
+ dest_size = dest_pitch * BitmapHeight;
+ dest_buf = FX_Alloc(FX_BYTE, dest_size);
+ } else {
+ dest_buf = FX_Alloc(FX_BYTE, dest_pitch);
+ }
+ FX_LPBYTE pDest = dest_buf;
+ FX_INT32 src_offset = 0;
+ FX_INT32 dest_offset = 0;
+ for (FX_INT32 row = 0; row < BitmapHeight; row ++) {
+ src_offset = row * src_pitch;
+ for (FX_INT32 column = 0; column < BitmapWidth; column ++) {
+ FX_FLOAT alpha = bUseMatte ? src_buf[src_offset + 3] / 255.0f : 1;
+ pDest[dest_offset] = (FX_BYTE)(src_buf[src_offset + 2] * alpha);
+ pDest[dest_offset + 1] = (FX_BYTE)(src_buf[src_offset + 1] * alpha);
+ pDest[dest_offset + 2] = (FX_BYTE)(src_buf[src_offset] * alpha);
+ dest_offset += 3;
+ src_offset += bpp == 24 ? 3 : 4;
+ }
+ if (bStream) {
+ pFileWrite->WriteBlock(pDest, dest_pitch);
+ pDest = dest_buf;
+ } else {
+ pDest += dest_pitch;
+ }
+ dest_offset = 0;
+ }
+ if (bStream) {
+ FX_Free(dest_buf);
+ dest_buf = NULL;
+ }
+ }
+ if (m_pStream == NULL) {
+ m_pStream = FX_NEW CPDF_Stream(NULL, 0, NULL);
+ }
+ if (!bStream) {
+ m_pStream->InitStream(dest_buf, dest_size, pDict);
+ } else {
+ pFileWrite->Flush();
+ m_pStream->InitStream(pFileRead, pDict);
+ }
+ m_bIsMask = pBitmap->IsAlphaMask();
+ m_Width = BitmapWidth;
+ m_Height = BitmapHeight;
+ if (dest_buf) {
+ FX_Free(dest_buf);
+ }
+}
+void CPDF_Image::ResetCache(CPDF_Page* pPage, const CFX_DIBitmap* pBitmap)
+{
+ pPage->GetRenderCache()->ResetBitmap(m_pStream, pBitmap);
+}
diff --git a/core/src/fpdfapi/fpdf_font/common.h b/core/src/fpdfapi/fpdf_font/common.h
index 1c11b281a4..4b37a44ccc 100644
--- a/core/src/fpdfapi/fpdf_font/common.h
+++ b/core/src/fpdfapi/fpdf_font/common.h
@@ -1,17 +1,17 @@
-// 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 COMMON_H
-#define COMMON_H
-typedef signed char TT_int8_t;
-typedef unsigned char TT_uint8_t;
-typedef signed short TT_int16_t;
-typedef unsigned short TT_uint16_t;
-typedef FX_INT32 TT_int32_t;
-typedef FX_DWORD TT_uint32_t;
-typedef FX_INT64 TT_int64_t;
-typedef FX_UINT64 TT_uint64_t;
-#endif
+// 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 COMMON_H
+#define COMMON_H
+typedef signed char TT_int8_t;
+typedef unsigned char TT_uint8_t;
+typedef signed short TT_int16_t;
+typedef unsigned short TT_uint16_t;
+typedef FX_INT32 TT_int32_t;
+typedef FX_DWORD TT_uint32_t;
+typedef FX_INT64 TT_int64_t;
+typedef FX_UINT64 TT_uint64_t;
+#endif
diff --git a/core/src/fpdfapi/fpdf_font/font_int.h b/core/src/fpdfapi/fpdf_font/font_int.h
index 779f58ee5d..b151d78b51 100644
--- a/core/src/fpdfapi/fpdf_font/font_int.h
+++ b/core/src/fpdfapi/fpdf_font/font_int.h
@@ -1,201 +1,201 @@
-// 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
-
-typedef void* FXFT_Library;
-class CPDF_CMapManager : public CFX_Object
-{
-public:
- CPDF_CMapManager();
- ~CPDF_CMapManager();
- FX_LPVOID GetPackage(FX_BOOL bPrompt);
- CPDF_CMap* GetPredefinedCMap(const CFX_ByteString& name, FX_BOOL bPrompt);
- CPDF_CID2UnicodeMap* GetCID2UnicodeMap(int charset, FX_BOOL bPrompt);
- void ReloadAll();
-private:
- CPDF_CMap* LoadPredefinedCMap(const CFX_ByteString& name, FX_BOOL bPrompt);
- CPDF_CID2UnicodeMap* LoadCID2UnicodeMap(int charset, FX_BOOL bPrompt);
- void DropAll(FX_BOOL bReload);
-#ifndef _FPDFAPI_MINI_
- FX_BOOL m_bPrompted;
- FX_LPVOID m_pPackage;
-#endif
- CFX_MapByteStringToPtr m_CMaps;
- CPDF_CID2UnicodeMap* m_CID2UnicodeMaps[6];
-};
-class CPDF_FontGlobals : public CFX_Object
-{
-public:
- CPDF_FontGlobals();
- ~CPDF_FontGlobals();
- void ClearAll();
- void Clear(void* key);
- CPDF_Font* Find(void* key, int index);
- void Set(void* key, int index, CPDF_Font* pFont);
- CFX_MapPtrToPtr m_pStockMap;
- CPDF_CMapManager m_CMapManager;
- struct {
- const struct FXCMAP_CMap* m_pMapList;
- int m_Count;
- } m_EmbeddedCharsets[5];
- struct {
- const FX_WORD* m_pMap;
- int m_Count;
- } m_EmbeddedToUnicodes[5];
- FX_LPBYTE m_pContrastRamps;
-};
-struct _CMap_CodeRange {
- int m_CharSize;
- FX_BYTE m_Lower[4];
- FX_BYTE m_Upper[4];
-};
-class CPDF_CMapParser : public CFX_Object
-{
-public:
- CPDF_CMapParser();
- ~CPDF_CMapParser() {}
- FX_BOOL Initialize(CPDF_CMap*);
- void ParseWord(FX_BSTR str);
- CFX_BinaryBuf m_AddMaps;
-private:
- CPDF_CMap* m_pCMap;
- int m_Status;
- int m_CodeSeq;
- FX_DWORD m_CodePoints[4];
- CFX_ArrayTemplate<_CMap_CodeRange> m_CodeRanges;
- CFX_ByteString m_Registry, m_Ordering, m_Supplement;
- CFX_ByteString m_LastWord;
-};
-#define CIDCODING_UNKNOWN 0
-#define CIDCODING_GB 1
-#define CIDCODING_BIG5 2
-#define CIDCODING_JIS 3
-#define CIDCODING_KOREA 4
-#define CIDCODING_UCS2 5
-#define CIDCODING_CID 6
-#define CIDCODING_UTF16 7
-class CPDF_CMap : public CFX_Object
-{
-public:
- CPDF_CMap();
- FX_BOOL LoadPredefined(CPDF_CMapManager* pMgr, const FX_CHAR* name, FX_BOOL bPromptCJK);
- FX_BOOL LoadEmbedded(FX_LPCBYTE pData, FX_DWORD dwSize);
- void Release();
- FX_BOOL IsLoaded() const
- {
- return m_bLoaded;
- }
- int GetCharset()
- {
- return m_Charset;
- }
- FX_BOOL IsVertWriting() const
- {
- return m_bVertical;
- }
- FX_WORD CIDFromCharCode(FX_DWORD charcode) const;
- FX_DWORD CharCodeFromCID(FX_WORD CID) const;
- int GetCharSize(FX_DWORD charcode) const;
- FX_DWORD GetNextChar(const FX_CHAR* pString, int& offset) const;
- int CountChar(const FX_CHAR* pString, int size) const;
- int AppendChar(FX_LPSTR str, FX_DWORD charcode) const;
- typedef enum {OneByte, TwoBytes, MixedTwoBytes, MixedFourBytes} CodingScheme;
-protected:
- ~CPDF_CMap();
- friend class CPDF_CMapParser;
- friend class CPDF_CMapManager;
- friend class CPDF_CIDFont;
-protected:
- CFX_ByteString m_PredefinedCMap;
- FX_BOOL m_bVertical;
- int m_Charset, m_Coding;
- CodingScheme m_CodingScheme;
- int m_nCodeRanges;
- FX_BYTE* m_pLeadingBytes;
- FX_WORD* m_pMapping;
- FX_LPBYTE m_pAddMapping;
- FX_BOOL m_bLoaded;
- const FXCMAP_CMap* m_pEmbedMap;
- CPDF_CMap* m_pUseMap;
-};
-class CPDF_PredefinedCMap
-{
-public:
- FX_LPCSTR m_pName;
- int m_Charset;
- int m_Coding;
- CPDF_CMap::CodingScheme m_CodingScheme;
- FX_DWORD m_LeadingSegCount;
- FX_BYTE m_LeadingSegs[4];
-};
-typedef struct _FileHeader {
- FX_BYTE btTag[4];
- FX_BYTE btVersion;
- FX_BYTE btFormat;
- FX_BYTE btReserved1[2];
- FX_DWORD dwStartIndex;
- FX_DWORD dwEndIndex;
- FX_DWORD dwDataSize;
- FX_DWORD dwDataOffset;
- FX_DWORD dwRecordSize;
-} FXMP_FILEHEADER;
-class CPDF_FXMP : public CFX_Object
-{
-public:
- CPDF_FXMP()
- {
- m_pHeader = NULL;
- m_pTable = NULL;
- }
- ~CPDF_FXMP()
- {
- if (m_pHeader) {
- FX_Free(m_pHeader);
- }
- }
- FX_BOOL IsLoaded()
- {
- return m_pTable != NULL;
- }
- FX_BOOL LoadFile(FX_LPVOID pPackage, FX_LPCSTR fileid);
- FX_LPBYTE GetRecord(FX_DWORD index);
-private:
- FXMP_FILEHEADER* m_pHeader;
- FX_LPBYTE m_pTable;
-};
-class CPDF_CID2UnicodeMap : public CFX_Object
-{
-public:
- CPDF_CID2UnicodeMap();
- ~CPDF_CID2UnicodeMap();
- FX_BOOL Initialize();
- FX_BOOL IsLoaded();
- void Load(CPDF_CMapManager* pMgr, int charset, FX_BOOL bPromptCJK);
- FX_WCHAR UnicodeFromCID(FX_WORD CID);
-protected:
- int m_Charset;
- const FX_WORD* m_pEmbeddedMap;
- FX_DWORD m_EmbeddedCount;
-#ifndef _FPDFAPI_MINI_
- CPDF_FXMP* m_pExternalMap;
-#endif
-};
-class CPDF_ToUnicodeMap : public CFX_Object
-{
-public:
- void Load(CPDF_Stream* pStream);
- CFX_WideString Lookup(FX_DWORD charcode);
- FX_DWORD ReverseLookup(FX_WCHAR unicode);
-protected:
- CFX_CMapDWordToDWord m_Map;
- CPDF_CID2UnicodeMap* m_pBaseMap;
- CFX_WideTextBuf m_MultiCharBuf;
-};
-class CPDF_FontCharMap : public CFX_CharMap, public CFX_Object
-{
-public:
- CPDF_FontCharMap(CPDF_Font* pFont);
- CPDF_Font* m_pFont;
-};
+// 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
+
+typedef void* FXFT_Library;
+class CPDF_CMapManager : public CFX_Object
+{
+public:
+ CPDF_CMapManager();
+ ~CPDF_CMapManager();
+ FX_LPVOID GetPackage(FX_BOOL bPrompt);
+ CPDF_CMap* GetPredefinedCMap(const CFX_ByteString& name, FX_BOOL bPrompt);
+ CPDF_CID2UnicodeMap* GetCID2UnicodeMap(int charset, FX_BOOL bPrompt);
+ void ReloadAll();
+private:
+ CPDF_CMap* LoadPredefinedCMap(const CFX_ByteString& name, FX_BOOL bPrompt);
+ CPDF_CID2UnicodeMap* LoadCID2UnicodeMap(int charset, FX_BOOL bPrompt);
+ void DropAll(FX_BOOL bReload);
+#ifndef _FPDFAPI_MINI_
+ FX_BOOL m_bPrompted;
+ FX_LPVOID m_pPackage;
+#endif
+ CFX_MapByteStringToPtr m_CMaps;
+ CPDF_CID2UnicodeMap* m_CID2UnicodeMaps[6];
+};
+class CPDF_FontGlobals : public CFX_Object
+{
+public:
+ CPDF_FontGlobals();
+ ~CPDF_FontGlobals();
+ void ClearAll();
+ void Clear(void* key);
+ CPDF_Font* Find(void* key, int index);
+ void Set(void* key, int index, CPDF_Font* pFont);
+ CFX_MapPtrToPtr m_pStockMap;
+ CPDF_CMapManager m_CMapManager;
+ struct {
+ const struct FXCMAP_CMap* m_pMapList;
+ int m_Count;
+ } m_EmbeddedCharsets[5];
+ struct {
+ const FX_WORD* m_pMap;
+ int m_Count;
+ } m_EmbeddedToUnicodes[5];
+ FX_LPBYTE m_pContrastRamps;
+};
+struct _CMap_CodeRange {
+ int m_CharSize;
+ FX_BYTE m_Lower[4];
+ FX_BYTE m_Upper[4];
+};
+class CPDF_CMapParser : public CFX_Object
+{
+public:
+ CPDF_CMapParser();
+ ~CPDF_CMapParser() {}
+ FX_BOOL Initialize(CPDF_CMap*);
+ void ParseWord(FX_BSTR str);
+ CFX_BinaryBuf m_AddMaps;
+private:
+ CPDF_CMap* m_pCMap;
+ int m_Status;
+ int m_CodeSeq;
+ FX_DWORD m_CodePoints[4];
+ CFX_ArrayTemplate<_CMap_CodeRange> m_CodeRanges;
+ CFX_ByteString m_Registry, m_Ordering, m_Supplement;
+ CFX_ByteString m_LastWord;
+};
+#define CIDCODING_UNKNOWN 0
+#define CIDCODING_GB 1
+#define CIDCODING_BIG5 2
+#define CIDCODING_JIS 3
+#define CIDCODING_KOREA 4
+#define CIDCODING_UCS2 5
+#define CIDCODING_CID 6
+#define CIDCODING_UTF16 7
+class CPDF_CMap : public CFX_Object
+{
+public:
+ CPDF_CMap();
+ FX_BOOL LoadPredefined(CPDF_CMapManager* pMgr, const FX_CHAR* name, FX_BOOL bPromptCJK);
+ FX_BOOL LoadEmbedded(FX_LPCBYTE pData, FX_DWORD dwSize);
+ void Release();
+ FX_BOOL IsLoaded() const
+ {
+ return m_bLoaded;
+ }
+ int GetCharset()
+ {
+ return m_Charset;
+ }
+ FX_BOOL IsVertWriting() const
+ {
+ return m_bVertical;
+ }
+ FX_WORD CIDFromCharCode(FX_DWORD charcode) const;
+ FX_DWORD CharCodeFromCID(FX_WORD CID) const;
+ int GetCharSize(FX_DWORD charcode) const;
+ FX_DWORD GetNextChar(const FX_CHAR* pString, int& offset) const;
+ int CountChar(const FX_CHAR* pString, int size) const;
+ int AppendChar(FX_LPSTR str, FX_DWORD charcode) const;
+ typedef enum {OneByte, TwoBytes, MixedTwoBytes, MixedFourBytes} CodingScheme;
+protected:
+ ~CPDF_CMap();
+ friend class CPDF_CMapParser;
+ friend class CPDF_CMapManager;
+ friend class CPDF_CIDFont;
+protected:
+ CFX_ByteString m_PredefinedCMap;
+ FX_BOOL m_bVertical;
+ int m_Charset, m_Coding;
+ CodingScheme m_CodingScheme;
+ int m_nCodeRanges;
+ FX_BYTE* m_pLeadingBytes;
+ FX_WORD* m_pMapping;
+ FX_LPBYTE m_pAddMapping;
+ FX_BOOL m_bLoaded;
+ const FXCMAP_CMap* m_pEmbedMap;
+ CPDF_CMap* m_pUseMap;
+};
+class CPDF_PredefinedCMap
+{
+public:
+ FX_LPCSTR m_pName;
+ int m_Charset;
+ int m_Coding;
+ CPDF_CMap::CodingScheme m_CodingScheme;
+ FX_DWORD m_LeadingSegCount;
+ FX_BYTE m_LeadingSegs[4];
+};
+typedef struct _FileHeader {
+ FX_BYTE btTag[4];
+ FX_BYTE btVersion;
+ FX_BYTE btFormat;
+ FX_BYTE btReserved1[2];
+ FX_DWORD dwStartIndex;
+ FX_DWORD dwEndIndex;
+ FX_DWORD dwDataSize;
+ FX_DWORD dwDataOffset;
+ FX_DWORD dwRecordSize;
+} FXMP_FILEHEADER;
+class CPDF_FXMP : public CFX_Object
+{
+public:
+ CPDF_FXMP()
+ {
+ m_pHeader = NULL;
+ m_pTable = NULL;
+ }
+ ~CPDF_FXMP()
+ {
+ if (m_pHeader) {
+ FX_Free(m_pHeader);
+ }
+ }
+ FX_BOOL IsLoaded()
+ {
+ return m_pTable != NULL;
+ }
+ FX_BOOL LoadFile(FX_LPVOID pPackage, FX_LPCSTR fileid);
+ FX_LPBYTE GetRecord(FX_DWORD index);
+private:
+ FXMP_FILEHEADER* m_pHeader;
+ FX_LPBYTE m_pTable;
+};
+class CPDF_CID2UnicodeMap : public CFX_Object
+{
+public:
+ CPDF_CID2UnicodeMap();
+ ~CPDF_CID2UnicodeMap();
+ FX_BOOL Initialize();
+ FX_BOOL IsLoaded();
+ void Load(CPDF_CMapManager* pMgr, int charset, FX_BOOL bPromptCJK);
+ FX_WCHAR UnicodeFromCID(FX_WORD CID);
+protected:
+ int m_Charset;
+ const FX_WORD* m_pEmbeddedMap;
+ FX_DWORD m_EmbeddedCount;
+#ifndef _FPDFAPI_MINI_
+ CPDF_FXMP* m_pExternalMap;
+#endif
+};
+class CPDF_ToUnicodeMap : public CFX_Object
+{
+public:
+ void Load(CPDF_Stream* pStream);
+ CFX_WideString Lookup(FX_DWORD charcode);
+ FX_DWORD ReverseLookup(FX_WCHAR unicode);
+protected:
+ CFX_CMapDWordToDWord m_Map;
+ CPDF_CID2UnicodeMap* m_pBaseMap;
+ CFX_WideTextBuf m_MultiCharBuf;
+};
+class CPDF_FontCharMap : public CFX_CharMap, public CFX_Object
+{
+public:
+ CPDF_FontCharMap(CPDF_Font* pFont);
+ CPDF_Font* m_pFont;
+};
diff --git a/core/src/fpdfapi/fpdf_font/fpdf_font.cpp b/core/src/fpdfapi/fpdf_font/fpdf_font.cpp
index 886199b120..4bec3337b1 100644
--- a/core/src/fpdfapi/fpdf_font/fpdf_font.cpp
+++ b/core/src/fpdfapi/fpdf_font/fpdf_font.cpp
@@ -1,1763 +1,1763 @@
-// 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
-
-#include "../../../include/fpdfapi/fpdf_page.h"
-#include "../../../include/fpdfapi/fpdf_module.h"
-#include "../../../include/fpdfapi/fpdf_pageobj.h"
-#include "font_int.h"
-#include "../fpdf_page/pageint.h"
-#include "../../../include/fxge/fx_freetype.h"
-FX_BOOL FT_UseTTCharmap(FXFT_Face face, int platform_id, int encoding_id)
-{
- for (int i = 0; i < FXFT_Get_Face_CharmapCount(face); i ++) {
- if (FXFT_Get_Charmap_PlatformID(FXFT_Get_Face_Charmaps(face)[i]) == platform_id &&
- FXFT_Get_Charmap_EncodingID(FXFT_Get_Face_Charmaps(face)[i]) == encoding_id) {
- FXFT_Set_Charmap(face, FXFT_Get_Face_Charmaps(face)[i]);
- return TRUE;
- }
- }
- return FALSE;
-}
-extern const FX_WORD* PDF_UnicodesForPredefinedCharSet(int);
-CPDF_FontGlobals::CPDF_FontGlobals()
-{
- FXSYS_memset32(m_EmbeddedCharsets, 0, sizeof m_EmbeddedCharsets);
- FXSYS_memset32(m_EmbeddedToUnicodes, 0, sizeof m_EmbeddedToUnicodes);
- m_pContrastRamps = NULL;
-}
-CPDF_FontGlobals::~CPDF_FontGlobals()
-{
- ClearAll();
- if (m_pContrastRamps) {
- FX_Free(m_pContrastRamps);
- }
-}
-class CFX_StockFontArray : public CFX_Object
-{
-public:
- CFX_StockFontArray()
- {
- FXSYS_memset32(m_pStockFonts, 0, sizeof(CPDF_Font*) * 14);
- }
- CPDF_Font* m_pStockFonts[14];
-};
-CPDF_Font* CPDF_FontGlobals::Find(void* key, int index)
-{
- void* value = NULL;
- if (!m_pStockMap.Lookup(key, value)) {
- return NULL;
- }
- if (!value) {
- return NULL;
- }
- return ((CFX_StockFontArray*)value)->m_pStockFonts[index];
-}
-void CPDF_FontGlobals::Set(void* key, int index, CPDF_Font* pFont)
-{
- void* value = NULL;
- if (m_pStockMap.Lookup(key, value)) {
- ((CFX_StockFontArray*)value)->m_pStockFonts[index] = pFont;
- return;
- }
- CFX_StockFontArray* pFonts = FX_NEW CFX_StockFontArray();
- if (pFonts) {
- pFonts->m_pStockFonts[index] = pFont;
- }
- m_pStockMap.SetAt(key, pFonts);
-}
-void CPDF_FontGlobals::Clear(void* key)
-{
- void* value = NULL;
- if (!m_pStockMap.Lookup(key, value)) {
- return;
- }
- if (value) {
- CFX_StockFontArray* pStockFonts = (CFX_StockFontArray*)value;
- for (int i = 0; i < 14; i ++) {
- if (pStockFonts->m_pStockFonts[i]) {
- pStockFonts->m_pStockFonts[i]->GetFontDict()->Release();
- delete pStockFonts->m_pStockFonts[i];
- }
- }
- delete pStockFonts;
- }
- m_pStockMap.RemoveKey(key);
-}
-void CPDF_FontGlobals::ClearAll()
-{
- FX_POSITION pos = m_pStockMap.GetStartPosition();
- while (pos) {
- void *key = NULL;
- void* value = NULL;
- m_pStockMap.GetNextAssoc(pos, key, value);
- if (value) {
- CFX_StockFontArray* pStockFonts = (CFX_StockFontArray*)value;
- for (int i = 0; i < 14; i ++) {
- if (pStockFonts->m_pStockFonts[i]) {
- pStockFonts->m_pStockFonts[i]->GetFontDict()->Release();
- delete pStockFonts->m_pStockFonts[i];
- }
- }
- delete pStockFonts;
- }
- m_pStockMap.RemoveKey(key);
- }
-}
-CPDF_Font::CPDF_Font()
-{
- m_FontType = 0;
- m_FontBBox.left = m_FontBBox.right = m_FontBBox.top = m_FontBBox.bottom = 0;
- m_StemV = m_Ascent = m_Descent = m_ItalicAngle = 0;
- m_pFontFile = NULL;
- m_Flags = 0;
- m_pToUnicodeMap = NULL;
- m_bToUnicodeLoaded = FALSE;
- m_pCharMap = NULL;
-}
-FX_BOOL CPDF_Font::Initialize()
-{
- m_pCharMap = FX_NEW CPDF_FontCharMap(this);
- return TRUE;
-}
-CPDF_Font::~CPDF_Font()
-{
- if (m_pCharMap) {
- FX_Free(m_pCharMap);
- m_pCharMap = NULL;
- }
- if (m_pToUnicodeMap) {
- delete m_pToUnicodeMap;
- m_pToUnicodeMap = NULL;
- }
- if (m_pFontFile) {
- m_pDocument->GetPageData()->ReleaseFontFileStreamAcc((CPDF_Stream*)m_pFontFile->GetStream());
- }
-}
-FX_BOOL CPDF_Font::IsVertWriting() const
-{
- FX_BOOL bVertWriting = FALSE;
- CPDF_CIDFont* pCIDFont = GetCIDFont();
- if (pCIDFont) {
- bVertWriting = pCIDFont->IsVertWriting();
- } else {
- bVertWriting = m_Font.IsVertical();
- }
- return bVertWriting;
-}
-CFX_ByteString CPDF_Font::GetFontTypeName() const
-{
- switch (m_FontType) {
- case PDFFONT_TYPE1:
- return FX_BSTRC("Type1");
- case PDFFONT_TRUETYPE:
- return FX_BSTRC("TrueType");
- case PDFFONT_TYPE3:
- return FX_BSTRC("Type3");
- case PDFFONT_CIDFONT:
- return FX_BSTRC("Type0");
- }
- return CFX_ByteString();
-}
-void CPDF_Font::AppendChar(CFX_ByteString& str, FX_DWORD charcode) const
-{
- char buf[4];
- int len = AppendChar(buf, charcode);
- if (len == 1) {
- str += buf[0];
- } else {
- str += CFX_ByteString(buf, len);
- }
-}
-CFX_WideString CPDF_Font::UnicodeFromCharCode(FX_DWORD charcode) const
-{
- if (!m_bToUnicodeLoaded) {
- ((CPDF_Font*)this)->LoadUnicodeMap();
- }
- if (m_pToUnicodeMap) {
- CFX_WideString wsRet = m_pToUnicodeMap->Lookup(charcode);
- if (!wsRet.IsEmpty()) {
- return wsRet;
- }
- }
- FX_WCHAR unicode = _UnicodeFromCharCode(charcode);
- if (unicode == 0) {
- return CFX_WideString();
- }
- return unicode;
-}
-FX_DWORD CPDF_Font::CharCodeFromUnicode(FX_WCHAR unicode) const
-{
- if (!m_bToUnicodeLoaded) {
- ((CPDF_Font*)this)->LoadUnicodeMap();
- }
- if (m_pToUnicodeMap) {
- FX_DWORD charcode = m_pToUnicodeMap->ReverseLookup(unicode);
- if (charcode) {
- return charcode;
- }
- }
- return _CharCodeFromUnicode(unicode);
-}
-CFX_WideString CPDF_Font::DecodeString(const CFX_ByteString& str) const
-{
- CFX_WideString result;
- int src_len = str.GetLength();
- result.Reserve(src_len);
- FX_LPCSTR src_buf = str;
- int src_pos = 0;
- while (src_pos < src_len) {
- FX_DWORD charcode = GetNextChar(src_buf, src_pos);
- CFX_WideString unicode = UnicodeFromCharCode(charcode);
- if (!unicode.IsEmpty()) {
- result += unicode;
- } else {
- result += (FX_WCHAR)charcode;
- }
- }
- return result;
-}
-CFX_ByteString CPDF_Font::EncodeString(const CFX_WideString& str) const
-{
- CFX_ByteString result;
- int src_len = str.GetLength();
- FX_LPSTR dest_buf = result.GetBuffer(src_len * 2);
- FX_LPCWSTR src_buf = str;
- int dest_pos = 0;
- for (int src_pos = 0; src_pos < src_len; src_pos ++) {
- FX_DWORD charcode = CharCodeFromUnicode(src_buf[src_pos]);
- dest_pos += AppendChar(dest_buf + dest_pos, charcode);
- }
- result.ReleaseBuffer(dest_pos);
- return result;
-}
-void CPDF_Font::LoadFontDescriptor(CPDF_Dictionary* pFontDesc)
-{
- m_Flags = pFontDesc->GetInteger(FX_BSTRC("Flags"), PDFFONT_NONSYMBOLIC);
- int ItalicAngle = 0;
- FX_BOOL bExistItalicAngle = FALSE;
- if (pFontDesc->KeyExist(FX_BSTRC("ItalicAngle"))) {
- ItalicAngle = pFontDesc->GetInteger(FX_BSTRC("ItalicAngle"));
- bExistItalicAngle = TRUE;
- }
- if (ItalicAngle < 0) {
- m_Flags |= PDFFONT_ITALIC;
- m_ItalicAngle = ItalicAngle;
- }
- FX_BOOL bExistStemV = FALSE;
- if (pFontDesc->KeyExist(FX_BSTRC("StemV"))) {
- m_StemV = pFontDesc->GetInteger(FX_BSTRC("StemV"));
- bExistStemV = TRUE;
- }
- FX_BOOL bExistAscent = FALSE;
- if (pFontDesc->KeyExist(FX_BSTRC("Ascent"))) {
- m_Ascent = pFontDesc->GetInteger(FX_BSTRC("Ascent"));
- bExistAscent = TRUE;
- }
- FX_BOOL bExistDescent = FALSE;
- if (pFontDesc->KeyExist(FX_BSTRC("Descent"))) {
- m_Descent = pFontDesc->GetInteger(FX_BSTRC("Descent"));
- bExistDescent = TRUE;
- }
- FX_BOOL bExistCapHeight = FALSE;
- if (pFontDesc->KeyExist(FX_BSTRC("CapHeight"))) {
- bExistCapHeight = TRUE;
- }
- if (bExistItalicAngle && bExistAscent && bExistCapHeight && bExistDescent && bExistStemV) {
- m_Flags |= PDFFONT_USEEXTERNATTR;
- }
- if (m_Descent > 10) {
- m_Descent = -m_Descent;
- }
- CPDF_Array* pBBox = pFontDesc->GetArray(FX_BSTRC("FontBBox"));
- if (pBBox) {
- m_FontBBox.left = pBBox->GetInteger(0);
- m_FontBBox.bottom = pBBox->GetInteger(1);
- m_FontBBox.right = pBBox->GetInteger(2);
- m_FontBBox.top = pBBox->GetInteger(3);
- }
- CPDF_Stream* pFontFile = pFontDesc->GetStream(FX_BSTRC("FontFile"));
- if (pFontFile == NULL) {
- pFontFile = pFontDesc->GetStream(FX_BSTRC("FontFile2"));
- }
- if (pFontFile == NULL) {
- pFontFile = pFontDesc->GetStream(FX_BSTRC("FontFile3"));
- }
- if (pFontFile) {
- m_pFontFile = m_pDocument->LoadFontFile(pFontFile);
- if (m_pFontFile == NULL) {
- return;
- }
- FX_LPCBYTE pFontData = m_pFontFile->GetData();
- FX_DWORD dwFontSize = m_pFontFile->GetSize();
- m_Font.LoadEmbedded(pFontData, dwFontSize);
- if (m_Font.m_Face == NULL) {
- m_pFontFile = NULL;
- }
- }
-}
-short TT2PDF(int m, FXFT_Face face)
-{
- int upm = FXFT_Get_Face_UnitsPerEM(face);
- if (upm == 0) {
- return (short)m;
- }
- return (m * 1000 + upm / 2) / upm;
-}
-void CPDF_Font::CheckFontMetrics()
-{
- if (m_FontBBox.top == 0 && m_FontBBox.bottom == 0 && m_FontBBox.left == 0 && m_FontBBox.right == 0) {
- if (m_Font.m_Face) {
- m_FontBBox.left = TT2PDF(FXFT_Get_Face_xMin(m_Font.m_Face), m_Font.m_Face);
- m_FontBBox.bottom = TT2PDF(FXFT_Get_Face_yMin(m_Font.m_Face), m_Font.m_Face);
- m_FontBBox.right = TT2PDF(FXFT_Get_Face_xMax(m_Font.m_Face), m_Font.m_Face);
- m_FontBBox.top = TT2PDF(FXFT_Get_Face_yMax(m_Font.m_Face), m_Font.m_Face);
- m_Ascent = TT2PDF(FXFT_Get_Face_Ascender(m_Font.m_Face), m_Font.m_Face);
- m_Descent = TT2PDF(FXFT_Get_Face_Descender(m_Font.m_Face), m_Font.m_Face);
- } else {
- FX_BOOL bFirst = TRUE;
- for (int i = 0; i < 256; i ++) {
- FX_RECT rect;
- GetCharBBox(i, rect);
- if (rect.left == rect.right) {
- continue;
- }
- if (bFirst) {
- m_FontBBox = rect;
- bFirst = FALSE;
- } else {
- if (m_FontBBox.top < rect.top) {
- m_FontBBox.top = rect.top;
- }
- if (m_FontBBox.right < rect.right) {
- m_FontBBox.right = rect.right;
- }
- if (m_FontBBox.left > rect.left) {
- m_FontBBox.left = rect.left;
- }
- if (m_FontBBox.bottom > rect.bottom) {
- m_FontBBox.bottom = rect.bottom;
- }
- }
- }
- }
- }
- if (m_Ascent == 0 && m_Descent == 0) {
- FX_RECT rect;
- GetCharBBox('A', rect);
- if (rect.bottom == rect.top) {
- m_Ascent = m_FontBBox.top;
- } else {
- m_Ascent = rect.top;
- }
- GetCharBBox('g', rect);
- if (rect.bottom == rect.top) {
- m_Descent = m_FontBBox.bottom;
- } else {
- m_Descent = rect.bottom;
- }
- }
-}
-void CPDF_Font::LoadUnicodeMap()
-{
- m_bToUnicodeLoaded = TRUE;
- CPDF_Stream* pStream = m_pFontDict->GetStream(FX_BSTRC("ToUnicode"));
- if (pStream == NULL) {
- return;
- }
- m_pToUnicodeMap = FX_NEW CPDF_ToUnicodeMap;
- m_pToUnicodeMap->Load(pStream);
-}
-int CPDF_Font::GetStringWidth(FX_LPCSTR pString, int size)
-{
- int offset = 0;
- int width = 0;
- while (offset < size) {
- FX_DWORD charcode = GetNextChar(pString, offset);
- width += GetCharWidthF(charcode);
- }
- return width;
-}
-int CPDF_Font::GetCharTypeWidth(FX_DWORD charcode)
-{
- if (m_Font.m_Face == NULL) {
- return 0;
- }
- int glyph_index = GlyphFromCharCode(charcode);
- if (glyph_index == 0xffff) {
- return 0;
- }
- return m_Font.GetGlyphWidth(glyph_index);
-}
-int _PDF_GetStandardFontName(CFX_ByteString& name);
-CPDF_Font* CPDF_Font::GetStockFont(CPDF_Document* pDoc, FX_BSTR name)
-{
- CFX_ByteString fontname(name);
- int font_id = _PDF_GetStandardFontName(fontname);
- if (font_id < 0) {
- return NULL;
- }
- CPDF_FontGlobals* pFontGlobals = CPDF_ModuleMgr::Get()->GetPageModule()->GetFontGlobals();
- CPDF_Font* pFont = pFontGlobals->Find(pDoc, font_id);
- if (pFont) {
- return pFont;
- }
- CPDF_Dictionary* pDict = CPDF_Dictionary::Create();
- pDict->SetAtName(FX_BSTRC("Type"), FX_BSTRC("Font"));
- pDict->SetAtName(FX_BSTRC("Subtype"), FX_BSTRC("Type1"));
- pDict->SetAtName(FX_BSTRC("BaseFont"), fontname);
- pDict->SetAtName(FX_BSTRC("Encoding"), FX_BSTRC("WinAnsiEncoding"));
- pFont = CPDF_Font::CreateFontF(NULL, pDict);
- pFontGlobals->Set(pDoc, font_id, pFont);
- return pFont;
-}
-const FX_BYTE ChineseFontNames[][5] = {
- {0xCB, 0xCE, 0xCC, 0xE5, 0x00},
- {0xBF, 0xAC, 0xCC, 0xE5, 0x00},
- {0xBA, 0xDA, 0xCC, 0xE5, 0x00},
- {0xB7, 0xC2, 0xCB, 0xCE, 0x00},
- {0xD0, 0xC2, 0xCB, 0xCE, 0x00}
-};
-CPDF_Font* CPDF_Font::CreateFontF(CPDF_Document* pDoc, CPDF_Dictionary* pFontDict)
-{
- CFX_ByteString type = pFontDict->GetString(FX_BSTRC("Subtype"));
- CPDF_Font* pFont;
- if (type == FX_BSTRC("TrueType")) {
- {
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ || _FXM_PLATFORM_ == _FXM_PLATFORM_LINUX_ || _FXM_PLATFORM_ == _FXM_PLATFORM_ANDROID_ || _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
- CFX_ByteString basefont = pFontDict->GetString(FX_BSTRC("BaseFont"));
- CFX_ByteString tag = basefont.Left(4);
- int i;
- int count = sizeof(ChineseFontNames) / sizeof(ChineseFontNames[0]);
- for (i = 0; i < count; ++i) {
- if (tag == CFX_ByteString((FX_LPCSTR)ChineseFontNames[i])) {
- break;
- }
- }
- if (i < count) {
- CPDF_Dictionary* pFontDesc = pFontDict->GetDict(FX_BSTRC("FontDescriptor"));
- if (pFontDesc == NULL || !pFontDesc->KeyExist(FX_BSTRC("FontFile2"))) {
- pFont = FX_NEW CPDF_CIDFont;
- pFont->Initialize();
- pFont->m_FontType = PDFFONT_CIDFONT;
- pFont->m_pFontDict = pFontDict;
- pFont->m_pDocument = pDoc;
- if (!pFont->Load()) {
- delete pFont;
- return NULL;
- }
- return pFont;
- }
- }
-#endif
- }
- pFont = FX_NEW CPDF_TrueTypeFont;
- pFont->Initialize();
- pFont->m_FontType = PDFFONT_TRUETYPE;
- } else if (type == FX_BSTRC("Type3")) {
- pFont = FX_NEW CPDF_Type3Font;
- pFont->Initialize();
- pFont->m_FontType = PDFFONT_TYPE3;
- } else if (type == FX_BSTRC("Type0")) {
- pFont = FX_NEW CPDF_CIDFont;
- pFont->Initialize();
- pFont->m_FontType = PDFFONT_CIDFONT;
- } else {
- pFont = FX_NEW CPDF_Type1Font;
- pFont->Initialize();
- pFont->m_FontType = PDFFONT_TYPE1;
- }
- pFont->m_pFontDict = pFontDict;
- pFont->m_pDocument = pDoc;
- if (!pFont->Load()) {
- delete pFont;
- return NULL;
- }
- return pFont;
-}
-FX_BOOL CPDF_Font::Load()
-{
- if (m_pFontDict == NULL) {
- return FALSE;
- }
- CFX_ByteString type = m_pFontDict->GetString(FX_BSTRC("Subtype"));
- m_BaseFont = m_pFontDict->GetString(FX_BSTRC("BaseFont"));
- if (type == FX_BSTRC("MMType1")) {
- type = FX_BSTRC("Type1");
- }
- return _Load();
-}
-static CFX_WideString _FontMap_GetWideString(CFX_CharMap* pMap, const CFX_ByteString& bytestr)
-{
- return ((CPDF_FontCharMap*)pMap)->m_pFont->DecodeString(bytestr);
-}
-static CFX_ByteString _FontMap_GetByteString(CFX_CharMap* pMap, const CFX_WideString& widestr)
-{
- return ((CPDF_FontCharMap*)pMap)->m_pFont->EncodeString(widestr);
-}
-CPDF_FontCharMap::CPDF_FontCharMap(CPDF_Font* pFont)
-{
- m_GetByteString = _FontMap_GetByteString;
- m_GetWideString = _FontMap_GetWideString;
- m_pFont = pFont;
-}
-CFX_WideString CPDF_ToUnicodeMap::Lookup(FX_DWORD charcode)
-{
- FX_DWORD value;
- if (m_Map.Lookup(charcode, value)) {
- FX_WCHAR unicode = (FX_WCHAR)(value & 0xffff);
- if (unicode != 0xffff) {
- return unicode;
- }
- FX_LPCWSTR buf = m_MultiCharBuf.GetBuffer();
- FX_DWORD buf_len = m_MultiCharBuf.GetLength();
- if (buf == NULL || buf_len == 0) {
- return CFX_WideString();
- }
- FX_DWORD index = value >> 16;
- if (index >= buf_len) {
- return CFX_WideString();
- }
- FX_DWORD len = buf[index];
- if (index + len < index || index + len >= buf_len) {
- return CFX_WideString();
- }
- return CFX_WideString(buf + index + 1, len);
- }
- if (m_pBaseMap) {
- return m_pBaseMap->UnicodeFromCID((FX_WORD)charcode);
- }
- return CFX_WideString();
-}
-FX_DWORD CPDF_ToUnicodeMap::ReverseLookup(FX_WCHAR unicode)
-{
- FX_POSITION pos = m_Map.GetStartPosition();
- while (pos) {
- FX_DWORD key, value;
- m_Map.GetNextAssoc(pos, key, value);
- if ((FX_WCHAR)value == unicode) {
- return key;
- }
- }
- return 0;
-}
-static FX_DWORD _StringToCode(FX_BSTR str)
-{
- FX_LPCSTR buf = str.GetCStr();
- int len = str.GetLength();
- if (len == 0) {
- return 0;
- }
- int result = 0;
- if (buf[0] == '<') {
- for (int i = 1; i < len; i ++) {
- int digit;
- if (buf[i] >= '0' && buf[i] <= '9') {
- digit = buf[i] - '0';
- } else if (buf[i] >= 'a' && buf[i] <= 'f') {
- digit = buf[i] - 'a' + 10;
- } else if (buf[i] >= 'A' && buf[i] <= 'F') {
- digit = buf[i] - 'A' + 10;
- } else {
- break;
- }
- result = result * 16 + digit;
- }
- return result;
- } else {
- for (int i = 0; i < len; i ++) {
- if (buf[i] < '0' || buf[i] > '9') {
- break;
- }
- result = result * 10 + buf[i] - '0';
- }
- }
- return result;
-}
-static CFX_WideString _StringDataAdd(CFX_WideString str)
-{
- CFX_WideString ret;
- int len = str.GetLength();
- FX_WCHAR value = 1;
- for (int i = len - 1; i >= 0 ; --i) {
- FX_WCHAR ch = str[i] + value;
- if (ch < str[i]) {
- ret.Insert(0, 0);
- } else {
- ret.Insert(0, ch);
- value = 0;
- }
- }
- if (value) {
- ret.Insert(0, value);
- }
- return ret;
-}
-static CFX_WideString _StringToWideString(FX_BSTR str)
-{
- FX_LPCSTR buf = str.GetCStr();
- int len = str.GetLength();
- if (len == 0) {
- return CFX_WideString();
- }
- CFX_WideString result;
- if (buf[0] == '<') {
- int byte_pos = 0;
- FX_WCHAR ch = 0;
- for (int i = 1; i < len; i ++) {
- int digit;
- if (buf[i] >= '0' && buf[i] <= '9') {
- digit = buf[i] - '0';
- } else if (buf[i] >= 'a' && buf[i] <= 'f') {
- digit = buf[i] - 'a' + 10;
- } else if (buf[i] >= 'A' && buf[i] <= 'F') {
- digit = buf[i] - 'A' + 10;
- } else {
- break;
- }
- ch = ch * 16 + digit;
- byte_pos ++;
- if (byte_pos == 4) {
- result += ch;
- byte_pos = 0;
- ch = 0;
- }
- }
- return result;
- }
- if (buf[0] == '(') {
- }
- return result;
-}
-void CPDF_ToUnicodeMap::Load(CPDF_Stream* pStream)
-{
- int CIDSet = 0;
- CPDF_StreamAcc stream;
- stream.LoadAllData(pStream, FALSE);
- CPDF_SimpleParser parser(stream.GetData(), stream.GetSize());
- m_Map.EstimateSize(stream.GetSize() / 8, 1024);
- while (1) {
- CFX_ByteStringC word = parser.GetWord();
- if (word.IsEmpty()) {
- break;
- }
- if (word == FX_BSTRC("beginbfchar")) {
- while (1) {
- word = parser.GetWord();
- if (word.IsEmpty() || word == FX_BSTRC("endbfchar")) {
- break;
- }
- FX_DWORD srccode = _StringToCode(word);
- word = parser.GetWord();
- CFX_WideString destcode = _StringToWideString(word);
- int len = destcode.GetLength();
- if (len == 0) {
- continue;
- }
- if (len == 1) {
- m_Map.SetAt(srccode, destcode.GetAt(0));
- } else {
- m_Map.SetAt(srccode, m_MultiCharBuf.GetLength() * 0x10000 + 0xffff);
- m_MultiCharBuf.AppendChar(destcode.GetLength());
- m_MultiCharBuf << destcode;
- }
- }
- } else if (word == FX_BSTRC("beginbfrange")) {
- while (1) {
- CFX_ByteString low, high;
- low = parser.GetWord();
- if (low.IsEmpty() || low == FX_BSTRC("endbfrange")) {
- break;
- }
- high = parser.GetWord();
- FX_DWORD lowcode = _StringToCode(low);
- FX_DWORD highcode = (lowcode & 0xffffff00) | (_StringToCode(high) & 0xff);
- if (highcode == (FX_DWORD) - 1) {
- break;
- }
- CFX_ByteString start = parser.GetWord();
- if (start == FX_BSTRC("[")) {
- for (FX_DWORD code = lowcode; code <= highcode; code ++) {
- CFX_ByteString dest = parser.GetWord();
- CFX_WideString destcode = _StringToWideString(dest);
- int len = destcode.GetLength();
- if (len == 0) {
- continue;
- }
- if (len == 1) {
- m_Map.SetAt(code, destcode.GetAt(0));
- } else {
- m_Map.SetAt(code, m_MultiCharBuf.GetLength() * 0x10000 + 0xffff);
- m_MultiCharBuf.AppendChar(destcode.GetLength());
- m_MultiCharBuf << destcode;
- }
- }
- parser.GetWord();
- } else {
- CFX_WideString destcode = _StringToWideString(start);
- int len = destcode.GetLength();
- FX_DWORD value = 0;
- if (len == 1) {
- value = _StringToCode(start);
- for (FX_DWORD code = lowcode; code <= highcode; code ++) {
- m_Map.SetAt(code, value++);
- }
- } else {
- for (FX_DWORD code = lowcode; code <= highcode; code ++) {
- CFX_WideString retcode;
- if (code == lowcode) {
- retcode = destcode;
- } else {
- retcode = _StringDataAdd(destcode);
- }
- m_Map.SetAt(code, m_MultiCharBuf.GetLength() * 0x10000 + 0xffff);
- m_MultiCharBuf.AppendChar(retcode.GetLength());
- m_MultiCharBuf << retcode;
- destcode = retcode;
- }
- }
- }
- }
- } else if (word == FX_BSTRC("/Adobe-Korea1-UCS2")) {
- CIDSet = CIDSET_KOREA1;
- } else if (word == FX_BSTRC("/Adobe-Japan1-UCS2")) {
- CIDSet = CIDSET_JAPAN1;
- } else if (word == FX_BSTRC("/Adobe-CNS1-UCS2")) {
- CIDSet = CIDSET_CNS1;
- } else if (word == FX_BSTRC("/Adobe-GB1-UCS2")) {
- CIDSet = CIDSET_GB1;
- }
- }
- if (CIDSet) {
- m_pBaseMap = CPDF_ModuleMgr::Get()->GetPageModule()->GetFontGlobals()->m_CMapManager.GetCID2UnicodeMap(CIDSet, FALSE);
- } else {
- m_pBaseMap = NULL;
- }
-}
-static FX_BOOL GetPredefinedEncoding(int& basemap, const CFX_ByteString& value)
-{
- if (value == FX_BSTRC("WinAnsiEncoding")) {
- basemap = PDFFONT_ENCODING_WINANSI;
- } else if (value == FX_BSTRC("MacRomanEncoding")) {
- basemap = PDFFONT_ENCODING_MACROMAN;
- } else if (value == FX_BSTRC("MacExpertEncoding")) {
- basemap = PDFFONT_ENCODING_MACEXPERT;
- } else if (value == FX_BSTRC("PDFDocEncoding")) {
- basemap = PDFFONT_ENCODING_PDFDOC;
- } else {
- return FALSE;
- }
- return TRUE;
-}
-void CPDF_Font::LoadPDFEncoding(CPDF_Object* pEncoding, int& iBaseEncoding, CFX_ByteString*& pCharNames,
- FX_BOOL bEmbedded, FX_BOOL bTrueType)
-{
- if (pEncoding == NULL) {
- if (m_BaseFont == FX_BSTRC("Symbol")) {
- iBaseEncoding = bTrueType ? PDFFONT_ENCODING_MS_SYMBOL : PDFFONT_ENCODING_ADOBE_SYMBOL;
- } else if (!bEmbedded && iBaseEncoding == PDFFONT_ENCODING_BUILTIN) {
- iBaseEncoding = PDFFONT_ENCODING_WINANSI;
- }
- return;
- }
- if (pEncoding->GetType() == PDFOBJ_NAME) {
- if (iBaseEncoding == PDFFONT_ENCODING_ADOBE_SYMBOL || iBaseEncoding == PDFFONT_ENCODING_ZAPFDINGBATS) {
- return;
- }
- if ((m_Flags & PDFFONT_SYMBOLIC) && m_BaseFont == FX_BSTRC("Symbol")) {
- if (!bTrueType) {
- iBaseEncoding = PDFFONT_ENCODING_ADOBE_SYMBOL;
- }
- return;
- }
- CFX_ByteString bsEncoding = pEncoding->GetString();
- if (bsEncoding.Compare(FX_BSTRC("MacExpertEncoding")) == 0) {
- bsEncoding = FX_BSTRC("WinAnsiEncoding");
- }
- GetPredefinedEncoding(iBaseEncoding, bsEncoding);
- return;
- }
- if (pEncoding->GetType() != PDFOBJ_DICTIONARY) {
- return;
- }
- CPDF_Dictionary* pDict = (CPDF_Dictionary*)pEncoding;
- if (iBaseEncoding != PDFFONT_ENCODING_ADOBE_SYMBOL && iBaseEncoding != PDFFONT_ENCODING_ZAPFDINGBATS) {
- CFX_ByteString bsEncoding = pDict->GetString(FX_BSTRC("BaseEncoding"));
- if (bsEncoding.Compare(FX_BSTRC("MacExpertEncoding")) == 0 && bTrueType) {
- bsEncoding = FX_BSTRC("WinAnsiEncoding");
- }
- GetPredefinedEncoding(iBaseEncoding, bsEncoding);
- }
- if ((!bEmbedded || bTrueType) && iBaseEncoding == PDFFONT_ENCODING_BUILTIN) {
- iBaseEncoding = PDFFONT_ENCODING_STANDARD;
- }
- CPDF_Array* pDiffs = pDict->GetArray(FX_BSTRC("Differences"));
- if (pDiffs == NULL) {
- return;
- }
- FX_NEW_VECTOR(pCharNames, CFX_ByteString, 256);
- FX_DWORD cur_code = 0;
- for (FX_DWORD i = 0; i < pDiffs->GetCount(); i ++) {
- CPDF_Object* pElement = pDiffs->GetElementValue(i);
- if (pElement == NULL) {
- continue;
- }
- if (pElement->GetType() == PDFOBJ_NAME) {
- if (cur_code < 256) {
- pCharNames[cur_code] = ((CPDF_Name*)pElement)->GetString();
- }
- cur_code ++;
- } else {
- cur_code = pElement->GetInteger();
- }
- }
-}
-FX_BOOL CPDF_Font::IsStandardFont() const
-{
- if (m_FontType != PDFFONT_TYPE1) {
- return FALSE;
- }
- if (m_pFontFile != NULL) {
- return FALSE;
- }
- if (((CPDF_Type1Font*)this)->GetBase14Font() < 0) {
- return FALSE;
- }
- return TRUE;
-}
-extern FX_LPCSTR PDF_CharNameFromPredefinedCharSet(int encoding, FX_BYTE charcode);
-CPDF_SimpleFont::CPDF_SimpleFont()
-{
- FXSYS_memset8(m_CharBBox, 0xff, sizeof m_CharBBox);
- FXSYS_memset8(m_CharWidth, 0xff, sizeof m_CharWidth);
- FXSYS_memset8(m_GlyphIndex, 0xff, sizeof m_GlyphIndex);
- FXSYS_memset8(m_ExtGID, 0xff, sizeof m_ExtGID);
- m_pCharNames = NULL;
- m_BaseEncoding = PDFFONT_ENCODING_BUILTIN;
-}
-CPDF_SimpleFont::~CPDF_SimpleFont()
-{
- if (m_pCharNames) {
- FX_DELETE_VECTOR(m_pCharNames, CFX_ByteString, 256);
- }
-}
-int CPDF_SimpleFont::GlyphFromCharCode(FX_DWORD charcode, FX_BOOL *pVertGlyph)
-{
- if (pVertGlyph) {
- *pVertGlyph = FALSE;
- }
- if (charcode > 0xff) {
- return -1;
- }
- int index = m_GlyphIndex[(FX_BYTE)charcode];
- if (index == 0xffff) {
- return -1;
- }
- return index;
-}
-void CPDF_SimpleFont::LoadCharMetrics(int charcode)
-{
- if (m_Font.m_Face == NULL) {
- return;
- }
- if (charcode < 0 || charcode > 0xff) {
- return;
- }
- int glyph_index = m_GlyphIndex[charcode];
- if (glyph_index == 0xffff) {
- if (m_pFontFile == NULL && charcode != 32) {
- LoadCharMetrics(32);
- m_CharBBox[charcode] = m_CharBBox[32];
- if (m_bUseFontWidth) {
- m_CharWidth[charcode] = m_CharWidth[32];
- }
- }
- return;
- }
- int err = FXFT_Load_Glyph(m_Font.m_Face, glyph_index, FXFT_LOAD_NO_SCALE | FXFT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH);
- if (err) {
- return;
- }
- m_CharBBox[charcode].Left = TT2PDF(FXFT_Get_Glyph_HoriBearingX(m_Font.m_Face), m_Font.m_Face);
- m_CharBBox[charcode].Right = TT2PDF(FXFT_Get_Glyph_HoriBearingX(m_Font.m_Face) + FXFT_Get_Glyph_Width(m_Font.m_Face), m_Font.m_Face);
- m_CharBBox[charcode].Top = TT2PDF(FXFT_Get_Glyph_HoriBearingY(m_Font.m_Face), m_Font.m_Face);
- m_CharBBox[charcode].Bottom = TT2PDF(FXFT_Get_Glyph_HoriBearingY(m_Font.m_Face) - FXFT_Get_Glyph_Height(m_Font.m_Face), m_Font.m_Face);
- if (m_bUseFontWidth) {
- int TT_Width = TT2PDF(FXFT_Get_Glyph_HoriAdvance(m_Font.m_Face), m_Font.m_Face);
- if (m_CharWidth[charcode] == 0xffff) {
- m_CharWidth[charcode] = TT_Width;
- } else if (TT_Width && !IsEmbedded()) {
- m_CharBBox[charcode].Right = m_CharBBox[charcode].Right * m_CharWidth[charcode] / TT_Width;
- m_CharBBox[charcode].Left = m_CharBBox[charcode].Left * m_CharWidth[charcode] / TT_Width;
- }
- }
-}
-int CPDF_SimpleFont::GetCharWidthF(FX_DWORD charcode, int level)
-{
- if (charcode > 0xff) {
- charcode = 0;
- }
- if (m_CharWidth[charcode] == 0xffff) {
- LoadCharMetrics(charcode);
- if (m_CharWidth[charcode] == 0xffff) {
- m_CharWidth[charcode] = 0;
- }
- }
- return (FX_INT16)m_CharWidth[charcode];
-}
-void CPDF_SimpleFont::GetCharBBox(FX_DWORD charcode, FX_RECT& rect, int level)
-{
- if (charcode > 0xff) {
- charcode = 0;
- }
- if (m_CharBBox[charcode].Left == (FX_SHORT)0xffff) {
- LoadCharMetrics(charcode);
- }
- rect.left = m_CharBBox[charcode].Left;
- rect.right = m_CharBBox[charcode].Right;
- rect.bottom = m_CharBBox[charcode].Bottom;
- rect.top = m_CharBBox[charcode].Top;
-}
-FX_LPCSTR GetAdobeCharName(int iBaseEncoding, const CFX_ByteString* pCharNames, int charcode)
-{
- ASSERT(charcode >= 0 && charcode < 256);
- if (charcode < 0 || charcode >= 256) {
- return NULL;
- }
- FX_LPCSTR name = NULL;
- if (pCharNames) {
- name = pCharNames[charcode];
- }
- if ((name == NULL || name[0] == 0) && iBaseEncoding) {
- name = PDF_CharNameFromPredefinedCharSet(iBaseEncoding, charcode);
- }
- if (name == NULL || name[0] == 0) {
- return NULL;
- }
- return name;
-}
-FX_BOOL CPDF_SimpleFont::LoadCommon()
-{
- CPDF_Dictionary* pFontDesc = m_pFontDict->GetDict(FX_BSTRC("FontDescriptor"));
- if (pFontDesc) {
- LoadFontDescriptor(pFontDesc);
- }
- CPDF_Array* pWidthArray = m_pFontDict->GetArray(FX_BSTRC("Widths"));
- int width_start = 0, width_end = -1;
- m_bUseFontWidth = TRUE;
- if (pWidthArray) {
- m_bUseFontWidth = FALSE;
- if (pFontDesc && pFontDesc->KeyExist(FX_BSTRC("MissingWidth"))) {
- int MissingWidth = pFontDesc->GetInteger(FX_BSTRC("MissingWidth"));
- for (int i = 0; i < 256; i ++) {
- m_CharWidth[i] = MissingWidth;
- }
- }
- width_start = m_pFontDict->GetInteger(FX_BSTRC("FirstChar"), 0);
- width_end = m_pFontDict->GetInteger(FX_BSTRC("LastChar"), 0);
- if (width_start >= 0 && width_start <= 255) {
- if (width_end <= 0 || width_end >= width_start + (int)pWidthArray->GetCount()) {
- width_end = width_start + pWidthArray->GetCount() - 1;
- }
- if (width_end > 255) {
- width_end = 255;
- }
- for (int i = width_start; i <= width_end; i ++) {
- m_CharWidth[i] = pWidthArray->GetInteger(i - width_start);
- }
- }
- }
- if (m_pFontFile == NULL) {
- LoadSubstFont();
- } else {
- if (m_BaseFont.GetLength() > 8 && m_BaseFont[7] == '+') {
- m_BaseFont = m_BaseFont.Mid(8);
- }
- }
- if (!(m_Flags & PDFFONT_SYMBOLIC)) {
- m_BaseEncoding = PDFFONT_ENCODING_STANDARD;
- }
- CPDF_Object* pEncoding = m_pFontDict->GetElementValue(FX_BSTRC("Encoding"));
- LoadPDFEncoding(pEncoding, m_BaseEncoding, m_pCharNames, m_pFontFile != NULL, m_Font.IsTTFont());
- LoadGlyphMap();
- if (m_pCharNames) {
- FX_DELETE_VECTOR(m_pCharNames, CFX_ByteString, 256);
- m_pCharNames = NULL;
- }
- if (m_Font.m_Face == NULL) {
- return TRUE;
- }
- if (m_Flags & PDFFONT_ALLCAP) {
- unsigned char lowercases[] = {'a', 'z', 0xe0, 0xf6, 0xf8, 0xfd};
- for (int range = 0; range < sizeof lowercases / 2; range ++) {
- for (int i = lowercases[range * 2]; i <= lowercases[range * 2 + 1]; i ++) {
- if (m_GlyphIndex[i] != 0xffff && m_pFontFile != NULL) {
- continue;
- }
- m_GlyphIndex[i] = m_GlyphIndex[i - 32];
- if (m_CharWidth[i - 32]) {
- m_CharWidth[i] = m_CharWidth[i - 32];
- m_CharBBox[i] = m_CharBBox[i - 32];
- }
- }
- }
- }
- CheckFontMetrics();
- return TRUE;
-}
-void CPDF_SimpleFont::LoadSubstFont()
-{
- if (!m_bUseFontWidth && !(m_Flags & PDFFONT_FIXEDPITCH)) {
- int width = 0, i;
- for (i = 0; i < 256; i ++) {
- if (m_CharWidth[i] == 0 || m_CharWidth[i] == 0xffff) {
- continue;
- }
- if (width == 0) {
- width = m_CharWidth[i];
- } else if (width != m_CharWidth[i]) {
- break;
- }
- }
- if (i == 256 && width) {
- m_Flags |= PDFFONT_FIXEDPITCH;
- }
- }
- int weight = m_StemV < 140 ? m_StemV * 5 : (m_StemV * 4 + 140);
- m_Font.LoadSubst(m_BaseFont, m_FontType == PDFFONT_TRUETYPE, m_Flags, weight, m_ItalicAngle, 0);
- if (m_Font.m_pSubstFont->m_SubstFlags & FXFONT_SUBST_NONSYMBOL) {
- }
-}
-FX_BOOL CPDF_SimpleFont::IsUnicodeCompatible() const
-{
- return m_BaseEncoding != PDFFONT_ENCODING_BUILTIN && m_BaseEncoding != PDFFONT_ENCODING_ADOBE_SYMBOL &&
- m_BaseEncoding != PDFFONT_ENCODING_ZAPFDINGBATS;
-}
-CPDF_Type1Font::CPDF_Type1Font()
-{
- m_Base14Font = -1;
-}
-FX_BOOL CPDF_Type1Font::_Load()
-{
- m_Base14Font = _PDF_GetStandardFontName(m_BaseFont);
- if (m_Base14Font >= 0) {
- CPDF_Dictionary* pFontDesc = m_pFontDict->GetDict(FX_BSTRC("FontDescriptor"));
- if (pFontDesc && pFontDesc->KeyExist(FX_BSTRC("Flags"))) {
- m_Flags = pFontDesc->GetInteger(FX_BSTRC("Flags"));
- } else {
- m_Flags = m_Base14Font >= 12 ? PDFFONT_SYMBOLIC : PDFFONT_NONSYMBOLIC;
- }
- if (m_Base14Font < 4)
- for (int i = 0; i < 256; i ++) {
- m_CharWidth[i] = 600;
- }
- if (m_Base14Font == 12) {
- m_BaseEncoding = PDFFONT_ENCODING_ADOBE_SYMBOL;
- } else if (m_Base14Font == 13) {
- m_BaseEncoding = PDFFONT_ENCODING_ZAPFDINGBATS;
- } else if (m_Flags & PDFFONT_NONSYMBOLIC) {
- m_BaseEncoding = PDFFONT_ENCODING_STANDARD;
- }
- }
- return LoadCommon();
-}
-static FX_BOOL FT_UseType1Charmap(FXFT_Face face)
-{
- if (FXFT_Get_Face_CharmapCount(face) == 0) {
- return FALSE;
- }
- if (FXFT_Get_Face_CharmapCount(face) == 1 &&
- FXFT_Get_Charmap_Encoding(FXFT_Get_Face_Charmaps(face)[0]) == FXFT_ENCODING_UNICODE) {
- return FALSE;
- }
- if (FXFT_Get_Charmap_Encoding(FXFT_Get_Face_Charmaps(face)[0]) == FXFT_ENCODING_UNICODE) {
- FXFT_Set_Charmap(face, FXFT_Get_Face_Charmaps(face)[1]);
- } else {
- FXFT_Set_Charmap(face, FXFT_Get_Face_Charmaps(face)[0]);
- }
- return TRUE;
-}
-extern FX_WCHAR FT_UnicodeFromCharCode(int encoding, FX_DWORD charcode);
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
-#include "../../fxge/apple/apple_int.h"
-#endif
-int CPDF_Type1Font::GlyphFromCharCodeExt(FX_DWORD charcode)
-{
- if (charcode > 0xff) {
- return -1;
- }
- int index = m_ExtGID[(FX_BYTE)charcode];
- if (index == 0xffff) {
- return -1;
- }
- return index;
-}
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
-struct _GlyphNameMap {
- FX_LPCSTR m_pStrAdobe;
- FX_LPCSTR m_pStrUnicode;
-};
-static const _GlyphNameMap g_GlyphNameSubsts[] = {
- {"ff", "uniFB00"},
- {"fi", "uniFB01"},
- {"fl", "uniFB02"},
- {"ffi", "uniFB03"},
- {"ffl", "uniFB04"}
-};
-extern "C" {
- static int compareString(const void* key, const void* element)
- {
- return FXSYS_stricmp((FX_LPCSTR)key, ((_GlyphNameMap*)element)->m_pStrAdobe);
- }
-}
-static FX_LPCSTR _GlyphNameRemap(FX_LPCSTR pStrAdobe)
-{
- _GlyphNameMap* found = (_GlyphNameMap*)FXSYS_bsearch(pStrAdobe, g_GlyphNameSubsts,
- sizeof g_GlyphNameSubsts / sizeof(_GlyphNameMap), sizeof(_GlyphNameMap),
- compareString);
- if (found) {
- return found->m_pStrUnicode;
- }
- return NULL;
-}
-#endif
-void CPDF_Type1Font::LoadGlyphMap()
-{
- if (m_Font.m_Face == NULL) {
- return;
- }
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
- FX_BOOL bCoreText = TRUE;
- CQuartz2D & quartz2d = ((CApplePlatform *) CFX_GEModule::Get()->GetPlatformData())->_quartz2d;
- if (!m_Font.m_pPlatformFont) {
- if (m_Font.GetPsName() == CFX_WideString::FromLocal("DFHeiStd-W5")) {
- bCoreText = FALSE;
- }
- m_Font.m_pPlatformFont = quartz2d.CreateFont(m_Font.m_pFontData, m_Font.m_dwSize);
- if (NULL == m_Font.m_pPlatformFont) {
- bCoreText = FALSE;
- }
- }
-#endif
- if (!IsEmbedded() && (m_Base14Font < 12) && m_Font.IsTTFont()) {
- if (FT_UseTTCharmap(m_Font.m_Face, 3, 0)) {
- FX_BOOL bGotOne = FALSE;
- for (int charcode = 0; charcode < 256; charcode ++) {
- const FX_BYTE prefix[4] = {0x00, 0xf0, 0xf1, 0xf2};
- for (int j = 0; j < 4; j ++) {
- FX_WORD unicode = prefix[j] * 256 + charcode;
- m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.m_Face, unicode);
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
- FX_CHAR name_glyph[256];
- FXFT_Get_Glyph_Name(m_Font.m_Face, m_GlyphIndex[charcode], name_glyph, 256);
- name_glyph[255] = 0;
- CFStringRef name_ct = CFStringCreateWithCStringNoCopy(kCFAllocatorDefault, name_glyph, kCFStringEncodingASCII, kCFAllocatorNull);
- m_ExtGID[charcode] = CGFontGetGlyphWithGlyphName((CGFontRef)m_Font.m_pPlatformFont, name_ct);
- if (name_ct) {
- CFRelease(name_ct);
- }
-#endif
- if (m_GlyphIndex[charcode]) {
- bGotOne = TRUE;
- break;
- }
- }
- }
- if (bGotOne) {
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
- if (!bCoreText) {
- FXSYS_memcpy32(m_ExtGID, m_GlyphIndex, 256);
- }
-#endif
- return;
- }
- }
- FXFT_Select_Charmap(m_Font.m_Face, FXFT_ENCODING_UNICODE);
- if (m_BaseEncoding == 0) {
- m_BaseEncoding = PDFFONT_ENCODING_STANDARD;
- }
- for (int charcode = 0; charcode < 256; charcode ++) {
- FX_LPCSTR name = GetAdobeCharName(m_BaseEncoding, m_pCharNames, charcode);
- if (name == NULL) {
- continue;
- }
- m_Encoding.m_Unicodes[charcode] = PDF_UnicodeFromAdobeName(name);
- m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.m_Face, m_Encoding.m_Unicodes[charcode]);
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
- FX_CHAR name_glyph[256];
- FXFT_Get_Glyph_Name(m_Font.m_Face, m_GlyphIndex[charcode], name_glyph, 256);
- name_glyph[255] = 0;
- CFStringRef name_ct = CFStringCreateWithCStringNoCopy(kCFAllocatorDefault, name_glyph, kCFStringEncodingASCII, kCFAllocatorNull);
- m_ExtGID[charcode] = CGFontGetGlyphWithGlyphName((CGFontRef)m_Font.m_pPlatformFont, name_ct);
- if (name_ct) {
- CFRelease(name_ct);
- }
-#endif
- if (m_GlyphIndex[charcode] == 0 && FXSYS_strcmp(name, ".notdef") == 0) {
- m_Encoding.m_Unicodes[charcode] = 0x20;
- m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.m_Face, 0x20);
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
- FX_CHAR name_glyph[256];
- FXFT_Get_Glyph_Name(m_Font.m_Face, m_GlyphIndex[charcode], name_glyph, 256);
- name_glyph[255] = 0;
- CFStringRef name_ct = CFStringCreateWithCStringNoCopy(kCFAllocatorDefault, name_glyph, kCFStringEncodingASCII, kCFAllocatorNull);
- m_ExtGID[charcode] = CGFontGetGlyphWithGlyphName((CGFontRef)m_Font.m_pPlatformFont, name_ct);
- if (name_ct) {
- CFRelease(name_ct);
- }
-#endif
- }
- }
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
- if (!bCoreText) {
- FXSYS_memcpy32(m_ExtGID, m_GlyphIndex, 256);
- }
-#endif
- return;
- }
- FT_UseType1Charmap(m_Font.m_Face);
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
- if (bCoreText) {
- if (m_Flags & PDFFONT_SYMBOLIC) {
- for (int charcode = 0; charcode < 256; charcode ++) {
- FX_LPCSTR name = GetAdobeCharName(m_BaseEncoding, m_pCharNames, charcode);
- if (name) {
- m_Encoding.m_Unicodes[charcode] = PDF_UnicodeFromAdobeName(name);
- m_GlyphIndex[charcode] = FXFT_Get_Name_Index(m_Font.m_Face, (char*)name);
- CFStringRef name_ct = CFStringCreateWithCStringNoCopy(kCFAllocatorDefault, name, kCFStringEncodingASCII, kCFAllocatorNull);
- m_ExtGID[charcode] = CGFontGetGlyphWithGlyphName((CGFontRef)m_Font.m_pPlatformFont, name_ct);
- if (name_ct) {
- CFRelease(name_ct);
- }
- } else {
- m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.m_Face, charcode);
- FX_WCHAR unicode = 0;
- if (m_GlyphIndex[charcode]) {
- unicode = FT_UnicodeFromCharCode(PDFFONT_ENCODING_STANDARD, charcode);
- }
- FX_CHAR name_glyph[256];
- FXSYS_memset32(name_glyph, 0, sizeof(name_glyph));
- FXFT_Get_Glyph_Name(m_Font.m_Face, m_GlyphIndex[charcode], name_glyph, 256);
- name_glyph[255] = 0;
- if (unicode == 0 && name_glyph[0] != 0) {
- unicode = PDF_UnicodeFromAdobeName(name_glyph);
- }
- m_Encoding.m_Unicodes[charcode] = unicode;
- CFStringRef name_ct = CFStringCreateWithCStringNoCopy(kCFAllocatorDefault, name_glyph, kCFStringEncodingASCII, kCFAllocatorNull);
- m_ExtGID[charcode] = CGFontGetGlyphWithGlyphName((CGFontRef)m_Font.m_pPlatformFont, name_ct);
- if (name_ct) {
- CFRelease(name_ct);
- }
- }
- }
- return;
- }
- FX_BOOL bUnicode = FALSE;
- if (0 == FXFT_Select_Charmap(m_Font.m_Face, FXFT_ENCODING_UNICODE)) {
- bUnicode = TRUE;
- }
- for (int charcode = 0; charcode < 256; charcode ++) {
- FX_LPCSTR name = GetAdobeCharName(m_BaseEncoding, m_pCharNames, charcode);
- if (name == NULL) {
- continue;
- }
- m_Encoding.m_Unicodes[charcode] = PDF_UnicodeFromAdobeName(name);
- FX_LPCSTR pStrUnicode = _GlyphNameRemap(name);
- if (pStrUnicode && 0 == FXFT_Get_Name_Index(m_Font.m_Face, (char*)name)) {
- name = pStrUnicode;
- }
- m_GlyphIndex[charcode] = FXFT_Get_Name_Index(m_Font.m_Face, (char*)name);
- CFStringRef name_ct = CFStringCreateWithCStringNoCopy(kCFAllocatorDefault, name, kCFStringEncodingASCII, kCFAllocatorNull);
- m_ExtGID[charcode] = CGFontGetGlyphWithGlyphName((CGFontRef)m_Font.m_pPlatformFont, name_ct);
- if (name_ct) {
- CFRelease(name_ct);
- }
- if (m_GlyphIndex[charcode] == 0) {
- if (FXSYS_strcmp(name, ".notdef") != 0 && FXSYS_strcmp(name, "space") != 0) {
- m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.m_Face, bUnicode ? m_Encoding.m_Unicodes[charcode] : charcode);
- FX_CHAR name_glyph[256];
- FXFT_Get_Glyph_Name(m_Font.m_Face, m_GlyphIndex[charcode], name_glyph, 256);
- name_glyph[255] = 0;
- CFStringRef name_ct = CFStringCreateWithCStringNoCopy(kCFAllocatorDefault, name_glyph, kCFStringEncodingASCII, kCFAllocatorNull);
- m_ExtGID[charcode] = CGFontGetGlyphWithGlyphName((CGFontRef)m_Font.m_pPlatformFont, name_ct);
- if (name_ct) {
- CFRelease(name_ct);
- }
- } else {
- m_Encoding.m_Unicodes[charcode] = 0x20;
- m_GlyphIndex[charcode] = bUnicode ? FXFT_Get_Char_Index(m_Font.m_Face, 0x20) : 0xffff;
- FX_CHAR name_glyph[256];
- FXFT_Get_Glyph_Name(m_Font.m_Face, m_GlyphIndex[charcode], name_glyph, 256);
- name_glyph[255] = 0;
- CFStringRef name_ct = CFStringCreateWithCStringNoCopy(kCFAllocatorDefault, name_glyph, kCFStringEncodingASCII, kCFAllocatorNull);
- m_ExtGID[charcode] = CGFontGetGlyphWithGlyphName((CGFontRef)m_Font.m_pPlatformFont, name_ct);
- if (name_ct) {
- CFRelease(name_ct);
- }
- }
- }
- }
- return;
- }
-#endif
- if (m_Flags & PDFFONT_SYMBOLIC) {
- for (int charcode = 0; charcode < 256; charcode ++) {
- FX_LPCSTR name = GetAdobeCharName(m_BaseEncoding, m_pCharNames, charcode);
- if (name) {
- m_Encoding.m_Unicodes[charcode] = PDF_UnicodeFromAdobeName(name);
- m_GlyphIndex[charcode] = FXFT_Get_Name_Index(m_Font.m_Face, (char*)name);
- } else {
- m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.m_Face, charcode);
- if (m_GlyphIndex[charcode]) {
- FX_WCHAR unicode = FT_UnicodeFromCharCode(PDFFONT_ENCODING_STANDARD, charcode);
- if (unicode == 0) {
- FX_CHAR name_glyph[256];
- FXSYS_memset32(name_glyph, 0, sizeof(name_glyph));
- FXFT_Get_Glyph_Name(m_Font.m_Face, m_GlyphIndex[charcode], name_glyph, 256);
- name_glyph[255] = 0;
- if (name_glyph[0] != 0) {
- unicode = PDF_UnicodeFromAdobeName(name_glyph);
- }
- }
- m_Encoding.m_Unicodes[charcode] = unicode;
- }
- }
- }
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
- if (!bCoreText) {
- FXSYS_memcpy32(m_ExtGID, m_GlyphIndex, 256);
- }
-#endif
- return;
- }
- FX_BOOL bUnicode = FALSE;
- if (0 == FXFT_Select_Charmap(m_Font.m_Face, FXFT_ENCODING_UNICODE)) {
- bUnicode = TRUE;
- }
- for (int charcode = 0; charcode < 256; charcode ++) {
- FX_LPCSTR name = GetAdobeCharName(m_BaseEncoding, m_pCharNames, charcode);
- if (name == NULL) {
- continue;
- }
- m_Encoding.m_Unicodes[charcode] = PDF_UnicodeFromAdobeName(name);
- m_GlyphIndex[charcode] = FXFT_Get_Name_Index(m_Font.m_Face, (char*)name);
- if (m_GlyphIndex[charcode] == 0) {
- if (FXSYS_strcmp(name, ".notdef") != 0 && FXSYS_strcmp(name, "space") != 0) {
- m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.m_Face, bUnicode ? m_Encoding.m_Unicodes[charcode] : charcode);
- } else {
- m_Encoding.m_Unicodes[charcode] = 0x20;
- m_GlyphIndex[charcode] = 0xffff;
- }
- }
- }
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
- if (!bCoreText) {
- FXSYS_memcpy32(m_ExtGID, m_GlyphIndex, 256);
- }
-#endif
-}
-CPDF_FontEncoding::CPDF_FontEncoding()
-{
- FXSYS_memset32(m_Unicodes, 0, sizeof(m_Unicodes));
-}
-int CPDF_FontEncoding::CharCodeFromUnicode(FX_WCHAR unicode) const
-{
- for (int i = 0; i < 256; i ++)
- if (m_Unicodes[i] == unicode) {
- return i;
- }
- return -1;
-}
-CPDF_FontEncoding::CPDF_FontEncoding(int PredefinedEncoding)
-{
- const FX_WORD* pSrc = PDF_UnicodesForPredefinedCharSet(PredefinedEncoding);
- if (!pSrc) {
- FXSYS_memset32(m_Unicodes, 0, sizeof(m_Unicodes));
- } else
- for (int i = 0; i < 256; i++) {
- m_Unicodes[i] = pSrc[i];
- }
-}
-FX_BOOL CPDF_FontEncoding::IsIdentical(CPDF_FontEncoding* pAnother) const
-{
- return FXSYS_memcmp32(m_Unicodes, pAnother->m_Unicodes, sizeof(m_Unicodes)) == 0;
-}
-CPDF_Object* CPDF_FontEncoding::Realize()
-{
- int predefined = 0;
- for (int cs = PDFFONT_ENCODING_WINANSI; cs < PDFFONT_ENCODING_ZAPFDINGBATS; cs ++) {
- const FX_WORD* pSrc = PDF_UnicodesForPredefinedCharSet(cs);
- FX_BOOL match = TRUE;
- for (int i = 0; i < 256; ++i) {
- if (m_Unicodes[i] != pSrc[i]) {
- match = FALSE;
- break;
- }
- }
- if (match) {
- predefined = cs;
- break;
- }
- }
- if (predefined) {
- if (predefined == PDFFONT_ENCODING_WINANSI) {
- return CPDF_Name::Create("WinAnsiEncoding");
- }
- if (predefined == PDFFONT_ENCODING_MACROMAN) {
- return CPDF_Name::Create("MacRomanEncoding");
- }
- if (predefined == PDFFONT_ENCODING_MACEXPERT) {
- return CPDF_Name::Create("MacExpertEncoding");
- }
- return NULL;
- }
- CPDF_Dictionary* pDict = CPDF_Dictionary::Create();
- pDict->SetAtName(FX_BSTRC("BaseEncoding"), FX_BSTRC("WinAnsiEncoding"));
- const FX_WORD* pStandard = PDF_UnicodesForPredefinedCharSet(PDFFONT_ENCODING_WINANSI);
- CPDF_Array* pDiff = CPDF_Array::Create();
- for (int i = 0; i < 256; i ++) {
- if (pStandard[i] == m_Unicodes[i]) {
- continue;
- }
- pDiff->Add(CPDF_Number::Create(i));
- pDiff->Add(CPDF_Name::Create(PDF_AdobeNameFromUnicode(m_Unicodes[i])));
- }
- pDict->SetAt(FX_BSTRC("Differences"), pDiff);
- return pDict;
-}
-CPDF_TrueTypeFont::CPDF_TrueTypeFont()
-{
-}
-FX_BOOL CPDF_TrueTypeFont::_Load()
-{
- return LoadCommon();
-}
-extern FX_DWORD FT_CharCodeFromUnicode(int encoding, FX_WCHAR unicode);
-void CPDF_TrueTypeFont::LoadGlyphMap()
-{
- if (m_Font.m_Face == NULL) {
- return;
- }
- int baseEncoding = m_BaseEncoding;
- if (m_pFontFile && m_Font.m_Face->num_charmaps > 0
- && (baseEncoding == PDFFONT_ENCODING_MACROMAN || baseEncoding == PDFFONT_ENCODING_WINANSI)
- && (m_Flags & PDFFONT_SYMBOLIC)) {
- FX_BOOL bSupportWin = FALSE;
- FX_BOOL bSupportMac = FALSE;
- for (int i = 0; i < FXFT_Get_Face_CharmapCount(m_Font.m_Face); i++) {
- int platform_id = FXFT_Get_Charmap_PlatformID(FXFT_Get_Face_Charmaps(m_Font.m_Face)[i]);
- if (platform_id == 0 || platform_id == 3) {
- bSupportWin = TRUE;
- } else if (platform_id == 0 || platform_id == 1) {
- bSupportMac = TRUE;
- }
- }
- if (baseEncoding == PDFFONT_ENCODING_WINANSI && !bSupportWin) {
- baseEncoding = bSupportMac ? PDFFONT_ENCODING_MACROMAN : PDFFONT_ENCODING_BUILTIN;
- } else if (baseEncoding == PDFFONT_ENCODING_MACROMAN && !bSupportMac) {
- baseEncoding = bSupportWin ? PDFFONT_ENCODING_WINANSI : PDFFONT_ENCODING_BUILTIN;
- }
- }
- if (((baseEncoding == PDFFONT_ENCODING_MACROMAN || baseEncoding == PDFFONT_ENCODING_WINANSI)
- && m_pCharNames == NULL) || (m_Flags & PDFFONT_NONSYMBOLIC)) {
- if (!FXFT_Has_Glyph_Names(m_Font.m_Face) && (!m_Font.m_Face->num_charmaps || !m_Font.m_Face->charmaps)) {
- int nStartChar = m_pFontDict->GetInteger(FX_BSTRC("FirstChar"));
- int charcode = 0;
- for (; charcode < nStartChar; charcode ++) {
- m_GlyphIndex[charcode] = 0;
- }
- FX_WORD nGlyph = charcode - nStartChar + 3;
- for (; charcode < 256; charcode ++, nGlyph ++) {
- m_GlyphIndex[charcode] = nGlyph;
- }
- return;
- }
- FX_BOOL bMSUnicode = FT_UseTTCharmap(m_Font.m_Face, 3, 1);
- FX_BOOL bMacRoman = FALSE, bMSSymbol = FALSE;
- if (!bMSUnicode) {
- if (m_Flags & PDFFONT_NONSYMBOLIC) {
- bMacRoman = FT_UseTTCharmap(m_Font.m_Face, 1, 0);
- bMSSymbol = !bMacRoman && FT_UseTTCharmap(m_Font.m_Face, 3, 0);
- } else {
- bMSSymbol = FT_UseTTCharmap(m_Font.m_Face, 3, 0);
- bMacRoman = !bMSSymbol && FT_UseTTCharmap(m_Font.m_Face, 1, 0);
- }
- }
- FX_BOOL bToUnicode = m_pFontDict->KeyExist(FX_BSTRC("ToUnicode"));
- for (int charcode = 0; charcode < 256; charcode ++) {
- FX_LPCSTR name = GetAdobeCharName(baseEncoding, m_pCharNames, charcode);
- if (name == NULL) {
- m_GlyphIndex[charcode] = m_pFontFile ? FXFT_Get_Char_Index(m_Font.m_Face, charcode) : -1;
- continue;
- }
- m_Encoding.m_Unicodes[charcode] = PDF_UnicodeFromAdobeName(name);
- if (bMSSymbol) {
- const FX_BYTE prefix[4] = {0x00, 0xf0, 0xf1, 0xf2};
- for (int j = 0; j < 4; j ++) {
- FX_WORD unicode = prefix[j] * 256 + charcode;
- m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.m_Face, unicode);
- if (m_GlyphIndex[charcode]) {
- break;
- }
- }
- } else if (m_Encoding.m_Unicodes[charcode]) {
- if (bMSUnicode) {
- m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.m_Face, m_Encoding.m_Unicodes[charcode]);
- } else if (bMacRoman) {
- FX_DWORD maccode = FT_CharCodeFromUnicode(FXFT_ENCODING_APPLE_ROMAN, m_Encoding.m_Unicodes[charcode]);
- if (!maccode) {
- m_GlyphIndex[charcode] = FXFT_Get_Name_Index(m_Font.m_Face, (char *)name);
- } else {
- m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.m_Face, maccode);
- }
- }
- }
- if ((m_GlyphIndex[charcode] == 0 || m_GlyphIndex[charcode] == 0xffff) && name != NULL) {
- if (name[0] == '.' && FXSYS_strcmp(name, ".notdef") == 0) {
- m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.m_Face, 32);
- } else {
- m_GlyphIndex[charcode] = FXFT_Get_Name_Index(m_Font.m_Face, (char*)name);
- if (m_GlyphIndex[charcode] == 0) {
- if (bToUnicode) {
- CFX_WideString wsUnicode = UnicodeFromCharCode(charcode);
- if (!wsUnicode.IsEmpty()) {
- m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.m_Face, wsUnicode[0]);
- m_Encoding.m_Unicodes[charcode] = wsUnicode[0];
- }
- }
- if (m_GlyphIndex[charcode] == 0) {
- m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.m_Face, charcode);
- }
- }
- }
- }
- }
- return;
- }
- if (FT_UseTTCharmap(m_Font.m_Face, 3, 0)) {
- const FX_BYTE prefix[4] = {0x00, 0xf0, 0xf1, 0xf2};
- FX_BOOL bGotOne = FALSE;
- for (int charcode = 0; charcode < 256; charcode ++) {
- for (int j = 0; j < 4; j ++) {
- FX_WORD unicode = prefix[j] * 256 + charcode;
- m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.m_Face, unicode);
- if (m_GlyphIndex[charcode]) {
- bGotOne = TRUE;
- break;
- }
- }
- }
- if (bGotOne) {
- if (baseEncoding != PDFFONT_ENCODING_BUILTIN) {
- for (int charcode = 0; charcode < 256; charcode ++) {
- FX_LPCSTR name = GetAdobeCharName(baseEncoding, m_pCharNames, charcode);
- if (name == NULL) {
- continue;
- }
- m_Encoding.m_Unicodes[charcode] = PDF_UnicodeFromAdobeName(name);
- }
- } else if (FT_UseTTCharmap(m_Font.m_Face, 1, 0)) {
- for (int charcode = 0; charcode < 256; charcode ++) {
- m_Encoding.m_Unicodes[charcode] = FT_UnicodeFromCharCode(FXFT_ENCODING_APPLE_ROMAN, charcode);
- }
- }
- return;
- }
- }
- if (FT_UseTTCharmap(m_Font.m_Face, 1, 0)) {
- FX_BOOL bGotOne = FALSE;
- for (int charcode = 0; charcode < 256; charcode ++) {
- m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.m_Face, charcode);
- m_Encoding.m_Unicodes[charcode] = FT_UnicodeFromCharCode(FXFT_ENCODING_APPLE_ROMAN, charcode);
- if (m_GlyphIndex[charcode]) {
- bGotOne = TRUE;
- }
- }
- if (m_pFontFile || bGotOne) {
- return;
- }
- }
- if (FXFT_Select_Charmap(m_Font.m_Face, FXFT_ENCODING_UNICODE) == 0) {
- FX_BOOL bGotOne = FALSE;
- const FX_WORD* pUnicodes = PDF_UnicodesForPredefinedCharSet(baseEncoding);
- for (int charcode = 0; charcode < 256; charcode ++) {
- if (m_pFontFile == NULL) {
- FX_LPCSTR name = GetAdobeCharName(0, m_pCharNames, charcode);
- if (name != NULL) {
- m_Encoding.m_Unicodes[charcode] = PDF_UnicodeFromAdobeName(name);
- } else if (pUnicodes) {
- m_Encoding.m_Unicodes[charcode] = pUnicodes[charcode];
- }
- } else {
- m_Encoding.m_Unicodes[charcode] = charcode;
- }
- m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.m_Face, m_Encoding.m_Unicodes[charcode]);
- if (m_GlyphIndex[charcode]) {
- bGotOne = TRUE;
- }
- }
- if (bGotOne) {
- return;
- }
- }
- for (int charcode = 0; charcode < 256; charcode ++) {
- m_GlyphIndex[charcode] = charcode;
- }
-}
-CPDF_Type3Font::CPDF_Type3Font()
-{
- m_pPageResources = NULL;
- FXSYS_memset32(m_CharWidthL, 0, sizeof m_CharWidthL);
-}
-CPDF_Type3Font::~CPDF_Type3Font()
-{
- FX_POSITION pos = m_CacheMap.GetStartPosition();
- while (pos) {
- FX_LPVOID key, value;
- m_CacheMap.GetNextAssoc(pos, key, value);
- delete (CPDF_Type3Char*)value;
- }
- m_CacheMap.RemoveAll();
- pos = m_DeletedMap.GetStartPosition();
- while (pos) {
- FX_LPVOID key, value;
- m_DeletedMap.GetNextAssoc(pos, key, value);
- delete (CPDF_Type3Char*)key;
- }
-}
-FX_BOOL CPDF_Type3Font::_Load()
-{
- m_pFontResources = m_pFontDict->GetDict(FX_BSTRC("Resources"));
- CPDF_Array* pMatrix = m_pFontDict->GetArray(FX_BSTRC("FontMatrix"));
- FX_FLOAT xscale = 1.0f, yscale = 1.0f;
- if (pMatrix) {
- m_FontMatrix = pMatrix->GetMatrix();
- xscale = m_FontMatrix.a;
- yscale = m_FontMatrix.d;
- }
- CPDF_Array* pBBox = m_pFontDict->GetArray(FX_BSTRC("FontBBox"));
- if (pBBox) {
- m_FontBBox.left = (FX_INT32)(FXSYS_Mul(pBBox->GetNumber(0), xscale) * 1000);
- m_FontBBox.bottom = (FX_INT32)(FXSYS_Mul(pBBox->GetNumber(1), yscale) * 1000);
- m_FontBBox.right = (FX_INT32)(FXSYS_Mul(pBBox->GetNumber(2), xscale) * 1000);
- m_FontBBox.top = (FX_INT32)(FXSYS_Mul(pBBox->GetNumber(3), yscale) * 1000);
- }
- int StartChar = m_pFontDict->GetInteger(FX_BSTRC("FirstChar"));
- CPDF_Array* pWidthArray = m_pFontDict->GetArray(FX_BSTRC("Widths"));
- if (pWidthArray && (StartChar >= 0 && StartChar < 256)) {
- FX_DWORD count = pWidthArray->GetCount();
- if (count > 256) {
- count = 256;
- }
- if (StartChar + count > 256) {
- count = 256 - StartChar;
- }
- for (FX_DWORD i = 0; i < count; i ++) {
- m_CharWidthL[StartChar + i] = FXSYS_round(FXSYS_Mul(pWidthArray->GetNumber(i), xscale) * 1000);
- }
- }
- m_pCharProcs = m_pFontDict->GetDict(FX_BSTRC("CharProcs"));
- CPDF_Object* pEncoding = m_pFontDict->GetElementValue(FX_BSTRC("Encoding"));
- if (pEncoding) {
- LoadPDFEncoding(pEncoding, m_BaseEncoding, m_pCharNames, FALSE, FALSE);
- if (m_pCharNames) {
- for (int i = 0; i < 256; i ++) {
- m_Encoding.m_Unicodes[i] = PDF_UnicodeFromAdobeName(m_pCharNames[i]);
- if (m_Encoding.m_Unicodes[i] == 0) {
- m_Encoding.m_Unicodes[i] = i;
- }
- }
- }
- }
- return TRUE;
-}
-void CPDF_Type3Font::CheckType3FontMetrics()
-{
- CheckFontMetrics();
-}
-CPDF_Type3Char* CPDF_Type3Font::LoadChar(FX_DWORD charcode, int level)
-{
- if (level >= _FPDF_MAX_TYPE3_FORM_LEVEL_) {
- return NULL;
- }
- CPDF_Type3Char* pChar = NULL;
- if (m_CacheMap.Lookup((FX_LPVOID)(FX_UINTPTR)charcode, (FX_LPVOID&)pChar)) {
- if (pChar->m_bPageRequired && m_pPageResources) {
- delete pChar;
- m_CacheMap.RemoveKey((FX_LPVOID)(FX_UINTPTR)charcode);
- return LoadChar(charcode, level + 1);
- }
- return pChar;
- }
- FX_LPCSTR name = GetAdobeCharName(m_BaseEncoding, m_pCharNames, charcode);
- if (name == NULL) {
- return NULL;
- }
- CPDF_Stream* pStream = (CPDF_Stream*)m_pCharProcs->GetElementValue(name);
- if (pStream == NULL || pStream->GetType() != PDFOBJ_STREAM) {
- return NULL;
- }
- pChar = FX_NEW CPDF_Type3Char;
- pChar->m_pForm = FX_NEW CPDF_Form(m_pDocument, m_pFontResources ? m_pFontResources : m_pPageResources, pStream, NULL);
- pChar->m_pForm->ParseContent(NULL, NULL, pChar, NULL, level + 1);
- FX_FLOAT scale = m_FontMatrix.GetXUnit();
- pChar->m_Width = (FX_INT32)(pChar->m_Width * scale + 0.5f);
- FX_RECT &rcBBox = pChar->m_BBox;
- CFX_FloatRect char_rect((FX_FLOAT)rcBBox.left / 1000.0f, (FX_FLOAT)rcBBox.bottom / 1000.0f,
- (FX_FLOAT)rcBBox.right / 1000.0f, (FX_FLOAT)rcBBox.top / 1000.0f);
- if (rcBBox.right <= rcBBox.left || rcBBox.bottom >= rcBBox.top) {
- char_rect = pChar->m_pForm->CalcBoundingBox();
- }
- char_rect.Transform(&m_FontMatrix);
- rcBBox.left = FXSYS_round(char_rect.left * 1000);
- rcBBox.right = FXSYS_round(char_rect.right * 1000);
- rcBBox.top = FXSYS_round(char_rect.top * 1000);
- rcBBox.bottom = FXSYS_round(char_rect.bottom * 1000);
- m_CacheMap.SetAt((FX_LPVOID)(FX_UINTPTR)charcode, pChar);
- if (pChar->m_pForm->CountObjects() == 0) {
- delete pChar->m_pForm;
- pChar->m_pForm = NULL;
- }
- return pChar;
-}
-int CPDF_Type3Font::GetCharWidthF(FX_DWORD charcode, int level)
-{
- if (charcode > 0xff) {
- charcode = 0;
- }
- if (m_CharWidthL[charcode]) {
- return m_CharWidthL[charcode];
- }
- CPDF_Type3Char* pChar = LoadChar(charcode, level);
- if (pChar == NULL) {
- return 0;
- }
- return pChar->m_Width;
-}
-void CPDF_Type3Font::GetCharBBox(FX_DWORD charcode, FX_RECT& rect, int level)
-{
- CPDF_Type3Char* pChar = LoadChar(charcode, level);
- if (pChar == NULL) {
- rect.left = rect.right = rect.top = rect.bottom = 0;
- return;
- }
- rect = pChar->m_BBox;
-}
-CPDF_Type3Char::CPDF_Type3Char()
-{
- m_pForm = NULL;
- m_pBitmap = NULL;
- m_bPageRequired = FALSE;
- m_bColored = FALSE;
-}
-CPDF_Type3Char::~CPDF_Type3Char()
-{
- if (m_pForm) {
- delete m_pForm;
- }
- if (m_pBitmap) {
- delete m_pBitmap;
- }
-}
+// 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
+
+#include "../../../include/fpdfapi/fpdf_page.h"
+#include "../../../include/fpdfapi/fpdf_module.h"
+#include "../../../include/fpdfapi/fpdf_pageobj.h"
+#include "font_int.h"
+#include "../fpdf_page/pageint.h"
+#include "../../../include/fxge/fx_freetype.h"
+FX_BOOL FT_UseTTCharmap(FXFT_Face face, int platform_id, int encoding_id)
+{
+ for (int i = 0; i < FXFT_Get_Face_CharmapCount(face); i ++) {
+ if (FXFT_Get_Charmap_PlatformID(FXFT_Get_Face_Charmaps(face)[i]) == platform_id &&
+ FXFT_Get_Charmap_EncodingID(FXFT_Get_Face_Charmaps(face)[i]) == encoding_id) {
+ FXFT_Set_Charmap(face, FXFT_Get_Face_Charmaps(face)[i]);
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+extern const FX_WORD* PDF_UnicodesForPredefinedCharSet(int);
+CPDF_FontGlobals::CPDF_FontGlobals()
+{
+ FXSYS_memset32(m_EmbeddedCharsets, 0, sizeof m_EmbeddedCharsets);
+ FXSYS_memset32(m_EmbeddedToUnicodes, 0, sizeof m_EmbeddedToUnicodes);
+ m_pContrastRamps = NULL;
+}
+CPDF_FontGlobals::~CPDF_FontGlobals()
+{
+ ClearAll();
+ if (m_pContrastRamps) {
+ FX_Free(m_pContrastRamps);
+ }
+}
+class CFX_StockFontArray : public CFX_Object
+{
+public:
+ CFX_StockFontArray()
+ {
+ FXSYS_memset32(m_pStockFonts, 0, sizeof(CPDF_Font*) * 14);
+ }
+ CPDF_Font* m_pStockFonts[14];
+};
+CPDF_Font* CPDF_FontGlobals::Find(void* key, int index)
+{
+ void* value = NULL;
+ if (!m_pStockMap.Lookup(key, value)) {
+ return NULL;
+ }
+ if (!value) {
+ return NULL;
+ }
+ return ((CFX_StockFontArray*)value)->m_pStockFonts[index];
+}
+void CPDF_FontGlobals::Set(void* key, int index, CPDF_Font* pFont)
+{
+ void* value = NULL;
+ if (m_pStockMap.Lookup(key, value)) {
+ ((CFX_StockFontArray*)value)->m_pStockFonts[index] = pFont;
+ return;
+ }
+ CFX_StockFontArray* pFonts = FX_NEW CFX_StockFontArray();
+ if (pFonts) {
+ pFonts->m_pStockFonts[index] = pFont;
+ }
+ m_pStockMap.SetAt(key, pFonts);
+}
+void CPDF_FontGlobals::Clear(void* key)
+{
+ void* value = NULL;
+ if (!m_pStockMap.Lookup(key, value)) {
+ return;
+ }
+ if (value) {
+ CFX_StockFontArray* pStockFonts = (CFX_StockFontArray*)value;
+ for (int i = 0; i < 14; i ++) {
+ if (pStockFonts->m_pStockFonts[i]) {
+ pStockFonts->m_pStockFonts[i]->GetFontDict()->Release();
+ delete pStockFonts->m_pStockFonts[i];
+ }
+ }
+ delete pStockFonts;
+ }
+ m_pStockMap.RemoveKey(key);
+}
+void CPDF_FontGlobals::ClearAll()
+{
+ FX_POSITION pos = m_pStockMap.GetStartPosition();
+ while (pos) {
+ void *key = NULL;
+ void* value = NULL;
+ m_pStockMap.GetNextAssoc(pos, key, value);
+ if (value) {
+ CFX_StockFontArray* pStockFonts = (CFX_StockFontArray*)value;
+ for (int i = 0; i < 14; i ++) {
+ if (pStockFonts->m_pStockFonts[i]) {
+ pStockFonts->m_pStockFonts[i]->GetFontDict()->Release();
+ delete pStockFonts->m_pStockFonts[i];
+ }
+ }
+ delete pStockFonts;
+ }
+ m_pStockMap.RemoveKey(key);
+ }
+}
+CPDF_Font::CPDF_Font()
+{
+ m_FontType = 0;
+ m_FontBBox.left = m_FontBBox.right = m_FontBBox.top = m_FontBBox.bottom = 0;
+ m_StemV = m_Ascent = m_Descent = m_ItalicAngle = 0;
+ m_pFontFile = NULL;
+ m_Flags = 0;
+ m_pToUnicodeMap = NULL;
+ m_bToUnicodeLoaded = FALSE;
+ m_pCharMap = NULL;
+}
+FX_BOOL CPDF_Font::Initialize()
+{
+ m_pCharMap = FX_NEW CPDF_FontCharMap(this);
+ return TRUE;
+}
+CPDF_Font::~CPDF_Font()
+{
+ if (m_pCharMap) {
+ FX_Free(m_pCharMap);
+ m_pCharMap = NULL;
+ }
+ if (m_pToUnicodeMap) {
+ delete m_pToUnicodeMap;
+ m_pToUnicodeMap = NULL;
+ }
+ if (m_pFontFile) {
+ m_pDocument->GetPageData()->ReleaseFontFileStreamAcc((CPDF_Stream*)m_pFontFile->GetStream());
+ }
+}
+FX_BOOL CPDF_Font::IsVertWriting() const
+{
+ FX_BOOL bVertWriting = FALSE;
+ CPDF_CIDFont* pCIDFont = GetCIDFont();
+ if (pCIDFont) {
+ bVertWriting = pCIDFont->IsVertWriting();
+ } else {
+ bVertWriting = m_Font.IsVertical();
+ }
+ return bVertWriting;
+}
+CFX_ByteString CPDF_Font::GetFontTypeName() const
+{
+ switch (m_FontType) {
+ case PDFFONT_TYPE1:
+ return FX_BSTRC("Type1");
+ case PDFFONT_TRUETYPE:
+ return FX_BSTRC("TrueType");
+ case PDFFONT_TYPE3:
+ return FX_BSTRC("Type3");
+ case PDFFONT_CIDFONT:
+ return FX_BSTRC("Type0");
+ }
+ return CFX_ByteString();
+}
+void CPDF_Font::AppendChar(CFX_ByteString& str, FX_DWORD charcode) const
+{
+ char buf[4];
+ int len = AppendChar(buf, charcode);
+ if (len == 1) {
+ str += buf[0];
+ } else {
+ str += CFX_ByteString(buf, len);
+ }
+}
+CFX_WideString CPDF_Font::UnicodeFromCharCode(FX_DWORD charcode) const
+{
+ if (!m_bToUnicodeLoaded) {
+ ((CPDF_Font*)this)->LoadUnicodeMap();
+ }
+ if (m_pToUnicodeMap) {
+ CFX_WideString wsRet = m_pToUnicodeMap->Lookup(charcode);
+ if (!wsRet.IsEmpty()) {
+ return wsRet;
+ }
+ }
+ FX_WCHAR unicode = _UnicodeFromCharCode(charcode);
+ if (unicode == 0) {
+ return CFX_WideString();
+ }
+ return unicode;
+}
+FX_DWORD CPDF_Font::CharCodeFromUnicode(FX_WCHAR unicode) const
+{
+ if (!m_bToUnicodeLoaded) {
+ ((CPDF_Font*)this)->LoadUnicodeMap();
+ }
+ if (m_pToUnicodeMap) {
+ FX_DWORD charcode = m_pToUnicodeMap->ReverseLookup(unicode);
+ if (charcode) {
+ return charcode;
+ }
+ }
+ return _CharCodeFromUnicode(unicode);
+}
+CFX_WideString CPDF_Font::DecodeString(const CFX_ByteString& str) const
+{
+ CFX_WideString result;
+ int src_len = str.GetLength();
+ result.Reserve(src_len);
+ FX_LPCSTR src_buf = str;
+ int src_pos = 0;
+ while (src_pos < src_len) {
+ FX_DWORD charcode = GetNextChar(src_buf, src_pos);
+ CFX_WideString unicode = UnicodeFromCharCode(charcode);
+ if (!unicode.IsEmpty()) {
+ result += unicode;
+ } else {
+ result += (FX_WCHAR)charcode;
+ }
+ }
+ return result;
+}
+CFX_ByteString CPDF_Font::EncodeString(const CFX_WideString& str) const
+{
+ CFX_ByteString result;
+ int src_len = str.GetLength();
+ FX_LPSTR dest_buf = result.GetBuffer(src_len * 2);
+ FX_LPCWSTR src_buf = str;
+ int dest_pos = 0;
+ for (int src_pos = 0; src_pos < src_len; src_pos ++) {
+ FX_DWORD charcode = CharCodeFromUnicode(src_buf[src_pos]);
+ dest_pos += AppendChar(dest_buf + dest_pos, charcode);
+ }
+ result.ReleaseBuffer(dest_pos);
+ return result;
+}
+void CPDF_Font::LoadFontDescriptor(CPDF_Dictionary* pFontDesc)
+{
+ m_Flags = pFontDesc->GetInteger(FX_BSTRC("Flags"), PDFFONT_NONSYMBOLIC);
+ int ItalicAngle = 0;
+ FX_BOOL bExistItalicAngle = FALSE;
+ if (pFontDesc->KeyExist(FX_BSTRC("ItalicAngle"))) {
+ ItalicAngle = pFontDesc->GetInteger(FX_BSTRC("ItalicAngle"));
+ bExistItalicAngle = TRUE;
+ }
+ if (ItalicAngle < 0) {
+ m_Flags |= PDFFONT_ITALIC;
+ m_ItalicAngle = ItalicAngle;
+ }
+ FX_BOOL bExistStemV = FALSE;
+ if (pFontDesc->KeyExist(FX_BSTRC("StemV"))) {
+ m_StemV = pFontDesc->GetInteger(FX_BSTRC("StemV"));
+ bExistStemV = TRUE;
+ }
+ FX_BOOL bExistAscent = FALSE;
+ if (pFontDesc->KeyExist(FX_BSTRC("Ascent"))) {
+ m_Ascent = pFontDesc->GetInteger(FX_BSTRC("Ascent"));
+ bExistAscent = TRUE;
+ }
+ FX_BOOL bExistDescent = FALSE;
+ if (pFontDesc->KeyExist(FX_BSTRC("Descent"))) {
+ m_Descent = pFontDesc->GetInteger(FX_BSTRC("Descent"));
+ bExistDescent = TRUE;
+ }
+ FX_BOOL bExistCapHeight = FALSE;
+ if (pFontDesc->KeyExist(FX_BSTRC("CapHeight"))) {
+ bExistCapHeight = TRUE;
+ }
+ if (bExistItalicAngle && bExistAscent && bExistCapHeight && bExistDescent && bExistStemV) {
+ m_Flags |= PDFFONT_USEEXTERNATTR;
+ }
+ if (m_Descent > 10) {
+ m_Descent = -m_Descent;
+ }
+ CPDF_Array* pBBox = pFontDesc->GetArray(FX_BSTRC("FontBBox"));
+ if (pBBox) {
+ m_FontBBox.left = pBBox->GetInteger(0);
+ m_FontBBox.bottom = pBBox->GetInteger(1);
+ m_FontBBox.right = pBBox->GetInteger(2);
+ m_FontBBox.top = pBBox->GetInteger(3);
+ }
+ CPDF_Stream* pFontFile = pFontDesc->GetStream(FX_BSTRC("FontFile"));
+ if (pFontFile == NULL) {
+ pFontFile = pFontDesc->GetStream(FX_BSTRC("FontFile2"));
+ }
+ if (pFontFile == NULL) {
+ pFontFile = pFontDesc->GetStream(FX_BSTRC("FontFile3"));
+ }
+ if (pFontFile) {
+ m_pFontFile = m_pDocument->LoadFontFile(pFontFile);
+ if (m_pFontFile == NULL) {
+ return;
+ }
+ FX_LPCBYTE pFontData = m_pFontFile->GetData();
+ FX_DWORD dwFontSize = m_pFontFile->GetSize();
+ m_Font.LoadEmbedded(pFontData, dwFontSize);
+ if (m_Font.m_Face == NULL) {
+ m_pFontFile = NULL;
+ }
+ }
+}
+short TT2PDF(int m, FXFT_Face face)
+{
+ int upm = FXFT_Get_Face_UnitsPerEM(face);
+ if (upm == 0) {
+ return (short)m;
+ }
+ return (m * 1000 + upm / 2) / upm;
+}
+void CPDF_Font::CheckFontMetrics()
+{
+ if (m_FontBBox.top == 0 && m_FontBBox.bottom == 0 && m_FontBBox.left == 0 && m_FontBBox.right == 0) {
+ if (m_Font.m_Face) {
+ m_FontBBox.left = TT2PDF(FXFT_Get_Face_xMin(m_Font.m_Face), m_Font.m_Face);
+ m_FontBBox.bottom = TT2PDF(FXFT_Get_Face_yMin(m_Font.m_Face), m_Font.m_Face);
+ m_FontBBox.right = TT2PDF(FXFT_Get_Face_xMax(m_Font.m_Face), m_Font.m_Face);
+ m_FontBBox.top = TT2PDF(FXFT_Get_Face_yMax(m_Font.m_Face), m_Font.m_Face);
+ m_Ascent = TT2PDF(FXFT_Get_Face_Ascender(m_Font.m_Face), m_Font.m_Face);
+ m_Descent = TT2PDF(FXFT_Get_Face_Descender(m_Font.m_Face), m_Font.m_Face);
+ } else {
+ FX_BOOL bFirst = TRUE;
+ for (int i = 0; i < 256; i ++) {
+ FX_RECT rect;
+ GetCharBBox(i, rect);
+ if (rect.left == rect.right) {
+ continue;
+ }
+ if (bFirst) {
+ m_FontBBox = rect;
+ bFirst = FALSE;
+ } else {
+ if (m_FontBBox.top < rect.top) {
+ m_FontBBox.top = rect.top;
+ }
+ if (m_FontBBox.right < rect.right) {
+ m_FontBBox.right = rect.right;
+ }
+ if (m_FontBBox.left > rect.left) {
+ m_FontBBox.left = rect.left;
+ }
+ if (m_FontBBox.bottom > rect.bottom) {
+ m_FontBBox.bottom = rect.bottom;
+ }
+ }
+ }
+ }
+ }
+ if (m_Ascent == 0 && m_Descent == 0) {
+ FX_RECT rect;
+ GetCharBBox('A', rect);
+ if (rect.bottom == rect.top) {
+ m_Ascent = m_FontBBox.top;
+ } else {
+ m_Ascent = rect.top;
+ }
+ GetCharBBox('g', rect);
+ if (rect.bottom == rect.top) {
+ m_Descent = m_FontBBox.bottom;
+ } else {
+ m_Descent = rect.bottom;
+ }
+ }
+}
+void CPDF_Font::LoadUnicodeMap()
+{
+ m_bToUnicodeLoaded = TRUE;
+ CPDF_Stream* pStream = m_pFontDict->GetStream(FX_BSTRC("ToUnicode"));
+ if (pStream == NULL) {
+ return;
+ }
+ m_pToUnicodeMap = FX_NEW CPDF_ToUnicodeMap;
+ m_pToUnicodeMap->Load(pStream);
+}
+int CPDF_Font::GetStringWidth(FX_LPCSTR pString, int size)
+{
+ int offset = 0;
+ int width = 0;
+ while (offset < size) {
+ FX_DWORD charcode = GetNextChar(pString, offset);
+ width += GetCharWidthF(charcode);
+ }
+ return width;
+}
+int CPDF_Font::GetCharTypeWidth(FX_DWORD charcode)
+{
+ if (m_Font.m_Face == NULL) {
+ return 0;
+ }
+ int glyph_index = GlyphFromCharCode(charcode);
+ if (glyph_index == 0xffff) {
+ return 0;
+ }
+ return m_Font.GetGlyphWidth(glyph_index);
+}
+int _PDF_GetStandardFontName(CFX_ByteString& name);
+CPDF_Font* CPDF_Font::GetStockFont(CPDF_Document* pDoc, FX_BSTR name)
+{
+ CFX_ByteString fontname(name);
+ int font_id = _PDF_GetStandardFontName(fontname);
+ if (font_id < 0) {
+ return NULL;
+ }
+ CPDF_FontGlobals* pFontGlobals = CPDF_ModuleMgr::Get()->GetPageModule()->GetFontGlobals();
+ CPDF_Font* pFont = pFontGlobals->Find(pDoc, font_id);
+ if (pFont) {
+ return pFont;
+ }
+ CPDF_Dictionary* pDict = CPDF_Dictionary::Create();
+ pDict->SetAtName(FX_BSTRC("Type"), FX_BSTRC("Font"));
+ pDict->SetAtName(FX_BSTRC("Subtype"), FX_BSTRC("Type1"));
+ pDict->SetAtName(FX_BSTRC("BaseFont"), fontname);
+ pDict->SetAtName(FX_BSTRC("Encoding"), FX_BSTRC("WinAnsiEncoding"));
+ pFont = CPDF_Font::CreateFontF(NULL, pDict);
+ pFontGlobals->Set(pDoc, font_id, pFont);
+ return pFont;
+}
+const FX_BYTE ChineseFontNames[][5] = {
+ {0xCB, 0xCE, 0xCC, 0xE5, 0x00},
+ {0xBF, 0xAC, 0xCC, 0xE5, 0x00},
+ {0xBA, 0xDA, 0xCC, 0xE5, 0x00},
+ {0xB7, 0xC2, 0xCB, 0xCE, 0x00},
+ {0xD0, 0xC2, 0xCB, 0xCE, 0x00}
+};
+CPDF_Font* CPDF_Font::CreateFontF(CPDF_Document* pDoc, CPDF_Dictionary* pFontDict)
+{
+ CFX_ByteString type = pFontDict->GetString(FX_BSTRC("Subtype"));
+ CPDF_Font* pFont;
+ if (type == FX_BSTRC("TrueType")) {
+ {
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ || _FXM_PLATFORM_ == _FXM_PLATFORM_LINUX_ || _FXM_PLATFORM_ == _FXM_PLATFORM_ANDROID_ || _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
+ CFX_ByteString basefont = pFontDict->GetString(FX_BSTRC("BaseFont"));
+ CFX_ByteString tag = basefont.Left(4);
+ int i;
+ int count = sizeof(ChineseFontNames) / sizeof(ChineseFontNames[0]);
+ for (i = 0; i < count; ++i) {
+ if (tag == CFX_ByteString((FX_LPCSTR)ChineseFontNames[i])) {
+ break;
+ }
+ }
+ if (i < count) {
+ CPDF_Dictionary* pFontDesc = pFontDict->GetDict(FX_BSTRC("FontDescriptor"));
+ if (pFontDesc == NULL || !pFontDesc->KeyExist(FX_BSTRC("FontFile2"))) {
+ pFont = FX_NEW CPDF_CIDFont;
+ pFont->Initialize();
+ pFont->m_FontType = PDFFONT_CIDFONT;
+ pFont->m_pFontDict = pFontDict;
+ pFont->m_pDocument = pDoc;
+ if (!pFont->Load()) {
+ delete pFont;
+ return NULL;
+ }
+ return pFont;
+ }
+ }
+#endif
+ }
+ pFont = FX_NEW CPDF_TrueTypeFont;
+ pFont->Initialize();
+ pFont->m_FontType = PDFFONT_TRUETYPE;
+ } else if (type == FX_BSTRC("Type3")) {
+ pFont = FX_NEW CPDF_Type3Font;
+ pFont->Initialize();
+ pFont->m_FontType = PDFFONT_TYPE3;
+ } else if (type == FX_BSTRC("Type0")) {
+ pFont = FX_NEW CPDF_CIDFont;
+ pFont->Initialize();
+ pFont->m_FontType = PDFFONT_CIDFONT;
+ } else {
+ pFont = FX_NEW CPDF_Type1Font;
+ pFont->Initialize();
+ pFont->m_FontType = PDFFONT_TYPE1;
+ }
+ pFont->m_pFontDict = pFontDict;
+ pFont->m_pDocument = pDoc;
+ if (!pFont->Load()) {
+ delete pFont;
+ return NULL;
+ }
+ return pFont;
+}
+FX_BOOL CPDF_Font::Load()
+{
+ if (m_pFontDict == NULL) {
+ return FALSE;
+ }
+ CFX_ByteString type = m_pFontDict->GetString(FX_BSTRC("Subtype"));
+ m_BaseFont = m_pFontDict->GetString(FX_BSTRC("BaseFont"));
+ if (type == FX_BSTRC("MMType1")) {
+ type = FX_BSTRC("Type1");
+ }
+ return _Load();
+}
+static CFX_WideString _FontMap_GetWideString(CFX_CharMap* pMap, const CFX_ByteString& bytestr)
+{
+ return ((CPDF_FontCharMap*)pMap)->m_pFont->DecodeString(bytestr);
+}
+static CFX_ByteString _FontMap_GetByteString(CFX_CharMap* pMap, const CFX_WideString& widestr)
+{
+ return ((CPDF_FontCharMap*)pMap)->m_pFont->EncodeString(widestr);
+}
+CPDF_FontCharMap::CPDF_FontCharMap(CPDF_Font* pFont)
+{
+ m_GetByteString = _FontMap_GetByteString;
+ m_GetWideString = _FontMap_GetWideString;
+ m_pFont = pFont;
+}
+CFX_WideString CPDF_ToUnicodeMap::Lookup(FX_DWORD charcode)
+{
+ FX_DWORD value;
+ if (m_Map.Lookup(charcode, value)) {
+ FX_WCHAR unicode = (FX_WCHAR)(value & 0xffff);
+ if (unicode != 0xffff) {
+ return unicode;
+ }
+ FX_LPCWSTR buf = m_MultiCharBuf.GetBuffer();
+ FX_DWORD buf_len = m_MultiCharBuf.GetLength();
+ if (buf == NULL || buf_len == 0) {
+ return CFX_WideString();
+ }
+ FX_DWORD index = value >> 16;
+ if (index >= buf_len) {
+ return CFX_WideString();
+ }
+ FX_DWORD len = buf[index];
+ if (index + len < index || index + len >= buf_len) {
+ return CFX_WideString();
+ }
+ return CFX_WideString(buf + index + 1, len);
+ }
+ if (m_pBaseMap) {
+ return m_pBaseMap->UnicodeFromCID((FX_WORD)charcode);
+ }
+ return CFX_WideString();
+}
+FX_DWORD CPDF_ToUnicodeMap::ReverseLookup(FX_WCHAR unicode)
+{
+ FX_POSITION pos = m_Map.GetStartPosition();
+ while (pos) {
+ FX_DWORD key, value;
+ m_Map.GetNextAssoc(pos, key, value);
+ if ((FX_WCHAR)value == unicode) {
+ return key;
+ }
+ }
+ return 0;
+}
+static FX_DWORD _StringToCode(FX_BSTR str)
+{
+ FX_LPCSTR buf = str.GetCStr();
+ int len = str.GetLength();
+ if (len == 0) {
+ return 0;
+ }
+ int result = 0;
+ if (buf[0] == '<') {
+ for (int i = 1; i < len; i ++) {
+ int digit;
+ if (buf[i] >= '0' && buf[i] <= '9') {
+ digit = buf[i] - '0';
+ } else if (buf[i] >= 'a' && buf[i] <= 'f') {
+ digit = buf[i] - 'a' + 10;
+ } else if (buf[i] >= 'A' && buf[i] <= 'F') {
+ digit = buf[i] - 'A' + 10;
+ } else {
+ break;
+ }
+ result = result * 16 + digit;
+ }
+ return result;
+ } else {
+ for (int i = 0; i < len; i ++) {
+ if (buf[i] < '0' || buf[i] > '9') {
+ break;
+ }
+ result = result * 10 + buf[i] - '0';
+ }
+ }
+ return result;
+}
+static CFX_WideString _StringDataAdd(CFX_WideString str)
+{
+ CFX_WideString ret;
+ int len = str.GetLength();
+ FX_WCHAR value = 1;
+ for (int i = len - 1; i >= 0 ; --i) {
+ FX_WCHAR ch = str[i] + value;
+ if (ch < str[i]) {
+ ret.Insert(0, 0);
+ } else {
+ ret.Insert(0, ch);
+ value = 0;
+ }
+ }
+ if (value) {
+ ret.Insert(0, value);
+ }
+ return ret;
+}
+static CFX_WideString _StringToWideString(FX_BSTR str)
+{
+ FX_LPCSTR buf = str.GetCStr();
+ int len = str.GetLength();
+ if (len == 0) {
+ return CFX_WideString();
+ }
+ CFX_WideString result;
+ if (buf[0] == '<') {
+ int byte_pos = 0;
+ FX_WCHAR ch = 0;
+ for (int i = 1; i < len; i ++) {
+ int digit;
+ if (buf[i] >= '0' && buf[i] <= '9') {
+ digit = buf[i] - '0';
+ } else if (buf[i] >= 'a' && buf[i] <= 'f') {
+ digit = buf[i] - 'a' + 10;
+ } else if (buf[i] >= 'A' && buf[i] <= 'F') {
+ digit = buf[i] - 'A' + 10;
+ } else {
+ break;
+ }
+ ch = ch * 16 + digit;
+ byte_pos ++;
+ if (byte_pos == 4) {
+ result += ch;
+ byte_pos = 0;
+ ch = 0;
+ }
+ }
+ return result;
+ }
+ if (buf[0] == '(') {
+ }
+ return result;
+}
+void CPDF_ToUnicodeMap::Load(CPDF_Stream* pStream)
+{
+ int CIDSet = 0;
+ CPDF_StreamAcc stream;
+ stream.LoadAllData(pStream, FALSE);
+ CPDF_SimpleParser parser(stream.GetData(), stream.GetSize());
+ m_Map.EstimateSize(stream.GetSize() / 8, 1024);
+ while (1) {
+ CFX_ByteStringC word = parser.GetWord();
+ if (word.IsEmpty()) {
+ break;
+ }
+ if (word == FX_BSTRC("beginbfchar")) {
+ while (1) {
+ word = parser.GetWord();
+ if (word.IsEmpty() || word == FX_BSTRC("endbfchar")) {
+ break;
+ }
+ FX_DWORD srccode = _StringToCode(word);
+ word = parser.GetWord();
+ CFX_WideString destcode = _StringToWideString(word);
+ int len = destcode.GetLength();
+ if (len == 0) {
+ continue;
+ }
+ if (len == 1) {
+ m_Map.SetAt(srccode, destcode.GetAt(0));
+ } else {
+ m_Map.SetAt(srccode, m_MultiCharBuf.GetLength() * 0x10000 + 0xffff);
+ m_MultiCharBuf.AppendChar(destcode.GetLength());
+ m_MultiCharBuf << destcode;
+ }
+ }
+ } else if (word == FX_BSTRC("beginbfrange")) {
+ while (1) {
+ CFX_ByteString low, high;
+ low = parser.GetWord();
+ if (low.IsEmpty() || low == FX_BSTRC("endbfrange")) {
+ break;
+ }
+ high = parser.GetWord();
+ FX_DWORD lowcode = _StringToCode(low);
+ FX_DWORD highcode = (lowcode & 0xffffff00) | (_StringToCode(high) & 0xff);
+ if (highcode == (FX_DWORD) - 1) {
+ break;
+ }
+ CFX_ByteString start = parser.GetWord();
+ if (start == FX_BSTRC("[")) {
+ for (FX_DWORD code = lowcode; code <= highcode; code ++) {
+ CFX_ByteString dest = parser.GetWord();
+ CFX_WideString destcode = _StringToWideString(dest);
+ int len = destcode.GetLength();
+ if (len == 0) {
+ continue;
+ }
+ if (len == 1) {
+ m_Map.SetAt(code, destcode.GetAt(0));
+ } else {
+ m_Map.SetAt(code, m_MultiCharBuf.GetLength() * 0x10000 + 0xffff);
+ m_MultiCharBuf.AppendChar(destcode.GetLength());
+ m_MultiCharBuf << destcode;
+ }
+ }
+ parser.GetWord();
+ } else {
+ CFX_WideString destcode = _StringToWideString(start);
+ int len = destcode.GetLength();
+ FX_DWORD value = 0;
+ if (len == 1) {
+ value = _StringToCode(start);
+ for (FX_DWORD code = lowcode; code <= highcode; code ++) {
+ m_Map.SetAt(code, value++);
+ }
+ } else {
+ for (FX_DWORD code = lowcode; code <= highcode; code ++) {
+ CFX_WideString retcode;
+ if (code == lowcode) {
+ retcode = destcode;
+ } else {
+ retcode = _StringDataAdd(destcode);
+ }
+ m_Map.SetAt(code, m_MultiCharBuf.GetLength() * 0x10000 + 0xffff);
+ m_MultiCharBuf.AppendChar(retcode.GetLength());
+ m_MultiCharBuf << retcode;
+ destcode = retcode;
+ }
+ }
+ }
+ }
+ } else if (word == FX_BSTRC("/Adobe-Korea1-UCS2")) {
+ CIDSet = CIDSET_KOREA1;
+ } else if (word == FX_BSTRC("/Adobe-Japan1-UCS2")) {
+ CIDSet = CIDSET_JAPAN1;
+ } else if (word == FX_BSTRC("/Adobe-CNS1-UCS2")) {
+ CIDSet = CIDSET_CNS1;
+ } else if (word == FX_BSTRC("/Adobe-GB1-UCS2")) {
+ CIDSet = CIDSET_GB1;
+ }
+ }
+ if (CIDSet) {
+ m_pBaseMap = CPDF_ModuleMgr::Get()->GetPageModule()->GetFontGlobals()->m_CMapManager.GetCID2UnicodeMap(CIDSet, FALSE);
+ } else {
+ m_pBaseMap = NULL;
+ }
+}
+static FX_BOOL GetPredefinedEncoding(int& basemap, const CFX_ByteString& value)
+{
+ if (value == FX_BSTRC("WinAnsiEncoding")) {
+ basemap = PDFFONT_ENCODING_WINANSI;
+ } else if (value == FX_BSTRC("MacRomanEncoding")) {
+ basemap = PDFFONT_ENCODING_MACROMAN;
+ } else if (value == FX_BSTRC("MacExpertEncoding")) {
+ basemap = PDFFONT_ENCODING_MACEXPERT;
+ } else if (value == FX_BSTRC("PDFDocEncoding")) {
+ basemap = PDFFONT_ENCODING_PDFDOC;
+ } else {
+ return FALSE;
+ }
+ return TRUE;
+}
+void CPDF_Font::LoadPDFEncoding(CPDF_Object* pEncoding, int& iBaseEncoding, CFX_ByteString*& pCharNames,
+ FX_BOOL bEmbedded, FX_BOOL bTrueType)
+{
+ if (pEncoding == NULL) {
+ if (m_BaseFont == FX_BSTRC("Symbol")) {
+ iBaseEncoding = bTrueType ? PDFFONT_ENCODING_MS_SYMBOL : PDFFONT_ENCODING_ADOBE_SYMBOL;
+ } else if (!bEmbedded && iBaseEncoding == PDFFONT_ENCODING_BUILTIN) {
+ iBaseEncoding = PDFFONT_ENCODING_WINANSI;
+ }
+ return;
+ }
+ if (pEncoding->GetType() == PDFOBJ_NAME) {
+ if (iBaseEncoding == PDFFONT_ENCODING_ADOBE_SYMBOL || iBaseEncoding == PDFFONT_ENCODING_ZAPFDINGBATS) {
+ return;
+ }
+ if ((m_Flags & PDFFONT_SYMBOLIC) && m_BaseFont == FX_BSTRC("Symbol")) {
+ if (!bTrueType) {
+ iBaseEncoding = PDFFONT_ENCODING_ADOBE_SYMBOL;
+ }
+ return;
+ }
+ CFX_ByteString bsEncoding = pEncoding->GetString();
+ if (bsEncoding.Compare(FX_BSTRC("MacExpertEncoding")) == 0) {
+ bsEncoding = FX_BSTRC("WinAnsiEncoding");
+ }
+ GetPredefinedEncoding(iBaseEncoding, bsEncoding);
+ return;
+ }
+ if (pEncoding->GetType() != PDFOBJ_DICTIONARY) {
+ return;
+ }
+ CPDF_Dictionary* pDict = (CPDF_Dictionary*)pEncoding;
+ if (iBaseEncoding != PDFFONT_ENCODING_ADOBE_SYMBOL && iBaseEncoding != PDFFONT_ENCODING_ZAPFDINGBATS) {
+ CFX_ByteString bsEncoding = pDict->GetString(FX_BSTRC("BaseEncoding"));
+ if (bsEncoding.Compare(FX_BSTRC("MacExpertEncoding")) == 0 && bTrueType) {
+ bsEncoding = FX_BSTRC("WinAnsiEncoding");
+ }
+ GetPredefinedEncoding(iBaseEncoding, bsEncoding);
+ }
+ if ((!bEmbedded || bTrueType) && iBaseEncoding == PDFFONT_ENCODING_BUILTIN) {
+ iBaseEncoding = PDFFONT_ENCODING_STANDARD;
+ }
+ CPDF_Array* pDiffs = pDict->GetArray(FX_BSTRC("Differences"));
+ if (pDiffs == NULL) {
+ return;
+ }
+ FX_NEW_VECTOR(pCharNames, CFX_ByteString, 256);
+ FX_DWORD cur_code = 0;
+ for (FX_DWORD i = 0; i < pDiffs->GetCount(); i ++) {
+ CPDF_Object* pElement = pDiffs->GetElementValue(i);
+ if (pElement == NULL) {
+ continue;
+ }
+ if (pElement->GetType() == PDFOBJ_NAME) {
+ if (cur_code < 256) {
+ pCharNames[cur_code] = ((CPDF_Name*)pElement)->GetString();
+ }
+ cur_code ++;
+ } else {
+ cur_code = pElement->GetInteger();
+ }
+ }
+}
+FX_BOOL CPDF_Font::IsStandardFont() const
+{
+ if (m_FontType != PDFFONT_TYPE1) {
+ return FALSE;
+ }
+ if (m_pFontFile != NULL) {
+ return FALSE;
+ }
+ if (((CPDF_Type1Font*)this)->GetBase14Font() < 0) {
+ return FALSE;
+ }
+ return TRUE;
+}
+extern FX_LPCSTR PDF_CharNameFromPredefinedCharSet(int encoding, FX_BYTE charcode);
+CPDF_SimpleFont::CPDF_SimpleFont()
+{
+ FXSYS_memset8(m_CharBBox, 0xff, sizeof m_CharBBox);
+ FXSYS_memset8(m_CharWidth, 0xff, sizeof m_CharWidth);
+ FXSYS_memset8(m_GlyphIndex, 0xff, sizeof m_GlyphIndex);
+ FXSYS_memset8(m_ExtGID, 0xff, sizeof m_ExtGID);
+ m_pCharNames = NULL;
+ m_BaseEncoding = PDFFONT_ENCODING_BUILTIN;
+}
+CPDF_SimpleFont::~CPDF_SimpleFont()
+{
+ if (m_pCharNames) {
+ FX_DELETE_VECTOR(m_pCharNames, CFX_ByteString, 256);
+ }
+}
+int CPDF_SimpleFont::GlyphFromCharCode(FX_DWORD charcode, FX_BOOL *pVertGlyph)
+{
+ if (pVertGlyph) {
+ *pVertGlyph = FALSE;
+ }
+ if (charcode > 0xff) {
+ return -1;
+ }
+ int index = m_GlyphIndex[(FX_BYTE)charcode];
+ if (index == 0xffff) {
+ return -1;
+ }
+ return index;
+}
+void CPDF_SimpleFont::LoadCharMetrics(int charcode)
+{
+ if (m_Font.m_Face == NULL) {
+ return;
+ }
+ if (charcode < 0 || charcode > 0xff) {
+ return;
+ }
+ int glyph_index = m_GlyphIndex[charcode];
+ if (glyph_index == 0xffff) {
+ if (m_pFontFile == NULL && charcode != 32) {
+ LoadCharMetrics(32);
+ m_CharBBox[charcode] = m_CharBBox[32];
+ if (m_bUseFontWidth) {
+ m_CharWidth[charcode] = m_CharWidth[32];
+ }
+ }
+ return;
+ }
+ int err = FXFT_Load_Glyph(m_Font.m_Face, glyph_index, FXFT_LOAD_NO_SCALE | FXFT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH);
+ if (err) {
+ return;
+ }
+ m_CharBBox[charcode].Left = TT2PDF(FXFT_Get_Glyph_HoriBearingX(m_Font.m_Face), m_Font.m_Face);
+ m_CharBBox[charcode].Right = TT2PDF(FXFT_Get_Glyph_HoriBearingX(m_Font.m_Face) + FXFT_Get_Glyph_Width(m_Font.m_Face), m_Font.m_Face);
+ m_CharBBox[charcode].Top = TT2PDF(FXFT_Get_Glyph_HoriBearingY(m_Font.m_Face), m_Font.m_Face);
+ m_CharBBox[charcode].Bottom = TT2PDF(FXFT_Get_Glyph_HoriBearingY(m_Font.m_Face) - FXFT_Get_Glyph_Height(m_Font.m_Face), m_Font.m_Face);
+ if (m_bUseFontWidth) {
+ int TT_Width = TT2PDF(FXFT_Get_Glyph_HoriAdvance(m_Font.m_Face), m_Font.m_Face);
+ if (m_CharWidth[charcode] == 0xffff) {
+ m_CharWidth[charcode] = TT_Width;
+ } else if (TT_Width && !IsEmbedded()) {
+ m_CharBBox[charcode].Right = m_CharBBox[charcode].Right * m_CharWidth[charcode] / TT_Width;
+ m_CharBBox[charcode].Left = m_CharBBox[charcode].Left * m_CharWidth[charcode] / TT_Width;
+ }
+ }
+}
+int CPDF_SimpleFont::GetCharWidthF(FX_DWORD charcode, int level)
+{
+ if (charcode > 0xff) {
+ charcode = 0;
+ }
+ if (m_CharWidth[charcode] == 0xffff) {
+ LoadCharMetrics(charcode);
+ if (m_CharWidth[charcode] == 0xffff) {
+ m_CharWidth[charcode] = 0;
+ }
+ }
+ return (FX_INT16)m_CharWidth[charcode];
+}
+void CPDF_SimpleFont::GetCharBBox(FX_DWORD charcode, FX_RECT& rect, int level)
+{
+ if (charcode > 0xff) {
+ charcode = 0;
+ }
+ if (m_CharBBox[charcode].Left == (FX_SHORT)0xffff) {
+ LoadCharMetrics(charcode);
+ }
+ rect.left = m_CharBBox[charcode].Left;
+ rect.right = m_CharBBox[charcode].Right;
+ rect.bottom = m_CharBBox[charcode].Bottom;
+ rect.top = m_CharBBox[charcode].Top;
+}
+FX_LPCSTR GetAdobeCharName(int iBaseEncoding, const CFX_ByteString* pCharNames, int charcode)
+{
+ ASSERT(charcode >= 0 && charcode < 256);
+ if (charcode < 0 || charcode >= 256) {
+ return NULL;
+ }
+ FX_LPCSTR name = NULL;
+ if (pCharNames) {
+ name = pCharNames[charcode];
+ }
+ if ((name == NULL || name[0] == 0) && iBaseEncoding) {
+ name = PDF_CharNameFromPredefinedCharSet(iBaseEncoding, charcode);
+ }
+ if (name == NULL || name[0] == 0) {
+ return NULL;
+ }
+ return name;
+}
+FX_BOOL CPDF_SimpleFont::LoadCommon()
+{
+ CPDF_Dictionary* pFontDesc = m_pFontDict->GetDict(FX_BSTRC("FontDescriptor"));
+ if (pFontDesc) {
+ LoadFontDescriptor(pFontDesc);
+ }
+ CPDF_Array* pWidthArray = m_pFontDict->GetArray(FX_BSTRC("Widths"));
+ int width_start = 0, width_end = -1;
+ m_bUseFontWidth = TRUE;
+ if (pWidthArray) {
+ m_bUseFontWidth = FALSE;
+ if (pFontDesc && pFontDesc->KeyExist(FX_BSTRC("MissingWidth"))) {
+ int MissingWidth = pFontDesc->GetInteger(FX_BSTRC("MissingWidth"));
+ for (int i = 0; i < 256; i ++) {
+ m_CharWidth[i] = MissingWidth;
+ }
+ }
+ width_start = m_pFontDict->GetInteger(FX_BSTRC("FirstChar"), 0);
+ width_end = m_pFontDict->GetInteger(FX_BSTRC("LastChar"), 0);
+ if (width_start >= 0 && width_start <= 255) {
+ if (width_end <= 0 || width_end >= width_start + (int)pWidthArray->GetCount()) {
+ width_end = width_start + pWidthArray->GetCount() - 1;
+ }
+ if (width_end > 255) {
+ width_end = 255;
+ }
+ for (int i = width_start; i <= width_end; i ++) {
+ m_CharWidth[i] = pWidthArray->GetInteger(i - width_start);
+ }
+ }
+ }
+ if (m_pFontFile == NULL) {
+ LoadSubstFont();
+ } else {
+ if (m_BaseFont.GetLength() > 8 && m_BaseFont[7] == '+') {
+ m_BaseFont = m_BaseFont.Mid(8);
+ }
+ }
+ if (!(m_Flags & PDFFONT_SYMBOLIC)) {
+ m_BaseEncoding = PDFFONT_ENCODING_STANDARD;
+ }
+ CPDF_Object* pEncoding = m_pFontDict->GetElementValue(FX_BSTRC("Encoding"));
+ LoadPDFEncoding(pEncoding, m_BaseEncoding, m_pCharNames, m_pFontFile != NULL, m_Font.IsTTFont());
+ LoadGlyphMap();
+ if (m_pCharNames) {
+ FX_DELETE_VECTOR(m_pCharNames, CFX_ByteString, 256);
+ m_pCharNames = NULL;
+ }
+ if (m_Font.m_Face == NULL) {
+ return TRUE;
+ }
+ if (m_Flags & PDFFONT_ALLCAP) {
+ unsigned char lowercases[] = {'a', 'z', 0xe0, 0xf6, 0xf8, 0xfd};
+ for (int range = 0; range < sizeof lowercases / 2; range ++) {
+ for (int i = lowercases[range * 2]; i <= lowercases[range * 2 + 1]; i ++) {
+ if (m_GlyphIndex[i] != 0xffff && m_pFontFile != NULL) {
+ continue;
+ }
+ m_GlyphIndex[i] = m_GlyphIndex[i - 32];
+ if (m_CharWidth[i - 32]) {
+ m_CharWidth[i] = m_CharWidth[i - 32];
+ m_CharBBox[i] = m_CharBBox[i - 32];
+ }
+ }
+ }
+ }
+ CheckFontMetrics();
+ return TRUE;
+}
+void CPDF_SimpleFont::LoadSubstFont()
+{
+ if (!m_bUseFontWidth && !(m_Flags & PDFFONT_FIXEDPITCH)) {
+ int width = 0, i;
+ for (i = 0; i < 256; i ++) {
+ if (m_CharWidth[i] == 0 || m_CharWidth[i] == 0xffff) {
+ continue;
+ }
+ if (width == 0) {
+ width = m_CharWidth[i];
+ } else if (width != m_CharWidth[i]) {
+ break;
+ }
+ }
+ if (i == 256 && width) {
+ m_Flags |= PDFFONT_FIXEDPITCH;
+ }
+ }
+ int weight = m_StemV < 140 ? m_StemV * 5 : (m_StemV * 4 + 140);
+ m_Font.LoadSubst(m_BaseFont, m_FontType == PDFFONT_TRUETYPE, m_Flags, weight, m_ItalicAngle, 0);
+ if (m_Font.m_pSubstFont->m_SubstFlags & FXFONT_SUBST_NONSYMBOL) {
+ }
+}
+FX_BOOL CPDF_SimpleFont::IsUnicodeCompatible() const
+{
+ return m_BaseEncoding != PDFFONT_ENCODING_BUILTIN && m_BaseEncoding != PDFFONT_ENCODING_ADOBE_SYMBOL &&
+ m_BaseEncoding != PDFFONT_ENCODING_ZAPFDINGBATS;
+}
+CPDF_Type1Font::CPDF_Type1Font()
+{
+ m_Base14Font = -1;
+}
+FX_BOOL CPDF_Type1Font::_Load()
+{
+ m_Base14Font = _PDF_GetStandardFontName(m_BaseFont);
+ if (m_Base14Font >= 0) {
+ CPDF_Dictionary* pFontDesc = m_pFontDict->GetDict(FX_BSTRC("FontDescriptor"));
+ if (pFontDesc && pFontDesc->KeyExist(FX_BSTRC("Flags"))) {
+ m_Flags = pFontDesc->GetInteger(FX_BSTRC("Flags"));
+ } else {
+ m_Flags = m_Base14Font >= 12 ? PDFFONT_SYMBOLIC : PDFFONT_NONSYMBOLIC;
+ }
+ if (m_Base14Font < 4)
+ for (int i = 0; i < 256; i ++) {
+ m_CharWidth[i] = 600;
+ }
+ if (m_Base14Font == 12) {
+ m_BaseEncoding = PDFFONT_ENCODING_ADOBE_SYMBOL;
+ } else if (m_Base14Font == 13) {
+ m_BaseEncoding = PDFFONT_ENCODING_ZAPFDINGBATS;
+ } else if (m_Flags & PDFFONT_NONSYMBOLIC) {
+ m_BaseEncoding = PDFFONT_ENCODING_STANDARD;
+ }
+ }
+ return LoadCommon();
+}
+static FX_BOOL FT_UseType1Charmap(FXFT_Face face)
+{
+ if (FXFT_Get_Face_CharmapCount(face) == 0) {
+ return FALSE;
+ }
+ if (FXFT_Get_Face_CharmapCount(face) == 1 &&
+ FXFT_Get_Charmap_Encoding(FXFT_Get_Face_Charmaps(face)[0]) == FXFT_ENCODING_UNICODE) {
+ return FALSE;
+ }
+ if (FXFT_Get_Charmap_Encoding(FXFT_Get_Face_Charmaps(face)[0]) == FXFT_ENCODING_UNICODE) {
+ FXFT_Set_Charmap(face, FXFT_Get_Face_Charmaps(face)[1]);
+ } else {
+ FXFT_Set_Charmap(face, FXFT_Get_Face_Charmaps(face)[0]);
+ }
+ return TRUE;
+}
+extern FX_WCHAR FT_UnicodeFromCharCode(int encoding, FX_DWORD charcode);
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
+#include "../../fxge/apple/apple_int.h"
+#endif
+int CPDF_Type1Font::GlyphFromCharCodeExt(FX_DWORD charcode)
+{
+ if (charcode > 0xff) {
+ return -1;
+ }
+ int index = m_ExtGID[(FX_BYTE)charcode];
+ if (index == 0xffff) {
+ return -1;
+ }
+ return index;
+}
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
+struct _GlyphNameMap {
+ FX_LPCSTR m_pStrAdobe;
+ FX_LPCSTR m_pStrUnicode;
+};
+static const _GlyphNameMap g_GlyphNameSubsts[] = {
+ {"ff", "uniFB00"},
+ {"fi", "uniFB01"},
+ {"fl", "uniFB02"},
+ {"ffi", "uniFB03"},
+ {"ffl", "uniFB04"}
+};
+extern "C" {
+ static int compareString(const void* key, const void* element)
+ {
+ return FXSYS_stricmp((FX_LPCSTR)key, ((_GlyphNameMap*)element)->m_pStrAdobe);
+ }
+}
+static FX_LPCSTR _GlyphNameRemap(FX_LPCSTR pStrAdobe)
+{
+ _GlyphNameMap* found = (_GlyphNameMap*)FXSYS_bsearch(pStrAdobe, g_GlyphNameSubsts,
+ sizeof g_GlyphNameSubsts / sizeof(_GlyphNameMap), sizeof(_GlyphNameMap),
+ compareString);
+ if (found) {
+ return found->m_pStrUnicode;
+ }
+ return NULL;
+}
+#endif
+void CPDF_Type1Font::LoadGlyphMap()
+{
+ if (m_Font.m_Face == NULL) {
+ return;
+ }
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
+ FX_BOOL bCoreText = TRUE;
+ CQuartz2D & quartz2d = ((CApplePlatform *) CFX_GEModule::Get()->GetPlatformData())->_quartz2d;
+ if (!m_Font.m_pPlatformFont) {
+ if (m_Font.GetPsName() == CFX_WideString::FromLocal("DFHeiStd-W5")) {
+ bCoreText = FALSE;
+ }
+ m_Font.m_pPlatformFont = quartz2d.CreateFont(m_Font.m_pFontData, m_Font.m_dwSize);
+ if (NULL == m_Font.m_pPlatformFont) {
+ bCoreText = FALSE;
+ }
+ }
+#endif
+ if (!IsEmbedded() && (m_Base14Font < 12) && m_Font.IsTTFont()) {
+ if (FT_UseTTCharmap(m_Font.m_Face, 3, 0)) {
+ FX_BOOL bGotOne = FALSE;
+ for (int charcode = 0; charcode < 256; charcode ++) {
+ const FX_BYTE prefix[4] = {0x00, 0xf0, 0xf1, 0xf2};
+ for (int j = 0; j < 4; j ++) {
+ FX_WORD unicode = prefix[j] * 256 + charcode;
+ m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.m_Face, unicode);
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
+ FX_CHAR name_glyph[256];
+ FXFT_Get_Glyph_Name(m_Font.m_Face, m_GlyphIndex[charcode], name_glyph, 256);
+ name_glyph[255] = 0;
+ CFStringRef name_ct = CFStringCreateWithCStringNoCopy(kCFAllocatorDefault, name_glyph, kCFStringEncodingASCII, kCFAllocatorNull);
+ m_ExtGID[charcode] = CGFontGetGlyphWithGlyphName((CGFontRef)m_Font.m_pPlatformFont, name_ct);
+ if (name_ct) {
+ CFRelease(name_ct);
+ }
+#endif
+ if (m_GlyphIndex[charcode]) {
+ bGotOne = TRUE;
+ break;
+ }
+ }
+ }
+ if (bGotOne) {
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
+ if (!bCoreText) {
+ FXSYS_memcpy32(m_ExtGID, m_GlyphIndex, 256);
+ }
+#endif
+ return;
+ }
+ }
+ FXFT_Select_Charmap(m_Font.m_Face, FXFT_ENCODING_UNICODE);
+ if (m_BaseEncoding == 0) {
+ m_BaseEncoding = PDFFONT_ENCODING_STANDARD;
+ }
+ for (int charcode = 0; charcode < 256; charcode ++) {
+ FX_LPCSTR name = GetAdobeCharName(m_BaseEncoding, m_pCharNames, charcode);
+ if (name == NULL) {
+ continue;
+ }
+ m_Encoding.m_Unicodes[charcode] = PDF_UnicodeFromAdobeName(name);
+ m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.m_Face, m_Encoding.m_Unicodes[charcode]);
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
+ FX_CHAR name_glyph[256];
+ FXFT_Get_Glyph_Name(m_Font.m_Face, m_GlyphIndex[charcode], name_glyph, 256);
+ name_glyph[255] = 0;
+ CFStringRef name_ct = CFStringCreateWithCStringNoCopy(kCFAllocatorDefault, name_glyph, kCFStringEncodingASCII, kCFAllocatorNull);
+ m_ExtGID[charcode] = CGFontGetGlyphWithGlyphName((CGFontRef)m_Font.m_pPlatformFont, name_ct);
+ if (name_ct) {
+ CFRelease(name_ct);
+ }
+#endif
+ if (m_GlyphIndex[charcode] == 0 && FXSYS_strcmp(name, ".notdef") == 0) {
+ m_Encoding.m_Unicodes[charcode] = 0x20;
+ m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.m_Face, 0x20);
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
+ FX_CHAR name_glyph[256];
+ FXFT_Get_Glyph_Name(m_Font.m_Face, m_GlyphIndex[charcode], name_glyph, 256);
+ name_glyph[255] = 0;
+ CFStringRef name_ct = CFStringCreateWithCStringNoCopy(kCFAllocatorDefault, name_glyph, kCFStringEncodingASCII, kCFAllocatorNull);
+ m_ExtGID[charcode] = CGFontGetGlyphWithGlyphName((CGFontRef)m_Font.m_pPlatformFont, name_ct);
+ if (name_ct) {
+ CFRelease(name_ct);
+ }
+#endif
+ }
+ }
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
+ if (!bCoreText) {
+ FXSYS_memcpy32(m_ExtGID, m_GlyphIndex, 256);
+ }
+#endif
+ return;
+ }
+ FT_UseType1Charmap(m_Font.m_Face);
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
+ if (bCoreText) {
+ if (m_Flags & PDFFONT_SYMBOLIC) {
+ for (int charcode = 0; charcode < 256; charcode ++) {
+ FX_LPCSTR name = GetAdobeCharName(m_BaseEncoding, m_pCharNames, charcode);
+ if (name) {
+ m_Encoding.m_Unicodes[charcode] = PDF_UnicodeFromAdobeName(name);
+ m_GlyphIndex[charcode] = FXFT_Get_Name_Index(m_Font.m_Face, (char*)name);
+ CFStringRef name_ct = CFStringCreateWithCStringNoCopy(kCFAllocatorDefault, name, kCFStringEncodingASCII, kCFAllocatorNull);
+ m_ExtGID[charcode] = CGFontGetGlyphWithGlyphName((CGFontRef)m_Font.m_pPlatformFont, name_ct);
+ if (name_ct) {
+ CFRelease(name_ct);
+ }
+ } else {
+ m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.m_Face, charcode);
+ FX_WCHAR unicode = 0;
+ if (m_GlyphIndex[charcode]) {
+ unicode = FT_UnicodeFromCharCode(PDFFONT_ENCODING_STANDARD, charcode);
+ }
+ FX_CHAR name_glyph[256];
+ FXSYS_memset32(name_glyph, 0, sizeof(name_glyph));
+ FXFT_Get_Glyph_Name(m_Font.m_Face, m_GlyphIndex[charcode], name_glyph, 256);
+ name_glyph[255] = 0;
+ if (unicode == 0 && name_glyph[0] != 0) {
+ unicode = PDF_UnicodeFromAdobeName(name_glyph);
+ }
+ m_Encoding.m_Unicodes[charcode] = unicode;
+ CFStringRef name_ct = CFStringCreateWithCStringNoCopy(kCFAllocatorDefault, name_glyph, kCFStringEncodingASCII, kCFAllocatorNull);
+ m_ExtGID[charcode] = CGFontGetGlyphWithGlyphName((CGFontRef)m_Font.m_pPlatformFont, name_ct);
+ if (name_ct) {
+ CFRelease(name_ct);
+ }
+ }
+ }
+ return;
+ }
+ FX_BOOL bUnicode = FALSE;
+ if (0 == FXFT_Select_Charmap(m_Font.m_Face, FXFT_ENCODING_UNICODE)) {
+ bUnicode = TRUE;
+ }
+ for (int charcode = 0; charcode < 256; charcode ++) {
+ FX_LPCSTR name = GetAdobeCharName(m_BaseEncoding, m_pCharNames, charcode);
+ if (name == NULL) {
+ continue;
+ }
+ m_Encoding.m_Unicodes[charcode] = PDF_UnicodeFromAdobeName(name);
+ FX_LPCSTR pStrUnicode = _GlyphNameRemap(name);
+ if (pStrUnicode && 0 == FXFT_Get_Name_Index(m_Font.m_Face, (char*)name)) {
+ name = pStrUnicode;
+ }
+ m_GlyphIndex[charcode] = FXFT_Get_Name_Index(m_Font.m_Face, (char*)name);
+ CFStringRef name_ct = CFStringCreateWithCStringNoCopy(kCFAllocatorDefault, name, kCFStringEncodingASCII, kCFAllocatorNull);
+ m_ExtGID[charcode] = CGFontGetGlyphWithGlyphName((CGFontRef)m_Font.m_pPlatformFont, name_ct);
+ if (name_ct) {
+ CFRelease(name_ct);
+ }
+ if (m_GlyphIndex[charcode] == 0) {
+ if (FXSYS_strcmp(name, ".notdef") != 0 && FXSYS_strcmp(name, "space") != 0) {
+ m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.m_Face, bUnicode ? m_Encoding.m_Unicodes[charcode] : charcode);
+ FX_CHAR name_glyph[256];
+ FXFT_Get_Glyph_Name(m_Font.m_Face, m_GlyphIndex[charcode], name_glyph, 256);
+ name_glyph[255] = 0;
+ CFStringRef name_ct = CFStringCreateWithCStringNoCopy(kCFAllocatorDefault, name_glyph, kCFStringEncodingASCII, kCFAllocatorNull);
+ m_ExtGID[charcode] = CGFontGetGlyphWithGlyphName((CGFontRef)m_Font.m_pPlatformFont, name_ct);
+ if (name_ct) {
+ CFRelease(name_ct);
+ }
+ } else {
+ m_Encoding.m_Unicodes[charcode] = 0x20;
+ m_GlyphIndex[charcode] = bUnicode ? FXFT_Get_Char_Index(m_Font.m_Face, 0x20) : 0xffff;
+ FX_CHAR name_glyph[256];
+ FXFT_Get_Glyph_Name(m_Font.m_Face, m_GlyphIndex[charcode], name_glyph, 256);
+ name_glyph[255] = 0;
+ CFStringRef name_ct = CFStringCreateWithCStringNoCopy(kCFAllocatorDefault, name_glyph, kCFStringEncodingASCII, kCFAllocatorNull);
+ m_ExtGID[charcode] = CGFontGetGlyphWithGlyphName((CGFontRef)m_Font.m_pPlatformFont, name_ct);
+ if (name_ct) {
+ CFRelease(name_ct);
+ }
+ }
+ }
+ }
+ return;
+ }
+#endif
+ if (m_Flags & PDFFONT_SYMBOLIC) {
+ for (int charcode = 0; charcode < 256; charcode ++) {
+ FX_LPCSTR name = GetAdobeCharName(m_BaseEncoding, m_pCharNames, charcode);
+ if (name) {
+ m_Encoding.m_Unicodes[charcode] = PDF_UnicodeFromAdobeName(name);
+ m_GlyphIndex[charcode] = FXFT_Get_Name_Index(m_Font.m_Face, (char*)name);
+ } else {
+ m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.m_Face, charcode);
+ if (m_GlyphIndex[charcode]) {
+ FX_WCHAR unicode = FT_UnicodeFromCharCode(PDFFONT_ENCODING_STANDARD, charcode);
+ if (unicode == 0) {
+ FX_CHAR name_glyph[256];
+ FXSYS_memset32(name_glyph, 0, sizeof(name_glyph));
+ FXFT_Get_Glyph_Name(m_Font.m_Face, m_GlyphIndex[charcode], name_glyph, 256);
+ name_glyph[255] = 0;
+ if (name_glyph[0] != 0) {
+ unicode = PDF_UnicodeFromAdobeName(name_glyph);
+ }
+ }
+ m_Encoding.m_Unicodes[charcode] = unicode;
+ }
+ }
+ }
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
+ if (!bCoreText) {
+ FXSYS_memcpy32(m_ExtGID, m_GlyphIndex, 256);
+ }
+#endif
+ return;
+ }
+ FX_BOOL bUnicode = FALSE;
+ if (0 == FXFT_Select_Charmap(m_Font.m_Face, FXFT_ENCODING_UNICODE)) {
+ bUnicode = TRUE;
+ }
+ for (int charcode = 0; charcode < 256; charcode ++) {
+ FX_LPCSTR name = GetAdobeCharName(m_BaseEncoding, m_pCharNames, charcode);
+ if (name == NULL) {
+ continue;
+ }
+ m_Encoding.m_Unicodes[charcode] = PDF_UnicodeFromAdobeName(name);
+ m_GlyphIndex[charcode] = FXFT_Get_Name_Index(m_Font.m_Face, (char*)name);
+ if (m_GlyphIndex[charcode] == 0) {
+ if (FXSYS_strcmp(name, ".notdef") != 0 && FXSYS_strcmp(name, "space") != 0) {
+ m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.m_Face, bUnicode ? m_Encoding.m_Unicodes[charcode] : charcode);
+ } else {
+ m_Encoding.m_Unicodes[charcode] = 0x20;
+ m_GlyphIndex[charcode] = 0xffff;
+ }
+ }
+ }
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
+ if (!bCoreText) {
+ FXSYS_memcpy32(m_ExtGID, m_GlyphIndex, 256);
+ }
+#endif
+}
+CPDF_FontEncoding::CPDF_FontEncoding()
+{
+ FXSYS_memset32(m_Unicodes, 0, sizeof(m_Unicodes));
+}
+int CPDF_FontEncoding::CharCodeFromUnicode(FX_WCHAR unicode) const
+{
+ for (int i = 0; i < 256; i ++)
+ if (m_Unicodes[i] == unicode) {
+ return i;
+ }
+ return -1;
+}
+CPDF_FontEncoding::CPDF_FontEncoding(int PredefinedEncoding)
+{
+ const FX_WORD* pSrc = PDF_UnicodesForPredefinedCharSet(PredefinedEncoding);
+ if (!pSrc) {
+ FXSYS_memset32(m_Unicodes, 0, sizeof(m_Unicodes));
+ } else
+ for (int i = 0; i < 256; i++) {
+ m_Unicodes[i] = pSrc[i];
+ }
+}
+FX_BOOL CPDF_FontEncoding::IsIdentical(CPDF_FontEncoding* pAnother) const
+{
+ return FXSYS_memcmp32(m_Unicodes, pAnother->m_Unicodes, sizeof(m_Unicodes)) == 0;
+}
+CPDF_Object* CPDF_FontEncoding::Realize()
+{
+ int predefined = 0;
+ for (int cs = PDFFONT_ENCODING_WINANSI; cs < PDFFONT_ENCODING_ZAPFDINGBATS; cs ++) {
+ const FX_WORD* pSrc = PDF_UnicodesForPredefinedCharSet(cs);
+ FX_BOOL match = TRUE;
+ for (int i = 0; i < 256; ++i) {
+ if (m_Unicodes[i] != pSrc[i]) {
+ match = FALSE;
+ break;
+ }
+ }
+ if (match) {
+ predefined = cs;
+ break;
+ }
+ }
+ if (predefined) {
+ if (predefined == PDFFONT_ENCODING_WINANSI) {
+ return CPDF_Name::Create("WinAnsiEncoding");
+ }
+ if (predefined == PDFFONT_ENCODING_MACROMAN) {
+ return CPDF_Name::Create("MacRomanEncoding");
+ }
+ if (predefined == PDFFONT_ENCODING_MACEXPERT) {
+ return CPDF_Name::Create("MacExpertEncoding");
+ }
+ return NULL;
+ }
+ CPDF_Dictionary* pDict = CPDF_Dictionary::Create();
+ pDict->SetAtName(FX_BSTRC("BaseEncoding"), FX_BSTRC("WinAnsiEncoding"));
+ const FX_WORD* pStandard = PDF_UnicodesForPredefinedCharSet(PDFFONT_ENCODING_WINANSI);
+ CPDF_Array* pDiff = CPDF_Array::Create();
+ for (int i = 0; i < 256; i ++) {
+ if (pStandard[i] == m_Unicodes[i]) {
+ continue;
+ }
+ pDiff->Add(CPDF_Number::Create(i));
+ pDiff->Add(CPDF_Name::Create(PDF_AdobeNameFromUnicode(m_Unicodes[i])));
+ }
+ pDict->SetAt(FX_BSTRC("Differences"), pDiff);
+ return pDict;
+}
+CPDF_TrueTypeFont::CPDF_TrueTypeFont()
+{
+}
+FX_BOOL CPDF_TrueTypeFont::_Load()
+{
+ return LoadCommon();
+}
+extern FX_DWORD FT_CharCodeFromUnicode(int encoding, FX_WCHAR unicode);
+void CPDF_TrueTypeFont::LoadGlyphMap()
+{
+ if (m_Font.m_Face == NULL) {
+ return;
+ }
+ int baseEncoding = m_BaseEncoding;
+ if (m_pFontFile && m_Font.m_Face->num_charmaps > 0
+ && (baseEncoding == PDFFONT_ENCODING_MACROMAN || baseEncoding == PDFFONT_ENCODING_WINANSI)
+ && (m_Flags & PDFFONT_SYMBOLIC)) {
+ FX_BOOL bSupportWin = FALSE;
+ FX_BOOL bSupportMac = FALSE;
+ for (int i = 0; i < FXFT_Get_Face_CharmapCount(m_Font.m_Face); i++) {
+ int platform_id = FXFT_Get_Charmap_PlatformID(FXFT_Get_Face_Charmaps(m_Font.m_Face)[i]);
+ if (platform_id == 0 || platform_id == 3) {
+ bSupportWin = TRUE;
+ } else if (platform_id == 0 || platform_id == 1) {
+ bSupportMac = TRUE;
+ }
+ }
+ if (baseEncoding == PDFFONT_ENCODING_WINANSI && !bSupportWin) {
+ baseEncoding = bSupportMac ? PDFFONT_ENCODING_MACROMAN : PDFFONT_ENCODING_BUILTIN;
+ } else if (baseEncoding == PDFFONT_ENCODING_MACROMAN && !bSupportMac) {
+ baseEncoding = bSupportWin ? PDFFONT_ENCODING_WINANSI : PDFFONT_ENCODING_BUILTIN;
+ }
+ }
+ if (((baseEncoding == PDFFONT_ENCODING_MACROMAN || baseEncoding == PDFFONT_ENCODING_WINANSI)
+ && m_pCharNames == NULL) || (m_Flags & PDFFONT_NONSYMBOLIC)) {
+ if (!FXFT_Has_Glyph_Names(m_Font.m_Face) && (!m_Font.m_Face->num_charmaps || !m_Font.m_Face->charmaps)) {
+ int nStartChar = m_pFontDict->GetInteger(FX_BSTRC("FirstChar"));
+ int charcode = 0;
+ for (; charcode < nStartChar; charcode ++) {
+ m_GlyphIndex[charcode] = 0;
+ }
+ FX_WORD nGlyph = charcode - nStartChar + 3;
+ for (; charcode < 256; charcode ++, nGlyph ++) {
+ m_GlyphIndex[charcode] = nGlyph;
+ }
+ return;
+ }
+ FX_BOOL bMSUnicode = FT_UseTTCharmap(m_Font.m_Face, 3, 1);
+ FX_BOOL bMacRoman = FALSE, bMSSymbol = FALSE;
+ if (!bMSUnicode) {
+ if (m_Flags & PDFFONT_NONSYMBOLIC) {
+ bMacRoman = FT_UseTTCharmap(m_Font.m_Face, 1, 0);
+ bMSSymbol = !bMacRoman && FT_UseTTCharmap(m_Font.m_Face, 3, 0);
+ } else {
+ bMSSymbol = FT_UseTTCharmap(m_Font.m_Face, 3, 0);
+ bMacRoman = !bMSSymbol && FT_UseTTCharmap(m_Font.m_Face, 1, 0);
+ }
+ }
+ FX_BOOL bToUnicode = m_pFontDict->KeyExist(FX_BSTRC("ToUnicode"));
+ for (int charcode = 0; charcode < 256; charcode ++) {
+ FX_LPCSTR name = GetAdobeCharName(baseEncoding, m_pCharNames, charcode);
+ if (name == NULL) {
+ m_GlyphIndex[charcode] = m_pFontFile ? FXFT_Get_Char_Index(m_Font.m_Face, charcode) : -1;
+ continue;
+ }
+ m_Encoding.m_Unicodes[charcode] = PDF_UnicodeFromAdobeName(name);
+ if (bMSSymbol) {
+ const FX_BYTE prefix[4] = {0x00, 0xf0, 0xf1, 0xf2};
+ for (int j = 0; j < 4; j ++) {
+ FX_WORD unicode = prefix[j] * 256 + charcode;
+ m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.m_Face, unicode);
+ if (m_GlyphIndex[charcode]) {
+ break;
+ }
+ }
+ } else if (m_Encoding.m_Unicodes[charcode]) {
+ if (bMSUnicode) {
+ m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.m_Face, m_Encoding.m_Unicodes[charcode]);
+ } else if (bMacRoman) {
+ FX_DWORD maccode = FT_CharCodeFromUnicode(FXFT_ENCODING_APPLE_ROMAN, m_Encoding.m_Unicodes[charcode]);
+ if (!maccode) {
+ m_GlyphIndex[charcode] = FXFT_Get_Name_Index(m_Font.m_Face, (char *)name);
+ } else {
+ m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.m_Face, maccode);
+ }
+ }
+ }
+ if ((m_GlyphIndex[charcode] == 0 || m_GlyphIndex[charcode] == 0xffff) && name != NULL) {
+ if (name[0] == '.' && FXSYS_strcmp(name, ".notdef") == 0) {
+ m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.m_Face, 32);
+ } else {
+ m_GlyphIndex[charcode] = FXFT_Get_Name_Index(m_Font.m_Face, (char*)name);
+ if (m_GlyphIndex[charcode] == 0) {
+ if (bToUnicode) {
+ CFX_WideString wsUnicode = UnicodeFromCharCode(charcode);
+ if (!wsUnicode.IsEmpty()) {
+ m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.m_Face, wsUnicode[0]);
+ m_Encoding.m_Unicodes[charcode] = wsUnicode[0];
+ }
+ }
+ if (m_GlyphIndex[charcode] == 0) {
+ m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.m_Face, charcode);
+ }
+ }
+ }
+ }
+ }
+ return;
+ }
+ if (FT_UseTTCharmap(m_Font.m_Face, 3, 0)) {
+ const FX_BYTE prefix[4] = {0x00, 0xf0, 0xf1, 0xf2};
+ FX_BOOL bGotOne = FALSE;
+ for (int charcode = 0; charcode < 256; charcode ++) {
+ for (int j = 0; j < 4; j ++) {
+ FX_WORD unicode = prefix[j] * 256 + charcode;
+ m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.m_Face, unicode);
+ if (m_GlyphIndex[charcode]) {
+ bGotOne = TRUE;
+ break;
+ }
+ }
+ }
+ if (bGotOne) {
+ if (baseEncoding != PDFFONT_ENCODING_BUILTIN) {
+ for (int charcode = 0; charcode < 256; charcode ++) {
+ FX_LPCSTR name = GetAdobeCharName(baseEncoding, m_pCharNames, charcode);
+ if (name == NULL) {
+ continue;
+ }
+ m_Encoding.m_Unicodes[charcode] = PDF_UnicodeFromAdobeName(name);
+ }
+ } else if (FT_UseTTCharmap(m_Font.m_Face, 1, 0)) {
+ for (int charcode = 0; charcode < 256; charcode ++) {
+ m_Encoding.m_Unicodes[charcode] = FT_UnicodeFromCharCode(FXFT_ENCODING_APPLE_ROMAN, charcode);
+ }
+ }
+ return;
+ }
+ }
+ if (FT_UseTTCharmap(m_Font.m_Face, 1, 0)) {
+ FX_BOOL bGotOne = FALSE;
+ for (int charcode = 0; charcode < 256; charcode ++) {
+ m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.m_Face, charcode);
+ m_Encoding.m_Unicodes[charcode] = FT_UnicodeFromCharCode(FXFT_ENCODING_APPLE_ROMAN, charcode);
+ if (m_GlyphIndex[charcode]) {
+ bGotOne = TRUE;
+ }
+ }
+ if (m_pFontFile || bGotOne) {
+ return;
+ }
+ }
+ if (FXFT_Select_Charmap(m_Font.m_Face, FXFT_ENCODING_UNICODE) == 0) {
+ FX_BOOL bGotOne = FALSE;
+ const FX_WORD* pUnicodes = PDF_UnicodesForPredefinedCharSet(baseEncoding);
+ for (int charcode = 0; charcode < 256; charcode ++) {
+ if (m_pFontFile == NULL) {
+ FX_LPCSTR name = GetAdobeCharName(0, m_pCharNames, charcode);
+ if (name != NULL) {
+ m_Encoding.m_Unicodes[charcode] = PDF_UnicodeFromAdobeName(name);
+ } else if (pUnicodes) {
+ m_Encoding.m_Unicodes[charcode] = pUnicodes[charcode];
+ }
+ } else {
+ m_Encoding.m_Unicodes[charcode] = charcode;
+ }
+ m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.m_Face, m_Encoding.m_Unicodes[charcode]);
+ if (m_GlyphIndex[charcode]) {
+ bGotOne = TRUE;
+ }
+ }
+ if (bGotOne) {
+ return;
+ }
+ }
+ for (int charcode = 0; charcode < 256; charcode ++) {
+ m_GlyphIndex[charcode] = charcode;
+ }
+}
+CPDF_Type3Font::CPDF_Type3Font()
+{
+ m_pPageResources = NULL;
+ FXSYS_memset32(m_CharWidthL, 0, sizeof m_CharWidthL);
+}
+CPDF_Type3Font::~CPDF_Type3Font()
+{
+ FX_POSITION pos = m_CacheMap.GetStartPosition();
+ while (pos) {
+ FX_LPVOID key, value;
+ m_CacheMap.GetNextAssoc(pos, key, value);
+ delete (CPDF_Type3Char*)value;
+ }
+ m_CacheMap.RemoveAll();
+ pos = m_DeletedMap.GetStartPosition();
+ while (pos) {
+ FX_LPVOID key, value;
+ m_DeletedMap.GetNextAssoc(pos, key, value);
+ delete (CPDF_Type3Char*)key;
+ }
+}
+FX_BOOL CPDF_Type3Font::_Load()
+{
+ m_pFontResources = m_pFontDict->GetDict(FX_BSTRC("Resources"));
+ CPDF_Array* pMatrix = m_pFontDict->GetArray(FX_BSTRC("FontMatrix"));
+ FX_FLOAT xscale = 1.0f, yscale = 1.0f;
+ if (pMatrix) {
+ m_FontMatrix = pMatrix->GetMatrix();
+ xscale = m_FontMatrix.a;
+ yscale = m_FontMatrix.d;
+ }
+ CPDF_Array* pBBox = m_pFontDict->GetArray(FX_BSTRC("FontBBox"));
+ if (pBBox) {
+ m_FontBBox.left = (FX_INT32)(FXSYS_Mul(pBBox->GetNumber(0), xscale) * 1000);
+ m_FontBBox.bottom = (FX_INT32)(FXSYS_Mul(pBBox->GetNumber(1), yscale) * 1000);
+ m_FontBBox.right = (FX_INT32)(FXSYS_Mul(pBBox->GetNumber(2), xscale) * 1000);
+ m_FontBBox.top = (FX_INT32)(FXSYS_Mul(pBBox->GetNumber(3), yscale) * 1000);
+ }
+ int StartChar = m_pFontDict->GetInteger(FX_BSTRC("FirstChar"));
+ CPDF_Array* pWidthArray = m_pFontDict->GetArray(FX_BSTRC("Widths"));
+ if (pWidthArray && (StartChar >= 0 && StartChar < 256)) {
+ FX_DWORD count = pWidthArray->GetCount();
+ if (count > 256) {
+ count = 256;
+ }
+ if (StartChar + count > 256) {
+ count = 256 - StartChar;
+ }
+ for (FX_DWORD i = 0; i < count; i ++) {
+ m_CharWidthL[StartChar + i] = FXSYS_round(FXSYS_Mul(pWidthArray->GetNumber(i), xscale) * 1000);
+ }
+ }
+ m_pCharProcs = m_pFontDict->GetDict(FX_BSTRC("CharProcs"));
+ CPDF_Object* pEncoding = m_pFontDict->GetElementValue(FX_BSTRC("Encoding"));
+ if (pEncoding) {
+ LoadPDFEncoding(pEncoding, m_BaseEncoding, m_pCharNames, FALSE, FALSE);
+ if (m_pCharNames) {
+ for (int i = 0; i < 256; i ++) {
+ m_Encoding.m_Unicodes[i] = PDF_UnicodeFromAdobeName(m_pCharNames[i]);
+ if (m_Encoding.m_Unicodes[i] == 0) {
+ m_Encoding.m_Unicodes[i] = i;
+ }
+ }
+ }
+ }
+ return TRUE;
+}
+void CPDF_Type3Font::CheckType3FontMetrics()
+{
+ CheckFontMetrics();
+}
+CPDF_Type3Char* CPDF_Type3Font::LoadChar(FX_DWORD charcode, int level)
+{
+ if (level >= _FPDF_MAX_TYPE3_FORM_LEVEL_) {
+ return NULL;
+ }
+ CPDF_Type3Char* pChar = NULL;
+ if (m_CacheMap.Lookup((FX_LPVOID)(FX_UINTPTR)charcode, (FX_LPVOID&)pChar)) {
+ if (pChar->m_bPageRequired && m_pPageResources) {
+ delete pChar;
+ m_CacheMap.RemoveKey((FX_LPVOID)(FX_UINTPTR)charcode);
+ return LoadChar(charcode, level + 1);
+ }
+ return pChar;
+ }
+ FX_LPCSTR name = GetAdobeCharName(m_BaseEncoding, m_pCharNames, charcode);
+ if (name == NULL) {
+ return NULL;
+ }
+ CPDF_Stream* pStream = (CPDF_Stream*)m_pCharProcs->GetElementValue(name);
+ if (pStream == NULL || pStream->GetType() != PDFOBJ_STREAM) {
+ return NULL;
+ }
+ pChar = FX_NEW CPDF_Type3Char;
+ pChar->m_pForm = FX_NEW CPDF_Form(m_pDocument, m_pFontResources ? m_pFontResources : m_pPageResources, pStream, NULL);
+ pChar->m_pForm->ParseContent(NULL, NULL, pChar, NULL, level + 1);
+ FX_FLOAT scale = m_FontMatrix.GetXUnit();
+ pChar->m_Width = (FX_INT32)(pChar->m_Width * scale + 0.5f);
+ FX_RECT &rcBBox = pChar->m_BBox;
+ CFX_FloatRect char_rect((FX_FLOAT)rcBBox.left / 1000.0f, (FX_FLOAT)rcBBox.bottom / 1000.0f,
+ (FX_FLOAT)rcBBox.right / 1000.0f, (FX_FLOAT)rcBBox.top / 1000.0f);
+ if (rcBBox.right <= rcBBox.left || rcBBox.bottom >= rcBBox.top) {
+ char_rect = pChar->m_pForm->CalcBoundingBox();
+ }
+ char_rect.Transform(&m_FontMatrix);
+ rcBBox.left = FXSYS_round(char_rect.left * 1000);
+ rcBBox.right = FXSYS_round(char_rect.right * 1000);
+ rcBBox.top = FXSYS_round(char_rect.top * 1000);
+ rcBBox.bottom = FXSYS_round(char_rect.bottom * 1000);
+ m_CacheMap.SetAt((FX_LPVOID)(FX_UINTPTR)charcode, pChar);
+ if (pChar->m_pForm->CountObjects() == 0) {
+ delete pChar->m_pForm;
+ pChar->m_pForm = NULL;
+ }
+ return pChar;
+}
+int CPDF_Type3Font::GetCharWidthF(FX_DWORD charcode, int level)
+{
+ if (charcode > 0xff) {
+ charcode = 0;
+ }
+ if (m_CharWidthL[charcode]) {
+ return m_CharWidthL[charcode];
+ }
+ CPDF_Type3Char* pChar = LoadChar(charcode, level);
+ if (pChar == NULL) {
+ return 0;
+ }
+ return pChar->m_Width;
+}
+void CPDF_Type3Font::GetCharBBox(FX_DWORD charcode, FX_RECT& rect, int level)
+{
+ CPDF_Type3Char* pChar = LoadChar(charcode, level);
+ if (pChar == NULL) {
+ rect.left = rect.right = rect.top = rect.bottom = 0;
+ return;
+ }
+ rect = pChar->m_BBox;
+}
+CPDF_Type3Char::CPDF_Type3Char()
+{
+ m_pForm = NULL;
+ m_pBitmap = NULL;
+ m_bPageRequired = FALSE;
+ m_bColored = FALSE;
+}
+CPDF_Type3Char::~CPDF_Type3Char()
+{
+ if (m_pForm) {
+ delete m_pForm;
+ }
+ if (m_pBitmap) {
+ delete m_pBitmap;
+ }
+}
diff --git a/core/src/fpdfapi/fpdf_font/fpdf_font_charset.cpp b/core/src/fpdfapi/fpdf_font/fpdf_font_charset.cpp
index bd09cfc75d..981018b33a 100644
--- a/core/src/fpdfapi/fpdf_font/fpdf_font_charset.cpp
+++ b/core/src/fpdfapi/fpdf_font/fpdf_font_charset.cpp
@@ -1,625 +1,625 @@
-// 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
-
-#include "../../../include/fpdfapi/fpdf_page.h"
-#include "../../../include/fxge/fx_freetype.h"
-extern FX_WCHAR PDF_UnicodeFromAdobeName(const FX_CHAR*);
-const struct _UnicodeAlt {
- FX_WORD m_Unicode;
- const FX_CHAR* m_Alter;
-}
-UnicodeAlts[] = {
- {0x00a0, " "}, {0x00a1, "!"}, {0x00a2, "c"}, {0x00a3, "P"}, {0x00a4, "o"},
- {0x00a5, "Y"}, {0x00a6, "|"}, {0x00a7, "S"}, {0x00a9, "(C)"}, {0x00aa, "a"},
- {0x00ab, "<<"}, {0x00ac, "-|"}, {0x00ae, "(R)"}, {0x00af, "-"},
- {0x00b0, "o"}, {0x00b1, "+/-"}, {0x00b2, "^2"}, { 0x00b3, "^3"},
- {0x00b4, "'"}, {0x00b5, "u"}, {0x00b6, "P"}, {0x00b7, "."},
- {0x00b9, "^1"}, {0x00ba, "o"}, {0x00bb, ">>"}, {0x00bc, "1/4"},
- {0x00bd, "1/2"}, {0x00be, "3/4"}, {0x00bf, "?"}, {0x00c0, "A"},
- {0x00c1, "A"}, {0x00c2, "A"}, {0x00c3, "A"}, {0x00c4, "A"},
- {0x00c5, "A"}, {0x00c6, "AE"}, {0x00c7, "C"}, {0x00c8, "E"},
- {0x00c9, "E"}, {0x00ca, "E"}, {0x00cb, "E"}, {0x00cc, "I"},
- {0x00cd, "I"}, {0x00ce, "I"}, {0x00cf, "I"},
- {0x00d1, "N"}, {0x00d2, "O"}, {0x00d3, "O"}, {0x00d4, "O"},
- {0x00d5, "O"}, {0x00d6, "O"}, {0x00d7, "x"}, {0x00d8, "O"},
- {0x00d9, "U"}, {0x00da, "U"}, {0x00db, "U"}, {0x00dc, "U"},
- {0x00dd, "Y"}, {0x00df, "S"}, {0x00e0, "a"},
- {0x00e1, "a"}, {0x00e2, "a"}, {0x00e3, "a"}, {0x00e4, "a"},
- {0x00e5, "a"}, {0x00e6, "ae"}, {0x00e7, "c"}, {0x00e8, "e"},
- {0x00e9, "e"}, {0x00ea, "e"}, {0x00eb, "e"}, {0x00ec, "i"},
- {0x00ed, "i"}, {0x00ee, "i"}, {0x00ef, "i"},
- {0x00f1, "n"}, {0x00f2, "o"}, {0x00f3, "o"}, {0x00f4, "o"},
- {0x00f5, "o"}, {0x00f6, "o"}, {0x00f7, "/"}, {0x00f8, "o"},
- {0x00f9, "u"}, {0x00fa, "u"}, {0x00fb, "u"}, {0x00fc, "u"},
- {0x00fd, "y"}, {0x00ff, "y"},
- {0x02b0, "h"}, {0x02b2, "j"}, {0x02b3, "r"}, {0x02b7, "w"},
- {0x02b8, "y"}, {0x02b9, "'"}, {0x02ba, "\""}, {0x02bb, "'"},
- {0x02bc, "'"}, {0x02bd, "'"}, {0x02be, "'"}, {0x02bf, "'"},
- {0x02c2, "<"}, {0x02c3, ">"}, {0x02c4, "^"}, {0x02c5, "v"},
- {0x02c6, "^"}, {0x02c7, "v"}, {0x02c8, "'"}, {0x02c9, "-"},
- {0x02ca, "'"}, {0x02cb, "'"}, {0x02cc, "."}, {0x02cd, "_"},
- {0x2010, "-"}, {0x2012, "-"}, {0x2013, "-"}, {0x2014, "--"},
- {0x2015, "--"}, {0x2016, "|"}, {0x2017, "_"},
- {0x2018, "'"}, {0x2019, "'"}, {0x201a, ","}, {0x201b, "'"},
- {0x201c, "\""}, {0x201d, "\""}, {0x201e, ","}, {0x201f, "'"},
- {0x2020, "+"}, {0x2021, "+"}, {0x2022, "*"}, {0x2023, ">"},
- {0x2024, "."}, {0x2025, ".."}, {0x2027, "."}, {0x2032, "'"},
- {0x2033, "\""}, {0x2035, "'"}, {0x2036, "\""}, {0x2038, "^"},
- {0x2039, "<"}, {0x203a, ">"}, {0x203b, "*"}, {0x203c, "!!"},
- {0x203d, "?!"}, {0x203e, "-"}, {0x2044, "/"}, {0x2047, "??"},
- {0x2048, "?!"}, {0x2049, "!?"}, {0x204e, "*"}, {0x2052, "%"},
- {0x2122, "(TM)"},
- {0x2212, "-"}, {0x2215, "/"}, {0x2216, "\\"}, {0x2217, "*"},
- {0x2218, "*"}, {0x2219, "*"}, {0x2223, "|"}, {0x22c5, "."},
- {0x266f, "#"},
- {0XF6D9, "(C)"}, {0XF6DA, "(C)"}, {0XF6DB, "(TM)"},
- {0XF8E8, "(C)"}, {0xf8e9, "(C)"}, {0XF8EA, "(TM)"},
-
- {0xfb01, "fi"}, {0xfb02, "fl"}
-};
-const FX_CHAR* FCS_GetAltStr(FX_WCHAR unicode)
-{
- int begin = 0;
- int end = sizeof UnicodeAlts / sizeof(struct _UnicodeAlt) - 1;
- while (begin <= end) {
- int middle = (begin + end) / 2;
- FX_WORD middlecode = UnicodeAlts[middle].m_Unicode;
- if (middlecode > unicode) {
- end = middle - 1;
- } else if (middlecode < unicode) {
- begin = middle + 1;
- } else {
- return UnicodeAlts[middle].m_Alter;
- }
- }
- return NULL;
-}
-const FX_WORD StandardEncoding[256] = {
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x2019,
- 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, 0x0030, 0x0031,
- 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b,
- 0x003c, 0x003d, 0x003e, 0x003f, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045,
- 0x0046, 0x0047, 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f,
- 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059,
- 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, 0x2018, 0x0061, 0x0062, 0x0063,
- 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d,
- 0x006e, 0x006f, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077,
- 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x00a1, 0x00a2, 0x00a3, 0x2044, 0x00a5, 0x0192, 0x00a7, 0x00a4, 0x0027,
- 0x201c, 0x00ab, 0x2039, 0x203a, 0xfb01, 0xfb02, 0x0000, 0x2013, 0x2020, 0x2021,
- 0x00b7, 0x0000, 0x00b6, 0x2022, 0x201a, 0x201e, 0x201d, 0x00bb, 0x2026, 0x2030,
- 0x0000, 0x00bf, 0x0000, 0x0060, 0x00b4, 0x02c6, 0x02dc, 0x00af, 0x02d8, 0x02d9,
- 0x00a8, 0x0000, 0x02da, 0x00b8, 0x0000, 0x02dd, 0x02db, 0x02c7, 0x2014, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x00c6, 0x0000, 0x00aa, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0141, 0x00d8, 0x0152, 0x00ba, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x00e6, 0x0000, 0x0000, 0x0000, 0x0131, 0x0000, 0x0000, 0x0142, 0x00f8,
- 0x0153, 0x00df, 0x0000, 0x0000, 0x0000, 0x0000
-};
-const FX_WORD MacRomanEncoding[256] = {
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027,
- 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, 0x0030, 0x0031,
- 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b,
- 0x003c, 0x003d, 0x003e, 0x003f, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045,
- 0x0046, 0x0047, 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f,
- 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059,
- 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, 0x0060, 0x0061, 0x0062, 0x0063,
- 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d,
- 0x006e, 0x006f, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077,
- 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x0000, 0x00c4, 0x00c5,
- 0x00c7, 0x00c9, 0x00d1, 0x00d6, 0x00dc, 0x00e1, 0x00e0, 0x00e2, 0x00e4, 0x00e3,
- 0x00e5, 0x00e7, 0x00e9, 0x00e8, 0x00ea, 0x00eb, 0x00ed, 0x00ec, 0x00ee, 0x00ef,
- 0x00f1, 0x00f3, 0x00f2, 0x00f4, 0x00f6, 0x00f5, 0x00fa, 0x00f9, 0x00fb, 0x00fc,
- 0x2020, 0x00b0, 0x00a2, 0x00a3, 0x00a7, 0x2022, 0x00b6, 0x00df, 0x00ae, 0x00a9,
- 0x2122, 0x00b4, 0x00a8, 0x0000, 0x00c6, 0x00d8, 0x0000, 0x00b1, 0x0000, 0x0000,
- 0x00a5, 0x00b5, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x00aa, 0x00ba, 0x0000,
- 0x00e6, 0x00f8, 0x00bf, 0x00a3, 0x00ac, 0x0000, 0x0192, 0x0000, 0x0000, 0x00ab,
- 0x00bb, 0x2026, 0x0020, 0x00c0, 0x00c3, 0x00d5, 0x0152, 0x0153, 0x2013, 0x2014,
- 0x201c, 0x201d, 0x2018, 0x2019, 0x00f7, 0x0000, 0x00ff, 0x0178, 0x2044, 0x00a4,
- 0x2039, 0x203a, 0xfb01, 0xfb02, 0x2021, 0x00b7, 0x201a, 0x201e, 0x2030, 0x00c2,
- 0x00ca, 0x00c1, 0x00cb, 0x00c8, 0x00cd, 0x00ce, 0x00cf, 0x00cc, 0x00d3, 0x00d4,
- 0x0000, 0x00d2, 0x00da, 0x00db, 0x00d9, 0x0131, 0x02c6, 0x02dc, 0x00af, 0x02d8,
- 0x02d9, 0x02da, 0x00b8, 0x02dd, 0x02db, 0x02c7
-};
-const FX_WORD AdobeWinAnsiEncoding[256] = {
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027,
- 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f,
- 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037,
- 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f,
- 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047,
- 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f,
- 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057,
- 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f,
- 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067,
- 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f,
- 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077,
- 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x2022,
- 0x20ac, 0x2022, 0x201a, 0x0192, 0x201e, 0x2026, 0x2020, 0x2021,
- 0x02c6, 0x2030, 0x0160, 0x2039, 0x0152, 0x2022, 0x017d, 0x2022,
- 0x2022, 0x2018, 0x2019, 0x201c, 0x201d, 0x2022, 0x2013, 0x2014,
- 0x02dc, 0x2122, 0x0161, 0x203a, 0x0153, 0x2022, 0x017e, 0x0178,
- 0x0020, 0x00a1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7,
- 0x00a8, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x002d, 0x00ae, 0x00af,
- 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7,
- 0x00b8, 0x00b9, 0x00ba, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00bf,
- 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7,
- 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf,
- 0x00d0, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00d7,
- 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x00de, 0x00df,
- 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7,
- 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef,
- 0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7,
- 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00ff
-};
-extern const FX_WORD PDFDocEncoding[256];
-const FX_WORD MacExpertEncoding[256] = {
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0020, 0xf721, 0xf6f8, 0xf7a2, 0xf724, 0xf6e4, 0xf726, 0xf7b4,
- 0x207d, 0x207e, 0x2025, 0x2024, 0x002c, 0x002d, 0x002e, 0x2044, 0xf730, 0xf731,
- 0xf732, 0xf733, 0xf734, 0xf735, 0xf736, 0xf737, 0xf738, 0xf739, 0x003a, 0x003b,
- 0x0000, 0xf6de, 0x0000, 0xf73f, 0x0000, 0x0000, 0x0000, 0x0000, 0xf7f0, 0x0000,
- 0x0000, 0x00bc, 0x00bd, 0x00be, 0x215b, 0x215c, 0x215d, 0x215e, 0x2153, 0x2154,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xfb00, 0xfb01, 0xfb02, 0xfb03,
- 0xfb04, 0x208d, 0x0000, 0x208e, 0xf6f6, 0xf6e5, 0xf760, 0xf761, 0xf762, 0xf763,
- 0xf764, 0xf765, 0xf766, 0xf767, 0xf768, 0xf769, 0xf76a, 0xf76b, 0xf76c, 0xf76d,
- 0xf76e, 0xf76f, 0xf770, 0xf771, 0xf772, 0xf773, 0xf774, 0xf775, 0xf776, 0xf777,
- 0xf778, 0xf779, 0xf77a, 0x20a1, 0xf6dc, 0xf6dd, 0xf6fe, 0x0000, 0x0000, 0xf6e9,
- 0xf6e0, 0x0000, 0x0000, 0x0000, 0x0000, 0xf7e1, 0xf7e0, 0xf7e2, 0xf7e4, 0xf7e3,
- 0xf7e5, 0xf7e7, 0xf7e9, 0xf7e8, 0xf7ea, 0xf7eb, 0xf7ed, 0xf7ec, 0xf7ee, 0xf7ef,
- 0xf7f1, 0xf7f3, 0xf7f2, 0xf7f4, 0xf7f6, 0xf7f5, 0xf7fa, 0xf7f9, 0xf7fb, 0xf7fc,
- 0x0000, 0x2078, 0x2084, 0x2083, 0x2086, 0x2088, 0x2087, 0xf6fd, 0x0000, 0xf6df,
- 0x2082, 0x0000, 0xf7a8, 0x0000, 0xf6f5, 0xf6fd, 0x2085, 0x0000, 0xf6e1, 0xf6e7,
- 0xf7fd, 0x0000, 0xf6e3, 0x0000, 0x0000, 0xf7fe, 0x0000, 0x2089, 0x2080, 0xf6ff,
- 0xf7e6, 0xf7f8, 0xf7bf, 0x2081, 0xf6e9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0xf7b8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xf6fa, 0x2012, 0xf6e6,
- 0x0000, 0x0000, 0x0000, 0x0000, 0xf7a1, 0x0000, 0xf7ff, 0x0000, 0x00b9, 0x00b2,
- 0x00b3, 0x2074, 0x2075, 0x2076, 0x2077, 0x2079, 0x2070, 0x0000, 0xf6ec, 0xf6f1,
- 0x0000, 0x0000, 0x0000, 0xf6ed, 0xf6f2, 0xf6eb, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0xf6ee, 0xf6fb, 0xf6f4, 0xf7af, 0xf6ea, 0x207f, 0xf6ef, 0xf6e2, 0xf6e8,
- 0xf6f7, 0xf6fc, 0x0000, 0x0000, 0x0000, 0x0000
-};
-const FX_WORD AdobeSymbolEncoding[256] = {
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0020, 0x0021, 0x2200, 0x0023, 0x2203, 0x0025, 0x0026, 0x220B,
- 0x0028, 0x0029, 0x2217, 0x002B, 0x002C, 0x2212, 0x002E, 0x002F,
- 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037,
- 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,
- 0x2245, 0x0391, 0x0392, 0x03A7, 0x0394, 0x0395, 0x03A6, 0x0393,
- 0x0397, 0x0399, 0x03D1, 0x039A, 0x039B, 0x039C, 0x039D, 0x039F,
- 0x03A0, 0x0398, 0x03A1, 0x03A3, 0x03A4, 0x03A5, 0x03C2, 0x03A9,
- 0x039E, 0x03A8, 0x0396, 0x005B, 0x2234, 0x005D, 0x22A5, 0x005F,
- 0xF8E5, 0x03B1, 0x03B2, 0x03C7, 0x03B4, 0x03B5, 0x03C6, 0x03B3,
- 0x03B7, 0x03B9, 0x03D5, 0x03BA, 0x03BB, 0x03BC, 0x03BD, 0x03BF,
- 0x03C0, 0x03B8, 0x03C1, 0x03C3, 0x03C4, 0x03C5, 0x03D6, 0x03C9,
- 0x03BE, 0x03C8, 0x03B6, 0x007B, 0x007C, 0x007D, 0x223C, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x20AC, 0x03D2, 0x2032, 0x2264, 0x2044, 0x221E, 0x0192, 0x2663,
- 0x2666, 0x2665, 0x2660, 0x2194, 0x2190, 0x2191, 0x2192, 0x2193,
- 0x00B0, 0x00B1, 0x2033, 0x2265, 0x00D7, 0x221D, 0x2202, 0x2022,
- 0x00F7, 0x2260, 0x2261, 0x2248, 0x2026, 0xF8E6, 0xF8E7, 0x21B5,
- 0x2135, 0x2111, 0x211C, 0x2118, 0x2297, 0x2295, 0x2205, 0x2229,
- 0x222A, 0x2283, 0x2287, 0x2284, 0x2282, 0x2286, 0x2208, 0x2209,
- 0x2220, 0x2207, 0xF6DA, 0xF6D9, 0xF6DB, 0x220F, 0x221A, 0x22C5,
- 0x00AC, 0x2227, 0x2228, 0x21D4, 0x21D0, 0x21D1, 0x21D2, 0x21D3,
- 0x25CA, 0x2329, 0xF8E8, 0xF8E9, 0xF8EA, 0x2211, 0xF8EB, 0xF8EC,
- 0xF8ED, 0xF8EE, 0xF8EF, 0xF8F0, 0xF8F1, 0xF8F2, 0xF8F3, 0xF8F4,
- 0x0000, 0x232A, 0x222B, 0x2320, 0xF8F5, 0x2321, 0xF8F6, 0xF8F7,
- 0xF8F8, 0xF8F9, 0xF8FA, 0xF8FB, 0xF8FC, 0xF8FD, 0xF8FE, 0x0000,
-};
-const FX_WORD ZapfEncoding[256] = {
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0020, 0x2701, 0x2702, 0x2703, 0x2704, 0x260E, 0x2706, 0x2707,
- 0x2708, 0x2709, 0x261B, 0x261E, 0x270C, 0x270D, 0x270E, 0x270F,
- 0x2710, 0x2711, 0x2712, 0x2713, 0x2714, 0x2715, 0x2716, 0x2717,
- 0x2718, 0x2719, 0x271A, 0x271B, 0x271C, 0x271D, 0x271E, 0x271F,
- 0x2720, 0x2721, 0x2722, 0x2723, 0x2724, 0x2725, 0x2726, 0x2727,
- 0x2605, 0x2729, 0x272A, 0x272B, 0x272C, 0x272D, 0x272E, 0x272F,
- 0x2730, 0x2731, 0x2732, 0x2733, 0x2734, 0x2735, 0x2736, 0x2737,
- 0x2738, 0x2739, 0x273A, 0x273B, 0x273C, 0x273D, 0x273E, 0x273F,
- 0x2740, 0x2741, 0x2742, 0x2743, 0x2744, 0x2745, 0x2746, 0x2747,
- 0x2748, 0x2749, 0x274A, 0x274B, 0x25CF, 0x274D, 0x25A0, 0x274F,
- 0x2750, 0x2751, 0x2752, 0x25B2, 0x25BC, 0x25C6, 0x2756, 0x25D7,
- 0x2758, 0x2759, 0x275A, 0x275B, 0x275C, 0x275D, 0x275E, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x2761, 0x2762, 0x2763, 0x2764, 0x2765, 0x2766, 0x2767,
- 0x2663, 0x2666, 0x2665, 0x2660, 0x2460, 0x2461, 0x2462, 0x2463,
- 0x2464, 0x2465, 0x2466, 0x2467, 0x2468, 0x2469, 0x2776, 0x2777,
- 0x2778, 0x2779, 0x277A, 0x277B, 0x277C, 0x277D, 0x277E, 0x277F,
- 0x2780, 0x2781, 0x2782, 0x2783, 0x2784, 0x2785, 0x2786, 0x2787,
- 0x2788, 0x2789, 0x278A, 0x278B, 0x278C, 0x278D, 0x278E, 0x278F,
- 0x2790, 0x2791, 0x2792, 0x2793, 0x2794, 0x2192, 0x2194, 0x2195,
- 0x2798, 0x2799, 0x279A, 0x279B, 0x279C, 0x279D, 0x279E, 0x279F,
- 0x27A0, 0x27A1, 0x27A2, 0x27A3, 0x27A4, 0x27A5, 0x27A6, 0x27A7,
- 0x27A8, 0x27A9, 0x27AA, 0x27AB, 0x27AC, 0x27AD, 0x27AE, 0x27AF,
- 0x0000, 0x27B1, 0x27B2, 0x27B3, 0x27B4, 0x27B5, 0x27B6, 0x27B7,
- 0x27B8, 0x27B9, 0x27BA, 0x27BB, 0x27BC, 0x27BD, 0x27BE, 0x0000,
-};
-const FX_LPCSTR StandardEncodingNames[224] = {
- "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quoteright",
- "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash",
- "zero", "one", "two", "three", "four", "five", "six", "seven",
- "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question",
- "at", "A", "B", "C", "D", "E", "F", "G",
- "H", "I", "J", "K", "L", "M", "N", "O",
- "P", "Q", "R", "S", "T", "U", "V", "W",
- "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore",
- "quoteleft", "a", "b", "c", "d", "e", "f", "g",
- "h", "i", "j", "k", "l", "m", "n", "o",
- "p", "q", "r", "s", "t", "u", "v", "w",
- "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, "exclamdown", "cent", "sterling", "fraction", "yen", "florin", "section",
- "currency", "quotesingle", "quotedblleft", "guillemotleft", "guilsinglleft", "guilsinglright", "fi", "fl",
- NULL, "endash", "dagger", "daggerdbl", "periodcentered", NULL, "paragraph", "bullet",
- "quotesinglbase", "quotedblbase", "quotedblright", "guillemotright", "ellipsis", "perthousand", NULL, "questiondown",
- NULL, "grave", "acute", "circumflex", "tilde", "macron", "breve", "dotaccent",
- "dieresis", NULL, "ring", "cedilla", NULL, "hungarumlaut", "ogonek", "caron",
- "emdash", NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, "AE", NULL, "ordfeminine", NULL, NULL, NULL, NULL,
- "Lslash", "Oslash", "OE", "ordmasculine", NULL, NULL, NULL, NULL,
- NULL, "ae", NULL, NULL, NULL, "dotlessi", NULL, NULL,
- "lslash", "oslash", "oe", "germandbls", NULL, NULL, NULL, NULL,
-};
-const FX_LPCSTR AdobeWinAnsiEncodingNames[224] = {
- "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quotesingle",
- "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash",
- "zero", "one", "two", "three", "four", "five", "six", "seven",
- "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question",
- "at", "A", "B", "C", "D", "E", "F", "G",
- "H", "I", "J", "K", "L", "M", "N", "O",
- "P", "Q", "R", "S", "T", "U", "V", "W",
- "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore",
- "grave", "a", "b", "c", "d", "e", "f", "g",
- "h", "i", "j", "k", "l", "m", "n", "o",
- "p", "q", "r", "s", "t", "u", "v", "w",
- "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", "bullet",
- "Euro", "bullet", "quotesinglbase", "florin", "quotedblbase", "ellipsis", "dagger", "daggerdbl",
- "circumflex", "perthousand", "Scaron", "guilsinglleft", "OE", "bullet", "Zcaron", "bullet",
- "bullet", "quoteleft", "quoteright", "quotedblleft", "quotedblright", "bullet", "endash", "emdash",
- "tilde", "trademark", "scaron", "guilsinglright", "oe", "bullet", "zcaron", "Ydieresis",
- "space", "exclamdown", "cent", "sterling", "currency", "yen", "brokenbar", "section",
- "dieresis", "copyright", "ordfeminine", "guillemotleft", "logicalnot", "hyphen", "registered", "macron",
- "degree", "plusminus", "twosuperior", "threesuperior", "acute", "mu", "paragraph", "periodcentered",
- "cedilla", "onesuperior", "ordmasculine", "guillemotright", "onequarter", "onehalf", "threequarters", "questiondown",
- "Agrave", "Aacute", "Acircumflex", "Atilde", "Adieresis", "Aring", "AE", "Ccedilla",
- "Egrave", "Eacute", "Ecircumflex", "Edieresis", "Igrave", "Iacute", "Icircumflex", "Idieresis",
- "Eth", "Ntilde", "Ograve", "Oacute", "Ocircumflex", "Otilde", "Odieresis", "multiply",
- "Oslash", "Ugrave", "Uacute", "Ucircumflex", "Udieresis", "Yacute", "Thorn", "germandbls",
- "agrave", "aacute", "acircumflex", "atilde", "adieresis", "aring", "ae", "ccedilla",
- "egrave", "eacute", "ecircumflex", "edieresis", "igrave", "iacute", "icircumflex", "idieresis",
- "eth", "ntilde", "ograve", "oacute", "ocircumflex", "otilde", "odieresis", "divide",
- "oslash", "ugrave", "uacute", "ucircumflex", "udieresis", "yacute", "thorn", "ydieresis",
-};
-const FX_LPCSTR MacRomanEncodingNames[224] = {
- "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quotesingle",
- "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash",
- "zero", "one", "two", "three", "four", "five", "six", "seven",
- "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question",
- "at", "A", "B", "C", "D", "E", "F", "G",
- "H", "I", "J", "K", "L", "M", "N", "O",
- "P", "Q", "R", "S", "T", "U", "V", "W",
- "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore",
- "grave", "a", "b", "c", "d", "e", "f", "g",
- "h", "i", "j", "k", "l", "m", "n", "o",
- "p", "q", "r", "s", "t", "u", "v", "w",
- "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", NULL,
- "Adieresis", "Aring", "Ccedilla", "Eacute", "Ntilde", "Odieresis", "Udieresis", "aacute",
- "agrave", "acircumflex", "adieresis", "atilde", "aring", "ccedilla", "eacute", "egrave",
- "ecircumflex", "edieresis", "iacute", "igrave", "icircumflex", "idieresis", "ntilde", "oacute",
- "ograve", "ocircumflex", "odieresis", "otilde", "uacute", "ugrave", "ucircumflex", "udieresis",
- "dagger", "degree", "cent", "sterling", "section", "bullet", "paragraph", "germandbls",
- "registered", "copyright", "trademark", "acute", "dieresis", "notequal", "AE", "Oslash",
- "infinity", "plusminus", "lessequal", "greaterequal", "yen", "mu", "partialdiff", "summation",
- "product", "pi", "integral", "ordfeminine", "ordmasculine", "Omega", "ae", "oslash",
- "questiondown", "exclamdown", "logicalnot", "radical", "florin", "approxequal", "Delta", "guillemotleft",
- "guillemotright", "ellipsis", "space", "Agrave", "Atilde", "Otilde", "OE", "oe",
- "endash", "emdash", "quotedblleft", "quotedblright", "quoteleft", "quoteright", "divide", "lozenge",
- "ydieresis", "Ydieresis", "fraction", "currency", "guilsinglleft", "guilsinglright", "fi", "fl",
- "daggerdbl", "periodcentered", "quotesinglbase", "quotedblbase", "perthousand", "Acircumflex", "Ecircumflex", "Aacute",
- "Edieresis", "Egrave", "Iacute", "Icircumflex", "Idieresis", "Igrave", "Oacute", "Ocircumflex",
- "apple", "Ograve", "Uacute", "Ucircumflex", "Ugrave", "dotlessi", "circumflex", "tilde",
- "macron", "breve", "dotaccent", "ring", "cedilla", "hungarumlaut", "ogonek", "caron",
-};
-const FX_LPCSTR MacExpertEncodingNames[224] = {
- "space", "exclamsmall", "Hungarumlautsmall", "centoldstyle", "dollaroldstyle", "dollarsuperior", "ampersandsmall", "Acutesmall",
- "parenleftsuperior", "parenrightsuperior", "twodotenleader", "onedotenleader", "comma", "hyphen", "period", "fraction",
- "zerooldstyle", "oneoldstyle", "twooldstyle", "threeoldstyle", "fouroldstyle", "fiveoldstyle", "sixoldstyle", "sevenoldstyle",
- "eightoldstyle", "nineoldstyle", "colon", "semicolon", NULL, "threequartersemdash", NULL, "questionsmall",
- NULL, NULL, NULL, NULL, "Ethsmall", NULL, NULL, "onequarter",
- "onehalf", "threequarters", "oneeighth", "threeeighths", "fiveeighths", "seveneighths", "onethird", "twothirds",
- NULL, NULL, NULL, NULL, NULL, NULL, "ff", "fi",
- "fl", "ffi", "ffl", "parenleftinferior", NULL, "parenrightinferior", "Circumflexsmall", "hypheninferior",
- "Gravesmall", "Asmall", "Bsmall", "Csmall", "Dsmall", "Esmall", "Fsmall", "Gsmall",
- "Hsmall", "Ismall", "Jsmall", "Ksmall", "Lsmall", "Msmall", "Nsmall", "Osmall",
- "Psmall", "Qsmall", "Rsmall", "Ssmall", "Tsmall", "Usmall", "Vsmall", "Wsmall",
- "Xsmall", "Ysmall", "Zsmall", "colonmonetary", "onefitted", "rupiah", "Tildesmall", NULL,
- NULL, "asuperior", "centsuperior", NULL, NULL, NULL, NULL, "Aacutesmall",
- "Agravesmall", "Acircumflexsmall", "Adieresissmall", "Atildesmall", "Aringsmall", "Ccedillasmall", "Eacutesmall", "Egravesmall",
- "Ecircumflexsmall", "Edieresissmall", "Iacutesmall", "Igravesmall", "Icircumflexsmall", "Idieresissmall", "Ntildesmall", "Oacutesmall",
- "Ogravesmall", "Ocircumflexsmall", "Odieresissmall", "Otildesmall", "Uacutesmall", "Ugravesmall", "Ucircumflexsmall", "Udieresissmall",
- NULL, "eightsuperior", "fourinferior", "threeinferior", "sixinferior", "eightinferior", "seveninferior", "Scaronsmall",
- NULL, "centinferior", "twoinferior", NULL, "Dieresissmall", NULL, "Caronsmall", "Scaronsmall",
- "fiveinferior", NULL, "commainferior", "periodinferior", "Yacutesmall", NULL, "dollarinferior", NULL,
- NULL, "Thornsmall", NULL, "nineinferior", "zeroinferior", "Zcaronsmall", "AEsmall", "Oslashsmall",
- "questiondownsmall", "oneinferior", "asuperior", NULL, NULL, NULL, NULL, NULL,
- NULL, "Cedillasmall", NULL, NULL, NULL, NULL, NULL, "OEsmall",
- "figuredash", "hyphensuperior", NULL, NULL, NULL, NULL, "exclamdownsmall", NULL,
- "Ydieresissmall", NULL, "onesuperior", "twosuperior", "threesuperior", "foursuperior", "fivesuperior", "sixsuperior",
- "sevensuperior", "ninesuperior", "zerosuperior", NULL, "esuperior", "rsuperior", NULL, NULL,
- NULL, "isuperior", "ssuperior", "dsuperior", NULL, NULL, NULL, NULL,
- NULL, "lsuperior", "Ogoneksmall", "Brevesmall", "Macronsmall", "bsuperior", "nsuperior", "msuperior",
- "commasuperior", "periodsuperior", "Dotaccentsmall", "Ringsmall", NULL, NULL, NULL, NULL,
-};
-const FX_LPCSTR PDFDocEncodingNames[232] = {
- "breve", "caron", "circumflex", "dotaccent", "hungarumlaut", "ogonek", "ring", "tilde",
- "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quotesingle",
- "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash",
- "zero", "one", "two", "three", "four", "five", "six", "seven",
- "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question",
- "at", "A", "B", "C", "D", "E", "F", "G",
- "H", "I", "J", "K", "L", "M", "N", "O",
- "P", "Q", "R", "S", "T", "U", "V", "W",
- "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore",
- "grave", "a", "b", "c", "d", "e", "f", "g",
- "h", "i", "j", "k", "l", "m", "n", "o",
- "p", "q", "r", "s", "t", "u", "v", "w",
- "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", NULL,
- "bullet3", "dagger", "daggerdbl", "ellipsis", "emdash", "endash", "florin", "fraction",
- "guilsinglleft", "guilsinglright", "minus", "perthousand", "quotedblbase", "quotedblleft", "quotedblright", "quoteleft",
- "quoteright", "quotesinglbase", "trademark", "fi", "fl", "Lslash", "OE", "Scaron",
- "Ydieresis", "Zcaron2", "dotlessi", "lslash", "oe", "scaron", "zcaron2", NULL,
- "Euro", "exclamdown", "cent", "sterling", "currency", "yen", "brokenbar", "section",
- "dieresis", "copyright", "ordfeminine", "guillemotleft4", "logicalnot", NULL, "registered", "macron",
- "degree", "plusminus", "twosuperior", "threesuperior", "acute", "mu", "paragraph", "periodcentered",
- "cedilla", "onesuperior", "ordmasculine", "guillemotright4", "onequarter", "onehalf", "threequarters", "questiondown",
- "Agrave", "Aacute", "Acircumflex", "Atilde", "Adieresis", "Aring", "AE", "Ccedilla",
- "Egrave", "Eacute", "Ecircumflex", "Edieresis", "Igrave", "Iacute", "Icircumflex", "Idieresis",
- "Eth", "Ntilde", "Ograve", "Oacute", "Ocircumflex", "Otilde", "Odieresis", "multiply",
- "Oslash", "Ugrave", "Uacute", "Ucircumflex", "Udieresis", "Yacute", "Thorn", "germandbls",
- "agrave", "aacute", "acircumflex", "atilde", "adieresis", "aring", "ae", "ccedilla",
- "egrave", "eacute", "ecircumflex", "edieresis", "igrave", "iacute", "icircumflex", "idieresis",
- "eth", "ntilde", "ograve", "oacute", "ocircumflex", "otilde", "odieresis", "divide",
- "oslash", "ugrave", "uacute", "ucircumflex", "udieresis", "yacute", "thorn", "ydieresis",
-};
-const FX_LPCSTR AdobeSymbolEncodingNames[224] = {
- "space", "exclam", "universal", "numbersign", "existential", "percent", "ampersand", "suchthat",
- "parenleft", "parenright", "asteriskmath", "plus", "comma", "minus", "period", "slash",
- "zero", "one", "two", "three", "four", "five", "six", "seven",
- "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question",
- "congruent", "Alpha", "Beta", "Chi", "Delta", "Epsilon", "Phi", "Gamma",
- "Eta", "Iota", "theta1", "Kappa", "Lambda", "Mu", "Nu", "Omicron",
- "Pi", "Theta", "Rho", "Sigma", "Tau", "Upsilon", "sigma1", "Omega",
- "Xi", "Psi", "Zeta", "bracketleft", "therefore", "bracketright", "perpendicular", "underscore",
- "radicalex", "alpha", "beta", "chi", "delta", "epsilon", "phi", "gamma",
- "eta", "iota", "phi1", "kappa", "lambda", "mu", "nu", "omicron",
- "pi", "theta", "rho", "sigma", "tau", "upsilon", "omega1", "omega",
- "xi", "psi", "zeta", "braceleft", "bar", "braceright", "similar", NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- "Euro", "Upsilon1", "minute", "lessequal", "fraction", "infinity", "florin", "club",
- "diamond", "heart", "spade", "arrowboth", "arrowleft", "arrowup", "arrowright", "arrowdown",
- "degree", "plusminus", "second", "greaterequal", "multiply", "proportional", "partialdiff", "bullet",
- "divide", "notequal", "equivalence", "approxequal", "ellipsis", "arrowvertex", "arrowhorizex", "carriagereturn",
- "aleph", "Ifraktur", "Rfraktur", "weierstrass", "circlemultiply", "circleplus", "emptyset", "intersection",
- "union", "propersuperset", "reflexsuperset", "notsubset", "propersubset", "reflexsubset", "element", "notelement",
- "angle", "gradient", "registerserif", "copyrightserif", "trademarkserif", "product", "radical", "dotmath",
- "logicalnot", "logicaland", "logicalor", "arrowdblboth", "arrowdblleft", "arrowdblup", "arrowdblright", "arrowdbldown",
- "lozenge", "angleleft", "registersans", "copyrightsans", "trademarksans", "summation", "parenlefttp", "parenleftex",
- "parenleftbt", "bracketlefttp", "bracketleftex", "bracketleftbt", "bracelefttp", "braceleftmid", "braceleftbt", "braceex",
- NULL, "angleright", "integral", "integraltp", "integralex", "integralbt", "parenrighttp", "parenrightex",
- "parenrightbt", "bracketrighttp", "bracketrightex", "bracketrightbt", "bracerighttp", "bracerightmid", "bracerightbt", NULL,
-};
-const FX_LPCSTR ZapfEncodingNames[224] = {
- "space", "a1", "a2", "a202", "a3", "a4", "a5", "a119",
- "a118", "a117", "a11", "a12", "a13", "a14", "a15", "a16",
- "a105", "a17", "a18", "a19", "a20", "a21", "a22", "a23",
- "a24", "a25", "a26", "a27", "a28", "a6", "a7", "a8",
- "a9", "a10", "a29", "a30", "a31", "a32", "a33", "a34",
- "a35", "a36", "a37", "a38", "a39", "a40", "a41", "a42",
- "a43", "a44", "a45", "a46", "a47", "a48", "a49", "a50",
- "a51", "a52", "a53", "a54", "a55", "a56", "a57", "a58",
- "a59", "a60", "a61", "a62", "a63", "a64", "a65", "a66",
- "a67", "a68", "a69", "a70", "a71", "a72", "a73", "a74",
- "a203", "a75", "a204", "a76", "a77", "a78", "a79", "a81",
- "a82", "a83", "a84", "a97", "a98", "a99", "a100", NULL,
- "a89", "a90", "a93", "a94", "a91", "a92", "a205", "a85",
- "a206", "a86", "a87", "a88", "a95", "a96", NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, "a101", "a102", "a103", "a104", "a106", "a107", "a108",
- "a112", "a111", "a110", "a109", "a120", "a121", "a122", "a123",
- "a124", "a125", "a126", "a127", "a128", "a129", "a130", "a131",
- "a132", "a133", "a134", "a135", "a136", "a137", "a138", "a139",
- "a140", "a141", "a142", "a143", "a144", "a145", "a146", "a147",
- "a148", "a149", "a150", "a151", "a152", "a153", "a154", "a155",
- "a156", "a157", "a158", "a159", "a160", "a161", "a163", "a164",
- "a196", "a165", "a192", "a166", "a167", "a168", "a169", "a170",
- "a171", "a172", "a173", "a162", "a174", "a175", "a176", "a177",
- "a178", "a179", "a193", "a180", "a199", "a181", "a200", "a182",
- NULL, "a201", "a183", "a184", "a197", "a185", "a194", "a198",
- "a186", "a195", "a187", "a188", "a189", "a190", "a191", NULL
-};
-const FX_CHAR* PDF_CharNameFromPredefinedCharSet(int encoding, FX_BYTE charcode)
-{
- if (encoding == PDFFONT_ENCODING_PDFDOC) {
- if (charcode < 24) {
- return NULL;
- }
- charcode -= 24;
- } else {
- if (charcode < 32) {
- return NULL;
- }
- charcode -= 32;
- }
- switch (encoding) {
- case PDFFONT_ENCODING_WINANSI:
- return AdobeWinAnsiEncodingNames[charcode];
- case PDFFONT_ENCODING_MACROMAN:
- return MacRomanEncodingNames[charcode];
- case PDFFONT_ENCODING_MACEXPERT:
- return MacExpertEncodingNames[charcode];
- case PDFFONT_ENCODING_STANDARD:
- return StandardEncodingNames[charcode];
- case PDFFONT_ENCODING_ADOBE_SYMBOL:
- return AdobeSymbolEncodingNames[charcode];
- case PDFFONT_ENCODING_ZAPFDINGBATS:
- return ZapfEncodingNames[charcode];
- case PDFFONT_ENCODING_PDFDOC:
- return PDFDocEncodingNames[charcode];
- }
- return NULL;
-}
-FX_WCHAR FT_UnicodeFromCharCode(int encoding, FX_DWORD charcode)
-{
- switch (encoding) {
- case FXFT_ENCODING_UNICODE:
- return (FX_WORD)charcode;
- case FXFT_ENCODING_ADOBE_STANDARD:
- return StandardEncoding[(FX_BYTE)charcode];
- case FXFT_ENCODING_ADOBE_EXPERT:
- return MacExpertEncoding[(FX_BYTE)charcode];
- case FXFT_ENCODING_ADOBE_LATIN_1:
- return AdobeWinAnsiEncoding[(FX_BYTE)charcode];
- case FXFT_ENCODING_APPLE_ROMAN:
- return MacRomanEncoding[(FX_BYTE)charcode];
- case PDFFONT_ENCODING_PDFDOC:
- return PDFDocEncoding[(FX_BYTE)charcode];
- }
- return 0;
-}
-static FX_DWORD PDF_FindCode(const FX_WORD* pCodes, FX_WORD unicode)
-{
- for (FX_DWORD i = 0; i < 256; i ++)
- if (pCodes[i] == unicode) {
- return i;
- }
- return 0;
-}
-const FX_WORD MSSymbolEncoding[256] = {
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 32, 33, 8704, 35, 8707, 37, 38, 8715,
- 40, 41, 8727, 43, 44, 8722, 46, 47, 48, 49,
- 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
- 60, 61, 62, 63, 8773, 913, 914, 935, 916, 917,
- 934, 915, 919, 921, 977, 922, 923, 924, 925, 927,
- 928, 920, 929, 931, 932, 933, 962, 937, 926, 936,
- 918, 91, 8756, 93, 8869, 95, 8254, 945, 946, 967,
- 948, 949, 966, 947, 951, 953, 981, 954, 955, 956,
- 957, 959, 960, 952, 961, 963, 964, 965, 982, 969,
- 958, 968, 950, 123, 124, 125, 8764, 0, 0, 0,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 978, 8242, 8804, 8725, 8734, 402, 9827, 9830, 9828,
- 9824, 8596, 8592, 8593, 8594, 8595, 176, 177, 8243, 8805,
- 215, 8733, 8706, 8729, 247, 8800, 8801, 8776, 8943, 0,
- 0, 8629, 0, 8465, 8476, 8472, 8855, 8853, 8709, 8745,
- 8746, 8835, 8839, 8836, 8834, 8838, 8712, 8713, 8736, 8711,
- 174, 169, 8482, 8719, 8730, 8901, 172, 8743, 8744, 8660,
- 8656, 8657, 8658, 8659, 9674, 9001, 0, 0, 0, 8721,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0x0000, 9002, 8747, 8992, 0, 8993, 0, 0, 0, 0,
- 0, 0, 0x0000, 0x0000, 0x0000, 0x0000
-};
-FX_DWORD FT_CharCodeFromUnicode(int encoding, FX_WCHAR unicode)
-{
- switch (encoding) {
- case FXFT_ENCODING_UNICODE:
- return unicode;
- case FXFT_ENCODING_ADOBE_STANDARD:
- return PDF_FindCode(StandardEncoding, unicode);
- case FXFT_ENCODING_ADOBE_EXPERT:
- return PDF_FindCode(MacExpertEncoding, unicode);
- case FXFT_ENCODING_ADOBE_LATIN_1:
- return PDF_FindCode(AdobeWinAnsiEncoding, unicode);
- case FXFT_ENCODING_APPLE_ROMAN:
- return PDF_FindCode(MacRomanEncoding, unicode);
- case FXFT_ENCODING_ADOBE_CUSTOM:
- return PDF_FindCode(PDFDocEncoding, unicode);
- case FXFT_ENCODING_MS_SYMBOL:
- return PDF_FindCode(MSSymbolEncoding, unicode);
- }
- return 0;
-}
-const FX_WORD* PDF_UnicodesForPredefinedCharSet(int encoding)
-{
- switch (encoding) {
- case PDFFONT_ENCODING_WINANSI:
- return AdobeWinAnsiEncoding;
- case PDFFONT_ENCODING_MACROMAN:
- return MacRomanEncoding;
- case PDFFONT_ENCODING_MACEXPERT:
- return MacExpertEncoding;
- case PDFFONT_ENCODING_STANDARD:
- return StandardEncoding;
- case PDFFONT_ENCODING_ADOBE_SYMBOL:
- return AdobeSymbolEncoding;
- case PDFFONT_ENCODING_ZAPFDINGBATS:
- return ZapfEncoding;
- case PDFFONT_ENCODING_PDFDOC:
- return PDFDocEncoding;
- case PDFFONT_ENCODING_MS_SYMBOL:
- return MSSymbolEncoding;
- }
- return NULL;
-}
-FX_DWORD PDF_PredefinedCharCodeFromUnicode(int encoding, FX_WCHAR unicode)
-{
- return PDF_FindCode(PDF_UnicodesForPredefinedCharSet(encoding), unicode);
-}
-#ifdef __cplusplus
-extern "C" {
-#endif
-extern int FXFT_unicode_from_adobe_name(const char* name);
-#ifdef __cplusplus
-}
-#endif
-FX_WCHAR PDF_UnicodeFromAdobeName(const FX_CHAR* name)
-{
- return (FX_WCHAR)(FXFT_unicode_from_adobe_name(name) & 0x7FFFFFFF);
-}
-CFX_ByteString PDF_AdobeNameFromUnicode(FX_WCHAR unicode)
-{
- char glyph_name[64];
- FXFT_adobe_name_from_unicode(glyph_name, unicode);
- return CFX_ByteString(glyph_name, -1);
-}
+// 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
+
+#include "../../../include/fpdfapi/fpdf_page.h"
+#include "../../../include/fxge/fx_freetype.h"
+extern FX_WCHAR PDF_UnicodeFromAdobeName(const FX_CHAR*);
+const struct _UnicodeAlt {
+ FX_WORD m_Unicode;
+ const FX_CHAR* m_Alter;
+}
+UnicodeAlts[] = {
+ {0x00a0, " "}, {0x00a1, "!"}, {0x00a2, "c"}, {0x00a3, "P"}, {0x00a4, "o"},
+ {0x00a5, "Y"}, {0x00a6, "|"}, {0x00a7, "S"}, {0x00a9, "(C)"}, {0x00aa, "a"},
+ {0x00ab, "<<"}, {0x00ac, "-|"}, {0x00ae, "(R)"}, {0x00af, "-"},
+ {0x00b0, "o"}, {0x00b1, "+/-"}, {0x00b2, "^2"}, { 0x00b3, "^3"},
+ {0x00b4, "'"}, {0x00b5, "u"}, {0x00b6, "P"}, {0x00b7, "."},
+ {0x00b9, "^1"}, {0x00ba, "o"}, {0x00bb, ">>"}, {0x00bc, "1/4"},
+ {0x00bd, "1/2"}, {0x00be, "3/4"}, {0x00bf, "?"}, {0x00c0, "A"},
+ {0x00c1, "A"}, {0x00c2, "A"}, {0x00c3, "A"}, {0x00c4, "A"},
+ {0x00c5, "A"}, {0x00c6, "AE"}, {0x00c7, "C"}, {0x00c8, "E"},
+ {0x00c9, "E"}, {0x00ca, "E"}, {0x00cb, "E"}, {0x00cc, "I"},
+ {0x00cd, "I"}, {0x00ce, "I"}, {0x00cf, "I"},
+ {0x00d1, "N"}, {0x00d2, "O"}, {0x00d3, "O"}, {0x00d4, "O"},
+ {0x00d5, "O"}, {0x00d6, "O"}, {0x00d7, "x"}, {0x00d8, "O"},
+ {0x00d9, "U"}, {0x00da, "U"}, {0x00db, "U"}, {0x00dc, "U"},
+ {0x00dd, "Y"}, {0x00df, "S"}, {0x00e0, "a"},
+ {0x00e1, "a"}, {0x00e2, "a"}, {0x00e3, "a"}, {0x00e4, "a"},
+ {0x00e5, "a"}, {0x00e6, "ae"}, {0x00e7, "c"}, {0x00e8, "e"},
+ {0x00e9, "e"}, {0x00ea, "e"}, {0x00eb, "e"}, {0x00ec, "i"},
+ {0x00ed, "i"}, {0x00ee, "i"}, {0x00ef, "i"},
+ {0x00f1, "n"}, {0x00f2, "o"}, {0x00f3, "o"}, {0x00f4, "o"},
+ {0x00f5, "o"}, {0x00f6, "o"}, {0x00f7, "/"}, {0x00f8, "o"},
+ {0x00f9, "u"}, {0x00fa, "u"}, {0x00fb, "u"}, {0x00fc, "u"},
+ {0x00fd, "y"}, {0x00ff, "y"},
+ {0x02b0, "h"}, {0x02b2, "j"}, {0x02b3, "r"}, {0x02b7, "w"},
+ {0x02b8, "y"}, {0x02b9, "'"}, {0x02ba, "\""}, {0x02bb, "'"},
+ {0x02bc, "'"}, {0x02bd, "'"}, {0x02be, "'"}, {0x02bf, "'"},
+ {0x02c2, "<"}, {0x02c3, ">"}, {0x02c4, "^"}, {0x02c5, "v"},
+ {0x02c6, "^"}, {0x02c7, "v"}, {0x02c8, "'"}, {0x02c9, "-"},
+ {0x02ca, "'"}, {0x02cb, "'"}, {0x02cc, "."}, {0x02cd, "_"},
+ {0x2010, "-"}, {0x2012, "-"}, {0x2013, "-"}, {0x2014, "--"},
+ {0x2015, "--"}, {0x2016, "|"}, {0x2017, "_"},
+ {0x2018, "'"}, {0x2019, "'"}, {0x201a, ","}, {0x201b, "'"},
+ {0x201c, "\""}, {0x201d, "\""}, {0x201e, ","}, {0x201f, "'"},
+ {0x2020, "+"}, {0x2021, "+"}, {0x2022, "*"}, {0x2023, ">"},
+ {0x2024, "."}, {0x2025, ".."}, {0x2027, "."}, {0x2032, "'"},
+ {0x2033, "\""}, {0x2035, "'"}, {0x2036, "\""}, {0x2038, "^"},
+ {0x2039, "<"}, {0x203a, ">"}, {0x203b, "*"}, {0x203c, "!!"},
+ {0x203d, "?!"}, {0x203e, "-"}, {0x2044, "/"}, {0x2047, "??"},
+ {0x2048, "?!"}, {0x2049, "!?"}, {0x204e, "*"}, {0x2052, "%"},
+ {0x2122, "(TM)"},
+ {0x2212, "-"}, {0x2215, "/"}, {0x2216, "\\"}, {0x2217, "*"},
+ {0x2218, "*"}, {0x2219, "*"}, {0x2223, "|"}, {0x22c5, "."},
+ {0x266f, "#"},
+ {0XF6D9, "(C)"}, {0XF6DA, "(C)"}, {0XF6DB, "(TM)"},
+ {0XF8E8, "(C)"}, {0xf8e9, "(C)"}, {0XF8EA, "(TM)"},
+
+ {0xfb01, "fi"}, {0xfb02, "fl"}
+};
+const FX_CHAR* FCS_GetAltStr(FX_WCHAR unicode)
+{
+ int begin = 0;
+ int end = sizeof UnicodeAlts / sizeof(struct _UnicodeAlt) - 1;
+ while (begin <= end) {
+ int middle = (begin + end) / 2;
+ FX_WORD middlecode = UnicodeAlts[middle].m_Unicode;
+ if (middlecode > unicode) {
+ end = middle - 1;
+ } else if (middlecode < unicode) {
+ begin = middle + 1;
+ } else {
+ return UnicodeAlts[middle].m_Alter;
+ }
+ }
+ return NULL;
+}
+const FX_WORD StandardEncoding[256] = {
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x2019,
+ 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, 0x0030, 0x0031,
+ 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b,
+ 0x003c, 0x003d, 0x003e, 0x003f, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045,
+ 0x0046, 0x0047, 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f,
+ 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059,
+ 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, 0x2018, 0x0061, 0x0062, 0x0063,
+ 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d,
+ 0x006e, 0x006f, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077,
+ 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x00a1, 0x00a2, 0x00a3, 0x2044, 0x00a5, 0x0192, 0x00a7, 0x00a4, 0x0027,
+ 0x201c, 0x00ab, 0x2039, 0x203a, 0xfb01, 0xfb02, 0x0000, 0x2013, 0x2020, 0x2021,
+ 0x00b7, 0x0000, 0x00b6, 0x2022, 0x201a, 0x201e, 0x201d, 0x00bb, 0x2026, 0x2030,
+ 0x0000, 0x00bf, 0x0000, 0x0060, 0x00b4, 0x02c6, 0x02dc, 0x00af, 0x02d8, 0x02d9,
+ 0x00a8, 0x0000, 0x02da, 0x00b8, 0x0000, 0x02dd, 0x02db, 0x02c7, 0x2014, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x00c6, 0x0000, 0x00aa, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0141, 0x00d8, 0x0152, 0x00ba, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x00e6, 0x0000, 0x0000, 0x0000, 0x0131, 0x0000, 0x0000, 0x0142, 0x00f8,
+ 0x0153, 0x00df, 0x0000, 0x0000, 0x0000, 0x0000
+};
+const FX_WORD MacRomanEncoding[256] = {
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027,
+ 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, 0x0030, 0x0031,
+ 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b,
+ 0x003c, 0x003d, 0x003e, 0x003f, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045,
+ 0x0046, 0x0047, 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f,
+ 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059,
+ 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, 0x0060, 0x0061, 0x0062, 0x0063,
+ 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d,
+ 0x006e, 0x006f, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077,
+ 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x0000, 0x00c4, 0x00c5,
+ 0x00c7, 0x00c9, 0x00d1, 0x00d6, 0x00dc, 0x00e1, 0x00e0, 0x00e2, 0x00e4, 0x00e3,
+ 0x00e5, 0x00e7, 0x00e9, 0x00e8, 0x00ea, 0x00eb, 0x00ed, 0x00ec, 0x00ee, 0x00ef,
+ 0x00f1, 0x00f3, 0x00f2, 0x00f4, 0x00f6, 0x00f5, 0x00fa, 0x00f9, 0x00fb, 0x00fc,
+ 0x2020, 0x00b0, 0x00a2, 0x00a3, 0x00a7, 0x2022, 0x00b6, 0x00df, 0x00ae, 0x00a9,
+ 0x2122, 0x00b4, 0x00a8, 0x0000, 0x00c6, 0x00d8, 0x0000, 0x00b1, 0x0000, 0x0000,
+ 0x00a5, 0x00b5, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x00aa, 0x00ba, 0x0000,
+ 0x00e6, 0x00f8, 0x00bf, 0x00a3, 0x00ac, 0x0000, 0x0192, 0x0000, 0x0000, 0x00ab,
+ 0x00bb, 0x2026, 0x0020, 0x00c0, 0x00c3, 0x00d5, 0x0152, 0x0153, 0x2013, 0x2014,
+ 0x201c, 0x201d, 0x2018, 0x2019, 0x00f7, 0x0000, 0x00ff, 0x0178, 0x2044, 0x00a4,
+ 0x2039, 0x203a, 0xfb01, 0xfb02, 0x2021, 0x00b7, 0x201a, 0x201e, 0x2030, 0x00c2,
+ 0x00ca, 0x00c1, 0x00cb, 0x00c8, 0x00cd, 0x00ce, 0x00cf, 0x00cc, 0x00d3, 0x00d4,
+ 0x0000, 0x00d2, 0x00da, 0x00db, 0x00d9, 0x0131, 0x02c6, 0x02dc, 0x00af, 0x02d8,
+ 0x02d9, 0x02da, 0x00b8, 0x02dd, 0x02db, 0x02c7
+};
+const FX_WORD AdobeWinAnsiEncoding[256] = {
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027,
+ 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f,
+ 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037,
+ 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f,
+ 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047,
+ 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f,
+ 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057,
+ 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f,
+ 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067,
+ 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f,
+ 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077,
+ 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x2022,
+ 0x20ac, 0x2022, 0x201a, 0x0192, 0x201e, 0x2026, 0x2020, 0x2021,
+ 0x02c6, 0x2030, 0x0160, 0x2039, 0x0152, 0x2022, 0x017d, 0x2022,
+ 0x2022, 0x2018, 0x2019, 0x201c, 0x201d, 0x2022, 0x2013, 0x2014,
+ 0x02dc, 0x2122, 0x0161, 0x203a, 0x0153, 0x2022, 0x017e, 0x0178,
+ 0x0020, 0x00a1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7,
+ 0x00a8, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x002d, 0x00ae, 0x00af,
+ 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7,
+ 0x00b8, 0x00b9, 0x00ba, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00bf,
+ 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7,
+ 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf,
+ 0x00d0, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00d7,
+ 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x00de, 0x00df,
+ 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7,
+ 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef,
+ 0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7,
+ 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00ff
+};
+extern const FX_WORD PDFDocEncoding[256];
+const FX_WORD MacExpertEncoding[256] = {
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0020, 0xf721, 0xf6f8, 0xf7a2, 0xf724, 0xf6e4, 0xf726, 0xf7b4,
+ 0x207d, 0x207e, 0x2025, 0x2024, 0x002c, 0x002d, 0x002e, 0x2044, 0xf730, 0xf731,
+ 0xf732, 0xf733, 0xf734, 0xf735, 0xf736, 0xf737, 0xf738, 0xf739, 0x003a, 0x003b,
+ 0x0000, 0xf6de, 0x0000, 0xf73f, 0x0000, 0x0000, 0x0000, 0x0000, 0xf7f0, 0x0000,
+ 0x0000, 0x00bc, 0x00bd, 0x00be, 0x215b, 0x215c, 0x215d, 0x215e, 0x2153, 0x2154,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xfb00, 0xfb01, 0xfb02, 0xfb03,
+ 0xfb04, 0x208d, 0x0000, 0x208e, 0xf6f6, 0xf6e5, 0xf760, 0xf761, 0xf762, 0xf763,
+ 0xf764, 0xf765, 0xf766, 0xf767, 0xf768, 0xf769, 0xf76a, 0xf76b, 0xf76c, 0xf76d,
+ 0xf76e, 0xf76f, 0xf770, 0xf771, 0xf772, 0xf773, 0xf774, 0xf775, 0xf776, 0xf777,
+ 0xf778, 0xf779, 0xf77a, 0x20a1, 0xf6dc, 0xf6dd, 0xf6fe, 0x0000, 0x0000, 0xf6e9,
+ 0xf6e0, 0x0000, 0x0000, 0x0000, 0x0000, 0xf7e1, 0xf7e0, 0xf7e2, 0xf7e4, 0xf7e3,
+ 0xf7e5, 0xf7e7, 0xf7e9, 0xf7e8, 0xf7ea, 0xf7eb, 0xf7ed, 0xf7ec, 0xf7ee, 0xf7ef,
+ 0xf7f1, 0xf7f3, 0xf7f2, 0xf7f4, 0xf7f6, 0xf7f5, 0xf7fa, 0xf7f9, 0xf7fb, 0xf7fc,
+ 0x0000, 0x2078, 0x2084, 0x2083, 0x2086, 0x2088, 0x2087, 0xf6fd, 0x0000, 0xf6df,
+ 0x2082, 0x0000, 0xf7a8, 0x0000, 0xf6f5, 0xf6fd, 0x2085, 0x0000, 0xf6e1, 0xf6e7,
+ 0xf7fd, 0x0000, 0xf6e3, 0x0000, 0x0000, 0xf7fe, 0x0000, 0x2089, 0x2080, 0xf6ff,
+ 0xf7e6, 0xf7f8, 0xf7bf, 0x2081, 0xf6e9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0xf7b8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xf6fa, 0x2012, 0xf6e6,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0xf7a1, 0x0000, 0xf7ff, 0x0000, 0x00b9, 0x00b2,
+ 0x00b3, 0x2074, 0x2075, 0x2076, 0x2077, 0x2079, 0x2070, 0x0000, 0xf6ec, 0xf6f1,
+ 0x0000, 0x0000, 0x0000, 0xf6ed, 0xf6f2, 0xf6eb, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0xf6ee, 0xf6fb, 0xf6f4, 0xf7af, 0xf6ea, 0x207f, 0xf6ef, 0xf6e2, 0xf6e8,
+ 0xf6f7, 0xf6fc, 0x0000, 0x0000, 0x0000, 0x0000
+};
+const FX_WORD AdobeSymbolEncoding[256] = {
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0020, 0x0021, 0x2200, 0x0023, 0x2203, 0x0025, 0x0026, 0x220B,
+ 0x0028, 0x0029, 0x2217, 0x002B, 0x002C, 0x2212, 0x002E, 0x002F,
+ 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037,
+ 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,
+ 0x2245, 0x0391, 0x0392, 0x03A7, 0x0394, 0x0395, 0x03A6, 0x0393,
+ 0x0397, 0x0399, 0x03D1, 0x039A, 0x039B, 0x039C, 0x039D, 0x039F,
+ 0x03A0, 0x0398, 0x03A1, 0x03A3, 0x03A4, 0x03A5, 0x03C2, 0x03A9,
+ 0x039E, 0x03A8, 0x0396, 0x005B, 0x2234, 0x005D, 0x22A5, 0x005F,
+ 0xF8E5, 0x03B1, 0x03B2, 0x03C7, 0x03B4, 0x03B5, 0x03C6, 0x03B3,
+ 0x03B7, 0x03B9, 0x03D5, 0x03BA, 0x03BB, 0x03BC, 0x03BD, 0x03BF,
+ 0x03C0, 0x03B8, 0x03C1, 0x03C3, 0x03C4, 0x03C5, 0x03D6, 0x03C9,
+ 0x03BE, 0x03C8, 0x03B6, 0x007B, 0x007C, 0x007D, 0x223C, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x20AC, 0x03D2, 0x2032, 0x2264, 0x2044, 0x221E, 0x0192, 0x2663,
+ 0x2666, 0x2665, 0x2660, 0x2194, 0x2190, 0x2191, 0x2192, 0x2193,
+ 0x00B0, 0x00B1, 0x2033, 0x2265, 0x00D7, 0x221D, 0x2202, 0x2022,
+ 0x00F7, 0x2260, 0x2261, 0x2248, 0x2026, 0xF8E6, 0xF8E7, 0x21B5,
+ 0x2135, 0x2111, 0x211C, 0x2118, 0x2297, 0x2295, 0x2205, 0x2229,
+ 0x222A, 0x2283, 0x2287, 0x2284, 0x2282, 0x2286, 0x2208, 0x2209,
+ 0x2220, 0x2207, 0xF6DA, 0xF6D9, 0xF6DB, 0x220F, 0x221A, 0x22C5,
+ 0x00AC, 0x2227, 0x2228, 0x21D4, 0x21D0, 0x21D1, 0x21D2, 0x21D3,
+ 0x25CA, 0x2329, 0xF8E8, 0xF8E9, 0xF8EA, 0x2211, 0xF8EB, 0xF8EC,
+ 0xF8ED, 0xF8EE, 0xF8EF, 0xF8F0, 0xF8F1, 0xF8F2, 0xF8F3, 0xF8F4,
+ 0x0000, 0x232A, 0x222B, 0x2320, 0xF8F5, 0x2321, 0xF8F6, 0xF8F7,
+ 0xF8F8, 0xF8F9, 0xF8FA, 0xF8FB, 0xF8FC, 0xF8FD, 0xF8FE, 0x0000,
+};
+const FX_WORD ZapfEncoding[256] = {
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0020, 0x2701, 0x2702, 0x2703, 0x2704, 0x260E, 0x2706, 0x2707,
+ 0x2708, 0x2709, 0x261B, 0x261E, 0x270C, 0x270D, 0x270E, 0x270F,
+ 0x2710, 0x2711, 0x2712, 0x2713, 0x2714, 0x2715, 0x2716, 0x2717,
+ 0x2718, 0x2719, 0x271A, 0x271B, 0x271C, 0x271D, 0x271E, 0x271F,
+ 0x2720, 0x2721, 0x2722, 0x2723, 0x2724, 0x2725, 0x2726, 0x2727,
+ 0x2605, 0x2729, 0x272A, 0x272B, 0x272C, 0x272D, 0x272E, 0x272F,
+ 0x2730, 0x2731, 0x2732, 0x2733, 0x2734, 0x2735, 0x2736, 0x2737,
+ 0x2738, 0x2739, 0x273A, 0x273B, 0x273C, 0x273D, 0x273E, 0x273F,
+ 0x2740, 0x2741, 0x2742, 0x2743, 0x2744, 0x2745, 0x2746, 0x2747,
+ 0x2748, 0x2749, 0x274A, 0x274B, 0x25CF, 0x274D, 0x25A0, 0x274F,
+ 0x2750, 0x2751, 0x2752, 0x25B2, 0x25BC, 0x25C6, 0x2756, 0x25D7,
+ 0x2758, 0x2759, 0x275A, 0x275B, 0x275C, 0x275D, 0x275E, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x2761, 0x2762, 0x2763, 0x2764, 0x2765, 0x2766, 0x2767,
+ 0x2663, 0x2666, 0x2665, 0x2660, 0x2460, 0x2461, 0x2462, 0x2463,
+ 0x2464, 0x2465, 0x2466, 0x2467, 0x2468, 0x2469, 0x2776, 0x2777,
+ 0x2778, 0x2779, 0x277A, 0x277B, 0x277C, 0x277D, 0x277E, 0x277F,
+ 0x2780, 0x2781, 0x2782, 0x2783, 0x2784, 0x2785, 0x2786, 0x2787,
+ 0x2788, 0x2789, 0x278A, 0x278B, 0x278C, 0x278D, 0x278E, 0x278F,
+ 0x2790, 0x2791, 0x2792, 0x2793, 0x2794, 0x2192, 0x2194, 0x2195,
+ 0x2798, 0x2799, 0x279A, 0x279B, 0x279C, 0x279D, 0x279E, 0x279F,
+ 0x27A0, 0x27A1, 0x27A2, 0x27A3, 0x27A4, 0x27A5, 0x27A6, 0x27A7,
+ 0x27A8, 0x27A9, 0x27AA, 0x27AB, 0x27AC, 0x27AD, 0x27AE, 0x27AF,
+ 0x0000, 0x27B1, 0x27B2, 0x27B3, 0x27B4, 0x27B5, 0x27B6, 0x27B7,
+ 0x27B8, 0x27B9, 0x27BA, 0x27BB, 0x27BC, 0x27BD, 0x27BE, 0x0000,
+};
+const FX_LPCSTR StandardEncodingNames[224] = {
+ "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quoteright",
+ "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash",
+ "zero", "one", "two", "three", "four", "five", "six", "seven",
+ "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question",
+ "at", "A", "B", "C", "D", "E", "F", "G",
+ "H", "I", "J", "K", "L", "M", "N", "O",
+ "P", "Q", "R", "S", "T", "U", "V", "W",
+ "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore",
+ "quoteleft", "a", "b", "c", "d", "e", "f", "g",
+ "h", "i", "j", "k", "l", "m", "n", "o",
+ "p", "q", "r", "s", "t", "u", "v", "w",
+ "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, "exclamdown", "cent", "sterling", "fraction", "yen", "florin", "section",
+ "currency", "quotesingle", "quotedblleft", "guillemotleft", "guilsinglleft", "guilsinglright", "fi", "fl",
+ NULL, "endash", "dagger", "daggerdbl", "periodcentered", NULL, "paragraph", "bullet",
+ "quotesinglbase", "quotedblbase", "quotedblright", "guillemotright", "ellipsis", "perthousand", NULL, "questiondown",
+ NULL, "grave", "acute", "circumflex", "tilde", "macron", "breve", "dotaccent",
+ "dieresis", NULL, "ring", "cedilla", NULL, "hungarumlaut", "ogonek", "caron",
+ "emdash", NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, "AE", NULL, "ordfeminine", NULL, NULL, NULL, NULL,
+ "Lslash", "Oslash", "OE", "ordmasculine", NULL, NULL, NULL, NULL,
+ NULL, "ae", NULL, NULL, NULL, "dotlessi", NULL, NULL,
+ "lslash", "oslash", "oe", "germandbls", NULL, NULL, NULL, NULL,
+};
+const FX_LPCSTR AdobeWinAnsiEncodingNames[224] = {
+ "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quotesingle",
+ "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash",
+ "zero", "one", "two", "three", "four", "five", "six", "seven",
+ "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question",
+ "at", "A", "B", "C", "D", "E", "F", "G",
+ "H", "I", "J", "K", "L", "M", "N", "O",
+ "P", "Q", "R", "S", "T", "U", "V", "W",
+ "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore",
+ "grave", "a", "b", "c", "d", "e", "f", "g",
+ "h", "i", "j", "k", "l", "m", "n", "o",
+ "p", "q", "r", "s", "t", "u", "v", "w",
+ "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", "bullet",
+ "Euro", "bullet", "quotesinglbase", "florin", "quotedblbase", "ellipsis", "dagger", "daggerdbl",
+ "circumflex", "perthousand", "Scaron", "guilsinglleft", "OE", "bullet", "Zcaron", "bullet",
+ "bullet", "quoteleft", "quoteright", "quotedblleft", "quotedblright", "bullet", "endash", "emdash",
+ "tilde", "trademark", "scaron", "guilsinglright", "oe", "bullet", "zcaron", "Ydieresis",
+ "space", "exclamdown", "cent", "sterling", "currency", "yen", "brokenbar", "section",
+ "dieresis", "copyright", "ordfeminine", "guillemotleft", "logicalnot", "hyphen", "registered", "macron",
+ "degree", "plusminus", "twosuperior", "threesuperior", "acute", "mu", "paragraph", "periodcentered",
+ "cedilla", "onesuperior", "ordmasculine", "guillemotright", "onequarter", "onehalf", "threequarters", "questiondown",
+ "Agrave", "Aacute", "Acircumflex", "Atilde", "Adieresis", "Aring", "AE", "Ccedilla",
+ "Egrave", "Eacute", "Ecircumflex", "Edieresis", "Igrave", "Iacute", "Icircumflex", "Idieresis",
+ "Eth", "Ntilde", "Ograve", "Oacute", "Ocircumflex", "Otilde", "Odieresis", "multiply",
+ "Oslash", "Ugrave", "Uacute", "Ucircumflex", "Udieresis", "Yacute", "Thorn", "germandbls",
+ "agrave", "aacute", "acircumflex", "atilde", "adieresis", "aring", "ae", "ccedilla",
+ "egrave", "eacute", "ecircumflex", "edieresis", "igrave", "iacute", "icircumflex", "idieresis",
+ "eth", "ntilde", "ograve", "oacute", "ocircumflex", "otilde", "odieresis", "divide",
+ "oslash", "ugrave", "uacute", "ucircumflex", "udieresis", "yacute", "thorn", "ydieresis",
+};
+const FX_LPCSTR MacRomanEncodingNames[224] = {
+ "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quotesingle",
+ "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash",
+ "zero", "one", "two", "three", "four", "five", "six", "seven",
+ "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question",
+ "at", "A", "B", "C", "D", "E", "F", "G",
+ "H", "I", "J", "K", "L", "M", "N", "O",
+ "P", "Q", "R", "S", "T", "U", "V", "W",
+ "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore",
+ "grave", "a", "b", "c", "d", "e", "f", "g",
+ "h", "i", "j", "k", "l", "m", "n", "o",
+ "p", "q", "r", "s", "t", "u", "v", "w",
+ "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", NULL,
+ "Adieresis", "Aring", "Ccedilla", "Eacute", "Ntilde", "Odieresis", "Udieresis", "aacute",
+ "agrave", "acircumflex", "adieresis", "atilde", "aring", "ccedilla", "eacute", "egrave",
+ "ecircumflex", "edieresis", "iacute", "igrave", "icircumflex", "idieresis", "ntilde", "oacute",
+ "ograve", "ocircumflex", "odieresis", "otilde", "uacute", "ugrave", "ucircumflex", "udieresis",
+ "dagger", "degree", "cent", "sterling", "section", "bullet", "paragraph", "germandbls",
+ "registered", "copyright", "trademark", "acute", "dieresis", "notequal", "AE", "Oslash",
+ "infinity", "plusminus", "lessequal", "greaterequal", "yen", "mu", "partialdiff", "summation",
+ "product", "pi", "integral", "ordfeminine", "ordmasculine", "Omega", "ae", "oslash",
+ "questiondown", "exclamdown", "logicalnot", "radical", "florin", "approxequal", "Delta", "guillemotleft",
+ "guillemotright", "ellipsis", "space", "Agrave", "Atilde", "Otilde", "OE", "oe",
+ "endash", "emdash", "quotedblleft", "quotedblright", "quoteleft", "quoteright", "divide", "lozenge",
+ "ydieresis", "Ydieresis", "fraction", "currency", "guilsinglleft", "guilsinglright", "fi", "fl",
+ "daggerdbl", "periodcentered", "quotesinglbase", "quotedblbase", "perthousand", "Acircumflex", "Ecircumflex", "Aacute",
+ "Edieresis", "Egrave", "Iacute", "Icircumflex", "Idieresis", "Igrave", "Oacute", "Ocircumflex",
+ "apple", "Ograve", "Uacute", "Ucircumflex", "Ugrave", "dotlessi", "circumflex", "tilde",
+ "macron", "breve", "dotaccent", "ring", "cedilla", "hungarumlaut", "ogonek", "caron",
+};
+const FX_LPCSTR MacExpertEncodingNames[224] = {
+ "space", "exclamsmall", "Hungarumlautsmall", "centoldstyle", "dollaroldstyle", "dollarsuperior", "ampersandsmall", "Acutesmall",
+ "parenleftsuperior", "parenrightsuperior", "twodotenleader", "onedotenleader", "comma", "hyphen", "period", "fraction",
+ "zerooldstyle", "oneoldstyle", "twooldstyle", "threeoldstyle", "fouroldstyle", "fiveoldstyle", "sixoldstyle", "sevenoldstyle",
+ "eightoldstyle", "nineoldstyle", "colon", "semicolon", NULL, "threequartersemdash", NULL, "questionsmall",
+ NULL, NULL, NULL, NULL, "Ethsmall", NULL, NULL, "onequarter",
+ "onehalf", "threequarters", "oneeighth", "threeeighths", "fiveeighths", "seveneighths", "onethird", "twothirds",
+ NULL, NULL, NULL, NULL, NULL, NULL, "ff", "fi",
+ "fl", "ffi", "ffl", "parenleftinferior", NULL, "parenrightinferior", "Circumflexsmall", "hypheninferior",
+ "Gravesmall", "Asmall", "Bsmall", "Csmall", "Dsmall", "Esmall", "Fsmall", "Gsmall",
+ "Hsmall", "Ismall", "Jsmall", "Ksmall", "Lsmall", "Msmall", "Nsmall", "Osmall",
+ "Psmall", "Qsmall", "Rsmall", "Ssmall", "Tsmall", "Usmall", "Vsmall", "Wsmall",
+ "Xsmall", "Ysmall", "Zsmall", "colonmonetary", "onefitted", "rupiah", "Tildesmall", NULL,
+ NULL, "asuperior", "centsuperior", NULL, NULL, NULL, NULL, "Aacutesmall",
+ "Agravesmall", "Acircumflexsmall", "Adieresissmall", "Atildesmall", "Aringsmall", "Ccedillasmall", "Eacutesmall", "Egravesmall",
+ "Ecircumflexsmall", "Edieresissmall", "Iacutesmall", "Igravesmall", "Icircumflexsmall", "Idieresissmall", "Ntildesmall", "Oacutesmall",
+ "Ogravesmall", "Ocircumflexsmall", "Odieresissmall", "Otildesmall", "Uacutesmall", "Ugravesmall", "Ucircumflexsmall", "Udieresissmall",
+ NULL, "eightsuperior", "fourinferior", "threeinferior", "sixinferior", "eightinferior", "seveninferior", "Scaronsmall",
+ NULL, "centinferior", "twoinferior", NULL, "Dieresissmall", NULL, "Caronsmall", "Scaronsmall",
+ "fiveinferior", NULL, "commainferior", "periodinferior", "Yacutesmall", NULL, "dollarinferior", NULL,
+ NULL, "Thornsmall", NULL, "nineinferior", "zeroinferior", "Zcaronsmall", "AEsmall", "Oslashsmall",
+ "questiondownsmall", "oneinferior", "asuperior", NULL, NULL, NULL, NULL, NULL,
+ NULL, "Cedillasmall", NULL, NULL, NULL, NULL, NULL, "OEsmall",
+ "figuredash", "hyphensuperior", NULL, NULL, NULL, NULL, "exclamdownsmall", NULL,
+ "Ydieresissmall", NULL, "onesuperior", "twosuperior", "threesuperior", "foursuperior", "fivesuperior", "sixsuperior",
+ "sevensuperior", "ninesuperior", "zerosuperior", NULL, "esuperior", "rsuperior", NULL, NULL,
+ NULL, "isuperior", "ssuperior", "dsuperior", NULL, NULL, NULL, NULL,
+ NULL, "lsuperior", "Ogoneksmall", "Brevesmall", "Macronsmall", "bsuperior", "nsuperior", "msuperior",
+ "commasuperior", "periodsuperior", "Dotaccentsmall", "Ringsmall", NULL, NULL, NULL, NULL,
+};
+const FX_LPCSTR PDFDocEncodingNames[232] = {
+ "breve", "caron", "circumflex", "dotaccent", "hungarumlaut", "ogonek", "ring", "tilde",
+ "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quotesingle",
+ "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash",
+ "zero", "one", "two", "three", "four", "five", "six", "seven",
+ "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question",
+ "at", "A", "B", "C", "D", "E", "F", "G",
+ "H", "I", "J", "K", "L", "M", "N", "O",
+ "P", "Q", "R", "S", "T", "U", "V", "W",
+ "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore",
+ "grave", "a", "b", "c", "d", "e", "f", "g",
+ "h", "i", "j", "k", "l", "m", "n", "o",
+ "p", "q", "r", "s", "t", "u", "v", "w",
+ "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", NULL,
+ "bullet3", "dagger", "daggerdbl", "ellipsis", "emdash", "endash", "florin", "fraction",
+ "guilsinglleft", "guilsinglright", "minus", "perthousand", "quotedblbase", "quotedblleft", "quotedblright", "quoteleft",
+ "quoteright", "quotesinglbase", "trademark", "fi", "fl", "Lslash", "OE", "Scaron",
+ "Ydieresis", "Zcaron2", "dotlessi", "lslash", "oe", "scaron", "zcaron2", NULL,
+ "Euro", "exclamdown", "cent", "sterling", "currency", "yen", "brokenbar", "section",
+ "dieresis", "copyright", "ordfeminine", "guillemotleft4", "logicalnot", NULL, "registered", "macron",
+ "degree", "plusminus", "twosuperior", "threesuperior", "acute", "mu", "paragraph", "periodcentered",
+ "cedilla", "onesuperior", "ordmasculine", "guillemotright4", "onequarter", "onehalf", "threequarters", "questiondown",
+ "Agrave", "Aacute", "Acircumflex", "Atilde", "Adieresis", "Aring", "AE", "Ccedilla",
+ "Egrave", "Eacute", "Ecircumflex", "Edieresis", "Igrave", "Iacute", "Icircumflex", "Idieresis",
+ "Eth", "Ntilde", "Ograve", "Oacute", "Ocircumflex", "Otilde", "Odieresis", "multiply",
+ "Oslash", "Ugrave", "Uacute", "Ucircumflex", "Udieresis", "Yacute", "Thorn", "germandbls",
+ "agrave", "aacute", "acircumflex", "atilde", "adieresis", "aring", "ae", "ccedilla",
+ "egrave", "eacute", "ecircumflex", "edieresis", "igrave", "iacute", "icircumflex", "idieresis",
+ "eth", "ntilde", "ograve", "oacute", "ocircumflex", "otilde", "odieresis", "divide",
+ "oslash", "ugrave", "uacute", "ucircumflex", "udieresis", "yacute", "thorn", "ydieresis",
+};
+const FX_LPCSTR AdobeSymbolEncodingNames[224] = {
+ "space", "exclam", "universal", "numbersign", "existential", "percent", "ampersand", "suchthat",
+ "parenleft", "parenright", "asteriskmath", "plus", "comma", "minus", "period", "slash",
+ "zero", "one", "two", "three", "four", "five", "six", "seven",
+ "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question",
+ "congruent", "Alpha", "Beta", "Chi", "Delta", "Epsilon", "Phi", "Gamma",
+ "Eta", "Iota", "theta1", "Kappa", "Lambda", "Mu", "Nu", "Omicron",
+ "Pi", "Theta", "Rho", "Sigma", "Tau", "Upsilon", "sigma1", "Omega",
+ "Xi", "Psi", "Zeta", "bracketleft", "therefore", "bracketright", "perpendicular", "underscore",
+ "radicalex", "alpha", "beta", "chi", "delta", "epsilon", "phi", "gamma",
+ "eta", "iota", "phi1", "kappa", "lambda", "mu", "nu", "omicron",
+ "pi", "theta", "rho", "sigma", "tau", "upsilon", "omega1", "omega",
+ "xi", "psi", "zeta", "braceleft", "bar", "braceright", "similar", NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ "Euro", "Upsilon1", "minute", "lessequal", "fraction", "infinity", "florin", "club",
+ "diamond", "heart", "spade", "arrowboth", "arrowleft", "arrowup", "arrowright", "arrowdown",
+ "degree", "plusminus", "second", "greaterequal", "multiply", "proportional", "partialdiff", "bullet",
+ "divide", "notequal", "equivalence", "approxequal", "ellipsis", "arrowvertex", "arrowhorizex", "carriagereturn",
+ "aleph", "Ifraktur", "Rfraktur", "weierstrass", "circlemultiply", "circleplus", "emptyset", "intersection",
+ "union", "propersuperset", "reflexsuperset", "notsubset", "propersubset", "reflexsubset", "element", "notelement",
+ "angle", "gradient", "registerserif", "copyrightserif", "trademarkserif", "product", "radical", "dotmath",
+ "logicalnot", "logicaland", "logicalor", "arrowdblboth", "arrowdblleft", "arrowdblup", "arrowdblright", "arrowdbldown",
+ "lozenge", "angleleft", "registersans", "copyrightsans", "trademarksans", "summation", "parenlefttp", "parenleftex",
+ "parenleftbt", "bracketlefttp", "bracketleftex", "bracketleftbt", "bracelefttp", "braceleftmid", "braceleftbt", "braceex",
+ NULL, "angleright", "integral", "integraltp", "integralex", "integralbt", "parenrighttp", "parenrightex",
+ "parenrightbt", "bracketrighttp", "bracketrightex", "bracketrightbt", "bracerighttp", "bracerightmid", "bracerightbt", NULL,
+};
+const FX_LPCSTR ZapfEncodingNames[224] = {
+ "space", "a1", "a2", "a202", "a3", "a4", "a5", "a119",
+ "a118", "a117", "a11", "a12", "a13", "a14", "a15", "a16",
+ "a105", "a17", "a18", "a19", "a20", "a21", "a22", "a23",
+ "a24", "a25", "a26", "a27", "a28", "a6", "a7", "a8",
+ "a9", "a10", "a29", "a30", "a31", "a32", "a33", "a34",
+ "a35", "a36", "a37", "a38", "a39", "a40", "a41", "a42",
+ "a43", "a44", "a45", "a46", "a47", "a48", "a49", "a50",
+ "a51", "a52", "a53", "a54", "a55", "a56", "a57", "a58",
+ "a59", "a60", "a61", "a62", "a63", "a64", "a65", "a66",
+ "a67", "a68", "a69", "a70", "a71", "a72", "a73", "a74",
+ "a203", "a75", "a204", "a76", "a77", "a78", "a79", "a81",
+ "a82", "a83", "a84", "a97", "a98", "a99", "a100", NULL,
+ "a89", "a90", "a93", "a94", "a91", "a92", "a205", "a85",
+ "a206", "a86", "a87", "a88", "a95", "a96", NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, "a101", "a102", "a103", "a104", "a106", "a107", "a108",
+ "a112", "a111", "a110", "a109", "a120", "a121", "a122", "a123",
+ "a124", "a125", "a126", "a127", "a128", "a129", "a130", "a131",
+ "a132", "a133", "a134", "a135", "a136", "a137", "a138", "a139",
+ "a140", "a141", "a142", "a143", "a144", "a145", "a146", "a147",
+ "a148", "a149", "a150", "a151", "a152", "a153", "a154", "a155",
+ "a156", "a157", "a158", "a159", "a160", "a161", "a163", "a164",
+ "a196", "a165", "a192", "a166", "a167", "a168", "a169", "a170",
+ "a171", "a172", "a173", "a162", "a174", "a175", "a176", "a177",
+ "a178", "a179", "a193", "a180", "a199", "a181", "a200", "a182",
+ NULL, "a201", "a183", "a184", "a197", "a185", "a194", "a198",
+ "a186", "a195", "a187", "a188", "a189", "a190", "a191", NULL
+};
+const FX_CHAR* PDF_CharNameFromPredefinedCharSet(int encoding, FX_BYTE charcode)
+{
+ if (encoding == PDFFONT_ENCODING_PDFDOC) {
+ if (charcode < 24) {
+ return NULL;
+ }
+ charcode -= 24;
+ } else {
+ if (charcode < 32) {
+ return NULL;
+ }
+ charcode -= 32;
+ }
+ switch (encoding) {
+ case PDFFONT_ENCODING_WINANSI:
+ return AdobeWinAnsiEncodingNames[charcode];
+ case PDFFONT_ENCODING_MACROMAN:
+ return MacRomanEncodingNames[charcode];
+ case PDFFONT_ENCODING_MACEXPERT:
+ return MacExpertEncodingNames[charcode];
+ case PDFFONT_ENCODING_STANDARD:
+ return StandardEncodingNames[charcode];
+ case PDFFONT_ENCODING_ADOBE_SYMBOL:
+ return AdobeSymbolEncodingNames[charcode];
+ case PDFFONT_ENCODING_ZAPFDINGBATS:
+ return ZapfEncodingNames[charcode];
+ case PDFFONT_ENCODING_PDFDOC:
+ return PDFDocEncodingNames[charcode];
+ }
+ return NULL;
+}
+FX_WCHAR FT_UnicodeFromCharCode(int encoding, FX_DWORD charcode)
+{
+ switch (encoding) {
+ case FXFT_ENCODING_UNICODE:
+ return (FX_WORD)charcode;
+ case FXFT_ENCODING_ADOBE_STANDARD:
+ return StandardEncoding[(FX_BYTE)charcode];
+ case FXFT_ENCODING_ADOBE_EXPERT:
+ return MacExpertEncoding[(FX_BYTE)charcode];
+ case FXFT_ENCODING_ADOBE_LATIN_1:
+ return AdobeWinAnsiEncoding[(FX_BYTE)charcode];
+ case FXFT_ENCODING_APPLE_ROMAN:
+ return MacRomanEncoding[(FX_BYTE)charcode];
+ case PDFFONT_ENCODING_PDFDOC:
+ return PDFDocEncoding[(FX_BYTE)charcode];
+ }
+ return 0;
+}
+static FX_DWORD PDF_FindCode(const FX_WORD* pCodes, FX_WORD unicode)
+{
+ for (FX_DWORD i = 0; i < 256; i ++)
+ if (pCodes[i] == unicode) {
+ return i;
+ }
+ return 0;
+}
+const FX_WORD MSSymbolEncoding[256] = {
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 32, 33, 8704, 35, 8707, 37, 38, 8715,
+ 40, 41, 8727, 43, 44, 8722, 46, 47, 48, 49,
+ 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
+ 60, 61, 62, 63, 8773, 913, 914, 935, 916, 917,
+ 934, 915, 919, 921, 977, 922, 923, 924, 925, 927,
+ 928, 920, 929, 931, 932, 933, 962, 937, 926, 936,
+ 918, 91, 8756, 93, 8869, 95, 8254, 945, 946, 967,
+ 948, 949, 966, 947, 951, 953, 981, 954, 955, 956,
+ 957, 959, 960, 952, 961, 963, 964, 965, 982, 969,
+ 958, 968, 950, 123, 124, 125, 8764, 0, 0, 0,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 978, 8242, 8804, 8725, 8734, 402, 9827, 9830, 9828,
+ 9824, 8596, 8592, 8593, 8594, 8595, 176, 177, 8243, 8805,
+ 215, 8733, 8706, 8729, 247, 8800, 8801, 8776, 8943, 0,
+ 0, 8629, 0, 8465, 8476, 8472, 8855, 8853, 8709, 8745,
+ 8746, 8835, 8839, 8836, 8834, 8838, 8712, 8713, 8736, 8711,
+ 174, 169, 8482, 8719, 8730, 8901, 172, 8743, 8744, 8660,
+ 8656, 8657, 8658, 8659, 9674, 9001, 0, 0, 0, 8721,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0x0000, 9002, 8747, 8992, 0, 8993, 0, 0, 0, 0,
+ 0, 0, 0x0000, 0x0000, 0x0000, 0x0000
+};
+FX_DWORD FT_CharCodeFromUnicode(int encoding, FX_WCHAR unicode)
+{
+ switch (encoding) {
+ case FXFT_ENCODING_UNICODE:
+ return unicode;
+ case FXFT_ENCODING_ADOBE_STANDARD:
+ return PDF_FindCode(StandardEncoding, unicode);
+ case FXFT_ENCODING_ADOBE_EXPERT:
+ return PDF_FindCode(MacExpertEncoding, unicode);
+ case FXFT_ENCODING_ADOBE_LATIN_1:
+ return PDF_FindCode(AdobeWinAnsiEncoding, unicode);
+ case FXFT_ENCODING_APPLE_ROMAN:
+ return PDF_FindCode(MacRomanEncoding, unicode);
+ case FXFT_ENCODING_ADOBE_CUSTOM:
+ return PDF_FindCode(PDFDocEncoding, unicode);
+ case FXFT_ENCODING_MS_SYMBOL:
+ return PDF_FindCode(MSSymbolEncoding, unicode);
+ }
+ return 0;
+}
+const FX_WORD* PDF_UnicodesForPredefinedCharSet(int encoding)
+{
+ switch (encoding) {
+ case PDFFONT_ENCODING_WINANSI:
+ return AdobeWinAnsiEncoding;
+ case PDFFONT_ENCODING_MACROMAN:
+ return MacRomanEncoding;
+ case PDFFONT_ENCODING_MACEXPERT:
+ return MacExpertEncoding;
+ case PDFFONT_ENCODING_STANDARD:
+ return StandardEncoding;
+ case PDFFONT_ENCODING_ADOBE_SYMBOL:
+ return AdobeSymbolEncoding;
+ case PDFFONT_ENCODING_ZAPFDINGBATS:
+ return ZapfEncoding;
+ case PDFFONT_ENCODING_PDFDOC:
+ return PDFDocEncoding;
+ case PDFFONT_ENCODING_MS_SYMBOL:
+ return MSSymbolEncoding;
+ }
+ return NULL;
+}
+FX_DWORD PDF_PredefinedCharCodeFromUnicode(int encoding, FX_WCHAR unicode)
+{
+ return PDF_FindCode(PDF_UnicodesForPredefinedCharSet(encoding), unicode);
+}
+#ifdef __cplusplus
+extern "C" {
+#endif
+extern int FXFT_unicode_from_adobe_name(const char* name);
+#ifdef __cplusplus
+}
+#endif
+FX_WCHAR PDF_UnicodeFromAdobeName(const FX_CHAR* name)
+{
+ return (FX_WCHAR)(FXFT_unicode_from_adobe_name(name) & 0x7FFFFFFF);
+}
+CFX_ByteString PDF_AdobeNameFromUnicode(FX_WCHAR unicode)
+{
+ char glyph_name[64];
+ FXFT_adobe_name_from_unicode(glyph_name, unicode);
+ return CFX_ByteString(glyph_name, -1);
+}
diff --git a/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp b/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp
index 891d82fa1a..23bbc4aab9 100644
--- a/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp
+++ b/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp
@@ -1,1716 +1,1716 @@
-// 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
-
-#include "../../../include/fpdfapi/fpdf_module.h"
-#include "../../../include/fpdfapi/fpdf_page.h"
-#include "font_int.h"
-#include "../fpdf_cmaps/cmap_int.h"
-#include "../../../include/fxge/fx_ge.h"
-#include "../../../include/fxge/fx_freetype.h"
-extern FX_DWORD FT_CharCodeFromUnicode(int encoding, FX_WCHAR unicode);
-extern FX_LPVOID FXFC_LoadPackage(FX_LPCSTR name);
-extern FX_BOOL FXFC_LoadFile(FX_LPVOID pPackage, FX_LPCSTR name, FX_LPBYTE& pBuffer, FX_DWORD& size);
-extern void FXFC_ClosePackage(FX_LPVOID pPackage);
-extern short TT2PDF(int m, FXFT_Face face);
-extern FX_BOOL FT_UseTTCharmap(FXFT_Face face, int platform_id, int encoding_id);
-extern FX_LPCSTR GetAdobeCharName(int iBaseEncoding, const CFX_ByteString* pCharNames, int charcode);
-CPDF_CMapManager::CPDF_CMapManager()
-{
-#ifndef _FPDFAPI_MINI_
- m_bPrompted = FALSE;
- m_pPackage = NULL;
-#endif
- FXSYS_memset32(m_CID2UnicodeMaps, 0, sizeof m_CID2UnicodeMaps);
-}
-CPDF_CMapManager::~CPDF_CMapManager()
-{
- DropAll(FALSE);
-#ifndef _FPDFAPI_MINI_
- if (m_pPackage) {
- FXFC_ClosePackage(m_pPackage);
- }
-#endif
-}
-#ifndef _FPDFAPI_MINI_
-FX_LPVOID CPDF_CMapManager::GetPackage(FX_BOOL bPrompt)
-{
-#ifndef FOXIT_CHROME_BUILD
- if (m_pPackage == NULL) {
- CFX_ByteString filename = CPDF_ModuleMgr::Get()->GetModuleFilePath(ADDIN_NAME_CJK, "FPDFCJK.BIN");
- m_pPackage = FXFC_LoadPackage(filename);
- if (bPrompt && m_pPackage == NULL && !m_bPrompted) {
- m_bPrompted = TRUE;
- if (!CPDF_ModuleMgr::Get()->DownloadModule(ADDIN_NAME_CJK)) {
- return NULL;
- }
- m_pPackage = FXFC_LoadPackage(filename);
- }
- }
-#endif
- return m_pPackage;
-}
-#endif
-CPDF_CMap* CPDF_CMapManager::GetPredefinedCMap(const CFX_ByteString& name, FX_BOOL bPromptCJK)
-{
- CPDF_CMap* pCMap;
- if (m_CMaps.Lookup(name, (FX_LPVOID&)pCMap)) {
- return pCMap;
- }
- pCMap = LoadPredefinedCMap(name, bPromptCJK);
- if (name.IsEmpty()) {
- return pCMap;
- }
- m_CMaps.SetAt(name, pCMap);
- return pCMap;
-}
-CPDF_CMap* CPDF_CMapManager::LoadPredefinedCMap(const CFX_ByteString& name, FX_BOOL bPromptCJK)
-{
- CPDF_CMap* pCMap = FX_NEW CPDF_CMap;
- FX_LPCSTR pname = name;
- if (*pname == '/') {
- pname ++;
- }
- pCMap->LoadPredefined(this, pname, bPromptCJK);
- return pCMap;
-}
-const FX_LPCSTR g_CharsetNames[] = {NULL, "GB1", "CNS1", "Japan1", "Korea1", "UCS", NULL};
-const int g_CharsetCPs[] = {0, 936, 950, 932, 949, 1200, 0};
-int _CharsetFromOrdering(const CFX_ByteString& Ordering)
-{
- int charset = 1;
- while (g_CharsetNames[charset] && Ordering != CFX_ByteStringC(g_CharsetNames[charset])) {
- charset ++;
- }
- if (g_CharsetNames[charset] == NULL) {
- return CIDSET_UNKNOWN;
- }
- return charset;
-}
-void CPDF_CMapManager::ReloadAll()
-{
- DropAll(TRUE);
-}
-void CPDF_CMapManager::DropAll(FX_BOOL bReload)
-{
- FX_POSITION pos = m_CMaps.GetStartPosition();
- while (pos) {
- CFX_ByteString name;
- CPDF_CMap* pCMap;
- m_CMaps.GetNextAssoc(pos, name, (FX_LPVOID&)pCMap);
- if (pCMap == NULL) {
- continue;
- }
- if (bReload) {
- pCMap->LoadPredefined(this, name, FALSE);
- } else {
- delete pCMap;
- }
- }
- for (int i = 0; i < sizeof m_CID2UnicodeMaps / sizeof(CPDF_CID2UnicodeMap*); i ++) {
- CPDF_CID2UnicodeMap* pMap = m_CID2UnicodeMaps[i];
- if (pMap == NULL) {
- continue;
- }
- if (bReload) {
- pMap->Load(this, i, FALSE);
- } else {
- delete pMap;
- }
- }
-}
-CPDF_CID2UnicodeMap* CPDF_CMapManager::GetCID2UnicodeMap(int charset, FX_BOOL bPromptCJK)
-{
- if (m_CID2UnicodeMaps[charset] == NULL) {
- m_CID2UnicodeMaps[charset] = LoadCID2UnicodeMap(charset, bPromptCJK);
- }
- return m_CID2UnicodeMaps[charset];
-}
-CPDF_CID2UnicodeMap* CPDF_CMapManager::LoadCID2UnicodeMap(int charset, FX_BOOL bPromptCJK)
-{
- CPDF_CID2UnicodeMap* pMap = FX_NEW CPDF_CID2UnicodeMap();
- if (!pMap->Initialize()) {
- delete pMap;
- return NULL;
- }
- pMap->Load(this, charset, bPromptCJK);
- return pMap;
-}
-CPDF_CMapParser::CPDF_CMapParser()
-{
- m_pCMap = NULL;
- m_Status = 0;
- m_CodeSeq = 0;
-}
-FX_BOOL CPDF_CMapParser::Initialize(CPDF_CMap* pCMap)
-{
- m_pCMap = pCMap;
- m_Status = 0;
- m_CodeSeq = 0;
- m_AddMaps.EstimateSize(0, 10240);
- return TRUE;
-}
-static FX_DWORD CMap_GetCode(FX_BSTR word)
-{
- int num = 0;
- if (word.GetAt(0) == '<') {
- for (int i = 1; i < word.GetLength(); i ++) {
- FX_BYTE digit = word.GetAt(i);
- if (digit >= '0' && digit <= '9') {
- digit = digit - '0';
- } else if (digit >= 'a' && digit <= 'f') {
- digit = digit - 'a' + 10;
- } else if (digit >= 'A' && digit <= 'F') {
- digit = digit - 'A' + 10;
- } else {
- return num;
- }
- num = num * 16 + digit;
- }
- } else {
- for (int i = 0; i < word.GetLength(); i ++) {
- if (word.GetAt(i) < '0' || word.GetAt(i) > '9') {
- return num;
- }
- num = num * 10 + word.GetAt(i) - '0';
- }
- }
- return num;
-}
-static FX_BOOL _CMap_GetCodeRange(_CMap_CodeRange& range, FX_BSTR first, FX_BSTR second)
-{
- if (first.GetLength() == 0 || first.GetAt(0) != '<') {
- return FALSE;
- }
- int num = 0;
- int i;
- for (i = 1; i < first.GetLength(); i ++)
- if (first.GetAt(i) == '>') {
- break;
- }
- range.m_CharSize = (i - 1) / 2;
- if (range.m_CharSize > 4) {
- return FALSE;
- }
- for (i = 0; i < range.m_CharSize; i ++) {
- FX_BYTE digit1 = first.GetAt(i * 2 + 1);
- FX_BYTE digit2 = first.GetAt(i * 2 + 2);
- FX_BYTE byte = (digit1 >= '0' && digit1 <= '9') ? (digit1 - '0') : ((digit1 & 0xdf) - 'A' + 10);
- byte = byte * 16 + ((digit2 >= '0' && digit2 <= '9') ? (digit2 - '0') : ((digit2 & 0xdf) - 'A' + 10));
- range.m_Lower[i] = byte;
- }
- FX_DWORD size = second.GetLength();
- for (i = 0; i < range.m_CharSize; i ++) {
- FX_BYTE digit1 = ((FX_DWORD)i * 2 + 1 < size) ? second.GetAt((FX_STRSIZE)i * 2 + 1) : 0;
- FX_BYTE digit2 = ((FX_DWORD)i * 2 + 2 < size) ? second.GetAt((FX_STRSIZE)i * 2 + 2) : 0;
- FX_BYTE byte = (digit1 >= '0' && digit1 <= '9') ? (digit1 - '0') : ((digit1 & 0xdf) - 'A' + 10);
- byte = byte * 16 + ((digit2 >= '0' && digit2 <= '9') ? (digit2 - '0') : ((digit2 & 0xdf) - 'A' + 10));
- range.m_Upper[i] = byte;
- }
- return TRUE;
-}
-static CFX_ByteString CMap_GetString(FX_BSTR word)
-{
- return word.Mid(1, word.GetLength() - 2);
-}
-void CPDF_CMapParser::ParseWord(FX_BSTR word)
-{
- if (word.IsEmpty()) {
- return;
- }
- if (word == FX_BSTRC("begincidchar")) {
- m_Status = 1;
- m_CodeSeq = 0;
- } else if (word == FX_BSTRC("begincidrange")) {
- m_Status = 2;
- m_CodeSeq = 0;
- } else if (word == FX_BSTRC("endcidrange") || word == FX_BSTRC("endcidchar")) {
- m_Status = 0;
- } else if (word == FX_BSTRC("/WMode")) {
- m_Status = 6;
- } else if (word == FX_BSTRC("/Registry")) {
- m_Status = 3;
- } else if (word == FX_BSTRC("/Ordering")) {
- m_Status = 4;
- } else if (word == FX_BSTRC("/Supplement")) {
- m_Status = 5;
- } else if (word == FX_BSTRC("begincodespacerange")) {
- m_Status = 7;
- m_CodeSeq = 0;
- } else if (word == FX_BSTRC("usecmap")) {
- } else if (m_Status == 1 || m_Status == 2) {
- m_CodePoints[m_CodeSeq] = CMap_GetCode(word);
- m_CodeSeq ++;
- FX_DWORD StartCode, EndCode;
- FX_WORD StartCID;
- if (m_Status == 1) {
- if (m_CodeSeq < 2) {
- return;
- }
- EndCode = StartCode = m_CodePoints[0];
- StartCID = (FX_WORD)m_CodePoints[1];
- } else {
- if (m_CodeSeq < 3) {
- return;
- }
- StartCode = m_CodePoints[0];
- EndCode = m_CodePoints[1];
- StartCID = (FX_WORD)m_CodePoints[2];
- }
- if (EndCode < 0x10000) {
- for (FX_DWORD code = StartCode; code <= EndCode; code ++) {
- m_pCMap->m_pMapping[code] = (FX_WORD)(StartCID + code - StartCode);
- }
- } else {
- FX_DWORD buf[2];
- buf[0] = StartCode;
- buf[1] = ((EndCode - StartCode) << 16) + StartCID;
- m_AddMaps.AppendBlock(buf, sizeof buf);
- }
- m_CodeSeq = 0;
- } else if (m_Status == 3) {
- CMap_GetString(word);
- m_Status = 0;
- } else if (m_Status == 4) {
- m_pCMap->m_Charset = _CharsetFromOrdering(CMap_GetString(word));
- m_Status = 0;
- } else if (m_Status == 5) {
- CMap_GetCode(word);
- m_Status = 0;
- } else if (m_Status == 6) {
- m_pCMap->m_bVertical = CMap_GetCode(word);
- m_Status = 0;
- } else if (m_Status == 7) {
- if (word == FX_BSTRC("endcodespacerange")) {
- int nSegs = m_CodeRanges.GetSize();
- if (nSegs > 1) {
- m_pCMap->m_CodingScheme = CPDF_CMap::MixedFourBytes;
- m_pCMap->m_nCodeRanges = nSegs;
- m_pCMap->m_pLeadingBytes = FX_Alloc(FX_BYTE, nSegs * sizeof(_CMap_CodeRange));
- FXSYS_memcpy32(m_pCMap->m_pLeadingBytes, m_CodeRanges.GetData(), nSegs * sizeof(_CMap_CodeRange));
- } else if (nSegs == 1) {
- m_pCMap->m_CodingScheme = (m_CodeRanges[0].m_CharSize == 2) ? CPDF_CMap::TwoBytes : CPDF_CMap::OneByte;
- }
- m_Status = 0;
- } else {
- if (word.GetLength() == 0 || word.GetAt(0) != '<') {
- return;
- }
- if (m_CodeSeq % 2) {
- _CMap_CodeRange range;
- if (_CMap_GetCodeRange(range, m_LastWord, word)) {
- m_CodeRanges.Add(range);
- }
- }
- m_CodeSeq ++;
- }
- }
- m_LastWord = word;
-}
-CPDF_CMap::CPDF_CMap()
-{
- m_Charset = CIDSET_UNKNOWN;
- m_Coding = CIDCODING_UNKNOWN;
- m_CodingScheme = TwoBytes;
- m_bVertical = 0;
- m_bLoaded = FALSE;
- m_pMapping = NULL;
- m_pLeadingBytes = NULL;
- m_pAddMapping = NULL;
- m_pEmbedMap = NULL;
- m_pUseMap = NULL;
- m_nCodeRanges = 0;
-}
-CPDF_CMap::~CPDF_CMap()
-{
- if (m_pMapping) {
- FX_Free(m_pMapping);
- }
- if (m_pAddMapping) {
- FX_Free(m_pAddMapping);
- }
- if (m_pLeadingBytes) {
- FX_Free(m_pLeadingBytes);
- }
- if (m_pUseMap) {
- delete m_pUseMap;
- }
-}
-void CPDF_CMap::Release()
-{
- if (m_PredefinedCMap.IsEmpty()) {
- delete this;
- }
-}
-const CPDF_PredefinedCMap g_PredefinedCMaps[] = {
- { "GB-EUC", CIDSET_GB1, CIDCODING_GB, CPDF_CMap::MixedTwoBytes, 1, {0xa1, 0xfe} },
- { "GBpc-EUC", CIDSET_GB1, CIDCODING_GB, CPDF_CMap::MixedTwoBytes, 1, {0xa1, 0xfc} },
- { "GBK-EUC", CIDSET_GB1, CIDCODING_GB, CPDF_CMap::MixedTwoBytes, 1, {0x81, 0xfe} },
- { "GBKp-EUC", CIDSET_GB1, CIDCODING_GB, CPDF_CMap::MixedTwoBytes, 1, {0x81, 0xfe} },
- { "GBK2K-EUC", CIDSET_GB1, CIDCODING_GB, CPDF_CMap::MixedTwoBytes, 1, {0x81, 0xfe} },
- { "GBK2K", CIDSET_GB1, CIDCODING_GB, CPDF_CMap::MixedTwoBytes, 1, {0x81, 0xfe} },
- { "UniGB-UCS2", CIDSET_GB1, CIDCODING_UCS2, CPDF_CMap::TwoBytes },
- { "UniGB-UTF16", CIDSET_GB1, CIDCODING_UTF16, CPDF_CMap::TwoBytes },
- { "B5pc", CIDSET_CNS1, CIDCODING_BIG5, CPDF_CMap::MixedTwoBytes, 1, {0xa1, 0xfc} },
- { "HKscs-B5", CIDSET_CNS1, CIDCODING_BIG5, CPDF_CMap::MixedTwoBytes, 1, {0x88, 0xfe} },
- { "ETen-B5", CIDSET_CNS1, CIDCODING_BIG5, CPDF_CMap::MixedTwoBytes, 1, {0xa1, 0xfe} },
- { "ETenms-B5", CIDSET_CNS1, CIDCODING_BIG5, CPDF_CMap::MixedTwoBytes, 1, {0xa1, 0xfe} },
- { "UniCNS-UCS2", CIDSET_CNS1, CIDCODING_UCS2, CPDF_CMap::TwoBytes },
- { "UniCNS-UTF16", CIDSET_CNS1, CIDCODING_UTF16, CPDF_CMap::TwoBytes },
- { "83pv-RKSJ", CIDSET_JAPAN1, CIDCODING_JIS, CPDF_CMap::MixedTwoBytes, 2, {0x81, 0x9f, 0xe0, 0xfc} },
- { "90ms-RKSJ", CIDSET_JAPAN1, CIDCODING_JIS, CPDF_CMap::MixedTwoBytes, 2, {0x81, 0x9f, 0xe0, 0xfc} },
- { "90msp-RKSJ", CIDSET_JAPAN1, CIDCODING_JIS, CPDF_CMap::MixedTwoBytes, 2, {0x81, 0x9f, 0xe0, 0xfc} },
- { "90pv-RKSJ", CIDSET_JAPAN1, CIDCODING_JIS, CPDF_CMap::MixedTwoBytes, 2, {0x81, 0x9f, 0xe0, 0xfc} },
- { "Add-RKSJ", CIDSET_JAPAN1, CIDCODING_JIS, CPDF_CMap::MixedTwoBytes, 2, {0x81, 0x9f, 0xe0, 0xfc} },
- { "EUC", CIDSET_JAPAN1, CIDCODING_JIS, CPDF_CMap::MixedTwoBytes, 2, {0x8e, 0x8e, 0xa1, 0xfe} },
- { "H", CIDSET_JAPAN1, CIDCODING_JIS, CPDF_CMap::TwoBytes, 1, {0x21, 0x7e} },
- { "V", CIDSET_JAPAN1, CIDCODING_JIS, CPDF_CMap::TwoBytes, 1, {0x21, 0x7e} },
- { "Ext-RKSJ", CIDSET_JAPAN1, CIDCODING_JIS, CPDF_CMap::MixedTwoBytes, 2, {0x81, 0x9f, 0xe0, 0xfc} },
- { "UniJIS-UCS2", CIDSET_JAPAN1, CIDCODING_UCS2, CPDF_CMap::TwoBytes },
- { "UniJIS-UCS2-HW", CIDSET_JAPAN1, CIDCODING_UCS2, CPDF_CMap::TwoBytes },
- { "UniJIS-UTF16", CIDSET_JAPAN1, CIDCODING_UTF16, CPDF_CMap::TwoBytes },
- { "KSC-EUC", CIDSET_KOREA1, CIDCODING_KOREA, CPDF_CMap::MixedTwoBytes, 1, {0xa1, 0xfe} },
- { "KSCms-UHC", CIDSET_KOREA1, CIDCODING_KOREA, CPDF_CMap::MixedTwoBytes, 1, {0x81, 0xfe} },
- { "KSCms-UHC-HW", CIDSET_KOREA1, CIDCODING_KOREA, CPDF_CMap::MixedTwoBytes, 1, {0x81, 0xfe} },
- { "KSCpc-EUC", CIDSET_KOREA1, CIDCODING_KOREA, CPDF_CMap::MixedTwoBytes, 1, {0xa1, 0xfd} },
- { "UniKS-UCS2", CIDSET_KOREA1, CIDCODING_UCS2, CPDF_CMap::TwoBytes },
- { "UniKS-UTF16", CIDSET_KOREA1, CIDCODING_UTF16, CPDF_CMap::TwoBytes },
- { NULL, 0, 0 }
-};
-extern void FPDFAPI_FindEmbeddedCMap(const char* name, int charset, int coding, const FXCMAP_CMap*& pMap);
-extern FX_WORD FPDFAPI_CIDFromCharCode(const FXCMAP_CMap* pMap, FX_DWORD charcode);
-FX_BOOL CPDF_CMap::LoadPredefined(CPDF_CMapManager* pMgr, FX_LPCSTR pName, FX_BOOL bPromptCJK)
-{
- m_PredefinedCMap = pName;
- if (m_PredefinedCMap == FX_BSTRC("Identity-H") || m_PredefinedCMap == FX_BSTRC("Identity-V")) {
- m_Coding = CIDCODING_CID;
- m_bVertical = pName[9] == 'V';
- m_bLoaded = TRUE;
- return TRUE;
- }
- CFX_ByteString cmapid = m_PredefinedCMap;
- m_bVertical = cmapid.Right(1) == FX_BSTRC("V");
- if (cmapid.GetLength() > 2) {
- cmapid = cmapid.Left(cmapid.GetLength() - 2);
- }
- int index = 0;
- while (1) {
- if (g_PredefinedCMaps[index].m_pName == NULL) {
- return FALSE;
- }
- if (cmapid == CFX_ByteStringC(g_PredefinedCMaps[index].m_pName)) {
- break;
- }
- index ++;
- }
- const CPDF_PredefinedCMap& map = g_PredefinedCMaps[index];
- m_Charset = map.m_Charset;
- m_Coding = map.m_Coding;
- m_CodingScheme = map.m_CodingScheme;
- if (m_CodingScheme == MixedTwoBytes) {
- m_pLeadingBytes = FX_Alloc(FX_BYTE, 256);
- FXSYS_memset32(m_pLeadingBytes, 0, 256);
- for (FX_DWORD i = 0; i < map.m_LeadingSegCount; i ++) {
- for (int b = map.m_LeadingSegs[i * 2]; b <= map.m_LeadingSegs[i * 2 + 1]; b ++) {
- m_pLeadingBytes[b] = 1;
- }
- }
- }
- FPDFAPI_FindEmbeddedCMap(pName, m_Charset, m_Coding, m_pEmbedMap);
- if (m_pEmbedMap) {
- m_bLoaded = TRUE;
- return TRUE;
- }
-#ifndef _FPDFAPI_MINI_
- FX_LPVOID pPackage = pMgr->GetPackage(bPromptCJK);
- FX_LPBYTE pBuffer;
- FX_DWORD size;
- if (pPackage == NULL || !FXFC_LoadFile(pPackage, m_PredefinedCMap, pBuffer, size)) {
- return FALSE;
- }
- m_pMapping = FX_Alloc(FX_WORD, 65536);
- FXSYS_memset32(m_pMapping, 0, 65536 * sizeof(FX_WORD));
- FX_DWORD dwRecodeEndPos = 0;
- if (pBuffer[5] == 0) {
- FX_DWORD dwStartIndex = *(FX_DWORD*)(pBuffer + 8);
- FX_DWORD dwRecordCount = *(FX_DWORD*)(pBuffer + 16);
- FX_DWORD dwDataOffset = *(FX_DWORD*)(pBuffer + 20);
- if (dwRecordCount * 2 + dwStartIndex * 2 < 65536) {
- FXSYS_memcpy32(m_pMapping + dwStartIndex * 2, pBuffer + dwDataOffset, dwRecordCount * 2);
- }
- dwRecodeEndPos = dwDataOffset + dwRecordCount * 2;
- } else if (pBuffer[5] == 2) {
- FX_DWORD nSegments = *(FX_DWORD*)(pBuffer + 16);
- FX_DWORD dwDataOffset = *(FX_DWORD*)(pBuffer + 20);
- dwRecodeEndPos = dwDataOffset + 6 * nSegments;
- for (FX_DWORD i = 0; i < nSegments; i ++) {
- FX_LPBYTE pRecord = pBuffer + dwDataOffset + i * 6;
- FX_WORD IndexStart = *(FX_WORD*)pRecord;
- FX_WORD IndexCount = *(FX_WORD*)(pRecord + 2);
- FX_WORD CodeStart = *(FX_WORD*)(pRecord + 4);
- if (IndexStart + IndexCount < 65536)
- for (FX_DWORD j = 0; j < IndexCount; j ++) {
- m_pMapping[IndexStart + j ] = (FX_WORD)(CodeStart + j);
- }
- }
- }
- if (dwRecodeEndPos < size) {
- FX_DWORD dwMapLen = *(FX_DWORD*)(pBuffer + dwRecodeEndPos);
- if (dwMapLen) {
- m_pUseMap = FX_NEW CPDF_CMap;
- CFX_ByteString bsName(pBuffer + dwRecodeEndPos + 4 , dwMapLen);
- if (m_pUseMap) {
- m_pUseMap->LoadPredefined(pMgr, bsName, bPromptCJK);
- }
- }
- }
- FX_Free(pBuffer);
- m_bLoaded = TRUE;
-#endif
- return TRUE;
-}
-extern "C" {
- static int compare_dword(const void* data1, const void* data2)
- {
- return (*(FX_DWORD*)data1) - (*(FX_DWORD*)data2);
- }
-};
-FX_BOOL CPDF_CMap::LoadEmbedded(FX_LPCBYTE pData, FX_DWORD size)
-{
- m_pMapping = FX_Alloc(FX_WORD, 65536);
- FXSYS_memset32(m_pMapping, 0, 65536 * sizeof(FX_WORD));
- CPDF_CMapParser parser;
- parser.Initialize(this);
- CPDF_SimpleParser syntax(pData, size);
- while (1) {
- CFX_ByteStringC word = syntax.GetWord();
- if (word.IsEmpty()) {
- break;
- }
- parser.ParseWord(word);
- }
- if (m_CodingScheme == MixedFourBytes && parser.m_AddMaps.GetSize()) {
- m_pAddMapping = FX_Alloc(FX_BYTE, parser.m_AddMaps.GetSize() + 4);
- *(FX_DWORD*)m_pAddMapping = parser.m_AddMaps.GetSize() / 8;
- FXSYS_memcpy32(m_pAddMapping + 4, parser.m_AddMaps.GetBuffer(), parser.m_AddMaps.GetSize());
- FXSYS_qsort(m_pAddMapping + 4, parser.m_AddMaps.GetSize() / 8, 8, compare_dword);
- }
- return TRUE;
-}
-extern "C" {
- static int compareCID(const void* key, const void* element)
- {
- if ((*(FX_DWORD*)key) < (*(FX_DWORD*)element)) {
- return -1;
- }
- if ((*(FX_DWORD*)key) > (*(FX_DWORD*)element) + ((FX_DWORD*)element)[1] / 65536) {
- return 1;
- }
- return 0;
- }
-};
-FX_WORD CPDF_CMap::CIDFromCharCode(FX_DWORD charcode) const
-{
- if (m_Coding == CIDCODING_CID) {
- return (FX_WORD)charcode;
- }
- if (m_pEmbedMap) {
- return FPDFAPI_CIDFromCharCode(m_pEmbedMap, charcode);
- }
- if (m_pMapping == NULL) {
- return (FX_WORD)charcode;
- }
- if (charcode >> 16) {
- if (m_pAddMapping) {
- void* found = FXSYS_bsearch(&charcode, m_pAddMapping + 4, *(FX_DWORD*)m_pAddMapping, 8, compareCID);
- if (found == NULL) {
- if (m_pUseMap) {
- return m_pUseMap->CIDFromCharCode(charcode);
- }
- return 0;
- }
- return (FX_WORD)(((FX_DWORD*)found)[1] % 65536 + charcode - * (FX_DWORD*)found);
- }
- if (m_pUseMap) {
- return m_pUseMap->CIDFromCharCode(charcode);
- }
- return 0;
- }
- FX_DWORD CID = m_pMapping[charcode];
- if (!CID && m_pUseMap) {
- return m_pUseMap->CIDFromCharCode(charcode);
- }
- return (FX_WORD)CID;
-}
-static int _CheckCodeRange(FX_LPBYTE codes, int size, _CMap_CodeRange* pRanges, int nRanges)
-{
- int iSeg = nRanges - 1;
- while (iSeg >= 0) {
- if (pRanges[iSeg].m_CharSize < size) {
- iSeg --;
- continue;
- }
- int iChar = 0;
- while (iChar < size) {
- if (codes[iChar] < pRanges[iSeg].m_Lower[iChar] ||
- codes[iChar] > pRanges[iSeg].m_Upper[iChar]) {
- break;
- }
- iChar ++;
- }
- if (iChar == pRanges[iSeg].m_CharSize) {
- return 2;
- }
- if (iChar) {
- if (size == pRanges[iSeg].m_CharSize) {
- return 2;
- }
- return 1;
- }
- iSeg --;
- }
- return 0;
-}
-FX_DWORD CPDF_CMap::GetNextChar(FX_LPCSTR pString, int& offset) const
-{
- switch (m_CodingScheme) {
- case OneByte:
- return ((FX_LPBYTE)pString)[offset++];
- case TwoBytes:
- offset += 2;
- return ((FX_LPBYTE)pString)[offset - 2] * 256 + ((FX_LPBYTE)pString)[offset - 1];
- case MixedTwoBytes: {
- FX_BYTE byte1 = ((FX_LPBYTE)pString)[offset++];
- if (!m_pLeadingBytes[byte1]) {
- return byte1;
- }
- FX_BYTE byte2 = ((FX_LPBYTE)pString)[offset++];
- return byte1 * 256 + byte2;
- }
- case MixedFourBytes: {
- FX_BYTE codes[4];
- int char_size = 1;
- codes[0] = ((FX_LPBYTE)pString)[offset++];
- _CMap_CodeRange* pRanges = (_CMap_CodeRange*)m_pLeadingBytes;
- while (1) {
- int ret = _CheckCodeRange(codes, char_size, pRanges, m_nCodeRanges);
- if (ret == 0) {
- return 0;
- }
- if (ret == 2) {
- FX_DWORD charcode = 0;
- for (int i = 0; i < char_size; i ++) {
- charcode = (charcode << 8) + codes[i];
- }
- return charcode;
- }
- if (char_size == 4) {
- return 0;
- }
- codes[char_size ++] = ((FX_LPBYTE)pString)[offset++];
- }
- break;
- }
- }
- return 0;
-}
-int CPDF_CMap::GetCharSize(FX_DWORD charcode) const
-{
- switch (m_CodingScheme) {
- case OneByte:
- return 1;
- case TwoBytes:
- return 2;
- case MixedTwoBytes:
- case MixedFourBytes:
- if (charcode < 0x100) {
- return 1;
- }
- if (charcode < 0x10000) {
- return 2;
- }
- if (charcode < 0x1000000) {
- return 3;
- }
- return 4;
- }
- return 1;
-}
-int CPDF_CMap::CountChar(FX_LPCSTR pString, int size) const
-{
- switch (m_CodingScheme) {
- case OneByte:
- return size;
- case TwoBytes:
- return (size + 1) / 2;
- case MixedTwoBytes: {
- int count = 0;
- for (int i = 0; i < size; i ++) {
- count ++;
- if (m_pLeadingBytes[((FX_LPBYTE)pString)[i]]) {
- i ++;
- }
- }
- return count;
- }
- case MixedFourBytes: {
- int count = 0, offset = 0;
- while (offset < size) {
- GetNextChar(pString, offset);
- count ++;
- }
- return count;
- }
- }
- return size;
-}
-int _GetCharSize(FX_DWORD charcode, _CMap_CodeRange* pRanges, int iRangesSize)
-{
- if (!iRangesSize) {
- return 1;
- }
- FX_BYTE codes[4];
- codes[0] = codes[1] = 0x00;
- codes[2] = (FX_BYTE)(charcode >> 8 & 0xFF);
- codes[3] = (FX_BYTE)charcode;
- int offset = 0, size = 4;
- for (int i = 0; i < 4; ++i) {
- int iSeg = iRangesSize - 1;
- while (iSeg >= 0) {
- if (pRanges[iSeg].m_CharSize < size) {
- iSeg --;
- continue;
- }
- int iChar = 0;
- while (iChar < size) {
- if (codes[offset + iChar] < pRanges[iSeg].m_Lower[iChar] ||
- codes[offset + iChar] > pRanges[iSeg].m_Upper[iChar]) {
- break;
- }
- iChar ++;
- }
- if (iChar == pRanges[iSeg].m_CharSize) {
- return size;
- }
- iSeg --;
- }
- size --;
- offset ++;
- }
- return 1;
-}
-int CPDF_CMap::AppendChar(FX_LPSTR str, FX_DWORD charcode) const
-{
- switch (m_CodingScheme) {
- case OneByte:
- str[0] = (FX_BYTE)charcode;
- return 1;
- case TwoBytes:
- str[0] = (FX_BYTE)(charcode / 256);
- str[1] = (FX_BYTE)(charcode % 256);
- return 2;
- case MixedTwoBytes:
- case MixedFourBytes:
- if (charcode < 0x100) {
- _CMap_CodeRange* pRanges = (_CMap_CodeRange*)m_pLeadingBytes;
- int iSize = _GetCharSize(charcode, pRanges, m_nCodeRanges);
- if (iSize == 0) {
- iSize = 1;
- }
- if (iSize > 1) {
- FXSYS_memset32(str, 0, sizeof(FX_BYTE) * iSize);
- }
- str[iSize - 1] = (FX_BYTE)charcode;
- return iSize;
- } else if (charcode < 0x10000) {
- str[0] = (FX_BYTE)(charcode >> 8);
- str[1] = (FX_BYTE)charcode;
- return 2;
- } else if (charcode < 0x1000000) {
- str[0] = (FX_BYTE)(charcode >> 16);
- str[1] = (FX_BYTE)(charcode >> 8);
- str[2] = (FX_BYTE)charcode;
- return 3;
- } else {
- str[0] = (FX_BYTE)(charcode >> 24);
- str[1] = (FX_BYTE)(charcode >> 16);
- str[2] = (FX_BYTE)(charcode >> 8);
- str[3] = (FX_BYTE)charcode;
- return 4;
- }
- }
- return 0;
-}
-CPDF_CID2UnicodeMap::CPDF_CID2UnicodeMap()
-{
- m_EmbeddedCount = 0;
-#ifndef _FPDFAPI_MINI_
- m_pExternalMap = NULL;
-#endif
-}
-CPDF_CID2UnicodeMap::~CPDF_CID2UnicodeMap()
-{
-#ifndef _FPDFAPI_MINI_
- if (m_pExternalMap) {
- delete m_pExternalMap;
- }
-#endif
-}
-FX_BOOL CPDF_CID2UnicodeMap::Initialize()
-{
-#ifndef _FPDFAPI_MINI_
- m_pExternalMap = FX_NEW CPDF_FXMP;
-#endif
- return TRUE;
-}
-FX_BOOL CPDF_CID2UnicodeMap::IsLoaded()
-{
-#ifdef _FPDFAPI_MINI_
- return m_EmbeddedCount != 0;
-#else
- return m_EmbeddedCount != 0 || (m_pExternalMap != NULL && m_pExternalMap->IsLoaded());
-#endif
-}
-FX_WCHAR CPDF_CID2UnicodeMap::UnicodeFromCID(FX_WORD CID)
-{
- if (m_Charset == CIDSET_UNICODE) {
- return CID;
- }
- if (CID < m_EmbeddedCount) {
- return m_pEmbeddedMap[CID];
- }
-#ifdef _FPDFAPI_MINI_
- return 0;
-#else
- FX_LPCBYTE record = m_pExternalMap->GetRecord(CID);
- if (record == NULL) {
- return 0;
- }
- return *(FX_WORD*)record;
-#endif
-}
-void FPDFAPI_LoadCID2UnicodeMap(int charset, const FX_WORD*& pMap, FX_DWORD& count);
-void CPDF_CID2UnicodeMap::Load(CPDF_CMapManager* pMgr, int charset, FX_BOOL bPromptCJK)
-{
- m_Charset = charset;
- FPDFAPI_LoadCID2UnicodeMap(charset, m_pEmbeddedMap, m_EmbeddedCount);
- if (m_EmbeddedCount) {
- return;
- }
-#ifndef _FPDFAPI_MINI_
- FX_LPVOID pPackage = pMgr->GetPackage(bPromptCJK);
- if (pPackage == NULL) {
- return;
- }
- m_pExternalMap->LoadFile(pPackage, FX_BSTRC("CIDInfo_") + g_CharsetNames[charset]);
-#endif
-}
-#include "ttgsubtable.h"
-CPDF_CIDFont::CPDF_CIDFont()
-{
- m_pCMap = NULL;
- m_pAllocatedCMap = NULL;
- m_pCID2UnicodeMap = NULL;
- m_pAnsiWidths = NULL;
- m_pCIDToGIDMap = NULL;
- m_bCIDIsGID = FALSE;
- m_bAdobeCourierStd = FALSE;
- m_pTTGSUBTable = NULL;
- FXSYS_memset8(m_CharBBox, 0xff, 256 * sizeof(FX_SMALL_RECT));
-}
-CPDF_CIDFont::~CPDF_CIDFont()
-{
- if (m_pAnsiWidths) {
- FX_Free(m_pAnsiWidths);
- }
- if (m_pAllocatedCMap) {
- delete m_pAllocatedCMap;
- }
- if (m_pCIDToGIDMap) {
- delete m_pCIDToGIDMap;
- }
- if (m_pTTGSUBTable) {
- delete m_pTTGSUBTable;
- }
-}
-FX_WORD CPDF_CIDFont::CIDFromCharCode(FX_DWORD charcode) const
-{
- if (m_pCMap == NULL) {
- return (FX_WORD)charcode;
- }
- return m_pCMap->CIDFromCharCode(charcode);
-}
-FX_BOOL CPDF_CIDFont::IsVertWriting() const
-{
- return m_pCMap ? m_pCMap->IsVertWriting() : FALSE;
-}
-extern FX_DWORD FPDFAPI_CharCodeFromCID(const FXCMAP_CMap* pMap, FX_WORD cid);
-static FX_DWORD _EmbeddedCharcodeFromUnicode(const FXCMAP_CMap* pEmbedMap, int charset, FX_WCHAR unicode)
-{
- if (charset <= 0 || charset > 4) {
- return 0;
- }
- CPDF_FontGlobals* pFontGlobals = CPDF_ModuleMgr::Get()->GetPageModule()->GetFontGlobals();
- const FX_WORD* pCodes = pFontGlobals->m_EmbeddedToUnicodes[charset].m_pMap;
- if (pCodes == NULL) {
- return 0;
- }
- int nCodes = pFontGlobals->m_EmbeddedToUnicodes[charset].m_Count;
- for (int i = 0; i < nCodes; i++) {
- if (pCodes[i] == unicode) {
- FX_DWORD CharCode = FPDFAPI_CharCodeFromCID(pEmbedMap, i);
- if (CharCode == 0) {
- continue;
- }
- return CharCode;
- }
- }
- return 0;
-}
-static FX_WCHAR _EmbeddedUnicodeFromCharcode(const FXCMAP_CMap* pEmbedMap, int charset, FX_DWORD charcode)
-{
- if (charset <= 0 || charset > 4) {
- return 0;
- }
- FX_WORD cid = FPDFAPI_CIDFromCharCode(pEmbedMap, charcode);
- if (cid == 0) {
- return 0;
- }
- CPDF_FontGlobals* pFontGlobals = CPDF_ModuleMgr::Get()->GetPageModule()->GetFontGlobals();
- const FX_WORD* pCodes = pFontGlobals->m_EmbeddedToUnicodes[charset].m_pMap;
- if (pCodes == NULL) {
- return 0;
- }
- if (cid < pFontGlobals->m_EmbeddedToUnicodes[charset].m_Count) {
- return pCodes[cid];
- }
- return 0;
-}
-FX_WCHAR CPDF_CIDFont::_UnicodeFromCharCode(FX_DWORD charcode) const
-{
- switch (m_pCMap->m_Coding) {
- case CIDCODING_UCS2:
- case CIDCODING_UTF16:
- return (FX_WCHAR)charcode;
- case CIDCODING_CID:
- if (m_pCID2UnicodeMap == NULL || !m_pCID2UnicodeMap->IsLoaded()) {
- return 0;
- }
- return m_pCID2UnicodeMap->UnicodeFromCID((FX_WORD)charcode);
- }
- if (!m_pCMap->IsLoaded() || m_pCID2UnicodeMap == NULL || !m_pCID2UnicodeMap->IsLoaded()) {
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
- FX_WCHAR unicode;
- int charsize = 1;
- if (charcode > 255) {
- charcode = (charcode % 256) * 256 + (charcode / 256);
- charsize = 2;
- }
- int ret = FXSYS_MultiByteToWideChar(g_CharsetCPs[m_pCMap->m_Coding], 0, (FX_LPCSTR)&charcode, charsize, &unicode, 1);
- if (ret != 1) {
- return 0;
- }
- return unicode;
-#endif
- if (m_pCMap->m_pEmbedMap) {
- return _EmbeddedUnicodeFromCharcode(m_pCMap->m_pEmbedMap, m_pCMap->m_Charset, charcode);
- } else {
- return 0;
- }
- }
- return m_pCID2UnicodeMap->UnicodeFromCID(CIDFromCharCode(charcode));
-}
-FX_DWORD CPDF_CIDFont::_CharCodeFromUnicode(FX_WCHAR unicode) const
-{
- switch (m_pCMap->m_Coding) {
- case CIDCODING_UNKNOWN:
- return 0;
- case CIDCODING_UCS2:
- case CIDCODING_UTF16:
- return unicode;
- case CIDCODING_CID: {
- if (m_pCID2UnicodeMap == NULL || !m_pCID2UnicodeMap->IsLoaded()) {
- return 0;
- }
- FX_DWORD CID = 0;
- while (CID < 65536) {
- FX_WCHAR this_unicode = m_pCID2UnicodeMap->UnicodeFromCID((FX_WORD)CID);
- if (this_unicode == unicode) {
- return CID;
- }
- CID ++;
- }
- break;
- }
- }
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
- FX_BYTE buffer[32];
- int ret = FXSYS_WideCharToMultiByte(g_CharsetCPs[m_pCMap->m_Coding], 0, &unicode, 1, (char*)buffer, 4, NULL, NULL);
- if (ret == 1) {
- return buffer[0];
- } else if (ret == 2) {
- return buffer[0] * 256 + buffer[1];
- }
- return 0;
-#endif
- if (unicode < 0x80) {
- return (FX_DWORD)unicode;
- } else {
- if (m_pCMap->m_pEmbedMap) {
- return _EmbeddedCharcodeFromUnicode(m_pCMap->m_pEmbedMap, m_pCMap->m_Charset, unicode);
- } else {
- return 0;
- }
- }
-}
-static void FT_UseCIDCharmap(FXFT_Face face, int coding)
-{
- int encoding;
- switch (coding) {
- case CIDCODING_GB:
- encoding = FXFT_ENCODING_GB2312;
- break;
- case CIDCODING_BIG5:
- encoding = FXFT_ENCODING_BIG5;
- break;
- case CIDCODING_JIS:
- encoding = FXFT_ENCODING_SJIS;
- break;
- case CIDCODING_KOREA:
- encoding = FXFT_ENCODING_JOHAB;
- break;
- default:
- encoding = FXFT_ENCODING_UNICODE;
- }
- int err = FXFT_Select_Charmap(face, encoding);
- if (err) {
- err = FXFT_Select_Charmap(face, FXFT_ENCODING_UNICODE);
- }
- if (err && FXFT_Get_Face_Charmaps(face)) {
- FXFT_Set_Charmap(face, *FXFT_Get_Face_Charmaps(face));
- }
-}
-FX_BOOL CPDF_CIDFont::_Load()
-{
- if (m_pFontDict->GetString(FX_BSTRC("Subtype")) == FX_BSTRC("TrueType")) {
- return LoadGB2312();
- }
- CPDF_Array* pFonts = m_pFontDict->GetArray(FX_BSTRC("DescendantFonts"));
- if (pFonts == NULL) {
- return FALSE;
- }
- if (pFonts->GetCount() != 1) {
- return FALSE;
- }
- CPDF_Dictionary* pCIDFontDict = pFonts->GetDict(0);
- if (pCIDFontDict == NULL) {
- return FALSE;
- }
- m_BaseFont = pCIDFontDict->GetString(FX_BSTRC("BaseFont"));
- if ((m_BaseFont.Compare("CourierStd") == 0 || m_BaseFont.Compare("CourierStd-Bold") == 0
- || m_BaseFont.Compare("CourierStd-BoldOblique") == 0 || m_BaseFont.Compare("CourierStd-Oblique") == 0)
- && !IsEmbedded()) {
- m_bAdobeCourierStd = TRUE;
- }
- CPDF_Dictionary* pFontDesc = pCIDFontDict->GetDict(FX_BSTRC("FontDescriptor"));
- if (pFontDesc) {
- LoadFontDescriptor(pFontDesc);
- }
- CPDF_Object* pEncoding = m_pFontDict->GetElementValue(FX_BSTRC("Encoding"));
- if (pEncoding == NULL) {
- return FALSE;
- }
- CFX_ByteString subtype = pCIDFontDict->GetString(FX_BSTRC("Subtype"));
- m_bType1 = FALSE;
- if (subtype == FX_BSTRC("CIDFontType0")) {
- m_bType1 = TRUE;
- }
- if (pEncoding->GetType() == PDFOBJ_NAME) {
- CFX_ByteString cmap = pEncoding->GetString();
- m_pCMap = CPDF_ModuleMgr::Get()->GetPageModule()->GetFontGlobals()->m_CMapManager.GetPredefinedCMap(cmap,
- m_pFontFile && m_bType1);
- } else if (pEncoding->GetType() == PDFOBJ_STREAM) {
- m_pAllocatedCMap = m_pCMap = FX_NEW CPDF_CMap;
- CPDF_Stream* pStream = (CPDF_Stream*)pEncoding;
- CPDF_StreamAcc acc;
- acc.LoadAllData(pStream, FALSE);
- m_pCMap->LoadEmbedded(acc.GetData(), acc.GetSize());
- } else {
- return FALSE;
- }
- if (m_pCMap == NULL) {
- return FALSE;
- }
- m_Charset = m_pCMap->m_Charset;
- if (m_Charset == CIDSET_UNKNOWN) {
- CPDF_Dictionary* pCIDInfo = pCIDFontDict->GetDict(FX_BSTRC("CIDSystemInfo"));
- if (pCIDInfo) {
- m_Charset = _CharsetFromOrdering(pCIDInfo->GetString(FX_BSTRC("Ordering")));
- }
- }
- if (m_Charset != CIDSET_UNKNOWN)
- m_pCID2UnicodeMap = CPDF_ModuleMgr::Get()->GetPageModule()->GetFontGlobals()->m_CMapManager.GetCID2UnicodeMap(m_Charset,
- m_pFontFile == NULL && (m_pCMap->m_Coding == CIDCODING_CID || pCIDFontDict->KeyExist(FX_BSTRC("W"))));
- if (m_Font.GetFace()) {
- if (m_bType1) {
- FXFT_Select_Charmap(m_Font.GetFace(), FXFT_ENCODING_UNICODE);
- } else {
- FT_UseCIDCharmap(m_Font.GetFace(), m_pCMap->m_Coding);
- }
- }
- m_DefaultWidth = pCIDFontDict->GetInteger(FX_BSTRC("DW"), 1000);
- CPDF_Array* pWidthArray = pCIDFontDict->GetArray(FX_BSTRC("W"));
- if (pWidthArray) {
- LoadMetricsArray(pWidthArray, m_WidthList, 1);
- }
- if (!IsEmbedded()) {
- LoadSubstFont();
- }
- if (1) {
- if (m_pFontFile || (GetSubstFont()->m_SubstFlags & FXFONT_SUBST_EXACT)) {
- CPDF_Object* pmap = pCIDFontDict->GetElementValue(FX_BSTRC("CIDToGIDMap"));
- if (pmap) {
- if (pmap->GetType() == PDFOBJ_STREAM) {
- m_pCIDToGIDMap = FX_NEW CPDF_StreamAcc;
- m_pCIDToGIDMap->LoadAllData((CPDF_Stream*)pmap, FALSE);
- } else if (pmap->GetString() == FX_BSTRC("Identity")) {
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
- if (m_pFontFile) {
- m_bCIDIsGID = TRUE;
- }
-#else
- m_bCIDIsGID = TRUE;
-#endif
- }
- }
- }
- }
- CheckFontMetrics();
- if (IsVertWriting()) {
- pWidthArray = pCIDFontDict->GetArray(FX_BSTRC("W2"));
- if (pWidthArray) {
- LoadMetricsArray(pWidthArray, m_VertMetrics, 3);
- }
- CPDF_Array* pDefaultArray = pCIDFontDict->GetArray(FX_BSTRC("DW2"));
- if (pDefaultArray) {
- m_DefaultVY = pDefaultArray->GetInteger(0);
- m_DefaultW1 = pDefaultArray->GetInteger(1);
- } else {
- m_DefaultVY = 880;
- m_DefaultW1 = -1000;
- }
- }
- return TRUE;
-}
-FX_FLOAT _CIDTransformToFloat(FX_BYTE ch)
-{
- if (ch < 128) {
- return ch * 1.0f / 127;
- }
- return (-255 + ch) * 1.0f / 127;
-}
-void CPDF_CIDFont::GetCharBBox(FX_DWORD charcode, FX_RECT& rect, int level)
-{
- if (charcode < 256 && m_CharBBox[charcode].Right != -1) {
- rect.bottom = m_CharBBox[charcode].Bottom;
- rect.left = m_CharBBox[charcode].Left;
- rect.right = m_CharBBox[charcode].Right;
- rect.top = m_CharBBox[charcode].Top;
- return;
- }
- FX_BOOL bVert = FALSE;
- int glyph_index = GlyphFromCharCode(charcode, &bVert);
- if (m_Font.m_Face == NULL) {
- rect = FX_RECT(0, 0, 0, 0);
- } else {
- rect.left = rect.bottom = rect.right = rect.top = 0;
- FXFT_Face face = m_Font.m_Face;
- if (FXFT_Is_Face_Tricky(face)) {
- int err = FXFT_Load_Glyph(face, glyph_index, FXFT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH);
- if (!err) {
- FXFT_BBox cbox;
- FXFT_Glyph glyph;
- err = FXFT_Get_Glyph(((FXFT_Face)face)->glyph, &glyph);
- if (!err) {
- FXFT_Glyph_Get_CBox(glyph, FXFT_GLYPH_BBOX_PIXELS, &cbox);
- int pixel_size_x = ((FXFT_Face)face)->size->metrics.x_ppem;
- int pixel_size_y = ((FXFT_Face)face)->size->metrics.y_ppem;
- if (pixel_size_x == 0 || pixel_size_y == 0) {
- rect.left = cbox.xMin;
- rect.right = cbox.xMax;
- rect.top = cbox.yMax;
- rect.bottom = cbox.yMin;
- } else {
- rect.left = cbox.xMin * 1000 / pixel_size_x;
- rect.right = cbox.xMax * 1000 / pixel_size_x;
- rect.top = cbox.yMax * 1000 / pixel_size_y;
- rect.bottom = cbox.yMin * 1000 / pixel_size_y;
- }
- if (rect.top > FXFT_Get_Face_Ascender(face)) {
- rect.top = FXFT_Get_Face_Ascender(face);
- }
- if (rect.bottom < FXFT_Get_Face_Descender(face)) {
- rect.bottom = FXFT_Get_Face_Descender(face);
- }
- FXFT_Done_Glyph(glyph);
- }
- }
- } else {
- int err = FXFT_Load_Glyph(face, glyph_index, FXFT_LOAD_NO_SCALE);
- if (err == 0) {
- rect.left = TT2PDF(FXFT_Get_Glyph_HoriBearingX(face), face);
- rect.right = TT2PDF(FXFT_Get_Glyph_HoriBearingX(face) + FXFT_Get_Glyph_Width(face), face);
- rect.top = TT2PDF(FXFT_Get_Glyph_HoriBearingY(face), face);
- rect.top += rect.top / 64;
- rect.bottom = TT2PDF(FXFT_Get_Glyph_HoriBearingY(face) - FXFT_Get_Glyph_Height(face), face);
- }
- }
- }
- if (m_pFontFile == NULL && m_Charset == CIDSET_JAPAN1) {
- FX_WORD CID = CIDFromCharCode(charcode);
- FX_LPCBYTE pTransform = GetCIDTransform(CID);
- if (pTransform && !bVert) {
- CFX_AffineMatrix matrix(_CIDTransformToFloat(pTransform[0]), _CIDTransformToFloat(pTransform[1]),
- _CIDTransformToFloat(pTransform[2]), _CIDTransformToFloat(pTransform[3]),
- _CIDTransformToFloat(pTransform[4]) * 1000 , _CIDTransformToFloat(pTransform[5]) * 1000);
- CFX_FloatRect rect_f(rect);
- rect_f.Transform(&matrix);
- rect = rect_f.GetOutterRect();
- }
- }
- if (charcode < 256) {
- m_CharBBox[charcode].Bottom = (short)rect.bottom;
- m_CharBBox[charcode].Left = (short)rect.left;
- m_CharBBox[charcode].Right = (short)rect.right;
- m_CharBBox[charcode].Top = (short)rect.top;
- }
-}
-int CPDF_CIDFont::GetCharWidthF(FX_DWORD charcode, int level)
-{
- if (m_pAnsiWidths && charcode < 0x80) {
- return m_pAnsiWidths[charcode];
- }
- FX_WORD cid = CIDFromCharCode(charcode);
- int size = m_WidthList.GetSize();
- FX_DWORD* list = m_WidthList.GetData();
- for (int i = 0; i < size; i += 3) {
- if (cid >= list[i] && cid <= list[i + 1]) {
- return (int)list[i + 2];
- }
- }
- return m_DefaultWidth;
-}
-short CPDF_CIDFont::GetVertWidth(FX_WORD CID) const
-{
- FX_DWORD vertsize = m_VertMetrics.GetSize() / 5;
- if (vertsize == 0) {
- return m_DefaultW1;
- }
- const FX_DWORD* pTable = m_VertMetrics.GetData();
- for (FX_DWORD i = 0; i < vertsize; i ++)
- if (pTable[i * 5] <= CID && pTable[i * 5 + 1] >= CID) {
- return (short)(int)pTable[i * 5 + 2];
- }
- return m_DefaultW1;
-}
-void CPDF_CIDFont::GetVertOrigin(FX_WORD CID, short& vx, short &vy) const
-{
- FX_DWORD vertsize = m_VertMetrics.GetSize() / 5;
- if (vertsize) {
- const FX_DWORD* pTable = m_VertMetrics.GetData();
- for (FX_DWORD i = 0; i < vertsize; i ++)
- if (pTable[i * 5] <= CID && pTable[i * 5 + 1] >= CID) {
- vx = (short)(int)pTable[i * 5 + 3];
- vy = (short)(int)pTable[i * 5 + 4];
- return;
- }
- }
- FX_DWORD dwWidth = m_DefaultWidth;
- int size = m_WidthList.GetSize();
- const FX_DWORD* list = m_WidthList.GetData();
- for (int i = 0; i < size; i += 3) {
- if (CID >= list[i] && CID <= list[i + 1]) {
- dwWidth = (FX_WORD)list[i + 2];
- break;
- }
- }
- vx = (short)dwWidth / 2;
- vy = (short)m_DefaultVY;
-}
-int CPDF_CIDFont::GetGlyphIndex(FX_DWORD unicode, FX_BOOL *pVertGlyph)
-{
- if (pVertGlyph) {
- *pVertGlyph = FALSE;
- }
- int index = FXFT_Get_Char_Index(m_Font.m_Face, unicode );
- if (unicode == 0x2502) {
- return index;
- }
- if (index && IsVertWriting()) {
- if (m_pTTGSUBTable) {
- TT_uint32_t vindex = 0;
- m_pTTGSUBTable->GetVerticalGlyph(index, &vindex);
- if (vindex) {
- index = vindex;
- if (pVertGlyph) {
- *pVertGlyph = TRUE;
- }
- }
- return index;
- }
- if (NULL == m_Font.m_pGsubData) {
- unsigned long length = 0;
- int error = FXFT_Load_Sfnt_Table( m_Font.m_Face, FT_MAKE_TAG('G', 'S', 'U', 'B'), 0, NULL, &length);
- if (!error) {
- m_Font.m_pGsubData = (unsigned char*)FX_Alloc(FX_BYTE, length);
- }
- }
- int error = FXFT_Load_Sfnt_Table( m_Font.m_Face, FT_MAKE_TAG('G', 'S', 'U', 'B'), 0, m_Font.m_pGsubData, NULL);
- if (!error && m_Font.m_pGsubData) {
- m_pTTGSUBTable = FX_NEW CFX_CTTGSUBTable;
- m_pTTGSUBTable->LoadGSUBTable((FT_Bytes)m_Font.m_pGsubData);
- TT_uint32_t vindex = 0;
- m_pTTGSUBTable->GetVerticalGlyph(index, &vindex);
- if (vindex) {
- index = vindex;
- if (pVertGlyph) {
- *pVertGlyph = TRUE;
- }
- }
- }
- return index;
- }
- if (pVertGlyph) {
- *pVertGlyph = FALSE;
- }
- return index;
-}
-int CPDF_CIDFont::GlyphFromCharCode(FX_DWORD charcode, FX_BOOL *pVertGlyph)
-{
- if (pVertGlyph) {
- *pVertGlyph = FALSE;
- }
- if (m_pFontFile == NULL && m_pCIDToGIDMap == NULL) {
- FX_WORD cid = CIDFromCharCode(charcode);
- FX_WCHAR unicode = 0;
- if (m_bCIDIsGID) {
-#if _FXM_PLATFORM_ != _FXM_PLATFORM_APPLE_
- return cid;
-#else
- if (m_Flags & PDFFONT_SYMBOLIC) {
- return cid;
- }
- CFX_WideString uni_str = UnicodeFromCharCode(charcode);
- if (uni_str.IsEmpty()) {
- return cid;
- }
- unicode = uni_str.GetAt(0);
-#endif
- } else {
- if (cid && m_pCID2UnicodeMap && m_pCID2UnicodeMap->IsLoaded()) {
- unicode = m_pCID2UnicodeMap->UnicodeFromCID(cid);
- }
- if (unicode == 0) {
- unicode = _UnicodeFromCharCode(charcode);
- }
- if (unicode == 0 && !(m_Flags & PDFFONT_SYMBOLIC)) {
- unicode = UnicodeFromCharCode(charcode).GetAt(0);
- }
- }
- if (unicode == 0) {
- if (!m_bAdobeCourierStd) {
- return charcode == 0 ? -1 : (int)charcode;
- }
- charcode += 31;
- int index = 0, iBaseEncoding;
- FX_BOOL bMSUnicode = FT_UseTTCharmap(m_Font.m_Face, 3, 1);
- FX_BOOL bMacRoman = FALSE;
- if (!bMSUnicode) {
- bMacRoman = FT_UseTTCharmap(m_Font.m_Face, 1, 0);
- }
- iBaseEncoding = PDFFONT_ENCODING_STANDARD;
- if (bMSUnicode) {
- iBaseEncoding = PDFFONT_ENCODING_WINANSI;
- } else if (bMacRoman) {
- iBaseEncoding = PDFFONT_ENCODING_MACROMAN;
- }
- FX_LPCSTR name = GetAdobeCharName(iBaseEncoding, NULL, charcode);
- if (name == NULL) {
- return charcode == 0 ? -1 : (int)charcode;
- }
- FX_WORD unicode = PDF_UnicodeFromAdobeName(name);
- if (unicode) {
- if (bMSUnicode) {
- index = FXFT_Get_Char_Index(m_Font.m_Face, unicode);
- } else if (bMacRoman) {
- FX_DWORD maccode = FT_CharCodeFromUnicode(FXFT_ENCODING_APPLE_ROMAN, unicode);
- index = !maccode ? FXFT_Get_Name_Index(m_Font.m_Face, (char *)name) : FXFT_Get_Char_Index(m_Font.m_Face, maccode);
- } else {
- return FXFT_Get_Char_Index(m_Font.m_Face, unicode);
- }
- } else {
- return charcode == 0 ? -1 : (int)charcode;
- }
- if (index == 0 || index == 0xffff) {
- return charcode == 0 ? -1 : (int)charcode;
- } else {
- return index;
- }
- }
- if (m_Charset == CIDSET_JAPAN1) {
- if (unicode == '\\') {
- unicode = '/';
- }
-#if !defined(_FPDFAPI_MINI_) && _FXM_PLATFORM_ != _FXM_PLATFORM_APPLE_
- else if (unicode == 0xa5) {
- unicode = 0x5c;
- }
-#endif
- }
- if (m_Font.m_Face == NULL) {
- return unicode;
- }
- int err = FXFT_Select_Charmap(m_Font.m_Face, FXFT_ENCODING_UNICODE);
- if (err != 0) {
- int i;
- for (i = 0; i < FXFT_Get_Face_CharmapCount(m_Font.m_Face); i ++) {
- FX_DWORD ret = FT_CharCodeFromUnicode(FXFT_Get_Charmap_Encoding(FXFT_Get_Face_Charmaps(m_Font.m_Face)[i]), (FX_WCHAR)charcode);
- if (ret == 0) {
- continue;
- }
- FXFT_Set_Charmap(m_Font.m_Face, FXFT_Get_Face_Charmaps(m_Font.m_Face)[i]);
- unicode = (FX_WCHAR)ret;
- break;
- }
- if (i == FXFT_Get_Face_CharmapCount(m_Font.m_Face) && i) {
- FXFT_Set_Charmap(m_Font.m_Face, FXFT_Get_Face_Charmaps(m_Font.m_Face)[0]);
- unicode = (FX_WCHAR)charcode;
- }
- }
- if (FXFT_Get_Face_Charmap(m_Font.m_Face)) {
- int index = GetGlyphIndex(unicode, pVertGlyph);
- if (index == 0) {
- return -1;
- }
- return index;
- }
- return unicode ;
- }
- if (m_Font.m_Face == NULL) {
- return -1;
- }
- FX_WORD cid = CIDFromCharCode(charcode);
- if (m_bType1) {
- if (NULL == m_pCIDToGIDMap) {
- return cid;
- }
- } else {
- if (m_pCIDToGIDMap == NULL) {
- if (m_pFontFile && m_pCMap->m_pMapping == NULL) {
- return cid;
- }
- if (m_pCMap->m_Coding == CIDCODING_UNKNOWN || FXFT_Get_Face_Charmap(m_Font.m_Face) == NULL) {
- return cid;
- }
- if (FXFT_Get_Charmap_Encoding(FXFT_Get_Face_Charmap(m_Font.m_Face)) == FXFT_ENCODING_UNICODE) {
- CFX_WideString unicode_str = UnicodeFromCharCode(charcode);
- if (unicode_str.IsEmpty()) {
- return -1;
- }
- charcode = unicode_str.GetAt(0);
- }
- return GetGlyphIndex(charcode, pVertGlyph);
- }
- }
- FX_DWORD byte_pos = cid * 2;
- if (byte_pos + 2 > m_pCIDToGIDMap->GetSize()) {
- return -1;
- }
- FX_LPCBYTE pdata = m_pCIDToGIDMap->GetData() + byte_pos;
- return pdata[0] * 256 + pdata[1];
-}
-FX_DWORD CPDF_CIDFont::GetNextChar(FX_LPCSTR pString, int& offset) const
-{
- return m_pCMap->GetNextChar(pString, offset);
-}
-int CPDF_CIDFont::GetCharSize(FX_DWORD charcode) const
-{
- return m_pCMap->GetCharSize(charcode);
-}
-int CPDF_CIDFont::CountChar(FX_LPCSTR pString, int size) const
-{
- return m_pCMap->CountChar(pString, size);
-}
-int CPDF_CIDFont::AppendChar(FX_LPSTR str, FX_DWORD charcode) const
-{
- return m_pCMap->AppendChar(str, charcode);
-}
-FX_BOOL CPDF_CIDFont::IsUnicodeCompatible() const
-{
- if (!m_pCMap->IsLoaded() || m_pCID2UnicodeMap == NULL || !m_pCID2UnicodeMap->IsLoaded()) {
- return m_pCMap->m_Coding != CIDCODING_UNKNOWN;
- }
- return TRUE;
-}
-FX_BOOL CPDF_CIDFont::IsFontStyleFromCharCode(FX_DWORD charcode) const
-{
- return TRUE;
-}
-void CPDF_CIDFont::LoadSubstFont()
-{
- m_Font.LoadSubst(m_BaseFont, !m_bType1, m_Flags, m_StemV * 5, m_ItalicAngle, g_CharsetCPs[m_Charset], IsVertWriting());
-}
-void CPDF_CIDFont::LoadMetricsArray(CPDF_Array* pArray, CFX_DWordArray& result, int nElements)
-{
- int width_status = 0;
- int iCurElement = 0;
- int first_code = 0, last_code;
- FX_DWORD count = pArray->GetCount();
- for (FX_DWORD i = 0; i < count; i ++) {
- CPDF_Object* pObj = pArray->GetElementValue(i);
- if (pObj == NULL) {
- continue;
- }
- if (pObj->GetType() == PDFOBJ_ARRAY) {
- if (width_status != 1) {
- return;
- }
- CPDF_Array* pArray = (CPDF_Array*)pObj;
- FX_DWORD count = pArray->GetCount();
- for (FX_DWORD j = 0; j < count; j += nElements) {
- result.Add(first_code);
- result.Add(first_code);
- for (int k = 0; k < nElements; k ++) {
- result.Add(pArray->GetInteger(j + k));
- }
- first_code ++;
- }
- width_status = 0;
- } else {
- if (width_status == 0) {
- first_code = pObj->GetInteger();
- width_status = 1;
- } else if (width_status == 1) {
- last_code = pObj->GetInteger();
- width_status = 2;
- iCurElement = 0;
- } else {
- if (!iCurElement) {
- result.Add(first_code);
- result.Add(last_code);
- }
- result.Add(pObj->GetInteger());
- iCurElement ++;
- if (iCurElement == nElements) {
- width_status = 0;
- }
- }
- }
- }
-}
-FX_BOOL CPDF_CIDFont::LoadGB2312()
-{
- m_BaseFont = m_pFontDict->GetString(FX_BSTRC("BaseFont"));
- CPDF_Dictionary* pFontDesc = m_pFontDict->GetDict(FX_BSTRC("FontDescriptor"));
- if (pFontDesc) {
- LoadFontDescriptor(pFontDesc);
- }
- m_Charset = CIDSET_GB1;
- m_bType1 = FALSE;
- m_pCMap = CPDF_ModuleMgr::Get()->GetPageModule()->GetFontGlobals()->m_CMapManager.GetPredefinedCMap(
- FX_BSTRC("GBK-EUC-H"), FALSE);
- m_pCID2UnicodeMap = CPDF_ModuleMgr::Get()->GetPageModule()->GetFontGlobals()->m_CMapManager.GetCID2UnicodeMap(m_Charset, FALSE);
- if (!IsEmbedded()) {
- LoadSubstFont();
- }
- CheckFontMetrics();
- m_DefaultWidth = 1000;
- m_pAnsiWidths = FX_Alloc(FX_WORD, 128);
- FXSYS_memset32(m_pAnsiWidths, 0, 128 * sizeof(FX_WORD));
- for (int i = 32; i < 127; i ++) {
- m_pAnsiWidths[i] = 500;
- }
- return TRUE;
-}
-const struct _CIDTransform {
- FX_WORD CID;
- FX_BYTE a, b, c, d, e, f;
-}
-Japan1_VertCIDs[] = {
- {97, 129, 0, 0, 127, 55, 0},
- {7887, 127, 0, 0, 127, 76, 89},
- {7888, 127, 0, 0, 127, 79, 94},
- {7889, 0, 129, 127, 0, 17, 127},
- {7890, 0, 129, 127, 0, 17, 127},
- {7891, 0, 129, 127, 0, 17, 127},
- {7892, 0, 129, 127, 0, 17, 127},
- {7893, 0, 129, 127, 0, 17, 127},
- {7894, 0, 129, 127, 0, 17, 127},
- {7895, 0, 129, 127, 0, 17, 127},
- {7896, 0, 129, 127, 0, 17, 127},
- {7897, 0, 129, 127, 0, 17, 127},
- {7898, 0, 129, 127, 0, 17, 127},
- {7899, 0, 129, 127, 0, 17, 104},
- {7900, 0, 129, 127, 0, 17, 127},
- {7901, 0, 129, 127, 0, 17, 104},
- {7902, 0, 129, 127, 0, 17, 127},
- {7903, 0, 129, 127, 0, 17, 127},
- {7904, 0, 129, 127, 0, 17, 127},
- {7905, 0, 129, 127, 0, 17, 114},
- {7906, 0, 129, 127, 0, 17, 127},
- {7907, 0, 129, 127, 0, 17, 127},
- {7908, 0, 129, 127, 0, 17, 127},
- {7909, 0, 129, 127, 0, 17, 127},
- {7910, 0, 129, 127, 0, 17, 127},
- {7911, 0, 129, 127, 0, 17, 127},
- {7912, 0, 129, 127, 0, 17, 127},
- {7913, 0, 129, 127, 0, 17, 127},
- {7914, 0, 129, 127, 0, 17, 127},
- {7915, 0, 129, 127, 0, 17, 114},
- {7916, 0, 129, 127, 0, 17, 127},
- {7917, 0, 129, 127, 0, 17, 127},
- {7918, 127, 0, 0, 127, 18, 25},
- {7919, 127, 0, 0, 127, 18, 25},
- {7920, 127, 0, 0, 127, 18, 25},
- {7921, 127, 0, 0, 127, 18, 25},
- {7922, 127, 0, 0, 127, 18, 25},
- {7923, 127, 0, 0, 127, 18, 25},
- {7924, 127, 0, 0, 127, 18, 25},
- {7925, 127, 0, 0, 127, 18, 25},
- {7926, 127, 0, 0, 127, 18, 25},
- {7927, 127, 0, 0, 127, 18, 25},
- {7928, 127, 0, 0, 127, 18, 25},
- {7929, 127, 0, 0, 127, 18, 25},
- {7930, 127, 0, 0, 127, 18, 25},
- {7931, 127, 0, 0, 127, 18, 25},
- {7932, 127, 0, 0, 127, 18, 25},
- {7933, 127, 0, 0, 127, 18, 25},
- {7934, 127, 0, 0, 127, 18, 25},
- {7935, 127, 0, 0, 127, 18, 25},
- {7936, 127, 0, 0, 127, 18, 25},
- {7937, 127, 0, 0, 127, 18, 25},
- {7938, 127, 0, 0, 127, 18, 25},
- {7939, 127, 0, 0, 127, 18, 25},
- {8720, 0, 129, 127, 0, 19, 102},
- {8721, 0, 129, 127, 0, 13, 127},
- {8722, 0, 129, 127, 0, 19, 108},
- {8723, 0, 129, 127, 0, 19, 102},
- {8724, 0, 129, 127, 0, 19, 102},
- {8725, 0, 129, 127, 0, 19, 102},
- {8726, 0, 129, 127, 0, 19, 102},
- {8727, 0, 129, 127, 0, 19, 102},
- {8728, 0, 129, 127, 0, 19, 114},
- {8729, 0, 129, 127, 0, 19, 114},
- {8730, 0, 129, 127, 0, 38, 108},
- {8731, 0, 129, 127, 0, 13, 108},
- {8732, 0, 129, 127, 0, 19, 108},
- {8733, 0, 129, 127, 0, 19, 108},
- {8734, 0, 129, 127, 0, 19, 108},
- {8735, 0, 129, 127, 0, 19, 108},
- {8736, 0, 129, 127, 0, 19, 102},
- {8737, 0, 129, 127, 0, 19, 102},
- {8738, 0, 129, 127, 0, 19, 102},
- {8739, 0, 129, 127, 0, 19, 102},
- {8740, 0, 129, 127, 0, 19, 102},
- {8741, 0, 129, 127, 0, 19, 102},
- {8742, 0, 129, 127, 0, 19, 102},
- {8743, 0, 129, 127, 0, 19, 102},
- {8744, 0, 129, 127, 0, 19, 102},
- {8745, 0, 129, 127, 0, 19, 102},
- {8746, 0, 129, 127, 0, 19, 114},
- {8747, 0, 129, 127, 0, 19, 114},
- {8748, 0, 129, 127, 0, 19, 102},
- {8749, 0, 129, 127, 0, 19, 102},
- {8750, 0, 129, 127, 0, 19, 102},
- {8751, 0, 129, 127, 0, 19, 102},
- {8752, 0, 129, 127, 0, 19, 102},
- {8753, 0, 129, 127, 0, 19, 102},
- {8754, 0, 129, 127, 0, 19, 102},
- {8755, 0, 129, 127, 0, 19, 102},
- {8756, 0, 129, 127, 0, 19, 102},
- {8757, 0, 129, 127, 0, 19, 102},
- {8758, 0, 129, 127, 0, 19, 102},
- {8759, 0, 129, 127, 0, 19, 102},
- {8760, 0, 129, 127, 0, 19, 102},
- {8761, 0, 129, 127, 0, 19, 102},
- {8762, 0, 129, 127, 0, 19, 102},
- {8763, 0, 129, 127, 0, 19, 102},
- {8764, 0, 129, 127, 0, 19, 102},
- {8765, 0, 129, 127, 0, 19, 102},
- {8766, 0, 129, 127, 0, 19, 102},
- {8767, 0, 129, 127, 0, 19, 102},
- {8768, 0, 129, 127, 0, 19, 102},
- {8769, 0, 129, 127, 0, 19, 102},
- {8770, 0, 129, 127, 0, 19, 102},
- {8771, 0, 129, 127, 0, 19, 102},
- {8772, 0, 129, 127, 0, 19, 102},
- {8773, 0, 129, 127, 0, 19, 102},
- {8774, 0, 129, 127, 0, 19, 102},
- {8775, 0, 129, 127, 0, 19, 102},
- {8776, 0, 129, 127, 0, 19, 102},
- {8777, 0, 129, 127, 0, 19, 102},
- {8778, 0, 129, 127, 0, 19, 102},
- {8779, 0, 129, 127, 0, 19, 114},
- {8780, 0, 129, 127, 0, 19, 108},
- {8781, 0, 129, 127, 0, 19, 114},
- {8782, 0, 129, 127, 0, 13, 114},
- {8783, 0, 129, 127, 0, 19, 108},
- {8784, 0, 129, 127, 0, 13, 114},
- {8785, 0, 129, 127, 0, 19, 108},
- {8786, 0, 129, 127, 0, 19, 108},
- {8787, 0, 129, 127, 0, 19, 108},
- {8788, 0, 129, 127, 0, 19, 108},
- {8789, 0, 129, 127, 0, 19, 108},
- {8790, 0, 129, 127, 0, 19, 108},
- {8791, 0, 129, 127, 0, 19, 108},
- {8792, 0, 129, 127, 0, 19, 108},
- {8793, 0, 129, 127, 0, 19, 108},
- {8794, 0, 129, 127, 0, 19, 108},
- {8795, 0, 129, 127, 0, 19, 108},
- {8796, 0, 129, 127, 0, 19, 108},
- {8797, 0, 129, 127, 0, 19, 108},
- {8798, 0, 129, 127, 0, 19, 108},
- {8799, 0, 129, 127, 0, 19, 108},
- {8800, 0, 129, 127, 0, 19, 108},
- {8801, 0, 129, 127, 0, 19, 108},
- {8802, 0, 129, 127, 0, 19, 108},
- {8803, 0, 129, 127, 0, 19, 108},
- {8804, 0, 129, 127, 0, 19, 108},
- {8805, 0, 129, 127, 0, 19, 108},
- {8806, 0, 129, 127, 0, 19, 108},
- {8807, 0, 129, 127, 0, 19, 108},
- {8808, 0, 129, 127, 0, 19, 108},
- {8809, 0, 129, 127, 0, 19, 108},
- {8810, 0, 129, 127, 0, 19, 108},
- {8811, 0, 129, 127, 0, 19, 114},
- {8812, 0, 129, 127, 0, 19, 102},
- {8813, 0, 129, 127, 0, 19, 114},
- {8814, 0, 129, 127, 0, 76, 102},
- {8815, 0, 129, 127, 0, 13, 121},
- {8816, 0, 129, 127, 0, 19, 114},
- {8817, 0, 129, 127, 0, 19, 127},
- {8818, 0, 129, 127, 0, 19, 114},
- {8819, 0, 129, 127, 0, 218, 108},
-};
-FX_LPCBYTE CPDF_CIDFont::GetCIDTransform(FX_WORD CID) const
-{
- if (m_Charset != CIDSET_JAPAN1 || m_pFontFile != NULL) {
- return NULL;
- }
- int begin = 0;
- int end = sizeof Japan1_VertCIDs / sizeof(struct _CIDTransform) - 1;
- while (begin <= end) {
- int middle = (begin + end) / 2;
- FX_WORD middlecode = Japan1_VertCIDs[middle].CID;
- if (middlecode > CID) {
- end = middle - 1;
- } else if (middlecode < CID) {
- begin = middle + 1;
- } else {
- return &Japan1_VertCIDs[middle].a;
- }
- }
- return NULL;
-}
+// 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
+
+#include "../../../include/fpdfapi/fpdf_module.h"
+#include "../../../include/fpdfapi/fpdf_page.h"
+#include "font_int.h"
+#include "../fpdf_cmaps/cmap_int.h"
+#include "../../../include/fxge/fx_ge.h"
+#include "../../../include/fxge/fx_freetype.h"
+extern FX_DWORD FT_CharCodeFromUnicode(int encoding, FX_WCHAR unicode);
+extern FX_LPVOID FXFC_LoadPackage(FX_LPCSTR name);
+extern FX_BOOL FXFC_LoadFile(FX_LPVOID pPackage, FX_LPCSTR name, FX_LPBYTE& pBuffer, FX_DWORD& size);
+extern void FXFC_ClosePackage(FX_LPVOID pPackage);
+extern short TT2PDF(int m, FXFT_Face face);
+extern FX_BOOL FT_UseTTCharmap(FXFT_Face face, int platform_id, int encoding_id);
+extern FX_LPCSTR GetAdobeCharName(int iBaseEncoding, const CFX_ByteString* pCharNames, int charcode);
+CPDF_CMapManager::CPDF_CMapManager()
+{
+#ifndef _FPDFAPI_MINI_
+ m_bPrompted = FALSE;
+ m_pPackage = NULL;
+#endif
+ FXSYS_memset32(m_CID2UnicodeMaps, 0, sizeof m_CID2UnicodeMaps);
+}
+CPDF_CMapManager::~CPDF_CMapManager()
+{
+ DropAll(FALSE);
+#ifndef _FPDFAPI_MINI_
+ if (m_pPackage) {
+ FXFC_ClosePackage(m_pPackage);
+ }
+#endif
+}
+#ifndef _FPDFAPI_MINI_
+FX_LPVOID CPDF_CMapManager::GetPackage(FX_BOOL bPrompt)
+{
+#ifndef FOXIT_CHROME_BUILD
+ if (m_pPackage == NULL) {
+ CFX_ByteString filename = CPDF_ModuleMgr::Get()->GetModuleFilePath(ADDIN_NAME_CJK, "FPDFCJK.BIN");
+ m_pPackage = FXFC_LoadPackage(filename);
+ if (bPrompt && m_pPackage == NULL && !m_bPrompted) {
+ m_bPrompted = TRUE;
+ if (!CPDF_ModuleMgr::Get()->DownloadModule(ADDIN_NAME_CJK)) {
+ return NULL;
+ }
+ m_pPackage = FXFC_LoadPackage(filename);
+ }
+ }
+#endif
+ return m_pPackage;
+}
+#endif
+CPDF_CMap* CPDF_CMapManager::GetPredefinedCMap(const CFX_ByteString& name, FX_BOOL bPromptCJK)
+{
+ CPDF_CMap* pCMap;
+ if (m_CMaps.Lookup(name, (FX_LPVOID&)pCMap)) {
+ return pCMap;
+ }
+ pCMap = LoadPredefinedCMap(name, bPromptCJK);
+ if (name.IsEmpty()) {
+ return pCMap;
+ }
+ m_CMaps.SetAt(name, pCMap);
+ return pCMap;
+}
+CPDF_CMap* CPDF_CMapManager::LoadPredefinedCMap(const CFX_ByteString& name, FX_BOOL bPromptCJK)
+{
+ CPDF_CMap* pCMap = FX_NEW CPDF_CMap;
+ FX_LPCSTR pname = name;
+ if (*pname == '/') {
+ pname ++;
+ }
+ pCMap->LoadPredefined(this, pname, bPromptCJK);
+ return pCMap;
+}
+const FX_LPCSTR g_CharsetNames[] = {NULL, "GB1", "CNS1", "Japan1", "Korea1", "UCS", NULL};
+const int g_CharsetCPs[] = {0, 936, 950, 932, 949, 1200, 0};
+int _CharsetFromOrdering(const CFX_ByteString& Ordering)
+{
+ int charset = 1;
+ while (g_CharsetNames[charset] && Ordering != CFX_ByteStringC(g_CharsetNames[charset])) {
+ charset ++;
+ }
+ if (g_CharsetNames[charset] == NULL) {
+ return CIDSET_UNKNOWN;
+ }
+ return charset;
+}
+void CPDF_CMapManager::ReloadAll()
+{
+ DropAll(TRUE);
+}
+void CPDF_CMapManager::DropAll(FX_BOOL bReload)
+{
+ FX_POSITION pos = m_CMaps.GetStartPosition();
+ while (pos) {
+ CFX_ByteString name;
+ CPDF_CMap* pCMap;
+ m_CMaps.GetNextAssoc(pos, name, (FX_LPVOID&)pCMap);
+ if (pCMap == NULL) {
+ continue;
+ }
+ if (bReload) {
+ pCMap->LoadPredefined(this, name, FALSE);
+ } else {
+ delete pCMap;
+ }
+ }
+ for (int i = 0; i < sizeof m_CID2UnicodeMaps / sizeof(CPDF_CID2UnicodeMap*); i ++) {
+ CPDF_CID2UnicodeMap* pMap = m_CID2UnicodeMaps[i];
+ if (pMap == NULL) {
+ continue;
+ }
+ if (bReload) {
+ pMap->Load(this, i, FALSE);
+ } else {
+ delete pMap;
+ }
+ }
+}
+CPDF_CID2UnicodeMap* CPDF_CMapManager::GetCID2UnicodeMap(int charset, FX_BOOL bPromptCJK)
+{
+ if (m_CID2UnicodeMaps[charset] == NULL) {
+ m_CID2UnicodeMaps[charset] = LoadCID2UnicodeMap(charset, bPromptCJK);
+ }
+ return m_CID2UnicodeMaps[charset];
+}
+CPDF_CID2UnicodeMap* CPDF_CMapManager::LoadCID2UnicodeMap(int charset, FX_BOOL bPromptCJK)
+{
+ CPDF_CID2UnicodeMap* pMap = FX_NEW CPDF_CID2UnicodeMap();
+ if (!pMap->Initialize()) {
+ delete pMap;
+ return NULL;
+ }
+ pMap->Load(this, charset, bPromptCJK);
+ return pMap;
+}
+CPDF_CMapParser::CPDF_CMapParser()
+{
+ m_pCMap = NULL;
+ m_Status = 0;
+ m_CodeSeq = 0;
+}
+FX_BOOL CPDF_CMapParser::Initialize(CPDF_CMap* pCMap)
+{
+ m_pCMap = pCMap;
+ m_Status = 0;
+ m_CodeSeq = 0;
+ m_AddMaps.EstimateSize(0, 10240);
+ return TRUE;
+}
+static FX_DWORD CMap_GetCode(FX_BSTR word)
+{
+ int num = 0;
+ if (word.GetAt(0) == '<') {
+ for (int i = 1; i < word.GetLength(); i ++) {
+ FX_BYTE digit = word.GetAt(i);
+ if (digit >= '0' && digit <= '9') {
+ digit = digit - '0';
+ } else if (digit >= 'a' && digit <= 'f') {
+ digit = digit - 'a' + 10;
+ } else if (digit >= 'A' && digit <= 'F') {
+ digit = digit - 'A' + 10;
+ } else {
+ return num;
+ }
+ num = num * 16 + digit;
+ }
+ } else {
+ for (int i = 0; i < word.GetLength(); i ++) {
+ if (word.GetAt(i) < '0' || word.GetAt(i) > '9') {
+ return num;
+ }
+ num = num * 10 + word.GetAt(i) - '0';
+ }
+ }
+ return num;
+}
+static FX_BOOL _CMap_GetCodeRange(_CMap_CodeRange& range, FX_BSTR first, FX_BSTR second)
+{
+ if (first.GetLength() == 0 || first.GetAt(0) != '<') {
+ return FALSE;
+ }
+ int num = 0;
+ int i;
+ for (i = 1; i < first.GetLength(); i ++)
+ if (first.GetAt(i) == '>') {
+ break;
+ }
+ range.m_CharSize = (i - 1) / 2;
+ if (range.m_CharSize > 4) {
+ return FALSE;
+ }
+ for (i = 0; i < range.m_CharSize; i ++) {
+ FX_BYTE digit1 = first.GetAt(i * 2 + 1);
+ FX_BYTE digit2 = first.GetAt(i * 2 + 2);
+ FX_BYTE byte = (digit1 >= '0' && digit1 <= '9') ? (digit1 - '0') : ((digit1 & 0xdf) - 'A' + 10);
+ byte = byte * 16 + ((digit2 >= '0' && digit2 <= '9') ? (digit2 - '0') : ((digit2 & 0xdf) - 'A' + 10));
+ range.m_Lower[i] = byte;
+ }
+ FX_DWORD size = second.GetLength();
+ for (i = 0; i < range.m_CharSize; i ++) {
+ FX_BYTE digit1 = ((FX_DWORD)i * 2 + 1 < size) ? second.GetAt((FX_STRSIZE)i * 2 + 1) : 0;
+ FX_BYTE digit2 = ((FX_DWORD)i * 2 + 2 < size) ? second.GetAt((FX_STRSIZE)i * 2 + 2) : 0;
+ FX_BYTE byte = (digit1 >= '0' && digit1 <= '9') ? (digit1 - '0') : ((digit1 & 0xdf) - 'A' + 10);
+ byte = byte * 16 + ((digit2 >= '0' && digit2 <= '9') ? (digit2 - '0') : ((digit2 & 0xdf) - 'A' + 10));
+ range.m_Upper[i] = byte;
+ }
+ return TRUE;
+}
+static CFX_ByteString CMap_GetString(FX_BSTR word)
+{
+ return word.Mid(1, word.GetLength() - 2);
+}
+void CPDF_CMapParser::ParseWord(FX_BSTR word)
+{
+ if (word.IsEmpty()) {
+ return;
+ }
+ if (word == FX_BSTRC("begincidchar")) {
+ m_Status = 1;
+ m_CodeSeq = 0;
+ } else if (word == FX_BSTRC("begincidrange")) {
+ m_Status = 2;
+ m_CodeSeq = 0;
+ } else if (word == FX_BSTRC("endcidrange") || word == FX_BSTRC("endcidchar")) {
+ m_Status = 0;
+ } else if (word == FX_BSTRC("/WMode")) {
+ m_Status = 6;
+ } else if (word == FX_BSTRC("/Registry")) {
+ m_Status = 3;
+ } else if (word == FX_BSTRC("/Ordering")) {
+ m_Status = 4;
+ } else if (word == FX_BSTRC("/Supplement")) {
+ m_Status = 5;
+ } else if (word == FX_BSTRC("begincodespacerange")) {
+ m_Status = 7;
+ m_CodeSeq = 0;
+ } else if (word == FX_BSTRC("usecmap")) {
+ } else if (m_Status == 1 || m_Status == 2) {
+ m_CodePoints[m_CodeSeq] = CMap_GetCode(word);
+ m_CodeSeq ++;
+ FX_DWORD StartCode, EndCode;
+ FX_WORD StartCID;
+ if (m_Status == 1) {
+ if (m_CodeSeq < 2) {
+ return;
+ }
+ EndCode = StartCode = m_CodePoints[0];
+ StartCID = (FX_WORD)m_CodePoints[1];
+ } else {
+ if (m_CodeSeq < 3) {
+ return;
+ }
+ StartCode = m_CodePoints[0];
+ EndCode = m_CodePoints[1];
+ StartCID = (FX_WORD)m_CodePoints[2];
+ }
+ if (EndCode < 0x10000) {
+ for (FX_DWORD code = StartCode; code <= EndCode; code ++) {
+ m_pCMap->m_pMapping[code] = (FX_WORD)(StartCID + code - StartCode);
+ }
+ } else {
+ FX_DWORD buf[2];
+ buf[0] = StartCode;
+ buf[1] = ((EndCode - StartCode) << 16) + StartCID;
+ m_AddMaps.AppendBlock(buf, sizeof buf);
+ }
+ m_CodeSeq = 0;
+ } else if (m_Status == 3) {
+ CMap_GetString(word);
+ m_Status = 0;
+ } else if (m_Status == 4) {
+ m_pCMap->m_Charset = _CharsetFromOrdering(CMap_GetString(word));
+ m_Status = 0;
+ } else if (m_Status == 5) {
+ CMap_GetCode(word);
+ m_Status = 0;
+ } else if (m_Status == 6) {
+ m_pCMap->m_bVertical = CMap_GetCode(word);
+ m_Status = 0;
+ } else if (m_Status == 7) {
+ if (word == FX_BSTRC("endcodespacerange")) {
+ int nSegs = m_CodeRanges.GetSize();
+ if (nSegs > 1) {
+ m_pCMap->m_CodingScheme = CPDF_CMap::MixedFourBytes;
+ m_pCMap->m_nCodeRanges = nSegs;
+ m_pCMap->m_pLeadingBytes = FX_Alloc(FX_BYTE, nSegs * sizeof(_CMap_CodeRange));
+ FXSYS_memcpy32(m_pCMap->m_pLeadingBytes, m_CodeRanges.GetData(), nSegs * sizeof(_CMap_CodeRange));
+ } else if (nSegs == 1) {
+ m_pCMap->m_CodingScheme = (m_CodeRanges[0].m_CharSize == 2) ? CPDF_CMap::TwoBytes : CPDF_CMap::OneByte;
+ }
+ m_Status = 0;
+ } else {
+ if (word.GetLength() == 0 || word.GetAt(0) != '<') {
+ return;
+ }
+ if (m_CodeSeq % 2) {
+ _CMap_CodeRange range;
+ if (_CMap_GetCodeRange(range, m_LastWord, word)) {
+ m_CodeRanges.Add(range);
+ }
+ }
+ m_CodeSeq ++;
+ }
+ }
+ m_LastWord = word;
+}
+CPDF_CMap::CPDF_CMap()
+{
+ m_Charset = CIDSET_UNKNOWN;
+ m_Coding = CIDCODING_UNKNOWN;
+ m_CodingScheme = TwoBytes;
+ m_bVertical = 0;
+ m_bLoaded = FALSE;
+ m_pMapping = NULL;
+ m_pLeadingBytes = NULL;
+ m_pAddMapping = NULL;
+ m_pEmbedMap = NULL;
+ m_pUseMap = NULL;
+ m_nCodeRanges = 0;
+}
+CPDF_CMap::~CPDF_CMap()
+{
+ if (m_pMapping) {
+ FX_Free(m_pMapping);
+ }
+ if (m_pAddMapping) {
+ FX_Free(m_pAddMapping);
+ }
+ if (m_pLeadingBytes) {
+ FX_Free(m_pLeadingBytes);
+ }
+ if (m_pUseMap) {
+ delete m_pUseMap;
+ }
+}
+void CPDF_CMap::Release()
+{
+ if (m_PredefinedCMap.IsEmpty()) {
+ delete this;
+ }
+}
+const CPDF_PredefinedCMap g_PredefinedCMaps[] = {
+ { "GB-EUC", CIDSET_GB1, CIDCODING_GB, CPDF_CMap::MixedTwoBytes, 1, {0xa1, 0xfe} },
+ { "GBpc-EUC", CIDSET_GB1, CIDCODING_GB, CPDF_CMap::MixedTwoBytes, 1, {0xa1, 0xfc} },
+ { "GBK-EUC", CIDSET_GB1, CIDCODING_GB, CPDF_CMap::MixedTwoBytes, 1, {0x81, 0xfe} },
+ { "GBKp-EUC", CIDSET_GB1, CIDCODING_GB, CPDF_CMap::MixedTwoBytes, 1, {0x81, 0xfe} },
+ { "GBK2K-EUC", CIDSET_GB1, CIDCODING_GB, CPDF_CMap::MixedTwoBytes, 1, {0x81, 0xfe} },
+ { "GBK2K", CIDSET_GB1, CIDCODING_GB, CPDF_CMap::MixedTwoBytes, 1, {0x81, 0xfe} },
+ { "UniGB-UCS2", CIDSET_GB1, CIDCODING_UCS2, CPDF_CMap::TwoBytes },
+ { "UniGB-UTF16", CIDSET_GB1, CIDCODING_UTF16, CPDF_CMap::TwoBytes },
+ { "B5pc", CIDSET_CNS1, CIDCODING_BIG5, CPDF_CMap::MixedTwoBytes, 1, {0xa1, 0xfc} },
+ { "HKscs-B5", CIDSET_CNS1, CIDCODING_BIG5, CPDF_CMap::MixedTwoBytes, 1, {0x88, 0xfe} },
+ { "ETen-B5", CIDSET_CNS1, CIDCODING_BIG5, CPDF_CMap::MixedTwoBytes, 1, {0xa1, 0xfe} },
+ { "ETenms-B5", CIDSET_CNS1, CIDCODING_BIG5, CPDF_CMap::MixedTwoBytes, 1, {0xa1, 0xfe} },
+ { "UniCNS-UCS2", CIDSET_CNS1, CIDCODING_UCS2, CPDF_CMap::TwoBytes },
+ { "UniCNS-UTF16", CIDSET_CNS1, CIDCODING_UTF16, CPDF_CMap::TwoBytes },
+ { "83pv-RKSJ", CIDSET_JAPAN1, CIDCODING_JIS, CPDF_CMap::MixedTwoBytes, 2, {0x81, 0x9f, 0xe0, 0xfc} },
+ { "90ms-RKSJ", CIDSET_JAPAN1, CIDCODING_JIS, CPDF_CMap::MixedTwoBytes, 2, {0x81, 0x9f, 0xe0, 0xfc} },
+ { "90msp-RKSJ", CIDSET_JAPAN1, CIDCODING_JIS, CPDF_CMap::MixedTwoBytes, 2, {0x81, 0x9f, 0xe0, 0xfc} },
+ { "90pv-RKSJ", CIDSET_JAPAN1, CIDCODING_JIS, CPDF_CMap::MixedTwoBytes, 2, {0x81, 0x9f, 0xe0, 0xfc} },
+ { "Add-RKSJ", CIDSET_JAPAN1, CIDCODING_JIS, CPDF_CMap::MixedTwoBytes, 2, {0x81, 0x9f, 0xe0, 0xfc} },
+ { "EUC", CIDSET_JAPAN1, CIDCODING_JIS, CPDF_CMap::MixedTwoBytes, 2, {0x8e, 0x8e, 0xa1, 0xfe} },
+ { "H", CIDSET_JAPAN1, CIDCODING_JIS, CPDF_CMap::TwoBytes, 1, {0x21, 0x7e} },
+ { "V", CIDSET_JAPAN1, CIDCODING_JIS, CPDF_CMap::TwoBytes, 1, {0x21, 0x7e} },
+ { "Ext-RKSJ", CIDSET_JAPAN1, CIDCODING_JIS, CPDF_CMap::MixedTwoBytes, 2, {0x81, 0x9f, 0xe0, 0xfc} },
+ { "UniJIS-UCS2", CIDSET_JAPAN1, CIDCODING_UCS2, CPDF_CMap::TwoBytes },
+ { "UniJIS-UCS2-HW", CIDSET_JAPAN1, CIDCODING_UCS2, CPDF_CMap::TwoBytes },
+ { "UniJIS-UTF16", CIDSET_JAPAN1, CIDCODING_UTF16, CPDF_CMap::TwoBytes },
+ { "KSC-EUC", CIDSET_KOREA1, CIDCODING_KOREA, CPDF_CMap::MixedTwoBytes, 1, {0xa1, 0xfe} },
+ { "KSCms-UHC", CIDSET_KOREA1, CIDCODING_KOREA, CPDF_CMap::MixedTwoBytes, 1, {0x81, 0xfe} },
+ { "KSCms-UHC-HW", CIDSET_KOREA1, CIDCODING_KOREA, CPDF_CMap::MixedTwoBytes, 1, {0x81, 0xfe} },
+ { "KSCpc-EUC", CIDSET_KOREA1, CIDCODING_KOREA, CPDF_CMap::MixedTwoBytes, 1, {0xa1, 0xfd} },
+ { "UniKS-UCS2", CIDSET_KOREA1, CIDCODING_UCS2, CPDF_CMap::TwoBytes },
+ { "UniKS-UTF16", CIDSET_KOREA1, CIDCODING_UTF16, CPDF_CMap::TwoBytes },
+ { NULL, 0, 0 }
+};
+extern void FPDFAPI_FindEmbeddedCMap(const char* name, int charset, int coding, const FXCMAP_CMap*& pMap);
+extern FX_WORD FPDFAPI_CIDFromCharCode(const FXCMAP_CMap* pMap, FX_DWORD charcode);
+FX_BOOL CPDF_CMap::LoadPredefined(CPDF_CMapManager* pMgr, FX_LPCSTR pName, FX_BOOL bPromptCJK)
+{
+ m_PredefinedCMap = pName;
+ if (m_PredefinedCMap == FX_BSTRC("Identity-H") || m_PredefinedCMap == FX_BSTRC("Identity-V")) {
+ m_Coding = CIDCODING_CID;
+ m_bVertical = pName[9] == 'V';
+ m_bLoaded = TRUE;
+ return TRUE;
+ }
+ CFX_ByteString cmapid = m_PredefinedCMap;
+ m_bVertical = cmapid.Right(1) == FX_BSTRC("V");
+ if (cmapid.GetLength() > 2) {
+ cmapid = cmapid.Left(cmapid.GetLength() - 2);
+ }
+ int index = 0;
+ while (1) {
+ if (g_PredefinedCMaps[index].m_pName == NULL) {
+ return FALSE;
+ }
+ if (cmapid == CFX_ByteStringC(g_PredefinedCMaps[index].m_pName)) {
+ break;
+ }
+ index ++;
+ }
+ const CPDF_PredefinedCMap& map = g_PredefinedCMaps[index];
+ m_Charset = map.m_Charset;
+ m_Coding = map.m_Coding;
+ m_CodingScheme = map.m_CodingScheme;
+ if (m_CodingScheme == MixedTwoBytes) {
+ m_pLeadingBytes = FX_Alloc(FX_BYTE, 256);
+ FXSYS_memset32(m_pLeadingBytes, 0, 256);
+ for (FX_DWORD i = 0; i < map.m_LeadingSegCount; i ++) {
+ for (int b = map.m_LeadingSegs[i * 2]; b <= map.m_LeadingSegs[i * 2 + 1]; b ++) {
+ m_pLeadingBytes[b] = 1;
+ }
+ }
+ }
+ FPDFAPI_FindEmbeddedCMap(pName, m_Charset, m_Coding, m_pEmbedMap);
+ if (m_pEmbedMap) {
+ m_bLoaded = TRUE;
+ return TRUE;
+ }
+#ifndef _FPDFAPI_MINI_
+ FX_LPVOID pPackage = pMgr->GetPackage(bPromptCJK);
+ FX_LPBYTE pBuffer;
+ FX_DWORD size;
+ if (pPackage == NULL || !FXFC_LoadFile(pPackage, m_PredefinedCMap, pBuffer, size)) {
+ return FALSE;
+ }
+ m_pMapping = FX_Alloc(FX_WORD, 65536);
+ FXSYS_memset32(m_pMapping, 0, 65536 * sizeof(FX_WORD));
+ FX_DWORD dwRecodeEndPos = 0;
+ if (pBuffer[5] == 0) {
+ FX_DWORD dwStartIndex = *(FX_DWORD*)(pBuffer + 8);
+ FX_DWORD dwRecordCount = *(FX_DWORD*)(pBuffer + 16);
+ FX_DWORD dwDataOffset = *(FX_DWORD*)(pBuffer + 20);
+ if (dwRecordCount * 2 + dwStartIndex * 2 < 65536) {
+ FXSYS_memcpy32(m_pMapping + dwStartIndex * 2, pBuffer + dwDataOffset, dwRecordCount * 2);
+ }
+ dwRecodeEndPos = dwDataOffset + dwRecordCount * 2;
+ } else if (pBuffer[5] == 2) {
+ FX_DWORD nSegments = *(FX_DWORD*)(pBuffer + 16);
+ FX_DWORD dwDataOffset = *(FX_DWORD*)(pBuffer + 20);
+ dwRecodeEndPos = dwDataOffset + 6 * nSegments;
+ for (FX_DWORD i = 0; i < nSegments; i ++) {
+ FX_LPBYTE pRecord = pBuffer + dwDataOffset + i * 6;
+ FX_WORD IndexStart = *(FX_WORD*)pRecord;
+ FX_WORD IndexCount = *(FX_WORD*)(pRecord + 2);
+ FX_WORD CodeStart = *(FX_WORD*)(pRecord + 4);
+ if (IndexStart + IndexCount < 65536)
+ for (FX_DWORD j = 0; j < IndexCount; j ++) {
+ m_pMapping[IndexStart + j ] = (FX_WORD)(CodeStart + j);
+ }
+ }
+ }
+ if (dwRecodeEndPos < size) {
+ FX_DWORD dwMapLen = *(FX_DWORD*)(pBuffer + dwRecodeEndPos);
+ if (dwMapLen) {
+ m_pUseMap = FX_NEW CPDF_CMap;
+ CFX_ByteString bsName(pBuffer + dwRecodeEndPos + 4 , dwMapLen);
+ if (m_pUseMap) {
+ m_pUseMap->LoadPredefined(pMgr, bsName, bPromptCJK);
+ }
+ }
+ }
+ FX_Free(pBuffer);
+ m_bLoaded = TRUE;
+#endif
+ return TRUE;
+}
+extern "C" {
+ static int compare_dword(const void* data1, const void* data2)
+ {
+ return (*(FX_DWORD*)data1) - (*(FX_DWORD*)data2);
+ }
+};
+FX_BOOL CPDF_CMap::LoadEmbedded(FX_LPCBYTE pData, FX_DWORD size)
+{
+ m_pMapping = FX_Alloc(FX_WORD, 65536);
+ FXSYS_memset32(m_pMapping, 0, 65536 * sizeof(FX_WORD));
+ CPDF_CMapParser parser;
+ parser.Initialize(this);
+ CPDF_SimpleParser syntax(pData, size);
+ while (1) {
+ CFX_ByteStringC word = syntax.GetWord();
+ if (word.IsEmpty()) {
+ break;
+ }
+ parser.ParseWord(word);
+ }
+ if (m_CodingScheme == MixedFourBytes && parser.m_AddMaps.GetSize()) {
+ m_pAddMapping = FX_Alloc(FX_BYTE, parser.m_AddMaps.GetSize() + 4);
+ *(FX_DWORD*)m_pAddMapping = parser.m_AddMaps.GetSize() / 8;
+ FXSYS_memcpy32(m_pAddMapping + 4, parser.m_AddMaps.GetBuffer(), parser.m_AddMaps.GetSize());
+ FXSYS_qsort(m_pAddMapping + 4, parser.m_AddMaps.GetSize() / 8, 8, compare_dword);
+ }
+ return TRUE;
+}
+extern "C" {
+ static int compareCID(const void* key, const void* element)
+ {
+ if ((*(FX_DWORD*)key) < (*(FX_DWORD*)element)) {
+ return -1;
+ }
+ if ((*(FX_DWORD*)key) > (*(FX_DWORD*)element) + ((FX_DWORD*)element)[1] / 65536) {
+ return 1;
+ }
+ return 0;
+ }
+};
+FX_WORD CPDF_CMap::CIDFromCharCode(FX_DWORD charcode) const
+{
+ if (m_Coding == CIDCODING_CID) {
+ return (FX_WORD)charcode;
+ }
+ if (m_pEmbedMap) {
+ return FPDFAPI_CIDFromCharCode(m_pEmbedMap, charcode);
+ }
+ if (m_pMapping == NULL) {
+ return (FX_WORD)charcode;
+ }
+ if (charcode >> 16) {
+ if (m_pAddMapping) {
+ void* found = FXSYS_bsearch(&charcode, m_pAddMapping + 4, *(FX_DWORD*)m_pAddMapping, 8, compareCID);
+ if (found == NULL) {
+ if (m_pUseMap) {
+ return m_pUseMap->CIDFromCharCode(charcode);
+ }
+ return 0;
+ }
+ return (FX_WORD)(((FX_DWORD*)found)[1] % 65536 + charcode - * (FX_DWORD*)found);
+ }
+ if (m_pUseMap) {
+ return m_pUseMap->CIDFromCharCode(charcode);
+ }
+ return 0;
+ }
+ FX_DWORD CID = m_pMapping[charcode];
+ if (!CID && m_pUseMap) {
+ return m_pUseMap->CIDFromCharCode(charcode);
+ }
+ return (FX_WORD)CID;
+}
+static int _CheckCodeRange(FX_LPBYTE codes, int size, _CMap_CodeRange* pRanges, int nRanges)
+{
+ int iSeg = nRanges - 1;
+ while (iSeg >= 0) {
+ if (pRanges[iSeg].m_CharSize < size) {
+ iSeg --;
+ continue;
+ }
+ int iChar = 0;
+ while (iChar < size) {
+ if (codes[iChar] < pRanges[iSeg].m_Lower[iChar] ||
+ codes[iChar] > pRanges[iSeg].m_Upper[iChar]) {
+ break;
+ }
+ iChar ++;
+ }
+ if (iChar == pRanges[iSeg].m_CharSize) {
+ return 2;
+ }
+ if (iChar) {
+ if (size == pRanges[iSeg].m_CharSize) {
+ return 2;
+ }
+ return 1;
+ }
+ iSeg --;
+ }
+ return 0;
+}
+FX_DWORD CPDF_CMap::GetNextChar(FX_LPCSTR pString, int& offset) const
+{
+ switch (m_CodingScheme) {
+ case OneByte:
+ return ((FX_LPBYTE)pString)[offset++];
+ case TwoBytes:
+ offset += 2;
+ return ((FX_LPBYTE)pString)[offset - 2] * 256 + ((FX_LPBYTE)pString)[offset - 1];
+ case MixedTwoBytes: {
+ FX_BYTE byte1 = ((FX_LPBYTE)pString)[offset++];
+ if (!m_pLeadingBytes[byte1]) {
+ return byte1;
+ }
+ FX_BYTE byte2 = ((FX_LPBYTE)pString)[offset++];
+ return byte1 * 256 + byte2;
+ }
+ case MixedFourBytes: {
+ FX_BYTE codes[4];
+ int char_size = 1;
+ codes[0] = ((FX_LPBYTE)pString)[offset++];
+ _CMap_CodeRange* pRanges = (_CMap_CodeRange*)m_pLeadingBytes;
+ while (1) {
+ int ret = _CheckCodeRange(codes, char_size, pRanges, m_nCodeRanges);
+ if (ret == 0) {
+ return 0;
+ }
+ if (ret == 2) {
+ FX_DWORD charcode = 0;
+ for (int i = 0; i < char_size; i ++) {
+ charcode = (charcode << 8) + codes[i];
+ }
+ return charcode;
+ }
+ if (char_size == 4) {
+ return 0;
+ }
+ codes[char_size ++] = ((FX_LPBYTE)pString)[offset++];
+ }
+ break;
+ }
+ }
+ return 0;
+}
+int CPDF_CMap::GetCharSize(FX_DWORD charcode) const
+{
+ switch (m_CodingScheme) {
+ case OneByte:
+ return 1;
+ case TwoBytes:
+ return 2;
+ case MixedTwoBytes:
+ case MixedFourBytes:
+ if (charcode < 0x100) {
+ return 1;
+ }
+ if (charcode < 0x10000) {
+ return 2;
+ }
+ if (charcode < 0x1000000) {
+ return 3;
+ }
+ return 4;
+ }
+ return 1;
+}
+int CPDF_CMap::CountChar(FX_LPCSTR pString, int size) const
+{
+ switch (m_CodingScheme) {
+ case OneByte:
+ return size;
+ case TwoBytes:
+ return (size + 1) / 2;
+ case MixedTwoBytes: {
+ int count = 0;
+ for (int i = 0; i < size; i ++) {
+ count ++;
+ if (m_pLeadingBytes[((FX_LPBYTE)pString)[i]]) {
+ i ++;
+ }
+ }
+ return count;
+ }
+ case MixedFourBytes: {
+ int count = 0, offset = 0;
+ while (offset < size) {
+ GetNextChar(pString, offset);
+ count ++;
+ }
+ return count;
+ }
+ }
+ return size;
+}
+int _GetCharSize(FX_DWORD charcode, _CMap_CodeRange* pRanges, int iRangesSize)
+{
+ if (!iRangesSize) {
+ return 1;
+ }
+ FX_BYTE codes[4];
+ codes[0] = codes[1] = 0x00;
+ codes[2] = (FX_BYTE)(charcode >> 8 & 0xFF);
+ codes[3] = (FX_BYTE)charcode;
+ int offset = 0, size = 4;
+ for (int i = 0; i < 4; ++i) {
+ int iSeg = iRangesSize - 1;
+ while (iSeg >= 0) {
+ if (pRanges[iSeg].m_CharSize < size) {
+ iSeg --;
+ continue;
+ }
+ int iChar = 0;
+ while (iChar < size) {
+ if (codes[offset + iChar] < pRanges[iSeg].m_Lower[iChar] ||
+ codes[offset + iChar] > pRanges[iSeg].m_Upper[iChar]) {
+ break;
+ }
+ iChar ++;
+ }
+ if (iChar == pRanges[iSeg].m_CharSize) {
+ return size;
+ }
+ iSeg --;
+ }
+ size --;
+ offset ++;
+ }
+ return 1;
+}
+int CPDF_CMap::AppendChar(FX_LPSTR str, FX_DWORD charcode) const
+{
+ switch (m_CodingScheme) {
+ case OneByte:
+ str[0] = (FX_BYTE)charcode;
+ return 1;
+ case TwoBytes:
+ str[0] = (FX_BYTE)(charcode / 256);
+ str[1] = (FX_BYTE)(charcode % 256);
+ return 2;
+ case MixedTwoBytes:
+ case MixedFourBytes:
+ if (charcode < 0x100) {
+ _CMap_CodeRange* pRanges = (_CMap_CodeRange*)m_pLeadingBytes;
+ int iSize = _GetCharSize(charcode, pRanges, m_nCodeRanges);
+ if (iSize == 0) {
+ iSize = 1;
+ }
+ if (iSize > 1) {
+ FXSYS_memset32(str, 0, sizeof(FX_BYTE) * iSize);
+ }
+ str[iSize - 1] = (FX_BYTE)charcode;
+ return iSize;
+ } else if (charcode < 0x10000) {
+ str[0] = (FX_BYTE)(charcode >> 8);
+ str[1] = (FX_BYTE)charcode;
+ return 2;
+ } else if (charcode < 0x1000000) {
+ str[0] = (FX_BYTE)(charcode >> 16);
+ str[1] = (FX_BYTE)(charcode >> 8);
+ str[2] = (FX_BYTE)charcode;
+ return 3;
+ } else {
+ str[0] = (FX_BYTE)(charcode >> 24);
+ str[1] = (FX_BYTE)(charcode >> 16);
+ str[2] = (FX_BYTE)(charcode >> 8);
+ str[3] = (FX_BYTE)charcode;
+ return 4;
+ }
+ }
+ return 0;
+}
+CPDF_CID2UnicodeMap::CPDF_CID2UnicodeMap()
+{
+ m_EmbeddedCount = 0;
+#ifndef _FPDFAPI_MINI_
+ m_pExternalMap = NULL;
+#endif
+}
+CPDF_CID2UnicodeMap::~CPDF_CID2UnicodeMap()
+{
+#ifndef _FPDFAPI_MINI_
+ if (m_pExternalMap) {
+ delete m_pExternalMap;
+ }
+#endif
+}
+FX_BOOL CPDF_CID2UnicodeMap::Initialize()
+{
+#ifndef _FPDFAPI_MINI_
+ m_pExternalMap = FX_NEW CPDF_FXMP;
+#endif
+ return TRUE;
+}
+FX_BOOL CPDF_CID2UnicodeMap::IsLoaded()
+{
+#ifdef _FPDFAPI_MINI_
+ return m_EmbeddedCount != 0;
+#else
+ return m_EmbeddedCount != 0 || (m_pExternalMap != NULL && m_pExternalMap->IsLoaded());
+#endif
+}
+FX_WCHAR CPDF_CID2UnicodeMap::UnicodeFromCID(FX_WORD CID)
+{
+ if (m_Charset == CIDSET_UNICODE) {
+ return CID;
+ }
+ if (CID < m_EmbeddedCount) {
+ return m_pEmbeddedMap[CID];
+ }
+#ifdef _FPDFAPI_MINI_
+ return 0;
+#else
+ FX_LPCBYTE record = m_pExternalMap->GetRecord(CID);
+ if (record == NULL) {
+ return 0;
+ }
+ return *(FX_WORD*)record;
+#endif
+}
+void FPDFAPI_LoadCID2UnicodeMap(int charset, const FX_WORD*& pMap, FX_DWORD& count);
+void CPDF_CID2UnicodeMap::Load(CPDF_CMapManager* pMgr, int charset, FX_BOOL bPromptCJK)
+{
+ m_Charset = charset;
+ FPDFAPI_LoadCID2UnicodeMap(charset, m_pEmbeddedMap, m_EmbeddedCount);
+ if (m_EmbeddedCount) {
+ return;
+ }
+#ifndef _FPDFAPI_MINI_
+ FX_LPVOID pPackage = pMgr->GetPackage(bPromptCJK);
+ if (pPackage == NULL) {
+ return;
+ }
+ m_pExternalMap->LoadFile(pPackage, FX_BSTRC("CIDInfo_") + g_CharsetNames[charset]);
+#endif
+}
+#include "ttgsubtable.h"
+CPDF_CIDFont::CPDF_CIDFont()
+{
+ m_pCMap = NULL;
+ m_pAllocatedCMap = NULL;
+ m_pCID2UnicodeMap = NULL;
+ m_pAnsiWidths = NULL;
+ m_pCIDToGIDMap = NULL;
+ m_bCIDIsGID = FALSE;
+ m_bAdobeCourierStd = FALSE;
+ m_pTTGSUBTable = NULL;
+ FXSYS_memset8(m_CharBBox, 0xff, 256 * sizeof(FX_SMALL_RECT));
+}
+CPDF_CIDFont::~CPDF_CIDFont()
+{
+ if (m_pAnsiWidths) {
+ FX_Free(m_pAnsiWidths);
+ }
+ if (m_pAllocatedCMap) {
+ delete m_pAllocatedCMap;
+ }
+ if (m_pCIDToGIDMap) {
+ delete m_pCIDToGIDMap;
+ }
+ if (m_pTTGSUBTable) {
+ delete m_pTTGSUBTable;
+ }
+}
+FX_WORD CPDF_CIDFont::CIDFromCharCode(FX_DWORD charcode) const
+{
+ if (m_pCMap == NULL) {
+ return (FX_WORD)charcode;
+ }
+ return m_pCMap->CIDFromCharCode(charcode);
+}
+FX_BOOL CPDF_CIDFont::IsVertWriting() const
+{
+ return m_pCMap ? m_pCMap->IsVertWriting() : FALSE;
+}
+extern FX_DWORD FPDFAPI_CharCodeFromCID(const FXCMAP_CMap* pMap, FX_WORD cid);
+static FX_DWORD _EmbeddedCharcodeFromUnicode(const FXCMAP_CMap* pEmbedMap, int charset, FX_WCHAR unicode)
+{
+ if (charset <= 0 || charset > 4) {
+ return 0;
+ }
+ CPDF_FontGlobals* pFontGlobals = CPDF_ModuleMgr::Get()->GetPageModule()->GetFontGlobals();
+ const FX_WORD* pCodes = pFontGlobals->m_EmbeddedToUnicodes[charset].m_pMap;
+ if (pCodes == NULL) {
+ return 0;
+ }
+ int nCodes = pFontGlobals->m_EmbeddedToUnicodes[charset].m_Count;
+ for (int i = 0; i < nCodes; i++) {
+ if (pCodes[i] == unicode) {
+ FX_DWORD CharCode = FPDFAPI_CharCodeFromCID(pEmbedMap, i);
+ if (CharCode == 0) {
+ continue;
+ }
+ return CharCode;
+ }
+ }
+ return 0;
+}
+static FX_WCHAR _EmbeddedUnicodeFromCharcode(const FXCMAP_CMap* pEmbedMap, int charset, FX_DWORD charcode)
+{
+ if (charset <= 0 || charset > 4) {
+ return 0;
+ }
+ FX_WORD cid = FPDFAPI_CIDFromCharCode(pEmbedMap, charcode);
+ if (cid == 0) {
+ return 0;
+ }
+ CPDF_FontGlobals* pFontGlobals = CPDF_ModuleMgr::Get()->GetPageModule()->GetFontGlobals();
+ const FX_WORD* pCodes = pFontGlobals->m_EmbeddedToUnicodes[charset].m_pMap;
+ if (pCodes == NULL) {
+ return 0;
+ }
+ if (cid < pFontGlobals->m_EmbeddedToUnicodes[charset].m_Count) {
+ return pCodes[cid];
+ }
+ return 0;
+}
+FX_WCHAR CPDF_CIDFont::_UnicodeFromCharCode(FX_DWORD charcode) const
+{
+ switch (m_pCMap->m_Coding) {
+ case CIDCODING_UCS2:
+ case CIDCODING_UTF16:
+ return (FX_WCHAR)charcode;
+ case CIDCODING_CID:
+ if (m_pCID2UnicodeMap == NULL || !m_pCID2UnicodeMap->IsLoaded()) {
+ return 0;
+ }
+ return m_pCID2UnicodeMap->UnicodeFromCID((FX_WORD)charcode);
+ }
+ if (!m_pCMap->IsLoaded() || m_pCID2UnicodeMap == NULL || !m_pCID2UnicodeMap->IsLoaded()) {
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
+ FX_WCHAR unicode;
+ int charsize = 1;
+ if (charcode > 255) {
+ charcode = (charcode % 256) * 256 + (charcode / 256);
+ charsize = 2;
+ }
+ int ret = FXSYS_MultiByteToWideChar(g_CharsetCPs[m_pCMap->m_Coding], 0, (FX_LPCSTR)&charcode, charsize, &unicode, 1);
+ if (ret != 1) {
+ return 0;
+ }
+ return unicode;
+#endif
+ if (m_pCMap->m_pEmbedMap) {
+ return _EmbeddedUnicodeFromCharcode(m_pCMap->m_pEmbedMap, m_pCMap->m_Charset, charcode);
+ } else {
+ return 0;
+ }
+ }
+ return m_pCID2UnicodeMap->UnicodeFromCID(CIDFromCharCode(charcode));
+}
+FX_DWORD CPDF_CIDFont::_CharCodeFromUnicode(FX_WCHAR unicode) const
+{
+ switch (m_pCMap->m_Coding) {
+ case CIDCODING_UNKNOWN:
+ return 0;
+ case CIDCODING_UCS2:
+ case CIDCODING_UTF16:
+ return unicode;
+ case CIDCODING_CID: {
+ if (m_pCID2UnicodeMap == NULL || !m_pCID2UnicodeMap->IsLoaded()) {
+ return 0;
+ }
+ FX_DWORD CID = 0;
+ while (CID < 65536) {
+ FX_WCHAR this_unicode = m_pCID2UnicodeMap->UnicodeFromCID((FX_WORD)CID);
+ if (this_unicode == unicode) {
+ return CID;
+ }
+ CID ++;
+ }
+ break;
+ }
+ }
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
+ FX_BYTE buffer[32];
+ int ret = FXSYS_WideCharToMultiByte(g_CharsetCPs[m_pCMap->m_Coding], 0, &unicode, 1, (char*)buffer, 4, NULL, NULL);
+ if (ret == 1) {
+ return buffer[0];
+ } else if (ret == 2) {
+ return buffer[0] * 256 + buffer[1];
+ }
+ return 0;
+#endif
+ if (unicode < 0x80) {
+ return (FX_DWORD)unicode;
+ } else {
+ if (m_pCMap->m_pEmbedMap) {
+ return _EmbeddedCharcodeFromUnicode(m_pCMap->m_pEmbedMap, m_pCMap->m_Charset, unicode);
+ } else {
+ return 0;
+ }
+ }
+}
+static void FT_UseCIDCharmap(FXFT_Face face, int coding)
+{
+ int encoding;
+ switch (coding) {
+ case CIDCODING_GB:
+ encoding = FXFT_ENCODING_GB2312;
+ break;
+ case CIDCODING_BIG5:
+ encoding = FXFT_ENCODING_BIG5;
+ break;
+ case CIDCODING_JIS:
+ encoding = FXFT_ENCODING_SJIS;
+ break;
+ case CIDCODING_KOREA:
+ encoding = FXFT_ENCODING_JOHAB;
+ break;
+ default:
+ encoding = FXFT_ENCODING_UNICODE;
+ }
+ int err = FXFT_Select_Charmap(face, encoding);
+ if (err) {
+ err = FXFT_Select_Charmap(face, FXFT_ENCODING_UNICODE);
+ }
+ if (err && FXFT_Get_Face_Charmaps(face)) {
+ FXFT_Set_Charmap(face, *FXFT_Get_Face_Charmaps(face));
+ }
+}
+FX_BOOL CPDF_CIDFont::_Load()
+{
+ if (m_pFontDict->GetString(FX_BSTRC("Subtype")) == FX_BSTRC("TrueType")) {
+ return LoadGB2312();
+ }
+ CPDF_Array* pFonts = m_pFontDict->GetArray(FX_BSTRC("DescendantFonts"));
+ if (pFonts == NULL) {
+ return FALSE;
+ }
+ if (pFonts->GetCount() != 1) {
+ return FALSE;
+ }
+ CPDF_Dictionary* pCIDFontDict = pFonts->GetDict(0);
+ if (pCIDFontDict == NULL) {
+ return FALSE;
+ }
+ m_BaseFont = pCIDFontDict->GetString(FX_BSTRC("BaseFont"));
+ if ((m_BaseFont.Compare("CourierStd") == 0 || m_BaseFont.Compare("CourierStd-Bold") == 0
+ || m_BaseFont.Compare("CourierStd-BoldOblique") == 0 || m_BaseFont.Compare("CourierStd-Oblique") == 0)
+ && !IsEmbedded()) {
+ m_bAdobeCourierStd = TRUE;
+ }
+ CPDF_Dictionary* pFontDesc = pCIDFontDict->GetDict(FX_BSTRC("FontDescriptor"));
+ if (pFontDesc) {
+ LoadFontDescriptor(pFontDesc);
+ }
+ CPDF_Object* pEncoding = m_pFontDict->GetElementValue(FX_BSTRC("Encoding"));
+ if (pEncoding == NULL) {
+ return FALSE;
+ }
+ CFX_ByteString subtype = pCIDFontDict->GetString(FX_BSTRC("Subtype"));
+ m_bType1 = FALSE;
+ if (subtype == FX_BSTRC("CIDFontType0")) {
+ m_bType1 = TRUE;
+ }
+ if (pEncoding->GetType() == PDFOBJ_NAME) {
+ CFX_ByteString cmap = pEncoding->GetString();
+ m_pCMap = CPDF_ModuleMgr::Get()->GetPageModule()->GetFontGlobals()->m_CMapManager.GetPredefinedCMap(cmap,
+ m_pFontFile && m_bType1);
+ } else if (pEncoding->GetType() == PDFOBJ_STREAM) {
+ m_pAllocatedCMap = m_pCMap = FX_NEW CPDF_CMap;
+ CPDF_Stream* pStream = (CPDF_Stream*)pEncoding;
+ CPDF_StreamAcc acc;
+ acc.LoadAllData(pStream, FALSE);
+ m_pCMap->LoadEmbedded(acc.GetData(), acc.GetSize());
+ } else {
+ return FALSE;
+ }
+ if (m_pCMap == NULL) {
+ return FALSE;
+ }
+ m_Charset = m_pCMap->m_Charset;
+ if (m_Charset == CIDSET_UNKNOWN) {
+ CPDF_Dictionary* pCIDInfo = pCIDFontDict->GetDict(FX_BSTRC("CIDSystemInfo"));
+ if (pCIDInfo) {
+ m_Charset = _CharsetFromOrdering(pCIDInfo->GetString(FX_BSTRC("Ordering")));
+ }
+ }
+ if (m_Charset != CIDSET_UNKNOWN)
+ m_pCID2UnicodeMap = CPDF_ModuleMgr::Get()->GetPageModule()->GetFontGlobals()->m_CMapManager.GetCID2UnicodeMap(m_Charset,
+ m_pFontFile == NULL && (m_pCMap->m_Coding == CIDCODING_CID || pCIDFontDict->KeyExist(FX_BSTRC("W"))));
+ if (m_Font.GetFace()) {
+ if (m_bType1) {
+ FXFT_Select_Charmap(m_Font.GetFace(), FXFT_ENCODING_UNICODE);
+ } else {
+ FT_UseCIDCharmap(m_Font.GetFace(), m_pCMap->m_Coding);
+ }
+ }
+ m_DefaultWidth = pCIDFontDict->GetInteger(FX_BSTRC("DW"), 1000);
+ CPDF_Array* pWidthArray = pCIDFontDict->GetArray(FX_BSTRC("W"));
+ if (pWidthArray) {
+ LoadMetricsArray(pWidthArray, m_WidthList, 1);
+ }
+ if (!IsEmbedded()) {
+ LoadSubstFont();
+ }
+ if (1) {
+ if (m_pFontFile || (GetSubstFont()->m_SubstFlags & FXFONT_SUBST_EXACT)) {
+ CPDF_Object* pmap = pCIDFontDict->GetElementValue(FX_BSTRC("CIDToGIDMap"));
+ if (pmap) {
+ if (pmap->GetType() == PDFOBJ_STREAM) {
+ m_pCIDToGIDMap = FX_NEW CPDF_StreamAcc;
+ m_pCIDToGIDMap->LoadAllData((CPDF_Stream*)pmap, FALSE);
+ } else if (pmap->GetString() == FX_BSTRC("Identity")) {
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
+ if (m_pFontFile) {
+ m_bCIDIsGID = TRUE;
+ }
+#else
+ m_bCIDIsGID = TRUE;
+#endif
+ }
+ }
+ }
+ }
+ CheckFontMetrics();
+ if (IsVertWriting()) {
+ pWidthArray = pCIDFontDict->GetArray(FX_BSTRC("W2"));
+ if (pWidthArray) {
+ LoadMetricsArray(pWidthArray, m_VertMetrics, 3);
+ }
+ CPDF_Array* pDefaultArray = pCIDFontDict->GetArray(FX_BSTRC("DW2"));
+ if (pDefaultArray) {
+ m_DefaultVY = pDefaultArray->GetInteger(0);
+ m_DefaultW1 = pDefaultArray->GetInteger(1);
+ } else {
+ m_DefaultVY = 880;
+ m_DefaultW1 = -1000;
+ }
+ }
+ return TRUE;
+}
+FX_FLOAT _CIDTransformToFloat(FX_BYTE ch)
+{
+ if (ch < 128) {
+ return ch * 1.0f / 127;
+ }
+ return (-255 + ch) * 1.0f / 127;
+}
+void CPDF_CIDFont::GetCharBBox(FX_DWORD charcode, FX_RECT& rect, int level)
+{
+ if (charcode < 256 && m_CharBBox[charcode].Right != -1) {
+ rect.bottom = m_CharBBox[charcode].Bottom;
+ rect.left = m_CharBBox[charcode].Left;
+ rect.right = m_CharBBox[charcode].Right;
+ rect.top = m_CharBBox[charcode].Top;
+ return;
+ }
+ FX_BOOL bVert = FALSE;
+ int glyph_index = GlyphFromCharCode(charcode, &bVert);
+ if (m_Font.m_Face == NULL) {
+ rect = FX_RECT(0, 0, 0, 0);
+ } else {
+ rect.left = rect.bottom = rect.right = rect.top = 0;
+ FXFT_Face face = m_Font.m_Face;
+ if (FXFT_Is_Face_Tricky(face)) {
+ int err = FXFT_Load_Glyph(face, glyph_index, FXFT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH);
+ if (!err) {
+ FXFT_BBox cbox;
+ FXFT_Glyph glyph;
+ err = FXFT_Get_Glyph(((FXFT_Face)face)->glyph, &glyph);
+ if (!err) {
+ FXFT_Glyph_Get_CBox(glyph, FXFT_GLYPH_BBOX_PIXELS, &cbox);
+ int pixel_size_x = ((FXFT_Face)face)->size->metrics.x_ppem;
+ int pixel_size_y = ((FXFT_Face)face)->size->metrics.y_ppem;
+ if (pixel_size_x == 0 || pixel_size_y == 0) {
+ rect.left = cbox.xMin;
+ rect.right = cbox.xMax;
+ rect.top = cbox.yMax;
+ rect.bottom = cbox.yMin;
+ } else {
+ rect.left = cbox.xMin * 1000 / pixel_size_x;
+ rect.right = cbox.xMax * 1000 / pixel_size_x;
+ rect.top = cbox.yMax * 1000 / pixel_size_y;
+ rect.bottom = cbox.yMin * 1000 / pixel_size_y;
+ }
+ if (rect.top > FXFT_Get_Face_Ascender(face)) {
+ rect.top = FXFT_Get_Face_Ascender(face);
+ }
+ if (rect.bottom < FXFT_Get_Face_Descender(face)) {
+ rect.bottom = FXFT_Get_Face_Descender(face);
+ }
+ FXFT_Done_Glyph(glyph);
+ }
+ }
+ } else {
+ int err = FXFT_Load_Glyph(face, glyph_index, FXFT_LOAD_NO_SCALE);
+ if (err == 0) {
+ rect.left = TT2PDF(FXFT_Get_Glyph_HoriBearingX(face), face);
+ rect.right = TT2PDF(FXFT_Get_Glyph_HoriBearingX(face) + FXFT_Get_Glyph_Width(face), face);
+ rect.top = TT2PDF(FXFT_Get_Glyph_HoriBearingY(face), face);
+ rect.top += rect.top / 64;
+ rect.bottom = TT2PDF(FXFT_Get_Glyph_HoriBearingY(face) - FXFT_Get_Glyph_Height(face), face);
+ }
+ }
+ }
+ if (m_pFontFile == NULL && m_Charset == CIDSET_JAPAN1) {
+ FX_WORD CID = CIDFromCharCode(charcode);
+ FX_LPCBYTE pTransform = GetCIDTransform(CID);
+ if (pTransform && !bVert) {
+ CFX_AffineMatrix matrix(_CIDTransformToFloat(pTransform[0]), _CIDTransformToFloat(pTransform[1]),
+ _CIDTransformToFloat(pTransform[2]), _CIDTransformToFloat(pTransform[3]),
+ _CIDTransformToFloat(pTransform[4]) * 1000 , _CIDTransformToFloat(pTransform[5]) * 1000);
+ CFX_FloatRect rect_f(rect);
+ rect_f.Transform(&matrix);
+ rect = rect_f.GetOutterRect();
+ }
+ }
+ if (charcode < 256) {
+ m_CharBBox[charcode].Bottom = (short)rect.bottom;
+ m_CharBBox[charcode].Left = (short)rect.left;
+ m_CharBBox[charcode].Right = (short)rect.right;
+ m_CharBBox[charcode].Top = (short)rect.top;
+ }
+}
+int CPDF_CIDFont::GetCharWidthF(FX_DWORD charcode, int level)
+{
+ if (m_pAnsiWidths && charcode < 0x80) {
+ return m_pAnsiWidths[charcode];
+ }
+ FX_WORD cid = CIDFromCharCode(charcode);
+ int size = m_WidthList.GetSize();
+ FX_DWORD* list = m_WidthList.GetData();
+ for (int i = 0; i < size; i += 3) {
+ if (cid >= list[i] && cid <= list[i + 1]) {
+ return (int)list[i + 2];
+ }
+ }
+ return m_DefaultWidth;
+}
+short CPDF_CIDFont::GetVertWidth(FX_WORD CID) const
+{
+ FX_DWORD vertsize = m_VertMetrics.GetSize() / 5;
+ if (vertsize == 0) {
+ return m_DefaultW1;
+ }
+ const FX_DWORD* pTable = m_VertMetrics.GetData();
+ for (FX_DWORD i = 0; i < vertsize; i ++)
+ if (pTable[i * 5] <= CID && pTable[i * 5 + 1] >= CID) {
+ return (short)(int)pTable[i * 5 + 2];
+ }
+ return m_DefaultW1;
+}
+void CPDF_CIDFont::GetVertOrigin(FX_WORD CID, short& vx, short &vy) const
+{
+ FX_DWORD vertsize = m_VertMetrics.GetSize() / 5;
+ if (vertsize) {
+ const FX_DWORD* pTable = m_VertMetrics.GetData();
+ for (FX_DWORD i = 0; i < vertsize; i ++)
+ if (pTable[i * 5] <= CID && pTable[i * 5 + 1] >= CID) {
+ vx = (short)(int)pTable[i * 5 + 3];
+ vy = (short)(int)pTable[i * 5 + 4];
+ return;
+ }
+ }
+ FX_DWORD dwWidth = m_DefaultWidth;
+ int size = m_WidthList.GetSize();
+ const FX_DWORD* list = m_WidthList.GetData();
+ for (int i = 0; i < size; i += 3) {
+ if (CID >= list[i] && CID <= list[i + 1]) {
+ dwWidth = (FX_WORD)list[i + 2];
+ break;
+ }
+ }
+ vx = (short)dwWidth / 2;
+ vy = (short)m_DefaultVY;
+}
+int CPDF_CIDFont::GetGlyphIndex(FX_DWORD unicode, FX_BOOL *pVertGlyph)
+{
+ if (pVertGlyph) {
+ *pVertGlyph = FALSE;
+ }
+ int index = FXFT_Get_Char_Index(m_Font.m_Face, unicode );
+ if (unicode == 0x2502) {
+ return index;
+ }
+ if (index && IsVertWriting()) {
+ if (m_pTTGSUBTable) {
+ TT_uint32_t vindex = 0;
+ m_pTTGSUBTable->GetVerticalGlyph(index, &vindex);
+ if (vindex) {
+ index = vindex;
+ if (pVertGlyph) {
+ *pVertGlyph = TRUE;
+ }
+ }
+ return index;
+ }
+ if (NULL == m_Font.m_pGsubData) {
+ unsigned long length = 0;
+ int error = FXFT_Load_Sfnt_Table( m_Font.m_Face, FT_MAKE_TAG('G', 'S', 'U', 'B'), 0, NULL, &length);
+ if (!error) {
+ m_Font.m_pGsubData = (unsigned char*)FX_Alloc(FX_BYTE, length);
+ }
+ }
+ int error = FXFT_Load_Sfnt_Table( m_Font.m_Face, FT_MAKE_TAG('G', 'S', 'U', 'B'), 0, m_Font.m_pGsubData, NULL);
+ if (!error && m_Font.m_pGsubData) {
+ m_pTTGSUBTable = FX_NEW CFX_CTTGSUBTable;
+ m_pTTGSUBTable->LoadGSUBTable((FT_Bytes)m_Font.m_pGsubData);
+ TT_uint32_t vindex = 0;
+ m_pTTGSUBTable->GetVerticalGlyph(index, &vindex);
+ if (vindex) {
+ index = vindex;
+ if (pVertGlyph) {
+ *pVertGlyph = TRUE;
+ }
+ }
+ }
+ return index;
+ }
+ if (pVertGlyph) {
+ *pVertGlyph = FALSE;
+ }
+ return index;
+}
+int CPDF_CIDFont::GlyphFromCharCode(FX_DWORD charcode, FX_BOOL *pVertGlyph)
+{
+ if (pVertGlyph) {
+ *pVertGlyph = FALSE;
+ }
+ if (m_pFontFile == NULL && m_pCIDToGIDMap == NULL) {
+ FX_WORD cid = CIDFromCharCode(charcode);
+ FX_WCHAR unicode = 0;
+ if (m_bCIDIsGID) {
+#if _FXM_PLATFORM_ != _FXM_PLATFORM_APPLE_
+ return cid;
+#else
+ if (m_Flags & PDFFONT_SYMBOLIC) {
+ return cid;
+ }
+ CFX_WideString uni_str = UnicodeFromCharCode(charcode);
+ if (uni_str.IsEmpty()) {
+ return cid;
+ }
+ unicode = uni_str.GetAt(0);
+#endif
+ } else {
+ if (cid && m_pCID2UnicodeMap && m_pCID2UnicodeMap->IsLoaded()) {
+ unicode = m_pCID2UnicodeMap->UnicodeFromCID(cid);
+ }
+ if (unicode == 0) {
+ unicode = _UnicodeFromCharCode(charcode);
+ }
+ if (unicode == 0 && !(m_Flags & PDFFONT_SYMBOLIC)) {
+ unicode = UnicodeFromCharCode(charcode).GetAt(0);
+ }
+ }
+ if (unicode == 0) {
+ if (!m_bAdobeCourierStd) {
+ return charcode == 0 ? -1 : (int)charcode;
+ }
+ charcode += 31;
+ int index = 0, iBaseEncoding;
+ FX_BOOL bMSUnicode = FT_UseTTCharmap(m_Font.m_Face, 3, 1);
+ FX_BOOL bMacRoman = FALSE;
+ if (!bMSUnicode) {
+ bMacRoman = FT_UseTTCharmap(m_Font.m_Face, 1, 0);
+ }
+ iBaseEncoding = PDFFONT_ENCODING_STANDARD;
+ if (bMSUnicode) {
+ iBaseEncoding = PDFFONT_ENCODING_WINANSI;
+ } else if (bMacRoman) {
+ iBaseEncoding = PDFFONT_ENCODING_MACROMAN;
+ }
+ FX_LPCSTR name = GetAdobeCharName(iBaseEncoding, NULL, charcode);
+ if (name == NULL) {
+ return charcode == 0 ? -1 : (int)charcode;
+ }
+ FX_WORD unicode = PDF_UnicodeFromAdobeName(name);
+ if (unicode) {
+ if (bMSUnicode) {
+ index = FXFT_Get_Char_Index(m_Font.m_Face, unicode);
+ } else if (bMacRoman) {
+ FX_DWORD maccode = FT_CharCodeFromUnicode(FXFT_ENCODING_APPLE_ROMAN, unicode);
+ index = !maccode ? FXFT_Get_Name_Index(m_Font.m_Face, (char *)name) : FXFT_Get_Char_Index(m_Font.m_Face, maccode);
+ } else {
+ return FXFT_Get_Char_Index(m_Font.m_Face, unicode);
+ }
+ } else {
+ return charcode == 0 ? -1 : (int)charcode;
+ }
+ if (index == 0 || index == 0xffff) {
+ return charcode == 0 ? -1 : (int)charcode;
+ } else {
+ return index;
+ }
+ }
+ if (m_Charset == CIDSET_JAPAN1) {
+ if (unicode == '\\') {
+ unicode = '/';
+ }
+#if !defined(_FPDFAPI_MINI_) && _FXM_PLATFORM_ != _FXM_PLATFORM_APPLE_
+ else if (unicode == 0xa5) {
+ unicode = 0x5c;
+ }
+#endif
+ }
+ if (m_Font.m_Face == NULL) {
+ return unicode;
+ }
+ int err = FXFT_Select_Charmap(m_Font.m_Face, FXFT_ENCODING_UNICODE);
+ if (err != 0) {
+ int i;
+ for (i = 0; i < FXFT_Get_Face_CharmapCount(m_Font.m_Face); i ++) {
+ FX_DWORD ret = FT_CharCodeFromUnicode(FXFT_Get_Charmap_Encoding(FXFT_Get_Face_Charmaps(m_Font.m_Face)[i]), (FX_WCHAR)charcode);
+ if (ret == 0) {
+ continue;
+ }
+ FXFT_Set_Charmap(m_Font.m_Face, FXFT_Get_Face_Charmaps(m_Font.m_Face)[i]);
+ unicode = (FX_WCHAR)ret;
+ break;
+ }
+ if (i == FXFT_Get_Face_CharmapCount(m_Font.m_Face) && i) {
+ FXFT_Set_Charmap(m_Font.m_Face, FXFT_Get_Face_Charmaps(m_Font.m_Face)[0]);
+ unicode = (FX_WCHAR)charcode;
+ }
+ }
+ if (FXFT_Get_Face_Charmap(m_Font.m_Face)) {
+ int index = GetGlyphIndex(unicode, pVertGlyph);
+ if (index == 0) {
+ return -1;
+ }
+ return index;
+ }
+ return unicode ;
+ }
+ if (m_Font.m_Face == NULL) {
+ return -1;
+ }
+ FX_WORD cid = CIDFromCharCode(charcode);
+ if (m_bType1) {
+ if (NULL == m_pCIDToGIDMap) {
+ return cid;
+ }
+ } else {
+ if (m_pCIDToGIDMap == NULL) {
+ if (m_pFontFile && m_pCMap->m_pMapping == NULL) {
+ return cid;
+ }
+ if (m_pCMap->m_Coding == CIDCODING_UNKNOWN || FXFT_Get_Face_Charmap(m_Font.m_Face) == NULL) {
+ return cid;
+ }
+ if (FXFT_Get_Charmap_Encoding(FXFT_Get_Face_Charmap(m_Font.m_Face)) == FXFT_ENCODING_UNICODE) {
+ CFX_WideString unicode_str = UnicodeFromCharCode(charcode);
+ if (unicode_str.IsEmpty()) {
+ return -1;
+ }
+ charcode = unicode_str.GetAt(0);
+ }
+ return GetGlyphIndex(charcode, pVertGlyph);
+ }
+ }
+ FX_DWORD byte_pos = cid * 2;
+ if (byte_pos + 2 > m_pCIDToGIDMap->GetSize()) {
+ return -1;
+ }
+ FX_LPCBYTE pdata = m_pCIDToGIDMap->GetData() + byte_pos;
+ return pdata[0] * 256 + pdata[1];
+}
+FX_DWORD CPDF_CIDFont::GetNextChar(FX_LPCSTR pString, int& offset) const
+{
+ return m_pCMap->GetNextChar(pString, offset);
+}
+int CPDF_CIDFont::GetCharSize(FX_DWORD charcode) const
+{
+ return m_pCMap->GetCharSize(charcode);
+}
+int CPDF_CIDFont::CountChar(FX_LPCSTR pString, int size) const
+{
+ return m_pCMap->CountChar(pString, size);
+}
+int CPDF_CIDFont::AppendChar(FX_LPSTR str, FX_DWORD charcode) const
+{
+ return m_pCMap->AppendChar(str, charcode);
+}
+FX_BOOL CPDF_CIDFont::IsUnicodeCompatible() const
+{
+ if (!m_pCMap->IsLoaded() || m_pCID2UnicodeMap == NULL || !m_pCID2UnicodeMap->IsLoaded()) {
+ return m_pCMap->m_Coding != CIDCODING_UNKNOWN;
+ }
+ return TRUE;
+}
+FX_BOOL CPDF_CIDFont::IsFontStyleFromCharCode(FX_DWORD charcode) const
+{
+ return TRUE;
+}
+void CPDF_CIDFont::LoadSubstFont()
+{
+ m_Font.LoadSubst(m_BaseFont, !m_bType1, m_Flags, m_StemV * 5, m_ItalicAngle, g_CharsetCPs[m_Charset], IsVertWriting());
+}
+void CPDF_CIDFont::LoadMetricsArray(CPDF_Array* pArray, CFX_DWordArray& result, int nElements)
+{
+ int width_status = 0;
+ int iCurElement = 0;
+ int first_code = 0, last_code;
+ FX_DWORD count = pArray->GetCount();
+ for (FX_DWORD i = 0; i < count; i ++) {
+ CPDF_Object* pObj = pArray->GetElementValue(i);
+ if (pObj == NULL) {
+ continue;
+ }
+ if (pObj->GetType() == PDFOBJ_ARRAY) {
+ if (width_status != 1) {
+ return;
+ }
+ CPDF_Array* pArray = (CPDF_Array*)pObj;
+ FX_DWORD count = pArray->GetCount();
+ for (FX_DWORD j = 0; j < count; j += nElements) {
+ result.Add(first_code);
+ result.Add(first_code);
+ for (int k = 0; k < nElements; k ++) {
+ result.Add(pArray->GetInteger(j + k));
+ }
+ first_code ++;
+ }
+ width_status = 0;
+ } else {
+ if (width_status == 0) {
+ first_code = pObj->GetInteger();
+ width_status = 1;
+ } else if (width_status == 1) {
+ last_code = pObj->GetInteger();
+ width_status = 2;
+ iCurElement = 0;
+ } else {
+ if (!iCurElement) {
+ result.Add(first_code);
+ result.Add(last_code);
+ }
+ result.Add(pObj->GetInteger());
+ iCurElement ++;
+ if (iCurElement == nElements) {
+ width_status = 0;
+ }
+ }
+ }
+ }
+}
+FX_BOOL CPDF_CIDFont::LoadGB2312()
+{
+ m_BaseFont = m_pFontDict->GetString(FX_BSTRC("BaseFont"));
+ CPDF_Dictionary* pFontDesc = m_pFontDict->GetDict(FX_BSTRC("FontDescriptor"));
+ if (pFontDesc) {
+ LoadFontDescriptor(pFontDesc);
+ }
+ m_Charset = CIDSET_GB1;
+ m_bType1 = FALSE;
+ m_pCMap = CPDF_ModuleMgr::Get()->GetPageModule()->GetFontGlobals()->m_CMapManager.GetPredefinedCMap(
+ FX_BSTRC("GBK-EUC-H"), FALSE);
+ m_pCID2UnicodeMap = CPDF_ModuleMgr::Get()->GetPageModule()->GetFontGlobals()->m_CMapManager.GetCID2UnicodeMap(m_Charset, FALSE);
+ if (!IsEmbedded()) {
+ LoadSubstFont();
+ }
+ CheckFontMetrics();
+ m_DefaultWidth = 1000;
+ m_pAnsiWidths = FX_Alloc(FX_WORD, 128);
+ FXSYS_memset32(m_pAnsiWidths, 0, 128 * sizeof(FX_WORD));
+ for (int i = 32; i < 127; i ++) {
+ m_pAnsiWidths[i] = 500;
+ }
+ return TRUE;
+}
+const struct _CIDTransform {
+ FX_WORD CID;
+ FX_BYTE a, b, c, d, e, f;
+}
+Japan1_VertCIDs[] = {
+ {97, 129, 0, 0, 127, 55, 0},
+ {7887, 127, 0, 0, 127, 76, 89},
+ {7888, 127, 0, 0, 127, 79, 94},
+ {7889, 0, 129, 127, 0, 17, 127},
+ {7890, 0, 129, 127, 0, 17, 127},
+ {7891, 0, 129, 127, 0, 17, 127},
+ {7892, 0, 129, 127, 0, 17, 127},
+ {7893, 0, 129, 127, 0, 17, 127},
+ {7894, 0, 129, 127, 0, 17, 127},
+ {7895, 0, 129, 127, 0, 17, 127},
+ {7896, 0, 129, 127, 0, 17, 127},
+ {7897, 0, 129, 127, 0, 17, 127},
+ {7898, 0, 129, 127, 0, 17, 127},
+ {7899, 0, 129, 127, 0, 17, 104},
+ {7900, 0, 129, 127, 0, 17, 127},
+ {7901, 0, 129, 127, 0, 17, 104},
+ {7902, 0, 129, 127, 0, 17, 127},
+ {7903, 0, 129, 127, 0, 17, 127},
+ {7904, 0, 129, 127, 0, 17, 127},
+ {7905, 0, 129, 127, 0, 17, 114},
+ {7906, 0, 129, 127, 0, 17, 127},
+ {7907, 0, 129, 127, 0, 17, 127},
+ {7908, 0, 129, 127, 0, 17, 127},
+ {7909, 0, 129, 127, 0, 17, 127},
+ {7910, 0, 129, 127, 0, 17, 127},
+ {7911, 0, 129, 127, 0, 17, 127},
+ {7912, 0, 129, 127, 0, 17, 127},
+ {7913, 0, 129, 127, 0, 17, 127},
+ {7914, 0, 129, 127, 0, 17, 127},
+ {7915, 0, 129, 127, 0, 17, 114},
+ {7916, 0, 129, 127, 0, 17, 127},
+ {7917, 0, 129, 127, 0, 17, 127},
+ {7918, 127, 0, 0, 127, 18, 25},
+ {7919, 127, 0, 0, 127, 18, 25},
+ {7920, 127, 0, 0, 127, 18, 25},
+ {7921, 127, 0, 0, 127, 18, 25},
+ {7922, 127, 0, 0, 127, 18, 25},
+ {7923, 127, 0, 0, 127, 18, 25},
+ {7924, 127, 0, 0, 127, 18, 25},
+ {7925, 127, 0, 0, 127, 18, 25},
+ {7926, 127, 0, 0, 127, 18, 25},
+ {7927, 127, 0, 0, 127, 18, 25},
+ {7928, 127, 0, 0, 127, 18, 25},
+ {7929, 127, 0, 0, 127, 18, 25},
+ {7930, 127, 0, 0, 127, 18, 25},
+ {7931, 127, 0, 0, 127, 18, 25},
+ {7932, 127, 0, 0, 127, 18, 25},
+ {7933, 127, 0, 0, 127, 18, 25},
+ {7934, 127, 0, 0, 127, 18, 25},
+ {7935, 127, 0, 0, 127, 18, 25},
+ {7936, 127, 0, 0, 127, 18, 25},
+ {7937, 127, 0, 0, 127, 18, 25},
+ {7938, 127, 0, 0, 127, 18, 25},
+ {7939, 127, 0, 0, 127, 18, 25},
+ {8720, 0, 129, 127, 0, 19, 102},
+ {8721, 0, 129, 127, 0, 13, 127},
+ {8722, 0, 129, 127, 0, 19, 108},
+ {8723, 0, 129, 127, 0, 19, 102},
+ {8724, 0, 129, 127, 0, 19, 102},
+ {8725, 0, 129, 127, 0, 19, 102},
+ {8726, 0, 129, 127, 0, 19, 102},
+ {8727, 0, 129, 127, 0, 19, 102},
+ {8728, 0, 129, 127, 0, 19, 114},
+ {8729, 0, 129, 127, 0, 19, 114},
+ {8730, 0, 129, 127, 0, 38, 108},
+ {8731, 0, 129, 127, 0, 13, 108},
+ {8732, 0, 129, 127, 0, 19, 108},
+ {8733, 0, 129, 127, 0, 19, 108},
+ {8734, 0, 129, 127, 0, 19, 108},
+ {8735, 0, 129, 127, 0, 19, 108},
+ {8736, 0, 129, 127, 0, 19, 102},
+ {8737, 0, 129, 127, 0, 19, 102},
+ {8738, 0, 129, 127, 0, 19, 102},
+ {8739, 0, 129, 127, 0, 19, 102},
+ {8740, 0, 129, 127, 0, 19, 102},
+ {8741, 0, 129, 127, 0, 19, 102},
+ {8742, 0, 129, 127, 0, 19, 102},
+ {8743, 0, 129, 127, 0, 19, 102},
+ {8744, 0, 129, 127, 0, 19, 102},
+ {8745, 0, 129, 127, 0, 19, 102},
+ {8746, 0, 129, 127, 0, 19, 114},
+ {8747, 0, 129, 127, 0, 19, 114},
+ {8748, 0, 129, 127, 0, 19, 102},
+ {8749, 0, 129, 127, 0, 19, 102},
+ {8750, 0, 129, 127, 0, 19, 102},
+ {8751, 0, 129, 127, 0, 19, 102},
+ {8752, 0, 129, 127, 0, 19, 102},
+ {8753, 0, 129, 127, 0, 19, 102},
+ {8754, 0, 129, 127, 0, 19, 102},
+ {8755, 0, 129, 127, 0, 19, 102},
+ {8756, 0, 129, 127, 0, 19, 102},
+ {8757, 0, 129, 127, 0, 19, 102},
+ {8758, 0, 129, 127, 0, 19, 102},
+ {8759, 0, 129, 127, 0, 19, 102},
+ {8760, 0, 129, 127, 0, 19, 102},
+ {8761, 0, 129, 127, 0, 19, 102},
+ {8762, 0, 129, 127, 0, 19, 102},
+ {8763, 0, 129, 127, 0, 19, 102},
+ {8764, 0, 129, 127, 0, 19, 102},
+ {8765, 0, 129, 127, 0, 19, 102},
+ {8766, 0, 129, 127, 0, 19, 102},
+ {8767, 0, 129, 127, 0, 19, 102},
+ {8768, 0, 129, 127, 0, 19, 102},
+ {8769, 0, 129, 127, 0, 19, 102},
+ {8770, 0, 129, 127, 0, 19, 102},
+ {8771, 0, 129, 127, 0, 19, 102},
+ {8772, 0, 129, 127, 0, 19, 102},
+ {8773, 0, 129, 127, 0, 19, 102},
+ {8774, 0, 129, 127, 0, 19, 102},
+ {8775, 0, 129, 127, 0, 19, 102},
+ {8776, 0, 129, 127, 0, 19, 102},
+ {8777, 0, 129, 127, 0, 19, 102},
+ {8778, 0, 129, 127, 0, 19, 102},
+ {8779, 0, 129, 127, 0, 19, 114},
+ {8780, 0, 129, 127, 0, 19, 108},
+ {8781, 0, 129, 127, 0, 19, 114},
+ {8782, 0, 129, 127, 0, 13, 114},
+ {8783, 0, 129, 127, 0, 19, 108},
+ {8784, 0, 129, 127, 0, 13, 114},
+ {8785, 0, 129, 127, 0, 19, 108},
+ {8786, 0, 129, 127, 0, 19, 108},
+ {8787, 0, 129, 127, 0, 19, 108},
+ {8788, 0, 129, 127, 0, 19, 108},
+ {8789, 0, 129, 127, 0, 19, 108},
+ {8790, 0, 129, 127, 0, 19, 108},
+ {8791, 0, 129, 127, 0, 19, 108},
+ {8792, 0, 129, 127, 0, 19, 108},
+ {8793, 0, 129, 127, 0, 19, 108},
+ {8794, 0, 129, 127, 0, 19, 108},
+ {8795, 0, 129, 127, 0, 19, 108},
+ {8796, 0, 129, 127, 0, 19, 108},
+ {8797, 0, 129, 127, 0, 19, 108},
+ {8798, 0, 129, 127, 0, 19, 108},
+ {8799, 0, 129, 127, 0, 19, 108},
+ {8800, 0, 129, 127, 0, 19, 108},
+ {8801, 0, 129, 127, 0, 19, 108},
+ {8802, 0, 129, 127, 0, 19, 108},
+ {8803, 0, 129, 127, 0, 19, 108},
+ {8804, 0, 129, 127, 0, 19, 108},
+ {8805, 0, 129, 127, 0, 19, 108},
+ {8806, 0, 129, 127, 0, 19, 108},
+ {8807, 0, 129, 127, 0, 19, 108},
+ {8808, 0, 129, 127, 0, 19, 108},
+ {8809, 0, 129, 127, 0, 19, 108},
+ {8810, 0, 129, 127, 0, 19, 108},
+ {8811, 0, 129, 127, 0, 19, 114},
+ {8812, 0, 129, 127, 0, 19, 102},
+ {8813, 0, 129, 127, 0, 19, 114},
+ {8814, 0, 129, 127, 0, 76, 102},
+ {8815, 0, 129, 127, 0, 13, 121},
+ {8816, 0, 129, 127, 0, 19, 114},
+ {8817, 0, 129, 127, 0, 19, 127},
+ {8818, 0, 129, 127, 0, 19, 114},
+ {8819, 0, 129, 127, 0, 218, 108},
+};
+FX_LPCBYTE CPDF_CIDFont::GetCIDTransform(FX_WORD CID) const
+{
+ if (m_Charset != CIDSET_JAPAN1 || m_pFontFile != NULL) {
+ return NULL;
+ }
+ int begin = 0;
+ int end = sizeof Japan1_VertCIDs / sizeof(struct _CIDTransform) - 1;
+ while (begin <= end) {
+ int middle = (begin + end) / 2;
+ FX_WORD middlecode = Japan1_VertCIDs[middle].CID;
+ if (middlecode > CID) {
+ end = middle - 1;
+ } else if (middlecode < CID) {
+ begin = middle + 1;
+ } else {
+ return &Japan1_VertCIDs[middle].a;
+ }
+ }
+ return NULL;
+}
diff --git a/core/src/fpdfapi/fpdf_font/fpdf_font_utility.cpp b/core/src/fpdfapi/fpdf_font/fpdf_font_utility.cpp
index 7810fe80a9..b10bff7ebe 100644
--- a/core/src/fpdfapi/fpdf_font/fpdf_font_utility.cpp
+++ b/core/src/fpdfapi/fpdf_font/fpdf_font_utility.cpp
@@ -1,97 +1,97 @@
-// 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
-
-#include "../../../include/fpdfapi/fpdf_module.h"
-#include "../../../include/fpdfapi/fpdf_resource.h"
-#include "../../../include/fxcodec/fx_codec.h"
-#include "font_int.h"
-#ifndef _FPDFAPI_MINI_
-typedef struct {
- FXSYS_FILE* m_pFile;
- int m_nFiles;
- int m_IndexSize;
- int m_IndexOffset;
-} FXFC_PACKAGE;
-FX_LPVOID FXFC_LoadPackage(FX_LPCSTR name)
-{
- FXSYS_FILE* file = FXSYS_fopen(name, (FX_LPCSTR)"rb");
- if (file == NULL) {
- return NULL;
- }
- FX_BYTE buf[256];
- size_t read = FXSYS_fread(buf, 1, 20, file);
- if (*(FX_DWORD*)buf != 0x43465846) {
- FXSYS_fclose(file);
- return NULL;
- }
- FXFC_PACKAGE* pPackage = FX_Alloc(FXFC_PACKAGE, 1);
- pPackage->m_pFile = file;
- pPackage->m_nFiles = *(int*)(buf + 8);
- pPackage->m_IndexSize = *(int*)(buf + 12);
- pPackage->m_IndexOffset = *(int*)(buf + 16);
- return pPackage;
-}
-void FXFC_ClosePackage(FX_LPVOID p)
-{
- FXFC_PACKAGE* pPackage = (FXFC_PACKAGE*)p;
- FXSYS_fclose(pPackage->m_pFile);
- FX_Free(pPackage);
-}
-FX_BOOL FXFC_LoadFile(FX_LPVOID p, FX_LPCSTR name, FX_LPBYTE& pBuffer, FX_DWORD& size)
-{
- FXFC_PACKAGE* pPackage = (FXFC_PACKAGE*)p;
- FXSYS_fseek(pPackage->m_pFile, pPackage->m_IndexOffset, FXSYS_SEEK_SET);
- FX_BYTE buf[128];
- size_t read = 0;
- for (int i = 0; i < pPackage->m_nFiles; i ++) {
- read = FXSYS_fread(buf, pPackage->m_IndexSize, 1, pPackage->m_pFile);
- if (FXSYS_stricmp((FX_LPCSTR)buf, name) == 0) {
- FX_DWORD offset = *(FX_DWORD*)&buf[64];
- size = *(FX_DWORD*)&buf[68];
- pBuffer = FX_Alloc(FX_BYTE, size);
- FXSYS_fseek(pPackage->m_pFile, offset, FXSYS_SEEK_SET);
- read = FXSYS_fread(pBuffer, size, 1, pPackage->m_pFile);
- if (buf[72]) {
- FX_DWORD orig_size;
- FX_LPBYTE comp_buf = pBuffer;
- CPDF_ModuleMgr::Get()->GetFlateModule()->FlateOrLZWDecode(FALSE, comp_buf, size, FALSE,
- 0, 0, 0, 0, 0, pBuffer, orig_size);
- FX_Free(comp_buf);
- size = orig_size;
- }
- return TRUE;
- }
- }
- return FALSE;
-}
-FX_BOOL CPDF_FXMP::LoadFile(FX_LPVOID pPackage, FX_LPCSTR fileid)
-{
- if (m_pHeader) {
- FX_Free(m_pHeader);
- m_pHeader = NULL;
- }
- m_pTable = NULL;
- FX_DWORD size;
- if (!FXFC_LoadFile(pPackage, fileid, (FX_LPBYTE&)m_pHeader, size)) {
- return FALSE;
- }
- if (FXSYS_memcmp32(m_pHeader, "FXMP", 4)) {
- return FALSE;
- }
- m_pTable = (FX_LPBYTE)m_pHeader + m_pHeader->dwDataOffset;
- return TRUE;
-}
-FX_LPBYTE CPDF_FXMP::GetRecord(FX_DWORD index)
-{
- if (m_pTable == NULL) {
- return NULL;
- }
- if ((int)index < (int)m_pHeader->dwStartIndex || index > m_pHeader->dwEndIndex) {
- return NULL;
- }
- return m_pTable + (index - m_pHeader->dwStartIndex) * m_pHeader->dwRecordSize;
-}
-#endif
+// 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
+
+#include "../../../include/fpdfapi/fpdf_module.h"
+#include "../../../include/fpdfapi/fpdf_resource.h"
+#include "../../../include/fxcodec/fx_codec.h"
+#include "font_int.h"
+#ifndef _FPDFAPI_MINI_
+typedef struct {
+ FXSYS_FILE* m_pFile;
+ int m_nFiles;
+ int m_IndexSize;
+ int m_IndexOffset;
+} FXFC_PACKAGE;
+FX_LPVOID FXFC_LoadPackage(FX_LPCSTR name)
+{
+ FXSYS_FILE* file = FXSYS_fopen(name, (FX_LPCSTR)"rb");
+ if (file == NULL) {
+ return NULL;
+ }
+ FX_BYTE buf[256];
+ size_t read = FXSYS_fread(buf, 1, 20, file);
+ if (*(FX_DWORD*)buf != 0x43465846) {
+ FXSYS_fclose(file);
+ return NULL;
+ }
+ FXFC_PACKAGE* pPackage = FX_Alloc(FXFC_PACKAGE, 1);
+ pPackage->m_pFile = file;
+ pPackage->m_nFiles = *(int*)(buf + 8);
+ pPackage->m_IndexSize = *(int*)(buf + 12);
+ pPackage->m_IndexOffset = *(int*)(buf + 16);
+ return pPackage;
+}
+void FXFC_ClosePackage(FX_LPVOID p)
+{
+ FXFC_PACKAGE* pPackage = (FXFC_PACKAGE*)p;
+ FXSYS_fclose(pPackage->m_pFile);
+ FX_Free(pPackage);
+}
+FX_BOOL FXFC_LoadFile(FX_LPVOID p, FX_LPCSTR name, FX_LPBYTE& pBuffer, FX_DWORD& size)
+{
+ FXFC_PACKAGE* pPackage = (FXFC_PACKAGE*)p;
+ FXSYS_fseek(pPackage->m_pFile, pPackage->m_IndexOffset, FXSYS_SEEK_SET);
+ FX_BYTE buf[128];
+ size_t read = 0;
+ for (int i = 0; i < pPackage->m_nFiles; i ++) {
+ read = FXSYS_fread(buf, pPackage->m_IndexSize, 1, pPackage->m_pFile);
+ if (FXSYS_stricmp((FX_LPCSTR)buf, name) == 0) {
+ FX_DWORD offset = *(FX_DWORD*)&buf[64];
+ size = *(FX_DWORD*)&buf[68];
+ pBuffer = FX_Alloc(FX_BYTE, size);
+ FXSYS_fseek(pPackage->m_pFile, offset, FXSYS_SEEK_SET);
+ read = FXSYS_fread(pBuffer, size, 1, pPackage->m_pFile);
+ if (buf[72]) {
+ FX_DWORD orig_size;
+ FX_LPBYTE comp_buf = pBuffer;
+ CPDF_ModuleMgr::Get()->GetFlateModule()->FlateOrLZWDecode(FALSE, comp_buf, size, FALSE,
+ 0, 0, 0, 0, 0, pBuffer, orig_size);
+ FX_Free(comp_buf);
+ size = orig_size;
+ }
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+FX_BOOL CPDF_FXMP::LoadFile(FX_LPVOID pPackage, FX_LPCSTR fileid)
+{
+ if (m_pHeader) {
+ FX_Free(m_pHeader);
+ m_pHeader = NULL;
+ }
+ m_pTable = NULL;
+ FX_DWORD size;
+ if (!FXFC_LoadFile(pPackage, fileid, (FX_LPBYTE&)m_pHeader, size)) {
+ return FALSE;
+ }
+ if (FXSYS_memcmp32(m_pHeader, "FXMP", 4)) {
+ return FALSE;
+ }
+ m_pTable = (FX_LPBYTE)m_pHeader + m_pHeader->dwDataOffset;
+ return TRUE;
+}
+FX_LPBYTE CPDF_FXMP::GetRecord(FX_DWORD index)
+{
+ if (m_pTable == NULL) {
+ return NULL;
+ }
+ if ((int)index < (int)m_pHeader->dwStartIndex || index > m_pHeader->dwEndIndex) {
+ return NULL;
+ }
+ return m_pTable + (index - m_pHeader->dwStartIndex) * m_pHeader->dwRecordSize;
+}
+#endif
diff --git a/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp b/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp
index b7a7864c2d..42f77de57b 100644
--- a/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp
+++ b/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp
@@ -1,452 +1,452 @@
-// 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
-
-#include "../../../include/fxge/fx_ge.h"
-#include "../../../include/fxge/fx_freetype.h"
-#include "ttgsubtable.h"
-CFX_GlyphMap::CFX_GlyphMap()
-{
-}
-CFX_GlyphMap::~CFX_GlyphMap()
-{
-}
-extern "C" {
- static int _CompareInt(const void* p1, const void* p2)
- {
- return (*(FX_DWORD*)p1) - (*(FX_DWORD*)p2);
- }
-};
-struct _IntPair {
- FX_INT32 key;
- FX_INT32 value;
-};
-void CFX_GlyphMap::SetAt(int key, int value)
-{
- FX_DWORD count = m_Buffer.GetSize() / sizeof(_IntPair);
- _IntPair* buf = (_IntPair*)m_Buffer.GetBuffer();
- _IntPair pair = {key, value};
- if (count == 0 || key > buf[count - 1].key) {
- m_Buffer.AppendBlock(&pair, sizeof(_IntPair));
- return;
- }
- int low = 0, high = count - 1;
- while (low <= high) {
- int mid = (low + high) / 2;
- if (buf[mid].key < key) {
- low = mid + 1;
- } else if (buf[mid].key > key) {
- high = mid - 1;
- } else {
- buf[mid].value = value;
- return;
- }
- }
- m_Buffer.InsertBlock(low * sizeof(_IntPair), &pair, sizeof(_IntPair));
-}
-FX_BOOL CFX_GlyphMap::Lookup(int key, int &value)
-{
- FX_LPVOID pResult = FXSYS_bsearch(&key, m_Buffer.GetBuffer(), m_Buffer.GetSize() / sizeof(_IntPair),
- sizeof(_IntPair), _CompareInt);
- if (pResult == NULL) {
- return FALSE;
- }
- value = ((FX_DWORD*)pResult)[1];
- return TRUE;
-}
-bool CFX_CTTGSUBTable::LoadGSUBTable(FT_Bytes gsub)
-{
- header.Version = gsub[0] << 24 | gsub[1] << 16 | gsub[2] << 8 | gsub[3];
- if(header.Version != 0x00010000) {
- return false;
- }
- header.ScriptList = gsub[4] << 8 | gsub[5];
- header.FeatureList = gsub[6] << 8 | gsub[7];
- header.LookupList = gsub[8] << 8 | gsub[9];
- return Parse(
- &gsub[header.ScriptList],
- &gsub[header.FeatureList],
- &gsub[header.LookupList]);
-}
-bool CFX_CTTGSUBTable::GetVerticalGlyph(TT_uint32_t glyphnum, TT_uint32_t *vglyphnum)
-{
- TT_uint32_t tag[] = {
- (TT_uint8_t)'v' << 24 |
- (TT_uint8_t)'r' << 16 |
- (TT_uint8_t)'t' << 8 |
- (TT_uint8_t)'2',
- (TT_uint8_t)'v' << 24 |
- (TT_uint8_t)'e' << 16 |
- (TT_uint8_t)'r' << 8 |
- (TT_uint8_t)'t',
- };
- if (!m_bFeautureMapLoad) {
- for (int i = 0; i < ScriptList.ScriptCount; i++) {
- for (int j = 0; j < (ScriptList.ScriptRecord + i)->Script.LangSysCount; ++j) {
- for (int k = 0; k < ((ScriptList.ScriptRecord + i)->Script.LangSysRecord + j)->LangSys.FeatureCount; ++k) {
- FX_DWORD index = *(((ScriptList.ScriptRecord + i)->Script.LangSysRecord + j)->LangSys.FeatureIndex + k);
- if (FeatureList.FeatureRecord[index].FeatureTag == tag[0] || FeatureList.FeatureRecord[index].FeatureTag == tag[1]) {
- FX_DWORD value;
- if (!m_featureMap.Lookup(index, value)) {
- m_featureMap.SetAt(index, index);
- }
- }
- }
- }
- }
- if (!m_featureMap.GetStartPosition()) {
- for (int i = 0; i < FeatureList.FeatureCount; i ++) {
- if (FeatureList.FeatureRecord[i].FeatureTag == tag[0] || FeatureList.FeatureRecord[i].FeatureTag == tag[1]) {
- FX_DWORD value;
- if (!m_featureMap.Lookup(i, value)) {
- m_featureMap.SetAt(i, i);
- }
- }
- }
- }
- m_bFeautureMapLoad = TRUE;
- }
- FX_POSITION pos = m_featureMap.GetStartPosition();
- while (pos) {
- FX_DWORD index, value;
- m_featureMap.GetNextAssoc(pos, index, value);
- if(GetVerticalGlyphSub(glyphnum, vglyphnum, &FeatureList.FeatureRecord[value].Feature)) {
- return true;
- }
- }
- return false;
-}
-bool CFX_CTTGSUBTable::GetVerticalGlyphSub(
- TT_uint32_t glyphnum,
- TT_uint32_t *vglyphnum,
- struct TFeature *Feature)
-{
- for(int i = 0; i < Feature->LookupCount; i++) {
- int index = Feature->LookupListIndex[i];
- if(index < 0 || LookupList.LookupCount < index) {
- continue;
- }
- if(LookupList.Lookup[index].LookupType == 1) {
- if(GetVerticalGlyphSub2(
- glyphnum,
- vglyphnum,
- &LookupList.Lookup[index])) {
- return true;
- }
- }
- }
- return false;
-}
-bool CFX_CTTGSUBTable::GetVerticalGlyphSub2(
- TT_uint32_t glyphnum,
- TT_uint32_t *vglyphnum,
- struct TLookup *Lookup)
-{
- for(int i = 0; i < Lookup->SubTableCount; i++) {
- switch(Lookup->SubTable[i]->SubstFormat) {
- case 1: {
- TSingleSubstFormat1 *tbl1 = (TSingleSubstFormat1*)Lookup->SubTable[i];
- if(GetCoverageIndex(tbl1->Coverage, glyphnum) >= 0) {
- *vglyphnum = glyphnum + tbl1->DeltaGlyphID;
- return true;
- }
- break;
- }
- case 2: {
- TSingleSubstFormat2 *tbl2 = (TSingleSubstFormat2*)Lookup->SubTable[i];
- int index = -1;
- index = GetCoverageIndex(tbl2->Coverage, glyphnum);
- if(0 <= index && index < tbl2->GlyphCount) {
- *vglyphnum = tbl2->Substitute[index];
- return true;
- }
- break;
- }
- }
- }
- return false;
-}
-int CFX_CTTGSUBTable::GetCoverageIndex(struct TCoverageFormatBase *Coverage, TT_uint32_t g)
-{
- int i = 0;
- if(Coverage == NULL) {
- return -1;
- }
- switch(Coverage->CoverageFormat) {
- case 1: {
- TCoverageFormat1 *c1 = (TCoverageFormat1*)Coverage;
- for(i = 0; i < c1->GlyphCount; i++) {
- if((TT_uint32_t)c1->GlyphArray[i] == g) {
- return i;
- }
- }
- return -1;
- }
- case 2: {
- TCoverageFormat2 *c2 = (TCoverageFormat2*)Coverage;
- for(i = 0; i < c2->RangeCount; i++) {
- TT_uint32_t s = c2->RangeRecord[i].Start;
- TT_uint32_t e = c2->RangeRecord[i].End;
- TT_uint32_t si = c2->RangeRecord[i].StartCoverageIndex;
- if (s <= g && g <= e) {
- return si + g - s;
- }
- }
- return -1;
- }
- }
- return -1;
-}
-bool CFX_CTTGSUBTable::Parse(
- FT_Bytes scriptlist,
- FT_Bytes featurelist,
- FT_Bytes lookuplist)
-{
- ParseScriptList(scriptlist, &ScriptList);
- ParseFeatureList(featurelist, &FeatureList);
- ParseLookupList(lookuplist, &LookupList);
- return true;
-}
-void CFX_CTTGSUBTable::ParseScriptList(FT_Bytes raw, struct TScriptList *rec)
-{
- int i;
- FT_Bytes sp = raw;
- rec->ScriptCount = GetUInt16(sp);
- if(rec->ScriptCount <= 0) {
- return;
- }
- rec->ScriptRecord = new struct TScriptRecord[rec->ScriptCount];
- for(i = 0; i < rec->ScriptCount; i++) {
- rec->ScriptRecord[i].ScriptTag = GetUInt32(sp);
- TT_uint16_t offset = GetUInt16(sp);
- ParseScript(
- &raw[offset],
- &rec->ScriptRecord[i].Script);
- }
-}
-void CFX_CTTGSUBTable::ParseScript(FT_Bytes raw, struct TScript *rec)
-{
- int i;
- FT_Bytes sp = raw;
- rec->DefaultLangSys = GetUInt16(sp);
- rec->LangSysCount = GetUInt16(sp);
- if(rec->LangSysCount <= 0) {
- return;
- }
- rec->LangSysRecord = new struct TLangSysRecord[rec->LangSysCount];
- for(i = 0; i < rec->LangSysCount; i++) {
- rec->LangSysRecord[i].LangSysTag = GetUInt32(sp);
- TT_uint16_t offset = GetUInt16(sp);
- ParseLangSys(
- &raw[offset],
- &rec->LangSysRecord[i].LangSys);
- }
-}
-void CFX_CTTGSUBTable::ParseLangSys(FT_Bytes raw, struct TLangSys *rec)
-{
- FT_Bytes sp = raw;
- rec->LookupOrder = GetUInt16(sp);
- rec->ReqFeatureIndex = GetUInt16(sp);
- rec->FeatureCount = GetUInt16(sp);
- if(rec->FeatureCount <= 0) {
- return;
- }
- rec->FeatureIndex = new TT_uint16_t[rec->FeatureCount];
- FXSYS_memset32(rec->FeatureIndex, 0, sizeof(TT_uint16_t) * rec->FeatureCount);
- for (int i = 0; i < rec->FeatureCount; ++i) {
- rec->FeatureIndex[i] = GetUInt16(sp);
- }
-}
-void CFX_CTTGSUBTable::ParseFeatureList(FT_Bytes raw, TFeatureList *rec)
-{
- int i;
- FT_Bytes sp = raw;
- rec->FeatureCount = GetUInt16(sp);
- if(rec->FeatureCount <= 0) {
- return;
- }
- rec->FeatureRecord = new struct TFeatureRecord[rec->FeatureCount];
- for(i = 0; i < rec->FeatureCount; i++) {
- rec->FeatureRecord[i].FeatureTag = GetUInt32(sp);
- TT_uint16_t offset = GetUInt16(sp);
- ParseFeature(
- &raw[offset],
- &rec->FeatureRecord[i].Feature);
- }
-}
-void CFX_CTTGSUBTable::ParseFeature(FT_Bytes raw, TFeature *rec)
-{
- int i;
- FT_Bytes sp = raw;
- rec->FeatureParams = GetUInt16(sp);
- rec->LookupCount = GetUInt16(sp);
- if(rec->LookupCount <= 0) {
- return;
- }
- rec->LookupListIndex = new TT_uint16_t[rec->LookupCount];
- for(i = 0; i < rec->LookupCount; i++) {
- rec->LookupListIndex[i] = GetUInt16(sp);
- }
-}
-void CFX_CTTGSUBTable::ParseLookupList(FT_Bytes raw, TLookupList *rec)
-{
- int i;
- FT_Bytes sp = raw;
- rec->LookupCount = GetUInt16(sp);
- if(rec->LookupCount <= 0) {
- return;
- }
- rec->Lookup = new struct TLookup[rec->LookupCount];
- for(i = 0; i < rec->LookupCount; i++) {
- TT_uint16_t offset = GetUInt16(sp);
- ParseLookup(
- &raw[offset],
- &rec->Lookup[i]);
- }
-}
-void CFX_CTTGSUBTable::ParseLookup(FT_Bytes raw, TLookup *rec)
-{
- int i;
- FT_Bytes sp = raw;
- rec->LookupType = GetUInt16(sp);
- rec->LookupFlag = GetUInt16(sp);
- rec->SubTableCount = GetUInt16(sp);
- if(rec->SubTableCount <= 0) {
- return;
- }
- rec->SubTable = new struct TSubTableBase*[rec->SubTableCount];
- for(i = 0; i < rec->SubTableCount; i++) {
- rec->SubTable[i] = NULL;
- }
- if(rec->LookupType != 1) {
- return;
- }
- for(i = 0; i < rec->SubTableCount; i++) {
- TT_uint16_t offset = GetUInt16(sp);
- ParseSingleSubst(
- &raw[offset],
- &rec->SubTable[i]);
- }
-}
-void CFX_CTTGSUBTable::ParseCoverage(FT_Bytes raw, TCoverageFormatBase **rec)
-{
- FT_Bytes sp = raw;
- TT_uint16_t Format = GetUInt16(sp);
- switch(Format) {
- case 1:
- *rec = new TCoverageFormat1();
- ParseCoverageFormat1(raw, (TCoverageFormat1*)*rec);
- break;
- case 2:
- *rec = new TCoverageFormat2();
- ParseCoverageFormat2(raw, (TCoverageFormat2*)*rec);
- break;
- }
-}
-void CFX_CTTGSUBTable::ParseCoverageFormat1(FT_Bytes raw, TCoverageFormat1 *rec)
-{
- int i;
- FT_Bytes sp = raw;
- GetUInt16(sp);
- rec->GlyphCount = GetUInt16(sp);
- if(rec->GlyphCount <= 0) {
- return;
- }
- rec->GlyphArray = new TT_uint16_t[rec->GlyphCount];
- for(i = 0; i < rec->GlyphCount; i++) {
- rec->GlyphArray[i] = GetUInt16(sp);
- }
-}
-void CFX_CTTGSUBTable::ParseCoverageFormat2(FT_Bytes raw, TCoverageFormat2 *rec)
-{
- int i;
- FT_Bytes sp = raw;
- GetUInt16(sp);
- rec->RangeCount = GetUInt16(sp);
- if(rec->RangeCount <= 0) {
- return;
- }
- rec->RangeRecord = new TRangeRecord[rec->RangeCount];
- for(i = 0; i < rec->RangeCount; i++) {
- rec->RangeRecord[i].Start = GetUInt16(sp);
- rec->RangeRecord[i].End = GetUInt16(sp);
- rec->RangeRecord[i].StartCoverageIndex = GetUInt16(sp);
- }
-}
-void CFX_CTTGSUBTable::ParseSingleSubst(FT_Bytes raw, TSubTableBase **rec)
-{
- FT_Bytes sp = raw;
- TT_uint16_t Format = GetUInt16(sp);
- switch(Format) {
- case 1:
- *rec = new TSingleSubstFormat1();
- ParseSingleSubstFormat1(raw, (TSingleSubstFormat1*)*rec);
- break;
- case 2:
- *rec = new TSingleSubstFormat2();
- ParseSingleSubstFormat2(raw, (TSingleSubstFormat2*)*rec);
- break;
- }
-}
-void CFX_CTTGSUBTable::ParseSingleSubstFormat1(FT_Bytes raw, TSingleSubstFormat1 *rec)
-{
- FT_Bytes sp = raw;
- GetUInt16(sp);
- TT_uint16_t offset = GetUInt16(sp);
- ParseCoverage(
- &raw[offset],
- &rec->Coverage);
- rec->DeltaGlyphID = GetInt16(sp);
-}
-void CFX_CTTGSUBTable::ParseSingleSubstFormat2(FT_Bytes raw, TSingleSubstFormat2 *rec)
-{
- int i;
- FT_Bytes sp = raw;
- GetUInt16(sp);
- TT_uint16_t offset = GetUInt16(sp);
- ParseCoverage(
- &raw[offset],
- &rec->Coverage);
- rec->GlyphCount = GetUInt16(sp);
- if(rec->GlyphCount <= 0) {
- return;
- }
- rec->Substitute = new TT_uint16_t[rec->GlyphCount];
- for(i = 0; i < rec->GlyphCount; i++) {
- rec->Substitute[i] = GetUInt16(sp);
- }
-}
-FX_BOOL CFX_GSUBTable::GetVerticalGlyph(FX_DWORD glyphnum, FX_DWORD* vglyphnum)
-{
- return m_GsubImp.GetVerticalGlyph(glyphnum, vglyphnum);
-}
-IFX_GSUBTable* FXGE_CreateGSUBTable(CFX_Font* pFont)
-{
- if (!pFont) {
- return NULL;
- }
- if (NULL == pFont->m_pGsubData) {
- unsigned long length = 0;
- int error = FXFT_Load_Sfnt_Table(pFont->m_Face, FT_MAKE_TAG('G', 'S', 'U', 'B'), 0, NULL, &length);
- if (!error) {
- pFont->m_pGsubData = (unsigned char*)FX_Alloc(FX_BYTE, length);
- }
- if (!pFont->m_pGsubData) {
- return NULL;
- }
- }
- int error = FXFT_Load_Sfnt_Table(pFont->m_Face, FT_MAKE_TAG('G', 'S', 'U', 'B'), 0, pFont->m_pGsubData, NULL);
- if (!error && pFont->m_pGsubData) {
- CFX_GSUBTable* pGsubTable = FX_NEW CFX_GSUBTable;
- if (!pGsubTable) {
- return NULL;
- }
- if (pGsubTable->m_GsubImp.LoadGSUBTable((FT_Bytes)pFont->m_pGsubData)) {
- return pGsubTable;
- }
- delete pGsubTable;
- }
- return NULL;
-}
+// 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
+
+#include "../../../include/fxge/fx_ge.h"
+#include "../../../include/fxge/fx_freetype.h"
+#include "ttgsubtable.h"
+CFX_GlyphMap::CFX_GlyphMap()
+{
+}
+CFX_GlyphMap::~CFX_GlyphMap()
+{
+}
+extern "C" {
+ static int _CompareInt(const void* p1, const void* p2)
+ {
+ return (*(FX_DWORD*)p1) - (*(FX_DWORD*)p2);
+ }
+};
+struct _IntPair {
+ FX_INT32 key;
+ FX_INT32 value;
+};
+void CFX_GlyphMap::SetAt(int key, int value)
+{
+ FX_DWORD count = m_Buffer.GetSize() / sizeof(_IntPair);
+ _IntPair* buf = (_IntPair*)m_Buffer.GetBuffer();
+ _IntPair pair = {key, value};
+ if (count == 0 || key > buf[count - 1].key) {
+ m_Buffer.AppendBlock(&pair, sizeof(_IntPair));
+ return;
+ }
+ int low = 0, high = count - 1;
+ while (low <= high) {
+ int mid = (low + high) / 2;
+ if (buf[mid].key < key) {
+ low = mid + 1;
+ } else if (buf[mid].key > key) {
+ high = mid - 1;
+ } else {
+ buf[mid].value = value;
+ return;
+ }
+ }
+ m_Buffer.InsertBlock(low * sizeof(_IntPair), &pair, sizeof(_IntPair));
+}
+FX_BOOL CFX_GlyphMap::Lookup(int key, int &value)
+{
+ FX_LPVOID pResult = FXSYS_bsearch(&key, m_Buffer.GetBuffer(), m_Buffer.GetSize() / sizeof(_IntPair),
+ sizeof(_IntPair), _CompareInt);
+ if (pResult == NULL) {
+ return FALSE;
+ }
+ value = ((FX_DWORD*)pResult)[1];
+ return TRUE;
+}
+bool CFX_CTTGSUBTable::LoadGSUBTable(FT_Bytes gsub)
+{
+ header.Version = gsub[0] << 24 | gsub[1] << 16 | gsub[2] << 8 | gsub[3];
+ if(header.Version != 0x00010000) {
+ return false;
+ }
+ header.ScriptList = gsub[4] << 8 | gsub[5];
+ header.FeatureList = gsub[6] << 8 | gsub[7];
+ header.LookupList = gsub[8] << 8 | gsub[9];
+ return Parse(
+ &gsub[header.ScriptList],
+ &gsub[header.FeatureList],
+ &gsub[header.LookupList]);
+}
+bool CFX_CTTGSUBTable::GetVerticalGlyph(TT_uint32_t glyphnum, TT_uint32_t *vglyphnum)
+{
+ TT_uint32_t tag[] = {
+ (TT_uint8_t)'v' << 24 |
+ (TT_uint8_t)'r' << 16 |
+ (TT_uint8_t)'t' << 8 |
+ (TT_uint8_t)'2',
+ (TT_uint8_t)'v' << 24 |
+ (TT_uint8_t)'e' << 16 |
+ (TT_uint8_t)'r' << 8 |
+ (TT_uint8_t)'t',
+ };
+ if (!m_bFeautureMapLoad) {
+ for (int i = 0; i < ScriptList.ScriptCount; i++) {
+ for (int j = 0; j < (ScriptList.ScriptRecord + i)->Script.LangSysCount; ++j) {
+ for (int k = 0; k < ((ScriptList.ScriptRecord + i)->Script.LangSysRecord + j)->LangSys.FeatureCount; ++k) {
+ FX_DWORD index = *(((ScriptList.ScriptRecord + i)->Script.LangSysRecord + j)->LangSys.FeatureIndex + k);
+ if (FeatureList.FeatureRecord[index].FeatureTag == tag[0] || FeatureList.FeatureRecord[index].FeatureTag == tag[1]) {
+ FX_DWORD value;
+ if (!m_featureMap.Lookup(index, value)) {
+ m_featureMap.SetAt(index, index);
+ }
+ }
+ }
+ }
+ }
+ if (!m_featureMap.GetStartPosition()) {
+ for (int i = 0; i < FeatureList.FeatureCount; i ++) {
+ if (FeatureList.FeatureRecord[i].FeatureTag == tag[0] || FeatureList.FeatureRecord[i].FeatureTag == tag[1]) {
+ FX_DWORD value;
+ if (!m_featureMap.Lookup(i, value)) {
+ m_featureMap.SetAt(i, i);
+ }
+ }
+ }
+ }
+ m_bFeautureMapLoad = TRUE;
+ }
+ FX_POSITION pos = m_featureMap.GetStartPosition();
+ while (pos) {
+ FX_DWORD index, value;
+ m_featureMap.GetNextAssoc(pos, index, value);
+ if(GetVerticalGlyphSub(glyphnum, vglyphnum, &FeatureList.FeatureRecord[value].Feature)) {
+ return true;
+ }
+ }
+ return false;
+}
+bool CFX_CTTGSUBTable::GetVerticalGlyphSub(
+ TT_uint32_t glyphnum,
+ TT_uint32_t *vglyphnum,
+ struct TFeature *Feature)
+{
+ for(int i = 0; i < Feature->LookupCount; i++) {
+ int index = Feature->LookupListIndex[i];
+ if(index < 0 || LookupList.LookupCount < index) {
+ continue;
+ }
+ if(LookupList.Lookup[index].LookupType == 1) {
+ if(GetVerticalGlyphSub2(
+ glyphnum,
+ vglyphnum,
+ &LookupList.Lookup[index])) {
+ return true;
+ }
+ }
+ }
+ return false;
+}
+bool CFX_CTTGSUBTable::GetVerticalGlyphSub2(
+ TT_uint32_t glyphnum,
+ TT_uint32_t *vglyphnum,
+ struct TLookup *Lookup)
+{
+ for(int i = 0; i < Lookup->SubTableCount; i++) {
+ switch(Lookup->SubTable[i]->SubstFormat) {
+ case 1: {
+ TSingleSubstFormat1 *tbl1 = (TSingleSubstFormat1*)Lookup->SubTable[i];
+ if(GetCoverageIndex(tbl1->Coverage, glyphnum) >= 0) {
+ *vglyphnum = glyphnum + tbl1->DeltaGlyphID;
+ return true;
+ }
+ break;
+ }
+ case 2: {
+ TSingleSubstFormat2 *tbl2 = (TSingleSubstFormat2*)Lookup->SubTable[i];
+ int index = -1;
+ index = GetCoverageIndex(tbl2->Coverage, glyphnum);
+ if(0 <= index && index < tbl2->GlyphCount) {
+ *vglyphnum = tbl2->Substitute[index];
+ return true;
+ }
+ break;
+ }
+ }
+ }
+ return false;
+}
+int CFX_CTTGSUBTable::GetCoverageIndex(struct TCoverageFormatBase *Coverage, TT_uint32_t g)
+{
+ int i = 0;
+ if(Coverage == NULL) {
+ return -1;
+ }
+ switch(Coverage->CoverageFormat) {
+ case 1: {
+ TCoverageFormat1 *c1 = (TCoverageFormat1*)Coverage;
+ for(i = 0; i < c1->GlyphCount; i++) {
+ if((TT_uint32_t)c1->GlyphArray[i] == g) {
+ return i;
+ }
+ }
+ return -1;
+ }
+ case 2: {
+ TCoverageFormat2 *c2 = (TCoverageFormat2*)Coverage;
+ for(i = 0; i < c2->RangeCount; i++) {
+ TT_uint32_t s = c2->RangeRecord[i].Start;
+ TT_uint32_t e = c2->RangeRecord[i].End;
+ TT_uint32_t si = c2->RangeRecord[i].StartCoverageIndex;
+ if (s <= g && g <= e) {
+ return si + g - s;
+ }
+ }
+ return -1;
+ }
+ }
+ return -1;
+}
+bool CFX_CTTGSUBTable::Parse(
+ FT_Bytes scriptlist,
+ FT_Bytes featurelist,
+ FT_Bytes lookuplist)
+{
+ ParseScriptList(scriptlist, &ScriptList);
+ ParseFeatureList(featurelist, &FeatureList);
+ ParseLookupList(lookuplist, &LookupList);
+ return true;
+}
+void CFX_CTTGSUBTable::ParseScriptList(FT_Bytes raw, struct TScriptList *rec)
+{
+ int i;
+ FT_Bytes sp = raw;
+ rec->ScriptCount = GetUInt16(sp);
+ if(rec->ScriptCount <= 0) {
+ return;
+ }
+ rec->ScriptRecord = new struct TScriptRecord[rec->ScriptCount];
+ for(i = 0; i < rec->ScriptCount; i++) {
+ rec->ScriptRecord[i].ScriptTag = GetUInt32(sp);
+ TT_uint16_t offset = GetUInt16(sp);
+ ParseScript(
+ &raw[offset],
+ &rec->ScriptRecord[i].Script);
+ }
+}
+void CFX_CTTGSUBTable::ParseScript(FT_Bytes raw, struct TScript *rec)
+{
+ int i;
+ FT_Bytes sp = raw;
+ rec->DefaultLangSys = GetUInt16(sp);
+ rec->LangSysCount = GetUInt16(sp);
+ if(rec->LangSysCount <= 0) {
+ return;
+ }
+ rec->LangSysRecord = new struct TLangSysRecord[rec->LangSysCount];
+ for(i = 0; i < rec->LangSysCount; i++) {
+ rec->LangSysRecord[i].LangSysTag = GetUInt32(sp);
+ TT_uint16_t offset = GetUInt16(sp);
+ ParseLangSys(
+ &raw[offset],
+ &rec->LangSysRecord[i].LangSys);
+ }
+}
+void CFX_CTTGSUBTable::ParseLangSys(FT_Bytes raw, struct TLangSys *rec)
+{
+ FT_Bytes sp = raw;
+ rec->LookupOrder = GetUInt16(sp);
+ rec->ReqFeatureIndex = GetUInt16(sp);
+ rec->FeatureCount = GetUInt16(sp);
+ if(rec->FeatureCount <= 0) {
+ return;
+ }
+ rec->FeatureIndex = new TT_uint16_t[rec->FeatureCount];
+ FXSYS_memset32(rec->FeatureIndex, 0, sizeof(TT_uint16_t) * rec->FeatureCount);
+ for (int i = 0; i < rec->FeatureCount; ++i) {
+ rec->FeatureIndex[i] = GetUInt16(sp);
+ }
+}
+void CFX_CTTGSUBTable::ParseFeatureList(FT_Bytes raw, TFeatureList *rec)
+{
+ int i;
+ FT_Bytes sp = raw;
+ rec->FeatureCount = GetUInt16(sp);
+ if(rec->FeatureCount <= 0) {
+ return;
+ }
+ rec->FeatureRecord = new struct TFeatureRecord[rec->FeatureCount];
+ for(i = 0; i < rec->FeatureCount; i++) {
+ rec->FeatureRecord[i].FeatureTag = GetUInt32(sp);
+ TT_uint16_t offset = GetUInt16(sp);
+ ParseFeature(
+ &raw[offset],
+ &rec->FeatureRecord[i].Feature);
+ }
+}
+void CFX_CTTGSUBTable::ParseFeature(FT_Bytes raw, TFeature *rec)
+{
+ int i;
+ FT_Bytes sp = raw;
+ rec->FeatureParams = GetUInt16(sp);
+ rec->LookupCount = GetUInt16(sp);
+ if(rec->LookupCount <= 0) {
+ return;
+ }
+ rec->LookupListIndex = new TT_uint16_t[rec->LookupCount];
+ for(i = 0; i < rec->LookupCount; i++) {
+ rec->LookupListIndex[i] = GetUInt16(sp);
+ }
+}
+void CFX_CTTGSUBTable::ParseLookupList(FT_Bytes raw, TLookupList *rec)
+{
+ int i;
+ FT_Bytes sp = raw;
+ rec->LookupCount = GetUInt16(sp);
+ if(rec->LookupCount <= 0) {
+ return;
+ }
+ rec->Lookup = new struct TLookup[rec->LookupCount];
+ for(i = 0; i < rec->LookupCount; i++) {
+ TT_uint16_t offset = GetUInt16(sp);
+ ParseLookup(
+ &raw[offset],
+ &rec->Lookup[i]);
+ }
+}
+void CFX_CTTGSUBTable::ParseLookup(FT_Bytes raw, TLookup *rec)
+{
+ int i;
+ FT_Bytes sp = raw;
+ rec->LookupType = GetUInt16(sp);
+ rec->LookupFlag = GetUInt16(sp);
+ rec->SubTableCount = GetUInt16(sp);
+ if(rec->SubTableCount <= 0) {
+ return;
+ }
+ rec->SubTable = new struct TSubTableBase*[rec->SubTableCount];
+ for(i = 0; i < rec->SubTableCount; i++) {
+ rec->SubTable[i] = NULL;
+ }
+ if(rec->LookupType != 1) {
+ return;
+ }
+ for(i = 0; i < rec->SubTableCount; i++) {
+ TT_uint16_t offset = GetUInt16(sp);
+ ParseSingleSubst(
+ &raw[offset],
+ &rec->SubTable[i]);
+ }
+}
+void CFX_CTTGSUBTable::ParseCoverage(FT_Bytes raw, TCoverageFormatBase **rec)
+{
+ FT_Bytes sp = raw;
+ TT_uint16_t Format = GetUInt16(sp);
+ switch(Format) {
+ case 1:
+ *rec = new TCoverageFormat1();
+ ParseCoverageFormat1(raw, (TCoverageFormat1*)*rec);
+ break;
+ case 2:
+ *rec = new TCoverageFormat2();
+ ParseCoverageFormat2(raw, (TCoverageFormat2*)*rec);
+ break;
+ }
+}
+void CFX_CTTGSUBTable::ParseCoverageFormat1(FT_Bytes raw, TCoverageFormat1 *rec)
+{
+ int i;
+ FT_Bytes sp = raw;
+ GetUInt16(sp);
+ rec->GlyphCount = GetUInt16(sp);
+ if(rec->GlyphCount <= 0) {
+ return;
+ }
+ rec->GlyphArray = new TT_uint16_t[rec->GlyphCount];
+ for(i = 0; i < rec->GlyphCount; i++) {
+ rec->GlyphArray[i] = GetUInt16(sp);
+ }
+}
+void CFX_CTTGSUBTable::ParseCoverageFormat2(FT_Bytes raw, TCoverageFormat2 *rec)
+{
+ int i;
+ FT_Bytes sp = raw;
+ GetUInt16(sp);
+ rec->RangeCount = GetUInt16(sp);
+ if(rec->RangeCount <= 0) {
+ return;
+ }
+ rec->RangeRecord = new TRangeRecord[rec->RangeCount];
+ for(i = 0; i < rec->RangeCount; i++) {
+ rec->RangeRecord[i].Start = GetUInt16(sp);
+ rec->RangeRecord[i].End = GetUInt16(sp);
+ rec->RangeRecord[i].StartCoverageIndex = GetUInt16(sp);
+ }
+}
+void CFX_CTTGSUBTable::ParseSingleSubst(FT_Bytes raw, TSubTableBase **rec)
+{
+ FT_Bytes sp = raw;
+ TT_uint16_t Format = GetUInt16(sp);
+ switch(Format) {
+ case 1:
+ *rec = new TSingleSubstFormat1();
+ ParseSingleSubstFormat1(raw, (TSingleSubstFormat1*)*rec);
+ break;
+ case 2:
+ *rec = new TSingleSubstFormat2();
+ ParseSingleSubstFormat2(raw, (TSingleSubstFormat2*)*rec);
+ break;
+ }
+}
+void CFX_CTTGSUBTable::ParseSingleSubstFormat1(FT_Bytes raw, TSingleSubstFormat1 *rec)
+{
+ FT_Bytes sp = raw;
+ GetUInt16(sp);
+ TT_uint16_t offset = GetUInt16(sp);
+ ParseCoverage(
+ &raw[offset],
+ &rec->Coverage);
+ rec->DeltaGlyphID = GetInt16(sp);
+}
+void CFX_CTTGSUBTable::ParseSingleSubstFormat2(FT_Bytes raw, TSingleSubstFormat2 *rec)
+{
+ int i;
+ FT_Bytes sp = raw;
+ GetUInt16(sp);
+ TT_uint16_t offset = GetUInt16(sp);
+ ParseCoverage(
+ &raw[offset],
+ &rec->Coverage);
+ rec->GlyphCount = GetUInt16(sp);
+ if(rec->GlyphCount <= 0) {
+ return;
+ }
+ rec->Substitute = new TT_uint16_t[rec->GlyphCount];
+ for(i = 0; i < rec->GlyphCount; i++) {
+ rec->Substitute[i] = GetUInt16(sp);
+ }
+}
+FX_BOOL CFX_GSUBTable::GetVerticalGlyph(FX_DWORD glyphnum, FX_DWORD* vglyphnum)
+{
+ return m_GsubImp.GetVerticalGlyph(glyphnum, vglyphnum);
+}
+IFX_GSUBTable* FXGE_CreateGSUBTable(CFX_Font* pFont)
+{
+ if (!pFont) {
+ return NULL;
+ }
+ if (NULL == pFont->m_pGsubData) {
+ unsigned long length = 0;
+ int error = FXFT_Load_Sfnt_Table(pFont->m_Face, FT_MAKE_TAG('G', 'S', 'U', 'B'), 0, NULL, &length);
+ if (!error) {
+ pFont->m_pGsubData = (unsigned char*)FX_Alloc(FX_BYTE, length);
+ }
+ if (!pFont->m_pGsubData) {
+ return NULL;
+ }
+ }
+ int error = FXFT_Load_Sfnt_Table(pFont->m_Face, FT_MAKE_TAG('G', 'S', 'U', 'B'), 0, pFont->m_pGsubData, NULL);
+ if (!error && pFont->m_pGsubData) {
+ CFX_GSUBTable* pGsubTable = FX_NEW CFX_GSUBTable;
+ if (!pGsubTable) {
+ return NULL;
+ }
+ if (pGsubTable->m_GsubImp.LoadGSUBTable((FT_Bytes)pFont->m_pGsubData)) {
+ return pGsubTable;
+ }
+ delete pGsubTable;
+ }
+ return NULL;
+}
diff --git a/core/src/fpdfapi/fpdf_font/ttgsubtable.h b/core/src/fpdfapi/fpdf_font/ttgsubtable.h
index a1f0e8867a..bf9c7a4c42 100644
--- a/core/src/fpdfapi/fpdf_font/ttgsubtable.h
+++ b/core/src/fpdfapi/fpdf_font/ttgsubtable.h
@@ -1,419 +1,419 @@
-// 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 TTGSUBTable_H
-#define TTGSUBTable_H
-#include "../../fx_freetype.h"
-#include "../../../include/fxcrt/fx_basic.h"
-#include "common.h"
-class CFX_GlyphMap
-{
-public:
- CFX_GlyphMap();
- ~CFX_GlyphMap();
- void SetAt(int key, int value);
- FX_BOOL Lookup(int key, int &value);
-protected:
- CFX_BinaryBuf m_Buffer;
-};
-class CFX_CTTGSUBTable : public CFX_Object
-{
-public:
- CFX_CTTGSUBTable(void): loaded(false), m_bFeautureMapLoad(FALSE) {};
- CFX_CTTGSUBTable(FT_Bytes gsub): loaded(false), m_bFeautureMapLoad(FALSE)
- {
- LoadGSUBTable(gsub);
- }
- virtual ~CFX_CTTGSUBTable() {}
- bool IsOk(void) const
- {
- return loaded;
- }
- bool LoadGSUBTable(FT_Bytes gsub);
- bool GetVerticalGlyph(TT_uint32_t glyphnum, TT_uint32_t *vglyphnum);
-private:
- struct tt_gsub_header {
- TT_uint32_t Version;
- TT_uint16_t ScriptList;
- TT_uint16_t FeatureList;
- TT_uint16_t LookupList;
- };
- struct TLangSys {
- TT_uint16_t LookupOrder;
- TT_uint16_t ReqFeatureIndex;
- TT_uint16_t FeatureCount;
- TT_uint16_t *FeatureIndex;
- TLangSys(): LookupOrder(0), ReqFeatureIndex(0), FeatureCount(0), FeatureIndex(NULL) {}
- ~TLangSys()
- {
- if(FeatureIndex) {
- delete[] FeatureIndex;
- }
- }
- private:
- TLangSys(const TLangSys&);
- TLangSys& operator=(const TLangSys&);
- };
- struct TLangSysRecord {
- TT_uint32_t LangSysTag;
- struct TLangSys LangSys;
- TLangSysRecord(): LangSysTag(0) {}
- private:
- TLangSysRecord(const TLangSysRecord&);
- TLangSysRecord& operator=(const TLangSysRecord&);
- };
- struct TScript {
- TT_uint16_t DefaultLangSys;
- TT_uint16_t LangSysCount;
- struct TLangSysRecord *LangSysRecord;
- TScript(): DefaultLangSys(0), LangSysCount(0), LangSysRecord(NULL) {}
- ~TScript()
- {
- if(LangSysRecord) {
- delete[] LangSysRecord;
- }
- }
- private:
- TScript(const TScript&);
- TScript& operator=(const TScript&);
- };
- struct TScriptRecord {
- TT_uint32_t ScriptTag;
- struct TScript Script;
- TScriptRecord(): ScriptTag(0) {}
- private:
- TScriptRecord(const TScriptRecord&);
- TScriptRecord& operator=(const TScriptRecord&);
- };
- struct TScriptList {
- TT_uint16_t ScriptCount;
- struct TScriptRecord *ScriptRecord;
- TScriptList(): ScriptCount(0), ScriptRecord(NULL) {}
- ~TScriptList()
- {
- if(ScriptRecord) {
- delete[] ScriptRecord;
- }
- }
- private:
- TScriptList(const TScriptList&);
- TScriptList& operator=(const TScriptList&);
- };
- struct TFeature {
- TT_uint16_t FeatureParams;
- int LookupCount;
- TT_uint16_t *LookupListIndex;
- TFeature(): FeatureParams(0), LookupCount(0), LookupListIndex(NULL) {}
- ~TFeature()
- {
- if(LookupListIndex) {
- delete[] LookupListIndex;
- }
- }
- private:
- TFeature(const TFeature&);
- TFeature& operator=(const TFeature&);
- };
- struct TFeatureRecord {
- TT_uint32_t FeatureTag;
- struct TFeature Feature;
- TFeatureRecord(): FeatureTag(0) {}
- private:
- TFeatureRecord(const TFeatureRecord&);
- TFeatureRecord& operator=(const TFeatureRecord&);
- };
- struct TFeatureList {
- int FeatureCount;
- struct TFeatureRecord *FeatureRecord;
- TFeatureList(): FeatureCount(0), FeatureRecord(NULL) {}
- ~TFeatureList()
- {
- if(FeatureRecord) {
- delete[] FeatureRecord;
- }
- }
- private:
- TFeatureList(const TFeatureList&);
- TFeatureList& operator=(const TFeatureList&);
- };
- enum TLookupFlag {
- LOOKUPFLAG_RightToLeft = 0x0001,
- LOOKUPFLAG_IgnoreBaseGlyphs = 0x0002,
- LOOKUPFLAG_IgnoreLigatures = 0x0004,
- LOOKUPFLAG_IgnoreMarks = 0x0008,
- LOOKUPFLAG_Reserved = 0x00F0,
- LOOKUPFLAG_MarkAttachmentType = 0xFF00,
- };
- struct TCoverageFormatBase {
- TT_uint16_t CoverageFormat;
- CFX_GlyphMap m_glyphMap;
- TCoverageFormatBase(): CoverageFormat(0) {}
- virtual ~TCoverageFormatBase() {}
- private:
- TCoverageFormatBase(const TCoverageFormatBase&);
- TCoverageFormatBase& operator=(const TCoverageFormatBase&);
- };
- struct TCoverageFormat1: public TCoverageFormatBase {
- TT_uint16_t GlyphCount;
- TT_uint16_t *GlyphArray;
- TCoverageFormat1(): GlyphCount(0), GlyphArray(NULL)
- {
- CoverageFormat = 1;
- }
- ~TCoverageFormat1()
- {
- if(GlyphArray) {
- delete[] GlyphArray;
- }
- }
- private:
- TCoverageFormat1(const TCoverageFormat1&);
- TCoverageFormat1& operator=(const TCoverageFormat1&);
- };
- struct TRangeRecord {
- TT_uint16_t Start;
- TT_uint16_t End;
- TT_uint16_t StartCoverageIndex;
- TRangeRecord(): Start(0), End(0), StartCoverageIndex(0) {}
- friend bool operator > (const TRangeRecord &r1, const TRangeRecord &r2)
- {
- return r1.Start > r2.Start;
- }
- private:
- TRangeRecord(const TRangeRecord&);
- };
- struct TCoverageFormat2: public TCoverageFormatBase {
- TT_uint16_t RangeCount;
- struct TRangeRecord *RangeRecord;
- TCoverageFormat2(): RangeCount(0), RangeRecord(NULL)
- {
- CoverageFormat = 2;
- }
- ~TCoverageFormat2()
- {
- if(RangeRecord) {
- delete[] RangeRecord;
- }
- }
- private:
- TCoverageFormat2(const TCoverageFormat2&);
- TCoverageFormat2& operator=(const TCoverageFormat2&);
- };
- struct TClassDefFormatBase {
- TT_uint16_t ClassFormat;
- TClassDefFormatBase(): ClassFormat(0) {}
- virtual ~TClassDefFormatBase() {}
- private:
- TClassDefFormatBase(const TClassDefFormatBase&);
- TClassDefFormatBase& operator=(const TClassDefFormatBase&);
- };
- struct TClassDefFormat1: public TClassDefFormatBase {
- TT_uint16_t StartGlyph;
- TT_uint16_t GlyphCount;
- TT_uint16_t *ClassValueArray;
- TClassDefFormat1(): StartGlyph(0), GlyphCount(0), ClassValueArray(NULL)
- {
- ClassFormat = 1;
- }
- ~TClassDefFormat1()
- {
- if(ClassValueArray) {
- delete[] ClassValueArray;
- }
- }
- private:
- TClassDefFormat1(const TClassDefFormat1&);
- TClassDefFormat1& operator=(const TClassDefFormat1&);
- };
- struct TClassRangeRecord {
- TT_uint16_t Start;
- TT_uint16_t End;
- TT_uint16_t Class;
- TClassRangeRecord(): Start(0), End(0), Class(0) {}
- private:
- TClassRangeRecord(const TClassRangeRecord&);
- TClassRangeRecord& operator=(const TClassRangeRecord&);
- };
- struct TClassDefFormat2: public TClassDefFormatBase {
- TT_uint16_t ClassRangeCount;
- struct TClassRangeRecord *ClassRangeRecord;
- TClassDefFormat2(): ClassRangeCount(0), ClassRangeRecord(NULL)
- {
- ClassFormat = 2;
- }
- ~TClassDefFormat2()
- {
- if(ClassRangeRecord) {
- delete[] ClassRangeRecord;
- }
- }
- private:
- TClassDefFormat2(const TClassDefFormat2&);
- TClassDefFormat2& operator=(const TClassDefFormat2&);
- };
- struct TDevice {
- TT_uint16_t StartSize;
- TT_uint16_t EndSize;
- TT_uint16_t DeltaFormat;
- TDevice(): StartSize(0), EndSize(0), DeltaFormat(0) {}
- private:
- TDevice(const TDevice&);
- TDevice& operator=(const TDevice&);
- };
- struct TSubTableBase {
- TT_uint16_t SubstFormat;
- TSubTableBase(): SubstFormat(0) {}
- virtual ~TSubTableBase() {}
- private:
- TSubTableBase(const TSubTableBase&);
- TSubTableBase& operator=(const TSubTableBase&);
- };
- struct TSingleSubstFormat1: public TSubTableBase {
- TCoverageFormatBase *Coverage;
- TT_int16_t DeltaGlyphID;
- TSingleSubstFormat1(): DeltaGlyphID(0), Coverage(NULL)
- {
- SubstFormat = 1;
- }
- ~TSingleSubstFormat1()
- {
- if(Coverage) {
- delete Coverage;
- }
- }
- private:
- TSingleSubstFormat1(const TSingleSubstFormat1&);
- TSingleSubstFormat1& operator=(const TSingleSubstFormat1&);
- };
- struct TSingleSubstFormat2: public TSubTableBase {
- TCoverageFormatBase *Coverage;
- TT_uint16_t GlyphCount;
- TT_uint16_t *Substitute;
- TSingleSubstFormat2(): Coverage(NULL), GlyphCount(0), Substitute(NULL)
- {
- SubstFormat = 2;
- }
- ~TSingleSubstFormat2()
- {
- if(Coverage) {
- delete Coverage;
- }
- if(Substitute) {
- delete[] Substitute;
- }
- }
- private:
- TSingleSubstFormat2(const TSingleSubstFormat2&);
- TSingleSubstFormat2& operator=(const TSingleSubstFormat2&);
- };
- struct TLookup {
- TT_uint16_t LookupType;
- TT_uint16_t LookupFlag;
- TT_uint16_t SubTableCount;
- struct TSubTableBase **SubTable;
- TLookup(): LookupType(0), LookupFlag(0), SubTableCount(0), SubTable(NULL) {}
- ~TLookup()
- {
- if(SubTableCount > 0 && SubTable != NULL) {
- for(int i = 0; i < SubTableCount; i++) {
- delete SubTable[i];
- }
- delete[] SubTable;
- }
- }
- private:
- TLookup(const TLookup&);
- TLookup& operator=(const TLookup&);
- };
- struct TLookupList {
- int LookupCount;
- struct TLookup *Lookup;
- TLookupList(): LookupCount(0), Lookup(NULL) {}
- ~TLookupList()
- {
- if(Lookup) {
- delete[] Lookup;
- }
- }
- private:
- TLookupList(const TLookupList&);
- TLookupList& operator=(const TLookupList&);
- };
- bool Parse(
- FT_Bytes scriptlist,
- FT_Bytes featurelist,
- FT_Bytes lookuplist);
- void ParseScriptList(FT_Bytes raw, TScriptList *rec);
- void ParseScript(FT_Bytes raw, TScript *rec);
- void ParseLangSys(FT_Bytes raw, TLangSys *rec);
- void ParseFeatureList(FT_Bytes raw, TFeatureList *rec);
- void ParseFeature(FT_Bytes raw, TFeature *rec);
- void ParseLookupList(FT_Bytes raw, TLookupList *rec);
- void ParseLookup(FT_Bytes raw, TLookup *rec);
- void ParseCoverage(FT_Bytes raw, TCoverageFormatBase **rec);
- void ParseCoverageFormat1(FT_Bytes raw, TCoverageFormat1 *rec);
- void ParseCoverageFormat2(FT_Bytes raw, TCoverageFormat2 *rec);
- void ParseSingleSubst(FT_Bytes raw, TSubTableBase **rec);
- void ParseSingleSubstFormat1(FT_Bytes raw, TSingleSubstFormat1 *rec);
- void ParseSingleSubstFormat2(FT_Bytes raw, TSingleSubstFormat2 *rec);
- bool GetVerticalGlyphSub(
- TT_uint32_t glyphnum,
- TT_uint32_t *vglyphnum,
- struct TFeature *Feature);
- bool GetVerticalGlyphSub2(
- TT_uint32_t glyphnum,
- TT_uint32_t *vglyphnum,
- struct TLookup *Lookup);
- int GetCoverageIndex(struct TCoverageFormatBase *Coverage, TT_uint32_t g);
- TT_uint8_t GetUInt8(FT_Bytes& p) const
- {
- TT_uint8_t ret = p[0];
- p += 1;
- return ret;
- }
- TT_int16_t GetInt16(FT_Bytes& p) const
- {
- TT_uint16_t ret = p[0] << 8 | p[1];
- p += 2;
- return *(TT_int16_t*)&ret;
- }
- TT_uint16_t GetUInt16(FT_Bytes& p) const
- {
- TT_uint16_t ret = p[0] << 8 | p[1];
- p += 2;
- return ret;
- }
- TT_int32_t GetInt32(FT_Bytes& p) const
- {
- TT_uint32_t ret = p[0] << 24 | p[1] << 16 | p[2] << 8 | p[3];
- p += 4;
- return *(TT_int32_t*)&ret;
- }
- TT_uint32_t GetUInt32(FT_Bytes& p) const
- {
- TT_uint32_t ret = p[0] << 24 | p[1] << 16 | p[2] << 8 | p[3];
- p += 4;
- return ret;
- }
- CFX_CMapDWordToDWord m_featureMap;
- FX_BOOL m_bFeautureMapLoad;
- bool loaded;
- struct tt_gsub_header header;
- struct TScriptList ScriptList;
- struct TFeatureList FeatureList;
- struct TLookupList LookupList;
-};
-class CFX_GSUBTable : public IFX_GSUBTable, public CFX_Object
-{
-public:
- virtual void Release()
- {
- delete this;
- }
- virtual FX_BOOL GetVerticalGlyph(FX_DWORD glyphnum, FX_DWORD* vglyphnum);
- CFX_CTTGSUBTable m_GsubImp;
-};
-#endif
+// 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 TTGSUBTable_H
+#define TTGSUBTable_H
+#include "../../fx_freetype.h"
+#include "../../../include/fxcrt/fx_basic.h"
+#include "common.h"
+class CFX_GlyphMap
+{
+public:
+ CFX_GlyphMap();
+ ~CFX_GlyphMap();
+ void SetAt(int key, int value);
+ FX_BOOL Lookup(int key, int &value);
+protected:
+ CFX_BinaryBuf m_Buffer;
+};
+class CFX_CTTGSUBTable : public CFX_Object
+{
+public:
+ CFX_CTTGSUBTable(void): loaded(false), m_bFeautureMapLoad(FALSE) {};
+ CFX_CTTGSUBTable(FT_Bytes gsub): loaded(false), m_bFeautureMapLoad(FALSE)
+ {
+ LoadGSUBTable(gsub);
+ }
+ virtual ~CFX_CTTGSUBTable() {}
+ bool IsOk(void) const
+ {
+ return loaded;
+ }
+ bool LoadGSUBTable(FT_Bytes gsub);
+ bool GetVerticalGlyph(TT_uint32_t glyphnum, TT_uint32_t *vglyphnum);
+private:
+ struct tt_gsub_header {
+ TT_uint32_t Version;
+ TT_uint16_t ScriptList;
+ TT_uint16_t FeatureList;
+ TT_uint16_t LookupList;
+ };
+ struct TLangSys {
+ TT_uint16_t LookupOrder;
+ TT_uint16_t ReqFeatureIndex;
+ TT_uint16_t FeatureCount;
+ TT_uint16_t *FeatureIndex;
+ TLangSys(): LookupOrder(0), ReqFeatureIndex(0), FeatureCount(0), FeatureIndex(NULL) {}
+ ~TLangSys()
+ {
+ if(FeatureIndex) {
+ delete[] FeatureIndex;
+ }
+ }
+ private:
+ TLangSys(const TLangSys&);
+ TLangSys& operator=(const TLangSys&);
+ };
+ struct TLangSysRecord {
+ TT_uint32_t LangSysTag;
+ struct TLangSys LangSys;
+ TLangSysRecord(): LangSysTag(0) {}
+ private:
+ TLangSysRecord(const TLangSysRecord&);
+ TLangSysRecord& operator=(const TLangSysRecord&);
+ };
+ struct TScript {
+ TT_uint16_t DefaultLangSys;
+ TT_uint16_t LangSysCount;
+ struct TLangSysRecord *LangSysRecord;
+ TScript(): DefaultLangSys(0), LangSysCount(0), LangSysRecord(NULL) {}
+ ~TScript()
+ {
+ if(LangSysRecord) {
+ delete[] LangSysRecord;
+ }
+ }
+ private:
+ TScript(const TScript&);
+ TScript& operator=(const TScript&);
+ };
+ struct TScriptRecord {
+ TT_uint32_t ScriptTag;
+ struct TScript Script;
+ TScriptRecord(): ScriptTag(0) {}
+ private:
+ TScriptRecord(const TScriptRecord&);
+ TScriptRecord& operator=(const TScriptRecord&);
+ };
+ struct TScriptList {
+ TT_uint16_t ScriptCount;
+ struct TScriptRecord *ScriptRecord;
+ TScriptList(): ScriptCount(0), ScriptRecord(NULL) {}
+ ~TScriptList()
+ {
+ if(ScriptRecord) {
+ delete[] ScriptRecord;
+ }
+ }
+ private:
+ TScriptList(const TScriptList&);
+ TScriptList& operator=(const TScriptList&);
+ };
+ struct TFeature {
+ TT_uint16_t FeatureParams;
+ int LookupCount;
+ TT_uint16_t *LookupListIndex;
+ TFeature(): FeatureParams(0), LookupCount(0), LookupListIndex(NULL) {}
+ ~TFeature()
+ {
+ if(LookupListIndex) {
+ delete[] LookupListIndex;
+ }
+ }
+ private:
+ TFeature(const TFeature&);
+ TFeature& operator=(const TFeature&);
+ };
+ struct TFeatureRecord {
+ TT_uint32_t FeatureTag;
+ struct TFeature Feature;
+ TFeatureRecord(): FeatureTag(0) {}
+ private:
+ TFeatureRecord(const TFeatureRecord&);
+ TFeatureRecord& operator=(const TFeatureRecord&);
+ };
+ struct TFeatureList {
+ int FeatureCount;
+ struct TFeatureRecord *FeatureRecord;
+ TFeatureList(): FeatureCount(0), FeatureRecord(NULL) {}
+ ~TFeatureList()
+ {
+ if(FeatureRecord) {
+ delete[] FeatureRecord;
+ }
+ }
+ private:
+ TFeatureList(const TFeatureList&);
+ TFeatureList& operator=(const TFeatureList&);
+ };
+ enum TLookupFlag {
+ LOOKUPFLAG_RightToLeft = 0x0001,
+ LOOKUPFLAG_IgnoreBaseGlyphs = 0x0002,
+ LOOKUPFLAG_IgnoreLigatures = 0x0004,
+ LOOKUPFLAG_IgnoreMarks = 0x0008,
+ LOOKUPFLAG_Reserved = 0x00F0,
+ LOOKUPFLAG_MarkAttachmentType = 0xFF00,
+ };
+ struct TCoverageFormatBase {
+ TT_uint16_t CoverageFormat;
+ CFX_GlyphMap m_glyphMap;
+ TCoverageFormatBase(): CoverageFormat(0) {}
+ virtual ~TCoverageFormatBase() {}
+ private:
+ TCoverageFormatBase(const TCoverageFormatBase&);
+ TCoverageFormatBase& operator=(const TCoverageFormatBase&);
+ };
+ struct TCoverageFormat1: public TCoverageFormatBase {
+ TT_uint16_t GlyphCount;
+ TT_uint16_t *GlyphArray;
+ TCoverageFormat1(): GlyphCount(0), GlyphArray(NULL)
+ {
+ CoverageFormat = 1;
+ }
+ ~TCoverageFormat1()
+ {
+ if(GlyphArray) {
+ delete[] GlyphArray;
+ }
+ }
+ private:
+ TCoverageFormat1(const TCoverageFormat1&);
+ TCoverageFormat1& operator=(const TCoverageFormat1&);
+ };
+ struct TRangeRecord {
+ TT_uint16_t Start;
+ TT_uint16_t End;
+ TT_uint16_t StartCoverageIndex;
+ TRangeRecord(): Start(0), End(0), StartCoverageIndex(0) {}
+ friend bool operator > (const TRangeRecord &r1, const TRangeRecord &r2)
+ {
+ return r1.Start > r2.Start;
+ }
+ private:
+ TRangeRecord(const TRangeRecord&);
+ };
+ struct TCoverageFormat2: public TCoverageFormatBase {
+ TT_uint16_t RangeCount;
+ struct TRangeRecord *RangeRecord;
+ TCoverageFormat2(): RangeCount(0), RangeRecord(NULL)
+ {
+ CoverageFormat = 2;
+ }
+ ~TCoverageFormat2()
+ {
+ if(RangeRecord) {
+ delete[] RangeRecord;
+ }
+ }
+ private:
+ TCoverageFormat2(const TCoverageFormat2&);
+ TCoverageFormat2& operator=(const TCoverageFormat2&);
+ };
+ struct TClassDefFormatBase {
+ TT_uint16_t ClassFormat;
+ TClassDefFormatBase(): ClassFormat(0) {}
+ virtual ~TClassDefFormatBase() {}
+ private:
+ TClassDefFormatBase(const TClassDefFormatBase&);
+ TClassDefFormatBase& operator=(const TClassDefFormatBase&);
+ };
+ struct TClassDefFormat1: public TClassDefFormatBase {
+ TT_uint16_t StartGlyph;
+ TT_uint16_t GlyphCount;
+ TT_uint16_t *ClassValueArray;
+ TClassDefFormat1(): StartGlyph(0), GlyphCount(0), ClassValueArray(NULL)
+ {
+ ClassFormat = 1;
+ }
+ ~TClassDefFormat1()
+ {
+ if(ClassValueArray) {
+ delete[] ClassValueArray;
+ }
+ }
+ private:
+ TClassDefFormat1(const TClassDefFormat1&);
+ TClassDefFormat1& operator=(const TClassDefFormat1&);
+ };
+ struct TClassRangeRecord {
+ TT_uint16_t Start;
+ TT_uint16_t End;
+ TT_uint16_t Class;
+ TClassRangeRecord(): Start(0), End(0), Class(0) {}
+ private:
+ TClassRangeRecord(const TClassRangeRecord&);
+ TClassRangeRecord& operator=(const TClassRangeRecord&);
+ };
+ struct TClassDefFormat2: public TClassDefFormatBase {
+ TT_uint16_t ClassRangeCount;
+ struct TClassRangeRecord *ClassRangeRecord;
+ TClassDefFormat2(): ClassRangeCount(0), ClassRangeRecord(NULL)
+ {
+ ClassFormat = 2;
+ }
+ ~TClassDefFormat2()
+ {
+ if(ClassRangeRecord) {
+ delete[] ClassRangeRecord;
+ }
+ }
+ private:
+ TClassDefFormat2(const TClassDefFormat2&);
+ TClassDefFormat2& operator=(const TClassDefFormat2&);
+ };
+ struct TDevice {
+ TT_uint16_t StartSize;
+ TT_uint16_t EndSize;
+ TT_uint16_t DeltaFormat;
+ TDevice(): StartSize(0), EndSize(0), DeltaFormat(0) {}
+ private:
+ TDevice(const TDevice&);
+ TDevice& operator=(const TDevice&);
+ };
+ struct TSubTableBase {
+ TT_uint16_t SubstFormat;
+ TSubTableBase(): SubstFormat(0) {}
+ virtual ~TSubTableBase() {}
+ private:
+ TSubTableBase(const TSubTableBase&);
+ TSubTableBase& operator=(const TSubTableBase&);
+ };
+ struct TSingleSubstFormat1: public TSubTableBase {
+ TCoverageFormatBase *Coverage;
+ TT_int16_t DeltaGlyphID;
+ TSingleSubstFormat1(): DeltaGlyphID(0), Coverage(NULL)
+ {
+ SubstFormat = 1;
+ }
+ ~TSingleSubstFormat1()
+ {
+ if(Coverage) {
+ delete Coverage;
+ }
+ }
+ private:
+ TSingleSubstFormat1(const TSingleSubstFormat1&);
+ TSingleSubstFormat1& operator=(const TSingleSubstFormat1&);
+ };
+ struct TSingleSubstFormat2: public TSubTableBase {
+ TCoverageFormatBase *Coverage;
+ TT_uint16_t GlyphCount;
+ TT_uint16_t *Substitute;
+ TSingleSubstFormat2(): Coverage(NULL), GlyphCount(0), Substitute(NULL)
+ {
+ SubstFormat = 2;
+ }
+ ~TSingleSubstFormat2()
+ {
+ if(Coverage) {
+ delete Coverage;
+ }
+ if(Substitute) {
+ delete[] Substitute;
+ }
+ }
+ private:
+ TSingleSubstFormat2(const TSingleSubstFormat2&);
+ TSingleSubstFormat2& operator=(const TSingleSubstFormat2&);
+ };
+ struct TLookup {
+ TT_uint16_t LookupType;
+ TT_uint16_t LookupFlag;
+ TT_uint16_t SubTableCount;
+ struct TSubTableBase **SubTable;
+ TLookup(): LookupType(0), LookupFlag(0), SubTableCount(0), SubTable(NULL) {}
+ ~TLookup()
+ {
+ if(SubTableCount > 0 && SubTable != NULL) {
+ for(int i = 0; i < SubTableCount; i++) {
+ delete SubTable[i];
+ }
+ delete[] SubTable;
+ }
+ }
+ private:
+ TLookup(const TLookup&);
+ TLookup& operator=(const TLookup&);
+ };
+ struct TLookupList {
+ int LookupCount;
+ struct TLookup *Lookup;
+ TLookupList(): LookupCount(0), Lookup(NULL) {}
+ ~TLookupList()
+ {
+ if(Lookup) {
+ delete[] Lookup;
+ }
+ }
+ private:
+ TLookupList(const TLookupList&);
+ TLookupList& operator=(const TLookupList&);
+ };
+ bool Parse(
+ FT_Bytes scriptlist,
+ FT_Bytes featurelist,
+ FT_Bytes lookuplist);
+ void ParseScriptList(FT_Bytes raw, TScriptList *rec);
+ void ParseScript(FT_Bytes raw, TScript *rec);
+ void ParseLangSys(FT_Bytes raw, TLangSys *rec);
+ void ParseFeatureList(FT_Bytes raw, TFeatureList *rec);
+ void ParseFeature(FT_Bytes raw, TFeature *rec);
+ void ParseLookupList(FT_Bytes raw, TLookupList *rec);
+ void ParseLookup(FT_Bytes raw, TLookup *rec);
+ void ParseCoverage(FT_Bytes raw, TCoverageFormatBase **rec);
+ void ParseCoverageFormat1(FT_Bytes raw, TCoverageFormat1 *rec);
+ void ParseCoverageFormat2(FT_Bytes raw, TCoverageFormat2 *rec);
+ void ParseSingleSubst(FT_Bytes raw, TSubTableBase **rec);
+ void ParseSingleSubstFormat1(FT_Bytes raw, TSingleSubstFormat1 *rec);
+ void ParseSingleSubstFormat2(FT_Bytes raw, TSingleSubstFormat2 *rec);
+ bool GetVerticalGlyphSub(
+ TT_uint32_t glyphnum,
+ TT_uint32_t *vglyphnum,
+ struct TFeature *Feature);
+ bool GetVerticalGlyphSub2(
+ TT_uint32_t glyphnum,
+ TT_uint32_t *vglyphnum,
+ struct TLookup *Lookup);
+ int GetCoverageIndex(struct TCoverageFormatBase *Coverage, TT_uint32_t g);
+ TT_uint8_t GetUInt8(FT_Bytes& p) const
+ {
+ TT_uint8_t ret = p[0];
+ p += 1;
+ return ret;
+ }
+ TT_int16_t GetInt16(FT_Bytes& p) const
+ {
+ TT_uint16_t ret = p[0] << 8 | p[1];
+ p += 2;
+ return *(TT_int16_t*)&ret;
+ }
+ TT_uint16_t GetUInt16(FT_Bytes& p) const
+ {
+ TT_uint16_t ret = p[0] << 8 | p[1];
+ p += 2;
+ return ret;
+ }
+ TT_int32_t GetInt32(FT_Bytes& p) const
+ {
+ TT_uint32_t ret = p[0] << 24 | p[1] << 16 | p[2] << 8 | p[3];
+ p += 4;
+ return *(TT_int32_t*)&ret;
+ }
+ TT_uint32_t GetUInt32(FT_Bytes& p) const
+ {
+ TT_uint32_t ret = p[0] << 24 | p[1] << 16 | p[2] << 8 | p[3];
+ p += 4;
+ return ret;
+ }
+ CFX_CMapDWordToDWord m_featureMap;
+ FX_BOOL m_bFeautureMapLoad;
+ bool loaded;
+ struct tt_gsub_header header;
+ struct TScriptList ScriptList;
+ struct TFeatureList FeatureList;
+ struct TLookupList LookupList;
+};
+class CFX_GSUBTable : public IFX_GSUBTable, public CFX_Object
+{
+public:
+ virtual void Release()
+ {
+ delete this;
+ }
+ virtual FX_BOOL GetVerticalGlyph(FX_DWORD glyphnum, FX_DWORD* vglyphnum);
+ CFX_CTTGSUBTable m_GsubImp;
+};
+#endif
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page.cpp
index 232e5619a7..3cfb93e4bc 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page.cpp
@@ -1,1047 +1,1047 @@
-// 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
-
-#include "../../../include/fpdfapi/fpdf_page.h"
-#include "../../../include/fpdfapi/fpdf_module.h"
-#include "pageint.h"
-void CPDF_PageObject::Release()
-{
- delete this;
-}
-CPDF_PageObject* CPDF_PageObject::Create(int type)
-{
- switch (type) {
- case PDFPAGE_TEXT:
- return FX_NEW CPDF_TextObject;
- case PDFPAGE_IMAGE:
- return FX_NEW CPDF_ImageObject;
- case PDFPAGE_PATH:
- return FX_NEW CPDF_PathObject;
- case PDFPAGE_SHADING:
- return FX_NEW CPDF_ShadingObject;
- case PDFPAGE_FORM:
- return FX_NEW CPDF_FormObject;
- }
- return NULL;
-}
-CPDF_PageObject* CPDF_PageObject::Clone() const
-{
- CPDF_PageObject* pObj = Create(m_Type);
- pObj->Copy(this);
- return pObj;
-}
-void CPDF_PageObject::Copy(const CPDF_PageObject* pSrc)
-{
- if (m_Type != pSrc->m_Type) {
- return;
- }
- CopyData(pSrc);
- CopyStates(*pSrc);
- m_Left = pSrc->m_Left;
- m_Right = pSrc->m_Right;
- m_Top = pSrc->m_Top;
- m_Bottom = pSrc->m_Bottom;
-}
-void CPDF_PageObject::AppendClipPath(CPDF_Path path, int type, FX_BOOL bAutoMerge)
-{
- m_ClipPath.AppendPath(path, type, bAutoMerge);
-}
-void CPDF_PageObject::CopyClipPath(CPDF_PageObject* pObj)
-{
- m_ClipPath = pObj->m_ClipPath;
-}
-void CPDF_PageObject::RemoveClipPath()
-{
- m_ClipPath.SetNull();
-}
-void CPDF_PageObject::RecalcBBox()
-{
- switch (m_Type) {
- case PDFPAGE_TEXT:
- ((CPDF_TextObject*)this)->RecalcPositionData();
- break;
- case PDFPAGE_PATH:
- ((CPDF_PathObject*)this)->CalcBoundingBox();
- break;
- case PDFPAGE_SHADING:
- ((CPDF_ShadingObject*)this)->CalcBoundingBox();
- break;
- }
-}
-void CPDF_PageObject::TransformClipPath(CFX_AffineMatrix& matrix)
-{
- if (m_ClipPath.IsNull()) {
- return;
- }
- m_ClipPath.GetModify();
- m_ClipPath.Transform(matrix);
-}
-void CPDF_PageObject::TransformGeneralState(CFX_AffineMatrix& matrix)
-{
- if(m_GeneralState.IsNull()) {
- return;
- }
- CPDF_GeneralStateData* pGS = m_GeneralState.GetModify();
- pGS->m_Matrix.Concat(matrix);
-}
-FX_RECT CPDF_PageObject::GetBBox(const CFX_AffineMatrix* pMatrix) const
-{
- CFX_FloatRect rect(m_Left, m_Bottom, m_Right, m_Top);
- if (pMatrix) {
- pMatrix->TransformRect(rect);
- }
- return rect.GetOutterRect();
-}
-CPDF_TextObject::CPDF_TextObject()
-{
- m_Type = PDFPAGE_TEXT;
- m_pCharCodes = NULL;
- m_pCharPos = NULL;
- m_nChars = 0;
- m_PosX = m_PosY = 0;
-}
-CPDF_TextObject::~CPDF_TextObject()
-{
- if (m_nChars > 1 && m_pCharCodes) {
- FX_Free(m_pCharCodes);
- }
- if (m_pCharPos) {
- FX_Free(m_pCharPos);
- }
-}
-void CPDF_TextObject::GetItemInfo(int index, CPDF_TextObjectItem* pInfo) const
-{
- pInfo->m_CharCode = m_nChars == 1 ? (FX_DWORD)(FX_UINTPTR)m_pCharCodes : m_pCharCodes[index];
- pInfo->m_OriginX = index ? m_pCharPos[index - 1] : 0;
- pInfo->m_OriginY = 0;
- if (pInfo->m_CharCode == -1) {
- return;
- }
- CPDF_Font* pFont = m_TextState.GetFont();
- if (pFont->GetFontType() != PDFFONT_CIDFONT) {
- return;
- }
- if (!((CPDF_CIDFont*)pFont)->IsVertWriting()) {
- return;
- }
- FX_WORD CID = ((CPDF_CIDFont*)pFont)->CIDFromCharCode(pInfo->m_CharCode);
- pInfo->m_OriginY = pInfo->m_OriginX;
- pInfo->m_OriginX = 0;
- short vx, vy;
- ((CPDF_CIDFont*)pFont)->GetVertOrigin(CID, vx, vy);
- FX_FLOAT fontsize = m_TextState.GetFontSize();
- pInfo->m_OriginX -= fontsize * vx / 1000;
- pInfo->m_OriginY -= fontsize * vy / 1000;
-}
-int CPDF_TextObject::CountChars() const
-{
- if (m_nChars == 1) {
- return 1;
- }
- int count = 0;
- for (int i = 0; i < m_nChars; i ++)
- if (m_pCharCodes[i] != (FX_DWORD) - 1) {
- count ++;
- }
- return count;
-}
-void CPDF_TextObject::GetCharInfo(int index, FX_DWORD& charcode, FX_FLOAT& kerning) const
-{
- if (m_nChars == 1) {
- charcode = (FX_DWORD)(FX_UINTPTR)m_pCharCodes;
- kerning = 0;
- return;
- }
- int count = 0;
- for (int i = 0; i < m_nChars; i ++) {
- if (m_pCharCodes[i] != (FX_DWORD) - 1) {
- if (count == index) {
- charcode = m_pCharCodes[i];
- if (i == m_nChars - 1 || m_pCharCodes[i + 1] != (FX_DWORD) - 1) {
- kerning = 0;
- } else {
- kerning = m_pCharPos[i];
- }
- return;
- }
- count ++;
- }
- }
-}
-void CPDF_TextObject::GetCharInfo(int index, CPDF_TextObjectItem* pInfo) const
-{
- if (m_nChars == 1) {
- GetItemInfo(0, pInfo);
- return;
- }
- int count = 0;
- for (int i = 0; i < m_nChars; i ++) {
- FX_DWORD charcode = m_pCharCodes[i];
- if (charcode == (FX_DWORD) - 1) {
- continue;
- }
- if (count == index) {
- GetItemInfo(i, pInfo);
- break;
- }
- count ++;
- }
-}
-void CPDF_TextObject::CopyData(const CPDF_PageObject* pSrc)
-{
- const CPDF_TextObject* pSrcObj = (const CPDF_TextObject*)pSrc;
- if (m_nChars > 1 && m_pCharCodes) {
- FX_Free(m_pCharCodes);
- m_pCharCodes = NULL;
- }
- if (m_pCharPos) {
- FX_Free(m_pCharPos);
- m_pCharPos = NULL;
- }
- m_nChars = pSrcObj->m_nChars;
- if (m_nChars > 1) {
- m_pCharCodes = FX_Alloc(FX_DWORD, m_nChars);
- m_pCharPos = FX_Alloc(FX_FLOAT, m_nChars - 1);
- int i;
- for (i = 0; i < m_nChars; i ++) {
- m_pCharCodes[i] = pSrcObj->m_pCharCodes[i];
- }
- for (i = 0; i < m_nChars - 1; i ++) {
- m_pCharPos[i] = pSrcObj->m_pCharPos[i];
- }
- } else {
- m_pCharCodes = pSrcObj->m_pCharCodes;
- }
- m_PosX = pSrcObj->m_PosX;
- m_PosY = pSrcObj->m_PosY;
-}
-void CPDF_TextObject::GetTextMatrix(CFX_AffineMatrix* pMatrix) const
-{
- FX_FLOAT* pTextMatrix = m_TextState.GetMatrix();
- pMatrix->Set(pTextMatrix[0], pTextMatrix[2], pTextMatrix[1], pTextMatrix[3], m_PosX, m_PosY);
-}
-void CPDF_TextObject::SetSegments(const CFX_ByteString* pStrs, FX_FLOAT* pKerning, int nsegs)
-{
- if (m_nChars > 1 && m_pCharCodes) {
- FX_Free(m_pCharCodes);
- m_pCharCodes = NULL;
- }
- if (m_pCharPos) {
- FX_Free(m_pCharPos);
- m_pCharPos = NULL;
- }
- CPDF_Font* pFont = m_TextState.GetFont();
- m_nChars = 0;
- for (int i = 0; i < nsegs; i ++) {
- m_nChars += pFont->CountChar(pStrs[i], pStrs[i].GetLength());
- }
- m_nChars += nsegs - 1;
- if (m_nChars > 1) {
- m_pCharCodes = FX_Alloc(FX_DWORD, m_nChars);
- m_pCharPos = FX_Alloc(FX_FLOAT, m_nChars - 1);
- int index = 0;
- for (int i = 0; i < nsegs; i ++) {
- FX_LPCSTR segment = pStrs[i];
- int offset = 0, len = pStrs[i].GetLength();
- while (offset < len) {
- m_pCharCodes[index++] = pFont->GetNextChar(segment, offset);
- }
- if (i != nsegs - 1) {
- m_pCharPos[index - 1] = pKerning[i];
- m_pCharCodes[index ++] = (FX_DWORD) - 1;
- }
- }
- } else {
- int offset = 0;
- m_pCharCodes = (FX_DWORD*)(FX_UINTPTR)pFont->GetNextChar(pStrs[0], offset);
- }
-}
-void CPDF_TextObject::SetText(const CFX_ByteString& str)
-{
- SetSegments(&str, NULL, 1);
- RecalcPositionData();
-}
-void CPDF_TextObject::SetEmpty()
-{
- if (m_nChars > 1 && m_pCharCodes) {
- FX_Free(m_pCharCodes);
- }
- if (m_nChars > 1 && m_pCharPos) {
- FX_Free(m_pCharPos);
- }
- m_nChars = 0;
- m_pCharCodes = NULL;
- m_pCharPos = NULL;
- m_Left = m_Right = m_PosX;
- m_Top = m_Bottom = m_PosY;
-}
-void CPDF_TextObject::SetText(CFX_ByteString* pStrs, FX_FLOAT* pKerning, int nSegs)
-{
- SetSegments(pStrs, pKerning, nSegs);
- RecalcPositionData();
-}
-void CPDF_TextObject::SetText(int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pKernings)
-{
- if (m_nChars > 1 && m_pCharCodes) {
- FX_Free(m_pCharCodes);
- m_pCharCodes = NULL;
- }
- if (m_pCharPos) {
- FX_Free(m_pCharPos);
- m_pCharPos = NULL;
- }
- int nKernings = 0;
- int i;
- for (i = 0; i < nChars - 1; i ++)
- if (pKernings[i] != 0) {
- nKernings ++;
- }
- m_nChars = nChars + nKernings;
- if (m_nChars > 1) {
- m_pCharCodes = FX_Alloc(FX_DWORD, m_nChars);
- m_pCharPos = FX_Alloc(FX_FLOAT, m_nChars - 1);
- int index = 0;
- for (int i = 0; i < nChars; i ++) {
- m_pCharCodes[index++] = pCharCodes[i];
- if (pKernings[i] != 0 && i != nChars - 1) {
- m_pCharCodes[index] = (FX_DWORD) - 1;
- m_pCharPos[index - 1] = pKernings[i];
- index ++;
- }
- }
- } else {
- int offset = 0;
- m_pCharCodes = (FX_DWORD*)(FX_UINTPTR)pCharCodes[0];
- }
- RecalcPositionData();
-}
-FX_FLOAT CPDF_TextObject::GetCharWidth(FX_DWORD charcode) const
-{
- FX_FLOAT fontsize = m_TextState.GetFontSize() / 1000;
- CPDF_Font* pFont = m_TextState.GetFont();
- FX_BOOL bVertWriting = FALSE;
- CPDF_CIDFont* pCIDFont = pFont->GetCIDFont();
- if (pCIDFont) {
- bVertWriting = pCIDFont->IsVertWriting();
- }
- if (!bVertWriting) {
- return pFont->GetCharWidthF(charcode, 0) * fontsize;
- } else {
- FX_WORD CID = pCIDFont->CIDFromCharCode(charcode);
- return pCIDFont->GetVertWidth(CID) * fontsize;
- }
-}
-FX_FLOAT CPDF_TextObject::GetSpaceCharWidth() const
-{
- CPDF_Font* pFont = m_TextState.GetFont();
- FX_DWORD charCode = m_TextState.GetFont()->CharCodeFromUnicode(32);
- if (charCode != (FX_DWORD) - 1) {
- return GetCharWidth(charCode);
- }
- FX_FLOAT fontSize = m_TextState.GetFontSize() / 4000.0f;
- FX_BOOL bVertWriting = FALSE;
- CPDF_CIDFont* pCIDFont = pFont->GetCIDFont();
- if (pCIDFont) {
- bVertWriting = pCIDFont->IsVertWriting();
- }
- FX_RECT fontRect;
- pFont->GetFontBBox(fontRect);
- fontSize *= bVertWriting ? (FX_FLOAT)fontRect.Height() : (FX_FLOAT)fontRect.Width();
- return fontSize;
-}
-void CPDF_TextObject::GetCharRect(int index, CFX_FloatRect& rect) const
-{
- FX_FLOAT curpos = 0;
- CPDF_Font* pFont = m_TextState.GetFont();
- FX_BOOL bVertWriting = FALSE;
- CPDF_CIDFont* pCIDFont = pFont->GetCIDFont();
- if (pCIDFont) {
- bVertWriting = pCIDFont->IsVertWriting();
- }
- FX_FLOAT fontsize = m_TextState.GetFontSize() / 1000;
- int count = 0;
- for (int i = 0; i < m_nChars; i ++) {
- FX_DWORD charcode = m_nChars == 1 ? (FX_DWORD)(FX_UINTPTR)m_pCharCodes : m_pCharCodes[i];
- if (charcode == (FX_DWORD) - 1) {
- continue;
- }
- if( count != index) {
- count++;
- continue;
- }
- FX_FLOAT curpos = i > 0 ? m_pCharPos[i - 1] : 0;
- FX_RECT char_rect;
- pFont->GetCharBBox(charcode, char_rect, 0);
- if (!bVertWriting) {
- rect.left = curpos + char_rect.left * fontsize;
- rect.right = curpos + char_rect.right * fontsize;
- rect.top = char_rect.top * fontsize;
- rect.bottom = char_rect.bottom * fontsize;
- } else {
- FX_WORD CID = pCIDFont->CIDFromCharCode(charcode);
- short vx, vy;
- pCIDFont->GetVertOrigin(CID, vx, vy);
- char_rect.left -= vx;
- char_rect.right -= vx;
- char_rect.top -= vy;
- char_rect.bottom -= vy;
- rect.left = char_rect.left * fontsize;
- rect.right = char_rect.right * fontsize;
- rect.top = curpos + char_rect.top * fontsize;
- rect.bottom = curpos + char_rect.bottom * fontsize;
- }
- return;
- }
-}
-void CPDF_TextObject::CalcPositionData(FX_FLOAT* pTextAdvanceX, FX_FLOAT* pTextAdvanceY, FX_FLOAT horz_scale, int level)
-{
- FX_FLOAT curpos = 0;
- FX_FLOAT min_x = 10000 * 1.0f, max_x = -10000 * 1.0f, min_y = 10000 * 1.0f, max_y = -10000 * 1.0f;
- CPDF_Font* pFont = m_TextState.GetFont();
- FX_BOOL bVertWriting = FALSE;
- CPDF_CIDFont* pCIDFont = pFont->GetCIDFont();
- if (pCIDFont) {
- bVertWriting = pCIDFont->IsVertWriting();
- }
- FX_FLOAT fontsize = m_TextState.GetFontSize();
- for (int i = 0; i < m_nChars; i ++) {
- FX_DWORD charcode = m_nChars == 1 ? (FX_DWORD)(FX_UINTPTR)m_pCharCodes : m_pCharCodes[i];
- if (charcode == (FX_DWORD) - 1) {
- curpos -= FXSYS_Mul(m_pCharPos[i - 1], fontsize) / 1000;
- continue;
- }
- if (i) {
- m_pCharPos[i - 1] = curpos;
- }
- FX_RECT char_rect;
- pFont->GetCharBBox(charcode, char_rect, level);
- FX_FLOAT charwidth;
- if (!bVertWriting) {
- if (min_y > char_rect.top) {
- min_y = (FX_FLOAT)char_rect.top;
- }
- if (max_y < char_rect.top) {
- max_y = (FX_FLOAT)char_rect.top;
- }
- if (min_y > char_rect.bottom) {
- min_y = (FX_FLOAT)char_rect.bottom;
- }
- if (max_y < char_rect.bottom) {
- max_y = (FX_FLOAT)char_rect.bottom;
- }
- FX_FLOAT char_left = curpos + char_rect.left * fontsize / 1000;
- FX_FLOAT char_right = curpos + char_rect.right * fontsize / 1000;
- if (min_x > char_left) {
- min_x = char_left;
- }
- if (max_x < char_left) {
- max_x = char_left;
- }
- if (min_x > char_right) {
- min_x = char_right;
- }
- if (max_x < char_right) {
- max_x = char_right;
- }
- charwidth = pFont->GetCharWidthF(charcode, level) * fontsize / 1000;
- } else {
- FX_WORD CID = pCIDFont->CIDFromCharCode(charcode);
- short vx, vy;
- pCIDFont->GetVertOrigin(CID, vx, vy);
- char_rect.left -= vx;
- char_rect.right -= vx;
- char_rect.top -= vy;
- char_rect.bottom -= vy;
- if (min_x > char_rect.left) {
- min_x = (FX_FLOAT)char_rect.left;
- }
- if (max_x < char_rect.left) {
- max_x = (FX_FLOAT)char_rect.left;
- }
- if (min_x > char_rect.right) {
- min_x = (FX_FLOAT)char_rect.right;
- }
- if (max_x < char_rect.right) {
- max_x = (FX_FLOAT)char_rect.right;
- }
- FX_FLOAT char_top = curpos + char_rect.top * fontsize / 1000;
- FX_FLOAT char_bottom = curpos + char_rect.bottom * fontsize / 1000;
- if (min_y > char_top) {
- min_y = char_top;
- }
- if (max_y < char_top) {
- max_y = char_top;
- }
- if (min_y > char_bottom) {
- min_y = char_bottom;
- }
- if (max_y < char_bottom) {
- max_y = char_bottom;
- }
- charwidth = pCIDFont->GetVertWidth(CID) * fontsize / 1000;
- }
- curpos += charwidth;
- if (charcode == ' ' && (pCIDFont == NULL || pCIDFont->GetCharSize(32) == 1)) {
- curpos += m_TextState.GetObject()->m_WordSpace;
- }
- curpos += m_TextState.GetObject()->m_CharSpace;
- }
- if (bVertWriting) {
- if (pTextAdvanceX) {
- *pTextAdvanceX = 0;
- }
- if (pTextAdvanceY) {
- *pTextAdvanceY = curpos;
- }
- min_x = min_x * fontsize / 1000;
- max_x = max_x * fontsize / 1000;
- } else {
- if (pTextAdvanceX) {
- *pTextAdvanceX = FXSYS_Mul(curpos, horz_scale);
- }
- if (pTextAdvanceY) {
- *pTextAdvanceY = 0;
- }
- min_y = min_y * fontsize / 1000;
- max_y = max_y * fontsize / 1000;
- }
- CFX_AffineMatrix matrix;
- GetTextMatrix(&matrix);
- m_Left = min_x;
- m_Right = max_x;
- m_Bottom = min_y;
- m_Top = max_y;
- matrix.TransformRect(m_Left, m_Right, m_Top, m_Bottom);
- int textmode = m_TextState.GetObject()->m_TextMode;
- if (textmode == 1 || textmode == 2 || textmode == 5 || textmode == 6) {
- FX_FLOAT half_width = m_GraphState.GetObject()->m_LineWidth / 2;
- m_Left -= half_width;
- m_Right += half_width;
- m_Top += half_width;
- m_Bottom -= half_width;
- }
-}
-void CPDF_TextObject::CalcCharPos(FX_FLOAT* pPosArray) const
-{
- FX_FLOAT curpos = 0;
- int count = 0;
- CPDF_Font* pFont = m_TextState.GetFont();
- FX_BOOL bVertWriting = FALSE;
- CPDF_CIDFont* pCIDFont = pFont->GetCIDFont();
- if (pCIDFont) {
- bVertWriting = pCIDFont->IsVertWriting();
- }
- FX_FLOAT fontsize = m_TextState.GetFontSize();
- int index = 0;
- for (int i = 0; i < m_nChars; i ++) {
- FX_DWORD charcode = m_nChars == 1 ? (FX_DWORD)(FX_UINTPTR)m_pCharCodes : m_pCharCodes[i];
- if (charcode == (FX_DWORD) - 1) {
- continue;
- }
- pPosArray[index++] = i ? m_pCharPos[i - 1] : 0;
- FX_FLOAT charwidth;
- if (bVertWriting) {
- FX_WORD CID = pCIDFont->CIDFromCharCode(charcode);
- charwidth = pCIDFont->GetVertWidth(CID) * fontsize / 1000;
- } else {
- charwidth = pFont->GetCharWidthF(charcode) * fontsize / 1000;
- }
- pPosArray[index] = pPosArray[index - 1] + charwidth;
- index++;
- }
-}
-void CPDF_TextObject::Transform(const CFX_AffineMatrix& matrix)
-{
- m_TextState.GetModify();
- CFX_AffineMatrix text_matrix;
- GetTextMatrix(&text_matrix);
- text_matrix.Concat(matrix);
- FX_FLOAT* pTextMatrix = m_TextState.GetMatrix();
- pTextMatrix[0] = text_matrix.GetA();
- pTextMatrix[1] = text_matrix.GetC();
- pTextMatrix[2] = text_matrix.GetB();
- pTextMatrix[3] = text_matrix.GetD();
- m_PosX = text_matrix.GetE();
- m_PosY = text_matrix.GetF();
- CalcPositionData(NULL, NULL, 0);
-}
-void CPDF_TextObject::SetPosition(FX_FLOAT x, FX_FLOAT y)
-{
- FX_FLOAT dx = x - m_PosX;
- FX_FLOAT dy = y - m_PosY;
- m_PosX = x;
- m_PosY = y;
- m_Left += dx;
- m_Right += dx;
- m_Top += dy;
- m_Bottom += dy;
-}
-void CPDF_TextObject::SetData(int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pCharPos, FX_FLOAT x, FX_FLOAT y)
-{
- ASSERT(m_nChars == 0);
- m_nChars = nChars;
- m_PosX = x;
- m_PosY = y;
- if (nChars == 0) {
- return;
- }
- if (nChars == 1) {
- m_pCharCodes = (FX_DWORD*)(FX_UINTPTR) * pCharCodes;
- } else {
- m_pCharCodes = FX_Alloc(FX_DWORD, nChars);
- FXSYS_memcpy32(m_pCharCodes, pCharCodes, sizeof(FX_DWORD)*nChars);
- m_pCharPos = FX_Alloc(FX_FLOAT, nChars - 1);
- FXSYS_memcpy32(m_pCharPos, pCharPos, sizeof(FX_FLOAT) * (nChars - 1));
- }
- RecalcPositionData();
-}
-void CPDF_TextObject::SetTextState(CPDF_TextState TextState)
-{
- m_TextState = TextState;
- CalcPositionData(NULL, NULL, 0);
-}
-CPDF_ShadingObject::CPDF_ShadingObject()
-{
- m_pShading = NULL;
- m_Type = PDFPAGE_SHADING;
-}
-CPDF_ShadingObject::~CPDF_ShadingObject()
-{
- CPDF_ShadingPattern* pShading = m_pShading;
- if (pShading && pShading->m_pDocument) {
- pShading->m_pDocument->GetPageData()->ReleasePattern(pShading->m_pShadingObj);
- }
-}
-void CPDF_ShadingObject::CopyData(const CPDF_PageObject* pSrc)
-{
- CPDF_ShadingObject* pSrcObj = (CPDF_ShadingObject*)pSrc;
- m_pShading = pSrcObj->m_pShading;
- if (m_pShading && m_pShading->m_pDocument) {
- CPDF_DocPageData* pDocPageData = m_pShading->m_pDocument->GetPageData();
- m_pShading = (CPDF_ShadingPattern*)pDocPageData->GetPattern(m_pShading->m_pShadingObj, m_pShading->m_bShadingObj, &m_pShading->m_ParentMatrix);
- }
- m_Matrix = pSrcObj->m_Matrix;
-}
-void CPDF_ShadingObject::Transform(const CFX_AffineMatrix& matrix)
-{
- if (!m_ClipPath.IsNull()) {
- m_ClipPath.GetModify();
- m_ClipPath.Transform(matrix);
- }
- m_Matrix.Concat(matrix);
- if (!m_ClipPath.IsNull()) {
- CalcBoundingBox();
- } else {
- matrix.TransformRect(m_Left, m_Right, m_Top, m_Bottom);
- }
-}
-void CPDF_ShadingObject::CalcBoundingBox()
-{
- if (m_ClipPath.IsNull()) {
- return;
- }
- CFX_FloatRect rect = m_ClipPath.GetClipBox();
- m_Left = rect.left;
- m_Bottom = rect.bottom;
- m_Right = rect.right;
- m_Top = rect.top;
-}
-CPDF_FormObject::~CPDF_FormObject()
-{
- if (m_pForm) {
- delete m_pForm;
- }
-}
-void CPDF_FormObject::Transform(const CFX_AffineMatrix& matrix)
-{
- m_FormMatrix.Concat(matrix);
- CalcBoundingBox();
-}
-void CPDF_FormObject::CopyData(const CPDF_PageObject* pSrc)
-{
- const CPDF_FormObject* pSrcObj = (const CPDF_FormObject*)pSrc;
- if (m_pForm) {
- delete m_pForm;
- }
- m_pForm = pSrcObj->m_pForm->Clone();
- m_FormMatrix = pSrcObj->m_FormMatrix;
-}
-void CPDF_FormObject::CalcBoundingBox()
-{
- CFX_FloatRect form_rect = m_pForm->CalcBoundingBox();
- form_rect.Transform(&m_FormMatrix);
- m_Left = form_rect.left;
- m_Bottom = form_rect.bottom;
- m_Right = form_rect.right;
- m_Top = form_rect.top;
-}
-CPDF_PageObjects::CPDF_PageObjects(FX_BOOL bReleaseMembers) : m_ObjectList(128)
-{
- m_bBackgroundAlphaNeeded = FALSE;
- m_bReleaseMembers = bReleaseMembers;
- m_ParseState = PDF_CONTENT_NOT_PARSED;
- m_pParser = NULL;
- m_pFormStream = NULL;
- m_pResources = NULL;
-}
-CPDF_PageObjects::~CPDF_PageObjects()
-{
- if (m_pParser) {
- delete m_pParser;
- }
- if (!m_bReleaseMembers) {
- return;
- }
- FX_POSITION pos = m_ObjectList.GetHeadPosition();
- while (pos) {
- CPDF_PageObject* pPageObj = (CPDF_PageObject*)m_ObjectList.GetNext(pos);
- if (!pPageObj) {
- continue;
- }
- pPageObj->Release();
- }
-}
-void CPDF_PageObjects::ContinueParse(IFX_Pause* pPause)
-{
- if (m_pParser == NULL) {
- return;
- }
- m_pParser->Continue(pPause);
- if (m_pParser->GetStatus() == CPDF_ContentParser::Done) {
- m_ParseState = PDF_CONTENT_PARSED;
- delete m_pParser;
- m_pParser = NULL;
- }
-}
-int CPDF_PageObjects::EstimateParseProgress() const
-{
- if (m_pParser == NULL) {
- return m_ParseState == PDF_CONTENT_PARSED ? 100 : 0;
- }
- return m_pParser->EstimateProgress();
-}
-FX_POSITION CPDF_PageObjects::InsertObject(FX_POSITION posInsertAfter, CPDF_PageObject* pNewObject)
-{
- if (posInsertAfter == NULL) {
- return m_ObjectList.AddHead(pNewObject);
- } else {
- return m_ObjectList.InsertAfter(posInsertAfter, pNewObject);
- }
-}
-int CPDF_PageObjects::GetObjectIndex(CPDF_PageObject* pObj) const
-{
- int index = 0;
- FX_POSITION pos = m_ObjectList.GetHeadPosition();
- while (pos) {
- CPDF_PageObject* pThisObj = (CPDF_PageObject*)m_ObjectList.GetNext(pos);
- if (pThisObj == pObj) {
- return index;
- }
- index ++;
- }
- return -1;
-}
-CPDF_PageObject* CPDF_PageObjects::GetObjectByIndex(int index) const
-{
- FX_POSITION pos = m_ObjectList.FindIndex(index);
- if (pos == NULL) {
- return NULL;
- }
- return (CPDF_PageObject*)m_ObjectList.GetAt(pos);
-}
-void CPDF_PageObjects::Transform(const CFX_AffineMatrix& matrix)
-{
- FX_POSITION pos = m_ObjectList.GetHeadPosition();
- while (pos) {
- CPDF_PageObject* pObj = (CPDF_PageObject*)m_ObjectList.GetNext(pos);
- pObj->Transform(matrix);
- }
-}
-CFX_FloatRect CPDF_PageObjects::CalcBoundingBox() const
-{
- if (m_ObjectList.GetCount() == 0) {
- return CFX_FloatRect(0, 0, 0, 0);
- }
- FX_FLOAT left, right, top, bottom;
- left = bottom = 1000000 * 1.0f;
- right = top = -1000000 * 1.0f;
- FX_POSITION pos = m_ObjectList.GetHeadPosition();
- while (pos) {
- CPDF_PageObject* pObj = (CPDF_PageObject*)m_ObjectList.GetNext(pos);
- if (left > pObj->m_Left) {
- left = pObj->m_Left;
- }
- if (right < pObj->m_Right) {
- right = pObj->m_Right;
- }
- if (top < pObj->m_Top) {
- top = pObj->m_Top;
- }
- if (bottom > pObj->m_Bottom) {
- bottom = pObj->m_Bottom;
- }
- }
- return CFX_FloatRect(left, bottom, right, top);
-}
-void CPDF_PageObjects::LoadTransInfo()
-{
- if (m_pFormDict == NULL) {
- return;
- }
- CPDF_Dictionary* pGroup = m_pFormDict->GetDict(FX_BSTRC("Group"));
- if (pGroup == NULL) {
- return;
- }
- if (pGroup->GetString(FX_BSTRC("S")) != FX_BSTRC("Transparency")) {
- return;
- }
- m_Transparency |= PDFTRANS_GROUP;
- if (pGroup->GetInteger(FX_BSTRC("I"))) {
- m_Transparency |= PDFTRANS_ISOLATED;
- }
- if (pGroup->GetInteger(FX_BSTRC("K"))) {
- m_Transparency |= PDFTRANS_KNOCKOUT;
- }
-}
-void CPDF_PageObjects::ClearCacheObjects()
-{
- m_ParseState = PDF_CONTENT_NOT_PARSED;
- if (m_pParser) {
- delete m_pParser;
- }
- m_pParser = NULL;
- if (m_bReleaseMembers) {
- FX_POSITION pos = m_ObjectList.GetHeadPosition();
- while (pos) {
- CPDF_PageObject* pPageObj = (CPDF_PageObject*)m_ObjectList.GetNext(pos);
- if (!pPageObj) {
- continue;
- }
- pPageObj->Release();
- }
- }
- m_ObjectList.RemoveAll();
-}
-CPDF_Page::CPDF_Page()
-{
- m_pPageRender = NULL;
-}
-void CPDF_Page::Load(CPDF_Document* pDocument, CPDF_Dictionary* pPageDict, FX_BOOL bPageCache)
-{
- m_pDocument = (CPDF_Document*)pDocument;
- m_pFormDict = pPageDict;
- if (bPageCache) {
- m_pPageRender = CPDF_ModuleMgr::Get()->GetRenderModule()->CreatePageCache(this);
- }
- if (pPageDict == NULL) {
- m_PageWidth = m_PageHeight = 100 * 1.0f;
- m_pPageResources = m_pResources = NULL;
- return;
- }
- m_pResources = GetPageAttr(FX_BSTRC("Resources"))->GetDict();
- m_pPageResources = m_pResources;
- CPDF_Object* pRotate = GetPageAttr(FX_BSTRC("Rotate"));
- int rotate = 0;
- if (pRotate) {
- rotate = pRotate->GetInteger() / 90 % 4;
- }
- if (rotate < 0) {
- rotate += 4;
- }
- CPDF_Array* pMediaBox, *pCropBox;
- pMediaBox = (CPDF_Array*)GetPageAttr(FX_BSTRC("MediaBox"));
- CFX_FloatRect mediabox;
- if (pMediaBox) {
- mediabox = pMediaBox->GetRect();
- mediabox.Normalize();
- }
- if (mediabox.IsEmpty()) {
- mediabox = CFX_FloatRect(0, 0, 612, 792);
- }
- pCropBox = (CPDF_Array*)GetPageAttr(FX_BSTRC("CropBox"));
- if (pCropBox) {
- m_BBox = pCropBox->GetRect();
- m_BBox.Normalize();
- }
- if (m_BBox.IsEmpty()) {
- m_BBox = mediabox;
- } else {
- m_BBox.Intersect(mediabox);
- }
- if (rotate % 2) {
- m_PageHeight = m_BBox.right - m_BBox.left;
- m_PageWidth = m_BBox.top - m_BBox.bottom;
- } else {
- m_PageWidth = m_BBox.right - m_BBox.left;
- m_PageHeight = m_BBox.top - m_BBox.bottom;
- }
- switch (rotate) {
- case 0:
- m_PageMatrix.Set(1.0f, 0, 0, 1.0f, -m_BBox.left, -m_BBox.bottom);
- break;
- case 1:
- m_PageMatrix.Set(0, -1.0f, 1.0f, 0, -m_BBox.bottom, m_BBox.right);
- break;
- case 2:
- m_PageMatrix.Set(-1.0f, 0, 0, -1.0f, m_BBox.right, m_BBox.top);
- break;
- case 3:
- m_PageMatrix.Set(0, 1.0f, -1.0f, 0, m_BBox.top, -m_BBox.left);
- break;
- }
- m_Transparency = PDFTRANS_ISOLATED;
- LoadTransInfo();
-}
-void CPDF_Page::StartParse(CPDF_ParseOptions* pOptions, FX_BOOL bReParse)
-{
- if (bReParse) {
- ClearCacheObjects();
- }
- if (m_ParseState == PDF_CONTENT_PARSED || m_ParseState == PDF_CONTENT_PARSING) {
- return;
- }
- m_pParser = FX_NEW CPDF_ContentParser;
- m_pParser->Start(this, pOptions);
- m_ParseState = PDF_CONTENT_PARSING;
-}
-void CPDF_Page::ParseContent(CPDF_ParseOptions* pOptions, FX_BOOL bReParse)
-{
- StartParse(pOptions, bReParse);
- ContinueParse(NULL);
-}
-CPDF_Page::~CPDF_Page()
-{
- if (m_pPageRender) {
- CPDF_RenderModuleDef* pModule = CPDF_ModuleMgr::Get()->GetRenderModule();
- pModule->DestroyPageCache(m_pPageRender);
- }
-}
-CPDF_Object* FPDFAPI_GetPageAttr(CPDF_Dictionary* pPageDict, FX_BSTR name)
-{
- int level = 0;
- while (1) {
- CPDF_Object* pObj = pPageDict->GetElementValue(name);
- if (pObj) {
- return pObj;
- }
- CPDF_Dictionary* pParent = pPageDict->GetDict(FX_BSTRC("Parent"));
- if (!pParent || pParent == pPageDict) {
- return NULL;
- }
- pPageDict = pParent;
- level ++;
- if (level == 1000) {
- return NULL;
- }
- }
-}
-CPDF_Object* CPDF_Page::GetPageAttr(FX_BSTR name) const
-{
- return FPDFAPI_GetPageAttr(m_pFormDict, name);
-}
-CPDF_Form::CPDF_Form(CPDF_Document* pDoc, CPDF_Dictionary* pPageResources, CPDF_Stream* pFormStream, CPDF_Dictionary* pParentResources)
-{
- m_pDocument = pDoc;
- m_pFormStream = pFormStream;
- m_pFormDict = pFormStream->GetDict();
- m_pResources = m_pFormDict->GetDict(FX_BSTRC("Resources"));
- m_pPageResources = pPageResources;
- if (m_pResources == NULL) {
- m_pResources = pParentResources;
- }
- if (m_pResources == NULL) {
- m_pResources = pPageResources;
- }
- m_Transparency = 0;
- LoadTransInfo();
-}
-CPDF_Form::~CPDF_Form()
-{
-}
-void CPDF_Form::StartParse(CPDF_AllStates* pGraphicStates, CFX_AffineMatrix* pParentMatrix,
- CPDF_Type3Char* pType3Char, CPDF_ParseOptions* pOptions, int level)
-{
- if (m_ParseState == PDF_CONTENT_PARSED || m_ParseState == PDF_CONTENT_PARSING) {
- return;
- }
- m_pParser = FX_NEW CPDF_ContentParser;
- m_pParser->Start(this, pGraphicStates, pParentMatrix, pType3Char, pOptions, level);
- m_ParseState = PDF_CONTENT_PARSING;
-}
-void CPDF_Form::ParseContent(CPDF_AllStates* pGraphicStates, CFX_AffineMatrix* pParentMatrix,
- CPDF_Type3Char* pType3Char, CPDF_ParseOptions* pOptions, int level)
-{
- StartParse(pGraphicStates, pParentMatrix, pType3Char, pOptions, level);
- ContinueParse(NULL);
-}
-CPDF_Form* CPDF_Form::Clone() const
-{
- CPDF_Form* pClone = FX_NEW CPDF_Form(m_pDocument, m_pPageResources, m_pFormStream, m_pResources);
- FX_POSITION pos = m_ObjectList.GetHeadPosition();
- while (pos) {
- CPDF_PageObject* pObj = (CPDF_PageObject*)m_ObjectList.GetNext(pos);
- pClone->m_ObjectList.AddTail(pObj->Clone());
- }
- return pClone;
-}
-void CPDF_Page::GetDisplayMatrix(CFX_AffineMatrix& matrix, int xPos, int yPos,
- int xSize, int ySize, int iRotate) const
-{
- if (m_PageWidth == 0 || m_PageHeight == 0) {
- return;
- }
- CFX_AffineMatrix display_matrix;
- int x0, y0, x1, y1, x2, y2;
- iRotate %= 4;
- switch (iRotate) {
- case 0:
- x0 = xPos;
- y0 = yPos + ySize;
- x1 = xPos;
- y1 = yPos;
- x2 = xPos + xSize;
- y2 = yPos + ySize;
- break;
- case 1:
- x0 = xPos;
- y0 = yPos;
- x1 = xPos + xSize;
- y1 = yPos;
- x2 = xPos;
- y2 = yPos + ySize;
- break;
- case 2:
- x0 = xPos + xSize;
- y0 = yPos;
- x1 = xPos + xSize;
- y1 = yPos + ySize;
- x2 = xPos;
- y2 = yPos;
- break;
- case 3:
- x0 = xPos + xSize;
- y0 = yPos + ySize;
- x1 = xPos;
- y1 = yPos + ySize;
- x2 = xPos + xSize;
- y2 = yPos;
- break;
- }
- display_matrix.Set(FXSYS_Div((FX_FLOAT)(x2 - x0), m_PageWidth),
- FXSYS_Div((FX_FLOAT)(y2 - y0), m_PageWidth),
- FXSYS_Div((FX_FLOAT)(x1 - x0), m_PageHeight),
- FXSYS_Div((FX_FLOAT)(y1 - y0), m_PageHeight),
- (FX_FLOAT)x0, (FX_FLOAT)y0);
- matrix = m_PageMatrix;
- matrix.Concat(display_matrix);
-}
-CPDF_ParseOptions::CPDF_ParseOptions()
-{
- m_bTextOnly = FALSE;
- m_bMarkedContent = TRUE;
- m_bSeparateForm = TRUE;
- m_bDecodeInlineImage = FALSE;
-}
+// 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
+
+#include "../../../include/fpdfapi/fpdf_page.h"
+#include "../../../include/fpdfapi/fpdf_module.h"
+#include "pageint.h"
+void CPDF_PageObject::Release()
+{
+ delete this;
+}
+CPDF_PageObject* CPDF_PageObject::Create(int type)
+{
+ switch (type) {
+ case PDFPAGE_TEXT:
+ return FX_NEW CPDF_TextObject;
+ case PDFPAGE_IMAGE:
+ return FX_NEW CPDF_ImageObject;
+ case PDFPAGE_PATH:
+ return FX_NEW CPDF_PathObject;
+ case PDFPAGE_SHADING:
+ return FX_NEW CPDF_ShadingObject;
+ case PDFPAGE_FORM:
+ return FX_NEW CPDF_FormObject;
+ }
+ return NULL;
+}
+CPDF_PageObject* CPDF_PageObject::Clone() const
+{
+ CPDF_PageObject* pObj = Create(m_Type);
+ pObj->Copy(this);
+ return pObj;
+}
+void CPDF_PageObject::Copy(const CPDF_PageObject* pSrc)
+{
+ if (m_Type != pSrc->m_Type) {
+ return;
+ }
+ CopyData(pSrc);
+ CopyStates(*pSrc);
+ m_Left = pSrc->m_Left;
+ m_Right = pSrc->m_Right;
+ m_Top = pSrc->m_Top;
+ m_Bottom = pSrc->m_Bottom;
+}
+void CPDF_PageObject::AppendClipPath(CPDF_Path path, int type, FX_BOOL bAutoMerge)
+{
+ m_ClipPath.AppendPath(path, type, bAutoMerge);
+}
+void CPDF_PageObject::CopyClipPath(CPDF_PageObject* pObj)
+{
+ m_ClipPath = pObj->m_ClipPath;
+}
+void CPDF_PageObject::RemoveClipPath()
+{
+ m_ClipPath.SetNull();
+}
+void CPDF_PageObject::RecalcBBox()
+{
+ switch (m_Type) {
+ case PDFPAGE_TEXT:
+ ((CPDF_TextObject*)this)->RecalcPositionData();
+ break;
+ case PDFPAGE_PATH:
+ ((CPDF_PathObject*)this)->CalcBoundingBox();
+ break;
+ case PDFPAGE_SHADING:
+ ((CPDF_ShadingObject*)this)->CalcBoundingBox();
+ break;
+ }
+}
+void CPDF_PageObject::TransformClipPath(CFX_AffineMatrix& matrix)
+{
+ if (m_ClipPath.IsNull()) {
+ return;
+ }
+ m_ClipPath.GetModify();
+ m_ClipPath.Transform(matrix);
+}
+void CPDF_PageObject::TransformGeneralState(CFX_AffineMatrix& matrix)
+{
+ if(m_GeneralState.IsNull()) {
+ return;
+ }
+ CPDF_GeneralStateData* pGS = m_GeneralState.GetModify();
+ pGS->m_Matrix.Concat(matrix);
+}
+FX_RECT CPDF_PageObject::GetBBox(const CFX_AffineMatrix* pMatrix) const
+{
+ CFX_FloatRect rect(m_Left, m_Bottom, m_Right, m_Top);
+ if (pMatrix) {
+ pMatrix->TransformRect(rect);
+ }
+ return rect.GetOutterRect();
+}
+CPDF_TextObject::CPDF_TextObject()
+{
+ m_Type = PDFPAGE_TEXT;
+ m_pCharCodes = NULL;
+ m_pCharPos = NULL;
+ m_nChars = 0;
+ m_PosX = m_PosY = 0;
+}
+CPDF_TextObject::~CPDF_TextObject()
+{
+ if (m_nChars > 1 && m_pCharCodes) {
+ FX_Free(m_pCharCodes);
+ }
+ if (m_pCharPos) {
+ FX_Free(m_pCharPos);
+ }
+}
+void CPDF_TextObject::GetItemInfo(int index, CPDF_TextObjectItem* pInfo) const
+{
+ pInfo->m_CharCode = m_nChars == 1 ? (FX_DWORD)(FX_UINTPTR)m_pCharCodes : m_pCharCodes[index];
+ pInfo->m_OriginX = index ? m_pCharPos[index - 1] : 0;
+ pInfo->m_OriginY = 0;
+ if (pInfo->m_CharCode == -1) {
+ return;
+ }
+ CPDF_Font* pFont = m_TextState.GetFont();
+ if (pFont->GetFontType() != PDFFONT_CIDFONT) {
+ return;
+ }
+ if (!((CPDF_CIDFont*)pFont)->IsVertWriting()) {
+ return;
+ }
+ FX_WORD CID = ((CPDF_CIDFont*)pFont)->CIDFromCharCode(pInfo->m_CharCode);
+ pInfo->m_OriginY = pInfo->m_OriginX;
+ pInfo->m_OriginX = 0;
+ short vx, vy;
+ ((CPDF_CIDFont*)pFont)->GetVertOrigin(CID, vx, vy);
+ FX_FLOAT fontsize = m_TextState.GetFontSize();
+ pInfo->m_OriginX -= fontsize * vx / 1000;
+ pInfo->m_OriginY -= fontsize * vy / 1000;
+}
+int CPDF_TextObject::CountChars() const
+{
+ if (m_nChars == 1) {
+ return 1;
+ }
+ int count = 0;
+ for (int i = 0; i < m_nChars; i ++)
+ if (m_pCharCodes[i] != (FX_DWORD) - 1) {
+ count ++;
+ }
+ return count;
+}
+void CPDF_TextObject::GetCharInfo(int index, FX_DWORD& charcode, FX_FLOAT& kerning) const
+{
+ if (m_nChars == 1) {
+ charcode = (FX_DWORD)(FX_UINTPTR)m_pCharCodes;
+ kerning = 0;
+ return;
+ }
+ int count = 0;
+ for (int i = 0; i < m_nChars; i ++) {
+ if (m_pCharCodes[i] != (FX_DWORD) - 1) {
+ if (count == index) {
+ charcode = m_pCharCodes[i];
+ if (i == m_nChars - 1 || m_pCharCodes[i + 1] != (FX_DWORD) - 1) {
+ kerning = 0;
+ } else {
+ kerning = m_pCharPos[i];
+ }
+ return;
+ }
+ count ++;
+ }
+ }
+}
+void CPDF_TextObject::GetCharInfo(int index, CPDF_TextObjectItem* pInfo) const
+{
+ if (m_nChars == 1) {
+ GetItemInfo(0, pInfo);
+ return;
+ }
+ int count = 0;
+ for (int i = 0; i < m_nChars; i ++) {
+ FX_DWORD charcode = m_pCharCodes[i];
+ if (charcode == (FX_DWORD) - 1) {
+ continue;
+ }
+ if (count == index) {
+ GetItemInfo(i, pInfo);
+ break;
+ }
+ count ++;
+ }
+}
+void CPDF_TextObject::CopyData(const CPDF_PageObject* pSrc)
+{
+ const CPDF_TextObject* pSrcObj = (const CPDF_TextObject*)pSrc;
+ if (m_nChars > 1 && m_pCharCodes) {
+ FX_Free(m_pCharCodes);
+ m_pCharCodes = NULL;
+ }
+ if (m_pCharPos) {
+ FX_Free(m_pCharPos);
+ m_pCharPos = NULL;
+ }
+ m_nChars = pSrcObj->m_nChars;
+ if (m_nChars > 1) {
+ m_pCharCodes = FX_Alloc(FX_DWORD, m_nChars);
+ m_pCharPos = FX_Alloc(FX_FLOAT, m_nChars - 1);
+ int i;
+ for (i = 0; i < m_nChars; i ++) {
+ m_pCharCodes[i] = pSrcObj->m_pCharCodes[i];
+ }
+ for (i = 0; i < m_nChars - 1; i ++) {
+ m_pCharPos[i] = pSrcObj->m_pCharPos[i];
+ }
+ } else {
+ m_pCharCodes = pSrcObj->m_pCharCodes;
+ }
+ m_PosX = pSrcObj->m_PosX;
+ m_PosY = pSrcObj->m_PosY;
+}
+void CPDF_TextObject::GetTextMatrix(CFX_AffineMatrix* pMatrix) const
+{
+ FX_FLOAT* pTextMatrix = m_TextState.GetMatrix();
+ pMatrix->Set(pTextMatrix[0], pTextMatrix[2], pTextMatrix[1], pTextMatrix[3], m_PosX, m_PosY);
+}
+void CPDF_TextObject::SetSegments(const CFX_ByteString* pStrs, FX_FLOAT* pKerning, int nsegs)
+{
+ if (m_nChars > 1 && m_pCharCodes) {
+ FX_Free(m_pCharCodes);
+ m_pCharCodes = NULL;
+ }
+ if (m_pCharPos) {
+ FX_Free(m_pCharPos);
+ m_pCharPos = NULL;
+ }
+ CPDF_Font* pFont = m_TextState.GetFont();
+ m_nChars = 0;
+ for (int i = 0; i < nsegs; i ++) {
+ m_nChars += pFont->CountChar(pStrs[i], pStrs[i].GetLength());
+ }
+ m_nChars += nsegs - 1;
+ if (m_nChars > 1) {
+ m_pCharCodes = FX_Alloc(FX_DWORD, m_nChars);
+ m_pCharPos = FX_Alloc(FX_FLOAT, m_nChars - 1);
+ int index = 0;
+ for (int i = 0; i < nsegs; i ++) {
+ FX_LPCSTR segment = pStrs[i];
+ int offset = 0, len = pStrs[i].GetLength();
+ while (offset < len) {
+ m_pCharCodes[index++] = pFont->GetNextChar(segment, offset);
+ }
+ if (i != nsegs - 1) {
+ m_pCharPos[index - 1] = pKerning[i];
+ m_pCharCodes[index ++] = (FX_DWORD) - 1;
+ }
+ }
+ } else {
+ int offset = 0;
+ m_pCharCodes = (FX_DWORD*)(FX_UINTPTR)pFont->GetNextChar(pStrs[0], offset);
+ }
+}
+void CPDF_TextObject::SetText(const CFX_ByteString& str)
+{
+ SetSegments(&str, NULL, 1);
+ RecalcPositionData();
+}
+void CPDF_TextObject::SetEmpty()
+{
+ if (m_nChars > 1 && m_pCharCodes) {
+ FX_Free(m_pCharCodes);
+ }
+ if (m_nChars > 1 && m_pCharPos) {
+ FX_Free(m_pCharPos);
+ }
+ m_nChars = 0;
+ m_pCharCodes = NULL;
+ m_pCharPos = NULL;
+ m_Left = m_Right = m_PosX;
+ m_Top = m_Bottom = m_PosY;
+}
+void CPDF_TextObject::SetText(CFX_ByteString* pStrs, FX_FLOAT* pKerning, int nSegs)
+{
+ SetSegments(pStrs, pKerning, nSegs);
+ RecalcPositionData();
+}
+void CPDF_TextObject::SetText(int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pKernings)
+{
+ if (m_nChars > 1 && m_pCharCodes) {
+ FX_Free(m_pCharCodes);
+ m_pCharCodes = NULL;
+ }
+ if (m_pCharPos) {
+ FX_Free(m_pCharPos);
+ m_pCharPos = NULL;
+ }
+ int nKernings = 0;
+ int i;
+ for (i = 0; i < nChars - 1; i ++)
+ if (pKernings[i] != 0) {
+ nKernings ++;
+ }
+ m_nChars = nChars + nKernings;
+ if (m_nChars > 1) {
+ m_pCharCodes = FX_Alloc(FX_DWORD, m_nChars);
+ m_pCharPos = FX_Alloc(FX_FLOAT, m_nChars - 1);
+ int index = 0;
+ for (int i = 0; i < nChars; i ++) {
+ m_pCharCodes[index++] = pCharCodes[i];
+ if (pKernings[i] != 0 && i != nChars - 1) {
+ m_pCharCodes[index] = (FX_DWORD) - 1;
+ m_pCharPos[index - 1] = pKernings[i];
+ index ++;
+ }
+ }
+ } else {
+ int offset = 0;
+ m_pCharCodes = (FX_DWORD*)(FX_UINTPTR)pCharCodes[0];
+ }
+ RecalcPositionData();
+}
+FX_FLOAT CPDF_TextObject::GetCharWidth(FX_DWORD charcode) const
+{
+ FX_FLOAT fontsize = m_TextState.GetFontSize() / 1000;
+ CPDF_Font* pFont = m_TextState.GetFont();
+ FX_BOOL bVertWriting = FALSE;
+ CPDF_CIDFont* pCIDFont = pFont->GetCIDFont();
+ if (pCIDFont) {
+ bVertWriting = pCIDFont->IsVertWriting();
+ }
+ if (!bVertWriting) {
+ return pFont->GetCharWidthF(charcode, 0) * fontsize;
+ } else {
+ FX_WORD CID = pCIDFont->CIDFromCharCode(charcode);
+ return pCIDFont->GetVertWidth(CID) * fontsize;
+ }
+}
+FX_FLOAT CPDF_TextObject::GetSpaceCharWidth() const
+{
+ CPDF_Font* pFont = m_TextState.GetFont();
+ FX_DWORD charCode = m_TextState.GetFont()->CharCodeFromUnicode(32);
+ if (charCode != (FX_DWORD) - 1) {
+ return GetCharWidth(charCode);
+ }
+ FX_FLOAT fontSize = m_TextState.GetFontSize() / 4000.0f;
+ FX_BOOL bVertWriting = FALSE;
+ CPDF_CIDFont* pCIDFont = pFont->GetCIDFont();
+ if (pCIDFont) {
+ bVertWriting = pCIDFont->IsVertWriting();
+ }
+ FX_RECT fontRect;
+ pFont->GetFontBBox(fontRect);
+ fontSize *= bVertWriting ? (FX_FLOAT)fontRect.Height() : (FX_FLOAT)fontRect.Width();
+ return fontSize;
+}
+void CPDF_TextObject::GetCharRect(int index, CFX_FloatRect& rect) const
+{
+ FX_FLOAT curpos = 0;
+ CPDF_Font* pFont = m_TextState.GetFont();
+ FX_BOOL bVertWriting = FALSE;
+ CPDF_CIDFont* pCIDFont = pFont->GetCIDFont();
+ if (pCIDFont) {
+ bVertWriting = pCIDFont->IsVertWriting();
+ }
+ FX_FLOAT fontsize = m_TextState.GetFontSize() / 1000;
+ int count = 0;
+ for (int i = 0; i < m_nChars; i ++) {
+ FX_DWORD charcode = m_nChars == 1 ? (FX_DWORD)(FX_UINTPTR)m_pCharCodes : m_pCharCodes[i];
+ if (charcode == (FX_DWORD) - 1) {
+ continue;
+ }
+ if( count != index) {
+ count++;
+ continue;
+ }
+ FX_FLOAT curpos = i > 0 ? m_pCharPos[i - 1] : 0;
+ FX_RECT char_rect;
+ pFont->GetCharBBox(charcode, char_rect, 0);
+ if (!bVertWriting) {
+ rect.left = curpos + char_rect.left * fontsize;
+ rect.right = curpos + char_rect.right * fontsize;
+ rect.top = char_rect.top * fontsize;
+ rect.bottom = char_rect.bottom * fontsize;
+ } else {
+ FX_WORD CID = pCIDFont->CIDFromCharCode(charcode);
+ short vx, vy;
+ pCIDFont->GetVertOrigin(CID, vx, vy);
+ char_rect.left -= vx;
+ char_rect.right -= vx;
+ char_rect.top -= vy;
+ char_rect.bottom -= vy;
+ rect.left = char_rect.left * fontsize;
+ rect.right = char_rect.right * fontsize;
+ rect.top = curpos + char_rect.top * fontsize;
+ rect.bottom = curpos + char_rect.bottom * fontsize;
+ }
+ return;
+ }
+}
+void CPDF_TextObject::CalcPositionData(FX_FLOAT* pTextAdvanceX, FX_FLOAT* pTextAdvanceY, FX_FLOAT horz_scale, int level)
+{
+ FX_FLOAT curpos = 0;
+ FX_FLOAT min_x = 10000 * 1.0f, max_x = -10000 * 1.0f, min_y = 10000 * 1.0f, max_y = -10000 * 1.0f;
+ CPDF_Font* pFont = m_TextState.GetFont();
+ FX_BOOL bVertWriting = FALSE;
+ CPDF_CIDFont* pCIDFont = pFont->GetCIDFont();
+ if (pCIDFont) {
+ bVertWriting = pCIDFont->IsVertWriting();
+ }
+ FX_FLOAT fontsize = m_TextState.GetFontSize();
+ for (int i = 0; i < m_nChars; i ++) {
+ FX_DWORD charcode = m_nChars == 1 ? (FX_DWORD)(FX_UINTPTR)m_pCharCodes : m_pCharCodes[i];
+ if (charcode == (FX_DWORD) - 1) {
+ curpos -= FXSYS_Mul(m_pCharPos[i - 1], fontsize) / 1000;
+ continue;
+ }
+ if (i) {
+ m_pCharPos[i - 1] = curpos;
+ }
+ FX_RECT char_rect;
+ pFont->GetCharBBox(charcode, char_rect, level);
+ FX_FLOAT charwidth;
+ if (!bVertWriting) {
+ if (min_y > char_rect.top) {
+ min_y = (FX_FLOAT)char_rect.top;
+ }
+ if (max_y < char_rect.top) {
+ max_y = (FX_FLOAT)char_rect.top;
+ }
+ if (min_y > char_rect.bottom) {
+ min_y = (FX_FLOAT)char_rect.bottom;
+ }
+ if (max_y < char_rect.bottom) {
+ max_y = (FX_FLOAT)char_rect.bottom;
+ }
+ FX_FLOAT char_left = curpos + char_rect.left * fontsize / 1000;
+ FX_FLOAT char_right = curpos + char_rect.right * fontsize / 1000;
+ if (min_x > char_left) {
+ min_x = char_left;
+ }
+ if (max_x < char_left) {
+ max_x = char_left;
+ }
+ if (min_x > char_right) {
+ min_x = char_right;
+ }
+ if (max_x < char_right) {
+ max_x = char_right;
+ }
+ charwidth = pFont->GetCharWidthF(charcode, level) * fontsize / 1000;
+ } else {
+ FX_WORD CID = pCIDFont->CIDFromCharCode(charcode);
+ short vx, vy;
+ pCIDFont->GetVertOrigin(CID, vx, vy);
+ char_rect.left -= vx;
+ char_rect.right -= vx;
+ char_rect.top -= vy;
+ char_rect.bottom -= vy;
+ if (min_x > char_rect.left) {
+ min_x = (FX_FLOAT)char_rect.left;
+ }
+ if (max_x < char_rect.left) {
+ max_x = (FX_FLOAT)char_rect.left;
+ }
+ if (min_x > char_rect.right) {
+ min_x = (FX_FLOAT)char_rect.right;
+ }
+ if (max_x < char_rect.right) {
+ max_x = (FX_FLOAT)char_rect.right;
+ }
+ FX_FLOAT char_top = curpos + char_rect.top * fontsize / 1000;
+ FX_FLOAT char_bottom = curpos + char_rect.bottom * fontsize / 1000;
+ if (min_y > char_top) {
+ min_y = char_top;
+ }
+ if (max_y < char_top) {
+ max_y = char_top;
+ }
+ if (min_y > char_bottom) {
+ min_y = char_bottom;
+ }
+ if (max_y < char_bottom) {
+ max_y = char_bottom;
+ }
+ charwidth = pCIDFont->GetVertWidth(CID) * fontsize / 1000;
+ }
+ curpos += charwidth;
+ if (charcode == ' ' && (pCIDFont == NULL || pCIDFont->GetCharSize(32) == 1)) {
+ curpos += m_TextState.GetObject()->m_WordSpace;
+ }
+ curpos += m_TextState.GetObject()->m_CharSpace;
+ }
+ if (bVertWriting) {
+ if (pTextAdvanceX) {
+ *pTextAdvanceX = 0;
+ }
+ if (pTextAdvanceY) {
+ *pTextAdvanceY = curpos;
+ }
+ min_x = min_x * fontsize / 1000;
+ max_x = max_x * fontsize / 1000;
+ } else {
+ if (pTextAdvanceX) {
+ *pTextAdvanceX = FXSYS_Mul(curpos, horz_scale);
+ }
+ if (pTextAdvanceY) {
+ *pTextAdvanceY = 0;
+ }
+ min_y = min_y * fontsize / 1000;
+ max_y = max_y * fontsize / 1000;
+ }
+ CFX_AffineMatrix matrix;
+ GetTextMatrix(&matrix);
+ m_Left = min_x;
+ m_Right = max_x;
+ m_Bottom = min_y;
+ m_Top = max_y;
+ matrix.TransformRect(m_Left, m_Right, m_Top, m_Bottom);
+ int textmode = m_TextState.GetObject()->m_TextMode;
+ if (textmode == 1 || textmode == 2 || textmode == 5 || textmode == 6) {
+ FX_FLOAT half_width = m_GraphState.GetObject()->m_LineWidth / 2;
+ m_Left -= half_width;
+ m_Right += half_width;
+ m_Top += half_width;
+ m_Bottom -= half_width;
+ }
+}
+void CPDF_TextObject::CalcCharPos(FX_FLOAT* pPosArray) const
+{
+ FX_FLOAT curpos = 0;
+ int count = 0;
+ CPDF_Font* pFont = m_TextState.GetFont();
+ FX_BOOL bVertWriting = FALSE;
+ CPDF_CIDFont* pCIDFont = pFont->GetCIDFont();
+ if (pCIDFont) {
+ bVertWriting = pCIDFont->IsVertWriting();
+ }
+ FX_FLOAT fontsize = m_TextState.GetFontSize();
+ int index = 0;
+ for (int i = 0; i < m_nChars; i ++) {
+ FX_DWORD charcode = m_nChars == 1 ? (FX_DWORD)(FX_UINTPTR)m_pCharCodes : m_pCharCodes[i];
+ if (charcode == (FX_DWORD) - 1) {
+ continue;
+ }
+ pPosArray[index++] = i ? m_pCharPos[i - 1] : 0;
+ FX_FLOAT charwidth;
+ if (bVertWriting) {
+ FX_WORD CID = pCIDFont->CIDFromCharCode(charcode);
+ charwidth = pCIDFont->GetVertWidth(CID) * fontsize / 1000;
+ } else {
+ charwidth = pFont->GetCharWidthF(charcode) * fontsize / 1000;
+ }
+ pPosArray[index] = pPosArray[index - 1] + charwidth;
+ index++;
+ }
+}
+void CPDF_TextObject::Transform(const CFX_AffineMatrix& matrix)
+{
+ m_TextState.GetModify();
+ CFX_AffineMatrix text_matrix;
+ GetTextMatrix(&text_matrix);
+ text_matrix.Concat(matrix);
+ FX_FLOAT* pTextMatrix = m_TextState.GetMatrix();
+ pTextMatrix[0] = text_matrix.GetA();
+ pTextMatrix[1] = text_matrix.GetC();
+ pTextMatrix[2] = text_matrix.GetB();
+ pTextMatrix[3] = text_matrix.GetD();
+ m_PosX = text_matrix.GetE();
+ m_PosY = text_matrix.GetF();
+ CalcPositionData(NULL, NULL, 0);
+}
+void CPDF_TextObject::SetPosition(FX_FLOAT x, FX_FLOAT y)
+{
+ FX_FLOAT dx = x - m_PosX;
+ FX_FLOAT dy = y - m_PosY;
+ m_PosX = x;
+ m_PosY = y;
+ m_Left += dx;
+ m_Right += dx;
+ m_Top += dy;
+ m_Bottom += dy;
+}
+void CPDF_TextObject::SetData(int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pCharPos, FX_FLOAT x, FX_FLOAT y)
+{
+ ASSERT(m_nChars == 0);
+ m_nChars = nChars;
+ m_PosX = x;
+ m_PosY = y;
+ if (nChars == 0) {
+ return;
+ }
+ if (nChars == 1) {
+ m_pCharCodes = (FX_DWORD*)(FX_UINTPTR) * pCharCodes;
+ } else {
+ m_pCharCodes = FX_Alloc(FX_DWORD, nChars);
+ FXSYS_memcpy32(m_pCharCodes, pCharCodes, sizeof(FX_DWORD)*nChars);
+ m_pCharPos = FX_Alloc(FX_FLOAT, nChars - 1);
+ FXSYS_memcpy32(m_pCharPos, pCharPos, sizeof(FX_FLOAT) * (nChars - 1));
+ }
+ RecalcPositionData();
+}
+void CPDF_TextObject::SetTextState(CPDF_TextState TextState)
+{
+ m_TextState = TextState;
+ CalcPositionData(NULL, NULL, 0);
+}
+CPDF_ShadingObject::CPDF_ShadingObject()
+{
+ m_pShading = NULL;
+ m_Type = PDFPAGE_SHADING;
+}
+CPDF_ShadingObject::~CPDF_ShadingObject()
+{
+ CPDF_ShadingPattern* pShading = m_pShading;
+ if (pShading && pShading->m_pDocument) {
+ pShading->m_pDocument->GetPageData()->ReleasePattern(pShading->m_pShadingObj);
+ }
+}
+void CPDF_ShadingObject::CopyData(const CPDF_PageObject* pSrc)
+{
+ CPDF_ShadingObject* pSrcObj = (CPDF_ShadingObject*)pSrc;
+ m_pShading = pSrcObj->m_pShading;
+ if (m_pShading && m_pShading->m_pDocument) {
+ CPDF_DocPageData* pDocPageData = m_pShading->m_pDocument->GetPageData();
+ m_pShading = (CPDF_ShadingPattern*)pDocPageData->GetPattern(m_pShading->m_pShadingObj, m_pShading->m_bShadingObj, &m_pShading->m_ParentMatrix);
+ }
+ m_Matrix = pSrcObj->m_Matrix;
+}
+void CPDF_ShadingObject::Transform(const CFX_AffineMatrix& matrix)
+{
+ if (!m_ClipPath.IsNull()) {
+ m_ClipPath.GetModify();
+ m_ClipPath.Transform(matrix);
+ }
+ m_Matrix.Concat(matrix);
+ if (!m_ClipPath.IsNull()) {
+ CalcBoundingBox();
+ } else {
+ matrix.TransformRect(m_Left, m_Right, m_Top, m_Bottom);
+ }
+}
+void CPDF_ShadingObject::CalcBoundingBox()
+{
+ if (m_ClipPath.IsNull()) {
+ return;
+ }
+ CFX_FloatRect rect = m_ClipPath.GetClipBox();
+ m_Left = rect.left;
+ m_Bottom = rect.bottom;
+ m_Right = rect.right;
+ m_Top = rect.top;
+}
+CPDF_FormObject::~CPDF_FormObject()
+{
+ if (m_pForm) {
+ delete m_pForm;
+ }
+}
+void CPDF_FormObject::Transform(const CFX_AffineMatrix& matrix)
+{
+ m_FormMatrix.Concat(matrix);
+ CalcBoundingBox();
+}
+void CPDF_FormObject::CopyData(const CPDF_PageObject* pSrc)
+{
+ const CPDF_FormObject* pSrcObj = (const CPDF_FormObject*)pSrc;
+ if (m_pForm) {
+ delete m_pForm;
+ }
+ m_pForm = pSrcObj->m_pForm->Clone();
+ m_FormMatrix = pSrcObj->m_FormMatrix;
+}
+void CPDF_FormObject::CalcBoundingBox()
+{
+ CFX_FloatRect form_rect = m_pForm->CalcBoundingBox();
+ form_rect.Transform(&m_FormMatrix);
+ m_Left = form_rect.left;
+ m_Bottom = form_rect.bottom;
+ m_Right = form_rect.right;
+ m_Top = form_rect.top;
+}
+CPDF_PageObjects::CPDF_PageObjects(FX_BOOL bReleaseMembers) : m_ObjectList(128)
+{
+ m_bBackgroundAlphaNeeded = FALSE;
+ m_bReleaseMembers = bReleaseMembers;
+ m_ParseState = PDF_CONTENT_NOT_PARSED;
+ m_pParser = NULL;
+ m_pFormStream = NULL;
+ m_pResources = NULL;
+}
+CPDF_PageObjects::~CPDF_PageObjects()
+{
+ if (m_pParser) {
+ delete m_pParser;
+ }
+ if (!m_bReleaseMembers) {
+ return;
+ }
+ FX_POSITION pos = m_ObjectList.GetHeadPosition();
+ while (pos) {
+ CPDF_PageObject* pPageObj = (CPDF_PageObject*)m_ObjectList.GetNext(pos);
+ if (!pPageObj) {
+ continue;
+ }
+ pPageObj->Release();
+ }
+}
+void CPDF_PageObjects::ContinueParse(IFX_Pause* pPause)
+{
+ if (m_pParser == NULL) {
+ return;
+ }
+ m_pParser->Continue(pPause);
+ if (m_pParser->GetStatus() == CPDF_ContentParser::Done) {
+ m_ParseState = PDF_CONTENT_PARSED;
+ delete m_pParser;
+ m_pParser = NULL;
+ }
+}
+int CPDF_PageObjects::EstimateParseProgress() const
+{
+ if (m_pParser == NULL) {
+ return m_ParseState == PDF_CONTENT_PARSED ? 100 : 0;
+ }
+ return m_pParser->EstimateProgress();
+}
+FX_POSITION CPDF_PageObjects::InsertObject(FX_POSITION posInsertAfter, CPDF_PageObject* pNewObject)
+{
+ if (posInsertAfter == NULL) {
+ return m_ObjectList.AddHead(pNewObject);
+ } else {
+ return m_ObjectList.InsertAfter(posInsertAfter, pNewObject);
+ }
+}
+int CPDF_PageObjects::GetObjectIndex(CPDF_PageObject* pObj) const
+{
+ int index = 0;
+ FX_POSITION pos = m_ObjectList.GetHeadPosition();
+ while (pos) {
+ CPDF_PageObject* pThisObj = (CPDF_PageObject*)m_ObjectList.GetNext(pos);
+ if (pThisObj == pObj) {
+ return index;
+ }
+ index ++;
+ }
+ return -1;
+}
+CPDF_PageObject* CPDF_PageObjects::GetObjectByIndex(int index) const
+{
+ FX_POSITION pos = m_ObjectList.FindIndex(index);
+ if (pos == NULL) {
+ return NULL;
+ }
+ return (CPDF_PageObject*)m_ObjectList.GetAt(pos);
+}
+void CPDF_PageObjects::Transform(const CFX_AffineMatrix& matrix)
+{
+ FX_POSITION pos = m_ObjectList.GetHeadPosition();
+ while (pos) {
+ CPDF_PageObject* pObj = (CPDF_PageObject*)m_ObjectList.GetNext(pos);
+ pObj->Transform(matrix);
+ }
+}
+CFX_FloatRect CPDF_PageObjects::CalcBoundingBox() const
+{
+ if (m_ObjectList.GetCount() == 0) {
+ return CFX_FloatRect(0, 0, 0, 0);
+ }
+ FX_FLOAT left, right, top, bottom;
+ left = bottom = 1000000 * 1.0f;
+ right = top = -1000000 * 1.0f;
+ FX_POSITION pos = m_ObjectList.GetHeadPosition();
+ while (pos) {
+ CPDF_PageObject* pObj = (CPDF_PageObject*)m_ObjectList.GetNext(pos);
+ if (left > pObj->m_Left) {
+ left = pObj->m_Left;
+ }
+ if (right < pObj->m_Right) {
+ right = pObj->m_Right;
+ }
+ if (top < pObj->m_Top) {
+ top = pObj->m_Top;
+ }
+ if (bottom > pObj->m_Bottom) {
+ bottom = pObj->m_Bottom;
+ }
+ }
+ return CFX_FloatRect(left, bottom, right, top);
+}
+void CPDF_PageObjects::LoadTransInfo()
+{
+ if (m_pFormDict == NULL) {
+ return;
+ }
+ CPDF_Dictionary* pGroup = m_pFormDict->GetDict(FX_BSTRC("Group"));
+ if (pGroup == NULL) {
+ return;
+ }
+ if (pGroup->GetString(FX_BSTRC("S")) != FX_BSTRC("Transparency")) {
+ return;
+ }
+ m_Transparency |= PDFTRANS_GROUP;
+ if (pGroup->GetInteger(FX_BSTRC("I"))) {
+ m_Transparency |= PDFTRANS_ISOLATED;
+ }
+ if (pGroup->GetInteger(FX_BSTRC("K"))) {
+ m_Transparency |= PDFTRANS_KNOCKOUT;
+ }
+}
+void CPDF_PageObjects::ClearCacheObjects()
+{
+ m_ParseState = PDF_CONTENT_NOT_PARSED;
+ if (m_pParser) {
+ delete m_pParser;
+ }
+ m_pParser = NULL;
+ if (m_bReleaseMembers) {
+ FX_POSITION pos = m_ObjectList.GetHeadPosition();
+ while (pos) {
+ CPDF_PageObject* pPageObj = (CPDF_PageObject*)m_ObjectList.GetNext(pos);
+ if (!pPageObj) {
+ continue;
+ }
+ pPageObj->Release();
+ }
+ }
+ m_ObjectList.RemoveAll();
+}
+CPDF_Page::CPDF_Page()
+{
+ m_pPageRender = NULL;
+}
+void CPDF_Page::Load(CPDF_Document* pDocument, CPDF_Dictionary* pPageDict, FX_BOOL bPageCache)
+{
+ m_pDocument = (CPDF_Document*)pDocument;
+ m_pFormDict = pPageDict;
+ if (bPageCache) {
+ m_pPageRender = CPDF_ModuleMgr::Get()->GetRenderModule()->CreatePageCache(this);
+ }
+ if (pPageDict == NULL) {
+ m_PageWidth = m_PageHeight = 100 * 1.0f;
+ m_pPageResources = m_pResources = NULL;
+ return;
+ }
+ m_pResources = GetPageAttr(FX_BSTRC("Resources"))->GetDict();
+ m_pPageResources = m_pResources;
+ CPDF_Object* pRotate = GetPageAttr(FX_BSTRC("Rotate"));
+ int rotate = 0;
+ if (pRotate) {
+ rotate = pRotate->GetInteger() / 90 % 4;
+ }
+ if (rotate < 0) {
+ rotate += 4;
+ }
+ CPDF_Array* pMediaBox, *pCropBox;
+ pMediaBox = (CPDF_Array*)GetPageAttr(FX_BSTRC("MediaBox"));
+ CFX_FloatRect mediabox;
+ if (pMediaBox) {
+ mediabox = pMediaBox->GetRect();
+ mediabox.Normalize();
+ }
+ if (mediabox.IsEmpty()) {
+ mediabox = CFX_FloatRect(0, 0, 612, 792);
+ }
+ pCropBox = (CPDF_Array*)GetPageAttr(FX_BSTRC("CropBox"));
+ if (pCropBox) {
+ m_BBox = pCropBox->GetRect();
+ m_BBox.Normalize();
+ }
+ if (m_BBox.IsEmpty()) {
+ m_BBox = mediabox;
+ } else {
+ m_BBox.Intersect(mediabox);
+ }
+ if (rotate % 2) {
+ m_PageHeight = m_BBox.right - m_BBox.left;
+ m_PageWidth = m_BBox.top - m_BBox.bottom;
+ } else {
+ m_PageWidth = m_BBox.right - m_BBox.left;
+ m_PageHeight = m_BBox.top - m_BBox.bottom;
+ }
+ switch (rotate) {
+ case 0:
+ m_PageMatrix.Set(1.0f, 0, 0, 1.0f, -m_BBox.left, -m_BBox.bottom);
+ break;
+ case 1:
+ m_PageMatrix.Set(0, -1.0f, 1.0f, 0, -m_BBox.bottom, m_BBox.right);
+ break;
+ case 2:
+ m_PageMatrix.Set(-1.0f, 0, 0, -1.0f, m_BBox.right, m_BBox.top);
+ break;
+ case 3:
+ m_PageMatrix.Set(0, 1.0f, -1.0f, 0, m_BBox.top, -m_BBox.left);
+ break;
+ }
+ m_Transparency = PDFTRANS_ISOLATED;
+ LoadTransInfo();
+}
+void CPDF_Page::StartParse(CPDF_ParseOptions* pOptions, FX_BOOL bReParse)
+{
+ if (bReParse) {
+ ClearCacheObjects();
+ }
+ if (m_ParseState == PDF_CONTENT_PARSED || m_ParseState == PDF_CONTENT_PARSING) {
+ return;
+ }
+ m_pParser = FX_NEW CPDF_ContentParser;
+ m_pParser->Start(this, pOptions);
+ m_ParseState = PDF_CONTENT_PARSING;
+}
+void CPDF_Page::ParseContent(CPDF_ParseOptions* pOptions, FX_BOOL bReParse)
+{
+ StartParse(pOptions, bReParse);
+ ContinueParse(NULL);
+}
+CPDF_Page::~CPDF_Page()
+{
+ if (m_pPageRender) {
+ CPDF_RenderModuleDef* pModule = CPDF_ModuleMgr::Get()->GetRenderModule();
+ pModule->DestroyPageCache(m_pPageRender);
+ }
+}
+CPDF_Object* FPDFAPI_GetPageAttr(CPDF_Dictionary* pPageDict, FX_BSTR name)
+{
+ int level = 0;
+ while (1) {
+ CPDF_Object* pObj = pPageDict->GetElementValue(name);
+ if (pObj) {
+ return pObj;
+ }
+ CPDF_Dictionary* pParent = pPageDict->GetDict(FX_BSTRC("Parent"));
+ if (!pParent || pParent == pPageDict) {
+ return NULL;
+ }
+ pPageDict = pParent;
+ level ++;
+ if (level == 1000) {
+ return NULL;
+ }
+ }
+}
+CPDF_Object* CPDF_Page::GetPageAttr(FX_BSTR name) const
+{
+ return FPDFAPI_GetPageAttr(m_pFormDict, name);
+}
+CPDF_Form::CPDF_Form(CPDF_Document* pDoc, CPDF_Dictionary* pPageResources, CPDF_Stream* pFormStream, CPDF_Dictionary* pParentResources)
+{
+ m_pDocument = pDoc;
+ m_pFormStream = pFormStream;
+ m_pFormDict = pFormStream->GetDict();
+ m_pResources = m_pFormDict->GetDict(FX_BSTRC("Resources"));
+ m_pPageResources = pPageResources;
+ if (m_pResources == NULL) {
+ m_pResources = pParentResources;
+ }
+ if (m_pResources == NULL) {
+ m_pResources = pPageResources;
+ }
+ m_Transparency = 0;
+ LoadTransInfo();
+}
+CPDF_Form::~CPDF_Form()
+{
+}
+void CPDF_Form::StartParse(CPDF_AllStates* pGraphicStates, CFX_AffineMatrix* pParentMatrix,
+ CPDF_Type3Char* pType3Char, CPDF_ParseOptions* pOptions, int level)
+{
+ if (m_ParseState == PDF_CONTENT_PARSED || m_ParseState == PDF_CONTENT_PARSING) {
+ return;
+ }
+ m_pParser = FX_NEW CPDF_ContentParser;
+ m_pParser->Start(this, pGraphicStates, pParentMatrix, pType3Char, pOptions, level);
+ m_ParseState = PDF_CONTENT_PARSING;
+}
+void CPDF_Form::ParseContent(CPDF_AllStates* pGraphicStates, CFX_AffineMatrix* pParentMatrix,
+ CPDF_Type3Char* pType3Char, CPDF_ParseOptions* pOptions, int level)
+{
+ StartParse(pGraphicStates, pParentMatrix, pType3Char, pOptions, level);
+ ContinueParse(NULL);
+}
+CPDF_Form* CPDF_Form::Clone() const
+{
+ CPDF_Form* pClone = FX_NEW CPDF_Form(m_pDocument, m_pPageResources, m_pFormStream, m_pResources);
+ FX_POSITION pos = m_ObjectList.GetHeadPosition();
+ while (pos) {
+ CPDF_PageObject* pObj = (CPDF_PageObject*)m_ObjectList.GetNext(pos);
+ pClone->m_ObjectList.AddTail(pObj->Clone());
+ }
+ return pClone;
+}
+void CPDF_Page::GetDisplayMatrix(CFX_AffineMatrix& matrix, int xPos, int yPos,
+ int xSize, int ySize, int iRotate) const
+{
+ if (m_PageWidth == 0 || m_PageHeight == 0) {
+ return;
+ }
+ CFX_AffineMatrix display_matrix;
+ int x0, y0, x1, y1, x2, y2;
+ iRotate %= 4;
+ switch (iRotate) {
+ case 0:
+ x0 = xPos;
+ y0 = yPos + ySize;
+ x1 = xPos;
+ y1 = yPos;
+ x2 = xPos + xSize;
+ y2 = yPos + ySize;
+ break;
+ case 1:
+ x0 = xPos;
+ y0 = yPos;
+ x1 = xPos + xSize;
+ y1 = yPos;
+ x2 = xPos;
+ y2 = yPos + ySize;
+ break;
+ case 2:
+ x0 = xPos + xSize;
+ y0 = yPos;
+ x1 = xPos + xSize;
+ y1 = yPos + ySize;
+ x2 = xPos;
+ y2 = yPos;
+ break;
+ case 3:
+ x0 = xPos + xSize;
+ y0 = yPos + ySize;
+ x1 = xPos;
+ y1 = yPos + ySize;
+ x2 = xPos + xSize;
+ y2 = yPos;
+ break;
+ }
+ display_matrix.Set(FXSYS_Div((FX_FLOAT)(x2 - x0), m_PageWidth),
+ FXSYS_Div((FX_FLOAT)(y2 - y0), m_PageWidth),
+ FXSYS_Div((FX_FLOAT)(x1 - x0), m_PageHeight),
+ FXSYS_Div((FX_FLOAT)(y1 - y0), m_PageHeight),
+ (FX_FLOAT)x0, (FX_FLOAT)y0);
+ matrix = m_PageMatrix;
+ matrix.Concat(display_matrix);
+}
+CPDF_ParseOptions::CPDF_ParseOptions()
+{
+ m_bTextOnly = FALSE;
+ m_bMarkedContent = TRUE;
+ m_bSeparateForm = TRUE;
+ m_bDecodeInlineImage = FALSE;
+}
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp
index 44b4fc0b1d..8c274b2607 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp
@@ -1,1401 +1,1401 @@
-// 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
-
-#include "../../../include/fpdfapi/fpdf_page.h"
-#include "../../../include/fpdfapi/fpdf_module.h"
-#include "../../../include/fxcodec/fx_codec.h"
-#include "pageint.h"
-#include <limits.h>
-void sRGB_to_AdobeCMYK(FX_FLOAT R, FX_FLOAT G, FX_FLOAT B, FX_FLOAT& c, FX_FLOAT& m, FX_FLOAT& y, FX_FLOAT& k)
-{
- c = 1.0f - R;
- m = 1.0f - G;
- y = 1.0f - B;
- k = c;
- if (m < k) {
- k = m;
- }
- if (y < k) {
- k = y;
- }
-}
-CPDF_DeviceCS::CPDF_DeviceCS(int family)
-{
- m_Family = family;
- if (m_Family == PDFCS_DEVICERGB) {
- m_nComponents = 3;
- } else if (m_Family == PDFCS_DEVICEGRAY) {
- m_nComponents = 1;
- } else {
- m_nComponents = 4;
- }
-}
-FX_BOOL CPDF_DeviceCS::GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const
-{
- if (m_Family == PDFCS_DEVICERGB) {
- R = pBuf[0];
- if (R < 0) {
- R = 0;
- } else if (R > 1) {
- R = 1;
- }
- G = pBuf[1];
- if (G < 0) {
- G = 0;
- } else if (G > 1) {
- G = 1;
- }
- B = pBuf[2];
- if (B < 0) {
- B = 0;
- } else if (B > 1) {
- B = 1;
- }
- } else if (m_Family == PDFCS_DEVICEGRAY) {
- R = *pBuf;
- if (R < 0) {
- R = 0;
- } else if (R > 1) {
- R = 1;
- }
- G = B = R;
- } else if (m_Family == PDFCS_DEVICECMYK) {
- if (!m_dwStdConversion) {
- AdobeCMYK_to_sRGB(pBuf[0], pBuf[1], pBuf[2], pBuf[3], R, G, B);
- } else {
- FX_FLOAT k = pBuf[3];
- R = 1.0f - FX_MIN(1.0f, pBuf[0] + k);
- G = 1.0f - FX_MIN(1.0f, pBuf[1] + k);
- B = 1.0f - FX_MIN(1.0f, pBuf[2] + k);
- }
- } else {
- ASSERT(m_Family == PDFCS_PATTERN);
- R = G = B = 0;
- return FALSE;
- }
- return TRUE;
-}
-FX_BOOL CPDF_DeviceCS::v_GetCMYK(FX_FLOAT* pBuf, FX_FLOAT& c, FX_FLOAT& m, FX_FLOAT& y, FX_FLOAT& k) const
-{
- if (m_Family != PDFCS_DEVICECMYK) {
- return FALSE;
- }
- c = pBuf[0];
- m = pBuf[1];
- y = pBuf[2];
- k = pBuf[3];
- return TRUE;
-}
-FX_BOOL CPDF_DeviceCS::SetRGB(FX_FLOAT* pBuf, FX_FLOAT R, FX_FLOAT G, FX_FLOAT B) const
-{
- if (m_Family == PDFCS_DEVICERGB) {
- pBuf[0] = R;
- pBuf[1] = G;
- pBuf[2] = B;
- return TRUE;
- } else if (m_Family == PDFCS_DEVICEGRAY) {
- if (R == G && R == B) {
- *pBuf = R;
- return TRUE;
- } else {
- return FALSE;
- }
- } else if (m_Family == PDFCS_DEVICECMYK) {
- sRGB_to_AdobeCMYK(R, G, B, pBuf[0], pBuf[1], pBuf[2], pBuf[3]);
- return TRUE;
- }
- return FALSE;
-}
-FX_BOOL CPDF_DeviceCS::v_SetCMYK(FX_FLOAT* pBuf, FX_FLOAT c, FX_FLOAT m, FX_FLOAT y, FX_FLOAT k) const
-{
- if (m_Family == PDFCS_DEVICERGB) {
- AdobeCMYK_to_sRGB(c, m, y, k, pBuf[0], pBuf[1], pBuf[2]);
- return TRUE;
- } else if (m_Family == PDFCS_DEVICEGRAY) {
- return FALSE;
- } else if (m_Family == PDFCS_DEVICECMYK) {
- pBuf[0] = c;
- pBuf[1] = m;
- pBuf[2] = y;
- pBuf[3] = k;
- return TRUE;
- }
- return FALSE;
-}
-static void ReverseRGB(FX_LPBYTE pDestBuf, FX_LPCBYTE pSrcBuf, int pixels)
-{
- if (pDestBuf == pSrcBuf)
- for (int i = 0; i < pixels; i ++) {
- FX_BYTE temp = pDestBuf[2];
- pDestBuf[2] = pDestBuf[0];
- pDestBuf[0] = temp;
- pDestBuf += 3;
- }
- else
- for (int i = 0; i < pixels; i ++) {
- *pDestBuf ++ = pSrcBuf[2];
- *pDestBuf ++ = pSrcBuf[1];
- *pDestBuf ++ = pSrcBuf[0];
- pSrcBuf += 3;
- }
-}
-void CPDF_DeviceCS::TranslateImageLine(FX_LPBYTE pDestBuf, FX_LPCBYTE pSrcBuf, int pixels, int image_width, int image_height, FX_BOOL bTransMask) const
-{
- if (bTransMask && m_Family == PDFCS_DEVICECMYK) {
- for (int i = 0; i < pixels; i ++) {
- int k = 255 - pSrcBuf[3];
- pDestBuf[0] = ((255 - pSrcBuf[0]) * k) / 255;
- pDestBuf[1] = ((255 - pSrcBuf[1]) * k) / 255;
- pDestBuf[2] = ((255 - pSrcBuf[2]) * k) / 255;
- pDestBuf += 3;
- pSrcBuf += 4;
- }
- return;
- }
- if (m_Family == PDFCS_DEVICERGB) {
- ReverseRGB(pDestBuf, pSrcBuf, pixels);
- } else if (m_Family == PDFCS_DEVICEGRAY) {
- for (int i = 0; i < pixels; i ++) {
- *pDestBuf ++ = pSrcBuf[i];
- *pDestBuf ++ = pSrcBuf[i];
- *pDestBuf ++ = pSrcBuf[i];
- }
- } else {
- for (int i = 0; i < pixels; i ++) {
- if (!m_dwStdConversion) {
- AdobeCMYK_to_sRGB1(pSrcBuf[0], pSrcBuf[1], pSrcBuf[2], pSrcBuf[3], pDestBuf[2], pDestBuf[1], pDestBuf[0]);
- } else {
- FX_BYTE k = pSrcBuf[3];
- pDestBuf[2] = 255 - FX_MIN(255, pSrcBuf[0] + k);
- pDestBuf[1] = 255 - FX_MIN(255, pSrcBuf[1] + k);
- pDestBuf[0] = 255 - FX_MIN(255, pSrcBuf[2] + k);
- }
- pSrcBuf += 4;
- pDestBuf += 3;
- }
- }
-}
-const FX_BYTE g_sRGBSamples1[] = {
- 0, 3, 6, 10, 13, 15, 18, 20, 22, 23, 25, 27, 28, 30, 31, 32,
- 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
- 49, 50, 51, 52, 53, 53, 54, 55, 56, 56, 57, 58, 58, 59, 60, 61,
- 61, 62, 62, 63, 64, 64, 65, 66, 66, 67, 67, 68, 68, 69, 70, 70,
- 71, 71, 72, 72, 73, 73, 74, 74, 75, 76, 76, 77, 77, 78, 78, 79,
- 79, 79, 80, 80, 81, 81, 82, 82, 83, 83, 84, 84, 85, 85, 85, 86,
- 86, 87, 87, 88, 88, 88, 89, 89, 90, 90, 91, 91, 91, 92, 92, 93,
- 93, 93, 94, 94, 95, 95, 95, 96, 96, 97, 97, 97, 98, 98, 98, 99,
- 99, 99, 100, 100, 101, 101, 101, 102, 102, 102, 103, 103, 103, 104, 104, 104,
- 105, 105, 106, 106, 106, 107, 107, 107, 108, 108, 108, 109, 109, 109, 110, 110,
- 110, 110, 111, 111, 111, 112, 112, 112, 113, 113, 113, 114, 114, 114, 115, 115,
- 115, 115, 116, 116, 116, 117, 117, 117, 118, 118, 118, 118, 119, 119, 119, 120,
-};
-const FX_BYTE g_sRGBSamples2[] = {
- 120, 121, 122, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136,
- 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 148, 149, 150, 151,
- 152, 153, 154, 155, 155, 156, 157, 158, 159, 159, 160, 161, 162, 163, 163, 164,
- 165, 166, 167, 167, 168, 169, 170, 170, 171, 172, 173, 173, 174, 175, 175, 176,
- 177, 178, 178, 179, 180, 180, 181, 182, 182, 183, 184, 185, 185, 186, 187, 187,
- 188, 189, 189, 190, 190, 191, 192, 192, 193, 194, 194, 195, 196, 196, 197, 197,
- 198, 199, 199, 200, 200, 201, 202, 202, 203, 203, 204, 205, 205, 206, 206, 207,
- 208, 208, 209, 209, 210, 210, 211, 212, 212, 213, 213, 214, 214, 215, 215, 216,
- 216, 217, 218, 218, 219, 219, 220, 220, 221, 221, 222, 222, 223, 223, 224, 224,
- 225, 226, 226, 227, 227, 228, 228, 229, 229, 230, 230, 231, 231, 232, 232, 233,
- 233, 234, 234, 235, 235, 236, 236, 237, 237, 238, 238, 238, 239, 239, 240, 240,
- 241, 241, 242, 242, 243, 243, 244, 244, 245, 245, 246, 246, 246, 247, 247, 248,
- 248, 249, 249, 250, 250, 251, 251, 251, 252, 252, 253, 253, 254, 254, 255, 255,
-};
-static void XYZ_to_sRGB(FX_FLOAT X, FX_FLOAT Y, FX_FLOAT Z, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B)
-{
- FX_FLOAT R1 = 3.2410f * X - 1.5374f * Y - 0.4986f * Z;
- FX_FLOAT G1 = -0.9692f * X + 1.8760f * Y + 0.0416f * Z;
- FX_FLOAT B1 = 0.0556f * X - 0.2040f * Y + 1.0570f * Z;
- if (R1 > 1) {
- R1 = 1;
- }
- if (R1 < 0) {
- R1 = 0;
- }
- if (G1 > 1) {
- G1 = 1;
- }
- if (G1 < 0) {
- G1 = 0;
- }
- if (B1 > 1) {
- B1 = 1;
- }
- if (B1 < 0) {
- B1 = 0;
- }
- int scale = (int)(R1 * 1023);
- if (scale < 0) {
- scale = 0;
- }
- if (scale < 192) {
- R = (g_sRGBSamples1[scale] / 255.0f);
- } else {
- R = (g_sRGBSamples2[scale / 4 - 48] / 255.0f);
- }
- scale = (int)(G1 * 1023);
- if (scale < 0) {
- scale = 0;
- }
- if (scale < 192) {
- G = (g_sRGBSamples1[scale] / 255.0f);
- } else {
- G = (g_sRGBSamples2[scale / 4 - 48] / 255.0f);
- }
- scale = (int)(B1 * 1023);
- if (scale < 0) {
- scale = 0;
- }
- if (scale < 192) {
- B = (g_sRGBSamples1[scale] / 255.0f);
- } else {
- B = (g_sRGBSamples2[scale / 4 - 48] / 255.0f);
- }
-}
-class CPDF_CalGray : public CPDF_ColorSpace
-{
-public:
- CPDF_CalGray();
- virtual FX_BOOL v_Load(CPDF_Document* pDoc, CPDF_Array* pArray);
- virtual FX_BOOL GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const;
- virtual void TranslateImageLine(FX_LPBYTE pDestBuf, FX_LPCBYTE pSrcBuf, int pixels, int image_width, int image_height, FX_BOOL bTransMask = FALSE) const;
- FX_BOOL SetRGB(FX_FLOAT* pBuf, FX_FLOAT R, FX_FLOAT G, FX_FLOAT B) const;
- FX_FLOAT m_WhitePoint[3];
- FX_FLOAT m_BlackPoint[3];
- FX_FLOAT m_Gamma;
-};
-CPDF_CalGray::CPDF_CalGray()
-{
- m_Family = PDFCS_CALGRAY;
- m_nComponents = 1;
-}
-FX_BOOL CPDF_CalGray::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray)
-{
- CPDF_Dictionary* pDict = pArray->GetDict(1);
- CPDF_Array* pParam = pDict->GetArray(FX_BSTRC("WhitePoint"));
- int i;
- for (i = 0; i < 3; i ++) {
- m_WhitePoint[i] = pParam->GetNumber(i);
- }
- pParam = pDict->GetArray(FX_BSTRC("BlackPoint"));
- for (i = 0; i < 3; i ++) {
- m_BlackPoint[i] = pParam ? pParam->GetNumber(i) : 0;
- }
- m_Gamma = pDict->GetNumber(FX_BSTRC("Gamma"));
- if (m_Gamma == 0) {
- m_Gamma = 1.0f;
- }
- return TRUE;
-}
-FX_BOOL CPDF_CalGray::GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const
-{
- R = G = B = *pBuf;
- return TRUE;
-}
-FX_BOOL CPDF_CalGray::SetRGB(FX_FLOAT* pBuf, FX_FLOAT R, FX_FLOAT G, FX_FLOAT B) const
-{
- if (R == G && R == B) {
- *pBuf = R;
- return TRUE;
- } else {
- return FALSE;
- }
-}
-void CPDF_CalGray::TranslateImageLine(FX_LPBYTE pDestBuf, FX_LPCBYTE pSrcBuf, int pixels, int image_width, int image_height, FX_BOOL bTransMask) const
-{
- for (int i = 0; i < pixels; i ++) {
- *pDestBuf ++ = pSrcBuf[i];
- *pDestBuf ++ = pSrcBuf[i];
- *pDestBuf ++ = pSrcBuf[i];
- }
-}
-class CPDF_CalRGB : public CPDF_ColorSpace
-{
-public:
- CPDF_CalRGB();
- virtual FX_BOOL v_Load(CPDF_Document* pDoc, CPDF_Array* pArray);
- virtual FX_BOOL GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const;
- virtual void TranslateImageLine(FX_LPBYTE pDestBuf, FX_LPCBYTE pSrcBuf, int pixels, int image_width, int image_height, FX_BOOL bTransMask = FALSE) const;
- FX_BOOL SetRGB(FX_FLOAT* pBuf, FX_FLOAT R, FX_FLOAT G, FX_FLOAT B) const;
- FX_FLOAT m_WhitePoint[3];
- FX_FLOAT m_BlackPoint[3];
- FX_FLOAT m_Gamma[3];
- FX_FLOAT m_Matrix[9];
- FX_BOOL m_bGamma, m_bMatrix;
-};
-CPDF_CalRGB::CPDF_CalRGB()
-{
- m_Family = PDFCS_CALRGB;
- m_nComponents = 3;
-}
-FX_BOOL CPDF_CalRGB::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray)
-{
- CPDF_Dictionary* pDict = pArray->GetDict(1);
- CPDF_Array* pParam = pDict->GetArray(FX_BSTRC("WhitePoint"));
- int i;
- for (i = 0; i < 3; i ++) {
- m_WhitePoint[i] = pParam->GetNumber(i);
- }
- pParam = pDict->GetArray(FX_BSTRC("BlackPoint"));
- for (i = 0; i < 3; i ++) {
- m_BlackPoint[i] = pParam ? pParam->GetNumber(i) : 0;
- }
- pParam = pDict->GetArray(FX_BSTRC("Gamma"));
- if (pParam) {
- m_bGamma = TRUE;
- for (i = 0; i < 3; i ++) {
- m_Gamma[i] = pParam->GetNumber(i);
- }
- } else {
- m_bGamma = FALSE;
- }
- pParam = pDict->GetArray(FX_BSTRC("Matrix"));
- if (pParam) {
- m_bMatrix = TRUE;
- for (i = 0; i < 9; i ++) {
- m_Matrix[i] = pParam->GetNumber(i);
- }
- } else {
- m_bMatrix = FALSE;
- }
- return TRUE;
-}
-FX_BOOL CPDF_CalRGB::GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const
-{
- FX_FLOAT A_ = pBuf[0];
- FX_FLOAT B_ = pBuf[1];
- FX_FLOAT C_ = pBuf[2];
- if (m_bGamma) {
- A_ = (FX_FLOAT)FXSYS_pow(A_, m_Gamma[0]);
- B_ = (FX_FLOAT)FXSYS_pow(B_, m_Gamma[1]);
- C_ = (FX_FLOAT)FXSYS_pow(C_, m_Gamma[2]);
- }
- FX_FLOAT X, Y, Z;
- if (m_bMatrix) {
- X = m_Matrix[0] * A_ + m_Matrix[3] * B_ + m_Matrix[6] * C_;
- Y = m_Matrix[1] * A_ + m_Matrix[4] * B_ + m_Matrix[7] * C_;
- Z = m_Matrix[2] * A_ + m_Matrix[5] * B_ + m_Matrix[8] * C_;
- } else {
- X = A_;
- Y = B_;
- Z = C_;
- }
- XYZ_to_sRGB(X, Y, Z, R, G, B);
- return TRUE;
-}
-FX_BOOL CPDF_CalRGB::SetRGB(FX_FLOAT* pBuf, FX_FLOAT R, FX_FLOAT G, FX_FLOAT B) const
-{
- pBuf[0] = R;
- pBuf[1] = G;
- pBuf[2] = B;
- return TRUE;
-}
-void CPDF_CalRGB::TranslateImageLine(FX_LPBYTE pDestBuf, FX_LPCBYTE pSrcBuf, int pixels, int image_width, int image_height, FX_BOOL bTransMask) const
-{
- if (bTransMask) {
- FX_FLOAT Cal[3];
- FX_FLOAT R, G, B;
- for(int i = 0; i < pixels; i ++) {
- Cal[0] = ((FX_FLOAT)pSrcBuf[2]) / 255;
- Cal[1] = ((FX_FLOAT)pSrcBuf[1]) / 255;
- Cal[2] = ((FX_FLOAT)pSrcBuf[0]) / 255;
- GetRGB(Cal, R, G, B);
- pDestBuf[0] = FXSYS_round(B * 255);
- pDestBuf[1] = FXSYS_round(G * 255);
- pDestBuf[2] = FXSYS_round(R * 255);
- pSrcBuf += 3;
- pDestBuf += 3;
- }
- }
- ReverseRGB(pDestBuf, pSrcBuf, pixels);
-}
-class CPDF_LabCS : public CPDF_ColorSpace
-{
-public:
- CPDF_LabCS()
- {
- m_Family = PDFCS_LAB;
- m_nComponents = 3;
- }
- virtual FX_BOOL v_Load(CPDF_Document* pDoc, CPDF_Array* pArray);
- virtual void GetDefaultValue(int iComponent, FX_FLOAT& value, FX_FLOAT& min, FX_FLOAT& max) const;
- virtual FX_BOOL GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const;
- FX_BOOL SetRGB(FX_FLOAT* pBuf, FX_FLOAT R, FX_FLOAT G, FX_FLOAT B) const;
- virtual void TranslateImageLine(FX_LPBYTE pDestBuf, FX_LPCBYTE pSrcBuf, int pixels, int image_width, int image_height, FX_BOOL bTransMask = FALSE) const;
- FX_FLOAT m_WhitePoint[3];
- FX_FLOAT m_BlackPoint[3];
- FX_FLOAT m_Ranges[4];
-};
-FX_BOOL CPDF_LabCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray)
-{
- CPDF_Dictionary* pDict = pArray->GetDict(1);
- CPDF_Array* pParam = pDict->GetArray(FX_BSTRC("WhitePoint"));
- int i;
- for (i = 0; i < 3; i ++) {
- m_WhitePoint[i] = pParam->GetNumber(i);
- }
- pParam = pDict->GetArray(FX_BSTRC("BlackPoint"));
- for (i = 0; i < 3; i ++) {
- m_BlackPoint[i] = pParam ? pParam->GetNumber(i) : 0;
- }
- pParam = pDict->GetArray(FX_BSTRC("Range"));
- const FX_FLOAT def_ranges[4] = { -100 * 1.0f, 100 * 1.0f, -100 * 1.0f, 100 * 1.0f};
- for (i = 0; i < 4; i ++) {
- m_Ranges[i] = pParam ? pParam->GetNumber(i) : def_ranges[i];
- }
- return TRUE;
-}
-void CPDF_LabCS::GetDefaultValue(int iComponent, FX_FLOAT& value, FX_FLOAT& min, FX_FLOAT& max) const
-{
- value = 0;
- if (iComponent == 0) {
- min = 0;
- max = 100 * 1.0f;
- } else {
- min = m_Ranges[iComponent * 2 - 2];
- max = m_Ranges[iComponent * 2 - 1];
- if (value < min) {
- value = min;
- } else if (value > max) {
- value = max;
- }
- }
-}
-FX_BOOL CPDF_LabCS::GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const
-{
- FX_FLOAT Lstar = pBuf[0];
- FX_FLOAT astar = pBuf[1];
- FX_FLOAT bstar = pBuf[2];
- FX_FLOAT M = (Lstar + 16.0f) / 116.0f;
- FX_FLOAT L = M + astar / 500.0f;
- FX_FLOAT N = M - bstar / 200.0f;
- FX_FLOAT X, Y, Z;
- if (L < 0.2069f) {
- X = 0.957f * 0.12842f * (L - 0.1379f);
- } else {
- X = 0.957f * L * L * L;
- }
- if (M < 0.2069f) {
- Y = 0.12842f * (M - 0.1379f);
- } else {
- Y = M * M * M;
- }
- if (N < 0.2069f) {
- Z = 1.0889f * 0.12842f * (N - 0.1379f);
- } else {
- Z = 1.0889f * N * N * N;
- }
- XYZ_to_sRGB(X, Y, Z, R, G, B);
- return TRUE;
-}
-FX_BOOL CPDF_LabCS::SetRGB(FX_FLOAT* pBuf, FX_FLOAT R, FX_FLOAT G, FX_FLOAT B) const
-{
- return FALSE;
-}
-void CPDF_LabCS::TranslateImageLine(FX_LPBYTE pDestBuf, FX_LPCBYTE pSrcBuf, int pixels, int image_width, int image_height, FX_BOOL bTransMask) const
-{
- for (int i = 0; i < pixels; i ++) {
- FX_FLOAT lab[3];
- FX_FLOAT R, G, B;
- lab[0] = (pSrcBuf[0] * 100 / 255.0f);
- lab[1] = (FX_FLOAT)(pSrcBuf[1] - 128);
- lab[2] = (FX_FLOAT)(pSrcBuf[2] - 128);
- GetRGB(lab, R, G, B);
- pDestBuf[0] = (FX_INT32)(B * 255);
- pDestBuf[1] = (FX_INT32)(G * 255);
- pDestBuf[2] = (FX_INT32)(R * 255);
- pDestBuf += 3;
- pSrcBuf += 3;
- }
-}
-CPDF_IccProfile::CPDF_IccProfile(FX_LPCBYTE pData, FX_DWORD dwSize, int nComponents)
-{
- m_bsRGB = nComponents == 3 && dwSize == 3144 && FXSYS_memcmp32(pData + 0x190, "sRGB IEC61966-2.1", 17) == 0;
- m_pTransform = NULL;
- if (!m_bsRGB && CPDF_ModuleMgr::Get()->GetIccModule()) {
- m_pTransform = CPDF_ModuleMgr::Get()->GetIccModule()->CreateTransform_sRGB(pData, dwSize, nComponents);
- }
-}
-CPDF_IccProfile::~CPDF_IccProfile()
-{
- if (m_pTransform) {
- CPDF_ModuleMgr::Get()->GetIccModule()->DestroyTransform(m_pTransform);
- }
-}
-class CPDF_ICCBasedCS : public CPDF_ColorSpace
-{
-public:
- CPDF_ICCBasedCS();
- virtual ~CPDF_ICCBasedCS();
- virtual FX_BOOL v_Load(CPDF_Document* pDoc, CPDF_Array* pArray);
- void GetDefaultValue(int i, FX_FLOAT& min, FX_FLOAT& max) const
- {
- min = m_pRanges[i * 2];
- max = m_pRanges[i * 2 + 1];
- }
- virtual FX_BOOL GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const;
- FX_BOOL v_GetCMYK(FX_FLOAT* pBuf, FX_FLOAT& c, FX_FLOAT& m, FX_FLOAT& y, FX_FLOAT& k) const;
- FX_BOOL SetRGB(FX_FLOAT* pBuf, FX_FLOAT R, FX_FLOAT G, FX_FLOAT B) const;
- virtual void EnableStdConversion(FX_BOOL bEnabled);
- virtual void TranslateImageLine(FX_LPBYTE pDestBuf, FX_LPCBYTE pSrcBuf, int pixels, int image_width, int image_height, FX_BOOL bTransMask = FALSE) const;
- FX_FLOAT* m_pRanges;
- CPDF_IccProfile* m_pProfile;
- CPDF_ColorSpace* m_pAlterCS;
- FX_LPBYTE m_pCache;
- FX_BOOL m_bOwn;
-};
-CPDF_ICCBasedCS::CPDF_ICCBasedCS()
-{
- m_pAlterCS = NULL;
- m_pProfile = NULL;
- m_Family = PDFCS_ICCBASED;
- m_pCache = NULL;
- m_pRanges = NULL;
- m_bOwn = FALSE;
-}
-CPDF_ICCBasedCS::~CPDF_ICCBasedCS()
-{
- if (m_pCache) {
- FX_Free(m_pCache);
- }
- if (m_pRanges) {
- FX_Free(m_pRanges);
- }
- if (m_pAlterCS && m_bOwn) {
- m_pAlterCS->ReleaseCS();
- }
- if (m_pProfile && m_pDocument) {
- m_pDocument->GetPageData()->ReleaseIccProfile(NULL, m_pProfile);
- }
-}
-FX_BOOL CPDF_ICCBasedCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray)
-{
- CPDF_Stream* pStream = pArray->GetStream(1);
- if (pStream == NULL) {
- return FALSE;
- }
- m_nComponents = pStream->GetDict()->GetInteger(FX_BSTRC("N"));
- if (m_nComponents < 0 || m_nComponents > (1 << 16)) {
- return FALSE;
- }
- CPDF_Array* pRanges = pStream->GetDict()->GetArray(FX_BSTRC("Range"));
- m_pRanges = FX_Alloc(FX_FLOAT, m_nComponents * 2);
- for (int i = 0; i < m_nComponents * 2; i ++) {
- if (pRanges) {
- m_pRanges[i] = pRanges->GetNumber(i);
- } else if (i % 2) {
- m_pRanges[i] = 1.0f;
- } else {
- m_pRanges[i] = 0;
- }
- }
- m_pProfile = pDoc->LoadIccProfile(pStream, m_nComponents);
- if (!m_pProfile) {
- return FALSE;
- }
- if (m_pProfile->m_pTransform == NULL) {
- CPDF_Object* pAlterCSObj = pStream->GetDict()->GetElementValue(FX_BSTRC("Alternate"));
- if (pAlterCSObj) {
- CPDF_ColorSpace* alter_cs = CPDF_ColorSpace::Load(pDoc, pAlterCSObj);
- if (alter_cs) {
- if (alter_cs->CountComponents() > m_nComponents) {
- alter_cs->ReleaseCS();
- } else {
- m_pAlterCS = alter_cs;
- m_bOwn = TRUE;
- }
- }
- }
- if (!m_pAlterCS) {
- if (m_nComponents == 3) {
- m_pAlterCS = GetStockCS(PDFCS_DEVICERGB);
- } else if (m_nComponents == 4) {
- m_pAlterCS = GetStockCS(PDFCS_DEVICECMYK);
- } else {
- m_pAlterCS = GetStockCS(PDFCS_DEVICEGRAY);
- }
- }
- }
- return TRUE;
-}
-FX_BOOL CPDF_ICCBasedCS::GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const
-{
- if (m_pProfile && m_pProfile->m_bsRGB) {
- R = pBuf[0];
- G = pBuf[1];
- B = pBuf[2];
- return TRUE;
- }
- ICodec_IccModule *pIccModule = CPDF_ModuleMgr::Get()->GetIccModule();
- if (m_pProfile->m_pTransform == NULL || pIccModule == NULL) {
- if (m_pAlterCS) {
- m_pAlterCS->GetRGB(pBuf, R, G, B);
- } else {
- R = G = B = 0.0f;
- }
- return TRUE;
- }
- FX_FLOAT rgb[3];
- pIccModule->Translate(m_pProfile->m_pTransform, pBuf, rgb);
- R = rgb[0];
- G = rgb[1];
- B = rgb[2];
- return TRUE;
-}
-FX_BOOL CPDF_ICCBasedCS::v_GetCMYK(FX_FLOAT* pBuf, FX_FLOAT& c, FX_FLOAT& m, FX_FLOAT& y, FX_FLOAT& k) const
-{
- if (m_nComponents != 4) {
- return FALSE;
- }
- c = pBuf[0];
- m = pBuf[1];
- y = pBuf[2];
- k = pBuf[3];
- return TRUE;
-}
-FX_BOOL CPDF_ICCBasedCS::SetRGB(FX_FLOAT* pBuf, FX_FLOAT R, FX_FLOAT G, FX_FLOAT B) const
-{
- return FALSE;
-}
-void CPDF_ICCBasedCS::EnableStdConversion(FX_BOOL bEnabled)
-{
- CPDF_ColorSpace::EnableStdConversion(bEnabled);
- if (m_pAlterCS) {
- m_pAlterCS->EnableStdConversion(bEnabled);
- }
-}
-void CPDF_ICCBasedCS::TranslateImageLine(FX_LPBYTE pDestBuf, FX_LPCBYTE pSrcBuf, int pixels, int image_width, int image_height, FX_BOOL bTransMask) const
-{
- if (m_pProfile->m_bsRGB) {
- ReverseRGB(pDestBuf, pSrcBuf, pixels);
- } else if (m_pProfile->m_pTransform) {
- int nMaxColors = 1;
- for (int i = 0; i < m_nComponents; i ++) {
- nMaxColors *= 52;
- }
- if (m_nComponents > 3 || image_width * image_height < nMaxColors * 3 / 2) {
- CPDF_ModuleMgr::Get()->GetIccModule()->TranslateScanline(m_pProfile->m_pTransform, pDestBuf, pSrcBuf, pixels);
- } else {
- if (m_pCache == NULL) {
- ((CPDF_ICCBasedCS*)this)->m_pCache = FX_Alloc(FX_BYTE, nMaxColors * 3);
- FX_LPBYTE temp_src = FX_Alloc(FX_BYTE, nMaxColors * m_nComponents);
- FX_LPBYTE pSrc = temp_src;
- for (int i = 0; i < nMaxColors; i ++) {
- FX_DWORD color = i;
- FX_DWORD order = nMaxColors / 52;
- for (int c = 0; c < m_nComponents; c ++) {
- *pSrc++ = (FX_BYTE)(color / order * 5);
- color %= order;
- order /= 52;
- }
- }
- CPDF_ModuleMgr::Get()->GetIccModule()->TranslateScanline(m_pProfile->m_pTransform, m_pCache, temp_src, nMaxColors);
- FX_Free(temp_src);
- }
- for (int i = 0; i < pixels; i ++) {
- int index = 0;
- for (int c = 0; c < m_nComponents; c ++) {
- index = index * 52 + (*pSrcBuf) / 5;
- pSrcBuf ++;
- }
- index *= 3;
- *pDestBuf++ = m_pCache[index];
- *pDestBuf++ = m_pCache[index + 1];
- *pDestBuf++ = m_pCache[index + 2];
- }
- }
- } else if (m_pAlterCS) {
- m_pAlterCS->TranslateImageLine(pDestBuf, pSrcBuf, pixels, image_width, image_height);
- }
-}
-class CPDF_IndexedCS : public CPDF_ColorSpace
-{
-public:
- CPDF_IndexedCS();
- virtual ~CPDF_IndexedCS();
- virtual FX_BOOL v_Load(CPDF_Document* pDoc, CPDF_Array* pArray);
- void GetDefaultValue(int iComponent, FX_FLOAT& min, FX_FLOAT& max) const
- {
- min = 0;
- max = (FX_FLOAT)m_MaxIndex;
- }
- virtual FX_BOOL GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const;
- virtual CPDF_ColorSpace* GetBaseCS() const
- {
- return m_pBaseCS;
- }
- virtual void EnableStdConversion(FX_BOOL bEnabled);
- CPDF_ColorSpace* m_pBaseCS;
- int m_nBaseComponents;
- int m_MaxIndex;
- CFX_ByteString m_Table;
- FX_FLOAT* m_pCompMinMax;
-};
-CPDF_IndexedCS::CPDF_IndexedCS()
-{
- m_pBaseCS = NULL;
- m_Family = PDFCS_INDEXED;
- m_nComponents = 1;
- m_pCompMinMax = NULL;
-}
-CPDF_IndexedCS::~CPDF_IndexedCS()
-{
- if (m_pCompMinMax) {
- FX_Free(m_pCompMinMax);
- }
- CPDF_ColorSpace* pCS = m_pBaseCS;
- if (pCS && m_pDocument) {
- m_pDocument->GetPageData()->ReleaseColorSpace(pCS->GetArray());
- }
-}
-FX_BOOL CPDF_IndexedCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray)
-{
- if (pArray->GetCount() < 4) {
- return FALSE;
- }
- CPDF_Object* pBaseObj = pArray->GetElementValue(1);
- if (pBaseObj == m_pArray) {
- return FALSE;
- }
- CPDF_DocPageData* pDocPageData = pDoc->GetPageData();
- m_pBaseCS = pDocPageData->GetColorSpace(pBaseObj, NULL);
- if (m_pBaseCS == NULL) {
- return FALSE;
- }
- m_nBaseComponents = m_pBaseCS->CountComponents();
- m_pCompMinMax = FX_Alloc(FX_FLOAT, m_nBaseComponents * 2);
- FX_FLOAT defvalue;
- for (int i = 0; i < m_nBaseComponents; i ++) {
- m_pBaseCS->GetDefaultValue(i, defvalue, m_pCompMinMax[i * 2], m_pCompMinMax[i * 2 + 1]);
- m_pCompMinMax[i * 2 + 1] -= m_pCompMinMax[i * 2];
- }
- m_MaxIndex = pArray->GetInteger(2);
- CPDF_Object* pTableObj = pArray->GetElementValue(3);
- if (pTableObj == NULL) {
- return FALSE;
- }
- FX_LPCBYTE pTable = NULL;
- FX_DWORD size = 0;
- CPDF_StreamAcc* pStreamAcc = NULL;
- if (pTableObj->GetType() == PDFOBJ_STRING) {
- m_Table = ((CPDF_String*)pTableObj)->GetString();
- } else if (pTableObj->GetType() == PDFOBJ_STREAM) {
- CPDF_StreamAcc acc;
- acc.LoadAllData((CPDF_Stream*)pTableObj, FALSE);
- m_Table = CFX_ByteStringC(acc.GetData(), acc.GetSize());
- }
- return TRUE;
-}
-FX_BOOL CPDF_IndexedCS::GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const
-{
- int index = (FX_INT32)(*pBuf);
- if (index < 0 || index > m_MaxIndex) {
- return FALSE;
- }
- if (m_nBaseComponents) {
- if (index == INT_MAX || (index + 1) > INT_MAX / m_nBaseComponents ||
- (index + 1)*m_nBaseComponents > (int)m_Table.GetLength()) {
- R = G = B = 0;
- return FALSE;
- }
- }
- CFX_FixedBufGrow<FX_FLOAT, 16> Comps(m_nBaseComponents);
- FX_FLOAT* comps = Comps;
- FX_LPCBYTE pTable = m_Table;
- for (int i = 0; i < m_nBaseComponents; i ++) {
- comps[i] = m_pCompMinMax[i * 2] + m_pCompMinMax[i * 2 + 1] * pTable[index * m_nBaseComponents + i] / 255;
- }
- m_pBaseCS->GetRGB(comps, R, G, B);
- return TRUE;
-}
-void CPDF_IndexedCS::EnableStdConversion(FX_BOOL bEnabled)
-{
- CPDF_ColorSpace::EnableStdConversion(bEnabled);
- if (m_pBaseCS) {
- m_pBaseCS->EnableStdConversion(bEnabled);
- }
-}
-#define MAX_PATTERN_COLORCOMPS 16
-typedef struct _PatternValue {
- CPDF_Pattern* m_pPattern;
- int m_nComps;
- FX_FLOAT m_Comps[MAX_PATTERN_COLORCOMPS];
-} PatternValue;
-CPDF_PatternCS::CPDF_PatternCS()
-{
- m_Family = PDFCS_PATTERN;
- m_pBaseCS = NULL;
- m_nComponents = 1;
-}
-CPDF_PatternCS::~CPDF_PatternCS()
-{
- CPDF_ColorSpace* pCS = m_pBaseCS;
- if (pCS && m_pDocument) {
- m_pDocument->GetPageData()->ReleaseColorSpace(pCS->GetArray());
- }
-}
-FX_BOOL CPDF_PatternCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray)
-{
- CPDF_Object* pBaseCS = pArray->GetElementValue(1);
- if (pBaseCS == m_pArray) {
- return FALSE;
- }
- CPDF_DocPageData* pDocPageData = pDoc->GetPageData();
- m_pBaseCS = pDocPageData->GetColorSpace(pBaseCS, NULL);
- if (m_pBaseCS) {
- m_nComponents = m_pBaseCS->CountComponents() + 1;
- if (m_pBaseCS->CountComponents() > MAX_PATTERN_COLORCOMPS) {
- return FALSE;
- }
- } else {
- m_nComponents = 1;
- }
- return TRUE;
-}
-FX_BOOL CPDF_PatternCS::GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const
-{
- if (m_pBaseCS) {
- PatternValue* pvalue = (PatternValue*)pBuf;
- m_pBaseCS->GetRGB(pvalue->m_Comps, R, G, B);
- return TRUE;
- }
- R = G = B = 0.75f;
- return FALSE;
-}
-class CPDF_SeparationCS : public CPDF_ColorSpace
-{
-public:
- CPDF_SeparationCS();
- virtual ~CPDF_SeparationCS();
- virtual void GetDefaultValue(int iComponent, FX_FLOAT& value, FX_FLOAT& min, FX_FLOAT& max) const
- {
- value = 1.0f;
- min = 0;
- max = 1.0f;
- }
- virtual FX_BOOL v_Load(CPDF_Document* pDoc, CPDF_Array* pArray);
- virtual FX_BOOL GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const;
- virtual void EnableStdConversion(FX_BOOL bEnabled);
- CPDF_ColorSpace* m_pAltCS;
- CPDF_Function* m_pFunc;
- enum {None, All, Colorant} m_Type;
-};
-CPDF_SeparationCS::CPDF_SeparationCS()
-{
- m_Family = PDFCS_SEPARATION;
- m_pAltCS = NULL;
- m_pFunc = NULL;
- m_nComponents = 1;
-}
-CPDF_SeparationCS::~CPDF_SeparationCS()
-{
- if (m_pAltCS) {
- m_pAltCS->ReleaseCS();
- }
- if (m_pFunc) {
- delete m_pFunc;
- }
-}
-FX_BOOL CPDF_SeparationCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray)
-{
- CFX_ByteString name = pArray->GetString(1);
- if (name == FX_BSTRC("None")) {
- m_Type = None;
- } else {
- m_Type = Colorant;
- CPDF_Object* pAltCS = pArray->GetElementValue(2);
- if (pAltCS == m_pArray) {
- return FALSE;
- }
- m_pAltCS = Load(pDoc, pAltCS);
- CPDF_Object* pFuncObj = pArray->GetElementValue(3);
- if (pFuncObj && pFuncObj->GetType() != PDFOBJ_NAME) {
- m_pFunc = CPDF_Function::Load(pFuncObj);
- }
- if (m_pFunc && m_pAltCS && m_pFunc->CountOutputs() < m_pAltCS->CountComponents()) {
- delete m_pFunc;
- m_pFunc = NULL;
- }
- }
- return TRUE;
-}
-FX_BOOL CPDF_SeparationCS::GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const
-{
- if (m_Type == None) {
- return FALSE;
- }
- if (m_pFunc == NULL) {
- if (m_pAltCS == NULL) {
- return FALSE;
- }
- int nComps = m_pAltCS->CountComponents();
- CFX_FixedBufGrow<FX_FLOAT, 16> results(nComps);
- for (int i = 0; i < nComps; i ++) {
- results[i] = *pBuf;
- }
- m_pAltCS->GetRGB(results, R, G, B);
- return TRUE;
- }
- CFX_FixedBufGrow<FX_FLOAT, 16> results(m_pFunc->CountOutputs());
- int nresults;
- m_pFunc->Call(pBuf, 1, results, nresults);
- if (nresults == 0) {
- return FALSE;
- }
- if (m_pAltCS) {
- m_pAltCS->GetRGB(results, R, G, B);
- return TRUE;
- } else {
- R = G = B = 0;
- return FALSE;
- }
-}
-void CPDF_SeparationCS::EnableStdConversion(FX_BOOL bEnabled)
-{
- CPDF_ColorSpace::EnableStdConversion(bEnabled);
- if (m_pAltCS) {
- m_pAltCS->EnableStdConversion(bEnabled);
- }
-}
-class CPDF_DeviceNCS : public CPDF_ColorSpace
-{
-public:
- CPDF_DeviceNCS();
- virtual ~CPDF_DeviceNCS();
- virtual void GetDefaultValue(int iComponent, FX_FLOAT& value, FX_FLOAT& min, FX_FLOAT& max) const
- {
- value = 1.0f;
- min = 0;
- max = 1.0f;
- }
- virtual FX_BOOL v_Load(CPDF_Document* pDoc, CPDF_Array* pArray);
- virtual FX_BOOL GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const;
- virtual void EnableStdConversion(FX_BOOL bEnabled);
- CPDF_ColorSpace* m_pAltCS;
- CPDF_Function* m_pFunc;
-};
-CPDF_DeviceNCS::CPDF_DeviceNCS()
-{
- m_Family = PDFCS_DEVICEN;
- m_pAltCS = NULL;
- m_pFunc = NULL;
-}
-CPDF_DeviceNCS::~CPDF_DeviceNCS()
-{
- if (m_pFunc) {
- delete m_pFunc;
- }
- if (m_pAltCS) {
- m_pAltCS->ReleaseCS();
- }
-}
-FX_BOOL CPDF_DeviceNCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray)
-{
- CPDF_Object* pObj = pArray->GetElementValue(1);
- if (!pObj) {
- return FALSE;
- }
- if (pObj->GetType() != PDFOBJ_ARRAY) {
- return FALSE;
- }
- m_nComponents = ((CPDF_Array*)pObj)->GetCount();
- CPDF_Object* pAltCS = pArray->GetElementValue(2);
- if (!pAltCS || pAltCS == m_pArray) {
- return FALSE;
- }
- m_pAltCS = Load(pDoc, pAltCS);
- m_pFunc = CPDF_Function::Load(pArray->GetElementValue(3));
- if (m_pAltCS == NULL || m_pFunc == NULL) {
- return FALSE;
- }
- if (m_pFunc->CountOutputs() < m_pAltCS->CountComponents()) {
- return FALSE;
- }
- return TRUE;
-}
-FX_BOOL CPDF_DeviceNCS::GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const
-{
- if (m_pFunc == NULL) {
- return FALSE;
- }
- CFX_FixedBufGrow<FX_FLOAT, 16> results(m_pFunc->CountOutputs());
- int nresults;
- m_pFunc->Call(pBuf, m_nComponents, results, nresults);
- if (nresults == 0) {
- return FALSE;
- }
- m_pAltCS->GetRGB(results, R, G, B);
- return TRUE;
-}
-void CPDF_DeviceNCS::EnableStdConversion(FX_BOOL bEnabled)
-{
- CPDF_ColorSpace::EnableStdConversion(bEnabled);
- if (m_pAltCS) {
- m_pAltCS->EnableStdConversion(bEnabled);
- }
-}
-CPDF_ColorSpace* CPDF_ColorSpace::GetStockCS(int family)
-{
- return CPDF_ModuleMgr::Get()->GetPageModule()->GetStockCS(family);;
-}
-CPDF_ColorSpace* _CSFromName(const CFX_ByteString& name)
-{
- if (name == FX_BSTRC("DeviceRGB") || name == FX_BSTRC("RGB")) {
- return CPDF_ColorSpace::GetStockCS(PDFCS_DEVICERGB);
- }
- if (name == FX_BSTRC("DeviceGray") || name == FX_BSTRC("G")) {
- return CPDF_ColorSpace::GetStockCS(PDFCS_DEVICEGRAY);
- }
- if (name == FX_BSTRC("DeviceCMYK") || name == FX_BSTRC("CMYK")) {
- return CPDF_ColorSpace::GetStockCS(PDFCS_DEVICECMYK);
- }
- if (name == FX_BSTRC("Pattern")) {
- return CPDF_ColorSpace::GetStockCS(PDFCS_PATTERN);
- }
- return NULL;
-}
-CPDF_ColorSpace* CPDF_ColorSpace::Load(CPDF_Document* pDoc, CPDF_Object* pObj)
-{
- if (pObj == NULL) {
- return NULL;
- }
- if (pObj->GetType() == PDFOBJ_NAME) {
- return _CSFromName(pObj->GetString());
- }
- if (pObj->GetType() == PDFOBJ_STREAM) {
- CPDF_Dictionary *pDict = ((CPDF_Stream *)pObj)->GetDict();
- if (!pDict) {
- return NULL;
- }
- CPDF_ColorSpace *pRet = NULL;
- FX_POSITION pos = pDict->GetStartPos();
- while (pos) {
- CFX_ByteString bsKey;
- CPDF_Object *pValue = pDict->GetNextElement(pos, bsKey);
- if (pValue->GetType() == PDFOBJ_NAME) {
- pRet = _CSFromName(pValue->GetString());
- }
- if (pRet) {
- return pRet;
- }
- }
- return NULL;
- }
- if (pObj->GetType() != PDFOBJ_ARRAY) {
- return NULL;
- }
- CPDF_Array* pArray = (CPDF_Array*)pObj;
- if (pArray->GetCount() == 0) {
- return NULL;
- }
- CFX_ByteString familyname = pArray->GetElementValue(0)->GetString();
- if (pArray->GetCount() == 1) {
- return _CSFromName(familyname);
- }
- CPDF_ColorSpace* pCS = NULL;
- FX_DWORD id = familyname.GetID();
- if (id == FXBSTR_ID('C', 'a', 'l', 'G')) {
- pCS = FX_NEW CPDF_CalGray();
- } else if (id == FXBSTR_ID('C', 'a', 'l', 'R')) {
- pCS = FX_NEW CPDF_CalRGB();
- } else if (id == FXBSTR_ID('L', 'a', 'b', 0)) {
- pCS = FX_NEW CPDF_LabCS();
- } else if (id == FXBSTR_ID('I', 'C', 'C', 'B')) {
- pCS = FX_NEW CPDF_ICCBasedCS();
- } else if (id == FXBSTR_ID('I', 'n', 'd', 'e') || id == FXBSTR_ID('I', 0, 0, 0)) {
- pCS = FX_NEW CPDF_IndexedCS();
- } else if (id == FXBSTR_ID('S', 'e', 'p', 'a')) {
- pCS = FX_NEW CPDF_SeparationCS();
- } else if (id == FXBSTR_ID('D', 'e', 'v', 'i')) {
- pCS = FX_NEW CPDF_DeviceNCS();
- } else if (id == FXBSTR_ID('P', 'a', 't', 't')) {
- pCS = FX_NEW CPDF_PatternCS();
- } else {
- return NULL;
- }
- pCS->m_pDocument = pDoc;
- pCS->m_pArray = pArray;
- if (!pCS->v_Load(pDoc, pArray)) {
- pCS->ReleaseCS();
- return NULL;
- }
- return pCS;
-}
-CPDF_ColorSpace::CPDF_ColorSpace()
-{
- m_Family = 0;
- m_pArray = NULL;
- m_dwStdConversion = 0;
- m_pDocument = NULL;
-}
-void CPDF_ColorSpace::ReleaseCS()
-{
- if (this == GetStockCS(PDFCS_DEVICERGB)) {
- return;
- }
- if (this == GetStockCS(PDFCS_DEVICEGRAY)) {
- return;
- }
- if (this == GetStockCS(PDFCS_DEVICECMYK)) {
- return;
- }
- if (this == GetStockCS(PDFCS_PATTERN)) {
- return;
- }
- delete this;
-}
-int CPDF_ColorSpace::GetBufSize() const
-{
- if (m_Family == PDFCS_PATTERN) {
- return sizeof(PatternValue);
- }
- return m_nComponents * sizeof(FX_FLOAT);
-}
-FX_FLOAT* CPDF_ColorSpace::CreateBuf()
-{
- int size = GetBufSize();
- FX_BYTE* pBuf = FX_Alloc(FX_BYTE, size);
- FXSYS_memset32(pBuf, 0, size);
- return (FX_FLOAT*)pBuf;
-}
-FX_BOOL CPDF_ColorSpace::sRGB() const
-{
- if (m_Family == PDFCS_DEVICERGB) {
- return TRUE;
- }
- if (m_Family != PDFCS_ICCBASED) {
- return FALSE;
- }
- CPDF_ICCBasedCS* pCS = (CPDF_ICCBasedCS*)this;
- return pCS->m_pProfile->m_bsRGB;
-}
-FX_BOOL CPDF_ColorSpace::GetCMYK(FX_FLOAT* pBuf, FX_FLOAT& c, FX_FLOAT& m, FX_FLOAT& y, FX_FLOAT& k) const
-{
- if (v_GetCMYK(pBuf, c, m, y, k)) {
- return TRUE;
- }
- FX_FLOAT R, G, B;
- if (!GetRGB(pBuf, R, G, B)) {
- return FALSE;
- }
- sRGB_to_AdobeCMYK(R, G, B, c, m, y, k);
- return TRUE;
-}
-FX_BOOL CPDF_ColorSpace::SetCMYK(FX_FLOAT* pBuf, FX_FLOAT c, FX_FLOAT m, FX_FLOAT y, FX_FLOAT k) const
-{
- if (v_SetCMYK(pBuf, c, m, y, k)) {
- return TRUE;
- }
- FX_FLOAT R, G, B;
- AdobeCMYK_to_sRGB(c, m, y, k, R, G, B);
- return SetRGB(pBuf, R, G, B);
-}
-void CPDF_ColorSpace::GetDefaultColor(FX_FLOAT* buf) const
-{
- if (buf == NULL || m_Family == PDFCS_PATTERN) {
- return;
- }
- FX_FLOAT min, max;
- for (int i = 0; i < m_nComponents; i ++) {
- GetDefaultValue(i, buf[i], min, max);
- }
-}
-int CPDF_ColorSpace::GetMaxIndex() const
-{
- if (m_Family != PDFCS_INDEXED) {
- return 0;
- }
- CPDF_IndexedCS* pCS = (CPDF_IndexedCS*)this;
- return pCS->m_MaxIndex;
-}
-void CPDF_ColorSpace::TranslateImageLine(FX_LPBYTE dest_buf, FX_LPCBYTE src_buf, int pixels, int image_width, int image_height, FX_BOOL bTransMask) const
-{
- CFX_FixedBufGrow<FX_FLOAT, 16> srcbuf(m_nComponents);
- FX_FLOAT* src = srcbuf;
- FX_FLOAT R, G, B;
- for (int i = 0; i < pixels; i ++) {
- for (int j = 0; j < m_nComponents; j ++)
- if (m_Family == PDFCS_INDEXED) {
- src[j] = (FX_FLOAT)(*src_buf ++);
- } else {
- src[j] = (FX_FLOAT)(*src_buf ++) / 255;
- }
- GetRGB(src, R, G, B);
- *dest_buf ++ = (FX_INT32)(B * 255);
- *dest_buf ++ = (FX_INT32)(G * 255);
- *dest_buf ++ = (FX_INT32)(R * 255);
- }
-}
-void CPDF_ColorSpace::EnableStdConversion(FX_BOOL bEnabled)
-{
- if (bEnabled) {
- m_dwStdConversion ++;
- } else if (m_dwStdConversion) {
- m_dwStdConversion --;
- }
-}
-CPDF_Color::CPDF_Color(int family)
-{
- m_pCS = CPDF_ColorSpace::GetStockCS(family);
- int nComps = 3;
- if (family == PDFCS_DEVICEGRAY) {
- nComps = 1;
- } else if (family == PDFCS_DEVICECMYK) {
- nComps = 4;
- }
- m_pBuffer = FX_Alloc(FX_FLOAT, nComps);
- for (int i = 0; i < nComps; i ++) {
- m_pBuffer[i] = 0;
- }
-}
-CPDF_Color::~CPDF_Color()
-{
- ReleaseBuffer();
- ReleaseColorSpace();
-}
-void CPDF_Color::ReleaseBuffer()
-{
- if (!m_pBuffer) {
- return;
- }
- if (m_pCS->GetFamily() == PDFCS_PATTERN) {
- PatternValue* pvalue = (PatternValue*)m_pBuffer;
- CPDF_Pattern* pPattern = pvalue->m_pPattern;
- if (pPattern && pPattern->m_pDocument) {
- pPattern->m_pDocument->GetPageData()->ReleasePattern(pPattern->m_pPatternObj);
- }
- }
- FX_Free(m_pBuffer);
- m_pBuffer = NULL;
-}
-void CPDF_Color::ReleaseColorSpace()
-{
- if (m_pCS && m_pCS->m_pDocument && m_pCS->GetArray()) {
- m_pCS->m_pDocument->GetPageData()->ReleaseColorSpace(m_pCS->GetArray());
- m_pCS = NULL;
- }
-}
-void CPDF_Color::SetColorSpace(CPDF_ColorSpace* pCS)
-{
- if (m_pCS == pCS) {
- if (m_pBuffer == NULL) {
- m_pBuffer = pCS->CreateBuf();
- }
- ReleaseColorSpace();
- m_pCS = pCS;
- return;
- }
- ReleaseBuffer();
- ReleaseColorSpace();
- m_pCS = pCS;
- if (m_pCS) {
- m_pBuffer = pCS->CreateBuf();
- pCS->GetDefaultColor(m_pBuffer);
- }
-}
-void CPDF_Color::SetValue(FX_FLOAT* comps)
-{
- if (m_pBuffer == NULL) {
- return;
- }
- if (m_pCS->GetFamily() != PDFCS_PATTERN) {
- FXSYS_memcpy32(m_pBuffer, comps, m_pCS->CountComponents() * sizeof(FX_FLOAT));
- }
-}
-void CPDF_Color::SetValue(CPDF_Pattern* pPattern, FX_FLOAT* comps, int ncomps)
-{
- if (ncomps > MAX_PATTERN_COLORCOMPS) {
- return;
- }
- if (m_pCS == NULL || m_pCS->GetFamily() != PDFCS_PATTERN) {
- if (m_pBuffer) {
- FX_Free(m_pBuffer);
- }
- m_pCS = CPDF_ColorSpace::GetStockCS(PDFCS_PATTERN);
- m_pBuffer = m_pCS->CreateBuf();
- }
- CPDF_DocPageData* pDocPageData = NULL;
- PatternValue* pvalue = (PatternValue*)m_pBuffer;
- if (pvalue->m_pPattern && pvalue->m_pPattern->m_pDocument) {
- pDocPageData = pvalue->m_pPattern->m_pDocument->GetPageData();
- pDocPageData->ReleasePattern(pvalue->m_pPattern->m_pPatternObj);
- }
- pvalue->m_nComps = ncomps;
- pvalue->m_pPattern = pPattern;
- if (ncomps) {
- FXSYS_memcpy32(pvalue->m_Comps, comps, ncomps * sizeof(FX_FLOAT));
- }
-}
-void CPDF_Color::Copy(const CPDF_Color* pSrc)
-{
- ReleaseBuffer();
- ReleaseColorSpace();
- m_pCS = pSrc->m_pCS;
- if (m_pCS && m_pCS->m_pDocument) {
- CPDF_Array* pArray = m_pCS->GetArray();
- if (pArray) {
- m_pCS = m_pCS->m_pDocument->GetPageData()->GetCopiedColorSpace(pArray);
- }
- }
- if (m_pCS == NULL) {
- return;
- }
- m_pBuffer = m_pCS->CreateBuf();
- FXSYS_memcpy32(m_pBuffer, pSrc->m_pBuffer, m_pCS->GetBufSize());
- if (m_pCS->GetFamily() == PDFCS_PATTERN) {
- PatternValue* pvalue = (PatternValue*)m_pBuffer;
- if (pvalue->m_pPattern && pvalue->m_pPattern->m_pDocument) {
- pvalue->m_pPattern = pvalue->m_pPattern->m_pDocument->GetPageData()->GetPattern(pvalue->m_pPattern->m_pPatternObj, FALSE, &pvalue->m_pPattern->m_ParentMatrix);
- }
- }
-}
-FX_BOOL CPDF_Color::GetRGB(int& R, int& G, int& B) const
-{
- if (m_pCS == NULL || m_pBuffer == NULL) {
- return FALSE;
- }
- FX_FLOAT r, g, b;
- if (!m_pCS->GetRGB(m_pBuffer, r, g, b)) {
- return FALSE;
- }
- R = (FX_INT32)(r * 255 + 0.5f);
- G = (FX_INT32)(g * 255 + 0.5f);
- B = (FX_INT32)(b * 255 + 0.5f);
- return TRUE;
-}
-CPDF_Pattern* CPDF_Color::GetPattern() const
-{
- if (m_pBuffer == NULL || m_pCS->GetFamily() != PDFCS_PATTERN) {
- return NULL;
- }
- PatternValue* pvalue = (PatternValue*)m_pBuffer;
- return pvalue->m_pPattern;
-}
-CPDF_ColorSpace* CPDF_Color::GetPatternCS() const
-{
- if (m_pBuffer == NULL || m_pCS->GetFamily() != PDFCS_PATTERN) {
- return NULL;
- }
- return m_pCS->GetBaseCS();
-}
-FX_FLOAT* CPDF_Color::GetPatternColor() const
-{
- if (m_pBuffer == NULL || m_pCS->GetFamily() != PDFCS_PATTERN) {
- return NULL;
- }
- PatternValue* pvalue = (PatternValue*)m_pBuffer;
- return pvalue->m_nComps ? pvalue->m_Comps : NULL;
-}
-FX_BOOL CPDF_Color::IsEqual(const CPDF_Color& other) const
-{
- if (m_pCS != other.m_pCS || m_pCS == NULL) {
- return FALSE;
- }
- return FXSYS_memcmp32(m_pBuffer, other.m_pBuffer, m_pCS->GetBufSize()) == 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
+
+#include "../../../include/fpdfapi/fpdf_page.h"
+#include "../../../include/fpdfapi/fpdf_module.h"
+#include "../../../include/fxcodec/fx_codec.h"
+#include "pageint.h"
+#include <limits.h>
+void sRGB_to_AdobeCMYK(FX_FLOAT R, FX_FLOAT G, FX_FLOAT B, FX_FLOAT& c, FX_FLOAT& m, FX_FLOAT& y, FX_FLOAT& k)
+{
+ c = 1.0f - R;
+ m = 1.0f - G;
+ y = 1.0f - B;
+ k = c;
+ if (m < k) {
+ k = m;
+ }
+ if (y < k) {
+ k = y;
+ }
+}
+CPDF_DeviceCS::CPDF_DeviceCS(int family)
+{
+ m_Family = family;
+ if (m_Family == PDFCS_DEVICERGB) {
+ m_nComponents = 3;
+ } else if (m_Family == PDFCS_DEVICEGRAY) {
+ m_nComponents = 1;
+ } else {
+ m_nComponents = 4;
+ }
+}
+FX_BOOL CPDF_DeviceCS::GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const
+{
+ if (m_Family == PDFCS_DEVICERGB) {
+ R = pBuf[0];
+ if (R < 0) {
+ R = 0;
+ } else if (R > 1) {
+ R = 1;
+ }
+ G = pBuf[1];
+ if (G < 0) {
+ G = 0;
+ } else if (G > 1) {
+ G = 1;
+ }
+ B = pBuf[2];
+ if (B < 0) {
+ B = 0;
+ } else if (B > 1) {
+ B = 1;
+ }
+ } else if (m_Family == PDFCS_DEVICEGRAY) {
+ R = *pBuf;
+ if (R < 0) {
+ R = 0;
+ } else if (R > 1) {
+ R = 1;
+ }
+ G = B = R;
+ } else if (m_Family == PDFCS_DEVICECMYK) {
+ if (!m_dwStdConversion) {
+ AdobeCMYK_to_sRGB(pBuf[0], pBuf[1], pBuf[2], pBuf[3], R, G, B);
+ } else {
+ FX_FLOAT k = pBuf[3];
+ R = 1.0f - FX_MIN(1.0f, pBuf[0] + k);
+ G = 1.0f - FX_MIN(1.0f, pBuf[1] + k);
+ B = 1.0f - FX_MIN(1.0f, pBuf[2] + k);
+ }
+ } else {
+ ASSERT(m_Family == PDFCS_PATTERN);
+ R = G = B = 0;
+ return FALSE;
+ }
+ return TRUE;
+}
+FX_BOOL CPDF_DeviceCS::v_GetCMYK(FX_FLOAT* pBuf, FX_FLOAT& c, FX_FLOAT& m, FX_FLOAT& y, FX_FLOAT& k) const
+{
+ if (m_Family != PDFCS_DEVICECMYK) {
+ return FALSE;
+ }
+ c = pBuf[0];
+ m = pBuf[1];
+ y = pBuf[2];
+ k = pBuf[3];
+ return TRUE;
+}
+FX_BOOL CPDF_DeviceCS::SetRGB(FX_FLOAT* pBuf, FX_FLOAT R, FX_FLOAT G, FX_FLOAT B) const
+{
+ if (m_Family == PDFCS_DEVICERGB) {
+ pBuf[0] = R;
+ pBuf[1] = G;
+ pBuf[2] = B;
+ return TRUE;
+ } else if (m_Family == PDFCS_DEVICEGRAY) {
+ if (R == G && R == B) {
+ *pBuf = R;
+ return TRUE;
+ } else {
+ return FALSE;
+ }
+ } else if (m_Family == PDFCS_DEVICECMYK) {
+ sRGB_to_AdobeCMYK(R, G, B, pBuf[0], pBuf[1], pBuf[2], pBuf[3]);
+ return TRUE;
+ }
+ return FALSE;
+}
+FX_BOOL CPDF_DeviceCS::v_SetCMYK(FX_FLOAT* pBuf, FX_FLOAT c, FX_FLOAT m, FX_FLOAT y, FX_FLOAT k) const
+{
+ if (m_Family == PDFCS_DEVICERGB) {
+ AdobeCMYK_to_sRGB(c, m, y, k, pBuf[0], pBuf[1], pBuf[2]);
+ return TRUE;
+ } else if (m_Family == PDFCS_DEVICEGRAY) {
+ return FALSE;
+ } else if (m_Family == PDFCS_DEVICECMYK) {
+ pBuf[0] = c;
+ pBuf[1] = m;
+ pBuf[2] = y;
+ pBuf[3] = k;
+ return TRUE;
+ }
+ return FALSE;
+}
+static void ReverseRGB(FX_LPBYTE pDestBuf, FX_LPCBYTE pSrcBuf, int pixels)
+{
+ if (pDestBuf == pSrcBuf)
+ for (int i = 0; i < pixels; i ++) {
+ FX_BYTE temp = pDestBuf[2];
+ pDestBuf[2] = pDestBuf[0];
+ pDestBuf[0] = temp;
+ pDestBuf += 3;
+ }
+ else
+ for (int i = 0; i < pixels; i ++) {
+ *pDestBuf ++ = pSrcBuf[2];
+ *pDestBuf ++ = pSrcBuf[1];
+ *pDestBuf ++ = pSrcBuf[0];
+ pSrcBuf += 3;
+ }
+}
+void CPDF_DeviceCS::TranslateImageLine(FX_LPBYTE pDestBuf, FX_LPCBYTE pSrcBuf, int pixels, int image_width, int image_height, FX_BOOL bTransMask) const
+{
+ if (bTransMask && m_Family == PDFCS_DEVICECMYK) {
+ for (int i = 0; i < pixels; i ++) {
+ int k = 255 - pSrcBuf[3];
+ pDestBuf[0] = ((255 - pSrcBuf[0]) * k) / 255;
+ pDestBuf[1] = ((255 - pSrcBuf[1]) * k) / 255;
+ pDestBuf[2] = ((255 - pSrcBuf[2]) * k) / 255;
+ pDestBuf += 3;
+ pSrcBuf += 4;
+ }
+ return;
+ }
+ if (m_Family == PDFCS_DEVICERGB) {
+ ReverseRGB(pDestBuf, pSrcBuf, pixels);
+ } else if (m_Family == PDFCS_DEVICEGRAY) {
+ for (int i = 0; i < pixels; i ++) {
+ *pDestBuf ++ = pSrcBuf[i];
+ *pDestBuf ++ = pSrcBuf[i];
+ *pDestBuf ++ = pSrcBuf[i];
+ }
+ } else {
+ for (int i = 0; i < pixels; i ++) {
+ if (!m_dwStdConversion) {
+ AdobeCMYK_to_sRGB1(pSrcBuf[0], pSrcBuf[1], pSrcBuf[2], pSrcBuf[3], pDestBuf[2], pDestBuf[1], pDestBuf[0]);
+ } else {
+ FX_BYTE k = pSrcBuf[3];
+ pDestBuf[2] = 255 - FX_MIN(255, pSrcBuf[0] + k);
+ pDestBuf[1] = 255 - FX_MIN(255, pSrcBuf[1] + k);
+ pDestBuf[0] = 255 - FX_MIN(255, pSrcBuf[2] + k);
+ }
+ pSrcBuf += 4;
+ pDestBuf += 3;
+ }
+ }
+}
+const FX_BYTE g_sRGBSamples1[] = {
+ 0, 3, 6, 10, 13, 15, 18, 20, 22, 23, 25, 27, 28, 30, 31, 32,
+ 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
+ 49, 50, 51, 52, 53, 53, 54, 55, 56, 56, 57, 58, 58, 59, 60, 61,
+ 61, 62, 62, 63, 64, 64, 65, 66, 66, 67, 67, 68, 68, 69, 70, 70,
+ 71, 71, 72, 72, 73, 73, 74, 74, 75, 76, 76, 77, 77, 78, 78, 79,
+ 79, 79, 80, 80, 81, 81, 82, 82, 83, 83, 84, 84, 85, 85, 85, 86,
+ 86, 87, 87, 88, 88, 88, 89, 89, 90, 90, 91, 91, 91, 92, 92, 93,
+ 93, 93, 94, 94, 95, 95, 95, 96, 96, 97, 97, 97, 98, 98, 98, 99,
+ 99, 99, 100, 100, 101, 101, 101, 102, 102, 102, 103, 103, 103, 104, 104, 104,
+ 105, 105, 106, 106, 106, 107, 107, 107, 108, 108, 108, 109, 109, 109, 110, 110,
+ 110, 110, 111, 111, 111, 112, 112, 112, 113, 113, 113, 114, 114, 114, 115, 115,
+ 115, 115, 116, 116, 116, 117, 117, 117, 118, 118, 118, 118, 119, 119, 119, 120,
+};
+const FX_BYTE g_sRGBSamples2[] = {
+ 120, 121, 122, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136,
+ 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 148, 149, 150, 151,
+ 152, 153, 154, 155, 155, 156, 157, 158, 159, 159, 160, 161, 162, 163, 163, 164,
+ 165, 166, 167, 167, 168, 169, 170, 170, 171, 172, 173, 173, 174, 175, 175, 176,
+ 177, 178, 178, 179, 180, 180, 181, 182, 182, 183, 184, 185, 185, 186, 187, 187,
+ 188, 189, 189, 190, 190, 191, 192, 192, 193, 194, 194, 195, 196, 196, 197, 197,
+ 198, 199, 199, 200, 200, 201, 202, 202, 203, 203, 204, 205, 205, 206, 206, 207,
+ 208, 208, 209, 209, 210, 210, 211, 212, 212, 213, 213, 214, 214, 215, 215, 216,
+ 216, 217, 218, 218, 219, 219, 220, 220, 221, 221, 222, 222, 223, 223, 224, 224,
+ 225, 226, 226, 227, 227, 228, 228, 229, 229, 230, 230, 231, 231, 232, 232, 233,
+ 233, 234, 234, 235, 235, 236, 236, 237, 237, 238, 238, 238, 239, 239, 240, 240,
+ 241, 241, 242, 242, 243, 243, 244, 244, 245, 245, 246, 246, 246, 247, 247, 248,
+ 248, 249, 249, 250, 250, 251, 251, 251, 252, 252, 253, 253, 254, 254, 255, 255,
+};
+static void XYZ_to_sRGB(FX_FLOAT X, FX_FLOAT Y, FX_FLOAT Z, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B)
+{
+ FX_FLOAT R1 = 3.2410f * X - 1.5374f * Y - 0.4986f * Z;
+ FX_FLOAT G1 = -0.9692f * X + 1.8760f * Y + 0.0416f * Z;
+ FX_FLOAT B1 = 0.0556f * X - 0.2040f * Y + 1.0570f * Z;
+ if (R1 > 1) {
+ R1 = 1;
+ }
+ if (R1 < 0) {
+ R1 = 0;
+ }
+ if (G1 > 1) {
+ G1 = 1;
+ }
+ if (G1 < 0) {
+ G1 = 0;
+ }
+ if (B1 > 1) {
+ B1 = 1;
+ }
+ if (B1 < 0) {
+ B1 = 0;
+ }
+ int scale = (int)(R1 * 1023);
+ if (scale < 0) {
+ scale = 0;
+ }
+ if (scale < 192) {
+ R = (g_sRGBSamples1[scale] / 255.0f);
+ } else {
+ R = (g_sRGBSamples2[scale / 4 - 48] / 255.0f);
+ }
+ scale = (int)(G1 * 1023);
+ if (scale < 0) {
+ scale = 0;
+ }
+ if (scale < 192) {
+ G = (g_sRGBSamples1[scale] / 255.0f);
+ } else {
+ G = (g_sRGBSamples2[scale / 4 - 48] / 255.0f);
+ }
+ scale = (int)(B1 * 1023);
+ if (scale < 0) {
+ scale = 0;
+ }
+ if (scale < 192) {
+ B = (g_sRGBSamples1[scale] / 255.0f);
+ } else {
+ B = (g_sRGBSamples2[scale / 4 - 48] / 255.0f);
+ }
+}
+class CPDF_CalGray : public CPDF_ColorSpace
+{
+public:
+ CPDF_CalGray();
+ virtual FX_BOOL v_Load(CPDF_Document* pDoc, CPDF_Array* pArray);
+ virtual FX_BOOL GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const;
+ virtual void TranslateImageLine(FX_LPBYTE pDestBuf, FX_LPCBYTE pSrcBuf, int pixels, int image_width, int image_height, FX_BOOL bTransMask = FALSE) const;
+ FX_BOOL SetRGB(FX_FLOAT* pBuf, FX_FLOAT R, FX_FLOAT G, FX_FLOAT B) const;
+ FX_FLOAT m_WhitePoint[3];
+ FX_FLOAT m_BlackPoint[3];
+ FX_FLOAT m_Gamma;
+};
+CPDF_CalGray::CPDF_CalGray()
+{
+ m_Family = PDFCS_CALGRAY;
+ m_nComponents = 1;
+}
+FX_BOOL CPDF_CalGray::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray)
+{
+ CPDF_Dictionary* pDict = pArray->GetDict(1);
+ CPDF_Array* pParam = pDict->GetArray(FX_BSTRC("WhitePoint"));
+ int i;
+ for (i = 0; i < 3; i ++) {
+ m_WhitePoint[i] = pParam->GetNumber(i);
+ }
+ pParam = pDict->GetArray(FX_BSTRC("BlackPoint"));
+ for (i = 0; i < 3; i ++) {
+ m_BlackPoint[i] = pParam ? pParam->GetNumber(i) : 0;
+ }
+ m_Gamma = pDict->GetNumber(FX_BSTRC("Gamma"));
+ if (m_Gamma == 0) {
+ m_Gamma = 1.0f;
+ }
+ return TRUE;
+}
+FX_BOOL CPDF_CalGray::GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const
+{
+ R = G = B = *pBuf;
+ return TRUE;
+}
+FX_BOOL CPDF_CalGray::SetRGB(FX_FLOAT* pBuf, FX_FLOAT R, FX_FLOAT G, FX_FLOAT B) const
+{
+ if (R == G && R == B) {
+ *pBuf = R;
+ return TRUE;
+ } else {
+ return FALSE;
+ }
+}
+void CPDF_CalGray::TranslateImageLine(FX_LPBYTE pDestBuf, FX_LPCBYTE pSrcBuf, int pixels, int image_width, int image_height, FX_BOOL bTransMask) const
+{
+ for (int i = 0; i < pixels; i ++) {
+ *pDestBuf ++ = pSrcBuf[i];
+ *pDestBuf ++ = pSrcBuf[i];
+ *pDestBuf ++ = pSrcBuf[i];
+ }
+}
+class CPDF_CalRGB : public CPDF_ColorSpace
+{
+public:
+ CPDF_CalRGB();
+ virtual FX_BOOL v_Load(CPDF_Document* pDoc, CPDF_Array* pArray);
+ virtual FX_BOOL GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const;
+ virtual void TranslateImageLine(FX_LPBYTE pDestBuf, FX_LPCBYTE pSrcBuf, int pixels, int image_width, int image_height, FX_BOOL bTransMask = FALSE) const;
+ FX_BOOL SetRGB(FX_FLOAT* pBuf, FX_FLOAT R, FX_FLOAT G, FX_FLOAT B) const;
+ FX_FLOAT m_WhitePoint[3];
+ FX_FLOAT m_BlackPoint[3];
+ FX_FLOAT m_Gamma[3];
+ FX_FLOAT m_Matrix[9];
+ FX_BOOL m_bGamma, m_bMatrix;
+};
+CPDF_CalRGB::CPDF_CalRGB()
+{
+ m_Family = PDFCS_CALRGB;
+ m_nComponents = 3;
+}
+FX_BOOL CPDF_CalRGB::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray)
+{
+ CPDF_Dictionary* pDict = pArray->GetDict(1);
+ CPDF_Array* pParam = pDict->GetArray(FX_BSTRC("WhitePoint"));
+ int i;
+ for (i = 0; i < 3; i ++) {
+ m_WhitePoint[i] = pParam->GetNumber(i);
+ }
+ pParam = pDict->GetArray(FX_BSTRC("BlackPoint"));
+ for (i = 0; i < 3; i ++) {
+ m_BlackPoint[i] = pParam ? pParam->GetNumber(i) : 0;
+ }
+ pParam = pDict->GetArray(FX_BSTRC("Gamma"));
+ if (pParam) {
+ m_bGamma = TRUE;
+ for (i = 0; i < 3; i ++) {
+ m_Gamma[i] = pParam->GetNumber(i);
+ }
+ } else {
+ m_bGamma = FALSE;
+ }
+ pParam = pDict->GetArray(FX_BSTRC("Matrix"));
+ if (pParam) {
+ m_bMatrix = TRUE;
+ for (i = 0; i < 9; i ++) {
+ m_Matrix[i] = pParam->GetNumber(i);
+ }
+ } else {
+ m_bMatrix = FALSE;
+ }
+ return TRUE;
+}
+FX_BOOL CPDF_CalRGB::GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const
+{
+ FX_FLOAT A_ = pBuf[0];
+ FX_FLOAT B_ = pBuf[1];
+ FX_FLOAT C_ = pBuf[2];
+ if (m_bGamma) {
+ A_ = (FX_FLOAT)FXSYS_pow(A_, m_Gamma[0]);
+ B_ = (FX_FLOAT)FXSYS_pow(B_, m_Gamma[1]);
+ C_ = (FX_FLOAT)FXSYS_pow(C_, m_Gamma[2]);
+ }
+ FX_FLOAT X, Y, Z;
+ if (m_bMatrix) {
+ X = m_Matrix[0] * A_ + m_Matrix[3] * B_ + m_Matrix[6] * C_;
+ Y = m_Matrix[1] * A_ + m_Matrix[4] * B_ + m_Matrix[7] * C_;
+ Z = m_Matrix[2] * A_ + m_Matrix[5] * B_ + m_Matrix[8] * C_;
+ } else {
+ X = A_;
+ Y = B_;
+ Z = C_;
+ }
+ XYZ_to_sRGB(X, Y, Z, R, G, B);
+ return TRUE;
+}
+FX_BOOL CPDF_CalRGB::SetRGB(FX_FLOAT* pBuf, FX_FLOAT R, FX_FLOAT G, FX_FLOAT B) const
+{
+ pBuf[0] = R;
+ pBuf[1] = G;
+ pBuf[2] = B;
+ return TRUE;
+}
+void CPDF_CalRGB::TranslateImageLine(FX_LPBYTE pDestBuf, FX_LPCBYTE pSrcBuf, int pixels, int image_width, int image_height, FX_BOOL bTransMask) const
+{
+ if (bTransMask) {
+ FX_FLOAT Cal[3];
+ FX_FLOAT R, G, B;
+ for(int i = 0; i < pixels; i ++) {
+ Cal[0] = ((FX_FLOAT)pSrcBuf[2]) / 255;
+ Cal[1] = ((FX_FLOAT)pSrcBuf[1]) / 255;
+ Cal[2] = ((FX_FLOAT)pSrcBuf[0]) / 255;
+ GetRGB(Cal, R, G, B);
+ pDestBuf[0] = FXSYS_round(B * 255);
+ pDestBuf[1] = FXSYS_round(G * 255);
+ pDestBuf[2] = FXSYS_round(R * 255);
+ pSrcBuf += 3;
+ pDestBuf += 3;
+ }
+ }
+ ReverseRGB(pDestBuf, pSrcBuf, pixels);
+}
+class CPDF_LabCS : public CPDF_ColorSpace
+{
+public:
+ CPDF_LabCS()
+ {
+ m_Family = PDFCS_LAB;
+ m_nComponents = 3;
+ }
+ virtual FX_BOOL v_Load(CPDF_Document* pDoc, CPDF_Array* pArray);
+ virtual void GetDefaultValue(int iComponent, FX_FLOAT& value, FX_FLOAT& min, FX_FLOAT& max) const;
+ virtual FX_BOOL GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const;
+ FX_BOOL SetRGB(FX_FLOAT* pBuf, FX_FLOAT R, FX_FLOAT G, FX_FLOAT B) const;
+ virtual void TranslateImageLine(FX_LPBYTE pDestBuf, FX_LPCBYTE pSrcBuf, int pixels, int image_width, int image_height, FX_BOOL bTransMask = FALSE) const;
+ FX_FLOAT m_WhitePoint[3];
+ FX_FLOAT m_BlackPoint[3];
+ FX_FLOAT m_Ranges[4];
+};
+FX_BOOL CPDF_LabCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray)
+{
+ CPDF_Dictionary* pDict = pArray->GetDict(1);
+ CPDF_Array* pParam = pDict->GetArray(FX_BSTRC("WhitePoint"));
+ int i;
+ for (i = 0; i < 3; i ++) {
+ m_WhitePoint[i] = pParam->GetNumber(i);
+ }
+ pParam = pDict->GetArray(FX_BSTRC("BlackPoint"));
+ for (i = 0; i < 3; i ++) {
+ m_BlackPoint[i] = pParam ? pParam->GetNumber(i) : 0;
+ }
+ pParam = pDict->GetArray(FX_BSTRC("Range"));
+ const FX_FLOAT def_ranges[4] = { -100 * 1.0f, 100 * 1.0f, -100 * 1.0f, 100 * 1.0f};
+ for (i = 0; i < 4; i ++) {
+ m_Ranges[i] = pParam ? pParam->GetNumber(i) : def_ranges[i];
+ }
+ return TRUE;
+}
+void CPDF_LabCS::GetDefaultValue(int iComponent, FX_FLOAT& value, FX_FLOAT& min, FX_FLOAT& max) const
+{
+ value = 0;
+ if (iComponent == 0) {
+ min = 0;
+ max = 100 * 1.0f;
+ } else {
+ min = m_Ranges[iComponent * 2 - 2];
+ max = m_Ranges[iComponent * 2 - 1];
+ if (value < min) {
+ value = min;
+ } else if (value > max) {
+ value = max;
+ }
+ }
+}
+FX_BOOL CPDF_LabCS::GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const
+{
+ FX_FLOAT Lstar = pBuf[0];
+ FX_FLOAT astar = pBuf[1];
+ FX_FLOAT bstar = pBuf[2];
+ FX_FLOAT M = (Lstar + 16.0f) / 116.0f;
+ FX_FLOAT L = M + astar / 500.0f;
+ FX_FLOAT N = M - bstar / 200.0f;
+ FX_FLOAT X, Y, Z;
+ if (L < 0.2069f) {
+ X = 0.957f * 0.12842f * (L - 0.1379f);
+ } else {
+ X = 0.957f * L * L * L;
+ }
+ if (M < 0.2069f) {
+ Y = 0.12842f * (M - 0.1379f);
+ } else {
+ Y = M * M * M;
+ }
+ if (N < 0.2069f) {
+ Z = 1.0889f * 0.12842f * (N - 0.1379f);
+ } else {
+ Z = 1.0889f * N * N * N;
+ }
+ XYZ_to_sRGB(X, Y, Z, R, G, B);
+ return TRUE;
+}
+FX_BOOL CPDF_LabCS::SetRGB(FX_FLOAT* pBuf, FX_FLOAT R, FX_FLOAT G, FX_FLOAT B) const
+{
+ return FALSE;
+}
+void CPDF_LabCS::TranslateImageLine(FX_LPBYTE pDestBuf, FX_LPCBYTE pSrcBuf, int pixels, int image_width, int image_height, FX_BOOL bTransMask) const
+{
+ for (int i = 0; i < pixels; i ++) {
+ FX_FLOAT lab[3];
+ FX_FLOAT R, G, B;
+ lab[0] = (pSrcBuf[0] * 100 / 255.0f);
+ lab[1] = (FX_FLOAT)(pSrcBuf[1] - 128);
+ lab[2] = (FX_FLOAT)(pSrcBuf[2] - 128);
+ GetRGB(lab, R, G, B);
+ pDestBuf[0] = (FX_INT32)(B * 255);
+ pDestBuf[1] = (FX_INT32)(G * 255);
+ pDestBuf[2] = (FX_INT32)(R * 255);
+ pDestBuf += 3;
+ pSrcBuf += 3;
+ }
+}
+CPDF_IccProfile::CPDF_IccProfile(FX_LPCBYTE pData, FX_DWORD dwSize, int nComponents)
+{
+ m_bsRGB = nComponents == 3 && dwSize == 3144 && FXSYS_memcmp32(pData + 0x190, "sRGB IEC61966-2.1", 17) == 0;
+ m_pTransform = NULL;
+ if (!m_bsRGB && CPDF_ModuleMgr::Get()->GetIccModule()) {
+ m_pTransform = CPDF_ModuleMgr::Get()->GetIccModule()->CreateTransform_sRGB(pData, dwSize, nComponents);
+ }
+}
+CPDF_IccProfile::~CPDF_IccProfile()
+{
+ if (m_pTransform) {
+ CPDF_ModuleMgr::Get()->GetIccModule()->DestroyTransform(m_pTransform);
+ }
+}
+class CPDF_ICCBasedCS : public CPDF_ColorSpace
+{
+public:
+ CPDF_ICCBasedCS();
+ virtual ~CPDF_ICCBasedCS();
+ virtual FX_BOOL v_Load(CPDF_Document* pDoc, CPDF_Array* pArray);
+ void GetDefaultValue(int i, FX_FLOAT& min, FX_FLOAT& max) const
+ {
+ min = m_pRanges[i * 2];
+ max = m_pRanges[i * 2 + 1];
+ }
+ virtual FX_BOOL GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const;
+ FX_BOOL v_GetCMYK(FX_FLOAT* pBuf, FX_FLOAT& c, FX_FLOAT& m, FX_FLOAT& y, FX_FLOAT& k) const;
+ FX_BOOL SetRGB(FX_FLOAT* pBuf, FX_FLOAT R, FX_FLOAT G, FX_FLOAT B) const;
+ virtual void EnableStdConversion(FX_BOOL bEnabled);
+ virtual void TranslateImageLine(FX_LPBYTE pDestBuf, FX_LPCBYTE pSrcBuf, int pixels, int image_width, int image_height, FX_BOOL bTransMask = FALSE) const;
+ FX_FLOAT* m_pRanges;
+ CPDF_IccProfile* m_pProfile;
+ CPDF_ColorSpace* m_pAlterCS;
+ FX_LPBYTE m_pCache;
+ FX_BOOL m_bOwn;
+};
+CPDF_ICCBasedCS::CPDF_ICCBasedCS()
+{
+ m_pAlterCS = NULL;
+ m_pProfile = NULL;
+ m_Family = PDFCS_ICCBASED;
+ m_pCache = NULL;
+ m_pRanges = NULL;
+ m_bOwn = FALSE;
+}
+CPDF_ICCBasedCS::~CPDF_ICCBasedCS()
+{
+ if (m_pCache) {
+ FX_Free(m_pCache);
+ }
+ if (m_pRanges) {
+ FX_Free(m_pRanges);
+ }
+ if (m_pAlterCS && m_bOwn) {
+ m_pAlterCS->ReleaseCS();
+ }
+ if (m_pProfile && m_pDocument) {
+ m_pDocument->GetPageData()->ReleaseIccProfile(NULL, m_pProfile);
+ }
+}
+FX_BOOL CPDF_ICCBasedCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray)
+{
+ CPDF_Stream* pStream = pArray->GetStream(1);
+ if (pStream == NULL) {
+ return FALSE;
+ }
+ m_nComponents = pStream->GetDict()->GetInteger(FX_BSTRC("N"));
+ if (m_nComponents < 0 || m_nComponents > (1 << 16)) {
+ return FALSE;
+ }
+ CPDF_Array* pRanges = pStream->GetDict()->GetArray(FX_BSTRC("Range"));
+ m_pRanges = FX_Alloc(FX_FLOAT, m_nComponents * 2);
+ for (int i = 0; i < m_nComponents * 2; i ++) {
+ if (pRanges) {
+ m_pRanges[i] = pRanges->GetNumber(i);
+ } else if (i % 2) {
+ m_pRanges[i] = 1.0f;
+ } else {
+ m_pRanges[i] = 0;
+ }
+ }
+ m_pProfile = pDoc->LoadIccProfile(pStream, m_nComponents);
+ if (!m_pProfile) {
+ return FALSE;
+ }
+ if (m_pProfile->m_pTransform == NULL) {
+ CPDF_Object* pAlterCSObj = pStream->GetDict()->GetElementValue(FX_BSTRC("Alternate"));
+ if (pAlterCSObj) {
+ CPDF_ColorSpace* alter_cs = CPDF_ColorSpace::Load(pDoc, pAlterCSObj);
+ if (alter_cs) {
+ if (alter_cs->CountComponents() > m_nComponents) {
+ alter_cs->ReleaseCS();
+ } else {
+ m_pAlterCS = alter_cs;
+ m_bOwn = TRUE;
+ }
+ }
+ }
+ if (!m_pAlterCS) {
+ if (m_nComponents == 3) {
+ m_pAlterCS = GetStockCS(PDFCS_DEVICERGB);
+ } else if (m_nComponents == 4) {
+ m_pAlterCS = GetStockCS(PDFCS_DEVICECMYK);
+ } else {
+ m_pAlterCS = GetStockCS(PDFCS_DEVICEGRAY);
+ }
+ }
+ }
+ return TRUE;
+}
+FX_BOOL CPDF_ICCBasedCS::GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const
+{
+ if (m_pProfile && m_pProfile->m_bsRGB) {
+ R = pBuf[0];
+ G = pBuf[1];
+ B = pBuf[2];
+ return TRUE;
+ }
+ ICodec_IccModule *pIccModule = CPDF_ModuleMgr::Get()->GetIccModule();
+ if (m_pProfile->m_pTransform == NULL || pIccModule == NULL) {
+ if (m_pAlterCS) {
+ m_pAlterCS->GetRGB(pBuf, R, G, B);
+ } else {
+ R = G = B = 0.0f;
+ }
+ return TRUE;
+ }
+ FX_FLOAT rgb[3];
+ pIccModule->Translate(m_pProfile->m_pTransform, pBuf, rgb);
+ R = rgb[0];
+ G = rgb[1];
+ B = rgb[2];
+ return TRUE;
+}
+FX_BOOL CPDF_ICCBasedCS::v_GetCMYK(FX_FLOAT* pBuf, FX_FLOAT& c, FX_FLOAT& m, FX_FLOAT& y, FX_FLOAT& k) const
+{
+ if (m_nComponents != 4) {
+ return FALSE;
+ }
+ c = pBuf[0];
+ m = pBuf[1];
+ y = pBuf[2];
+ k = pBuf[3];
+ return TRUE;
+}
+FX_BOOL CPDF_ICCBasedCS::SetRGB(FX_FLOAT* pBuf, FX_FLOAT R, FX_FLOAT G, FX_FLOAT B) const
+{
+ return FALSE;
+}
+void CPDF_ICCBasedCS::EnableStdConversion(FX_BOOL bEnabled)
+{
+ CPDF_ColorSpace::EnableStdConversion(bEnabled);
+ if (m_pAlterCS) {
+ m_pAlterCS->EnableStdConversion(bEnabled);
+ }
+}
+void CPDF_ICCBasedCS::TranslateImageLine(FX_LPBYTE pDestBuf, FX_LPCBYTE pSrcBuf, int pixels, int image_width, int image_height, FX_BOOL bTransMask) const
+{
+ if (m_pProfile->m_bsRGB) {
+ ReverseRGB(pDestBuf, pSrcBuf, pixels);
+ } else if (m_pProfile->m_pTransform) {
+ int nMaxColors = 1;
+ for (int i = 0; i < m_nComponents; i ++) {
+ nMaxColors *= 52;
+ }
+ if (m_nComponents > 3 || image_width * image_height < nMaxColors * 3 / 2) {
+ CPDF_ModuleMgr::Get()->GetIccModule()->TranslateScanline(m_pProfile->m_pTransform, pDestBuf, pSrcBuf, pixels);
+ } else {
+ if (m_pCache == NULL) {
+ ((CPDF_ICCBasedCS*)this)->m_pCache = FX_Alloc(FX_BYTE, nMaxColors * 3);
+ FX_LPBYTE temp_src = FX_Alloc(FX_BYTE, nMaxColors * m_nComponents);
+ FX_LPBYTE pSrc = temp_src;
+ for (int i = 0; i < nMaxColors; i ++) {
+ FX_DWORD color = i;
+ FX_DWORD order = nMaxColors / 52;
+ for (int c = 0; c < m_nComponents; c ++) {
+ *pSrc++ = (FX_BYTE)(color / order * 5);
+ color %= order;
+ order /= 52;
+ }
+ }
+ CPDF_ModuleMgr::Get()->GetIccModule()->TranslateScanline(m_pProfile->m_pTransform, m_pCache, temp_src, nMaxColors);
+ FX_Free(temp_src);
+ }
+ for (int i = 0; i < pixels; i ++) {
+ int index = 0;
+ for (int c = 0; c < m_nComponents; c ++) {
+ index = index * 52 + (*pSrcBuf) / 5;
+ pSrcBuf ++;
+ }
+ index *= 3;
+ *pDestBuf++ = m_pCache[index];
+ *pDestBuf++ = m_pCache[index + 1];
+ *pDestBuf++ = m_pCache[index + 2];
+ }
+ }
+ } else if (m_pAlterCS) {
+ m_pAlterCS->TranslateImageLine(pDestBuf, pSrcBuf, pixels, image_width, image_height);
+ }
+}
+class CPDF_IndexedCS : public CPDF_ColorSpace
+{
+public:
+ CPDF_IndexedCS();
+ virtual ~CPDF_IndexedCS();
+ virtual FX_BOOL v_Load(CPDF_Document* pDoc, CPDF_Array* pArray);
+ void GetDefaultValue(int iComponent, FX_FLOAT& min, FX_FLOAT& max) const
+ {
+ min = 0;
+ max = (FX_FLOAT)m_MaxIndex;
+ }
+ virtual FX_BOOL GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const;
+ virtual CPDF_ColorSpace* GetBaseCS() const
+ {
+ return m_pBaseCS;
+ }
+ virtual void EnableStdConversion(FX_BOOL bEnabled);
+ CPDF_ColorSpace* m_pBaseCS;
+ int m_nBaseComponents;
+ int m_MaxIndex;
+ CFX_ByteString m_Table;
+ FX_FLOAT* m_pCompMinMax;
+};
+CPDF_IndexedCS::CPDF_IndexedCS()
+{
+ m_pBaseCS = NULL;
+ m_Family = PDFCS_INDEXED;
+ m_nComponents = 1;
+ m_pCompMinMax = NULL;
+}
+CPDF_IndexedCS::~CPDF_IndexedCS()
+{
+ if (m_pCompMinMax) {
+ FX_Free(m_pCompMinMax);
+ }
+ CPDF_ColorSpace* pCS = m_pBaseCS;
+ if (pCS && m_pDocument) {
+ m_pDocument->GetPageData()->ReleaseColorSpace(pCS->GetArray());
+ }
+}
+FX_BOOL CPDF_IndexedCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray)
+{
+ if (pArray->GetCount() < 4) {
+ return FALSE;
+ }
+ CPDF_Object* pBaseObj = pArray->GetElementValue(1);
+ if (pBaseObj == m_pArray) {
+ return FALSE;
+ }
+ CPDF_DocPageData* pDocPageData = pDoc->GetPageData();
+ m_pBaseCS = pDocPageData->GetColorSpace(pBaseObj, NULL);
+ if (m_pBaseCS == NULL) {
+ return FALSE;
+ }
+ m_nBaseComponents = m_pBaseCS->CountComponents();
+ m_pCompMinMax = FX_Alloc(FX_FLOAT, m_nBaseComponents * 2);
+ FX_FLOAT defvalue;
+ for (int i = 0; i < m_nBaseComponents; i ++) {
+ m_pBaseCS->GetDefaultValue(i, defvalue, m_pCompMinMax[i * 2], m_pCompMinMax[i * 2 + 1]);
+ m_pCompMinMax[i * 2 + 1] -= m_pCompMinMax[i * 2];
+ }
+ m_MaxIndex = pArray->GetInteger(2);
+ CPDF_Object* pTableObj = pArray->GetElementValue(3);
+ if (pTableObj == NULL) {
+ return FALSE;
+ }
+ FX_LPCBYTE pTable = NULL;
+ FX_DWORD size = 0;
+ CPDF_StreamAcc* pStreamAcc = NULL;
+ if (pTableObj->GetType() == PDFOBJ_STRING) {
+ m_Table = ((CPDF_String*)pTableObj)->GetString();
+ } else if (pTableObj->GetType() == PDFOBJ_STREAM) {
+ CPDF_StreamAcc acc;
+ acc.LoadAllData((CPDF_Stream*)pTableObj, FALSE);
+ m_Table = CFX_ByteStringC(acc.GetData(), acc.GetSize());
+ }
+ return TRUE;
+}
+FX_BOOL CPDF_IndexedCS::GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const
+{
+ int index = (FX_INT32)(*pBuf);
+ if (index < 0 || index > m_MaxIndex) {
+ return FALSE;
+ }
+ if (m_nBaseComponents) {
+ if (index == INT_MAX || (index + 1) > INT_MAX / m_nBaseComponents ||
+ (index + 1)*m_nBaseComponents > (int)m_Table.GetLength()) {
+ R = G = B = 0;
+ return FALSE;
+ }
+ }
+ CFX_FixedBufGrow<FX_FLOAT, 16> Comps(m_nBaseComponents);
+ FX_FLOAT* comps = Comps;
+ FX_LPCBYTE pTable = m_Table;
+ for (int i = 0; i < m_nBaseComponents; i ++) {
+ comps[i] = m_pCompMinMax[i * 2] + m_pCompMinMax[i * 2 + 1] * pTable[index * m_nBaseComponents + i] / 255;
+ }
+ m_pBaseCS->GetRGB(comps, R, G, B);
+ return TRUE;
+}
+void CPDF_IndexedCS::EnableStdConversion(FX_BOOL bEnabled)
+{
+ CPDF_ColorSpace::EnableStdConversion(bEnabled);
+ if (m_pBaseCS) {
+ m_pBaseCS->EnableStdConversion(bEnabled);
+ }
+}
+#define MAX_PATTERN_COLORCOMPS 16
+typedef struct _PatternValue {
+ CPDF_Pattern* m_pPattern;
+ int m_nComps;
+ FX_FLOAT m_Comps[MAX_PATTERN_COLORCOMPS];
+} PatternValue;
+CPDF_PatternCS::CPDF_PatternCS()
+{
+ m_Family = PDFCS_PATTERN;
+ m_pBaseCS = NULL;
+ m_nComponents = 1;
+}
+CPDF_PatternCS::~CPDF_PatternCS()
+{
+ CPDF_ColorSpace* pCS = m_pBaseCS;
+ if (pCS && m_pDocument) {
+ m_pDocument->GetPageData()->ReleaseColorSpace(pCS->GetArray());
+ }
+}
+FX_BOOL CPDF_PatternCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray)
+{
+ CPDF_Object* pBaseCS = pArray->GetElementValue(1);
+ if (pBaseCS == m_pArray) {
+ return FALSE;
+ }
+ CPDF_DocPageData* pDocPageData = pDoc->GetPageData();
+ m_pBaseCS = pDocPageData->GetColorSpace(pBaseCS, NULL);
+ if (m_pBaseCS) {
+ m_nComponents = m_pBaseCS->CountComponents() + 1;
+ if (m_pBaseCS->CountComponents() > MAX_PATTERN_COLORCOMPS) {
+ return FALSE;
+ }
+ } else {
+ m_nComponents = 1;
+ }
+ return TRUE;
+}
+FX_BOOL CPDF_PatternCS::GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const
+{
+ if (m_pBaseCS) {
+ PatternValue* pvalue = (PatternValue*)pBuf;
+ m_pBaseCS->GetRGB(pvalue->m_Comps, R, G, B);
+ return TRUE;
+ }
+ R = G = B = 0.75f;
+ return FALSE;
+}
+class CPDF_SeparationCS : public CPDF_ColorSpace
+{
+public:
+ CPDF_SeparationCS();
+ virtual ~CPDF_SeparationCS();
+ virtual void GetDefaultValue(int iComponent, FX_FLOAT& value, FX_FLOAT& min, FX_FLOAT& max) const
+ {
+ value = 1.0f;
+ min = 0;
+ max = 1.0f;
+ }
+ virtual FX_BOOL v_Load(CPDF_Document* pDoc, CPDF_Array* pArray);
+ virtual FX_BOOL GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const;
+ virtual void EnableStdConversion(FX_BOOL bEnabled);
+ CPDF_ColorSpace* m_pAltCS;
+ CPDF_Function* m_pFunc;
+ enum {None, All, Colorant} m_Type;
+};
+CPDF_SeparationCS::CPDF_SeparationCS()
+{
+ m_Family = PDFCS_SEPARATION;
+ m_pAltCS = NULL;
+ m_pFunc = NULL;
+ m_nComponents = 1;
+}
+CPDF_SeparationCS::~CPDF_SeparationCS()
+{
+ if (m_pAltCS) {
+ m_pAltCS->ReleaseCS();
+ }
+ if (m_pFunc) {
+ delete m_pFunc;
+ }
+}
+FX_BOOL CPDF_SeparationCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray)
+{
+ CFX_ByteString name = pArray->GetString(1);
+ if (name == FX_BSTRC("None")) {
+ m_Type = None;
+ } else {
+ m_Type = Colorant;
+ CPDF_Object* pAltCS = pArray->GetElementValue(2);
+ if (pAltCS == m_pArray) {
+ return FALSE;
+ }
+ m_pAltCS = Load(pDoc, pAltCS);
+ CPDF_Object* pFuncObj = pArray->GetElementValue(3);
+ if (pFuncObj && pFuncObj->GetType() != PDFOBJ_NAME) {
+ m_pFunc = CPDF_Function::Load(pFuncObj);
+ }
+ if (m_pFunc && m_pAltCS && m_pFunc->CountOutputs() < m_pAltCS->CountComponents()) {
+ delete m_pFunc;
+ m_pFunc = NULL;
+ }
+ }
+ return TRUE;
+}
+FX_BOOL CPDF_SeparationCS::GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const
+{
+ if (m_Type == None) {
+ return FALSE;
+ }
+ if (m_pFunc == NULL) {
+ if (m_pAltCS == NULL) {
+ return FALSE;
+ }
+ int nComps = m_pAltCS->CountComponents();
+ CFX_FixedBufGrow<FX_FLOAT, 16> results(nComps);
+ for (int i = 0; i < nComps; i ++) {
+ results[i] = *pBuf;
+ }
+ m_pAltCS->GetRGB(results, R, G, B);
+ return TRUE;
+ }
+ CFX_FixedBufGrow<FX_FLOAT, 16> results(m_pFunc->CountOutputs());
+ int nresults;
+ m_pFunc->Call(pBuf, 1, results, nresults);
+ if (nresults == 0) {
+ return FALSE;
+ }
+ if (m_pAltCS) {
+ m_pAltCS->GetRGB(results, R, G, B);
+ return TRUE;
+ } else {
+ R = G = B = 0;
+ return FALSE;
+ }
+}
+void CPDF_SeparationCS::EnableStdConversion(FX_BOOL bEnabled)
+{
+ CPDF_ColorSpace::EnableStdConversion(bEnabled);
+ if (m_pAltCS) {
+ m_pAltCS->EnableStdConversion(bEnabled);
+ }
+}
+class CPDF_DeviceNCS : public CPDF_ColorSpace
+{
+public:
+ CPDF_DeviceNCS();
+ virtual ~CPDF_DeviceNCS();
+ virtual void GetDefaultValue(int iComponent, FX_FLOAT& value, FX_FLOAT& min, FX_FLOAT& max) const
+ {
+ value = 1.0f;
+ min = 0;
+ max = 1.0f;
+ }
+ virtual FX_BOOL v_Load(CPDF_Document* pDoc, CPDF_Array* pArray);
+ virtual FX_BOOL GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const;
+ virtual void EnableStdConversion(FX_BOOL bEnabled);
+ CPDF_ColorSpace* m_pAltCS;
+ CPDF_Function* m_pFunc;
+};
+CPDF_DeviceNCS::CPDF_DeviceNCS()
+{
+ m_Family = PDFCS_DEVICEN;
+ m_pAltCS = NULL;
+ m_pFunc = NULL;
+}
+CPDF_DeviceNCS::~CPDF_DeviceNCS()
+{
+ if (m_pFunc) {
+ delete m_pFunc;
+ }
+ if (m_pAltCS) {
+ m_pAltCS->ReleaseCS();
+ }
+}
+FX_BOOL CPDF_DeviceNCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray)
+{
+ CPDF_Object* pObj = pArray->GetElementValue(1);
+ if (!pObj) {
+ return FALSE;
+ }
+ if (pObj->GetType() != PDFOBJ_ARRAY) {
+ return FALSE;
+ }
+ m_nComponents = ((CPDF_Array*)pObj)->GetCount();
+ CPDF_Object* pAltCS = pArray->GetElementValue(2);
+ if (!pAltCS || pAltCS == m_pArray) {
+ return FALSE;
+ }
+ m_pAltCS = Load(pDoc, pAltCS);
+ m_pFunc = CPDF_Function::Load(pArray->GetElementValue(3));
+ if (m_pAltCS == NULL || m_pFunc == NULL) {
+ return FALSE;
+ }
+ if (m_pFunc->CountOutputs() < m_pAltCS->CountComponents()) {
+ return FALSE;
+ }
+ return TRUE;
+}
+FX_BOOL CPDF_DeviceNCS::GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const
+{
+ if (m_pFunc == NULL) {
+ return FALSE;
+ }
+ CFX_FixedBufGrow<FX_FLOAT, 16> results(m_pFunc->CountOutputs());
+ int nresults;
+ m_pFunc->Call(pBuf, m_nComponents, results, nresults);
+ if (nresults == 0) {
+ return FALSE;
+ }
+ m_pAltCS->GetRGB(results, R, G, B);
+ return TRUE;
+}
+void CPDF_DeviceNCS::EnableStdConversion(FX_BOOL bEnabled)
+{
+ CPDF_ColorSpace::EnableStdConversion(bEnabled);
+ if (m_pAltCS) {
+ m_pAltCS->EnableStdConversion(bEnabled);
+ }
+}
+CPDF_ColorSpace* CPDF_ColorSpace::GetStockCS(int family)
+{
+ return CPDF_ModuleMgr::Get()->GetPageModule()->GetStockCS(family);;
+}
+CPDF_ColorSpace* _CSFromName(const CFX_ByteString& name)
+{
+ if (name == FX_BSTRC("DeviceRGB") || name == FX_BSTRC("RGB")) {
+ return CPDF_ColorSpace::GetStockCS(PDFCS_DEVICERGB);
+ }
+ if (name == FX_BSTRC("DeviceGray") || name == FX_BSTRC("G")) {
+ return CPDF_ColorSpace::GetStockCS(PDFCS_DEVICEGRAY);
+ }
+ if (name == FX_BSTRC("DeviceCMYK") || name == FX_BSTRC("CMYK")) {
+ return CPDF_ColorSpace::GetStockCS(PDFCS_DEVICECMYK);
+ }
+ if (name == FX_BSTRC("Pattern")) {
+ return CPDF_ColorSpace::GetStockCS(PDFCS_PATTERN);
+ }
+ return NULL;
+}
+CPDF_ColorSpace* CPDF_ColorSpace::Load(CPDF_Document* pDoc, CPDF_Object* pObj)
+{
+ if (pObj == NULL) {
+ return NULL;
+ }
+ if (pObj->GetType() == PDFOBJ_NAME) {
+ return _CSFromName(pObj->GetString());
+ }
+ if (pObj->GetType() == PDFOBJ_STREAM) {
+ CPDF_Dictionary *pDict = ((CPDF_Stream *)pObj)->GetDict();
+ if (!pDict) {
+ return NULL;
+ }
+ CPDF_ColorSpace *pRet = NULL;
+ FX_POSITION pos = pDict->GetStartPos();
+ while (pos) {
+ CFX_ByteString bsKey;
+ CPDF_Object *pValue = pDict->GetNextElement(pos, bsKey);
+ if (pValue->GetType() == PDFOBJ_NAME) {
+ pRet = _CSFromName(pValue->GetString());
+ }
+ if (pRet) {
+ return pRet;
+ }
+ }
+ return NULL;
+ }
+ if (pObj->GetType() != PDFOBJ_ARRAY) {
+ return NULL;
+ }
+ CPDF_Array* pArray = (CPDF_Array*)pObj;
+ if (pArray->GetCount() == 0) {
+ return NULL;
+ }
+ CFX_ByteString familyname = pArray->GetElementValue(0)->GetString();
+ if (pArray->GetCount() == 1) {
+ return _CSFromName(familyname);
+ }
+ CPDF_ColorSpace* pCS = NULL;
+ FX_DWORD id = familyname.GetID();
+ if (id == FXBSTR_ID('C', 'a', 'l', 'G')) {
+ pCS = FX_NEW CPDF_CalGray();
+ } else if (id == FXBSTR_ID('C', 'a', 'l', 'R')) {
+ pCS = FX_NEW CPDF_CalRGB();
+ } else if (id == FXBSTR_ID('L', 'a', 'b', 0)) {
+ pCS = FX_NEW CPDF_LabCS();
+ } else if (id == FXBSTR_ID('I', 'C', 'C', 'B')) {
+ pCS = FX_NEW CPDF_ICCBasedCS();
+ } else if (id == FXBSTR_ID('I', 'n', 'd', 'e') || id == FXBSTR_ID('I', 0, 0, 0)) {
+ pCS = FX_NEW CPDF_IndexedCS();
+ } else if (id == FXBSTR_ID('S', 'e', 'p', 'a')) {
+ pCS = FX_NEW CPDF_SeparationCS();
+ } else if (id == FXBSTR_ID('D', 'e', 'v', 'i')) {
+ pCS = FX_NEW CPDF_DeviceNCS();
+ } else if (id == FXBSTR_ID('P', 'a', 't', 't')) {
+ pCS = FX_NEW CPDF_PatternCS();
+ } else {
+ return NULL;
+ }
+ pCS->m_pDocument = pDoc;
+ pCS->m_pArray = pArray;
+ if (!pCS->v_Load(pDoc, pArray)) {
+ pCS->ReleaseCS();
+ return NULL;
+ }
+ return pCS;
+}
+CPDF_ColorSpace::CPDF_ColorSpace()
+{
+ m_Family = 0;
+ m_pArray = NULL;
+ m_dwStdConversion = 0;
+ m_pDocument = NULL;
+}
+void CPDF_ColorSpace::ReleaseCS()
+{
+ if (this == GetStockCS(PDFCS_DEVICERGB)) {
+ return;
+ }
+ if (this == GetStockCS(PDFCS_DEVICEGRAY)) {
+ return;
+ }
+ if (this == GetStockCS(PDFCS_DEVICECMYK)) {
+ return;
+ }
+ if (this == GetStockCS(PDFCS_PATTERN)) {
+ return;
+ }
+ delete this;
+}
+int CPDF_ColorSpace::GetBufSize() const
+{
+ if (m_Family == PDFCS_PATTERN) {
+ return sizeof(PatternValue);
+ }
+ return m_nComponents * sizeof(FX_FLOAT);
+}
+FX_FLOAT* CPDF_ColorSpace::CreateBuf()
+{
+ int size = GetBufSize();
+ FX_BYTE* pBuf = FX_Alloc(FX_BYTE, size);
+ FXSYS_memset32(pBuf, 0, size);
+ return (FX_FLOAT*)pBuf;
+}
+FX_BOOL CPDF_ColorSpace::sRGB() const
+{
+ if (m_Family == PDFCS_DEVICERGB) {
+ return TRUE;
+ }
+ if (m_Family != PDFCS_ICCBASED) {
+ return FALSE;
+ }
+ CPDF_ICCBasedCS* pCS = (CPDF_ICCBasedCS*)this;
+ return pCS->m_pProfile->m_bsRGB;
+}
+FX_BOOL CPDF_ColorSpace::GetCMYK(FX_FLOAT* pBuf, FX_FLOAT& c, FX_FLOAT& m, FX_FLOAT& y, FX_FLOAT& k) const
+{
+ if (v_GetCMYK(pBuf, c, m, y, k)) {
+ return TRUE;
+ }
+ FX_FLOAT R, G, B;
+ if (!GetRGB(pBuf, R, G, B)) {
+ return FALSE;
+ }
+ sRGB_to_AdobeCMYK(R, G, B, c, m, y, k);
+ return TRUE;
+}
+FX_BOOL CPDF_ColorSpace::SetCMYK(FX_FLOAT* pBuf, FX_FLOAT c, FX_FLOAT m, FX_FLOAT y, FX_FLOAT k) const
+{
+ if (v_SetCMYK(pBuf, c, m, y, k)) {
+ return TRUE;
+ }
+ FX_FLOAT R, G, B;
+ AdobeCMYK_to_sRGB(c, m, y, k, R, G, B);
+ return SetRGB(pBuf, R, G, B);
+}
+void CPDF_ColorSpace::GetDefaultColor(FX_FLOAT* buf) const
+{
+ if (buf == NULL || m_Family == PDFCS_PATTERN) {
+ return;
+ }
+ FX_FLOAT min, max;
+ for (int i = 0; i < m_nComponents; i ++) {
+ GetDefaultValue(i, buf[i], min, max);
+ }
+}
+int CPDF_ColorSpace::GetMaxIndex() const
+{
+ if (m_Family != PDFCS_INDEXED) {
+ return 0;
+ }
+ CPDF_IndexedCS* pCS = (CPDF_IndexedCS*)this;
+ return pCS->m_MaxIndex;
+}
+void CPDF_ColorSpace::TranslateImageLine(FX_LPBYTE dest_buf, FX_LPCBYTE src_buf, int pixels, int image_width, int image_height, FX_BOOL bTransMask) const
+{
+ CFX_FixedBufGrow<FX_FLOAT, 16> srcbuf(m_nComponents);
+ FX_FLOAT* src = srcbuf;
+ FX_FLOAT R, G, B;
+ for (int i = 0; i < pixels; i ++) {
+ for (int j = 0; j < m_nComponents; j ++)
+ if (m_Family == PDFCS_INDEXED) {
+ src[j] = (FX_FLOAT)(*src_buf ++);
+ } else {
+ src[j] = (FX_FLOAT)(*src_buf ++) / 255;
+ }
+ GetRGB(src, R, G, B);
+ *dest_buf ++ = (FX_INT32)(B * 255);
+ *dest_buf ++ = (FX_INT32)(G * 255);
+ *dest_buf ++ = (FX_INT32)(R * 255);
+ }
+}
+void CPDF_ColorSpace::EnableStdConversion(FX_BOOL bEnabled)
+{
+ if (bEnabled) {
+ m_dwStdConversion ++;
+ } else if (m_dwStdConversion) {
+ m_dwStdConversion --;
+ }
+}
+CPDF_Color::CPDF_Color(int family)
+{
+ m_pCS = CPDF_ColorSpace::GetStockCS(family);
+ int nComps = 3;
+ if (family == PDFCS_DEVICEGRAY) {
+ nComps = 1;
+ } else if (family == PDFCS_DEVICECMYK) {
+ nComps = 4;
+ }
+ m_pBuffer = FX_Alloc(FX_FLOAT, nComps);
+ for (int i = 0; i < nComps; i ++) {
+ m_pBuffer[i] = 0;
+ }
+}
+CPDF_Color::~CPDF_Color()
+{
+ ReleaseBuffer();
+ ReleaseColorSpace();
+}
+void CPDF_Color::ReleaseBuffer()
+{
+ if (!m_pBuffer) {
+ return;
+ }
+ if (m_pCS->GetFamily() == PDFCS_PATTERN) {
+ PatternValue* pvalue = (PatternValue*)m_pBuffer;
+ CPDF_Pattern* pPattern = pvalue->m_pPattern;
+ if (pPattern && pPattern->m_pDocument) {
+ pPattern->m_pDocument->GetPageData()->ReleasePattern(pPattern->m_pPatternObj);
+ }
+ }
+ FX_Free(m_pBuffer);
+ m_pBuffer = NULL;
+}
+void CPDF_Color::ReleaseColorSpace()
+{
+ if (m_pCS && m_pCS->m_pDocument && m_pCS->GetArray()) {
+ m_pCS->m_pDocument->GetPageData()->ReleaseColorSpace(m_pCS->GetArray());
+ m_pCS = NULL;
+ }
+}
+void CPDF_Color::SetColorSpace(CPDF_ColorSpace* pCS)
+{
+ if (m_pCS == pCS) {
+ if (m_pBuffer == NULL) {
+ m_pBuffer = pCS->CreateBuf();
+ }
+ ReleaseColorSpace();
+ m_pCS = pCS;
+ return;
+ }
+ ReleaseBuffer();
+ ReleaseColorSpace();
+ m_pCS = pCS;
+ if (m_pCS) {
+ m_pBuffer = pCS->CreateBuf();
+ pCS->GetDefaultColor(m_pBuffer);
+ }
+}
+void CPDF_Color::SetValue(FX_FLOAT* comps)
+{
+ if (m_pBuffer == NULL) {
+ return;
+ }
+ if (m_pCS->GetFamily() != PDFCS_PATTERN) {
+ FXSYS_memcpy32(m_pBuffer, comps, m_pCS->CountComponents() * sizeof(FX_FLOAT));
+ }
+}
+void CPDF_Color::SetValue(CPDF_Pattern* pPattern, FX_FLOAT* comps, int ncomps)
+{
+ if (ncomps > MAX_PATTERN_COLORCOMPS) {
+ return;
+ }
+ if (m_pCS == NULL || m_pCS->GetFamily() != PDFCS_PATTERN) {
+ if (m_pBuffer) {
+ FX_Free(m_pBuffer);
+ }
+ m_pCS = CPDF_ColorSpace::GetStockCS(PDFCS_PATTERN);
+ m_pBuffer = m_pCS->CreateBuf();
+ }
+ CPDF_DocPageData* pDocPageData = NULL;
+ PatternValue* pvalue = (PatternValue*)m_pBuffer;
+ if (pvalue->m_pPattern && pvalue->m_pPattern->m_pDocument) {
+ pDocPageData = pvalue->m_pPattern->m_pDocument->GetPageData();
+ pDocPageData->ReleasePattern(pvalue->m_pPattern->m_pPatternObj);
+ }
+ pvalue->m_nComps = ncomps;
+ pvalue->m_pPattern = pPattern;
+ if (ncomps) {
+ FXSYS_memcpy32(pvalue->m_Comps, comps, ncomps * sizeof(FX_FLOAT));
+ }
+}
+void CPDF_Color::Copy(const CPDF_Color* pSrc)
+{
+ ReleaseBuffer();
+ ReleaseColorSpace();
+ m_pCS = pSrc->m_pCS;
+ if (m_pCS && m_pCS->m_pDocument) {
+ CPDF_Array* pArray = m_pCS->GetArray();
+ if (pArray) {
+ m_pCS = m_pCS->m_pDocument->GetPageData()->GetCopiedColorSpace(pArray);
+ }
+ }
+ if (m_pCS == NULL) {
+ return;
+ }
+ m_pBuffer = m_pCS->CreateBuf();
+ FXSYS_memcpy32(m_pBuffer, pSrc->m_pBuffer, m_pCS->GetBufSize());
+ if (m_pCS->GetFamily() == PDFCS_PATTERN) {
+ PatternValue* pvalue = (PatternValue*)m_pBuffer;
+ if (pvalue->m_pPattern && pvalue->m_pPattern->m_pDocument) {
+ pvalue->m_pPattern = pvalue->m_pPattern->m_pDocument->GetPageData()->GetPattern(pvalue->m_pPattern->m_pPatternObj, FALSE, &pvalue->m_pPattern->m_ParentMatrix);
+ }
+ }
+}
+FX_BOOL CPDF_Color::GetRGB(int& R, int& G, int& B) const
+{
+ if (m_pCS == NULL || m_pBuffer == NULL) {
+ return FALSE;
+ }
+ FX_FLOAT r, g, b;
+ if (!m_pCS->GetRGB(m_pBuffer, r, g, b)) {
+ return FALSE;
+ }
+ R = (FX_INT32)(r * 255 + 0.5f);
+ G = (FX_INT32)(g * 255 + 0.5f);
+ B = (FX_INT32)(b * 255 + 0.5f);
+ return TRUE;
+}
+CPDF_Pattern* CPDF_Color::GetPattern() const
+{
+ if (m_pBuffer == NULL || m_pCS->GetFamily() != PDFCS_PATTERN) {
+ return NULL;
+ }
+ PatternValue* pvalue = (PatternValue*)m_pBuffer;
+ return pvalue->m_pPattern;
+}
+CPDF_ColorSpace* CPDF_Color::GetPatternCS() const
+{
+ if (m_pBuffer == NULL || m_pCS->GetFamily() != PDFCS_PATTERN) {
+ return NULL;
+ }
+ return m_pCS->GetBaseCS();
+}
+FX_FLOAT* CPDF_Color::GetPatternColor() const
+{
+ if (m_pBuffer == NULL || m_pCS->GetFamily() != PDFCS_PATTERN) {
+ return NULL;
+ }
+ PatternValue* pvalue = (PatternValue*)m_pBuffer;
+ return pvalue->m_nComps ? pvalue->m_Comps : NULL;
+}
+FX_BOOL CPDF_Color::IsEqual(const CPDF_Color& other) const
+{
+ if (m_pCS != other.m_pCS || m_pCS == NULL) {
+ return FALSE;
+ }
+ return FXSYS_memcmp32(m_pBuffer, other.m_pBuffer, m_pCS->GetBufSize()) == 0;
+}
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp
index d4e5bef400..a9d2c4d695 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp
@@ -1,647 +1,647 @@
-// 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
-
-#include "../../../include/fpdfapi/fpdf_page.h"
-#include "../../../include/fpdfapi/fpdf_module.h"
-#include "../../../include/fdrm/fx_crypt.h"
-#include "../fpdf_font/font_int.h"
-#include "pageint.h"
-class CPDF_PageModule : public CPDF_PageModuleDef
-{
-public:
- CPDF_PageModule() : m_StockGrayCS(PDFCS_DEVICEGRAY), m_StockRGBCS(PDFCS_DEVICERGB),
- m_StockCMYKCS(PDFCS_DEVICECMYK) {}
- virtual ~CPDF_PageModule() {}
- virtual FX_BOOL Installed()
- {
- return TRUE;
- }
- virtual CPDF_DocPageData* CreateDocData(CPDF_Document* pDoc)
- {
- return FX_NEW CPDF_DocPageData(pDoc);
- }
- virtual void ReleaseDoc(CPDF_Document* pDoc);
- virtual void ClearDoc(CPDF_Document* pDoc);
- virtual CPDF_FontGlobals* GetFontGlobals()
- {
- return &m_FontGlobals;
- }
- virtual void ClearStockFont(CPDF_Document* pDoc)
- {
- m_FontGlobals.Clear(pDoc);
- }
- virtual CPDF_ColorSpace* GetStockCS(int family);
- virtual void NotifyCJKAvailable();
- CPDF_FontGlobals m_FontGlobals;
- CPDF_DeviceCS m_StockGrayCS;
- CPDF_DeviceCS m_StockRGBCS;
- CPDF_DeviceCS m_StockCMYKCS;
- CPDF_PatternCS m_StockPatternCS;
-};
-CPDF_ColorSpace* CPDF_PageModule::GetStockCS(int family)
-{
- if (family == PDFCS_DEVICEGRAY) {
- return &m_StockGrayCS;
- }
- if (family == PDFCS_DEVICERGB) {
- return &m_StockRGBCS;
- }
- if (family == PDFCS_DEVICECMYK) {
- return &m_StockCMYKCS;
- }
- if (family == PDFCS_PATTERN) {
- return &m_StockPatternCS;
- }
- return NULL;
-}
-void CPDF_ModuleMgr::InitPageModule()
-{
- if (m_pPageModule) {
- delete m_pPageModule;
- }
- CPDF_PageModule* pPageModule = FX_NEW CPDF_PageModule;
- m_pPageModule = pPageModule;
-}
-void CPDF_PageModule::ReleaseDoc(CPDF_Document* pDoc)
-{
- delete pDoc->GetPageData();
-}
-void CPDF_PageModule::ClearDoc(CPDF_Document* pDoc)
-{
- pDoc->GetPageData()->Clear(FALSE);
-}
-void CPDF_PageModule::NotifyCJKAvailable()
-{
- m_FontGlobals.m_CMapManager.ReloadAll();
-}
-CPDF_Font* CPDF_Document::LoadFont(CPDF_Dictionary* pFontDict)
-{
- if (!pFontDict) {
- return NULL;
- }
- return GetValidatePageData()->GetFont(pFontDict, FALSE);
-}
-CPDF_Font* CPDF_Document::FindFont(CPDF_Dictionary* pFontDict)
-{
- if (!pFontDict) {
- return NULL;
- }
- return GetValidatePageData()->GetFont(pFontDict, TRUE);
-}
-CPDF_StreamAcc* CPDF_Document::LoadFontFile(CPDF_Stream* pStream)
-{
- if (pStream == NULL) {
- return NULL;
- }
- return GetValidatePageData()->GetFontFileStreamAcc(pStream);
-}
-CPDF_ColorSpace* _CSFromName(const CFX_ByteString& name);
-CPDF_ColorSpace* CPDF_Document::LoadColorSpace(CPDF_Object* pCSObj, CPDF_Dictionary* pResources)
-{
- return GetValidatePageData()->GetColorSpace(pCSObj, pResources);
-}
-CPDF_Pattern* CPDF_Document::LoadPattern(CPDF_Object* pPatternObj, FX_BOOL bShading, const CFX_AffineMatrix* matrix)
-{
- return GetValidatePageData()->GetPattern(pPatternObj, bShading, matrix);
-}
-CPDF_IccProfile* CPDF_Document::LoadIccProfile(CPDF_Stream* pStream, int nComponents)
-{
- return GetValidatePageData()->GetIccProfile(pStream, nComponents);
-}
-CPDF_Image* CPDF_Document::LoadImageF(CPDF_Object* pObj)
-{
- if (!pObj) {
- return NULL;
- }
- FXSYS_assert(pObj->GetObjNum());
- return GetValidatePageData()->GetImage(pObj);
-}
-void CPDF_Document::RemoveColorSpaceFromPageData(CPDF_Object* pCSObj)
-{
- if (!pCSObj) {
- return;
- }
- GetPageData()->ReleaseColorSpace(pCSObj);
-}
-CPDF_DocPageData::CPDF_DocPageData(CPDF_Document *pPDFDoc)
- : m_pPDFDoc(pPDFDoc)
- , m_FontMap()
- , m_ColorSpaceMap()
- , m_PatternMap()
- , m_ImageMap()
- , m_IccProfileMap()
- , m_FontFileMap()
-{
- m_FontMap.InitHashTable(64);
- m_ColorSpaceMap.InitHashTable(32);
- m_PatternMap.InitHashTable(16);
- m_ImageMap.InitHashTable(64);
- m_IccProfileMap.InitHashTable(16);
- m_FontFileMap.InitHashTable(32);
-}
-CPDF_DocPageData::~CPDF_DocPageData()
-{
- Clear(FALSE);
- Clear(TRUE);
- FX_POSITION pos = NULL;
-}
-void CPDF_DocPageData::Clear(FX_BOOL bRelease)
-{
- FX_POSITION pos;
- FX_DWORD nCount;
- {
- pos = m_PatternMap.GetStartPosition();
- while (pos) {
- CPDF_Object* ptObj;
- CPDF_CountedObject<CPDF_Pattern*>* ptData;
- m_PatternMap.GetNextAssoc(pos, ptObj, ptData);
- nCount = ptData->m_nCount;
- if (bRelease || nCount < 2) {
- delete ptData->m_Obj;
- ptData->m_Obj = NULL;
- }
- }
- }
- {
- pos = m_FontMap.GetStartPosition();
- while (pos) {
- CPDF_Dictionary* fontDict;
- CPDF_CountedObject<CPDF_Font*>* fontData;
- m_FontMap.GetNextAssoc(pos, fontDict, fontData);
- nCount = fontData->m_nCount;
- if (bRelease || nCount < 2) {
- delete fontData->m_Obj;
- fontData->m_Obj = NULL;
- }
- }
- }
- {
- pos = m_ImageMap.GetStartPosition();
- while (pos) {
- FX_DWORD objNum;
- CPDF_CountedObject<CPDF_Image*>* imageData;
- m_ImageMap.GetNextAssoc(pos, objNum, imageData);
- nCount = imageData->m_nCount;
- if (bRelease || nCount < 2) {
- delete imageData->m_Obj;
- delete imageData;
- m_ImageMap.RemoveKey(objNum);
- }
- }
- }
- {
- pos = m_ColorSpaceMap.GetStartPosition();
- while (pos) {
- CPDF_Object* csKey;
- CPDF_CountedObject<CPDF_ColorSpace*>* csData;
- m_ColorSpaceMap.GetNextAssoc(pos, csKey, csData);
- nCount = csData->m_nCount;
- if (bRelease || nCount < 2) {
- csData->m_Obj->ReleaseCS();
- csData->m_Obj = NULL;
- }
- }
- }
- {
- pos = m_IccProfileMap.GetStartPosition();
- while (pos) {
- CPDF_Stream* ipKey;
- CPDF_CountedObject<CPDF_IccProfile*>* ipData;
- m_IccProfileMap.GetNextAssoc(pos, ipKey, ipData);
- nCount = ipData->m_nCount;
- if (bRelease || nCount < 2) {
- FX_POSITION pos2 = m_HashProfileMap.GetStartPosition();
- while (pos2) {
- CFX_ByteString bsKey;
- CPDF_Stream* pFindStream = NULL;
- m_HashProfileMap.GetNextAssoc(pos2, bsKey, (void*&)pFindStream);
- if (ipKey == pFindStream) {
- m_HashProfileMap.RemoveKey(bsKey);
- break;
- }
- }
- delete ipData->m_Obj;
- delete ipData;
- m_IccProfileMap.RemoveKey(ipKey);
- }
- }
- }
- {
- pos = m_FontFileMap.GetStartPosition();
- while (pos) {
- CPDF_Stream* ftKey;
- CPDF_CountedObject<CPDF_StreamAcc*>* ftData;
- m_FontFileMap.GetNextAssoc(pos, ftKey, ftData);
- nCount = ftData->m_nCount;
- if (bRelease || nCount < 2) {
- delete ftData->m_Obj;
- delete ftData;
- m_FontFileMap.RemoveKey(ftKey);
- }
- }
- }
-}
-CPDF_Font* CPDF_DocPageData::GetFont(CPDF_Dictionary* pFontDict, FX_BOOL findOnly)
-{
- if (!pFontDict) {
- return NULL;
- }
- if (findOnly) {
- CPDF_CountedObject<CPDF_Font*>* fontData;
- if (m_FontMap.Lookup(pFontDict, fontData)) {
- if (!fontData->m_Obj) {
- return NULL;
- }
- fontData->m_nCount ++;
- return fontData->m_Obj;
- }
- return NULL;
- }
- CPDF_CountedObject<CPDF_Font*>* fontData = NULL;
- if (m_FontMap.Lookup(pFontDict, fontData)) {
- if (fontData->m_Obj) {
- fontData->m_nCount ++;
- return fontData->m_Obj;
- }
- }
- FX_BOOL bNew = FALSE;
- if (!fontData) {
- fontData = FX_NEW CPDF_CountedObject<CPDF_Font*>;
- bNew = TRUE;
- if (!fontData) {
- return NULL;
- }
- }
- CPDF_Font* pFont = CPDF_Font::CreateFontF(m_pPDFDoc, pFontDict);
- if (!pFont) {
- if (bNew) {
- delete fontData;
- }
- return NULL;
- }
- fontData->m_nCount = 2;
- fontData->m_Obj = pFont;
- m_FontMap.SetAt(pFontDict, fontData);
- return pFont;
-}
-CPDF_Font* CPDF_DocPageData::GetStandardFont(FX_BSTR fontName, CPDF_FontEncoding* pEncoding)
-{
- if (fontName.IsEmpty()) {
- return NULL;
- }
- FX_POSITION pos = m_FontMap.GetStartPosition();
- while (pos) {
- CPDF_Dictionary* fontDict;
- CPDF_CountedObject<CPDF_Font*>* fontData;
- m_FontMap.GetNextAssoc(pos, fontDict, fontData);
- CPDF_Font* pFont = fontData->m_Obj;
- if (!pFont) {
- continue;
- }
- if (pFont->GetBaseFont() != fontName) {
- continue;
- }
- if (pFont->IsEmbedded()) {
- continue;
- }
- if (pFont->GetFontType() != PDFFONT_TYPE1) {
- continue;
- }
- if (pFont->GetFontDict()->KeyExist(FX_BSTRC("Widths"))) {
- continue;
- }
- CPDF_Type1Font* pT1Font = pFont->GetType1Font();
- if (pEncoding && !pT1Font->GetEncoding()->IsIdentical(pEncoding)) {
- continue;
- }
- fontData->m_nCount ++;
- return pFont;
- }
- CPDF_Dictionary* pDict = FX_NEW CPDF_Dictionary;
- pDict->SetAtName(FX_BSTRC("Type"), FX_BSTRC("Font"));
- pDict->SetAtName(FX_BSTRC("Subtype"), FX_BSTRC("Type1"));
- pDict->SetAtName(FX_BSTRC("BaseFont"), fontName);
- if (pEncoding) {
- pDict->SetAt(FX_BSTRC("Encoding"), pEncoding->Realize());
- }
- m_pPDFDoc->AddIndirectObject(pDict);
- CPDF_CountedObject<CPDF_Font*>* fontData = FX_NEW CPDF_CountedObject<CPDF_Font*>;
- if (!fontData) {
- return NULL;
- }
- CPDF_Font* pFont = CPDF_Font::CreateFontF(m_pPDFDoc, pDict);
- if (!pFont) {
- delete fontData;
- return NULL;
- }
- fontData->m_nCount = 2;
- fontData->m_Obj = pFont;
- m_FontMap.SetAt(pDict, fontData);
- return pFont;
-}
-void CPDF_DocPageData::ReleaseFont(CPDF_Dictionary* pFontDict)
-{
- if (!pFontDict) {
- return;
- }
- CPDF_CountedObject<CPDF_Font*>* fontData;
- if (!m_FontMap.Lookup(pFontDict, fontData)) {
- return;
- }
- if (fontData->m_Obj && --fontData->m_nCount == 0) {
- delete fontData->m_Obj;
- fontData->m_Obj = NULL;
- }
-}
-CPDF_ColorSpace* CPDF_DocPageData::GetColorSpace(CPDF_Object* pCSObj, CPDF_Dictionary* pResources)
-{
- if (!pCSObj) {
- return NULL;
- }
- if (pCSObj->GetType() == PDFOBJ_NAME) {
- CFX_ByteString name = pCSObj->GetConstString();
- CPDF_ColorSpace* pCS = _CSFromName(name);
- if (!pCS && pResources) {
- CPDF_Dictionary* pList = pResources->GetDict(FX_BSTRC("ColorSpace"));
- if (pList) {
- pCSObj = pList->GetElementValue(name);
- return GetColorSpace(pCSObj, NULL);
- }
- }
- if (pCS == NULL || pResources == NULL) {
- return pCS;
- }
- CPDF_Dictionary* pColorSpaces = pResources->GetDict(FX_BSTRC("ColorSpace"));
- if (pColorSpaces == NULL) {
- return pCS;
- }
- CPDF_Object* pDefaultCS = NULL;
- switch (pCS->GetFamily()) {
- case PDFCS_DEVICERGB:
- pDefaultCS = pColorSpaces->GetElementValue(FX_BSTRC("DefaultRGB"));
- break;
- case PDFCS_DEVICEGRAY:
- pDefaultCS = pColorSpaces->GetElementValue(FX_BSTRC("DefaultGray"));
- break;
- case PDFCS_DEVICECMYK:
- pDefaultCS = pColorSpaces->GetElementValue(FX_BSTRC("DefaultCMYK"));
- break;
- }
- if (pDefaultCS == NULL) {
- return pCS;
- }
- return GetColorSpace(pDefaultCS, NULL);
- }
- if (pCSObj->GetType() != PDFOBJ_ARRAY) {
- return NULL;
- }
- CPDF_Array* pArray = (CPDF_Array*)pCSObj;
- if (pArray->GetCount() == 0) {
- return NULL;
- }
- if (pArray->GetCount() == 1) {
- return GetColorSpace(pArray->GetElementValue(0), pResources);
- }
- CPDF_CountedObject<CPDF_ColorSpace*>* csData = NULL;
- if (m_ColorSpaceMap.Lookup(pCSObj, csData)) {
- if (csData->m_Obj) {
- csData->m_nCount++;
- return csData->m_Obj;
- }
- }
- FX_BOOL bNew = FALSE;
- if (!csData) {
- csData = FX_NEW CPDF_CountedObject<CPDF_ColorSpace*>;
- if (!csData) {
- return NULL;
- }
- bNew = TRUE;
- }
- CPDF_ColorSpace* pCS = CPDF_ColorSpace::Load(m_pPDFDoc, pArray);
- if (!pCS) {
- if (bNew) {
- delete csData;
- }
- return NULL;
- }
- csData->m_nCount = 2;
- csData->m_Obj = pCS;
- m_ColorSpaceMap.SetAt(pCSObj, csData);
- return pCS;
-}
-CPDF_ColorSpace* CPDF_DocPageData::GetCopiedColorSpace(CPDF_Object* pCSObj)
-{
- if (!pCSObj) {
- return NULL;
- }
- CPDF_CountedObject<CPDF_ColorSpace*>* csData;
- if (!m_ColorSpaceMap.Lookup(pCSObj, csData)) {
- return NULL;
- }
- if (!csData->m_Obj) {
- return NULL;
- }
- csData->m_nCount ++;
- return csData->m_Obj;
-}
-void CPDF_DocPageData::ReleaseColorSpace(CPDF_Object* pColorSpace)
-{
- if (!pColorSpace) {
- return;
- }
- CPDF_CountedObject<CPDF_ColorSpace*>* csData;
- if (!m_ColorSpaceMap.Lookup(pColorSpace, csData)) {
- return;
- }
- if (csData->m_Obj && --csData->m_nCount == 0) {
- csData->m_Obj->ReleaseCS();
- csData->m_Obj = NULL;
- }
-}
-CPDF_Pattern* CPDF_DocPageData::GetPattern(CPDF_Object* pPatternObj, FX_BOOL bShading, const CFX_AffineMatrix* matrix)
-{
- if (!pPatternObj) {
- return NULL;
- }
- CPDF_CountedObject<CPDF_Pattern*>* ptData = NULL;
- if (m_PatternMap.Lookup(pPatternObj, ptData)) {
- if (ptData->m_Obj) {
- ptData->m_nCount++;
- return ptData->m_Obj;
- }
- }
- FX_BOOL bNew = FALSE;
- if (!ptData) {
- ptData = FX_NEW CPDF_CountedObject<CPDF_Pattern*>;
- bNew = TRUE;
- if (!ptData) {
- return NULL;
- }
- }
- CPDF_Pattern* pPattern = NULL;
- if (bShading) {
- pPattern = FX_NEW CPDF_ShadingPattern(m_pPDFDoc, pPatternObj, bShading, matrix);
- } else {
- CPDF_Dictionary* pDict = pPatternObj->GetDict();
- if (pDict) {
- int type = pDict->GetInteger(FX_BSTRC("PatternType"));
- if (type == 1) {
- pPattern = FX_NEW CPDF_TilingPattern(m_pPDFDoc, pPatternObj, matrix);
- } else if (type == 2) {
- pPattern = FX_NEW CPDF_ShadingPattern(m_pPDFDoc, pPatternObj, FALSE, matrix);
- }
- }
- }
- if (!pPattern) {
- if (bNew) {
- delete ptData;
- }
- return NULL;
- }
- ptData->m_nCount = 2;
- ptData->m_Obj = pPattern;
- m_PatternMap.SetAt(pPatternObj, ptData);
- return pPattern;
-}
-void CPDF_DocPageData::ReleasePattern(CPDF_Object* pPatternObj)
-{
- if (!pPatternObj) {
- return;
- }
- CPDF_CountedObject<CPDF_Pattern*>* ptData;
- if (!m_PatternMap.Lookup(pPatternObj, ptData)) {
- return;
- }
- if (ptData->m_Obj && --ptData->m_nCount == 0) {
- delete ptData->m_Obj;
- ptData->m_Obj = NULL;
- }
-}
-CPDF_Image* CPDF_DocPageData::GetImage(CPDF_Object* pImageStream)
-{
- if (!pImageStream) {
- return NULL;
- }
- FX_DWORD dwImageObjNum = pImageStream->GetObjNum();
- CPDF_CountedObject<CPDF_Image*>* imageData;
- if (m_ImageMap.Lookup(dwImageObjNum, imageData)) {
- imageData->m_nCount ++;
- return imageData->m_Obj;
- }
- imageData = FX_NEW CPDF_CountedObject<CPDF_Image*>;
- if (!imageData) {
- return NULL;
- }
- CPDF_Image* pImage = FX_NEW CPDF_Image(m_pPDFDoc);
- if (!pImage) {
- delete imageData;
- return NULL;
- }
- pImage->LoadImageF((CPDF_Stream*)pImageStream, FALSE);
- imageData->m_nCount = 2;
- imageData->m_Obj = pImage;
- m_ImageMap.SetAt(dwImageObjNum, imageData);
- return pImage;
-}
-void CPDF_DocPageData::ReleaseImage(CPDF_Object* pImageStream)
-{
- if (!pImageStream) {
- return;
- }
- PDF_DocPageData_Release<FX_DWORD, CPDF_Image*>(m_ImageMap, pImageStream->GetObjNum(), NULL);
-}
-CPDF_IccProfile* CPDF_DocPageData::GetIccProfile(CPDF_Stream* pIccProfileStream, FX_INT32 nComponents)
-{
- if (!pIccProfileStream) {
- return NULL;
- }
- CPDF_CountedObject<CPDF_IccProfile*>* ipData = NULL;
- if (m_IccProfileMap.Lookup(pIccProfileStream, ipData)) {
- ipData->m_nCount++;
- return ipData->m_Obj;
- }
- CPDF_StreamAcc stream;
- stream.LoadAllData(pIccProfileStream, FALSE);
- FX_BYTE digest[20];
- CPDF_Stream* pCopiedStream = NULL;
- CRYPT_SHA1Generate(stream.GetData(), stream.GetSize(), digest);
- if (m_HashProfileMap.Lookup(CFX_ByteStringC(digest, 20), (void*&)pCopiedStream)) {
- m_IccProfileMap.Lookup(pCopiedStream, ipData);
- ipData->m_nCount++;
- return ipData->m_Obj;
- }
- CPDF_IccProfile* pProfile = FX_NEW CPDF_IccProfile(stream.GetData(), stream.GetSize(), nComponents);
- if (!pProfile) {
- return NULL;
- }
- ipData = FX_NEW CPDF_CountedObject<CPDF_IccProfile*>;
- if (!ipData) {
- delete pProfile;
- return NULL;
- }
- ipData->m_nCount = 2;
- ipData->m_Obj = pProfile;
- m_IccProfileMap.SetAt(pIccProfileStream, ipData);
- m_HashProfileMap.SetAt(CFX_ByteStringC(digest, 20), pIccProfileStream);
- return pProfile;
-}
-void CPDF_DocPageData::ReleaseIccProfile(CPDF_Stream* pIccProfileStream, CPDF_IccProfile* pIccProfile)
-{
- if (!pIccProfileStream && !pIccProfile) {
- return;
- }
- CPDF_CountedObject<CPDF_IccProfile*>* ipData = NULL;
- if (m_IccProfileMap.Lookup(pIccProfileStream, ipData) && ipData->m_nCount < 2) {
- FX_POSITION pos = m_HashProfileMap.GetStartPosition();
- while (pos) {
- CFX_ByteString key;
- CPDF_Stream* pFindStream = NULL;
- m_HashProfileMap.GetNextAssoc(pos, key, (void*&)pFindStream);
- if (pIccProfileStream == pFindStream) {
- m_HashProfileMap.RemoveKey(key);
- break;
- }
- }
- }
- PDF_DocPageData_Release<CPDF_Stream*, CPDF_IccProfile*>(m_IccProfileMap, pIccProfileStream, pIccProfile);
-}
-CPDF_StreamAcc* CPDF_DocPageData::GetFontFileStreamAcc(CPDF_Stream* pFontStream)
-{
- if (!pFontStream) {
- return NULL;
- }
- CPDF_CountedObject<CPDF_StreamAcc*>* ftData;
- if (m_FontFileMap.Lookup(pFontStream, ftData)) {
- ftData->m_nCount ++;
- return ftData->m_Obj;
- }
- ftData = FX_NEW CPDF_CountedObject<CPDF_StreamAcc*>;
- if (!ftData) {
- return NULL;
- }
- CPDF_StreamAcc* pFontFile = FX_NEW CPDF_StreamAcc;
- if (!pFontFile) {
- delete ftData;
- return NULL;
- }
- CPDF_Dictionary* pFontDict = pFontStream->GetDict();
- FX_INT32 org_size = pFontDict->GetInteger(FX_BSTRC("Length1")) + pFontDict->GetInteger(FX_BSTRC("Length2")) + pFontDict->GetInteger(FX_BSTRC("Length3"));
- if (org_size < 0) {
- org_size = 0;
- }
- pFontFile->LoadAllData(pFontStream, FALSE, org_size);
- ftData->m_nCount = 2;
- ftData->m_Obj = pFontFile;
- m_FontFileMap.SetAt(pFontStream, ftData);
- return pFontFile;
-}
-void CPDF_DocPageData::ReleaseFontFileStreamAcc(CPDF_Stream* pFontStream, FX_BOOL bForce)
-{
- if (!pFontStream) {
- return;
- }
- PDF_DocPageData_Release<CPDF_Stream*, CPDF_StreamAcc*>(m_FontFileMap, pFontStream, NULL, bForce);
-}
+// 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
+
+#include "../../../include/fpdfapi/fpdf_page.h"
+#include "../../../include/fpdfapi/fpdf_module.h"
+#include "../../../include/fdrm/fx_crypt.h"
+#include "../fpdf_font/font_int.h"
+#include "pageint.h"
+class CPDF_PageModule : public CPDF_PageModuleDef
+{
+public:
+ CPDF_PageModule() : m_StockGrayCS(PDFCS_DEVICEGRAY), m_StockRGBCS(PDFCS_DEVICERGB),
+ m_StockCMYKCS(PDFCS_DEVICECMYK) {}
+ virtual ~CPDF_PageModule() {}
+ virtual FX_BOOL Installed()
+ {
+ return TRUE;
+ }
+ virtual CPDF_DocPageData* CreateDocData(CPDF_Document* pDoc)
+ {
+ return FX_NEW CPDF_DocPageData(pDoc);
+ }
+ virtual void ReleaseDoc(CPDF_Document* pDoc);
+ virtual void ClearDoc(CPDF_Document* pDoc);
+ virtual CPDF_FontGlobals* GetFontGlobals()
+ {
+ return &m_FontGlobals;
+ }
+ virtual void ClearStockFont(CPDF_Document* pDoc)
+ {
+ m_FontGlobals.Clear(pDoc);
+ }
+ virtual CPDF_ColorSpace* GetStockCS(int family);
+ virtual void NotifyCJKAvailable();
+ CPDF_FontGlobals m_FontGlobals;
+ CPDF_DeviceCS m_StockGrayCS;
+ CPDF_DeviceCS m_StockRGBCS;
+ CPDF_DeviceCS m_StockCMYKCS;
+ CPDF_PatternCS m_StockPatternCS;
+};
+CPDF_ColorSpace* CPDF_PageModule::GetStockCS(int family)
+{
+ if (family == PDFCS_DEVICEGRAY) {
+ return &m_StockGrayCS;
+ }
+ if (family == PDFCS_DEVICERGB) {
+ return &m_StockRGBCS;
+ }
+ if (family == PDFCS_DEVICECMYK) {
+ return &m_StockCMYKCS;
+ }
+ if (family == PDFCS_PATTERN) {
+ return &m_StockPatternCS;
+ }
+ return NULL;
+}
+void CPDF_ModuleMgr::InitPageModule()
+{
+ if (m_pPageModule) {
+ delete m_pPageModule;
+ }
+ CPDF_PageModule* pPageModule = FX_NEW CPDF_PageModule;
+ m_pPageModule = pPageModule;
+}
+void CPDF_PageModule::ReleaseDoc(CPDF_Document* pDoc)
+{
+ delete pDoc->GetPageData();
+}
+void CPDF_PageModule::ClearDoc(CPDF_Document* pDoc)
+{
+ pDoc->GetPageData()->Clear(FALSE);
+}
+void CPDF_PageModule::NotifyCJKAvailable()
+{
+ m_FontGlobals.m_CMapManager.ReloadAll();
+}
+CPDF_Font* CPDF_Document::LoadFont(CPDF_Dictionary* pFontDict)
+{
+ if (!pFontDict) {
+ return NULL;
+ }
+ return GetValidatePageData()->GetFont(pFontDict, FALSE);
+}
+CPDF_Font* CPDF_Document::FindFont(CPDF_Dictionary* pFontDict)
+{
+ if (!pFontDict) {
+ return NULL;
+ }
+ return GetValidatePageData()->GetFont(pFontDict, TRUE);
+}
+CPDF_StreamAcc* CPDF_Document::LoadFontFile(CPDF_Stream* pStream)
+{
+ if (pStream == NULL) {
+ return NULL;
+ }
+ return GetValidatePageData()->GetFontFileStreamAcc(pStream);
+}
+CPDF_ColorSpace* _CSFromName(const CFX_ByteString& name);
+CPDF_ColorSpace* CPDF_Document::LoadColorSpace(CPDF_Object* pCSObj, CPDF_Dictionary* pResources)
+{
+ return GetValidatePageData()->GetColorSpace(pCSObj, pResources);
+}
+CPDF_Pattern* CPDF_Document::LoadPattern(CPDF_Object* pPatternObj, FX_BOOL bShading, const CFX_AffineMatrix* matrix)
+{
+ return GetValidatePageData()->GetPattern(pPatternObj, bShading, matrix);
+}
+CPDF_IccProfile* CPDF_Document::LoadIccProfile(CPDF_Stream* pStream, int nComponents)
+{
+ return GetValidatePageData()->GetIccProfile(pStream, nComponents);
+}
+CPDF_Image* CPDF_Document::LoadImageF(CPDF_Object* pObj)
+{
+ if (!pObj) {
+ return NULL;
+ }
+ FXSYS_assert(pObj->GetObjNum());
+ return GetValidatePageData()->GetImage(pObj);
+}
+void CPDF_Document::RemoveColorSpaceFromPageData(CPDF_Object* pCSObj)
+{
+ if (!pCSObj) {
+ return;
+ }
+ GetPageData()->ReleaseColorSpace(pCSObj);
+}
+CPDF_DocPageData::CPDF_DocPageData(CPDF_Document *pPDFDoc)
+ : m_pPDFDoc(pPDFDoc)
+ , m_FontMap()
+ , m_ColorSpaceMap()
+ , m_PatternMap()
+ , m_ImageMap()
+ , m_IccProfileMap()
+ , m_FontFileMap()
+{
+ m_FontMap.InitHashTable(64);
+ m_ColorSpaceMap.InitHashTable(32);
+ m_PatternMap.InitHashTable(16);
+ m_ImageMap.InitHashTable(64);
+ m_IccProfileMap.InitHashTable(16);
+ m_FontFileMap.InitHashTable(32);
+}
+CPDF_DocPageData::~CPDF_DocPageData()
+{
+ Clear(FALSE);
+ Clear(TRUE);
+ FX_POSITION pos = NULL;
+}
+void CPDF_DocPageData::Clear(FX_BOOL bRelease)
+{
+ FX_POSITION pos;
+ FX_DWORD nCount;
+ {
+ pos = m_PatternMap.GetStartPosition();
+ while (pos) {
+ CPDF_Object* ptObj;
+ CPDF_CountedObject<CPDF_Pattern*>* ptData;
+ m_PatternMap.GetNextAssoc(pos, ptObj, ptData);
+ nCount = ptData->m_nCount;
+ if (bRelease || nCount < 2) {
+ delete ptData->m_Obj;
+ ptData->m_Obj = NULL;
+ }
+ }
+ }
+ {
+ pos = m_FontMap.GetStartPosition();
+ while (pos) {
+ CPDF_Dictionary* fontDict;
+ CPDF_CountedObject<CPDF_Font*>* fontData;
+ m_FontMap.GetNextAssoc(pos, fontDict, fontData);
+ nCount = fontData->m_nCount;
+ if (bRelease || nCount < 2) {
+ delete fontData->m_Obj;
+ fontData->m_Obj = NULL;
+ }
+ }
+ }
+ {
+ pos = m_ImageMap.GetStartPosition();
+ while (pos) {
+ FX_DWORD objNum;
+ CPDF_CountedObject<CPDF_Image*>* imageData;
+ m_ImageMap.GetNextAssoc(pos, objNum, imageData);
+ nCount = imageData->m_nCount;
+ if (bRelease || nCount < 2) {
+ delete imageData->m_Obj;
+ delete imageData;
+ m_ImageMap.RemoveKey(objNum);
+ }
+ }
+ }
+ {
+ pos = m_ColorSpaceMap.GetStartPosition();
+ while (pos) {
+ CPDF_Object* csKey;
+ CPDF_CountedObject<CPDF_ColorSpace*>* csData;
+ m_ColorSpaceMap.GetNextAssoc(pos, csKey, csData);
+ nCount = csData->m_nCount;
+ if (bRelease || nCount < 2) {
+ csData->m_Obj->ReleaseCS();
+ csData->m_Obj = NULL;
+ }
+ }
+ }
+ {
+ pos = m_IccProfileMap.GetStartPosition();
+ while (pos) {
+ CPDF_Stream* ipKey;
+ CPDF_CountedObject<CPDF_IccProfile*>* ipData;
+ m_IccProfileMap.GetNextAssoc(pos, ipKey, ipData);
+ nCount = ipData->m_nCount;
+ if (bRelease || nCount < 2) {
+ FX_POSITION pos2 = m_HashProfileMap.GetStartPosition();
+ while (pos2) {
+ CFX_ByteString bsKey;
+ CPDF_Stream* pFindStream = NULL;
+ m_HashProfileMap.GetNextAssoc(pos2, bsKey, (void*&)pFindStream);
+ if (ipKey == pFindStream) {
+ m_HashProfileMap.RemoveKey(bsKey);
+ break;
+ }
+ }
+ delete ipData->m_Obj;
+ delete ipData;
+ m_IccProfileMap.RemoveKey(ipKey);
+ }
+ }
+ }
+ {
+ pos = m_FontFileMap.GetStartPosition();
+ while (pos) {
+ CPDF_Stream* ftKey;
+ CPDF_CountedObject<CPDF_StreamAcc*>* ftData;
+ m_FontFileMap.GetNextAssoc(pos, ftKey, ftData);
+ nCount = ftData->m_nCount;
+ if (bRelease || nCount < 2) {
+ delete ftData->m_Obj;
+ delete ftData;
+ m_FontFileMap.RemoveKey(ftKey);
+ }
+ }
+ }
+}
+CPDF_Font* CPDF_DocPageData::GetFont(CPDF_Dictionary* pFontDict, FX_BOOL findOnly)
+{
+ if (!pFontDict) {
+ return NULL;
+ }
+ if (findOnly) {
+ CPDF_CountedObject<CPDF_Font*>* fontData;
+ if (m_FontMap.Lookup(pFontDict, fontData)) {
+ if (!fontData->m_Obj) {
+ return NULL;
+ }
+ fontData->m_nCount ++;
+ return fontData->m_Obj;
+ }
+ return NULL;
+ }
+ CPDF_CountedObject<CPDF_Font*>* fontData = NULL;
+ if (m_FontMap.Lookup(pFontDict, fontData)) {
+ if (fontData->m_Obj) {
+ fontData->m_nCount ++;
+ return fontData->m_Obj;
+ }
+ }
+ FX_BOOL bNew = FALSE;
+ if (!fontData) {
+ fontData = FX_NEW CPDF_CountedObject<CPDF_Font*>;
+ bNew = TRUE;
+ if (!fontData) {
+ return NULL;
+ }
+ }
+ CPDF_Font* pFont = CPDF_Font::CreateFontF(m_pPDFDoc, pFontDict);
+ if (!pFont) {
+ if (bNew) {
+ delete fontData;
+ }
+ return NULL;
+ }
+ fontData->m_nCount = 2;
+ fontData->m_Obj = pFont;
+ m_FontMap.SetAt(pFontDict, fontData);
+ return pFont;
+}
+CPDF_Font* CPDF_DocPageData::GetStandardFont(FX_BSTR fontName, CPDF_FontEncoding* pEncoding)
+{
+ if (fontName.IsEmpty()) {
+ return NULL;
+ }
+ FX_POSITION pos = m_FontMap.GetStartPosition();
+ while (pos) {
+ CPDF_Dictionary* fontDict;
+ CPDF_CountedObject<CPDF_Font*>* fontData;
+ m_FontMap.GetNextAssoc(pos, fontDict, fontData);
+ CPDF_Font* pFont = fontData->m_Obj;
+ if (!pFont) {
+ continue;
+ }
+ if (pFont->GetBaseFont() != fontName) {
+ continue;
+ }
+ if (pFont->IsEmbedded()) {
+ continue;
+ }
+ if (pFont->GetFontType() != PDFFONT_TYPE1) {
+ continue;
+ }
+ if (pFont->GetFontDict()->KeyExist(FX_BSTRC("Widths"))) {
+ continue;
+ }
+ CPDF_Type1Font* pT1Font = pFont->GetType1Font();
+ if (pEncoding && !pT1Font->GetEncoding()->IsIdentical(pEncoding)) {
+ continue;
+ }
+ fontData->m_nCount ++;
+ return pFont;
+ }
+ CPDF_Dictionary* pDict = FX_NEW CPDF_Dictionary;
+ pDict->SetAtName(FX_BSTRC("Type"), FX_BSTRC("Font"));
+ pDict->SetAtName(FX_BSTRC("Subtype"), FX_BSTRC("Type1"));
+ pDict->SetAtName(FX_BSTRC("BaseFont"), fontName);
+ if (pEncoding) {
+ pDict->SetAt(FX_BSTRC("Encoding"), pEncoding->Realize());
+ }
+ m_pPDFDoc->AddIndirectObject(pDict);
+ CPDF_CountedObject<CPDF_Font*>* fontData = FX_NEW CPDF_CountedObject<CPDF_Font*>;
+ if (!fontData) {
+ return NULL;
+ }
+ CPDF_Font* pFont = CPDF_Font::CreateFontF(m_pPDFDoc, pDict);
+ if (!pFont) {
+ delete fontData;
+ return NULL;
+ }
+ fontData->m_nCount = 2;
+ fontData->m_Obj = pFont;
+ m_FontMap.SetAt(pDict, fontData);
+ return pFont;
+}
+void CPDF_DocPageData::ReleaseFont(CPDF_Dictionary* pFontDict)
+{
+ if (!pFontDict) {
+ return;
+ }
+ CPDF_CountedObject<CPDF_Font*>* fontData;
+ if (!m_FontMap.Lookup(pFontDict, fontData)) {
+ return;
+ }
+ if (fontData->m_Obj && --fontData->m_nCount == 0) {
+ delete fontData->m_Obj;
+ fontData->m_Obj = NULL;
+ }
+}
+CPDF_ColorSpace* CPDF_DocPageData::GetColorSpace(CPDF_Object* pCSObj, CPDF_Dictionary* pResources)
+{
+ if (!pCSObj) {
+ return NULL;
+ }
+ if (pCSObj->GetType() == PDFOBJ_NAME) {
+ CFX_ByteString name = pCSObj->GetConstString();
+ CPDF_ColorSpace* pCS = _CSFromName(name);
+ if (!pCS && pResources) {
+ CPDF_Dictionary* pList = pResources->GetDict(FX_BSTRC("ColorSpace"));
+ if (pList) {
+ pCSObj = pList->GetElementValue(name);
+ return GetColorSpace(pCSObj, NULL);
+ }
+ }
+ if (pCS == NULL || pResources == NULL) {
+ return pCS;
+ }
+ CPDF_Dictionary* pColorSpaces = pResources->GetDict(FX_BSTRC("ColorSpace"));
+ if (pColorSpaces == NULL) {
+ return pCS;
+ }
+ CPDF_Object* pDefaultCS = NULL;
+ switch (pCS->GetFamily()) {
+ case PDFCS_DEVICERGB:
+ pDefaultCS = pColorSpaces->GetElementValue(FX_BSTRC("DefaultRGB"));
+ break;
+ case PDFCS_DEVICEGRAY:
+ pDefaultCS = pColorSpaces->GetElementValue(FX_BSTRC("DefaultGray"));
+ break;
+ case PDFCS_DEVICECMYK:
+ pDefaultCS = pColorSpaces->GetElementValue(FX_BSTRC("DefaultCMYK"));
+ break;
+ }
+ if (pDefaultCS == NULL) {
+ return pCS;
+ }
+ return GetColorSpace(pDefaultCS, NULL);
+ }
+ if (pCSObj->GetType() != PDFOBJ_ARRAY) {
+ return NULL;
+ }
+ CPDF_Array* pArray = (CPDF_Array*)pCSObj;
+ if (pArray->GetCount() == 0) {
+ return NULL;
+ }
+ if (pArray->GetCount() == 1) {
+ return GetColorSpace(pArray->GetElementValue(0), pResources);
+ }
+ CPDF_CountedObject<CPDF_ColorSpace*>* csData = NULL;
+ if (m_ColorSpaceMap.Lookup(pCSObj, csData)) {
+ if (csData->m_Obj) {
+ csData->m_nCount++;
+ return csData->m_Obj;
+ }
+ }
+ FX_BOOL bNew = FALSE;
+ if (!csData) {
+ csData = FX_NEW CPDF_CountedObject<CPDF_ColorSpace*>;
+ if (!csData) {
+ return NULL;
+ }
+ bNew = TRUE;
+ }
+ CPDF_ColorSpace* pCS = CPDF_ColorSpace::Load(m_pPDFDoc, pArray);
+ if (!pCS) {
+ if (bNew) {
+ delete csData;
+ }
+ return NULL;
+ }
+ csData->m_nCount = 2;
+ csData->m_Obj = pCS;
+ m_ColorSpaceMap.SetAt(pCSObj, csData);
+ return pCS;
+}
+CPDF_ColorSpace* CPDF_DocPageData::GetCopiedColorSpace(CPDF_Object* pCSObj)
+{
+ if (!pCSObj) {
+ return NULL;
+ }
+ CPDF_CountedObject<CPDF_ColorSpace*>* csData;
+ if (!m_ColorSpaceMap.Lookup(pCSObj, csData)) {
+ return NULL;
+ }
+ if (!csData->m_Obj) {
+ return NULL;
+ }
+ csData->m_nCount ++;
+ return csData->m_Obj;
+}
+void CPDF_DocPageData::ReleaseColorSpace(CPDF_Object* pColorSpace)
+{
+ if (!pColorSpace) {
+ return;
+ }
+ CPDF_CountedObject<CPDF_ColorSpace*>* csData;
+ if (!m_ColorSpaceMap.Lookup(pColorSpace, csData)) {
+ return;
+ }
+ if (csData->m_Obj && --csData->m_nCount == 0) {
+ csData->m_Obj->ReleaseCS();
+ csData->m_Obj = NULL;
+ }
+}
+CPDF_Pattern* CPDF_DocPageData::GetPattern(CPDF_Object* pPatternObj, FX_BOOL bShading, const CFX_AffineMatrix* matrix)
+{
+ if (!pPatternObj) {
+ return NULL;
+ }
+ CPDF_CountedObject<CPDF_Pattern*>* ptData = NULL;
+ if (m_PatternMap.Lookup(pPatternObj, ptData)) {
+ if (ptData->m_Obj) {
+ ptData->m_nCount++;
+ return ptData->m_Obj;
+ }
+ }
+ FX_BOOL bNew = FALSE;
+ if (!ptData) {
+ ptData = FX_NEW CPDF_CountedObject<CPDF_Pattern*>;
+ bNew = TRUE;
+ if (!ptData) {
+ return NULL;
+ }
+ }
+ CPDF_Pattern* pPattern = NULL;
+ if (bShading) {
+ pPattern = FX_NEW CPDF_ShadingPattern(m_pPDFDoc, pPatternObj, bShading, matrix);
+ } else {
+ CPDF_Dictionary* pDict = pPatternObj->GetDict();
+ if (pDict) {
+ int type = pDict->GetInteger(FX_BSTRC("PatternType"));
+ if (type == 1) {
+ pPattern = FX_NEW CPDF_TilingPattern(m_pPDFDoc, pPatternObj, matrix);
+ } else if (type == 2) {
+ pPattern = FX_NEW CPDF_ShadingPattern(m_pPDFDoc, pPatternObj, FALSE, matrix);
+ }
+ }
+ }
+ if (!pPattern) {
+ if (bNew) {
+ delete ptData;
+ }
+ return NULL;
+ }
+ ptData->m_nCount = 2;
+ ptData->m_Obj = pPattern;
+ m_PatternMap.SetAt(pPatternObj, ptData);
+ return pPattern;
+}
+void CPDF_DocPageData::ReleasePattern(CPDF_Object* pPatternObj)
+{
+ if (!pPatternObj) {
+ return;
+ }
+ CPDF_CountedObject<CPDF_Pattern*>* ptData;
+ if (!m_PatternMap.Lookup(pPatternObj, ptData)) {
+ return;
+ }
+ if (ptData->m_Obj && --ptData->m_nCount == 0) {
+ delete ptData->m_Obj;
+ ptData->m_Obj = NULL;
+ }
+}
+CPDF_Image* CPDF_DocPageData::GetImage(CPDF_Object* pImageStream)
+{
+ if (!pImageStream) {
+ return NULL;
+ }
+ FX_DWORD dwImageObjNum = pImageStream->GetObjNum();
+ CPDF_CountedObject<CPDF_Image*>* imageData;
+ if (m_ImageMap.Lookup(dwImageObjNum, imageData)) {
+ imageData->m_nCount ++;
+ return imageData->m_Obj;
+ }
+ imageData = FX_NEW CPDF_CountedObject<CPDF_Image*>;
+ if (!imageData) {
+ return NULL;
+ }
+ CPDF_Image* pImage = FX_NEW CPDF_Image(m_pPDFDoc);
+ if (!pImage) {
+ delete imageData;
+ return NULL;
+ }
+ pImage->LoadImageF((CPDF_Stream*)pImageStream, FALSE);
+ imageData->m_nCount = 2;
+ imageData->m_Obj = pImage;
+ m_ImageMap.SetAt(dwImageObjNum, imageData);
+ return pImage;
+}
+void CPDF_DocPageData::ReleaseImage(CPDF_Object* pImageStream)
+{
+ if (!pImageStream) {
+ return;
+ }
+ PDF_DocPageData_Release<FX_DWORD, CPDF_Image*>(m_ImageMap, pImageStream->GetObjNum(), NULL);
+}
+CPDF_IccProfile* CPDF_DocPageData::GetIccProfile(CPDF_Stream* pIccProfileStream, FX_INT32 nComponents)
+{
+ if (!pIccProfileStream) {
+ return NULL;
+ }
+ CPDF_CountedObject<CPDF_IccProfile*>* ipData = NULL;
+ if (m_IccProfileMap.Lookup(pIccProfileStream, ipData)) {
+ ipData->m_nCount++;
+ return ipData->m_Obj;
+ }
+ CPDF_StreamAcc stream;
+ stream.LoadAllData(pIccProfileStream, FALSE);
+ FX_BYTE digest[20];
+ CPDF_Stream* pCopiedStream = NULL;
+ CRYPT_SHA1Generate(stream.GetData(), stream.GetSize(), digest);
+ if (m_HashProfileMap.Lookup(CFX_ByteStringC(digest, 20), (void*&)pCopiedStream)) {
+ m_IccProfileMap.Lookup(pCopiedStream, ipData);
+ ipData->m_nCount++;
+ return ipData->m_Obj;
+ }
+ CPDF_IccProfile* pProfile = FX_NEW CPDF_IccProfile(stream.GetData(), stream.GetSize(), nComponents);
+ if (!pProfile) {
+ return NULL;
+ }
+ ipData = FX_NEW CPDF_CountedObject<CPDF_IccProfile*>;
+ if (!ipData) {
+ delete pProfile;
+ return NULL;
+ }
+ ipData->m_nCount = 2;
+ ipData->m_Obj = pProfile;
+ m_IccProfileMap.SetAt(pIccProfileStream, ipData);
+ m_HashProfileMap.SetAt(CFX_ByteStringC(digest, 20), pIccProfileStream);
+ return pProfile;
+}
+void CPDF_DocPageData::ReleaseIccProfile(CPDF_Stream* pIccProfileStream, CPDF_IccProfile* pIccProfile)
+{
+ if (!pIccProfileStream && !pIccProfile) {
+ return;
+ }
+ CPDF_CountedObject<CPDF_IccProfile*>* ipData = NULL;
+ if (m_IccProfileMap.Lookup(pIccProfileStream, ipData) && ipData->m_nCount < 2) {
+ FX_POSITION pos = m_HashProfileMap.GetStartPosition();
+ while (pos) {
+ CFX_ByteString key;
+ CPDF_Stream* pFindStream = NULL;
+ m_HashProfileMap.GetNextAssoc(pos, key, (void*&)pFindStream);
+ if (pIccProfileStream == pFindStream) {
+ m_HashProfileMap.RemoveKey(key);
+ break;
+ }
+ }
+ }
+ PDF_DocPageData_Release<CPDF_Stream*, CPDF_IccProfile*>(m_IccProfileMap, pIccProfileStream, pIccProfile);
+}
+CPDF_StreamAcc* CPDF_DocPageData::GetFontFileStreamAcc(CPDF_Stream* pFontStream)
+{
+ if (!pFontStream) {
+ return NULL;
+ }
+ CPDF_CountedObject<CPDF_StreamAcc*>* ftData;
+ if (m_FontFileMap.Lookup(pFontStream, ftData)) {
+ ftData->m_nCount ++;
+ return ftData->m_Obj;
+ }
+ ftData = FX_NEW CPDF_CountedObject<CPDF_StreamAcc*>;
+ if (!ftData) {
+ return NULL;
+ }
+ CPDF_StreamAcc* pFontFile = FX_NEW CPDF_StreamAcc;
+ if (!pFontFile) {
+ delete ftData;
+ return NULL;
+ }
+ CPDF_Dictionary* pFontDict = pFontStream->GetDict();
+ FX_INT32 org_size = pFontDict->GetInteger(FX_BSTRC("Length1")) + pFontDict->GetInteger(FX_BSTRC("Length2")) + pFontDict->GetInteger(FX_BSTRC("Length3"));
+ if (org_size < 0) {
+ org_size = 0;
+ }
+ pFontFile->LoadAllData(pFontStream, FALSE, org_size);
+ ftData->m_nCount = 2;
+ ftData->m_Obj = pFontFile;
+ m_FontFileMap.SetAt(pFontStream, ftData);
+ return pFontFile;
+}
+void CPDF_DocPageData::ReleaseFontFileStreamAcc(CPDF_Stream* pFontStream, FX_BOOL bForce)
+{
+ if (!pFontStream) {
+ return;
+ }
+ PDF_DocPageData_Release<CPDF_Stream*, CPDF_StreamAcc*>(m_FontFileMap, pFontStream, NULL, bForce);
+}
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp
index 335460f320..5b178f955e 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp
@@ -1,886 +1,886 @@
-// 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
-
-#include "../../../include/fpdfapi/fpdf_page.h"
-#include "../../../include/fpdfapi/fpdf_module.h"
-#include "pageint.h"
-#include <limits.h>
-class CPDF_PSEngine;
-typedef enum {PSOP_ADD, PSOP_SUB, PSOP_MUL, PSOP_DIV, PSOP_IDIV, PSOP_MOD,
- PSOP_NEG, PSOP_ABS, PSOP_CEILING, PSOP_FLOOR, PSOP_ROUND, PSOP_TRUNCATE,
- PSOP_SQRT, PSOP_SIN, PSOP_COS, PSOP_ATAN, PSOP_EXP, PSOP_LN, PSOP_LOG,
- PSOP_CVI, PSOP_CVR, PSOP_EQ, PSOP_NE, PSOP_GT, PSOP_GE, PSOP_LT, PSOP_LE,
- PSOP_AND, PSOP_OR, PSOP_XOR, PSOP_NOT, PSOP_BITSHIFT, PSOP_TRUE, PSOP_FALSE,
- PSOP_IF, PSOP_IFELSE, PSOP_POP, PSOP_EXCH, PSOP_DUP, PSOP_COPY,
- PSOP_INDEX, PSOP_ROLL, PSOP_PROC, PSOP_CONST
- } PDF_PSOP;
-class CPDF_PSProc : public CFX_Object
-{
-public:
- ~CPDF_PSProc();
- FX_BOOL Parse(CPDF_SimpleParser& parser);
- FX_BOOL Execute(CPDF_PSEngine* pEngine);
- CFX_PtrArray m_Operators;
-};
-#define PSENGINE_STACKSIZE 100
-class CPDF_PSEngine : public CFX_Object
-{
-public:
- CPDF_PSEngine();
- ~CPDF_PSEngine();
- FX_BOOL Parse(const FX_CHAR* string, int size);
- FX_BOOL Execute()
- {
- return m_MainProc.Execute(this);
- }
- FX_BOOL DoOperator(PDF_PSOP op);
- void Reset()
- {
- m_StackCount = 0;
- }
- void Push(FX_FLOAT value);
- void Push(int value)
- {
- Push((FX_FLOAT)value);
- }
- FX_FLOAT Pop();
- int GetStackSize()
- {
- return m_StackCount;
- }
-private:
- FX_FLOAT m_Stack[PSENGINE_STACKSIZE];
- int m_StackCount;
- CPDF_PSProc m_MainProc;
-};
-CPDF_PSProc::~CPDF_PSProc()
-{
- int size = m_Operators.GetSize();
- for (int i = 0; i < size; i ++) {
- if (m_Operators[i] == (FX_LPVOID)PSOP_PROC) {
- delete (CPDF_PSProc*)m_Operators[i + 1];
- i ++;
- } else if (m_Operators[i] == (FX_LPVOID)PSOP_CONST) {
- FX_Free((FX_FLOAT*)m_Operators[i + 1]);
- i ++;
- }
- }
-}
-#pragma optimize( "", off )
-FX_BOOL CPDF_PSProc::Execute(CPDF_PSEngine* pEngine)
-{
- int size = m_Operators.GetSize();
- for (int i = 0; i < size; i ++) {
- PDF_PSOP op = (PDF_PSOP)(FX_UINTPTR)m_Operators[i];
- if (op == PSOP_PROC) {
- i ++;
- } else if (op == PSOP_CONST) {
- pEngine->Push(*(FX_FLOAT*)m_Operators[i + 1]);
- i ++;
- } else if (op == PSOP_IF) {
- if (i < 2 || m_Operators[i - 2] != (FX_LPVOID)PSOP_PROC) {
- return FALSE;
- }
- if ((int)pEngine->Pop()) {
- ((CPDF_PSProc*)m_Operators[i - 1])->Execute(pEngine);
- }
- } else if (op == PSOP_IFELSE) {
- if (i < 4 || m_Operators[i - 2] != (FX_LPVOID)PSOP_PROC ||
- m_Operators[i - 4] != (FX_LPVOID)PSOP_PROC) {
- return FALSE;
- }
- if ((int)pEngine->Pop()) {
- ((CPDF_PSProc*)m_Operators[i - 3])->Execute(pEngine);
- } else {
- ((CPDF_PSProc*)m_Operators[i - 1])->Execute(pEngine);
- }
- } else {
- pEngine->DoOperator(op);
- }
- }
- return TRUE;
-}
-#pragma optimize( "", on )
-CPDF_PSEngine::CPDF_PSEngine()
-{
- m_StackCount = 0;
-}
-CPDF_PSEngine::~CPDF_PSEngine()
-{
-}
-void CPDF_PSEngine::Push(FX_FLOAT v)
-{
- if (m_StackCount == 100) {
- return;
- }
- m_Stack[m_StackCount++] = v;
-}
-FX_FLOAT CPDF_PSEngine::Pop()
-{
- if (m_StackCount == 0) {
- return 0;
- }
- return m_Stack[--m_StackCount];
-}
-const struct _PDF_PSOpName {
- const FX_CHAR* name;
- PDF_PSOP op;
-} _PDF_PSOpNames[] = {
- {"add", PSOP_ADD}, {"sub", PSOP_SUB}, {"mul", PSOP_MUL}, {"div", PSOP_DIV},
- {"idiv", PSOP_IDIV}, {"mod", PSOP_MOD}, {"neg", PSOP_NEG}, {"abs", PSOP_ABS},
- {"ceiling", PSOP_CEILING}, {"floor", PSOP_FLOOR}, {"round", PSOP_ROUND},
- {"truncate", PSOP_TRUNCATE}, {"sqrt", PSOP_SQRT}, {"sin", PSOP_SIN},
- {"cos", PSOP_COS}, {"atan", PSOP_ATAN}, {"exp", PSOP_EXP}, {"ln", PSOP_LN},
- {"log", PSOP_LOG}, {"cvi", PSOP_CVI}, {"cvr", PSOP_CVR}, {"eq", PSOP_EQ},
- {"ne", PSOP_NE}, {"gt", PSOP_GT}, {"ge", PSOP_GE}, {"lt", PSOP_LT},
- {"le", PSOP_LE}, {"and", PSOP_AND}, {"or", PSOP_OR}, {"xor", PSOP_XOR},
- {"not", PSOP_NOT}, {"bitshift", PSOP_BITSHIFT}, {"true", PSOP_TRUE},
- {"false", PSOP_FALSE}, {"if", PSOP_IF}, {"ifelse", PSOP_IFELSE},
- {"pop", PSOP_POP}, {"exch", PSOP_EXCH}, {"dup", PSOP_DUP},
- {"copy", PSOP_COPY}, {"index", PSOP_INDEX}, {"roll", PSOP_ROLL},
- {NULL, PSOP_PROC}
-};
-FX_BOOL CPDF_PSEngine::Parse(const FX_CHAR* string, int size)
-{
- CPDF_SimpleParser parser((FX_LPBYTE)string, size);
- CFX_ByteStringC word = parser.GetWord();
- if (word != FX_BSTRC("{")) {
- return FALSE;
- }
- return m_MainProc.Parse(parser);
-}
-FX_BOOL CPDF_PSProc::Parse(CPDF_SimpleParser& parser)
-{
- while (1) {
- CFX_ByteStringC word = parser.GetWord();
- if (word.IsEmpty()) {
- return FALSE;
- }
- if (word == FX_BSTRC("}")) {
- return TRUE;
- }
- if (word == FX_BSTRC("{")) {
- CPDF_PSProc* pProc = FX_NEW CPDF_PSProc;
- m_Operators.Add((FX_LPVOID)PSOP_PROC);
- m_Operators.Add(pProc);
- if (!pProc->Parse(parser)) {
- return FALSE;
- }
- } else {
- int i = 0;
- while (_PDF_PSOpNames[i].name) {
- if (word == CFX_ByteStringC(_PDF_PSOpNames[i].name)) {
- m_Operators.Add((FX_LPVOID)_PDF_PSOpNames[i].op);
- break;
- }
- i ++;
- }
- if (_PDF_PSOpNames[i].name == NULL) {
- FX_FLOAT* pd = FX_Alloc(FX_FLOAT, 1);
- *pd = FX_atof(word);
- m_Operators.Add((FX_LPVOID)PSOP_CONST);
- m_Operators.Add(pd);
- }
- }
- }
-}
-#define PI 3.1415926535897932384626433832795f
-FX_BOOL CPDF_PSEngine::DoOperator(PDF_PSOP op)
-{
- int i1, i2;
- FX_FLOAT d1, d2;
- switch (op) {
- case PSOP_ADD:
- d1 = Pop();
- d2 = Pop();
- Push(d1 + d2);
- break;
- case PSOP_SUB:
- d2 = Pop();
- d1 = Pop();
- Push(d1 - d2);
- break;
- case PSOP_MUL:
- d1 = Pop();
- d2 = Pop();
- Push(d1 * d2);
- break;
- case PSOP_DIV:
- d2 = Pop();
- d1 = Pop();
- Push(d1 / d2);
- break;
- case PSOP_IDIV:
- i2 = (int)Pop();
- i1 = (int)Pop();
- Push(i1 / i2);
- break;
- case PSOP_MOD:
- i2 = (int)Pop();
- i1 = (int)Pop();
- Push(i1 % i2);
- break;
- case PSOP_NEG:
- d1 = Pop();
- Push(-d1);
- break;
- case PSOP_ABS:
- d1 = Pop();
- Push((FX_FLOAT)FXSYS_fabs(d1));
- break;
- case PSOP_CEILING:
- d1 = Pop();
- Push((FX_FLOAT)FXSYS_ceil(d1));
- break;
- case PSOP_FLOOR:
- d1 = Pop();
- Push((FX_FLOAT)FXSYS_floor(d1));
- break;
- case PSOP_ROUND:
- d1 = Pop();
- Push(FXSYS_round(d1));
- break;
- case PSOP_TRUNCATE:
- i1 = (int)Pop();
- Push(i1);
- break;
- case PSOP_SQRT:
- d1 = Pop();
- Push((FX_FLOAT)FXSYS_sqrt(d1));
- break;
- case PSOP_SIN:
- d1 = Pop();
- Push((FX_FLOAT)FXSYS_sin(d1 * PI / 180.0f));
- break;
- case PSOP_COS:
- d1 = Pop();
- Push((FX_FLOAT)FXSYS_cos(d1 * PI / 180.0f));
- break;
- case PSOP_ATAN:
- d2 = Pop();
- d1 = Pop();
- d1 = (FX_FLOAT)(FXSYS_atan2(d1, d2) * 180.0 / PI);
- if (d1 < 0) {
- d1 += 360;
- }
- Push(d1);
- break;
- case PSOP_EXP:
- d2 = Pop();
- d1 = Pop();
- Push((FX_FLOAT)FXSYS_pow(d1, d2));
- break;
- case PSOP_LN:
- d1 = Pop();
- Push((FX_FLOAT)FXSYS_log(d1));
- break;
- case PSOP_LOG:
- d1 = Pop();
- Push((FX_FLOAT)FXSYS_log10(d1));
- break;
- case PSOP_CVI:
- i1 = (int)Pop();
- Push(i1);
- break;
- case PSOP_CVR:
- break;
- case PSOP_EQ:
- d2 = Pop();
- d1 = Pop();
- Push((int)(d1 == d2));
- break;
- case PSOP_NE:
- d2 = Pop();
- d1 = Pop();
- Push((int)(d1 != d2));
- break;
- case PSOP_GT:
- d2 = Pop();
- d1 = Pop();
- Push((int)(d1 > d2));
- break;
- case PSOP_GE:
- d2 = Pop();
- d1 = Pop();
- Push((int)(d1 >= d2));
- break;
- case PSOP_LT:
- d2 = Pop();
- d1 = Pop();
- Push((int)(d1 < d2));
- break;
- case PSOP_LE:
- d2 = Pop();
- d1 = Pop();
- Push((int)(d1 <= d2));
- break;
- case PSOP_AND:
- i1 = (int)Pop();
- i2 = (int)Pop();
- Push(i1 & i2);
- break;
- case PSOP_OR:
- i1 = (int)Pop();
- i2 = (int)Pop();
- Push(i1 | i2);
- break;
- case PSOP_XOR:
- i1 = (int)Pop();
- i2 = (int)Pop();
- Push(i1 ^ i2);
- break;
- case PSOP_NOT:
- i1 = (int)Pop();
- Push((int)!i1);
- break;
- case PSOP_BITSHIFT: {
- int shift = (int)Pop();
- int i = (int)Pop();
- if (shift > 0) {
- Push(i << shift);
- } else {
- Push(i >> -shift);
- }
- break;
- }
- case PSOP_TRUE:
- Push(1);
- break;
- case PSOP_FALSE:
- Push(0);
- break;
- case PSOP_POP:
- Pop();
- break;
- case PSOP_EXCH:
- d2 = Pop();
- d1 = Pop();
- Push(d2);
- Push(d1);
- break;
- case PSOP_DUP:
- d1 = Pop();
- Push(d1);
- Push(d1);
- break;
- case PSOP_COPY: {
- int n = (int)Pop();
- if (n < 0 || n > PSENGINE_STACKSIZE || m_StackCount + n > PSENGINE_STACKSIZE || n > m_StackCount) {
- break;
- }
- for (int i = 0; i < n; i ++) {
- m_Stack[m_StackCount + i] = m_Stack[m_StackCount + i - n];
- }
- m_StackCount += n;
- break;
- }
- case PSOP_INDEX: {
- int n = (int)Pop();
- if (n < 0 || n >= m_StackCount) {
- break;
- }
- Push(m_Stack[m_StackCount - n - 1]);
- break;
- }
- case PSOP_ROLL: {
- int j = (int)Pop();
- int n = (int)Pop();
- if (m_StackCount == 0) {
- break;
- }
- if (n < 0 || n > m_StackCount) {
- break;
- }
- if (j < 0)
- for (int i = 0; i < -j; i ++) {
- FX_FLOAT first = m_Stack[m_StackCount - n];
- for (int ii = 0; ii < n - 1; ii ++) {
- m_Stack[m_StackCount - n + ii] = m_Stack[m_StackCount - n + ii + 1];
- }
- m_Stack[m_StackCount - 1] = first;
- }
- else
- for (int i = 0; i < j; i ++) {
- FX_FLOAT last = m_Stack[m_StackCount - 1];
- int ii;
- for (ii = 0; ii < n - 1; ii ++) {
- m_Stack[m_StackCount - ii - 1] = m_Stack[m_StackCount - ii - 2];
- }
- m_Stack[m_StackCount - ii - 1] = last;
- }
- break;
- }
- default:
- break;
- }
- return TRUE;
-}
-static FX_FLOAT PDF_Interpolate(FX_FLOAT x, FX_FLOAT xmin, FX_FLOAT xmax, FX_FLOAT ymin, FX_FLOAT ymax)
-{
- return ((x - xmin) * (ymax - ymin) / (xmax - xmin)) + ymin;
-}
-static FX_DWORD _GetBits32(FX_LPCBYTE pData, int bitpos, int nbits)
-{
- int result = 0;
- for (int i = 0; i < nbits; i ++)
- if (pData[(bitpos + i) / 8] & (1 << (7 - (bitpos + i) % 8))) {
- result |= 1 << (nbits - i - 1);
- }
- return result;
-}
-typedef struct {
- FX_FLOAT encode_max, encode_min;
- int sizes;
-} SampleEncodeInfo;
-typedef struct {
- FX_FLOAT decode_max, decode_min;
-} SampleDecodeInfo;
-class CPDF_SampledFunc : public CPDF_Function
-{
-public:
- CPDF_SampledFunc();
- virtual ~CPDF_SampledFunc();
- virtual FX_BOOL v_Init(CPDF_Object* pObj);
- virtual FX_BOOL v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const;
- SampleEncodeInfo* m_pEncodeInfo;
- SampleDecodeInfo* m_pDecodeInfo;
- FX_DWORD m_nBitsPerSample, m_SampleMax;
- CPDF_StreamAcc* m_pSampleStream;
-};
-CPDF_SampledFunc::CPDF_SampledFunc()
-{
- m_pSampleStream = NULL;
- m_pEncodeInfo = NULL;
- m_pDecodeInfo = NULL;
-}
-CPDF_SampledFunc::~CPDF_SampledFunc()
-{
- if (m_pSampleStream) {
- delete m_pSampleStream;
- }
- if (m_pEncodeInfo) {
- FX_Free(m_pEncodeInfo);
- }
- if (m_pDecodeInfo) {
- FX_Free(m_pDecodeInfo);
- }
-}
-FX_BOOL CPDF_SampledFunc::v_Init(CPDF_Object* pObj)
-{
- if (pObj->GetType() != PDFOBJ_STREAM) {
- return FALSE;
- }
- CPDF_Stream* pStream = (CPDF_Stream*)pObj;
- CPDF_Dictionary* pDict = pStream->GetDict();
- CPDF_Array* pSize = pDict->GetArray(FX_BSTRC("Size"));
- CPDF_Array* pEncode = pDict->GetArray(FX_BSTRC("Encode"));
- CPDF_Array* pDecode = pDict->GetArray(FX_BSTRC("Decode"));
- m_nBitsPerSample = pDict->GetInteger(FX_BSTRC("BitsPerSample"));
- m_SampleMax = 0xffffffff >> (32 - m_nBitsPerSample);
- m_pSampleStream = FX_NEW CPDF_StreamAcc;
- m_pSampleStream->LoadAllData(pStream, FALSE);
- m_pEncodeInfo = FX_Alloc(SampleEncodeInfo, m_nInputs);
- int i;
- FX_DWORD nTotalSamples = 1;
- for (i = 0; i < m_nInputs; i ++) {
- m_pEncodeInfo[i].sizes = pSize->GetInteger(i);
- if (!pSize && i == 0) {
- m_pEncodeInfo[i].sizes = pDict->GetInteger(FX_BSTRC("Size"));
- }
- if (nTotalSamples > 0 && (FX_UINT32)(m_pEncodeInfo[i].sizes) > UINT_MAX / nTotalSamples) {
- return FALSE;
- }
- nTotalSamples *= m_pEncodeInfo[i].sizes;
- if (pEncode) {
- m_pEncodeInfo[i].encode_min = pEncode->GetFloat(i * 2);
- m_pEncodeInfo[i].encode_max = pEncode->GetFloat(i * 2 + 1);
- } else {
- m_pEncodeInfo[i].encode_min = 0;
- if (m_pEncodeInfo[i].sizes == 1) {
- m_pEncodeInfo[i].encode_max = 1;
- } else {
- m_pEncodeInfo[i].encode_max = (FX_FLOAT)m_pEncodeInfo[i].sizes - 1;
- }
- }
- }
- if (nTotalSamples > 0 && m_nBitsPerSample > UINT_MAX / nTotalSamples) {
- return FALSE;
- }
- nTotalSamples *= m_nBitsPerSample;
- if (nTotalSamples > 0 && ((FX_UINT32)m_nOutputs) > UINT_MAX / nTotalSamples) {
- return FALSE;
- }
- nTotalSamples *= m_nOutputs;
- if (nTotalSamples == 0 || m_pSampleStream->GetSize() * 8 < nTotalSamples) {
- return FALSE;
- }
- m_pDecodeInfo = FX_Alloc(SampleDecodeInfo, m_nOutputs);
- for (i = 0; i < m_nOutputs; i ++) {
- if (pDecode) {
- m_pDecodeInfo[i].decode_min = pDecode->GetFloat(2 * i);
- m_pDecodeInfo[i].decode_max = pDecode->GetFloat(2 * i + 1);
- } else {
- m_pDecodeInfo[i].decode_min = m_pRanges[i * 2];
- m_pDecodeInfo[i].decode_max = m_pRanges[i * 2 + 1];
- }
- }
- return TRUE;
-}
-FX_BOOL CPDF_SampledFunc::v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const
-{
- int pos = 0;
- CFX_FixedBufGrow<FX_FLOAT, 16> encoded_input_buf(m_nInputs);
- FX_FLOAT* encoded_input = encoded_input_buf;
- CFX_FixedBufGrow<int, 32> int_buf(m_nInputs * 2);
- int* index = int_buf;
- int* blocksize = index + m_nInputs;
- for (int i = 0; i < m_nInputs; i ++) {
- if (i == 0) {
- blocksize[i] = 1;
- } else {
- blocksize[i] = blocksize[i - 1] * m_pEncodeInfo[i - 1].sizes;
- }
- encoded_input[i] = PDF_Interpolate(inputs[i], m_pDomains[i * 2], m_pDomains[i * 2 + 1],
- m_pEncodeInfo[i].encode_min, m_pEncodeInfo[i].encode_max);
- index[i] = (int)encoded_input[i];
- if (index[i] < 0) {
- index[i] = 0;
- } else if (index[i] > m_pEncodeInfo[i].sizes - 1) {
- index[i] = m_pEncodeInfo[i].sizes - 1;
- }
- pos += index[i] * blocksize[i];
- }
- int bitpos = pos * m_nBitsPerSample * m_nOutputs;
- FX_LPCBYTE pSampleData = m_pSampleStream->GetData();
- if (pSampleData == NULL) {
- return FALSE;
- }
- for (int j = 0; j < m_nOutputs; j ++) {
- FX_DWORD sample = _GetBits32(pSampleData, bitpos + j * m_nBitsPerSample, m_nBitsPerSample);
- FX_FLOAT encoded = (FX_FLOAT)sample;
- for (int i = 0; i < m_nInputs; i ++) {
- if (index[i] == m_pEncodeInfo[i].sizes - 1) {
- if (index[i] == 0) {
- encoded = encoded_input[i] * (FX_FLOAT)sample;
- }
- } else {
- int bitpos1 = bitpos + m_nBitsPerSample * m_nOutputs * blocksize[i];
- FX_DWORD sample1 = _GetBits32(pSampleData, bitpos1 + j * m_nBitsPerSample, m_nBitsPerSample);
- encoded += (encoded_input[i] - index[i]) * ((FX_FLOAT)sample1 - (FX_FLOAT)sample);
- }
- }
- results[j] = PDF_Interpolate(encoded, 0, (FX_FLOAT)m_SampleMax,
- m_pDecodeInfo[j].decode_min, m_pDecodeInfo[j].decode_max);
- }
- return TRUE;
-}
-class CPDF_PSFunc : public CPDF_Function
-{
-public:
- virtual FX_BOOL v_Init(CPDF_Object* pObj);
- virtual FX_BOOL v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const;
- CPDF_PSEngine m_PS;
-};
-FX_BOOL CPDF_PSFunc::v_Init(CPDF_Object* pObj)
-{
- CPDF_Stream* pStream = (CPDF_Stream*)pObj;
- CPDF_StreamAcc acc;
- acc.LoadAllData(pStream, FALSE);
- return m_PS.Parse((const FX_CHAR*)acc.GetData(), acc.GetSize());
-}
-FX_BOOL CPDF_PSFunc::v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const
-{
- CPDF_PSEngine& PS = (CPDF_PSEngine&)m_PS;
- PS.Reset();
- int i;
- for (i = 0; i < m_nInputs; i ++) {
- PS.Push(inputs[i]);
- }
- PS.Execute();
- if (PS.GetStackSize() < m_nOutputs) {
- return FALSE;
- }
- for (i = 0; i < m_nOutputs; i ++) {
- results[m_nOutputs - i - 1] = PS.Pop();
- }
- return TRUE;
-}
-class CPDF_ExpIntFunc : public CPDF_Function
-{
-public:
- CPDF_ExpIntFunc();
- virtual ~CPDF_ExpIntFunc();
- virtual FX_BOOL v_Init(CPDF_Object* pObj);
- virtual FX_BOOL v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const;
- FX_FLOAT m_Exponent;
- FX_FLOAT* m_pBeginValues;
- FX_FLOAT* m_pEndValues;
- int m_nOrigOutputs;
-};
-CPDF_ExpIntFunc::CPDF_ExpIntFunc()
-{
- m_pBeginValues = NULL;
- m_pEndValues = NULL;
-}
-CPDF_ExpIntFunc::~CPDF_ExpIntFunc()
-{
- if (m_pBeginValues) {
- FX_Free(m_pBeginValues);
- }
- if (m_pEndValues) {
- FX_Free(m_pEndValues);
- }
-}
-FX_BOOL CPDF_ExpIntFunc::v_Init(CPDF_Object* pObj)
-{
- CPDF_Dictionary* pDict = pObj->GetDict();
- if (pDict == NULL) {
- return FALSE;
- }
- CPDF_Array* pArray0 = pDict->GetArray(FX_BSTRC("C0"));
- if (m_nOutputs == 0) {
- m_nOutputs = 1;
- if (pArray0) {
- m_nOutputs = pArray0->GetCount();
- }
- }
- CPDF_Array* pArray1 = pDict->GetArray(FX_BSTRC("C1"));
- m_pBeginValues = FX_Alloc(FX_FLOAT, m_nOutputs * 2);
- m_pEndValues = FX_Alloc(FX_FLOAT, m_nOutputs * 2);
- for (int i = 0; i < m_nOutputs; i ++) {
- m_pBeginValues[i] = pArray0 ? pArray0->GetFloat(i) : 0.0f;
- m_pEndValues[i] = pArray1 ? pArray1->GetFloat(i) : 1.0f;
- }
- m_Exponent = pDict->GetFloat(FX_BSTRC("N"));
- m_nOrigOutputs = m_nOutputs;
- if (m_nOutputs && m_nInputs > INT_MAX / m_nOutputs) {
- return FALSE;
- }
- m_nOutputs *= m_nInputs;
- return TRUE;
-}
-FX_BOOL CPDF_ExpIntFunc::v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const
-{
- for (int i = 0; i < m_nInputs; i ++)
- for (int j = 0; j < m_nOrigOutputs; j ++) {
- results[i * m_nOrigOutputs + j] = m_pBeginValues[j] + (FX_FLOAT)FXSYS_pow(inputs[i], m_Exponent) *
- (m_pEndValues[j] - m_pBeginValues[j]);
- }
- return TRUE;
-}
-class CPDF_StitchFunc : public CPDF_Function
-{
-public:
- CPDF_StitchFunc();
- virtual ~CPDF_StitchFunc();
- virtual FX_BOOL v_Init(CPDF_Object* pObj);
- virtual FX_BOOL v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const;
- int m_nSubs;
- CPDF_Function** m_pSubFunctions;
- FX_FLOAT* m_pBounds;
- FX_FLOAT* m_pEncode;
-};
-CPDF_StitchFunc::CPDF_StitchFunc()
-{
- m_nSubs = 0;
- m_pSubFunctions = NULL;
- m_pBounds = NULL;
- m_pEncode = NULL;
-}
-CPDF_StitchFunc::~CPDF_StitchFunc()
-{
- for (int i = 0; i < m_nSubs; i ++)
- if (m_pSubFunctions[i]) {
- delete m_pSubFunctions[i];
- }
- if (m_pSubFunctions) {
- FX_Free(m_pSubFunctions);
- }
- if (m_pBounds) {
- FX_Free(m_pBounds);
- }
- if (m_pEncode) {
- FX_Free(m_pEncode);
- }
-}
-FX_BOOL CPDF_StitchFunc::v_Init(CPDF_Object* pObj)
-{
- CPDF_Dictionary* pDict = pObj->GetDict();
- if (pDict == NULL) {
- return FALSE;
- }
- CPDF_Array* pArray = pDict->GetArray(FX_BSTRC("Functions"));
- if (pArray == NULL) {
- return FALSE;
- }
- m_nSubs = pArray->GetCount();
- if (m_nSubs == 0) {
- return FALSE;
- }
- m_pSubFunctions = FX_Alloc(CPDF_Function*, m_nSubs);
- FXSYS_memset32(m_pSubFunctions, 0, sizeof(CPDF_Function*)*m_nSubs);
- m_nOutputs = 0;
- int i;
- for (i = 0; i < m_nSubs; i ++) {
- CPDF_Object* pSub = pArray->GetElementValue(i);
- if (pSub == pObj) {
- return FALSE;
- }
- m_pSubFunctions[i] = CPDF_Function::Load(pSub);
- if (m_pSubFunctions[i] == NULL) {
- return FALSE;
- }
- if (m_pSubFunctions[i]->CountOutputs() > m_nOutputs) {
- m_nOutputs = m_pSubFunctions[i]->CountOutputs();
- }
- }
- m_pBounds = FX_Alloc(FX_FLOAT, m_nSubs + 1);
- m_pBounds[0] = m_pDomains[0];
- pArray = pDict->GetArray(FX_BSTRC("Bounds"));
- if (pArray == NULL) {
- return FALSE;
- }
- for (i = 0; i < m_nSubs - 1; i ++) {
- m_pBounds[i + 1] = pArray->GetFloat(i);
- }
- m_pBounds[m_nSubs] = m_pDomains[1];
- m_pEncode = FX_Alloc(FX_FLOAT, m_nSubs * 2);
- pArray = pDict->GetArray(FX_BSTRC("Encode"));
- if (pArray == NULL) {
- return FALSE;
- }
- for (i = 0; i < m_nSubs * 2; i ++) {
- m_pEncode[i] = pArray->GetFloat(i);
- }
- return TRUE;
-}
-FX_BOOL CPDF_StitchFunc::v_Call(FX_FLOAT* inputs, FX_FLOAT* outputs) const
-{
- FX_FLOAT input = inputs[0];
- int i;
- for (i = 0; i < m_nSubs - 1; i ++)
- if (input < m_pBounds[i + 1]) {
- break;
- }
- if (m_pSubFunctions[i] == NULL) {
- return FALSE;
- }
- input = PDF_Interpolate(input, m_pBounds[i], m_pBounds[i + 1], m_pEncode[i * 2], m_pEncode[i * 2 + 1]);
- int nresults;
- m_pSubFunctions[i]->Call(&input, m_nInputs, outputs, nresults);
- return TRUE;
-}
-CPDF_Function* CPDF_Function::Load(CPDF_Object* pFuncObj)
-{
- if (pFuncObj == NULL) {
- return NULL;
- }
- CPDF_Function* pFunc = NULL;
- int type;
- if (pFuncObj->GetType() == PDFOBJ_STREAM) {
- type = ((CPDF_Stream*)pFuncObj)->GetDict()->GetInteger(FX_BSTRC("FunctionType"));
- } else if (pFuncObj->GetType() == PDFOBJ_DICTIONARY) {
- type = ((CPDF_Dictionary*)pFuncObj)->GetInteger(FX_BSTRC("FunctionType"));
- } else {
- return NULL;
- }
- if (type == 0) {
- pFunc = FX_NEW CPDF_SampledFunc;
- } else if (type == 2) {
- pFunc = FX_NEW CPDF_ExpIntFunc;
- } else if (type == 3) {
- pFunc = FX_NEW CPDF_StitchFunc;
- } else if (type == 4) {
- pFunc = FX_NEW CPDF_PSFunc;
- } else {
- return NULL;
- }
- if (!pFunc->Init(pFuncObj)) {
- delete pFunc;
- return NULL;
- }
- return pFunc;
-}
-CPDF_Function::CPDF_Function()
-{
- m_pDomains = NULL;
- m_pRanges = NULL;
-}
-CPDF_Function::~CPDF_Function()
-{
- if (m_pDomains) {
- FX_Free(m_pDomains);
- m_pDomains = NULL;
- }
- if (m_pRanges) {
- FX_Free(m_pRanges);
- m_pRanges = NULL;
- }
-}
-FX_BOOL CPDF_Function::Init(CPDF_Object* pObj)
-{
- CPDF_Dictionary* pDict;
- if (pObj->GetType() == PDFOBJ_STREAM) {
- pDict = ((CPDF_Stream*)pObj)->GetDict();
- } else {
- pDict = (CPDF_Dictionary*)pObj;
- }
- CPDF_Array* pDomains = pDict->GetArray(FX_BSTRC("Domain"));
- if (pDomains == NULL) {
- return FALSE;
- }
- m_nInputs = pDomains->GetCount() / 2;
- if (m_nInputs == 0) {
- return FALSE;
- }
- m_pDomains = FX_Alloc(FX_FLOAT, m_nInputs * 2);
- for (int i = 0; i < m_nInputs * 2; i ++) {
- m_pDomains[i] = pDomains->GetFloat(i);
- }
- CPDF_Array* pRanges = pDict->GetArray(FX_BSTRC("Range"));
- m_nOutputs = 0;
- if (pRanges) {
- m_nOutputs = pRanges->GetCount() / 2;
- m_pRanges = FX_Alloc(FX_FLOAT, m_nOutputs * 2);
- for (int i = 0; i < m_nOutputs * 2; i ++) {
- m_pRanges[i] = pRanges->GetFloat(i);
- }
- }
- FX_DWORD old_outputs = m_nOutputs;
- FX_BOOL ret = v_Init(pObj);
- if (m_pRanges && m_nOutputs > (int)old_outputs) {
- m_pRanges = FX_Realloc(FX_FLOAT, m_pRanges, m_nOutputs * 2);
- if (m_pRanges) {
- FXSYS_memset32(m_pRanges + (old_outputs * 2), 0, sizeof(FX_FLOAT) * (m_nOutputs - old_outputs) * 2);
- }
- }
- return ret;
-}
-FX_BOOL CPDF_Function::Call(FX_FLOAT* inputs, int ninputs, FX_FLOAT* results, int& nresults) const
-{
- if (m_nInputs != ninputs) {
- return FALSE;
- }
- nresults = m_nOutputs;
- for (int i = 0; i < m_nInputs; i ++) {
- if (inputs[i] < m_pDomains[i * 2]) {
- inputs[i] = m_pDomains[i * 2];
- } else if (inputs[i] > m_pDomains[i * 2 + 1]) {
- inputs[i] = m_pDomains[i * 2] + 1;
- }
- }
- v_Call(inputs, results);
- if (m_pRanges) {
- for (int i = 0; i < m_nOutputs; i ++) {
- if (results[i] < m_pRanges[i * 2]) {
- results[i] = m_pRanges[i * 2];
- } else if (results[i] > m_pRanges[i * 2 + 1]) {
- results[i] = m_pRanges[i * 2 + 1];
- }
- }
- }
- return TRUE;
-}
+// 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
+
+#include "../../../include/fpdfapi/fpdf_page.h"
+#include "../../../include/fpdfapi/fpdf_module.h"
+#include "pageint.h"
+#include <limits.h>
+class CPDF_PSEngine;
+typedef enum {PSOP_ADD, PSOP_SUB, PSOP_MUL, PSOP_DIV, PSOP_IDIV, PSOP_MOD,
+ PSOP_NEG, PSOP_ABS, PSOP_CEILING, PSOP_FLOOR, PSOP_ROUND, PSOP_TRUNCATE,
+ PSOP_SQRT, PSOP_SIN, PSOP_COS, PSOP_ATAN, PSOP_EXP, PSOP_LN, PSOP_LOG,
+ PSOP_CVI, PSOP_CVR, PSOP_EQ, PSOP_NE, PSOP_GT, PSOP_GE, PSOP_LT, PSOP_LE,
+ PSOP_AND, PSOP_OR, PSOP_XOR, PSOP_NOT, PSOP_BITSHIFT, PSOP_TRUE, PSOP_FALSE,
+ PSOP_IF, PSOP_IFELSE, PSOP_POP, PSOP_EXCH, PSOP_DUP, PSOP_COPY,
+ PSOP_INDEX, PSOP_ROLL, PSOP_PROC, PSOP_CONST
+ } PDF_PSOP;
+class CPDF_PSProc : public CFX_Object
+{
+public:
+ ~CPDF_PSProc();
+ FX_BOOL Parse(CPDF_SimpleParser& parser);
+ FX_BOOL Execute(CPDF_PSEngine* pEngine);
+ CFX_PtrArray m_Operators;
+};
+#define PSENGINE_STACKSIZE 100
+class CPDF_PSEngine : public CFX_Object
+{
+public:
+ CPDF_PSEngine();
+ ~CPDF_PSEngine();
+ FX_BOOL Parse(const FX_CHAR* string, int size);
+ FX_BOOL Execute()
+ {
+ return m_MainProc.Execute(this);
+ }
+ FX_BOOL DoOperator(PDF_PSOP op);
+ void Reset()
+ {
+ m_StackCount = 0;
+ }
+ void Push(FX_FLOAT value);
+ void Push(int value)
+ {
+ Push((FX_FLOAT)value);
+ }
+ FX_FLOAT Pop();
+ int GetStackSize()
+ {
+ return m_StackCount;
+ }
+private:
+ FX_FLOAT m_Stack[PSENGINE_STACKSIZE];
+ int m_StackCount;
+ CPDF_PSProc m_MainProc;
+};
+CPDF_PSProc::~CPDF_PSProc()
+{
+ int size = m_Operators.GetSize();
+ for (int i = 0; i < size; i ++) {
+ if (m_Operators[i] == (FX_LPVOID)PSOP_PROC) {
+ delete (CPDF_PSProc*)m_Operators[i + 1];
+ i ++;
+ } else if (m_Operators[i] == (FX_LPVOID)PSOP_CONST) {
+ FX_Free((FX_FLOAT*)m_Operators[i + 1]);
+ i ++;
+ }
+ }
+}
+#pragma optimize( "", off )
+FX_BOOL CPDF_PSProc::Execute(CPDF_PSEngine* pEngine)
+{
+ int size = m_Operators.GetSize();
+ for (int i = 0; i < size; i ++) {
+ PDF_PSOP op = (PDF_PSOP)(FX_UINTPTR)m_Operators[i];
+ if (op == PSOP_PROC) {
+ i ++;
+ } else if (op == PSOP_CONST) {
+ pEngine->Push(*(FX_FLOAT*)m_Operators[i + 1]);
+ i ++;
+ } else if (op == PSOP_IF) {
+ if (i < 2 || m_Operators[i - 2] != (FX_LPVOID)PSOP_PROC) {
+ return FALSE;
+ }
+ if ((int)pEngine->Pop()) {
+ ((CPDF_PSProc*)m_Operators[i - 1])->Execute(pEngine);
+ }
+ } else if (op == PSOP_IFELSE) {
+ if (i < 4 || m_Operators[i - 2] != (FX_LPVOID)PSOP_PROC ||
+ m_Operators[i - 4] != (FX_LPVOID)PSOP_PROC) {
+ return FALSE;
+ }
+ if ((int)pEngine->Pop()) {
+ ((CPDF_PSProc*)m_Operators[i - 3])->Execute(pEngine);
+ } else {
+ ((CPDF_PSProc*)m_Operators[i - 1])->Execute(pEngine);
+ }
+ } else {
+ pEngine->DoOperator(op);
+ }
+ }
+ return TRUE;
+}
+#pragma optimize( "", on )
+CPDF_PSEngine::CPDF_PSEngine()
+{
+ m_StackCount = 0;
+}
+CPDF_PSEngine::~CPDF_PSEngine()
+{
+}
+void CPDF_PSEngine::Push(FX_FLOAT v)
+{
+ if (m_StackCount == 100) {
+ return;
+ }
+ m_Stack[m_StackCount++] = v;
+}
+FX_FLOAT CPDF_PSEngine::Pop()
+{
+ if (m_StackCount == 0) {
+ return 0;
+ }
+ return m_Stack[--m_StackCount];
+}
+const struct _PDF_PSOpName {
+ const FX_CHAR* name;
+ PDF_PSOP op;
+} _PDF_PSOpNames[] = {
+ {"add", PSOP_ADD}, {"sub", PSOP_SUB}, {"mul", PSOP_MUL}, {"div", PSOP_DIV},
+ {"idiv", PSOP_IDIV}, {"mod", PSOP_MOD}, {"neg", PSOP_NEG}, {"abs", PSOP_ABS},
+ {"ceiling", PSOP_CEILING}, {"floor", PSOP_FLOOR}, {"round", PSOP_ROUND},
+ {"truncate", PSOP_TRUNCATE}, {"sqrt", PSOP_SQRT}, {"sin", PSOP_SIN},
+ {"cos", PSOP_COS}, {"atan", PSOP_ATAN}, {"exp", PSOP_EXP}, {"ln", PSOP_LN},
+ {"log", PSOP_LOG}, {"cvi", PSOP_CVI}, {"cvr", PSOP_CVR}, {"eq", PSOP_EQ},
+ {"ne", PSOP_NE}, {"gt", PSOP_GT}, {"ge", PSOP_GE}, {"lt", PSOP_LT},
+ {"le", PSOP_LE}, {"and", PSOP_AND}, {"or", PSOP_OR}, {"xor", PSOP_XOR},
+ {"not", PSOP_NOT}, {"bitshift", PSOP_BITSHIFT}, {"true", PSOP_TRUE},
+ {"false", PSOP_FALSE}, {"if", PSOP_IF}, {"ifelse", PSOP_IFELSE},
+ {"pop", PSOP_POP}, {"exch", PSOP_EXCH}, {"dup", PSOP_DUP},
+ {"copy", PSOP_COPY}, {"index", PSOP_INDEX}, {"roll", PSOP_ROLL},
+ {NULL, PSOP_PROC}
+};
+FX_BOOL CPDF_PSEngine::Parse(const FX_CHAR* string, int size)
+{
+ CPDF_SimpleParser parser((FX_LPBYTE)string, size);
+ CFX_ByteStringC word = parser.GetWord();
+ if (word != FX_BSTRC("{")) {
+ return FALSE;
+ }
+ return m_MainProc.Parse(parser);
+}
+FX_BOOL CPDF_PSProc::Parse(CPDF_SimpleParser& parser)
+{
+ while (1) {
+ CFX_ByteStringC word = parser.GetWord();
+ if (word.IsEmpty()) {
+ return FALSE;
+ }
+ if (word == FX_BSTRC("}")) {
+ return TRUE;
+ }
+ if (word == FX_BSTRC("{")) {
+ CPDF_PSProc* pProc = FX_NEW CPDF_PSProc;
+ m_Operators.Add((FX_LPVOID)PSOP_PROC);
+ m_Operators.Add(pProc);
+ if (!pProc->Parse(parser)) {
+ return FALSE;
+ }
+ } else {
+ int i = 0;
+ while (_PDF_PSOpNames[i].name) {
+ if (word == CFX_ByteStringC(_PDF_PSOpNames[i].name)) {
+ m_Operators.Add((FX_LPVOID)_PDF_PSOpNames[i].op);
+ break;
+ }
+ i ++;
+ }
+ if (_PDF_PSOpNames[i].name == NULL) {
+ FX_FLOAT* pd = FX_Alloc(FX_FLOAT, 1);
+ *pd = FX_atof(word);
+ m_Operators.Add((FX_LPVOID)PSOP_CONST);
+ m_Operators.Add(pd);
+ }
+ }
+ }
+}
+#define PI 3.1415926535897932384626433832795f
+FX_BOOL CPDF_PSEngine::DoOperator(PDF_PSOP op)
+{
+ int i1, i2;
+ FX_FLOAT d1, d2;
+ switch (op) {
+ case PSOP_ADD:
+ d1 = Pop();
+ d2 = Pop();
+ Push(d1 + d2);
+ break;
+ case PSOP_SUB:
+ d2 = Pop();
+ d1 = Pop();
+ Push(d1 - d2);
+ break;
+ case PSOP_MUL:
+ d1 = Pop();
+ d2 = Pop();
+ Push(d1 * d2);
+ break;
+ case PSOP_DIV:
+ d2 = Pop();
+ d1 = Pop();
+ Push(d1 / d2);
+ break;
+ case PSOP_IDIV:
+ i2 = (int)Pop();
+ i1 = (int)Pop();
+ Push(i1 / i2);
+ break;
+ case PSOP_MOD:
+ i2 = (int)Pop();
+ i1 = (int)Pop();
+ Push(i1 % i2);
+ break;
+ case PSOP_NEG:
+ d1 = Pop();
+ Push(-d1);
+ break;
+ case PSOP_ABS:
+ d1 = Pop();
+ Push((FX_FLOAT)FXSYS_fabs(d1));
+ break;
+ case PSOP_CEILING:
+ d1 = Pop();
+ Push((FX_FLOAT)FXSYS_ceil(d1));
+ break;
+ case PSOP_FLOOR:
+ d1 = Pop();
+ Push((FX_FLOAT)FXSYS_floor(d1));
+ break;
+ case PSOP_ROUND:
+ d1 = Pop();
+ Push(FXSYS_round(d1));
+ break;
+ case PSOP_TRUNCATE:
+ i1 = (int)Pop();
+ Push(i1);
+ break;
+ case PSOP_SQRT:
+ d1 = Pop();
+ Push((FX_FLOAT)FXSYS_sqrt(d1));
+ break;
+ case PSOP_SIN:
+ d1 = Pop();
+ Push((FX_FLOAT)FXSYS_sin(d1 * PI / 180.0f));
+ break;
+ case PSOP_COS:
+ d1 = Pop();
+ Push((FX_FLOAT)FXSYS_cos(d1 * PI / 180.0f));
+ break;
+ case PSOP_ATAN:
+ d2 = Pop();
+ d1 = Pop();
+ d1 = (FX_FLOAT)(FXSYS_atan2(d1, d2) * 180.0 / PI);
+ if (d1 < 0) {
+ d1 += 360;
+ }
+ Push(d1);
+ break;
+ case PSOP_EXP:
+ d2 = Pop();
+ d1 = Pop();
+ Push((FX_FLOAT)FXSYS_pow(d1, d2));
+ break;
+ case PSOP_LN:
+ d1 = Pop();
+ Push((FX_FLOAT)FXSYS_log(d1));
+ break;
+ case PSOP_LOG:
+ d1 = Pop();
+ Push((FX_FLOAT)FXSYS_log10(d1));
+ break;
+ case PSOP_CVI:
+ i1 = (int)Pop();
+ Push(i1);
+ break;
+ case PSOP_CVR:
+ break;
+ case PSOP_EQ:
+ d2 = Pop();
+ d1 = Pop();
+ Push((int)(d1 == d2));
+ break;
+ case PSOP_NE:
+ d2 = Pop();
+ d1 = Pop();
+ Push((int)(d1 != d2));
+ break;
+ case PSOP_GT:
+ d2 = Pop();
+ d1 = Pop();
+ Push((int)(d1 > d2));
+ break;
+ case PSOP_GE:
+ d2 = Pop();
+ d1 = Pop();
+ Push((int)(d1 >= d2));
+ break;
+ case PSOP_LT:
+ d2 = Pop();
+ d1 = Pop();
+ Push((int)(d1 < d2));
+ break;
+ case PSOP_LE:
+ d2 = Pop();
+ d1 = Pop();
+ Push((int)(d1 <= d2));
+ break;
+ case PSOP_AND:
+ i1 = (int)Pop();
+ i2 = (int)Pop();
+ Push(i1 & i2);
+ break;
+ case PSOP_OR:
+ i1 = (int)Pop();
+ i2 = (int)Pop();
+ Push(i1 | i2);
+ break;
+ case PSOP_XOR:
+ i1 = (int)Pop();
+ i2 = (int)Pop();
+ Push(i1 ^ i2);
+ break;
+ case PSOP_NOT:
+ i1 = (int)Pop();
+ Push((int)!i1);
+ break;
+ case PSOP_BITSHIFT: {
+ int shift = (int)Pop();
+ int i = (int)Pop();
+ if (shift > 0) {
+ Push(i << shift);
+ } else {
+ Push(i >> -shift);
+ }
+ break;
+ }
+ case PSOP_TRUE:
+ Push(1);
+ break;
+ case PSOP_FALSE:
+ Push(0);
+ break;
+ case PSOP_POP:
+ Pop();
+ break;
+ case PSOP_EXCH:
+ d2 = Pop();
+ d1 = Pop();
+ Push(d2);
+ Push(d1);
+ break;
+ case PSOP_DUP:
+ d1 = Pop();
+ Push(d1);
+ Push(d1);
+ break;
+ case PSOP_COPY: {
+ int n = (int)Pop();
+ if (n < 0 || n > PSENGINE_STACKSIZE || m_StackCount + n > PSENGINE_STACKSIZE || n > m_StackCount) {
+ break;
+ }
+ for (int i = 0; i < n; i ++) {
+ m_Stack[m_StackCount + i] = m_Stack[m_StackCount + i - n];
+ }
+ m_StackCount += n;
+ break;
+ }
+ case PSOP_INDEX: {
+ int n = (int)Pop();
+ if (n < 0 || n >= m_StackCount) {
+ break;
+ }
+ Push(m_Stack[m_StackCount - n - 1]);
+ break;
+ }
+ case PSOP_ROLL: {
+ int j = (int)Pop();
+ int n = (int)Pop();
+ if (m_StackCount == 0) {
+ break;
+ }
+ if (n < 0 || n > m_StackCount) {
+ break;
+ }
+ if (j < 0)
+ for (int i = 0; i < -j; i ++) {
+ FX_FLOAT first = m_Stack[m_StackCount - n];
+ for (int ii = 0; ii < n - 1; ii ++) {
+ m_Stack[m_StackCount - n + ii] = m_Stack[m_StackCount - n + ii + 1];
+ }
+ m_Stack[m_StackCount - 1] = first;
+ }
+ else
+ for (int i = 0; i < j; i ++) {
+ FX_FLOAT last = m_Stack[m_StackCount - 1];
+ int ii;
+ for (ii = 0; ii < n - 1; ii ++) {
+ m_Stack[m_StackCount - ii - 1] = m_Stack[m_StackCount - ii - 2];
+ }
+ m_Stack[m_StackCount - ii - 1] = last;
+ }
+ break;
+ }
+ default:
+ break;
+ }
+ return TRUE;
+}
+static FX_FLOAT PDF_Interpolate(FX_FLOAT x, FX_FLOAT xmin, FX_FLOAT xmax, FX_FLOAT ymin, FX_FLOAT ymax)
+{
+ return ((x - xmin) * (ymax - ymin) / (xmax - xmin)) + ymin;
+}
+static FX_DWORD _GetBits32(FX_LPCBYTE pData, int bitpos, int nbits)
+{
+ int result = 0;
+ for (int i = 0; i < nbits; i ++)
+ if (pData[(bitpos + i) / 8] & (1 << (7 - (bitpos + i) % 8))) {
+ result |= 1 << (nbits - i - 1);
+ }
+ return result;
+}
+typedef struct {
+ FX_FLOAT encode_max, encode_min;
+ int sizes;
+} SampleEncodeInfo;
+typedef struct {
+ FX_FLOAT decode_max, decode_min;
+} SampleDecodeInfo;
+class CPDF_SampledFunc : public CPDF_Function
+{
+public:
+ CPDF_SampledFunc();
+ virtual ~CPDF_SampledFunc();
+ virtual FX_BOOL v_Init(CPDF_Object* pObj);
+ virtual FX_BOOL v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const;
+ SampleEncodeInfo* m_pEncodeInfo;
+ SampleDecodeInfo* m_pDecodeInfo;
+ FX_DWORD m_nBitsPerSample, m_SampleMax;
+ CPDF_StreamAcc* m_pSampleStream;
+};
+CPDF_SampledFunc::CPDF_SampledFunc()
+{
+ m_pSampleStream = NULL;
+ m_pEncodeInfo = NULL;
+ m_pDecodeInfo = NULL;
+}
+CPDF_SampledFunc::~CPDF_SampledFunc()
+{
+ if (m_pSampleStream) {
+ delete m_pSampleStream;
+ }
+ if (m_pEncodeInfo) {
+ FX_Free(m_pEncodeInfo);
+ }
+ if (m_pDecodeInfo) {
+ FX_Free(m_pDecodeInfo);
+ }
+}
+FX_BOOL CPDF_SampledFunc::v_Init(CPDF_Object* pObj)
+{
+ if (pObj->GetType() != PDFOBJ_STREAM) {
+ return FALSE;
+ }
+ CPDF_Stream* pStream = (CPDF_Stream*)pObj;
+ CPDF_Dictionary* pDict = pStream->GetDict();
+ CPDF_Array* pSize = pDict->GetArray(FX_BSTRC("Size"));
+ CPDF_Array* pEncode = pDict->GetArray(FX_BSTRC("Encode"));
+ CPDF_Array* pDecode = pDict->GetArray(FX_BSTRC("Decode"));
+ m_nBitsPerSample = pDict->GetInteger(FX_BSTRC("BitsPerSample"));
+ m_SampleMax = 0xffffffff >> (32 - m_nBitsPerSample);
+ m_pSampleStream = FX_NEW CPDF_StreamAcc;
+ m_pSampleStream->LoadAllData(pStream, FALSE);
+ m_pEncodeInfo = FX_Alloc(SampleEncodeInfo, m_nInputs);
+ int i;
+ FX_DWORD nTotalSamples = 1;
+ for (i = 0; i < m_nInputs; i ++) {
+ m_pEncodeInfo[i].sizes = pSize->GetInteger(i);
+ if (!pSize && i == 0) {
+ m_pEncodeInfo[i].sizes = pDict->GetInteger(FX_BSTRC("Size"));
+ }
+ if (nTotalSamples > 0 && (FX_UINT32)(m_pEncodeInfo[i].sizes) > UINT_MAX / nTotalSamples) {
+ return FALSE;
+ }
+ nTotalSamples *= m_pEncodeInfo[i].sizes;
+ if (pEncode) {
+ m_pEncodeInfo[i].encode_min = pEncode->GetFloat(i * 2);
+ m_pEncodeInfo[i].encode_max = pEncode->GetFloat(i * 2 + 1);
+ } else {
+ m_pEncodeInfo[i].encode_min = 0;
+ if (m_pEncodeInfo[i].sizes == 1) {
+ m_pEncodeInfo[i].encode_max = 1;
+ } else {
+ m_pEncodeInfo[i].encode_max = (FX_FLOAT)m_pEncodeInfo[i].sizes - 1;
+ }
+ }
+ }
+ if (nTotalSamples > 0 && m_nBitsPerSample > UINT_MAX / nTotalSamples) {
+ return FALSE;
+ }
+ nTotalSamples *= m_nBitsPerSample;
+ if (nTotalSamples > 0 && ((FX_UINT32)m_nOutputs) > UINT_MAX / nTotalSamples) {
+ return FALSE;
+ }
+ nTotalSamples *= m_nOutputs;
+ if (nTotalSamples == 0 || m_pSampleStream->GetSize() * 8 < nTotalSamples) {
+ return FALSE;
+ }
+ m_pDecodeInfo = FX_Alloc(SampleDecodeInfo, m_nOutputs);
+ for (i = 0; i < m_nOutputs; i ++) {
+ if (pDecode) {
+ m_pDecodeInfo[i].decode_min = pDecode->GetFloat(2 * i);
+ m_pDecodeInfo[i].decode_max = pDecode->GetFloat(2 * i + 1);
+ } else {
+ m_pDecodeInfo[i].decode_min = m_pRanges[i * 2];
+ m_pDecodeInfo[i].decode_max = m_pRanges[i * 2 + 1];
+ }
+ }
+ return TRUE;
+}
+FX_BOOL CPDF_SampledFunc::v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const
+{
+ int pos = 0;
+ CFX_FixedBufGrow<FX_FLOAT, 16> encoded_input_buf(m_nInputs);
+ FX_FLOAT* encoded_input = encoded_input_buf;
+ CFX_FixedBufGrow<int, 32> int_buf(m_nInputs * 2);
+ int* index = int_buf;
+ int* blocksize = index + m_nInputs;
+ for (int i = 0; i < m_nInputs; i ++) {
+ if (i == 0) {
+ blocksize[i] = 1;
+ } else {
+ blocksize[i] = blocksize[i - 1] * m_pEncodeInfo[i - 1].sizes;
+ }
+ encoded_input[i] = PDF_Interpolate(inputs[i], m_pDomains[i * 2], m_pDomains[i * 2 + 1],
+ m_pEncodeInfo[i].encode_min, m_pEncodeInfo[i].encode_max);
+ index[i] = (int)encoded_input[i];
+ if (index[i] < 0) {
+ index[i] = 0;
+ } else if (index[i] > m_pEncodeInfo[i].sizes - 1) {
+ index[i] = m_pEncodeInfo[i].sizes - 1;
+ }
+ pos += index[i] * blocksize[i];
+ }
+ int bitpos = pos * m_nBitsPerSample * m_nOutputs;
+ FX_LPCBYTE pSampleData = m_pSampleStream->GetData();
+ if (pSampleData == NULL) {
+ return FALSE;
+ }
+ for (int j = 0; j < m_nOutputs; j ++) {
+ FX_DWORD sample = _GetBits32(pSampleData, bitpos + j * m_nBitsPerSample, m_nBitsPerSample);
+ FX_FLOAT encoded = (FX_FLOAT)sample;
+ for (int i = 0; i < m_nInputs; i ++) {
+ if (index[i] == m_pEncodeInfo[i].sizes - 1) {
+ if (index[i] == 0) {
+ encoded = encoded_input[i] * (FX_FLOAT)sample;
+ }
+ } else {
+ int bitpos1 = bitpos + m_nBitsPerSample * m_nOutputs * blocksize[i];
+ FX_DWORD sample1 = _GetBits32(pSampleData, bitpos1 + j * m_nBitsPerSample, m_nBitsPerSample);
+ encoded += (encoded_input[i] - index[i]) * ((FX_FLOAT)sample1 - (FX_FLOAT)sample);
+ }
+ }
+ results[j] = PDF_Interpolate(encoded, 0, (FX_FLOAT)m_SampleMax,
+ m_pDecodeInfo[j].decode_min, m_pDecodeInfo[j].decode_max);
+ }
+ return TRUE;
+}
+class CPDF_PSFunc : public CPDF_Function
+{
+public:
+ virtual FX_BOOL v_Init(CPDF_Object* pObj);
+ virtual FX_BOOL v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const;
+ CPDF_PSEngine m_PS;
+};
+FX_BOOL CPDF_PSFunc::v_Init(CPDF_Object* pObj)
+{
+ CPDF_Stream* pStream = (CPDF_Stream*)pObj;
+ CPDF_StreamAcc acc;
+ acc.LoadAllData(pStream, FALSE);
+ return m_PS.Parse((const FX_CHAR*)acc.GetData(), acc.GetSize());
+}
+FX_BOOL CPDF_PSFunc::v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const
+{
+ CPDF_PSEngine& PS = (CPDF_PSEngine&)m_PS;
+ PS.Reset();
+ int i;
+ for (i = 0; i < m_nInputs; i ++) {
+ PS.Push(inputs[i]);
+ }
+ PS.Execute();
+ if (PS.GetStackSize() < m_nOutputs) {
+ return FALSE;
+ }
+ for (i = 0; i < m_nOutputs; i ++) {
+ results[m_nOutputs - i - 1] = PS.Pop();
+ }
+ return TRUE;
+}
+class CPDF_ExpIntFunc : public CPDF_Function
+{
+public:
+ CPDF_ExpIntFunc();
+ virtual ~CPDF_ExpIntFunc();
+ virtual FX_BOOL v_Init(CPDF_Object* pObj);
+ virtual FX_BOOL v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const;
+ FX_FLOAT m_Exponent;
+ FX_FLOAT* m_pBeginValues;
+ FX_FLOAT* m_pEndValues;
+ int m_nOrigOutputs;
+};
+CPDF_ExpIntFunc::CPDF_ExpIntFunc()
+{
+ m_pBeginValues = NULL;
+ m_pEndValues = NULL;
+}
+CPDF_ExpIntFunc::~CPDF_ExpIntFunc()
+{
+ if (m_pBeginValues) {
+ FX_Free(m_pBeginValues);
+ }
+ if (m_pEndValues) {
+ FX_Free(m_pEndValues);
+ }
+}
+FX_BOOL CPDF_ExpIntFunc::v_Init(CPDF_Object* pObj)
+{
+ CPDF_Dictionary* pDict = pObj->GetDict();
+ if (pDict == NULL) {
+ return FALSE;
+ }
+ CPDF_Array* pArray0 = pDict->GetArray(FX_BSTRC("C0"));
+ if (m_nOutputs == 0) {
+ m_nOutputs = 1;
+ if (pArray0) {
+ m_nOutputs = pArray0->GetCount();
+ }
+ }
+ CPDF_Array* pArray1 = pDict->GetArray(FX_BSTRC("C1"));
+ m_pBeginValues = FX_Alloc(FX_FLOAT, m_nOutputs * 2);
+ m_pEndValues = FX_Alloc(FX_FLOAT, m_nOutputs * 2);
+ for (int i = 0; i < m_nOutputs; i ++) {
+ m_pBeginValues[i] = pArray0 ? pArray0->GetFloat(i) : 0.0f;
+ m_pEndValues[i] = pArray1 ? pArray1->GetFloat(i) : 1.0f;
+ }
+ m_Exponent = pDict->GetFloat(FX_BSTRC("N"));
+ m_nOrigOutputs = m_nOutputs;
+ if (m_nOutputs && m_nInputs > INT_MAX / m_nOutputs) {
+ return FALSE;
+ }
+ m_nOutputs *= m_nInputs;
+ return TRUE;
+}
+FX_BOOL CPDF_ExpIntFunc::v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const
+{
+ for (int i = 0; i < m_nInputs; i ++)
+ for (int j = 0; j < m_nOrigOutputs; j ++) {
+ results[i * m_nOrigOutputs + j] = m_pBeginValues[j] + (FX_FLOAT)FXSYS_pow(inputs[i], m_Exponent) *
+ (m_pEndValues[j] - m_pBeginValues[j]);
+ }
+ return TRUE;
+}
+class CPDF_StitchFunc : public CPDF_Function
+{
+public:
+ CPDF_StitchFunc();
+ virtual ~CPDF_StitchFunc();
+ virtual FX_BOOL v_Init(CPDF_Object* pObj);
+ virtual FX_BOOL v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const;
+ int m_nSubs;
+ CPDF_Function** m_pSubFunctions;
+ FX_FLOAT* m_pBounds;
+ FX_FLOAT* m_pEncode;
+};
+CPDF_StitchFunc::CPDF_StitchFunc()
+{
+ m_nSubs = 0;
+ m_pSubFunctions = NULL;
+ m_pBounds = NULL;
+ m_pEncode = NULL;
+}
+CPDF_StitchFunc::~CPDF_StitchFunc()
+{
+ for (int i = 0; i < m_nSubs; i ++)
+ if (m_pSubFunctions[i]) {
+ delete m_pSubFunctions[i];
+ }
+ if (m_pSubFunctions) {
+ FX_Free(m_pSubFunctions);
+ }
+ if (m_pBounds) {
+ FX_Free(m_pBounds);
+ }
+ if (m_pEncode) {
+ FX_Free(m_pEncode);
+ }
+}
+FX_BOOL CPDF_StitchFunc::v_Init(CPDF_Object* pObj)
+{
+ CPDF_Dictionary* pDict = pObj->GetDict();
+ if (pDict == NULL) {
+ return FALSE;
+ }
+ CPDF_Array* pArray = pDict->GetArray(FX_BSTRC("Functions"));
+ if (pArray == NULL) {
+ return FALSE;
+ }
+ m_nSubs = pArray->GetCount();
+ if (m_nSubs == 0) {
+ return FALSE;
+ }
+ m_pSubFunctions = FX_Alloc(CPDF_Function*, m_nSubs);
+ FXSYS_memset32(m_pSubFunctions, 0, sizeof(CPDF_Function*)*m_nSubs);
+ m_nOutputs = 0;
+ int i;
+ for (i = 0; i < m_nSubs; i ++) {
+ CPDF_Object* pSub = pArray->GetElementValue(i);
+ if (pSub == pObj) {
+ return FALSE;
+ }
+ m_pSubFunctions[i] = CPDF_Function::Load(pSub);
+ if (m_pSubFunctions[i] == NULL) {
+ return FALSE;
+ }
+ if (m_pSubFunctions[i]->CountOutputs() > m_nOutputs) {
+ m_nOutputs = m_pSubFunctions[i]->CountOutputs();
+ }
+ }
+ m_pBounds = FX_Alloc(FX_FLOAT, m_nSubs + 1);
+ m_pBounds[0] = m_pDomains[0];
+ pArray = pDict->GetArray(FX_BSTRC("Bounds"));
+ if (pArray == NULL) {
+ return FALSE;
+ }
+ for (i = 0; i < m_nSubs - 1; i ++) {
+ m_pBounds[i + 1] = pArray->GetFloat(i);
+ }
+ m_pBounds[m_nSubs] = m_pDomains[1];
+ m_pEncode = FX_Alloc(FX_FLOAT, m_nSubs * 2);
+ pArray = pDict->GetArray(FX_BSTRC("Encode"));
+ if (pArray == NULL) {
+ return FALSE;
+ }
+ for (i = 0; i < m_nSubs * 2; i ++) {
+ m_pEncode[i] = pArray->GetFloat(i);
+ }
+ return TRUE;
+}
+FX_BOOL CPDF_StitchFunc::v_Call(FX_FLOAT* inputs, FX_FLOAT* outputs) const
+{
+ FX_FLOAT input = inputs[0];
+ int i;
+ for (i = 0; i < m_nSubs - 1; i ++)
+ if (input < m_pBounds[i + 1]) {
+ break;
+ }
+ if (m_pSubFunctions[i] == NULL) {
+ return FALSE;
+ }
+ input = PDF_Interpolate(input, m_pBounds[i], m_pBounds[i + 1], m_pEncode[i * 2], m_pEncode[i * 2 + 1]);
+ int nresults;
+ m_pSubFunctions[i]->Call(&input, m_nInputs, outputs, nresults);
+ return TRUE;
+}
+CPDF_Function* CPDF_Function::Load(CPDF_Object* pFuncObj)
+{
+ if (pFuncObj == NULL) {
+ return NULL;
+ }
+ CPDF_Function* pFunc = NULL;
+ int type;
+ if (pFuncObj->GetType() == PDFOBJ_STREAM) {
+ type = ((CPDF_Stream*)pFuncObj)->GetDict()->GetInteger(FX_BSTRC("FunctionType"));
+ } else if (pFuncObj->GetType() == PDFOBJ_DICTIONARY) {
+ type = ((CPDF_Dictionary*)pFuncObj)->GetInteger(FX_BSTRC("FunctionType"));
+ } else {
+ return NULL;
+ }
+ if (type == 0) {
+ pFunc = FX_NEW CPDF_SampledFunc;
+ } else if (type == 2) {
+ pFunc = FX_NEW CPDF_ExpIntFunc;
+ } else if (type == 3) {
+ pFunc = FX_NEW CPDF_StitchFunc;
+ } else if (type == 4) {
+ pFunc = FX_NEW CPDF_PSFunc;
+ } else {
+ return NULL;
+ }
+ if (!pFunc->Init(pFuncObj)) {
+ delete pFunc;
+ return NULL;
+ }
+ return pFunc;
+}
+CPDF_Function::CPDF_Function()
+{
+ m_pDomains = NULL;
+ m_pRanges = NULL;
+}
+CPDF_Function::~CPDF_Function()
+{
+ if (m_pDomains) {
+ FX_Free(m_pDomains);
+ m_pDomains = NULL;
+ }
+ if (m_pRanges) {
+ FX_Free(m_pRanges);
+ m_pRanges = NULL;
+ }
+}
+FX_BOOL CPDF_Function::Init(CPDF_Object* pObj)
+{
+ CPDF_Dictionary* pDict;
+ if (pObj->GetType() == PDFOBJ_STREAM) {
+ pDict = ((CPDF_Stream*)pObj)->GetDict();
+ } else {
+ pDict = (CPDF_Dictionary*)pObj;
+ }
+ CPDF_Array* pDomains = pDict->GetArray(FX_BSTRC("Domain"));
+ if (pDomains == NULL) {
+ return FALSE;
+ }
+ m_nInputs = pDomains->GetCount() / 2;
+ if (m_nInputs == 0) {
+ return FALSE;
+ }
+ m_pDomains = FX_Alloc(FX_FLOAT, m_nInputs * 2);
+ for (int i = 0; i < m_nInputs * 2; i ++) {
+ m_pDomains[i] = pDomains->GetFloat(i);
+ }
+ CPDF_Array* pRanges = pDict->GetArray(FX_BSTRC("Range"));
+ m_nOutputs = 0;
+ if (pRanges) {
+ m_nOutputs = pRanges->GetCount() / 2;
+ m_pRanges = FX_Alloc(FX_FLOAT, m_nOutputs * 2);
+ for (int i = 0; i < m_nOutputs * 2; i ++) {
+ m_pRanges[i] = pRanges->GetFloat(i);
+ }
+ }
+ FX_DWORD old_outputs = m_nOutputs;
+ FX_BOOL ret = v_Init(pObj);
+ if (m_pRanges && m_nOutputs > (int)old_outputs) {
+ m_pRanges = FX_Realloc(FX_FLOAT, m_pRanges, m_nOutputs * 2);
+ if (m_pRanges) {
+ FXSYS_memset32(m_pRanges + (old_outputs * 2), 0, sizeof(FX_FLOAT) * (m_nOutputs - old_outputs) * 2);
+ }
+ }
+ return ret;
+}
+FX_BOOL CPDF_Function::Call(FX_FLOAT* inputs, int ninputs, FX_FLOAT* results, int& nresults) const
+{
+ if (m_nInputs != ninputs) {
+ return FALSE;
+ }
+ nresults = m_nOutputs;
+ for (int i = 0; i < m_nInputs; i ++) {
+ if (inputs[i] < m_pDomains[i * 2]) {
+ inputs[i] = m_pDomains[i * 2];
+ } else if (inputs[i] > m_pDomains[i * 2 + 1]) {
+ inputs[i] = m_pDomains[i * 2] + 1;
+ }
+ }
+ v_Call(inputs, results);
+ if (m_pRanges) {
+ for (int i = 0; i < m_nOutputs; i ++) {
+ if (results[i] < m_pRanges[i * 2]) {
+ results[i] = m_pRanges[i * 2];
+ } else if (results[i] > m_pRanges[i * 2 + 1]) {
+ results[i] = m_pRanges[i * 2 + 1];
+ }
+ }
+ }
+ return TRUE;
+}
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp
index e9115e6342..f53a5b23a4 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp
@@ -1,707 +1,707 @@
-// 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
-
-#include "../../../include/fpdfapi/fpdf_page.h"
-#include "../../../include/fpdfapi/fpdf_pageobj.h"
-#include "../../../include/fpdfapi/fpdf_module.h"
-#include "../../../include/fpdfapi/fpdf_render.h"
-#include "pageint.h"
-#include "../fpdf_render/render_int.h"
-void CPDF_GraphicStates::DefaultStates()
-{
- m_ColorState.New()->Default();
-}
-void CPDF_GraphicStates::CopyStates(const CPDF_GraphicStates& src)
-{
- m_ClipPath = src.m_ClipPath;
- m_GraphState = src.m_GraphState;
- m_ColorState = src.m_ColorState;
- m_TextState = src.m_TextState;
- m_GeneralState = src.m_GeneralState;
-}
-CPDF_ClipPathData::CPDF_ClipPathData()
-{
- m_PathCount = 0;
- m_pPathList = NULL;
- m_pTypeList = NULL;
- m_TextCount = 0;
- m_pTextList = NULL;
-}
-CPDF_ClipPathData::~CPDF_ClipPathData()
-{
- int i;
- if (m_pPathList) {
- FX_DELETE_VECTOR(m_pPathList, CPDF_Path, m_PathCount);
- }
- if (m_pTypeList) {
- FX_Free(m_pTypeList);
- }
- for (i = m_TextCount - 1; i > -1; i --)
- if (m_pTextList[i]) {
- delete m_pTextList[i];
- }
- if (m_pTextList) {
- FX_Free(m_pTextList);
- }
-}
-CPDF_ClipPathData::CPDF_ClipPathData(const CPDF_ClipPathData& src)
-{
- m_pPathList = NULL;
- m_pPathList = NULL;
- m_pTextList = NULL;
- m_PathCount = src.m_PathCount;
- if (m_PathCount) {
- int alloc_size = m_PathCount;
- if (alloc_size % 8) {
- alloc_size += 8 - (alloc_size % 8);
- }
- FX_NEW_VECTOR(m_pPathList, CPDF_Path, alloc_size);
- for (int i = 0; i < m_PathCount; i ++) {
- m_pPathList[i] = src.m_pPathList[i];
- }
- m_pTypeList = FX_Alloc(FX_BYTE, alloc_size);
- FXSYS_memcpy32(m_pTypeList, src.m_pTypeList, m_PathCount);
- } else {
- m_pPathList = NULL;
- m_pTypeList = NULL;
- }
- m_TextCount = src.m_TextCount;
- if (m_TextCount) {
- m_pTextList = FX_Alloc(CPDF_TextObject*, m_TextCount);
- FXSYS_memset32(m_pTextList, 0, sizeof(CPDF_TextObject*) * m_TextCount);
- for (int i = 0; i < m_TextCount; i ++) {
- if (src.m_pTextList[i]) {
- m_pTextList[i] = FX_NEW CPDF_TextObject;
- m_pTextList[i]->Copy(src.m_pTextList[i]);
- } else {
- m_pTextList[i] = NULL;
- }
- }
- } else {
- m_pTextList = NULL;
- }
-}
-void CPDF_ClipPathData::SetCount(int path_count, int text_count)
-{
- ASSERT(m_TextCount == 0 && m_PathCount == 0);
- if (path_count) {
- m_PathCount = path_count;
- int alloc_size = (path_count + 7) / 8 * 8;
- FX_NEW_VECTOR(m_pPathList, CPDF_Path, alloc_size);
- m_pTypeList = FX_Alloc(FX_BYTE, alloc_size);
- }
- if (text_count) {
- m_TextCount = text_count;
- m_pTextList = FX_Alloc(CPDF_TextObject*, text_count);
- FXSYS_memset32(m_pTextList, 0, sizeof(void*) * text_count);
- }
-}
-CPDF_Rect CPDF_ClipPath::GetClipBox() const
-{
- CPDF_Rect rect;
- FX_BOOL bStarted = FALSE;
- int count = GetPathCount();
- if (count) {
- rect = GetPath(0).GetBoundingBox();
- for (int i = 1; i < count; i ++) {
- CPDF_Rect path_rect = GetPath(i).GetBoundingBox();
- rect.Intersect(path_rect);
- }
- bStarted = TRUE;
- }
- count = GetTextCount();
- if (count) {
- CPDF_Rect layer_rect;
- FX_BOOL bLayerStarted = FALSE;
- for (int i = 0; i < count; i ++) {
- CPDF_TextObject* pTextObj = GetText(i);
- if (pTextObj == NULL) {
- if (!bStarted) {
- rect = layer_rect;
- bStarted = TRUE;
- } else {
- rect.Intersect(layer_rect);
- }
- bLayerStarted = FALSE;
- } else {
- if (!bLayerStarted) {
- layer_rect = pTextObj->GetBBox(NULL);
- bLayerStarted = TRUE;
- } else {
- layer_rect.Union(pTextObj->GetBBox(NULL));
- }
- }
- }
- }
- return rect;
-}
-void CPDF_ClipPath::AppendPath(CPDF_Path path, int type, FX_BOOL bAutoMerge)
-{
- CPDF_ClipPathData* pData = GetModify();
- if (pData->m_PathCount && bAutoMerge) {
- CPDF_Path old_path = pData->m_pPathList[pData->m_PathCount - 1];
- if (old_path.IsRect()) {
- CPDF_Rect old_rect(old_path.GetPointX(0), old_path.GetPointY(0),
- old_path.GetPointX(2), old_path.GetPointY(2));
- CPDF_Rect new_rect = path.GetBoundingBox();
- if (old_rect.Contains(new_rect)) {
- pData->m_PathCount --;
- pData->m_pPathList[pData->m_PathCount].SetNull();
- }
- }
- }
- if (pData->m_PathCount % 8 == 0) {
- CPDF_Path* pNewPath;
- FX_NEW_VECTOR(pNewPath, CPDF_Path, pData->m_PathCount + 8);
- for (int i = 0; i < pData->m_PathCount; i ++) {
- pNewPath[i] = pData->m_pPathList[i];
- }
- if (pData->m_pPathList) {
- FX_DELETE_VECTOR(pData->m_pPathList, CPDF_Path, pData->m_PathCount);
- }
- FX_BYTE* pNewType = FX_Alloc(FX_BYTE, pData->m_PathCount + 8);
- FXSYS_memcpy32(pNewType, pData->m_pTypeList, pData->m_PathCount);
- if (pData->m_pTypeList) {
- FX_Free(pData->m_pTypeList);
- }
- pData->m_pPathList = pNewPath;
- pData->m_pTypeList = pNewType;
- }
- pData->m_pPathList[pData->m_PathCount] = path;
- pData->m_pTypeList[pData->m_PathCount] = (FX_BYTE)type;
- pData->m_PathCount ++;
-}
-void CPDF_ClipPath::DeletePath(int index)
-{
- CPDF_ClipPathData* pData = GetModify();
- if (index >= pData->m_PathCount) {
- return;
- }
- pData->m_pPathList[index].SetNull();
- for (int i = index; i < pData->m_PathCount - 1; i ++) {
- pData->m_pPathList[i] = pData->m_pPathList[i + 1];
- }
- pData->m_pPathList[pData->m_PathCount - 1].SetNull();
- FXSYS_memmove32(pData->m_pTypeList + index, pData->m_pTypeList + index + 1, pData->m_PathCount - index - 1);
- pData->m_PathCount --;
-}
-#define FPDF_CLIPPATH_MAX_TEXTS 1024
-void CPDF_ClipPath::AppendTexts(CPDF_TextObject** pTexts, int count)
-{
- CPDF_ClipPathData* pData = GetModify();
- if (pData->m_TextCount + count > FPDF_CLIPPATH_MAX_TEXTS) {
- for (int i = 0; i < count; i ++) {
- pTexts[i]->Release();
- }
- return;
- }
- CPDF_TextObject** pNewList = FX_Alloc(CPDF_TextObject*, pData->m_TextCount + count + 1);
- if (pData->m_pTextList) {
- FXSYS_memcpy32(pNewList, pData->m_pTextList, pData->m_TextCount * sizeof(CPDF_TextObject*));
- FX_Free(pData->m_pTextList);
- }
- pData->m_pTextList = pNewList;
- for (int i = 0; i < count; i ++) {
- pData->m_pTextList[pData->m_TextCount + i] = pTexts[i];
- }
- pData->m_pTextList[pData->m_TextCount + count] = NULL;
- pData->m_TextCount += count + 1;
-}
-void CPDF_ClipPath::Transform(const CPDF_Matrix& matrix)
-{
- CPDF_ClipPathData* pData = GetModify();
- int i;
- for (i = 0; i < pData->m_PathCount; i ++) {
- pData->m_pPathList[i].Transform(&matrix);
- }
- for (i = 0; i < pData->m_TextCount; i ++)
- if (pData->m_pTextList[i]) {
- pData->m_pTextList[i]->Transform(matrix);
- }
-}
-CPDF_ColorStateData::CPDF_ColorStateData(const CPDF_ColorStateData& src)
-{
- m_FillColor.Copy(&src.m_FillColor);
- m_FillRGB = src.m_FillRGB;
- m_StrokeColor.Copy(&src.m_StrokeColor);
- m_StrokeRGB = src.m_StrokeRGB;
-}
-void CPDF_ColorStateData::Default()
-{
- m_FillRGB = m_StrokeRGB = 0;
- m_FillColor.SetColorSpace(CPDF_ColorSpace::GetStockCS(PDFCS_DEVICEGRAY));
- m_StrokeColor.SetColorSpace(CPDF_ColorSpace::GetStockCS(PDFCS_DEVICEGRAY));
-}
-void CPDF_ColorState::SetFillColor(CPDF_ColorSpace* pCS, FX_FLOAT* pValue, int nValues)
-{
- CPDF_ColorStateData* pData = GetModify();
- SetColor(pData->m_FillColor, pData->m_FillRGB, pCS, pValue, nValues);
-}
-void CPDF_ColorState::SetStrokeColor(CPDF_ColorSpace* pCS, FX_FLOAT* pValue, int nValues)
-{
- CPDF_ColorStateData* pData = GetModify();
- SetColor(pData->m_StrokeColor, pData->m_StrokeRGB, pCS, pValue, nValues);
-}
-void CPDF_ColorState::SetColor(CPDF_Color& color, FX_DWORD& rgb, CPDF_ColorSpace* pCS, FX_FLOAT* pValue, int nValues)
-{
- if (pCS) {
- color.SetColorSpace(pCS);
- } else if (color.IsNull()) {
- color.SetColorSpace(CPDF_ColorSpace::GetStockCS(PDFCS_DEVICEGRAY));
- }
- if (color.m_pCS->CountComponents() > nValues) {
- return;
- }
- color.SetValue(pValue);
- int R, G, B;
- rgb = color.GetRGB(R, G, B) ? FXSYS_RGB(R, G, B) : (FX_DWORD) - 1;
-}
-void CPDF_ColorState::SetFillPattern(CPDF_Pattern* pPattern, FX_FLOAT* pValue, int nValues)
-{
- CPDF_ColorStateData* pData = GetModify();
- pData->m_FillColor.SetValue(pPattern, pValue, nValues);
- int R, G, B;
- FX_BOOL ret = pData->m_FillColor.GetRGB(R, G, B);
- if (pPattern->m_PatternType == 1 && ((CPDF_TilingPattern*)pPattern)->m_bColored && !ret) {
- pData->m_FillRGB = 0x00BFBFBF;
- return;
- }
- pData->m_FillRGB = ret ? FXSYS_RGB(R, G, B) : (FX_DWORD) - 1;
-}
-void CPDF_ColorState::SetStrokePattern(CPDF_Pattern* pPattern, FX_FLOAT* pValue, int nValues)
-{
- CPDF_ColorStateData* pData = GetModify();
- pData->m_StrokeColor.SetValue(pPattern, pValue, nValues);
- int R, G, B;
- FX_BOOL ret = pData->m_StrokeColor.GetRGB(R, G, B);
- if (pPattern->m_PatternType == 1 && ((CPDF_TilingPattern*)pPattern)->m_bColored && !ret) {
- pData->m_StrokeRGB = 0x00BFBFBF;
- return;
- }
- pData->m_StrokeRGB = pData->m_StrokeColor.GetRGB(R, G, B) ? FXSYS_RGB(R, G, B) : (FX_DWORD) - 1;
-}
-CPDF_TextStateData::CPDF_TextStateData()
-{
- m_pFont = NULL;
- m_FontSize = 1.0f;
- m_WordSpace = 0;
- m_CharSpace = 0;
- m_TextMode = 0;
- m_Matrix[0] = m_Matrix[3] = 1.0f;
- m_Matrix[1] = m_Matrix[2] = 0;
- m_CTM[0] = m_CTM[3] = 1.0f;
- m_CTM[1] = m_CTM[2] = 0;
-}
-CPDF_TextStateData::CPDF_TextStateData(const CPDF_TextStateData& src)
-{
- FXSYS_memcpy32(this, &src, sizeof(CPDF_TextStateData));
- if (m_pFont && m_pFont->m_pDocument) {
- m_pFont = m_pFont->m_pDocument->GetPageData()->GetFont(m_pFont->GetFontDict(), FALSE);
- }
-}
-CPDF_TextStateData::~CPDF_TextStateData()
-{
- CPDF_Font* pFont = m_pFont;
- if (pFont && pFont->m_pDocument) {
- pFont->m_pDocument->GetPageData()->ReleaseFont(pFont->GetFontDict());
- }
-}
-void CPDF_TextState::SetFont(CPDF_Font* pFont)
-{
- CPDF_Font*& pStateFont = GetModify()->m_pFont;
- CPDF_DocPageData* pDocPageData = NULL;
- if (pStateFont && pStateFont->m_pDocument) {
- pDocPageData = pStateFont->m_pDocument->GetPageData();
- pDocPageData->ReleaseFont(pStateFont->GetFontDict());
- }
- pStateFont = pFont;
-}
-FX_FLOAT CPDF_TextState::GetFontSizeV() const
-{
- FX_FLOAT* pMatrix = GetMatrix();
- FX_FLOAT unit = FXSYS_sqrt2(pMatrix[1], pMatrix[3]);
- FX_FLOAT size = FXSYS_Mul(unit, GetFontSize());
- return (FX_FLOAT)FXSYS_fabs(size);
-}
-FX_FLOAT CPDF_TextState::GetFontSizeH() const
-{
- FX_FLOAT* pMatrix = GetMatrix();
- FX_FLOAT unit = FXSYS_sqrt2(pMatrix[0], pMatrix[2]);
- FX_FLOAT size = FXSYS_Mul(unit, GetFontSize());
- return (FX_FLOAT)FXSYS_fabs(size);
-}
-FX_FLOAT CPDF_TextState::GetBaselineAngle() const
-{
- FX_FLOAT* m_Matrix = GetMatrix();
- return FXSYS_atan2(m_Matrix[2], m_Matrix[0]);
-}
-FX_FLOAT CPDF_TextState::GetShearAngle() const
-{
- FX_FLOAT* m_Matrix = GetMatrix();
- FX_FLOAT shear_angle = FXSYS_atan2(m_Matrix[1], m_Matrix[3]);
- return GetBaselineAngle() + shear_angle;
-}
-CPDF_GeneralStateData::CPDF_GeneralStateData()
-{
- FXSYS_memset32(this, 0, sizeof(CPDF_GeneralStateData));
- FXSYS_strcpy((FX_LPSTR)m_BlendMode, (FX_LPCSTR)"Normal");
- m_StrokeAlpha = 1.0f;
- m_FillAlpha = 1.0f;
- m_Flatness = 1.0f;
- m_Matrix.SetIdentity();
-}
-CPDF_GeneralStateData::CPDF_GeneralStateData(const CPDF_GeneralStateData& src)
-{
- FXSYS_memcpy32(this, &src, sizeof(CPDF_GeneralStateData));
- if (src.m_pTransferFunc && src.m_pTransferFunc->m_pPDFDoc) {
- CPDF_DocRenderData* pDocCache = src.m_pTransferFunc->m_pPDFDoc->GetRenderData();
- if (!pDocCache) {
- return;
- }
- m_pTransferFunc = pDocCache->GetTransferFunc(m_pTR);
- }
-}
-CPDF_GeneralStateData::~CPDF_GeneralStateData()
-{
- if (m_pTransferFunc && m_pTransferFunc->m_pPDFDoc) {
- CPDF_DocRenderData* pDocCache = m_pTransferFunc->m_pPDFDoc->GetRenderData();
- if (!pDocCache) {
- return;
- }
- pDocCache->ReleaseTransferFunc(m_pTR);
- }
-}
-static int GetBlendType(FX_BSTR mode)
-{
- switch (mode.GetID()) {
- case FXBSTR_ID('N', 'o', 'r', 'm'):
- case FXBSTR_ID('C', 'o', 'm', 'p'):
- return FXDIB_BLEND_NORMAL;
- case FXBSTR_ID('M', 'u', 'l', 't'):
- return FXDIB_BLEND_MULTIPLY;
- case FXBSTR_ID('S', 'c', 'r', 'e'):
- return FXDIB_BLEND_SCREEN;
- case FXBSTR_ID('O', 'v', 'e', 'r'):
- return FXDIB_BLEND_OVERLAY;
- case FXBSTR_ID('D', 'a', 'r', 'k'):
- return FXDIB_BLEND_DARKEN;
- case FXBSTR_ID('L', 'i', 'g', 'h'):
- return FXDIB_BLEND_LIGHTEN;
- case FXBSTR_ID('C', 'o', 'l', 'o'):
- if (mode.GetLength() == 10) {
- return FXDIB_BLEND_COLORDODGE;
- }
- if (mode.GetLength() == 9) {
- return FXDIB_BLEND_COLORBURN;
- }
- return FXDIB_BLEND_COLOR;
- case FXBSTR_ID('H', 'a', 'r', 'd'):
- return FXDIB_BLEND_HARDLIGHT;
- case FXBSTR_ID('S', 'o', 'f', 't'):
- return FXDIB_BLEND_SOFTLIGHT;
- case FXBSTR_ID('D', 'i', 'f', 'f'):
- return FXDIB_BLEND_DIFFERENCE;
- case FXBSTR_ID('E', 'x', 'c', 'l'):
- return FXDIB_BLEND_EXCLUSION;
- case FXBSTR_ID('H', 'u', 'e', 0):
- return FXDIB_BLEND_HUE;
- case FXBSTR_ID('S', 'a', 't', 'u'):
- return FXDIB_BLEND_SATURATION;
- case FXBSTR_ID('L', 'u', 'm', 'i'):
- return FXDIB_BLEND_LUMINOSITY;
- }
- return FXDIB_BLEND_NORMAL;
-}
-void CPDF_GeneralStateData::SetBlendMode(FX_BSTR blend_mode)
-{
- if (blend_mode.GetLength() > 15) {
- return;
- }
- FXSYS_memcpy32(m_BlendMode, (FX_LPCBYTE)blend_mode, blend_mode.GetLength());
- m_BlendMode[blend_mode.GetLength()] = 0;
- m_BlendType = ::GetBlendType(blend_mode);
-}
-int RI_StringToId(const CFX_ByteString& ri)
-{
- FX_DWORD id = ri.GetID();
- if (id == FXBSTR_ID('A', 'b', 's', 'o')) {
- return 1;
- }
- if (id == FXBSTR_ID('S', 'a', 't', 'u')) {
- return 2;
- }
- if (id == FXBSTR_ID('P', 'e', 'r', 'c')) {
- return 3;
- }
- return 0;
-}
-void CPDF_GeneralState::SetRenderIntent(const CFX_ByteString& ri)
-{
- GetModify()->m_RenderIntent = RI_StringToId(ri);
-}
-CPDF_AllStates::CPDF_AllStates()
-{
- m_TextX = m_TextY = m_TextLineX = m_TextLineY = 0;
- m_TextLeading = 0;
- m_TextRise = 0;
- m_TextHorzScale = 1.0f;
-}
-CPDF_AllStates::~CPDF_AllStates()
-{
-}
-void CPDF_AllStates::Copy(const CPDF_AllStates& src)
-{
- CopyStates(src);
- m_TextMatrix.Copy(src.m_TextMatrix);
- m_ParentMatrix.Copy(src.m_ParentMatrix);
- m_CTM.Copy(src.m_CTM);
- m_TextX = src.m_TextX;
- m_TextY = src.m_TextY;
- m_TextLineX = src.m_TextLineX;
- m_TextLineY = src.m_TextLineY;
- m_TextLeading = src.m_TextLeading;
- m_TextRise = src.m_TextRise;
- m_TextHorzScale = src.m_TextHorzScale;
-}
-void CPDF_AllStates::SetLineDash(CPDF_Array* pArray, FX_FLOAT phase, FX_FLOAT scale)
-{
- CFX_GraphStateData* pData = m_GraphState.GetModify();
- pData->m_DashPhase = FXSYS_Mul(phase, scale);
- pData->SetDashCount(pArray->GetCount());
- for (FX_DWORD i = 0; i < pArray->GetCount(); i ++) {
- pData->m_DashArray[i] = FXSYS_Mul(pArray->GetNumber(i), scale);
- }
-}
-void CPDF_AllStates::ProcessExtGS(CPDF_Dictionary* pGS, CPDF_StreamContentParser* pParser)
-{
- CPDF_GeneralStateData* pGeneralState = m_GeneralState.GetModify();
- FX_POSITION pos = pGS->GetStartPos();
- while (pos) {
- CFX_ByteString key_str;
- CPDF_Object* pObject = pGS->GetNextElement(pos, key_str)->GetDirect();
- if (pObject == NULL) {
- continue;
- }
- FX_DWORD key = key_str.GetID();
- switch (key) {
- case FXBSTR_ID('L', 'W', 0, 0):
- m_GraphState.GetModify()->m_LineWidth = pObject->GetNumber();
- break;
- case FXBSTR_ID('L', 'C', 0, 0):
- m_GraphState.GetModify()->m_LineCap = (CFX_GraphStateData::LineCap)pObject->GetInteger();
- break;
- case FXBSTR_ID('L', 'J', 0, 0):
- m_GraphState.GetModify()->m_LineJoin = (CFX_GraphStateData::LineJoin)pObject->GetInteger();
- break;
- case FXBSTR_ID('M', 'L', 0, 0):
- m_GraphState.GetModify()->m_MiterLimit = pObject->GetNumber();
- break;
- case FXBSTR_ID('D', 0, 0, 0): {
- if (pObject->GetType() != PDFOBJ_ARRAY) {
- break;
- }
- CPDF_Array* pDash = (CPDF_Array*)pObject;
- CPDF_Array* pArray = pDash->GetArray(0);
- if (pArray == NULL) {
- break;
- }
- SetLineDash(pArray, pDash->GetNumber(1), 1.0f);
- break;
- }
- case FXBSTR_ID('R', 'I', 0, 0):
- m_GeneralState.SetRenderIntent(pObject->GetString());
- break;
- case FXBSTR_ID('F', 'o', 'n', 't'): {
- if (pObject->GetType() != PDFOBJ_ARRAY) {
- break;
- }
- CPDF_Array* pFont = (CPDF_Array*)pObject;
- m_TextState.GetModify()->m_FontSize = pFont->GetNumber(1);
- m_TextState.SetFont(pParser->FindFont(pFont->GetString(0)));
- break;
- }
- case FXBSTR_ID('T', 'R', 0, 0):
- if (pGS->KeyExist(FX_BSTRC("TR2"))) {
- continue;
- }
- case FXBSTR_ID('T', 'R', '2', 0):
- if (pObject && pObject->GetType() != PDFOBJ_NAME) {
- pGeneralState->m_pTR = pObject;
- } else {
- pGeneralState->m_pTR = NULL;
- }
- break;
- case FXBSTR_ID('B', 'M', 0, 0): {
- CFX_ByteString mode;
- if (pObject->GetType() == PDFOBJ_ARRAY) {
- mode = ((CPDF_Array*)pObject)->GetString(0);
- } else {
- mode = pObject->GetString();
- }
- pGeneralState->SetBlendMode(mode);
- if (pGeneralState->m_BlendType > FXDIB_BLEND_MULTIPLY) {
- pParser->m_pObjectList->m_bBackgroundAlphaNeeded = TRUE;
- }
- break;
- }
- case FXBSTR_ID('S', 'M', 'a', 's'):
- if (pObject && pObject->GetType() == PDFOBJ_DICTIONARY) {
- pGeneralState->m_pSoftMask = pObject;
- FXSYS_memcpy32(pGeneralState->m_SMaskMatrix, &pParser->m_pCurStates->m_CTM, sizeof(CPDF_Matrix));
- } else {
- pGeneralState->m_pSoftMask = NULL;
- }
- break;
- case FXBSTR_ID('C', 'A', 0, 0):
- pGeneralState->m_StrokeAlpha = PDF_ClipFloat(pObject->GetNumber());
- break;
- case FXBSTR_ID('c', 'a', 0, 0):
- pGeneralState->m_FillAlpha = PDF_ClipFloat(pObject->GetNumber());
- break;
- case FXBSTR_ID('O', 'P', 0, 0):
- pGeneralState->m_StrokeOP = pObject->GetInteger();
- if (!pGS->KeyExist(FX_BSTRC("op"))) {
- pGeneralState->m_FillOP = pObject->GetInteger();
- }
- break;
- case FXBSTR_ID('o', 'p', 0, 0):
- pGeneralState->m_FillOP = pObject->GetInteger();
- break;
- case FXBSTR_ID('O', 'P', 'M', 0):
- pGeneralState->m_OPMode = pObject->GetInteger();
- break;
- case FXBSTR_ID('B', 'G', 0, 0):
- if (pGS->KeyExist(FX_BSTRC("BG2"))) {
- continue;
- }
- case FXBSTR_ID('B', 'G', '2', 0):
- pGeneralState->m_pBG = pObject;
- break;
- case FXBSTR_ID('U', 'C', 'R', 0):
- if (pGS->KeyExist(FX_BSTRC("UCR2"))) {
- continue;
- }
- case FXBSTR_ID('U', 'C', 'R', '2'):
- pGeneralState->m_pUCR = pObject;
- break;
- case FXBSTR_ID('H', 'T', 0, 0):
- pGeneralState->m_pHT = pObject;
- break;
- case FXBSTR_ID('F', 'L', 0, 0):
- pGeneralState->m_Flatness = pObject->GetNumber();
- break;
- case FXBSTR_ID('S', 'M', 0, 0):
- pGeneralState->m_Smoothness = pObject->GetNumber();
- break;
- case FXBSTR_ID('S', 'A', 0, 0):
- pGeneralState->m_StrokeAdjust = pObject->GetInteger();
- break;
- case FXBSTR_ID('A', 'I', 'S', 0):
- pGeneralState->m_AlphaSource = pObject->GetInteger();
- break;
- case FXBSTR_ID('T', 'K', 0, 0):
- pGeneralState->m_TextKnockout = pObject->GetInteger();
- break;
- }
- }
- pGeneralState->m_Matrix = m_CTM;
-}
-CPDF_ContentMarkItem::CPDF_ContentMarkItem()
-{
- m_ParamType = None;
-}
-CPDF_ContentMarkItem::CPDF_ContentMarkItem(const CPDF_ContentMarkItem& src)
-{
- m_MarkName = src.m_MarkName;
- m_ParamType = src.m_ParamType;
- if (m_ParamType == DirectDict) {
- m_pParam = ((CPDF_Dictionary*)src.m_pParam)->Clone();
- } else {
- m_pParam = src.m_pParam;
- }
-}
-CPDF_ContentMarkItem::~CPDF_ContentMarkItem()
-{
- if (m_ParamType == DirectDict) {
- ((CPDF_Dictionary*)m_pParam)->Release();
- }
-}
-FX_BOOL CPDF_ContentMarkItem::HasMCID() const
-{
- if (m_pParam && (m_ParamType == DirectDict || m_ParamType == PropertiesDict)) {
- return ((CPDF_Dictionary *)m_pParam)->KeyExist(FX_BSTRC("MCID"));
- }
- return FALSE;
-}
-CPDF_ContentMarkData::CPDF_ContentMarkData(const CPDF_ContentMarkData& src)
-{
- for (int i = 0; i < src.m_Marks.GetSize(); i ++) {
- m_Marks.Add(src.m_Marks[i]);
- }
-}
-int CPDF_ContentMarkData::GetMCID() const
-{
- CPDF_ContentMarkItem::ParamType type = CPDF_ContentMarkItem::None;
- for (int i = 0; i < m_Marks.GetSize(); i ++) {
- type = m_Marks[i].GetParamType();
- if (type == CPDF_ContentMarkItem::PropertiesDict || type == CPDF_ContentMarkItem::DirectDict) {
- CPDF_Dictionary *pDict = (CPDF_Dictionary *)m_Marks[i].GetParam();
- if (pDict->KeyExist(FX_BSTRC("MCID"))) {
- return pDict->GetInteger(FX_BSTRC("MCID"));
- }
- }
- }
- return -1;
-}
-void CPDF_ContentMarkData::AddMark(const CFX_ByteString& name, CPDF_Dictionary* pDict, FX_BOOL bDirect)
-{
- CPDF_ContentMarkItem& item = m_Marks.Add();
- item.SetName(name);
- if (pDict == NULL) {
- return;
- }
- item.SetParam(bDirect ? CPDF_ContentMarkItem::DirectDict : CPDF_ContentMarkItem::PropertiesDict,
- bDirect ? pDict->Clone() : pDict);
-}
-void CPDF_ContentMarkData::DeleteLastMark()
-{
- int size = m_Marks.GetSize();
- if (size == 0) {
- return;
- }
- m_Marks.RemoveAt(size - 1);
-}
-FX_BOOL CPDF_ContentMark::HasMark(FX_BSTR mark) const
-{
- if (m_pObject == NULL) {
- return FALSE;
- }
- for (int i = 0; i < m_pObject->CountItems(); i ++) {
- CPDF_ContentMarkItem& item = m_pObject->GetItem(i);
- if (item.GetName() == mark) {
- return TRUE;
- }
- }
- return FALSE;
-}
-FX_BOOL CPDF_ContentMark::LookupMark(FX_BSTR mark, CPDF_Dictionary*& pDict) const
-{
- if (m_pObject == NULL) {
- return FALSE;
- }
- for (int i = 0; i < m_pObject->CountItems(); i ++) {
- CPDF_ContentMarkItem& item = m_pObject->GetItem(i);
- if (item.GetName() == mark) {
- pDict = NULL;
- if (item.GetParamType() == CPDF_ContentMarkItem::PropertiesDict ||
- item.GetParamType() == CPDF_ContentMarkItem::DirectDict) {
- pDict = (CPDF_Dictionary*)item.GetParam();
- }
- return TRUE;
- }
- }
- return FALSE;
-}
+// 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
+
+#include "../../../include/fpdfapi/fpdf_page.h"
+#include "../../../include/fpdfapi/fpdf_pageobj.h"
+#include "../../../include/fpdfapi/fpdf_module.h"
+#include "../../../include/fpdfapi/fpdf_render.h"
+#include "pageint.h"
+#include "../fpdf_render/render_int.h"
+void CPDF_GraphicStates::DefaultStates()
+{
+ m_ColorState.New()->Default();
+}
+void CPDF_GraphicStates::CopyStates(const CPDF_GraphicStates& src)
+{
+ m_ClipPath = src.m_ClipPath;
+ m_GraphState = src.m_GraphState;
+ m_ColorState = src.m_ColorState;
+ m_TextState = src.m_TextState;
+ m_GeneralState = src.m_GeneralState;
+}
+CPDF_ClipPathData::CPDF_ClipPathData()
+{
+ m_PathCount = 0;
+ m_pPathList = NULL;
+ m_pTypeList = NULL;
+ m_TextCount = 0;
+ m_pTextList = NULL;
+}
+CPDF_ClipPathData::~CPDF_ClipPathData()
+{
+ int i;
+ if (m_pPathList) {
+ FX_DELETE_VECTOR(m_pPathList, CPDF_Path, m_PathCount);
+ }
+ if (m_pTypeList) {
+ FX_Free(m_pTypeList);
+ }
+ for (i = m_TextCount - 1; i > -1; i --)
+ if (m_pTextList[i]) {
+ delete m_pTextList[i];
+ }
+ if (m_pTextList) {
+ FX_Free(m_pTextList);
+ }
+}
+CPDF_ClipPathData::CPDF_ClipPathData(const CPDF_ClipPathData& src)
+{
+ m_pPathList = NULL;
+ m_pPathList = NULL;
+ m_pTextList = NULL;
+ m_PathCount = src.m_PathCount;
+ if (m_PathCount) {
+ int alloc_size = m_PathCount;
+ if (alloc_size % 8) {
+ alloc_size += 8 - (alloc_size % 8);
+ }
+ FX_NEW_VECTOR(m_pPathList, CPDF_Path, alloc_size);
+ for (int i = 0; i < m_PathCount; i ++) {
+ m_pPathList[i] = src.m_pPathList[i];
+ }
+ m_pTypeList = FX_Alloc(FX_BYTE, alloc_size);
+ FXSYS_memcpy32(m_pTypeList, src.m_pTypeList, m_PathCount);
+ } else {
+ m_pPathList = NULL;
+ m_pTypeList = NULL;
+ }
+ m_TextCount = src.m_TextCount;
+ if (m_TextCount) {
+ m_pTextList = FX_Alloc(CPDF_TextObject*, m_TextCount);
+ FXSYS_memset32(m_pTextList, 0, sizeof(CPDF_TextObject*) * m_TextCount);
+ for (int i = 0; i < m_TextCount; i ++) {
+ if (src.m_pTextList[i]) {
+ m_pTextList[i] = FX_NEW CPDF_TextObject;
+ m_pTextList[i]->Copy(src.m_pTextList[i]);
+ } else {
+ m_pTextList[i] = NULL;
+ }
+ }
+ } else {
+ m_pTextList = NULL;
+ }
+}
+void CPDF_ClipPathData::SetCount(int path_count, int text_count)
+{
+ ASSERT(m_TextCount == 0 && m_PathCount == 0);
+ if (path_count) {
+ m_PathCount = path_count;
+ int alloc_size = (path_count + 7) / 8 * 8;
+ FX_NEW_VECTOR(m_pPathList, CPDF_Path, alloc_size);
+ m_pTypeList = FX_Alloc(FX_BYTE, alloc_size);
+ }
+ if (text_count) {
+ m_TextCount = text_count;
+ m_pTextList = FX_Alloc(CPDF_TextObject*, text_count);
+ FXSYS_memset32(m_pTextList, 0, sizeof(void*) * text_count);
+ }
+}
+CPDF_Rect CPDF_ClipPath::GetClipBox() const
+{
+ CPDF_Rect rect;
+ FX_BOOL bStarted = FALSE;
+ int count = GetPathCount();
+ if (count) {
+ rect = GetPath(0).GetBoundingBox();
+ for (int i = 1; i < count; i ++) {
+ CPDF_Rect path_rect = GetPath(i).GetBoundingBox();
+ rect.Intersect(path_rect);
+ }
+ bStarted = TRUE;
+ }
+ count = GetTextCount();
+ if (count) {
+ CPDF_Rect layer_rect;
+ FX_BOOL bLayerStarted = FALSE;
+ for (int i = 0; i < count; i ++) {
+ CPDF_TextObject* pTextObj = GetText(i);
+ if (pTextObj == NULL) {
+ if (!bStarted) {
+ rect = layer_rect;
+ bStarted = TRUE;
+ } else {
+ rect.Intersect(layer_rect);
+ }
+ bLayerStarted = FALSE;
+ } else {
+ if (!bLayerStarted) {
+ layer_rect = pTextObj->GetBBox(NULL);
+ bLayerStarted = TRUE;
+ } else {
+ layer_rect.Union(pTextObj->GetBBox(NULL));
+ }
+ }
+ }
+ }
+ return rect;
+}
+void CPDF_ClipPath::AppendPath(CPDF_Path path, int type, FX_BOOL bAutoMerge)
+{
+ CPDF_ClipPathData* pData = GetModify();
+ if (pData->m_PathCount && bAutoMerge) {
+ CPDF_Path old_path = pData->m_pPathList[pData->m_PathCount - 1];
+ if (old_path.IsRect()) {
+ CPDF_Rect old_rect(old_path.GetPointX(0), old_path.GetPointY(0),
+ old_path.GetPointX(2), old_path.GetPointY(2));
+ CPDF_Rect new_rect = path.GetBoundingBox();
+ if (old_rect.Contains(new_rect)) {
+ pData->m_PathCount --;
+ pData->m_pPathList[pData->m_PathCount].SetNull();
+ }
+ }
+ }
+ if (pData->m_PathCount % 8 == 0) {
+ CPDF_Path* pNewPath;
+ FX_NEW_VECTOR(pNewPath, CPDF_Path, pData->m_PathCount + 8);
+ for (int i = 0; i < pData->m_PathCount; i ++) {
+ pNewPath[i] = pData->m_pPathList[i];
+ }
+ if (pData->m_pPathList) {
+ FX_DELETE_VECTOR(pData->m_pPathList, CPDF_Path, pData->m_PathCount);
+ }
+ FX_BYTE* pNewType = FX_Alloc(FX_BYTE, pData->m_PathCount + 8);
+ FXSYS_memcpy32(pNewType, pData->m_pTypeList, pData->m_PathCount);
+ if (pData->m_pTypeList) {
+ FX_Free(pData->m_pTypeList);
+ }
+ pData->m_pPathList = pNewPath;
+ pData->m_pTypeList = pNewType;
+ }
+ pData->m_pPathList[pData->m_PathCount] = path;
+ pData->m_pTypeList[pData->m_PathCount] = (FX_BYTE)type;
+ pData->m_PathCount ++;
+}
+void CPDF_ClipPath::DeletePath(int index)
+{
+ CPDF_ClipPathData* pData = GetModify();
+ if (index >= pData->m_PathCount) {
+ return;
+ }
+ pData->m_pPathList[index].SetNull();
+ for (int i = index; i < pData->m_PathCount - 1; i ++) {
+ pData->m_pPathList[i] = pData->m_pPathList[i + 1];
+ }
+ pData->m_pPathList[pData->m_PathCount - 1].SetNull();
+ FXSYS_memmove32(pData->m_pTypeList + index, pData->m_pTypeList + index + 1, pData->m_PathCount - index - 1);
+ pData->m_PathCount --;
+}
+#define FPDF_CLIPPATH_MAX_TEXTS 1024
+void CPDF_ClipPath::AppendTexts(CPDF_TextObject** pTexts, int count)
+{
+ CPDF_ClipPathData* pData = GetModify();
+ if (pData->m_TextCount + count > FPDF_CLIPPATH_MAX_TEXTS) {
+ for (int i = 0; i < count; i ++) {
+ pTexts[i]->Release();
+ }
+ return;
+ }
+ CPDF_TextObject** pNewList = FX_Alloc(CPDF_TextObject*, pData->m_TextCount + count + 1);
+ if (pData->m_pTextList) {
+ FXSYS_memcpy32(pNewList, pData->m_pTextList, pData->m_TextCount * sizeof(CPDF_TextObject*));
+ FX_Free(pData->m_pTextList);
+ }
+ pData->m_pTextList = pNewList;
+ for (int i = 0; i < count; i ++) {
+ pData->m_pTextList[pData->m_TextCount + i] = pTexts[i];
+ }
+ pData->m_pTextList[pData->m_TextCount + count] = NULL;
+ pData->m_TextCount += count + 1;
+}
+void CPDF_ClipPath::Transform(const CPDF_Matrix& matrix)
+{
+ CPDF_ClipPathData* pData = GetModify();
+ int i;
+ for (i = 0; i < pData->m_PathCount; i ++) {
+ pData->m_pPathList[i].Transform(&matrix);
+ }
+ for (i = 0; i < pData->m_TextCount; i ++)
+ if (pData->m_pTextList[i]) {
+ pData->m_pTextList[i]->Transform(matrix);
+ }
+}
+CPDF_ColorStateData::CPDF_ColorStateData(const CPDF_ColorStateData& src)
+{
+ m_FillColor.Copy(&src.m_FillColor);
+ m_FillRGB = src.m_FillRGB;
+ m_StrokeColor.Copy(&src.m_StrokeColor);
+ m_StrokeRGB = src.m_StrokeRGB;
+}
+void CPDF_ColorStateData::Default()
+{
+ m_FillRGB = m_StrokeRGB = 0;
+ m_FillColor.SetColorSpace(CPDF_ColorSpace::GetStockCS(PDFCS_DEVICEGRAY));
+ m_StrokeColor.SetColorSpace(CPDF_ColorSpace::GetStockCS(PDFCS_DEVICEGRAY));
+}
+void CPDF_ColorState::SetFillColor(CPDF_ColorSpace* pCS, FX_FLOAT* pValue, int nValues)
+{
+ CPDF_ColorStateData* pData = GetModify();
+ SetColor(pData->m_FillColor, pData->m_FillRGB, pCS, pValue, nValues);
+}
+void CPDF_ColorState::SetStrokeColor(CPDF_ColorSpace* pCS, FX_FLOAT* pValue, int nValues)
+{
+ CPDF_ColorStateData* pData = GetModify();
+ SetColor(pData->m_StrokeColor, pData->m_StrokeRGB, pCS, pValue, nValues);
+}
+void CPDF_ColorState::SetColor(CPDF_Color& color, FX_DWORD& rgb, CPDF_ColorSpace* pCS, FX_FLOAT* pValue, int nValues)
+{
+ if (pCS) {
+ color.SetColorSpace(pCS);
+ } else if (color.IsNull()) {
+ color.SetColorSpace(CPDF_ColorSpace::GetStockCS(PDFCS_DEVICEGRAY));
+ }
+ if (color.m_pCS->CountComponents() > nValues) {
+ return;
+ }
+ color.SetValue(pValue);
+ int R, G, B;
+ rgb = color.GetRGB(R, G, B) ? FXSYS_RGB(R, G, B) : (FX_DWORD) - 1;
+}
+void CPDF_ColorState::SetFillPattern(CPDF_Pattern* pPattern, FX_FLOAT* pValue, int nValues)
+{
+ CPDF_ColorStateData* pData = GetModify();
+ pData->m_FillColor.SetValue(pPattern, pValue, nValues);
+ int R, G, B;
+ FX_BOOL ret = pData->m_FillColor.GetRGB(R, G, B);
+ if (pPattern->m_PatternType == 1 && ((CPDF_TilingPattern*)pPattern)->m_bColored && !ret) {
+ pData->m_FillRGB = 0x00BFBFBF;
+ return;
+ }
+ pData->m_FillRGB = ret ? FXSYS_RGB(R, G, B) : (FX_DWORD) - 1;
+}
+void CPDF_ColorState::SetStrokePattern(CPDF_Pattern* pPattern, FX_FLOAT* pValue, int nValues)
+{
+ CPDF_ColorStateData* pData = GetModify();
+ pData->m_StrokeColor.SetValue(pPattern, pValue, nValues);
+ int R, G, B;
+ FX_BOOL ret = pData->m_StrokeColor.GetRGB(R, G, B);
+ if (pPattern->m_PatternType == 1 && ((CPDF_TilingPattern*)pPattern)->m_bColored && !ret) {
+ pData->m_StrokeRGB = 0x00BFBFBF;
+ return;
+ }
+ pData->m_StrokeRGB = pData->m_StrokeColor.GetRGB(R, G, B) ? FXSYS_RGB(R, G, B) : (FX_DWORD) - 1;
+}
+CPDF_TextStateData::CPDF_TextStateData()
+{
+ m_pFont = NULL;
+ m_FontSize = 1.0f;
+ m_WordSpace = 0;
+ m_CharSpace = 0;
+ m_TextMode = 0;
+ m_Matrix[0] = m_Matrix[3] = 1.0f;
+ m_Matrix[1] = m_Matrix[2] = 0;
+ m_CTM[0] = m_CTM[3] = 1.0f;
+ m_CTM[1] = m_CTM[2] = 0;
+}
+CPDF_TextStateData::CPDF_TextStateData(const CPDF_TextStateData& src)
+{
+ FXSYS_memcpy32(this, &src, sizeof(CPDF_TextStateData));
+ if (m_pFont && m_pFont->m_pDocument) {
+ m_pFont = m_pFont->m_pDocument->GetPageData()->GetFont(m_pFont->GetFontDict(), FALSE);
+ }
+}
+CPDF_TextStateData::~CPDF_TextStateData()
+{
+ CPDF_Font* pFont = m_pFont;
+ if (pFont && pFont->m_pDocument) {
+ pFont->m_pDocument->GetPageData()->ReleaseFont(pFont->GetFontDict());
+ }
+}
+void CPDF_TextState::SetFont(CPDF_Font* pFont)
+{
+ CPDF_Font*& pStateFont = GetModify()->m_pFont;
+ CPDF_DocPageData* pDocPageData = NULL;
+ if (pStateFont && pStateFont->m_pDocument) {
+ pDocPageData = pStateFont->m_pDocument->GetPageData();
+ pDocPageData->ReleaseFont(pStateFont->GetFontDict());
+ }
+ pStateFont = pFont;
+}
+FX_FLOAT CPDF_TextState::GetFontSizeV() const
+{
+ FX_FLOAT* pMatrix = GetMatrix();
+ FX_FLOAT unit = FXSYS_sqrt2(pMatrix[1], pMatrix[3]);
+ FX_FLOAT size = FXSYS_Mul(unit, GetFontSize());
+ return (FX_FLOAT)FXSYS_fabs(size);
+}
+FX_FLOAT CPDF_TextState::GetFontSizeH() const
+{
+ FX_FLOAT* pMatrix = GetMatrix();
+ FX_FLOAT unit = FXSYS_sqrt2(pMatrix[0], pMatrix[2]);
+ FX_FLOAT size = FXSYS_Mul(unit, GetFontSize());
+ return (FX_FLOAT)FXSYS_fabs(size);
+}
+FX_FLOAT CPDF_TextState::GetBaselineAngle() const
+{
+ FX_FLOAT* m_Matrix = GetMatrix();
+ return FXSYS_atan2(m_Matrix[2], m_Matrix[0]);
+}
+FX_FLOAT CPDF_TextState::GetShearAngle() const
+{
+ FX_FLOAT* m_Matrix = GetMatrix();
+ FX_FLOAT shear_angle = FXSYS_atan2(m_Matrix[1], m_Matrix[3]);
+ return GetBaselineAngle() + shear_angle;
+}
+CPDF_GeneralStateData::CPDF_GeneralStateData()
+{
+ FXSYS_memset32(this, 0, sizeof(CPDF_GeneralStateData));
+ FXSYS_strcpy((FX_LPSTR)m_BlendMode, (FX_LPCSTR)"Normal");
+ m_StrokeAlpha = 1.0f;
+ m_FillAlpha = 1.0f;
+ m_Flatness = 1.0f;
+ m_Matrix.SetIdentity();
+}
+CPDF_GeneralStateData::CPDF_GeneralStateData(const CPDF_GeneralStateData& src)
+{
+ FXSYS_memcpy32(this, &src, sizeof(CPDF_GeneralStateData));
+ if (src.m_pTransferFunc && src.m_pTransferFunc->m_pPDFDoc) {
+ CPDF_DocRenderData* pDocCache = src.m_pTransferFunc->m_pPDFDoc->GetRenderData();
+ if (!pDocCache) {
+ return;
+ }
+ m_pTransferFunc = pDocCache->GetTransferFunc(m_pTR);
+ }
+}
+CPDF_GeneralStateData::~CPDF_GeneralStateData()
+{
+ if (m_pTransferFunc && m_pTransferFunc->m_pPDFDoc) {
+ CPDF_DocRenderData* pDocCache = m_pTransferFunc->m_pPDFDoc->GetRenderData();
+ if (!pDocCache) {
+ return;
+ }
+ pDocCache->ReleaseTransferFunc(m_pTR);
+ }
+}
+static int GetBlendType(FX_BSTR mode)
+{
+ switch (mode.GetID()) {
+ case FXBSTR_ID('N', 'o', 'r', 'm'):
+ case FXBSTR_ID('C', 'o', 'm', 'p'):
+ return FXDIB_BLEND_NORMAL;
+ case FXBSTR_ID('M', 'u', 'l', 't'):
+ return FXDIB_BLEND_MULTIPLY;
+ case FXBSTR_ID('S', 'c', 'r', 'e'):
+ return FXDIB_BLEND_SCREEN;
+ case FXBSTR_ID('O', 'v', 'e', 'r'):
+ return FXDIB_BLEND_OVERLAY;
+ case FXBSTR_ID('D', 'a', 'r', 'k'):
+ return FXDIB_BLEND_DARKEN;
+ case FXBSTR_ID('L', 'i', 'g', 'h'):
+ return FXDIB_BLEND_LIGHTEN;
+ case FXBSTR_ID('C', 'o', 'l', 'o'):
+ if (mode.GetLength() == 10) {
+ return FXDIB_BLEND_COLORDODGE;
+ }
+ if (mode.GetLength() == 9) {
+ return FXDIB_BLEND_COLORBURN;
+ }
+ return FXDIB_BLEND_COLOR;
+ case FXBSTR_ID('H', 'a', 'r', 'd'):
+ return FXDIB_BLEND_HARDLIGHT;
+ case FXBSTR_ID('S', 'o', 'f', 't'):
+ return FXDIB_BLEND_SOFTLIGHT;
+ case FXBSTR_ID('D', 'i', 'f', 'f'):
+ return FXDIB_BLEND_DIFFERENCE;
+ case FXBSTR_ID('E', 'x', 'c', 'l'):
+ return FXDIB_BLEND_EXCLUSION;
+ case FXBSTR_ID('H', 'u', 'e', 0):
+ return FXDIB_BLEND_HUE;
+ case FXBSTR_ID('S', 'a', 't', 'u'):
+ return FXDIB_BLEND_SATURATION;
+ case FXBSTR_ID('L', 'u', 'm', 'i'):
+ return FXDIB_BLEND_LUMINOSITY;
+ }
+ return FXDIB_BLEND_NORMAL;
+}
+void CPDF_GeneralStateData::SetBlendMode(FX_BSTR blend_mode)
+{
+ if (blend_mode.GetLength() > 15) {
+ return;
+ }
+ FXSYS_memcpy32(m_BlendMode, (FX_LPCBYTE)blend_mode, blend_mode.GetLength());
+ m_BlendMode[blend_mode.GetLength()] = 0;
+ m_BlendType = ::GetBlendType(blend_mode);
+}
+int RI_StringToId(const CFX_ByteString& ri)
+{
+ FX_DWORD id = ri.GetID();
+ if (id == FXBSTR_ID('A', 'b', 's', 'o')) {
+ return 1;
+ }
+ if (id == FXBSTR_ID('S', 'a', 't', 'u')) {
+ return 2;
+ }
+ if (id == FXBSTR_ID('P', 'e', 'r', 'c')) {
+ return 3;
+ }
+ return 0;
+}
+void CPDF_GeneralState::SetRenderIntent(const CFX_ByteString& ri)
+{
+ GetModify()->m_RenderIntent = RI_StringToId(ri);
+}
+CPDF_AllStates::CPDF_AllStates()
+{
+ m_TextX = m_TextY = m_TextLineX = m_TextLineY = 0;
+ m_TextLeading = 0;
+ m_TextRise = 0;
+ m_TextHorzScale = 1.0f;
+}
+CPDF_AllStates::~CPDF_AllStates()
+{
+}
+void CPDF_AllStates::Copy(const CPDF_AllStates& src)
+{
+ CopyStates(src);
+ m_TextMatrix.Copy(src.m_TextMatrix);
+ m_ParentMatrix.Copy(src.m_ParentMatrix);
+ m_CTM.Copy(src.m_CTM);
+ m_TextX = src.m_TextX;
+ m_TextY = src.m_TextY;
+ m_TextLineX = src.m_TextLineX;
+ m_TextLineY = src.m_TextLineY;
+ m_TextLeading = src.m_TextLeading;
+ m_TextRise = src.m_TextRise;
+ m_TextHorzScale = src.m_TextHorzScale;
+}
+void CPDF_AllStates::SetLineDash(CPDF_Array* pArray, FX_FLOAT phase, FX_FLOAT scale)
+{
+ CFX_GraphStateData* pData = m_GraphState.GetModify();
+ pData->m_DashPhase = FXSYS_Mul(phase, scale);
+ pData->SetDashCount(pArray->GetCount());
+ for (FX_DWORD i = 0; i < pArray->GetCount(); i ++) {
+ pData->m_DashArray[i] = FXSYS_Mul(pArray->GetNumber(i), scale);
+ }
+}
+void CPDF_AllStates::ProcessExtGS(CPDF_Dictionary* pGS, CPDF_StreamContentParser* pParser)
+{
+ CPDF_GeneralStateData* pGeneralState = m_GeneralState.GetModify();
+ FX_POSITION pos = pGS->GetStartPos();
+ while (pos) {
+ CFX_ByteString key_str;
+ CPDF_Object* pObject = pGS->GetNextElement(pos, key_str)->GetDirect();
+ if (pObject == NULL) {
+ continue;
+ }
+ FX_DWORD key = key_str.GetID();
+ switch (key) {
+ case FXBSTR_ID('L', 'W', 0, 0):
+ m_GraphState.GetModify()->m_LineWidth = pObject->GetNumber();
+ break;
+ case FXBSTR_ID('L', 'C', 0, 0):
+ m_GraphState.GetModify()->m_LineCap = (CFX_GraphStateData::LineCap)pObject->GetInteger();
+ break;
+ case FXBSTR_ID('L', 'J', 0, 0):
+ m_GraphState.GetModify()->m_LineJoin = (CFX_GraphStateData::LineJoin)pObject->GetInteger();
+ break;
+ case FXBSTR_ID('M', 'L', 0, 0):
+ m_GraphState.GetModify()->m_MiterLimit = pObject->GetNumber();
+ break;
+ case FXBSTR_ID('D', 0, 0, 0): {
+ if (pObject->GetType() != PDFOBJ_ARRAY) {
+ break;
+ }
+ CPDF_Array* pDash = (CPDF_Array*)pObject;
+ CPDF_Array* pArray = pDash->GetArray(0);
+ if (pArray == NULL) {
+ break;
+ }
+ SetLineDash(pArray, pDash->GetNumber(1), 1.0f);
+ break;
+ }
+ case FXBSTR_ID('R', 'I', 0, 0):
+ m_GeneralState.SetRenderIntent(pObject->GetString());
+ break;
+ case FXBSTR_ID('F', 'o', 'n', 't'): {
+ if (pObject->GetType() != PDFOBJ_ARRAY) {
+ break;
+ }
+ CPDF_Array* pFont = (CPDF_Array*)pObject;
+ m_TextState.GetModify()->m_FontSize = pFont->GetNumber(1);
+ m_TextState.SetFont(pParser->FindFont(pFont->GetString(0)));
+ break;
+ }
+ case FXBSTR_ID('T', 'R', 0, 0):
+ if (pGS->KeyExist(FX_BSTRC("TR2"))) {
+ continue;
+ }
+ case FXBSTR_ID('T', 'R', '2', 0):
+ if (pObject && pObject->GetType() != PDFOBJ_NAME) {
+ pGeneralState->m_pTR = pObject;
+ } else {
+ pGeneralState->m_pTR = NULL;
+ }
+ break;
+ case FXBSTR_ID('B', 'M', 0, 0): {
+ CFX_ByteString mode;
+ if (pObject->GetType() == PDFOBJ_ARRAY) {
+ mode = ((CPDF_Array*)pObject)->GetString(0);
+ } else {
+ mode = pObject->GetString();
+ }
+ pGeneralState->SetBlendMode(mode);
+ if (pGeneralState->m_BlendType > FXDIB_BLEND_MULTIPLY) {
+ pParser->m_pObjectList->m_bBackgroundAlphaNeeded = TRUE;
+ }
+ break;
+ }
+ case FXBSTR_ID('S', 'M', 'a', 's'):
+ if (pObject && pObject->GetType() == PDFOBJ_DICTIONARY) {
+ pGeneralState->m_pSoftMask = pObject;
+ FXSYS_memcpy32(pGeneralState->m_SMaskMatrix, &pParser->m_pCurStates->m_CTM, sizeof(CPDF_Matrix));
+ } else {
+ pGeneralState->m_pSoftMask = NULL;
+ }
+ break;
+ case FXBSTR_ID('C', 'A', 0, 0):
+ pGeneralState->m_StrokeAlpha = PDF_ClipFloat(pObject->GetNumber());
+ break;
+ case FXBSTR_ID('c', 'a', 0, 0):
+ pGeneralState->m_FillAlpha = PDF_ClipFloat(pObject->GetNumber());
+ break;
+ case FXBSTR_ID('O', 'P', 0, 0):
+ pGeneralState->m_StrokeOP = pObject->GetInteger();
+ if (!pGS->KeyExist(FX_BSTRC("op"))) {
+ pGeneralState->m_FillOP = pObject->GetInteger();
+ }
+ break;
+ case FXBSTR_ID('o', 'p', 0, 0):
+ pGeneralState->m_FillOP = pObject->GetInteger();
+ break;
+ case FXBSTR_ID('O', 'P', 'M', 0):
+ pGeneralState->m_OPMode = pObject->GetInteger();
+ break;
+ case FXBSTR_ID('B', 'G', 0, 0):
+ if (pGS->KeyExist(FX_BSTRC("BG2"))) {
+ continue;
+ }
+ case FXBSTR_ID('B', 'G', '2', 0):
+ pGeneralState->m_pBG = pObject;
+ break;
+ case FXBSTR_ID('U', 'C', 'R', 0):
+ if (pGS->KeyExist(FX_BSTRC("UCR2"))) {
+ continue;
+ }
+ case FXBSTR_ID('U', 'C', 'R', '2'):
+ pGeneralState->m_pUCR = pObject;
+ break;
+ case FXBSTR_ID('H', 'T', 0, 0):
+ pGeneralState->m_pHT = pObject;
+ break;
+ case FXBSTR_ID('F', 'L', 0, 0):
+ pGeneralState->m_Flatness = pObject->GetNumber();
+ break;
+ case FXBSTR_ID('S', 'M', 0, 0):
+ pGeneralState->m_Smoothness = pObject->GetNumber();
+ break;
+ case FXBSTR_ID('S', 'A', 0, 0):
+ pGeneralState->m_StrokeAdjust = pObject->GetInteger();
+ break;
+ case FXBSTR_ID('A', 'I', 'S', 0):
+ pGeneralState->m_AlphaSource = pObject->GetInteger();
+ break;
+ case FXBSTR_ID('T', 'K', 0, 0):
+ pGeneralState->m_TextKnockout = pObject->GetInteger();
+ break;
+ }
+ }
+ pGeneralState->m_Matrix = m_CTM;
+}
+CPDF_ContentMarkItem::CPDF_ContentMarkItem()
+{
+ m_ParamType = None;
+}
+CPDF_ContentMarkItem::CPDF_ContentMarkItem(const CPDF_ContentMarkItem& src)
+{
+ m_MarkName = src.m_MarkName;
+ m_ParamType = src.m_ParamType;
+ if (m_ParamType == DirectDict) {
+ m_pParam = ((CPDF_Dictionary*)src.m_pParam)->Clone();
+ } else {
+ m_pParam = src.m_pParam;
+ }
+}
+CPDF_ContentMarkItem::~CPDF_ContentMarkItem()
+{
+ if (m_ParamType == DirectDict) {
+ ((CPDF_Dictionary*)m_pParam)->Release();
+ }
+}
+FX_BOOL CPDF_ContentMarkItem::HasMCID() const
+{
+ if (m_pParam && (m_ParamType == DirectDict || m_ParamType == PropertiesDict)) {
+ return ((CPDF_Dictionary *)m_pParam)->KeyExist(FX_BSTRC("MCID"));
+ }
+ return FALSE;
+}
+CPDF_ContentMarkData::CPDF_ContentMarkData(const CPDF_ContentMarkData& src)
+{
+ for (int i = 0; i < src.m_Marks.GetSize(); i ++) {
+ m_Marks.Add(src.m_Marks[i]);
+ }
+}
+int CPDF_ContentMarkData::GetMCID() const
+{
+ CPDF_ContentMarkItem::ParamType type = CPDF_ContentMarkItem::None;
+ for (int i = 0; i < m_Marks.GetSize(); i ++) {
+ type = m_Marks[i].GetParamType();
+ if (type == CPDF_ContentMarkItem::PropertiesDict || type == CPDF_ContentMarkItem::DirectDict) {
+ CPDF_Dictionary *pDict = (CPDF_Dictionary *)m_Marks[i].GetParam();
+ if (pDict->KeyExist(FX_BSTRC("MCID"))) {
+ return pDict->GetInteger(FX_BSTRC("MCID"));
+ }
+ }
+ }
+ return -1;
+}
+void CPDF_ContentMarkData::AddMark(const CFX_ByteString& name, CPDF_Dictionary* pDict, FX_BOOL bDirect)
+{
+ CPDF_ContentMarkItem& item = m_Marks.Add();
+ item.SetName(name);
+ if (pDict == NULL) {
+ return;
+ }
+ item.SetParam(bDirect ? CPDF_ContentMarkItem::DirectDict : CPDF_ContentMarkItem::PropertiesDict,
+ bDirect ? pDict->Clone() : pDict);
+}
+void CPDF_ContentMarkData::DeleteLastMark()
+{
+ int size = m_Marks.GetSize();
+ if (size == 0) {
+ return;
+ }
+ m_Marks.RemoveAt(size - 1);
+}
+FX_BOOL CPDF_ContentMark::HasMark(FX_BSTR mark) const
+{
+ if (m_pObject == NULL) {
+ return FALSE;
+ }
+ for (int i = 0; i < m_pObject->CountItems(); i ++) {
+ CPDF_ContentMarkItem& item = m_pObject->GetItem(i);
+ if (item.GetName() == mark) {
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+FX_BOOL CPDF_ContentMark::LookupMark(FX_BSTR mark, CPDF_Dictionary*& pDict) const
+{
+ if (m_pObject == NULL) {
+ return FALSE;
+ }
+ for (int i = 0; i < m_pObject->CountItems(); i ++) {
+ CPDF_ContentMarkItem& item = m_pObject->GetItem(i);
+ if (item.GetName() == mark) {
+ pDict = NULL;
+ if (item.GetParamType() == CPDF_ContentMarkItem::PropertiesDict ||
+ item.GetParamType() == CPDF_ContentMarkItem::DirectDict) {
+ pDict = (CPDF_Dictionary*)item.GetParam();
+ }
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_image.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_image.cpp
index ec351058ac..b1fbe01b90 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_image.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_image.cpp
@@ -1,116 +1,116 @@
-// 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
-
-#include "../../../include/fpdfapi/fpdf_page.h"
-#include "../../../include/fpdfapi/fpdf_pageobj.h"
-#include "pageint.h"
-CPDF_ImageObject::CPDF_ImageObject()
-{
- m_pImage = NULL;
- m_Type = PDFPAGE_IMAGE;
-}
-CPDF_ImageObject::~CPDF_ImageObject()
-{
- if (!m_pImage) {
- return;
- }
- if (m_pImage->IsInline() || (m_pImage->GetStream() && m_pImage->GetStream()->GetObjNum() == 0)) {
- delete m_pImage;
- } else {
- m_pImage->GetDocument()->GetPageData()->ReleaseImage(m_pImage->GetStream());
- }
-}
-void CPDF_ImageObject::CopyData(const CPDF_PageObject* pSrc)
-{
- const CPDF_ImageObject* pSrcObj = (const CPDF_ImageObject*)pSrc;
- if (m_pImage) {
- m_pImage->Release();
- }
- m_pImage = pSrcObj->m_pImage->Clone();
- m_Matrix = pSrcObj->m_Matrix;
-}
-void CPDF_ImageObject::Transform(const CFX_AffineMatrix& matrix)
-{
- m_Matrix.Concat(matrix);
- CalcBoundingBox();
-}
-void CPDF_ImageObject::CalcBoundingBox()
-{
- m_Left = m_Bottom = 0;
- m_Right = m_Top = 1.0f;
- m_Matrix.TransformRect(m_Left, m_Right, m_Top, m_Bottom);
-}
-void CPDF_Image::Release()
-{
- if (m_bInline || (m_pStream && m_pStream->GetObjNum() == 0)) {
- delete this;
- }
-}
-CPDF_Image* CPDF_Image::Clone()
-{
- if (m_pStream->GetObjNum()) {
- return m_pDocument->GetPageData()->GetImage(m_pStream);
- }
- CPDF_Image* pImage = FX_NEW CPDF_Image(m_pDocument);
- pImage->LoadImageF((CPDF_Stream*)((CPDF_Object*)m_pStream)->Clone(), m_bInline);
- if (m_bInline) {
- CPDF_Dictionary *pInlineDict = (CPDF_Dictionary*)m_pInlineDict->Clone(TRUE);
- pImage->SetInlineDict(pInlineDict);
- }
- return pImage;
-}
-CPDF_Image::CPDF_Image(CPDF_Document* pDoc)
-{
- m_pDocument = pDoc;
- m_pStream = NULL;
- m_pOC = NULL;
- m_bInline = FALSE;
- m_pInlineDict = NULL;
- m_pDIBSource = NULL;
- m_pMask = NULL;
- m_MatteColor = 0;
-}
-CPDF_Image::~CPDF_Image()
-{
- if (m_bInline) {
- if (m_pStream) {
-#ifndef FOXIT_CHROME_BUILD
- CPDF_Dictionary* pDict = m_pStream->GetDict();
- if (pDict) {
- CPDF_Object* pCSObj = pDict->GetElementValue(FX_BSTRC("ColorSpace"));
- if (pCSObj && m_pDocument) {
- m_pDocument->RemoveColorSpaceFromPageData(pCSObj);
- }
- }
-#endif
- m_pStream->Release();
- }
- if (m_pInlineDict) {
- m_pInlineDict->Release();
- }
- }
-}
-FX_BOOL CPDF_Image::LoadImageF(CPDF_Stream* pStream, FX_BOOL bInline)
-{
- m_pStream = pStream;
- if (m_bInline && m_pInlineDict) {
- m_pInlineDict->Release();
- m_pInlineDict = NULL;
- }
- m_bInline = bInline;
- CPDF_Dictionary* pDict = pStream->GetDict();
- if (m_bInline) {
- m_pInlineDict = (CPDF_Dictionary*)pDict->Clone();
- }
- m_pOC = pDict->GetDict(FX_BSTRC("OC"));
- m_bIsMask = !pDict->KeyExist(FX_BSTRC("ColorSpace")) || pDict->GetInteger(FX_BSTRC("ImageMask"));
-#ifndef _FPDFAPI_MINI_
- m_bInterpolate = pDict->GetInteger(FX_BSTRC("Interpolate"));
-#endif
- m_Height = pDict->GetInteger(FX_BSTRC("Height"));
- m_Width = pDict->GetInteger(FX_BSTRC("Width"));
- return TRUE;
-}
+// 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
+
+#include "../../../include/fpdfapi/fpdf_page.h"
+#include "../../../include/fpdfapi/fpdf_pageobj.h"
+#include "pageint.h"
+CPDF_ImageObject::CPDF_ImageObject()
+{
+ m_pImage = NULL;
+ m_Type = PDFPAGE_IMAGE;
+}
+CPDF_ImageObject::~CPDF_ImageObject()
+{
+ if (!m_pImage) {
+ return;
+ }
+ if (m_pImage->IsInline() || (m_pImage->GetStream() && m_pImage->GetStream()->GetObjNum() == 0)) {
+ delete m_pImage;
+ } else {
+ m_pImage->GetDocument()->GetPageData()->ReleaseImage(m_pImage->GetStream());
+ }
+}
+void CPDF_ImageObject::CopyData(const CPDF_PageObject* pSrc)
+{
+ const CPDF_ImageObject* pSrcObj = (const CPDF_ImageObject*)pSrc;
+ if (m_pImage) {
+ m_pImage->Release();
+ }
+ m_pImage = pSrcObj->m_pImage->Clone();
+ m_Matrix = pSrcObj->m_Matrix;
+}
+void CPDF_ImageObject::Transform(const CFX_AffineMatrix& matrix)
+{
+ m_Matrix.Concat(matrix);
+ CalcBoundingBox();
+}
+void CPDF_ImageObject::CalcBoundingBox()
+{
+ m_Left = m_Bottom = 0;
+ m_Right = m_Top = 1.0f;
+ m_Matrix.TransformRect(m_Left, m_Right, m_Top, m_Bottom);
+}
+void CPDF_Image::Release()
+{
+ if (m_bInline || (m_pStream && m_pStream->GetObjNum() == 0)) {
+ delete this;
+ }
+}
+CPDF_Image* CPDF_Image::Clone()
+{
+ if (m_pStream->GetObjNum()) {
+ return m_pDocument->GetPageData()->GetImage(m_pStream);
+ }
+ CPDF_Image* pImage = FX_NEW CPDF_Image(m_pDocument);
+ pImage->LoadImageF((CPDF_Stream*)((CPDF_Object*)m_pStream)->Clone(), m_bInline);
+ if (m_bInline) {
+ CPDF_Dictionary *pInlineDict = (CPDF_Dictionary*)m_pInlineDict->Clone(TRUE);
+ pImage->SetInlineDict(pInlineDict);
+ }
+ return pImage;
+}
+CPDF_Image::CPDF_Image(CPDF_Document* pDoc)
+{
+ m_pDocument = pDoc;
+ m_pStream = NULL;
+ m_pOC = NULL;
+ m_bInline = FALSE;
+ m_pInlineDict = NULL;
+ m_pDIBSource = NULL;
+ m_pMask = NULL;
+ m_MatteColor = 0;
+}
+CPDF_Image::~CPDF_Image()
+{
+ if (m_bInline) {
+ if (m_pStream) {
+#ifndef FOXIT_CHROME_BUILD
+ CPDF_Dictionary* pDict = m_pStream->GetDict();
+ if (pDict) {
+ CPDF_Object* pCSObj = pDict->GetElementValue(FX_BSTRC("ColorSpace"));
+ if (pCSObj && m_pDocument) {
+ m_pDocument->RemoveColorSpaceFromPageData(pCSObj);
+ }
+ }
+#endif
+ m_pStream->Release();
+ }
+ if (m_pInlineDict) {
+ m_pInlineDict->Release();
+ }
+ }
+}
+FX_BOOL CPDF_Image::LoadImageF(CPDF_Stream* pStream, FX_BOOL bInline)
+{
+ m_pStream = pStream;
+ if (m_bInline && m_pInlineDict) {
+ m_pInlineDict->Release();
+ m_pInlineDict = NULL;
+ }
+ m_bInline = bInline;
+ CPDF_Dictionary* pDict = pStream->GetDict();
+ if (m_bInline) {
+ m_pInlineDict = (CPDF_Dictionary*)pDict->Clone();
+ }
+ m_pOC = pDict->GetDict(FX_BSTRC("OC"));
+ m_bIsMask = !pDict->KeyExist(FX_BSTRC("ColorSpace")) || pDict->GetInteger(FX_BSTRC("ImageMask"));
+#ifndef _FPDFAPI_MINI_
+ m_bInterpolate = pDict->GetInteger(FX_BSTRC("Interpolate"));
+#endif
+ m_Height = pDict->GetInteger(FX_BSTRC("Height"));
+ m_Width = pDict->GetInteger(FX_BSTRC("Width"));
+ return TRUE;
+}
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp
index 40f6d04212..ff670965ec 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp
@@ -1,1681 +1,1681 @@
-// 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
-
-#include "../../../include/fpdfapi/fpdf_page.h"
-#include "../../../include/fpdfapi/fpdf_module.h"
-#include "../../../include/fpdfapi/fpdf_serial.h"
-#include "pageint.h"
-#define REQUIRE_PARAMS(count) if (m_ParamCount != count) { m_bAbort = TRUE; return; }
-CPDF_StreamContentParser::CPDF_StreamContentParser()
-{
- m_DefFontSize = 0;
- m_pCurStates = NULL;
- m_pLastTextObject = NULL;
- m_pPathPoints = NULL;
- m_PathClipType = 0;
- m_PathPointCount = m_PathAllocSize = 0;
- m_PathCurrentX = m_PathCurrentY = 0.0f;
- m_bResourceMissing = FALSE;
- m_bColored = FALSE;
- FXSYS_memset32(m_Type3Data, 0, sizeof(FX_FLOAT) * 6);
- m_ParamCount = 0;
- m_ParamStartPos = 0;
- m_bAbort = FALSE;
- m_pLastImageDict = NULL;
- m_pLastCloneImageDict = NULL;
- m_pLastImage = NULL;
- m_bReleaseLastDict = TRUE;
- m_pParentResources = NULL;
-#ifdef _FPDFAPI_MINI_
- m_pObjectState = NULL;
- m_pObjectStack = NULL;
- m_pWordBuf = NULL;
- m_pDictName = NULL;
- m_pStreamBuf = NULL;
- m_WordState = 0;
- m_ObjectSize = 0;
-#endif
-}
-FX_BOOL CPDF_StreamContentParser::Initialize()
-{
-#ifdef _FPDFAPI_MINI_
- m_pObjectState = FX_Alloc(FX_BOOL, _FPDF_MAX_OBJECT_STACK_SIZE_);
- FXSYS_memset32(m_pObjectState, 0, _FPDF_MAX_OBJECT_STACK_SIZE_ * sizeof(FX_BOOL));
- m_pObjectStack = FX_Alloc(CPDF_Object*, _FPDF_MAX_OBJECT_STACK_SIZE_);
- FXSYS_memset32(m_pObjectStack, 0, _FPDF_MAX_OBJECT_STACK_SIZE_ * sizeof(CPDF_Object*));
- m_pWordBuf = FX_Alloc(FX_BYTE, 256);
- FXSYS_memset32(m_pWordBuf, 0, 256 * sizeof(FX_BYTE));
- m_pDictName = FX_Alloc(FX_BYTE, 256);
- FXSYS_memset32(m_pDictName, 0, 256 * sizeof(FX_BYTE));
- m_pStreamBuf = FX_Alloc(FX_BYTE, STREAM_PARSE_BUFSIZE);
- FXSYS_memset32(m_pStreamBuf, 0, STREAM_PARSE_BUFSIZE * sizeof(FX_BYTE));
- m_StringBuf.EstimateSize(1024);
- m_ObjectSize = 0;
- m_ImageSrcBuf.EstimateSize(STREAM_PARSE_BUFSIZE);
-#endif
- return TRUE;
-}
-CPDF_StreamContentParser::~CPDF_StreamContentParser()
-{
- ClearAllParams();
- int i = 0;
- for (i = 0; i < m_StateStack.GetSize(); i ++) {
- delete (CPDF_AllStates*)m_StateStack[i];
- }
- if (m_pPathPoints) {
- FX_Free(m_pPathPoints);
- }
- if (m_pCurStates) {
- delete m_pCurStates;
- }
- if (m_pLastImageDict) {
- m_pLastImageDict->Release();
- }
- if (m_pLastCloneImageDict) {
- m_pLastCloneImageDict->Release();
- }
-#ifdef _FPDFAPI_MINI_
- for (i = 0; i < (int)m_ObjectSize; ++i) {
- if (!m_pObjectState[i]) {
- m_pObjectStack[i]->Release();
- }
- }
- FX_Free(m_pObjectStack);
- FX_Free(m_pObjectState);
- FX_Free(m_pStreamBuf);
- FX_Free(m_pWordBuf);
- FX_Free(m_pDictName);
-#endif
-}
-void CPDF_StreamContentParser::PrepareParse(CPDF_Document* pDocument,
- CPDF_Dictionary* pPageResources, CPDF_Dictionary* pParentResources, CFX_AffineMatrix* pmtContentToUser, CPDF_PageObjects* pObjList,
- CPDF_Dictionary* pResources, CPDF_Rect* pBBox, CPDF_ParseOptions* pOptions,
- CPDF_AllStates* pStates, int level)
-{
- for (int i = 0; i < 6; i ++) {
- m_Type3Data[i] = 0;
- }
- m_pDocument = pDocument;
- m_pPageResources = pPageResources;
- m_pParentResources = pParentResources;
- if (pmtContentToUser) {
- m_mtContentToUser = *pmtContentToUser;
- }
- if (pOptions) {
- m_Options = *pOptions;
- }
- m_pObjectList = pObjList;
- m_pResources = pResources;
- if (pResources == NULL) {
- m_pResources = m_pParentResources;
- }
- if (m_pResources == NULL) {
- m_pResources = pPageResources;
- }
- if (pBBox) {
- m_BBox = *pBBox;
- }
- m_Level = level;
- m_pCurStates = FX_NEW CPDF_AllStates;
- if (pStates) {
- m_pCurStates->Copy(*pStates);
- } else {
- m_pCurStates->m_GeneralState.New();
- m_pCurStates->m_GraphState.New();
- m_pCurStates->m_TextState.New();
- m_pCurStates->m_ColorState.New();
- }
-#ifdef _FPDFAPI_MINI_
- FXSYS_memset32(m_pObjectState, 0, _FPDF_MAX_OBJECT_STACK_SIZE_ * sizeof(FX_BOOL));
-#endif
-}
-int CPDF_StreamContentParser::GetNextParamPos()
-{
- if (m_ParamCount == PARAM_BUF_SIZE) {
- m_ParamStartPos ++;
- if (m_ParamStartPos == PARAM_BUF_SIZE) {
- m_ParamStartPos = 0;
- }
- if (m_ParamBuf1[m_ParamStartPos].m_Type == 0) {
- m_ParamBuf1[m_ParamStartPos].m_pObject->Release();
- }
- return m_ParamStartPos;
- }
- int index = m_ParamStartPos + m_ParamCount;
- if (index >= PARAM_BUF_SIZE) {
- index -= PARAM_BUF_SIZE;
- }
- m_ParamCount ++;
- return index;
-}
-void CPDF_StreamContentParser::AddNameParam(FX_LPCSTR name, int len)
-{
- int index = GetNextParamPos();
- if (len > 32) {
- m_ParamBuf1[index].m_Type = 0;
- m_ParamBuf1[index].m_pObject = CPDF_Name::Create(PDF_NameDecode(CFX_ByteStringC(name, len)));
- } else {
- m_ParamBuf1[index].m_Type = PDFOBJ_NAME;
- if (FXSYS_memchr(name, '#', len) == NULL) {
- FXSYS_memcpy32(m_ParamBuf1[index].m_Name.m_Buffer, name, len);
- m_ParamBuf1[index].m_Name.m_Len = len;
- } else {
- CFX_ByteString str = PDF_NameDecode(CFX_ByteStringC(name, len));
- FXSYS_memcpy32(m_ParamBuf1[index].m_Name.m_Buffer, (FX_LPCSTR)str, str.GetLength());
- m_ParamBuf1[index].m_Name.m_Len = str.GetLength();
- }
- }
-}
-void CPDF_StreamContentParser::AddNumberParam(FX_LPCSTR str, int len)
-{
- int index = GetNextParamPos();
- m_ParamBuf1[index].m_Type = PDFOBJ_NUMBER;
- FX_atonum(CFX_ByteStringC(str, len), m_ParamBuf1[index].m_Number.m_bInteger,
- &m_ParamBuf1[index].m_Number.m_Integer);
-}
-void CPDF_StreamContentParser::AddObjectParam(CPDF_Object* pObj)
-{
- int index = GetNextParamPos();
- m_ParamBuf1[index].m_Type = 0;
- m_ParamBuf1[index].m_pObject = pObj;
-}
-void CPDF_StreamContentParser::ClearAllParams()
-{
- FX_DWORD index = m_ParamStartPos;
- for (FX_DWORD i = 0; i < m_ParamCount; i ++) {
- if (m_ParamBuf1[index].m_Type == 0) {
- m_ParamBuf1[index].m_pObject->Release();
- }
- index ++;
- if (index == PARAM_BUF_SIZE) {
- index = 0;
- }
- }
- m_ParamStartPos = 0;
- m_ParamCount = 0;
-}
-CPDF_Object* CPDF_StreamContentParser::GetObject(FX_DWORD index)
-{
- if (index >= m_ParamCount) {
- return NULL;
- }
- int real_index = m_ParamStartPos + m_ParamCount - index - 1;
- if (real_index >= PARAM_BUF_SIZE) {
- real_index -= PARAM_BUF_SIZE;
- }
- _ContentParam& param = m_ParamBuf1[real_index];
- if (param.m_Type == PDFOBJ_NUMBER) {
- CPDF_Number* pNumber = CPDF_Number::Create(param.m_Number.m_bInteger, &param.m_Number.m_Integer);
- param.m_Type = 0;
- param.m_pObject = pNumber;
- return pNumber;
- }
- if (param.m_Type == PDFOBJ_NAME) {
- CPDF_Name* pName = CPDF_Name::Create(CFX_ByteString(param.m_Name.m_Buffer, param.m_Name.m_Len));
- param.m_Type = 0;
- param.m_pObject = pName;
- return pName;
- }
- if (param.m_Type == 0) {
- return param.m_pObject;
- }
- ASSERT(FALSE);
- return NULL;
-}
-CFX_ByteString CPDF_StreamContentParser::GetString(FX_DWORD index)
-{
- if (index >= m_ParamCount) {
- return CFX_ByteString();
- }
- int real_index = m_ParamStartPos + m_ParamCount - index - 1;
- if (real_index >= PARAM_BUF_SIZE) {
- real_index -= PARAM_BUF_SIZE;
- }
- _ContentParam& param = m_ParamBuf1[real_index];
- if (param.m_Type == PDFOBJ_NAME) {
- return CFX_ByteString(param.m_Name.m_Buffer, param.m_Name.m_Len);
- }
- if (param.m_Type == 0) {
- return param.m_pObject->GetString();
- }
- return CFX_ByteString();
-}
-FX_FLOAT CPDF_StreamContentParser::GetNumber(FX_DWORD index)
-{
- if (index >= m_ParamCount) {
- return 0;
- }
- int real_index = m_ParamStartPos + m_ParamCount - index - 1;
- if (real_index >= PARAM_BUF_SIZE) {
- real_index -= PARAM_BUF_SIZE;
- }
- _ContentParam& param = m_ParamBuf1[real_index];
- if (param.m_Type == PDFOBJ_NUMBER) {
- return param.m_Number.m_bInteger ? (FX_FLOAT)param.m_Number.m_Integer : param.m_Number.m_Float;
- }
- if (param.m_Type == 0) {
- return param.m_pObject->GetNumber();
- }
- return 0;
-}
-FX_FLOAT CPDF_StreamContentParser::GetNumber16(FX_DWORD index)
-{
- return GetNumber(index);
-}
-void CPDF_StreamContentParser::SetGraphicStates(CPDF_PageObject* pObj, FX_BOOL bColor, FX_BOOL bText, FX_BOOL bGraph)
-{
- pObj->m_GeneralState = m_pCurStates->m_GeneralState;
- pObj->m_ClipPath = m_pCurStates->m_ClipPath;
- pObj->m_ContentMark = m_CurContentMark;
- if (bColor) {
- pObj->m_ColorState = m_pCurStates->m_ColorState;
- }
- if (bGraph) {
- pObj->m_GraphState = m_pCurStates->m_GraphState;
- }
- if (bText) {
- pObj->m_TextState = m_pCurStates->m_TextState;
- }
-}
-const struct _OpCode {
- FX_DWORD m_OpId;
- void (CPDF_StreamContentParser::*m_OpHandler)();
-} g_OpCodes[] = {
- {FXBSTR_ID('"', 0, 0, 0), &CPDF_StreamContentParser::Handle_NextLineShowText_Space},
- {FXBSTR_ID('\'', 0, 0, 0), &CPDF_StreamContentParser::Handle_NextLineShowText},
- {FXBSTR_ID('B', 0, 0, 0), &CPDF_StreamContentParser::Handle_FillStrokePath},
- {FXBSTR_ID('B', '*', 0, 0), &CPDF_StreamContentParser::Handle_EOFillStrokePath},
- {FXBSTR_ID('B', 'D', 'C', 0), &CPDF_StreamContentParser::Handle_BeginMarkedContent_Dictionary},
- {FXBSTR_ID('B', 'I', 0, 0), &CPDF_StreamContentParser::Handle_BeginImage},
- {FXBSTR_ID('B', 'M', 'C', 0), &CPDF_StreamContentParser::Handle_BeginMarkedContent},
- {FXBSTR_ID('B', 'T', 0, 0), &CPDF_StreamContentParser::Handle_BeginText},
- {FXBSTR_ID('B', 'X', 0, 0), &CPDF_StreamContentParser::Handle_BeginSectionUndefined},
- {FXBSTR_ID('C', 'S', 0, 0), &CPDF_StreamContentParser::Handle_SetColorSpace_Stroke},
- {FXBSTR_ID('D', 'P', 0, 0), &CPDF_StreamContentParser::Handle_MarkPlace_Dictionary},
- {FXBSTR_ID('D', 'o', 0, 0), &CPDF_StreamContentParser::Handle_ExecuteXObject},
- {FXBSTR_ID('E', 'I', 0, 0), &CPDF_StreamContentParser::Handle_EndImage},
- {FXBSTR_ID('E', 'M', 'C', 0), &CPDF_StreamContentParser::Handle_EndMarkedContent},
- {FXBSTR_ID('E', 'T', 0, 0), &CPDF_StreamContentParser::Handle_EndText},
- {FXBSTR_ID('E', 'X', 0, 0), &CPDF_StreamContentParser::Handle_EndSectionUndefined},
- {FXBSTR_ID('F', 0, 0, 0), &CPDF_StreamContentParser::Handle_FillPathOld},
- {FXBSTR_ID('G', 0, 0, 0), &CPDF_StreamContentParser::Handle_SetGray_Stroke},
- {FXBSTR_ID('I', 'D', 0, 0), &CPDF_StreamContentParser::Handle_BeginImageData},
- {FXBSTR_ID('J', 0, 0, 0), &CPDF_StreamContentParser::Handle_SetLineCap},
- {FXBSTR_ID('K', 0, 0, 0), &CPDF_StreamContentParser::Handle_SetCMYKColor_Stroke},
- {FXBSTR_ID('M', 0, 0, 0), &CPDF_StreamContentParser::Handle_SetMiterLimit},
- {FXBSTR_ID('M', 'P', 0, 0), &CPDF_StreamContentParser::Handle_MarkPlace},
- {FXBSTR_ID('Q', 0, 0, 0), &CPDF_StreamContentParser::Handle_RestoreGraphState},
- {FXBSTR_ID('R', 'G', 0, 0), &CPDF_StreamContentParser::Handle_SetRGBColor_Stroke},
- {FXBSTR_ID('S', 0, 0, 0), &CPDF_StreamContentParser::Handle_StrokePath},
- {FXBSTR_ID('S', 'C', 0, 0), &CPDF_StreamContentParser::Handle_SetColor_Stroke},
- {FXBSTR_ID('S', 'C', 'N', 0), &CPDF_StreamContentParser::Handle_SetColorPS_Stroke},
- {FXBSTR_ID('T', '*', 0, 0), &CPDF_StreamContentParser::Handle_MoveToNextLine},
- {FXBSTR_ID('T', 'D', 0, 0), &CPDF_StreamContentParser::Handle_MoveTextPoint_SetLeading},
- {FXBSTR_ID('T', 'J', 0, 0), &CPDF_StreamContentParser::Handle_ShowText_Positioning},
- {FXBSTR_ID('T', 'L', 0, 0), &CPDF_StreamContentParser::Handle_SetTextLeading},
- {FXBSTR_ID('T', 'c', 0, 0), &CPDF_StreamContentParser::Handle_SetCharSpace},
- {FXBSTR_ID('T', 'd', 0, 0), &CPDF_StreamContentParser::Handle_MoveTextPoint},
- {FXBSTR_ID('T', 'f', 0, 0), &CPDF_StreamContentParser::Handle_SetFont},
- {FXBSTR_ID('T', 'j', 0, 0), &CPDF_StreamContentParser::Handle_ShowText},
- {FXBSTR_ID('T', 'm', 0, 0), &CPDF_StreamContentParser::Handle_SetTextMatrix},
- {FXBSTR_ID('T', 'r', 0, 0), &CPDF_StreamContentParser::Handle_SetTextRenderMode},
- {FXBSTR_ID('T', 's', 0, 0), &CPDF_StreamContentParser::Handle_SetTextRise},
- {FXBSTR_ID('T', 'w', 0, 0), &CPDF_StreamContentParser::Handle_SetWordSpace},
- {FXBSTR_ID('T', 'z', 0, 0), &CPDF_StreamContentParser::Handle_SetHorzScale},
- {FXBSTR_ID('W', 0, 0, 0), &CPDF_StreamContentParser::Handle_Clip},
- {FXBSTR_ID('W', '*', 0, 0), &CPDF_StreamContentParser::Handle_EOClip},
- {FXBSTR_ID('b', 0, 0, 0), &CPDF_StreamContentParser::Handle_CloseFillStrokePath},
- {FXBSTR_ID('b', '*', 0, 0), &CPDF_StreamContentParser::Handle_CloseEOFillStrokePath},
- {FXBSTR_ID('c', 0, 0, 0), &CPDF_StreamContentParser::Handle_CurveTo_123},
- {FXBSTR_ID('c', 'm', 0, 0), &CPDF_StreamContentParser::Handle_ConcatMatrix},
- {FXBSTR_ID('c', 's', 0, 0), &CPDF_StreamContentParser::Handle_SetColorSpace_Fill},
- {FXBSTR_ID('d', 0, 0, 0), &CPDF_StreamContentParser::Handle_SetDash},
- {FXBSTR_ID('d', '0', 0, 0), &CPDF_StreamContentParser::Handle_SetCharWidth},
- {FXBSTR_ID('d', '1', 0, 0), &CPDF_StreamContentParser::Handle_SetCachedDevice},
- {FXBSTR_ID('f', 0, 0, 0), &CPDF_StreamContentParser::Handle_FillPath},
- {FXBSTR_ID('f', '*', 0, 0), &CPDF_StreamContentParser::Handle_EOFillPath},
- {FXBSTR_ID('g', 0, 0, 0), &CPDF_StreamContentParser::Handle_SetGray_Fill},
- {FXBSTR_ID('g', 's', 0, 0), &CPDF_StreamContentParser::Handle_SetExtendGraphState},
- {FXBSTR_ID('h', 0, 0, 0), &CPDF_StreamContentParser::Handle_ClosePath},
- {FXBSTR_ID('i', 0, 0, 0), &CPDF_StreamContentParser::Handle_SetFlat},
- {FXBSTR_ID('j', 0, 0, 0), &CPDF_StreamContentParser::Handle_SetLineJoin},
- {FXBSTR_ID('k', 0, 0, 0), &CPDF_StreamContentParser::Handle_SetCMYKColor_Fill},
- {FXBSTR_ID('l', 0, 0, 0), &CPDF_StreamContentParser::Handle_LineTo},
- {FXBSTR_ID('m', 0, 0, 0), &CPDF_StreamContentParser::Handle_MoveTo},
- {FXBSTR_ID('n', 0, 0, 0), &CPDF_StreamContentParser::Handle_EndPath},
- {FXBSTR_ID('q', 0, 0, 0), &CPDF_StreamContentParser::Handle_SaveGraphState},
- {FXBSTR_ID('r', 'e', 0, 0), &CPDF_StreamContentParser::Handle_Rectangle},
- {FXBSTR_ID('r', 'g', 0, 0), &CPDF_StreamContentParser::Handle_SetRGBColor_Fill},
- {FXBSTR_ID('r', 'i', 0, 0), &CPDF_StreamContentParser::Handle_SetRenderIntent},
- {FXBSTR_ID('s', 0, 0, 0), &CPDF_StreamContentParser::Handle_CloseStrokePath},
- {FXBSTR_ID('s', 'c', 0, 0), &CPDF_StreamContentParser::Handle_SetColor_Fill},
- {FXBSTR_ID('s', 'c', 'n', 0), &CPDF_StreamContentParser::Handle_SetColorPS_Fill},
- {FXBSTR_ID('s', 'h', 0, 0), &CPDF_StreamContentParser::Handle_ShadeFill},
- {FXBSTR_ID('v', 0, 0, 0), &CPDF_StreamContentParser::Handle_CurveTo_23},
- {FXBSTR_ID('w', 0, 0, 0), &CPDF_StreamContentParser::Handle_SetLineWidth},
- {FXBSTR_ID('y', 0, 0, 0), &CPDF_StreamContentParser::Handle_CurveTo_13},
-};
-FX_BOOL CPDF_StreamContentParser::OnOperator(FX_LPCSTR op)
-{
- int i = 0;
- FX_DWORD opid = 0;
- while (i < 4 && op[i]) {
- opid = (opid << 8) + op[i];
- i ++;
- }
- while (i < 4) {
- opid <<= 8;
- i ++;
- };
- int low = 0, high = sizeof g_OpCodes / sizeof(struct _OpCode) - 1;
- while (low <= high) {
- int middle = (low + high) / 2;
- int compare = opid - g_OpCodes[middle].m_OpId;
- if (compare == 0) {
- (this->*g_OpCodes[middle].m_OpHandler)();
- return TRUE;
- } else if (compare < 0) {
- high = middle - 1;
- } else {
- low = middle + 1;
- }
- }
- return m_CompatCount != 0;
-}
-void CPDF_StreamContentParser::Handle_CloseFillStrokePath()
-{
- if (m_Options.m_bTextOnly) {
- return;
- }
- Handle_ClosePath();
- AddPathObject(FXFILL_WINDING, TRUE);
-}
-void CPDF_StreamContentParser::Handle_FillStrokePath()
-{
- if (m_Options.m_bTextOnly) {
- return;
- }
- AddPathObject(FXFILL_WINDING, TRUE);
-}
-void CPDF_StreamContentParser::Handle_CloseEOFillStrokePath()
-{
- if (m_Options.m_bTextOnly) {
- return;
- }
- AddPathPoint(m_PathStartX, m_PathStartY, FXPT_LINETO | FXPT_CLOSEFIGURE);
- AddPathObject(FXFILL_ALTERNATE, TRUE);
-}
-void CPDF_StreamContentParser::Handle_EOFillStrokePath()
-{
- if (m_Options.m_bTextOnly) {
- return;
- }
- AddPathObject(FXFILL_ALTERNATE, TRUE);
-}
-void CPDF_StreamContentParser::Handle_BeginMarkedContent_Dictionary()
-{
- if (!m_Options.m_bMarkedContent) {
- return;
- }
- CFX_ByteString tag = GetString(1);
- CPDF_Object* pProperty = GetObject(0);
- if (pProperty == NULL) {
- return;
- }
- FX_BOOL bDirect = TRUE;
- if (pProperty->GetType() == PDFOBJ_NAME) {
- pProperty = FindResourceObj(FX_BSTRC("Properties"), pProperty->GetString());
- if (pProperty == NULL) {
- return;
- }
- bDirect = FALSE;
- }
- if (pProperty->GetType() != PDFOBJ_DICTIONARY) {
- return;
- }
- m_CurContentMark.GetModify()->AddMark(tag, (CPDF_Dictionary*)pProperty, bDirect);
-}
-void CPDF_StreamContentParser::Handle_BeginMarkedContent()
-{
- if (!m_Options.m_bMarkedContent) {
- return;
- }
- CFX_ByteString tag = GetString(0);
- m_CurContentMark.GetModify()->AddMark(tag, NULL, FALSE);
-}
-struct _FX_BSTR {
- FX_LPCSTR m_Ptr;
- int m_Size;
-};
-#define _FX_BSTRC(str) {str, sizeof(str)-1}
-const _FX_BSTR _PDF_InlineKeyAbbr[] = {
- _FX_BSTRC("BitsPerComponent"), _FX_BSTRC("BPC"),
- _FX_BSTRC("ColorSpace"), _FX_BSTRC("CS"),
- _FX_BSTRC("Decode"), _FX_BSTRC("D"),
- _FX_BSTRC("DecodeParms"), _FX_BSTRC("DP"),
- _FX_BSTRC("Filter"), _FX_BSTRC("F"),
- _FX_BSTRC("Height"), _FX_BSTRC("H"),
- _FX_BSTRC("ImageMask"), _FX_BSTRC("IM"),
- _FX_BSTRC("Interpolate"), _FX_BSTRC("I"),
- _FX_BSTRC("Width"), _FX_BSTRC("W"),
-};
-const _FX_BSTR _PDF_InlineValueAbbr[] = {
- _FX_BSTRC("DeviceGray"), _FX_BSTRC("G"),
- _FX_BSTRC("DeviceRGB"), _FX_BSTRC("RGB"),
- _FX_BSTRC("DeviceCMYK"), _FX_BSTRC("CMYK"),
- _FX_BSTRC("Indexed"), _FX_BSTRC("I"),
- _FX_BSTRC("ASCIIHexDecode"), _FX_BSTRC("AHx"),
- _FX_BSTRC("ASCII85Decode"), _FX_BSTRC("A85"),
- _FX_BSTRC("LZWDecode"), _FX_BSTRC("LZW"),
- _FX_BSTRC("FlateDecode"), _FX_BSTRC("Fl"),
- _FX_BSTRC("RunLengthDecode"), _FX_BSTRC("RL"),
- _FX_BSTRC("CCITTFaxDecode"), _FX_BSTRC("CCF"),
- _FX_BSTRC("DCTDecode"), _FX_BSTRC("DCT"),
-};
-static CFX_ByteStringC _PDF_FindFullName(const _FX_BSTR* table, int count, FX_BSTR abbr)
-{
- int i = 0;
- while (i < count) {
- if (abbr.GetLength() == table[i + 1].m_Size && FXSYS_memcmp32(abbr.GetPtr(), table[i + 1].m_Ptr, abbr.GetLength()) == 0) {
- return CFX_ByteStringC(table[i].m_Ptr, table[i].m_Size);
- }
- i += 2;
- }
- return CFX_ByteStringC();
-}
-void _PDF_ReplaceAbbr(CPDF_Object* pObj)
-{
- switch (pObj->GetType()) {
- case PDFOBJ_DICTIONARY: {
- CPDF_Dictionary* pDict = (CPDF_Dictionary*)pObj;
- FX_POSITION pos = pDict->GetStartPos();
- while (pos) {
- CFX_ByteString key;
- CPDF_Object* value = pDict->GetNextElement(pos, key);
- CFX_ByteStringC fullname = _PDF_FindFullName(_PDF_InlineKeyAbbr,
- sizeof _PDF_InlineKeyAbbr / sizeof(_FX_BSTR), key);
- if (!fullname.IsEmpty()) {
- pDict->ReplaceKey(key, fullname);
- key = fullname;
- }
- if (value->GetType() == PDFOBJ_NAME) {
- CFX_ByteString name = value->GetString();
- fullname = _PDF_FindFullName(_PDF_InlineValueAbbr,
- sizeof _PDF_InlineValueAbbr / sizeof(_FX_BSTR), name);
- if (!fullname.IsEmpty()) {
- pDict->SetAtName(key, fullname);
- }
- } else {
- _PDF_ReplaceAbbr(value);
- }
- }
- break;
- }
- case PDFOBJ_ARRAY: {
- CPDF_Array* pArray = (CPDF_Array*)pObj;
- for (FX_DWORD i = 0; i < pArray->GetCount(); i ++) {
- CPDF_Object* pElement = pArray->GetElement(i);
- if (pElement->GetType() == PDFOBJ_NAME) {
- CFX_ByteString name = pElement->GetString();
- CFX_ByteStringC fullname = _PDF_FindFullName(_PDF_InlineValueAbbr,
- sizeof _PDF_InlineValueAbbr / sizeof(_FX_BSTR), name);
- if (!fullname.IsEmpty()) {
- pArray->SetAt(i, CPDF_Name::Create(fullname));
- }
- } else {
- _PDF_ReplaceAbbr(pElement);
- }
- }
- break;
- }
- }
-}
-static CFX_ByteStringC _PDF_FindAbbrName(const _FX_BSTR* table, int count, FX_BSTR fullName)
-{
- int i = 0;
- while (i < count) {
- if (fullName.GetLength() == table[i].m_Size && FXSYS_memcmp32(fullName.GetPtr(), table[i].m_Ptr, fullName.GetLength()) == 0) {
- return CFX_ByteStringC(table[i + 1].m_Ptr, table[i + 1].m_Size);
- }
- i += 2;
- }
- return CFX_ByteStringC();
-}
-void _PDF_ReplaceFull(CPDF_Object* pObj)
-{
- switch (pObj->GetType()) {
- case PDFOBJ_DICTIONARY: {
- CPDF_Dictionary* pDict = (CPDF_Dictionary*)pObj;
- FX_POSITION pos = pDict->GetStartPos();
- while (pos) {
- CFX_ByteString key;
- CPDF_Object* value = pDict->GetNextElement(pos, key);
- CFX_ByteStringC abbrName = _PDF_FindAbbrName(_PDF_InlineKeyAbbr,
- sizeof(_PDF_InlineKeyAbbr) / sizeof(_FX_BSTR), key);
- if (!abbrName.IsEmpty()) {
- pDict->ReplaceKey(key, abbrName);
- key = abbrName;
- }
- if (value->GetType() == PDFOBJ_NAME) {
- CFX_ByteString name = value->GetString();
- abbrName = _PDF_FindAbbrName(_PDF_InlineValueAbbr,
- sizeof(_PDF_InlineValueAbbr) / sizeof(_FX_BSTR), name);
- if (!abbrName.IsEmpty()) {
- pDict->SetAtName(key, abbrName);
- }
- } else {
- _PDF_ReplaceFull(value);
- }
- }
- break;
- }
- case PDFOBJ_ARRAY: {
- CPDF_Array* pArray = (CPDF_Array*)pObj;
- for (FX_DWORD i = 0; i < pArray->GetCount(); i ++) {
- CPDF_Object* pElement = pArray->GetElement(i);
- if (pElement->GetType() == PDFOBJ_NAME) {
- CFX_ByteString name = pElement->GetString();
- CFX_ByteStringC abbrName = _PDF_FindAbbrName(_PDF_InlineValueAbbr,
- sizeof _PDF_InlineValueAbbr / sizeof(_FX_BSTR), name);
- if (!abbrName.IsEmpty()) {
- pArray->SetAt(i, CPDF_Name::Create(abbrName));
- }
- } else {
- _PDF_ReplaceFull(pElement);
- }
- }
- break;
- }
- }
-}
-void CPDF_StreamContentParser::Handle_BeginText()
-{
- m_pCurStates->m_TextMatrix.Set(1.0f, 0, 0, 1.0f, 0, 0);
- OnChangeTextMatrix();
- m_pCurStates->m_TextX = 0;
- m_pCurStates->m_TextY = 0;
- m_pCurStates->m_TextLineX = 0;
- m_pCurStates->m_TextLineY = 0;
-}
-void CPDF_StreamContentParser::Handle_BeginSectionUndefined()
-{
- m_CompatCount ++;
-}
-void CPDF_StreamContentParser::Handle_CurveTo_123()
-{
- if (m_Options.m_bTextOnly) {
- return;
- }
- AddPathPoint(GetNumber(5), GetNumber(4), FXPT_BEZIERTO);
- AddPathPoint(GetNumber(3), GetNumber(2), FXPT_BEZIERTO);
- AddPathPoint(GetNumber(1), GetNumber(0), FXPT_BEZIERTO);
-}
-void CPDF_StreamContentParser::Handle_ConcatMatrix()
-{
- FX_FLOAT a2 = GetNumber16(5), b2 = GetNumber16(4), c2 = GetNumber16(3), d2 = GetNumber16(2);
- FX_FLOAT e2 = GetNumber(1), f2 = GetNumber(0);
- FX_FLOAT old_width_scale = m_pCurStates->m_CTM.GetXUnit();
- CFX_AffineMatrix new_matrix(a2, b2, c2, d2, e2, f2);
- new_matrix.Concat(m_pCurStates->m_CTM);
- m_pCurStates->m_CTM = new_matrix;
- FX_FLOAT new_width_scale = m_pCurStates->m_CTM.GetXUnit();
- OnChangeTextMatrix();
-}
-void CPDF_StreamContentParser::Handle_SetColorSpace_Fill()
-{
- if (m_Options.m_bTextOnly) {
- return;
- }
- CFX_ByteString csname = GetString(0);
- CPDF_ColorSpace* pCS = FindColorSpace(csname);
- if (pCS == NULL) {
- return;
- }
- m_pCurStates->m_ColorState.GetModify()->m_FillColor.SetColorSpace(pCS);
-}
-void CPDF_StreamContentParser::Handle_SetColorSpace_Stroke()
-{
- if (m_Options.m_bTextOnly) {
- return;
- }
- CFX_ByteString csname = GetString(0);
- CPDF_ColorSpace* pCS = FindColorSpace(csname);
- if (pCS == NULL) {
- return;
- }
- m_pCurStates->m_ColorState.GetModify()->m_StrokeColor.SetColorSpace(pCS);
-}
-void CPDF_StreamContentParser::Handle_SetDash()
-{
- if (m_Options.m_bTextOnly) {
- return;
- }
- CPDF_Array* pArray = GetObject(1)->GetArray();
- if (pArray == NULL) {
- return;
- }
- m_pCurStates->SetLineDash(pArray, GetNumber(0), 1.0f);
-}
-void CPDF_StreamContentParser::Handle_SetCharWidth()
-{
- m_Type3Data[0] = GetNumber(1);
- m_Type3Data[1] = GetNumber(0);
- m_bColored = TRUE;
-}
-void CPDF_StreamContentParser::Handle_SetCachedDevice()
-{
- for (int i = 0; i < 6; i ++) {
- m_Type3Data[i] = GetNumber(5 - i);
- }
- m_bColored = FALSE;
-}
-void CPDF_StreamContentParser::Handle_ExecuteXObject()
-{
- CFX_ByteString name = GetString(0);
- if (name == m_LastImageName && m_pLastImage && m_pLastImage->GetStream() && m_pLastImage->GetStream()->GetObjNum()) {
-#if defined(_FPDFAPI_MINI_) && !defined(_FXCORE_FEATURE_ALL_)
- AddDuplicateImage();
-#else
- AddImage(NULL, m_pLastImage, FALSE);
-#endif
- return;
- }
- if (m_Options.m_bTextOnly) {
- CPDF_Object* pRes = NULL;
- if (m_pResources == NULL) {
- return;
- }
- if (m_pResources == m_pPageResources) {
- CPDF_Dictionary* pList = m_pResources->GetDict(FX_BSTRC("XObject"));
- if (pList == NULL) {
- return;
- }
- pRes = pList->GetElement(name);
- if (pRes == NULL || pRes->GetType() != PDFOBJ_REFERENCE) {
- return;
- }
- } else {
- CPDF_Dictionary* pList = m_pResources->GetDict(FX_BSTRC("XObject"));
- if (pList == NULL) {
- if (m_pPageResources == NULL) {
- return;
- }
- CPDF_Dictionary* pList = m_pPageResources->GetDict(FX_BSTRC("XObject"));
- if (pList == NULL) {
- return;
- }
- pRes = pList->GetElement(name);
- if (pRes == NULL || pRes->GetType() != PDFOBJ_REFERENCE) {
- return;
- }
- } else {
- pRes = pList->GetElement(name);
- if (pRes == NULL || pRes->GetType() != PDFOBJ_REFERENCE) {
- return;
- }
- }
- }
- FX_BOOL bForm;
- if (m_pDocument->IsFormStream(((CPDF_Reference*)pRes)->GetRefObjNum(), bForm) && !bForm) {
- return;
- }
- }
- CPDF_Stream* pXObject = (CPDF_Stream*)FindResourceObj(FX_BSTRC("XObject"), name);
- if (pXObject == NULL || pXObject->GetType() != PDFOBJ_STREAM) {
- m_bResourceMissing = TRUE;
- return;
- }
- CFX_ByteStringC type = pXObject->GetDict()->GetConstString(FX_BSTRC("Subtype"));
- if (type == FX_BSTRC("Image")) {
- if (m_Options.m_bTextOnly) {
- return;
- }
- CPDF_ImageObject* pObj = AddImage(pXObject, NULL, FALSE);
- m_LastImageName = name;
- m_pLastImage = pObj->m_pImage;
- } else if (type == FX_BSTRC("Form")) {
- AddForm(pXObject);
- } else {
- return;
- }
-}
-void CPDF_StreamContentParser::AddForm(CPDF_Stream* pStream)
-{
-#if !defined(_FPDFAPI_MINI_) || defined(_FXCORE_FEATURE_ALL_)
- if (!m_Options.m_bSeparateForm) {
- CPDF_Dictionary* pResources = pStream->GetDict()->GetDict(FX_BSTRC("Resources"));
- CFX_AffineMatrix form_matrix = pStream->GetDict()->GetMatrix(FX_BSTRC("Matrix"));
- form_matrix.Concat(m_pCurStates->m_CTM);
- CPDF_Array* pBBox = pStream->GetDict()->GetArray(FX_BSTRC("BBox"));
- CFX_FloatRect form_bbox;
- CPDF_Path ClipPath;
- if (pBBox) {
- form_bbox = pStream->GetDict()->GetRect(FX_BSTRC("BBox"));
- ClipPath.New();
- ClipPath.AppendRect(form_bbox.left, form_bbox.bottom, form_bbox.right, form_bbox.top);
- ClipPath.Transform(&form_matrix);
- form_bbox.Transform(&form_matrix);
- }
- CPDF_StreamContentParser parser;
- parser.Initialize();
- parser.PrepareParse(m_pDocument, m_pPageResources, m_pResources, &m_mtContentToUser,
- m_pObjectList, pResources, &form_bbox, &m_Options, m_pCurStates, m_Level + 1);
- parser.m_pCurStates->m_CTM = form_matrix;
- if (ClipPath.NotNull()) {
- parser.m_pCurStates->m_ClipPath.AppendPath(ClipPath, FXFILL_WINDING, TRUE);
- }
- CPDF_StreamAcc stream;
- stream.LoadAllData(pStream, FALSE);
- if (stream.GetSize() == 0) {
- return;
- }
-#ifdef _FPDFAPI_MINI_
- parser.InputData(stream.GetData(), stream.GetSize());
- parser.Finish();
-#else
- parser.Parse(stream.GetData(), stream.GetSize(), 0);
-#endif
- return;
- }
-#endif
- CPDF_FormObject* pFormObj = FX_NEW CPDF_FormObject;
- pFormObj->m_pForm = FX_NEW CPDF_Form(m_pDocument, m_pPageResources, pStream, m_pResources);
- pFormObj->m_FormMatrix = m_pCurStates->m_CTM;
- pFormObj->m_FormMatrix.Concat(m_mtContentToUser);
- CPDF_AllStates status;
- status.m_GeneralState = m_pCurStates->m_GeneralState;
- status.m_GraphState = m_pCurStates->m_GraphState;
- status.m_ColorState = m_pCurStates->m_ColorState;
- status.m_TextState = m_pCurStates->m_TextState;
- pFormObj->m_pForm->ParseContent(&status, NULL, NULL, &m_Options, m_Level + 1);
- if (!m_pObjectList->m_bBackgroundAlphaNeeded && pFormObj->m_pForm->m_bBackgroundAlphaNeeded) {
- m_pObjectList->m_bBackgroundAlphaNeeded = TRUE;
- }
- pFormObj->CalcBoundingBox();
- SetGraphicStates(pFormObj, TRUE, TRUE, TRUE);
- m_pObjectList->m_ObjectList.AddTail(pFormObj);
-}
-#if defined(_FPDFAPI_MINI_) && !defined(_FXCORE_FEATURE_ALL_)
-void CPDF_StreamContentParser::AddDuplicateImage()
-{
- FX_POSITION tailpos = m_pObjectList->m_ObjectList.GetTailPosition();
- CPDF_PageObject* pLastObj = (CPDF_PageObject*)m_pObjectList->m_ObjectList.GetAt(tailpos);
- if (pLastObj == NULL || (pLastObj->m_Type != PDFPAGE_INLINES && pLastObj->m_Type != PDFPAGE_IMAGE)) {
- AddImage(NULL, m_pLastImage, FALSE);
- return;
- }
- if (pLastObj->m_GeneralState != m_pCurStates->m_GeneralState ||
- pLastObj->m_ClipPath != m_pCurStates->m_ClipPath ||
- pLastObj->m_ColorState != m_pCurStates->m_ColorState) {
- AddImage(NULL, m_pLastImage, FALSE);
- return;
- }
- CFX_AffineMatrix ImageMatrix;
- ImageMatrix.Copy(m_pCurStates->m_CTM);
- ImageMatrix.Concat(m_mtContentToUser);
- if (pLastObj->m_Type == PDFPAGE_INLINES) {
- CPDF_InlineImages* pInlines = (CPDF_InlineImages*)pLastObj;
- if (pInlines->m_pStream != m_pLastImage->GetStream()) {
- AddImage(NULL, m_pLastImage, FALSE);
- return;
- }
- pInlines->AddMatrix(ImageMatrix);
- } else {
- CPDF_ImageObject* pImageObj = (CPDF_ImageObject*)pLastObj;
- CPDF_InlineImages* pInlines = FX_NEW CPDF_InlineImages;
- pInlines->m_pStream = m_pLastImage->GetStream();
- SetGraphicStates(pInlines, !pInlines->m_pStream->GetDict()->KeyExist(FX_BSTRC("ColorSpace")), FALSE, FALSE);
- pInlines->AddMatrix(pImageObj->m_Matrix);
- pInlines->AddMatrix(ImageMatrix);
- m_pObjectList->m_ObjectList.RemoveAt(tailpos);
- m_pObjectList->m_ObjectList.AddTail(pInlines);
- pLastObj->Release();
- }
-}
-#endif
-CPDF_ImageObject* CPDF_StreamContentParser::AddImage(CPDF_Stream* pStream, CPDF_Image* pImage, FX_BOOL bInline)
-{
- if (pStream == NULL && pImage == NULL) {
- return NULL;
- }
- CFX_AffineMatrix ImageMatrix;
- ImageMatrix.Copy(m_pCurStates->m_CTM);
- ImageMatrix.Concat(m_mtContentToUser);
- CPDF_ImageObject* pImageObj = FX_NEW CPDF_ImageObject;
- if (pImage) {
- pImageObj->m_pImage = m_pDocument->GetPageData()->GetImage(pImage->GetStream());
- } else if (pStream->GetObjNum()) {
- pImageObj->m_pImage = m_pDocument->LoadImageF(pStream);
- } else {
- pImageObj->m_pImage = FX_NEW CPDF_Image(m_pDocument);
- pImageObj->m_pImage->LoadImageF(pStream, bInline);
- }
- SetGraphicStates(pImageObj, pImageObj->m_pImage->IsMask(), FALSE, FALSE);
- pImageObj->m_Matrix = ImageMatrix;
- pImageObj->CalcBoundingBox();
- m_pObjectList->m_ObjectList.AddTail(pImageObj);
- return pImageObj;
-}
-void CPDF_StreamContentParser::Handle_MarkPlace_Dictionary()
-{
-}
-void CPDF_StreamContentParser::Handle_EndImage()
-{
-}
-void CPDF_StreamContentParser::Handle_EndMarkedContent()
-{
- if (!m_Options.m_bMarkedContent) {
- return;
- }
- if (m_CurContentMark.IsNull()) {
- return;
- }
- int count = m_CurContentMark.GetObject()->CountItems();
- if (count == 1) {
- m_CurContentMark.SetNull();
- return;
- }
- m_CurContentMark.GetModify()->DeleteLastMark();
-}
-void CPDF_StreamContentParser::Handle_EndText()
-{
- int count = m_ClipTextList.GetSize();
- if (count == 0) {
- return;
- }
- if (m_pCurStates->m_TextState.GetObject()->m_TextMode < 4) {
- for (int i = 0; i < count; i ++) {
- CPDF_TextObject* pText = (CPDF_TextObject*)m_ClipTextList.GetAt(i);
- if (pText) {
- delete pText;
- }
- }
- } else {
- m_pCurStates->m_ClipPath.AppendTexts((CPDF_TextObject**)m_ClipTextList.GetData(), count);
- }
- m_ClipTextList.RemoveAll();
-}
-void CPDF_StreamContentParser::Handle_EndSectionUndefined()
-{
- if (m_CompatCount) {
- m_CompatCount --;
- }
-}
-void CPDF_StreamContentParser::Handle_FillPath()
-{
- if (m_Options.m_bTextOnly) {
- return;
- }
- AddPathObject(FXFILL_WINDING, FALSE);
-}
-void CPDF_StreamContentParser::Handle_FillPathOld()
-{
- if (m_Options.m_bTextOnly) {
- return;
- }
- AddPathObject(FXFILL_WINDING, FALSE);
-}
-void CPDF_StreamContentParser::Handle_EOFillPath()
-{
- if (m_Options.m_bTextOnly) {
- return;
- }
- AddPathObject(FXFILL_ALTERNATE, FALSE);
-}
-void CPDF_StreamContentParser::Handle_SetGray_Fill()
-{
- FX_FLOAT value = GetNumber(0);
- CPDF_ColorSpace* pCS = CPDF_ColorSpace::GetStockCS(PDFCS_DEVICEGRAY);
- m_pCurStates->m_ColorState.SetFillColor(pCS, &value, 1);
-}
-void CPDF_StreamContentParser::Handle_SetGray_Stroke()
-{
- FX_FLOAT value = GetNumber(0);
- CPDF_ColorSpace* pCS = CPDF_ColorSpace::GetStockCS(PDFCS_DEVICEGRAY);
- m_pCurStates->m_ColorState.SetStrokeColor(pCS, &value, 1);
-}
-void CPDF_StreamContentParser::Handle_SetExtendGraphState()
-{
- CFX_ByteString name = GetString(0);
- CPDF_Dictionary* pGS = (CPDF_Dictionary*)FindResourceObj(FX_BSTRC("ExtGState"), name);
- if (pGS == NULL || pGS->GetType() != PDFOBJ_DICTIONARY) {
- m_bResourceMissing = TRUE;
- return;
- }
- m_pCurStates->ProcessExtGS(pGS, this);
-}
-void CPDF_StreamContentParser::Handle_ClosePath()
-{
- if (m_Options.m_bTextOnly) {
- return;
- }
- if (m_PathPointCount == 0) {
- return;
- }
- if (m_PathStartX != m_PathCurrentX || m_PathStartY != m_PathCurrentY) {
- AddPathPoint(m_PathStartX, m_PathStartY, FXPT_LINETO | FXPT_CLOSEFIGURE);
- } else if (m_pPathPoints[m_PathPointCount - 1].m_Flag != FXPT_MOVETO) {
- m_pPathPoints[m_PathPointCount - 1].m_Flag |= FXPT_CLOSEFIGURE;
- }
-}
-void CPDF_StreamContentParser::Handle_SetFlat()
-{
-#if !defined(_FPDFAPI_MINI_) || defined(_FXCORE_FEATURE_ALL_)
- m_pCurStates->m_GeneralState.GetModify()->m_Flatness = GetNumber(0);
-#endif
-}
-void CPDF_StreamContentParser::Handle_BeginImageData()
-{
-}
-void CPDF_StreamContentParser::Handle_SetLineJoin()
-{
- m_pCurStates->m_GraphState.GetModify()->m_LineJoin = (CFX_GraphStateData::LineJoin)GetInteger(0);
-}
-void CPDF_StreamContentParser::Handle_SetLineCap()
-{
- m_pCurStates->m_GraphState.GetModify()->m_LineCap = (CFX_GraphStateData::LineCap)GetInteger(0);
-}
-void CPDF_StreamContentParser::Handle_SetCMYKColor_Fill()
-{
- REQUIRE_PARAMS(4);
- FX_FLOAT values[4];
- for (int i = 0; i < 4; i ++) {
- values[i] = GetNumber(3 - i);
- }
- CPDF_ColorSpace* pCS = CPDF_ColorSpace::GetStockCS(PDFCS_DEVICECMYK);
- m_pCurStates->m_ColorState.SetFillColor(pCS, values, 4);
-}
-void CPDF_StreamContentParser::Handle_SetCMYKColor_Stroke()
-{
- REQUIRE_PARAMS(4);
- FX_FLOAT values[4];
- for (int i = 0; i < 4; i ++) {
- values[i] = GetNumber(3 - i);
- }
- CPDF_ColorSpace* pCS = CPDF_ColorSpace::GetStockCS(PDFCS_DEVICECMYK);
- m_pCurStates->m_ColorState.SetStrokeColor(pCS, values, 4);
-}
-void CPDF_StreamContentParser::Handle_LineTo()
-{
- REQUIRE_PARAMS(2);
- if (m_Options.m_bTextOnly) {
- return;
- }
- AddPathPoint(GetNumber(1), GetNumber(0), FXPT_LINETO);
-}
-void CPDF_StreamContentParser::Handle_MoveTo()
-{
- REQUIRE_PARAMS(2);
- if (m_Options.m_bTextOnly) {
-#ifndef _FPDFAPI_MINI_
- m_pSyntax->SkipPathObject();
-#endif
- return;
- }
- AddPathPoint(GetNumber(1), GetNumber(0), FXPT_MOVETO);
-#ifndef _FPDFAPI_MINI_
- ParsePathObject();
-#endif
-}
-void CPDF_StreamContentParser::Handle_SetMiterLimit()
-{
- m_pCurStates->m_GraphState.GetModify()->m_MiterLimit = GetNumber(0);
-}
-void CPDF_StreamContentParser::Handle_MarkPlace()
-{
-}
-void CPDF_StreamContentParser::Handle_EndPath()
-{
- if (m_Options.m_bTextOnly) {
- return;
- }
- AddPathObject(0, FALSE);
-}
-void CPDF_StreamContentParser::Handle_SaveGraphState()
-{
- CPDF_AllStates* pStates = FX_NEW CPDF_AllStates;
- pStates->Copy(*m_pCurStates);
- m_StateStack.Add(pStates);
-}
-void CPDF_StreamContentParser::Handle_RestoreGraphState()
-{
- int size = m_StateStack.GetSize();
- if (size == 0) {
- return;
- }
- CPDF_AllStates* pStates = (CPDF_AllStates*)m_StateStack.GetAt(size - 1);
- m_pCurStates->Copy(*pStates);
- delete pStates;
- m_StateStack.RemoveAt(size - 1);
-}
-void CPDF_StreamContentParser::Handle_Rectangle()
-{
- if (m_Options.m_bTextOnly) {
- return;
- }
- FX_FLOAT x = GetNumber(3), y = GetNumber(2);
- FX_FLOAT w = GetNumber(1), h = GetNumber(0);
- AddPathRect(x, y, w, h);
-}
-void CPDF_StreamContentParser::AddPathRect(FX_FLOAT x, FX_FLOAT y, FX_FLOAT w, FX_FLOAT h)
-{
- AddPathPoint(x, y, FXPT_MOVETO);
- AddPathPoint(x + w, y, FXPT_LINETO);
- AddPathPoint(x + w, y + h, FXPT_LINETO);
- AddPathPoint(x, y + h, FXPT_LINETO);
- AddPathPoint(x, y, FXPT_LINETO | FXPT_CLOSEFIGURE);
-}
-void CPDF_StreamContentParser::Handle_SetRGBColor_Fill()
-{
- REQUIRE_PARAMS(3);
- FX_FLOAT values[3];
- for (int i = 0; i < 3; i ++) {
- values[i] = GetNumber(2 - i);
- }
- CPDF_ColorSpace* pCS = CPDF_ColorSpace::GetStockCS(PDFCS_DEVICERGB);
- m_pCurStates->m_ColorState.SetFillColor(pCS, values, 3);
-}
-void CPDF_StreamContentParser::Handle_SetRGBColor_Stroke()
-{
- REQUIRE_PARAMS(3);
- FX_FLOAT values[3];
- for (int i = 0; i < 3; i ++) {
- values[i] = GetNumber(2 - i);
- }
- CPDF_ColorSpace* pCS = CPDF_ColorSpace::GetStockCS(PDFCS_DEVICERGB);
- m_pCurStates->m_ColorState.SetStrokeColor(pCS, values, 3);
-}
-void CPDF_StreamContentParser::Handle_SetRenderIntent()
-{
-}
-void CPDF_StreamContentParser::Handle_CloseStrokePath()
-{
- if (m_Options.m_bTextOnly) {
- return;
- }
- Handle_ClosePath();
- AddPathObject(0, TRUE);
-}
-void CPDF_StreamContentParser::Handle_StrokePath()
-{
- if (m_Options.m_bTextOnly) {
- return;
- }
- AddPathObject(0, TRUE);
-}
-void CPDF_StreamContentParser::Handle_SetColor_Fill()
-{
- if (m_Options.m_bTextOnly) {
- return;
- }
- FX_FLOAT values[4];
- int nargs = m_ParamCount;
- if (nargs > 4) {
- nargs = 4;
- }
- for (int i = 0; i < nargs; i ++) {
- values[i] = GetNumber(nargs - i - 1);
- }
- m_pCurStates->m_ColorState.SetFillColor(NULL, values, nargs);
-}
-void CPDF_StreamContentParser::Handle_SetColor_Stroke()
-{
- if (m_Options.m_bTextOnly) {
- return;
- }
- FX_FLOAT values[4];
- int nargs = m_ParamCount;
- if (nargs > 4) {
- nargs = 4;
- }
- for (int i = 0; i < nargs; i ++) {
- values[i] = GetNumber(nargs - i - 1);
- }
- m_pCurStates->m_ColorState.SetStrokeColor(NULL, values, nargs);
-}
-void CPDF_StreamContentParser::Handle_SetColorPS_Fill()
-{
- if (m_Options.m_bTextOnly) {
- return;
- }
- CPDF_Object* pLastParam = GetObject(0);
- if (pLastParam == NULL) {
- return;
- }
- int nargs = m_ParamCount;
- int nvalues = nargs;
- if (pLastParam->GetType() == PDFOBJ_NAME) {
- nvalues --;
- }
- FX_FLOAT* values = NULL;
- if (nvalues) {
- values = FX_Alloc(FX_FLOAT, nvalues);
- for (int i = 0; i < nvalues; i ++) {
- values[i] = GetNumber(nargs - i - 1);
- }
- }
- if (nvalues != nargs) {
- CPDF_Pattern* pPattern = FindPattern(GetString(0), FALSE);
- if (pPattern) {
- m_pCurStates->m_ColorState.SetFillPattern(pPattern, values, nvalues);
- }
- } else {
- m_pCurStates->m_ColorState.SetFillColor(NULL, values, nvalues);
- }
- if (values) {
- FX_Free(values);
- }
-}
-void CPDF_StreamContentParser::Handle_SetColorPS_Stroke()
-{
- if (m_Options.m_bTextOnly) {
- return;
- }
- CPDF_Object* pLastParam = GetObject(0);
- if (pLastParam == NULL) {
- return;
- }
- int nargs = m_ParamCount;
- int nvalues = nargs;
- if (pLastParam->GetType() == PDFOBJ_NAME) {
- nvalues --;
- }
- FX_FLOAT* values = NULL;
- if (nvalues) {
- values = FX_Alloc(FX_FLOAT, nvalues);
- for (int i = 0; i < nvalues; i ++) {
- values[i] = GetNumber(nargs - i - 1);
- }
- }
- if (nvalues != nargs) {
- CPDF_Pattern* pPattern = FindPattern(GetString(0), FALSE);
- if (pPattern) {
- m_pCurStates->m_ColorState.SetStrokePattern(pPattern, values, nvalues);
- }
- } else {
- m_pCurStates->m_ColorState.SetStrokeColor(NULL, values, nvalues);
- }
- if (values) {
- FX_Free(values);
- }
-}
-CFX_FloatRect _GetShadingBBox(CPDF_Stream* pStream, int type, const CFX_AffineMatrix* pMatrix,
- CPDF_Function** pFuncs, int nFuncs, CPDF_ColorSpace* pCS);
-void CPDF_StreamContentParser::Handle_ShadeFill()
-{
- if (m_Options.m_bTextOnly) {
- return;
- }
- CPDF_Pattern* pPattern = FindPattern(GetString(0), TRUE);
- if (pPattern == NULL) {
- return;
- }
- if (pPattern->m_PatternType != PATTERN_SHADING) {
- return;
- }
- CPDF_ShadingPattern* pShading = (CPDF_ShadingPattern*)pPattern;
- if (!pShading->m_bShadingObj) {
- return;
- }
- if (!pShading->Load()) {
- return;
- }
- CPDF_ShadingObject* pObj = FX_NEW CPDF_ShadingObject;
- pObj->m_pShading = pShading;
- SetGraphicStates(pObj, FALSE, FALSE, FALSE);
- pObj->m_Matrix = m_pCurStates->m_CTM;
- pObj->m_Matrix.Concat(m_mtContentToUser);
- CFX_FloatRect bbox;
- if (!pObj->m_ClipPath.IsNull()) {
- bbox = pObj->m_ClipPath.GetClipBox();
- } else {
- bbox = m_BBox;
- }
- if (pShading->m_ShadingType >= 4) {
- bbox.Intersect(_GetShadingBBox((CPDF_Stream*)pShading->m_pShadingObj, pShading->m_ShadingType, &pObj->m_Matrix,
- pShading->m_pFunctions, pShading->m_nFuncs, pShading->m_pCS));
- }
- pObj->m_Left = bbox.left;
- pObj->m_Right = bbox.right;
- pObj->m_Top = bbox.top;
- pObj->m_Bottom = bbox.bottom;
- m_pObjectList->m_ObjectList.AddTail(pObj);
-}
-void CPDF_StreamContentParser::Handle_SetCharSpace()
-{
- m_pCurStates->m_TextState.GetModify()->m_CharSpace = GetNumber(0);
-}
-void CPDF_StreamContentParser::Handle_MoveTextPoint()
-{
- m_pCurStates->m_TextLineX += GetNumber(1);
- m_pCurStates->m_TextLineY += GetNumber(0);
- m_pCurStates->m_TextX = m_pCurStates->m_TextLineX;
- m_pCurStates->m_TextY = m_pCurStates->m_TextLineY;
-}
-void CPDF_StreamContentParser::Handle_MoveTextPoint_SetLeading()
-{
- Handle_MoveTextPoint();
- m_pCurStates->m_TextLeading = -GetNumber(0);
-}
-void CPDF_StreamContentParser::Handle_SetFont()
-{
- FX_FLOAT fs = GetNumber(0);
- if (fs == 0) {
- fs = m_DefFontSize;
- }
- m_pCurStates->m_TextState.GetModify()->m_FontSize = fs;
- CPDF_Font* pFont = FindFont(GetString(1));
- if (pFont) {
- m_pCurStates->m_TextState.SetFont(pFont);
- }
-}
-CPDF_Object* CPDF_StreamContentParser::FindResourceObj(FX_BSTR type, const CFX_ByteString& name)
-{
- if (m_pResources == NULL) {
- return NULL;
- }
- if (m_pResources == m_pPageResources) {
- CPDF_Dictionary* pList = m_pResources->GetDict(type);
- if (pList == NULL) {
- return NULL;
- }
- CPDF_Object* pRes = pList->GetElementValue(name);
- return pRes;
- }
- CPDF_Dictionary* pList = m_pResources->GetDict(type);
- if (pList == NULL) {
- if (m_pPageResources == NULL) {
- return NULL;
- }
- CPDF_Dictionary* pList = m_pPageResources->GetDict(type);
- if (pList == NULL) {
- return NULL;
- }
- CPDF_Object* pRes = pList->GetElementValue(name);
- return pRes;
- }
- CPDF_Object* pRes = pList->GetElementValue(name);
- return pRes;
-}
-CPDF_Font* CPDF_StreamContentParser::FindFont(const CFX_ByteString& name)
-{
- CPDF_Dictionary* pFontDict = (CPDF_Dictionary*)FindResourceObj(FX_BSTRC("Font"), name);
- if (pFontDict == NULL || pFontDict->GetType() != PDFOBJ_DICTIONARY) {
- m_bResourceMissing = TRUE;
- return CPDF_Font::GetStockFont(m_pDocument, FX_BSTRC("Helvetica"));
- }
- CPDF_Font* pFont = m_pDocument->LoadFont(pFontDict);
- if (pFont && pFont->GetType3Font()) {
- pFont->GetType3Font()->SetPageResources(m_pResources);
- pFont->GetType3Font()->CheckType3FontMetrics();
- }
- return pFont;
-}
-CPDF_ColorSpace* CPDF_StreamContentParser::FindColorSpace(const CFX_ByteString& name)
-{
- if (name == FX_BSTRC("Pattern")) {
- return CPDF_ColorSpace::GetStockCS(PDFCS_PATTERN);
- }
- if (name == FX_BSTRC("DeviceGray") || name == FX_BSTRC("DeviceCMYK") || name == FX_BSTRC("DeviceRGB")) {
- CFX_ByteString defname = "Default";
- defname += name.Mid(7);
- CPDF_Object* pDefObj = FindResourceObj(FX_BSTRC("ColorSpace"), defname);
- if (pDefObj == NULL) {
- if (name == FX_BSTRC("DeviceGray")) {
- return CPDF_ColorSpace::GetStockCS(PDFCS_DEVICEGRAY);
- }
- if (name == FX_BSTRC("DeviceRGB")) {
- return CPDF_ColorSpace::GetStockCS(PDFCS_DEVICERGB);
- }
- return CPDF_ColorSpace::GetStockCS(PDFCS_DEVICECMYK);
- }
- return m_pDocument->LoadColorSpace(pDefObj);
- }
- CPDF_Object* pCSObj = FindResourceObj(FX_BSTRC("ColorSpace"), name);
- if (pCSObj == NULL) {
- m_bResourceMissing = TRUE;
- return NULL;
- }
- return m_pDocument->LoadColorSpace(pCSObj);
-}
-CPDF_Pattern* CPDF_StreamContentParser::FindPattern(const CFX_ByteString& name, FX_BOOL bShading)
-{
- CPDF_Object* pPattern = FindResourceObj(bShading ? FX_BSTRC("Shading") : FX_BSTRC("Pattern"), name);
- if (pPattern == NULL || (pPattern->GetType() != PDFOBJ_DICTIONARY &&
- pPattern->GetType() != PDFOBJ_STREAM)) {
- m_bResourceMissing = TRUE;
- return NULL;
- }
- return m_pDocument->LoadPattern(pPattern, bShading, &m_pCurStates->m_ParentMatrix);
-}
-void CPDF_StreamContentParser::ConvertTextSpace(FX_FLOAT& x, FX_FLOAT& y)
-{
- m_pCurStates->m_TextMatrix.Transform(x, y, x, y);
- ConvertUserSpace(x, y);
-}
-void CPDF_StreamContentParser::ConvertUserSpace(FX_FLOAT& x, FX_FLOAT& y)
-{
- m_pCurStates->m_CTM.Transform(x, y, x, y);
- m_mtContentToUser.Transform(x, y, x, y);
-}
-void CPDF_StreamContentParser::AddTextObject(CFX_ByteString* pStrs, FX_FLOAT fInitKerning, FX_FLOAT* pKerning, int nsegs)
-{
- CPDF_Font* pFont = m_pCurStates->m_TextState.GetFont();
- if (pFont == NULL) {
- return;
- }
- if (fInitKerning != 0) {
- if (!pFont->IsVertWriting()) {
- m_pCurStates->m_TextX -= FXSYS_Mul(fInitKerning, m_pCurStates->m_TextState.GetFontSize()) / 1000;
- } else {
- m_pCurStates->m_TextY -= FXSYS_Mul(fInitKerning, m_pCurStates->m_TextState.GetFontSize()) / 1000;
- }
- }
- if (nsegs == 0) {
- return;
- }
- int textmode;
- if (pFont->GetFontType() == PDFFONT_TYPE3) {
- textmode = 0;
- } else {
- textmode = m_pCurStates->m_TextState.GetObject()->m_TextMode;
- }
- CPDF_TextObject* pText = FX_NEW CPDF_TextObject;
- m_pLastTextObject = pText;
- SetGraphicStates(pText, TRUE, TRUE, TRUE);
- if (textmode && textmode != 3 && textmode != 4 && textmode != 7) {
- FX_FLOAT* pCTM = pText->m_TextState.GetModify()->m_CTM;
- pCTM[0] = m_pCurStates->m_CTM.a;
- pCTM[1] = m_pCurStates->m_CTM.c;
- pCTM[2] = m_pCurStates->m_CTM.b;
- pCTM[3] = m_pCurStates->m_CTM.d;
- }
- pText->SetSegments(pStrs, pKerning, nsegs);
- pText->m_PosX = m_pCurStates->m_TextX;
- pText->m_PosY = m_pCurStates->m_TextY + m_pCurStates->m_TextRise;
- ConvertTextSpace(pText->m_PosX, pText->m_PosY);
- FX_FLOAT x_advance, y_advance;
- pText->CalcPositionData(&x_advance, &y_advance, m_pCurStates->m_TextHorzScale, m_Level);
- m_pCurStates->m_TextX += x_advance;
- m_pCurStates->m_TextY += y_advance;
- if (textmode > 3) {
- CPDF_TextObject* pCopy = FX_NEW CPDF_TextObject;
- pCopy->Copy(pText);
- m_ClipTextList.Add(pCopy);
- }
- m_pObjectList->m_ObjectList.AddTail(pText);
- if (pKerning && pKerning[nsegs - 1] != 0) {
- if (!pFont->IsVertWriting()) {
- m_pCurStates->m_TextX -= FXSYS_Mul(pKerning[nsegs - 1], m_pCurStates->m_TextState.GetFontSize()) / 1000;
- } else {
- m_pCurStates->m_TextY -= FXSYS_Mul(pKerning[nsegs - 1], m_pCurStates->m_TextState.GetFontSize()) / 1000;
- }
- }
-}
-void CPDF_StreamContentParser::Handle_ShowText()
-{
- CFX_ByteString str = GetString(0);
- if (str.IsEmpty()) {
- return;
- }
- AddTextObject(&str, 0, NULL, 1);
-}
-void CPDF_StreamContentParser::Handle_ShowText_Positioning()
-{
- CPDF_Array* pArray = GetObject(0)->GetArray();
- if (pArray == NULL) {
- return;
- }
- int n = pArray->GetCount(), nsegs = 0, i;
- for (i = 0; i < n; i ++) {
- CPDF_Object* pObj = pArray->GetElementValue(i);
- if (pObj->GetType() == PDFOBJ_STRING) {
- nsegs ++;
- }
- }
- if (nsegs == 0) {
- for (i = 0; i < n; i ++) {
- m_pCurStates->m_TextX -= FXSYS_Mul(pArray->GetNumber(i), m_pCurStates->m_TextState.GetFontSize()) / 1000;
- };
- return;
- }
- CFX_ByteString* pStrs;
- FX_NEW_VECTOR(pStrs, CFX_ByteString, nsegs);
- FX_FLOAT* pKerning = FX_Alloc(FX_FLOAT, nsegs);
- int iSegment = 0;
- FX_FLOAT fInitKerning = 0;
- for (i = 0; i < n; i ++) {
- CPDF_Object* pObj = pArray->GetElementValue(i);
- if (pObj->GetType() == PDFOBJ_STRING) {
- CFX_ByteString str = pObj->GetString();
- if (str.IsEmpty()) {
- continue;
- }
- pStrs[iSegment] = str;
- pKerning[iSegment ++] = 0;
- } else {
- if (iSegment == 0) {
- fInitKerning += pObj->GetNumber();
- } else {
- pKerning[iSegment - 1] += pObj->GetNumber();
- }
- }
- }
- AddTextObject(pStrs, fInitKerning, pKerning, iSegment);
- FX_DELETE_VECTOR(pStrs, CFX_ByteString, nsegs);
- FX_Free(pKerning);
-}
-void CPDF_StreamContentParser::Handle_SetTextLeading()
-{
- m_pCurStates->m_TextLeading = GetNumber(0);
-}
-void CPDF_StreamContentParser::Handle_SetTextMatrix()
-{
- m_pCurStates->m_TextMatrix.Set(GetNumber16(5), GetNumber16(4), GetNumber16(3),
- GetNumber16(2), GetNumber(1), GetNumber(0));
- OnChangeTextMatrix();
- m_pCurStates->m_TextX = 0;
- m_pCurStates->m_TextY = 0;
- m_pCurStates->m_TextLineX = 0;
- m_pCurStates->m_TextLineY = 0;
-}
-void CPDF_StreamContentParser::OnChangeTextMatrix()
-{
- CFX_AffineMatrix text_matrix(m_pCurStates->m_TextHorzScale, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f);
- text_matrix.Concat(m_pCurStates->m_TextMatrix);
- text_matrix.Concat(m_pCurStates->m_CTM);
- text_matrix.Concat(m_mtContentToUser);
- FX_FLOAT* pTextMatrix = m_pCurStates->m_TextState.GetModify()->m_Matrix;
- pTextMatrix[0] = text_matrix.a;
- pTextMatrix[1] = text_matrix.c;
- pTextMatrix[2] = text_matrix.b;
- pTextMatrix[3] = text_matrix.d;
-}
-void CPDF_StreamContentParser::Handle_SetTextRenderMode()
-{
- int mode = GetInteger(0);
- if (mode < 0 || mode > 7) {
- return;
- }
- m_pCurStates->m_TextState.GetModify()->m_TextMode = mode;
-}
-void CPDF_StreamContentParser::Handle_SetTextRise()
-{
- m_pCurStates->m_TextRise = GetNumber(0);
-}
-void CPDF_StreamContentParser::Handle_SetWordSpace()
-{
- m_pCurStates->m_TextState.GetModify()->m_WordSpace = GetNumber(0);
-}
-void CPDF_StreamContentParser::Handle_SetHorzScale()
-{
- if (m_ParamCount != 1) {
- return;
- }
- m_pCurStates->m_TextHorzScale = GetNumber(0) / 100;
- OnChangeTextMatrix();
-}
-void CPDF_StreamContentParser::Handle_MoveToNextLine()
-{
- m_pCurStates->m_TextLineY -= m_pCurStates->m_TextLeading;
- m_pCurStates->m_TextX = m_pCurStates->m_TextLineX;
- m_pCurStates->m_TextY = m_pCurStates->m_TextLineY;
-}
-void CPDF_StreamContentParser::Handle_CurveTo_23()
-{
- if (m_Options.m_bTextOnly) {
- return;
- }
- AddPathPoint(m_PathCurrentX, m_PathCurrentY, FXPT_BEZIERTO);
- AddPathPoint(GetNumber(3), GetNumber(2), FXPT_BEZIERTO);
- AddPathPoint(GetNumber(1), GetNumber(0), FXPT_BEZIERTO);
-}
-void CPDF_StreamContentParser::Handle_SetLineWidth()
-{
- FX_FLOAT width = GetNumber(0);
- m_pCurStates->m_GraphState.GetModify()->m_LineWidth = width;
-}
-void CPDF_StreamContentParser::Handle_Clip()
-{
- m_PathClipType = FXFILL_WINDING;
-}
-void CPDF_StreamContentParser::Handle_EOClip()
-{
- m_PathClipType = FXFILL_ALTERNATE;
-}
-void CPDF_StreamContentParser::Handle_CurveTo_13()
-{
- if (m_Options.m_bTextOnly) {
- return;
- }
- AddPathPoint(GetNumber(3), GetNumber(2), FXPT_BEZIERTO);
- AddPathPoint(GetNumber(1), GetNumber(0), FXPT_BEZIERTO);
- AddPathPoint(GetNumber(1), GetNumber(0), FXPT_BEZIERTO);
-}
-void CPDF_StreamContentParser::Handle_NextLineShowText()
-{
- Handle_MoveToNextLine();
- Handle_ShowText();
-}
-void CPDF_StreamContentParser::Handle_NextLineShowText_Space()
-{
- m_pCurStates->m_TextState.GetModify()->m_WordSpace = GetNumber(2);
- m_pCurStates->m_TextState.GetModify()->m_CharSpace = GetNumber(1);
- Handle_NextLineShowText();
-}
-void CPDF_StreamContentParser::Handle_Invalid()
-{
-}
-void CPDF_StreamContentParser::AddPathPoint(FX_FLOAT x, FX_FLOAT y, int flag)
-{
- m_PathCurrentX = x;
- m_PathCurrentY = y;
- if (flag == FXPT_MOVETO) {
- m_PathStartX = x;
- m_PathStartY = y;
- if (m_PathPointCount && m_pPathPoints[m_PathPointCount - 1].m_Flag == FXPT_MOVETO) {
- m_pPathPoints[m_PathPointCount - 1].m_PointX = x;
- m_pPathPoints[m_PathPointCount - 1].m_PointY = y;
- return;
- }
- } else if (m_PathPointCount == 0) {
- return;
- }
- m_PathPointCount ++;
- if (m_PathPointCount > m_PathAllocSize) {
- int newsize = m_PathPointCount + 256;
- FX_PATHPOINT* pNewPoints = FX_Alloc(FX_PATHPOINT, newsize);
- if (m_PathAllocSize) {
- FXSYS_memcpy32(pNewPoints, m_pPathPoints, m_PathAllocSize * sizeof(FX_PATHPOINT));
- FX_Free(m_pPathPoints);
- }
- m_pPathPoints = pNewPoints;
- m_PathAllocSize = newsize;
- }
- m_pPathPoints[m_PathPointCount - 1].m_Flag = flag;
- m_pPathPoints[m_PathPointCount - 1].m_PointX = x;
- m_pPathPoints[m_PathPointCount - 1].m_PointY = y;
-}
-void CPDF_StreamContentParser::AddPathObject(int FillType, FX_BOOL bStroke)
-{
- int PathPointCount = m_PathPointCount, PathClipType = m_PathClipType;
- m_PathPointCount = 0;
- m_PathClipType = 0;
- if (PathPointCount <= 1) {
- if (PathPointCount && PathClipType) {
- CPDF_Path path;
- path.New()->AppendRect(0, 0, 0, 0);
- m_pCurStates->m_ClipPath.AppendPath(path, FXFILL_WINDING, TRUE);
- }
- return;
- }
- if (PathPointCount && m_pPathPoints[PathPointCount - 1].m_Flag == FXPT_MOVETO) {
- PathPointCount --;
- }
- CPDF_Path Path;
- CFX_PathData* pPathData = Path.New();
- pPathData->SetPointCount(PathPointCount);
- FXSYS_memcpy32(pPathData->GetPoints(), m_pPathPoints, sizeof(FX_PATHPOINT) * PathPointCount);
- CFX_AffineMatrix matrix = m_pCurStates->m_CTM;
- matrix.Concat(m_mtContentToUser);
- if (bStroke || FillType) {
- CPDF_PathObject* pPathObj = FX_NEW CPDF_PathObject;
- pPathObj->m_bStroke = bStroke;
- pPathObj->m_FillType = FillType;
- pPathObj->m_Path = Path;
- pPathObj->m_Matrix = matrix;
- SetGraphicStates(pPathObj, TRUE, FALSE, TRUE);
- pPathObj->CalcBoundingBox();
- m_pObjectList->m_ObjectList.AddTail(pPathObj);
- }
- if (PathClipType) {
- if (!matrix.IsIdentity()) {
- Path.Transform(&matrix);
- matrix.SetIdentity();
- }
- m_pCurStates->m_ClipPath.AppendPath(Path, PathClipType, TRUE);
- }
-}
-CFX_ByteString _FPDF_ByteStringFromHex(CFX_BinaryBuf& src_buf)
-{
- CFX_ByteTextBuf buf;
- FX_BOOL bFirst = TRUE;
- int code = 0;
- FX_LPCBYTE str = src_buf.GetBuffer();
- FX_DWORD size = src_buf.GetSize();
- for (FX_DWORD i = 0; i < size; i ++) {
- FX_BYTE ch = str[i];
- if (ch >= '0' && ch <= '9') {
- if (bFirst) {
- code = (ch - '0') * 16;
- } else {
- code += ch - '0';
- buf.AppendChar((char)code);
- }
- bFirst = !bFirst;
- } else if (ch >= 'A' && ch <= 'F') {
- if (bFirst) {
- code = (ch - 'A' + 10) * 16;
- } else {
- code += ch - 'A' + 10;
- buf.AppendChar((char)code);
- }
- bFirst = !bFirst;
- } else if (ch >= 'a' && ch <= 'f') {
- if (bFirst) {
- code = (ch - 'a' + 10) * 16;
- } else {
- code += ch - 'a' + 10;
- buf.AppendChar((char)code);
- }
- bFirst = !bFirst;
- }
- }
- if (!bFirst) {
- buf.AppendChar((char)code);
- }
- return buf.GetByteString();
-}
+// 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
+
+#include "../../../include/fpdfapi/fpdf_page.h"
+#include "../../../include/fpdfapi/fpdf_module.h"
+#include "../../../include/fpdfapi/fpdf_serial.h"
+#include "pageint.h"
+#define REQUIRE_PARAMS(count) if (m_ParamCount != count) { m_bAbort = TRUE; return; }
+CPDF_StreamContentParser::CPDF_StreamContentParser()
+{
+ m_DefFontSize = 0;
+ m_pCurStates = NULL;
+ m_pLastTextObject = NULL;
+ m_pPathPoints = NULL;
+ m_PathClipType = 0;
+ m_PathPointCount = m_PathAllocSize = 0;
+ m_PathCurrentX = m_PathCurrentY = 0.0f;
+ m_bResourceMissing = FALSE;
+ m_bColored = FALSE;
+ FXSYS_memset32(m_Type3Data, 0, sizeof(FX_FLOAT) * 6);
+ m_ParamCount = 0;
+ m_ParamStartPos = 0;
+ m_bAbort = FALSE;
+ m_pLastImageDict = NULL;
+ m_pLastCloneImageDict = NULL;
+ m_pLastImage = NULL;
+ m_bReleaseLastDict = TRUE;
+ m_pParentResources = NULL;
+#ifdef _FPDFAPI_MINI_
+ m_pObjectState = NULL;
+ m_pObjectStack = NULL;
+ m_pWordBuf = NULL;
+ m_pDictName = NULL;
+ m_pStreamBuf = NULL;
+ m_WordState = 0;
+ m_ObjectSize = 0;
+#endif
+}
+FX_BOOL CPDF_StreamContentParser::Initialize()
+{
+#ifdef _FPDFAPI_MINI_
+ m_pObjectState = FX_Alloc(FX_BOOL, _FPDF_MAX_OBJECT_STACK_SIZE_);
+ FXSYS_memset32(m_pObjectState, 0, _FPDF_MAX_OBJECT_STACK_SIZE_ * sizeof(FX_BOOL));
+ m_pObjectStack = FX_Alloc(CPDF_Object*, _FPDF_MAX_OBJECT_STACK_SIZE_);
+ FXSYS_memset32(m_pObjectStack, 0, _FPDF_MAX_OBJECT_STACK_SIZE_ * sizeof(CPDF_Object*));
+ m_pWordBuf = FX_Alloc(FX_BYTE, 256);
+ FXSYS_memset32(m_pWordBuf, 0, 256 * sizeof(FX_BYTE));
+ m_pDictName = FX_Alloc(FX_BYTE, 256);
+ FXSYS_memset32(m_pDictName, 0, 256 * sizeof(FX_BYTE));
+ m_pStreamBuf = FX_Alloc(FX_BYTE, STREAM_PARSE_BUFSIZE);
+ FXSYS_memset32(m_pStreamBuf, 0, STREAM_PARSE_BUFSIZE * sizeof(FX_BYTE));
+ m_StringBuf.EstimateSize(1024);
+ m_ObjectSize = 0;
+ m_ImageSrcBuf.EstimateSize(STREAM_PARSE_BUFSIZE);
+#endif
+ return TRUE;
+}
+CPDF_StreamContentParser::~CPDF_StreamContentParser()
+{
+ ClearAllParams();
+ int i = 0;
+ for (i = 0; i < m_StateStack.GetSize(); i ++) {
+ delete (CPDF_AllStates*)m_StateStack[i];
+ }
+ if (m_pPathPoints) {
+ FX_Free(m_pPathPoints);
+ }
+ if (m_pCurStates) {
+ delete m_pCurStates;
+ }
+ if (m_pLastImageDict) {
+ m_pLastImageDict->Release();
+ }
+ if (m_pLastCloneImageDict) {
+ m_pLastCloneImageDict->Release();
+ }
+#ifdef _FPDFAPI_MINI_
+ for (i = 0; i < (int)m_ObjectSize; ++i) {
+ if (!m_pObjectState[i]) {
+ m_pObjectStack[i]->Release();
+ }
+ }
+ FX_Free(m_pObjectStack);
+ FX_Free(m_pObjectState);
+ FX_Free(m_pStreamBuf);
+ FX_Free(m_pWordBuf);
+ FX_Free(m_pDictName);
+#endif
+}
+void CPDF_StreamContentParser::PrepareParse(CPDF_Document* pDocument,
+ CPDF_Dictionary* pPageResources, CPDF_Dictionary* pParentResources, CFX_AffineMatrix* pmtContentToUser, CPDF_PageObjects* pObjList,
+ CPDF_Dictionary* pResources, CPDF_Rect* pBBox, CPDF_ParseOptions* pOptions,
+ CPDF_AllStates* pStates, int level)
+{
+ for (int i = 0; i < 6; i ++) {
+ m_Type3Data[i] = 0;
+ }
+ m_pDocument = pDocument;
+ m_pPageResources = pPageResources;
+ m_pParentResources = pParentResources;
+ if (pmtContentToUser) {
+ m_mtContentToUser = *pmtContentToUser;
+ }
+ if (pOptions) {
+ m_Options = *pOptions;
+ }
+ m_pObjectList = pObjList;
+ m_pResources = pResources;
+ if (pResources == NULL) {
+ m_pResources = m_pParentResources;
+ }
+ if (m_pResources == NULL) {
+ m_pResources = pPageResources;
+ }
+ if (pBBox) {
+ m_BBox = *pBBox;
+ }
+ m_Level = level;
+ m_pCurStates = FX_NEW CPDF_AllStates;
+ if (pStates) {
+ m_pCurStates->Copy(*pStates);
+ } else {
+ m_pCurStates->m_GeneralState.New();
+ m_pCurStates->m_GraphState.New();
+ m_pCurStates->m_TextState.New();
+ m_pCurStates->m_ColorState.New();
+ }
+#ifdef _FPDFAPI_MINI_
+ FXSYS_memset32(m_pObjectState, 0, _FPDF_MAX_OBJECT_STACK_SIZE_ * sizeof(FX_BOOL));
+#endif
+}
+int CPDF_StreamContentParser::GetNextParamPos()
+{
+ if (m_ParamCount == PARAM_BUF_SIZE) {
+ m_ParamStartPos ++;
+ if (m_ParamStartPos == PARAM_BUF_SIZE) {
+ m_ParamStartPos = 0;
+ }
+ if (m_ParamBuf1[m_ParamStartPos].m_Type == 0) {
+ m_ParamBuf1[m_ParamStartPos].m_pObject->Release();
+ }
+ return m_ParamStartPos;
+ }
+ int index = m_ParamStartPos + m_ParamCount;
+ if (index >= PARAM_BUF_SIZE) {
+ index -= PARAM_BUF_SIZE;
+ }
+ m_ParamCount ++;
+ return index;
+}
+void CPDF_StreamContentParser::AddNameParam(FX_LPCSTR name, int len)
+{
+ int index = GetNextParamPos();
+ if (len > 32) {
+ m_ParamBuf1[index].m_Type = 0;
+ m_ParamBuf1[index].m_pObject = CPDF_Name::Create(PDF_NameDecode(CFX_ByteStringC(name, len)));
+ } else {
+ m_ParamBuf1[index].m_Type = PDFOBJ_NAME;
+ if (FXSYS_memchr(name, '#', len) == NULL) {
+ FXSYS_memcpy32(m_ParamBuf1[index].m_Name.m_Buffer, name, len);
+ m_ParamBuf1[index].m_Name.m_Len = len;
+ } else {
+ CFX_ByteString str = PDF_NameDecode(CFX_ByteStringC(name, len));
+ FXSYS_memcpy32(m_ParamBuf1[index].m_Name.m_Buffer, (FX_LPCSTR)str, str.GetLength());
+ m_ParamBuf1[index].m_Name.m_Len = str.GetLength();
+ }
+ }
+}
+void CPDF_StreamContentParser::AddNumberParam(FX_LPCSTR str, int len)
+{
+ int index = GetNextParamPos();
+ m_ParamBuf1[index].m_Type = PDFOBJ_NUMBER;
+ FX_atonum(CFX_ByteStringC(str, len), m_ParamBuf1[index].m_Number.m_bInteger,
+ &m_ParamBuf1[index].m_Number.m_Integer);
+}
+void CPDF_StreamContentParser::AddObjectParam(CPDF_Object* pObj)
+{
+ int index = GetNextParamPos();
+ m_ParamBuf1[index].m_Type = 0;
+ m_ParamBuf1[index].m_pObject = pObj;
+}
+void CPDF_StreamContentParser::ClearAllParams()
+{
+ FX_DWORD index = m_ParamStartPos;
+ for (FX_DWORD i = 0; i < m_ParamCount; i ++) {
+ if (m_ParamBuf1[index].m_Type == 0) {
+ m_ParamBuf1[index].m_pObject->Release();
+ }
+ index ++;
+ if (index == PARAM_BUF_SIZE) {
+ index = 0;
+ }
+ }
+ m_ParamStartPos = 0;
+ m_ParamCount = 0;
+}
+CPDF_Object* CPDF_StreamContentParser::GetObject(FX_DWORD index)
+{
+ if (index >= m_ParamCount) {
+ return NULL;
+ }
+ int real_index = m_ParamStartPos + m_ParamCount - index - 1;
+ if (real_index >= PARAM_BUF_SIZE) {
+ real_index -= PARAM_BUF_SIZE;
+ }
+ _ContentParam& param = m_ParamBuf1[real_index];
+ if (param.m_Type == PDFOBJ_NUMBER) {
+ CPDF_Number* pNumber = CPDF_Number::Create(param.m_Number.m_bInteger, &param.m_Number.m_Integer);
+ param.m_Type = 0;
+ param.m_pObject = pNumber;
+ return pNumber;
+ }
+ if (param.m_Type == PDFOBJ_NAME) {
+ CPDF_Name* pName = CPDF_Name::Create(CFX_ByteString(param.m_Name.m_Buffer, param.m_Name.m_Len));
+ param.m_Type = 0;
+ param.m_pObject = pName;
+ return pName;
+ }
+ if (param.m_Type == 0) {
+ return param.m_pObject;
+ }
+ ASSERT(FALSE);
+ return NULL;
+}
+CFX_ByteString CPDF_StreamContentParser::GetString(FX_DWORD index)
+{
+ if (index >= m_ParamCount) {
+ return CFX_ByteString();
+ }
+ int real_index = m_ParamStartPos + m_ParamCount - index - 1;
+ if (real_index >= PARAM_BUF_SIZE) {
+ real_index -= PARAM_BUF_SIZE;
+ }
+ _ContentParam& param = m_ParamBuf1[real_index];
+ if (param.m_Type == PDFOBJ_NAME) {
+ return CFX_ByteString(param.m_Name.m_Buffer, param.m_Name.m_Len);
+ }
+ if (param.m_Type == 0) {
+ return param.m_pObject->GetString();
+ }
+ return CFX_ByteString();
+}
+FX_FLOAT CPDF_StreamContentParser::GetNumber(FX_DWORD index)
+{
+ if (index >= m_ParamCount) {
+ return 0;
+ }
+ int real_index = m_ParamStartPos + m_ParamCount - index - 1;
+ if (real_index >= PARAM_BUF_SIZE) {
+ real_index -= PARAM_BUF_SIZE;
+ }
+ _ContentParam& param = m_ParamBuf1[real_index];
+ if (param.m_Type == PDFOBJ_NUMBER) {
+ return param.m_Number.m_bInteger ? (FX_FLOAT)param.m_Number.m_Integer : param.m_Number.m_Float;
+ }
+ if (param.m_Type == 0) {
+ return param.m_pObject->GetNumber();
+ }
+ return 0;
+}
+FX_FLOAT CPDF_StreamContentParser::GetNumber16(FX_DWORD index)
+{
+ return GetNumber(index);
+}
+void CPDF_StreamContentParser::SetGraphicStates(CPDF_PageObject* pObj, FX_BOOL bColor, FX_BOOL bText, FX_BOOL bGraph)
+{
+ pObj->m_GeneralState = m_pCurStates->m_GeneralState;
+ pObj->m_ClipPath = m_pCurStates->m_ClipPath;
+ pObj->m_ContentMark = m_CurContentMark;
+ if (bColor) {
+ pObj->m_ColorState = m_pCurStates->m_ColorState;
+ }
+ if (bGraph) {
+ pObj->m_GraphState = m_pCurStates->m_GraphState;
+ }
+ if (bText) {
+ pObj->m_TextState = m_pCurStates->m_TextState;
+ }
+}
+const struct _OpCode {
+ FX_DWORD m_OpId;
+ void (CPDF_StreamContentParser::*m_OpHandler)();
+} g_OpCodes[] = {
+ {FXBSTR_ID('"', 0, 0, 0), &CPDF_StreamContentParser::Handle_NextLineShowText_Space},
+ {FXBSTR_ID('\'', 0, 0, 0), &CPDF_StreamContentParser::Handle_NextLineShowText},
+ {FXBSTR_ID('B', 0, 0, 0), &CPDF_StreamContentParser::Handle_FillStrokePath},
+ {FXBSTR_ID('B', '*', 0, 0), &CPDF_StreamContentParser::Handle_EOFillStrokePath},
+ {FXBSTR_ID('B', 'D', 'C', 0), &CPDF_StreamContentParser::Handle_BeginMarkedContent_Dictionary},
+ {FXBSTR_ID('B', 'I', 0, 0), &CPDF_StreamContentParser::Handle_BeginImage},
+ {FXBSTR_ID('B', 'M', 'C', 0), &CPDF_StreamContentParser::Handle_BeginMarkedContent},
+ {FXBSTR_ID('B', 'T', 0, 0), &CPDF_StreamContentParser::Handle_BeginText},
+ {FXBSTR_ID('B', 'X', 0, 0), &CPDF_StreamContentParser::Handle_BeginSectionUndefined},
+ {FXBSTR_ID('C', 'S', 0, 0), &CPDF_StreamContentParser::Handle_SetColorSpace_Stroke},
+ {FXBSTR_ID('D', 'P', 0, 0), &CPDF_StreamContentParser::Handle_MarkPlace_Dictionary},
+ {FXBSTR_ID('D', 'o', 0, 0), &CPDF_StreamContentParser::Handle_ExecuteXObject},
+ {FXBSTR_ID('E', 'I', 0, 0), &CPDF_StreamContentParser::Handle_EndImage},
+ {FXBSTR_ID('E', 'M', 'C', 0), &CPDF_StreamContentParser::Handle_EndMarkedContent},
+ {FXBSTR_ID('E', 'T', 0, 0), &CPDF_StreamContentParser::Handle_EndText},
+ {FXBSTR_ID('E', 'X', 0, 0), &CPDF_StreamContentParser::Handle_EndSectionUndefined},
+ {FXBSTR_ID('F', 0, 0, 0), &CPDF_StreamContentParser::Handle_FillPathOld},
+ {FXBSTR_ID('G', 0, 0, 0), &CPDF_StreamContentParser::Handle_SetGray_Stroke},
+ {FXBSTR_ID('I', 'D', 0, 0), &CPDF_StreamContentParser::Handle_BeginImageData},
+ {FXBSTR_ID('J', 0, 0, 0), &CPDF_StreamContentParser::Handle_SetLineCap},
+ {FXBSTR_ID('K', 0, 0, 0), &CPDF_StreamContentParser::Handle_SetCMYKColor_Stroke},
+ {FXBSTR_ID('M', 0, 0, 0), &CPDF_StreamContentParser::Handle_SetMiterLimit},
+ {FXBSTR_ID('M', 'P', 0, 0), &CPDF_StreamContentParser::Handle_MarkPlace},
+ {FXBSTR_ID('Q', 0, 0, 0), &CPDF_StreamContentParser::Handle_RestoreGraphState},
+ {FXBSTR_ID('R', 'G', 0, 0), &CPDF_StreamContentParser::Handle_SetRGBColor_Stroke},
+ {FXBSTR_ID('S', 0, 0, 0), &CPDF_StreamContentParser::Handle_StrokePath},
+ {FXBSTR_ID('S', 'C', 0, 0), &CPDF_StreamContentParser::Handle_SetColor_Stroke},
+ {FXBSTR_ID('S', 'C', 'N', 0), &CPDF_StreamContentParser::Handle_SetColorPS_Stroke},
+ {FXBSTR_ID('T', '*', 0, 0), &CPDF_StreamContentParser::Handle_MoveToNextLine},
+ {FXBSTR_ID('T', 'D', 0, 0), &CPDF_StreamContentParser::Handle_MoveTextPoint_SetLeading},
+ {FXBSTR_ID('T', 'J', 0, 0), &CPDF_StreamContentParser::Handle_ShowText_Positioning},
+ {FXBSTR_ID('T', 'L', 0, 0), &CPDF_StreamContentParser::Handle_SetTextLeading},
+ {FXBSTR_ID('T', 'c', 0, 0), &CPDF_StreamContentParser::Handle_SetCharSpace},
+ {FXBSTR_ID('T', 'd', 0, 0), &CPDF_StreamContentParser::Handle_MoveTextPoint},
+ {FXBSTR_ID('T', 'f', 0, 0), &CPDF_StreamContentParser::Handle_SetFont},
+ {FXBSTR_ID('T', 'j', 0, 0), &CPDF_StreamContentParser::Handle_ShowText},
+ {FXBSTR_ID('T', 'm', 0, 0), &CPDF_StreamContentParser::Handle_SetTextMatrix},
+ {FXBSTR_ID('T', 'r', 0, 0), &CPDF_StreamContentParser::Handle_SetTextRenderMode},
+ {FXBSTR_ID('T', 's', 0, 0), &CPDF_StreamContentParser::Handle_SetTextRise},
+ {FXBSTR_ID('T', 'w', 0, 0), &CPDF_StreamContentParser::Handle_SetWordSpace},
+ {FXBSTR_ID('T', 'z', 0, 0), &CPDF_StreamContentParser::Handle_SetHorzScale},
+ {FXBSTR_ID('W', 0, 0, 0), &CPDF_StreamContentParser::Handle_Clip},
+ {FXBSTR_ID('W', '*', 0, 0), &CPDF_StreamContentParser::Handle_EOClip},
+ {FXBSTR_ID('b', 0, 0, 0), &CPDF_StreamContentParser::Handle_CloseFillStrokePath},
+ {FXBSTR_ID('b', '*', 0, 0), &CPDF_StreamContentParser::Handle_CloseEOFillStrokePath},
+ {FXBSTR_ID('c', 0, 0, 0), &CPDF_StreamContentParser::Handle_CurveTo_123},
+ {FXBSTR_ID('c', 'm', 0, 0), &CPDF_StreamContentParser::Handle_ConcatMatrix},
+ {FXBSTR_ID('c', 's', 0, 0), &CPDF_StreamContentParser::Handle_SetColorSpace_Fill},
+ {FXBSTR_ID('d', 0, 0, 0), &CPDF_StreamContentParser::Handle_SetDash},
+ {FXBSTR_ID('d', '0', 0, 0), &CPDF_StreamContentParser::Handle_SetCharWidth},
+ {FXBSTR_ID('d', '1', 0, 0), &CPDF_StreamContentParser::Handle_SetCachedDevice},
+ {FXBSTR_ID('f', 0, 0, 0), &CPDF_StreamContentParser::Handle_FillPath},
+ {FXBSTR_ID('f', '*', 0, 0), &CPDF_StreamContentParser::Handle_EOFillPath},
+ {FXBSTR_ID('g', 0, 0, 0), &CPDF_StreamContentParser::Handle_SetGray_Fill},
+ {FXBSTR_ID('g', 's', 0, 0), &CPDF_StreamContentParser::Handle_SetExtendGraphState},
+ {FXBSTR_ID('h', 0, 0, 0), &CPDF_StreamContentParser::Handle_ClosePath},
+ {FXBSTR_ID('i', 0, 0, 0), &CPDF_StreamContentParser::Handle_SetFlat},
+ {FXBSTR_ID('j', 0, 0, 0), &CPDF_StreamContentParser::Handle_SetLineJoin},
+ {FXBSTR_ID('k', 0, 0, 0), &CPDF_StreamContentParser::Handle_SetCMYKColor_Fill},
+ {FXBSTR_ID('l', 0, 0, 0), &CPDF_StreamContentParser::Handle_LineTo},
+ {FXBSTR_ID('m', 0, 0, 0), &CPDF_StreamContentParser::Handle_MoveTo},
+ {FXBSTR_ID('n', 0, 0, 0), &CPDF_StreamContentParser::Handle_EndPath},
+ {FXBSTR_ID('q', 0, 0, 0), &CPDF_StreamContentParser::Handle_SaveGraphState},
+ {FXBSTR_ID('r', 'e', 0, 0), &CPDF_StreamContentParser::Handle_Rectangle},
+ {FXBSTR_ID('r', 'g', 0, 0), &CPDF_StreamContentParser::Handle_SetRGBColor_Fill},
+ {FXBSTR_ID('r', 'i', 0, 0), &CPDF_StreamContentParser::Handle_SetRenderIntent},
+ {FXBSTR_ID('s', 0, 0, 0), &CPDF_StreamContentParser::Handle_CloseStrokePath},
+ {FXBSTR_ID('s', 'c', 0, 0), &CPDF_StreamContentParser::Handle_SetColor_Fill},
+ {FXBSTR_ID('s', 'c', 'n', 0), &CPDF_StreamContentParser::Handle_SetColorPS_Fill},
+ {FXBSTR_ID('s', 'h', 0, 0), &CPDF_StreamContentParser::Handle_ShadeFill},
+ {FXBSTR_ID('v', 0, 0, 0), &CPDF_StreamContentParser::Handle_CurveTo_23},
+ {FXBSTR_ID('w', 0, 0, 0), &CPDF_StreamContentParser::Handle_SetLineWidth},
+ {FXBSTR_ID('y', 0, 0, 0), &CPDF_StreamContentParser::Handle_CurveTo_13},
+};
+FX_BOOL CPDF_StreamContentParser::OnOperator(FX_LPCSTR op)
+{
+ int i = 0;
+ FX_DWORD opid = 0;
+ while (i < 4 && op[i]) {
+ opid = (opid << 8) + op[i];
+ i ++;
+ }
+ while (i < 4) {
+ opid <<= 8;
+ i ++;
+ };
+ int low = 0, high = sizeof g_OpCodes / sizeof(struct _OpCode) - 1;
+ while (low <= high) {
+ int middle = (low + high) / 2;
+ int compare = opid - g_OpCodes[middle].m_OpId;
+ if (compare == 0) {
+ (this->*g_OpCodes[middle].m_OpHandler)();
+ return TRUE;
+ } else if (compare < 0) {
+ high = middle - 1;
+ } else {
+ low = middle + 1;
+ }
+ }
+ return m_CompatCount != 0;
+}
+void CPDF_StreamContentParser::Handle_CloseFillStrokePath()
+{
+ if (m_Options.m_bTextOnly) {
+ return;
+ }
+ Handle_ClosePath();
+ AddPathObject(FXFILL_WINDING, TRUE);
+}
+void CPDF_StreamContentParser::Handle_FillStrokePath()
+{
+ if (m_Options.m_bTextOnly) {
+ return;
+ }
+ AddPathObject(FXFILL_WINDING, TRUE);
+}
+void CPDF_StreamContentParser::Handle_CloseEOFillStrokePath()
+{
+ if (m_Options.m_bTextOnly) {
+ return;
+ }
+ AddPathPoint(m_PathStartX, m_PathStartY, FXPT_LINETO | FXPT_CLOSEFIGURE);
+ AddPathObject(FXFILL_ALTERNATE, TRUE);
+}
+void CPDF_StreamContentParser::Handle_EOFillStrokePath()
+{
+ if (m_Options.m_bTextOnly) {
+ return;
+ }
+ AddPathObject(FXFILL_ALTERNATE, TRUE);
+}
+void CPDF_StreamContentParser::Handle_BeginMarkedContent_Dictionary()
+{
+ if (!m_Options.m_bMarkedContent) {
+ return;
+ }
+ CFX_ByteString tag = GetString(1);
+ CPDF_Object* pProperty = GetObject(0);
+ if (pProperty == NULL) {
+ return;
+ }
+ FX_BOOL bDirect = TRUE;
+ if (pProperty->GetType() == PDFOBJ_NAME) {
+ pProperty = FindResourceObj(FX_BSTRC("Properties"), pProperty->GetString());
+ if (pProperty == NULL) {
+ return;
+ }
+ bDirect = FALSE;
+ }
+ if (pProperty->GetType() != PDFOBJ_DICTIONARY) {
+ return;
+ }
+ m_CurContentMark.GetModify()->AddMark(tag, (CPDF_Dictionary*)pProperty, bDirect);
+}
+void CPDF_StreamContentParser::Handle_BeginMarkedContent()
+{
+ if (!m_Options.m_bMarkedContent) {
+ return;
+ }
+ CFX_ByteString tag = GetString(0);
+ m_CurContentMark.GetModify()->AddMark(tag, NULL, FALSE);
+}
+struct _FX_BSTR {
+ FX_LPCSTR m_Ptr;
+ int m_Size;
+};
+#define _FX_BSTRC(str) {str, sizeof(str)-1}
+const _FX_BSTR _PDF_InlineKeyAbbr[] = {
+ _FX_BSTRC("BitsPerComponent"), _FX_BSTRC("BPC"),
+ _FX_BSTRC("ColorSpace"), _FX_BSTRC("CS"),
+ _FX_BSTRC("Decode"), _FX_BSTRC("D"),
+ _FX_BSTRC("DecodeParms"), _FX_BSTRC("DP"),
+ _FX_BSTRC("Filter"), _FX_BSTRC("F"),
+ _FX_BSTRC("Height"), _FX_BSTRC("H"),
+ _FX_BSTRC("ImageMask"), _FX_BSTRC("IM"),
+ _FX_BSTRC("Interpolate"), _FX_BSTRC("I"),
+ _FX_BSTRC("Width"), _FX_BSTRC("W"),
+};
+const _FX_BSTR _PDF_InlineValueAbbr[] = {
+ _FX_BSTRC("DeviceGray"), _FX_BSTRC("G"),
+ _FX_BSTRC("DeviceRGB"), _FX_BSTRC("RGB"),
+ _FX_BSTRC("DeviceCMYK"), _FX_BSTRC("CMYK"),
+ _FX_BSTRC("Indexed"), _FX_BSTRC("I"),
+ _FX_BSTRC("ASCIIHexDecode"), _FX_BSTRC("AHx"),
+ _FX_BSTRC("ASCII85Decode"), _FX_BSTRC("A85"),
+ _FX_BSTRC("LZWDecode"), _FX_BSTRC("LZW"),
+ _FX_BSTRC("FlateDecode"), _FX_BSTRC("Fl"),
+ _FX_BSTRC("RunLengthDecode"), _FX_BSTRC("RL"),
+ _FX_BSTRC("CCITTFaxDecode"), _FX_BSTRC("CCF"),
+ _FX_BSTRC("DCTDecode"), _FX_BSTRC("DCT"),
+};
+static CFX_ByteStringC _PDF_FindFullName(const _FX_BSTR* table, int count, FX_BSTR abbr)
+{
+ int i = 0;
+ while (i < count) {
+ if (abbr.GetLength() == table[i + 1].m_Size && FXSYS_memcmp32(abbr.GetPtr(), table[i + 1].m_Ptr, abbr.GetLength()) == 0) {
+ return CFX_ByteStringC(table[i].m_Ptr, table[i].m_Size);
+ }
+ i += 2;
+ }
+ return CFX_ByteStringC();
+}
+void _PDF_ReplaceAbbr(CPDF_Object* pObj)
+{
+ switch (pObj->GetType()) {
+ case PDFOBJ_DICTIONARY: {
+ CPDF_Dictionary* pDict = (CPDF_Dictionary*)pObj;
+ FX_POSITION pos = pDict->GetStartPos();
+ while (pos) {
+ CFX_ByteString key;
+ CPDF_Object* value = pDict->GetNextElement(pos, key);
+ CFX_ByteStringC fullname = _PDF_FindFullName(_PDF_InlineKeyAbbr,
+ sizeof _PDF_InlineKeyAbbr / sizeof(_FX_BSTR), key);
+ if (!fullname.IsEmpty()) {
+ pDict->ReplaceKey(key, fullname);
+ key = fullname;
+ }
+ if (value->GetType() == PDFOBJ_NAME) {
+ CFX_ByteString name = value->GetString();
+ fullname = _PDF_FindFullName(_PDF_InlineValueAbbr,
+ sizeof _PDF_InlineValueAbbr / sizeof(_FX_BSTR), name);
+ if (!fullname.IsEmpty()) {
+ pDict->SetAtName(key, fullname);
+ }
+ } else {
+ _PDF_ReplaceAbbr(value);
+ }
+ }
+ break;
+ }
+ case PDFOBJ_ARRAY: {
+ CPDF_Array* pArray = (CPDF_Array*)pObj;
+ for (FX_DWORD i = 0; i < pArray->GetCount(); i ++) {
+ CPDF_Object* pElement = pArray->GetElement(i);
+ if (pElement->GetType() == PDFOBJ_NAME) {
+ CFX_ByteString name = pElement->GetString();
+ CFX_ByteStringC fullname = _PDF_FindFullName(_PDF_InlineValueAbbr,
+ sizeof _PDF_InlineValueAbbr / sizeof(_FX_BSTR), name);
+ if (!fullname.IsEmpty()) {
+ pArray->SetAt(i, CPDF_Name::Create(fullname));
+ }
+ } else {
+ _PDF_ReplaceAbbr(pElement);
+ }
+ }
+ break;
+ }
+ }
+}
+static CFX_ByteStringC _PDF_FindAbbrName(const _FX_BSTR* table, int count, FX_BSTR fullName)
+{
+ int i = 0;
+ while (i < count) {
+ if (fullName.GetLength() == table[i].m_Size && FXSYS_memcmp32(fullName.GetPtr(), table[i].m_Ptr, fullName.GetLength()) == 0) {
+ return CFX_ByteStringC(table[i + 1].m_Ptr, table[i + 1].m_Size);
+ }
+ i += 2;
+ }
+ return CFX_ByteStringC();
+}
+void _PDF_ReplaceFull(CPDF_Object* pObj)
+{
+ switch (pObj->GetType()) {
+ case PDFOBJ_DICTIONARY: {
+ CPDF_Dictionary* pDict = (CPDF_Dictionary*)pObj;
+ FX_POSITION pos = pDict->GetStartPos();
+ while (pos) {
+ CFX_ByteString key;
+ CPDF_Object* value = pDict->GetNextElement(pos, key);
+ CFX_ByteStringC abbrName = _PDF_FindAbbrName(_PDF_InlineKeyAbbr,
+ sizeof(_PDF_InlineKeyAbbr) / sizeof(_FX_BSTR), key);
+ if (!abbrName.IsEmpty()) {
+ pDict->ReplaceKey(key, abbrName);
+ key = abbrName;
+ }
+ if (value->GetType() == PDFOBJ_NAME) {
+ CFX_ByteString name = value->GetString();
+ abbrName = _PDF_FindAbbrName(_PDF_InlineValueAbbr,
+ sizeof(_PDF_InlineValueAbbr) / sizeof(_FX_BSTR), name);
+ if (!abbrName.IsEmpty()) {
+ pDict->SetAtName(key, abbrName);
+ }
+ } else {
+ _PDF_ReplaceFull(value);
+ }
+ }
+ break;
+ }
+ case PDFOBJ_ARRAY: {
+ CPDF_Array* pArray = (CPDF_Array*)pObj;
+ for (FX_DWORD i = 0; i < pArray->GetCount(); i ++) {
+ CPDF_Object* pElement = pArray->GetElement(i);
+ if (pElement->GetType() == PDFOBJ_NAME) {
+ CFX_ByteString name = pElement->GetString();
+ CFX_ByteStringC abbrName = _PDF_FindAbbrName(_PDF_InlineValueAbbr,
+ sizeof _PDF_InlineValueAbbr / sizeof(_FX_BSTR), name);
+ if (!abbrName.IsEmpty()) {
+ pArray->SetAt(i, CPDF_Name::Create(abbrName));
+ }
+ } else {
+ _PDF_ReplaceFull(pElement);
+ }
+ }
+ break;
+ }
+ }
+}
+void CPDF_StreamContentParser::Handle_BeginText()
+{
+ m_pCurStates->m_TextMatrix.Set(1.0f, 0, 0, 1.0f, 0, 0);
+ OnChangeTextMatrix();
+ m_pCurStates->m_TextX = 0;
+ m_pCurStates->m_TextY = 0;
+ m_pCurStates->m_TextLineX = 0;
+ m_pCurStates->m_TextLineY = 0;
+}
+void CPDF_StreamContentParser::Handle_BeginSectionUndefined()
+{
+ m_CompatCount ++;
+}
+void CPDF_StreamContentParser::Handle_CurveTo_123()
+{
+ if (m_Options.m_bTextOnly) {
+ return;
+ }
+ AddPathPoint(GetNumber(5), GetNumber(4), FXPT_BEZIERTO);
+ AddPathPoint(GetNumber(3), GetNumber(2), FXPT_BEZIERTO);
+ AddPathPoint(GetNumber(1), GetNumber(0), FXPT_BEZIERTO);
+}
+void CPDF_StreamContentParser::Handle_ConcatMatrix()
+{
+ FX_FLOAT a2 = GetNumber16(5), b2 = GetNumber16(4), c2 = GetNumber16(3), d2 = GetNumber16(2);
+ FX_FLOAT e2 = GetNumber(1), f2 = GetNumber(0);
+ FX_FLOAT old_width_scale = m_pCurStates->m_CTM.GetXUnit();
+ CFX_AffineMatrix new_matrix(a2, b2, c2, d2, e2, f2);
+ new_matrix.Concat(m_pCurStates->m_CTM);
+ m_pCurStates->m_CTM = new_matrix;
+ FX_FLOAT new_width_scale = m_pCurStates->m_CTM.GetXUnit();
+ OnChangeTextMatrix();
+}
+void CPDF_StreamContentParser::Handle_SetColorSpace_Fill()
+{
+ if (m_Options.m_bTextOnly) {
+ return;
+ }
+ CFX_ByteString csname = GetString(0);
+ CPDF_ColorSpace* pCS = FindColorSpace(csname);
+ if (pCS == NULL) {
+ return;
+ }
+ m_pCurStates->m_ColorState.GetModify()->m_FillColor.SetColorSpace(pCS);
+}
+void CPDF_StreamContentParser::Handle_SetColorSpace_Stroke()
+{
+ if (m_Options.m_bTextOnly) {
+ return;
+ }
+ CFX_ByteString csname = GetString(0);
+ CPDF_ColorSpace* pCS = FindColorSpace(csname);
+ if (pCS == NULL) {
+ return;
+ }
+ m_pCurStates->m_ColorState.GetModify()->m_StrokeColor.SetColorSpace(pCS);
+}
+void CPDF_StreamContentParser::Handle_SetDash()
+{
+ if (m_Options.m_bTextOnly) {
+ return;
+ }
+ CPDF_Array* pArray = GetObject(1)->GetArray();
+ if (pArray == NULL) {
+ return;
+ }
+ m_pCurStates->SetLineDash(pArray, GetNumber(0), 1.0f);
+}
+void CPDF_StreamContentParser::Handle_SetCharWidth()
+{
+ m_Type3Data[0] = GetNumber(1);
+ m_Type3Data[1] = GetNumber(0);
+ m_bColored = TRUE;
+}
+void CPDF_StreamContentParser::Handle_SetCachedDevice()
+{
+ for (int i = 0; i < 6; i ++) {
+ m_Type3Data[i] = GetNumber(5 - i);
+ }
+ m_bColored = FALSE;
+}
+void CPDF_StreamContentParser::Handle_ExecuteXObject()
+{
+ CFX_ByteString name = GetString(0);
+ if (name == m_LastImageName && m_pLastImage && m_pLastImage->GetStream() && m_pLastImage->GetStream()->GetObjNum()) {
+#if defined(_FPDFAPI_MINI_) && !defined(_FXCORE_FEATURE_ALL_)
+ AddDuplicateImage();
+#else
+ AddImage(NULL, m_pLastImage, FALSE);
+#endif
+ return;
+ }
+ if (m_Options.m_bTextOnly) {
+ CPDF_Object* pRes = NULL;
+ if (m_pResources == NULL) {
+ return;
+ }
+ if (m_pResources == m_pPageResources) {
+ CPDF_Dictionary* pList = m_pResources->GetDict(FX_BSTRC("XObject"));
+ if (pList == NULL) {
+ return;
+ }
+ pRes = pList->GetElement(name);
+ if (pRes == NULL || pRes->GetType() != PDFOBJ_REFERENCE) {
+ return;
+ }
+ } else {
+ CPDF_Dictionary* pList = m_pResources->GetDict(FX_BSTRC("XObject"));
+ if (pList == NULL) {
+ if (m_pPageResources == NULL) {
+ return;
+ }
+ CPDF_Dictionary* pList = m_pPageResources->GetDict(FX_BSTRC("XObject"));
+ if (pList == NULL) {
+ return;
+ }
+ pRes = pList->GetElement(name);
+ if (pRes == NULL || pRes->GetType() != PDFOBJ_REFERENCE) {
+ return;
+ }
+ } else {
+ pRes = pList->GetElement(name);
+ if (pRes == NULL || pRes->GetType() != PDFOBJ_REFERENCE) {
+ return;
+ }
+ }
+ }
+ FX_BOOL bForm;
+ if (m_pDocument->IsFormStream(((CPDF_Reference*)pRes)->GetRefObjNum(), bForm) && !bForm) {
+ return;
+ }
+ }
+ CPDF_Stream* pXObject = (CPDF_Stream*)FindResourceObj(FX_BSTRC("XObject"), name);
+ if (pXObject == NULL || pXObject->GetType() != PDFOBJ_STREAM) {
+ m_bResourceMissing = TRUE;
+ return;
+ }
+ CFX_ByteStringC type = pXObject->GetDict()->GetConstString(FX_BSTRC("Subtype"));
+ if (type == FX_BSTRC("Image")) {
+ if (m_Options.m_bTextOnly) {
+ return;
+ }
+ CPDF_ImageObject* pObj = AddImage(pXObject, NULL, FALSE);
+ m_LastImageName = name;
+ m_pLastImage = pObj->m_pImage;
+ } else if (type == FX_BSTRC("Form")) {
+ AddForm(pXObject);
+ } else {
+ return;
+ }
+}
+void CPDF_StreamContentParser::AddForm(CPDF_Stream* pStream)
+{
+#if !defined(_FPDFAPI_MINI_) || defined(_FXCORE_FEATURE_ALL_)
+ if (!m_Options.m_bSeparateForm) {
+ CPDF_Dictionary* pResources = pStream->GetDict()->GetDict(FX_BSTRC("Resources"));
+ CFX_AffineMatrix form_matrix = pStream->GetDict()->GetMatrix(FX_BSTRC("Matrix"));
+ form_matrix.Concat(m_pCurStates->m_CTM);
+ CPDF_Array* pBBox = pStream->GetDict()->GetArray(FX_BSTRC("BBox"));
+ CFX_FloatRect form_bbox;
+ CPDF_Path ClipPath;
+ if (pBBox) {
+ form_bbox = pStream->GetDict()->GetRect(FX_BSTRC("BBox"));
+ ClipPath.New();
+ ClipPath.AppendRect(form_bbox.left, form_bbox.bottom, form_bbox.right, form_bbox.top);
+ ClipPath.Transform(&form_matrix);
+ form_bbox.Transform(&form_matrix);
+ }
+ CPDF_StreamContentParser parser;
+ parser.Initialize();
+ parser.PrepareParse(m_pDocument, m_pPageResources, m_pResources, &m_mtContentToUser,
+ m_pObjectList, pResources, &form_bbox, &m_Options, m_pCurStates, m_Level + 1);
+ parser.m_pCurStates->m_CTM = form_matrix;
+ if (ClipPath.NotNull()) {
+ parser.m_pCurStates->m_ClipPath.AppendPath(ClipPath, FXFILL_WINDING, TRUE);
+ }
+ CPDF_StreamAcc stream;
+ stream.LoadAllData(pStream, FALSE);
+ if (stream.GetSize() == 0) {
+ return;
+ }
+#ifdef _FPDFAPI_MINI_
+ parser.InputData(stream.GetData(), stream.GetSize());
+ parser.Finish();
+#else
+ parser.Parse(stream.GetData(), stream.GetSize(), 0);
+#endif
+ return;
+ }
+#endif
+ CPDF_FormObject* pFormObj = FX_NEW CPDF_FormObject;
+ pFormObj->m_pForm = FX_NEW CPDF_Form(m_pDocument, m_pPageResources, pStream, m_pResources);
+ pFormObj->m_FormMatrix = m_pCurStates->m_CTM;
+ pFormObj->m_FormMatrix.Concat(m_mtContentToUser);
+ CPDF_AllStates status;
+ status.m_GeneralState = m_pCurStates->m_GeneralState;
+ status.m_GraphState = m_pCurStates->m_GraphState;
+ status.m_ColorState = m_pCurStates->m_ColorState;
+ status.m_TextState = m_pCurStates->m_TextState;
+ pFormObj->m_pForm->ParseContent(&status, NULL, NULL, &m_Options, m_Level + 1);
+ if (!m_pObjectList->m_bBackgroundAlphaNeeded && pFormObj->m_pForm->m_bBackgroundAlphaNeeded) {
+ m_pObjectList->m_bBackgroundAlphaNeeded = TRUE;
+ }
+ pFormObj->CalcBoundingBox();
+ SetGraphicStates(pFormObj, TRUE, TRUE, TRUE);
+ m_pObjectList->m_ObjectList.AddTail(pFormObj);
+}
+#if defined(_FPDFAPI_MINI_) && !defined(_FXCORE_FEATURE_ALL_)
+void CPDF_StreamContentParser::AddDuplicateImage()
+{
+ FX_POSITION tailpos = m_pObjectList->m_ObjectList.GetTailPosition();
+ CPDF_PageObject* pLastObj = (CPDF_PageObject*)m_pObjectList->m_ObjectList.GetAt(tailpos);
+ if (pLastObj == NULL || (pLastObj->m_Type != PDFPAGE_INLINES && pLastObj->m_Type != PDFPAGE_IMAGE)) {
+ AddImage(NULL, m_pLastImage, FALSE);
+ return;
+ }
+ if (pLastObj->m_GeneralState != m_pCurStates->m_GeneralState ||
+ pLastObj->m_ClipPath != m_pCurStates->m_ClipPath ||
+ pLastObj->m_ColorState != m_pCurStates->m_ColorState) {
+ AddImage(NULL, m_pLastImage, FALSE);
+ return;
+ }
+ CFX_AffineMatrix ImageMatrix;
+ ImageMatrix.Copy(m_pCurStates->m_CTM);
+ ImageMatrix.Concat(m_mtContentToUser);
+ if (pLastObj->m_Type == PDFPAGE_INLINES) {
+ CPDF_InlineImages* pInlines = (CPDF_InlineImages*)pLastObj;
+ if (pInlines->m_pStream != m_pLastImage->GetStream()) {
+ AddImage(NULL, m_pLastImage, FALSE);
+ return;
+ }
+ pInlines->AddMatrix(ImageMatrix);
+ } else {
+ CPDF_ImageObject* pImageObj = (CPDF_ImageObject*)pLastObj;
+ CPDF_InlineImages* pInlines = FX_NEW CPDF_InlineImages;
+ pInlines->m_pStream = m_pLastImage->GetStream();
+ SetGraphicStates(pInlines, !pInlines->m_pStream->GetDict()->KeyExist(FX_BSTRC("ColorSpace")), FALSE, FALSE);
+ pInlines->AddMatrix(pImageObj->m_Matrix);
+ pInlines->AddMatrix(ImageMatrix);
+ m_pObjectList->m_ObjectList.RemoveAt(tailpos);
+ m_pObjectList->m_ObjectList.AddTail(pInlines);
+ pLastObj->Release();
+ }
+}
+#endif
+CPDF_ImageObject* CPDF_StreamContentParser::AddImage(CPDF_Stream* pStream, CPDF_Image* pImage, FX_BOOL bInline)
+{
+ if (pStream == NULL && pImage == NULL) {
+ return NULL;
+ }
+ CFX_AffineMatrix ImageMatrix;
+ ImageMatrix.Copy(m_pCurStates->m_CTM);
+ ImageMatrix.Concat(m_mtContentToUser);
+ CPDF_ImageObject* pImageObj = FX_NEW CPDF_ImageObject;
+ if (pImage) {
+ pImageObj->m_pImage = m_pDocument->GetPageData()->GetImage(pImage->GetStream());
+ } else if (pStream->GetObjNum()) {
+ pImageObj->m_pImage = m_pDocument->LoadImageF(pStream);
+ } else {
+ pImageObj->m_pImage = FX_NEW CPDF_Image(m_pDocument);
+ pImageObj->m_pImage->LoadImageF(pStream, bInline);
+ }
+ SetGraphicStates(pImageObj, pImageObj->m_pImage->IsMask(), FALSE, FALSE);
+ pImageObj->m_Matrix = ImageMatrix;
+ pImageObj->CalcBoundingBox();
+ m_pObjectList->m_ObjectList.AddTail(pImageObj);
+ return pImageObj;
+}
+void CPDF_StreamContentParser::Handle_MarkPlace_Dictionary()
+{
+}
+void CPDF_StreamContentParser::Handle_EndImage()
+{
+}
+void CPDF_StreamContentParser::Handle_EndMarkedContent()
+{
+ if (!m_Options.m_bMarkedContent) {
+ return;
+ }
+ if (m_CurContentMark.IsNull()) {
+ return;
+ }
+ int count = m_CurContentMark.GetObject()->CountItems();
+ if (count == 1) {
+ m_CurContentMark.SetNull();
+ return;
+ }
+ m_CurContentMark.GetModify()->DeleteLastMark();
+}
+void CPDF_StreamContentParser::Handle_EndText()
+{
+ int count = m_ClipTextList.GetSize();
+ if (count == 0) {
+ return;
+ }
+ if (m_pCurStates->m_TextState.GetObject()->m_TextMode < 4) {
+ for (int i = 0; i < count; i ++) {
+ CPDF_TextObject* pText = (CPDF_TextObject*)m_ClipTextList.GetAt(i);
+ if (pText) {
+ delete pText;
+ }
+ }
+ } else {
+ m_pCurStates->m_ClipPath.AppendTexts((CPDF_TextObject**)m_ClipTextList.GetData(), count);
+ }
+ m_ClipTextList.RemoveAll();
+}
+void CPDF_StreamContentParser::Handle_EndSectionUndefined()
+{
+ if (m_CompatCount) {
+ m_CompatCount --;
+ }
+}
+void CPDF_StreamContentParser::Handle_FillPath()
+{
+ if (m_Options.m_bTextOnly) {
+ return;
+ }
+ AddPathObject(FXFILL_WINDING, FALSE);
+}
+void CPDF_StreamContentParser::Handle_FillPathOld()
+{
+ if (m_Options.m_bTextOnly) {
+ return;
+ }
+ AddPathObject(FXFILL_WINDING, FALSE);
+}
+void CPDF_StreamContentParser::Handle_EOFillPath()
+{
+ if (m_Options.m_bTextOnly) {
+ return;
+ }
+ AddPathObject(FXFILL_ALTERNATE, FALSE);
+}
+void CPDF_StreamContentParser::Handle_SetGray_Fill()
+{
+ FX_FLOAT value = GetNumber(0);
+ CPDF_ColorSpace* pCS = CPDF_ColorSpace::GetStockCS(PDFCS_DEVICEGRAY);
+ m_pCurStates->m_ColorState.SetFillColor(pCS, &value, 1);
+}
+void CPDF_StreamContentParser::Handle_SetGray_Stroke()
+{
+ FX_FLOAT value = GetNumber(0);
+ CPDF_ColorSpace* pCS = CPDF_ColorSpace::GetStockCS(PDFCS_DEVICEGRAY);
+ m_pCurStates->m_ColorState.SetStrokeColor(pCS, &value, 1);
+}
+void CPDF_StreamContentParser::Handle_SetExtendGraphState()
+{
+ CFX_ByteString name = GetString(0);
+ CPDF_Dictionary* pGS = (CPDF_Dictionary*)FindResourceObj(FX_BSTRC("ExtGState"), name);
+ if (pGS == NULL || pGS->GetType() != PDFOBJ_DICTIONARY) {
+ m_bResourceMissing = TRUE;
+ return;
+ }
+ m_pCurStates->ProcessExtGS(pGS, this);
+}
+void CPDF_StreamContentParser::Handle_ClosePath()
+{
+ if (m_Options.m_bTextOnly) {
+ return;
+ }
+ if (m_PathPointCount == 0) {
+ return;
+ }
+ if (m_PathStartX != m_PathCurrentX || m_PathStartY != m_PathCurrentY) {
+ AddPathPoint(m_PathStartX, m_PathStartY, FXPT_LINETO | FXPT_CLOSEFIGURE);
+ } else if (m_pPathPoints[m_PathPointCount - 1].m_Flag != FXPT_MOVETO) {
+ m_pPathPoints[m_PathPointCount - 1].m_Flag |= FXPT_CLOSEFIGURE;
+ }
+}
+void CPDF_StreamContentParser::Handle_SetFlat()
+{
+#if !defined(_FPDFAPI_MINI_) || defined(_FXCORE_FEATURE_ALL_)
+ m_pCurStates->m_GeneralState.GetModify()->m_Flatness = GetNumber(0);
+#endif
+}
+void CPDF_StreamContentParser::Handle_BeginImageData()
+{
+}
+void CPDF_StreamContentParser::Handle_SetLineJoin()
+{
+ m_pCurStates->m_GraphState.GetModify()->m_LineJoin = (CFX_GraphStateData::LineJoin)GetInteger(0);
+}
+void CPDF_StreamContentParser::Handle_SetLineCap()
+{
+ m_pCurStates->m_GraphState.GetModify()->m_LineCap = (CFX_GraphStateData::LineCap)GetInteger(0);
+}
+void CPDF_StreamContentParser::Handle_SetCMYKColor_Fill()
+{
+ REQUIRE_PARAMS(4);
+ FX_FLOAT values[4];
+ for (int i = 0; i < 4; i ++) {
+ values[i] = GetNumber(3 - i);
+ }
+ CPDF_ColorSpace* pCS = CPDF_ColorSpace::GetStockCS(PDFCS_DEVICECMYK);
+ m_pCurStates->m_ColorState.SetFillColor(pCS, values, 4);
+}
+void CPDF_StreamContentParser::Handle_SetCMYKColor_Stroke()
+{
+ REQUIRE_PARAMS(4);
+ FX_FLOAT values[4];
+ for (int i = 0; i < 4; i ++) {
+ values[i] = GetNumber(3 - i);
+ }
+ CPDF_ColorSpace* pCS = CPDF_ColorSpace::GetStockCS(PDFCS_DEVICECMYK);
+ m_pCurStates->m_ColorState.SetStrokeColor(pCS, values, 4);
+}
+void CPDF_StreamContentParser::Handle_LineTo()
+{
+ REQUIRE_PARAMS(2);
+ if (m_Options.m_bTextOnly) {
+ return;
+ }
+ AddPathPoint(GetNumber(1), GetNumber(0), FXPT_LINETO);
+}
+void CPDF_StreamContentParser::Handle_MoveTo()
+{
+ REQUIRE_PARAMS(2);
+ if (m_Options.m_bTextOnly) {
+#ifndef _FPDFAPI_MINI_
+ m_pSyntax->SkipPathObject();
+#endif
+ return;
+ }
+ AddPathPoint(GetNumber(1), GetNumber(0), FXPT_MOVETO);
+#ifndef _FPDFAPI_MINI_
+ ParsePathObject();
+#endif
+}
+void CPDF_StreamContentParser::Handle_SetMiterLimit()
+{
+ m_pCurStates->m_GraphState.GetModify()->m_MiterLimit = GetNumber(0);
+}
+void CPDF_StreamContentParser::Handle_MarkPlace()
+{
+}
+void CPDF_StreamContentParser::Handle_EndPath()
+{
+ if (m_Options.m_bTextOnly) {
+ return;
+ }
+ AddPathObject(0, FALSE);
+}
+void CPDF_StreamContentParser::Handle_SaveGraphState()
+{
+ CPDF_AllStates* pStates = FX_NEW CPDF_AllStates;
+ pStates->Copy(*m_pCurStates);
+ m_StateStack.Add(pStates);
+}
+void CPDF_StreamContentParser::Handle_RestoreGraphState()
+{
+ int size = m_StateStack.GetSize();
+ if (size == 0) {
+ return;
+ }
+ CPDF_AllStates* pStates = (CPDF_AllStates*)m_StateStack.GetAt(size - 1);
+ m_pCurStates->Copy(*pStates);
+ delete pStates;
+ m_StateStack.RemoveAt(size - 1);
+}
+void CPDF_StreamContentParser::Handle_Rectangle()
+{
+ if (m_Options.m_bTextOnly) {
+ return;
+ }
+ FX_FLOAT x = GetNumber(3), y = GetNumber(2);
+ FX_FLOAT w = GetNumber(1), h = GetNumber(0);
+ AddPathRect(x, y, w, h);
+}
+void CPDF_StreamContentParser::AddPathRect(FX_FLOAT x, FX_FLOAT y, FX_FLOAT w, FX_FLOAT h)
+{
+ AddPathPoint(x, y, FXPT_MOVETO);
+ AddPathPoint(x + w, y, FXPT_LINETO);
+ AddPathPoint(x + w, y + h, FXPT_LINETO);
+ AddPathPoint(x, y + h, FXPT_LINETO);
+ AddPathPoint(x, y, FXPT_LINETO | FXPT_CLOSEFIGURE);
+}
+void CPDF_StreamContentParser::Handle_SetRGBColor_Fill()
+{
+ REQUIRE_PARAMS(3);
+ FX_FLOAT values[3];
+ for (int i = 0; i < 3; i ++) {
+ values[i] = GetNumber(2 - i);
+ }
+ CPDF_ColorSpace* pCS = CPDF_ColorSpace::GetStockCS(PDFCS_DEVICERGB);
+ m_pCurStates->m_ColorState.SetFillColor(pCS, values, 3);
+}
+void CPDF_StreamContentParser::Handle_SetRGBColor_Stroke()
+{
+ REQUIRE_PARAMS(3);
+ FX_FLOAT values[3];
+ for (int i = 0; i < 3; i ++) {
+ values[i] = GetNumber(2 - i);
+ }
+ CPDF_ColorSpace* pCS = CPDF_ColorSpace::GetStockCS(PDFCS_DEVICERGB);
+ m_pCurStates->m_ColorState.SetStrokeColor(pCS, values, 3);
+}
+void CPDF_StreamContentParser::Handle_SetRenderIntent()
+{
+}
+void CPDF_StreamContentParser::Handle_CloseStrokePath()
+{
+ if (m_Options.m_bTextOnly) {
+ return;
+ }
+ Handle_ClosePath();
+ AddPathObject(0, TRUE);
+}
+void CPDF_StreamContentParser::Handle_StrokePath()
+{
+ if (m_Options.m_bTextOnly) {
+ return;
+ }
+ AddPathObject(0, TRUE);
+}
+void CPDF_StreamContentParser::Handle_SetColor_Fill()
+{
+ if (m_Options.m_bTextOnly) {
+ return;
+ }
+ FX_FLOAT values[4];
+ int nargs = m_ParamCount;
+ if (nargs > 4) {
+ nargs = 4;
+ }
+ for (int i = 0; i < nargs; i ++) {
+ values[i] = GetNumber(nargs - i - 1);
+ }
+ m_pCurStates->m_ColorState.SetFillColor(NULL, values, nargs);
+}
+void CPDF_StreamContentParser::Handle_SetColor_Stroke()
+{
+ if (m_Options.m_bTextOnly) {
+ return;
+ }
+ FX_FLOAT values[4];
+ int nargs = m_ParamCount;
+ if (nargs > 4) {
+ nargs = 4;
+ }
+ for (int i = 0; i < nargs; i ++) {
+ values[i] = GetNumber(nargs - i - 1);
+ }
+ m_pCurStates->m_ColorState.SetStrokeColor(NULL, values, nargs);
+}
+void CPDF_StreamContentParser::Handle_SetColorPS_Fill()
+{
+ if (m_Options.m_bTextOnly) {
+ return;
+ }
+ CPDF_Object* pLastParam = GetObject(0);
+ if (pLastParam == NULL) {
+ return;
+ }
+ int nargs = m_ParamCount;
+ int nvalues = nargs;
+ if (pLastParam->GetType() == PDFOBJ_NAME) {
+ nvalues --;
+ }
+ FX_FLOAT* values = NULL;
+ if (nvalues) {
+ values = FX_Alloc(FX_FLOAT, nvalues);
+ for (int i = 0; i < nvalues; i ++) {
+ values[i] = GetNumber(nargs - i - 1);
+ }
+ }
+ if (nvalues != nargs) {
+ CPDF_Pattern* pPattern = FindPattern(GetString(0), FALSE);
+ if (pPattern) {
+ m_pCurStates->m_ColorState.SetFillPattern(pPattern, values, nvalues);
+ }
+ } else {
+ m_pCurStates->m_ColorState.SetFillColor(NULL, values, nvalues);
+ }
+ if (values) {
+ FX_Free(values);
+ }
+}
+void CPDF_StreamContentParser::Handle_SetColorPS_Stroke()
+{
+ if (m_Options.m_bTextOnly) {
+ return;
+ }
+ CPDF_Object* pLastParam = GetObject(0);
+ if (pLastParam == NULL) {
+ return;
+ }
+ int nargs = m_ParamCount;
+ int nvalues = nargs;
+ if (pLastParam->GetType() == PDFOBJ_NAME) {
+ nvalues --;
+ }
+ FX_FLOAT* values = NULL;
+ if (nvalues) {
+ values = FX_Alloc(FX_FLOAT, nvalues);
+ for (int i = 0; i < nvalues; i ++) {
+ values[i] = GetNumber(nargs - i - 1);
+ }
+ }
+ if (nvalues != nargs) {
+ CPDF_Pattern* pPattern = FindPattern(GetString(0), FALSE);
+ if (pPattern) {
+ m_pCurStates->m_ColorState.SetStrokePattern(pPattern, values, nvalues);
+ }
+ } else {
+ m_pCurStates->m_ColorState.SetStrokeColor(NULL, values, nvalues);
+ }
+ if (values) {
+ FX_Free(values);
+ }
+}
+CFX_FloatRect _GetShadingBBox(CPDF_Stream* pStream, int type, const CFX_AffineMatrix* pMatrix,
+ CPDF_Function** pFuncs, int nFuncs, CPDF_ColorSpace* pCS);
+void CPDF_StreamContentParser::Handle_ShadeFill()
+{
+ if (m_Options.m_bTextOnly) {
+ return;
+ }
+ CPDF_Pattern* pPattern = FindPattern(GetString(0), TRUE);
+ if (pPattern == NULL) {
+ return;
+ }
+ if (pPattern->m_PatternType != PATTERN_SHADING) {
+ return;
+ }
+ CPDF_ShadingPattern* pShading = (CPDF_ShadingPattern*)pPattern;
+ if (!pShading->m_bShadingObj) {
+ return;
+ }
+ if (!pShading->Load()) {
+ return;
+ }
+ CPDF_ShadingObject* pObj = FX_NEW CPDF_ShadingObject;
+ pObj->m_pShading = pShading;
+ SetGraphicStates(pObj, FALSE, FALSE, FALSE);
+ pObj->m_Matrix = m_pCurStates->m_CTM;
+ pObj->m_Matrix.Concat(m_mtContentToUser);
+ CFX_FloatRect bbox;
+ if (!pObj->m_ClipPath.IsNull()) {
+ bbox = pObj->m_ClipPath.GetClipBox();
+ } else {
+ bbox = m_BBox;
+ }
+ if (pShading->m_ShadingType >= 4) {
+ bbox.Intersect(_GetShadingBBox((CPDF_Stream*)pShading->m_pShadingObj, pShading->m_ShadingType, &pObj->m_Matrix,
+ pShading->m_pFunctions, pShading->m_nFuncs, pShading->m_pCS));
+ }
+ pObj->m_Left = bbox.left;
+ pObj->m_Right = bbox.right;
+ pObj->m_Top = bbox.top;
+ pObj->m_Bottom = bbox.bottom;
+ m_pObjectList->m_ObjectList.AddTail(pObj);
+}
+void CPDF_StreamContentParser::Handle_SetCharSpace()
+{
+ m_pCurStates->m_TextState.GetModify()->m_CharSpace = GetNumber(0);
+}
+void CPDF_StreamContentParser::Handle_MoveTextPoint()
+{
+ m_pCurStates->m_TextLineX += GetNumber(1);
+ m_pCurStates->m_TextLineY += GetNumber(0);
+ m_pCurStates->m_TextX = m_pCurStates->m_TextLineX;
+ m_pCurStates->m_TextY = m_pCurStates->m_TextLineY;
+}
+void CPDF_StreamContentParser::Handle_MoveTextPoint_SetLeading()
+{
+ Handle_MoveTextPoint();
+ m_pCurStates->m_TextLeading = -GetNumber(0);
+}
+void CPDF_StreamContentParser::Handle_SetFont()
+{
+ FX_FLOAT fs = GetNumber(0);
+ if (fs == 0) {
+ fs = m_DefFontSize;
+ }
+ m_pCurStates->m_TextState.GetModify()->m_FontSize = fs;
+ CPDF_Font* pFont = FindFont(GetString(1));
+ if (pFont) {
+ m_pCurStates->m_TextState.SetFont(pFont);
+ }
+}
+CPDF_Object* CPDF_StreamContentParser::FindResourceObj(FX_BSTR type, const CFX_ByteString& name)
+{
+ if (m_pResources == NULL) {
+ return NULL;
+ }
+ if (m_pResources == m_pPageResources) {
+ CPDF_Dictionary* pList = m_pResources->GetDict(type);
+ if (pList == NULL) {
+ return NULL;
+ }
+ CPDF_Object* pRes = pList->GetElementValue(name);
+ return pRes;
+ }
+ CPDF_Dictionary* pList = m_pResources->GetDict(type);
+ if (pList == NULL) {
+ if (m_pPageResources == NULL) {
+ return NULL;
+ }
+ CPDF_Dictionary* pList = m_pPageResources->GetDict(type);
+ if (pList == NULL) {
+ return NULL;
+ }
+ CPDF_Object* pRes = pList->GetElementValue(name);
+ return pRes;
+ }
+ CPDF_Object* pRes = pList->GetElementValue(name);
+ return pRes;
+}
+CPDF_Font* CPDF_StreamContentParser::FindFont(const CFX_ByteString& name)
+{
+ CPDF_Dictionary* pFontDict = (CPDF_Dictionary*)FindResourceObj(FX_BSTRC("Font"), name);
+ if (pFontDict == NULL || pFontDict->GetType() != PDFOBJ_DICTIONARY) {
+ m_bResourceMissing = TRUE;
+ return CPDF_Font::GetStockFont(m_pDocument, FX_BSTRC("Helvetica"));
+ }
+ CPDF_Font* pFont = m_pDocument->LoadFont(pFontDict);
+ if (pFont && pFont->GetType3Font()) {
+ pFont->GetType3Font()->SetPageResources(m_pResources);
+ pFont->GetType3Font()->CheckType3FontMetrics();
+ }
+ return pFont;
+}
+CPDF_ColorSpace* CPDF_StreamContentParser::FindColorSpace(const CFX_ByteString& name)
+{
+ if (name == FX_BSTRC("Pattern")) {
+ return CPDF_ColorSpace::GetStockCS(PDFCS_PATTERN);
+ }
+ if (name == FX_BSTRC("DeviceGray") || name == FX_BSTRC("DeviceCMYK") || name == FX_BSTRC("DeviceRGB")) {
+ CFX_ByteString defname = "Default";
+ defname += name.Mid(7);
+ CPDF_Object* pDefObj = FindResourceObj(FX_BSTRC("ColorSpace"), defname);
+ if (pDefObj == NULL) {
+ if (name == FX_BSTRC("DeviceGray")) {
+ return CPDF_ColorSpace::GetStockCS(PDFCS_DEVICEGRAY);
+ }
+ if (name == FX_BSTRC("DeviceRGB")) {
+ return CPDF_ColorSpace::GetStockCS(PDFCS_DEVICERGB);
+ }
+ return CPDF_ColorSpace::GetStockCS(PDFCS_DEVICECMYK);
+ }
+ return m_pDocument->LoadColorSpace(pDefObj);
+ }
+ CPDF_Object* pCSObj = FindResourceObj(FX_BSTRC("ColorSpace"), name);
+ if (pCSObj == NULL) {
+ m_bResourceMissing = TRUE;
+ return NULL;
+ }
+ return m_pDocument->LoadColorSpace(pCSObj);
+}
+CPDF_Pattern* CPDF_StreamContentParser::FindPattern(const CFX_ByteString& name, FX_BOOL bShading)
+{
+ CPDF_Object* pPattern = FindResourceObj(bShading ? FX_BSTRC("Shading") : FX_BSTRC("Pattern"), name);
+ if (pPattern == NULL || (pPattern->GetType() != PDFOBJ_DICTIONARY &&
+ pPattern->GetType() != PDFOBJ_STREAM)) {
+ m_bResourceMissing = TRUE;
+ return NULL;
+ }
+ return m_pDocument->LoadPattern(pPattern, bShading, &m_pCurStates->m_ParentMatrix);
+}
+void CPDF_StreamContentParser::ConvertTextSpace(FX_FLOAT& x, FX_FLOAT& y)
+{
+ m_pCurStates->m_TextMatrix.Transform(x, y, x, y);
+ ConvertUserSpace(x, y);
+}
+void CPDF_StreamContentParser::ConvertUserSpace(FX_FLOAT& x, FX_FLOAT& y)
+{
+ m_pCurStates->m_CTM.Transform(x, y, x, y);
+ m_mtContentToUser.Transform(x, y, x, y);
+}
+void CPDF_StreamContentParser::AddTextObject(CFX_ByteString* pStrs, FX_FLOAT fInitKerning, FX_FLOAT* pKerning, int nsegs)
+{
+ CPDF_Font* pFont = m_pCurStates->m_TextState.GetFont();
+ if (pFont == NULL) {
+ return;
+ }
+ if (fInitKerning != 0) {
+ if (!pFont->IsVertWriting()) {
+ m_pCurStates->m_TextX -= FXSYS_Mul(fInitKerning, m_pCurStates->m_TextState.GetFontSize()) / 1000;
+ } else {
+ m_pCurStates->m_TextY -= FXSYS_Mul(fInitKerning, m_pCurStates->m_TextState.GetFontSize()) / 1000;
+ }
+ }
+ if (nsegs == 0) {
+ return;
+ }
+ int textmode;
+ if (pFont->GetFontType() == PDFFONT_TYPE3) {
+ textmode = 0;
+ } else {
+ textmode = m_pCurStates->m_TextState.GetObject()->m_TextMode;
+ }
+ CPDF_TextObject* pText = FX_NEW CPDF_TextObject;
+ m_pLastTextObject = pText;
+ SetGraphicStates(pText, TRUE, TRUE, TRUE);
+ if (textmode && textmode != 3 && textmode != 4 && textmode != 7) {
+ FX_FLOAT* pCTM = pText->m_TextState.GetModify()->m_CTM;
+ pCTM[0] = m_pCurStates->m_CTM.a;
+ pCTM[1] = m_pCurStates->m_CTM.c;
+ pCTM[2] = m_pCurStates->m_CTM.b;
+ pCTM[3] = m_pCurStates->m_CTM.d;
+ }
+ pText->SetSegments(pStrs, pKerning, nsegs);
+ pText->m_PosX = m_pCurStates->m_TextX;
+ pText->m_PosY = m_pCurStates->m_TextY + m_pCurStates->m_TextRise;
+ ConvertTextSpace(pText->m_PosX, pText->m_PosY);
+ FX_FLOAT x_advance, y_advance;
+ pText->CalcPositionData(&x_advance, &y_advance, m_pCurStates->m_TextHorzScale, m_Level);
+ m_pCurStates->m_TextX += x_advance;
+ m_pCurStates->m_TextY += y_advance;
+ if (textmode > 3) {
+ CPDF_TextObject* pCopy = FX_NEW CPDF_TextObject;
+ pCopy->Copy(pText);
+ m_ClipTextList.Add(pCopy);
+ }
+ m_pObjectList->m_ObjectList.AddTail(pText);
+ if (pKerning && pKerning[nsegs - 1] != 0) {
+ if (!pFont->IsVertWriting()) {
+ m_pCurStates->m_TextX -= FXSYS_Mul(pKerning[nsegs - 1], m_pCurStates->m_TextState.GetFontSize()) / 1000;
+ } else {
+ m_pCurStates->m_TextY -= FXSYS_Mul(pKerning[nsegs - 1], m_pCurStates->m_TextState.GetFontSize()) / 1000;
+ }
+ }
+}
+void CPDF_StreamContentParser::Handle_ShowText()
+{
+ CFX_ByteString str = GetString(0);
+ if (str.IsEmpty()) {
+ return;
+ }
+ AddTextObject(&str, 0, NULL, 1);
+}
+void CPDF_StreamContentParser::Handle_ShowText_Positioning()
+{
+ CPDF_Array* pArray = GetObject(0)->GetArray();
+ if (pArray == NULL) {
+ return;
+ }
+ int n = pArray->GetCount(), nsegs = 0, i;
+ for (i = 0; i < n; i ++) {
+ CPDF_Object* pObj = pArray->GetElementValue(i);
+ if (pObj->GetType() == PDFOBJ_STRING) {
+ nsegs ++;
+ }
+ }
+ if (nsegs == 0) {
+ for (i = 0; i < n; i ++) {
+ m_pCurStates->m_TextX -= FXSYS_Mul(pArray->GetNumber(i), m_pCurStates->m_TextState.GetFontSize()) / 1000;
+ };
+ return;
+ }
+ CFX_ByteString* pStrs;
+ FX_NEW_VECTOR(pStrs, CFX_ByteString, nsegs);
+ FX_FLOAT* pKerning = FX_Alloc(FX_FLOAT, nsegs);
+ int iSegment = 0;
+ FX_FLOAT fInitKerning = 0;
+ for (i = 0; i < n; i ++) {
+ CPDF_Object* pObj = pArray->GetElementValue(i);
+ if (pObj->GetType() == PDFOBJ_STRING) {
+ CFX_ByteString str = pObj->GetString();
+ if (str.IsEmpty()) {
+ continue;
+ }
+ pStrs[iSegment] = str;
+ pKerning[iSegment ++] = 0;
+ } else {
+ if (iSegment == 0) {
+ fInitKerning += pObj->GetNumber();
+ } else {
+ pKerning[iSegment - 1] += pObj->GetNumber();
+ }
+ }
+ }
+ AddTextObject(pStrs, fInitKerning, pKerning, iSegment);
+ FX_DELETE_VECTOR(pStrs, CFX_ByteString, nsegs);
+ FX_Free(pKerning);
+}
+void CPDF_StreamContentParser::Handle_SetTextLeading()
+{
+ m_pCurStates->m_TextLeading = GetNumber(0);
+}
+void CPDF_StreamContentParser::Handle_SetTextMatrix()
+{
+ m_pCurStates->m_TextMatrix.Set(GetNumber16(5), GetNumber16(4), GetNumber16(3),
+ GetNumber16(2), GetNumber(1), GetNumber(0));
+ OnChangeTextMatrix();
+ m_pCurStates->m_TextX = 0;
+ m_pCurStates->m_TextY = 0;
+ m_pCurStates->m_TextLineX = 0;
+ m_pCurStates->m_TextLineY = 0;
+}
+void CPDF_StreamContentParser::OnChangeTextMatrix()
+{
+ CFX_AffineMatrix text_matrix(m_pCurStates->m_TextHorzScale, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f);
+ text_matrix.Concat(m_pCurStates->m_TextMatrix);
+ text_matrix.Concat(m_pCurStates->m_CTM);
+ text_matrix.Concat(m_mtContentToUser);
+ FX_FLOAT* pTextMatrix = m_pCurStates->m_TextState.GetModify()->m_Matrix;
+ pTextMatrix[0] = text_matrix.a;
+ pTextMatrix[1] = text_matrix.c;
+ pTextMatrix[2] = text_matrix.b;
+ pTextMatrix[3] = text_matrix.d;
+}
+void CPDF_StreamContentParser::Handle_SetTextRenderMode()
+{
+ int mode = GetInteger(0);
+ if (mode < 0 || mode > 7) {
+ return;
+ }
+ m_pCurStates->m_TextState.GetModify()->m_TextMode = mode;
+}
+void CPDF_StreamContentParser::Handle_SetTextRise()
+{
+ m_pCurStates->m_TextRise = GetNumber(0);
+}
+void CPDF_StreamContentParser::Handle_SetWordSpace()
+{
+ m_pCurStates->m_TextState.GetModify()->m_WordSpace = GetNumber(0);
+}
+void CPDF_StreamContentParser::Handle_SetHorzScale()
+{
+ if (m_ParamCount != 1) {
+ return;
+ }
+ m_pCurStates->m_TextHorzScale = GetNumber(0) / 100;
+ OnChangeTextMatrix();
+}
+void CPDF_StreamContentParser::Handle_MoveToNextLine()
+{
+ m_pCurStates->m_TextLineY -= m_pCurStates->m_TextLeading;
+ m_pCurStates->m_TextX = m_pCurStates->m_TextLineX;
+ m_pCurStates->m_TextY = m_pCurStates->m_TextLineY;
+}
+void CPDF_StreamContentParser::Handle_CurveTo_23()
+{
+ if (m_Options.m_bTextOnly) {
+ return;
+ }
+ AddPathPoint(m_PathCurrentX, m_PathCurrentY, FXPT_BEZIERTO);
+ AddPathPoint(GetNumber(3), GetNumber(2), FXPT_BEZIERTO);
+ AddPathPoint(GetNumber(1), GetNumber(0), FXPT_BEZIERTO);
+}
+void CPDF_StreamContentParser::Handle_SetLineWidth()
+{
+ FX_FLOAT width = GetNumber(0);
+ m_pCurStates->m_GraphState.GetModify()->m_LineWidth = width;
+}
+void CPDF_StreamContentParser::Handle_Clip()
+{
+ m_PathClipType = FXFILL_WINDING;
+}
+void CPDF_StreamContentParser::Handle_EOClip()
+{
+ m_PathClipType = FXFILL_ALTERNATE;
+}
+void CPDF_StreamContentParser::Handle_CurveTo_13()
+{
+ if (m_Options.m_bTextOnly) {
+ return;
+ }
+ AddPathPoint(GetNumber(3), GetNumber(2), FXPT_BEZIERTO);
+ AddPathPoint(GetNumber(1), GetNumber(0), FXPT_BEZIERTO);
+ AddPathPoint(GetNumber(1), GetNumber(0), FXPT_BEZIERTO);
+}
+void CPDF_StreamContentParser::Handle_NextLineShowText()
+{
+ Handle_MoveToNextLine();
+ Handle_ShowText();
+}
+void CPDF_StreamContentParser::Handle_NextLineShowText_Space()
+{
+ m_pCurStates->m_TextState.GetModify()->m_WordSpace = GetNumber(2);
+ m_pCurStates->m_TextState.GetModify()->m_CharSpace = GetNumber(1);
+ Handle_NextLineShowText();
+}
+void CPDF_StreamContentParser::Handle_Invalid()
+{
+}
+void CPDF_StreamContentParser::AddPathPoint(FX_FLOAT x, FX_FLOAT y, int flag)
+{
+ m_PathCurrentX = x;
+ m_PathCurrentY = y;
+ if (flag == FXPT_MOVETO) {
+ m_PathStartX = x;
+ m_PathStartY = y;
+ if (m_PathPointCount && m_pPathPoints[m_PathPointCount - 1].m_Flag == FXPT_MOVETO) {
+ m_pPathPoints[m_PathPointCount - 1].m_PointX = x;
+ m_pPathPoints[m_PathPointCount - 1].m_PointY = y;
+ return;
+ }
+ } else if (m_PathPointCount == 0) {
+ return;
+ }
+ m_PathPointCount ++;
+ if (m_PathPointCount > m_PathAllocSize) {
+ int newsize = m_PathPointCount + 256;
+ FX_PATHPOINT* pNewPoints = FX_Alloc(FX_PATHPOINT, newsize);
+ if (m_PathAllocSize) {
+ FXSYS_memcpy32(pNewPoints, m_pPathPoints, m_PathAllocSize * sizeof(FX_PATHPOINT));
+ FX_Free(m_pPathPoints);
+ }
+ m_pPathPoints = pNewPoints;
+ m_PathAllocSize = newsize;
+ }
+ m_pPathPoints[m_PathPointCount - 1].m_Flag = flag;
+ m_pPathPoints[m_PathPointCount - 1].m_PointX = x;
+ m_pPathPoints[m_PathPointCount - 1].m_PointY = y;
+}
+void CPDF_StreamContentParser::AddPathObject(int FillType, FX_BOOL bStroke)
+{
+ int PathPointCount = m_PathPointCount, PathClipType = m_PathClipType;
+ m_PathPointCount = 0;
+ m_PathClipType = 0;
+ if (PathPointCount <= 1) {
+ if (PathPointCount && PathClipType) {
+ CPDF_Path path;
+ path.New()->AppendRect(0, 0, 0, 0);
+ m_pCurStates->m_ClipPath.AppendPath(path, FXFILL_WINDING, TRUE);
+ }
+ return;
+ }
+ if (PathPointCount && m_pPathPoints[PathPointCount - 1].m_Flag == FXPT_MOVETO) {
+ PathPointCount --;
+ }
+ CPDF_Path Path;
+ CFX_PathData* pPathData = Path.New();
+ pPathData->SetPointCount(PathPointCount);
+ FXSYS_memcpy32(pPathData->GetPoints(), m_pPathPoints, sizeof(FX_PATHPOINT) * PathPointCount);
+ CFX_AffineMatrix matrix = m_pCurStates->m_CTM;
+ matrix.Concat(m_mtContentToUser);
+ if (bStroke || FillType) {
+ CPDF_PathObject* pPathObj = FX_NEW CPDF_PathObject;
+ pPathObj->m_bStroke = bStroke;
+ pPathObj->m_FillType = FillType;
+ pPathObj->m_Path = Path;
+ pPathObj->m_Matrix = matrix;
+ SetGraphicStates(pPathObj, TRUE, FALSE, TRUE);
+ pPathObj->CalcBoundingBox();
+ m_pObjectList->m_ObjectList.AddTail(pPathObj);
+ }
+ if (PathClipType) {
+ if (!matrix.IsIdentity()) {
+ Path.Transform(&matrix);
+ matrix.SetIdentity();
+ }
+ m_pCurStates->m_ClipPath.AppendPath(Path, PathClipType, TRUE);
+ }
+}
+CFX_ByteString _FPDF_ByteStringFromHex(CFX_BinaryBuf& src_buf)
+{
+ CFX_ByteTextBuf buf;
+ FX_BOOL bFirst = TRUE;
+ int code = 0;
+ FX_LPCBYTE str = src_buf.GetBuffer();
+ FX_DWORD size = src_buf.GetSize();
+ for (FX_DWORD i = 0; i < size; i ++) {
+ FX_BYTE ch = str[i];
+ if (ch >= '0' && ch <= '9') {
+ if (bFirst) {
+ code = (ch - '0') * 16;
+ } else {
+ code += ch - '0';
+ buf.AppendChar((char)code);
+ }
+ bFirst = !bFirst;
+ } else if (ch >= 'A' && ch <= 'F') {
+ if (bFirst) {
+ code = (ch - 'A' + 10) * 16;
+ } else {
+ code += ch - 'A' + 10;
+ buf.AppendChar((char)code);
+ }
+ bFirst = !bFirst;
+ } else if (ch >= 'a' && ch <= 'f') {
+ if (bFirst) {
+ code = (ch - 'a' + 10) * 16;
+ } else {
+ code += ch - 'a' + 10;
+ buf.AppendChar((char)code);
+ }
+ bFirst = !bFirst;
+ }
+ }
+ if (!bFirst) {
+ buf.AppendChar((char)code);
+ }
+ return buf.GetByteString();
+}
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_parser_new.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_parser_new.cpp
index 2eeb1feff5..5442f9b4ec 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_parser_new.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_parser_new.cpp
@@ -1,822 +1,822 @@
-// 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
-
-#include "../../../include/fpdfapi/fpdf_page.h"
-#include "../../../include/fpdfapi/fpdf_module.h"
-#include "pageint.h"
-#if defined(_FPDFAPI_MINI_)
-extern const FX_LPCSTR _PDF_CharType;
-void CPDF_StreamContentParser::InputData(FX_LPCBYTE src_buf, FX_DWORD src_size)
-{
- if (m_Level > _FPDF_MAX_FORM_LEVEL_) {
- return;
- }
- for (FX_DWORD i = 0; i < src_size; i ++) {
- int ch = src_buf[i];
- int type = _PDF_CharType[ch];
-start:
- switch (m_WordState) {
- case 0:
- if (type == 'W') {
- } else if (type == 'N') {
- m_WordState = 5;
- m_pWordBuf[0] = ch;
- m_WordSize = 1;
- } else if (type == 'R') {
- m_WordState = 4;
- m_pWordBuf[0] = ch;
- m_WordSize = 1;
- } else switch (ch) {
- case '/':
- m_WordState = 2;
- m_WordSize = 0;
- break;
- case '[':
- StartArray();
- break;
- case ']':
- EndArray();
- break;
- case '(':
- m_WordState = 7;
- m_StringLevel = 1;
- m_StringState = 0;
- m_StringBuf.Clear();
- break;
- case '<':
- m_WordState = 3;
- break;
- case '>':
- m_WordState = 8;
- break;
- case '%':
- m_WordState = 1;
- break;
- }
- break;
- case 1:
- if (ch == '\n' || ch == '\r') {
- m_WordState = 0;
- }
- break;
- case 2:
- if (type != 'R' && type != 'N') {
- EndName();
- m_WordState = 0;
- goto start;
- }
- if (m_WordSize < 256) {
- m_pWordBuf[m_WordSize++] = ch;
- }
- break;
- case 3:
- if (ch == '<') {
- StartDict();
- m_WordState = 0;
- } else {
- m_StringBuf.Clear();
- m_WordState = 6;
- goto start;
- }
- break;
- case 4:
- if (type != 'R' && type != 'N') {
- m_WordState = 0;
- EndKeyword();
- if (m_bAbort) {
- return;
- }
- goto start;
- }
- if (m_WordSize < 256) {
- m_pWordBuf[m_WordSize++] = ch;
- }
- break;
- case 5:
- if (type != 'N') {
- EndNumber();
- m_WordState = 0;
- goto start;
- }
- if (m_WordSize < 256) {
- m_pWordBuf[m_WordSize++] = ch;
- }
- break;
- case 6:
- if (ch == '>') {
- EndHexString();
- m_WordState = 0;
- } else {
- m_StringBuf.AppendByte(ch);
- }
- break;
- case 7:
- switch (m_StringState) {
- case 0:
- if (ch == ')') {
- m_StringLevel --;
- if (m_StringLevel == 0) {
- EndString();
- m_WordState = 0;
- break;
- }
- m_StringBuf.AppendByte(')');
- } else if (ch == '(') {
- m_StringLevel ++;
- m_StringBuf.AppendByte('(');
- } else if (ch == '\\') {
- m_StringState = 1;
- } else {
- m_StringBuf.AppendByte((char)ch);
- }
- break;
- case 1:
- if (ch >= '0' && ch <= '7') {
- m_EscCode = ch - '0';
- m_StringState = 2;
- break;
- }
- if (ch == 'n') {
- m_StringBuf.AppendByte('\n');
- } else if (ch == 'r') {
- m_StringBuf.AppendByte('\r');
- } else if (ch == 't') {
- m_StringBuf.AppendByte('\t');
- } else if (ch == 'b') {
- m_StringBuf.AppendByte('\b');
- } else if (ch == 'f') {
- m_StringBuf.AppendByte('\f');
- } else if (ch == '\\') {
- m_StringBuf.AppendByte('\\');
- } else if (ch == '(') {
- m_StringBuf.AppendByte('(');
- } else if (ch == ')') {
- m_StringBuf.AppendByte(')');
- } else if (ch == '\r') {
- m_StringState = 4;
- break;
- } else if (ch == '\n') {
- } else {
- m_StringBuf.AppendByte(ch);
- }
- m_StringState = 0;
- break;
- case 2:
- if (ch >= '0' && ch <= '7') {
- m_EscCode = m_EscCode * 8 + ch - '0';
- m_StringState = 3;
- } else {
- m_StringBuf.AppendByte(m_EscCode);
- m_StringState = 0;
- goto start;
- }
- break;
- case 3:
- if (ch >= '0' && ch <= '7') {
- m_EscCode = m_EscCode * 8 + ch - '0';
- m_StringBuf.AppendByte(m_EscCode);
- m_StringState = 0;
- } else {
- m_StringBuf.AppendByte(m_EscCode);
- m_StringState = 0;
- goto start;
- }
- break;
- case 4:
- m_StringState = 0;
- if (ch != '\n') {
- goto start;
- }
- break;
- }
- break;
- case 8:
- m_WordState = 0;
- if (ch == '>') {
- EndDict();
- } else {
- goto start;
- }
- break;
- case 9:
- switch (m_InlineImageState) {
- case 0:
- if (type == 'W' || type == 'D') {
- m_InlineImageState = 1;
- m_InlineWhiteChar = ch;
- } else {
- m_StringBuf.AppendByte(ch);
- }
- break;
- case 1:
- m_StringBuf.AppendByte(m_InlineWhiteChar);
- if (ch == 'I') {
- m_InlineImageState = 2;
- } else {
- m_InlineImageState = 0;
- goto start;
- }
- break;
- case 2:
- if (ch == 'D') {
- m_InlineImageState = 3;
- } else {
- m_StringBuf.AppendByte('I');
- m_InlineImageState = 0;
- goto start;
- }
- break;
- case 3:
- EndImageDict();
- break;
- }
- break;
- case 10:
- switch (m_InlineImageState) {
- case 0:
- if (type == 'W') {
- m_InlineImageState = 1;
- m_InlineWhiteChar = ch;
- } else {
- m_ImageSrcBuf.AppendByte(ch);
- }
- break;
- case 1:
- if (ch == 'E') {
- m_InlineImageState = 2;
- } else {
- m_ImageSrcBuf.AppendByte(m_InlineWhiteChar);
- m_InlineImageState = 0;
- goto start;
- }
- break;
- case 2:
- if (ch == 'I') {
- m_InlineImageState = 3;
- } else {
- m_ImageSrcBuf.AppendByte(m_InlineWhiteChar);
- m_ImageSrcBuf.AppendByte('E');
- m_InlineImageState = 0;
- goto start;
- }
- break;
- case 3:
- if (type == 'W') {
- EndInlineImage();
- } else {
- m_ImageSrcBuf.AppendByte(m_InlineWhiteChar);
- m_ImageSrcBuf.AppendByte('E');
- m_ImageSrcBuf.AppendByte('I');
- m_InlineImageState = 0;
- goto start;
- }
- break;
- }
- break;
- case 11:
- if (m_InlineImageState < m_ImageSrcBuf.GetSize()) {
- m_ImageSrcBuf.GetBuffer()[m_InlineImageState ++] = ch;
- } else {
- if (ch == 'I') {
- EndInlineImage();
- }
- }
- break;
- }
- }
-}
-void CPDF_StreamContentParser::Finish()
-{
- switch (m_WordState) {
- case 0:
- break;
- case 1:
- break;
- case 2:
- EndName();
- break;
- case 3:
- break;
- case 4:
- EndKeyword();
- break;
- case 5:
- EndNumber();
- break;
- case 6:
- EndHexString();
- break;
- case 7:
- EndString();
- break;
- case 8:
- break;
- case 9:
- break;
- case 10:
- EndInlineImage();
- break;
- }
- m_WordState = 0;
-}
-void CPDF_StreamContentParser::AddContainer(CPDF_Object* pObject)
-{
- if (m_ObjectSize) {
- m_pObjectState[m_ObjectSize] = SetToCurObj(pObject);
- }
- FXSYS_assert(m_ObjectSize < _FPDF_MAX_OBJECT_STACK_SIZE_);
- m_pObjectStack[m_ObjectSize++] = pObject;
-}
-FX_BOOL CPDF_StreamContentParser::SetToCurObj(CPDF_Object* pObject)
-{
- if (m_ObjectSize == 0) {
- AddObjectParam(pObject);
- return TRUE;
- }
- FX_BOOL bInArrayOrDict = TRUE;
- CPDF_Object* pCurObj = m_pObjectStack[m_ObjectSize - 1];
- if (pCurObj->GetType() == PDFOBJ_ARRAY) {
- ((CPDF_Array*)pCurObj)->Add(pObject, m_pDocument);
- } else {
- if (!m_bDictName && m_pDictName[0]) {
- ((CPDF_Dictionary*)pCurObj)->SetAt((FX_LPCSTR)m_pDictName, pObject, m_pDocument);
- } else {
- bInArrayOrDict = FALSE;
- }
- m_bDictName = TRUE;
- }
- return bInArrayOrDict;
-}
-void CPDF_StreamContentParser::StartArray()
-{
- if (m_ObjectSize)
- if (m_pObjectStack[0]->GetType() != PDFOBJ_DICTIONARY && m_pObjectStack[m_ObjectSize - 1]->GetType() == PDFOBJ_ARRAY) {
- return;
- }
- CPDF_Array* pArray = FX_NEW CPDF_Array;
- AddContainer(pArray);
-}
-void CPDF_StreamContentParser::EndArray()
-{
- if (m_ObjectSize == 0) {
- return;
- }
- CPDF_Object* pCurObj = m_pObjectStack[m_ObjectSize - 1];
- if (pCurObj->GetType() != PDFOBJ_ARRAY) {
- return;
- }
- m_ObjectSize --;
- if (m_ObjectSize == 0) {
- AddObjectParam(pCurObj);
- } else {
- if (!m_pObjectState[m_ObjectSize]) {
- pCurObj->Release();
- }
- }
- m_pObjectState[m_ObjectSize] = FALSE;
-}
-void CPDF_StreamContentParser::StartDict()
-{
- CPDF_Dictionary* pDict = FX_NEW CPDF_Dictionary;
- AddContainer(pDict);
- m_bDictName = TRUE;
-}
-void CPDF_StreamContentParser::EndDict()
-{
- if (m_ObjectSize == 0) {
- return;
- }
- CPDF_Object* pCurObj = m_pObjectStack[m_ObjectSize - 1];
- if (pCurObj->GetType() != PDFOBJ_DICTIONARY) {
- return;
- }
- m_ObjectSize --;
- if (m_ObjectSize == 0) {
- AddObjectParam(pCurObj);
- } else {
- if (!m_pObjectState[m_ObjectSize]) {
- pCurObj->Release();
- }
- }
- m_pObjectState[m_ObjectSize] = FALSE;
-}
-void CPDF_StreamContentParser::EndName()
-{
- if (m_ObjectSize == 0) {
- AddNameParam((FX_LPCSTR)m_pWordBuf, m_WordSize);
- return;
- }
- CPDF_Object* pCurObj = m_pObjectStack[m_ObjectSize - 1];
- if (pCurObj->GetType() == PDFOBJ_ARRAY) {
- ((CPDF_Array*)pCurObj)->AddName(CFX_ByteString(m_pWordBuf, m_WordSize));
- } else {
- if (m_bDictName) {
- FXSYS_memcpy32(m_pDictName, m_pWordBuf, m_WordSize);
- m_pDictName[m_WordSize] = 0;
- } else {
- if (m_pDictName[0] != 0) {
- ((CPDF_Dictionary*)pCurObj)->SetAtName((FX_LPCSTR)m_pDictName, CFX_ByteString(m_pWordBuf, m_WordSize));
- }
- }
- m_bDictName = !m_bDictName;
- }
-}
-void CPDF_StreamContentParser::EndNumber()
-{
- if (m_ObjectSize == 0) {
- AddNumberParam((FX_LPCSTR)m_pWordBuf, m_WordSize);
- return;
- }
- CPDF_Number *pObj = FX_NEW CPDF_Number(CFX_ByteStringC(m_pWordBuf, m_WordSize));
- if (!SetToCurObj(pObj)) {
- pObj->Release();
- }
-}
-extern CFX_ByteString _FPDF_ByteStringFromHex(CFX_BinaryBuf& src_buf);
-void CPDF_StreamContentParser::EndHexString()
-{
- CPDF_String *pObj = FX_NEW CPDF_String(_FPDF_ByteStringFromHex(m_StringBuf), TRUE);
- if (!SetToCurObj(pObj)) {
- pObj->Release();
- }
-}
-void CPDF_StreamContentParser::EndString()
-{
- CPDF_String *pObj = FX_NEW CPDF_String(m_StringBuf.GetByteString());
- if (!SetToCurObj(pObj)) {
- pObj->Release();
- }
-}
-void CPDF_StreamContentParser::Handle_BeginImage(void)
-{
- m_WordState = 9;
- m_InlineImageState = 0;
- m_StringBuf.Clear();
-}
-void _PDF_ReplaceAbbr(CPDF_Object* pObj);
-void CPDF_StreamContentParser::EndImageDict()
-{
- if (m_StringBuf.GetSize() != m_LastImageDict.GetSize() ||
- FXSYS_memcmp32(m_StringBuf.GetBuffer(), m_LastImageDict.GetBuffer(), m_StringBuf.GetSize())) {
- m_WordState = 0;
- StartDict();
- InputData(m_StringBuf.GetBuffer(), m_StringBuf.GetSize());
- Finish();
- m_bSameLastDict = FALSE;
- if (m_pLastImageDict && m_bReleaseLastDict) {
- m_pLastImageDict->Release();
- m_pLastImageDict = NULL;
- }
- if (!m_ObjectSize) {
- m_InlineImageState = 0;
- return;
- }
- m_pLastImageDict = (CPDF_Dictionary*)m_pObjectStack[--m_ObjectSize];
- m_bReleaseLastDict = !m_pObjectState[m_ObjectSize];
- m_pObjectState[m_ObjectSize] = FALSE;
- _PDF_ReplaceAbbr(m_pLastImageDict);
- m_LastImageDict.TakeOver(m_StringBuf);
- if (m_pLastImageDict->KeyExist(FX_BSTRC("ColorSpace"))) {
- CPDF_Object* pCSObj = m_pLastImageDict->GetElementValue(FX_BSTRC("ColorSpace"));
- if (pCSObj->GetType() == PDFOBJ_NAME) {
- CFX_ByteString name = pCSObj->GetString();
- if (name != FX_BSTRC("DeviceRGB") && name != FX_BSTRC("DeviceGray") && name != FX_BSTRC("DeviceCMYK")) {
- pCSObj = FindResourceObj(FX_BSTRC("ColorSpace"), name);
- if (pCSObj) {
- if (!pCSObj->GetObjNum()) {
- pCSObj = pCSObj->Clone();
- }
- m_pLastImageDict->SetAt(FX_BSTRC("ColorSpace"), pCSObj, m_pDocument);
- }
- }
- }
- }
- } else {
- m_bSameLastDict = TRUE;
- }
- m_ImageSrcBuf.Clear();
- if (m_pLastCloneImageDict) {
- m_pLastCloneImageDict->Release();
- }
- m_pLastCloneImageDict = (CPDF_Dictionary*)m_pLastImageDict->Clone();
- if (m_pLastCloneImageDict->KeyExist(FX_BSTRC("Filter"))) {
- m_WordState = 10;
- m_InlineImageState = 0;
- } else {
- int width = m_pLastCloneImageDict->GetInteger(FX_BSTRC("Width"));
- int height = m_pLastCloneImageDict->GetInteger(FX_BSTRC("Height"));
- int OrigSize = 0;
- CPDF_Object* pCSObj = m_pLastCloneImageDict->GetElementValue(FX_BSTRC("ColorSpace"));
- if (pCSObj != NULL) {
- int bpc = m_pLastCloneImageDict->GetInteger(FX_BSTRC("BitsPerComponent"));
- int nComponents = 1;
- CPDF_ColorSpace* pCS = m_pDocument->LoadColorSpace(pCSObj);
- if (pCS == NULL) {
- nComponents = 3;
- } else {
- nComponents = pCS->CountComponents();
- m_pDocument->GetPageData()->ReleaseColorSpace(pCSObj);
- }
- int pitch = (width * bpc * nComponents + 7) / 8;
- OrigSize = pitch * height;
- } else {
- OrigSize = ((width + 7) / 8) * height;
- }
- m_ImageSrcBuf.AppendBlock(NULL, OrigSize);
- m_WordState = 11;
- m_InlineImageState = 0;
- }
-}
-void CPDF_StreamContentParser::EndInlineImage()
-{
- CFX_AffineMatrix ImageMatrix;
- ImageMatrix.Copy(m_pCurStates->m_CTM);
- ImageMatrix.Concat(m_mtContentToUser);
- m_LastImageData.CopyData(m_ImageSrcBuf.GetBuffer(), m_ImageSrcBuf.GetSize());
- CPDF_Stream* pStream = CPDF_Stream::Create(m_ImageSrcBuf.GetBuffer(), m_ImageSrcBuf.GetSize(),
- m_pLastCloneImageDict);
- m_ImageSrcBuf.DetachBuffer();
- m_pLastCloneImageDict = NULL;
- CPDF_InlineImages* pImages = FX_NEW CPDF_InlineImages;
- pImages->m_pStream = pStream;
- SetGraphicStates(pImages, !m_pLastCloneImageDict->KeyExist(FX_BSTRC("ColorSpace")), FALSE, FALSE);
- pImages->AddMatrix(ImageMatrix);
- m_pObjectList->m_ObjectList.AddTail(pImages);
- m_WordState = 0;
-}
-#define FXDWORD_TRUE FXDWORD_FROM_LSBFIRST(0x65757274)
-#define FXDWORD_NULL FXDWORD_FROM_LSBFIRST(0x6c6c756e)
-#define FXDWORD_FALS FXDWORD_FROM_LSBFIRST(0x736c6166)
-void CPDF_StreamContentParser::EndKeyword()
-{
- CPDF_Object *pObj = NULL;
- if (m_WordSize == 4) {
- if (*(FX_DWORD*)m_pWordBuf == FXDWORD_TRUE) {
- pObj = CPDF_Boolean::Create(TRUE);
- if (!SetToCurObj(pObj)) {
- pObj->Release();
- }
- return;
- } else if (*(FX_DWORD*)m_pWordBuf == FXDWORD_NULL) {
- pObj = CPDF_Null::Create();
- if (!SetToCurObj(pObj)) {
- pObj->Release();
- }
- return;
- }
- } else if (m_WordSize == 5) {
- if (*(FX_DWORD*)m_pWordBuf == FXDWORD_FALS && m_pWordBuf[4] == 'e') {
- pObj = CPDF_Boolean::Create(FALSE);
- if (!SetToCurObj(pObj)) {
- pObj->Release();
- }
- return;
- }
- }
- m_pWordBuf[m_WordSize] = 0;
- OnOperator((char*)m_pWordBuf);
- ClearAllParams();
-}
-#define PAGEPARSE_STAGE_PARSE 2
-#define PAGEPARSE_STAGE_CHECKCLIP 3
-CPDF_ContentParser::CPDF_ContentParser()
-{
- m_pParser = NULL;
- m_Status = Ready;
- m_pStreamFilter = NULL;
- m_pType3Char = NULL;
-}
-CPDF_ContentParser::~CPDF_ContentParser()
-{
- Clear();
-}
-void CPDF_ContentParser::Clear()
-{
- if (m_pParser) {
- delete m_pParser;
- }
- if (m_pStreamFilter) {
- delete m_pStreamFilter;
- }
- m_pParser = NULL;
- m_Status = Ready;
-}
-void CPDF_ContentParser::Start(CPDF_Page* pPage, CPDF_ParseOptions* pOptions)
-{
- if (m_Status != Ready || pPage == NULL || pPage->m_pDocument == NULL || pPage->m_pFormDict == NULL) {
- m_Status = Done;
- return;
- }
- m_pObjects = pPage;
- m_bForm = FALSE;
- if (pOptions) {
- m_Options = *pOptions;
- }
- CPDF_Object* pContent = pPage->m_pFormDict->GetElementValue(FX_BSTRC("Contents"));
- if (pContent == NULL) {
- m_Status = Done;
- return;
- }
- if (pContent->GetType() == PDFOBJ_STREAM) {
- m_nStreams = 1;
- } else if (pContent->GetType() == PDFOBJ_ARRAY) {
- m_nStreams = ((CPDF_Array*)pContent)->GetCount();
- } else {
- m_Status = Done;
- return;
- }
- m_Status = ToBeContinued;
- m_InternalStage = PAGEPARSE_STAGE_PARSE;
- m_CurrentOffset = 0;
- m_pParser = FX_NEW CPDF_StreamContentParser;
- m_pParser->Initialize();
- m_pParser->PrepareParse(pPage->m_pDocument, pPage->m_pResources, NULL, NULL, pPage,
- pPage->m_pResources, &pPage->m_BBox, &m_Options, NULL, 0);
- m_pParser->m_pCurStates->m_ColorState.GetModify()->Default();
-}
-void CPDF_ContentParser::Start(CPDF_Form* pForm, CPDF_AllStates* pGraphicStates, CFX_AffineMatrix* pParentMatrix,
- CPDF_Type3Char* pType3Char, CPDF_ParseOptions* pOptions, int level)
-{
- m_pType3Char = pType3Char;
- m_pObjects = pForm;
- m_bForm = TRUE;
- CFX_AffineMatrix form_matrix = pForm->m_pFormDict->GetMatrix(FX_BSTRC("Matrix"));
- if (pGraphicStates) {
- form_matrix.Concat(pGraphicStates->m_CTM);
- }
- CPDF_Array* pBBox = pForm->m_pFormDict->GetArray(FX_BSTRC("BBox"));
- CFX_FloatRect form_bbox;
- CPDF_Path ClipPath;
- if (pBBox) {
- form_bbox = pBBox->GetRect();
- ClipPath.New();
- ClipPath.AppendRect(form_bbox.left, form_bbox.bottom, form_bbox.right, form_bbox.top);
- ClipPath.Transform(&form_matrix);
- if (pParentMatrix) {
- ClipPath.Transform(pParentMatrix);
- }
- form_bbox.Transform(&form_matrix);
- }
- CPDF_Dictionary* pResources = pForm->m_pFormDict->GetDict(FX_BSTRC("Resources"));
- m_pParser = FX_NEW CPDF_StreamContentParser;
- m_pParser->Initialize();
- m_pParser->PrepareParse(pForm->m_pDocument, pForm->m_pPageResources, pForm->m_pResources, pParentMatrix, pForm,
- pResources, &form_bbox, pOptions, pGraphicStates, level);
- m_pParser->m_pCurStates->m_CTM = form_matrix;
- if (ClipPath.NotNull()) {
- m_pParser->m_pCurStates->m_ClipPath.AppendPath(ClipPath, FXFILL_WINDING, TRUE);
- }
- if (pForm->m_Transparency & PDFTRANS_GROUP) {
- CPDF_GeneralStateData* pData = m_pParser->m_pCurStates->m_GeneralState.GetModify();
- pData->m_BlendType = FXDIB_BLEND_NORMAL;
- pData->m_StrokeAlpha = 1.0f;
- pData->m_FillAlpha = 1.0f;
- pData->m_pSoftMask = NULL;
- }
- m_pStreamFilter = pForm->m_pFormStream->GetStreamFilter();
- m_nStreams = 1;
- m_Status = ToBeContinued;
- m_InternalStage = PAGEPARSE_STAGE_PARSE;
- m_CurrentOffset = 0;
-}
-void CPDF_ContentParser::Continue(IFX_Pause* pPause)
-{
- while (m_Status == ToBeContinued) {
- if (m_InternalStage == PAGEPARSE_STAGE_PARSE) {
- if (m_pStreamFilter == NULL) {
- if (m_CurrentOffset == m_nStreams) {
- m_InternalStage = PAGEPARSE_STAGE_CHECKCLIP;
- if (m_pType3Char) {
- m_pType3Char->m_bColored = m_pParser->m_bColored;
- m_pType3Char->m_Width = FXSYS_round(m_pParser->m_Type3Data[0] * 1000);
- m_pType3Char->m_BBox.left = FXSYS_round(m_pParser->m_Type3Data[2] * 1000);
- m_pType3Char->m_BBox.bottom = FXSYS_round(m_pParser->m_Type3Data[3] * 1000);
- m_pType3Char->m_BBox.right = FXSYS_round(m_pParser->m_Type3Data[4] * 1000);
- m_pType3Char->m_BBox.top = FXSYS_round(m_pParser->m_Type3Data[5] * 1000);
- m_pType3Char->m_bPageRequired = m_pParser->m_bResourceMissing;
- }
- delete m_pParser;
- m_pParser = NULL;
- continue;
- }
- CPDF_Object* pContent = m_pObjects->m_pFormDict->GetElementValue(FX_BSTRC("Contents"));
- if (pContent->GetType() == PDFOBJ_STREAM) {
- m_pStreamFilter = ((CPDF_Stream*)pContent)->GetStreamFilter();
- } else {
- CPDF_Stream* pStream = ((CPDF_Array*)pContent)->GetStream(m_CurrentOffset);
- if (pStream == NULL) {
- m_CurrentOffset ++;
- continue;
- }
- m_pStreamFilter = pStream->GetStreamFilter();
- }
- }
- FX_DWORD len = m_pStreamFilter->ReadBlock(m_pParser->m_pStreamBuf, STREAM_PARSE_BUFSIZE);
- m_pParser->InputData(m_pParser->m_pStreamBuf, len);
- if (m_pParser->m_bAbort) {
- delete m_pStreamFilter;
- m_pStreamFilter = NULL;
- m_Status = Done;
- delete m_pParser;
- m_pParser = NULL;
- return;
- }
- if (len < STREAM_PARSE_BUFSIZE) {
- m_pParser->Finish();
- m_CurrentOffset ++;
- delete m_pStreamFilter;
- m_pStreamFilter = NULL;
- }
- if (pPause && pPause->NeedToPauseNow()) {
- return;
- }
- }
- if (m_InternalStage == PAGEPARSE_STAGE_CHECKCLIP) {
- FX_POSITION pos = m_pObjects->m_ObjectList.GetHeadPosition();
- while (pos) {
- CPDF_PageObject* pObj = (CPDF_PageObject*)m_pObjects->m_ObjectList.GetNext(pos);
- if (pObj == NULL) {
- continue;
- }
- if (pObj->m_ClipPath.IsNull()) {
- continue;
- }
- if (pObj->m_ClipPath.GetPathCount() != 1) {
- continue;
- }
- if (pObj->m_ClipPath.GetTextCount()) {
- continue;
- }
- CPDF_Path ClipPath = pObj->m_ClipPath.GetPath(0);
- if (!ClipPath.IsRect() || pObj->m_Type == PDFPAGE_SHADING) {
- continue;
- }
- CFX_FloatRect old_rect(ClipPath.GetPointX(0), ClipPath.GetPointY(0),
- ClipPath.GetPointX(2), ClipPath.GetPointY(2));
- CFX_FloatRect obj_rect(pObj->m_Left, pObj->m_Bottom, pObj->m_Right, pObj->m_Top);
- if (old_rect.Contains(obj_rect)) {
- pObj->m_ClipPath.SetNull();
- }
- }
- if (m_pObjects->m_ObjectList.GetCount() == 1) {
- CPDF_PageObject* pObj = (CPDF_PageObject*)m_pObjects->m_ObjectList.GetAt(m_pObjects->m_ObjectList.GetHeadPosition());
- if (pObj && pObj->m_Type == PDFPAGE_TEXT) {
- CPDF_TextObject* pText = (CPDF_TextObject*)pObj;
- }
- }
- m_Status = Done;
- return;
- }
- }
-}
-int CPDF_ContentParser::EstimateProgress()
-{
- if (m_Status == Ready) {
- return 0;
- }
- if (m_Status == Done) {
- return 100;
- }
- if (m_InternalStage == PAGEPARSE_STAGE_CHECKCLIP) {
- return 90;
- }
- if (m_pStreamFilter == NULL) {
- return 90 * m_CurrentOffset / m_nStreams;
- }
- int total_raw_size = m_pStreamFilter->GetStream()->GetRawSize() * m_nStreams;
- int parsed_raw_size = m_pStreamFilter->GetStream()->GetRawSize() * m_CurrentOffset +
- m_pStreamFilter->GetSrcPos();
- return 90 * parsed_raw_size / total_raw_size;
-}
-CPDF_InlineImages::CPDF_InlineImages()
-{
- m_Type = PDFPAGE_INLINES;
- m_pStream = NULL;
- m_pBitmap = NULL;
-}
-CPDF_InlineImages::~CPDF_InlineImages()
-{
- if (m_pStream) {
- m_pStream->Release();
- }
- if (m_pBitmap) {
- delete m_pBitmap;
- }
-}
-void CPDF_InlineImages::AddMatrix(CFX_AffineMatrix& matrix)
-{
- m_Matrices.Add(matrix);
- CFX_FloatRect rect = matrix.GetUnitRect();
- if (m_Matrices.GetSize() > 1) {
- CFX_FloatRect rect1(m_Left, m_Bottom, m_Right, m_Top);
- rect.Union(rect1);
- }
- m_Left = rect.left;
- m_Right = rect.right;
- m_Top = rect.top;
- m_Bottom = rect.bottom;
-}
-#endif
+// 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
+
+#include "../../../include/fpdfapi/fpdf_page.h"
+#include "../../../include/fpdfapi/fpdf_module.h"
+#include "pageint.h"
+#if defined(_FPDFAPI_MINI_)
+extern const FX_LPCSTR _PDF_CharType;
+void CPDF_StreamContentParser::InputData(FX_LPCBYTE src_buf, FX_DWORD src_size)
+{
+ if (m_Level > _FPDF_MAX_FORM_LEVEL_) {
+ return;
+ }
+ for (FX_DWORD i = 0; i < src_size; i ++) {
+ int ch = src_buf[i];
+ int type = _PDF_CharType[ch];
+start:
+ switch (m_WordState) {
+ case 0:
+ if (type == 'W') {
+ } else if (type == 'N') {
+ m_WordState = 5;
+ m_pWordBuf[0] = ch;
+ m_WordSize = 1;
+ } else if (type == 'R') {
+ m_WordState = 4;
+ m_pWordBuf[0] = ch;
+ m_WordSize = 1;
+ } else switch (ch) {
+ case '/':
+ m_WordState = 2;
+ m_WordSize = 0;
+ break;
+ case '[':
+ StartArray();
+ break;
+ case ']':
+ EndArray();
+ break;
+ case '(':
+ m_WordState = 7;
+ m_StringLevel = 1;
+ m_StringState = 0;
+ m_StringBuf.Clear();
+ break;
+ case '<':
+ m_WordState = 3;
+ break;
+ case '>':
+ m_WordState = 8;
+ break;
+ case '%':
+ m_WordState = 1;
+ break;
+ }
+ break;
+ case 1:
+ if (ch == '\n' || ch == '\r') {
+ m_WordState = 0;
+ }
+ break;
+ case 2:
+ if (type != 'R' && type != 'N') {
+ EndName();
+ m_WordState = 0;
+ goto start;
+ }
+ if (m_WordSize < 256) {
+ m_pWordBuf[m_WordSize++] = ch;
+ }
+ break;
+ case 3:
+ if (ch == '<') {
+ StartDict();
+ m_WordState = 0;
+ } else {
+ m_StringBuf.Clear();
+ m_WordState = 6;
+ goto start;
+ }
+ break;
+ case 4:
+ if (type != 'R' && type != 'N') {
+ m_WordState = 0;
+ EndKeyword();
+ if (m_bAbort) {
+ return;
+ }
+ goto start;
+ }
+ if (m_WordSize < 256) {
+ m_pWordBuf[m_WordSize++] = ch;
+ }
+ break;
+ case 5:
+ if (type != 'N') {
+ EndNumber();
+ m_WordState = 0;
+ goto start;
+ }
+ if (m_WordSize < 256) {
+ m_pWordBuf[m_WordSize++] = ch;
+ }
+ break;
+ case 6:
+ if (ch == '>') {
+ EndHexString();
+ m_WordState = 0;
+ } else {
+ m_StringBuf.AppendByte(ch);
+ }
+ break;
+ case 7:
+ switch (m_StringState) {
+ case 0:
+ if (ch == ')') {
+ m_StringLevel --;
+ if (m_StringLevel == 0) {
+ EndString();
+ m_WordState = 0;
+ break;
+ }
+ m_StringBuf.AppendByte(')');
+ } else if (ch == '(') {
+ m_StringLevel ++;
+ m_StringBuf.AppendByte('(');
+ } else if (ch == '\\') {
+ m_StringState = 1;
+ } else {
+ m_StringBuf.AppendByte((char)ch);
+ }
+ break;
+ case 1:
+ if (ch >= '0' && ch <= '7') {
+ m_EscCode = ch - '0';
+ m_StringState = 2;
+ break;
+ }
+ if (ch == 'n') {
+ m_StringBuf.AppendByte('\n');
+ } else if (ch == 'r') {
+ m_StringBuf.AppendByte('\r');
+ } else if (ch == 't') {
+ m_StringBuf.AppendByte('\t');
+ } else if (ch == 'b') {
+ m_StringBuf.AppendByte('\b');
+ } else if (ch == 'f') {
+ m_StringBuf.AppendByte('\f');
+ } else if (ch == '\\') {
+ m_StringBuf.AppendByte('\\');
+ } else if (ch == '(') {
+ m_StringBuf.AppendByte('(');
+ } else if (ch == ')') {
+ m_StringBuf.AppendByte(')');
+ } else if (ch == '\r') {
+ m_StringState = 4;
+ break;
+ } else if (ch == '\n') {
+ } else {
+ m_StringBuf.AppendByte(ch);
+ }
+ m_StringState = 0;
+ break;
+ case 2:
+ if (ch >= '0' && ch <= '7') {
+ m_EscCode = m_EscCode * 8 + ch - '0';
+ m_StringState = 3;
+ } else {
+ m_StringBuf.AppendByte(m_EscCode);
+ m_StringState = 0;
+ goto start;
+ }
+ break;
+ case 3:
+ if (ch >= '0' && ch <= '7') {
+ m_EscCode = m_EscCode * 8 + ch - '0';
+ m_StringBuf.AppendByte(m_EscCode);
+ m_StringState = 0;
+ } else {
+ m_StringBuf.AppendByte(m_EscCode);
+ m_StringState = 0;
+ goto start;
+ }
+ break;
+ case 4:
+ m_StringState = 0;
+ if (ch != '\n') {
+ goto start;
+ }
+ break;
+ }
+ break;
+ case 8:
+ m_WordState = 0;
+ if (ch == '>') {
+ EndDict();
+ } else {
+ goto start;
+ }
+ break;
+ case 9:
+ switch (m_InlineImageState) {
+ case 0:
+ if (type == 'W' || type == 'D') {
+ m_InlineImageState = 1;
+ m_InlineWhiteChar = ch;
+ } else {
+ m_StringBuf.AppendByte(ch);
+ }
+ break;
+ case 1:
+ m_StringBuf.AppendByte(m_InlineWhiteChar);
+ if (ch == 'I') {
+ m_InlineImageState = 2;
+ } else {
+ m_InlineImageState = 0;
+ goto start;
+ }
+ break;
+ case 2:
+ if (ch == 'D') {
+ m_InlineImageState = 3;
+ } else {
+ m_StringBuf.AppendByte('I');
+ m_InlineImageState = 0;
+ goto start;
+ }
+ break;
+ case 3:
+ EndImageDict();
+ break;
+ }
+ break;
+ case 10:
+ switch (m_InlineImageState) {
+ case 0:
+ if (type == 'W') {
+ m_InlineImageState = 1;
+ m_InlineWhiteChar = ch;
+ } else {
+ m_ImageSrcBuf.AppendByte(ch);
+ }
+ break;
+ case 1:
+ if (ch == 'E') {
+ m_InlineImageState = 2;
+ } else {
+ m_ImageSrcBuf.AppendByte(m_InlineWhiteChar);
+ m_InlineImageState = 0;
+ goto start;
+ }
+ break;
+ case 2:
+ if (ch == 'I') {
+ m_InlineImageState = 3;
+ } else {
+ m_ImageSrcBuf.AppendByte(m_InlineWhiteChar);
+ m_ImageSrcBuf.AppendByte('E');
+ m_InlineImageState = 0;
+ goto start;
+ }
+ break;
+ case 3:
+ if (type == 'W') {
+ EndInlineImage();
+ } else {
+ m_ImageSrcBuf.AppendByte(m_InlineWhiteChar);
+ m_ImageSrcBuf.AppendByte('E');
+ m_ImageSrcBuf.AppendByte('I');
+ m_InlineImageState = 0;
+ goto start;
+ }
+ break;
+ }
+ break;
+ case 11:
+ if (m_InlineImageState < m_ImageSrcBuf.GetSize()) {
+ m_ImageSrcBuf.GetBuffer()[m_InlineImageState ++] = ch;
+ } else {
+ if (ch == 'I') {
+ EndInlineImage();
+ }
+ }
+ break;
+ }
+ }
+}
+void CPDF_StreamContentParser::Finish()
+{
+ switch (m_WordState) {
+ case 0:
+ break;
+ case 1:
+ break;
+ case 2:
+ EndName();
+ break;
+ case 3:
+ break;
+ case 4:
+ EndKeyword();
+ break;
+ case 5:
+ EndNumber();
+ break;
+ case 6:
+ EndHexString();
+ break;
+ case 7:
+ EndString();
+ break;
+ case 8:
+ break;
+ case 9:
+ break;
+ case 10:
+ EndInlineImage();
+ break;
+ }
+ m_WordState = 0;
+}
+void CPDF_StreamContentParser::AddContainer(CPDF_Object* pObject)
+{
+ if (m_ObjectSize) {
+ m_pObjectState[m_ObjectSize] = SetToCurObj(pObject);
+ }
+ FXSYS_assert(m_ObjectSize < _FPDF_MAX_OBJECT_STACK_SIZE_);
+ m_pObjectStack[m_ObjectSize++] = pObject;
+}
+FX_BOOL CPDF_StreamContentParser::SetToCurObj(CPDF_Object* pObject)
+{
+ if (m_ObjectSize == 0) {
+ AddObjectParam(pObject);
+ return TRUE;
+ }
+ FX_BOOL bInArrayOrDict = TRUE;
+ CPDF_Object* pCurObj = m_pObjectStack[m_ObjectSize - 1];
+ if (pCurObj->GetType() == PDFOBJ_ARRAY) {
+ ((CPDF_Array*)pCurObj)->Add(pObject, m_pDocument);
+ } else {
+ if (!m_bDictName && m_pDictName[0]) {
+ ((CPDF_Dictionary*)pCurObj)->SetAt((FX_LPCSTR)m_pDictName, pObject, m_pDocument);
+ } else {
+ bInArrayOrDict = FALSE;
+ }
+ m_bDictName = TRUE;
+ }
+ return bInArrayOrDict;
+}
+void CPDF_StreamContentParser::StartArray()
+{
+ if (m_ObjectSize)
+ if (m_pObjectStack[0]->GetType() != PDFOBJ_DICTIONARY && m_pObjectStack[m_ObjectSize - 1]->GetType() == PDFOBJ_ARRAY) {
+ return;
+ }
+ CPDF_Array* pArray = FX_NEW CPDF_Array;
+ AddContainer(pArray);
+}
+void CPDF_StreamContentParser::EndArray()
+{
+ if (m_ObjectSize == 0) {
+ return;
+ }
+ CPDF_Object* pCurObj = m_pObjectStack[m_ObjectSize - 1];
+ if (pCurObj->GetType() != PDFOBJ_ARRAY) {
+ return;
+ }
+ m_ObjectSize --;
+ if (m_ObjectSize == 0) {
+ AddObjectParam(pCurObj);
+ } else {
+ if (!m_pObjectState[m_ObjectSize]) {
+ pCurObj->Release();
+ }
+ }
+ m_pObjectState[m_ObjectSize] = FALSE;
+}
+void CPDF_StreamContentParser::StartDict()
+{
+ CPDF_Dictionary* pDict = FX_NEW CPDF_Dictionary;
+ AddContainer(pDict);
+ m_bDictName = TRUE;
+}
+void CPDF_StreamContentParser::EndDict()
+{
+ if (m_ObjectSize == 0) {
+ return;
+ }
+ CPDF_Object* pCurObj = m_pObjectStack[m_ObjectSize - 1];
+ if (pCurObj->GetType() != PDFOBJ_DICTIONARY) {
+ return;
+ }
+ m_ObjectSize --;
+ if (m_ObjectSize == 0) {
+ AddObjectParam(pCurObj);
+ } else {
+ if (!m_pObjectState[m_ObjectSize]) {
+ pCurObj->Release();
+ }
+ }
+ m_pObjectState[m_ObjectSize] = FALSE;
+}
+void CPDF_StreamContentParser::EndName()
+{
+ if (m_ObjectSize == 0) {
+ AddNameParam((FX_LPCSTR)m_pWordBuf, m_WordSize);
+ return;
+ }
+ CPDF_Object* pCurObj = m_pObjectStack[m_ObjectSize - 1];
+ if (pCurObj->GetType() == PDFOBJ_ARRAY) {
+ ((CPDF_Array*)pCurObj)->AddName(CFX_ByteString(m_pWordBuf, m_WordSize));
+ } else {
+ if (m_bDictName) {
+ FXSYS_memcpy32(m_pDictName, m_pWordBuf, m_WordSize);
+ m_pDictName[m_WordSize] = 0;
+ } else {
+ if (m_pDictName[0] != 0) {
+ ((CPDF_Dictionary*)pCurObj)->SetAtName((FX_LPCSTR)m_pDictName, CFX_ByteString(m_pWordBuf, m_WordSize));
+ }
+ }
+ m_bDictName = !m_bDictName;
+ }
+}
+void CPDF_StreamContentParser::EndNumber()
+{
+ if (m_ObjectSize == 0) {
+ AddNumberParam((FX_LPCSTR)m_pWordBuf, m_WordSize);
+ return;
+ }
+ CPDF_Number *pObj = FX_NEW CPDF_Number(CFX_ByteStringC(m_pWordBuf, m_WordSize));
+ if (!SetToCurObj(pObj)) {
+ pObj->Release();
+ }
+}
+extern CFX_ByteString _FPDF_ByteStringFromHex(CFX_BinaryBuf& src_buf);
+void CPDF_StreamContentParser::EndHexString()
+{
+ CPDF_String *pObj = FX_NEW CPDF_String(_FPDF_ByteStringFromHex(m_StringBuf), TRUE);
+ if (!SetToCurObj(pObj)) {
+ pObj->Release();
+ }
+}
+void CPDF_StreamContentParser::EndString()
+{
+ CPDF_String *pObj = FX_NEW CPDF_String(m_StringBuf.GetByteString());
+ if (!SetToCurObj(pObj)) {
+ pObj->Release();
+ }
+}
+void CPDF_StreamContentParser::Handle_BeginImage(void)
+{
+ m_WordState = 9;
+ m_InlineImageState = 0;
+ m_StringBuf.Clear();
+}
+void _PDF_ReplaceAbbr(CPDF_Object* pObj);
+void CPDF_StreamContentParser::EndImageDict()
+{
+ if (m_StringBuf.GetSize() != m_LastImageDict.GetSize() ||
+ FXSYS_memcmp32(m_StringBuf.GetBuffer(), m_LastImageDict.GetBuffer(), m_StringBuf.GetSize())) {
+ m_WordState = 0;
+ StartDict();
+ InputData(m_StringBuf.GetBuffer(), m_StringBuf.GetSize());
+ Finish();
+ m_bSameLastDict = FALSE;
+ if (m_pLastImageDict && m_bReleaseLastDict) {
+ m_pLastImageDict->Release();
+ m_pLastImageDict = NULL;
+ }
+ if (!m_ObjectSize) {
+ m_InlineImageState = 0;
+ return;
+ }
+ m_pLastImageDict = (CPDF_Dictionary*)m_pObjectStack[--m_ObjectSize];
+ m_bReleaseLastDict = !m_pObjectState[m_ObjectSize];
+ m_pObjectState[m_ObjectSize] = FALSE;
+ _PDF_ReplaceAbbr(m_pLastImageDict);
+ m_LastImageDict.TakeOver(m_StringBuf);
+ if (m_pLastImageDict->KeyExist(FX_BSTRC("ColorSpace"))) {
+ CPDF_Object* pCSObj = m_pLastImageDict->GetElementValue(FX_BSTRC("ColorSpace"));
+ if (pCSObj->GetType() == PDFOBJ_NAME) {
+ CFX_ByteString name = pCSObj->GetString();
+ if (name != FX_BSTRC("DeviceRGB") && name != FX_BSTRC("DeviceGray") && name != FX_BSTRC("DeviceCMYK")) {
+ pCSObj = FindResourceObj(FX_BSTRC("ColorSpace"), name);
+ if (pCSObj) {
+ if (!pCSObj->GetObjNum()) {
+ pCSObj = pCSObj->Clone();
+ }
+ m_pLastImageDict->SetAt(FX_BSTRC("ColorSpace"), pCSObj, m_pDocument);
+ }
+ }
+ }
+ }
+ } else {
+ m_bSameLastDict = TRUE;
+ }
+ m_ImageSrcBuf.Clear();
+ if (m_pLastCloneImageDict) {
+ m_pLastCloneImageDict->Release();
+ }
+ m_pLastCloneImageDict = (CPDF_Dictionary*)m_pLastImageDict->Clone();
+ if (m_pLastCloneImageDict->KeyExist(FX_BSTRC("Filter"))) {
+ m_WordState = 10;
+ m_InlineImageState = 0;
+ } else {
+ int width = m_pLastCloneImageDict->GetInteger(FX_BSTRC("Width"));
+ int height = m_pLastCloneImageDict->GetInteger(FX_BSTRC("Height"));
+ int OrigSize = 0;
+ CPDF_Object* pCSObj = m_pLastCloneImageDict->GetElementValue(FX_BSTRC("ColorSpace"));
+ if (pCSObj != NULL) {
+ int bpc = m_pLastCloneImageDict->GetInteger(FX_BSTRC("BitsPerComponent"));
+ int nComponents = 1;
+ CPDF_ColorSpace* pCS = m_pDocument->LoadColorSpace(pCSObj);
+ if (pCS == NULL) {
+ nComponents = 3;
+ } else {
+ nComponents = pCS->CountComponents();
+ m_pDocument->GetPageData()->ReleaseColorSpace(pCSObj);
+ }
+ int pitch = (width * bpc * nComponents + 7) / 8;
+ OrigSize = pitch * height;
+ } else {
+ OrigSize = ((width + 7) / 8) * height;
+ }
+ m_ImageSrcBuf.AppendBlock(NULL, OrigSize);
+ m_WordState = 11;
+ m_InlineImageState = 0;
+ }
+}
+void CPDF_StreamContentParser::EndInlineImage()
+{
+ CFX_AffineMatrix ImageMatrix;
+ ImageMatrix.Copy(m_pCurStates->m_CTM);
+ ImageMatrix.Concat(m_mtContentToUser);
+ m_LastImageData.CopyData(m_ImageSrcBuf.GetBuffer(), m_ImageSrcBuf.GetSize());
+ CPDF_Stream* pStream = CPDF_Stream::Create(m_ImageSrcBuf.GetBuffer(), m_ImageSrcBuf.GetSize(),
+ m_pLastCloneImageDict);
+ m_ImageSrcBuf.DetachBuffer();
+ m_pLastCloneImageDict = NULL;
+ CPDF_InlineImages* pImages = FX_NEW CPDF_InlineImages;
+ pImages->m_pStream = pStream;
+ SetGraphicStates(pImages, !m_pLastCloneImageDict->KeyExist(FX_BSTRC("ColorSpace")), FALSE, FALSE);
+ pImages->AddMatrix(ImageMatrix);
+ m_pObjectList->m_ObjectList.AddTail(pImages);
+ m_WordState = 0;
+}
+#define FXDWORD_TRUE FXDWORD_FROM_LSBFIRST(0x65757274)
+#define FXDWORD_NULL FXDWORD_FROM_LSBFIRST(0x6c6c756e)
+#define FXDWORD_FALS FXDWORD_FROM_LSBFIRST(0x736c6166)
+void CPDF_StreamContentParser::EndKeyword()
+{
+ CPDF_Object *pObj = NULL;
+ if (m_WordSize == 4) {
+ if (*(FX_DWORD*)m_pWordBuf == FXDWORD_TRUE) {
+ pObj = CPDF_Boolean::Create(TRUE);
+ if (!SetToCurObj(pObj)) {
+ pObj->Release();
+ }
+ return;
+ } else if (*(FX_DWORD*)m_pWordBuf == FXDWORD_NULL) {
+ pObj = CPDF_Null::Create();
+ if (!SetToCurObj(pObj)) {
+ pObj->Release();
+ }
+ return;
+ }
+ } else if (m_WordSize == 5) {
+ if (*(FX_DWORD*)m_pWordBuf == FXDWORD_FALS && m_pWordBuf[4] == 'e') {
+ pObj = CPDF_Boolean::Create(FALSE);
+ if (!SetToCurObj(pObj)) {
+ pObj->Release();
+ }
+ return;
+ }
+ }
+ m_pWordBuf[m_WordSize] = 0;
+ OnOperator((char*)m_pWordBuf);
+ ClearAllParams();
+}
+#define PAGEPARSE_STAGE_PARSE 2
+#define PAGEPARSE_STAGE_CHECKCLIP 3
+CPDF_ContentParser::CPDF_ContentParser()
+{
+ m_pParser = NULL;
+ m_Status = Ready;
+ m_pStreamFilter = NULL;
+ m_pType3Char = NULL;
+}
+CPDF_ContentParser::~CPDF_ContentParser()
+{
+ Clear();
+}
+void CPDF_ContentParser::Clear()
+{
+ if (m_pParser) {
+ delete m_pParser;
+ }
+ if (m_pStreamFilter) {
+ delete m_pStreamFilter;
+ }
+ m_pParser = NULL;
+ m_Status = Ready;
+}
+void CPDF_ContentParser::Start(CPDF_Page* pPage, CPDF_ParseOptions* pOptions)
+{
+ if (m_Status != Ready || pPage == NULL || pPage->m_pDocument == NULL || pPage->m_pFormDict == NULL) {
+ m_Status = Done;
+ return;
+ }
+ m_pObjects = pPage;
+ m_bForm = FALSE;
+ if (pOptions) {
+ m_Options = *pOptions;
+ }
+ CPDF_Object* pContent = pPage->m_pFormDict->GetElementValue(FX_BSTRC("Contents"));
+ if (pContent == NULL) {
+ m_Status = Done;
+ return;
+ }
+ if (pContent->GetType() == PDFOBJ_STREAM) {
+ m_nStreams = 1;
+ } else if (pContent->GetType() == PDFOBJ_ARRAY) {
+ m_nStreams = ((CPDF_Array*)pContent)->GetCount();
+ } else {
+ m_Status = Done;
+ return;
+ }
+ m_Status = ToBeContinued;
+ m_InternalStage = PAGEPARSE_STAGE_PARSE;
+ m_CurrentOffset = 0;
+ m_pParser = FX_NEW CPDF_StreamContentParser;
+ m_pParser->Initialize();
+ m_pParser->PrepareParse(pPage->m_pDocument, pPage->m_pResources, NULL, NULL, pPage,
+ pPage->m_pResources, &pPage->m_BBox, &m_Options, NULL, 0);
+ m_pParser->m_pCurStates->m_ColorState.GetModify()->Default();
+}
+void CPDF_ContentParser::Start(CPDF_Form* pForm, CPDF_AllStates* pGraphicStates, CFX_AffineMatrix* pParentMatrix,
+ CPDF_Type3Char* pType3Char, CPDF_ParseOptions* pOptions, int level)
+{
+ m_pType3Char = pType3Char;
+ m_pObjects = pForm;
+ m_bForm = TRUE;
+ CFX_AffineMatrix form_matrix = pForm->m_pFormDict->GetMatrix(FX_BSTRC("Matrix"));
+ if (pGraphicStates) {
+ form_matrix.Concat(pGraphicStates->m_CTM);
+ }
+ CPDF_Array* pBBox = pForm->m_pFormDict->GetArray(FX_BSTRC("BBox"));
+ CFX_FloatRect form_bbox;
+ CPDF_Path ClipPath;
+ if (pBBox) {
+ form_bbox = pBBox->GetRect();
+ ClipPath.New();
+ ClipPath.AppendRect(form_bbox.left, form_bbox.bottom, form_bbox.right, form_bbox.top);
+ ClipPath.Transform(&form_matrix);
+ if (pParentMatrix) {
+ ClipPath.Transform(pParentMatrix);
+ }
+ form_bbox.Transform(&form_matrix);
+ }
+ CPDF_Dictionary* pResources = pForm->m_pFormDict->GetDict(FX_BSTRC("Resources"));
+ m_pParser = FX_NEW CPDF_StreamContentParser;
+ m_pParser->Initialize();
+ m_pParser->PrepareParse(pForm->m_pDocument, pForm->m_pPageResources, pForm->m_pResources, pParentMatrix, pForm,
+ pResources, &form_bbox, pOptions, pGraphicStates, level);
+ m_pParser->m_pCurStates->m_CTM = form_matrix;
+ if (ClipPath.NotNull()) {
+ m_pParser->m_pCurStates->m_ClipPath.AppendPath(ClipPath, FXFILL_WINDING, TRUE);
+ }
+ if (pForm->m_Transparency & PDFTRANS_GROUP) {
+ CPDF_GeneralStateData* pData = m_pParser->m_pCurStates->m_GeneralState.GetModify();
+ pData->m_BlendType = FXDIB_BLEND_NORMAL;
+ pData->m_StrokeAlpha = 1.0f;
+ pData->m_FillAlpha = 1.0f;
+ pData->m_pSoftMask = NULL;
+ }
+ m_pStreamFilter = pForm->m_pFormStream->GetStreamFilter();
+ m_nStreams = 1;
+ m_Status = ToBeContinued;
+ m_InternalStage = PAGEPARSE_STAGE_PARSE;
+ m_CurrentOffset = 0;
+}
+void CPDF_ContentParser::Continue(IFX_Pause* pPause)
+{
+ while (m_Status == ToBeContinued) {
+ if (m_InternalStage == PAGEPARSE_STAGE_PARSE) {
+ if (m_pStreamFilter == NULL) {
+ if (m_CurrentOffset == m_nStreams) {
+ m_InternalStage = PAGEPARSE_STAGE_CHECKCLIP;
+ if (m_pType3Char) {
+ m_pType3Char->m_bColored = m_pParser->m_bColored;
+ m_pType3Char->m_Width = FXSYS_round(m_pParser->m_Type3Data[0] * 1000);
+ m_pType3Char->m_BBox.left = FXSYS_round(m_pParser->m_Type3Data[2] * 1000);
+ m_pType3Char->m_BBox.bottom = FXSYS_round(m_pParser->m_Type3Data[3] * 1000);
+ m_pType3Char->m_BBox.right = FXSYS_round(m_pParser->m_Type3Data[4] * 1000);
+ m_pType3Char->m_BBox.top = FXSYS_round(m_pParser->m_Type3Data[5] * 1000);
+ m_pType3Char->m_bPageRequired = m_pParser->m_bResourceMissing;
+ }
+ delete m_pParser;
+ m_pParser = NULL;
+ continue;
+ }
+ CPDF_Object* pContent = m_pObjects->m_pFormDict->GetElementValue(FX_BSTRC("Contents"));
+ if (pContent->GetType() == PDFOBJ_STREAM) {
+ m_pStreamFilter = ((CPDF_Stream*)pContent)->GetStreamFilter();
+ } else {
+ CPDF_Stream* pStream = ((CPDF_Array*)pContent)->GetStream(m_CurrentOffset);
+ if (pStream == NULL) {
+ m_CurrentOffset ++;
+ continue;
+ }
+ m_pStreamFilter = pStream->GetStreamFilter();
+ }
+ }
+ FX_DWORD len = m_pStreamFilter->ReadBlock(m_pParser->m_pStreamBuf, STREAM_PARSE_BUFSIZE);
+ m_pParser->InputData(m_pParser->m_pStreamBuf, len);
+ if (m_pParser->m_bAbort) {
+ delete m_pStreamFilter;
+ m_pStreamFilter = NULL;
+ m_Status = Done;
+ delete m_pParser;
+ m_pParser = NULL;
+ return;
+ }
+ if (len < STREAM_PARSE_BUFSIZE) {
+ m_pParser->Finish();
+ m_CurrentOffset ++;
+ delete m_pStreamFilter;
+ m_pStreamFilter = NULL;
+ }
+ if (pPause && pPause->NeedToPauseNow()) {
+ return;
+ }
+ }
+ if (m_InternalStage == PAGEPARSE_STAGE_CHECKCLIP) {
+ FX_POSITION pos = m_pObjects->m_ObjectList.GetHeadPosition();
+ while (pos) {
+ CPDF_PageObject* pObj = (CPDF_PageObject*)m_pObjects->m_ObjectList.GetNext(pos);
+ if (pObj == NULL) {
+ continue;
+ }
+ if (pObj->m_ClipPath.IsNull()) {
+ continue;
+ }
+ if (pObj->m_ClipPath.GetPathCount() != 1) {
+ continue;
+ }
+ if (pObj->m_ClipPath.GetTextCount()) {
+ continue;
+ }
+ CPDF_Path ClipPath = pObj->m_ClipPath.GetPath(0);
+ if (!ClipPath.IsRect() || pObj->m_Type == PDFPAGE_SHADING) {
+ continue;
+ }
+ CFX_FloatRect old_rect(ClipPath.GetPointX(0), ClipPath.GetPointY(0),
+ ClipPath.GetPointX(2), ClipPath.GetPointY(2));
+ CFX_FloatRect obj_rect(pObj->m_Left, pObj->m_Bottom, pObj->m_Right, pObj->m_Top);
+ if (old_rect.Contains(obj_rect)) {
+ pObj->m_ClipPath.SetNull();
+ }
+ }
+ if (m_pObjects->m_ObjectList.GetCount() == 1) {
+ CPDF_PageObject* pObj = (CPDF_PageObject*)m_pObjects->m_ObjectList.GetAt(m_pObjects->m_ObjectList.GetHeadPosition());
+ if (pObj && pObj->m_Type == PDFPAGE_TEXT) {
+ CPDF_TextObject* pText = (CPDF_TextObject*)pObj;
+ }
+ }
+ m_Status = Done;
+ return;
+ }
+ }
+}
+int CPDF_ContentParser::EstimateProgress()
+{
+ if (m_Status == Ready) {
+ return 0;
+ }
+ if (m_Status == Done) {
+ return 100;
+ }
+ if (m_InternalStage == PAGEPARSE_STAGE_CHECKCLIP) {
+ return 90;
+ }
+ if (m_pStreamFilter == NULL) {
+ return 90 * m_CurrentOffset / m_nStreams;
+ }
+ int total_raw_size = m_pStreamFilter->GetStream()->GetRawSize() * m_nStreams;
+ int parsed_raw_size = m_pStreamFilter->GetStream()->GetRawSize() * m_CurrentOffset +
+ m_pStreamFilter->GetSrcPos();
+ return 90 * parsed_raw_size / total_raw_size;
+}
+CPDF_InlineImages::CPDF_InlineImages()
+{
+ m_Type = PDFPAGE_INLINES;
+ m_pStream = NULL;
+ m_pBitmap = NULL;
+}
+CPDF_InlineImages::~CPDF_InlineImages()
+{
+ if (m_pStream) {
+ m_pStream->Release();
+ }
+ if (m_pBitmap) {
+ delete m_pBitmap;
+ }
+}
+void CPDF_InlineImages::AddMatrix(CFX_AffineMatrix& matrix)
+{
+ m_Matrices.Add(matrix);
+ CFX_FloatRect rect = matrix.GetUnitRect();
+ if (m_Matrices.GetSize() > 1) {
+ CFX_FloatRect rect1(m_Left, m_Bottom, m_Right, m_Top);
+ rect.Union(rect1);
+ }
+ m_Left = rect.left;
+ m_Right = rect.right;
+ m_Top = rect.top;
+ m_Bottom = rect.bottom;
+}
+#endif
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp
index 2f0a18d62e..cafca2623c 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp
@@ -1,1146 +1,1146 @@
-// 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
-
-#include "../../../include/fpdfapi/fpdf_page.h"
-#include "../../../include/fpdfapi/fpdf_module.h"
-#include "../../../include/fxcodec/fx_codec.h"
-#include "pageint.h"
-#include <limits.h>
-extern const FX_LPCSTR _PDF_OpCharType =
- "IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII"
- "IIVIIIIVIIVIIIIIVVIIIIIIIIIIIIII"
- "IIVVVVVVIVVVVVVIVVVVVIIVVIIIIIII"
- "IIVVVVVVVVVVVVVVIVVVIIVVIVVIIIII"
- "IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII"
- "IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII"
- "IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII"
- "IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII";
-FX_BOOL _PDF_HasInvalidOpChar(FX_LPCSTR op)
-{
- if(!op) {
- return FALSE;
- }
- FX_BYTE ch;
- while((ch = *op++)) {
- if(_PDF_OpCharType[ch] == 'I') {
- return TRUE;
- }
- }
- return FALSE;
-}
-FX_DWORD CPDF_StreamContentParser::Parse(FX_LPCBYTE pData, FX_DWORD dwSize, FX_DWORD max_cost)
-{
- if (m_Level > _FPDF_MAX_FORM_LEVEL_) {
- return dwSize;
- }
- FX_DWORD InitObjCount = m_pObjectList->CountObjects();
- CPDF_StreamParser syntax(pData, dwSize);
- m_pSyntax = &syntax;
- m_CompatCount = 0;
- while (1) {
- FX_DWORD cost = m_pObjectList->CountObjects() - InitObjCount;
- if (max_cost && cost >= max_cost) {
- break;
- }
- switch (syntax.ParseNextElement()) {
- case CPDF_StreamParser::EndOfData:
- return m_pSyntax->GetPos();
- case CPDF_StreamParser::Keyword:
- if(!OnOperator((char*)syntax.GetWordBuf()) && _PDF_HasInvalidOpChar((char*)syntax.GetWordBuf())) {
- m_bAbort = TRUE;
- }
- if (m_bAbort) {
- return m_pSyntax->GetPos();
- }
- ClearAllParams();
- break;
- case CPDF_StreamParser::Number:
- AddNumberParam((char*)syntax.GetWordBuf(), syntax.GetWordSize());
- break;
- case CPDF_StreamParser::Name:
- AddNameParam((FX_LPCSTR)syntax.GetWordBuf() + 1, syntax.GetWordSize() - 1);
- break;
- default:
- AddObjectParam(syntax.GetObject());
- }
- }
- return m_pSyntax->GetPos();
-}
-void _PDF_ReplaceAbbr(CPDF_Object* pObj);
-void CPDF_StreamContentParser::Handle_BeginImage()
-{
- FX_FILESIZE savePos = m_pSyntax->GetPos();
- CPDF_Dictionary* pDict = CPDF_Dictionary::Create();
- while (1) {
- CPDF_StreamParser::SyntaxType type = m_pSyntax->ParseNextElement();
- if (type == CPDF_StreamParser::Keyword) {
- CFX_ByteString bsKeyword(m_pSyntax->GetWordBuf(), m_pSyntax->GetWordSize());
- if (bsKeyword != FX_BSTRC("ID")) {
- m_pSyntax->SetPos(savePos);
- pDict->Release();
- return;
- }
- }
- if (type != CPDF_StreamParser::Name) {
- break;
- }
- CFX_ByteString key((FX_LPCSTR)m_pSyntax->GetWordBuf() + 1, m_pSyntax->GetWordSize() - 1);
- CPDF_Object* pObj = m_pSyntax->ReadNextObject();
- if (!key.IsEmpty()) {
- pDict->SetAt(key, pObj, m_pDocument);
- } else {
- pObj->Release();
- }
- }
- _PDF_ReplaceAbbr(pDict);
- CPDF_Object* pCSObj = NULL;
- if (pDict->KeyExist(FX_BSTRC("ColorSpace"))) {
- pCSObj = pDict->GetElementValue(FX_BSTRC("ColorSpace"));
- if (pCSObj->GetType() == PDFOBJ_NAME) {
- CFX_ByteString name = pCSObj->GetString();
- if (name != FX_BSTRC("DeviceRGB") && name != FX_BSTRC("DeviceGray") && name != FX_BSTRC("DeviceCMYK")) {
- pCSObj = FindResourceObj(FX_BSTRC("ColorSpace"), name);
- if (pCSObj && !pCSObj->GetObjNum()) {
- pCSObj = pCSObj->Clone();
- pDict->SetAt(FX_BSTRC("ColorSpace"), pCSObj, m_pDocument);
- }
- }
- }
- }
- CPDF_Stream* pStream = m_pSyntax->ReadInlineStream(m_pDocument, pDict, pCSObj, m_Options.m_bDecodeInlineImage);
- while (1) {
- CPDF_StreamParser::SyntaxType type = m_pSyntax->ParseNextElement();
- if (type == CPDF_StreamParser::EndOfData) {
- break;
- }
- if (type != CPDF_StreamParser::Keyword) {
- continue;
- }
- if (m_pSyntax->GetWordSize() == 2 && m_pSyntax->GetWordBuf()[0] == 'E' &&
- m_pSyntax->GetWordBuf()[1] == 'I') {
- break;
- }
- }
- if (m_Options.m_bTextOnly) {
- if (pStream) {
- pStream->Release();
- } else {
- pDict->Release();
- }
- return;
- }
- pDict->SetAtName(FX_BSTRC("Subtype"), FX_BSTRC("Image"));
- CPDF_ImageObject *pImgObj = AddImage(pStream, NULL, TRUE);
- if (!pImgObj) {
- if (pStream) {
- pStream->Release();
- } else {
- pDict->Release();
- }
- }
-}
-void CPDF_StreamContentParser::ParsePathObject()
-{
- FX_FLOAT params[6] = {0};
- int nParams = 0;
- int last_pos = m_pSyntax->GetPos();
- while (1) {
- CPDF_StreamParser::SyntaxType type = m_pSyntax->ParseNextElement();
- FX_BOOL bProcessed = TRUE;
- switch (type) {
- case CPDF_StreamParser::EndOfData:
- return;
- case CPDF_StreamParser::Keyword: {
- int len = m_pSyntax->GetWordSize();
- if (len == 1) {
- switch (m_pSyntax->GetWordBuf()[0]) {
- case 'm':
- AddPathPoint(params[0], params[1], FXPT_MOVETO);
- nParams = 0;
- break;
- case 'l':
- AddPathPoint(params[0], params[1], FXPT_LINETO);
- nParams = 0;
- break;
- case 'c':
- AddPathPoint(params[0], params[1], FXPT_BEZIERTO);
- AddPathPoint(params[2], params[3], FXPT_BEZIERTO);
- AddPathPoint(params[4], params[5], FXPT_BEZIERTO);
- nParams = 0;
- break;
- case 'v':
- AddPathPoint(m_PathCurrentX, m_PathCurrentY, FXPT_BEZIERTO);
- AddPathPoint(params[0], params[1], FXPT_BEZIERTO);
- AddPathPoint(params[2], params[3], FXPT_BEZIERTO);
- nParams = 0;
- break;
- case 'y':
- AddPathPoint(params[0], params[1], FXPT_BEZIERTO);
- AddPathPoint(params[2], params[3], FXPT_BEZIERTO);
- AddPathPoint(params[2], params[3], FXPT_BEZIERTO);
- nParams = 0;
- break;
- case 'h':
- Handle_ClosePath();
- nParams = 0;
- break;
- default:
- bProcessed = FALSE;
- break;
- }
- } else if (len == 2) {
- if (m_pSyntax->GetWordBuf()[0] == 'r' && m_pSyntax->GetWordBuf()[1] == 'e') {
- AddPathRect(params[0], params[1], params[2], params[3]);
- nParams = 0;
- } else {
- bProcessed = FALSE;
- }
- } else {
- bProcessed = FALSE;
- }
- if (bProcessed) {
- last_pos = m_pSyntax->GetPos();
- }
- break;
- }
- case CPDF_StreamParser::Number: {
- if (nParams == 6) {
- break;
- }
- FX_BOOL bInteger;
- int value;
- FX_atonum(CFX_ByteStringC(m_pSyntax->GetWordBuf(), m_pSyntax->GetWordSize()), bInteger, &value);
- params[nParams++] = bInteger ? (FX_FLOAT)value : *(FX_FLOAT*)&value;
- break;
- }
- default:
- bProcessed = FALSE;
- }
- if (!bProcessed) {
- m_pSyntax->SetPos(last_pos);
- return;
- }
- }
-}
-CPDF_StreamParser::CPDF_StreamParser(const FX_BYTE* pData, FX_DWORD dwSize)
-{
- m_pBuf = pData;
- m_Size = dwSize;
- m_Pos = 0;
- m_pLastObj = NULL;
-}
-CPDF_StreamParser::~CPDF_StreamParser()
-{
- if (m_pLastObj) {
- m_pLastObj->Release();
- }
-}
-FX_DWORD _DecodeAllScanlines(ICodec_ScanlineDecoder* pDecoder, FX_LPBYTE& dest_buf, FX_DWORD& dest_size)
-{
- if (pDecoder == NULL) {
- return (FX_DWORD) - 1;
- }
- int ncomps = pDecoder->CountComps();
- int bpc = pDecoder->GetBPC();
- int width = pDecoder->GetWidth();
- int height = pDecoder->GetHeight();
- int pitch = (width * ncomps * bpc + 7) / 8;
- if (height == 0 || pitch > (1 << 30) / height) {
- delete pDecoder;
- return -1;
- }
- dest_size = pitch * height;
- dest_buf = FX_Alloc( FX_BYTE, dest_size);
- for (int row = 0; row < height; row ++) {
- FX_LPBYTE pLine = pDecoder->GetScanline(row);
- if (pLine == NULL) {
- break;
- }
- FXSYS_memcpy32(dest_buf + row * pitch, pLine, pitch);
- }
- FX_DWORD srcoff = pDecoder->GetSrcOffset();
- delete pDecoder;
- return srcoff;
-}
-ICodec_ScanlineDecoder* FPDFAPI_CreateFaxDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height,
- const CPDF_Dictionary* pParams);
-FX_DWORD _A85Decode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size);
-FX_DWORD _HexDecode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size);
-FX_DWORD FPDFAPI_FlateOrLZWDecode(FX_BOOL bLZW, const FX_BYTE* src_buf, FX_DWORD src_size, CPDF_Dictionary* pParams,
- FX_DWORD estimated_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size);
-FX_DWORD PDF_DecodeInlineStream(const FX_BYTE* src_buf, FX_DWORD limit,
- int width, int height, CFX_ByteString& decoder,
- CPDF_Dictionary* pParam, FX_LPBYTE& dest_buf, FX_DWORD& dest_size)
-{
- if (decoder == FX_BSTRC("CCITTFaxDecode") || decoder == FX_BSTRC("CCF")) {
- ICodec_ScanlineDecoder* pDecoder = FPDFAPI_CreateFaxDecoder(src_buf, limit, width, height, pParam);
- return _DecodeAllScanlines(pDecoder, dest_buf, dest_size);
- } else if (decoder == FX_BSTRC("ASCII85Decode") || decoder == FX_BSTRC("A85")) {
- return _A85Decode(src_buf, limit, dest_buf, dest_size);
- } else if (decoder == FX_BSTRC("ASCIIHexDecode") || decoder == FX_BSTRC("AHx")) {
- return _HexDecode(src_buf, limit, dest_buf, dest_size);
- } else if (decoder == FX_BSTRC("FlateDecode") || decoder == FX_BSTRC("Fl")) {
- return FPDFAPI_FlateOrLZWDecode(FALSE, src_buf, limit, pParam, dest_size, dest_buf, dest_size);
- } else if (decoder == FX_BSTRC("LZWDecode") || decoder == FX_BSTRC("LZW")) {
- return FPDFAPI_FlateOrLZWDecode(TRUE, src_buf, limit, pParam, 0, dest_buf, dest_size);
- } else if (decoder == FX_BSTRC("DCTDecode") || decoder == FX_BSTRC("DCT")) {
- ICodec_ScanlineDecoder* pDecoder = CPDF_ModuleMgr::Get()->GetJpegModule()->CreateDecoder(
- src_buf, limit, width, height, 0, pParam ? pParam->GetInteger(FX_BSTRC("ColorTransform"), 1) : 1);
- return _DecodeAllScanlines(pDecoder, dest_buf, dest_size);
- } else if (decoder == FX_BSTRC("RunLengthDecode") || decoder == FX_BSTRC("RL")) {
- return RunLengthDecode(src_buf, limit, dest_buf, dest_size);
- }
- dest_size = 0;
- dest_buf = 0;
- return (FX_DWORD) - 1;
-}
-extern const FX_LPCSTR _PDF_CharType;
-CPDF_Stream* CPDF_StreamParser::ReadInlineStream(CPDF_Document* pDoc, CPDF_Dictionary* pDict, CPDF_Object* pCSObj, FX_BOOL bDecode)
-{
- if (m_Pos == m_Size) {
- return NULL;
- }
- if (_PDF_CharType[m_pBuf[m_Pos]] == 'W') {
- m_Pos ++;
- }
- CFX_ByteString Decoder;
- CPDF_Dictionary* pParam = NULL;
- CPDF_Object* pFilter = pDict->GetElementValue(FX_BSTRC("Filter"));
- if (pFilter == NULL) {
- } else if (pFilter->GetType() == PDFOBJ_ARRAY) {
- Decoder = ((CPDF_Array*)pFilter)->GetString(0);
- CPDF_Array* pParams = pDict->GetArray(FX_BSTRC("DecodeParms"));
- if (pParams) {
- pParam = pParams->GetDict(0);
- }
- } else {
- Decoder = pFilter->GetString();
- pParam = pDict->GetDict(FX_BSTRC("DecodeParms"));
- }
- FX_DWORD width = pDict->GetInteger(FX_BSTRC("Width"));
- FX_DWORD height = pDict->GetInteger(FX_BSTRC("Height"));
- FX_DWORD OrigSize = 0;
- if (pCSObj != NULL) {
- FX_DWORD bpc = pDict->GetInteger(FX_BSTRC("BitsPerComponent"));
- FX_DWORD nComponents = 1;
- CPDF_ColorSpace* pCS = pDoc->LoadColorSpace(pCSObj);
- if (pCS == NULL) {
- nComponents = 3;
- } else {
- nComponents = pCS->CountComponents();
- pDoc->GetPageData()->ReleaseColorSpace(pCSObj);
- }
- FX_DWORD pitch = width;
- if (bpc && pitch > INT_MAX / bpc) {
- return NULL;
- }
- pitch *= bpc;
- if (nComponents && pitch > INT_MAX / nComponents) {
- return NULL;
- }
- pitch *= nComponents;
- if (pitch > INT_MAX - 7) {
- return NULL;
- }
- pitch += 7;
- pitch /= 8;
- OrigSize = pitch;
- } else {
- if (width > INT_MAX - 7) {
- return NULL;
- }
- OrigSize = ((width + 7) / 8);
- }
- if (height && OrigSize > INT_MAX / height) {
- return NULL;
- }
- OrigSize *= height;
- FX_LPBYTE pData = NULL;
- FX_DWORD dwStreamSize;
- if (Decoder.IsEmpty()) {
- if (OrigSize > m_Size - m_Pos) {
- OrigSize = m_Size - m_Pos;
- }
- pData = FX_Alloc(FX_BYTE, OrigSize);
- FXSYS_memcpy32(pData, m_pBuf + m_Pos, OrigSize);
- dwStreamSize = OrigSize;
- m_Pos += OrigSize;
- } else {
- FX_DWORD dwDestSize = OrigSize;
- dwStreamSize = PDF_DecodeInlineStream(m_pBuf + m_Pos, m_Size - m_Pos, width, height, Decoder, pParam,
- pData, dwDestSize);
- if ((int)dwStreamSize < 0) {
- return NULL;
- }
- if (bDecode) {
- m_Pos += dwStreamSize;
- dwStreamSize = dwDestSize;
- if (pFilter->GetType() == PDFOBJ_ARRAY) {
- ((CPDF_Array*)pFilter)->RemoveAt(0);
- CPDF_Array* pParams = pDict->GetArray(FX_BSTRC("DecodeParms"));
- if (pParams) {
- pParams->RemoveAt(0);
- }
- } else {
- pDict->RemoveAt(FX_BSTRC("Filter"));
- pDict->RemoveAt(FX_BSTRC("DecodeParms"));
- }
- } else {
- if (pData) {
- FX_Free(pData);
- }
- FX_DWORD dwSavePos = m_Pos;
- m_Pos += dwStreamSize;
- while (1) {
- FX_DWORD dwPrevPos = m_Pos;
- CPDF_StreamParser::SyntaxType type = ParseNextElement();
- if (type == CPDF_StreamParser::EndOfData) {
- break;
- }
- if (type != CPDF_StreamParser::Keyword) {
- dwStreamSize += m_Pos - dwPrevPos;
- continue;
- }
- if (GetWordSize() == 2 && GetWordBuf()[0] == 'E' &&
- GetWordBuf()[1] == 'I') {
- m_Pos = dwPrevPos;
- break;
- }
- dwStreamSize += m_Pos - dwPrevPos;
- }
- m_Pos = dwSavePos;
- pData = FX_Alloc(FX_BYTE, dwStreamSize);
- FXSYS_memcpy32(pData, m_pBuf + m_Pos, dwStreamSize);
- m_Pos += dwStreamSize;
- }
- }
- pDict->SetAtInteger(FX_BSTRC("Length"), (int)dwStreamSize);
- return CPDF_Stream::Create(pData, dwStreamSize, pDict);
-}
-#define MAX_WORD_BUFFER 256
-#define MAX_STRING_LENGTH 32767
-#define FXDWORD_TRUE FXDWORD_FROM_LSBFIRST(0x65757274)
-#define FXDWORD_NULL FXDWORD_FROM_LSBFIRST(0x6c6c756e)
-#define FXDWORD_FALS FXDWORD_FROM_LSBFIRST(0x736c6166)
-CPDF_StreamParser::SyntaxType CPDF_StreamParser::ParseNextElement()
-{
- if (m_pLastObj) {
- m_pLastObj->Release();
- m_pLastObj = NULL;
- }
- m_WordSize = 0;
- FX_BOOL bIsNumber = TRUE;
- if (m_Pos >= m_Size) {
- return EndOfData;
- }
- int ch = m_pBuf[m_Pos++];
- int type = _PDF_CharType[ch];
- while (1) {
- while (type == 'W') {
- if (m_Size <= m_Pos) {
- return EndOfData;
- }
- ch = m_pBuf[m_Pos++];
- type = _PDF_CharType[ch];
- }
- if (ch != '%') {
- break;
- }
- while (1) {
- if (m_Size <= m_Pos) {
- return EndOfData;
- }
- ch = m_pBuf[m_Pos++];
- if (ch == '\r' || ch == '\n') {
- break;
- }
- }
- type = _PDF_CharType[ch];
- }
- if (type == 'D' && ch != '/') {
- m_Pos --;
- m_pLastObj = ReadNextObject();
- return Others;
- }
- while (1) {
- if (m_WordSize < MAX_WORD_BUFFER) {
- m_WordBuffer[m_WordSize++] = ch;
- }
- if (type != 'N') {
- bIsNumber = FALSE;
- }
- if (m_Size <= m_Pos) {
- break;
- }
- ch = m_pBuf[m_Pos++];
- type = _PDF_CharType[ch];
- if (type == 'D' || type == 'W') {
- m_Pos --;
- break;
- }
- }
- m_WordBuffer[m_WordSize] = 0;
- if (bIsNumber) {
- return Number;
- }
- if (m_WordBuffer[0] == '/') {
- return Name;
- }
- if (m_WordSize == 4) {
- if (*(FX_DWORD*)m_WordBuffer == FXDWORD_TRUE) {
- m_pLastObj = CPDF_Boolean::Create(TRUE);
- return Others;
- }
- if (*(FX_DWORD*)m_WordBuffer == FXDWORD_NULL) {
- m_pLastObj = CPDF_Null::Create();
- return Others;
- }
- } else if (m_WordSize == 5) {
- if (*(FX_DWORD*)m_WordBuffer == FXDWORD_FALS && m_WordBuffer[4] == 'e') {
- m_pLastObj = CPDF_Boolean::Create(FALSE);
- return Others;
- }
- }
- return Keyword;
-}
-void CPDF_StreamParser::SkipPathObject()
-{
- FX_DWORD command_startpos = m_Pos;
- if (m_Pos >= m_Size) {
- return;
- }
- int ch = m_pBuf[m_Pos++];
- int type = _PDF_CharType[ch];
- while (1) {
- while (type == 'W') {
- if (m_Pos >= m_Size) {
- return;
- }
- ch = m_pBuf[m_Pos++];
- type = _PDF_CharType[ch];
- }
- if (type != 'N') {
- m_Pos = command_startpos;
- return;
- }
- while (1) {
- while (type != 'W') {
- if (m_Pos >= m_Size) {
- return;
- }
- ch = m_pBuf[m_Pos++];
- type = _PDF_CharType[ch];
- }
- while (type == 'W') {
- if (m_Pos >= m_Size) {
- return;
- }
- ch = m_pBuf[m_Pos++];
- type = _PDF_CharType[ch];
- }
- if (type == 'N') {
- continue;
- }
- FX_DWORD op_startpos = m_Pos - 1;
- while (type != 'W' && type != 'D') {
- if (m_Pos >= m_Size) {
- return;
- }
- ch = m_pBuf[m_Pos++];
- type = _PDF_CharType[ch];
- }
- if (m_Pos - op_startpos == 2) {
- int op = m_pBuf[op_startpos];
- if (op == 'm' || op == 'l' || op == 'c' || op == 'v' || op == 'y') {
- command_startpos = m_Pos;
- break;
- }
- } else if (m_Pos - op_startpos == 3) {
- if (m_pBuf[op_startpos] == 'r' && m_pBuf[op_startpos + 1] == 'e') {
- command_startpos = m_Pos;
- break;
- }
- }
- m_Pos = command_startpos;
- return;
- }
- }
-}
-CPDF_Object* CPDF_StreamParser::ReadNextObject(FX_BOOL bAllowNestedArray, FX_BOOL bInArray)
-{
- FX_BOOL bIsNumber;
- GetNextWord(bIsNumber);
- if (m_WordSize == 0) {
- return NULL;
- }
- if (bIsNumber) {
- m_WordBuffer[m_WordSize] = 0;
- return CPDF_Number::Create(CFX_ByteStringC(m_WordBuffer, m_WordSize));
- }
- int first_char = m_WordBuffer[0];
- if (first_char == '/') {
- return CPDF_Name::Create(PDF_NameDecode(CFX_ByteStringC(m_WordBuffer + 1, m_WordSize - 1)));
- }
- if (first_char == '(') {
- return CPDF_String::Create(ReadString());
- }
- if (first_char == '<') {
- if (m_WordSize == 1) {
- return CPDF_String::Create(ReadHexString(), TRUE);
- }
- CPDF_Dictionary* pDict = CPDF_Dictionary::Create();
- while (1) {
- GetNextWord(bIsNumber);
- if (m_WordSize == 0) {
- pDict->Release();
- return NULL;
- }
- if (m_WordSize == 2 && m_WordBuffer[0] == '>') {
- break;
- }
- if (m_WordBuffer[0] != '/') {
- pDict->Release();
- return NULL;
- }
- CFX_ByteString key = PDF_NameDecode(CFX_ByteStringC(m_WordBuffer + 1, m_WordSize - 1));
- CPDF_Object* pObj = ReadNextObject(TRUE);
- if (pObj == NULL) {
- if (pDict) {
- pDict->Release();
- }
- return NULL;
- }
- if (!key.IsEmpty()) {
- pDict->SetAt(key, pObj);
- } else {
- pObj->Release();
- }
- }
- return pDict;
- }
- if (first_char == '[') {
- if (!bAllowNestedArray && bInArray) {
- return NULL;
- }
- CPDF_Array* pArray = CPDF_Array::Create();
- while (1) {
- CPDF_Object* pObj = ReadNextObject(bAllowNestedArray, TRUE);
- if (pObj == NULL) {
- if (m_WordSize == 0 || m_WordBuffer[0] == ']') {
- return pArray;
- }
- if (m_WordBuffer[0] == '[') {
- continue;
- }
- } else {
- pArray->Add(pObj);
- }
- }
- }
- if (m_WordSize == 4) {
- if (*(FX_DWORD*)m_WordBuffer == FXDWORD_TRUE) {
- return CPDF_Boolean::Create(TRUE);
- }
- if (*(FX_DWORD*)m_WordBuffer == FXDWORD_NULL) {
- return CPDF_Null::Create();
- }
- } else if (m_WordSize == 5) {
- if (*(FX_DWORD*)m_WordBuffer == FXDWORD_FALS && m_WordBuffer[4] == 'e') {
- return CPDF_Boolean::Create(FALSE);
- }
- }
- return NULL;
-}
-void CPDF_StreamParser::GetNextWord(FX_BOOL& bIsNumber)
-{
- m_WordSize = 0;
- bIsNumber = TRUE;
- if (m_Size <= m_Pos) {
- return;
- }
- int ch = m_pBuf[m_Pos++];
- int type = _PDF_CharType[ch];
- while (1) {
- while (type == 'W') {
- if (m_Size <= m_Pos) {
- return;
- }
- ch = m_pBuf[m_Pos++];
- type = _PDF_CharType[ch];
- }
- if (ch != '%') {
- break;
- }
- while (1) {
- if (m_Size <= m_Pos) {
- return;
- }
- ch = m_pBuf[m_Pos++];
- if (ch == '\r' || ch == '\n') {
- break;
- }
- }
- type = _PDF_CharType[ch];
- }
- if (type == 'D') {
- bIsNumber = FALSE;
- m_WordBuffer[m_WordSize++] = ch;
- if (ch == '/') {
- while (1) {
- if (m_Size <= m_Pos) {
- return;
- }
- ch = m_pBuf[m_Pos++];
- type = _PDF_CharType[ch];
- if (type != 'R' && type != 'N') {
- m_Pos --;
- return;
- }
- if (m_WordSize < MAX_WORD_BUFFER) {
- m_WordBuffer[m_WordSize++] = ch;
- }
- }
- } else if (ch == '<') {
- if (m_Size <= m_Pos) {
- return;
- }
- ch = m_pBuf[m_Pos++];
- if (ch == '<') {
- m_WordBuffer[m_WordSize++] = ch;
- } else {
- m_Pos --;
- }
- } else if (ch == '>') {
- if (m_Size <= m_Pos) {
- return;
- }
- ch = m_pBuf[m_Pos++];
- if (ch == '>') {
- m_WordBuffer[m_WordSize++] = ch;
- } else {
- m_Pos --;
- }
- }
- return;
- }
- while (1) {
- if (m_WordSize < MAX_WORD_BUFFER) {
- m_WordBuffer[m_WordSize++] = ch;
- }
- if (type != 'N') {
- bIsNumber = FALSE;
- }
- if (m_Size <= m_Pos) {
- return;
- }
- ch = m_pBuf[m_Pos++];
- type = _PDF_CharType[ch];
- if (type == 'D' || type == 'W') {
- m_Pos --;
- break;
- }
- }
-}
-CFX_ByteString CPDF_StreamParser::ReadString()
-{
- if (m_Size <= m_Pos) {
- return CFX_ByteString();
- }
- int ch = m_pBuf[m_Pos++];
- CFX_ByteTextBuf buf;
- int parlevel = 0;
- int status = 0, iEscCode = 0;
- while (1) {
- switch (status) {
- case 0:
- if (ch == ')') {
- if (parlevel == 0) {
- if (buf.GetLength() > MAX_STRING_LENGTH) {
- return CFX_ByteString(buf.GetBuffer(), MAX_STRING_LENGTH);
- }
- return buf.GetByteString();
- }
- parlevel --;
- buf.AppendChar(')');
- } else if (ch == '(') {
- parlevel ++;
- buf.AppendChar('(');
- } else if (ch == '\\') {
- status = 1;
- } else {
- buf.AppendChar((char)ch);
- }
- break;
- case 1:
- if (ch >= '0' && ch <= '7') {
- iEscCode = ch - '0';
- status = 2;
- break;
- }
- if (ch == 'n') {
- buf.AppendChar('\n');
- } else if (ch == 'r') {
- buf.AppendChar('\r');
- } else if (ch == 't') {
- buf.AppendChar('\t');
- } else if (ch == 'b') {
- buf.AppendChar('\b');
- } else if (ch == 'f') {
- buf.AppendChar('\f');
- } else if (ch == '\r') {
- status = 4;
- break;
- } else if (ch == '\n') {
- } else {
- buf.AppendChar(ch);
- }
- status = 0;
- break;
- case 2:
- if (ch >= '0' && ch <= '7') {
- iEscCode = iEscCode * 8 + ch - '0';
- status = 3;
- } else {
- buf.AppendChar(iEscCode);
- status = 0;
- continue;
- }
- break;
- case 3:
- if (ch >= '0' && ch <= '7') {
- iEscCode = iEscCode * 8 + ch - '0';
- buf.AppendChar(iEscCode);
- status = 0;
- } else {
- buf.AppendChar(iEscCode);
- status = 0;
- continue;
- }
- break;
- case 4:
- status = 0;
- if (ch != '\n') {
- continue;
- }
- break;
- }
- if (m_Size <= m_Pos) {
- break;
- }
- ch = m_pBuf[m_Pos++];
- }
- if (m_Size > m_Pos) {
- ch = m_pBuf[m_Pos++];
- }
- if (buf.GetLength() > MAX_STRING_LENGTH) {
- return CFX_ByteString(buf.GetBuffer(), MAX_STRING_LENGTH);
- }
- return buf.GetByteString();
-}
-CFX_ByteString CPDF_StreamParser::ReadHexString()
-{
- if (m_Size <= m_Pos) {
- return CFX_ByteString();
- }
- int ch = m_pBuf[m_Pos++];
- CFX_ByteTextBuf buf;
- FX_BOOL bFirst = TRUE;
- int code = 0;
- while (1) {
- if (ch == '>') {
- break;
- }
- if (ch >= '0' && ch <= '9') {
- if (bFirst) {
- code = (ch - '0') * 16;
- } else {
- code += ch - '0';
- buf.AppendChar((char)code);
- }
- bFirst = !bFirst;
- } else if (ch >= 'A' && ch <= 'F') {
- if (bFirst) {
- code = (ch - 'A' + 10) * 16;
- } else {
- code += ch - 'A' + 10;
- buf.AppendChar((char)code);
- }
- bFirst = !bFirst;
- } else if (ch >= 'a' && ch <= 'f') {
- if (bFirst) {
- code = (ch - 'a' + 10) * 16;
- } else {
- code += ch - 'a' + 10;
- buf.AppendChar((char)code);
- }
- bFirst = !bFirst;
- }
- if (m_Size <= m_Pos) {
- break;
- }
- ch = m_pBuf[m_Pos++];
- }
- if (!bFirst) {
- buf.AppendChar((char)code);
- }
- if (buf.GetLength() > MAX_STRING_LENGTH) {
- return CFX_ByteString(buf.GetBuffer(), MAX_STRING_LENGTH);
- }
- return buf.GetByteString();
-}
-#define PAGEPARSE_STAGE_GETCONTENT 1
-#define PAGEPARSE_STAGE_PARSE 2
-#define PAGEPARSE_STAGE_CHECKCLIP 3
-CPDF_ContentParser::CPDF_ContentParser()
-{
- m_pParser = NULL;
- m_pStreamArray = NULL;
- m_pSingleStream = NULL;
- m_pData = NULL;
- m_Status = Ready;
- m_pType3Char = NULL;
-}
-CPDF_ContentParser::~CPDF_ContentParser()
-{
- Clear();
-}
-void CPDF_ContentParser::Clear()
-{
- if (m_pParser) {
- delete m_pParser;
- }
- if (m_pSingleStream) {
- delete m_pSingleStream;
- }
- if (m_pStreamArray) {
- for (FX_DWORD i = 0; i < m_nStreams; i ++)
- if (m_pStreamArray[i]) {
- delete m_pStreamArray[i];
- }
- FX_Free(m_pStreamArray);
- }
- if (m_pData && m_pSingleStream == NULL) {
- FX_Free((void*)m_pData);
- }
- m_pParser = NULL;
- m_pStreamArray = NULL;
- m_pSingleStream = NULL;
- m_pData = NULL;
- m_Status = Ready;
-}
-void CPDF_ContentParser::Start(CPDF_Page* pPage, CPDF_ParseOptions* pOptions)
-{
- if (m_Status != Ready || pPage == NULL || pPage->m_pDocument == NULL || pPage->m_pFormDict == NULL) {
- m_Status = Done;
- return;
- }
- m_pObjects = pPage;
- m_bForm = FALSE;
- if (pOptions) {
- m_Options = *pOptions;
- }
- m_Status = ToBeContinued;
- m_InternalStage = PAGEPARSE_STAGE_GETCONTENT;
- m_CurrentOffset = 0;
- CPDF_Object* pContent = pPage->m_pFormDict->GetElementValue(FX_BSTRC("Contents"));
- if (pContent == NULL) {
- m_Status = Done;
- return;
- }
- if (pContent->GetType() == PDFOBJ_STREAM) {
- m_nStreams = 0;
- m_pSingleStream = FX_NEW CPDF_StreamAcc;
- m_pSingleStream->LoadAllData((CPDF_Stream*)pContent, FALSE);
- } else if (pContent->GetType() == PDFOBJ_ARRAY) {
- CPDF_Array* pArray = (CPDF_Array*)pContent;
- m_nStreams = pArray->GetCount();
- if (m_nStreams == 0) {
- m_Status = Done;
- return;
- }
- m_pStreamArray = FX_Alloc(CPDF_StreamAcc*, m_nStreams);
- FXSYS_memset32(m_pStreamArray, 0, sizeof(CPDF_StreamAcc*) * m_nStreams);
- } else {
- m_Status = Done;
- return;
- }
-}
-void CPDF_ContentParser::Start(CPDF_Form* pForm, CPDF_AllStates* pGraphicStates,
- CFX_AffineMatrix* pParentMatrix, CPDF_Type3Char* pType3Char, CPDF_ParseOptions* pOptions, int level)
-{
- m_pType3Char = pType3Char;
- m_pObjects = pForm;
- m_bForm = TRUE;
- CFX_AffineMatrix form_matrix = pForm->m_pFormDict->GetMatrix(FX_BSTRC("Matrix"));
- if (pGraphicStates) {
- form_matrix.Concat(pGraphicStates->m_CTM);
- }
- CPDF_Array* pBBox = pForm->m_pFormDict->GetArray(FX_BSTRC("BBox"));
- CFX_FloatRect form_bbox;
- CPDF_Path ClipPath;
- if (pBBox) {
- form_bbox = pBBox->GetRect();
- ClipPath.New();
- ClipPath.AppendRect(form_bbox.left, form_bbox.bottom, form_bbox.right, form_bbox.top);
- ClipPath.Transform(&form_matrix);
- if (pParentMatrix) {
- ClipPath.Transform(pParentMatrix);
- }
- form_bbox.Transform(&form_matrix);
- if (pParentMatrix) {
- form_bbox.Transform(pParentMatrix);
- }
- }
- CPDF_Dictionary* pResources = pForm->m_pFormDict->GetDict(FX_BSTRC("Resources"));
- m_pParser = FX_NEW CPDF_StreamContentParser;
- m_pParser->Initialize();
- m_pParser->PrepareParse(pForm->m_pDocument, pForm->m_pPageResources, pForm->m_pResources, pParentMatrix, pForm,
- pResources, &form_bbox, pOptions, pGraphicStates, level);
- m_pParser->m_pCurStates->m_CTM = form_matrix;
- m_pParser->m_pCurStates->m_ParentMatrix = form_matrix;
- if (ClipPath.NotNull()) {
- m_pParser->m_pCurStates->m_ClipPath.AppendPath(ClipPath, FXFILL_WINDING, TRUE);
- }
- if (pForm->m_Transparency & PDFTRANS_GROUP) {
- CPDF_GeneralStateData* pData = m_pParser->m_pCurStates->m_GeneralState.GetModify();
- pData->m_BlendType = FXDIB_BLEND_NORMAL;
- pData->m_StrokeAlpha = 1.0f;
- pData->m_FillAlpha = 1.0f;
- pData->m_pSoftMask = NULL;
- }
- m_nStreams = 0;
- m_pSingleStream = FX_NEW CPDF_StreamAcc;
- if (pForm->m_pDocument) {
- m_pSingleStream->LoadAllData(pForm->m_pFormStream, FALSE);
- } else {
- m_pSingleStream->LoadAllData(pForm->m_pFormStream, FALSE);
- }
- m_pData = (FX_LPBYTE)m_pSingleStream->GetData();
- m_Size = m_pSingleStream->GetSize();
- m_Status = ToBeContinued;
- m_InternalStage = PAGEPARSE_STAGE_PARSE;
- m_CurrentOffset = 0;
-}
-void CPDF_ContentParser::Continue(IFX_Pause* pPause)
-{
- int steps = 0;
- while (m_Status == ToBeContinued) {
- if (m_InternalStage == PAGEPARSE_STAGE_GETCONTENT) {
- if (m_CurrentOffset == m_nStreams) {
- if (m_pStreamArray) {
- m_Size = 0;
- FX_DWORD i;
- for (i = 0; i < m_nStreams; i ++) {
- FX_DWORD size = m_pStreamArray[i]->GetSize();
- if (m_Size + size + 1 <= m_Size) {
- m_Status = Done;
- return;
- }
- m_Size += size + 1;
- }
- m_pData = FX_Alloc(FX_BYTE, m_Size);
- if (!m_pData) {
- m_Status = Done;
- return;
- }
- FX_DWORD pos = 0;
- for (i = 0; i < m_nStreams; i ++) {
- FXSYS_memcpy32(m_pData + pos, m_pStreamArray[i]->GetData(), m_pStreamArray[i]->GetSize());
- pos += m_pStreamArray[i]->GetSize() + 1;
- m_pData[pos - 1] = ' ';
- delete m_pStreamArray[i];
- }
- FX_Free(m_pStreamArray);
- m_pStreamArray = NULL;
- } else {
- m_pData = (FX_LPBYTE)m_pSingleStream->GetData();
- m_Size = m_pSingleStream->GetSize();
- }
- m_InternalStage = PAGEPARSE_STAGE_PARSE;
- m_CurrentOffset = 0;
- } else {
- CPDF_Array* pContent = m_pObjects->m_pFormDict->GetArray(FX_BSTRC("Contents"));
- m_pStreamArray[m_CurrentOffset] = FX_NEW CPDF_StreamAcc;
- CPDF_Stream* pStreamObj = (CPDF_Stream*)pContent->GetElementValue(m_CurrentOffset);
- m_pStreamArray[m_CurrentOffset]->LoadAllData(pStreamObj, FALSE);
- m_CurrentOffset ++;
- }
- }
- if (m_InternalStage == PAGEPARSE_STAGE_PARSE) {
- if (m_pParser == NULL) {
- m_pParser = FX_NEW CPDF_StreamContentParser;
- m_pParser->Initialize();
- m_pParser->PrepareParse(m_pObjects->m_pDocument, m_pObjects->m_pPageResources, NULL, NULL, m_pObjects,
- m_pObjects->m_pResources, &m_pObjects->m_BBox, &m_Options, NULL, 0);
- m_pParser->m_pCurStates->m_ColorState.GetModify()->Default();
- }
- if (m_CurrentOffset >= m_Size) {
- m_InternalStage = PAGEPARSE_STAGE_CHECKCLIP;
- } else {
- m_CurrentOffset += m_pParser->Parse(m_pData + m_CurrentOffset, m_Size - m_CurrentOffset, PARSE_STEP_LIMIT);
- if (m_pParser->m_bAbort) {
- m_InternalStage = PAGEPARSE_STAGE_CHECKCLIP;
- continue;
- }
- }
- }
- if (m_InternalStage == PAGEPARSE_STAGE_CHECKCLIP) {
- if (m_pType3Char) {
- m_pType3Char->m_bColored = m_pParser->m_bColored;
- m_pType3Char->m_Width = FXSYS_round(m_pParser->m_Type3Data[0] * 1000);
- m_pType3Char->m_BBox.left = FXSYS_round(m_pParser->m_Type3Data[2] * 1000);
- m_pType3Char->m_BBox.bottom = FXSYS_round(m_pParser->m_Type3Data[3] * 1000);
- m_pType3Char->m_BBox.right = FXSYS_round(m_pParser->m_Type3Data[4] * 1000);
- m_pType3Char->m_BBox.top = FXSYS_round(m_pParser->m_Type3Data[5] * 1000);
- }
- FX_POSITION pos = m_pObjects->m_ObjectList.GetHeadPosition();
- while (pos) {
- CPDF_PageObject* pObj = (CPDF_PageObject*)m_pObjects->m_ObjectList.GetNext(pos);
- if (pObj->m_ClipPath.IsNull()) {
- continue;
- }
- if (pObj->m_ClipPath.GetPathCount() != 1) {
- continue;
- }
- if (pObj->m_ClipPath.GetTextCount()) {
- continue;
- }
- CPDF_Path ClipPath = pObj->m_ClipPath.GetPath(0);
- if (!ClipPath.IsRect() || pObj->m_Type == PDFPAGE_SHADING) {
- continue;
- }
- CFX_FloatRect old_rect(ClipPath.GetPointX(0), ClipPath.GetPointY(0),
- ClipPath.GetPointX(2), ClipPath.GetPointY(2));
- CFX_FloatRect obj_rect(pObj->m_Left, pObj->m_Bottom, pObj->m_Right, pObj->m_Top);
- if (old_rect.Contains(obj_rect)) {
- pObj->m_ClipPath.SetNull();
- }
- }
- m_Status = Done;
- return;
- }
- steps ++;
- if (pPause && pPause->NeedToPauseNow()) {
- break;
- }
- }
-}
-int CPDF_ContentParser::EstimateProgress()
-{
- if (m_Status == Ready) {
- return 0;
- }
- if (m_Status == Done) {
- return 100;
- }
- if (m_InternalStage == PAGEPARSE_STAGE_GETCONTENT) {
- return 10;
- }
- if (m_InternalStage == PAGEPARSE_STAGE_CHECKCLIP) {
- return 90;
- }
- return 10 + 80 * m_CurrentOffset / m_Size;
-}
+// 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
+
+#include "../../../include/fpdfapi/fpdf_page.h"
+#include "../../../include/fpdfapi/fpdf_module.h"
+#include "../../../include/fxcodec/fx_codec.h"
+#include "pageint.h"
+#include <limits.h>
+extern const FX_LPCSTR _PDF_OpCharType =
+ "IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII"
+ "IIVIIIIVIIVIIIIIVVIIIIIIIIIIIIII"
+ "IIVVVVVVIVVVVVVIVVVVVIIVVIIIIIII"
+ "IIVVVVVVVVVVVVVVIVVVIIVVIVVIIIII"
+ "IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII"
+ "IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII"
+ "IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII"
+ "IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII";
+FX_BOOL _PDF_HasInvalidOpChar(FX_LPCSTR op)
+{
+ if(!op) {
+ return FALSE;
+ }
+ FX_BYTE ch;
+ while((ch = *op++)) {
+ if(_PDF_OpCharType[ch] == 'I') {
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+FX_DWORD CPDF_StreamContentParser::Parse(FX_LPCBYTE pData, FX_DWORD dwSize, FX_DWORD max_cost)
+{
+ if (m_Level > _FPDF_MAX_FORM_LEVEL_) {
+ return dwSize;
+ }
+ FX_DWORD InitObjCount = m_pObjectList->CountObjects();
+ CPDF_StreamParser syntax(pData, dwSize);
+ m_pSyntax = &syntax;
+ m_CompatCount = 0;
+ while (1) {
+ FX_DWORD cost = m_pObjectList->CountObjects() - InitObjCount;
+ if (max_cost && cost >= max_cost) {
+ break;
+ }
+ switch (syntax.ParseNextElement()) {
+ case CPDF_StreamParser::EndOfData:
+ return m_pSyntax->GetPos();
+ case CPDF_StreamParser::Keyword:
+ if(!OnOperator((char*)syntax.GetWordBuf()) && _PDF_HasInvalidOpChar((char*)syntax.GetWordBuf())) {
+ m_bAbort = TRUE;
+ }
+ if (m_bAbort) {
+ return m_pSyntax->GetPos();
+ }
+ ClearAllParams();
+ break;
+ case CPDF_StreamParser::Number:
+ AddNumberParam((char*)syntax.GetWordBuf(), syntax.GetWordSize());
+ break;
+ case CPDF_StreamParser::Name:
+ AddNameParam((FX_LPCSTR)syntax.GetWordBuf() + 1, syntax.GetWordSize() - 1);
+ break;
+ default:
+ AddObjectParam(syntax.GetObject());
+ }
+ }
+ return m_pSyntax->GetPos();
+}
+void _PDF_ReplaceAbbr(CPDF_Object* pObj);
+void CPDF_StreamContentParser::Handle_BeginImage()
+{
+ FX_FILESIZE savePos = m_pSyntax->GetPos();
+ CPDF_Dictionary* pDict = CPDF_Dictionary::Create();
+ while (1) {
+ CPDF_StreamParser::SyntaxType type = m_pSyntax->ParseNextElement();
+ if (type == CPDF_StreamParser::Keyword) {
+ CFX_ByteString bsKeyword(m_pSyntax->GetWordBuf(), m_pSyntax->GetWordSize());
+ if (bsKeyword != FX_BSTRC("ID")) {
+ m_pSyntax->SetPos(savePos);
+ pDict->Release();
+ return;
+ }
+ }
+ if (type != CPDF_StreamParser::Name) {
+ break;
+ }
+ CFX_ByteString key((FX_LPCSTR)m_pSyntax->GetWordBuf() + 1, m_pSyntax->GetWordSize() - 1);
+ CPDF_Object* pObj = m_pSyntax->ReadNextObject();
+ if (!key.IsEmpty()) {
+ pDict->SetAt(key, pObj, m_pDocument);
+ } else {
+ pObj->Release();
+ }
+ }
+ _PDF_ReplaceAbbr(pDict);
+ CPDF_Object* pCSObj = NULL;
+ if (pDict->KeyExist(FX_BSTRC("ColorSpace"))) {
+ pCSObj = pDict->GetElementValue(FX_BSTRC("ColorSpace"));
+ if (pCSObj->GetType() == PDFOBJ_NAME) {
+ CFX_ByteString name = pCSObj->GetString();
+ if (name != FX_BSTRC("DeviceRGB") && name != FX_BSTRC("DeviceGray") && name != FX_BSTRC("DeviceCMYK")) {
+ pCSObj = FindResourceObj(FX_BSTRC("ColorSpace"), name);
+ if (pCSObj && !pCSObj->GetObjNum()) {
+ pCSObj = pCSObj->Clone();
+ pDict->SetAt(FX_BSTRC("ColorSpace"), pCSObj, m_pDocument);
+ }
+ }
+ }
+ }
+ CPDF_Stream* pStream = m_pSyntax->ReadInlineStream(m_pDocument, pDict, pCSObj, m_Options.m_bDecodeInlineImage);
+ while (1) {
+ CPDF_StreamParser::SyntaxType type = m_pSyntax->ParseNextElement();
+ if (type == CPDF_StreamParser::EndOfData) {
+ break;
+ }
+ if (type != CPDF_StreamParser::Keyword) {
+ continue;
+ }
+ if (m_pSyntax->GetWordSize() == 2 && m_pSyntax->GetWordBuf()[0] == 'E' &&
+ m_pSyntax->GetWordBuf()[1] == 'I') {
+ break;
+ }
+ }
+ if (m_Options.m_bTextOnly) {
+ if (pStream) {
+ pStream->Release();
+ } else {
+ pDict->Release();
+ }
+ return;
+ }
+ pDict->SetAtName(FX_BSTRC("Subtype"), FX_BSTRC("Image"));
+ CPDF_ImageObject *pImgObj = AddImage(pStream, NULL, TRUE);
+ if (!pImgObj) {
+ if (pStream) {
+ pStream->Release();
+ } else {
+ pDict->Release();
+ }
+ }
+}
+void CPDF_StreamContentParser::ParsePathObject()
+{
+ FX_FLOAT params[6] = {0};
+ int nParams = 0;
+ int last_pos = m_pSyntax->GetPos();
+ while (1) {
+ CPDF_StreamParser::SyntaxType type = m_pSyntax->ParseNextElement();
+ FX_BOOL bProcessed = TRUE;
+ switch (type) {
+ case CPDF_StreamParser::EndOfData:
+ return;
+ case CPDF_StreamParser::Keyword: {
+ int len = m_pSyntax->GetWordSize();
+ if (len == 1) {
+ switch (m_pSyntax->GetWordBuf()[0]) {
+ case 'm':
+ AddPathPoint(params[0], params[1], FXPT_MOVETO);
+ nParams = 0;
+ break;
+ case 'l':
+ AddPathPoint(params[0], params[1], FXPT_LINETO);
+ nParams = 0;
+ break;
+ case 'c':
+ AddPathPoint(params[0], params[1], FXPT_BEZIERTO);
+ AddPathPoint(params[2], params[3], FXPT_BEZIERTO);
+ AddPathPoint(params[4], params[5], FXPT_BEZIERTO);
+ nParams = 0;
+ break;
+ case 'v':
+ AddPathPoint(m_PathCurrentX, m_PathCurrentY, FXPT_BEZIERTO);
+ AddPathPoint(params[0], params[1], FXPT_BEZIERTO);
+ AddPathPoint(params[2], params[3], FXPT_BEZIERTO);
+ nParams = 0;
+ break;
+ case 'y':
+ AddPathPoint(params[0], params[1], FXPT_BEZIERTO);
+ AddPathPoint(params[2], params[3], FXPT_BEZIERTO);
+ AddPathPoint(params[2], params[3], FXPT_BEZIERTO);
+ nParams = 0;
+ break;
+ case 'h':
+ Handle_ClosePath();
+ nParams = 0;
+ break;
+ default:
+ bProcessed = FALSE;
+ break;
+ }
+ } else if (len == 2) {
+ if (m_pSyntax->GetWordBuf()[0] == 'r' && m_pSyntax->GetWordBuf()[1] == 'e') {
+ AddPathRect(params[0], params[1], params[2], params[3]);
+ nParams = 0;
+ } else {
+ bProcessed = FALSE;
+ }
+ } else {
+ bProcessed = FALSE;
+ }
+ if (bProcessed) {
+ last_pos = m_pSyntax->GetPos();
+ }
+ break;
+ }
+ case CPDF_StreamParser::Number: {
+ if (nParams == 6) {
+ break;
+ }
+ FX_BOOL bInteger;
+ int value;
+ FX_atonum(CFX_ByteStringC(m_pSyntax->GetWordBuf(), m_pSyntax->GetWordSize()), bInteger, &value);
+ params[nParams++] = bInteger ? (FX_FLOAT)value : *(FX_FLOAT*)&value;
+ break;
+ }
+ default:
+ bProcessed = FALSE;
+ }
+ if (!bProcessed) {
+ m_pSyntax->SetPos(last_pos);
+ return;
+ }
+ }
+}
+CPDF_StreamParser::CPDF_StreamParser(const FX_BYTE* pData, FX_DWORD dwSize)
+{
+ m_pBuf = pData;
+ m_Size = dwSize;
+ m_Pos = 0;
+ m_pLastObj = NULL;
+}
+CPDF_StreamParser::~CPDF_StreamParser()
+{
+ if (m_pLastObj) {
+ m_pLastObj->Release();
+ }
+}
+FX_DWORD _DecodeAllScanlines(ICodec_ScanlineDecoder* pDecoder, FX_LPBYTE& dest_buf, FX_DWORD& dest_size)
+{
+ if (pDecoder == NULL) {
+ return (FX_DWORD) - 1;
+ }
+ int ncomps = pDecoder->CountComps();
+ int bpc = pDecoder->GetBPC();
+ int width = pDecoder->GetWidth();
+ int height = pDecoder->GetHeight();
+ int pitch = (width * ncomps * bpc + 7) / 8;
+ if (height == 0 || pitch > (1 << 30) / height) {
+ delete pDecoder;
+ return -1;
+ }
+ dest_size = pitch * height;
+ dest_buf = FX_Alloc( FX_BYTE, dest_size);
+ for (int row = 0; row < height; row ++) {
+ FX_LPBYTE pLine = pDecoder->GetScanline(row);
+ if (pLine == NULL) {
+ break;
+ }
+ FXSYS_memcpy32(dest_buf + row * pitch, pLine, pitch);
+ }
+ FX_DWORD srcoff = pDecoder->GetSrcOffset();
+ delete pDecoder;
+ return srcoff;
+}
+ICodec_ScanlineDecoder* FPDFAPI_CreateFaxDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height,
+ const CPDF_Dictionary* pParams);
+FX_DWORD _A85Decode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size);
+FX_DWORD _HexDecode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size);
+FX_DWORD FPDFAPI_FlateOrLZWDecode(FX_BOOL bLZW, const FX_BYTE* src_buf, FX_DWORD src_size, CPDF_Dictionary* pParams,
+ FX_DWORD estimated_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size);
+FX_DWORD PDF_DecodeInlineStream(const FX_BYTE* src_buf, FX_DWORD limit,
+ int width, int height, CFX_ByteString& decoder,
+ CPDF_Dictionary* pParam, FX_LPBYTE& dest_buf, FX_DWORD& dest_size)
+{
+ if (decoder == FX_BSTRC("CCITTFaxDecode") || decoder == FX_BSTRC("CCF")) {
+ ICodec_ScanlineDecoder* pDecoder = FPDFAPI_CreateFaxDecoder(src_buf, limit, width, height, pParam);
+ return _DecodeAllScanlines(pDecoder, dest_buf, dest_size);
+ } else if (decoder == FX_BSTRC("ASCII85Decode") || decoder == FX_BSTRC("A85")) {
+ return _A85Decode(src_buf, limit, dest_buf, dest_size);
+ } else if (decoder == FX_BSTRC("ASCIIHexDecode") || decoder == FX_BSTRC("AHx")) {
+ return _HexDecode(src_buf, limit, dest_buf, dest_size);
+ } else if (decoder == FX_BSTRC("FlateDecode") || decoder == FX_BSTRC("Fl")) {
+ return FPDFAPI_FlateOrLZWDecode(FALSE, src_buf, limit, pParam, dest_size, dest_buf, dest_size);
+ } else if (decoder == FX_BSTRC("LZWDecode") || decoder == FX_BSTRC("LZW")) {
+ return FPDFAPI_FlateOrLZWDecode(TRUE, src_buf, limit, pParam, 0, dest_buf, dest_size);
+ } else if (decoder == FX_BSTRC("DCTDecode") || decoder == FX_BSTRC("DCT")) {
+ ICodec_ScanlineDecoder* pDecoder = CPDF_ModuleMgr::Get()->GetJpegModule()->CreateDecoder(
+ src_buf, limit, width, height, 0, pParam ? pParam->GetInteger(FX_BSTRC("ColorTransform"), 1) : 1);
+ return _DecodeAllScanlines(pDecoder, dest_buf, dest_size);
+ } else if (decoder == FX_BSTRC("RunLengthDecode") || decoder == FX_BSTRC("RL")) {
+ return RunLengthDecode(src_buf, limit, dest_buf, dest_size);
+ }
+ dest_size = 0;
+ dest_buf = 0;
+ return (FX_DWORD) - 1;
+}
+extern const FX_LPCSTR _PDF_CharType;
+CPDF_Stream* CPDF_StreamParser::ReadInlineStream(CPDF_Document* pDoc, CPDF_Dictionary* pDict, CPDF_Object* pCSObj, FX_BOOL bDecode)
+{
+ if (m_Pos == m_Size) {
+ return NULL;
+ }
+ if (_PDF_CharType[m_pBuf[m_Pos]] == 'W') {
+ m_Pos ++;
+ }
+ CFX_ByteString Decoder;
+ CPDF_Dictionary* pParam = NULL;
+ CPDF_Object* pFilter = pDict->GetElementValue(FX_BSTRC("Filter"));
+ if (pFilter == NULL) {
+ } else if (pFilter->GetType() == PDFOBJ_ARRAY) {
+ Decoder = ((CPDF_Array*)pFilter)->GetString(0);
+ CPDF_Array* pParams = pDict->GetArray(FX_BSTRC("DecodeParms"));
+ if (pParams) {
+ pParam = pParams->GetDict(0);
+ }
+ } else {
+ Decoder = pFilter->GetString();
+ pParam = pDict->GetDict(FX_BSTRC("DecodeParms"));
+ }
+ FX_DWORD width = pDict->GetInteger(FX_BSTRC("Width"));
+ FX_DWORD height = pDict->GetInteger(FX_BSTRC("Height"));
+ FX_DWORD OrigSize = 0;
+ if (pCSObj != NULL) {
+ FX_DWORD bpc = pDict->GetInteger(FX_BSTRC("BitsPerComponent"));
+ FX_DWORD nComponents = 1;
+ CPDF_ColorSpace* pCS = pDoc->LoadColorSpace(pCSObj);
+ if (pCS == NULL) {
+ nComponents = 3;
+ } else {
+ nComponents = pCS->CountComponents();
+ pDoc->GetPageData()->ReleaseColorSpace(pCSObj);
+ }
+ FX_DWORD pitch = width;
+ if (bpc && pitch > INT_MAX / bpc) {
+ return NULL;
+ }
+ pitch *= bpc;
+ if (nComponents && pitch > INT_MAX / nComponents) {
+ return NULL;
+ }
+ pitch *= nComponents;
+ if (pitch > INT_MAX - 7) {
+ return NULL;
+ }
+ pitch += 7;
+ pitch /= 8;
+ OrigSize = pitch;
+ } else {
+ if (width > INT_MAX - 7) {
+ return NULL;
+ }
+ OrigSize = ((width + 7) / 8);
+ }
+ if (height && OrigSize > INT_MAX / height) {
+ return NULL;
+ }
+ OrigSize *= height;
+ FX_LPBYTE pData = NULL;
+ FX_DWORD dwStreamSize;
+ if (Decoder.IsEmpty()) {
+ if (OrigSize > m_Size - m_Pos) {
+ OrigSize = m_Size - m_Pos;
+ }
+ pData = FX_Alloc(FX_BYTE, OrigSize);
+ FXSYS_memcpy32(pData, m_pBuf + m_Pos, OrigSize);
+ dwStreamSize = OrigSize;
+ m_Pos += OrigSize;
+ } else {
+ FX_DWORD dwDestSize = OrigSize;
+ dwStreamSize = PDF_DecodeInlineStream(m_pBuf + m_Pos, m_Size - m_Pos, width, height, Decoder, pParam,
+ pData, dwDestSize);
+ if ((int)dwStreamSize < 0) {
+ return NULL;
+ }
+ if (bDecode) {
+ m_Pos += dwStreamSize;
+ dwStreamSize = dwDestSize;
+ if (pFilter->GetType() == PDFOBJ_ARRAY) {
+ ((CPDF_Array*)pFilter)->RemoveAt(0);
+ CPDF_Array* pParams = pDict->GetArray(FX_BSTRC("DecodeParms"));
+ if (pParams) {
+ pParams->RemoveAt(0);
+ }
+ } else {
+ pDict->RemoveAt(FX_BSTRC("Filter"));
+ pDict->RemoveAt(FX_BSTRC("DecodeParms"));
+ }
+ } else {
+ if (pData) {
+ FX_Free(pData);
+ }
+ FX_DWORD dwSavePos = m_Pos;
+ m_Pos += dwStreamSize;
+ while (1) {
+ FX_DWORD dwPrevPos = m_Pos;
+ CPDF_StreamParser::SyntaxType type = ParseNextElement();
+ if (type == CPDF_StreamParser::EndOfData) {
+ break;
+ }
+ if (type != CPDF_StreamParser::Keyword) {
+ dwStreamSize += m_Pos - dwPrevPos;
+ continue;
+ }
+ if (GetWordSize() == 2 && GetWordBuf()[0] == 'E' &&
+ GetWordBuf()[1] == 'I') {
+ m_Pos = dwPrevPos;
+ break;
+ }
+ dwStreamSize += m_Pos - dwPrevPos;
+ }
+ m_Pos = dwSavePos;
+ pData = FX_Alloc(FX_BYTE, dwStreamSize);
+ FXSYS_memcpy32(pData, m_pBuf + m_Pos, dwStreamSize);
+ m_Pos += dwStreamSize;
+ }
+ }
+ pDict->SetAtInteger(FX_BSTRC("Length"), (int)dwStreamSize);
+ return CPDF_Stream::Create(pData, dwStreamSize, pDict);
+}
+#define MAX_WORD_BUFFER 256
+#define MAX_STRING_LENGTH 32767
+#define FXDWORD_TRUE FXDWORD_FROM_LSBFIRST(0x65757274)
+#define FXDWORD_NULL FXDWORD_FROM_LSBFIRST(0x6c6c756e)
+#define FXDWORD_FALS FXDWORD_FROM_LSBFIRST(0x736c6166)
+CPDF_StreamParser::SyntaxType CPDF_StreamParser::ParseNextElement()
+{
+ if (m_pLastObj) {
+ m_pLastObj->Release();
+ m_pLastObj = NULL;
+ }
+ m_WordSize = 0;
+ FX_BOOL bIsNumber = TRUE;
+ if (m_Pos >= m_Size) {
+ return EndOfData;
+ }
+ int ch = m_pBuf[m_Pos++];
+ int type = _PDF_CharType[ch];
+ while (1) {
+ while (type == 'W') {
+ if (m_Size <= m_Pos) {
+ return EndOfData;
+ }
+ ch = m_pBuf[m_Pos++];
+ type = _PDF_CharType[ch];
+ }
+ if (ch != '%') {
+ break;
+ }
+ while (1) {
+ if (m_Size <= m_Pos) {
+ return EndOfData;
+ }
+ ch = m_pBuf[m_Pos++];
+ if (ch == '\r' || ch == '\n') {
+ break;
+ }
+ }
+ type = _PDF_CharType[ch];
+ }
+ if (type == 'D' && ch != '/') {
+ m_Pos --;
+ m_pLastObj = ReadNextObject();
+ return Others;
+ }
+ while (1) {
+ if (m_WordSize < MAX_WORD_BUFFER) {
+ m_WordBuffer[m_WordSize++] = ch;
+ }
+ if (type != 'N') {
+ bIsNumber = FALSE;
+ }
+ if (m_Size <= m_Pos) {
+ break;
+ }
+ ch = m_pBuf[m_Pos++];
+ type = _PDF_CharType[ch];
+ if (type == 'D' || type == 'W') {
+ m_Pos --;
+ break;
+ }
+ }
+ m_WordBuffer[m_WordSize] = 0;
+ if (bIsNumber) {
+ return Number;
+ }
+ if (m_WordBuffer[0] == '/') {
+ return Name;
+ }
+ if (m_WordSize == 4) {
+ if (*(FX_DWORD*)m_WordBuffer == FXDWORD_TRUE) {
+ m_pLastObj = CPDF_Boolean::Create(TRUE);
+ return Others;
+ }
+ if (*(FX_DWORD*)m_WordBuffer == FXDWORD_NULL) {
+ m_pLastObj = CPDF_Null::Create();
+ return Others;
+ }
+ } else if (m_WordSize == 5) {
+ if (*(FX_DWORD*)m_WordBuffer == FXDWORD_FALS && m_WordBuffer[4] == 'e') {
+ m_pLastObj = CPDF_Boolean::Create(FALSE);
+ return Others;
+ }
+ }
+ return Keyword;
+}
+void CPDF_StreamParser::SkipPathObject()
+{
+ FX_DWORD command_startpos = m_Pos;
+ if (m_Pos >= m_Size) {
+ return;
+ }
+ int ch = m_pBuf[m_Pos++];
+ int type = _PDF_CharType[ch];
+ while (1) {
+ while (type == 'W') {
+ if (m_Pos >= m_Size) {
+ return;
+ }
+ ch = m_pBuf[m_Pos++];
+ type = _PDF_CharType[ch];
+ }
+ if (type != 'N') {
+ m_Pos = command_startpos;
+ return;
+ }
+ while (1) {
+ while (type != 'W') {
+ if (m_Pos >= m_Size) {
+ return;
+ }
+ ch = m_pBuf[m_Pos++];
+ type = _PDF_CharType[ch];
+ }
+ while (type == 'W') {
+ if (m_Pos >= m_Size) {
+ return;
+ }
+ ch = m_pBuf[m_Pos++];
+ type = _PDF_CharType[ch];
+ }
+ if (type == 'N') {
+ continue;
+ }
+ FX_DWORD op_startpos = m_Pos - 1;
+ while (type != 'W' && type != 'D') {
+ if (m_Pos >= m_Size) {
+ return;
+ }
+ ch = m_pBuf[m_Pos++];
+ type = _PDF_CharType[ch];
+ }
+ if (m_Pos - op_startpos == 2) {
+ int op = m_pBuf[op_startpos];
+ if (op == 'm' || op == 'l' || op == 'c' || op == 'v' || op == 'y') {
+ command_startpos = m_Pos;
+ break;
+ }
+ } else if (m_Pos - op_startpos == 3) {
+ if (m_pBuf[op_startpos] == 'r' && m_pBuf[op_startpos + 1] == 'e') {
+ command_startpos = m_Pos;
+ break;
+ }
+ }
+ m_Pos = command_startpos;
+ return;
+ }
+ }
+}
+CPDF_Object* CPDF_StreamParser::ReadNextObject(FX_BOOL bAllowNestedArray, FX_BOOL bInArray)
+{
+ FX_BOOL bIsNumber;
+ GetNextWord(bIsNumber);
+ if (m_WordSize == 0) {
+ return NULL;
+ }
+ if (bIsNumber) {
+ m_WordBuffer[m_WordSize] = 0;
+ return CPDF_Number::Create(CFX_ByteStringC(m_WordBuffer, m_WordSize));
+ }
+ int first_char = m_WordBuffer[0];
+ if (first_char == '/') {
+ return CPDF_Name::Create(PDF_NameDecode(CFX_ByteStringC(m_WordBuffer + 1, m_WordSize - 1)));
+ }
+ if (first_char == '(') {
+ return CPDF_String::Create(ReadString());
+ }
+ if (first_char == '<') {
+ if (m_WordSize == 1) {
+ return CPDF_String::Create(ReadHexString(), TRUE);
+ }
+ CPDF_Dictionary* pDict = CPDF_Dictionary::Create();
+ while (1) {
+ GetNextWord(bIsNumber);
+ if (m_WordSize == 0) {
+ pDict->Release();
+ return NULL;
+ }
+ if (m_WordSize == 2 && m_WordBuffer[0] == '>') {
+ break;
+ }
+ if (m_WordBuffer[0] != '/') {
+ pDict->Release();
+ return NULL;
+ }
+ CFX_ByteString key = PDF_NameDecode(CFX_ByteStringC(m_WordBuffer + 1, m_WordSize - 1));
+ CPDF_Object* pObj = ReadNextObject(TRUE);
+ if (pObj == NULL) {
+ if (pDict) {
+ pDict->Release();
+ }
+ return NULL;
+ }
+ if (!key.IsEmpty()) {
+ pDict->SetAt(key, pObj);
+ } else {
+ pObj->Release();
+ }
+ }
+ return pDict;
+ }
+ if (first_char == '[') {
+ if (!bAllowNestedArray && bInArray) {
+ return NULL;
+ }
+ CPDF_Array* pArray = CPDF_Array::Create();
+ while (1) {
+ CPDF_Object* pObj = ReadNextObject(bAllowNestedArray, TRUE);
+ if (pObj == NULL) {
+ if (m_WordSize == 0 || m_WordBuffer[0] == ']') {
+ return pArray;
+ }
+ if (m_WordBuffer[0] == '[') {
+ continue;
+ }
+ } else {
+ pArray->Add(pObj);
+ }
+ }
+ }
+ if (m_WordSize == 4) {
+ if (*(FX_DWORD*)m_WordBuffer == FXDWORD_TRUE) {
+ return CPDF_Boolean::Create(TRUE);
+ }
+ if (*(FX_DWORD*)m_WordBuffer == FXDWORD_NULL) {
+ return CPDF_Null::Create();
+ }
+ } else if (m_WordSize == 5) {
+ if (*(FX_DWORD*)m_WordBuffer == FXDWORD_FALS && m_WordBuffer[4] == 'e') {
+ return CPDF_Boolean::Create(FALSE);
+ }
+ }
+ return NULL;
+}
+void CPDF_StreamParser::GetNextWord(FX_BOOL& bIsNumber)
+{
+ m_WordSize = 0;
+ bIsNumber = TRUE;
+ if (m_Size <= m_Pos) {
+ return;
+ }
+ int ch = m_pBuf[m_Pos++];
+ int type = _PDF_CharType[ch];
+ while (1) {
+ while (type == 'W') {
+ if (m_Size <= m_Pos) {
+ return;
+ }
+ ch = m_pBuf[m_Pos++];
+ type = _PDF_CharType[ch];
+ }
+ if (ch != '%') {
+ break;
+ }
+ while (1) {
+ if (m_Size <= m_Pos) {
+ return;
+ }
+ ch = m_pBuf[m_Pos++];
+ if (ch == '\r' || ch == '\n') {
+ break;
+ }
+ }
+ type = _PDF_CharType[ch];
+ }
+ if (type == 'D') {
+ bIsNumber = FALSE;
+ m_WordBuffer[m_WordSize++] = ch;
+ if (ch == '/') {
+ while (1) {
+ if (m_Size <= m_Pos) {
+ return;
+ }
+ ch = m_pBuf[m_Pos++];
+ type = _PDF_CharType[ch];
+ if (type != 'R' && type != 'N') {
+ m_Pos --;
+ return;
+ }
+ if (m_WordSize < MAX_WORD_BUFFER) {
+ m_WordBuffer[m_WordSize++] = ch;
+ }
+ }
+ } else if (ch == '<') {
+ if (m_Size <= m_Pos) {
+ return;
+ }
+ ch = m_pBuf[m_Pos++];
+ if (ch == '<') {
+ m_WordBuffer[m_WordSize++] = ch;
+ } else {
+ m_Pos --;
+ }
+ } else if (ch == '>') {
+ if (m_Size <= m_Pos) {
+ return;
+ }
+ ch = m_pBuf[m_Pos++];
+ if (ch == '>') {
+ m_WordBuffer[m_WordSize++] = ch;
+ } else {
+ m_Pos --;
+ }
+ }
+ return;
+ }
+ while (1) {
+ if (m_WordSize < MAX_WORD_BUFFER) {
+ m_WordBuffer[m_WordSize++] = ch;
+ }
+ if (type != 'N') {
+ bIsNumber = FALSE;
+ }
+ if (m_Size <= m_Pos) {
+ return;
+ }
+ ch = m_pBuf[m_Pos++];
+ type = _PDF_CharType[ch];
+ if (type == 'D' || type == 'W') {
+ m_Pos --;
+ break;
+ }
+ }
+}
+CFX_ByteString CPDF_StreamParser::ReadString()
+{
+ if (m_Size <= m_Pos) {
+ return CFX_ByteString();
+ }
+ int ch = m_pBuf[m_Pos++];
+ CFX_ByteTextBuf buf;
+ int parlevel = 0;
+ int status = 0, iEscCode = 0;
+ while (1) {
+ switch (status) {
+ case 0:
+ if (ch == ')') {
+ if (parlevel == 0) {
+ if (buf.GetLength() > MAX_STRING_LENGTH) {
+ return CFX_ByteString(buf.GetBuffer(), MAX_STRING_LENGTH);
+ }
+ return buf.GetByteString();
+ }
+ parlevel --;
+ buf.AppendChar(')');
+ } else if (ch == '(') {
+ parlevel ++;
+ buf.AppendChar('(');
+ } else if (ch == '\\') {
+ status = 1;
+ } else {
+ buf.AppendChar((char)ch);
+ }
+ break;
+ case 1:
+ if (ch >= '0' && ch <= '7') {
+ iEscCode = ch - '0';
+ status = 2;
+ break;
+ }
+ if (ch == 'n') {
+ buf.AppendChar('\n');
+ } else if (ch == 'r') {
+ buf.AppendChar('\r');
+ } else if (ch == 't') {
+ buf.AppendChar('\t');
+ } else if (ch == 'b') {
+ buf.AppendChar('\b');
+ } else if (ch == 'f') {
+ buf.AppendChar('\f');
+ } else if (ch == '\r') {
+ status = 4;
+ break;
+ } else if (ch == '\n') {
+ } else {
+ buf.AppendChar(ch);
+ }
+ status = 0;
+ break;
+ case 2:
+ if (ch >= '0' && ch <= '7') {
+ iEscCode = iEscCode * 8 + ch - '0';
+ status = 3;
+ } else {
+ buf.AppendChar(iEscCode);
+ status = 0;
+ continue;
+ }
+ break;
+ case 3:
+ if (ch >= '0' && ch <= '7') {
+ iEscCode = iEscCode * 8 + ch - '0';
+ buf.AppendChar(iEscCode);
+ status = 0;
+ } else {
+ buf.AppendChar(iEscCode);
+ status = 0;
+ continue;
+ }
+ break;
+ case 4:
+ status = 0;
+ if (ch != '\n') {
+ continue;
+ }
+ break;
+ }
+ if (m_Size <= m_Pos) {
+ break;
+ }
+ ch = m_pBuf[m_Pos++];
+ }
+ if (m_Size > m_Pos) {
+ ch = m_pBuf[m_Pos++];
+ }
+ if (buf.GetLength() > MAX_STRING_LENGTH) {
+ return CFX_ByteString(buf.GetBuffer(), MAX_STRING_LENGTH);
+ }
+ return buf.GetByteString();
+}
+CFX_ByteString CPDF_StreamParser::ReadHexString()
+{
+ if (m_Size <= m_Pos) {
+ return CFX_ByteString();
+ }
+ int ch = m_pBuf[m_Pos++];
+ CFX_ByteTextBuf buf;
+ FX_BOOL bFirst = TRUE;
+ int code = 0;
+ while (1) {
+ if (ch == '>') {
+ break;
+ }
+ if (ch >= '0' && ch <= '9') {
+ if (bFirst) {
+ code = (ch - '0') * 16;
+ } else {
+ code += ch - '0';
+ buf.AppendChar((char)code);
+ }
+ bFirst = !bFirst;
+ } else if (ch >= 'A' && ch <= 'F') {
+ if (bFirst) {
+ code = (ch - 'A' + 10) * 16;
+ } else {
+ code += ch - 'A' + 10;
+ buf.AppendChar((char)code);
+ }
+ bFirst = !bFirst;
+ } else if (ch >= 'a' && ch <= 'f') {
+ if (bFirst) {
+ code = (ch - 'a' + 10) * 16;
+ } else {
+ code += ch - 'a' + 10;
+ buf.AppendChar((char)code);
+ }
+ bFirst = !bFirst;
+ }
+ if (m_Size <= m_Pos) {
+ break;
+ }
+ ch = m_pBuf[m_Pos++];
+ }
+ if (!bFirst) {
+ buf.AppendChar((char)code);
+ }
+ if (buf.GetLength() > MAX_STRING_LENGTH) {
+ return CFX_ByteString(buf.GetBuffer(), MAX_STRING_LENGTH);
+ }
+ return buf.GetByteString();
+}
+#define PAGEPARSE_STAGE_GETCONTENT 1
+#define PAGEPARSE_STAGE_PARSE 2
+#define PAGEPARSE_STAGE_CHECKCLIP 3
+CPDF_ContentParser::CPDF_ContentParser()
+{
+ m_pParser = NULL;
+ m_pStreamArray = NULL;
+ m_pSingleStream = NULL;
+ m_pData = NULL;
+ m_Status = Ready;
+ m_pType3Char = NULL;
+}
+CPDF_ContentParser::~CPDF_ContentParser()
+{
+ Clear();
+}
+void CPDF_ContentParser::Clear()
+{
+ if (m_pParser) {
+ delete m_pParser;
+ }
+ if (m_pSingleStream) {
+ delete m_pSingleStream;
+ }
+ if (m_pStreamArray) {
+ for (FX_DWORD i = 0; i < m_nStreams; i ++)
+ if (m_pStreamArray[i]) {
+ delete m_pStreamArray[i];
+ }
+ FX_Free(m_pStreamArray);
+ }
+ if (m_pData && m_pSingleStream == NULL) {
+ FX_Free((void*)m_pData);
+ }
+ m_pParser = NULL;
+ m_pStreamArray = NULL;
+ m_pSingleStream = NULL;
+ m_pData = NULL;
+ m_Status = Ready;
+}
+void CPDF_ContentParser::Start(CPDF_Page* pPage, CPDF_ParseOptions* pOptions)
+{
+ if (m_Status != Ready || pPage == NULL || pPage->m_pDocument == NULL || pPage->m_pFormDict == NULL) {
+ m_Status = Done;
+ return;
+ }
+ m_pObjects = pPage;
+ m_bForm = FALSE;
+ if (pOptions) {
+ m_Options = *pOptions;
+ }
+ m_Status = ToBeContinued;
+ m_InternalStage = PAGEPARSE_STAGE_GETCONTENT;
+ m_CurrentOffset = 0;
+ CPDF_Object* pContent = pPage->m_pFormDict->GetElementValue(FX_BSTRC("Contents"));
+ if (pContent == NULL) {
+ m_Status = Done;
+ return;
+ }
+ if (pContent->GetType() == PDFOBJ_STREAM) {
+ m_nStreams = 0;
+ m_pSingleStream = FX_NEW CPDF_StreamAcc;
+ m_pSingleStream->LoadAllData((CPDF_Stream*)pContent, FALSE);
+ } else if (pContent->GetType() == PDFOBJ_ARRAY) {
+ CPDF_Array* pArray = (CPDF_Array*)pContent;
+ m_nStreams = pArray->GetCount();
+ if (m_nStreams == 0) {
+ m_Status = Done;
+ return;
+ }
+ m_pStreamArray = FX_Alloc(CPDF_StreamAcc*, m_nStreams);
+ FXSYS_memset32(m_pStreamArray, 0, sizeof(CPDF_StreamAcc*) * m_nStreams);
+ } else {
+ m_Status = Done;
+ return;
+ }
+}
+void CPDF_ContentParser::Start(CPDF_Form* pForm, CPDF_AllStates* pGraphicStates,
+ CFX_AffineMatrix* pParentMatrix, CPDF_Type3Char* pType3Char, CPDF_ParseOptions* pOptions, int level)
+{
+ m_pType3Char = pType3Char;
+ m_pObjects = pForm;
+ m_bForm = TRUE;
+ CFX_AffineMatrix form_matrix = pForm->m_pFormDict->GetMatrix(FX_BSTRC("Matrix"));
+ if (pGraphicStates) {
+ form_matrix.Concat(pGraphicStates->m_CTM);
+ }
+ CPDF_Array* pBBox = pForm->m_pFormDict->GetArray(FX_BSTRC("BBox"));
+ CFX_FloatRect form_bbox;
+ CPDF_Path ClipPath;
+ if (pBBox) {
+ form_bbox = pBBox->GetRect();
+ ClipPath.New();
+ ClipPath.AppendRect(form_bbox.left, form_bbox.bottom, form_bbox.right, form_bbox.top);
+ ClipPath.Transform(&form_matrix);
+ if (pParentMatrix) {
+ ClipPath.Transform(pParentMatrix);
+ }
+ form_bbox.Transform(&form_matrix);
+ if (pParentMatrix) {
+ form_bbox.Transform(pParentMatrix);
+ }
+ }
+ CPDF_Dictionary* pResources = pForm->m_pFormDict->GetDict(FX_BSTRC("Resources"));
+ m_pParser = FX_NEW CPDF_StreamContentParser;
+ m_pParser->Initialize();
+ m_pParser->PrepareParse(pForm->m_pDocument, pForm->m_pPageResources, pForm->m_pResources, pParentMatrix, pForm,
+ pResources, &form_bbox, pOptions, pGraphicStates, level);
+ m_pParser->m_pCurStates->m_CTM = form_matrix;
+ m_pParser->m_pCurStates->m_ParentMatrix = form_matrix;
+ if (ClipPath.NotNull()) {
+ m_pParser->m_pCurStates->m_ClipPath.AppendPath(ClipPath, FXFILL_WINDING, TRUE);
+ }
+ if (pForm->m_Transparency & PDFTRANS_GROUP) {
+ CPDF_GeneralStateData* pData = m_pParser->m_pCurStates->m_GeneralState.GetModify();
+ pData->m_BlendType = FXDIB_BLEND_NORMAL;
+ pData->m_StrokeAlpha = 1.0f;
+ pData->m_FillAlpha = 1.0f;
+ pData->m_pSoftMask = NULL;
+ }
+ m_nStreams = 0;
+ m_pSingleStream = FX_NEW CPDF_StreamAcc;
+ if (pForm->m_pDocument) {
+ m_pSingleStream->LoadAllData(pForm->m_pFormStream, FALSE);
+ } else {
+ m_pSingleStream->LoadAllData(pForm->m_pFormStream, FALSE);
+ }
+ m_pData = (FX_LPBYTE)m_pSingleStream->GetData();
+ m_Size = m_pSingleStream->GetSize();
+ m_Status = ToBeContinued;
+ m_InternalStage = PAGEPARSE_STAGE_PARSE;
+ m_CurrentOffset = 0;
+}
+void CPDF_ContentParser::Continue(IFX_Pause* pPause)
+{
+ int steps = 0;
+ while (m_Status == ToBeContinued) {
+ if (m_InternalStage == PAGEPARSE_STAGE_GETCONTENT) {
+ if (m_CurrentOffset == m_nStreams) {
+ if (m_pStreamArray) {
+ m_Size = 0;
+ FX_DWORD i;
+ for (i = 0; i < m_nStreams; i ++) {
+ FX_DWORD size = m_pStreamArray[i]->GetSize();
+ if (m_Size + size + 1 <= m_Size) {
+ m_Status = Done;
+ return;
+ }
+ m_Size += size + 1;
+ }
+ m_pData = FX_Alloc(FX_BYTE, m_Size);
+ if (!m_pData) {
+ m_Status = Done;
+ return;
+ }
+ FX_DWORD pos = 0;
+ for (i = 0; i < m_nStreams; i ++) {
+ FXSYS_memcpy32(m_pData + pos, m_pStreamArray[i]->GetData(), m_pStreamArray[i]->GetSize());
+ pos += m_pStreamArray[i]->GetSize() + 1;
+ m_pData[pos - 1] = ' ';
+ delete m_pStreamArray[i];
+ }
+ FX_Free(m_pStreamArray);
+ m_pStreamArray = NULL;
+ } else {
+ m_pData = (FX_LPBYTE)m_pSingleStream->GetData();
+ m_Size = m_pSingleStream->GetSize();
+ }
+ m_InternalStage = PAGEPARSE_STAGE_PARSE;
+ m_CurrentOffset = 0;
+ } else {
+ CPDF_Array* pContent = m_pObjects->m_pFormDict->GetArray(FX_BSTRC("Contents"));
+ m_pStreamArray[m_CurrentOffset] = FX_NEW CPDF_StreamAcc;
+ CPDF_Stream* pStreamObj = (CPDF_Stream*)pContent->GetElementValue(m_CurrentOffset);
+ m_pStreamArray[m_CurrentOffset]->LoadAllData(pStreamObj, FALSE);
+ m_CurrentOffset ++;
+ }
+ }
+ if (m_InternalStage == PAGEPARSE_STAGE_PARSE) {
+ if (m_pParser == NULL) {
+ m_pParser = FX_NEW CPDF_StreamContentParser;
+ m_pParser->Initialize();
+ m_pParser->PrepareParse(m_pObjects->m_pDocument, m_pObjects->m_pPageResources, NULL, NULL, m_pObjects,
+ m_pObjects->m_pResources, &m_pObjects->m_BBox, &m_Options, NULL, 0);
+ m_pParser->m_pCurStates->m_ColorState.GetModify()->Default();
+ }
+ if (m_CurrentOffset >= m_Size) {
+ m_InternalStage = PAGEPARSE_STAGE_CHECKCLIP;
+ } else {
+ m_CurrentOffset += m_pParser->Parse(m_pData + m_CurrentOffset, m_Size - m_CurrentOffset, PARSE_STEP_LIMIT);
+ if (m_pParser->m_bAbort) {
+ m_InternalStage = PAGEPARSE_STAGE_CHECKCLIP;
+ continue;
+ }
+ }
+ }
+ if (m_InternalStage == PAGEPARSE_STAGE_CHECKCLIP) {
+ if (m_pType3Char) {
+ m_pType3Char->m_bColored = m_pParser->m_bColored;
+ m_pType3Char->m_Width = FXSYS_round(m_pParser->m_Type3Data[0] * 1000);
+ m_pType3Char->m_BBox.left = FXSYS_round(m_pParser->m_Type3Data[2] * 1000);
+ m_pType3Char->m_BBox.bottom = FXSYS_round(m_pParser->m_Type3Data[3] * 1000);
+ m_pType3Char->m_BBox.right = FXSYS_round(m_pParser->m_Type3Data[4] * 1000);
+ m_pType3Char->m_BBox.top = FXSYS_round(m_pParser->m_Type3Data[5] * 1000);
+ }
+ FX_POSITION pos = m_pObjects->m_ObjectList.GetHeadPosition();
+ while (pos) {
+ CPDF_PageObject* pObj = (CPDF_PageObject*)m_pObjects->m_ObjectList.GetNext(pos);
+ if (pObj->m_ClipPath.IsNull()) {
+ continue;
+ }
+ if (pObj->m_ClipPath.GetPathCount() != 1) {
+ continue;
+ }
+ if (pObj->m_ClipPath.GetTextCount()) {
+ continue;
+ }
+ CPDF_Path ClipPath = pObj->m_ClipPath.GetPath(0);
+ if (!ClipPath.IsRect() || pObj->m_Type == PDFPAGE_SHADING) {
+ continue;
+ }
+ CFX_FloatRect old_rect(ClipPath.GetPointX(0), ClipPath.GetPointY(0),
+ ClipPath.GetPointX(2), ClipPath.GetPointY(2));
+ CFX_FloatRect obj_rect(pObj->m_Left, pObj->m_Bottom, pObj->m_Right, pObj->m_Top);
+ if (old_rect.Contains(obj_rect)) {
+ pObj->m_ClipPath.SetNull();
+ }
+ }
+ m_Status = Done;
+ return;
+ }
+ steps ++;
+ if (pPause && pPause->NeedToPauseNow()) {
+ break;
+ }
+ }
+}
+int CPDF_ContentParser::EstimateProgress()
+{
+ if (m_Status == Ready) {
+ return 0;
+ }
+ if (m_Status == Done) {
+ return 100;
+ }
+ if (m_InternalStage == PAGEPARSE_STAGE_GETCONTENT) {
+ return 10;
+ }
+ if (m_InternalStage == PAGEPARSE_STAGE_CHECKCLIP) {
+ return 90;
+ }
+ return 10 + 80 * m_CurrentOffset / m_Size;
+}
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_path.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_path.cpp
index 836c940f5e..8b4d42236b 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_path.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_path.cpp
@@ -1,52 +1,52 @@
-// 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
-
-#include "../../../include/fpdfapi/fpdf_page.h"
-#include "../../../include/fpdfapi/fpdf_pageobj.h"
-#include "../../../include/fpdfapi/fpdf_module.h"
-#include "pageint.h"
-void CPDF_PathObject::CopyData(const CPDF_PageObject* pSrc)
-{
- const CPDF_PathObject* pSrcObj = (const CPDF_PathObject*)pSrc;
- m_Path = pSrcObj->m_Path;
- m_FillType = pSrcObj->m_FillType;
- m_bStroke = pSrcObj->m_bStroke;
- m_Matrix = pSrcObj->m_Matrix;
-}
-void CPDF_PathObject::Transform(const CPDF_Matrix& matrix)
-{
- m_Matrix.Concat(matrix);
- CalcBoundingBox();
-}
-void CPDF_PathObject::SetGraphState(CPDF_GraphState GraphState)
-{
- m_GraphState = GraphState;
- CalcBoundingBox();
-}
-void CPDF_PathObject::CalcBoundingBox()
-{
- if (m_Path.IsNull()) {
- return;
- }
- CFX_FloatRect rect;
- FX_FLOAT width = m_GraphState.GetObject()->m_LineWidth;
- if (m_bStroke && width != 0) {
- rect = m_Path.GetBoundingBox(width, m_GraphState.GetObject()->m_MiterLimit);
- } else {
- rect = m_Path.GetBoundingBox();
- }
- rect.Transform(&m_Matrix);
- if (width == 0 && m_bStroke) {
- rect.left += -0.5f;
- rect.right += 0.5f;
- rect.bottom += -0.5f;
- rect.top += 0.5f;
- }
- m_Left = rect.left;
- m_Right = rect.right;
- m_Top = rect.top;
- m_Bottom = rect.bottom;
-}
+// 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
+
+#include "../../../include/fpdfapi/fpdf_page.h"
+#include "../../../include/fpdfapi/fpdf_pageobj.h"
+#include "../../../include/fpdfapi/fpdf_module.h"
+#include "pageint.h"
+void CPDF_PathObject::CopyData(const CPDF_PageObject* pSrc)
+{
+ const CPDF_PathObject* pSrcObj = (const CPDF_PathObject*)pSrc;
+ m_Path = pSrcObj->m_Path;
+ m_FillType = pSrcObj->m_FillType;
+ m_bStroke = pSrcObj->m_bStroke;
+ m_Matrix = pSrcObj->m_Matrix;
+}
+void CPDF_PathObject::Transform(const CPDF_Matrix& matrix)
+{
+ m_Matrix.Concat(matrix);
+ CalcBoundingBox();
+}
+void CPDF_PathObject::SetGraphState(CPDF_GraphState GraphState)
+{
+ m_GraphState = GraphState;
+ CalcBoundingBox();
+}
+void CPDF_PathObject::CalcBoundingBox()
+{
+ if (m_Path.IsNull()) {
+ return;
+ }
+ CFX_FloatRect rect;
+ FX_FLOAT width = m_GraphState.GetObject()->m_LineWidth;
+ if (m_bStroke && width != 0) {
+ rect = m_Path.GetBoundingBox(width, m_GraphState.GetObject()->m_MiterLimit);
+ } else {
+ rect = m_Path.GetBoundingBox();
+ }
+ rect.Transform(&m_Matrix);
+ if (width == 0 && m_bStroke) {
+ rect.left += -0.5f;
+ rect.right += 0.5f;
+ rect.bottom += -0.5f;
+ rect.top += 0.5f;
+ }
+ m_Left = rect.left;
+ m_Right = rect.right;
+ m_Top = rect.top;
+ m_Bottom = rect.bottom;
+}
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp
index aee0367acb..6c6c095980 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp
@@ -1,278 +1,278 @@
-// 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
-
-#include "../../../include/fpdfapi/fpdf_page.h"
-#include "pageint.h"
-CPDF_TilingPattern::CPDF_TilingPattern(CPDF_Document* pDoc, CPDF_Object* pPatternObj, const CFX_AffineMatrix* parentMatrix) :
- CPDF_Pattern(parentMatrix)
-{
- m_PatternType = PATTERN_TILING;
- m_pPatternObj = pPatternObj;
- m_pDocument = pDoc;
- CPDF_Dictionary* pDict = m_pPatternObj->GetDict();
- ASSERT(pDict != NULL);
- m_Pattern2Form = pDict->GetMatrix(FX_BSTRC("Matrix"));
- m_bColored = pDict->GetInteger(FX_BSTRC("PaintType")) == 1;
- if (parentMatrix) {
- m_Pattern2Form.Concat(*parentMatrix);
- }
- m_pForm = NULL;
-}
-CPDF_TilingPattern::~CPDF_TilingPattern()
-{
- if (m_pForm) {
- delete m_pForm;
- }
-}
-FX_BOOL CPDF_TilingPattern::Load()
-{
- if (m_pForm != NULL) {
- return TRUE;
- }
- CPDF_Dictionary* pDict = m_pPatternObj->GetDict();
- if (pDict == NULL) {
- return FALSE;
- }
- m_bColored = pDict->GetInteger(FX_BSTRC("PaintType")) == 1;
- m_XStep = (FX_FLOAT)FXSYS_fabs(pDict->GetNumber(FX_BSTRC("XStep")));
- m_YStep = (FX_FLOAT)FXSYS_fabs(pDict->GetNumber(FX_BSTRC("YStep")));
- if (m_pPatternObj->GetType() != PDFOBJ_STREAM) {
- return FALSE;
- }
- CPDF_Stream* pStream = (CPDF_Stream*)m_pPatternObj;
- m_pForm = FX_NEW CPDF_Form(m_pDocument, NULL, pStream);
- m_pForm->ParseContent(NULL, &m_ParentMatrix, NULL, NULL);
- m_BBox = pDict->GetRect(FX_BSTRC("BBox"));
- return TRUE;
-}
-CPDF_ShadingPattern::CPDF_ShadingPattern(CPDF_Document* pDoc, CPDF_Object* pPatternObj, FX_BOOL bShading, const CFX_AffineMatrix* parentMatrix) : CPDF_Pattern(parentMatrix)
-{
- m_PatternType = PATTERN_SHADING;
- m_pPatternObj = bShading ? NULL : pPatternObj;
- m_pDocument = pDoc;
- m_bShadingObj = bShading;
- if (!bShading) {
- CPDF_Dictionary* pDict = m_pPatternObj->GetDict();
- ASSERT(pDict != NULL);
- m_Pattern2Form = pDict->GetMatrix(FX_BSTRC("Matrix"));
- m_pShadingObj = pDict->GetElementValue(FX_BSTRC("Shading"));
- if (parentMatrix) {
- m_Pattern2Form.Concat(*parentMatrix);
- }
- } else {
- m_pShadingObj = pPatternObj;
- }
- m_ShadingType = 0;
- m_pCS = NULL;
- m_nFuncs = 0;
- for (int i = 0; i < 4; i ++) {
- m_pFunctions[i] = NULL;
- }
-}
-CPDF_ShadingPattern::~CPDF_ShadingPattern()
-{
- Clear();
-}
-void CPDF_ShadingPattern::Clear()
-{
- for (int i = 0; i < m_nFuncs; i ++) {
- if (m_pFunctions[i]) {
- delete m_pFunctions[i];
- }
- m_pFunctions[i] = NULL;
- }
- CPDF_ColorSpace* pCS = m_pCS;
- if (pCS && m_pDocument) {
- m_pDocument->GetPageData()->ReleaseColorSpace(pCS->GetArray());
- }
- m_ShadingType = 0;
- m_pCS = NULL;
- m_nFuncs = 0;
-}
-FX_BOOL CPDF_ShadingPattern::Load()
-{
- if (m_ShadingType != 0) {
- return TRUE;
- }
- CPDF_Dictionary* pShadingDict = m_pShadingObj->GetDict();
- if (pShadingDict == NULL) {
- return FALSE;
- }
- if (m_nFuncs) {
- for (int i = 0; i < m_nFuncs; i ++)
- if (m_pFunctions[i]) {
- delete m_pFunctions[i];
- }
- m_nFuncs = 0;
- }
- CPDF_Object* pFunc = pShadingDict->GetElementValue(FX_BSTRC("Function"));
- if (pFunc) {
- if (pFunc->GetType() == PDFOBJ_ARRAY) {
- m_nFuncs = ((CPDF_Array*)pFunc)->GetCount();
- if (m_nFuncs > 4) {
- m_nFuncs = 4;
- }
- for (int i = 0; i < m_nFuncs; i ++) {
- m_pFunctions[i] = CPDF_Function::Load(((CPDF_Array*)pFunc)->GetElementValue(i));
- }
- } else {
- m_pFunctions[0] = CPDF_Function::Load(pFunc);
- m_nFuncs = 1;
- }
- }
- CPDF_Object* pCSObj = pShadingDict->GetElementValue(FX_BSTRC("ColorSpace"));
- if (pCSObj == NULL) {
- return FALSE;
- }
- CPDF_DocPageData* pDocPageData = m_pDocument->GetPageData();
- m_pCS = pDocPageData->GetColorSpace(pCSObj, NULL);
- m_ShadingType = pShadingDict->GetInteger(FX_BSTRC("ShadingType"));
- return TRUE;
-}
-FX_BOOL CPDF_ShadingPattern::Reload()
-{
- Clear();
- return Load();
-}
-FX_BOOL CPDF_MeshStream::Load(CPDF_Stream* pShadingStream, CPDF_Function** pFuncs, int nFuncs, CPDF_ColorSpace* pCS)
-{
- m_Stream.LoadAllData(pShadingStream);
- m_BitStream.Init(m_Stream.GetData(), m_Stream.GetSize());
- m_pFuncs = pFuncs;
- m_nFuncs = nFuncs;
- m_pCS = pCS;
- CPDF_Dictionary* pDict = pShadingStream->GetDict();
- m_nCoordBits = pDict->GetInteger(FX_BSTRC("BitsPerCoordinate"));
- m_nCompBits = pDict->GetInteger(FX_BSTRC("BitsPerComponent"));
- m_nFlagBits = pDict->GetInteger(FX_BSTRC("BitsPerFlag"));
- if (!m_nCoordBits || !m_nCompBits) {
- return FALSE;
- }
- int nComps = pCS->CountComponents();
- if (nComps > 8) {
- return FALSE;
- }
- m_nComps = nFuncs ? 1 : nComps;
- if (((int)m_nComps < 0) || m_nComps > 8) {
- return FALSE;
- }
- m_CoordMax = m_nCoordBits == 32 ? -1 : (1 << m_nCoordBits) - 1;
- m_CompMax = (1 << m_nCompBits) - 1;
- CPDF_Array* pDecode = pDict->GetArray(FX_BSTRC("Decode"));
- if (pDecode == NULL || pDecode->GetCount() != 4 + m_nComps * 2) {
- return FALSE;
- }
- m_xmin = pDecode->GetNumber(0);
- m_xmax = pDecode->GetNumber(1);
- m_ymin = pDecode->GetNumber(2);
- m_ymax = pDecode->GetNumber(3);
- for (FX_DWORD i = 0; i < m_nComps; i ++) {
- m_ColorMin[i] = pDecode->GetNumber(i * 2 + 4);
- m_ColorMax[i] = pDecode->GetNumber(i * 2 + 5);
- }
- return TRUE;
-}
-FX_DWORD CPDF_MeshStream::GetFlag()
-{
- return m_BitStream.GetBits(m_nFlagBits) & 0x03;
-}
-void CPDF_MeshStream::GetCoords(FX_FLOAT& x, FX_FLOAT& y)
-{
- if (m_nCoordBits == 32) {
- x = m_xmin + (FX_FLOAT)(m_BitStream.GetBits(m_nCoordBits) * (m_xmax - m_xmin) / (double)m_CoordMax);
- y = m_ymin + (FX_FLOAT)(m_BitStream.GetBits(m_nCoordBits) * (m_ymax - m_ymin) / (double)m_CoordMax);
- } else {
- x = m_xmin + m_BitStream.GetBits(m_nCoordBits) * (m_xmax - m_xmin) / m_CoordMax;
- y = m_ymin + m_BitStream.GetBits(m_nCoordBits) * (m_ymax - m_ymin) / m_CoordMax;
- }
-}
-void CPDF_MeshStream::GetColor(FX_FLOAT& r, FX_FLOAT& g, FX_FLOAT& b)
-{
- FX_DWORD i;
- FX_FLOAT color_value[8];
- for (i = 0; i < m_nComps; i ++) {
- color_value[i] = m_ColorMin[i] + m_BitStream.GetBits(m_nCompBits) * (m_ColorMax[i] - m_ColorMin[i]) / m_CompMax;
- }
- if (m_nFuncs) {
- static const int kMaxResults = 8;
- FX_FLOAT result[kMaxResults];
- int nResults;
- FXSYS_memset32(result, 0, sizeof(result));
- for (FX_DWORD i = 0; i < m_nFuncs; i ++) {
- if (m_pFuncs[i] && m_pFuncs[i]->CountOutputs() <= kMaxResults) {
- m_pFuncs[i]->Call(color_value, 1, result, nResults);
- }
- }
- m_pCS->GetRGB(result, r, g, b);
- } else {
- m_pCS->GetRGB(color_value, r, g, b);
- }
-}
-FX_DWORD CPDF_MeshStream::GetVertex(CPDF_MeshVertex& vertex, CFX_AffineMatrix* pObject2Bitmap)
-{
- FX_DWORD flag = GetFlag();
- GetCoords(vertex.x, vertex.y);
- pObject2Bitmap->Transform(vertex.x, vertex.y);
- GetColor(vertex.r, vertex.g, vertex.b);
- m_BitStream.ByteAlign();
- return flag;
-}
-FX_BOOL CPDF_MeshStream::GetVertexRow(CPDF_MeshVertex* vertex, int count, CFX_AffineMatrix* pObject2Bitmap)
-{
- for (int i = 0; i < count; i ++) {
- if (m_BitStream.IsEOF()) {
- return FALSE;
- }
- GetCoords(vertex[i].x, vertex[i].y);
- pObject2Bitmap->Transform(vertex[i].x, vertex[i].y);
- GetColor(vertex[i].r, vertex[i].g, vertex[i].b);
- m_BitStream.ByteAlign();
- }
- return TRUE;
-}
-CFX_FloatRect _GetShadingBBox(CPDF_Stream* pStream, int type, const CFX_AffineMatrix* pMatrix,
- CPDF_Function** pFuncs, int nFuncs, CPDF_ColorSpace* pCS)
-{
- if (pStream == NULL || pStream->GetType() != PDFOBJ_STREAM || pFuncs == NULL || pCS == NULL) {
- return CFX_FloatRect(0, 0, 0, 0);
- }
- CPDF_MeshStream stream;
- if (!stream.Load(pStream, pFuncs, nFuncs, pCS)) {
- return CFX_FloatRect(0, 0, 0, 0);
- }
- CFX_FloatRect rect;
- FX_BOOL bStarted = FALSE;
- FX_BOOL bGouraud = type == 4 || type == 5;
- int full_point_count = type == 7 ? 16 : (type == 6 ? 12 : 1);
- int full_color_count = (type == 6 || type == 7) ? 4 : 1;
- while (!stream.m_BitStream.IsEOF()) {
- FX_DWORD flag;
- if (type != 5) {
- flag = stream.GetFlag();
- }
- int point_count = full_point_count, color_count = full_color_count;
- if (!bGouraud && flag) {
- point_count -= 4;
- color_count -= 2;
- }
- for (int i = 0; i < point_count; i ++) {
- FX_FLOAT x, y;
- stream.GetCoords(x, y);
- if (bStarted) {
- rect.UpdateRect(x, y);
- } else {
- rect.InitRect(x, y);
- bStarted = TRUE;
- }
- }
- stream.m_BitStream.SkipBits(stream.m_nComps * stream.m_nCompBits * color_count);
- if (bGouraud) {
- stream.m_BitStream.ByteAlign();
- }
- }
- rect.Transform(pMatrix);
- return rect;
-}
+// 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
+
+#include "../../../include/fpdfapi/fpdf_page.h"
+#include "pageint.h"
+CPDF_TilingPattern::CPDF_TilingPattern(CPDF_Document* pDoc, CPDF_Object* pPatternObj, const CFX_AffineMatrix* parentMatrix) :
+ CPDF_Pattern(parentMatrix)
+{
+ m_PatternType = PATTERN_TILING;
+ m_pPatternObj = pPatternObj;
+ m_pDocument = pDoc;
+ CPDF_Dictionary* pDict = m_pPatternObj->GetDict();
+ ASSERT(pDict != NULL);
+ m_Pattern2Form = pDict->GetMatrix(FX_BSTRC("Matrix"));
+ m_bColored = pDict->GetInteger(FX_BSTRC("PaintType")) == 1;
+ if (parentMatrix) {
+ m_Pattern2Form.Concat(*parentMatrix);
+ }
+ m_pForm = NULL;
+}
+CPDF_TilingPattern::~CPDF_TilingPattern()
+{
+ if (m_pForm) {
+ delete m_pForm;
+ }
+}
+FX_BOOL CPDF_TilingPattern::Load()
+{
+ if (m_pForm != NULL) {
+ return TRUE;
+ }
+ CPDF_Dictionary* pDict = m_pPatternObj->GetDict();
+ if (pDict == NULL) {
+ return FALSE;
+ }
+ m_bColored = pDict->GetInteger(FX_BSTRC("PaintType")) == 1;
+ m_XStep = (FX_FLOAT)FXSYS_fabs(pDict->GetNumber(FX_BSTRC("XStep")));
+ m_YStep = (FX_FLOAT)FXSYS_fabs(pDict->GetNumber(FX_BSTRC("YStep")));
+ if (m_pPatternObj->GetType() != PDFOBJ_STREAM) {
+ return FALSE;
+ }
+ CPDF_Stream* pStream = (CPDF_Stream*)m_pPatternObj;
+ m_pForm = FX_NEW CPDF_Form(m_pDocument, NULL, pStream);
+ m_pForm->ParseContent(NULL, &m_ParentMatrix, NULL, NULL);
+ m_BBox = pDict->GetRect(FX_BSTRC("BBox"));
+ return TRUE;
+}
+CPDF_ShadingPattern::CPDF_ShadingPattern(CPDF_Document* pDoc, CPDF_Object* pPatternObj, FX_BOOL bShading, const CFX_AffineMatrix* parentMatrix) : CPDF_Pattern(parentMatrix)
+{
+ m_PatternType = PATTERN_SHADING;
+ m_pPatternObj = bShading ? NULL : pPatternObj;
+ m_pDocument = pDoc;
+ m_bShadingObj = bShading;
+ if (!bShading) {
+ CPDF_Dictionary* pDict = m_pPatternObj->GetDict();
+ ASSERT(pDict != NULL);
+ m_Pattern2Form = pDict->GetMatrix(FX_BSTRC("Matrix"));
+ m_pShadingObj = pDict->GetElementValue(FX_BSTRC("Shading"));
+ if (parentMatrix) {
+ m_Pattern2Form.Concat(*parentMatrix);
+ }
+ } else {
+ m_pShadingObj = pPatternObj;
+ }
+ m_ShadingType = 0;
+ m_pCS = NULL;
+ m_nFuncs = 0;
+ for (int i = 0; i < 4; i ++) {
+ m_pFunctions[i] = NULL;
+ }
+}
+CPDF_ShadingPattern::~CPDF_ShadingPattern()
+{
+ Clear();
+}
+void CPDF_ShadingPattern::Clear()
+{
+ for (int i = 0; i < m_nFuncs; i ++) {
+ if (m_pFunctions[i]) {
+ delete m_pFunctions[i];
+ }
+ m_pFunctions[i] = NULL;
+ }
+ CPDF_ColorSpace* pCS = m_pCS;
+ if (pCS && m_pDocument) {
+ m_pDocument->GetPageData()->ReleaseColorSpace(pCS->GetArray());
+ }
+ m_ShadingType = 0;
+ m_pCS = NULL;
+ m_nFuncs = 0;
+}
+FX_BOOL CPDF_ShadingPattern::Load()
+{
+ if (m_ShadingType != 0) {
+ return TRUE;
+ }
+ CPDF_Dictionary* pShadingDict = m_pShadingObj->GetDict();
+ if (pShadingDict == NULL) {
+ return FALSE;
+ }
+ if (m_nFuncs) {
+ for (int i = 0; i < m_nFuncs; i ++)
+ if (m_pFunctions[i]) {
+ delete m_pFunctions[i];
+ }
+ m_nFuncs = 0;
+ }
+ CPDF_Object* pFunc = pShadingDict->GetElementValue(FX_BSTRC("Function"));
+ if (pFunc) {
+ if (pFunc->GetType() == PDFOBJ_ARRAY) {
+ m_nFuncs = ((CPDF_Array*)pFunc)->GetCount();
+ if (m_nFuncs > 4) {
+ m_nFuncs = 4;
+ }
+ for (int i = 0; i < m_nFuncs; i ++) {
+ m_pFunctions[i] = CPDF_Function::Load(((CPDF_Array*)pFunc)->GetElementValue(i));
+ }
+ } else {
+ m_pFunctions[0] = CPDF_Function::Load(pFunc);
+ m_nFuncs = 1;
+ }
+ }
+ CPDF_Object* pCSObj = pShadingDict->GetElementValue(FX_BSTRC("ColorSpace"));
+ if (pCSObj == NULL) {
+ return FALSE;
+ }
+ CPDF_DocPageData* pDocPageData = m_pDocument->GetPageData();
+ m_pCS = pDocPageData->GetColorSpace(pCSObj, NULL);
+ m_ShadingType = pShadingDict->GetInteger(FX_BSTRC("ShadingType"));
+ return TRUE;
+}
+FX_BOOL CPDF_ShadingPattern::Reload()
+{
+ Clear();
+ return Load();
+}
+FX_BOOL CPDF_MeshStream::Load(CPDF_Stream* pShadingStream, CPDF_Function** pFuncs, int nFuncs, CPDF_ColorSpace* pCS)
+{
+ m_Stream.LoadAllData(pShadingStream);
+ m_BitStream.Init(m_Stream.GetData(), m_Stream.GetSize());
+ m_pFuncs = pFuncs;
+ m_nFuncs = nFuncs;
+ m_pCS = pCS;
+ CPDF_Dictionary* pDict = pShadingStream->GetDict();
+ m_nCoordBits = pDict->GetInteger(FX_BSTRC("BitsPerCoordinate"));
+ m_nCompBits = pDict->GetInteger(FX_BSTRC("BitsPerComponent"));
+ m_nFlagBits = pDict->GetInteger(FX_BSTRC("BitsPerFlag"));
+ if (!m_nCoordBits || !m_nCompBits) {
+ return FALSE;
+ }
+ int nComps = pCS->CountComponents();
+ if (nComps > 8) {
+ return FALSE;
+ }
+ m_nComps = nFuncs ? 1 : nComps;
+ if (((int)m_nComps < 0) || m_nComps > 8) {
+ return FALSE;
+ }
+ m_CoordMax = m_nCoordBits == 32 ? -1 : (1 << m_nCoordBits) - 1;
+ m_CompMax = (1 << m_nCompBits) - 1;
+ CPDF_Array* pDecode = pDict->GetArray(FX_BSTRC("Decode"));
+ if (pDecode == NULL || pDecode->GetCount() != 4 + m_nComps * 2) {
+ return FALSE;
+ }
+ m_xmin = pDecode->GetNumber(0);
+ m_xmax = pDecode->GetNumber(1);
+ m_ymin = pDecode->GetNumber(2);
+ m_ymax = pDecode->GetNumber(3);
+ for (FX_DWORD i = 0; i < m_nComps; i ++) {
+ m_ColorMin[i] = pDecode->GetNumber(i * 2 + 4);
+ m_ColorMax[i] = pDecode->GetNumber(i * 2 + 5);
+ }
+ return TRUE;
+}
+FX_DWORD CPDF_MeshStream::GetFlag()
+{
+ return m_BitStream.GetBits(m_nFlagBits) & 0x03;
+}
+void CPDF_MeshStream::GetCoords(FX_FLOAT& x, FX_FLOAT& y)
+{
+ if (m_nCoordBits == 32) {
+ x = m_xmin + (FX_FLOAT)(m_BitStream.GetBits(m_nCoordBits) * (m_xmax - m_xmin) / (double)m_CoordMax);
+ y = m_ymin + (FX_FLOAT)(m_BitStream.GetBits(m_nCoordBits) * (m_ymax - m_ymin) / (double)m_CoordMax);
+ } else {
+ x = m_xmin + m_BitStream.GetBits(m_nCoordBits) * (m_xmax - m_xmin) / m_CoordMax;
+ y = m_ymin + m_BitStream.GetBits(m_nCoordBits) * (m_ymax - m_ymin) / m_CoordMax;
+ }
+}
+void CPDF_MeshStream::GetColor(FX_FLOAT& r, FX_FLOAT& g, FX_FLOAT& b)
+{
+ FX_DWORD i;
+ FX_FLOAT color_value[8];
+ for (i = 0; i < m_nComps; i ++) {
+ color_value[i] = m_ColorMin[i] + m_BitStream.GetBits(m_nCompBits) * (m_ColorMax[i] - m_ColorMin[i]) / m_CompMax;
+ }
+ if (m_nFuncs) {
+ static const int kMaxResults = 8;
+ FX_FLOAT result[kMaxResults];
+ int nResults;
+ FXSYS_memset32(result, 0, sizeof(result));
+ for (FX_DWORD i = 0; i < m_nFuncs; i ++) {
+ if (m_pFuncs[i] && m_pFuncs[i]->CountOutputs() <= kMaxResults) {
+ m_pFuncs[i]->Call(color_value, 1, result, nResults);
+ }
+ }
+ m_pCS->GetRGB(result, r, g, b);
+ } else {
+ m_pCS->GetRGB(color_value, r, g, b);
+ }
+}
+FX_DWORD CPDF_MeshStream::GetVertex(CPDF_MeshVertex& vertex, CFX_AffineMatrix* pObject2Bitmap)
+{
+ FX_DWORD flag = GetFlag();
+ GetCoords(vertex.x, vertex.y);
+ pObject2Bitmap->Transform(vertex.x, vertex.y);
+ GetColor(vertex.r, vertex.g, vertex.b);
+ m_BitStream.ByteAlign();
+ return flag;
+}
+FX_BOOL CPDF_MeshStream::GetVertexRow(CPDF_MeshVertex* vertex, int count, CFX_AffineMatrix* pObject2Bitmap)
+{
+ for (int i = 0; i < count; i ++) {
+ if (m_BitStream.IsEOF()) {
+ return FALSE;
+ }
+ GetCoords(vertex[i].x, vertex[i].y);
+ pObject2Bitmap->Transform(vertex[i].x, vertex[i].y);
+ GetColor(vertex[i].r, vertex[i].g, vertex[i].b);
+ m_BitStream.ByteAlign();
+ }
+ return TRUE;
+}
+CFX_FloatRect _GetShadingBBox(CPDF_Stream* pStream, int type, const CFX_AffineMatrix* pMatrix,
+ CPDF_Function** pFuncs, int nFuncs, CPDF_ColorSpace* pCS)
+{
+ if (pStream == NULL || pStream->GetType() != PDFOBJ_STREAM || pFuncs == NULL || pCS == NULL) {
+ return CFX_FloatRect(0, 0, 0, 0);
+ }
+ CPDF_MeshStream stream;
+ if (!stream.Load(pStream, pFuncs, nFuncs, pCS)) {
+ return CFX_FloatRect(0, 0, 0, 0);
+ }
+ CFX_FloatRect rect;
+ FX_BOOL bStarted = FALSE;
+ FX_BOOL bGouraud = type == 4 || type == 5;
+ int full_point_count = type == 7 ? 16 : (type == 6 ? 12 : 1);
+ int full_color_count = (type == 6 || type == 7) ? 4 : 1;
+ while (!stream.m_BitStream.IsEOF()) {
+ FX_DWORD flag;
+ if (type != 5) {
+ flag = stream.GetFlag();
+ }
+ int point_count = full_point_count, color_count = full_color_count;
+ if (!bGouraud && flag) {
+ point_count -= 4;
+ color_count -= 2;
+ }
+ for (int i = 0; i < point_count; i ++) {
+ FX_FLOAT x, y;
+ stream.GetCoords(x, y);
+ if (bStarted) {
+ rect.UpdateRect(x, y);
+ } else {
+ rect.InitRect(x, y);
+ bStarted = TRUE;
+ }
+ }
+ stream.m_BitStream.SkipBits(stream.m_nComps * stream.m_nCompBits * color_count);
+ if (bGouraud) {
+ stream.m_BitStream.ByteAlign();
+ }
+ }
+ rect.Transform(pMatrix);
+ return rect;
+}
diff --git a/core/src/fpdfapi/fpdf_page/pageint.h b/core/src/fpdfapi/fpdf_page/pageint.h
index b1a83ec236..4e097ca49e 100644
--- a/core/src/fpdfapi/fpdf_page/pageint.h
+++ b/core/src/fpdfapi/fpdf_page/pageint.h
@@ -1,505 +1,505 @@
-// 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
-
-#include "../../../include/fpdfapi/fpdf_pageobj.h"
-#define PARSE_STEP_LIMIT 100
-#define STREAM_PARSE_BUFSIZE 20480
-class CPDF_QuickFontCache;
-#ifndef _FPDFAPI_MINI_
-class CPDF_StreamParser : public CFX_Object
-{
-public:
-
- CPDF_StreamParser(const FX_BYTE* pData, FX_DWORD dwSize);
- ~CPDF_StreamParser();
-
- CPDF_Stream* ReadInlineStream(CPDF_Document* pDoc, CPDF_Dictionary* pDict, CPDF_Object* pCSObj, FX_BOOL bDecode);
- typedef enum { EndOfData, Number, Keyword, Name, Others } SyntaxType;
-
- SyntaxType ParseNextElement();
- FX_LPBYTE GetWordBuf()
- {
- return m_WordBuffer;
- }
- FX_DWORD GetWordSize()
- {
- return m_WordSize;
- }
- CPDF_Object* GetObject()
- {
- CPDF_Object* pObj = m_pLastObj;
- m_pLastObj = NULL;
- return pObj;
- }
- FX_DWORD GetPos()
- {
- return m_Pos;
- }
- void SetPos(FX_DWORD pos)
- {
- m_Pos = pos;
- }
-
- CPDF_Object* ReadNextObject(FX_BOOL bAllowNestedArray = FALSE, FX_BOOL bInArray = FALSE);
- void SkipPathObject();
-protected:
- void GetNextWord(FX_BOOL& bIsNumber);
- CFX_ByteString ReadString();
- CFX_ByteString ReadHexString();
- const FX_BYTE* m_pBuf;
- FX_DWORD m_Size;
- FX_DWORD m_Pos;
- FX_BYTE m_WordBuffer[256];
- FX_DWORD m_WordSize;
- CPDF_Object* m_pLastObj;
-};
-#endif
-typedef enum {
- PDFOP_CloseFillStrokePath = 0, PDFOP_FillStrokePath,
- PDFOP_CloseEOFillStrokePath, PDFOP_EOFillStrokePath,
- PDFOP_BeginMarkedContent_Dictionary, PDFOP_BeginImage,
- PDFOP_BeginMarkedContent, PDFOP_BeginText,
- PDFOP_BeginSectionUndefined, PDFOP_CurveTo_123,
- PDFOP_ConcatMatrix, PDFOP_SetColorSpace_Fill,
- PDFOP_SetColorSpace_Stroke, PDFOP_SetDash,
- PDFOP_SetCharWidth, PDFOP_SetCachedDevice,
- PDFOP_ExecuteXObject, PDFOP_MarkPlace_Dictionary,
- PDFOP_EndImage, PDFOP_EndMarkedContent,
- PDFOP_EndText, PDFOP_EndSectionUndefined,
- PDFOP_FillPath, PDFOP_FillPathOld,
- PDFOP_EOFillPath, PDFOP_SetGray_Fill,
- PDFOP_SetGray_Stroke, PDFOP_SetExtendGraphState,
- PDFOP_ClosePath, PDFOP_SetFlat,
- PDFOP_BeginImageData, PDFOP_SetLineJoin,
- PDFOP_SetLineCap, PDFOP_SetCMYKColor_Fill,
- PDFOP_SetCMYKColor_Stroke, PDFOP_LineTo,
- PDFOP_MoveTo, PDFOP_SetMiterLimit,
- PDFOP_MarkPlace, PDFOP_EndPath,
- PDFOP_SaveGraphState, PDFOP_RestoreGraphState,
- PDFOP_Rectangle, PDFOP_SetRGBColor_Fill,
- PDFOP_SetRGBColor_Stroke, PDFOP_SetRenderIntent,
- PDFOP_CloseStrokePath, PDFOP_StrokePath,
- PDFOP_SetColor_Fill, PDFOP_SetColor_Stroke,
- PDFOP_SetColorPS_Fill, PDFOP_SetColorPS_Stroke,
- PDFOP_ShadeFill, PDFOP_SetCharSpace,
- PDFOP_MoveTextPoint, PDFOP_MoveTextPoint_SetLeading,
- PDFOP_SetFont, PDFOP_ShowText,
- PDFOP_ShowText_Positioning, PDFOP_SetTextLeading,
- PDFOP_SetTextMatrix, PDFOP_SetTextRenderMode,
- PDFOP_SetTextRise, PDFOP_SetWordSpace,
- PDFOP_SetHorzScale, PDFOP_MoveToNextLine,
- PDFOP_CurveTo_23, PDFOP_SetLineWidth,
- PDFOP_Clip, PDFOP_EOClip,
- PDFOP_CurveTo_13, PDFOP_NextLineShowText,
- PDFOP_NextLineShowText_Space, PDFOP_Invalid
-} PDFOP;
-#define PARAM_BUF_SIZE 16
-typedef struct {
- int m_Type;
- union {
- struct {
- FX_BOOL m_bInteger;
- union {
- int m_Integer;
- FX_FLOAT m_Float;
- };
- } m_Number;
- CPDF_Object* m_pObject;
- struct {
- int m_Len;
- char m_Buffer[32];
- } m_Name;
- };
-} _ContentParam;
-#if defined(_FPDFAPI_MINI_)
-#define _FPDF_MAX_FORM_LEVEL_ 17
-#else
-#define _FPDF_MAX_FORM_LEVEL_ 30
-#endif
-#define _FPDF_MAX_TYPE3_FORM_LEVEL_ 4
-#define _FPDF_MAX_OBJECT_STACK_SIZE_ 512
-class CPDF_StreamContentParser : public CFX_Object
-{
-public:
- CPDF_StreamContentParser();
- ~CPDF_StreamContentParser();
- FX_BOOL Initialize();
- void PrepareParse(CPDF_Document* pDoc, CPDF_Dictionary* pPageResources, CPDF_Dictionary* pParentResources,
- CFX_AffineMatrix* pmtContentToUser,
- CPDF_PageObjects* pObjList, CPDF_Dictionary* pResources,
- CFX_FloatRect* pBBox, CPDF_ParseOptions* pOptions,
- CPDF_AllStates* pAllStates, int level);
- CPDF_Document* m_pDocument;
- CPDF_Dictionary* m_pPageResources;
- CPDF_Dictionary* m_pParentResources;
- CPDF_PageObjects* m_pObjectList;
- CPDF_Dictionary* m_pResources;
- int m_Level;
- CFX_AffineMatrix m_mtContentToUser;
- CFX_FloatRect m_BBox;
- CPDF_ParseOptions m_Options;
- _ContentParam m_ParamBuf1[PARAM_BUF_SIZE];
- FX_DWORD m_ParamStartPos;
- FX_DWORD m_ParamCount;
- void AddNumberParam(FX_LPCSTR str, int len);
- void AddObjectParam(CPDF_Object* pObj);
- void AddNameParam(FX_LPCSTR name, int size);
- int GetNextParamPos();
- void ClearAllParams();
- CPDF_Object* GetObject(FX_DWORD index);
- CFX_ByteString GetString(FX_DWORD index);
- FX_FLOAT GetNumber(FX_DWORD index);
- FX_FLOAT GetNumber16(FX_DWORD index);
- int GetInteger(FX_DWORD index)
- {
- return (FX_INT32)(GetNumber(index));
- }
- FX_BOOL OnOperator(FX_LPCSTR op);
- void BigCaseCaller(int index);
- FX_BOOL m_bAbort;
-#ifndef _FPDFAPI_MINI_
- CPDF_StreamParser* m_pSyntax;
- FX_DWORD GetParsePos()
- {
- return m_pSyntax->GetPos();
- }
-#else
- int m_WordState;
- void InputData(FX_LPCBYTE src_buf, FX_DWORD src_size);
- void Finish();
- void StartArray();
- void EndArray();
- void StartDict();
- void EndDict();
- void EndName();
- void EndNumber();
- void EndKeyword();
- void EndHexString();
- void EndString();
- void EndImageDict();
- void EndInlineImage();
- FX_LPBYTE m_pWordBuf;
- FX_DWORD m_WordSize;
- CFX_BinaryBuf m_StringBuf;
- int m_StringLevel, m_StringState, m_EscCode;
- void AddContainer(CPDF_Object* pObject);
- FX_BOOL SetToCurObj(CPDF_Object* pObject);
- FX_LPBYTE m_pDictName;
- FX_BOOL m_bDictName;
- CPDF_Object** m_pObjectStack;
- FX_BOOL* m_pObjectState;
- FX_DWORD m_ObjectSize;
- int m_InlineImageState;
- FX_BYTE m_InlineWhiteChar;
- CFX_BinaryBuf m_ImageSrcBuf;
- FX_LPBYTE m_pStreamBuf;
-#endif
- CPDF_AllStates* m_pCurStates;
- CPDF_ContentMark m_CurContentMark;
- CFX_PtrArray m_ClipTextList;
- CPDF_TextObject* m_pLastTextObject;
- FX_FLOAT m_DefFontSize;
- void AddTextObject(CFX_ByteString* pText, FX_FLOAT fInitKerning, FX_FLOAT* pKerning, int count);
-
- void ConvertUserSpace(FX_FLOAT& x, FX_FLOAT& y);
- void ConvertTextSpace(FX_FLOAT& x, FX_FLOAT& y);
- void OnChangeTextMatrix();
-#ifndef _FPDFAPI_MINI_
- FX_DWORD Parse(FX_LPCBYTE pData, FX_DWORD dwSize, FX_DWORD max_cost);
- void ParsePathObject();
-#endif
- int m_CompatCount;
- FX_PATHPOINT* m_pPathPoints;
- int m_PathPointCount;
- int m_PathAllocSize;
- FX_FLOAT m_PathStartX, m_PathStartY;
- FX_FLOAT m_PathCurrentX, m_PathCurrentY;
- int m_PathClipType;
- void AddPathPoint(FX_FLOAT x, FX_FLOAT y, int flag);
- void AddPathRect(FX_FLOAT x, FX_FLOAT y, FX_FLOAT w, FX_FLOAT h);
- void AddPathObject(int FillType, FX_BOOL bStroke);
- CPDF_ImageObject* AddImage(CPDF_Stream* pStream, CPDF_Image* pImage, FX_BOOL bInline);
- void AddDuplicateImage();
- void AddForm(CPDF_Stream*);
- CFX_ByteString m_LastImageName;
- CPDF_Image* m_pLastImage;
- CFX_BinaryBuf m_LastImageDict, m_LastImageData;
- CPDF_Dictionary* m_pLastImageDict;
- CPDF_Dictionary* m_pLastCloneImageDict;
- FX_BOOL m_bReleaseLastDict;
- FX_BOOL m_bSameLastDict;
- void SetGraphicStates(CPDF_PageObject* pObj, FX_BOOL bColor, FX_BOOL bText, FX_BOOL bGraph);
- FX_BOOL m_bColored;
- FX_FLOAT m_Type3Data[6];
- FX_BOOL m_bResourceMissing;
- CFX_PtrArray m_StateStack;
- void SaveStates(CPDF_AllStates*);
- void RestoreStates(CPDF_AllStates*);
- CPDF_Font* FindFont(const CFX_ByteString& name);
- CPDF_ColorSpace* FindColorSpace(const CFX_ByteString& name);
- CPDF_Pattern* FindPattern(const CFX_ByteString& name, FX_BOOL bShading);
- CPDF_Object* FindResourceObj(FX_BSTR type, const CFX_ByteString& name);
- void Handle_CloseFillStrokePath();
- void Handle_FillStrokePath();
- void Handle_CloseEOFillStrokePath();
- void Handle_EOFillStrokePath();
- void Handle_BeginMarkedContent_Dictionary();
- void Handle_BeginImage();
- void Handle_BeginMarkedContent();
- void Handle_BeginText();
- void Handle_BeginSectionUndefined();
- void Handle_CurveTo_123();
- void Handle_ConcatMatrix();
- void Handle_SetColorSpace_Fill();
- void Handle_SetColorSpace_Stroke();
- void Handle_SetDash();
- void Handle_SetCharWidth();
- void Handle_SetCachedDevice();
- void Handle_ExecuteXObject();
- void Handle_MarkPlace_Dictionary();
- void Handle_EndImage();
- void Handle_EndMarkedContent();
- void Handle_EndText();
- void Handle_EndSectionUndefined();
- void Handle_FillPath();
- void Handle_FillPathOld();
- void Handle_EOFillPath();
- void Handle_SetGray_Fill();
- void Handle_SetGray_Stroke();
- void Handle_SetExtendGraphState();
- void Handle_ClosePath();
- void Handle_SetFlat();
- void Handle_BeginImageData();
- void Handle_SetLineJoin();
- void Handle_SetLineCap();
- void Handle_SetCMYKColor_Fill();
- void Handle_SetCMYKColor_Stroke();
- void Handle_LineTo();
- void Handle_MoveTo();
- void Handle_SetMiterLimit();
- void Handle_MarkPlace();
- void Handle_EndPath();
- void Handle_SaveGraphState();
- void Handle_RestoreGraphState();
- void Handle_Rectangle();
- void Handle_SetRGBColor_Fill();
- void Handle_SetRGBColor_Stroke();
- void Handle_SetRenderIntent();
- void Handle_CloseStrokePath();
- void Handle_StrokePath();
- void Handle_SetColor_Fill();
- void Handle_SetColor_Stroke();
- void Handle_SetColorPS_Fill();
- void Handle_SetColorPS_Stroke();
- void Handle_ShadeFill();
- void Handle_SetCharSpace();
- void Handle_MoveTextPoint();
- void Handle_MoveTextPoint_SetLeading();
- void Handle_SetFont();
- void Handle_ShowText();
- void Handle_ShowText_Positioning();
- void Handle_SetTextLeading();
- void Handle_SetTextMatrix();
- void Handle_SetTextRenderMode();
- void Handle_SetTextRise();
- void Handle_SetWordSpace();
- void Handle_SetHorzScale();
- void Handle_MoveToNextLine();
- void Handle_CurveTo_23();
- void Handle_SetLineWidth();
- void Handle_Clip();
- void Handle_EOClip();
- void Handle_CurveTo_13();
- void Handle_NextLineShowText();
- void Handle_NextLineShowText_Space();
- void Handle_Invalid();
-};
-class CPDF_ContentParser : public CFX_Object
-{
-public:
- CPDF_ContentParser();
- ~CPDF_ContentParser();
- typedef enum { Ready, ToBeContinued, Done } ParseStatus;
- ParseStatus GetStatus()
- {
- return m_Status;
- }
- void Start(CPDF_Page* pPage, CPDF_ParseOptions* pOptions);
- void Start(CPDF_Form* pForm, CPDF_AllStates* pGraphicStates, CFX_AffineMatrix* pParentMatrix,
- CPDF_Type3Char* pType3Char, CPDF_ParseOptions* pOptions, int level);
- void Continue(IFX_Pause* pPause);
- int EstimateProgress();
-protected:
- void Clear();
- ParseStatus m_Status;
- CPDF_PageObjects* m_pObjects;
- FX_BOOL m_bForm;
- CPDF_ParseOptions m_Options;
- CPDF_Type3Char* m_pType3Char;
- int m_InternalStage;
- CPDF_StreamAcc* m_pSingleStream;
- CPDF_StreamAcc** m_pStreamArray;
- FX_DWORD m_nStreams;
- FX_LPBYTE m_pData;
- FX_DWORD m_Size;
- class CPDF_StreamContentParser* m_pParser;
- FX_DWORD m_CurrentOffset;
- CPDF_StreamFilter* m_pStreamFilter;
-};
-class CPDF_AllStates : public CPDF_GraphicStates
-{
-public:
- CPDF_AllStates();
- ~CPDF_AllStates();
- void Copy(const CPDF_AllStates& src);
- void ProcessExtGS(CPDF_Dictionary* pGS, CPDF_StreamContentParser* pParser);
- void SetLineDash(CPDF_Array*, FX_FLOAT, FX_FLOAT scale);
- CFX_AffineMatrix m_TextMatrix, m_CTM, m_ParentMatrix;
- FX_FLOAT m_TextX, m_TextY, m_TextLineX, m_TextLineY;
- FX_FLOAT m_TextLeading, m_TextRise, m_TextHorzScale;
-};
-template <class ObjClass> class CPDF_CountedObject : public CFX_Object
-{
-public:
- ObjClass m_Obj;
- FX_DWORD m_nCount;
-};
-typedef CFX_MapPtrTemplate<CPDF_Dictionary*, CPDF_CountedObject<CPDF_Font*>*> CPDF_FontMap;
-typedef CFX_MapPtrTemplate<CPDF_Object*, CPDF_CountedObject<CPDF_ColorSpace*>*> CPDF_ColorSpaceMap;
-typedef CFX_MapPtrTemplate<CPDF_Object*, CPDF_CountedObject<CPDF_Pattern*>*> CPDF_PatternMap;
-typedef CFX_MapPtrTemplate<FX_DWORD, CPDF_CountedObject<CPDF_Image*>*> CPDF_ImageMap;
-typedef CFX_MapPtrTemplate<CPDF_Stream*, CPDF_CountedObject<CPDF_IccProfile*>*> CPDF_IccProfileMap;
-typedef CFX_MapPtrTemplate<CPDF_Stream*, CPDF_CountedObject<CPDF_StreamAcc*>*> CPDF_FontFileMap;
-template <class KeyType, class ValueType>
-KeyType PDF_DocPageData_FindValue(const CFX_MapPtrTemplate<KeyType, CPDF_CountedObject<ValueType>*> &map, ValueType findValue, CPDF_CountedObject<ValueType>*& findData)
-{
- FX_POSITION pos = map.GetStartPosition();
- while (pos) {
- KeyType findKey;
- map.GetNextAssoc(pos, findKey, findData);
- if (findData->m_Obj == findValue) {
- return findKey;
- }
- }
- findData = NULL;
- return (KeyType)(FX_UINTPTR)NULL;
-}
-template <class KeyType, class ValueType>
-FX_BOOL PDF_DocPageData_Release(CFX_MapPtrTemplate<KeyType, CPDF_CountedObject<ValueType>*> &map, KeyType findKey, ValueType findValue, FX_BOOL bForce = FALSE)
-{
- if (!findKey && !findValue) {
- return FALSE;
- }
- CPDF_CountedObject<ValueType>* findData = NULL;
- if (!findKey) {
- findKey = PDF_DocPageData_FindValue<KeyType, ValueType>(map, findValue, findData);
- } else if (!map.Lookup(findKey, findData)) {
- return FALSE;
- }
- if (findData && ((-- findData->m_nCount) == 0 || bForce)) {
- delete findData->m_Obj;
- delete findData;
- map.RemoveKey(findKey);
- return TRUE;
- }
- return FALSE;
-}
-class CPDF_DocPageData : public CFX_Object
-{
-public:
- CPDF_DocPageData(CPDF_Document *pPDFDoc);
- ~CPDF_DocPageData();
- void Clear(FX_BOOL bRelease = FALSE);
- CPDF_Font* GetFont(CPDF_Dictionary* pFontDict, FX_BOOL findOnly);
- CPDF_Font* GetStandardFont(FX_BSTR fontName, CPDF_FontEncoding* pEncoding);
- void ReleaseFont(CPDF_Dictionary* pFontDict);
- CPDF_ColorSpace* GetColorSpace(CPDF_Object* pCSObj, CPDF_Dictionary* pResources);
- CPDF_ColorSpace* GetCopiedColorSpace(CPDF_Object* pCSObj);
- void ReleaseColorSpace(CPDF_Object* pColorSpace);
- CPDF_Pattern* GetPattern(CPDF_Object* pPatternObj, FX_BOOL bShading, const CFX_AffineMatrix* matrix);
- void ReleasePattern(CPDF_Object* pPatternObj);
- CPDF_Image* GetImage(CPDF_Object* pImageStream);
- void ReleaseImage(CPDF_Object* pImageStream);
- CPDF_IccProfile* GetIccProfile(CPDF_Stream* pIccProfileStream, FX_INT32 nComponents);
- void ReleaseIccProfile(CPDF_Stream* pIccProfileStream, CPDF_IccProfile* pIccProfile);
- CPDF_StreamAcc* GetFontFileStreamAcc(CPDF_Stream* pFontStream);
- void ReleaseFontFileStreamAcc(CPDF_Stream* pFontStream, FX_BOOL bForce = FALSE);
- CPDF_Document* m_pPDFDoc;
- CPDF_FontMap m_FontMap;
- CPDF_ColorSpaceMap m_ColorSpaceMap;
- CPDF_PatternMap m_PatternMap;
- CPDF_ImageMap m_ImageMap;
- CPDF_IccProfileMap m_IccProfileMap;
- CFX_MapByteStringToPtr m_HashProfileMap;
- CPDF_FontFileMap m_FontFileMap;
-};
-class CPDF_Function : public CFX_Object
-{
-public:
- static CPDF_Function* Load(CPDF_Object* pFuncObj);
- virtual ~CPDF_Function();
- FX_BOOL Call(FX_FLOAT* inputs, int ninputs, FX_FLOAT* results, int& nresults) const;
- int CountInputs()
- {
- return m_nInputs;
- }
- int CountOutputs()
- {
- return m_nOutputs;
- }
-protected:
- CPDF_Function();
- int m_nInputs, m_nOutputs;
- FX_FLOAT* m_pDomains;
- FX_FLOAT* m_pRanges;
- FX_BOOL Init(CPDF_Object* pObj);
- virtual FX_BOOL v_Init(CPDF_Object* pObj) = 0;
- virtual FX_BOOL v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const = 0;
-};
-class CPDF_IccProfile : public CFX_Object
-{
-public:
- CPDF_IccProfile(FX_LPCBYTE pData, FX_DWORD dwSize, int nComponents);
- ~CPDF_IccProfile();
- FX_BOOL m_bsRGB;
- FX_LPVOID m_pTransform;
-};
-class CPDF_DeviceCS : public CPDF_ColorSpace
-{
-public:
- CPDF_DeviceCS(int family);
- virtual FX_BOOL GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const;
- FX_BOOL SetRGB(FX_FLOAT* pBuf, FX_FLOAT R, FX_FLOAT G, FX_FLOAT B) const;
- FX_BOOL v_GetCMYK(FX_FLOAT* pBuf, FX_FLOAT& c, FX_FLOAT& m, FX_FLOAT& y, FX_FLOAT& k) const;
- FX_BOOL v_SetCMYK(FX_FLOAT* pBuf, FX_FLOAT c, FX_FLOAT m, FX_FLOAT y, FX_FLOAT k) const;
- virtual void TranslateImageLine(FX_LPBYTE pDestBuf, FX_LPCBYTE pSrcBuf, int pixels, int image_width, int image_height, FX_BOOL bTransMask = FALSE) const;
-};
-class CPDF_PatternCS : public CPDF_ColorSpace
-{
-public:
- CPDF_PatternCS();
- ~CPDF_PatternCS();
- virtual FX_BOOL v_Load(CPDF_Document* pDoc, CPDF_Array* pArray);
- virtual FX_BOOL GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const;
- virtual CPDF_ColorSpace* GetBaseCS() const
- {
- return m_pBaseCS;
- }
- CPDF_ColorSpace* m_pBaseCS;
-};
-#define MAX_PAGE_OBJECTS_UNIFY_NAMING 4096
-class CPDF_ResourceNaming : public CFX_Object
-{
-public:
- struct _NamingState : public CFX_Object {
- CFX_ByteString m_Prefix;
- int m_nIndex;
- };
- ~CPDF_ResourceNaming();
- CFX_ByteString GetName(const CPDF_Dictionary* pResList, FX_LPCSTR szType);
-protected:
- CFX_MapByteStringToPtr m_NamingCache;
-};
+// 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
+
+#include "../../../include/fpdfapi/fpdf_pageobj.h"
+#define PARSE_STEP_LIMIT 100
+#define STREAM_PARSE_BUFSIZE 20480
+class CPDF_QuickFontCache;
+#ifndef _FPDFAPI_MINI_
+class CPDF_StreamParser : public CFX_Object
+{
+public:
+
+ CPDF_StreamParser(const FX_BYTE* pData, FX_DWORD dwSize);
+ ~CPDF_StreamParser();
+
+ CPDF_Stream* ReadInlineStream(CPDF_Document* pDoc, CPDF_Dictionary* pDict, CPDF_Object* pCSObj, FX_BOOL bDecode);
+ typedef enum { EndOfData, Number, Keyword, Name, Others } SyntaxType;
+
+ SyntaxType ParseNextElement();
+ FX_LPBYTE GetWordBuf()
+ {
+ return m_WordBuffer;
+ }
+ FX_DWORD GetWordSize()
+ {
+ return m_WordSize;
+ }
+ CPDF_Object* GetObject()
+ {
+ CPDF_Object* pObj = m_pLastObj;
+ m_pLastObj = NULL;
+ return pObj;
+ }
+ FX_DWORD GetPos()
+ {
+ return m_Pos;
+ }
+ void SetPos(FX_DWORD pos)
+ {
+ m_Pos = pos;
+ }
+
+ CPDF_Object* ReadNextObject(FX_BOOL bAllowNestedArray = FALSE, FX_BOOL bInArray = FALSE);
+ void SkipPathObject();
+protected:
+ void GetNextWord(FX_BOOL& bIsNumber);
+ CFX_ByteString ReadString();
+ CFX_ByteString ReadHexString();
+ const FX_BYTE* m_pBuf;
+ FX_DWORD m_Size;
+ FX_DWORD m_Pos;
+ FX_BYTE m_WordBuffer[256];
+ FX_DWORD m_WordSize;
+ CPDF_Object* m_pLastObj;
+};
+#endif
+typedef enum {
+ PDFOP_CloseFillStrokePath = 0, PDFOP_FillStrokePath,
+ PDFOP_CloseEOFillStrokePath, PDFOP_EOFillStrokePath,
+ PDFOP_BeginMarkedContent_Dictionary, PDFOP_BeginImage,
+ PDFOP_BeginMarkedContent, PDFOP_BeginText,
+ PDFOP_BeginSectionUndefined, PDFOP_CurveTo_123,
+ PDFOP_ConcatMatrix, PDFOP_SetColorSpace_Fill,
+ PDFOP_SetColorSpace_Stroke, PDFOP_SetDash,
+ PDFOP_SetCharWidth, PDFOP_SetCachedDevice,
+ PDFOP_ExecuteXObject, PDFOP_MarkPlace_Dictionary,
+ PDFOP_EndImage, PDFOP_EndMarkedContent,
+ PDFOP_EndText, PDFOP_EndSectionUndefined,
+ PDFOP_FillPath, PDFOP_FillPathOld,
+ PDFOP_EOFillPath, PDFOP_SetGray_Fill,
+ PDFOP_SetGray_Stroke, PDFOP_SetExtendGraphState,
+ PDFOP_ClosePath, PDFOP_SetFlat,
+ PDFOP_BeginImageData, PDFOP_SetLineJoin,
+ PDFOP_SetLineCap, PDFOP_SetCMYKColor_Fill,
+ PDFOP_SetCMYKColor_Stroke, PDFOP_LineTo,
+ PDFOP_MoveTo, PDFOP_SetMiterLimit,
+ PDFOP_MarkPlace, PDFOP_EndPath,
+ PDFOP_SaveGraphState, PDFOP_RestoreGraphState,
+ PDFOP_Rectangle, PDFOP_SetRGBColor_Fill,
+ PDFOP_SetRGBColor_Stroke, PDFOP_SetRenderIntent,
+ PDFOP_CloseStrokePath, PDFOP_StrokePath,
+ PDFOP_SetColor_Fill, PDFOP_SetColor_Stroke,
+ PDFOP_SetColorPS_Fill, PDFOP_SetColorPS_Stroke,
+ PDFOP_ShadeFill, PDFOP_SetCharSpace,
+ PDFOP_MoveTextPoint, PDFOP_MoveTextPoint_SetLeading,
+ PDFOP_SetFont, PDFOP_ShowText,
+ PDFOP_ShowText_Positioning, PDFOP_SetTextLeading,
+ PDFOP_SetTextMatrix, PDFOP_SetTextRenderMode,
+ PDFOP_SetTextRise, PDFOP_SetWordSpace,
+ PDFOP_SetHorzScale, PDFOP_MoveToNextLine,
+ PDFOP_CurveTo_23, PDFOP_SetLineWidth,
+ PDFOP_Clip, PDFOP_EOClip,
+ PDFOP_CurveTo_13, PDFOP_NextLineShowText,
+ PDFOP_NextLineShowText_Space, PDFOP_Invalid
+} PDFOP;
+#define PARAM_BUF_SIZE 16
+typedef struct {
+ int m_Type;
+ union {
+ struct {
+ FX_BOOL m_bInteger;
+ union {
+ int m_Integer;
+ FX_FLOAT m_Float;
+ };
+ } m_Number;
+ CPDF_Object* m_pObject;
+ struct {
+ int m_Len;
+ char m_Buffer[32];
+ } m_Name;
+ };
+} _ContentParam;
+#if defined(_FPDFAPI_MINI_)
+#define _FPDF_MAX_FORM_LEVEL_ 17
+#else
+#define _FPDF_MAX_FORM_LEVEL_ 30
+#endif
+#define _FPDF_MAX_TYPE3_FORM_LEVEL_ 4
+#define _FPDF_MAX_OBJECT_STACK_SIZE_ 512
+class CPDF_StreamContentParser : public CFX_Object
+{
+public:
+ CPDF_StreamContentParser();
+ ~CPDF_StreamContentParser();
+ FX_BOOL Initialize();
+ void PrepareParse(CPDF_Document* pDoc, CPDF_Dictionary* pPageResources, CPDF_Dictionary* pParentResources,
+ CFX_AffineMatrix* pmtContentToUser,
+ CPDF_PageObjects* pObjList, CPDF_Dictionary* pResources,
+ CFX_FloatRect* pBBox, CPDF_ParseOptions* pOptions,
+ CPDF_AllStates* pAllStates, int level);
+ CPDF_Document* m_pDocument;
+ CPDF_Dictionary* m_pPageResources;
+ CPDF_Dictionary* m_pParentResources;
+ CPDF_PageObjects* m_pObjectList;
+ CPDF_Dictionary* m_pResources;
+ int m_Level;
+ CFX_AffineMatrix m_mtContentToUser;
+ CFX_FloatRect m_BBox;
+ CPDF_ParseOptions m_Options;
+ _ContentParam m_ParamBuf1[PARAM_BUF_SIZE];
+ FX_DWORD m_ParamStartPos;
+ FX_DWORD m_ParamCount;
+ void AddNumberParam(FX_LPCSTR str, int len);
+ void AddObjectParam(CPDF_Object* pObj);
+ void AddNameParam(FX_LPCSTR name, int size);
+ int GetNextParamPos();
+ void ClearAllParams();
+ CPDF_Object* GetObject(FX_DWORD index);
+ CFX_ByteString GetString(FX_DWORD index);
+ FX_FLOAT GetNumber(FX_DWORD index);
+ FX_FLOAT GetNumber16(FX_DWORD index);
+ int GetInteger(FX_DWORD index)
+ {
+ return (FX_INT32)(GetNumber(index));
+ }
+ FX_BOOL OnOperator(FX_LPCSTR op);
+ void BigCaseCaller(int index);
+ FX_BOOL m_bAbort;
+#ifndef _FPDFAPI_MINI_
+ CPDF_StreamParser* m_pSyntax;
+ FX_DWORD GetParsePos()
+ {
+ return m_pSyntax->GetPos();
+ }
+#else
+ int m_WordState;
+ void InputData(FX_LPCBYTE src_buf, FX_DWORD src_size);
+ void Finish();
+ void StartArray();
+ void EndArray();
+ void StartDict();
+ void EndDict();
+ void EndName();
+ void EndNumber();
+ void EndKeyword();
+ void EndHexString();
+ void EndString();
+ void EndImageDict();
+ void EndInlineImage();
+ FX_LPBYTE m_pWordBuf;
+ FX_DWORD m_WordSize;
+ CFX_BinaryBuf m_StringBuf;
+ int m_StringLevel, m_StringState, m_EscCode;
+ void AddContainer(CPDF_Object* pObject);
+ FX_BOOL SetToCurObj(CPDF_Object* pObject);
+ FX_LPBYTE m_pDictName;
+ FX_BOOL m_bDictName;
+ CPDF_Object** m_pObjectStack;
+ FX_BOOL* m_pObjectState;
+ FX_DWORD m_ObjectSize;
+ int m_InlineImageState;
+ FX_BYTE m_InlineWhiteChar;
+ CFX_BinaryBuf m_ImageSrcBuf;
+ FX_LPBYTE m_pStreamBuf;
+#endif
+ CPDF_AllStates* m_pCurStates;
+ CPDF_ContentMark m_CurContentMark;
+ CFX_PtrArray m_ClipTextList;
+ CPDF_TextObject* m_pLastTextObject;
+ FX_FLOAT m_DefFontSize;
+ void AddTextObject(CFX_ByteString* pText, FX_FLOAT fInitKerning, FX_FLOAT* pKerning, int count);
+
+ void ConvertUserSpace(FX_FLOAT& x, FX_FLOAT& y);
+ void ConvertTextSpace(FX_FLOAT& x, FX_FLOAT& y);
+ void OnChangeTextMatrix();
+#ifndef _FPDFAPI_MINI_
+ FX_DWORD Parse(FX_LPCBYTE pData, FX_DWORD dwSize, FX_DWORD max_cost);
+ void ParsePathObject();
+#endif
+ int m_CompatCount;
+ FX_PATHPOINT* m_pPathPoints;
+ int m_PathPointCount;
+ int m_PathAllocSize;
+ FX_FLOAT m_PathStartX, m_PathStartY;
+ FX_FLOAT m_PathCurrentX, m_PathCurrentY;
+ int m_PathClipType;
+ void AddPathPoint(FX_FLOAT x, FX_FLOAT y, int flag);
+ void AddPathRect(FX_FLOAT x, FX_FLOAT y, FX_FLOAT w, FX_FLOAT h);
+ void AddPathObject(int FillType, FX_BOOL bStroke);
+ CPDF_ImageObject* AddImage(CPDF_Stream* pStream, CPDF_Image* pImage, FX_BOOL bInline);
+ void AddDuplicateImage();
+ void AddForm(CPDF_Stream*);
+ CFX_ByteString m_LastImageName;
+ CPDF_Image* m_pLastImage;
+ CFX_BinaryBuf m_LastImageDict, m_LastImageData;
+ CPDF_Dictionary* m_pLastImageDict;
+ CPDF_Dictionary* m_pLastCloneImageDict;
+ FX_BOOL m_bReleaseLastDict;
+ FX_BOOL m_bSameLastDict;
+ void SetGraphicStates(CPDF_PageObject* pObj, FX_BOOL bColor, FX_BOOL bText, FX_BOOL bGraph);
+ FX_BOOL m_bColored;
+ FX_FLOAT m_Type3Data[6];
+ FX_BOOL m_bResourceMissing;
+ CFX_PtrArray m_StateStack;
+ void SaveStates(CPDF_AllStates*);
+ void RestoreStates(CPDF_AllStates*);
+ CPDF_Font* FindFont(const CFX_ByteString& name);
+ CPDF_ColorSpace* FindColorSpace(const CFX_ByteString& name);
+ CPDF_Pattern* FindPattern(const CFX_ByteString& name, FX_BOOL bShading);
+ CPDF_Object* FindResourceObj(FX_BSTR type, const CFX_ByteString& name);
+ void Handle_CloseFillStrokePath();
+ void Handle_FillStrokePath();
+ void Handle_CloseEOFillStrokePath();
+ void Handle_EOFillStrokePath();
+ void Handle_BeginMarkedContent_Dictionary();
+ void Handle_BeginImage();
+ void Handle_BeginMarkedContent();
+ void Handle_BeginText();
+ void Handle_BeginSectionUndefined();
+ void Handle_CurveTo_123();
+ void Handle_ConcatMatrix();
+ void Handle_SetColorSpace_Fill();
+ void Handle_SetColorSpace_Stroke();
+ void Handle_SetDash();
+ void Handle_SetCharWidth();
+ void Handle_SetCachedDevice();
+ void Handle_ExecuteXObject();
+ void Handle_MarkPlace_Dictionary();
+ void Handle_EndImage();
+ void Handle_EndMarkedContent();
+ void Handle_EndText();
+ void Handle_EndSectionUndefined();
+ void Handle_FillPath();
+ void Handle_FillPathOld();
+ void Handle_EOFillPath();
+ void Handle_SetGray_Fill();
+ void Handle_SetGray_Stroke();
+ void Handle_SetExtendGraphState();
+ void Handle_ClosePath();
+ void Handle_SetFlat();
+ void Handle_BeginImageData();
+ void Handle_SetLineJoin();
+ void Handle_SetLineCap();
+ void Handle_SetCMYKColor_Fill();
+ void Handle_SetCMYKColor_Stroke();
+ void Handle_LineTo();
+ void Handle_MoveTo();
+ void Handle_SetMiterLimit();
+ void Handle_MarkPlace();
+ void Handle_EndPath();
+ void Handle_SaveGraphState();
+ void Handle_RestoreGraphState();
+ void Handle_Rectangle();
+ void Handle_SetRGBColor_Fill();
+ void Handle_SetRGBColor_Stroke();
+ void Handle_SetRenderIntent();
+ void Handle_CloseStrokePath();
+ void Handle_StrokePath();
+ void Handle_SetColor_Fill();
+ void Handle_SetColor_Stroke();
+ void Handle_SetColorPS_Fill();
+ void Handle_SetColorPS_Stroke();
+ void Handle_ShadeFill();
+ void Handle_SetCharSpace();
+ void Handle_MoveTextPoint();
+ void Handle_MoveTextPoint_SetLeading();
+ void Handle_SetFont();
+ void Handle_ShowText();
+ void Handle_ShowText_Positioning();
+ void Handle_SetTextLeading();
+ void Handle_SetTextMatrix();
+ void Handle_SetTextRenderMode();
+ void Handle_SetTextRise();
+ void Handle_SetWordSpace();
+ void Handle_SetHorzScale();
+ void Handle_MoveToNextLine();
+ void Handle_CurveTo_23();
+ void Handle_SetLineWidth();
+ void Handle_Clip();
+ void Handle_EOClip();
+ void Handle_CurveTo_13();
+ void Handle_NextLineShowText();
+ void Handle_NextLineShowText_Space();
+ void Handle_Invalid();
+};
+class CPDF_ContentParser : public CFX_Object
+{
+public:
+ CPDF_ContentParser();
+ ~CPDF_ContentParser();
+ typedef enum { Ready, ToBeContinued, Done } ParseStatus;
+ ParseStatus GetStatus()
+ {
+ return m_Status;
+ }
+ void Start(CPDF_Page* pPage, CPDF_ParseOptions* pOptions);
+ void Start(CPDF_Form* pForm, CPDF_AllStates* pGraphicStates, CFX_AffineMatrix* pParentMatrix,
+ CPDF_Type3Char* pType3Char, CPDF_ParseOptions* pOptions, int level);
+ void Continue(IFX_Pause* pPause);
+ int EstimateProgress();
+protected:
+ void Clear();
+ ParseStatus m_Status;
+ CPDF_PageObjects* m_pObjects;
+ FX_BOOL m_bForm;
+ CPDF_ParseOptions m_Options;
+ CPDF_Type3Char* m_pType3Char;
+ int m_InternalStage;
+ CPDF_StreamAcc* m_pSingleStream;
+ CPDF_StreamAcc** m_pStreamArray;
+ FX_DWORD m_nStreams;
+ FX_LPBYTE m_pData;
+ FX_DWORD m_Size;
+ class CPDF_StreamContentParser* m_pParser;
+ FX_DWORD m_CurrentOffset;
+ CPDF_StreamFilter* m_pStreamFilter;
+};
+class CPDF_AllStates : public CPDF_GraphicStates
+{
+public:
+ CPDF_AllStates();
+ ~CPDF_AllStates();
+ void Copy(const CPDF_AllStates& src);
+ void ProcessExtGS(CPDF_Dictionary* pGS, CPDF_StreamContentParser* pParser);
+ void SetLineDash(CPDF_Array*, FX_FLOAT, FX_FLOAT scale);
+ CFX_AffineMatrix m_TextMatrix, m_CTM, m_ParentMatrix;
+ FX_FLOAT m_TextX, m_TextY, m_TextLineX, m_TextLineY;
+ FX_FLOAT m_TextLeading, m_TextRise, m_TextHorzScale;
+};
+template <class ObjClass> class CPDF_CountedObject : public CFX_Object
+{
+public:
+ ObjClass m_Obj;
+ FX_DWORD m_nCount;
+};
+typedef CFX_MapPtrTemplate<CPDF_Dictionary*, CPDF_CountedObject<CPDF_Font*>*> CPDF_FontMap;
+typedef CFX_MapPtrTemplate<CPDF_Object*, CPDF_CountedObject<CPDF_ColorSpace*>*> CPDF_ColorSpaceMap;
+typedef CFX_MapPtrTemplate<CPDF_Object*, CPDF_CountedObject<CPDF_Pattern*>*> CPDF_PatternMap;
+typedef CFX_MapPtrTemplate<FX_DWORD, CPDF_CountedObject<CPDF_Image*>*> CPDF_ImageMap;
+typedef CFX_MapPtrTemplate<CPDF_Stream*, CPDF_CountedObject<CPDF_IccProfile*>*> CPDF_IccProfileMap;
+typedef CFX_MapPtrTemplate<CPDF_Stream*, CPDF_CountedObject<CPDF_StreamAcc*>*> CPDF_FontFileMap;
+template <class KeyType, class ValueType>
+KeyType PDF_DocPageData_FindValue(const CFX_MapPtrTemplate<KeyType, CPDF_CountedObject<ValueType>*> &map, ValueType findValue, CPDF_CountedObject<ValueType>*& findData)
+{
+ FX_POSITION pos = map.GetStartPosition();
+ while (pos) {
+ KeyType findKey;
+ map.GetNextAssoc(pos, findKey, findData);
+ if (findData->m_Obj == findValue) {
+ return findKey;
+ }
+ }
+ findData = NULL;
+ return (KeyType)(FX_UINTPTR)NULL;
+}
+template <class KeyType, class ValueType>
+FX_BOOL PDF_DocPageData_Release(CFX_MapPtrTemplate<KeyType, CPDF_CountedObject<ValueType>*> &map, KeyType findKey, ValueType findValue, FX_BOOL bForce = FALSE)
+{
+ if (!findKey && !findValue) {
+ return FALSE;
+ }
+ CPDF_CountedObject<ValueType>* findData = NULL;
+ if (!findKey) {
+ findKey = PDF_DocPageData_FindValue<KeyType, ValueType>(map, findValue, findData);
+ } else if (!map.Lookup(findKey, findData)) {
+ return FALSE;
+ }
+ if (findData && ((-- findData->m_nCount) == 0 || bForce)) {
+ delete findData->m_Obj;
+ delete findData;
+ map.RemoveKey(findKey);
+ return TRUE;
+ }
+ return FALSE;
+}
+class CPDF_DocPageData : public CFX_Object
+{
+public:
+ CPDF_DocPageData(CPDF_Document *pPDFDoc);
+ ~CPDF_DocPageData();
+ void Clear(FX_BOOL bRelease = FALSE);
+ CPDF_Font* GetFont(CPDF_Dictionary* pFontDict, FX_BOOL findOnly);
+ CPDF_Font* GetStandardFont(FX_BSTR fontName, CPDF_FontEncoding* pEncoding);
+ void ReleaseFont(CPDF_Dictionary* pFontDict);
+ CPDF_ColorSpace* GetColorSpace(CPDF_Object* pCSObj, CPDF_Dictionary* pResources);
+ CPDF_ColorSpace* GetCopiedColorSpace(CPDF_Object* pCSObj);
+ void ReleaseColorSpace(CPDF_Object* pColorSpace);
+ CPDF_Pattern* GetPattern(CPDF_Object* pPatternObj, FX_BOOL bShading, const CFX_AffineMatrix* matrix);
+ void ReleasePattern(CPDF_Object* pPatternObj);
+ CPDF_Image* GetImage(CPDF_Object* pImageStream);
+ void ReleaseImage(CPDF_Object* pImageStream);
+ CPDF_IccProfile* GetIccProfile(CPDF_Stream* pIccProfileStream, FX_INT32 nComponents);
+ void ReleaseIccProfile(CPDF_Stream* pIccProfileStream, CPDF_IccProfile* pIccProfile);
+ CPDF_StreamAcc* GetFontFileStreamAcc(CPDF_Stream* pFontStream);
+ void ReleaseFontFileStreamAcc(CPDF_Stream* pFontStream, FX_BOOL bForce = FALSE);
+ CPDF_Document* m_pPDFDoc;
+ CPDF_FontMap m_FontMap;
+ CPDF_ColorSpaceMap m_ColorSpaceMap;
+ CPDF_PatternMap m_PatternMap;
+ CPDF_ImageMap m_ImageMap;
+ CPDF_IccProfileMap m_IccProfileMap;
+ CFX_MapByteStringToPtr m_HashProfileMap;
+ CPDF_FontFileMap m_FontFileMap;
+};
+class CPDF_Function : public CFX_Object
+{
+public:
+ static CPDF_Function* Load(CPDF_Object* pFuncObj);
+ virtual ~CPDF_Function();
+ FX_BOOL Call(FX_FLOAT* inputs, int ninputs, FX_FLOAT* results, int& nresults) const;
+ int CountInputs()
+ {
+ return m_nInputs;
+ }
+ int CountOutputs()
+ {
+ return m_nOutputs;
+ }
+protected:
+ CPDF_Function();
+ int m_nInputs, m_nOutputs;
+ FX_FLOAT* m_pDomains;
+ FX_FLOAT* m_pRanges;
+ FX_BOOL Init(CPDF_Object* pObj);
+ virtual FX_BOOL v_Init(CPDF_Object* pObj) = 0;
+ virtual FX_BOOL v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const = 0;
+};
+class CPDF_IccProfile : public CFX_Object
+{
+public:
+ CPDF_IccProfile(FX_LPCBYTE pData, FX_DWORD dwSize, int nComponents);
+ ~CPDF_IccProfile();
+ FX_BOOL m_bsRGB;
+ FX_LPVOID m_pTransform;
+};
+class CPDF_DeviceCS : public CPDF_ColorSpace
+{
+public:
+ CPDF_DeviceCS(int family);
+ virtual FX_BOOL GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const;
+ FX_BOOL SetRGB(FX_FLOAT* pBuf, FX_FLOAT R, FX_FLOAT G, FX_FLOAT B) const;
+ FX_BOOL v_GetCMYK(FX_FLOAT* pBuf, FX_FLOAT& c, FX_FLOAT& m, FX_FLOAT& y, FX_FLOAT& k) const;
+ FX_BOOL v_SetCMYK(FX_FLOAT* pBuf, FX_FLOAT c, FX_FLOAT m, FX_FLOAT y, FX_FLOAT k) const;
+ virtual void TranslateImageLine(FX_LPBYTE pDestBuf, FX_LPCBYTE pSrcBuf, int pixels, int image_width, int image_height, FX_BOOL bTransMask = FALSE) const;
+};
+class CPDF_PatternCS : public CPDF_ColorSpace
+{
+public:
+ CPDF_PatternCS();
+ ~CPDF_PatternCS();
+ virtual FX_BOOL v_Load(CPDF_Document* pDoc, CPDF_Array* pArray);
+ virtual FX_BOOL GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B) const;
+ virtual CPDF_ColorSpace* GetBaseCS() const
+ {
+ return m_pBaseCS;
+ }
+ CPDF_ColorSpace* m_pBaseCS;
+};
+#define MAX_PAGE_OBJECTS_UNIFY_NAMING 4096
+class CPDF_ResourceNaming : public CFX_Object
+{
+public:
+ struct _NamingState : public CFX_Object {
+ CFX_ByteString m_Prefix;
+ int m_nIndex;
+ };
+ ~CPDF_ResourceNaming();
+ CFX_ByteString GetName(const CPDF_Dictionary* pResList, FX_LPCSTR szType);
+protected:
+ CFX_MapByteStringToPtr m_NamingCache;
+};
diff --git a/core/src/fpdfapi/fpdf_parser/filters_int.h b/core/src/fpdfapi/fpdf_parser/filters_int.h
index fa7d7db76e..d1dedc482c 100644
--- a/core/src/fpdfapi/fpdf_parser/filters_int.h
+++ b/core/src/fpdfapi/fpdf_parser/filters_int.h
@@ -1,119 +1,119 @@
-// 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
-
-class CPDF_DecryptFilter : public CFX_DataFilter
-{
-public:
- CPDF_DecryptFilter(CPDF_CryptoHandler* pCryptoHandler, FX_DWORD objnum, FX_DWORD gennum);
- virtual ~CPDF_DecryptFilter();
- virtual void v_FilterIn(FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf);
- virtual void v_FilterFinish(CFX_BinaryBuf& dest_buf);
- CPDF_CryptoHandler* m_pCryptoHandler;
- FX_LPVOID m_pContext;
- FX_DWORD m_ObjNum, m_GenNum;
-};
-class CPDF_FlateFilter : public CFX_DataFilter
-{
-public:
- CPDF_FlateFilter();
- virtual ~CPDF_FlateFilter();
- virtual void v_FilterIn(FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf);
- virtual void v_FilterFinish(CFX_BinaryBuf& dest_buf) {}
- void* m_pContext;
- FX_BYTE m_DestBuffer[FPDF_FILTER_BUFFER_SIZE];
-};
-class CPDF_LzwFilter : public CFX_DataFilter
-{
-public:
- CPDF_LzwFilter(FX_BOOL bEarlyChange);
- virtual ~CPDF_LzwFilter() {}
- virtual void v_FilterIn(FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf);
- virtual void v_FilterFinish(CFX_BinaryBuf& dest_buf) {}
- FX_BOOL m_bEarlyChange;
- FX_DWORD m_CodeArray[5021];
- FX_DWORD m_nCodes;
- FX_DWORD m_CodeLen;
- FX_DWORD m_OldCode;
- FX_BYTE m_LastChar;
- FX_DWORD m_nLeftBits, m_LeftBits;
- FX_BYTE m_DecodeStack[4000];
- FX_DWORD m_StackLen;
- void AddCode(FX_DWORD prefix_code, FX_BYTE append_char);
- void DecodeString(FX_DWORD code);
-};
-class CPDF_PredictorFilter : public CFX_DataFilter
-{
-public:
- CPDF_PredictorFilter(int predictor, int colors, int bpc, int cols);
- virtual ~CPDF_PredictorFilter();
- virtual void v_FilterIn(FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf);
- virtual void v_FilterFinish(CFX_BinaryBuf& dest_buf) {}
- FX_BOOL m_bTiff;
- FX_DWORD m_Pitch, m_Bpp;
- FX_LPBYTE m_pRefLine, m_pCurLine;
- FX_DWORD m_iLine, m_LineInSize;
-};
-class CPDF_AsciiHexFilter : public CFX_DataFilter
-{
-public:
- CPDF_AsciiHexFilter();
- virtual ~CPDF_AsciiHexFilter() {}
- virtual void v_FilterIn(FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf);
- virtual void v_FilterFinish(CFX_BinaryBuf& dest_buf) {}
- int m_State;
- int m_FirstDigit;
-};
-class CPDF_Ascii85Filter : public CFX_DataFilter
-{
-public:
- CPDF_Ascii85Filter();
- virtual ~CPDF_Ascii85Filter() {}
- virtual void v_FilterIn(FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf);
- virtual void v_FilterFinish(CFX_BinaryBuf& dest_buf) {}
- int m_State;
- int m_CharCount;
- FX_DWORD m_CurDWord;
-};
-class CPDF_RunLenFilter : public CFX_DataFilter
-{
-public:
- CPDF_RunLenFilter();
- virtual ~CPDF_RunLenFilter() {}
- virtual void v_FilterIn(FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf);
- virtual void v_FilterFinish(CFX_BinaryBuf& dest_buf) {}
- int m_State;
- FX_DWORD m_Count;
-};
-class CPDF_JpegFilter : public CFX_DataFilter
-{
-public:
- CPDF_JpegFilter();
- virtual ~CPDF_JpegFilter();
- virtual void v_FilterIn(FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf);
- virtual void v_FilterFinish(CFX_BinaryBuf& dest_buf) {}
- void* m_pContext;
- CFX_BinaryBuf m_InputBuf;
- FX_LPBYTE m_pScanline;
- int m_Pitch, m_Height, m_Width, m_nComps, m_iLine;
- FX_BOOL m_bGotHeader;
-};
-class CPDF_FaxFilter : public CFX_DataFilter
-{
-public:
- CPDF_FaxFilter();
- virtual ~CPDF_FaxFilter();
- FX_BOOL Initialize(int Encoding, int bEndOfLine, int bByteAlign, int bBlack, int nRows, int nColumns);
- virtual void v_FilterIn(FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf);
- virtual void v_FilterFinish(CFX_BinaryBuf& dest_buf);
- int m_Encoding, m_bEndOfLine, m_bByteAlign, m_bBlack;
- int m_nRows, m_nColumns, m_Pitch, m_iRow;
- FX_LPBYTE m_pScanlineBuf, m_pRefBuf;
- CFX_BinaryBuf m_InputBuf;
- int m_InputBitPos;
- void ProcessData(FX_LPCBYTE src_buf, FX_DWORD src_size, int& bitpos, FX_BOOL bFinish,
- CFX_BinaryBuf& dest_buf);
- FX_BOOL ReadLine(FX_LPCBYTE src_buf, int bitsize, int& bitpos);
-};
+// 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
+
+class CPDF_DecryptFilter : public CFX_DataFilter
+{
+public:
+ CPDF_DecryptFilter(CPDF_CryptoHandler* pCryptoHandler, FX_DWORD objnum, FX_DWORD gennum);
+ virtual ~CPDF_DecryptFilter();
+ virtual void v_FilterIn(FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf);
+ virtual void v_FilterFinish(CFX_BinaryBuf& dest_buf);
+ CPDF_CryptoHandler* m_pCryptoHandler;
+ FX_LPVOID m_pContext;
+ FX_DWORD m_ObjNum, m_GenNum;
+};
+class CPDF_FlateFilter : public CFX_DataFilter
+{
+public:
+ CPDF_FlateFilter();
+ virtual ~CPDF_FlateFilter();
+ virtual void v_FilterIn(FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf);
+ virtual void v_FilterFinish(CFX_BinaryBuf& dest_buf) {}
+ void* m_pContext;
+ FX_BYTE m_DestBuffer[FPDF_FILTER_BUFFER_SIZE];
+};
+class CPDF_LzwFilter : public CFX_DataFilter
+{
+public:
+ CPDF_LzwFilter(FX_BOOL bEarlyChange);
+ virtual ~CPDF_LzwFilter() {}
+ virtual void v_FilterIn(FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf);
+ virtual void v_FilterFinish(CFX_BinaryBuf& dest_buf) {}
+ FX_BOOL m_bEarlyChange;
+ FX_DWORD m_CodeArray[5021];
+ FX_DWORD m_nCodes;
+ FX_DWORD m_CodeLen;
+ FX_DWORD m_OldCode;
+ FX_BYTE m_LastChar;
+ FX_DWORD m_nLeftBits, m_LeftBits;
+ FX_BYTE m_DecodeStack[4000];
+ FX_DWORD m_StackLen;
+ void AddCode(FX_DWORD prefix_code, FX_BYTE append_char);
+ void DecodeString(FX_DWORD code);
+};
+class CPDF_PredictorFilter : public CFX_DataFilter
+{
+public:
+ CPDF_PredictorFilter(int predictor, int colors, int bpc, int cols);
+ virtual ~CPDF_PredictorFilter();
+ virtual void v_FilterIn(FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf);
+ virtual void v_FilterFinish(CFX_BinaryBuf& dest_buf) {}
+ FX_BOOL m_bTiff;
+ FX_DWORD m_Pitch, m_Bpp;
+ FX_LPBYTE m_pRefLine, m_pCurLine;
+ FX_DWORD m_iLine, m_LineInSize;
+};
+class CPDF_AsciiHexFilter : public CFX_DataFilter
+{
+public:
+ CPDF_AsciiHexFilter();
+ virtual ~CPDF_AsciiHexFilter() {}
+ virtual void v_FilterIn(FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf);
+ virtual void v_FilterFinish(CFX_BinaryBuf& dest_buf) {}
+ int m_State;
+ int m_FirstDigit;
+};
+class CPDF_Ascii85Filter : public CFX_DataFilter
+{
+public:
+ CPDF_Ascii85Filter();
+ virtual ~CPDF_Ascii85Filter() {}
+ virtual void v_FilterIn(FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf);
+ virtual void v_FilterFinish(CFX_BinaryBuf& dest_buf) {}
+ int m_State;
+ int m_CharCount;
+ FX_DWORD m_CurDWord;
+};
+class CPDF_RunLenFilter : public CFX_DataFilter
+{
+public:
+ CPDF_RunLenFilter();
+ virtual ~CPDF_RunLenFilter() {}
+ virtual void v_FilterIn(FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf);
+ virtual void v_FilterFinish(CFX_BinaryBuf& dest_buf) {}
+ int m_State;
+ FX_DWORD m_Count;
+};
+class CPDF_JpegFilter : public CFX_DataFilter
+{
+public:
+ CPDF_JpegFilter();
+ virtual ~CPDF_JpegFilter();
+ virtual void v_FilterIn(FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf);
+ virtual void v_FilterFinish(CFX_BinaryBuf& dest_buf) {}
+ void* m_pContext;
+ CFX_BinaryBuf m_InputBuf;
+ FX_LPBYTE m_pScanline;
+ int m_Pitch, m_Height, m_Width, m_nComps, m_iLine;
+ FX_BOOL m_bGotHeader;
+};
+class CPDF_FaxFilter : public CFX_DataFilter
+{
+public:
+ CPDF_FaxFilter();
+ virtual ~CPDF_FaxFilter();
+ FX_BOOL Initialize(int Encoding, int bEndOfLine, int bByteAlign, int bBlack, int nRows, int nColumns);
+ virtual void v_FilterIn(FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf);
+ virtual void v_FilterFinish(CFX_BinaryBuf& dest_buf);
+ int m_Encoding, m_bEndOfLine, m_bByteAlign, m_bBlack;
+ int m_nRows, m_nColumns, m_Pitch, m_iRow;
+ FX_LPBYTE m_pScanlineBuf, m_pRefBuf;
+ CFX_BinaryBuf m_InputBuf;
+ int m_InputBitPos;
+ void ProcessData(FX_LPCBYTE src_buf, FX_DWORD src_size, int& bitpos, FX_BOOL bFinish,
+ CFX_BinaryBuf& dest_buf);
+ FX_BOOL ReadLine(FX_LPCBYTE src_buf, int bitsize, int& bitpos);
+};
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp
index 74e81d40fd..dfc26bc197 100644
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp
@@ -1,533 +1,533 @@
-// 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
-
-#include "../../../include/fpdfapi/fpdf_parser.h"
-#include "../../../include/fpdfapi/fpdf_module.h"
-#include "../../../include/fxcodec/fx_codec.h"
-#include <limits.h>
-#define _STREAM_MAX_SIZE_ 20 * 1024 * 1024
-FX_DWORD _A85Decode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size)
-{
- dest_size = 0;
- dest_buf = NULL;
- if (src_size == 0) {
- return 0;
- }
- FX_DWORD orig_size = dest_size;
- FX_DWORD zcount = 0;
- FX_DWORD pos = 0;
- while (pos < src_size) {
- FX_BYTE ch = src_buf[pos];
- if (ch < '!' && ch != '\n' && ch != '\r' && ch != ' ' && ch != '\t') {
- break;
- }
- if (ch == 'z') {
- zcount ++;
- } else if (ch > 'u') {
- break;
- }
- pos ++;
- }
- if (pos == 0) {
- return 0;
- }
- if (zcount > UINT_MAX / 4) {
- return (FX_DWORD) - 1;
- }
- if (zcount * 4 > UINT_MAX - (pos - zcount)) {
- return (FX_DWORD) - 1;
- }
- dest_buf = FX_Alloc(FX_BYTE, zcount * 4 + (pos - zcount));
- if (dest_buf == NULL) {
- return (FX_DWORD) - 1;
- }
- int state = 0, res = 0;
- pos = dest_size = 0;
- while (pos < src_size) {
- FX_BYTE ch = src_buf[pos++];
- if (ch == '\n' || ch == '\r' || ch == ' ' || ch == '\t') {
- continue;
- }
- if (ch == 'z') {
- FXSYS_memset32(dest_buf + dest_size, 0, 4);
- state = 0;
- res = 0;
- dest_size += 4;
- } else {
- if (ch < '!' || ch > 'u') {
- break;
- }
- res = res * 85 + ch - 33;
- state ++;
- if (state == 5) {
- for (int i = 0; i < 4; i ++) {
- dest_buf[dest_size++] = (FX_BYTE)(res >> (3 - i) * 8);
- }
- state = 0;
- res = 0;
- }
- }
- }
- if (state) {
- int i;
- for (i = state; i < 5; i ++) {
- res = res * 85 + 84;
- }
- for (i = 0; i < state - 1; i ++) {
- dest_buf[dest_size++] = (FX_BYTE)(res >> (3 - i) * 8);
- }
- }
- if (pos < src_size && src_buf[pos] == '>') {
- pos ++;
- }
- return pos;
-}
-FX_DWORD _HexDecode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size)
-{
- FX_DWORD orig_size = dest_size;
- FX_DWORD i;
- for (i = 0; i < src_size; i ++)
- if (src_buf[i] == '>') {
- break;
- }
- dest_buf = FX_Alloc( FX_BYTE, i / 2 + 1);
- dest_size = 0;
- FX_BOOL bFirstDigit = TRUE;
- for (i = 0; i < src_size; i ++) {
- FX_BYTE ch = src_buf[i];
- if (ch == ' ' || ch == '\n' || ch == '\t' || ch == '\r') {
- continue;
- }
- int digit;
- if (ch <= '9' && ch >= '0') {
- digit = ch - '0';
- } else if (ch <= 'f' && ch >= 'a') {
- digit = ch - 'a' + 10;
- } else if (ch <= 'F' && ch >= 'A') {
- digit = ch - 'A' + 10;
- } else if (ch == '>') {
- i ++;
- break;
- } else {
- continue;
- }
- if (bFirstDigit) {
- dest_buf[dest_size] = digit * 16;
- } else {
- dest_buf[dest_size ++] += digit;
- }
- bFirstDigit = !bFirstDigit;
- }
- if (!bFirstDigit) {
- dest_size ++;
- }
- return i;
-}
-FX_DWORD RunLengthDecode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size)
-{
- FX_DWORD orig_size = dest_size;
- FX_DWORD i = 0;
- FX_DWORD old;
- dest_size = 0;
- while (i < src_size) {
- if (src_buf[i] < 128) {
- old = dest_size;
- dest_size += src_buf[i] + 1;
- if (dest_size < old) {
- return (FX_DWORD) - 1;
- }
- i += src_buf[i] + 2;
- } else if (src_buf[i] > 128) {
- old = dest_size;
- dest_size += 257 - src_buf[i];
- if (dest_size < old) {
- return (FX_DWORD) - 1;
- }
- i += 2;
- } else {
- break;
- }
- }
- if (dest_size >= _STREAM_MAX_SIZE_) {
- return -1;
- }
- dest_buf = FX_Alloc( FX_BYTE, dest_size);
- if (!dest_buf) {
- return -1;
- }
- i = 0;
- int dest_count = 0;
- while (i < src_size) {
- if (src_buf[i] < 128) {
- FX_DWORD copy_len = src_buf[i] + 1;
- FX_DWORD buf_left = src_size - i - 1;
- if (buf_left < copy_len) {
- FX_DWORD delta = copy_len - buf_left;
- copy_len = buf_left;
- FXSYS_memset8(dest_buf + dest_count + copy_len, '\0', delta);
- }
- FXSYS_memcpy32(dest_buf + dest_count, src_buf + i + 1, copy_len);
- dest_count += src_buf[i] + 1;
- i += src_buf[i] + 2;
- } else if (src_buf[i] > 128) {
- int fill = 0;
- if (i < src_size - 1) {
- fill = src_buf[i + 1];
- }
- FXSYS_memset8(dest_buf + dest_count, fill, 257 - src_buf[i]);
- dest_count += 257 - src_buf[i];
- i += 2;
- } else {
- break;
- }
- }
- FX_DWORD ret = i + 1;
- if (ret > src_size) {
- ret = src_size;
- }
- return ret;
-}
-ICodec_ScanlineDecoder* FPDFAPI_CreateFaxDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height,
- const CPDF_Dictionary* pParams)
-{
- int K = 0;
- FX_BOOL EndOfLine = FALSE;
- FX_BOOL ByteAlign = FALSE;
- FX_BOOL BlackIs1 = FALSE;
- FX_BOOL Columns = 1728;
- FX_BOOL Rows = 0;
- if (pParams) {
- K = pParams->GetInteger(FX_BSTRC("K"));
- EndOfLine = pParams->GetInteger(FX_BSTRC("EndOfLine"));
- ByteAlign = pParams->GetInteger(FX_BSTRC("EncodedByteAlign"));
- BlackIs1 = pParams->GetInteger(FX_BSTRC("BlackIs1"));
- Columns = pParams->GetInteger(FX_BSTRC("Columns"), 1728);
- Rows = pParams->GetInteger(FX_BSTRC("Rows"));
- if (Rows > USHRT_MAX) {
- Rows = 0;
- }
- if (Columns <= 0 || Rows < 0 || Columns > USHRT_MAX || Rows > USHRT_MAX) {
- return NULL;
- }
- }
- return CPDF_ModuleMgr::Get()->GetFaxModule()->CreateDecoder(src_buf, src_size, width, height,
- K, EndOfLine, ByteAlign, BlackIs1, Columns, Rows);
-}
-static FX_BOOL CheckFlateDecodeParams(int Colors, int BitsPerComponent, int Columns)
-{
- if (Columns < 0) {
- return FALSE;
- }
- int check = Columns;
- if (Colors < 0 || (check > 0 && Colors > INT_MAX / check)) {
- return FALSE;
- }
- check *= Colors;
- if (BitsPerComponent < 0 ||
- (check > 0 && BitsPerComponent > INT_MAX / check)) {
- return FALSE;
- }
- check *= BitsPerComponent;
- if (check > INT_MAX - 7) {
- return FALSE;
- }
- return TRUE;
-}
-ICodec_ScanlineDecoder* FPDFAPI_CreateFlateDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height,
- int nComps, int bpc, const CPDF_Dictionary* pParams)
-{
- int predictor = 0;
- FX_BOOL bEarlyChange = TRUE;
- int Colors = 0, BitsPerComponent = 0, Columns = 0;
- if (pParams) {
- predictor = ((CPDF_Dictionary*)pParams)->GetInteger(FX_BSTRC("Predictor"));
- bEarlyChange = ((CPDF_Dictionary*)pParams)->GetInteger(FX_BSTRC("EarlyChange"), 1);
- Colors = pParams->GetInteger(FX_BSTRC("Colors"), 1);
- BitsPerComponent = pParams->GetInteger(FX_BSTRC("BitsPerComponent"), 8);
- Columns = pParams->GetInteger(FX_BSTRC("Columns"), 1);
- if (!CheckFlateDecodeParams(Colors, BitsPerComponent, Columns)) {
- return NULL;
- }
- }
- return CPDF_ModuleMgr::Get()->GetFlateModule()->CreateDecoder(src_buf, src_size, width, height,
- nComps, bpc, predictor, Colors, BitsPerComponent, Columns);
-}
-FX_DWORD FPDFAPI_FlateOrLZWDecode(FX_BOOL bLZW, const FX_BYTE* src_buf, FX_DWORD src_size, CPDF_Dictionary* pParams,
- FX_DWORD estimated_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size)
-{
- int predictor = 0;
- FX_BOOL bEarlyChange = TRUE;
- int Colors = 0, BitsPerComponent = 0, Columns = 0;
- if (pParams) {
- predictor = ((CPDF_Dictionary*)pParams)->GetInteger(FX_BSTRC("Predictor"));
- bEarlyChange = ((CPDF_Dictionary*)pParams)->GetInteger(FX_BSTRC("EarlyChange"), 1);
- Colors = pParams->GetInteger(FX_BSTRC("Colors"), 1);
- BitsPerComponent = pParams->GetInteger(FX_BSTRC("BitsPerComponent"), 8);
- Columns = pParams->GetInteger(FX_BSTRC("Columns"), 1);
- if (!CheckFlateDecodeParams(Colors, BitsPerComponent, Columns)) {
- return (FX_DWORD) - 1;
- }
- }
- return CPDF_ModuleMgr::Get()->GetFlateModule()->FlateOrLZWDecode(bLZW, src_buf, src_size,
- bEarlyChange, predictor, Colors, BitsPerComponent, Columns, estimated_size,
- dest_buf, dest_size);
-}
-FX_BOOL PDF_DataDecode(FX_LPCBYTE src_buf, FX_DWORD src_size, const CPDF_Dictionary* pDict,
- FX_LPBYTE& dest_buf, FX_DWORD& dest_size, CFX_ByteString& ImageEncoding,
- CPDF_Dictionary*& pImageParms, FX_DWORD last_estimated_size, FX_BOOL bImageAcc)
-
-{
- CPDF_Object* pDecoder = pDict->GetElementValue(FX_BSTRC("Filter"));
- if (pDecoder == NULL || (pDecoder->GetType() != PDFOBJ_ARRAY && pDecoder->GetType() != PDFOBJ_NAME)) {
- return FALSE;
- }
- CPDF_Object* pParams = pDict->GetElementValue(FX_BSTRC("DecodeParms"));
- CFX_ByteStringArray DecoderList;
- CFX_PtrArray ParamList;
- if (pDecoder->GetType() == PDFOBJ_ARRAY) {
- if (pParams && pParams->GetType() != PDFOBJ_ARRAY) {
- pParams = NULL;
- }
- CPDF_Array* pDecoders = (CPDF_Array*)pDecoder;
- for (FX_DWORD i = 0; i < pDecoders->GetCount(); i ++) {
- CFX_ByteStringC str = pDecoders->GetConstString(i);
- DecoderList.Add(str);
- if (pParams) {
- ParamList.Add(((CPDF_Array*)pParams)->GetDict(i));
- } else {
- ParamList.Add(NULL);
- }
- }
- } else {
- DecoderList.Add(pDecoder->GetConstString());
- ParamList.Add(pParams->GetDict());
- }
- FX_LPBYTE last_buf = (FX_LPBYTE)src_buf;
- FX_DWORD last_size = src_size;
- for (int i = 0; i < DecoderList.GetSize(); i ++) {
- int estimated_size = i == DecoderList.GetSize() - 1 ? last_estimated_size : 0;
- CFX_ByteString decoder = DecoderList[i];
- CPDF_Dictionary* pParam = (CPDF_Dictionary*)ParamList[i];
- FX_LPBYTE new_buf = NULL;
- FX_DWORD new_size = (FX_DWORD) - 1;
- int offset = -1;
- if (decoder == FX_BSTRC("FlateDecode") || decoder == FX_BSTRC("Fl")) {
- if (bImageAcc && i == DecoderList.GetSize() - 1) {
- ImageEncoding = FX_BSTRC("FlateDecode");
- dest_buf = (FX_LPBYTE)last_buf;
- dest_size = last_size;
- pImageParms = pParam;
- return TRUE;
- } else {
- offset = FPDFAPI_FlateOrLZWDecode(FALSE, last_buf, last_size, pParam, estimated_size, new_buf, new_size);
- }
- } else if (decoder == FX_BSTRC("LZWDecode") || decoder == FX_BSTRC("LZW")) {
- offset = FPDFAPI_FlateOrLZWDecode(TRUE, last_buf, last_size, pParam, estimated_size, new_buf, new_size);
- } else if (decoder == FX_BSTRC("ASCII85Decode") || decoder == FX_BSTRC("A85")) {
- offset = _A85Decode(last_buf, last_size, new_buf, new_size);
- } else if (decoder == FX_BSTRC("ASCIIHexDecode") || decoder == FX_BSTRC("AHx")) {
- offset = _HexDecode(last_buf, last_size, new_buf, new_size);
- } else if (decoder == FX_BSTRC("RunLengthDecode") || decoder == FX_BSTRC("RL")) {
- if (bImageAcc && i == DecoderList.GetSize() - 1) {
- ImageEncoding = FX_BSTRC("RunLengthDecode");
- dest_buf = (FX_LPBYTE)last_buf;
- dest_size = last_size;
- pImageParms = pParam;
- return TRUE;
- }
- offset = RunLengthDecode(last_buf, last_size, new_buf, new_size);
- } else {
- if (decoder == FX_BSTRC("DCT")) {
- decoder = "DCTDecode";
- } else if (decoder == FX_BSTRC("CCF")) {
- decoder = "CCITTFaxDecode";
- } else if (decoder == FX_BSTRC("Crypt")) {
- continue;
- }
- ImageEncoding = decoder;
- pImageParms = pParam;
- dest_buf = (FX_LPBYTE)last_buf;
- dest_size = last_size;
- return TRUE;
- }
- if (last_buf != src_buf) {
- FX_Free(last_buf);
- }
- if (offset == -1) {
- return FALSE;
- }
- last_buf = new_buf;
- last_size = new_size;
- }
- ImageEncoding = "";
- pImageParms = NULL;
- dest_buf = last_buf;
- dest_size = last_size;
- return TRUE;
-}
-extern const FX_WORD PDFDocEncoding[256] = {
- 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009,
- 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, 0x0010, 0x0011, 0x0012, 0x0013,
- 0x0014, 0x0015, 0x0016, 0x0017, 0x02d8, 0x02c7, 0x02c6, 0x02d9, 0x02dd, 0x02db,
- 0x02da, 0x02dc, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027,
- 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, 0x0030, 0x0031,
- 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b,
- 0x003c, 0x003d, 0x003e, 0x003f, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045,
- 0x0046, 0x0047, 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f,
- 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059,
- 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, 0x0060, 0x0061, 0x0062, 0x0063,
- 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d,
- 0x006e, 0x006f, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077,
- 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x0000, 0x2022, 0x2020,
- 0x2021, 0x2026, 0x2014, 0x2013, 0x0192, 0x2044, 0x2039, 0x203a, 0x2212, 0x2030,
- 0x201e, 0x201c, 0x201d, 0x2018, 0x2019, 0x201a, 0x2122, 0xfb01, 0xfb02, 0x0141,
- 0x0152, 0x0160, 0x0178, 0x017d, 0x0131, 0x0142, 0x0153, 0x0161, 0x017e, 0x0000,
- 0x20ac, 0x00a1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, 0x00a8, 0x00a9,
- 0x00aa, 0x00ab, 0x00ac, 0x0000, 0x00ae, 0x00af, 0x00b0, 0x00b1, 0x00b2, 0x00b3,
- 0x00b4, 0x00b5, 0x00b6, 0x00b7, 0x00b8, 0x00b9, 0x00ba, 0x00bb, 0x00bc, 0x00bd,
- 0x00be, 0x00bf, 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7,
- 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, 0x00d0, 0x00d1,
- 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00d7, 0x00d8, 0x00d9, 0x00da, 0x00db,
- 0x00dc, 0x00dd, 0x00de, 0x00df, 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5,
- 0x00e6, 0x00e7, 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef,
- 0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7, 0x00f8, 0x00f9,
- 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00ff
-};
-CFX_WideString PDF_DecodeText(FX_LPCBYTE src_data, FX_DWORD src_len, CFX_CharMap* pCharMap)
-{
- CFX_WideString result;
- if (src_len >= 2 && ((src_data[0] == 0xfe && src_data[1] == 0xff) || (src_data[0] == 0xff && src_data[1] == 0xfe))) {
- FX_BOOL bBE = src_data[0] == 0xfe;
- int max_chars = (src_len - 2) / 2;
- if (!max_chars) {
- return result;
- }
- if (src_data[0] == 0xff) {
- bBE = !src_data[2];
- }
- FX_LPWSTR dest_buf = result.GetBuffer(max_chars);
- FX_LPCBYTE uni_str = src_data + 2;
- int dest_pos = 0;
- for (int i = 0; i < max_chars * 2; i += 2) {
- FX_WORD unicode = bBE ? (uni_str[i] << 8 | uni_str[i + 1]) : (uni_str[i + 1] << 8 | uni_str[i]);
- if (unicode == 0x1b) {
- i += 2;
- while (i < max_chars * 2) {
- FX_WORD unicode = bBE ? (uni_str[i] << 8 | uni_str[i + 1]) : (uni_str[i + 1] << 8 | uni_str[i]);
- i += 2;
- if (unicode == 0x1b) {
- break;
- }
- }
- } else {
- dest_buf[dest_pos++] = unicode;
- }
- }
- result.ReleaseBuffer(dest_pos);
- } else if (pCharMap == NULL) {
- FX_LPWSTR dest_buf = result.GetBuffer(src_len);
- for (FX_DWORD i = 0; i < src_len; i ++) {
- dest_buf[i] = PDFDocEncoding[src_data[i]];
- }
- result.ReleaseBuffer(src_len);
- } else {
- return (*pCharMap->m_GetWideString)(pCharMap, CFX_ByteString((FX_LPCSTR)src_data, src_len));
- }
- return result;
-}
-CFX_WideString PDF_DecodeText(const CFX_ByteString& bstr, CFX_CharMap* pCharMap)
-{
- return PDF_DecodeText((FX_LPCBYTE)(FX_LPCSTR)bstr, bstr.GetLength(), pCharMap);
-}
-CFX_ByteString PDF_EncodeText(FX_LPCWSTR pString, int len, CFX_CharMap* pCharMap)
-{
- if (len == -1) {
- len = (FX_STRSIZE)FXSYS_wcslen(pString);
- }
- CFX_ByteString result;
- if (pCharMap == NULL) {
- FX_LPSTR dest_buf1 = result.GetBuffer(len);
- int i;
- for (i = 0; i < len; i ++) {
- int code;
- for (code = 0; code < 256; code ++)
- if (PDFDocEncoding[code] == pString[i]) {
- break;
- }
- if (code == 256) {
- break;
- }
- dest_buf1[i] = code;
- }
- result.ReleaseBuffer(i);
- if (i == len) {
- return result;
- }
- }
- FX_LPBYTE dest_buf2 = (FX_LPBYTE)result.GetBuffer(len * 2 + 2);
- dest_buf2[0] = 0xfe;
- dest_buf2[1] = 0xff;
- dest_buf2 += 2;
- for (int i = 0; i < len; i ++) {
- *dest_buf2++ = pString[i] >> 8;
- *dest_buf2++ = (FX_BYTE)pString[i];
- }
- result.ReleaseBuffer(len * 2 + 2);
- return result;
-}
-CFX_ByteString PDF_EncodeString(const CFX_ByteString& src, FX_BOOL bHex)
-{
- CFX_ByteTextBuf result;
- int srclen = src.GetLength();
- if (bHex) {
- result.AppendChar('<');
- for (int i = 0; i < srclen; i ++) {
- result.AppendChar("0123456789ABCDEF"[src[i] / 16]);
- result.AppendChar("0123456789ABCDEF"[src[i] % 16]);
- }
- result.AppendChar('>');
- return result.GetByteString();
- }
- result.AppendChar('(');
- for (int i = 0; i < srclen; i ++) {
- FX_BYTE ch = src[i];
- if (ch == ')' || ch == '\\' || ch == '(') {
- result.AppendChar('\\');
- } else if (ch == 0x0a) {
- result << FX_BSTRC("\\n");
- continue;
- } else if (ch == 0x0d) {
- result << FX_BSTRC("\\r");
- continue;
- }
- result.AppendChar(ch);
- }
- result.AppendChar(')');
- return result.GetByteString();
-}
-void FlateEncode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size)
-{
- CCodec_ModuleMgr* pEncoders = CPDF_ModuleMgr::Get()->GetCodecModule();
- if (pEncoders) {
- pEncoders->GetFlateModule()->Encode(src_buf, src_size, dest_buf, dest_size);
- }
-}
-void FlateEncode(FX_LPCBYTE src_buf, FX_DWORD src_size, int predictor, int Colors, int BitsPerComponent, int Columns,
- FX_LPBYTE& dest_buf, FX_DWORD& dest_size)
-{
- CCodec_ModuleMgr* pEncoders = CPDF_ModuleMgr::Get()->GetCodecModule();
- if (pEncoders) {
- pEncoders->GetFlateModule()->Encode(src_buf, src_size, predictor, Colors, BitsPerComponent, Columns, dest_buf, dest_size);
- }
-}
-FX_DWORD FlateDecode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size)
-{
- CCodec_ModuleMgr* pEncoders = CPDF_ModuleMgr::Get()->GetCodecModule();
- if (pEncoders) {
- return pEncoders->GetFlateModule()->FlateOrLZWDecode(FALSE, src_buf, src_size, FALSE, 0, 0, 0, 0, 0, dest_buf, dest_size);
- }
- return 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
+
+#include "../../../include/fpdfapi/fpdf_parser.h"
+#include "../../../include/fpdfapi/fpdf_module.h"
+#include "../../../include/fxcodec/fx_codec.h"
+#include <limits.h>
+#define _STREAM_MAX_SIZE_ 20 * 1024 * 1024
+FX_DWORD _A85Decode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size)
+{
+ dest_size = 0;
+ dest_buf = NULL;
+ if (src_size == 0) {
+ return 0;
+ }
+ FX_DWORD orig_size = dest_size;
+ FX_DWORD zcount = 0;
+ FX_DWORD pos = 0;
+ while (pos < src_size) {
+ FX_BYTE ch = src_buf[pos];
+ if (ch < '!' && ch != '\n' && ch != '\r' && ch != ' ' && ch != '\t') {
+ break;
+ }
+ if (ch == 'z') {
+ zcount ++;
+ } else if (ch > 'u') {
+ break;
+ }
+ pos ++;
+ }
+ if (pos == 0) {
+ return 0;
+ }
+ if (zcount > UINT_MAX / 4) {
+ return (FX_DWORD) - 1;
+ }
+ if (zcount * 4 > UINT_MAX - (pos - zcount)) {
+ return (FX_DWORD) - 1;
+ }
+ dest_buf = FX_Alloc(FX_BYTE, zcount * 4 + (pos - zcount));
+ if (dest_buf == NULL) {
+ return (FX_DWORD) - 1;
+ }
+ int state = 0, res = 0;
+ pos = dest_size = 0;
+ while (pos < src_size) {
+ FX_BYTE ch = src_buf[pos++];
+ if (ch == '\n' || ch == '\r' || ch == ' ' || ch == '\t') {
+ continue;
+ }
+ if (ch == 'z') {
+ FXSYS_memset32(dest_buf + dest_size, 0, 4);
+ state = 0;
+ res = 0;
+ dest_size += 4;
+ } else {
+ if (ch < '!' || ch > 'u') {
+ break;
+ }
+ res = res * 85 + ch - 33;
+ state ++;
+ if (state == 5) {
+ for (int i = 0; i < 4; i ++) {
+ dest_buf[dest_size++] = (FX_BYTE)(res >> (3 - i) * 8);
+ }
+ state = 0;
+ res = 0;
+ }
+ }
+ }
+ if (state) {
+ int i;
+ for (i = state; i < 5; i ++) {
+ res = res * 85 + 84;
+ }
+ for (i = 0; i < state - 1; i ++) {
+ dest_buf[dest_size++] = (FX_BYTE)(res >> (3 - i) * 8);
+ }
+ }
+ if (pos < src_size && src_buf[pos] == '>') {
+ pos ++;
+ }
+ return pos;
+}
+FX_DWORD _HexDecode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size)
+{
+ FX_DWORD orig_size = dest_size;
+ FX_DWORD i;
+ for (i = 0; i < src_size; i ++)
+ if (src_buf[i] == '>') {
+ break;
+ }
+ dest_buf = FX_Alloc( FX_BYTE, i / 2 + 1);
+ dest_size = 0;
+ FX_BOOL bFirstDigit = TRUE;
+ for (i = 0; i < src_size; i ++) {
+ FX_BYTE ch = src_buf[i];
+ if (ch == ' ' || ch == '\n' || ch == '\t' || ch == '\r') {
+ continue;
+ }
+ int digit;
+ if (ch <= '9' && ch >= '0') {
+ digit = ch - '0';
+ } else if (ch <= 'f' && ch >= 'a') {
+ digit = ch - 'a' + 10;
+ } else if (ch <= 'F' && ch >= 'A') {
+ digit = ch - 'A' + 10;
+ } else if (ch == '>') {
+ i ++;
+ break;
+ } else {
+ continue;
+ }
+ if (bFirstDigit) {
+ dest_buf[dest_size] = digit * 16;
+ } else {
+ dest_buf[dest_size ++] += digit;
+ }
+ bFirstDigit = !bFirstDigit;
+ }
+ if (!bFirstDigit) {
+ dest_size ++;
+ }
+ return i;
+}
+FX_DWORD RunLengthDecode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size)
+{
+ FX_DWORD orig_size = dest_size;
+ FX_DWORD i = 0;
+ FX_DWORD old;
+ dest_size = 0;
+ while (i < src_size) {
+ if (src_buf[i] < 128) {
+ old = dest_size;
+ dest_size += src_buf[i] + 1;
+ if (dest_size < old) {
+ return (FX_DWORD) - 1;
+ }
+ i += src_buf[i] + 2;
+ } else if (src_buf[i] > 128) {
+ old = dest_size;
+ dest_size += 257 - src_buf[i];
+ if (dest_size < old) {
+ return (FX_DWORD) - 1;
+ }
+ i += 2;
+ } else {
+ break;
+ }
+ }
+ if (dest_size >= _STREAM_MAX_SIZE_) {
+ return -1;
+ }
+ dest_buf = FX_Alloc( FX_BYTE, dest_size);
+ if (!dest_buf) {
+ return -1;
+ }
+ i = 0;
+ int dest_count = 0;
+ while (i < src_size) {
+ if (src_buf[i] < 128) {
+ FX_DWORD copy_len = src_buf[i] + 1;
+ FX_DWORD buf_left = src_size - i - 1;
+ if (buf_left < copy_len) {
+ FX_DWORD delta = copy_len - buf_left;
+ copy_len = buf_left;
+ FXSYS_memset8(dest_buf + dest_count + copy_len, '\0', delta);
+ }
+ FXSYS_memcpy32(dest_buf + dest_count, src_buf + i + 1, copy_len);
+ dest_count += src_buf[i] + 1;
+ i += src_buf[i] + 2;
+ } else if (src_buf[i] > 128) {
+ int fill = 0;
+ if (i < src_size - 1) {
+ fill = src_buf[i + 1];
+ }
+ FXSYS_memset8(dest_buf + dest_count, fill, 257 - src_buf[i]);
+ dest_count += 257 - src_buf[i];
+ i += 2;
+ } else {
+ break;
+ }
+ }
+ FX_DWORD ret = i + 1;
+ if (ret > src_size) {
+ ret = src_size;
+ }
+ return ret;
+}
+ICodec_ScanlineDecoder* FPDFAPI_CreateFaxDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height,
+ const CPDF_Dictionary* pParams)
+{
+ int K = 0;
+ FX_BOOL EndOfLine = FALSE;
+ FX_BOOL ByteAlign = FALSE;
+ FX_BOOL BlackIs1 = FALSE;
+ FX_BOOL Columns = 1728;
+ FX_BOOL Rows = 0;
+ if (pParams) {
+ K = pParams->GetInteger(FX_BSTRC("K"));
+ EndOfLine = pParams->GetInteger(FX_BSTRC("EndOfLine"));
+ ByteAlign = pParams->GetInteger(FX_BSTRC("EncodedByteAlign"));
+ BlackIs1 = pParams->GetInteger(FX_BSTRC("BlackIs1"));
+ Columns = pParams->GetInteger(FX_BSTRC("Columns"), 1728);
+ Rows = pParams->GetInteger(FX_BSTRC("Rows"));
+ if (Rows > USHRT_MAX) {
+ Rows = 0;
+ }
+ if (Columns <= 0 || Rows < 0 || Columns > USHRT_MAX || Rows > USHRT_MAX) {
+ return NULL;
+ }
+ }
+ return CPDF_ModuleMgr::Get()->GetFaxModule()->CreateDecoder(src_buf, src_size, width, height,
+ K, EndOfLine, ByteAlign, BlackIs1, Columns, Rows);
+}
+static FX_BOOL CheckFlateDecodeParams(int Colors, int BitsPerComponent, int Columns)
+{
+ if (Columns < 0) {
+ return FALSE;
+ }
+ int check = Columns;
+ if (Colors < 0 || (check > 0 && Colors > INT_MAX / check)) {
+ return FALSE;
+ }
+ check *= Colors;
+ if (BitsPerComponent < 0 ||
+ (check > 0 && BitsPerComponent > INT_MAX / check)) {
+ return FALSE;
+ }
+ check *= BitsPerComponent;
+ if (check > INT_MAX - 7) {
+ return FALSE;
+ }
+ return TRUE;
+}
+ICodec_ScanlineDecoder* FPDFAPI_CreateFlateDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height,
+ int nComps, int bpc, const CPDF_Dictionary* pParams)
+{
+ int predictor = 0;
+ FX_BOOL bEarlyChange = TRUE;
+ int Colors = 0, BitsPerComponent = 0, Columns = 0;
+ if (pParams) {
+ predictor = ((CPDF_Dictionary*)pParams)->GetInteger(FX_BSTRC("Predictor"));
+ bEarlyChange = ((CPDF_Dictionary*)pParams)->GetInteger(FX_BSTRC("EarlyChange"), 1);
+ Colors = pParams->GetInteger(FX_BSTRC("Colors"), 1);
+ BitsPerComponent = pParams->GetInteger(FX_BSTRC("BitsPerComponent"), 8);
+ Columns = pParams->GetInteger(FX_BSTRC("Columns"), 1);
+ if (!CheckFlateDecodeParams(Colors, BitsPerComponent, Columns)) {
+ return NULL;
+ }
+ }
+ return CPDF_ModuleMgr::Get()->GetFlateModule()->CreateDecoder(src_buf, src_size, width, height,
+ nComps, bpc, predictor, Colors, BitsPerComponent, Columns);
+}
+FX_DWORD FPDFAPI_FlateOrLZWDecode(FX_BOOL bLZW, const FX_BYTE* src_buf, FX_DWORD src_size, CPDF_Dictionary* pParams,
+ FX_DWORD estimated_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size)
+{
+ int predictor = 0;
+ FX_BOOL bEarlyChange = TRUE;
+ int Colors = 0, BitsPerComponent = 0, Columns = 0;
+ if (pParams) {
+ predictor = ((CPDF_Dictionary*)pParams)->GetInteger(FX_BSTRC("Predictor"));
+ bEarlyChange = ((CPDF_Dictionary*)pParams)->GetInteger(FX_BSTRC("EarlyChange"), 1);
+ Colors = pParams->GetInteger(FX_BSTRC("Colors"), 1);
+ BitsPerComponent = pParams->GetInteger(FX_BSTRC("BitsPerComponent"), 8);
+ Columns = pParams->GetInteger(FX_BSTRC("Columns"), 1);
+ if (!CheckFlateDecodeParams(Colors, BitsPerComponent, Columns)) {
+ return (FX_DWORD) - 1;
+ }
+ }
+ return CPDF_ModuleMgr::Get()->GetFlateModule()->FlateOrLZWDecode(bLZW, src_buf, src_size,
+ bEarlyChange, predictor, Colors, BitsPerComponent, Columns, estimated_size,
+ dest_buf, dest_size);
+}
+FX_BOOL PDF_DataDecode(FX_LPCBYTE src_buf, FX_DWORD src_size, const CPDF_Dictionary* pDict,
+ FX_LPBYTE& dest_buf, FX_DWORD& dest_size, CFX_ByteString& ImageEncoding,
+ CPDF_Dictionary*& pImageParms, FX_DWORD last_estimated_size, FX_BOOL bImageAcc)
+
+{
+ CPDF_Object* pDecoder = pDict->GetElementValue(FX_BSTRC("Filter"));
+ if (pDecoder == NULL || (pDecoder->GetType() != PDFOBJ_ARRAY && pDecoder->GetType() != PDFOBJ_NAME)) {
+ return FALSE;
+ }
+ CPDF_Object* pParams = pDict->GetElementValue(FX_BSTRC("DecodeParms"));
+ CFX_ByteStringArray DecoderList;
+ CFX_PtrArray ParamList;
+ if (pDecoder->GetType() == PDFOBJ_ARRAY) {
+ if (pParams && pParams->GetType() != PDFOBJ_ARRAY) {
+ pParams = NULL;
+ }
+ CPDF_Array* pDecoders = (CPDF_Array*)pDecoder;
+ for (FX_DWORD i = 0; i < pDecoders->GetCount(); i ++) {
+ CFX_ByteStringC str = pDecoders->GetConstString(i);
+ DecoderList.Add(str);
+ if (pParams) {
+ ParamList.Add(((CPDF_Array*)pParams)->GetDict(i));
+ } else {
+ ParamList.Add(NULL);
+ }
+ }
+ } else {
+ DecoderList.Add(pDecoder->GetConstString());
+ ParamList.Add(pParams->GetDict());
+ }
+ FX_LPBYTE last_buf = (FX_LPBYTE)src_buf;
+ FX_DWORD last_size = src_size;
+ for (int i = 0; i < DecoderList.GetSize(); i ++) {
+ int estimated_size = i == DecoderList.GetSize() - 1 ? last_estimated_size : 0;
+ CFX_ByteString decoder = DecoderList[i];
+ CPDF_Dictionary* pParam = (CPDF_Dictionary*)ParamList[i];
+ FX_LPBYTE new_buf = NULL;
+ FX_DWORD new_size = (FX_DWORD) - 1;
+ int offset = -1;
+ if (decoder == FX_BSTRC("FlateDecode") || decoder == FX_BSTRC("Fl")) {
+ if (bImageAcc && i == DecoderList.GetSize() - 1) {
+ ImageEncoding = FX_BSTRC("FlateDecode");
+ dest_buf = (FX_LPBYTE)last_buf;
+ dest_size = last_size;
+ pImageParms = pParam;
+ return TRUE;
+ } else {
+ offset = FPDFAPI_FlateOrLZWDecode(FALSE, last_buf, last_size, pParam, estimated_size, new_buf, new_size);
+ }
+ } else if (decoder == FX_BSTRC("LZWDecode") || decoder == FX_BSTRC("LZW")) {
+ offset = FPDFAPI_FlateOrLZWDecode(TRUE, last_buf, last_size, pParam, estimated_size, new_buf, new_size);
+ } else if (decoder == FX_BSTRC("ASCII85Decode") || decoder == FX_BSTRC("A85")) {
+ offset = _A85Decode(last_buf, last_size, new_buf, new_size);
+ } else if (decoder == FX_BSTRC("ASCIIHexDecode") || decoder == FX_BSTRC("AHx")) {
+ offset = _HexDecode(last_buf, last_size, new_buf, new_size);
+ } else if (decoder == FX_BSTRC("RunLengthDecode") || decoder == FX_BSTRC("RL")) {
+ if (bImageAcc && i == DecoderList.GetSize() - 1) {
+ ImageEncoding = FX_BSTRC("RunLengthDecode");
+ dest_buf = (FX_LPBYTE)last_buf;
+ dest_size = last_size;
+ pImageParms = pParam;
+ return TRUE;
+ }
+ offset = RunLengthDecode(last_buf, last_size, new_buf, new_size);
+ } else {
+ if (decoder == FX_BSTRC("DCT")) {
+ decoder = "DCTDecode";
+ } else if (decoder == FX_BSTRC("CCF")) {
+ decoder = "CCITTFaxDecode";
+ } else if (decoder == FX_BSTRC("Crypt")) {
+ continue;
+ }
+ ImageEncoding = decoder;
+ pImageParms = pParam;
+ dest_buf = (FX_LPBYTE)last_buf;
+ dest_size = last_size;
+ return TRUE;
+ }
+ if (last_buf != src_buf) {
+ FX_Free(last_buf);
+ }
+ if (offset == -1) {
+ return FALSE;
+ }
+ last_buf = new_buf;
+ last_size = new_size;
+ }
+ ImageEncoding = "";
+ pImageParms = NULL;
+ dest_buf = last_buf;
+ dest_size = last_size;
+ return TRUE;
+}
+extern const FX_WORD PDFDocEncoding[256] = {
+ 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009,
+ 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, 0x0010, 0x0011, 0x0012, 0x0013,
+ 0x0014, 0x0015, 0x0016, 0x0017, 0x02d8, 0x02c7, 0x02c6, 0x02d9, 0x02dd, 0x02db,
+ 0x02da, 0x02dc, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027,
+ 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, 0x0030, 0x0031,
+ 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b,
+ 0x003c, 0x003d, 0x003e, 0x003f, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045,
+ 0x0046, 0x0047, 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f,
+ 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059,
+ 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, 0x0060, 0x0061, 0x0062, 0x0063,
+ 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d,
+ 0x006e, 0x006f, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077,
+ 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x0000, 0x2022, 0x2020,
+ 0x2021, 0x2026, 0x2014, 0x2013, 0x0192, 0x2044, 0x2039, 0x203a, 0x2212, 0x2030,
+ 0x201e, 0x201c, 0x201d, 0x2018, 0x2019, 0x201a, 0x2122, 0xfb01, 0xfb02, 0x0141,
+ 0x0152, 0x0160, 0x0178, 0x017d, 0x0131, 0x0142, 0x0153, 0x0161, 0x017e, 0x0000,
+ 0x20ac, 0x00a1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, 0x00a8, 0x00a9,
+ 0x00aa, 0x00ab, 0x00ac, 0x0000, 0x00ae, 0x00af, 0x00b0, 0x00b1, 0x00b2, 0x00b3,
+ 0x00b4, 0x00b5, 0x00b6, 0x00b7, 0x00b8, 0x00b9, 0x00ba, 0x00bb, 0x00bc, 0x00bd,
+ 0x00be, 0x00bf, 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7,
+ 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, 0x00d0, 0x00d1,
+ 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00d7, 0x00d8, 0x00d9, 0x00da, 0x00db,
+ 0x00dc, 0x00dd, 0x00de, 0x00df, 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5,
+ 0x00e6, 0x00e7, 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef,
+ 0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7, 0x00f8, 0x00f9,
+ 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00ff
+};
+CFX_WideString PDF_DecodeText(FX_LPCBYTE src_data, FX_DWORD src_len, CFX_CharMap* pCharMap)
+{
+ CFX_WideString result;
+ if (src_len >= 2 && ((src_data[0] == 0xfe && src_data[1] == 0xff) || (src_data[0] == 0xff && src_data[1] == 0xfe))) {
+ FX_BOOL bBE = src_data[0] == 0xfe;
+ int max_chars = (src_len - 2) / 2;
+ if (!max_chars) {
+ return result;
+ }
+ if (src_data[0] == 0xff) {
+ bBE = !src_data[2];
+ }
+ FX_LPWSTR dest_buf = result.GetBuffer(max_chars);
+ FX_LPCBYTE uni_str = src_data + 2;
+ int dest_pos = 0;
+ for (int i = 0; i < max_chars * 2; i += 2) {
+ FX_WORD unicode = bBE ? (uni_str[i] << 8 | uni_str[i + 1]) : (uni_str[i + 1] << 8 | uni_str[i]);
+ if (unicode == 0x1b) {
+ i += 2;
+ while (i < max_chars * 2) {
+ FX_WORD unicode = bBE ? (uni_str[i] << 8 | uni_str[i + 1]) : (uni_str[i + 1] << 8 | uni_str[i]);
+ i += 2;
+ if (unicode == 0x1b) {
+ break;
+ }
+ }
+ } else {
+ dest_buf[dest_pos++] = unicode;
+ }
+ }
+ result.ReleaseBuffer(dest_pos);
+ } else if (pCharMap == NULL) {
+ FX_LPWSTR dest_buf = result.GetBuffer(src_len);
+ for (FX_DWORD i = 0; i < src_len; i ++) {
+ dest_buf[i] = PDFDocEncoding[src_data[i]];
+ }
+ result.ReleaseBuffer(src_len);
+ } else {
+ return (*pCharMap->m_GetWideString)(pCharMap, CFX_ByteString((FX_LPCSTR)src_data, src_len));
+ }
+ return result;
+}
+CFX_WideString PDF_DecodeText(const CFX_ByteString& bstr, CFX_CharMap* pCharMap)
+{
+ return PDF_DecodeText((FX_LPCBYTE)(FX_LPCSTR)bstr, bstr.GetLength(), pCharMap);
+}
+CFX_ByteString PDF_EncodeText(FX_LPCWSTR pString, int len, CFX_CharMap* pCharMap)
+{
+ if (len == -1) {
+ len = (FX_STRSIZE)FXSYS_wcslen(pString);
+ }
+ CFX_ByteString result;
+ if (pCharMap == NULL) {
+ FX_LPSTR dest_buf1 = result.GetBuffer(len);
+ int i;
+ for (i = 0; i < len; i ++) {
+ int code;
+ for (code = 0; code < 256; code ++)
+ if (PDFDocEncoding[code] == pString[i]) {
+ break;
+ }
+ if (code == 256) {
+ break;
+ }
+ dest_buf1[i] = code;
+ }
+ result.ReleaseBuffer(i);
+ if (i == len) {
+ return result;
+ }
+ }
+ FX_LPBYTE dest_buf2 = (FX_LPBYTE)result.GetBuffer(len * 2 + 2);
+ dest_buf2[0] = 0xfe;
+ dest_buf2[1] = 0xff;
+ dest_buf2 += 2;
+ for (int i = 0; i < len; i ++) {
+ *dest_buf2++ = pString[i] >> 8;
+ *dest_buf2++ = (FX_BYTE)pString[i];
+ }
+ result.ReleaseBuffer(len * 2 + 2);
+ return result;
+}
+CFX_ByteString PDF_EncodeString(const CFX_ByteString& src, FX_BOOL bHex)
+{
+ CFX_ByteTextBuf result;
+ int srclen = src.GetLength();
+ if (bHex) {
+ result.AppendChar('<');
+ for (int i = 0; i < srclen; i ++) {
+ result.AppendChar("0123456789ABCDEF"[src[i] / 16]);
+ result.AppendChar("0123456789ABCDEF"[src[i] % 16]);
+ }
+ result.AppendChar('>');
+ return result.GetByteString();
+ }
+ result.AppendChar('(');
+ for (int i = 0; i < srclen; i ++) {
+ FX_BYTE ch = src[i];
+ if (ch == ')' || ch == '\\' || ch == '(') {
+ result.AppendChar('\\');
+ } else if (ch == 0x0a) {
+ result << FX_BSTRC("\\n");
+ continue;
+ } else if (ch == 0x0d) {
+ result << FX_BSTRC("\\r");
+ continue;
+ }
+ result.AppendChar(ch);
+ }
+ result.AppendChar(')');
+ return result.GetByteString();
+}
+void FlateEncode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size)
+{
+ CCodec_ModuleMgr* pEncoders = CPDF_ModuleMgr::Get()->GetCodecModule();
+ if (pEncoders) {
+ pEncoders->GetFlateModule()->Encode(src_buf, src_size, dest_buf, dest_size);
+ }
+}
+void FlateEncode(FX_LPCBYTE src_buf, FX_DWORD src_size, int predictor, int Colors, int BitsPerComponent, int Columns,
+ FX_LPBYTE& dest_buf, FX_DWORD& dest_size)
+{
+ CCodec_ModuleMgr* pEncoders = CPDF_ModuleMgr::Get()->GetCodecModule();
+ if (pEncoders) {
+ pEncoders->GetFlateModule()->Encode(src_buf, src_size, predictor, Colors, BitsPerComponent, Columns, dest_buf, dest_size);
+ }
+}
+FX_DWORD FlateDecode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size)
+{
+ CCodec_ModuleMgr* pEncoders = CPDF_ModuleMgr::Get()->GetCodecModule();
+ if (pEncoders) {
+ return pEncoders->GetFlateModule()->FlateOrLZWDecode(FALSE, src_buf, src_size, FALSE, 0, 0, 0, 0, 0, dest_buf, dest_size);
+ }
+ return 0;
+}
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_document.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_document.cpp
index 068a60679a..a4982040bf 100644
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_document.cpp
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_document.cpp
@@ -1,398 +1,398 @@
-// 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
-
-#include "../../../include/fpdfapi/fpdf_parser.h"
-#include "../../../include/fpdfapi/fpdf_module.h"
-extern FX_LPVOID PDFPreviewInitCache(CPDF_Document* pDoc);
-extern void PDFPreviewClearCache(FX_LPVOID pCache);
-CPDF_Document::CPDF_Document(IPDF_DocParser* pParser) : CPDF_IndirectObjects(pParser)
-{
- ASSERT(pParser != NULL);
- m_pRootDict = NULL;
- m_pInfoDict = NULL;
- m_bLinearized = FALSE;
- m_dwFirstPageNo = 0;
- m_dwFirstPageObjNum = 0;
- m_pDocPage = CPDF_ModuleMgr::Get()->GetPageModule()->CreateDocData(this);
- m_pDocRender = CPDF_ModuleMgr::Get()->GetRenderModule()->CreateDocData(this);
-}
-CPDF_DocPageData* CPDF_Document::GetValidatePageData()
-{
- if (m_pDocPage) {
- return m_pDocPage;
- }
- m_pDocPage = CPDF_ModuleMgr::Get()->GetPageModule()->CreateDocData(this);
- return m_pDocPage;
-}
-CPDF_DocRenderData* CPDF_Document::GetValidateRenderData()
-{
- if (m_pDocRender) {
- return m_pDocRender;
- }
- m_pDocRender = CPDF_ModuleMgr::Get()->GetRenderModule()->CreateDocData(this);
- return m_pDocRender;
-}
-void CPDF_Document::LoadDoc()
-{
- m_LastObjNum = m_pParser->GetLastObjNum();
- CPDF_Object* pRootObj = GetIndirectObject(m_pParser->GetRootObjNum());
- if (pRootObj == NULL) {
- return;
- }
- m_pRootDict = pRootObj->GetDict();
- if (m_pRootDict == NULL) {
- return;
- }
- CPDF_Object* pInfoObj = GetIndirectObject(m_pParser->GetInfoObjNum());
- if (pInfoObj) {
- m_pInfoDict = pInfoObj->GetDict();
- }
- CPDF_Array* pIDArray = m_pParser->GetIDArray();
- if (pIDArray) {
- m_ID1 = pIDArray->GetString(0);
- m_ID2 = pIDArray->GetString(1);
- }
- m_PageList.SetSize(_GetPageCount());
-}
-void CPDF_Document::LoadAsynDoc(CPDF_Dictionary *pLinearized)
-{
- m_bLinearized = TRUE;
- m_LastObjNum = m_pParser->GetLastObjNum();
- m_pRootDict = GetIndirectObject(m_pParser->GetRootObjNum())->GetDict();
- if (m_pRootDict == NULL) {
- return;
- }
- m_pInfoDict = GetIndirectObject(m_pParser->GetInfoObjNum())->GetDict();
- CPDF_Array* pIDArray = m_pParser->GetIDArray();
- if (pIDArray) {
- m_ID1 = pIDArray->GetString(0);
- m_ID2 = pIDArray->GetString(1);
- }
- FX_DWORD dwPageCount = 0;
- CPDF_Object *pCount = pLinearized->GetElement(FX_BSTRC("N"));
- if (pCount && pCount->GetType() == PDFOBJ_NUMBER) {
- dwPageCount = pCount->GetInteger();
- }
- m_PageList.SetSize(dwPageCount);
- CPDF_Object *pNo = pLinearized->GetElement(FX_BSTRC("P"));
- if (pNo && pNo->GetType() == PDFOBJ_NUMBER) {
- m_dwFirstPageNo = pNo->GetInteger();
- }
- CPDF_Object *pObjNum = pLinearized->GetElement(FX_BSTRC("O"));
- if (pObjNum && pObjNum->GetType() == PDFOBJ_NUMBER) {
- m_dwFirstPageObjNum = pObjNum->GetInteger();
- }
-}
-void CPDF_Document::LoadPages()
-{
- m_PageList.SetSize(_GetPageCount());
-}
-extern void FPDF_TTFaceMapper_ReleaseDoc(CPDF_Document*);
-CPDF_Document::~CPDF_Document()
-{
- if (m_pDocRender) {
- CPDF_ModuleMgr::Get()->GetRenderModule()->DestroyDocData(m_pDocRender);
- }
- if (m_pDocPage) {
- CPDF_ModuleMgr::Get()->GetPageModule()->ReleaseDoc(this);
- CPDF_ModuleMgr::Get()->GetPageModule()->ClearStockFont(this);
- }
-}
-#define FX_MAX_PAGE_LEVEL 1024
-CPDF_Dictionary* CPDF_Document::_FindPDFPage(CPDF_Dictionary* pPages, int iPage, int nPagesToGo, int level)
-{
- CPDF_Array* pKidList = pPages->GetArray(FX_BSTRC("Kids"));
- if (pKidList == NULL) {
- if (nPagesToGo == 0) {
- return pPages;
- }
- return NULL;
- }
- if (level >= FX_MAX_PAGE_LEVEL) {
- return NULL;
- }
- int nKids = pKidList->GetCount();
- for (int i = 0; i < nKids; i ++) {
- CPDF_Dictionary* pKid = pKidList->GetDict(i);
- if (pKid == NULL) {
- nPagesToGo --;
- continue;
- }
- if (pKid == pPages) {
- continue;
- }
- if (!pKid->KeyExist(FX_BSTRC("Kids"))) {
- if (nPagesToGo == 0) {
- return pKid;
- }
- m_PageList.SetAt(iPage - nPagesToGo, pKid->GetObjNum());
- nPagesToGo --;
- } else {
- int nPages = pKid->GetInteger(FX_BSTRC("Count"));
- if (nPagesToGo < nPages) {
- return _FindPDFPage(pKid, iPage, nPagesToGo, level + 1);
- }
- nPagesToGo -= nPages;
- }
- }
- return NULL;
-}
-CPDF_Dictionary* CPDF_Document::GetPage(int iPage)
-{
- if (iPage < 0 || iPage >= m_PageList.GetSize()) {
- return NULL;
- }
- if (m_bLinearized && (iPage == (int)m_dwFirstPageNo)) {
- CPDF_Object* pObj = GetIndirectObject(m_dwFirstPageObjNum);
- if (pObj && pObj->GetType() == PDFOBJ_DICTIONARY) {
- return (CPDF_Dictionary*)pObj;
- }
- }
- int objnum = m_PageList.GetAt(iPage);
- if (objnum) {
- CPDF_Object* pObj = GetIndirectObject(objnum);
- ASSERT(pObj->GetType() == PDFOBJ_DICTIONARY);
- return (CPDF_Dictionary*)pObj;
- }
- CPDF_Dictionary* pRoot = GetRoot();
- if (pRoot == NULL) {
- return NULL;
- }
- CPDF_Dictionary* pPages = pRoot->GetDict(FX_BSTRC("Pages"));
- if (pPages == NULL) {
- return NULL;
- }
- CPDF_Dictionary* pPage = _FindPDFPage(pPages, iPage, iPage, 0);
- if (pPage == NULL) {
- return NULL;
- }
- m_PageList.SetAt(iPage, pPage->GetObjNum());
- return pPage;
-}
-int CPDF_Document::_FindPageIndex(CPDF_Dictionary* pNode, FX_DWORD& skip_count, FX_DWORD objnum, int& index, int level)
-{
- if (pNode->KeyExist(FX_BSTRC("Kids"))) {
- CPDF_Array* pKidList = pNode->GetArray(FX_BSTRC("Kids"));
- if (pKidList == NULL) {
- return -1;
- }
- if (level >= FX_MAX_PAGE_LEVEL) {
- return -1;
- }
- FX_DWORD count = pNode->GetInteger(FX_BSTRC("Count"));
- if (count <= skip_count) {
- skip_count -= count;
- index += count;
- return -1;
- }
- if (count && count == pKidList->GetCount()) {
- for (FX_DWORD i = 0; i < count; i ++) {
- CPDF_Reference* pKid = (CPDF_Reference*)pKidList->GetElement(i);
- if (pKid && pKid->GetType() == PDFOBJ_REFERENCE) {
- if (pKid->GetRefObjNum() == objnum) {
- m_PageList.SetAt(index + i, objnum);
- return index + i;
- }
- }
- }
- }
- for (FX_DWORD i = 0; i < pKidList->GetCount(); i ++) {
- CPDF_Dictionary* pKid = pKidList->GetDict(i);
- if (pKid == NULL) {
- continue;
- }
- if (pKid == pNode) {
- continue;
- }
- int found_index = _FindPageIndex(pKid, skip_count, objnum, index, level + 1);
- if (found_index >= 0) {
- return found_index;
- }
- }
- } else {
- if (objnum == pNode->GetObjNum()) {
- return index;
- }
- if (skip_count) {
- skip_count--;
- }
- index ++;
- }
- return -1;
-}
-int CPDF_Document::GetPageIndex(FX_DWORD objnum)
-{
- FX_DWORD nPages = m_PageList.GetSize();
- FX_DWORD skip_count = 0;
- FX_BOOL bSkipped = FALSE;
- for (FX_DWORD i = 0; i < nPages; i ++) {
- FX_DWORD objnum1 = m_PageList.GetAt(i);
- if (objnum1 == objnum) {
- return i;
- }
- if (!bSkipped && objnum1 == 0) {
- skip_count = i;
- bSkipped = TRUE;
- }
- }
- CPDF_Dictionary* pRoot = GetRoot();
- if (pRoot == NULL) {
- return -1;
- }
- CPDF_Dictionary* pPages = pRoot->GetDict(FX_BSTRC("Pages"));
- if (pPages == NULL) {
- return -1;
- }
- int index = 0;
- return _FindPageIndex(pPages, skip_count, objnum, index);
-}
-int CPDF_Document::GetPageCount() const
-{
- return m_PageList.GetSize();
-}
-static int _CountPages(CPDF_Dictionary* pPages, int level)
-{
- if (level > 128) {
- return 0;
- }
- int count = pPages->GetInteger(FX_BSTRC("Count"));
- if (count > 0 && count < FPDF_PAGE_MAX_NUM) {
- return count;
- }
- CPDF_Array* pKidList = pPages->GetArray(FX_BSTRC("Kids"));
- if (pKidList == NULL) {
- return 0;
- }
- count = 0;
- for (FX_DWORD i = 0; i < pKidList->GetCount(); i ++) {
- CPDF_Dictionary* pKid = pKidList->GetDict(i);
- if (pKid == NULL) {
- continue;
- }
- if (!pKid->KeyExist(FX_BSTRC("Kids"))) {
- count ++;
- } else {
- count += _CountPages(pKid, level + 1);
- }
- }
- pPages->SetAtInteger(FX_BSTRC("Count"), count);
- return count;
-}
-int CPDF_Document::_GetPageCount() const
-{
- CPDF_Dictionary* pRoot = GetRoot();
- if (pRoot == NULL) {
- return 0;
- }
- CPDF_Dictionary* pPages = pRoot->GetDict(FX_BSTRC("Pages"));
- if (pPages == NULL) {
- return 0;
- }
- if (!pPages->KeyExist(FX_BSTRC("Kids"))) {
- return 1;
- }
- return _CountPages(pPages, 0);
-}
-static FX_BOOL _EnumPages(CPDF_Dictionary* pPages, IPDF_EnumPageHandler* pHandler)
-{
- CPDF_Array* pKidList = pPages->GetArray(FX_BSTRC("Kids"));
- if (pKidList == NULL) {
- return pHandler->EnumPage(pPages);
- }
- for (FX_DWORD i = 0; i < pKidList->GetCount(); i ++) {
- CPDF_Dictionary* pKid = pKidList->GetDict(i);
- if (pKid == NULL) {
- continue;
- }
- if (!pKid->KeyExist(FX_BSTRC("Kids"))) {
- if (!pHandler->EnumPage(pKid)) {
- return FALSE;
- }
- } else {
- return _EnumPages(pKid, pHandler);
- }
- }
- return TRUE;
-}
-void CPDF_Document::EnumPages(IPDF_EnumPageHandler* pHandler)
-{
- CPDF_Dictionary* pRoot = GetRoot();
- if (pRoot == NULL) {
- return;
- }
- CPDF_Dictionary* pPages = pRoot->GetDict(FX_BSTRC("Pages"));
- if (pPages == NULL) {
- return;
- }
- _EnumPages(pPages, pHandler);
-}
-FX_BOOL CPDF_Document::IsContentUsedElsewhere(FX_DWORD objnum, CPDF_Dictionary* pThisPageDict)
-{
- for (int i = 0; i < m_PageList.GetSize(); i ++) {
- CPDF_Dictionary* pPageDict = GetPage(i);
- if (pPageDict == pThisPageDict) {
- continue;
- }
- CPDF_Object* pContents = pPageDict->GetElement(FX_BSTRC("Contents"));
- if (pContents == NULL) {
- continue;
- }
- if (pContents->GetDirectType() == PDFOBJ_ARRAY) {
- CPDF_Array* pArray = (CPDF_Array*)pContents->GetDirect();
- for (FX_DWORD j = 0; j < pArray->GetCount(); j ++) {
- CPDF_Reference* pRef = (CPDF_Reference*)pArray->GetElement(j);
- if (pRef->GetRefObjNum() == objnum) {
- return TRUE;
- }
- }
- } else if (pContents->GetObjNum() == objnum) {
- return TRUE;
- }
- }
- return FALSE;
-}
-FX_DWORD CPDF_Document::GetUserPermissions(FX_BOOL bCheckRevision) const
-{
- if (m_pParser == NULL) {
- return (FX_DWORD) - 1;
- }
- return m_pParser->GetPermissions(bCheckRevision);
-}
-FX_BOOL CPDF_Document::IsOwner() const
-{
- if (m_pParser == NULL) {
- return TRUE;
- }
- return m_pParser->IsOwner();
-}
-FX_BOOL CPDF_Document::IsFormStream(FX_DWORD objnum, FX_BOOL& bForm) const
-{
- {
- CPDF_Object* pObj;
- if (m_IndirectObjs.Lookup((FX_LPVOID)(FX_UINTPTR)objnum, (FX_LPVOID&)pObj)) {
- bForm = pObj->GetType() == PDFOBJ_STREAM &&
- ((CPDF_Stream*)pObj)->GetDict()->GetString(FX_BSTRC("Subtype")) == FX_BSTRC("Form");
- return TRUE;
- }
- }
- if (m_pParser == NULL) {
- bForm = FALSE;
- return TRUE;
- }
- return m_pParser->IsFormStream(objnum, bForm);
-}
-void CPDF_Document::ClearPageData()
-{
- if (m_pDocPage) {
- CPDF_ModuleMgr::Get()->GetPageModule()->ClearDoc(this);
- }
-}
-void CPDF_Document::ClearRenderData()
-{
- if (m_pDocRender) {
- CPDF_ModuleMgr::Get()->GetRenderModule()->ClearDocData(m_pDocRender);
- }
-}
+// 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
+
+#include "../../../include/fpdfapi/fpdf_parser.h"
+#include "../../../include/fpdfapi/fpdf_module.h"
+extern FX_LPVOID PDFPreviewInitCache(CPDF_Document* pDoc);
+extern void PDFPreviewClearCache(FX_LPVOID pCache);
+CPDF_Document::CPDF_Document(IPDF_DocParser* pParser) : CPDF_IndirectObjects(pParser)
+{
+ ASSERT(pParser != NULL);
+ m_pRootDict = NULL;
+ m_pInfoDict = NULL;
+ m_bLinearized = FALSE;
+ m_dwFirstPageNo = 0;
+ m_dwFirstPageObjNum = 0;
+ m_pDocPage = CPDF_ModuleMgr::Get()->GetPageModule()->CreateDocData(this);
+ m_pDocRender = CPDF_ModuleMgr::Get()->GetRenderModule()->CreateDocData(this);
+}
+CPDF_DocPageData* CPDF_Document::GetValidatePageData()
+{
+ if (m_pDocPage) {
+ return m_pDocPage;
+ }
+ m_pDocPage = CPDF_ModuleMgr::Get()->GetPageModule()->CreateDocData(this);
+ return m_pDocPage;
+}
+CPDF_DocRenderData* CPDF_Document::GetValidateRenderData()
+{
+ if (m_pDocRender) {
+ return m_pDocRender;
+ }
+ m_pDocRender = CPDF_ModuleMgr::Get()->GetRenderModule()->CreateDocData(this);
+ return m_pDocRender;
+}
+void CPDF_Document::LoadDoc()
+{
+ m_LastObjNum = m_pParser->GetLastObjNum();
+ CPDF_Object* pRootObj = GetIndirectObject(m_pParser->GetRootObjNum());
+ if (pRootObj == NULL) {
+ return;
+ }
+ m_pRootDict = pRootObj->GetDict();
+ if (m_pRootDict == NULL) {
+ return;
+ }
+ CPDF_Object* pInfoObj = GetIndirectObject(m_pParser->GetInfoObjNum());
+ if (pInfoObj) {
+ m_pInfoDict = pInfoObj->GetDict();
+ }
+ CPDF_Array* pIDArray = m_pParser->GetIDArray();
+ if (pIDArray) {
+ m_ID1 = pIDArray->GetString(0);
+ m_ID2 = pIDArray->GetString(1);
+ }
+ m_PageList.SetSize(_GetPageCount());
+}
+void CPDF_Document::LoadAsynDoc(CPDF_Dictionary *pLinearized)
+{
+ m_bLinearized = TRUE;
+ m_LastObjNum = m_pParser->GetLastObjNum();
+ m_pRootDict = GetIndirectObject(m_pParser->GetRootObjNum())->GetDict();
+ if (m_pRootDict == NULL) {
+ return;
+ }
+ m_pInfoDict = GetIndirectObject(m_pParser->GetInfoObjNum())->GetDict();
+ CPDF_Array* pIDArray = m_pParser->GetIDArray();
+ if (pIDArray) {
+ m_ID1 = pIDArray->GetString(0);
+ m_ID2 = pIDArray->GetString(1);
+ }
+ FX_DWORD dwPageCount = 0;
+ CPDF_Object *pCount = pLinearized->GetElement(FX_BSTRC("N"));
+ if (pCount && pCount->GetType() == PDFOBJ_NUMBER) {
+ dwPageCount = pCount->GetInteger();
+ }
+ m_PageList.SetSize(dwPageCount);
+ CPDF_Object *pNo = pLinearized->GetElement(FX_BSTRC("P"));
+ if (pNo && pNo->GetType() == PDFOBJ_NUMBER) {
+ m_dwFirstPageNo = pNo->GetInteger();
+ }
+ CPDF_Object *pObjNum = pLinearized->GetElement(FX_BSTRC("O"));
+ if (pObjNum && pObjNum->GetType() == PDFOBJ_NUMBER) {
+ m_dwFirstPageObjNum = pObjNum->GetInteger();
+ }
+}
+void CPDF_Document::LoadPages()
+{
+ m_PageList.SetSize(_GetPageCount());
+}
+extern void FPDF_TTFaceMapper_ReleaseDoc(CPDF_Document*);
+CPDF_Document::~CPDF_Document()
+{
+ if (m_pDocRender) {
+ CPDF_ModuleMgr::Get()->GetRenderModule()->DestroyDocData(m_pDocRender);
+ }
+ if (m_pDocPage) {
+ CPDF_ModuleMgr::Get()->GetPageModule()->ReleaseDoc(this);
+ CPDF_ModuleMgr::Get()->GetPageModule()->ClearStockFont(this);
+ }
+}
+#define FX_MAX_PAGE_LEVEL 1024
+CPDF_Dictionary* CPDF_Document::_FindPDFPage(CPDF_Dictionary* pPages, int iPage, int nPagesToGo, int level)
+{
+ CPDF_Array* pKidList = pPages->GetArray(FX_BSTRC("Kids"));
+ if (pKidList == NULL) {
+ if (nPagesToGo == 0) {
+ return pPages;
+ }
+ return NULL;
+ }
+ if (level >= FX_MAX_PAGE_LEVEL) {
+ return NULL;
+ }
+ int nKids = pKidList->GetCount();
+ for (int i = 0; i < nKids; i ++) {
+ CPDF_Dictionary* pKid = pKidList->GetDict(i);
+ if (pKid == NULL) {
+ nPagesToGo --;
+ continue;
+ }
+ if (pKid == pPages) {
+ continue;
+ }
+ if (!pKid->KeyExist(FX_BSTRC("Kids"))) {
+ if (nPagesToGo == 0) {
+ return pKid;
+ }
+ m_PageList.SetAt(iPage - nPagesToGo, pKid->GetObjNum());
+ nPagesToGo --;
+ } else {
+ int nPages = pKid->GetInteger(FX_BSTRC("Count"));
+ if (nPagesToGo < nPages) {
+ return _FindPDFPage(pKid, iPage, nPagesToGo, level + 1);
+ }
+ nPagesToGo -= nPages;
+ }
+ }
+ return NULL;
+}
+CPDF_Dictionary* CPDF_Document::GetPage(int iPage)
+{
+ if (iPage < 0 || iPage >= m_PageList.GetSize()) {
+ return NULL;
+ }
+ if (m_bLinearized && (iPage == (int)m_dwFirstPageNo)) {
+ CPDF_Object* pObj = GetIndirectObject(m_dwFirstPageObjNum);
+ if (pObj && pObj->GetType() == PDFOBJ_DICTIONARY) {
+ return (CPDF_Dictionary*)pObj;
+ }
+ }
+ int objnum = m_PageList.GetAt(iPage);
+ if (objnum) {
+ CPDF_Object* pObj = GetIndirectObject(objnum);
+ ASSERT(pObj->GetType() == PDFOBJ_DICTIONARY);
+ return (CPDF_Dictionary*)pObj;
+ }
+ CPDF_Dictionary* pRoot = GetRoot();
+ if (pRoot == NULL) {
+ return NULL;
+ }
+ CPDF_Dictionary* pPages = pRoot->GetDict(FX_BSTRC("Pages"));
+ if (pPages == NULL) {
+ return NULL;
+ }
+ CPDF_Dictionary* pPage = _FindPDFPage(pPages, iPage, iPage, 0);
+ if (pPage == NULL) {
+ return NULL;
+ }
+ m_PageList.SetAt(iPage, pPage->GetObjNum());
+ return pPage;
+}
+int CPDF_Document::_FindPageIndex(CPDF_Dictionary* pNode, FX_DWORD& skip_count, FX_DWORD objnum, int& index, int level)
+{
+ if (pNode->KeyExist(FX_BSTRC("Kids"))) {
+ CPDF_Array* pKidList = pNode->GetArray(FX_BSTRC("Kids"));
+ if (pKidList == NULL) {
+ return -1;
+ }
+ if (level >= FX_MAX_PAGE_LEVEL) {
+ return -1;
+ }
+ FX_DWORD count = pNode->GetInteger(FX_BSTRC("Count"));
+ if (count <= skip_count) {
+ skip_count -= count;
+ index += count;
+ return -1;
+ }
+ if (count && count == pKidList->GetCount()) {
+ for (FX_DWORD i = 0; i < count; i ++) {
+ CPDF_Reference* pKid = (CPDF_Reference*)pKidList->GetElement(i);
+ if (pKid && pKid->GetType() == PDFOBJ_REFERENCE) {
+ if (pKid->GetRefObjNum() == objnum) {
+ m_PageList.SetAt(index + i, objnum);
+ return index + i;
+ }
+ }
+ }
+ }
+ for (FX_DWORD i = 0; i < pKidList->GetCount(); i ++) {
+ CPDF_Dictionary* pKid = pKidList->GetDict(i);
+ if (pKid == NULL) {
+ continue;
+ }
+ if (pKid == pNode) {
+ continue;
+ }
+ int found_index = _FindPageIndex(pKid, skip_count, objnum, index, level + 1);
+ if (found_index >= 0) {
+ return found_index;
+ }
+ }
+ } else {
+ if (objnum == pNode->GetObjNum()) {
+ return index;
+ }
+ if (skip_count) {
+ skip_count--;
+ }
+ index ++;
+ }
+ return -1;
+}
+int CPDF_Document::GetPageIndex(FX_DWORD objnum)
+{
+ FX_DWORD nPages = m_PageList.GetSize();
+ FX_DWORD skip_count = 0;
+ FX_BOOL bSkipped = FALSE;
+ for (FX_DWORD i = 0; i < nPages; i ++) {
+ FX_DWORD objnum1 = m_PageList.GetAt(i);
+ if (objnum1 == objnum) {
+ return i;
+ }
+ if (!bSkipped && objnum1 == 0) {
+ skip_count = i;
+ bSkipped = TRUE;
+ }
+ }
+ CPDF_Dictionary* pRoot = GetRoot();
+ if (pRoot == NULL) {
+ return -1;
+ }
+ CPDF_Dictionary* pPages = pRoot->GetDict(FX_BSTRC("Pages"));
+ if (pPages == NULL) {
+ return -1;
+ }
+ int index = 0;
+ return _FindPageIndex(pPages, skip_count, objnum, index);
+}
+int CPDF_Document::GetPageCount() const
+{
+ return m_PageList.GetSize();
+}
+static int _CountPages(CPDF_Dictionary* pPages, int level)
+{
+ if (level > 128) {
+ return 0;
+ }
+ int count = pPages->GetInteger(FX_BSTRC("Count"));
+ if (count > 0 && count < FPDF_PAGE_MAX_NUM) {
+ return count;
+ }
+ CPDF_Array* pKidList = pPages->GetArray(FX_BSTRC("Kids"));
+ if (pKidList == NULL) {
+ return 0;
+ }
+ count = 0;
+ for (FX_DWORD i = 0; i < pKidList->GetCount(); i ++) {
+ CPDF_Dictionary* pKid = pKidList->GetDict(i);
+ if (pKid == NULL) {
+ continue;
+ }
+ if (!pKid->KeyExist(FX_BSTRC("Kids"))) {
+ count ++;
+ } else {
+ count += _CountPages(pKid, level + 1);
+ }
+ }
+ pPages->SetAtInteger(FX_BSTRC("Count"), count);
+ return count;
+}
+int CPDF_Document::_GetPageCount() const
+{
+ CPDF_Dictionary* pRoot = GetRoot();
+ if (pRoot == NULL) {
+ return 0;
+ }
+ CPDF_Dictionary* pPages = pRoot->GetDict(FX_BSTRC("Pages"));
+ if (pPages == NULL) {
+ return 0;
+ }
+ if (!pPages->KeyExist(FX_BSTRC("Kids"))) {
+ return 1;
+ }
+ return _CountPages(pPages, 0);
+}
+static FX_BOOL _EnumPages(CPDF_Dictionary* pPages, IPDF_EnumPageHandler* pHandler)
+{
+ CPDF_Array* pKidList = pPages->GetArray(FX_BSTRC("Kids"));
+ if (pKidList == NULL) {
+ return pHandler->EnumPage(pPages);
+ }
+ for (FX_DWORD i = 0; i < pKidList->GetCount(); i ++) {
+ CPDF_Dictionary* pKid = pKidList->GetDict(i);
+ if (pKid == NULL) {
+ continue;
+ }
+ if (!pKid->KeyExist(FX_BSTRC("Kids"))) {
+ if (!pHandler->EnumPage(pKid)) {
+ return FALSE;
+ }
+ } else {
+ return _EnumPages(pKid, pHandler);
+ }
+ }
+ return TRUE;
+}
+void CPDF_Document::EnumPages(IPDF_EnumPageHandler* pHandler)
+{
+ CPDF_Dictionary* pRoot = GetRoot();
+ if (pRoot == NULL) {
+ return;
+ }
+ CPDF_Dictionary* pPages = pRoot->GetDict(FX_BSTRC("Pages"));
+ if (pPages == NULL) {
+ return;
+ }
+ _EnumPages(pPages, pHandler);
+}
+FX_BOOL CPDF_Document::IsContentUsedElsewhere(FX_DWORD objnum, CPDF_Dictionary* pThisPageDict)
+{
+ for (int i = 0; i < m_PageList.GetSize(); i ++) {
+ CPDF_Dictionary* pPageDict = GetPage(i);
+ if (pPageDict == pThisPageDict) {
+ continue;
+ }
+ CPDF_Object* pContents = pPageDict->GetElement(FX_BSTRC("Contents"));
+ if (pContents == NULL) {
+ continue;
+ }
+ if (pContents->GetDirectType() == PDFOBJ_ARRAY) {
+ CPDF_Array* pArray = (CPDF_Array*)pContents->GetDirect();
+ for (FX_DWORD j = 0; j < pArray->GetCount(); j ++) {
+ CPDF_Reference* pRef = (CPDF_Reference*)pArray->GetElement(j);
+ if (pRef->GetRefObjNum() == objnum) {
+ return TRUE;
+ }
+ }
+ } else if (pContents->GetObjNum() == objnum) {
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+FX_DWORD CPDF_Document::GetUserPermissions(FX_BOOL bCheckRevision) const
+{
+ if (m_pParser == NULL) {
+ return (FX_DWORD) - 1;
+ }
+ return m_pParser->GetPermissions(bCheckRevision);
+}
+FX_BOOL CPDF_Document::IsOwner() const
+{
+ if (m_pParser == NULL) {
+ return TRUE;
+ }
+ return m_pParser->IsOwner();
+}
+FX_BOOL CPDF_Document::IsFormStream(FX_DWORD objnum, FX_BOOL& bForm) const
+{
+ {
+ CPDF_Object* pObj;
+ if (m_IndirectObjs.Lookup((FX_LPVOID)(FX_UINTPTR)objnum, (FX_LPVOID&)pObj)) {
+ bForm = pObj->GetType() == PDFOBJ_STREAM &&
+ ((CPDF_Stream*)pObj)->GetDict()->GetString(FX_BSTRC("Subtype")) == FX_BSTRC("Form");
+ return TRUE;
+ }
+ }
+ if (m_pParser == NULL) {
+ bForm = FALSE;
+ return TRUE;
+ }
+ return m_pParser->IsFormStream(objnum, bForm);
+}
+void CPDF_Document::ClearPageData()
+{
+ if (m_pDocPage) {
+ CPDF_ModuleMgr::Get()->GetPageModule()->ClearDoc(this);
+ }
+}
+void CPDF_Document::ClearRenderData()
+{
+ if (m_pDocRender) {
+ CPDF_ModuleMgr::Get()->GetRenderModule()->ClearDocData(m_pDocRender);
+ }
+}
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_encrypt.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_encrypt.cpp
index d1f1a24488..fadcd38b1b 100644
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_encrypt.cpp
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_encrypt.cpp
@@ -1,957 +1,957 @@
-// 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
-
-#include <time.h>
-#include "../../../include/fpdfapi/fpdf_parser.h"
-#include "../../../include/fdrm/fx_crypt.h"
-const FX_BYTE defpasscode[32] = {
- 0x28, 0xbf, 0x4e, 0x5e, 0x4e, 0x75, 0x8a, 0x41,
- 0x64, 0x00, 0x4e, 0x56, 0xff, 0xfa, 0x01, 0x08,
- 0x2e, 0x2e, 0x00, 0xb6, 0xd0, 0x68, 0x3e, 0x80,
- 0x2f, 0x0c, 0xa9, 0xfe, 0x64, 0x53, 0x69, 0x7a
-};
-void CalcEncryptKey(CPDF_Dictionary* pEncrypt, FX_LPCBYTE password, FX_DWORD pass_size,
- FX_LPBYTE key, int keylen, FX_BOOL bIgnoreMeta, CPDF_Array* pIdArray)
-{
- int revision = pEncrypt->GetInteger(FX_BSTRC("R"));
- FX_BYTE passcode[32];
- for (FX_DWORD i = 0; i < 32; i ++) {
- passcode[i] = i < pass_size ? password[i] : defpasscode[i - pass_size];
- }
- FX_BYTE md5[100];
- CRYPT_MD5Start(md5);
- CRYPT_MD5Update(md5, passcode, 32);
- CFX_ByteString okey = pEncrypt->GetString(FX_BSTRC("O"));
- CRYPT_MD5Update(md5, (FX_LPBYTE)(FX_LPCSTR)okey, okey.GetLength());
- FX_DWORD perm = pEncrypt->GetInteger(FX_BSTRC("P"));
- CRYPT_MD5Update(md5, (FX_LPBYTE)&perm, 4);
- if (pIdArray) {
- CFX_ByteString id = pIdArray->GetString(0);
- CRYPT_MD5Update(md5, (FX_LPBYTE)(FX_LPCSTR)id, id.GetLength());
- }
- if (!bIgnoreMeta && revision >= 3 && !pEncrypt->GetInteger(FX_BSTRC("EncryptMetadata"), 1)) {
- FX_DWORD tag = (FX_DWORD) - 1;
- CRYPT_MD5Update(md5, (FX_LPBYTE)&tag, 4);
- }
- FX_BYTE digest[16];
- CRYPT_MD5Finish(md5, digest);
- FX_DWORD copy_len = keylen;
- if (copy_len > sizeof(digest)) {
- copy_len = sizeof(digest);
- }
- if (revision >= 3) {
- for (int i = 0; i < 50; i ++) {
- CRYPT_MD5Generate(digest, copy_len, digest);
- }
- }
- FXSYS_memset32(key, 0, keylen);
- FXSYS_memcpy32(key, digest, copy_len);
-}
-CPDF_CryptoHandler* CPDF_StandardSecurityHandler::CreateCryptoHandler()
-{
- return FX_NEW CPDF_StandardCryptoHandler;
-}
-typedef struct _PDF_CRYPTOITEM : public CFX_Object {
- FX_INT32 m_Cipher;
- FX_INT32 m_KeyLen;
- FX_BOOL m_bChecked;
- CPDF_StandardCryptoHandler* m_pCryptoHandler;
-} PDF_CRYPTOITEM;
-CPDF_StandardSecurityHandler::CPDF_StandardSecurityHandler()
-{
- m_Version = 0;
- m_Revision = 0;
- m_pParser = NULL;
- m_pEncryptDict = NULL;
- m_bOwner = FALSE;
- m_Permissions = 0;
- m_Cipher = FXCIPHER_NONE;
- m_KeyLen = 0;
-}
-CPDF_StandardSecurityHandler::~CPDF_StandardSecurityHandler()
-{
-}
-FX_BOOL CPDF_StandardSecurityHandler::OnInit(CPDF_Parser* pParser, CPDF_Dictionary* pEncryptDict)
-{
- m_pParser = pParser;
- if (!LoadDict(pEncryptDict)) {
- return FALSE;
- }
- if (m_Cipher == FXCIPHER_NONE) {
- return TRUE;
- }
- return CheckSecurity(m_KeyLen);
-}
-FX_BOOL CPDF_StandardSecurityHandler::CheckSecurity(FX_INT32 key_len)
-{
- CFX_ByteString password = m_pParser->GetPassword();
- if (CheckPassword(password, password.GetLength(), TRUE, m_EncryptKey, key_len)) {
- if (password.IsEmpty()) {
- if (!CheckPassword(password, password.GetLength(), FALSE, m_EncryptKey, key_len)) {
- return FALSE;
- }
- }
- m_bOwner = TRUE;
- return TRUE;
- }
- return CheckPassword(password, password.GetLength(), FALSE, m_EncryptKey, key_len);
-}
-FX_DWORD CPDF_StandardSecurityHandler::GetPermissions()
-{
- return m_Permissions;
-}
-static FX_BOOL _LoadCryptInfo(CPDF_Dictionary* pEncryptDict, FX_BSTR name, int& cipher, int& keylen)
-{
- int Version = pEncryptDict->GetInteger(FX_BSTRC("V"));
- int Revision = pEncryptDict->GetInteger(FX_BSTRC("R"));
- cipher = FXCIPHER_RC4;
- keylen = 0;
- if (Version >= 4) {
- CPDF_Dictionary* pCryptFilters = pEncryptDict->GetDict(FX_BSTRC("CF"));
- if (pCryptFilters == NULL) {
- return FALSE;
- }
- if (name == FX_BSTRC("Identity")) {
- cipher = FXCIPHER_NONE;
- } else {
- CPDF_Dictionary* pDefFilter = pCryptFilters->GetDict(name);
- if (pDefFilter == NULL) {
- return FALSE;
- }
- int nKeyBits = 0;
- if (Version == 4) {
- nKeyBits = pDefFilter->GetInteger(FX_BSTRC("Length"), 0);
- if (nKeyBits == 0) {
- nKeyBits = pEncryptDict->GetInteger(FX_BSTRC("Length"), 128);
- }
- } else {
- nKeyBits = pEncryptDict->GetInteger(FX_BSTRC("Length"), 256);
- }
- if (nKeyBits < 40) {
- nKeyBits *= 8;
- }
- keylen = nKeyBits / 8;
- CFX_ByteString cipher_name = pDefFilter->GetString(FX_BSTRC("CFM"));
- if (cipher_name == FX_BSTRC("AESV2") || cipher_name == FX_BSTRC("AESV3")) {
- cipher = FXCIPHER_AES;
- }
- }
- } else {
- keylen = Version > 1 ? pEncryptDict->GetInteger(FX_BSTRC("Length"), 40) / 8 : 5;
- }
- if (keylen > 32 || keylen < 0) {
- return FALSE;
- }
- return TRUE;
-}
-FX_BOOL CPDF_StandardSecurityHandler::LoadDict(CPDF_Dictionary* pEncryptDict)
-{
- m_pEncryptDict = pEncryptDict;
- m_bOwner = FALSE;
- m_Version = pEncryptDict->GetInteger(FX_BSTRC("V"));
- m_Revision = pEncryptDict->GetInteger(FX_BSTRC("R"));
- m_Permissions = pEncryptDict->GetInteger(FX_BSTRC("P"), -1);
- if (m_Version < 4) {
- return _LoadCryptInfo(pEncryptDict, CFX_ByteString(), m_Cipher, m_KeyLen);
- }
- CFX_ByteString stmf_name = pEncryptDict->GetString(FX_BSTRC("StmF"));
- CFX_ByteString strf_name = pEncryptDict->GetString(FX_BSTRC("StrF"));
- if (stmf_name != strf_name) {
- return FALSE;
- }
- if (!_LoadCryptInfo(pEncryptDict, strf_name, m_Cipher, m_KeyLen)) {
- return FALSE;
- }
- return TRUE;
-}
-FX_BOOL CPDF_StandardSecurityHandler::LoadDict(CPDF_Dictionary* pEncryptDict, FX_DWORD type, int& cipher, int& key_len)
-{
- m_pEncryptDict = pEncryptDict;
- m_bOwner = FALSE;
- m_Version = pEncryptDict->GetInteger(FX_BSTRC("V"));
- m_Revision = pEncryptDict->GetInteger(FX_BSTRC("R"));
- m_Permissions = pEncryptDict->GetInteger(FX_BSTRC("P"), -1);
- CFX_ByteString strf_name, stmf_name;
- if (m_Version >= 4) {
- stmf_name = pEncryptDict->GetString(FX_BSTRC("StmF"));
- strf_name = pEncryptDict->GetString(FX_BSTRC("StrF"));
- if (stmf_name != strf_name) {
- return FALSE;
- }
- }
- if (!_LoadCryptInfo(pEncryptDict, strf_name, cipher, key_len)) {
- return FALSE;
- }
- m_Cipher = cipher;
- m_KeyLen = key_len;
- return TRUE;
- return TRUE;
-}
-FX_BOOL CPDF_StandardSecurityHandler::GetCryptInfo(int& cipher, FX_LPCBYTE& buffer, int& keylen)
-{
- cipher = m_Cipher;
- buffer = m_EncryptKey;
- keylen = m_KeyLen;
- return TRUE;
-}
-#define FX_GET_32WORD(n,b,i) \
- { \
- (n) = (FX_DWORD)(( (FX_UINT64) (b)[(i)] << 24 ) \
- | ( (FX_UINT64) (b)[(i) + 1] << 16 ) \
- | ( (FX_UINT64) (b)[(i) + 2] << 8 ) \
- | ( (FX_UINT64) (b)[(i) + 3] )); \
- }
-int BigOrder64BitsMod3(FX_LPBYTE data)
-{
- FX_UINT64 ret = 0;
- for (int i = 0; i < 4; ++i) {
- FX_DWORD value;
- FX_GET_32WORD(value, data, 4 * i);
- ret <<= 32;
- ret |= value;
- ret %= 3;
- }
- return (int)ret;
-}
-void Revision6_Hash(FX_LPCBYTE password, FX_DWORD size, FX_LPCBYTE salt, FX_LPCBYTE vector, FX_LPBYTE hash)
-{
- int iBlockSize = 32;
- FX_BYTE sha[128];
- CRYPT_SHA256Start(sha);
- CRYPT_SHA256Update(sha, password, size);
- CRYPT_SHA256Update(sha, salt, 8);
- if (vector) {
- CRYPT_SHA256Update(sha, vector, 48);
- }
- FX_BYTE digest[32];
- CRYPT_SHA256Finish(sha, digest);
- CFX_ByteTextBuf buf;
- FX_LPBYTE input = digest;
- FX_LPBYTE key = input;
- FX_LPBYTE iv = input + 16;
- FX_LPBYTE E = buf.GetBuffer();
- int iBufLen = buf.GetLength();
- CFX_ByteTextBuf interDigest;
- int i = 0;
- FX_LPBYTE aes = FX_Alloc(FX_BYTE, 2048);
- while (i < 64 || i < E[iBufLen - 1] + 32) {
- int iRoundSize = size + iBlockSize;
- if (vector) {
- iRoundSize += 48;
- }
- iBufLen = iRoundSize * 64;
- buf.EstimateSize(iBufLen);
- E = buf.GetBuffer();
- CFX_ByteTextBuf content;
- for (int j = 0; j < 64; ++j) {
- content.AppendBlock(password, size);
- content.AppendBlock(input, iBlockSize);
- if (vector) {
- content.AppendBlock(vector, 48);
- }
- }
- CRYPT_AESSetKey(aes, 16, key, 16, TRUE);
- CRYPT_AESSetIV(aes, iv);
- CRYPT_AESEncrypt(aes, E, content.GetBuffer(), iBufLen);
- int iHash = 0;
- switch (BigOrder64BitsMod3(E)) {
- case 0:
- iHash = 0;
- iBlockSize = 32;
- break;
- case 1:
- iHash = 1;
- iBlockSize = 48;
- break;
- default:
- iHash = 2;
- iBlockSize = 64;
- break;
- }
- interDigest.EstimateSize(iBlockSize);
- input = interDigest.GetBuffer();
- if (iHash == 0) {
- CRYPT_SHA256Generate(E, iBufLen, input);
- } else if (iHash == 1) {
- CRYPT_SHA384Generate(E, iBufLen, input);
- } else if (iHash == 2) {
- CRYPT_SHA512Generate(E, iBufLen, input);
- }
- key = input;
- iv = input + 16;
- ++i;
- }
- FX_Free(aes);
- if (hash) {
- FXSYS_memcpy32(hash, input, 32);
- }
-}
-FX_BOOL CPDF_StandardSecurityHandler::AES256_CheckPassword(FX_LPCBYTE password, FX_DWORD size,
- FX_BOOL bOwner, FX_LPBYTE key)
-{
- CFX_ByteString okey = m_pEncryptDict->GetString(FX_BSTRC("O"));
- if (okey.GetLength() < 48) {
- return FALSE;
- }
- CFX_ByteString ukey = m_pEncryptDict->GetString(FX_BSTRC("U"));
- if (ukey.GetLength() < 48) {
- return FALSE;
- }
- FX_LPCBYTE pkey = bOwner ? (FX_LPCBYTE)okey : (FX_LPCBYTE)ukey;
- FX_BYTE sha[128];
- FX_BYTE digest[32];
- if (m_Revision >= 6) {
- Revision6_Hash(password, size, (FX_LPCBYTE)pkey + 32, (bOwner ? (FX_LPCBYTE)ukey : NULL), digest);
- } else {
- CRYPT_SHA256Start(sha);
- CRYPT_SHA256Update(sha, password, size);
- CRYPT_SHA256Update(sha, pkey + 32, 8);
- if (bOwner) {
- CRYPT_SHA256Update(sha, ukey, 48);
- }
- CRYPT_SHA256Finish(sha, digest);
- }
- if (FXSYS_memcmp32(digest, pkey, 32) != 0) {
- return FALSE;
- }
- if (key == NULL) {
- return TRUE;
- }
- if (m_Revision >= 6) {
- Revision6_Hash(password, size, (FX_LPCBYTE)pkey + 40, (bOwner ? (FX_LPCBYTE)ukey : NULL), digest);
- } else {
- CRYPT_SHA256Start(sha);
- CRYPT_SHA256Update(sha, password, size);
- CRYPT_SHA256Update(sha, pkey + 40, 8);
- if (bOwner) {
- CRYPT_SHA256Update(sha, ukey, 48);
- }
- CRYPT_SHA256Finish(sha, digest);
- }
- CFX_ByteString ekey = m_pEncryptDict->GetString(bOwner ? FX_BSTRC("OE") : FX_BSTRC("UE"));
- if (ekey.GetLength() < 32) {
- return FALSE;
- }
- FX_BYTE* aes = FX_Alloc(FX_BYTE, 2048);
- CRYPT_AESSetKey(aes, 16, digest, 32, FALSE);
- FX_BYTE iv[16];
- FXSYS_memset32(iv, 0, 16);
- CRYPT_AESSetIV(aes, iv);
- CRYPT_AESDecrypt(aes, key, ekey, 32);
- CRYPT_AESSetKey(aes, 16, key, 32, FALSE);
- CRYPT_AESSetIV(aes, iv);
- CFX_ByteString perms = m_pEncryptDict->GetString(FX_BSTRC("Perms"));
- if (perms.IsEmpty()) {
- return FALSE;
- }
- FX_BYTE perms_buf[16];
- FXSYS_memset32(perms_buf, 0, sizeof(perms_buf));
- FX_DWORD copy_len = sizeof(perms_buf);
- if (copy_len > (FX_DWORD)perms.GetLength()) {
- copy_len = perms.GetLength();
- }
- FXSYS_memcpy32(perms_buf, (FX_LPCBYTE)perms, copy_len);
- FX_BYTE buf[16];
- CRYPT_AESDecrypt(aes, buf, perms_buf, 16);
- FX_Free(aes);
- if (buf[9] != 'a' || buf[10] != 'd' || buf[11] != 'b') {
- return FALSE;
- }
- if (FXDWORD_GET_LSBFIRST(buf) != m_Permissions) {
- return FALSE;
- }
- if ((buf[8] == 'T' && !IsMetadataEncrypted()) || (buf[8] == 'F' && IsMetadataEncrypted())) {
- return FALSE;
- }
- return TRUE;
-}
-int CPDF_StandardSecurityHandler::CheckPassword(FX_LPCBYTE password, FX_DWORD pass_size, FX_BOOL bOwner, FX_LPBYTE key)
-{
- return CheckPassword(password, pass_size, bOwner, key, m_KeyLen);
-}
-int CPDF_StandardSecurityHandler::CheckPassword(FX_LPCBYTE password, FX_DWORD size, FX_BOOL bOwner, FX_LPBYTE key, FX_INT32 key_len)
-{
- if (m_Revision >= 5) {
- return AES256_CheckPassword(password, size, bOwner, key);
- }
- FX_BYTE keybuf[32];
- if (key == NULL) {
- key = keybuf;
- }
- if (bOwner) {
- return CheckOwnerPassword(password, size, key, key_len);
- }
- return CheckUserPassword(password, size, FALSE, key, key_len) || CheckUserPassword(password, size, TRUE, key, key_len);
-}
-FX_BOOL CPDF_StandardSecurityHandler::CheckUserPassword(FX_LPCBYTE password, FX_DWORD pass_size,
- FX_BOOL bIgnoreEncryptMeta, FX_LPBYTE key, FX_INT32 key_len)
-{
- CalcEncryptKey(m_pEncryptDict, password, pass_size, key, key_len, bIgnoreEncryptMeta,
- m_pParser->GetIDArray());
- CFX_ByteString ukey = m_pEncryptDict->GetString(FX_BSTRC("U"));
- if (ukey.GetLength() < 16) {
- return FALSE;
- }
- FX_BYTE ukeybuf[32];
- if (m_Revision == 2) {
- FXSYS_memcpy32(ukeybuf, defpasscode, 32);
- CRYPT_ArcFourCryptBlock(ukeybuf, 32, key, key_len);
- } else {
- FX_BYTE test[32], tmpkey[32];
- FX_DWORD copy_len = sizeof(test);
- if (copy_len > (FX_DWORD)ukey.GetLength()) {
- copy_len = ukey.GetLength();
- }
- FXSYS_memset32(test, 0, sizeof(test));
- FXSYS_memcpy32(test, (FX_LPCSTR)ukey, copy_len);
- for (int i = 19; i >= 0; i --) {
- for (int j = 0; j < key_len; j ++) {
- tmpkey[j] = key[j] ^ i;
- }
- CRYPT_ArcFourCryptBlock(test, 32, tmpkey, key_len);
- }
- FX_BYTE md5[100];
- CRYPT_MD5Start(md5);
- CRYPT_MD5Update(md5, defpasscode, 32);
- CPDF_Array* pIdArray = m_pParser->GetIDArray();
- if (pIdArray) {
- CFX_ByteString id = pIdArray->GetString(0);
- CRYPT_MD5Update(md5, (FX_LPBYTE)(FX_LPCSTR)id, id.GetLength());
- }
- CRYPT_MD5Finish(md5, ukeybuf);
- return FXSYS_memcmp32(test, ukeybuf, 16) == 0;
- }
- if (FXSYS_memcmp32((FX_LPVOID)(FX_LPCSTR)ukey, ukeybuf, 16) == 0) {
- return TRUE;
- }
- return FALSE;
-}
-CFX_ByteString CPDF_StandardSecurityHandler::GetUserPassword(FX_LPCBYTE owner_pass, FX_DWORD pass_size)
-{
- return GetUserPassword(owner_pass, pass_size, m_KeyLen);
-}
-CFX_ByteString CPDF_StandardSecurityHandler::GetUserPassword(FX_LPCBYTE owner_pass, FX_DWORD pass_size, FX_INT32 key_len)
-{
- CFX_ByteString okey = m_pEncryptDict->GetString(FX_BSTRC("O"));
- FX_BYTE passcode[32];
- FX_DWORD i;
- for (i = 0; i < 32; i ++) {
- passcode[i] = i < pass_size ? owner_pass[i] : defpasscode[i - pass_size];
- }
- FX_BYTE digest[16];
- CRYPT_MD5Generate(passcode, 32, digest);
- if (m_Revision >= 3) {
- for (int i = 0; i < 50; i ++) {
- CRYPT_MD5Generate(digest, 16, digest);
- }
- }
- FX_BYTE enckey[32];
- FXSYS_memset32(enckey, 0, sizeof(enckey));
- FX_DWORD copy_len = key_len;
- if (copy_len > sizeof(digest)) {
- copy_len = sizeof(digest);
- }
- FXSYS_memcpy32(enckey, digest, copy_len);
- int okeylen = okey.GetLength();
- if (okeylen > 32) {
- okeylen = 32;
- }
- FX_BYTE okeybuf[64];
- FXSYS_memcpy32(okeybuf, (FX_LPCSTR)okey, okeylen);
- if (m_Revision == 2) {
- CRYPT_ArcFourCryptBlock(okeybuf, okeylen, enckey, key_len);
- } else {
- for (int i = 19; i >= 0; i --) {
- FX_BYTE tempkey[32];
- for (int j = 0; j < m_KeyLen; j ++) {
- tempkey[j] = enckey[j] ^ i;
- }
- CRYPT_ArcFourCryptBlock(okeybuf, okeylen, tempkey, key_len);
- }
- }
- int len = 32;
- while (len && defpasscode[len - 1] == okeybuf[len - 1]) {
- len --;
- }
- return CFX_ByteString(okeybuf, len);
-}
-FX_BOOL CPDF_StandardSecurityHandler::CheckOwnerPassword(FX_LPCBYTE password, FX_DWORD pass_size,
- FX_LPBYTE key, FX_INT32 key_len)
-{
- CFX_ByteString user_pass = GetUserPassword(password, pass_size, key_len);
- if (CheckUserPassword(user_pass, user_pass.GetLength(), FALSE, key, key_len)) {
- return TRUE;
- }
- return CheckUserPassword(user_pass, user_pass.GetLength(), TRUE, key, key_len);
-}
-FX_BOOL CPDF_StandardSecurityHandler::IsMetadataEncrypted()
-{
- return m_pEncryptDict->GetBoolean(FX_BSTRC("EncryptMetadata"), TRUE);
-}
-CPDF_SecurityHandler* FPDF_CreateStandardSecurityHandler()
-{
- return FX_NEW CPDF_StandardSecurityHandler;
-}
-void CPDF_StandardSecurityHandler::OnCreate(CPDF_Dictionary* pEncryptDict, CPDF_Array* pIdArray,
- FX_LPCBYTE user_pass, FX_DWORD user_size,
- FX_LPCBYTE owner_pass, FX_DWORD owner_size, FX_BOOL bDefault, FX_DWORD type)
-{
- int cipher = 0, key_len = 0;
- if (!LoadDict(pEncryptDict, type, cipher, key_len)) {
- return;
- }
- if (bDefault && (owner_pass == NULL || owner_size == 0)) {
- owner_pass = user_pass;
- owner_size = user_size;
- }
- if (m_Revision >= 5) {
- int t = (int)time(NULL);
- FX_BYTE sha[128];
- CRYPT_SHA256Start(sha);
- CRYPT_SHA256Update(sha, (FX_BYTE*)&t, sizeof t);
- CRYPT_SHA256Update(sha, m_EncryptKey, 32);
- CRYPT_SHA256Update(sha, (FX_BYTE*)"there", 5);
- CRYPT_SHA256Finish(sha, m_EncryptKey);
- AES256_SetPassword(pEncryptDict, user_pass, user_size, FALSE, m_EncryptKey);
- if (bDefault) {
- AES256_SetPassword(pEncryptDict, owner_pass, owner_size, TRUE, m_EncryptKey);
- AES256_SetPerms(pEncryptDict, m_Permissions, pEncryptDict->GetBoolean(FX_BSTRC("EncryptMetadata"), TRUE), m_EncryptKey);
- }
- return;
- }
- if (bDefault) {
- FX_BYTE passcode[32];
- FX_DWORD i;
- for (i = 0; i < 32; i ++) {
- passcode[i] = i < owner_size ? owner_pass[i] : defpasscode[i - owner_size];
- }
- FX_BYTE digest[16];
- CRYPT_MD5Generate(passcode, 32, digest);
- if (m_Revision >= 3) {
- for (int i = 0; i < 50; i ++) {
- CRYPT_MD5Generate(digest, 16, digest);
- }
- }
- FX_BYTE enckey[32];
- FXSYS_memcpy32(enckey, digest, key_len);
- for (i = 0; i < 32; i ++) {
- passcode[i] = i < user_size ? user_pass[i] : defpasscode[i - user_size];
- }
- CRYPT_ArcFourCryptBlock(passcode, 32, enckey, key_len);
- FX_BYTE tempkey[32];
- if (m_Revision >= 3) {
- for (i = 1; i <= 19; i ++) {
- for (int j = 0; j < key_len; j ++) {
- tempkey[j] = enckey[j] ^ (FX_BYTE)i;
- }
- CRYPT_ArcFourCryptBlock(passcode, 32, tempkey, key_len);
- }
- }
- pEncryptDict->SetAtString(FX_BSTRC("O"), CFX_ByteString(passcode, 32));
- }
- CalcEncryptKey(m_pEncryptDict, (FX_LPBYTE)user_pass, user_size, m_EncryptKey, key_len, FALSE, pIdArray);
- if (m_Revision < 3) {
- FX_BYTE tempbuf[32];
- FXSYS_memcpy32(tempbuf, defpasscode, 32);
- CRYPT_ArcFourCryptBlock(tempbuf, 32, m_EncryptKey, key_len);
- pEncryptDict->SetAtString(FX_BSTRC("U"), CFX_ByteString(tempbuf, 32));
- } else {
- FX_BYTE md5[100];
- CRYPT_MD5Start(md5);
- CRYPT_MD5Update(md5, defpasscode, 32);
- if (pIdArray) {
- CFX_ByteString id = pIdArray->GetString(0);
- CRYPT_MD5Update(md5, (FX_LPBYTE)(FX_LPCSTR)id, id.GetLength());
- }
- FX_BYTE digest[32];
- CRYPT_MD5Finish(md5, digest);
- CRYPT_ArcFourCryptBlock(digest, 16, m_EncryptKey, key_len);
- FX_BYTE tempkey[32];
- for (int i = 1; i <= 19; i ++) {
- for (int j = 0; j < key_len; j ++) {
- tempkey[j] = m_EncryptKey[j] ^ (FX_BYTE)i;
- }
- CRYPT_ArcFourCryptBlock(digest, 16, tempkey, key_len);
- }
- CRYPT_MD5Generate(digest, 16, digest + 16);
- pEncryptDict->SetAtString(FX_BSTRC("U"), CFX_ByteString(digest, 32));
- }
-}
-void CPDF_StandardSecurityHandler::OnCreate(CPDF_Dictionary* pEncryptDict, CPDF_Array* pIdArray,
- FX_LPCBYTE user_pass, FX_DWORD user_size,
- FX_LPCBYTE owner_pass, FX_DWORD owner_size, FX_DWORD type)
-{
- OnCreate(pEncryptDict, pIdArray, user_pass, user_size, owner_pass, owner_size, TRUE, type);
-}
-void CPDF_StandardSecurityHandler::OnCreate(CPDF_Dictionary* pEncryptDict, CPDF_Array* pIdArray, FX_LPCBYTE user_pass, FX_DWORD user_size, FX_DWORD type)
-{
- OnCreate(pEncryptDict, pIdArray, user_pass, user_size, NULL, 0, FALSE, type);
-}
-void CPDF_StandardSecurityHandler::AES256_SetPassword(CPDF_Dictionary* pEncryptDict, FX_LPCBYTE password, FX_DWORD size, FX_BOOL bOwner, FX_LPCBYTE key)
-{
- FX_BYTE sha[128];
- CRYPT_SHA1Start(sha);
- CRYPT_SHA1Update(sha, key, 32);
- CRYPT_SHA1Update(sha, (FX_BYTE*)"hello", 5);
- FX_BYTE digest[20];
- CRYPT_SHA1Finish(sha, digest);
- CFX_ByteString ukey = pEncryptDict->GetString(FX_BSTRC("U"));
- FX_BYTE digest1[48];
- if (m_Revision >= 6) {
- Revision6_Hash(password, size, digest, (bOwner ? (FX_LPCBYTE)ukey : NULL), digest1);
- } else {
- CRYPT_SHA256Start(sha);
- CRYPT_SHA256Update(sha, password, size);
- CRYPT_SHA256Update(sha, digest, 8);
- if (bOwner) {
- CRYPT_SHA256Update(sha, ukey, ukey.GetLength());
- }
- CRYPT_SHA256Finish(sha, digest1);
- }
- FXSYS_memcpy32(digest1 + 32, digest, 16);
- pEncryptDict->SetAtString(bOwner ? FX_BSTRC("O") : FX_BSTRC("U"), CFX_ByteString(digest1, 48));
- if (m_Revision >= 6) {
- Revision6_Hash(password, size, digest + 8, (bOwner ? (FX_LPCBYTE)ukey : NULL), digest1);
- } else {
- CRYPT_SHA256Start(sha);
- CRYPT_SHA256Update(sha, password, size);
- CRYPT_SHA256Update(sha, digest + 8, 8);
- if (bOwner) {
- CRYPT_SHA256Update(sha, ukey, ukey.GetLength());
- }
- CRYPT_SHA256Finish(sha, digest1);
- }
- FX_BYTE* aes = FX_Alloc(FX_BYTE, 2048);
- CRYPT_AESSetKey(aes, 16, digest1, 32, TRUE);
- FX_BYTE iv[16];
- FXSYS_memset32(iv, 0, 16);
- CRYPT_AESSetIV(aes, iv);
- CRYPT_AESEncrypt(aes, digest1, key, 32);
- FX_Free(aes);
- pEncryptDict->SetAtString(bOwner ? FX_BSTRC("OE") : FX_BSTRC("UE"), CFX_ByteString(digest1, 32));
-}
-void CPDF_StandardSecurityHandler::AES256_SetPerms(CPDF_Dictionary* pEncryptDict, FX_DWORD permissions,
- FX_BOOL bEncryptMetadata, FX_LPCBYTE key)
-{
- FX_BYTE buf[16];
- buf[0] = (FX_BYTE)permissions;
- buf[1] = (FX_BYTE)(permissions >> 8);
- buf[2] = (FX_BYTE)(permissions >> 16);
- buf[3] = (FX_BYTE)(permissions >> 24);
- buf[4] = 0xff;
- buf[5] = 0xff;
- buf[6] = 0xff;
- buf[7] = 0xff;
- buf[8] = bEncryptMetadata ? 'T' : 'F';
- buf[9] = 'a';
- buf[10] = 'd';
- buf[11] = 'b';
- FX_BYTE* aes = FX_Alloc(FX_BYTE, 2048);
- CRYPT_AESSetKey(aes, 16, key, 32, TRUE);
- FX_BYTE iv[16], buf1[16];
- FXSYS_memset32(iv, 0, 16);
- CRYPT_AESSetIV(aes, iv);
- CRYPT_AESEncrypt(aes, buf1, buf, 16);
- FX_Free(aes);
- pEncryptDict->SetAtString(FX_BSTRC("Perms"), CFX_ByteString(buf1, 16));
-}
-void CPDF_StandardCryptoHandler::CryptBlock(FX_BOOL bEncrypt, FX_DWORD objnum, FX_DWORD gennum, FX_LPCBYTE src_buf, FX_DWORD src_size,
- FX_LPBYTE dest_buf, FX_DWORD& dest_size)
-{
- if (m_Cipher == FXCIPHER_NONE) {
- FXSYS_memcpy32(dest_buf, src_buf, src_size);
- return;
- }
- FX_BYTE realkey[16];
- int realkeylen = 16;
- if (m_Cipher != FXCIPHER_AES || m_KeyLen != 32) {
- FX_BYTE key1[32];
- FXSYS_memcpy32(key1, m_EncryptKey, m_KeyLen);
- key1[m_KeyLen + 0] = (FX_BYTE)objnum;
- key1[m_KeyLen + 1] = (FX_BYTE)(objnum >> 8);
- key1[m_KeyLen + 2] = (FX_BYTE)(objnum >> 16);
- key1[m_KeyLen + 3] = (FX_BYTE)gennum;
- key1[m_KeyLen + 4] = (FX_BYTE)(gennum >> 8);
- FXSYS_memcpy32(key1 + m_KeyLen, &objnum, 3);
- FXSYS_memcpy32(key1 + m_KeyLen + 3, &gennum, 2);
- if (m_Cipher == FXCIPHER_AES) {
- FXSYS_memcpy32(key1 + m_KeyLen + 5, "sAlT", 4);
- }
- CRYPT_MD5Generate(key1, m_Cipher == FXCIPHER_AES ? m_KeyLen + 9 : m_KeyLen + 5, realkey);
- realkeylen = m_KeyLen + 5;
- if (realkeylen > 16) {
- realkeylen = 16;
- }
- }
- if (m_Cipher == FXCIPHER_AES) {
- CRYPT_AESSetKey(m_pAESContext, 16, m_KeyLen == 32 ? m_EncryptKey : realkey, m_KeyLen, bEncrypt);
- if (bEncrypt) {
- FX_BYTE iv[16];
- for (int i = 0; i < 16; i ++) {
- iv[i] = (FX_BYTE)rand();
- }
- CRYPT_AESSetIV(m_pAESContext, iv);
- FXSYS_memcpy32(dest_buf, iv, 16);
- int nblocks = src_size / 16;
- CRYPT_AESEncrypt(m_pAESContext, dest_buf + 16, src_buf, nblocks * 16);
- FX_BYTE padding[16];
- FXSYS_memcpy32(padding, src_buf + nblocks * 16, src_size % 16);
- FXSYS_memset8(padding + src_size % 16, 16 - src_size % 16, 16 - src_size % 16);
- CRYPT_AESEncrypt(m_pAESContext, dest_buf + nblocks * 16 + 16, padding, 16);
- dest_size = 32 + nblocks * 16;
- } else {
- CRYPT_AESSetIV(m_pAESContext, src_buf);
- CRYPT_AESDecrypt(m_pAESContext, dest_buf, src_buf + 16, src_size - 16);
- dest_size = src_size - 16;
- dest_size -= dest_buf[dest_size - 1];
- }
- } else {
- ASSERT(dest_size == src_size);
- if (dest_buf != src_buf) {
- FXSYS_memcpy32(dest_buf, src_buf, src_size);
- }
- CRYPT_ArcFourCryptBlock(dest_buf, dest_size, realkey, realkeylen);
- }
-}
-typedef struct _AESCryptContext {
- FX_BYTE m_Context[2048];
- FX_BOOL m_bIV;
- FX_BYTE m_Block[16];
- FX_DWORD m_BlockOffset;
-} AESCryptContext;
-FX_LPVOID CPDF_StandardCryptoHandler::CryptStart(FX_DWORD objnum, FX_DWORD gennum, FX_BOOL bEncrypt)
-{
- if (m_Cipher == FXCIPHER_NONE) {
- return this;
- }
- if (m_Cipher == FXCIPHER_AES && m_KeyLen == 32) {
- AESCryptContext* pContext = FX_Alloc(AESCryptContext, 1);
- pContext->m_bIV = TRUE;
- pContext->m_BlockOffset = 0;
- CRYPT_AESSetKey(pContext->m_Context, 16, m_EncryptKey, 32, bEncrypt);
- if (bEncrypt) {
- for (int i = 0; i < 16; i ++) {
- pContext->m_Block[i] = (FX_BYTE)rand();
- }
- CRYPT_AESSetIV(pContext->m_Context, pContext->m_Block);
- }
- return pContext;
- }
- FX_BYTE key1[48];
- FXSYS_memcpy32(key1, m_EncryptKey, m_KeyLen);
- FXSYS_memcpy32(key1 + m_KeyLen, &objnum, 3);
- FXSYS_memcpy32(key1 + m_KeyLen + 3, &gennum, 2);
- if (m_Cipher == FXCIPHER_AES) {
- FXSYS_memcpy32(key1 + m_KeyLen + 5, "sAlT", 4);
- }
- FX_BYTE realkey[16];
- CRYPT_MD5Generate(key1, m_Cipher == FXCIPHER_AES ? m_KeyLen + 9 : m_KeyLen + 5, realkey);
- int realkeylen = m_KeyLen + 5;
- if (realkeylen > 16) {
- realkeylen = 16;
- }
- if (m_Cipher == FXCIPHER_AES) {
- AESCryptContext* pContext = FX_Alloc(AESCryptContext, 1);
- pContext->m_bIV = TRUE;
- pContext->m_BlockOffset = 0;
- CRYPT_AESSetKey(pContext->m_Context, 16, realkey, 16, bEncrypt);
- if (bEncrypt) {
- for (int i = 0; i < 16; i ++) {
- pContext->m_Block[i] = (FX_BYTE)rand();
- }
- CRYPT_AESSetIV(pContext->m_Context, pContext->m_Block);
- }
- return pContext;
- }
- void* pContext = FX_Alloc(FX_BYTE, 1040);
- CRYPT_ArcFourSetup(pContext, realkey, realkeylen);
- return pContext;
-}
-FX_BOOL CPDF_StandardCryptoHandler::CryptStream(FX_LPVOID context, FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf, FX_BOOL bEncrypt)
-{
- if (!context) {
- return FALSE;
- }
- if (m_Cipher == FXCIPHER_NONE) {
- dest_buf.AppendBlock(src_buf, src_size);
- return TRUE;
- }
- if (m_Cipher == FXCIPHER_RC4) {
- int old_size = dest_buf.GetSize();
- dest_buf.AppendBlock(src_buf, src_size);
- CRYPT_ArcFourCrypt(context, dest_buf.GetBuffer() + old_size, src_size);
- return TRUE;
- }
- AESCryptContext* pContext = (AESCryptContext*)context;
- if (pContext->m_bIV && bEncrypt) {
- dest_buf.AppendBlock(pContext->m_Block, 16);
- pContext->m_bIV = FALSE;
- }
- FX_DWORD src_off = 0;
- FX_DWORD src_left = src_size;
- while (1) {
- FX_DWORD copy_size = 16 - pContext->m_BlockOffset;
- if (copy_size > src_left) {
- copy_size = src_left;
- }
- FXSYS_memcpy32(pContext->m_Block + pContext->m_BlockOffset, src_buf + src_off, copy_size);
- src_off += copy_size;
- src_left -= copy_size;
- pContext->m_BlockOffset += copy_size;
- if (pContext->m_BlockOffset == 16) {
- if (!bEncrypt && pContext->m_bIV) {
- CRYPT_AESSetIV(pContext->m_Context, pContext->m_Block);
- pContext->m_bIV = FALSE;
- pContext->m_BlockOffset = 0;
- } else if (src_off < src_size) {
- FX_BYTE block_buf[16];
- if (bEncrypt) {
- CRYPT_AESEncrypt(pContext->m_Context, block_buf, pContext->m_Block, 16);
- } else {
- CRYPT_AESDecrypt(pContext->m_Context, block_buf, pContext->m_Block, 16);
- }
- dest_buf.AppendBlock(block_buf, 16);
- pContext->m_BlockOffset = 0;
- }
- }
- if (!src_left) {
- break;
- }
- }
- return TRUE;
-}
-FX_BOOL CPDF_StandardCryptoHandler::CryptFinish(FX_LPVOID context, CFX_BinaryBuf& dest_buf, FX_BOOL bEncrypt)
-{
- if (!context) {
- return FALSE;
- }
- if (m_Cipher == FXCIPHER_NONE) {
- return TRUE;
- }
- if (m_Cipher == FXCIPHER_RC4) {
- FX_Free(context);
- return TRUE;
- }
- AESCryptContext* pContext = (AESCryptContext*)context;
- if (bEncrypt) {
- FX_BYTE block_buf[16];
- if (pContext->m_BlockOffset == 16) {
- CRYPT_AESEncrypt(pContext->m_Context, block_buf, pContext->m_Block, 16);
- dest_buf.AppendBlock(block_buf, 16);
- pContext->m_BlockOffset = 0;
- }
- FXSYS_memset8(pContext->m_Block + pContext->m_BlockOffset, (FX_BYTE)(16 - pContext->m_BlockOffset), 16 - pContext->m_BlockOffset);
- CRYPT_AESEncrypt(pContext->m_Context, block_buf, pContext->m_Block, 16);
- dest_buf.AppendBlock(block_buf, 16);
- } else if (pContext->m_BlockOffset == 16) {
- FX_BYTE block_buf[16];
- CRYPT_AESDecrypt(pContext->m_Context, block_buf, pContext->m_Block, 16);
- if (block_buf[15] <= 16) {
- dest_buf.AppendBlock(block_buf, 16 - block_buf[15]);
- }
- }
- FX_Free(pContext);
- return TRUE;
-}
-FX_LPVOID CPDF_StandardCryptoHandler::DecryptStart(FX_DWORD objnum, FX_DWORD gennum)
-{
- return CryptStart(objnum, gennum, FALSE);
-}
-FX_DWORD CPDF_StandardCryptoHandler::DecryptGetSize(FX_DWORD src_size)
-{
- return m_Cipher == FXCIPHER_AES ? src_size - 16 : src_size;
-}
-FX_BOOL CPDF_StandardCryptoHandler::Init(CPDF_Dictionary* pEncryptDict, CPDF_SecurityHandler* pSecurityHandler)
-{
- FX_LPCBYTE key;
- if (!pSecurityHandler->GetCryptInfo(m_Cipher, key, m_KeyLen)) {
- return FALSE;
- }
- if (m_KeyLen > 32 || m_KeyLen < 0) {
- return FALSE;
- }
- if (m_Cipher != FXCIPHER_NONE) {
- FXSYS_memcpy32(m_EncryptKey, key, m_KeyLen);
- }
- if (m_Cipher == FXCIPHER_AES) {
- m_pAESContext = FX_Alloc(FX_BYTE, 2048);
- }
- return TRUE;
-}
-FX_BOOL CPDF_StandardCryptoHandler::Init(int cipher, FX_LPCBYTE key, int keylen)
-{
- if (cipher == FXCIPHER_AES) {
- switch(keylen) {
- case 16:
- case 24:
- case 32:
- break;
- default:
- return FALSE;
- }
- } else if (cipher == FXCIPHER_AES2) {
- if (keylen != 32) {
- return FALSE;
- }
- } else if (cipher == FXCIPHER_RC4) {
- if (keylen < 5 || keylen > 16) {
- return FALSE;
- }
- } else {
- if (keylen > 32) {
- keylen = 32;
- }
- }
- m_Cipher = cipher;
- m_KeyLen = keylen;
- FXSYS_memcpy32(m_EncryptKey, key, keylen);
- if (m_Cipher == FXCIPHER_AES) {
- m_pAESContext = FX_Alloc(FX_BYTE, 2048);
- }
- return TRUE;
-}
-FX_BOOL CPDF_StandardCryptoHandler::DecryptStream(FX_LPVOID context, FX_LPCBYTE src_buf, FX_DWORD src_size,
- CFX_BinaryBuf& dest_buf)
-{
- return CryptStream(context, src_buf, src_size, dest_buf, FALSE);
-}
-FX_BOOL CPDF_StandardCryptoHandler::DecryptFinish(FX_LPVOID context, CFX_BinaryBuf& dest_buf)
-{
- return CryptFinish(context, dest_buf, FALSE);
-}
-FX_DWORD CPDF_StandardCryptoHandler::EncryptGetSize(FX_DWORD objnum, FX_DWORD version, FX_LPCBYTE src_buf, FX_DWORD src_size)
-{
- if (m_Cipher == FXCIPHER_AES) {
- return src_size + 32;
- }
- return src_size;
-}
-FX_BOOL CPDF_StandardCryptoHandler::EncryptContent(FX_DWORD objnum, FX_DWORD gennum, FX_LPCBYTE src_buf, FX_DWORD src_size,
- FX_LPBYTE dest_buf, FX_DWORD& dest_size)
-{
- CryptBlock(TRUE, objnum, gennum, src_buf, src_size, dest_buf, dest_size);
- return TRUE;
-}
-void CPDF_CryptoHandler::Decrypt(FX_DWORD objnum, FX_DWORD gennum, CFX_ByteString& str)
-{
- CFX_BinaryBuf dest_buf;
- FX_LPVOID context = DecryptStart(objnum, gennum);
- DecryptStream(context, (FX_LPCBYTE)str, str.GetLength(), dest_buf);
- DecryptFinish(context, dest_buf);
- str = dest_buf;
-}
-CPDF_StandardCryptoHandler::CPDF_StandardCryptoHandler()
-{
- m_pAESContext = NULL;
- m_Cipher = FXCIPHER_NONE;
- m_KeyLen = 0;
-}
-CPDF_StandardCryptoHandler::~CPDF_StandardCryptoHandler()
-{
- if (m_pAESContext) {
- FX_Free(m_pAESContext);
- }
-}
+// 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
+
+#include <time.h>
+#include "../../../include/fpdfapi/fpdf_parser.h"
+#include "../../../include/fdrm/fx_crypt.h"
+const FX_BYTE defpasscode[32] = {
+ 0x28, 0xbf, 0x4e, 0x5e, 0x4e, 0x75, 0x8a, 0x41,
+ 0x64, 0x00, 0x4e, 0x56, 0xff, 0xfa, 0x01, 0x08,
+ 0x2e, 0x2e, 0x00, 0xb6, 0xd0, 0x68, 0x3e, 0x80,
+ 0x2f, 0x0c, 0xa9, 0xfe, 0x64, 0x53, 0x69, 0x7a
+};
+void CalcEncryptKey(CPDF_Dictionary* pEncrypt, FX_LPCBYTE password, FX_DWORD pass_size,
+ FX_LPBYTE key, int keylen, FX_BOOL bIgnoreMeta, CPDF_Array* pIdArray)
+{
+ int revision = pEncrypt->GetInteger(FX_BSTRC("R"));
+ FX_BYTE passcode[32];
+ for (FX_DWORD i = 0; i < 32; i ++) {
+ passcode[i] = i < pass_size ? password[i] : defpasscode[i - pass_size];
+ }
+ FX_BYTE md5[100];
+ CRYPT_MD5Start(md5);
+ CRYPT_MD5Update(md5, passcode, 32);
+ CFX_ByteString okey = pEncrypt->GetString(FX_BSTRC("O"));
+ CRYPT_MD5Update(md5, (FX_LPBYTE)(FX_LPCSTR)okey, okey.GetLength());
+ FX_DWORD perm = pEncrypt->GetInteger(FX_BSTRC("P"));
+ CRYPT_MD5Update(md5, (FX_LPBYTE)&perm, 4);
+ if (pIdArray) {
+ CFX_ByteString id = pIdArray->GetString(0);
+ CRYPT_MD5Update(md5, (FX_LPBYTE)(FX_LPCSTR)id, id.GetLength());
+ }
+ if (!bIgnoreMeta && revision >= 3 && !pEncrypt->GetInteger(FX_BSTRC("EncryptMetadata"), 1)) {
+ FX_DWORD tag = (FX_DWORD) - 1;
+ CRYPT_MD5Update(md5, (FX_LPBYTE)&tag, 4);
+ }
+ FX_BYTE digest[16];
+ CRYPT_MD5Finish(md5, digest);
+ FX_DWORD copy_len = keylen;
+ if (copy_len > sizeof(digest)) {
+ copy_len = sizeof(digest);
+ }
+ if (revision >= 3) {
+ for (int i = 0; i < 50; i ++) {
+ CRYPT_MD5Generate(digest, copy_len, digest);
+ }
+ }
+ FXSYS_memset32(key, 0, keylen);
+ FXSYS_memcpy32(key, digest, copy_len);
+}
+CPDF_CryptoHandler* CPDF_StandardSecurityHandler::CreateCryptoHandler()
+{
+ return FX_NEW CPDF_StandardCryptoHandler;
+}
+typedef struct _PDF_CRYPTOITEM : public CFX_Object {
+ FX_INT32 m_Cipher;
+ FX_INT32 m_KeyLen;
+ FX_BOOL m_bChecked;
+ CPDF_StandardCryptoHandler* m_pCryptoHandler;
+} PDF_CRYPTOITEM;
+CPDF_StandardSecurityHandler::CPDF_StandardSecurityHandler()
+{
+ m_Version = 0;
+ m_Revision = 0;
+ m_pParser = NULL;
+ m_pEncryptDict = NULL;
+ m_bOwner = FALSE;
+ m_Permissions = 0;
+ m_Cipher = FXCIPHER_NONE;
+ m_KeyLen = 0;
+}
+CPDF_StandardSecurityHandler::~CPDF_StandardSecurityHandler()
+{
+}
+FX_BOOL CPDF_StandardSecurityHandler::OnInit(CPDF_Parser* pParser, CPDF_Dictionary* pEncryptDict)
+{
+ m_pParser = pParser;
+ if (!LoadDict(pEncryptDict)) {
+ return FALSE;
+ }
+ if (m_Cipher == FXCIPHER_NONE) {
+ return TRUE;
+ }
+ return CheckSecurity(m_KeyLen);
+}
+FX_BOOL CPDF_StandardSecurityHandler::CheckSecurity(FX_INT32 key_len)
+{
+ CFX_ByteString password = m_pParser->GetPassword();
+ if (CheckPassword(password, password.GetLength(), TRUE, m_EncryptKey, key_len)) {
+ if (password.IsEmpty()) {
+ if (!CheckPassword(password, password.GetLength(), FALSE, m_EncryptKey, key_len)) {
+ return FALSE;
+ }
+ }
+ m_bOwner = TRUE;
+ return TRUE;
+ }
+ return CheckPassword(password, password.GetLength(), FALSE, m_EncryptKey, key_len);
+}
+FX_DWORD CPDF_StandardSecurityHandler::GetPermissions()
+{
+ return m_Permissions;
+}
+static FX_BOOL _LoadCryptInfo(CPDF_Dictionary* pEncryptDict, FX_BSTR name, int& cipher, int& keylen)
+{
+ int Version = pEncryptDict->GetInteger(FX_BSTRC("V"));
+ int Revision = pEncryptDict->GetInteger(FX_BSTRC("R"));
+ cipher = FXCIPHER_RC4;
+ keylen = 0;
+ if (Version >= 4) {
+ CPDF_Dictionary* pCryptFilters = pEncryptDict->GetDict(FX_BSTRC("CF"));
+ if (pCryptFilters == NULL) {
+ return FALSE;
+ }
+ if (name == FX_BSTRC("Identity")) {
+ cipher = FXCIPHER_NONE;
+ } else {
+ CPDF_Dictionary* pDefFilter = pCryptFilters->GetDict(name);
+ if (pDefFilter == NULL) {
+ return FALSE;
+ }
+ int nKeyBits = 0;
+ if (Version == 4) {
+ nKeyBits = pDefFilter->GetInteger(FX_BSTRC("Length"), 0);
+ if (nKeyBits == 0) {
+ nKeyBits = pEncryptDict->GetInteger(FX_BSTRC("Length"), 128);
+ }
+ } else {
+ nKeyBits = pEncryptDict->GetInteger(FX_BSTRC("Length"), 256);
+ }
+ if (nKeyBits < 40) {
+ nKeyBits *= 8;
+ }
+ keylen = nKeyBits / 8;
+ CFX_ByteString cipher_name = pDefFilter->GetString(FX_BSTRC("CFM"));
+ if (cipher_name == FX_BSTRC("AESV2") || cipher_name == FX_BSTRC("AESV3")) {
+ cipher = FXCIPHER_AES;
+ }
+ }
+ } else {
+ keylen = Version > 1 ? pEncryptDict->GetInteger(FX_BSTRC("Length"), 40) / 8 : 5;
+ }
+ if (keylen > 32 || keylen < 0) {
+ return FALSE;
+ }
+ return TRUE;
+}
+FX_BOOL CPDF_StandardSecurityHandler::LoadDict(CPDF_Dictionary* pEncryptDict)
+{
+ m_pEncryptDict = pEncryptDict;
+ m_bOwner = FALSE;
+ m_Version = pEncryptDict->GetInteger(FX_BSTRC("V"));
+ m_Revision = pEncryptDict->GetInteger(FX_BSTRC("R"));
+ m_Permissions = pEncryptDict->GetInteger(FX_BSTRC("P"), -1);
+ if (m_Version < 4) {
+ return _LoadCryptInfo(pEncryptDict, CFX_ByteString(), m_Cipher, m_KeyLen);
+ }
+ CFX_ByteString stmf_name = pEncryptDict->GetString(FX_BSTRC("StmF"));
+ CFX_ByteString strf_name = pEncryptDict->GetString(FX_BSTRC("StrF"));
+ if (stmf_name != strf_name) {
+ return FALSE;
+ }
+ if (!_LoadCryptInfo(pEncryptDict, strf_name, m_Cipher, m_KeyLen)) {
+ return FALSE;
+ }
+ return TRUE;
+}
+FX_BOOL CPDF_StandardSecurityHandler::LoadDict(CPDF_Dictionary* pEncryptDict, FX_DWORD type, int& cipher, int& key_len)
+{
+ m_pEncryptDict = pEncryptDict;
+ m_bOwner = FALSE;
+ m_Version = pEncryptDict->GetInteger(FX_BSTRC("V"));
+ m_Revision = pEncryptDict->GetInteger(FX_BSTRC("R"));
+ m_Permissions = pEncryptDict->GetInteger(FX_BSTRC("P"), -1);
+ CFX_ByteString strf_name, stmf_name;
+ if (m_Version >= 4) {
+ stmf_name = pEncryptDict->GetString(FX_BSTRC("StmF"));
+ strf_name = pEncryptDict->GetString(FX_BSTRC("StrF"));
+ if (stmf_name != strf_name) {
+ return FALSE;
+ }
+ }
+ if (!_LoadCryptInfo(pEncryptDict, strf_name, cipher, key_len)) {
+ return FALSE;
+ }
+ m_Cipher = cipher;
+ m_KeyLen = key_len;
+ return TRUE;
+ return TRUE;
+}
+FX_BOOL CPDF_StandardSecurityHandler::GetCryptInfo(int& cipher, FX_LPCBYTE& buffer, int& keylen)
+{
+ cipher = m_Cipher;
+ buffer = m_EncryptKey;
+ keylen = m_KeyLen;
+ return TRUE;
+}
+#define FX_GET_32WORD(n,b,i) \
+ { \
+ (n) = (FX_DWORD)(( (FX_UINT64) (b)[(i)] << 24 ) \
+ | ( (FX_UINT64) (b)[(i) + 1] << 16 ) \
+ | ( (FX_UINT64) (b)[(i) + 2] << 8 ) \
+ | ( (FX_UINT64) (b)[(i) + 3] )); \
+ }
+int BigOrder64BitsMod3(FX_LPBYTE data)
+{
+ FX_UINT64 ret = 0;
+ for (int i = 0; i < 4; ++i) {
+ FX_DWORD value;
+ FX_GET_32WORD(value, data, 4 * i);
+ ret <<= 32;
+ ret |= value;
+ ret %= 3;
+ }
+ return (int)ret;
+}
+void Revision6_Hash(FX_LPCBYTE password, FX_DWORD size, FX_LPCBYTE salt, FX_LPCBYTE vector, FX_LPBYTE hash)
+{
+ int iBlockSize = 32;
+ FX_BYTE sha[128];
+ CRYPT_SHA256Start(sha);
+ CRYPT_SHA256Update(sha, password, size);
+ CRYPT_SHA256Update(sha, salt, 8);
+ if (vector) {
+ CRYPT_SHA256Update(sha, vector, 48);
+ }
+ FX_BYTE digest[32];
+ CRYPT_SHA256Finish(sha, digest);
+ CFX_ByteTextBuf buf;
+ FX_LPBYTE input = digest;
+ FX_LPBYTE key = input;
+ FX_LPBYTE iv = input + 16;
+ FX_LPBYTE E = buf.GetBuffer();
+ int iBufLen = buf.GetLength();
+ CFX_ByteTextBuf interDigest;
+ int i = 0;
+ FX_LPBYTE aes = FX_Alloc(FX_BYTE, 2048);
+ while (i < 64 || i < E[iBufLen - 1] + 32) {
+ int iRoundSize = size + iBlockSize;
+ if (vector) {
+ iRoundSize += 48;
+ }
+ iBufLen = iRoundSize * 64;
+ buf.EstimateSize(iBufLen);
+ E = buf.GetBuffer();
+ CFX_ByteTextBuf content;
+ for (int j = 0; j < 64; ++j) {
+ content.AppendBlock(password, size);
+ content.AppendBlock(input, iBlockSize);
+ if (vector) {
+ content.AppendBlock(vector, 48);
+ }
+ }
+ CRYPT_AESSetKey(aes, 16, key, 16, TRUE);
+ CRYPT_AESSetIV(aes, iv);
+ CRYPT_AESEncrypt(aes, E, content.GetBuffer(), iBufLen);
+ int iHash = 0;
+ switch (BigOrder64BitsMod3(E)) {
+ case 0:
+ iHash = 0;
+ iBlockSize = 32;
+ break;
+ case 1:
+ iHash = 1;
+ iBlockSize = 48;
+ break;
+ default:
+ iHash = 2;
+ iBlockSize = 64;
+ break;
+ }
+ interDigest.EstimateSize(iBlockSize);
+ input = interDigest.GetBuffer();
+ if (iHash == 0) {
+ CRYPT_SHA256Generate(E, iBufLen, input);
+ } else if (iHash == 1) {
+ CRYPT_SHA384Generate(E, iBufLen, input);
+ } else if (iHash == 2) {
+ CRYPT_SHA512Generate(E, iBufLen, input);
+ }
+ key = input;
+ iv = input + 16;
+ ++i;
+ }
+ FX_Free(aes);
+ if (hash) {
+ FXSYS_memcpy32(hash, input, 32);
+ }
+}
+FX_BOOL CPDF_StandardSecurityHandler::AES256_CheckPassword(FX_LPCBYTE password, FX_DWORD size,
+ FX_BOOL bOwner, FX_LPBYTE key)
+{
+ CFX_ByteString okey = m_pEncryptDict->GetString(FX_BSTRC("O"));
+ if (okey.GetLength() < 48) {
+ return FALSE;
+ }
+ CFX_ByteString ukey = m_pEncryptDict->GetString(FX_BSTRC("U"));
+ if (ukey.GetLength() < 48) {
+ return FALSE;
+ }
+ FX_LPCBYTE pkey = bOwner ? (FX_LPCBYTE)okey : (FX_LPCBYTE)ukey;
+ FX_BYTE sha[128];
+ FX_BYTE digest[32];
+ if (m_Revision >= 6) {
+ Revision6_Hash(password, size, (FX_LPCBYTE)pkey + 32, (bOwner ? (FX_LPCBYTE)ukey : NULL), digest);
+ } else {
+ CRYPT_SHA256Start(sha);
+ CRYPT_SHA256Update(sha, password, size);
+ CRYPT_SHA256Update(sha, pkey + 32, 8);
+ if (bOwner) {
+ CRYPT_SHA256Update(sha, ukey, 48);
+ }
+ CRYPT_SHA256Finish(sha, digest);
+ }
+ if (FXSYS_memcmp32(digest, pkey, 32) != 0) {
+ return FALSE;
+ }
+ if (key == NULL) {
+ return TRUE;
+ }
+ if (m_Revision >= 6) {
+ Revision6_Hash(password, size, (FX_LPCBYTE)pkey + 40, (bOwner ? (FX_LPCBYTE)ukey : NULL), digest);
+ } else {
+ CRYPT_SHA256Start(sha);
+ CRYPT_SHA256Update(sha, password, size);
+ CRYPT_SHA256Update(sha, pkey + 40, 8);
+ if (bOwner) {
+ CRYPT_SHA256Update(sha, ukey, 48);
+ }
+ CRYPT_SHA256Finish(sha, digest);
+ }
+ CFX_ByteString ekey = m_pEncryptDict->GetString(bOwner ? FX_BSTRC("OE") : FX_BSTRC("UE"));
+ if (ekey.GetLength() < 32) {
+ return FALSE;
+ }
+ FX_BYTE* aes = FX_Alloc(FX_BYTE, 2048);
+ CRYPT_AESSetKey(aes, 16, digest, 32, FALSE);
+ FX_BYTE iv[16];
+ FXSYS_memset32(iv, 0, 16);
+ CRYPT_AESSetIV(aes, iv);
+ CRYPT_AESDecrypt(aes, key, ekey, 32);
+ CRYPT_AESSetKey(aes, 16, key, 32, FALSE);
+ CRYPT_AESSetIV(aes, iv);
+ CFX_ByteString perms = m_pEncryptDict->GetString(FX_BSTRC("Perms"));
+ if (perms.IsEmpty()) {
+ return FALSE;
+ }
+ FX_BYTE perms_buf[16];
+ FXSYS_memset32(perms_buf, 0, sizeof(perms_buf));
+ FX_DWORD copy_len = sizeof(perms_buf);
+ if (copy_len > (FX_DWORD)perms.GetLength()) {
+ copy_len = perms.GetLength();
+ }
+ FXSYS_memcpy32(perms_buf, (FX_LPCBYTE)perms, copy_len);
+ FX_BYTE buf[16];
+ CRYPT_AESDecrypt(aes, buf, perms_buf, 16);
+ FX_Free(aes);
+ if (buf[9] != 'a' || buf[10] != 'd' || buf[11] != 'b') {
+ return FALSE;
+ }
+ if (FXDWORD_GET_LSBFIRST(buf) != m_Permissions) {
+ return FALSE;
+ }
+ if ((buf[8] == 'T' && !IsMetadataEncrypted()) || (buf[8] == 'F' && IsMetadataEncrypted())) {
+ return FALSE;
+ }
+ return TRUE;
+}
+int CPDF_StandardSecurityHandler::CheckPassword(FX_LPCBYTE password, FX_DWORD pass_size, FX_BOOL bOwner, FX_LPBYTE key)
+{
+ return CheckPassword(password, pass_size, bOwner, key, m_KeyLen);
+}
+int CPDF_StandardSecurityHandler::CheckPassword(FX_LPCBYTE password, FX_DWORD size, FX_BOOL bOwner, FX_LPBYTE key, FX_INT32 key_len)
+{
+ if (m_Revision >= 5) {
+ return AES256_CheckPassword(password, size, bOwner, key);
+ }
+ FX_BYTE keybuf[32];
+ if (key == NULL) {
+ key = keybuf;
+ }
+ if (bOwner) {
+ return CheckOwnerPassword(password, size, key, key_len);
+ }
+ return CheckUserPassword(password, size, FALSE, key, key_len) || CheckUserPassword(password, size, TRUE, key, key_len);
+}
+FX_BOOL CPDF_StandardSecurityHandler::CheckUserPassword(FX_LPCBYTE password, FX_DWORD pass_size,
+ FX_BOOL bIgnoreEncryptMeta, FX_LPBYTE key, FX_INT32 key_len)
+{
+ CalcEncryptKey(m_pEncryptDict, password, pass_size, key, key_len, bIgnoreEncryptMeta,
+ m_pParser->GetIDArray());
+ CFX_ByteString ukey = m_pEncryptDict->GetString(FX_BSTRC("U"));
+ if (ukey.GetLength() < 16) {
+ return FALSE;
+ }
+ FX_BYTE ukeybuf[32];
+ if (m_Revision == 2) {
+ FXSYS_memcpy32(ukeybuf, defpasscode, 32);
+ CRYPT_ArcFourCryptBlock(ukeybuf, 32, key, key_len);
+ } else {
+ FX_BYTE test[32], tmpkey[32];
+ FX_DWORD copy_len = sizeof(test);
+ if (copy_len > (FX_DWORD)ukey.GetLength()) {
+ copy_len = ukey.GetLength();
+ }
+ FXSYS_memset32(test, 0, sizeof(test));
+ FXSYS_memcpy32(test, (FX_LPCSTR)ukey, copy_len);
+ for (int i = 19; i >= 0; i --) {
+ for (int j = 0; j < key_len; j ++) {
+ tmpkey[j] = key[j] ^ i;
+ }
+ CRYPT_ArcFourCryptBlock(test, 32, tmpkey, key_len);
+ }
+ FX_BYTE md5[100];
+ CRYPT_MD5Start(md5);
+ CRYPT_MD5Update(md5, defpasscode, 32);
+ CPDF_Array* pIdArray = m_pParser->GetIDArray();
+ if (pIdArray) {
+ CFX_ByteString id = pIdArray->GetString(0);
+ CRYPT_MD5Update(md5, (FX_LPBYTE)(FX_LPCSTR)id, id.GetLength());
+ }
+ CRYPT_MD5Finish(md5, ukeybuf);
+ return FXSYS_memcmp32(test, ukeybuf, 16) == 0;
+ }
+ if (FXSYS_memcmp32((FX_LPVOID)(FX_LPCSTR)ukey, ukeybuf, 16) == 0) {
+ return TRUE;
+ }
+ return FALSE;
+}
+CFX_ByteString CPDF_StandardSecurityHandler::GetUserPassword(FX_LPCBYTE owner_pass, FX_DWORD pass_size)
+{
+ return GetUserPassword(owner_pass, pass_size, m_KeyLen);
+}
+CFX_ByteString CPDF_StandardSecurityHandler::GetUserPassword(FX_LPCBYTE owner_pass, FX_DWORD pass_size, FX_INT32 key_len)
+{
+ CFX_ByteString okey = m_pEncryptDict->GetString(FX_BSTRC("O"));
+ FX_BYTE passcode[32];
+ FX_DWORD i;
+ for (i = 0; i < 32; i ++) {
+ passcode[i] = i < pass_size ? owner_pass[i] : defpasscode[i - pass_size];
+ }
+ FX_BYTE digest[16];
+ CRYPT_MD5Generate(passcode, 32, digest);
+ if (m_Revision >= 3) {
+ for (int i = 0; i < 50; i ++) {
+ CRYPT_MD5Generate(digest, 16, digest);
+ }
+ }
+ FX_BYTE enckey[32];
+ FXSYS_memset32(enckey, 0, sizeof(enckey));
+ FX_DWORD copy_len = key_len;
+ if (copy_len > sizeof(digest)) {
+ copy_len = sizeof(digest);
+ }
+ FXSYS_memcpy32(enckey, digest, copy_len);
+ int okeylen = okey.GetLength();
+ if (okeylen > 32) {
+ okeylen = 32;
+ }
+ FX_BYTE okeybuf[64];
+ FXSYS_memcpy32(okeybuf, (FX_LPCSTR)okey, okeylen);
+ if (m_Revision == 2) {
+ CRYPT_ArcFourCryptBlock(okeybuf, okeylen, enckey, key_len);
+ } else {
+ for (int i = 19; i >= 0; i --) {
+ FX_BYTE tempkey[32];
+ for (int j = 0; j < m_KeyLen; j ++) {
+ tempkey[j] = enckey[j] ^ i;
+ }
+ CRYPT_ArcFourCryptBlock(okeybuf, okeylen, tempkey, key_len);
+ }
+ }
+ int len = 32;
+ while (len && defpasscode[len - 1] == okeybuf[len - 1]) {
+ len --;
+ }
+ return CFX_ByteString(okeybuf, len);
+}
+FX_BOOL CPDF_StandardSecurityHandler::CheckOwnerPassword(FX_LPCBYTE password, FX_DWORD pass_size,
+ FX_LPBYTE key, FX_INT32 key_len)
+{
+ CFX_ByteString user_pass = GetUserPassword(password, pass_size, key_len);
+ if (CheckUserPassword(user_pass, user_pass.GetLength(), FALSE, key, key_len)) {
+ return TRUE;
+ }
+ return CheckUserPassword(user_pass, user_pass.GetLength(), TRUE, key, key_len);
+}
+FX_BOOL CPDF_StandardSecurityHandler::IsMetadataEncrypted()
+{
+ return m_pEncryptDict->GetBoolean(FX_BSTRC("EncryptMetadata"), TRUE);
+}
+CPDF_SecurityHandler* FPDF_CreateStandardSecurityHandler()
+{
+ return FX_NEW CPDF_StandardSecurityHandler;
+}
+void CPDF_StandardSecurityHandler::OnCreate(CPDF_Dictionary* pEncryptDict, CPDF_Array* pIdArray,
+ FX_LPCBYTE user_pass, FX_DWORD user_size,
+ FX_LPCBYTE owner_pass, FX_DWORD owner_size, FX_BOOL bDefault, FX_DWORD type)
+{
+ int cipher = 0, key_len = 0;
+ if (!LoadDict(pEncryptDict, type, cipher, key_len)) {
+ return;
+ }
+ if (bDefault && (owner_pass == NULL || owner_size == 0)) {
+ owner_pass = user_pass;
+ owner_size = user_size;
+ }
+ if (m_Revision >= 5) {
+ int t = (int)time(NULL);
+ FX_BYTE sha[128];
+ CRYPT_SHA256Start(sha);
+ CRYPT_SHA256Update(sha, (FX_BYTE*)&t, sizeof t);
+ CRYPT_SHA256Update(sha, m_EncryptKey, 32);
+ CRYPT_SHA256Update(sha, (FX_BYTE*)"there", 5);
+ CRYPT_SHA256Finish(sha, m_EncryptKey);
+ AES256_SetPassword(pEncryptDict, user_pass, user_size, FALSE, m_EncryptKey);
+ if (bDefault) {
+ AES256_SetPassword(pEncryptDict, owner_pass, owner_size, TRUE, m_EncryptKey);
+ AES256_SetPerms(pEncryptDict, m_Permissions, pEncryptDict->GetBoolean(FX_BSTRC("EncryptMetadata"), TRUE), m_EncryptKey);
+ }
+ return;
+ }
+ if (bDefault) {
+ FX_BYTE passcode[32];
+ FX_DWORD i;
+ for (i = 0; i < 32; i ++) {
+ passcode[i] = i < owner_size ? owner_pass[i] : defpasscode[i - owner_size];
+ }
+ FX_BYTE digest[16];
+ CRYPT_MD5Generate(passcode, 32, digest);
+ if (m_Revision >= 3) {
+ for (int i = 0; i < 50; i ++) {
+ CRYPT_MD5Generate(digest, 16, digest);
+ }
+ }
+ FX_BYTE enckey[32];
+ FXSYS_memcpy32(enckey, digest, key_len);
+ for (i = 0; i < 32; i ++) {
+ passcode[i] = i < user_size ? user_pass[i] : defpasscode[i - user_size];
+ }
+ CRYPT_ArcFourCryptBlock(passcode, 32, enckey, key_len);
+ FX_BYTE tempkey[32];
+ if (m_Revision >= 3) {
+ for (i = 1; i <= 19; i ++) {
+ for (int j = 0; j < key_len; j ++) {
+ tempkey[j] = enckey[j] ^ (FX_BYTE)i;
+ }
+ CRYPT_ArcFourCryptBlock(passcode, 32, tempkey, key_len);
+ }
+ }
+ pEncryptDict->SetAtString(FX_BSTRC("O"), CFX_ByteString(passcode, 32));
+ }
+ CalcEncryptKey(m_pEncryptDict, (FX_LPBYTE)user_pass, user_size, m_EncryptKey, key_len, FALSE, pIdArray);
+ if (m_Revision < 3) {
+ FX_BYTE tempbuf[32];
+ FXSYS_memcpy32(tempbuf, defpasscode, 32);
+ CRYPT_ArcFourCryptBlock(tempbuf, 32, m_EncryptKey, key_len);
+ pEncryptDict->SetAtString(FX_BSTRC("U"), CFX_ByteString(tempbuf, 32));
+ } else {
+ FX_BYTE md5[100];
+ CRYPT_MD5Start(md5);
+ CRYPT_MD5Update(md5, defpasscode, 32);
+ if (pIdArray) {
+ CFX_ByteString id = pIdArray->GetString(0);
+ CRYPT_MD5Update(md5, (FX_LPBYTE)(FX_LPCSTR)id, id.GetLength());
+ }
+ FX_BYTE digest[32];
+ CRYPT_MD5Finish(md5, digest);
+ CRYPT_ArcFourCryptBlock(digest, 16, m_EncryptKey, key_len);
+ FX_BYTE tempkey[32];
+ for (int i = 1; i <= 19; i ++) {
+ for (int j = 0; j < key_len; j ++) {
+ tempkey[j] = m_EncryptKey[j] ^ (FX_BYTE)i;
+ }
+ CRYPT_ArcFourCryptBlock(digest, 16, tempkey, key_len);
+ }
+ CRYPT_MD5Generate(digest, 16, digest + 16);
+ pEncryptDict->SetAtString(FX_BSTRC("U"), CFX_ByteString(digest, 32));
+ }
+}
+void CPDF_StandardSecurityHandler::OnCreate(CPDF_Dictionary* pEncryptDict, CPDF_Array* pIdArray,
+ FX_LPCBYTE user_pass, FX_DWORD user_size,
+ FX_LPCBYTE owner_pass, FX_DWORD owner_size, FX_DWORD type)
+{
+ OnCreate(pEncryptDict, pIdArray, user_pass, user_size, owner_pass, owner_size, TRUE, type);
+}
+void CPDF_StandardSecurityHandler::OnCreate(CPDF_Dictionary* pEncryptDict, CPDF_Array* pIdArray, FX_LPCBYTE user_pass, FX_DWORD user_size, FX_DWORD type)
+{
+ OnCreate(pEncryptDict, pIdArray, user_pass, user_size, NULL, 0, FALSE, type);
+}
+void CPDF_StandardSecurityHandler::AES256_SetPassword(CPDF_Dictionary* pEncryptDict, FX_LPCBYTE password, FX_DWORD size, FX_BOOL bOwner, FX_LPCBYTE key)
+{
+ FX_BYTE sha[128];
+ CRYPT_SHA1Start(sha);
+ CRYPT_SHA1Update(sha, key, 32);
+ CRYPT_SHA1Update(sha, (FX_BYTE*)"hello", 5);
+ FX_BYTE digest[20];
+ CRYPT_SHA1Finish(sha, digest);
+ CFX_ByteString ukey = pEncryptDict->GetString(FX_BSTRC("U"));
+ FX_BYTE digest1[48];
+ if (m_Revision >= 6) {
+ Revision6_Hash(password, size, digest, (bOwner ? (FX_LPCBYTE)ukey : NULL), digest1);
+ } else {
+ CRYPT_SHA256Start(sha);
+ CRYPT_SHA256Update(sha, password, size);
+ CRYPT_SHA256Update(sha, digest, 8);
+ if (bOwner) {
+ CRYPT_SHA256Update(sha, ukey, ukey.GetLength());
+ }
+ CRYPT_SHA256Finish(sha, digest1);
+ }
+ FXSYS_memcpy32(digest1 + 32, digest, 16);
+ pEncryptDict->SetAtString(bOwner ? FX_BSTRC("O") : FX_BSTRC("U"), CFX_ByteString(digest1, 48));
+ if (m_Revision >= 6) {
+ Revision6_Hash(password, size, digest + 8, (bOwner ? (FX_LPCBYTE)ukey : NULL), digest1);
+ } else {
+ CRYPT_SHA256Start(sha);
+ CRYPT_SHA256Update(sha, password, size);
+ CRYPT_SHA256Update(sha, digest + 8, 8);
+ if (bOwner) {
+ CRYPT_SHA256Update(sha, ukey, ukey.GetLength());
+ }
+ CRYPT_SHA256Finish(sha, digest1);
+ }
+ FX_BYTE* aes = FX_Alloc(FX_BYTE, 2048);
+ CRYPT_AESSetKey(aes, 16, digest1, 32, TRUE);
+ FX_BYTE iv[16];
+ FXSYS_memset32(iv, 0, 16);
+ CRYPT_AESSetIV(aes, iv);
+ CRYPT_AESEncrypt(aes, digest1, key, 32);
+ FX_Free(aes);
+ pEncryptDict->SetAtString(bOwner ? FX_BSTRC("OE") : FX_BSTRC("UE"), CFX_ByteString(digest1, 32));
+}
+void CPDF_StandardSecurityHandler::AES256_SetPerms(CPDF_Dictionary* pEncryptDict, FX_DWORD permissions,
+ FX_BOOL bEncryptMetadata, FX_LPCBYTE key)
+{
+ FX_BYTE buf[16];
+ buf[0] = (FX_BYTE)permissions;
+ buf[1] = (FX_BYTE)(permissions >> 8);
+ buf[2] = (FX_BYTE)(permissions >> 16);
+ buf[3] = (FX_BYTE)(permissions >> 24);
+ buf[4] = 0xff;
+ buf[5] = 0xff;
+ buf[6] = 0xff;
+ buf[7] = 0xff;
+ buf[8] = bEncryptMetadata ? 'T' : 'F';
+ buf[9] = 'a';
+ buf[10] = 'd';
+ buf[11] = 'b';
+ FX_BYTE* aes = FX_Alloc(FX_BYTE, 2048);
+ CRYPT_AESSetKey(aes, 16, key, 32, TRUE);
+ FX_BYTE iv[16], buf1[16];
+ FXSYS_memset32(iv, 0, 16);
+ CRYPT_AESSetIV(aes, iv);
+ CRYPT_AESEncrypt(aes, buf1, buf, 16);
+ FX_Free(aes);
+ pEncryptDict->SetAtString(FX_BSTRC("Perms"), CFX_ByteString(buf1, 16));
+}
+void CPDF_StandardCryptoHandler::CryptBlock(FX_BOOL bEncrypt, FX_DWORD objnum, FX_DWORD gennum, FX_LPCBYTE src_buf, FX_DWORD src_size,
+ FX_LPBYTE dest_buf, FX_DWORD& dest_size)
+{
+ if (m_Cipher == FXCIPHER_NONE) {
+ FXSYS_memcpy32(dest_buf, src_buf, src_size);
+ return;
+ }
+ FX_BYTE realkey[16];
+ int realkeylen = 16;
+ if (m_Cipher != FXCIPHER_AES || m_KeyLen != 32) {
+ FX_BYTE key1[32];
+ FXSYS_memcpy32(key1, m_EncryptKey, m_KeyLen);
+ key1[m_KeyLen + 0] = (FX_BYTE)objnum;
+ key1[m_KeyLen + 1] = (FX_BYTE)(objnum >> 8);
+ key1[m_KeyLen + 2] = (FX_BYTE)(objnum >> 16);
+ key1[m_KeyLen + 3] = (FX_BYTE)gennum;
+ key1[m_KeyLen + 4] = (FX_BYTE)(gennum >> 8);
+ FXSYS_memcpy32(key1 + m_KeyLen, &objnum, 3);
+ FXSYS_memcpy32(key1 + m_KeyLen + 3, &gennum, 2);
+ if (m_Cipher == FXCIPHER_AES) {
+ FXSYS_memcpy32(key1 + m_KeyLen + 5, "sAlT", 4);
+ }
+ CRYPT_MD5Generate(key1, m_Cipher == FXCIPHER_AES ? m_KeyLen + 9 : m_KeyLen + 5, realkey);
+ realkeylen = m_KeyLen + 5;
+ if (realkeylen > 16) {
+ realkeylen = 16;
+ }
+ }
+ if (m_Cipher == FXCIPHER_AES) {
+ CRYPT_AESSetKey(m_pAESContext, 16, m_KeyLen == 32 ? m_EncryptKey : realkey, m_KeyLen, bEncrypt);
+ if (bEncrypt) {
+ FX_BYTE iv[16];
+ for (int i = 0; i < 16; i ++) {
+ iv[i] = (FX_BYTE)rand();
+ }
+ CRYPT_AESSetIV(m_pAESContext, iv);
+ FXSYS_memcpy32(dest_buf, iv, 16);
+ int nblocks = src_size / 16;
+ CRYPT_AESEncrypt(m_pAESContext, dest_buf + 16, src_buf, nblocks * 16);
+ FX_BYTE padding[16];
+ FXSYS_memcpy32(padding, src_buf + nblocks * 16, src_size % 16);
+ FXSYS_memset8(padding + src_size % 16, 16 - src_size % 16, 16 - src_size % 16);
+ CRYPT_AESEncrypt(m_pAESContext, dest_buf + nblocks * 16 + 16, padding, 16);
+ dest_size = 32 + nblocks * 16;
+ } else {
+ CRYPT_AESSetIV(m_pAESContext, src_buf);
+ CRYPT_AESDecrypt(m_pAESContext, dest_buf, src_buf + 16, src_size - 16);
+ dest_size = src_size - 16;
+ dest_size -= dest_buf[dest_size - 1];
+ }
+ } else {
+ ASSERT(dest_size == src_size);
+ if (dest_buf != src_buf) {
+ FXSYS_memcpy32(dest_buf, src_buf, src_size);
+ }
+ CRYPT_ArcFourCryptBlock(dest_buf, dest_size, realkey, realkeylen);
+ }
+}
+typedef struct _AESCryptContext {
+ FX_BYTE m_Context[2048];
+ FX_BOOL m_bIV;
+ FX_BYTE m_Block[16];
+ FX_DWORD m_BlockOffset;
+} AESCryptContext;
+FX_LPVOID CPDF_StandardCryptoHandler::CryptStart(FX_DWORD objnum, FX_DWORD gennum, FX_BOOL bEncrypt)
+{
+ if (m_Cipher == FXCIPHER_NONE) {
+ return this;
+ }
+ if (m_Cipher == FXCIPHER_AES && m_KeyLen == 32) {
+ AESCryptContext* pContext = FX_Alloc(AESCryptContext, 1);
+ pContext->m_bIV = TRUE;
+ pContext->m_BlockOffset = 0;
+ CRYPT_AESSetKey(pContext->m_Context, 16, m_EncryptKey, 32, bEncrypt);
+ if (bEncrypt) {
+ for (int i = 0; i < 16; i ++) {
+ pContext->m_Block[i] = (FX_BYTE)rand();
+ }
+ CRYPT_AESSetIV(pContext->m_Context, pContext->m_Block);
+ }
+ return pContext;
+ }
+ FX_BYTE key1[48];
+ FXSYS_memcpy32(key1, m_EncryptKey, m_KeyLen);
+ FXSYS_memcpy32(key1 + m_KeyLen, &objnum, 3);
+ FXSYS_memcpy32(key1 + m_KeyLen + 3, &gennum, 2);
+ if (m_Cipher == FXCIPHER_AES) {
+ FXSYS_memcpy32(key1 + m_KeyLen + 5, "sAlT", 4);
+ }
+ FX_BYTE realkey[16];
+ CRYPT_MD5Generate(key1, m_Cipher == FXCIPHER_AES ? m_KeyLen + 9 : m_KeyLen + 5, realkey);
+ int realkeylen = m_KeyLen + 5;
+ if (realkeylen > 16) {
+ realkeylen = 16;
+ }
+ if (m_Cipher == FXCIPHER_AES) {
+ AESCryptContext* pContext = FX_Alloc(AESCryptContext, 1);
+ pContext->m_bIV = TRUE;
+ pContext->m_BlockOffset = 0;
+ CRYPT_AESSetKey(pContext->m_Context, 16, realkey, 16, bEncrypt);
+ if (bEncrypt) {
+ for (int i = 0; i < 16; i ++) {
+ pContext->m_Block[i] = (FX_BYTE)rand();
+ }
+ CRYPT_AESSetIV(pContext->m_Context, pContext->m_Block);
+ }
+ return pContext;
+ }
+ void* pContext = FX_Alloc(FX_BYTE, 1040);
+ CRYPT_ArcFourSetup(pContext, realkey, realkeylen);
+ return pContext;
+}
+FX_BOOL CPDF_StandardCryptoHandler::CryptStream(FX_LPVOID context, FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf, FX_BOOL bEncrypt)
+{
+ if (!context) {
+ return FALSE;
+ }
+ if (m_Cipher == FXCIPHER_NONE) {
+ dest_buf.AppendBlock(src_buf, src_size);
+ return TRUE;
+ }
+ if (m_Cipher == FXCIPHER_RC4) {
+ int old_size = dest_buf.GetSize();
+ dest_buf.AppendBlock(src_buf, src_size);
+ CRYPT_ArcFourCrypt(context, dest_buf.GetBuffer() + old_size, src_size);
+ return TRUE;
+ }
+ AESCryptContext* pContext = (AESCryptContext*)context;
+ if (pContext->m_bIV && bEncrypt) {
+ dest_buf.AppendBlock(pContext->m_Block, 16);
+ pContext->m_bIV = FALSE;
+ }
+ FX_DWORD src_off = 0;
+ FX_DWORD src_left = src_size;
+ while (1) {
+ FX_DWORD copy_size = 16 - pContext->m_BlockOffset;
+ if (copy_size > src_left) {
+ copy_size = src_left;
+ }
+ FXSYS_memcpy32(pContext->m_Block + pContext->m_BlockOffset, src_buf + src_off, copy_size);
+ src_off += copy_size;
+ src_left -= copy_size;
+ pContext->m_BlockOffset += copy_size;
+ if (pContext->m_BlockOffset == 16) {
+ if (!bEncrypt && pContext->m_bIV) {
+ CRYPT_AESSetIV(pContext->m_Context, pContext->m_Block);
+ pContext->m_bIV = FALSE;
+ pContext->m_BlockOffset = 0;
+ } else if (src_off < src_size) {
+ FX_BYTE block_buf[16];
+ if (bEncrypt) {
+ CRYPT_AESEncrypt(pContext->m_Context, block_buf, pContext->m_Block, 16);
+ } else {
+ CRYPT_AESDecrypt(pContext->m_Context, block_buf, pContext->m_Block, 16);
+ }
+ dest_buf.AppendBlock(block_buf, 16);
+ pContext->m_BlockOffset = 0;
+ }
+ }
+ if (!src_left) {
+ break;
+ }
+ }
+ return TRUE;
+}
+FX_BOOL CPDF_StandardCryptoHandler::CryptFinish(FX_LPVOID context, CFX_BinaryBuf& dest_buf, FX_BOOL bEncrypt)
+{
+ if (!context) {
+ return FALSE;
+ }
+ if (m_Cipher == FXCIPHER_NONE) {
+ return TRUE;
+ }
+ if (m_Cipher == FXCIPHER_RC4) {
+ FX_Free(context);
+ return TRUE;
+ }
+ AESCryptContext* pContext = (AESCryptContext*)context;
+ if (bEncrypt) {
+ FX_BYTE block_buf[16];
+ if (pContext->m_BlockOffset == 16) {
+ CRYPT_AESEncrypt(pContext->m_Context, block_buf, pContext->m_Block, 16);
+ dest_buf.AppendBlock(block_buf, 16);
+ pContext->m_BlockOffset = 0;
+ }
+ FXSYS_memset8(pContext->m_Block + pContext->m_BlockOffset, (FX_BYTE)(16 - pContext->m_BlockOffset), 16 - pContext->m_BlockOffset);
+ CRYPT_AESEncrypt(pContext->m_Context, block_buf, pContext->m_Block, 16);
+ dest_buf.AppendBlock(block_buf, 16);
+ } else if (pContext->m_BlockOffset == 16) {
+ FX_BYTE block_buf[16];
+ CRYPT_AESDecrypt(pContext->m_Context, block_buf, pContext->m_Block, 16);
+ if (block_buf[15] <= 16) {
+ dest_buf.AppendBlock(block_buf, 16 - block_buf[15]);
+ }
+ }
+ FX_Free(pContext);
+ return TRUE;
+}
+FX_LPVOID CPDF_StandardCryptoHandler::DecryptStart(FX_DWORD objnum, FX_DWORD gennum)
+{
+ return CryptStart(objnum, gennum, FALSE);
+}
+FX_DWORD CPDF_StandardCryptoHandler::DecryptGetSize(FX_DWORD src_size)
+{
+ return m_Cipher == FXCIPHER_AES ? src_size - 16 : src_size;
+}
+FX_BOOL CPDF_StandardCryptoHandler::Init(CPDF_Dictionary* pEncryptDict, CPDF_SecurityHandler* pSecurityHandler)
+{
+ FX_LPCBYTE key;
+ if (!pSecurityHandler->GetCryptInfo(m_Cipher, key, m_KeyLen)) {
+ return FALSE;
+ }
+ if (m_KeyLen > 32 || m_KeyLen < 0) {
+ return FALSE;
+ }
+ if (m_Cipher != FXCIPHER_NONE) {
+ FXSYS_memcpy32(m_EncryptKey, key, m_KeyLen);
+ }
+ if (m_Cipher == FXCIPHER_AES) {
+ m_pAESContext = FX_Alloc(FX_BYTE, 2048);
+ }
+ return TRUE;
+}
+FX_BOOL CPDF_StandardCryptoHandler::Init(int cipher, FX_LPCBYTE key, int keylen)
+{
+ if (cipher == FXCIPHER_AES) {
+ switch(keylen) {
+ case 16:
+ case 24:
+ case 32:
+ break;
+ default:
+ return FALSE;
+ }
+ } else if (cipher == FXCIPHER_AES2) {
+ if (keylen != 32) {
+ return FALSE;
+ }
+ } else if (cipher == FXCIPHER_RC4) {
+ if (keylen < 5 || keylen > 16) {
+ return FALSE;
+ }
+ } else {
+ if (keylen > 32) {
+ keylen = 32;
+ }
+ }
+ m_Cipher = cipher;
+ m_KeyLen = keylen;
+ FXSYS_memcpy32(m_EncryptKey, key, keylen);
+ if (m_Cipher == FXCIPHER_AES) {
+ m_pAESContext = FX_Alloc(FX_BYTE, 2048);
+ }
+ return TRUE;
+}
+FX_BOOL CPDF_StandardCryptoHandler::DecryptStream(FX_LPVOID context, FX_LPCBYTE src_buf, FX_DWORD src_size,
+ CFX_BinaryBuf& dest_buf)
+{
+ return CryptStream(context, src_buf, src_size, dest_buf, FALSE);
+}
+FX_BOOL CPDF_StandardCryptoHandler::DecryptFinish(FX_LPVOID context, CFX_BinaryBuf& dest_buf)
+{
+ return CryptFinish(context, dest_buf, FALSE);
+}
+FX_DWORD CPDF_StandardCryptoHandler::EncryptGetSize(FX_DWORD objnum, FX_DWORD version, FX_LPCBYTE src_buf, FX_DWORD src_size)
+{
+ if (m_Cipher == FXCIPHER_AES) {
+ return src_size + 32;
+ }
+ return src_size;
+}
+FX_BOOL CPDF_StandardCryptoHandler::EncryptContent(FX_DWORD objnum, FX_DWORD gennum, FX_LPCBYTE src_buf, FX_DWORD src_size,
+ FX_LPBYTE dest_buf, FX_DWORD& dest_size)
+{
+ CryptBlock(TRUE, objnum, gennum, src_buf, src_size, dest_buf, dest_size);
+ return TRUE;
+}
+void CPDF_CryptoHandler::Decrypt(FX_DWORD objnum, FX_DWORD gennum, CFX_ByteString& str)
+{
+ CFX_BinaryBuf dest_buf;
+ FX_LPVOID context = DecryptStart(objnum, gennum);
+ DecryptStream(context, (FX_LPCBYTE)str, str.GetLength(), dest_buf);
+ DecryptFinish(context, dest_buf);
+ str = dest_buf;
+}
+CPDF_StandardCryptoHandler::CPDF_StandardCryptoHandler()
+{
+ m_pAESContext = NULL;
+ m_Cipher = FXCIPHER_NONE;
+ m_KeyLen = 0;
+}
+CPDF_StandardCryptoHandler::~CPDF_StandardCryptoHandler()
+{
+ if (m_pAESContext) {
+ FX_Free(m_pAESContext);
+ }
+}
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_fdf.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_fdf.cpp
index 22f9aa713f..36cc9db754 100644
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_fdf.cpp
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_fdf.cpp
@@ -1,224 +1,224 @@
-// 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
-
-#include "../../../include/fpdfapi/fpdf_serial.h"
-CFDF_Document::CFDF_Document() : CPDF_IndirectObjects(NULL)
-{
- m_pRootDict = NULL;
- m_pFile = NULL;
- m_bOwnFile = FALSE;
-}
-CFDF_Document::~CFDF_Document()
-{
- if (m_bOwnFile && m_pFile) {
- m_pFile->Release();
- }
-}
-CFDF_Document* CFDF_Document::CreateNewDoc()
-{
- CFDF_Document* pDoc = FX_NEW CFDF_Document;
- pDoc->m_pRootDict = FX_NEW CPDF_Dictionary;
- pDoc->AddIndirectObject(pDoc->m_pRootDict);
- CPDF_Dictionary* pFDFDict = FX_NEW CPDF_Dictionary;
- pDoc->m_pRootDict->SetAt(FX_BSTRC("FDF"), pFDFDict);
- return pDoc;
-}
-CFDF_Document* CFDF_Document::ParseFile(FX_LPCSTR file_path)
-{
- return CFDF_Document::ParseFile(FX_CreateFileRead(file_path), TRUE);
-}
-CFDF_Document* CFDF_Document::ParseFile(FX_LPCWSTR file_path)
-{
- return CFDF_Document::ParseFile(FX_CreateFileRead(file_path), TRUE);
-}
-CFDF_Document* CFDF_Document::ParseFile(IFX_FileRead *pFile, FX_BOOL bOwnFile)
-{
- if (!pFile) {
- return NULL;
- }
- CFDF_Document* pDoc = FX_NEW CFDF_Document;
- pDoc->ParseStream(pFile, bOwnFile);
- if (pDoc->m_pRootDict == NULL) {
- delete pDoc;
- return NULL;
- }
- return pDoc;
-}
-CFDF_Document* CFDF_Document::ParseMemory(FX_LPCBYTE pData, FX_DWORD size)
-{
- return CFDF_Document::ParseFile(FX_CreateMemoryStream((FX_LPBYTE)pData, size), TRUE);
-}
-void CFDF_Document::ParseStream(IFX_FileRead *pFile, FX_BOOL bOwnFile)
-{
- m_pFile = pFile;
- m_bOwnFile = bOwnFile;
- CPDF_SyntaxParser parser;
- parser.InitParser(m_pFile, 0);
- while (1) {
- FX_BOOL bNumber;
- CFX_ByteString word = parser.GetNextWord(bNumber);
- if (bNumber) {
- FX_DWORD objnum = FXSYS_atoi(word);
- word = parser.GetNextWord(bNumber);
- if (!bNumber) {
- break;
- }
- word = parser.GetNextWord(bNumber);
- if (word != FX_BSTRC("obj")) {
- break;
- }
- CPDF_Object* pObj = parser.GetObject(this, objnum, 0, FALSE);
- if (pObj == NULL) {
- break;
- }
- InsertIndirectObject(objnum, pObj);
- word = parser.GetNextWord(bNumber);
- if (word != FX_BSTRC("endobj")) {
- break;
- }
- } else {
- if (word != FX_BSTRC("trailer")) {
- break;
- }
- CPDF_Dictionary* pMainDict = (CPDF_Dictionary*)parser.GetObject(this, 0, 0, 0);
- if (pMainDict == NULL || pMainDict->GetType() != PDFOBJ_DICTIONARY) {
- break;
- }
- m_pRootDict = pMainDict->GetDict(FX_BSTRC("Root"));
- pMainDict->Release();
- break;
- }
- }
-}
-FX_BOOL CFDF_Document::WriteBuf(CFX_ByteTextBuf& buf) const
-{
- if (m_pRootDict == NULL) {
- return FALSE;
- }
- buf << FX_BSTRC("%FDF-1.2\r\n");
- FX_POSITION pos = m_IndirectObjs.GetStartPosition();
- while(pos) {
- size_t objnum;
- CPDF_Object* pObj;
- m_IndirectObjs.GetNextAssoc(pos, (FX_LPVOID&)objnum, (FX_LPVOID&)pObj);
- buf << (FX_DWORD)objnum << FX_BSTRC(" 0 obj\r\n") << pObj << FX_BSTRC("\r\nendobj\r\n\r\n");
- }
- buf << FX_BSTRC("trailer\r\n<</Root ") << m_pRootDict->GetObjNum() << FX_BSTRC(" 0 R>>\r\n%%EOF\r\n");
- return TRUE;
-}
-CFX_WideString CFDF_Document::GetWin32Path() const
-{
- CPDF_Object* pFileSpec = m_pRootDict->GetDict(FX_BSTRC("FDF"))->GetElementValue(FX_BSTRC("F"));
- if (pFileSpec == NULL) {
- return CFX_WideString();
- }
- if (pFileSpec->GetType() == PDFOBJ_STRING) {
- return FPDF_FileSpec_GetWin32Path(m_pRootDict->GetDict(FX_BSTRC("FDF")));
- }
- return FPDF_FileSpec_GetWin32Path(pFileSpec);
-}
-FX_BOOL CFDF_Document::WriteFile(FX_LPCSTR file_path) const
-{
- IFX_FileWrite *pFile = FX_CreateFileWrite(file_path);
- if (!pFile) {
- return FALSE;
- }
- FX_BOOL bRet = WriteFile(pFile);
- pFile->Release();
- return bRet;
-}
-FX_BOOL CFDF_Document::WriteFile(FX_LPCWSTR file_path) const
-{
- IFX_FileWrite *pFile = FX_CreateFileWrite(file_path);
- if (!pFile) {
- return FALSE;
- }
- FX_BOOL bRet = WriteFile(pFile);
- pFile->Release();
- return bRet;
-}
-FX_BOOL CFDF_Document::WriteFile(IFX_FileWrite *pFile) const
-{
- CFX_ByteTextBuf buf;
- WriteBuf(buf);
- FX_BOOL bRet = pFile->WriteBlock(buf.GetBuffer(), buf.GetSize());
- if (bRet) {
- pFile->Flush();
- }
- return bRet;
-}
-static CFX_WideString ChangeSlash(FX_LPCWSTR str)
-{
- CFX_WideString result;
- while (*str) {
- if (*str == '\\') {
- result += '/';
- } else if (*str == '/') {
- result += '\\';
- } else {
- result += *str;
- }
- str ++;
- }
- return result;
-}
-void FPDF_FileSpec_SetWin32Path(CPDF_Object* pFileSpec, const CFX_WideString& filepath)
-{
- CFX_WideString result;
- if (filepath.GetLength() > 1 && filepath[1] == ':') {
- result = L"/";
- result += filepath[0];
- if (filepath[2] != '\\') {
- result += '/';
- }
- result += ChangeSlash((FX_LPCWSTR)filepath + 2);
- } else if (filepath.GetLength() > 1 && filepath[0] == '\\' && filepath[1] == '\\') {
- result = ChangeSlash((FX_LPCWSTR)filepath + 1);
- } else {
- result = ChangeSlash(filepath);
- }
- if (pFileSpec->GetType() == PDFOBJ_STRING) {
- pFileSpec->SetString(CFX_ByteString::FromUnicode(result));
- } else if (pFileSpec->GetType() == PDFOBJ_DICTIONARY) {
- ((CPDF_Dictionary*)pFileSpec)->SetAtString(FX_BSTRC("F"), CFX_ByteString::FromUnicode(result));
- ((CPDF_Dictionary*)pFileSpec)->SetAtString(FX_BSTRC("UF"), PDF_EncodeText(result));
- ((CPDF_Dictionary*)pFileSpec)->RemoveAt(FX_BSTRC("FS"));
- }
-}
-CFX_WideString FPDF_FileSpec_GetWin32Path(const CPDF_Object* pFileSpec)
-{
- CFX_WideString wsFileName;
- if (pFileSpec->GetType() == PDFOBJ_DICTIONARY) {
- CPDF_Dictionary* pDict = (CPDF_Dictionary*)pFileSpec;
- wsFileName = pDict->GetUnicodeText(FX_BSTRC("UF"));
- if (wsFileName.IsEmpty()) {
- wsFileName = CFX_WideString::FromLocal(pDict->GetString(FX_BSTRC("F")));
- }
- if (pDict->GetString(FX_BSTRC("FS")) == FX_BSTRC("URL")) {
- return wsFileName;
- }
- if (wsFileName.IsEmpty() && pDict->KeyExist(FX_BSTRC("DOS"))) {
- wsFileName = CFX_WideString::FromLocal(pDict->GetString(FX_BSTRC("DOS")));
- }
- } else {
- wsFileName = CFX_WideString::FromLocal(pFileSpec->GetString());
- }
- if (wsFileName[0] != '/') {
- return ChangeSlash(wsFileName);
- }
- if (wsFileName[2] == '/') {
- CFX_WideString result;
- result += wsFileName[1];
- result += ':';
- result += ChangeSlash(((FX_LPCWSTR)wsFileName) + 2);
- return result;
- } else {
- CFX_WideString result;
- result += '\\';
- result += ChangeSlash(wsFileName);
- return result;
- }
-}
+// 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
+
+#include "../../../include/fpdfapi/fpdf_serial.h"
+CFDF_Document::CFDF_Document() : CPDF_IndirectObjects(NULL)
+{
+ m_pRootDict = NULL;
+ m_pFile = NULL;
+ m_bOwnFile = FALSE;
+}
+CFDF_Document::~CFDF_Document()
+{
+ if (m_bOwnFile && m_pFile) {
+ m_pFile->Release();
+ }
+}
+CFDF_Document* CFDF_Document::CreateNewDoc()
+{
+ CFDF_Document* pDoc = FX_NEW CFDF_Document;
+ pDoc->m_pRootDict = FX_NEW CPDF_Dictionary;
+ pDoc->AddIndirectObject(pDoc->m_pRootDict);
+ CPDF_Dictionary* pFDFDict = FX_NEW CPDF_Dictionary;
+ pDoc->m_pRootDict->SetAt(FX_BSTRC("FDF"), pFDFDict);
+ return pDoc;
+}
+CFDF_Document* CFDF_Document::ParseFile(FX_LPCSTR file_path)
+{
+ return CFDF_Document::ParseFile(FX_CreateFileRead(file_path), TRUE);
+}
+CFDF_Document* CFDF_Document::ParseFile(FX_LPCWSTR file_path)
+{
+ return CFDF_Document::ParseFile(FX_CreateFileRead(file_path), TRUE);
+}
+CFDF_Document* CFDF_Document::ParseFile(IFX_FileRead *pFile, FX_BOOL bOwnFile)
+{
+ if (!pFile) {
+ return NULL;
+ }
+ CFDF_Document* pDoc = FX_NEW CFDF_Document;
+ pDoc->ParseStream(pFile, bOwnFile);
+ if (pDoc->m_pRootDict == NULL) {
+ delete pDoc;
+ return NULL;
+ }
+ return pDoc;
+}
+CFDF_Document* CFDF_Document::ParseMemory(FX_LPCBYTE pData, FX_DWORD size)
+{
+ return CFDF_Document::ParseFile(FX_CreateMemoryStream((FX_LPBYTE)pData, size), TRUE);
+}
+void CFDF_Document::ParseStream(IFX_FileRead *pFile, FX_BOOL bOwnFile)
+{
+ m_pFile = pFile;
+ m_bOwnFile = bOwnFile;
+ CPDF_SyntaxParser parser;
+ parser.InitParser(m_pFile, 0);
+ while (1) {
+ FX_BOOL bNumber;
+ CFX_ByteString word = parser.GetNextWord(bNumber);
+ if (bNumber) {
+ FX_DWORD objnum = FXSYS_atoi(word);
+ word = parser.GetNextWord(bNumber);
+ if (!bNumber) {
+ break;
+ }
+ word = parser.GetNextWord(bNumber);
+ if (word != FX_BSTRC("obj")) {
+ break;
+ }
+ CPDF_Object* pObj = parser.GetObject(this, objnum, 0, FALSE);
+ if (pObj == NULL) {
+ break;
+ }
+ InsertIndirectObject(objnum, pObj);
+ word = parser.GetNextWord(bNumber);
+ if (word != FX_BSTRC("endobj")) {
+ break;
+ }
+ } else {
+ if (word != FX_BSTRC("trailer")) {
+ break;
+ }
+ CPDF_Dictionary* pMainDict = (CPDF_Dictionary*)parser.GetObject(this, 0, 0, 0);
+ if (pMainDict == NULL || pMainDict->GetType() != PDFOBJ_DICTIONARY) {
+ break;
+ }
+ m_pRootDict = pMainDict->GetDict(FX_BSTRC("Root"));
+ pMainDict->Release();
+ break;
+ }
+ }
+}
+FX_BOOL CFDF_Document::WriteBuf(CFX_ByteTextBuf& buf) const
+{
+ if (m_pRootDict == NULL) {
+ return FALSE;
+ }
+ buf << FX_BSTRC("%FDF-1.2\r\n");
+ FX_POSITION pos = m_IndirectObjs.GetStartPosition();
+ while(pos) {
+ size_t objnum;
+ CPDF_Object* pObj;
+ m_IndirectObjs.GetNextAssoc(pos, (FX_LPVOID&)objnum, (FX_LPVOID&)pObj);
+ buf << (FX_DWORD)objnum << FX_BSTRC(" 0 obj\r\n") << pObj << FX_BSTRC("\r\nendobj\r\n\r\n");
+ }
+ buf << FX_BSTRC("trailer\r\n<</Root ") << m_pRootDict->GetObjNum() << FX_BSTRC(" 0 R>>\r\n%%EOF\r\n");
+ return TRUE;
+}
+CFX_WideString CFDF_Document::GetWin32Path() const
+{
+ CPDF_Object* pFileSpec = m_pRootDict->GetDict(FX_BSTRC("FDF"))->GetElementValue(FX_BSTRC("F"));
+ if (pFileSpec == NULL) {
+ return CFX_WideString();
+ }
+ if (pFileSpec->GetType() == PDFOBJ_STRING) {
+ return FPDF_FileSpec_GetWin32Path(m_pRootDict->GetDict(FX_BSTRC("FDF")));
+ }
+ return FPDF_FileSpec_GetWin32Path(pFileSpec);
+}
+FX_BOOL CFDF_Document::WriteFile(FX_LPCSTR file_path) const
+{
+ IFX_FileWrite *pFile = FX_CreateFileWrite(file_path);
+ if (!pFile) {
+ return FALSE;
+ }
+ FX_BOOL bRet = WriteFile(pFile);
+ pFile->Release();
+ return bRet;
+}
+FX_BOOL CFDF_Document::WriteFile(FX_LPCWSTR file_path) const
+{
+ IFX_FileWrite *pFile = FX_CreateFileWrite(file_path);
+ if (!pFile) {
+ return FALSE;
+ }
+ FX_BOOL bRet = WriteFile(pFile);
+ pFile->Release();
+ return bRet;
+}
+FX_BOOL CFDF_Document::WriteFile(IFX_FileWrite *pFile) const
+{
+ CFX_ByteTextBuf buf;
+ WriteBuf(buf);
+ FX_BOOL bRet = pFile->WriteBlock(buf.GetBuffer(), buf.GetSize());
+ if (bRet) {
+ pFile->Flush();
+ }
+ return bRet;
+}
+static CFX_WideString ChangeSlash(FX_LPCWSTR str)
+{
+ CFX_WideString result;
+ while (*str) {
+ if (*str == '\\') {
+ result += '/';
+ } else if (*str == '/') {
+ result += '\\';
+ } else {
+ result += *str;
+ }
+ str ++;
+ }
+ return result;
+}
+void FPDF_FileSpec_SetWin32Path(CPDF_Object* pFileSpec, const CFX_WideString& filepath)
+{
+ CFX_WideString result;
+ if (filepath.GetLength() > 1 && filepath[1] == ':') {
+ result = L"/";
+ result += filepath[0];
+ if (filepath[2] != '\\') {
+ result += '/';
+ }
+ result += ChangeSlash((FX_LPCWSTR)filepath + 2);
+ } else if (filepath.GetLength() > 1 && filepath[0] == '\\' && filepath[1] == '\\') {
+ result = ChangeSlash((FX_LPCWSTR)filepath + 1);
+ } else {
+ result = ChangeSlash(filepath);
+ }
+ if (pFileSpec->GetType() == PDFOBJ_STRING) {
+ pFileSpec->SetString(CFX_ByteString::FromUnicode(result));
+ } else if (pFileSpec->GetType() == PDFOBJ_DICTIONARY) {
+ ((CPDF_Dictionary*)pFileSpec)->SetAtString(FX_BSTRC("F"), CFX_ByteString::FromUnicode(result));
+ ((CPDF_Dictionary*)pFileSpec)->SetAtString(FX_BSTRC("UF"), PDF_EncodeText(result));
+ ((CPDF_Dictionary*)pFileSpec)->RemoveAt(FX_BSTRC("FS"));
+ }
+}
+CFX_WideString FPDF_FileSpec_GetWin32Path(const CPDF_Object* pFileSpec)
+{
+ CFX_WideString wsFileName;
+ if (pFileSpec->GetType() == PDFOBJ_DICTIONARY) {
+ CPDF_Dictionary* pDict = (CPDF_Dictionary*)pFileSpec;
+ wsFileName = pDict->GetUnicodeText(FX_BSTRC("UF"));
+ if (wsFileName.IsEmpty()) {
+ wsFileName = CFX_WideString::FromLocal(pDict->GetString(FX_BSTRC("F")));
+ }
+ if (pDict->GetString(FX_BSTRC("FS")) == FX_BSTRC("URL")) {
+ return wsFileName;
+ }
+ if (wsFileName.IsEmpty() && pDict->KeyExist(FX_BSTRC("DOS"))) {
+ wsFileName = CFX_WideString::FromLocal(pDict->GetString(FX_BSTRC("DOS")));
+ }
+ } else {
+ wsFileName = CFX_WideString::FromLocal(pFileSpec->GetString());
+ }
+ if (wsFileName[0] != '/') {
+ return ChangeSlash(wsFileName);
+ }
+ if (wsFileName[2] == '/') {
+ CFX_WideString result;
+ result += wsFileName[1];
+ result += ':';
+ result += ChangeSlash(((FX_LPCWSTR)wsFileName) + 2);
+ return result;
+ } else {
+ CFX_WideString result;
+ result += '\\';
+ result += ChangeSlash(wsFileName);
+ return result;
+ }
+}
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_filters.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_filters.cpp
index 76a79f69cb..1e4e1570df 100644
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_filters.cpp
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_filters.cpp
@@ -1,909 +1,909 @@
-// 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
-
-#include "../../fx_zlib.h"
-#include "../../../include/fpdfapi/fpdf_parser.h"
-#include "../../../include/fxcodec/fx_codec.h"
-#include "../../../include/fpdfapi/fpdf_module.h"
-#include "filters_int.h"
-CFX_DataFilter::CFX_DataFilter()
-{
- m_bEOF = FALSE;
- m_pDestFilter = NULL;
- m_SrcPos = 0;
-}
-CFX_DataFilter::~CFX_DataFilter()
-{
- if (m_pDestFilter) {
- delete m_pDestFilter;
- }
-}
-void CFX_DataFilter::SetDestFilter(CFX_DataFilter* pFilter)
-{
- if (m_pDestFilter) {
- m_pDestFilter->SetDestFilter(pFilter);
- } else {
- m_pDestFilter = pFilter;
- }
-}
-void CFX_DataFilter::FilterIn(FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf)
-{
- if (m_bEOF) {
- return;
- }
- m_SrcPos += src_size;
- if (m_pDestFilter) {
- CFX_BinaryBuf temp_buf;
- temp_buf.EstimateSize(FPDF_FILTER_BUFFER_SIZE, FPDF_FILTER_BUFFER_SIZE);
- v_FilterIn(src_buf, src_size, temp_buf);
- m_pDestFilter->FilterIn(temp_buf.GetBuffer(), temp_buf.GetSize(), dest_buf);
- } else {
- v_FilterIn(src_buf, src_size, dest_buf);
- }
-}
-void CFX_DataFilter::FilterFinish(CFX_BinaryBuf& dest_buf)
-{
- if (m_pDestFilter) {
- CFX_BinaryBuf temp_buf;
- v_FilterFinish(temp_buf);
- if (temp_buf.GetSize()) {
- m_pDestFilter->FilterIn(temp_buf.GetBuffer(), temp_buf.GetSize(), dest_buf);
- }
- m_pDestFilter->FilterFinish(dest_buf);
- } else {
- v_FilterFinish(dest_buf);
- }
- m_bEOF = TRUE;
-}
-void CFX_DataFilter::ReportEOF(FX_DWORD left_input)
-{
- if (m_bEOF) {
- return;
- }
- m_bEOF = TRUE;
- m_SrcPos -= left_input;
-}
-CFX_DataFilter* FPDF_CreateFilter(FX_BSTR name, const CPDF_Dictionary* pParam, int width, int height)
-{
- FX_DWORD id = name.GetID();
- switch (id) {
- case FXBSTR_ID('F', 'l', 'a', 't'):
- case FXBSTR_ID('F', 'l', 0, 0):
- case FXBSTR_ID('L', 'Z', 'W', 'D'):
- case FXBSTR_ID('L', 'Z', 'W', 0): {
- CFX_DataFilter* pFilter;
- if (id == FXBSTR_ID('L', 'Z', 'W', 'D') || id == FXBSTR_ID('L', 'Z', 'W', 0)) {
- pFilter = FX_NEW CPDF_LzwFilter(pParam->GetInteger("EarlyChange", 1));
- } else {
- pFilter = FX_NEW CPDF_FlateFilter;
- }
- if (pParam->GetInteger("Predictor", 1) > 1) {
- CFX_DataFilter* pPredictor = FX_NEW CPDF_PredictorFilter(pParam->GetInteger(FX_BSTRC("Predictor"), 1),
- pParam->GetInteger(FX_BSTRC("Colors"), 1), pParam->GetInteger(FX_BSTRC("BitsPerComponent"), 8),
- pParam->GetInteger(FX_BSTRC("Columns"), 1));
- pFilter->SetDestFilter(pPredictor);
- }
- return pFilter;
- }
- case FXBSTR_ID('A', 'S', 'C', 'I'):
- if (name == "ASCIIHexDecode") {
- return FX_NEW CPDF_AsciiHexFilter;
- }
- return FX_NEW CPDF_Ascii85Filter;
- case FXBSTR_ID('A', 'H', 'x', 0):
- return FX_NEW CPDF_AsciiHexFilter;
- case FXBSTR_ID('A', '8', '5', 0):
- return FX_NEW CPDF_Ascii85Filter;
- case FXBSTR_ID('R', 'u', 'n', 'L'):
- return FX_NEW CPDF_RunLenFilter;
- case FXBSTR_ID('C', 'C', 'I', 'T'): {
- int Encoding = 0;
- int bEndOfLine = FALSE;
- int bByteAlign = FALSE;
- int bBlack = FALSE;
- int nRows = 0;
- int nColumns = 1728;
- if (pParam) {
- Encoding = pParam->GetInteger(FX_BSTRC("K"));
- bEndOfLine = pParam->GetInteger(FX_BSTRC("EndOfLine"));
- bByteAlign = pParam->GetInteger(FX_BSTRC("EncodedByteAlign"));
- bBlack = pParam->GetInteger(FX_BSTRC("BlackIs1"));
- nColumns = pParam->GetInteger(FX_BSTRC("Columns"), 1728);
- nRows = pParam->GetInteger(FX_BSTRC("Rows"));
- }
- if (nColumns == 0) {
- nColumns = width;
- }
- if (nRows == 0) {
- nRows = height;
- }
- CPDF_FaxFilter* pFilter = FX_NEW CPDF_FaxFilter();
- pFilter->Initialize(Encoding, bEndOfLine, bByteAlign, bBlack, nRows, nColumns);
- return pFilter;
- }
- case FXBSTR_ID('D', 'C', 'T', 'D'):
- return FX_NEW CPDF_JpegFilter;
- default:
- return NULL;
- }
-}
-CFX_DataFilter* _FPDF_CreateFilterFromDict(CPDF_Dictionary* pDict)
-{
- CPDF_Object* pDecoder = pDict->GetElementValue("Filter");
- if (pDecoder == NULL) {
- return NULL;
- }
- CFX_DataFilter* pFirstFilter = NULL;
- int width = pDict->GetInteger(FX_BSTRC("Width")), height = pDict->GetInteger(FX_BSTRC("Height"));
- CPDF_Object* pParams = pDict->GetElementValue("DecodeParms");
- if (pDecoder->GetType() == PDFOBJ_ARRAY) {
- if (pParams && pParams->GetType() != PDFOBJ_ARRAY) {
- pParams = NULL;
- }
- for (FX_DWORD i = 0; i < ((CPDF_Array*)pDecoder)->GetCount(); i ++) {
- CFX_ByteString name = ((CPDF_Array*)pDecoder)->GetString(i);
- CPDF_Dictionary* pParam = NULL;
- if (pParams) {
- pParam = ((CPDF_Array*)pParams)->GetDict(i);
- }
- CFX_DataFilter* pDestFilter = FPDF_CreateFilter(name, pParam, width, height);
- if (pDestFilter) {
- if (pFirstFilter == NULL) {
- pFirstFilter = pDestFilter;
- } else {
- pFirstFilter->SetDestFilter(pDestFilter);
- }
- }
- }
- } else {
- if (pParams && pParams->GetType() != PDFOBJ_DICTIONARY) {
- pParams = NULL;
- }
- pFirstFilter = FPDF_CreateFilter(pDecoder->GetString(), (CPDF_Dictionary*)pParams, width, height);
- }
- return pFirstFilter;
-}
-CPDF_StreamFilter* CPDF_Stream::GetStreamFilter(FX_BOOL bRaw) const
-{
- CFX_DataFilter* pFirstFilter = NULL;
- if (m_pCryptoHandler) {
- pFirstFilter = FX_NEW CPDF_DecryptFilter(m_pCryptoHandler, m_ObjNum, m_GenNum);
- }
- if (!bRaw) {
- CFX_DataFilter* pFilter = _FPDF_CreateFilterFromDict(m_pDict);
- if (pFilter) {
- if (pFirstFilter == NULL) {
- pFirstFilter = pFilter;
- } else {
- pFirstFilter->SetDestFilter(pFilter);
- }
- }
- }
- CPDF_StreamFilter* pStreamFilter = FX_NEW CPDF_StreamFilter;
- pStreamFilter->m_pStream = this;
- pStreamFilter->m_pFilter = pFirstFilter;
- pStreamFilter->m_pBuffer = NULL;
- pStreamFilter->m_SrcOffset = 0;
- return pStreamFilter;
-}
-CPDF_StreamFilter::~CPDF_StreamFilter()
-{
- if (m_pFilter) {
- delete m_pFilter;
- }
- if (m_pBuffer) {
- delete m_pBuffer;
- }
-}
-#define FPDF_FILTER_BUFFER_IN_SIZE FPDF_FILTER_BUFFER_SIZE
-FX_DWORD CPDF_StreamFilter::ReadBlock(FX_LPBYTE buffer, FX_DWORD buf_size)
-{
- if (m_pFilter == NULL) {
- FX_DWORD read_size = m_pStream->GetRawSize() - m_SrcOffset;
- if (read_size == 0) {
- return 0;
- }
- if (read_size > buf_size) {
- read_size = buf_size;
- }
- m_pStream->ReadRawData(m_SrcOffset, buffer, read_size);
- m_SrcOffset += read_size;
- return read_size;
- }
- FX_DWORD read_size = 0;
- if (m_pBuffer) {
- read_size = ReadLeftOver(buffer, buf_size);
- if (read_size == buf_size) {
- return read_size;
- }
- buffer += read_size;
- buf_size -= read_size;
- }
- ASSERT(m_pBuffer == NULL);
- if (m_pFilter->IsEOF()) {
- return read_size;
- }
- m_pBuffer = FX_NEW CFX_BinaryBuf;
- m_pBuffer->EstimateSize(FPDF_FILTER_BUFFER_SIZE, FPDF_FILTER_BUFFER_SIZE);
- m_BufOffset = 0;
- while (1) {
- int src_size = m_pStream->GetRawSize() - m_SrcOffset;
- if (src_size == 0) {
- m_pFilter->FilterFinish(*m_pBuffer);
- break;
- }
- if (src_size > FPDF_FILTER_BUFFER_IN_SIZE) {
- src_size = FPDF_FILTER_BUFFER_IN_SIZE;
- }
- if (!m_pStream->ReadRawData(m_SrcOffset, m_SrcBuffer, src_size)) {
- return 0;
- }
- m_SrcOffset += src_size;
- m_pFilter->FilterIn(m_SrcBuffer, src_size, *m_pBuffer);
- if (m_pBuffer->GetSize() >= (int)buf_size) {
- break;
- }
- }
- return read_size + ReadLeftOver(buffer, buf_size);
-}
-FX_DWORD CPDF_StreamFilter::ReadLeftOver(FX_LPBYTE buffer, FX_DWORD buf_size)
-{
- FX_DWORD read_size = m_pBuffer->GetSize() - m_BufOffset;
- if (read_size > buf_size) {
- read_size = buf_size;
- }
- FXSYS_memcpy32(buffer, m_pBuffer->GetBuffer() + m_BufOffset, read_size);
- m_BufOffset += read_size;
- if (m_BufOffset == (FX_DWORD)m_pBuffer->GetSize()) {
- delete m_pBuffer;
- m_pBuffer = NULL;
- }
- return read_size;
-}
-CPDF_DecryptFilter::CPDF_DecryptFilter(CPDF_CryptoHandler* pCryptoHandler, FX_DWORD objnum, FX_DWORD gennum)
-{
- m_pCryptoHandler = pCryptoHandler;
- m_pContext = NULL;
- m_ObjNum = objnum;
- m_GenNum = gennum;
-}
-CPDF_DecryptFilter::~CPDF_DecryptFilter()
-{
- CFX_BinaryBuf buf;
- if (m_pContext) {
- m_pCryptoHandler->DecryptFinish(m_pContext, buf);
- }
-}
-void CPDF_DecryptFilter::v_FilterIn(FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf)
-{
- if (m_pContext == NULL) {
- m_pContext = m_pCryptoHandler->DecryptStart(m_ObjNum, m_GenNum);
- }
- m_pCryptoHandler->DecryptStream(m_pContext, src_buf, src_size, dest_buf);
-}
-void CPDF_DecryptFilter::v_FilterFinish(CFX_BinaryBuf& dest_buf)
-{
- m_bEOF = TRUE;
- if (m_pContext == NULL) {
- return;
- }
- m_pCryptoHandler->DecryptFinish(m_pContext, dest_buf);
- m_pContext = NULL;
-}
-extern "C" {
- static void* my_alloc_func (void* opaque, unsigned int items, unsigned int size)
- {
- return FX_Alloc(FX_BYTE, items * size);
- }
- static void my_free_func (void* opaque, void* address)
- {
- FX_Free(address);
- }
- void* FPDFAPI_FlateInit(void* (*alloc_func)(void*, unsigned int, unsigned int),
- void (*free_func)(void*, void*));
- void FPDFAPI_FlateInput(void* context, const unsigned char* src_buf, unsigned int src_size);
- int FPDFAPI_FlateOutput(void* context, unsigned char* dest_buf, unsigned int dest_size);
- int FPDFAPI_FlateGetAvailIn(void* context);
- int FPDFAPI_FlateGetAvailOut(void* context);
- void FPDFAPI_FlateEnd(void* context);
-}
-CPDF_FlateFilter::CPDF_FlateFilter()
-{
- m_pContext = NULL;
-}
-CPDF_FlateFilter::~CPDF_FlateFilter()
-{
- if (m_pContext) {
- FPDFAPI_FlateEnd(m_pContext);
- }
-}
-void CPDF_FlateFilter::v_FilterIn(FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf)
-{
- if (m_pContext == NULL) {
- m_pContext = FPDFAPI_FlateInit(my_alloc_func, my_free_func);
- }
- FPDFAPI_FlateInput(m_pContext, src_buf, src_size);
- while (1) {
- int ret = FPDFAPI_FlateOutput(m_pContext, m_DestBuffer, FPDF_FILTER_BUFFER_SIZE);
- int out_size = FPDF_FILTER_BUFFER_SIZE - FPDFAPI_FlateGetAvailOut(m_pContext);
- dest_buf.AppendBlock(m_DestBuffer, out_size);
- if (ret == Z_BUF_ERROR) {
- break;
- }
- if (ret != Z_OK) {
- ReportEOF(FPDFAPI_FlateGetAvailIn(m_pContext));
- break;
- }
- }
-}
-CPDF_LzwFilter::CPDF_LzwFilter(FX_BOOL bEarlyChange)
-{
- m_bEarlyChange = bEarlyChange ? 1 : 0;
- m_CodeLen = 9;
- m_nCodes = 0;
- m_nLeftBits = 0;
- m_LeftBits = 0;
- m_OldCode = (FX_DWORD) - 1;
-}
-void CPDF_LzwFilter::v_FilterIn(FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf)
-{
- for (FX_DWORD i = 0; i < src_size; i ++) {
- if (m_nLeftBits + 8 < m_CodeLen) {
- m_nLeftBits += 8;
- m_LeftBits = (m_LeftBits << 8) | src_buf[i];
- continue;
- }
- FX_DWORD new_bits = m_CodeLen - m_nLeftBits;
- FX_DWORD code = (m_LeftBits << new_bits) | (src_buf[i] >> (8 - new_bits));
- m_nLeftBits = 8 - new_bits;
- m_LeftBits = src_buf[i] % (1 << m_nLeftBits);
- if (code < 256) {
- dest_buf.AppendByte((FX_BYTE)code);
- m_LastChar = (FX_BYTE)code;
- if (m_OldCode != -1) {
- AddCode(m_OldCode, m_LastChar);
- }
- m_OldCode = code;
- } else if (code == 256) {
- m_CodeLen = 9;
- m_nCodes = 0;
- m_OldCode = (FX_DWORD) - 1;
- } else if (code == 257) {
- ReportEOF(src_size - i - 1);
- return;
- } else {
- if (m_OldCode == -1) {
- ReportEOF(src_size - i - 1);
- return;
- }
- m_StackLen = 0;
- if (code >= m_nCodes + 258) {
- if (m_StackLen < sizeof(m_DecodeStack)) {
- m_DecodeStack[m_StackLen++] = m_LastChar;
- }
- DecodeString(m_OldCode);
- } else {
- DecodeString(code);
- }
- dest_buf.AppendBlock(NULL, m_StackLen);
- FX_LPBYTE pOutput = dest_buf.GetBuffer() + dest_buf.GetSize() - m_StackLen;
- for (FX_DWORD cc = 0; cc < m_StackLen; cc ++) {
- pOutput[cc] = m_DecodeStack[m_StackLen - cc - 1];
- }
- m_LastChar = m_DecodeStack[m_StackLen - 1];
- if (m_OldCode < 256) {
- AddCode(m_OldCode, m_LastChar);
- } else if (m_OldCode - 258 >= m_nCodes) {
- ReportEOF(src_size - i - 1);
- return;
- } else {
- AddCode(m_OldCode, m_LastChar);
- }
- m_OldCode = code;
- }
- }
-}
-void CPDF_LzwFilter::AddCode(FX_DWORD prefix_code, FX_BYTE append_char)
-{
- if (m_nCodes + m_bEarlyChange == 4094) {
- return;
- }
- m_CodeArray[m_nCodes ++] = (prefix_code << 16) | append_char;
- if (m_nCodes + m_bEarlyChange == 512 - 258) {
- m_CodeLen = 10;
- } else if (m_nCodes + m_bEarlyChange == 1024 - 258) {
- m_CodeLen = 11;
- } else if (m_nCodes + m_bEarlyChange == 2048 - 258) {
- m_CodeLen = 12;
- }
-}
-void CPDF_LzwFilter::DecodeString(FX_DWORD code)
-{
- while (1) {
- int index = code - 258;
- if (index < 0 || index >= (int)m_nCodes) {
- break;
- }
- FX_DWORD data = m_CodeArray[index];
- if (m_StackLen >= sizeof(m_DecodeStack)) {
- return;
- }
- m_DecodeStack[m_StackLen++] = (FX_BYTE)data;
- code = data >> 16;
- }
- if (m_StackLen >= sizeof(m_DecodeStack)) {
- return;
- }
- m_DecodeStack[m_StackLen++] = (FX_BYTE)code;
-}
-CPDF_PredictorFilter::CPDF_PredictorFilter(int predictor, int colors, int bpc, int cols)
-{
- m_bTiff = predictor < 10;
- m_pRefLine = NULL;
- m_pCurLine = NULL;
- m_iLine = 0;
- m_LineInSize = 0;
- m_Bpp = (colors * bpc + 7) / 8;
- m_Pitch = (colors * bpc * cols + 7) / 8;
- if (!m_bTiff) {
- m_Pitch ++;
- }
-}
-CPDF_PredictorFilter::~CPDF_PredictorFilter()
-{
- if (m_pCurLine) {
- FX_Free(m_pCurLine);
- }
- if (m_pRefLine) {
- FX_Free(m_pRefLine);
- }
-}
-static FX_BYTE PaethPredictor(int a, int b, int c)
-{
- int p = a + b - c;
- int pa = FXSYS_abs(p - a);
- int pb = FXSYS_abs(p - b);
- int pc = FXSYS_abs(p - c);
- if (pa <= pb && pa <= pc) {
- return (FX_BYTE)a;
- }
- if (pb <= pc) {
- return (FX_BYTE)b;
- }
- return (FX_BYTE)c;
-}
-static void PNG_PredictorLine(FX_LPBYTE cur_buf, FX_LPBYTE ref_buf, int pitch, int Bpp)
-{
- FX_BYTE tag = cur_buf[0];
- if (tag == 0) {
- return;
- }
- cur_buf ++;
- if (ref_buf) {
- ref_buf ++;
- }
- for (int byte = 0; byte < pitch; byte ++) {
- FX_BYTE raw_byte = cur_buf[byte];
- switch (tag) {
- case 1: {
- FX_BYTE left = 0;
- if (byte >= Bpp) {
- left = cur_buf[byte - Bpp];
- }
- cur_buf[byte] = raw_byte + left;
- break;
- }
- case 2: {
- FX_BYTE up = 0;
- if (ref_buf) {
- up = ref_buf[byte];
- }
- cur_buf[byte] = raw_byte + up;
- break;
- }
- case 3: {
- FX_BYTE left = 0;
- if (byte >= Bpp) {
- left = cur_buf[byte - Bpp];
- }
- FX_BYTE up = 0;
- if (ref_buf) {
- up = ref_buf[byte];
- }
- cur_buf[byte] = raw_byte + (up + left) / 2;
- break;
- }
- case 4: {
- FX_BYTE left = 0;
- if (byte >= Bpp) {
- left = cur_buf[byte - Bpp];
- }
- FX_BYTE up = 0;
- if (ref_buf) {
- up = ref_buf[byte];
- }
- FX_BYTE upper_left = 0;
- if (byte >= Bpp && ref_buf) {
- upper_left = ref_buf[byte - Bpp];
- }
- cur_buf[byte] = raw_byte + PaethPredictor(left, up, upper_left);
- break;
- }
- }
- }
-}
-void CPDF_PredictorFilter::v_FilterIn(FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf)
-{
- if (m_pCurLine == NULL) {
- m_pCurLine = FX_Alloc(FX_BYTE, m_Pitch);
- if (!m_bTiff) {
- m_pRefLine = FX_Alloc(FX_BYTE, m_Pitch);
- }
- }
- while (1) {
- FX_DWORD read_size = m_Pitch - m_LineInSize;
- if (read_size > src_size) {
- read_size = src_size;
- }
- FXSYS_memcpy32(m_pCurLine + m_LineInSize, src_buf, read_size);
- m_LineInSize += read_size;
- if (m_LineInSize < m_Pitch) {
- break;
- }
- src_buf += read_size;
- src_size -= read_size;
- if (m_bTiff) {
- for (FX_DWORD byte = m_Bpp; byte < m_Pitch; byte ++) {
- m_pCurLine[byte] += m_pCurLine[byte - m_Bpp];
- }
- dest_buf.AppendBlock(m_pCurLine, m_Pitch);
- } else {
- PNG_PredictorLine(m_pCurLine, m_iLine ? m_pRefLine : NULL, m_Pitch - 1, m_Bpp);
- dest_buf.AppendBlock(m_pCurLine + 1, m_Pitch - 1);
- m_iLine ++;
- FX_LPBYTE temp = m_pCurLine;
- m_pCurLine = m_pRefLine;
- m_pRefLine = temp;
- }
- m_LineInSize = 0;
- }
-}
-CPDF_Ascii85Filter::CPDF_Ascii85Filter()
-{
- m_State = 0;
- m_CharCount = 0;
-}
-extern const FX_LPCSTR _PDF_CharType;
-void CPDF_Ascii85Filter::v_FilterIn(FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf)
-{
- for (FX_DWORD i = 0; i < src_size; i ++) {
- FX_BYTE byte = src_buf[i];
- if (_PDF_CharType[byte] == 'W') {
- continue;
- }
- switch (m_State) {
- case 0:
- if (byte >= '!' && byte <= 'u') {
- int digit = byte - '!';
- m_CurDWord = digit;
- m_CharCount = 1;
- m_State = 1;
- } else if (byte == 'z') {
- int zero = 0;
- dest_buf.AppendBlock(&zero, 4);
- } else if (byte == '~') {
- m_State = 2;
- }
- break;
- case 1: {
- if (byte >= '!' && byte <= 'u') {
- int digit = byte - '!';
- m_CurDWord = m_CurDWord * 85 + digit;
- m_CharCount ++;
- if (m_CharCount == 5) {
- for (int i = 0; i < 4; i ++) {
- dest_buf.AppendByte((FX_BYTE)(m_CurDWord >> (3 - i) * 8));
- }
- m_State = 0;
- }
- } else if (byte == '~') {
- if (m_CharCount > 1) {
- int i;
- for (i = m_CharCount; i < 5; i ++) {
- m_CurDWord = m_CurDWord * 85 + 84;
- }
- for (i = 0; i < m_CharCount - 1; i ++) {
- dest_buf.AppendByte((FX_BYTE)(m_CurDWord >> (3 - i) * 8));
- }
- }
- m_State = 2;
- }
- break;
- }
- case 2:
- if (byte == '>') {
- ReportEOF(src_size - i - 1);
- return;
- }
- break;
- }
- }
-}
-CPDF_AsciiHexFilter::CPDF_AsciiHexFilter()
-{
- m_State = 0;
-}
-void CPDF_AsciiHexFilter::v_FilterIn(FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf)
-{
- for (FX_DWORD i = 0; i < src_size; i ++) {
- FX_BYTE byte = src_buf[i];
- if (_PDF_CharType[byte] == 'W') {
- continue;
- }
- int digit;
- if (byte >= '0' && byte <= '9') {
- digit = byte - '0';
- } else if (byte >= 'a' && byte <= 'f') {
- digit = byte - 'a' + 10;
- } else if (byte >= 'A' && byte <= 'F') {
- digit = byte - 'A' + 10;
- } else {
- if (m_State) {
- dest_buf.AppendByte(m_FirstDigit * 16);
- }
- ReportEOF(src_size - i - 1);
- return;
- }
- if (m_State == 0) {
- m_FirstDigit = digit;
- m_State ++;
- } else {
- dest_buf.AppendByte(m_FirstDigit * 16 + digit);
- m_State --;
- }
- }
-}
-CPDF_RunLenFilter::CPDF_RunLenFilter()
-{
- m_State = 0;
- m_Count = 0;
-}
-void CPDF_RunLenFilter::v_FilterIn(FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf)
-{
- for (FX_DWORD i = 0; i < src_size; i ++) {
- FX_BYTE byte = src_buf[i];
- switch (m_State) {
- case 0:
- if (byte < 128) {
- m_State = 1;
- m_Count = byte + 1;
- } else if (byte == 128) {
- ReportEOF(src_size - i - 1);
- return;
- } else {
- m_State = 2;
- m_Count = 257 - byte;
- }
- break;
- case 1:
- dest_buf.AppendByte(byte);
- m_Count --;
- if (m_Count == 0) {
- m_State = 0;
- }
- break;
- case 2: {
- dest_buf.AppendBlock(NULL, m_Count);
- FXSYS_memset8(dest_buf.GetBuffer() + dest_buf.GetSize() - m_Count, byte, m_Count);
- m_State = 0;
- break;
- }
- }
- }
-}
-CPDF_JpegFilter::CPDF_JpegFilter()
-{
- m_pContext = NULL;
- m_bGotHeader = FALSE;
- m_pScanline = NULL;
- m_iLine = 0;
-}
-CPDF_JpegFilter::~CPDF_JpegFilter()
-{
- if (m_pScanline) {
- FX_Free(m_pScanline);
- }
- if (m_pContext) {
- CPDF_ModuleMgr::Get()->GetJpegModule()->Finish(m_pContext);
- }
-}
-void CPDF_JpegFilter::v_FilterIn(FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf)
-{
- if (m_pContext == NULL) {
- m_pContext = CPDF_ModuleMgr::Get()->GetJpegModule()->Start();
- }
- FX_LPCBYTE jpeg_src_buf;
- FX_DWORD jpeg_src_size;
- CFX_BinaryBuf temp_buf;
- if (m_InputBuf.GetSize()) {
- temp_buf.EstimateSize(m_InputBuf.GetSize() + src_size);
- temp_buf.AppendBlock(m_InputBuf.GetBuffer(), m_InputBuf.GetSize());
- m_InputBuf.Clear();
- temp_buf.AppendBlock(src_buf, src_size);
- jpeg_src_buf = temp_buf.GetBuffer();
- jpeg_src_size = temp_buf.GetSize();
- } else {
- jpeg_src_buf = src_buf;
- jpeg_src_size = src_size;
- }
- CPDF_ModuleMgr::Get()->GetJpegModule()->Input(m_pContext, jpeg_src_buf, jpeg_src_size);
- if (!m_bGotHeader) {
- int ret = CPDF_ModuleMgr::Get()->GetJpegModule()->ReadHeader(m_pContext, &m_Width, &m_Height, &m_nComps);
- int left_size = CPDF_ModuleMgr::Get()->GetJpegModule()->GetAvailInput(m_pContext);
- if (ret == 1) {
- ReportEOF(left_size);
- return;
- }
- if (ret == 2) {
- m_InputBuf.AppendBlock(jpeg_src_buf + jpeg_src_size - left_size, left_size);
- return;
- }
- CPDF_ModuleMgr::Get()->GetJpegModule()->StartScanline(m_pContext, 1);
- m_bGotHeader = TRUE;
- m_Pitch = m_Width * m_nComps;
- }
- if (m_pScanline == NULL) {
- m_pScanline = FX_Alloc(FX_BYTE, m_Pitch + 4);
- }
- while (1) {
- if (!CPDF_ModuleMgr::Get()->GetJpegModule()->ReadScanline(m_pContext, m_pScanline)) {
- int left_size = CPDF_ModuleMgr::Get()->GetJpegModule()->GetAvailInput(m_pContext);
- m_InputBuf.AppendBlock(jpeg_src_buf + jpeg_src_size - left_size, left_size);
- break;
- }
- dest_buf.AppendBlock(m_pScanline, m_Pitch);
- m_iLine ++;
- if (m_iLine == m_Height) {
- ReportEOF(CPDF_ModuleMgr::Get()->GetJpegModule()->GetAvailInput(m_pContext));
- return;
- }
- }
-}
-CPDF_FaxFilter::CPDF_FaxFilter()
-{
- m_Encoding = 0;
- m_bEndOfLine = FALSE;
- m_bByteAlign = FALSE;
- m_bBlack = FALSE;
- m_nRows = 0;
- m_nColumns = 0;
- m_Pitch = 0;
- m_pScanlineBuf = NULL;
- m_pRefBuf = NULL;
- m_iRow = 0;
- m_InputBitPos = 0;
-}
-CPDF_FaxFilter::~CPDF_FaxFilter()
-{
- if (m_pScanlineBuf) {
- FX_Free(m_pScanlineBuf);
- }
- if (m_pRefBuf) {
- FX_Free(m_pRefBuf);
- }
-}
-FX_BOOL CPDF_FaxFilter::Initialize(int Encoding, int bEndOfLine, int bByteAlign, int bBlack, int nRows, int nColumns)
-{
- m_Encoding = Encoding;
- m_bEndOfLine = bEndOfLine;
- m_bByteAlign = bByteAlign;
- m_bBlack = bBlack;
- m_nRows = nRows;
- m_nColumns = nColumns;
- m_Pitch = (m_nColumns + 7) / 8;
- m_pScanlineBuf = FX_Alloc(FX_BYTE, m_Pitch);
- m_pRefBuf = FX_Alloc(FX_BYTE, m_Pitch);
- FXSYS_memset8(m_pScanlineBuf, 0xff, m_Pitch);
- FXSYS_memset8(m_pRefBuf, 0xff, m_Pitch);
- m_iRow = 0;
- m_InputBitPos = 0;
- return TRUE;
-}
-void CPDF_FaxFilter::v_FilterIn(FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf)
-{
- FX_LPCBYTE fax_src_buf;
- FX_DWORD fax_src_size;
- CFX_BinaryBuf temp_buf;
- int bitpos;
- if (m_InputBuf.GetSize()) {
- temp_buf.EstimateSize(m_InputBuf.GetSize() + src_size);
- temp_buf.AppendBlock(m_InputBuf.GetBuffer(), m_InputBuf.GetSize());
- m_InputBuf.Clear();
- temp_buf.AppendBlock(src_buf, src_size);
- fax_src_buf = temp_buf.GetBuffer();
- fax_src_size = temp_buf.GetSize();
- bitpos = m_InputBitPos;
- } else {
- fax_src_buf = src_buf;
- fax_src_size = src_size;
- bitpos = 0;
- }
- ProcessData(fax_src_buf, fax_src_size, bitpos, FALSE, dest_buf);
- int left_bits = fax_src_size * 8 - bitpos;
- m_InputBuf.AppendBlock(fax_src_buf + bitpos / 8, (left_bits + 7) / 8);
- m_InputBitPos = bitpos % 8;
-}
-void CPDF_FaxFilter::v_FilterFinish(CFX_BinaryBuf& dest_buf)
-{
- ProcessData(m_InputBuf.GetBuffer(), m_InputBuf.GetSize(), m_InputBitPos, TRUE, dest_buf);
-}
-FX_BOOL _FaxSkipEOL(const FX_BYTE* src_buf, int bitsize, int& bitpos);
-FX_BOOL _FaxG4GetRow(const FX_BYTE* src_buf, int bitsize, int& bitpos, FX_LPBYTE dest_buf, const FX_BYTE* ref_buf, int columns);
-FX_BOOL _FaxGet1DLine(const FX_BYTE* src_buf, int bitsize, int& bitpos, FX_LPBYTE dest_buf, int columns);
-void CPDF_FaxFilter::ProcessData(FX_LPCBYTE src_buf, FX_DWORD src_size, int& bitpos, FX_BOOL bFinish,
- CFX_BinaryBuf& dest_buf)
-{
- int bitsize = src_size * 8;
- while (1) {
- if ((bitsize < bitpos + 256) && !bFinish) {
- return;
- }
- int start_bitpos = bitpos;
- FXSYS_memset8(m_pScanlineBuf, 0xff, m_Pitch);
- if (!ReadLine(src_buf, bitsize, bitpos)) {
- bitpos = start_bitpos;
- return;
- }
- if (m_Encoding) {
- FXSYS_memcpy32(m_pRefBuf, m_pScanlineBuf, m_Pitch);
- }
- if (m_bBlack) {
- for (int i = 0; i < m_Pitch; i ++) {
- m_pScanlineBuf[i] = ~m_pScanlineBuf[i];
- }
- }
- dest_buf.AppendBlock(m_pScanlineBuf, m_Pitch);
- m_iRow ++;
- if (m_iRow == m_nRows) {
- ReportEOF(src_size - (bitpos + 7) / 8);
- return;
- }
- }
-}
-FX_BOOL CPDF_FaxFilter::ReadLine(FX_LPCBYTE src_buf, int bitsize, int& bitpos)
-{
- if (!_FaxSkipEOL(src_buf, bitsize, bitpos)) {
- return FALSE;
- }
- FX_BOOL ret;
- if (m_Encoding < 0) {
- ret = _FaxG4GetRow(src_buf, bitsize, bitpos, m_pScanlineBuf, m_pRefBuf, m_nColumns);
- } else if (m_Encoding == 0) {
- ret = _FaxGet1DLine(src_buf, bitsize, bitpos, m_pScanlineBuf, m_nColumns);
- } else {
- if (bitpos == bitsize) {
- return FALSE;
- }
- FX_BOOL bNext1D = src_buf[bitpos / 8] & (1 << (7 - bitpos % 8));
- bitpos ++;
- if (bNext1D) {
- ret = _FaxGet1DLine(src_buf, bitsize, bitpos, m_pScanlineBuf, m_nColumns);
- } else {
- ret = _FaxG4GetRow(src_buf, bitsize, bitpos, m_pScanlineBuf, m_pRefBuf, m_nColumns);
- }
- }
- if (!ret) {
- return FALSE;
- }
- if (m_bEndOfLine)
- if (!_FaxSkipEOL(src_buf, bitsize, bitpos)) {
- return FALSE;
- }
- if (m_bByteAlign) {
- bitpos = (bitpos + 7) / 8 * 8;
- }
- return TRUE;
-}
+// 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
+
+#include "../../fx_zlib.h"
+#include "../../../include/fpdfapi/fpdf_parser.h"
+#include "../../../include/fxcodec/fx_codec.h"
+#include "../../../include/fpdfapi/fpdf_module.h"
+#include "filters_int.h"
+CFX_DataFilter::CFX_DataFilter()
+{
+ m_bEOF = FALSE;
+ m_pDestFilter = NULL;
+ m_SrcPos = 0;
+}
+CFX_DataFilter::~CFX_DataFilter()
+{
+ if (m_pDestFilter) {
+ delete m_pDestFilter;
+ }
+}
+void CFX_DataFilter::SetDestFilter(CFX_DataFilter* pFilter)
+{
+ if (m_pDestFilter) {
+ m_pDestFilter->SetDestFilter(pFilter);
+ } else {
+ m_pDestFilter = pFilter;
+ }
+}
+void CFX_DataFilter::FilterIn(FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf)
+{
+ if (m_bEOF) {
+ return;
+ }
+ m_SrcPos += src_size;
+ if (m_pDestFilter) {
+ CFX_BinaryBuf temp_buf;
+ temp_buf.EstimateSize(FPDF_FILTER_BUFFER_SIZE, FPDF_FILTER_BUFFER_SIZE);
+ v_FilterIn(src_buf, src_size, temp_buf);
+ m_pDestFilter->FilterIn(temp_buf.GetBuffer(), temp_buf.GetSize(), dest_buf);
+ } else {
+ v_FilterIn(src_buf, src_size, dest_buf);
+ }
+}
+void CFX_DataFilter::FilterFinish(CFX_BinaryBuf& dest_buf)
+{
+ if (m_pDestFilter) {
+ CFX_BinaryBuf temp_buf;
+ v_FilterFinish(temp_buf);
+ if (temp_buf.GetSize()) {
+ m_pDestFilter->FilterIn(temp_buf.GetBuffer(), temp_buf.GetSize(), dest_buf);
+ }
+ m_pDestFilter->FilterFinish(dest_buf);
+ } else {
+ v_FilterFinish(dest_buf);
+ }
+ m_bEOF = TRUE;
+}
+void CFX_DataFilter::ReportEOF(FX_DWORD left_input)
+{
+ if (m_bEOF) {
+ return;
+ }
+ m_bEOF = TRUE;
+ m_SrcPos -= left_input;
+}
+CFX_DataFilter* FPDF_CreateFilter(FX_BSTR name, const CPDF_Dictionary* pParam, int width, int height)
+{
+ FX_DWORD id = name.GetID();
+ switch (id) {
+ case FXBSTR_ID('F', 'l', 'a', 't'):
+ case FXBSTR_ID('F', 'l', 0, 0):
+ case FXBSTR_ID('L', 'Z', 'W', 'D'):
+ case FXBSTR_ID('L', 'Z', 'W', 0): {
+ CFX_DataFilter* pFilter;
+ if (id == FXBSTR_ID('L', 'Z', 'W', 'D') || id == FXBSTR_ID('L', 'Z', 'W', 0)) {
+ pFilter = FX_NEW CPDF_LzwFilter(pParam->GetInteger("EarlyChange", 1));
+ } else {
+ pFilter = FX_NEW CPDF_FlateFilter;
+ }
+ if (pParam->GetInteger("Predictor", 1) > 1) {
+ CFX_DataFilter* pPredictor = FX_NEW CPDF_PredictorFilter(pParam->GetInteger(FX_BSTRC("Predictor"), 1),
+ pParam->GetInteger(FX_BSTRC("Colors"), 1), pParam->GetInteger(FX_BSTRC("BitsPerComponent"), 8),
+ pParam->GetInteger(FX_BSTRC("Columns"), 1));
+ pFilter->SetDestFilter(pPredictor);
+ }
+ return pFilter;
+ }
+ case FXBSTR_ID('A', 'S', 'C', 'I'):
+ if (name == "ASCIIHexDecode") {
+ return FX_NEW CPDF_AsciiHexFilter;
+ }
+ return FX_NEW CPDF_Ascii85Filter;
+ case FXBSTR_ID('A', 'H', 'x', 0):
+ return FX_NEW CPDF_AsciiHexFilter;
+ case FXBSTR_ID('A', '8', '5', 0):
+ return FX_NEW CPDF_Ascii85Filter;
+ case FXBSTR_ID('R', 'u', 'n', 'L'):
+ return FX_NEW CPDF_RunLenFilter;
+ case FXBSTR_ID('C', 'C', 'I', 'T'): {
+ int Encoding = 0;
+ int bEndOfLine = FALSE;
+ int bByteAlign = FALSE;
+ int bBlack = FALSE;
+ int nRows = 0;
+ int nColumns = 1728;
+ if (pParam) {
+ Encoding = pParam->GetInteger(FX_BSTRC("K"));
+ bEndOfLine = pParam->GetInteger(FX_BSTRC("EndOfLine"));
+ bByteAlign = pParam->GetInteger(FX_BSTRC("EncodedByteAlign"));
+ bBlack = pParam->GetInteger(FX_BSTRC("BlackIs1"));
+ nColumns = pParam->GetInteger(FX_BSTRC("Columns"), 1728);
+ nRows = pParam->GetInteger(FX_BSTRC("Rows"));
+ }
+ if (nColumns == 0) {
+ nColumns = width;
+ }
+ if (nRows == 0) {
+ nRows = height;
+ }
+ CPDF_FaxFilter* pFilter = FX_NEW CPDF_FaxFilter();
+ pFilter->Initialize(Encoding, bEndOfLine, bByteAlign, bBlack, nRows, nColumns);
+ return pFilter;
+ }
+ case FXBSTR_ID('D', 'C', 'T', 'D'):
+ return FX_NEW CPDF_JpegFilter;
+ default:
+ return NULL;
+ }
+}
+CFX_DataFilter* _FPDF_CreateFilterFromDict(CPDF_Dictionary* pDict)
+{
+ CPDF_Object* pDecoder = pDict->GetElementValue("Filter");
+ if (pDecoder == NULL) {
+ return NULL;
+ }
+ CFX_DataFilter* pFirstFilter = NULL;
+ int width = pDict->GetInteger(FX_BSTRC("Width")), height = pDict->GetInteger(FX_BSTRC("Height"));
+ CPDF_Object* pParams = pDict->GetElementValue("DecodeParms");
+ if (pDecoder->GetType() == PDFOBJ_ARRAY) {
+ if (pParams && pParams->GetType() != PDFOBJ_ARRAY) {
+ pParams = NULL;
+ }
+ for (FX_DWORD i = 0; i < ((CPDF_Array*)pDecoder)->GetCount(); i ++) {
+ CFX_ByteString name = ((CPDF_Array*)pDecoder)->GetString(i);
+ CPDF_Dictionary* pParam = NULL;
+ if (pParams) {
+ pParam = ((CPDF_Array*)pParams)->GetDict(i);
+ }
+ CFX_DataFilter* pDestFilter = FPDF_CreateFilter(name, pParam, width, height);
+ if (pDestFilter) {
+ if (pFirstFilter == NULL) {
+ pFirstFilter = pDestFilter;
+ } else {
+ pFirstFilter->SetDestFilter(pDestFilter);
+ }
+ }
+ }
+ } else {
+ if (pParams && pParams->GetType() != PDFOBJ_DICTIONARY) {
+ pParams = NULL;
+ }
+ pFirstFilter = FPDF_CreateFilter(pDecoder->GetString(), (CPDF_Dictionary*)pParams, width, height);
+ }
+ return pFirstFilter;
+}
+CPDF_StreamFilter* CPDF_Stream::GetStreamFilter(FX_BOOL bRaw) const
+{
+ CFX_DataFilter* pFirstFilter = NULL;
+ if (m_pCryptoHandler) {
+ pFirstFilter = FX_NEW CPDF_DecryptFilter(m_pCryptoHandler, m_ObjNum, m_GenNum);
+ }
+ if (!bRaw) {
+ CFX_DataFilter* pFilter = _FPDF_CreateFilterFromDict(m_pDict);
+ if (pFilter) {
+ if (pFirstFilter == NULL) {
+ pFirstFilter = pFilter;
+ } else {
+ pFirstFilter->SetDestFilter(pFilter);
+ }
+ }
+ }
+ CPDF_StreamFilter* pStreamFilter = FX_NEW CPDF_StreamFilter;
+ pStreamFilter->m_pStream = this;
+ pStreamFilter->m_pFilter = pFirstFilter;
+ pStreamFilter->m_pBuffer = NULL;
+ pStreamFilter->m_SrcOffset = 0;
+ return pStreamFilter;
+}
+CPDF_StreamFilter::~CPDF_StreamFilter()
+{
+ if (m_pFilter) {
+ delete m_pFilter;
+ }
+ if (m_pBuffer) {
+ delete m_pBuffer;
+ }
+}
+#define FPDF_FILTER_BUFFER_IN_SIZE FPDF_FILTER_BUFFER_SIZE
+FX_DWORD CPDF_StreamFilter::ReadBlock(FX_LPBYTE buffer, FX_DWORD buf_size)
+{
+ if (m_pFilter == NULL) {
+ FX_DWORD read_size = m_pStream->GetRawSize() - m_SrcOffset;
+ if (read_size == 0) {
+ return 0;
+ }
+ if (read_size > buf_size) {
+ read_size = buf_size;
+ }
+ m_pStream->ReadRawData(m_SrcOffset, buffer, read_size);
+ m_SrcOffset += read_size;
+ return read_size;
+ }
+ FX_DWORD read_size = 0;
+ if (m_pBuffer) {
+ read_size = ReadLeftOver(buffer, buf_size);
+ if (read_size == buf_size) {
+ return read_size;
+ }
+ buffer += read_size;
+ buf_size -= read_size;
+ }
+ ASSERT(m_pBuffer == NULL);
+ if (m_pFilter->IsEOF()) {
+ return read_size;
+ }
+ m_pBuffer = FX_NEW CFX_BinaryBuf;
+ m_pBuffer->EstimateSize(FPDF_FILTER_BUFFER_SIZE, FPDF_FILTER_BUFFER_SIZE);
+ m_BufOffset = 0;
+ while (1) {
+ int src_size = m_pStream->GetRawSize() - m_SrcOffset;
+ if (src_size == 0) {
+ m_pFilter->FilterFinish(*m_pBuffer);
+ break;
+ }
+ if (src_size > FPDF_FILTER_BUFFER_IN_SIZE) {
+ src_size = FPDF_FILTER_BUFFER_IN_SIZE;
+ }
+ if (!m_pStream->ReadRawData(m_SrcOffset, m_SrcBuffer, src_size)) {
+ return 0;
+ }
+ m_SrcOffset += src_size;
+ m_pFilter->FilterIn(m_SrcBuffer, src_size, *m_pBuffer);
+ if (m_pBuffer->GetSize() >= (int)buf_size) {
+ break;
+ }
+ }
+ return read_size + ReadLeftOver(buffer, buf_size);
+}
+FX_DWORD CPDF_StreamFilter::ReadLeftOver(FX_LPBYTE buffer, FX_DWORD buf_size)
+{
+ FX_DWORD read_size = m_pBuffer->GetSize() - m_BufOffset;
+ if (read_size > buf_size) {
+ read_size = buf_size;
+ }
+ FXSYS_memcpy32(buffer, m_pBuffer->GetBuffer() + m_BufOffset, read_size);
+ m_BufOffset += read_size;
+ if (m_BufOffset == (FX_DWORD)m_pBuffer->GetSize()) {
+ delete m_pBuffer;
+ m_pBuffer = NULL;
+ }
+ return read_size;
+}
+CPDF_DecryptFilter::CPDF_DecryptFilter(CPDF_CryptoHandler* pCryptoHandler, FX_DWORD objnum, FX_DWORD gennum)
+{
+ m_pCryptoHandler = pCryptoHandler;
+ m_pContext = NULL;
+ m_ObjNum = objnum;
+ m_GenNum = gennum;
+}
+CPDF_DecryptFilter::~CPDF_DecryptFilter()
+{
+ CFX_BinaryBuf buf;
+ if (m_pContext) {
+ m_pCryptoHandler->DecryptFinish(m_pContext, buf);
+ }
+}
+void CPDF_DecryptFilter::v_FilterIn(FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf)
+{
+ if (m_pContext == NULL) {
+ m_pContext = m_pCryptoHandler->DecryptStart(m_ObjNum, m_GenNum);
+ }
+ m_pCryptoHandler->DecryptStream(m_pContext, src_buf, src_size, dest_buf);
+}
+void CPDF_DecryptFilter::v_FilterFinish(CFX_BinaryBuf& dest_buf)
+{
+ m_bEOF = TRUE;
+ if (m_pContext == NULL) {
+ return;
+ }
+ m_pCryptoHandler->DecryptFinish(m_pContext, dest_buf);
+ m_pContext = NULL;
+}
+extern "C" {
+ static void* my_alloc_func (void* opaque, unsigned int items, unsigned int size)
+ {
+ return FX_Alloc(FX_BYTE, items * size);
+ }
+ static void my_free_func (void* opaque, void* address)
+ {
+ FX_Free(address);
+ }
+ void* FPDFAPI_FlateInit(void* (*alloc_func)(void*, unsigned int, unsigned int),
+ void (*free_func)(void*, void*));
+ void FPDFAPI_FlateInput(void* context, const unsigned char* src_buf, unsigned int src_size);
+ int FPDFAPI_FlateOutput(void* context, unsigned char* dest_buf, unsigned int dest_size);
+ int FPDFAPI_FlateGetAvailIn(void* context);
+ int FPDFAPI_FlateGetAvailOut(void* context);
+ void FPDFAPI_FlateEnd(void* context);
+}
+CPDF_FlateFilter::CPDF_FlateFilter()
+{
+ m_pContext = NULL;
+}
+CPDF_FlateFilter::~CPDF_FlateFilter()
+{
+ if (m_pContext) {
+ FPDFAPI_FlateEnd(m_pContext);
+ }
+}
+void CPDF_FlateFilter::v_FilterIn(FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf)
+{
+ if (m_pContext == NULL) {
+ m_pContext = FPDFAPI_FlateInit(my_alloc_func, my_free_func);
+ }
+ FPDFAPI_FlateInput(m_pContext, src_buf, src_size);
+ while (1) {
+ int ret = FPDFAPI_FlateOutput(m_pContext, m_DestBuffer, FPDF_FILTER_BUFFER_SIZE);
+ int out_size = FPDF_FILTER_BUFFER_SIZE - FPDFAPI_FlateGetAvailOut(m_pContext);
+ dest_buf.AppendBlock(m_DestBuffer, out_size);
+ if (ret == Z_BUF_ERROR) {
+ break;
+ }
+ if (ret != Z_OK) {
+ ReportEOF(FPDFAPI_FlateGetAvailIn(m_pContext));
+ break;
+ }
+ }
+}
+CPDF_LzwFilter::CPDF_LzwFilter(FX_BOOL bEarlyChange)
+{
+ m_bEarlyChange = bEarlyChange ? 1 : 0;
+ m_CodeLen = 9;
+ m_nCodes = 0;
+ m_nLeftBits = 0;
+ m_LeftBits = 0;
+ m_OldCode = (FX_DWORD) - 1;
+}
+void CPDF_LzwFilter::v_FilterIn(FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf)
+{
+ for (FX_DWORD i = 0; i < src_size; i ++) {
+ if (m_nLeftBits + 8 < m_CodeLen) {
+ m_nLeftBits += 8;
+ m_LeftBits = (m_LeftBits << 8) | src_buf[i];
+ continue;
+ }
+ FX_DWORD new_bits = m_CodeLen - m_nLeftBits;
+ FX_DWORD code = (m_LeftBits << new_bits) | (src_buf[i] >> (8 - new_bits));
+ m_nLeftBits = 8 - new_bits;
+ m_LeftBits = src_buf[i] % (1 << m_nLeftBits);
+ if (code < 256) {
+ dest_buf.AppendByte((FX_BYTE)code);
+ m_LastChar = (FX_BYTE)code;
+ if (m_OldCode != -1) {
+ AddCode(m_OldCode, m_LastChar);
+ }
+ m_OldCode = code;
+ } else if (code == 256) {
+ m_CodeLen = 9;
+ m_nCodes = 0;
+ m_OldCode = (FX_DWORD) - 1;
+ } else if (code == 257) {
+ ReportEOF(src_size - i - 1);
+ return;
+ } else {
+ if (m_OldCode == -1) {
+ ReportEOF(src_size - i - 1);
+ return;
+ }
+ m_StackLen = 0;
+ if (code >= m_nCodes + 258) {
+ if (m_StackLen < sizeof(m_DecodeStack)) {
+ m_DecodeStack[m_StackLen++] = m_LastChar;
+ }
+ DecodeString(m_OldCode);
+ } else {
+ DecodeString(code);
+ }
+ dest_buf.AppendBlock(NULL, m_StackLen);
+ FX_LPBYTE pOutput = dest_buf.GetBuffer() + dest_buf.GetSize() - m_StackLen;
+ for (FX_DWORD cc = 0; cc < m_StackLen; cc ++) {
+ pOutput[cc] = m_DecodeStack[m_StackLen - cc - 1];
+ }
+ m_LastChar = m_DecodeStack[m_StackLen - 1];
+ if (m_OldCode < 256) {
+ AddCode(m_OldCode, m_LastChar);
+ } else if (m_OldCode - 258 >= m_nCodes) {
+ ReportEOF(src_size - i - 1);
+ return;
+ } else {
+ AddCode(m_OldCode, m_LastChar);
+ }
+ m_OldCode = code;
+ }
+ }
+}
+void CPDF_LzwFilter::AddCode(FX_DWORD prefix_code, FX_BYTE append_char)
+{
+ if (m_nCodes + m_bEarlyChange == 4094) {
+ return;
+ }
+ m_CodeArray[m_nCodes ++] = (prefix_code << 16) | append_char;
+ if (m_nCodes + m_bEarlyChange == 512 - 258) {
+ m_CodeLen = 10;
+ } else if (m_nCodes + m_bEarlyChange == 1024 - 258) {
+ m_CodeLen = 11;
+ } else if (m_nCodes + m_bEarlyChange == 2048 - 258) {
+ m_CodeLen = 12;
+ }
+}
+void CPDF_LzwFilter::DecodeString(FX_DWORD code)
+{
+ while (1) {
+ int index = code - 258;
+ if (index < 0 || index >= (int)m_nCodes) {
+ break;
+ }
+ FX_DWORD data = m_CodeArray[index];
+ if (m_StackLen >= sizeof(m_DecodeStack)) {
+ return;
+ }
+ m_DecodeStack[m_StackLen++] = (FX_BYTE)data;
+ code = data >> 16;
+ }
+ if (m_StackLen >= sizeof(m_DecodeStack)) {
+ return;
+ }
+ m_DecodeStack[m_StackLen++] = (FX_BYTE)code;
+}
+CPDF_PredictorFilter::CPDF_PredictorFilter(int predictor, int colors, int bpc, int cols)
+{
+ m_bTiff = predictor < 10;
+ m_pRefLine = NULL;
+ m_pCurLine = NULL;
+ m_iLine = 0;
+ m_LineInSize = 0;
+ m_Bpp = (colors * bpc + 7) / 8;
+ m_Pitch = (colors * bpc * cols + 7) / 8;
+ if (!m_bTiff) {
+ m_Pitch ++;
+ }
+}
+CPDF_PredictorFilter::~CPDF_PredictorFilter()
+{
+ if (m_pCurLine) {
+ FX_Free(m_pCurLine);
+ }
+ if (m_pRefLine) {
+ FX_Free(m_pRefLine);
+ }
+}
+static FX_BYTE PaethPredictor(int a, int b, int c)
+{
+ int p = a + b - c;
+ int pa = FXSYS_abs(p - a);
+ int pb = FXSYS_abs(p - b);
+ int pc = FXSYS_abs(p - c);
+ if (pa <= pb && pa <= pc) {
+ return (FX_BYTE)a;
+ }
+ if (pb <= pc) {
+ return (FX_BYTE)b;
+ }
+ return (FX_BYTE)c;
+}
+static void PNG_PredictorLine(FX_LPBYTE cur_buf, FX_LPBYTE ref_buf, int pitch, int Bpp)
+{
+ FX_BYTE tag = cur_buf[0];
+ if (tag == 0) {
+ return;
+ }
+ cur_buf ++;
+ if (ref_buf) {
+ ref_buf ++;
+ }
+ for (int byte = 0; byte < pitch; byte ++) {
+ FX_BYTE raw_byte = cur_buf[byte];
+ switch (tag) {
+ case 1: {
+ FX_BYTE left = 0;
+ if (byte >= Bpp) {
+ left = cur_buf[byte - Bpp];
+ }
+ cur_buf[byte] = raw_byte + left;
+ break;
+ }
+ case 2: {
+ FX_BYTE up = 0;
+ if (ref_buf) {
+ up = ref_buf[byte];
+ }
+ cur_buf[byte] = raw_byte + up;
+ break;
+ }
+ case 3: {
+ FX_BYTE left = 0;
+ if (byte >= Bpp) {
+ left = cur_buf[byte - Bpp];
+ }
+ FX_BYTE up = 0;
+ if (ref_buf) {
+ up = ref_buf[byte];
+ }
+ cur_buf[byte] = raw_byte + (up + left) / 2;
+ break;
+ }
+ case 4: {
+ FX_BYTE left = 0;
+ if (byte >= Bpp) {
+ left = cur_buf[byte - Bpp];
+ }
+ FX_BYTE up = 0;
+ if (ref_buf) {
+ up = ref_buf[byte];
+ }
+ FX_BYTE upper_left = 0;
+ if (byte >= Bpp && ref_buf) {
+ upper_left = ref_buf[byte - Bpp];
+ }
+ cur_buf[byte] = raw_byte + PaethPredictor(left, up, upper_left);
+ break;
+ }
+ }
+ }
+}
+void CPDF_PredictorFilter::v_FilterIn(FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf)
+{
+ if (m_pCurLine == NULL) {
+ m_pCurLine = FX_Alloc(FX_BYTE, m_Pitch);
+ if (!m_bTiff) {
+ m_pRefLine = FX_Alloc(FX_BYTE, m_Pitch);
+ }
+ }
+ while (1) {
+ FX_DWORD read_size = m_Pitch - m_LineInSize;
+ if (read_size > src_size) {
+ read_size = src_size;
+ }
+ FXSYS_memcpy32(m_pCurLine + m_LineInSize, src_buf, read_size);
+ m_LineInSize += read_size;
+ if (m_LineInSize < m_Pitch) {
+ break;
+ }
+ src_buf += read_size;
+ src_size -= read_size;
+ if (m_bTiff) {
+ for (FX_DWORD byte = m_Bpp; byte < m_Pitch; byte ++) {
+ m_pCurLine[byte] += m_pCurLine[byte - m_Bpp];
+ }
+ dest_buf.AppendBlock(m_pCurLine, m_Pitch);
+ } else {
+ PNG_PredictorLine(m_pCurLine, m_iLine ? m_pRefLine : NULL, m_Pitch - 1, m_Bpp);
+ dest_buf.AppendBlock(m_pCurLine + 1, m_Pitch - 1);
+ m_iLine ++;
+ FX_LPBYTE temp = m_pCurLine;
+ m_pCurLine = m_pRefLine;
+ m_pRefLine = temp;
+ }
+ m_LineInSize = 0;
+ }
+}
+CPDF_Ascii85Filter::CPDF_Ascii85Filter()
+{
+ m_State = 0;
+ m_CharCount = 0;
+}
+extern const FX_LPCSTR _PDF_CharType;
+void CPDF_Ascii85Filter::v_FilterIn(FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf)
+{
+ for (FX_DWORD i = 0; i < src_size; i ++) {
+ FX_BYTE byte = src_buf[i];
+ if (_PDF_CharType[byte] == 'W') {
+ continue;
+ }
+ switch (m_State) {
+ case 0:
+ if (byte >= '!' && byte <= 'u') {
+ int digit = byte - '!';
+ m_CurDWord = digit;
+ m_CharCount = 1;
+ m_State = 1;
+ } else if (byte == 'z') {
+ int zero = 0;
+ dest_buf.AppendBlock(&zero, 4);
+ } else if (byte == '~') {
+ m_State = 2;
+ }
+ break;
+ case 1: {
+ if (byte >= '!' && byte <= 'u') {
+ int digit = byte - '!';
+ m_CurDWord = m_CurDWord * 85 + digit;
+ m_CharCount ++;
+ if (m_CharCount == 5) {
+ for (int i = 0; i < 4; i ++) {
+ dest_buf.AppendByte((FX_BYTE)(m_CurDWord >> (3 - i) * 8));
+ }
+ m_State = 0;
+ }
+ } else if (byte == '~') {
+ if (m_CharCount > 1) {
+ int i;
+ for (i = m_CharCount; i < 5; i ++) {
+ m_CurDWord = m_CurDWord * 85 + 84;
+ }
+ for (i = 0; i < m_CharCount - 1; i ++) {
+ dest_buf.AppendByte((FX_BYTE)(m_CurDWord >> (3 - i) * 8));
+ }
+ }
+ m_State = 2;
+ }
+ break;
+ }
+ case 2:
+ if (byte == '>') {
+ ReportEOF(src_size - i - 1);
+ return;
+ }
+ break;
+ }
+ }
+}
+CPDF_AsciiHexFilter::CPDF_AsciiHexFilter()
+{
+ m_State = 0;
+}
+void CPDF_AsciiHexFilter::v_FilterIn(FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf)
+{
+ for (FX_DWORD i = 0; i < src_size; i ++) {
+ FX_BYTE byte = src_buf[i];
+ if (_PDF_CharType[byte] == 'W') {
+ continue;
+ }
+ int digit;
+ if (byte >= '0' && byte <= '9') {
+ digit = byte - '0';
+ } else if (byte >= 'a' && byte <= 'f') {
+ digit = byte - 'a' + 10;
+ } else if (byte >= 'A' && byte <= 'F') {
+ digit = byte - 'A' + 10;
+ } else {
+ if (m_State) {
+ dest_buf.AppendByte(m_FirstDigit * 16);
+ }
+ ReportEOF(src_size - i - 1);
+ return;
+ }
+ if (m_State == 0) {
+ m_FirstDigit = digit;
+ m_State ++;
+ } else {
+ dest_buf.AppendByte(m_FirstDigit * 16 + digit);
+ m_State --;
+ }
+ }
+}
+CPDF_RunLenFilter::CPDF_RunLenFilter()
+{
+ m_State = 0;
+ m_Count = 0;
+}
+void CPDF_RunLenFilter::v_FilterIn(FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf)
+{
+ for (FX_DWORD i = 0; i < src_size; i ++) {
+ FX_BYTE byte = src_buf[i];
+ switch (m_State) {
+ case 0:
+ if (byte < 128) {
+ m_State = 1;
+ m_Count = byte + 1;
+ } else if (byte == 128) {
+ ReportEOF(src_size - i - 1);
+ return;
+ } else {
+ m_State = 2;
+ m_Count = 257 - byte;
+ }
+ break;
+ case 1:
+ dest_buf.AppendByte(byte);
+ m_Count --;
+ if (m_Count == 0) {
+ m_State = 0;
+ }
+ break;
+ case 2: {
+ dest_buf.AppendBlock(NULL, m_Count);
+ FXSYS_memset8(dest_buf.GetBuffer() + dest_buf.GetSize() - m_Count, byte, m_Count);
+ m_State = 0;
+ break;
+ }
+ }
+ }
+}
+CPDF_JpegFilter::CPDF_JpegFilter()
+{
+ m_pContext = NULL;
+ m_bGotHeader = FALSE;
+ m_pScanline = NULL;
+ m_iLine = 0;
+}
+CPDF_JpegFilter::~CPDF_JpegFilter()
+{
+ if (m_pScanline) {
+ FX_Free(m_pScanline);
+ }
+ if (m_pContext) {
+ CPDF_ModuleMgr::Get()->GetJpegModule()->Finish(m_pContext);
+ }
+}
+void CPDF_JpegFilter::v_FilterIn(FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf)
+{
+ if (m_pContext == NULL) {
+ m_pContext = CPDF_ModuleMgr::Get()->GetJpegModule()->Start();
+ }
+ FX_LPCBYTE jpeg_src_buf;
+ FX_DWORD jpeg_src_size;
+ CFX_BinaryBuf temp_buf;
+ if (m_InputBuf.GetSize()) {
+ temp_buf.EstimateSize(m_InputBuf.GetSize() + src_size);
+ temp_buf.AppendBlock(m_InputBuf.GetBuffer(), m_InputBuf.GetSize());
+ m_InputBuf.Clear();
+ temp_buf.AppendBlock(src_buf, src_size);
+ jpeg_src_buf = temp_buf.GetBuffer();
+ jpeg_src_size = temp_buf.GetSize();
+ } else {
+ jpeg_src_buf = src_buf;
+ jpeg_src_size = src_size;
+ }
+ CPDF_ModuleMgr::Get()->GetJpegModule()->Input(m_pContext, jpeg_src_buf, jpeg_src_size);
+ if (!m_bGotHeader) {
+ int ret = CPDF_ModuleMgr::Get()->GetJpegModule()->ReadHeader(m_pContext, &m_Width, &m_Height, &m_nComps);
+ int left_size = CPDF_ModuleMgr::Get()->GetJpegModule()->GetAvailInput(m_pContext);
+ if (ret == 1) {
+ ReportEOF(left_size);
+ return;
+ }
+ if (ret == 2) {
+ m_InputBuf.AppendBlock(jpeg_src_buf + jpeg_src_size - left_size, left_size);
+ return;
+ }
+ CPDF_ModuleMgr::Get()->GetJpegModule()->StartScanline(m_pContext, 1);
+ m_bGotHeader = TRUE;
+ m_Pitch = m_Width * m_nComps;
+ }
+ if (m_pScanline == NULL) {
+ m_pScanline = FX_Alloc(FX_BYTE, m_Pitch + 4);
+ }
+ while (1) {
+ if (!CPDF_ModuleMgr::Get()->GetJpegModule()->ReadScanline(m_pContext, m_pScanline)) {
+ int left_size = CPDF_ModuleMgr::Get()->GetJpegModule()->GetAvailInput(m_pContext);
+ m_InputBuf.AppendBlock(jpeg_src_buf + jpeg_src_size - left_size, left_size);
+ break;
+ }
+ dest_buf.AppendBlock(m_pScanline, m_Pitch);
+ m_iLine ++;
+ if (m_iLine == m_Height) {
+ ReportEOF(CPDF_ModuleMgr::Get()->GetJpegModule()->GetAvailInput(m_pContext));
+ return;
+ }
+ }
+}
+CPDF_FaxFilter::CPDF_FaxFilter()
+{
+ m_Encoding = 0;
+ m_bEndOfLine = FALSE;
+ m_bByteAlign = FALSE;
+ m_bBlack = FALSE;
+ m_nRows = 0;
+ m_nColumns = 0;
+ m_Pitch = 0;
+ m_pScanlineBuf = NULL;
+ m_pRefBuf = NULL;
+ m_iRow = 0;
+ m_InputBitPos = 0;
+}
+CPDF_FaxFilter::~CPDF_FaxFilter()
+{
+ if (m_pScanlineBuf) {
+ FX_Free(m_pScanlineBuf);
+ }
+ if (m_pRefBuf) {
+ FX_Free(m_pRefBuf);
+ }
+}
+FX_BOOL CPDF_FaxFilter::Initialize(int Encoding, int bEndOfLine, int bByteAlign, int bBlack, int nRows, int nColumns)
+{
+ m_Encoding = Encoding;
+ m_bEndOfLine = bEndOfLine;
+ m_bByteAlign = bByteAlign;
+ m_bBlack = bBlack;
+ m_nRows = nRows;
+ m_nColumns = nColumns;
+ m_Pitch = (m_nColumns + 7) / 8;
+ m_pScanlineBuf = FX_Alloc(FX_BYTE, m_Pitch);
+ m_pRefBuf = FX_Alloc(FX_BYTE, m_Pitch);
+ FXSYS_memset8(m_pScanlineBuf, 0xff, m_Pitch);
+ FXSYS_memset8(m_pRefBuf, 0xff, m_Pitch);
+ m_iRow = 0;
+ m_InputBitPos = 0;
+ return TRUE;
+}
+void CPDF_FaxFilter::v_FilterIn(FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf)
+{
+ FX_LPCBYTE fax_src_buf;
+ FX_DWORD fax_src_size;
+ CFX_BinaryBuf temp_buf;
+ int bitpos;
+ if (m_InputBuf.GetSize()) {
+ temp_buf.EstimateSize(m_InputBuf.GetSize() + src_size);
+ temp_buf.AppendBlock(m_InputBuf.GetBuffer(), m_InputBuf.GetSize());
+ m_InputBuf.Clear();
+ temp_buf.AppendBlock(src_buf, src_size);
+ fax_src_buf = temp_buf.GetBuffer();
+ fax_src_size = temp_buf.GetSize();
+ bitpos = m_InputBitPos;
+ } else {
+ fax_src_buf = src_buf;
+ fax_src_size = src_size;
+ bitpos = 0;
+ }
+ ProcessData(fax_src_buf, fax_src_size, bitpos, FALSE, dest_buf);
+ int left_bits = fax_src_size * 8 - bitpos;
+ m_InputBuf.AppendBlock(fax_src_buf + bitpos / 8, (left_bits + 7) / 8);
+ m_InputBitPos = bitpos % 8;
+}
+void CPDF_FaxFilter::v_FilterFinish(CFX_BinaryBuf& dest_buf)
+{
+ ProcessData(m_InputBuf.GetBuffer(), m_InputBuf.GetSize(), m_InputBitPos, TRUE, dest_buf);
+}
+FX_BOOL _FaxSkipEOL(const FX_BYTE* src_buf, int bitsize, int& bitpos);
+FX_BOOL _FaxG4GetRow(const FX_BYTE* src_buf, int bitsize, int& bitpos, FX_LPBYTE dest_buf, const FX_BYTE* ref_buf, int columns);
+FX_BOOL _FaxGet1DLine(const FX_BYTE* src_buf, int bitsize, int& bitpos, FX_LPBYTE dest_buf, int columns);
+void CPDF_FaxFilter::ProcessData(FX_LPCBYTE src_buf, FX_DWORD src_size, int& bitpos, FX_BOOL bFinish,
+ CFX_BinaryBuf& dest_buf)
+{
+ int bitsize = src_size * 8;
+ while (1) {
+ if ((bitsize < bitpos + 256) && !bFinish) {
+ return;
+ }
+ int start_bitpos = bitpos;
+ FXSYS_memset8(m_pScanlineBuf, 0xff, m_Pitch);
+ if (!ReadLine(src_buf, bitsize, bitpos)) {
+ bitpos = start_bitpos;
+ return;
+ }
+ if (m_Encoding) {
+ FXSYS_memcpy32(m_pRefBuf, m_pScanlineBuf, m_Pitch);
+ }
+ if (m_bBlack) {
+ for (int i = 0; i < m_Pitch; i ++) {
+ m_pScanlineBuf[i] = ~m_pScanlineBuf[i];
+ }
+ }
+ dest_buf.AppendBlock(m_pScanlineBuf, m_Pitch);
+ m_iRow ++;
+ if (m_iRow == m_nRows) {
+ ReportEOF(src_size - (bitpos + 7) / 8);
+ return;
+ }
+ }
+}
+FX_BOOL CPDF_FaxFilter::ReadLine(FX_LPCBYTE src_buf, int bitsize, int& bitpos)
+{
+ if (!_FaxSkipEOL(src_buf, bitsize, bitpos)) {
+ return FALSE;
+ }
+ FX_BOOL ret;
+ if (m_Encoding < 0) {
+ ret = _FaxG4GetRow(src_buf, bitsize, bitpos, m_pScanlineBuf, m_pRefBuf, m_nColumns);
+ } else if (m_Encoding == 0) {
+ ret = _FaxGet1DLine(src_buf, bitsize, bitpos, m_pScanlineBuf, m_nColumns);
+ } else {
+ if (bitpos == bitsize) {
+ return FALSE;
+ }
+ FX_BOOL bNext1D = src_buf[bitpos / 8] & (1 << (7 - bitpos % 8));
+ bitpos ++;
+ if (bNext1D) {
+ ret = _FaxGet1DLine(src_buf, bitsize, bitpos, m_pScanlineBuf, m_nColumns);
+ } else {
+ ret = _FaxG4GetRow(src_buf, bitsize, bitpos, m_pScanlineBuf, m_pRefBuf, m_nColumns);
+ }
+ }
+ if (!ret) {
+ return FALSE;
+ }
+ if (m_bEndOfLine)
+ if (!_FaxSkipEOL(src_buf, bitsize, bitpos)) {
+ return FALSE;
+ }
+ if (m_bByteAlign) {
+ bitpos = (bitpos + 7) / 8 * 8;
+ }
+ return TRUE;
+}
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp
index 53cf892d7e..bd8b157bfa 100644
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp
@@ -1,1344 +1,1344 @@
-// 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
-
-#include "../../../include/fpdfapi/fpdf_parser.h"
-void CPDF_Object::Release()
-{
- if (this == NULL) {
- return;
- }
- if (m_ObjNum) {
- return;
- }
- Destroy();
-}
-void CPDF_Object::Destroy()
-{
- switch (m_Type) {
- case PDFOBJ_STRING:
- delete (CPDF_String*)this;
- break;
- case PDFOBJ_NAME:
- delete (CPDF_Name*)this;
- break;
- case PDFOBJ_ARRAY:
- delete (CPDF_Array*)this;
- break;
- case PDFOBJ_DICTIONARY:
- delete (CPDF_Dictionary*)this;
- break;
- case PDFOBJ_STREAM:
- delete (CPDF_Stream*)this;
- break;
- default:
- delete this;
- }
-}
-CFX_ByteString CPDF_Object::GetString() const
-{
- if (this == NULL) {
- return CFX_ByteString();
- }
- switch (m_Type) {
- case PDFOBJ_BOOLEAN:
- return ((CPDF_Boolean*)this)->m_bValue ? "true" : "false";
- case PDFOBJ_NUMBER:
- return ((CPDF_Number*)this)->GetString();
- case PDFOBJ_STRING:
- return ((CPDF_String*)this)->m_String;
- case PDFOBJ_NAME:
- return ((CPDF_Name*)this)->m_Name;
- case PDFOBJ_REFERENCE: {
- CPDF_Reference* pRef = (CPDF_Reference*)(FX_LPVOID)this;
- if (pRef->m_pObjList == NULL) {
- break;
- }
- CPDF_Object* pObj = pRef->m_pObjList->GetIndirectObject(pRef->m_RefObjNum);
- if (pObj == NULL) {
- return CFX_ByteString();
- }
- return pObj->GetString();
- }
- }
- return CFX_ByteString();
-}
-CFX_ByteStringC CPDF_Object::GetConstString() const
-{
- if (this == NULL) {
- return CFX_ByteStringC();
- }
- switch (m_Type) {
- case PDFOBJ_STRING:
- return CFX_ByteStringC((FX_LPCBYTE)((CPDF_String*)this)->m_String, ((CPDF_String*)this)->m_String.GetLength());
- case PDFOBJ_NAME:
- return CFX_ByteStringC((FX_LPCBYTE)((CPDF_Name*)this)->m_Name, ((CPDF_Name*)this)->m_Name.GetLength());
- case PDFOBJ_REFERENCE: {
- CPDF_Reference* pRef = (CPDF_Reference*)(FX_LPVOID)this;
- if (pRef->m_pObjList == NULL) {
- break;
- }
- CPDF_Object* pObj = pRef->m_pObjList->GetIndirectObject(pRef->m_RefObjNum);
- if (pObj == NULL) {
- return CFX_ByteStringC();
- }
- return pObj->GetConstString();
- }
- }
- return CFX_ByteStringC();
-}
-FX_FLOAT CPDF_Object::GetNumber() const
-{
- if (this == NULL) {
- return 0;
- }
- switch (m_Type) {
- case PDFOBJ_NUMBER:
- return ((CPDF_Number*)this)->GetNumber();
- case PDFOBJ_REFERENCE: {
- CPDF_Reference* pRef = (CPDF_Reference*)(FX_LPVOID)this;
- if (pRef->m_pObjList == NULL) {
- break;
- }
- CPDF_Object* pObj = pRef->m_pObjList->GetIndirectObject(pRef->m_RefObjNum);
- if (pObj == NULL) {
- return 0;
- }
- return pObj->GetNumber();
- }
- }
- return 0;
-}
-FX_FLOAT CPDF_Object::GetNumber16() const
-{
- return GetNumber();
-}
-int CPDF_Object::GetInteger() const
-{
- if (this == NULL) {
- return 0;
- }
- switch (m_Type) {
- case PDFOBJ_BOOLEAN:
- return ((CPDF_Boolean*)this)->m_bValue;
- case PDFOBJ_NUMBER:
- return ((CPDF_Number*)this)->GetInteger();
- case PDFOBJ_REFERENCE: {
- CPDF_Reference* pRef = (CPDF_Reference*)(FX_LPVOID)this;
- PARSE_CONTEXT context;
- FXSYS_memset32(&context, 0, sizeof(PARSE_CONTEXT));
- if (pRef->m_pObjList == NULL) {
- return 0;
- }
- CPDF_Object* pObj = pRef->m_pObjList->GetIndirectObject(pRef->m_RefObjNum, &context);
- if (pObj == NULL) {
- return 0;
- }
- return pObj->GetInteger();
- }
- }
- return 0;
-}
-CPDF_Dictionary* CPDF_Object::GetDict() const
-{
- if (this == NULL) {
- return NULL;
- }
- switch (m_Type) {
- case PDFOBJ_DICTIONARY:
- return (CPDF_Dictionary*)this;
- case PDFOBJ_STREAM:
- return ((CPDF_Stream*)this)->GetDict();
- case PDFOBJ_REFERENCE: {
- CPDF_Reference* pRef = (CPDF_Reference*)this;
- if (pRef->m_pObjList == NULL) {
- break;
- }
- CPDF_Object* pObj = pRef->m_pObjList->GetIndirectObject(pRef->m_RefObjNum);
- if (pObj == NULL) {
- return NULL;
- }
- return pObj->GetDict();
- }
- }
- return NULL;
-}
-CPDF_Array* CPDF_Object::GetArray() const
-{
- if (this == NULL) {
- return NULL;
- }
- if (m_Type == PDFOBJ_ARRAY) {
- return (CPDF_Array*)this;
- }
- return NULL;
-}
-void CPDF_Object::SetString(const CFX_ByteString& str)
-{
- ASSERT(this != NULL);
- switch (m_Type) {
- case PDFOBJ_BOOLEAN:
- ((CPDF_Boolean*)this)->m_bValue = str == FX_BSTRC("true") ? 1 : 0;
- return;
- case PDFOBJ_NUMBER:
- ((CPDF_Number*)this)->SetString(str);
- return;
- case PDFOBJ_STRING:
- ((CPDF_String*)this)->m_String = str;
- return;
- case PDFOBJ_NAME:
- ((CPDF_Name*)this)->m_Name = str;
- return;
- }
- ASSERT(FALSE);
-}
-int CPDF_Object::GetDirectType() const
-{
- if (m_Type != PDFOBJ_REFERENCE) {
- return m_Type;
- }
- CPDF_Reference* pRef = (CPDF_Reference*)this;
- return pRef->m_pObjList->GetIndirectType(pRef->m_RefObjNum);
-}
-FX_BOOL CPDF_Object::IsIdentical(CPDF_Object* pOther) const
-{
- if (this == pOther) {
- return TRUE;
- }
- if (this == NULL || pOther == NULL) {
- return FALSE;
- }
- if (pOther->m_Type != m_Type) {
- if (m_Type == PDFOBJ_REFERENCE) {
- return GetDirect()->IsIdentical(pOther);
- } else if (pOther->m_Type == PDFOBJ_REFERENCE) {
- return IsIdentical(pOther->GetDirect());
- }
- return FALSE;
- }
- switch (m_Type) {
- case PDFOBJ_BOOLEAN:
- return (((CPDF_Boolean*)this)->Identical((CPDF_Boolean*)pOther));
- case PDFOBJ_NUMBER:
- return (((CPDF_Number*)this)->Identical((CPDF_Number*)pOther));
- case PDFOBJ_STRING:
- return (((CPDF_String*)this)->Identical((CPDF_String*)pOther));
- case PDFOBJ_NAME:
- return (((CPDF_Name*)this)->Identical((CPDF_Name*)pOther));
- case PDFOBJ_ARRAY:
- return (((CPDF_Array*)this)->Identical((CPDF_Array*)pOther));
- case PDFOBJ_DICTIONARY:
- return (((CPDF_Dictionary*)this)->Identical((CPDF_Dictionary*)pOther));
- case PDFOBJ_NULL:
- return TRUE;
- case PDFOBJ_STREAM:
- return (((CPDF_Stream*)this)->Identical((CPDF_Stream*)pOther));
- case PDFOBJ_REFERENCE:
- return (((CPDF_Reference*)this)->Identical((CPDF_Reference*)pOther));
- }
- return FALSE;
-}
-CPDF_Object* CPDF_Object::GetDirect() const
-{
- if (this == NULL) {
- return NULL;
- }
- if (m_Type != PDFOBJ_REFERENCE) {
- return (CPDF_Object*)this;
- }
- CPDF_Reference* pRef = (CPDF_Reference*)(FX_LPVOID)this;
- if (pRef->m_pObjList == NULL) {
- return NULL;
- }
- return pRef->m_pObjList->GetIndirectObject(pRef->m_RefObjNum);
-}
-CPDF_Object* CPDF_Object::Clone(FX_BOOL bDirect) const
-{
- CFX_MapPtrToPtr visited;
- return CloneInternal(bDirect, &visited);
-}
-CPDF_Object* CPDF_Object::CloneInternal(FX_BOOL bDirect, CFX_MapPtrToPtr* visited) const
-{
- if (this == NULL) {
- return NULL;
- }
- switch (m_Type) {
- case PDFOBJ_BOOLEAN:
- return FX_NEW CPDF_Boolean(((CPDF_Boolean*)this)->m_bValue);
- case PDFOBJ_NUMBER:
- return FX_NEW CPDF_Number(((CPDF_Number*)this)->m_bInteger, &((CPDF_Number*)this)->m_Integer);
- case PDFOBJ_STRING:
- return FX_NEW CPDF_String(((CPDF_String*)this)->m_String, ((CPDF_String*)this)->IsHex());
- case PDFOBJ_NAME:
- return FX_NEW CPDF_Name(((CPDF_Name*)this)->m_Name);
- case PDFOBJ_ARRAY: {
- CPDF_Array* pCopy = FX_NEW CPDF_Array();
- CPDF_Array* pThis = (CPDF_Array*)this;
- int n = pThis->GetCount();
- for (int i = 0; i < n; i ++) {
- CPDF_Object* value = (CPDF_Object*)pThis->m_Objects.GetAt(i);
- pCopy->m_Objects.Add(value->CloneInternal(bDirect, visited));
- }
- return pCopy;
- }
- case PDFOBJ_DICTIONARY: {
- CPDF_Dictionary* pCopy = FX_NEW CPDF_Dictionary();
- CPDF_Dictionary* pThis = (CPDF_Dictionary*)this;
- FX_POSITION pos = pThis->m_Map.GetStartPosition();
- while (pos) {
- CFX_ByteString key;
- CPDF_Object* value;
- pThis->m_Map.GetNextAssoc(pos, key, (void*&)value);
- pCopy->m_Map.SetAt(key, value->CloneInternal(bDirect, visited));
- }
- return pCopy;
- }
- case PDFOBJ_NULL: {
- return FX_NEW CPDF_Null;
- }
- case PDFOBJ_STREAM: {
- CPDF_Stream* pThis = (CPDF_Stream*)this;
- CPDF_StreamAcc acc;
- acc.LoadAllData(pThis, TRUE);
- FX_DWORD streamSize = acc.GetSize();
- CPDF_Stream* pObj = FX_NEW CPDF_Stream(acc.DetachData(), streamSize, (CPDF_Dictionary*)((CPDF_Object*)pThis->GetDict())->CloneInternal(bDirect, visited));
- return pObj;
- }
- case PDFOBJ_REFERENCE: {
- CPDF_Reference* pRef = (CPDF_Reference*)this;
- FX_DWORD obj_num = pRef->m_RefObjNum;
- if (bDirect && !visited->GetValueAt((void*)(FX_UINTPTR)obj_num)) {
- visited->SetAt((void*)(FX_UINTPTR)obj_num, (void*)1);
- CPDF_Object* ret = pRef->GetDirect()->CloneInternal(TRUE, visited);
- return ret;
- } else {
- return FX_NEW CPDF_Reference(pRef->m_pObjList, obj_num);
- }
- }
- }
- return NULL;
-}
-CPDF_Object* CPDF_Object::CloneRef(CPDF_IndirectObjects* pDoc) const
-{
- if (this == NULL) {
- return NULL;
- }
- if (m_ObjNum) {
- return FX_NEW CPDF_Reference(pDoc, m_ObjNum);
- }
- return Clone();
-}
-CFX_WideString CPDF_Object::GetUnicodeText(CFX_CharMap* pCharMap) const
-{
- if (this == NULL) {
- return CFX_WideString();
- }
- if (m_Type == PDFOBJ_STRING) {
- return PDF_DecodeText(((CPDF_String*)this)->m_String, pCharMap);
- } else if (m_Type == PDFOBJ_STREAM) {
- CPDF_StreamAcc stream;
- stream.LoadAllData((CPDF_Stream*)this, FALSE);
- CFX_WideString result = PDF_DecodeText(stream.GetData(), stream.GetSize(), pCharMap);
- return result;
- } else if (m_Type == PDFOBJ_NAME) {
- return PDF_DecodeText(((CPDF_Name*)this)->m_Name, pCharMap);
- }
- return CFX_WideString();
-}
-void CPDF_Object::SetUnicodeText(FX_LPCWSTR pUnicodes, int len)
-{
- if (this == NULL) {
- return;
- }
- if (m_Type == PDFOBJ_STRING) {
- ((CPDF_String*)this)->m_String = PDF_EncodeText(pUnicodes, len);
- } else if (m_Type == PDFOBJ_STREAM) {
- CFX_ByteString result = PDF_EncodeText(pUnicodes, len);
- ((CPDF_Stream*)this)->SetData((FX_LPBYTE)(FX_LPCSTR)result, result.GetLength(), FALSE, FALSE);
- }
-}
-CPDF_Number::CPDF_Number(int value)
-{
- m_Type = PDFOBJ_NUMBER;
- m_bInteger = TRUE;
- m_Integer = value;
-}
-CPDF_Number::CPDF_Number(FX_FLOAT value)
-{
- m_Type = PDFOBJ_NUMBER;
- m_bInteger = FALSE;
- m_Float = value;
-}
-CPDF_Number::CPDF_Number(FX_BOOL bInteger, void* pData)
-{
- m_Type = PDFOBJ_NUMBER;
- m_bInteger = bInteger;
- m_Integer = *(int*)pData;
-}
-extern void FX_atonum(FX_BSTR, FX_BOOL&, void*);
-CPDF_Number::CPDF_Number(FX_BSTR str)
-{
- m_Type = PDFOBJ_NUMBER;
- FX_atonum(str, m_bInteger, &m_Integer);
-}
-void CPDF_Number::SetString(FX_BSTR str)
-{
- FX_atonum(str, m_bInteger, &m_Integer);
-}
-FX_BOOL CPDF_Number::Identical(CPDF_Number* pOther) const
-{
- return m_bInteger == pOther->m_bInteger && m_Integer == pOther->m_Integer;
-}
-CFX_ByteString CPDF_Number::GetString() const
-{
- return m_bInteger ? CFX_ByteString::FormatInteger(m_Integer, FXFORMAT_SIGNED) : CFX_ByteString::FormatFloat(m_Float);
-}
-void CPDF_Number::SetNumber(FX_FLOAT value)
-{
- m_bInteger = FALSE;
- m_Float = value;
-}
-CPDF_String::CPDF_String(const CFX_WideString& str)
-{
- m_Type = PDFOBJ_STRING;
- m_String = PDF_EncodeText(str, str.GetLength());
- m_bHex = FALSE;
-}
-CPDF_Array::~CPDF_Array()
-{
- int size = m_Objects.GetSize();
- CPDF_Object** pList = (CPDF_Object**)m_Objects.GetData();
- for (int i = 0; i < size; i ++) {
- pList[i]->Release();
- }
-}
-CFX_FloatRect CPDF_Array::GetRect()
-{
- CFX_FloatRect rect;
- if (this == NULL || m_Type != PDFOBJ_ARRAY || m_Objects.GetSize() != 4) {
- return rect;
- }
- rect.left = GetNumber(0);
- rect.bottom = GetNumber(1);
- rect.right = GetNumber(2);
- rect.top = GetNumber(3);
- return rect;
-}
-CFX_AffineMatrix CPDF_Array::GetMatrix()
-{
- CFX_AffineMatrix matrix;
- if (this == NULL || m_Type != PDFOBJ_ARRAY || m_Objects.GetSize() != 6) {
- return matrix;
- }
- matrix.Set(GetNumber(0), GetNumber(1), GetNumber(2), GetNumber(3), GetNumber(4), GetNumber(5));
- return matrix;
-}
-CPDF_Object* CPDF_Array::GetElement(FX_DWORD i) const
-{
- if (this == NULL) {
- return NULL;
- }
- if (i >= (FX_DWORD)m_Objects.GetSize()) {
- return NULL;
- }
- return (CPDF_Object*)m_Objects.GetAt(i);
-}
-CPDF_Object* CPDF_Array::GetElementValue(FX_DWORD i) const
-{
- if (this == NULL) {
- return NULL;
- }
- if (i >= (FX_DWORD)m_Objects.GetSize()) {
- return NULL;
- }
- return ((CPDF_Object*)m_Objects.GetAt(i))->GetDirect();
-}
-CFX_ByteString CPDF_Array::GetString(FX_DWORD i) const
-{
- if (this && i < (FX_DWORD)m_Objects.GetSize()) {
- CPDF_Object* p = (CPDF_Object*)m_Objects.GetAt(i);
- return p->GetString();
- }
- return CFX_ByteString();
-}
-CFX_ByteStringC CPDF_Array::GetConstString(FX_DWORD i) const
-{
- if (this && i < (FX_DWORD)m_Objects.GetSize()) {
- CPDF_Object* p = (CPDF_Object*)m_Objects.GetAt(i);
- return p->GetConstString();
- }
- return CFX_ByteStringC();
-}
-int CPDF_Array::GetInteger(FX_DWORD i) const
-{
- if (this == NULL || i >= (FX_DWORD)m_Objects.GetSize()) {
- return 0;
- }
- CPDF_Object* p = (CPDF_Object*)m_Objects.GetAt(i);
- return p->GetInteger();
-}
-FX_FLOAT CPDF_Array::GetNumber(FX_DWORD i) const
-{
- if (this == NULL || i >= (FX_DWORD)m_Objects.GetSize()) {
- return 0;
- }
- CPDF_Object* p = (CPDF_Object*)m_Objects.GetAt(i);
- return p->GetNumber();
-}
-CPDF_Dictionary* CPDF_Array::GetDict(FX_DWORD i) const
-{
- CPDF_Object* p = GetElementValue(i);
- if (p == NULL) {
- return NULL;
- } else if (p->GetType() == PDFOBJ_DICTIONARY) {
- return (CPDF_Dictionary*)p;
- } else if (p->GetType() == PDFOBJ_STREAM) {
- return ((CPDF_Stream*)p)->GetDict();
- }
- return NULL;
-}
-CPDF_Stream* CPDF_Array::GetStream(FX_DWORD i) const
-{
- CPDF_Object* p = GetElementValue(i);
- if (p == NULL || p->GetType() != PDFOBJ_STREAM) {
- return NULL;
- }
- return (CPDF_Stream*)p;
-}
-CPDF_Array* CPDF_Array::GetArray(FX_DWORD i) const
-{
- CPDF_Object* p = GetElementValue(i);
- if (p == NULL || p->GetType() != PDFOBJ_ARRAY) {
- return NULL;
- }
- return (CPDF_Array*)p;
-}
-void CPDF_Array::RemoveAt(FX_DWORD i)
-{
- ASSERT(this != NULL && m_Type == PDFOBJ_ARRAY);
- if (i >= (FX_DWORD)m_Objects.GetSize()) {
- return;
- }
- CPDF_Object* p = (CPDF_Object*)m_Objects.GetAt(i);
- p->Release();
- m_Objects.RemoveAt(i);
-}
-void CPDF_Array::SetAt(FX_DWORD i, CPDF_Object* pObj, CPDF_IndirectObjects* pObjs)
-{
- ASSERT(this != NULL && m_Type == PDFOBJ_ARRAY);
- ASSERT(i < (FX_DWORD)m_Objects.GetSize());
- if (i >= (FX_DWORD)m_Objects.GetSize()) {
- return;
- }
- CPDF_Object* pOld = (CPDF_Object*)m_Objects.GetAt(i);
- pOld->Release();
- if (pObj->GetObjNum()) {
- ASSERT(pObjs != NULL);
- pObj = CPDF_Reference::Create(pObjs, pObj->GetObjNum());
- }
- m_Objects.SetAt(i, pObj);
-}
-void CPDF_Array::InsertAt(FX_DWORD index, CPDF_Object* pObj, CPDF_IndirectObjects* pObjs)
-{
- ASSERT(pObj != NULL);
- if (pObj->GetObjNum()) {
- ASSERT(pObjs != NULL);
- pObj = CPDF_Reference::Create(pObjs, pObj->GetObjNum());
- }
- m_Objects.InsertAt(index, pObj);
-}
-void CPDF_Array::Add(CPDF_Object* pObj, CPDF_IndirectObjects* pObjs)
-{
- ASSERT(pObj != NULL);
- if (pObj->GetObjNum()) {
- ASSERT(pObjs != NULL);
- pObj = CPDF_Reference::Create(pObjs, pObj->GetObjNum());
- }
- m_Objects.Add(pObj);
-}
-void CPDF_Array::AddName(const CFX_ByteString& str)
-{
- ASSERT(this != NULL && m_Type == PDFOBJ_ARRAY);
- Add(FX_NEW CPDF_Name(str));
-}
-void CPDF_Array::AddString(const CFX_ByteString& str)
-{
- ASSERT(this != NULL && m_Type == PDFOBJ_ARRAY);
- Add(FX_NEW CPDF_String(str));
-}
-void CPDF_Array::AddInteger(int i)
-{
- ASSERT(this != NULL && m_Type == PDFOBJ_ARRAY);
- Add(FX_NEW CPDF_Number(i));
-}
-void CPDF_Array::AddNumber(FX_FLOAT f)
-{
- ASSERT(this != NULL && m_Type == PDFOBJ_ARRAY);
- CPDF_Number* pNumber = FX_NEW CPDF_Number;
- pNumber->SetNumber(f);
- Add(pNumber);
-}
-void CPDF_Array::AddReference(CPDF_IndirectObjects* pDoc, FX_DWORD objnum)
-{
- ASSERT(this != NULL && m_Type == PDFOBJ_ARRAY);
- Add(FX_NEW CPDF_Reference(pDoc, objnum));
-}
-FX_BOOL CPDF_Array::Identical(CPDF_Array* pOther) const
-{
- if (m_Objects.GetSize() != pOther->m_Objects.GetSize()) {
- return FALSE;
- }
- for (int i = 0; i < m_Objects.GetSize(); i ++)
- if (!((CPDF_Object*)m_Objects[i])->IsIdentical((CPDF_Object*)pOther->m_Objects[i])) {
- return FALSE;
- }
- return TRUE;
-}
-CPDF_Dictionary::~CPDF_Dictionary()
-{
- FX_POSITION pos = m_Map.GetStartPosition();
- while (pos) {
- FX_LPVOID value = m_Map.GetNextValue(pos);
- ((CPDF_Object*)value)->Release();
- }
-}
-FX_POSITION CPDF_Dictionary::GetStartPos() const
-{
- return m_Map.GetStartPosition();
-}
-CPDF_Object* CPDF_Dictionary::GetNextElement(FX_POSITION& pos, CFX_ByteString& key) const
-{
- if (pos == NULL) {
- return NULL;
- }
- CPDF_Object* p;
- m_Map.GetNextAssoc(pos, key, (FX_LPVOID&)p);
- return p;
-}
-CPDF_Object* CPDF_Dictionary::GetElement(FX_BSTR key) const
-{
- if (this == NULL) {
- return NULL;
- }
- CPDF_Object* p = NULL;
- m_Map.Lookup(key, (void*&)p);
- return p;
-}
-CPDF_Object* CPDF_Dictionary::GetElementValue(FX_BSTR key) const
-{
- if (this == NULL) {
- return NULL;
- }
- CPDF_Object* p = NULL;
- m_Map.Lookup(key, (void*&)p);
- return p->GetDirect();
-}
-CFX_ByteString CPDF_Dictionary::GetString(FX_BSTR key) const
-{
- if (this) {
- CPDF_Object* p = NULL;
- m_Map.Lookup(key, (void*&)p);
- if (p) {
- return p->GetString();
- }
- }
- return CFX_ByteString();
-}
-CFX_ByteStringC CPDF_Dictionary::GetConstString(FX_BSTR key) const
-{
- if (this) {
- CPDF_Object* p = NULL;
- m_Map.Lookup(key, (void*&)p);
- if (p) {
- return p->GetConstString();
- }
- }
- return CFX_ByteStringC();
-}
-CFX_WideString CPDF_Dictionary::GetUnicodeText(FX_BSTR key, CFX_CharMap* pCharMap) const
-{
- if (this) {
- CPDF_Object* p = NULL;
- m_Map.Lookup(key, (void*&)p);
- if (p) {
- if(p->GetType() == PDFOBJ_REFERENCE) {
- p = ((CPDF_Reference*)p)->GetDirect();
- return p->GetUnicodeText(pCharMap);
- } else {
- return p->GetUnicodeText(pCharMap);
- }
- }
- }
- return CFX_WideString();
-}
-CFX_ByteString CPDF_Dictionary::GetString(FX_BSTR key, FX_BSTR def) const
-{
- if (this) {
- CPDF_Object* p = NULL;
- m_Map.Lookup(key, (void*&)p);
- if (p) {
- return p->GetString();
- }
- }
- return CFX_ByteString(def);
-}
-CFX_ByteStringC CPDF_Dictionary::GetConstString(FX_BSTR key, FX_BSTR def) const
-{
- if (this) {
- CPDF_Object* p = NULL;
- m_Map.Lookup(key, (void*&)p);
- if (p) {
- return p->GetConstString();
- }
- }
- return CFX_ByteStringC(def);
-}
-int CPDF_Dictionary::GetInteger(FX_BSTR key) const
-{
- if (this) {
- CPDF_Object* p = NULL;
- m_Map.Lookup(key, (void*&)p);
- if (p) {
- return p->GetInteger();
- }
- }
- return 0;
-}
-int CPDF_Dictionary::GetInteger(FX_BSTR key, int def) const
-{
- if (this) {
- CPDF_Object* p = NULL;
- m_Map.Lookup(key, (void*&)p);
- if (p) {
- return p->GetInteger();
- }
- }
- return def;
-}
-FX_FLOAT CPDF_Dictionary::GetNumber(FX_BSTR key) const
-{
- if (this) {
- CPDF_Object* p = NULL;
- m_Map.Lookup(key, (void*&)p);
- if (p) {
- return p->GetNumber();
- }
- }
- return 0;
-}
-FX_BOOL CPDF_Dictionary::GetBoolean(FX_BSTR key, FX_BOOL bDefault) const
-{
- if (this) {
- CPDF_Object* p = NULL;
- m_Map.Lookup(key, (void*&)p);
- if (p && p->GetType() == PDFOBJ_BOOLEAN) {
- return p->GetInteger();
- }
- }
- return bDefault;
-}
-CPDF_Dictionary* CPDF_Dictionary::GetDict(FX_BSTR key) const
-{
- CPDF_Object* p = GetElementValue(key);
- if (p == NULL) {
- return NULL;
- } else if (p->GetType() == PDFOBJ_DICTIONARY) {
- return (CPDF_Dictionary*)p;
- } else if (p->GetType() == PDFOBJ_STREAM) {
- return ((CPDF_Stream*)p)->GetDict();
- }
- return NULL;
-}
-CPDF_Array* CPDF_Dictionary::GetArray(FX_BSTR key) const
-{
- CPDF_Object* p = GetElementValue(key);
- if (p == NULL || p->GetType() != PDFOBJ_ARRAY) {
- return NULL;
- }
- return (CPDF_Array*)p;
-}
-CPDF_Stream* CPDF_Dictionary::GetStream(FX_BSTR key) const
-{
- CPDF_Object* p = GetElementValue(key);
- if (p == NULL || p->GetType() != PDFOBJ_STREAM) {
- return NULL;
- }
- return (CPDF_Stream*)p;
-}
-CFX_FloatRect CPDF_Dictionary::GetRect(FX_BSTR key) const
-{
- CFX_FloatRect rect;
- CPDF_Array* pArray = GetArray(key);
- if (pArray) {
- rect = pArray->GetRect();
- }
- return rect;
-}
-CFX_AffineMatrix CPDF_Dictionary::GetMatrix(FX_BSTR key) const
-{
- CFX_AffineMatrix matrix;
- CPDF_Array* pArray = GetArray(key);
- if (pArray) {
- matrix = pArray->GetMatrix();
- }
- return matrix;
-}
-FX_BOOL CPDF_Dictionary::KeyExist(FX_BSTR key) const
-{
- if (this == NULL) {
- return FALSE;
- }
- FX_LPVOID value;
- return m_Map.Lookup(key, value);
-}
-void CPDF_Dictionary::SetAt(FX_BSTR key, CPDF_Object* pObj, CPDF_IndirectObjects* pObjs)
-{
- ASSERT(this != NULL && m_Type == PDFOBJ_DICTIONARY);
- CPDF_Object* p = NULL;
- m_Map.Lookup(key, (void*&)p);
- if (p == pObj) {
- return;
- }
- if (p) {
- p->Release();
- }
- if (pObj) {
- if (pObj->GetObjNum()) {
- ASSERT(pObjs != NULL);
- pObj = CPDF_Reference::Create(pObjs, pObj->GetObjNum());
- }
- m_Map.SetAt(key, pObj);
- } else {
- m_Map.RemoveKey(key);
- }
-}
-void CPDF_Dictionary::AddValue(FX_BSTR key, CPDF_Object* pObj)
-{
- ASSERT(this != NULL && m_Type == PDFOBJ_DICTIONARY);
- m_Map.AddValue(key, pObj);
-}
-void CPDF_Dictionary::RemoveAt(FX_BSTR key)
-{
- ASSERT(this != NULL && m_Type == PDFOBJ_DICTIONARY);
- CPDF_Object* p = NULL;
- m_Map.Lookup(key, (void*&)p);
- if (p == NULL) {
- return;
- }
- p->Release();
- m_Map.RemoveKey(key);
-}
-void CPDF_Dictionary::ReplaceKey(FX_BSTR oldkey, FX_BSTR newkey)
-{
- ASSERT(this != NULL && m_Type == PDFOBJ_DICTIONARY);
- CPDF_Object* p = NULL;
- m_Map.Lookup(oldkey, (void*&)p);
- if (p == NULL) {
- return;
- }
- m_Map.RemoveKey(oldkey);
- m_Map.SetAt(newkey, p);
-}
-FX_BOOL CPDF_Dictionary::Identical(CPDF_Dictionary* pOther) const
-{
- if (this == NULL) {
- if (pOther == NULL) {
- return TRUE;
- }
- return FALSE;
- }
- if (pOther == NULL) {
- return FALSE;
- }
- if (m_Map.GetCount() != pOther->m_Map.GetCount()) {
- return FALSE;
- }
- FX_POSITION pos = m_Map.GetStartPosition();
- while (pos) {
- CFX_ByteString key;
- FX_LPVOID value;
- m_Map.GetNextAssoc(pos, key, value);
- if (!((CPDF_Object*)value)->IsIdentical(pOther->GetElement(key))) {
- return FALSE;
- }
- }
- return TRUE;
-}
-void CPDF_Dictionary::SetAtInteger(FX_BSTR key, int i)
-{
- SetAt(key, FX_NEW CPDF_Number(i));
-}
-void CPDF_Dictionary::SetAtName(FX_BSTR key, const CFX_ByteString& name)
-{
- SetAt(key, FX_NEW CPDF_Name(name));
-}
-void CPDF_Dictionary::SetAtString(FX_BSTR key, const CFX_ByteString& str)
-{
- SetAt(key, FX_NEW CPDF_String(str));
-}
-void CPDF_Dictionary::SetAtReference(FX_BSTR key, CPDF_IndirectObjects* pDoc, FX_DWORD objnum)
-{
- SetAt(key, FX_NEW CPDF_Reference(pDoc, objnum));
-}
-void CPDF_Dictionary::AddReference(FX_BSTR key, CPDF_IndirectObjects* pDoc, FX_DWORD objnum)
-{
- AddValue(key, FX_NEW CPDF_Reference(pDoc, objnum));
-}
-void CPDF_Dictionary::SetAtNumber(FX_BSTR key, FX_FLOAT f)
-{
- CPDF_Number* pNumber = FX_NEW CPDF_Number;
- pNumber->SetNumber(f);
- SetAt(key, pNumber);
-}
-void CPDF_Dictionary::SetAtBoolean(FX_BSTR key, FX_BOOL bValue)
-{
- SetAt(key, FX_NEW CPDF_Boolean(bValue));
-}
-void CPDF_Dictionary::SetAtRect(FX_BSTR key, const CFX_FloatRect& rect)
-{
- CPDF_Array* pArray = FX_NEW CPDF_Array;
- pArray->AddNumber(rect.left);
- pArray->AddNumber(rect.bottom);
- pArray->AddNumber(rect.right);
- pArray->AddNumber(rect.top);
- SetAt(key, pArray);
-}
-void CPDF_Dictionary::SetAtMatrix(FX_BSTR key, const CFX_AffineMatrix& matrix)
-{
- CPDF_Array* pArray = FX_NEW CPDF_Array;
- pArray->AddNumber16(matrix.a);
- pArray->AddNumber16(matrix.b);
- pArray->AddNumber16(matrix.c);
- pArray->AddNumber16(matrix.d);
- pArray->AddNumber(matrix.e);
- pArray->AddNumber(matrix.f);
- SetAt(key, pArray);
-}
-CPDF_Stream::CPDF_Stream(FX_LPBYTE pData, FX_DWORD size, CPDF_Dictionary* pDict)
-{
- m_Type = PDFOBJ_STREAM;
- m_pDict = pDict;
- m_dwSize = size;
- m_GenNum = (FX_DWORD) - 1;
- m_pDataBuf = pData;
- m_pCryptoHandler = NULL;
-}
-CPDF_Stream::~CPDF_Stream()
-{
- if (m_GenNum == (FX_DWORD) - 1 && m_pDataBuf != NULL) {
- FX_Free(m_pDataBuf);
- }
- if (m_pDict) {
- m_pDict->Release();
- }
-}
-void CPDF_Stream::InitStream(CPDF_Dictionary* pDict)
-{
- if (pDict) {
- if (m_pDict) {
- m_pDict->Release();
- }
- m_pDict = pDict;
- }
- if (m_GenNum == (FX_DWORD) - 1) {
- if (m_pDataBuf) {
- FX_Free(m_pDataBuf);
- }
- }
- m_GenNum = 0;
- m_pFile = NULL;
- m_pCryptoHandler = NULL;
- m_FileOffset = 0;
-}
-void CPDF_Stream::InitStream(FX_LPBYTE pData, FX_DWORD size, CPDF_Dictionary* pDict)
-{
- InitStream(pDict);
- m_GenNum = (FX_DWORD) - 1;
- m_pDataBuf = FX_Alloc(FX_BYTE, size);
- if (pData) {
- FXSYS_memcpy32(m_pDataBuf, pData, size);
- }
- m_dwSize = size;
- if (m_pDict) {
- m_pDict->SetAtInteger(FX_BSTRC("Length"), size);
- }
-}
-void CPDF_Stream::SetData(FX_LPCBYTE pData, FX_DWORD size, FX_BOOL bCompressed, FX_BOOL bKeepBuf)
-{
- if (m_GenNum == (FX_DWORD) - 1) {
- if (m_pDataBuf) {
- FX_Free(m_pDataBuf);
- }
- } else {
- m_GenNum = (FX_DWORD) - 1;
- m_pCryptoHandler = NULL;
- }
- if (bKeepBuf) {
- m_pDataBuf = (FX_LPBYTE)pData;
- } else {
- m_pDataBuf = FX_Alloc(FX_BYTE, size);
- if (pData) {
- FXSYS_memcpy32(m_pDataBuf, pData, size);
- }
- }
- m_dwSize = size;
- if (m_pDict == NULL) {
- m_pDict = FX_NEW CPDF_Dictionary;
- }
- m_pDict->SetAtInteger(FX_BSTRC("Length"), size);
- if (!bCompressed) {
- m_pDict->RemoveAt(FX_BSTRC("Filter"));
- m_pDict->RemoveAt(FX_BSTRC("DecodeParms"));
- }
-}
-FX_BOOL CPDF_Stream::ReadRawData(FX_FILESIZE offset, FX_LPBYTE buf, FX_DWORD size) const
-{
- if ((m_GenNum != (FX_DWORD) - 1) && m_pFile) {
- return m_pFile->ReadBlock(buf, m_FileOffset + offset, size);
- }
- if (m_pDataBuf) {
- FXSYS_memcpy32(buf, m_pDataBuf + offset, size);
- }
- return TRUE;
-}
-void CPDF_Stream::InitStream(IFX_FileRead *pFile, CPDF_Dictionary* pDict)
-{
- InitStream(pDict);
- m_pFile = pFile;
- m_dwSize = (FX_DWORD)pFile->GetSize();
- if (m_pDict) {
- m_pDict->SetAtInteger(FX_BSTRC("Length"), m_dwSize);
- }
-}
-FX_BOOL CPDF_Stream::Identical(CPDF_Stream* pOther) const
-{
- if (!m_pDict->Identical(pOther->m_pDict)) {
- return FALSE;
- }
- if (m_dwSize != pOther->m_dwSize) {
- return FALSE;
- }
- if (m_GenNum != (FX_DWORD) - 1 && pOther->m_GenNum != (FX_DWORD) - 1) {
- if (m_pFile == pOther->m_pFile && m_pFile == NULL) {
- return TRUE;
- }
- if (!m_pFile || !pOther->m_pFile) {
- return FALSE;
- }
- FX_BYTE srcBuf[1024];
- FX_BYTE destBuf[1024];
- FX_DWORD size = m_dwSize;
- FX_DWORD srcOffset = m_FileOffset;
- FX_DWORD destOffset = pOther->m_FileOffset;
- if (m_pFile == pOther->m_pFile && srcOffset == destOffset) {
- return TRUE;
- }
- while (size > 0) {
- FX_DWORD actualSize = size > 1024 ? 1024 : size;
- m_pFile->ReadBlock(srcBuf, srcOffset, actualSize);
- pOther->m_pFile->ReadBlock(destBuf, destOffset, actualSize);
- if (FXSYS_memcmp32(srcBuf, destBuf, actualSize) != 0) {
- return FALSE;
- }
- size -= actualSize;
- srcOffset += actualSize;
- destOffset += actualSize;
- }
- return TRUE;
- }
- if (m_GenNum != (FX_DWORD) - 1 || pOther->m_GenNum != (FX_DWORD) - 1) {
- IFX_FileRead* pFile = NULL;
- FX_LPBYTE pBuf = NULL;
- FX_DWORD offset = 0;
- if (m_GenNum != (FX_DWORD) - 1) {
- pFile = m_pFile;
- pBuf = pOther->m_pDataBuf;
- offset = m_FileOffset;
- }
- if (pOther->m_GenNum != (FX_DWORD) - 1) {
- pFile = pOther->m_pFile;
- pBuf = m_pDataBuf;
- offset = pOther->m_FileOffset;
- }
- if (NULL == pBuf) {
- return FALSE;
- }
- FX_BYTE srcBuf[1024];
- FX_DWORD size = m_dwSize;
- while (size > 0) {
- FX_DWORD actualSize = size > 1024 ? 1024 : size;
- m_pFile->ReadBlock(srcBuf, offset, actualSize);
- if (FXSYS_memcmp32(srcBuf, pBuf, actualSize) != 0) {
- return FALSE;
- }
- pBuf += actualSize;
- size -= actualSize;
- offset += actualSize;
- }
- return TRUE;
- }
- return FXSYS_memcmp32(m_pDataBuf, pOther->m_pDataBuf, m_dwSize) == 0;
-}
-CPDF_Stream* CPDF_Stream::Clone(FX_BOOL bDirect, FPDF_LPFCloneStreamCallback lpfCallback, FX_LPVOID pUserData) const
-{
- CPDF_Dictionary *pCloneDict = (CPDF_Dictionary*)m_pDict->Clone(bDirect);
- IFX_FileStream *pFS = NULL;
- if (lpfCallback) {
- pFS = lpfCallback((CPDF_Stream*)this, pUserData);
- }
- if (!pFS) {
- CPDF_StreamAcc acc;
- acc.LoadAllData(this, TRUE);
- FX_DWORD streamSize = acc.GetSize();
- CPDF_Stream* pObj = FX_NEW CPDF_Stream(acc.DetachData(), streamSize, pCloneDict);
- return pObj;
- }
- CPDF_Stream* pObj = FX_NEW CPDF_Stream(NULL, 0, NULL);
- CPDF_StreamFilter *pSF = GetStreamFilter(TRUE);
- if (pSF) {
- FX_LPBYTE pBuf = FX_Alloc(FX_BYTE, 4096);
- FX_DWORD dwRead;
- do {
- dwRead = pSF->ReadBlock(pBuf, 4096);
- if (dwRead) {
- pFS->WriteBlock(pBuf, dwRead);
- }
- } while (dwRead == 4096);
- pFS->Flush();
- FX_Free(pBuf);
- delete pSF;
- }
- pObj->InitStream((IFX_FileRead*)pFS, pCloneDict);
- return pObj;
-}
-extern FX_BOOL PDF_DataDecode(FX_LPCBYTE src_buf, FX_DWORD src_size, const CPDF_Dictionary* pDict,
- FX_LPBYTE& dest_buf, FX_DWORD& dest_size, CFX_ByteString& ImageEncoding,
- CPDF_Dictionary*& pImageParms, FX_DWORD estimated_size, FX_BOOL bImageAcc);
-CPDF_StreamAcc::CPDF_StreamAcc()
-{
- m_bNewBuf = FALSE;
- m_pData = NULL;
- m_dwSize = 0;
- m_pImageParam = NULL;
- m_pStream = NULL;
- m_pSrcData = NULL;
-}
-void CPDF_StreamAcc::LoadAllData(const CPDF_Stream* pStream, FX_BOOL bRawAccess, FX_DWORD estimated_size,
- FX_BOOL bImageAcc)
-{
- if (pStream == NULL || pStream->GetType() != PDFOBJ_STREAM) {
- return;
- }
- m_pStream = pStream;
- if (pStream->IsMemoryBased() &&
- (!pStream->GetDict()->KeyExist(FX_BSTRC("Filter")) || bRawAccess)) {
- m_dwSize = pStream->m_dwSize;
- m_pData = (FX_LPBYTE)pStream->m_pDataBuf;
- return;
- }
- FX_LPBYTE pSrcData;
- FX_DWORD dwSrcSize = pStream->m_dwSize;
- if (dwSrcSize == 0) {
- return;
- }
- if (!pStream->IsMemoryBased()) {
- pSrcData = m_pSrcData = FX_Alloc(FX_BYTE, dwSrcSize);
- if (!pSrcData || !pStream->ReadRawData(0, pSrcData, dwSrcSize)) {
- return;
- }
- } else {
- pSrcData = pStream->m_pDataBuf;
- }
- FX_LPBYTE pDecryptedData;
- FX_DWORD dwDecryptedSize;
- if (pStream->m_pCryptoHandler) {
- CFX_BinaryBuf dest_buf;
- dest_buf.EstimateSize(pStream->m_pCryptoHandler->DecryptGetSize(dwSrcSize));
- FX_LPVOID context = pStream->m_pCryptoHandler->DecryptStart(pStream->GetObjNum(), pStream->m_GenNum);
- pStream->m_pCryptoHandler->DecryptStream(context, pSrcData, dwSrcSize, dest_buf);
- pStream->m_pCryptoHandler->DecryptFinish(context, dest_buf);
- pDecryptedData = dest_buf.GetBuffer();
- dwDecryptedSize = dest_buf.GetSize();
- dest_buf.DetachBuffer();
- } else {
- pDecryptedData = pSrcData;
- dwDecryptedSize = dwSrcSize;
- }
- if (!pStream->GetDict()->KeyExist(FX_BSTRC("Filter")) || bRawAccess) {
- m_pData = pDecryptedData;
- m_dwSize = dwDecryptedSize;
- } else {
- FX_BOOL bRet = PDF_DataDecode(pDecryptedData, dwDecryptedSize, m_pStream->GetDict(),
- m_pData, m_dwSize, m_ImageDecoder, m_pImageParam, estimated_size, bImageAcc);
- if (!bRet) {
- m_pData = pDecryptedData;
- m_dwSize = dwDecryptedSize;
- }
- }
- if (pSrcData != pStream->m_pDataBuf && pSrcData != m_pData) {
- FX_Free(pSrcData);
- }
- if (pDecryptedData != pSrcData && pDecryptedData != m_pData) {
- FX_Free(pDecryptedData);
- }
- m_pSrcData = NULL;
- m_bNewBuf = m_pData != pStream->m_pDataBuf;
-}
-CPDF_StreamAcc::~CPDF_StreamAcc()
-{
- if (m_bNewBuf && m_pData) {
- FX_Free(m_pData);
- }
- if (m_pSrcData) {
- FX_Free(m_pSrcData);
- }
-}
-FX_LPCBYTE CPDF_StreamAcc::GetData() const
-{
- if (m_bNewBuf) {
- return m_pData;
- }
- if (!m_pStream) {
- return NULL;
- }
- return m_pStream->m_pDataBuf;
-}
-FX_DWORD CPDF_StreamAcc::GetSize() const
-{
- if (m_bNewBuf) {
- return m_dwSize;
- }
- if (!m_pStream) {
- return 0;
- }
- return m_pStream->m_dwSize;
-}
-FX_LPBYTE CPDF_StreamAcc::DetachData()
-{
- if (m_bNewBuf) {
- FX_LPBYTE p = m_pData;
- m_pData = NULL;
- m_dwSize = 0;
- return p;
- }
- FX_LPBYTE p = FX_Alloc(FX_BYTE, m_dwSize);
- if (p == NULL) {
- return NULL;
- }
- FXSYS_memcpy32(p, m_pData, m_dwSize);
- return p;
-}
-void CPDF_Reference::SetRef(CPDF_IndirectObjects* pDoc, FX_DWORD objnum)
-{
- m_pObjList = pDoc;
- m_RefObjNum = objnum;
-}
-CPDF_IndirectObjects::CPDF_IndirectObjects(IPDF_DocParser* pParser)
-{
- m_pParser = pParser;
- m_IndirectObjs.InitHashTable(1013);
- if (pParser) {
- m_LastObjNum = m_pParser->GetLastObjNum();
- } else {
- m_LastObjNum = 0;
- }
-}
-CPDF_IndirectObjects::~CPDF_IndirectObjects()
-{
- FX_POSITION pos = m_IndirectObjs.GetStartPosition();
- while (pos) {
- FX_LPVOID key, value;
- m_IndirectObjs.GetNextAssoc(pos, key, value);
- ((CPDF_Object*)value)->Destroy();
- }
-}
-CPDF_Object* CPDF_IndirectObjects::GetIndirectObject(FX_DWORD objnum, struct PARSE_CONTEXT* pContext)
-{
- if (objnum == 0) {
- return NULL;
- }
- FX_LPVOID value;
- {
- if (m_IndirectObjs.Lookup((FX_LPVOID)(FX_UINTPTR)objnum, value)) {
- if (((CPDF_Object*)value)->GetObjNum() == -1) {
- return NULL;
- }
- return (CPDF_Object*)value;
- }
- }
- CPDF_Object* pObj = NULL;
- if (m_pParser) {
- pObj = m_pParser->ParseIndirectObject(this, objnum, pContext);
- }
- if (pObj == NULL) {
- return NULL;
- }
- pObj->m_ObjNum = objnum;
- if (m_LastObjNum < objnum) {
- m_LastObjNum = objnum;
- }
- if (m_IndirectObjs.Lookup((FX_LPVOID)(FX_UINTPTR)objnum, value)) {
- if (value) {
- ((CPDF_Object *)value)->Destroy();
- }
- }
- m_IndirectObjs.SetAt((FX_LPVOID)(FX_UINTPTR)objnum, pObj);
- return pObj;
-}
-int CPDF_IndirectObjects::GetIndirectType(FX_DWORD objnum)
-{
- FX_LPVOID value;
- if (m_IndirectObjs.Lookup((FX_LPVOID)(FX_UINTPTR)objnum, value)) {
- return ((CPDF_Object*)value)->GetType();
- }
- if (m_pParser) {
- PARSE_CONTEXT context;
- FXSYS_memset32(&context, 0, sizeof(PARSE_CONTEXT));
- context.m_Flags = PDFPARSE_TYPEONLY;
- return (int)(FX_UINTPTR)m_pParser->ParseIndirectObject(this, objnum, &context);
- }
- return 0;
-}
-FX_DWORD CPDF_IndirectObjects::AddIndirectObject(CPDF_Object* pObj)
-{
- if (pObj->m_ObjNum) {
- return pObj->m_ObjNum;
- }
- m_LastObjNum ++;
- m_IndirectObjs.SetAt((FX_LPVOID)(FX_UINTPTR)m_LastObjNum, pObj);
- pObj->m_ObjNum = m_LastObjNum;
- return m_LastObjNum;
-}
-void CPDF_IndirectObjects::ReleaseIndirectObject(FX_DWORD objnum)
-{
- FX_LPVOID value;
- if (!m_IndirectObjs.Lookup((FX_LPVOID)(FX_UINTPTR)objnum, value)) {
- return;
- }
- if (((CPDF_Object*)value)->GetObjNum() == -1) {
- return;
- }
- ((CPDF_Object*)value)->Destroy();
- m_IndirectObjs.RemoveKey((FX_LPVOID)(FX_UINTPTR)objnum);
-}
-void CPDF_IndirectObjects::InsertIndirectObject(FX_DWORD objnum, CPDF_Object* pObj)
-{
- if (objnum == 0 || pObj == NULL) {
- return;
- }
- FX_LPVOID value;
- if (m_IndirectObjs.Lookup((FX_LPVOID)(FX_UINTPTR)objnum, value)) {
- ((CPDF_Object*)value)->Destroy();
- }
- pObj->m_ObjNum = objnum;
- m_IndirectObjs.SetAt((FX_LPVOID)(FX_UINTPTR)objnum, pObj);
- if (m_LastObjNum < objnum) {
- m_LastObjNum = objnum;
- }
-}
-FX_DWORD CPDF_IndirectObjects::GetLastObjNum() const
-{
- return m_LastObjNum;
-}
+// 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
+
+#include "../../../include/fpdfapi/fpdf_parser.h"
+void CPDF_Object::Release()
+{
+ if (this == NULL) {
+ return;
+ }
+ if (m_ObjNum) {
+ return;
+ }
+ Destroy();
+}
+void CPDF_Object::Destroy()
+{
+ switch (m_Type) {
+ case PDFOBJ_STRING:
+ delete (CPDF_String*)this;
+ break;
+ case PDFOBJ_NAME:
+ delete (CPDF_Name*)this;
+ break;
+ case PDFOBJ_ARRAY:
+ delete (CPDF_Array*)this;
+ break;
+ case PDFOBJ_DICTIONARY:
+ delete (CPDF_Dictionary*)this;
+ break;
+ case PDFOBJ_STREAM:
+ delete (CPDF_Stream*)this;
+ break;
+ default:
+ delete this;
+ }
+}
+CFX_ByteString CPDF_Object::GetString() const
+{
+ if (this == NULL) {
+ return CFX_ByteString();
+ }
+ switch (m_Type) {
+ case PDFOBJ_BOOLEAN:
+ return ((CPDF_Boolean*)this)->m_bValue ? "true" : "false";
+ case PDFOBJ_NUMBER:
+ return ((CPDF_Number*)this)->GetString();
+ case PDFOBJ_STRING:
+ return ((CPDF_String*)this)->m_String;
+ case PDFOBJ_NAME:
+ return ((CPDF_Name*)this)->m_Name;
+ case PDFOBJ_REFERENCE: {
+ CPDF_Reference* pRef = (CPDF_Reference*)(FX_LPVOID)this;
+ if (pRef->m_pObjList == NULL) {
+ break;
+ }
+ CPDF_Object* pObj = pRef->m_pObjList->GetIndirectObject(pRef->m_RefObjNum);
+ if (pObj == NULL) {
+ return CFX_ByteString();
+ }
+ return pObj->GetString();
+ }
+ }
+ return CFX_ByteString();
+}
+CFX_ByteStringC CPDF_Object::GetConstString() const
+{
+ if (this == NULL) {
+ return CFX_ByteStringC();
+ }
+ switch (m_Type) {
+ case PDFOBJ_STRING:
+ return CFX_ByteStringC((FX_LPCBYTE)((CPDF_String*)this)->m_String, ((CPDF_String*)this)->m_String.GetLength());
+ case PDFOBJ_NAME:
+ return CFX_ByteStringC((FX_LPCBYTE)((CPDF_Name*)this)->m_Name, ((CPDF_Name*)this)->m_Name.GetLength());
+ case PDFOBJ_REFERENCE: {
+ CPDF_Reference* pRef = (CPDF_Reference*)(FX_LPVOID)this;
+ if (pRef->m_pObjList == NULL) {
+ break;
+ }
+ CPDF_Object* pObj = pRef->m_pObjList->GetIndirectObject(pRef->m_RefObjNum);
+ if (pObj == NULL) {
+ return CFX_ByteStringC();
+ }
+ return pObj->GetConstString();
+ }
+ }
+ return CFX_ByteStringC();
+}
+FX_FLOAT CPDF_Object::GetNumber() const
+{
+ if (this == NULL) {
+ return 0;
+ }
+ switch (m_Type) {
+ case PDFOBJ_NUMBER:
+ return ((CPDF_Number*)this)->GetNumber();
+ case PDFOBJ_REFERENCE: {
+ CPDF_Reference* pRef = (CPDF_Reference*)(FX_LPVOID)this;
+ if (pRef->m_pObjList == NULL) {
+ break;
+ }
+ CPDF_Object* pObj = pRef->m_pObjList->GetIndirectObject(pRef->m_RefObjNum);
+ if (pObj == NULL) {
+ return 0;
+ }
+ return pObj->GetNumber();
+ }
+ }
+ return 0;
+}
+FX_FLOAT CPDF_Object::GetNumber16() const
+{
+ return GetNumber();
+}
+int CPDF_Object::GetInteger() const
+{
+ if (this == NULL) {
+ return 0;
+ }
+ switch (m_Type) {
+ case PDFOBJ_BOOLEAN:
+ return ((CPDF_Boolean*)this)->m_bValue;
+ case PDFOBJ_NUMBER:
+ return ((CPDF_Number*)this)->GetInteger();
+ case PDFOBJ_REFERENCE: {
+ CPDF_Reference* pRef = (CPDF_Reference*)(FX_LPVOID)this;
+ PARSE_CONTEXT context;
+ FXSYS_memset32(&context, 0, sizeof(PARSE_CONTEXT));
+ if (pRef->m_pObjList == NULL) {
+ return 0;
+ }
+ CPDF_Object* pObj = pRef->m_pObjList->GetIndirectObject(pRef->m_RefObjNum, &context);
+ if (pObj == NULL) {
+ return 0;
+ }
+ return pObj->GetInteger();
+ }
+ }
+ return 0;
+}
+CPDF_Dictionary* CPDF_Object::GetDict() const
+{
+ if (this == NULL) {
+ return NULL;
+ }
+ switch (m_Type) {
+ case PDFOBJ_DICTIONARY:
+ return (CPDF_Dictionary*)this;
+ case PDFOBJ_STREAM:
+ return ((CPDF_Stream*)this)->GetDict();
+ case PDFOBJ_REFERENCE: {
+ CPDF_Reference* pRef = (CPDF_Reference*)this;
+ if (pRef->m_pObjList == NULL) {
+ break;
+ }
+ CPDF_Object* pObj = pRef->m_pObjList->GetIndirectObject(pRef->m_RefObjNum);
+ if (pObj == NULL) {
+ return NULL;
+ }
+ return pObj->GetDict();
+ }
+ }
+ return NULL;
+}
+CPDF_Array* CPDF_Object::GetArray() const
+{
+ if (this == NULL) {
+ return NULL;
+ }
+ if (m_Type == PDFOBJ_ARRAY) {
+ return (CPDF_Array*)this;
+ }
+ return NULL;
+}
+void CPDF_Object::SetString(const CFX_ByteString& str)
+{
+ ASSERT(this != NULL);
+ switch (m_Type) {
+ case PDFOBJ_BOOLEAN:
+ ((CPDF_Boolean*)this)->m_bValue = str == FX_BSTRC("true") ? 1 : 0;
+ return;
+ case PDFOBJ_NUMBER:
+ ((CPDF_Number*)this)->SetString(str);
+ return;
+ case PDFOBJ_STRING:
+ ((CPDF_String*)this)->m_String = str;
+ return;
+ case PDFOBJ_NAME:
+ ((CPDF_Name*)this)->m_Name = str;
+ return;
+ }
+ ASSERT(FALSE);
+}
+int CPDF_Object::GetDirectType() const
+{
+ if (m_Type != PDFOBJ_REFERENCE) {
+ return m_Type;
+ }
+ CPDF_Reference* pRef = (CPDF_Reference*)this;
+ return pRef->m_pObjList->GetIndirectType(pRef->m_RefObjNum);
+}
+FX_BOOL CPDF_Object::IsIdentical(CPDF_Object* pOther) const
+{
+ if (this == pOther) {
+ return TRUE;
+ }
+ if (this == NULL || pOther == NULL) {
+ return FALSE;
+ }
+ if (pOther->m_Type != m_Type) {
+ if (m_Type == PDFOBJ_REFERENCE) {
+ return GetDirect()->IsIdentical(pOther);
+ } else if (pOther->m_Type == PDFOBJ_REFERENCE) {
+ return IsIdentical(pOther->GetDirect());
+ }
+ return FALSE;
+ }
+ switch (m_Type) {
+ case PDFOBJ_BOOLEAN:
+ return (((CPDF_Boolean*)this)->Identical((CPDF_Boolean*)pOther));
+ case PDFOBJ_NUMBER:
+ return (((CPDF_Number*)this)->Identical((CPDF_Number*)pOther));
+ case PDFOBJ_STRING:
+ return (((CPDF_String*)this)->Identical((CPDF_String*)pOther));
+ case PDFOBJ_NAME:
+ return (((CPDF_Name*)this)->Identical((CPDF_Name*)pOther));
+ case PDFOBJ_ARRAY:
+ return (((CPDF_Array*)this)->Identical((CPDF_Array*)pOther));
+ case PDFOBJ_DICTIONARY:
+ return (((CPDF_Dictionary*)this)->Identical((CPDF_Dictionary*)pOther));
+ case PDFOBJ_NULL:
+ return TRUE;
+ case PDFOBJ_STREAM:
+ return (((CPDF_Stream*)this)->Identical((CPDF_Stream*)pOther));
+ case PDFOBJ_REFERENCE:
+ return (((CPDF_Reference*)this)->Identical((CPDF_Reference*)pOther));
+ }
+ return FALSE;
+}
+CPDF_Object* CPDF_Object::GetDirect() const
+{
+ if (this == NULL) {
+ return NULL;
+ }
+ if (m_Type != PDFOBJ_REFERENCE) {
+ return (CPDF_Object*)this;
+ }
+ CPDF_Reference* pRef = (CPDF_Reference*)(FX_LPVOID)this;
+ if (pRef->m_pObjList == NULL) {
+ return NULL;
+ }
+ return pRef->m_pObjList->GetIndirectObject(pRef->m_RefObjNum);
+}
+CPDF_Object* CPDF_Object::Clone(FX_BOOL bDirect) const
+{
+ CFX_MapPtrToPtr visited;
+ return CloneInternal(bDirect, &visited);
+}
+CPDF_Object* CPDF_Object::CloneInternal(FX_BOOL bDirect, CFX_MapPtrToPtr* visited) const
+{
+ if (this == NULL) {
+ return NULL;
+ }
+ switch (m_Type) {
+ case PDFOBJ_BOOLEAN:
+ return FX_NEW CPDF_Boolean(((CPDF_Boolean*)this)->m_bValue);
+ case PDFOBJ_NUMBER:
+ return FX_NEW CPDF_Number(((CPDF_Number*)this)->m_bInteger, &((CPDF_Number*)this)->m_Integer);
+ case PDFOBJ_STRING:
+ return FX_NEW CPDF_String(((CPDF_String*)this)->m_String, ((CPDF_String*)this)->IsHex());
+ case PDFOBJ_NAME:
+ return FX_NEW CPDF_Name(((CPDF_Name*)this)->m_Name);
+ case PDFOBJ_ARRAY: {
+ CPDF_Array* pCopy = FX_NEW CPDF_Array();
+ CPDF_Array* pThis = (CPDF_Array*)this;
+ int n = pThis->GetCount();
+ for (int i = 0; i < n; i ++) {
+ CPDF_Object* value = (CPDF_Object*)pThis->m_Objects.GetAt(i);
+ pCopy->m_Objects.Add(value->CloneInternal(bDirect, visited));
+ }
+ return pCopy;
+ }
+ case PDFOBJ_DICTIONARY: {
+ CPDF_Dictionary* pCopy = FX_NEW CPDF_Dictionary();
+ CPDF_Dictionary* pThis = (CPDF_Dictionary*)this;
+ FX_POSITION pos = pThis->m_Map.GetStartPosition();
+ while (pos) {
+ CFX_ByteString key;
+ CPDF_Object* value;
+ pThis->m_Map.GetNextAssoc(pos, key, (void*&)value);
+ pCopy->m_Map.SetAt(key, value->CloneInternal(bDirect, visited));
+ }
+ return pCopy;
+ }
+ case PDFOBJ_NULL: {
+ return FX_NEW CPDF_Null;
+ }
+ case PDFOBJ_STREAM: {
+ CPDF_Stream* pThis = (CPDF_Stream*)this;
+ CPDF_StreamAcc acc;
+ acc.LoadAllData(pThis, TRUE);
+ FX_DWORD streamSize = acc.GetSize();
+ CPDF_Stream* pObj = FX_NEW CPDF_Stream(acc.DetachData(), streamSize, (CPDF_Dictionary*)((CPDF_Object*)pThis->GetDict())->CloneInternal(bDirect, visited));
+ return pObj;
+ }
+ case PDFOBJ_REFERENCE: {
+ CPDF_Reference* pRef = (CPDF_Reference*)this;
+ FX_DWORD obj_num = pRef->m_RefObjNum;
+ if (bDirect && !visited->GetValueAt((void*)(FX_UINTPTR)obj_num)) {
+ visited->SetAt((void*)(FX_UINTPTR)obj_num, (void*)1);
+ CPDF_Object* ret = pRef->GetDirect()->CloneInternal(TRUE, visited);
+ return ret;
+ } else {
+ return FX_NEW CPDF_Reference(pRef->m_pObjList, obj_num);
+ }
+ }
+ }
+ return NULL;
+}
+CPDF_Object* CPDF_Object::CloneRef(CPDF_IndirectObjects* pDoc) const
+{
+ if (this == NULL) {
+ return NULL;
+ }
+ if (m_ObjNum) {
+ return FX_NEW CPDF_Reference(pDoc, m_ObjNum);
+ }
+ return Clone();
+}
+CFX_WideString CPDF_Object::GetUnicodeText(CFX_CharMap* pCharMap) const
+{
+ if (this == NULL) {
+ return CFX_WideString();
+ }
+ if (m_Type == PDFOBJ_STRING) {
+ return PDF_DecodeText(((CPDF_String*)this)->m_String, pCharMap);
+ } else if (m_Type == PDFOBJ_STREAM) {
+ CPDF_StreamAcc stream;
+ stream.LoadAllData((CPDF_Stream*)this, FALSE);
+ CFX_WideString result = PDF_DecodeText(stream.GetData(), stream.GetSize(), pCharMap);
+ return result;
+ } else if (m_Type == PDFOBJ_NAME) {
+ return PDF_DecodeText(((CPDF_Name*)this)->m_Name, pCharMap);
+ }
+ return CFX_WideString();
+}
+void CPDF_Object::SetUnicodeText(FX_LPCWSTR pUnicodes, int len)
+{
+ if (this == NULL) {
+ return;
+ }
+ if (m_Type == PDFOBJ_STRING) {
+ ((CPDF_String*)this)->m_String = PDF_EncodeText(pUnicodes, len);
+ } else if (m_Type == PDFOBJ_STREAM) {
+ CFX_ByteString result = PDF_EncodeText(pUnicodes, len);
+ ((CPDF_Stream*)this)->SetData((FX_LPBYTE)(FX_LPCSTR)result, result.GetLength(), FALSE, FALSE);
+ }
+}
+CPDF_Number::CPDF_Number(int value)
+{
+ m_Type = PDFOBJ_NUMBER;
+ m_bInteger = TRUE;
+ m_Integer = value;
+}
+CPDF_Number::CPDF_Number(FX_FLOAT value)
+{
+ m_Type = PDFOBJ_NUMBER;
+ m_bInteger = FALSE;
+ m_Float = value;
+}
+CPDF_Number::CPDF_Number(FX_BOOL bInteger, void* pData)
+{
+ m_Type = PDFOBJ_NUMBER;
+ m_bInteger = bInteger;
+ m_Integer = *(int*)pData;
+}
+extern void FX_atonum(FX_BSTR, FX_BOOL&, void*);
+CPDF_Number::CPDF_Number(FX_BSTR str)
+{
+ m_Type = PDFOBJ_NUMBER;
+ FX_atonum(str, m_bInteger, &m_Integer);
+}
+void CPDF_Number::SetString(FX_BSTR str)
+{
+ FX_atonum(str, m_bInteger, &m_Integer);
+}
+FX_BOOL CPDF_Number::Identical(CPDF_Number* pOther) const
+{
+ return m_bInteger == pOther->m_bInteger && m_Integer == pOther->m_Integer;
+}
+CFX_ByteString CPDF_Number::GetString() const
+{
+ return m_bInteger ? CFX_ByteString::FormatInteger(m_Integer, FXFORMAT_SIGNED) : CFX_ByteString::FormatFloat(m_Float);
+}
+void CPDF_Number::SetNumber(FX_FLOAT value)
+{
+ m_bInteger = FALSE;
+ m_Float = value;
+}
+CPDF_String::CPDF_String(const CFX_WideString& str)
+{
+ m_Type = PDFOBJ_STRING;
+ m_String = PDF_EncodeText(str, str.GetLength());
+ m_bHex = FALSE;
+}
+CPDF_Array::~CPDF_Array()
+{
+ int size = m_Objects.GetSize();
+ CPDF_Object** pList = (CPDF_Object**)m_Objects.GetData();
+ for (int i = 0; i < size; i ++) {
+ pList[i]->Release();
+ }
+}
+CFX_FloatRect CPDF_Array::GetRect()
+{
+ CFX_FloatRect rect;
+ if (this == NULL || m_Type != PDFOBJ_ARRAY || m_Objects.GetSize() != 4) {
+ return rect;
+ }
+ rect.left = GetNumber(0);
+ rect.bottom = GetNumber(1);
+ rect.right = GetNumber(2);
+ rect.top = GetNumber(3);
+ return rect;
+}
+CFX_AffineMatrix CPDF_Array::GetMatrix()
+{
+ CFX_AffineMatrix matrix;
+ if (this == NULL || m_Type != PDFOBJ_ARRAY || m_Objects.GetSize() != 6) {
+ return matrix;
+ }
+ matrix.Set(GetNumber(0), GetNumber(1), GetNumber(2), GetNumber(3), GetNumber(4), GetNumber(5));
+ return matrix;
+}
+CPDF_Object* CPDF_Array::GetElement(FX_DWORD i) const
+{
+ if (this == NULL) {
+ return NULL;
+ }
+ if (i >= (FX_DWORD)m_Objects.GetSize()) {
+ return NULL;
+ }
+ return (CPDF_Object*)m_Objects.GetAt(i);
+}
+CPDF_Object* CPDF_Array::GetElementValue(FX_DWORD i) const
+{
+ if (this == NULL) {
+ return NULL;
+ }
+ if (i >= (FX_DWORD)m_Objects.GetSize()) {
+ return NULL;
+ }
+ return ((CPDF_Object*)m_Objects.GetAt(i))->GetDirect();
+}
+CFX_ByteString CPDF_Array::GetString(FX_DWORD i) const
+{
+ if (this && i < (FX_DWORD)m_Objects.GetSize()) {
+ CPDF_Object* p = (CPDF_Object*)m_Objects.GetAt(i);
+ return p->GetString();
+ }
+ return CFX_ByteString();
+}
+CFX_ByteStringC CPDF_Array::GetConstString(FX_DWORD i) const
+{
+ if (this && i < (FX_DWORD)m_Objects.GetSize()) {
+ CPDF_Object* p = (CPDF_Object*)m_Objects.GetAt(i);
+ return p->GetConstString();
+ }
+ return CFX_ByteStringC();
+}
+int CPDF_Array::GetInteger(FX_DWORD i) const
+{
+ if (this == NULL || i >= (FX_DWORD)m_Objects.GetSize()) {
+ return 0;
+ }
+ CPDF_Object* p = (CPDF_Object*)m_Objects.GetAt(i);
+ return p->GetInteger();
+}
+FX_FLOAT CPDF_Array::GetNumber(FX_DWORD i) const
+{
+ if (this == NULL || i >= (FX_DWORD)m_Objects.GetSize()) {
+ return 0;
+ }
+ CPDF_Object* p = (CPDF_Object*)m_Objects.GetAt(i);
+ return p->GetNumber();
+}
+CPDF_Dictionary* CPDF_Array::GetDict(FX_DWORD i) const
+{
+ CPDF_Object* p = GetElementValue(i);
+ if (p == NULL) {
+ return NULL;
+ } else if (p->GetType() == PDFOBJ_DICTIONARY) {
+ return (CPDF_Dictionary*)p;
+ } else if (p->GetType() == PDFOBJ_STREAM) {
+ return ((CPDF_Stream*)p)->GetDict();
+ }
+ return NULL;
+}
+CPDF_Stream* CPDF_Array::GetStream(FX_DWORD i) const
+{
+ CPDF_Object* p = GetElementValue(i);
+ if (p == NULL || p->GetType() != PDFOBJ_STREAM) {
+ return NULL;
+ }
+ return (CPDF_Stream*)p;
+}
+CPDF_Array* CPDF_Array::GetArray(FX_DWORD i) const
+{
+ CPDF_Object* p = GetElementValue(i);
+ if (p == NULL || p->GetType() != PDFOBJ_ARRAY) {
+ return NULL;
+ }
+ return (CPDF_Array*)p;
+}
+void CPDF_Array::RemoveAt(FX_DWORD i)
+{
+ ASSERT(this != NULL && m_Type == PDFOBJ_ARRAY);
+ if (i >= (FX_DWORD)m_Objects.GetSize()) {
+ return;
+ }
+ CPDF_Object* p = (CPDF_Object*)m_Objects.GetAt(i);
+ p->Release();
+ m_Objects.RemoveAt(i);
+}
+void CPDF_Array::SetAt(FX_DWORD i, CPDF_Object* pObj, CPDF_IndirectObjects* pObjs)
+{
+ ASSERT(this != NULL && m_Type == PDFOBJ_ARRAY);
+ ASSERT(i < (FX_DWORD)m_Objects.GetSize());
+ if (i >= (FX_DWORD)m_Objects.GetSize()) {
+ return;
+ }
+ CPDF_Object* pOld = (CPDF_Object*)m_Objects.GetAt(i);
+ pOld->Release();
+ if (pObj->GetObjNum()) {
+ ASSERT(pObjs != NULL);
+ pObj = CPDF_Reference::Create(pObjs, pObj->GetObjNum());
+ }
+ m_Objects.SetAt(i, pObj);
+}
+void CPDF_Array::InsertAt(FX_DWORD index, CPDF_Object* pObj, CPDF_IndirectObjects* pObjs)
+{
+ ASSERT(pObj != NULL);
+ if (pObj->GetObjNum()) {
+ ASSERT(pObjs != NULL);
+ pObj = CPDF_Reference::Create(pObjs, pObj->GetObjNum());
+ }
+ m_Objects.InsertAt(index, pObj);
+}
+void CPDF_Array::Add(CPDF_Object* pObj, CPDF_IndirectObjects* pObjs)
+{
+ ASSERT(pObj != NULL);
+ if (pObj->GetObjNum()) {
+ ASSERT(pObjs != NULL);
+ pObj = CPDF_Reference::Create(pObjs, pObj->GetObjNum());
+ }
+ m_Objects.Add(pObj);
+}
+void CPDF_Array::AddName(const CFX_ByteString& str)
+{
+ ASSERT(this != NULL && m_Type == PDFOBJ_ARRAY);
+ Add(FX_NEW CPDF_Name(str));
+}
+void CPDF_Array::AddString(const CFX_ByteString& str)
+{
+ ASSERT(this != NULL && m_Type == PDFOBJ_ARRAY);
+ Add(FX_NEW CPDF_String(str));
+}
+void CPDF_Array::AddInteger(int i)
+{
+ ASSERT(this != NULL && m_Type == PDFOBJ_ARRAY);
+ Add(FX_NEW CPDF_Number(i));
+}
+void CPDF_Array::AddNumber(FX_FLOAT f)
+{
+ ASSERT(this != NULL && m_Type == PDFOBJ_ARRAY);
+ CPDF_Number* pNumber = FX_NEW CPDF_Number;
+ pNumber->SetNumber(f);
+ Add(pNumber);
+}
+void CPDF_Array::AddReference(CPDF_IndirectObjects* pDoc, FX_DWORD objnum)
+{
+ ASSERT(this != NULL && m_Type == PDFOBJ_ARRAY);
+ Add(FX_NEW CPDF_Reference(pDoc, objnum));
+}
+FX_BOOL CPDF_Array::Identical(CPDF_Array* pOther) const
+{
+ if (m_Objects.GetSize() != pOther->m_Objects.GetSize()) {
+ return FALSE;
+ }
+ for (int i = 0; i < m_Objects.GetSize(); i ++)
+ if (!((CPDF_Object*)m_Objects[i])->IsIdentical((CPDF_Object*)pOther->m_Objects[i])) {
+ return FALSE;
+ }
+ return TRUE;
+}
+CPDF_Dictionary::~CPDF_Dictionary()
+{
+ FX_POSITION pos = m_Map.GetStartPosition();
+ while (pos) {
+ FX_LPVOID value = m_Map.GetNextValue(pos);
+ ((CPDF_Object*)value)->Release();
+ }
+}
+FX_POSITION CPDF_Dictionary::GetStartPos() const
+{
+ return m_Map.GetStartPosition();
+}
+CPDF_Object* CPDF_Dictionary::GetNextElement(FX_POSITION& pos, CFX_ByteString& key) const
+{
+ if (pos == NULL) {
+ return NULL;
+ }
+ CPDF_Object* p;
+ m_Map.GetNextAssoc(pos, key, (FX_LPVOID&)p);
+ return p;
+}
+CPDF_Object* CPDF_Dictionary::GetElement(FX_BSTR key) const
+{
+ if (this == NULL) {
+ return NULL;
+ }
+ CPDF_Object* p = NULL;
+ m_Map.Lookup(key, (void*&)p);
+ return p;
+}
+CPDF_Object* CPDF_Dictionary::GetElementValue(FX_BSTR key) const
+{
+ if (this == NULL) {
+ return NULL;
+ }
+ CPDF_Object* p = NULL;
+ m_Map.Lookup(key, (void*&)p);
+ return p->GetDirect();
+}
+CFX_ByteString CPDF_Dictionary::GetString(FX_BSTR key) const
+{
+ if (this) {
+ CPDF_Object* p = NULL;
+ m_Map.Lookup(key, (void*&)p);
+ if (p) {
+ return p->GetString();
+ }
+ }
+ return CFX_ByteString();
+}
+CFX_ByteStringC CPDF_Dictionary::GetConstString(FX_BSTR key) const
+{
+ if (this) {
+ CPDF_Object* p = NULL;
+ m_Map.Lookup(key, (void*&)p);
+ if (p) {
+ return p->GetConstString();
+ }
+ }
+ return CFX_ByteStringC();
+}
+CFX_WideString CPDF_Dictionary::GetUnicodeText(FX_BSTR key, CFX_CharMap* pCharMap) const
+{
+ if (this) {
+ CPDF_Object* p = NULL;
+ m_Map.Lookup(key, (void*&)p);
+ if (p) {
+ if(p->GetType() == PDFOBJ_REFERENCE) {
+ p = ((CPDF_Reference*)p)->GetDirect();
+ return p->GetUnicodeText(pCharMap);
+ } else {
+ return p->GetUnicodeText(pCharMap);
+ }
+ }
+ }
+ return CFX_WideString();
+}
+CFX_ByteString CPDF_Dictionary::GetString(FX_BSTR key, FX_BSTR def) const
+{
+ if (this) {
+ CPDF_Object* p = NULL;
+ m_Map.Lookup(key, (void*&)p);
+ if (p) {
+ return p->GetString();
+ }
+ }
+ return CFX_ByteString(def);
+}
+CFX_ByteStringC CPDF_Dictionary::GetConstString(FX_BSTR key, FX_BSTR def) const
+{
+ if (this) {
+ CPDF_Object* p = NULL;
+ m_Map.Lookup(key, (void*&)p);
+ if (p) {
+ return p->GetConstString();
+ }
+ }
+ return CFX_ByteStringC(def);
+}
+int CPDF_Dictionary::GetInteger(FX_BSTR key) const
+{
+ if (this) {
+ CPDF_Object* p = NULL;
+ m_Map.Lookup(key, (void*&)p);
+ if (p) {
+ return p->GetInteger();
+ }
+ }
+ return 0;
+}
+int CPDF_Dictionary::GetInteger(FX_BSTR key, int def) const
+{
+ if (this) {
+ CPDF_Object* p = NULL;
+ m_Map.Lookup(key, (void*&)p);
+ if (p) {
+ return p->GetInteger();
+ }
+ }
+ return def;
+}
+FX_FLOAT CPDF_Dictionary::GetNumber(FX_BSTR key) const
+{
+ if (this) {
+ CPDF_Object* p = NULL;
+ m_Map.Lookup(key, (void*&)p);
+ if (p) {
+ return p->GetNumber();
+ }
+ }
+ return 0;
+}
+FX_BOOL CPDF_Dictionary::GetBoolean(FX_BSTR key, FX_BOOL bDefault) const
+{
+ if (this) {
+ CPDF_Object* p = NULL;
+ m_Map.Lookup(key, (void*&)p);
+ if (p && p->GetType() == PDFOBJ_BOOLEAN) {
+ return p->GetInteger();
+ }
+ }
+ return bDefault;
+}
+CPDF_Dictionary* CPDF_Dictionary::GetDict(FX_BSTR key) const
+{
+ CPDF_Object* p = GetElementValue(key);
+ if (p == NULL) {
+ return NULL;
+ } else if (p->GetType() == PDFOBJ_DICTIONARY) {
+ return (CPDF_Dictionary*)p;
+ } else if (p->GetType() == PDFOBJ_STREAM) {
+ return ((CPDF_Stream*)p)->GetDict();
+ }
+ return NULL;
+}
+CPDF_Array* CPDF_Dictionary::GetArray(FX_BSTR key) const
+{
+ CPDF_Object* p = GetElementValue(key);
+ if (p == NULL || p->GetType() != PDFOBJ_ARRAY) {
+ return NULL;
+ }
+ return (CPDF_Array*)p;
+}
+CPDF_Stream* CPDF_Dictionary::GetStream(FX_BSTR key) const
+{
+ CPDF_Object* p = GetElementValue(key);
+ if (p == NULL || p->GetType() != PDFOBJ_STREAM) {
+ return NULL;
+ }
+ return (CPDF_Stream*)p;
+}
+CFX_FloatRect CPDF_Dictionary::GetRect(FX_BSTR key) const
+{
+ CFX_FloatRect rect;
+ CPDF_Array* pArray = GetArray(key);
+ if (pArray) {
+ rect = pArray->GetRect();
+ }
+ return rect;
+}
+CFX_AffineMatrix CPDF_Dictionary::GetMatrix(FX_BSTR key) const
+{
+ CFX_AffineMatrix matrix;
+ CPDF_Array* pArray = GetArray(key);
+ if (pArray) {
+ matrix = pArray->GetMatrix();
+ }
+ return matrix;
+}
+FX_BOOL CPDF_Dictionary::KeyExist(FX_BSTR key) const
+{
+ if (this == NULL) {
+ return FALSE;
+ }
+ FX_LPVOID value;
+ return m_Map.Lookup(key, value);
+}
+void CPDF_Dictionary::SetAt(FX_BSTR key, CPDF_Object* pObj, CPDF_IndirectObjects* pObjs)
+{
+ ASSERT(this != NULL && m_Type == PDFOBJ_DICTIONARY);
+ CPDF_Object* p = NULL;
+ m_Map.Lookup(key, (void*&)p);
+ if (p == pObj) {
+ return;
+ }
+ if (p) {
+ p->Release();
+ }
+ if (pObj) {
+ if (pObj->GetObjNum()) {
+ ASSERT(pObjs != NULL);
+ pObj = CPDF_Reference::Create(pObjs, pObj->GetObjNum());
+ }
+ m_Map.SetAt(key, pObj);
+ } else {
+ m_Map.RemoveKey(key);
+ }
+}
+void CPDF_Dictionary::AddValue(FX_BSTR key, CPDF_Object* pObj)
+{
+ ASSERT(this != NULL && m_Type == PDFOBJ_DICTIONARY);
+ m_Map.AddValue(key, pObj);
+}
+void CPDF_Dictionary::RemoveAt(FX_BSTR key)
+{
+ ASSERT(this != NULL && m_Type == PDFOBJ_DICTIONARY);
+ CPDF_Object* p = NULL;
+ m_Map.Lookup(key, (void*&)p);
+ if (p == NULL) {
+ return;
+ }
+ p->Release();
+ m_Map.RemoveKey(key);
+}
+void CPDF_Dictionary::ReplaceKey(FX_BSTR oldkey, FX_BSTR newkey)
+{
+ ASSERT(this != NULL && m_Type == PDFOBJ_DICTIONARY);
+ CPDF_Object* p = NULL;
+ m_Map.Lookup(oldkey, (void*&)p);
+ if (p == NULL) {
+ return;
+ }
+ m_Map.RemoveKey(oldkey);
+ m_Map.SetAt(newkey, p);
+}
+FX_BOOL CPDF_Dictionary::Identical(CPDF_Dictionary* pOther) const
+{
+ if (this == NULL) {
+ if (pOther == NULL) {
+ return TRUE;
+ }
+ return FALSE;
+ }
+ if (pOther == NULL) {
+ return FALSE;
+ }
+ if (m_Map.GetCount() != pOther->m_Map.GetCount()) {
+ return FALSE;
+ }
+ FX_POSITION pos = m_Map.GetStartPosition();
+ while (pos) {
+ CFX_ByteString key;
+ FX_LPVOID value;
+ m_Map.GetNextAssoc(pos, key, value);
+ if (!((CPDF_Object*)value)->IsIdentical(pOther->GetElement(key))) {
+ return FALSE;
+ }
+ }
+ return TRUE;
+}
+void CPDF_Dictionary::SetAtInteger(FX_BSTR key, int i)
+{
+ SetAt(key, FX_NEW CPDF_Number(i));
+}
+void CPDF_Dictionary::SetAtName(FX_BSTR key, const CFX_ByteString& name)
+{
+ SetAt(key, FX_NEW CPDF_Name(name));
+}
+void CPDF_Dictionary::SetAtString(FX_BSTR key, const CFX_ByteString& str)
+{
+ SetAt(key, FX_NEW CPDF_String(str));
+}
+void CPDF_Dictionary::SetAtReference(FX_BSTR key, CPDF_IndirectObjects* pDoc, FX_DWORD objnum)
+{
+ SetAt(key, FX_NEW CPDF_Reference(pDoc, objnum));
+}
+void CPDF_Dictionary::AddReference(FX_BSTR key, CPDF_IndirectObjects* pDoc, FX_DWORD objnum)
+{
+ AddValue(key, FX_NEW CPDF_Reference(pDoc, objnum));
+}
+void CPDF_Dictionary::SetAtNumber(FX_BSTR key, FX_FLOAT f)
+{
+ CPDF_Number* pNumber = FX_NEW CPDF_Number;
+ pNumber->SetNumber(f);
+ SetAt(key, pNumber);
+}
+void CPDF_Dictionary::SetAtBoolean(FX_BSTR key, FX_BOOL bValue)
+{
+ SetAt(key, FX_NEW CPDF_Boolean(bValue));
+}
+void CPDF_Dictionary::SetAtRect(FX_BSTR key, const CFX_FloatRect& rect)
+{
+ CPDF_Array* pArray = FX_NEW CPDF_Array;
+ pArray->AddNumber(rect.left);
+ pArray->AddNumber(rect.bottom);
+ pArray->AddNumber(rect.right);
+ pArray->AddNumber(rect.top);
+ SetAt(key, pArray);
+}
+void CPDF_Dictionary::SetAtMatrix(FX_BSTR key, const CFX_AffineMatrix& matrix)
+{
+ CPDF_Array* pArray = FX_NEW CPDF_Array;
+ pArray->AddNumber16(matrix.a);
+ pArray->AddNumber16(matrix.b);
+ pArray->AddNumber16(matrix.c);
+ pArray->AddNumber16(matrix.d);
+ pArray->AddNumber(matrix.e);
+ pArray->AddNumber(matrix.f);
+ SetAt(key, pArray);
+}
+CPDF_Stream::CPDF_Stream(FX_LPBYTE pData, FX_DWORD size, CPDF_Dictionary* pDict)
+{
+ m_Type = PDFOBJ_STREAM;
+ m_pDict = pDict;
+ m_dwSize = size;
+ m_GenNum = (FX_DWORD) - 1;
+ m_pDataBuf = pData;
+ m_pCryptoHandler = NULL;
+}
+CPDF_Stream::~CPDF_Stream()
+{
+ if (m_GenNum == (FX_DWORD) - 1 && m_pDataBuf != NULL) {
+ FX_Free(m_pDataBuf);
+ }
+ if (m_pDict) {
+ m_pDict->Release();
+ }
+}
+void CPDF_Stream::InitStream(CPDF_Dictionary* pDict)
+{
+ if (pDict) {
+ if (m_pDict) {
+ m_pDict->Release();
+ }
+ m_pDict = pDict;
+ }
+ if (m_GenNum == (FX_DWORD) - 1) {
+ if (m_pDataBuf) {
+ FX_Free(m_pDataBuf);
+ }
+ }
+ m_GenNum = 0;
+ m_pFile = NULL;
+ m_pCryptoHandler = NULL;
+ m_FileOffset = 0;
+}
+void CPDF_Stream::InitStream(FX_LPBYTE pData, FX_DWORD size, CPDF_Dictionary* pDict)
+{
+ InitStream(pDict);
+ m_GenNum = (FX_DWORD) - 1;
+ m_pDataBuf = FX_Alloc(FX_BYTE, size);
+ if (pData) {
+ FXSYS_memcpy32(m_pDataBuf, pData, size);
+ }
+ m_dwSize = size;
+ if (m_pDict) {
+ m_pDict->SetAtInteger(FX_BSTRC("Length"), size);
+ }
+}
+void CPDF_Stream::SetData(FX_LPCBYTE pData, FX_DWORD size, FX_BOOL bCompressed, FX_BOOL bKeepBuf)
+{
+ if (m_GenNum == (FX_DWORD) - 1) {
+ if (m_pDataBuf) {
+ FX_Free(m_pDataBuf);
+ }
+ } else {
+ m_GenNum = (FX_DWORD) - 1;
+ m_pCryptoHandler = NULL;
+ }
+ if (bKeepBuf) {
+ m_pDataBuf = (FX_LPBYTE)pData;
+ } else {
+ m_pDataBuf = FX_Alloc(FX_BYTE, size);
+ if (pData) {
+ FXSYS_memcpy32(m_pDataBuf, pData, size);
+ }
+ }
+ m_dwSize = size;
+ if (m_pDict == NULL) {
+ m_pDict = FX_NEW CPDF_Dictionary;
+ }
+ m_pDict->SetAtInteger(FX_BSTRC("Length"), size);
+ if (!bCompressed) {
+ m_pDict->RemoveAt(FX_BSTRC("Filter"));
+ m_pDict->RemoveAt(FX_BSTRC("DecodeParms"));
+ }
+}
+FX_BOOL CPDF_Stream::ReadRawData(FX_FILESIZE offset, FX_LPBYTE buf, FX_DWORD size) const
+{
+ if ((m_GenNum != (FX_DWORD) - 1) && m_pFile) {
+ return m_pFile->ReadBlock(buf, m_FileOffset + offset, size);
+ }
+ if (m_pDataBuf) {
+ FXSYS_memcpy32(buf, m_pDataBuf + offset, size);
+ }
+ return TRUE;
+}
+void CPDF_Stream::InitStream(IFX_FileRead *pFile, CPDF_Dictionary* pDict)
+{
+ InitStream(pDict);
+ m_pFile = pFile;
+ m_dwSize = (FX_DWORD)pFile->GetSize();
+ if (m_pDict) {
+ m_pDict->SetAtInteger(FX_BSTRC("Length"), m_dwSize);
+ }
+}
+FX_BOOL CPDF_Stream::Identical(CPDF_Stream* pOther) const
+{
+ if (!m_pDict->Identical(pOther->m_pDict)) {
+ return FALSE;
+ }
+ if (m_dwSize != pOther->m_dwSize) {
+ return FALSE;
+ }
+ if (m_GenNum != (FX_DWORD) - 1 && pOther->m_GenNum != (FX_DWORD) - 1) {
+ if (m_pFile == pOther->m_pFile && m_pFile == NULL) {
+ return TRUE;
+ }
+ if (!m_pFile || !pOther->m_pFile) {
+ return FALSE;
+ }
+ FX_BYTE srcBuf[1024];
+ FX_BYTE destBuf[1024];
+ FX_DWORD size = m_dwSize;
+ FX_DWORD srcOffset = m_FileOffset;
+ FX_DWORD destOffset = pOther->m_FileOffset;
+ if (m_pFile == pOther->m_pFile && srcOffset == destOffset) {
+ return TRUE;
+ }
+ while (size > 0) {
+ FX_DWORD actualSize = size > 1024 ? 1024 : size;
+ m_pFile->ReadBlock(srcBuf, srcOffset, actualSize);
+ pOther->m_pFile->ReadBlock(destBuf, destOffset, actualSize);
+ if (FXSYS_memcmp32(srcBuf, destBuf, actualSize) != 0) {
+ return FALSE;
+ }
+ size -= actualSize;
+ srcOffset += actualSize;
+ destOffset += actualSize;
+ }
+ return TRUE;
+ }
+ if (m_GenNum != (FX_DWORD) - 1 || pOther->m_GenNum != (FX_DWORD) - 1) {
+ IFX_FileRead* pFile = NULL;
+ FX_LPBYTE pBuf = NULL;
+ FX_DWORD offset = 0;
+ if (m_GenNum != (FX_DWORD) - 1) {
+ pFile = m_pFile;
+ pBuf = pOther->m_pDataBuf;
+ offset = m_FileOffset;
+ }
+ if (pOther->m_GenNum != (FX_DWORD) - 1) {
+ pFile = pOther->m_pFile;
+ pBuf = m_pDataBuf;
+ offset = pOther->m_FileOffset;
+ }
+ if (NULL == pBuf) {
+ return FALSE;
+ }
+ FX_BYTE srcBuf[1024];
+ FX_DWORD size = m_dwSize;
+ while (size > 0) {
+ FX_DWORD actualSize = size > 1024 ? 1024 : size;
+ m_pFile->ReadBlock(srcBuf, offset, actualSize);
+ if (FXSYS_memcmp32(srcBuf, pBuf, actualSize) != 0) {
+ return FALSE;
+ }
+ pBuf += actualSize;
+ size -= actualSize;
+ offset += actualSize;
+ }
+ return TRUE;
+ }
+ return FXSYS_memcmp32(m_pDataBuf, pOther->m_pDataBuf, m_dwSize) == 0;
+}
+CPDF_Stream* CPDF_Stream::Clone(FX_BOOL bDirect, FPDF_LPFCloneStreamCallback lpfCallback, FX_LPVOID pUserData) const
+{
+ CPDF_Dictionary *pCloneDict = (CPDF_Dictionary*)m_pDict->Clone(bDirect);
+ IFX_FileStream *pFS = NULL;
+ if (lpfCallback) {
+ pFS = lpfCallback((CPDF_Stream*)this, pUserData);
+ }
+ if (!pFS) {
+ CPDF_StreamAcc acc;
+ acc.LoadAllData(this, TRUE);
+ FX_DWORD streamSize = acc.GetSize();
+ CPDF_Stream* pObj = FX_NEW CPDF_Stream(acc.DetachData(), streamSize, pCloneDict);
+ return pObj;
+ }
+ CPDF_Stream* pObj = FX_NEW CPDF_Stream(NULL, 0, NULL);
+ CPDF_StreamFilter *pSF = GetStreamFilter(TRUE);
+ if (pSF) {
+ FX_LPBYTE pBuf = FX_Alloc(FX_BYTE, 4096);
+ FX_DWORD dwRead;
+ do {
+ dwRead = pSF->ReadBlock(pBuf, 4096);
+ if (dwRead) {
+ pFS->WriteBlock(pBuf, dwRead);
+ }
+ } while (dwRead == 4096);
+ pFS->Flush();
+ FX_Free(pBuf);
+ delete pSF;
+ }
+ pObj->InitStream((IFX_FileRead*)pFS, pCloneDict);
+ return pObj;
+}
+extern FX_BOOL PDF_DataDecode(FX_LPCBYTE src_buf, FX_DWORD src_size, const CPDF_Dictionary* pDict,
+ FX_LPBYTE& dest_buf, FX_DWORD& dest_size, CFX_ByteString& ImageEncoding,
+ CPDF_Dictionary*& pImageParms, FX_DWORD estimated_size, FX_BOOL bImageAcc);
+CPDF_StreamAcc::CPDF_StreamAcc()
+{
+ m_bNewBuf = FALSE;
+ m_pData = NULL;
+ m_dwSize = 0;
+ m_pImageParam = NULL;
+ m_pStream = NULL;
+ m_pSrcData = NULL;
+}
+void CPDF_StreamAcc::LoadAllData(const CPDF_Stream* pStream, FX_BOOL bRawAccess, FX_DWORD estimated_size,
+ FX_BOOL bImageAcc)
+{
+ if (pStream == NULL || pStream->GetType() != PDFOBJ_STREAM) {
+ return;
+ }
+ m_pStream = pStream;
+ if (pStream->IsMemoryBased() &&
+ (!pStream->GetDict()->KeyExist(FX_BSTRC("Filter")) || bRawAccess)) {
+ m_dwSize = pStream->m_dwSize;
+ m_pData = (FX_LPBYTE)pStream->m_pDataBuf;
+ return;
+ }
+ FX_LPBYTE pSrcData;
+ FX_DWORD dwSrcSize = pStream->m_dwSize;
+ if (dwSrcSize == 0) {
+ return;
+ }
+ if (!pStream->IsMemoryBased()) {
+ pSrcData = m_pSrcData = FX_Alloc(FX_BYTE, dwSrcSize);
+ if (!pSrcData || !pStream->ReadRawData(0, pSrcData, dwSrcSize)) {
+ return;
+ }
+ } else {
+ pSrcData = pStream->m_pDataBuf;
+ }
+ FX_LPBYTE pDecryptedData;
+ FX_DWORD dwDecryptedSize;
+ if (pStream->m_pCryptoHandler) {
+ CFX_BinaryBuf dest_buf;
+ dest_buf.EstimateSize(pStream->m_pCryptoHandler->DecryptGetSize(dwSrcSize));
+ FX_LPVOID context = pStream->m_pCryptoHandler->DecryptStart(pStream->GetObjNum(), pStream->m_GenNum);
+ pStream->m_pCryptoHandler->DecryptStream(context, pSrcData, dwSrcSize, dest_buf);
+ pStream->m_pCryptoHandler->DecryptFinish(context, dest_buf);
+ pDecryptedData = dest_buf.GetBuffer();
+ dwDecryptedSize = dest_buf.GetSize();
+ dest_buf.DetachBuffer();
+ } else {
+ pDecryptedData = pSrcData;
+ dwDecryptedSize = dwSrcSize;
+ }
+ if (!pStream->GetDict()->KeyExist(FX_BSTRC("Filter")) || bRawAccess) {
+ m_pData = pDecryptedData;
+ m_dwSize = dwDecryptedSize;
+ } else {
+ FX_BOOL bRet = PDF_DataDecode(pDecryptedData, dwDecryptedSize, m_pStream->GetDict(),
+ m_pData, m_dwSize, m_ImageDecoder, m_pImageParam, estimated_size, bImageAcc);
+ if (!bRet) {
+ m_pData = pDecryptedData;
+ m_dwSize = dwDecryptedSize;
+ }
+ }
+ if (pSrcData != pStream->m_pDataBuf && pSrcData != m_pData) {
+ FX_Free(pSrcData);
+ }
+ if (pDecryptedData != pSrcData && pDecryptedData != m_pData) {
+ FX_Free(pDecryptedData);
+ }
+ m_pSrcData = NULL;
+ m_bNewBuf = m_pData != pStream->m_pDataBuf;
+}
+CPDF_StreamAcc::~CPDF_StreamAcc()
+{
+ if (m_bNewBuf && m_pData) {
+ FX_Free(m_pData);
+ }
+ if (m_pSrcData) {
+ FX_Free(m_pSrcData);
+ }
+}
+FX_LPCBYTE CPDF_StreamAcc::GetData() const
+{
+ if (m_bNewBuf) {
+ return m_pData;
+ }
+ if (!m_pStream) {
+ return NULL;
+ }
+ return m_pStream->m_pDataBuf;
+}
+FX_DWORD CPDF_StreamAcc::GetSize() const
+{
+ if (m_bNewBuf) {
+ return m_dwSize;
+ }
+ if (!m_pStream) {
+ return 0;
+ }
+ return m_pStream->m_dwSize;
+}
+FX_LPBYTE CPDF_StreamAcc::DetachData()
+{
+ if (m_bNewBuf) {
+ FX_LPBYTE p = m_pData;
+ m_pData = NULL;
+ m_dwSize = 0;
+ return p;
+ }
+ FX_LPBYTE p = FX_Alloc(FX_BYTE, m_dwSize);
+ if (p == NULL) {
+ return NULL;
+ }
+ FXSYS_memcpy32(p, m_pData, m_dwSize);
+ return p;
+}
+void CPDF_Reference::SetRef(CPDF_IndirectObjects* pDoc, FX_DWORD objnum)
+{
+ m_pObjList = pDoc;
+ m_RefObjNum = objnum;
+}
+CPDF_IndirectObjects::CPDF_IndirectObjects(IPDF_DocParser* pParser)
+{
+ m_pParser = pParser;
+ m_IndirectObjs.InitHashTable(1013);
+ if (pParser) {
+ m_LastObjNum = m_pParser->GetLastObjNum();
+ } else {
+ m_LastObjNum = 0;
+ }
+}
+CPDF_IndirectObjects::~CPDF_IndirectObjects()
+{
+ FX_POSITION pos = m_IndirectObjs.GetStartPosition();
+ while (pos) {
+ FX_LPVOID key, value;
+ m_IndirectObjs.GetNextAssoc(pos, key, value);
+ ((CPDF_Object*)value)->Destroy();
+ }
+}
+CPDF_Object* CPDF_IndirectObjects::GetIndirectObject(FX_DWORD objnum, struct PARSE_CONTEXT* pContext)
+{
+ if (objnum == 0) {
+ return NULL;
+ }
+ FX_LPVOID value;
+ {
+ if (m_IndirectObjs.Lookup((FX_LPVOID)(FX_UINTPTR)objnum, value)) {
+ if (((CPDF_Object*)value)->GetObjNum() == -1) {
+ return NULL;
+ }
+ return (CPDF_Object*)value;
+ }
+ }
+ CPDF_Object* pObj = NULL;
+ if (m_pParser) {
+ pObj = m_pParser->ParseIndirectObject(this, objnum, pContext);
+ }
+ if (pObj == NULL) {
+ return NULL;
+ }
+ pObj->m_ObjNum = objnum;
+ if (m_LastObjNum < objnum) {
+ m_LastObjNum = objnum;
+ }
+ if (m_IndirectObjs.Lookup((FX_LPVOID)(FX_UINTPTR)objnum, value)) {
+ if (value) {
+ ((CPDF_Object *)value)->Destroy();
+ }
+ }
+ m_IndirectObjs.SetAt((FX_LPVOID)(FX_UINTPTR)objnum, pObj);
+ return pObj;
+}
+int CPDF_IndirectObjects::GetIndirectType(FX_DWORD objnum)
+{
+ FX_LPVOID value;
+ if (m_IndirectObjs.Lookup((FX_LPVOID)(FX_UINTPTR)objnum, value)) {
+ return ((CPDF_Object*)value)->GetType();
+ }
+ if (m_pParser) {
+ PARSE_CONTEXT context;
+ FXSYS_memset32(&context, 0, sizeof(PARSE_CONTEXT));
+ context.m_Flags = PDFPARSE_TYPEONLY;
+ return (int)(FX_UINTPTR)m_pParser->ParseIndirectObject(this, objnum, &context);
+ }
+ return 0;
+}
+FX_DWORD CPDF_IndirectObjects::AddIndirectObject(CPDF_Object* pObj)
+{
+ if (pObj->m_ObjNum) {
+ return pObj->m_ObjNum;
+ }
+ m_LastObjNum ++;
+ m_IndirectObjs.SetAt((FX_LPVOID)(FX_UINTPTR)m_LastObjNum, pObj);
+ pObj->m_ObjNum = m_LastObjNum;
+ return m_LastObjNum;
+}
+void CPDF_IndirectObjects::ReleaseIndirectObject(FX_DWORD objnum)
+{
+ FX_LPVOID value;
+ if (!m_IndirectObjs.Lookup((FX_LPVOID)(FX_UINTPTR)objnum, value)) {
+ return;
+ }
+ if (((CPDF_Object*)value)->GetObjNum() == -1) {
+ return;
+ }
+ ((CPDF_Object*)value)->Destroy();
+ m_IndirectObjs.RemoveKey((FX_LPVOID)(FX_UINTPTR)objnum);
+}
+void CPDF_IndirectObjects::InsertIndirectObject(FX_DWORD objnum, CPDF_Object* pObj)
+{
+ if (objnum == 0 || pObj == NULL) {
+ return;
+ }
+ FX_LPVOID value;
+ if (m_IndirectObjs.Lookup((FX_LPVOID)(FX_UINTPTR)objnum, value)) {
+ ((CPDF_Object*)value)->Destroy();
+ }
+ pObj->m_ObjNum = objnum;
+ m_IndirectObjs.SetAt((FX_LPVOID)(FX_UINTPTR)objnum, pObj);
+ if (m_LastObjNum < objnum) {
+ m_LastObjNum = objnum;
+ }
+}
+FX_DWORD CPDF_IndirectObjects::GetLastObjNum() const
+{
+ return m_LastObjNum;
+}
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp
index cc3d29c9ed..7559bcee91 100644
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp
@@ -1,453 +1,453 @@
-// 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
-
-#include "../../../include/fpdfapi/fpdf_parser.h"
-extern const FX_LPCSTR _PDF_CharType =
- "WRRRRRRRRWWRWWRRRRRRRRRRRRRRRRRR"
- "WRRRRDRRDDRNRNNDNNNNNNNNNNRRDRDR"
- "RRRRRRRRRRRRRRRRRRRRRRRRRRRDRDRR"
- "RRRRRRRRRRRRRRRRRRRRRRRRRRRDRDRR"
- "WRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR"
- "RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR"
- "RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR"
- "RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRW";
-#ifndef MAX_PATH
-#define MAX_PATH 4096
-#endif
-CPDF_SimpleParser::CPDF_SimpleParser(FX_LPCBYTE pData, FX_DWORD dwSize)
-{
- m_pData = pData;
- m_dwSize = dwSize;
- m_dwCurPos = 0;
-}
-CPDF_SimpleParser::CPDF_SimpleParser(FX_BSTR str)
-{
- m_pData = str;
- m_dwSize = str.GetLength();
- m_dwCurPos = 0;
-}
-void CPDF_SimpleParser::ParseWord(FX_LPCBYTE& pStart, FX_DWORD& dwSize, int& type)
-{
- pStart = NULL;
- dwSize = 0;
- type = PDFWORD_EOF;
- FX_BYTE ch;
- char chartype;
- while (1) {
- if (m_dwSize <= m_dwCurPos) {
- return;
- }
- ch = m_pData[m_dwCurPos++];
- chartype = _PDF_CharType[ch];
- while (chartype == 'W') {
- if (m_dwSize <= m_dwCurPos) {
- return;
- }
- ch = m_pData[m_dwCurPos++];
- chartype = _PDF_CharType[ch];
- }
- if (ch != '%') {
- break;
- }
- while (1) {
- if (m_dwSize <= m_dwCurPos) {
- return;
- }
- ch = m_pData[m_dwCurPos++];
- if (ch == '\r' || ch == '\n') {
- break;
- }
- }
- chartype = _PDF_CharType[ch];
- }
- FX_DWORD start_pos = m_dwCurPos - 1;
- pStart = m_pData + start_pos;
- if (chartype == 'D') {
- if (ch == '/') {
- while (1) {
- if (m_dwSize <= m_dwCurPos) {
- return;
- }
- ch = m_pData[m_dwCurPos++];
- chartype = _PDF_CharType[ch];
- if (chartype != 'R' && chartype != 'N') {
- m_dwCurPos --;
- dwSize = m_dwCurPos - start_pos;
- type = PDFWORD_NAME;
- return;
- }
- }
- } else {
- type = PDFWORD_DELIMITER;
- dwSize = 1;
- if (ch == '<') {
- if (m_dwSize <= m_dwCurPos) {
- return;
- }
- ch = m_pData[m_dwCurPos++];
- if (ch == '<') {
- dwSize = 2;
- } else {
- m_dwCurPos --;
- }
- } else if (ch == '>') {
- if (m_dwSize <= m_dwCurPos) {
- return;
- }
- ch = m_pData[m_dwCurPos++];
- if (ch == '>') {
- dwSize = 2;
- } else {
- m_dwCurPos --;
- }
- }
- }
- return;
- }
- type = PDFWORD_NUMBER;
- dwSize = 1;
- while (1) {
- if (chartype != 'N') {
- type = PDFWORD_TEXT;
- }
- if (m_dwSize <= m_dwCurPos) {
- return;
- }
- ch = m_pData[m_dwCurPos++];
- chartype = _PDF_CharType[ch];
- if (chartype == 'D' || chartype == 'W') {
- m_dwCurPos --;
- break;
- }
- dwSize ++;
- }
-}
-CFX_ByteStringC CPDF_SimpleParser::GetWord()
-{
- FX_LPCBYTE pStart;
- FX_DWORD dwSize;
- int type;
- ParseWord(pStart, dwSize, type);
- if (dwSize == 1 && pStart[0] == '<') {
- while (m_dwCurPos < m_dwSize && m_pData[m_dwCurPos] != '>') {
- m_dwCurPos ++;
- }
- if (m_dwCurPos < m_dwSize) {
- m_dwCurPos ++;
- }
- return CFX_ByteStringC(pStart, (FX_STRSIZE)(m_dwCurPos - (pStart - m_pData)));
- } else if (dwSize == 1 && pStart[0] == '(') {
- int level = 1;
- while (m_dwCurPos < m_dwSize) {
- if (m_pData[m_dwCurPos] == ')') {
- level --;
- if (level == 0) {
- break;
- }
- }
- if (m_pData[m_dwCurPos] == '\\') {
- if (m_dwSize <= m_dwCurPos) {
- break;
- }
- m_dwCurPos ++;
- } else if (m_pData[m_dwCurPos] == '(') {
- level ++;
- }
- if (m_dwSize <= m_dwCurPos) {
- break;
- }
- m_dwCurPos ++;
- }
- if (m_dwCurPos < m_dwSize) {
- m_dwCurPos ++;
- }
- return CFX_ByteStringC(pStart, (FX_STRSIZE)(m_dwCurPos - (pStart - m_pData)));
- }
- return CFX_ByteStringC(pStart, dwSize);
-}
-FX_BOOL CPDF_SimpleParser::SearchToken(FX_BSTR token)
-{
- int token_len = token.GetLength();
- while (m_dwCurPos < m_dwSize - token_len) {
- if (FXSYS_memcmp32(m_pData + m_dwCurPos, token, token_len) == 0) {
- break;
- }
- m_dwCurPos ++;
- }
- if (m_dwCurPos == m_dwSize - token_len) {
- return FALSE;
- }
- m_dwCurPos += token_len;
- return TRUE;
-}
-FX_BOOL CPDF_SimpleParser::SkipWord(FX_BSTR token)
-{
- while (1) {
- CFX_ByteStringC word = GetWord();
- if (word.IsEmpty()) {
- return FALSE;
- }
- if (word == token) {
- return TRUE;
- }
- }
- return FALSE;
-}
-FX_BOOL CPDF_SimpleParser::FindTagPair(FX_BSTR start_token, FX_BSTR end_token,
- FX_DWORD& start_pos, FX_DWORD& end_pos)
-{
- if (!start_token.IsEmpty()) {
- if (!SkipWord(start_token)) {
- return FALSE;
- }
- start_pos = m_dwCurPos;
- }
- while (1) {
- end_pos = m_dwCurPos;
- CFX_ByteStringC word = GetWord();
- if (word.IsEmpty()) {
- return FALSE;
- }
- if (word == end_token) {
- return TRUE;
- }
- }
- return FALSE;
-}
-FX_BOOL CPDF_SimpleParser::FindTagParam(FX_BSTR token, int nParams)
-{
- nParams ++;
- FX_DWORD* pBuf = FX_Alloc(FX_DWORD, nParams);
- int buf_index = 0;
- int buf_count = 0;
- while (1) {
- pBuf[buf_index++] = m_dwCurPos;
- if (buf_index == nParams) {
- buf_index = 0;
- }
- buf_count ++;
- if (buf_count > nParams) {
- buf_count = nParams;
- }
- CFX_ByteStringC word = GetWord();
- if (word.IsEmpty()) {
- FX_Free(pBuf);
- return FALSE;
- }
- if (word == token) {
- if (buf_count < nParams) {
- continue;
- }
- m_dwCurPos = pBuf[buf_index];
- FX_Free(pBuf);
- return TRUE;
- }
- }
- return FALSE;
-}
-static int _hex2dec(char ch)
-{
- if (ch >= '0' && ch <= '9') {
- return ch - '0';
- }
- if (ch >= 'a' && ch <= 'f') {
- return ch - 'a' + 10;
- }
- if (ch >= 'A' && ch <= 'F') {
- return ch - 'A' + 10;
- }
- return 0;
-}
-CFX_ByteString PDF_NameDecode(FX_BSTR bstr)
-{
- int size = bstr.GetLength();
- FX_LPCSTR pSrc = bstr.GetCStr();
- if (FXSYS_memchr(pSrc, '#', size) == NULL) {
- return bstr;
- }
- CFX_ByteString result;
- FX_LPSTR pDestStart = result.GetBuffer(size);
- FX_LPSTR pDest = pDestStart;
- for (int i = 0; i < size; i ++) {
- if (pSrc[i] == '#' && i < size - 2) {
- *pDest ++ = _hex2dec(pSrc[i + 1]) * 16 + _hex2dec(pSrc[i + 2]);
- i += 2;
- } else {
- *pDest ++ = pSrc[i];
- }
- }
- result.ReleaseBuffer((FX_STRSIZE)(pDest - pDestStart));
- return result;
-}
-CFX_ByteString PDF_NameDecode(const CFX_ByteString& orig)
-{
- if (FXSYS_memchr((FX_LPCSTR)orig, '#', orig.GetLength()) == NULL) {
- return orig;
- }
- return PDF_NameDecode(CFX_ByteStringC(orig));
-}
-CFX_ByteString PDF_NameEncode(const CFX_ByteString& orig)
-{
- FX_LPBYTE src_buf = (FX_LPBYTE)(FX_LPCSTR)orig;
- int src_len = orig.GetLength();
- int dest_len = 0;
- int i;
- for (i = 0; i < src_len; i ++) {
- FX_BYTE ch = src_buf[i];
- if (ch >= 0x80 || _PDF_CharType[ch] == 'W' || ch == '#' ||
- _PDF_CharType[ch] == 'D') {
- dest_len += 3;
- } else {
- dest_len ++;
- }
- }
- if (dest_len == src_len) {
- return orig;
- }
- CFX_ByteString res;
- FX_LPSTR dest_buf = res.GetBuffer(dest_len);
- dest_len = 0;
- for (i = 0; i < src_len; i ++) {
- FX_BYTE ch = src_buf[i];
- if (ch >= 0x80 || _PDF_CharType[ch] == 'W' || ch == '#' ||
- _PDF_CharType[ch] == 'D') {
- dest_buf[dest_len++] = '#';
- dest_buf[dest_len++] = "0123456789ABCDEF"[ch / 16];
- dest_buf[dest_len++] = "0123456789ABCDEF"[ch % 16];
- } else {
- dest_buf[dest_len++] = ch;
- }
- }
- dest_buf[dest_len] = 0;
- res.ReleaseBuffer();
- return res;
-}
-CFX_ByteTextBuf& operator << (CFX_ByteTextBuf& buf, const CPDF_Object* pObj)
-{
- if (pObj == NULL) {
- buf << FX_BSTRC(" null");
- return buf;
- }
- switch (pObj->GetType()) {
- case PDFOBJ_NULL:
- buf << FX_BSTRC(" null");
- break;
- case PDFOBJ_BOOLEAN:
- case PDFOBJ_NUMBER:
- buf << " " << pObj->GetString();
- break;
- case PDFOBJ_STRING: {
- CFX_ByteString str = pObj->GetString();
- FX_BOOL bHex = ((CPDF_String*)pObj)->IsHex();
- buf << PDF_EncodeString(str, bHex);
- break;
- }
- case PDFOBJ_NAME: {
- CFX_ByteString str = pObj->GetString();
- buf << FX_BSTRC("/") << PDF_NameEncode(str);
- break;
- }
- case PDFOBJ_REFERENCE: {
- CPDF_Reference* p = (CPDF_Reference*)pObj;
- buf << " " << p->GetRefObjNum() << FX_BSTRC(" 0 R ");
- break;
- }
- case PDFOBJ_ARRAY: {
- CPDF_Array* p = (CPDF_Array*)pObj;
- buf << FX_BSTRC("[");
- for (FX_DWORD i = 0; i < p->GetCount(); i ++) {
- CPDF_Object* pElement = p->GetElement(i);
- if (pElement->GetObjNum()) {
- buf << " " << pElement->GetObjNum() << FX_BSTRC(" 0 R");
- } else {
- buf << pElement;
- }
- }
- buf << FX_BSTRC("]");
- break;
- }
- case PDFOBJ_DICTIONARY: {
- CPDF_Dictionary* p = (CPDF_Dictionary*)pObj;
- buf << FX_BSTRC("<<");
- FX_POSITION pos = p->GetStartPos();
- while (pos) {
- CFX_ByteString key;
- CPDF_Object* pValue = p->GetNextElement(pos, key);
- buf << FX_BSTRC("/") << PDF_NameEncode(key);
- if (pValue->GetObjNum()) {
- buf << " " << pValue->GetObjNum() << FX_BSTRC(" 0 R ");
- } else {
- buf << pValue;
- }
- }
- buf << FX_BSTRC(">>");
- break;
- }
- case PDFOBJ_STREAM: {
- CPDF_Stream* p = (CPDF_Stream*)pObj;
- buf << p->GetDict() << FX_BSTRC("stream\r\n");
- CPDF_StreamAcc acc;
- acc.LoadAllData(p, TRUE);
- buf.AppendBlock(acc.GetData(), acc.GetSize());
- buf << FX_BSTRC("\r\nendstream");
- break;
- }
- default:
- ASSERT(FALSE);
- break;
- }
- return buf;
-}
-FX_FLOAT PDF_ClipFloat(FX_FLOAT f)
-{
- if (f < 0) {
- return 0;
- }
- if (f > 1.0f) {
- return 1.0f;
- }
- return f;
-}
-static CPDF_Object* SearchNumberNode(CPDF_Dictionary* pNode, int num)
-{
- CPDF_Array* pLimits = pNode->GetArray("Limits");
- if (pLimits && (num < pLimits->GetInteger(0) || num > pLimits->GetInteger(1))) {
- return NULL;
- }
- CPDF_Array* pNumbers = pNode->GetArray("Nums");
- if (pNumbers) {
- FX_DWORD dwCount = pNumbers->GetCount() / 2;
- for (FX_DWORD i = 0; i < dwCount; i ++) {
- int index = pNumbers->GetInteger(i * 2);
- if (num == index) {
- return pNumbers->GetElementValue(i * 2 + 1);
- }
- if (index > num) {
- break;
- }
- }
- return NULL;
- }
- CPDF_Array* pKids = pNode->GetArray("Kids");
- if (pKids == NULL) {
- return NULL;
- }
- for (FX_DWORD i = 0; i < pKids->GetCount(); i ++) {
- CPDF_Dictionary* pKid = pKids->GetDict(i);
- if (pKid == NULL) {
- continue;
- }
- CPDF_Object* pFound = SearchNumberNode(pKid, num);
- if (pFound) {
- return pFound;
- }
- }
- return NULL;
-}
-CPDF_Object* CPDF_NumberTree::LookupValue(int num)
-{
- return SearchNumberNode(m_pRoot, num);
-}
+// 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
+
+#include "../../../include/fpdfapi/fpdf_parser.h"
+extern const FX_LPCSTR _PDF_CharType =
+ "WRRRRRRRRWWRWWRRRRRRRRRRRRRRRRRR"
+ "WRRRRDRRDDRNRNNDNNNNNNNNNNRRDRDR"
+ "RRRRRRRRRRRRRRRRRRRRRRRRRRRDRDRR"
+ "RRRRRRRRRRRRRRRRRRRRRRRRRRRDRDRR"
+ "WRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR"
+ "RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR"
+ "RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR"
+ "RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRW";
+#ifndef MAX_PATH
+#define MAX_PATH 4096
+#endif
+CPDF_SimpleParser::CPDF_SimpleParser(FX_LPCBYTE pData, FX_DWORD dwSize)
+{
+ m_pData = pData;
+ m_dwSize = dwSize;
+ m_dwCurPos = 0;
+}
+CPDF_SimpleParser::CPDF_SimpleParser(FX_BSTR str)
+{
+ m_pData = str;
+ m_dwSize = str.GetLength();
+ m_dwCurPos = 0;
+}
+void CPDF_SimpleParser::ParseWord(FX_LPCBYTE& pStart, FX_DWORD& dwSize, int& type)
+{
+ pStart = NULL;
+ dwSize = 0;
+ type = PDFWORD_EOF;
+ FX_BYTE ch;
+ char chartype;
+ while (1) {
+ if (m_dwSize <= m_dwCurPos) {
+ return;
+ }
+ ch = m_pData[m_dwCurPos++];
+ chartype = _PDF_CharType[ch];
+ while (chartype == 'W') {
+ if (m_dwSize <= m_dwCurPos) {
+ return;
+ }
+ ch = m_pData[m_dwCurPos++];
+ chartype = _PDF_CharType[ch];
+ }
+ if (ch != '%') {
+ break;
+ }
+ while (1) {
+ if (m_dwSize <= m_dwCurPos) {
+ return;
+ }
+ ch = m_pData[m_dwCurPos++];
+ if (ch == '\r' || ch == '\n') {
+ break;
+ }
+ }
+ chartype = _PDF_CharType[ch];
+ }
+ FX_DWORD start_pos = m_dwCurPos - 1;
+ pStart = m_pData + start_pos;
+ if (chartype == 'D') {
+ if (ch == '/') {
+ while (1) {
+ if (m_dwSize <= m_dwCurPos) {
+ return;
+ }
+ ch = m_pData[m_dwCurPos++];
+ chartype = _PDF_CharType[ch];
+ if (chartype != 'R' && chartype != 'N') {
+ m_dwCurPos --;
+ dwSize = m_dwCurPos - start_pos;
+ type = PDFWORD_NAME;
+ return;
+ }
+ }
+ } else {
+ type = PDFWORD_DELIMITER;
+ dwSize = 1;
+ if (ch == '<') {
+ if (m_dwSize <= m_dwCurPos) {
+ return;
+ }
+ ch = m_pData[m_dwCurPos++];
+ if (ch == '<') {
+ dwSize = 2;
+ } else {
+ m_dwCurPos --;
+ }
+ } else if (ch == '>') {
+ if (m_dwSize <= m_dwCurPos) {
+ return;
+ }
+ ch = m_pData[m_dwCurPos++];
+ if (ch == '>') {
+ dwSize = 2;
+ } else {
+ m_dwCurPos --;
+ }
+ }
+ }
+ return;
+ }
+ type = PDFWORD_NUMBER;
+ dwSize = 1;
+ while (1) {
+ if (chartype != 'N') {
+ type = PDFWORD_TEXT;
+ }
+ if (m_dwSize <= m_dwCurPos) {
+ return;
+ }
+ ch = m_pData[m_dwCurPos++];
+ chartype = _PDF_CharType[ch];
+ if (chartype == 'D' || chartype == 'W') {
+ m_dwCurPos --;
+ break;
+ }
+ dwSize ++;
+ }
+}
+CFX_ByteStringC CPDF_SimpleParser::GetWord()
+{
+ FX_LPCBYTE pStart;
+ FX_DWORD dwSize;
+ int type;
+ ParseWord(pStart, dwSize, type);
+ if (dwSize == 1 && pStart[0] == '<') {
+ while (m_dwCurPos < m_dwSize && m_pData[m_dwCurPos] != '>') {
+ m_dwCurPos ++;
+ }
+ if (m_dwCurPos < m_dwSize) {
+ m_dwCurPos ++;
+ }
+ return CFX_ByteStringC(pStart, (FX_STRSIZE)(m_dwCurPos - (pStart - m_pData)));
+ } else if (dwSize == 1 && pStart[0] == '(') {
+ int level = 1;
+ while (m_dwCurPos < m_dwSize) {
+ if (m_pData[m_dwCurPos] == ')') {
+ level --;
+ if (level == 0) {
+ break;
+ }
+ }
+ if (m_pData[m_dwCurPos] == '\\') {
+ if (m_dwSize <= m_dwCurPos) {
+ break;
+ }
+ m_dwCurPos ++;
+ } else if (m_pData[m_dwCurPos] == '(') {
+ level ++;
+ }
+ if (m_dwSize <= m_dwCurPos) {
+ break;
+ }
+ m_dwCurPos ++;
+ }
+ if (m_dwCurPos < m_dwSize) {
+ m_dwCurPos ++;
+ }
+ return CFX_ByteStringC(pStart, (FX_STRSIZE)(m_dwCurPos - (pStart - m_pData)));
+ }
+ return CFX_ByteStringC(pStart, dwSize);
+}
+FX_BOOL CPDF_SimpleParser::SearchToken(FX_BSTR token)
+{
+ int token_len = token.GetLength();
+ while (m_dwCurPos < m_dwSize - token_len) {
+ if (FXSYS_memcmp32(m_pData + m_dwCurPos, token, token_len) == 0) {
+ break;
+ }
+ m_dwCurPos ++;
+ }
+ if (m_dwCurPos == m_dwSize - token_len) {
+ return FALSE;
+ }
+ m_dwCurPos += token_len;
+ return TRUE;
+}
+FX_BOOL CPDF_SimpleParser::SkipWord(FX_BSTR token)
+{
+ while (1) {
+ CFX_ByteStringC word = GetWord();
+ if (word.IsEmpty()) {
+ return FALSE;
+ }
+ if (word == token) {
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+FX_BOOL CPDF_SimpleParser::FindTagPair(FX_BSTR start_token, FX_BSTR end_token,
+ FX_DWORD& start_pos, FX_DWORD& end_pos)
+{
+ if (!start_token.IsEmpty()) {
+ if (!SkipWord(start_token)) {
+ return FALSE;
+ }
+ start_pos = m_dwCurPos;
+ }
+ while (1) {
+ end_pos = m_dwCurPos;
+ CFX_ByteStringC word = GetWord();
+ if (word.IsEmpty()) {
+ return FALSE;
+ }
+ if (word == end_token) {
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+FX_BOOL CPDF_SimpleParser::FindTagParam(FX_BSTR token, int nParams)
+{
+ nParams ++;
+ FX_DWORD* pBuf = FX_Alloc(FX_DWORD, nParams);
+ int buf_index = 0;
+ int buf_count = 0;
+ while (1) {
+ pBuf[buf_index++] = m_dwCurPos;
+ if (buf_index == nParams) {
+ buf_index = 0;
+ }
+ buf_count ++;
+ if (buf_count > nParams) {
+ buf_count = nParams;
+ }
+ CFX_ByteStringC word = GetWord();
+ if (word.IsEmpty()) {
+ FX_Free(pBuf);
+ return FALSE;
+ }
+ if (word == token) {
+ if (buf_count < nParams) {
+ continue;
+ }
+ m_dwCurPos = pBuf[buf_index];
+ FX_Free(pBuf);
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+static int _hex2dec(char ch)
+{
+ if (ch >= '0' && ch <= '9') {
+ return ch - '0';
+ }
+ if (ch >= 'a' && ch <= 'f') {
+ return ch - 'a' + 10;
+ }
+ if (ch >= 'A' && ch <= 'F') {
+ return ch - 'A' + 10;
+ }
+ return 0;
+}
+CFX_ByteString PDF_NameDecode(FX_BSTR bstr)
+{
+ int size = bstr.GetLength();
+ FX_LPCSTR pSrc = bstr.GetCStr();
+ if (FXSYS_memchr(pSrc, '#', size) == NULL) {
+ return bstr;
+ }
+ CFX_ByteString result;
+ FX_LPSTR pDestStart = result.GetBuffer(size);
+ FX_LPSTR pDest = pDestStart;
+ for (int i = 0; i < size; i ++) {
+ if (pSrc[i] == '#' && i < size - 2) {
+ *pDest ++ = _hex2dec(pSrc[i + 1]) * 16 + _hex2dec(pSrc[i + 2]);
+ i += 2;
+ } else {
+ *pDest ++ = pSrc[i];
+ }
+ }
+ result.ReleaseBuffer((FX_STRSIZE)(pDest - pDestStart));
+ return result;
+}
+CFX_ByteString PDF_NameDecode(const CFX_ByteString& orig)
+{
+ if (FXSYS_memchr((FX_LPCSTR)orig, '#', orig.GetLength()) == NULL) {
+ return orig;
+ }
+ return PDF_NameDecode(CFX_ByteStringC(orig));
+}
+CFX_ByteString PDF_NameEncode(const CFX_ByteString& orig)
+{
+ FX_LPBYTE src_buf = (FX_LPBYTE)(FX_LPCSTR)orig;
+ int src_len = orig.GetLength();
+ int dest_len = 0;
+ int i;
+ for (i = 0; i < src_len; i ++) {
+ FX_BYTE ch = src_buf[i];
+ if (ch >= 0x80 || _PDF_CharType[ch] == 'W' || ch == '#' ||
+ _PDF_CharType[ch] == 'D') {
+ dest_len += 3;
+ } else {
+ dest_len ++;
+ }
+ }
+ if (dest_len == src_len) {
+ return orig;
+ }
+ CFX_ByteString res;
+ FX_LPSTR dest_buf = res.GetBuffer(dest_len);
+ dest_len = 0;
+ for (i = 0; i < src_len; i ++) {
+ FX_BYTE ch = src_buf[i];
+ if (ch >= 0x80 || _PDF_CharType[ch] == 'W' || ch == '#' ||
+ _PDF_CharType[ch] == 'D') {
+ dest_buf[dest_len++] = '#';
+ dest_buf[dest_len++] = "0123456789ABCDEF"[ch / 16];
+ dest_buf[dest_len++] = "0123456789ABCDEF"[ch % 16];
+ } else {
+ dest_buf[dest_len++] = ch;
+ }
+ }
+ dest_buf[dest_len] = 0;
+ res.ReleaseBuffer();
+ return res;
+}
+CFX_ByteTextBuf& operator << (CFX_ByteTextBuf& buf, const CPDF_Object* pObj)
+{
+ if (pObj == NULL) {
+ buf << FX_BSTRC(" null");
+ return buf;
+ }
+ switch (pObj->GetType()) {
+ case PDFOBJ_NULL:
+ buf << FX_BSTRC(" null");
+ break;
+ case PDFOBJ_BOOLEAN:
+ case PDFOBJ_NUMBER:
+ buf << " " << pObj->GetString();
+ break;
+ case PDFOBJ_STRING: {
+ CFX_ByteString str = pObj->GetString();
+ FX_BOOL bHex = ((CPDF_String*)pObj)->IsHex();
+ buf << PDF_EncodeString(str, bHex);
+ break;
+ }
+ case PDFOBJ_NAME: {
+ CFX_ByteString str = pObj->GetString();
+ buf << FX_BSTRC("/") << PDF_NameEncode(str);
+ break;
+ }
+ case PDFOBJ_REFERENCE: {
+ CPDF_Reference* p = (CPDF_Reference*)pObj;
+ buf << " " << p->GetRefObjNum() << FX_BSTRC(" 0 R ");
+ break;
+ }
+ case PDFOBJ_ARRAY: {
+ CPDF_Array* p = (CPDF_Array*)pObj;
+ buf << FX_BSTRC("[");
+ for (FX_DWORD i = 0; i < p->GetCount(); i ++) {
+ CPDF_Object* pElement = p->GetElement(i);
+ if (pElement->GetObjNum()) {
+ buf << " " << pElement->GetObjNum() << FX_BSTRC(" 0 R");
+ } else {
+ buf << pElement;
+ }
+ }
+ buf << FX_BSTRC("]");
+ break;
+ }
+ case PDFOBJ_DICTIONARY: {
+ CPDF_Dictionary* p = (CPDF_Dictionary*)pObj;
+ buf << FX_BSTRC("<<");
+ FX_POSITION pos = p->GetStartPos();
+ while (pos) {
+ CFX_ByteString key;
+ CPDF_Object* pValue = p->GetNextElement(pos, key);
+ buf << FX_BSTRC("/") << PDF_NameEncode(key);
+ if (pValue->GetObjNum()) {
+ buf << " " << pValue->GetObjNum() << FX_BSTRC(" 0 R ");
+ } else {
+ buf << pValue;
+ }
+ }
+ buf << FX_BSTRC(">>");
+ break;
+ }
+ case PDFOBJ_STREAM: {
+ CPDF_Stream* p = (CPDF_Stream*)pObj;
+ buf << p->GetDict() << FX_BSTRC("stream\r\n");
+ CPDF_StreamAcc acc;
+ acc.LoadAllData(p, TRUE);
+ buf.AppendBlock(acc.GetData(), acc.GetSize());
+ buf << FX_BSTRC("\r\nendstream");
+ break;
+ }
+ default:
+ ASSERT(FALSE);
+ break;
+ }
+ return buf;
+}
+FX_FLOAT PDF_ClipFloat(FX_FLOAT f)
+{
+ if (f < 0) {
+ return 0;
+ }
+ if (f > 1.0f) {
+ return 1.0f;
+ }
+ return f;
+}
+static CPDF_Object* SearchNumberNode(CPDF_Dictionary* pNode, int num)
+{
+ CPDF_Array* pLimits = pNode->GetArray("Limits");
+ if (pLimits && (num < pLimits->GetInteger(0) || num > pLimits->GetInteger(1))) {
+ return NULL;
+ }
+ CPDF_Array* pNumbers = pNode->GetArray("Nums");
+ if (pNumbers) {
+ FX_DWORD dwCount = pNumbers->GetCount() / 2;
+ for (FX_DWORD i = 0; i < dwCount; i ++) {
+ int index = pNumbers->GetInteger(i * 2);
+ if (num == index) {
+ return pNumbers->GetElementValue(i * 2 + 1);
+ }
+ if (index > num) {
+ break;
+ }
+ }
+ return NULL;
+ }
+ CPDF_Array* pKids = pNode->GetArray("Kids");
+ if (pKids == NULL) {
+ return NULL;
+ }
+ for (FX_DWORD i = 0; i < pKids->GetCount(); i ++) {
+ CPDF_Dictionary* pKid = pKids->GetDict(i);
+ if (pKid == NULL) {
+ continue;
+ }
+ CPDF_Object* pFound = SearchNumberNode(pKid, num);
+ if (pFound) {
+ return pFound;
+ }
+ }
+ return NULL;
+}
+CPDF_Object* CPDF_NumberTree::LookupValue(int num)
+{
+ return SearchNumberNode(m_pRoot, num);
+}
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render.cpp
index fba698ca62..19624329fb 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render.cpp
@@ -1,1488 +1,1488 @@
-// 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
-
-#include "../../../include/fpdfapi/fpdf_render.h"
-#include "../../../include/fpdfapi/fpdf_module.h"
-#include "../fpdf_page/pageint.h"
-#include "../../../include/fxge/fx_ge.h"
-#include "../../../include/fxcodec/fx_codec.h"
-#include "render_int.h"
-CPDF_DocRenderData::CPDF_DocRenderData(CPDF_Document* pPDFDoc)
- : m_pPDFDoc(pPDFDoc)
- , m_pFontCache(NULL)
-{
-}
-CPDF_DocRenderData::~CPDF_DocRenderData()
-{
- Clear(TRUE);
-}
-void CPDF_DocRenderData::Clear(FX_BOOL bRelease)
-{
- FX_POSITION pos;
- {
- pos = m_Type3FaceMap.GetStartPosition();
- while (pos) {
- CPDF_Font* pFont;
- CPDF_CountedObject<CPDF_Type3Cache*>* cache;
- m_Type3FaceMap.GetNextAssoc(pos, pFont, cache);
- if (bRelease || cache->m_nCount < 2) {
- delete cache->m_Obj;
- delete cache;
- m_Type3FaceMap.RemoveKey(pFont);
- }
- }
- }
-#ifndef _FPDFAPI_MINI_
- {
- pos = m_TransferFuncMap.GetStartPosition();
- while (pos) {
- CPDF_Object* key;
- CPDF_CountedObject<CPDF_TransferFunc*>* value;
- m_TransferFuncMap.GetNextAssoc(pos, key, value);
- if (bRelease || value->m_nCount < 2) {
- delete value->m_Obj;
- delete value;
- m_TransferFuncMap.RemoveKey(key);
- }
- }
- }
-#endif
- if (m_pFontCache) {
- if (bRelease) {
- delete m_pFontCache;
- m_pFontCache = NULL;
- } else {
- m_pFontCache->FreeCache(FALSE);
- }
- }
-}
-FX_BOOL CPDF_DocRenderData::Initialize()
-{
- m_pFontCache = FX_NEW CFX_FontCache;
- return TRUE;
-}
-CPDF_Type3Cache* CPDF_DocRenderData::GetCachedType3(CPDF_Type3Font* pFont)
-{
- CPDF_CountedObject<CPDF_Type3Cache*>* pCache;
- if (!m_Type3FaceMap.Lookup(pFont, pCache)) {
- CPDF_Type3Cache* pType3 = FX_NEW CPDF_Type3Cache(pFont);
- pCache = FX_NEW CPDF_CountedObject<CPDF_Type3Cache*>;
- pCache->m_Obj = pType3;
- pCache->m_nCount = 1;
- m_Type3FaceMap.SetAt(pFont, pCache);
- }
- pCache->m_nCount++;
- return pCache->m_Obj;
-}
-void CPDF_DocRenderData::ReleaseCachedType3(CPDF_Type3Font* pFont)
-{
- CPDF_CountedObject<CPDF_Type3Cache*>* pCache;
- if (!m_Type3FaceMap.Lookup(pFont, pCache)) {
- return;
- }
- pCache->m_nCount--;
-}
-class CPDF_RenderModule : public CPDF_RenderModuleDef
-{
-public:
- virtual ~CPDF_RenderModule() {}
- virtual FX_BOOL Installed()
- {
- return TRUE;
- }
- virtual CPDF_DocRenderData* CreateDocData(CPDF_Document* pDoc);
- virtual void DestroyDocData(CPDF_DocRenderData* p);
- virtual void ClearDocData(CPDF_DocRenderData* p);
- virtual CPDF_DocRenderData* GetRenderData()
- {
- return &m_RenderData;
- }
- virtual CPDF_PageRenderCache* CreatePageCache(CPDF_Page* pPage)
- {
- return FX_NEW CPDF_PageRenderCache(pPage);
- }
- virtual void DestroyPageCache(CPDF_PageRenderCache* pCache);
- virtual CPDF_RenderConfig* GetConfig()
- {
- return &m_RenderConfig;
- }
-private:
- CPDF_DocRenderData m_RenderData;
- CPDF_RenderConfig m_RenderConfig;
-};
-CPDF_DocRenderData* CPDF_RenderModule::CreateDocData(CPDF_Document* pDoc)
-{
- CPDF_DocRenderData* pData = FX_NEW CPDF_DocRenderData(pDoc);
- pData->Initialize();
- return pData;
-}
-void CPDF_RenderModule::DestroyDocData(CPDF_DocRenderData* pDocData)
-{
- delete pDocData;
-}
-void CPDF_RenderModule::ClearDocData(CPDF_DocRenderData* p)
-{
- if (p) {
- p->Clear(FALSE);
- }
-}
-void CPDF_RenderModule::DestroyPageCache(CPDF_PageRenderCache* pCache)
-{
- delete pCache;
-}
-void CPDF_ModuleMgr::InitRenderModule()
-{
- if (m_pRenderModule) {
- delete m_pRenderModule;
- }
- m_pRenderModule = FX_NEW CPDF_RenderModule;
-}
-CPDF_RenderOptions::CPDF_RenderOptions()
- : m_ColorMode(RENDER_COLOR_NORMAL)
- , m_Flags(RENDER_CLEARTYPE)
- , m_Interpolation(0)
- , m_AddFlags(0)
- , m_pOCContext(NULL)
- , m_dwLimitCacheSize(1024 * 1024 * 100)
- , m_HalftoneLimit(-1)
-{
-#if defined(_FPDFAPI_MINI_)
- m_Flags |= RENDER_LIMITEDIMAGECACHE;
-#endif
-}
-FX_ARGB CPDF_RenderOptions::TranslateColor(FX_ARGB argb) const
-{
- if (m_ColorMode == RENDER_COLOR_NORMAL) {
- return argb;
- }
- if (m_ColorMode == RENDER_COLOR_ALPHA) {
- return argb;
- }
- int a, r, g, b;
- ArgbDecode(argb, a, r, g, b);
- int gray = FXRGB2GRAY(r, g, b);
- if (m_ColorMode == RENDER_COLOR_TWOCOLOR) {
- int color = (r - gray) * (r - gray) + (g - gray) * (g - gray) + (b - gray) * (b - gray);
- if (gray < 35 && color < 20) {
- return ArgbEncode(a, m_ForeColor);
- }
- if (gray > 221 && color < 20) {
- return ArgbEncode(a, m_BackColor);
- }
- return argb;
- }
- int fr = FXSYS_GetRValue(m_ForeColor);
- int fg = FXSYS_GetGValue(m_ForeColor);
- int fb = FXSYS_GetBValue(m_ForeColor);
- int br = FXSYS_GetRValue(m_BackColor);
- int bg = FXSYS_GetGValue(m_BackColor);
- int bb = FXSYS_GetBValue(m_BackColor);
- r = (br - fr) * gray / 255 + fr;
- g = (bg - fg) * gray / 255 + fg;
- b = (bb - fb) * gray / 255 + fb;
- return ArgbEncode(a, r, g, b);
-}
-CPDF_RenderStatus::CPDF_RenderStatus()
-{
- m_pContext = NULL;
- m_bStopped = FALSE;
- m_Level = 0;
- m_pDevice = NULL;
- m_pCurObj = NULL;
- m_pStopObj = NULL;
- m_HalftoneLimit = 0;
- m_pObjectRenderer = NULL;
- m_bPrint = FALSE;
- m_Transparency = 0;
- m_DitherBits = 0;
- m_bDropObjects = FALSE;
- m_bStdCS = FALSE;
- m_GroupFamily = 0;
- m_bLoadMask = FALSE;
- m_pType3Char = NULL;
- m_T3FillColor = 0;
- m_pFormResource = NULL;
- m_pPageResource = NULL;
- m_curBlend = FXDIB_BLEND_NORMAL;
-}
-CPDF_RenderStatus::~CPDF_RenderStatus()
-{
- if (m_pObjectRenderer) {
- delete m_pObjectRenderer;
- }
-}
-FX_BOOL CPDF_RenderStatus::Initialize(int level, CPDF_RenderContext* pContext, CFX_RenderDevice* pDevice,
- const CFX_AffineMatrix* pDeviceMatrix, const CPDF_PageObject* pStopObj,
- const CPDF_RenderStatus* pParentState, const CPDF_GraphicStates* pInitialStates,
- const CPDF_RenderOptions* pOptions, int transparency, FX_BOOL bDropObjects,
- CPDF_Dictionary* pFormResource, FX_BOOL bStdCS, CPDF_Type3Char* pType3Char,
- FX_ARGB fill_color, FX_DWORD GroupFamily,
- FX_BOOL bLoadMask)
-{
- m_Level = level;
- m_pContext = pContext;
- m_pDevice = pDevice;
- m_DitherBits = pDevice->GetDeviceCaps(FXDC_DITHER_BITS);
- m_bPrint = m_pDevice->GetDeviceClass() != FXDC_DISPLAY;
- if (pDeviceMatrix) {
- m_DeviceMatrix = *pDeviceMatrix;
- }
- m_pStopObj = pStopObj;
- if (pOptions) {
- m_Options = *pOptions;
- }
- m_bDropObjects = bDropObjects;
- m_bStdCS = bStdCS;
- m_T3FillColor = fill_color;
- m_pType3Char = pType3Char;
- m_GroupFamily = GroupFamily;
- m_bLoadMask = bLoadMask;
- m_pFormResource = pFormResource;
- m_pPageResource = m_pContext->m_pPageResources;
- if (pInitialStates && !m_pType3Char) {
- m_InitialStates.CopyStates(*pInitialStates);
- if (pParentState) {
- CPDF_ColorStateData* pColorData = (CPDF_ColorStateData*)(const CPDF_ColorStateData*)m_InitialStates.m_ColorState;
- CPDF_ColorStateData* pParentData = (CPDF_ColorStateData*)(const CPDF_ColorStateData*)pParentState->m_InitialStates.m_ColorState;
- if (!pColorData || pColorData->m_FillColor.IsNull()) {
- CPDF_ColorStateData* pData = m_InitialStates.m_ColorState.GetModify();
- pData->m_FillRGB = pParentData->m_FillRGB;
- pData->m_FillColor.Copy(&pParentData->m_FillColor);
- }
- if (!pColorData || pColorData->m_StrokeColor.IsNull()) {
- CPDF_ColorStateData* pData = m_InitialStates.m_ColorState.GetModify();
- pData->m_StrokeRGB = pParentData->m_FillRGB;
- pData->m_StrokeColor.Copy(&pParentData->m_StrokeColor);
- }
- }
- } else {
- m_InitialStates.DefaultStates();
- }
-#if defined(_FPDFAPI_MINI_)||defined(_FXCORE_LIMITED_CPU_)
- m_HalftoneLimit = CPDF_ModuleMgr::Get()->GetRenderModule()->GetConfig()->m_HalftoneLimit;
- if (pOptions && pOptions->m_HalftoneLimit >= 0) {
- m_HalftoneLimit = pOptions->m_HalftoneLimit;
- }
-#endif
- m_pObjectRenderer = NULL;
- m_Transparency = transparency;
- return TRUE;
-}
-void CPDF_RenderStatus::RenderObjectList(const CPDF_PageObjects* pObjs, const CFX_AffineMatrix* pObj2Device)
-{
- if (m_Level > 32) {
- return;
- }
- CFX_FloatRect clip_rect = m_pDevice->GetClipBox();
- CFX_AffineMatrix device2object;
- device2object.SetReverse(*pObj2Device);
- device2object.TransformRect(clip_rect);
- int index = 0;
- FX_POSITION pos = pObjs->GetFirstObjectPosition();
- while(pos) {
- index ++;
- CPDF_PageObject* pCurObj = pObjs->GetNextObject(pos);
- if (pCurObj == m_pStopObj) {
- m_bStopped = TRUE;
- return;
- }
- if (!pCurObj) {
- continue;
- }
- if(pCurObj == NULL || pCurObj->m_Left > clip_rect.right || pCurObj->m_Right < clip_rect.left ||
- pCurObj->m_Bottom > clip_rect.top || pCurObj->m_Top < clip_rect.bottom) {
- continue;
- }
- RenderSingleObject(pCurObj, pObj2Device);
- if (m_bStopped) {
- return;
- }
- }
-}
-void CPDF_RenderStatus::RenderSingleObject(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device)
-{
- if (m_Level > 32) {
- return;
- }
- m_pCurObj = pObj;
- if (m_Options.m_pOCContext && pObj->m_ContentMark.NotNull())
- if (!m_Options.m_pOCContext->CheckObjectVisible(pObj)) {
- return;
- }
- ProcessClipPath(pObj->m_ClipPath, pObj2Device);
- if (ProcessTransparency(pObj, pObj2Device)) {
- return;
- }
- ProcessObjectNoClip(pObj, pObj2Device);
-}
-FX_BOOL CPDF_RenderStatus::ContinueSingleObject(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device, IFX_Pause* pPause)
-{
- if (m_pObjectRenderer) {
- if (m_pObjectRenderer->Continue(pPause)) {
- return TRUE;
- }
- if (!m_pObjectRenderer->m_Result) {
- DrawObjWithBackground(pObj, pObj2Device);
- }
-#ifdef _FPDFAPI_MINI_
- if (m_DitherBits) {
- DitherObjectArea(pObj, pObj2Device);
- }
-#endif
- delete m_pObjectRenderer;
- m_pObjectRenderer = NULL;
- return FALSE;
- }
- m_pCurObj = pObj;
- if (m_Options.m_pOCContext && pObj->m_ContentMark.NotNull())
- if (!m_Options.m_pOCContext->CheckObjectVisible(pObj)) {
- return FALSE;
- }
- ProcessClipPath(pObj->m_ClipPath, pObj2Device);
- if (ProcessTransparency(pObj, pObj2Device)) {
- return FALSE;
- }
- if (pObj->m_Type == PDFPAGE_IMAGE) {
- m_pObjectRenderer = IPDF_ObjectRenderer::Create(pObj->m_Type);
- if (!m_pObjectRenderer->Start(this, pObj, pObj2Device, FALSE)) {
- if (!m_pObjectRenderer->m_Result) {
- DrawObjWithBackground(pObj, pObj2Device);
- }
-#ifdef _FPDFAPI_MINI_
- if (m_DitherBits) {
- DitherObjectArea(pObj, pObj2Device);
- }
-#endif
- delete m_pObjectRenderer;
- m_pObjectRenderer = NULL;
- return FALSE;
- }
- return ContinueSingleObject(pObj, pObj2Device, pPause);
- }
- ProcessObjectNoClip(pObj, pObj2Device);
- return FALSE;
-}
-IPDF_ObjectRenderer* IPDF_ObjectRenderer::Create(int type)
-{
- IPDF_ObjectRenderer* pRenderer = NULL;
- if (type == PDFPAGE_IMAGE) {
- pRenderer = FX_NEW CPDF_ImageRenderer;
- }
- return pRenderer;
-}
-FX_BOOL CPDF_RenderStatus::GetObjectClippedRect(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device, FX_BOOL bLogical, FX_RECT &rect) const
-{
- rect = pObj->GetBBox(pObj2Device);
- FX_RECT rtClip = m_pDevice->GetClipBox();
- if (!bLogical) {
- CFX_Matrix dCTM = m_pDevice->GetCTM();
- FX_FLOAT a = FXSYS_fabs(dCTM.a);
- FX_FLOAT d = FXSYS_fabs(dCTM.d);
- if (a != 1.0f || d != 1.0f) {
- rect.right = rect.left + (FX_INT32)FXSYS_ceil((FX_FLOAT)rect.Width() * a);
- rect.bottom = rect.top + (FX_INT32)FXSYS_ceil((FX_FLOAT)rect.Height() * d);
- rtClip.right = rtClip.left + (FX_INT32)FXSYS_ceil((FX_FLOAT)rtClip.Width() * a);
- rtClip.bottom = rtClip.top + (FX_INT32)FXSYS_ceil((FX_FLOAT)rtClip.Height() * d);
- }
- }
- rect.Intersect(rtClip);
- return rect.IsEmpty();
-}
-void CPDF_RenderStatus::DitherObjectArea(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device)
-{
- CFX_DIBitmap* pBitmap = m_pDevice->GetBitmap();
- if (pBitmap == NULL) {
- return;
- }
- FX_RECT rect;
- if (GetObjectClippedRect(pObj, pObj2Device, FALSE, rect)) {
- return;
- }
- if (m_DitherBits == 2) {
- static FX_ARGB pal[4] = {0, 85, 170, 255};
- pBitmap->DitherFS(pal, 4, &rect);
- } else if (m_DitherBits == 3) {
- static FX_ARGB pal[8] = {0, 36, 73, 109, 146, 182, 219, 255};
- pBitmap->DitherFS(pal, 8, &rect);
- } else if (m_DitherBits == 4) {
- static FX_ARGB pal[16] = {0, 17, 34, 51, 68, 85, 102, 119, 136, 153, 170, 187, 204, 221, 238, 255};
- pBitmap->DitherFS(pal, 16, &rect);
- }
-}
-void CPDF_RenderStatus::ProcessObjectNoClip(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device)
-{
- FX_BOOL bRet = FALSE;
- switch (pObj->m_Type) {
- case PDFPAGE_TEXT:
- bRet = ProcessText((CPDF_TextObject*)pObj, pObj2Device, NULL);
- break;
- case PDFPAGE_PATH:
- bRet = ProcessPath((CPDF_PathObject*)pObj, pObj2Device);
- break;
- case PDFPAGE_IMAGE:
- bRet = ProcessImage((CPDF_ImageObject*)pObj, pObj2Device);
- break;
- case PDFPAGE_SHADING:
- bRet = ProcessShading((CPDF_ShadingObject*)pObj, pObj2Device);
- break;
- case PDFPAGE_FORM:
- bRet = ProcessForm((CPDF_FormObject*)pObj, pObj2Device);
- break;
-#if defined(_FPDFAPI_MINI_)
- case PDFPAGE_INLINES:
- bRet = ProcessInlines((CPDF_InlineImages*)pObj, pObj2Device);
- break;
-#endif
- }
- if (!bRet) {
- DrawObjWithBackground(pObj, pObj2Device);
- }
-}
-FX_BOOL CPDF_RenderStatus::DrawObjWithBlend(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device)
-{
- FX_BOOL bRet = FALSE;
- switch (pObj->m_Type) {
- case PDFPAGE_PATH:
- bRet = ProcessPath((CPDF_PathObject*)pObj, pObj2Device);
- break;
- case PDFPAGE_IMAGE:
- bRet = ProcessImage((CPDF_ImageObject *)pObj, pObj2Device);
- break;
- case PDFPAGE_FORM:
- bRet = ProcessForm((CPDF_FormObject*)pObj, pObj2Device);
- break;
- }
- return bRet;
-}
-void CPDF_RenderStatus::GetScaledMatrix(CFX_Matrix &matrix) const
-{
- CFX_Matrix dCTM = m_pDevice->GetCTM();
- matrix.a *= FXSYS_fabs(dCTM.a);
- matrix.d *= FXSYS_fabs(dCTM.d);
-}
-void CPDF_RenderStatus::DrawObjWithBackground(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device)
-{
-#if !defined(_FPDFAPI_MINI_) || defined(_FXCORE_FEATURE_ALL_)
- FX_RECT rect;
- if (GetObjectClippedRect(pObj, pObj2Device, FALSE, rect)) {
- return;
- }
- int res = 300;
- if (pObj->m_Type == PDFPAGE_IMAGE && m_pDevice->GetDeviceCaps(FXDC_DEVICE_CLASS) == FXDC_PRINTER) {
- res = 0;
- }
- CPDF_ScaledRenderBuffer buffer;
- if (!buffer.Initialize(m_pContext, m_pDevice, &rect, pObj, &m_Options, res)) {
- return;
- }
- CFX_AffineMatrix matrix = *pObj2Device;
- matrix.Concat(*buffer.GetMatrix());
- GetScaledMatrix(matrix);
- CPDF_Dictionary* pFormResource = NULL;
- if (pObj->m_Type == PDFPAGE_FORM) {
- CPDF_FormObject* pFormObj = (CPDF_FormObject*)pObj;
- if (pFormObj->m_pForm && pFormObj->m_pForm->m_pFormDict) {
- pFormResource = pFormObj->m_pForm->m_pFormDict->GetDict(FX_BSTRC("Resources"));
- }
- }
- CPDF_RenderStatus status;
- status.Initialize(m_Level + 1, m_pContext, buffer.GetDevice(), buffer.GetMatrix(), NULL, NULL, NULL, &m_Options, m_Transparency, m_bDropObjects, pFormResource);
- status.RenderSingleObject(pObj, &matrix);
- buffer.OutputToDevice();
-#endif
-}
-FX_BOOL CPDF_RenderStatus::ProcessForm(CPDF_FormObject* pFormObj, const CFX_AffineMatrix* pObj2Device)
-{
- CPDF_Dictionary* pOC = pFormObj->m_pForm->m_pFormDict->GetDict(FX_BSTRC("OC"));
- if (pOC && m_Options.m_pOCContext && !m_Options.m_pOCContext->CheckOCGVisible(pOC)) {
- return TRUE;
- }
- CFX_AffineMatrix matrix = pFormObj->m_FormMatrix;
- matrix.Concat(*pObj2Device);
- CPDF_Dictionary* pResources = NULL;
- if (pFormObj->m_pForm && pFormObj->m_pForm->m_pFormDict) {
- pResources = pFormObj->m_pForm->m_pFormDict->GetDict(FX_BSTRC("Resources"));
- }
- CPDF_RenderStatus status;
- status.Initialize(m_Level + 1, m_pContext, m_pDevice, NULL, m_pStopObj,
- this, pFormObj, &m_Options, m_Transparency, m_bDropObjects, pResources, TRUE);
- status.m_curBlend = m_curBlend;
- m_pDevice->SaveState();
- status.RenderObjectList(pFormObj->m_pForm, &matrix);
- m_bStopped = status.m_bStopped;
- m_pDevice->RestoreState();
- return TRUE;
-}
-FX_BOOL IsAvailableMatrix(const CFX_AffineMatrix& matrix)
-{
- if (matrix.a == 0 || matrix.d == 0) {
- return matrix.b != 0 && matrix.c != 0;
- }
- if (matrix.b == 0 || matrix.c == 0) {
- return matrix.a != 0 && matrix.d != 0;
- }
- return TRUE;
-}
-FX_BOOL CPDF_RenderStatus::ProcessPath(CPDF_PathObject* pPathObj, const CFX_AffineMatrix* pObj2Device)
-{
- int FillType = pPathObj->m_FillType;
- FX_BOOL bStroke = pPathObj->m_bStroke;
- ProcessPathPattern(pPathObj, pObj2Device, FillType, bStroke);
- if (FillType == 0 && !bStroke) {
- return TRUE;
- }
- FX_DWORD fill_argb = 0;
- if (FillType) {
- fill_argb = GetFillArgb(pPathObj);
- }
- FX_DWORD stroke_argb = 0;
- if (bStroke) {
- stroke_argb = GetStrokeArgb(pPathObj);
- }
- CFX_AffineMatrix path_matrix = pPathObj->m_Matrix;
- path_matrix.Concat(*pObj2Device);
- if (!IsAvailableMatrix(path_matrix)) {
- return TRUE;
- }
- if (FillType && (m_Options.m_Flags & RENDER_RECT_AA)) {
- FillType |= FXFILL_RECT_AA;
- }
- if (m_Options.m_Flags & RENDER_FILL_FULLCOVER) {
- FillType |= FXFILL_FULLCOVER;
- }
- if (m_Options.m_Flags & RENDER_NOPATHSMOOTH) {
- FillType |= FXFILL_NOPATHSMOOTH;
- }
- if (bStroke) {
- FillType |= FX_FILL_STROKE;
- }
-#if !defined(_FPDFAPI_MINI_) || defined(_FXCORE_FEATURE_ALL_)
- const CPDF_GeneralStateData* pGeneralData = ((CPDF_PageObject*)pPathObj)->m_GeneralState;
- if (pGeneralData && pGeneralData->m_StrokeAdjust) {
- FillType |= FX_STROKE_ADJUST;
- }
-#endif
- if (m_pType3Char) {
- FillType |= FX_FILL_TEXT_MODE;
- }
- CFX_GraphStateData graphState(*pPathObj->m_GraphState);
- if (m_Options.m_Flags & RENDER_THINLINE) {
- graphState.m_LineWidth = 0;
- }
- return m_pDevice->DrawPath(pPathObj->m_Path, &path_matrix, &graphState, fill_argb, stroke_argb, FillType, 0, NULL, m_curBlend);
-}
-CPDF_TransferFunc* CPDF_RenderStatus::GetTransferFunc(CPDF_Object* pObj) const
-{
- ASSERT(pObj != NULL);
- CPDF_DocRenderData* pDocCache = m_pContext->m_pDocument->GetRenderData();
- if (!pDocCache) {
- return NULL;
- }
- return pDocCache->GetTransferFunc(pObj);
-}
-FX_ARGB CPDF_RenderStatus::GetFillArgb(const CPDF_PageObject* pObj, FX_BOOL bType3) const
-{
- CPDF_ColorStateData* pColorData = (CPDF_ColorStateData*)(const CPDF_ColorStateData*)pObj->m_ColorState;
- if (m_pType3Char && !bType3 && (!m_pType3Char->m_bColored || (m_pType3Char->m_bColored && (!pColorData || pColorData->m_FillColor.IsNull())))) {
- return m_T3FillColor;
- } else if (!pColorData || pColorData->m_FillColor.IsNull()) {
- pColorData = (CPDF_ColorStateData*)(const CPDF_ColorStateData*)m_InitialStates.m_ColorState;
- }
- FX_COLORREF rgb = pColorData->m_FillRGB;
- if (rgb == (FX_DWORD) - 1) {
- return 0;
- }
- const CPDF_GeneralStateData* pGeneralData = pObj->m_GeneralState;
- int alpha;
- if (pGeneralData) {
- alpha = (FX_INT32)(pGeneralData->m_FillAlpha * 255);
-#ifndef _FPDFAPI_MINI_
- if (pGeneralData->m_pTR) {
- if (!pGeneralData->m_pTransferFunc) {
- ((CPDF_GeneralStateData*)pGeneralData)->m_pTransferFunc = GetTransferFunc(pGeneralData->m_pTR);
- }
- if (pGeneralData->m_pTransferFunc) {
- rgb = pGeneralData->m_pTransferFunc->TranslateColor(rgb);
- }
- }
-#endif
- } else {
- alpha = 255;
- }
- return m_Options.TranslateColor(ArgbEncode(alpha, rgb));
-}
-FX_ARGB CPDF_RenderStatus::GetStrokeArgb(const CPDF_PageObject* pObj) const
-{
- CPDF_ColorStateData* pColorData = (CPDF_ColorStateData*)(const CPDF_ColorStateData*)pObj->m_ColorState;
- if (m_pType3Char && (!m_pType3Char->m_bColored || (m_pType3Char->m_bColored && (!pColorData || pColorData->m_StrokeColor.IsNull())))) {
- return m_T3FillColor;
- } else if (!pColorData || pColorData->m_StrokeColor.IsNull()) {
- pColorData = (CPDF_ColorStateData*)(const CPDF_ColorStateData*)m_InitialStates.m_ColorState;
- }
- FX_COLORREF rgb = pColorData->m_StrokeRGB;
- if (rgb == (FX_DWORD) - 1) {
- return 0;
- }
- const CPDF_GeneralStateData* pGeneralData = pObj->m_GeneralState;
- int alpha;
- if (pGeneralData) {
- alpha = (FX_INT32)(pGeneralData->m_StrokeAlpha * 255);
-#ifndef _FPDFAPI_MINI_
- if (pGeneralData->m_pTR) {
- if (!pGeneralData->m_pTransferFunc) {
- ((CPDF_GeneralStateData*)pGeneralData)->m_pTransferFunc = GetTransferFunc(pGeneralData->m_pTR);
- }
- if (pGeneralData->m_pTransferFunc) {
- rgb = pGeneralData->m_pTransferFunc->TranslateColor(rgb);
- }
- }
-#endif
- } else {
- alpha = 255;
- }
- return m_Options.TranslateColor(ArgbEncode(alpha, rgb));
-}
-void CPDF_RenderStatus::ProcessClipPath(CPDF_ClipPath ClipPath, const CFX_AffineMatrix* pObj2Device)
-{
- if (ClipPath.IsNull()) {
- if (m_LastClipPath.IsNull()) {
- return;
- }
- m_pDevice->RestoreState(TRUE);
- m_LastClipPath.SetNull();
- return;
- }
- if (m_LastClipPath == ClipPath) {
- return;
- }
- m_LastClipPath = ClipPath;
- m_pDevice->RestoreState(TRUE);
- int nClipPath = ClipPath.GetPathCount();
- int i;
- for (i = 0; i < nClipPath; i++) {
- const CFX_PathData* pPathData = ClipPath.GetPath(i);
- if (pPathData == NULL) {
- continue;
- }
- if (pPathData->GetPointCount() == 0) {
- CFX_PathData EmptyPath;
- EmptyPath.AppendRect(-1, -1, 0, 0);
- int fill_mode = FXFILL_WINDING;
- m_pDevice->SetClip_PathFill(&EmptyPath, NULL, fill_mode);
- } else {
- int ClipType = ClipPath.GetClipType(i);
- m_pDevice->SetClip_PathFill(pPathData, pObj2Device, ClipType);
- }
- }
- int textcount = ClipPath.GetTextCount();
- if (textcount == 0) {
- return;
- }
- if (m_pDevice->GetDeviceClass() == FXDC_DISPLAY && !(m_pDevice->GetDeviceCaps(FXDC_RENDER_CAPS) & FXRC_SOFT_CLIP)) {
- return;
- }
- CFX_PathData* pTextClippingPath = NULL;
- for (i = 0; i < textcount; i ++) {
- CPDF_TextObject* pText = ClipPath.GetText(i);
- if (pText == NULL) {
- if (pTextClippingPath) {
- int fill_mode = FXFILL_WINDING;
- if (m_Options.m_Flags & RENDER_NOTEXTSMOOTH) {
- fill_mode |= FXFILL_NOPATHSMOOTH;
- }
- m_pDevice->SetClip_PathFill(pTextClippingPath, NULL, fill_mode);
- delete pTextClippingPath;
- pTextClippingPath = NULL;
- }
- } else {
- if (pTextClippingPath == NULL) {
- pTextClippingPath = FX_NEW CFX_PathData;
- }
- ProcessText(pText, pObj2Device, pTextClippingPath);
- }
- }
- if (pTextClippingPath) {
- delete pTextClippingPath;
- }
-}
-void CPDF_RenderStatus::DrawClipPath(CPDF_ClipPath ClipPath, const CFX_AffineMatrix* pObj2Device)
-{
- if (ClipPath.IsNull()) {
- return;
- }
- int fill_mode = 0;
- if (m_Options.m_Flags & RENDER_NOPATHSMOOTH) {
- fill_mode |= FXFILL_NOPATHSMOOTH;
- }
- int nClipPath = ClipPath.GetPathCount();
- int i;
- for (i = 0; i < nClipPath; i++) {
- const CFX_PathData* pPathData = ClipPath.GetPath(i);
- if (pPathData == NULL) {
- continue;
- }
- CFX_GraphStateData stroke_state;
- if (m_Options.m_Flags & RENDER_THINLINE) {
- stroke_state.m_LineWidth = 0;
- }
- m_pDevice->DrawPath(pPathData, pObj2Device, &stroke_state, 0, 0xffff0000, fill_mode);
- }
-}
-FX_BOOL CPDF_RenderStatus::SelectClipPath(CPDF_PathObject* pPathObj, const CFX_AffineMatrix* pObj2Device, FX_BOOL bStroke)
-{
- CFX_AffineMatrix path_matrix = pPathObj->m_Matrix;
- path_matrix.Concat(*pObj2Device);
- if (bStroke) {
- CFX_GraphStateData graphState(*pPathObj->m_GraphState);
- if (m_Options.m_Flags & RENDER_THINLINE) {
- graphState.m_LineWidth = 0;
- }
- return m_pDevice->SetClip_PathStroke(pPathObj->m_Path, &path_matrix, &graphState);
- }
- int fill_mode = pPathObj->m_FillType;
- if (m_Options.m_Flags & RENDER_NOPATHSMOOTH) {
- fill_mode |= FXFILL_NOPATHSMOOTH;
- }
- return m_pDevice->SetClip_PathFill(pPathObj->m_Path, &path_matrix, fill_mode);
-}
-FX_BOOL CPDF_RenderStatus::ProcessTransparency(const CPDF_PageObject* pPageObj, const CFX_AffineMatrix* pObj2Device)
-{
- const CPDF_GeneralStateData* pGeneralState = pPageObj->m_GeneralState;
- int blend_type = pGeneralState ? pGeneralState->m_BlendType : FXDIB_BLEND_NORMAL;
- if (blend_type == FXDIB_BLEND_UNSUPPORTED) {
- return TRUE;
- }
- CPDF_Dictionary* pSMaskDict = pGeneralState ? (CPDF_Dictionary*)pGeneralState->m_pSoftMask : NULL;
- if (pSMaskDict) {
- if (pPageObj->m_Type == PDFPAGE_IMAGE &&
- ((CPDF_ImageObject*)pPageObj)->m_pImage->GetDict()->KeyExist(FX_BSTRC("SMask"))) {
- pSMaskDict = NULL;
- }
- }
- CPDF_Dictionary* pFormResource = NULL;
- FX_FLOAT group_alpha = 1.0f;
- int Transparency = m_Transparency;
- FX_BOOL bGroupTransparent = FALSE;
- if (pPageObj->m_Type == PDFPAGE_FORM) {
- CPDF_FormObject* pFormObj = (CPDF_FormObject*)pPageObj;
- const CPDF_GeneralStateData *pStateData = pFormObj->m_GeneralState.GetObject();
- if (pStateData) {
- group_alpha = pStateData->m_FillAlpha;
- }
- Transparency = pFormObj->m_pForm->m_Transparency;
- bGroupTransparent = Transparency & PDFTRANS_ISOLATED ? TRUE : FALSE;
- if (pFormObj->m_pForm->m_pFormDict) {
- pFormResource = pFormObj->m_pForm->m_pFormDict->GetDict("Resources");
- }
- }
- FX_BOOL bTextClip = FALSE;
- if (pPageObj->m_ClipPath.NotNull() && pPageObj->m_ClipPath.GetTextCount() &&
- m_pDevice->GetDeviceClass() == FXDC_DISPLAY && !(m_pDevice->GetDeviceCaps(FXDC_RENDER_CAPS) & FXRC_SOFT_CLIP)) {
- bTextClip = TRUE;
- }
- if ((m_Options.m_Flags & RENDER_OVERPRINT) && pPageObj->m_Type == PDFPAGE_IMAGE && pGeneralState && pGeneralState->m_FillOP && pGeneralState->m_StrokeOP) {
- CPDF_Document* pDocument = NULL;
- CPDF_Page* pPage = NULL;
- if (m_pContext->m_pPageCache) {
- pPage = m_pContext->m_pPageCache->GetPage();
- pDocument = pPage->m_pDocument;
- } else {
- pDocument = ((CPDF_ImageObject*)pPageObj)->m_pImage->GetDocument();
- }
- CPDF_Dictionary* pPageResources = pPage ? pPage->m_pPageResources : NULL;
- CPDF_Object* pCSObj = ((CPDF_ImageObject*)pPageObj)->m_pImage->GetStream()->GetDict()->GetElementValue(FX_BSTRC("ColorSpace"));
- CPDF_ColorSpace* pColorSpace = pDocument->LoadColorSpace(pCSObj, pPageResources);
- if (pColorSpace) {
- int format = pColorSpace->GetFamily();
- if (format == PDFCS_DEVICECMYK || format == PDFCS_SEPARATION || format == PDFCS_DEVICEN) {
- blend_type = FXDIB_BLEND_DARKEN;
- }
- pDocument->GetPageData()->ReleaseColorSpace(pCSObj);
- }
- }
- if (pSMaskDict == NULL && group_alpha == 1.0f && blend_type == FXDIB_BLEND_NORMAL && !bTextClip && !bGroupTransparent) {
- return FALSE;
- }
- FX_BOOL isolated = Transparency & PDFTRANS_ISOLATED;
- if (m_bPrint) {
- FX_BOOL bRet = FALSE;
- int rendCaps = m_pDevice->GetRenderCaps();
- if (!((Transparency & PDFTRANS_ISOLATED) || pSMaskDict || bTextClip) && (rendCaps & FXRC_BLEND_MODE)) {
- int oldBlend = m_curBlend;
- m_curBlend = blend_type;
- bRet = DrawObjWithBlend(pPageObj, pObj2Device);
- m_curBlend = oldBlend;
- }
- if (!bRet) {
- DrawObjWithBackground(pPageObj, pObj2Device);
- }
- return TRUE;
- }
- FX_RECT rect = pPageObj->GetBBox(pObj2Device);
- rect.Intersect(m_pDevice->GetClipBox());
- if (rect.IsEmpty()) {
- return TRUE;
- }
- CFX_Matrix deviceCTM = m_pDevice->GetCTM();
- FX_FLOAT scaleX = FXSYS_fabs(deviceCTM.a);
- FX_FLOAT scaleY = FXSYS_fabs(deviceCTM.d);
- int width = FXSYS_round((FX_FLOAT)rect.Width() * scaleX);
- int height = FXSYS_round((FX_FLOAT)rect.Height() * scaleY);
- CFX_FxgeDevice bitmap_device;
- CFX_DIBitmap* oriDevice = NULL;
- if (!isolated && (m_pDevice->GetRenderCaps() & FXRC_GET_BITS)) {
- oriDevice = FX_NEW CFX_DIBitmap;
- if (!m_pDevice->CreateCompatibleBitmap(oriDevice, width, height)) {
- return TRUE;
- }
- m_pDevice->GetDIBits(oriDevice, rect.left, rect.top);
- }
- if (!bitmap_device.Create(width, height, FXDIB_Argb, 0, oriDevice)) {
- return TRUE;
- }
- CFX_DIBitmap* bitmap = bitmap_device.GetBitmap();
- bitmap->Clear(0);
- CFX_AffineMatrix new_matrix = *pObj2Device;
- new_matrix.TranslateI(-rect.left, -rect.top);
- new_matrix.Scale(scaleX, scaleY);
- CFX_DIBitmap* pTextMask = NULL;
- if (bTextClip) {
- pTextMask = FX_NEW CFX_DIBitmap;
- if (!pTextMask->Create(width, height, FXDIB_8bppMask)) {
- delete pTextMask;
- return TRUE;
- }
- pTextMask->Clear(0);
- CFX_FxgeDevice text_device;
- text_device.Attach(pTextMask);
- for (FX_DWORD i = 0; i < pPageObj->m_ClipPath.GetTextCount(); i ++) {
- CPDF_TextObject* textobj = pPageObj->m_ClipPath.GetText(i);
- if (textobj == NULL) {
- break;
- }
- CFX_AffineMatrix text_matrix;
- textobj->GetTextMatrix(&text_matrix);
- CPDF_TextRenderer::DrawTextPath(&text_device, textobj->m_nChars, textobj->m_pCharCodes, textobj->m_pCharPos,
- textobj->m_TextState.GetFont(), textobj->m_TextState.GetFontSize(),
- &text_matrix, &new_matrix, textobj->m_GraphState, (FX_ARGB) - 1, 0, NULL);
- }
- }
- CPDF_RenderStatus bitmap_render;
- bitmap_render.Initialize(m_Level + 1, m_pContext, &bitmap_device, NULL,
- m_pStopObj, NULL, NULL, &m_Options, 0, m_bDropObjects, pFormResource, TRUE);
- bitmap_render.ProcessObjectNoClip(pPageObj, &new_matrix);
- m_bStopped = bitmap_render.m_bStopped;
- if (pSMaskDict) {
- CFX_AffineMatrix smask_matrix;
- FXSYS_memcpy32(&smask_matrix, pGeneralState->m_SMaskMatrix, sizeof smask_matrix);
- smask_matrix.Concat(*pObj2Device);
- CFX_DIBSource* pSMaskSource = LoadSMask(pSMaskDict, &rect, &smask_matrix);
- if (pSMaskSource) {
- bitmap->MultiplyAlpha(pSMaskSource);
- delete pSMaskSource;
- }
- }
- if (pTextMask) {
- bitmap->MultiplyAlpha(pTextMask);
- delete pTextMask;
- pTextMask = NULL;
- }
- if (Transparency & PDFTRANS_GROUP && group_alpha != 1.0f) {
- bitmap->MultiplyAlpha((FX_INT32)(group_alpha * 255));
- }
- Transparency = m_Transparency;
- if (pPageObj->m_Type == PDFPAGE_FORM) {
- Transparency |= PDFTRANS_GROUP;
- }
- CompositeDIBitmap(bitmap, rect.left, rect.top, 0, 255, blend_type, Transparency);
- if (oriDevice) {
- delete oriDevice;
- }
- return TRUE;
-}
-CFX_DIBitmap* CPDF_RenderStatus::GetBackdrop(const CPDF_PageObject* pObj, const FX_RECT& rect, int& left, int& top,
- FX_BOOL bBackAlphaRequired)
-{
- FX_RECT bbox = rect;
- bbox.Intersect(m_pDevice->GetClipBox());
- left = bbox.left;
- top = bbox.top;
- CFX_Matrix deviceCTM = m_pDevice->GetCTM();
- FX_FLOAT scaleX = FXSYS_fabs(deviceCTM.a);
- FX_FLOAT scaleY = FXSYS_fabs(deviceCTM.d);
- int width = FXSYS_round(bbox.Width() * scaleX);
- int height = FXSYS_round(bbox.Height() * scaleY);
- CFX_DIBitmap* pBackdrop = FX_NEW CFX_DIBitmap;
- if (bBackAlphaRequired && !m_bDropObjects) {
- pBackdrop->Create(width, height, FXDIB_Argb);
- } else {
- m_pDevice->CreateCompatibleBitmap(pBackdrop, width, height);
- }
- if (pBackdrop->GetBuffer() == NULL) {
- delete pBackdrop;
- return NULL;
- }
- FX_BOOL bNeedDraw;
- if (pBackdrop->HasAlpha()) {
- bNeedDraw = !(m_pDevice->GetRenderCaps() & FXRC_ALPHA_OUTPUT);
- } else {
- bNeedDraw = !(m_pDevice->GetRenderCaps() & FXRC_GET_BITS);
- }
- if (!bNeedDraw) {
- m_pDevice->GetDIBits(pBackdrop, left, top);
- return pBackdrop;
- }
- CFX_AffineMatrix FinalMatrix = m_DeviceMatrix;
- FinalMatrix.TranslateI(-left, -top);
- FinalMatrix.Scale(scaleX, scaleY);
- pBackdrop->Clear(pBackdrop->HasAlpha() ? 0 : 0xffffffff);
- CFX_FxgeDevice device;
- device.Attach(pBackdrop);
- m_pContext->Render(&device, pObj, &m_Options, &FinalMatrix);
- return pBackdrop;
-}
-void CPDF_RenderContext::GetBackground(CFX_DIBitmap* pBuffer, const CPDF_PageObject* pObj,
- const CPDF_RenderOptions* pOptions, CFX_AffineMatrix* pFinalMatrix)
-{
- CFX_FxgeDevice device;
- device.Attach(pBuffer);
- if (m_pBackgroundDraw) {
- m_pBackgroundDraw->OnDrawBackground(&device, pFinalMatrix);
- } else {
- FX_RECT rect(0, 0, device.GetWidth(), device.GetHeight());
- device.FillRect(&rect, 0xffffffff);
- }
- Render(&device, pObj, pOptions, pFinalMatrix);
-}
-CPDF_GraphicStates* CPDF_RenderStatus::CloneObjStates(const CPDF_GraphicStates* pSrcStates, FX_BOOL bStroke)
-{
- if (!pSrcStates) {
- return NULL;
- }
- CPDF_GraphicStates* pStates = FX_NEW CPDF_GraphicStates;
- if (!pStates) {
- return NULL;
- }
- pStates->CopyStates(*pSrcStates);
- CPDF_Color* pObjColor = bStroke ? pSrcStates->m_ColorState.GetStrokeColor() :
- pSrcStates->m_ColorState.GetFillColor();
- if (!pObjColor->IsNull()) {
- CPDF_ColorStateData* pColorData = pStates->m_ColorState.GetModify();
- pColorData->m_FillRGB = bStroke ? pSrcStates->m_ColorState.GetObject()->m_StrokeRGB :
- pSrcStates->m_ColorState.GetObject()->m_FillRGB;
- pColorData->m_StrokeRGB = pColorData->m_FillRGB;
- }
- return pStates;
-}
-CPDF_RenderContext::CPDF_RenderContext()
-{
-}
-void CPDF_RenderContext::Create(CPDF_Document* pDoc, CPDF_PageRenderCache* pPageCache,
- CPDF_Dictionary* pPageResources, FX_BOOL bFirstLayer)
-{
- m_pBackgroundDraw = NULL;
- m_pDocument = pDoc;
- m_pPageResources = pPageResources;
- m_pPageCache = pPageCache;
- m_bFirstLayer = bFirstLayer;
-}
-void CPDF_RenderContext::Create(CPDF_Page* pPage, FX_BOOL bFirstLayer)
-{
- m_pBackgroundDraw = NULL;
- m_pDocument = pPage->m_pDocument;
- m_pPageResources = pPage->m_pPageResources;
- m_pPageCache = pPage->GetRenderCache();
- m_bFirstLayer = bFirstLayer;
-}
-CPDF_RenderContext::~CPDF_RenderContext()
-{
-}
-void CPDF_RenderContext::Clear()
-{
- m_pDocument = NULL;
- m_pPageResources = NULL;
- m_pPageCache = NULL;
- m_pBackgroundDraw = NULL;
- m_bFirstLayer = TRUE;
- m_ContentList.RemoveAll();
-}
-void CPDF_RenderContext::AppendObjectList(CPDF_PageObjects* pObjs, const CFX_AffineMatrix* pObject2Device)
-{
- _PDF_RenderItem* pItem = m_ContentList.AddSpace();
- pItem->m_pObjectList = pObjs;
- if (pObject2Device) {
- pItem->m_Matrix = *pObject2Device;
- } else {
- pItem->m_Matrix.SetIdentity();
- }
-}
-void CPDF_RenderContext::Render(CFX_RenderDevice* pDevice, const CPDF_RenderOptions* pOptions,
- const CFX_AffineMatrix* pLastMatrix)
-{
- Render(pDevice, NULL, pOptions, pLastMatrix);
-}
-void CPDF_RenderContext::Render(CFX_RenderDevice* pDevice, const CPDF_PageObject* pStopObj,
- const CPDF_RenderOptions* pOptions, const CFX_AffineMatrix* pLastMatrix)
-{
- int count = m_ContentList.GetSize();
- for (int j = 0; j < count; j ++) {
- pDevice->SaveState();
- _PDF_RenderItem* pItem = m_ContentList.GetDataPtr(j);
- if (pLastMatrix) {
- CFX_AffineMatrix FinalMatrix = pItem->m_Matrix;
- FinalMatrix.Concat(*pLastMatrix);
- CPDF_RenderStatus status;
- status.Initialize(0, this, pDevice, pLastMatrix, pStopObj, NULL, NULL, pOptions,
- pItem->m_pObjectList->m_Transparency, FALSE, NULL);
- status.RenderObjectList(pItem->m_pObjectList, &FinalMatrix);
-#if !defined(_FPDFAPI_MINI_)
- if (status.m_Options.m_Flags & RENDER_LIMITEDIMAGECACHE) {
- m_pPageCache->CacheOptimization(status.m_Options.m_dwLimitCacheSize);
- }
-#endif
- if (status.m_bStopped) {
- pDevice->RestoreState();
- break;
- }
- } else {
- CPDF_RenderStatus status;
- status.Initialize(0, this, pDevice, NULL, pStopObj, NULL, NULL, pOptions,
- pItem->m_pObjectList->m_Transparency, FALSE, NULL);
- status.RenderObjectList(pItem->m_pObjectList, &pItem->m_Matrix);
-#if !defined(_FPDFAPI_MINI_)
- if (status.m_Options.m_Flags & RENDER_LIMITEDIMAGECACHE) {
- m_pPageCache->CacheOptimization(status.m_Options.m_dwLimitCacheSize);
- }
-#endif
- if (status.m_bStopped) {
- pDevice->RestoreState();
- break;
- }
- }
- pDevice->RestoreState();
- }
-}
-void CPDF_RenderContext::DrawObjectList(CFX_RenderDevice* pDevice, CPDF_PageObjects* pObjs,
- const CFX_AffineMatrix* pObject2Device, const CPDF_RenderOptions* pOptions)
-{
- AppendObjectList(pObjs, pObject2Device);
- Render(pDevice, pOptions);
-}
-CPDF_ProgressiveRenderer::CPDF_ProgressiveRenderer()
-{
- m_pRenderer = NULL;
- m_pContext = NULL;
- m_pDevice = NULL;
- m_Status = Ready;
-}
-CPDF_ProgressiveRenderer::~CPDF_ProgressiveRenderer()
-{
- Clear();
-}
-void CPDF_ProgressiveRenderer::Clear()
-{
- if (m_pRenderer) {
- delete m_pRenderer;
- m_pDevice->RestoreState();
- m_pRenderer = NULL;
- }
- m_Status = Ready;
-}
-void CPDF_ProgressiveRenderer::Start(CPDF_RenderContext* pContext, CFX_RenderDevice* pDevice,
- const CPDF_RenderOptions* pOptions, IFX_Pause* pPause, FX_BOOL bDropObjects)
-{
- if (m_Status != Ready) {
- m_Status = Failed;
- return;
- }
- m_pContext = pContext;
- m_pDevice = pDevice;
- m_pOptions = pOptions;
- m_bDropObjects = bDropObjects;
- if (pContext == NULL || pDevice == NULL) {
- m_Status = Failed;
- return;
- }
- m_Status = ToBeContinued;
- m_ObjectPos = NULL;
- m_LayerIndex = 0;
- m_ObjectIndex = 0;
- m_PrevLastPos = NULL;
- Continue(pPause);
-}
-#ifdef _FPDFAPI_MINI_
-#define RENDER_STEP_LIMIT 20
-#else
-#define RENDER_STEP_LIMIT 100
-#endif
-void CPDF_ProgressiveRenderer::Continue(IFX_Pause* pPause)
-{
- if (m_Status != ToBeContinued) {
- return;
- }
- FX_DWORD nLayers = m_pContext->m_ContentList.GetSize();
- for (; m_LayerIndex < nLayers; m_LayerIndex ++) {
- _PDF_RenderItem* pItem = m_pContext->m_ContentList.GetDataPtr(m_LayerIndex);
- FX_POSITION LastPos = pItem->m_pObjectList->GetLastObjectPosition();
- if (m_ObjectPos == NULL) {
- if (LastPos == m_PrevLastPos) {
- if (!pItem->m_pObjectList->IsParsed()) {
- pItem->m_pObjectList->ContinueParse(pPause);
- if (!pItem->m_pObjectList->IsParsed()) {
- return;
- }
- LastPos = pItem->m_pObjectList->GetLastObjectPosition();
- }
- }
- if (LastPos == m_PrevLastPos) {
- if (m_pRenderer) {
- delete m_pRenderer;
- m_pRenderer = NULL;
- m_pDevice->RestoreState();
- m_ObjectPos = NULL;
- m_PrevLastPos = NULL;
- }
- continue;
- }
- if (m_PrevLastPos) {
- m_ObjectPos = m_PrevLastPos;
- pItem->m_pObjectList->GetNextObject(m_ObjectPos);
- } else {
- m_ObjectPos = pItem->m_pObjectList->GetFirstObjectPosition();
- }
- m_PrevLastPos = LastPos;
- }
- if (m_pRenderer == NULL) {
- m_ObjectPos = pItem->m_pObjectList->GetFirstObjectPosition();
- m_ObjectIndex = 0;
- m_pRenderer = FX_NEW CPDF_RenderStatus();
- m_pRenderer->Initialize(0, m_pContext, m_pDevice, NULL, NULL, NULL, NULL,
- m_pOptions, pItem->m_pObjectList->m_Transparency, m_bDropObjects, NULL);
- m_pDevice->SaveState();
- m_ClipRect = m_pDevice->GetClipBox();
- CFX_AffineMatrix device2object;
- device2object.SetReverse(pItem->m_Matrix);
- device2object.TransformRect(m_ClipRect);
- }
- int objs_to_go = CPDF_ModuleMgr::Get()->GetRenderModule()->GetConfig()->m_RenderStepLimit;
- while (m_ObjectPos) {
- CPDF_PageObject* pCurObj = pItem->m_pObjectList->GetObjectAt(m_ObjectPos);
- if (pCurObj && pCurObj->m_Left <= m_ClipRect.right && pCurObj->m_Right >= m_ClipRect.left &&
- pCurObj->m_Bottom <= m_ClipRect.top && pCurObj->m_Top >= m_ClipRect.bottom) {
- if (m_pRenderer->ContinueSingleObject(pCurObj, &pItem->m_Matrix, pPause)) {
- return;
- }
-#if !defined(_FPDFAPI_MINI_)
- if (pCurObj->m_Type == PDFPAGE_IMAGE && m_pRenderer->m_Options.m_Flags & RENDER_LIMITEDIMAGECACHE) {
- m_pContext->GetPageCache()->CacheOptimization(m_pRenderer->m_Options.m_dwLimitCacheSize);
- }
-#endif
- if (pCurObj->m_Type == PDFPAGE_FORM || pCurObj->m_Type == PDFPAGE_SHADING) {
- objs_to_go = 0;
- } else {
- objs_to_go --;
- }
- }
- m_ObjectIndex ++;
- pItem->m_pObjectList->GetNextObject(m_ObjectPos);
- if (objs_to_go == 0) {
- if (pPause && pPause->NeedToPauseNow()) {
- return;
- }
- objs_to_go = CPDF_ModuleMgr::Get()->GetRenderModule()->GetConfig()->m_RenderStepLimit;
- }
- }
- if (!pItem->m_pObjectList->IsParsed()) {
- return;
- }
- delete m_pRenderer;
- m_pRenderer = NULL;
- m_pDevice->RestoreState();
- m_ObjectPos = NULL;
- m_PrevLastPos = NULL;
- if (pPause && pPause->NeedToPauseNow()) {
- m_LayerIndex++;
- return;
- }
- }
- m_Status = Done;
-}
-int CPDF_ProgressiveRenderer::EstimateProgress()
-{
- if (!m_pContext) {
- return 0;
- }
- FX_DWORD nLayers = m_pContext->m_ContentList.GetSize();
- int nTotal = 0, nRendered = 0;
- for (FX_DWORD layer = 0; layer < nLayers; layer ++) {
- _PDF_RenderItem* pItem = m_pContext->m_ContentList.GetDataPtr(layer);
- int nObjs = pItem->m_pObjectList->CountObjects();
- if (layer == m_LayerIndex) {
- nRendered += m_ObjectIndex;
- } else if (layer < m_LayerIndex) {
- nRendered += nObjs;
- }
- nTotal += nObjs;
- }
- if (nTotal == 0) {
- return 0;
- }
- return 100 * nRendered / nTotal;
-}
-CPDF_TransferFunc* CPDF_DocRenderData::GetTransferFunc(CPDF_Object* pObj)
-{
- if (pObj == NULL) {
- return NULL;
- }
- CPDF_CountedObject<CPDF_TransferFunc*>* pTransferCounter;
- if (!m_TransferFuncMap.Lookup(pObj, pTransferCounter)) {
- CPDF_TransferFunc* pTransfer = NULL;
- CPDF_Function* pFuncs[3] = {NULL, NULL, NULL};
- FX_BOOL bUniTransfer = TRUE;
- int i;
- FX_BOOL bIdentity = TRUE;
- if (pObj->GetType() == PDFOBJ_ARRAY) {
- bUniTransfer = FALSE;
- CPDF_Array* pArray = (CPDF_Array*)pObj;
- if (pArray->GetCount() < 3) {
- return NULL;
- }
- for (FX_DWORD i = 0; i < 3; i ++) {
- pFuncs[2 - i] = CPDF_Function::Load(pArray->GetElementValue(i));
- if (pFuncs[2 - i] == NULL) {
- return NULL;
- }
- }
- } else {
- pFuncs[0] = CPDF_Function::Load(pObj);
- if (pFuncs[0] == NULL) {
- return NULL;
- }
- }
- pTransfer = FX_NEW CPDF_TransferFunc;
- pTransfer->m_pPDFDoc = m_pPDFDoc;
- pTransferCounter = FX_NEW CPDF_CountedObject<CPDF_TransferFunc*>;
- pTransferCounter->m_nCount = 1;
- pTransferCounter->m_Obj = pTransfer;
- m_TransferFuncMap.SetAt(pObj, pTransferCounter);
- static const int kMaxOutputs = 16;
- FX_FLOAT output[kMaxOutputs];
- FXSYS_memset32(output, 0, sizeof(output));
- FX_FLOAT input;
- int noutput;
- for (int v = 0; v < 256; v ++) {
- input = (FX_FLOAT)v / 255.0f;
- if (bUniTransfer) {
- if (pFuncs[0] && pFuncs[0]->CountOutputs() <= kMaxOutputs) {
- pFuncs[0]->Call(&input, 1, output, noutput);
- }
- int o = FXSYS_round(output[0] * 255);
- if (o != v) {
- bIdentity = FALSE;
- }
- for (i = 0; i < 3; i ++) {
- pTransfer->m_Samples[i * 256 + v] = o;
- }
- } else
- for (i = 0; i < 3; i ++) {
- if (pFuncs[i] && pFuncs[i]->CountOutputs() <= kMaxOutputs) {
- pFuncs[i]->Call(&input, 1, output, noutput);
- int o = FXSYS_round(output[0] * 255);
- if (o != v) {
- bIdentity = FALSE;
- }
- pTransfer->m_Samples[i * 256 + v] = o;
- } else {
- pTransfer->m_Samples[i * 256 + v] = v;
- }
- }
- }
- for (i = 0; i < 3; i ++)
- if (pFuncs[i]) {
- delete pFuncs[i];
- }
- pTransfer->m_bIdentity = bIdentity;
- }
- pTransferCounter->m_nCount++;
- return pTransferCounter->m_Obj;
-}
-void CPDF_DocRenderData::ReleaseTransferFunc(CPDF_Object* pObj)
-{
- CPDF_CountedObject<CPDF_TransferFunc*>* pTransferCounter;
- if (!m_TransferFuncMap.Lookup(pObj, pTransferCounter)) {
- return;
- }
- pTransferCounter->m_nCount--;
-}
-CPDF_RenderConfig::CPDF_RenderConfig()
-{
- m_HalftoneLimit = 0;
-#ifdef _FPDFAPI_MINI_
- m_RenderStepLimit = 20;
-#else
- m_RenderStepLimit = 100;
-#endif
-}
-CPDF_RenderConfig::~CPDF_RenderConfig()
-{
-}
-CPDF_DeviceBuffer::CPDF_DeviceBuffer()
-{
- m_pBitmap = NULL;
- m_pDevice = NULL;
- m_pContext = NULL;
- m_pObject = NULL;
-}
-CPDF_DeviceBuffer::~CPDF_DeviceBuffer()
-{
- if (m_pBitmap) {
- delete m_pBitmap;
- }
-}
-FX_BOOL CPDF_DeviceBuffer::Initialize(CPDF_RenderContext* pContext, CFX_RenderDevice* pDevice, FX_RECT* pRect,
- const CPDF_PageObject* pObj, int max_dpi)
-{
- m_pDevice = pDevice;
- m_pContext = pContext;
- m_Rect = *pRect;
- m_pObject = pObj;
- m_Matrix.TranslateI(-pRect->left, -pRect->top);
-#if _FXM_PLATFORM_ != _FXM_PLATFORM_APPLE_
- int horz_size = pDevice->GetDeviceCaps(FXDC_HORZ_SIZE);
- int vert_size = pDevice->GetDeviceCaps(FXDC_VERT_SIZE);
- if (horz_size && vert_size && max_dpi) {
- int dpih = pDevice->GetDeviceCaps(FXDC_PIXEL_WIDTH) * 254 / (horz_size * 10);
- int dpiv = pDevice->GetDeviceCaps(FXDC_PIXEL_HEIGHT) * 254 / (vert_size * 10);
- if (dpih > max_dpi) {
- m_Matrix.Scale((FX_FLOAT)(max_dpi) / dpih, 1.0f);
- }
- if (dpiv > max_dpi) {
- m_Matrix.Scale(1.0f, (FX_FLOAT)(max_dpi) / (FX_FLOAT)dpiv);
- }
- }
-#ifdef _FPDFAPI_MINI_
- m_Matrix.Scale(0.5f, 0.5f);
-#endif
-#endif
- CFX_Matrix ctm = m_pDevice->GetCTM();
- FX_FLOAT fScaleX = FXSYS_fabs(ctm.a);
- FX_FLOAT fScaleY = FXSYS_fabs(ctm.d);
- m_Matrix.Concat(fScaleX, 0, 0, fScaleY, 0, 0);
- CFX_FloatRect rect(*pRect);
- m_Matrix.TransformRect(rect);
- FX_RECT bitmap_rect = rect.GetOutterRect();
- m_pBitmap = FX_NEW CFX_DIBitmap;
- m_pBitmap->Create(bitmap_rect.Width(), bitmap_rect.Height(), FXDIB_Argb);
- return TRUE;
-}
-void CPDF_DeviceBuffer::OutputToDevice()
-{
- if (m_pDevice->GetDeviceCaps(FXDC_RENDER_CAPS) & FXRC_GET_BITS) {
- if (m_Matrix.a == 1.0f && m_Matrix.d == 1.0f) {
- m_pDevice->SetDIBits(m_pBitmap, m_Rect.left, m_Rect.top);
- } else {
- m_pDevice->StretchDIBits(m_pBitmap, m_Rect.left, m_Rect.top, m_Rect.Width(), m_Rect.Height());
- }
- } else {
-#if !defined(_FPDFAPI_MINI_) || defined(_FXCORE_FEATURE_ALL_)
- CFX_DIBitmap buffer;
- m_pDevice->CreateCompatibleBitmap(&buffer, m_pBitmap->GetWidth(), m_pBitmap->GetHeight());
- m_pContext->GetBackground(&buffer, m_pObject, NULL, &m_Matrix);
- buffer.CompositeBitmap(0, 0, buffer.GetWidth(), buffer.GetHeight(), m_pBitmap, 0, 0);
- m_pDevice->StretchDIBits(&buffer, m_Rect.left, m_Rect.top, m_Rect.Width(), m_Rect.Height());
-#endif
- }
-}
-CPDF_ScaledRenderBuffer::CPDF_ScaledRenderBuffer()
-{
- m_pBitmapDevice = NULL;
-}
-CPDF_ScaledRenderBuffer::~CPDF_ScaledRenderBuffer()
-{
- if (m_pBitmapDevice) {
- delete m_pBitmapDevice;
- }
-}
-#ifndef _FPDFAPI_MINI_
-#define _FPDFAPI_IMAGESIZE_LIMIT_ (30 * 1024 * 1024)
-#else
-#define _FPDFAPI_IMAGESIZE_LIMIT_ (10 * 1024 * 1024)
-#endif
-FX_BOOL CPDF_ScaledRenderBuffer::Initialize(CPDF_RenderContext* pContext, CFX_RenderDevice* pDevice, FX_RECT* pRect,
- const CPDF_PageObject* pObj, const CPDF_RenderOptions *pOptions, int max_dpi)
-{
- FXSYS_assert(pRect != NULL);
- m_pDevice = pDevice;
- if (m_pDevice->GetDeviceCaps(FXDC_RENDER_CAPS) & FXRC_GET_BITS) {
- return TRUE;
- }
- m_pContext = pContext;
- m_Rect = *pRect;
- m_pObject = pObj;
- m_Matrix.TranslateI(-pRect->left, -pRect->top);
- int horz_size = pDevice->GetDeviceCaps(FXDC_HORZ_SIZE);
- int vert_size = pDevice->GetDeviceCaps(FXDC_VERT_SIZE);
- if (horz_size && vert_size && max_dpi) {
- int dpih = pDevice->GetDeviceCaps(FXDC_PIXEL_WIDTH) * 254 / (horz_size * 10);
- int dpiv = pDevice->GetDeviceCaps(FXDC_PIXEL_HEIGHT) * 254 / (vert_size * 10);
- if (dpih > max_dpi) {
- m_Matrix.Scale((FX_FLOAT)(max_dpi) / dpih, 1.0f);
- }
- if (dpiv > max_dpi) {
- m_Matrix.Scale(1.0f, (FX_FLOAT)(max_dpi) / (FX_FLOAT)dpiv);
- }
- }
- m_pBitmapDevice = FX_NEW CFX_FxgeDevice;
- FXDIB_Format dibFormat = FXDIB_Rgb;
- FX_INT32 bpp = 24;
- if (m_pDevice->GetDeviceCaps(FXDC_RENDER_CAPS) & FXRC_ALPHA_OUTPUT) {
- dibFormat = FXDIB_Argb;
- bpp = 32;
- }
- CFX_FloatRect rect;
- FX_INT32 iWidth, iHeight, iPitch;
- while (1) {
- rect = *pRect;
- m_Matrix.TransformRect(rect);
- FX_RECT bitmap_rect = rect.GetOutterRect();
- iWidth = bitmap_rect.Width();
- iHeight = bitmap_rect.Height();
- iPitch = (iWidth * bpp + 31) / 32 * 4;
- if (iWidth * iHeight < 1) {
- return FALSE;
- }
- if (iPitch * iHeight <= _FPDFAPI_IMAGESIZE_LIMIT_ &&
- m_pBitmapDevice->Create(iWidth, iHeight, dibFormat)) {
- break;
- }
- m_Matrix.Scale(0.5f, 0.5f);
- }
-#if !defined(_FPDFAPI_MINI_) || defined(_FXCORE_FEATURE_ALL_)
- m_pContext->GetBackground(m_pBitmapDevice->GetBitmap(), m_pObject, pOptions, &m_Matrix);
-#endif
- return TRUE;
-}
-void CPDF_ScaledRenderBuffer::OutputToDevice()
-{
- if (m_pBitmapDevice) {
- m_pDevice->StretchDIBits(m_pBitmapDevice->GetBitmap(), m_Rect.left, m_Rect.top, m_Rect.Width(), m_Rect.Height());
- }
-}
-FX_BOOL IPDF_OCContext::CheckObjectVisible(const CPDF_PageObject* pObj)
-{
- const CPDF_ContentMarkData* pData = pObj->m_ContentMark;
- int nItems = pData->CountItems();
- for (int i = 0; i < nItems; i ++) {
- CPDF_ContentMarkItem& item = pData->GetItem(i);
- if (item.GetName() == FX_BSTRC("OC") && item.GetParamType() == CPDF_ContentMarkItem::PropertiesDict) {
- CPDF_Dictionary* pOCG = (CPDF_Dictionary*)item.GetParam();
- if (!CheckOCGVisible(pOCG)) {
- return FALSE;
- }
- }
- }
- return TRUE;
-}
+// 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
+
+#include "../../../include/fpdfapi/fpdf_render.h"
+#include "../../../include/fpdfapi/fpdf_module.h"
+#include "../fpdf_page/pageint.h"
+#include "../../../include/fxge/fx_ge.h"
+#include "../../../include/fxcodec/fx_codec.h"
+#include "render_int.h"
+CPDF_DocRenderData::CPDF_DocRenderData(CPDF_Document* pPDFDoc)
+ : m_pPDFDoc(pPDFDoc)
+ , m_pFontCache(NULL)
+{
+}
+CPDF_DocRenderData::~CPDF_DocRenderData()
+{
+ Clear(TRUE);
+}
+void CPDF_DocRenderData::Clear(FX_BOOL bRelease)
+{
+ FX_POSITION pos;
+ {
+ pos = m_Type3FaceMap.GetStartPosition();
+ while (pos) {
+ CPDF_Font* pFont;
+ CPDF_CountedObject<CPDF_Type3Cache*>* cache;
+ m_Type3FaceMap.GetNextAssoc(pos, pFont, cache);
+ if (bRelease || cache->m_nCount < 2) {
+ delete cache->m_Obj;
+ delete cache;
+ m_Type3FaceMap.RemoveKey(pFont);
+ }
+ }
+ }
+#ifndef _FPDFAPI_MINI_
+ {
+ pos = m_TransferFuncMap.GetStartPosition();
+ while (pos) {
+ CPDF_Object* key;
+ CPDF_CountedObject<CPDF_TransferFunc*>* value;
+ m_TransferFuncMap.GetNextAssoc(pos, key, value);
+ if (bRelease || value->m_nCount < 2) {
+ delete value->m_Obj;
+ delete value;
+ m_TransferFuncMap.RemoveKey(key);
+ }
+ }
+ }
+#endif
+ if (m_pFontCache) {
+ if (bRelease) {
+ delete m_pFontCache;
+ m_pFontCache = NULL;
+ } else {
+ m_pFontCache->FreeCache(FALSE);
+ }
+ }
+}
+FX_BOOL CPDF_DocRenderData::Initialize()
+{
+ m_pFontCache = FX_NEW CFX_FontCache;
+ return TRUE;
+}
+CPDF_Type3Cache* CPDF_DocRenderData::GetCachedType3(CPDF_Type3Font* pFont)
+{
+ CPDF_CountedObject<CPDF_Type3Cache*>* pCache;
+ if (!m_Type3FaceMap.Lookup(pFont, pCache)) {
+ CPDF_Type3Cache* pType3 = FX_NEW CPDF_Type3Cache(pFont);
+ pCache = FX_NEW CPDF_CountedObject<CPDF_Type3Cache*>;
+ pCache->m_Obj = pType3;
+ pCache->m_nCount = 1;
+ m_Type3FaceMap.SetAt(pFont, pCache);
+ }
+ pCache->m_nCount++;
+ return pCache->m_Obj;
+}
+void CPDF_DocRenderData::ReleaseCachedType3(CPDF_Type3Font* pFont)
+{
+ CPDF_CountedObject<CPDF_Type3Cache*>* pCache;
+ if (!m_Type3FaceMap.Lookup(pFont, pCache)) {
+ return;
+ }
+ pCache->m_nCount--;
+}
+class CPDF_RenderModule : public CPDF_RenderModuleDef
+{
+public:
+ virtual ~CPDF_RenderModule() {}
+ virtual FX_BOOL Installed()
+ {
+ return TRUE;
+ }
+ virtual CPDF_DocRenderData* CreateDocData(CPDF_Document* pDoc);
+ virtual void DestroyDocData(CPDF_DocRenderData* p);
+ virtual void ClearDocData(CPDF_DocRenderData* p);
+ virtual CPDF_DocRenderData* GetRenderData()
+ {
+ return &m_RenderData;
+ }
+ virtual CPDF_PageRenderCache* CreatePageCache(CPDF_Page* pPage)
+ {
+ return FX_NEW CPDF_PageRenderCache(pPage);
+ }
+ virtual void DestroyPageCache(CPDF_PageRenderCache* pCache);
+ virtual CPDF_RenderConfig* GetConfig()
+ {
+ return &m_RenderConfig;
+ }
+private:
+ CPDF_DocRenderData m_RenderData;
+ CPDF_RenderConfig m_RenderConfig;
+};
+CPDF_DocRenderData* CPDF_RenderModule::CreateDocData(CPDF_Document* pDoc)
+{
+ CPDF_DocRenderData* pData = FX_NEW CPDF_DocRenderData(pDoc);
+ pData->Initialize();
+ return pData;
+}
+void CPDF_RenderModule::DestroyDocData(CPDF_DocRenderData* pDocData)
+{
+ delete pDocData;
+}
+void CPDF_RenderModule::ClearDocData(CPDF_DocRenderData* p)
+{
+ if (p) {
+ p->Clear(FALSE);
+ }
+}
+void CPDF_RenderModule::DestroyPageCache(CPDF_PageRenderCache* pCache)
+{
+ delete pCache;
+}
+void CPDF_ModuleMgr::InitRenderModule()
+{
+ if (m_pRenderModule) {
+ delete m_pRenderModule;
+ }
+ m_pRenderModule = FX_NEW CPDF_RenderModule;
+}
+CPDF_RenderOptions::CPDF_RenderOptions()
+ : m_ColorMode(RENDER_COLOR_NORMAL)
+ , m_Flags(RENDER_CLEARTYPE)
+ , m_Interpolation(0)
+ , m_AddFlags(0)
+ , m_pOCContext(NULL)
+ , m_dwLimitCacheSize(1024 * 1024 * 100)
+ , m_HalftoneLimit(-1)
+{
+#if defined(_FPDFAPI_MINI_)
+ m_Flags |= RENDER_LIMITEDIMAGECACHE;
+#endif
+}
+FX_ARGB CPDF_RenderOptions::TranslateColor(FX_ARGB argb) const
+{
+ if (m_ColorMode == RENDER_COLOR_NORMAL) {
+ return argb;
+ }
+ if (m_ColorMode == RENDER_COLOR_ALPHA) {
+ return argb;
+ }
+ int a, r, g, b;
+ ArgbDecode(argb, a, r, g, b);
+ int gray = FXRGB2GRAY(r, g, b);
+ if (m_ColorMode == RENDER_COLOR_TWOCOLOR) {
+ int color = (r - gray) * (r - gray) + (g - gray) * (g - gray) + (b - gray) * (b - gray);
+ if (gray < 35 && color < 20) {
+ return ArgbEncode(a, m_ForeColor);
+ }
+ if (gray > 221 && color < 20) {
+ return ArgbEncode(a, m_BackColor);
+ }
+ return argb;
+ }
+ int fr = FXSYS_GetRValue(m_ForeColor);
+ int fg = FXSYS_GetGValue(m_ForeColor);
+ int fb = FXSYS_GetBValue(m_ForeColor);
+ int br = FXSYS_GetRValue(m_BackColor);
+ int bg = FXSYS_GetGValue(m_BackColor);
+ int bb = FXSYS_GetBValue(m_BackColor);
+ r = (br - fr) * gray / 255 + fr;
+ g = (bg - fg) * gray / 255 + fg;
+ b = (bb - fb) * gray / 255 + fb;
+ return ArgbEncode(a, r, g, b);
+}
+CPDF_RenderStatus::CPDF_RenderStatus()
+{
+ m_pContext = NULL;
+ m_bStopped = FALSE;
+ m_Level = 0;
+ m_pDevice = NULL;
+ m_pCurObj = NULL;
+ m_pStopObj = NULL;
+ m_HalftoneLimit = 0;
+ m_pObjectRenderer = NULL;
+ m_bPrint = FALSE;
+ m_Transparency = 0;
+ m_DitherBits = 0;
+ m_bDropObjects = FALSE;
+ m_bStdCS = FALSE;
+ m_GroupFamily = 0;
+ m_bLoadMask = FALSE;
+ m_pType3Char = NULL;
+ m_T3FillColor = 0;
+ m_pFormResource = NULL;
+ m_pPageResource = NULL;
+ m_curBlend = FXDIB_BLEND_NORMAL;
+}
+CPDF_RenderStatus::~CPDF_RenderStatus()
+{
+ if (m_pObjectRenderer) {
+ delete m_pObjectRenderer;
+ }
+}
+FX_BOOL CPDF_RenderStatus::Initialize(int level, CPDF_RenderContext* pContext, CFX_RenderDevice* pDevice,
+ const CFX_AffineMatrix* pDeviceMatrix, const CPDF_PageObject* pStopObj,
+ const CPDF_RenderStatus* pParentState, const CPDF_GraphicStates* pInitialStates,
+ const CPDF_RenderOptions* pOptions, int transparency, FX_BOOL bDropObjects,
+ CPDF_Dictionary* pFormResource, FX_BOOL bStdCS, CPDF_Type3Char* pType3Char,
+ FX_ARGB fill_color, FX_DWORD GroupFamily,
+ FX_BOOL bLoadMask)
+{
+ m_Level = level;
+ m_pContext = pContext;
+ m_pDevice = pDevice;
+ m_DitherBits = pDevice->GetDeviceCaps(FXDC_DITHER_BITS);
+ m_bPrint = m_pDevice->GetDeviceClass() != FXDC_DISPLAY;
+ if (pDeviceMatrix) {
+ m_DeviceMatrix = *pDeviceMatrix;
+ }
+ m_pStopObj = pStopObj;
+ if (pOptions) {
+ m_Options = *pOptions;
+ }
+ m_bDropObjects = bDropObjects;
+ m_bStdCS = bStdCS;
+ m_T3FillColor = fill_color;
+ m_pType3Char = pType3Char;
+ m_GroupFamily = GroupFamily;
+ m_bLoadMask = bLoadMask;
+ m_pFormResource = pFormResource;
+ m_pPageResource = m_pContext->m_pPageResources;
+ if (pInitialStates && !m_pType3Char) {
+ m_InitialStates.CopyStates(*pInitialStates);
+ if (pParentState) {
+ CPDF_ColorStateData* pColorData = (CPDF_ColorStateData*)(const CPDF_ColorStateData*)m_InitialStates.m_ColorState;
+ CPDF_ColorStateData* pParentData = (CPDF_ColorStateData*)(const CPDF_ColorStateData*)pParentState->m_InitialStates.m_ColorState;
+ if (!pColorData || pColorData->m_FillColor.IsNull()) {
+ CPDF_ColorStateData* pData = m_InitialStates.m_ColorState.GetModify();
+ pData->m_FillRGB = pParentData->m_FillRGB;
+ pData->m_FillColor.Copy(&pParentData->m_FillColor);
+ }
+ if (!pColorData || pColorData->m_StrokeColor.IsNull()) {
+ CPDF_ColorStateData* pData = m_InitialStates.m_ColorState.GetModify();
+ pData->m_StrokeRGB = pParentData->m_FillRGB;
+ pData->m_StrokeColor.Copy(&pParentData->m_StrokeColor);
+ }
+ }
+ } else {
+ m_InitialStates.DefaultStates();
+ }
+#if defined(_FPDFAPI_MINI_)||defined(_FXCORE_LIMITED_CPU_)
+ m_HalftoneLimit = CPDF_ModuleMgr::Get()->GetRenderModule()->GetConfig()->m_HalftoneLimit;
+ if (pOptions && pOptions->m_HalftoneLimit >= 0) {
+ m_HalftoneLimit = pOptions->m_HalftoneLimit;
+ }
+#endif
+ m_pObjectRenderer = NULL;
+ m_Transparency = transparency;
+ return TRUE;
+}
+void CPDF_RenderStatus::RenderObjectList(const CPDF_PageObjects* pObjs, const CFX_AffineMatrix* pObj2Device)
+{
+ if (m_Level > 32) {
+ return;
+ }
+ CFX_FloatRect clip_rect = m_pDevice->GetClipBox();
+ CFX_AffineMatrix device2object;
+ device2object.SetReverse(*pObj2Device);
+ device2object.TransformRect(clip_rect);
+ int index = 0;
+ FX_POSITION pos = pObjs->GetFirstObjectPosition();
+ while(pos) {
+ index ++;
+ CPDF_PageObject* pCurObj = pObjs->GetNextObject(pos);
+ if (pCurObj == m_pStopObj) {
+ m_bStopped = TRUE;
+ return;
+ }
+ if (!pCurObj) {
+ continue;
+ }
+ if(pCurObj == NULL || pCurObj->m_Left > clip_rect.right || pCurObj->m_Right < clip_rect.left ||
+ pCurObj->m_Bottom > clip_rect.top || pCurObj->m_Top < clip_rect.bottom) {
+ continue;
+ }
+ RenderSingleObject(pCurObj, pObj2Device);
+ if (m_bStopped) {
+ return;
+ }
+ }
+}
+void CPDF_RenderStatus::RenderSingleObject(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device)
+{
+ if (m_Level > 32) {
+ return;
+ }
+ m_pCurObj = pObj;
+ if (m_Options.m_pOCContext && pObj->m_ContentMark.NotNull())
+ if (!m_Options.m_pOCContext->CheckObjectVisible(pObj)) {
+ return;
+ }
+ ProcessClipPath(pObj->m_ClipPath, pObj2Device);
+ if (ProcessTransparency(pObj, pObj2Device)) {
+ return;
+ }
+ ProcessObjectNoClip(pObj, pObj2Device);
+}
+FX_BOOL CPDF_RenderStatus::ContinueSingleObject(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device, IFX_Pause* pPause)
+{
+ if (m_pObjectRenderer) {
+ if (m_pObjectRenderer->Continue(pPause)) {
+ return TRUE;
+ }
+ if (!m_pObjectRenderer->m_Result) {
+ DrawObjWithBackground(pObj, pObj2Device);
+ }
+#ifdef _FPDFAPI_MINI_
+ if (m_DitherBits) {
+ DitherObjectArea(pObj, pObj2Device);
+ }
+#endif
+ delete m_pObjectRenderer;
+ m_pObjectRenderer = NULL;
+ return FALSE;
+ }
+ m_pCurObj = pObj;
+ if (m_Options.m_pOCContext && pObj->m_ContentMark.NotNull())
+ if (!m_Options.m_pOCContext->CheckObjectVisible(pObj)) {
+ return FALSE;
+ }
+ ProcessClipPath(pObj->m_ClipPath, pObj2Device);
+ if (ProcessTransparency(pObj, pObj2Device)) {
+ return FALSE;
+ }
+ if (pObj->m_Type == PDFPAGE_IMAGE) {
+ m_pObjectRenderer = IPDF_ObjectRenderer::Create(pObj->m_Type);
+ if (!m_pObjectRenderer->Start(this, pObj, pObj2Device, FALSE)) {
+ if (!m_pObjectRenderer->m_Result) {
+ DrawObjWithBackground(pObj, pObj2Device);
+ }
+#ifdef _FPDFAPI_MINI_
+ if (m_DitherBits) {
+ DitherObjectArea(pObj, pObj2Device);
+ }
+#endif
+ delete m_pObjectRenderer;
+ m_pObjectRenderer = NULL;
+ return FALSE;
+ }
+ return ContinueSingleObject(pObj, pObj2Device, pPause);
+ }
+ ProcessObjectNoClip(pObj, pObj2Device);
+ return FALSE;
+}
+IPDF_ObjectRenderer* IPDF_ObjectRenderer::Create(int type)
+{
+ IPDF_ObjectRenderer* pRenderer = NULL;
+ if (type == PDFPAGE_IMAGE) {
+ pRenderer = FX_NEW CPDF_ImageRenderer;
+ }
+ return pRenderer;
+}
+FX_BOOL CPDF_RenderStatus::GetObjectClippedRect(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device, FX_BOOL bLogical, FX_RECT &rect) const
+{
+ rect = pObj->GetBBox(pObj2Device);
+ FX_RECT rtClip = m_pDevice->GetClipBox();
+ if (!bLogical) {
+ CFX_Matrix dCTM = m_pDevice->GetCTM();
+ FX_FLOAT a = FXSYS_fabs(dCTM.a);
+ FX_FLOAT d = FXSYS_fabs(dCTM.d);
+ if (a != 1.0f || d != 1.0f) {
+ rect.right = rect.left + (FX_INT32)FXSYS_ceil((FX_FLOAT)rect.Width() * a);
+ rect.bottom = rect.top + (FX_INT32)FXSYS_ceil((FX_FLOAT)rect.Height() * d);
+ rtClip.right = rtClip.left + (FX_INT32)FXSYS_ceil((FX_FLOAT)rtClip.Width() * a);
+ rtClip.bottom = rtClip.top + (FX_INT32)FXSYS_ceil((FX_FLOAT)rtClip.Height() * d);
+ }
+ }
+ rect.Intersect(rtClip);
+ return rect.IsEmpty();
+}
+void CPDF_RenderStatus::DitherObjectArea(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device)
+{
+ CFX_DIBitmap* pBitmap = m_pDevice->GetBitmap();
+ if (pBitmap == NULL) {
+ return;
+ }
+ FX_RECT rect;
+ if (GetObjectClippedRect(pObj, pObj2Device, FALSE, rect)) {
+ return;
+ }
+ if (m_DitherBits == 2) {
+ static FX_ARGB pal[4] = {0, 85, 170, 255};
+ pBitmap->DitherFS(pal, 4, &rect);
+ } else if (m_DitherBits == 3) {
+ static FX_ARGB pal[8] = {0, 36, 73, 109, 146, 182, 219, 255};
+ pBitmap->DitherFS(pal, 8, &rect);
+ } else if (m_DitherBits == 4) {
+ static FX_ARGB pal[16] = {0, 17, 34, 51, 68, 85, 102, 119, 136, 153, 170, 187, 204, 221, 238, 255};
+ pBitmap->DitherFS(pal, 16, &rect);
+ }
+}
+void CPDF_RenderStatus::ProcessObjectNoClip(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device)
+{
+ FX_BOOL bRet = FALSE;
+ switch (pObj->m_Type) {
+ case PDFPAGE_TEXT:
+ bRet = ProcessText((CPDF_TextObject*)pObj, pObj2Device, NULL);
+ break;
+ case PDFPAGE_PATH:
+ bRet = ProcessPath((CPDF_PathObject*)pObj, pObj2Device);
+ break;
+ case PDFPAGE_IMAGE:
+ bRet = ProcessImage((CPDF_ImageObject*)pObj, pObj2Device);
+ break;
+ case PDFPAGE_SHADING:
+ bRet = ProcessShading((CPDF_ShadingObject*)pObj, pObj2Device);
+ break;
+ case PDFPAGE_FORM:
+ bRet = ProcessForm((CPDF_FormObject*)pObj, pObj2Device);
+ break;
+#if defined(_FPDFAPI_MINI_)
+ case PDFPAGE_INLINES:
+ bRet = ProcessInlines((CPDF_InlineImages*)pObj, pObj2Device);
+ break;
+#endif
+ }
+ if (!bRet) {
+ DrawObjWithBackground(pObj, pObj2Device);
+ }
+}
+FX_BOOL CPDF_RenderStatus::DrawObjWithBlend(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device)
+{
+ FX_BOOL bRet = FALSE;
+ switch (pObj->m_Type) {
+ case PDFPAGE_PATH:
+ bRet = ProcessPath((CPDF_PathObject*)pObj, pObj2Device);
+ break;
+ case PDFPAGE_IMAGE:
+ bRet = ProcessImage((CPDF_ImageObject *)pObj, pObj2Device);
+ break;
+ case PDFPAGE_FORM:
+ bRet = ProcessForm((CPDF_FormObject*)pObj, pObj2Device);
+ break;
+ }
+ return bRet;
+}
+void CPDF_RenderStatus::GetScaledMatrix(CFX_Matrix &matrix) const
+{
+ CFX_Matrix dCTM = m_pDevice->GetCTM();
+ matrix.a *= FXSYS_fabs(dCTM.a);
+ matrix.d *= FXSYS_fabs(dCTM.d);
+}
+void CPDF_RenderStatus::DrawObjWithBackground(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device)
+{
+#if !defined(_FPDFAPI_MINI_) || defined(_FXCORE_FEATURE_ALL_)
+ FX_RECT rect;
+ if (GetObjectClippedRect(pObj, pObj2Device, FALSE, rect)) {
+ return;
+ }
+ int res = 300;
+ if (pObj->m_Type == PDFPAGE_IMAGE && m_pDevice->GetDeviceCaps(FXDC_DEVICE_CLASS) == FXDC_PRINTER) {
+ res = 0;
+ }
+ CPDF_ScaledRenderBuffer buffer;
+ if (!buffer.Initialize(m_pContext, m_pDevice, &rect, pObj, &m_Options, res)) {
+ return;
+ }
+ CFX_AffineMatrix matrix = *pObj2Device;
+ matrix.Concat(*buffer.GetMatrix());
+ GetScaledMatrix(matrix);
+ CPDF_Dictionary* pFormResource = NULL;
+ if (pObj->m_Type == PDFPAGE_FORM) {
+ CPDF_FormObject* pFormObj = (CPDF_FormObject*)pObj;
+ if (pFormObj->m_pForm && pFormObj->m_pForm->m_pFormDict) {
+ pFormResource = pFormObj->m_pForm->m_pFormDict->GetDict(FX_BSTRC("Resources"));
+ }
+ }
+ CPDF_RenderStatus status;
+ status.Initialize(m_Level + 1, m_pContext, buffer.GetDevice(), buffer.GetMatrix(), NULL, NULL, NULL, &m_Options, m_Transparency, m_bDropObjects, pFormResource);
+ status.RenderSingleObject(pObj, &matrix);
+ buffer.OutputToDevice();
+#endif
+}
+FX_BOOL CPDF_RenderStatus::ProcessForm(CPDF_FormObject* pFormObj, const CFX_AffineMatrix* pObj2Device)
+{
+ CPDF_Dictionary* pOC = pFormObj->m_pForm->m_pFormDict->GetDict(FX_BSTRC("OC"));
+ if (pOC && m_Options.m_pOCContext && !m_Options.m_pOCContext->CheckOCGVisible(pOC)) {
+ return TRUE;
+ }
+ CFX_AffineMatrix matrix = pFormObj->m_FormMatrix;
+ matrix.Concat(*pObj2Device);
+ CPDF_Dictionary* pResources = NULL;
+ if (pFormObj->m_pForm && pFormObj->m_pForm->m_pFormDict) {
+ pResources = pFormObj->m_pForm->m_pFormDict->GetDict(FX_BSTRC("Resources"));
+ }
+ CPDF_RenderStatus status;
+ status.Initialize(m_Level + 1, m_pContext, m_pDevice, NULL, m_pStopObj,
+ this, pFormObj, &m_Options, m_Transparency, m_bDropObjects, pResources, TRUE);
+ status.m_curBlend = m_curBlend;
+ m_pDevice->SaveState();
+ status.RenderObjectList(pFormObj->m_pForm, &matrix);
+ m_bStopped = status.m_bStopped;
+ m_pDevice->RestoreState();
+ return TRUE;
+}
+FX_BOOL IsAvailableMatrix(const CFX_AffineMatrix& matrix)
+{
+ if (matrix.a == 0 || matrix.d == 0) {
+ return matrix.b != 0 && matrix.c != 0;
+ }
+ if (matrix.b == 0 || matrix.c == 0) {
+ return matrix.a != 0 && matrix.d != 0;
+ }
+ return TRUE;
+}
+FX_BOOL CPDF_RenderStatus::ProcessPath(CPDF_PathObject* pPathObj, const CFX_AffineMatrix* pObj2Device)
+{
+ int FillType = pPathObj->m_FillType;
+ FX_BOOL bStroke = pPathObj->m_bStroke;
+ ProcessPathPattern(pPathObj, pObj2Device, FillType, bStroke);
+ if (FillType == 0 && !bStroke) {
+ return TRUE;
+ }
+ FX_DWORD fill_argb = 0;
+ if (FillType) {
+ fill_argb = GetFillArgb(pPathObj);
+ }
+ FX_DWORD stroke_argb = 0;
+ if (bStroke) {
+ stroke_argb = GetStrokeArgb(pPathObj);
+ }
+ CFX_AffineMatrix path_matrix = pPathObj->m_Matrix;
+ path_matrix.Concat(*pObj2Device);
+ if (!IsAvailableMatrix(path_matrix)) {
+ return TRUE;
+ }
+ if (FillType && (m_Options.m_Flags & RENDER_RECT_AA)) {
+ FillType |= FXFILL_RECT_AA;
+ }
+ if (m_Options.m_Flags & RENDER_FILL_FULLCOVER) {
+ FillType |= FXFILL_FULLCOVER;
+ }
+ if (m_Options.m_Flags & RENDER_NOPATHSMOOTH) {
+ FillType |= FXFILL_NOPATHSMOOTH;
+ }
+ if (bStroke) {
+ FillType |= FX_FILL_STROKE;
+ }
+#if !defined(_FPDFAPI_MINI_) || defined(_FXCORE_FEATURE_ALL_)
+ const CPDF_GeneralStateData* pGeneralData = ((CPDF_PageObject*)pPathObj)->m_GeneralState;
+ if (pGeneralData && pGeneralData->m_StrokeAdjust) {
+ FillType |= FX_STROKE_ADJUST;
+ }
+#endif
+ if (m_pType3Char) {
+ FillType |= FX_FILL_TEXT_MODE;
+ }
+ CFX_GraphStateData graphState(*pPathObj->m_GraphState);
+ if (m_Options.m_Flags & RENDER_THINLINE) {
+ graphState.m_LineWidth = 0;
+ }
+ return m_pDevice->DrawPath(pPathObj->m_Path, &path_matrix, &graphState, fill_argb, stroke_argb, FillType, 0, NULL, m_curBlend);
+}
+CPDF_TransferFunc* CPDF_RenderStatus::GetTransferFunc(CPDF_Object* pObj) const
+{
+ ASSERT(pObj != NULL);
+ CPDF_DocRenderData* pDocCache = m_pContext->m_pDocument->GetRenderData();
+ if (!pDocCache) {
+ return NULL;
+ }
+ return pDocCache->GetTransferFunc(pObj);
+}
+FX_ARGB CPDF_RenderStatus::GetFillArgb(const CPDF_PageObject* pObj, FX_BOOL bType3) const
+{
+ CPDF_ColorStateData* pColorData = (CPDF_ColorStateData*)(const CPDF_ColorStateData*)pObj->m_ColorState;
+ if (m_pType3Char && !bType3 && (!m_pType3Char->m_bColored || (m_pType3Char->m_bColored && (!pColorData || pColorData->m_FillColor.IsNull())))) {
+ return m_T3FillColor;
+ } else if (!pColorData || pColorData->m_FillColor.IsNull()) {
+ pColorData = (CPDF_ColorStateData*)(const CPDF_ColorStateData*)m_InitialStates.m_ColorState;
+ }
+ FX_COLORREF rgb = pColorData->m_FillRGB;
+ if (rgb == (FX_DWORD) - 1) {
+ return 0;
+ }
+ const CPDF_GeneralStateData* pGeneralData = pObj->m_GeneralState;
+ int alpha;
+ if (pGeneralData) {
+ alpha = (FX_INT32)(pGeneralData->m_FillAlpha * 255);
+#ifndef _FPDFAPI_MINI_
+ if (pGeneralData->m_pTR) {
+ if (!pGeneralData->m_pTransferFunc) {
+ ((CPDF_GeneralStateData*)pGeneralData)->m_pTransferFunc = GetTransferFunc(pGeneralData->m_pTR);
+ }
+ if (pGeneralData->m_pTransferFunc) {
+ rgb = pGeneralData->m_pTransferFunc->TranslateColor(rgb);
+ }
+ }
+#endif
+ } else {
+ alpha = 255;
+ }
+ return m_Options.TranslateColor(ArgbEncode(alpha, rgb));
+}
+FX_ARGB CPDF_RenderStatus::GetStrokeArgb(const CPDF_PageObject* pObj) const
+{
+ CPDF_ColorStateData* pColorData = (CPDF_ColorStateData*)(const CPDF_ColorStateData*)pObj->m_ColorState;
+ if (m_pType3Char && (!m_pType3Char->m_bColored || (m_pType3Char->m_bColored && (!pColorData || pColorData->m_StrokeColor.IsNull())))) {
+ return m_T3FillColor;
+ } else if (!pColorData || pColorData->m_StrokeColor.IsNull()) {
+ pColorData = (CPDF_ColorStateData*)(const CPDF_ColorStateData*)m_InitialStates.m_ColorState;
+ }
+ FX_COLORREF rgb = pColorData->m_StrokeRGB;
+ if (rgb == (FX_DWORD) - 1) {
+ return 0;
+ }
+ const CPDF_GeneralStateData* pGeneralData = pObj->m_GeneralState;
+ int alpha;
+ if (pGeneralData) {
+ alpha = (FX_INT32)(pGeneralData->m_StrokeAlpha * 255);
+#ifndef _FPDFAPI_MINI_
+ if (pGeneralData->m_pTR) {
+ if (!pGeneralData->m_pTransferFunc) {
+ ((CPDF_GeneralStateData*)pGeneralData)->m_pTransferFunc = GetTransferFunc(pGeneralData->m_pTR);
+ }
+ if (pGeneralData->m_pTransferFunc) {
+ rgb = pGeneralData->m_pTransferFunc->TranslateColor(rgb);
+ }
+ }
+#endif
+ } else {
+ alpha = 255;
+ }
+ return m_Options.TranslateColor(ArgbEncode(alpha, rgb));
+}
+void CPDF_RenderStatus::ProcessClipPath(CPDF_ClipPath ClipPath, const CFX_AffineMatrix* pObj2Device)
+{
+ if (ClipPath.IsNull()) {
+ if (m_LastClipPath.IsNull()) {
+ return;
+ }
+ m_pDevice->RestoreState(TRUE);
+ m_LastClipPath.SetNull();
+ return;
+ }
+ if (m_LastClipPath == ClipPath) {
+ return;
+ }
+ m_LastClipPath = ClipPath;
+ m_pDevice->RestoreState(TRUE);
+ int nClipPath = ClipPath.GetPathCount();
+ int i;
+ for (i = 0; i < nClipPath; i++) {
+ const CFX_PathData* pPathData = ClipPath.GetPath(i);
+ if (pPathData == NULL) {
+ continue;
+ }
+ if (pPathData->GetPointCount() == 0) {
+ CFX_PathData EmptyPath;
+ EmptyPath.AppendRect(-1, -1, 0, 0);
+ int fill_mode = FXFILL_WINDING;
+ m_pDevice->SetClip_PathFill(&EmptyPath, NULL, fill_mode);
+ } else {
+ int ClipType = ClipPath.GetClipType(i);
+ m_pDevice->SetClip_PathFill(pPathData, pObj2Device, ClipType);
+ }
+ }
+ int textcount = ClipPath.GetTextCount();
+ if (textcount == 0) {
+ return;
+ }
+ if (m_pDevice->GetDeviceClass() == FXDC_DISPLAY && !(m_pDevice->GetDeviceCaps(FXDC_RENDER_CAPS) & FXRC_SOFT_CLIP)) {
+ return;
+ }
+ CFX_PathData* pTextClippingPath = NULL;
+ for (i = 0; i < textcount; i ++) {
+ CPDF_TextObject* pText = ClipPath.GetText(i);
+ if (pText == NULL) {
+ if (pTextClippingPath) {
+ int fill_mode = FXFILL_WINDING;
+ if (m_Options.m_Flags & RENDER_NOTEXTSMOOTH) {
+ fill_mode |= FXFILL_NOPATHSMOOTH;
+ }
+ m_pDevice->SetClip_PathFill(pTextClippingPath, NULL, fill_mode);
+ delete pTextClippingPath;
+ pTextClippingPath = NULL;
+ }
+ } else {
+ if (pTextClippingPath == NULL) {
+ pTextClippingPath = FX_NEW CFX_PathData;
+ }
+ ProcessText(pText, pObj2Device, pTextClippingPath);
+ }
+ }
+ if (pTextClippingPath) {
+ delete pTextClippingPath;
+ }
+}
+void CPDF_RenderStatus::DrawClipPath(CPDF_ClipPath ClipPath, const CFX_AffineMatrix* pObj2Device)
+{
+ if (ClipPath.IsNull()) {
+ return;
+ }
+ int fill_mode = 0;
+ if (m_Options.m_Flags & RENDER_NOPATHSMOOTH) {
+ fill_mode |= FXFILL_NOPATHSMOOTH;
+ }
+ int nClipPath = ClipPath.GetPathCount();
+ int i;
+ for (i = 0; i < nClipPath; i++) {
+ const CFX_PathData* pPathData = ClipPath.GetPath(i);
+ if (pPathData == NULL) {
+ continue;
+ }
+ CFX_GraphStateData stroke_state;
+ if (m_Options.m_Flags & RENDER_THINLINE) {
+ stroke_state.m_LineWidth = 0;
+ }
+ m_pDevice->DrawPath(pPathData, pObj2Device, &stroke_state, 0, 0xffff0000, fill_mode);
+ }
+}
+FX_BOOL CPDF_RenderStatus::SelectClipPath(CPDF_PathObject* pPathObj, const CFX_AffineMatrix* pObj2Device, FX_BOOL bStroke)
+{
+ CFX_AffineMatrix path_matrix = pPathObj->m_Matrix;
+ path_matrix.Concat(*pObj2Device);
+ if (bStroke) {
+ CFX_GraphStateData graphState(*pPathObj->m_GraphState);
+ if (m_Options.m_Flags & RENDER_THINLINE) {
+ graphState.m_LineWidth = 0;
+ }
+ return m_pDevice->SetClip_PathStroke(pPathObj->m_Path, &path_matrix, &graphState);
+ }
+ int fill_mode = pPathObj->m_FillType;
+ if (m_Options.m_Flags & RENDER_NOPATHSMOOTH) {
+ fill_mode |= FXFILL_NOPATHSMOOTH;
+ }
+ return m_pDevice->SetClip_PathFill(pPathObj->m_Path, &path_matrix, fill_mode);
+}
+FX_BOOL CPDF_RenderStatus::ProcessTransparency(const CPDF_PageObject* pPageObj, const CFX_AffineMatrix* pObj2Device)
+{
+ const CPDF_GeneralStateData* pGeneralState = pPageObj->m_GeneralState;
+ int blend_type = pGeneralState ? pGeneralState->m_BlendType : FXDIB_BLEND_NORMAL;
+ if (blend_type == FXDIB_BLEND_UNSUPPORTED) {
+ return TRUE;
+ }
+ CPDF_Dictionary* pSMaskDict = pGeneralState ? (CPDF_Dictionary*)pGeneralState->m_pSoftMask : NULL;
+ if (pSMaskDict) {
+ if (pPageObj->m_Type == PDFPAGE_IMAGE &&
+ ((CPDF_ImageObject*)pPageObj)->m_pImage->GetDict()->KeyExist(FX_BSTRC("SMask"))) {
+ pSMaskDict = NULL;
+ }
+ }
+ CPDF_Dictionary* pFormResource = NULL;
+ FX_FLOAT group_alpha = 1.0f;
+ int Transparency = m_Transparency;
+ FX_BOOL bGroupTransparent = FALSE;
+ if (pPageObj->m_Type == PDFPAGE_FORM) {
+ CPDF_FormObject* pFormObj = (CPDF_FormObject*)pPageObj;
+ const CPDF_GeneralStateData *pStateData = pFormObj->m_GeneralState.GetObject();
+ if (pStateData) {
+ group_alpha = pStateData->m_FillAlpha;
+ }
+ Transparency = pFormObj->m_pForm->m_Transparency;
+ bGroupTransparent = Transparency & PDFTRANS_ISOLATED ? TRUE : FALSE;
+ if (pFormObj->m_pForm->m_pFormDict) {
+ pFormResource = pFormObj->m_pForm->m_pFormDict->GetDict("Resources");
+ }
+ }
+ FX_BOOL bTextClip = FALSE;
+ if (pPageObj->m_ClipPath.NotNull() && pPageObj->m_ClipPath.GetTextCount() &&
+ m_pDevice->GetDeviceClass() == FXDC_DISPLAY && !(m_pDevice->GetDeviceCaps(FXDC_RENDER_CAPS) & FXRC_SOFT_CLIP)) {
+ bTextClip = TRUE;
+ }
+ if ((m_Options.m_Flags & RENDER_OVERPRINT) && pPageObj->m_Type == PDFPAGE_IMAGE && pGeneralState && pGeneralState->m_FillOP && pGeneralState->m_StrokeOP) {
+ CPDF_Document* pDocument = NULL;
+ CPDF_Page* pPage = NULL;
+ if (m_pContext->m_pPageCache) {
+ pPage = m_pContext->m_pPageCache->GetPage();
+ pDocument = pPage->m_pDocument;
+ } else {
+ pDocument = ((CPDF_ImageObject*)pPageObj)->m_pImage->GetDocument();
+ }
+ CPDF_Dictionary* pPageResources = pPage ? pPage->m_pPageResources : NULL;
+ CPDF_Object* pCSObj = ((CPDF_ImageObject*)pPageObj)->m_pImage->GetStream()->GetDict()->GetElementValue(FX_BSTRC("ColorSpace"));
+ CPDF_ColorSpace* pColorSpace = pDocument->LoadColorSpace(pCSObj, pPageResources);
+ if (pColorSpace) {
+ int format = pColorSpace->GetFamily();
+ if (format == PDFCS_DEVICECMYK || format == PDFCS_SEPARATION || format == PDFCS_DEVICEN) {
+ blend_type = FXDIB_BLEND_DARKEN;
+ }
+ pDocument->GetPageData()->ReleaseColorSpace(pCSObj);
+ }
+ }
+ if (pSMaskDict == NULL && group_alpha == 1.0f && blend_type == FXDIB_BLEND_NORMAL && !bTextClip && !bGroupTransparent) {
+ return FALSE;
+ }
+ FX_BOOL isolated = Transparency & PDFTRANS_ISOLATED;
+ if (m_bPrint) {
+ FX_BOOL bRet = FALSE;
+ int rendCaps = m_pDevice->GetRenderCaps();
+ if (!((Transparency & PDFTRANS_ISOLATED) || pSMaskDict || bTextClip) && (rendCaps & FXRC_BLEND_MODE)) {
+ int oldBlend = m_curBlend;
+ m_curBlend = blend_type;
+ bRet = DrawObjWithBlend(pPageObj, pObj2Device);
+ m_curBlend = oldBlend;
+ }
+ if (!bRet) {
+ DrawObjWithBackground(pPageObj, pObj2Device);
+ }
+ return TRUE;
+ }
+ FX_RECT rect = pPageObj->GetBBox(pObj2Device);
+ rect.Intersect(m_pDevice->GetClipBox());
+ if (rect.IsEmpty()) {
+ return TRUE;
+ }
+ CFX_Matrix deviceCTM = m_pDevice->GetCTM();
+ FX_FLOAT scaleX = FXSYS_fabs(deviceCTM.a);
+ FX_FLOAT scaleY = FXSYS_fabs(deviceCTM.d);
+ int width = FXSYS_round((FX_FLOAT)rect.Width() * scaleX);
+ int height = FXSYS_round((FX_FLOAT)rect.Height() * scaleY);
+ CFX_FxgeDevice bitmap_device;
+ CFX_DIBitmap* oriDevice = NULL;
+ if (!isolated && (m_pDevice->GetRenderCaps() & FXRC_GET_BITS)) {
+ oriDevice = FX_NEW CFX_DIBitmap;
+ if (!m_pDevice->CreateCompatibleBitmap(oriDevice, width, height)) {
+ return TRUE;
+ }
+ m_pDevice->GetDIBits(oriDevice, rect.left, rect.top);
+ }
+ if (!bitmap_device.Create(width, height, FXDIB_Argb, 0, oriDevice)) {
+ return TRUE;
+ }
+ CFX_DIBitmap* bitmap = bitmap_device.GetBitmap();
+ bitmap->Clear(0);
+ CFX_AffineMatrix new_matrix = *pObj2Device;
+ new_matrix.TranslateI(-rect.left, -rect.top);
+ new_matrix.Scale(scaleX, scaleY);
+ CFX_DIBitmap* pTextMask = NULL;
+ if (bTextClip) {
+ pTextMask = FX_NEW CFX_DIBitmap;
+ if (!pTextMask->Create(width, height, FXDIB_8bppMask)) {
+ delete pTextMask;
+ return TRUE;
+ }
+ pTextMask->Clear(0);
+ CFX_FxgeDevice text_device;
+ text_device.Attach(pTextMask);
+ for (FX_DWORD i = 0; i < pPageObj->m_ClipPath.GetTextCount(); i ++) {
+ CPDF_TextObject* textobj = pPageObj->m_ClipPath.GetText(i);
+ if (textobj == NULL) {
+ break;
+ }
+ CFX_AffineMatrix text_matrix;
+ textobj->GetTextMatrix(&text_matrix);
+ CPDF_TextRenderer::DrawTextPath(&text_device, textobj->m_nChars, textobj->m_pCharCodes, textobj->m_pCharPos,
+ textobj->m_TextState.GetFont(), textobj->m_TextState.GetFontSize(),
+ &text_matrix, &new_matrix, textobj->m_GraphState, (FX_ARGB) - 1, 0, NULL);
+ }
+ }
+ CPDF_RenderStatus bitmap_render;
+ bitmap_render.Initialize(m_Level + 1, m_pContext, &bitmap_device, NULL,
+ m_pStopObj, NULL, NULL, &m_Options, 0, m_bDropObjects, pFormResource, TRUE);
+ bitmap_render.ProcessObjectNoClip(pPageObj, &new_matrix);
+ m_bStopped = bitmap_render.m_bStopped;
+ if (pSMaskDict) {
+ CFX_AffineMatrix smask_matrix;
+ FXSYS_memcpy32(&smask_matrix, pGeneralState->m_SMaskMatrix, sizeof smask_matrix);
+ smask_matrix.Concat(*pObj2Device);
+ CFX_DIBSource* pSMaskSource = LoadSMask(pSMaskDict, &rect, &smask_matrix);
+ if (pSMaskSource) {
+ bitmap->MultiplyAlpha(pSMaskSource);
+ delete pSMaskSource;
+ }
+ }
+ if (pTextMask) {
+ bitmap->MultiplyAlpha(pTextMask);
+ delete pTextMask;
+ pTextMask = NULL;
+ }
+ if (Transparency & PDFTRANS_GROUP && group_alpha != 1.0f) {
+ bitmap->MultiplyAlpha((FX_INT32)(group_alpha * 255));
+ }
+ Transparency = m_Transparency;
+ if (pPageObj->m_Type == PDFPAGE_FORM) {
+ Transparency |= PDFTRANS_GROUP;
+ }
+ CompositeDIBitmap(bitmap, rect.left, rect.top, 0, 255, blend_type, Transparency);
+ if (oriDevice) {
+ delete oriDevice;
+ }
+ return TRUE;
+}
+CFX_DIBitmap* CPDF_RenderStatus::GetBackdrop(const CPDF_PageObject* pObj, const FX_RECT& rect, int& left, int& top,
+ FX_BOOL bBackAlphaRequired)
+{
+ FX_RECT bbox = rect;
+ bbox.Intersect(m_pDevice->GetClipBox());
+ left = bbox.left;
+ top = bbox.top;
+ CFX_Matrix deviceCTM = m_pDevice->GetCTM();
+ FX_FLOAT scaleX = FXSYS_fabs(deviceCTM.a);
+ FX_FLOAT scaleY = FXSYS_fabs(deviceCTM.d);
+ int width = FXSYS_round(bbox.Width() * scaleX);
+ int height = FXSYS_round(bbox.Height() * scaleY);
+ CFX_DIBitmap* pBackdrop = FX_NEW CFX_DIBitmap;
+ if (bBackAlphaRequired && !m_bDropObjects) {
+ pBackdrop->Create(width, height, FXDIB_Argb);
+ } else {
+ m_pDevice->CreateCompatibleBitmap(pBackdrop, width, height);
+ }
+ if (pBackdrop->GetBuffer() == NULL) {
+ delete pBackdrop;
+ return NULL;
+ }
+ FX_BOOL bNeedDraw;
+ if (pBackdrop->HasAlpha()) {
+ bNeedDraw = !(m_pDevice->GetRenderCaps() & FXRC_ALPHA_OUTPUT);
+ } else {
+ bNeedDraw = !(m_pDevice->GetRenderCaps() & FXRC_GET_BITS);
+ }
+ if (!bNeedDraw) {
+ m_pDevice->GetDIBits(pBackdrop, left, top);
+ return pBackdrop;
+ }
+ CFX_AffineMatrix FinalMatrix = m_DeviceMatrix;
+ FinalMatrix.TranslateI(-left, -top);
+ FinalMatrix.Scale(scaleX, scaleY);
+ pBackdrop->Clear(pBackdrop->HasAlpha() ? 0 : 0xffffffff);
+ CFX_FxgeDevice device;
+ device.Attach(pBackdrop);
+ m_pContext->Render(&device, pObj, &m_Options, &FinalMatrix);
+ return pBackdrop;
+}
+void CPDF_RenderContext::GetBackground(CFX_DIBitmap* pBuffer, const CPDF_PageObject* pObj,
+ const CPDF_RenderOptions* pOptions, CFX_AffineMatrix* pFinalMatrix)
+{
+ CFX_FxgeDevice device;
+ device.Attach(pBuffer);
+ if (m_pBackgroundDraw) {
+ m_pBackgroundDraw->OnDrawBackground(&device, pFinalMatrix);
+ } else {
+ FX_RECT rect(0, 0, device.GetWidth(), device.GetHeight());
+ device.FillRect(&rect, 0xffffffff);
+ }
+ Render(&device, pObj, pOptions, pFinalMatrix);
+}
+CPDF_GraphicStates* CPDF_RenderStatus::CloneObjStates(const CPDF_GraphicStates* pSrcStates, FX_BOOL bStroke)
+{
+ if (!pSrcStates) {
+ return NULL;
+ }
+ CPDF_GraphicStates* pStates = FX_NEW CPDF_GraphicStates;
+ if (!pStates) {
+ return NULL;
+ }
+ pStates->CopyStates(*pSrcStates);
+ CPDF_Color* pObjColor = bStroke ? pSrcStates->m_ColorState.GetStrokeColor() :
+ pSrcStates->m_ColorState.GetFillColor();
+ if (!pObjColor->IsNull()) {
+ CPDF_ColorStateData* pColorData = pStates->m_ColorState.GetModify();
+ pColorData->m_FillRGB = bStroke ? pSrcStates->m_ColorState.GetObject()->m_StrokeRGB :
+ pSrcStates->m_ColorState.GetObject()->m_FillRGB;
+ pColorData->m_StrokeRGB = pColorData->m_FillRGB;
+ }
+ return pStates;
+}
+CPDF_RenderContext::CPDF_RenderContext()
+{
+}
+void CPDF_RenderContext::Create(CPDF_Document* pDoc, CPDF_PageRenderCache* pPageCache,
+ CPDF_Dictionary* pPageResources, FX_BOOL bFirstLayer)
+{
+ m_pBackgroundDraw = NULL;
+ m_pDocument = pDoc;
+ m_pPageResources = pPageResources;
+ m_pPageCache = pPageCache;
+ m_bFirstLayer = bFirstLayer;
+}
+void CPDF_RenderContext::Create(CPDF_Page* pPage, FX_BOOL bFirstLayer)
+{
+ m_pBackgroundDraw = NULL;
+ m_pDocument = pPage->m_pDocument;
+ m_pPageResources = pPage->m_pPageResources;
+ m_pPageCache = pPage->GetRenderCache();
+ m_bFirstLayer = bFirstLayer;
+}
+CPDF_RenderContext::~CPDF_RenderContext()
+{
+}
+void CPDF_RenderContext::Clear()
+{
+ m_pDocument = NULL;
+ m_pPageResources = NULL;
+ m_pPageCache = NULL;
+ m_pBackgroundDraw = NULL;
+ m_bFirstLayer = TRUE;
+ m_ContentList.RemoveAll();
+}
+void CPDF_RenderContext::AppendObjectList(CPDF_PageObjects* pObjs, const CFX_AffineMatrix* pObject2Device)
+{
+ _PDF_RenderItem* pItem = m_ContentList.AddSpace();
+ pItem->m_pObjectList = pObjs;
+ if (pObject2Device) {
+ pItem->m_Matrix = *pObject2Device;
+ } else {
+ pItem->m_Matrix.SetIdentity();
+ }
+}
+void CPDF_RenderContext::Render(CFX_RenderDevice* pDevice, const CPDF_RenderOptions* pOptions,
+ const CFX_AffineMatrix* pLastMatrix)
+{
+ Render(pDevice, NULL, pOptions, pLastMatrix);
+}
+void CPDF_RenderContext::Render(CFX_RenderDevice* pDevice, const CPDF_PageObject* pStopObj,
+ const CPDF_RenderOptions* pOptions, const CFX_AffineMatrix* pLastMatrix)
+{
+ int count = m_ContentList.GetSize();
+ for (int j = 0; j < count; j ++) {
+ pDevice->SaveState();
+ _PDF_RenderItem* pItem = m_ContentList.GetDataPtr(j);
+ if (pLastMatrix) {
+ CFX_AffineMatrix FinalMatrix = pItem->m_Matrix;
+ FinalMatrix.Concat(*pLastMatrix);
+ CPDF_RenderStatus status;
+ status.Initialize(0, this, pDevice, pLastMatrix, pStopObj, NULL, NULL, pOptions,
+ pItem->m_pObjectList->m_Transparency, FALSE, NULL);
+ status.RenderObjectList(pItem->m_pObjectList, &FinalMatrix);
+#if !defined(_FPDFAPI_MINI_)
+ if (status.m_Options.m_Flags & RENDER_LIMITEDIMAGECACHE) {
+ m_pPageCache->CacheOptimization(status.m_Options.m_dwLimitCacheSize);
+ }
+#endif
+ if (status.m_bStopped) {
+ pDevice->RestoreState();
+ break;
+ }
+ } else {
+ CPDF_RenderStatus status;
+ status.Initialize(0, this, pDevice, NULL, pStopObj, NULL, NULL, pOptions,
+ pItem->m_pObjectList->m_Transparency, FALSE, NULL);
+ status.RenderObjectList(pItem->m_pObjectList, &pItem->m_Matrix);
+#if !defined(_FPDFAPI_MINI_)
+ if (status.m_Options.m_Flags & RENDER_LIMITEDIMAGECACHE) {
+ m_pPageCache->CacheOptimization(status.m_Options.m_dwLimitCacheSize);
+ }
+#endif
+ if (status.m_bStopped) {
+ pDevice->RestoreState();
+ break;
+ }
+ }
+ pDevice->RestoreState();
+ }
+}
+void CPDF_RenderContext::DrawObjectList(CFX_RenderDevice* pDevice, CPDF_PageObjects* pObjs,
+ const CFX_AffineMatrix* pObject2Device, const CPDF_RenderOptions* pOptions)
+{
+ AppendObjectList(pObjs, pObject2Device);
+ Render(pDevice, pOptions);
+}
+CPDF_ProgressiveRenderer::CPDF_ProgressiveRenderer()
+{
+ m_pRenderer = NULL;
+ m_pContext = NULL;
+ m_pDevice = NULL;
+ m_Status = Ready;
+}
+CPDF_ProgressiveRenderer::~CPDF_ProgressiveRenderer()
+{
+ Clear();
+}
+void CPDF_ProgressiveRenderer::Clear()
+{
+ if (m_pRenderer) {
+ delete m_pRenderer;
+ m_pDevice->RestoreState();
+ m_pRenderer = NULL;
+ }
+ m_Status = Ready;
+}
+void CPDF_ProgressiveRenderer::Start(CPDF_RenderContext* pContext, CFX_RenderDevice* pDevice,
+ const CPDF_RenderOptions* pOptions, IFX_Pause* pPause, FX_BOOL bDropObjects)
+{
+ if (m_Status != Ready) {
+ m_Status = Failed;
+ return;
+ }
+ m_pContext = pContext;
+ m_pDevice = pDevice;
+ m_pOptions = pOptions;
+ m_bDropObjects = bDropObjects;
+ if (pContext == NULL || pDevice == NULL) {
+ m_Status = Failed;
+ return;
+ }
+ m_Status = ToBeContinued;
+ m_ObjectPos = NULL;
+ m_LayerIndex = 0;
+ m_ObjectIndex = 0;
+ m_PrevLastPos = NULL;
+ Continue(pPause);
+}
+#ifdef _FPDFAPI_MINI_
+#define RENDER_STEP_LIMIT 20
+#else
+#define RENDER_STEP_LIMIT 100
+#endif
+void CPDF_ProgressiveRenderer::Continue(IFX_Pause* pPause)
+{
+ if (m_Status != ToBeContinued) {
+ return;
+ }
+ FX_DWORD nLayers = m_pContext->m_ContentList.GetSize();
+ for (; m_LayerIndex < nLayers; m_LayerIndex ++) {
+ _PDF_RenderItem* pItem = m_pContext->m_ContentList.GetDataPtr(m_LayerIndex);
+ FX_POSITION LastPos = pItem->m_pObjectList->GetLastObjectPosition();
+ if (m_ObjectPos == NULL) {
+ if (LastPos == m_PrevLastPos) {
+ if (!pItem->m_pObjectList->IsParsed()) {
+ pItem->m_pObjectList->ContinueParse(pPause);
+ if (!pItem->m_pObjectList->IsParsed()) {
+ return;
+ }
+ LastPos = pItem->m_pObjectList->GetLastObjectPosition();
+ }
+ }
+ if (LastPos == m_PrevLastPos) {
+ if (m_pRenderer) {
+ delete m_pRenderer;
+ m_pRenderer = NULL;
+ m_pDevice->RestoreState();
+ m_ObjectPos = NULL;
+ m_PrevLastPos = NULL;
+ }
+ continue;
+ }
+ if (m_PrevLastPos) {
+ m_ObjectPos = m_PrevLastPos;
+ pItem->m_pObjectList->GetNextObject(m_ObjectPos);
+ } else {
+ m_ObjectPos = pItem->m_pObjectList->GetFirstObjectPosition();
+ }
+ m_PrevLastPos = LastPos;
+ }
+ if (m_pRenderer == NULL) {
+ m_ObjectPos = pItem->m_pObjectList->GetFirstObjectPosition();
+ m_ObjectIndex = 0;
+ m_pRenderer = FX_NEW CPDF_RenderStatus();
+ m_pRenderer->Initialize(0, m_pContext, m_pDevice, NULL, NULL, NULL, NULL,
+ m_pOptions, pItem->m_pObjectList->m_Transparency, m_bDropObjects, NULL);
+ m_pDevice->SaveState();
+ m_ClipRect = m_pDevice->GetClipBox();
+ CFX_AffineMatrix device2object;
+ device2object.SetReverse(pItem->m_Matrix);
+ device2object.TransformRect(m_ClipRect);
+ }
+ int objs_to_go = CPDF_ModuleMgr::Get()->GetRenderModule()->GetConfig()->m_RenderStepLimit;
+ while (m_ObjectPos) {
+ CPDF_PageObject* pCurObj = pItem->m_pObjectList->GetObjectAt(m_ObjectPos);
+ if (pCurObj && pCurObj->m_Left <= m_ClipRect.right && pCurObj->m_Right >= m_ClipRect.left &&
+ pCurObj->m_Bottom <= m_ClipRect.top && pCurObj->m_Top >= m_ClipRect.bottom) {
+ if (m_pRenderer->ContinueSingleObject(pCurObj, &pItem->m_Matrix, pPause)) {
+ return;
+ }
+#if !defined(_FPDFAPI_MINI_)
+ if (pCurObj->m_Type == PDFPAGE_IMAGE && m_pRenderer->m_Options.m_Flags & RENDER_LIMITEDIMAGECACHE) {
+ m_pContext->GetPageCache()->CacheOptimization(m_pRenderer->m_Options.m_dwLimitCacheSize);
+ }
+#endif
+ if (pCurObj->m_Type == PDFPAGE_FORM || pCurObj->m_Type == PDFPAGE_SHADING) {
+ objs_to_go = 0;
+ } else {
+ objs_to_go --;
+ }
+ }
+ m_ObjectIndex ++;
+ pItem->m_pObjectList->GetNextObject(m_ObjectPos);
+ if (objs_to_go == 0) {
+ if (pPause && pPause->NeedToPauseNow()) {
+ return;
+ }
+ objs_to_go = CPDF_ModuleMgr::Get()->GetRenderModule()->GetConfig()->m_RenderStepLimit;
+ }
+ }
+ if (!pItem->m_pObjectList->IsParsed()) {
+ return;
+ }
+ delete m_pRenderer;
+ m_pRenderer = NULL;
+ m_pDevice->RestoreState();
+ m_ObjectPos = NULL;
+ m_PrevLastPos = NULL;
+ if (pPause && pPause->NeedToPauseNow()) {
+ m_LayerIndex++;
+ return;
+ }
+ }
+ m_Status = Done;
+}
+int CPDF_ProgressiveRenderer::EstimateProgress()
+{
+ if (!m_pContext) {
+ return 0;
+ }
+ FX_DWORD nLayers = m_pContext->m_ContentList.GetSize();
+ int nTotal = 0, nRendered = 0;
+ for (FX_DWORD layer = 0; layer < nLayers; layer ++) {
+ _PDF_RenderItem* pItem = m_pContext->m_ContentList.GetDataPtr(layer);
+ int nObjs = pItem->m_pObjectList->CountObjects();
+ if (layer == m_LayerIndex) {
+ nRendered += m_ObjectIndex;
+ } else if (layer < m_LayerIndex) {
+ nRendered += nObjs;
+ }
+ nTotal += nObjs;
+ }
+ if (nTotal == 0) {
+ return 0;
+ }
+ return 100 * nRendered / nTotal;
+}
+CPDF_TransferFunc* CPDF_DocRenderData::GetTransferFunc(CPDF_Object* pObj)
+{
+ if (pObj == NULL) {
+ return NULL;
+ }
+ CPDF_CountedObject<CPDF_TransferFunc*>* pTransferCounter;
+ if (!m_TransferFuncMap.Lookup(pObj, pTransferCounter)) {
+ CPDF_TransferFunc* pTransfer = NULL;
+ CPDF_Function* pFuncs[3] = {NULL, NULL, NULL};
+ FX_BOOL bUniTransfer = TRUE;
+ int i;
+ FX_BOOL bIdentity = TRUE;
+ if (pObj->GetType() == PDFOBJ_ARRAY) {
+ bUniTransfer = FALSE;
+ CPDF_Array* pArray = (CPDF_Array*)pObj;
+ if (pArray->GetCount() < 3) {
+ return NULL;
+ }
+ for (FX_DWORD i = 0; i < 3; i ++) {
+ pFuncs[2 - i] = CPDF_Function::Load(pArray->GetElementValue(i));
+ if (pFuncs[2 - i] == NULL) {
+ return NULL;
+ }
+ }
+ } else {
+ pFuncs[0] = CPDF_Function::Load(pObj);
+ if (pFuncs[0] == NULL) {
+ return NULL;
+ }
+ }
+ pTransfer = FX_NEW CPDF_TransferFunc;
+ pTransfer->m_pPDFDoc = m_pPDFDoc;
+ pTransferCounter = FX_NEW CPDF_CountedObject<CPDF_TransferFunc*>;
+ pTransferCounter->m_nCount = 1;
+ pTransferCounter->m_Obj = pTransfer;
+ m_TransferFuncMap.SetAt(pObj, pTransferCounter);
+ static const int kMaxOutputs = 16;
+ FX_FLOAT output[kMaxOutputs];
+ FXSYS_memset32(output, 0, sizeof(output));
+ FX_FLOAT input;
+ int noutput;
+ for (int v = 0; v < 256; v ++) {
+ input = (FX_FLOAT)v / 255.0f;
+ if (bUniTransfer) {
+ if (pFuncs[0] && pFuncs[0]->CountOutputs() <= kMaxOutputs) {
+ pFuncs[0]->Call(&input, 1, output, noutput);
+ }
+ int o = FXSYS_round(output[0] * 255);
+ if (o != v) {
+ bIdentity = FALSE;
+ }
+ for (i = 0; i < 3; i ++) {
+ pTransfer->m_Samples[i * 256 + v] = o;
+ }
+ } else
+ for (i = 0; i < 3; i ++) {
+ if (pFuncs[i] && pFuncs[i]->CountOutputs() <= kMaxOutputs) {
+ pFuncs[i]->Call(&input, 1, output, noutput);
+ int o = FXSYS_round(output[0] * 255);
+ if (o != v) {
+ bIdentity = FALSE;
+ }
+ pTransfer->m_Samples[i * 256 + v] = o;
+ } else {
+ pTransfer->m_Samples[i * 256 + v] = v;
+ }
+ }
+ }
+ for (i = 0; i < 3; i ++)
+ if (pFuncs[i]) {
+ delete pFuncs[i];
+ }
+ pTransfer->m_bIdentity = bIdentity;
+ }
+ pTransferCounter->m_nCount++;
+ return pTransferCounter->m_Obj;
+}
+void CPDF_DocRenderData::ReleaseTransferFunc(CPDF_Object* pObj)
+{
+ CPDF_CountedObject<CPDF_TransferFunc*>* pTransferCounter;
+ if (!m_TransferFuncMap.Lookup(pObj, pTransferCounter)) {
+ return;
+ }
+ pTransferCounter->m_nCount--;
+}
+CPDF_RenderConfig::CPDF_RenderConfig()
+{
+ m_HalftoneLimit = 0;
+#ifdef _FPDFAPI_MINI_
+ m_RenderStepLimit = 20;
+#else
+ m_RenderStepLimit = 100;
+#endif
+}
+CPDF_RenderConfig::~CPDF_RenderConfig()
+{
+}
+CPDF_DeviceBuffer::CPDF_DeviceBuffer()
+{
+ m_pBitmap = NULL;
+ m_pDevice = NULL;
+ m_pContext = NULL;
+ m_pObject = NULL;
+}
+CPDF_DeviceBuffer::~CPDF_DeviceBuffer()
+{
+ if (m_pBitmap) {
+ delete m_pBitmap;
+ }
+}
+FX_BOOL CPDF_DeviceBuffer::Initialize(CPDF_RenderContext* pContext, CFX_RenderDevice* pDevice, FX_RECT* pRect,
+ const CPDF_PageObject* pObj, int max_dpi)
+{
+ m_pDevice = pDevice;
+ m_pContext = pContext;
+ m_Rect = *pRect;
+ m_pObject = pObj;
+ m_Matrix.TranslateI(-pRect->left, -pRect->top);
+#if _FXM_PLATFORM_ != _FXM_PLATFORM_APPLE_
+ int horz_size = pDevice->GetDeviceCaps(FXDC_HORZ_SIZE);
+ int vert_size = pDevice->GetDeviceCaps(FXDC_VERT_SIZE);
+ if (horz_size && vert_size && max_dpi) {
+ int dpih = pDevice->GetDeviceCaps(FXDC_PIXEL_WIDTH) * 254 / (horz_size * 10);
+ int dpiv = pDevice->GetDeviceCaps(FXDC_PIXEL_HEIGHT) * 254 / (vert_size * 10);
+ if (dpih > max_dpi) {
+ m_Matrix.Scale((FX_FLOAT)(max_dpi) / dpih, 1.0f);
+ }
+ if (dpiv > max_dpi) {
+ m_Matrix.Scale(1.0f, (FX_FLOAT)(max_dpi) / (FX_FLOAT)dpiv);
+ }
+ }
+#ifdef _FPDFAPI_MINI_
+ m_Matrix.Scale(0.5f, 0.5f);
+#endif
+#endif
+ CFX_Matrix ctm = m_pDevice->GetCTM();
+ FX_FLOAT fScaleX = FXSYS_fabs(ctm.a);
+ FX_FLOAT fScaleY = FXSYS_fabs(ctm.d);
+ m_Matrix.Concat(fScaleX, 0, 0, fScaleY, 0, 0);
+ CFX_FloatRect rect(*pRect);
+ m_Matrix.TransformRect(rect);
+ FX_RECT bitmap_rect = rect.GetOutterRect();
+ m_pBitmap = FX_NEW CFX_DIBitmap;
+ m_pBitmap->Create(bitmap_rect.Width(), bitmap_rect.Height(), FXDIB_Argb);
+ return TRUE;
+}
+void CPDF_DeviceBuffer::OutputToDevice()
+{
+ if (m_pDevice->GetDeviceCaps(FXDC_RENDER_CAPS) & FXRC_GET_BITS) {
+ if (m_Matrix.a == 1.0f && m_Matrix.d == 1.0f) {
+ m_pDevice->SetDIBits(m_pBitmap, m_Rect.left, m_Rect.top);
+ } else {
+ m_pDevice->StretchDIBits(m_pBitmap, m_Rect.left, m_Rect.top, m_Rect.Width(), m_Rect.Height());
+ }
+ } else {
+#if !defined(_FPDFAPI_MINI_) || defined(_FXCORE_FEATURE_ALL_)
+ CFX_DIBitmap buffer;
+ m_pDevice->CreateCompatibleBitmap(&buffer, m_pBitmap->GetWidth(), m_pBitmap->GetHeight());
+ m_pContext->GetBackground(&buffer, m_pObject, NULL, &m_Matrix);
+ buffer.CompositeBitmap(0, 0, buffer.GetWidth(), buffer.GetHeight(), m_pBitmap, 0, 0);
+ m_pDevice->StretchDIBits(&buffer, m_Rect.left, m_Rect.top, m_Rect.Width(), m_Rect.Height());
+#endif
+ }
+}
+CPDF_ScaledRenderBuffer::CPDF_ScaledRenderBuffer()
+{
+ m_pBitmapDevice = NULL;
+}
+CPDF_ScaledRenderBuffer::~CPDF_ScaledRenderBuffer()
+{
+ if (m_pBitmapDevice) {
+ delete m_pBitmapDevice;
+ }
+}
+#ifndef _FPDFAPI_MINI_
+#define _FPDFAPI_IMAGESIZE_LIMIT_ (30 * 1024 * 1024)
+#else
+#define _FPDFAPI_IMAGESIZE_LIMIT_ (10 * 1024 * 1024)
+#endif
+FX_BOOL CPDF_ScaledRenderBuffer::Initialize(CPDF_RenderContext* pContext, CFX_RenderDevice* pDevice, FX_RECT* pRect,
+ const CPDF_PageObject* pObj, const CPDF_RenderOptions *pOptions, int max_dpi)
+{
+ FXSYS_assert(pRect != NULL);
+ m_pDevice = pDevice;
+ if (m_pDevice->GetDeviceCaps(FXDC_RENDER_CAPS) & FXRC_GET_BITS) {
+ return TRUE;
+ }
+ m_pContext = pContext;
+ m_Rect = *pRect;
+ m_pObject = pObj;
+ m_Matrix.TranslateI(-pRect->left, -pRect->top);
+ int horz_size = pDevice->GetDeviceCaps(FXDC_HORZ_SIZE);
+ int vert_size = pDevice->GetDeviceCaps(FXDC_VERT_SIZE);
+ if (horz_size && vert_size && max_dpi) {
+ int dpih = pDevice->GetDeviceCaps(FXDC_PIXEL_WIDTH) * 254 / (horz_size * 10);
+ int dpiv = pDevice->GetDeviceCaps(FXDC_PIXEL_HEIGHT) * 254 / (vert_size * 10);
+ if (dpih > max_dpi) {
+ m_Matrix.Scale((FX_FLOAT)(max_dpi) / dpih, 1.0f);
+ }
+ if (dpiv > max_dpi) {
+ m_Matrix.Scale(1.0f, (FX_FLOAT)(max_dpi) / (FX_FLOAT)dpiv);
+ }
+ }
+ m_pBitmapDevice = FX_NEW CFX_FxgeDevice;
+ FXDIB_Format dibFormat = FXDIB_Rgb;
+ FX_INT32 bpp = 24;
+ if (m_pDevice->GetDeviceCaps(FXDC_RENDER_CAPS) & FXRC_ALPHA_OUTPUT) {
+ dibFormat = FXDIB_Argb;
+ bpp = 32;
+ }
+ CFX_FloatRect rect;
+ FX_INT32 iWidth, iHeight, iPitch;
+ while (1) {
+ rect = *pRect;
+ m_Matrix.TransformRect(rect);
+ FX_RECT bitmap_rect = rect.GetOutterRect();
+ iWidth = bitmap_rect.Width();
+ iHeight = bitmap_rect.Height();
+ iPitch = (iWidth * bpp + 31) / 32 * 4;
+ if (iWidth * iHeight < 1) {
+ return FALSE;
+ }
+ if (iPitch * iHeight <= _FPDFAPI_IMAGESIZE_LIMIT_ &&
+ m_pBitmapDevice->Create(iWidth, iHeight, dibFormat)) {
+ break;
+ }
+ m_Matrix.Scale(0.5f, 0.5f);
+ }
+#if !defined(_FPDFAPI_MINI_) || defined(_FXCORE_FEATURE_ALL_)
+ m_pContext->GetBackground(m_pBitmapDevice->GetBitmap(), m_pObject, pOptions, &m_Matrix);
+#endif
+ return TRUE;
+}
+void CPDF_ScaledRenderBuffer::OutputToDevice()
+{
+ if (m_pBitmapDevice) {
+ m_pDevice->StretchDIBits(m_pBitmapDevice->GetBitmap(), m_Rect.left, m_Rect.top, m_Rect.Width(), m_Rect.Height());
+ }
+}
+FX_BOOL IPDF_OCContext::CheckObjectVisible(const CPDF_PageObject* pObj)
+{
+ const CPDF_ContentMarkData* pData = pObj->m_ContentMark;
+ int nItems = pData->CountItems();
+ for (int i = 0; i < nItems; i ++) {
+ CPDF_ContentMarkItem& item = pData->GetItem(i);
+ if (item.GetName() == FX_BSTRC("OC") && item.GetParamType() == CPDF_ContentMarkItem::PropertiesDict) {
+ CPDF_Dictionary* pOCG = (CPDF_Dictionary*)item.GetParam();
+ if (!CheckOCGVisible(pOCG)) {
+ return FALSE;
+ }
+ }
+ }
+ return TRUE;
+}
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_cache.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_cache.cpp
index c5be3391b8..eb08bca8a7 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render_cache.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render_cache.cpp
@@ -1,389 +1,389 @@
-// 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
-
-#include "../../../include/fpdfapi/fpdf_render.h"
-#include "../../../include/fpdfapi/fpdf_pageobj.h"
-#include "../../../include/fxge/fx_ge.h"
-#include "../fpdf_page/pageint.h"
-#include "render_int.h"
-struct CACHEINFO {
- FX_DWORD time;
- CPDF_Stream* pStream;
-};
-extern "C" {
- static int compare(const void* data1, const void* data2)
- {
- return ((CACHEINFO*)data1)->time - ((CACHEINFO*)data2)->time;
- }
-};
-void CPDF_Page::ClearRenderCache()
-{
- if (m_pPageRender) {
- m_pPageRender->ClearAll();
- }
-}
-void CPDF_PageRenderCache::ClearAll()
-{
- FX_POSITION pos = m_ImageCaches.GetStartPosition();
- while (pos) {
- FX_LPVOID key, value;
- m_ImageCaches.GetNextAssoc(pos, key, value);
- delete (CPDF_ImageCache*)value;
- }
- m_ImageCaches.RemoveAll();
- m_nCacheSize = 0;
- m_nTimeCount = 0;
-}
-void CPDF_PageRenderCache::CacheOptimization(FX_INT32 dwLimitCacheSize)
-{
- if (m_nCacheSize <= (FX_DWORD)dwLimitCacheSize) {
- return;
- }
- int nCount = m_ImageCaches.GetCount();
- CACHEINFO* pCACHEINFO = (CACHEINFO*)FX_Alloc(FX_BYTE, (sizeof (CACHEINFO)) * nCount);
- FX_POSITION pos = m_ImageCaches.GetStartPosition();
- int i = 0;
- while (pos) {
- FX_LPVOID key, value;
- m_ImageCaches.GetNextAssoc(pos, key, value);
- pCACHEINFO[i].time = ((CPDF_ImageCache*)value)->GetTimeCount();
- pCACHEINFO[i++].pStream = ((CPDF_ImageCache*)value)->GetStream();
- }
- FXSYS_qsort(pCACHEINFO, nCount, sizeof (CACHEINFO), compare);
- FX_DWORD nTimeCount = m_nTimeCount;
- if (nTimeCount + 1 < nTimeCount) {
- for (i = 0; i < nCount; i ++) {
- ((CPDF_ImageCache*)(m_ImageCaches[pCACHEINFO[i].pStream]))->m_dwTimeCount = i;
- }
- m_nTimeCount = nCount;
- }
- i = 0;
- while(nCount > 15) {
- ClearImageCache(pCACHEINFO[i++].pStream);
- nCount--;
- }
- while (m_nCacheSize > (FX_DWORD)dwLimitCacheSize) {
- ClearImageCache(pCACHEINFO[i++].pStream);
- }
- FX_Free(pCACHEINFO);
-}
-void CPDF_PageRenderCache::ClearImageCache(CPDF_Stream* pStream)
-{
- FX_LPVOID value = m_ImageCaches.GetValueAt(pStream);
- if (value == NULL) {
- m_ImageCaches.RemoveKey(pStream);
- return;
- }
- m_nCacheSize -= ((CPDF_ImageCache*)value)->EstimateSize();
- delete (CPDF_ImageCache*)value;
- m_ImageCaches.RemoveKey(pStream);
-}
-FX_DWORD CPDF_PageRenderCache::EstimateSize()
-{
- FX_DWORD dwSize = 0;
- FX_POSITION pos = m_ImageCaches.GetStartPosition();
- while (pos) {
- FX_LPVOID key, value;
- m_ImageCaches.GetNextAssoc(pos, key, value);
- dwSize += ((CPDF_ImageCache*)value)->EstimateSize();
- }
- m_nCacheSize = dwSize;
- return dwSize;
-}
-FX_DWORD CPDF_PageRenderCache::GetCachedSize(CPDF_Stream* pStream) const
-{
- if (pStream == NULL) {
- return m_nCacheSize;
- }
- CPDF_ImageCache* pImageCache;
- if (!m_ImageCaches.Lookup(pStream, (FX_LPVOID&)pImageCache)) {
- return 0;
- }
- return pImageCache->EstimateSize();
-}
-void CPDF_PageRenderCache::GetCachedBitmap(CPDF_Stream* pStream, CFX_DIBSource*& pBitmap, CFX_DIBSource*& pMask, FX_DWORD& MatteColor,
- FX_BOOL bStdCS, FX_DWORD GroupFamily, FX_BOOL bLoadMask, CPDF_RenderStatus* pRenderStatus,
- FX_INT32 downsampleWidth, FX_INT32 downsampleHeight)
-{
- CPDF_ImageCache* pImageCache;
- FX_BOOL bFind = m_ImageCaches.Lookup(pStream, (FX_LPVOID&)pImageCache);
- if (!bFind) {
- pImageCache = FX_NEW CPDF_ImageCache(m_pPage->m_pDocument, pStream);
- }
- m_nTimeCount ++;
- FX_BOOL bCached = pImageCache->GetCachedBitmap(pBitmap, pMask, MatteColor, m_pPage->m_pPageResources, bStdCS, GroupFamily, bLoadMask, pRenderStatus, downsampleWidth, downsampleHeight);
- if (!bFind) {
- m_ImageCaches.SetAt(pStream, pImageCache);
- }
- if (!bCached) {
- m_nCacheSize += pImageCache->EstimateSize();
- }
-}
-FX_BOOL CPDF_PageRenderCache::StartGetCachedBitmap(CPDF_Stream* pStream, FX_BOOL bStdCS, FX_DWORD GroupFamily, FX_BOOL bLoadMask, CPDF_RenderStatus* pRenderStatus, FX_INT32 downsampleWidth, FX_INT32 downsampleHeight)
-{
- m_bCurFindCache = m_ImageCaches.Lookup(pStream, (FX_LPVOID&)m_pCurImageCache);
- if (!m_bCurFindCache) {
- m_pCurImageCache = FX_NEW CPDF_ImageCache(m_pPage->m_pDocument, pStream);
- }
- int ret = m_pCurImageCache->StartGetCachedBitmap(pRenderStatus->m_pFormResource, m_pPage->m_pPageResources, bStdCS, GroupFamily, bLoadMask, pRenderStatus, downsampleWidth, downsampleHeight);
- if (ret == 2) {
- return TRUE;
- }
- m_nTimeCount ++;
- if (!m_bCurFindCache) {
- m_ImageCaches.SetAt(pStream, m_pCurImageCache);
- }
- if (!ret) {
- m_nCacheSize += m_pCurImageCache->EstimateSize();
- }
- return FALSE;
-}
-FX_BOOL CPDF_PageRenderCache::Continue(IFX_Pause* pPause)
-{
- int ret = m_pCurImageCache->Continue(pPause);
- if (ret == 2) {
- return TRUE;
- }
- m_nTimeCount ++;
- if (!m_bCurFindCache) {
- m_ImageCaches.SetAt(m_pCurImageCache->GetStream(), m_pCurImageCache);
- }
- if (!ret) {
- m_nCacheSize += m_pCurImageCache->EstimateSize();
- }
- return FALSE;
-}
-void CPDF_PageRenderCache::ResetBitmap(CPDF_Stream* pStream, const CFX_DIBitmap* pBitmap)
-{
- CPDF_ImageCache* pImageCache;
- if (!m_ImageCaches.Lookup(pStream, (FX_LPVOID&)pImageCache)) {
- if (pBitmap == NULL) {
- return;
- }
- pImageCache = FX_NEW CPDF_ImageCache(m_pPage->m_pDocument, pStream);
- m_ImageCaches.SetAt(pStream, pImageCache);
- }
- int oldsize = pImageCache->EstimateSize();
- pImageCache->Reset(pBitmap);
- m_nCacheSize = pImageCache->EstimateSize() - oldsize;
-}
-CPDF_ImageCache::CPDF_ImageCache(CPDF_Document* pDoc, CPDF_Stream* pStream)
- : m_pDocument(pDoc)
- , m_pStream(pStream)
- , m_pCachedBitmap(NULL)
- , m_pCachedMask(NULL)
- , m_dwCacheSize(0)
- , m_dwTimeCount(0)
- , m_pCurBitmap(NULL)
- , m_pCurMask(NULL)
- , m_MatteColor(0)
- , m_pRenderStatus(NULL)
-{
-}
-CPDF_ImageCache::~CPDF_ImageCache()
-{
- if (m_pCachedBitmap) {
- delete m_pCachedBitmap;
- m_pCachedBitmap = NULL;
- }
- if (m_pCachedMask) {
- delete m_pCachedMask;
- m_pCachedMask = NULL;
- }
-}
-void CPDF_ImageCache::Reset(const CFX_DIBitmap* pBitmap)
-{
- if (m_pCachedBitmap) {
- delete m_pCachedBitmap;
- }
- m_pCachedBitmap = NULL;
- if (pBitmap) {
- m_pCachedBitmap = pBitmap->Clone();
- }
- CalcSize();
-}
-void CPDF_PageRenderCache::ClearImageData()
-{
- FX_POSITION pos = m_ImageCaches.GetStartPosition();
- while (pos) {
- FX_LPVOID key, value;
- m_ImageCaches.GetNextAssoc(pos, key, value);
- ((CPDF_ImageCache*)value)->ClearImageData();
- }
-}
-void CPDF_ImageCache::ClearImageData()
-{
- if (m_pCachedBitmap && m_pCachedBitmap->GetBuffer() == NULL) {
- ((CPDF_DIBSource*)m_pCachedBitmap)->ClearImageData();
- }
-}
-static FX_DWORD FPDF_ImageCache_EstimateImageSize(const CFX_DIBSource* pDIB)
-{
- return pDIB && pDIB->GetBuffer() ? (FX_DWORD)pDIB->GetHeight() * pDIB->GetPitch() + (FX_DWORD)pDIB->GetPaletteSize() * 4 : 0;
-}
-FX_BOOL CPDF_ImageCache::GetCachedBitmap(CFX_DIBSource*& pBitmap, CFX_DIBSource*& pMask, FX_DWORD& MatteColor, CPDF_Dictionary* pPageResources,
- FX_BOOL bStdCS, FX_DWORD GroupFamily, FX_BOOL bLoadMask, CPDF_RenderStatus* pRenderStatus,
- FX_INT32 downsampleWidth, FX_INT32 downsampleHeight)
-{
- if (m_pCachedBitmap) {
- pBitmap = m_pCachedBitmap;
- pMask = m_pCachedMask;
- MatteColor = m_MatteColor;
- return TRUE;
- }
- if (!pRenderStatus) {
- return FALSE;
- }
- CPDF_RenderContext*pContext = pRenderStatus->GetContext();
- CPDF_PageRenderCache* pPageRenderCache = pContext->m_pPageCache;
- m_dwTimeCount = pPageRenderCache->GetTimeCount();
- CPDF_DIBSource* pSrc = FX_NEW CPDF_DIBSource;
- CPDF_DIBSource* pMaskSrc = NULL;
- if (!pSrc->Load(m_pDocument, m_pStream, &pMaskSrc, &MatteColor, pRenderStatus->m_pFormResource, pPageResources, bStdCS, GroupFamily, bLoadMask)) {
- delete pSrc;
- pBitmap = NULL;
- return FALSE;
- }
- m_MatteColor = MatteColor;
-#if !defined(_FPDFAPI_MINI_)
- if (pSrc->GetPitch() * pSrc->GetHeight() < FPDF_HUGE_IMAGE_SIZE) {
- m_pCachedBitmap = pSrc->Clone();
- delete pSrc;
- } else {
- m_pCachedBitmap = pSrc;
- }
- if (pMaskSrc) {
- m_pCachedMask = pMaskSrc->Clone();
- delete pMaskSrc;
- }
-#else
- if (pSrc->GetFormat() == FXDIB_8bppRgb && pSrc->GetPalette() &&
- pSrc->GetHeight() * pSrc->GetWidth() * 3 < 1024) {
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
- m_pCachedBitmap = pSrc->CloneConvert(FXDIB_Rgb32);
-#else
- m_pCachedBitmap = pSrc->CloneConvert(FXDIB_Rgb);
-#endif
- delete pSrc;
- } else if (pSrc->GetPitch() * pSrc->GetHeight() < 102400) {
- m_pCachedBitmap = pSrc->Clone();
- delete pSrc;
- } else {
- m_pCachedBitmap = pSrc;
- }
- m_pCachedMask = pMaskSrc;
-#endif
- pBitmap = m_pCachedBitmap;
- pMask = m_pCachedMask;
- CalcSize();
- return FALSE;
-}
-CFX_DIBSource* CPDF_ImageCache::DetachBitmap()
-{
- CFX_DIBSource* pDIBSource = m_pCurBitmap;
- m_pCurBitmap = NULL;
- return pDIBSource;
-}
-CFX_DIBSource* CPDF_ImageCache::DetachMask()
-{
- CFX_DIBSource* pDIBSource = m_pCurMask;
- m_pCurMask = NULL;
- return pDIBSource;
-}
-int CPDF_ImageCache::StartGetCachedBitmap(CPDF_Dictionary* pFormResources, CPDF_Dictionary* pPageResources, FX_BOOL bStdCS,
- FX_DWORD GroupFamily, FX_BOOL bLoadMask, CPDF_RenderStatus* pRenderStatus,
- FX_INT32 downsampleWidth, FX_INT32 downsampleHeight)
-{
- if (m_pCachedBitmap) {
- m_pCurBitmap = m_pCachedBitmap;
- m_pCurMask = m_pCachedMask;
- return 1;
- }
- if (!pRenderStatus) {
- return 0;
- }
- m_pRenderStatus = pRenderStatus;
- m_pCurBitmap = FX_NEW CPDF_DIBSource;
- int ret = ((CPDF_DIBSource*)m_pCurBitmap)->StartLoadDIBSource(m_pDocument, m_pStream, TRUE, pFormResources, pPageResources, bStdCS, GroupFamily, bLoadMask);
- if (ret == 2) {
- return ret;
- }
- if (!ret) {
- delete m_pCurBitmap;
- m_pCurBitmap = NULL;
- return 0;
- }
- ContinueGetCachedBitmap();
- return 0;
-}
-int CPDF_ImageCache::ContinueGetCachedBitmap()
-{
- m_MatteColor = ((CPDF_DIBSource*)m_pCurBitmap)->m_MatteColor;
- m_pCurMask = ((CPDF_DIBSource*)m_pCurBitmap)->DetachMask();
- CPDF_RenderContext*pContext = m_pRenderStatus->GetContext();
- CPDF_PageRenderCache* pPageRenderCache = pContext->m_pPageCache;
- m_dwTimeCount = pPageRenderCache->GetTimeCount();
-#if !defined(_FPDFAPI_MINI_)
- if (m_pCurBitmap->GetPitch() * m_pCurBitmap->GetHeight() < FPDF_HUGE_IMAGE_SIZE) {
- m_pCachedBitmap = m_pCurBitmap->Clone();
- delete m_pCurBitmap;
- m_pCurBitmap = NULL;
- } else {
- m_pCachedBitmap = m_pCurBitmap;
- }
- if (m_pCurMask) {
- m_pCachedMask = m_pCurMask->Clone();
- delete m_pCurMask;
- m_pCurMask = NULL;
- }
-#else
- if (m_pCurBitmap->GetFormat() == FXDIB_8bppRgb && m_pCurBitmap->GetPalette() &&
- m_pCurBitmap->GetHeight() * m_pCurBitmap->GetWidth() * 3 < 1024) {
- m_pCachedBitmap = m_pCurBitmap->CloneConvert(FXDIB_Rgb32);
- m_pCachedBitmap = m_pCurBitmap->CloneConvert(FXDIB_Rgb);
- delete m_pCurBitmap;
- m_pCurBitmap = NULL;
- } else if (m_pCurBitmap->GetPitch() * m_pCurBitmap->GetHeight() < 102400) {
- m_pCachedBitmap = m_pCurBitmap->Clone();
- delete m_pCurBitmap;
- m_pCurBitmap = NULL;
- } else {
- m_pCachedBitmap = m_pCurBitmap;
- }
- m_pCachedMask = m_pCurMask;
-#endif
- m_pCurBitmap = m_pCachedBitmap;
- m_pCurMask = m_pCachedMask;
- CalcSize();
- return 0;
-}
-int CPDF_ImageCache::Continue(IFX_Pause* pPause)
-{
- int ret = ((CPDF_DIBSource*)m_pCurBitmap)->ContinueLoadDIBSource(pPause);
- if (ret == 2) {
- return ret;
- }
- if (!ret) {
- delete m_pCurBitmap;
- m_pCurBitmap = NULL;
- return 0;
- }
- ContinueGetCachedBitmap();
- return 0;
-}
-void CPDF_ImageCache::CalcSize()
-{
- m_dwCacheSize = FPDF_ImageCache_EstimateImageSize(m_pCachedBitmap) + FPDF_ImageCache_EstimateImageSize(m_pCachedMask);
-}
-void CPDF_Document::ClearRenderFont()
-{
- if (m_pDocRender) {
- CFX_FontCache* pCache = m_pDocRender->GetFontCache();
- if (pCache) {
- pCache->FreeCache(FALSE);
- }
- }
-}
+// 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
+
+#include "../../../include/fpdfapi/fpdf_render.h"
+#include "../../../include/fpdfapi/fpdf_pageobj.h"
+#include "../../../include/fxge/fx_ge.h"
+#include "../fpdf_page/pageint.h"
+#include "render_int.h"
+struct CACHEINFO {
+ FX_DWORD time;
+ CPDF_Stream* pStream;
+};
+extern "C" {
+ static int compare(const void* data1, const void* data2)
+ {
+ return ((CACHEINFO*)data1)->time - ((CACHEINFO*)data2)->time;
+ }
+};
+void CPDF_Page::ClearRenderCache()
+{
+ if (m_pPageRender) {
+ m_pPageRender->ClearAll();
+ }
+}
+void CPDF_PageRenderCache::ClearAll()
+{
+ FX_POSITION pos = m_ImageCaches.GetStartPosition();
+ while (pos) {
+ FX_LPVOID key, value;
+ m_ImageCaches.GetNextAssoc(pos, key, value);
+ delete (CPDF_ImageCache*)value;
+ }
+ m_ImageCaches.RemoveAll();
+ m_nCacheSize = 0;
+ m_nTimeCount = 0;
+}
+void CPDF_PageRenderCache::CacheOptimization(FX_INT32 dwLimitCacheSize)
+{
+ if (m_nCacheSize <= (FX_DWORD)dwLimitCacheSize) {
+ return;
+ }
+ int nCount = m_ImageCaches.GetCount();
+ CACHEINFO* pCACHEINFO = (CACHEINFO*)FX_Alloc(FX_BYTE, (sizeof (CACHEINFO)) * nCount);
+ FX_POSITION pos = m_ImageCaches.GetStartPosition();
+ int i = 0;
+ while (pos) {
+ FX_LPVOID key, value;
+ m_ImageCaches.GetNextAssoc(pos, key, value);
+ pCACHEINFO[i].time = ((CPDF_ImageCache*)value)->GetTimeCount();
+ pCACHEINFO[i++].pStream = ((CPDF_ImageCache*)value)->GetStream();
+ }
+ FXSYS_qsort(pCACHEINFO, nCount, sizeof (CACHEINFO), compare);
+ FX_DWORD nTimeCount = m_nTimeCount;
+ if (nTimeCount + 1 < nTimeCount) {
+ for (i = 0; i < nCount; i ++) {
+ ((CPDF_ImageCache*)(m_ImageCaches[pCACHEINFO[i].pStream]))->m_dwTimeCount = i;
+ }
+ m_nTimeCount = nCount;
+ }
+ i = 0;
+ while(nCount > 15) {
+ ClearImageCache(pCACHEINFO[i++].pStream);
+ nCount--;
+ }
+ while (m_nCacheSize > (FX_DWORD)dwLimitCacheSize) {
+ ClearImageCache(pCACHEINFO[i++].pStream);
+ }
+ FX_Free(pCACHEINFO);
+}
+void CPDF_PageRenderCache::ClearImageCache(CPDF_Stream* pStream)
+{
+ FX_LPVOID value = m_ImageCaches.GetValueAt(pStream);
+ if (value == NULL) {
+ m_ImageCaches.RemoveKey(pStream);
+ return;
+ }
+ m_nCacheSize -= ((CPDF_ImageCache*)value)->EstimateSize();
+ delete (CPDF_ImageCache*)value;
+ m_ImageCaches.RemoveKey(pStream);
+}
+FX_DWORD CPDF_PageRenderCache::EstimateSize()
+{
+ FX_DWORD dwSize = 0;
+ FX_POSITION pos = m_ImageCaches.GetStartPosition();
+ while (pos) {
+ FX_LPVOID key, value;
+ m_ImageCaches.GetNextAssoc(pos, key, value);
+ dwSize += ((CPDF_ImageCache*)value)->EstimateSize();
+ }
+ m_nCacheSize = dwSize;
+ return dwSize;
+}
+FX_DWORD CPDF_PageRenderCache::GetCachedSize(CPDF_Stream* pStream) const
+{
+ if (pStream == NULL) {
+ return m_nCacheSize;
+ }
+ CPDF_ImageCache* pImageCache;
+ if (!m_ImageCaches.Lookup(pStream, (FX_LPVOID&)pImageCache)) {
+ return 0;
+ }
+ return pImageCache->EstimateSize();
+}
+void CPDF_PageRenderCache::GetCachedBitmap(CPDF_Stream* pStream, CFX_DIBSource*& pBitmap, CFX_DIBSource*& pMask, FX_DWORD& MatteColor,
+ FX_BOOL bStdCS, FX_DWORD GroupFamily, FX_BOOL bLoadMask, CPDF_RenderStatus* pRenderStatus,
+ FX_INT32 downsampleWidth, FX_INT32 downsampleHeight)
+{
+ CPDF_ImageCache* pImageCache;
+ FX_BOOL bFind = m_ImageCaches.Lookup(pStream, (FX_LPVOID&)pImageCache);
+ if (!bFind) {
+ pImageCache = FX_NEW CPDF_ImageCache(m_pPage->m_pDocument, pStream);
+ }
+ m_nTimeCount ++;
+ FX_BOOL bCached = pImageCache->GetCachedBitmap(pBitmap, pMask, MatteColor, m_pPage->m_pPageResources, bStdCS, GroupFamily, bLoadMask, pRenderStatus, downsampleWidth, downsampleHeight);
+ if (!bFind) {
+ m_ImageCaches.SetAt(pStream, pImageCache);
+ }
+ if (!bCached) {
+ m_nCacheSize += pImageCache->EstimateSize();
+ }
+}
+FX_BOOL CPDF_PageRenderCache::StartGetCachedBitmap(CPDF_Stream* pStream, FX_BOOL bStdCS, FX_DWORD GroupFamily, FX_BOOL bLoadMask, CPDF_RenderStatus* pRenderStatus, FX_INT32 downsampleWidth, FX_INT32 downsampleHeight)
+{
+ m_bCurFindCache = m_ImageCaches.Lookup(pStream, (FX_LPVOID&)m_pCurImageCache);
+ if (!m_bCurFindCache) {
+ m_pCurImageCache = FX_NEW CPDF_ImageCache(m_pPage->m_pDocument, pStream);
+ }
+ int ret = m_pCurImageCache->StartGetCachedBitmap(pRenderStatus->m_pFormResource, m_pPage->m_pPageResources, bStdCS, GroupFamily, bLoadMask, pRenderStatus, downsampleWidth, downsampleHeight);
+ if (ret == 2) {
+ return TRUE;
+ }
+ m_nTimeCount ++;
+ if (!m_bCurFindCache) {
+ m_ImageCaches.SetAt(pStream, m_pCurImageCache);
+ }
+ if (!ret) {
+ m_nCacheSize += m_pCurImageCache->EstimateSize();
+ }
+ return FALSE;
+}
+FX_BOOL CPDF_PageRenderCache::Continue(IFX_Pause* pPause)
+{
+ int ret = m_pCurImageCache->Continue(pPause);
+ if (ret == 2) {
+ return TRUE;
+ }
+ m_nTimeCount ++;
+ if (!m_bCurFindCache) {
+ m_ImageCaches.SetAt(m_pCurImageCache->GetStream(), m_pCurImageCache);
+ }
+ if (!ret) {
+ m_nCacheSize += m_pCurImageCache->EstimateSize();
+ }
+ return FALSE;
+}
+void CPDF_PageRenderCache::ResetBitmap(CPDF_Stream* pStream, const CFX_DIBitmap* pBitmap)
+{
+ CPDF_ImageCache* pImageCache;
+ if (!m_ImageCaches.Lookup(pStream, (FX_LPVOID&)pImageCache)) {
+ if (pBitmap == NULL) {
+ return;
+ }
+ pImageCache = FX_NEW CPDF_ImageCache(m_pPage->m_pDocument, pStream);
+ m_ImageCaches.SetAt(pStream, pImageCache);
+ }
+ int oldsize = pImageCache->EstimateSize();
+ pImageCache->Reset(pBitmap);
+ m_nCacheSize = pImageCache->EstimateSize() - oldsize;
+}
+CPDF_ImageCache::CPDF_ImageCache(CPDF_Document* pDoc, CPDF_Stream* pStream)
+ : m_pDocument(pDoc)
+ , m_pStream(pStream)
+ , m_pCachedBitmap(NULL)
+ , m_pCachedMask(NULL)
+ , m_dwCacheSize(0)
+ , m_dwTimeCount(0)
+ , m_pCurBitmap(NULL)
+ , m_pCurMask(NULL)
+ , m_MatteColor(0)
+ , m_pRenderStatus(NULL)
+{
+}
+CPDF_ImageCache::~CPDF_ImageCache()
+{
+ if (m_pCachedBitmap) {
+ delete m_pCachedBitmap;
+ m_pCachedBitmap = NULL;
+ }
+ if (m_pCachedMask) {
+ delete m_pCachedMask;
+ m_pCachedMask = NULL;
+ }
+}
+void CPDF_ImageCache::Reset(const CFX_DIBitmap* pBitmap)
+{
+ if (m_pCachedBitmap) {
+ delete m_pCachedBitmap;
+ }
+ m_pCachedBitmap = NULL;
+ if (pBitmap) {
+ m_pCachedBitmap = pBitmap->Clone();
+ }
+ CalcSize();
+}
+void CPDF_PageRenderCache::ClearImageData()
+{
+ FX_POSITION pos = m_ImageCaches.GetStartPosition();
+ while (pos) {
+ FX_LPVOID key, value;
+ m_ImageCaches.GetNextAssoc(pos, key, value);
+ ((CPDF_ImageCache*)value)->ClearImageData();
+ }
+}
+void CPDF_ImageCache::ClearImageData()
+{
+ if (m_pCachedBitmap && m_pCachedBitmap->GetBuffer() == NULL) {
+ ((CPDF_DIBSource*)m_pCachedBitmap)->ClearImageData();
+ }
+}
+static FX_DWORD FPDF_ImageCache_EstimateImageSize(const CFX_DIBSource* pDIB)
+{
+ return pDIB && pDIB->GetBuffer() ? (FX_DWORD)pDIB->GetHeight() * pDIB->GetPitch() + (FX_DWORD)pDIB->GetPaletteSize() * 4 : 0;
+}
+FX_BOOL CPDF_ImageCache::GetCachedBitmap(CFX_DIBSource*& pBitmap, CFX_DIBSource*& pMask, FX_DWORD& MatteColor, CPDF_Dictionary* pPageResources,
+ FX_BOOL bStdCS, FX_DWORD GroupFamily, FX_BOOL bLoadMask, CPDF_RenderStatus* pRenderStatus,
+ FX_INT32 downsampleWidth, FX_INT32 downsampleHeight)
+{
+ if (m_pCachedBitmap) {
+ pBitmap = m_pCachedBitmap;
+ pMask = m_pCachedMask;
+ MatteColor = m_MatteColor;
+ return TRUE;
+ }
+ if (!pRenderStatus) {
+ return FALSE;
+ }
+ CPDF_RenderContext*pContext = pRenderStatus->GetContext();
+ CPDF_PageRenderCache* pPageRenderCache = pContext->m_pPageCache;
+ m_dwTimeCount = pPageRenderCache->GetTimeCount();
+ CPDF_DIBSource* pSrc = FX_NEW CPDF_DIBSource;
+ CPDF_DIBSource* pMaskSrc = NULL;
+ if (!pSrc->Load(m_pDocument, m_pStream, &pMaskSrc, &MatteColor, pRenderStatus->m_pFormResource, pPageResources, bStdCS, GroupFamily, bLoadMask)) {
+ delete pSrc;
+ pBitmap = NULL;
+ return FALSE;
+ }
+ m_MatteColor = MatteColor;
+#if !defined(_FPDFAPI_MINI_)
+ if (pSrc->GetPitch() * pSrc->GetHeight() < FPDF_HUGE_IMAGE_SIZE) {
+ m_pCachedBitmap = pSrc->Clone();
+ delete pSrc;
+ } else {
+ m_pCachedBitmap = pSrc;
+ }
+ if (pMaskSrc) {
+ m_pCachedMask = pMaskSrc->Clone();
+ delete pMaskSrc;
+ }
+#else
+ if (pSrc->GetFormat() == FXDIB_8bppRgb && pSrc->GetPalette() &&
+ pSrc->GetHeight() * pSrc->GetWidth() * 3 < 1024) {
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
+ m_pCachedBitmap = pSrc->CloneConvert(FXDIB_Rgb32);
+#else
+ m_pCachedBitmap = pSrc->CloneConvert(FXDIB_Rgb);
+#endif
+ delete pSrc;
+ } else if (pSrc->GetPitch() * pSrc->GetHeight() < 102400) {
+ m_pCachedBitmap = pSrc->Clone();
+ delete pSrc;
+ } else {
+ m_pCachedBitmap = pSrc;
+ }
+ m_pCachedMask = pMaskSrc;
+#endif
+ pBitmap = m_pCachedBitmap;
+ pMask = m_pCachedMask;
+ CalcSize();
+ return FALSE;
+}
+CFX_DIBSource* CPDF_ImageCache::DetachBitmap()
+{
+ CFX_DIBSource* pDIBSource = m_pCurBitmap;
+ m_pCurBitmap = NULL;
+ return pDIBSource;
+}
+CFX_DIBSource* CPDF_ImageCache::DetachMask()
+{
+ CFX_DIBSource* pDIBSource = m_pCurMask;
+ m_pCurMask = NULL;
+ return pDIBSource;
+}
+int CPDF_ImageCache::StartGetCachedBitmap(CPDF_Dictionary* pFormResources, CPDF_Dictionary* pPageResources, FX_BOOL bStdCS,
+ FX_DWORD GroupFamily, FX_BOOL bLoadMask, CPDF_RenderStatus* pRenderStatus,
+ FX_INT32 downsampleWidth, FX_INT32 downsampleHeight)
+{
+ if (m_pCachedBitmap) {
+ m_pCurBitmap = m_pCachedBitmap;
+ m_pCurMask = m_pCachedMask;
+ return 1;
+ }
+ if (!pRenderStatus) {
+ return 0;
+ }
+ m_pRenderStatus = pRenderStatus;
+ m_pCurBitmap = FX_NEW CPDF_DIBSource;
+ int ret = ((CPDF_DIBSource*)m_pCurBitmap)->StartLoadDIBSource(m_pDocument, m_pStream, TRUE, pFormResources, pPageResources, bStdCS, GroupFamily, bLoadMask);
+ if (ret == 2) {
+ return ret;
+ }
+ if (!ret) {
+ delete m_pCurBitmap;
+ m_pCurBitmap = NULL;
+ return 0;
+ }
+ ContinueGetCachedBitmap();
+ return 0;
+}
+int CPDF_ImageCache::ContinueGetCachedBitmap()
+{
+ m_MatteColor = ((CPDF_DIBSource*)m_pCurBitmap)->m_MatteColor;
+ m_pCurMask = ((CPDF_DIBSource*)m_pCurBitmap)->DetachMask();
+ CPDF_RenderContext*pContext = m_pRenderStatus->GetContext();
+ CPDF_PageRenderCache* pPageRenderCache = pContext->m_pPageCache;
+ m_dwTimeCount = pPageRenderCache->GetTimeCount();
+#if !defined(_FPDFAPI_MINI_)
+ if (m_pCurBitmap->GetPitch() * m_pCurBitmap->GetHeight() < FPDF_HUGE_IMAGE_SIZE) {
+ m_pCachedBitmap = m_pCurBitmap->Clone();
+ delete m_pCurBitmap;
+ m_pCurBitmap = NULL;
+ } else {
+ m_pCachedBitmap = m_pCurBitmap;
+ }
+ if (m_pCurMask) {
+ m_pCachedMask = m_pCurMask->Clone();
+ delete m_pCurMask;
+ m_pCurMask = NULL;
+ }
+#else
+ if (m_pCurBitmap->GetFormat() == FXDIB_8bppRgb && m_pCurBitmap->GetPalette() &&
+ m_pCurBitmap->GetHeight() * m_pCurBitmap->GetWidth() * 3 < 1024) {
+ m_pCachedBitmap = m_pCurBitmap->CloneConvert(FXDIB_Rgb32);
+ m_pCachedBitmap = m_pCurBitmap->CloneConvert(FXDIB_Rgb);
+ delete m_pCurBitmap;
+ m_pCurBitmap = NULL;
+ } else if (m_pCurBitmap->GetPitch() * m_pCurBitmap->GetHeight() < 102400) {
+ m_pCachedBitmap = m_pCurBitmap->Clone();
+ delete m_pCurBitmap;
+ m_pCurBitmap = NULL;
+ } else {
+ m_pCachedBitmap = m_pCurBitmap;
+ }
+ m_pCachedMask = m_pCurMask;
+#endif
+ m_pCurBitmap = m_pCachedBitmap;
+ m_pCurMask = m_pCachedMask;
+ CalcSize();
+ return 0;
+}
+int CPDF_ImageCache::Continue(IFX_Pause* pPause)
+{
+ int ret = ((CPDF_DIBSource*)m_pCurBitmap)->ContinueLoadDIBSource(pPause);
+ if (ret == 2) {
+ return ret;
+ }
+ if (!ret) {
+ delete m_pCurBitmap;
+ m_pCurBitmap = NULL;
+ return 0;
+ }
+ ContinueGetCachedBitmap();
+ return 0;
+}
+void CPDF_ImageCache::CalcSize()
+{
+ m_dwCacheSize = FPDF_ImageCache_EstimateImageSize(m_pCachedBitmap) + FPDF_ImageCache_EstimateImageSize(m_pCachedMask);
+}
+void CPDF_Document::ClearRenderFont()
+{
+ if (m_pDocRender) {
+ CFX_FontCache* pCache = m_pDocRender->GetFontCache();
+ if (pCache) {
+ pCache->FreeCache(FALSE);
+ }
+ }
+}
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp
index c2a7393739..39241e10f4 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp
@@ -1,1165 +1,1165 @@
-// 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
-
-#include "../../../include/fxge/fx_ge.h"
-#include "../../../include/fxcodec/fx_codec.h"
-#include "../../../include/fpdfapi/fpdf_module.h"
-#include "../../../include/fpdfapi/fpdf_render.h"
-#include "../../../include/fpdfapi/fpdf_pageobj.h"
-#include "../fpdf_page/pageint.h"
-#include "render_int.h"
-FX_BOOL CPDF_RenderStatus::ProcessImage(CPDF_ImageObject* pImageObj, const CFX_AffineMatrix* pObj2Device)
-{
- CPDF_ImageRenderer render;
- if (render.Start(this, pImageObj, pObj2Device, m_bStdCS, m_curBlend)) {
- render.Continue(NULL);
- }
-#ifdef _FPDFAPI_MINI_
- if (m_DitherBits) {
- DitherObjectArea(pImageObj, pObj2Device);
- }
-#endif
- return render.m_Result;
-}
-#if defined(_FPDFAPI_MINI_)
-FX_BOOL CPDF_RenderStatus::ProcessInlines(CPDF_InlineImages* pInlines, const CFX_AffineMatrix* pObj2Device)
-{
- int bitmap_alpha = 255;
- if (!pInlines->m_GeneralState.IsNull()) {
- bitmap_alpha = FXSYS_round(pInlines->m_GeneralState.GetObject()->m_FillAlpha * 255);
- }
- if (pInlines->m_pStream) {
- CPDF_DIBSource dibsrc;
- if (!dibsrc.Load(m_pContext->m_pDocument, pInlines->m_pStream, NULL, NULL, NULL, NULL)) {
- return TRUE;
- }
- pInlines->m_pBitmap = dibsrc.Clone();
- pInlines->m_pStream->Release();
- pInlines->m_pStream = NULL;
- }
- if (pInlines->m_pBitmap == NULL) {
- return TRUE;
- }
- FX_ARGB fill_argb = 0;
- if (pInlines->m_pBitmap->IsAlphaMask()) {
- fill_argb = GetFillArgb(pInlines);
- }
- int flags = 0;
- if (m_Options.m_Flags & RENDER_FORCE_DOWNSAMPLE) {
- flags |= RENDER_FORCE_DOWNSAMPLE;
- } else if (m_Options.m_Flags & RENDER_FORCE_HALFTONE) {
- flags = 0;
- }
- for (int i = 0; i < pInlines->m_Matrices.GetSize(); i ++) {
- CFX_AffineMatrix image_matrix = pInlines->m_Matrices.GetAt(i);
- image_matrix.Concat(*pObj2Device);
- CPDF_ImageRenderer renderer;
- if (renderer.Start(this, pInlines->m_pBitmap, fill_argb, bitmap_alpha, &image_matrix, flags, FALSE, m_curBlend)) {
- renderer.Continue(NULL);
- }
- }
- return TRUE;
-}
-#endif
-void CPDF_RenderStatus::CompositeDIBitmap(CFX_DIBitmap* pDIBitmap, int left, int top, FX_ARGB mask_argb,
- int bitmap_alpha, int blend_mode, int Transparency)
-{
- if (pDIBitmap == NULL) {
- return;
- }
- FX_BOOL bIsolated = Transparency & PDFTRANS_ISOLATED;
- FX_BOOL bGroup = Transparency & PDFTRANS_GROUP;
- if (blend_mode == FXDIB_BLEND_NORMAL) {
- if (!pDIBitmap->IsAlphaMask()) {
- if (bitmap_alpha < 255) {
- pDIBitmap->MultiplyAlpha(bitmap_alpha);
- }
- if (m_pDevice->SetDIBits(pDIBitmap, left, top)) {
- return;
- }
- } else {
- FX_DWORD fill_argb = m_Options.TranslateColor(mask_argb);
- if (bitmap_alpha < 255) {
- ((FX_BYTE*)&fill_argb)[3] = ((FX_BYTE*)&fill_argb)[3] * bitmap_alpha / 255;
- }
- if (m_pDevice->SetBitMask(pDIBitmap, left, top, fill_argb)) {
- return;
- }
- }
- }
- FX_BOOL bBackAlphaRequired = blend_mode && bIsolated && !m_bDropObjects;
- FX_BOOL bGetBackGround = ((m_pDevice->GetRenderCaps() & FXRC_ALPHA_OUTPUT)) ||
- (!(m_pDevice->GetRenderCaps() & FXRC_ALPHA_OUTPUT) && (m_pDevice->GetRenderCaps()
- & FXRC_GET_BITS) && !bBackAlphaRequired);
- if (bGetBackGround) {
- if (bIsolated || !bGroup) {
- if (pDIBitmap->IsAlphaMask()) {
- return;
- }
- m_pDevice->SetDIBits(pDIBitmap, left, top, blend_mode);
- } else {
- FX_RECT rect(left, top, left + pDIBitmap->GetWidth(), top + pDIBitmap->GetHeight());
- rect.Intersect(m_pDevice->GetClipBox());
- CFX_DIBitmap* pClone = NULL;
- FX_BOOL bClone = FALSE;
- if (m_pDevice->GetBackDrop() && m_pDevice->GetBitmap()) {
- bClone = TRUE;
- pClone = m_pDevice->GetBackDrop()->Clone(&rect);
- CFX_DIBitmap *pForeBitmap = m_pDevice->GetBitmap();
- pClone->CompositeBitmap(0, 0, pClone->GetWidth(), pClone->GetHeight(), pForeBitmap, rect.left, rect.top);
- left = left >= 0 ? 0 : left;
- top = top >= 0 ? 0 : top;
- if (!pDIBitmap->IsAlphaMask())
- pClone->CompositeBitmap(0, 0, pClone->GetWidth(), pClone->GetHeight(), pDIBitmap,
- left, top, blend_mode);
- else
- pClone->CompositeMask(0, 0, pClone->GetWidth(), pClone->GetHeight(), pDIBitmap,
- mask_argb, left, top, blend_mode);
- } else {
- pClone = pDIBitmap;
- }
- if (m_pDevice->GetBackDrop()) {
- m_pDevice->SetDIBits(pClone, rect.left, rect.top);
- } else {
- if (pDIBitmap->IsAlphaMask()) {
- return;
- }
- m_pDevice->SetDIBits(pDIBitmap, rect.left, rect.top, blend_mode);
- }
- if (bClone) {
- delete pClone;
- }
- }
- return;
- }
- int back_left, back_top;
- FX_RECT rect(left, top, left + pDIBitmap->GetWidth(), top + pDIBitmap->GetHeight());
- CFX_DIBitmap* pBackdrop = GetBackdrop(m_pCurObj, rect, back_left, back_top, blend_mode > FXDIB_BLEND_NORMAL && bIsolated);
- if (!pBackdrop) {
- return;
- }
- if (!pDIBitmap->IsAlphaMask())
- pBackdrop->CompositeBitmap(left - back_left, top - back_top, pDIBitmap->GetWidth(), pDIBitmap->GetHeight(), pDIBitmap,
- 0, 0, blend_mode);
- else
- pBackdrop->CompositeMask(left - back_left, top - back_top, pDIBitmap->GetWidth(), pDIBitmap->GetHeight(), pDIBitmap,
- mask_argb, 0, 0, blend_mode);
- CFX_DIBitmap* pBackdrop1 = FX_NEW CFX_DIBitmap;
- pBackdrop1->Create(pBackdrop->GetWidth(), pBackdrop->GetHeight(), FXDIB_Rgb32);
- pBackdrop1->Clear((FX_DWORD) - 1);
- pBackdrop1->CompositeBitmap(0, 0, pBackdrop->GetWidth(), pBackdrop->GetHeight(), pBackdrop, 0, 0);
- delete pBackdrop;
- pBackdrop = pBackdrop1;
- m_pDevice->SetDIBits(pBackdrop, back_left, back_top);
- delete pBackdrop;
-}
-FX_COLORREF CPDF_TransferFunc::TranslateColor(FX_COLORREF rgb)
-{
- return FXSYS_RGB(m_Samples[FXSYS_GetRValue(rgb)], m_Samples[256 + FXSYS_GetGValue(rgb)],
- m_Samples[512 + FXSYS_GetBValue(rgb)]);
-}
-CFX_DIBSource* CPDF_TransferFunc::TranslateImage(const CFX_DIBSource* pSrc, FX_BOOL bAutoDropSrc)
-{
- CPDF_DIBTransferFunc* pDest = FX_NEW CPDF_DIBTransferFunc(this);
- pDest->LoadSrc(pSrc, bAutoDropSrc);
- return pDest;
-}
-FXDIB_Format CPDF_DIBTransferFunc::GetDestFormat()
-{
- if (m_pSrc->IsAlphaMask()) {
- return FXDIB_8bppMask;
- }
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
- return (m_pSrc->HasAlpha()) ? FXDIB_Argb : FXDIB_Rgb32;
-#else
- return (m_pSrc->HasAlpha()) ? FXDIB_Argb : FXDIB_Rgb;
-#endif
-}
-CPDF_DIBTransferFunc::CPDF_DIBTransferFunc(const CPDF_TransferFunc* pTransferFunc)
-{
- m_RampR = pTransferFunc->m_Samples;
- m_RampG = &pTransferFunc->m_Samples[256];
- m_RampB = &pTransferFunc->m_Samples[512];
-}
-void CPDF_DIBTransferFunc::TranslateScanline(FX_LPBYTE dest_buf, FX_LPCBYTE src_buf) const
-{
- int i;
- FX_BOOL bSkip = FALSE;
- switch (m_pSrc->GetFormat()) {
- case FXDIB_1bppRgb: {
- int r0 = m_RampR[0], g0 = m_RampG[0], b0 = m_RampB[0];
- int r1 = m_RampR[255], g1 = m_RampG[255], b1 = m_RampB[255];
- for (i = 0; i < m_Width; i ++) {
- if (src_buf[i / 8] & (1 << (7 - i % 8))) {
- *dest_buf++ = b1;
- *dest_buf++ = g1;
- *dest_buf++ = r1;
- } else {
- *dest_buf++ = b0;
- *dest_buf++ = g0;
- *dest_buf++ = r0;
- }
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
- dest_buf++;
-#endif
- }
- break;
- }
- case FXDIB_1bppMask: {
- int m0 = m_RampR[0], m1 = m_RampR[255];
- for (i = 0; i < m_Width; i ++) {
- if (src_buf[i / 8] & (1 << (7 - i % 8))) {
- *dest_buf++ = m1;
- } else {
- *dest_buf++ = m0;
- }
- }
- break;
- }
- case FXDIB_8bppRgb: {
- FX_ARGB* pPal = m_pSrc->GetPalette();
- for (i = 0; i < m_Width; i ++) {
- if (pPal) {
- FX_ARGB src_argb = pPal[*src_buf];
- *dest_buf++ = m_RampB[FXARGB_R(src_argb)];
- *dest_buf++ = m_RampG[FXARGB_G(src_argb)];
- *dest_buf++ = m_RampR[FXARGB_B(src_argb)];
- } else {
- FX_DWORD src_byte = *src_buf;
- *dest_buf++ = m_RampB[src_byte];
- *dest_buf++ = m_RampG[src_byte];
- *dest_buf++ = m_RampR[src_byte];
- }
- src_buf ++;
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
- dest_buf++;
-#endif
- }
- break;
- }
- case FXDIB_8bppMask:
- for (i = 0; i < m_Width; i ++) {
- *dest_buf++ = m_RampR[*(src_buf++)];
- }
- break;
- case FXDIB_Rgb:
- for (i = 0; i < m_Width; i ++) {
- *dest_buf++ = m_RampB[*(src_buf++)];
- *dest_buf++ = m_RampG[*(src_buf++)];
- *dest_buf++ = m_RampR[*(src_buf++)];
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
- dest_buf++;
-#endif
- }
- break;
- case FXDIB_Rgb32:
- bSkip = TRUE;
- case FXDIB_Argb:
- for (i = 0; i < m_Width; i ++) {
- *dest_buf++ = m_RampB[*(src_buf++)];
- *dest_buf++ = m_RampG[*(src_buf++)];
- *dest_buf++ = m_RampR[*(src_buf++)];
- if (!bSkip) {
- *dest_buf++ = *src_buf;
- }
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
- else {
- dest_buf++;
- }
-#endif
- src_buf ++;
- }
- break;
- default:
- break;
- }
-}
-void CPDF_DIBTransferFunc::TranslateDownSamples(FX_LPBYTE dest_buf, FX_LPCBYTE src_buf, int pixels, int Bpp) const
-{
- if (Bpp == 8) {
- for (int i = 0; i < pixels; i ++) {
- *dest_buf++ = m_RampR[*(src_buf++)];
- }
- } else if (Bpp == 24) {
- for (int i = 0; i < pixels; i ++) {
- *dest_buf++ = m_RampB[*(src_buf++)];
- *dest_buf++ = m_RampG[*(src_buf++)];
- *dest_buf++ = m_RampR[*(src_buf++)];
- }
- } else {
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
- if (!m_pSrc->HasAlpha()) {
- for (int i = 0; i < pixels; i ++) {
- *dest_buf++ = m_RampB[*(src_buf++)];
- *dest_buf++ = m_RampG[*(src_buf++)];
- *dest_buf++ = m_RampR[*(src_buf++)];
- dest_buf++;
- src_buf++;
- }
- } else
-#endif
- for (int i = 0; i < pixels; i ++) {
- *dest_buf++ = m_RampB[*(src_buf++)];
- *dest_buf++ = m_RampG[*(src_buf++)];
- *dest_buf++ = m_RampR[*(src_buf++)];
- *dest_buf++ = *(src_buf++);
- }
- }
-}
-static FX_BOOL _IsSupported(CPDF_ColorSpace* pCS)
-{
- if (pCS->GetFamily() == PDFCS_DEVICERGB || pCS->GetFamily() == PDFCS_DEVICEGRAY ||
- pCS->GetFamily() == PDFCS_DEVICECMYK || pCS->GetFamily() == PDFCS_CALGRAY ||
- pCS->GetFamily() == PDFCS_CALRGB) {
- return TRUE;
- }
- if (pCS->GetFamily() == PDFCS_INDEXED && _IsSupported(pCS->GetBaseCS())) {
- return TRUE;
- }
- return FALSE;
-}
-CPDF_ImageRenderer::CPDF_ImageRenderer()
-{
- m_pRenderStatus = NULL;
- m_pImageObject = NULL;
- m_Result = TRUE;
- m_Status = 0;
- m_pQuickStretcher = NULL;
- m_pTransformer = NULL;
- m_DeviceHandle = NULL;
- m_LoadHandle = NULL;
- m_pClone = NULL;
- m_bStdCS = FALSE;
- m_bPatternColor = FALSE;
- m_BlendType = FXDIB_BLEND_NORMAL;
- m_pPattern = NULL;
- m_pObj2Device = NULL;
-}
-CPDF_ImageRenderer::~CPDF_ImageRenderer()
-{
- if (m_pQuickStretcher) {
- delete m_pQuickStretcher;
- }
- if (m_pTransformer) {
- delete m_pTransformer;
- }
- if (m_DeviceHandle) {
- m_pRenderStatus->m_pDevice->CancelDIBits(m_DeviceHandle);
- }
- if (m_LoadHandle) {
- delete (CPDF_ProgressiveImageLoaderHandle*)m_LoadHandle;
- }
- if (m_pClone) {
- delete m_pClone;
- }
-}
-FX_BOOL CPDF_ImageRenderer::StartLoadDIBSource()
-{
- CFX_FloatRect image_rect_f = m_ImageMatrix.GetUnitRect();
- FX_RECT image_rect = image_rect_f.GetOutterRect();
- int dest_width = image_rect.Width();
- int dest_height = image_rect.Height();
- if (m_ImageMatrix.a < 0) {
- dest_width = -dest_width;
- }
- if (m_ImageMatrix.d > 0) {
- dest_height = -dest_height;
- }
- if (m_Loader.StartLoadImage(m_pImageObject, m_pRenderStatus->m_pContext->m_pPageCache, m_LoadHandle, m_bStdCS,
- m_pRenderStatus->m_GroupFamily, m_pRenderStatus->m_bLoadMask, m_pRenderStatus, dest_width, dest_height)) {
- if (m_LoadHandle != NULL) {
- m_Status = 4;
- return TRUE;
- }
- return FALSE;
- }
- return FALSE;
-}
-FX_BOOL CPDF_ImageRenderer::StartRenderDIBSource()
-{
- if (m_Loader.m_pBitmap == NULL) {
- return FALSE;
- }
- m_BitmapAlpha = 255;
- const CPDF_GeneralStateData* pGeneralState = m_pImageObject->m_GeneralState;
- if (pGeneralState) {
- m_BitmapAlpha = FXSYS_round(pGeneralState->m_FillAlpha * 255);
- }
- m_pDIBSource = m_Loader.m_pBitmap;
- if (m_pRenderStatus->m_Options.m_ColorMode == RENDER_COLOR_ALPHA && m_Loader.m_pMask == NULL) {
- return StartBitmapAlpha();
- }
-#ifndef _FPDFAPI_MINI_
- if (pGeneralState && pGeneralState->m_pTR) {
- if (!pGeneralState->m_pTransferFunc) {
- ((CPDF_GeneralStateData*)pGeneralState)->m_pTransferFunc = m_pRenderStatus->GetTransferFunc(pGeneralState->m_pTR);
- }
- if (pGeneralState->m_pTransferFunc && !pGeneralState->m_pTransferFunc->m_bIdentity) {
- m_pDIBSource = m_Loader.m_pBitmap = pGeneralState->m_pTransferFunc->TranslateImage(m_Loader.m_pBitmap, !m_Loader.m_bCached);
- if (m_Loader.m_bCached && m_Loader.m_pMask) {
- m_Loader.m_pMask = m_Loader.m_pMask->Clone();
- }
- m_Loader.m_bCached = FALSE;
- }
- }
-#endif
- m_FillArgb = 0;
- m_bPatternColor = FALSE;
- m_pPattern = NULL;
- if (m_pDIBSource->IsAlphaMask()) {
- CPDF_Color* pColor = m_pImageObject->m_ColorState.GetFillColor();
- if (pColor && pColor->IsPattern()) {
- m_pPattern = pColor->GetPattern();
- if (m_pPattern != NULL) {
- m_bPatternColor = TRUE;
- }
- }
- m_FillArgb = m_pRenderStatus->GetFillArgb(m_pImageObject);
- } else if (m_pRenderStatus->m_Options.m_ColorMode == RENDER_COLOR_GRAY) {
- m_pClone = m_pDIBSource->Clone();
- m_pClone->ConvertColorScale(m_pRenderStatus->m_Options.m_BackColor, m_pRenderStatus->m_Options.m_ForeColor);
- m_pDIBSource = m_pClone;
- }
- m_Flags = 0;
-#if !defined(_FPDFAPI_MINI_)
- if (m_pRenderStatus->m_Options.m_Flags & RENDER_FORCE_DOWNSAMPLE) {
- m_Flags |= RENDER_FORCE_DOWNSAMPLE;
- } else if (m_pRenderStatus->m_Options.m_Flags & RENDER_FORCE_HALFTONE) {
- m_Flags |= RENDER_FORCE_HALFTONE;
- }
-#else
- if (!(m_pRenderStatus->m_Options.m_Flags & RENDER_FORCE_HALFTONE)) {
- if (m_pRenderStatus->m_HalftoneLimit) {
- CFX_FloatRect image_rect_f = m_ImageMatrix.GetUnitRect();
- FX_RECT image_rect = image_rect_f.GetOutterRect();
- FX_RECT image_clip = image_rect;
- image_rect.Intersect(m_pRenderStatus->m_pDevice->GetClipBox());
- if (image_rect.Width() && image_rect.Height()) {
- if ((image_clip.Width() * m_pDIBSource->GetWidth() / image_rect.Width()) *
- (image_clip.Height() * m_pDIBSource->GetHeight() / image_rect.Height()) >
- m_pRenderStatus->m_HalftoneLimit) {
- m_Flags |= RENDER_FORCE_DOWNSAMPLE;
- }
- }
- } else {
- m_Flags |= RENDER_FORCE_DOWNSAMPLE;
- }
- }
-#endif
-#ifndef _FPDFAPI_MINI_
- if (m_pRenderStatus->m_pDevice->GetDeviceClass() != FXDC_DISPLAY) {
- CPDF_Object* pFilters = m_pImageObject->m_pImage->GetStream()->GetDict()->GetElementValue(FX_BSTRC("Filter"));
- if (pFilters) {
- if (pFilters->GetType() == PDFOBJ_NAME) {
- CFX_ByteStringC bsDecodeType = pFilters->GetConstString();
- if (bsDecodeType == FX_BSTRC("DCTDecode") || bsDecodeType == FX_BSTRC("JPXDecode")) {
- m_Flags |= FXRENDER_IMAGE_LOSSY;
- }
- } else if (pFilters->GetType() == PDFOBJ_ARRAY) {
- CPDF_Array* pArray = (CPDF_Array*)pFilters;
- for (FX_DWORD i = 0; i < pArray->GetCount(); i ++) {
- CFX_ByteStringC bsDecodeType = pArray->GetConstString(i);
- if (bsDecodeType == FX_BSTRC("DCTDecode") || bsDecodeType == FX_BSTRC("JPXDecode")) {
- m_Flags |= FXRENDER_IMAGE_LOSSY;
- break;
- }
- }
- }
- }
- }
- if (m_pRenderStatus->m_Options.m_Flags & RENDER_NOIMAGESMOOTH) {
- m_Flags |= FXDIB_NOSMOOTH;
- } else if (m_pImageObject->m_pImage->IsInterpol()) {
- m_Flags |= FXDIB_INTERPOL;
- }
-#endif
- if (m_Loader.m_pMask) {
- return DrawMaskedImage();
- }
- if (m_bPatternColor) {
- return DrawPatternImage(m_pObj2Device);
- }
-#if !defined(_FPDFAPI_MINI_) || defined(_FXCORE_FEATURE_ALL_)
- if (m_BitmapAlpha == 255 && pGeneralState && pGeneralState->m_FillOP &&
- pGeneralState->m_OPMode == 0 && pGeneralState->m_BlendType == FXDIB_BLEND_NORMAL && pGeneralState->m_StrokeAlpha == 1 && pGeneralState->m_FillAlpha == 1) {
- CPDF_Document* pDocument = NULL;
- CPDF_Page* pPage = NULL;
- if (m_pRenderStatus->m_pContext->m_pPageCache) {
- pPage = m_pRenderStatus->m_pContext->m_pPageCache->GetPage();
- pDocument = pPage->m_pDocument;
- } else {
- pDocument = m_pImageObject->m_pImage->GetDocument();
- }
- CPDF_Dictionary* pPageResources = pPage ? pPage->m_pPageResources : NULL;
- CPDF_Object* pCSObj = m_pImageObject->m_pImage->GetStream()->GetDict()->GetElementValue(FX_BSTRC("ColorSpace"));
- CPDF_ColorSpace* pColorSpace = pDocument->LoadColorSpace(pCSObj, pPageResources);
- if (pColorSpace) {
- int format = pColorSpace->GetFamily();
- if (format == PDFCS_DEVICECMYK || format == PDFCS_SEPARATION || format == PDFCS_DEVICEN) {
- m_BlendType = FXDIB_BLEND_DARKEN;
- }
- pDocument->GetPageData()->ReleaseColorSpace(pCSObj);
- }
- }
-#endif
- return StartDIBSource();
-}
-FX_BOOL CPDF_ImageRenderer::Start(CPDF_RenderStatus* pStatus, const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device, FX_BOOL bStdCS, int blendType)
-{
- m_pRenderStatus = pStatus;
- m_bStdCS = bStdCS;
- m_pImageObject = (CPDF_ImageObject*)pObj;
- m_BlendType = blendType;
- m_pObj2Device = pObj2Device;
-#ifndef _FPDFAPI_MINI_
- CPDF_Dictionary* pOC = m_pImageObject->m_pImage->GetOC();
- if (pOC && m_pRenderStatus->m_Options.m_pOCContext && !m_pRenderStatus->m_Options.m_pOCContext->CheckOCGVisible(pOC)) {
- return FALSE;
- }
-#endif
- m_ImageMatrix = m_pImageObject->m_Matrix;
- m_ImageMatrix.Concat(*pObj2Device);
- if (StartLoadDIBSource()) {
- return TRUE;
- }
- return StartRenderDIBSource();
-}
-FX_BOOL CPDF_ImageRenderer::Start(CPDF_RenderStatus* pStatus, const CFX_DIBSource* pDIBSource, FX_ARGB bitmap_argb,
- int bitmap_alpha, const CFX_AffineMatrix* pImage2Device, FX_DWORD flags, FX_BOOL bStdCS, int blendType)
-{
- m_pRenderStatus = pStatus;
- m_pDIBSource = pDIBSource;
- m_FillArgb = bitmap_argb;
- m_BitmapAlpha = bitmap_alpha;
- m_ImageMatrix = *pImage2Device;
- m_Flags = flags;
- m_bStdCS = bStdCS;
- m_BlendType = blendType;
- return StartDIBSource();
-}
-FX_BOOL CPDF_ImageRenderer::DrawPatternImage(const CFX_Matrix* pObj2Device)
-{
- if (m_pRenderStatus->m_bPrint && !(m_pRenderStatus->m_pDevice->GetRenderCaps() & FXRC_BLEND_MODE)) {
- m_Result = FALSE;
- return FALSE;
- }
- FX_RECT rect = m_ImageMatrix.GetUnitRect().GetOutterRect();
- rect.Intersect(m_pRenderStatus->m_pDevice->GetClipBox());
- if (rect.IsEmpty()) {
- return FALSE;
- }
- CFX_AffineMatrix new_matrix = m_ImageMatrix;
- new_matrix.TranslateI(-rect.left, -rect.top);
- int width = rect.Width();
- int height = rect.Height();
- CFX_FxgeDevice bitmap_device1;
- if (!bitmap_device1.Create(rect.Width(), rect.Height(), FXDIB_Rgb32)) {
- return TRUE;
- }
- bitmap_device1.GetBitmap()->Clear(0xffffff);
- {
- CPDF_RenderStatus bitmap_render;
- bitmap_render.Initialize(m_pRenderStatus->m_Level + 1, m_pRenderStatus->m_pContext, &bitmap_device1, NULL, NULL,
- NULL, NULL, &m_pRenderStatus->m_Options, 0, m_pRenderStatus->m_bDropObjects, NULL, TRUE);
- CFX_Matrix patternDevice = *pObj2Device;
- patternDevice.Translate((FX_FLOAT) - rect.left, (FX_FLOAT) - rect.top);
- if(m_pPattern->m_PatternType == PATTERN_TILING) {
- bitmap_render.DrawTilingPattern((CPDF_TilingPattern*)m_pPattern, m_pImageObject, &patternDevice, FALSE);
- } else {
- bitmap_render.DrawShadingPattern((CPDF_ShadingPattern*)m_pPattern, m_pImageObject, &patternDevice, FALSE);
- }
- }
- {
- CFX_FxgeDevice bitmap_device2;
- if (!bitmap_device2.Create(rect.Width(), rect.Height(), FXDIB_8bppRgb)) {
- return TRUE;
- }
- bitmap_device2.GetBitmap()->Clear(0);
- CPDF_RenderStatus bitmap_render;
- bitmap_render.Initialize(m_pRenderStatus->m_Level + 1, m_pRenderStatus->m_pContext, &bitmap_device2, NULL, NULL,
- NULL, NULL, NULL, 0, m_pRenderStatus->m_bDropObjects, NULL, TRUE);
- CPDF_ImageRenderer image_render;
- if (image_render.Start(&bitmap_render, m_pDIBSource, 0xffffffff, 255, &new_matrix, m_Flags, TRUE)) {
- image_render.Continue(NULL);
- }
- if (m_Loader.m_MatteColor != 0xffffffff) {
- int matte_r = FXARGB_R(m_Loader.m_MatteColor);
- int matte_g = FXARGB_G(m_Loader.m_MatteColor);
- int matte_b = FXARGB_B(m_Loader.m_MatteColor);
- for (int row = 0; row < height; row ++) {
- FX_LPBYTE dest_scan = (FX_LPBYTE)bitmap_device1.GetBitmap()->GetScanline(row);
- FX_LPCBYTE mask_scan = bitmap_device2.GetBitmap()->GetScanline(row);
- for (int col = 0; col < width; col ++) {
- int alpha = *mask_scan ++;
- if (alpha) {
- int orig = (*dest_scan - matte_b) * 255 / alpha + matte_b;
- if (orig < 0) {
- orig = 0;
- } else if (orig > 255) {
- orig = 255;
- }
- *dest_scan++ = orig;
- orig = (*dest_scan - matte_g) * 255 / alpha + matte_g;
- if (orig < 0) {
- orig = 0;
- } else if (orig > 255) {
- orig = 255;
- }
- *dest_scan++ = orig;
- orig = (*dest_scan - matte_r) * 255 / alpha + matte_r;
- if (orig < 0) {
- orig = 0;
- } else if (orig > 255) {
- orig = 255;
- }
- *dest_scan++ = orig;
- dest_scan ++;
- } else {
- dest_scan += 4;
- }
- }
- }
- }
- bitmap_device2.GetBitmap()->ConvertFormat(FXDIB_8bppMask);
- bitmap_device1.GetBitmap()->MultiplyAlpha(bitmap_device2.GetBitmap());
- bitmap_device1.GetBitmap()->MultiplyAlpha(255);
- }
- m_pRenderStatus->m_pDevice->SetDIBits(bitmap_device1.GetBitmap(), rect.left, rect.top, m_BlendType);
- return FALSE;
-}
-FX_BOOL CPDF_ImageRenderer::DrawMaskedImage()
-{
- if (m_pRenderStatus->m_bPrint && !(m_pRenderStatus->m_pDevice->GetRenderCaps() & FXRC_BLEND_MODE)) {
- m_Result = FALSE;
- return FALSE;
- }
- FX_RECT rect = m_ImageMatrix.GetUnitRect().GetOutterRect();
- rect.Intersect(m_pRenderStatus->m_pDevice->GetClipBox());
- if (rect.IsEmpty()) {
- return FALSE;
- }
- CFX_AffineMatrix new_matrix = m_ImageMatrix;
- new_matrix.TranslateI(-rect.left, -rect.top);
- int width = rect.Width();
- int height = rect.Height();
- CFX_FxgeDevice bitmap_device1;
- if (!bitmap_device1.Create(width, height, FXDIB_Rgb32)) {
- return TRUE;
- }
- bitmap_device1.GetBitmap()->Clear(0xffffff);
- {
- CPDF_RenderStatus bitmap_render;
- bitmap_render.Initialize(m_pRenderStatus->m_Level + 1, m_pRenderStatus->m_pContext, &bitmap_device1, NULL, NULL,
- NULL, NULL, NULL, 0, m_pRenderStatus->m_bDropObjects, NULL, TRUE);
- CPDF_ImageRenderer image_render;
- if (image_render.Start(&bitmap_render, m_pDIBSource, 0, 255, &new_matrix, m_Flags, TRUE)) {
- image_render.Continue(NULL);
- }
- }
- {
- CFX_FxgeDevice bitmap_device2;
- if (!bitmap_device2.Create(width, height, FXDIB_8bppRgb)) {
- return TRUE;
- }
- bitmap_device2.GetBitmap()->Clear(0);
- CPDF_RenderStatus bitmap_render;
- bitmap_render.Initialize(m_pRenderStatus->m_Level + 1, m_pRenderStatus->m_pContext, &bitmap_device2, NULL, NULL,
- NULL, NULL, NULL, 0, m_pRenderStatus->m_bDropObjects, NULL, TRUE);
- CPDF_ImageRenderer image_render;
- if (image_render.Start(&bitmap_render, m_Loader.m_pMask, 0xffffffff, 255, &new_matrix, m_Flags, TRUE)) {
- image_render.Continue(NULL);
- }
- if (m_Loader.m_MatteColor != 0xffffffff) {
- int matte_r = FXARGB_R(m_Loader.m_MatteColor);
- int matte_g = FXARGB_G(m_Loader.m_MatteColor);
- int matte_b = FXARGB_B(m_Loader.m_MatteColor);
- for (int row = 0; row < height; row ++) {
- FX_LPBYTE dest_scan = (FX_LPBYTE)bitmap_device1.GetBitmap()->GetScanline(row);
- FX_LPCBYTE mask_scan = bitmap_device2.GetBitmap()->GetScanline(row);
- for (int col = 0; col < width; col ++) {
- int alpha = *mask_scan ++;
- if (alpha) {
- int orig = (*dest_scan - matte_b) * 255 / alpha + matte_b;
- if (orig < 0) {
- orig = 0;
- } else if (orig > 255) {
- orig = 255;
- }
- *dest_scan++ = orig;
- orig = (*dest_scan - matte_g) * 255 / alpha + matte_g;
- if (orig < 0) {
- orig = 0;
- } else if (orig > 255) {
- orig = 255;
- }
- *dest_scan++ = orig;
- orig = (*dest_scan - matte_r) * 255 / alpha + matte_r;
- if (orig < 0) {
- orig = 0;
- } else if (orig > 255) {
- orig = 255;
- }
- *dest_scan++ = orig;
- dest_scan ++;
- } else {
- dest_scan += 4;
- }
- }
- }
- }
- bitmap_device2.GetBitmap()->ConvertFormat(FXDIB_8bppMask);
- bitmap_device1.GetBitmap()->MultiplyAlpha(bitmap_device2.GetBitmap());
- if (m_BitmapAlpha < 255) {
- bitmap_device1.GetBitmap()->MultiplyAlpha(m_BitmapAlpha);
- }
- }
- m_pRenderStatus->m_pDevice->SetDIBits(bitmap_device1.GetBitmap(), rect.left, rect.top, m_BlendType);
- return FALSE;
-}
-FX_BOOL CPDF_ImageRenderer::StartDIBSource()
-{
-#if !defined(_FPDFAPI_MINI_)
- if (!(m_Flags & RENDER_FORCE_DOWNSAMPLE) && m_pDIBSource->GetBPP() > 1) {
- int image_size = m_pDIBSource->GetBPP() / 8 * m_pDIBSource->GetWidth() * m_pDIBSource->GetHeight();
- if (image_size > FPDF_HUGE_IMAGE_SIZE && !(m_Flags & RENDER_FORCE_HALFTONE)) {
- m_Flags |= RENDER_FORCE_DOWNSAMPLE;
- }
- }
-#endif
- if (m_pRenderStatus->m_pDevice->StartDIBits(m_pDIBSource, m_BitmapAlpha, m_FillArgb,
- &m_ImageMatrix, m_Flags, m_DeviceHandle, 0, NULL, m_BlendType)) {
- if (m_DeviceHandle != NULL) {
- m_Status = 3;
- return TRUE;
- }
- return FALSE;
- }
-#if !defined(_FPDFAPI_MINI_) || defined(_FXCORE_FEATURE_ALL_)
- CFX_FloatRect image_rect_f = m_ImageMatrix.GetUnitRect();
- FX_RECT image_rect = image_rect_f.GetOutterRect();
- int dest_width = image_rect.Width();
- int dest_height = image_rect.Height();
- if ((FXSYS_fabs(m_ImageMatrix.b) >= 0.5f || m_ImageMatrix.a == 0) ||
- (FXSYS_fabs(m_ImageMatrix.c) >= 0.5f || m_ImageMatrix.d == 0) ) {
- if (m_pRenderStatus->m_bPrint && !(m_pRenderStatus->m_pDevice->GetRenderCaps() & FXRC_BLEND_MODE)) {
- m_Result = FALSE;
- return FALSE;
- }
- FX_RECT clip_box = m_pRenderStatus->m_pDevice->GetClipBox();
- clip_box.Intersect(image_rect);
- m_Status = 2;
- m_pTransformer = FX_NEW CFX_ImageTransformer;
- m_pTransformer->Start(m_pDIBSource, &m_ImageMatrix, m_Flags, &clip_box);
- return TRUE;
- }
- if (m_ImageMatrix.a < 0) {
- dest_width = -dest_width;
- }
- if (m_ImageMatrix.d > 0) {
- dest_height = -dest_height;
- }
- int dest_left, dest_top;
- dest_left = dest_width > 0 ? image_rect.left : image_rect.right;
- dest_top = dest_height > 0 ? image_rect.top : image_rect.bottom;
- if (m_pDIBSource->IsOpaqueImage() && m_BitmapAlpha == 255) {
- if (m_pRenderStatus->m_pDevice->StretchDIBits(m_pDIBSource, dest_left, dest_top,
- dest_width, dest_height, m_Flags, NULL, m_BlendType)) {
- return FALSE;
- }
- }
- if (m_pDIBSource->IsAlphaMask()) {
- if (m_BitmapAlpha != 255) {
- m_FillArgb = FXARGB_MUL_ALPHA(m_FillArgb, m_BitmapAlpha);
- }
- if (m_pRenderStatus->m_pDevice->StretchBitMask(m_pDIBSource, dest_left, dest_top, dest_width, dest_height, m_FillArgb, m_Flags)) {
- return FALSE;
- }
- }
- if (m_pRenderStatus->m_bPrint && !(m_pRenderStatus->m_pDevice->GetRenderCaps() & FXRC_BLEND_MODE)) {
- m_Result = FALSE;
- return TRUE;
- }
- FX_RECT clip_box = m_pRenderStatus->m_pDevice->GetClipBox();
- FX_RECT dest_rect = clip_box;
- dest_rect.Intersect(image_rect);
- FX_RECT dest_clip(dest_rect.left - image_rect.left, dest_rect.top - image_rect.top,
- dest_rect.right - image_rect.left, dest_rect.bottom - image_rect.top);
- CFX_DIBitmap* pStretched = m_pDIBSource->StretchTo(dest_width, dest_height, m_Flags, &dest_clip);
- if (pStretched) {
- m_pRenderStatus->CompositeDIBitmap(pStretched, dest_rect.left, dest_rect.top, m_FillArgb,
- m_BitmapAlpha, m_BlendType, FALSE);
- delete pStretched;
- pStretched = NULL;
- }
-#endif
- return FALSE;
-}
-FX_BOOL CPDF_ImageRenderer::StartBitmapAlpha()
-{
-#ifndef _FPDFAPI_MINI_
- if (m_pDIBSource->IsOpaqueImage()) {
- CFX_PathData path;
- path.AppendRect(0, 0, 1, 1);
- path.Transform(&m_ImageMatrix);
- FX_DWORD fill_color = ArgbEncode(0xff, m_BitmapAlpha, m_BitmapAlpha, m_BitmapAlpha);
- m_pRenderStatus->m_pDevice->DrawPath(&path, NULL, NULL, fill_color, 0, FXFILL_WINDING);
- } else {
- const CFX_DIBSource* pAlphaMask = m_pDIBSource->IsAlphaMask() ? m_pDIBSource : m_pDIBSource->GetAlphaMask();
- if (FXSYS_fabs(m_ImageMatrix.b) >= 0.5f || FXSYS_fabs(m_ImageMatrix.c) >= 0.5f) {
- int left, top;
- CFX_DIBitmap* pTransformed = pAlphaMask->TransformTo(&m_ImageMatrix, left, top);
- if (pTransformed == NULL) {
- return TRUE;
- }
- m_pRenderStatus->m_pDevice->SetBitMask(pTransformed, left, top, ArgbEncode(0xff, m_BitmapAlpha, m_BitmapAlpha, m_BitmapAlpha));
- delete pTransformed;
- } else {
- CFX_FloatRect image_rect_f = m_ImageMatrix.GetUnitRect();
- FX_RECT image_rect = image_rect_f.GetOutterRect();
- int dest_width = m_ImageMatrix.a > 0 ? image_rect.Width() : -image_rect.Width();
- int dest_height = m_ImageMatrix.d > 0 ? -image_rect.Height() : image_rect.Height();
- int left = dest_width > 0 ? image_rect.left : image_rect.right;
- int top = dest_height > 0 ? image_rect.top : image_rect.bottom;
- m_pRenderStatus->m_pDevice->StretchBitMask(pAlphaMask, left, top, dest_width, dest_height,
- ArgbEncode(0xff, m_BitmapAlpha, m_BitmapAlpha, m_BitmapAlpha));
- }
- if (m_pDIBSource != pAlphaMask) {
- delete pAlphaMask;
- }
- }
-#endif
- return FALSE;
-}
-FX_BOOL CPDF_ImageRenderer::Continue(IFX_Pause* pPause)
-{
- if (m_Status == 1) {
-#ifndef _FPDFAPI_MINI_
- if (m_pQuickStretcher->Continue(pPause)) {
- return TRUE;
- }
- if (m_pQuickStretcher->m_pBitmap->IsAlphaMask())
- m_pRenderStatus->m_pDevice->SetBitMask(m_pQuickStretcher->m_pBitmap, m_pQuickStretcher->m_ResultLeft,
- m_pQuickStretcher->m_ResultTop, m_FillArgb);
- else
- m_pRenderStatus->m_pDevice->SetDIBits(m_pQuickStretcher->m_pBitmap, m_pQuickStretcher->m_ResultLeft,
- m_pQuickStretcher->m_ResultTop, m_BlendType);
- return FALSE;
-#endif
- } else if (m_Status == 2) {
-#if !defined(_FPDFAPI_MINI_) || defined(_FXCORE_FEATURE_ALL_)
- if (m_pTransformer->Continue(pPause)) {
- return TRUE;
- }
- CFX_DIBitmap* pBitmap = m_pTransformer->m_Storer.Detach();
- if (pBitmap == NULL) {
- return FALSE;
- }
- if (pBitmap->IsAlphaMask()) {
- if (m_BitmapAlpha != 255) {
- m_FillArgb = FXARGB_MUL_ALPHA(m_FillArgb, m_BitmapAlpha);
- }
- m_Result = m_pRenderStatus->m_pDevice->SetBitMask(pBitmap,
- m_pTransformer->m_ResultLeft, m_pTransformer->m_ResultTop, m_FillArgb);
- } else {
- if (m_BitmapAlpha != 255) {
- pBitmap->MultiplyAlpha(m_BitmapAlpha);
- }
- m_Result = m_pRenderStatus->m_pDevice->SetDIBits(pBitmap,
- m_pTransformer->m_ResultLeft, m_pTransformer->m_ResultTop, m_BlendType);
- }
- delete pBitmap;
- return FALSE;
-#endif
- } else if (m_Status == 3) {
- return m_pRenderStatus->m_pDevice->ContinueDIBits(m_DeviceHandle, pPause);
- } else if (m_Status == 4) {
- if (m_Loader.Continue(m_LoadHandle, pPause)) {
- return TRUE;
- }
- if (StartRenderDIBSource()) {
- return Continue(pPause);
- }
- return FALSE;
- }
- return FALSE;
-}
-CPDF_QuickStretcher::CPDF_QuickStretcher()
-{
- m_pBitmap = NULL;
- m_pDecoder = NULL;
- m_pCS = NULL;
-}
-CPDF_QuickStretcher::~CPDF_QuickStretcher()
-{
- if (m_pBitmap) {
- delete m_pBitmap;
- }
- if (m_pCS) {
- m_pCS->ReleaseCS();
- }
- if (m_pDecoder) {
- delete m_pDecoder;
- }
-}
-ICodec_ScanlineDecoder* FPDFAPI_CreateFlateDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height,
- int nComps, int bpc, const CPDF_Dictionary* pParams);
-FX_BOOL CPDF_QuickStretcher::Start(CPDF_ImageObject* pImageObj, CFX_AffineMatrix* pImage2Device, const FX_RECT* pClipBox)
-{
- if (FXSYS_fabs(pImage2Device->a) < FXSYS_fabs(pImage2Device->b) * 10 && FXSYS_fabs(pImage2Device->d) < FXSYS_fabs(pImage2Device->c) * 10) {
- return FALSE;
- }
- CFX_FloatRect image_rect_f = pImage2Device->GetUnitRect();
- FX_RECT image_rect = image_rect_f.GetOutterRect();
- m_DestWidth = image_rect.Width();
- m_DestHeight = image_rect.Height();
- m_bFlipX = pImage2Device->a < 0;
- m_bFlipY = pImage2Device->d > 0;
- FX_RECT result_rect = *pClipBox;
- result_rect.Intersect(image_rect);
- if (result_rect.IsEmpty()) {
- return FALSE;
- }
- m_ResultWidth = result_rect.Width();
- m_ResultHeight = result_rect.Height();
- m_ResultLeft = result_rect.left;
- m_ResultTop = result_rect.top;
- m_ClipLeft = result_rect.left - image_rect.left;
- m_ClipTop = result_rect.top - image_rect.top;
- CPDF_Dictionary* pDict = pImageObj->m_pImage->GetDict();
- if (pDict->GetInteger(FX_BSTRC("BitsPerComponent")) != 8) {
- return FALSE;
- }
- if (pDict->KeyExist(FX_BSTRC("SMask")) || pDict->KeyExist(FX_BSTRC("Mask"))) {
- return FALSE;
- }
- m_SrcWidth = pDict->GetInteger(FX_BSTRC("Width"));
- m_SrcHeight = pDict->GetInteger(FX_BSTRC("Height"));
- m_pCS = NULL;
- m_Bpp = 3;
- CPDF_Object* pCSObj = pDict->GetElementValue(FX_BSTRC("ColorSpace"));
- if (pCSObj == NULL) {
- return FALSE;
- }
- m_pCS = CPDF_ColorSpace::Load(pImageObj->m_pImage->GetDocument(), pCSObj);
- if (m_pCS == NULL) {
- return FALSE;
- }
- if (!_IsSupported(m_pCS)) {
- return FALSE;
- }
- m_Bpp = m_pCS->CountComponents();
- if (m_pCS->sRGB()) {
- m_pCS->ReleaseCS();
- m_pCS = NULL;
- }
- CPDF_Stream* pStream = pImageObj->m_pImage->GetStream();
- m_StreamAcc.LoadAllData(pStream, FALSE, m_SrcWidth * m_SrcHeight * m_Bpp, TRUE);
- m_pDecoder = NULL;
- if (!m_StreamAcc.GetImageDecoder().IsEmpty()) {
- if (m_StreamAcc.GetImageDecoder() == FX_BSTRC("DCTDecode")) {
- const CPDF_Dictionary* pParam = m_StreamAcc.GetImageParam();
- m_pDecoder = CPDF_ModuleMgr::Get()->GetJpegModule()->CreateDecoder(
- m_StreamAcc.GetData(), m_StreamAcc.GetSize(), m_SrcWidth, m_SrcHeight, m_Bpp,
- pParam ? pParam->GetInteger(FX_BSTRC("ColorTransform"), 1) : 1);
- } else if (m_StreamAcc.GetImageDecoder() == FX_BSTRC("FlateDecode")) {
- m_pDecoder = FPDFAPI_CreateFlateDecoder(
- m_StreamAcc.GetData(), m_StreamAcc.GetSize(), m_SrcWidth, m_SrcHeight, m_Bpp, 8,
- m_StreamAcc.GetImageParam());
- } else {
- return FALSE;
- }
- m_pDecoder->DownScale(m_DestWidth, m_DestHeight);
- }
- m_pBitmap = FX_NEW CFX_DIBitmap;
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
- m_pBitmap->Create(m_ResultWidth, m_ResultHeight, FXDIB_Rgb32);
-#else
- m_pBitmap->Create(m_ResultWidth, m_ResultHeight, FXDIB_Rgb);
-#endif
- m_LineIndex = 0;
- return TRUE;
-}
-FX_BOOL CPDF_QuickStretcher::Continue(IFX_Pause* pPause)
-{
- FX_LPBYTE result_buf = m_pBitmap->GetBuffer();
- int src_width = m_pDecoder ? m_pDecoder->GetWidth() : m_SrcWidth;
- int src_height = m_pDecoder ? m_pDecoder->GetHeight() : m_SrcHeight;
- int src_pitch = src_width * m_Bpp;
- while (m_LineIndex < m_ResultHeight) {
- int dest_y, src_y;
- if (m_bFlipY) {
- dest_y = m_ResultHeight - m_LineIndex - 1;
- src_y = (m_DestHeight - (dest_y + m_ClipTop) - 1) * src_height / m_DestHeight;
- } else {
- dest_y = m_LineIndex;
- src_y = (dest_y + m_ClipTop) * src_height / m_DestHeight;
- }
- FX_LPCBYTE src_scan;
- if (m_pDecoder) {
- src_scan = m_pDecoder->GetScanline(src_y);
- if (src_scan == NULL) {
- break;
- }
- } else {
- src_scan = m_StreamAcc.GetData();
- if (src_scan == NULL) {
- break;
- }
- src_scan += src_y * src_pitch;
- }
- FX_LPBYTE result_scan = result_buf + dest_y * m_pBitmap->GetPitch();
- for (int x = 0; x < m_ResultWidth; x ++) {
- int dest_x = m_ClipLeft + x;
- int src_x = (m_bFlipX ? (m_DestWidth - dest_x - 1) : dest_x) * src_width / m_DestWidth;
- FX_LPCBYTE src_pixel = src_scan + src_x * m_Bpp;
- if (m_pCS == NULL) {
- *result_scan = src_pixel[2];
- result_scan ++;
- *result_scan = src_pixel[1];
- result_scan ++;
- *result_scan = src_pixel[0];
- result_scan ++;
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
- result_scan ++;
-#endif
- } else {
- m_pCS->TranslateImageLine(result_scan, src_pixel, 1, 0, 0);
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
- result_scan += 4;
-#else
- result_scan += 3;
-#endif
- }
- }
- m_LineIndex ++;
- if (pPause && pPause->NeedToPauseNow()) {
- return TRUE;
- }
- }
- return FALSE;
-}
-CFX_DIBitmap* CPDF_RenderStatus::LoadSMask(CPDF_Dictionary* pSMaskDict,
- FX_RECT* pClipRect, const CFX_AffineMatrix* pMatrix)
-{
- if (pSMaskDict == NULL) {
- return NULL;
- }
- CFX_DIBitmap* pMask = NULL;
- int width = pClipRect->right - pClipRect->left;
- int height = pClipRect->bottom - pClipRect->top;
- FX_BOOL bLuminosity = FALSE;
- bLuminosity = pSMaskDict->GetConstString(FX_BSTRC("S")) != FX_BSTRC("Alpha");
- CPDF_Stream* pGroup = pSMaskDict->GetStream(FX_BSTRC("G"));
- if (pGroup == NULL) {
- return NULL;
- }
- CPDF_Function* pFunc = NULL;
- CPDF_Object* pFuncObj = pSMaskDict->GetElementValue(FX_BSTRC("TR"));
- if (pFuncObj && (pFuncObj->GetType() == PDFOBJ_DICTIONARY || pFuncObj->GetType() == PDFOBJ_STREAM)) {
- pFunc = CPDF_Function::Load(pFuncObj);
- }
- CFX_AffineMatrix matrix = *pMatrix;
- matrix.TranslateI(-pClipRect->left, -pClipRect->top);
- CPDF_Form form(m_pContext->m_pDocument, m_pContext->m_pPageResources, pGroup);
- form.ParseContent(NULL, NULL, NULL, NULL);
- CFX_FxgeDevice bitmap_device;
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
- if (!bitmap_device.Create(width, height, bLuminosity ? FXDIB_Rgb32 : FXDIB_8bppMask)) {
- return NULL;
- }
-#else
- if (!bitmap_device.Create(width, height, bLuminosity ? FXDIB_Rgb : FXDIB_8bppMask)) {
- return NULL;
- }
-#endif
- CFX_DIBitmap& bitmap = *bitmap_device.GetBitmap();
- CPDF_Object* pCSObj = NULL;
- CPDF_ColorSpace* pCS = NULL;
- if (bLuminosity) {
- CPDF_Array* pBC = pSMaskDict->GetArray(FX_BSTRC("BC"));
- FX_ARGB back_color = 0xff000000;
- if (pBC) {
- pCSObj = pGroup->GetDict()->GetDict(FX_BSTRC("Group"))->GetElementValue(FX_BSTRC("CS"));
- pCS = m_pContext->m_pDocument->LoadColorSpace(pCSObj);
- if (pCS) {
- FX_FLOAT R, G, B;
- FX_DWORD num_floats = 8;
- if (pCS->CountComponents() > (FX_INT32)num_floats) {
- num_floats = (FX_DWORD)pCS->CountComponents();
- }
- CFX_FixedBufGrow<FX_FLOAT, 8> float_array(num_floats);
- FX_FLOAT* pFloats = float_array;
- FXSYS_memset32(pFloats, 0, num_floats * sizeof(FX_FLOAT));
- int count = pBC->GetCount() > 8 ? 8 : pBC->GetCount();
- for (int i = 0; i < count; i ++) {
- pFloats[i] = pBC->GetNumber(i);
- }
- pCS->GetRGB(pFloats, R, G, B);
- back_color = 0xff000000 | ((FX_INT32)(R * 255) << 16) | ((FX_INT32)(G * 255) << 8) | (FX_INT32)(B * 255);
- m_pContext->m_pDocument->GetPageData()->ReleaseColorSpace(pCSObj);
- }
- }
- bitmap.Clear(back_color);
- } else {
- bitmap.Clear(0);
- }
- CPDF_Dictionary* pFormResource = NULL;
- if (form.m_pFormDict) {
- pFormResource = form.m_pFormDict->GetDict(FX_BSTRC("Resources"));
- }
- CPDF_RenderOptions options;
- options.m_ColorMode = bLuminosity ? RENDER_COLOR_NORMAL : RENDER_COLOR_ALPHA;
- CPDF_RenderStatus status;
- status.Initialize(m_Level + 1, m_pContext, &bitmap_device, NULL, NULL, NULL, NULL,
- &options, 0, m_bDropObjects, pFormResource, TRUE, NULL, 0, pCS ? pCS->GetFamily() : 0, bLuminosity);
- status.RenderObjectList(&form, &matrix);
- pMask = FX_NEW CFX_DIBitmap;
- if (!pMask->Create(width, height, FXDIB_8bppMask)) {
- delete pMask;
- return NULL;
- }
- FX_LPBYTE dest_buf = pMask->GetBuffer();
- int dest_pitch = pMask->GetPitch();
- FX_LPBYTE src_buf = bitmap.GetBuffer();
- int src_pitch = bitmap.GetPitch();
- FX_LPBYTE pTransfer = FX_Alloc(FX_BYTE, 256);
- if (pFunc) {
- CFX_FixedBufGrow<FX_FLOAT, 16> results(pFunc->CountOutputs());
- for (int i = 0; i < 256; i ++) {
- FX_FLOAT input = (FX_FLOAT)i / 255.0f;
- int nresult;
- pFunc->Call(&input, 1, results, nresult);
- pTransfer[i] = FXSYS_round(results[0] * 255);
- }
- } else {
- for (int i = 0; i < 256; i ++) {
- pTransfer[i] = i;
- }
- }
- if (bLuminosity) {
- int Bpp = bitmap.GetBPP() / 8;
- for (int row = 0; row < height; row ++) {
- FX_LPBYTE dest_pos = dest_buf + row * dest_pitch;
- FX_LPBYTE src_pos = src_buf + row * src_pitch;
- for (int col = 0; col < width; col ++) {
- *dest_pos ++ = pTransfer[FXRGB2GRAY(src_pos[2], src_pos[1], *src_pos)];
- src_pos += Bpp;
- }
- }
- } else if (pFunc) {
- int size = dest_pitch * height;
- for (int i = 0; i < size; i ++) {
- dest_buf[i] = pTransfer[src_buf[i]];
- }
- } else {
- FXSYS_memcpy32(dest_buf, src_buf, dest_pitch * height);
- }
- if (pFunc) {
- delete pFunc;
- }
- FX_Free(pTransfer);
- return pMask;
-}
+// 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
+
+#include "../../../include/fxge/fx_ge.h"
+#include "../../../include/fxcodec/fx_codec.h"
+#include "../../../include/fpdfapi/fpdf_module.h"
+#include "../../../include/fpdfapi/fpdf_render.h"
+#include "../../../include/fpdfapi/fpdf_pageobj.h"
+#include "../fpdf_page/pageint.h"
+#include "render_int.h"
+FX_BOOL CPDF_RenderStatus::ProcessImage(CPDF_ImageObject* pImageObj, const CFX_AffineMatrix* pObj2Device)
+{
+ CPDF_ImageRenderer render;
+ if (render.Start(this, pImageObj, pObj2Device, m_bStdCS, m_curBlend)) {
+ render.Continue(NULL);
+ }
+#ifdef _FPDFAPI_MINI_
+ if (m_DitherBits) {
+ DitherObjectArea(pImageObj, pObj2Device);
+ }
+#endif
+ return render.m_Result;
+}
+#if defined(_FPDFAPI_MINI_)
+FX_BOOL CPDF_RenderStatus::ProcessInlines(CPDF_InlineImages* pInlines, const CFX_AffineMatrix* pObj2Device)
+{
+ int bitmap_alpha = 255;
+ if (!pInlines->m_GeneralState.IsNull()) {
+ bitmap_alpha = FXSYS_round(pInlines->m_GeneralState.GetObject()->m_FillAlpha * 255);
+ }
+ if (pInlines->m_pStream) {
+ CPDF_DIBSource dibsrc;
+ if (!dibsrc.Load(m_pContext->m_pDocument, pInlines->m_pStream, NULL, NULL, NULL, NULL)) {
+ return TRUE;
+ }
+ pInlines->m_pBitmap = dibsrc.Clone();
+ pInlines->m_pStream->Release();
+ pInlines->m_pStream = NULL;
+ }
+ if (pInlines->m_pBitmap == NULL) {
+ return TRUE;
+ }
+ FX_ARGB fill_argb = 0;
+ if (pInlines->m_pBitmap->IsAlphaMask()) {
+ fill_argb = GetFillArgb(pInlines);
+ }
+ int flags = 0;
+ if (m_Options.m_Flags & RENDER_FORCE_DOWNSAMPLE) {
+ flags |= RENDER_FORCE_DOWNSAMPLE;
+ } else if (m_Options.m_Flags & RENDER_FORCE_HALFTONE) {
+ flags = 0;
+ }
+ for (int i = 0; i < pInlines->m_Matrices.GetSize(); i ++) {
+ CFX_AffineMatrix image_matrix = pInlines->m_Matrices.GetAt(i);
+ image_matrix.Concat(*pObj2Device);
+ CPDF_ImageRenderer renderer;
+ if (renderer.Start(this, pInlines->m_pBitmap, fill_argb, bitmap_alpha, &image_matrix, flags, FALSE, m_curBlend)) {
+ renderer.Continue(NULL);
+ }
+ }
+ return TRUE;
+}
+#endif
+void CPDF_RenderStatus::CompositeDIBitmap(CFX_DIBitmap* pDIBitmap, int left, int top, FX_ARGB mask_argb,
+ int bitmap_alpha, int blend_mode, int Transparency)
+{
+ if (pDIBitmap == NULL) {
+ return;
+ }
+ FX_BOOL bIsolated = Transparency & PDFTRANS_ISOLATED;
+ FX_BOOL bGroup = Transparency & PDFTRANS_GROUP;
+ if (blend_mode == FXDIB_BLEND_NORMAL) {
+ if (!pDIBitmap->IsAlphaMask()) {
+ if (bitmap_alpha < 255) {
+ pDIBitmap->MultiplyAlpha(bitmap_alpha);
+ }
+ if (m_pDevice->SetDIBits(pDIBitmap, left, top)) {
+ return;
+ }
+ } else {
+ FX_DWORD fill_argb = m_Options.TranslateColor(mask_argb);
+ if (bitmap_alpha < 255) {
+ ((FX_BYTE*)&fill_argb)[3] = ((FX_BYTE*)&fill_argb)[3] * bitmap_alpha / 255;
+ }
+ if (m_pDevice->SetBitMask(pDIBitmap, left, top, fill_argb)) {
+ return;
+ }
+ }
+ }
+ FX_BOOL bBackAlphaRequired = blend_mode && bIsolated && !m_bDropObjects;
+ FX_BOOL bGetBackGround = ((m_pDevice->GetRenderCaps() & FXRC_ALPHA_OUTPUT)) ||
+ (!(m_pDevice->GetRenderCaps() & FXRC_ALPHA_OUTPUT) && (m_pDevice->GetRenderCaps()
+ & FXRC_GET_BITS) && !bBackAlphaRequired);
+ if (bGetBackGround) {
+ if (bIsolated || !bGroup) {
+ if (pDIBitmap->IsAlphaMask()) {
+ return;
+ }
+ m_pDevice->SetDIBits(pDIBitmap, left, top, blend_mode);
+ } else {
+ FX_RECT rect(left, top, left + pDIBitmap->GetWidth(), top + pDIBitmap->GetHeight());
+ rect.Intersect(m_pDevice->GetClipBox());
+ CFX_DIBitmap* pClone = NULL;
+ FX_BOOL bClone = FALSE;
+ if (m_pDevice->GetBackDrop() && m_pDevice->GetBitmap()) {
+ bClone = TRUE;
+ pClone = m_pDevice->GetBackDrop()->Clone(&rect);
+ CFX_DIBitmap *pForeBitmap = m_pDevice->GetBitmap();
+ pClone->CompositeBitmap(0, 0, pClone->GetWidth(), pClone->GetHeight(), pForeBitmap, rect.left, rect.top);
+ left = left >= 0 ? 0 : left;
+ top = top >= 0 ? 0 : top;
+ if (!pDIBitmap->IsAlphaMask())
+ pClone->CompositeBitmap(0, 0, pClone->GetWidth(), pClone->GetHeight(), pDIBitmap,
+ left, top, blend_mode);
+ else
+ pClone->CompositeMask(0, 0, pClone->GetWidth(), pClone->GetHeight(), pDIBitmap,
+ mask_argb, left, top, blend_mode);
+ } else {
+ pClone = pDIBitmap;
+ }
+ if (m_pDevice->GetBackDrop()) {
+ m_pDevice->SetDIBits(pClone, rect.left, rect.top);
+ } else {
+ if (pDIBitmap->IsAlphaMask()) {
+ return;
+ }
+ m_pDevice->SetDIBits(pDIBitmap, rect.left, rect.top, blend_mode);
+ }
+ if (bClone) {
+ delete pClone;
+ }
+ }
+ return;
+ }
+ int back_left, back_top;
+ FX_RECT rect(left, top, left + pDIBitmap->GetWidth(), top + pDIBitmap->GetHeight());
+ CFX_DIBitmap* pBackdrop = GetBackdrop(m_pCurObj, rect, back_left, back_top, blend_mode > FXDIB_BLEND_NORMAL && bIsolated);
+ if (!pBackdrop) {
+ return;
+ }
+ if (!pDIBitmap->IsAlphaMask())
+ pBackdrop->CompositeBitmap(left - back_left, top - back_top, pDIBitmap->GetWidth(), pDIBitmap->GetHeight(), pDIBitmap,
+ 0, 0, blend_mode);
+ else
+ pBackdrop->CompositeMask(left - back_left, top - back_top, pDIBitmap->GetWidth(), pDIBitmap->GetHeight(), pDIBitmap,
+ mask_argb, 0, 0, blend_mode);
+ CFX_DIBitmap* pBackdrop1 = FX_NEW CFX_DIBitmap;
+ pBackdrop1->Create(pBackdrop->GetWidth(), pBackdrop->GetHeight(), FXDIB_Rgb32);
+ pBackdrop1->Clear((FX_DWORD) - 1);
+ pBackdrop1->CompositeBitmap(0, 0, pBackdrop->GetWidth(), pBackdrop->GetHeight(), pBackdrop, 0, 0);
+ delete pBackdrop;
+ pBackdrop = pBackdrop1;
+ m_pDevice->SetDIBits(pBackdrop, back_left, back_top);
+ delete pBackdrop;
+}
+FX_COLORREF CPDF_TransferFunc::TranslateColor(FX_COLORREF rgb)
+{
+ return FXSYS_RGB(m_Samples[FXSYS_GetRValue(rgb)], m_Samples[256 + FXSYS_GetGValue(rgb)],
+ m_Samples[512 + FXSYS_GetBValue(rgb)]);
+}
+CFX_DIBSource* CPDF_TransferFunc::TranslateImage(const CFX_DIBSource* pSrc, FX_BOOL bAutoDropSrc)
+{
+ CPDF_DIBTransferFunc* pDest = FX_NEW CPDF_DIBTransferFunc(this);
+ pDest->LoadSrc(pSrc, bAutoDropSrc);
+ return pDest;
+}
+FXDIB_Format CPDF_DIBTransferFunc::GetDestFormat()
+{
+ if (m_pSrc->IsAlphaMask()) {
+ return FXDIB_8bppMask;
+ }
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
+ return (m_pSrc->HasAlpha()) ? FXDIB_Argb : FXDIB_Rgb32;
+#else
+ return (m_pSrc->HasAlpha()) ? FXDIB_Argb : FXDIB_Rgb;
+#endif
+}
+CPDF_DIBTransferFunc::CPDF_DIBTransferFunc(const CPDF_TransferFunc* pTransferFunc)
+{
+ m_RampR = pTransferFunc->m_Samples;
+ m_RampG = &pTransferFunc->m_Samples[256];
+ m_RampB = &pTransferFunc->m_Samples[512];
+}
+void CPDF_DIBTransferFunc::TranslateScanline(FX_LPBYTE dest_buf, FX_LPCBYTE src_buf) const
+{
+ int i;
+ FX_BOOL bSkip = FALSE;
+ switch (m_pSrc->GetFormat()) {
+ case FXDIB_1bppRgb: {
+ int r0 = m_RampR[0], g0 = m_RampG[0], b0 = m_RampB[0];
+ int r1 = m_RampR[255], g1 = m_RampG[255], b1 = m_RampB[255];
+ for (i = 0; i < m_Width; i ++) {
+ if (src_buf[i / 8] & (1 << (7 - i % 8))) {
+ *dest_buf++ = b1;
+ *dest_buf++ = g1;
+ *dest_buf++ = r1;
+ } else {
+ *dest_buf++ = b0;
+ *dest_buf++ = g0;
+ *dest_buf++ = r0;
+ }
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
+ dest_buf++;
+#endif
+ }
+ break;
+ }
+ case FXDIB_1bppMask: {
+ int m0 = m_RampR[0], m1 = m_RampR[255];
+ for (i = 0; i < m_Width; i ++) {
+ if (src_buf[i / 8] & (1 << (7 - i % 8))) {
+ *dest_buf++ = m1;
+ } else {
+ *dest_buf++ = m0;
+ }
+ }
+ break;
+ }
+ case FXDIB_8bppRgb: {
+ FX_ARGB* pPal = m_pSrc->GetPalette();
+ for (i = 0; i < m_Width; i ++) {
+ if (pPal) {
+ FX_ARGB src_argb = pPal[*src_buf];
+ *dest_buf++ = m_RampB[FXARGB_R(src_argb)];
+ *dest_buf++ = m_RampG[FXARGB_G(src_argb)];
+ *dest_buf++ = m_RampR[FXARGB_B(src_argb)];
+ } else {
+ FX_DWORD src_byte = *src_buf;
+ *dest_buf++ = m_RampB[src_byte];
+ *dest_buf++ = m_RampG[src_byte];
+ *dest_buf++ = m_RampR[src_byte];
+ }
+ src_buf ++;
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
+ dest_buf++;
+#endif
+ }
+ break;
+ }
+ case FXDIB_8bppMask:
+ for (i = 0; i < m_Width; i ++) {
+ *dest_buf++ = m_RampR[*(src_buf++)];
+ }
+ break;
+ case FXDIB_Rgb:
+ for (i = 0; i < m_Width; i ++) {
+ *dest_buf++ = m_RampB[*(src_buf++)];
+ *dest_buf++ = m_RampG[*(src_buf++)];
+ *dest_buf++ = m_RampR[*(src_buf++)];
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
+ dest_buf++;
+#endif
+ }
+ break;
+ case FXDIB_Rgb32:
+ bSkip = TRUE;
+ case FXDIB_Argb:
+ for (i = 0; i < m_Width; i ++) {
+ *dest_buf++ = m_RampB[*(src_buf++)];
+ *dest_buf++ = m_RampG[*(src_buf++)];
+ *dest_buf++ = m_RampR[*(src_buf++)];
+ if (!bSkip) {
+ *dest_buf++ = *src_buf;
+ }
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
+ else {
+ dest_buf++;
+ }
+#endif
+ src_buf ++;
+ }
+ break;
+ default:
+ break;
+ }
+}
+void CPDF_DIBTransferFunc::TranslateDownSamples(FX_LPBYTE dest_buf, FX_LPCBYTE src_buf, int pixels, int Bpp) const
+{
+ if (Bpp == 8) {
+ for (int i = 0; i < pixels; i ++) {
+ *dest_buf++ = m_RampR[*(src_buf++)];
+ }
+ } else if (Bpp == 24) {
+ for (int i = 0; i < pixels; i ++) {
+ *dest_buf++ = m_RampB[*(src_buf++)];
+ *dest_buf++ = m_RampG[*(src_buf++)];
+ *dest_buf++ = m_RampR[*(src_buf++)];
+ }
+ } else {
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
+ if (!m_pSrc->HasAlpha()) {
+ for (int i = 0; i < pixels; i ++) {
+ *dest_buf++ = m_RampB[*(src_buf++)];
+ *dest_buf++ = m_RampG[*(src_buf++)];
+ *dest_buf++ = m_RampR[*(src_buf++)];
+ dest_buf++;
+ src_buf++;
+ }
+ } else
+#endif
+ for (int i = 0; i < pixels; i ++) {
+ *dest_buf++ = m_RampB[*(src_buf++)];
+ *dest_buf++ = m_RampG[*(src_buf++)];
+ *dest_buf++ = m_RampR[*(src_buf++)];
+ *dest_buf++ = *(src_buf++);
+ }
+ }
+}
+static FX_BOOL _IsSupported(CPDF_ColorSpace* pCS)
+{
+ if (pCS->GetFamily() == PDFCS_DEVICERGB || pCS->GetFamily() == PDFCS_DEVICEGRAY ||
+ pCS->GetFamily() == PDFCS_DEVICECMYK || pCS->GetFamily() == PDFCS_CALGRAY ||
+ pCS->GetFamily() == PDFCS_CALRGB) {
+ return TRUE;
+ }
+ if (pCS->GetFamily() == PDFCS_INDEXED && _IsSupported(pCS->GetBaseCS())) {
+ return TRUE;
+ }
+ return FALSE;
+}
+CPDF_ImageRenderer::CPDF_ImageRenderer()
+{
+ m_pRenderStatus = NULL;
+ m_pImageObject = NULL;
+ m_Result = TRUE;
+ m_Status = 0;
+ m_pQuickStretcher = NULL;
+ m_pTransformer = NULL;
+ m_DeviceHandle = NULL;
+ m_LoadHandle = NULL;
+ m_pClone = NULL;
+ m_bStdCS = FALSE;
+ m_bPatternColor = FALSE;
+ m_BlendType = FXDIB_BLEND_NORMAL;
+ m_pPattern = NULL;
+ m_pObj2Device = NULL;
+}
+CPDF_ImageRenderer::~CPDF_ImageRenderer()
+{
+ if (m_pQuickStretcher) {
+ delete m_pQuickStretcher;
+ }
+ if (m_pTransformer) {
+ delete m_pTransformer;
+ }
+ if (m_DeviceHandle) {
+ m_pRenderStatus->m_pDevice->CancelDIBits(m_DeviceHandle);
+ }
+ if (m_LoadHandle) {
+ delete (CPDF_ProgressiveImageLoaderHandle*)m_LoadHandle;
+ }
+ if (m_pClone) {
+ delete m_pClone;
+ }
+}
+FX_BOOL CPDF_ImageRenderer::StartLoadDIBSource()
+{
+ CFX_FloatRect image_rect_f = m_ImageMatrix.GetUnitRect();
+ FX_RECT image_rect = image_rect_f.GetOutterRect();
+ int dest_width = image_rect.Width();
+ int dest_height = image_rect.Height();
+ if (m_ImageMatrix.a < 0) {
+ dest_width = -dest_width;
+ }
+ if (m_ImageMatrix.d > 0) {
+ dest_height = -dest_height;
+ }
+ if (m_Loader.StartLoadImage(m_pImageObject, m_pRenderStatus->m_pContext->m_pPageCache, m_LoadHandle, m_bStdCS,
+ m_pRenderStatus->m_GroupFamily, m_pRenderStatus->m_bLoadMask, m_pRenderStatus, dest_width, dest_height)) {
+ if (m_LoadHandle != NULL) {
+ m_Status = 4;
+ return TRUE;
+ }
+ return FALSE;
+ }
+ return FALSE;
+}
+FX_BOOL CPDF_ImageRenderer::StartRenderDIBSource()
+{
+ if (m_Loader.m_pBitmap == NULL) {
+ return FALSE;
+ }
+ m_BitmapAlpha = 255;
+ const CPDF_GeneralStateData* pGeneralState = m_pImageObject->m_GeneralState;
+ if (pGeneralState) {
+ m_BitmapAlpha = FXSYS_round(pGeneralState->m_FillAlpha * 255);
+ }
+ m_pDIBSource = m_Loader.m_pBitmap;
+ if (m_pRenderStatus->m_Options.m_ColorMode == RENDER_COLOR_ALPHA && m_Loader.m_pMask == NULL) {
+ return StartBitmapAlpha();
+ }
+#ifndef _FPDFAPI_MINI_
+ if (pGeneralState && pGeneralState->m_pTR) {
+ if (!pGeneralState->m_pTransferFunc) {
+ ((CPDF_GeneralStateData*)pGeneralState)->m_pTransferFunc = m_pRenderStatus->GetTransferFunc(pGeneralState->m_pTR);
+ }
+ if (pGeneralState->m_pTransferFunc && !pGeneralState->m_pTransferFunc->m_bIdentity) {
+ m_pDIBSource = m_Loader.m_pBitmap = pGeneralState->m_pTransferFunc->TranslateImage(m_Loader.m_pBitmap, !m_Loader.m_bCached);
+ if (m_Loader.m_bCached && m_Loader.m_pMask) {
+ m_Loader.m_pMask = m_Loader.m_pMask->Clone();
+ }
+ m_Loader.m_bCached = FALSE;
+ }
+ }
+#endif
+ m_FillArgb = 0;
+ m_bPatternColor = FALSE;
+ m_pPattern = NULL;
+ if (m_pDIBSource->IsAlphaMask()) {
+ CPDF_Color* pColor = m_pImageObject->m_ColorState.GetFillColor();
+ if (pColor && pColor->IsPattern()) {
+ m_pPattern = pColor->GetPattern();
+ if (m_pPattern != NULL) {
+ m_bPatternColor = TRUE;
+ }
+ }
+ m_FillArgb = m_pRenderStatus->GetFillArgb(m_pImageObject);
+ } else if (m_pRenderStatus->m_Options.m_ColorMode == RENDER_COLOR_GRAY) {
+ m_pClone = m_pDIBSource->Clone();
+ m_pClone->ConvertColorScale(m_pRenderStatus->m_Options.m_BackColor, m_pRenderStatus->m_Options.m_ForeColor);
+ m_pDIBSource = m_pClone;
+ }
+ m_Flags = 0;
+#if !defined(_FPDFAPI_MINI_)
+ if (m_pRenderStatus->m_Options.m_Flags & RENDER_FORCE_DOWNSAMPLE) {
+ m_Flags |= RENDER_FORCE_DOWNSAMPLE;
+ } else if (m_pRenderStatus->m_Options.m_Flags & RENDER_FORCE_HALFTONE) {
+ m_Flags |= RENDER_FORCE_HALFTONE;
+ }
+#else
+ if (!(m_pRenderStatus->m_Options.m_Flags & RENDER_FORCE_HALFTONE)) {
+ if (m_pRenderStatus->m_HalftoneLimit) {
+ CFX_FloatRect image_rect_f = m_ImageMatrix.GetUnitRect();
+ FX_RECT image_rect = image_rect_f.GetOutterRect();
+ FX_RECT image_clip = image_rect;
+ image_rect.Intersect(m_pRenderStatus->m_pDevice->GetClipBox());
+ if (image_rect.Width() && image_rect.Height()) {
+ if ((image_clip.Width() * m_pDIBSource->GetWidth() / image_rect.Width()) *
+ (image_clip.Height() * m_pDIBSource->GetHeight() / image_rect.Height()) >
+ m_pRenderStatus->m_HalftoneLimit) {
+ m_Flags |= RENDER_FORCE_DOWNSAMPLE;
+ }
+ }
+ } else {
+ m_Flags |= RENDER_FORCE_DOWNSAMPLE;
+ }
+ }
+#endif
+#ifndef _FPDFAPI_MINI_
+ if (m_pRenderStatus->m_pDevice->GetDeviceClass() != FXDC_DISPLAY) {
+ CPDF_Object* pFilters = m_pImageObject->m_pImage->GetStream()->GetDict()->GetElementValue(FX_BSTRC("Filter"));
+ if (pFilters) {
+ if (pFilters->GetType() == PDFOBJ_NAME) {
+ CFX_ByteStringC bsDecodeType = pFilters->GetConstString();
+ if (bsDecodeType == FX_BSTRC("DCTDecode") || bsDecodeType == FX_BSTRC("JPXDecode")) {
+ m_Flags |= FXRENDER_IMAGE_LOSSY;
+ }
+ } else if (pFilters->GetType() == PDFOBJ_ARRAY) {
+ CPDF_Array* pArray = (CPDF_Array*)pFilters;
+ for (FX_DWORD i = 0; i < pArray->GetCount(); i ++) {
+ CFX_ByteStringC bsDecodeType = pArray->GetConstString(i);
+ if (bsDecodeType == FX_BSTRC("DCTDecode") || bsDecodeType == FX_BSTRC("JPXDecode")) {
+ m_Flags |= FXRENDER_IMAGE_LOSSY;
+ break;
+ }
+ }
+ }
+ }
+ }
+ if (m_pRenderStatus->m_Options.m_Flags & RENDER_NOIMAGESMOOTH) {
+ m_Flags |= FXDIB_NOSMOOTH;
+ } else if (m_pImageObject->m_pImage->IsInterpol()) {
+ m_Flags |= FXDIB_INTERPOL;
+ }
+#endif
+ if (m_Loader.m_pMask) {
+ return DrawMaskedImage();
+ }
+ if (m_bPatternColor) {
+ return DrawPatternImage(m_pObj2Device);
+ }
+#if !defined(_FPDFAPI_MINI_) || defined(_FXCORE_FEATURE_ALL_)
+ if (m_BitmapAlpha == 255 && pGeneralState && pGeneralState->m_FillOP &&
+ pGeneralState->m_OPMode == 0 && pGeneralState->m_BlendType == FXDIB_BLEND_NORMAL && pGeneralState->m_StrokeAlpha == 1 && pGeneralState->m_FillAlpha == 1) {
+ CPDF_Document* pDocument = NULL;
+ CPDF_Page* pPage = NULL;
+ if (m_pRenderStatus->m_pContext->m_pPageCache) {
+ pPage = m_pRenderStatus->m_pContext->m_pPageCache->GetPage();
+ pDocument = pPage->m_pDocument;
+ } else {
+ pDocument = m_pImageObject->m_pImage->GetDocument();
+ }
+ CPDF_Dictionary* pPageResources = pPage ? pPage->m_pPageResources : NULL;
+ CPDF_Object* pCSObj = m_pImageObject->m_pImage->GetStream()->GetDict()->GetElementValue(FX_BSTRC("ColorSpace"));
+ CPDF_ColorSpace* pColorSpace = pDocument->LoadColorSpace(pCSObj, pPageResources);
+ if (pColorSpace) {
+ int format = pColorSpace->GetFamily();
+ if (format == PDFCS_DEVICECMYK || format == PDFCS_SEPARATION || format == PDFCS_DEVICEN) {
+ m_BlendType = FXDIB_BLEND_DARKEN;
+ }
+ pDocument->GetPageData()->ReleaseColorSpace(pCSObj);
+ }
+ }
+#endif
+ return StartDIBSource();
+}
+FX_BOOL CPDF_ImageRenderer::Start(CPDF_RenderStatus* pStatus, const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device, FX_BOOL bStdCS, int blendType)
+{
+ m_pRenderStatus = pStatus;
+ m_bStdCS = bStdCS;
+ m_pImageObject = (CPDF_ImageObject*)pObj;
+ m_BlendType = blendType;
+ m_pObj2Device = pObj2Device;
+#ifndef _FPDFAPI_MINI_
+ CPDF_Dictionary* pOC = m_pImageObject->m_pImage->GetOC();
+ if (pOC && m_pRenderStatus->m_Options.m_pOCContext && !m_pRenderStatus->m_Options.m_pOCContext->CheckOCGVisible(pOC)) {
+ return FALSE;
+ }
+#endif
+ m_ImageMatrix = m_pImageObject->m_Matrix;
+ m_ImageMatrix.Concat(*pObj2Device);
+ if (StartLoadDIBSource()) {
+ return TRUE;
+ }
+ return StartRenderDIBSource();
+}
+FX_BOOL CPDF_ImageRenderer::Start(CPDF_RenderStatus* pStatus, const CFX_DIBSource* pDIBSource, FX_ARGB bitmap_argb,
+ int bitmap_alpha, const CFX_AffineMatrix* pImage2Device, FX_DWORD flags, FX_BOOL bStdCS, int blendType)
+{
+ m_pRenderStatus = pStatus;
+ m_pDIBSource = pDIBSource;
+ m_FillArgb = bitmap_argb;
+ m_BitmapAlpha = bitmap_alpha;
+ m_ImageMatrix = *pImage2Device;
+ m_Flags = flags;
+ m_bStdCS = bStdCS;
+ m_BlendType = blendType;
+ return StartDIBSource();
+}
+FX_BOOL CPDF_ImageRenderer::DrawPatternImage(const CFX_Matrix* pObj2Device)
+{
+ if (m_pRenderStatus->m_bPrint && !(m_pRenderStatus->m_pDevice->GetRenderCaps() & FXRC_BLEND_MODE)) {
+ m_Result = FALSE;
+ return FALSE;
+ }
+ FX_RECT rect = m_ImageMatrix.GetUnitRect().GetOutterRect();
+ rect.Intersect(m_pRenderStatus->m_pDevice->GetClipBox());
+ if (rect.IsEmpty()) {
+ return FALSE;
+ }
+ CFX_AffineMatrix new_matrix = m_ImageMatrix;
+ new_matrix.TranslateI(-rect.left, -rect.top);
+ int width = rect.Width();
+ int height = rect.Height();
+ CFX_FxgeDevice bitmap_device1;
+ if (!bitmap_device1.Create(rect.Width(), rect.Height(), FXDIB_Rgb32)) {
+ return TRUE;
+ }
+ bitmap_device1.GetBitmap()->Clear(0xffffff);
+ {
+ CPDF_RenderStatus bitmap_render;
+ bitmap_render.Initialize(m_pRenderStatus->m_Level + 1, m_pRenderStatus->m_pContext, &bitmap_device1, NULL, NULL,
+ NULL, NULL, &m_pRenderStatus->m_Options, 0, m_pRenderStatus->m_bDropObjects, NULL, TRUE);
+ CFX_Matrix patternDevice = *pObj2Device;
+ patternDevice.Translate((FX_FLOAT) - rect.left, (FX_FLOAT) - rect.top);
+ if(m_pPattern->m_PatternType == PATTERN_TILING) {
+ bitmap_render.DrawTilingPattern((CPDF_TilingPattern*)m_pPattern, m_pImageObject, &patternDevice, FALSE);
+ } else {
+ bitmap_render.DrawShadingPattern((CPDF_ShadingPattern*)m_pPattern, m_pImageObject, &patternDevice, FALSE);
+ }
+ }
+ {
+ CFX_FxgeDevice bitmap_device2;
+ if (!bitmap_device2.Create(rect.Width(), rect.Height(), FXDIB_8bppRgb)) {
+ return TRUE;
+ }
+ bitmap_device2.GetBitmap()->Clear(0);
+ CPDF_RenderStatus bitmap_render;
+ bitmap_render.Initialize(m_pRenderStatus->m_Level + 1, m_pRenderStatus->m_pContext, &bitmap_device2, NULL, NULL,
+ NULL, NULL, NULL, 0, m_pRenderStatus->m_bDropObjects, NULL, TRUE);
+ CPDF_ImageRenderer image_render;
+ if (image_render.Start(&bitmap_render, m_pDIBSource, 0xffffffff, 255, &new_matrix, m_Flags, TRUE)) {
+ image_render.Continue(NULL);
+ }
+ if (m_Loader.m_MatteColor != 0xffffffff) {
+ int matte_r = FXARGB_R(m_Loader.m_MatteColor);
+ int matte_g = FXARGB_G(m_Loader.m_MatteColor);
+ int matte_b = FXARGB_B(m_Loader.m_MatteColor);
+ for (int row = 0; row < height; row ++) {
+ FX_LPBYTE dest_scan = (FX_LPBYTE)bitmap_device1.GetBitmap()->GetScanline(row);
+ FX_LPCBYTE mask_scan = bitmap_device2.GetBitmap()->GetScanline(row);
+ for (int col = 0; col < width; col ++) {
+ int alpha = *mask_scan ++;
+ if (alpha) {
+ int orig = (*dest_scan - matte_b) * 255 / alpha + matte_b;
+ if (orig < 0) {
+ orig = 0;
+ } else if (orig > 255) {
+ orig = 255;
+ }
+ *dest_scan++ = orig;
+ orig = (*dest_scan - matte_g) * 255 / alpha + matte_g;
+ if (orig < 0) {
+ orig = 0;
+ } else if (orig > 255) {
+ orig = 255;
+ }
+ *dest_scan++ = orig;
+ orig = (*dest_scan - matte_r) * 255 / alpha + matte_r;
+ if (orig < 0) {
+ orig = 0;
+ } else if (orig > 255) {
+ orig = 255;
+ }
+ *dest_scan++ = orig;
+ dest_scan ++;
+ } else {
+ dest_scan += 4;
+ }
+ }
+ }
+ }
+ bitmap_device2.GetBitmap()->ConvertFormat(FXDIB_8bppMask);
+ bitmap_device1.GetBitmap()->MultiplyAlpha(bitmap_device2.GetBitmap());
+ bitmap_device1.GetBitmap()->MultiplyAlpha(255);
+ }
+ m_pRenderStatus->m_pDevice->SetDIBits(bitmap_device1.GetBitmap(), rect.left, rect.top, m_BlendType);
+ return FALSE;
+}
+FX_BOOL CPDF_ImageRenderer::DrawMaskedImage()
+{
+ if (m_pRenderStatus->m_bPrint && !(m_pRenderStatus->m_pDevice->GetRenderCaps() & FXRC_BLEND_MODE)) {
+ m_Result = FALSE;
+ return FALSE;
+ }
+ FX_RECT rect = m_ImageMatrix.GetUnitRect().GetOutterRect();
+ rect.Intersect(m_pRenderStatus->m_pDevice->GetClipBox());
+ if (rect.IsEmpty()) {
+ return FALSE;
+ }
+ CFX_AffineMatrix new_matrix = m_ImageMatrix;
+ new_matrix.TranslateI(-rect.left, -rect.top);
+ int width = rect.Width();
+ int height = rect.Height();
+ CFX_FxgeDevice bitmap_device1;
+ if (!bitmap_device1.Create(width, height, FXDIB_Rgb32)) {
+ return TRUE;
+ }
+ bitmap_device1.GetBitmap()->Clear(0xffffff);
+ {
+ CPDF_RenderStatus bitmap_render;
+ bitmap_render.Initialize(m_pRenderStatus->m_Level + 1, m_pRenderStatus->m_pContext, &bitmap_device1, NULL, NULL,
+ NULL, NULL, NULL, 0, m_pRenderStatus->m_bDropObjects, NULL, TRUE);
+ CPDF_ImageRenderer image_render;
+ if (image_render.Start(&bitmap_render, m_pDIBSource, 0, 255, &new_matrix, m_Flags, TRUE)) {
+ image_render.Continue(NULL);
+ }
+ }
+ {
+ CFX_FxgeDevice bitmap_device2;
+ if (!bitmap_device2.Create(width, height, FXDIB_8bppRgb)) {
+ return TRUE;
+ }
+ bitmap_device2.GetBitmap()->Clear(0);
+ CPDF_RenderStatus bitmap_render;
+ bitmap_render.Initialize(m_pRenderStatus->m_Level + 1, m_pRenderStatus->m_pContext, &bitmap_device2, NULL, NULL,
+ NULL, NULL, NULL, 0, m_pRenderStatus->m_bDropObjects, NULL, TRUE);
+ CPDF_ImageRenderer image_render;
+ if (image_render.Start(&bitmap_render, m_Loader.m_pMask, 0xffffffff, 255, &new_matrix, m_Flags, TRUE)) {
+ image_render.Continue(NULL);
+ }
+ if (m_Loader.m_MatteColor != 0xffffffff) {
+ int matte_r = FXARGB_R(m_Loader.m_MatteColor);
+ int matte_g = FXARGB_G(m_Loader.m_MatteColor);
+ int matte_b = FXARGB_B(m_Loader.m_MatteColor);
+ for (int row = 0; row < height; row ++) {
+ FX_LPBYTE dest_scan = (FX_LPBYTE)bitmap_device1.GetBitmap()->GetScanline(row);
+ FX_LPCBYTE mask_scan = bitmap_device2.GetBitmap()->GetScanline(row);
+ for (int col = 0; col < width; col ++) {
+ int alpha = *mask_scan ++;
+ if (alpha) {
+ int orig = (*dest_scan - matte_b) * 255 / alpha + matte_b;
+ if (orig < 0) {
+ orig = 0;
+ } else if (orig > 255) {
+ orig = 255;
+ }
+ *dest_scan++ = orig;
+ orig = (*dest_scan - matte_g) * 255 / alpha + matte_g;
+ if (orig < 0) {
+ orig = 0;
+ } else if (orig > 255) {
+ orig = 255;
+ }
+ *dest_scan++ = orig;
+ orig = (*dest_scan - matte_r) * 255 / alpha + matte_r;
+ if (orig < 0) {
+ orig = 0;
+ } else if (orig > 255) {
+ orig = 255;
+ }
+ *dest_scan++ = orig;
+ dest_scan ++;
+ } else {
+ dest_scan += 4;
+ }
+ }
+ }
+ }
+ bitmap_device2.GetBitmap()->ConvertFormat(FXDIB_8bppMask);
+ bitmap_device1.GetBitmap()->MultiplyAlpha(bitmap_device2.GetBitmap());
+ if (m_BitmapAlpha < 255) {
+ bitmap_device1.GetBitmap()->MultiplyAlpha(m_BitmapAlpha);
+ }
+ }
+ m_pRenderStatus->m_pDevice->SetDIBits(bitmap_device1.GetBitmap(), rect.left, rect.top, m_BlendType);
+ return FALSE;
+}
+FX_BOOL CPDF_ImageRenderer::StartDIBSource()
+{
+#if !defined(_FPDFAPI_MINI_)
+ if (!(m_Flags & RENDER_FORCE_DOWNSAMPLE) && m_pDIBSource->GetBPP() > 1) {
+ int image_size = m_pDIBSource->GetBPP() / 8 * m_pDIBSource->GetWidth() * m_pDIBSource->GetHeight();
+ if (image_size > FPDF_HUGE_IMAGE_SIZE && !(m_Flags & RENDER_FORCE_HALFTONE)) {
+ m_Flags |= RENDER_FORCE_DOWNSAMPLE;
+ }
+ }
+#endif
+ if (m_pRenderStatus->m_pDevice->StartDIBits(m_pDIBSource, m_BitmapAlpha, m_FillArgb,
+ &m_ImageMatrix, m_Flags, m_DeviceHandle, 0, NULL, m_BlendType)) {
+ if (m_DeviceHandle != NULL) {
+ m_Status = 3;
+ return TRUE;
+ }
+ return FALSE;
+ }
+#if !defined(_FPDFAPI_MINI_) || defined(_FXCORE_FEATURE_ALL_)
+ CFX_FloatRect image_rect_f = m_ImageMatrix.GetUnitRect();
+ FX_RECT image_rect = image_rect_f.GetOutterRect();
+ int dest_width = image_rect.Width();
+ int dest_height = image_rect.Height();
+ if ((FXSYS_fabs(m_ImageMatrix.b) >= 0.5f || m_ImageMatrix.a == 0) ||
+ (FXSYS_fabs(m_ImageMatrix.c) >= 0.5f || m_ImageMatrix.d == 0) ) {
+ if (m_pRenderStatus->m_bPrint && !(m_pRenderStatus->m_pDevice->GetRenderCaps() & FXRC_BLEND_MODE)) {
+ m_Result = FALSE;
+ return FALSE;
+ }
+ FX_RECT clip_box = m_pRenderStatus->m_pDevice->GetClipBox();
+ clip_box.Intersect(image_rect);
+ m_Status = 2;
+ m_pTransformer = FX_NEW CFX_ImageTransformer;
+ m_pTransformer->Start(m_pDIBSource, &m_ImageMatrix, m_Flags, &clip_box);
+ return TRUE;
+ }
+ if (m_ImageMatrix.a < 0) {
+ dest_width = -dest_width;
+ }
+ if (m_ImageMatrix.d > 0) {
+ dest_height = -dest_height;
+ }
+ int dest_left, dest_top;
+ dest_left = dest_width > 0 ? image_rect.left : image_rect.right;
+ dest_top = dest_height > 0 ? image_rect.top : image_rect.bottom;
+ if (m_pDIBSource->IsOpaqueImage() && m_BitmapAlpha == 255) {
+ if (m_pRenderStatus->m_pDevice->StretchDIBits(m_pDIBSource, dest_left, dest_top,
+ dest_width, dest_height, m_Flags, NULL, m_BlendType)) {
+ return FALSE;
+ }
+ }
+ if (m_pDIBSource->IsAlphaMask()) {
+ if (m_BitmapAlpha != 255) {
+ m_FillArgb = FXARGB_MUL_ALPHA(m_FillArgb, m_BitmapAlpha);
+ }
+ if (m_pRenderStatus->m_pDevice->StretchBitMask(m_pDIBSource, dest_left, dest_top, dest_width, dest_height, m_FillArgb, m_Flags)) {
+ return FALSE;
+ }
+ }
+ if (m_pRenderStatus->m_bPrint && !(m_pRenderStatus->m_pDevice->GetRenderCaps() & FXRC_BLEND_MODE)) {
+ m_Result = FALSE;
+ return TRUE;
+ }
+ FX_RECT clip_box = m_pRenderStatus->m_pDevice->GetClipBox();
+ FX_RECT dest_rect = clip_box;
+ dest_rect.Intersect(image_rect);
+ FX_RECT dest_clip(dest_rect.left - image_rect.left, dest_rect.top - image_rect.top,
+ dest_rect.right - image_rect.left, dest_rect.bottom - image_rect.top);
+ CFX_DIBitmap* pStretched = m_pDIBSource->StretchTo(dest_width, dest_height, m_Flags, &dest_clip);
+ if (pStretched) {
+ m_pRenderStatus->CompositeDIBitmap(pStretched, dest_rect.left, dest_rect.top, m_FillArgb,
+ m_BitmapAlpha, m_BlendType, FALSE);
+ delete pStretched;
+ pStretched = NULL;
+ }
+#endif
+ return FALSE;
+}
+FX_BOOL CPDF_ImageRenderer::StartBitmapAlpha()
+{
+#ifndef _FPDFAPI_MINI_
+ if (m_pDIBSource->IsOpaqueImage()) {
+ CFX_PathData path;
+ path.AppendRect(0, 0, 1, 1);
+ path.Transform(&m_ImageMatrix);
+ FX_DWORD fill_color = ArgbEncode(0xff, m_BitmapAlpha, m_BitmapAlpha, m_BitmapAlpha);
+ m_pRenderStatus->m_pDevice->DrawPath(&path, NULL, NULL, fill_color, 0, FXFILL_WINDING);
+ } else {
+ const CFX_DIBSource* pAlphaMask = m_pDIBSource->IsAlphaMask() ? m_pDIBSource : m_pDIBSource->GetAlphaMask();
+ if (FXSYS_fabs(m_ImageMatrix.b) >= 0.5f || FXSYS_fabs(m_ImageMatrix.c) >= 0.5f) {
+ int left, top;
+ CFX_DIBitmap* pTransformed = pAlphaMask->TransformTo(&m_ImageMatrix, left, top);
+ if (pTransformed == NULL) {
+ return TRUE;
+ }
+ m_pRenderStatus->m_pDevice->SetBitMask(pTransformed, left, top, ArgbEncode(0xff, m_BitmapAlpha, m_BitmapAlpha, m_BitmapAlpha));
+ delete pTransformed;
+ } else {
+ CFX_FloatRect image_rect_f = m_ImageMatrix.GetUnitRect();
+ FX_RECT image_rect = image_rect_f.GetOutterRect();
+ int dest_width = m_ImageMatrix.a > 0 ? image_rect.Width() : -image_rect.Width();
+ int dest_height = m_ImageMatrix.d > 0 ? -image_rect.Height() : image_rect.Height();
+ int left = dest_width > 0 ? image_rect.left : image_rect.right;
+ int top = dest_height > 0 ? image_rect.top : image_rect.bottom;
+ m_pRenderStatus->m_pDevice->StretchBitMask(pAlphaMask, left, top, dest_width, dest_height,
+ ArgbEncode(0xff, m_BitmapAlpha, m_BitmapAlpha, m_BitmapAlpha));
+ }
+ if (m_pDIBSource != pAlphaMask) {
+ delete pAlphaMask;
+ }
+ }
+#endif
+ return FALSE;
+}
+FX_BOOL CPDF_ImageRenderer::Continue(IFX_Pause* pPause)
+{
+ if (m_Status == 1) {
+#ifndef _FPDFAPI_MINI_
+ if (m_pQuickStretcher->Continue(pPause)) {
+ return TRUE;
+ }
+ if (m_pQuickStretcher->m_pBitmap->IsAlphaMask())
+ m_pRenderStatus->m_pDevice->SetBitMask(m_pQuickStretcher->m_pBitmap, m_pQuickStretcher->m_ResultLeft,
+ m_pQuickStretcher->m_ResultTop, m_FillArgb);
+ else
+ m_pRenderStatus->m_pDevice->SetDIBits(m_pQuickStretcher->m_pBitmap, m_pQuickStretcher->m_ResultLeft,
+ m_pQuickStretcher->m_ResultTop, m_BlendType);
+ return FALSE;
+#endif
+ } else if (m_Status == 2) {
+#if !defined(_FPDFAPI_MINI_) || defined(_FXCORE_FEATURE_ALL_)
+ if (m_pTransformer->Continue(pPause)) {
+ return TRUE;
+ }
+ CFX_DIBitmap* pBitmap = m_pTransformer->m_Storer.Detach();
+ if (pBitmap == NULL) {
+ return FALSE;
+ }
+ if (pBitmap->IsAlphaMask()) {
+ if (m_BitmapAlpha != 255) {
+ m_FillArgb = FXARGB_MUL_ALPHA(m_FillArgb, m_BitmapAlpha);
+ }
+ m_Result = m_pRenderStatus->m_pDevice->SetBitMask(pBitmap,
+ m_pTransformer->m_ResultLeft, m_pTransformer->m_ResultTop, m_FillArgb);
+ } else {
+ if (m_BitmapAlpha != 255) {
+ pBitmap->MultiplyAlpha(m_BitmapAlpha);
+ }
+ m_Result = m_pRenderStatus->m_pDevice->SetDIBits(pBitmap,
+ m_pTransformer->m_ResultLeft, m_pTransformer->m_ResultTop, m_BlendType);
+ }
+ delete pBitmap;
+ return FALSE;
+#endif
+ } else if (m_Status == 3) {
+ return m_pRenderStatus->m_pDevice->ContinueDIBits(m_DeviceHandle, pPause);
+ } else if (m_Status == 4) {
+ if (m_Loader.Continue(m_LoadHandle, pPause)) {
+ return TRUE;
+ }
+ if (StartRenderDIBSource()) {
+ return Continue(pPause);
+ }
+ return FALSE;
+ }
+ return FALSE;
+}
+CPDF_QuickStretcher::CPDF_QuickStretcher()
+{
+ m_pBitmap = NULL;
+ m_pDecoder = NULL;
+ m_pCS = NULL;
+}
+CPDF_QuickStretcher::~CPDF_QuickStretcher()
+{
+ if (m_pBitmap) {
+ delete m_pBitmap;
+ }
+ if (m_pCS) {
+ m_pCS->ReleaseCS();
+ }
+ if (m_pDecoder) {
+ delete m_pDecoder;
+ }
+}
+ICodec_ScanlineDecoder* FPDFAPI_CreateFlateDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height,
+ int nComps, int bpc, const CPDF_Dictionary* pParams);
+FX_BOOL CPDF_QuickStretcher::Start(CPDF_ImageObject* pImageObj, CFX_AffineMatrix* pImage2Device, const FX_RECT* pClipBox)
+{
+ if (FXSYS_fabs(pImage2Device->a) < FXSYS_fabs(pImage2Device->b) * 10 && FXSYS_fabs(pImage2Device->d) < FXSYS_fabs(pImage2Device->c) * 10) {
+ return FALSE;
+ }
+ CFX_FloatRect image_rect_f = pImage2Device->GetUnitRect();
+ FX_RECT image_rect = image_rect_f.GetOutterRect();
+ m_DestWidth = image_rect.Width();
+ m_DestHeight = image_rect.Height();
+ m_bFlipX = pImage2Device->a < 0;
+ m_bFlipY = pImage2Device->d > 0;
+ FX_RECT result_rect = *pClipBox;
+ result_rect.Intersect(image_rect);
+ if (result_rect.IsEmpty()) {
+ return FALSE;
+ }
+ m_ResultWidth = result_rect.Width();
+ m_ResultHeight = result_rect.Height();
+ m_ResultLeft = result_rect.left;
+ m_ResultTop = result_rect.top;
+ m_ClipLeft = result_rect.left - image_rect.left;
+ m_ClipTop = result_rect.top - image_rect.top;
+ CPDF_Dictionary* pDict = pImageObj->m_pImage->GetDict();
+ if (pDict->GetInteger(FX_BSTRC("BitsPerComponent")) != 8) {
+ return FALSE;
+ }
+ if (pDict->KeyExist(FX_BSTRC("SMask")) || pDict->KeyExist(FX_BSTRC("Mask"))) {
+ return FALSE;
+ }
+ m_SrcWidth = pDict->GetInteger(FX_BSTRC("Width"));
+ m_SrcHeight = pDict->GetInteger(FX_BSTRC("Height"));
+ m_pCS = NULL;
+ m_Bpp = 3;
+ CPDF_Object* pCSObj = pDict->GetElementValue(FX_BSTRC("ColorSpace"));
+ if (pCSObj == NULL) {
+ return FALSE;
+ }
+ m_pCS = CPDF_ColorSpace::Load(pImageObj->m_pImage->GetDocument(), pCSObj);
+ if (m_pCS == NULL) {
+ return FALSE;
+ }
+ if (!_IsSupported(m_pCS)) {
+ return FALSE;
+ }
+ m_Bpp = m_pCS->CountComponents();
+ if (m_pCS->sRGB()) {
+ m_pCS->ReleaseCS();
+ m_pCS = NULL;
+ }
+ CPDF_Stream* pStream = pImageObj->m_pImage->GetStream();
+ m_StreamAcc.LoadAllData(pStream, FALSE, m_SrcWidth * m_SrcHeight * m_Bpp, TRUE);
+ m_pDecoder = NULL;
+ if (!m_StreamAcc.GetImageDecoder().IsEmpty()) {
+ if (m_StreamAcc.GetImageDecoder() == FX_BSTRC("DCTDecode")) {
+ const CPDF_Dictionary* pParam = m_StreamAcc.GetImageParam();
+ m_pDecoder = CPDF_ModuleMgr::Get()->GetJpegModule()->CreateDecoder(
+ m_StreamAcc.GetData(), m_StreamAcc.GetSize(), m_SrcWidth, m_SrcHeight, m_Bpp,
+ pParam ? pParam->GetInteger(FX_BSTRC("ColorTransform"), 1) : 1);
+ } else if (m_StreamAcc.GetImageDecoder() == FX_BSTRC("FlateDecode")) {
+ m_pDecoder = FPDFAPI_CreateFlateDecoder(
+ m_StreamAcc.GetData(), m_StreamAcc.GetSize(), m_SrcWidth, m_SrcHeight, m_Bpp, 8,
+ m_StreamAcc.GetImageParam());
+ } else {
+ return FALSE;
+ }
+ m_pDecoder->DownScale(m_DestWidth, m_DestHeight);
+ }
+ m_pBitmap = FX_NEW CFX_DIBitmap;
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
+ m_pBitmap->Create(m_ResultWidth, m_ResultHeight, FXDIB_Rgb32);
+#else
+ m_pBitmap->Create(m_ResultWidth, m_ResultHeight, FXDIB_Rgb);
+#endif
+ m_LineIndex = 0;
+ return TRUE;
+}
+FX_BOOL CPDF_QuickStretcher::Continue(IFX_Pause* pPause)
+{
+ FX_LPBYTE result_buf = m_pBitmap->GetBuffer();
+ int src_width = m_pDecoder ? m_pDecoder->GetWidth() : m_SrcWidth;
+ int src_height = m_pDecoder ? m_pDecoder->GetHeight() : m_SrcHeight;
+ int src_pitch = src_width * m_Bpp;
+ while (m_LineIndex < m_ResultHeight) {
+ int dest_y, src_y;
+ if (m_bFlipY) {
+ dest_y = m_ResultHeight - m_LineIndex - 1;
+ src_y = (m_DestHeight - (dest_y + m_ClipTop) - 1) * src_height / m_DestHeight;
+ } else {
+ dest_y = m_LineIndex;
+ src_y = (dest_y + m_ClipTop) * src_height / m_DestHeight;
+ }
+ FX_LPCBYTE src_scan;
+ if (m_pDecoder) {
+ src_scan = m_pDecoder->GetScanline(src_y);
+ if (src_scan == NULL) {
+ break;
+ }
+ } else {
+ src_scan = m_StreamAcc.GetData();
+ if (src_scan == NULL) {
+ break;
+ }
+ src_scan += src_y * src_pitch;
+ }
+ FX_LPBYTE result_scan = result_buf + dest_y * m_pBitmap->GetPitch();
+ for (int x = 0; x < m_ResultWidth; x ++) {
+ int dest_x = m_ClipLeft + x;
+ int src_x = (m_bFlipX ? (m_DestWidth - dest_x - 1) : dest_x) * src_width / m_DestWidth;
+ FX_LPCBYTE src_pixel = src_scan + src_x * m_Bpp;
+ if (m_pCS == NULL) {
+ *result_scan = src_pixel[2];
+ result_scan ++;
+ *result_scan = src_pixel[1];
+ result_scan ++;
+ *result_scan = src_pixel[0];
+ result_scan ++;
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
+ result_scan ++;
+#endif
+ } else {
+ m_pCS->TranslateImageLine(result_scan, src_pixel, 1, 0, 0);
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
+ result_scan += 4;
+#else
+ result_scan += 3;
+#endif
+ }
+ }
+ m_LineIndex ++;
+ if (pPause && pPause->NeedToPauseNow()) {
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+CFX_DIBitmap* CPDF_RenderStatus::LoadSMask(CPDF_Dictionary* pSMaskDict,
+ FX_RECT* pClipRect, const CFX_AffineMatrix* pMatrix)
+{
+ if (pSMaskDict == NULL) {
+ return NULL;
+ }
+ CFX_DIBitmap* pMask = NULL;
+ int width = pClipRect->right - pClipRect->left;
+ int height = pClipRect->bottom - pClipRect->top;
+ FX_BOOL bLuminosity = FALSE;
+ bLuminosity = pSMaskDict->GetConstString(FX_BSTRC("S")) != FX_BSTRC("Alpha");
+ CPDF_Stream* pGroup = pSMaskDict->GetStream(FX_BSTRC("G"));
+ if (pGroup == NULL) {
+ return NULL;
+ }
+ CPDF_Function* pFunc = NULL;
+ CPDF_Object* pFuncObj = pSMaskDict->GetElementValue(FX_BSTRC("TR"));
+ if (pFuncObj && (pFuncObj->GetType() == PDFOBJ_DICTIONARY || pFuncObj->GetType() == PDFOBJ_STREAM)) {
+ pFunc = CPDF_Function::Load(pFuncObj);
+ }
+ CFX_AffineMatrix matrix = *pMatrix;
+ matrix.TranslateI(-pClipRect->left, -pClipRect->top);
+ CPDF_Form form(m_pContext->m_pDocument, m_pContext->m_pPageResources, pGroup);
+ form.ParseContent(NULL, NULL, NULL, NULL);
+ CFX_FxgeDevice bitmap_device;
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
+ if (!bitmap_device.Create(width, height, bLuminosity ? FXDIB_Rgb32 : FXDIB_8bppMask)) {
+ return NULL;
+ }
+#else
+ if (!bitmap_device.Create(width, height, bLuminosity ? FXDIB_Rgb : FXDIB_8bppMask)) {
+ return NULL;
+ }
+#endif
+ CFX_DIBitmap& bitmap = *bitmap_device.GetBitmap();
+ CPDF_Object* pCSObj = NULL;
+ CPDF_ColorSpace* pCS = NULL;
+ if (bLuminosity) {
+ CPDF_Array* pBC = pSMaskDict->GetArray(FX_BSTRC("BC"));
+ FX_ARGB back_color = 0xff000000;
+ if (pBC) {
+ pCSObj = pGroup->GetDict()->GetDict(FX_BSTRC("Group"))->GetElementValue(FX_BSTRC("CS"));
+ pCS = m_pContext->m_pDocument->LoadColorSpace(pCSObj);
+ if (pCS) {
+ FX_FLOAT R, G, B;
+ FX_DWORD num_floats = 8;
+ if (pCS->CountComponents() > (FX_INT32)num_floats) {
+ num_floats = (FX_DWORD)pCS->CountComponents();
+ }
+ CFX_FixedBufGrow<FX_FLOAT, 8> float_array(num_floats);
+ FX_FLOAT* pFloats = float_array;
+ FXSYS_memset32(pFloats, 0, num_floats * sizeof(FX_FLOAT));
+ int count = pBC->GetCount() > 8 ? 8 : pBC->GetCount();
+ for (int i = 0; i < count; i ++) {
+ pFloats[i] = pBC->GetNumber(i);
+ }
+ pCS->GetRGB(pFloats, R, G, B);
+ back_color = 0xff000000 | ((FX_INT32)(R * 255) << 16) | ((FX_INT32)(G * 255) << 8) | (FX_INT32)(B * 255);
+ m_pContext->m_pDocument->GetPageData()->ReleaseColorSpace(pCSObj);
+ }
+ }
+ bitmap.Clear(back_color);
+ } else {
+ bitmap.Clear(0);
+ }
+ CPDF_Dictionary* pFormResource = NULL;
+ if (form.m_pFormDict) {
+ pFormResource = form.m_pFormDict->GetDict(FX_BSTRC("Resources"));
+ }
+ CPDF_RenderOptions options;
+ options.m_ColorMode = bLuminosity ? RENDER_COLOR_NORMAL : RENDER_COLOR_ALPHA;
+ CPDF_RenderStatus status;
+ status.Initialize(m_Level + 1, m_pContext, &bitmap_device, NULL, NULL, NULL, NULL,
+ &options, 0, m_bDropObjects, pFormResource, TRUE, NULL, 0, pCS ? pCS->GetFamily() : 0, bLuminosity);
+ status.RenderObjectList(&form, &matrix);
+ pMask = FX_NEW CFX_DIBitmap;
+ if (!pMask->Create(width, height, FXDIB_8bppMask)) {
+ delete pMask;
+ return NULL;
+ }
+ FX_LPBYTE dest_buf = pMask->GetBuffer();
+ int dest_pitch = pMask->GetPitch();
+ FX_LPBYTE src_buf = bitmap.GetBuffer();
+ int src_pitch = bitmap.GetPitch();
+ FX_LPBYTE pTransfer = FX_Alloc(FX_BYTE, 256);
+ if (pFunc) {
+ CFX_FixedBufGrow<FX_FLOAT, 16> results(pFunc->CountOutputs());
+ for (int i = 0; i < 256; i ++) {
+ FX_FLOAT input = (FX_FLOAT)i / 255.0f;
+ int nresult;
+ pFunc->Call(&input, 1, results, nresult);
+ pTransfer[i] = FXSYS_round(results[0] * 255);
+ }
+ } else {
+ for (int i = 0; i < 256; i ++) {
+ pTransfer[i] = i;
+ }
+ }
+ if (bLuminosity) {
+ int Bpp = bitmap.GetBPP() / 8;
+ for (int row = 0; row < height; row ++) {
+ FX_LPBYTE dest_pos = dest_buf + row * dest_pitch;
+ FX_LPBYTE src_pos = src_buf + row * src_pitch;
+ for (int col = 0; col < width; col ++) {
+ *dest_pos ++ = pTransfer[FXRGB2GRAY(src_pos[2], src_pos[1], *src_pos)];
+ src_pos += Bpp;
+ }
+ }
+ } else if (pFunc) {
+ int size = dest_pitch * height;
+ for (int i = 0; i < size; i ++) {
+ dest_buf[i] = pTransfer[src_buf[i]];
+ }
+ } else {
+ FXSYS_memcpy32(dest_buf, src_buf, dest_pitch * height);
+ }
+ if (pFunc) {
+ delete pFunc;
+ }
+ FX_Free(pTransfer);
+ return pMask;
+}
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
index fcb5271cc3..e67b46c931 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
@@ -1,1524 +1,1524 @@
-// 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
-
-#include "../../../include/fxge/fx_ge.h"
-#include "../../../include/fxcodec/fx_codec.h"
-#include "../../../include/fpdfapi/fpdf_module.h"
-#include "../../../include/fpdfapi/fpdf_render.h"
-#include "../../../include/fpdfapi/fpdf_pageobj.h"
-#include "../fpdf_page/pageint.h"
-#include "render_int.h"
-#include <limits.h>
-static unsigned int _GetBits8(FX_LPCBYTE pData, int bitpos, int nbits)
-{
- unsigned int byte = pData[bitpos / 8];
- if (nbits == 8) {
- return byte;
- } else if (nbits == 4) {
- return (bitpos % 8) ? (byte & 0x0f) : (byte >> 4);
- } else if (nbits == 2) {
- return (byte >> (6 - bitpos % 8)) & 0x03;
- } else if (nbits == 1) {
- return (byte >> (7 - bitpos % 8)) & 0x01;
- } else if (nbits == 16) {
- return byte * 256 + pData[bitpos / 8 + 1];
- }
- return 0;
-}
-CFX_DIBSource* CPDF_Image::LoadDIBSource(CFX_DIBSource** ppMask, FX_DWORD* pMatteColor, FX_BOOL bStdCS, FX_DWORD GroupFamily, FX_BOOL bLoadMask) const
-{
- CPDF_DIBSource* pSource = FX_NEW CPDF_DIBSource;
- if (pSource->Load(m_pDocument, m_pStream, (CPDF_DIBSource**)ppMask, pMatteColor, NULL, NULL, bStdCS, GroupFamily, bLoadMask)) {
- return pSource;
- }
- delete pSource;
- return NULL;
-}
-CFX_DIBSource* CPDF_Image::DetachBitmap()
-{
- CFX_DIBSource* pBitmap = m_pDIBSource;
- m_pDIBSource = NULL;
- return pBitmap;
-}
-CFX_DIBSource* CPDF_Image::DetachMask()
-{
- CFX_DIBSource* pBitmap = m_pMask;
- m_pMask = NULL;
- return pBitmap;
-}
-FX_BOOL CPDF_Image::StartLoadDIBSource(CPDF_Dictionary* pFormResource, CPDF_Dictionary* pPageResource, FX_BOOL bStdCS, FX_DWORD GroupFamily, FX_BOOL bLoadMask)
-{
- m_pDIBSource = FX_NEW CPDF_DIBSource;
- int ret = ((CPDF_DIBSource*)m_pDIBSource)->StartLoadDIBSource(m_pDocument, m_pStream, TRUE, pFormResource, pPageResource, bStdCS, GroupFamily, bLoadMask);
- if (ret == 2) {
- return TRUE;
- }
- if (!ret) {
- delete m_pDIBSource;
- m_pDIBSource = NULL;
- return FALSE;
- }
- m_pMask = ((CPDF_DIBSource*)m_pDIBSource)->DetachMask();
- m_MatteColor = ((CPDF_DIBSource*)m_pDIBSource)->m_MatteColor;
- return FALSE;
-}
-FX_BOOL CPDF_Image::Continue(IFX_Pause* pPause)
-{
- int ret = ((CPDF_DIBSource*)m_pDIBSource)->ContinueLoadDIBSource(pPause);
- if (ret == 2) {
- return TRUE;
- }
- if (!ret) {
- delete m_pDIBSource;
- m_pDIBSource = NULL;
- return FALSE;
- }
- m_pMask = ((CPDF_DIBSource*)m_pDIBSource)->DetachMask();
- m_MatteColor = ((CPDF_DIBSource*)m_pDIBSource)->m_MatteColor;
- return FALSE;
-}
-CPDF_DIBSource::CPDF_DIBSource()
-{
- m_pDocument = NULL;
- m_pStreamAcc = NULL;
- m_pDict = NULL;
- m_bpp = 0;
- m_Width = m_Height = 0;
- m_pColorSpace = NULL;
- m_bDefaultDecode = TRUE;
- m_bImageMask = FALSE;
- m_pPalette = NULL;
- m_pCompData = NULL;
- m_bColorKey = FALSE;
- m_pMaskedLine = m_pLineBuf = NULL;
- m_pCachedBitmap = NULL;
- m_pDecoder = NULL;
- m_nComponents = 0;
- m_bpc = 0;
- m_bLoadMask = FALSE;
- m_Family = 0;
- m_pMask = NULL;
- m_MatteColor = 0;
- m_pJbig2Context = NULL;
- m_pGlobalStream = NULL;
- m_bStdCS = FALSE;
- m_pMaskStream = NULL;
- m_Status = 0;
- m_bHasMask = FALSE;
-}
-CPDF_DIBSource::~CPDF_DIBSource()
-{
- if (m_pStreamAcc) {
- delete m_pStreamAcc;
- }
- if (m_pMaskedLine) {
- FX_Free(m_pMaskedLine);
- }
- if (m_pLineBuf) {
- FX_Free(m_pLineBuf);
- }
- if (m_pCachedBitmap) {
- delete m_pCachedBitmap;
- }
- if (m_pDecoder) {
- delete m_pDecoder;
- }
- if (m_pCompData) {
- FX_Free(m_pCompData);
- }
- CPDF_ColorSpace* pCS = m_pColorSpace;
- if (pCS && m_pDocument) {
- m_pDocument->GetPageData()->ReleaseColorSpace(pCS->GetArray());
- }
- if (m_pJbig2Context) {
- ICodec_Jbig2Module* pJbig2Moudle = CPDF_ModuleMgr::Get()->GetJbig2Module();
- pJbig2Moudle->DestroyJbig2Context(m_pJbig2Context);
- m_pJbig2Context = NULL;
- }
- if (m_pGlobalStream) {
- delete m_pGlobalStream;
- }
- m_pGlobalStream = NULL;
-}
-CFX_DIBitmap* CPDF_DIBSource::GetBitmap() const
-{
- if (m_pCachedBitmap) {
- return m_pCachedBitmap;
- }
- return Clone();
-}
-void CPDF_DIBSource::ReleaseBitmap(CFX_DIBitmap* pBitmap) const
-{
- if (pBitmap && pBitmap != m_pCachedBitmap) {
- delete pBitmap;
- }
-}
-FX_BOOL CPDF_DIBSource::Load(CPDF_Document* pDoc, const CPDF_Stream* pStream, CPDF_DIBSource** ppMask,
- FX_DWORD* pMatteColor, CPDF_Dictionary* pFormResources, CPDF_Dictionary* pPageResources, FX_BOOL bStdCS, FX_DWORD GroupFamily, FX_BOOL bLoadMask)
-{
- if (pStream == NULL) {
- return FALSE;
- }
- m_pDocument = pDoc;
- m_pDict = pStream->GetDict();
- m_pStream = pStream;
- m_Width = m_pDict->GetInteger(FX_BSTRC("Width"));
- m_Height = m_pDict->GetInteger(FX_BSTRC("Height"));
- if (m_Width <= 0 || m_Height <= 0 || m_Width > 0x01ffff || m_Height > 0x01ffff) {
- return FALSE;
- }
- m_GroupFamily = GroupFamily;
- m_bLoadMask = bLoadMask;
- if (!LoadColorInfo(m_pStream->GetObjNum() != 0 ? NULL : pFormResources, pPageResources)) {
- return FALSE;
- }
- FX_DWORD src_pitch = m_bpc;
- if (m_bpc != 0 && m_nComponents != 0) {
- if (src_pitch > 0 && m_nComponents > (unsigned)INT_MAX / src_pitch) {
- return FALSE;
- }
- src_pitch *= m_nComponents;
- if (src_pitch > 0 && (FX_DWORD)m_Width > (unsigned)INT_MAX / src_pitch) {
- return FALSE;
- }
- src_pitch *= m_Width;
- if (src_pitch + 7 < src_pitch) {
- return FALSE;
- }
- src_pitch += 7;
- src_pitch /= 8;
- if (src_pitch > 0 && (FX_DWORD)m_Height > (unsigned)INT_MAX / src_pitch) {
- return FALSE;
- }
- }
- m_pStreamAcc = FX_NEW CPDF_StreamAcc;
- m_pStreamAcc->LoadAllData(pStream, FALSE, m_Height * src_pitch, TRUE);
- if (m_pStreamAcc->GetSize() == 0 || m_pStreamAcc->GetData() == NULL) {
- return FALSE;
- }
- const CFX_ByteString& decoder = m_pStreamAcc->GetImageDecoder();
- if (!decoder.IsEmpty() && decoder == FX_BSTRC("CCITTFaxDecode")) {
- m_bpc = 1;
- }
- if (!CreateDecoder()) {
- return FALSE;
- }
- if (m_bImageMask) {
- m_bpp = 1;
- m_bpc = 1;
- m_nComponents = 1;
- m_AlphaFlag = 1;
- } else if (m_bpc * m_nComponents == 1) {
- m_bpp = 1;
- } else if (m_bpc * m_nComponents <= 8) {
- m_bpp = 8;
- } else {
- m_bpp = 24;
- }
- if (!m_bpc || !m_nComponents) {
- return FALSE;
- }
- m_Pitch = m_Width;
- if ((FX_DWORD)m_bpp > (unsigned)INT_MAX / m_Pitch) {
- return FALSE;
- }
- m_Pitch *= m_bpp;
- if (m_Pitch + 31 < m_Pitch) {
- return FALSE;
- }
- m_Pitch += 31;
- m_Pitch = m_Pitch / 32 * 4;
- m_pLineBuf = FX_Alloc(FX_BYTE, m_Pitch);
- if (m_pColorSpace && bStdCS) {
- m_pColorSpace->EnableStdConversion(TRUE);
- }
- LoadPalette();
- if (m_bColorKey) {
- m_bpp = 32;
- m_AlphaFlag = 2;
- m_Pitch = m_Width;
- if ((FX_DWORD)m_bpp > (unsigned)INT_MAX / m_Pitch) {
- return FALSE;
- }
- m_Pitch *= m_bpp;
- if (m_Pitch + 31 < m_Pitch) {
- return FALSE;
- }
- m_Pitch += 31;
- m_Pitch = m_Pitch / 32 * 4;
- m_pMaskedLine = FX_Alloc(FX_BYTE, m_Pitch);
- }
- if (ppMask) {
- *ppMask = LoadMask(*pMatteColor);
- }
- if (m_pColorSpace && bStdCS) {
- m_pColorSpace->EnableStdConversion(FALSE);
- }
- return TRUE;
-}
-int CPDF_DIBSource::ContinueToLoadMask()
-{
- if (m_bImageMask) {
- m_bpp = 1;
- m_bpc = 1;
- m_nComponents = 1;
- m_AlphaFlag = 1;
- } else if (m_bpc * m_nComponents == 1) {
- m_bpp = 1;
- } else if (m_bpc * m_nComponents <= 8) {
- m_bpp = 8;
- } else {
- m_bpp = 24;
- }
- if (!m_bpc || !m_nComponents) {
- return 0;
- }
- m_Pitch = m_Width;
- if ((FX_DWORD)m_bpp > (unsigned)INT_MAX / m_Pitch) {
- return 0;
- }
- m_Pitch *= m_bpp;
- if (m_Pitch + 31 < m_Pitch) {
- return 0;
- }
- m_Pitch += 31;
- m_Pitch = m_Pitch / 32 * 4;
- m_pLineBuf = FX_Alloc(FX_BYTE, m_Pitch);
- if (m_pColorSpace && m_bStdCS) {
- m_pColorSpace->EnableStdConversion(TRUE);
- }
- LoadPalette();
- if (m_bColorKey) {
- m_bpp = 32;
- m_AlphaFlag = 2;
- m_Pitch = m_Width;
- if ((FX_DWORD)m_bpp > (unsigned)INT_MAX / m_Pitch) {
- return 0;
- }
- m_Pitch *= m_bpp;
- if (m_Pitch + 31 < m_Pitch) {
- return 0;
- }
- m_Pitch += 31;
- m_Pitch = m_Pitch / 32 * 4;
- m_pMaskedLine = FX_Alloc(FX_BYTE, m_Pitch);
- }
- return 1;
-}
-int CPDF_DIBSource::StartLoadDIBSource(CPDF_Document* pDoc, const CPDF_Stream* pStream, FX_BOOL bHasMask,
- CPDF_Dictionary* pFormResources, CPDF_Dictionary* pPageResources,
- FX_BOOL bStdCS, FX_DWORD GroupFamily, FX_BOOL bLoadMask)
-{
- if (pStream == NULL) {
- return 0;
- }
- m_pDocument = pDoc;
- m_pDict = pStream->GetDict();
- m_pStream = pStream;
- m_bStdCS = bStdCS;
- m_bHasMask = bHasMask;
- m_Width = m_pDict->GetInteger(FX_BSTRC("Width"));
- m_Height = m_pDict->GetInteger(FX_BSTRC("Height"));
- if (m_Width <= 0 || m_Height <= 0 || m_Width > 0x01ffff || m_Height > 0x01ffff) {
- return 0;
- }
- m_GroupFamily = GroupFamily;
- m_bLoadMask = bLoadMask;
- if (!LoadColorInfo(m_pStream->GetObjNum() != 0 ? NULL : pFormResources, pPageResources)) {
- return 0;
- }
- FX_DWORD src_pitch = m_bpc;
- if (m_bpc != 0 && m_nComponents != 0) {
- if (src_pitch > 0 && m_nComponents > (unsigned)INT_MAX / src_pitch) {
- return 0;
- }
- src_pitch *= m_nComponents;
- if (src_pitch > 0 && (FX_DWORD)m_Width > (unsigned)INT_MAX / src_pitch) {
- return 0;
- }
- src_pitch *= m_Width;
- if (src_pitch + 7 < src_pitch) {
- return 0;
- }
- src_pitch += 7;
- src_pitch /= 8;
- if (src_pitch > 0 && (FX_DWORD)m_Height > (unsigned)INT_MAX / src_pitch) {
- return 0;
- }
- }
- m_pStreamAcc = FX_NEW CPDF_StreamAcc;
- m_pStreamAcc->LoadAllData(pStream, FALSE, m_Height * src_pitch, TRUE);
- if (m_pStreamAcc->GetSize() == 0 || m_pStreamAcc->GetData() == NULL) {
- return 0;
- }
- const CFX_ByteString& decoder = m_pStreamAcc->GetImageDecoder();
- if (!decoder.IsEmpty() && decoder == FX_BSTRC("CCITTFaxDecode")) {
- m_bpc = 1;
- }
- int ret = CreateDecoder();
- if (ret != 1) {
- if (!ret) {
- return ret;
- }
- if (!ContinueToLoadMask()) {
- return 0;
- }
- if (m_bHasMask) {
- StratLoadMask();
- }
- return ret;
- }
- if (!ContinueToLoadMask()) {
- return 0;
- }
- if (m_bHasMask) {
- ret = StratLoadMask();
- }
- if (ret == 2) {
- return ret;
- }
- if (m_pColorSpace && m_bStdCS) {
- m_pColorSpace->EnableStdConversion(FALSE);
- }
- return ret;
-}
-int CPDF_DIBSource::ContinueLoadDIBSource(IFX_Pause* pPause)
-{
- FXCODEC_STATUS ret;
- if (m_Status == 1) {
- const CFX_ByteString& decoder = m_pStreamAcc->GetImageDecoder();
- if (decoder == FX_BSTRC("JPXDecode")) {
- return 0;
- }
- ICodec_Jbig2Module* pJbig2Moudle = CPDF_ModuleMgr::Get()->GetJbig2Module();
- if (m_pJbig2Context == NULL) {
- m_pJbig2Context = pJbig2Moudle->CreateJbig2Context();
- if (m_pStreamAcc->GetImageParam()) {
- CPDF_Stream* pGlobals = m_pStreamAcc->GetImageParam()->GetStream(FX_BSTRC("JBIG2Globals"));
- if (pGlobals) {
- m_pGlobalStream = FX_NEW CPDF_StreamAcc;
- m_pGlobalStream->LoadAllData(pGlobals, FALSE);
- }
- }
- ret = pJbig2Moudle->StartDecode(m_pJbig2Context, m_Width, m_Height, m_pStreamAcc->GetData(), m_pStreamAcc->GetSize(),
- m_pGlobalStream ? m_pGlobalStream->GetData() : NULL, m_pGlobalStream ? m_pGlobalStream->GetSize() : 0, m_pCachedBitmap->GetBuffer(),
- m_pCachedBitmap->GetPitch(), pPause);
- if (ret < 0) {
- delete m_pCachedBitmap;
- m_pCachedBitmap = NULL;
- if (m_pGlobalStream) {
- delete m_pGlobalStream;
- }
- m_pGlobalStream = NULL;
- pJbig2Moudle->DestroyJbig2Context(m_pJbig2Context);
- m_pJbig2Context = NULL;
- return 0;
- }
- if (ret == FXCODEC_STATUS_DECODE_TOBECONTINUE) {
- return 2;
- }
- int ret1 = 1;
- if (m_bHasMask) {
- ret1 = ContinueLoadMaskDIB(pPause);
- m_Status = 2;
- }
- if (ret1 == 2) {
- return ret1;
- }
- if (m_pColorSpace && m_bStdCS) {
- m_pColorSpace->EnableStdConversion(FALSE);
- }
- return ret1;
- }
- FXCODEC_STATUS ret = pJbig2Moudle->ContinueDecode(m_pJbig2Context, pPause);
- if (ret < 0) {
- delete m_pCachedBitmap;
- m_pCachedBitmap = NULL;
- if (m_pGlobalStream) {
- delete m_pGlobalStream;
- }
- m_pGlobalStream = NULL;
- pJbig2Moudle->DestroyJbig2Context(m_pJbig2Context);
- m_pJbig2Context = NULL;
- return 0;
- }
- if (ret == FXCODEC_STATUS_DECODE_TOBECONTINUE) {
- return 2;
- }
- int ret1 = 1;
- if (m_bHasMask) {
- ret1 = ContinueLoadMaskDIB(pPause);
- m_Status = 2;
- }
- if (ret1 == 2) {
- return ret1;
- }
- if (m_pColorSpace && m_bStdCS) {
- m_pColorSpace->EnableStdConversion(FALSE);
- }
- return ret1;
- } else if (m_Status == 2) {
- return ContinueLoadMaskDIB(pPause);
- }
- return 0;
-}
-FX_BOOL CPDF_DIBSource::LoadColorInfo(CPDF_Dictionary* pFormResources, CPDF_Dictionary* pPageResources)
-{
- if (m_pDict->GetInteger("ImageMask")) {
- m_bImageMask = TRUE;
- }
- if (m_bImageMask || !m_pDict->KeyExist(FX_BSTRC("ColorSpace"))) {
- if (!m_bImageMask) {
- CPDF_Object* pFilter = m_pDict->GetElementValue(FX_BSTRC("Filter"));
- if (pFilter) {
- CFX_ByteString filter;
- if (pFilter->GetType() == PDFOBJ_NAME) {
- filter = pFilter->GetString();
- if (filter == FX_BSTRC("JPXDecode")) {
- return TRUE;
- }
- } else if (pFilter->GetType() == PDFOBJ_ARRAY) {
- CPDF_Array* pArray = (CPDF_Array*)pFilter;
- if (pArray->GetString(pArray->GetCount() - 1) == FX_BSTRC("JPXDecode")) {
- return TRUE;
- }
- }
- }
- }
- m_bImageMask = TRUE;
- m_bpc = m_nComponents = 1;
- CPDF_Array* pDecode = m_pDict->GetArray(FX_BSTRC("Decode"));
- m_bDefaultDecode = pDecode == NULL || pDecode->GetInteger(0) == 0;
- return TRUE;
- }
- CPDF_Object* pCSObj = m_pDict->GetElementValue(FX_BSTRC("ColorSpace"));
- if (pCSObj == NULL) {
- return FALSE;
- }
- CPDF_DocPageData* pDocPageData = m_pDocument->GetPageData();
- if (pFormResources) {
- m_pColorSpace = pDocPageData->GetColorSpace(pCSObj, pFormResources);
- }
- if (m_pColorSpace == NULL) {
- m_pColorSpace = pDocPageData->GetColorSpace(pCSObj, pPageResources);
- }
- if (m_pColorSpace == NULL) {
- return FALSE;
- }
- m_bpc = m_pDict->GetInteger(FX_BSTRC("BitsPerComponent"));
- m_Family = m_pColorSpace->GetFamily();
- m_nComponents = m_pColorSpace->CountComponents();
- if (m_Family == PDFCS_ICCBASED && pCSObj->GetType() == PDFOBJ_NAME) {
- CFX_ByteString cs = pCSObj->GetString();
- if (cs == FX_BSTRC("DeviceGray")) {
- m_nComponents = 1;
- } else if (cs == FX_BSTRC("DeviceRGB")) {
- m_nComponents = 3;
- } else if (cs == FX_BSTRC("DeviceCMYK")) {
- m_nComponents = 4;
- }
- }
- m_pCompData = FX_Alloc(DIB_COMP_DATA, m_nComponents);
- if (m_bpc == 0) {
- return TRUE;
- }
- int max_data = (1 << m_bpc) - 1;
- CPDF_Array* pDecode = m_pDict->GetArray(FX_BSTRC("Decode"));
- if (pDecode) {
- for (FX_DWORD i = 0; i < m_nComponents; i ++) {
- m_pCompData[i].m_DecodeMin = pDecode->GetNumber(i * 2);
- FX_FLOAT max = pDecode->GetNumber(i * 2 + 1);
- m_pCompData[i].m_DecodeStep = (max - m_pCompData[i].m_DecodeMin) / max_data;
- FX_FLOAT def_value, def_min, def_max;
- m_pColorSpace->GetDefaultValue(i, def_value, def_min, def_max);
- if (m_Family == PDFCS_INDEXED) {
- def_max = (FX_FLOAT)max_data;
- }
- if (def_min != m_pCompData[i].m_DecodeMin || def_max != max) {
- m_bDefaultDecode = FALSE;
- }
- }
- } else {
- for (FX_DWORD i = 0; i < m_nComponents; i ++) {
- FX_FLOAT def_value;
- m_pColorSpace->GetDefaultValue(i, def_value, m_pCompData[i].m_DecodeMin, m_pCompData[i].m_DecodeStep);
- if (m_Family == PDFCS_INDEXED) {
- m_pCompData[i].m_DecodeStep = (FX_FLOAT)max_data;
- }
- m_pCompData[i].m_DecodeStep = (m_pCompData[i].m_DecodeStep - m_pCompData[i].m_DecodeMin) / max_data;
- }
- }
- if (!m_pDict->KeyExist(FX_BSTRC("SMask"))) {
- CPDF_Object* pMask = m_pDict->GetElementValue(FX_BSTRC("Mask"));
- if (pMask == NULL) {
- return TRUE;
- }
- if (pMask->GetType() == PDFOBJ_ARRAY) {
- CPDF_Array* pArray = (CPDF_Array*)pMask;
- if (pArray->GetCount() >= m_nComponents * 2)
- for (FX_DWORD i = 0; i < m_nComponents * 2; i ++) {
- if (i % 2) {
- m_pCompData[i / 2].m_ColorKeyMax = pArray->GetInteger(i);
- } else {
- m_pCompData[i / 2].m_ColorKeyMin = pArray->GetInteger(i);
- }
- }
- m_bColorKey = TRUE;
- }
- }
- return TRUE;
-}
-ICodec_ScanlineDecoder* FPDFAPI_CreateFaxDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height,
- const CPDF_Dictionary* pParams);
-ICodec_ScanlineDecoder* FPDFAPI_CreateFlateDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height,
- int nComps, int bpc, const CPDF_Dictionary* pParams);
-int CPDF_DIBSource::CreateDecoder()
-{
- const CFX_ByteString& decoder = m_pStreamAcc->GetImageDecoder();
- if (decoder.IsEmpty()) {
- return 1;
- }
- FX_LPCBYTE src_data = m_pStreamAcc->GetData();
- FX_DWORD src_size = m_pStreamAcc->GetSize();
- const CPDF_Dictionary* pParams = m_pStreamAcc->GetImageParam();
- if (decoder == FX_BSTRC("CCITTFaxDecode")) {
- m_pDecoder = FPDFAPI_CreateFaxDecoder(src_data, src_size, m_Width, m_Height, pParams);
- } else if (decoder == FX_BSTRC("DCTDecode")) {
- m_pDecoder = CPDF_ModuleMgr::Get()->GetJpegModule()->CreateDecoder(src_data, src_size, m_Width, m_Height,
- m_nComponents, pParams ? pParams->GetInteger(FX_BSTR("ColorTransform"), 1) : 1);
- if (NULL == m_pDecoder) {
- FX_BOOL bTransform = FALSE;
- int comps, bpc;
- ICodec_JpegModule* pJpegModule = CPDF_ModuleMgr::Get()->GetJpegModule();
- if (pJpegModule->LoadInfo(src_data, src_size, m_Width, m_Height, comps, bpc, bTransform)) {
- m_nComponents = comps;
- m_bpc = bpc;
- m_pDecoder = CPDF_ModuleMgr::Get()->GetJpegModule()->CreateDecoder(src_data, src_size, m_Width, m_Height,
- m_nComponents, bTransform);
- }
- }
- } else if (decoder == FX_BSTRC("FlateDecode")) {
- m_pDecoder = FPDFAPI_CreateFlateDecoder(src_data, src_size, m_Width, m_Height, m_nComponents, m_bpc, pParams);
- } else if (decoder == FX_BSTRC("JPXDecode")) {
- LoadJpxBitmap();
- return m_pCachedBitmap != NULL ? 1 : 0;
- } else if (decoder == FX_BSTRC("JBIG2Decode")) {
- m_pCachedBitmap = FX_NEW CFX_DIBitmap;
- if (!m_pCachedBitmap->Create(m_Width, m_Height, m_bImageMask ? FXDIB_1bppMask : FXDIB_1bppRgb)) {
- delete m_pCachedBitmap;
- m_pCachedBitmap = NULL;
- return 0;
- }
- m_Status = 1;
- return 2;
- } else if (decoder == FX_BSTRC("RunLengthDecode")) {
- m_pDecoder = CPDF_ModuleMgr::Get()->GetCodecModule()->GetBasicModule()->CreateRunLengthDecoder(src_data, src_size, m_Width, m_Height, m_nComponents, m_bpc);
- }
- if (m_pDecoder) {
- int requested_pitch = (m_Width * m_nComponents * m_bpc + 7) / 8;
- int provided_pitch = (m_pDecoder->GetWidth() * m_pDecoder->CountComps() * m_pDecoder->GetBPC() + 7) / 8;
- if (provided_pitch < requested_pitch) {
- return 0;
- }
- return 1;
- }
- return 0;
-}
-void CPDF_DIBSource::LoadJpxBitmap()
-{
- ICodec_JpxModule* pJpxModule = CPDF_ModuleMgr::Get()->GetJpxModule();
- if (pJpxModule == NULL) {
- return;
- }
- FX_LPVOID ctx = pJpxModule->CreateDecoder(m_pStreamAcc->GetData(), m_pStreamAcc->GetSize(), m_pColorSpace != NULL);
- if (ctx == NULL) {
- return;
- }
- FX_DWORD width = 0, height = 0, codestream_nComps = 0, image_nComps = 0;
- pJpxModule->GetImageInfo(ctx, width, height, codestream_nComps, image_nComps);
- if ((int)width < m_Width || (int)height < m_Height) {
- pJpxModule->DestroyDecoder(ctx);
- return;
- }
- int output_nComps;
- FX_BOOL bTranslateColor, bSwapRGB = FALSE;
- if (m_pColorSpace) {
- if (codestream_nComps != (FX_DWORD)m_pColorSpace->CountComponents()) {
- return;
- }
- output_nComps = codestream_nComps;
- bTranslateColor = FALSE;
- if (m_pColorSpace == CPDF_ColorSpace::GetStockCS(PDFCS_DEVICERGB)) {
- bSwapRGB = TRUE;
- m_pColorSpace = NULL;
- }
- } else {
- bTranslateColor = TRUE;
- if (image_nComps) {
- output_nComps = image_nComps;
- } else {
- output_nComps = codestream_nComps;
- }
- if (output_nComps == 3) {
- bSwapRGB = TRUE;
- } else if (output_nComps == 4) {
- m_pColorSpace = CPDF_ColorSpace::GetStockCS(PDFCS_DEVICECMYK);
- bTranslateColor = FALSE;
- }
- m_nComponents = output_nComps;
- }
- FXDIB_Format format;
- if (output_nComps == 1) {
- format = FXDIB_8bppRgb;
- } else if (output_nComps <= 3) {
- format = FXDIB_Rgb;
- } else if (output_nComps == 4) {
- format = FXDIB_Rgb32;
- } else {
- width = (width * output_nComps + 2) / 3;
- format = FXDIB_Rgb;
- }
- m_pCachedBitmap = FX_NEW CFX_DIBitmap;
- if (!m_pCachedBitmap->Create(width, height, format)) {
- delete m_pCachedBitmap;
- m_pCachedBitmap = NULL;
- return;
- }
- m_pCachedBitmap->Clear(0xFFFFFFFF);
- FX_LPBYTE output_offsets = FX_Alloc(FX_BYTE, output_nComps);
- for (int i = 0; i < output_nComps; i ++) {
- output_offsets[i] = i;
- }
- if (bSwapRGB) {
- output_offsets[0] = 2;
- output_offsets[2] = 0;
- }
- if (!pJpxModule->Decode(ctx, m_pCachedBitmap->GetBuffer(), m_pCachedBitmap->GetPitch(), bTranslateColor, output_offsets)) {
- delete m_pCachedBitmap;
- m_pCachedBitmap = NULL;
- return;
- }
- FX_Free(output_offsets);
- pJpxModule->DestroyDecoder(ctx);
- if (m_pColorSpace && m_pColorSpace->GetFamily() == PDFCS_INDEXED && m_bpc < 8) {
- int scale = 8 - m_bpc;
- for (FX_DWORD row = 0; row < height; row ++) {
- FX_LPBYTE scanline = (FX_LPBYTE)m_pCachedBitmap->GetScanline(row);
- for (FX_DWORD col = 0; col < width; col ++) {
- *scanline = (*scanline) >> scale;
- scanline++;
- }
- }
- }
- m_bpc = 8;
-}
-void CPDF_DIBSource::LoadJbig2Bitmap()
-{
- ICodec_Jbig2Module* pJbig2Module = CPDF_ModuleMgr::Get()->GetJbig2Module();
- if (pJbig2Module == NULL) {
- return;
- }
- CPDF_StreamAcc* pGlobalStream = NULL;
- if (m_pStreamAcc->GetImageParam()) {
- CPDF_Stream* pGlobals = m_pStreamAcc->GetImageParam()->GetStream(FX_BSTRC("JBIG2Globals"));
- if (pGlobals) {
- pGlobalStream = FX_NEW CPDF_StreamAcc;
- pGlobalStream->LoadAllData(pGlobals, FALSE);
- }
- }
- m_pCachedBitmap = FX_NEW CFX_DIBitmap;
- if (!m_pCachedBitmap->Create(m_Width, m_Height, m_bImageMask ? FXDIB_1bppMask : FXDIB_1bppRgb)) {
- return;
- }
- int ret = pJbig2Module->Decode(m_Width, m_Height, m_pStreamAcc->GetData(), m_pStreamAcc->GetSize(),
- pGlobalStream ? pGlobalStream->GetData() : NULL, pGlobalStream ? pGlobalStream->GetSize() : 0,
- m_pCachedBitmap->GetBuffer(), m_pCachedBitmap->GetPitch());
- if (ret < 0) {
- delete m_pCachedBitmap;
- m_pCachedBitmap = NULL;
- }
- if (pGlobalStream) {
- delete pGlobalStream;
- }
- m_bpc = 1;
- m_nComponents = 1;
-}
-CPDF_DIBSource* CPDF_DIBSource::LoadMask(FX_DWORD& MatteColor)
-{
- MatteColor = 0xffffffff;
- CPDF_Stream* pSoftMask = m_pDict->GetStream(FX_BSTRC("SMask"));
- if (pSoftMask) {
- CPDF_Array* pMatte = pSoftMask->GetDict()->GetArray(FX_BSTRC("Matte"));
- if (pMatte != NULL && m_pColorSpace && (FX_DWORD)m_pColorSpace->CountComponents() <= m_nComponents) {
- FX_FLOAT* pColor = FX_Alloc(FX_FLOAT, m_nComponents);
- for (FX_DWORD i = 0; i < m_nComponents; i ++) {
- pColor[i] = pMatte->GetFloat(i);
- }
- FX_FLOAT R, G, B;
- m_pColorSpace->GetRGB(pColor, R, G, B);
- FX_Free(pColor);
- MatteColor = FXARGB_MAKE(0, FXSYS_round(R * 255), FXSYS_round(G * 255), FXSYS_round(B * 255));
- }
- return LoadMaskDIB(pSoftMask);
- }
- CPDF_Object* pMask = m_pDict->GetElementValue(FX_BSTRC("Mask"));
- if (pMask == NULL) {
- return NULL;
- }
- if (pMask->GetType() == PDFOBJ_STREAM) {
- return LoadMaskDIB((CPDF_Stream*)pMask);
- }
- return NULL;
-}
-int CPDF_DIBSource::StratLoadMask()
-{
- m_MatteColor = 0xffffffff;
- m_pMaskStream = m_pDict->GetStream(FX_BSTRC("SMask"));
- if (m_pMaskStream) {
- CPDF_Array* pMatte = m_pMaskStream->GetDict()->GetArray(FX_BSTRC("Matte"));
- if (pMatte != NULL && m_pColorSpace && (FX_DWORD)m_pColorSpace->CountComponents() <= m_nComponents) {
- FX_FLOAT R, G, B;
- FX_FLOAT* pColor = FX_Alloc(FX_FLOAT, m_nComponents);
- for (FX_DWORD i = 0; i < m_nComponents; i ++) {
- pColor[i] = pMatte->GetFloat(i);
- }
- m_pColorSpace->GetRGB(pColor, R, G, B);
- FX_Free(pColor);
- m_MatteColor = FXARGB_MAKE(0, FXSYS_round(R * 255), FXSYS_round(G * 255), FXSYS_round(B * 255));
- }
- return StartLoadMaskDIB();
- }
- m_pMaskStream = m_pDict->GetElementValue(FX_BSTRC("Mask"));
- if (m_pMaskStream == NULL) {
- return 1;
- }
- if (m_pMaskStream->GetType() == PDFOBJ_STREAM) {
- return StartLoadMaskDIB();
- }
- return 1;
-}
-int CPDF_DIBSource::ContinueLoadMaskDIB(IFX_Pause* pPause)
-{
- if (m_pMask == NULL) {
- return 1;
- }
- int ret = m_pMask->ContinueLoadDIBSource(pPause);
- if (ret == 2) {
- return ret;
- }
- if (m_pColorSpace && m_bStdCS) {
- m_pColorSpace->EnableStdConversion(FALSE);
- }
- if (!ret) {
- delete m_pMask;
- m_pMask = NULL;
- return ret;
- }
- return 1;
-}
-CPDF_DIBSource* CPDF_DIBSource::DetachMask()
-{
- CPDF_DIBSource* pDIBSource = m_pMask;
- m_pMask = NULL;
- return pDIBSource;
-}
-CPDF_DIBSource* CPDF_DIBSource::LoadMaskDIB(CPDF_Stream* pMask)
-{
- CPDF_DIBSource* pMaskSource = FX_NEW CPDF_DIBSource;
- if (!pMaskSource->Load(m_pDocument, pMask, NULL, NULL, NULL, NULL, TRUE)) {
- delete pMaskSource;
- return NULL;
- }
- return pMaskSource;
-}
-int CPDF_DIBSource::StartLoadMaskDIB()
-{
- m_pMask = FX_NEW CPDF_DIBSource;
- int ret = m_pMask->StartLoadDIBSource(m_pDocument, (CPDF_Stream*)m_pMaskStream, FALSE, NULL, NULL, TRUE);
- if (ret == 2) {
- if (m_Status == 0) {
- m_Status = 2;
- }
- return 2;
- }
- if (!ret) {
- delete m_pMask;
- m_pMask = NULL;
- return 1;
- }
- return 1;
-}
-void CPDF_DIBSource::LoadPalette()
-{
- if (m_bpc * m_nComponents > 8) {
- return;
- }
- if (m_pColorSpace == NULL) {
- return;
- }
- if (m_bpc * m_nComponents == 1) {
- if (m_bDefaultDecode && (m_Family == PDFCS_DEVICEGRAY || m_Family == PDFCS_DEVICERGB)) {
- return;
- }
- if (m_pColorSpace->CountComponents() > 3) {
- return;
- }
- FX_FLOAT color_values[3];
- color_values[0] = m_pCompData[0].m_DecodeMin;
- color_values[1] = color_values[2] = color_values[0];
- FX_FLOAT R, G, B;
- m_pColorSpace->GetRGB(color_values, R, G, B);
- FX_ARGB argb0 = ArgbEncode(255, FXSYS_round(R * 255), FXSYS_round(G * 255), FXSYS_round(B * 255));
- color_values[0] += m_pCompData[0].m_DecodeStep;
- color_values[1] += m_pCompData[0].m_DecodeStep;
- color_values[2] += m_pCompData[0].m_DecodeStep;
- m_pColorSpace->GetRGB(color_values, R, G, B);
- FX_ARGB argb1 = ArgbEncode(255, FXSYS_round(R * 255), FXSYS_round(G * 255), FXSYS_round(B * 255));
- if (argb0 != 0xFF000000 || argb1 != 0xFFFFFFFF) {
- SetPaletteArgb(0, argb0);
- SetPaletteArgb(1, argb1);
- }
- return;
- }
- if (m_pColorSpace == CPDF_ColorSpace::GetStockCS(PDFCS_DEVICEGRAY) && m_bpc == 8 && m_bDefaultDecode) {
- } else {
- int palette_count = 1 << (m_bpc * m_nComponents);
- CFX_FixedBufGrow<FX_FLOAT, 16> color_values(m_nComponents);
- FX_FLOAT* color_value = color_values;
- for (int i = 0; i < palette_count; i ++) {
- int color_data = i;
- for (FX_DWORD j = 0; j < m_nComponents; j ++) {
- int encoded_component = color_data % (1 << m_bpc);
- color_data /= 1 << m_bpc;
- color_value[j] = m_pCompData[j].m_DecodeMin + m_pCompData[j].m_DecodeStep * encoded_component;
- }
- FX_FLOAT R = 0, G = 0, B = 0;
- if (m_nComponents == 1 && m_Family == PDFCS_ICCBASED && m_pColorSpace->CountComponents() > 1) {
- int nComponents = m_pColorSpace->CountComponents();
- FX_FLOAT* temp_buf = FX_Alloc(FX_FLOAT, nComponents);
- for (int i = 0; i < nComponents; i++) {
- temp_buf[i] = *color_value;
- }
- m_pColorSpace->GetRGB(temp_buf, R, G, B);
- FX_Free(temp_buf);
- } else {
- m_pColorSpace->GetRGB(color_value, R, G, B);
- }
- SetPaletteArgb(i, ArgbEncode(255, FXSYS_round(R * 255), FXSYS_round(G * 255), FXSYS_round(B * 255)));
- }
- }
-}
-
-FX_DWORD CPDF_DIBSource::GetValidBpp() const
-{
- FX_DWORD bpc = m_bpc;
- CPDF_Object * pFilter = m_pDict->GetElementValue(FX_BSTRC("Filter"));
- if(pFilter)
- {
- if(pFilter->GetType() == PDFOBJ_NAME)
- {
- CFX_ByteString filter = pFilter->GetString();
- if(filter == FX_BSTRC("CCITTFaxDecode") || filter == FX_BSTRC("JBIG2Decode") )
- bpc = 1;
- if(filter == FX_BSTRC("RunLengthDecode") || filter == FX_BSTRC("DCTDecode") )
- bpc = 8;
- }
- else if (pFilter->GetType() == PDFOBJ_ARRAY)
- {
- CPDF_Array *pArray = (CPDF_Array *) pFilter;
- if( pArray->GetString(pArray->GetCount() -1) == FX_BSTRC("CCITTFacDecode") ||
- pArray->GetString(pArray->GetCount() -1) == FX_BSTRC("JBIG2Decode") )
- bpc = 1;
-
- if( pArray->GetString(pArray->GetCount() -1) == FX_BSTRC("RunLengthDecode") ||
- pArray->GetString(pArray->GetCount() -1) == FX_BSTRC("DCTDecode") )
- bpc = 8;
- }
- }
-
- return bpc;
-}
-
-#define NORMALCOLOR_MAX(color, max) (color) > (max) ? (max) : (color) < 0 ? 0 : (color);
-void CPDF_DIBSource::TranslateScanline24bpp(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan) const
-{
- int max_data = (1 << m_bpc) - 1;
- if (m_bDefaultDecode) {
- if (m_Family == PDFCS_DEVICERGB || m_Family == PDFCS_CALRGB) {
- if (m_bpc == 16) {
- FX_LPBYTE dest_pos = dest_scan;
- FX_LPCBYTE src_pos = src_scan;
- for (int col = 0; col < m_Width; col ++) {
- *dest_scan++ = src_pos[4];
- *dest_scan++ = src_pos[2];
- *dest_scan++ = *src_pos;
- src_pos += 6;
- }
- } else if (m_bpc == 8) {
- FX_LPBYTE dest_pos = dest_scan;
- FX_LPCBYTE src_pos = src_scan;
- for (int column = 0; column < m_Width; column ++) {
- *dest_scan++ = src_pos[2];
- *dest_scan++ = src_pos[1];
- *dest_scan++ = *src_pos;
- src_pos += 3;
- }
- } else {
- int src_bit_pos = 0;
- int dest_byte_pos = 0;
-
- FX_DWORD bpc = GetValidBpp();
-
- for (int column = 0; column < m_Width; column ++) {
- int R = _GetBits8(src_scan, src_bit_pos, bpc);
- src_bit_pos += bpc;
- int G = _GetBits8(src_scan, src_bit_pos, bpc);
- src_bit_pos += bpc;
- int B = _GetBits8(src_scan, src_bit_pos, bpc);
- src_bit_pos += bpc;
- R = NORMALCOLOR_MAX(R, max_data);
- G = NORMALCOLOR_MAX(G, max_data);
- B = NORMALCOLOR_MAX(B, max_data);
- dest_scan[dest_byte_pos] = B * 255 / max_data;
- dest_scan[dest_byte_pos + 1] = G * 255 / max_data;
- dest_scan[dest_byte_pos + 2] = R * 255 / max_data;
- dest_byte_pos += 3;
- }
- }
- return;
- } else if (m_bpc == 8) {
- if (m_nComponents == m_pColorSpace->CountComponents())
- m_pColorSpace->TranslateImageLine(dest_scan, src_scan, m_Width, m_Width, m_Height,
- m_bLoadMask && m_GroupFamily == PDFCS_DEVICECMYK && m_Family == PDFCS_DEVICECMYK);
- return;
- }
- }
- CFX_FixedBufGrow<FX_FLOAT, 16> color_values1(m_nComponents);
- FX_FLOAT* color_values = color_values1;
- FX_FLOAT R, G, B;
- if (m_bpc == 8) {
- int src_byte_pos = 0;
- int dest_byte_pos = 0;
- for (int column = 0; column < m_Width; column ++) {
- for (FX_DWORD color = 0; color < m_nComponents; color ++) {
- int data = src_scan[src_byte_pos ++];
- color_values[color] = m_pCompData[color].m_DecodeMin +
- m_pCompData[color].m_DecodeStep * data;
- }
- if (m_bLoadMask && m_GroupFamily == PDFCS_DEVICECMYK && m_Family == PDFCS_DEVICECMYK) {
- FX_FLOAT k = 1.0f - color_values[3];
- R = (1.0f - color_values[0]) * k;
- G = (1.0f - color_values[1]) * k;
- B = (1.0f - color_values[2]) * k;
- } else {
- m_pColorSpace->GetRGB(color_values, R, G, B);
- }
- R = NORMALCOLOR_MAX(R, 1);
- G = NORMALCOLOR_MAX(G, 1);
- B = NORMALCOLOR_MAX(B, 1);
- dest_scan[dest_byte_pos] = (FX_INT32)(B * 255);
- dest_scan[dest_byte_pos + 1] = (FX_INT32)(G * 255);
- dest_scan[dest_byte_pos + 2] = (FX_INT32)(R * 255);
- dest_byte_pos += 3;
- }
- } else {
- int src_bit_pos = 0;
- int dest_byte_pos = 0;
-
- FX_DWORD bpc = GetValidBpp();
-
- for (int column = 0; column < m_Width; column ++) {
- for (FX_DWORD color = 0; color < m_nComponents; color ++) {
- int data = _GetBits8(src_scan, src_bit_pos, bpc);
- color_values[color] = m_pCompData[color].m_DecodeMin +
- m_pCompData[color].m_DecodeStep * data;
- src_bit_pos += bpc;
- }
- if (m_bLoadMask && m_GroupFamily == PDFCS_DEVICECMYK && m_Family == PDFCS_DEVICECMYK) {
- FX_FLOAT k = 1.0f - color_values[3];
- R = (1.0f - color_values[0]) * k;
- G = (1.0f - color_values[1]) * k;
- B = (1.0f - color_values[2]) * k;
- } else {
- m_pColorSpace->GetRGB(color_values, R, G, B);
- }
- R = NORMALCOLOR_MAX(R, 1);
- G = NORMALCOLOR_MAX(G, 1);
- B = NORMALCOLOR_MAX(B, 1);
- dest_scan[dest_byte_pos] = (FX_INT32)(B * 255);
- dest_scan[dest_byte_pos + 1] = (FX_INT32)(G * 255);
- dest_scan[dest_byte_pos + 2] = (FX_INT32)(R * 255);
- dest_byte_pos += 3;
- }
- }
-}
-FX_LPBYTE CPDF_DIBSource::GetBuffer() const
-{
- if (m_pCachedBitmap) {
- return m_pCachedBitmap->GetBuffer();
- }
- return NULL;
-}
-FX_LPCBYTE CPDF_DIBSource::GetScanline(int line) const
-{
- FX_DWORD src_pitch = (m_Width * m_bpc * m_nComponents + 7) / 8;
- FX_LPCBYTE pSrcLine = NULL;
- if (m_pCachedBitmap) {
- if (line >= m_pCachedBitmap->GetHeight()) {
- line = m_pCachedBitmap->GetHeight() - 1;
- }
- pSrcLine = m_pCachedBitmap->GetScanline(line);
- } else if (m_pDecoder) {
- pSrcLine = m_pDecoder->GetScanline(line);
- } else {
- if (m_pStreamAcc->GetSize() >= (line + 1) * src_pitch) {
- pSrcLine = m_pStreamAcc->GetData() + line * src_pitch;
- }
- }
- if (pSrcLine == NULL) {
- FX_LPBYTE pLineBuf = m_pMaskedLine ? m_pMaskedLine : m_pLineBuf;
- FXSYS_memset8(pLineBuf, 0xff, m_Pitch);
- return pLineBuf;
- }
- if (m_bpc * m_nComponents == 1) {
- if (m_bImageMask && m_bDefaultDecode) {
- for (FX_DWORD i = 0; i < src_pitch; i ++) {
- m_pLineBuf[i] = ~pSrcLine[i];
- }
- } else if (m_bColorKey) {
- FX_DWORD reset_argb, set_argb;
- reset_argb = m_pPalette ? m_pPalette[0] : 0xff000000;
- set_argb = m_pPalette ? m_pPalette[1] : 0xffffffff;
- if (m_pCompData[0].m_ColorKeyMin == 0) {
- reset_argb = 0;
- }
- if (m_pCompData[0].m_ColorKeyMax == 1) {
- set_argb = 0;
- }
- set_argb = FXARGB_TODIB(set_argb);
- reset_argb = FXARGB_TODIB(reset_argb);
- FX_DWORD* dest_scan = (FX_DWORD*)m_pMaskedLine;
- for (int col = 0; col < m_Width; col ++) {
- if (pSrcLine[col / 8] & (1 << (7 - col % 8))) {
- *dest_scan = set_argb;
- } else {
- *dest_scan = reset_argb;
- }
- dest_scan ++;
- }
- return m_pMaskedLine;
- } else {
- FXSYS_memcpy32(m_pLineBuf, pSrcLine, src_pitch);
- }
- return m_pLineBuf;
- }
- if (m_bpc * m_nComponents <= 8) {
- if (m_bpc == 8) {
- FXSYS_memcpy32(m_pLineBuf, pSrcLine, src_pitch);
- } else {
- int src_bit_pos = 0;
- for (int col = 0; col < m_Width; col ++) {
- int color_index = 0;
- for (FX_DWORD color = 0; color < m_nComponents; color ++) {
- int data = _GetBits8(pSrcLine, src_bit_pos, m_bpc);
- color_index |= data << (color * m_bpc);
- src_bit_pos += m_bpc;
- }
- m_pLineBuf[col] = color_index;
- }
- }
- if (m_bColorKey) {
- FX_LPBYTE pDestPixel = m_pMaskedLine;
- FX_LPCBYTE pSrcPixel = m_pLineBuf;
- for (int col = 0; col < m_Width; col ++) {
- FX_BYTE index = *pSrcPixel++;
- if (m_pPalette) {
- *pDestPixel++ = FXARGB_B(m_pPalette[index]);
- *pDestPixel++ = FXARGB_G(m_pPalette[index]);
- *pDestPixel++ = FXARGB_R(m_pPalette[index]);
- } else {
- *pDestPixel++ = index;
- *pDestPixel++ = index;
- *pDestPixel++ = index;
- }
- *pDestPixel = (index < m_pCompData[0].m_ColorKeyMin || index > m_pCompData[0].m_ColorKeyMax) ? 0xff : 0;
- pDestPixel ++ ;
- }
- return m_pMaskedLine;
- }
- return m_pLineBuf;
- }
- if (m_bColorKey) {
- if (m_nComponents == 3 && m_bpc == 8) {
- FX_LPBYTE alpha_channel = m_pMaskedLine + 3;
- for (int col = 0; col < m_Width; col ++) {
- FX_LPCBYTE pPixel = pSrcLine + col * 3;
- alpha_channel[col * 4] = (pPixel[0] < m_pCompData[0].m_ColorKeyMin ||
- pPixel[0] > m_pCompData[0].m_ColorKeyMax ||
- pPixel[1] < m_pCompData[1].m_ColorKeyMin || pPixel[1] > m_pCompData[1].m_ColorKeyMax ||
- pPixel[2] < m_pCompData[2].m_ColorKeyMin || pPixel[2] > m_pCompData[2].m_ColorKeyMax) ? 0xff : 0;
- }
- } else {
- FXSYS_memset8(m_pMaskedLine, 0xff, m_Pitch);
- }
- }
- if (m_pColorSpace) {
- TranslateScanline24bpp(m_pLineBuf, pSrcLine);
- pSrcLine = m_pLineBuf;
- }
- if (m_bColorKey) {
- FX_LPCBYTE pSrcPixel = pSrcLine;
- FX_LPBYTE pDestPixel = m_pMaskedLine;
- for (int col = 0; col < m_Width; col ++) {
- *pDestPixel++ = *pSrcPixel++;
- *pDestPixel++ = *pSrcPixel++;
- *pDestPixel++ = *pSrcPixel++;
- pDestPixel ++;
- }
- return m_pMaskedLine;
- }
- return pSrcLine;
-}
-FX_BOOL CPDF_DIBSource::SkipToScanline(int line, IFX_Pause* pPause) const
-{
- if (m_pDecoder) {
- return m_pDecoder->SkipToScanline(line, pPause);
- }
- return FALSE;
-}
-void CPDF_DIBSource::DownSampleScanline(int line, FX_LPBYTE dest_scan, int dest_bpp,
- int dest_width, FX_BOOL bFlipX, int clip_left, int clip_width) const
-{
- FX_DWORD src_width = m_Width;
- FX_DWORD src_pitch = (src_width * m_bpc * m_nComponents + 7) / 8;
- FX_LPCBYTE pSrcLine = NULL;
- if (m_pCachedBitmap) {
- pSrcLine = m_pCachedBitmap->GetScanline(line);
- } else if (m_pDecoder) {
- pSrcLine = m_pDecoder->GetScanline(line);
- } else {
- if (m_pStreamAcc->GetSize() >= (line + 1) * src_pitch) {
- pSrcLine = m_pStreamAcc->GetData() + line * src_pitch;
- }
- }
- int orig_Bpp = m_bpc * m_nComponents / 8;
- int dest_Bpp = dest_bpp / 8;
- if (pSrcLine == NULL) {
- FXSYS_memset32(dest_scan, 0xff, dest_Bpp * clip_width);
- return;
- }
- CFX_FixedBufGrow<FX_BYTE, 128> temp(orig_Bpp);
- if (m_bpc * m_nComponents == 1) {
- FX_DWORD set_argb = (FX_DWORD) - 1, reset_argb = 0;
- if (m_bImageMask) {
- if (m_bDefaultDecode) {
- set_argb = 0;
- reset_argb = (FX_DWORD) - 1;
- }
- } else if (m_bColorKey) {
- reset_argb = m_pPalette ? m_pPalette[0] : 0xff000000;
- set_argb = m_pPalette ? m_pPalette[1] : 0xffffffff;
- if (m_pCompData[0].m_ColorKeyMin == 0) {
- reset_argb = 0;
- }
- if (m_pCompData[0].m_ColorKeyMax == 1) {
- set_argb = 0;
- }
- set_argb = FXARGB_TODIB(set_argb);
- reset_argb = FXARGB_TODIB(reset_argb);
- for (int i = 0; i < clip_width; i ++) {
- FX_DWORD src_x = (clip_left + i) * src_width / dest_width;
- if (bFlipX) {
- src_x = src_width - src_x - 1;
- }
- src_x %= src_width;
- if (pSrcLine[src_x / 8] & (1 << (7 - src_x % 8))) {
- ((FX_DWORD*)dest_scan)[i] = set_argb;
- } else {
- ((FX_DWORD*)dest_scan)[i] = reset_argb;
- }
- }
- return;
- } else {
- if (dest_Bpp == 1) {
- } else if (m_pPalette) {
- reset_argb = m_pPalette[0];
- set_argb = m_pPalette[1];
- }
- }
- for (int i = 0; i < clip_width; i ++) {
- FX_DWORD src_x = (clip_left + i) * src_width / dest_width;
- if (bFlipX) {
- src_x = src_width - src_x - 1;
- }
- src_x %= src_width;
- int dest_pos = i * dest_Bpp;
- if (pSrcLine[src_x / 8] & (1 << (7 - src_x % 8))) {
- if (dest_Bpp == 1) {
- dest_scan[dest_pos] = (FX_BYTE)set_argb;
- } else if (dest_Bpp == 3) {
- dest_scan[dest_pos] = FXARGB_B(set_argb);
- dest_scan[dest_pos + 1] = FXARGB_G(set_argb);
- dest_scan[dest_pos + 2] = FXARGB_R(set_argb);
- } else {
- *(FX_DWORD*)(dest_scan + dest_pos) = set_argb;
- }
- } else {
- if (dest_Bpp == 1) {
- dest_scan[dest_pos] = (FX_BYTE)reset_argb;
- } else if (dest_Bpp == 3) {
- dest_scan[dest_pos] = FXARGB_B(reset_argb);
- dest_scan[dest_pos + 1] = FXARGB_G(reset_argb);
- dest_scan[dest_pos + 2] = FXARGB_R(reset_argb);
- } else {
- *(FX_DWORD*)(dest_scan + dest_pos) = reset_argb;
- }
- }
- }
- return;
- } else if (m_bpc * m_nComponents <= 8) {
- if (m_bpc < 8) {
- int src_bit_pos = 0;
- for (FX_DWORD col = 0; col < src_width; col ++) {
- int color_index = 0;
- for (FX_DWORD color = 0; color < m_nComponents; color ++) {
- int data = _GetBits8(pSrcLine, src_bit_pos, m_bpc);
- color_index |= data << (color * m_bpc);
- src_bit_pos += m_bpc;
- }
- m_pLineBuf[col] = color_index;
- }
- pSrcLine = m_pLineBuf;
- }
- if (m_bColorKey) {
- for (int i = 0; i < clip_width; i ++) {
- FX_DWORD src_x = (clip_left + i) * src_width / dest_width;
- if (bFlipX) {
- src_x = src_width - src_x - 1;
- }
- src_x %= src_width;
- FX_LPBYTE pDestPixel = dest_scan + i * 4;
- FX_BYTE index = pSrcLine[src_x];
- if (m_pPalette) {
- *pDestPixel++ = FXARGB_B(m_pPalette[index]);
- *pDestPixel++ = FXARGB_G(m_pPalette[index]);
- *pDestPixel++ = FXARGB_R(m_pPalette[index]);
- } else {
- *pDestPixel++ = index;
- *pDestPixel++ = index;
- *pDestPixel++ = index;
- }
- *pDestPixel = (index < m_pCompData[0].m_ColorKeyMin || index > m_pCompData[0].m_ColorKeyMax) ? 0xff : 0;
- }
- return;
- }
- for (int i = 0; i < clip_width; i ++) {
- FX_DWORD src_x = (clip_left + i) * src_width / dest_width;
- if (bFlipX) {
- src_x = src_width - src_x - 1;
- }
- src_x %= src_width;
- FX_BYTE index = pSrcLine[src_x];
- if (dest_Bpp == 1) {
- dest_scan[i] = index;
- } else {
- int dest_pos = i * dest_Bpp;
- FX_ARGB argb = m_pPalette[index];
- dest_scan[dest_pos] = FXARGB_B(argb);
- dest_scan[dest_pos + 1] = FXARGB_G(argb);
- dest_scan[dest_pos + 2] = FXARGB_R(argb);
- }
- }
- return;
- } else {
- int last_src_x = -1;
- FX_ARGB last_argb;
- FX_FLOAT orig_Not8Bpp = (FX_FLOAT)m_bpc * (FX_FLOAT)m_nComponents / 8.0f;
- FX_FLOAT unit_To8Bpc = 255.0f / ((1 << m_bpc) - 1);
- for (int i = 0; i < clip_width; i ++) {
- int dest_x = clip_left + i;
- FX_DWORD src_x = (bFlipX ? (dest_width - dest_x - 1) : dest_x) * (FX_INT64)src_width / dest_width;
- src_x %= src_width;
- FX_LPCBYTE pSrcPixel = NULL;
- if (m_bpc % 8 == 0) {
- pSrcPixel = pSrcLine + src_x * orig_Bpp;
- } else {
- pSrcPixel = pSrcLine + (int)(src_x * orig_Not8Bpp);
- }
- FX_LPBYTE pDestPixel = dest_scan + i * dest_Bpp;
- FX_ARGB argb;
- if (src_x == last_src_x) {
- argb = last_argb;
- } else {
- if (m_pColorSpace) {
- FX_BYTE color[4];
- if (!m_bDefaultDecode) {
- for (int i = 0; i < orig_Bpp; i ++) {
- int color_value = (int)((m_pCompData[i].m_DecodeMin + m_pCompData[i].m_DecodeStep * (FX_FLOAT)pSrcPixel[i]) * 255.0f + 0.5f);
- temp[i] = color_value > 255 ? 255 : (color_value < 0 ? 0 : color_value);
- }
- m_pColorSpace->TranslateImageLine(color, temp, 1, 0, 0, m_bLoadMask && m_GroupFamily == PDFCS_DEVICECMYK && m_Family == PDFCS_DEVICECMYK);
- } else {
- if (m_bpc < 8) {
- int src_bit_pos = 0;
- if (src_x % 2) {
- src_bit_pos = 4;
- }
- int value = (1 << m_bpc) - 1;
- for (FX_DWORD i = 0; i < m_nComponents; i ++) {
- temp[i] = (FX_BYTE)(_GetBits8(pSrcPixel, src_bit_pos, m_bpc) * unit_To8Bpc);
- src_bit_pos += m_bpc;
- }
- m_pColorSpace->TranslateImageLine(color, temp, 1, 0, 0, m_bLoadMask && m_GroupFamily == PDFCS_DEVICECMYK && m_Family == PDFCS_DEVICECMYK);
- } else {
- m_pColorSpace->TranslateImageLine(color, pSrcPixel, 1, 0, 0, m_bLoadMask && m_GroupFamily == PDFCS_DEVICECMYK && m_Family == PDFCS_DEVICECMYK);
- }
- }
- argb = FXARGB_MAKE(0xff, color[2], color[1], color[0]);
- } else {
- argb = FXARGB_MAKE(0xff, pSrcPixel[2], pSrcPixel[1], pSrcPixel[0]);
- }
- if (m_bColorKey) {
- int alpha = 0xff;
- if (m_nComponents == 3 && m_bpc == 8) {
- alpha = (pSrcPixel[0] < m_pCompData[0].m_ColorKeyMin ||
- pSrcPixel[0] > m_pCompData[0].m_ColorKeyMax ||
- pSrcPixel[1] < m_pCompData[1].m_ColorKeyMin ||
- pSrcPixel[1] > m_pCompData[1].m_ColorKeyMax ||
- pSrcPixel[2] < m_pCompData[2].m_ColorKeyMin ||
- pSrcPixel[2] > m_pCompData[2].m_ColorKeyMax) ? 0xff : 0;
- }
- argb &= 0xffffff;
- argb |= alpha << 24;
- }
- last_src_x = src_x;
- last_argb = argb;
- }
- if (dest_Bpp == 4) {
- *(FX_DWORD*)pDestPixel = FXARGB_TODIB(argb);
- } else {
- *pDestPixel++ = FXARGB_B(argb);
- *pDestPixel++ = FXARGB_G(argb);
- *pDestPixel = FXARGB_R(argb);
- }
- }
- }
-}
-void CPDF_DIBSource::SetDownSampleSize(int dest_width, int dest_height) const
-{
- if (m_pDecoder) {
- m_pDecoder->DownScale(dest_width, dest_height);
- ((CPDF_DIBSource*)this)->m_Width = m_pDecoder->GetWidth();
- ((CPDF_DIBSource*)this)->m_Height = m_pDecoder->GetHeight();
- }
-}
-void CPDF_DIBSource::ClearImageData()
-{
- if (m_pDecoder) {
- m_pDecoder->ClearImageData();
- }
-}
-CPDF_ProgressiveImageLoaderHandle::CPDF_ProgressiveImageLoaderHandle()
-{
- m_pImageLoader = NULL;
- m_pCache = NULL;
- m_pImage = NULL;
-}
-CPDF_ProgressiveImageLoaderHandle::~CPDF_ProgressiveImageLoaderHandle()
-{
- m_pImageLoader = NULL;
- m_pCache = NULL;
- m_pImage = NULL;
-}
-FX_BOOL CPDF_ProgressiveImageLoaderHandle::Start(CPDF_ImageLoader* pImageLoader, const CPDF_ImageObject* pImage, CPDF_PageRenderCache* pCache, FX_BOOL bStdCS, FX_DWORD GroupFamily, FX_BOOL bLoadMask, CPDF_RenderStatus* pRenderStatus, FX_INT32 nDownsampleWidth, FX_INT32 nDownsampleHeight)
-{
- m_pImageLoader = pImageLoader;
- m_pCache = pCache;
- m_pImage = (CPDF_ImageObject*)pImage;
- m_nDownsampleWidth = nDownsampleWidth;
- m_nDownsampleHeight = nDownsampleHeight;
- FX_BOOL ret;
- if (pCache) {
- ret = pCache->StartGetCachedBitmap(pImage->m_pImage->GetStream(), bStdCS, GroupFamily, bLoadMask, pRenderStatus, m_nDownsampleWidth, m_nDownsampleHeight);
- if (ret == FALSE) {
- m_pImageLoader->m_bCached = TRUE;
- m_pImageLoader->m_pBitmap = pCache->m_pCurImageCache->DetachBitmap();
- m_pImageLoader->m_pMask = pCache->m_pCurImageCache->DetachMask();
- m_pImageLoader->m_MatteColor = pCache->m_pCurImageCache->m_MatteColor;
- }
- } else {
- ret = pImage->m_pImage->StartLoadDIBSource(pRenderStatus->m_pFormResource, pRenderStatus->m_pPageResource, bStdCS, GroupFamily, bLoadMask);
- if (ret == FALSE) {
- m_pImageLoader->m_bCached = FALSE;
- m_pImageLoader->m_pBitmap = m_pImage->m_pImage->DetachBitmap();
- m_pImageLoader->m_pMask = m_pImage->m_pImage->DetachMask();
- m_pImageLoader->m_MatteColor = m_pImage->m_pImage->m_MatteColor;
- }
- }
- return ret;
-}
-FX_BOOL CPDF_ProgressiveImageLoaderHandle::Continue(IFX_Pause* pPause)
-{
- FX_BOOL ret;
- if (m_pCache) {
- ret = m_pCache->Continue(pPause);
- if (ret == FALSE) {
- m_pImageLoader->m_bCached = TRUE;
- m_pImageLoader->m_pBitmap = m_pCache->m_pCurImageCache->DetachBitmap();
- m_pImageLoader->m_pMask = m_pCache->m_pCurImageCache->DetachMask();
- m_pImageLoader->m_MatteColor = m_pCache->m_pCurImageCache->m_MatteColor;
- }
- } else {
- ret = m_pImage->m_pImage->Continue(pPause);
- if (ret == FALSE) {
- m_pImageLoader->m_bCached = FALSE;
- m_pImageLoader->m_pBitmap = m_pImage->m_pImage->DetachBitmap();
- m_pImageLoader->m_pMask = m_pImage->m_pImage->DetachMask();
- m_pImageLoader->m_MatteColor = m_pImage->m_pImage->m_MatteColor;
- }
- }
- return ret;
-}
-FX_BOOL CPDF_ImageLoader::Load(const CPDF_ImageObject* pImage, CPDF_PageRenderCache* pCache, FX_BOOL bStdCS, FX_DWORD GroupFamily, FX_BOOL bLoadMask, CPDF_RenderStatus* pRenderStatus)
-{
- if (pImage == NULL) {
- return FALSE;
- }
- if (pCache) {
- pCache->GetCachedBitmap(pImage->m_pImage->GetStream(), m_pBitmap, m_pMask, m_MatteColor, bStdCS, GroupFamily, bLoadMask, pRenderStatus, m_nDownsampleWidth, m_nDownsampleHeight);
- m_bCached = TRUE;
- } else {
- m_pBitmap = pImage->m_pImage->LoadDIBSource(&m_pMask, &m_MatteColor, bStdCS, GroupFamily, bLoadMask);
- m_bCached = FALSE;
- }
- return FALSE;
-}
-FX_BOOL CPDF_ImageLoader::StartLoadImage(const CPDF_ImageObject* pImage, CPDF_PageRenderCache* pCache, FX_LPVOID& LoadHandle, FX_BOOL bStdCS, FX_DWORD GroupFamily, FX_BOOL bLoadMask, CPDF_RenderStatus* pRenderStatus, FX_INT32 nDownsampleWidth, FX_INT32 nDownsampleHeight)
-{
- m_nDownsampleWidth = nDownsampleWidth;
- m_nDownsampleHeight = nDownsampleHeight;
- CPDF_ProgressiveImageLoaderHandle* pLoaderHandle = NULL;
- pLoaderHandle = FX_NEW CPDF_ProgressiveImageLoaderHandle;
- FX_BOOL ret = pLoaderHandle->Start(this, pImage, pCache, bStdCS, GroupFamily, bLoadMask, pRenderStatus, m_nDownsampleWidth, m_nDownsampleHeight);
- LoadHandle = pLoaderHandle;
- return ret;
-}
-FX_BOOL CPDF_ImageLoader::Continue(FX_LPVOID LoadHandle, IFX_Pause* pPause)
-{
- return ((CPDF_ProgressiveImageLoaderHandle*)LoadHandle)->Continue(pPause);
-}
-CPDF_ImageLoader::~CPDF_ImageLoader()
-{
- if (!m_bCached) {
- if (m_pBitmap) {
- delete m_pBitmap;
- m_pBitmap = NULL;
- }
- if (m_pMask) {
- delete m_pMask;
- }
- }
-}
+// 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
+
+#include "../../../include/fxge/fx_ge.h"
+#include "../../../include/fxcodec/fx_codec.h"
+#include "../../../include/fpdfapi/fpdf_module.h"
+#include "../../../include/fpdfapi/fpdf_render.h"
+#include "../../../include/fpdfapi/fpdf_pageobj.h"
+#include "../fpdf_page/pageint.h"
+#include "render_int.h"
+#include <limits.h>
+static unsigned int _GetBits8(FX_LPCBYTE pData, int bitpos, int nbits)
+{
+ unsigned int byte = pData[bitpos / 8];
+ if (nbits == 8) {
+ return byte;
+ } else if (nbits == 4) {
+ return (bitpos % 8) ? (byte & 0x0f) : (byte >> 4);
+ } else if (nbits == 2) {
+ return (byte >> (6 - bitpos % 8)) & 0x03;
+ } else if (nbits == 1) {
+ return (byte >> (7 - bitpos % 8)) & 0x01;
+ } else if (nbits == 16) {
+ return byte * 256 + pData[bitpos / 8 + 1];
+ }
+ return 0;
+}
+CFX_DIBSource* CPDF_Image::LoadDIBSource(CFX_DIBSource** ppMask, FX_DWORD* pMatteColor, FX_BOOL bStdCS, FX_DWORD GroupFamily, FX_BOOL bLoadMask) const
+{
+ CPDF_DIBSource* pSource = FX_NEW CPDF_DIBSource;
+ if (pSource->Load(m_pDocument, m_pStream, (CPDF_DIBSource**)ppMask, pMatteColor, NULL, NULL, bStdCS, GroupFamily, bLoadMask)) {
+ return pSource;
+ }
+ delete pSource;
+ return NULL;
+}
+CFX_DIBSource* CPDF_Image::DetachBitmap()
+{
+ CFX_DIBSource* pBitmap = m_pDIBSource;
+ m_pDIBSource = NULL;
+ return pBitmap;
+}
+CFX_DIBSource* CPDF_Image::DetachMask()
+{
+ CFX_DIBSource* pBitmap = m_pMask;
+ m_pMask = NULL;
+ return pBitmap;
+}
+FX_BOOL CPDF_Image::StartLoadDIBSource(CPDF_Dictionary* pFormResource, CPDF_Dictionary* pPageResource, FX_BOOL bStdCS, FX_DWORD GroupFamily, FX_BOOL bLoadMask)
+{
+ m_pDIBSource = FX_NEW CPDF_DIBSource;
+ int ret = ((CPDF_DIBSource*)m_pDIBSource)->StartLoadDIBSource(m_pDocument, m_pStream, TRUE, pFormResource, pPageResource, bStdCS, GroupFamily, bLoadMask);
+ if (ret == 2) {
+ return TRUE;
+ }
+ if (!ret) {
+ delete m_pDIBSource;
+ m_pDIBSource = NULL;
+ return FALSE;
+ }
+ m_pMask = ((CPDF_DIBSource*)m_pDIBSource)->DetachMask();
+ m_MatteColor = ((CPDF_DIBSource*)m_pDIBSource)->m_MatteColor;
+ return FALSE;
+}
+FX_BOOL CPDF_Image::Continue(IFX_Pause* pPause)
+{
+ int ret = ((CPDF_DIBSource*)m_pDIBSource)->ContinueLoadDIBSource(pPause);
+ if (ret == 2) {
+ return TRUE;
+ }
+ if (!ret) {
+ delete m_pDIBSource;
+ m_pDIBSource = NULL;
+ return FALSE;
+ }
+ m_pMask = ((CPDF_DIBSource*)m_pDIBSource)->DetachMask();
+ m_MatteColor = ((CPDF_DIBSource*)m_pDIBSource)->m_MatteColor;
+ return FALSE;
+}
+CPDF_DIBSource::CPDF_DIBSource()
+{
+ m_pDocument = NULL;
+ m_pStreamAcc = NULL;
+ m_pDict = NULL;
+ m_bpp = 0;
+ m_Width = m_Height = 0;
+ m_pColorSpace = NULL;
+ m_bDefaultDecode = TRUE;
+ m_bImageMask = FALSE;
+ m_pPalette = NULL;
+ m_pCompData = NULL;
+ m_bColorKey = FALSE;
+ m_pMaskedLine = m_pLineBuf = NULL;
+ m_pCachedBitmap = NULL;
+ m_pDecoder = NULL;
+ m_nComponents = 0;
+ m_bpc = 0;
+ m_bLoadMask = FALSE;
+ m_Family = 0;
+ m_pMask = NULL;
+ m_MatteColor = 0;
+ m_pJbig2Context = NULL;
+ m_pGlobalStream = NULL;
+ m_bStdCS = FALSE;
+ m_pMaskStream = NULL;
+ m_Status = 0;
+ m_bHasMask = FALSE;
+}
+CPDF_DIBSource::~CPDF_DIBSource()
+{
+ if (m_pStreamAcc) {
+ delete m_pStreamAcc;
+ }
+ if (m_pMaskedLine) {
+ FX_Free(m_pMaskedLine);
+ }
+ if (m_pLineBuf) {
+ FX_Free(m_pLineBuf);
+ }
+ if (m_pCachedBitmap) {
+ delete m_pCachedBitmap;
+ }
+ if (m_pDecoder) {
+ delete m_pDecoder;
+ }
+ if (m_pCompData) {
+ FX_Free(m_pCompData);
+ }
+ CPDF_ColorSpace* pCS = m_pColorSpace;
+ if (pCS && m_pDocument) {
+ m_pDocument->GetPageData()->ReleaseColorSpace(pCS->GetArray());
+ }
+ if (m_pJbig2Context) {
+ ICodec_Jbig2Module* pJbig2Moudle = CPDF_ModuleMgr::Get()->GetJbig2Module();
+ pJbig2Moudle->DestroyJbig2Context(m_pJbig2Context);
+ m_pJbig2Context = NULL;
+ }
+ if (m_pGlobalStream) {
+ delete m_pGlobalStream;
+ }
+ m_pGlobalStream = NULL;
+}
+CFX_DIBitmap* CPDF_DIBSource::GetBitmap() const
+{
+ if (m_pCachedBitmap) {
+ return m_pCachedBitmap;
+ }
+ return Clone();
+}
+void CPDF_DIBSource::ReleaseBitmap(CFX_DIBitmap* pBitmap) const
+{
+ if (pBitmap && pBitmap != m_pCachedBitmap) {
+ delete pBitmap;
+ }
+}
+FX_BOOL CPDF_DIBSource::Load(CPDF_Document* pDoc, const CPDF_Stream* pStream, CPDF_DIBSource** ppMask,
+ FX_DWORD* pMatteColor, CPDF_Dictionary* pFormResources, CPDF_Dictionary* pPageResources, FX_BOOL bStdCS, FX_DWORD GroupFamily, FX_BOOL bLoadMask)
+{
+ if (pStream == NULL) {
+ return FALSE;
+ }
+ m_pDocument = pDoc;
+ m_pDict = pStream->GetDict();
+ m_pStream = pStream;
+ m_Width = m_pDict->GetInteger(FX_BSTRC("Width"));
+ m_Height = m_pDict->GetInteger(FX_BSTRC("Height"));
+ if (m_Width <= 0 || m_Height <= 0 || m_Width > 0x01ffff || m_Height > 0x01ffff) {
+ return FALSE;
+ }
+ m_GroupFamily = GroupFamily;
+ m_bLoadMask = bLoadMask;
+ if (!LoadColorInfo(m_pStream->GetObjNum() != 0 ? NULL : pFormResources, pPageResources)) {
+ return FALSE;
+ }
+ FX_DWORD src_pitch = m_bpc;
+ if (m_bpc != 0 && m_nComponents != 0) {
+ if (src_pitch > 0 && m_nComponents > (unsigned)INT_MAX / src_pitch) {
+ return FALSE;
+ }
+ src_pitch *= m_nComponents;
+ if (src_pitch > 0 && (FX_DWORD)m_Width > (unsigned)INT_MAX / src_pitch) {
+ return FALSE;
+ }
+ src_pitch *= m_Width;
+ if (src_pitch + 7 < src_pitch) {
+ return FALSE;
+ }
+ src_pitch += 7;
+ src_pitch /= 8;
+ if (src_pitch > 0 && (FX_DWORD)m_Height > (unsigned)INT_MAX / src_pitch) {
+ return FALSE;
+ }
+ }
+ m_pStreamAcc = FX_NEW CPDF_StreamAcc;
+ m_pStreamAcc->LoadAllData(pStream, FALSE, m_Height * src_pitch, TRUE);
+ if (m_pStreamAcc->GetSize() == 0 || m_pStreamAcc->GetData() == NULL) {
+ return FALSE;
+ }
+ const CFX_ByteString& decoder = m_pStreamAcc->GetImageDecoder();
+ if (!decoder.IsEmpty() && decoder == FX_BSTRC("CCITTFaxDecode")) {
+ m_bpc = 1;
+ }
+ if (!CreateDecoder()) {
+ return FALSE;
+ }
+ if (m_bImageMask) {
+ m_bpp = 1;
+ m_bpc = 1;
+ m_nComponents = 1;
+ m_AlphaFlag = 1;
+ } else if (m_bpc * m_nComponents == 1) {
+ m_bpp = 1;
+ } else if (m_bpc * m_nComponents <= 8) {
+ m_bpp = 8;
+ } else {
+ m_bpp = 24;
+ }
+ if (!m_bpc || !m_nComponents) {
+ return FALSE;
+ }
+ m_Pitch = m_Width;
+ if ((FX_DWORD)m_bpp > (unsigned)INT_MAX / m_Pitch) {
+ return FALSE;
+ }
+ m_Pitch *= m_bpp;
+ if (m_Pitch + 31 < m_Pitch) {
+ return FALSE;
+ }
+ m_Pitch += 31;
+ m_Pitch = m_Pitch / 32 * 4;
+ m_pLineBuf = FX_Alloc(FX_BYTE, m_Pitch);
+ if (m_pColorSpace && bStdCS) {
+ m_pColorSpace->EnableStdConversion(TRUE);
+ }
+ LoadPalette();
+ if (m_bColorKey) {
+ m_bpp = 32;
+ m_AlphaFlag = 2;
+ m_Pitch = m_Width;
+ if ((FX_DWORD)m_bpp > (unsigned)INT_MAX / m_Pitch) {
+ return FALSE;
+ }
+ m_Pitch *= m_bpp;
+ if (m_Pitch + 31 < m_Pitch) {
+ return FALSE;
+ }
+ m_Pitch += 31;
+ m_Pitch = m_Pitch / 32 * 4;
+ m_pMaskedLine = FX_Alloc(FX_BYTE, m_Pitch);
+ }
+ if (ppMask) {
+ *ppMask = LoadMask(*pMatteColor);
+ }
+ if (m_pColorSpace && bStdCS) {
+ m_pColorSpace->EnableStdConversion(FALSE);
+ }
+ return TRUE;
+}
+int CPDF_DIBSource::ContinueToLoadMask()
+{
+ if (m_bImageMask) {
+ m_bpp = 1;
+ m_bpc = 1;
+ m_nComponents = 1;
+ m_AlphaFlag = 1;
+ } else if (m_bpc * m_nComponents == 1) {
+ m_bpp = 1;
+ } else if (m_bpc * m_nComponents <= 8) {
+ m_bpp = 8;
+ } else {
+ m_bpp = 24;
+ }
+ if (!m_bpc || !m_nComponents) {
+ return 0;
+ }
+ m_Pitch = m_Width;
+ if ((FX_DWORD)m_bpp > (unsigned)INT_MAX / m_Pitch) {
+ return 0;
+ }
+ m_Pitch *= m_bpp;
+ if (m_Pitch + 31 < m_Pitch) {
+ return 0;
+ }
+ m_Pitch += 31;
+ m_Pitch = m_Pitch / 32 * 4;
+ m_pLineBuf = FX_Alloc(FX_BYTE, m_Pitch);
+ if (m_pColorSpace && m_bStdCS) {
+ m_pColorSpace->EnableStdConversion(TRUE);
+ }
+ LoadPalette();
+ if (m_bColorKey) {
+ m_bpp = 32;
+ m_AlphaFlag = 2;
+ m_Pitch = m_Width;
+ if ((FX_DWORD)m_bpp > (unsigned)INT_MAX / m_Pitch) {
+ return 0;
+ }
+ m_Pitch *= m_bpp;
+ if (m_Pitch + 31 < m_Pitch) {
+ return 0;
+ }
+ m_Pitch += 31;
+ m_Pitch = m_Pitch / 32 * 4;
+ m_pMaskedLine = FX_Alloc(FX_BYTE, m_Pitch);
+ }
+ return 1;
+}
+int CPDF_DIBSource::StartLoadDIBSource(CPDF_Document* pDoc, const CPDF_Stream* pStream, FX_BOOL bHasMask,
+ CPDF_Dictionary* pFormResources, CPDF_Dictionary* pPageResources,
+ FX_BOOL bStdCS, FX_DWORD GroupFamily, FX_BOOL bLoadMask)
+{
+ if (pStream == NULL) {
+ return 0;
+ }
+ m_pDocument = pDoc;
+ m_pDict = pStream->GetDict();
+ m_pStream = pStream;
+ m_bStdCS = bStdCS;
+ m_bHasMask = bHasMask;
+ m_Width = m_pDict->GetInteger(FX_BSTRC("Width"));
+ m_Height = m_pDict->GetInteger(FX_BSTRC("Height"));
+ if (m_Width <= 0 || m_Height <= 0 || m_Width > 0x01ffff || m_Height > 0x01ffff) {
+ return 0;
+ }
+ m_GroupFamily = GroupFamily;
+ m_bLoadMask = bLoadMask;
+ if (!LoadColorInfo(m_pStream->GetObjNum() != 0 ? NULL : pFormResources, pPageResources)) {
+ return 0;
+ }
+ FX_DWORD src_pitch = m_bpc;
+ if (m_bpc != 0 && m_nComponents != 0) {
+ if (src_pitch > 0 && m_nComponents > (unsigned)INT_MAX / src_pitch) {
+ return 0;
+ }
+ src_pitch *= m_nComponents;
+ if (src_pitch > 0 && (FX_DWORD)m_Width > (unsigned)INT_MAX / src_pitch) {
+ return 0;
+ }
+ src_pitch *= m_Width;
+ if (src_pitch + 7 < src_pitch) {
+ return 0;
+ }
+ src_pitch += 7;
+ src_pitch /= 8;
+ if (src_pitch > 0 && (FX_DWORD)m_Height > (unsigned)INT_MAX / src_pitch) {
+ return 0;
+ }
+ }
+ m_pStreamAcc = FX_NEW CPDF_StreamAcc;
+ m_pStreamAcc->LoadAllData(pStream, FALSE, m_Height * src_pitch, TRUE);
+ if (m_pStreamAcc->GetSize() == 0 || m_pStreamAcc->GetData() == NULL) {
+ return 0;
+ }
+ const CFX_ByteString& decoder = m_pStreamAcc->GetImageDecoder();
+ if (!decoder.IsEmpty() && decoder == FX_BSTRC("CCITTFaxDecode")) {
+ m_bpc = 1;
+ }
+ int ret = CreateDecoder();
+ if (ret != 1) {
+ if (!ret) {
+ return ret;
+ }
+ if (!ContinueToLoadMask()) {
+ return 0;
+ }
+ if (m_bHasMask) {
+ StratLoadMask();
+ }
+ return ret;
+ }
+ if (!ContinueToLoadMask()) {
+ return 0;
+ }
+ if (m_bHasMask) {
+ ret = StratLoadMask();
+ }
+ if (ret == 2) {
+ return ret;
+ }
+ if (m_pColorSpace && m_bStdCS) {
+ m_pColorSpace->EnableStdConversion(FALSE);
+ }
+ return ret;
+}
+int CPDF_DIBSource::ContinueLoadDIBSource(IFX_Pause* pPause)
+{
+ FXCODEC_STATUS ret;
+ if (m_Status == 1) {
+ const CFX_ByteString& decoder = m_pStreamAcc->GetImageDecoder();
+ if (decoder == FX_BSTRC("JPXDecode")) {
+ return 0;
+ }
+ ICodec_Jbig2Module* pJbig2Moudle = CPDF_ModuleMgr::Get()->GetJbig2Module();
+ if (m_pJbig2Context == NULL) {
+ m_pJbig2Context = pJbig2Moudle->CreateJbig2Context();
+ if (m_pStreamAcc->GetImageParam()) {
+ CPDF_Stream* pGlobals = m_pStreamAcc->GetImageParam()->GetStream(FX_BSTRC("JBIG2Globals"));
+ if (pGlobals) {
+ m_pGlobalStream = FX_NEW CPDF_StreamAcc;
+ m_pGlobalStream->LoadAllData(pGlobals, FALSE);
+ }
+ }
+ ret = pJbig2Moudle->StartDecode(m_pJbig2Context, m_Width, m_Height, m_pStreamAcc->GetData(), m_pStreamAcc->GetSize(),
+ m_pGlobalStream ? m_pGlobalStream->GetData() : NULL, m_pGlobalStream ? m_pGlobalStream->GetSize() : 0, m_pCachedBitmap->GetBuffer(),
+ m_pCachedBitmap->GetPitch(), pPause);
+ if (ret < 0) {
+ delete m_pCachedBitmap;
+ m_pCachedBitmap = NULL;
+ if (m_pGlobalStream) {
+ delete m_pGlobalStream;
+ }
+ m_pGlobalStream = NULL;
+ pJbig2Moudle->DestroyJbig2Context(m_pJbig2Context);
+ m_pJbig2Context = NULL;
+ return 0;
+ }
+ if (ret == FXCODEC_STATUS_DECODE_TOBECONTINUE) {
+ return 2;
+ }
+ int ret1 = 1;
+ if (m_bHasMask) {
+ ret1 = ContinueLoadMaskDIB(pPause);
+ m_Status = 2;
+ }
+ if (ret1 == 2) {
+ return ret1;
+ }
+ if (m_pColorSpace && m_bStdCS) {
+ m_pColorSpace->EnableStdConversion(FALSE);
+ }
+ return ret1;
+ }
+ FXCODEC_STATUS ret = pJbig2Moudle->ContinueDecode(m_pJbig2Context, pPause);
+ if (ret < 0) {
+ delete m_pCachedBitmap;
+ m_pCachedBitmap = NULL;
+ if (m_pGlobalStream) {
+ delete m_pGlobalStream;
+ }
+ m_pGlobalStream = NULL;
+ pJbig2Moudle->DestroyJbig2Context(m_pJbig2Context);
+ m_pJbig2Context = NULL;
+ return 0;
+ }
+ if (ret == FXCODEC_STATUS_DECODE_TOBECONTINUE) {
+ return 2;
+ }
+ int ret1 = 1;
+ if (m_bHasMask) {
+ ret1 = ContinueLoadMaskDIB(pPause);
+ m_Status = 2;
+ }
+ if (ret1 == 2) {
+ return ret1;
+ }
+ if (m_pColorSpace && m_bStdCS) {
+ m_pColorSpace->EnableStdConversion(FALSE);
+ }
+ return ret1;
+ } else if (m_Status == 2) {
+ return ContinueLoadMaskDIB(pPause);
+ }
+ return 0;
+}
+FX_BOOL CPDF_DIBSource::LoadColorInfo(CPDF_Dictionary* pFormResources, CPDF_Dictionary* pPageResources)
+{
+ if (m_pDict->GetInteger("ImageMask")) {
+ m_bImageMask = TRUE;
+ }
+ if (m_bImageMask || !m_pDict->KeyExist(FX_BSTRC("ColorSpace"))) {
+ if (!m_bImageMask) {
+ CPDF_Object* pFilter = m_pDict->GetElementValue(FX_BSTRC("Filter"));
+ if (pFilter) {
+ CFX_ByteString filter;
+ if (pFilter->GetType() == PDFOBJ_NAME) {
+ filter = pFilter->GetString();
+ if (filter == FX_BSTRC("JPXDecode")) {
+ return TRUE;
+ }
+ } else if (pFilter->GetType() == PDFOBJ_ARRAY) {
+ CPDF_Array* pArray = (CPDF_Array*)pFilter;
+ if (pArray->GetString(pArray->GetCount() - 1) == FX_BSTRC("JPXDecode")) {
+ return TRUE;
+ }
+ }
+ }
+ }
+ m_bImageMask = TRUE;
+ m_bpc = m_nComponents = 1;
+ CPDF_Array* pDecode = m_pDict->GetArray(FX_BSTRC("Decode"));
+ m_bDefaultDecode = pDecode == NULL || pDecode->GetInteger(0) == 0;
+ return TRUE;
+ }
+ CPDF_Object* pCSObj = m_pDict->GetElementValue(FX_BSTRC("ColorSpace"));
+ if (pCSObj == NULL) {
+ return FALSE;
+ }
+ CPDF_DocPageData* pDocPageData = m_pDocument->GetPageData();
+ if (pFormResources) {
+ m_pColorSpace = pDocPageData->GetColorSpace(pCSObj, pFormResources);
+ }
+ if (m_pColorSpace == NULL) {
+ m_pColorSpace = pDocPageData->GetColorSpace(pCSObj, pPageResources);
+ }
+ if (m_pColorSpace == NULL) {
+ return FALSE;
+ }
+ m_bpc = m_pDict->GetInteger(FX_BSTRC("BitsPerComponent"));
+ m_Family = m_pColorSpace->GetFamily();
+ m_nComponents = m_pColorSpace->CountComponents();
+ if (m_Family == PDFCS_ICCBASED && pCSObj->GetType() == PDFOBJ_NAME) {
+ CFX_ByteString cs = pCSObj->GetString();
+ if (cs == FX_BSTRC("DeviceGray")) {
+ m_nComponents = 1;
+ } else if (cs == FX_BSTRC("DeviceRGB")) {
+ m_nComponents = 3;
+ } else if (cs == FX_BSTRC("DeviceCMYK")) {
+ m_nComponents = 4;
+ }
+ }
+ m_pCompData = FX_Alloc(DIB_COMP_DATA, m_nComponents);
+ if (m_bpc == 0) {
+ return TRUE;
+ }
+ int max_data = (1 << m_bpc) - 1;
+ CPDF_Array* pDecode = m_pDict->GetArray(FX_BSTRC("Decode"));
+ if (pDecode) {
+ for (FX_DWORD i = 0; i < m_nComponents; i ++) {
+ m_pCompData[i].m_DecodeMin = pDecode->GetNumber(i * 2);
+ FX_FLOAT max = pDecode->GetNumber(i * 2 + 1);
+ m_pCompData[i].m_DecodeStep = (max - m_pCompData[i].m_DecodeMin) / max_data;
+ FX_FLOAT def_value, def_min, def_max;
+ m_pColorSpace->GetDefaultValue(i, def_value, def_min, def_max);
+ if (m_Family == PDFCS_INDEXED) {
+ def_max = (FX_FLOAT)max_data;
+ }
+ if (def_min != m_pCompData[i].m_DecodeMin || def_max != max) {
+ m_bDefaultDecode = FALSE;
+ }
+ }
+ } else {
+ for (FX_DWORD i = 0; i < m_nComponents; i ++) {
+ FX_FLOAT def_value;
+ m_pColorSpace->GetDefaultValue(i, def_value, m_pCompData[i].m_DecodeMin, m_pCompData[i].m_DecodeStep);
+ if (m_Family == PDFCS_INDEXED) {
+ m_pCompData[i].m_DecodeStep = (FX_FLOAT)max_data;
+ }
+ m_pCompData[i].m_DecodeStep = (m_pCompData[i].m_DecodeStep - m_pCompData[i].m_DecodeMin) / max_data;
+ }
+ }
+ if (!m_pDict->KeyExist(FX_BSTRC("SMask"))) {
+ CPDF_Object* pMask = m_pDict->GetElementValue(FX_BSTRC("Mask"));
+ if (pMask == NULL) {
+ return TRUE;
+ }
+ if (pMask->GetType() == PDFOBJ_ARRAY) {
+ CPDF_Array* pArray = (CPDF_Array*)pMask;
+ if (pArray->GetCount() >= m_nComponents * 2)
+ for (FX_DWORD i = 0; i < m_nComponents * 2; i ++) {
+ if (i % 2) {
+ m_pCompData[i / 2].m_ColorKeyMax = pArray->GetInteger(i);
+ } else {
+ m_pCompData[i / 2].m_ColorKeyMin = pArray->GetInteger(i);
+ }
+ }
+ m_bColorKey = TRUE;
+ }
+ }
+ return TRUE;
+}
+ICodec_ScanlineDecoder* FPDFAPI_CreateFaxDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height,
+ const CPDF_Dictionary* pParams);
+ICodec_ScanlineDecoder* FPDFAPI_CreateFlateDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height,
+ int nComps, int bpc, const CPDF_Dictionary* pParams);
+int CPDF_DIBSource::CreateDecoder()
+{
+ const CFX_ByteString& decoder = m_pStreamAcc->GetImageDecoder();
+ if (decoder.IsEmpty()) {
+ return 1;
+ }
+ FX_LPCBYTE src_data = m_pStreamAcc->GetData();
+ FX_DWORD src_size = m_pStreamAcc->GetSize();
+ const CPDF_Dictionary* pParams = m_pStreamAcc->GetImageParam();
+ if (decoder == FX_BSTRC("CCITTFaxDecode")) {
+ m_pDecoder = FPDFAPI_CreateFaxDecoder(src_data, src_size, m_Width, m_Height, pParams);
+ } else if (decoder == FX_BSTRC("DCTDecode")) {
+ m_pDecoder = CPDF_ModuleMgr::Get()->GetJpegModule()->CreateDecoder(src_data, src_size, m_Width, m_Height,
+ m_nComponents, pParams ? pParams->GetInteger(FX_BSTR("ColorTransform"), 1) : 1);
+ if (NULL == m_pDecoder) {
+ FX_BOOL bTransform = FALSE;
+ int comps, bpc;
+ ICodec_JpegModule* pJpegModule = CPDF_ModuleMgr::Get()->GetJpegModule();
+ if (pJpegModule->LoadInfo(src_data, src_size, m_Width, m_Height, comps, bpc, bTransform)) {
+ m_nComponents = comps;
+ m_bpc = bpc;
+ m_pDecoder = CPDF_ModuleMgr::Get()->GetJpegModule()->CreateDecoder(src_data, src_size, m_Width, m_Height,
+ m_nComponents, bTransform);
+ }
+ }
+ } else if (decoder == FX_BSTRC("FlateDecode")) {
+ m_pDecoder = FPDFAPI_CreateFlateDecoder(src_data, src_size, m_Width, m_Height, m_nComponents, m_bpc, pParams);
+ } else if (decoder == FX_BSTRC("JPXDecode")) {
+ LoadJpxBitmap();
+ return m_pCachedBitmap != NULL ? 1 : 0;
+ } else if (decoder == FX_BSTRC("JBIG2Decode")) {
+ m_pCachedBitmap = FX_NEW CFX_DIBitmap;
+ if (!m_pCachedBitmap->Create(m_Width, m_Height, m_bImageMask ? FXDIB_1bppMask : FXDIB_1bppRgb)) {
+ delete m_pCachedBitmap;
+ m_pCachedBitmap = NULL;
+ return 0;
+ }
+ m_Status = 1;
+ return 2;
+ } else if (decoder == FX_BSTRC("RunLengthDecode")) {
+ m_pDecoder = CPDF_ModuleMgr::Get()->GetCodecModule()->GetBasicModule()->CreateRunLengthDecoder(src_data, src_size, m_Width, m_Height, m_nComponents, m_bpc);
+ }
+ if (m_pDecoder) {
+ int requested_pitch = (m_Width * m_nComponents * m_bpc + 7) / 8;
+ int provided_pitch = (m_pDecoder->GetWidth() * m_pDecoder->CountComps() * m_pDecoder->GetBPC() + 7) / 8;
+ if (provided_pitch < requested_pitch) {
+ return 0;
+ }
+ return 1;
+ }
+ return 0;
+}
+void CPDF_DIBSource::LoadJpxBitmap()
+{
+ ICodec_JpxModule* pJpxModule = CPDF_ModuleMgr::Get()->GetJpxModule();
+ if (pJpxModule == NULL) {
+ return;
+ }
+ FX_LPVOID ctx = pJpxModule->CreateDecoder(m_pStreamAcc->GetData(), m_pStreamAcc->GetSize(), m_pColorSpace != NULL);
+ if (ctx == NULL) {
+ return;
+ }
+ FX_DWORD width = 0, height = 0, codestream_nComps = 0, image_nComps = 0;
+ pJpxModule->GetImageInfo(ctx, width, height, codestream_nComps, image_nComps);
+ if ((int)width < m_Width || (int)height < m_Height) {
+ pJpxModule->DestroyDecoder(ctx);
+ return;
+ }
+ int output_nComps;
+ FX_BOOL bTranslateColor, bSwapRGB = FALSE;
+ if (m_pColorSpace) {
+ if (codestream_nComps != (FX_DWORD)m_pColorSpace->CountComponents()) {
+ return;
+ }
+ output_nComps = codestream_nComps;
+ bTranslateColor = FALSE;
+ if (m_pColorSpace == CPDF_ColorSpace::GetStockCS(PDFCS_DEVICERGB)) {
+ bSwapRGB = TRUE;
+ m_pColorSpace = NULL;
+ }
+ } else {
+ bTranslateColor = TRUE;
+ if (image_nComps) {
+ output_nComps = image_nComps;
+ } else {
+ output_nComps = codestream_nComps;
+ }
+ if (output_nComps == 3) {
+ bSwapRGB = TRUE;
+ } else if (output_nComps == 4) {
+ m_pColorSpace = CPDF_ColorSpace::GetStockCS(PDFCS_DEVICECMYK);
+ bTranslateColor = FALSE;
+ }
+ m_nComponents = output_nComps;
+ }
+ FXDIB_Format format;
+ if (output_nComps == 1) {
+ format = FXDIB_8bppRgb;
+ } else if (output_nComps <= 3) {
+ format = FXDIB_Rgb;
+ } else if (output_nComps == 4) {
+ format = FXDIB_Rgb32;
+ } else {
+ width = (width * output_nComps + 2) / 3;
+ format = FXDIB_Rgb;
+ }
+ m_pCachedBitmap = FX_NEW CFX_DIBitmap;
+ if (!m_pCachedBitmap->Create(width, height, format)) {
+ delete m_pCachedBitmap;
+ m_pCachedBitmap = NULL;
+ return;
+ }
+ m_pCachedBitmap->Clear(0xFFFFFFFF);
+ FX_LPBYTE output_offsets = FX_Alloc(FX_BYTE, output_nComps);
+ for (int i = 0; i < output_nComps; i ++) {
+ output_offsets[i] = i;
+ }
+ if (bSwapRGB) {
+ output_offsets[0] = 2;
+ output_offsets[2] = 0;
+ }
+ if (!pJpxModule->Decode(ctx, m_pCachedBitmap->GetBuffer(), m_pCachedBitmap->GetPitch(), bTranslateColor, output_offsets)) {
+ delete m_pCachedBitmap;
+ m_pCachedBitmap = NULL;
+ return;
+ }
+ FX_Free(output_offsets);
+ pJpxModule->DestroyDecoder(ctx);
+ if (m_pColorSpace && m_pColorSpace->GetFamily() == PDFCS_INDEXED && m_bpc < 8) {
+ int scale = 8 - m_bpc;
+ for (FX_DWORD row = 0; row < height; row ++) {
+ FX_LPBYTE scanline = (FX_LPBYTE)m_pCachedBitmap->GetScanline(row);
+ for (FX_DWORD col = 0; col < width; col ++) {
+ *scanline = (*scanline) >> scale;
+ scanline++;
+ }
+ }
+ }
+ m_bpc = 8;
+}
+void CPDF_DIBSource::LoadJbig2Bitmap()
+{
+ ICodec_Jbig2Module* pJbig2Module = CPDF_ModuleMgr::Get()->GetJbig2Module();
+ if (pJbig2Module == NULL) {
+ return;
+ }
+ CPDF_StreamAcc* pGlobalStream = NULL;
+ if (m_pStreamAcc->GetImageParam()) {
+ CPDF_Stream* pGlobals = m_pStreamAcc->GetImageParam()->GetStream(FX_BSTRC("JBIG2Globals"));
+ if (pGlobals) {
+ pGlobalStream = FX_NEW CPDF_StreamAcc;
+ pGlobalStream->LoadAllData(pGlobals, FALSE);
+ }
+ }
+ m_pCachedBitmap = FX_NEW CFX_DIBitmap;
+ if (!m_pCachedBitmap->Create(m_Width, m_Height, m_bImageMask ? FXDIB_1bppMask : FXDIB_1bppRgb)) {
+ return;
+ }
+ int ret = pJbig2Module->Decode(m_Width, m_Height, m_pStreamAcc->GetData(), m_pStreamAcc->GetSize(),
+ pGlobalStream ? pGlobalStream->GetData() : NULL, pGlobalStream ? pGlobalStream->GetSize() : 0,
+ m_pCachedBitmap->GetBuffer(), m_pCachedBitmap->GetPitch());
+ if (ret < 0) {
+ delete m_pCachedBitmap;
+ m_pCachedBitmap = NULL;
+ }
+ if (pGlobalStream) {
+ delete pGlobalStream;
+ }
+ m_bpc = 1;
+ m_nComponents = 1;
+}
+CPDF_DIBSource* CPDF_DIBSource::LoadMask(FX_DWORD& MatteColor)
+{
+ MatteColor = 0xffffffff;
+ CPDF_Stream* pSoftMask = m_pDict->GetStream(FX_BSTRC("SMask"));
+ if (pSoftMask) {
+ CPDF_Array* pMatte = pSoftMask->GetDict()->GetArray(FX_BSTRC("Matte"));
+ if (pMatte != NULL && m_pColorSpace && (FX_DWORD)m_pColorSpace->CountComponents() <= m_nComponents) {
+ FX_FLOAT* pColor = FX_Alloc(FX_FLOAT, m_nComponents);
+ for (FX_DWORD i = 0; i < m_nComponents; i ++) {
+ pColor[i] = pMatte->GetFloat(i);
+ }
+ FX_FLOAT R, G, B;
+ m_pColorSpace->GetRGB(pColor, R, G, B);
+ FX_Free(pColor);
+ MatteColor = FXARGB_MAKE(0, FXSYS_round(R * 255), FXSYS_round(G * 255), FXSYS_round(B * 255));
+ }
+ return LoadMaskDIB(pSoftMask);
+ }
+ CPDF_Object* pMask = m_pDict->GetElementValue(FX_BSTRC("Mask"));
+ if (pMask == NULL) {
+ return NULL;
+ }
+ if (pMask->GetType() == PDFOBJ_STREAM) {
+ return LoadMaskDIB((CPDF_Stream*)pMask);
+ }
+ return NULL;
+}
+int CPDF_DIBSource::StratLoadMask()
+{
+ m_MatteColor = 0xffffffff;
+ m_pMaskStream = m_pDict->GetStream(FX_BSTRC("SMask"));
+ if (m_pMaskStream) {
+ CPDF_Array* pMatte = m_pMaskStream->GetDict()->GetArray(FX_BSTRC("Matte"));
+ if (pMatte != NULL && m_pColorSpace && (FX_DWORD)m_pColorSpace->CountComponents() <= m_nComponents) {
+ FX_FLOAT R, G, B;
+ FX_FLOAT* pColor = FX_Alloc(FX_FLOAT, m_nComponents);
+ for (FX_DWORD i = 0; i < m_nComponents; i ++) {
+ pColor[i] = pMatte->GetFloat(i);
+ }
+ m_pColorSpace->GetRGB(pColor, R, G, B);
+ FX_Free(pColor);
+ m_MatteColor = FXARGB_MAKE(0, FXSYS_round(R * 255), FXSYS_round(G * 255), FXSYS_round(B * 255));
+ }
+ return StartLoadMaskDIB();
+ }
+ m_pMaskStream = m_pDict->GetElementValue(FX_BSTRC("Mask"));
+ if (m_pMaskStream == NULL) {
+ return 1;
+ }
+ if (m_pMaskStream->GetType() == PDFOBJ_STREAM) {
+ return StartLoadMaskDIB();
+ }
+ return 1;
+}
+int CPDF_DIBSource::ContinueLoadMaskDIB(IFX_Pause* pPause)
+{
+ if (m_pMask == NULL) {
+ return 1;
+ }
+ int ret = m_pMask->ContinueLoadDIBSource(pPause);
+ if (ret == 2) {
+ return ret;
+ }
+ if (m_pColorSpace && m_bStdCS) {
+ m_pColorSpace->EnableStdConversion(FALSE);
+ }
+ if (!ret) {
+ delete m_pMask;
+ m_pMask = NULL;
+ return ret;
+ }
+ return 1;
+}
+CPDF_DIBSource* CPDF_DIBSource::DetachMask()
+{
+ CPDF_DIBSource* pDIBSource = m_pMask;
+ m_pMask = NULL;
+ return pDIBSource;
+}
+CPDF_DIBSource* CPDF_DIBSource::LoadMaskDIB(CPDF_Stream* pMask)
+{
+ CPDF_DIBSource* pMaskSource = FX_NEW CPDF_DIBSource;
+ if (!pMaskSource->Load(m_pDocument, pMask, NULL, NULL, NULL, NULL, TRUE)) {
+ delete pMaskSource;
+ return NULL;
+ }
+ return pMaskSource;
+}
+int CPDF_DIBSource::StartLoadMaskDIB()
+{
+ m_pMask = FX_NEW CPDF_DIBSource;
+ int ret = m_pMask->StartLoadDIBSource(m_pDocument, (CPDF_Stream*)m_pMaskStream, FALSE, NULL, NULL, TRUE);
+ if (ret == 2) {
+ if (m_Status == 0) {
+ m_Status = 2;
+ }
+ return 2;
+ }
+ if (!ret) {
+ delete m_pMask;
+ m_pMask = NULL;
+ return 1;
+ }
+ return 1;
+}
+void CPDF_DIBSource::LoadPalette()
+{
+ if (m_bpc * m_nComponents > 8) {
+ return;
+ }
+ if (m_pColorSpace == NULL) {
+ return;
+ }
+ if (m_bpc * m_nComponents == 1) {
+ if (m_bDefaultDecode && (m_Family == PDFCS_DEVICEGRAY || m_Family == PDFCS_DEVICERGB)) {
+ return;
+ }
+ if (m_pColorSpace->CountComponents() > 3) {
+ return;
+ }
+ FX_FLOAT color_values[3];
+ color_values[0] = m_pCompData[0].m_DecodeMin;
+ color_values[1] = color_values[2] = color_values[0];
+ FX_FLOAT R, G, B;
+ m_pColorSpace->GetRGB(color_values, R, G, B);
+ FX_ARGB argb0 = ArgbEncode(255, FXSYS_round(R * 255), FXSYS_round(G * 255), FXSYS_round(B * 255));
+ color_values[0] += m_pCompData[0].m_DecodeStep;
+ color_values[1] += m_pCompData[0].m_DecodeStep;
+ color_values[2] += m_pCompData[0].m_DecodeStep;
+ m_pColorSpace->GetRGB(color_values, R, G, B);
+ FX_ARGB argb1 = ArgbEncode(255, FXSYS_round(R * 255), FXSYS_round(G * 255), FXSYS_round(B * 255));
+ if (argb0 != 0xFF000000 || argb1 != 0xFFFFFFFF) {
+ SetPaletteArgb(0, argb0);
+ SetPaletteArgb(1, argb1);
+ }
+ return;
+ }
+ if (m_pColorSpace == CPDF_ColorSpace::GetStockCS(PDFCS_DEVICEGRAY) && m_bpc == 8 && m_bDefaultDecode) {
+ } else {
+ int palette_count = 1 << (m_bpc * m_nComponents);
+ CFX_FixedBufGrow<FX_FLOAT, 16> color_values(m_nComponents);
+ FX_FLOAT* color_value = color_values;
+ for (int i = 0; i < palette_count; i ++) {
+ int color_data = i;
+ for (FX_DWORD j = 0; j < m_nComponents; j ++) {
+ int encoded_component = color_data % (1 << m_bpc);
+ color_data /= 1 << m_bpc;
+ color_value[j] = m_pCompData[j].m_DecodeMin + m_pCompData[j].m_DecodeStep * encoded_component;
+ }
+ FX_FLOAT R = 0, G = 0, B = 0;
+ if (m_nComponents == 1 && m_Family == PDFCS_ICCBASED && m_pColorSpace->CountComponents() > 1) {
+ int nComponents = m_pColorSpace->CountComponents();
+ FX_FLOAT* temp_buf = FX_Alloc(FX_FLOAT, nComponents);
+ for (int i = 0; i < nComponents; i++) {
+ temp_buf[i] = *color_value;
+ }
+ m_pColorSpace->GetRGB(temp_buf, R, G, B);
+ FX_Free(temp_buf);
+ } else {
+ m_pColorSpace->GetRGB(color_value, R, G, B);
+ }
+ SetPaletteArgb(i, ArgbEncode(255, FXSYS_round(R * 255), FXSYS_round(G * 255), FXSYS_round(B * 255)));
+ }
+ }
+}
+
+FX_DWORD CPDF_DIBSource::GetValidBpp() const
+{
+ FX_DWORD bpc = m_bpc;
+ CPDF_Object * pFilter = m_pDict->GetElementValue(FX_BSTRC("Filter"));
+ if(pFilter)
+ {
+ if(pFilter->GetType() == PDFOBJ_NAME)
+ {
+ CFX_ByteString filter = pFilter->GetString();
+ if(filter == FX_BSTRC("CCITTFaxDecode") || filter == FX_BSTRC("JBIG2Decode") )
+ bpc = 1;
+ if(filter == FX_BSTRC("RunLengthDecode") || filter == FX_BSTRC("DCTDecode") )
+ bpc = 8;
+ }
+ else if (pFilter->GetType() == PDFOBJ_ARRAY)
+ {
+ CPDF_Array *pArray = (CPDF_Array *) pFilter;
+ if( pArray->GetString(pArray->GetCount() -1) == FX_BSTRC("CCITTFacDecode") ||
+ pArray->GetString(pArray->GetCount() -1) == FX_BSTRC("JBIG2Decode") )
+ bpc = 1;
+
+ if( pArray->GetString(pArray->GetCount() -1) == FX_BSTRC("RunLengthDecode") ||
+ pArray->GetString(pArray->GetCount() -1) == FX_BSTRC("DCTDecode") )
+ bpc = 8;
+ }
+ }
+
+ return bpc;
+}
+
+#define NORMALCOLOR_MAX(color, max) (color) > (max) ? (max) : (color) < 0 ? 0 : (color);
+void CPDF_DIBSource::TranslateScanline24bpp(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan) const
+{
+ int max_data = (1 << m_bpc) - 1;
+ if (m_bDefaultDecode) {
+ if (m_Family == PDFCS_DEVICERGB || m_Family == PDFCS_CALRGB) {
+ if (m_bpc == 16) {
+ FX_LPBYTE dest_pos = dest_scan;
+ FX_LPCBYTE src_pos = src_scan;
+ for (int col = 0; col < m_Width; col ++) {
+ *dest_scan++ = src_pos[4];
+ *dest_scan++ = src_pos[2];
+ *dest_scan++ = *src_pos;
+ src_pos += 6;
+ }
+ } else if (m_bpc == 8) {
+ FX_LPBYTE dest_pos = dest_scan;
+ FX_LPCBYTE src_pos = src_scan;
+ for (int column = 0; column < m_Width; column ++) {
+ *dest_scan++ = src_pos[2];
+ *dest_scan++ = src_pos[1];
+ *dest_scan++ = *src_pos;
+ src_pos += 3;
+ }
+ } else {
+ int src_bit_pos = 0;
+ int dest_byte_pos = 0;
+
+ FX_DWORD bpc = GetValidBpp();
+
+ for (int column = 0; column < m_Width; column ++) {
+ int R = _GetBits8(src_scan, src_bit_pos, bpc);
+ src_bit_pos += bpc;
+ int G = _GetBits8(src_scan, src_bit_pos, bpc);
+ src_bit_pos += bpc;
+ int B = _GetBits8(src_scan, src_bit_pos, bpc);
+ src_bit_pos += bpc;
+ R = NORMALCOLOR_MAX(R, max_data);
+ G = NORMALCOLOR_MAX(G, max_data);
+ B = NORMALCOLOR_MAX(B, max_data);
+ dest_scan[dest_byte_pos] = B * 255 / max_data;
+ dest_scan[dest_byte_pos + 1] = G * 255 / max_data;
+ dest_scan[dest_byte_pos + 2] = R * 255 / max_data;
+ dest_byte_pos += 3;
+ }
+ }
+ return;
+ } else if (m_bpc == 8) {
+ if (m_nComponents == m_pColorSpace->CountComponents())
+ m_pColorSpace->TranslateImageLine(dest_scan, src_scan, m_Width, m_Width, m_Height,
+ m_bLoadMask && m_GroupFamily == PDFCS_DEVICECMYK && m_Family == PDFCS_DEVICECMYK);
+ return;
+ }
+ }
+ CFX_FixedBufGrow<FX_FLOAT, 16> color_values1(m_nComponents);
+ FX_FLOAT* color_values = color_values1;
+ FX_FLOAT R, G, B;
+ if (m_bpc == 8) {
+ int src_byte_pos = 0;
+ int dest_byte_pos = 0;
+ for (int column = 0; column < m_Width; column ++) {
+ for (FX_DWORD color = 0; color < m_nComponents; color ++) {
+ int data = src_scan[src_byte_pos ++];
+ color_values[color] = m_pCompData[color].m_DecodeMin +
+ m_pCompData[color].m_DecodeStep * data;
+ }
+ if (m_bLoadMask && m_GroupFamily == PDFCS_DEVICECMYK && m_Family == PDFCS_DEVICECMYK) {
+ FX_FLOAT k = 1.0f - color_values[3];
+ R = (1.0f - color_values[0]) * k;
+ G = (1.0f - color_values[1]) * k;
+ B = (1.0f - color_values[2]) * k;
+ } else {
+ m_pColorSpace->GetRGB(color_values, R, G, B);
+ }
+ R = NORMALCOLOR_MAX(R, 1);
+ G = NORMALCOLOR_MAX(G, 1);
+ B = NORMALCOLOR_MAX(B, 1);
+ dest_scan[dest_byte_pos] = (FX_INT32)(B * 255);
+ dest_scan[dest_byte_pos + 1] = (FX_INT32)(G * 255);
+ dest_scan[dest_byte_pos + 2] = (FX_INT32)(R * 255);
+ dest_byte_pos += 3;
+ }
+ } else {
+ int src_bit_pos = 0;
+ int dest_byte_pos = 0;
+
+ FX_DWORD bpc = GetValidBpp();
+
+ for (int column = 0; column < m_Width; column ++) {
+ for (FX_DWORD color = 0; color < m_nComponents; color ++) {
+ int data = _GetBits8(src_scan, src_bit_pos, bpc);
+ color_values[color] = m_pCompData[color].m_DecodeMin +
+ m_pCompData[color].m_DecodeStep * data;
+ src_bit_pos += bpc;
+ }
+ if (m_bLoadMask && m_GroupFamily == PDFCS_DEVICECMYK && m_Family == PDFCS_DEVICECMYK) {
+ FX_FLOAT k = 1.0f - color_values[3];
+ R = (1.0f - color_values[0]) * k;
+ G = (1.0f - color_values[1]) * k;
+ B = (1.0f - color_values[2]) * k;
+ } else {
+ m_pColorSpace->GetRGB(color_values, R, G, B);
+ }
+ R = NORMALCOLOR_MAX(R, 1);
+ G = NORMALCOLOR_MAX(G, 1);
+ B = NORMALCOLOR_MAX(B, 1);
+ dest_scan[dest_byte_pos] = (FX_INT32)(B * 255);
+ dest_scan[dest_byte_pos + 1] = (FX_INT32)(G * 255);
+ dest_scan[dest_byte_pos + 2] = (FX_INT32)(R * 255);
+ dest_byte_pos += 3;
+ }
+ }
+}
+FX_LPBYTE CPDF_DIBSource::GetBuffer() const
+{
+ if (m_pCachedBitmap) {
+ return m_pCachedBitmap->GetBuffer();
+ }
+ return NULL;
+}
+FX_LPCBYTE CPDF_DIBSource::GetScanline(int line) const
+{
+ FX_DWORD src_pitch = (m_Width * m_bpc * m_nComponents + 7) / 8;
+ FX_LPCBYTE pSrcLine = NULL;
+ if (m_pCachedBitmap) {
+ if (line >= m_pCachedBitmap->GetHeight()) {
+ line = m_pCachedBitmap->GetHeight() - 1;
+ }
+ pSrcLine = m_pCachedBitmap->GetScanline(line);
+ } else if (m_pDecoder) {
+ pSrcLine = m_pDecoder->GetScanline(line);
+ } else {
+ if (m_pStreamAcc->GetSize() >= (line + 1) * src_pitch) {
+ pSrcLine = m_pStreamAcc->GetData() + line * src_pitch;
+ }
+ }
+ if (pSrcLine == NULL) {
+ FX_LPBYTE pLineBuf = m_pMaskedLine ? m_pMaskedLine : m_pLineBuf;
+ FXSYS_memset8(pLineBuf, 0xff, m_Pitch);
+ return pLineBuf;
+ }
+ if (m_bpc * m_nComponents == 1) {
+ if (m_bImageMask && m_bDefaultDecode) {
+ for (FX_DWORD i = 0; i < src_pitch; i ++) {
+ m_pLineBuf[i] = ~pSrcLine[i];
+ }
+ } else if (m_bColorKey) {
+ FX_DWORD reset_argb, set_argb;
+ reset_argb = m_pPalette ? m_pPalette[0] : 0xff000000;
+ set_argb = m_pPalette ? m_pPalette[1] : 0xffffffff;
+ if (m_pCompData[0].m_ColorKeyMin == 0) {
+ reset_argb = 0;
+ }
+ if (m_pCompData[0].m_ColorKeyMax == 1) {
+ set_argb = 0;
+ }
+ set_argb = FXARGB_TODIB(set_argb);
+ reset_argb = FXARGB_TODIB(reset_argb);
+ FX_DWORD* dest_scan = (FX_DWORD*)m_pMaskedLine;
+ for (int col = 0; col < m_Width; col ++) {
+ if (pSrcLine[col / 8] & (1 << (7 - col % 8))) {
+ *dest_scan = set_argb;
+ } else {
+ *dest_scan = reset_argb;
+ }
+ dest_scan ++;
+ }
+ return m_pMaskedLine;
+ } else {
+ FXSYS_memcpy32(m_pLineBuf, pSrcLine, src_pitch);
+ }
+ return m_pLineBuf;
+ }
+ if (m_bpc * m_nComponents <= 8) {
+ if (m_bpc == 8) {
+ FXSYS_memcpy32(m_pLineBuf, pSrcLine, src_pitch);
+ } else {
+ int src_bit_pos = 0;
+ for (int col = 0; col < m_Width; col ++) {
+ int color_index = 0;
+ for (FX_DWORD color = 0; color < m_nComponents; color ++) {
+ int data = _GetBits8(pSrcLine, src_bit_pos, m_bpc);
+ color_index |= data << (color * m_bpc);
+ src_bit_pos += m_bpc;
+ }
+ m_pLineBuf[col] = color_index;
+ }
+ }
+ if (m_bColorKey) {
+ FX_LPBYTE pDestPixel = m_pMaskedLine;
+ FX_LPCBYTE pSrcPixel = m_pLineBuf;
+ for (int col = 0; col < m_Width; col ++) {
+ FX_BYTE index = *pSrcPixel++;
+ if (m_pPalette) {
+ *pDestPixel++ = FXARGB_B(m_pPalette[index]);
+ *pDestPixel++ = FXARGB_G(m_pPalette[index]);
+ *pDestPixel++ = FXARGB_R(m_pPalette[index]);
+ } else {
+ *pDestPixel++ = index;
+ *pDestPixel++ = index;
+ *pDestPixel++ = index;
+ }
+ *pDestPixel = (index < m_pCompData[0].m_ColorKeyMin || index > m_pCompData[0].m_ColorKeyMax) ? 0xff : 0;
+ pDestPixel ++ ;
+ }
+ return m_pMaskedLine;
+ }
+ return m_pLineBuf;
+ }
+ if (m_bColorKey) {
+ if (m_nComponents == 3 && m_bpc == 8) {
+ FX_LPBYTE alpha_channel = m_pMaskedLine + 3;
+ for (int col = 0; col < m_Width; col ++) {
+ FX_LPCBYTE pPixel = pSrcLine + col * 3;
+ alpha_channel[col * 4] = (pPixel[0] < m_pCompData[0].m_ColorKeyMin ||
+ pPixel[0] > m_pCompData[0].m_ColorKeyMax ||
+ pPixel[1] < m_pCompData[1].m_ColorKeyMin || pPixel[1] > m_pCompData[1].m_ColorKeyMax ||
+ pPixel[2] < m_pCompData[2].m_ColorKeyMin || pPixel[2] > m_pCompData[2].m_ColorKeyMax) ? 0xff : 0;
+ }
+ } else {
+ FXSYS_memset8(m_pMaskedLine, 0xff, m_Pitch);
+ }
+ }
+ if (m_pColorSpace) {
+ TranslateScanline24bpp(m_pLineBuf, pSrcLine);
+ pSrcLine = m_pLineBuf;
+ }
+ if (m_bColorKey) {
+ FX_LPCBYTE pSrcPixel = pSrcLine;
+ FX_LPBYTE pDestPixel = m_pMaskedLine;
+ for (int col = 0; col < m_Width; col ++) {
+ *pDestPixel++ = *pSrcPixel++;
+ *pDestPixel++ = *pSrcPixel++;
+ *pDestPixel++ = *pSrcPixel++;
+ pDestPixel ++;
+ }
+ return m_pMaskedLine;
+ }
+ return pSrcLine;
+}
+FX_BOOL CPDF_DIBSource::SkipToScanline(int line, IFX_Pause* pPause) const
+{
+ if (m_pDecoder) {
+ return m_pDecoder->SkipToScanline(line, pPause);
+ }
+ return FALSE;
+}
+void CPDF_DIBSource::DownSampleScanline(int line, FX_LPBYTE dest_scan, int dest_bpp,
+ int dest_width, FX_BOOL bFlipX, int clip_left, int clip_width) const
+{
+ FX_DWORD src_width = m_Width;
+ FX_DWORD src_pitch = (src_width * m_bpc * m_nComponents + 7) / 8;
+ FX_LPCBYTE pSrcLine = NULL;
+ if (m_pCachedBitmap) {
+ pSrcLine = m_pCachedBitmap->GetScanline(line);
+ } else if (m_pDecoder) {
+ pSrcLine = m_pDecoder->GetScanline(line);
+ } else {
+ if (m_pStreamAcc->GetSize() >= (line + 1) * src_pitch) {
+ pSrcLine = m_pStreamAcc->GetData() + line * src_pitch;
+ }
+ }
+ int orig_Bpp = m_bpc * m_nComponents / 8;
+ int dest_Bpp = dest_bpp / 8;
+ if (pSrcLine == NULL) {
+ FXSYS_memset32(dest_scan, 0xff, dest_Bpp * clip_width);
+ return;
+ }
+ CFX_FixedBufGrow<FX_BYTE, 128> temp(orig_Bpp);
+ if (m_bpc * m_nComponents == 1) {
+ FX_DWORD set_argb = (FX_DWORD) - 1, reset_argb = 0;
+ if (m_bImageMask) {
+ if (m_bDefaultDecode) {
+ set_argb = 0;
+ reset_argb = (FX_DWORD) - 1;
+ }
+ } else if (m_bColorKey) {
+ reset_argb = m_pPalette ? m_pPalette[0] : 0xff000000;
+ set_argb = m_pPalette ? m_pPalette[1] : 0xffffffff;
+ if (m_pCompData[0].m_ColorKeyMin == 0) {
+ reset_argb = 0;
+ }
+ if (m_pCompData[0].m_ColorKeyMax == 1) {
+ set_argb = 0;
+ }
+ set_argb = FXARGB_TODIB(set_argb);
+ reset_argb = FXARGB_TODIB(reset_argb);
+ for (int i = 0; i < clip_width; i ++) {
+ FX_DWORD src_x = (clip_left + i) * src_width / dest_width;
+ if (bFlipX) {
+ src_x = src_width - src_x - 1;
+ }
+ src_x %= src_width;
+ if (pSrcLine[src_x / 8] & (1 << (7 - src_x % 8))) {
+ ((FX_DWORD*)dest_scan)[i] = set_argb;
+ } else {
+ ((FX_DWORD*)dest_scan)[i] = reset_argb;
+ }
+ }
+ return;
+ } else {
+ if (dest_Bpp == 1) {
+ } else if (m_pPalette) {
+ reset_argb = m_pPalette[0];
+ set_argb = m_pPalette[1];
+ }
+ }
+ for (int i = 0; i < clip_width; i ++) {
+ FX_DWORD src_x = (clip_left + i) * src_width / dest_width;
+ if (bFlipX) {
+ src_x = src_width - src_x - 1;
+ }
+ src_x %= src_width;
+ int dest_pos = i * dest_Bpp;
+ if (pSrcLine[src_x / 8] & (1 << (7 - src_x % 8))) {
+ if (dest_Bpp == 1) {
+ dest_scan[dest_pos] = (FX_BYTE)set_argb;
+ } else if (dest_Bpp == 3) {
+ dest_scan[dest_pos] = FXARGB_B(set_argb);
+ dest_scan[dest_pos + 1] = FXARGB_G(set_argb);
+ dest_scan[dest_pos + 2] = FXARGB_R(set_argb);
+ } else {
+ *(FX_DWORD*)(dest_scan + dest_pos) = set_argb;
+ }
+ } else {
+ if (dest_Bpp == 1) {
+ dest_scan[dest_pos] = (FX_BYTE)reset_argb;
+ } else if (dest_Bpp == 3) {
+ dest_scan[dest_pos] = FXARGB_B(reset_argb);
+ dest_scan[dest_pos + 1] = FXARGB_G(reset_argb);
+ dest_scan[dest_pos + 2] = FXARGB_R(reset_argb);
+ } else {
+ *(FX_DWORD*)(dest_scan + dest_pos) = reset_argb;
+ }
+ }
+ }
+ return;
+ } else if (m_bpc * m_nComponents <= 8) {
+ if (m_bpc < 8) {
+ int src_bit_pos = 0;
+ for (FX_DWORD col = 0; col < src_width; col ++) {
+ int color_index = 0;
+ for (FX_DWORD color = 0; color < m_nComponents; color ++) {
+ int data = _GetBits8(pSrcLine, src_bit_pos, m_bpc);
+ color_index |= data << (color * m_bpc);
+ src_bit_pos += m_bpc;
+ }
+ m_pLineBuf[col] = color_index;
+ }
+ pSrcLine = m_pLineBuf;
+ }
+ if (m_bColorKey) {
+ for (int i = 0; i < clip_width; i ++) {
+ FX_DWORD src_x = (clip_left + i) * src_width / dest_width;
+ if (bFlipX) {
+ src_x = src_width - src_x - 1;
+ }
+ src_x %= src_width;
+ FX_LPBYTE pDestPixel = dest_scan + i * 4;
+ FX_BYTE index = pSrcLine[src_x];
+ if (m_pPalette) {
+ *pDestPixel++ = FXARGB_B(m_pPalette[index]);
+ *pDestPixel++ = FXARGB_G(m_pPalette[index]);
+ *pDestPixel++ = FXARGB_R(m_pPalette[index]);
+ } else {
+ *pDestPixel++ = index;
+ *pDestPixel++ = index;
+ *pDestPixel++ = index;
+ }
+ *pDestPixel = (index < m_pCompData[0].m_ColorKeyMin || index > m_pCompData[0].m_ColorKeyMax) ? 0xff : 0;
+ }
+ return;
+ }
+ for (int i = 0; i < clip_width; i ++) {
+ FX_DWORD src_x = (clip_left + i) * src_width / dest_width;
+ if (bFlipX) {
+ src_x = src_width - src_x - 1;
+ }
+ src_x %= src_width;
+ FX_BYTE index = pSrcLine[src_x];
+ if (dest_Bpp == 1) {
+ dest_scan[i] = index;
+ } else {
+ int dest_pos = i * dest_Bpp;
+ FX_ARGB argb = m_pPalette[index];
+ dest_scan[dest_pos] = FXARGB_B(argb);
+ dest_scan[dest_pos + 1] = FXARGB_G(argb);
+ dest_scan[dest_pos + 2] = FXARGB_R(argb);
+ }
+ }
+ return;
+ } else {
+ int last_src_x = -1;
+ FX_ARGB last_argb;
+ FX_FLOAT orig_Not8Bpp = (FX_FLOAT)m_bpc * (FX_FLOAT)m_nComponents / 8.0f;
+ FX_FLOAT unit_To8Bpc = 255.0f / ((1 << m_bpc) - 1);
+ for (int i = 0; i < clip_width; i ++) {
+ int dest_x = clip_left + i;
+ FX_DWORD src_x = (bFlipX ? (dest_width - dest_x - 1) : dest_x) * (FX_INT64)src_width / dest_width;
+ src_x %= src_width;
+ FX_LPCBYTE pSrcPixel = NULL;
+ if (m_bpc % 8 == 0) {
+ pSrcPixel = pSrcLine + src_x * orig_Bpp;
+ } else {
+ pSrcPixel = pSrcLine + (int)(src_x * orig_Not8Bpp);
+ }
+ FX_LPBYTE pDestPixel = dest_scan + i * dest_Bpp;
+ FX_ARGB argb;
+ if (src_x == last_src_x) {
+ argb = last_argb;
+ } else {
+ if (m_pColorSpace) {
+ FX_BYTE color[4];
+ if (!m_bDefaultDecode) {
+ for (int i = 0; i < orig_Bpp; i ++) {
+ int color_value = (int)((m_pCompData[i].m_DecodeMin + m_pCompData[i].m_DecodeStep * (FX_FLOAT)pSrcPixel[i]) * 255.0f + 0.5f);
+ temp[i] = color_value > 255 ? 255 : (color_value < 0 ? 0 : color_value);
+ }
+ m_pColorSpace->TranslateImageLine(color, temp, 1, 0, 0, m_bLoadMask && m_GroupFamily == PDFCS_DEVICECMYK && m_Family == PDFCS_DEVICECMYK);
+ } else {
+ if (m_bpc < 8) {
+ int src_bit_pos = 0;
+ if (src_x % 2) {
+ src_bit_pos = 4;
+ }
+ int value = (1 << m_bpc) - 1;
+ for (FX_DWORD i = 0; i < m_nComponents; i ++) {
+ temp[i] = (FX_BYTE)(_GetBits8(pSrcPixel, src_bit_pos, m_bpc) * unit_To8Bpc);
+ src_bit_pos += m_bpc;
+ }
+ m_pColorSpace->TranslateImageLine(color, temp, 1, 0, 0, m_bLoadMask && m_GroupFamily == PDFCS_DEVICECMYK && m_Family == PDFCS_DEVICECMYK);
+ } else {
+ m_pColorSpace->TranslateImageLine(color, pSrcPixel, 1, 0, 0, m_bLoadMask && m_GroupFamily == PDFCS_DEVICECMYK && m_Family == PDFCS_DEVICECMYK);
+ }
+ }
+ argb = FXARGB_MAKE(0xff, color[2], color[1], color[0]);
+ } else {
+ argb = FXARGB_MAKE(0xff, pSrcPixel[2], pSrcPixel[1], pSrcPixel[0]);
+ }
+ if (m_bColorKey) {
+ int alpha = 0xff;
+ if (m_nComponents == 3 && m_bpc == 8) {
+ alpha = (pSrcPixel[0] < m_pCompData[0].m_ColorKeyMin ||
+ pSrcPixel[0] > m_pCompData[0].m_ColorKeyMax ||
+ pSrcPixel[1] < m_pCompData[1].m_ColorKeyMin ||
+ pSrcPixel[1] > m_pCompData[1].m_ColorKeyMax ||
+ pSrcPixel[2] < m_pCompData[2].m_ColorKeyMin ||
+ pSrcPixel[2] > m_pCompData[2].m_ColorKeyMax) ? 0xff : 0;
+ }
+ argb &= 0xffffff;
+ argb |= alpha << 24;
+ }
+ last_src_x = src_x;
+ last_argb = argb;
+ }
+ if (dest_Bpp == 4) {
+ *(FX_DWORD*)pDestPixel = FXARGB_TODIB(argb);
+ } else {
+ *pDestPixel++ = FXARGB_B(argb);
+ *pDestPixel++ = FXARGB_G(argb);
+ *pDestPixel = FXARGB_R(argb);
+ }
+ }
+ }
+}
+void CPDF_DIBSource::SetDownSampleSize(int dest_width, int dest_height) const
+{
+ if (m_pDecoder) {
+ m_pDecoder->DownScale(dest_width, dest_height);
+ ((CPDF_DIBSource*)this)->m_Width = m_pDecoder->GetWidth();
+ ((CPDF_DIBSource*)this)->m_Height = m_pDecoder->GetHeight();
+ }
+}
+void CPDF_DIBSource::ClearImageData()
+{
+ if (m_pDecoder) {
+ m_pDecoder->ClearImageData();
+ }
+}
+CPDF_ProgressiveImageLoaderHandle::CPDF_ProgressiveImageLoaderHandle()
+{
+ m_pImageLoader = NULL;
+ m_pCache = NULL;
+ m_pImage = NULL;
+}
+CPDF_ProgressiveImageLoaderHandle::~CPDF_ProgressiveImageLoaderHandle()
+{
+ m_pImageLoader = NULL;
+ m_pCache = NULL;
+ m_pImage = NULL;
+}
+FX_BOOL CPDF_ProgressiveImageLoaderHandle::Start(CPDF_ImageLoader* pImageLoader, const CPDF_ImageObject* pImage, CPDF_PageRenderCache* pCache, FX_BOOL bStdCS, FX_DWORD GroupFamily, FX_BOOL bLoadMask, CPDF_RenderStatus* pRenderStatus, FX_INT32 nDownsampleWidth, FX_INT32 nDownsampleHeight)
+{
+ m_pImageLoader = pImageLoader;
+ m_pCache = pCache;
+ m_pImage = (CPDF_ImageObject*)pImage;
+ m_nDownsampleWidth = nDownsampleWidth;
+ m_nDownsampleHeight = nDownsampleHeight;
+ FX_BOOL ret;
+ if (pCache) {
+ ret = pCache->StartGetCachedBitmap(pImage->m_pImage->GetStream(), bStdCS, GroupFamily, bLoadMask, pRenderStatus, m_nDownsampleWidth, m_nDownsampleHeight);
+ if (ret == FALSE) {
+ m_pImageLoader->m_bCached = TRUE;
+ m_pImageLoader->m_pBitmap = pCache->m_pCurImageCache->DetachBitmap();
+ m_pImageLoader->m_pMask = pCache->m_pCurImageCache->DetachMask();
+ m_pImageLoader->m_MatteColor = pCache->m_pCurImageCache->m_MatteColor;
+ }
+ } else {
+ ret = pImage->m_pImage->StartLoadDIBSource(pRenderStatus->m_pFormResource, pRenderStatus->m_pPageResource, bStdCS, GroupFamily, bLoadMask);
+ if (ret == FALSE) {
+ m_pImageLoader->m_bCached = FALSE;
+ m_pImageLoader->m_pBitmap = m_pImage->m_pImage->DetachBitmap();
+ m_pImageLoader->m_pMask = m_pImage->m_pImage->DetachMask();
+ m_pImageLoader->m_MatteColor = m_pImage->m_pImage->m_MatteColor;
+ }
+ }
+ return ret;
+}
+FX_BOOL CPDF_ProgressiveImageLoaderHandle::Continue(IFX_Pause* pPause)
+{
+ FX_BOOL ret;
+ if (m_pCache) {
+ ret = m_pCache->Continue(pPause);
+ if (ret == FALSE) {
+ m_pImageLoader->m_bCached = TRUE;
+ m_pImageLoader->m_pBitmap = m_pCache->m_pCurImageCache->DetachBitmap();
+ m_pImageLoader->m_pMask = m_pCache->m_pCurImageCache->DetachMask();
+ m_pImageLoader->m_MatteColor = m_pCache->m_pCurImageCache->m_MatteColor;
+ }
+ } else {
+ ret = m_pImage->m_pImage->Continue(pPause);
+ if (ret == FALSE) {
+ m_pImageLoader->m_bCached = FALSE;
+ m_pImageLoader->m_pBitmap = m_pImage->m_pImage->DetachBitmap();
+ m_pImageLoader->m_pMask = m_pImage->m_pImage->DetachMask();
+ m_pImageLoader->m_MatteColor = m_pImage->m_pImage->m_MatteColor;
+ }
+ }
+ return ret;
+}
+FX_BOOL CPDF_ImageLoader::Load(const CPDF_ImageObject* pImage, CPDF_PageRenderCache* pCache, FX_BOOL bStdCS, FX_DWORD GroupFamily, FX_BOOL bLoadMask, CPDF_RenderStatus* pRenderStatus)
+{
+ if (pImage == NULL) {
+ return FALSE;
+ }
+ if (pCache) {
+ pCache->GetCachedBitmap(pImage->m_pImage->GetStream(), m_pBitmap, m_pMask, m_MatteColor, bStdCS, GroupFamily, bLoadMask, pRenderStatus, m_nDownsampleWidth, m_nDownsampleHeight);
+ m_bCached = TRUE;
+ } else {
+ m_pBitmap = pImage->m_pImage->LoadDIBSource(&m_pMask, &m_MatteColor, bStdCS, GroupFamily, bLoadMask);
+ m_bCached = FALSE;
+ }
+ return FALSE;
+}
+FX_BOOL CPDF_ImageLoader::StartLoadImage(const CPDF_ImageObject* pImage, CPDF_PageRenderCache* pCache, FX_LPVOID& LoadHandle, FX_BOOL bStdCS, FX_DWORD GroupFamily, FX_BOOL bLoadMask, CPDF_RenderStatus* pRenderStatus, FX_INT32 nDownsampleWidth, FX_INT32 nDownsampleHeight)
+{
+ m_nDownsampleWidth = nDownsampleWidth;
+ m_nDownsampleHeight = nDownsampleHeight;
+ CPDF_ProgressiveImageLoaderHandle* pLoaderHandle = NULL;
+ pLoaderHandle = FX_NEW CPDF_ProgressiveImageLoaderHandle;
+ FX_BOOL ret = pLoaderHandle->Start(this, pImage, pCache, bStdCS, GroupFamily, bLoadMask, pRenderStatus, m_nDownsampleWidth, m_nDownsampleHeight);
+ LoadHandle = pLoaderHandle;
+ return ret;
+}
+FX_BOOL CPDF_ImageLoader::Continue(FX_LPVOID LoadHandle, IFX_Pause* pPause)
+{
+ return ((CPDF_ProgressiveImageLoaderHandle*)LoadHandle)->Continue(pPause);
+}
+CPDF_ImageLoader::~CPDF_ImageLoader()
+{
+ if (!m_bCached) {
+ if (m_pBitmap) {
+ delete m_pBitmap;
+ m_pBitmap = NULL;
+ }
+ if (m_pMask) {
+ delete m_pMask;
+ }
+ }
+}
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp
index 8cc30a72a1..4b4f929179 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp
@@ -1,1093 +1,1093 @@
-// 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
-
-#include "../../../include/fpdfapi/fpdf_render.h"
-#include "../../../include/fpdfapi/fpdf_pageobj.h"
-#include "../../../include/fxge/fx_ge.h"
-#include "../fpdf_page/pageint.h"
-#include "render_int.h"
-#define SHADING_STEPS 256
-static void _DrawAxialShading(CFX_DIBitmap* pBitmap, CFX_AffineMatrix* pObject2Bitmap,
- CPDF_Dictionary* pDict, CPDF_Function** pFuncs, int nFuncs,
- CPDF_ColorSpace* pCS, int alpha)
-{
- ASSERT(pBitmap->GetFormat() == FXDIB_Argb);
- CPDF_Array* pCoords = pDict->GetArray(FX_BSTRC("Coords"));
- if (pCoords == NULL) {
- return;
- }
- FX_FLOAT start_x = pCoords->GetNumber(0);
- FX_FLOAT start_y = pCoords->GetNumber(1);
- FX_FLOAT end_x = pCoords->GetNumber(2);
- FX_FLOAT end_y = pCoords->GetNumber(3);
- FX_FLOAT t_min = 0, t_max = 1.0f;
- CPDF_Array* pArray = pDict->GetArray(FX_BSTRC("Domain"));
- if (pArray) {
- t_min = pArray->GetNumber(0);
- t_max = pArray->GetNumber(1);
- }
- FX_BOOL bStartExtend = FALSE, bEndExtend = FALSE;
- pArray = pDict->GetArray(FX_BSTRC("Extend"));
- if (pArray) {
- bStartExtend = pArray->GetInteger(0);
- bEndExtend = pArray->GetInteger(1);
- }
- int width = pBitmap->GetWidth();
- int height = pBitmap->GetHeight();
- FX_FLOAT x_span = end_x - start_x;
- FX_FLOAT y_span = end_y - start_y;
- FX_FLOAT axis_len_square = FXSYS_Mul(x_span, x_span) + FXSYS_Mul(y_span, y_span);
- CFX_AffineMatrix matrix;
- matrix.SetReverse(*pObject2Bitmap);
- int total_results = 0;
- for (int j = 0; j < nFuncs; j ++) {
- if (pFuncs[j]) {
- total_results += pFuncs[j]->CountOutputs();
- }
- }
- if (pCS->CountComponents() > total_results) {
- total_results = pCS->CountComponents();
- }
- CFX_FixedBufGrow<FX_FLOAT, 16> result_array(total_results);
- FX_FLOAT* pResults = result_array;
- FXSYS_memset32(pResults, 0, total_results * sizeof(FX_FLOAT));
- FX_DWORD rgb_array[SHADING_STEPS];
- for (int i = 0; i < SHADING_STEPS; i ++) {
- FX_FLOAT input = (t_max - t_min) * i / SHADING_STEPS + t_min;
- int offset = 0;
- for (int j = 0; j < nFuncs; j ++) {
- if (pFuncs[j]) {
- int nresults = 0;
- if (pFuncs[j]->Call(&input, 1, pResults + offset, nresults)) {
- offset += nresults;
- }
- }
- }
- FX_FLOAT R, G, B;
- pCS->GetRGB(pResults, R, G, B);
- rgb_array[i] = FXARGB_TODIB(FXARGB_MAKE(alpha, FXSYS_round(R * 255), FXSYS_round(G * 255), FXSYS_round(B * 255)));
- }
- int pitch = pBitmap->GetPitch();
- int Bpp = pBitmap->GetBPP() / 8;
- for (int row = 0; row < height; row ++) {
- FX_DWORD* dib_buf = (FX_DWORD*)(pBitmap->GetBuffer() + row * pitch);
- for (int column = 0; column < width; column ++) {
- FX_FLOAT x = (FX_FLOAT)column, y = (FX_FLOAT)row;
- matrix.Transform(x, y);
- FX_FLOAT scale = FXSYS_Div(FXSYS_Mul(x - start_x, x_span) + FXSYS_Mul(y - start_y, y_span), axis_len_square);
- int index = (FX_INT32)(scale * (SHADING_STEPS - 1));
- if (index < 0) {
- if (!bStartExtend) {
- continue;
- }
- index = 0;
- } else if (index >= SHADING_STEPS) {
- if (!bEndExtend) {
- continue;
- }
- index = SHADING_STEPS - 1;
- }
- dib_buf[column] = rgb_array[index];
- }
- }
-}
-static void _DrawRadialShading(CFX_DIBitmap* pBitmap, CFX_AffineMatrix* pObject2Bitmap,
- CPDF_Dictionary* pDict, CPDF_Function** pFuncs, int nFuncs,
- CPDF_ColorSpace* pCS, int alpha)
-{
- ASSERT(pBitmap->GetFormat() == FXDIB_Argb);
- CPDF_Array* pCoords = pDict->GetArray(FX_BSTRC("Coords"));
- if (pCoords == NULL) {
- return;
- }
- FX_FLOAT start_x = pCoords->GetNumber(0);
- FX_FLOAT start_y = pCoords->GetNumber(1);
- FX_FLOAT start_r = pCoords->GetNumber(2);
- FX_FLOAT end_x = pCoords->GetNumber(3);
- FX_FLOAT end_y = pCoords->GetNumber(4);
- FX_FLOAT end_r = pCoords->GetNumber(5);
- CFX_AffineMatrix matrix;
- matrix.SetReverse(*pObject2Bitmap);
- FX_FLOAT t_min = 0, t_max = 1.0f;
- CPDF_Array* pArray = pDict->GetArray(FX_BSTRC("Domain"));
- if (pArray) {
- t_min = pArray->GetNumber(0);
- t_max = pArray->GetNumber(1);
- }
- FX_BOOL bStartExtend = FALSE, bEndExtend = FALSE;
- pArray = pDict->GetArray(FX_BSTRC("Extend"));
- if (pArray) {
- bStartExtend = pArray->GetInteger(0);
- bEndExtend = pArray->GetInteger(1);
- }
- int total_results = 0;
- for (int j = 0; j < nFuncs; j ++) {
- if (pFuncs[j]) {
- total_results += pFuncs[j]->CountOutputs();
- }
- }
- if (pCS->CountComponents() > total_results) {
- total_results = pCS->CountComponents();
- }
- CFX_FixedBufGrow<FX_FLOAT, 16> result_array(total_results);
- FX_FLOAT* pResults = result_array;
- FXSYS_memset32(pResults, 0, total_results * sizeof(FX_FLOAT));
- FX_DWORD rgb_array[SHADING_STEPS];
- for (int i = 0; i < SHADING_STEPS; i ++) {
- FX_FLOAT input = (t_max - t_min) * i / SHADING_STEPS + t_min;
- int offset = 0;
- for (int j = 0; j < nFuncs; j ++) {
- if (pFuncs[j]) {
- int nresults;
- if (pFuncs[j]->Call(&input, 1, pResults + offset, nresults)) {
- offset += nresults;
- }
- }
- }
- FX_FLOAT R, G, B;
- pCS->GetRGB(pResults, R, G, B);
- rgb_array[i] = FXARGB_TODIB(FXARGB_MAKE(alpha, FXSYS_round(R * 255), FXSYS_round(G * 255), FXSYS_round(B * 255)));
- }
- FX_FLOAT a = FXSYS_Mul(start_x - end_x, start_x - end_x) +
- FXSYS_Mul(start_y - end_y, start_y - end_y) - FXSYS_Mul(start_r - end_r, start_r - end_r);
- int width = pBitmap->GetWidth();
- int height = pBitmap->GetHeight();
- int pitch = pBitmap->GetPitch();
- int Bpp = pBitmap->GetBPP() / 8;
- FX_BOOL bDecreasing = FALSE;
- if (start_r > end_r) {
- int length = (int)FXSYS_sqrt((FXSYS_Mul(start_x - end_x, start_x - end_x) + FXSYS_Mul(start_y - end_y, start_y - end_y)));
- if (length < start_r - end_r) {
- bDecreasing = TRUE;
- }
- }
- for (int row = 0; row < height; row ++) {
- FX_DWORD* dib_buf = (FX_DWORD*)(pBitmap->GetBuffer() + row * pitch);
- for (int column = 0; column < width; column ++) {
- FX_FLOAT x = (FX_FLOAT)column, y = (FX_FLOAT)row;
- matrix.Transform(x, y);
- FX_FLOAT b = -2 * (FXSYS_Mul(x - start_x, end_x - start_x) + FXSYS_Mul(y - start_y, end_y - start_y) +
- FXSYS_Mul(start_r, end_r - start_r));
- FX_FLOAT c = FXSYS_Mul(x - start_x, x - start_x) + FXSYS_Mul(y - start_y, y - start_y) -
- FXSYS_Mul(start_r, start_r);
- FX_FLOAT s;
- if (a == 0) {
- s = FXSYS_Div(-c, b);
- } else {
- FX_FLOAT b2_4ac = FXSYS_Mul(b, b) - 4 * FXSYS_Mul(a, c);
- if (b2_4ac < 0) {
- continue;
- }
- FX_FLOAT root = FXSYS_sqrt(b2_4ac);
- FX_FLOAT s1, s2;
- if (a > 0) {
- s1 = FXSYS_Div(-b - root, 2 * a);
- s2 = FXSYS_Div(-b + root, 2 * a);
- } else {
- s2 = FXSYS_Div(-b - root, 2 * a);
- s1 = FXSYS_Div(-b + root, 2 * a);
- }
- if (bDecreasing) {
- if (s1 >= 0 || bStartExtend) {
- s = s1;
- } else {
- s = s2;
- }
- } else {
- if (s2 <= 1.0f || bEndExtend) {
- s = s2;
- } else {
- s = s1;
- }
- }
- if ((start_r + s * (end_r - start_r)) < 0) {
- continue;
- }
- }
- int index = (FX_INT32)(s * (SHADING_STEPS - 1));
- if (index < 0) {
- if (!bStartExtend) {
- continue;
- }
- index = 0;
- }
- if (index >= SHADING_STEPS) {
- if (!bEndExtend) {
- continue;
- }
- index = SHADING_STEPS - 1;
- }
- dib_buf[column] = rgb_array[index];
- }
- }
-}
-static void _DrawFuncShading(CFX_DIBitmap* pBitmap, CFX_AffineMatrix* pObject2Bitmap,
- CPDF_Dictionary* pDict, CPDF_Function** pFuncs, int nFuncs,
- CPDF_ColorSpace* pCS, int alpha)
-{
- ASSERT(pBitmap->GetFormat() == FXDIB_Argb);
- CPDF_Array* pDomain = pDict->GetArray(FX_BSTRC("Domain"));
- FX_FLOAT xmin = 0, ymin = 0, xmax = 1.0f, ymax = 1.0f;
- if (pDomain) {
- xmin = pDomain->GetNumber(0);
- xmax = pDomain->GetNumber(1);
- ymin = pDomain->GetNumber(2);
- ymax = pDomain->GetNumber(3);
- }
- CFX_AffineMatrix mtDomain2Target = pDict->GetMatrix(FX_BSTRC("Matrix"));
- CFX_AffineMatrix matrix, reverse_matrix;
- matrix.SetReverse(*pObject2Bitmap);
- reverse_matrix.SetReverse(mtDomain2Target);
- matrix.Concat(reverse_matrix);
- int width = pBitmap->GetWidth();
- int height = pBitmap->GetHeight();
- int pitch = pBitmap->GetPitch();
- int Bpp = pBitmap->GetBPP() / 8;
- int total_results = 0;
- for (int j = 0; j < nFuncs; j ++) {
- if (pFuncs[j]) {
- total_results += pFuncs[j]->CountOutputs();
- }
- }
- if (pCS->CountComponents() > total_results) {
- total_results = pCS->CountComponents();
- }
- CFX_FixedBufGrow<FX_FLOAT, 16> result_array(total_results);
- FX_FLOAT* pResults = result_array;
- FXSYS_memset32(pResults, 0, total_results * sizeof(FX_FLOAT));
- for (int row = 0; row < height; row ++) {
- FX_DWORD* dib_buf = (FX_DWORD*)(pBitmap->GetBuffer() + row * pitch);
- for (int column = 0; column < width; column ++) {
- FX_FLOAT x = (FX_FLOAT)column, y = (FX_FLOAT)row;
- matrix.Transform(x, y);
- if (x < xmin || x > xmax || y < ymin || y > ymax) {
- continue;
- }
- FX_FLOAT input[2];
- int offset = 0;
- input[0] = x;
- input[1] = y;
- for (int j = 0; j < nFuncs; j ++) {
- if (pFuncs[j]) {
- int nresults;
- if (pFuncs[j]->Call(input, 2, pResults + offset, nresults)) {
- offset += nresults;
- }
- }
- }
- FX_FLOAT R, G, B;
- pCS->GetRGB(pResults, R, G, B);
- dib_buf[column] = FXARGB_TODIB(FXARGB_MAKE(alpha, (FX_INT32)(R * 255), (FX_INT32)(G * 255), (FX_INT32)(B * 255)));
- }
- }
-}
-FX_BOOL _GetScanlineIntersect(int y, FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, FX_FLOAT& x)
-{
- if (y1 == y2) {
- return FALSE;
- }
- if (y1 < y2) {
- if (y < y1 || y > y2) {
- return FALSE;
- }
- } else {
- if (y < y2 || y > y1) {
- return FALSE;
- }
- }
- x = x1 + FXSYS_MulDiv(x2 - x1, y - y1, y2 - y1);
- return TRUE;
-}
-static void _DrawGouraud(CFX_DIBitmap* pBitmap, int alpha, CPDF_MeshVertex triangle[3])
-{
- FX_FLOAT min_y = triangle[0].y, max_y = triangle[0].y;
- for (int i = 1; i < 3; i ++) {
- if (min_y > triangle[i].y) {
- min_y = triangle[i].y;
- }
- if (max_y < triangle[i].y) {
- max_y = triangle[i].y;
- }
- }
- if (min_y == max_y) {
- return;
- }
- int min_yi = (int)FXSYS_floor(min_y), max_yi = (int)FXSYS_ceil(max_y);
- if (min_yi < 0) {
- min_yi = 0;
- }
- if (max_yi >= pBitmap->GetHeight()) {
- max_yi = pBitmap->GetHeight() - 1;
- }
- for (int y = min_yi; y <= max_yi; y ++) {
- int nIntersects = 0;
- FX_FLOAT inter_x[3], r[3], g[3], b[3];
- for (int i = 0; i < 3; i ++) {
- CPDF_MeshVertex& vertex1 = triangle[i];
- CPDF_MeshVertex& vertex2 = triangle[(i + 1) % 3];
- FX_BOOL bIntersect = _GetScanlineIntersect(y, vertex1.x, vertex1.y,
- vertex2.x, vertex2.y, inter_x[nIntersects]);
- if (!bIntersect) {
- continue;
- }
- r[nIntersects] = vertex1.r + FXSYS_MulDiv(vertex2.r - vertex1.r, y - vertex1.y, vertex2.y - vertex1.y);
- g[nIntersects] = vertex1.g + FXSYS_MulDiv(vertex2.g - vertex1.g, y - vertex1.y, vertex2.y - vertex1.y);
- b[nIntersects] = vertex1.b + FXSYS_MulDiv(vertex2.b - vertex1.b, y - vertex1.y, vertex2.y - vertex1.y);
- nIntersects ++;
- }
- if (nIntersects != 2) {
- continue;
- }
- int min_x, max_x, start_index, end_index;
- if (inter_x[0] < inter_x[1]) {
- min_x = (int)FXSYS_floor(inter_x[0]);
- max_x = (int)FXSYS_ceil(inter_x[1]);
- start_index = 0;
- end_index = 1;
- } else {
- min_x = (int)FXSYS_floor(inter_x[1]);
- max_x = (int)FXSYS_ceil(inter_x[0]);
- start_index = 1;
- end_index = 0;
- }
- int start_x = min_x, end_x = max_x;
- if (start_x < 0) {
- start_x = 0;
- }
- if (end_x > pBitmap->GetWidth()) {
- end_x = pBitmap->GetWidth();
- }
- FX_LPBYTE dib_buf = pBitmap->GetBuffer() + y * pBitmap->GetPitch() + start_x * 4;
- FX_FLOAT r_unit = (r[end_index] - r[start_index]) / (max_x - min_x);
- FX_FLOAT g_unit = (g[end_index] - g[start_index]) / (max_x - min_x);
- FX_FLOAT b_unit = (b[end_index] - b[start_index]) / (max_x - min_x);
- FX_FLOAT R = r[start_index] + (start_x - min_x) * r_unit;
- FX_FLOAT G = g[start_index] + (start_x - min_x) * g_unit;
- FX_FLOAT B = b[start_index] + (start_x - min_x) * b_unit;
- for (int x = start_x; x < end_x; x ++) {
- R += r_unit;
- G += g_unit;
- B += b_unit;
- FXARGB_SETDIB(dib_buf, FXARGB_MAKE(alpha, (FX_INT32)(R * 255), (FX_INT32)(G * 255), (FX_INT32)(B * 255)));
- dib_buf += 4;
- }
- }
-}
-static void _DrawFreeGouraudShading(CFX_DIBitmap* pBitmap, CFX_AffineMatrix* pObject2Bitmap,
- CPDF_Stream* pShadingStream, CPDF_Function** pFuncs, int nFuncs,
- CPDF_ColorSpace* pCS, int alpha)
-{
- ASSERT(pBitmap->GetFormat() == FXDIB_Argb);
- if (pShadingStream->GetType() != PDFOBJ_STREAM) {
- return;
- }
- CPDF_MeshStream stream;
- if (!stream.Load(pShadingStream, pFuncs, nFuncs, pCS)) {
- return;
- }
- CPDF_MeshVertex triangle[3];
- while (!stream.m_BitStream.IsEOF()) {
- CPDF_MeshVertex vertex;
- FX_DWORD flag = stream.GetVertex(vertex, pObject2Bitmap);
- if (flag == 0) {
- triangle[0] = vertex;
- for (int j = 1; j < 3; j ++) {
- stream.GetVertex(triangle[j], pObject2Bitmap);
- }
- } else {
- if (flag == 1) {
- triangle[0] = triangle[1];
- }
- triangle[1] = triangle[2];
- triangle[2] = vertex;
- }
- _DrawGouraud(pBitmap, alpha, triangle);
- }
-}
-static void _DrawLatticeGouraudShading(CFX_DIBitmap* pBitmap, CFX_AffineMatrix* pObject2Bitmap,
- CPDF_Stream* pShadingStream, CPDF_Function** pFuncs, int nFuncs,
- CPDF_ColorSpace* pCS, int alpha)
-{
- ASSERT(pBitmap->GetFormat() == FXDIB_Argb);
- if (pShadingStream->GetType() != PDFOBJ_STREAM) {
- return;
- }
- int row_verts = pShadingStream->GetDict()->GetInteger("VerticesPerRow");
- if (row_verts < 2) {
- return;
- }
- CPDF_MeshStream stream;
- if (!stream.Load(pShadingStream, pFuncs, nFuncs, pCS)) {
- return;
- }
- CPDF_MeshVertex* vertex = FX_Alloc(CPDF_MeshVertex, row_verts * 2);
- if (!stream.GetVertexRow(vertex, row_verts, pObject2Bitmap)) {
- FX_Free(vertex);
- return;
- }
- int last_index = 0;
- while (1) {
- CPDF_MeshVertex* last_row = vertex + last_index * row_verts;
- CPDF_MeshVertex* this_row = vertex + (1 - last_index) * row_verts;
- if (!stream.GetVertexRow(this_row, row_verts, pObject2Bitmap)) {
- FX_Free(vertex);
- return;
- }
- CPDF_MeshVertex triangle[3];
- for (int i = 1; i < row_verts; i ++) {
- triangle[0] = last_row[i];
- triangle[1] = this_row[i - 1];
- triangle[2] = last_row[i - 1];
- _DrawGouraud(pBitmap, alpha, triangle);
- triangle[2] = this_row[i];
- _DrawGouraud(pBitmap, alpha, triangle);
- }
- last_index = 1 - last_index;
- }
- FX_Free(vertex);
-}
-struct Coon_BezierCoeff {
- float a, b, c, d;
- void FromPoints(float p0, float p1, float p2, float p3)
- {
- a = -p0 + 3 * p1 - 3 * p2 + p3;
- b = 3 * p0 - 6 * p1 + 3 * p2;
- c = -3 * p0 + 3 * p1;
- d = p0;
- }
- Coon_BezierCoeff first_half()
- {
- Coon_BezierCoeff result;
- result.a = a / 8;
- result.b = b / 4;
- result.c = c / 2;
- result.d = d;
- return result;
- }
- Coon_BezierCoeff second_half()
- {
- Coon_BezierCoeff result;
- result.a = a / 8;
- result.b = 3 * a / 8 + b / 4;
- result.c = 3 * a / 8 + b / 2 + c / 2;
- result.d = a / 8 + b / 4 + c / 2 + d;
- return result;
- }
- void GetPoints(float p[4])
- {
- p[0] = d;
- p[1] = c / 3 + p[0];
- p[2] = b / 3 - p[0] + 2 * p[1];
- p[3] = a + p[0] - 3 * p[1] + 3 * p[2];
- }
- void GetPointsReverse(float p[4])
- {
- p[3] = d;
- p[2] = c / 3 + p[3];
- p[1] = b / 3 - p[3] + 2 * p[2];
- p[0] = a + p[3] - 3 * p[2] + 3 * p[1];
- }
- void BezierInterpol(Coon_BezierCoeff& C1, Coon_BezierCoeff& C2, Coon_BezierCoeff& D1, Coon_BezierCoeff& D2)
- {
- a = (D1.a + D2.a) / 2;
- b = (D1.b + D2.b) / 2;
- c = (D1.c + D2.c) / 2 - (C1.a / 8 + C1.b / 4 + C1.c / 2) + (C2.a / 8 + C2.b / 4) + (-C1.d + D2.d) / 2 - (C2.a + C2.b) / 2;
- d = C1.a / 8 + C1.b / 4 + C1.c / 2 + C1.d;
- }
- float Distance()
- {
- float dis = a + b + c;
- return dis < 0 ? -dis : dis;
- }
-};
-struct Coon_Bezier {
- Coon_BezierCoeff x, y;
- void FromPoints(float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3)
- {
- x.FromPoints(x0, x1, x2, x3);
- y.FromPoints(y0, y1, y2, y3);
- }
- Coon_Bezier first_half()
- {
- Coon_Bezier result;
- result.x = x.first_half();
- result.y = y.first_half();
- return result;
- }
- Coon_Bezier second_half()
- {
- Coon_Bezier result;
- result.x = x.second_half();
- result.y = y.second_half();
- return result;
- }
- void BezierInterpol(Coon_Bezier& C1, Coon_Bezier& C2, Coon_Bezier& D1, Coon_Bezier& D2)
- {
- x.BezierInterpol(C1.x, C2.x, D1.x, D2.x);
- y.BezierInterpol(C1.y, C2.y, D1.y, D2.y);
- }
- void GetPoints(FX_PATHPOINT* pPoints)
- {
- float p[4];
- int i;
- x.GetPoints(p);
- for (i = 0; i < 4; i ++) {
- pPoints[i].m_PointX = p[i];
- }
- y.GetPoints(p);
- for (i = 0; i < 4; i ++) {
- pPoints[i].m_PointY = p[i];
- }
- }
- void GetPointsReverse(FX_PATHPOINT* pPoints)
- {
- float p[4];
- int i;
- x.GetPointsReverse(p);
- for (i = 0; i < 4; i ++) {
- pPoints[i].m_PointX = p[i];
- }
- y.GetPointsReverse(p);
- for (i = 0; i < 4; i ++) {
- pPoints[i].m_PointY = p[i];
- }
- }
- float Distance()
- {
- return x.Distance() + y.Distance();
- }
-};
-static int _BiInterpol(int c0, int c1, int c2, int c3, int x, int y, int x_scale, int y_scale)
-{
- int x1 = c0 + (c3 - c0) * x / x_scale;
- int x2 = c1 + (c2 - c1) * x / x_scale;
- return x1 + (x2 - x1) * y / y_scale;
-}
-struct Coon_Color {
- Coon_Color()
- {
- FXSYS_memset32(comp, 0, sizeof(int) * 3);
- }
- int comp[3];
- void BiInterpol(Coon_Color colors[4], int x, int y, int x_scale, int y_scale)
- {
- for (int i = 0; i < 3; i ++)
- comp[i] = _BiInterpol(colors[0].comp[i], colors[1].comp[i], colors[2].comp[i], colors[3].comp[i],
- x, y, x_scale, y_scale);
- }
- int Distance(Coon_Color& o)
- {
- int max, diff;
- max = FXSYS_abs(comp[0] - o.comp[0]);
- diff = FXSYS_abs(comp[1] - o.comp[1]);
- if (max < diff) {
- max = diff;
- }
- diff = FXSYS_abs(comp[2] - o.comp[2]);
- if (max < diff) {
- max = diff;
- }
- return max;
- }
-};
-struct CPDF_PatchDrawer {
- Coon_Color patch_colors[4];
- int max_delta;
- CFX_PathData path;
- CFX_RenderDevice* pDevice;
- int fill_mode;
- int alpha;
- void Draw(int x_scale, int y_scale, int left, int bottom, Coon_Bezier C1, Coon_Bezier C2, Coon_Bezier D1, Coon_Bezier D2)
- {
- FX_BOOL bSmall = C1.Distance() < 2 && C2.Distance() < 2 && D1.Distance() < 2 && D2.Distance() < 2;
- Coon_Color div_colors[4];
- int d_bottom, d_left, d_top, d_right;
- div_colors[0].BiInterpol(patch_colors, left, bottom, x_scale, y_scale);
- if (!bSmall) {
- div_colors[1].BiInterpol(patch_colors, left, bottom + 1, x_scale, y_scale);
- div_colors[2].BiInterpol(patch_colors, left + 1, bottom + 1, x_scale, y_scale);
- div_colors[3].BiInterpol(patch_colors, left + 1, bottom, x_scale, y_scale);
- d_bottom = div_colors[3].Distance(div_colors[0]);
- d_left = div_colors[1].Distance(div_colors[0]);
- d_top = div_colors[1].Distance(div_colors[2]);
- d_right = div_colors[2].Distance(div_colors[3]);
- }
-#define COONCOLOR_THRESHOLD 4
- if (bSmall || (d_bottom < COONCOLOR_THRESHOLD && d_left < COONCOLOR_THRESHOLD &&
- d_top < COONCOLOR_THRESHOLD && d_right < COONCOLOR_THRESHOLD)) {
- FX_PATHPOINT* pPoints = path.GetPoints();
- C1.GetPoints(pPoints);
- D2.GetPoints(pPoints + 3);
- C2.GetPointsReverse(pPoints + 6);
- D1.GetPointsReverse(pPoints + 9);
- int fillFlags = FXFILL_WINDING | FXFILL_FULLCOVER;
- if (fill_mode & RENDER_NOPATHSMOOTH) {
- fillFlags |= FXFILL_NOPATHSMOOTH;
- }
- pDevice->DrawPath(&path, NULL, NULL, FXARGB_MAKE(alpha, div_colors[0].comp[0], div_colors[0].comp[1], div_colors[0].comp[2]), 0, fillFlags);
- } else {
- if (d_bottom < COONCOLOR_THRESHOLD && d_top < COONCOLOR_THRESHOLD) {
- Coon_Bezier m1;
- m1.BezierInterpol(D1, D2, C1, C2);
- y_scale *= 2;
- bottom *= 2;
- Draw(x_scale, y_scale, left, bottom, C1, m1, D1.first_half(), D2.first_half());
- Draw(x_scale, y_scale, left, bottom + 1, m1, C2, D1.second_half(), D2.second_half());
- } else if (d_left < COONCOLOR_THRESHOLD && d_right < COONCOLOR_THRESHOLD) {
- Coon_Bezier m2;
- m2.BezierInterpol(C1, C2, D1, D2);
- x_scale *= 2;
- left *= 2;
- Draw(x_scale, y_scale, left, bottom, C1.first_half(), C2.first_half(), D1, m2);
- Draw(x_scale, y_scale, left + 1, bottom, C1.second_half(), C2.second_half(), m2, D2);
- } else {
- Coon_Bezier m1, m2;
- m1.BezierInterpol(D1, D2, C1, C2);
- m2.BezierInterpol(C1, C2, D1, D2);
- Coon_Bezier m1f = m1.first_half();
- Coon_Bezier m1s = m1.second_half();
- Coon_Bezier m2f = m2.first_half();
- Coon_Bezier m2s = m2.second_half();
- x_scale *= 2;
- y_scale *= 2;
- left *= 2;
- bottom *= 2;
- Draw(x_scale, y_scale, left, bottom, C1.first_half(), m1f, D1.first_half(), m2f);
- Draw(x_scale, y_scale, left, bottom + 1, m1f, C2.first_half(), D1.second_half(), m2s);
- Draw(x_scale, y_scale, left + 1, bottom, C1.second_half(), m1s, m2f, D2.first_half());
- Draw(x_scale, y_scale, left + 1, bottom + 1, m1s, C2.second_half(), m2s, D2.second_half());
- }
- }
- }
-};
-static void _DrawCoonPatchMeshes(FX_BOOL bTensor, CFX_DIBitmap* pBitmap, CFX_AffineMatrix* pObject2Bitmap,
- CPDF_Stream* pShadingStream, CPDF_Function** pFuncs, int nFuncs,
- CPDF_ColorSpace* pCS, int fill_mode, int alpha)
-{
- ASSERT(pBitmap->GetFormat() == FXDIB_Argb);
- if (pShadingStream->GetType() != PDFOBJ_STREAM) {
- return;
- }
- CFX_FxgeDevice device;
- device.Attach(pBitmap);
- CPDF_MeshStream stream;
- if (!stream.Load(pShadingStream, pFuncs, nFuncs, pCS)) {
- return;
- }
- CPDF_PatchDrawer patch;
- patch.alpha = alpha;
- patch.pDevice = &device;
- patch.fill_mode = fill_mode;
- patch.path.SetPointCount(13);
- FX_PATHPOINT* pPoints = patch.path.GetPoints();
- pPoints[0].m_Flag = FXPT_MOVETO;
- for (int i = 1; i < 13; i ++) {
- pPoints[i].m_Flag = FXPT_BEZIERTO;
- }
- CFX_FloatPoint coords[16];
- int point_count = bTensor ? 16 : 12;
- while (!stream.m_BitStream.IsEOF()) {
- FX_DWORD flag = stream.GetFlag();
- int iStartPoint = 0, iStartColor = 0, i;
- if (flag) {
- iStartPoint = 4;
- iStartColor = 2;
- CFX_FloatPoint tempCoords[4];
- for (int i = 0; i < 4; i ++) {
- tempCoords[i] = coords[(flag * 3 + i) % 12];
- }
- FXSYS_memcpy32(coords, tempCoords, sizeof(CFX_FloatPoint) * 4);
- Coon_Color tempColors[2];
- tempColors[0] = patch.patch_colors[flag];
- tempColors[1] = patch.patch_colors[(flag + 1) % 4];
- FXSYS_memcpy32(patch.patch_colors, tempColors, sizeof(Coon_Color) * 2);
- }
- for (i = iStartPoint; i < point_count; i ++) {
- stream.GetCoords(coords[i].x, coords[i].y);
- pObject2Bitmap->Transform(coords[i].x, coords[i].y);
- }
- for (i = iStartColor; i < 4; i ++) {
- FX_FLOAT r, g, b;
- stream.GetColor(r, g, b);
- patch.patch_colors[i].comp[0] = (FX_INT32)(r * 255);
- patch.patch_colors[i].comp[1] = (FX_INT32)(g * 255);
- patch.patch_colors[i].comp[2] = (FX_INT32)(b * 255);
- }
- CFX_FloatRect bbox = CFX_FloatRect::GetBBox(coords, point_count);
- if (bbox.right <= 0 || bbox.left >= (FX_FLOAT)pBitmap->GetWidth() || bbox.top <= 0 ||
- bbox.bottom >= (FX_FLOAT)pBitmap->GetHeight()) {
- continue;
- }
- Coon_Bezier C1, C2, D1, D2;
- C1.FromPoints(coords[0].x, coords[0].y, coords[11].x, coords[11].y, coords[10].x, coords[10].y,
- coords[9].x, coords[9].y);
- C2.FromPoints(coords[3].x, coords[3].y, coords[4].x, coords[4].y, coords[5].x, coords[5].y,
- coords[6].x, coords[6].y);
- D1.FromPoints(coords[0].x, coords[0].y, coords[1].x, coords[1].y, coords[2].x, coords[2].y,
- coords[3].x, coords[3].y);
- D2.FromPoints(coords[9].x, coords[9].y, coords[8].x, coords[8].y, coords[7].x, coords[7].y,
- coords[6].x, coords[6].y);
- patch.Draw(1, 1, 0, 0, C1, C2, D1, D2);
- }
-}
-void CPDF_RenderStatus::DrawShading(CPDF_ShadingPattern* pPattern, CFX_AffineMatrix* pMatrix,
- FX_RECT& clip_rect, int alpha, FX_BOOL bAlphaMode)
-{
- int width = clip_rect.Width();
- int height = clip_rect.Height();
- CPDF_Function** pFuncs = pPattern->m_pFunctions;
- int nFuncs = pPattern->m_nFuncs;
- CPDF_Dictionary* pDict = pPattern->m_pShadingObj->GetDict();
- CPDF_ColorSpace* pColorSpace = pPattern->m_pCS;
- if (pColorSpace == NULL) {
- return;
- }
- FX_ARGB background = 0;
- if (!pPattern->m_bShadingObj && pPattern->m_pShadingObj->GetDict()->KeyExist(FX_BSTRC("Background"))) {
- CPDF_Array* pBackColor = pPattern->m_pShadingObj->GetDict()->GetArray(FX_BSTRC("Background"));
- if (pBackColor && pBackColor->GetCount() >= (FX_DWORD)pColorSpace->CountComponents()) {
- CFX_FixedBufGrow<FX_FLOAT, 16> comps(pColorSpace->CountComponents());
- for (int i = 0; i < pColorSpace->CountComponents(); i ++) {
- comps[i] = pBackColor->GetNumber(i);
- }
- FX_FLOAT R, G, B;
- pColorSpace->GetRGB(comps, R, G, B);
- background = ArgbEncode(255, (FX_INT32)(R * 255), (FX_INT32)(G * 255), (FX_INT32)(B * 255));
- }
- }
- if (pDict->KeyExist(FX_BSTRC("BBox"))) {
- CFX_FloatRect rect = pDict->GetRect(FX_BSTRC("BBox"));
- rect.Transform(pMatrix);
- clip_rect.Intersect(rect.GetOutterRect());
- }
- CPDF_DeviceBuffer buffer;
- buffer.Initialize(m_pContext, m_pDevice, &clip_rect, m_pCurObj, 150);
- CFX_AffineMatrix FinalMatrix = *pMatrix;
- FinalMatrix.Concat(*buffer.GetMatrix());
- CFX_DIBitmap* pBitmap = buffer.GetBitmap();
- if (pBitmap->GetBuffer() == NULL) {
- return;
- }
- pBitmap->Clear(background);
- int fill_mode = m_Options.m_Flags;
- switch (pPattern->m_ShadingType) {
- case 1:
- _DrawFuncShading(pBitmap, &FinalMatrix, pDict, pFuncs, nFuncs, pColorSpace, alpha);
- break;
- case 2:
- _DrawAxialShading(pBitmap, &FinalMatrix, pDict, pFuncs, nFuncs, pColorSpace, alpha);
- break;
- case 3:
- _DrawRadialShading(pBitmap, &FinalMatrix, pDict, pFuncs, nFuncs, pColorSpace, alpha);
- break;
- case 4: {
- _DrawFreeGouraudShading(pBitmap, &FinalMatrix, (CPDF_Stream*)pPattern->m_pShadingObj,
- pFuncs, nFuncs, pColorSpace, alpha);
- }
- break;
- case 5: {
- _DrawLatticeGouraudShading(pBitmap, &FinalMatrix, (CPDF_Stream*)pPattern->m_pShadingObj,
- pFuncs, nFuncs, pColorSpace, alpha);
- }
- break;
- case 6:
- case 7: {
- _DrawCoonPatchMeshes(pPattern->m_ShadingType - 6, pBitmap, &FinalMatrix, (CPDF_Stream*)pPattern->m_pShadingObj,
- pFuncs, nFuncs, pColorSpace, fill_mode, alpha);
- }
- break;
- }
- if (bAlphaMode) {
- pBitmap->LoadChannel(FXDIB_Red, pBitmap, FXDIB_Alpha);
- }
- if (m_Options.m_ColorMode == RENDER_COLOR_GRAY) {
- pBitmap->ConvertColorScale(m_Options.m_ForeColor, m_Options.m_BackColor);
- }
- buffer.OutputToDevice();
-}
-void CPDF_RenderStatus::DrawShadingPattern(CPDF_ShadingPattern* pattern, CPDF_PageObject* pPageObj, const CFX_AffineMatrix* pObj2Device, FX_BOOL bStroke)
-{
- if (!pattern->Load()) {
- return;
- }
- m_pDevice->SaveState();
- if (pPageObj->m_Type == PDFPAGE_PATH) {
- if (!SelectClipPath((CPDF_PathObject*)pPageObj, pObj2Device, bStroke)) {
- m_pDevice->RestoreState();
- return;
- }
- } else if (pPageObj->m_Type == PDFPAGE_IMAGE) {
- FX_RECT rect = pPageObj->GetBBox(pObj2Device);
- m_pDevice->SetClip_Rect(&rect);
- } else {
- return;
- }
- FX_RECT rect;
- if (GetObjectClippedRect(pPageObj, pObj2Device, FALSE, rect)) {
- m_pDevice->RestoreState();
- return;
- }
- CFX_AffineMatrix matrix = pattern->m_Pattern2Form;
- matrix.Concat(*pObj2Device);
- GetScaledMatrix(matrix);
- int alpha = pPageObj->m_GeneralState.GetAlpha(bStroke);
- DrawShading(pattern, &matrix, rect, alpha, m_Options.m_ColorMode == RENDER_COLOR_ALPHA);
- m_pDevice->RestoreState();
-}
-FX_BOOL CPDF_RenderStatus::ProcessShading(CPDF_ShadingObject* pShadingObj, const CFX_AffineMatrix* pObj2Device)
-{
- FX_RECT rect = pShadingObj->GetBBox(pObj2Device);
- FX_RECT clip_box = m_pDevice->GetClipBox();
- rect.Intersect(clip_box);
- if (rect.IsEmpty()) {
- return TRUE;
- }
- CFX_AffineMatrix matrix = pShadingObj->m_Matrix;
- matrix.Concat(*pObj2Device);
- DrawShading(pShadingObj->m_pShading, &matrix, rect, pShadingObj->m_GeneralState.GetAlpha(FALSE),
- m_Options.m_ColorMode == RENDER_COLOR_ALPHA);
-#ifdef _FPDFAPI_MINI_
- if (m_DitherBits) {
- DitherObjectArea(pShadingObj, pObj2Device);
- }
-#endif
- return TRUE;
-}
-static CFX_DIBitmap* DrawPatternBitmap(CPDF_Document* pDoc, CPDF_PageRenderCache* pCache,
- CPDF_TilingPattern* pPattern, const CFX_AffineMatrix* pObject2Device,
- int width, int height, int flags)
-{
- CFX_DIBitmap* pBitmap = FX_NEW CFX_DIBitmap;
- if (!pBitmap->Create(width, height, pPattern->m_bColored ? FXDIB_Argb : FXDIB_8bppMask)) {
- delete pBitmap;
- return NULL;
- }
- CFX_FxgeDevice bitmap_device;
- bitmap_device.Attach(pBitmap);
- pBitmap->Clear(0);
- CFX_FloatRect cell_bbox = pPattern->m_BBox;
- pPattern->m_Pattern2Form.TransformRect(cell_bbox);
- pObject2Device->TransformRect(cell_bbox);
- CFX_FloatRect bitmap_rect(0.0f, 0.0f, (FX_FLOAT)width, (FX_FLOAT)height);
- CFX_AffineMatrix mtAdjust;
- mtAdjust.MatchRect(bitmap_rect, cell_bbox);
- CFX_AffineMatrix mtPattern2Bitmap = *pObject2Device;
- mtPattern2Bitmap.Concat(mtAdjust);
- CPDF_RenderOptions options;
- if (!pPattern->m_bColored) {
- options.m_ColorMode = RENDER_COLOR_ALPHA;
- }
- flags |= RENDER_FORCE_HALFTONE;
- options.m_Flags = flags;
- CPDF_RenderContext context;
- context.Create(pDoc, pCache, NULL);
- context.DrawObjectList(&bitmap_device, pPattern->m_pForm, &mtPattern2Bitmap, &options);
- return pBitmap;
-}
-void CPDF_RenderStatus::DrawTilingPattern(CPDF_TilingPattern* pPattern, CPDF_PageObject* pPageObj, const CFX_AffineMatrix* pObj2Device, FX_BOOL bStroke)
-{
- if (!pPattern->Load()) {
- return;
- }
- m_pDevice->SaveState();
- if (pPageObj->m_Type == PDFPAGE_PATH) {
- if (!SelectClipPath((CPDF_PathObject*)pPageObj, pObj2Device, bStroke)) {
- m_pDevice->RestoreState();
- return;
- }
- } else if (pPageObj->m_Type == PDFPAGE_IMAGE) {
- FX_RECT rect = pPageObj->GetBBox(pObj2Device);
- m_pDevice->SetClip_Rect(&rect);
- } else {
- return;
- }
- FX_RECT clip_box = m_pDevice->GetClipBox();
- if (clip_box.IsEmpty()) {
- m_pDevice->RestoreState();
- return;
- }
- CFX_Matrix dCTM = m_pDevice->GetCTM();
- FX_FLOAT sa = FXSYS_fabs(dCTM.a);
- FX_FLOAT sd = FXSYS_fabs(dCTM.d);
- clip_box.right = clip_box.left + (FX_INT32)FXSYS_ceil(clip_box.Width() * sa);
- clip_box.bottom = clip_box.top + (FX_INT32)FXSYS_ceil(clip_box.Height() * sd);
- CFX_AffineMatrix mtPattern2Device = pPattern->m_Pattern2Form;
- mtPattern2Device.Concat(*pObj2Device);
- GetScaledMatrix(mtPattern2Device);
- FX_BOOL bAligned = FALSE;
- if (pPattern->m_BBox.left == 0 && pPattern->m_BBox.bottom == 0 &&
- pPattern->m_BBox.right == pPattern->m_XStep && pPattern->m_BBox.top == pPattern->m_YStep &&
- (mtPattern2Device.IsScaled() || mtPattern2Device.Is90Rotated())) {
- bAligned = TRUE;
- }
- CFX_FloatRect cell_bbox = pPattern->m_BBox;
- mtPattern2Device.TransformRect(cell_bbox);
- int width = (int)FXSYS_ceil(cell_bbox.Width());
- int height = (int)FXSYS_ceil(cell_bbox.Height());
- if (width == 0) {
- width = 1;
- }
- if (height == 0) {
- height = 1;
- }
- int min_col, max_col, min_row, max_row;
- CFX_AffineMatrix mtDevice2Pattern;
- mtDevice2Pattern.SetReverse(mtPattern2Device);
- CFX_FloatRect clip_box_p(clip_box);
- clip_box_p.Transform(&mtDevice2Pattern);
- min_col = (int)FXSYS_ceil(FXSYS_Div(clip_box_p.left - pPattern->m_BBox.right, pPattern->m_XStep));
- max_col = (int)FXSYS_floor(FXSYS_Div(clip_box_p.right - pPattern->m_BBox.left, pPattern->m_XStep));
- min_row = (int)FXSYS_ceil(FXSYS_Div(clip_box_p.bottom - pPattern->m_BBox.top, pPattern->m_YStep));
- max_row = (int)FXSYS_floor(FXSYS_Div(clip_box_p.top - pPattern->m_BBox.bottom, pPattern->m_YStep));
- if (width > clip_box.Width() || height > clip_box.Height() || width * height > clip_box.Width() * clip_box.Height()) {
- CPDF_GraphicStates* pStates = NULL;
- if (!pPattern->m_bColored) {
- pStates = CloneObjStates(pPageObj, bStroke);
- }
- CPDF_Dictionary* pFormResource = NULL;
- if (pPattern->m_pForm->m_pFormDict) {
- pFormResource = pPattern->m_pForm->m_pFormDict->GetDict(FX_BSTRC("Resources"));
- }
- for (int col = min_col; col <= max_col; col ++)
- for (int row = min_row; row <= max_row; row ++) {
- FX_FLOAT orig_x, orig_y;
- orig_x = col * pPattern->m_XStep;
- orig_y = row * pPattern->m_YStep;
- mtPattern2Device.Transform(orig_x, orig_y);
- CFX_AffineMatrix matrix = *pObj2Device;
- matrix.Translate(orig_x - mtPattern2Device.e, orig_y - mtPattern2Device.f);
- m_pDevice->SaveState();
- CPDF_RenderStatus status;
- status.Initialize(m_Level + 1, m_pContext, m_pDevice, NULL, NULL, this, pStates, &m_Options,
- pPattern->m_pForm->m_Transparency, m_bDropObjects, pFormResource);
- status.RenderObjectList(pPattern->m_pForm, &matrix);
- m_pDevice->RestoreState();
- }
- m_pDevice->RestoreState();
- if (pStates) {
- delete pStates;
- }
- return;
- }
- if (bAligned) {
- int orig_x = FXSYS_round(mtPattern2Device.e);
- int orig_y = FXSYS_round(mtPattern2Device.f);
- min_col = (clip_box.left - orig_x) / width;
- if (clip_box.left < orig_x) {
- min_col --;
- }
- max_col = (clip_box.right - orig_x) / width;
- if (clip_box.right <= orig_x) {
- max_col --;
- }
- min_row = (clip_box.top - orig_y) / height;
- if (clip_box.top < orig_y) {
- min_row --;
- }
- max_row = (clip_box.bottom - orig_y) / height;
- if (clip_box.bottom <= orig_y) {
- max_row --;
- }
- }
- FX_FLOAT left_offset = cell_bbox.left - mtPattern2Device.e;
- FX_FLOAT top_offset = cell_bbox.bottom - mtPattern2Device.f;
- CFX_DIBitmap* pPatternBitmap = NULL;
- if (width * height < 16) {
- CFX_DIBitmap* pEnlargedBitmap = DrawPatternBitmap(m_pContext->m_pDocument, m_pContext->m_pPageCache, pPattern, pObj2Device, 8, 8, m_Options.m_Flags);
- pPatternBitmap = pEnlargedBitmap->StretchTo(width, height);
- delete pEnlargedBitmap;
- } else {
- pPatternBitmap = DrawPatternBitmap(m_pContext->m_pDocument, m_pContext->m_pPageCache, pPattern, pObj2Device, width, height, m_Options.m_Flags);
- }
- if (pPatternBitmap == NULL) {
- m_pDevice->RestoreState();
- return;
- }
- if (m_Options.m_ColorMode == RENDER_COLOR_GRAY) {
- pPatternBitmap->ConvertColorScale(m_Options.m_ForeColor, m_Options.m_BackColor);
- }
- FX_ARGB fill_argb = GetFillArgb(pPageObj);
- int clip_width = clip_box.right - clip_box.left;
- int clip_height = clip_box.bottom - clip_box.top;
- CFX_DIBitmap screen;
- if (!screen.Create(clip_width, clip_height, FXDIB_Argb)) {
- return;
- }
- screen.Clear(0);
- FX_DWORD* src_buf = (FX_DWORD*)pPatternBitmap->GetBuffer();
- for (int col = min_col; col <= max_col; col ++) {
- for (int row = min_row; row <= max_row; row ++) {
- int start_x, start_y;
- if (bAligned) {
- start_x = FXSYS_round(mtPattern2Device.e) + col * width - clip_box.left;
- start_y = FXSYS_round(mtPattern2Device.f) + row * height - clip_box.top;
- } else {
- FX_FLOAT orig_x = col * pPattern->m_XStep;
- FX_FLOAT orig_y = row * pPattern->m_YStep;
- mtPattern2Device.Transform(orig_x, orig_y);
- start_x = FXSYS_round(orig_x + left_offset) - clip_box.left;
- start_y = FXSYS_round(orig_y + top_offset) - clip_box.top;
- }
- if (width == 1 && height == 1) {
- if (start_x < 0 || start_x >= clip_box.Width() || start_y < 0 || start_y >= clip_box.Height()) {
- continue;
- }
- FX_DWORD* dest_buf = (FX_DWORD*)(screen.GetBuffer() + screen.GetPitch() * start_y + start_x * 4);
- if (pPattern->m_bColored) {
- *dest_buf = *src_buf;
- } else {
- *dest_buf = (*(FX_LPBYTE)src_buf << 24) | (fill_argb & 0xffffff);
- }
- } else {
- if (pPattern->m_bColored) {
- screen.CompositeBitmap(start_x, start_y, width, height, pPatternBitmap, 0, 0);
- } else {
- screen.CompositeMask(start_x, start_y, width, height, pPatternBitmap, fill_argb, 0, 0);
- }
- }
- }
- }
- CompositeDIBitmap(&screen, clip_box.left, clip_box.top, 0, 255, FXDIB_BLEND_NORMAL, FALSE);
- m_pDevice->RestoreState();
- delete pPatternBitmap;
-}
-void CPDF_RenderStatus::DrawPathWithPattern(CPDF_PathObject* pPathObj, const CFX_AffineMatrix* pObj2Device, CPDF_Color* pColor, FX_BOOL bStroke)
-{
- CPDF_Pattern* pattern = pColor->GetPattern();
- if (pattern == NULL) {
- return;
- }
- if(pattern->m_PatternType == PATTERN_TILING) {
- DrawTilingPattern((CPDF_TilingPattern*)pattern, pPathObj, pObj2Device, bStroke);
- } else {
- DrawShadingPattern((CPDF_ShadingPattern*)pattern, pPathObj, pObj2Device, bStroke);
- }
-}
-void CPDF_RenderStatus::ProcessPathPattern(CPDF_PathObject* pPathObj, const CFX_AffineMatrix* pObj2Device, int& filltype, FX_BOOL& bStroke)
-{
- FX_BOOL bPattern = FALSE;
- if(filltype) {
- CPDF_Color& FillColor = *pPathObj->m_ColorState.GetFillColor();
- if(FillColor.m_pCS && FillColor.m_pCS->GetFamily() == PDFCS_PATTERN) {
- DrawPathWithPattern(pPathObj, pObj2Device, &FillColor, FALSE);
- filltype = 0;
- bPattern = TRUE;
- }
- }
- if(bStroke) {
- CPDF_Color& StrokeColor = *pPathObj->m_ColorState.GetStrokeColor();
- if(StrokeColor.m_pCS && StrokeColor.m_pCS->GetFamily() == PDFCS_PATTERN) {
- DrawPathWithPattern(pPathObj, pObj2Device, &StrokeColor, TRUE);
- bStroke = FALSE;
- bPattern = TRUE;
- }
- }
-#ifdef _FPDFAPI_MINI_
- if (bPattern && m_DitherBits) {
- DitherObjectArea(pPathObj, pObj2Device);
- }
-#endif
-}
+// 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
+
+#include "../../../include/fpdfapi/fpdf_render.h"
+#include "../../../include/fpdfapi/fpdf_pageobj.h"
+#include "../../../include/fxge/fx_ge.h"
+#include "../fpdf_page/pageint.h"
+#include "render_int.h"
+#define SHADING_STEPS 256
+static void _DrawAxialShading(CFX_DIBitmap* pBitmap, CFX_AffineMatrix* pObject2Bitmap,
+ CPDF_Dictionary* pDict, CPDF_Function** pFuncs, int nFuncs,
+ CPDF_ColorSpace* pCS, int alpha)
+{
+ ASSERT(pBitmap->GetFormat() == FXDIB_Argb);
+ CPDF_Array* pCoords = pDict->GetArray(FX_BSTRC("Coords"));
+ if (pCoords == NULL) {
+ return;
+ }
+ FX_FLOAT start_x = pCoords->GetNumber(0);
+ FX_FLOAT start_y = pCoords->GetNumber(1);
+ FX_FLOAT end_x = pCoords->GetNumber(2);
+ FX_FLOAT end_y = pCoords->GetNumber(3);
+ FX_FLOAT t_min = 0, t_max = 1.0f;
+ CPDF_Array* pArray = pDict->GetArray(FX_BSTRC("Domain"));
+ if (pArray) {
+ t_min = pArray->GetNumber(0);
+ t_max = pArray->GetNumber(1);
+ }
+ FX_BOOL bStartExtend = FALSE, bEndExtend = FALSE;
+ pArray = pDict->GetArray(FX_BSTRC("Extend"));
+ if (pArray) {
+ bStartExtend = pArray->GetInteger(0);
+ bEndExtend = pArray->GetInteger(1);
+ }
+ int width = pBitmap->GetWidth();
+ int height = pBitmap->GetHeight();
+ FX_FLOAT x_span = end_x - start_x;
+ FX_FLOAT y_span = end_y - start_y;
+ FX_FLOAT axis_len_square = FXSYS_Mul(x_span, x_span) + FXSYS_Mul(y_span, y_span);
+ CFX_AffineMatrix matrix;
+ matrix.SetReverse(*pObject2Bitmap);
+ int total_results = 0;
+ for (int j = 0; j < nFuncs; j ++) {
+ if (pFuncs[j]) {
+ total_results += pFuncs[j]->CountOutputs();
+ }
+ }
+ if (pCS->CountComponents() > total_results) {
+ total_results = pCS->CountComponents();
+ }
+ CFX_FixedBufGrow<FX_FLOAT, 16> result_array(total_results);
+ FX_FLOAT* pResults = result_array;
+ FXSYS_memset32(pResults, 0, total_results * sizeof(FX_FLOAT));
+ FX_DWORD rgb_array[SHADING_STEPS];
+ for (int i = 0; i < SHADING_STEPS; i ++) {
+ FX_FLOAT input = (t_max - t_min) * i / SHADING_STEPS + t_min;
+ int offset = 0;
+ for (int j = 0; j < nFuncs; j ++) {
+ if (pFuncs[j]) {
+ int nresults = 0;
+ if (pFuncs[j]->Call(&input, 1, pResults + offset, nresults)) {
+ offset += nresults;
+ }
+ }
+ }
+ FX_FLOAT R, G, B;
+ pCS->GetRGB(pResults, R, G, B);
+ rgb_array[i] = FXARGB_TODIB(FXARGB_MAKE(alpha, FXSYS_round(R * 255), FXSYS_round(G * 255), FXSYS_round(B * 255)));
+ }
+ int pitch = pBitmap->GetPitch();
+ int Bpp = pBitmap->GetBPP() / 8;
+ for (int row = 0; row < height; row ++) {
+ FX_DWORD* dib_buf = (FX_DWORD*)(pBitmap->GetBuffer() + row * pitch);
+ for (int column = 0; column < width; column ++) {
+ FX_FLOAT x = (FX_FLOAT)column, y = (FX_FLOAT)row;
+ matrix.Transform(x, y);
+ FX_FLOAT scale = FXSYS_Div(FXSYS_Mul(x - start_x, x_span) + FXSYS_Mul(y - start_y, y_span), axis_len_square);
+ int index = (FX_INT32)(scale * (SHADING_STEPS - 1));
+ if (index < 0) {
+ if (!bStartExtend) {
+ continue;
+ }
+ index = 0;
+ } else if (index >= SHADING_STEPS) {
+ if (!bEndExtend) {
+ continue;
+ }
+ index = SHADING_STEPS - 1;
+ }
+ dib_buf[column] = rgb_array[index];
+ }
+ }
+}
+static void _DrawRadialShading(CFX_DIBitmap* pBitmap, CFX_AffineMatrix* pObject2Bitmap,
+ CPDF_Dictionary* pDict, CPDF_Function** pFuncs, int nFuncs,
+ CPDF_ColorSpace* pCS, int alpha)
+{
+ ASSERT(pBitmap->GetFormat() == FXDIB_Argb);
+ CPDF_Array* pCoords = pDict->GetArray(FX_BSTRC("Coords"));
+ if (pCoords == NULL) {
+ return;
+ }
+ FX_FLOAT start_x = pCoords->GetNumber(0);
+ FX_FLOAT start_y = pCoords->GetNumber(1);
+ FX_FLOAT start_r = pCoords->GetNumber(2);
+ FX_FLOAT end_x = pCoords->GetNumber(3);
+ FX_FLOAT end_y = pCoords->GetNumber(4);
+ FX_FLOAT end_r = pCoords->GetNumber(5);
+ CFX_AffineMatrix matrix;
+ matrix.SetReverse(*pObject2Bitmap);
+ FX_FLOAT t_min = 0, t_max = 1.0f;
+ CPDF_Array* pArray = pDict->GetArray(FX_BSTRC("Domain"));
+ if (pArray) {
+ t_min = pArray->GetNumber(0);
+ t_max = pArray->GetNumber(1);
+ }
+ FX_BOOL bStartExtend = FALSE, bEndExtend = FALSE;
+ pArray = pDict->GetArray(FX_BSTRC("Extend"));
+ if (pArray) {
+ bStartExtend = pArray->GetInteger(0);
+ bEndExtend = pArray->GetInteger(1);
+ }
+ int total_results = 0;
+ for (int j = 0; j < nFuncs; j ++) {
+ if (pFuncs[j]) {
+ total_results += pFuncs[j]->CountOutputs();
+ }
+ }
+ if (pCS->CountComponents() > total_results) {
+ total_results = pCS->CountComponents();
+ }
+ CFX_FixedBufGrow<FX_FLOAT, 16> result_array(total_results);
+ FX_FLOAT* pResults = result_array;
+ FXSYS_memset32(pResults, 0, total_results * sizeof(FX_FLOAT));
+ FX_DWORD rgb_array[SHADING_STEPS];
+ for (int i = 0; i < SHADING_STEPS; i ++) {
+ FX_FLOAT input = (t_max - t_min) * i / SHADING_STEPS + t_min;
+ int offset = 0;
+ for (int j = 0; j < nFuncs; j ++) {
+ if (pFuncs[j]) {
+ int nresults;
+ if (pFuncs[j]->Call(&input, 1, pResults + offset, nresults)) {
+ offset += nresults;
+ }
+ }
+ }
+ FX_FLOAT R, G, B;
+ pCS->GetRGB(pResults, R, G, B);
+ rgb_array[i] = FXARGB_TODIB(FXARGB_MAKE(alpha, FXSYS_round(R * 255), FXSYS_round(G * 255), FXSYS_round(B * 255)));
+ }
+ FX_FLOAT a = FXSYS_Mul(start_x - end_x, start_x - end_x) +
+ FXSYS_Mul(start_y - end_y, start_y - end_y) - FXSYS_Mul(start_r - end_r, start_r - end_r);
+ int width = pBitmap->GetWidth();
+ int height = pBitmap->GetHeight();
+ int pitch = pBitmap->GetPitch();
+ int Bpp = pBitmap->GetBPP() / 8;
+ FX_BOOL bDecreasing = FALSE;
+ if (start_r > end_r) {
+ int length = (int)FXSYS_sqrt((FXSYS_Mul(start_x - end_x, start_x - end_x) + FXSYS_Mul(start_y - end_y, start_y - end_y)));
+ if (length < start_r - end_r) {
+ bDecreasing = TRUE;
+ }
+ }
+ for (int row = 0; row < height; row ++) {
+ FX_DWORD* dib_buf = (FX_DWORD*)(pBitmap->GetBuffer() + row * pitch);
+ for (int column = 0; column < width; column ++) {
+ FX_FLOAT x = (FX_FLOAT)column, y = (FX_FLOAT)row;
+ matrix.Transform(x, y);
+ FX_FLOAT b = -2 * (FXSYS_Mul(x - start_x, end_x - start_x) + FXSYS_Mul(y - start_y, end_y - start_y) +
+ FXSYS_Mul(start_r, end_r - start_r));
+ FX_FLOAT c = FXSYS_Mul(x - start_x, x - start_x) + FXSYS_Mul(y - start_y, y - start_y) -
+ FXSYS_Mul(start_r, start_r);
+ FX_FLOAT s;
+ if (a == 0) {
+ s = FXSYS_Div(-c, b);
+ } else {
+ FX_FLOAT b2_4ac = FXSYS_Mul(b, b) - 4 * FXSYS_Mul(a, c);
+ if (b2_4ac < 0) {
+ continue;
+ }
+ FX_FLOAT root = FXSYS_sqrt(b2_4ac);
+ FX_FLOAT s1, s2;
+ if (a > 0) {
+ s1 = FXSYS_Div(-b - root, 2 * a);
+ s2 = FXSYS_Div(-b + root, 2 * a);
+ } else {
+ s2 = FXSYS_Div(-b - root, 2 * a);
+ s1 = FXSYS_Div(-b + root, 2 * a);
+ }
+ if (bDecreasing) {
+ if (s1 >= 0 || bStartExtend) {
+ s = s1;
+ } else {
+ s = s2;
+ }
+ } else {
+ if (s2 <= 1.0f || bEndExtend) {
+ s = s2;
+ } else {
+ s = s1;
+ }
+ }
+ if ((start_r + s * (end_r - start_r)) < 0) {
+ continue;
+ }
+ }
+ int index = (FX_INT32)(s * (SHADING_STEPS - 1));
+ if (index < 0) {
+ if (!bStartExtend) {
+ continue;
+ }
+ index = 0;
+ }
+ if (index >= SHADING_STEPS) {
+ if (!bEndExtend) {
+ continue;
+ }
+ index = SHADING_STEPS - 1;
+ }
+ dib_buf[column] = rgb_array[index];
+ }
+ }
+}
+static void _DrawFuncShading(CFX_DIBitmap* pBitmap, CFX_AffineMatrix* pObject2Bitmap,
+ CPDF_Dictionary* pDict, CPDF_Function** pFuncs, int nFuncs,
+ CPDF_ColorSpace* pCS, int alpha)
+{
+ ASSERT(pBitmap->GetFormat() == FXDIB_Argb);
+ CPDF_Array* pDomain = pDict->GetArray(FX_BSTRC("Domain"));
+ FX_FLOAT xmin = 0, ymin = 0, xmax = 1.0f, ymax = 1.0f;
+ if (pDomain) {
+ xmin = pDomain->GetNumber(0);
+ xmax = pDomain->GetNumber(1);
+ ymin = pDomain->GetNumber(2);
+ ymax = pDomain->GetNumber(3);
+ }
+ CFX_AffineMatrix mtDomain2Target = pDict->GetMatrix(FX_BSTRC("Matrix"));
+ CFX_AffineMatrix matrix, reverse_matrix;
+ matrix.SetReverse(*pObject2Bitmap);
+ reverse_matrix.SetReverse(mtDomain2Target);
+ matrix.Concat(reverse_matrix);
+ int width = pBitmap->GetWidth();
+ int height = pBitmap->GetHeight();
+ int pitch = pBitmap->GetPitch();
+ int Bpp = pBitmap->GetBPP() / 8;
+ int total_results = 0;
+ for (int j = 0; j < nFuncs; j ++) {
+ if (pFuncs[j]) {
+ total_results += pFuncs[j]->CountOutputs();
+ }
+ }
+ if (pCS->CountComponents() > total_results) {
+ total_results = pCS->CountComponents();
+ }
+ CFX_FixedBufGrow<FX_FLOAT, 16> result_array(total_results);
+ FX_FLOAT* pResults = result_array;
+ FXSYS_memset32(pResults, 0, total_results * sizeof(FX_FLOAT));
+ for (int row = 0; row < height; row ++) {
+ FX_DWORD* dib_buf = (FX_DWORD*)(pBitmap->GetBuffer() + row * pitch);
+ for (int column = 0; column < width; column ++) {
+ FX_FLOAT x = (FX_FLOAT)column, y = (FX_FLOAT)row;
+ matrix.Transform(x, y);
+ if (x < xmin || x > xmax || y < ymin || y > ymax) {
+ continue;
+ }
+ FX_FLOAT input[2];
+ int offset = 0;
+ input[0] = x;
+ input[1] = y;
+ for (int j = 0; j < nFuncs; j ++) {
+ if (pFuncs[j]) {
+ int nresults;
+ if (pFuncs[j]->Call(input, 2, pResults + offset, nresults)) {
+ offset += nresults;
+ }
+ }
+ }
+ FX_FLOAT R, G, B;
+ pCS->GetRGB(pResults, R, G, B);
+ dib_buf[column] = FXARGB_TODIB(FXARGB_MAKE(alpha, (FX_INT32)(R * 255), (FX_INT32)(G * 255), (FX_INT32)(B * 255)));
+ }
+ }
+}
+FX_BOOL _GetScanlineIntersect(int y, FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, FX_FLOAT& x)
+{
+ if (y1 == y2) {
+ return FALSE;
+ }
+ if (y1 < y2) {
+ if (y < y1 || y > y2) {
+ return FALSE;
+ }
+ } else {
+ if (y < y2 || y > y1) {
+ return FALSE;
+ }
+ }
+ x = x1 + FXSYS_MulDiv(x2 - x1, y - y1, y2 - y1);
+ return TRUE;
+}
+static void _DrawGouraud(CFX_DIBitmap* pBitmap, int alpha, CPDF_MeshVertex triangle[3])
+{
+ FX_FLOAT min_y = triangle[0].y, max_y = triangle[0].y;
+ for (int i = 1; i < 3; i ++) {
+ if (min_y > triangle[i].y) {
+ min_y = triangle[i].y;
+ }
+ if (max_y < triangle[i].y) {
+ max_y = triangle[i].y;
+ }
+ }
+ if (min_y == max_y) {
+ return;
+ }
+ int min_yi = (int)FXSYS_floor(min_y), max_yi = (int)FXSYS_ceil(max_y);
+ if (min_yi < 0) {
+ min_yi = 0;
+ }
+ if (max_yi >= pBitmap->GetHeight()) {
+ max_yi = pBitmap->GetHeight() - 1;
+ }
+ for (int y = min_yi; y <= max_yi; y ++) {
+ int nIntersects = 0;
+ FX_FLOAT inter_x[3], r[3], g[3], b[3];
+ for (int i = 0; i < 3; i ++) {
+ CPDF_MeshVertex& vertex1 = triangle[i];
+ CPDF_MeshVertex& vertex2 = triangle[(i + 1) % 3];
+ FX_BOOL bIntersect = _GetScanlineIntersect(y, vertex1.x, vertex1.y,
+ vertex2.x, vertex2.y, inter_x[nIntersects]);
+ if (!bIntersect) {
+ continue;
+ }
+ r[nIntersects] = vertex1.r + FXSYS_MulDiv(vertex2.r - vertex1.r, y - vertex1.y, vertex2.y - vertex1.y);
+ g[nIntersects] = vertex1.g + FXSYS_MulDiv(vertex2.g - vertex1.g, y - vertex1.y, vertex2.y - vertex1.y);
+ b[nIntersects] = vertex1.b + FXSYS_MulDiv(vertex2.b - vertex1.b, y - vertex1.y, vertex2.y - vertex1.y);
+ nIntersects ++;
+ }
+ if (nIntersects != 2) {
+ continue;
+ }
+ int min_x, max_x, start_index, end_index;
+ if (inter_x[0] < inter_x[1]) {
+ min_x = (int)FXSYS_floor(inter_x[0]);
+ max_x = (int)FXSYS_ceil(inter_x[1]);
+ start_index = 0;
+ end_index = 1;
+ } else {
+ min_x = (int)FXSYS_floor(inter_x[1]);
+ max_x = (int)FXSYS_ceil(inter_x[0]);
+ start_index = 1;
+ end_index = 0;
+ }
+ int start_x = min_x, end_x = max_x;
+ if (start_x < 0) {
+ start_x = 0;
+ }
+ if (end_x > pBitmap->GetWidth()) {
+ end_x = pBitmap->GetWidth();
+ }
+ FX_LPBYTE dib_buf = pBitmap->GetBuffer() + y * pBitmap->GetPitch() + start_x * 4;
+ FX_FLOAT r_unit = (r[end_index] - r[start_index]) / (max_x - min_x);
+ FX_FLOAT g_unit = (g[end_index] - g[start_index]) / (max_x - min_x);
+ FX_FLOAT b_unit = (b[end_index] - b[start_index]) / (max_x - min_x);
+ FX_FLOAT R = r[start_index] + (start_x - min_x) * r_unit;
+ FX_FLOAT G = g[start_index] + (start_x - min_x) * g_unit;
+ FX_FLOAT B = b[start_index] + (start_x - min_x) * b_unit;
+ for (int x = start_x; x < end_x; x ++) {
+ R += r_unit;
+ G += g_unit;
+ B += b_unit;
+ FXARGB_SETDIB(dib_buf, FXARGB_MAKE(alpha, (FX_INT32)(R * 255), (FX_INT32)(G * 255), (FX_INT32)(B * 255)));
+ dib_buf += 4;
+ }
+ }
+}
+static void _DrawFreeGouraudShading(CFX_DIBitmap* pBitmap, CFX_AffineMatrix* pObject2Bitmap,
+ CPDF_Stream* pShadingStream, CPDF_Function** pFuncs, int nFuncs,
+ CPDF_ColorSpace* pCS, int alpha)
+{
+ ASSERT(pBitmap->GetFormat() == FXDIB_Argb);
+ if (pShadingStream->GetType() != PDFOBJ_STREAM) {
+ return;
+ }
+ CPDF_MeshStream stream;
+ if (!stream.Load(pShadingStream, pFuncs, nFuncs, pCS)) {
+ return;
+ }
+ CPDF_MeshVertex triangle[3];
+ while (!stream.m_BitStream.IsEOF()) {
+ CPDF_MeshVertex vertex;
+ FX_DWORD flag = stream.GetVertex(vertex, pObject2Bitmap);
+ if (flag == 0) {
+ triangle[0] = vertex;
+ for (int j = 1; j < 3; j ++) {
+ stream.GetVertex(triangle[j], pObject2Bitmap);
+ }
+ } else {
+ if (flag == 1) {
+ triangle[0] = triangle[1];
+ }
+ triangle[1] = triangle[2];
+ triangle[2] = vertex;
+ }
+ _DrawGouraud(pBitmap, alpha, triangle);
+ }
+}
+static void _DrawLatticeGouraudShading(CFX_DIBitmap* pBitmap, CFX_AffineMatrix* pObject2Bitmap,
+ CPDF_Stream* pShadingStream, CPDF_Function** pFuncs, int nFuncs,
+ CPDF_ColorSpace* pCS, int alpha)
+{
+ ASSERT(pBitmap->GetFormat() == FXDIB_Argb);
+ if (pShadingStream->GetType() != PDFOBJ_STREAM) {
+ return;
+ }
+ int row_verts = pShadingStream->GetDict()->GetInteger("VerticesPerRow");
+ if (row_verts < 2) {
+ return;
+ }
+ CPDF_MeshStream stream;
+ if (!stream.Load(pShadingStream, pFuncs, nFuncs, pCS)) {
+ return;
+ }
+ CPDF_MeshVertex* vertex = FX_Alloc(CPDF_MeshVertex, row_verts * 2);
+ if (!stream.GetVertexRow(vertex, row_verts, pObject2Bitmap)) {
+ FX_Free(vertex);
+ return;
+ }
+ int last_index = 0;
+ while (1) {
+ CPDF_MeshVertex* last_row = vertex + last_index * row_verts;
+ CPDF_MeshVertex* this_row = vertex + (1 - last_index) * row_verts;
+ if (!stream.GetVertexRow(this_row, row_verts, pObject2Bitmap)) {
+ FX_Free(vertex);
+ return;
+ }
+ CPDF_MeshVertex triangle[3];
+ for (int i = 1; i < row_verts; i ++) {
+ triangle[0] = last_row[i];
+ triangle[1] = this_row[i - 1];
+ triangle[2] = last_row[i - 1];
+ _DrawGouraud(pBitmap, alpha, triangle);
+ triangle[2] = this_row[i];
+ _DrawGouraud(pBitmap, alpha, triangle);
+ }
+ last_index = 1 - last_index;
+ }
+ FX_Free(vertex);
+}
+struct Coon_BezierCoeff {
+ float a, b, c, d;
+ void FromPoints(float p0, float p1, float p2, float p3)
+ {
+ a = -p0 + 3 * p1 - 3 * p2 + p3;
+ b = 3 * p0 - 6 * p1 + 3 * p2;
+ c = -3 * p0 + 3 * p1;
+ d = p0;
+ }
+ Coon_BezierCoeff first_half()
+ {
+ Coon_BezierCoeff result;
+ result.a = a / 8;
+ result.b = b / 4;
+ result.c = c / 2;
+ result.d = d;
+ return result;
+ }
+ Coon_BezierCoeff second_half()
+ {
+ Coon_BezierCoeff result;
+ result.a = a / 8;
+ result.b = 3 * a / 8 + b / 4;
+ result.c = 3 * a / 8 + b / 2 + c / 2;
+ result.d = a / 8 + b / 4 + c / 2 + d;
+ return result;
+ }
+ void GetPoints(float p[4])
+ {
+ p[0] = d;
+ p[1] = c / 3 + p[0];
+ p[2] = b / 3 - p[0] + 2 * p[1];
+ p[3] = a + p[0] - 3 * p[1] + 3 * p[2];
+ }
+ void GetPointsReverse(float p[4])
+ {
+ p[3] = d;
+ p[2] = c / 3 + p[3];
+ p[1] = b / 3 - p[3] + 2 * p[2];
+ p[0] = a + p[3] - 3 * p[2] + 3 * p[1];
+ }
+ void BezierInterpol(Coon_BezierCoeff& C1, Coon_BezierCoeff& C2, Coon_BezierCoeff& D1, Coon_BezierCoeff& D2)
+ {
+ a = (D1.a + D2.a) / 2;
+ b = (D1.b + D2.b) / 2;
+ c = (D1.c + D2.c) / 2 - (C1.a / 8 + C1.b / 4 + C1.c / 2) + (C2.a / 8 + C2.b / 4) + (-C1.d + D2.d) / 2 - (C2.a + C2.b) / 2;
+ d = C1.a / 8 + C1.b / 4 + C1.c / 2 + C1.d;
+ }
+ float Distance()
+ {
+ float dis = a + b + c;
+ return dis < 0 ? -dis : dis;
+ }
+};
+struct Coon_Bezier {
+ Coon_BezierCoeff x, y;
+ void FromPoints(float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3)
+ {
+ x.FromPoints(x0, x1, x2, x3);
+ y.FromPoints(y0, y1, y2, y3);
+ }
+ Coon_Bezier first_half()
+ {
+ Coon_Bezier result;
+ result.x = x.first_half();
+ result.y = y.first_half();
+ return result;
+ }
+ Coon_Bezier second_half()
+ {
+ Coon_Bezier result;
+ result.x = x.second_half();
+ result.y = y.second_half();
+ return result;
+ }
+ void BezierInterpol(Coon_Bezier& C1, Coon_Bezier& C2, Coon_Bezier& D1, Coon_Bezier& D2)
+ {
+ x.BezierInterpol(C1.x, C2.x, D1.x, D2.x);
+ y.BezierInterpol(C1.y, C2.y, D1.y, D2.y);
+ }
+ void GetPoints(FX_PATHPOINT* pPoints)
+ {
+ float p[4];
+ int i;
+ x.GetPoints(p);
+ for (i = 0; i < 4; i ++) {
+ pPoints[i].m_PointX = p[i];
+ }
+ y.GetPoints(p);
+ for (i = 0; i < 4; i ++) {
+ pPoints[i].m_PointY = p[i];
+ }
+ }
+ void GetPointsReverse(FX_PATHPOINT* pPoints)
+ {
+ float p[4];
+ int i;
+ x.GetPointsReverse(p);
+ for (i = 0; i < 4; i ++) {
+ pPoints[i].m_PointX = p[i];
+ }
+ y.GetPointsReverse(p);
+ for (i = 0; i < 4; i ++) {
+ pPoints[i].m_PointY = p[i];
+ }
+ }
+ float Distance()
+ {
+ return x.Distance() + y.Distance();
+ }
+};
+static int _BiInterpol(int c0, int c1, int c2, int c3, int x, int y, int x_scale, int y_scale)
+{
+ int x1 = c0 + (c3 - c0) * x / x_scale;
+ int x2 = c1 + (c2 - c1) * x / x_scale;
+ return x1 + (x2 - x1) * y / y_scale;
+}
+struct Coon_Color {
+ Coon_Color()
+ {
+ FXSYS_memset32(comp, 0, sizeof(int) * 3);
+ }
+ int comp[3];
+ void BiInterpol(Coon_Color colors[4], int x, int y, int x_scale, int y_scale)
+ {
+ for (int i = 0; i < 3; i ++)
+ comp[i] = _BiInterpol(colors[0].comp[i], colors[1].comp[i], colors[2].comp[i], colors[3].comp[i],
+ x, y, x_scale, y_scale);
+ }
+ int Distance(Coon_Color& o)
+ {
+ int max, diff;
+ max = FXSYS_abs(comp[0] - o.comp[0]);
+ diff = FXSYS_abs(comp[1] - o.comp[1]);
+ if (max < diff) {
+ max = diff;
+ }
+ diff = FXSYS_abs(comp[2] - o.comp[2]);
+ if (max < diff) {
+ max = diff;
+ }
+ return max;
+ }
+};
+struct CPDF_PatchDrawer {
+ Coon_Color patch_colors[4];
+ int max_delta;
+ CFX_PathData path;
+ CFX_RenderDevice* pDevice;
+ int fill_mode;
+ int alpha;
+ void Draw(int x_scale, int y_scale, int left, int bottom, Coon_Bezier C1, Coon_Bezier C2, Coon_Bezier D1, Coon_Bezier D2)
+ {
+ FX_BOOL bSmall = C1.Distance() < 2 && C2.Distance() < 2 && D1.Distance() < 2 && D2.Distance() < 2;
+ Coon_Color div_colors[4];
+ int d_bottom, d_left, d_top, d_right;
+ div_colors[0].BiInterpol(patch_colors, left, bottom, x_scale, y_scale);
+ if (!bSmall) {
+ div_colors[1].BiInterpol(patch_colors, left, bottom + 1, x_scale, y_scale);
+ div_colors[2].BiInterpol(patch_colors, left + 1, bottom + 1, x_scale, y_scale);
+ div_colors[3].BiInterpol(patch_colors, left + 1, bottom, x_scale, y_scale);
+ d_bottom = div_colors[3].Distance(div_colors[0]);
+ d_left = div_colors[1].Distance(div_colors[0]);
+ d_top = div_colors[1].Distance(div_colors[2]);
+ d_right = div_colors[2].Distance(div_colors[3]);
+ }
+#define COONCOLOR_THRESHOLD 4
+ if (bSmall || (d_bottom < COONCOLOR_THRESHOLD && d_left < COONCOLOR_THRESHOLD &&
+ d_top < COONCOLOR_THRESHOLD && d_right < COONCOLOR_THRESHOLD)) {
+ FX_PATHPOINT* pPoints = path.GetPoints();
+ C1.GetPoints(pPoints);
+ D2.GetPoints(pPoints + 3);
+ C2.GetPointsReverse(pPoints + 6);
+ D1.GetPointsReverse(pPoints + 9);
+ int fillFlags = FXFILL_WINDING | FXFILL_FULLCOVER;
+ if (fill_mode & RENDER_NOPATHSMOOTH) {
+ fillFlags |= FXFILL_NOPATHSMOOTH;
+ }
+ pDevice->DrawPath(&path, NULL, NULL, FXARGB_MAKE(alpha, div_colors[0].comp[0], div_colors[0].comp[1], div_colors[0].comp[2]), 0, fillFlags);
+ } else {
+ if (d_bottom < COONCOLOR_THRESHOLD && d_top < COONCOLOR_THRESHOLD) {
+ Coon_Bezier m1;
+ m1.BezierInterpol(D1, D2, C1, C2);
+ y_scale *= 2;
+ bottom *= 2;
+ Draw(x_scale, y_scale, left, bottom, C1, m1, D1.first_half(), D2.first_half());
+ Draw(x_scale, y_scale, left, bottom + 1, m1, C2, D1.second_half(), D2.second_half());
+ } else if (d_left < COONCOLOR_THRESHOLD && d_right < COONCOLOR_THRESHOLD) {
+ Coon_Bezier m2;
+ m2.BezierInterpol(C1, C2, D1, D2);
+ x_scale *= 2;
+ left *= 2;
+ Draw(x_scale, y_scale, left, bottom, C1.first_half(), C2.first_half(), D1, m2);
+ Draw(x_scale, y_scale, left + 1, bottom, C1.second_half(), C2.second_half(), m2, D2);
+ } else {
+ Coon_Bezier m1, m2;
+ m1.BezierInterpol(D1, D2, C1, C2);
+ m2.BezierInterpol(C1, C2, D1, D2);
+ Coon_Bezier m1f = m1.first_half();
+ Coon_Bezier m1s = m1.second_half();
+ Coon_Bezier m2f = m2.first_half();
+ Coon_Bezier m2s = m2.second_half();
+ x_scale *= 2;
+ y_scale *= 2;
+ left *= 2;
+ bottom *= 2;
+ Draw(x_scale, y_scale, left, bottom, C1.first_half(), m1f, D1.first_half(), m2f);
+ Draw(x_scale, y_scale, left, bottom + 1, m1f, C2.first_half(), D1.second_half(), m2s);
+ Draw(x_scale, y_scale, left + 1, bottom, C1.second_half(), m1s, m2f, D2.first_half());
+ Draw(x_scale, y_scale, left + 1, bottom + 1, m1s, C2.second_half(), m2s, D2.second_half());
+ }
+ }
+ }
+};
+static void _DrawCoonPatchMeshes(FX_BOOL bTensor, CFX_DIBitmap* pBitmap, CFX_AffineMatrix* pObject2Bitmap,
+ CPDF_Stream* pShadingStream, CPDF_Function** pFuncs, int nFuncs,
+ CPDF_ColorSpace* pCS, int fill_mode, int alpha)
+{
+ ASSERT(pBitmap->GetFormat() == FXDIB_Argb);
+ if (pShadingStream->GetType() != PDFOBJ_STREAM) {
+ return;
+ }
+ CFX_FxgeDevice device;
+ device.Attach(pBitmap);
+ CPDF_MeshStream stream;
+ if (!stream.Load(pShadingStream, pFuncs, nFuncs, pCS)) {
+ return;
+ }
+ CPDF_PatchDrawer patch;
+ patch.alpha = alpha;
+ patch.pDevice = &device;
+ patch.fill_mode = fill_mode;
+ patch.path.SetPointCount(13);
+ FX_PATHPOINT* pPoints = patch.path.GetPoints();
+ pPoints[0].m_Flag = FXPT_MOVETO;
+ for (int i = 1; i < 13; i ++) {
+ pPoints[i].m_Flag = FXPT_BEZIERTO;
+ }
+ CFX_FloatPoint coords[16];
+ int point_count = bTensor ? 16 : 12;
+ while (!stream.m_BitStream.IsEOF()) {
+ FX_DWORD flag = stream.GetFlag();
+ int iStartPoint = 0, iStartColor = 0, i;
+ if (flag) {
+ iStartPoint = 4;
+ iStartColor = 2;
+ CFX_FloatPoint tempCoords[4];
+ for (int i = 0; i < 4; i ++) {
+ tempCoords[i] = coords[(flag * 3 + i) % 12];
+ }
+ FXSYS_memcpy32(coords, tempCoords, sizeof(CFX_FloatPoint) * 4);
+ Coon_Color tempColors[2];
+ tempColors[0] = patch.patch_colors[flag];
+ tempColors[1] = patch.patch_colors[(flag + 1) % 4];
+ FXSYS_memcpy32(patch.patch_colors, tempColors, sizeof(Coon_Color) * 2);
+ }
+ for (i = iStartPoint; i < point_count; i ++) {
+ stream.GetCoords(coords[i].x, coords[i].y);
+ pObject2Bitmap->Transform(coords[i].x, coords[i].y);
+ }
+ for (i = iStartColor; i < 4; i ++) {
+ FX_FLOAT r, g, b;
+ stream.GetColor(r, g, b);
+ patch.patch_colors[i].comp[0] = (FX_INT32)(r * 255);
+ patch.patch_colors[i].comp[1] = (FX_INT32)(g * 255);
+ patch.patch_colors[i].comp[2] = (FX_INT32)(b * 255);
+ }
+ CFX_FloatRect bbox = CFX_FloatRect::GetBBox(coords, point_count);
+ if (bbox.right <= 0 || bbox.left >= (FX_FLOAT)pBitmap->GetWidth() || bbox.top <= 0 ||
+ bbox.bottom >= (FX_FLOAT)pBitmap->GetHeight()) {
+ continue;
+ }
+ Coon_Bezier C1, C2, D1, D2;
+ C1.FromPoints(coords[0].x, coords[0].y, coords[11].x, coords[11].y, coords[10].x, coords[10].y,
+ coords[9].x, coords[9].y);
+ C2.FromPoints(coords[3].x, coords[3].y, coords[4].x, coords[4].y, coords[5].x, coords[5].y,
+ coords[6].x, coords[6].y);
+ D1.FromPoints(coords[0].x, coords[0].y, coords[1].x, coords[1].y, coords[2].x, coords[2].y,
+ coords[3].x, coords[3].y);
+ D2.FromPoints(coords[9].x, coords[9].y, coords[8].x, coords[8].y, coords[7].x, coords[7].y,
+ coords[6].x, coords[6].y);
+ patch.Draw(1, 1, 0, 0, C1, C2, D1, D2);
+ }
+}
+void CPDF_RenderStatus::DrawShading(CPDF_ShadingPattern* pPattern, CFX_AffineMatrix* pMatrix,
+ FX_RECT& clip_rect, int alpha, FX_BOOL bAlphaMode)
+{
+ int width = clip_rect.Width();
+ int height = clip_rect.Height();
+ CPDF_Function** pFuncs = pPattern->m_pFunctions;
+ int nFuncs = pPattern->m_nFuncs;
+ CPDF_Dictionary* pDict = pPattern->m_pShadingObj->GetDict();
+ CPDF_ColorSpace* pColorSpace = pPattern->m_pCS;
+ if (pColorSpace == NULL) {
+ return;
+ }
+ FX_ARGB background = 0;
+ if (!pPattern->m_bShadingObj && pPattern->m_pShadingObj->GetDict()->KeyExist(FX_BSTRC("Background"))) {
+ CPDF_Array* pBackColor = pPattern->m_pShadingObj->GetDict()->GetArray(FX_BSTRC("Background"));
+ if (pBackColor && pBackColor->GetCount() >= (FX_DWORD)pColorSpace->CountComponents()) {
+ CFX_FixedBufGrow<FX_FLOAT, 16> comps(pColorSpace->CountComponents());
+ for (int i = 0; i < pColorSpace->CountComponents(); i ++) {
+ comps[i] = pBackColor->GetNumber(i);
+ }
+ FX_FLOAT R, G, B;
+ pColorSpace->GetRGB(comps, R, G, B);
+ background = ArgbEncode(255, (FX_INT32)(R * 255), (FX_INT32)(G * 255), (FX_INT32)(B * 255));
+ }
+ }
+ if (pDict->KeyExist(FX_BSTRC("BBox"))) {
+ CFX_FloatRect rect = pDict->GetRect(FX_BSTRC("BBox"));
+ rect.Transform(pMatrix);
+ clip_rect.Intersect(rect.GetOutterRect());
+ }
+ CPDF_DeviceBuffer buffer;
+ buffer.Initialize(m_pContext, m_pDevice, &clip_rect, m_pCurObj, 150);
+ CFX_AffineMatrix FinalMatrix = *pMatrix;
+ FinalMatrix.Concat(*buffer.GetMatrix());
+ CFX_DIBitmap* pBitmap = buffer.GetBitmap();
+ if (pBitmap->GetBuffer() == NULL) {
+ return;
+ }
+ pBitmap->Clear(background);
+ int fill_mode = m_Options.m_Flags;
+ switch (pPattern->m_ShadingType) {
+ case 1:
+ _DrawFuncShading(pBitmap, &FinalMatrix, pDict, pFuncs, nFuncs, pColorSpace, alpha);
+ break;
+ case 2:
+ _DrawAxialShading(pBitmap, &FinalMatrix, pDict, pFuncs, nFuncs, pColorSpace, alpha);
+ break;
+ case 3:
+ _DrawRadialShading(pBitmap, &FinalMatrix, pDict, pFuncs, nFuncs, pColorSpace, alpha);
+ break;
+ case 4: {
+ _DrawFreeGouraudShading(pBitmap, &FinalMatrix, (CPDF_Stream*)pPattern->m_pShadingObj,
+ pFuncs, nFuncs, pColorSpace, alpha);
+ }
+ break;
+ case 5: {
+ _DrawLatticeGouraudShading(pBitmap, &FinalMatrix, (CPDF_Stream*)pPattern->m_pShadingObj,
+ pFuncs, nFuncs, pColorSpace, alpha);
+ }
+ break;
+ case 6:
+ case 7: {
+ _DrawCoonPatchMeshes(pPattern->m_ShadingType - 6, pBitmap, &FinalMatrix, (CPDF_Stream*)pPattern->m_pShadingObj,
+ pFuncs, nFuncs, pColorSpace, fill_mode, alpha);
+ }
+ break;
+ }
+ if (bAlphaMode) {
+ pBitmap->LoadChannel(FXDIB_Red, pBitmap, FXDIB_Alpha);
+ }
+ if (m_Options.m_ColorMode == RENDER_COLOR_GRAY) {
+ pBitmap->ConvertColorScale(m_Options.m_ForeColor, m_Options.m_BackColor);
+ }
+ buffer.OutputToDevice();
+}
+void CPDF_RenderStatus::DrawShadingPattern(CPDF_ShadingPattern* pattern, CPDF_PageObject* pPageObj, const CFX_AffineMatrix* pObj2Device, FX_BOOL bStroke)
+{
+ if (!pattern->Load()) {
+ return;
+ }
+ m_pDevice->SaveState();
+ if (pPageObj->m_Type == PDFPAGE_PATH) {
+ if (!SelectClipPath((CPDF_PathObject*)pPageObj, pObj2Device, bStroke)) {
+ m_pDevice->RestoreState();
+ return;
+ }
+ } else if (pPageObj->m_Type == PDFPAGE_IMAGE) {
+ FX_RECT rect = pPageObj->GetBBox(pObj2Device);
+ m_pDevice->SetClip_Rect(&rect);
+ } else {
+ return;
+ }
+ FX_RECT rect;
+ if (GetObjectClippedRect(pPageObj, pObj2Device, FALSE, rect)) {
+ m_pDevice->RestoreState();
+ return;
+ }
+ CFX_AffineMatrix matrix = pattern->m_Pattern2Form;
+ matrix.Concat(*pObj2Device);
+ GetScaledMatrix(matrix);
+ int alpha = pPageObj->m_GeneralState.GetAlpha(bStroke);
+ DrawShading(pattern, &matrix, rect, alpha, m_Options.m_ColorMode == RENDER_COLOR_ALPHA);
+ m_pDevice->RestoreState();
+}
+FX_BOOL CPDF_RenderStatus::ProcessShading(CPDF_ShadingObject* pShadingObj, const CFX_AffineMatrix* pObj2Device)
+{
+ FX_RECT rect = pShadingObj->GetBBox(pObj2Device);
+ FX_RECT clip_box = m_pDevice->GetClipBox();
+ rect.Intersect(clip_box);
+ if (rect.IsEmpty()) {
+ return TRUE;
+ }
+ CFX_AffineMatrix matrix = pShadingObj->m_Matrix;
+ matrix.Concat(*pObj2Device);
+ DrawShading(pShadingObj->m_pShading, &matrix, rect, pShadingObj->m_GeneralState.GetAlpha(FALSE),
+ m_Options.m_ColorMode == RENDER_COLOR_ALPHA);
+#ifdef _FPDFAPI_MINI_
+ if (m_DitherBits) {
+ DitherObjectArea(pShadingObj, pObj2Device);
+ }
+#endif
+ return TRUE;
+}
+static CFX_DIBitmap* DrawPatternBitmap(CPDF_Document* pDoc, CPDF_PageRenderCache* pCache,
+ CPDF_TilingPattern* pPattern, const CFX_AffineMatrix* pObject2Device,
+ int width, int height, int flags)
+{
+ CFX_DIBitmap* pBitmap = FX_NEW CFX_DIBitmap;
+ if (!pBitmap->Create(width, height, pPattern->m_bColored ? FXDIB_Argb : FXDIB_8bppMask)) {
+ delete pBitmap;
+ return NULL;
+ }
+ CFX_FxgeDevice bitmap_device;
+ bitmap_device.Attach(pBitmap);
+ pBitmap->Clear(0);
+ CFX_FloatRect cell_bbox = pPattern->m_BBox;
+ pPattern->m_Pattern2Form.TransformRect(cell_bbox);
+ pObject2Device->TransformRect(cell_bbox);
+ CFX_FloatRect bitmap_rect(0.0f, 0.0f, (FX_FLOAT)width, (FX_FLOAT)height);
+ CFX_AffineMatrix mtAdjust;
+ mtAdjust.MatchRect(bitmap_rect, cell_bbox);
+ CFX_AffineMatrix mtPattern2Bitmap = *pObject2Device;
+ mtPattern2Bitmap.Concat(mtAdjust);
+ CPDF_RenderOptions options;
+ if (!pPattern->m_bColored) {
+ options.m_ColorMode = RENDER_COLOR_ALPHA;
+ }
+ flags |= RENDER_FORCE_HALFTONE;
+ options.m_Flags = flags;
+ CPDF_RenderContext context;
+ context.Create(pDoc, pCache, NULL);
+ context.DrawObjectList(&bitmap_device, pPattern->m_pForm, &mtPattern2Bitmap, &options);
+ return pBitmap;
+}
+void CPDF_RenderStatus::DrawTilingPattern(CPDF_TilingPattern* pPattern, CPDF_PageObject* pPageObj, const CFX_AffineMatrix* pObj2Device, FX_BOOL bStroke)
+{
+ if (!pPattern->Load()) {
+ return;
+ }
+ m_pDevice->SaveState();
+ if (pPageObj->m_Type == PDFPAGE_PATH) {
+ if (!SelectClipPath((CPDF_PathObject*)pPageObj, pObj2Device, bStroke)) {
+ m_pDevice->RestoreState();
+ return;
+ }
+ } else if (pPageObj->m_Type == PDFPAGE_IMAGE) {
+ FX_RECT rect = pPageObj->GetBBox(pObj2Device);
+ m_pDevice->SetClip_Rect(&rect);
+ } else {
+ return;
+ }
+ FX_RECT clip_box = m_pDevice->GetClipBox();
+ if (clip_box.IsEmpty()) {
+ m_pDevice->RestoreState();
+ return;
+ }
+ CFX_Matrix dCTM = m_pDevice->GetCTM();
+ FX_FLOAT sa = FXSYS_fabs(dCTM.a);
+ FX_FLOAT sd = FXSYS_fabs(dCTM.d);
+ clip_box.right = clip_box.left + (FX_INT32)FXSYS_ceil(clip_box.Width() * sa);
+ clip_box.bottom = clip_box.top + (FX_INT32)FXSYS_ceil(clip_box.Height() * sd);
+ CFX_AffineMatrix mtPattern2Device = pPattern->m_Pattern2Form;
+ mtPattern2Device.Concat(*pObj2Device);
+ GetScaledMatrix(mtPattern2Device);
+ FX_BOOL bAligned = FALSE;
+ if (pPattern->m_BBox.left == 0 && pPattern->m_BBox.bottom == 0 &&
+ pPattern->m_BBox.right == pPattern->m_XStep && pPattern->m_BBox.top == pPattern->m_YStep &&
+ (mtPattern2Device.IsScaled() || mtPattern2Device.Is90Rotated())) {
+ bAligned = TRUE;
+ }
+ CFX_FloatRect cell_bbox = pPattern->m_BBox;
+ mtPattern2Device.TransformRect(cell_bbox);
+ int width = (int)FXSYS_ceil(cell_bbox.Width());
+ int height = (int)FXSYS_ceil(cell_bbox.Height());
+ if (width == 0) {
+ width = 1;
+ }
+ if (height == 0) {
+ height = 1;
+ }
+ int min_col, max_col, min_row, max_row;
+ CFX_AffineMatrix mtDevice2Pattern;
+ mtDevice2Pattern.SetReverse(mtPattern2Device);
+ CFX_FloatRect clip_box_p(clip_box);
+ clip_box_p.Transform(&mtDevice2Pattern);
+ min_col = (int)FXSYS_ceil(FXSYS_Div(clip_box_p.left - pPattern->m_BBox.right, pPattern->m_XStep));
+ max_col = (int)FXSYS_floor(FXSYS_Div(clip_box_p.right - pPattern->m_BBox.left, pPattern->m_XStep));
+ min_row = (int)FXSYS_ceil(FXSYS_Div(clip_box_p.bottom - pPattern->m_BBox.top, pPattern->m_YStep));
+ max_row = (int)FXSYS_floor(FXSYS_Div(clip_box_p.top - pPattern->m_BBox.bottom, pPattern->m_YStep));
+ if (width > clip_box.Width() || height > clip_box.Height() || width * height > clip_box.Width() * clip_box.Height()) {
+ CPDF_GraphicStates* pStates = NULL;
+ if (!pPattern->m_bColored) {
+ pStates = CloneObjStates(pPageObj, bStroke);
+ }
+ CPDF_Dictionary* pFormResource = NULL;
+ if (pPattern->m_pForm->m_pFormDict) {
+ pFormResource = pPattern->m_pForm->m_pFormDict->GetDict(FX_BSTRC("Resources"));
+ }
+ for (int col = min_col; col <= max_col; col ++)
+ for (int row = min_row; row <= max_row; row ++) {
+ FX_FLOAT orig_x, orig_y;
+ orig_x = col * pPattern->m_XStep;
+ orig_y = row * pPattern->m_YStep;
+ mtPattern2Device.Transform(orig_x, orig_y);
+ CFX_AffineMatrix matrix = *pObj2Device;
+ matrix.Translate(orig_x - mtPattern2Device.e, orig_y - mtPattern2Device.f);
+ m_pDevice->SaveState();
+ CPDF_RenderStatus status;
+ status.Initialize(m_Level + 1, m_pContext, m_pDevice, NULL, NULL, this, pStates, &m_Options,
+ pPattern->m_pForm->m_Transparency, m_bDropObjects, pFormResource);
+ status.RenderObjectList(pPattern->m_pForm, &matrix);
+ m_pDevice->RestoreState();
+ }
+ m_pDevice->RestoreState();
+ if (pStates) {
+ delete pStates;
+ }
+ return;
+ }
+ if (bAligned) {
+ int orig_x = FXSYS_round(mtPattern2Device.e);
+ int orig_y = FXSYS_round(mtPattern2Device.f);
+ min_col = (clip_box.left - orig_x) / width;
+ if (clip_box.left < orig_x) {
+ min_col --;
+ }
+ max_col = (clip_box.right - orig_x) / width;
+ if (clip_box.right <= orig_x) {
+ max_col --;
+ }
+ min_row = (clip_box.top - orig_y) / height;
+ if (clip_box.top < orig_y) {
+ min_row --;
+ }
+ max_row = (clip_box.bottom - orig_y) / height;
+ if (clip_box.bottom <= orig_y) {
+ max_row --;
+ }
+ }
+ FX_FLOAT left_offset = cell_bbox.left - mtPattern2Device.e;
+ FX_FLOAT top_offset = cell_bbox.bottom - mtPattern2Device.f;
+ CFX_DIBitmap* pPatternBitmap = NULL;
+ if (width * height < 16) {
+ CFX_DIBitmap* pEnlargedBitmap = DrawPatternBitmap(m_pContext->m_pDocument, m_pContext->m_pPageCache, pPattern, pObj2Device, 8, 8, m_Options.m_Flags);
+ pPatternBitmap = pEnlargedBitmap->StretchTo(width, height);
+ delete pEnlargedBitmap;
+ } else {
+ pPatternBitmap = DrawPatternBitmap(m_pContext->m_pDocument, m_pContext->m_pPageCache, pPattern, pObj2Device, width, height, m_Options.m_Flags);
+ }
+ if (pPatternBitmap == NULL) {
+ m_pDevice->RestoreState();
+ return;
+ }
+ if (m_Options.m_ColorMode == RENDER_COLOR_GRAY) {
+ pPatternBitmap->ConvertColorScale(m_Options.m_ForeColor, m_Options.m_BackColor);
+ }
+ FX_ARGB fill_argb = GetFillArgb(pPageObj);
+ int clip_width = clip_box.right - clip_box.left;
+ int clip_height = clip_box.bottom - clip_box.top;
+ CFX_DIBitmap screen;
+ if (!screen.Create(clip_width, clip_height, FXDIB_Argb)) {
+ return;
+ }
+ screen.Clear(0);
+ FX_DWORD* src_buf = (FX_DWORD*)pPatternBitmap->GetBuffer();
+ for (int col = min_col; col <= max_col; col ++) {
+ for (int row = min_row; row <= max_row; row ++) {
+ int start_x, start_y;
+ if (bAligned) {
+ start_x = FXSYS_round(mtPattern2Device.e) + col * width - clip_box.left;
+ start_y = FXSYS_round(mtPattern2Device.f) + row * height - clip_box.top;
+ } else {
+ FX_FLOAT orig_x = col * pPattern->m_XStep;
+ FX_FLOAT orig_y = row * pPattern->m_YStep;
+ mtPattern2Device.Transform(orig_x, orig_y);
+ start_x = FXSYS_round(orig_x + left_offset) - clip_box.left;
+ start_y = FXSYS_round(orig_y + top_offset) - clip_box.top;
+ }
+ if (width == 1 && height == 1) {
+ if (start_x < 0 || start_x >= clip_box.Width() || start_y < 0 || start_y >= clip_box.Height()) {
+ continue;
+ }
+ FX_DWORD* dest_buf = (FX_DWORD*)(screen.GetBuffer() + screen.GetPitch() * start_y + start_x * 4);
+ if (pPattern->m_bColored) {
+ *dest_buf = *src_buf;
+ } else {
+ *dest_buf = (*(FX_LPBYTE)src_buf << 24) | (fill_argb & 0xffffff);
+ }
+ } else {
+ if (pPattern->m_bColored) {
+ screen.CompositeBitmap(start_x, start_y, width, height, pPatternBitmap, 0, 0);
+ } else {
+ screen.CompositeMask(start_x, start_y, width, height, pPatternBitmap, fill_argb, 0, 0);
+ }
+ }
+ }
+ }
+ CompositeDIBitmap(&screen, clip_box.left, clip_box.top, 0, 255, FXDIB_BLEND_NORMAL, FALSE);
+ m_pDevice->RestoreState();
+ delete pPatternBitmap;
+}
+void CPDF_RenderStatus::DrawPathWithPattern(CPDF_PathObject* pPathObj, const CFX_AffineMatrix* pObj2Device, CPDF_Color* pColor, FX_BOOL bStroke)
+{
+ CPDF_Pattern* pattern = pColor->GetPattern();
+ if (pattern == NULL) {
+ return;
+ }
+ if(pattern->m_PatternType == PATTERN_TILING) {
+ DrawTilingPattern((CPDF_TilingPattern*)pattern, pPathObj, pObj2Device, bStroke);
+ } else {
+ DrawShadingPattern((CPDF_ShadingPattern*)pattern, pPathObj, pObj2Device, bStroke);
+ }
+}
+void CPDF_RenderStatus::ProcessPathPattern(CPDF_PathObject* pPathObj, const CFX_AffineMatrix* pObj2Device, int& filltype, FX_BOOL& bStroke)
+{
+ FX_BOOL bPattern = FALSE;
+ if(filltype) {
+ CPDF_Color& FillColor = *pPathObj->m_ColorState.GetFillColor();
+ if(FillColor.m_pCS && FillColor.m_pCS->GetFamily() == PDFCS_PATTERN) {
+ DrawPathWithPattern(pPathObj, pObj2Device, &FillColor, FALSE);
+ filltype = 0;
+ bPattern = TRUE;
+ }
+ }
+ if(bStroke) {
+ CPDF_Color& StrokeColor = *pPathObj->m_ColorState.GetStrokeColor();
+ if(StrokeColor.m_pCS && StrokeColor.m_pCS->GetFamily() == PDFCS_PATTERN) {
+ DrawPathWithPattern(pPathObj, pObj2Device, &StrokeColor, TRUE);
+ bStroke = FALSE;
+ bPattern = TRUE;
+ }
+ }
+#ifdef _FPDFAPI_MINI_
+ if (bPattern && m_DitherBits) {
+ DitherObjectArea(pPathObj, pObj2Device);
+ }
+#endif
+}
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp
index 91ff982935..a26d619565 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp
@@ -1,760 +1,760 @@
-// 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
-
-#include "../../../include/fxge/fx_ge.h"
-#include "../../../include/fpdfapi/fpdf_render.h"
-#include "../../../include/fpdfapi/fpdf_pageobj.h"
-#include "../fpdf_page/pageint.h"
-#include "render_int.h"
-extern FX_BOOL IsAvailableMatrix(const CFX_AffineMatrix& matrix);
-CPDF_Type3Cache::~CPDF_Type3Cache()
-{
- FX_POSITION pos = m_SizeMap.GetStartPosition();
- CFX_ByteString Key;
- CPDF_Type3Glyphs* pSizeCache = NULL;
- while(pos) {
- pSizeCache = (CPDF_Type3Glyphs*)m_SizeMap.GetNextValue(pos);
- delete pSizeCache;
- }
- m_SizeMap.RemoveAll();
-}
-CFX_GlyphBitmap* CPDF_Type3Cache::LoadGlyph(FX_DWORD charcode, const CFX_AffineMatrix* pMatrix, FX_FLOAT retinaScaleX, FX_FLOAT retinaScaleY)
-{
- _CPDF_UniqueKeyGen keygen;
- keygen.Generate(4, FXSYS_round(pMatrix->a * 10000), FXSYS_round(pMatrix->b * 10000),
- FXSYS_round(pMatrix->c * 10000), FXSYS_round(pMatrix->d * 10000));
- CFX_ByteStringC FaceGlyphsKey(keygen.m_Key, keygen.m_KeyLen);
- CPDF_Type3Glyphs* pSizeCache = NULL;
- if(!m_SizeMap.Lookup(FaceGlyphsKey, (void*&)pSizeCache)) {
- pSizeCache = FX_NEW CPDF_Type3Glyphs;
- m_SizeMap.SetAt(FaceGlyphsKey, pSizeCache);
- }
- CFX_GlyphBitmap* pGlyphBitmap;
- if(pSizeCache->m_GlyphMap.Lookup((FX_LPVOID)(FX_UINTPTR)charcode, (void*&)pGlyphBitmap)) {
- return pGlyphBitmap;
- }
- pGlyphBitmap = RenderGlyph(pSizeCache, charcode, pMatrix, retinaScaleX, retinaScaleY);
- pSizeCache->m_GlyphMap.SetAt((FX_LPVOID)(FX_UINTPTR)charcode, pGlyphBitmap);
- return pGlyphBitmap;
-}
-CPDF_Type3Glyphs::~CPDF_Type3Glyphs()
-{
- FX_POSITION pos = m_GlyphMap.GetStartPosition();
- FX_LPVOID Key;
- CFX_GlyphBitmap* pGlyphBitmap;
- while(pos) {
- m_GlyphMap.GetNextAssoc(pos, Key, (void*&)pGlyphBitmap);
- delete pGlyphBitmap;
- }
-}
-static int _AdjustBlue(FX_FLOAT pos, int& count, int blues[])
-{
- FX_FLOAT min_distance = 1000000.0f * 1.0f;
- int closest_pos = -1;
- for (int i = 0; i < count; i ++) {
- FX_FLOAT distance = (FX_FLOAT)FXSYS_fabs(pos - (FX_FLOAT)blues[i]);
- if (distance < 1.0f * 80.0f / 100.0f && distance < min_distance) {
- min_distance = distance;
- closest_pos = i;
- }
- }
- if (closest_pos >= 0) {
- return blues[closest_pos];
- }
- int new_pos = FXSYS_round(pos);
- if (count == TYPE3_MAX_BLUES) {
- return new_pos;
- }
- blues[count++] = new_pos;
- return new_pos;
-}
-void CPDF_Type3Glyphs::AdjustBlue(FX_FLOAT top, FX_FLOAT bottom, int& top_line, int& bottom_line)
-{
- top_line = _AdjustBlue(top, m_TopBlueCount, m_TopBlue);
- bottom_line = _AdjustBlue(bottom, m_BottomBlueCount, m_BottomBlue);
-}
-static FX_BOOL _IsScanLine1bpp(FX_LPBYTE pBuf, int width)
-{
- int size = width / 8;
- for (int i = 0; i < size; i ++)
- if (pBuf[i]) {
- return TRUE;
- }
- if (width % 8)
- if (pBuf[width / 8] & (0xff << (8 - width % 8))) {
- return TRUE;
- }
- return FALSE;
-}
-static FX_BOOL _IsScanLine8bpp(FX_LPBYTE pBuf, int width)
-{
- for (int i = 0; i < width; i ++)
- if (pBuf[i] > 0x40) {
- return TRUE;
- }
- return FALSE;
-}
-static int _DetectFirstLastScan(const CFX_DIBitmap* pBitmap, FX_BOOL bFirst)
-{
- int height = pBitmap->GetHeight(), pitch = pBitmap->GetPitch(), width = pBitmap->GetWidth();
- int bpp = pBitmap->GetBPP();
- if (bpp > 8) {
- width *= bpp / 8;
- }
- FX_LPBYTE pBuf = pBitmap->GetBuffer();
- int line = bFirst ? 0 : height - 1;
- int line_step = bFirst ? 1 : -1;
- int line_end = bFirst ? height : -1;
- while (line != line_end) {
- if (bpp == 1) {
- if (_IsScanLine1bpp(pBuf + line * pitch, width)) {
- return line;
- }
- } else {
- if (_IsScanLine8bpp(pBuf + line * pitch, width)) {
- return line;
- }
- }
- line += line_step;
- }
- return -1;
-}
-CFX_GlyphBitmap* CPDF_Type3Cache::RenderGlyph(CPDF_Type3Glyphs* pSize, FX_DWORD charcode, const CFX_AffineMatrix* pMatrix, FX_FLOAT retinaScaleX, FX_FLOAT retinaScaleY)
-{
- CPDF_Type3Char* pChar = m_pFont->LoadChar(charcode);
- if (pChar == NULL || pChar->m_pBitmap == NULL) {
- return NULL;
- }
- CFX_DIBitmap* pBitmap = pChar->m_pBitmap;
- CFX_AffineMatrix image_matrix, text_matrix;
- image_matrix = pChar->m_ImageMatrix;
- text_matrix.Set(pMatrix->a, pMatrix->b, pMatrix->c, pMatrix->d, 0, 0);
- image_matrix.Concat(text_matrix);
- CFX_DIBitmap* pResBitmap = NULL;
- int left, top;
- if (FXSYS_fabs(image_matrix.b) < FXSYS_fabs(image_matrix.a) / 100 && FXSYS_fabs(image_matrix.c) < FXSYS_fabs(image_matrix.d) / 100) {
- int top_line, bottom_line;
- top_line = _DetectFirstLastScan(pBitmap, TRUE);
- bottom_line = _DetectFirstLastScan(pBitmap, FALSE);
- if (top_line == 0 && bottom_line == pBitmap->GetHeight() - 1) {
- FX_FLOAT top_y = image_matrix.d + image_matrix.f;
- FX_FLOAT bottom_y = image_matrix.f;
- FX_BOOL bFlipped = top_y > bottom_y;
- if (bFlipped) {
- FX_FLOAT temp = top_y;
- top_y = bottom_y;
- bottom_y = temp;
- }
- pSize->AdjustBlue(top_y, bottom_y, top_line, bottom_line);
- pResBitmap = pBitmap->StretchTo((int)(FXSYS_round(image_matrix.a) * retinaScaleX), (int)((bFlipped ? top_line - bottom_line : bottom_line - top_line) * retinaScaleY));
- top = top_line;
- if (image_matrix.a < 0) {
- image_matrix.Scale(retinaScaleX, retinaScaleY);
- left = FXSYS_round(image_matrix.e + image_matrix.a);
- } else {
- left = FXSYS_round(image_matrix.e);
- }
- } else {
- }
- }
- if (pResBitmap == NULL) {
- image_matrix.Scale(retinaScaleX, retinaScaleY);
- pResBitmap = pBitmap->TransformTo(&image_matrix, left, top);
- }
- if (pResBitmap == NULL) {
- return NULL;
- }
- CFX_GlyphBitmap* pGlyph = FX_NEW CFX_GlyphBitmap;
- pGlyph->m_Left = left;
- pGlyph->m_Top = -top;
- pGlyph->m_Bitmap.TakeOver(pResBitmap);
- delete pResBitmap;
- return pGlyph;
-}
-void _CPDF_UniqueKeyGen::Generate(int count, ...)
-{
- va_list argList;
- va_start(argList, count);
- for (int i = 0; i < count; i ++) {
- int p = va_arg(argList, int);
- ((FX_DWORD*)m_Key)[i] = p;
- }
- va_end(argList);
- m_KeyLen = count * sizeof(FX_DWORD);
-}
-FX_BOOL CPDF_RenderStatus::ProcessText(const CPDF_TextObject* textobj, const CFX_AffineMatrix* pObj2Device, CFX_PathData* pClippingPath)
-{
- if(textobj->m_nChars == 0) {
- return TRUE;
- }
- int text_render_mode = textobj->m_TextState.GetObject()->m_TextMode;
- if (text_render_mode == 3) {
- return TRUE;
- }
- CPDF_Font* pFont = textobj->m_TextState.GetFont();
- if (pFont->GetFontType() == PDFFONT_TYPE3) {
- return ProcessType3Text(textobj, pObj2Device);
- }
- FX_BOOL bFill = FALSE, bStroke = FALSE, bClip = FALSE;
- if (pClippingPath) {
- bClip = TRUE;
- } else {
- switch (text_render_mode) {
- case 0:
- case 4:
- bFill = TRUE;
- break;
- case 1:
- case 5:
- if (pFont->GetFace() == NULL && !(pFont->GetSubstFont()->m_SubstFlags & FXFONT_SUBST_GLYPHPATH)) {
- bFill = TRUE;
- } else {
- bStroke = TRUE;
- }
- break;
- case 2:
- case 6:
- if (pFont->GetFace() == NULL && !(pFont->GetSubstFont()->m_SubstFlags & FXFONT_SUBST_GLYPHPATH)) {
- bFill = TRUE;
- } else {
- bFill = bStroke = TRUE;
- }
- break;
- case 3:
- case 7:
- return TRUE;
- default:
- bFill = TRUE;
- }
- }
- FX_ARGB stroke_argb = 0, fill_argb = 0;
- FX_BOOL bPattern = FALSE;
- if (bStroke) {
- if (textobj->m_ColorState.GetStrokeColor()->IsPattern()) {
- bPattern = TRUE;
- } else {
- stroke_argb = GetStrokeArgb(textobj);
- }
- }
- if (bFill) {
- if (textobj->m_ColorState.GetFillColor()->IsPattern()) {
- bPattern = TRUE;
- } else {
- fill_argb = GetFillArgb(textobj);
- }
- }
- CFX_AffineMatrix text_matrix;
- textobj->GetTextMatrix(&text_matrix);
- if(IsAvailableMatrix(text_matrix) == FALSE) {
- return TRUE;
- }
- FX_FLOAT font_size = textobj->m_TextState.GetFontSize();
- if (bPattern) {
- DrawTextPathWithPattern(textobj, pObj2Device, pFont, font_size, &text_matrix, bFill, bStroke);
- return TRUE;
- }
-#if defined(_FPDFAPI_MINI_)
- if (bFill) {
- bStroke = FALSE;
- }
- if (bStroke) {
- if (font_size * text_matrix.GetXUnit() * pObj2Device->GetXUnit() < 6) {
- bStroke = FALSE;
- }
- }
-#endif
- if (bClip || bStroke) {
- const CFX_AffineMatrix* pDeviceMatrix = pObj2Device;
- CFX_AffineMatrix device_matrix;
- if (bStroke) {
- const FX_FLOAT* pCTM = textobj->m_TextState.GetObject()->m_CTM;
- if (pCTM[0] != 1.0f || pCTM[3] != 1.0f) {
- CFX_AffineMatrix ctm(pCTM[0], pCTM[1], pCTM[2], pCTM[3], 0, 0);
- text_matrix.ConcatInverse(ctm);
- device_matrix.Copy(ctm);
- device_matrix.Concat(*pObj2Device);
- pDeviceMatrix = &device_matrix;
- }
- }
- int flag = 0;
- if (bStroke && bFill) {
- flag |= FX_FILL_STROKE;
- flag |= FX_STROKE_TEXT_MODE;
- }
-#if !defined(_FPDFAPI_MINI_) || defined(_FXCORE_FEATURE_ALL_)
- const CPDF_GeneralStateData* pGeneralData = ((CPDF_PageObject*)textobj)->m_GeneralState;
- if (pGeneralData && pGeneralData->m_StrokeAdjust) {
- flag |= FX_STROKE_ADJUST;
- }
-#endif
- if (m_Options.m_Flags & RENDER_NOTEXTSMOOTH) {
- flag |= FXFILL_NOPATHSMOOTH;
- }
- return CPDF_TextRenderer::DrawTextPath(m_pDevice, textobj->m_nChars, textobj->m_pCharCodes, textobj->m_pCharPos, pFont, font_size,
- &text_matrix, pDeviceMatrix, textobj->m_GraphState, fill_argb, stroke_argb, pClippingPath, flag);
- }
- text_matrix.Concat(*pObj2Device);
- return CPDF_TextRenderer::DrawNormalText(m_pDevice, textobj->m_nChars, textobj->m_pCharCodes, textobj->m_pCharPos, pFont, font_size,
- &text_matrix, fill_argb, &m_Options);
-}
-CPDF_Type3Cache* CPDF_RenderStatus::GetCachedType3(CPDF_Type3Font* pFont)
-{
- if (pFont->m_pDocument == NULL) {
- return NULL;
- }
- pFont->m_pDocument->GetPageData()->GetFont(pFont->GetFontDict(), FALSE);
- return pFont->m_pDocument->GetRenderData()->GetCachedType3(pFont);
-}
-static void ReleaseCachedType3(CPDF_Type3Font* pFont)
-{
- if (pFont->m_pDocument == NULL) {
- return;
- }
- pFont->m_pDocument->GetRenderData()->ReleaseCachedType3(pFont);
- pFont->m_pDocument->GetPageData()->ReleaseFont(pFont->GetFontDict());
-}
-FX_BOOL CPDF_Type3Char::LoadBitmap(CPDF_RenderContext* pContext)
-{
- if (m_pBitmap != NULL || m_pForm == NULL) {
- return TRUE;
- }
- if (m_pForm->CountObjects() == 1 && !m_bColored) {
- CPDF_PageObject *pPageObj = m_pForm->GetObjectAt(m_pForm->GetFirstObjectPosition());
- if (pPageObj->m_Type == PDFPAGE_IMAGE) {
- CPDF_ImageObject* pImage = (CPDF_ImageObject*)pPageObj;
- m_ImageMatrix = pImage->m_Matrix;
- const CFX_DIBSource* pSource = pImage->m_pImage->LoadDIBSource();
- if (pSource) {
- m_pBitmap = pSource->Clone();
- delete pSource;
- }
- delete m_pForm;
- m_pForm = NULL;
- return TRUE;
- }
- if (pPageObj->m_Type == PDFPAGE_INLINES) {
- CPDF_InlineImages *pInlines = (CPDF_InlineImages *)pPageObj;
- if (pInlines->m_pStream) {
- m_ImageMatrix = pInlines->m_Matrices[0];
- CPDF_DIBSource dibsrc;
- if (!dibsrc.Load(pContext->m_pDocument, pInlines->m_pStream, NULL, NULL, NULL, NULL)) {
- return FALSE;
- }
- m_pBitmap = dibsrc.Clone();
- delete m_pForm;
- m_pForm = NULL;
- return TRUE;
- }
- }
- }
- return FALSE;
-}
-class CPDF_RefType3Cache
-{
-public:
- CPDF_RefType3Cache(CPDF_Type3Font* pType3Font)
- {
- m_dwCount = 0;
- m_pType3Font = pType3Font;
- }
- ~CPDF_RefType3Cache()
- {
- while(m_dwCount--) {
- ReleaseCachedType3(m_pType3Font);
- }
- }
- FX_DWORD m_dwCount;
- CPDF_Type3Font* m_pType3Font;
-};
-FX_BOOL CPDF_RenderStatus::ProcessType3Text(const CPDF_TextObject* textobj, const CFX_AffineMatrix* pObj2Device)
-{
- CPDF_Type3Font* pType3Font = textobj->m_TextState.GetFont()->GetType3Font();
- for (int j = 0; j < m_Type3FontCache.GetSize(); j++)
- if ((CPDF_Type3Font*)m_Type3FontCache.GetAt(j) == pType3Font) {
- return TRUE;
- }
- CFX_Matrix dCTM = m_pDevice->GetCTM();
- FX_FLOAT sa = FXSYS_fabs(dCTM.a);
- FX_FLOAT sd = FXSYS_fabs(dCTM.d);
- CFX_AffineMatrix text_matrix;
- textobj->GetTextMatrix(&text_matrix);
- CFX_AffineMatrix char_matrix = pType3Font->GetFontMatrix();
- FX_FLOAT font_size = textobj->m_TextState.GetFontSize();
- char_matrix.Scale(font_size, font_size);
- FX_ARGB fill_argb = GetFillArgb(textobj, TRUE);
- int fill_alpha = FXARGB_A(fill_argb);
- int device_class = m_pDevice->GetDeviceClass();
- FXTEXT_GLYPHPOS* pGlyphAndPos = NULL;
- if (device_class == FXDC_DISPLAY) {
- pGlyphAndPos = FX_Alloc(FXTEXT_GLYPHPOS, textobj->m_nChars);
- FXSYS_memset32(pGlyphAndPos, 0, sizeof(FXTEXT_GLYPHPOS) * textobj->m_nChars);
- } else if (fill_alpha < 255) {
- return FALSE;
- }
- CPDF_RefType3Cache refTypeCache(pType3Font);
- FX_DWORD *pChars = textobj->m_pCharCodes;
- if (textobj->m_nChars == 1) {
- pChars = (FX_DWORD*)(&textobj->m_pCharCodes);
- }
- for (int iChar = 0; iChar < textobj->m_nChars; iChar ++) {
- FX_DWORD charcode = pChars[iChar];
- if (charcode == (FX_DWORD) - 1) {
- continue;
- }
- CPDF_Type3Char* pType3Char = pType3Font->LoadChar(charcode);
- if (pType3Char == NULL) {
- continue;
- }
- CFX_AffineMatrix matrix = char_matrix;
- matrix.e += iChar ? textobj->m_pCharPos[iChar - 1] : 0;
- matrix.Concat(text_matrix);
- matrix.Concat(*pObj2Device);
- if (!pType3Char->LoadBitmap(m_pContext)) {
- if (pGlyphAndPos) {
- for (int i = 0; i < iChar; i ++) {
- FXTEXT_GLYPHPOS& glyph = pGlyphAndPos[i];
- if (glyph.m_pGlyph == NULL) {
- continue;
- }
- m_pDevice->SetBitMask(&glyph.m_pGlyph->m_Bitmap,
- glyph.m_OriginX + glyph.m_pGlyph->m_Left,
- glyph.m_OriginY - glyph.m_pGlyph->m_Top, fill_argb);
- }
- FX_Free(pGlyphAndPos);
- pGlyphAndPos = NULL;
- }
- CPDF_GraphicStates* pStates = CloneObjStates(textobj, FALSE);
- CPDF_RenderOptions Options = m_Options;
- Options.m_Flags |= RENDER_FORCE_HALFTONE | RENDER_RECT_AA;
- Options.m_Flags &= ~RENDER_FORCE_DOWNSAMPLE;
- CPDF_Dictionary* pFormResource = NULL;
- if (pType3Char->m_pForm && pType3Char->m_pForm->m_pFormDict) {
- pFormResource = pType3Char->m_pForm->m_pFormDict->GetDict(FX_BSTRC("Resources"));
- }
- if (fill_alpha == 255) {
- CPDF_RenderStatus status;
- status.Initialize(m_Level + 1, m_pContext, m_pDevice, NULL, NULL, this, pStates, &Options,
- pType3Char->m_pForm->m_Transparency, m_bDropObjects, pFormResource, FALSE, pType3Char, fill_argb);
- status.m_Type3FontCache.Append(m_Type3FontCache);
- status.m_Type3FontCache.Add(pType3Font);
- m_pDevice->SaveState();
- status.RenderObjectList(pType3Char->m_pForm, &matrix);
- m_pDevice->RestoreState();
- } else {
- CFX_FloatRect rect_f = pType3Char->m_pForm->CalcBoundingBox();
- rect_f.Transform(&matrix);
- FX_RECT rect = rect_f.GetOutterRect();
- CFX_FxgeDevice bitmap_device;
- if (!bitmap_device.Create((int)(rect.Width() * sa), (int)(rect.Height() * sd), FXDIB_Argb)) {
- return TRUE;
- }
- bitmap_device.GetBitmap()->Clear(0);
- CPDF_RenderStatus status;
- status.Initialize(m_Level + 1, m_pContext, &bitmap_device, NULL, NULL, this, pStates, &Options,
- pType3Char->m_pForm->m_Transparency, m_bDropObjects, pFormResource, FALSE, pType3Char, fill_argb);
- status.m_Type3FontCache.Append(m_Type3FontCache);
- status.m_Type3FontCache.Add(pType3Font);
- matrix.TranslateI(-rect.left, -rect.top);
- matrix.Scale(sa, sd);
- status.RenderObjectList(pType3Char->m_pForm, &matrix);
- m_pDevice->SetDIBits(bitmap_device.GetBitmap(), rect.left, rect.top);
- }
- delete pStates;
- } else if (pType3Char->m_pBitmap) {
- if (device_class == FXDC_DISPLAY) {
- CPDF_Type3Cache* pCache = GetCachedType3(pType3Font);
- refTypeCache.m_dwCount++;
- CFX_GlyphBitmap* pBitmap = pCache->LoadGlyph(charcode, &matrix, sa, sd);
- if (pBitmap == NULL) {
- continue;
- }
- int origin_x = FXSYS_round(matrix.e);
- int origin_y = FXSYS_round(matrix.f);
- if (pGlyphAndPos) {
- pGlyphAndPos[iChar].m_pGlyph = pBitmap;
- pGlyphAndPos[iChar].m_OriginX = origin_x;
- pGlyphAndPos[iChar].m_OriginY = origin_y;
- } else {
- m_pDevice->SetBitMask(&pBitmap->m_Bitmap, origin_x + pBitmap->m_Left, origin_y - pBitmap->m_Top, fill_argb);
- }
- } else {
- CFX_AffineMatrix image_matrix = pType3Char->m_ImageMatrix;
- image_matrix.Concat(matrix);
- CPDF_ImageRenderer renderer;
- if (renderer.Start(this, pType3Char->m_pBitmap, fill_argb, 255, &image_matrix, 0, FALSE)) {
- renderer.Continue(NULL);
- }
- if (!renderer.m_Result) {
- return FALSE;
- }
- }
- }
- }
- if (pGlyphAndPos) {
- FX_RECT rect = FXGE_GetGlyphsBBox(pGlyphAndPos, textobj->m_nChars, 0, sa, sd);
- CFX_DIBitmap bitmap;
- if (!bitmap.Create((int)(rect.Width() * sa), (int)(rect.Height() * sd), FXDIB_8bppMask)) {
- FX_Free(pGlyphAndPos);
- return TRUE;
- }
- bitmap.Clear(0);
- for (int iChar = 0; iChar < textobj->m_nChars; iChar ++) {
- FXTEXT_GLYPHPOS& glyph = pGlyphAndPos[iChar];
- if (glyph.m_pGlyph == NULL) {
- continue;
- }
- bitmap.TransferBitmap((int)((glyph.m_OriginX + glyph.m_pGlyph->m_Left - rect.left) * sa),
- (int)((glyph.m_OriginY - glyph.m_pGlyph->m_Top - rect.top) * sd),
- glyph.m_pGlyph->m_Bitmap.GetWidth(), glyph.m_pGlyph->m_Bitmap.GetHeight(),
- &glyph.m_pGlyph->m_Bitmap, 0, 0);
- }
- m_pDevice->SetBitMask(&bitmap, rect.left, rect.top, fill_argb);
- FX_Free(pGlyphAndPos);
- }
- return TRUE;
-}
-class CPDF_CharPosList
-{
-public:
- CPDF_CharPosList();
- ~CPDF_CharPosList();
- void Load(int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pCharPos, CPDF_Font* pFont, FX_FLOAT font_size);
- FXTEXT_CHARPOS* m_pCharPos;
- FX_DWORD m_nChars;
-};
-FX_FLOAT _CIDTransformToFloat(FX_BYTE ch);
-CPDF_CharPosList::CPDF_CharPosList()
-{
- m_pCharPos = NULL;
-}
-CPDF_CharPosList::~CPDF_CharPosList()
-{
- if (m_pCharPos) {
- FX_Free(m_pCharPos);
- }
-}
-void CPDF_CharPosList::Load(int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pCharPos, CPDF_Font* pFont,
- FX_FLOAT FontSize)
-{
- m_pCharPos = FX_Alloc(FXTEXT_CHARPOS, nChars);
- FXSYS_memset32(m_pCharPos, 0, sizeof(FXTEXT_CHARPOS) * nChars);
- m_nChars = 0;
- CPDF_CIDFont* pCIDFont = pFont->GetCIDFont();
- FX_BOOL bVertWriting = pCIDFont && pCIDFont->IsVertWriting();
- for (int iChar = 0; iChar < nChars; iChar ++) {
- FX_DWORD CharCode = nChars == 1 ? (FX_DWORD)(FX_UINTPTR)pCharCodes : pCharCodes[iChar];
- if (CharCode == (FX_DWORD) - 1) {
- continue;
- }
- FX_BOOL bVert = FALSE;
- FXTEXT_CHARPOS& charpos = m_pCharPos[m_nChars++];
- if (pCIDFont) {
- charpos.m_bFontStyle = pCIDFont->IsFontStyleFromCharCode(CharCode);
- }
- charpos.m_GlyphIndex = pFont->GlyphFromCharCode(CharCode, &bVert);
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
- charpos.m_ExtGID = pFont->GlyphFromCharCodeExt(CharCode);
-#endif
- if (!pFont->IsEmbedded() && pFont->GetFontType() != PDFFONT_CIDFONT) {
- charpos.m_FontCharWidth = pFont->GetCharWidthF(CharCode);
- } else {
- charpos.m_FontCharWidth = 0;
- }
- charpos.m_OriginX = iChar ? pCharPos[iChar - 1] : 0;
- charpos.m_OriginY = 0;
- charpos.m_bGlyphAdjust = FALSE;
- if (pCIDFont == NULL) {
- continue;
- }
- FX_WORD CID = pCIDFont->CIDFromCharCode(CharCode);
- if (bVertWriting) {
- charpos.m_OriginY = charpos.m_OriginX;
- charpos.m_OriginX = 0;
- short vx, vy;
- pCIDFont->GetVertOrigin(CID, vx, vy);
- charpos.m_OriginX -= FontSize * vx / 1000;
- charpos.m_OriginY -= FontSize * vy / 1000;
- }
- FX_LPCBYTE pTransform = pCIDFont->GetCIDTransform(CID);
- if (pTransform && !bVert) {
- charpos.m_AdjustMatrix[0] = _CIDTransformToFloat(pTransform[0]);
- charpos.m_AdjustMatrix[2] = _CIDTransformToFloat(pTransform[2]);
- charpos.m_AdjustMatrix[1] = _CIDTransformToFloat(pTransform[1]);
- charpos.m_AdjustMatrix[3] = _CIDTransformToFloat(pTransform[3]);
- charpos.m_OriginX += _CIDTransformToFloat(pTransform[4]) * FontSize;
- charpos.m_OriginY += _CIDTransformToFloat(pTransform[5]) * FontSize;
- charpos.m_bGlyphAdjust = TRUE;
- }
- }
-}
-FX_BOOL CPDF_TextRenderer::DrawTextPath(CFX_RenderDevice* pDevice, int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pCharPos,
- CPDF_Font* pFont, FX_FLOAT font_size,
- const CFX_AffineMatrix* pText2User, const CFX_AffineMatrix* pUser2Device,
- const CFX_GraphStateData* pGraphState,
- FX_ARGB fill_argb, FX_ARGB stroke_argb, CFX_PathData* pClippingPath, int nFlag)
-{
- CFX_FontCache* pCache = pFont->m_pDocument ? pFont->m_pDocument->GetRenderData()->GetFontCache() : NULL;
- CPDF_CharPosList CharPosList;
- CharPosList.Load(nChars, pCharCodes, pCharPos, pFont, font_size);
- return pDevice->DrawTextPath(CharPosList.m_nChars, CharPosList.m_pCharPos,
- &pFont->m_Font, pCache, font_size, pText2User, pUser2Device,
- pGraphState, fill_argb, stroke_argb, pClippingPath, nFlag);
-}
-void CPDF_TextRenderer::DrawTextString(CFX_RenderDevice* pDevice, int left, int top, CPDF_Font* pFont, int height,
- const CFX_ByteString& str, FX_ARGB argb)
-{
- FX_RECT font_bbox;
- pFont->GetFontBBox(font_bbox);
- FX_FLOAT font_size = (FX_FLOAT)height * 1000.0f / (FX_FLOAT)(font_bbox.top - font_bbox.bottom);
- FX_FLOAT origin_x = (FX_FLOAT)left;
- FX_FLOAT origin_y = (FX_FLOAT)top + font_size * (FX_FLOAT)font_bbox.top / 1000.0f;
- CFX_AffineMatrix matrix(1.0f, 0, 0, -1.0f, 0, 0);
- DrawTextString(pDevice, origin_x, origin_y, pFont, font_size, &matrix, str, argb);
-}
-void CPDF_TextRenderer::DrawTextString(CFX_RenderDevice* pDevice, FX_FLOAT origin_x, FX_FLOAT origin_y, CPDF_Font* pFont, FX_FLOAT font_size,
- const CFX_AffineMatrix* pMatrix, const CFX_ByteString& str, FX_ARGB fill_argb,
- FX_ARGB stroke_argb, const CFX_GraphStateData* pGraphState, const CPDF_RenderOptions* pOptions)
-{
- int nChars = pFont->CountChar(str, str.GetLength());
- if (nChars == 0) {
- return;
- }
- FX_DWORD charcode;
- int offset = 0;
- FX_DWORD* pCharCodes;
- FX_FLOAT* pCharPos;
- if (nChars == 1) {
- charcode = pFont->GetNextChar(str, offset);
- pCharCodes = (FX_DWORD*)(FX_UINTPTR)charcode;
- pCharPos = NULL;
- } else {
- pCharCodes = FX_Alloc(FX_DWORD, nChars);
- pCharPos = FX_Alloc(FX_FLOAT, nChars - 1);
- FX_FLOAT cur_pos = 0;
- for (int i = 0; i < nChars; i ++) {
- pCharCodes[i] = pFont->GetNextChar(str, offset);
- if (i) {
- pCharPos[i - 1] = cur_pos;
- }
- cur_pos += pFont->GetCharWidthF(pCharCodes[i]) * font_size / 1000;
- }
- }
- CFX_AffineMatrix matrix;
- if (pMatrix) {
- matrix = *pMatrix;
- }
- matrix.e = origin_x;
- matrix.f = origin_y;
- if (pFont->GetFontType() == PDFFONT_TYPE3)
- ;
- else if (stroke_argb == 0) {
- DrawNormalText(pDevice, nChars, pCharCodes, pCharPos, pFont, font_size, &matrix, fill_argb, pOptions);
- } else
- DrawTextPath(pDevice, nChars, pCharCodes, pCharPos, pFont, font_size, &matrix, NULL, pGraphState,
- fill_argb, stroke_argb, NULL);
- if (nChars > 1) {
- FX_Free(pCharCodes);
- FX_Free(pCharPos);
- }
-}
-FX_BOOL CPDF_TextRenderer::DrawNormalText(CFX_RenderDevice* pDevice, int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pCharPos,
- CPDF_Font* pFont, FX_FLOAT font_size,
- const CFX_AffineMatrix* pText2Device,
- FX_ARGB fill_argb, const CPDF_RenderOptions* pOptions)
-{
- CFX_FontCache* pCache = pFont->m_pDocument ? pFont->m_pDocument->GetRenderData()->GetFontCache() : NULL;
- CPDF_CharPosList CharPosList;
- CharPosList.Load(nChars, pCharCodes, pCharPos, pFont, font_size);
- int FXGE_flags = 0;
- if (pOptions) {
- FX_DWORD dwFlags = pOptions->m_Flags;
- if (dwFlags & RENDER_CLEARTYPE) {
- FXGE_flags |= FXTEXT_CLEARTYPE;
- if (dwFlags & RENDER_BGR_STRIPE) {
- FXGE_flags |= FXTEXT_BGR_STRIPE;
- }
- }
- if (dwFlags & RENDER_NOTEXTSMOOTH) {
- FXGE_flags |= FXTEXT_NOSMOOTH;
- }
- if (dwFlags & RENDER_PRINTGRAPHICTEXT) {
- FXGE_flags |= FXTEXT_PRINTGRAPHICTEXT;
- }
- if (dwFlags & RENDER_NO_NATIVETEXT) {
- FXGE_flags |= FXTEXT_NO_NATIVETEXT;
- }
- if (dwFlags & RENDER_PRINTIMAGETEXT) {
- FXGE_flags |= FXTEXT_PRINTIMAGETEXT;
- }
- } else {
- FXGE_flags = FXTEXT_CLEARTYPE;
- }
- if (pFont->GetFontType() & PDFFONT_CIDFONT) {
- FXGE_flags |= FXFONT_CIDFONT;
- }
- return pDevice->DrawNormalText(CharPosList.m_nChars, CharPosList.m_pCharPos, &pFont->m_Font, pCache, font_size, pText2Device, fill_argb, FXGE_flags);
-}
-void CPDF_RenderStatus::DrawTextPathWithPattern(const CPDF_TextObject* textobj, const CFX_AffineMatrix* pObj2Device,
- CPDF_Font* pFont, FX_FLOAT font_size,
- const CFX_AffineMatrix* pTextMatrix, FX_BOOL bFill, FX_BOOL bStroke)
-{
- if (!bStroke) {
- CPDF_PathObject path;
- CPDF_TextObject* pCopy = FX_NEW CPDF_TextObject;
- pCopy->Copy(textobj);
- path.m_bStroke = FALSE;
- path.m_FillType = FXFILL_WINDING;
- path.m_ClipPath.AppendTexts(&pCopy, 1);
- path.m_ColorState = textobj->m_ColorState;
- path.m_Path.New()->AppendRect(textobj->m_Left, textobj->m_Bottom, textobj->m_Right, textobj->m_Top);
- path.m_Left = textobj->m_Left;
- path.m_Bottom = textobj->m_Bottom;
- path.m_Right = textobj->m_Right;
- path.m_Top = textobj->m_Top;
- RenderSingleObject(&path, pObj2Device);
- return;
- }
- CFX_FontCache* pCache;
- if (pFont->m_pDocument) {
- pCache = pFont->m_pDocument->GetRenderData()->GetFontCache();
- } else {
- pCache = CFX_GEModule::Get()->GetFontCache();
- }
- CFX_FaceCache* pFaceCache = pCache->GetCachedFace(&pFont->m_Font);
- FX_FONTCACHE_DEFINE(pCache, &pFont->m_Font);
- CPDF_CharPosList CharPosList;
- CharPosList.Load(textobj->m_nChars, textobj->m_pCharCodes, textobj->m_pCharPos, pFont, font_size);
- for (FX_DWORD i = 0; i < CharPosList.m_nChars; i ++) {
- FXTEXT_CHARPOS& charpos = CharPosList.m_pCharPos[i];
- const CFX_PathData* pPath = pFaceCache->LoadGlyphPath(&pFont->m_Font, charpos.m_GlyphIndex,
- charpos.m_FontCharWidth);
- if (pPath == NULL) {
- continue;
- }
- CPDF_PathObject path;
- path.m_GraphState = textobj->m_GraphState;
- path.m_ColorState = textobj->m_ColorState;
- CFX_AffineMatrix matrix;
- if (charpos.m_bGlyphAdjust)
- matrix.Set(charpos.m_AdjustMatrix[0], charpos.m_AdjustMatrix[1],
- charpos.m_AdjustMatrix[2], charpos.m_AdjustMatrix[3], 0, 0);
- matrix.Concat(font_size, 0, 0, font_size, charpos.m_OriginX, charpos.m_OriginY);
- path.m_Path.New()->Append(pPath, &matrix);
- path.m_Matrix = *pTextMatrix;
- path.m_bStroke = bStroke;
- path.m_FillType = bFill ? FXFILL_WINDING : 0;
- path.CalcBoundingBox();
- ProcessPath(&path, pObj2Device);
- }
-}
-CFX_PathData* CPDF_Font::LoadGlyphPath(FX_DWORD charcode, int dest_width)
-{
- int glyph_index = GlyphFromCharCode(charcode);
- if (m_Font.m_Face == NULL) {
- return NULL;
- }
- return m_Font.LoadGlyphPath(glyph_index, dest_width);
-}
+// 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
+
+#include "../../../include/fxge/fx_ge.h"
+#include "../../../include/fpdfapi/fpdf_render.h"
+#include "../../../include/fpdfapi/fpdf_pageobj.h"
+#include "../fpdf_page/pageint.h"
+#include "render_int.h"
+extern FX_BOOL IsAvailableMatrix(const CFX_AffineMatrix& matrix);
+CPDF_Type3Cache::~CPDF_Type3Cache()
+{
+ FX_POSITION pos = m_SizeMap.GetStartPosition();
+ CFX_ByteString Key;
+ CPDF_Type3Glyphs* pSizeCache = NULL;
+ while(pos) {
+ pSizeCache = (CPDF_Type3Glyphs*)m_SizeMap.GetNextValue(pos);
+ delete pSizeCache;
+ }
+ m_SizeMap.RemoveAll();
+}
+CFX_GlyphBitmap* CPDF_Type3Cache::LoadGlyph(FX_DWORD charcode, const CFX_AffineMatrix* pMatrix, FX_FLOAT retinaScaleX, FX_FLOAT retinaScaleY)
+{
+ _CPDF_UniqueKeyGen keygen;
+ keygen.Generate(4, FXSYS_round(pMatrix->a * 10000), FXSYS_round(pMatrix->b * 10000),
+ FXSYS_round(pMatrix->c * 10000), FXSYS_round(pMatrix->d * 10000));
+ CFX_ByteStringC FaceGlyphsKey(keygen.m_Key, keygen.m_KeyLen);
+ CPDF_Type3Glyphs* pSizeCache = NULL;
+ if(!m_SizeMap.Lookup(FaceGlyphsKey, (void*&)pSizeCache)) {
+ pSizeCache = FX_NEW CPDF_Type3Glyphs;
+ m_SizeMap.SetAt(FaceGlyphsKey, pSizeCache);
+ }
+ CFX_GlyphBitmap* pGlyphBitmap;
+ if(pSizeCache->m_GlyphMap.Lookup((FX_LPVOID)(FX_UINTPTR)charcode, (void*&)pGlyphBitmap)) {
+ return pGlyphBitmap;
+ }
+ pGlyphBitmap = RenderGlyph(pSizeCache, charcode, pMatrix, retinaScaleX, retinaScaleY);
+ pSizeCache->m_GlyphMap.SetAt((FX_LPVOID)(FX_UINTPTR)charcode, pGlyphBitmap);
+ return pGlyphBitmap;
+}
+CPDF_Type3Glyphs::~CPDF_Type3Glyphs()
+{
+ FX_POSITION pos = m_GlyphMap.GetStartPosition();
+ FX_LPVOID Key;
+ CFX_GlyphBitmap* pGlyphBitmap;
+ while(pos) {
+ m_GlyphMap.GetNextAssoc(pos, Key, (void*&)pGlyphBitmap);
+ delete pGlyphBitmap;
+ }
+}
+static int _AdjustBlue(FX_FLOAT pos, int& count, int blues[])
+{
+ FX_FLOAT min_distance = 1000000.0f * 1.0f;
+ int closest_pos = -1;
+ for (int i = 0; i < count; i ++) {
+ FX_FLOAT distance = (FX_FLOAT)FXSYS_fabs(pos - (FX_FLOAT)blues[i]);
+ if (distance < 1.0f * 80.0f / 100.0f && distance < min_distance) {
+ min_distance = distance;
+ closest_pos = i;
+ }
+ }
+ if (closest_pos >= 0) {
+ return blues[closest_pos];
+ }
+ int new_pos = FXSYS_round(pos);
+ if (count == TYPE3_MAX_BLUES) {
+ return new_pos;
+ }
+ blues[count++] = new_pos;
+ return new_pos;
+}
+void CPDF_Type3Glyphs::AdjustBlue(FX_FLOAT top, FX_FLOAT bottom, int& top_line, int& bottom_line)
+{
+ top_line = _AdjustBlue(top, m_TopBlueCount, m_TopBlue);
+ bottom_line = _AdjustBlue(bottom, m_BottomBlueCount, m_BottomBlue);
+}
+static FX_BOOL _IsScanLine1bpp(FX_LPBYTE pBuf, int width)
+{
+ int size = width / 8;
+ for (int i = 0; i < size; i ++)
+ if (pBuf[i]) {
+ return TRUE;
+ }
+ if (width % 8)
+ if (pBuf[width / 8] & (0xff << (8 - width % 8))) {
+ return TRUE;
+ }
+ return FALSE;
+}
+static FX_BOOL _IsScanLine8bpp(FX_LPBYTE pBuf, int width)
+{
+ for (int i = 0; i < width; i ++)
+ if (pBuf[i] > 0x40) {
+ return TRUE;
+ }
+ return FALSE;
+}
+static int _DetectFirstLastScan(const CFX_DIBitmap* pBitmap, FX_BOOL bFirst)
+{
+ int height = pBitmap->GetHeight(), pitch = pBitmap->GetPitch(), width = pBitmap->GetWidth();
+ int bpp = pBitmap->GetBPP();
+ if (bpp > 8) {
+ width *= bpp / 8;
+ }
+ FX_LPBYTE pBuf = pBitmap->GetBuffer();
+ int line = bFirst ? 0 : height - 1;
+ int line_step = bFirst ? 1 : -1;
+ int line_end = bFirst ? height : -1;
+ while (line != line_end) {
+ if (bpp == 1) {
+ if (_IsScanLine1bpp(pBuf + line * pitch, width)) {
+ return line;
+ }
+ } else {
+ if (_IsScanLine8bpp(pBuf + line * pitch, width)) {
+ return line;
+ }
+ }
+ line += line_step;
+ }
+ return -1;
+}
+CFX_GlyphBitmap* CPDF_Type3Cache::RenderGlyph(CPDF_Type3Glyphs* pSize, FX_DWORD charcode, const CFX_AffineMatrix* pMatrix, FX_FLOAT retinaScaleX, FX_FLOAT retinaScaleY)
+{
+ CPDF_Type3Char* pChar = m_pFont->LoadChar(charcode);
+ if (pChar == NULL || pChar->m_pBitmap == NULL) {
+ return NULL;
+ }
+ CFX_DIBitmap* pBitmap = pChar->m_pBitmap;
+ CFX_AffineMatrix image_matrix, text_matrix;
+ image_matrix = pChar->m_ImageMatrix;
+ text_matrix.Set(pMatrix->a, pMatrix->b, pMatrix->c, pMatrix->d, 0, 0);
+ image_matrix.Concat(text_matrix);
+ CFX_DIBitmap* pResBitmap = NULL;
+ int left, top;
+ if (FXSYS_fabs(image_matrix.b) < FXSYS_fabs(image_matrix.a) / 100 && FXSYS_fabs(image_matrix.c) < FXSYS_fabs(image_matrix.d) / 100) {
+ int top_line, bottom_line;
+ top_line = _DetectFirstLastScan(pBitmap, TRUE);
+ bottom_line = _DetectFirstLastScan(pBitmap, FALSE);
+ if (top_line == 0 && bottom_line == pBitmap->GetHeight() - 1) {
+ FX_FLOAT top_y = image_matrix.d + image_matrix.f;
+ FX_FLOAT bottom_y = image_matrix.f;
+ FX_BOOL bFlipped = top_y > bottom_y;
+ if (bFlipped) {
+ FX_FLOAT temp = top_y;
+ top_y = bottom_y;
+ bottom_y = temp;
+ }
+ pSize->AdjustBlue(top_y, bottom_y, top_line, bottom_line);
+ pResBitmap = pBitmap->StretchTo((int)(FXSYS_round(image_matrix.a) * retinaScaleX), (int)((bFlipped ? top_line - bottom_line : bottom_line - top_line) * retinaScaleY));
+ top = top_line;
+ if (image_matrix.a < 0) {
+ image_matrix.Scale(retinaScaleX, retinaScaleY);
+ left = FXSYS_round(image_matrix.e + image_matrix.a);
+ } else {
+ left = FXSYS_round(image_matrix.e);
+ }
+ } else {
+ }
+ }
+ if (pResBitmap == NULL) {
+ image_matrix.Scale(retinaScaleX, retinaScaleY);
+ pResBitmap = pBitmap->TransformTo(&image_matrix, left, top);
+ }
+ if (pResBitmap == NULL) {
+ return NULL;
+ }
+ CFX_GlyphBitmap* pGlyph = FX_NEW CFX_GlyphBitmap;
+ pGlyph->m_Left = left;
+ pGlyph->m_Top = -top;
+ pGlyph->m_Bitmap.TakeOver(pResBitmap);
+ delete pResBitmap;
+ return pGlyph;
+}
+void _CPDF_UniqueKeyGen::Generate(int count, ...)
+{
+ va_list argList;
+ va_start(argList, count);
+ for (int i = 0; i < count; i ++) {
+ int p = va_arg(argList, int);
+ ((FX_DWORD*)m_Key)[i] = p;
+ }
+ va_end(argList);
+ m_KeyLen = count * sizeof(FX_DWORD);
+}
+FX_BOOL CPDF_RenderStatus::ProcessText(const CPDF_TextObject* textobj, const CFX_AffineMatrix* pObj2Device, CFX_PathData* pClippingPath)
+{
+ if(textobj->m_nChars == 0) {
+ return TRUE;
+ }
+ int text_render_mode = textobj->m_TextState.GetObject()->m_TextMode;
+ if (text_render_mode == 3) {
+ return TRUE;
+ }
+ CPDF_Font* pFont = textobj->m_TextState.GetFont();
+ if (pFont->GetFontType() == PDFFONT_TYPE3) {
+ return ProcessType3Text(textobj, pObj2Device);
+ }
+ FX_BOOL bFill = FALSE, bStroke = FALSE, bClip = FALSE;
+ if (pClippingPath) {
+ bClip = TRUE;
+ } else {
+ switch (text_render_mode) {
+ case 0:
+ case 4:
+ bFill = TRUE;
+ break;
+ case 1:
+ case 5:
+ if (pFont->GetFace() == NULL && !(pFont->GetSubstFont()->m_SubstFlags & FXFONT_SUBST_GLYPHPATH)) {
+ bFill = TRUE;
+ } else {
+ bStroke = TRUE;
+ }
+ break;
+ case 2:
+ case 6:
+ if (pFont->GetFace() == NULL && !(pFont->GetSubstFont()->m_SubstFlags & FXFONT_SUBST_GLYPHPATH)) {
+ bFill = TRUE;
+ } else {
+ bFill = bStroke = TRUE;
+ }
+ break;
+ case 3:
+ case 7:
+ return TRUE;
+ default:
+ bFill = TRUE;
+ }
+ }
+ FX_ARGB stroke_argb = 0, fill_argb = 0;
+ FX_BOOL bPattern = FALSE;
+ if (bStroke) {
+ if (textobj->m_ColorState.GetStrokeColor()->IsPattern()) {
+ bPattern = TRUE;
+ } else {
+ stroke_argb = GetStrokeArgb(textobj);
+ }
+ }
+ if (bFill) {
+ if (textobj->m_ColorState.GetFillColor()->IsPattern()) {
+ bPattern = TRUE;
+ } else {
+ fill_argb = GetFillArgb(textobj);
+ }
+ }
+ CFX_AffineMatrix text_matrix;
+ textobj->GetTextMatrix(&text_matrix);
+ if(IsAvailableMatrix(text_matrix) == FALSE) {
+ return TRUE;
+ }
+ FX_FLOAT font_size = textobj->m_TextState.GetFontSize();
+ if (bPattern) {
+ DrawTextPathWithPattern(textobj, pObj2Device, pFont, font_size, &text_matrix, bFill, bStroke);
+ return TRUE;
+ }
+#if defined(_FPDFAPI_MINI_)
+ if (bFill) {
+ bStroke = FALSE;
+ }
+ if (bStroke) {
+ if (font_size * text_matrix.GetXUnit() * pObj2Device->GetXUnit() < 6) {
+ bStroke = FALSE;
+ }
+ }
+#endif
+ if (bClip || bStroke) {
+ const CFX_AffineMatrix* pDeviceMatrix = pObj2Device;
+ CFX_AffineMatrix device_matrix;
+ if (bStroke) {
+ const FX_FLOAT* pCTM = textobj->m_TextState.GetObject()->m_CTM;
+ if (pCTM[0] != 1.0f || pCTM[3] != 1.0f) {
+ CFX_AffineMatrix ctm(pCTM[0], pCTM[1], pCTM[2], pCTM[3], 0, 0);
+ text_matrix.ConcatInverse(ctm);
+ device_matrix.Copy(ctm);
+ device_matrix.Concat(*pObj2Device);
+ pDeviceMatrix = &device_matrix;
+ }
+ }
+ int flag = 0;
+ if (bStroke && bFill) {
+ flag |= FX_FILL_STROKE;
+ flag |= FX_STROKE_TEXT_MODE;
+ }
+#if !defined(_FPDFAPI_MINI_) || defined(_FXCORE_FEATURE_ALL_)
+ const CPDF_GeneralStateData* pGeneralData = ((CPDF_PageObject*)textobj)->m_GeneralState;
+ if (pGeneralData && pGeneralData->m_StrokeAdjust) {
+ flag |= FX_STROKE_ADJUST;
+ }
+#endif
+ if (m_Options.m_Flags & RENDER_NOTEXTSMOOTH) {
+ flag |= FXFILL_NOPATHSMOOTH;
+ }
+ return CPDF_TextRenderer::DrawTextPath(m_pDevice, textobj->m_nChars, textobj->m_pCharCodes, textobj->m_pCharPos, pFont, font_size,
+ &text_matrix, pDeviceMatrix, textobj->m_GraphState, fill_argb, stroke_argb, pClippingPath, flag);
+ }
+ text_matrix.Concat(*pObj2Device);
+ return CPDF_TextRenderer::DrawNormalText(m_pDevice, textobj->m_nChars, textobj->m_pCharCodes, textobj->m_pCharPos, pFont, font_size,
+ &text_matrix, fill_argb, &m_Options);
+}
+CPDF_Type3Cache* CPDF_RenderStatus::GetCachedType3(CPDF_Type3Font* pFont)
+{
+ if (pFont->m_pDocument == NULL) {
+ return NULL;
+ }
+ pFont->m_pDocument->GetPageData()->GetFont(pFont->GetFontDict(), FALSE);
+ return pFont->m_pDocument->GetRenderData()->GetCachedType3(pFont);
+}
+static void ReleaseCachedType3(CPDF_Type3Font* pFont)
+{
+ if (pFont->m_pDocument == NULL) {
+ return;
+ }
+ pFont->m_pDocument->GetRenderData()->ReleaseCachedType3(pFont);
+ pFont->m_pDocument->GetPageData()->ReleaseFont(pFont->GetFontDict());
+}
+FX_BOOL CPDF_Type3Char::LoadBitmap(CPDF_RenderContext* pContext)
+{
+ if (m_pBitmap != NULL || m_pForm == NULL) {
+ return TRUE;
+ }
+ if (m_pForm->CountObjects() == 1 && !m_bColored) {
+ CPDF_PageObject *pPageObj = m_pForm->GetObjectAt(m_pForm->GetFirstObjectPosition());
+ if (pPageObj->m_Type == PDFPAGE_IMAGE) {
+ CPDF_ImageObject* pImage = (CPDF_ImageObject*)pPageObj;
+ m_ImageMatrix = pImage->m_Matrix;
+ const CFX_DIBSource* pSource = pImage->m_pImage->LoadDIBSource();
+ if (pSource) {
+ m_pBitmap = pSource->Clone();
+ delete pSource;
+ }
+ delete m_pForm;
+ m_pForm = NULL;
+ return TRUE;
+ }
+ if (pPageObj->m_Type == PDFPAGE_INLINES) {
+ CPDF_InlineImages *pInlines = (CPDF_InlineImages *)pPageObj;
+ if (pInlines->m_pStream) {
+ m_ImageMatrix = pInlines->m_Matrices[0];
+ CPDF_DIBSource dibsrc;
+ if (!dibsrc.Load(pContext->m_pDocument, pInlines->m_pStream, NULL, NULL, NULL, NULL)) {
+ return FALSE;
+ }
+ m_pBitmap = dibsrc.Clone();
+ delete m_pForm;
+ m_pForm = NULL;
+ return TRUE;
+ }
+ }
+ }
+ return FALSE;
+}
+class CPDF_RefType3Cache
+{
+public:
+ CPDF_RefType3Cache(CPDF_Type3Font* pType3Font)
+ {
+ m_dwCount = 0;
+ m_pType3Font = pType3Font;
+ }
+ ~CPDF_RefType3Cache()
+ {
+ while(m_dwCount--) {
+ ReleaseCachedType3(m_pType3Font);
+ }
+ }
+ FX_DWORD m_dwCount;
+ CPDF_Type3Font* m_pType3Font;
+};
+FX_BOOL CPDF_RenderStatus::ProcessType3Text(const CPDF_TextObject* textobj, const CFX_AffineMatrix* pObj2Device)
+{
+ CPDF_Type3Font* pType3Font = textobj->m_TextState.GetFont()->GetType3Font();
+ for (int j = 0; j < m_Type3FontCache.GetSize(); j++)
+ if ((CPDF_Type3Font*)m_Type3FontCache.GetAt(j) == pType3Font) {
+ return TRUE;
+ }
+ CFX_Matrix dCTM = m_pDevice->GetCTM();
+ FX_FLOAT sa = FXSYS_fabs(dCTM.a);
+ FX_FLOAT sd = FXSYS_fabs(dCTM.d);
+ CFX_AffineMatrix text_matrix;
+ textobj->GetTextMatrix(&text_matrix);
+ CFX_AffineMatrix char_matrix = pType3Font->GetFontMatrix();
+ FX_FLOAT font_size = textobj->m_TextState.GetFontSize();
+ char_matrix.Scale(font_size, font_size);
+ FX_ARGB fill_argb = GetFillArgb(textobj, TRUE);
+ int fill_alpha = FXARGB_A(fill_argb);
+ int device_class = m_pDevice->GetDeviceClass();
+ FXTEXT_GLYPHPOS* pGlyphAndPos = NULL;
+ if (device_class == FXDC_DISPLAY) {
+ pGlyphAndPos = FX_Alloc(FXTEXT_GLYPHPOS, textobj->m_nChars);
+ FXSYS_memset32(pGlyphAndPos, 0, sizeof(FXTEXT_GLYPHPOS) * textobj->m_nChars);
+ } else if (fill_alpha < 255) {
+ return FALSE;
+ }
+ CPDF_RefType3Cache refTypeCache(pType3Font);
+ FX_DWORD *pChars = textobj->m_pCharCodes;
+ if (textobj->m_nChars == 1) {
+ pChars = (FX_DWORD*)(&textobj->m_pCharCodes);
+ }
+ for (int iChar = 0; iChar < textobj->m_nChars; iChar ++) {
+ FX_DWORD charcode = pChars[iChar];
+ if (charcode == (FX_DWORD) - 1) {
+ continue;
+ }
+ CPDF_Type3Char* pType3Char = pType3Font->LoadChar(charcode);
+ if (pType3Char == NULL) {
+ continue;
+ }
+ CFX_AffineMatrix matrix = char_matrix;
+ matrix.e += iChar ? textobj->m_pCharPos[iChar - 1] : 0;
+ matrix.Concat(text_matrix);
+ matrix.Concat(*pObj2Device);
+ if (!pType3Char->LoadBitmap(m_pContext)) {
+ if (pGlyphAndPos) {
+ for (int i = 0; i < iChar; i ++) {
+ FXTEXT_GLYPHPOS& glyph = pGlyphAndPos[i];
+ if (glyph.m_pGlyph == NULL) {
+ continue;
+ }
+ m_pDevice->SetBitMask(&glyph.m_pGlyph->m_Bitmap,
+ glyph.m_OriginX + glyph.m_pGlyph->m_Left,
+ glyph.m_OriginY - glyph.m_pGlyph->m_Top, fill_argb);
+ }
+ FX_Free(pGlyphAndPos);
+ pGlyphAndPos = NULL;
+ }
+ CPDF_GraphicStates* pStates = CloneObjStates(textobj, FALSE);
+ CPDF_RenderOptions Options = m_Options;
+ Options.m_Flags |= RENDER_FORCE_HALFTONE | RENDER_RECT_AA;
+ Options.m_Flags &= ~RENDER_FORCE_DOWNSAMPLE;
+ CPDF_Dictionary* pFormResource = NULL;
+ if (pType3Char->m_pForm && pType3Char->m_pForm->m_pFormDict) {
+ pFormResource = pType3Char->m_pForm->m_pFormDict->GetDict(FX_BSTRC("Resources"));
+ }
+ if (fill_alpha == 255) {
+ CPDF_RenderStatus status;
+ status.Initialize(m_Level + 1, m_pContext, m_pDevice, NULL, NULL, this, pStates, &Options,
+ pType3Char->m_pForm->m_Transparency, m_bDropObjects, pFormResource, FALSE, pType3Char, fill_argb);
+ status.m_Type3FontCache.Append(m_Type3FontCache);
+ status.m_Type3FontCache.Add(pType3Font);
+ m_pDevice->SaveState();
+ status.RenderObjectList(pType3Char->m_pForm, &matrix);
+ m_pDevice->RestoreState();
+ } else {
+ CFX_FloatRect rect_f = pType3Char->m_pForm->CalcBoundingBox();
+ rect_f.Transform(&matrix);
+ FX_RECT rect = rect_f.GetOutterRect();
+ CFX_FxgeDevice bitmap_device;
+ if (!bitmap_device.Create((int)(rect.Width() * sa), (int)(rect.Height() * sd), FXDIB_Argb)) {
+ return TRUE;
+ }
+ bitmap_device.GetBitmap()->Clear(0);
+ CPDF_RenderStatus status;
+ status.Initialize(m_Level + 1, m_pContext, &bitmap_device, NULL, NULL, this, pStates, &Options,
+ pType3Char->m_pForm->m_Transparency, m_bDropObjects, pFormResource, FALSE, pType3Char, fill_argb);
+ status.m_Type3FontCache.Append(m_Type3FontCache);
+ status.m_Type3FontCache.Add(pType3Font);
+ matrix.TranslateI(-rect.left, -rect.top);
+ matrix.Scale(sa, sd);
+ status.RenderObjectList(pType3Char->m_pForm, &matrix);
+ m_pDevice->SetDIBits(bitmap_device.GetBitmap(), rect.left, rect.top);
+ }
+ delete pStates;
+ } else if (pType3Char->m_pBitmap) {
+ if (device_class == FXDC_DISPLAY) {
+ CPDF_Type3Cache* pCache = GetCachedType3(pType3Font);
+ refTypeCache.m_dwCount++;
+ CFX_GlyphBitmap* pBitmap = pCache->LoadGlyph(charcode, &matrix, sa, sd);
+ if (pBitmap == NULL) {
+ continue;
+ }
+ int origin_x = FXSYS_round(matrix.e);
+ int origin_y = FXSYS_round(matrix.f);
+ if (pGlyphAndPos) {
+ pGlyphAndPos[iChar].m_pGlyph = pBitmap;
+ pGlyphAndPos[iChar].m_OriginX = origin_x;
+ pGlyphAndPos[iChar].m_OriginY = origin_y;
+ } else {
+ m_pDevice->SetBitMask(&pBitmap->m_Bitmap, origin_x + pBitmap->m_Left, origin_y - pBitmap->m_Top, fill_argb);
+ }
+ } else {
+ CFX_AffineMatrix image_matrix = pType3Char->m_ImageMatrix;
+ image_matrix.Concat(matrix);
+ CPDF_ImageRenderer renderer;
+ if (renderer.Start(this, pType3Char->m_pBitmap, fill_argb, 255, &image_matrix, 0, FALSE)) {
+ renderer.Continue(NULL);
+ }
+ if (!renderer.m_Result) {
+ return FALSE;
+ }
+ }
+ }
+ }
+ if (pGlyphAndPos) {
+ FX_RECT rect = FXGE_GetGlyphsBBox(pGlyphAndPos, textobj->m_nChars, 0, sa, sd);
+ CFX_DIBitmap bitmap;
+ if (!bitmap.Create((int)(rect.Width() * sa), (int)(rect.Height() * sd), FXDIB_8bppMask)) {
+ FX_Free(pGlyphAndPos);
+ return TRUE;
+ }
+ bitmap.Clear(0);
+ for (int iChar = 0; iChar < textobj->m_nChars; iChar ++) {
+ FXTEXT_GLYPHPOS& glyph = pGlyphAndPos[iChar];
+ if (glyph.m_pGlyph == NULL) {
+ continue;
+ }
+ bitmap.TransferBitmap((int)((glyph.m_OriginX + glyph.m_pGlyph->m_Left - rect.left) * sa),
+ (int)((glyph.m_OriginY - glyph.m_pGlyph->m_Top - rect.top) * sd),
+ glyph.m_pGlyph->m_Bitmap.GetWidth(), glyph.m_pGlyph->m_Bitmap.GetHeight(),
+ &glyph.m_pGlyph->m_Bitmap, 0, 0);
+ }
+ m_pDevice->SetBitMask(&bitmap, rect.left, rect.top, fill_argb);
+ FX_Free(pGlyphAndPos);
+ }
+ return TRUE;
+}
+class CPDF_CharPosList
+{
+public:
+ CPDF_CharPosList();
+ ~CPDF_CharPosList();
+ void Load(int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pCharPos, CPDF_Font* pFont, FX_FLOAT font_size);
+ FXTEXT_CHARPOS* m_pCharPos;
+ FX_DWORD m_nChars;
+};
+FX_FLOAT _CIDTransformToFloat(FX_BYTE ch);
+CPDF_CharPosList::CPDF_CharPosList()
+{
+ m_pCharPos = NULL;
+}
+CPDF_CharPosList::~CPDF_CharPosList()
+{
+ if (m_pCharPos) {
+ FX_Free(m_pCharPos);
+ }
+}
+void CPDF_CharPosList::Load(int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pCharPos, CPDF_Font* pFont,
+ FX_FLOAT FontSize)
+{
+ m_pCharPos = FX_Alloc(FXTEXT_CHARPOS, nChars);
+ FXSYS_memset32(m_pCharPos, 0, sizeof(FXTEXT_CHARPOS) * nChars);
+ m_nChars = 0;
+ CPDF_CIDFont* pCIDFont = pFont->GetCIDFont();
+ FX_BOOL bVertWriting = pCIDFont && pCIDFont->IsVertWriting();
+ for (int iChar = 0; iChar < nChars; iChar ++) {
+ FX_DWORD CharCode = nChars == 1 ? (FX_DWORD)(FX_UINTPTR)pCharCodes : pCharCodes[iChar];
+ if (CharCode == (FX_DWORD) - 1) {
+ continue;
+ }
+ FX_BOOL bVert = FALSE;
+ FXTEXT_CHARPOS& charpos = m_pCharPos[m_nChars++];
+ if (pCIDFont) {
+ charpos.m_bFontStyle = pCIDFont->IsFontStyleFromCharCode(CharCode);
+ }
+ charpos.m_GlyphIndex = pFont->GlyphFromCharCode(CharCode, &bVert);
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
+ charpos.m_ExtGID = pFont->GlyphFromCharCodeExt(CharCode);
+#endif
+ if (!pFont->IsEmbedded() && pFont->GetFontType() != PDFFONT_CIDFONT) {
+ charpos.m_FontCharWidth = pFont->GetCharWidthF(CharCode);
+ } else {
+ charpos.m_FontCharWidth = 0;
+ }
+ charpos.m_OriginX = iChar ? pCharPos[iChar - 1] : 0;
+ charpos.m_OriginY = 0;
+ charpos.m_bGlyphAdjust = FALSE;
+ if (pCIDFont == NULL) {
+ continue;
+ }
+ FX_WORD CID = pCIDFont->CIDFromCharCode(CharCode);
+ if (bVertWriting) {
+ charpos.m_OriginY = charpos.m_OriginX;
+ charpos.m_OriginX = 0;
+ short vx, vy;
+ pCIDFont->GetVertOrigin(CID, vx, vy);
+ charpos.m_OriginX -= FontSize * vx / 1000;
+ charpos.m_OriginY -= FontSize * vy / 1000;
+ }
+ FX_LPCBYTE pTransform = pCIDFont->GetCIDTransform(CID);
+ if (pTransform && !bVert) {
+ charpos.m_AdjustMatrix[0] = _CIDTransformToFloat(pTransform[0]);
+ charpos.m_AdjustMatrix[2] = _CIDTransformToFloat(pTransform[2]);
+ charpos.m_AdjustMatrix[1] = _CIDTransformToFloat(pTransform[1]);
+ charpos.m_AdjustMatrix[3] = _CIDTransformToFloat(pTransform[3]);
+ charpos.m_OriginX += _CIDTransformToFloat(pTransform[4]) * FontSize;
+ charpos.m_OriginY += _CIDTransformToFloat(pTransform[5]) * FontSize;
+ charpos.m_bGlyphAdjust = TRUE;
+ }
+ }
+}
+FX_BOOL CPDF_TextRenderer::DrawTextPath(CFX_RenderDevice* pDevice, int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pCharPos,
+ CPDF_Font* pFont, FX_FLOAT font_size,
+ const CFX_AffineMatrix* pText2User, const CFX_AffineMatrix* pUser2Device,
+ const CFX_GraphStateData* pGraphState,
+ FX_ARGB fill_argb, FX_ARGB stroke_argb, CFX_PathData* pClippingPath, int nFlag)
+{
+ CFX_FontCache* pCache = pFont->m_pDocument ? pFont->m_pDocument->GetRenderData()->GetFontCache() : NULL;
+ CPDF_CharPosList CharPosList;
+ CharPosList.Load(nChars, pCharCodes, pCharPos, pFont, font_size);
+ return pDevice->DrawTextPath(CharPosList.m_nChars, CharPosList.m_pCharPos,
+ &pFont->m_Font, pCache, font_size, pText2User, pUser2Device,
+ pGraphState, fill_argb, stroke_argb, pClippingPath, nFlag);
+}
+void CPDF_TextRenderer::DrawTextString(CFX_RenderDevice* pDevice, int left, int top, CPDF_Font* pFont, int height,
+ const CFX_ByteString& str, FX_ARGB argb)
+{
+ FX_RECT font_bbox;
+ pFont->GetFontBBox(font_bbox);
+ FX_FLOAT font_size = (FX_FLOAT)height * 1000.0f / (FX_FLOAT)(font_bbox.top - font_bbox.bottom);
+ FX_FLOAT origin_x = (FX_FLOAT)left;
+ FX_FLOAT origin_y = (FX_FLOAT)top + font_size * (FX_FLOAT)font_bbox.top / 1000.0f;
+ CFX_AffineMatrix matrix(1.0f, 0, 0, -1.0f, 0, 0);
+ DrawTextString(pDevice, origin_x, origin_y, pFont, font_size, &matrix, str, argb);
+}
+void CPDF_TextRenderer::DrawTextString(CFX_RenderDevice* pDevice, FX_FLOAT origin_x, FX_FLOAT origin_y, CPDF_Font* pFont, FX_FLOAT font_size,
+ const CFX_AffineMatrix* pMatrix, const CFX_ByteString& str, FX_ARGB fill_argb,
+ FX_ARGB stroke_argb, const CFX_GraphStateData* pGraphState, const CPDF_RenderOptions* pOptions)
+{
+ int nChars = pFont->CountChar(str, str.GetLength());
+ if (nChars == 0) {
+ return;
+ }
+ FX_DWORD charcode;
+ int offset = 0;
+ FX_DWORD* pCharCodes;
+ FX_FLOAT* pCharPos;
+ if (nChars == 1) {
+ charcode = pFont->GetNextChar(str, offset);
+ pCharCodes = (FX_DWORD*)(FX_UINTPTR)charcode;
+ pCharPos = NULL;
+ } else {
+ pCharCodes = FX_Alloc(FX_DWORD, nChars);
+ pCharPos = FX_Alloc(FX_FLOAT, nChars - 1);
+ FX_FLOAT cur_pos = 0;
+ for (int i = 0; i < nChars; i ++) {
+ pCharCodes[i] = pFont->GetNextChar(str, offset);
+ if (i) {
+ pCharPos[i - 1] = cur_pos;
+ }
+ cur_pos += pFont->GetCharWidthF(pCharCodes[i]) * font_size / 1000;
+ }
+ }
+ CFX_AffineMatrix matrix;
+ if (pMatrix) {
+ matrix = *pMatrix;
+ }
+ matrix.e = origin_x;
+ matrix.f = origin_y;
+ if (pFont->GetFontType() == PDFFONT_TYPE3)
+ ;
+ else if (stroke_argb == 0) {
+ DrawNormalText(pDevice, nChars, pCharCodes, pCharPos, pFont, font_size, &matrix, fill_argb, pOptions);
+ } else
+ DrawTextPath(pDevice, nChars, pCharCodes, pCharPos, pFont, font_size, &matrix, NULL, pGraphState,
+ fill_argb, stroke_argb, NULL);
+ if (nChars > 1) {
+ FX_Free(pCharCodes);
+ FX_Free(pCharPos);
+ }
+}
+FX_BOOL CPDF_TextRenderer::DrawNormalText(CFX_RenderDevice* pDevice, int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pCharPos,
+ CPDF_Font* pFont, FX_FLOAT font_size,
+ const CFX_AffineMatrix* pText2Device,
+ FX_ARGB fill_argb, const CPDF_RenderOptions* pOptions)
+{
+ CFX_FontCache* pCache = pFont->m_pDocument ? pFont->m_pDocument->GetRenderData()->GetFontCache() : NULL;
+ CPDF_CharPosList CharPosList;
+ CharPosList.Load(nChars, pCharCodes, pCharPos, pFont, font_size);
+ int FXGE_flags = 0;
+ if (pOptions) {
+ FX_DWORD dwFlags = pOptions->m_Flags;
+ if (dwFlags & RENDER_CLEARTYPE) {
+ FXGE_flags |= FXTEXT_CLEARTYPE;
+ if (dwFlags & RENDER_BGR_STRIPE) {
+ FXGE_flags |= FXTEXT_BGR_STRIPE;
+ }
+ }
+ if (dwFlags & RENDER_NOTEXTSMOOTH) {
+ FXGE_flags |= FXTEXT_NOSMOOTH;
+ }
+ if (dwFlags & RENDER_PRINTGRAPHICTEXT) {
+ FXGE_flags |= FXTEXT_PRINTGRAPHICTEXT;
+ }
+ if (dwFlags & RENDER_NO_NATIVETEXT) {
+ FXGE_flags |= FXTEXT_NO_NATIVETEXT;
+ }
+ if (dwFlags & RENDER_PRINTIMAGETEXT) {
+ FXGE_flags |= FXTEXT_PRINTIMAGETEXT;
+ }
+ } else {
+ FXGE_flags = FXTEXT_CLEARTYPE;
+ }
+ if (pFont->GetFontType() & PDFFONT_CIDFONT) {
+ FXGE_flags |= FXFONT_CIDFONT;
+ }
+ return pDevice->DrawNormalText(CharPosList.m_nChars, CharPosList.m_pCharPos, &pFont->m_Font, pCache, font_size, pText2Device, fill_argb, FXGE_flags);
+}
+void CPDF_RenderStatus::DrawTextPathWithPattern(const CPDF_TextObject* textobj, const CFX_AffineMatrix* pObj2Device,
+ CPDF_Font* pFont, FX_FLOAT font_size,
+ const CFX_AffineMatrix* pTextMatrix, FX_BOOL bFill, FX_BOOL bStroke)
+{
+ if (!bStroke) {
+ CPDF_PathObject path;
+ CPDF_TextObject* pCopy = FX_NEW CPDF_TextObject;
+ pCopy->Copy(textobj);
+ path.m_bStroke = FALSE;
+ path.m_FillType = FXFILL_WINDING;
+ path.m_ClipPath.AppendTexts(&pCopy, 1);
+ path.m_ColorState = textobj->m_ColorState;
+ path.m_Path.New()->AppendRect(textobj->m_Left, textobj->m_Bottom, textobj->m_Right, textobj->m_Top);
+ path.m_Left = textobj->m_Left;
+ path.m_Bottom = textobj->m_Bottom;
+ path.m_Right = textobj->m_Right;
+ path.m_Top = textobj->m_Top;
+ RenderSingleObject(&path, pObj2Device);
+ return;
+ }
+ CFX_FontCache* pCache;
+ if (pFont->m_pDocument) {
+ pCache = pFont->m_pDocument->GetRenderData()->GetFontCache();
+ } else {
+ pCache = CFX_GEModule::Get()->GetFontCache();
+ }
+ CFX_FaceCache* pFaceCache = pCache->GetCachedFace(&pFont->m_Font);
+ FX_FONTCACHE_DEFINE(pCache, &pFont->m_Font);
+ CPDF_CharPosList CharPosList;
+ CharPosList.Load(textobj->m_nChars, textobj->m_pCharCodes, textobj->m_pCharPos, pFont, font_size);
+ for (FX_DWORD i = 0; i < CharPosList.m_nChars; i ++) {
+ FXTEXT_CHARPOS& charpos = CharPosList.m_pCharPos[i];
+ const CFX_PathData* pPath = pFaceCache->LoadGlyphPath(&pFont->m_Font, charpos.m_GlyphIndex,
+ charpos.m_FontCharWidth);
+ if (pPath == NULL) {
+ continue;
+ }
+ CPDF_PathObject path;
+ path.m_GraphState = textobj->m_GraphState;
+ path.m_ColorState = textobj->m_ColorState;
+ CFX_AffineMatrix matrix;
+ if (charpos.m_bGlyphAdjust)
+ matrix.Set(charpos.m_AdjustMatrix[0], charpos.m_AdjustMatrix[1],
+ charpos.m_AdjustMatrix[2], charpos.m_AdjustMatrix[3], 0, 0);
+ matrix.Concat(font_size, 0, 0, font_size, charpos.m_OriginX, charpos.m_OriginY);
+ path.m_Path.New()->Append(pPath, &matrix);
+ path.m_Matrix = *pTextMatrix;
+ path.m_bStroke = bStroke;
+ path.m_FillType = bFill ? FXFILL_WINDING : 0;
+ path.CalcBoundingBox();
+ ProcessPath(&path, pObj2Device);
+ }
+}
+CFX_PathData* CPDF_Font::LoadGlyphPath(FX_DWORD charcode, int dest_width)
+{
+ int glyph_index = GlyphFromCharCode(charcode);
+ if (m_Font.m_Face == NULL) {
+ return NULL;
+ }
+ return m_Font.LoadGlyphPath(glyph_index, dest_width);
+}
diff --git a/core/src/fpdfapi/fpdf_render/render_int.h b/core/src/fpdfapi/fpdf_render/render_int.h
index 3acde0ec43..9bde4be877 100644
--- a/core/src/fpdfapi/fpdf_render/render_int.h
+++ b/core/src/fpdfapi/fpdf_render/render_int.h
@@ -1,462 +1,462 @@
-// 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 _FPDF_PAGEOBJ_H_
-#include "../../../include/fpdfapi/fpdf_pageobj.h"
-#endif
-class CPDF_QuickStretcher;
-#define TYPE3_MAX_BLUES 16
-class CPDF_Type3Glyphs : public CFX_Object
-{
-public:
- CPDF_Type3Glyphs()
- {
- m_GlyphMap.InitHashTable(253);
- m_TopBlueCount = m_BottomBlueCount = 0;
- }
- ~CPDF_Type3Glyphs();
- CFX_MapPtrToPtr m_GlyphMap;
- void AdjustBlue(FX_FLOAT top, FX_FLOAT bottom, int& top_line, int& bottom_line);
-
- int m_TopBlue[TYPE3_MAX_BLUES], m_BottomBlue[TYPE3_MAX_BLUES];
- int m_TopBlueCount, m_BottomBlueCount;
-};
-class CFX_GlyphBitmap;
-class CPDF_Type3Cache : public CFX_Object
-{
-public:
- CPDF_Type3Cache(CPDF_Type3Font* pFont)
- {
- m_pFont = pFont;
- }
- ~CPDF_Type3Cache();
- CFX_GlyphBitmap* LoadGlyph(FX_DWORD charcode, const CFX_AffineMatrix* pMatrix, FX_FLOAT retinaScaleX = 1.0f, FX_FLOAT retinaScaleY = 1.0f);
-protected:
- CFX_GlyphBitmap* RenderGlyph(CPDF_Type3Glyphs* pSize, FX_DWORD charcode, const CFX_AffineMatrix* pMatrix, FX_FLOAT retinaScaleX = 1.0f, FX_FLOAT retinaScaleY = 1.0f);
- CPDF_Type3Font* m_pFont;
- CFX_MapByteStringToPtr m_SizeMap;
-};
-class CPDF_TransferFunc : public CFX_Object
-{
-public:
- CPDF_Document* m_pPDFDoc;
- FX_BYTE m_Samples[256 * 3];
- FX_BOOL m_bIdentity;
-
- CFX_DIBSource* TranslateImage(const CFX_DIBSource* pSrc, FX_BOOL bAutoDropSrc);
- FX_COLORREF TranslateColor(FX_COLORREF src);
-};
-typedef CFX_MapPtrTemplate<CPDF_Font*, CPDF_CountedObject<CPDF_Type3Cache*>*> CPDF_Type3CacheMap;
-typedef CFX_MapPtrTemplate<CPDF_Object*, CPDF_CountedObject<CPDF_TransferFunc*>*> CPDF_TransferFuncMap;
-class CPDF_DocRenderData : public CFX_Object
-{
-public:
- CPDF_DocRenderData(CPDF_Document* pPDFDoc = NULL);
- ~CPDF_DocRenderData();
- FX_BOOL Initialize();
- CPDF_Type3Cache* GetCachedType3(CPDF_Type3Font* pFont);
- CPDF_TransferFunc* GetTransferFunc(CPDF_Object* pObj);
- CFX_FontCache* GetFontCache()
- {
- return m_pFontCache;
- }
- void Clear(FX_BOOL bRelease = FALSE);
- void ReleaseCachedType3(CPDF_Type3Font* pFont);
- void ReleaseTransferFunc(CPDF_Object* pObj);
-private:
- CPDF_Document* m_pPDFDoc;
- CFX_FontCache* m_pFontCache;
- CPDF_Type3CacheMap m_Type3FaceMap;
- CPDF_TransferFuncMap m_TransferFuncMap;
-};
-struct _PDF_RenderItem {
-public:
- CPDF_PageObjects* m_pObjectList;
- CFX_AffineMatrix m_Matrix;
-};
-typedef CFX_ArrayTemplate<_PDF_RenderItem> CPDF_RenderLayer;
-class IPDF_ObjectRenderer : public CFX_Object
-{
-public:
- static IPDF_ObjectRenderer* Create(int type);
- virtual ~IPDF_ObjectRenderer() {}
- virtual FX_BOOL Start(CPDF_RenderStatus* pRenderStatus, const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device, FX_BOOL bStdCS, int blendType = FXDIB_BLEND_NORMAL) = 0;
- virtual FX_BOOL Continue(IFX_Pause* pPause) = 0;
- FX_BOOL m_Result;
-};
-class CPDF_RenderStatus : public CFX_Object
-{
-public:
- CPDF_RenderStatus();
- ~CPDF_RenderStatus();
- FX_BOOL Initialize(int level, class CPDF_RenderContext* pContext, CFX_RenderDevice* pDevice, const CFX_AffineMatrix* pDeviceMatrix,
- const CPDF_PageObject* pStopObj, const CPDF_RenderStatus* pParentStatus,
- const CPDF_GraphicStates* pInitialStates, const CPDF_RenderOptions* pOptions,
- int transparency, FX_BOOL bDropObjects, CPDF_Dictionary* pFormResource = NULL,
- FX_BOOL bStdCS = FALSE, CPDF_Type3Char* pType3Char = NULL, FX_ARGB fill_color = 0,
- FX_DWORD GroupFamily = 0, FX_BOOL bLoadMask = FALSE);
- void RenderObjectList(const CPDF_PageObjects* pObjs, const CFX_AffineMatrix* pObj2Device);
- void RenderSingleObject(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device);
- FX_BOOL ContinueSingleObject(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device, IFX_Pause* pPause);
- CPDF_RenderOptions m_Options;
- CPDF_Dictionary* m_pFormResource;
- CPDF_Dictionary* m_pPageResource;
- CFX_PtrArray m_Type3FontCache;
- CPDF_RenderContext* GetContext()
- {
- return m_pContext;
- }
-protected:
- friend class CPDF_ImageRenderer;
- friend class CPDF_RenderContext;
- void ProcessClipPath(CPDF_ClipPath ClipPath, const CFX_AffineMatrix* pObj2Device);
- void DrawClipPath(CPDF_ClipPath ClipPath, const CFX_AffineMatrix* pObj2Device);
- FX_BOOL ProcessTransparency(const CPDF_PageObject* PageObj, const CFX_AffineMatrix* pObj2Device);
- void ProcessObjectNoClip(const CPDF_PageObject* PageObj, const CFX_AffineMatrix* pObj2Device);
- void DrawObjWithBackground(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device);
- FX_BOOL DrawObjWithBlend(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device);
- FX_BOOL ProcessPath(CPDF_PathObject* pPathObj, const CFX_AffineMatrix* pObj2Device);
- void ProcessPathPattern(CPDF_PathObject* pPathObj, const CFX_AffineMatrix* pObj2Device, int& filltype, FX_BOOL& bStroke);
- void DrawPathWithPattern(CPDF_PathObject* pPathObj, const CFX_AffineMatrix* pObj2Device, CPDF_Color* pColor, FX_BOOL bStroke);
- void DrawTilingPattern(CPDF_TilingPattern* pPattern, CPDF_PageObject* pPageObj, const CFX_AffineMatrix* pObj2Device, FX_BOOL bStroke);
- void DrawShadingPattern(CPDF_ShadingPattern* pPattern, CPDF_PageObject* pPageObj, const CFX_AffineMatrix* pObj2Device, FX_BOOL bStroke);
- FX_BOOL SelectClipPath(CPDF_PathObject* pPathObj, const CFX_AffineMatrix* pObj2Device, FX_BOOL bStroke);
- FX_BOOL ProcessImage(CPDF_ImageObject* pImageObj, const CFX_AffineMatrix* pObj2Device);
- FX_BOOL OutputBitmapAlpha(CPDF_ImageObject* pImageObj, const CFX_AffineMatrix* pImage2Device);
- FX_BOOL OutputImage(CPDF_ImageObject* pImageObj, const CFX_AffineMatrix* pImage2Device);
- FX_BOOL OutputDIBSource(const CFX_DIBSource* pOutputBitmap, FX_ARGB fill_argb, int bitmap_alpha,
- const CFX_AffineMatrix* pImage2Device, CPDF_ImageCache* pImageCache, FX_DWORD flags);
- void CompositeDIBitmap(CFX_DIBitmap* pDIBitmap, int left, int top, FX_ARGB mask_argb,
- int bitmap_alpha, int blend_mode, int bIsolated);
- FX_BOOL ProcessInlines(CPDF_InlineImages* pInlines, const CFX_AffineMatrix* pObj2Device);
- FX_BOOL ProcessShading(CPDF_ShadingObject* pShadingObj, const CFX_AffineMatrix* pObj2Device);
- void DrawShading(CPDF_ShadingPattern* pPattern, CFX_AffineMatrix* pMatrix, FX_RECT& clip_rect,
- int alpha, FX_BOOL bAlphaMode);
- FX_BOOL ProcessType3Text(const CPDF_TextObject* textobj, const CFX_AffineMatrix* pObj2Device);
- FX_BOOL ProcessText(const CPDF_TextObject* textobj, const CFX_AffineMatrix* pObj2Device, CFX_PathData* pClippingPath);
- void DrawTextPathWithPattern(const CPDF_TextObject* textobj, const CFX_AffineMatrix* pObj2Device,
- CPDF_Font* pFont, FX_FLOAT font_size,
- const CFX_AffineMatrix* pTextMatrix, FX_BOOL bFill, FX_BOOL bStroke);
- FX_BOOL ProcessForm(CPDF_FormObject* pFormObj, const CFX_AffineMatrix* pObj2Device);
- CFX_DIBitmap* GetBackdrop(const CPDF_PageObject* pObj, const FX_RECT& rect, int& left, int& top,
- FX_BOOL bBackAlphaRequired);
- CFX_DIBitmap* LoadSMask(CPDF_Dictionary* pSMaskDict, FX_RECT* pClipRect, const CFX_AffineMatrix* pMatrix);
- void Init(CPDF_RenderContext* pParent);
- static class CPDF_Type3Cache* GetCachedType3(CPDF_Type3Font* pFont);
- static CPDF_GraphicStates* CloneObjStates(const CPDF_GraphicStates* pPathObj, FX_BOOL bStroke);
- CPDF_TransferFunc* GetTransferFunc(CPDF_Object* pObject) const;
- FX_ARGB GetFillArgb(const CPDF_PageObject* pObj, FX_BOOL bType3 = FALSE) const;
- FX_ARGB GetStrokeArgb(const CPDF_PageObject* pObj) const;
- CPDF_RenderContext* m_pContext;
- FX_BOOL m_bStopped;
- void DitherObjectArea(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device);
- FX_BOOL GetObjectClippedRect(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device, FX_BOOL bLogical, FX_RECT &rect) const;
- void GetScaledMatrix(CFX_Matrix &matrix) const;
-protected:
- int m_Level;
- CFX_RenderDevice* m_pDevice;
- CFX_AffineMatrix m_DeviceMatrix;
- CPDF_ClipPath m_LastClipPath;
- const CPDF_PageObject* m_pCurObj;
- const CPDF_PageObject* m_pStopObj;
- CPDF_GraphicStates m_InitialStates;
- int m_HalftoneLimit;
- IPDF_ObjectRenderer* m_pObjectRenderer;
- FX_BOOL m_bPrint;
- int m_Transparency;
- int m_DitherBits;
- FX_BOOL m_bDropObjects;
- FX_BOOL m_bStdCS;
- FX_DWORD m_GroupFamily;
- FX_BOOL m_bLoadMask;
- CPDF_Type3Char * m_pType3Char;
- FX_ARGB m_T3FillColor;
- int m_curBlend;
-};
-class CPDF_ImageLoader : public CFX_Object
-{
-public:
- CPDF_ImageLoader()
- {
- m_pBitmap = NULL;
- m_pMask = NULL;
- m_MatteColor = 0;
- m_bCached = FALSE;
- m_nDownsampleWidth = 0;
- m_nDownsampleHeight = 0;
- }
-
- FX_BOOL Load(const CPDF_ImageObject* pImage, CPDF_PageRenderCache* pCache, FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0, FX_BOOL bLoadMask = FALSE, CPDF_RenderStatus* pRenderStatus = NULL);
-
- FX_BOOL StartLoadImage(const CPDF_ImageObject* pImage, CPDF_PageRenderCache* pCache, FX_LPVOID& LoadHandle, FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0, FX_BOOL bLoadMask = FALSE, CPDF_RenderStatus* pRenderStatus = NULL, FX_INT32 nDownsampleWidth = 0, FX_INT32 nDownsampleHeight = 0);
- FX_BOOL Continue(FX_LPVOID LoadHandle, IFX_Pause* pPause);
- ~CPDF_ImageLoader();
- CFX_DIBSource* m_pBitmap;
- CFX_DIBSource* m_pMask;
- FX_DWORD m_MatteColor;
- FX_BOOL m_bCached;
-protected:
- FX_INT32 m_nDownsampleWidth;
- FX_INT32 m_nDownsampleHeight;
-};
-class CPDF_ProgressiveImageLoaderHandle : public CFX_Object
-{
-public:
- CPDF_ProgressiveImageLoaderHandle();
- ~CPDF_ProgressiveImageLoaderHandle();
-
- FX_BOOL Start(CPDF_ImageLoader* pImageLoader, const CPDF_ImageObject* pImage, CPDF_PageRenderCache* pCache, FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0, FX_BOOL bLoadMask = FALSE, CPDF_RenderStatus* pRenderStatus = NULL, FX_INT32 nDownsampleWidth = 0, FX_INT32 nDownsampleHeight = 0);
- FX_BOOL Continue(IFX_Pause* pPause);
-protected:
- CPDF_ImageLoader* m_pImageLoader;
- CPDF_PageRenderCache* m_pCache;
- CPDF_ImageObject* m_pImage;
- FX_INT32 m_nDownsampleWidth;
- FX_INT32 m_nDownsampleHeight;
-};
-class CFX_ImageTransformer;
-class CPDF_ImageRenderer : public IPDF_ObjectRenderer
-{
-public:
- CPDF_ImageRenderer();
- ~CPDF_ImageRenderer();
- FX_BOOL Start(CPDF_RenderStatus* pStatus, const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device, FX_BOOL bStdCS, int blendType = FXDIB_BLEND_NORMAL);
- FX_BOOL Start(CPDF_RenderStatus* pStatus, const CFX_DIBSource* pDIBSource, FX_ARGB bitmap_argb,
- int bitmap_alpha, const CFX_AffineMatrix* pImage2Device, FX_DWORD flags, FX_BOOL bStdCS, int blendType = FXDIB_BLEND_NORMAL);
- FX_BOOL Continue(IFX_Pause* pPause);
-protected:
- CPDF_RenderStatus* m_pRenderStatus;
- CPDF_ImageObject* m_pImageObject;
- int m_Status;
- const CFX_AffineMatrix* m_pObj2Device;
- CFX_AffineMatrix m_ImageMatrix;
- CPDF_ImageLoader m_Loader;
- const CFX_DIBSource* m_pDIBSource;
- CFX_DIBitmap* m_pClone;
- int m_BitmapAlpha;
- FX_BOOL m_bPatternColor;
- CPDF_Pattern* m_pPattern;
- FX_ARGB m_FillArgb;
- FX_DWORD m_Flags;
- CPDF_QuickStretcher* m_pQuickStretcher;
- CFX_ImageTransformer* m_pTransformer;
- CPDF_ImageRenderer* m_pRenderer2;
- FX_LPVOID m_DeviceHandle;
- FX_LPVOID m_LoadHandle;
- FX_BOOL m_bStdCS;
- int m_BlendType;
- FX_BOOL StartBitmapAlpha();
- FX_BOOL StartDIBSource();
- FX_BOOL StartRenderDIBSource();
- FX_BOOL StartLoadDIBSource();
- FX_BOOL DrawMaskedImage();
- FX_BOOL DrawPatternImage(const CFX_Matrix* pObj2Device);
-};
-class CPDF_ScaledRenderBuffer : public CFX_Object
-{
-public:
- CPDF_ScaledRenderBuffer();
- ~CPDF_ScaledRenderBuffer();
- FX_BOOL Initialize(CPDF_RenderContext* pContext, CFX_RenderDevice* pDevice, FX_RECT* pRect,
- const CPDF_PageObject* pObj, const CPDF_RenderOptions *pOptions = NULL, int max_dpi = 0);
- CFX_RenderDevice* GetDevice()
- {
- return m_pBitmapDevice ? m_pBitmapDevice : m_pDevice;
- }
- CFX_AffineMatrix* GetMatrix()
- {
- return &m_Matrix;
- }
- void OutputToDevice();
-private:
- CFX_RenderDevice* m_pDevice;
- CPDF_RenderContext* m_pContext;
- FX_RECT m_Rect;
- const CPDF_PageObject* m_pObject;
- CFX_FxgeDevice* m_pBitmapDevice;
- CFX_AffineMatrix m_Matrix;
-};
-class ICodec_ScanlineDecoder;
-class CPDF_QuickStretcher : public CFX_Object
-{
-public:
- CPDF_QuickStretcher();
- ~CPDF_QuickStretcher();
- FX_BOOL Start(CPDF_ImageObject* pImageObj, CFX_AffineMatrix* pImage2Device, const FX_RECT* pClipBox);
- FX_BOOL Continue(IFX_Pause* pPause);
- CFX_DIBitmap* m_pBitmap;
- int m_ResultLeft, m_ResultTop, m_ClipLeft, m_ClipTop;
- int m_DestWidth, m_DestHeight, m_ResultWidth, m_ResultHeight;
- int m_Bpp, m_SrcWidth, m_SrcHeight;
- FX_BOOL m_bFlipX, m_bFlipY;
- CPDF_ColorSpace* m_pCS;
- ICodec_ScanlineDecoder* m_pDecoder;
- CPDF_StreamAcc m_StreamAcc;
- int m_LineIndex;
-};
-class CPDF_DeviceBuffer : public CFX_Object
-{
-public:
- CPDF_DeviceBuffer();
- ~CPDF_DeviceBuffer();
- FX_BOOL Initialize(CPDF_RenderContext* pContext, CFX_RenderDevice* pDevice, FX_RECT* pRect,
- const CPDF_PageObject* pObj, int max_dpi = 0);
- void OutputToDevice();
- CFX_DIBitmap* GetBitmap() const
- {
- return m_pBitmap;
- }
- const CFX_AffineMatrix* GetMatrix() const
- {
- return &m_Matrix;
- }
-private:
- CFX_RenderDevice* m_pDevice;
- CPDF_RenderContext* m_pContext;
- FX_RECT m_Rect;
- const CPDF_PageObject* m_pObject;
- CFX_DIBitmap* m_pBitmap;
- CFX_AffineMatrix m_Matrix;
-};
-class CPDF_ImageCache : public CFX_Object
-{
-public:
- CPDF_ImageCache(CPDF_Document* pDoc, CPDF_Stream* pStream);
- ~CPDF_ImageCache();
- void ClearImageData();
- void Reset(const CFX_DIBitmap* pBitmap);
- FX_BOOL GetCachedBitmap(CFX_DIBSource*& pBitmap, CFX_DIBSource*& pMask, FX_DWORD& MatteColor, CPDF_Dictionary* pPageResources,
- FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0, FX_BOOL bLoadMask = FALSE,
- CPDF_RenderStatus* pRenderStatus = NULL, FX_INT32 downsampleWidth = 0, FX_INT32 downsampleHeight = 0);
- FX_DWORD EstimateSize() const
- {
- return m_dwCacheSize;
- }
- FX_DWORD GetTimeCount() const
- {
- return m_dwTimeCount;
- }
- CPDF_Stream* GetStream() const
- {
- return m_pStream;
- }
- void SetTimeCount(FX_DWORD dwTimeCount)
- {
- m_dwTimeCount = dwTimeCount;
- }
- int m_dwTimeCount;
-public:
- int StartGetCachedBitmap(CPDF_Dictionary* pFormResources, CPDF_Dictionary* pPageResources,
- FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0,
- FX_BOOL bLoadMask = FALSE, CPDF_RenderStatus* pRenderStatus = NULL, FX_INT32 downsampleWidth = 0, FX_INT32 downsampleHeight = 0);
- int Continue(IFX_Pause* pPause);
- int ContinueGetCachedBitmap();
- CFX_DIBSource* DetachBitmap();
- CFX_DIBSource* DetachMask();
- CFX_DIBSource* m_pCurBitmap;
- CFX_DIBSource* m_pCurMask;
- FX_DWORD m_MatteColor;
- CPDF_RenderStatus* m_pRenderStatus;
-protected:
- CPDF_Document* m_pDocument;
- CPDF_Stream* m_pStream;
- CFX_DIBSource* m_pCachedBitmap;
- CFX_DIBSource* m_pCachedMask;
- FX_DWORD m_dwCacheSize;
- void CalcSize();
-};
-typedef struct {
- FX_FLOAT m_DecodeMin;
- FX_FLOAT m_DecodeStep;
- int m_ColorKeyMin;
- int m_ColorKeyMax;
-} DIB_COMP_DATA;
-class CPDF_DIBSource : public CFX_DIBSource
-{
-public:
- CPDF_DIBSource();
- virtual ~CPDF_DIBSource();
- FX_BOOL Load(CPDF_Document* pDoc, const CPDF_Stream* pStream,
- CPDF_DIBSource** ppMask, FX_DWORD* pMatteColor,
- CPDF_Dictionary* pFormResources, CPDF_Dictionary* pPageResources,
- FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0, FX_BOOL bLoadMask = FALSE);
- virtual FX_BOOL SkipToScanline(int line, IFX_Pause* pPause) const;
- virtual FX_LPBYTE GetBuffer() const;
- virtual FX_LPCBYTE GetScanline(int line) const;
- virtual void DownSampleScanline(int line, FX_LPBYTE dest_scan, int dest_bpp,
- int dest_width, FX_BOOL bFlipX, int clip_left, int clip_width) const;
- virtual void SetDownSampleSize(int dest_width, int dest_height) const;
- CFX_DIBitmap* GetBitmap() const;
- void ReleaseBitmap(CFX_DIBitmap*) const;
- void ClearImageData();
-public:
- int StartLoadDIBSource(CPDF_Document* pDoc, const CPDF_Stream* pStream, FX_BOOL bHasMask,
- CPDF_Dictionary* pFormResources, CPDF_Dictionary* pPageResources,
- FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0, FX_BOOL bLoadMask = FALSE);
- int ContinueLoadDIBSource(IFX_Pause* pPause);
- int StratLoadMask();
- int StartLoadMaskDIB();
- int ContinueLoadMaskDIB(IFX_Pause* pPause);
- int ContinueToLoadMask();
- CPDF_DIBSource* DetachMask();
- CPDF_DIBSource* m_pMask;
- FX_DWORD m_MatteColor;
- FX_LPVOID m_pJbig2Context;
- CPDF_StreamAcc* m_pGlobalStream;
- FX_BOOL m_bStdCS;
- int m_Status;
- CPDF_Object* m_pMaskStream;
- FX_BOOL m_bHasMask;
-protected:
- FX_BOOL LoadColorInfo(CPDF_Dictionary* pFormResources, CPDF_Dictionary* pPageResources);
- CPDF_DIBSource* LoadMask(FX_DWORD& MatteColor);
- CPDF_DIBSource* LoadMaskDIB(CPDF_Stream* pMask);
- void LoadJpxBitmap();
- void LoadJbig2Bitmap();
- void LoadPalette();
- FX_BOOL CreateDecoder();
- void TranslateScanline24bpp(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan) const;
- FX_DWORD GetValidBpp() const;
-
- CPDF_Document* m_pDocument;
- const CPDF_Stream* m_pStream;
- CPDF_StreamAcc* m_pStreamAcc;
- const CPDF_Dictionary* m_pDict;
- CPDF_ColorSpace* m_pColorSpace;
- FX_DWORD m_Family, m_bpc, m_nComponents, m_GroupFamily;
- FX_BOOL m_bLoadMask;
- FX_BOOL m_bDefaultDecode, m_bImageMask, m_bColorKey;
- DIB_COMP_DATA* m_pCompData;
- FX_LPBYTE m_pLineBuf;
- FX_LPBYTE m_pMaskedLine;
- CFX_DIBitmap* m_pCachedBitmap;
- ICodec_ScanlineDecoder* m_pDecoder;
-};
-#ifdef _FPDFAPI_MINI_
-#define FPDF_HUGE_IMAGE_SIZE 3000000
-#else
-#define FPDF_HUGE_IMAGE_SIZE 60000000
-#endif
-class CPDF_DIBTransferFunc : public CFX_FilteredDIB
-{
-public:
- CPDF_DIBTransferFunc(const CPDF_TransferFunc* pTransferFunc);
- virtual FXDIB_Format GetDestFormat();
- virtual FX_ARGB* GetDestPalette()
- {
- return NULL;
- }
- virtual void TranslateScanline(FX_LPBYTE dest_buf, FX_LPCBYTE src_buf) const;
- virtual void TranslateDownSamples(FX_LPBYTE dest_buf, FX_LPCBYTE src_buf, int pixels, int Bpp) const;
- FX_LPCBYTE m_RampR;
- FX_LPCBYTE m_RampG;
- FX_LPCBYTE m_RampB;
-};
-struct _CPDF_UniqueKeyGen {
- void Generate(int count, ...);
- FX_CHAR m_Key[128];
- int m_KeyLen;
-};
+// 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 _FPDF_PAGEOBJ_H_
+#include "../../../include/fpdfapi/fpdf_pageobj.h"
+#endif
+class CPDF_QuickStretcher;
+#define TYPE3_MAX_BLUES 16
+class CPDF_Type3Glyphs : public CFX_Object
+{
+public:
+ CPDF_Type3Glyphs()
+ {
+ m_GlyphMap.InitHashTable(253);
+ m_TopBlueCount = m_BottomBlueCount = 0;
+ }
+ ~CPDF_Type3Glyphs();
+ CFX_MapPtrToPtr m_GlyphMap;
+ void AdjustBlue(FX_FLOAT top, FX_FLOAT bottom, int& top_line, int& bottom_line);
+
+ int m_TopBlue[TYPE3_MAX_BLUES], m_BottomBlue[TYPE3_MAX_BLUES];
+ int m_TopBlueCount, m_BottomBlueCount;
+};
+class CFX_GlyphBitmap;
+class CPDF_Type3Cache : public CFX_Object
+{
+public:
+ CPDF_Type3Cache(CPDF_Type3Font* pFont)
+ {
+ m_pFont = pFont;
+ }
+ ~CPDF_Type3Cache();
+ CFX_GlyphBitmap* LoadGlyph(FX_DWORD charcode, const CFX_AffineMatrix* pMatrix, FX_FLOAT retinaScaleX = 1.0f, FX_FLOAT retinaScaleY = 1.0f);
+protected:
+ CFX_GlyphBitmap* RenderGlyph(CPDF_Type3Glyphs* pSize, FX_DWORD charcode, const CFX_AffineMatrix* pMatrix, FX_FLOAT retinaScaleX = 1.0f, FX_FLOAT retinaScaleY = 1.0f);
+ CPDF_Type3Font* m_pFont;
+ CFX_MapByteStringToPtr m_SizeMap;
+};
+class CPDF_TransferFunc : public CFX_Object
+{
+public:
+ CPDF_Document* m_pPDFDoc;
+ FX_BYTE m_Samples[256 * 3];
+ FX_BOOL m_bIdentity;
+
+ CFX_DIBSource* TranslateImage(const CFX_DIBSource* pSrc, FX_BOOL bAutoDropSrc);
+ FX_COLORREF TranslateColor(FX_COLORREF src);
+};
+typedef CFX_MapPtrTemplate<CPDF_Font*, CPDF_CountedObject<CPDF_Type3Cache*>*> CPDF_Type3CacheMap;
+typedef CFX_MapPtrTemplate<CPDF_Object*, CPDF_CountedObject<CPDF_TransferFunc*>*> CPDF_TransferFuncMap;
+class CPDF_DocRenderData : public CFX_Object
+{
+public:
+ CPDF_DocRenderData(CPDF_Document* pPDFDoc = NULL);
+ ~CPDF_DocRenderData();
+ FX_BOOL Initialize();
+ CPDF_Type3Cache* GetCachedType3(CPDF_Type3Font* pFont);
+ CPDF_TransferFunc* GetTransferFunc(CPDF_Object* pObj);
+ CFX_FontCache* GetFontCache()
+ {
+ return m_pFontCache;
+ }
+ void Clear(FX_BOOL bRelease = FALSE);
+ void ReleaseCachedType3(CPDF_Type3Font* pFont);
+ void ReleaseTransferFunc(CPDF_Object* pObj);
+private:
+ CPDF_Document* m_pPDFDoc;
+ CFX_FontCache* m_pFontCache;
+ CPDF_Type3CacheMap m_Type3FaceMap;
+ CPDF_TransferFuncMap m_TransferFuncMap;
+};
+struct _PDF_RenderItem {
+public:
+ CPDF_PageObjects* m_pObjectList;
+ CFX_AffineMatrix m_Matrix;
+};
+typedef CFX_ArrayTemplate<_PDF_RenderItem> CPDF_RenderLayer;
+class IPDF_ObjectRenderer : public CFX_Object
+{
+public:
+ static IPDF_ObjectRenderer* Create(int type);
+ virtual ~IPDF_ObjectRenderer() {}
+ virtual FX_BOOL Start(CPDF_RenderStatus* pRenderStatus, const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device, FX_BOOL bStdCS, int blendType = FXDIB_BLEND_NORMAL) = 0;
+ virtual FX_BOOL Continue(IFX_Pause* pPause) = 0;
+ FX_BOOL m_Result;
+};
+class CPDF_RenderStatus : public CFX_Object
+{
+public:
+ CPDF_RenderStatus();
+ ~CPDF_RenderStatus();
+ FX_BOOL Initialize(int level, class CPDF_RenderContext* pContext, CFX_RenderDevice* pDevice, const CFX_AffineMatrix* pDeviceMatrix,
+ const CPDF_PageObject* pStopObj, const CPDF_RenderStatus* pParentStatus,
+ const CPDF_GraphicStates* pInitialStates, const CPDF_RenderOptions* pOptions,
+ int transparency, FX_BOOL bDropObjects, CPDF_Dictionary* pFormResource = NULL,
+ FX_BOOL bStdCS = FALSE, CPDF_Type3Char* pType3Char = NULL, FX_ARGB fill_color = 0,
+ FX_DWORD GroupFamily = 0, FX_BOOL bLoadMask = FALSE);
+ void RenderObjectList(const CPDF_PageObjects* pObjs, const CFX_AffineMatrix* pObj2Device);
+ void RenderSingleObject(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device);
+ FX_BOOL ContinueSingleObject(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device, IFX_Pause* pPause);
+ CPDF_RenderOptions m_Options;
+ CPDF_Dictionary* m_pFormResource;
+ CPDF_Dictionary* m_pPageResource;
+ CFX_PtrArray m_Type3FontCache;
+ CPDF_RenderContext* GetContext()
+ {
+ return m_pContext;
+ }
+protected:
+ friend class CPDF_ImageRenderer;
+ friend class CPDF_RenderContext;
+ void ProcessClipPath(CPDF_ClipPath ClipPath, const CFX_AffineMatrix* pObj2Device);
+ void DrawClipPath(CPDF_ClipPath ClipPath, const CFX_AffineMatrix* pObj2Device);
+ FX_BOOL ProcessTransparency(const CPDF_PageObject* PageObj, const CFX_AffineMatrix* pObj2Device);
+ void ProcessObjectNoClip(const CPDF_PageObject* PageObj, const CFX_AffineMatrix* pObj2Device);
+ void DrawObjWithBackground(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device);
+ FX_BOOL DrawObjWithBlend(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device);
+ FX_BOOL ProcessPath(CPDF_PathObject* pPathObj, const CFX_AffineMatrix* pObj2Device);
+ void ProcessPathPattern(CPDF_PathObject* pPathObj, const CFX_AffineMatrix* pObj2Device, int& filltype, FX_BOOL& bStroke);
+ void DrawPathWithPattern(CPDF_PathObject* pPathObj, const CFX_AffineMatrix* pObj2Device, CPDF_Color* pColor, FX_BOOL bStroke);
+ void DrawTilingPattern(CPDF_TilingPattern* pPattern, CPDF_PageObject* pPageObj, const CFX_AffineMatrix* pObj2Device, FX_BOOL bStroke);
+ void DrawShadingPattern(CPDF_ShadingPattern* pPattern, CPDF_PageObject* pPageObj, const CFX_AffineMatrix* pObj2Device, FX_BOOL bStroke);
+ FX_BOOL SelectClipPath(CPDF_PathObject* pPathObj, const CFX_AffineMatrix* pObj2Device, FX_BOOL bStroke);
+ FX_BOOL ProcessImage(CPDF_ImageObject* pImageObj, const CFX_AffineMatrix* pObj2Device);
+ FX_BOOL OutputBitmapAlpha(CPDF_ImageObject* pImageObj, const CFX_AffineMatrix* pImage2Device);
+ FX_BOOL OutputImage(CPDF_ImageObject* pImageObj, const CFX_AffineMatrix* pImage2Device);
+ FX_BOOL OutputDIBSource(const CFX_DIBSource* pOutputBitmap, FX_ARGB fill_argb, int bitmap_alpha,
+ const CFX_AffineMatrix* pImage2Device, CPDF_ImageCache* pImageCache, FX_DWORD flags);
+ void CompositeDIBitmap(CFX_DIBitmap* pDIBitmap, int left, int top, FX_ARGB mask_argb,
+ int bitmap_alpha, int blend_mode, int bIsolated);
+ FX_BOOL ProcessInlines(CPDF_InlineImages* pInlines, const CFX_AffineMatrix* pObj2Device);
+ FX_BOOL ProcessShading(CPDF_ShadingObject* pShadingObj, const CFX_AffineMatrix* pObj2Device);
+ void DrawShading(CPDF_ShadingPattern* pPattern, CFX_AffineMatrix* pMatrix, FX_RECT& clip_rect,
+ int alpha, FX_BOOL bAlphaMode);
+ FX_BOOL ProcessType3Text(const CPDF_TextObject* textobj, const CFX_AffineMatrix* pObj2Device);
+ FX_BOOL ProcessText(const CPDF_TextObject* textobj, const CFX_AffineMatrix* pObj2Device, CFX_PathData* pClippingPath);
+ void DrawTextPathWithPattern(const CPDF_TextObject* textobj, const CFX_AffineMatrix* pObj2Device,
+ CPDF_Font* pFont, FX_FLOAT font_size,
+ const CFX_AffineMatrix* pTextMatrix, FX_BOOL bFill, FX_BOOL bStroke);
+ FX_BOOL ProcessForm(CPDF_FormObject* pFormObj, const CFX_AffineMatrix* pObj2Device);
+ CFX_DIBitmap* GetBackdrop(const CPDF_PageObject* pObj, const FX_RECT& rect, int& left, int& top,
+ FX_BOOL bBackAlphaRequired);
+ CFX_DIBitmap* LoadSMask(CPDF_Dictionary* pSMaskDict, FX_RECT* pClipRect, const CFX_AffineMatrix* pMatrix);
+ void Init(CPDF_RenderContext* pParent);
+ static class CPDF_Type3Cache* GetCachedType3(CPDF_Type3Font* pFont);
+ static CPDF_GraphicStates* CloneObjStates(const CPDF_GraphicStates* pPathObj, FX_BOOL bStroke);
+ CPDF_TransferFunc* GetTransferFunc(CPDF_Object* pObject) const;
+ FX_ARGB GetFillArgb(const CPDF_PageObject* pObj, FX_BOOL bType3 = FALSE) const;
+ FX_ARGB GetStrokeArgb(const CPDF_PageObject* pObj) const;
+ CPDF_RenderContext* m_pContext;
+ FX_BOOL m_bStopped;
+ void DitherObjectArea(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device);
+ FX_BOOL GetObjectClippedRect(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device, FX_BOOL bLogical, FX_RECT &rect) const;
+ void GetScaledMatrix(CFX_Matrix &matrix) const;
+protected:
+ int m_Level;
+ CFX_RenderDevice* m_pDevice;
+ CFX_AffineMatrix m_DeviceMatrix;
+ CPDF_ClipPath m_LastClipPath;
+ const CPDF_PageObject* m_pCurObj;
+ const CPDF_PageObject* m_pStopObj;
+ CPDF_GraphicStates m_InitialStates;
+ int m_HalftoneLimit;
+ IPDF_ObjectRenderer* m_pObjectRenderer;
+ FX_BOOL m_bPrint;
+ int m_Transparency;
+ int m_DitherBits;
+ FX_BOOL m_bDropObjects;
+ FX_BOOL m_bStdCS;
+ FX_DWORD m_GroupFamily;
+ FX_BOOL m_bLoadMask;
+ CPDF_Type3Char * m_pType3Char;
+ FX_ARGB m_T3FillColor;
+ int m_curBlend;
+};
+class CPDF_ImageLoader : public CFX_Object
+{
+public:
+ CPDF_ImageLoader()
+ {
+ m_pBitmap = NULL;
+ m_pMask = NULL;
+ m_MatteColor = 0;
+ m_bCached = FALSE;
+ m_nDownsampleWidth = 0;
+ m_nDownsampleHeight = 0;
+ }
+
+ FX_BOOL Load(const CPDF_ImageObject* pImage, CPDF_PageRenderCache* pCache, FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0, FX_BOOL bLoadMask = FALSE, CPDF_RenderStatus* pRenderStatus = NULL);
+
+ FX_BOOL StartLoadImage(const CPDF_ImageObject* pImage, CPDF_PageRenderCache* pCache, FX_LPVOID& LoadHandle, FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0, FX_BOOL bLoadMask = FALSE, CPDF_RenderStatus* pRenderStatus = NULL, FX_INT32 nDownsampleWidth = 0, FX_INT32 nDownsampleHeight = 0);
+ FX_BOOL Continue(FX_LPVOID LoadHandle, IFX_Pause* pPause);
+ ~CPDF_ImageLoader();
+ CFX_DIBSource* m_pBitmap;
+ CFX_DIBSource* m_pMask;
+ FX_DWORD m_MatteColor;
+ FX_BOOL m_bCached;
+protected:
+ FX_INT32 m_nDownsampleWidth;
+ FX_INT32 m_nDownsampleHeight;
+};
+class CPDF_ProgressiveImageLoaderHandle : public CFX_Object
+{
+public:
+ CPDF_ProgressiveImageLoaderHandle();
+ ~CPDF_ProgressiveImageLoaderHandle();
+
+ FX_BOOL Start(CPDF_ImageLoader* pImageLoader, const CPDF_ImageObject* pImage, CPDF_PageRenderCache* pCache, FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0, FX_BOOL bLoadMask = FALSE, CPDF_RenderStatus* pRenderStatus = NULL, FX_INT32 nDownsampleWidth = 0, FX_INT32 nDownsampleHeight = 0);
+ FX_BOOL Continue(IFX_Pause* pPause);
+protected:
+ CPDF_ImageLoader* m_pImageLoader;
+ CPDF_PageRenderCache* m_pCache;
+ CPDF_ImageObject* m_pImage;
+ FX_INT32 m_nDownsampleWidth;
+ FX_INT32 m_nDownsampleHeight;
+};
+class CFX_ImageTransformer;
+class CPDF_ImageRenderer : public IPDF_ObjectRenderer
+{
+public:
+ CPDF_ImageRenderer();
+ ~CPDF_ImageRenderer();
+ FX_BOOL Start(CPDF_RenderStatus* pStatus, const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device, FX_BOOL bStdCS, int blendType = FXDIB_BLEND_NORMAL);
+ FX_BOOL Start(CPDF_RenderStatus* pStatus, const CFX_DIBSource* pDIBSource, FX_ARGB bitmap_argb,
+ int bitmap_alpha, const CFX_AffineMatrix* pImage2Device, FX_DWORD flags, FX_BOOL bStdCS, int blendType = FXDIB_BLEND_NORMAL);
+ FX_BOOL Continue(IFX_Pause* pPause);
+protected:
+ CPDF_RenderStatus* m_pRenderStatus;
+ CPDF_ImageObject* m_pImageObject;
+ int m_Status;
+ const CFX_AffineMatrix* m_pObj2Device;
+ CFX_AffineMatrix m_ImageMatrix;
+ CPDF_ImageLoader m_Loader;
+ const CFX_DIBSource* m_pDIBSource;
+ CFX_DIBitmap* m_pClone;
+ int m_BitmapAlpha;
+ FX_BOOL m_bPatternColor;
+ CPDF_Pattern* m_pPattern;
+ FX_ARGB m_FillArgb;
+ FX_DWORD m_Flags;
+ CPDF_QuickStretcher* m_pQuickStretcher;
+ CFX_ImageTransformer* m_pTransformer;
+ CPDF_ImageRenderer* m_pRenderer2;
+ FX_LPVOID m_DeviceHandle;
+ FX_LPVOID m_LoadHandle;
+ FX_BOOL m_bStdCS;
+ int m_BlendType;
+ FX_BOOL StartBitmapAlpha();
+ FX_BOOL StartDIBSource();
+ FX_BOOL StartRenderDIBSource();
+ FX_BOOL StartLoadDIBSource();
+ FX_BOOL DrawMaskedImage();
+ FX_BOOL DrawPatternImage(const CFX_Matrix* pObj2Device);
+};
+class CPDF_ScaledRenderBuffer : public CFX_Object
+{
+public:
+ CPDF_ScaledRenderBuffer();
+ ~CPDF_ScaledRenderBuffer();
+ FX_BOOL Initialize(CPDF_RenderContext* pContext, CFX_RenderDevice* pDevice, FX_RECT* pRect,
+ const CPDF_PageObject* pObj, const CPDF_RenderOptions *pOptions = NULL, int max_dpi = 0);
+ CFX_RenderDevice* GetDevice()
+ {
+ return m_pBitmapDevice ? m_pBitmapDevice : m_pDevice;
+ }
+ CFX_AffineMatrix* GetMatrix()
+ {
+ return &m_Matrix;
+ }
+ void OutputToDevice();
+private:
+ CFX_RenderDevice* m_pDevice;
+ CPDF_RenderContext* m_pContext;
+ FX_RECT m_Rect;
+ const CPDF_PageObject* m_pObject;
+ CFX_FxgeDevice* m_pBitmapDevice;
+ CFX_AffineMatrix m_Matrix;
+};
+class ICodec_ScanlineDecoder;
+class CPDF_QuickStretcher : public CFX_Object
+{
+public:
+ CPDF_QuickStretcher();
+ ~CPDF_QuickStretcher();
+ FX_BOOL Start(CPDF_ImageObject* pImageObj, CFX_AffineMatrix* pImage2Device, const FX_RECT* pClipBox);
+ FX_BOOL Continue(IFX_Pause* pPause);
+ CFX_DIBitmap* m_pBitmap;
+ int m_ResultLeft, m_ResultTop, m_ClipLeft, m_ClipTop;
+ int m_DestWidth, m_DestHeight, m_ResultWidth, m_ResultHeight;
+ int m_Bpp, m_SrcWidth, m_SrcHeight;
+ FX_BOOL m_bFlipX, m_bFlipY;
+ CPDF_ColorSpace* m_pCS;
+ ICodec_ScanlineDecoder* m_pDecoder;
+ CPDF_StreamAcc m_StreamAcc;
+ int m_LineIndex;
+};
+class CPDF_DeviceBuffer : public CFX_Object
+{
+public:
+ CPDF_DeviceBuffer();
+ ~CPDF_DeviceBuffer();
+ FX_BOOL Initialize(CPDF_RenderContext* pContext, CFX_RenderDevice* pDevice, FX_RECT* pRect,
+ const CPDF_PageObject* pObj, int max_dpi = 0);
+ void OutputToDevice();
+ CFX_DIBitmap* GetBitmap() const
+ {
+ return m_pBitmap;
+ }
+ const CFX_AffineMatrix* GetMatrix() const
+ {
+ return &m_Matrix;
+ }
+private:
+ CFX_RenderDevice* m_pDevice;
+ CPDF_RenderContext* m_pContext;
+ FX_RECT m_Rect;
+ const CPDF_PageObject* m_pObject;
+ CFX_DIBitmap* m_pBitmap;
+ CFX_AffineMatrix m_Matrix;
+};
+class CPDF_ImageCache : public CFX_Object
+{
+public:
+ CPDF_ImageCache(CPDF_Document* pDoc, CPDF_Stream* pStream);
+ ~CPDF_ImageCache();
+ void ClearImageData();
+ void Reset(const CFX_DIBitmap* pBitmap);
+ FX_BOOL GetCachedBitmap(CFX_DIBSource*& pBitmap, CFX_DIBSource*& pMask, FX_DWORD& MatteColor, CPDF_Dictionary* pPageResources,
+ FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0, FX_BOOL bLoadMask = FALSE,
+ CPDF_RenderStatus* pRenderStatus = NULL, FX_INT32 downsampleWidth = 0, FX_INT32 downsampleHeight = 0);
+ FX_DWORD EstimateSize() const
+ {
+ return m_dwCacheSize;
+ }
+ FX_DWORD GetTimeCount() const
+ {
+ return m_dwTimeCount;
+ }
+ CPDF_Stream* GetStream() const
+ {
+ return m_pStream;
+ }
+ void SetTimeCount(FX_DWORD dwTimeCount)
+ {
+ m_dwTimeCount = dwTimeCount;
+ }
+ int m_dwTimeCount;
+public:
+ int StartGetCachedBitmap(CPDF_Dictionary* pFormResources, CPDF_Dictionary* pPageResources,
+ FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0,
+ FX_BOOL bLoadMask = FALSE, CPDF_RenderStatus* pRenderStatus = NULL, FX_INT32 downsampleWidth = 0, FX_INT32 downsampleHeight = 0);
+ int Continue(IFX_Pause* pPause);
+ int ContinueGetCachedBitmap();
+ CFX_DIBSource* DetachBitmap();
+ CFX_DIBSource* DetachMask();
+ CFX_DIBSource* m_pCurBitmap;
+ CFX_DIBSource* m_pCurMask;
+ FX_DWORD m_MatteColor;
+ CPDF_RenderStatus* m_pRenderStatus;
+protected:
+ CPDF_Document* m_pDocument;
+ CPDF_Stream* m_pStream;
+ CFX_DIBSource* m_pCachedBitmap;
+ CFX_DIBSource* m_pCachedMask;
+ FX_DWORD m_dwCacheSize;
+ void CalcSize();
+};
+typedef struct {
+ FX_FLOAT m_DecodeMin;
+ FX_FLOAT m_DecodeStep;
+ int m_ColorKeyMin;
+ int m_ColorKeyMax;
+} DIB_COMP_DATA;
+class CPDF_DIBSource : public CFX_DIBSource
+{
+public:
+ CPDF_DIBSource();
+ virtual ~CPDF_DIBSource();
+ FX_BOOL Load(CPDF_Document* pDoc, const CPDF_Stream* pStream,
+ CPDF_DIBSource** ppMask, FX_DWORD* pMatteColor,
+ CPDF_Dictionary* pFormResources, CPDF_Dictionary* pPageResources,
+ FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0, FX_BOOL bLoadMask = FALSE);
+ virtual FX_BOOL SkipToScanline(int line, IFX_Pause* pPause) const;
+ virtual FX_LPBYTE GetBuffer() const;
+ virtual FX_LPCBYTE GetScanline(int line) const;
+ virtual void DownSampleScanline(int line, FX_LPBYTE dest_scan, int dest_bpp,
+ int dest_width, FX_BOOL bFlipX, int clip_left, int clip_width) const;
+ virtual void SetDownSampleSize(int dest_width, int dest_height) const;
+ CFX_DIBitmap* GetBitmap() const;
+ void ReleaseBitmap(CFX_DIBitmap*) const;
+ void ClearImageData();
+public:
+ int StartLoadDIBSource(CPDF_Document* pDoc, const CPDF_Stream* pStream, FX_BOOL bHasMask,
+ CPDF_Dictionary* pFormResources, CPDF_Dictionary* pPageResources,
+ FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily = 0, FX_BOOL bLoadMask = FALSE);
+ int ContinueLoadDIBSource(IFX_Pause* pPause);
+ int StratLoadMask();
+ int StartLoadMaskDIB();
+ int ContinueLoadMaskDIB(IFX_Pause* pPause);
+ int ContinueToLoadMask();
+ CPDF_DIBSource* DetachMask();
+ CPDF_DIBSource* m_pMask;
+ FX_DWORD m_MatteColor;
+ FX_LPVOID m_pJbig2Context;
+ CPDF_StreamAcc* m_pGlobalStream;
+ FX_BOOL m_bStdCS;
+ int m_Status;
+ CPDF_Object* m_pMaskStream;
+ FX_BOOL m_bHasMask;
+protected:
+ FX_BOOL LoadColorInfo(CPDF_Dictionary* pFormResources, CPDF_Dictionary* pPageResources);
+ CPDF_DIBSource* LoadMask(FX_DWORD& MatteColor);
+ CPDF_DIBSource* LoadMaskDIB(CPDF_Stream* pMask);
+ void LoadJpxBitmap();
+ void LoadJbig2Bitmap();
+ void LoadPalette();
+ FX_BOOL CreateDecoder();
+ void TranslateScanline24bpp(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan) const;
+ FX_DWORD GetValidBpp() const;
+
+ CPDF_Document* m_pDocument;
+ const CPDF_Stream* m_pStream;
+ CPDF_StreamAcc* m_pStreamAcc;
+ const CPDF_Dictionary* m_pDict;
+ CPDF_ColorSpace* m_pColorSpace;
+ FX_DWORD m_Family, m_bpc, m_nComponents, m_GroupFamily;
+ FX_BOOL m_bLoadMask;
+ FX_BOOL m_bDefaultDecode, m_bImageMask, m_bColorKey;
+ DIB_COMP_DATA* m_pCompData;
+ FX_LPBYTE m_pLineBuf;
+ FX_LPBYTE m_pMaskedLine;
+ CFX_DIBitmap* m_pCachedBitmap;
+ ICodec_ScanlineDecoder* m_pDecoder;
+};
+#ifdef _FPDFAPI_MINI_
+#define FPDF_HUGE_IMAGE_SIZE 3000000
+#else
+#define FPDF_HUGE_IMAGE_SIZE 60000000
+#endif
+class CPDF_DIBTransferFunc : public CFX_FilteredDIB
+{
+public:
+ CPDF_DIBTransferFunc(const CPDF_TransferFunc* pTransferFunc);
+ virtual FXDIB_Format GetDestFormat();
+ virtual FX_ARGB* GetDestPalette()
+ {
+ return NULL;
+ }
+ virtual void TranslateScanline(FX_LPBYTE dest_buf, FX_LPCBYTE src_buf) const;
+ virtual void TranslateDownSamples(FX_LPBYTE dest_buf, FX_LPCBYTE src_buf, int pixels, int Bpp) const;
+ FX_LPCBYTE m_RampR;
+ FX_LPCBYTE m_RampG;
+ FX_LPCBYTE m_RampB;
+};
+struct _CPDF_UniqueKeyGen {
+ void Generate(int count, ...);
+ FX_CHAR m_Key[128];
+ int m_KeyLen;
+};
diff --git a/core/src/fpdfdoc/doc_action.cpp b/core/src/fpdfdoc/doc_action.cpp
index f13bd27cbe..801c69fbb7 100644
--- a/core/src/fpdfdoc/doc_action.cpp
+++ b/core/src/fpdfdoc/doc_action.cpp
@@ -1,362 +1,362 @@
-// 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
-
-#include "../../include/fpdfdoc/fpdf_doc.h"
-CPDF_Dest CPDF_Action::GetDest(CPDF_Document* pDoc) const
-{
- if (m_pDict == NULL) {
- return NULL;
- }
- CFX_ByteString type = m_pDict->GetString("S");
- if (type != "GoTo" && type != "GoToR") {
- return NULL;
- }
- CPDF_Object* pDest = m_pDict->GetElementValue("D");
- if (pDest == NULL) {
- return NULL;
- }
- if (pDest->GetType() == PDFOBJ_STRING || pDest->GetType() == PDFOBJ_NAME) {
- CPDF_NameTree name_tree(pDoc, FX_BSTRC("Dests"));
- CFX_ByteStringC name = pDest->GetString();
- return name_tree.LookupNamedDest(pDoc, name);
- } else if (pDest->GetType() == PDFOBJ_ARRAY) {
- return (CPDF_Array*)pDest;
- }
- return NULL;
-}
-const FX_CHAR* g_sATypes[] = {"Unknown", "GoTo", "GoToR", "GoToE", "Launch", "Thread", "URI", "Sound", "Movie",
- "Hide", "Named", "SubmitForm", "ResetForm", "ImportData", "JavaScript", "SetOCGState",
- "Rendition", "Trans", "GoTo3DView", ""
- };
-CPDF_Action::ActionType CPDF_Action::GetType() const
-{
- ActionType eType = Unknown;
- if (m_pDict != NULL) {
- CFX_ByteString csType = m_pDict->GetString("S");
- if (!csType.IsEmpty()) {
- int i = 0;
- while (g_sATypes[i][0] != '\0') {
- if (csType == g_sATypes[i]) {
- return (ActionType)i;
- }
- i ++;
- }
- }
- }
- return eType;
-}
-CFX_WideString CPDF_Action::GetFilePath() const
-{
- CFX_ByteString type = m_pDict->GetString("S");
- if (type != "GoToR" && type != "Launch" &&
- type != "SubmitForm" && type != "ImportData") {
- return CFX_WideString();
- }
- CPDF_Object* pFile = m_pDict->GetElementValue("F");
- CFX_WideString path;
- if (pFile == NULL) {
- if (type == "Launch") {
- CPDF_Dictionary* pWinDict = m_pDict->GetDict(FX_BSTRC("Win"));
- if (pWinDict) {
- return CFX_WideString::FromLocal(pWinDict->GetString(FX_BSTRC("F")));
- }
- }
- return path;
- }
- CPDF_FileSpec filespec(pFile);
- filespec.GetFileName(path);
- return path;
-}
-CFX_ByteString CPDF_Action::GetURI(CPDF_Document* pDoc) const
-{
- CFX_ByteString csURI;
- if (m_pDict == NULL) {
- return csURI;
- }
- if (m_pDict->GetString("S") != "URI") {
- return csURI;
- }
- csURI = m_pDict->GetString("URI");
- CPDF_Dictionary* pRoot = pDoc->GetRoot();
- CPDF_Dictionary* pURI = pRoot->GetDict("URI");
- if (pURI != NULL) {
- if (csURI.Find(FX_BSTRC(":"), 0) < 1) {
- csURI = pURI->GetString("Base") + csURI;
- }
- }
- return csURI;
-}
-FX_DWORD CPDF_ActionFields::GetFieldsCount() const
-{
- if (m_pAction == NULL) {
- return 0;
- }
- CPDF_Dictionary* pDict = (CPDF_Dictionary*)(*m_pAction);
- if (pDict == NULL) {
- return 0;
- }
- CFX_ByteString csType = pDict->GetString("S");
- CPDF_Object* pFields = NULL;
- if (csType == "Hide") {
- pFields = pDict->GetElementValue("T");
- } else {
- pFields = pDict->GetArray("Fields");
- }
- if (pFields == NULL) {
- return 0;
- }
- int iType = pFields->GetType();
- if (iType == PDFOBJ_DICTIONARY) {
- return 1;
- } else if (iType == PDFOBJ_STRING) {
- return 1;
- } else if (iType == PDFOBJ_ARRAY) {
- return ((CPDF_Array*)pFields)->GetCount();
- }
- return 0;
-}
-void CPDF_ActionFields::GetAllFields(CFX_PtrArray& fieldObjects) const
-{
- fieldObjects.RemoveAll();
- if (m_pAction == NULL) {
- return;
- }
- CPDF_Dictionary* pDict = (CPDF_Dictionary*)(*m_pAction);
- if (pDict == NULL) {
- return;
- }
- CFX_ByteString csType = pDict->GetString("S");
- CPDF_Object* pFields = NULL;
- if (csType == "Hide") {
- pFields = pDict->GetElementValue("T");
- } else {
- pFields = pDict->GetArray("Fields");
- }
- if (pFields == NULL) {
- return;
- }
- int iType = pFields->GetType();
- if (iType == PDFOBJ_DICTIONARY || iType == PDFOBJ_STRING) {
- fieldObjects.Add(pFields);
- } else if (iType == PDFOBJ_ARRAY) {
- CPDF_Array* pArray = (CPDF_Array*)pFields;
- FX_DWORD iCount = pArray->GetCount();
- for (FX_DWORD i = 0; i < iCount; i ++) {
- CPDF_Object* pObj = pArray->GetElementValue(i);
- if (pObj != NULL) {
- fieldObjects.Add(pObj);
- }
- }
- }
-}
-CPDF_Object* CPDF_ActionFields::GetField(FX_DWORD iIndex) const
-{
- if (m_pAction == NULL) {
- return NULL;
- }
- CPDF_Dictionary* pDict = (CPDF_Dictionary*)(*m_pAction);
- if (pDict == NULL) {
- return NULL;
- }
- CFX_ByteString csType = pDict->GetString("S");
- CPDF_Object* pFields = NULL;
- if (csType == "Hide") {
- pFields = pDict->GetElementValue("T");
- } else {
- pFields = pDict->GetArray("Fields");
- }
- if (pFields == NULL) {
- return NULL;
- }
- CPDF_Object* pFindObj = NULL;
- int iType = pFields->GetType();
- if (iType == PDFOBJ_DICTIONARY || iType == PDFOBJ_STRING) {
- if (iIndex == 0) {
- pFindObj = pFields;
- }
- } else if (iType == PDFOBJ_ARRAY) {
- pFindObj = ((CPDF_Array*)pFields)->GetElementValue(iIndex);
- }
- return pFindObj;
-}
-CPDF_LWinParam CPDF_Action::GetWinParam() const
-{
- if (m_pDict == NULL) {
- return NULL;
- }
- if (m_pDict->GetString("S") != "Launch") {
- return NULL;
- }
- return m_pDict->GetDict("Win");
-}
-CFX_WideString CPDF_Action::GetJavaScript() const
-{
- CFX_WideString csJS;
- if (m_pDict == NULL) {
- return csJS;
- }
- CPDF_Object* pJS = m_pDict->GetElementValue("JS");
- if (pJS != NULL) {
- return pJS->GetUnicodeText();
- }
- return csJS;
-}
-CPDF_Dictionary* CPDF_Action::GetAnnot() const
-{
- if (m_pDict == NULL) {
- return NULL;
- }
- CFX_ByteString csType = m_pDict->GetString("S");
- if (csType == FX_BSTRC("Rendition")) {
- return m_pDict->GetDict("AN");
- } else if (csType == FX_BSTRC("Movie")) {
- return m_pDict->GetDict("Annotation");
- }
- return NULL;
-}
-FX_INT32 CPDF_Action::GetOperationType() const
-{
- if (m_pDict == NULL) {
- return 0;
- }
- CFX_ByteString csType = m_pDict->GetString("S");
- if (csType == FX_BSTRC("Rendition")) {
- return m_pDict->GetInteger("OP");
- } else if (csType == FX_BSTRC("Movie")) {
- CFX_ByteString csOP = m_pDict->GetString("Operation");
- if (csOP == FX_BSTRC("Play")) {
- return 0;
- } else if (csOP == FX_BSTRC("Stop")) {
- return 1;
- } else if (csOP == FX_BSTRC("Pause")) {
- return 2;
- } else if (csOP == FX_BSTRC("Resume")) {
- return 3;
- }
- }
- return 0;
-}
-FX_DWORD CPDF_Action::GetSubActionsCount() const
-{
- if (m_pDict == NULL || !m_pDict->KeyExist("Next")) {
- return 0;
- }
- CPDF_Object* pNext = m_pDict->GetElementValue("Next");
- if (!pNext) {
- return 0;
- }
- int iObjType = pNext->GetType();
- if (iObjType == PDFOBJ_DICTIONARY) {
- return 1;
- }
- if (iObjType == PDFOBJ_ARRAY) {
- return ((CPDF_Array*)pNext)->GetCount();
- }
- return 0;
-}
-CPDF_Action CPDF_Action::GetSubAction(FX_DWORD iIndex) const
-{
- if (m_pDict == NULL || !m_pDict->KeyExist("Next")) {
- return NULL;
- }
- CPDF_Object* pNext = m_pDict->GetElementValue("Next");
- int iObjType = pNext->GetType();
- if (iObjType == PDFOBJ_DICTIONARY) {
- if (iIndex == 0) {
- return (CPDF_Dictionary*)pNext;
- }
- }
- if (iObjType == PDFOBJ_ARRAY) {
- return ((CPDF_Array*)pNext)->GetDict(iIndex);
- }
- return NULL;
-}
-const FX_CHAR* g_sAATypes[] = {"E", "X", "D", "U", "Fo", "Bl", "PO", "PC", "PV", "PI",
- "O", "C",
- "K", "F", "V", "C",
- "WC", "WS", "DS", "WP", "DP",
- ""
- };
-FX_BOOL CPDF_AAction::ActionExist(AActionType eType) const
-{
- if (m_pDict == NULL) {
- return FALSE;
- }
- return m_pDict->KeyExist(g_sAATypes[(int)eType]);
-}
-CPDF_Action CPDF_AAction::GetAction(AActionType eType) const
-{
- if (m_pDict == NULL) {
- return NULL;
- }
- return m_pDict->GetDict(g_sAATypes[(int)eType]);
-}
-FX_POSITION CPDF_AAction::GetStartPos() const
-{
- if (m_pDict == NULL) {
- return NULL;
- }
- return m_pDict->GetStartPos();
-}
-CPDF_Action CPDF_AAction::GetNextAction(FX_POSITION& pos, AActionType& eType) const
-{
- if (m_pDict == NULL) {
- return NULL;
- }
- CFX_ByteString csKey;
- CPDF_Object* pObj = m_pDict->GetNextElement(pos, csKey);
- if (pObj != NULL) {
- CPDF_Object* pDirect = pObj->GetDirect();
- if (pDirect != NULL && pDirect->GetType() == PDFOBJ_DICTIONARY) {
- int i = 0;
- while (g_sAATypes[i][0] != '\0') {
- if (csKey == g_sAATypes[i]) {
- break;
- }
- i ++;
- }
- eType = (AActionType)i;
- return (CPDF_Dictionary*)pDirect;
- }
- }
- return NULL;
-}
-CPDF_DocJSActions::CPDF_DocJSActions(CPDF_Document* pDoc)
-{
- m_pDocument = pDoc;
-}
-int CPDF_DocJSActions::CountJSActions() const
-{
- ASSERT(m_pDocument != NULL);
- CPDF_NameTree name_tree(m_pDocument, FX_BSTRC("JavaScript"));
- return name_tree.GetCount();
-}
-CPDF_Action CPDF_DocJSActions::GetJSAction(int index, CFX_ByteString& csName) const
-{
- ASSERT(m_pDocument != NULL);
- CPDF_NameTree name_tree(m_pDocument, FX_BSTRC("JavaScript"));
- CPDF_Object *pAction = name_tree.LookupValue(index, csName);
- if (pAction == NULL || pAction->GetType() != PDFOBJ_DICTIONARY) {
- return NULL;
- }
- return pAction->GetDict();
-}
-CPDF_Action CPDF_DocJSActions::GetJSAction(const CFX_ByteString& csName) const
-{
- ASSERT(m_pDocument != NULL);
- CPDF_NameTree name_tree(m_pDocument, FX_BSTRC("JavaScript"));
- CPDF_Object *pAction = name_tree.LookupValue(csName);
- if (pAction == NULL || pAction->GetType() != PDFOBJ_DICTIONARY) {
- return NULL;
- }
- return pAction->GetDict();
-}
-int CPDF_DocJSActions::FindJSAction(const CFX_ByteString& csName) const
-{
- ASSERT(m_pDocument != NULL);
- CPDF_NameTree name_tree(m_pDocument, FX_BSTRC("JavaScript"));
- return name_tree.GetIndex(csName);
-}
+// 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
+
+#include "../../include/fpdfdoc/fpdf_doc.h"
+CPDF_Dest CPDF_Action::GetDest(CPDF_Document* pDoc) const
+{
+ if (m_pDict == NULL) {
+ return NULL;
+ }
+ CFX_ByteString type = m_pDict->GetString("S");
+ if (type != "GoTo" && type != "GoToR") {
+ return NULL;
+ }
+ CPDF_Object* pDest = m_pDict->GetElementValue("D");
+ if (pDest == NULL) {
+ return NULL;
+ }
+ if (pDest->GetType() == PDFOBJ_STRING || pDest->GetType() == PDFOBJ_NAME) {
+ CPDF_NameTree name_tree(pDoc, FX_BSTRC("Dests"));
+ CFX_ByteStringC name = pDest->GetString();
+ return name_tree.LookupNamedDest(pDoc, name);
+ } else if (pDest->GetType() == PDFOBJ_ARRAY) {
+ return (CPDF_Array*)pDest;
+ }
+ return NULL;
+}
+const FX_CHAR* g_sATypes[] = {"Unknown", "GoTo", "GoToR", "GoToE", "Launch", "Thread", "URI", "Sound", "Movie",
+ "Hide", "Named", "SubmitForm", "ResetForm", "ImportData", "JavaScript", "SetOCGState",
+ "Rendition", "Trans", "GoTo3DView", ""
+ };
+CPDF_Action::ActionType CPDF_Action::GetType() const
+{
+ ActionType eType = Unknown;
+ if (m_pDict != NULL) {
+ CFX_ByteString csType = m_pDict->GetString("S");
+ if (!csType.IsEmpty()) {
+ int i = 0;
+ while (g_sATypes[i][0] != '\0') {
+ if (csType == g_sATypes[i]) {
+ return (ActionType)i;
+ }
+ i ++;
+ }
+ }
+ }
+ return eType;
+}
+CFX_WideString CPDF_Action::GetFilePath() const
+{
+ CFX_ByteString type = m_pDict->GetString("S");
+ if (type != "GoToR" && type != "Launch" &&
+ type != "SubmitForm" && type != "ImportData") {
+ return CFX_WideString();
+ }
+ CPDF_Object* pFile = m_pDict->GetElementValue("F");
+ CFX_WideString path;
+ if (pFile == NULL) {
+ if (type == "Launch") {
+ CPDF_Dictionary* pWinDict = m_pDict->GetDict(FX_BSTRC("Win"));
+ if (pWinDict) {
+ return CFX_WideString::FromLocal(pWinDict->GetString(FX_BSTRC("F")));
+ }
+ }
+ return path;
+ }
+ CPDF_FileSpec filespec(pFile);
+ filespec.GetFileName(path);
+ return path;
+}
+CFX_ByteString CPDF_Action::GetURI(CPDF_Document* pDoc) const
+{
+ CFX_ByteString csURI;
+ if (m_pDict == NULL) {
+ return csURI;
+ }
+ if (m_pDict->GetString("S") != "URI") {
+ return csURI;
+ }
+ csURI = m_pDict->GetString("URI");
+ CPDF_Dictionary* pRoot = pDoc->GetRoot();
+ CPDF_Dictionary* pURI = pRoot->GetDict("URI");
+ if (pURI != NULL) {
+ if (csURI.Find(FX_BSTRC(":"), 0) < 1) {
+ csURI = pURI->GetString("Base") + csURI;
+ }
+ }
+ return csURI;
+}
+FX_DWORD CPDF_ActionFields::GetFieldsCount() const
+{
+ if (m_pAction == NULL) {
+ return 0;
+ }
+ CPDF_Dictionary* pDict = (CPDF_Dictionary*)(*m_pAction);
+ if (pDict == NULL) {
+ return 0;
+ }
+ CFX_ByteString csType = pDict->GetString("S");
+ CPDF_Object* pFields = NULL;
+ if (csType == "Hide") {
+ pFields = pDict->GetElementValue("T");
+ } else {
+ pFields = pDict->GetArray("Fields");
+ }
+ if (pFields == NULL) {
+ return 0;
+ }
+ int iType = pFields->GetType();
+ if (iType == PDFOBJ_DICTIONARY) {
+ return 1;
+ } else if (iType == PDFOBJ_STRING) {
+ return 1;
+ } else if (iType == PDFOBJ_ARRAY) {
+ return ((CPDF_Array*)pFields)->GetCount();
+ }
+ return 0;
+}
+void CPDF_ActionFields::GetAllFields(CFX_PtrArray& fieldObjects) const
+{
+ fieldObjects.RemoveAll();
+ if (m_pAction == NULL) {
+ return;
+ }
+ CPDF_Dictionary* pDict = (CPDF_Dictionary*)(*m_pAction);
+ if (pDict == NULL) {
+ return;
+ }
+ CFX_ByteString csType = pDict->GetString("S");
+ CPDF_Object* pFields = NULL;
+ if (csType == "Hide") {
+ pFields = pDict->GetElementValue("T");
+ } else {
+ pFields = pDict->GetArray("Fields");
+ }
+ if (pFields == NULL) {
+ return;
+ }
+ int iType = pFields->GetType();
+ if (iType == PDFOBJ_DICTIONARY || iType == PDFOBJ_STRING) {
+ fieldObjects.Add(pFields);
+ } else if (iType == PDFOBJ_ARRAY) {
+ CPDF_Array* pArray = (CPDF_Array*)pFields;
+ FX_DWORD iCount = pArray->GetCount();
+ for (FX_DWORD i = 0; i < iCount; i ++) {
+ CPDF_Object* pObj = pArray->GetElementValue(i);
+ if (pObj != NULL) {
+ fieldObjects.Add(pObj);
+ }
+ }
+ }
+}
+CPDF_Object* CPDF_ActionFields::GetField(FX_DWORD iIndex) const
+{
+ if (m_pAction == NULL) {
+ return NULL;
+ }
+ CPDF_Dictionary* pDict = (CPDF_Dictionary*)(*m_pAction);
+ if (pDict == NULL) {
+ return NULL;
+ }
+ CFX_ByteString csType = pDict->GetString("S");
+ CPDF_Object* pFields = NULL;
+ if (csType == "Hide") {
+ pFields = pDict->GetElementValue("T");
+ } else {
+ pFields = pDict->GetArray("Fields");
+ }
+ if (pFields == NULL) {
+ return NULL;
+ }
+ CPDF_Object* pFindObj = NULL;
+ int iType = pFields->GetType();
+ if (iType == PDFOBJ_DICTIONARY || iType == PDFOBJ_STRING) {
+ if (iIndex == 0) {
+ pFindObj = pFields;
+ }
+ } else if (iType == PDFOBJ_ARRAY) {
+ pFindObj = ((CPDF_Array*)pFields)->GetElementValue(iIndex);
+ }
+ return pFindObj;
+}
+CPDF_LWinParam CPDF_Action::GetWinParam() const
+{
+ if (m_pDict == NULL) {
+ return NULL;
+ }
+ if (m_pDict->GetString("S") != "Launch") {
+ return NULL;
+ }
+ return m_pDict->GetDict("Win");
+}
+CFX_WideString CPDF_Action::GetJavaScript() const
+{
+ CFX_WideString csJS;
+ if (m_pDict == NULL) {
+ return csJS;
+ }
+ CPDF_Object* pJS = m_pDict->GetElementValue("JS");
+ if (pJS != NULL) {
+ return pJS->GetUnicodeText();
+ }
+ return csJS;
+}
+CPDF_Dictionary* CPDF_Action::GetAnnot() const
+{
+ if (m_pDict == NULL) {
+ return NULL;
+ }
+ CFX_ByteString csType = m_pDict->GetString("S");
+ if (csType == FX_BSTRC("Rendition")) {
+ return m_pDict->GetDict("AN");
+ } else if (csType == FX_BSTRC("Movie")) {
+ return m_pDict->GetDict("Annotation");
+ }
+ return NULL;
+}
+FX_INT32 CPDF_Action::GetOperationType() const
+{
+ if (m_pDict == NULL) {
+ return 0;
+ }
+ CFX_ByteString csType = m_pDict->GetString("S");
+ if (csType == FX_BSTRC("Rendition")) {
+ return m_pDict->GetInteger("OP");
+ } else if (csType == FX_BSTRC("Movie")) {
+ CFX_ByteString csOP = m_pDict->GetString("Operation");
+ if (csOP == FX_BSTRC("Play")) {
+ return 0;
+ } else if (csOP == FX_BSTRC("Stop")) {
+ return 1;
+ } else if (csOP == FX_BSTRC("Pause")) {
+ return 2;
+ } else if (csOP == FX_BSTRC("Resume")) {
+ return 3;
+ }
+ }
+ return 0;
+}
+FX_DWORD CPDF_Action::GetSubActionsCount() const
+{
+ if (m_pDict == NULL || !m_pDict->KeyExist("Next")) {
+ return 0;
+ }
+ CPDF_Object* pNext = m_pDict->GetElementValue("Next");
+ if (!pNext) {
+ return 0;
+ }
+ int iObjType = pNext->GetType();
+ if (iObjType == PDFOBJ_DICTIONARY) {
+ return 1;
+ }
+ if (iObjType == PDFOBJ_ARRAY) {
+ return ((CPDF_Array*)pNext)->GetCount();
+ }
+ return 0;
+}
+CPDF_Action CPDF_Action::GetSubAction(FX_DWORD iIndex) const
+{
+ if (m_pDict == NULL || !m_pDict->KeyExist("Next")) {
+ return NULL;
+ }
+ CPDF_Object* pNext = m_pDict->GetElementValue("Next");
+ int iObjType = pNext->GetType();
+ if (iObjType == PDFOBJ_DICTIONARY) {
+ if (iIndex == 0) {
+ return (CPDF_Dictionary*)pNext;
+ }
+ }
+ if (iObjType == PDFOBJ_ARRAY) {
+ return ((CPDF_Array*)pNext)->GetDict(iIndex);
+ }
+ return NULL;
+}
+const FX_CHAR* g_sAATypes[] = {"E", "X", "D", "U", "Fo", "Bl", "PO", "PC", "PV", "PI",
+ "O", "C",
+ "K", "F", "V", "C",
+ "WC", "WS", "DS", "WP", "DP",
+ ""
+ };
+FX_BOOL CPDF_AAction::ActionExist(AActionType eType) const
+{
+ if (m_pDict == NULL) {
+ return FALSE;
+ }
+ return m_pDict->KeyExist(g_sAATypes[(int)eType]);
+}
+CPDF_Action CPDF_AAction::GetAction(AActionType eType) const
+{
+ if (m_pDict == NULL) {
+ return NULL;
+ }
+ return m_pDict->GetDict(g_sAATypes[(int)eType]);
+}
+FX_POSITION CPDF_AAction::GetStartPos() const
+{
+ if (m_pDict == NULL) {
+ return NULL;
+ }
+ return m_pDict->GetStartPos();
+}
+CPDF_Action CPDF_AAction::GetNextAction(FX_POSITION& pos, AActionType& eType) const
+{
+ if (m_pDict == NULL) {
+ return NULL;
+ }
+ CFX_ByteString csKey;
+ CPDF_Object* pObj = m_pDict->GetNextElement(pos, csKey);
+ if (pObj != NULL) {
+ CPDF_Object* pDirect = pObj->GetDirect();
+ if (pDirect != NULL && pDirect->GetType() == PDFOBJ_DICTIONARY) {
+ int i = 0;
+ while (g_sAATypes[i][0] != '\0') {
+ if (csKey == g_sAATypes[i]) {
+ break;
+ }
+ i ++;
+ }
+ eType = (AActionType)i;
+ return (CPDF_Dictionary*)pDirect;
+ }
+ }
+ return NULL;
+}
+CPDF_DocJSActions::CPDF_DocJSActions(CPDF_Document* pDoc)
+{
+ m_pDocument = pDoc;
+}
+int CPDF_DocJSActions::CountJSActions() const
+{
+ ASSERT(m_pDocument != NULL);
+ CPDF_NameTree name_tree(m_pDocument, FX_BSTRC("JavaScript"));
+ return name_tree.GetCount();
+}
+CPDF_Action CPDF_DocJSActions::GetJSAction(int index, CFX_ByteString& csName) const
+{
+ ASSERT(m_pDocument != NULL);
+ CPDF_NameTree name_tree(m_pDocument, FX_BSTRC("JavaScript"));
+ CPDF_Object *pAction = name_tree.LookupValue(index, csName);
+ if (pAction == NULL || pAction->GetType() != PDFOBJ_DICTIONARY) {
+ return NULL;
+ }
+ return pAction->GetDict();
+}
+CPDF_Action CPDF_DocJSActions::GetJSAction(const CFX_ByteString& csName) const
+{
+ ASSERT(m_pDocument != NULL);
+ CPDF_NameTree name_tree(m_pDocument, FX_BSTRC("JavaScript"));
+ CPDF_Object *pAction = name_tree.LookupValue(csName);
+ if (pAction == NULL || pAction->GetType() != PDFOBJ_DICTIONARY) {
+ return NULL;
+ }
+ return pAction->GetDict();
+}
+int CPDF_DocJSActions::FindJSAction(const CFX_ByteString& csName) const
+{
+ ASSERT(m_pDocument != NULL);
+ CPDF_NameTree name_tree(m_pDocument, FX_BSTRC("JavaScript"));
+ return name_tree.GetIndex(csName);
+}
diff --git a/core/src/fpdfdoc/doc_annot.cpp b/core/src/fpdfdoc/doc_annot.cpp
index da30485073..227578a974 100644
--- a/core/src/fpdfdoc/doc_annot.cpp
+++ b/core/src/fpdfdoc/doc_annot.cpp
@@ -1,519 +1,519 @@
-// 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
-
-#include "../../include/fpdfdoc/fpdf_doc.h"
-#include "../../include/fpdfapi/fpdf_pageobj.h"
-CPDF_AnnotList::CPDF_AnnotList(CPDF_Page* pPage)
-{
- ASSERT(pPage != NULL);
- m_pPageDict = pPage->m_pFormDict;
- if (m_pPageDict == NULL) {
- return;
- }
- m_pDocument = pPage->m_pDocument;
- CPDF_Array* pAnnots = m_pPageDict->GetArray("Annots");
- if (pAnnots == NULL) {
- return;
- }
- CPDF_Dictionary* pRoot = m_pDocument->GetRoot();
- CPDF_Dictionary* pAcroForm = pRoot->GetDict("AcroForm");
- FX_BOOL bRegenerateAP = pAcroForm && pAcroForm->GetBoolean("NeedAppearances");
- for (FX_DWORD i = 0; i < pAnnots->GetCount(); i ++) {
- CPDF_Dictionary* pDict = (CPDF_Dictionary*)pAnnots->GetElementValue(i);
- if (pDict == NULL || pDict->GetType() != PDFOBJ_DICTIONARY) {
- continue;
- }
- FX_DWORD dwObjNum = pDict->GetObjNum();
- if (dwObjNum == 0) {
- dwObjNum = m_pDocument->AddIndirectObject(pDict);
- CPDF_Reference* pAction = CPDF_Reference::Create(m_pDocument, dwObjNum);
- if (pAction == NULL) {
- break;
- }
- pAnnots->InsertAt(i, pAction);
- pAnnots->RemoveAt(i + 1);
- pDict = pAnnots->GetDict(i);
- }
- CPDF_Annot* pAnnot = FX_NEW CPDF_Annot(pDict);
- if (pAnnot == NULL) {
- break;
- }
- pAnnot->m_pList = this;
- m_AnnotList.Add(pAnnot);
- if (bRegenerateAP && pDict->GetConstString(FX_BSTRC("Subtype")) == FX_BSTRC("Widget"))
- if (CPDF_InterForm::UpdatingAPEnabled()) {
- FPDF_GenerateAP(m_pDocument, pDict);
- }
- }
-}
-CPDF_AnnotList::~CPDF_AnnotList()
-{
- int i = 0;
- for (i = 0; i < m_AnnotList.GetSize(); i ++) {
- delete (CPDF_Annot*)m_AnnotList[i];
- }
- for (i = 0; i < m_Borders.GetSize(); ++i) {
- delete (CPDF_PageObjects*)m_Borders[i];
- }
-}
-void CPDF_AnnotList::DisplayPass(const CPDF_Page* pPage, CFX_RenderDevice* pDevice,
- CPDF_RenderContext* pContext, FX_BOOL bPrinting, CFX_AffineMatrix* pMatrix,
- FX_BOOL bWidgetPass, CPDF_RenderOptions* pOptions, FX_RECT* clip_rect)
-{
- for (int i = 0; i < m_AnnotList.GetSize(); i ++) {
- CPDF_Annot* pAnnot = (CPDF_Annot*)m_AnnotList[i];
- FX_BOOL bWidget = pAnnot->GetSubType() == "Widget";
- if ((bWidgetPass && !bWidget) || (!bWidgetPass && bWidget)) {
- continue;
- }
- FX_DWORD annot_flags = pAnnot->GetFlags();
- if (annot_flags & ANNOTFLAG_HIDDEN) {
- continue;
- }
- if (bPrinting && (annot_flags & ANNOTFLAG_PRINT) == 0) {
- continue;
- }
- if (!bPrinting && (annot_flags & ANNOTFLAG_NOVIEW)) {
- continue;
- }
- if (pOptions != NULL) {
- IPDF_OCContext* pOCContext = pOptions->m_pOCContext;
- CPDF_Dictionary* pAnnotDict = pAnnot->m_pAnnotDict;
- if (pOCContext != NULL && pAnnotDict != NULL &&
- !pOCContext->CheckOCGVisible(pAnnotDict->GetDict(FX_BSTRC("OC")))) {
- continue;
- }
- }
- CPDF_Rect annot_rect_f;
- pAnnot->GetRect(annot_rect_f);
- CFX_Matrix matrix;
- matrix = *pMatrix;
- if (clip_rect) {
- annot_rect_f.Transform(&matrix);
- FX_RECT annot_rect = annot_rect_f.GetOutterRect();
- annot_rect.Intersect(*clip_rect);
- if (annot_rect.IsEmpty()) {
- continue;
- }
- }
- if (pContext) {
- pAnnot->DrawInContext(pPage, pContext, &matrix, CPDF_Annot::Normal);
- } else if (!pAnnot->DrawAppearance(pPage, pDevice, &matrix, CPDF_Annot::Normal, pOptions)) {
- pAnnot->DrawBorder(pDevice, &matrix, pOptions);
- }
- }
-}
-void CPDF_AnnotList::DisplayAnnots(const CPDF_Page* pPage, CFX_RenderDevice* pDevice,
- CFX_AffineMatrix* pUser2Device,
- FX_BOOL bShowWidget, CPDF_RenderOptions* pOptions)
-{
- FX_RECT clip_rect;
- if (pDevice) {
- clip_rect = pDevice->GetClipBox();
- }
- FX_BOOL bPrinting = pDevice->GetDeviceClass() == FXDC_PRINTER || (pOptions && (pOptions->m_Flags & RENDER_PRINTPREVIEW));
- DisplayAnnots(pPage, pDevice, NULL, bPrinting, pUser2Device, bShowWidget ? 3 : 1, pOptions, &clip_rect);
-}
-void CPDF_AnnotList::DisplayAnnots(const CPDF_Page* pPage, CFX_RenderDevice* pDevice, CPDF_RenderContext* pContext,
- FX_BOOL bPrinting, CFX_AffineMatrix* pUser2Device, FX_DWORD dwAnnotFlags,
- CPDF_RenderOptions* pOptions, FX_RECT* pClipRect)
-{
- if (dwAnnotFlags & 0x01) {
- DisplayPass(pPage, pDevice, pContext, bPrinting, pUser2Device, FALSE, pOptions, pClipRect);
- }
- if (dwAnnotFlags & 0x02) {
- DisplayPass(pPage, pDevice, pContext, bPrinting, pUser2Device, TRUE, pOptions, pClipRect);
- }
-}
-int CPDF_AnnotList::GetIndex(CPDF_Annot* pAnnot)
-{
- for (int i = 0; i < m_AnnotList.GetSize(); i ++)
- if (m_AnnotList[i] == (FX_LPVOID)pAnnot) {
- return i;
- }
- return -1;
-}
-CPDF_Annot::CPDF_Annot(CPDF_Dictionary* pDict)
-{
- m_pList = NULL;
- m_pAnnotDict = pDict;
-}
-CPDF_Annot::~CPDF_Annot()
-{
- ClearCachedAP();
-}
-CPDF_Reference* CPDF_Annot::NewAnnotRef()
-{
- if (m_pAnnotDict->GetObjNum() == 0) {
- m_pList->m_pDocument->AddIndirectObject(m_pAnnotDict);
- }
- return CPDF_Reference::Create(m_pList->m_pDocument, m_pAnnotDict->GetObjNum());
-}
-void CPDF_Annot::ClearCachedAP()
-{
- FX_POSITION pos = m_APMap.GetStartPosition();
- while (pos) {
- void* pForm;
- void* pObjects;
- m_APMap.GetNextAssoc(pos, pForm, pObjects);
- delete (CPDF_PageObjects*)pObjects;
- }
- m_APMap.RemoveAll();
-}
-CFX_ByteString CPDF_Annot::GetSubType() const
-{
- return m_pAnnotDict->GetConstString(FX_BSTRC("Subtype"));
-}
-void CPDF_Annot::GetRect(CPDF_Rect& rect) const
-{
- if (m_pAnnotDict == NULL) {
- return;
- }
- rect = m_pAnnotDict->GetRect("Rect");
- rect.Normalize();
-}
-CPDF_Stream* FPDFDOC_GetAnnotAP(CPDF_Dictionary* pAnnotDict, CPDF_Annot::AppearanceMode mode)
-{
- CPDF_Dictionary* pAP = pAnnotDict->GetDict("AP");
- if (pAP == NULL) {
- return NULL;
- }
- const FX_CHAR* ap_entry = "N";
- if (mode == CPDF_Annot::Down) {
- ap_entry = "D";
- } else if (mode == CPDF_Annot::Rollover) {
- ap_entry = "R";
- }
- if (!pAP->KeyExist(ap_entry)) {
- ap_entry = "N";
- }
- CPDF_Object* psub = pAP->GetElementValue(ap_entry);
- if (psub == NULL) {
- return NULL;
- }
- CPDF_Stream* pStream = NULL;
- if (psub->GetType() == PDFOBJ_STREAM) {
- pStream = (CPDF_Stream*)psub;
- } else if (psub->GetType() == PDFOBJ_DICTIONARY) {
- CFX_ByteString as = pAnnotDict->GetString("AS");
- if (as.IsEmpty()) {
- CFX_ByteString value = pAnnotDict->GetString(FX_BSTRC("V"));
- if (value.IsEmpty()) {
- value = pAnnotDict->GetDict(FX_BSTRC("Parent"))->GetString(FX_BSTRC("V"));
- }
- if (value.IsEmpty() || !((CPDF_Dictionary*)psub)->KeyExist(value)) {
- as = FX_BSTRC("Off");
- } else {
- as = value;
- }
- }
- pStream = ((CPDF_Dictionary*)psub)->GetStream(as);
- }
- return pStream;
-}
-CPDF_Form* CPDF_Annot::GetAPForm(const CPDF_Page* pPage, AppearanceMode mode)
-{
- CPDF_Stream* pStream = FPDFDOC_GetAnnotAP(m_pAnnotDict, mode);
- if (pStream == NULL) {
- return NULL;
- }
- CPDF_Form* pForm;
- if (m_APMap.Lookup(pStream, (void*&)pForm)) {
- return pForm;
- }
- pForm = FX_NEW CPDF_Form(m_pList->m_pDocument, pPage->m_pResources, pStream);
- if (pForm == NULL) {
- return NULL;
- }
- pForm->ParseContent(NULL, NULL, NULL, NULL);
- m_APMap.SetAt(pStream, pForm);
- return pForm;
-}
-static CPDF_Form* FPDFDOC_Annot_GetMatrix(const CPDF_Page* pPage, CPDF_Annot* pAnnot, CPDF_Annot::AppearanceMode mode, const CFX_AffineMatrix* pUser2Device, CFX_Matrix &matrix)
-{
- CPDF_Form* pForm = pAnnot->GetAPForm(pPage, mode);
- if (!pForm) {
- return NULL;
- }
- CFX_FloatRect form_bbox = pForm->m_pFormDict->GetRect(FX_BSTRC("BBox"));
- CFX_Matrix form_matrix = pForm->m_pFormDict->GetMatrix(FX_BSTRC("Matrix"));
- form_matrix.TransformRect(form_bbox);
- CPDF_Rect arect;
- pAnnot->GetRect(arect);
- matrix.MatchRect(arect, form_bbox);
- matrix.Concat(*pUser2Device);
- return pForm;
-}
-FX_BOOL CPDF_Annot::DrawAppearance(const CPDF_Page* pPage, CFX_RenderDevice* pDevice, const CFX_AffineMatrix* pUser2Device,
- AppearanceMode mode, const CPDF_RenderOptions* pOptions)
-{
- CFX_Matrix matrix;
- CPDF_Form* pForm = FPDFDOC_Annot_GetMatrix(pPage, this, mode, pUser2Device, matrix);
- if (!pForm) {
- return FALSE;
- }
- CPDF_RenderContext context;
- context.Create((CPDF_Page*)pPage);
- context.DrawObjectList(pDevice, pForm, &matrix, pOptions);
- return TRUE;
-}
-FX_BOOL CPDF_Annot::DrawInContext(const CPDF_Page* pPage, const CPDF_RenderContext* pContext, const CFX_AffineMatrix* pUser2Device, AppearanceMode mode)
-{
- CFX_Matrix matrix;
- CPDF_Form* pForm = FPDFDOC_Annot_GetMatrix(pPage, this, mode, pUser2Device, matrix);
- if (!pForm) {
- return FALSE;
- }
- ((CPDF_RenderContext*)pContext)->AppendObjectList(pForm, &matrix);
- return TRUE;
-}
-CPDF_PageObject* CPDF_Annot::GetBorder(FX_BOOL bPrint, const CPDF_RenderOptions* pOptions)
-{
- if (GetSubType() == "Popup") {
- return NULL;
- }
- FX_DWORD annot_flags = GetFlags();
- if (annot_flags & ANNOTFLAG_HIDDEN) {
- return NULL;
- }
- FX_BOOL bPrinting = bPrint || (pOptions && (pOptions->m_Flags & RENDER_PRINTPREVIEW));
- if (bPrinting && (annot_flags & ANNOTFLAG_PRINT) == 0) {
- return NULL;
- }
- if (!bPrinting && (annot_flags & ANNOTFLAG_NOVIEW)) {
- return NULL;
- }
- CPDF_Dictionary* pBS = m_pAnnotDict->GetDict("BS");
- char style_char;
- FX_FLOAT width;
- CPDF_Array* pDashArray = NULL;
- if (pBS == NULL) {
- CPDF_Array* pBorderArray = m_pAnnotDict->GetArray("Border");
- style_char = 'S';
- if (pBorderArray) {
- width = pBorderArray->GetNumber(2);
- if (pBorderArray->GetCount() == 4) {
- pDashArray = pBorderArray->GetArray(3);
- if (pDashArray == NULL) {
- return NULL;
- }
- style_char = 'D';
- }
- } else {
- width = 1;
- }
- } else {
- CFX_ByteString style = pBS->GetString("S");
- pDashArray = pBS->GetArray("D");
- style_char = style[1];
- width = pBS->GetNumber("W");
- }
- if (width <= 0) {
- return NULL;
- }
- CPDF_Array* pColor = m_pAnnotDict->GetArray("C");
- FX_DWORD argb = 0xff000000;
- if (pColor != NULL) {
- int R = (FX_INT32)(pColor->GetNumber(0) * 255);
- int G = (FX_INT32)(pColor->GetNumber(1) * 255);
- int B = (FX_INT32)(pColor->GetNumber(2) * 255);
- argb = ArgbEncode(0xff, R, G, B);
- }
- CPDF_PathObject *pPathObject = FX_NEW CPDF_PathObject();
- if (!pPathObject) {
- return NULL;
- }
- CPDF_GraphStateData *pGraphState = pPathObject->m_GraphState.GetModify();
- if (!pGraphState) {
- pPathObject->Release();
- return NULL;
- }
- pGraphState->m_LineWidth = width;
- CPDF_ColorStateData *pColorData = pPathObject->m_ColorState.GetModify();
- if (!pColorData) {
- pPathObject->Release();
- return NULL;
- }
- pColorData->m_StrokeRGB = argb;
- pPathObject->m_bStroke = TRUE;
- pPathObject->m_FillType = 0;
- if (style_char == 'D') {
- if (pDashArray) {
- FX_DWORD dash_count = pDashArray->GetCount();
- if (dash_count % 2) {
- dash_count ++;
- }
- pGraphState->m_DashArray = FX_Alloc(FX_FLOAT, dash_count);
- if (pGraphState->m_DashArray == NULL) {
- pPathObject->Release();
- return NULL;
- }
- pGraphState->m_DashCount = dash_count;
- FX_DWORD i;
- for (i = 0; i < pDashArray->GetCount(); i ++) {
- pGraphState->m_DashArray[i] = pDashArray->GetNumber(i);
- }
- if (i < dash_count) {
- pGraphState->m_DashArray[i] = pGraphState->m_DashArray[i - 1];
- }
- } else {
- pGraphState->m_DashArray = FX_Alloc(FX_FLOAT, 2);
- if (pGraphState->m_DashArray == NULL) {
- pPathObject->Release();
- return NULL;
- }
- pGraphState->m_DashCount = 2;
- pGraphState->m_DashArray[0] = pGraphState->m_DashArray[1] = 3 * 1.0f;
- }
- }
- CFX_FloatRect rect;
- GetRect(rect);
- width /= 2;
- CPDF_PathData *pPathData = pPathObject->m_Path.GetModify();
- if (pPathData) {
- pPathData->AppendRect(rect.left + width, rect.bottom + width, rect.right - width, rect.top - width);
- }
- pPathObject->CalcBoundingBox();
- return pPathObject;
-}
-void CPDF_Annot::DrawBorder(CFX_RenderDevice* pDevice, const CFX_AffineMatrix* pUser2Device, const CPDF_RenderOptions* pOptions)
-{
- if (GetSubType() == "Popup") {
- return;
- }
- FX_DWORD annot_flags = GetFlags();
- if (annot_flags & ANNOTFLAG_HIDDEN) {
- return;
- }
- FX_BOOL bPrinting = pDevice->GetDeviceClass() == FXDC_PRINTER || (pOptions && (pOptions->m_Flags & RENDER_PRINTPREVIEW));
- if (bPrinting && (annot_flags & ANNOTFLAG_PRINT) == 0) {
- return;
- }
- if (!bPrinting && (annot_flags & ANNOTFLAG_NOVIEW)) {
- return;
- }
- CPDF_Dictionary* pBS = m_pAnnotDict->GetDict("BS");
- char style_char;
- FX_FLOAT width;
- CPDF_Array* pDashArray = NULL;
- if (pBS == NULL) {
- CPDF_Array* pBorderArray = m_pAnnotDict->GetArray("Border");
- style_char = 'S';
- if (pBorderArray) {
- width = pBorderArray->GetNumber(2);
- if (pBorderArray->GetCount() == 4) {
- pDashArray = pBorderArray->GetArray(3);
- if (pDashArray == NULL) {
- return;
- }
- int nLen = pDashArray->GetCount();
- int i = 0;
- for (; i < nLen; ++i) {
- CPDF_Object*pObj = pDashArray->GetElementValue(i);
- if (pObj && pObj->GetInteger()) {
- break;
- }
- }
- if (i == nLen) {
- return;
- }
- style_char = 'D';
- }
- } else {
- width = 1;
- }
- } else {
- CFX_ByteString style = pBS->GetString("S");
- pDashArray = pBS->GetArray("D");
- style_char = style[1];
- width = pBS->GetNumber("W");
- }
- if (width <= 0) {
- return;
- }
- CPDF_Array* pColor = m_pAnnotDict->GetArray("C");
- FX_DWORD argb = 0xff000000;
- if (pColor != NULL) {
- int R = (FX_INT32)(pColor->GetNumber(0) * 255);
- int G = (FX_INT32)(pColor->GetNumber(1) * 255);
- int B = (FX_INT32)(pColor->GetNumber(2) * 255);
- argb = ArgbEncode(0xff, R, G, B);
- }
- CPDF_GraphStateData graph_state;
- graph_state.m_LineWidth = width;
- if (style_char == 'D') {
- if (pDashArray) {
- FX_DWORD dash_count = pDashArray->GetCount();
- if (dash_count % 2) {
- dash_count ++;
- }
- graph_state.m_DashArray = FX_Alloc(FX_FLOAT, dash_count);
- if (graph_state.m_DashArray == NULL) {
- return ;
- }
- graph_state.m_DashCount = dash_count;
- FX_DWORD i;
- for (i = 0; i < pDashArray->GetCount(); i ++) {
- graph_state.m_DashArray[i] = pDashArray->GetNumber(i);
- }
- if (i < dash_count) {
- graph_state.m_DashArray[i] = graph_state.m_DashArray[i - 1];
- }
- } else {
- graph_state.m_DashArray = FX_Alloc(FX_FLOAT, 2);
- if (graph_state.m_DashArray == NULL) {
- return ;
- }
- graph_state.m_DashCount = 2;
- graph_state.m_DashArray[0] = graph_state.m_DashArray[1] = 3 * 1.0f;
- }
- }
- CFX_FloatRect rect;
- GetRect(rect);
- CPDF_PathData path;
- width /= 2;
- path.AppendRect(rect.left + width, rect.bottom + width, rect.right - width, rect.top - width);
- int fill_type = 0;
- if (pOptions && (pOptions->m_Flags & RENDER_NOPATHSMOOTH)) {
- fill_type |= FXFILL_NOPATHSMOOTH;
- }
- pDevice->DrawPath(&path, pUser2Device, &graph_state, argb, argb, fill_type);
-}
-int CPDF_Annot::CountIRTNotes()
-{
- int count = 0;
- for (int i = 0; i < m_pList->Count(); i ++) {
- CPDF_Annot* pAnnot = m_pList->GetAt(i);
- if (pAnnot == NULL) {
- continue;
- }
- CPDF_Dictionary* pIRT = pAnnot->m_pAnnotDict->GetDict("IRT");
- if (pIRT != m_pAnnotDict) {
- continue;
- }
- count ++;
- }
- return count;
-}
-CPDF_Annot* CPDF_Annot::GetIRTNote(int index)
-{
- int count = 0;
- for (int i = 0; i < m_pList->Count(); i ++) {
- CPDF_Annot* pAnnot = m_pList->GetAt(i);
- if (pAnnot == NULL) {
- continue;
- }
- CPDF_Dictionary* pIRT = pAnnot->m_pAnnotDict->GetDict("IRT");
- if (pIRT != m_pAnnotDict) {
- continue;
- }
- if (count == index) {
- return pAnnot;
- }
- count ++;
- }
- return NULL;
-}
+// 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
+
+#include "../../include/fpdfdoc/fpdf_doc.h"
+#include "../../include/fpdfapi/fpdf_pageobj.h"
+CPDF_AnnotList::CPDF_AnnotList(CPDF_Page* pPage)
+{
+ ASSERT(pPage != NULL);
+ m_pPageDict = pPage->m_pFormDict;
+ if (m_pPageDict == NULL) {
+ return;
+ }
+ m_pDocument = pPage->m_pDocument;
+ CPDF_Array* pAnnots = m_pPageDict->GetArray("Annots");
+ if (pAnnots == NULL) {
+ return;
+ }
+ CPDF_Dictionary* pRoot = m_pDocument->GetRoot();
+ CPDF_Dictionary* pAcroForm = pRoot->GetDict("AcroForm");
+ FX_BOOL bRegenerateAP = pAcroForm && pAcroForm->GetBoolean("NeedAppearances");
+ for (FX_DWORD i = 0; i < pAnnots->GetCount(); i ++) {
+ CPDF_Dictionary* pDict = (CPDF_Dictionary*)pAnnots->GetElementValue(i);
+ if (pDict == NULL || pDict->GetType() != PDFOBJ_DICTIONARY) {
+ continue;
+ }
+ FX_DWORD dwObjNum = pDict->GetObjNum();
+ if (dwObjNum == 0) {
+ dwObjNum = m_pDocument->AddIndirectObject(pDict);
+ CPDF_Reference* pAction = CPDF_Reference::Create(m_pDocument, dwObjNum);
+ if (pAction == NULL) {
+ break;
+ }
+ pAnnots->InsertAt(i, pAction);
+ pAnnots->RemoveAt(i + 1);
+ pDict = pAnnots->GetDict(i);
+ }
+ CPDF_Annot* pAnnot = FX_NEW CPDF_Annot(pDict);
+ if (pAnnot == NULL) {
+ break;
+ }
+ pAnnot->m_pList = this;
+ m_AnnotList.Add(pAnnot);
+ if (bRegenerateAP && pDict->GetConstString(FX_BSTRC("Subtype")) == FX_BSTRC("Widget"))
+ if (CPDF_InterForm::UpdatingAPEnabled()) {
+ FPDF_GenerateAP(m_pDocument, pDict);
+ }
+ }
+}
+CPDF_AnnotList::~CPDF_AnnotList()
+{
+ int i = 0;
+ for (i = 0; i < m_AnnotList.GetSize(); i ++) {
+ delete (CPDF_Annot*)m_AnnotList[i];
+ }
+ for (i = 0; i < m_Borders.GetSize(); ++i) {
+ delete (CPDF_PageObjects*)m_Borders[i];
+ }
+}
+void CPDF_AnnotList::DisplayPass(const CPDF_Page* pPage, CFX_RenderDevice* pDevice,
+ CPDF_RenderContext* pContext, FX_BOOL bPrinting, CFX_AffineMatrix* pMatrix,
+ FX_BOOL bWidgetPass, CPDF_RenderOptions* pOptions, FX_RECT* clip_rect)
+{
+ for (int i = 0; i < m_AnnotList.GetSize(); i ++) {
+ CPDF_Annot* pAnnot = (CPDF_Annot*)m_AnnotList[i];
+ FX_BOOL bWidget = pAnnot->GetSubType() == "Widget";
+ if ((bWidgetPass && !bWidget) || (!bWidgetPass && bWidget)) {
+ continue;
+ }
+ FX_DWORD annot_flags = pAnnot->GetFlags();
+ if (annot_flags & ANNOTFLAG_HIDDEN) {
+ continue;
+ }
+ if (bPrinting && (annot_flags & ANNOTFLAG_PRINT) == 0) {
+ continue;
+ }
+ if (!bPrinting && (annot_flags & ANNOTFLAG_NOVIEW)) {
+ continue;
+ }
+ if (pOptions != NULL) {
+ IPDF_OCContext* pOCContext = pOptions->m_pOCContext;
+ CPDF_Dictionary* pAnnotDict = pAnnot->m_pAnnotDict;
+ if (pOCContext != NULL && pAnnotDict != NULL &&
+ !pOCContext->CheckOCGVisible(pAnnotDict->GetDict(FX_BSTRC("OC")))) {
+ continue;
+ }
+ }
+ CPDF_Rect annot_rect_f;
+ pAnnot->GetRect(annot_rect_f);
+ CFX_Matrix matrix;
+ matrix = *pMatrix;
+ if (clip_rect) {
+ annot_rect_f.Transform(&matrix);
+ FX_RECT annot_rect = annot_rect_f.GetOutterRect();
+ annot_rect.Intersect(*clip_rect);
+ if (annot_rect.IsEmpty()) {
+ continue;
+ }
+ }
+ if (pContext) {
+ pAnnot->DrawInContext(pPage, pContext, &matrix, CPDF_Annot::Normal);
+ } else if (!pAnnot->DrawAppearance(pPage, pDevice, &matrix, CPDF_Annot::Normal, pOptions)) {
+ pAnnot->DrawBorder(pDevice, &matrix, pOptions);
+ }
+ }
+}
+void CPDF_AnnotList::DisplayAnnots(const CPDF_Page* pPage, CFX_RenderDevice* pDevice,
+ CFX_AffineMatrix* pUser2Device,
+ FX_BOOL bShowWidget, CPDF_RenderOptions* pOptions)
+{
+ FX_RECT clip_rect;
+ if (pDevice) {
+ clip_rect = pDevice->GetClipBox();
+ }
+ FX_BOOL bPrinting = pDevice->GetDeviceClass() == FXDC_PRINTER || (pOptions && (pOptions->m_Flags & RENDER_PRINTPREVIEW));
+ DisplayAnnots(pPage, pDevice, NULL, bPrinting, pUser2Device, bShowWidget ? 3 : 1, pOptions, &clip_rect);
+}
+void CPDF_AnnotList::DisplayAnnots(const CPDF_Page* pPage, CFX_RenderDevice* pDevice, CPDF_RenderContext* pContext,
+ FX_BOOL bPrinting, CFX_AffineMatrix* pUser2Device, FX_DWORD dwAnnotFlags,
+ CPDF_RenderOptions* pOptions, FX_RECT* pClipRect)
+{
+ if (dwAnnotFlags & 0x01) {
+ DisplayPass(pPage, pDevice, pContext, bPrinting, pUser2Device, FALSE, pOptions, pClipRect);
+ }
+ if (dwAnnotFlags & 0x02) {
+ DisplayPass(pPage, pDevice, pContext, bPrinting, pUser2Device, TRUE, pOptions, pClipRect);
+ }
+}
+int CPDF_AnnotList::GetIndex(CPDF_Annot* pAnnot)
+{
+ for (int i = 0; i < m_AnnotList.GetSize(); i ++)
+ if (m_AnnotList[i] == (FX_LPVOID)pAnnot) {
+ return i;
+ }
+ return -1;
+}
+CPDF_Annot::CPDF_Annot(CPDF_Dictionary* pDict)
+{
+ m_pList = NULL;
+ m_pAnnotDict = pDict;
+}
+CPDF_Annot::~CPDF_Annot()
+{
+ ClearCachedAP();
+}
+CPDF_Reference* CPDF_Annot::NewAnnotRef()
+{
+ if (m_pAnnotDict->GetObjNum() == 0) {
+ m_pList->m_pDocument->AddIndirectObject(m_pAnnotDict);
+ }
+ return CPDF_Reference::Create(m_pList->m_pDocument, m_pAnnotDict->GetObjNum());
+}
+void CPDF_Annot::ClearCachedAP()
+{
+ FX_POSITION pos = m_APMap.GetStartPosition();
+ while (pos) {
+ void* pForm;
+ void* pObjects;
+ m_APMap.GetNextAssoc(pos, pForm, pObjects);
+ delete (CPDF_PageObjects*)pObjects;
+ }
+ m_APMap.RemoveAll();
+}
+CFX_ByteString CPDF_Annot::GetSubType() const
+{
+ return m_pAnnotDict->GetConstString(FX_BSTRC("Subtype"));
+}
+void CPDF_Annot::GetRect(CPDF_Rect& rect) const
+{
+ if (m_pAnnotDict == NULL) {
+ return;
+ }
+ rect = m_pAnnotDict->GetRect("Rect");
+ rect.Normalize();
+}
+CPDF_Stream* FPDFDOC_GetAnnotAP(CPDF_Dictionary* pAnnotDict, CPDF_Annot::AppearanceMode mode)
+{
+ CPDF_Dictionary* pAP = pAnnotDict->GetDict("AP");
+ if (pAP == NULL) {
+ return NULL;
+ }
+ const FX_CHAR* ap_entry = "N";
+ if (mode == CPDF_Annot::Down) {
+ ap_entry = "D";
+ } else if (mode == CPDF_Annot::Rollover) {
+ ap_entry = "R";
+ }
+ if (!pAP->KeyExist(ap_entry)) {
+ ap_entry = "N";
+ }
+ CPDF_Object* psub = pAP->GetElementValue(ap_entry);
+ if (psub == NULL) {
+ return NULL;
+ }
+ CPDF_Stream* pStream = NULL;
+ if (psub->GetType() == PDFOBJ_STREAM) {
+ pStream = (CPDF_Stream*)psub;
+ } else if (psub->GetType() == PDFOBJ_DICTIONARY) {
+ CFX_ByteString as = pAnnotDict->GetString("AS");
+ if (as.IsEmpty()) {
+ CFX_ByteString value = pAnnotDict->GetString(FX_BSTRC("V"));
+ if (value.IsEmpty()) {
+ value = pAnnotDict->GetDict(FX_BSTRC("Parent"))->GetString(FX_BSTRC("V"));
+ }
+ if (value.IsEmpty() || !((CPDF_Dictionary*)psub)->KeyExist(value)) {
+ as = FX_BSTRC("Off");
+ } else {
+ as = value;
+ }
+ }
+ pStream = ((CPDF_Dictionary*)psub)->GetStream(as);
+ }
+ return pStream;
+}
+CPDF_Form* CPDF_Annot::GetAPForm(const CPDF_Page* pPage, AppearanceMode mode)
+{
+ CPDF_Stream* pStream = FPDFDOC_GetAnnotAP(m_pAnnotDict, mode);
+ if (pStream == NULL) {
+ return NULL;
+ }
+ CPDF_Form* pForm;
+ if (m_APMap.Lookup(pStream, (void*&)pForm)) {
+ return pForm;
+ }
+ pForm = FX_NEW CPDF_Form(m_pList->m_pDocument, pPage->m_pResources, pStream);
+ if (pForm == NULL) {
+ return NULL;
+ }
+ pForm->ParseContent(NULL, NULL, NULL, NULL);
+ m_APMap.SetAt(pStream, pForm);
+ return pForm;
+}
+static CPDF_Form* FPDFDOC_Annot_GetMatrix(const CPDF_Page* pPage, CPDF_Annot* pAnnot, CPDF_Annot::AppearanceMode mode, const CFX_AffineMatrix* pUser2Device, CFX_Matrix &matrix)
+{
+ CPDF_Form* pForm = pAnnot->GetAPForm(pPage, mode);
+ if (!pForm) {
+ return NULL;
+ }
+ CFX_FloatRect form_bbox = pForm->m_pFormDict->GetRect(FX_BSTRC("BBox"));
+ CFX_Matrix form_matrix = pForm->m_pFormDict->GetMatrix(FX_BSTRC("Matrix"));
+ form_matrix.TransformRect(form_bbox);
+ CPDF_Rect arect;
+ pAnnot->GetRect(arect);
+ matrix.MatchRect(arect, form_bbox);
+ matrix.Concat(*pUser2Device);
+ return pForm;
+}
+FX_BOOL CPDF_Annot::DrawAppearance(const CPDF_Page* pPage, CFX_RenderDevice* pDevice, const CFX_AffineMatrix* pUser2Device,
+ AppearanceMode mode, const CPDF_RenderOptions* pOptions)
+{
+ CFX_Matrix matrix;
+ CPDF_Form* pForm = FPDFDOC_Annot_GetMatrix(pPage, this, mode, pUser2Device, matrix);
+ if (!pForm) {
+ return FALSE;
+ }
+ CPDF_RenderContext context;
+ context.Create((CPDF_Page*)pPage);
+ context.DrawObjectList(pDevice, pForm, &matrix, pOptions);
+ return TRUE;
+}
+FX_BOOL CPDF_Annot::DrawInContext(const CPDF_Page* pPage, const CPDF_RenderContext* pContext, const CFX_AffineMatrix* pUser2Device, AppearanceMode mode)
+{
+ CFX_Matrix matrix;
+ CPDF_Form* pForm = FPDFDOC_Annot_GetMatrix(pPage, this, mode, pUser2Device, matrix);
+ if (!pForm) {
+ return FALSE;
+ }
+ ((CPDF_RenderContext*)pContext)->AppendObjectList(pForm, &matrix);
+ return TRUE;
+}
+CPDF_PageObject* CPDF_Annot::GetBorder(FX_BOOL bPrint, const CPDF_RenderOptions* pOptions)
+{
+ if (GetSubType() == "Popup") {
+ return NULL;
+ }
+ FX_DWORD annot_flags = GetFlags();
+ if (annot_flags & ANNOTFLAG_HIDDEN) {
+ return NULL;
+ }
+ FX_BOOL bPrinting = bPrint || (pOptions && (pOptions->m_Flags & RENDER_PRINTPREVIEW));
+ if (bPrinting && (annot_flags & ANNOTFLAG_PRINT) == 0) {
+ return NULL;
+ }
+ if (!bPrinting && (annot_flags & ANNOTFLAG_NOVIEW)) {
+ return NULL;
+ }
+ CPDF_Dictionary* pBS = m_pAnnotDict->GetDict("BS");
+ char style_char;
+ FX_FLOAT width;
+ CPDF_Array* pDashArray = NULL;
+ if (pBS == NULL) {
+ CPDF_Array* pBorderArray = m_pAnnotDict->GetArray("Border");
+ style_char = 'S';
+ if (pBorderArray) {
+ width = pBorderArray->GetNumber(2);
+ if (pBorderArray->GetCount() == 4) {
+ pDashArray = pBorderArray->GetArray(3);
+ if (pDashArray == NULL) {
+ return NULL;
+ }
+ style_char = 'D';
+ }
+ } else {
+ width = 1;
+ }
+ } else {
+ CFX_ByteString style = pBS->GetString("S");
+ pDashArray = pBS->GetArray("D");
+ style_char = style[1];
+ width = pBS->GetNumber("W");
+ }
+ if (width <= 0) {
+ return NULL;
+ }
+ CPDF_Array* pColor = m_pAnnotDict->GetArray("C");
+ FX_DWORD argb = 0xff000000;
+ if (pColor != NULL) {
+ int R = (FX_INT32)(pColor->GetNumber(0) * 255);
+ int G = (FX_INT32)(pColor->GetNumber(1) * 255);
+ int B = (FX_INT32)(pColor->GetNumber(2) * 255);
+ argb = ArgbEncode(0xff, R, G, B);
+ }
+ CPDF_PathObject *pPathObject = FX_NEW CPDF_PathObject();
+ if (!pPathObject) {
+ return NULL;
+ }
+ CPDF_GraphStateData *pGraphState = pPathObject->m_GraphState.GetModify();
+ if (!pGraphState) {
+ pPathObject->Release();
+ return NULL;
+ }
+ pGraphState->m_LineWidth = width;
+ CPDF_ColorStateData *pColorData = pPathObject->m_ColorState.GetModify();
+ if (!pColorData) {
+ pPathObject->Release();
+ return NULL;
+ }
+ pColorData->m_StrokeRGB = argb;
+ pPathObject->m_bStroke = TRUE;
+ pPathObject->m_FillType = 0;
+ if (style_char == 'D') {
+ if (pDashArray) {
+ FX_DWORD dash_count = pDashArray->GetCount();
+ if (dash_count % 2) {
+ dash_count ++;
+ }
+ pGraphState->m_DashArray = FX_Alloc(FX_FLOAT, dash_count);
+ if (pGraphState->m_DashArray == NULL) {
+ pPathObject->Release();
+ return NULL;
+ }
+ pGraphState->m_DashCount = dash_count;
+ FX_DWORD i;
+ for (i = 0; i < pDashArray->GetCount(); i ++) {
+ pGraphState->m_DashArray[i] = pDashArray->GetNumber(i);
+ }
+ if (i < dash_count) {
+ pGraphState->m_DashArray[i] = pGraphState->m_DashArray[i - 1];
+ }
+ } else {
+ pGraphState->m_DashArray = FX_Alloc(FX_FLOAT, 2);
+ if (pGraphState->m_DashArray == NULL) {
+ pPathObject->Release();
+ return NULL;
+ }
+ pGraphState->m_DashCount = 2;
+ pGraphState->m_DashArray[0] = pGraphState->m_DashArray[1] = 3 * 1.0f;
+ }
+ }
+ CFX_FloatRect rect;
+ GetRect(rect);
+ width /= 2;
+ CPDF_PathData *pPathData = pPathObject->m_Path.GetModify();
+ if (pPathData) {
+ pPathData->AppendRect(rect.left + width, rect.bottom + width, rect.right - width, rect.top - width);
+ }
+ pPathObject->CalcBoundingBox();
+ return pPathObject;
+}
+void CPDF_Annot::DrawBorder(CFX_RenderDevice* pDevice, const CFX_AffineMatrix* pUser2Device, const CPDF_RenderOptions* pOptions)
+{
+ if (GetSubType() == "Popup") {
+ return;
+ }
+ FX_DWORD annot_flags = GetFlags();
+ if (annot_flags & ANNOTFLAG_HIDDEN) {
+ return;
+ }
+ FX_BOOL bPrinting = pDevice->GetDeviceClass() == FXDC_PRINTER || (pOptions && (pOptions->m_Flags & RENDER_PRINTPREVIEW));
+ if (bPrinting && (annot_flags & ANNOTFLAG_PRINT) == 0) {
+ return;
+ }
+ if (!bPrinting && (annot_flags & ANNOTFLAG_NOVIEW)) {
+ return;
+ }
+ CPDF_Dictionary* pBS = m_pAnnotDict->GetDict("BS");
+ char style_char;
+ FX_FLOAT width;
+ CPDF_Array* pDashArray = NULL;
+ if (pBS == NULL) {
+ CPDF_Array* pBorderArray = m_pAnnotDict->GetArray("Border");
+ style_char = 'S';
+ if (pBorderArray) {
+ width = pBorderArray->GetNumber(2);
+ if (pBorderArray->GetCount() == 4) {
+ pDashArray = pBorderArray->GetArray(3);
+ if (pDashArray == NULL) {
+ return;
+ }
+ int nLen = pDashArray->GetCount();
+ int i = 0;
+ for (; i < nLen; ++i) {
+ CPDF_Object*pObj = pDashArray->GetElementValue(i);
+ if (pObj && pObj->GetInteger()) {
+ break;
+ }
+ }
+ if (i == nLen) {
+ return;
+ }
+ style_char = 'D';
+ }
+ } else {
+ width = 1;
+ }
+ } else {
+ CFX_ByteString style = pBS->GetString("S");
+ pDashArray = pBS->GetArray("D");
+ style_char = style[1];
+ width = pBS->GetNumber("W");
+ }
+ if (width <= 0) {
+ return;
+ }
+ CPDF_Array* pColor = m_pAnnotDict->GetArray("C");
+ FX_DWORD argb = 0xff000000;
+ if (pColor != NULL) {
+ int R = (FX_INT32)(pColor->GetNumber(0) * 255);
+ int G = (FX_INT32)(pColor->GetNumber(1) * 255);
+ int B = (FX_INT32)(pColor->GetNumber(2) * 255);
+ argb = ArgbEncode(0xff, R, G, B);
+ }
+ CPDF_GraphStateData graph_state;
+ graph_state.m_LineWidth = width;
+ if (style_char == 'D') {
+ if (pDashArray) {
+ FX_DWORD dash_count = pDashArray->GetCount();
+ if (dash_count % 2) {
+ dash_count ++;
+ }
+ graph_state.m_DashArray = FX_Alloc(FX_FLOAT, dash_count);
+ if (graph_state.m_DashArray == NULL) {
+ return ;
+ }
+ graph_state.m_DashCount = dash_count;
+ FX_DWORD i;
+ for (i = 0; i < pDashArray->GetCount(); i ++) {
+ graph_state.m_DashArray[i] = pDashArray->GetNumber(i);
+ }
+ if (i < dash_count) {
+ graph_state.m_DashArray[i] = graph_state.m_DashArray[i - 1];
+ }
+ } else {
+ graph_state.m_DashArray = FX_Alloc(FX_FLOAT, 2);
+ if (graph_state.m_DashArray == NULL) {
+ return ;
+ }
+ graph_state.m_DashCount = 2;
+ graph_state.m_DashArray[0] = graph_state.m_DashArray[1] = 3 * 1.0f;
+ }
+ }
+ CFX_FloatRect rect;
+ GetRect(rect);
+ CPDF_PathData path;
+ width /= 2;
+ path.AppendRect(rect.left + width, rect.bottom + width, rect.right - width, rect.top - width);
+ int fill_type = 0;
+ if (pOptions && (pOptions->m_Flags & RENDER_NOPATHSMOOTH)) {
+ fill_type |= FXFILL_NOPATHSMOOTH;
+ }
+ pDevice->DrawPath(&path, pUser2Device, &graph_state, argb, argb, fill_type);
+}
+int CPDF_Annot::CountIRTNotes()
+{
+ int count = 0;
+ for (int i = 0; i < m_pList->Count(); i ++) {
+ CPDF_Annot* pAnnot = m_pList->GetAt(i);
+ if (pAnnot == NULL) {
+ continue;
+ }
+ CPDF_Dictionary* pIRT = pAnnot->m_pAnnotDict->GetDict("IRT");
+ if (pIRT != m_pAnnotDict) {
+ continue;
+ }
+ count ++;
+ }
+ return count;
+}
+CPDF_Annot* CPDF_Annot::GetIRTNote(int index)
+{
+ int count = 0;
+ for (int i = 0; i < m_pList->Count(); i ++) {
+ CPDF_Annot* pAnnot = m_pList->GetAt(i);
+ if (pAnnot == NULL) {
+ continue;
+ }
+ CPDF_Dictionary* pIRT = pAnnot->m_pAnnotDict->GetDict("IRT");
+ if (pIRT != m_pAnnotDict) {
+ continue;
+ }
+ if (count == index) {
+ return pAnnot;
+ }
+ count ++;
+ }
+ return NULL;
+}
diff --git a/core/src/fpdfdoc/doc_ap.cpp b/core/src/fpdfdoc/doc_ap.cpp
index 0afe718fcd..784d89daed 100644
--- a/core/src/fpdfdoc/doc_ap.cpp
+++ b/core/src/fpdfdoc/doc_ap.cpp
@@ -1,808 +1,808 @@
-// 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
-
-#include "../../include/fpdfdoc/fpdf_doc.h"
-#include "../../include/fpdfdoc/fpdf_vt.h"
-#include "pdf_vt.h"
-#include "../../include/fpdfdoc/fpdf_ap.h"
-FX_BOOL FPDF_GenerateAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict)
-{
- if (pAnnotDict->GetConstString("Subtype") != FX_BSTRC("Widget")) {
- return FALSE;
- }
- CFX_ByteString field_type = FPDF_GetFieldAttr(pAnnotDict, "FT")->GetString();
- FX_DWORD flags = FPDF_GetFieldAttr(pAnnotDict, "Ff")->GetInteger();
- if (field_type == "Tx") {
- return CPVT_GenerateAP::GenerateTextFieldAP(pDoc, pAnnotDict);
- } else if (field_type == "Ch") {
- if (flags & (1 << 17)) {
- return CPVT_GenerateAP::GenerateComboBoxAP(pDoc, pAnnotDict);
- } else {
- return CPVT_GenerateAP::GenerateListBoxAP(pDoc, pAnnotDict);
- }
- } else if (field_type == "Btn") {
- if (!(flags & (1 << 16))) {
- if (!pAnnotDict->KeyExist("AS")) {
- if (CPDF_Dictionary* pParentDict = pAnnotDict->GetDict("Parent")) {
- if (pParentDict->KeyExist("AS")) {
- pAnnotDict->SetAtString("AS", pParentDict->GetString("AS"));
- }
- }
- }
- }
- }
- return FALSE;
-}
-class CPVT_FontMap : public IPVT_FontMap
-{
-public:
- CPVT_FontMap(CPDF_Document * pDoc, CPDF_Dictionary * pResDict, CPDF_Font * pDefFont,
- const CFX_ByteString & sDefFontAlias);
- virtual ~CPVT_FontMap();
- CPDF_Font* GetPDFFont(FX_INT32 nFontIndex);
- CFX_ByteString GetPDFFontAlias(FX_INT32 nFontIndex);
- static void GetAnnotSysPDFFont(CPDF_Document * pDoc, CPDF_Dictionary * pResDict,
- CPDF_Font * & pSysFont, CFX_ByteString & sSysFontAlias);
-private:
- CPDF_Document* m_pDocument;
- CPDF_Dictionary* m_pResDict;
- CPDF_Font* m_pDefFont;
- CFX_ByteString m_sDefFontAlias;
- CPDF_Font* m_pSysFont;
- CFX_ByteString m_sSysFontAlias;
-};
-CPVT_FontMap::CPVT_FontMap(CPDF_Document * pDoc, CPDF_Dictionary * pResDict, CPDF_Font * pDefFont,
- const CFX_ByteString & sDefFontAlias) :
- m_pDocument(pDoc),
- m_pResDict(pResDict),
- m_pDefFont(pDefFont),
- m_sDefFontAlias(sDefFontAlias),
- m_pSysFont(NULL),
- m_sSysFontAlias()
-{
-}
-CPVT_FontMap::~CPVT_FontMap()
-{
-}
-extern CPDF_Font* AddNativeInterFormFont(CPDF_Dictionary*& pFormDict, CPDF_Document* pDocument, CFX_ByteString& csNameTag);
-void CPVT_FontMap::GetAnnotSysPDFFont(CPDF_Document * pDoc, CPDF_Dictionary * pResDict,
- CPDF_Font * & pSysFont, CFX_ByteString & sSysFontAlias)
-{
- if (pDoc && pResDict) {
- CFX_ByteString sFontAlias;
- CPDF_Dictionary* pFormDict = pDoc->GetRoot()->GetDict("AcroForm");
- if (CPDF_Font * pPDFFont = AddNativeInterFormFont(pFormDict, pDoc, sSysFontAlias)) {
- if (CPDF_Dictionary * pFontList = pResDict->GetDict("Font")) {
- if (!pFontList->KeyExist(sSysFontAlias)) {
- pFontList->SetAtReference(sSysFontAlias, pDoc, pPDFFont->GetFontDict());
- }
- }
- pSysFont = pPDFFont;
- }
- }
-}
-CPDF_Font* CPVT_FontMap::GetPDFFont(FX_INT32 nFontIndex)
-{
- switch (nFontIndex) {
- case 0:
- return m_pDefFont;
- case 1:
- if (!m_pSysFont) {
- GetAnnotSysPDFFont(m_pDocument, m_pResDict, m_pSysFont, m_sSysFontAlias);
- }
- return m_pSysFont;
- }
- return NULL;
-}
-CFX_ByteString CPVT_FontMap::GetPDFFontAlias(FX_INT32 nFontIndex)
-{
- switch (nFontIndex) {
- case 0:
- return m_sDefFontAlias;
- case 1:
- if (!m_pSysFont) {
- GetAnnotSysPDFFont(m_pDocument, m_pResDict, m_pSysFont, m_sSysFontAlias);
- }
- return m_sSysFontAlias;
- }
- return "";
-}
-CPVT_Provider::CPVT_Provider(IPVT_FontMap * pFontMap) : m_pFontMap(pFontMap)
-{
- ASSERT (m_pFontMap != NULL);
-}
-CPVT_Provider::~CPVT_Provider()
-{
-}
-FX_INT32 CPVT_Provider::GetCharWidth(FX_INT32 nFontIndex, FX_WORD word, FX_INT32 nWordStyle)
-{
- if (CPDF_Font* pPDFFont = m_pFontMap->GetPDFFont(nFontIndex)) {
- FX_DWORD charcode = pPDFFont->CharCodeFromUnicode(word);
- if (charcode != -1) {
- return pPDFFont->GetCharWidthF(charcode);
- }
- }
- return 0;
-}
-FX_INT32 CPVT_Provider::GetTypeAscent(FX_INT32 nFontIndex)
-{
- if (CPDF_Font* pPDFFont = m_pFontMap->GetPDFFont(nFontIndex)) {
- return pPDFFont->GetTypeAscent();
- }
- return 0;
-}
-FX_INT32 CPVT_Provider::GetTypeDescent(FX_INT32 nFontIndex)
-{
- if (CPDF_Font* pPDFFont = m_pFontMap->GetPDFFont(nFontIndex)) {
- return pPDFFont->GetTypeDescent();
- }
- return 0;
-}
-FX_INT32 CPVT_Provider::GetWordFontIndex(FX_WORD word, FX_INT32 charset, FX_INT32 nFontIndex)
-{
- if (CPDF_Font* pDefFont = m_pFontMap->GetPDFFont(0)) {
- if (pDefFont->CharCodeFromUnicode(word) != -1) {
- return 0;
- }
- }
- if (CPDF_Font* pSysFont = m_pFontMap->GetPDFFont(1))
- if (pSysFont->CharCodeFromUnicode(word) != -1) {
- return 1;
- }
- return -1;
-}
-FX_BOOL CPVT_Provider::IsLatinWord(FX_WORD word)
-{
- if ((word >= 0x61 && word <= 0x7A) || (word >= 0x41 && word <= 0x5A) || word == 0x2D || word == 0x27) {
- return TRUE;
- }
- return FALSE;
-}
-FX_INT32 CPVT_Provider::GetDefaultFontIndex()
-{
- return 0;
-}
-static CFX_ByteString GetPDFWordString(IPVT_FontMap * pFontMap, FX_INT32 nFontIndex, FX_WORD Word, FX_WORD SubWord)
-{
- CFX_ByteString sWord;
- if (SubWord > 0) {
- sWord.Format("%c", SubWord);
- } else {
- if (pFontMap) {
- if (CPDF_Font * pPDFFont = pFontMap->GetPDFFont(nFontIndex)) {
- if (pPDFFont->GetBaseFont().Compare("Symbol") == 0 || pPDFFont->GetBaseFont().Compare("ZapfDingbats") == 0) {
- sWord.Format("%c", Word);
- } else {
- FX_DWORD dwCharCode = pPDFFont->CharCodeFromUnicode(Word);
- if (dwCharCode != -1) {
- pPDFFont->AppendChar(sWord, dwCharCode);
- }
- }
- }
- }
- }
- return sWord;
-}
-static CFX_ByteString GetWordRenderString(const CFX_ByteString & strWords)
-{
- if (strWords.GetLength() > 0) {
- return PDF_EncodeString(strWords) + " Tj\n";
- }
- return "";
-}
-static CFX_ByteString GetFontSetString(IPVT_FontMap * pFontMap, FX_INT32 nFontIndex, FX_FLOAT fFontSize)
-{
- CFX_ByteTextBuf sRet;
- if (pFontMap) {
- CFX_ByteString sFontAlias = pFontMap->GetPDFFontAlias(nFontIndex);
- if (sFontAlias.GetLength() > 0 && fFontSize > 0 ) {
- sRet << "/" << sFontAlias << " " << fFontSize << " Tf\n";
- }
- }
- return sRet.GetByteString();
-}
-static CPVT_Color ParseColor(const CFX_ByteString & str)
-{
- CPDF_SimpleParser syntax(str);
- syntax.SetPos(0);
- if (syntax.FindTagParam("g", 1)) {
- return CPVT_Color(CT_GRAY, FX_atof(syntax.GetWord()));
- }
- syntax.SetPos(0);
- if (syntax.FindTagParam("rg", 3)) {
- FX_FLOAT f1 = FX_atof(syntax.GetWord());
- FX_FLOAT f2 = FX_atof(syntax.GetWord());
- FX_FLOAT f3 = FX_atof(syntax.GetWord());
- return CPVT_Color(CT_RGB, f1, f2, f3);
- }
- syntax.SetPos(0);
- if (syntax.FindTagParam("k", 4)) {
- FX_FLOAT f1 = FX_atof(syntax.GetWord());
- FX_FLOAT f2 = FX_atof(syntax.GetWord());
- FX_FLOAT f3 = FX_atof(syntax.GetWord());
- FX_FLOAT f4 = FX_atof(syntax.GetWord());
- return CPVT_Color(CT_CMYK, f1, f2, f3, f4);
- }
- return CPVT_Color(CT_TRANSPARENT);
-}
-static CPVT_Color ParseColor(const CPDF_Array & array)
-{
- CPVT_Color rt;
- switch (array.GetCount()) {
- case 1:
- rt = CPVT_Color(CT_GRAY, array.GetFloat(0));
- break;
- case 3:
- rt = CPVT_Color(CT_RGB, array.GetFloat(0), array.GetFloat(1), array.GetFloat(2));
- break;
- case 4:
- rt = CPVT_Color(CT_CMYK, array.GetFloat(0), array.GetFloat(1), array.GetFloat(2), array.GetFloat(3));
- break;
- }
- return rt;
-}
-static FX_BOOL GenerateWidgetAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict, const FX_INT32 & nWidgetType)
-{
- CPDF_Dictionary* pFormDict = NULL;
- if (CPDF_Dictionary * pRootDict = pDoc->GetRoot()) {
- pFormDict = pRootDict->GetDict("AcroForm");
- }
- if (!pFormDict) {
- return FALSE;
- }
- CFX_ByteString DA = FPDF_GetFieldAttr(pAnnotDict, "DA")->GetString();
- if (DA.IsEmpty()) {
- DA = pFormDict->GetString("DA");
- }
- if (DA.IsEmpty()) {
- return FALSE;
- }
- CPDF_SimpleParser syntax(DA);
- syntax.FindTagParam("Tf", 2);
- CFX_ByteString sFontName = syntax.GetWord();
- sFontName = PDF_NameDecode(sFontName);
- if (sFontName.IsEmpty()) {
- return FALSE;
- }
- FX_FLOAT fFontSize = FX_atof(syntax.GetWord());
- CPVT_Color crText = ParseColor(DA);
- FX_BOOL bUseFormRes = FALSE;
- CPDF_Dictionary * pFontDict = NULL;
- CPDF_Dictionary* pDRDict = pAnnotDict->GetDict(FX_BSTRC("DR"));
- if (pDRDict == NULL) {
- pDRDict = pFormDict->GetDict(FX_BSTRC("DR"));
- bUseFormRes = TRUE;
- }
- CPDF_Dictionary * pDRFontDict = NULL;
- if ((pDRFontDict = pDRDict->GetDict("Font"))) {
- pFontDict = pDRFontDict->GetDict(sFontName.Mid(1));
- if (!pFontDict && !bUseFormRes) {
- pDRDict = pFormDict->GetDict(FX_BSTRC("DR"));
- pDRFontDict = pDRDict->GetDict("Font");
- if (pDRFontDict) {
- pFontDict = pDRFontDict->GetDict(sFontName.Mid(1));
- }
- }
- }
- if (!pDRFontDict) {
- return FALSE;
- }
- if (!pFontDict) {
- pFontDict = CPDF_Dictionary::Create();
- if (pFontDict == NULL) {
- return FALSE;
- }
- pFontDict->SetAtName(FX_BSTRC("Type"), "Font");
- pFontDict->SetAtName(FX_BSTRC("Subtype"), "Type1");
- pFontDict->SetAtName(FX_BSTRC("BaseFont"), "Helvetica");
- pFontDict->SetAtName(FX_BSTRC("Encoding"), "WinAnsiEncoding");
- pDoc->AddIndirectObject(pFontDict);
- pDRFontDict->SetAtReference(sFontName.Mid(1), pDoc, pFontDict);
- }
- CPDF_Font* pDefFont = pDoc->LoadFont(pFontDict);
- if (!pDefFont) {
- return FALSE;
- }
- CFX_CharMap* pCharMap = pDefFont->GetCharMap();
- CPDF_Rect rcAnnot = pAnnotDict->GetRect("Rect");
- FX_INT32 nRotate = 0;
- if (CPDF_Dictionary * pMKDict = pAnnotDict->GetDict("MK")) {
- nRotate = pMKDict->GetInteger("R");
- }
- CPDF_Rect rcBBox;
- CPDF_Matrix matrix;
- switch (nRotate % 360) {
- case 0:
- rcBBox = CPDF_Rect(0, 0, rcAnnot.right - rcAnnot.left, rcAnnot.top - rcAnnot.bottom);
- break;
- case 90:
- matrix = CPDF_Matrix(0, 1, -1, 0, rcAnnot.right - rcAnnot.left, 0);
- rcBBox = CPDF_Rect(0, 0, rcAnnot.top - rcAnnot.bottom, rcAnnot.right - rcAnnot.left);
- break;
- case 180:
- matrix = CPDF_Matrix(-1, 0, 0, -1, rcAnnot.right - rcAnnot.left, rcAnnot.top - rcAnnot.bottom);
- rcBBox = CPDF_Rect(0, 0, rcAnnot.right - rcAnnot.left, rcAnnot.top - rcAnnot.bottom);
- break;
- case 270:
- matrix = CPDF_Matrix(0, -1, 1, 0, 0, rcAnnot.top - rcAnnot.bottom);
- rcBBox = CPDF_Rect(0, 0, rcAnnot.top - rcAnnot.bottom, rcAnnot.right - rcAnnot.left);
- break;
- }
- FX_INT32 nBorderStyle = PBS_SOLID;
- FX_FLOAT fBorderWidth = 1;
- CPVT_Dash dsBorder(3, 0, 0);
- CPVT_Color crLeftTop, crRightBottom;
- if (CPDF_Dictionary * pBSDict = pAnnotDict->GetDict("BS")) {
- if (pBSDict->KeyExist("W")) {
- fBorderWidth = pBSDict->GetNumber("W");
- }
- if (CPDF_Array * pArray = pBSDict->GetArray("D")) {
- dsBorder = CPVT_Dash(pArray->GetInteger(0), pArray->GetInteger(1), pArray->GetInteger(2));
- }
- switch (pBSDict->GetString("S").GetAt(0)) {
- case 'S':
- nBorderStyle = PBS_SOLID;
- break;
- case 'D':
- nBorderStyle = PBS_DASH;
- break;
- case 'B':
- nBorderStyle = PBS_BEVELED;
- fBorderWidth *= 2;
- crLeftTop = CPVT_Color(CT_GRAY, 1);
- crRightBottom = CPVT_Color(CT_GRAY, 0.5);
- break;
- case 'I':
- nBorderStyle = PBS_INSET;
- fBorderWidth *= 2;
- crLeftTop = CPVT_Color(CT_GRAY, 0.5);
- crRightBottom = CPVT_Color(CT_GRAY, 0.75);
- break;
- case 'U':
- nBorderStyle = PBS_UNDERLINED;
- break;
- }
- }
- CPVT_Color crBorder, crBG;
- if (CPDF_Dictionary * pMKDict = pAnnotDict->GetDict("MK")) {
- if (CPDF_Array * pArray = pMKDict->GetArray("BC")) {
- crBorder = ParseColor(*pArray);
- }
- if (CPDF_Array * pArray = pMKDict->GetArray("BG")) {
- crBG = ParseColor(*pArray);
- }
- }
- CFX_ByteTextBuf sAppStream;
- CFX_ByteString sBG = CPVT_GenerateAP::GenerateColorAP(crBG, TRUE);
- if (sBG.GetLength() > 0) {
- sAppStream << "q\n" << sBG << rcBBox.left << " " << rcBBox.bottom << " "
- << rcBBox.Width() << " " << rcBBox.Height() << " re f\n" << "Q\n";
- }
- CFX_ByteString sBorderStream = CPVT_GenerateAP::GenerateBorderAP(rcBBox, fBorderWidth,
- crBorder, crLeftTop, crRightBottom, nBorderStyle, dsBorder);
- if (sBorderStream.GetLength() > 0) {
- sAppStream << "q\n" << sBorderStream << "Q\n";
- }
- CPDF_Rect rcBody = CPDF_Rect(rcBBox.left + fBorderWidth, rcBBox.bottom + fBorderWidth,
- rcBBox.right - fBorderWidth, rcBBox.top - fBorderWidth);
- rcBody.Normalize();
- CPDF_Dictionary* pAPDict = pAnnotDict->GetDict("AP");
- if (pAPDict == NULL) {
- pAPDict = CPDF_Dictionary::Create();
- if (pAPDict == NULL) {
- return FALSE;
- }
- pAnnotDict->SetAt("AP", pAPDict);
- }
- CPDF_Stream* pNormalStream = pAPDict->GetStream("N");
- if (pNormalStream == NULL) {
- pNormalStream = CPDF_Stream::Create(NULL, 0, NULL);
- if (pNormalStream == NULL) {
- return FALSE;
- }
- FX_INT32 objnum = pDoc->AddIndirectObject(pNormalStream);
- pAnnotDict->GetDict("AP")->SetAtReference("N", pDoc, objnum);
- }
- CPDF_Dictionary * pStreamDict = pNormalStream->GetDict();
- if (pStreamDict) {
- pStreamDict->SetAtMatrix("Matrix", matrix);
- pStreamDict->SetAtRect("BBox", rcBBox);
- CPDF_Dictionary* pStreamResList = pStreamDict->GetDict("Resources");
- if (pStreamResList) {
- CPDF_Dictionary* pStreamResFontList = pStreamResList->GetDict("Font");
- if (!pStreamResFontList) {
- pStreamResFontList = CPDF_Dictionary::Create();
- if (pStreamResFontList == NULL) {
- return FALSE;
- }
- pStreamResList->SetAt("Font", pStreamResFontList);
- }
- if (!pStreamResFontList->KeyExist(sFontName)) {
- pStreamResFontList->SetAtReference(sFontName, pDoc, pFontDict);
- }
- } else {
- pStreamDict->SetAt("Resources", pFormDict->GetDict("DR")->Clone());
- pStreamResList = pStreamDict->GetDict("Resources");
- }
- }
- switch (nWidgetType) {
- case 0: {
- CFX_WideString swValue = FPDF_GetFieldAttr(pAnnotDict, "V")->GetUnicodeText();
- FX_INT32 nAlign = FPDF_GetFieldAttr(pAnnotDict, "Q")->GetInteger();
- FX_DWORD dwFlags = FPDF_GetFieldAttr(pAnnotDict, "Ff")->GetInteger();
- FX_DWORD dwMaxLen = FPDF_GetFieldAttr(pAnnotDict, "MaxLen")->GetInteger();
- CPVT_FontMap map(pDoc, pStreamDict->GetDict("Resources"), pDefFont, sFontName.Right(sFontName.GetLength() - 1));
- CPVT_Provider prd(&map);
- CPDF_VariableText vt;
- vt.SetProvider(&prd);
- vt.SetPlateRect(rcBody);
- vt.SetAlignment(nAlign);
- if (IsFloatZero(fFontSize)) {
- vt.SetAutoFontSize(TRUE);
- } else {
- vt.SetFontSize(fFontSize);
- }
- FX_BOOL bMultiLine = (dwFlags >> 12) & 1;
- if (bMultiLine) {
- vt.SetMultiLine(TRUE);
- vt.SetAutoReturn(TRUE);
- }
- FX_WORD subWord = 0;
- if ((dwFlags >> 13) & 1) {
- subWord = '*';
- vt.SetPasswordChar(subWord);
- }
- FX_BOOL bCharArray = (dwFlags >> 24) & 1;
- if (bCharArray) {
- vt.SetCharArray(dwMaxLen);
- } else {
- vt.SetLimitChar(dwMaxLen);
- }
- vt.Initialize();
- vt.SetText(swValue);
- vt.RearrangeAll();
- CPDF_Rect rcContent = vt.GetContentRect();
- CPDF_Point ptOffset(0.0f, 0.0f);
- if (!bMultiLine) {
- ptOffset = CPDF_Point(0.0f, (rcContent.Height() - rcBody.Height()) / 2.0f);
- }
- CFX_ByteString sBody = CPVT_GenerateAP::GenerateEditAP(&map, vt.GetIterator(), ptOffset, !bCharArray, subWord);
- if (sBody.GetLength() > 0) {
- sAppStream << "/Tx BMC\n" << "q\n";
- if (rcContent.Width() > rcBody.Width() ||
- rcContent.Height() > rcBody.Height()) {
- sAppStream << rcBody.left << " " << rcBody.bottom << " "
- << rcBody.Width() << " " << rcBody.Height() << " re\nW\nn\n";
- }
- sAppStream << "BT\n" << CPVT_GenerateAP::GenerateColorAP(crText, TRUE) << sBody << "ET\n" << "Q\nEMC\n";
- }
- }
- break;
- case 1: {
- CFX_WideString swValue = FPDF_GetFieldAttr(pAnnotDict, "V")->GetUnicodeText();
- CPVT_FontMap map(pDoc, pStreamDict->GetDict("Resources"), pDefFont, sFontName.Right(sFontName.GetLength() - 1));
- CPVT_Provider prd(&map);
- CPDF_VariableText vt;
- vt.SetProvider(&prd);
- CPDF_Rect rcButton = rcBody;
- rcButton.left = rcButton.right - 13;
- rcButton.Normalize();
- CPDF_Rect rcEdit = rcBody;
- rcEdit.right = rcButton.left;
- rcEdit.Normalize();
- vt.SetPlateRect(rcEdit);
- if (IsFloatZero(fFontSize)) {
- vt.SetAutoFontSize(TRUE);
- } else {
- vt.SetFontSize(fFontSize);
- }
- vt.Initialize();
- vt.SetText(swValue);
- vt.RearrangeAll();
- CPDF_Rect rcContent = vt.GetContentRect();
- CPDF_Point ptOffset = CPDF_Point(0.0f, (rcContent.Height() - rcEdit.Height()) / 2.0f);
- CFX_ByteString sEdit = CPVT_GenerateAP::GenerateEditAP(&map, vt.GetIterator(), ptOffset, TRUE, 0);
- if (sEdit.GetLength() > 0) {
- sAppStream << "/Tx BMC\n" << "q\n";
- sAppStream << rcEdit.left << " " << rcEdit.bottom << " "
- << rcEdit.Width() << " " << rcEdit.Height() << " re\nW\nn\n";
- sAppStream << "BT\n" << CPVT_GenerateAP::GenerateColorAP(crText, TRUE) << sEdit << "ET\n" << "Q\nEMC\n";
- }
- CFX_ByteString sButton = CPVT_GenerateAP::GenerateColorAP(CPVT_Color(CT_RGB, 220.0f / 255.0f, 220.0f / 255.0f, 220.0f / 255.0f), TRUE);
- if (sButton.GetLength() > 0 && !rcButton.IsEmpty()) {
- sAppStream << "q\n" << sButton;
- sAppStream << rcButton.left << " " << rcButton.bottom << " "
- << rcButton.Width() << " " << rcButton.Height() << " re f\n";
- sAppStream << "Q\n";
- CFX_ByteString sButtonBorder = CPVT_GenerateAP::GenerateBorderAP(rcButton, 2, CPVT_Color(CT_GRAY, 0), CPVT_Color(CT_GRAY, 1), CPVT_Color(CT_GRAY, 0.5), PBS_BEVELED, CPVT_Dash(3, 0, 0));
- if (sButtonBorder.GetLength() > 0) {
- sAppStream << "q\n" << sButtonBorder << "Q\n";
- }
- CPDF_Point ptCenter = CPDF_Point((rcButton.left + rcButton.right) / 2, (rcButton.top + rcButton.bottom) / 2);
- if (IsFloatBigger(rcButton.Width(), 6) && IsFloatBigger(rcButton.Height(), 6)) {
- sAppStream << "q\n" << " 0 g\n";
- sAppStream << ptCenter.x - 3 << " " << ptCenter.y + 1.5f << " m\n";
- sAppStream << ptCenter.x + 3 << " " << ptCenter.y + 1.5f << " l\n";
- sAppStream << ptCenter.x << " " << ptCenter.y - 1.5f << " l\n";
- sAppStream << ptCenter.x - 3 << " " << ptCenter.y + 1.5f << " l f\n";
- sAppStream << sButton << "Q\n";
- }
- }
- }
- break;
- case 2: {
- CPVT_FontMap map(pDoc, pStreamDict->GetDict("Resources"), pDefFont, sFontName.Right(sFontName.GetLength() - 1));
- CPVT_Provider prd(&map);
- CPDF_Array * pOpts = FPDF_GetFieldAttr(pAnnotDict, "Opt")->GetArray();
- CPDF_Array * pSels = FPDF_GetFieldAttr(pAnnotDict, "I")->GetArray();
- FX_INT32 nTop = FPDF_GetFieldAttr(pAnnotDict, "TI")->GetInteger();
- CFX_ByteTextBuf sBody;
- if (pOpts) {
- FX_FLOAT fy = rcBody.top;
- for (FX_INT32 i = nTop, sz = pOpts->GetCount(); i < sz; i++) {
- if (IsFloatSmaller(fy, rcBody.bottom)) {
- break;
- }
- if (CPDF_Object* pOpt = pOpts->GetElementValue(i)) {
- CFX_WideString swItem;
- if (pOpt->GetType() == PDFOBJ_STRING) {
- swItem = pOpt->GetUnicodeText();
- } else if (pOpt->GetType() == PDFOBJ_ARRAY) {
- swItem = ((CPDF_Array*)pOpt)->GetElementValue(1)->GetUnicodeText();
- }
- FX_BOOL bSelected = FALSE;
- if (pSels) {
- for (FX_DWORD s = 0, ssz = pSels->GetCount(); s < ssz; s++) {
- if (i == pSels->GetInteger(s)) {
- bSelected = TRUE;
- break;
- }
- }
- }
- CPDF_VariableText vt;
- vt.SetProvider(&prd);
- vt.SetPlateRect(CPDF_Rect(rcBody.left, 0.0f, rcBody.right, 0.0f));
- if (IsFloatZero(fFontSize)) {
- vt.SetFontSize(12.0f);
- } else {
- vt.SetFontSize(fFontSize);
- }
- vt.Initialize();
- vt.SetText(swItem);
- vt.RearrangeAll();
- FX_FLOAT fItemHeight = vt.GetContentRect().Height();
- if (bSelected) {
- CPDF_Rect rcItem = CPDF_Rect(rcBody.left, fy - fItemHeight, rcBody.right, fy);
- sBody << "q\n" << CPVT_GenerateAP::GenerateColorAP(CPVT_Color(CT_RGB, 0, 51.0f / 255.0f, 113.0f / 255.0f), TRUE)
- << rcItem.left << " " << rcItem.bottom << " " << rcItem.Width() << " " << rcItem.Height() << " re f\n" << "Q\n";
- sBody << "BT\n" << CPVT_GenerateAP::GenerateColorAP(CPVT_Color(CT_GRAY, 1), TRUE) << CPVT_GenerateAP::GenerateEditAP(&map, vt.GetIterator(), CPDF_Point(0.0f, fy), TRUE, 0) << "ET\n";
- } else {
- sBody << "BT\n" << CPVT_GenerateAP::GenerateColorAP(crText, TRUE) << CPVT_GenerateAP::GenerateEditAP(&map, vt.GetIterator(), CPDF_Point(0.0f, fy), TRUE, 0) << "ET\n";
- }
- fy -= fItemHeight;
- }
- }
- }
- if (sBody.GetSize() > 0) {
- sAppStream << "/Tx BMC\n" << "q\n";
- sAppStream << rcBody.left << " " << rcBody.bottom << " "
- << rcBody.Width() << " " << rcBody.Height() << " re\nW\nn\n";
- sAppStream << sBody.GetByteString() << "Q\nEMC\n";
- }
- }
- break;
- }
- if (pNormalStream) {
- pNormalStream->SetData((FX_BYTE*)sAppStream.GetBuffer(), sAppStream.GetSize(), FALSE, FALSE);
- pStreamDict = pNormalStream->GetDict();
- if (pStreamDict) {
- pStreamDict->SetAtMatrix("Matrix", matrix);
- pStreamDict->SetAtRect("BBox", rcBBox);
- CPDF_Dictionary* pStreamResList = pStreamDict->GetDict("Resources");
- if (pStreamResList) {
- CPDF_Dictionary* pStreamResFontList = pStreamResList->GetDict("Font");
- if (!pStreamResFontList) {
- pStreamResFontList = CPDF_Dictionary::Create();
- if (pStreamResFontList == NULL) {
- return FALSE;
- }
- pStreamResList->SetAt("Font", pStreamResFontList);
- }
- if (!pStreamResFontList->KeyExist(sFontName)) {
- pStreamResFontList->SetAtReference(sFontName, pDoc, pFontDict);
- }
- } else {
- pStreamDict->SetAt("Resources", pFormDict->GetDict("DR")->Clone());
- pStreamResList = pStreamDict->GetDict("Resources");
- }
- }
- }
- return TRUE;
-}
-FX_BOOL CPVT_GenerateAP::GenerateTextFieldAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict)
-{
- return GenerateWidgetAP(pDoc, pAnnotDict, 0);
-}
-FX_BOOL CPVT_GenerateAP::GenerateComboBoxAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict)
-{
- return GenerateWidgetAP(pDoc, pAnnotDict, 1);
-}
-FX_BOOL CPVT_GenerateAP::GenerateListBoxAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict)
-{
- return GenerateWidgetAP(pDoc, pAnnotDict, 2);
-}
-CFX_ByteString CPVT_GenerateAP::GenerateEditAP(IPVT_FontMap * pFontMap, IPDF_VariableText_Iterator* pIterator, const CPDF_Point & ptOffset, FX_BOOL bContinuous, FX_WORD SubWord, const CPVT_WordRange * pVisible)
-{
- CFX_ByteTextBuf sEditStream, sLineStream, sWords;
- CPDF_Point ptOld(0.0f, 0.0f), ptNew(0.0f, 0.0f);
- FX_INT32 nCurFontIndex = -1;
- if (pIterator) {
- if (pVisible) {
- pIterator->SetAt(pVisible->BeginPos);
- } else {
- pIterator->SetAt(0);
- }
- CPVT_WordPlace oldplace;
- while (pIterator->NextWord()) {
- CPVT_WordPlace place = pIterator->GetAt();
- if (pVisible && place.WordCmp(pVisible->EndPos) > 0) {
- break;
- }
- if (bContinuous) {
- if (place.LineCmp(oldplace) != 0) {
- if (sWords.GetSize() > 0) {
- sLineStream << GetWordRenderString(sWords.GetByteString());
- sEditStream << sLineStream;
- sLineStream.Clear();
- sWords.Clear();
- }
- CPVT_Word word;
- if (pIterator->GetWord(word)) {
- ptNew = CPDF_Point(word.ptWord.x + ptOffset.x, word.ptWord.y + ptOffset.y);
- } else {
- CPVT_Line line;
- pIterator->GetLine(line);
- ptNew = CPDF_Point(line.ptLine.x + ptOffset.x, line.ptLine.y + ptOffset.y);
- }
- if (ptNew.x != ptOld.x || ptNew.y != ptOld.y) {
- sLineStream << ptNew.x - ptOld.x << " " << ptNew.y - ptOld.y << " Td\n";
- ptOld = ptNew;
- }
- }
- CPVT_Word word;
- if (pIterator->GetWord(word)) {
- if (word.nFontIndex != nCurFontIndex) {
- if (sWords.GetSize() > 0) {
- sLineStream << GetWordRenderString(sWords.GetByteString());
- sWords.Clear();
- }
- sLineStream << GetFontSetString(pFontMap, word.nFontIndex, word.fFontSize);
- nCurFontIndex = word.nFontIndex;
- }
- sWords << GetPDFWordString(pFontMap, nCurFontIndex, word.Word, SubWord);
- }
- oldplace = place;
- } else {
- CPVT_Word word;
- if (pIterator->GetWord(word)) {
- ptNew = CPDF_Point(word.ptWord.x + ptOffset.x, word.ptWord.y + ptOffset.y);
- if (ptNew.x != ptOld.x || ptNew.y != ptOld.y) {
- sEditStream << ptNew.x - ptOld.x << " " << ptNew.y - ptOld.y << " Td\n";
- ptOld = ptNew;
- }
- if (word.nFontIndex != nCurFontIndex) {
- sEditStream << GetFontSetString(pFontMap, word.nFontIndex, word.fFontSize);
- nCurFontIndex = word.nFontIndex;
- }
- sEditStream << GetWordRenderString(GetPDFWordString(pFontMap, nCurFontIndex, word.Word, SubWord));
- }
- }
- }
- if (sWords.GetSize() > 0) {
- sLineStream << GetWordRenderString(sWords.GetByteString());
- sEditStream << sLineStream;
- sWords.Clear();
- }
- }
- return sEditStream.GetByteString();
-}
-CFX_ByteString CPVT_GenerateAP::GenerateBorderAP(const CPDF_Rect & rect, FX_FLOAT fWidth,
- const CPVT_Color & color, const CPVT_Color & crLeftTop, const CPVT_Color & crRightBottom,
- FX_INT32 nStyle, const CPVT_Dash & dash)
-{
- CFX_ByteTextBuf sAppStream;
- CFX_ByteString sColor;
- FX_FLOAT fLeft = rect.left;
- FX_FLOAT fRight = rect.right;
- FX_FLOAT fTop = rect.top;
- FX_FLOAT fBottom = rect.bottom;
- if (fWidth > 0.0f) {
- FX_FLOAT fHalfWidth = fWidth / 2.0f;
- switch (nStyle) {
- default:
- case PBS_SOLID:
- sColor = GenerateColorAP(color, TRUE);
- if (sColor.GetLength() > 0) {
- sAppStream << sColor;
- sAppStream << fLeft << " " << fBottom << " " << fRight - fLeft << " " << fTop - fBottom << " re\n";
- sAppStream << fLeft + fWidth << " " << fBottom + fWidth << " "
- << fRight - fLeft - fWidth * 2 << " " << fTop - fBottom - fWidth * 2 << " re\n";
- sAppStream << "f*\n";
- }
- break;
- case PBS_DASH:
- sColor = GenerateColorAP(color, FALSE);
- if (sColor.GetLength() > 0) {
- sAppStream << sColor;
- sAppStream << fWidth << " w" << " [" << dash.nDash << " " << dash.nGap << "] " << dash.nPhase << " d\n";
- sAppStream << fLeft + fWidth / 2 << " " << fBottom + fWidth / 2 << " m\n";
- sAppStream << fLeft + fWidth / 2 << " " << fTop - fWidth / 2 << " l\n";
- sAppStream << fRight - fWidth / 2 << " " << fTop - fWidth / 2 << " l\n";
- sAppStream << fRight - fWidth / 2 << " " << fBottom + fWidth / 2 << " l\n";
- sAppStream << fLeft + fWidth / 2 << " " << fBottom + fWidth / 2 << " l S\n";
- }
- break;
- case PBS_BEVELED:
- case PBS_INSET:
- sColor = GenerateColorAP(crLeftTop, TRUE);
- if (sColor.GetLength() > 0) {
- sAppStream << sColor;
- sAppStream << fLeft + fHalfWidth << " " << fBottom + fHalfWidth << " m\n";
- sAppStream << fLeft + fHalfWidth << " " << fTop - fHalfWidth << " l\n";
- sAppStream << fRight - fHalfWidth << " " << fTop - fHalfWidth << " l\n";
- sAppStream << fRight - fHalfWidth * 2 << " " << fTop - fHalfWidth * 2 << " l\n";
- sAppStream << fLeft + fHalfWidth * 2 << " " << fTop - fHalfWidth * 2 << " l\n";
- sAppStream << fLeft + fHalfWidth * 2 << " " << fBottom + fHalfWidth * 2 << " l f\n";
- }
- sColor = GenerateColorAP(crRightBottom, TRUE);
- if (sColor.GetLength() > 0) {
- sAppStream << sColor;
- sAppStream << fRight - fHalfWidth << " " << fTop - fHalfWidth << " m\n";
- sAppStream << fRight - fHalfWidth << " " << fBottom + fHalfWidth << " l\n";
- sAppStream << fLeft + fHalfWidth << " " << fBottom + fHalfWidth << " l\n";
- sAppStream << fLeft + fHalfWidth * 2 << " " << fBottom + fHalfWidth * 2 << " l\n";
- sAppStream << fRight - fHalfWidth * 2 << " " << fBottom + fHalfWidth * 2 << " l\n";
- sAppStream << fRight - fHalfWidth * 2 << " " << fTop - fHalfWidth * 2 << " l f\n";
- }
- sColor = GenerateColorAP(color, TRUE);
- if (sColor.GetLength() > 0) {
- sAppStream << sColor;
- sAppStream << fLeft << " " << fBottom << " " << fRight - fLeft << " " << fTop - fBottom << " re\n";
- sAppStream << fLeft + fHalfWidth << " " << fBottom + fHalfWidth << " "
- << fRight - fLeft - fHalfWidth * 2 << " " << fTop - fBottom - fHalfWidth * 2 << " re f*\n";
- }
- break;
- case PBS_UNDERLINED:
- sColor = GenerateColorAP(color, FALSE);
- if (sColor.GetLength() > 0) {
- sAppStream << sColor;
- sAppStream << fWidth << " w\n";
- sAppStream << fLeft << " " << fBottom + fWidth / 2 << " m\n";
- sAppStream << fRight << " " << fBottom + fWidth / 2 << " l S\n";
- }
- break;
- }
- }
- return sAppStream.GetByteString();
-}
-CFX_ByteString CPVT_GenerateAP::GenerateColorAP(const CPVT_Color & color, const FX_BOOL & bFillOrStroke)
-{
- CFX_ByteTextBuf sColorStream;
- switch (color.nColorType) {
- case CT_RGB:
- sColorStream << color.fColor1 << " " << color.fColor2 << " " << color.fColor3 << " "
- << (bFillOrStroke ? "rg" : "RG") << "\n";
- break;
- case CT_GRAY:
- sColorStream << color.fColor1 << " " << (bFillOrStroke ? "g" : "G") << "\n";
- break;
- case CT_CMYK:
- sColorStream << color.fColor1 << " " << color.fColor2 << " " << color.fColor3 << " " << color.fColor4 << " "
- << (bFillOrStroke ? "k" : "K") << "\n";
- break;
- }
- return sColorStream.GetByteString();
-}
+// 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
+
+#include "../../include/fpdfdoc/fpdf_doc.h"
+#include "../../include/fpdfdoc/fpdf_vt.h"
+#include "pdf_vt.h"
+#include "../../include/fpdfdoc/fpdf_ap.h"
+FX_BOOL FPDF_GenerateAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict)
+{
+ if (pAnnotDict->GetConstString("Subtype") != FX_BSTRC("Widget")) {
+ return FALSE;
+ }
+ CFX_ByteString field_type = FPDF_GetFieldAttr(pAnnotDict, "FT")->GetString();
+ FX_DWORD flags = FPDF_GetFieldAttr(pAnnotDict, "Ff")->GetInteger();
+ if (field_type == "Tx") {
+ return CPVT_GenerateAP::GenerateTextFieldAP(pDoc, pAnnotDict);
+ } else if (field_type == "Ch") {
+ if (flags & (1 << 17)) {
+ return CPVT_GenerateAP::GenerateComboBoxAP(pDoc, pAnnotDict);
+ } else {
+ return CPVT_GenerateAP::GenerateListBoxAP(pDoc, pAnnotDict);
+ }
+ } else if (field_type == "Btn") {
+ if (!(flags & (1 << 16))) {
+ if (!pAnnotDict->KeyExist("AS")) {
+ if (CPDF_Dictionary* pParentDict = pAnnotDict->GetDict("Parent")) {
+ if (pParentDict->KeyExist("AS")) {
+ pAnnotDict->SetAtString("AS", pParentDict->GetString("AS"));
+ }
+ }
+ }
+ }
+ }
+ return FALSE;
+}
+class CPVT_FontMap : public IPVT_FontMap
+{
+public:
+ CPVT_FontMap(CPDF_Document * pDoc, CPDF_Dictionary * pResDict, CPDF_Font * pDefFont,
+ const CFX_ByteString & sDefFontAlias);
+ virtual ~CPVT_FontMap();
+ CPDF_Font* GetPDFFont(FX_INT32 nFontIndex);
+ CFX_ByteString GetPDFFontAlias(FX_INT32 nFontIndex);
+ static void GetAnnotSysPDFFont(CPDF_Document * pDoc, CPDF_Dictionary * pResDict,
+ CPDF_Font * & pSysFont, CFX_ByteString & sSysFontAlias);
+private:
+ CPDF_Document* m_pDocument;
+ CPDF_Dictionary* m_pResDict;
+ CPDF_Font* m_pDefFont;
+ CFX_ByteString m_sDefFontAlias;
+ CPDF_Font* m_pSysFont;
+ CFX_ByteString m_sSysFontAlias;
+};
+CPVT_FontMap::CPVT_FontMap(CPDF_Document * pDoc, CPDF_Dictionary * pResDict, CPDF_Font * pDefFont,
+ const CFX_ByteString & sDefFontAlias) :
+ m_pDocument(pDoc),
+ m_pResDict(pResDict),
+ m_pDefFont(pDefFont),
+ m_sDefFontAlias(sDefFontAlias),
+ m_pSysFont(NULL),
+ m_sSysFontAlias()
+{
+}
+CPVT_FontMap::~CPVT_FontMap()
+{
+}
+extern CPDF_Font* AddNativeInterFormFont(CPDF_Dictionary*& pFormDict, CPDF_Document* pDocument, CFX_ByteString& csNameTag);
+void CPVT_FontMap::GetAnnotSysPDFFont(CPDF_Document * pDoc, CPDF_Dictionary * pResDict,
+ CPDF_Font * & pSysFont, CFX_ByteString & sSysFontAlias)
+{
+ if (pDoc && pResDict) {
+ CFX_ByteString sFontAlias;
+ CPDF_Dictionary* pFormDict = pDoc->GetRoot()->GetDict("AcroForm");
+ if (CPDF_Font * pPDFFont = AddNativeInterFormFont(pFormDict, pDoc, sSysFontAlias)) {
+ if (CPDF_Dictionary * pFontList = pResDict->GetDict("Font")) {
+ if (!pFontList->KeyExist(sSysFontAlias)) {
+ pFontList->SetAtReference(sSysFontAlias, pDoc, pPDFFont->GetFontDict());
+ }
+ }
+ pSysFont = pPDFFont;
+ }
+ }
+}
+CPDF_Font* CPVT_FontMap::GetPDFFont(FX_INT32 nFontIndex)
+{
+ switch (nFontIndex) {
+ case 0:
+ return m_pDefFont;
+ case 1:
+ if (!m_pSysFont) {
+ GetAnnotSysPDFFont(m_pDocument, m_pResDict, m_pSysFont, m_sSysFontAlias);
+ }
+ return m_pSysFont;
+ }
+ return NULL;
+}
+CFX_ByteString CPVT_FontMap::GetPDFFontAlias(FX_INT32 nFontIndex)
+{
+ switch (nFontIndex) {
+ case 0:
+ return m_sDefFontAlias;
+ case 1:
+ if (!m_pSysFont) {
+ GetAnnotSysPDFFont(m_pDocument, m_pResDict, m_pSysFont, m_sSysFontAlias);
+ }
+ return m_sSysFontAlias;
+ }
+ return "";
+}
+CPVT_Provider::CPVT_Provider(IPVT_FontMap * pFontMap) : m_pFontMap(pFontMap)
+{
+ ASSERT (m_pFontMap != NULL);
+}
+CPVT_Provider::~CPVT_Provider()
+{
+}
+FX_INT32 CPVT_Provider::GetCharWidth(FX_INT32 nFontIndex, FX_WORD word, FX_INT32 nWordStyle)
+{
+ if (CPDF_Font* pPDFFont = m_pFontMap->GetPDFFont(nFontIndex)) {
+ FX_DWORD charcode = pPDFFont->CharCodeFromUnicode(word);
+ if (charcode != -1) {
+ return pPDFFont->GetCharWidthF(charcode);
+ }
+ }
+ return 0;
+}
+FX_INT32 CPVT_Provider::GetTypeAscent(FX_INT32 nFontIndex)
+{
+ if (CPDF_Font* pPDFFont = m_pFontMap->GetPDFFont(nFontIndex)) {
+ return pPDFFont->GetTypeAscent();
+ }
+ return 0;
+}
+FX_INT32 CPVT_Provider::GetTypeDescent(FX_INT32 nFontIndex)
+{
+ if (CPDF_Font* pPDFFont = m_pFontMap->GetPDFFont(nFontIndex)) {
+ return pPDFFont->GetTypeDescent();
+ }
+ return 0;
+}
+FX_INT32 CPVT_Provider::GetWordFontIndex(FX_WORD word, FX_INT32 charset, FX_INT32 nFontIndex)
+{
+ if (CPDF_Font* pDefFont = m_pFontMap->GetPDFFont(0)) {
+ if (pDefFont->CharCodeFromUnicode(word) != -1) {
+ return 0;
+ }
+ }
+ if (CPDF_Font* pSysFont = m_pFontMap->GetPDFFont(1))
+ if (pSysFont->CharCodeFromUnicode(word) != -1) {
+ return 1;
+ }
+ return -1;
+}
+FX_BOOL CPVT_Provider::IsLatinWord(FX_WORD word)
+{
+ if ((word >= 0x61 && word <= 0x7A) || (word >= 0x41 && word <= 0x5A) || word == 0x2D || word == 0x27) {
+ return TRUE;
+ }
+ return FALSE;
+}
+FX_INT32 CPVT_Provider::GetDefaultFontIndex()
+{
+ return 0;
+}
+static CFX_ByteString GetPDFWordString(IPVT_FontMap * pFontMap, FX_INT32 nFontIndex, FX_WORD Word, FX_WORD SubWord)
+{
+ CFX_ByteString sWord;
+ if (SubWord > 0) {
+ sWord.Format("%c", SubWord);
+ } else {
+ if (pFontMap) {
+ if (CPDF_Font * pPDFFont = pFontMap->GetPDFFont(nFontIndex)) {
+ if (pPDFFont->GetBaseFont().Compare("Symbol") == 0 || pPDFFont->GetBaseFont().Compare("ZapfDingbats") == 0) {
+ sWord.Format("%c", Word);
+ } else {
+ FX_DWORD dwCharCode = pPDFFont->CharCodeFromUnicode(Word);
+ if (dwCharCode != -1) {
+ pPDFFont->AppendChar(sWord, dwCharCode);
+ }
+ }
+ }
+ }
+ }
+ return sWord;
+}
+static CFX_ByteString GetWordRenderString(const CFX_ByteString & strWords)
+{
+ if (strWords.GetLength() > 0) {
+ return PDF_EncodeString(strWords) + " Tj\n";
+ }
+ return "";
+}
+static CFX_ByteString GetFontSetString(IPVT_FontMap * pFontMap, FX_INT32 nFontIndex, FX_FLOAT fFontSize)
+{
+ CFX_ByteTextBuf sRet;
+ if (pFontMap) {
+ CFX_ByteString sFontAlias = pFontMap->GetPDFFontAlias(nFontIndex);
+ if (sFontAlias.GetLength() > 0 && fFontSize > 0 ) {
+ sRet << "/" << sFontAlias << " " << fFontSize << " Tf\n";
+ }
+ }
+ return sRet.GetByteString();
+}
+static CPVT_Color ParseColor(const CFX_ByteString & str)
+{
+ CPDF_SimpleParser syntax(str);
+ syntax.SetPos(0);
+ if (syntax.FindTagParam("g", 1)) {
+ return CPVT_Color(CT_GRAY, FX_atof(syntax.GetWord()));
+ }
+ syntax.SetPos(0);
+ if (syntax.FindTagParam("rg", 3)) {
+ FX_FLOAT f1 = FX_atof(syntax.GetWord());
+ FX_FLOAT f2 = FX_atof(syntax.GetWord());
+ FX_FLOAT f3 = FX_atof(syntax.GetWord());
+ return CPVT_Color(CT_RGB, f1, f2, f3);
+ }
+ syntax.SetPos(0);
+ if (syntax.FindTagParam("k", 4)) {
+ FX_FLOAT f1 = FX_atof(syntax.GetWord());
+ FX_FLOAT f2 = FX_atof(syntax.GetWord());
+ FX_FLOAT f3 = FX_atof(syntax.GetWord());
+ FX_FLOAT f4 = FX_atof(syntax.GetWord());
+ return CPVT_Color(CT_CMYK, f1, f2, f3, f4);
+ }
+ return CPVT_Color(CT_TRANSPARENT);
+}
+static CPVT_Color ParseColor(const CPDF_Array & array)
+{
+ CPVT_Color rt;
+ switch (array.GetCount()) {
+ case 1:
+ rt = CPVT_Color(CT_GRAY, array.GetFloat(0));
+ break;
+ case 3:
+ rt = CPVT_Color(CT_RGB, array.GetFloat(0), array.GetFloat(1), array.GetFloat(2));
+ break;
+ case 4:
+ rt = CPVT_Color(CT_CMYK, array.GetFloat(0), array.GetFloat(1), array.GetFloat(2), array.GetFloat(3));
+ break;
+ }
+ return rt;
+}
+static FX_BOOL GenerateWidgetAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict, const FX_INT32 & nWidgetType)
+{
+ CPDF_Dictionary* pFormDict = NULL;
+ if (CPDF_Dictionary * pRootDict = pDoc->GetRoot()) {
+ pFormDict = pRootDict->GetDict("AcroForm");
+ }
+ if (!pFormDict) {
+ return FALSE;
+ }
+ CFX_ByteString DA = FPDF_GetFieldAttr(pAnnotDict, "DA")->GetString();
+ if (DA.IsEmpty()) {
+ DA = pFormDict->GetString("DA");
+ }
+ if (DA.IsEmpty()) {
+ return FALSE;
+ }
+ CPDF_SimpleParser syntax(DA);
+ syntax.FindTagParam("Tf", 2);
+ CFX_ByteString sFontName = syntax.GetWord();
+ sFontName = PDF_NameDecode(sFontName);
+ if (sFontName.IsEmpty()) {
+ return FALSE;
+ }
+ FX_FLOAT fFontSize = FX_atof(syntax.GetWord());
+ CPVT_Color crText = ParseColor(DA);
+ FX_BOOL bUseFormRes = FALSE;
+ CPDF_Dictionary * pFontDict = NULL;
+ CPDF_Dictionary* pDRDict = pAnnotDict->GetDict(FX_BSTRC("DR"));
+ if (pDRDict == NULL) {
+ pDRDict = pFormDict->GetDict(FX_BSTRC("DR"));
+ bUseFormRes = TRUE;
+ }
+ CPDF_Dictionary * pDRFontDict = NULL;
+ if ((pDRFontDict = pDRDict->GetDict("Font"))) {
+ pFontDict = pDRFontDict->GetDict(sFontName.Mid(1));
+ if (!pFontDict && !bUseFormRes) {
+ pDRDict = pFormDict->GetDict(FX_BSTRC("DR"));
+ pDRFontDict = pDRDict->GetDict("Font");
+ if (pDRFontDict) {
+ pFontDict = pDRFontDict->GetDict(sFontName.Mid(1));
+ }
+ }
+ }
+ if (!pDRFontDict) {
+ return FALSE;
+ }
+ if (!pFontDict) {
+ pFontDict = CPDF_Dictionary::Create();
+ if (pFontDict == NULL) {
+ return FALSE;
+ }
+ pFontDict->SetAtName(FX_BSTRC("Type"), "Font");
+ pFontDict->SetAtName(FX_BSTRC("Subtype"), "Type1");
+ pFontDict->SetAtName(FX_BSTRC("BaseFont"), "Helvetica");
+ pFontDict->SetAtName(FX_BSTRC("Encoding"), "WinAnsiEncoding");
+ pDoc->AddIndirectObject(pFontDict);
+ pDRFontDict->SetAtReference(sFontName.Mid(1), pDoc, pFontDict);
+ }
+ CPDF_Font* pDefFont = pDoc->LoadFont(pFontDict);
+ if (!pDefFont) {
+ return FALSE;
+ }
+ CFX_CharMap* pCharMap = pDefFont->GetCharMap();
+ CPDF_Rect rcAnnot = pAnnotDict->GetRect("Rect");
+ FX_INT32 nRotate = 0;
+ if (CPDF_Dictionary * pMKDict = pAnnotDict->GetDict("MK")) {
+ nRotate = pMKDict->GetInteger("R");
+ }
+ CPDF_Rect rcBBox;
+ CPDF_Matrix matrix;
+ switch (nRotate % 360) {
+ case 0:
+ rcBBox = CPDF_Rect(0, 0, rcAnnot.right - rcAnnot.left, rcAnnot.top - rcAnnot.bottom);
+ break;
+ case 90:
+ matrix = CPDF_Matrix(0, 1, -1, 0, rcAnnot.right - rcAnnot.left, 0);
+ rcBBox = CPDF_Rect(0, 0, rcAnnot.top - rcAnnot.bottom, rcAnnot.right - rcAnnot.left);
+ break;
+ case 180:
+ matrix = CPDF_Matrix(-1, 0, 0, -1, rcAnnot.right - rcAnnot.left, rcAnnot.top - rcAnnot.bottom);
+ rcBBox = CPDF_Rect(0, 0, rcAnnot.right - rcAnnot.left, rcAnnot.top - rcAnnot.bottom);
+ break;
+ case 270:
+ matrix = CPDF_Matrix(0, -1, 1, 0, 0, rcAnnot.top - rcAnnot.bottom);
+ rcBBox = CPDF_Rect(0, 0, rcAnnot.top - rcAnnot.bottom, rcAnnot.right - rcAnnot.left);
+ break;
+ }
+ FX_INT32 nBorderStyle = PBS_SOLID;
+ FX_FLOAT fBorderWidth = 1;
+ CPVT_Dash dsBorder(3, 0, 0);
+ CPVT_Color crLeftTop, crRightBottom;
+ if (CPDF_Dictionary * pBSDict = pAnnotDict->GetDict("BS")) {
+ if (pBSDict->KeyExist("W")) {
+ fBorderWidth = pBSDict->GetNumber("W");
+ }
+ if (CPDF_Array * pArray = pBSDict->GetArray("D")) {
+ dsBorder = CPVT_Dash(pArray->GetInteger(0), pArray->GetInteger(1), pArray->GetInteger(2));
+ }
+ switch (pBSDict->GetString("S").GetAt(0)) {
+ case 'S':
+ nBorderStyle = PBS_SOLID;
+ break;
+ case 'D':
+ nBorderStyle = PBS_DASH;
+ break;
+ case 'B':
+ nBorderStyle = PBS_BEVELED;
+ fBorderWidth *= 2;
+ crLeftTop = CPVT_Color(CT_GRAY, 1);
+ crRightBottom = CPVT_Color(CT_GRAY, 0.5);
+ break;
+ case 'I':
+ nBorderStyle = PBS_INSET;
+ fBorderWidth *= 2;
+ crLeftTop = CPVT_Color(CT_GRAY, 0.5);
+ crRightBottom = CPVT_Color(CT_GRAY, 0.75);
+ break;
+ case 'U':
+ nBorderStyle = PBS_UNDERLINED;
+ break;
+ }
+ }
+ CPVT_Color crBorder, crBG;
+ if (CPDF_Dictionary * pMKDict = pAnnotDict->GetDict("MK")) {
+ if (CPDF_Array * pArray = pMKDict->GetArray("BC")) {
+ crBorder = ParseColor(*pArray);
+ }
+ if (CPDF_Array * pArray = pMKDict->GetArray("BG")) {
+ crBG = ParseColor(*pArray);
+ }
+ }
+ CFX_ByteTextBuf sAppStream;
+ CFX_ByteString sBG = CPVT_GenerateAP::GenerateColorAP(crBG, TRUE);
+ if (sBG.GetLength() > 0) {
+ sAppStream << "q\n" << sBG << rcBBox.left << " " << rcBBox.bottom << " "
+ << rcBBox.Width() << " " << rcBBox.Height() << " re f\n" << "Q\n";
+ }
+ CFX_ByteString sBorderStream = CPVT_GenerateAP::GenerateBorderAP(rcBBox, fBorderWidth,
+ crBorder, crLeftTop, crRightBottom, nBorderStyle, dsBorder);
+ if (sBorderStream.GetLength() > 0) {
+ sAppStream << "q\n" << sBorderStream << "Q\n";
+ }
+ CPDF_Rect rcBody = CPDF_Rect(rcBBox.left + fBorderWidth, rcBBox.bottom + fBorderWidth,
+ rcBBox.right - fBorderWidth, rcBBox.top - fBorderWidth);
+ rcBody.Normalize();
+ CPDF_Dictionary* pAPDict = pAnnotDict->GetDict("AP");
+ if (pAPDict == NULL) {
+ pAPDict = CPDF_Dictionary::Create();
+ if (pAPDict == NULL) {
+ return FALSE;
+ }
+ pAnnotDict->SetAt("AP", pAPDict);
+ }
+ CPDF_Stream* pNormalStream = pAPDict->GetStream("N");
+ if (pNormalStream == NULL) {
+ pNormalStream = CPDF_Stream::Create(NULL, 0, NULL);
+ if (pNormalStream == NULL) {
+ return FALSE;
+ }
+ FX_INT32 objnum = pDoc->AddIndirectObject(pNormalStream);
+ pAnnotDict->GetDict("AP")->SetAtReference("N", pDoc, objnum);
+ }
+ CPDF_Dictionary * pStreamDict = pNormalStream->GetDict();
+ if (pStreamDict) {
+ pStreamDict->SetAtMatrix("Matrix", matrix);
+ pStreamDict->SetAtRect("BBox", rcBBox);
+ CPDF_Dictionary* pStreamResList = pStreamDict->GetDict("Resources");
+ if (pStreamResList) {
+ CPDF_Dictionary* pStreamResFontList = pStreamResList->GetDict("Font");
+ if (!pStreamResFontList) {
+ pStreamResFontList = CPDF_Dictionary::Create();
+ if (pStreamResFontList == NULL) {
+ return FALSE;
+ }
+ pStreamResList->SetAt("Font", pStreamResFontList);
+ }
+ if (!pStreamResFontList->KeyExist(sFontName)) {
+ pStreamResFontList->SetAtReference(sFontName, pDoc, pFontDict);
+ }
+ } else {
+ pStreamDict->SetAt("Resources", pFormDict->GetDict("DR")->Clone());
+ pStreamResList = pStreamDict->GetDict("Resources");
+ }
+ }
+ switch (nWidgetType) {
+ case 0: {
+ CFX_WideString swValue = FPDF_GetFieldAttr(pAnnotDict, "V")->GetUnicodeText();
+ FX_INT32 nAlign = FPDF_GetFieldAttr(pAnnotDict, "Q")->GetInteger();
+ FX_DWORD dwFlags = FPDF_GetFieldAttr(pAnnotDict, "Ff")->GetInteger();
+ FX_DWORD dwMaxLen = FPDF_GetFieldAttr(pAnnotDict, "MaxLen")->GetInteger();
+ CPVT_FontMap map(pDoc, pStreamDict->GetDict("Resources"), pDefFont, sFontName.Right(sFontName.GetLength() - 1));
+ CPVT_Provider prd(&map);
+ CPDF_VariableText vt;
+ vt.SetProvider(&prd);
+ vt.SetPlateRect(rcBody);
+ vt.SetAlignment(nAlign);
+ if (IsFloatZero(fFontSize)) {
+ vt.SetAutoFontSize(TRUE);
+ } else {
+ vt.SetFontSize(fFontSize);
+ }
+ FX_BOOL bMultiLine = (dwFlags >> 12) & 1;
+ if (bMultiLine) {
+ vt.SetMultiLine(TRUE);
+ vt.SetAutoReturn(TRUE);
+ }
+ FX_WORD subWord = 0;
+ if ((dwFlags >> 13) & 1) {
+ subWord = '*';
+ vt.SetPasswordChar(subWord);
+ }
+ FX_BOOL bCharArray = (dwFlags >> 24) & 1;
+ if (bCharArray) {
+ vt.SetCharArray(dwMaxLen);
+ } else {
+ vt.SetLimitChar(dwMaxLen);
+ }
+ vt.Initialize();
+ vt.SetText(swValue);
+ vt.RearrangeAll();
+ CPDF_Rect rcContent = vt.GetContentRect();
+ CPDF_Point ptOffset(0.0f, 0.0f);
+ if (!bMultiLine) {
+ ptOffset = CPDF_Point(0.0f, (rcContent.Height() - rcBody.Height()) / 2.0f);
+ }
+ CFX_ByteString sBody = CPVT_GenerateAP::GenerateEditAP(&map, vt.GetIterator(), ptOffset, !bCharArray, subWord);
+ if (sBody.GetLength() > 0) {
+ sAppStream << "/Tx BMC\n" << "q\n";
+ if (rcContent.Width() > rcBody.Width() ||
+ rcContent.Height() > rcBody.Height()) {
+ sAppStream << rcBody.left << " " << rcBody.bottom << " "
+ << rcBody.Width() << " " << rcBody.Height() << " re\nW\nn\n";
+ }
+ sAppStream << "BT\n" << CPVT_GenerateAP::GenerateColorAP(crText, TRUE) << sBody << "ET\n" << "Q\nEMC\n";
+ }
+ }
+ break;
+ case 1: {
+ CFX_WideString swValue = FPDF_GetFieldAttr(pAnnotDict, "V")->GetUnicodeText();
+ CPVT_FontMap map(pDoc, pStreamDict->GetDict("Resources"), pDefFont, sFontName.Right(sFontName.GetLength() - 1));
+ CPVT_Provider prd(&map);
+ CPDF_VariableText vt;
+ vt.SetProvider(&prd);
+ CPDF_Rect rcButton = rcBody;
+ rcButton.left = rcButton.right - 13;
+ rcButton.Normalize();
+ CPDF_Rect rcEdit = rcBody;
+ rcEdit.right = rcButton.left;
+ rcEdit.Normalize();
+ vt.SetPlateRect(rcEdit);
+ if (IsFloatZero(fFontSize)) {
+ vt.SetAutoFontSize(TRUE);
+ } else {
+ vt.SetFontSize(fFontSize);
+ }
+ vt.Initialize();
+ vt.SetText(swValue);
+ vt.RearrangeAll();
+ CPDF_Rect rcContent = vt.GetContentRect();
+ CPDF_Point ptOffset = CPDF_Point(0.0f, (rcContent.Height() - rcEdit.Height()) / 2.0f);
+ CFX_ByteString sEdit = CPVT_GenerateAP::GenerateEditAP(&map, vt.GetIterator(), ptOffset, TRUE, 0);
+ if (sEdit.GetLength() > 0) {
+ sAppStream << "/Tx BMC\n" << "q\n";
+ sAppStream << rcEdit.left << " " << rcEdit.bottom << " "
+ << rcEdit.Width() << " " << rcEdit.Height() << " re\nW\nn\n";
+ sAppStream << "BT\n" << CPVT_GenerateAP::GenerateColorAP(crText, TRUE) << sEdit << "ET\n" << "Q\nEMC\n";
+ }
+ CFX_ByteString sButton = CPVT_GenerateAP::GenerateColorAP(CPVT_Color(CT_RGB, 220.0f / 255.0f, 220.0f / 255.0f, 220.0f / 255.0f), TRUE);
+ if (sButton.GetLength() > 0 && !rcButton.IsEmpty()) {
+ sAppStream << "q\n" << sButton;
+ sAppStream << rcButton.left << " " << rcButton.bottom << " "
+ << rcButton.Width() << " " << rcButton.Height() << " re f\n";
+ sAppStream << "Q\n";
+ CFX_ByteString sButtonBorder = CPVT_GenerateAP::GenerateBorderAP(rcButton, 2, CPVT_Color(CT_GRAY, 0), CPVT_Color(CT_GRAY, 1), CPVT_Color(CT_GRAY, 0.5), PBS_BEVELED, CPVT_Dash(3, 0, 0));
+ if (sButtonBorder.GetLength() > 0) {
+ sAppStream << "q\n" << sButtonBorder << "Q\n";
+ }
+ CPDF_Point ptCenter = CPDF_Point((rcButton.left + rcButton.right) / 2, (rcButton.top + rcButton.bottom) / 2);
+ if (IsFloatBigger(rcButton.Width(), 6) && IsFloatBigger(rcButton.Height(), 6)) {
+ sAppStream << "q\n" << " 0 g\n";
+ sAppStream << ptCenter.x - 3 << " " << ptCenter.y + 1.5f << " m\n";
+ sAppStream << ptCenter.x + 3 << " " << ptCenter.y + 1.5f << " l\n";
+ sAppStream << ptCenter.x << " " << ptCenter.y - 1.5f << " l\n";
+ sAppStream << ptCenter.x - 3 << " " << ptCenter.y + 1.5f << " l f\n";
+ sAppStream << sButton << "Q\n";
+ }
+ }
+ }
+ break;
+ case 2: {
+ CPVT_FontMap map(pDoc, pStreamDict->GetDict("Resources"), pDefFont, sFontName.Right(sFontName.GetLength() - 1));
+ CPVT_Provider prd(&map);
+ CPDF_Array * pOpts = FPDF_GetFieldAttr(pAnnotDict, "Opt")->GetArray();
+ CPDF_Array * pSels = FPDF_GetFieldAttr(pAnnotDict, "I")->GetArray();
+ FX_INT32 nTop = FPDF_GetFieldAttr(pAnnotDict, "TI")->GetInteger();
+ CFX_ByteTextBuf sBody;
+ if (pOpts) {
+ FX_FLOAT fy = rcBody.top;
+ for (FX_INT32 i = nTop, sz = pOpts->GetCount(); i < sz; i++) {
+ if (IsFloatSmaller(fy, rcBody.bottom)) {
+ break;
+ }
+ if (CPDF_Object* pOpt = pOpts->GetElementValue(i)) {
+ CFX_WideString swItem;
+ if (pOpt->GetType() == PDFOBJ_STRING) {
+ swItem = pOpt->GetUnicodeText();
+ } else if (pOpt->GetType() == PDFOBJ_ARRAY) {
+ swItem = ((CPDF_Array*)pOpt)->GetElementValue(1)->GetUnicodeText();
+ }
+ FX_BOOL bSelected = FALSE;
+ if (pSels) {
+ for (FX_DWORD s = 0, ssz = pSels->GetCount(); s < ssz; s++) {
+ if (i == pSels->GetInteger(s)) {
+ bSelected = TRUE;
+ break;
+ }
+ }
+ }
+ CPDF_VariableText vt;
+ vt.SetProvider(&prd);
+ vt.SetPlateRect(CPDF_Rect(rcBody.left, 0.0f, rcBody.right, 0.0f));
+ if (IsFloatZero(fFontSize)) {
+ vt.SetFontSize(12.0f);
+ } else {
+ vt.SetFontSize(fFontSize);
+ }
+ vt.Initialize();
+ vt.SetText(swItem);
+ vt.RearrangeAll();
+ FX_FLOAT fItemHeight = vt.GetContentRect().Height();
+ if (bSelected) {
+ CPDF_Rect rcItem = CPDF_Rect(rcBody.left, fy - fItemHeight, rcBody.right, fy);
+ sBody << "q\n" << CPVT_GenerateAP::GenerateColorAP(CPVT_Color(CT_RGB, 0, 51.0f / 255.0f, 113.0f / 255.0f), TRUE)
+ << rcItem.left << " " << rcItem.bottom << " " << rcItem.Width() << " " << rcItem.Height() << " re f\n" << "Q\n";
+ sBody << "BT\n" << CPVT_GenerateAP::GenerateColorAP(CPVT_Color(CT_GRAY, 1), TRUE) << CPVT_GenerateAP::GenerateEditAP(&map, vt.GetIterator(), CPDF_Point(0.0f, fy), TRUE, 0) << "ET\n";
+ } else {
+ sBody << "BT\n" << CPVT_GenerateAP::GenerateColorAP(crText, TRUE) << CPVT_GenerateAP::GenerateEditAP(&map, vt.GetIterator(), CPDF_Point(0.0f, fy), TRUE, 0) << "ET\n";
+ }
+ fy -= fItemHeight;
+ }
+ }
+ }
+ if (sBody.GetSize() > 0) {
+ sAppStream << "/Tx BMC\n" << "q\n";
+ sAppStream << rcBody.left << " " << rcBody.bottom << " "
+ << rcBody.Width() << " " << rcBody.Height() << " re\nW\nn\n";
+ sAppStream << sBody.GetByteString() << "Q\nEMC\n";
+ }
+ }
+ break;
+ }
+ if (pNormalStream) {
+ pNormalStream->SetData((FX_BYTE*)sAppStream.GetBuffer(), sAppStream.GetSize(), FALSE, FALSE);
+ pStreamDict = pNormalStream->GetDict();
+ if (pStreamDict) {
+ pStreamDict->SetAtMatrix("Matrix", matrix);
+ pStreamDict->SetAtRect("BBox", rcBBox);
+ CPDF_Dictionary* pStreamResList = pStreamDict->GetDict("Resources");
+ if (pStreamResList) {
+ CPDF_Dictionary* pStreamResFontList = pStreamResList->GetDict("Font");
+ if (!pStreamResFontList) {
+ pStreamResFontList = CPDF_Dictionary::Create();
+ if (pStreamResFontList == NULL) {
+ return FALSE;
+ }
+ pStreamResList->SetAt("Font", pStreamResFontList);
+ }
+ if (!pStreamResFontList->KeyExist(sFontName)) {
+ pStreamResFontList->SetAtReference(sFontName, pDoc, pFontDict);
+ }
+ } else {
+ pStreamDict->SetAt("Resources", pFormDict->GetDict("DR")->Clone());
+ pStreamResList = pStreamDict->GetDict("Resources");
+ }
+ }
+ }
+ return TRUE;
+}
+FX_BOOL CPVT_GenerateAP::GenerateTextFieldAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict)
+{
+ return GenerateWidgetAP(pDoc, pAnnotDict, 0);
+}
+FX_BOOL CPVT_GenerateAP::GenerateComboBoxAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict)
+{
+ return GenerateWidgetAP(pDoc, pAnnotDict, 1);
+}
+FX_BOOL CPVT_GenerateAP::GenerateListBoxAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict)
+{
+ return GenerateWidgetAP(pDoc, pAnnotDict, 2);
+}
+CFX_ByteString CPVT_GenerateAP::GenerateEditAP(IPVT_FontMap * pFontMap, IPDF_VariableText_Iterator* pIterator, const CPDF_Point & ptOffset, FX_BOOL bContinuous, FX_WORD SubWord, const CPVT_WordRange * pVisible)
+{
+ CFX_ByteTextBuf sEditStream, sLineStream, sWords;
+ CPDF_Point ptOld(0.0f, 0.0f), ptNew(0.0f, 0.0f);
+ FX_INT32 nCurFontIndex = -1;
+ if (pIterator) {
+ if (pVisible) {
+ pIterator->SetAt(pVisible->BeginPos);
+ } else {
+ pIterator->SetAt(0);
+ }
+ CPVT_WordPlace oldplace;
+ while (pIterator->NextWord()) {
+ CPVT_WordPlace place = pIterator->GetAt();
+ if (pVisible && place.WordCmp(pVisible->EndPos) > 0) {
+ break;
+ }
+ if (bContinuous) {
+ if (place.LineCmp(oldplace) != 0) {
+ if (sWords.GetSize() > 0) {
+ sLineStream << GetWordRenderString(sWords.GetByteString());
+ sEditStream << sLineStream;
+ sLineStream.Clear();
+ sWords.Clear();
+ }
+ CPVT_Word word;
+ if (pIterator->GetWord(word)) {
+ ptNew = CPDF_Point(word.ptWord.x + ptOffset.x, word.ptWord.y + ptOffset.y);
+ } else {
+ CPVT_Line line;
+ pIterator->GetLine(line);
+ ptNew = CPDF_Point(line.ptLine.x + ptOffset.x, line.ptLine.y + ptOffset.y);
+ }
+ if (ptNew.x != ptOld.x || ptNew.y != ptOld.y) {
+ sLineStream << ptNew.x - ptOld.x << " " << ptNew.y - ptOld.y << " Td\n";
+ ptOld = ptNew;
+ }
+ }
+ CPVT_Word word;
+ if (pIterator->GetWord(word)) {
+ if (word.nFontIndex != nCurFontIndex) {
+ if (sWords.GetSize() > 0) {
+ sLineStream << GetWordRenderString(sWords.GetByteString());
+ sWords.Clear();
+ }
+ sLineStream << GetFontSetString(pFontMap, word.nFontIndex, word.fFontSize);
+ nCurFontIndex = word.nFontIndex;
+ }
+ sWords << GetPDFWordString(pFontMap, nCurFontIndex, word.Word, SubWord);
+ }
+ oldplace = place;
+ } else {
+ CPVT_Word word;
+ if (pIterator->GetWord(word)) {
+ ptNew = CPDF_Point(word.ptWord.x + ptOffset.x, word.ptWord.y + ptOffset.y);
+ if (ptNew.x != ptOld.x || ptNew.y != ptOld.y) {
+ sEditStream << ptNew.x - ptOld.x << " " << ptNew.y - ptOld.y << " Td\n";
+ ptOld = ptNew;
+ }
+ if (word.nFontIndex != nCurFontIndex) {
+ sEditStream << GetFontSetString(pFontMap, word.nFontIndex, word.fFontSize);
+ nCurFontIndex = word.nFontIndex;
+ }
+ sEditStream << GetWordRenderString(GetPDFWordString(pFontMap, nCurFontIndex, word.Word, SubWord));
+ }
+ }
+ }
+ if (sWords.GetSize() > 0) {
+ sLineStream << GetWordRenderString(sWords.GetByteString());
+ sEditStream << sLineStream;
+ sWords.Clear();
+ }
+ }
+ return sEditStream.GetByteString();
+}
+CFX_ByteString CPVT_GenerateAP::GenerateBorderAP(const CPDF_Rect & rect, FX_FLOAT fWidth,
+ const CPVT_Color & color, const CPVT_Color & crLeftTop, const CPVT_Color & crRightBottom,
+ FX_INT32 nStyle, const CPVT_Dash & dash)
+{
+ CFX_ByteTextBuf sAppStream;
+ CFX_ByteString sColor;
+ FX_FLOAT fLeft = rect.left;
+ FX_FLOAT fRight = rect.right;
+ FX_FLOAT fTop = rect.top;
+ FX_FLOAT fBottom = rect.bottom;
+ if (fWidth > 0.0f) {
+ FX_FLOAT fHalfWidth = fWidth / 2.0f;
+ switch (nStyle) {
+ default:
+ case PBS_SOLID:
+ sColor = GenerateColorAP(color, TRUE);
+ if (sColor.GetLength() > 0) {
+ sAppStream << sColor;
+ sAppStream << fLeft << " " << fBottom << " " << fRight - fLeft << " " << fTop - fBottom << " re\n";
+ sAppStream << fLeft + fWidth << " " << fBottom + fWidth << " "
+ << fRight - fLeft - fWidth * 2 << " " << fTop - fBottom - fWidth * 2 << " re\n";
+ sAppStream << "f*\n";
+ }
+ break;
+ case PBS_DASH:
+ sColor = GenerateColorAP(color, FALSE);
+ if (sColor.GetLength() > 0) {
+ sAppStream << sColor;
+ sAppStream << fWidth << " w" << " [" << dash.nDash << " " << dash.nGap << "] " << dash.nPhase << " d\n";
+ sAppStream << fLeft + fWidth / 2 << " " << fBottom + fWidth / 2 << " m\n";
+ sAppStream << fLeft + fWidth / 2 << " " << fTop - fWidth / 2 << " l\n";
+ sAppStream << fRight - fWidth / 2 << " " << fTop - fWidth / 2 << " l\n";
+ sAppStream << fRight - fWidth / 2 << " " << fBottom + fWidth / 2 << " l\n";
+ sAppStream << fLeft + fWidth / 2 << " " << fBottom + fWidth / 2 << " l S\n";
+ }
+ break;
+ case PBS_BEVELED:
+ case PBS_INSET:
+ sColor = GenerateColorAP(crLeftTop, TRUE);
+ if (sColor.GetLength() > 0) {
+ sAppStream << sColor;
+ sAppStream << fLeft + fHalfWidth << " " << fBottom + fHalfWidth << " m\n";
+ sAppStream << fLeft + fHalfWidth << " " << fTop - fHalfWidth << " l\n";
+ sAppStream << fRight - fHalfWidth << " " << fTop - fHalfWidth << " l\n";
+ sAppStream << fRight - fHalfWidth * 2 << " " << fTop - fHalfWidth * 2 << " l\n";
+ sAppStream << fLeft + fHalfWidth * 2 << " " << fTop - fHalfWidth * 2 << " l\n";
+ sAppStream << fLeft + fHalfWidth * 2 << " " << fBottom + fHalfWidth * 2 << " l f\n";
+ }
+ sColor = GenerateColorAP(crRightBottom, TRUE);
+ if (sColor.GetLength() > 0) {
+ sAppStream << sColor;
+ sAppStream << fRight - fHalfWidth << " " << fTop - fHalfWidth << " m\n";
+ sAppStream << fRight - fHalfWidth << " " << fBottom + fHalfWidth << " l\n";
+ sAppStream << fLeft + fHalfWidth << " " << fBottom + fHalfWidth << " l\n";
+ sAppStream << fLeft + fHalfWidth * 2 << " " << fBottom + fHalfWidth * 2 << " l\n";
+ sAppStream << fRight - fHalfWidth * 2 << " " << fBottom + fHalfWidth * 2 << " l\n";
+ sAppStream << fRight - fHalfWidth * 2 << " " << fTop - fHalfWidth * 2 << " l f\n";
+ }
+ sColor = GenerateColorAP(color, TRUE);
+ if (sColor.GetLength() > 0) {
+ sAppStream << sColor;
+ sAppStream << fLeft << " " << fBottom << " " << fRight - fLeft << " " << fTop - fBottom << " re\n";
+ sAppStream << fLeft + fHalfWidth << " " << fBottom + fHalfWidth << " "
+ << fRight - fLeft - fHalfWidth * 2 << " " << fTop - fBottom - fHalfWidth * 2 << " re f*\n";
+ }
+ break;
+ case PBS_UNDERLINED:
+ sColor = GenerateColorAP(color, FALSE);
+ if (sColor.GetLength() > 0) {
+ sAppStream << sColor;
+ sAppStream << fWidth << " w\n";
+ sAppStream << fLeft << " " << fBottom + fWidth / 2 << " m\n";
+ sAppStream << fRight << " " << fBottom + fWidth / 2 << " l S\n";
+ }
+ break;
+ }
+ }
+ return sAppStream.GetByteString();
+}
+CFX_ByteString CPVT_GenerateAP::GenerateColorAP(const CPVT_Color & color, const FX_BOOL & bFillOrStroke)
+{
+ CFX_ByteTextBuf sColorStream;
+ switch (color.nColorType) {
+ case CT_RGB:
+ sColorStream << color.fColor1 << " " << color.fColor2 << " " << color.fColor3 << " "
+ << (bFillOrStroke ? "rg" : "RG") << "\n";
+ break;
+ case CT_GRAY:
+ sColorStream << color.fColor1 << " " << (bFillOrStroke ? "g" : "G") << "\n";
+ break;
+ case CT_CMYK:
+ sColorStream << color.fColor1 << " " << color.fColor2 << " " << color.fColor3 << " " << color.fColor4 << " "
+ << (bFillOrStroke ? "k" : "K") << "\n";
+ break;
+ }
+ return sColorStream.GetByteString();
+}
diff --git a/core/src/fpdfdoc/doc_basic.cpp b/core/src/fpdfdoc/doc_basic.cpp
index 4ec8fb74fd..199a9a6dec 100644
--- a/core/src/fpdfdoc/doc_basic.cpp
+++ b/core/src/fpdfdoc/doc_basic.cpp
@@ -1,567 +1,567 @@
-// 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
-
-#include "../../include/fpdfdoc/fpdf_doc.h"
-const int nMaxRecursion = 32;
-int CPDF_Dest::GetPageIndex(CPDF_Document* pDoc)
-{
- if (m_pObj == NULL || m_pObj->GetType() != PDFOBJ_ARRAY) {
- return 0;
- }
- CPDF_Object* pPage = ((CPDF_Array*)m_pObj)->GetElementValue(0);
- if (pPage == NULL) {
- return 0;
- }
- if (pPage->GetType() == PDFOBJ_NUMBER) {
- return pPage->GetInteger();
- }
- if (pPage->GetType() != PDFOBJ_DICTIONARY) {
- return 0;
- }
- return pDoc->GetPageIndex(pPage->GetObjNum());
-}
-FX_DWORD CPDF_Dest::GetPageObjNum()
-{
- if (m_pObj == NULL || m_pObj->GetType() != PDFOBJ_ARRAY) {
- return 0;
- }
- CPDF_Object* pPage = ((CPDF_Array*)m_pObj)->GetElementValue(0);
- if (pPage == NULL) {
- return 0;
- }
- if (pPage->GetType() == PDFOBJ_NUMBER) {
- return pPage->GetInteger();
- }
- if (pPage->GetType() == PDFOBJ_DICTIONARY) {
- return pPage->GetObjNum();
- }
- return 0;
-}
-const FX_CHAR* g_sZoomModes[] = {"XYZ", "Fit", "FitH", "FitV", "FitR", "FitB", "FitBH", "FitBV", ""};
-int CPDF_Dest::GetZoomMode()
-{
- if (m_pObj == NULL || m_pObj->GetType() != PDFOBJ_ARRAY) {
- return 0;
- }
- CFX_ByteString mode = ((CPDF_Array*)m_pObj)->GetElementValue(1)->GetString();
- int i = 0;
- while (g_sZoomModes[i][0] != '\0') {
- if (mode == g_sZoomModes[i]) {
- return i + 1;
- }
- i ++;
- }
- return 0;
-}
-FX_FLOAT CPDF_Dest::GetParam(int index)
-{
- if (m_pObj == NULL || m_pObj->GetType() != PDFOBJ_ARRAY) {
- return 0;
- }
- return ((CPDF_Array*)m_pObj)->GetNumber(2 + index);
-}
-CFX_ByteString CPDF_Dest::GetRemoteName()
-{
- if (m_pObj == NULL) {
- return CFX_ByteString();
- }
- return m_pObj->GetString();
-}
-CPDF_NameTree::CPDF_NameTree(CPDF_Document* pDoc, FX_BSTR category)
-{
- m_pRoot = pDoc->GetRoot()->GetDict(FX_BSTRC("Names"))->GetDict(category);
-}
-static CPDF_Object* SearchNameNode(CPDF_Dictionary* pNode, const CFX_ByteString& csName,
- int& nIndex, CPDF_Array** ppFind, int nLevel = 0)
-{
- if (nLevel > nMaxRecursion) {
- return NULL;
- }
- CPDF_Array* pLimits = pNode->GetArray(FX_BSTRC("Limits"));
- if (pLimits != NULL) {
- CFX_ByteString csLeft = pLimits->GetString(0);
- CFX_ByteString csRight = pLimits->GetString(1);
- if (csLeft.Compare(csRight) > 0) {
- CFX_ByteString csTmp = csRight;
- csRight = csLeft;
- csLeft = csTmp;
- }
- if (csName.Compare(csLeft) < 0 || csName.Compare(csRight) > 0) {
- return NULL;
- }
- }
- CPDF_Array* pNames = pNode->GetArray(FX_BSTRC("Names"));
- if (pNames) {
- FX_DWORD dwCount = pNames->GetCount() / 2;
- for (FX_DWORD i = 0; i < dwCount; i ++) {
- CFX_ByteString csValue = pNames->GetString(i * 2);
- FX_INT32 iCompare = csValue.Compare(csName);
- if (iCompare <= 0) {
- if (ppFind != NULL) {
- *ppFind = pNames;
- }
- if (iCompare < 0) {
- continue;
- }
- } else {
- break;
- }
- nIndex += i;
- return pNames->GetElementValue(i * 2 + 1);
- }
- nIndex += dwCount;
- return NULL;
- }
- CPDF_Array* pKids = pNode->GetArray(FX_BSTRC("Kids"));
- if (pKids == NULL) {
- return NULL;
- }
- for (FX_DWORD i = 0; i < pKids->GetCount(); i ++) {
- CPDF_Dictionary* pKid = pKids->GetDict(i);
- if (pKid == NULL) {
- continue;
- }
- CPDF_Object* pFound = SearchNameNode(pKid, csName, nIndex, ppFind, nLevel + 1);
- if (pFound) {
- return pFound;
- }
- }
- return NULL;
-}
-static CPDF_Object* SearchNameNode(CPDF_Dictionary* pNode, int nIndex, int& nCurIndex,
- CFX_ByteString& csName, CPDF_Array** ppFind, int nLevel = 0)
-{
- if (nLevel > nMaxRecursion) {
- return NULL;
- }
- CPDF_Array* pNames = pNode->GetArray(FX_BSTRC("Names"));
- if (pNames) {
- int nCount = pNames->GetCount() / 2;
- if (nIndex >= nCurIndex + nCount) {
- nCurIndex += nCount;
- return NULL;
- } else {
- if (ppFind != NULL) {
- *ppFind = pNames;
- }
- csName = pNames->GetString((nIndex - nCurIndex) * 2);
- return pNames->GetElementValue((nIndex - nCurIndex) * 2 + 1);
- }
- }
- CPDF_Array* pKids = pNode->GetArray(FX_BSTRC("Kids"));
- if (pKids == NULL) {
- return NULL;
- }
- for (FX_DWORD i = 0; i < pKids->GetCount(); i ++) {
- CPDF_Dictionary* pKid = pKids->GetDict(i);
- if (pKid == NULL) {
- continue;
- }
- CPDF_Object* pFound = SearchNameNode(pKid, nIndex, nCurIndex, csName, ppFind, nLevel + 1);
- if (pFound) {
- return pFound;
- }
- }
- return NULL;
-}
-static int CountNames(CPDF_Dictionary* pNode, int nLevel = 0)
-{
- if (nLevel > nMaxRecursion) {
- return 0;
- }
- CPDF_Array* pNames = pNode->GetArray(FX_BSTRC("Names"));
- if (pNames) {
- return pNames->GetCount() / 2;
- }
- CPDF_Array* pKids = pNode->GetArray(FX_BSTRC("Kids"));
- if (pKids == NULL) {
- return 0;
- }
- int nCount = 0;
- for (FX_DWORD i = 0; i < pKids->GetCount(); i ++) {
- CPDF_Dictionary* pKid = pKids->GetDict(i);
- if (pKid == NULL) {
- continue;
- }
- nCount += CountNames(pKid, nLevel + 1);
- }
- return nCount;
-}
-int CPDF_NameTree::GetCount() const
-{
- if (m_pRoot == NULL) {
- return 0;
- }
- return ::CountNames(m_pRoot);
-}
-int CPDF_NameTree::GetIndex(const CFX_ByteString& csName) const
-{
- if (m_pRoot == NULL) {
- return -1;
- }
- int nIndex = 0;
- if (SearchNameNode(m_pRoot, csName, nIndex, NULL) == NULL) {
- return -1;
- }
- return nIndex;
-}
-CPDF_Object* CPDF_NameTree::LookupValue(int nIndex, CFX_ByteString& csName) const
-{
- if (m_pRoot == NULL) {
- return NULL;
- }
- int nCurIndex = 0;
- return SearchNameNode(m_pRoot, nIndex, nCurIndex, csName, NULL);
-}
-CPDF_Object* CPDF_NameTree::LookupValue(const CFX_ByteString& csName) const
-{
- if (m_pRoot == NULL) {
- return NULL;
- }
- int nIndex = 0;
- return SearchNameNode(m_pRoot, csName, nIndex, NULL);
-}
-CPDF_Array* CPDF_NameTree::LookupNamedDest(CPDF_Document* pDoc, FX_BSTR sName)
-{
- CPDF_Object* pValue = LookupValue(sName);
- if (pValue == NULL) {
- CPDF_Dictionary* pDests = pDoc->GetRoot()->GetDict(FX_BSTRC("Dests"));
- if (pDests == NULL) {
- return NULL;
- }
- pValue = pDests->GetElementValue(sName);
- }
- if (pValue == NULL) {
- return NULL;
- }
- if (pValue->GetType() == PDFOBJ_ARRAY) {
- return (CPDF_Array*)pValue;
- }
- if (pValue->GetType() == PDFOBJ_DICTIONARY) {
- return ((CPDF_Dictionary*)pValue)->GetArray(FX_BSTRC("D"));
- }
- return NULL;
-}
-static CFX_WideString ChangeSlashToPlatform(FX_LPCWSTR str)
-{
- CFX_WideString result;
- while (*str) {
- if (*str == '/') {
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
- result += ':';
-#elif _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
- result += '\\';
-#else
- result += *str;
-#endif
- } else {
- result += *str;
- }
- str++;
- }
- return result;
-}
-static CFX_WideString FILESPEC_DecodeFileName(FX_WSTR filepath)
-{
- if (filepath.GetLength() <= 1) {
- return CFX_WideString();
- }
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
- if (filepath.Left(sizeof("/Mac") - 1) == CFX_WideStringC(L"/Mac")) {
- return ChangeSlashToPlatform(filepath.GetPtr() + 1);
- }
- return ChangeSlashToPlatform(filepath.GetPtr());
-#elif _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
- if (filepath.GetAt(0) != '/') {
- return ChangeSlashToPlatform(filepath.GetPtr());
- }
- if (filepath.GetAt(1) == '/') {
- return ChangeSlashToPlatform(filepath.GetPtr() + 1);
- }
- if (filepath.GetAt(2) == '/') {
- CFX_WideString result;
- result += filepath.GetAt(1);
- result += ':';
- result += ChangeSlashToPlatform(filepath.GetPtr() + 2);
- return result;
- }
- CFX_WideString result;
- result += '\\';
- result += ChangeSlashToPlatform(filepath.GetPtr());
- return result;
-#else
- return filepath;
-#endif
-}
-FX_BOOL CPDF_FileSpec::GetFileName(CFX_WideString &csFileName) const
-{
- if (m_pObj == NULL) {
- return FALSE;
- }
- if (m_pObj->GetType() == PDFOBJ_DICTIONARY) {
- CPDF_Dictionary* pDict = (CPDF_Dictionary*)m_pObj;
- csFileName = pDict->GetUnicodeText(FX_BSTRC("UF"));
- if (csFileName.IsEmpty()) {
- csFileName = CFX_WideString::FromLocal(pDict->GetString(FX_BSTRC("F")));
- }
- if (pDict->GetString(FX_BSTRC("FS")) == FX_BSTRC("URL")) {
- return TRUE;
- }
- if (csFileName.IsEmpty()) {
- if (pDict->KeyExist(FX_BSTRC("DOS"))) {
- csFileName = CFX_WideString::FromLocal(pDict->GetString(FX_BSTRC("DOS")));
- } else if (pDict->KeyExist(FX_BSTRC("Mac"))) {
- csFileName = CFX_WideString::FromLocal(pDict->GetString(FX_BSTRC("Mac")));
- } else if (pDict->KeyExist(FX_BSTRC("Unix"))) {
- csFileName = CFX_WideString::FromLocal(pDict->GetString(FX_BSTRC("Unix")));
- } else {
- return FALSE;
- }
- }
- } else {
- csFileName = CFX_WideString::FromLocal(m_pObj->GetString());
- }
- csFileName = FILESPEC_DecodeFileName(csFileName);
- return TRUE;
-}
-CPDF_FileSpec::CPDF_FileSpec()
-{
- m_pObj = CPDF_Dictionary::Create();
- if (m_pObj != NULL) {
- ((CPDF_Dictionary*)m_pObj)->SetAtName(FX_BSTRC("Type"), FX_BSTRC("Filespec"));
- }
-}
-FX_BOOL CPDF_FileSpec::IsURL() const
-{
- if (m_pObj == NULL) {
- return FALSE;
- }
- if (m_pObj->GetType() != PDFOBJ_DICTIONARY) {
- return FALSE;
- }
- return ((CPDF_Dictionary*)m_pObj)->GetString(FX_BSTRC("FS")) == FX_BSTRC("URL");
-}
-static CFX_WideString ChangeSlashToPDF(FX_LPCWSTR str)
-{
- CFX_WideString result;
- while (*str) {
- if (*str == '\\' || *str == ':') {
- result += '/';
- } else {
- result += *str;
- }
- str++;
- }
- return result;
-}
-CFX_WideString FILESPEC_EncodeFileName(FX_WSTR filepath)
-{
- if (filepath.GetLength() <= 1) {
- return CFX_WideString();
- }
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
- if (filepath.GetAt(1) == ':') {
- CFX_WideString result;
- result = '/';
- result += filepath.GetAt(0);
- if (filepath.GetAt(2) != '\\') {
- result += '/';
- }
- result += ChangeSlashToPDF(filepath.GetPtr() + 2);
- return result;
- }
- if (filepath.GetAt(0) == '\\' && filepath.GetAt(1) == '\\') {
- return ChangeSlashToPDF(filepath.GetPtr() + 1);
- }
- if (filepath.GetAt(0) == '\\') {
- CFX_WideString result;
- result = '/';
- result += ChangeSlashToPDF(filepath.GetPtr());
- return result;
- }
- return ChangeSlashToPDF(filepath.GetPtr());
-#elif _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
- if (filepath.Left(sizeof("Mac") - 1) == FX_WSTRC(L"Mac")) {
- CFX_WideString result;
- result = '/';
- result += ChangeSlashToPDF(filepath.GetPtr());
- return result;
- }
- return ChangeSlashToPDF(filepath.GetPtr());
-#else
- return filepath;
-#endif
-}
-CPDF_Stream* CPDF_FileSpec::GetFileStream() const
-{
- if (m_pObj == NULL) {
- return NULL;
- }
- FX_INT32 iType = m_pObj->GetType();
- if (iType == PDFOBJ_STREAM) {
- return (CPDF_Stream*)m_pObj;
- } else if (iType == PDFOBJ_DICTIONARY) {
- CPDF_Dictionary *pEF = ((CPDF_Dictionary*)m_pObj)->GetDict(FX_BSTRC("EF"));
- if (pEF == NULL) {
- return NULL;
- }
- return pEF->GetStream(FX_BSTRC("F"));
- }
- return NULL;
-}
-static void FPDFDOC_FILESPEC_SetFileName(CPDF_Object *pObj, FX_WSTR wsFileName, FX_BOOL bURL)
-{
- ASSERT(pObj != NULL);
- CFX_WideString wsStr;
- if (bURL) {
- wsStr = wsFileName;
- } else {
- wsStr = FILESPEC_EncodeFileName(wsFileName);
- }
- FX_INT32 iType = pObj->GetType();
- if (iType == PDFOBJ_STRING) {
- pObj->SetString(CFX_ByteString::FromUnicode(wsStr));
- } else if (iType == PDFOBJ_DICTIONARY) {
- CPDF_Dictionary* pDict = (CPDF_Dictionary*)pObj;
- pDict->SetAtString(FX_BSTRC("F"), CFX_ByteString::FromUnicode(wsStr));
- pDict->SetAtString(FX_BSTRC("UF"), PDF_EncodeText(wsStr));
- }
-}
-void CPDF_FileSpec::SetFileName(FX_WSTR wsFileName, FX_BOOL bURL)
-{
- ASSERT(m_pObj != NULL);
- if (m_pObj->GetType() == PDFOBJ_DICTIONARY && bURL) {
- ((CPDF_Dictionary*)m_pObj)->SetAtName(FX_BSTRC("FS"), "URL");
- }
- FPDFDOC_FILESPEC_SetFileName(m_pObj, wsFileName, bURL);
-}
-static CFX_WideString _MakeRoman(int num)
-{
- const int arabic[] = {
- 1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1
- };
- const CFX_WideString roman[] = {
- L"m", L"cm", L"d", L"cd", L"c", L"xc", L"l", L"xl", L"x", L"ix", L"v", L"iv", L"i"
- };
- const int nMaxNum = 1000000;
- num %= nMaxNum;
- int i = 0;
- CFX_WideString wsRomanNumber;
- while (num > 0) {
- while (num >= arabic[i]) {
- num = num - arabic[i];
- wsRomanNumber += roman[i];
- }
- i = i + 1;
- }
- return wsRomanNumber;
-}
-static CFX_WideString _MakeLetters(int num)
-{
- if (num == 0) {
- return CFX_WideString();
- }
- CFX_WideString wsLetters;
- const int nMaxCount = 1000;
- const int nLetterCount = 26;
- num -= 1;
- int count = num / nLetterCount + 1;
- count %= nMaxCount;
- FX_WCHAR ch = L'a' + num % nLetterCount;
- for (int i = 0; i < count; i++) {
- wsLetters += ch;
- }
- return wsLetters;
-}
-static CFX_WideString _GetLabelNumPortion(int num, const CFX_ByteString& bsStyle)
-{
- CFX_WideString wsNumPortion;
- if (bsStyle.IsEmpty()) {
- return wsNumPortion;
- }
- if (bsStyle == "D") {
- wsNumPortion.Format((FX_LPCWSTR)L"%d", num);
- } else if (bsStyle == "R") {
- wsNumPortion = _MakeRoman(num);
- wsNumPortion.MakeUpper();
- } else if (bsStyle == "r") {
- wsNumPortion = _MakeRoman(num);
- } else if (bsStyle == "A") {
- wsNumPortion = _MakeLetters(num);
- wsNumPortion.MakeUpper();
- } else if (bsStyle == "a") {
- wsNumPortion = _MakeLetters(num);
- }
- return wsNumPortion;
-}
-CFX_WideString CPDF_PageLabel::GetLabel(int nPage) const
-{
- CFX_WideString wsLabel;
- if (m_pDocument == NULL) {
- return wsLabel;
- }
- CPDF_Dictionary* pPDFRoot = m_pDocument->GetRoot();
- if (pPDFRoot == NULL) {
- return wsLabel;
- }
- CPDF_Dictionary* pLabels = pPDFRoot->GetDict(FX_BSTRC("PageLabels"));
- CPDF_NumberTree numberTree(pLabels);
- CPDF_Object* pValue = NULL;
- int n = nPage;
- while (n >= 0) {
- pValue = numberTree.LookupValue(n);
- if (pValue != NULL) {
- break;
- }
- n--;
- }
- if (pValue != NULL) {
- pValue = pValue->GetDirect();
- if (pValue->GetType() == PDFOBJ_DICTIONARY) {
- CPDF_Dictionary* pLabel = (CPDF_Dictionary*)pValue;
- if (pLabel->KeyExist(FX_BSTRC("P"))) {
- wsLabel += pLabel->GetUnicodeText(FX_BSTRC("P"));
- }
- CFX_ByteString bsNumberingStyle = pLabel->GetString(FX_BSTRC("S"), NULL);
- int nLabelNum = nPage - n + pLabel->GetInteger(FX_BSTRC("St"), 1);
- CFX_WideString wsNumPortion = _GetLabelNumPortion(nLabelNum, bsNumberingStyle);
- wsLabel += wsNumPortion;
- return wsLabel;
- }
- }
- wsLabel.Format((FX_LPCWSTR)L"%d", nPage + 1);
- return wsLabel;
-}
-FX_INT32 CPDF_PageLabel::GetPageByLabel(FX_BSTR bsLabel) const
-{
- if (m_pDocument == NULL) {
- return -1;
- }
- CPDF_Dictionary* pPDFRoot = m_pDocument->GetRoot();
- if (pPDFRoot == NULL) {
- return -1;
- }
- int nPages = m_pDocument->GetPageCount();
- CFX_ByteString bsLbl;
- CFX_ByteString bsOrig = bsLabel;
- for (int i = 0; i < nPages; i++) {
- bsLbl = PDF_EncodeText(GetLabel(i));
- if (!bsLbl.Compare(bsOrig)) {
- return i;
- }
- }
- bsLbl = bsOrig;
- int nPage = FXSYS_atoi(bsLbl);
- if (nPage > 0 && nPage <= nPages) {
- return nPage;
- }
- return -1;
-}
-FX_INT32 CPDF_PageLabel::GetPageByLabel(FX_WSTR wsLabel) const
-{
- CFX_ByteString bsLabel = PDF_EncodeText((CFX_WideString)wsLabel);
- return GetPageByLabel(bsLabel);
-}
+// 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
+
+#include "../../include/fpdfdoc/fpdf_doc.h"
+const int nMaxRecursion = 32;
+int CPDF_Dest::GetPageIndex(CPDF_Document* pDoc)
+{
+ if (m_pObj == NULL || m_pObj->GetType() != PDFOBJ_ARRAY) {
+ return 0;
+ }
+ CPDF_Object* pPage = ((CPDF_Array*)m_pObj)->GetElementValue(0);
+ if (pPage == NULL) {
+ return 0;
+ }
+ if (pPage->GetType() == PDFOBJ_NUMBER) {
+ return pPage->GetInteger();
+ }
+ if (pPage->GetType() != PDFOBJ_DICTIONARY) {
+ return 0;
+ }
+ return pDoc->GetPageIndex(pPage->GetObjNum());
+}
+FX_DWORD CPDF_Dest::GetPageObjNum()
+{
+ if (m_pObj == NULL || m_pObj->GetType() != PDFOBJ_ARRAY) {
+ return 0;
+ }
+ CPDF_Object* pPage = ((CPDF_Array*)m_pObj)->GetElementValue(0);
+ if (pPage == NULL) {
+ return 0;
+ }
+ if (pPage->GetType() == PDFOBJ_NUMBER) {
+ return pPage->GetInteger();
+ }
+ if (pPage->GetType() == PDFOBJ_DICTIONARY) {
+ return pPage->GetObjNum();
+ }
+ return 0;
+}
+const FX_CHAR* g_sZoomModes[] = {"XYZ", "Fit", "FitH", "FitV", "FitR", "FitB", "FitBH", "FitBV", ""};
+int CPDF_Dest::GetZoomMode()
+{
+ if (m_pObj == NULL || m_pObj->GetType() != PDFOBJ_ARRAY) {
+ return 0;
+ }
+ CFX_ByteString mode = ((CPDF_Array*)m_pObj)->GetElementValue(1)->GetString();
+ int i = 0;
+ while (g_sZoomModes[i][0] != '\0') {
+ if (mode == g_sZoomModes[i]) {
+ return i + 1;
+ }
+ i ++;
+ }
+ return 0;
+}
+FX_FLOAT CPDF_Dest::GetParam(int index)
+{
+ if (m_pObj == NULL || m_pObj->GetType() != PDFOBJ_ARRAY) {
+ return 0;
+ }
+ return ((CPDF_Array*)m_pObj)->GetNumber(2 + index);
+}
+CFX_ByteString CPDF_Dest::GetRemoteName()
+{
+ if (m_pObj == NULL) {
+ return CFX_ByteString();
+ }
+ return m_pObj->GetString();
+}
+CPDF_NameTree::CPDF_NameTree(CPDF_Document* pDoc, FX_BSTR category)
+{
+ m_pRoot = pDoc->GetRoot()->GetDict(FX_BSTRC("Names"))->GetDict(category);
+}
+static CPDF_Object* SearchNameNode(CPDF_Dictionary* pNode, const CFX_ByteString& csName,
+ int& nIndex, CPDF_Array** ppFind, int nLevel = 0)
+{
+ if (nLevel > nMaxRecursion) {
+ return NULL;
+ }
+ CPDF_Array* pLimits = pNode->GetArray(FX_BSTRC("Limits"));
+ if (pLimits != NULL) {
+ CFX_ByteString csLeft = pLimits->GetString(0);
+ CFX_ByteString csRight = pLimits->GetString(1);
+ if (csLeft.Compare(csRight) > 0) {
+ CFX_ByteString csTmp = csRight;
+ csRight = csLeft;
+ csLeft = csTmp;
+ }
+ if (csName.Compare(csLeft) < 0 || csName.Compare(csRight) > 0) {
+ return NULL;
+ }
+ }
+ CPDF_Array* pNames = pNode->GetArray(FX_BSTRC("Names"));
+ if (pNames) {
+ FX_DWORD dwCount = pNames->GetCount() / 2;
+ for (FX_DWORD i = 0; i < dwCount; i ++) {
+ CFX_ByteString csValue = pNames->GetString(i * 2);
+ FX_INT32 iCompare = csValue.Compare(csName);
+ if (iCompare <= 0) {
+ if (ppFind != NULL) {
+ *ppFind = pNames;
+ }
+ if (iCompare < 0) {
+ continue;
+ }
+ } else {
+ break;
+ }
+ nIndex += i;
+ return pNames->GetElementValue(i * 2 + 1);
+ }
+ nIndex += dwCount;
+ return NULL;
+ }
+ CPDF_Array* pKids = pNode->GetArray(FX_BSTRC("Kids"));
+ if (pKids == NULL) {
+ return NULL;
+ }
+ for (FX_DWORD i = 0; i < pKids->GetCount(); i ++) {
+ CPDF_Dictionary* pKid = pKids->GetDict(i);
+ if (pKid == NULL) {
+ continue;
+ }
+ CPDF_Object* pFound = SearchNameNode(pKid, csName, nIndex, ppFind, nLevel + 1);
+ if (pFound) {
+ return pFound;
+ }
+ }
+ return NULL;
+}
+static CPDF_Object* SearchNameNode(CPDF_Dictionary* pNode, int nIndex, int& nCurIndex,
+ CFX_ByteString& csName, CPDF_Array** ppFind, int nLevel = 0)
+{
+ if (nLevel > nMaxRecursion) {
+ return NULL;
+ }
+ CPDF_Array* pNames = pNode->GetArray(FX_BSTRC("Names"));
+ if (pNames) {
+ int nCount = pNames->GetCount() / 2;
+ if (nIndex >= nCurIndex + nCount) {
+ nCurIndex += nCount;
+ return NULL;
+ } else {
+ if (ppFind != NULL) {
+ *ppFind = pNames;
+ }
+ csName = pNames->GetString((nIndex - nCurIndex) * 2);
+ return pNames->GetElementValue((nIndex - nCurIndex) * 2 + 1);
+ }
+ }
+ CPDF_Array* pKids = pNode->GetArray(FX_BSTRC("Kids"));
+ if (pKids == NULL) {
+ return NULL;
+ }
+ for (FX_DWORD i = 0; i < pKids->GetCount(); i ++) {
+ CPDF_Dictionary* pKid = pKids->GetDict(i);
+ if (pKid == NULL) {
+ continue;
+ }
+ CPDF_Object* pFound = SearchNameNode(pKid, nIndex, nCurIndex, csName, ppFind, nLevel + 1);
+ if (pFound) {
+ return pFound;
+ }
+ }
+ return NULL;
+}
+static int CountNames(CPDF_Dictionary* pNode, int nLevel = 0)
+{
+ if (nLevel > nMaxRecursion) {
+ return 0;
+ }
+ CPDF_Array* pNames = pNode->GetArray(FX_BSTRC("Names"));
+ if (pNames) {
+ return pNames->GetCount() / 2;
+ }
+ CPDF_Array* pKids = pNode->GetArray(FX_BSTRC("Kids"));
+ if (pKids == NULL) {
+ return 0;
+ }
+ int nCount = 0;
+ for (FX_DWORD i = 0; i < pKids->GetCount(); i ++) {
+ CPDF_Dictionary* pKid = pKids->GetDict(i);
+ if (pKid == NULL) {
+ continue;
+ }
+ nCount += CountNames(pKid, nLevel + 1);
+ }
+ return nCount;
+}
+int CPDF_NameTree::GetCount() const
+{
+ if (m_pRoot == NULL) {
+ return 0;
+ }
+ return ::CountNames(m_pRoot);
+}
+int CPDF_NameTree::GetIndex(const CFX_ByteString& csName) const
+{
+ if (m_pRoot == NULL) {
+ return -1;
+ }
+ int nIndex = 0;
+ if (SearchNameNode(m_pRoot, csName, nIndex, NULL) == NULL) {
+ return -1;
+ }
+ return nIndex;
+}
+CPDF_Object* CPDF_NameTree::LookupValue(int nIndex, CFX_ByteString& csName) const
+{
+ if (m_pRoot == NULL) {
+ return NULL;
+ }
+ int nCurIndex = 0;
+ return SearchNameNode(m_pRoot, nIndex, nCurIndex, csName, NULL);
+}
+CPDF_Object* CPDF_NameTree::LookupValue(const CFX_ByteString& csName) const
+{
+ if (m_pRoot == NULL) {
+ return NULL;
+ }
+ int nIndex = 0;
+ return SearchNameNode(m_pRoot, csName, nIndex, NULL);
+}
+CPDF_Array* CPDF_NameTree::LookupNamedDest(CPDF_Document* pDoc, FX_BSTR sName)
+{
+ CPDF_Object* pValue = LookupValue(sName);
+ if (pValue == NULL) {
+ CPDF_Dictionary* pDests = pDoc->GetRoot()->GetDict(FX_BSTRC("Dests"));
+ if (pDests == NULL) {
+ return NULL;
+ }
+ pValue = pDests->GetElementValue(sName);
+ }
+ if (pValue == NULL) {
+ return NULL;
+ }
+ if (pValue->GetType() == PDFOBJ_ARRAY) {
+ return (CPDF_Array*)pValue;
+ }
+ if (pValue->GetType() == PDFOBJ_DICTIONARY) {
+ return ((CPDF_Dictionary*)pValue)->GetArray(FX_BSTRC("D"));
+ }
+ return NULL;
+}
+static CFX_WideString ChangeSlashToPlatform(FX_LPCWSTR str)
+{
+ CFX_WideString result;
+ while (*str) {
+ if (*str == '/') {
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
+ result += ':';
+#elif _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
+ result += '\\';
+#else
+ result += *str;
+#endif
+ } else {
+ result += *str;
+ }
+ str++;
+ }
+ return result;
+}
+static CFX_WideString FILESPEC_DecodeFileName(FX_WSTR filepath)
+{
+ if (filepath.GetLength() <= 1) {
+ return CFX_WideString();
+ }
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
+ if (filepath.Left(sizeof("/Mac") - 1) == CFX_WideStringC(L"/Mac")) {
+ return ChangeSlashToPlatform(filepath.GetPtr() + 1);
+ }
+ return ChangeSlashToPlatform(filepath.GetPtr());
+#elif _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
+ if (filepath.GetAt(0) != '/') {
+ return ChangeSlashToPlatform(filepath.GetPtr());
+ }
+ if (filepath.GetAt(1) == '/') {
+ return ChangeSlashToPlatform(filepath.GetPtr() + 1);
+ }
+ if (filepath.GetAt(2) == '/') {
+ CFX_WideString result;
+ result += filepath.GetAt(1);
+ result += ':';
+ result += ChangeSlashToPlatform(filepath.GetPtr() + 2);
+ return result;
+ }
+ CFX_WideString result;
+ result += '\\';
+ result += ChangeSlashToPlatform(filepath.GetPtr());
+ return result;
+#else
+ return filepath;
+#endif
+}
+FX_BOOL CPDF_FileSpec::GetFileName(CFX_WideString &csFileName) const
+{
+ if (m_pObj == NULL) {
+ return FALSE;
+ }
+ if (m_pObj->GetType() == PDFOBJ_DICTIONARY) {
+ CPDF_Dictionary* pDict = (CPDF_Dictionary*)m_pObj;
+ csFileName = pDict->GetUnicodeText(FX_BSTRC("UF"));
+ if (csFileName.IsEmpty()) {
+ csFileName = CFX_WideString::FromLocal(pDict->GetString(FX_BSTRC("F")));
+ }
+ if (pDict->GetString(FX_BSTRC("FS")) == FX_BSTRC("URL")) {
+ return TRUE;
+ }
+ if (csFileName.IsEmpty()) {
+ if (pDict->KeyExist(FX_BSTRC("DOS"))) {
+ csFileName = CFX_WideString::FromLocal(pDict->GetString(FX_BSTRC("DOS")));
+ } else if (pDict->KeyExist(FX_BSTRC("Mac"))) {
+ csFileName = CFX_WideString::FromLocal(pDict->GetString(FX_BSTRC("Mac")));
+ } else if (pDict->KeyExist(FX_BSTRC("Unix"))) {
+ csFileName = CFX_WideString::FromLocal(pDict->GetString(FX_BSTRC("Unix")));
+ } else {
+ return FALSE;
+ }
+ }
+ } else {
+ csFileName = CFX_WideString::FromLocal(m_pObj->GetString());
+ }
+ csFileName = FILESPEC_DecodeFileName(csFileName);
+ return TRUE;
+}
+CPDF_FileSpec::CPDF_FileSpec()
+{
+ m_pObj = CPDF_Dictionary::Create();
+ if (m_pObj != NULL) {
+ ((CPDF_Dictionary*)m_pObj)->SetAtName(FX_BSTRC("Type"), FX_BSTRC("Filespec"));
+ }
+}
+FX_BOOL CPDF_FileSpec::IsURL() const
+{
+ if (m_pObj == NULL) {
+ return FALSE;
+ }
+ if (m_pObj->GetType() != PDFOBJ_DICTIONARY) {
+ return FALSE;
+ }
+ return ((CPDF_Dictionary*)m_pObj)->GetString(FX_BSTRC("FS")) == FX_BSTRC("URL");
+}
+static CFX_WideString ChangeSlashToPDF(FX_LPCWSTR str)
+{
+ CFX_WideString result;
+ while (*str) {
+ if (*str == '\\' || *str == ':') {
+ result += '/';
+ } else {
+ result += *str;
+ }
+ str++;
+ }
+ return result;
+}
+CFX_WideString FILESPEC_EncodeFileName(FX_WSTR filepath)
+{
+ if (filepath.GetLength() <= 1) {
+ return CFX_WideString();
+ }
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
+ if (filepath.GetAt(1) == ':') {
+ CFX_WideString result;
+ result = '/';
+ result += filepath.GetAt(0);
+ if (filepath.GetAt(2) != '\\') {
+ result += '/';
+ }
+ result += ChangeSlashToPDF(filepath.GetPtr() + 2);
+ return result;
+ }
+ if (filepath.GetAt(0) == '\\' && filepath.GetAt(1) == '\\') {
+ return ChangeSlashToPDF(filepath.GetPtr() + 1);
+ }
+ if (filepath.GetAt(0) == '\\') {
+ CFX_WideString result;
+ result = '/';
+ result += ChangeSlashToPDF(filepath.GetPtr());
+ return result;
+ }
+ return ChangeSlashToPDF(filepath.GetPtr());
+#elif _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
+ if (filepath.Left(sizeof("Mac") - 1) == FX_WSTRC(L"Mac")) {
+ CFX_WideString result;
+ result = '/';
+ result += ChangeSlashToPDF(filepath.GetPtr());
+ return result;
+ }
+ return ChangeSlashToPDF(filepath.GetPtr());
+#else
+ return filepath;
+#endif
+}
+CPDF_Stream* CPDF_FileSpec::GetFileStream() const
+{
+ if (m_pObj == NULL) {
+ return NULL;
+ }
+ FX_INT32 iType = m_pObj->GetType();
+ if (iType == PDFOBJ_STREAM) {
+ return (CPDF_Stream*)m_pObj;
+ } else if (iType == PDFOBJ_DICTIONARY) {
+ CPDF_Dictionary *pEF = ((CPDF_Dictionary*)m_pObj)->GetDict(FX_BSTRC("EF"));
+ if (pEF == NULL) {
+ return NULL;
+ }
+ return pEF->GetStream(FX_BSTRC("F"));
+ }
+ return NULL;
+}
+static void FPDFDOC_FILESPEC_SetFileName(CPDF_Object *pObj, FX_WSTR wsFileName, FX_BOOL bURL)
+{
+ ASSERT(pObj != NULL);
+ CFX_WideString wsStr;
+ if (bURL) {
+ wsStr = wsFileName;
+ } else {
+ wsStr = FILESPEC_EncodeFileName(wsFileName);
+ }
+ FX_INT32 iType = pObj->GetType();
+ if (iType == PDFOBJ_STRING) {
+ pObj->SetString(CFX_ByteString::FromUnicode(wsStr));
+ } else if (iType == PDFOBJ_DICTIONARY) {
+ CPDF_Dictionary* pDict = (CPDF_Dictionary*)pObj;
+ pDict->SetAtString(FX_BSTRC("F"), CFX_ByteString::FromUnicode(wsStr));
+ pDict->SetAtString(FX_BSTRC("UF"), PDF_EncodeText(wsStr));
+ }
+}
+void CPDF_FileSpec::SetFileName(FX_WSTR wsFileName, FX_BOOL bURL)
+{
+ ASSERT(m_pObj != NULL);
+ if (m_pObj->GetType() == PDFOBJ_DICTIONARY && bURL) {
+ ((CPDF_Dictionary*)m_pObj)->SetAtName(FX_BSTRC("FS"), "URL");
+ }
+ FPDFDOC_FILESPEC_SetFileName(m_pObj, wsFileName, bURL);
+}
+static CFX_WideString _MakeRoman(int num)
+{
+ const int arabic[] = {
+ 1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1
+ };
+ const CFX_WideString roman[] = {
+ L"m", L"cm", L"d", L"cd", L"c", L"xc", L"l", L"xl", L"x", L"ix", L"v", L"iv", L"i"
+ };
+ const int nMaxNum = 1000000;
+ num %= nMaxNum;
+ int i = 0;
+ CFX_WideString wsRomanNumber;
+ while (num > 0) {
+ while (num >= arabic[i]) {
+ num = num - arabic[i];
+ wsRomanNumber += roman[i];
+ }
+ i = i + 1;
+ }
+ return wsRomanNumber;
+}
+static CFX_WideString _MakeLetters(int num)
+{
+ if (num == 0) {
+ return CFX_WideString();
+ }
+ CFX_WideString wsLetters;
+ const int nMaxCount = 1000;
+ const int nLetterCount = 26;
+ num -= 1;
+ int count = num / nLetterCount + 1;
+ count %= nMaxCount;
+ FX_WCHAR ch = L'a' + num % nLetterCount;
+ for (int i = 0; i < count; i++) {
+ wsLetters += ch;
+ }
+ return wsLetters;
+}
+static CFX_WideString _GetLabelNumPortion(int num, const CFX_ByteString& bsStyle)
+{
+ CFX_WideString wsNumPortion;
+ if (bsStyle.IsEmpty()) {
+ return wsNumPortion;
+ }
+ if (bsStyle == "D") {
+ wsNumPortion.Format((FX_LPCWSTR)L"%d", num);
+ } else if (bsStyle == "R") {
+ wsNumPortion = _MakeRoman(num);
+ wsNumPortion.MakeUpper();
+ } else if (bsStyle == "r") {
+ wsNumPortion = _MakeRoman(num);
+ } else if (bsStyle == "A") {
+ wsNumPortion = _MakeLetters(num);
+ wsNumPortion.MakeUpper();
+ } else if (bsStyle == "a") {
+ wsNumPortion = _MakeLetters(num);
+ }
+ return wsNumPortion;
+}
+CFX_WideString CPDF_PageLabel::GetLabel(int nPage) const
+{
+ CFX_WideString wsLabel;
+ if (m_pDocument == NULL) {
+ return wsLabel;
+ }
+ CPDF_Dictionary* pPDFRoot = m_pDocument->GetRoot();
+ if (pPDFRoot == NULL) {
+ return wsLabel;
+ }
+ CPDF_Dictionary* pLabels = pPDFRoot->GetDict(FX_BSTRC("PageLabels"));
+ CPDF_NumberTree numberTree(pLabels);
+ CPDF_Object* pValue = NULL;
+ int n = nPage;
+ while (n >= 0) {
+ pValue = numberTree.LookupValue(n);
+ if (pValue != NULL) {
+ break;
+ }
+ n--;
+ }
+ if (pValue != NULL) {
+ pValue = pValue->GetDirect();
+ if (pValue->GetType() == PDFOBJ_DICTIONARY) {
+ CPDF_Dictionary* pLabel = (CPDF_Dictionary*)pValue;
+ if (pLabel->KeyExist(FX_BSTRC("P"))) {
+ wsLabel += pLabel->GetUnicodeText(FX_BSTRC("P"));
+ }
+ CFX_ByteString bsNumberingStyle = pLabel->GetString(FX_BSTRC("S"), NULL);
+ int nLabelNum = nPage - n + pLabel->GetInteger(FX_BSTRC("St"), 1);
+ CFX_WideString wsNumPortion = _GetLabelNumPortion(nLabelNum, bsNumberingStyle);
+ wsLabel += wsNumPortion;
+ return wsLabel;
+ }
+ }
+ wsLabel.Format((FX_LPCWSTR)L"%d", nPage + 1);
+ return wsLabel;
+}
+FX_INT32 CPDF_PageLabel::GetPageByLabel(FX_BSTR bsLabel) const
+{
+ if (m_pDocument == NULL) {
+ return -1;
+ }
+ CPDF_Dictionary* pPDFRoot = m_pDocument->GetRoot();
+ if (pPDFRoot == NULL) {
+ return -1;
+ }
+ int nPages = m_pDocument->GetPageCount();
+ CFX_ByteString bsLbl;
+ CFX_ByteString bsOrig = bsLabel;
+ for (int i = 0; i < nPages; i++) {
+ bsLbl = PDF_EncodeText(GetLabel(i));
+ if (!bsLbl.Compare(bsOrig)) {
+ return i;
+ }
+ }
+ bsLbl = bsOrig;
+ int nPage = FXSYS_atoi(bsLbl);
+ if (nPage > 0 && nPage <= nPages) {
+ return nPage;
+ }
+ return -1;
+}
+FX_INT32 CPDF_PageLabel::GetPageByLabel(FX_WSTR wsLabel) const
+{
+ CFX_ByteString bsLabel = PDF_EncodeText((CFX_WideString)wsLabel);
+ return GetPageByLabel(bsLabel);
+}
diff --git a/core/src/fpdfdoc/doc_bookmark.cpp b/core/src/fpdfdoc/doc_bookmark.cpp
index 6cc954bd69..0ae649ecdd 100644
--- a/core/src/fpdfdoc/doc_bookmark.cpp
+++ b/core/src/fpdfdoc/doc_bookmark.cpp
@@ -1,91 +1,91 @@
-// 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
-
-#include "../../include/fpdfdoc/fpdf_doc.h"
-CPDF_Bookmark CPDF_BookmarkTree::GetFirstChild(CPDF_Bookmark Parent)
-{
- if (Parent.m_pDict == NULL) {
- CPDF_Dictionary* pRoot = m_pDocument->GetRoot()->GetDict("Outlines");
- if (pRoot == NULL) {
- return NULL;
- }
- return pRoot->GetDict("First");
- }
- return Parent.m_pDict->GetDict("First");
-}
-CPDF_Bookmark CPDF_BookmarkTree::GetNextSibling(CPDF_Bookmark This)
-{
- if (This.m_pDict == NULL) {
- return NULL;
- }
- CPDF_Dictionary *pNext = This.m_pDict->GetDict("Next");
- return pNext == This.m_pDict ? NULL : pNext;
-}
-FX_DWORD CPDF_Bookmark::GetColorRef()
-{
- if (!m_pDict) {
- return 0;
- }
- CPDF_Array* pColor = m_pDict->GetArray("C");
- if (pColor == NULL) {
- return FXSYS_RGB(0, 0, 0);
- }
- int r = FXSYS_round(pColor->GetNumber(0) * 255);
- int g = FXSYS_round(pColor->GetNumber(1) * 255);
- int b = FXSYS_round(pColor->GetNumber(2) * 255);
- return FXSYS_RGB(r, g, b);
-}
-FX_DWORD CPDF_Bookmark::GetFontStyle()
-{
- if (!m_pDict) {
- return 0;
- }
- return m_pDict->GetInteger("F");
-}
-CFX_WideString CPDF_Bookmark::GetTitle()
-{
- if (!m_pDict) {
- return CFX_WideString();
- }
- CPDF_String* pString = (CPDF_String*)m_pDict->GetElementValue("Title");
- if (pString == NULL || pString->GetType() != PDFOBJ_STRING) {
- return CFX_WideString();
- }
- CFX_WideString title = pString->GetUnicodeText();
- FX_LPWSTR buf = title.LockBuffer();
- int len = title.GetLength(), i;
- for (i = 0; i < len; i ++)
- if (buf[i] < 0x20) {
- buf[i] = 0x20;
- }
- title.ReleaseBuffer(len);
- return title;
-}
-CPDF_Dest CPDF_Bookmark::GetDest(CPDF_Document* pDocument)
-{
- if (!m_pDict) {
- return NULL;
- }
- CPDF_Object* pDest = m_pDict->GetElementValue("Dest");
- if (pDest == NULL) {
- return NULL;
- }
- if (pDest->GetType() == PDFOBJ_STRING || pDest->GetType() == PDFOBJ_NAME) {
- CPDF_NameTree name_tree(pDocument, FX_BSTRC("Dests"));
- CFX_ByteStringC name = pDest->GetString();
- return name_tree.LookupNamedDest(pDocument, name);
- } else if (pDest->GetType() == PDFOBJ_ARRAY) {
- return (CPDF_Array*)pDest;
- }
- return NULL;
-}
-CPDF_Action CPDF_Bookmark::GetAction()
-{
- if (!m_pDict) {
- return NULL;
- }
- return m_pDict->GetDict("A");
-}
+// 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
+
+#include "../../include/fpdfdoc/fpdf_doc.h"
+CPDF_Bookmark CPDF_BookmarkTree::GetFirstChild(CPDF_Bookmark Parent)
+{
+ if (Parent.m_pDict == NULL) {
+ CPDF_Dictionary* pRoot = m_pDocument->GetRoot()->GetDict("Outlines");
+ if (pRoot == NULL) {
+ return NULL;
+ }
+ return pRoot->GetDict("First");
+ }
+ return Parent.m_pDict->GetDict("First");
+}
+CPDF_Bookmark CPDF_BookmarkTree::GetNextSibling(CPDF_Bookmark This)
+{
+ if (This.m_pDict == NULL) {
+ return NULL;
+ }
+ CPDF_Dictionary *pNext = This.m_pDict->GetDict("Next");
+ return pNext == This.m_pDict ? NULL : pNext;
+}
+FX_DWORD CPDF_Bookmark::GetColorRef()
+{
+ if (!m_pDict) {
+ return 0;
+ }
+ CPDF_Array* pColor = m_pDict->GetArray("C");
+ if (pColor == NULL) {
+ return FXSYS_RGB(0, 0, 0);
+ }
+ int r = FXSYS_round(pColor->GetNumber(0) * 255);
+ int g = FXSYS_round(pColor->GetNumber(1) * 255);
+ int b = FXSYS_round(pColor->GetNumber(2) * 255);
+ return FXSYS_RGB(r, g, b);
+}
+FX_DWORD CPDF_Bookmark::GetFontStyle()
+{
+ if (!m_pDict) {
+ return 0;
+ }
+ return m_pDict->GetInteger("F");
+}
+CFX_WideString CPDF_Bookmark::GetTitle()
+{
+ if (!m_pDict) {
+ return CFX_WideString();
+ }
+ CPDF_String* pString = (CPDF_String*)m_pDict->GetElementValue("Title");
+ if (pString == NULL || pString->GetType() != PDFOBJ_STRING) {
+ return CFX_WideString();
+ }
+ CFX_WideString title = pString->GetUnicodeText();
+ FX_LPWSTR buf = title.LockBuffer();
+ int len = title.GetLength(), i;
+ for (i = 0; i < len; i ++)
+ if (buf[i] < 0x20) {
+ buf[i] = 0x20;
+ }
+ title.ReleaseBuffer(len);
+ return title;
+}
+CPDF_Dest CPDF_Bookmark::GetDest(CPDF_Document* pDocument)
+{
+ if (!m_pDict) {
+ return NULL;
+ }
+ CPDF_Object* pDest = m_pDict->GetElementValue("Dest");
+ if (pDest == NULL) {
+ return NULL;
+ }
+ if (pDest->GetType() == PDFOBJ_STRING || pDest->GetType() == PDFOBJ_NAME) {
+ CPDF_NameTree name_tree(pDocument, FX_BSTRC("Dests"));
+ CFX_ByteStringC name = pDest->GetString();
+ return name_tree.LookupNamedDest(pDocument, name);
+ } else if (pDest->GetType() == PDFOBJ_ARRAY) {
+ return (CPDF_Array*)pDest;
+ }
+ return NULL;
+}
+CPDF_Action CPDF_Bookmark::GetAction()
+{
+ if (!m_pDict) {
+ return NULL;
+ }
+ return m_pDict->GetDict("A");
+}
diff --git a/core/src/fpdfdoc/doc_form.cpp b/core/src/fpdfdoc/doc_form.cpp
index 1139233987..c1e41526d4 100644
--- a/core/src/fpdfdoc/doc_form.cpp
+++ b/core/src/fpdfdoc/doc_form.cpp
@@ -1,1664 +1,1664 @@
-// 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
-
-#include "../../include/fpdfdoc/fpdf_doc.h"
-#include "../../include/fxcrt/fx_xml.h"
-CFX_WideString GetFullName(CPDF_Dictionary* pFieldDict);
-void InitInterFormDict(CPDF_Dictionary*& pFormDict, CPDF_Document* pDocument);
-FX_DWORD CountInterFormFonts(CPDF_Dictionary* pFormDict);
-CPDF_Font* GetInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, FX_DWORD index, CFX_ByteString& csNameTag);
-CPDF_Font* GetInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, CFX_ByteString csNameTag);
-CPDF_Font* GetInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, CFX_ByteString csFontName, CFX_ByteString& csNameTag);
-CPDF_Font* GetNativeInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, FX_BYTE charSet, CFX_ByteString& csNameTag);
-CPDF_Font* GetNativeInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, CFX_ByteString& csNameTag);
-FX_BOOL FindInterFormFont(CPDF_Dictionary* pFormDict, const CPDF_Font* pFont, CFX_ByteString& csNameTag);
-FX_BOOL FindInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, CFX_ByteString csFontName, CPDF_Font*& pFont, CFX_ByteString& csNameTag);
-void AddInterFormFont(CPDF_Dictionary*& pFormDict, CPDF_Document* pDocument, const CPDF_Font* pFont, CFX_ByteString& csNameTag);
-CPDF_Font* AddNativeInterFormFont(CPDF_Dictionary*& pFormDict, CPDF_Document* pDocument, FX_BYTE charSet, CFX_ByteString& csNameTag);
-CPDF_Font* AddNativeInterFormFont(CPDF_Dictionary*& pFormDict, CPDF_Document* pDocument, CFX_ByteString& csNameTag);
-void RemoveInterFormFont(CPDF_Dictionary* pFormDict, const CPDF_Font* pFont);
-void RemoveInterFormFont(CPDF_Dictionary* pFormDict, CFX_ByteString csNameTag);
-CPDF_Font* GetDefaultInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument);
-void SetDefaultInterFormFont(CPDF_Dictionary*& pFormDict, CPDF_Document* pDocument, const CPDF_Font* pFont);
-void SaveCheckedFieldStatus(CPDF_FormField* pField, CFX_ByteArray& statusArray);
-FX_BOOL NeedPDFEncodeForFieldFullName(const CFX_WideString& csFieldName);
-FX_BOOL NeedPDFEncodeForFieldTree(CPDF_Dictionary* pFieldDict, int nLevel = 0);
-void EncodeFieldName(const CFX_WideString& csName, CFX_ByteString& csT);
-void UpdateEncodeFieldName(CPDF_Dictionary* pFieldDict, int nLevel = 0);
-const int nMaxRecursion = 32;
-class _CFieldNameExtractor : public CFX_Object
-{
-public:
- _CFieldNameExtractor(const CFX_WideString& full_name)
- {
- m_pStart = full_name;
- m_pEnd = m_pStart + full_name.GetLength();
- m_pCur = m_pStart;
- }
- void GetNext(FX_LPCWSTR &pSubName, FX_STRSIZE& size)
- {
- pSubName = m_pCur;
- while (m_pCur < m_pEnd && m_pCur[0] != L'.') {
- m_pCur++;
- }
- size = (FX_STRSIZE)(m_pCur - pSubName);
- if (m_pCur < m_pEnd && m_pCur[0] == L'.') {
- m_pCur++;
- }
- }
-protected:
- FX_LPCWSTR m_pStart;
- FX_LPCWSTR m_pEnd;
- FX_LPCWSTR m_pCur;
-};
-class CFieldTree : public CFX_Object
-{
-public:
- struct _Node : public CFX_Object {
- _Node *parent;
- CFX_PtrArray children;
- CFX_WideString short_name;
- CPDF_FormField *field_ptr;
- int CountFields(int nLevel = 0)
- {
- if (nLevel > nMaxRecursion) {
- return 0;
- }
- if (field_ptr) {
- return 1;
- }
- int count = 0;
- for (int i = 0; i < children.GetSize(); i ++) {
- count += ((_Node *)children.GetAt(i))->CountFields(nLevel + 1);
- }
- return count;
- }
- CPDF_FormField* GetField(int* fields_to_go)
- {
- if (field_ptr) {
- if (*fields_to_go == 0) {
- return field_ptr;
- }
- --*fields_to_go;
- return NULL;
- }
- for (int i = 0; i < children.GetSize(); i++) {
- _Node *pNode = (_Node *)children.GetAt(i);
- CPDF_FormField* pField = pNode->GetField(fields_to_go);
- if (pField) {
- return pField;
- }
- }
- return NULL;
- }
- CPDF_FormField* GetField(int index)
- {
- int fields_to_go = index;
- return GetField(&fields_to_go);
- }
- };
- CFieldTree();
- ~CFieldTree();
- void SetField(const CFX_WideString &full_name, CPDF_FormField *field_ptr);
- CPDF_FormField *GetField(const CFX_WideString &full_name);
- CPDF_FormField *RemoveField(const CFX_WideString &full_name);
- void RemoveAll();
- _Node *FindNode(const CFX_WideString &full_name);
- _Node * AddChild(_Node *pParent, const CFX_WideString &short_name, CPDF_FormField *field_ptr);
- void RemoveNode(_Node *pNode, int nLevel = 0);
- _Node *_Lookup(_Node *pParent, const CFX_WideString &short_name);
- _Node m_Root;
-};
-CFieldTree::CFieldTree()
-{
- m_Root.parent = NULL;
- m_Root.field_ptr = NULL;
-}
-CFieldTree::~CFieldTree()
-{
- RemoveAll();
-}
-CFieldTree::_Node *CFieldTree::AddChild(_Node *pParent, const CFX_WideString &short_name, CPDF_FormField *field_ptr)
-{
- if (pParent == NULL) {
- return NULL;
- }
- _Node *pNode = FX_NEW _Node;
- if (pNode == NULL) {
- return NULL;
- }
- pNode->parent = pParent;
- pNode->short_name = short_name;
- pNode->field_ptr = field_ptr;
- pParent->children.Add(pNode);
- return pNode;
-}
-void CFieldTree::RemoveNode(_Node *pNode, int nLevel)
-{
- if (pNode == NULL) {
- return ;
- }
- if (nLevel > nMaxRecursion) {
- delete pNode;
- return ;
- }
- CFX_PtrArray& ptr_array = pNode->children;
- for (int i = 0; i < ptr_array.GetSize(); i ++) {
- _Node *pChild = (_Node *)ptr_array[i];
- RemoveNode(pChild, nLevel + 1);
- }
- delete pNode;
-}
-CFieldTree::_Node *CFieldTree::_Lookup(_Node *pParent, const CFX_WideString &short_name)
-{
- if (pParent == NULL) {
- return NULL;
- }
- CFX_PtrArray& ptr_array = pParent->children;
- for (int i = 0; i < ptr_array.GetSize(); i ++) {
- _Node *pNode = (_Node *)ptr_array[i];
- if (pNode->short_name.GetLength() == short_name.GetLength() &&
- FXSYS_memcmp32((FX_LPCWSTR)pNode->short_name, (FX_LPCWSTR)short_name, short_name.GetLength()*sizeof(FX_WCHAR)) == 0) {
- return pNode;
- }
- }
- return NULL;
-}
-void CFieldTree::RemoveAll()
-{
- CFX_PtrArray& ptr_array = m_Root.children;
- for (int i = 0; i < ptr_array.GetSize(); i ++) {
- _Node *pNode = (_Node *)ptr_array[i];
- RemoveNode(pNode);
- }
-}
-void CFieldTree::SetField(const CFX_WideString &full_name, CPDF_FormField *field_ptr)
-{
- if (full_name == L"") {
- return;
- }
- _CFieldNameExtractor name_extractor(full_name);
- FX_LPCWSTR pName;
- FX_STRSIZE nLength;
- name_extractor.GetNext(pName, nLength);
- _Node *pNode = &m_Root, *pLast = NULL;
- while (nLength > 0) {
- pLast = pNode;
- CFX_WideString name = CFX_WideString(pName, nLength);
- pNode = _Lookup(pLast, name);
- if (pNode == NULL) {
- pNode = AddChild(pLast, name, NULL);
- }
- name_extractor.GetNext(pName, nLength);
- }
- if (pNode != &m_Root) {
- pNode->field_ptr = field_ptr;
- }
-}
-CPDF_FormField *CFieldTree::GetField(const CFX_WideString &full_name)
-{
- if (full_name == L"") {
- return NULL;
- }
- _CFieldNameExtractor name_extractor(full_name);
- FX_LPCWSTR pName;
- FX_STRSIZE nLength;
- name_extractor.GetNext(pName, nLength);
- _Node *pNode = &m_Root, *pLast = NULL;
- while (nLength > 0 && pNode) {
- pLast = pNode;
- CFX_WideString name = CFX_WideString(pName, nLength);
- pNode = _Lookup(pLast, name);
- name_extractor.GetNext(pName, nLength);
- }
- return pNode ? pNode->field_ptr : NULL;
-}
-CPDF_FormField *CFieldTree::RemoveField(const CFX_WideString & full_name)
-{
- if (full_name == L"") {
- return NULL;
- }
- _CFieldNameExtractor name_extractor(full_name);
- FX_LPCWSTR pName;
- FX_STRSIZE nLength;
- name_extractor.GetNext(pName, nLength);
- _Node *pNode = &m_Root, *pLast = NULL;
- while (nLength > 0 && pNode) {
- pLast = pNode;
- CFX_WideString name = CFX_WideString(pName, nLength);
- pNode = _Lookup(pLast, name);
- name_extractor.GetNext(pName, nLength);
- }
- if (pNode && pNode != &m_Root) {
- CFX_PtrArray& ptr_array = pLast->children;
- for (int i = 0; i < ptr_array.GetSize(); i ++) {
- if (pNode == (_Node *)ptr_array[i]) {
- ptr_array.RemoveAt(i);
- break;
- }
- }
- CPDF_FormField *pField = pNode->field_ptr;
- RemoveNode(pNode);
- return pField;
- }
- return NULL;
-}
-CFieldTree::_Node *CFieldTree::FindNode(const CFX_WideString& full_name)
-{
- if (full_name == L"") {
- return NULL;
- }
- _CFieldNameExtractor name_extractor(full_name);
- FX_LPCWSTR pName;
- FX_STRSIZE nLength;
- name_extractor.GetNext(pName, nLength);
- _Node *pNode = &m_Root, *pLast = NULL;
- while (nLength > 0 && pNode) {
- pLast = pNode;
- CFX_WideString name = CFX_WideString(pName, nLength);
- pNode = _Lookup(pLast, name);
- name_extractor.GetNext(pName, nLength);
- }
- return pNode;
-}
-CPDF_InterForm::CPDF_InterForm(CPDF_Document* pDocument, FX_BOOL bGenerateAP) : CFX_PrivateData()
-{
- m_pDocument = pDocument;
- m_bGenerateAP = bGenerateAP;
- m_pFormNotify = NULL;
- m_bUpdated = FALSE;
- m_pFieldTree = FX_NEW CFieldTree;
- CPDF_Dictionary* pRoot = m_pDocument->GetRoot();
- m_pFormDict = pRoot->GetDict("AcroForm");
- if (m_pFormDict == NULL) {
- return;
- }
- CPDF_Array* pFields = m_pFormDict->GetArray("Fields");
- if (pFields == NULL) {
- return;
- }
- int count = pFields->GetCount();
- for (int i = 0; i < count; i ++) {
- LoadField(pFields->GetDict(i));
- }
-}
-CPDF_InterForm::~CPDF_InterForm()
-{
- FX_POSITION pos = m_ControlMap.GetStartPosition();
- while (pos) {
- FX_LPVOID key, value;
- m_ControlMap.GetNextAssoc(pos, key, value);
- delete (CPDF_FormControl*)value;
- }
- if (m_pFieldTree != NULL) {
- int nCount = m_pFieldTree->m_Root.CountFields();
- for (int i = 0; i < nCount; i++) {
- CPDF_FormField *pField = m_pFieldTree->m_Root.GetField(i);
- delete pField;
- }
- delete m_pFieldTree;
- }
-}
-FX_BOOL CPDF_InterForm::m_bUpdateAP = TRUE;
-FX_BOOL CPDF_InterForm::UpdatingAPEnabled()
-{
- return m_bUpdateAP;
-}
-void CPDF_InterForm::EnableUpdateAP(FX_BOOL bUpdateAP)
-{
- m_bUpdateAP = bUpdateAP;
-}
-CFX_ByteString CPDF_InterForm::GenerateNewResourceName(const CPDF_Dictionary* pResDict, FX_LPCSTR csType, int iMinLen, FX_LPCSTR csPrefix)
-{
- CFX_ByteString csStr = csPrefix;
- CFX_ByteString csBType = csType;
- if (csStr.IsEmpty()) {
- if (csBType == "ExtGState") {
- csStr = "GS";
- } else if (csBType == "ColorSpace") {
- csStr = "CS";
- } else if (csBType == "Font") {
- csStr = "ZiTi";
- } else {
- csStr = "Res";
- }
- }
- CFX_ByteString csTmp = csStr;
- int iCount = csStr.GetLength();
- int m = 0;
- if (iMinLen > 0) {
- csTmp = "";
- while (m < iMinLen && m < iCount) {
- csTmp += csStr[m ++];
- }
- while (m < iMinLen) {
- csTmp += '0' + m % 10;
- m ++;
- }
- } else {
- m = iCount;
- }
- if (pResDict == NULL) {
- return csTmp;
- }
- CPDF_Dictionary* pDict = pResDict->GetDict(csType);
- if (pDict == NULL) {
- return csTmp;
- }
- int num = 0;
- CFX_ByteString bsNum;
- while (TRUE) {
- if (!pDict->KeyExist(csTmp + bsNum)) {
- return csTmp + bsNum;
- }
- if (m < iCount) {
- csTmp += csStr[m ++];
- } else {
- bsNum.Format("%d", num++);
- }
- m ++;
- }
- return csTmp;
-}
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
-typedef struct _PDF_FONTDATA {
- FX_BOOL bFind;
- LOGFONTA lf;
-} PDF_FONTDATA, FAR* LPDF_FONTDATA;
-static int CALLBACK EnumFontFamExProc( ENUMLOGFONTEXA *lpelfe,
- NEWTEXTMETRICEX *lpntme,
- DWORD FontType,
- LPARAM lParam
- )
-{
- if (FontType != 0x004 || strchr(lpelfe->elfLogFont.lfFaceName, '@') != NULL) {
- return 1;
- } else {
- LPDF_FONTDATA pData = (LPDF_FONTDATA)lParam;
- memcpy(&pData->lf, &lpelfe->elfLogFont, sizeof(LOGFONTA));
- pData->bFind = TRUE;
- return 0;
- }
-}
-static FX_BOOL RetrieveSpecificFont(LOGFONTA& lf)
-{
- PDF_FONTDATA fd;
- memset(&fd, 0, sizeof(PDF_FONTDATA));
- HDC hDC = ::GetDC(NULL);
- EnumFontFamiliesExA(hDC, &lf, (FONTENUMPROCA)EnumFontFamExProc, (LPARAM)&fd, 0);
- ::ReleaseDC(NULL, hDC);
- if (fd.bFind) {
- memcpy(&lf, &fd.lf, sizeof(LOGFONTA));
- }
- return fd.bFind;
-}
-static FX_BOOL RetrieveSpecificFont(FX_BYTE charSet, FX_BYTE pitchAndFamily, LPCSTR pcsFontName, LOGFONTA& lf)
-{
- memset(&lf, 0, sizeof(LOGFONTA));
- lf.lfCharSet = charSet;
- lf.lfPitchAndFamily = pitchAndFamily;
- if (pcsFontName != NULL) {
- strcpy(lf.lfFaceName, pcsFontName);
- }
- return RetrieveSpecificFont(lf);
-}
-static FX_BOOL RetrieveStockFont(int iFontObject, FX_BYTE charSet, LOGFONTA& lf)
-{
- HFONT hFont = (HFONT)::GetStockObject(iFontObject);
- if (hFont != NULL) {
- memset(&lf, 0, sizeof(LOGFONTA));
- int iRet = ::GetObject(hFont, sizeof(LOGFONTA), &lf);
- if (iRet > 0 && (lf.lfCharSet == charSet || charSet == 255)) {
- return RetrieveSpecificFont(lf);
- }
- }
- return FALSE;
-}
-#endif
-CPDF_Font* CPDF_InterForm::AddSystemDefaultFont(const CPDF_Document* pDocument)
-{
- if (pDocument == NULL) {
- return NULL;
- }
- CPDF_Font* pFont = NULL;
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
- LOGFONTA lf;
- FX_BOOL bRet;
- bRet = RetrieveStockFont(DEFAULT_GUI_FONT, 255, lf);
- if (!bRet) {
- bRet = RetrieveStockFont(SYSTEM_FONT, 255, lf);
- }
- if (bRet) {
- pFont = ((CPDF_Document*)pDocument)->AddWindowsFont(&lf, FALSE, TRUE);
- }
-#endif
- return pFont;
-}
-CPDF_Font* CPDF_InterForm::AddSystemFont(const CPDF_Document* pDocument, CFX_ByteString csFontName, FX_BYTE iCharSet)
-{
- if (pDocument == NULL || csFontName.IsEmpty()) {
- return NULL;
- }
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
- if (iCharSet == 1) {
- iCharSet = GetNativeCharSet();
- }
- HFONT hFont = ::CreateFontA(0, 0, 0, 0, 0, 0, 0, 0, iCharSet, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, (FX_LPCSTR)csFontName);
- if (hFont != NULL) {
- LOGFONTA lf;
- memset(&lf, 0, sizeof(LOGFONTA));
- ::GetObjectA(hFont, sizeof(LOGFONTA), &lf);
- ::DeleteObject(hFont);
- if (strlen(lf.lfFaceName) > 0) {
- return ((CPDF_Document*)pDocument)->AddWindowsFont(&lf, FALSE, TRUE);
- }
- }
-#endif
- return NULL;
-}
-CPDF_Font* CPDF_InterForm::AddSystemFont(const CPDF_Document* pDocument, CFX_WideString csFontName, FX_BYTE iCharSet)
-{
- if (pDocument == NULL || csFontName.IsEmpty()) {
- return NULL;
- }
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
- if (iCharSet == 1) {
- iCharSet = GetNativeCharSet();
- }
- HFONT hFont = ::CreateFontW(0, 0, 0, 0, 0, 0, 0, 0, iCharSet, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, csFontName);
- if (hFont != NULL) {
- LOGFONTA lf;
- memset(&lf, 0, sizeof(LOGFONTA));
- ::GetObject(hFont, sizeof(LOGFONTA), &lf);
- ::DeleteObject(hFont);
- if (strlen(lf.lfFaceName) > 0) {
- return ((CPDF_Document*)pDocument)->AddWindowsFont(&lf, FALSE, TRUE);
- }
- }
-#endif
- return NULL;
-}
-CPDF_Font* CPDF_InterForm::AddStandardFont(const CPDF_Document* pDocument, CFX_ByteString csFontName)
-{
- if (pDocument == NULL || csFontName.IsEmpty()) {
- return NULL;
- }
- CPDF_Font* pFont = NULL;
- if (csFontName == "ZapfDingbats") {
- pFont = ((CPDF_Document*)pDocument)->AddStandardFont(csFontName, NULL);
- } else {
- CPDF_FontEncoding encoding(PDFFONT_ENCODING_WINANSI);
- pFont = ((CPDF_Document*)pDocument)->AddStandardFont(csFontName, &encoding);
- }
- return pFont;
-}
-CFX_ByteString CPDF_InterForm::GetNativeFont(FX_BYTE charSet, FX_LPVOID pLogFont)
-{
- CFX_ByteString csFontName;
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
- LOGFONTA lf;
- FX_BOOL bRet;
- if (charSet == ANSI_CHARSET) {
- csFontName = "Helvetica";
- return csFontName;
- }
- bRet = FALSE;
- if (charSet == SHIFTJIS_CHARSET) {
- bRet = RetrieveSpecificFont(charSet, DEFAULT_PITCH | FF_DONTCARE, "MS Mincho", lf);
- } else if (charSet == GB2312_CHARSET) {
- bRet = RetrieveSpecificFont(charSet, DEFAULT_PITCH | FF_DONTCARE, "SimSun", lf);
- } else if (charSet == CHINESEBIG5_CHARSET) {
- bRet = RetrieveSpecificFont(charSet, DEFAULT_PITCH | FF_DONTCARE, "MingLiU", lf);
- }
- if (!bRet) {
- bRet = RetrieveSpecificFont(charSet, DEFAULT_PITCH | FF_DONTCARE, "Arial Unicode MS", lf);
- }
- if (!bRet) {
- bRet = RetrieveSpecificFont(charSet, DEFAULT_PITCH | FF_DONTCARE, "Microsoft Sans Serif", lf);
- }
- if (!bRet) {
- bRet = RetrieveSpecificFont(charSet, DEFAULT_PITCH | FF_DONTCARE, NULL, lf);
- }
- if (bRet) {
- if (pLogFont != NULL) {
- memcpy(pLogFont, &lf, sizeof(LOGFONTA));
- }
- csFontName = lf.lfFaceName;
- return csFontName;
- }
-#endif
- return csFontName;
-}
-CFX_ByteString CPDF_InterForm::GetNativeFont(FX_LPVOID pLogFont)
-{
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
- FX_BYTE charSet = GetNativeCharSet();
- return GetNativeFont(charSet, pLogFont);
-#else
- return CFX_ByteString();
-#endif
-}
-FX_BYTE CPDF_InterForm::GetNativeCharSet()
-{
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
- FX_BYTE charSet = ANSI_CHARSET;
- UINT iCodePage = ::GetACP();
- switch (iCodePage) {
- case 932:
- charSet = SHIFTJIS_CHARSET;
- break;
- case 936:
- charSet = GB2312_CHARSET;
- break;
- case 950:
- charSet = CHINESEBIG5_CHARSET;
- break;
- case 1252:
- charSet = ANSI_CHARSET;
- break;
- case 874:
- charSet = THAI_CHARSET;
- break;
- case 949:
- charSet = HANGUL_CHARSET;
- break;
- case 1200:
- charSet = ANSI_CHARSET;
- break;
- case 1250:
- charSet = EASTEUROPE_CHARSET;
- break;
- case 1251:
- charSet = RUSSIAN_CHARSET;
- break;
- case 1253:
- charSet = GREEK_CHARSET;
- break;
- case 1254:
- charSet = TURKISH_CHARSET;
- break;
- case 1255:
- charSet = HEBREW_CHARSET;
- break;
- case 1256:
- charSet = ARABIC_CHARSET;
- break;
- case 1257:
- charSet = BALTIC_CHARSET;
- break;
- case 1258:
- charSet = VIETNAMESE_CHARSET;
- break;
- case 1361:
- charSet = JOHAB_CHARSET;
- break;
- }
- return charSet;
-#else
- return 0;
-#endif
-}
-CPDF_Font* CPDF_InterForm::AddNativeFont(FX_BYTE charSet, const CPDF_Document* pDocument)
-{
- if (pDocument == NULL) {
- return NULL;
- }
- CPDF_Font* pFont = NULL;
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
- LOGFONTA lf;
- CFX_ByteString csFontName = GetNativeFont(charSet, &lf);
- if (!csFontName.IsEmpty()) {
- if (csFontName == "Helvetica") {
- pFont = AddStandardFont(pDocument, csFontName);
- } else {
- pFont = ((CPDF_Document*)pDocument)->AddWindowsFont(&lf, FALSE, TRUE);
- }
- }
-#endif
- return pFont;
-}
-CPDF_Font* CPDF_InterForm::AddNativeFont(const CPDF_Document* pDocument)
-{
- if (pDocument == NULL) {
- return NULL;
- }
- CPDF_Font* pFont = NULL;
- FX_BYTE charSet = GetNativeCharSet();
- pFont = AddNativeFont(charSet, pDocument);
- return pFont;
-}
-FX_BOOL CPDF_InterForm::ValidateFieldName(CFX_WideString& csNewFieldName, int iType, const CPDF_FormField* pExcludedField, const CPDF_FormControl* pExcludedControl)
-{
- if (csNewFieldName.IsEmpty()) {
- return FALSE;
- }
- int iPos = 0;
- int iLength = csNewFieldName.GetLength();
- CFX_WideString csSub;
- while (TRUE) {
- while (iPos < iLength && (csNewFieldName[iPos] == L'.' || csNewFieldName[iPos] == L' ')) {
- iPos ++;
- }
- if (iPos < iLength && !csSub.IsEmpty()) {
- csSub += L'.';
- }
- while (iPos < iLength && csNewFieldName[iPos] != L'.') {
- csSub += csNewFieldName[iPos ++];
- }
- for (int i = csSub.GetLength() - 1; i > -1; i --) {
- if (csSub[i] == L' ' || csSub[i] == L'.') {
- csSub.SetAt(i, L'\0');
- } else {
- break;
- }
- }
- FX_DWORD dwCount = m_pFieldTree->m_Root.CountFields();
- for (FX_DWORD m = 0; m < dwCount; m ++) {
- CPDF_FormField* pField = m_pFieldTree->m_Root.GetField(m);
- if (pField == NULL) {
- continue;
- }
- if (pField == pExcludedField) {
- if (pExcludedControl != NULL) {
- if (pField->CountControls() < 2) {
- continue;
- }
- } else {
- continue;
- }
- }
- CFX_WideString csFullName = pField->GetFullName();
- int iRet = CompareFieldName(csSub, csFullName);
- if (iRet == 1) {
- if (pField->GetFieldType() != iType) {
- return FALSE;
- }
- } else if (iRet == 2 && csSub == csNewFieldName) {
- if (csFullName[iPos] == L'.') {
- return FALSE;
- }
- } else if (iRet == 3 && csSub == csNewFieldName) {
- if (csNewFieldName[csFullName.GetLength()] == L'.') {
- return FALSE;
- }
- }
- }
- if (iPos >= iLength) {
- break;
- }
- }
- if (csSub.IsEmpty()) {
- return FALSE;
- }
- csNewFieldName = csSub;
- return TRUE;
-}
-FX_BOOL CPDF_InterForm::ValidateFieldName(CFX_WideString& csNewFieldName, int iType)
-{
- return ValidateFieldName(csNewFieldName, iType, NULL, NULL);
-}
-FX_BOOL CPDF_InterForm::ValidateFieldName(const CPDF_FormField* pField, CFX_WideString& csNewFieldName)
-{
- if (pField == NULL || csNewFieldName.IsEmpty()) {
- return FALSE;
- }
- return ValidateFieldName(csNewFieldName, ((CPDF_FormField*)pField)->GetFieldType(), pField, NULL);
-}
-FX_BOOL CPDF_InterForm::ValidateFieldName(const CPDF_FormControl* pControl, CFX_WideString& csNewFieldName)
-{
- if (pControl == NULL || csNewFieldName.IsEmpty()) {
- return FALSE;
- }
- CPDF_FormField* pField = ((CPDF_FormControl*)pControl)->GetField();
- return ValidateFieldName(csNewFieldName, pField->GetFieldType(), pField, pControl);
-}
-int CPDF_InterForm::CompareFieldName(const CFX_ByteString& name1, const CFX_ByteString& name2)
-{
- FX_LPCSTR ptr1 = name1, ptr2 = name2;
- if (name1.GetLength() != name2.GetLength()) {
- int i = 0;
- while (ptr1[i] == ptr2[i]) {
- i ++;
- }
- if (i == name1.GetLength()) {
- return 2;
- }
- if (i == name2.GetLength()) {
- return 3;
- }
- return 0;
- } else {
- return name1 == name2 ? 1 : 0;
- }
-}
-int CPDF_InterForm::CompareFieldName(const CFX_WideString& name1, const CFX_WideString& name2)
-{
- FX_LPCWSTR ptr1 = name1, ptr2 = name2;
- if (name1.GetLength() != name2.GetLength()) {
- int i = 0;
- while (ptr1[i] == ptr2[i]) {
- i ++;
- }
- if (i == name1.GetLength()) {
- return 2;
- }
- if (i == name2.GetLength()) {
- return 3;
- }
- return 0;
- } else {
- return name1 == name2 ? 1 : 0;
- }
-}
-FX_DWORD CPDF_InterForm::CountFields(const CFX_WideString &csFieldName)
-{
- if (csFieldName.IsEmpty()) {
- return (FX_DWORD)m_pFieldTree->m_Root.CountFields();
- }
- CFieldTree::_Node *pNode = m_pFieldTree->FindNode(csFieldName);
- if (pNode == NULL) {
- return 0;
- }
- return pNode->CountFields();
-}
-CPDF_FormField* CPDF_InterForm::GetField(FX_DWORD index, const CFX_WideString &csFieldName)
-{
- if (csFieldName == L"") {
- return m_pFieldTree->m_Root.GetField(index);
- }
- CFieldTree::_Node *pNode = m_pFieldTree->FindNode(csFieldName);
- if (pNode == NULL) {
- return NULL;
- }
- return pNode->GetField(index);
-}
-void CPDF_InterForm::GetAllFieldNames(CFX_WideStringArray& allFieldNames)
-{
- allFieldNames.RemoveAll();
- int nCount = m_pFieldTree->m_Root.CountFields();
- for (int i = 0; i < nCount; i ++) {
- CPDF_FormField *pField = m_pFieldTree->m_Root.GetField(i);
- if (pField) {
- CFX_WideString full_name = GetFullName(pField->GetFieldDict());
- allFieldNames.Add(full_name);
- }
- }
-}
-FX_BOOL CPDF_InterForm::IsValidFormField(const void* pField)
-{
- if (pField == NULL) {
- return FALSE;
- }
- int nCount = m_pFieldTree->m_Root.CountFields();
- for (int i = 0; i < nCount; i++) {
- CPDF_FormField *pFormField = m_pFieldTree->m_Root.GetField(i);
- if (pField == pFormField) {
- return TRUE;
- }
- }
- return FALSE;
-}
-CPDF_FormField* CPDF_InterForm::GetFieldByDict(CPDF_Dictionary* pFieldDict) const
-{
- if (pFieldDict == NULL) {
- return NULL;
- }
- CFX_WideString csWName = GetFullName(pFieldDict);
- return m_pFieldTree->GetField(csWName);
-}
-FX_DWORD CPDF_InterForm::CountControls(CFX_WideString csFieldName)
-{
- if (csFieldName.IsEmpty()) {
- return (FX_DWORD)m_ControlMap.GetCount();
- }
- CPDF_FormField *pField = m_pFieldTree->GetField(csFieldName);
- if (pField == NULL) {
- return 0;
- }
- return pField->m_ControlList.GetSize();
-}
-CPDF_FormControl* CPDF_InterForm::GetControl(FX_DWORD index, CFX_WideString csFieldName)
-{
- CPDF_FormField *pField = m_pFieldTree->GetField(csFieldName);
- if (pField == NULL) {
- return NULL;
- }
- if (index < (FX_DWORD)pField->m_ControlList.GetSize()) {
- return (CPDF_FormControl *)pField->m_ControlList.GetAt(index);
- }
- return NULL;
-}
-FX_BOOL CPDF_InterForm::IsValidFormControl(const void* pControl)
-{
- if (pControl == NULL) {
- return FALSE;
- }
- FX_POSITION pos = m_ControlMap.GetStartPosition();
- while (pos) {
- CPDF_Dictionary* pWidgetDict = NULL;
- void* pFormControl = NULL;
- m_ControlMap.GetNextAssoc(pos, (FX_LPVOID&)pWidgetDict, pFormControl);
- if (pControl == pFormControl) {
- return TRUE;
- }
- }
- return FALSE;
-}
-int CPDF_InterForm::CountPageControls(CPDF_Page* pPage) const
-{
- CPDF_Array* pAnnotList = pPage->m_pFormDict->GetArray("Annots");
- if (pAnnotList == NULL) {
- return 0;
- }
- int count = 0;
- for (FX_DWORD i = 0; i < pAnnotList->GetCount(); i ++) {
- CPDF_Dictionary* pAnnot = pAnnotList->GetDict(i);
- if (pAnnot == NULL) {
- continue;
- }
- CPDF_FormControl* pControl;
- if (!m_ControlMap.Lookup(pAnnot, (FX_LPVOID&)pControl)) {
- continue;
- }
- count ++;
- }
- return count;
-}
-CPDF_FormControl* CPDF_InterForm::GetPageControl(CPDF_Page* pPage, int index) const
-{
- CPDF_Array* pAnnotList = pPage->m_pFormDict->GetArray("Annots");
- if (pAnnotList == NULL) {
- return NULL;
- }
- int count = 0;
- for (FX_DWORD i = 0; i < pAnnotList->GetCount(); i ++) {
- CPDF_Dictionary* pAnnot = pAnnotList->GetDict(i);
- if (pAnnot == NULL) {
- continue;
- }
- CPDF_FormControl* pControl;
- if (!m_ControlMap.Lookup(pAnnot, (FX_LPVOID&)pControl)) {
- continue;
- }
- if (index == count) {
- return pControl;
- }
- count ++;
- }
- return NULL;
-}
-CPDF_FormControl* CPDF_InterForm::GetControlAtPoint(CPDF_Page* pPage, FX_FLOAT pdf_x, FX_FLOAT pdf_y) const
-{
- CPDF_Array* pAnnotList = pPage->m_pFormDict->GetArray("Annots");
- if (pAnnotList == NULL) {
- return NULL;
- }
- for (FX_DWORD i = pAnnotList->GetCount(); i > 0; i --) {
- CPDF_Dictionary* pAnnot = pAnnotList->GetDict(i - 1);
- if (pAnnot == NULL) {
- continue;
- }
- CPDF_FormControl* pControl;
- if (!m_ControlMap.Lookup(pAnnot, (FX_LPVOID&)pControl)) {
- continue;
- }
- CFX_FloatRect rect = pControl->GetRect();
- if (rect.Contains(pdf_x, pdf_y)) {
- return pControl;
- }
- }
- return NULL;
-}
-CPDF_FormControl* CPDF_InterForm::GetControlByDict(CPDF_Dictionary* pWidgetDict) const
-{
- CPDF_FormControl* pControl = NULL;
- m_ControlMap.Lookup(pWidgetDict, (FX_LPVOID&)pControl);
- return pControl;
-}
-FX_DWORD CPDF_InterForm::CountInternalFields(const CFX_WideString& csFieldName) const
-{
- if (m_pFormDict == NULL) {
- return 0;
- }
- CPDF_Array* pArray = m_pFormDict->GetArray("Fields");
- if (pArray == NULL) {
- return 0;
- }
- if (csFieldName.IsEmpty()) {
- return pArray->GetCount();
- } else {
- int iLength = csFieldName.GetLength();
- int iPos = 0;
- CPDF_Dictionary* pDict = NULL;
- while (pArray != NULL) {
- CFX_WideString csSub;
- if (iPos < iLength && csFieldName[iPos] == L'.') {
- iPos ++;
- }
- while (iPos < iLength && csFieldName[iPos] != L'.') {
- csSub += csFieldName[iPos ++];
- }
- int iCount = pArray->GetCount();
- FX_BOOL bFind = FALSE;
- for (int i = 0; i < iCount; i ++) {
- pDict = pArray->GetDict(i);
- if (pDict == NULL) {
- continue;
- }
- CFX_WideString csT = pDict->GetUnicodeText("T");
- if (csT == csSub) {
- bFind = TRUE;
- break;
- }
- }
- if (!bFind) {
- return 0;
- }
- if (iPos >= iLength) {
- break;
- }
- pArray = pDict->GetArray("Kids");
- }
- if (pDict == NULL) {
- return 0;
- } else {
- pArray = pDict->GetArray("Kids");
- if (pArray == NULL) {
- return 1;
- } else {
- return pArray->GetCount();
- }
- }
- }
-}
-CPDF_Dictionary* CPDF_InterForm::GetInternalField(FX_DWORD index, const CFX_WideString& csFieldName) const
-{
- if (m_pFormDict == NULL) {
- return NULL;
- }
- CPDF_Array* pArray = m_pFormDict->GetArray("Fields");
- if (pArray == NULL) {
- return 0;
- }
- if (csFieldName.IsEmpty()) {
- return pArray->GetDict(index);
- } else {
- int iLength = csFieldName.GetLength();
- int iPos = 0;
- CPDF_Dictionary* pDict = NULL;
- while (pArray != NULL) {
- CFX_WideString csSub;
- if (iPos < iLength && csFieldName[iPos] == L'.') {
- iPos ++;
- }
- while (iPos < iLength && csFieldName[iPos] != L'.') {
- csSub += csFieldName[iPos ++];
- }
- int iCount = pArray->GetCount();
- FX_BOOL bFind = FALSE;
- for (int i = 0; i < iCount; i ++) {
- pDict = pArray->GetDict(i);
- if (pDict == NULL) {
- continue;
- }
- CFX_WideString csT = pDict->GetUnicodeText("T");
- if (csT == csSub) {
- bFind = TRUE;
- break;
- }
- }
- if (!bFind) {
- return NULL;
- }
- if (iPos >= iLength) {
- break;
- }
- pArray = pDict->GetArray("Kids");
- }
- if (pDict == NULL) {
- return NULL;
- } else {
- pArray = pDict->GetArray("Kids");
- if (pArray == NULL) {
- return pDict;
- } else {
- return pArray->GetDict(index);
- }
- }
- }
-}
-FX_BOOL CPDF_InterForm::NeedConstructAP()
-{
- if (m_pFormDict == NULL) {
- return FALSE;
- }
- return m_pFormDict->GetBoolean("NeedAppearances");
-}
-void CPDF_InterForm::NeedConstructAP(FX_BOOL bNeedAP)
-{
- if (m_pFormDict == NULL) {
- InitInterFormDict(m_pFormDict, m_pDocument);
- }
- m_pFormDict->SetAtBoolean("NeedAppearances", bNeedAP);
- m_bGenerateAP = bNeedAP;
-}
-int CPDF_InterForm::CountFieldsInCalculationOrder()
-{
- if (m_pFormDict == NULL) {
- return 0;
- }
- CPDF_Array* pArray = m_pFormDict->GetArray("CO");
- if (pArray == NULL) {
- return 0;
- }
- return pArray->GetCount();
-}
-CPDF_FormField* CPDF_InterForm::GetFieldInCalculationOrder(int index)
-{
- if (m_pFormDict == NULL || index < 0) {
- return NULL;
- }
- CPDF_Array* pArray = m_pFormDict->GetArray("CO");
- if (pArray == NULL) {
- return NULL;
- }
- CPDF_Object* pElement = pArray->GetElementValue(index);
- if (pElement != NULL && pElement->GetType() == PDFOBJ_DICTIONARY) {
- return GetFieldByDict((CPDF_Dictionary*)pElement);
- }
- return NULL;
-}
-int CPDF_InterForm::FindFieldInCalculationOrder(const CPDF_FormField* pField)
-{
- if (m_pFormDict == NULL || pField == NULL) {
- return -1;
- }
- CPDF_Array* pArray = m_pFormDict->GetArray("CO");
- if (pArray == NULL) {
- return -1;
- }
- for (FX_DWORD i = 0; i < pArray->GetCount(); i ++) {
- CPDF_Object* pElement = pArray->GetElementValue(i);
- if (pElement == pField->m_pDict) {
- return i;
- }
- }
- return -1;
-}
-FX_DWORD CPDF_InterForm::CountFormFonts()
-{
- return CountInterFormFonts(m_pFormDict);
-}
-CPDF_Font* CPDF_InterForm::GetFormFont(FX_DWORD index, CFX_ByteString& csNameTag)
-{
- return GetInterFormFont(m_pFormDict, m_pDocument, index, csNameTag);
-}
-CPDF_Font* CPDF_InterForm::GetFormFont(CFX_ByteString csNameTag)
-{
- return GetInterFormFont(m_pFormDict, m_pDocument, csNameTag);
-}
-CPDF_Font* CPDF_InterForm::GetFormFont(CFX_ByteString csFontName, CFX_ByteString& csNameTag)
-{
- return GetInterFormFont(m_pFormDict, m_pDocument, csFontName, csNameTag);
-}
-CPDF_Font* CPDF_InterForm::GetNativeFormFont(FX_BYTE charSet, CFX_ByteString& csNameTag)
-{
- return GetNativeInterFormFont(m_pFormDict, m_pDocument, charSet, csNameTag);
-}
-CPDF_Font* CPDF_InterForm::GetNativeFormFont(CFX_ByteString& csNameTag)
-{
- return GetNativeInterFormFont(m_pFormDict, m_pDocument, csNameTag);
-}
-FX_BOOL CPDF_InterForm::FindFormFont(const CPDF_Font* pFont, CFX_ByteString& csNameTag)
-{
- return FindInterFormFont(m_pFormDict, pFont, csNameTag);
-}
-FX_BOOL CPDF_InterForm::FindFormFont(CFX_ByteString csFontName, CPDF_Font*& pFont, CFX_ByteString& csNameTag)
-{
- return FindInterFormFont(m_pFormDict, m_pDocument, csFontName, pFont, csNameTag);
-}
-void CPDF_InterForm::AddFormFont(const CPDF_Font* pFont, CFX_ByteString& csNameTag)
-{
- AddInterFormFont(m_pFormDict, m_pDocument, pFont, csNameTag);
- m_bUpdated = TRUE;
-}
-CPDF_Font* CPDF_InterForm::AddNativeFormFont(FX_BYTE charSet, CFX_ByteString& csNameTag)
-{
- m_bUpdated = TRUE;
- return AddNativeInterFormFont(m_pFormDict, m_pDocument, charSet, csNameTag);
-}
-CPDF_Font* CPDF_InterForm::AddNativeFormFont(CFX_ByteString& csNameTag)
-{
- m_bUpdated = TRUE;
- return AddNativeInterFormFont(m_pFormDict, m_pDocument, csNameTag);
-}
-void CPDF_InterForm::RemoveFormFont(const CPDF_Font* pFont)
-{
- m_bUpdated = TRUE;
- RemoveInterFormFont(m_pFormDict, pFont);
-}
-void CPDF_InterForm::RemoveFormFont(CFX_ByteString csNameTag)
-{
- m_bUpdated = TRUE;
- RemoveInterFormFont(m_pFormDict, csNameTag);
-}
-CPDF_DefaultAppearance CPDF_InterForm::GetDefaultAppearance()
-{
- CFX_ByteString csDA;
- if (m_pFormDict == NULL) {
- return csDA;
- }
- csDA = m_pFormDict->GetString("DA");
- return csDA;
-}
-CPDF_Font* CPDF_InterForm::GetDefaultFormFont()
-{
- return GetDefaultInterFormFont(m_pFormDict, m_pDocument);
-}
-int CPDF_InterForm::GetFormAlignment()
-{
- if (m_pFormDict == NULL) {
- return 0;
- }
- return m_pFormDict->GetInteger("Q", 0);
-}
-FX_BOOL CPDF_InterForm::ResetForm(const CFX_PtrArray& fields, FX_BOOL bIncludeOrExclude, FX_BOOL bNotify)
-{
- if (bNotify && m_pFormNotify != NULL) {
- int iRet = m_pFormNotify->BeforeFormReset(this);
- if (iRet < 0) {
- return FALSE;
- }
- }
- int nCount = m_pFieldTree->m_Root.CountFields();
- for (int i = 0; i < nCount; i++) {
- CPDF_FormField* pField = m_pFieldTree->m_Root.GetField(i);
- if (pField == NULL) {
- continue;
- }
- FX_BOOL bFind = FALSE;
- int iCount = fields.GetSize();
- for (int i = 0; i < iCount; i ++) {
- if (pField == (CPDF_FormField*)fields[i]) {
- bFind = TRUE;
- break;
- }
- }
- if ((bIncludeOrExclude && bFind) || (!bIncludeOrExclude && !bFind)) {
- pField->ResetField(bNotify);
- }
- }
- if (bNotify && m_pFormNotify != NULL) {
- m_pFormNotify->AfterFormReset(this);
- }
- return TRUE;
-}
-FX_BOOL CPDF_InterForm::ResetForm(FX_BOOL bNotify)
-{
- if (bNotify && m_pFormNotify != NULL) {
- int iRet = m_pFormNotify->BeforeFormReset(this);
- if (iRet < 0) {
- return FALSE;
- }
- }
- int nCount = m_pFieldTree->m_Root.CountFields();
- for (int i = 0; i < nCount; i++) {
- CPDF_FormField* pField = m_pFieldTree->m_Root.GetField(i);
- if (pField == NULL) {
- continue;
- }
- pField->ResetField(bNotify);
- }
- if (bNotify && m_pFormNotify != NULL) {
- m_pFormNotify->AfterFormReset(this);
- }
- return TRUE;
-}
-void CPDF_InterForm::ReloadForm()
-{
- FX_POSITION pos = m_ControlMap.GetStartPosition();
- while (pos) {
- CPDF_Dictionary* pWidgetDict;
- CPDF_FormControl* pControl;
- m_ControlMap.GetNextAssoc(pos, (FX_LPVOID&)pWidgetDict, (FX_LPVOID&)pControl);
- delete pControl;
- }
- m_ControlMap.RemoveAll();
- int nCount = m_pFieldTree->m_Root.CountFields();
- for (int k = 0; k < nCount; k ++) {
- CPDF_FormField* pField = m_pFieldTree->m_Root.GetField(k);
- delete pField;
- }
- m_pFieldTree->RemoveAll();
- if (m_pFormDict == NULL) {
- return;
- }
- CPDF_Array* pFields = m_pFormDict->GetArray("Fields");
- if (pFields == NULL) {
- return;
- }
- int iCount = pFields->GetCount();
- for (int i = 0; i < iCount; i ++) {
- LoadField(pFields->GetDict(i));
- }
-}
-void CPDF_InterForm::LoadField(CPDF_Dictionary* pFieldDict, int nLevel)
-{
- if (nLevel > nMaxRecursion) {
- return;
- }
- if (pFieldDict == NULL) {
- return;
- }
- FX_DWORD dwParentObjNum = pFieldDict->GetObjNum();
- CPDF_Array* pKids = pFieldDict->GetArray("Kids");
- if (!pKids) {
- AddTerminalField(pFieldDict);
- return;
- }
- CPDF_Dictionary* pFirstKid = pKids->GetDict(0);
- if (pFirstKid == NULL) {
- return;
- }
- if (pFirstKid->KeyExist("T") || pFirstKid->KeyExist("Kids")) {
- for (FX_DWORD i = 0; i < pKids->GetCount(); i ++) {
- CPDF_Dictionary * pChildDict = pKids->GetDict(i);
- if (pChildDict) {
- if (pChildDict->GetObjNum() != dwParentObjNum) {
- LoadField(pChildDict, nLevel + 1);
- }
- }
- }
- } else {
- AddTerminalField(pFieldDict);
- }
-}
-FX_BOOL CPDF_InterForm::HasXFAForm() const
-{
- return m_pFormDict && m_pFormDict->GetArray(FX_BSTRC("XFA")) != NULL;
-}
-void CPDF_InterForm::FixPageFields(const CPDF_Page* pPage)
-{
- ASSERT(pPage != NULL);
- CPDF_Dictionary* pPageDict = pPage->m_pFormDict;
- if (pPageDict == NULL) {
- return;
- }
- CPDF_Array* pAnnots = pPageDict->GetArray(FX_BSTRC("Annots"));
- if (pAnnots == NULL) {
- return;
- }
- int iAnnotCount = pAnnots->GetCount();
- for (int i = 0; i < iAnnotCount; i++) {
- CPDF_Dictionary* pAnnot = pAnnots->GetDict(i);
- if (pAnnot != NULL && pAnnot->GetString(FX_BSTRC("Subtype")) == "Widget") {
- LoadField(pAnnot);
- }
- }
-}
-CPDF_FormField* CPDF_InterForm::AddTerminalField(const CPDF_Dictionary* pFieldDict)
-{
- if (!pFieldDict->KeyExist(FX_BSTRC("T"))) {
- return NULL;
- }
- CPDF_Dictionary* pDict = (CPDF_Dictionary*)pFieldDict;
- CFX_WideString csWName = GetFullName(pDict);
- if (csWName.IsEmpty()) {
- return NULL;
- }
- CPDF_FormField* pField = NULL;
- pField = m_pFieldTree->GetField(csWName);
- if (pField == NULL) {
- CPDF_Dictionary *pParent = (CPDF_Dictionary*)pFieldDict;
- if (!pFieldDict->KeyExist(FX_BSTR("T")) &&
- pFieldDict->GetString(FX_BSTRC("Subtype")) == FX_BSTRC("Widget")) {
- pParent = pFieldDict->GetDict(FX_BSTRC("Parent"));
- if (!pParent) {
- pParent = (CPDF_Dictionary*)pFieldDict;
- }
- }
- if (pParent && pParent != pFieldDict && !pParent->KeyExist(FX_BSTRC("FT"))) {
- if (pFieldDict->KeyExist(FX_BSTRC("FT"))) {
- CPDF_Object *pFTValue = pFieldDict->GetElementValue(FX_BSTRC("FT"));
- if (pFTValue) {
- pParent->SetAt(FX_BSTRC("FT"), pFTValue->Clone());
- }
- }
- if (pFieldDict->KeyExist(FX_BSTRC("Ff"))) {
- CPDF_Object *pFfValue = pFieldDict->GetElementValue(FX_BSTRC("Ff"));
- if (pFfValue) {
- pParent->SetAt(FX_BSTRC("Ff"), pFfValue->Clone());
- }
- }
- }
- pField = FX_NEW CPDF_FormField(this, pParent);
- CPDF_Object* pTObj = pDict->GetElement("T");
- if (pTObj && pTObj->GetType() == PDFOBJ_REFERENCE) {
- CPDF_Object* pClone = pTObj->Clone(TRUE);
- if (pClone) {
- pDict->SetAt("T", pClone);
- } else {
- pDict->SetAtName("T", "");
- }
- }
- m_pFieldTree->SetField(csWName, pField);
- }
- CPDF_Array* pKids = pFieldDict->GetArray("Kids");
- if (pKids == NULL) {
- if (pFieldDict->GetString("Subtype") == "Widget") {
- AddControl(pField, pFieldDict);
- }
- } else {
- for (FX_DWORD i = 0; i < pKids->GetCount(); i ++) {
- CPDF_Dictionary* pKid = pKids->GetDict(i);
- if (pKid == NULL) {
- continue;
- }
- if (pKid->GetString("Subtype") != "Widget") {
- continue;
- }
- AddControl(pField, pKid);
- }
- }
- return pField;
-}
-CPDF_FormControl* CPDF_InterForm::AddControl(const CPDF_FormField* pField, const CPDF_Dictionary* pWidgetDict)
-{
- void *rValue = NULL;
- if (m_ControlMap.Lookup((CPDF_Dictionary*)pWidgetDict, rValue)) {
- return (CPDF_FormControl*)rValue;
- }
- CPDF_FormControl* pControl = FX_NEW CPDF_FormControl((CPDF_FormField*)pField, (CPDF_Dictionary*)pWidgetDict);
- if (pControl == NULL) {
- return NULL;
- }
- m_ControlMap.SetAt((CPDF_Dictionary*)pWidgetDict, pControl);
- ((CPDF_FormField*)pField)->m_ControlList.Add(pControl);
- return pControl;
-}
-CPDF_FormField* CPDF_InterForm::CheckRequiredFields(const CFX_PtrArray *fields, FX_BOOL bIncludeOrExclude) const
-{
- int nCount = m_pFieldTree->m_Root.CountFields();
- for (int i = 0; i < nCount; i++) {
- CPDF_FormField* pField = m_pFieldTree->m_Root.GetField(i);
- if (pField == NULL) {
- continue;
- }
- FX_INT32 iType = pField->GetType();
- if (iType == CPDF_FormField::PushButton || iType == CPDF_FormField::CheckBox || iType == CPDF_FormField::ListBox) {
- continue;
- }
- FX_DWORD dwFlags = pField->GetFieldFlags();
- if (dwFlags & 0x04) {
- continue;
- }
- FX_BOOL bFind = TRUE;
- if (fields != NULL) {
- bFind = fields->Find(pField, 0) >= 0;
- }
- if ((bIncludeOrExclude && bFind) || (!bIncludeOrExclude && !bFind)) {
- CPDF_Dictionary *pFieldDict = pField->m_pDict;
- if ((dwFlags & 0x02) != 0 && pFieldDict->GetString("V").IsEmpty()) {
- return pField;
- }
- }
- }
- return NULL;
-}
-CFDF_Document* CPDF_InterForm::ExportToFDF(FX_WSTR pdf_path, FX_BOOL bSimpleFileSpec) const
-{
- CFX_PtrArray fields;
- int nCount = m_pFieldTree->m_Root.CountFields();
- for (int i = 0; i < nCount; i ++) {
- CPDF_FormField* pField = m_pFieldTree->m_Root.GetField(i);
- fields.Add(pField);
- }
- return ExportToFDF(pdf_path, fields, TRUE, bSimpleFileSpec);
-}
-CFX_WideString FILESPEC_EncodeFileName(FX_WSTR filepath);
-CFDF_Document* CPDF_InterForm::ExportToFDF(FX_WSTR pdf_path, CFX_PtrArray& fields, FX_BOOL bIncludeOrExclude, FX_BOOL bSimpleFileSpec) const
-{
- CFDF_Document* pDoc = CFDF_Document::CreateNewDoc();
- if (pDoc == NULL) {
- return NULL;
- }
- CPDF_Dictionary* pMainDict = pDoc->GetRoot()->GetDict("FDF");
- if (!pdf_path.IsEmpty()) {
- if (bSimpleFileSpec) {
- CFX_WideString wsFilePath = FILESPEC_EncodeFileName(pdf_path);
- pMainDict->SetAtString(FX_BSTRC("F"), CFX_ByteString::FromUnicode(wsFilePath));
- pMainDict->SetAtString(FX_BSTRC("UF"), PDF_EncodeText(wsFilePath));
- } else {
- CPDF_FileSpec filespec;
- filespec.SetFileName(pdf_path);
- pMainDict->SetAt("F", (CPDF_Object*)filespec);
- }
- }
- CPDF_Array* pFields = CPDF_Array::Create();
- if (pFields == NULL) {
- return NULL;
- }
- pMainDict->SetAt("Fields", pFields);
- int nCount = m_pFieldTree->m_Root.CountFields();
- for (int i = 0; i < nCount; i ++) {
- CPDF_FormField* pField = m_pFieldTree->m_Root.GetField(i);
- if (pField == NULL || pField->GetType() == CPDF_FormField::PushButton) {
- continue;
- }
- FX_DWORD dwFlags = pField->GetFieldFlags();
- if (dwFlags & 0x04) {
- continue;
- }
- FX_BOOL bFind = fields.Find(pField, 0) >= 0;
- if ((bIncludeOrExclude && bFind) || (!bIncludeOrExclude && !bFind)) {
- if ((dwFlags & 0x02) != 0 && pField->m_pDict->GetString("V").IsEmpty()) {
- continue;
- }
- CFX_WideString fullname = GetFullName(pField->GetFieldDict());
- CPDF_Dictionary* pFieldDict = CPDF_Dictionary::Create();
- if (pFieldDict == NULL) {
- return NULL;
- }
- CPDF_String* pString = CPDF_String::Create(fullname);
- if (pString == NULL) {
- pFieldDict->Release();
- return NULL;
- }
- pFieldDict->SetAt("T", pString);
- if (pField->GetType() == CPDF_FormField::CheckBox || pField->GetType() == CPDF_FormField::RadioButton) {
- CFX_WideString csExport = pField->GetCheckValue(FALSE);
- CFX_ByteString csBExport = PDF_EncodeText(csExport);
- CPDF_Object* pOpt = FPDF_GetFieldAttr(pField->m_pDict, "Opt");
- if (pOpt == NULL) {
- pFieldDict->SetAtName("V", csBExport);
- } else {
- pFieldDict->SetAtString("V", csBExport);
- }
- } else {
- CPDF_Object* pV = FPDF_GetFieldAttr(pField->m_pDict, "V");
- if (pV != NULL) {
- pFieldDict->SetAt("V", pV->Clone(TRUE));
- }
- }
- pFields->Add(pFieldDict);
- }
- }
- return pDoc;
-}
-const struct _SupportFieldEncoding {
- FX_LPCSTR m_name;
- FX_INT32 m_codePage;
-} g_fieldEncoding[] = {
- "BigFive", 950,
- "GBK", 936,
- "Shift-JIS", 932,
- "UHC", 949,
-};
-static void FPDFDOC_FDF_GetFieldValue(CPDF_Dictionary *pFieldDict, CFX_WideString &csValue, CFX_ByteString &bsEncoding)
-{
- ASSERT(pFieldDict != NULL);
- CFX_ByteString csBValue = pFieldDict->GetString("V");
- FX_INT32 iCount = sizeof(g_fieldEncoding) / sizeof(g_fieldEncoding[0]);
- FX_INT32 i = 0;
- for (; i < iCount; ++i)
- if (bsEncoding == g_fieldEncoding[i].m_name) {
- break;
- }
- if (i < iCount) {
- CFX_CharMap *pCharMap = CFX_CharMap::GetDefaultMapper(g_fieldEncoding[i].m_codePage);
- FXSYS_assert(pCharMap != NULL);
- csValue.ConvertFrom(csBValue, pCharMap);
- return;
- }
- CFX_ByteString csTemp = csBValue.Left(2);
- if (csTemp == "\xFF\xFE" || csTemp == "\xFE\xFF") {
- csValue = PDF_DecodeText(csBValue);
- } else {
- csValue = CFX_WideString::FromLocal(csBValue);
- }
-}
-void CPDF_InterForm::FDF_ImportField(CPDF_Dictionary* pFieldDict, const CFX_WideString& parent_name, FX_BOOL bNotify, int nLevel)
-{
- CFX_WideString name;
- if (!parent_name.IsEmpty()) {
- name = parent_name + L".";
- }
- name += pFieldDict->GetUnicodeText("T");
- CPDF_Array* pKids = pFieldDict->GetArray("Kids");
- if (pKids) {
- for (FX_DWORD i = 0; i < pKids->GetCount(); i ++) {
- CPDF_Dictionary* pKid = pKids->GetDict(i);
- if (pKid == NULL) {
- continue;
- }
- if (nLevel <= nMaxRecursion) {
- FDF_ImportField(pKid, name, bNotify, nLevel + 1);
- }
- }
- return;
- }
- if (!pFieldDict->KeyExist("V")) {
- return;
- }
- CPDF_FormField* pField = m_pFieldTree->GetField(name);
- if (pField == NULL) {
- return;
- }
- CFX_WideString csWValue;
- FPDFDOC_FDF_GetFieldValue(pFieldDict, csWValue, m_bsEncoding);
- int iType = pField->GetFieldType();
- if (bNotify && m_pFormNotify != NULL) {
- int iRet = 0;
- if (iType == FIELDTYPE_LISTBOX) {
- iRet = m_pFormNotify->BeforeSelectionChange(pField, csWValue);
- } else if (iType == FIELDTYPE_COMBOBOX || iType == FIELDTYPE_TEXTFIELD) {
- iRet = m_pFormNotify->BeforeValueChange(pField, csWValue);
- }
- if (iRet < 0) {
- return;
- }
- }
- CFX_ByteArray statusArray;
- if (iType == FIELDTYPE_CHECKBOX || iType == FIELDTYPE_RADIOBUTTON) {
- SaveCheckedFieldStatus(pField, statusArray);
- }
- pField->SetValue(csWValue);
- CPDF_FormField::Type eType = pField->GetType();
- if ((eType == CPDF_FormField::ListBox || eType == CPDF_FormField::ComboBox) && pFieldDict->KeyExist("Opt")) {
- pField->m_pDict->SetAt("Opt", pFieldDict->GetElementValue("Opt")->Clone(TRUE));
- }
- if (bNotify && m_pFormNotify != NULL) {
- if (iType == FIELDTYPE_CHECKBOX || iType == FIELDTYPE_RADIOBUTTON) {
- m_pFormNotify->AfterCheckedStatusChange(pField, statusArray);
- } else if (iType == FIELDTYPE_LISTBOX) {
- m_pFormNotify->AfterSelectionChange(pField);
- } else if (iType == FIELDTYPE_COMBOBOX || iType == FIELDTYPE_TEXTFIELD) {
- m_pFormNotify->AfterValueChange(pField);
- }
- }
- if (CPDF_InterForm::m_bUpdateAP) {
- pField->UpdateAP(NULL);
- }
-}
-FX_BOOL CPDF_InterForm::ImportFromFDF(const CFDF_Document* pFDF, FX_BOOL bNotify)
-{
- if (pFDF == NULL) {
- return FALSE;
- }
- CPDF_Dictionary* pMainDict = pFDF->GetRoot()->GetDict("FDF");
- if (pMainDict == NULL) {
- return FALSE;
- }
- CPDF_Array* pFields = pMainDict->GetArray("Fields");
- if (pFields == NULL) {
- return FALSE;
- }
- m_bsEncoding = pMainDict->GetString(FX_BSTRC("Encoding"));
- if (bNotify && m_pFormNotify != NULL) {
- int iRet = m_pFormNotify->BeforeFormImportData(this);
- if (iRet < 0) {
- return FALSE;
- }
- }
- for (FX_DWORD i = 0; i < pFields->GetCount(); i ++) {
- CPDF_Dictionary* pField = pFields->GetDict(i);
- if (pField == NULL) {
- continue;
- }
- FDF_ImportField(pField, L"", bNotify);
- }
- if (bNotify && m_pFormNotify != NULL) {
- m_pFormNotify->AfterFormImportData(this);
- }
- return TRUE;
-}
-void CPDF_InterForm::SetFormNotify(const CPDF_FormNotify* pNotify)
-{
- m_pFormNotify = (CPDF_FormNotify*)pNotify;
-}
-int CPDF_InterForm::GetPageWithWidget(int iCurPage, FX_BOOL bNext)
-{
- if (iCurPage < 0) {
- return -1;
- }
- int iPageCount = m_pDocument->GetPageCount();
- if (iCurPage >= iPageCount) {
- return -1;
- }
- int iNewPage = iCurPage;
- do {
- iNewPage += bNext ? 1 : -1;
- if (iNewPage >= iPageCount) {
- iNewPage = 0;
- }
- if (iNewPage < 0) {
- iNewPage = iPageCount - 1;
- }
- if (iNewPage == iCurPage) {
- break;
- }
- CPDF_Dictionary* pPageDict = m_pDocument->GetPage(iNewPage);
- if (pPageDict == NULL) {
- continue;
- }
- CPDF_Array* pAnnots = pPageDict->GetArray("Annots");
- if (pAnnots == NULL) {
- continue;
- }
- FX_DWORD dwCount = pAnnots->GetCount();
- for (FX_DWORD i = 0; i < dwCount; i ++) {
- CPDF_Object* pAnnotDict = pAnnots->GetElementValue(i);
- if (pAnnotDict == NULL) {
- continue;
- }
- CPDF_FormControl* pControl = NULL;
- if (m_ControlMap.Lookup(pAnnotDict, (void*&)pControl)) {
- return iNewPage;
- }
- }
- } while (TRUE);
- return -1;
-}
+// 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
+
+#include "../../include/fpdfdoc/fpdf_doc.h"
+#include "../../include/fxcrt/fx_xml.h"
+CFX_WideString GetFullName(CPDF_Dictionary* pFieldDict);
+void InitInterFormDict(CPDF_Dictionary*& pFormDict, CPDF_Document* pDocument);
+FX_DWORD CountInterFormFonts(CPDF_Dictionary* pFormDict);
+CPDF_Font* GetInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, FX_DWORD index, CFX_ByteString& csNameTag);
+CPDF_Font* GetInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, CFX_ByteString csNameTag);
+CPDF_Font* GetInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, CFX_ByteString csFontName, CFX_ByteString& csNameTag);
+CPDF_Font* GetNativeInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, FX_BYTE charSet, CFX_ByteString& csNameTag);
+CPDF_Font* GetNativeInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, CFX_ByteString& csNameTag);
+FX_BOOL FindInterFormFont(CPDF_Dictionary* pFormDict, const CPDF_Font* pFont, CFX_ByteString& csNameTag);
+FX_BOOL FindInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, CFX_ByteString csFontName, CPDF_Font*& pFont, CFX_ByteString& csNameTag);
+void AddInterFormFont(CPDF_Dictionary*& pFormDict, CPDF_Document* pDocument, const CPDF_Font* pFont, CFX_ByteString& csNameTag);
+CPDF_Font* AddNativeInterFormFont(CPDF_Dictionary*& pFormDict, CPDF_Document* pDocument, FX_BYTE charSet, CFX_ByteString& csNameTag);
+CPDF_Font* AddNativeInterFormFont(CPDF_Dictionary*& pFormDict, CPDF_Document* pDocument, CFX_ByteString& csNameTag);
+void RemoveInterFormFont(CPDF_Dictionary* pFormDict, const CPDF_Font* pFont);
+void RemoveInterFormFont(CPDF_Dictionary* pFormDict, CFX_ByteString csNameTag);
+CPDF_Font* GetDefaultInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument);
+void SetDefaultInterFormFont(CPDF_Dictionary*& pFormDict, CPDF_Document* pDocument, const CPDF_Font* pFont);
+void SaveCheckedFieldStatus(CPDF_FormField* pField, CFX_ByteArray& statusArray);
+FX_BOOL NeedPDFEncodeForFieldFullName(const CFX_WideString& csFieldName);
+FX_BOOL NeedPDFEncodeForFieldTree(CPDF_Dictionary* pFieldDict, int nLevel = 0);
+void EncodeFieldName(const CFX_WideString& csName, CFX_ByteString& csT);
+void UpdateEncodeFieldName(CPDF_Dictionary* pFieldDict, int nLevel = 0);
+const int nMaxRecursion = 32;
+class _CFieldNameExtractor : public CFX_Object
+{
+public:
+ _CFieldNameExtractor(const CFX_WideString& full_name)
+ {
+ m_pStart = full_name;
+ m_pEnd = m_pStart + full_name.GetLength();
+ m_pCur = m_pStart;
+ }
+ void GetNext(FX_LPCWSTR &pSubName, FX_STRSIZE& size)
+ {
+ pSubName = m_pCur;
+ while (m_pCur < m_pEnd && m_pCur[0] != L'.') {
+ m_pCur++;
+ }
+ size = (FX_STRSIZE)(m_pCur - pSubName);
+ if (m_pCur < m_pEnd && m_pCur[0] == L'.') {
+ m_pCur++;
+ }
+ }
+protected:
+ FX_LPCWSTR m_pStart;
+ FX_LPCWSTR m_pEnd;
+ FX_LPCWSTR m_pCur;
+};
+class CFieldTree : public CFX_Object
+{
+public:
+ struct _Node : public CFX_Object {
+ _Node *parent;
+ CFX_PtrArray children;
+ CFX_WideString short_name;
+ CPDF_FormField *field_ptr;
+ int CountFields(int nLevel = 0)
+ {
+ if (nLevel > nMaxRecursion) {
+ return 0;
+ }
+ if (field_ptr) {
+ return 1;
+ }
+ int count = 0;
+ for (int i = 0; i < children.GetSize(); i ++) {
+ count += ((_Node *)children.GetAt(i))->CountFields(nLevel + 1);
+ }
+ return count;
+ }
+ CPDF_FormField* GetField(int* fields_to_go)
+ {
+ if (field_ptr) {
+ if (*fields_to_go == 0) {
+ return field_ptr;
+ }
+ --*fields_to_go;
+ return NULL;
+ }
+ for (int i = 0; i < children.GetSize(); i++) {
+ _Node *pNode = (_Node *)children.GetAt(i);
+ CPDF_FormField* pField = pNode->GetField(fields_to_go);
+ if (pField) {
+ return pField;
+ }
+ }
+ return NULL;
+ }
+ CPDF_FormField* GetField(int index)
+ {
+ int fields_to_go = index;
+ return GetField(&fields_to_go);
+ }
+ };
+ CFieldTree();
+ ~CFieldTree();
+ void SetField(const CFX_WideString &full_name, CPDF_FormField *field_ptr);
+ CPDF_FormField *GetField(const CFX_WideString &full_name);
+ CPDF_FormField *RemoveField(const CFX_WideString &full_name);
+ void RemoveAll();
+ _Node *FindNode(const CFX_WideString &full_name);
+ _Node * AddChild(_Node *pParent, const CFX_WideString &short_name, CPDF_FormField *field_ptr);
+ void RemoveNode(_Node *pNode, int nLevel = 0);
+ _Node *_Lookup(_Node *pParent, const CFX_WideString &short_name);
+ _Node m_Root;
+};
+CFieldTree::CFieldTree()
+{
+ m_Root.parent = NULL;
+ m_Root.field_ptr = NULL;
+}
+CFieldTree::~CFieldTree()
+{
+ RemoveAll();
+}
+CFieldTree::_Node *CFieldTree::AddChild(_Node *pParent, const CFX_WideString &short_name, CPDF_FormField *field_ptr)
+{
+ if (pParent == NULL) {
+ return NULL;
+ }
+ _Node *pNode = FX_NEW _Node;
+ if (pNode == NULL) {
+ return NULL;
+ }
+ pNode->parent = pParent;
+ pNode->short_name = short_name;
+ pNode->field_ptr = field_ptr;
+ pParent->children.Add(pNode);
+ return pNode;
+}
+void CFieldTree::RemoveNode(_Node *pNode, int nLevel)
+{
+ if (pNode == NULL) {
+ return ;
+ }
+ if (nLevel > nMaxRecursion) {
+ delete pNode;
+ return ;
+ }
+ CFX_PtrArray& ptr_array = pNode->children;
+ for (int i = 0; i < ptr_array.GetSize(); i ++) {
+ _Node *pChild = (_Node *)ptr_array[i];
+ RemoveNode(pChild, nLevel + 1);
+ }
+ delete pNode;
+}
+CFieldTree::_Node *CFieldTree::_Lookup(_Node *pParent, const CFX_WideString &short_name)
+{
+ if (pParent == NULL) {
+ return NULL;
+ }
+ CFX_PtrArray& ptr_array = pParent->children;
+ for (int i = 0; i < ptr_array.GetSize(); i ++) {
+ _Node *pNode = (_Node *)ptr_array[i];
+ if (pNode->short_name.GetLength() == short_name.GetLength() &&
+ FXSYS_memcmp32((FX_LPCWSTR)pNode->short_name, (FX_LPCWSTR)short_name, short_name.GetLength()*sizeof(FX_WCHAR)) == 0) {
+ return pNode;
+ }
+ }
+ return NULL;
+}
+void CFieldTree::RemoveAll()
+{
+ CFX_PtrArray& ptr_array = m_Root.children;
+ for (int i = 0; i < ptr_array.GetSize(); i ++) {
+ _Node *pNode = (_Node *)ptr_array[i];
+ RemoveNode(pNode);
+ }
+}
+void CFieldTree::SetField(const CFX_WideString &full_name, CPDF_FormField *field_ptr)
+{
+ if (full_name == L"") {
+ return;
+ }
+ _CFieldNameExtractor name_extractor(full_name);
+ FX_LPCWSTR pName;
+ FX_STRSIZE nLength;
+ name_extractor.GetNext(pName, nLength);
+ _Node *pNode = &m_Root, *pLast = NULL;
+ while (nLength > 0) {
+ pLast = pNode;
+ CFX_WideString name = CFX_WideString(pName, nLength);
+ pNode = _Lookup(pLast, name);
+ if (pNode == NULL) {
+ pNode = AddChild(pLast, name, NULL);
+ }
+ name_extractor.GetNext(pName, nLength);
+ }
+ if (pNode != &m_Root) {
+ pNode->field_ptr = field_ptr;
+ }
+}
+CPDF_FormField *CFieldTree::GetField(const CFX_WideString &full_name)
+{
+ if (full_name == L"") {
+ return NULL;
+ }
+ _CFieldNameExtractor name_extractor(full_name);
+ FX_LPCWSTR pName;
+ FX_STRSIZE nLength;
+ name_extractor.GetNext(pName, nLength);
+ _Node *pNode = &m_Root, *pLast = NULL;
+ while (nLength > 0 && pNode) {
+ pLast = pNode;
+ CFX_WideString name = CFX_WideString(pName, nLength);
+ pNode = _Lookup(pLast, name);
+ name_extractor.GetNext(pName, nLength);
+ }
+ return pNode ? pNode->field_ptr : NULL;
+}
+CPDF_FormField *CFieldTree::RemoveField(const CFX_WideString & full_name)
+{
+ if (full_name == L"") {
+ return NULL;
+ }
+ _CFieldNameExtractor name_extractor(full_name);
+ FX_LPCWSTR pName;
+ FX_STRSIZE nLength;
+ name_extractor.GetNext(pName, nLength);
+ _Node *pNode = &m_Root, *pLast = NULL;
+ while (nLength > 0 && pNode) {
+ pLast = pNode;
+ CFX_WideString name = CFX_WideString(pName, nLength);
+ pNode = _Lookup(pLast, name);
+ name_extractor.GetNext(pName, nLength);
+ }
+ if (pNode && pNode != &m_Root) {
+ CFX_PtrArray& ptr_array = pLast->children;
+ for (int i = 0; i < ptr_array.GetSize(); i ++) {
+ if (pNode == (_Node *)ptr_array[i]) {
+ ptr_array.RemoveAt(i);
+ break;
+ }
+ }
+ CPDF_FormField *pField = pNode->field_ptr;
+ RemoveNode(pNode);
+ return pField;
+ }
+ return NULL;
+}
+CFieldTree::_Node *CFieldTree::FindNode(const CFX_WideString& full_name)
+{
+ if (full_name == L"") {
+ return NULL;
+ }
+ _CFieldNameExtractor name_extractor(full_name);
+ FX_LPCWSTR pName;
+ FX_STRSIZE nLength;
+ name_extractor.GetNext(pName, nLength);
+ _Node *pNode = &m_Root, *pLast = NULL;
+ while (nLength > 0 && pNode) {
+ pLast = pNode;
+ CFX_WideString name = CFX_WideString(pName, nLength);
+ pNode = _Lookup(pLast, name);
+ name_extractor.GetNext(pName, nLength);
+ }
+ return pNode;
+}
+CPDF_InterForm::CPDF_InterForm(CPDF_Document* pDocument, FX_BOOL bGenerateAP) : CFX_PrivateData()
+{
+ m_pDocument = pDocument;
+ m_bGenerateAP = bGenerateAP;
+ m_pFormNotify = NULL;
+ m_bUpdated = FALSE;
+ m_pFieldTree = FX_NEW CFieldTree;
+ CPDF_Dictionary* pRoot = m_pDocument->GetRoot();
+ m_pFormDict = pRoot->GetDict("AcroForm");
+ if (m_pFormDict == NULL) {
+ return;
+ }
+ CPDF_Array* pFields = m_pFormDict->GetArray("Fields");
+ if (pFields == NULL) {
+ return;
+ }
+ int count = pFields->GetCount();
+ for (int i = 0; i < count; i ++) {
+ LoadField(pFields->GetDict(i));
+ }
+}
+CPDF_InterForm::~CPDF_InterForm()
+{
+ FX_POSITION pos = m_ControlMap.GetStartPosition();
+ while (pos) {
+ FX_LPVOID key, value;
+ m_ControlMap.GetNextAssoc(pos, key, value);
+ delete (CPDF_FormControl*)value;
+ }
+ if (m_pFieldTree != NULL) {
+ int nCount = m_pFieldTree->m_Root.CountFields();
+ for (int i = 0; i < nCount; i++) {
+ CPDF_FormField *pField = m_pFieldTree->m_Root.GetField(i);
+ delete pField;
+ }
+ delete m_pFieldTree;
+ }
+}
+FX_BOOL CPDF_InterForm::m_bUpdateAP = TRUE;
+FX_BOOL CPDF_InterForm::UpdatingAPEnabled()
+{
+ return m_bUpdateAP;
+}
+void CPDF_InterForm::EnableUpdateAP(FX_BOOL bUpdateAP)
+{
+ m_bUpdateAP = bUpdateAP;
+}
+CFX_ByteString CPDF_InterForm::GenerateNewResourceName(const CPDF_Dictionary* pResDict, FX_LPCSTR csType, int iMinLen, FX_LPCSTR csPrefix)
+{
+ CFX_ByteString csStr = csPrefix;
+ CFX_ByteString csBType = csType;
+ if (csStr.IsEmpty()) {
+ if (csBType == "ExtGState") {
+ csStr = "GS";
+ } else if (csBType == "ColorSpace") {
+ csStr = "CS";
+ } else if (csBType == "Font") {
+ csStr = "ZiTi";
+ } else {
+ csStr = "Res";
+ }
+ }
+ CFX_ByteString csTmp = csStr;
+ int iCount = csStr.GetLength();
+ int m = 0;
+ if (iMinLen > 0) {
+ csTmp = "";
+ while (m < iMinLen && m < iCount) {
+ csTmp += csStr[m ++];
+ }
+ while (m < iMinLen) {
+ csTmp += '0' + m % 10;
+ m ++;
+ }
+ } else {
+ m = iCount;
+ }
+ if (pResDict == NULL) {
+ return csTmp;
+ }
+ CPDF_Dictionary* pDict = pResDict->GetDict(csType);
+ if (pDict == NULL) {
+ return csTmp;
+ }
+ int num = 0;
+ CFX_ByteString bsNum;
+ while (TRUE) {
+ if (!pDict->KeyExist(csTmp + bsNum)) {
+ return csTmp + bsNum;
+ }
+ if (m < iCount) {
+ csTmp += csStr[m ++];
+ } else {
+ bsNum.Format("%d", num++);
+ }
+ m ++;
+ }
+ return csTmp;
+}
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
+typedef struct _PDF_FONTDATA {
+ FX_BOOL bFind;
+ LOGFONTA lf;
+} PDF_FONTDATA, FAR* LPDF_FONTDATA;
+static int CALLBACK EnumFontFamExProc( ENUMLOGFONTEXA *lpelfe,
+ NEWTEXTMETRICEX *lpntme,
+ DWORD FontType,
+ LPARAM lParam
+ )
+{
+ if (FontType != 0x004 || strchr(lpelfe->elfLogFont.lfFaceName, '@') != NULL) {
+ return 1;
+ } else {
+ LPDF_FONTDATA pData = (LPDF_FONTDATA)lParam;
+ memcpy(&pData->lf, &lpelfe->elfLogFont, sizeof(LOGFONTA));
+ pData->bFind = TRUE;
+ return 0;
+ }
+}
+static FX_BOOL RetrieveSpecificFont(LOGFONTA& lf)
+{
+ PDF_FONTDATA fd;
+ memset(&fd, 0, sizeof(PDF_FONTDATA));
+ HDC hDC = ::GetDC(NULL);
+ EnumFontFamiliesExA(hDC, &lf, (FONTENUMPROCA)EnumFontFamExProc, (LPARAM)&fd, 0);
+ ::ReleaseDC(NULL, hDC);
+ if (fd.bFind) {
+ memcpy(&lf, &fd.lf, sizeof(LOGFONTA));
+ }
+ return fd.bFind;
+}
+static FX_BOOL RetrieveSpecificFont(FX_BYTE charSet, FX_BYTE pitchAndFamily, LPCSTR pcsFontName, LOGFONTA& lf)
+{
+ memset(&lf, 0, sizeof(LOGFONTA));
+ lf.lfCharSet = charSet;
+ lf.lfPitchAndFamily = pitchAndFamily;
+ if (pcsFontName != NULL) {
+ strcpy(lf.lfFaceName, pcsFontName);
+ }
+ return RetrieveSpecificFont(lf);
+}
+static FX_BOOL RetrieveStockFont(int iFontObject, FX_BYTE charSet, LOGFONTA& lf)
+{
+ HFONT hFont = (HFONT)::GetStockObject(iFontObject);
+ if (hFont != NULL) {
+ memset(&lf, 0, sizeof(LOGFONTA));
+ int iRet = ::GetObject(hFont, sizeof(LOGFONTA), &lf);
+ if (iRet > 0 && (lf.lfCharSet == charSet || charSet == 255)) {
+ return RetrieveSpecificFont(lf);
+ }
+ }
+ return FALSE;
+}
+#endif
+CPDF_Font* CPDF_InterForm::AddSystemDefaultFont(const CPDF_Document* pDocument)
+{
+ if (pDocument == NULL) {
+ return NULL;
+ }
+ CPDF_Font* pFont = NULL;
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
+ LOGFONTA lf;
+ FX_BOOL bRet;
+ bRet = RetrieveStockFont(DEFAULT_GUI_FONT, 255, lf);
+ if (!bRet) {
+ bRet = RetrieveStockFont(SYSTEM_FONT, 255, lf);
+ }
+ if (bRet) {
+ pFont = ((CPDF_Document*)pDocument)->AddWindowsFont(&lf, FALSE, TRUE);
+ }
+#endif
+ return pFont;
+}
+CPDF_Font* CPDF_InterForm::AddSystemFont(const CPDF_Document* pDocument, CFX_ByteString csFontName, FX_BYTE iCharSet)
+{
+ if (pDocument == NULL || csFontName.IsEmpty()) {
+ return NULL;
+ }
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
+ if (iCharSet == 1) {
+ iCharSet = GetNativeCharSet();
+ }
+ HFONT hFont = ::CreateFontA(0, 0, 0, 0, 0, 0, 0, 0, iCharSet, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, (FX_LPCSTR)csFontName);
+ if (hFont != NULL) {
+ LOGFONTA lf;
+ memset(&lf, 0, sizeof(LOGFONTA));
+ ::GetObjectA(hFont, sizeof(LOGFONTA), &lf);
+ ::DeleteObject(hFont);
+ if (strlen(lf.lfFaceName) > 0) {
+ return ((CPDF_Document*)pDocument)->AddWindowsFont(&lf, FALSE, TRUE);
+ }
+ }
+#endif
+ return NULL;
+}
+CPDF_Font* CPDF_InterForm::AddSystemFont(const CPDF_Document* pDocument, CFX_WideString csFontName, FX_BYTE iCharSet)
+{
+ if (pDocument == NULL || csFontName.IsEmpty()) {
+ return NULL;
+ }
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
+ if (iCharSet == 1) {
+ iCharSet = GetNativeCharSet();
+ }
+ HFONT hFont = ::CreateFontW(0, 0, 0, 0, 0, 0, 0, 0, iCharSet, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, csFontName);
+ if (hFont != NULL) {
+ LOGFONTA lf;
+ memset(&lf, 0, sizeof(LOGFONTA));
+ ::GetObject(hFont, sizeof(LOGFONTA), &lf);
+ ::DeleteObject(hFont);
+ if (strlen(lf.lfFaceName) > 0) {
+ return ((CPDF_Document*)pDocument)->AddWindowsFont(&lf, FALSE, TRUE);
+ }
+ }
+#endif
+ return NULL;
+}
+CPDF_Font* CPDF_InterForm::AddStandardFont(const CPDF_Document* pDocument, CFX_ByteString csFontName)
+{
+ if (pDocument == NULL || csFontName.IsEmpty()) {
+ return NULL;
+ }
+ CPDF_Font* pFont = NULL;
+ if (csFontName == "ZapfDingbats") {
+ pFont = ((CPDF_Document*)pDocument)->AddStandardFont(csFontName, NULL);
+ } else {
+ CPDF_FontEncoding encoding(PDFFONT_ENCODING_WINANSI);
+ pFont = ((CPDF_Document*)pDocument)->AddStandardFont(csFontName, &encoding);
+ }
+ return pFont;
+}
+CFX_ByteString CPDF_InterForm::GetNativeFont(FX_BYTE charSet, FX_LPVOID pLogFont)
+{
+ CFX_ByteString csFontName;
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
+ LOGFONTA lf;
+ FX_BOOL bRet;
+ if (charSet == ANSI_CHARSET) {
+ csFontName = "Helvetica";
+ return csFontName;
+ }
+ bRet = FALSE;
+ if (charSet == SHIFTJIS_CHARSET) {
+ bRet = RetrieveSpecificFont(charSet, DEFAULT_PITCH | FF_DONTCARE, "MS Mincho", lf);
+ } else if (charSet == GB2312_CHARSET) {
+ bRet = RetrieveSpecificFont(charSet, DEFAULT_PITCH | FF_DONTCARE, "SimSun", lf);
+ } else if (charSet == CHINESEBIG5_CHARSET) {
+ bRet = RetrieveSpecificFont(charSet, DEFAULT_PITCH | FF_DONTCARE, "MingLiU", lf);
+ }
+ if (!bRet) {
+ bRet = RetrieveSpecificFont(charSet, DEFAULT_PITCH | FF_DONTCARE, "Arial Unicode MS", lf);
+ }
+ if (!bRet) {
+ bRet = RetrieveSpecificFont(charSet, DEFAULT_PITCH | FF_DONTCARE, "Microsoft Sans Serif", lf);
+ }
+ if (!bRet) {
+ bRet = RetrieveSpecificFont(charSet, DEFAULT_PITCH | FF_DONTCARE, NULL, lf);
+ }
+ if (bRet) {
+ if (pLogFont != NULL) {
+ memcpy(pLogFont, &lf, sizeof(LOGFONTA));
+ }
+ csFontName = lf.lfFaceName;
+ return csFontName;
+ }
+#endif
+ return csFontName;
+}
+CFX_ByteString CPDF_InterForm::GetNativeFont(FX_LPVOID pLogFont)
+{
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
+ FX_BYTE charSet = GetNativeCharSet();
+ return GetNativeFont(charSet, pLogFont);
+#else
+ return CFX_ByteString();
+#endif
+}
+FX_BYTE CPDF_InterForm::GetNativeCharSet()
+{
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
+ FX_BYTE charSet = ANSI_CHARSET;
+ UINT iCodePage = ::GetACP();
+ switch (iCodePage) {
+ case 932:
+ charSet = SHIFTJIS_CHARSET;
+ break;
+ case 936:
+ charSet = GB2312_CHARSET;
+ break;
+ case 950:
+ charSet = CHINESEBIG5_CHARSET;
+ break;
+ case 1252:
+ charSet = ANSI_CHARSET;
+ break;
+ case 874:
+ charSet = THAI_CHARSET;
+ break;
+ case 949:
+ charSet = HANGUL_CHARSET;
+ break;
+ case 1200:
+ charSet = ANSI_CHARSET;
+ break;
+ case 1250:
+ charSet = EASTEUROPE_CHARSET;
+ break;
+ case 1251:
+ charSet = RUSSIAN_CHARSET;
+ break;
+ case 1253:
+ charSet = GREEK_CHARSET;
+ break;
+ case 1254:
+ charSet = TURKISH_CHARSET;
+ break;
+ case 1255:
+ charSet = HEBREW_CHARSET;
+ break;
+ case 1256:
+ charSet = ARABIC_CHARSET;
+ break;
+ case 1257:
+ charSet = BALTIC_CHARSET;
+ break;
+ case 1258:
+ charSet = VIETNAMESE_CHARSET;
+ break;
+ case 1361:
+ charSet = JOHAB_CHARSET;
+ break;
+ }
+ return charSet;
+#else
+ return 0;
+#endif
+}
+CPDF_Font* CPDF_InterForm::AddNativeFont(FX_BYTE charSet, const CPDF_Document* pDocument)
+{
+ if (pDocument == NULL) {
+ return NULL;
+ }
+ CPDF_Font* pFont = NULL;
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
+ LOGFONTA lf;
+ CFX_ByteString csFontName = GetNativeFont(charSet, &lf);
+ if (!csFontName.IsEmpty()) {
+ if (csFontName == "Helvetica") {
+ pFont = AddStandardFont(pDocument, csFontName);
+ } else {
+ pFont = ((CPDF_Document*)pDocument)->AddWindowsFont(&lf, FALSE, TRUE);
+ }
+ }
+#endif
+ return pFont;
+}
+CPDF_Font* CPDF_InterForm::AddNativeFont(const CPDF_Document* pDocument)
+{
+ if (pDocument == NULL) {
+ return NULL;
+ }
+ CPDF_Font* pFont = NULL;
+ FX_BYTE charSet = GetNativeCharSet();
+ pFont = AddNativeFont(charSet, pDocument);
+ return pFont;
+}
+FX_BOOL CPDF_InterForm::ValidateFieldName(CFX_WideString& csNewFieldName, int iType, const CPDF_FormField* pExcludedField, const CPDF_FormControl* pExcludedControl)
+{
+ if (csNewFieldName.IsEmpty()) {
+ return FALSE;
+ }
+ int iPos = 0;
+ int iLength = csNewFieldName.GetLength();
+ CFX_WideString csSub;
+ while (TRUE) {
+ while (iPos < iLength && (csNewFieldName[iPos] == L'.' || csNewFieldName[iPos] == L' ')) {
+ iPos ++;
+ }
+ if (iPos < iLength && !csSub.IsEmpty()) {
+ csSub += L'.';
+ }
+ while (iPos < iLength && csNewFieldName[iPos] != L'.') {
+ csSub += csNewFieldName[iPos ++];
+ }
+ for (int i = csSub.GetLength() - 1; i > -1; i --) {
+ if (csSub[i] == L' ' || csSub[i] == L'.') {
+ csSub.SetAt(i, L'\0');
+ } else {
+ break;
+ }
+ }
+ FX_DWORD dwCount = m_pFieldTree->m_Root.CountFields();
+ for (FX_DWORD m = 0; m < dwCount; m ++) {
+ CPDF_FormField* pField = m_pFieldTree->m_Root.GetField(m);
+ if (pField == NULL) {
+ continue;
+ }
+ if (pField == pExcludedField) {
+ if (pExcludedControl != NULL) {
+ if (pField->CountControls() < 2) {
+ continue;
+ }
+ } else {
+ continue;
+ }
+ }
+ CFX_WideString csFullName = pField->GetFullName();
+ int iRet = CompareFieldName(csSub, csFullName);
+ if (iRet == 1) {
+ if (pField->GetFieldType() != iType) {
+ return FALSE;
+ }
+ } else if (iRet == 2 && csSub == csNewFieldName) {
+ if (csFullName[iPos] == L'.') {
+ return FALSE;
+ }
+ } else if (iRet == 3 && csSub == csNewFieldName) {
+ if (csNewFieldName[csFullName.GetLength()] == L'.') {
+ return FALSE;
+ }
+ }
+ }
+ if (iPos >= iLength) {
+ break;
+ }
+ }
+ if (csSub.IsEmpty()) {
+ return FALSE;
+ }
+ csNewFieldName = csSub;
+ return TRUE;
+}
+FX_BOOL CPDF_InterForm::ValidateFieldName(CFX_WideString& csNewFieldName, int iType)
+{
+ return ValidateFieldName(csNewFieldName, iType, NULL, NULL);
+}
+FX_BOOL CPDF_InterForm::ValidateFieldName(const CPDF_FormField* pField, CFX_WideString& csNewFieldName)
+{
+ if (pField == NULL || csNewFieldName.IsEmpty()) {
+ return FALSE;
+ }
+ return ValidateFieldName(csNewFieldName, ((CPDF_FormField*)pField)->GetFieldType(), pField, NULL);
+}
+FX_BOOL CPDF_InterForm::ValidateFieldName(const CPDF_FormControl* pControl, CFX_WideString& csNewFieldName)
+{
+ if (pControl == NULL || csNewFieldName.IsEmpty()) {
+ return FALSE;
+ }
+ CPDF_FormField* pField = ((CPDF_FormControl*)pControl)->GetField();
+ return ValidateFieldName(csNewFieldName, pField->GetFieldType(), pField, pControl);
+}
+int CPDF_InterForm::CompareFieldName(const CFX_ByteString& name1, const CFX_ByteString& name2)
+{
+ FX_LPCSTR ptr1 = name1, ptr2 = name2;
+ if (name1.GetLength() != name2.GetLength()) {
+ int i = 0;
+ while (ptr1[i] == ptr2[i]) {
+ i ++;
+ }
+ if (i == name1.GetLength()) {
+ return 2;
+ }
+ if (i == name2.GetLength()) {
+ return 3;
+ }
+ return 0;
+ } else {
+ return name1 == name2 ? 1 : 0;
+ }
+}
+int CPDF_InterForm::CompareFieldName(const CFX_WideString& name1, const CFX_WideString& name2)
+{
+ FX_LPCWSTR ptr1 = name1, ptr2 = name2;
+ if (name1.GetLength() != name2.GetLength()) {
+ int i = 0;
+ while (ptr1[i] == ptr2[i]) {
+ i ++;
+ }
+ if (i == name1.GetLength()) {
+ return 2;
+ }
+ if (i == name2.GetLength()) {
+ return 3;
+ }
+ return 0;
+ } else {
+ return name1 == name2 ? 1 : 0;
+ }
+}
+FX_DWORD CPDF_InterForm::CountFields(const CFX_WideString &csFieldName)
+{
+ if (csFieldName.IsEmpty()) {
+ return (FX_DWORD)m_pFieldTree->m_Root.CountFields();
+ }
+ CFieldTree::_Node *pNode = m_pFieldTree->FindNode(csFieldName);
+ if (pNode == NULL) {
+ return 0;
+ }
+ return pNode->CountFields();
+}
+CPDF_FormField* CPDF_InterForm::GetField(FX_DWORD index, const CFX_WideString &csFieldName)
+{
+ if (csFieldName == L"") {
+ return m_pFieldTree->m_Root.GetField(index);
+ }
+ CFieldTree::_Node *pNode = m_pFieldTree->FindNode(csFieldName);
+ if (pNode == NULL) {
+ return NULL;
+ }
+ return pNode->GetField(index);
+}
+void CPDF_InterForm::GetAllFieldNames(CFX_WideStringArray& allFieldNames)
+{
+ allFieldNames.RemoveAll();
+ int nCount = m_pFieldTree->m_Root.CountFields();
+ for (int i = 0; i < nCount; i ++) {
+ CPDF_FormField *pField = m_pFieldTree->m_Root.GetField(i);
+ if (pField) {
+ CFX_WideString full_name = GetFullName(pField->GetFieldDict());
+ allFieldNames.Add(full_name);
+ }
+ }
+}
+FX_BOOL CPDF_InterForm::IsValidFormField(const void* pField)
+{
+ if (pField == NULL) {
+ return FALSE;
+ }
+ int nCount = m_pFieldTree->m_Root.CountFields();
+ for (int i = 0; i < nCount; i++) {
+ CPDF_FormField *pFormField = m_pFieldTree->m_Root.GetField(i);
+ if (pField == pFormField) {
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+CPDF_FormField* CPDF_InterForm::GetFieldByDict(CPDF_Dictionary* pFieldDict) const
+{
+ if (pFieldDict == NULL) {
+ return NULL;
+ }
+ CFX_WideString csWName = GetFullName(pFieldDict);
+ return m_pFieldTree->GetField(csWName);
+}
+FX_DWORD CPDF_InterForm::CountControls(CFX_WideString csFieldName)
+{
+ if (csFieldName.IsEmpty()) {
+ return (FX_DWORD)m_ControlMap.GetCount();
+ }
+ CPDF_FormField *pField = m_pFieldTree->GetField(csFieldName);
+ if (pField == NULL) {
+ return 0;
+ }
+ return pField->m_ControlList.GetSize();
+}
+CPDF_FormControl* CPDF_InterForm::GetControl(FX_DWORD index, CFX_WideString csFieldName)
+{
+ CPDF_FormField *pField = m_pFieldTree->GetField(csFieldName);
+ if (pField == NULL) {
+ return NULL;
+ }
+ if (index < (FX_DWORD)pField->m_ControlList.GetSize()) {
+ return (CPDF_FormControl *)pField->m_ControlList.GetAt(index);
+ }
+ return NULL;
+}
+FX_BOOL CPDF_InterForm::IsValidFormControl(const void* pControl)
+{
+ if (pControl == NULL) {
+ return FALSE;
+ }
+ FX_POSITION pos = m_ControlMap.GetStartPosition();
+ while (pos) {
+ CPDF_Dictionary* pWidgetDict = NULL;
+ void* pFormControl = NULL;
+ m_ControlMap.GetNextAssoc(pos, (FX_LPVOID&)pWidgetDict, pFormControl);
+ if (pControl == pFormControl) {
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+int CPDF_InterForm::CountPageControls(CPDF_Page* pPage) const
+{
+ CPDF_Array* pAnnotList = pPage->m_pFormDict->GetArray("Annots");
+ if (pAnnotList == NULL) {
+ return 0;
+ }
+ int count = 0;
+ for (FX_DWORD i = 0; i < pAnnotList->GetCount(); i ++) {
+ CPDF_Dictionary* pAnnot = pAnnotList->GetDict(i);
+ if (pAnnot == NULL) {
+ continue;
+ }
+ CPDF_FormControl* pControl;
+ if (!m_ControlMap.Lookup(pAnnot, (FX_LPVOID&)pControl)) {
+ continue;
+ }
+ count ++;
+ }
+ return count;
+}
+CPDF_FormControl* CPDF_InterForm::GetPageControl(CPDF_Page* pPage, int index) const
+{
+ CPDF_Array* pAnnotList = pPage->m_pFormDict->GetArray("Annots");
+ if (pAnnotList == NULL) {
+ return NULL;
+ }
+ int count = 0;
+ for (FX_DWORD i = 0; i < pAnnotList->GetCount(); i ++) {
+ CPDF_Dictionary* pAnnot = pAnnotList->GetDict(i);
+ if (pAnnot == NULL) {
+ continue;
+ }
+ CPDF_FormControl* pControl;
+ if (!m_ControlMap.Lookup(pAnnot, (FX_LPVOID&)pControl)) {
+ continue;
+ }
+ if (index == count) {
+ return pControl;
+ }
+ count ++;
+ }
+ return NULL;
+}
+CPDF_FormControl* CPDF_InterForm::GetControlAtPoint(CPDF_Page* pPage, FX_FLOAT pdf_x, FX_FLOAT pdf_y) const
+{
+ CPDF_Array* pAnnotList = pPage->m_pFormDict->GetArray("Annots");
+ if (pAnnotList == NULL) {
+ return NULL;
+ }
+ for (FX_DWORD i = pAnnotList->GetCount(); i > 0; i --) {
+ CPDF_Dictionary* pAnnot = pAnnotList->GetDict(i - 1);
+ if (pAnnot == NULL) {
+ continue;
+ }
+ CPDF_FormControl* pControl;
+ if (!m_ControlMap.Lookup(pAnnot, (FX_LPVOID&)pControl)) {
+ continue;
+ }
+ CFX_FloatRect rect = pControl->GetRect();
+ if (rect.Contains(pdf_x, pdf_y)) {
+ return pControl;
+ }
+ }
+ return NULL;
+}
+CPDF_FormControl* CPDF_InterForm::GetControlByDict(CPDF_Dictionary* pWidgetDict) const
+{
+ CPDF_FormControl* pControl = NULL;
+ m_ControlMap.Lookup(pWidgetDict, (FX_LPVOID&)pControl);
+ return pControl;
+}
+FX_DWORD CPDF_InterForm::CountInternalFields(const CFX_WideString& csFieldName) const
+{
+ if (m_pFormDict == NULL) {
+ return 0;
+ }
+ CPDF_Array* pArray = m_pFormDict->GetArray("Fields");
+ if (pArray == NULL) {
+ return 0;
+ }
+ if (csFieldName.IsEmpty()) {
+ return pArray->GetCount();
+ } else {
+ int iLength = csFieldName.GetLength();
+ int iPos = 0;
+ CPDF_Dictionary* pDict = NULL;
+ while (pArray != NULL) {
+ CFX_WideString csSub;
+ if (iPos < iLength && csFieldName[iPos] == L'.') {
+ iPos ++;
+ }
+ while (iPos < iLength && csFieldName[iPos] != L'.') {
+ csSub += csFieldName[iPos ++];
+ }
+ int iCount = pArray->GetCount();
+ FX_BOOL bFind = FALSE;
+ for (int i = 0; i < iCount; i ++) {
+ pDict = pArray->GetDict(i);
+ if (pDict == NULL) {
+ continue;
+ }
+ CFX_WideString csT = pDict->GetUnicodeText("T");
+ if (csT == csSub) {
+ bFind = TRUE;
+ break;
+ }
+ }
+ if (!bFind) {
+ return 0;
+ }
+ if (iPos >= iLength) {
+ break;
+ }
+ pArray = pDict->GetArray("Kids");
+ }
+ if (pDict == NULL) {
+ return 0;
+ } else {
+ pArray = pDict->GetArray("Kids");
+ if (pArray == NULL) {
+ return 1;
+ } else {
+ return pArray->GetCount();
+ }
+ }
+ }
+}
+CPDF_Dictionary* CPDF_InterForm::GetInternalField(FX_DWORD index, const CFX_WideString& csFieldName) const
+{
+ if (m_pFormDict == NULL) {
+ return NULL;
+ }
+ CPDF_Array* pArray = m_pFormDict->GetArray("Fields");
+ if (pArray == NULL) {
+ return 0;
+ }
+ if (csFieldName.IsEmpty()) {
+ return pArray->GetDict(index);
+ } else {
+ int iLength = csFieldName.GetLength();
+ int iPos = 0;
+ CPDF_Dictionary* pDict = NULL;
+ while (pArray != NULL) {
+ CFX_WideString csSub;
+ if (iPos < iLength && csFieldName[iPos] == L'.') {
+ iPos ++;
+ }
+ while (iPos < iLength && csFieldName[iPos] != L'.') {
+ csSub += csFieldName[iPos ++];
+ }
+ int iCount = pArray->GetCount();
+ FX_BOOL bFind = FALSE;
+ for (int i = 0; i < iCount; i ++) {
+ pDict = pArray->GetDict(i);
+ if (pDict == NULL) {
+ continue;
+ }
+ CFX_WideString csT = pDict->GetUnicodeText("T");
+ if (csT == csSub) {
+ bFind = TRUE;
+ break;
+ }
+ }
+ if (!bFind) {
+ return NULL;
+ }
+ if (iPos >= iLength) {
+ break;
+ }
+ pArray = pDict->GetArray("Kids");
+ }
+ if (pDict == NULL) {
+ return NULL;
+ } else {
+ pArray = pDict->GetArray("Kids");
+ if (pArray == NULL) {
+ return pDict;
+ } else {
+ return pArray->GetDict(index);
+ }
+ }
+ }
+}
+FX_BOOL CPDF_InterForm::NeedConstructAP()
+{
+ if (m_pFormDict == NULL) {
+ return FALSE;
+ }
+ return m_pFormDict->GetBoolean("NeedAppearances");
+}
+void CPDF_InterForm::NeedConstructAP(FX_BOOL bNeedAP)
+{
+ if (m_pFormDict == NULL) {
+ InitInterFormDict(m_pFormDict, m_pDocument);
+ }
+ m_pFormDict->SetAtBoolean("NeedAppearances", bNeedAP);
+ m_bGenerateAP = bNeedAP;
+}
+int CPDF_InterForm::CountFieldsInCalculationOrder()
+{
+ if (m_pFormDict == NULL) {
+ return 0;
+ }
+ CPDF_Array* pArray = m_pFormDict->GetArray("CO");
+ if (pArray == NULL) {
+ return 0;
+ }
+ return pArray->GetCount();
+}
+CPDF_FormField* CPDF_InterForm::GetFieldInCalculationOrder(int index)
+{
+ if (m_pFormDict == NULL || index < 0) {
+ return NULL;
+ }
+ CPDF_Array* pArray = m_pFormDict->GetArray("CO");
+ if (pArray == NULL) {
+ return NULL;
+ }
+ CPDF_Object* pElement = pArray->GetElementValue(index);
+ if (pElement != NULL && pElement->GetType() == PDFOBJ_DICTIONARY) {
+ return GetFieldByDict((CPDF_Dictionary*)pElement);
+ }
+ return NULL;
+}
+int CPDF_InterForm::FindFieldInCalculationOrder(const CPDF_FormField* pField)
+{
+ if (m_pFormDict == NULL || pField == NULL) {
+ return -1;
+ }
+ CPDF_Array* pArray = m_pFormDict->GetArray("CO");
+ if (pArray == NULL) {
+ return -1;
+ }
+ for (FX_DWORD i = 0; i < pArray->GetCount(); i ++) {
+ CPDF_Object* pElement = pArray->GetElementValue(i);
+ if (pElement == pField->m_pDict) {
+ return i;
+ }
+ }
+ return -1;
+}
+FX_DWORD CPDF_InterForm::CountFormFonts()
+{
+ return CountInterFormFonts(m_pFormDict);
+}
+CPDF_Font* CPDF_InterForm::GetFormFont(FX_DWORD index, CFX_ByteString& csNameTag)
+{
+ return GetInterFormFont(m_pFormDict, m_pDocument, index, csNameTag);
+}
+CPDF_Font* CPDF_InterForm::GetFormFont(CFX_ByteString csNameTag)
+{
+ return GetInterFormFont(m_pFormDict, m_pDocument, csNameTag);
+}
+CPDF_Font* CPDF_InterForm::GetFormFont(CFX_ByteString csFontName, CFX_ByteString& csNameTag)
+{
+ return GetInterFormFont(m_pFormDict, m_pDocument, csFontName, csNameTag);
+}
+CPDF_Font* CPDF_InterForm::GetNativeFormFont(FX_BYTE charSet, CFX_ByteString& csNameTag)
+{
+ return GetNativeInterFormFont(m_pFormDict, m_pDocument, charSet, csNameTag);
+}
+CPDF_Font* CPDF_InterForm::GetNativeFormFont(CFX_ByteString& csNameTag)
+{
+ return GetNativeInterFormFont(m_pFormDict, m_pDocument, csNameTag);
+}
+FX_BOOL CPDF_InterForm::FindFormFont(const CPDF_Font* pFont, CFX_ByteString& csNameTag)
+{
+ return FindInterFormFont(m_pFormDict, pFont, csNameTag);
+}
+FX_BOOL CPDF_InterForm::FindFormFont(CFX_ByteString csFontName, CPDF_Font*& pFont, CFX_ByteString& csNameTag)
+{
+ return FindInterFormFont(m_pFormDict, m_pDocument, csFontName, pFont, csNameTag);
+}
+void CPDF_InterForm::AddFormFont(const CPDF_Font* pFont, CFX_ByteString& csNameTag)
+{
+ AddInterFormFont(m_pFormDict, m_pDocument, pFont, csNameTag);
+ m_bUpdated = TRUE;
+}
+CPDF_Font* CPDF_InterForm::AddNativeFormFont(FX_BYTE charSet, CFX_ByteString& csNameTag)
+{
+ m_bUpdated = TRUE;
+ return AddNativeInterFormFont(m_pFormDict, m_pDocument, charSet, csNameTag);
+}
+CPDF_Font* CPDF_InterForm::AddNativeFormFont(CFX_ByteString& csNameTag)
+{
+ m_bUpdated = TRUE;
+ return AddNativeInterFormFont(m_pFormDict, m_pDocument, csNameTag);
+}
+void CPDF_InterForm::RemoveFormFont(const CPDF_Font* pFont)
+{
+ m_bUpdated = TRUE;
+ RemoveInterFormFont(m_pFormDict, pFont);
+}
+void CPDF_InterForm::RemoveFormFont(CFX_ByteString csNameTag)
+{
+ m_bUpdated = TRUE;
+ RemoveInterFormFont(m_pFormDict, csNameTag);
+}
+CPDF_DefaultAppearance CPDF_InterForm::GetDefaultAppearance()
+{
+ CFX_ByteString csDA;
+ if (m_pFormDict == NULL) {
+ return csDA;
+ }
+ csDA = m_pFormDict->GetString("DA");
+ return csDA;
+}
+CPDF_Font* CPDF_InterForm::GetDefaultFormFont()
+{
+ return GetDefaultInterFormFont(m_pFormDict, m_pDocument);
+}
+int CPDF_InterForm::GetFormAlignment()
+{
+ if (m_pFormDict == NULL) {
+ return 0;
+ }
+ return m_pFormDict->GetInteger("Q", 0);
+}
+FX_BOOL CPDF_InterForm::ResetForm(const CFX_PtrArray& fields, FX_BOOL bIncludeOrExclude, FX_BOOL bNotify)
+{
+ if (bNotify && m_pFormNotify != NULL) {
+ int iRet = m_pFormNotify->BeforeFormReset(this);
+ if (iRet < 0) {
+ return FALSE;
+ }
+ }
+ int nCount = m_pFieldTree->m_Root.CountFields();
+ for (int i = 0; i < nCount; i++) {
+ CPDF_FormField* pField = m_pFieldTree->m_Root.GetField(i);
+ if (pField == NULL) {
+ continue;
+ }
+ FX_BOOL bFind = FALSE;
+ int iCount = fields.GetSize();
+ for (int i = 0; i < iCount; i ++) {
+ if (pField == (CPDF_FormField*)fields[i]) {
+ bFind = TRUE;
+ break;
+ }
+ }
+ if ((bIncludeOrExclude && bFind) || (!bIncludeOrExclude && !bFind)) {
+ pField->ResetField(bNotify);
+ }
+ }
+ if (bNotify && m_pFormNotify != NULL) {
+ m_pFormNotify->AfterFormReset(this);
+ }
+ return TRUE;
+}
+FX_BOOL CPDF_InterForm::ResetForm(FX_BOOL bNotify)
+{
+ if (bNotify && m_pFormNotify != NULL) {
+ int iRet = m_pFormNotify->BeforeFormReset(this);
+ if (iRet < 0) {
+ return FALSE;
+ }
+ }
+ int nCount = m_pFieldTree->m_Root.CountFields();
+ for (int i = 0; i < nCount; i++) {
+ CPDF_FormField* pField = m_pFieldTree->m_Root.GetField(i);
+ if (pField == NULL) {
+ continue;
+ }
+ pField->ResetField(bNotify);
+ }
+ if (bNotify && m_pFormNotify != NULL) {
+ m_pFormNotify->AfterFormReset(this);
+ }
+ return TRUE;
+}
+void CPDF_InterForm::ReloadForm()
+{
+ FX_POSITION pos = m_ControlMap.GetStartPosition();
+ while (pos) {
+ CPDF_Dictionary* pWidgetDict;
+ CPDF_FormControl* pControl;
+ m_ControlMap.GetNextAssoc(pos, (FX_LPVOID&)pWidgetDict, (FX_LPVOID&)pControl);
+ delete pControl;
+ }
+ m_ControlMap.RemoveAll();
+ int nCount = m_pFieldTree->m_Root.CountFields();
+ for (int k = 0; k < nCount; k ++) {
+ CPDF_FormField* pField = m_pFieldTree->m_Root.GetField(k);
+ delete pField;
+ }
+ m_pFieldTree->RemoveAll();
+ if (m_pFormDict == NULL) {
+ return;
+ }
+ CPDF_Array* pFields = m_pFormDict->GetArray("Fields");
+ if (pFields == NULL) {
+ return;
+ }
+ int iCount = pFields->GetCount();
+ for (int i = 0; i < iCount; i ++) {
+ LoadField(pFields->GetDict(i));
+ }
+}
+void CPDF_InterForm::LoadField(CPDF_Dictionary* pFieldDict, int nLevel)
+{
+ if (nLevel > nMaxRecursion) {
+ return;
+ }
+ if (pFieldDict == NULL) {
+ return;
+ }
+ FX_DWORD dwParentObjNum = pFieldDict->GetObjNum();
+ CPDF_Array* pKids = pFieldDict->GetArray("Kids");
+ if (!pKids) {
+ AddTerminalField(pFieldDict);
+ return;
+ }
+ CPDF_Dictionary* pFirstKid = pKids->GetDict(0);
+ if (pFirstKid == NULL) {
+ return;
+ }
+ if (pFirstKid->KeyExist("T") || pFirstKid->KeyExist("Kids")) {
+ for (FX_DWORD i = 0; i < pKids->GetCount(); i ++) {
+ CPDF_Dictionary * pChildDict = pKids->GetDict(i);
+ if (pChildDict) {
+ if (pChildDict->GetObjNum() != dwParentObjNum) {
+ LoadField(pChildDict, nLevel + 1);
+ }
+ }
+ }
+ } else {
+ AddTerminalField(pFieldDict);
+ }
+}
+FX_BOOL CPDF_InterForm::HasXFAForm() const
+{
+ return m_pFormDict && m_pFormDict->GetArray(FX_BSTRC("XFA")) != NULL;
+}
+void CPDF_InterForm::FixPageFields(const CPDF_Page* pPage)
+{
+ ASSERT(pPage != NULL);
+ CPDF_Dictionary* pPageDict = pPage->m_pFormDict;
+ if (pPageDict == NULL) {
+ return;
+ }
+ CPDF_Array* pAnnots = pPageDict->GetArray(FX_BSTRC("Annots"));
+ if (pAnnots == NULL) {
+ return;
+ }
+ int iAnnotCount = pAnnots->GetCount();
+ for (int i = 0; i < iAnnotCount; i++) {
+ CPDF_Dictionary* pAnnot = pAnnots->GetDict(i);
+ if (pAnnot != NULL && pAnnot->GetString(FX_BSTRC("Subtype")) == "Widget") {
+ LoadField(pAnnot);
+ }
+ }
+}
+CPDF_FormField* CPDF_InterForm::AddTerminalField(const CPDF_Dictionary* pFieldDict)
+{
+ if (!pFieldDict->KeyExist(FX_BSTRC("T"))) {
+ return NULL;
+ }
+ CPDF_Dictionary* pDict = (CPDF_Dictionary*)pFieldDict;
+ CFX_WideString csWName = GetFullName(pDict);
+ if (csWName.IsEmpty()) {
+ return NULL;
+ }
+ CPDF_FormField* pField = NULL;
+ pField = m_pFieldTree->GetField(csWName);
+ if (pField == NULL) {
+ CPDF_Dictionary *pParent = (CPDF_Dictionary*)pFieldDict;
+ if (!pFieldDict->KeyExist(FX_BSTR("T")) &&
+ pFieldDict->GetString(FX_BSTRC("Subtype")) == FX_BSTRC("Widget")) {
+ pParent = pFieldDict->GetDict(FX_BSTRC("Parent"));
+ if (!pParent) {
+ pParent = (CPDF_Dictionary*)pFieldDict;
+ }
+ }
+ if (pParent && pParent != pFieldDict && !pParent->KeyExist(FX_BSTRC("FT"))) {
+ if (pFieldDict->KeyExist(FX_BSTRC("FT"))) {
+ CPDF_Object *pFTValue = pFieldDict->GetElementValue(FX_BSTRC("FT"));
+ if (pFTValue) {
+ pParent->SetAt(FX_BSTRC("FT"), pFTValue->Clone());
+ }
+ }
+ if (pFieldDict->KeyExist(FX_BSTRC("Ff"))) {
+ CPDF_Object *pFfValue = pFieldDict->GetElementValue(FX_BSTRC("Ff"));
+ if (pFfValue) {
+ pParent->SetAt(FX_BSTRC("Ff"), pFfValue->Clone());
+ }
+ }
+ }
+ pField = FX_NEW CPDF_FormField(this, pParent);
+ CPDF_Object* pTObj = pDict->GetElement("T");
+ if (pTObj && pTObj->GetType() == PDFOBJ_REFERENCE) {
+ CPDF_Object* pClone = pTObj->Clone(TRUE);
+ if (pClone) {
+ pDict->SetAt("T", pClone);
+ } else {
+ pDict->SetAtName("T", "");
+ }
+ }
+ m_pFieldTree->SetField(csWName, pField);
+ }
+ CPDF_Array* pKids = pFieldDict->GetArray("Kids");
+ if (pKids == NULL) {
+ if (pFieldDict->GetString("Subtype") == "Widget") {
+ AddControl(pField, pFieldDict);
+ }
+ } else {
+ for (FX_DWORD i = 0; i < pKids->GetCount(); i ++) {
+ CPDF_Dictionary* pKid = pKids->GetDict(i);
+ if (pKid == NULL) {
+ continue;
+ }
+ if (pKid->GetString("Subtype") != "Widget") {
+ continue;
+ }
+ AddControl(pField, pKid);
+ }
+ }
+ return pField;
+}
+CPDF_FormControl* CPDF_InterForm::AddControl(const CPDF_FormField* pField, const CPDF_Dictionary* pWidgetDict)
+{
+ void *rValue = NULL;
+ if (m_ControlMap.Lookup((CPDF_Dictionary*)pWidgetDict, rValue)) {
+ return (CPDF_FormControl*)rValue;
+ }
+ CPDF_FormControl* pControl = FX_NEW CPDF_FormControl((CPDF_FormField*)pField, (CPDF_Dictionary*)pWidgetDict);
+ if (pControl == NULL) {
+ return NULL;
+ }
+ m_ControlMap.SetAt((CPDF_Dictionary*)pWidgetDict, pControl);
+ ((CPDF_FormField*)pField)->m_ControlList.Add(pControl);
+ return pControl;
+}
+CPDF_FormField* CPDF_InterForm::CheckRequiredFields(const CFX_PtrArray *fields, FX_BOOL bIncludeOrExclude) const
+{
+ int nCount = m_pFieldTree->m_Root.CountFields();
+ for (int i = 0; i < nCount; i++) {
+ CPDF_FormField* pField = m_pFieldTree->m_Root.GetField(i);
+ if (pField == NULL) {
+ continue;
+ }
+ FX_INT32 iType = pField->GetType();
+ if (iType == CPDF_FormField::PushButton || iType == CPDF_FormField::CheckBox || iType == CPDF_FormField::ListBox) {
+ continue;
+ }
+ FX_DWORD dwFlags = pField->GetFieldFlags();
+ if (dwFlags & 0x04) {
+ continue;
+ }
+ FX_BOOL bFind = TRUE;
+ if (fields != NULL) {
+ bFind = fields->Find(pField, 0) >= 0;
+ }
+ if ((bIncludeOrExclude && bFind) || (!bIncludeOrExclude && !bFind)) {
+ CPDF_Dictionary *pFieldDict = pField->m_pDict;
+ if ((dwFlags & 0x02) != 0 && pFieldDict->GetString("V").IsEmpty()) {
+ return pField;
+ }
+ }
+ }
+ return NULL;
+}
+CFDF_Document* CPDF_InterForm::ExportToFDF(FX_WSTR pdf_path, FX_BOOL bSimpleFileSpec) const
+{
+ CFX_PtrArray fields;
+ int nCount = m_pFieldTree->m_Root.CountFields();
+ for (int i = 0; i < nCount; i ++) {
+ CPDF_FormField* pField = m_pFieldTree->m_Root.GetField(i);
+ fields.Add(pField);
+ }
+ return ExportToFDF(pdf_path, fields, TRUE, bSimpleFileSpec);
+}
+CFX_WideString FILESPEC_EncodeFileName(FX_WSTR filepath);
+CFDF_Document* CPDF_InterForm::ExportToFDF(FX_WSTR pdf_path, CFX_PtrArray& fields, FX_BOOL bIncludeOrExclude, FX_BOOL bSimpleFileSpec) const
+{
+ CFDF_Document* pDoc = CFDF_Document::CreateNewDoc();
+ if (pDoc == NULL) {
+ return NULL;
+ }
+ CPDF_Dictionary* pMainDict = pDoc->GetRoot()->GetDict("FDF");
+ if (!pdf_path.IsEmpty()) {
+ if (bSimpleFileSpec) {
+ CFX_WideString wsFilePath = FILESPEC_EncodeFileName(pdf_path);
+ pMainDict->SetAtString(FX_BSTRC("F"), CFX_ByteString::FromUnicode(wsFilePath));
+ pMainDict->SetAtString(FX_BSTRC("UF"), PDF_EncodeText(wsFilePath));
+ } else {
+ CPDF_FileSpec filespec;
+ filespec.SetFileName(pdf_path);
+ pMainDict->SetAt("F", (CPDF_Object*)filespec);
+ }
+ }
+ CPDF_Array* pFields = CPDF_Array::Create();
+ if (pFields == NULL) {
+ return NULL;
+ }
+ pMainDict->SetAt("Fields", pFields);
+ int nCount = m_pFieldTree->m_Root.CountFields();
+ for (int i = 0; i < nCount; i ++) {
+ CPDF_FormField* pField = m_pFieldTree->m_Root.GetField(i);
+ if (pField == NULL || pField->GetType() == CPDF_FormField::PushButton) {
+ continue;
+ }
+ FX_DWORD dwFlags = pField->GetFieldFlags();
+ if (dwFlags & 0x04) {
+ continue;
+ }
+ FX_BOOL bFind = fields.Find(pField, 0) >= 0;
+ if ((bIncludeOrExclude && bFind) || (!bIncludeOrExclude && !bFind)) {
+ if ((dwFlags & 0x02) != 0 && pField->m_pDict->GetString("V").IsEmpty()) {
+ continue;
+ }
+ CFX_WideString fullname = GetFullName(pField->GetFieldDict());
+ CPDF_Dictionary* pFieldDict = CPDF_Dictionary::Create();
+ if (pFieldDict == NULL) {
+ return NULL;
+ }
+ CPDF_String* pString = CPDF_String::Create(fullname);
+ if (pString == NULL) {
+ pFieldDict->Release();
+ return NULL;
+ }
+ pFieldDict->SetAt("T", pString);
+ if (pField->GetType() == CPDF_FormField::CheckBox || pField->GetType() == CPDF_FormField::RadioButton) {
+ CFX_WideString csExport = pField->GetCheckValue(FALSE);
+ CFX_ByteString csBExport = PDF_EncodeText(csExport);
+ CPDF_Object* pOpt = FPDF_GetFieldAttr(pField->m_pDict, "Opt");
+ if (pOpt == NULL) {
+ pFieldDict->SetAtName("V", csBExport);
+ } else {
+ pFieldDict->SetAtString("V", csBExport);
+ }
+ } else {
+ CPDF_Object* pV = FPDF_GetFieldAttr(pField->m_pDict, "V");
+ if (pV != NULL) {
+ pFieldDict->SetAt("V", pV->Clone(TRUE));
+ }
+ }
+ pFields->Add(pFieldDict);
+ }
+ }
+ return pDoc;
+}
+const struct _SupportFieldEncoding {
+ FX_LPCSTR m_name;
+ FX_INT32 m_codePage;
+} g_fieldEncoding[] = {
+ "BigFive", 950,
+ "GBK", 936,
+ "Shift-JIS", 932,
+ "UHC", 949,
+};
+static void FPDFDOC_FDF_GetFieldValue(CPDF_Dictionary *pFieldDict, CFX_WideString &csValue, CFX_ByteString &bsEncoding)
+{
+ ASSERT(pFieldDict != NULL);
+ CFX_ByteString csBValue = pFieldDict->GetString("V");
+ FX_INT32 iCount = sizeof(g_fieldEncoding) / sizeof(g_fieldEncoding[0]);
+ FX_INT32 i = 0;
+ for (; i < iCount; ++i)
+ if (bsEncoding == g_fieldEncoding[i].m_name) {
+ break;
+ }
+ if (i < iCount) {
+ CFX_CharMap *pCharMap = CFX_CharMap::GetDefaultMapper(g_fieldEncoding[i].m_codePage);
+ FXSYS_assert(pCharMap != NULL);
+ csValue.ConvertFrom(csBValue, pCharMap);
+ return;
+ }
+ CFX_ByteString csTemp = csBValue.Left(2);
+ if (csTemp == "\xFF\xFE" || csTemp == "\xFE\xFF") {
+ csValue = PDF_DecodeText(csBValue);
+ } else {
+ csValue = CFX_WideString::FromLocal(csBValue);
+ }
+}
+void CPDF_InterForm::FDF_ImportField(CPDF_Dictionary* pFieldDict, const CFX_WideString& parent_name, FX_BOOL bNotify, int nLevel)
+{
+ CFX_WideString name;
+ if (!parent_name.IsEmpty()) {
+ name = parent_name + L".";
+ }
+ name += pFieldDict->GetUnicodeText("T");
+ CPDF_Array* pKids = pFieldDict->GetArray("Kids");
+ if (pKids) {
+ for (FX_DWORD i = 0; i < pKids->GetCount(); i ++) {
+ CPDF_Dictionary* pKid = pKids->GetDict(i);
+ if (pKid == NULL) {
+ continue;
+ }
+ if (nLevel <= nMaxRecursion) {
+ FDF_ImportField(pKid, name, bNotify, nLevel + 1);
+ }
+ }
+ return;
+ }
+ if (!pFieldDict->KeyExist("V")) {
+ return;
+ }
+ CPDF_FormField* pField = m_pFieldTree->GetField(name);
+ if (pField == NULL) {
+ return;
+ }
+ CFX_WideString csWValue;
+ FPDFDOC_FDF_GetFieldValue(pFieldDict, csWValue, m_bsEncoding);
+ int iType = pField->GetFieldType();
+ if (bNotify && m_pFormNotify != NULL) {
+ int iRet = 0;
+ if (iType == FIELDTYPE_LISTBOX) {
+ iRet = m_pFormNotify->BeforeSelectionChange(pField, csWValue);
+ } else if (iType == FIELDTYPE_COMBOBOX || iType == FIELDTYPE_TEXTFIELD) {
+ iRet = m_pFormNotify->BeforeValueChange(pField, csWValue);
+ }
+ if (iRet < 0) {
+ return;
+ }
+ }
+ CFX_ByteArray statusArray;
+ if (iType == FIELDTYPE_CHECKBOX || iType == FIELDTYPE_RADIOBUTTON) {
+ SaveCheckedFieldStatus(pField, statusArray);
+ }
+ pField->SetValue(csWValue);
+ CPDF_FormField::Type eType = pField->GetType();
+ if ((eType == CPDF_FormField::ListBox || eType == CPDF_FormField::ComboBox) && pFieldDict->KeyExist("Opt")) {
+ pField->m_pDict->SetAt("Opt", pFieldDict->GetElementValue("Opt")->Clone(TRUE));
+ }
+ if (bNotify && m_pFormNotify != NULL) {
+ if (iType == FIELDTYPE_CHECKBOX || iType == FIELDTYPE_RADIOBUTTON) {
+ m_pFormNotify->AfterCheckedStatusChange(pField, statusArray);
+ } else if (iType == FIELDTYPE_LISTBOX) {
+ m_pFormNotify->AfterSelectionChange(pField);
+ } else if (iType == FIELDTYPE_COMBOBOX || iType == FIELDTYPE_TEXTFIELD) {
+ m_pFormNotify->AfterValueChange(pField);
+ }
+ }
+ if (CPDF_InterForm::m_bUpdateAP) {
+ pField->UpdateAP(NULL);
+ }
+}
+FX_BOOL CPDF_InterForm::ImportFromFDF(const CFDF_Document* pFDF, FX_BOOL bNotify)
+{
+ if (pFDF == NULL) {
+ return FALSE;
+ }
+ CPDF_Dictionary* pMainDict = pFDF->GetRoot()->GetDict("FDF");
+ if (pMainDict == NULL) {
+ return FALSE;
+ }
+ CPDF_Array* pFields = pMainDict->GetArray("Fields");
+ if (pFields == NULL) {
+ return FALSE;
+ }
+ m_bsEncoding = pMainDict->GetString(FX_BSTRC("Encoding"));
+ if (bNotify && m_pFormNotify != NULL) {
+ int iRet = m_pFormNotify->BeforeFormImportData(this);
+ if (iRet < 0) {
+ return FALSE;
+ }
+ }
+ for (FX_DWORD i = 0; i < pFields->GetCount(); i ++) {
+ CPDF_Dictionary* pField = pFields->GetDict(i);
+ if (pField == NULL) {
+ continue;
+ }
+ FDF_ImportField(pField, L"", bNotify);
+ }
+ if (bNotify && m_pFormNotify != NULL) {
+ m_pFormNotify->AfterFormImportData(this);
+ }
+ return TRUE;
+}
+void CPDF_InterForm::SetFormNotify(const CPDF_FormNotify* pNotify)
+{
+ m_pFormNotify = (CPDF_FormNotify*)pNotify;
+}
+int CPDF_InterForm::GetPageWithWidget(int iCurPage, FX_BOOL bNext)
+{
+ if (iCurPage < 0) {
+ return -1;
+ }
+ int iPageCount = m_pDocument->GetPageCount();
+ if (iCurPage >= iPageCount) {
+ return -1;
+ }
+ int iNewPage = iCurPage;
+ do {
+ iNewPage += bNext ? 1 : -1;
+ if (iNewPage >= iPageCount) {
+ iNewPage = 0;
+ }
+ if (iNewPage < 0) {
+ iNewPage = iPageCount - 1;
+ }
+ if (iNewPage == iCurPage) {
+ break;
+ }
+ CPDF_Dictionary* pPageDict = m_pDocument->GetPage(iNewPage);
+ if (pPageDict == NULL) {
+ continue;
+ }
+ CPDF_Array* pAnnots = pPageDict->GetArray("Annots");
+ if (pAnnots == NULL) {
+ continue;
+ }
+ FX_DWORD dwCount = pAnnots->GetCount();
+ for (FX_DWORD i = 0; i < dwCount; i ++) {
+ CPDF_Object* pAnnotDict = pAnnots->GetElementValue(i);
+ if (pAnnotDict == NULL) {
+ continue;
+ }
+ CPDF_FormControl* pControl = NULL;
+ if (m_ControlMap.Lookup(pAnnotDict, (void*&)pControl)) {
+ return iNewPage;
+ }
+ }
+ } while (TRUE);
+ return -1;
+}
diff --git a/core/src/fpdfdoc/doc_formcontrol.cpp b/core/src/fpdfdoc/doc_formcontrol.cpp
index f92b87e5f6..61cd980754 100644
--- a/core/src/fpdfdoc/doc_formcontrol.cpp
+++ b/core/src/fpdfdoc/doc_formcontrol.cpp
@@ -1,461 +1,461 @@
-// 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
-
-#include "../../include/fpdfdoc/fpdf_doc.h"
-CPDF_FormControl::CPDF_FormControl(CPDF_FormField* pField, CPDF_Dictionary* pWidgetDict)
-{
- m_pField = pField;
- m_pWidgetDict = pWidgetDict;
- m_pForm = m_pField->m_pForm;
-}
-CFX_FloatRect CPDF_FormControl::GetRect()
-{
- return m_pWidgetDict->GetRect("Rect");
-}
-CFX_ByteString CPDF_FormControl::GetOnStateName()
-{
- ASSERT(GetType() == CPDF_FormField::CheckBox || GetType() == CPDF_FormField::RadioButton);
- CFX_ByteString csOn;
- CPDF_Dictionary* pAP = m_pWidgetDict->GetDict("AP");
- if (pAP == NULL) {
- return csOn;
- }
- CPDF_Dictionary* pN = pAP->GetDict("N");
- if (pN == NULL) {
- return csOn;
- }
- FX_POSITION pos = pN->GetStartPos();
- while (pos) {
- pN->GetNextElement(pos, csOn);
- if (csOn != "Off") {
- return csOn;
- }
- }
- return CFX_ByteString();
-}
-void CPDF_FormControl::SetOnStateName(const CFX_ByteString& csOn)
-{
- ASSERT(GetType() == CPDF_FormField::CheckBox || GetType() == CPDF_FormField::RadioButton);
- CFX_ByteString csValue = csOn;
- if (csValue.IsEmpty()) {
- csValue = "Yes";
- }
- if (csValue == "Off") {
- csValue = "Yes";
- }
- CFX_ByteString csAS = m_pWidgetDict->GetString("AS", "Off");
- if (csAS != "Off") {
- m_pWidgetDict->SetAtName("AS", csValue);
- }
- CPDF_Dictionary* pAP = m_pWidgetDict->GetDict("AP");
- if (pAP == NULL) {
- return;
- }
- FX_POSITION pos1 = pAP->GetStartPos();
- while (pos1) {
- CFX_ByteString csKey1;
- CPDF_Object* pObj1 = pAP->GetNextElement(pos1, csKey1);
- if (pObj1 == NULL) {
- continue;
- }
- CPDF_Object* pObjDirect1 = pObj1->GetDirect();
- if (pObjDirect1->GetType() != PDFOBJ_DICTIONARY) {
- continue;
- }
- CPDF_Dictionary* pSubDict = (CPDF_Dictionary*)pObjDirect1;
- FX_POSITION pos2 = pSubDict->GetStartPos();
- while (pos2) {
- CFX_ByteString csKey2;
- CPDF_Object* pObj2 = pSubDict->GetNextElement(pos2, csKey2);
- if (pObj2 == NULL) {
- continue;
- }
- if (csKey2 != "Off") {
- pSubDict->ReplaceKey(csKey2, csValue);
- break;
- }
- }
- }
-}
-CFX_ByteString CPDF_FormControl::GetCheckedAPState()
-{
- ASSERT(GetType() == CPDF_FormField::CheckBox || GetType() == CPDF_FormField::RadioButton);
- CFX_ByteString csOn = GetOnStateName();
- if (GetType() == CPDF_FormField::RadioButton || GetType() == CPDF_FormField::CheckBox) {
- CPDF_Object* pOpt = FPDF_GetFieldAttr(m_pField->m_pDict, "Opt");
- if (pOpt != NULL && pOpt->GetType() == PDFOBJ_ARRAY) {
- int iIndex = m_pField->GetControlIndex(this);
- csOn.Format("%d", iIndex);
- }
- }
- if (csOn.IsEmpty()) {
- csOn = "Yes";
- }
- return csOn;
-}
-CFX_WideString CPDF_FormControl::GetExportValue()
-{
- ASSERT(GetType() == CPDF_FormField::CheckBox || GetType() == CPDF_FormField::RadioButton);
- CFX_ByteString csOn = GetOnStateName();
- if (GetType() == CPDF_FormField::RadioButton || GetType() == CPDF_FormField::CheckBox) {
- CPDF_Object* pOpt = FPDF_GetFieldAttr(m_pField->m_pDict, "Opt");
- if (pOpt != NULL && pOpt->GetType() == PDFOBJ_ARRAY) {
- int iIndex = m_pField->GetControlIndex(this);
- csOn = ((CPDF_Array*)pOpt)->GetString(iIndex);
- }
- }
- if (csOn.IsEmpty()) {
- csOn = "Yes";
- }
- CFX_WideString csWOn = PDF_DecodeText(csOn);
- return csWOn;
-}
-FX_BOOL CPDF_FormControl::IsChecked()
-{
- ASSERT(GetType() == CPDF_FormField::CheckBox || GetType() == CPDF_FormField::RadioButton);
- CFX_ByteString csOn = GetOnStateName();
- CFX_ByteString csAS = m_pWidgetDict->GetString("AS");
- return csAS == csOn;
-}
-FX_BOOL CPDF_FormControl::IsDefaultChecked()
-{
- ASSERT(GetType() == CPDF_FormField::CheckBox || GetType() == CPDF_FormField::RadioButton);
- CPDF_Object* pDV = FPDF_GetFieldAttr(m_pField->m_pDict, "DV");
- if (pDV == NULL) {
- return FALSE;
- }
- CFX_ByteString csDV = pDV->GetString();
- CFX_ByteString csOn = GetOnStateName();
- return (csDV == csOn);
-}
-void CPDF_FormControl::CheckControl(FX_BOOL bChecked)
-{
- ASSERT(GetType() == CPDF_FormField::CheckBox || GetType() == CPDF_FormField::RadioButton);
- CFX_ByteString csOn = GetOnStateName();
- CFX_ByteString csOldAS = m_pWidgetDict->GetString("AS", "Off");
- CFX_ByteString csAS = "Off";
- if (bChecked) {
- csAS = csOn;
- }
- if (csOldAS == csAS) {
- return;
- }
- m_pWidgetDict->SetAtName("AS", csAS);
- m_pForm->m_bUpdated = TRUE;
-}
-CPDF_Stream* FPDFDOC_GetAnnotAP(CPDF_Dictionary* pAnnotDict, CPDF_Annot::AppearanceMode mode);
-void CPDF_FormControl::DrawControl(CFX_RenderDevice* pDevice, CFX_AffineMatrix* pMatrix, CPDF_Page* pPage,
- CPDF_Annot::AppearanceMode mode, const CPDF_RenderOptions* pOptions)
-{
- if (m_pWidgetDict->GetInteger("F") & ANNOTFLAG_HIDDEN) {
- return;
- }
- CPDF_Stream* pStream = FPDFDOC_GetAnnotAP(m_pWidgetDict, mode);
- if (pStream == NULL) {
- return;
- }
- CFX_FloatRect form_bbox = pStream->GetDict()->GetRect("BBox");
- CFX_AffineMatrix form_matrix = pStream->GetDict()->GetMatrix("Matrix");
- form_matrix.TransformRect(form_bbox);
- CFX_FloatRect arect = m_pWidgetDict->GetRect("Rect");
- CFX_AffineMatrix matrix;
- matrix.MatchRect(arect, form_bbox);
- matrix.Concat(*pMatrix);
- CPDF_Form form(m_pField->m_pForm->m_pDocument, m_pField->m_pForm->m_pFormDict->GetDict("DR"), pStream);
- form.ParseContent(NULL, NULL, NULL, NULL);
- CPDF_RenderContext context;
- context.Create(pPage);
- context.DrawObjectList(pDevice, &form, &matrix, pOptions);
-}
-const FX_CHAR* g_sHighlightingMode[] = {"N", "I", "O", "P", "T", ""};
-CPDF_FormControl::HighlightingMode CPDF_FormControl::GetHighlightingMode()
-{
- if (m_pWidgetDict == NULL) {
- return Invert;
- }
- CFX_ByteString csH = m_pWidgetDict->GetString("H", "I");
- int i = 0;
- while (g_sHighlightingMode[i][0] != '\0') {
- if (csH.Equal(g_sHighlightingMode[i])) {
- return (HighlightingMode)i;
- }
- i ++;
- }
- return Invert;
-}
-CPDF_ApSettings CPDF_FormControl::GetMK(FX_BOOL bCreate)
-{
- if (!m_pWidgetDict) {
- return NULL;
- }
- CPDF_ApSettings mk = m_pWidgetDict->GetDict(FX_BSTRC("MK"));
- if (!mk && bCreate) {
- mk = CPDF_Dictionary::Create();
- if (mk == NULL) {
- return NULL;
- }
- m_pWidgetDict->SetAt(FX_BSTRC("MK"), mk);
- }
- return mk;
-}
-FX_BOOL CPDF_FormControl::HasMKEntry(CFX_ByteString csEntry)
-{
- CPDF_ApSettings mk = GetMK(FALSE);
- return mk.HasMKEntry(csEntry);
-}
-int CPDF_FormControl::GetRotation()
-{
- CPDF_ApSettings mk = GetMK(FALSE);
- return mk.GetRotation();
-}
-FX_ARGB CPDF_FormControl::GetColor(int& iColorType, CFX_ByteString csEntry)
-{
- CPDF_ApSettings mk = GetMK(FALSE);
- return mk.GetColor(iColorType, csEntry);
-}
-FX_FLOAT CPDF_FormControl::GetOriginalColor(int index, CFX_ByteString csEntry)
-{
- CPDF_ApSettings mk = GetMK(FALSE);
- return mk.GetOriginalColor(index, csEntry);
-}
-void CPDF_FormControl::GetOriginalColor(int& iColorType, FX_FLOAT fc[4], CFX_ByteString csEntry)
-{
- CPDF_ApSettings mk = GetMK(FALSE);
- mk.GetOriginalColor(iColorType, fc, csEntry);
-}
-CFX_WideString CPDF_FormControl::GetCaption(CFX_ByteString csEntry)
-{
- CPDF_ApSettings mk = GetMK(FALSE);
- return mk.GetCaption(csEntry);
-}
-CPDF_Stream* CPDF_FormControl::GetIcon(CFX_ByteString csEntry)
-{
- CPDF_ApSettings mk = GetMK(FALSE);
- return mk.GetIcon(csEntry);
-}
-CPDF_IconFit CPDF_FormControl::GetIconFit()
-{
- CPDF_ApSettings mk = GetMK(FALSE);
- return mk.GetIconFit();
-}
-int CPDF_FormControl::GetTextPosition()
-{
- CPDF_ApSettings mk = GetMK(FALSE);
- return mk.GetTextPosition();
-}
-CPDF_Action CPDF_FormControl::GetAction()
-{
- if (m_pWidgetDict == NULL) {
- return NULL;
- }
- if (m_pWidgetDict->KeyExist("A")) {
- return m_pWidgetDict->GetDict("A");
- } else {
- CPDF_Object* pObj = FPDF_GetFieldAttr(m_pField->m_pDict, "A");
- if (pObj == NULL) {
- return NULL;
- }
- return pObj->GetDict();
- }
-}
-CPDF_AAction CPDF_FormControl::GetAdditionalAction()
-{
- if (m_pWidgetDict == NULL) {
- return NULL;
- }
- if (m_pWidgetDict->KeyExist("AA")) {
- return m_pWidgetDict->GetDict("AA");
- } else {
- return m_pField->GetAdditionalAction();
- }
-}
-CPDF_DefaultAppearance CPDF_FormControl::GetDefaultAppearance()
-{
- if (m_pWidgetDict == NULL) {
- return CFX_ByteString();
- }
- if (m_pWidgetDict->KeyExist("DA")) {
- return m_pWidgetDict->GetString("DA");
- } else {
- CPDF_Object* pObj = FPDF_GetFieldAttr(m_pField->m_pDict, "DA");
- if (pObj == NULL) {
- return m_pField->m_pForm->GetDefaultAppearance();
- }
- return pObj->GetString();
- }
-}
-CPDF_Font* CPDF_FormControl::GetDefaultControlFont()
-{
- CPDF_DefaultAppearance cDA = GetDefaultAppearance();
- CFX_ByteString csFontNameTag;
- FX_FLOAT fFontSize;
- cDA.GetFont(csFontNameTag, fFontSize);
- if (csFontNameTag.IsEmpty()) {
- return NULL;
- }
- CPDF_Object* pObj = FPDF_GetFieldAttr(m_pWidgetDict, "DR");
- if (pObj != NULL && pObj->GetType() == PDFOBJ_DICTIONARY) {
- CPDF_Dictionary* pFonts = ((CPDF_Dictionary*)pObj)->GetDict("Font");
- if (pFonts != NULL) {
- CPDF_Dictionary *pElement = pFonts->GetDict(csFontNameTag);
- CPDF_Font *pFont = m_pField->m_pForm->m_pDocument->LoadFont(pElement);
- if (pFont != NULL) {
- return pFont;
- }
- }
- }
- CPDF_Font *pFont = m_pField->m_pForm->GetFormFont(csFontNameTag);
- if (pFont != NULL) {
- return pFont;
- }
- CPDF_Dictionary *pPageDict = m_pWidgetDict->GetDict("P");
- pObj = FPDF_GetFieldAttr(pPageDict, "Resources");
- if (pObj != NULL && pObj->GetType() == PDFOBJ_DICTIONARY) {
- CPDF_Dictionary* pFonts = ((CPDF_Dictionary*)pObj)->GetDict("Font");
- if (pFonts != NULL) {
- CPDF_Dictionary *pElement = pFonts->GetDict(csFontNameTag);
- CPDF_Font *pFont = m_pField->m_pForm->m_pDocument->LoadFont(pElement);
- if (pFont != NULL) {
- return pFont;
- }
- }
- }
- return NULL;
-}
-int CPDF_FormControl::GetControlAlignment()
-{
- if (m_pWidgetDict == NULL) {
- return 0;
- }
- if (m_pWidgetDict->KeyExist("Q")) {
- return m_pWidgetDict->GetInteger("Q", 0);
- } else {
- CPDF_Object* pObj = FPDF_GetFieldAttr(m_pField->m_pDict, "Q");
- if (pObj == NULL) {
- return m_pField->m_pForm->GetFormAlignment();
- }
- return pObj->GetInteger();
- }
-}
-FX_BOOL CPDF_ApSettings::HasMKEntry(FX_BSTR csEntry)
-{
- if (m_pDict == NULL) {
- return FALSE;
- }
- return m_pDict->KeyExist(csEntry);
-}
-int CPDF_ApSettings::GetRotation()
-{
- if (m_pDict == NULL) {
- return 0;
- }
- return m_pDict->GetInteger(FX_BSTRC("R"));
-}
-FX_ARGB CPDF_ApSettings::GetColor(int& iColorType, FX_BSTR csEntry)
-{
- iColorType = COLORTYPE_TRANSPARENT;
- if (m_pDict == NULL) {
- return 0;
- }
- FX_ARGB color = 0;
- CPDF_Array* pEntry = m_pDict->GetArray(csEntry);
- if (pEntry == NULL) {
- return color;
- }
- FX_DWORD dwCount = pEntry->GetCount();
- if (dwCount == 1) {
- iColorType = COLORTYPE_GRAY;
- FX_FLOAT g = pEntry->GetNumber(0) * 255;
- color = ArgbEncode(255, (int)g, (int)g, (int)g);
- } else if (dwCount == 3) {
- iColorType = COLORTYPE_RGB;
- FX_FLOAT r = pEntry->GetNumber(0) * 255;
- FX_FLOAT g = pEntry->GetNumber(1) * 255;
- FX_FLOAT b = pEntry->GetNumber(2) * 255;
- color = ArgbEncode(255, (int)r, (int)g, (int)b);
- } else if (dwCount == 4) {
- iColorType = COLORTYPE_CMYK;
- FX_FLOAT c = pEntry->GetNumber(0);
- FX_FLOAT m = pEntry->GetNumber(1);
- FX_FLOAT y = pEntry->GetNumber(2);
- FX_FLOAT k = pEntry->GetNumber(3);
- FX_FLOAT r = 1.0f - FX_MIN(1.0f, c + k);
- FX_FLOAT g = 1.0f - FX_MIN(1.0f, m + k);
- FX_FLOAT b = 1.0f - FX_MIN(1.0f, y + k);
- color = ArgbEncode(255, (int)(r * 255), (int)(g * 255), (int)(b * 255));
- }
- return color;
-}
-FX_FLOAT CPDF_ApSettings::GetOriginalColor(int index, FX_BSTR csEntry)
-{
- if (m_pDict == NULL) {
- return 0;
- }
- CPDF_Array* pEntry = m_pDict->GetArray(csEntry);
- if (pEntry != NULL) {
- return pEntry->GetNumber(index);
- }
- return 0;
-}
-void CPDF_ApSettings::GetOriginalColor(int& iColorType, FX_FLOAT fc[4], FX_BSTR csEntry)
-{
- iColorType = COLORTYPE_TRANSPARENT;
- for (int i = 0; i < 4; i ++) {
- fc[i] = 0;
- }
- if (m_pDict == NULL) {
- return;
- }
- CPDF_Array* pEntry = m_pDict->GetArray(csEntry);
- if (pEntry == NULL) {
- return;
- }
- FX_DWORD dwCount = pEntry->GetCount();
- if (dwCount == 1) {
- iColorType = COLORTYPE_GRAY;
- fc[0] = pEntry->GetNumber(0);
- } else if (dwCount == 3) {
- iColorType = COLORTYPE_RGB;
- fc[0] = pEntry->GetNumber(0);
- fc[1] = pEntry->GetNumber(1);
- fc[2] = pEntry->GetNumber(2);
- } else if (dwCount == 4) {
- iColorType = COLORTYPE_CMYK;
- fc[0] = pEntry->GetNumber(0);
- fc[1] = pEntry->GetNumber(1);
- fc[2] = pEntry->GetNumber(2);
- fc[3] = pEntry->GetNumber(3);
- }
-}
-CFX_WideString CPDF_ApSettings::GetCaption(FX_BSTR csEntry)
-{
- CFX_WideString csCaption;
- if (m_pDict == NULL) {
- return csCaption;
- }
- return m_pDict->GetUnicodeText(csEntry);
-}
-CPDF_Stream* CPDF_ApSettings::GetIcon(FX_BSTR csEntry)
-{
- if (m_pDict == NULL) {
- return NULL;
- }
- return m_pDict->GetStream(csEntry);
-}
-CPDF_IconFit CPDF_ApSettings::GetIconFit()
-{
- if (m_pDict == NULL) {
- return NULL;
- }
- return m_pDict->GetDict(FX_BSTRC("IF"));
-}
-int CPDF_ApSettings::GetTextPosition()
-{
- if (m_pDict == NULL) {
- return TEXTPOS_CAPTION;
- }
- return m_pDict->GetInteger(FX_BSTRC("TP"), TEXTPOS_CAPTION);
-}
+// 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
+
+#include "../../include/fpdfdoc/fpdf_doc.h"
+CPDF_FormControl::CPDF_FormControl(CPDF_FormField* pField, CPDF_Dictionary* pWidgetDict)
+{
+ m_pField = pField;
+ m_pWidgetDict = pWidgetDict;
+ m_pForm = m_pField->m_pForm;
+}
+CFX_FloatRect CPDF_FormControl::GetRect()
+{
+ return m_pWidgetDict->GetRect("Rect");
+}
+CFX_ByteString CPDF_FormControl::GetOnStateName()
+{
+ ASSERT(GetType() == CPDF_FormField::CheckBox || GetType() == CPDF_FormField::RadioButton);
+ CFX_ByteString csOn;
+ CPDF_Dictionary* pAP = m_pWidgetDict->GetDict("AP");
+ if (pAP == NULL) {
+ return csOn;
+ }
+ CPDF_Dictionary* pN = pAP->GetDict("N");
+ if (pN == NULL) {
+ return csOn;
+ }
+ FX_POSITION pos = pN->GetStartPos();
+ while (pos) {
+ pN->GetNextElement(pos, csOn);
+ if (csOn != "Off") {
+ return csOn;
+ }
+ }
+ return CFX_ByteString();
+}
+void CPDF_FormControl::SetOnStateName(const CFX_ByteString& csOn)
+{
+ ASSERT(GetType() == CPDF_FormField::CheckBox || GetType() == CPDF_FormField::RadioButton);
+ CFX_ByteString csValue = csOn;
+ if (csValue.IsEmpty()) {
+ csValue = "Yes";
+ }
+ if (csValue == "Off") {
+ csValue = "Yes";
+ }
+ CFX_ByteString csAS = m_pWidgetDict->GetString("AS", "Off");
+ if (csAS != "Off") {
+ m_pWidgetDict->SetAtName("AS", csValue);
+ }
+ CPDF_Dictionary* pAP = m_pWidgetDict->GetDict("AP");
+ if (pAP == NULL) {
+ return;
+ }
+ FX_POSITION pos1 = pAP->GetStartPos();
+ while (pos1) {
+ CFX_ByteString csKey1;
+ CPDF_Object* pObj1 = pAP->GetNextElement(pos1, csKey1);
+ if (pObj1 == NULL) {
+ continue;
+ }
+ CPDF_Object* pObjDirect1 = pObj1->GetDirect();
+ if (pObjDirect1->GetType() != PDFOBJ_DICTIONARY) {
+ continue;
+ }
+ CPDF_Dictionary* pSubDict = (CPDF_Dictionary*)pObjDirect1;
+ FX_POSITION pos2 = pSubDict->GetStartPos();
+ while (pos2) {
+ CFX_ByteString csKey2;
+ CPDF_Object* pObj2 = pSubDict->GetNextElement(pos2, csKey2);
+ if (pObj2 == NULL) {
+ continue;
+ }
+ if (csKey2 != "Off") {
+ pSubDict->ReplaceKey(csKey2, csValue);
+ break;
+ }
+ }
+ }
+}
+CFX_ByteString CPDF_FormControl::GetCheckedAPState()
+{
+ ASSERT(GetType() == CPDF_FormField::CheckBox || GetType() == CPDF_FormField::RadioButton);
+ CFX_ByteString csOn = GetOnStateName();
+ if (GetType() == CPDF_FormField::RadioButton || GetType() == CPDF_FormField::CheckBox) {
+ CPDF_Object* pOpt = FPDF_GetFieldAttr(m_pField->m_pDict, "Opt");
+ if (pOpt != NULL && pOpt->GetType() == PDFOBJ_ARRAY) {
+ int iIndex = m_pField->GetControlIndex(this);
+ csOn.Format("%d", iIndex);
+ }
+ }
+ if (csOn.IsEmpty()) {
+ csOn = "Yes";
+ }
+ return csOn;
+}
+CFX_WideString CPDF_FormControl::GetExportValue()
+{
+ ASSERT(GetType() == CPDF_FormField::CheckBox || GetType() == CPDF_FormField::RadioButton);
+ CFX_ByteString csOn = GetOnStateName();
+ if (GetType() == CPDF_FormField::RadioButton || GetType() == CPDF_FormField::CheckBox) {
+ CPDF_Object* pOpt = FPDF_GetFieldAttr(m_pField->m_pDict, "Opt");
+ if (pOpt != NULL && pOpt->GetType() == PDFOBJ_ARRAY) {
+ int iIndex = m_pField->GetControlIndex(this);
+ csOn = ((CPDF_Array*)pOpt)->GetString(iIndex);
+ }
+ }
+ if (csOn.IsEmpty()) {
+ csOn = "Yes";
+ }
+ CFX_WideString csWOn = PDF_DecodeText(csOn);
+ return csWOn;
+}
+FX_BOOL CPDF_FormControl::IsChecked()
+{
+ ASSERT(GetType() == CPDF_FormField::CheckBox || GetType() == CPDF_FormField::RadioButton);
+ CFX_ByteString csOn = GetOnStateName();
+ CFX_ByteString csAS = m_pWidgetDict->GetString("AS");
+ return csAS == csOn;
+}
+FX_BOOL CPDF_FormControl::IsDefaultChecked()
+{
+ ASSERT(GetType() == CPDF_FormField::CheckBox || GetType() == CPDF_FormField::RadioButton);
+ CPDF_Object* pDV = FPDF_GetFieldAttr(m_pField->m_pDict, "DV");
+ if (pDV == NULL) {
+ return FALSE;
+ }
+ CFX_ByteString csDV = pDV->GetString();
+ CFX_ByteString csOn = GetOnStateName();
+ return (csDV == csOn);
+}
+void CPDF_FormControl::CheckControl(FX_BOOL bChecked)
+{
+ ASSERT(GetType() == CPDF_FormField::CheckBox || GetType() == CPDF_FormField::RadioButton);
+ CFX_ByteString csOn = GetOnStateName();
+ CFX_ByteString csOldAS = m_pWidgetDict->GetString("AS", "Off");
+ CFX_ByteString csAS = "Off";
+ if (bChecked) {
+ csAS = csOn;
+ }
+ if (csOldAS == csAS) {
+ return;
+ }
+ m_pWidgetDict->SetAtName("AS", csAS);
+ m_pForm->m_bUpdated = TRUE;
+}
+CPDF_Stream* FPDFDOC_GetAnnotAP(CPDF_Dictionary* pAnnotDict, CPDF_Annot::AppearanceMode mode);
+void CPDF_FormControl::DrawControl(CFX_RenderDevice* pDevice, CFX_AffineMatrix* pMatrix, CPDF_Page* pPage,
+ CPDF_Annot::AppearanceMode mode, const CPDF_RenderOptions* pOptions)
+{
+ if (m_pWidgetDict->GetInteger("F") & ANNOTFLAG_HIDDEN) {
+ return;
+ }
+ CPDF_Stream* pStream = FPDFDOC_GetAnnotAP(m_pWidgetDict, mode);
+ if (pStream == NULL) {
+ return;
+ }
+ CFX_FloatRect form_bbox = pStream->GetDict()->GetRect("BBox");
+ CFX_AffineMatrix form_matrix = pStream->GetDict()->GetMatrix("Matrix");
+ form_matrix.TransformRect(form_bbox);
+ CFX_FloatRect arect = m_pWidgetDict->GetRect("Rect");
+ CFX_AffineMatrix matrix;
+ matrix.MatchRect(arect, form_bbox);
+ matrix.Concat(*pMatrix);
+ CPDF_Form form(m_pField->m_pForm->m_pDocument, m_pField->m_pForm->m_pFormDict->GetDict("DR"), pStream);
+ form.ParseContent(NULL, NULL, NULL, NULL);
+ CPDF_RenderContext context;
+ context.Create(pPage);
+ context.DrawObjectList(pDevice, &form, &matrix, pOptions);
+}
+const FX_CHAR* g_sHighlightingMode[] = {"N", "I", "O", "P", "T", ""};
+CPDF_FormControl::HighlightingMode CPDF_FormControl::GetHighlightingMode()
+{
+ if (m_pWidgetDict == NULL) {
+ return Invert;
+ }
+ CFX_ByteString csH = m_pWidgetDict->GetString("H", "I");
+ int i = 0;
+ while (g_sHighlightingMode[i][0] != '\0') {
+ if (csH.Equal(g_sHighlightingMode[i])) {
+ return (HighlightingMode)i;
+ }
+ i ++;
+ }
+ return Invert;
+}
+CPDF_ApSettings CPDF_FormControl::GetMK(FX_BOOL bCreate)
+{
+ if (!m_pWidgetDict) {
+ return NULL;
+ }
+ CPDF_ApSettings mk = m_pWidgetDict->GetDict(FX_BSTRC("MK"));
+ if (!mk && bCreate) {
+ mk = CPDF_Dictionary::Create();
+ if (mk == NULL) {
+ return NULL;
+ }
+ m_pWidgetDict->SetAt(FX_BSTRC("MK"), mk);
+ }
+ return mk;
+}
+FX_BOOL CPDF_FormControl::HasMKEntry(CFX_ByteString csEntry)
+{
+ CPDF_ApSettings mk = GetMK(FALSE);
+ return mk.HasMKEntry(csEntry);
+}
+int CPDF_FormControl::GetRotation()
+{
+ CPDF_ApSettings mk = GetMK(FALSE);
+ return mk.GetRotation();
+}
+FX_ARGB CPDF_FormControl::GetColor(int& iColorType, CFX_ByteString csEntry)
+{
+ CPDF_ApSettings mk = GetMK(FALSE);
+ return mk.GetColor(iColorType, csEntry);
+}
+FX_FLOAT CPDF_FormControl::GetOriginalColor(int index, CFX_ByteString csEntry)
+{
+ CPDF_ApSettings mk = GetMK(FALSE);
+ return mk.GetOriginalColor(index, csEntry);
+}
+void CPDF_FormControl::GetOriginalColor(int& iColorType, FX_FLOAT fc[4], CFX_ByteString csEntry)
+{
+ CPDF_ApSettings mk = GetMK(FALSE);
+ mk.GetOriginalColor(iColorType, fc, csEntry);
+}
+CFX_WideString CPDF_FormControl::GetCaption(CFX_ByteString csEntry)
+{
+ CPDF_ApSettings mk = GetMK(FALSE);
+ return mk.GetCaption(csEntry);
+}
+CPDF_Stream* CPDF_FormControl::GetIcon(CFX_ByteString csEntry)
+{
+ CPDF_ApSettings mk = GetMK(FALSE);
+ return mk.GetIcon(csEntry);
+}
+CPDF_IconFit CPDF_FormControl::GetIconFit()
+{
+ CPDF_ApSettings mk = GetMK(FALSE);
+ return mk.GetIconFit();
+}
+int CPDF_FormControl::GetTextPosition()
+{
+ CPDF_ApSettings mk = GetMK(FALSE);
+ return mk.GetTextPosition();
+}
+CPDF_Action CPDF_FormControl::GetAction()
+{
+ if (m_pWidgetDict == NULL) {
+ return NULL;
+ }
+ if (m_pWidgetDict->KeyExist("A")) {
+ return m_pWidgetDict->GetDict("A");
+ } else {
+ CPDF_Object* pObj = FPDF_GetFieldAttr(m_pField->m_pDict, "A");
+ if (pObj == NULL) {
+ return NULL;
+ }
+ return pObj->GetDict();
+ }
+}
+CPDF_AAction CPDF_FormControl::GetAdditionalAction()
+{
+ if (m_pWidgetDict == NULL) {
+ return NULL;
+ }
+ if (m_pWidgetDict->KeyExist("AA")) {
+ return m_pWidgetDict->GetDict("AA");
+ } else {
+ return m_pField->GetAdditionalAction();
+ }
+}
+CPDF_DefaultAppearance CPDF_FormControl::GetDefaultAppearance()
+{
+ if (m_pWidgetDict == NULL) {
+ return CFX_ByteString();
+ }
+ if (m_pWidgetDict->KeyExist("DA")) {
+ return m_pWidgetDict->GetString("DA");
+ } else {
+ CPDF_Object* pObj = FPDF_GetFieldAttr(m_pField->m_pDict, "DA");
+ if (pObj == NULL) {
+ return m_pField->m_pForm->GetDefaultAppearance();
+ }
+ return pObj->GetString();
+ }
+}
+CPDF_Font* CPDF_FormControl::GetDefaultControlFont()
+{
+ CPDF_DefaultAppearance cDA = GetDefaultAppearance();
+ CFX_ByteString csFontNameTag;
+ FX_FLOAT fFontSize;
+ cDA.GetFont(csFontNameTag, fFontSize);
+ if (csFontNameTag.IsEmpty()) {
+ return NULL;
+ }
+ CPDF_Object* pObj = FPDF_GetFieldAttr(m_pWidgetDict, "DR");
+ if (pObj != NULL && pObj->GetType() == PDFOBJ_DICTIONARY) {
+ CPDF_Dictionary* pFonts = ((CPDF_Dictionary*)pObj)->GetDict("Font");
+ if (pFonts != NULL) {
+ CPDF_Dictionary *pElement = pFonts->GetDict(csFontNameTag);
+ CPDF_Font *pFont = m_pField->m_pForm->m_pDocument->LoadFont(pElement);
+ if (pFont != NULL) {
+ return pFont;
+ }
+ }
+ }
+ CPDF_Font *pFont = m_pField->m_pForm->GetFormFont(csFontNameTag);
+ if (pFont != NULL) {
+ return pFont;
+ }
+ CPDF_Dictionary *pPageDict = m_pWidgetDict->GetDict("P");
+ pObj = FPDF_GetFieldAttr(pPageDict, "Resources");
+ if (pObj != NULL && pObj->GetType() == PDFOBJ_DICTIONARY) {
+ CPDF_Dictionary* pFonts = ((CPDF_Dictionary*)pObj)->GetDict("Font");
+ if (pFonts != NULL) {
+ CPDF_Dictionary *pElement = pFonts->GetDict(csFontNameTag);
+ CPDF_Font *pFont = m_pField->m_pForm->m_pDocument->LoadFont(pElement);
+ if (pFont != NULL) {
+ return pFont;
+ }
+ }
+ }
+ return NULL;
+}
+int CPDF_FormControl::GetControlAlignment()
+{
+ if (m_pWidgetDict == NULL) {
+ return 0;
+ }
+ if (m_pWidgetDict->KeyExist("Q")) {
+ return m_pWidgetDict->GetInteger("Q", 0);
+ } else {
+ CPDF_Object* pObj = FPDF_GetFieldAttr(m_pField->m_pDict, "Q");
+ if (pObj == NULL) {
+ return m_pField->m_pForm->GetFormAlignment();
+ }
+ return pObj->GetInteger();
+ }
+}
+FX_BOOL CPDF_ApSettings::HasMKEntry(FX_BSTR csEntry)
+{
+ if (m_pDict == NULL) {
+ return FALSE;
+ }
+ return m_pDict->KeyExist(csEntry);
+}
+int CPDF_ApSettings::GetRotation()
+{
+ if (m_pDict == NULL) {
+ return 0;
+ }
+ return m_pDict->GetInteger(FX_BSTRC("R"));
+}
+FX_ARGB CPDF_ApSettings::GetColor(int& iColorType, FX_BSTR csEntry)
+{
+ iColorType = COLORTYPE_TRANSPARENT;
+ if (m_pDict == NULL) {
+ return 0;
+ }
+ FX_ARGB color = 0;
+ CPDF_Array* pEntry = m_pDict->GetArray(csEntry);
+ if (pEntry == NULL) {
+ return color;
+ }
+ FX_DWORD dwCount = pEntry->GetCount();
+ if (dwCount == 1) {
+ iColorType = COLORTYPE_GRAY;
+ FX_FLOAT g = pEntry->GetNumber(0) * 255;
+ color = ArgbEncode(255, (int)g, (int)g, (int)g);
+ } else if (dwCount == 3) {
+ iColorType = COLORTYPE_RGB;
+ FX_FLOAT r = pEntry->GetNumber(0) * 255;
+ FX_FLOAT g = pEntry->GetNumber(1) * 255;
+ FX_FLOAT b = pEntry->GetNumber(2) * 255;
+ color = ArgbEncode(255, (int)r, (int)g, (int)b);
+ } else if (dwCount == 4) {
+ iColorType = COLORTYPE_CMYK;
+ FX_FLOAT c = pEntry->GetNumber(0);
+ FX_FLOAT m = pEntry->GetNumber(1);
+ FX_FLOAT y = pEntry->GetNumber(2);
+ FX_FLOAT k = pEntry->GetNumber(3);
+ FX_FLOAT r = 1.0f - FX_MIN(1.0f, c + k);
+ FX_FLOAT g = 1.0f - FX_MIN(1.0f, m + k);
+ FX_FLOAT b = 1.0f - FX_MIN(1.0f, y + k);
+ color = ArgbEncode(255, (int)(r * 255), (int)(g * 255), (int)(b * 255));
+ }
+ return color;
+}
+FX_FLOAT CPDF_ApSettings::GetOriginalColor(int index, FX_BSTR csEntry)
+{
+ if (m_pDict == NULL) {
+ return 0;
+ }
+ CPDF_Array* pEntry = m_pDict->GetArray(csEntry);
+ if (pEntry != NULL) {
+ return pEntry->GetNumber(index);
+ }
+ return 0;
+}
+void CPDF_ApSettings::GetOriginalColor(int& iColorType, FX_FLOAT fc[4], FX_BSTR csEntry)
+{
+ iColorType = COLORTYPE_TRANSPARENT;
+ for (int i = 0; i < 4; i ++) {
+ fc[i] = 0;
+ }
+ if (m_pDict == NULL) {
+ return;
+ }
+ CPDF_Array* pEntry = m_pDict->GetArray(csEntry);
+ if (pEntry == NULL) {
+ return;
+ }
+ FX_DWORD dwCount = pEntry->GetCount();
+ if (dwCount == 1) {
+ iColorType = COLORTYPE_GRAY;
+ fc[0] = pEntry->GetNumber(0);
+ } else if (dwCount == 3) {
+ iColorType = COLORTYPE_RGB;
+ fc[0] = pEntry->GetNumber(0);
+ fc[1] = pEntry->GetNumber(1);
+ fc[2] = pEntry->GetNumber(2);
+ } else if (dwCount == 4) {
+ iColorType = COLORTYPE_CMYK;
+ fc[0] = pEntry->GetNumber(0);
+ fc[1] = pEntry->GetNumber(1);
+ fc[2] = pEntry->GetNumber(2);
+ fc[3] = pEntry->GetNumber(3);
+ }
+}
+CFX_WideString CPDF_ApSettings::GetCaption(FX_BSTR csEntry)
+{
+ CFX_WideString csCaption;
+ if (m_pDict == NULL) {
+ return csCaption;
+ }
+ return m_pDict->GetUnicodeText(csEntry);
+}
+CPDF_Stream* CPDF_ApSettings::GetIcon(FX_BSTR csEntry)
+{
+ if (m_pDict == NULL) {
+ return NULL;
+ }
+ return m_pDict->GetStream(csEntry);
+}
+CPDF_IconFit CPDF_ApSettings::GetIconFit()
+{
+ if (m_pDict == NULL) {
+ return NULL;
+ }
+ return m_pDict->GetDict(FX_BSTRC("IF"));
+}
+int CPDF_ApSettings::GetTextPosition()
+{
+ if (m_pDict == NULL) {
+ return TEXTPOS_CAPTION;
+ }
+ return m_pDict->GetInteger(FX_BSTRC("TP"), TEXTPOS_CAPTION);
+}
diff --git a/core/src/fpdfdoc/doc_formfield.cpp b/core/src/fpdfdoc/doc_formfield.cpp
index d84a6b14be..548448696d 100644
--- a/core/src/fpdfdoc/doc_formfield.cpp
+++ b/core/src/fpdfdoc/doc_formfield.cpp
@@ -1,1095 +1,1095 @@
-// 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
-
-#include "../../include/fpdfdoc/fpdf_doc.h"
-CFX_WideString GetFullName(CPDF_Dictionary* pFieldDict);
-void SaveCheckedFieldStatus(CPDF_FormField* pField, CFX_ByteArray& statusArray);
-FX_BOOL PDF_FormField_IsUnison(CPDF_FormField *pField)
-{
- FX_BOOL bUnison = FALSE;
- if (pField->GetType() == CPDF_FormField::CheckBox) {
- bUnison = TRUE;
- } else {
- FX_DWORD dwFlags = pField->GetFieldFlags();
- bUnison = ((dwFlags & 0x2000000) != 0);
- }
- return bUnison;
-}
-CPDF_FormField::CPDF_FormField(CPDF_InterForm* pForm, CPDF_Dictionary* pDict)
-{
- m_pDict = pDict;
- m_Type = Unknown;
- m_pForm = pForm;
- m_pFont = NULL;
- m_FontSize = 0;
- SyncFieldFlags();
-}
-CPDF_FormField::~CPDF_FormField()
-{
-}
-void CPDF_FormField::SyncFieldFlags()
-{
- CFX_ByteString type_name = FPDF_GetFieldAttr(m_pDict, "FT")->GetString();
- FX_DWORD flags = FPDF_GetFieldAttr(m_pDict, "Ff")->GetInteger();
- m_Flags = 0;
- if (flags & 1) {
- m_Flags |= FORMFIELD_READONLY;
- }
- if (flags & 2) {
- m_Flags |= FORMFIELD_REQUIRED;
- }
- if (flags & 4) {
- m_Flags |= FORMFIELD_NOEXPORT;
- }
- if (type_name == "Btn") {
- if (flags & 0x8000) {
- m_Type = RadioButton;
- if (flags & 0x4000) {
- m_Flags |= FORMRADIO_NOTOGGLEOFF;
- }
- if (flags & 0x2000000) {
- m_Flags |= FORMRADIO_UNISON;
- }
- } else if (flags & 0x10000) {
- m_Type = PushButton;
- } else {
- m_Type = CheckBox;
- }
- } else if (type_name == "Tx") {
- if (flags & 0x100000) {
- m_Type = File;
- } else if (flags & 0x2000000) {
- m_Type = RichText;
- } else {
- m_Type = Text;
- if (flags & 0x1000) {
- m_Flags |= FORMTEXT_MULTILINE;
- }
- if (flags & 0x2000) {
- m_Flags |= FORMTEXT_PASSWORD;
- }
- if (flags & 0x800000) {
- m_Flags |= FORMTEXT_NOSCROLL;
- }
- if (flags & 0x100000) {
- m_Flags |= FORMTEXT_COMB;
- }
- }
- LoadDA();
- } else if (type_name == "Ch") {
- if (flags & 0x20000) {
- m_Type = ComboBox;
- if (flags & 0x40000) {
- m_Flags |= FORMCOMBO_EDIT;
- }
- } else {
- m_Type = ListBox;
- if (flags & 0x200000) {
- m_Flags |= FORMLIST_MULTISELECT;
- }
- }
- LoadDA();
- } else if (type_name == "Sig") {
- m_Type = Sign;
- }
-}
-CFX_WideString CPDF_FormField::GetFullName()
-{
- return ::GetFullName(m_pDict);
-}
-FX_BOOL CPDF_FormField::ResetField(FX_BOOL bNotify)
-{
- switch (m_Type) {
- case CPDF_FormField::CheckBox:
- case CPDF_FormField::RadioButton: {
- CFX_ByteArray statusArray;
- if (bNotify && m_pForm->m_pFormNotify != NULL) {
- SaveCheckedFieldStatus(this, statusArray);
- }
- int iCount = CountControls();
- if (iCount) {
- if (PDF_FormField_IsUnison(this)) {
- for(int i = 0; i < iCount; i++) {
- CheckControl(i, GetControl(i)->IsDefaultChecked(), FALSE);
- }
- } else {
- for (int i = 0; i < iCount; i ++) {
- CPDF_FormControl* pControl = GetControl(i);
- FX_BOOL bChecked = pControl->IsDefaultChecked();
- CheckControl(i, bChecked, FALSE);
- }
- }
- }
- if (bNotify && m_pForm->m_pFormNotify != NULL) {
- m_pForm->m_pFormNotify->AfterCheckedStatusChange(this, statusArray);
- }
- }
- break;
- case CPDF_FormField::ComboBox: {
- CFX_WideString csValue;
- ClearSelection();
- int iIndex = GetDefaultSelectedItem();
- if (iIndex >= 0) {
- csValue = GetOptionLabel(iIndex);
- }
- if (bNotify && m_pForm->m_pFormNotify != NULL) {
- int iRet = m_pForm->m_pFormNotify->BeforeValueChange(this, csValue);
- if (iRet < 0) {
- return FALSE;
- }
- }
- SetItemSelection(iIndex, TRUE);
- if (bNotify && m_pForm->m_pFormNotify != NULL) {
- m_pForm->m_pFormNotify->AfterValueChange(this);
- }
- }
- break;
- case CPDF_FormField::ListBox: {
- CFX_WideString csValue;
- ClearSelection();
- int iIndex = GetDefaultSelectedItem();
- if (iIndex >= 0) {
- csValue = GetOptionLabel(iIndex);
- }
- if (bNotify && m_pForm->m_pFormNotify != NULL) {
- int iRet = m_pForm->m_pFormNotify->BeforeSelectionChange(this, csValue);
- if (iRet < 0) {
- return FALSE;
- }
- }
- SetItemSelection(iIndex, TRUE);
- if (bNotify && m_pForm->m_pFormNotify != NULL) {
- m_pForm->m_pFormNotify->AfterSelectionChange(this);
- }
- }
- break;
- case CPDF_FormField::Text:
- case CPDF_FormField::RichText:
- case CPDF_FormField::File:
- default: {
- CPDF_Object* pDV = FPDF_GetFieldAttr(m_pDict, "DV");
- CFX_WideString csDValue;
- if (pDV != NULL) {
- csDValue = pDV->GetUnicodeText();
- }
- CPDF_Object* pV = FPDF_GetFieldAttr(m_pDict, "V");
- CFX_WideString csValue;
- if (pV != NULL) {
- csValue = pV->GetUnicodeText();
- }
- CPDF_Object* pRV = FPDF_GetFieldAttr(m_pDict, "RV");
- if (!pRV && (csDValue == csValue)) {
- return FALSE;
- }
- if (bNotify && m_pForm->m_pFormNotify != NULL) {
- int iRet = m_pForm->m_pFormNotify->BeforeValueChange(this, csDValue);
- if (iRet < 0) {
- return FALSE;
- }
- }
- if (pDV == NULL) {
- m_pDict->RemoveAt("V");
- m_pDict->RemoveAt("RV");
- } else {
- CPDF_Object* pClone = pDV->Clone();
- if (pClone == NULL) {
- return FALSE;
- }
- m_pDict->SetAt("V", pClone);
- if(pRV) {
- CPDF_Object* pCloneR = pDV->Clone();
- m_pDict->SetAt("RV", pCloneR);
- }
- }
- if (bNotify && m_pForm->m_pFormNotify != NULL) {
- m_pForm->m_pFormNotify->AfterValueChange(this);
- }
- m_pForm->m_bUpdated = TRUE;
- }
- break;
- }
- return TRUE;
-}
-int CPDF_FormField::GetControlIndex(const CPDF_FormControl* pControl)
-{
- if (pControl == NULL) {
- return -1;
- }
- int iCount = m_ControlList.GetSize();
- for (int i = 0; i < iCount; i ++) {
- CPDF_FormControl* pFind = (CPDF_FormControl*)m_ControlList.GetAt(i);
- if (pFind == pControl) {
- return i;
- }
- }
- return -1;
-}
-int CPDF_FormField::GetFieldType()
-{
- switch (m_Type) {
- case PushButton:
- return FIELDTYPE_PUSHBUTTON;
- case CheckBox:
- return FIELDTYPE_CHECKBOX;
- case RadioButton:
- return FIELDTYPE_RADIOBUTTON;
- case ComboBox:
- return FIELDTYPE_COMBOBOX;
- case ListBox:
- return FIELDTYPE_LISTBOX;
- case Text:
- case RichText:
- case File:
- return FIELDTYPE_TEXTFIELD;
- case Sign:
- return FIELDTYPE_SIGNATURE;
- default:
- break;
- }
- return FIELDTYPE_UNKNOWN;
-}
-CPDF_AAction CPDF_FormField::GetAdditionalAction()
-{
- CPDF_Object* pObj = FPDF_GetFieldAttr(m_pDict, "AA");
- if (pObj == NULL) {
- return NULL;
- }
- return pObj->GetDict();
-}
-CFX_WideString CPDF_FormField::GetAlternateName()
-{
- CPDF_Object* pObj = FPDF_GetFieldAttr(m_pDict, "TU");
- if (pObj == NULL) {
- return L"";
- }
- return pObj->GetUnicodeText();
-}
-CFX_WideString CPDF_FormField::GetMappingName()
-{
- CPDF_Object* pObj = FPDF_GetFieldAttr(m_pDict, "TM");
- if (pObj == NULL) {
- return L"";
- }
- return pObj->GetUnicodeText();
-}
-FX_DWORD CPDF_FormField::GetFieldFlags()
-{
- CPDF_Object* pObj = FPDF_GetFieldAttr(m_pDict, "Ff");
- if (pObj == NULL) {
- return 0;
- }
- return pObj->GetInteger();
-}
-CFX_ByteString CPDF_FormField::GetDefaultStyle()
-{
- CPDF_Object* pObj = FPDF_GetFieldAttr(m_pDict, "DS");
- if (pObj == NULL) {
- return "";
- }
- return pObj->GetString();
-}
-CFX_WideString CPDF_FormField::GetRichTextString()
-{
- CPDF_Object* pObj = FPDF_GetFieldAttr(m_pDict, "RV");
- if (pObj == NULL) {
- return L"";
- }
- return pObj->GetUnicodeText();
-}
-CFX_WideString CPDF_FormField::GetValue(FX_BOOL bDefault)
-{
- if (GetType() == CheckBox || GetType() == RadioButton) {
- return GetCheckValue(bDefault);
- }
- CPDF_Object* pValue = FPDF_GetFieldAttr(m_pDict, bDefault ? "DV" : "V");
- if (pValue == NULL) {
- if (!bDefault) {
- if (m_Type == RichText) {
- pValue = FPDF_GetFieldAttr(m_pDict, "V");
- }
- if (pValue == NULL && m_Type != Text) {
- pValue = FPDF_GetFieldAttr(m_pDict, "DV");
- }
- }
- if (pValue == NULL) {
- return CFX_WideString();
- }
- }
- switch (pValue->GetType()) {
- case PDFOBJ_STRING:
- case PDFOBJ_STREAM:
- return pValue->GetUnicodeText();
- case PDFOBJ_ARRAY:
- pValue = ((CPDF_Array*)pValue)->GetElementValue(0);
- return pValue->GetUnicodeText();
- break;
- }
- return CFX_WideString();
-}
-CFX_WideString CPDF_FormField::GetValue()
-{
- return GetValue(FALSE);
-}
-CFX_WideString CPDF_FormField::GetDefaultValue()
-{
- return GetValue(TRUE);
-}
-FX_BOOL CPDF_FormField::SetValue(const CFX_WideString& value, FX_BOOL bDefault, FX_BOOL bNotify)
-{
- switch (m_Type) {
- case CheckBox:
- case RadioButton: {
- SetCheckValue(value, bDefault, bNotify);
- return TRUE;
- }
- case File:
- case RichText:
- case Text:
- case ComboBox: {
- CFX_WideString csValue = value;
- if (bNotify && m_pForm->m_pFormNotify != NULL) {
- int iRet = m_pForm->m_pFormNotify->BeforeValueChange(this, csValue);
- if (iRet < 0) {
- return FALSE;
- }
- }
- int iIndex = FindOptionValue(csValue);
- if (iIndex < 0) {
- CFX_ByteString bsEncodeText = PDF_EncodeText(csValue);
- m_pDict->SetAtString(bDefault ? "DV" : "V", bsEncodeText);
- if (m_Type == RichText && !bDefault) {
- m_pDict->SetAtString("RV", bsEncodeText);
- }
- m_pDict->RemoveAt("I");
- } else {
- m_pDict->SetAtString(bDefault ? "DV" : "V", PDF_EncodeText(csValue));
- if (bDefault) {
- } else {
- ClearSelection();
- SetItemSelection(iIndex, TRUE);
- }
- }
- if (bNotify && m_pForm->m_pFormNotify != NULL) {
- m_pForm->m_pFormNotify->AfterValueChange(this);
- }
- m_pForm->m_bUpdated = TRUE;
- }
- break;
- case ListBox: {
- int iIndex = FindOptionValue(value);
- if (iIndex < 0) {
- return FALSE;
- }
- if (bDefault && iIndex == GetDefaultSelectedItem()) {
- return FALSE;
- }
- if (bNotify && m_pForm->m_pFormNotify != NULL) {
- CFX_WideString csValue = value;
- int iRet = m_pForm->m_pFormNotify->BeforeSelectionChange(this, csValue);
- if (iRet < 0) {
- return FALSE;
- }
- }
- if (bDefault) {
- } else {
- ClearSelection();
- SetItemSelection(iIndex, TRUE);
- }
- if (bNotify && m_pForm->m_pFormNotify != NULL) {
- m_pForm->m_pFormNotify->AfterSelectionChange(this);
- }
- m_pForm->m_bUpdated = TRUE;
- break;
- }
- default:
- break;
- }
- if (CPDF_InterForm::m_bUpdateAP) {
- UpdateAP(NULL);
- }
- return TRUE;
-}
-FX_BOOL CPDF_FormField::SetValue(const CFX_WideString& value, FX_BOOL bNotify)
-{
- return SetValue(value, FALSE, bNotify);
-}
-int CPDF_FormField::GetMaxLen()
-{
- CPDF_Object* pObj = FPDF_GetFieldAttr(m_pDict, "MaxLen");
- if (pObj == NULL) {
- int iCount = m_ControlList.GetSize();
- for (int i = 0; i < iCount; i ++) {
- CPDF_FormControl* pControl = (CPDF_FormControl*)m_ControlList.GetAt(i);
- if (pControl == NULL) {
- continue;
- }
- CPDF_Dictionary* pWidgetDict = pControl->m_pWidgetDict;
- if (pWidgetDict->KeyExist("MaxLen")) {
- return pWidgetDict->GetInteger("MaxLen");
- }
- }
- return 0;
- }
- return pObj->GetInteger();
-}
-int CPDF_FormField::CountSelectedItems()
-{
- CPDF_Object* pValue = FPDF_GetFieldAttr(m_pDict, "V");
- if (pValue == NULL) {
- pValue = FPDF_GetFieldAttr(m_pDict, "I");
- if (pValue == NULL) {
- return 0;
- }
- }
- if (pValue->GetType() == PDFOBJ_STRING) {
- if (pValue->GetString().IsEmpty()) {
- return 0;
- }
- return 1;
- }
- if (pValue->GetType() == PDFOBJ_NUMBER) {
- if (pValue->GetString().IsEmpty()) {
- return 0;
- }
- return 1;
- }
- if (pValue->GetType() != PDFOBJ_ARRAY) {
- return 0;
- }
- return ((CPDF_Array*)pValue)->GetCount();
-}
-int CPDF_FormField::GetSelectedIndex(int index)
-{
- CPDF_Object* pValue = FPDF_GetFieldAttr(m_pDict, "V");
- if (pValue == NULL) {
- pValue = FPDF_GetFieldAttr(m_pDict, "I");
- if (pValue == NULL) {
- return -1;
- }
- }
- CFX_WideString sel_value;
- if (pValue->GetType() == PDFOBJ_STRING) {
- if (index != 0) {
- return -1;
- }
- sel_value = pValue->GetUnicodeText();
- } else if (pValue->GetType() == PDFOBJ_NUMBER) {
- return pValue->GetInteger();
- } else {
- if (pValue->GetType() != PDFOBJ_ARRAY) {
- return -1;
- }
- if (index < 0) {
- return -1;
- }
- sel_value = ((CPDF_Array*)pValue)->GetElementValue(index)->GetUnicodeText();
- }
- if (index < CountSelectedOptions()) {
- int iOptIndex = GetSelectedOptionIndex(index);
- CFX_WideString csOpt = GetOptionValue(iOptIndex);
- if (csOpt == sel_value) {
- return iOptIndex;
- }
- }
- int nOpts = CountOptions();
- for (int i = 0; i < nOpts; i ++) {
- if (sel_value == GetOptionValue(i)) {
- return i;
- }
- }
- return -1;
-}
-FX_BOOL CPDF_FormField::ClearSelection(FX_BOOL bNotify)
-{
- if (bNotify && m_pForm->m_pFormNotify != NULL) {
- int iRet = 0;
- CFX_WideString csValue;
- int iIndex = GetSelectedIndex(0);
- if (iIndex >= 0) {
- csValue = GetOptionLabel(iIndex);
- }
- if (GetType() == ListBox) {
- iRet = m_pForm->m_pFormNotify->BeforeSelectionChange(this, csValue);
- }
- if (GetType() == ComboBox) {
- iRet = m_pForm->m_pFormNotify->BeforeValueChange(this, csValue);
- }
- if (iRet < 0) {
- return FALSE;
- }
- }
- m_pDict->RemoveAt("V");
- m_pDict->RemoveAt("I");
- if (bNotify && m_pForm->m_pFormNotify != NULL) {
- if (GetType() == ListBox) {
- m_pForm->m_pFormNotify->AfterSelectionChange(this);
- }
- if (GetType() == ComboBox) {
- m_pForm->m_pFormNotify->AfterValueChange(this);
- }
- }
- if (CPDF_InterForm::m_bUpdateAP) {
- UpdateAP(NULL);
- }
- m_pForm->m_bUpdated = TRUE;
- return TRUE;
-}
-FX_BOOL CPDF_FormField::IsItemSelected(int index)
-{
- ASSERT(GetType() == ComboBox || GetType() == ListBox);
- if (index < 0 || index >= CountOptions()) {
- return FALSE;
- }
- if (IsOptionSelected(index)) {
- return TRUE;
- }
- CFX_WideString opt_value = GetOptionValue(index);
- CPDF_Object* pValue = FPDF_GetFieldAttr(m_pDict, "V");
- if (pValue == NULL) {
- pValue = FPDF_GetFieldAttr(m_pDict, "I");
- if (pValue == NULL) {
- return FALSE;
- }
- }
- if (pValue->GetType() == PDFOBJ_STRING) {
- if (pValue->GetUnicodeText() == opt_value) {
- return TRUE;
- }
- return FALSE;
- }
- if (pValue->GetType() == PDFOBJ_NUMBER) {
- if (pValue->GetString().IsEmpty()) {
- return FALSE;
- }
- if (pValue->GetInteger() == index) {
- return TRUE;
- }
- return FALSE;
- }
- if (pValue->GetType() != PDFOBJ_ARRAY) {
- return FALSE;
- }
- CPDF_Array* pArray = (CPDF_Array*)pValue;
- int iPos = -1;
- for (int j = 0; j < CountSelectedOptions(); j ++) {
- if (GetSelectedOptionIndex(j) == index) {
- iPos = j;
- break;
- }
- }
- for (FX_DWORD i = 0; i < pArray->GetCount(); i ++)
- if (pArray->GetElementValue(i)->GetUnicodeText() == opt_value && (int)i == iPos) {
- return TRUE;
- }
- return FALSE;
-}
-FX_BOOL CPDF_FormField::SetItemSelection(int index, FX_BOOL bSelected, FX_BOOL bNotify)
-{
- ASSERT(GetType() == ComboBox || GetType() == ListBox);
- if (index < 0 || index >= CountOptions()) {
- return FALSE;
- }
- CFX_WideString opt_value = GetOptionValue(index);
- if (bNotify && m_pForm->m_pFormNotify != NULL) {
- int iRet = 0;
- if (GetType() == ListBox) {
- iRet = m_pForm->m_pFormNotify->BeforeSelectionChange(this, opt_value);
- }
- if (GetType() == ComboBox) {
- iRet = m_pForm->m_pFormNotify->BeforeValueChange(this, opt_value);
- }
- if (iRet < 0) {
- return FALSE;
- }
- }
- if (!bSelected) {
- CPDF_Object* pValue = FPDF_GetFieldAttr(m_pDict, "V");
- if (pValue != NULL) {
- if (m_Type == ListBox) {
- SelectOption(index, FALSE);
- if (pValue->GetType() == PDFOBJ_STRING) {
- if (pValue->GetUnicodeText() == opt_value) {
- m_pDict->RemoveAt("V");
- }
- } else if (pValue->GetType() == PDFOBJ_ARRAY) {
- CPDF_Array* pArray = CPDF_Array::Create();
- if (pArray == NULL) {
- return FALSE;
- }
- int iCount = CountOptions();
- for (int i = 0; i < iCount; i ++) {
- if (i != index) {
- if (IsItemSelected(i)) {
- opt_value = GetOptionValue(i);
- pArray->AddString(PDF_EncodeText(opt_value));
- }
- }
- }
- if (pArray->GetCount() < 1) {
- pArray->Release();
- } else {
- m_pDict->SetAt("V", pArray);
- }
- }
- } else if (m_Type == ComboBox) {
- m_pDict->RemoveAt("V");
- m_pDict->RemoveAt("I");
- }
- }
- } else {
- if (m_Type == ListBox) {
- SelectOption(index, TRUE);
- if (!(m_Flags & FORMLIST_MULTISELECT)) {
- m_pDict->SetAtString("V", PDF_EncodeText(opt_value, opt_value.GetLength()));
- } else {
- CPDF_Array* pArray = CPDF_Array::Create();
- if (pArray == NULL) {
- return FALSE;
- }
- FX_BOOL bSelected;
- int iCount = CountOptions();
- for (int i = 0; i < iCount; i ++) {
- if (i != index) {
- bSelected = IsItemSelected(i);
- } else {
- bSelected = TRUE;
- }
- if (bSelected) {
- opt_value = GetOptionValue(i);
- pArray->AddString(PDF_EncodeText(opt_value));
- }
- }
- m_pDict->SetAt("V", pArray);
- }
- } else if (m_Type == ComboBox) {
- m_pDict->SetAtString("V", PDF_EncodeText(opt_value, opt_value.GetLength()));
- CPDF_Array* pI = CPDF_Array::Create();
- if (pI == NULL) {
- return FALSE;
- }
- pI->AddInteger(index);
- m_pDict->SetAt("I", pI);
- }
- }
- if (bNotify && m_pForm->m_pFormNotify != NULL) {
- if (GetType() == ListBox) {
- m_pForm->m_pFormNotify->AfterSelectionChange(this);
- }
- if (GetType() == ComboBox) {
- m_pForm->m_pFormNotify->AfterValueChange(this);
- }
- }
- if (CPDF_InterForm::m_bUpdateAP) {
- UpdateAP(NULL);
- }
- m_pForm->m_bUpdated = TRUE;
- return TRUE;
-}
-FX_BOOL CPDF_FormField::IsItemDefaultSelected(int index)
-{
- ASSERT(GetType() == ComboBox || GetType() == ListBox);
- if (index < 0 || index >= CountOptions()) {
- return FALSE;
- }
- int iDVIndex = GetDefaultSelectedItem();
- if (iDVIndex < 0) {
- return FALSE;
- }
- return (iDVIndex == index);
-}
-int CPDF_FormField::GetDefaultSelectedItem()
-{
- ASSERT(GetType() == ComboBox || GetType() == ListBox);
- CPDF_Object* pValue = FPDF_GetFieldAttr(m_pDict, "DV");
- if (pValue == NULL) {
- return -1;
- }
- CFX_WideString csDV = pValue->GetUnicodeText();
- if (csDV.IsEmpty()) {
- return -1;
- }
- int iCount = CountOptions();
- for (int i = 0; i < iCount; i ++) {
- if (csDV == GetOptionValue(i)) {
- return i;
- }
- }
- return -1;
-}
-void CPDF_FormField::UpdateAP(CPDF_FormControl* pControl)
-{
- if (m_Type == PushButton) {
- return;
- }
- if (m_Type == RadioButton || m_Type == CheckBox) {
- return;
- }
- if (!m_pForm->m_bGenerateAP) {
- return;
- }
- for (int i = 0; i < CountControls(); i ++) {
- CPDF_FormControl* pControl = GetControl(i);
- FPDF_GenerateAP(m_pForm->m_pDocument, pControl->m_pWidgetDict);
- }
-}
-int CPDF_FormField::CountOptions()
-{
- CPDF_Object* pValue = FPDF_GetFieldAttr(m_pDict, "Opt");
- if (pValue == NULL || pValue->GetType() != PDFOBJ_ARRAY) {
- return 0;
- }
- return ((CPDF_Array*)pValue)->GetCount();
-}
-CFX_WideString CPDF_FormField::GetOptionText(int index, int sub_index)
-{
- CPDF_Object* pValue = FPDF_GetFieldAttr(m_pDict, "Opt");
- if (pValue == NULL || pValue->GetType() != PDFOBJ_ARRAY) {
- return CFX_WideString();
- }
- CPDF_Object* pOption = ((CPDF_Array*)pValue)->GetElementValue(index);
- if (pOption == NULL) {
- return CFX_WideString();
- }
- if (pOption->GetType() == PDFOBJ_ARRAY) {
- pOption = ((CPDF_Array*)pOption)->GetElementValue(sub_index);
- }
- if (pOption == NULL || pOption->GetType() != PDFOBJ_STRING) {
- return CFX_WideString();
- }
- return ((CPDF_String*)pOption)->GetUnicodeText();
-}
-CFX_WideString CPDF_FormField::GetOptionLabel(int index)
-{
- return GetOptionText(index, 1);
-}
-CFX_WideString CPDF_FormField::GetOptionValue(int index)
-{
- return GetOptionText(index, 0);
-}
-int CPDF_FormField::FindOption(CFX_WideString csOptLabel)
-{
- int iCount = CountOptions();
- for (int i = 0; i < iCount; i ++) {
- CFX_WideString csValue = GetOptionValue(i);
- if (csValue == csOptLabel) {
- return i;
- }
- }
- return -1;
-}
-int CPDF_FormField::FindOptionValue(FX_LPCWSTR csOptValue, int iStartIndex)
-{
- if (iStartIndex < 0) {
- iStartIndex = 0;
- }
- int iCount = CountOptions();
- for (; iStartIndex < iCount; iStartIndex ++) {
- CFX_WideString csValue = GetOptionValue(iStartIndex);
- if (csValue == csOptValue) {
- return iStartIndex;
- }
- }
- return -1;
-}
-FX_BOOL CPDF_FormField::CheckControl(int iControlIndex, FX_BOOL bChecked, FX_BOOL bNotify)
-{
- ASSERT(GetType() == CheckBox || GetType() == RadioButton);
- CPDF_FormControl* pControl = GetControl(iControlIndex);
- if (pControl == NULL) {
- return FALSE;
- }
- if (!bChecked && pControl->IsChecked() == bChecked) {
- return FALSE;
- }
- CFX_ByteArray statusArray;
- if (bNotify && m_pForm->m_pFormNotify != NULL) {
- SaveCheckedFieldStatus(this, statusArray);
- }
- CFX_WideString csWExport = pControl->GetExportValue();
- CFX_ByteString csBExport = PDF_EncodeText(csWExport);
- int iCount = CountControls();
- FX_BOOL bUnison = PDF_FormField_IsUnison(this);
- for (int i = 0; i < iCount; i ++) {
- CPDF_FormControl* pCtrl = GetControl(i);
- if (bUnison) {
- CFX_WideString csEValue = pCtrl->GetExportValue();
- if (csEValue == csWExport) {
- if (pCtrl->GetOnStateName() == pControl->GetOnStateName()) {
- pCtrl->CheckControl(bChecked);
- } else if (bChecked) {
- pCtrl->CheckControl(FALSE);
- }
- } else if (bChecked) {
- pCtrl->CheckControl(FALSE);
- }
- } else {
- if (i == iControlIndex) {
- pCtrl->CheckControl(bChecked);
- } else if (bChecked) {
- pCtrl->CheckControl(FALSE);
- }
- }
- }
- CPDF_Object* pOpt = FPDF_GetFieldAttr(m_pDict, "Opt");
- if (pOpt == NULL || pOpt->GetType() != PDFOBJ_ARRAY) {
- if (bChecked) {
- m_pDict->SetAtName("V", csBExport);
- } else {
- CFX_ByteString csV;
- CPDF_Object* pV = FPDF_GetFieldAttr(m_pDict, "V");
- if (pV != NULL) {
- csV = pV->GetString();
- }
- if (csV == csBExport) {
- m_pDict->SetAtName("V", "Off");
- }
- }
- } else if (bChecked) {
- CFX_ByteString csIndex;
- csIndex.Format("%d", iControlIndex);
- m_pDict->SetAtName("V", csIndex);
- }
- if (bNotify && m_pForm->m_pFormNotify != NULL) {
- m_pForm->m_pFormNotify->AfterCheckedStatusChange(this, statusArray);
- }
- m_pForm->m_bUpdated = TRUE;
- return TRUE;
-}
-CFX_WideString CPDF_FormField::GetCheckValue(FX_BOOL bDefault)
-{
- ASSERT(GetType() == CheckBox || GetType() == RadioButton);
- CFX_WideString csExport = L"Off";
- FX_BOOL bChecked;
- int iCount = CountControls();
- for (int i = 0; i < iCount; i ++) {
- CPDF_FormControl* pControl = GetControl(i);
- if (bDefault) {
- bChecked = pControl->IsDefaultChecked();
- } else {
- bChecked = pControl->IsChecked();
- }
- if (bChecked) {
- csExport = pControl->GetExportValue();
- break;
- }
- }
- return csExport;
-}
-FX_BOOL CPDF_FormField::SetCheckValue(const CFX_WideString& value, FX_BOOL bDefault, FX_BOOL bNotify)
-{
- ASSERT(GetType() == CheckBox || GetType() == RadioButton);
- CFX_ByteArray statusArray;
- if (bNotify && m_pForm->m_pFormNotify != NULL) {
- SaveCheckedFieldStatus(this, statusArray);
- }
- int iCount = CountControls();
- for (int i = 0; i < iCount; i ++) {
- CPDF_FormControl* pControl = GetControl(i);
- CFX_WideString csExport = pControl->GetExportValue();
- if (csExport == value) {
- if (bDefault) {
- } else {
- CheckControl(GetControlIndex(pControl), TRUE);
- }
- break;
- } else {
- if (bDefault) {
- } else {
- CheckControl(GetControlIndex(pControl), FALSE);
- }
- }
- }
- if (bNotify && m_pForm->m_pFormNotify != NULL) {
- m_pForm->m_pFormNotify->AfterCheckedStatusChange(this, statusArray);
- }
- m_pForm->m_bUpdated = TRUE;
- return TRUE;
-}
-int CPDF_FormField::GetTopVisibleIndex()
-{
- CPDF_Object* pObj = FPDF_GetFieldAttr(m_pDict, "TI");
- if (pObj == NULL) {
- return 0;
- }
- return pObj->GetInteger();
-}
-int CPDF_FormField::CountSelectedOptions()
-{
- CPDF_Object* pObj = FPDF_GetFieldAttr(m_pDict, "I");
- if (pObj == NULL) {
- return 0;
- }
- CPDF_Array* pArray = pObj->GetArray();
- if (pArray == NULL) {
- return 0;
- }
- return (int)pArray->GetCount();
-}
-int CPDF_FormField::GetSelectedOptionIndex(int index)
-{
- CPDF_Object* pObj = FPDF_GetFieldAttr(m_pDict, "I");
- if (pObj == NULL) {
- return -1;
- }
- CPDF_Array* pArray = pObj->GetArray();
- if (pArray == NULL) {
- return -1;
- }
- int iCount = (int)pArray->GetCount();
- if (iCount > 0 && index < iCount) {
- return pArray->GetInteger(index);
- }
- return -1;
-}
-FX_BOOL CPDF_FormField::IsOptionSelected(int iOptIndex)
-{
- CPDF_Object* pObj = FPDF_GetFieldAttr(m_pDict, "I");
- if (pObj == NULL) {
- return FALSE;
- }
- CPDF_Array* pArray = pObj->GetArray();
- if (pArray == NULL) {
- return FALSE;
- }
- int iCount = (int)pArray->GetCount();
- for (int i = 0; i < iCount; i ++) {
- if (pArray->GetInteger(i) == iOptIndex) {
- return TRUE;
- }
- }
- return FALSE;
-}
-FX_BOOL CPDF_FormField::SelectOption(int iOptIndex, FX_BOOL bSelected, FX_BOOL bNotify)
-{
- CPDF_Array* pArray = m_pDict->GetArray("I");
- if (pArray == NULL) {
- if (!bSelected) {
- return TRUE;
- }
- pArray = CPDF_Array::Create();
- if (pArray == NULL) {
- return FALSE;
- }
- m_pDict->SetAt("I", pArray);
- }
- FX_BOOL bReturn = FALSE;
- for (int i = 0; i < (int)pArray->GetCount(); i ++) {
- int iFind = pArray->GetInteger(i);
- if (iFind == iOptIndex) {
- if (bSelected) {
- return TRUE;
- }
- if (bNotify && m_pForm->m_pFormNotify != NULL) {
- int iRet = 0;
- CFX_WideString csValue = GetOptionLabel(iOptIndex);
- if (GetType() == ListBox) {
- iRet = m_pForm->m_pFormNotify->BeforeSelectionChange(this, csValue);
- }
- if (GetType() == ComboBox) {
- iRet = m_pForm->m_pFormNotify->BeforeValueChange(this, csValue);
- }
- if (iRet < 0) {
- return FALSE;
- }
- }
- pArray->RemoveAt(i);
- bReturn = TRUE;
- break;
- } else if (iFind > iOptIndex) {
- if (!bSelected) {
- continue;
- }
- if (bNotify && m_pForm->m_pFormNotify != NULL) {
- int iRet = 0;
- CFX_WideString csValue = GetOptionLabel(iOptIndex);
- if (GetType() == ListBox) {
- iRet = m_pForm->m_pFormNotify->BeforeSelectionChange(this, csValue);
- }
- if (GetType() == ComboBox) {
- iRet = m_pForm->m_pFormNotify->BeforeValueChange(this, csValue);
- }
- if (iRet < 0) {
- return FALSE;
- }
- }
- CPDF_Number* pNum = CPDF_Number::Create(iOptIndex);
- if (pNum == NULL) {
- return FALSE;
- }
- pArray->InsertAt(i, pNum);
- bReturn = TRUE;
- break;
- }
- }
- if (!bReturn) {
- if (bSelected) {
- pArray->AddInteger(iOptIndex);
- }
- if (pArray->GetCount() == 0) {
- m_pDict->RemoveAt("I");
- }
- }
- if (bNotify && m_pForm->m_pFormNotify != NULL) {
- if (GetType() == ListBox) {
- m_pForm->m_pFormNotify->AfterSelectionChange(this);
- }
- if (GetType() == ComboBox) {
- m_pForm->m_pFormNotify->AfterValueChange(this);
- }
- }
- m_pForm->m_bUpdated = TRUE;
- return TRUE;
-}
-FX_BOOL CPDF_FormField::ClearSelectedOptions(FX_BOOL bNotify)
-{
- if (bNotify && m_pForm->m_pFormNotify != NULL) {
- int iRet = 0;
- CFX_WideString csValue;
- int iIndex = GetSelectedIndex(0);
- if (iIndex >= 0) {
- csValue = GetOptionLabel(iIndex);
- }
- if (GetType() == ListBox) {
- iRet = m_pForm->m_pFormNotify->BeforeSelectionChange(this, csValue);
- }
- if (GetType() == ComboBox) {
- iRet = m_pForm->m_pFormNotify->BeforeValueChange(this, csValue);
- }
- if (iRet < 0) {
- return FALSE;
- }
- }
- m_pDict->RemoveAt("I");
- if (bNotify && m_pForm->m_pFormNotify != NULL) {
- if (GetType() == ListBox) {
- m_pForm->m_pFormNotify->AfterSelectionChange(this);
- }
- if (GetType() == ComboBox) {
- m_pForm->m_pFormNotify->AfterValueChange(this);
- }
- }
- m_pForm->m_bUpdated = TRUE;
- return TRUE;
-}
-void CPDF_FormField::LoadDA()
-{
- CFX_ByteString DA = FPDF_GetFieldAttr(m_pDict, "DA")->GetString();
- if (DA.IsEmpty()) {
- DA = m_pForm->m_pFormDict->GetString("DA");
- }
- if (DA.IsEmpty()) {
- return;
- }
- CPDF_SimpleParser syntax(DA);
- syntax.FindTagParam("Tf", 2);
- CFX_ByteString font_name = syntax.GetWord();
- CPDF_Dictionary* pFontDict = m_pForm->m_pFormDict->GetDict("DR")->GetDict("Font")->GetDict(font_name);
- if (pFontDict == NULL) {
- return;
- }
- m_pFont = m_pForm->m_pDocument->LoadFont(pFontDict);
- m_FontSize = FX_atof(syntax.GetWord());
-}
+// 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
+
+#include "../../include/fpdfdoc/fpdf_doc.h"
+CFX_WideString GetFullName(CPDF_Dictionary* pFieldDict);
+void SaveCheckedFieldStatus(CPDF_FormField* pField, CFX_ByteArray& statusArray);
+FX_BOOL PDF_FormField_IsUnison(CPDF_FormField *pField)
+{
+ FX_BOOL bUnison = FALSE;
+ if (pField->GetType() == CPDF_FormField::CheckBox) {
+ bUnison = TRUE;
+ } else {
+ FX_DWORD dwFlags = pField->GetFieldFlags();
+ bUnison = ((dwFlags & 0x2000000) != 0);
+ }
+ return bUnison;
+}
+CPDF_FormField::CPDF_FormField(CPDF_InterForm* pForm, CPDF_Dictionary* pDict)
+{
+ m_pDict = pDict;
+ m_Type = Unknown;
+ m_pForm = pForm;
+ m_pFont = NULL;
+ m_FontSize = 0;
+ SyncFieldFlags();
+}
+CPDF_FormField::~CPDF_FormField()
+{
+}
+void CPDF_FormField::SyncFieldFlags()
+{
+ CFX_ByteString type_name = FPDF_GetFieldAttr(m_pDict, "FT")->GetString();
+ FX_DWORD flags = FPDF_GetFieldAttr(m_pDict, "Ff")->GetInteger();
+ m_Flags = 0;
+ if (flags & 1) {
+ m_Flags |= FORMFIELD_READONLY;
+ }
+ if (flags & 2) {
+ m_Flags |= FORMFIELD_REQUIRED;
+ }
+ if (flags & 4) {
+ m_Flags |= FORMFIELD_NOEXPORT;
+ }
+ if (type_name == "Btn") {
+ if (flags & 0x8000) {
+ m_Type = RadioButton;
+ if (flags & 0x4000) {
+ m_Flags |= FORMRADIO_NOTOGGLEOFF;
+ }
+ if (flags & 0x2000000) {
+ m_Flags |= FORMRADIO_UNISON;
+ }
+ } else if (flags & 0x10000) {
+ m_Type = PushButton;
+ } else {
+ m_Type = CheckBox;
+ }
+ } else if (type_name == "Tx") {
+ if (flags & 0x100000) {
+ m_Type = File;
+ } else if (flags & 0x2000000) {
+ m_Type = RichText;
+ } else {
+ m_Type = Text;
+ if (flags & 0x1000) {
+ m_Flags |= FORMTEXT_MULTILINE;
+ }
+ if (flags & 0x2000) {
+ m_Flags |= FORMTEXT_PASSWORD;
+ }
+ if (flags & 0x800000) {
+ m_Flags |= FORMTEXT_NOSCROLL;
+ }
+ if (flags & 0x100000) {
+ m_Flags |= FORMTEXT_COMB;
+ }
+ }
+ LoadDA();
+ } else if (type_name == "Ch") {
+ if (flags & 0x20000) {
+ m_Type = ComboBox;
+ if (flags & 0x40000) {
+ m_Flags |= FORMCOMBO_EDIT;
+ }
+ } else {
+ m_Type = ListBox;
+ if (flags & 0x200000) {
+ m_Flags |= FORMLIST_MULTISELECT;
+ }
+ }
+ LoadDA();
+ } else if (type_name == "Sig") {
+ m_Type = Sign;
+ }
+}
+CFX_WideString CPDF_FormField::GetFullName()
+{
+ return ::GetFullName(m_pDict);
+}
+FX_BOOL CPDF_FormField::ResetField(FX_BOOL bNotify)
+{
+ switch (m_Type) {
+ case CPDF_FormField::CheckBox:
+ case CPDF_FormField::RadioButton: {
+ CFX_ByteArray statusArray;
+ if (bNotify && m_pForm->m_pFormNotify != NULL) {
+ SaveCheckedFieldStatus(this, statusArray);
+ }
+ int iCount = CountControls();
+ if (iCount) {
+ if (PDF_FormField_IsUnison(this)) {
+ for(int i = 0; i < iCount; i++) {
+ CheckControl(i, GetControl(i)->IsDefaultChecked(), FALSE);
+ }
+ } else {
+ for (int i = 0; i < iCount; i ++) {
+ CPDF_FormControl* pControl = GetControl(i);
+ FX_BOOL bChecked = pControl->IsDefaultChecked();
+ CheckControl(i, bChecked, FALSE);
+ }
+ }
+ }
+ if (bNotify && m_pForm->m_pFormNotify != NULL) {
+ m_pForm->m_pFormNotify->AfterCheckedStatusChange(this, statusArray);
+ }
+ }
+ break;
+ case CPDF_FormField::ComboBox: {
+ CFX_WideString csValue;
+ ClearSelection();
+ int iIndex = GetDefaultSelectedItem();
+ if (iIndex >= 0) {
+ csValue = GetOptionLabel(iIndex);
+ }
+ if (bNotify && m_pForm->m_pFormNotify != NULL) {
+ int iRet = m_pForm->m_pFormNotify->BeforeValueChange(this, csValue);
+ if (iRet < 0) {
+ return FALSE;
+ }
+ }
+ SetItemSelection(iIndex, TRUE);
+ if (bNotify && m_pForm->m_pFormNotify != NULL) {
+ m_pForm->m_pFormNotify->AfterValueChange(this);
+ }
+ }
+ break;
+ case CPDF_FormField::ListBox: {
+ CFX_WideString csValue;
+ ClearSelection();
+ int iIndex = GetDefaultSelectedItem();
+ if (iIndex >= 0) {
+ csValue = GetOptionLabel(iIndex);
+ }
+ if (bNotify && m_pForm->m_pFormNotify != NULL) {
+ int iRet = m_pForm->m_pFormNotify->BeforeSelectionChange(this, csValue);
+ if (iRet < 0) {
+ return FALSE;
+ }
+ }
+ SetItemSelection(iIndex, TRUE);
+ if (bNotify && m_pForm->m_pFormNotify != NULL) {
+ m_pForm->m_pFormNotify->AfterSelectionChange(this);
+ }
+ }
+ break;
+ case CPDF_FormField::Text:
+ case CPDF_FormField::RichText:
+ case CPDF_FormField::File:
+ default: {
+ CPDF_Object* pDV = FPDF_GetFieldAttr(m_pDict, "DV");
+ CFX_WideString csDValue;
+ if (pDV != NULL) {
+ csDValue = pDV->GetUnicodeText();
+ }
+ CPDF_Object* pV = FPDF_GetFieldAttr(m_pDict, "V");
+ CFX_WideString csValue;
+ if (pV != NULL) {
+ csValue = pV->GetUnicodeText();
+ }
+ CPDF_Object* pRV = FPDF_GetFieldAttr(m_pDict, "RV");
+ if (!pRV && (csDValue == csValue)) {
+ return FALSE;
+ }
+ if (bNotify && m_pForm->m_pFormNotify != NULL) {
+ int iRet = m_pForm->m_pFormNotify->BeforeValueChange(this, csDValue);
+ if (iRet < 0) {
+ return FALSE;
+ }
+ }
+ if (pDV == NULL) {
+ m_pDict->RemoveAt("V");
+ m_pDict->RemoveAt("RV");
+ } else {
+ CPDF_Object* pClone = pDV->Clone();
+ if (pClone == NULL) {
+ return FALSE;
+ }
+ m_pDict->SetAt("V", pClone);
+ if(pRV) {
+ CPDF_Object* pCloneR = pDV->Clone();
+ m_pDict->SetAt("RV", pCloneR);
+ }
+ }
+ if (bNotify && m_pForm->m_pFormNotify != NULL) {
+ m_pForm->m_pFormNotify->AfterValueChange(this);
+ }
+ m_pForm->m_bUpdated = TRUE;
+ }
+ break;
+ }
+ return TRUE;
+}
+int CPDF_FormField::GetControlIndex(const CPDF_FormControl* pControl)
+{
+ if (pControl == NULL) {
+ return -1;
+ }
+ int iCount = m_ControlList.GetSize();
+ for (int i = 0; i < iCount; i ++) {
+ CPDF_FormControl* pFind = (CPDF_FormControl*)m_ControlList.GetAt(i);
+ if (pFind == pControl) {
+ return i;
+ }
+ }
+ return -1;
+}
+int CPDF_FormField::GetFieldType()
+{
+ switch (m_Type) {
+ case PushButton:
+ return FIELDTYPE_PUSHBUTTON;
+ case CheckBox:
+ return FIELDTYPE_CHECKBOX;
+ case RadioButton:
+ return FIELDTYPE_RADIOBUTTON;
+ case ComboBox:
+ return FIELDTYPE_COMBOBOX;
+ case ListBox:
+ return FIELDTYPE_LISTBOX;
+ case Text:
+ case RichText:
+ case File:
+ return FIELDTYPE_TEXTFIELD;
+ case Sign:
+ return FIELDTYPE_SIGNATURE;
+ default:
+ break;
+ }
+ return FIELDTYPE_UNKNOWN;
+}
+CPDF_AAction CPDF_FormField::GetAdditionalAction()
+{
+ CPDF_Object* pObj = FPDF_GetFieldAttr(m_pDict, "AA");
+ if (pObj == NULL) {
+ return NULL;
+ }
+ return pObj->GetDict();
+}
+CFX_WideString CPDF_FormField::GetAlternateName()
+{
+ CPDF_Object* pObj = FPDF_GetFieldAttr(m_pDict, "TU");
+ if (pObj == NULL) {
+ return L"";
+ }
+ return pObj->GetUnicodeText();
+}
+CFX_WideString CPDF_FormField::GetMappingName()
+{
+ CPDF_Object* pObj = FPDF_GetFieldAttr(m_pDict, "TM");
+ if (pObj == NULL) {
+ return L"";
+ }
+ return pObj->GetUnicodeText();
+}
+FX_DWORD CPDF_FormField::GetFieldFlags()
+{
+ CPDF_Object* pObj = FPDF_GetFieldAttr(m_pDict, "Ff");
+ if (pObj == NULL) {
+ return 0;
+ }
+ return pObj->GetInteger();
+}
+CFX_ByteString CPDF_FormField::GetDefaultStyle()
+{
+ CPDF_Object* pObj = FPDF_GetFieldAttr(m_pDict, "DS");
+ if (pObj == NULL) {
+ return "";
+ }
+ return pObj->GetString();
+}
+CFX_WideString CPDF_FormField::GetRichTextString()
+{
+ CPDF_Object* pObj = FPDF_GetFieldAttr(m_pDict, "RV");
+ if (pObj == NULL) {
+ return L"";
+ }
+ return pObj->GetUnicodeText();
+}
+CFX_WideString CPDF_FormField::GetValue(FX_BOOL bDefault)
+{
+ if (GetType() == CheckBox || GetType() == RadioButton) {
+ return GetCheckValue(bDefault);
+ }
+ CPDF_Object* pValue = FPDF_GetFieldAttr(m_pDict, bDefault ? "DV" : "V");
+ if (pValue == NULL) {
+ if (!bDefault) {
+ if (m_Type == RichText) {
+ pValue = FPDF_GetFieldAttr(m_pDict, "V");
+ }
+ if (pValue == NULL && m_Type != Text) {
+ pValue = FPDF_GetFieldAttr(m_pDict, "DV");
+ }
+ }
+ if (pValue == NULL) {
+ return CFX_WideString();
+ }
+ }
+ switch (pValue->GetType()) {
+ case PDFOBJ_STRING:
+ case PDFOBJ_STREAM:
+ return pValue->GetUnicodeText();
+ case PDFOBJ_ARRAY:
+ pValue = ((CPDF_Array*)pValue)->GetElementValue(0);
+ return pValue->GetUnicodeText();
+ break;
+ }
+ return CFX_WideString();
+}
+CFX_WideString CPDF_FormField::GetValue()
+{
+ return GetValue(FALSE);
+}
+CFX_WideString CPDF_FormField::GetDefaultValue()
+{
+ return GetValue(TRUE);
+}
+FX_BOOL CPDF_FormField::SetValue(const CFX_WideString& value, FX_BOOL bDefault, FX_BOOL bNotify)
+{
+ switch (m_Type) {
+ case CheckBox:
+ case RadioButton: {
+ SetCheckValue(value, bDefault, bNotify);
+ return TRUE;
+ }
+ case File:
+ case RichText:
+ case Text:
+ case ComboBox: {
+ CFX_WideString csValue = value;
+ if (bNotify && m_pForm->m_pFormNotify != NULL) {
+ int iRet = m_pForm->m_pFormNotify->BeforeValueChange(this, csValue);
+ if (iRet < 0) {
+ return FALSE;
+ }
+ }
+ int iIndex = FindOptionValue(csValue);
+ if (iIndex < 0) {
+ CFX_ByteString bsEncodeText = PDF_EncodeText(csValue);
+ m_pDict->SetAtString(bDefault ? "DV" : "V", bsEncodeText);
+ if (m_Type == RichText && !bDefault) {
+ m_pDict->SetAtString("RV", bsEncodeText);
+ }
+ m_pDict->RemoveAt("I");
+ } else {
+ m_pDict->SetAtString(bDefault ? "DV" : "V", PDF_EncodeText(csValue));
+ if (bDefault) {
+ } else {
+ ClearSelection();
+ SetItemSelection(iIndex, TRUE);
+ }
+ }
+ if (bNotify && m_pForm->m_pFormNotify != NULL) {
+ m_pForm->m_pFormNotify->AfterValueChange(this);
+ }
+ m_pForm->m_bUpdated = TRUE;
+ }
+ break;
+ case ListBox: {
+ int iIndex = FindOptionValue(value);
+ if (iIndex < 0) {
+ return FALSE;
+ }
+ if (bDefault && iIndex == GetDefaultSelectedItem()) {
+ return FALSE;
+ }
+ if (bNotify && m_pForm->m_pFormNotify != NULL) {
+ CFX_WideString csValue = value;
+ int iRet = m_pForm->m_pFormNotify->BeforeSelectionChange(this, csValue);
+ if (iRet < 0) {
+ return FALSE;
+ }
+ }
+ if (bDefault) {
+ } else {
+ ClearSelection();
+ SetItemSelection(iIndex, TRUE);
+ }
+ if (bNotify && m_pForm->m_pFormNotify != NULL) {
+ m_pForm->m_pFormNotify->AfterSelectionChange(this);
+ }
+ m_pForm->m_bUpdated = TRUE;
+ break;
+ }
+ default:
+ break;
+ }
+ if (CPDF_InterForm::m_bUpdateAP) {
+ UpdateAP(NULL);
+ }
+ return TRUE;
+}
+FX_BOOL CPDF_FormField::SetValue(const CFX_WideString& value, FX_BOOL bNotify)
+{
+ return SetValue(value, FALSE, bNotify);
+}
+int CPDF_FormField::GetMaxLen()
+{
+ CPDF_Object* pObj = FPDF_GetFieldAttr(m_pDict, "MaxLen");
+ if (pObj == NULL) {
+ int iCount = m_ControlList.GetSize();
+ for (int i = 0; i < iCount; i ++) {
+ CPDF_FormControl* pControl = (CPDF_FormControl*)m_ControlList.GetAt(i);
+ if (pControl == NULL) {
+ continue;
+ }
+ CPDF_Dictionary* pWidgetDict = pControl->m_pWidgetDict;
+ if (pWidgetDict->KeyExist("MaxLen")) {
+ return pWidgetDict->GetInteger("MaxLen");
+ }
+ }
+ return 0;
+ }
+ return pObj->GetInteger();
+}
+int CPDF_FormField::CountSelectedItems()
+{
+ CPDF_Object* pValue = FPDF_GetFieldAttr(m_pDict, "V");
+ if (pValue == NULL) {
+ pValue = FPDF_GetFieldAttr(m_pDict, "I");
+ if (pValue == NULL) {
+ return 0;
+ }
+ }
+ if (pValue->GetType() == PDFOBJ_STRING) {
+ if (pValue->GetString().IsEmpty()) {
+ return 0;
+ }
+ return 1;
+ }
+ if (pValue->GetType() == PDFOBJ_NUMBER) {
+ if (pValue->GetString().IsEmpty()) {
+ return 0;
+ }
+ return 1;
+ }
+ if (pValue->GetType() != PDFOBJ_ARRAY) {
+ return 0;
+ }
+ return ((CPDF_Array*)pValue)->GetCount();
+}
+int CPDF_FormField::GetSelectedIndex(int index)
+{
+ CPDF_Object* pValue = FPDF_GetFieldAttr(m_pDict, "V");
+ if (pValue == NULL) {
+ pValue = FPDF_GetFieldAttr(m_pDict, "I");
+ if (pValue == NULL) {
+ return -1;
+ }
+ }
+ CFX_WideString sel_value;
+ if (pValue->GetType() == PDFOBJ_STRING) {
+ if (index != 0) {
+ return -1;
+ }
+ sel_value = pValue->GetUnicodeText();
+ } else if (pValue->GetType() == PDFOBJ_NUMBER) {
+ return pValue->GetInteger();
+ } else {
+ if (pValue->GetType() != PDFOBJ_ARRAY) {
+ return -1;
+ }
+ if (index < 0) {
+ return -1;
+ }
+ sel_value = ((CPDF_Array*)pValue)->GetElementValue(index)->GetUnicodeText();
+ }
+ if (index < CountSelectedOptions()) {
+ int iOptIndex = GetSelectedOptionIndex(index);
+ CFX_WideString csOpt = GetOptionValue(iOptIndex);
+ if (csOpt == sel_value) {
+ return iOptIndex;
+ }
+ }
+ int nOpts = CountOptions();
+ for (int i = 0; i < nOpts; i ++) {
+ if (sel_value == GetOptionValue(i)) {
+ return i;
+ }
+ }
+ return -1;
+}
+FX_BOOL CPDF_FormField::ClearSelection(FX_BOOL bNotify)
+{
+ if (bNotify && m_pForm->m_pFormNotify != NULL) {
+ int iRet = 0;
+ CFX_WideString csValue;
+ int iIndex = GetSelectedIndex(0);
+ if (iIndex >= 0) {
+ csValue = GetOptionLabel(iIndex);
+ }
+ if (GetType() == ListBox) {
+ iRet = m_pForm->m_pFormNotify->BeforeSelectionChange(this, csValue);
+ }
+ if (GetType() == ComboBox) {
+ iRet = m_pForm->m_pFormNotify->BeforeValueChange(this, csValue);
+ }
+ if (iRet < 0) {
+ return FALSE;
+ }
+ }
+ m_pDict->RemoveAt("V");
+ m_pDict->RemoveAt("I");
+ if (bNotify && m_pForm->m_pFormNotify != NULL) {
+ if (GetType() == ListBox) {
+ m_pForm->m_pFormNotify->AfterSelectionChange(this);
+ }
+ if (GetType() == ComboBox) {
+ m_pForm->m_pFormNotify->AfterValueChange(this);
+ }
+ }
+ if (CPDF_InterForm::m_bUpdateAP) {
+ UpdateAP(NULL);
+ }
+ m_pForm->m_bUpdated = TRUE;
+ return TRUE;
+}
+FX_BOOL CPDF_FormField::IsItemSelected(int index)
+{
+ ASSERT(GetType() == ComboBox || GetType() == ListBox);
+ if (index < 0 || index >= CountOptions()) {
+ return FALSE;
+ }
+ if (IsOptionSelected(index)) {
+ return TRUE;
+ }
+ CFX_WideString opt_value = GetOptionValue(index);
+ CPDF_Object* pValue = FPDF_GetFieldAttr(m_pDict, "V");
+ if (pValue == NULL) {
+ pValue = FPDF_GetFieldAttr(m_pDict, "I");
+ if (pValue == NULL) {
+ return FALSE;
+ }
+ }
+ if (pValue->GetType() == PDFOBJ_STRING) {
+ if (pValue->GetUnicodeText() == opt_value) {
+ return TRUE;
+ }
+ return FALSE;
+ }
+ if (pValue->GetType() == PDFOBJ_NUMBER) {
+ if (pValue->GetString().IsEmpty()) {
+ return FALSE;
+ }
+ if (pValue->GetInteger() == index) {
+ return TRUE;
+ }
+ return FALSE;
+ }
+ if (pValue->GetType() != PDFOBJ_ARRAY) {
+ return FALSE;
+ }
+ CPDF_Array* pArray = (CPDF_Array*)pValue;
+ int iPos = -1;
+ for (int j = 0; j < CountSelectedOptions(); j ++) {
+ if (GetSelectedOptionIndex(j) == index) {
+ iPos = j;
+ break;
+ }
+ }
+ for (FX_DWORD i = 0; i < pArray->GetCount(); i ++)
+ if (pArray->GetElementValue(i)->GetUnicodeText() == opt_value && (int)i == iPos) {
+ return TRUE;
+ }
+ return FALSE;
+}
+FX_BOOL CPDF_FormField::SetItemSelection(int index, FX_BOOL bSelected, FX_BOOL bNotify)
+{
+ ASSERT(GetType() == ComboBox || GetType() == ListBox);
+ if (index < 0 || index >= CountOptions()) {
+ return FALSE;
+ }
+ CFX_WideString opt_value = GetOptionValue(index);
+ if (bNotify && m_pForm->m_pFormNotify != NULL) {
+ int iRet = 0;
+ if (GetType() == ListBox) {
+ iRet = m_pForm->m_pFormNotify->BeforeSelectionChange(this, opt_value);
+ }
+ if (GetType() == ComboBox) {
+ iRet = m_pForm->m_pFormNotify->BeforeValueChange(this, opt_value);
+ }
+ if (iRet < 0) {
+ return FALSE;
+ }
+ }
+ if (!bSelected) {
+ CPDF_Object* pValue = FPDF_GetFieldAttr(m_pDict, "V");
+ if (pValue != NULL) {
+ if (m_Type == ListBox) {
+ SelectOption(index, FALSE);
+ if (pValue->GetType() == PDFOBJ_STRING) {
+ if (pValue->GetUnicodeText() == opt_value) {
+ m_pDict->RemoveAt("V");
+ }
+ } else if (pValue->GetType() == PDFOBJ_ARRAY) {
+ CPDF_Array* pArray = CPDF_Array::Create();
+ if (pArray == NULL) {
+ return FALSE;
+ }
+ int iCount = CountOptions();
+ for (int i = 0; i < iCount; i ++) {
+ if (i != index) {
+ if (IsItemSelected(i)) {
+ opt_value = GetOptionValue(i);
+ pArray->AddString(PDF_EncodeText(opt_value));
+ }
+ }
+ }
+ if (pArray->GetCount() < 1) {
+ pArray->Release();
+ } else {
+ m_pDict->SetAt("V", pArray);
+ }
+ }
+ } else if (m_Type == ComboBox) {
+ m_pDict->RemoveAt("V");
+ m_pDict->RemoveAt("I");
+ }
+ }
+ } else {
+ if (m_Type == ListBox) {
+ SelectOption(index, TRUE);
+ if (!(m_Flags & FORMLIST_MULTISELECT)) {
+ m_pDict->SetAtString("V", PDF_EncodeText(opt_value, opt_value.GetLength()));
+ } else {
+ CPDF_Array* pArray = CPDF_Array::Create();
+ if (pArray == NULL) {
+ return FALSE;
+ }
+ FX_BOOL bSelected;
+ int iCount = CountOptions();
+ for (int i = 0; i < iCount; i ++) {
+ if (i != index) {
+ bSelected = IsItemSelected(i);
+ } else {
+ bSelected = TRUE;
+ }
+ if (bSelected) {
+ opt_value = GetOptionValue(i);
+ pArray->AddString(PDF_EncodeText(opt_value));
+ }
+ }
+ m_pDict->SetAt("V", pArray);
+ }
+ } else if (m_Type == ComboBox) {
+ m_pDict->SetAtString("V", PDF_EncodeText(opt_value, opt_value.GetLength()));
+ CPDF_Array* pI = CPDF_Array::Create();
+ if (pI == NULL) {
+ return FALSE;
+ }
+ pI->AddInteger(index);
+ m_pDict->SetAt("I", pI);
+ }
+ }
+ if (bNotify && m_pForm->m_pFormNotify != NULL) {
+ if (GetType() == ListBox) {
+ m_pForm->m_pFormNotify->AfterSelectionChange(this);
+ }
+ if (GetType() == ComboBox) {
+ m_pForm->m_pFormNotify->AfterValueChange(this);
+ }
+ }
+ if (CPDF_InterForm::m_bUpdateAP) {
+ UpdateAP(NULL);
+ }
+ m_pForm->m_bUpdated = TRUE;
+ return TRUE;
+}
+FX_BOOL CPDF_FormField::IsItemDefaultSelected(int index)
+{
+ ASSERT(GetType() == ComboBox || GetType() == ListBox);
+ if (index < 0 || index >= CountOptions()) {
+ return FALSE;
+ }
+ int iDVIndex = GetDefaultSelectedItem();
+ if (iDVIndex < 0) {
+ return FALSE;
+ }
+ return (iDVIndex == index);
+}
+int CPDF_FormField::GetDefaultSelectedItem()
+{
+ ASSERT(GetType() == ComboBox || GetType() == ListBox);
+ CPDF_Object* pValue = FPDF_GetFieldAttr(m_pDict, "DV");
+ if (pValue == NULL) {
+ return -1;
+ }
+ CFX_WideString csDV = pValue->GetUnicodeText();
+ if (csDV.IsEmpty()) {
+ return -1;
+ }
+ int iCount = CountOptions();
+ for (int i = 0; i < iCount; i ++) {
+ if (csDV == GetOptionValue(i)) {
+ return i;
+ }
+ }
+ return -1;
+}
+void CPDF_FormField::UpdateAP(CPDF_FormControl* pControl)
+{
+ if (m_Type == PushButton) {
+ return;
+ }
+ if (m_Type == RadioButton || m_Type == CheckBox) {
+ return;
+ }
+ if (!m_pForm->m_bGenerateAP) {
+ return;
+ }
+ for (int i = 0; i < CountControls(); i ++) {
+ CPDF_FormControl* pControl = GetControl(i);
+ FPDF_GenerateAP(m_pForm->m_pDocument, pControl->m_pWidgetDict);
+ }
+}
+int CPDF_FormField::CountOptions()
+{
+ CPDF_Object* pValue = FPDF_GetFieldAttr(m_pDict, "Opt");
+ if (pValue == NULL || pValue->GetType() != PDFOBJ_ARRAY) {
+ return 0;
+ }
+ return ((CPDF_Array*)pValue)->GetCount();
+}
+CFX_WideString CPDF_FormField::GetOptionText(int index, int sub_index)
+{
+ CPDF_Object* pValue = FPDF_GetFieldAttr(m_pDict, "Opt");
+ if (pValue == NULL || pValue->GetType() != PDFOBJ_ARRAY) {
+ return CFX_WideString();
+ }
+ CPDF_Object* pOption = ((CPDF_Array*)pValue)->GetElementValue(index);
+ if (pOption == NULL) {
+ return CFX_WideString();
+ }
+ if (pOption->GetType() == PDFOBJ_ARRAY) {
+ pOption = ((CPDF_Array*)pOption)->GetElementValue(sub_index);
+ }
+ if (pOption == NULL || pOption->GetType() != PDFOBJ_STRING) {
+ return CFX_WideString();
+ }
+ return ((CPDF_String*)pOption)->GetUnicodeText();
+}
+CFX_WideString CPDF_FormField::GetOptionLabel(int index)
+{
+ return GetOptionText(index, 1);
+}
+CFX_WideString CPDF_FormField::GetOptionValue(int index)
+{
+ return GetOptionText(index, 0);
+}
+int CPDF_FormField::FindOption(CFX_WideString csOptLabel)
+{
+ int iCount = CountOptions();
+ for (int i = 0; i < iCount; i ++) {
+ CFX_WideString csValue = GetOptionValue(i);
+ if (csValue == csOptLabel) {
+ return i;
+ }
+ }
+ return -1;
+}
+int CPDF_FormField::FindOptionValue(FX_LPCWSTR csOptValue, int iStartIndex)
+{
+ if (iStartIndex < 0) {
+ iStartIndex = 0;
+ }
+ int iCount = CountOptions();
+ for (; iStartIndex < iCount; iStartIndex ++) {
+ CFX_WideString csValue = GetOptionValue(iStartIndex);
+ if (csValue == csOptValue) {
+ return iStartIndex;
+ }
+ }
+ return -1;
+}
+FX_BOOL CPDF_FormField::CheckControl(int iControlIndex, FX_BOOL bChecked, FX_BOOL bNotify)
+{
+ ASSERT(GetType() == CheckBox || GetType() == RadioButton);
+ CPDF_FormControl* pControl = GetControl(iControlIndex);
+ if (pControl == NULL) {
+ return FALSE;
+ }
+ if (!bChecked && pControl->IsChecked() == bChecked) {
+ return FALSE;
+ }
+ CFX_ByteArray statusArray;
+ if (bNotify && m_pForm->m_pFormNotify != NULL) {
+ SaveCheckedFieldStatus(this, statusArray);
+ }
+ CFX_WideString csWExport = pControl->GetExportValue();
+ CFX_ByteString csBExport = PDF_EncodeText(csWExport);
+ int iCount = CountControls();
+ FX_BOOL bUnison = PDF_FormField_IsUnison(this);
+ for (int i = 0; i < iCount; i ++) {
+ CPDF_FormControl* pCtrl = GetControl(i);
+ if (bUnison) {
+ CFX_WideString csEValue = pCtrl->GetExportValue();
+ if (csEValue == csWExport) {
+ if (pCtrl->GetOnStateName() == pControl->GetOnStateName()) {
+ pCtrl->CheckControl(bChecked);
+ } else if (bChecked) {
+ pCtrl->CheckControl(FALSE);
+ }
+ } else if (bChecked) {
+ pCtrl->CheckControl(FALSE);
+ }
+ } else {
+ if (i == iControlIndex) {
+ pCtrl->CheckControl(bChecked);
+ } else if (bChecked) {
+ pCtrl->CheckControl(FALSE);
+ }
+ }
+ }
+ CPDF_Object* pOpt = FPDF_GetFieldAttr(m_pDict, "Opt");
+ if (pOpt == NULL || pOpt->GetType() != PDFOBJ_ARRAY) {
+ if (bChecked) {
+ m_pDict->SetAtName("V", csBExport);
+ } else {
+ CFX_ByteString csV;
+ CPDF_Object* pV = FPDF_GetFieldAttr(m_pDict, "V");
+ if (pV != NULL) {
+ csV = pV->GetString();
+ }
+ if (csV == csBExport) {
+ m_pDict->SetAtName("V", "Off");
+ }
+ }
+ } else if (bChecked) {
+ CFX_ByteString csIndex;
+ csIndex.Format("%d", iControlIndex);
+ m_pDict->SetAtName("V", csIndex);
+ }
+ if (bNotify && m_pForm->m_pFormNotify != NULL) {
+ m_pForm->m_pFormNotify->AfterCheckedStatusChange(this, statusArray);
+ }
+ m_pForm->m_bUpdated = TRUE;
+ return TRUE;
+}
+CFX_WideString CPDF_FormField::GetCheckValue(FX_BOOL bDefault)
+{
+ ASSERT(GetType() == CheckBox || GetType() == RadioButton);
+ CFX_WideString csExport = L"Off";
+ FX_BOOL bChecked;
+ int iCount = CountControls();
+ for (int i = 0; i < iCount; i ++) {
+ CPDF_FormControl* pControl = GetControl(i);
+ if (bDefault) {
+ bChecked = pControl->IsDefaultChecked();
+ } else {
+ bChecked = pControl->IsChecked();
+ }
+ if (bChecked) {
+ csExport = pControl->GetExportValue();
+ break;
+ }
+ }
+ return csExport;
+}
+FX_BOOL CPDF_FormField::SetCheckValue(const CFX_WideString& value, FX_BOOL bDefault, FX_BOOL bNotify)
+{
+ ASSERT(GetType() == CheckBox || GetType() == RadioButton);
+ CFX_ByteArray statusArray;
+ if (bNotify && m_pForm->m_pFormNotify != NULL) {
+ SaveCheckedFieldStatus(this, statusArray);
+ }
+ int iCount = CountControls();
+ for (int i = 0; i < iCount; i ++) {
+ CPDF_FormControl* pControl = GetControl(i);
+ CFX_WideString csExport = pControl->GetExportValue();
+ if (csExport == value) {
+ if (bDefault) {
+ } else {
+ CheckControl(GetControlIndex(pControl), TRUE);
+ }
+ break;
+ } else {
+ if (bDefault) {
+ } else {
+ CheckControl(GetControlIndex(pControl), FALSE);
+ }
+ }
+ }
+ if (bNotify && m_pForm->m_pFormNotify != NULL) {
+ m_pForm->m_pFormNotify->AfterCheckedStatusChange(this, statusArray);
+ }
+ m_pForm->m_bUpdated = TRUE;
+ return TRUE;
+}
+int CPDF_FormField::GetTopVisibleIndex()
+{
+ CPDF_Object* pObj = FPDF_GetFieldAttr(m_pDict, "TI");
+ if (pObj == NULL) {
+ return 0;
+ }
+ return pObj->GetInteger();
+}
+int CPDF_FormField::CountSelectedOptions()
+{
+ CPDF_Object* pObj = FPDF_GetFieldAttr(m_pDict, "I");
+ if (pObj == NULL) {
+ return 0;
+ }
+ CPDF_Array* pArray = pObj->GetArray();
+ if (pArray == NULL) {
+ return 0;
+ }
+ return (int)pArray->GetCount();
+}
+int CPDF_FormField::GetSelectedOptionIndex(int index)
+{
+ CPDF_Object* pObj = FPDF_GetFieldAttr(m_pDict, "I");
+ if (pObj == NULL) {
+ return -1;
+ }
+ CPDF_Array* pArray = pObj->GetArray();
+ if (pArray == NULL) {
+ return -1;
+ }
+ int iCount = (int)pArray->GetCount();
+ if (iCount > 0 && index < iCount) {
+ return pArray->GetInteger(index);
+ }
+ return -1;
+}
+FX_BOOL CPDF_FormField::IsOptionSelected(int iOptIndex)
+{
+ CPDF_Object* pObj = FPDF_GetFieldAttr(m_pDict, "I");
+ if (pObj == NULL) {
+ return FALSE;
+ }
+ CPDF_Array* pArray = pObj->GetArray();
+ if (pArray == NULL) {
+ return FALSE;
+ }
+ int iCount = (int)pArray->GetCount();
+ for (int i = 0; i < iCount; i ++) {
+ if (pArray->GetInteger(i) == iOptIndex) {
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+FX_BOOL CPDF_FormField::SelectOption(int iOptIndex, FX_BOOL bSelected, FX_BOOL bNotify)
+{
+ CPDF_Array* pArray = m_pDict->GetArray("I");
+ if (pArray == NULL) {
+ if (!bSelected) {
+ return TRUE;
+ }
+ pArray = CPDF_Array::Create();
+ if (pArray == NULL) {
+ return FALSE;
+ }
+ m_pDict->SetAt("I", pArray);
+ }
+ FX_BOOL bReturn = FALSE;
+ for (int i = 0; i < (int)pArray->GetCount(); i ++) {
+ int iFind = pArray->GetInteger(i);
+ if (iFind == iOptIndex) {
+ if (bSelected) {
+ return TRUE;
+ }
+ if (bNotify && m_pForm->m_pFormNotify != NULL) {
+ int iRet = 0;
+ CFX_WideString csValue = GetOptionLabel(iOptIndex);
+ if (GetType() == ListBox) {
+ iRet = m_pForm->m_pFormNotify->BeforeSelectionChange(this, csValue);
+ }
+ if (GetType() == ComboBox) {
+ iRet = m_pForm->m_pFormNotify->BeforeValueChange(this, csValue);
+ }
+ if (iRet < 0) {
+ return FALSE;
+ }
+ }
+ pArray->RemoveAt(i);
+ bReturn = TRUE;
+ break;
+ } else if (iFind > iOptIndex) {
+ if (!bSelected) {
+ continue;
+ }
+ if (bNotify && m_pForm->m_pFormNotify != NULL) {
+ int iRet = 0;
+ CFX_WideString csValue = GetOptionLabel(iOptIndex);
+ if (GetType() == ListBox) {
+ iRet = m_pForm->m_pFormNotify->BeforeSelectionChange(this, csValue);
+ }
+ if (GetType() == ComboBox) {
+ iRet = m_pForm->m_pFormNotify->BeforeValueChange(this, csValue);
+ }
+ if (iRet < 0) {
+ return FALSE;
+ }
+ }
+ CPDF_Number* pNum = CPDF_Number::Create(iOptIndex);
+ if (pNum == NULL) {
+ return FALSE;
+ }
+ pArray->InsertAt(i, pNum);
+ bReturn = TRUE;
+ break;
+ }
+ }
+ if (!bReturn) {
+ if (bSelected) {
+ pArray->AddInteger(iOptIndex);
+ }
+ if (pArray->GetCount() == 0) {
+ m_pDict->RemoveAt("I");
+ }
+ }
+ if (bNotify && m_pForm->m_pFormNotify != NULL) {
+ if (GetType() == ListBox) {
+ m_pForm->m_pFormNotify->AfterSelectionChange(this);
+ }
+ if (GetType() == ComboBox) {
+ m_pForm->m_pFormNotify->AfterValueChange(this);
+ }
+ }
+ m_pForm->m_bUpdated = TRUE;
+ return TRUE;
+}
+FX_BOOL CPDF_FormField::ClearSelectedOptions(FX_BOOL bNotify)
+{
+ if (bNotify && m_pForm->m_pFormNotify != NULL) {
+ int iRet = 0;
+ CFX_WideString csValue;
+ int iIndex = GetSelectedIndex(0);
+ if (iIndex >= 0) {
+ csValue = GetOptionLabel(iIndex);
+ }
+ if (GetType() == ListBox) {
+ iRet = m_pForm->m_pFormNotify->BeforeSelectionChange(this, csValue);
+ }
+ if (GetType() == ComboBox) {
+ iRet = m_pForm->m_pFormNotify->BeforeValueChange(this, csValue);
+ }
+ if (iRet < 0) {
+ return FALSE;
+ }
+ }
+ m_pDict->RemoveAt("I");
+ if (bNotify && m_pForm->m_pFormNotify != NULL) {
+ if (GetType() == ListBox) {
+ m_pForm->m_pFormNotify->AfterSelectionChange(this);
+ }
+ if (GetType() == ComboBox) {
+ m_pForm->m_pFormNotify->AfterValueChange(this);
+ }
+ }
+ m_pForm->m_bUpdated = TRUE;
+ return TRUE;
+}
+void CPDF_FormField::LoadDA()
+{
+ CFX_ByteString DA = FPDF_GetFieldAttr(m_pDict, "DA")->GetString();
+ if (DA.IsEmpty()) {
+ DA = m_pForm->m_pFormDict->GetString("DA");
+ }
+ if (DA.IsEmpty()) {
+ return;
+ }
+ CPDF_SimpleParser syntax(DA);
+ syntax.FindTagParam("Tf", 2);
+ CFX_ByteString font_name = syntax.GetWord();
+ CPDF_Dictionary* pFontDict = m_pForm->m_pFormDict->GetDict("DR")->GetDict("Font")->GetDict(font_name);
+ if (pFontDict == NULL) {
+ return;
+ }
+ m_pFont = m_pForm->m_pDocument->LoadFont(pFontDict);
+ m_FontSize = FX_atof(syntax.GetWord());
+}
diff --git a/core/src/fpdfdoc/doc_link.cpp b/core/src/fpdfdoc/doc_link.cpp
index 4c8fda7a34..0d1b98e7b7 100644
--- a/core/src/fpdfdoc/doc_link.cpp
+++ b/core/src/fpdfdoc/doc_link.cpp
@@ -1,105 +1,105 @@
-// 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
-
-#include "../../include/fpdfdoc/fpdf_doc.h"
-CPDF_LinkList::~CPDF_LinkList()
-{
- FX_POSITION pos = m_PageMap.GetStartPosition();
- while (pos) {
- FX_LPVOID key, value;
- m_PageMap.GetNextAssoc(pos, key, value);
- delete (CFX_PtrArray*)value;
- }
-}
-CFX_PtrArray* CPDF_LinkList::GetPageLinks(CPDF_Page* pPage)
-{
- FX_DWORD objnum = pPage->m_pFormDict->GetObjNum();
- if (objnum == 0) {
- return NULL;
- }
- CFX_PtrArray* pPageLinkList = NULL;
- if (!m_PageMap.Lookup((FX_LPVOID)(FX_UINTPTR)objnum, (FX_LPVOID&)pPageLinkList)) {
- pPageLinkList = FX_NEW CFX_PtrArray;
- if (pPageLinkList == NULL) {
- return NULL;
- }
- m_PageMap.SetAt((FX_LPVOID)(FX_UINTPTR)objnum, pPageLinkList);
- LoadPageLinks(pPage, pPageLinkList);
- }
- return pPageLinkList;
-}
-int CPDF_LinkList::CountLinks(CPDF_Page* pPage)
-{
- CFX_PtrArray* pPageLinkList = GetPageLinks(pPage);
- if (pPageLinkList == NULL) {
- return 0;
- }
- return pPageLinkList->GetSize();
-}
-CPDF_Link CPDF_LinkList::GetLink(CPDF_Page* pPage, int index)
-{
- CFX_PtrArray* pPageLinkList = GetPageLinks(pPage);
- if (pPageLinkList == NULL) {
- return NULL;
- }
- return (CPDF_Dictionary*)pPageLinkList->GetAt(index);
-}
-CPDF_Link CPDF_LinkList::GetLinkAtPoint(CPDF_Page* pPage, FX_FLOAT pdf_x, FX_FLOAT pdf_y)
-{
- CFX_PtrArray* pPageLinkList = GetPageLinks(pPage);
- if (pPageLinkList == NULL) {
- return NULL;
- }
- int size = pPageLinkList->GetSize();
- for (int i = 0; i < size; i ++) {
- CPDF_Link Link = (CPDF_Dictionary*)pPageLinkList->GetAt(i);
- CPDF_Rect rect = Link.GetRect();
- if (rect.Contains(pdf_x, pdf_y)) {
- return Link;
- }
- }
- return NULL;
-}
-void CPDF_LinkList::LoadPageLinks(CPDF_Page* pPage, CFX_PtrArray* pList)
-{
- CPDF_Array* pAnnotList = pPage->m_pFormDict->GetArray("Annots");
- if (pAnnotList == NULL) {
- return;
- }
- for (FX_DWORD i = 0; i < pAnnotList->GetCount(); i ++) {
- CPDF_Dictionary* pAnnot = pAnnotList->GetDict(i);
- if (pAnnot == NULL) {
- continue;
- }
- if (pAnnot->GetString("Subtype") != "Link") {
- continue;
- }
- pList->Add(pAnnot);
- }
-}
-CPDF_Rect CPDF_Link::GetRect()
-{
- return m_pDict->GetRect("Rect");
-}
-CPDF_Dest CPDF_Link::GetDest(CPDF_Document* pDoc)
-{
- CPDF_Object* pDest = m_pDict->GetElementValue("Dest");
- if (pDest == NULL) {
- return NULL;
- }
- if (pDest->GetType() == PDFOBJ_STRING || pDest->GetType() == PDFOBJ_NAME) {
- CPDF_NameTree name_tree(pDoc, FX_BSTRC("Dests"));
- CFX_ByteStringC name = pDest->GetString();
- return name_tree.LookupNamedDest(pDoc, name);
- } else if (pDest->GetType() == PDFOBJ_ARRAY) {
- return (CPDF_Array*)pDest;
- }
- return NULL;
-}
-CPDF_Action CPDF_Link::GetAction()
-{
- return m_pDict->GetDict("A");
-}
+// 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
+
+#include "../../include/fpdfdoc/fpdf_doc.h"
+CPDF_LinkList::~CPDF_LinkList()
+{
+ FX_POSITION pos = m_PageMap.GetStartPosition();
+ while (pos) {
+ FX_LPVOID key, value;
+ m_PageMap.GetNextAssoc(pos, key, value);
+ delete (CFX_PtrArray*)value;
+ }
+}
+CFX_PtrArray* CPDF_LinkList::GetPageLinks(CPDF_Page* pPage)
+{
+ FX_DWORD objnum = pPage->m_pFormDict->GetObjNum();
+ if (objnum == 0) {
+ return NULL;
+ }
+ CFX_PtrArray* pPageLinkList = NULL;
+ if (!m_PageMap.Lookup((FX_LPVOID)(FX_UINTPTR)objnum, (FX_LPVOID&)pPageLinkList)) {
+ pPageLinkList = FX_NEW CFX_PtrArray;
+ if (pPageLinkList == NULL) {
+ return NULL;
+ }
+ m_PageMap.SetAt((FX_LPVOID)(FX_UINTPTR)objnum, pPageLinkList);
+ LoadPageLinks(pPage, pPageLinkList);
+ }
+ return pPageLinkList;
+}
+int CPDF_LinkList::CountLinks(CPDF_Page* pPage)
+{
+ CFX_PtrArray* pPageLinkList = GetPageLinks(pPage);
+ if (pPageLinkList == NULL) {
+ return 0;
+ }
+ return pPageLinkList->GetSize();
+}
+CPDF_Link CPDF_LinkList::GetLink(CPDF_Page* pPage, int index)
+{
+ CFX_PtrArray* pPageLinkList = GetPageLinks(pPage);
+ if (pPageLinkList == NULL) {
+ return NULL;
+ }
+ return (CPDF_Dictionary*)pPageLinkList->GetAt(index);
+}
+CPDF_Link CPDF_LinkList::GetLinkAtPoint(CPDF_Page* pPage, FX_FLOAT pdf_x, FX_FLOAT pdf_y)
+{
+ CFX_PtrArray* pPageLinkList = GetPageLinks(pPage);
+ if (pPageLinkList == NULL) {
+ return NULL;
+ }
+ int size = pPageLinkList->GetSize();
+ for (int i = 0; i < size; i ++) {
+ CPDF_Link Link = (CPDF_Dictionary*)pPageLinkList->GetAt(i);
+ CPDF_Rect rect = Link.GetRect();
+ if (rect.Contains(pdf_x, pdf_y)) {
+ return Link;
+ }
+ }
+ return NULL;
+}
+void CPDF_LinkList::LoadPageLinks(CPDF_Page* pPage, CFX_PtrArray* pList)
+{
+ CPDF_Array* pAnnotList = pPage->m_pFormDict->GetArray("Annots");
+ if (pAnnotList == NULL) {
+ return;
+ }
+ for (FX_DWORD i = 0; i < pAnnotList->GetCount(); i ++) {
+ CPDF_Dictionary* pAnnot = pAnnotList->GetDict(i);
+ if (pAnnot == NULL) {
+ continue;
+ }
+ if (pAnnot->GetString("Subtype") != "Link") {
+ continue;
+ }
+ pList->Add(pAnnot);
+ }
+}
+CPDF_Rect CPDF_Link::GetRect()
+{
+ return m_pDict->GetRect("Rect");
+}
+CPDF_Dest CPDF_Link::GetDest(CPDF_Document* pDoc)
+{
+ CPDF_Object* pDest = m_pDict->GetElementValue("Dest");
+ if (pDest == NULL) {
+ return NULL;
+ }
+ if (pDest->GetType() == PDFOBJ_STRING || pDest->GetType() == PDFOBJ_NAME) {
+ CPDF_NameTree name_tree(pDoc, FX_BSTRC("Dests"));
+ CFX_ByteStringC name = pDest->GetString();
+ return name_tree.LookupNamedDest(pDoc, name);
+ } else if (pDest->GetType() == PDFOBJ_ARRAY) {
+ return (CPDF_Array*)pDest;
+ }
+ return NULL;
+}
+CPDF_Action CPDF_Link::GetAction()
+{
+ return m_pDict->GetDict("A");
+}
diff --git a/core/src/fpdfdoc/doc_metadata.cpp b/core/src/fpdfdoc/doc_metadata.cpp
index e3ac9e3779..8c00157990 100644
--- a/core/src/fpdfdoc/doc_metadata.cpp
+++ b/core/src/fpdfdoc/doc_metadata.cpp
@@ -1,152 +1,152 @@
-// 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
-
-#include "../../include/fpdfdoc/fpdf_doc.h"
-#include "../../include/fxcrt/fx_xml.h"
-typedef struct _PDFDOC_METADATA {
- CPDF_Document *m_pDoc;
- CXML_Element *m_pXmlElmnt;
- CXML_Element *m_pElmntRdf;
- CFX_CMapByteStringToPtr *m_pStringMap;
-} PDFDOC_METADATA, * PDFDOC_LPMETADATA;
-typedef PDFDOC_METADATA const * PDFDOC_LPCMETADATA;
-const FX_LPCSTR gs_FPDFDOC_Metadata_Titles[] = {
- "Title", "title",
- "Subject", "description",
- "Author", "creator",
- "Keywords", "Keywords",
- "Producer", "Producer",
- "Creator", "CreatorTool",
- "CreationDate", "CreateDate",
- "ModDate", "ModifyDate",
- "MetadataDate", "MetadataDate"
-};
-CPDF_Metadata::CPDF_Metadata()
-{
- m_pData = FX_Alloc(PDFDOC_METADATA, 1);
- FXSYS_memset32(m_pData, 0, sizeof(PDFDOC_METADATA));
- CFX_CMapByteStringToPtr *&pStringMap = ((PDFDOC_LPMETADATA)m_pData)->m_pStringMap;
- pStringMap = FX_NEW(CFX_CMapByteStringToPtr);
- if (pStringMap != NULL) {
- CFX_ByteString bstr;
- for (int i = 0; i < 18; i += 2) {
- bstr = gs_FPDFDOC_Metadata_Titles[i];
- pStringMap->AddValue(bstr, (void*)gs_FPDFDOC_Metadata_Titles[i + 1]);
- }
- }
-}
-CPDF_Metadata::~CPDF_Metadata()
-{
- FXSYS_assert(m_pData != NULL);
- CXML_Element *&p = ((PDFDOC_LPMETADATA)m_pData)->m_pXmlElmnt;
- if (p) {
- delete p;
- }
- CFX_CMapByteStringToPtr *pStringMap = ((PDFDOC_LPMETADATA)m_pData)->m_pStringMap;
- if (pStringMap) {
- pStringMap->RemoveAll();
- FX_Free(pStringMap);
- }
- FX_Free(m_pData);
-}
-void CPDF_Metadata::LoadDoc(CPDF_Document *pDoc)
-{
- FXSYS_assert(pDoc != NULL);
- ((PDFDOC_LPMETADATA)m_pData)->m_pDoc = pDoc;
- CPDF_Dictionary *pRoot = pDoc->GetRoot();
- CPDF_Stream *pStream = pRoot->GetStream(FX_BSTRC("Metadata"));
- if (!pStream) {
- return;
- }
- CPDF_StreamAcc acc;
- acc.LoadAllData(pStream, FALSE);
- int size = acc.GetSize();
- FX_LPCBYTE pBuf = acc.GetData();
- CXML_Element *&pXmlElmnt = ((PDFDOC_LPMETADATA)m_pData)->m_pXmlElmnt;
- pXmlElmnt = CXML_Element::Parse(pBuf, size);
- if (!pXmlElmnt) {
- return;
- }
- CXML_Element *&pElmntRdf = ((PDFDOC_LPMETADATA)m_pData)->m_pElmntRdf;
- if (pXmlElmnt->GetTagName() == FX_BSTRC("RDF")) {
- pElmntRdf = pXmlElmnt;
- } else {
- pElmntRdf = pXmlElmnt->GetElement(NULL, FX_BSTRC("RDF"));
- }
-}
-FX_INT32 CPDF_Metadata::GetString(FX_BSTR bsItem, CFX_WideString &wsStr)
-{
- if (!((PDFDOC_LPMETADATA)m_pData)->m_pXmlElmnt) {
- return -1;
- }
- if (!((PDFDOC_LPMETADATA)m_pData)->m_pStringMap) {
- return -1;
- }
- void *szTag;
- if (!((PDFDOC_LPMETADATA)m_pData)->m_pStringMap->Lookup(bsItem, szTag)) {
- return -1;
- }
- CFX_ByteString bsTag = (FX_LPCSTR)szTag;
- wsStr = L"";
- CXML_Element *pElmntRdf = ((PDFDOC_LPMETADATA)m_pData)->m_pElmntRdf;
- if (!pElmntRdf) {
- return -1;
- }
- int nChild = pElmntRdf->CountChildren();
- for (int i = 0; i < nChild; i++) {
- CXML_Element *pTag = pElmntRdf->GetElement(NULL, FX_BSTRC("Description"), i);
- if (!pTag) {
- continue;
- }
- if (bsItem == FX_BSTRC("Title") || bsItem == FX_BSTRC("Subject")) {
- CXML_Element *pElmnt = pTag->GetElement(NULL, bsTag);
- if (!pElmnt) {
- continue;
- }
- pElmnt = pElmnt->GetElement(NULL, FX_BSTRC("Alt"));
- if (!pElmnt) {
- continue;
- }
- pElmnt = pElmnt->GetElement(NULL, FX_BSTRC("li"));
- if (!pElmnt) {
- continue;
- }
- wsStr = pElmnt->GetContent(0);
- return wsStr.GetLength();
- } else if (bsItem == FX_BSTRC("Author")) {
- CXML_Element *pElmnt = pTag->GetElement(NULL, bsTag);
- if (!pElmnt) {
- continue;
- }
- pElmnt = pElmnt->GetElement(NULL, FX_BSTRC("Seq"));
- if (!pElmnt) {
- continue;
- }
- pElmnt = pElmnt->GetElement(NULL, FX_BSTRC("li"));
- if (!pElmnt) {
- continue;
- }
- wsStr = pElmnt->GetContent(0);
- return wsStr.GetLength();
- } else {
- CXML_Element *pElmnt = pTag->GetElement(NULL, bsTag);
- if (!pElmnt) {
- continue;
- }
- wsStr = pElmnt->GetContent(0);
- return wsStr.GetLength();
- }
- }
- return -1;
-}
-CXML_Element* CPDF_Metadata::GetRoot() const
-{
- return ((PDFDOC_LPMETADATA)m_pData)->m_pXmlElmnt;
-}
-CXML_Element* CPDF_Metadata::GetRDF() const
-{
- return ((PDFDOC_LPMETADATA)m_pData)->m_pElmntRdf;
-}
+// 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
+
+#include "../../include/fpdfdoc/fpdf_doc.h"
+#include "../../include/fxcrt/fx_xml.h"
+typedef struct _PDFDOC_METADATA {
+ CPDF_Document *m_pDoc;
+ CXML_Element *m_pXmlElmnt;
+ CXML_Element *m_pElmntRdf;
+ CFX_CMapByteStringToPtr *m_pStringMap;
+} PDFDOC_METADATA, * PDFDOC_LPMETADATA;
+typedef PDFDOC_METADATA const * PDFDOC_LPCMETADATA;
+const FX_LPCSTR gs_FPDFDOC_Metadata_Titles[] = {
+ "Title", "title",
+ "Subject", "description",
+ "Author", "creator",
+ "Keywords", "Keywords",
+ "Producer", "Producer",
+ "Creator", "CreatorTool",
+ "CreationDate", "CreateDate",
+ "ModDate", "ModifyDate",
+ "MetadataDate", "MetadataDate"
+};
+CPDF_Metadata::CPDF_Metadata()
+{
+ m_pData = FX_Alloc(PDFDOC_METADATA, 1);
+ FXSYS_memset32(m_pData, 0, sizeof(PDFDOC_METADATA));
+ CFX_CMapByteStringToPtr *&pStringMap = ((PDFDOC_LPMETADATA)m_pData)->m_pStringMap;
+ pStringMap = FX_NEW(CFX_CMapByteStringToPtr);
+ if (pStringMap != NULL) {
+ CFX_ByteString bstr;
+ for (int i = 0; i < 18; i += 2) {
+ bstr = gs_FPDFDOC_Metadata_Titles[i];
+ pStringMap->AddValue(bstr, (void*)gs_FPDFDOC_Metadata_Titles[i + 1]);
+ }
+ }
+}
+CPDF_Metadata::~CPDF_Metadata()
+{
+ FXSYS_assert(m_pData != NULL);
+ CXML_Element *&p = ((PDFDOC_LPMETADATA)m_pData)->m_pXmlElmnt;
+ if (p) {
+ delete p;
+ }
+ CFX_CMapByteStringToPtr *pStringMap = ((PDFDOC_LPMETADATA)m_pData)->m_pStringMap;
+ if (pStringMap) {
+ pStringMap->RemoveAll();
+ FX_Free(pStringMap);
+ }
+ FX_Free(m_pData);
+}
+void CPDF_Metadata::LoadDoc(CPDF_Document *pDoc)
+{
+ FXSYS_assert(pDoc != NULL);
+ ((PDFDOC_LPMETADATA)m_pData)->m_pDoc = pDoc;
+ CPDF_Dictionary *pRoot = pDoc->GetRoot();
+ CPDF_Stream *pStream = pRoot->GetStream(FX_BSTRC("Metadata"));
+ if (!pStream) {
+ return;
+ }
+ CPDF_StreamAcc acc;
+ acc.LoadAllData(pStream, FALSE);
+ int size = acc.GetSize();
+ FX_LPCBYTE pBuf = acc.GetData();
+ CXML_Element *&pXmlElmnt = ((PDFDOC_LPMETADATA)m_pData)->m_pXmlElmnt;
+ pXmlElmnt = CXML_Element::Parse(pBuf, size);
+ if (!pXmlElmnt) {
+ return;
+ }
+ CXML_Element *&pElmntRdf = ((PDFDOC_LPMETADATA)m_pData)->m_pElmntRdf;
+ if (pXmlElmnt->GetTagName() == FX_BSTRC("RDF")) {
+ pElmntRdf = pXmlElmnt;
+ } else {
+ pElmntRdf = pXmlElmnt->GetElement(NULL, FX_BSTRC("RDF"));
+ }
+}
+FX_INT32 CPDF_Metadata::GetString(FX_BSTR bsItem, CFX_WideString &wsStr)
+{
+ if (!((PDFDOC_LPMETADATA)m_pData)->m_pXmlElmnt) {
+ return -1;
+ }
+ if (!((PDFDOC_LPMETADATA)m_pData)->m_pStringMap) {
+ return -1;
+ }
+ void *szTag;
+ if (!((PDFDOC_LPMETADATA)m_pData)->m_pStringMap->Lookup(bsItem, szTag)) {
+ return -1;
+ }
+ CFX_ByteString bsTag = (FX_LPCSTR)szTag;
+ wsStr = L"";
+ CXML_Element *pElmntRdf = ((PDFDOC_LPMETADATA)m_pData)->m_pElmntRdf;
+ if (!pElmntRdf) {
+ return -1;
+ }
+ int nChild = pElmntRdf->CountChildren();
+ for (int i = 0; i < nChild; i++) {
+ CXML_Element *pTag = pElmntRdf->GetElement(NULL, FX_BSTRC("Description"), i);
+ if (!pTag) {
+ continue;
+ }
+ if (bsItem == FX_BSTRC("Title") || bsItem == FX_BSTRC("Subject")) {
+ CXML_Element *pElmnt = pTag->GetElement(NULL, bsTag);
+ if (!pElmnt) {
+ continue;
+ }
+ pElmnt = pElmnt->GetElement(NULL, FX_BSTRC("Alt"));
+ if (!pElmnt) {
+ continue;
+ }
+ pElmnt = pElmnt->GetElement(NULL, FX_BSTRC("li"));
+ if (!pElmnt) {
+ continue;
+ }
+ wsStr = pElmnt->GetContent(0);
+ return wsStr.GetLength();
+ } else if (bsItem == FX_BSTRC("Author")) {
+ CXML_Element *pElmnt = pTag->GetElement(NULL, bsTag);
+ if (!pElmnt) {
+ continue;
+ }
+ pElmnt = pElmnt->GetElement(NULL, FX_BSTRC("Seq"));
+ if (!pElmnt) {
+ continue;
+ }
+ pElmnt = pElmnt->GetElement(NULL, FX_BSTRC("li"));
+ if (!pElmnt) {
+ continue;
+ }
+ wsStr = pElmnt->GetContent(0);
+ return wsStr.GetLength();
+ } else {
+ CXML_Element *pElmnt = pTag->GetElement(NULL, bsTag);
+ if (!pElmnt) {
+ continue;
+ }
+ wsStr = pElmnt->GetContent(0);
+ return wsStr.GetLength();
+ }
+ }
+ return -1;
+}
+CXML_Element* CPDF_Metadata::GetRoot() const
+{
+ return ((PDFDOC_LPMETADATA)m_pData)->m_pXmlElmnt;
+}
+CXML_Element* CPDF_Metadata::GetRDF() const
+{
+ return ((PDFDOC_LPMETADATA)m_pData)->m_pElmntRdf;
+}
diff --git a/core/src/fpdfdoc/doc_ocg.cpp b/core/src/fpdfdoc/doc_ocg.cpp
index 39b8e37521..0ca9fc0313 100644
--- a/core/src/fpdfdoc/doc_ocg.cpp
+++ b/core/src/fpdfdoc/doc_ocg.cpp
@@ -1,300 +1,300 @@
-// 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
-
-#include "../../include/fpdfdoc/fpdf_doc.h"
-static FX_INT32 FPDFDOC_OCG_FindGroup(const CPDF_Object *pObject, const CPDF_Dictionary *pGroupDict)
-{
- if (pObject == NULL || pGroupDict == NULL) {
- return -1;
- }
- FX_INT32 iType = pObject->GetType();
- if (iType == PDFOBJ_ARRAY) {
- FX_DWORD dwCount = ((CPDF_Array*)pObject)->GetCount();
- for (FX_DWORD i = 0; i < dwCount; i++) {
- if (((CPDF_Array*)pObject)->GetDict(i) == pGroupDict) {
- return i;
- }
- }
- return -1;
- }
- if (pObject->GetDict() == pGroupDict) {
- return 0;
- }
- return -1;
-}
-static FX_BOOL FPDFDOC_OCG_HasIntent(const CPDF_Dictionary *pDict, FX_BSTR csElement, FX_BSTR csDef = FX_BSTRC(""))
-{
- FXSYS_assert(pDict != NULL);
- CPDF_Object *pIntent = pDict->GetElementValue(FX_BSTRC("Intent"));
- if (pIntent == NULL) {
- return csElement == csDef;
- }
- CFX_ByteString bsIntent;
- if (pIntent->GetType() == PDFOBJ_ARRAY) {
- FX_DWORD dwCount = ((CPDF_Array*)pIntent)->GetCount();
- for (FX_DWORD i = 0; i < dwCount; i++) {
- bsIntent = ((CPDF_Array*)pIntent)->GetString(i);
- if (bsIntent == FX_BSTRC("All") || bsIntent == csElement) {
- return TRUE;
- }
- }
- return FALSE;
- }
- bsIntent = pIntent->GetString();
- return bsIntent == FX_BSTRC("All") || bsIntent == csElement;
-}
-static CPDF_Dictionary* FPDFDOC_OCG_GetConfig(CPDF_Document *pDoc, const CPDF_Dictionary *pOCGDict, FX_BSTR bsState)
-{
- FXSYS_assert(pDoc && pOCGDict);
- CPDF_Dictionary *pOCProperties = pDoc->GetRoot()->GetDict(FX_BSTRC("OCProperties"));
- if (!pOCProperties) {
- return NULL;
- }
- CPDF_Array *pOCGs = pOCProperties->GetArray(FX_BSTRC("OCGs"));
- if (!pOCGs) {
- return NULL;
- }
- if (FPDFDOC_OCG_FindGroup(pOCGs, pOCGDict) < 0) {
- return NULL;
- }
- CPDF_Dictionary *pConfig = pOCProperties->GetDict(FX_BSTRC("D"));
- CPDF_Array *pConfigs = pOCProperties->GetArray(FX_BSTRC("Configs"));
- if (pConfigs) {
- CPDF_Dictionary *pFind;
- FX_INT32 iCount = pConfigs->GetCount();
- for (FX_INT32 i = 0; i < iCount; i ++) {
- pFind = pConfigs->GetDict(i);
- if (!pFind) {
- continue;
- }
- if (!FPDFDOC_OCG_HasIntent(pFind, FX_BSTRC("View"), FX_BSTRC("View"))) {
- continue;
- }
- pConfig = pFind;
- break;
- }
- }
- return pConfig;
-}
-static CFX_ByteString FPDFDOC_OCG_GetUsageTypeString(CPDF_OCContext::UsageType eType)
-{
- CFX_ByteString csState = FX_BSTRC("View");
- if (eType == CPDF_OCContext::Design) {
- csState = FX_BSTRC("Design");
- } else if (eType == CPDF_OCContext::Print) {
- csState = FX_BSTRC("Print");
- } else if (eType == CPDF_OCContext::Export) {
- csState = FX_BSTRC("Export");
- }
- return csState;
-}
-CPDF_OCContext::CPDF_OCContext(CPDF_Document *pDoc, UsageType eUsageType)
-{
- FXSYS_assert(pDoc != NULL);
- m_pDocument = pDoc;
- m_eUsageType = eUsageType;
-}
-CPDF_OCContext::~CPDF_OCContext()
-{
- m_OCGStates.RemoveAll();
-}
-FX_BOOL CPDF_OCContext::LoadOCGStateFromConfig(FX_BSTR csConfig, const CPDF_Dictionary *pOCGDict, FX_BOOL &bValidConfig) const
-{
- CPDF_Dictionary *pConfig = FPDFDOC_OCG_GetConfig(m_pDocument, pOCGDict, csConfig);
- if (!pConfig) {
- return TRUE;
- }
- bValidConfig = TRUE;
- FX_BOOL bState = pConfig->GetString(FX_BSTRC("BaseState"), FX_BSTRC("ON")) != FX_BSTRC("OFF");
- CPDF_Array *pArray = pConfig->GetArray(FX_BSTRC("ON"));
- if (pArray) {
- if (FPDFDOC_OCG_FindGroup(pArray, pOCGDict) >= 0) {
- bState = TRUE;
- }
- }
- pArray = pConfig->GetArray(FX_BSTRC("OFF"));
- if (pArray) {
- if (FPDFDOC_OCG_FindGroup(pArray, pOCGDict) >= 0) {
- bState = FALSE;
- }
- }
- pArray = pConfig->GetArray(FX_BSTRC("AS"));
- if (pArray) {
- CFX_ByteString csFind = csConfig + FX_BSTRC("State");
- FX_INT32 iCount = pArray->GetCount();
- for (FX_INT32 i = 0; i < iCount; i ++) {
- CPDF_Dictionary *pUsage = pArray->GetDict(i);
- if (!pUsage) {
- continue;
- }
- if (pUsage->GetString(FX_BSTRC("Event"), FX_BSTRC("View")) != csConfig) {
- continue;
- }
- CPDF_Array *pOCGs = pUsage->GetArray(FX_BSTRC("OCGs"));
- if (!pOCGs) {
- continue;
- }
- if (FPDFDOC_OCG_FindGroup(pOCGs, pOCGDict) < 0) {
- continue;
- }
- CPDF_Dictionary *pState = pUsage->GetDict(csConfig);
- if (!pState) {
- continue;
- }
- bState = pState->GetString(csFind) != FX_BSTRC("OFF");
- }
- }
- return bState;
-}
-FX_BOOL CPDF_OCContext::LoadOCGState(const CPDF_Dictionary *pOCGDict) const
-{
- if (!FPDFDOC_OCG_HasIntent(pOCGDict, FX_BSTRC("View"), FX_BSTRC("View"))) {
- return TRUE;
- }
- CFX_ByteString csState = FPDFDOC_OCG_GetUsageTypeString(m_eUsageType);
- CPDF_Dictionary *pUsage = pOCGDict->GetDict(FX_BSTRC("Usage"));
- if (pUsage) {
- CPDF_Dictionary *pState = pUsage->GetDict(csState);
- if (pState) {
- CFX_ByteString csFind = csState + FX_BSTRC("State");
- if (pState->KeyExist(csFind)) {
- return pState->GetString(csFind) != FX_BSTRC("OFF");
- }
- }
- if (csState != FX_BSTRC("View")) {
- pState = pUsage->GetDict(FX_BSTRC("View"));
- if (pState && pState->KeyExist(FX_BSTRC("ViewState"))) {
- return pState->GetString(FX_BSTRC("ViewState")) != FX_BSTRC("OFF");
- }
- }
- }
- FX_BOOL bDefValid = FALSE;
- return LoadOCGStateFromConfig(csState, pOCGDict, bDefValid);
-}
-FX_BOOL CPDF_OCContext::GetOCGVisible(const CPDF_Dictionary *pOCGDict)
-{
- if (!pOCGDict) {
- return FALSE;
- }
- FX_LPVOID bState = NULL;
- if (m_OCGStates.Lookup(pOCGDict, bState)) {
- return (FX_UINTPTR)bState != 0;
- }
- bState = (FX_LPVOID)(FX_UINTPTR)LoadOCGState(pOCGDict);
- m_OCGStates.SetAt(pOCGDict, bState);
- return (FX_UINTPTR)bState != 0;
-}
-FX_BOOL CPDF_OCContext::GetOCGVE(CPDF_Array *pExpression, FX_BOOL bFromConfig, int nLevel)
-{
- if (nLevel > 32) {
- return FALSE;
- }
- if (pExpression == NULL) {
- return FALSE;
- }
- FX_INT32 iCount = pExpression->GetCount();
- CPDF_Object *pOCGObj;
- CFX_ByteString csOperator = pExpression->GetString(0);
- if (csOperator == FX_BSTRC("Not")) {
- pOCGObj = pExpression->GetElementValue(1);
- if (pOCGObj == NULL) {
- return FALSE;
- }
- if (pOCGObj->GetType() == PDFOBJ_DICTIONARY) {
- return !(bFromConfig ? LoadOCGState((CPDF_Dictionary*)pOCGObj) : GetOCGVisible((CPDF_Dictionary*)pOCGObj));
- } else if (pOCGObj->GetType() == PDFOBJ_ARRAY) {
- return !GetOCGVE((CPDF_Array*)pOCGObj, bFromConfig, nLevel + 1);
- } else {
- return FALSE;
- }
- }
- if (csOperator == FX_BSTRC("Or") || csOperator == FX_BSTRC("And")) {
- FX_BOOL bValue = FALSE;
- for (FX_INT32 i = 1; i < iCount; i ++) {
- pOCGObj = pExpression->GetElementValue(1);
- if (pOCGObj == NULL) {
- continue;
- }
- FX_BOOL bItem = FALSE;
- if (pOCGObj->GetType() == PDFOBJ_DICTIONARY) {
- bItem = bFromConfig ? LoadOCGState((CPDF_Dictionary*)pOCGObj) : GetOCGVisible((CPDF_Dictionary*)pOCGObj);
- } else if (pOCGObj->GetType() == PDFOBJ_ARRAY) {
- bItem = GetOCGVE((CPDF_Array*)pOCGObj, bFromConfig, nLevel + 1);
- }
- if (i == 1) {
- bValue = bItem;
- } else {
- if (csOperator == FX_BSTRC("Or")) {
- bValue = bValue || bItem;
- } else {
- bValue = bValue && bItem;
- }
- }
- }
- return bValue;
- }
- return FALSE;
-}
-FX_BOOL CPDF_OCContext::LoadOCMDState(const CPDF_Dictionary *pOCMDDict, FX_BOOL bFromConfig)
-{
- FXSYS_assert(pOCMDDict != NULL);
- CPDF_Array *pVE = pOCMDDict->GetArray(FX_BSTRC("VE"));
- if (pVE != NULL) {
- return GetOCGVE(pVE, bFromConfig);
- }
- CFX_ByteString csP = pOCMDDict->GetString(FX_BSTRC("P"), FX_BSTRC("AnyOn"));
- CPDF_Object *pOCGObj = pOCMDDict->GetElementValue(FX_BSTRC("OCGs"));
- if (pOCGObj == NULL) {
- return TRUE;
- }
- if (pOCGObj->GetType() == PDFOBJ_DICTIONARY) {
- return bFromConfig ? LoadOCGState((CPDF_Dictionary*)pOCGObj) : GetOCGVisible((CPDF_Dictionary*)pOCGObj);
- }
- if (pOCGObj->GetType() != PDFOBJ_ARRAY) {
- return TRUE;
- }
- FX_BOOL bState = FALSE;
- if (csP == FX_BSTRC("AllOn") || csP == FX_BSTRC("AllOff")) {
- bState = TRUE;
- }
- FX_INT32 iCount = ((CPDF_Array*)pOCGObj)->GetCount();
- for (FX_INT32 i = 0; i < iCount; i ++) {
- FX_BOOL bItem = TRUE;
- CPDF_Dictionary* pItemDict = ((CPDF_Array*)pOCGObj)->GetDict(i);
- if (pItemDict) {
- bItem = bFromConfig ? LoadOCGState(pItemDict) : GetOCGVisible(pItemDict);
- }
- if (csP == FX_BSTRC("AnyOn") && bItem) {
- return TRUE;
- }
- if (csP == FX_BSTRC("AnyOff") && !bItem) {
- return TRUE;
- }
- if (csP == FX_BSTRC("AllOn") && !bItem) {
- return FALSE;
- }
- if (csP == FX_BSTRC("AllOff") && bItem) {
- return FALSE;
- }
- }
- return bState;
-}
-FX_BOOL CPDF_OCContext::CheckOCGVisible(const CPDF_Dictionary *pOCGDict)
-{
- if (pOCGDict == NULL) {
- return TRUE;
- }
- CFX_ByteString csType = pOCGDict->GetString(FX_BSTRC("Type"), FX_BSTRC("OCG"));
- if (csType == FX_BSTRC("OCG")) {
- return GetOCGVisible(pOCGDict);
- } else {
- return LoadOCMDState(pOCGDict, FALSE);
- }
-}
-void CPDF_OCContext::ResetOCContext()
-{
- m_OCGStates.RemoveAll();
-}
+// 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
+
+#include "../../include/fpdfdoc/fpdf_doc.h"
+static FX_INT32 FPDFDOC_OCG_FindGroup(const CPDF_Object *pObject, const CPDF_Dictionary *pGroupDict)
+{
+ if (pObject == NULL || pGroupDict == NULL) {
+ return -1;
+ }
+ FX_INT32 iType = pObject->GetType();
+ if (iType == PDFOBJ_ARRAY) {
+ FX_DWORD dwCount = ((CPDF_Array*)pObject)->GetCount();
+ for (FX_DWORD i = 0; i < dwCount; i++) {
+ if (((CPDF_Array*)pObject)->GetDict(i) == pGroupDict) {
+ return i;
+ }
+ }
+ return -1;
+ }
+ if (pObject->GetDict() == pGroupDict) {
+ return 0;
+ }
+ return -1;
+}
+static FX_BOOL FPDFDOC_OCG_HasIntent(const CPDF_Dictionary *pDict, FX_BSTR csElement, FX_BSTR csDef = FX_BSTRC(""))
+{
+ FXSYS_assert(pDict != NULL);
+ CPDF_Object *pIntent = pDict->GetElementValue(FX_BSTRC("Intent"));
+ if (pIntent == NULL) {
+ return csElement == csDef;
+ }
+ CFX_ByteString bsIntent;
+ if (pIntent->GetType() == PDFOBJ_ARRAY) {
+ FX_DWORD dwCount = ((CPDF_Array*)pIntent)->GetCount();
+ for (FX_DWORD i = 0; i < dwCount; i++) {
+ bsIntent = ((CPDF_Array*)pIntent)->GetString(i);
+ if (bsIntent == FX_BSTRC("All") || bsIntent == csElement) {
+ return TRUE;
+ }
+ }
+ return FALSE;
+ }
+ bsIntent = pIntent->GetString();
+ return bsIntent == FX_BSTRC("All") || bsIntent == csElement;
+}
+static CPDF_Dictionary* FPDFDOC_OCG_GetConfig(CPDF_Document *pDoc, const CPDF_Dictionary *pOCGDict, FX_BSTR bsState)
+{
+ FXSYS_assert(pDoc && pOCGDict);
+ CPDF_Dictionary *pOCProperties = pDoc->GetRoot()->GetDict(FX_BSTRC("OCProperties"));
+ if (!pOCProperties) {
+ return NULL;
+ }
+ CPDF_Array *pOCGs = pOCProperties->GetArray(FX_BSTRC("OCGs"));
+ if (!pOCGs) {
+ return NULL;
+ }
+ if (FPDFDOC_OCG_FindGroup(pOCGs, pOCGDict) < 0) {
+ return NULL;
+ }
+ CPDF_Dictionary *pConfig = pOCProperties->GetDict(FX_BSTRC("D"));
+ CPDF_Array *pConfigs = pOCProperties->GetArray(FX_BSTRC("Configs"));
+ if (pConfigs) {
+ CPDF_Dictionary *pFind;
+ FX_INT32 iCount = pConfigs->GetCount();
+ for (FX_INT32 i = 0; i < iCount; i ++) {
+ pFind = pConfigs->GetDict(i);
+ if (!pFind) {
+ continue;
+ }
+ if (!FPDFDOC_OCG_HasIntent(pFind, FX_BSTRC("View"), FX_BSTRC("View"))) {
+ continue;
+ }
+ pConfig = pFind;
+ break;
+ }
+ }
+ return pConfig;
+}
+static CFX_ByteString FPDFDOC_OCG_GetUsageTypeString(CPDF_OCContext::UsageType eType)
+{
+ CFX_ByteString csState = FX_BSTRC("View");
+ if (eType == CPDF_OCContext::Design) {
+ csState = FX_BSTRC("Design");
+ } else if (eType == CPDF_OCContext::Print) {
+ csState = FX_BSTRC("Print");
+ } else if (eType == CPDF_OCContext::Export) {
+ csState = FX_BSTRC("Export");
+ }
+ return csState;
+}
+CPDF_OCContext::CPDF_OCContext(CPDF_Document *pDoc, UsageType eUsageType)
+{
+ FXSYS_assert(pDoc != NULL);
+ m_pDocument = pDoc;
+ m_eUsageType = eUsageType;
+}
+CPDF_OCContext::~CPDF_OCContext()
+{
+ m_OCGStates.RemoveAll();
+}
+FX_BOOL CPDF_OCContext::LoadOCGStateFromConfig(FX_BSTR csConfig, const CPDF_Dictionary *pOCGDict, FX_BOOL &bValidConfig) const
+{
+ CPDF_Dictionary *pConfig = FPDFDOC_OCG_GetConfig(m_pDocument, pOCGDict, csConfig);
+ if (!pConfig) {
+ return TRUE;
+ }
+ bValidConfig = TRUE;
+ FX_BOOL bState = pConfig->GetString(FX_BSTRC("BaseState"), FX_BSTRC("ON")) != FX_BSTRC("OFF");
+ CPDF_Array *pArray = pConfig->GetArray(FX_BSTRC("ON"));
+ if (pArray) {
+ if (FPDFDOC_OCG_FindGroup(pArray, pOCGDict) >= 0) {
+ bState = TRUE;
+ }
+ }
+ pArray = pConfig->GetArray(FX_BSTRC("OFF"));
+ if (pArray) {
+ if (FPDFDOC_OCG_FindGroup(pArray, pOCGDict) >= 0) {
+ bState = FALSE;
+ }
+ }
+ pArray = pConfig->GetArray(FX_BSTRC("AS"));
+ if (pArray) {
+ CFX_ByteString csFind = csConfig + FX_BSTRC("State");
+ FX_INT32 iCount = pArray->GetCount();
+ for (FX_INT32 i = 0; i < iCount; i ++) {
+ CPDF_Dictionary *pUsage = pArray->GetDict(i);
+ if (!pUsage) {
+ continue;
+ }
+ if (pUsage->GetString(FX_BSTRC("Event"), FX_BSTRC("View")) != csConfig) {
+ continue;
+ }
+ CPDF_Array *pOCGs = pUsage->GetArray(FX_BSTRC("OCGs"));
+ if (!pOCGs) {
+ continue;
+ }
+ if (FPDFDOC_OCG_FindGroup(pOCGs, pOCGDict) < 0) {
+ continue;
+ }
+ CPDF_Dictionary *pState = pUsage->GetDict(csConfig);
+ if (!pState) {
+ continue;
+ }
+ bState = pState->GetString(csFind) != FX_BSTRC("OFF");
+ }
+ }
+ return bState;
+}
+FX_BOOL CPDF_OCContext::LoadOCGState(const CPDF_Dictionary *pOCGDict) const
+{
+ if (!FPDFDOC_OCG_HasIntent(pOCGDict, FX_BSTRC("View"), FX_BSTRC("View"))) {
+ return TRUE;
+ }
+ CFX_ByteString csState = FPDFDOC_OCG_GetUsageTypeString(m_eUsageType);
+ CPDF_Dictionary *pUsage = pOCGDict->GetDict(FX_BSTRC("Usage"));
+ if (pUsage) {
+ CPDF_Dictionary *pState = pUsage->GetDict(csState);
+ if (pState) {
+ CFX_ByteString csFind = csState + FX_BSTRC("State");
+ if (pState->KeyExist(csFind)) {
+ return pState->GetString(csFind) != FX_BSTRC("OFF");
+ }
+ }
+ if (csState != FX_BSTRC("View")) {
+ pState = pUsage->GetDict(FX_BSTRC("View"));
+ if (pState && pState->KeyExist(FX_BSTRC("ViewState"))) {
+ return pState->GetString(FX_BSTRC("ViewState")) != FX_BSTRC("OFF");
+ }
+ }
+ }
+ FX_BOOL bDefValid = FALSE;
+ return LoadOCGStateFromConfig(csState, pOCGDict, bDefValid);
+}
+FX_BOOL CPDF_OCContext::GetOCGVisible(const CPDF_Dictionary *pOCGDict)
+{
+ if (!pOCGDict) {
+ return FALSE;
+ }
+ FX_LPVOID bState = NULL;
+ if (m_OCGStates.Lookup(pOCGDict, bState)) {
+ return (FX_UINTPTR)bState != 0;
+ }
+ bState = (FX_LPVOID)(FX_UINTPTR)LoadOCGState(pOCGDict);
+ m_OCGStates.SetAt(pOCGDict, bState);
+ return (FX_UINTPTR)bState != 0;
+}
+FX_BOOL CPDF_OCContext::GetOCGVE(CPDF_Array *pExpression, FX_BOOL bFromConfig, int nLevel)
+{
+ if (nLevel > 32) {
+ return FALSE;
+ }
+ if (pExpression == NULL) {
+ return FALSE;
+ }
+ FX_INT32 iCount = pExpression->GetCount();
+ CPDF_Object *pOCGObj;
+ CFX_ByteString csOperator = pExpression->GetString(0);
+ if (csOperator == FX_BSTRC("Not")) {
+ pOCGObj = pExpression->GetElementValue(1);
+ if (pOCGObj == NULL) {
+ return FALSE;
+ }
+ if (pOCGObj->GetType() == PDFOBJ_DICTIONARY) {
+ return !(bFromConfig ? LoadOCGState((CPDF_Dictionary*)pOCGObj) : GetOCGVisible((CPDF_Dictionary*)pOCGObj));
+ } else if (pOCGObj->GetType() == PDFOBJ_ARRAY) {
+ return !GetOCGVE((CPDF_Array*)pOCGObj, bFromConfig, nLevel + 1);
+ } else {
+ return FALSE;
+ }
+ }
+ if (csOperator == FX_BSTRC("Or") || csOperator == FX_BSTRC("And")) {
+ FX_BOOL bValue = FALSE;
+ for (FX_INT32 i = 1; i < iCount; i ++) {
+ pOCGObj = pExpression->GetElementValue(1);
+ if (pOCGObj == NULL) {
+ continue;
+ }
+ FX_BOOL bItem = FALSE;
+ if (pOCGObj->GetType() == PDFOBJ_DICTIONARY) {
+ bItem = bFromConfig ? LoadOCGState((CPDF_Dictionary*)pOCGObj) : GetOCGVisible((CPDF_Dictionary*)pOCGObj);
+ } else if (pOCGObj->GetType() == PDFOBJ_ARRAY) {
+ bItem = GetOCGVE((CPDF_Array*)pOCGObj, bFromConfig, nLevel + 1);
+ }
+ if (i == 1) {
+ bValue = bItem;
+ } else {
+ if (csOperator == FX_BSTRC("Or")) {
+ bValue = bValue || bItem;
+ } else {
+ bValue = bValue && bItem;
+ }
+ }
+ }
+ return bValue;
+ }
+ return FALSE;
+}
+FX_BOOL CPDF_OCContext::LoadOCMDState(const CPDF_Dictionary *pOCMDDict, FX_BOOL bFromConfig)
+{
+ FXSYS_assert(pOCMDDict != NULL);
+ CPDF_Array *pVE = pOCMDDict->GetArray(FX_BSTRC("VE"));
+ if (pVE != NULL) {
+ return GetOCGVE(pVE, bFromConfig);
+ }
+ CFX_ByteString csP = pOCMDDict->GetString(FX_BSTRC("P"), FX_BSTRC("AnyOn"));
+ CPDF_Object *pOCGObj = pOCMDDict->GetElementValue(FX_BSTRC("OCGs"));
+ if (pOCGObj == NULL) {
+ return TRUE;
+ }
+ if (pOCGObj->GetType() == PDFOBJ_DICTIONARY) {
+ return bFromConfig ? LoadOCGState((CPDF_Dictionary*)pOCGObj) : GetOCGVisible((CPDF_Dictionary*)pOCGObj);
+ }
+ if (pOCGObj->GetType() != PDFOBJ_ARRAY) {
+ return TRUE;
+ }
+ FX_BOOL bState = FALSE;
+ if (csP == FX_BSTRC("AllOn") || csP == FX_BSTRC("AllOff")) {
+ bState = TRUE;
+ }
+ FX_INT32 iCount = ((CPDF_Array*)pOCGObj)->GetCount();
+ for (FX_INT32 i = 0; i < iCount; i ++) {
+ FX_BOOL bItem = TRUE;
+ CPDF_Dictionary* pItemDict = ((CPDF_Array*)pOCGObj)->GetDict(i);
+ if (pItemDict) {
+ bItem = bFromConfig ? LoadOCGState(pItemDict) : GetOCGVisible(pItemDict);
+ }
+ if (csP == FX_BSTRC("AnyOn") && bItem) {
+ return TRUE;
+ }
+ if (csP == FX_BSTRC("AnyOff") && !bItem) {
+ return TRUE;
+ }
+ if (csP == FX_BSTRC("AllOn") && !bItem) {
+ return FALSE;
+ }
+ if (csP == FX_BSTRC("AllOff") && bItem) {
+ return FALSE;
+ }
+ }
+ return bState;
+}
+FX_BOOL CPDF_OCContext::CheckOCGVisible(const CPDF_Dictionary *pOCGDict)
+{
+ if (pOCGDict == NULL) {
+ return TRUE;
+ }
+ CFX_ByteString csType = pOCGDict->GetString(FX_BSTRC("Type"), FX_BSTRC("OCG"));
+ if (csType == FX_BSTRC("OCG")) {
+ return GetOCGVisible(pOCGDict);
+ } else {
+ return LoadOCMDState(pOCGDict, FALSE);
+ }
+}
+void CPDF_OCContext::ResetOCContext()
+{
+ m_OCGStates.RemoveAll();
+}
diff --git a/core/src/fpdfdoc/doc_tagged.cpp b/core/src/fpdfdoc/doc_tagged.cpp
index 95ae8d581e..551042037b 100644
--- a/core/src/fpdfdoc/doc_tagged.cpp
+++ b/core/src/fpdfdoc/doc_tagged.cpp
@@ -1,448 +1,448 @@
-// 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
-
-#include "../../include/fpdfapi/fpdf_parser.h"
-#include "../../include/fpdfapi/fpdf_page.h"
-#include "../../include/fpdfdoc/fpdf_tagged.h"
-#include "tagged_int.h"
-const int nMaxRecursion = 32;
-static FX_BOOL IsTagged(const CPDF_Document* pDoc)
-{
- CPDF_Dictionary* pCatalog = pDoc->GetRoot();
- CPDF_Dictionary* pMarkInfo = pCatalog->GetDict(FX_BSTRC("MarkInfo"));
- return pMarkInfo != NULL && pMarkInfo->GetInteger(FX_BSTRC("Marked"));
-}
-CPDF_StructTree* CPDF_StructTree::LoadPage(const CPDF_Document* pDoc, const CPDF_Dictionary* pPageDict)
-{
- if (!IsTagged(pDoc)) {
- return NULL;
- }
- CPDF_StructTreeImpl* pTree = FX_NEW CPDF_StructTreeImpl(pDoc);
- if (pTree == NULL) {
- return NULL;
- }
- pTree->LoadPageTree(pPageDict);
- return pTree;
-}
-CPDF_StructTree* CPDF_StructTree::LoadDoc(const CPDF_Document* pDoc)
-{
- if (!IsTagged(pDoc)) {
- return NULL;
- }
- CPDF_StructTreeImpl* pTree = FX_NEW CPDF_StructTreeImpl(pDoc);
- if (pTree == NULL) {
- return NULL;
- }
- pTree->LoadDocTree();
- return pTree;
-}
-CPDF_StructTreeImpl::CPDF_StructTreeImpl(const CPDF_Document* pDoc)
-{
- CPDF_Dictionary* pCatalog = pDoc->GetRoot();
- m_pTreeRoot = pCatalog->GetDict(FX_BSTRC("StructTreeRoot"));
- if (m_pTreeRoot == NULL) {
- return;
- }
- m_pRoleMap = m_pTreeRoot->GetDict(FX_BSTRC("RoleMap"));
-}
-CPDF_StructTreeImpl::~CPDF_StructTreeImpl()
-{
- for (int i = 0; i < m_Kids.GetSize(); i ++)
- if (m_Kids[i]) {
- m_Kids[i]->Release();
- }
-}
-void CPDF_StructTreeImpl::LoadDocTree()
-{
- m_pPage = NULL;
- if (m_pTreeRoot == NULL) {
- return;
- }
- CPDF_Object* pKids = m_pTreeRoot->GetElementValue(FX_BSTRC("K"));
- if (pKids == NULL) {
- return;
- }
- if (pKids->GetType() == PDFOBJ_DICTIONARY) {
- CPDF_StructElementImpl* pStructElementImpl = FX_NEW CPDF_StructElementImpl(this, NULL, (CPDF_Dictionary*)pKids);
- if (pStructElementImpl == NULL) {
- return;
- }
- m_Kids.Add(pStructElementImpl);
- return;
- }
- if (pKids->GetType() != PDFOBJ_ARRAY) {
- return;
- }
- CPDF_Array* pArray = (CPDF_Array*)pKids;
- for (FX_DWORD i = 0; i < pArray->GetCount(); i ++) {
- CPDF_Dictionary* pKid = pArray->GetDict(i);
- CPDF_StructElementImpl* pStructElementImpl = FX_NEW CPDF_StructElementImpl(this, NULL, pKid);
- if (pStructElementImpl == NULL) {
- return;
- }
- m_Kids.Add(pStructElementImpl);
- }
-}
-void CPDF_StructTreeImpl::LoadPageTree(const CPDF_Dictionary* pPageDict)
-{
- m_pPage = pPageDict;
- if (m_pTreeRoot == NULL) {
- return;
- }
- CPDF_Object* pKids = m_pTreeRoot->GetElementValue(FX_BSTRC("K"));
- if (pKids == NULL) {
- return;
- }
- FX_DWORD dwKids = 0;
- if (pKids->GetType() == PDFOBJ_DICTIONARY) {
- dwKids = 1;
- } else if (pKids->GetType() == PDFOBJ_ARRAY) {
- dwKids = ((CPDF_Array*)pKids)->GetCount();
- } else {
- return;
- }
- FX_DWORD i;
- m_Kids.SetSize(dwKids);
- for (i = 0; i < dwKids; i ++) {
- m_Kids[i] = NULL;
- }
- CFX_MapPtrToPtr element_map;
- CPDF_Dictionary* pParentTree = m_pTreeRoot->GetDict(FX_BSTRC("ParentTree"));
- if (pParentTree == NULL) {
- return;
- }
- CPDF_NumberTree parent_tree(pParentTree);
- int parents_id = pPageDict->GetInteger(FX_BSTRC("StructParents"), -1);
- if (parents_id >= 0) {
- CPDF_Object* pParents = parent_tree.LookupValue(parents_id);
- if (pParents == NULL || pParents->GetType() != PDFOBJ_ARRAY) {
- return;
- }
- CPDF_Array* pParentArray = (CPDF_Array*)pParents;
- for (i = 0; i < pParentArray->GetCount(); i ++) {
- CPDF_Dictionary* pParent = pParentArray->GetDict(i);
- if (pParent == NULL) {
- continue;
- }
- AddPageNode(pParent, element_map);
- }
- }
-}
-CPDF_StructElementImpl* CPDF_StructTreeImpl::AddPageNode(CPDF_Dictionary* pDict, CFX_MapPtrToPtr& map, int nLevel)
-{
- if (nLevel > nMaxRecursion) {
- return NULL;
- }
- CPDF_StructElementImpl* pElement = NULL;
- if (map.Lookup(pDict, (FX_LPVOID&)pElement)) {
- return pElement;
- }
- pElement = FX_NEW CPDF_StructElementImpl(this, NULL, pDict);
- if (pElement == NULL) {
- return NULL;
- }
- map.SetAt(pDict, pElement);
- CPDF_Dictionary* pParent = pDict->GetDict(FX_BSTRC("P"));
- if (pParent == NULL || pParent->GetString(FX_BSTRC("Type")) == FX_BSTRC("StructTreeRoot")) {
- if (!AddTopLevelNode(pDict, pElement)) {
- pElement->Release();
- map.RemoveKey(pDict);
- }
- } else {
- CPDF_StructElementImpl* pParentElement = AddPageNode(pParent, map, nLevel + 1);
- FX_BOOL bSave = FALSE;
- for (int i = 0; i < pParentElement->m_Kids.GetSize(); i ++) {
- if (pParentElement->m_Kids[i].m_Type != CPDF_StructKid::Element) {
- continue;
- }
- if (pParentElement->m_Kids[i].m_Element.m_pDict != pDict) {
- continue;
- }
- pParentElement->m_Kids[i].m_Element.m_pElement = pElement->Retain();
- bSave = TRUE;
- }
- if (!bSave) {
- pElement->Release();
- map.RemoveKey(pDict);
- }
- }
- return pElement;
-}
-FX_BOOL CPDF_StructTreeImpl::AddTopLevelNode(CPDF_Dictionary* pDict, CPDF_StructElementImpl* pElement)
-{
- CPDF_Object *pObj = m_pTreeRoot->GetElementValue(FX_BSTRC("K"));
- if (!pObj) {
- return FALSE;
- }
- if (pObj->GetType() == PDFOBJ_DICTIONARY) {
- if (pObj->GetObjNum() == pDict->GetObjNum()) {
- if (m_Kids[0]) {
- m_Kids[0]->Release();
- }
- m_Kids[0] = pElement->Retain();
- } else {
- return FALSE;
- }
- }
- if (pObj->GetType() == PDFOBJ_ARRAY) {
- CPDF_Array* pTopKids = (CPDF_Array*)pObj;
- FX_DWORD i;
- FX_BOOL bSave = FALSE;
- for (i = 0; i < pTopKids->GetCount(); i ++) {
- CPDF_Reference* pKidRef = (CPDF_Reference*)pTopKids->GetElement(i);
- if (pKidRef->GetType() != PDFOBJ_REFERENCE || pKidRef->GetRefObjNum() != pDict->GetObjNum()) {
- continue;
- }
- if (m_Kids[i]) {
- m_Kids[i]->Release();
- }
- m_Kids[i] = pElement->Retain();
- bSave = TRUE;
- }
- if (!bSave) {
- return FALSE;
- }
- }
- return TRUE;
-}
-CPDF_StructElementImpl::CPDF_StructElementImpl(CPDF_StructTreeImpl* pTree, CPDF_StructElementImpl* pParent, CPDF_Dictionary* pDict)
- : m_RefCount(0)
-{
- m_pTree = pTree;
- m_pDict = pDict;
- m_Type = pDict->GetString(FX_BSTRC("S"));
- CFX_ByteString mapped = pTree->m_pRoleMap->GetString(m_Type);
- if (!mapped.IsEmpty()) {
- m_Type = mapped;
- }
- m_pParent = pParent;
- LoadKids(pDict);
-}
-CPDF_StructElementImpl::~CPDF_StructElementImpl()
-{
- for (int i = 0; i < m_Kids.GetSize(); i ++) {
- if (m_Kids[i].m_Type == CPDF_StructKid::Element && m_Kids[i].m_Element.m_pElement) {
- ((CPDF_StructElementImpl*)m_Kids[i].m_Element.m_pElement)->Release();
- }
- }
-}
-CPDF_StructElementImpl* CPDF_StructElementImpl::Retain()
-{
- m_RefCount++;
- return this;
-}
-void CPDF_StructElementImpl::Release()
-{
- if(--m_RefCount < 1) {
- delete this;
- }
-}
-void CPDF_StructElementImpl::LoadKids(CPDF_Dictionary* pDict)
-{
- CPDF_Object* pObj = pDict->GetElement(FX_BSTRC("Pg"));
- FX_DWORD PageObjNum = 0;
- if (pObj && pObj->GetType() == PDFOBJ_REFERENCE) {
- PageObjNum = ((CPDF_Reference*)pObj)->GetRefObjNum();
- }
- CPDF_Object* pKids = pDict->GetElementValue(FX_BSTRC("K"));
- if (pKids == NULL) {
- return;
- }
- if (pKids->GetType() == PDFOBJ_ARRAY) {
- CPDF_Array* pArray = (CPDF_Array*)pKids;
- m_Kids.SetSize(pArray->GetCount());
- for (FX_DWORD i = 0; i < pArray->GetCount(); i ++) {
- CPDF_Object* pKid = pArray->GetElementValue(i);
- LoadKid(PageObjNum, pKid, &m_Kids[i]);
- }
- } else {
- m_Kids.SetSize(1);
- LoadKid(PageObjNum, pKids, &m_Kids[0]);
- }
-}
-void CPDF_StructElementImpl::LoadKid(FX_DWORD PageObjNum, CPDF_Object* pKidObj, CPDF_StructKid* pKid)
-{
- pKid->m_Type = CPDF_StructKid::Invalid;
- if (pKidObj == NULL) {
- return;
- }
- if (pKidObj->GetType() == PDFOBJ_NUMBER) {
- if (m_pTree->m_pPage && m_pTree->m_pPage->GetObjNum() != PageObjNum) {
- return;
- }
- pKid->m_Type = CPDF_StructKid::PageContent;
- pKid->m_PageContent.m_ContentId = pKidObj->GetInteger();
- pKid->m_PageContent.m_PageObjNum = PageObjNum;
- return;
- }
- if (pKidObj->GetType() != PDFOBJ_DICTIONARY) {
- return;
- }
- CPDF_Dictionary* pKidDict = (CPDF_Dictionary*)pKidObj;
- CPDF_Object* pPageObj = pKidDict->GetElement(FX_BSTRC("Pg"));
- if (pPageObj && pPageObj->GetType() == PDFOBJ_REFERENCE) {
- PageObjNum = ((CPDF_Reference*)pPageObj)->GetRefObjNum();
- }
- CFX_ByteString type = pKidDict->GetString(FX_BSTRC("Type"));
- if (type == FX_BSTRC("MCR")) {
- if (m_pTree->m_pPage && m_pTree->m_pPage->GetObjNum() != PageObjNum) {
- return;
- }
- pKid->m_Type = CPDF_StructKid::StreamContent;
- CPDF_Object* pStreamObj = pKidDict->GetElement(FX_BSTRC("Stm"));
- if (pStreamObj && pStreamObj->GetType() == PDFOBJ_REFERENCE) {
- pKid->m_StreamContent.m_RefObjNum = ((CPDF_Reference*)pStreamObj)->GetRefObjNum();
- } else {
- pKid->m_StreamContent.m_RefObjNum = 0;
- }
- pKid->m_StreamContent.m_PageObjNum = PageObjNum;
- pKid->m_StreamContent.m_ContentId = pKidDict->GetInteger(FX_BSTRC("MCID"));
- } else if (type == FX_BSTRC("OBJR")) {
- if (m_pTree->m_pPage && m_pTree->m_pPage->GetObjNum() != PageObjNum) {
- return;
- }
- pKid->m_Type = CPDF_StructKid::Object;
- CPDF_Object* pObj = pKidDict->GetElement(FX_BSTRC("Obj"));
- if (pObj && pObj->GetType() == PDFOBJ_REFERENCE) {
- pKid->m_Object.m_RefObjNum = ((CPDF_Reference*)pObj)->GetRefObjNum();
- } else {
- pKid->m_Object.m_RefObjNum = 0;
- }
- pKid->m_Object.m_PageObjNum = PageObjNum;
- } else {
- pKid->m_Type = CPDF_StructKid::Element;
- pKid->m_Element.m_pDict = pKidDict;
- if (m_pTree->m_pPage == NULL) {
- pKid->m_Element.m_pElement = FX_NEW CPDF_StructElementImpl(m_pTree, this, pKidDict);
- } else {
- pKid->m_Element.m_pElement = NULL;
- }
- }
-}
-static CPDF_Dictionary* FindAttrDict(CPDF_Object* pAttrs, FX_BSTR owner, FX_FLOAT nLevel = 0.0F)
-{
- if (nLevel > nMaxRecursion) {
- return NULL;
- }
- if (pAttrs == NULL) {
- return NULL;
- }
- CPDF_Dictionary* pDict = NULL;
- if (pAttrs->GetType() == PDFOBJ_DICTIONARY) {
- pDict = (CPDF_Dictionary*)pAttrs;
- } else if (pAttrs->GetType() == PDFOBJ_STREAM) {
- pDict = ((CPDF_Stream*)pAttrs)->GetDict();
- } else if (pAttrs->GetType() == PDFOBJ_ARRAY) {
- CPDF_Array* pArray = (CPDF_Array*)pAttrs;
- for (FX_DWORD i = 0; i < pArray->GetCount(); i ++) {
- CPDF_Object* pElement = pArray->GetElementValue(i);
- pDict = FindAttrDict(pElement, owner, nLevel + 1);
- if (pDict) {
- return pDict;
- }
- }
- }
- if (pDict && pDict->GetString(FX_BSTRC("O")) == owner) {
- return pDict;
- }
- return NULL;
-}
-CPDF_Object* CPDF_StructElementImpl::GetAttr(FX_BSTR owner, FX_BSTR name, FX_BOOL bInheritable, FX_FLOAT fLevel)
-{
- if (fLevel > nMaxRecursion) {
- return NULL;
- }
- if (bInheritable) {
- CPDF_Object* pAttr = GetAttr(owner, name, FALSE);
- if (pAttr) {
- return pAttr;
- }
- if (m_pParent == NULL) {
- return NULL;
- }
- return m_pParent->GetAttr(owner, name, TRUE, fLevel + 1);
- }
- CPDF_Object* pA = m_pDict->GetElementValue(FX_BSTRC("A"));
- if (pA) {
- CPDF_Dictionary* pAttrDict = FindAttrDict(pA, owner);
- if (pAttrDict) {
- CPDF_Object* pAttr = pAttrDict->GetElementValue(name);
- if (pAttr) {
- return pAttr;
- }
- }
- }
- CPDF_Object* pC = m_pDict->GetElementValue(FX_BSTRC("C"));
- if (pC == NULL) {
- return NULL;
- }
- CPDF_Dictionary* pClassMap = m_pTree->m_pTreeRoot->GetDict(FX_BSTRC("ClassMap"));
- if (pClassMap == NULL) {
- return NULL;
- }
- if (pC->GetType() == PDFOBJ_ARRAY) {
- CPDF_Array* pArray = (CPDF_Array*)pC;
- for (FX_DWORD i = 0; i < pArray->GetCount(); i ++) {
- CFX_ByteString class_name = pArray->GetString(i);
- CPDF_Dictionary* pClassDict = pClassMap->GetDict(class_name);
- if (pClassDict && pClassDict->GetString(FX_BSTRC("O")) == owner) {
- return pClassDict->GetElementValue(name);
- }
- }
- return NULL;
- }
- CFX_ByteString class_name = pC->GetString();
- CPDF_Dictionary* pClassDict = pClassMap->GetDict(class_name);
- if (pClassDict && pClassDict->GetString(FX_BSTRC("O")) == owner) {
- return pClassDict->GetElementValue(name);
- }
- return NULL;
-}
-CPDF_Object* CPDF_StructElementImpl::GetAttr(FX_BSTR owner, FX_BSTR name, FX_BOOL bInheritable, int subindex)
-{
- CPDF_Object* pAttr = GetAttr(owner, name, bInheritable);
- if (pAttr == NULL || subindex == -1 || pAttr->GetType() != PDFOBJ_ARRAY) {
- return pAttr;
- }
- CPDF_Array* pArray = (CPDF_Array*)pAttr;
- if (subindex >= (int)pArray->GetCount()) {
- return pAttr;
- }
- return pArray->GetElementValue(subindex);
-}
-CFX_ByteString CPDF_StructElementImpl::GetName(FX_BSTR owner, FX_BSTR name, FX_BSTR default_value, FX_BOOL bInheritable, int subindex)
-{
- CPDF_Object* pAttr = GetAttr(owner, name, bInheritable, subindex);
- if (pAttr == NULL || pAttr->GetType() != PDFOBJ_NAME) {
- return default_value;
- }
- return pAttr->GetString();
-}
-FX_ARGB CPDF_StructElementImpl::GetColor(FX_BSTR owner, FX_BSTR name, FX_ARGB default_value, FX_BOOL bInheritable, int subindex)
-{
- CPDF_Object* pAttr = GetAttr(owner, name, bInheritable, subindex);
- if (pAttr == NULL || pAttr->GetType() != PDFOBJ_ARRAY) {
- return default_value;
- }
- CPDF_Array* pArray = (CPDF_Array*)pAttr;
- return 0xff000000 | ((int)(pArray->GetNumber(0) * 255) << 16) | ((int)(pArray->GetNumber(1) * 255) << 8) | (int)(pArray->GetNumber(2) * 255);
-}
-FX_FLOAT CPDF_StructElementImpl::GetNumber(FX_BSTR owner, FX_BSTR name, FX_FLOAT default_value, FX_BOOL bInheritable, int subindex)
-{
- CPDF_Object* pAttr = GetAttr(owner, name, bInheritable, subindex);
- if (pAttr == NULL || pAttr->GetType() != PDFOBJ_NUMBER) {
- return default_value;
- }
- return pAttr->GetNumber();
-}
-int CPDF_StructElementImpl::GetInteger(FX_BSTR owner, FX_BSTR name, int default_value, FX_BOOL bInheritable, int subindex)
-{
- CPDF_Object* pAttr = GetAttr(owner, name, bInheritable, subindex);
- if (pAttr == NULL || pAttr->GetType() != PDFOBJ_NUMBER) {
- return default_value;
- }
- return pAttr->GetInteger();
-}
+// 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
+
+#include "../../include/fpdfapi/fpdf_parser.h"
+#include "../../include/fpdfapi/fpdf_page.h"
+#include "../../include/fpdfdoc/fpdf_tagged.h"
+#include "tagged_int.h"
+const int nMaxRecursion = 32;
+static FX_BOOL IsTagged(const CPDF_Document* pDoc)
+{
+ CPDF_Dictionary* pCatalog = pDoc->GetRoot();
+ CPDF_Dictionary* pMarkInfo = pCatalog->GetDict(FX_BSTRC("MarkInfo"));
+ return pMarkInfo != NULL && pMarkInfo->GetInteger(FX_BSTRC("Marked"));
+}
+CPDF_StructTree* CPDF_StructTree::LoadPage(const CPDF_Document* pDoc, const CPDF_Dictionary* pPageDict)
+{
+ if (!IsTagged(pDoc)) {
+ return NULL;
+ }
+ CPDF_StructTreeImpl* pTree = FX_NEW CPDF_StructTreeImpl(pDoc);
+ if (pTree == NULL) {
+ return NULL;
+ }
+ pTree->LoadPageTree(pPageDict);
+ return pTree;
+}
+CPDF_StructTree* CPDF_StructTree::LoadDoc(const CPDF_Document* pDoc)
+{
+ if (!IsTagged(pDoc)) {
+ return NULL;
+ }
+ CPDF_StructTreeImpl* pTree = FX_NEW CPDF_StructTreeImpl(pDoc);
+ if (pTree == NULL) {
+ return NULL;
+ }
+ pTree->LoadDocTree();
+ return pTree;
+}
+CPDF_StructTreeImpl::CPDF_StructTreeImpl(const CPDF_Document* pDoc)
+{
+ CPDF_Dictionary* pCatalog = pDoc->GetRoot();
+ m_pTreeRoot = pCatalog->GetDict(FX_BSTRC("StructTreeRoot"));
+ if (m_pTreeRoot == NULL) {
+ return;
+ }
+ m_pRoleMap = m_pTreeRoot->GetDict(FX_BSTRC("RoleMap"));
+}
+CPDF_StructTreeImpl::~CPDF_StructTreeImpl()
+{
+ for (int i = 0; i < m_Kids.GetSize(); i ++)
+ if (m_Kids[i]) {
+ m_Kids[i]->Release();
+ }
+}
+void CPDF_StructTreeImpl::LoadDocTree()
+{
+ m_pPage = NULL;
+ if (m_pTreeRoot == NULL) {
+ return;
+ }
+ CPDF_Object* pKids = m_pTreeRoot->GetElementValue(FX_BSTRC("K"));
+ if (pKids == NULL) {
+ return;
+ }
+ if (pKids->GetType() == PDFOBJ_DICTIONARY) {
+ CPDF_StructElementImpl* pStructElementImpl = FX_NEW CPDF_StructElementImpl(this, NULL, (CPDF_Dictionary*)pKids);
+ if (pStructElementImpl == NULL) {
+ return;
+ }
+ m_Kids.Add(pStructElementImpl);
+ return;
+ }
+ if (pKids->GetType() != PDFOBJ_ARRAY) {
+ return;
+ }
+ CPDF_Array* pArray = (CPDF_Array*)pKids;
+ for (FX_DWORD i = 0; i < pArray->GetCount(); i ++) {
+ CPDF_Dictionary* pKid = pArray->GetDict(i);
+ CPDF_StructElementImpl* pStructElementImpl = FX_NEW CPDF_StructElementImpl(this, NULL, pKid);
+ if (pStructElementImpl == NULL) {
+ return;
+ }
+ m_Kids.Add(pStructElementImpl);
+ }
+}
+void CPDF_StructTreeImpl::LoadPageTree(const CPDF_Dictionary* pPageDict)
+{
+ m_pPage = pPageDict;
+ if (m_pTreeRoot == NULL) {
+ return;
+ }
+ CPDF_Object* pKids = m_pTreeRoot->GetElementValue(FX_BSTRC("K"));
+ if (pKids == NULL) {
+ return;
+ }
+ FX_DWORD dwKids = 0;
+ if (pKids->GetType() == PDFOBJ_DICTIONARY) {
+ dwKids = 1;
+ } else if (pKids->GetType() == PDFOBJ_ARRAY) {
+ dwKids = ((CPDF_Array*)pKids)->GetCount();
+ } else {
+ return;
+ }
+ FX_DWORD i;
+ m_Kids.SetSize(dwKids);
+ for (i = 0; i < dwKids; i ++) {
+ m_Kids[i] = NULL;
+ }
+ CFX_MapPtrToPtr element_map;
+ CPDF_Dictionary* pParentTree = m_pTreeRoot->GetDict(FX_BSTRC("ParentTree"));
+ if (pParentTree == NULL) {
+ return;
+ }
+ CPDF_NumberTree parent_tree(pParentTree);
+ int parents_id = pPageDict->GetInteger(FX_BSTRC("StructParents"), -1);
+ if (parents_id >= 0) {
+ CPDF_Object* pParents = parent_tree.LookupValue(parents_id);
+ if (pParents == NULL || pParents->GetType() != PDFOBJ_ARRAY) {
+ return;
+ }
+ CPDF_Array* pParentArray = (CPDF_Array*)pParents;
+ for (i = 0; i < pParentArray->GetCount(); i ++) {
+ CPDF_Dictionary* pParent = pParentArray->GetDict(i);
+ if (pParent == NULL) {
+ continue;
+ }
+ AddPageNode(pParent, element_map);
+ }
+ }
+}
+CPDF_StructElementImpl* CPDF_StructTreeImpl::AddPageNode(CPDF_Dictionary* pDict, CFX_MapPtrToPtr& map, int nLevel)
+{
+ if (nLevel > nMaxRecursion) {
+ return NULL;
+ }
+ CPDF_StructElementImpl* pElement = NULL;
+ if (map.Lookup(pDict, (FX_LPVOID&)pElement)) {
+ return pElement;
+ }
+ pElement = FX_NEW CPDF_StructElementImpl(this, NULL, pDict);
+ if (pElement == NULL) {
+ return NULL;
+ }
+ map.SetAt(pDict, pElement);
+ CPDF_Dictionary* pParent = pDict->GetDict(FX_BSTRC("P"));
+ if (pParent == NULL || pParent->GetString(FX_BSTRC("Type")) == FX_BSTRC("StructTreeRoot")) {
+ if (!AddTopLevelNode(pDict, pElement)) {
+ pElement->Release();
+ map.RemoveKey(pDict);
+ }
+ } else {
+ CPDF_StructElementImpl* pParentElement = AddPageNode(pParent, map, nLevel + 1);
+ FX_BOOL bSave = FALSE;
+ for (int i = 0; i < pParentElement->m_Kids.GetSize(); i ++) {
+ if (pParentElement->m_Kids[i].m_Type != CPDF_StructKid::Element) {
+ continue;
+ }
+ if (pParentElement->m_Kids[i].m_Element.m_pDict != pDict) {
+ continue;
+ }
+ pParentElement->m_Kids[i].m_Element.m_pElement = pElement->Retain();
+ bSave = TRUE;
+ }
+ if (!bSave) {
+ pElement->Release();
+ map.RemoveKey(pDict);
+ }
+ }
+ return pElement;
+}
+FX_BOOL CPDF_StructTreeImpl::AddTopLevelNode(CPDF_Dictionary* pDict, CPDF_StructElementImpl* pElement)
+{
+ CPDF_Object *pObj = m_pTreeRoot->GetElementValue(FX_BSTRC("K"));
+ if (!pObj) {
+ return FALSE;
+ }
+ if (pObj->GetType() == PDFOBJ_DICTIONARY) {
+ if (pObj->GetObjNum() == pDict->GetObjNum()) {
+ if (m_Kids[0]) {
+ m_Kids[0]->Release();
+ }
+ m_Kids[0] = pElement->Retain();
+ } else {
+ return FALSE;
+ }
+ }
+ if (pObj->GetType() == PDFOBJ_ARRAY) {
+ CPDF_Array* pTopKids = (CPDF_Array*)pObj;
+ FX_DWORD i;
+ FX_BOOL bSave = FALSE;
+ for (i = 0; i < pTopKids->GetCount(); i ++) {
+ CPDF_Reference* pKidRef = (CPDF_Reference*)pTopKids->GetElement(i);
+ if (pKidRef->GetType() != PDFOBJ_REFERENCE || pKidRef->GetRefObjNum() != pDict->GetObjNum()) {
+ continue;
+ }
+ if (m_Kids[i]) {
+ m_Kids[i]->Release();
+ }
+ m_Kids[i] = pElement->Retain();
+ bSave = TRUE;
+ }
+ if (!bSave) {
+ return FALSE;
+ }
+ }
+ return TRUE;
+}
+CPDF_StructElementImpl::CPDF_StructElementImpl(CPDF_StructTreeImpl* pTree, CPDF_StructElementImpl* pParent, CPDF_Dictionary* pDict)
+ : m_RefCount(0)
+{
+ m_pTree = pTree;
+ m_pDict = pDict;
+ m_Type = pDict->GetString(FX_BSTRC("S"));
+ CFX_ByteString mapped = pTree->m_pRoleMap->GetString(m_Type);
+ if (!mapped.IsEmpty()) {
+ m_Type = mapped;
+ }
+ m_pParent = pParent;
+ LoadKids(pDict);
+}
+CPDF_StructElementImpl::~CPDF_StructElementImpl()
+{
+ for (int i = 0; i < m_Kids.GetSize(); i ++) {
+ if (m_Kids[i].m_Type == CPDF_StructKid::Element && m_Kids[i].m_Element.m_pElement) {
+ ((CPDF_StructElementImpl*)m_Kids[i].m_Element.m_pElement)->Release();
+ }
+ }
+}
+CPDF_StructElementImpl* CPDF_StructElementImpl::Retain()
+{
+ m_RefCount++;
+ return this;
+}
+void CPDF_StructElementImpl::Release()
+{
+ if(--m_RefCount < 1) {
+ delete this;
+ }
+}
+void CPDF_StructElementImpl::LoadKids(CPDF_Dictionary* pDict)
+{
+ CPDF_Object* pObj = pDict->GetElement(FX_BSTRC("Pg"));
+ FX_DWORD PageObjNum = 0;
+ if (pObj && pObj->GetType() == PDFOBJ_REFERENCE) {
+ PageObjNum = ((CPDF_Reference*)pObj)->GetRefObjNum();
+ }
+ CPDF_Object* pKids = pDict->GetElementValue(FX_BSTRC("K"));
+ if (pKids == NULL) {
+ return;
+ }
+ if (pKids->GetType() == PDFOBJ_ARRAY) {
+ CPDF_Array* pArray = (CPDF_Array*)pKids;
+ m_Kids.SetSize(pArray->GetCount());
+ for (FX_DWORD i = 0; i < pArray->GetCount(); i ++) {
+ CPDF_Object* pKid = pArray->GetElementValue(i);
+ LoadKid(PageObjNum, pKid, &m_Kids[i]);
+ }
+ } else {
+ m_Kids.SetSize(1);
+ LoadKid(PageObjNum, pKids, &m_Kids[0]);
+ }
+}
+void CPDF_StructElementImpl::LoadKid(FX_DWORD PageObjNum, CPDF_Object* pKidObj, CPDF_StructKid* pKid)
+{
+ pKid->m_Type = CPDF_StructKid::Invalid;
+ if (pKidObj == NULL) {
+ return;
+ }
+ if (pKidObj->GetType() == PDFOBJ_NUMBER) {
+ if (m_pTree->m_pPage && m_pTree->m_pPage->GetObjNum() != PageObjNum) {
+ return;
+ }
+ pKid->m_Type = CPDF_StructKid::PageContent;
+ pKid->m_PageContent.m_ContentId = pKidObj->GetInteger();
+ pKid->m_PageContent.m_PageObjNum = PageObjNum;
+ return;
+ }
+ if (pKidObj->GetType() != PDFOBJ_DICTIONARY) {
+ return;
+ }
+ CPDF_Dictionary* pKidDict = (CPDF_Dictionary*)pKidObj;
+ CPDF_Object* pPageObj = pKidDict->GetElement(FX_BSTRC("Pg"));
+ if (pPageObj && pPageObj->GetType() == PDFOBJ_REFERENCE) {
+ PageObjNum = ((CPDF_Reference*)pPageObj)->GetRefObjNum();
+ }
+ CFX_ByteString type = pKidDict->GetString(FX_BSTRC("Type"));
+ if (type == FX_BSTRC("MCR")) {
+ if (m_pTree->m_pPage && m_pTree->m_pPage->GetObjNum() != PageObjNum) {
+ return;
+ }
+ pKid->m_Type = CPDF_StructKid::StreamContent;
+ CPDF_Object* pStreamObj = pKidDict->GetElement(FX_BSTRC("Stm"));
+ if (pStreamObj && pStreamObj->GetType() == PDFOBJ_REFERENCE) {
+ pKid->m_StreamContent.m_RefObjNum = ((CPDF_Reference*)pStreamObj)->GetRefObjNum();
+ } else {
+ pKid->m_StreamContent.m_RefObjNum = 0;
+ }
+ pKid->m_StreamContent.m_PageObjNum = PageObjNum;
+ pKid->m_StreamContent.m_ContentId = pKidDict->GetInteger(FX_BSTRC("MCID"));
+ } else if (type == FX_BSTRC("OBJR")) {
+ if (m_pTree->m_pPage && m_pTree->m_pPage->GetObjNum() != PageObjNum) {
+ return;
+ }
+ pKid->m_Type = CPDF_StructKid::Object;
+ CPDF_Object* pObj = pKidDict->GetElement(FX_BSTRC("Obj"));
+ if (pObj && pObj->GetType() == PDFOBJ_REFERENCE) {
+ pKid->m_Object.m_RefObjNum = ((CPDF_Reference*)pObj)->GetRefObjNum();
+ } else {
+ pKid->m_Object.m_RefObjNum = 0;
+ }
+ pKid->m_Object.m_PageObjNum = PageObjNum;
+ } else {
+ pKid->m_Type = CPDF_StructKid::Element;
+ pKid->m_Element.m_pDict = pKidDict;
+ if (m_pTree->m_pPage == NULL) {
+ pKid->m_Element.m_pElement = FX_NEW CPDF_StructElementImpl(m_pTree, this, pKidDict);
+ } else {
+ pKid->m_Element.m_pElement = NULL;
+ }
+ }
+}
+static CPDF_Dictionary* FindAttrDict(CPDF_Object* pAttrs, FX_BSTR owner, FX_FLOAT nLevel = 0.0F)
+{
+ if (nLevel > nMaxRecursion) {
+ return NULL;
+ }
+ if (pAttrs == NULL) {
+ return NULL;
+ }
+ CPDF_Dictionary* pDict = NULL;
+ if (pAttrs->GetType() == PDFOBJ_DICTIONARY) {
+ pDict = (CPDF_Dictionary*)pAttrs;
+ } else if (pAttrs->GetType() == PDFOBJ_STREAM) {
+ pDict = ((CPDF_Stream*)pAttrs)->GetDict();
+ } else if (pAttrs->GetType() == PDFOBJ_ARRAY) {
+ CPDF_Array* pArray = (CPDF_Array*)pAttrs;
+ for (FX_DWORD i = 0; i < pArray->GetCount(); i ++) {
+ CPDF_Object* pElement = pArray->GetElementValue(i);
+ pDict = FindAttrDict(pElement, owner, nLevel + 1);
+ if (pDict) {
+ return pDict;
+ }
+ }
+ }
+ if (pDict && pDict->GetString(FX_BSTRC("O")) == owner) {
+ return pDict;
+ }
+ return NULL;
+}
+CPDF_Object* CPDF_StructElementImpl::GetAttr(FX_BSTR owner, FX_BSTR name, FX_BOOL bInheritable, FX_FLOAT fLevel)
+{
+ if (fLevel > nMaxRecursion) {
+ return NULL;
+ }
+ if (bInheritable) {
+ CPDF_Object* pAttr = GetAttr(owner, name, FALSE);
+ if (pAttr) {
+ return pAttr;
+ }
+ if (m_pParent == NULL) {
+ return NULL;
+ }
+ return m_pParent->GetAttr(owner, name, TRUE, fLevel + 1);
+ }
+ CPDF_Object* pA = m_pDict->GetElementValue(FX_BSTRC("A"));
+ if (pA) {
+ CPDF_Dictionary* pAttrDict = FindAttrDict(pA, owner);
+ if (pAttrDict) {
+ CPDF_Object* pAttr = pAttrDict->GetElementValue(name);
+ if (pAttr) {
+ return pAttr;
+ }
+ }
+ }
+ CPDF_Object* pC = m_pDict->GetElementValue(FX_BSTRC("C"));
+ if (pC == NULL) {
+ return NULL;
+ }
+ CPDF_Dictionary* pClassMap = m_pTree->m_pTreeRoot->GetDict(FX_BSTRC("ClassMap"));
+ if (pClassMap == NULL) {
+ return NULL;
+ }
+ if (pC->GetType() == PDFOBJ_ARRAY) {
+ CPDF_Array* pArray = (CPDF_Array*)pC;
+ for (FX_DWORD i = 0; i < pArray->GetCount(); i ++) {
+ CFX_ByteString class_name = pArray->GetString(i);
+ CPDF_Dictionary* pClassDict = pClassMap->GetDict(class_name);
+ if (pClassDict && pClassDict->GetString(FX_BSTRC("O")) == owner) {
+ return pClassDict->GetElementValue(name);
+ }
+ }
+ return NULL;
+ }
+ CFX_ByteString class_name = pC->GetString();
+ CPDF_Dictionary* pClassDict = pClassMap->GetDict(class_name);
+ if (pClassDict && pClassDict->GetString(FX_BSTRC("O")) == owner) {
+ return pClassDict->GetElementValue(name);
+ }
+ return NULL;
+}
+CPDF_Object* CPDF_StructElementImpl::GetAttr(FX_BSTR owner, FX_BSTR name, FX_BOOL bInheritable, int subindex)
+{
+ CPDF_Object* pAttr = GetAttr(owner, name, bInheritable);
+ if (pAttr == NULL || subindex == -1 || pAttr->GetType() != PDFOBJ_ARRAY) {
+ return pAttr;
+ }
+ CPDF_Array* pArray = (CPDF_Array*)pAttr;
+ if (subindex >= (int)pArray->GetCount()) {
+ return pAttr;
+ }
+ return pArray->GetElementValue(subindex);
+}
+CFX_ByteString CPDF_StructElementImpl::GetName(FX_BSTR owner, FX_BSTR name, FX_BSTR default_value, FX_BOOL bInheritable, int subindex)
+{
+ CPDF_Object* pAttr = GetAttr(owner, name, bInheritable, subindex);
+ if (pAttr == NULL || pAttr->GetType() != PDFOBJ_NAME) {
+ return default_value;
+ }
+ return pAttr->GetString();
+}
+FX_ARGB CPDF_StructElementImpl::GetColor(FX_BSTR owner, FX_BSTR name, FX_ARGB default_value, FX_BOOL bInheritable, int subindex)
+{
+ CPDF_Object* pAttr = GetAttr(owner, name, bInheritable, subindex);
+ if (pAttr == NULL || pAttr->GetType() != PDFOBJ_ARRAY) {
+ return default_value;
+ }
+ CPDF_Array* pArray = (CPDF_Array*)pAttr;
+ return 0xff000000 | ((int)(pArray->GetNumber(0) * 255) << 16) | ((int)(pArray->GetNumber(1) * 255) << 8) | (int)(pArray->GetNumber(2) * 255);
+}
+FX_FLOAT CPDF_StructElementImpl::GetNumber(FX_BSTR owner, FX_BSTR name, FX_FLOAT default_value, FX_BOOL bInheritable, int subindex)
+{
+ CPDF_Object* pAttr = GetAttr(owner, name, bInheritable, subindex);
+ if (pAttr == NULL || pAttr->GetType() != PDFOBJ_NUMBER) {
+ return default_value;
+ }
+ return pAttr->GetNumber();
+}
+int CPDF_StructElementImpl::GetInteger(FX_BSTR owner, FX_BSTR name, int default_value, FX_BOOL bInheritable, int subindex)
+{
+ CPDF_Object* pAttr = GetAttr(owner, name, bInheritable, subindex);
+ if (pAttr == NULL || pAttr->GetType() != PDFOBJ_NUMBER) {
+ return default_value;
+ }
+ return pAttr->GetInteger();
+}
diff --git a/core/src/fpdfdoc/doc_utils.cpp b/core/src/fpdfdoc/doc_utils.cpp
index dd81594998..ad958adbf2 100644
--- a/core/src/fpdfdoc/doc_utils.cpp
+++ b/core/src/fpdfdoc/doc_utils.cpp
@@ -1,749 +1,749 @@
-// 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
-
-#include "../../include/fpdfdoc/fpdf_doc.h"
-static const int FPDFDOC_UTILS_MAXRECURSION = 32;
-CFX_WideString GetFullName(CPDF_Dictionary* pFieldDict);
-void InitInterFormDict(CPDF_Dictionary*& pFormDict, CPDF_Document* pDocument);
-FX_DWORD CountInterFormFonts(CPDF_Dictionary* pFormDict);
-CPDF_Font* GetInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, FX_DWORD index, CFX_ByteString& csNameTag);
-CPDF_Font* GetInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, CFX_ByteString csNameTag);
-CPDF_Font* GetInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, CFX_ByteString csFontName, CFX_ByteString& csNameTag);
-CPDF_Font* GetNativeInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, FX_BYTE charSet, CFX_ByteString& csNameTag);
-CPDF_Font* GetNativeInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, CFX_ByteString& csNameTag);
-FX_BOOL FindInterFormFont(CPDF_Dictionary* pFormDict, const CPDF_Font* pFont, CFX_ByteString& csNameTag);
-FX_BOOL FindInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, CFX_ByteString csFontName, CPDF_Font*& pFont, CFX_ByteString& csNameTag);
-void AddInterFormFont(CPDF_Dictionary*& pFormDict, CPDF_Document* pDocument, const CPDF_Font* pFont, CFX_ByteString& csNameTag);
-CPDF_Font* AddNativeInterFormFont(CPDF_Dictionary*& pFormDict, CPDF_Document* pDocument, FX_BYTE charSet, CFX_ByteString& csNameTag);
-CPDF_Font* AddNativeInterFormFont(CPDF_Dictionary*& pFormDict, CPDF_Document* pDocument, CFX_ByteString& csNameTag);
-void RemoveInterFormFont(CPDF_Dictionary* pFormDict, const CPDF_Font* pFont);
-void RemoveInterFormFont(CPDF_Dictionary* pFormDict, CFX_ByteString csNameTag);
-CPDF_Font* GetDefaultInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument);
-void SetDefaultInterFormFont(CPDF_Dictionary*& pFormDict, CPDF_Document* pDocument, const CPDF_Font* pFont);
-void SaveCheckedFieldStatus(CPDF_FormField* pField, CFX_ByteArray& statusArray);
-FX_BOOL NeedPDFEncodeForFieldFullName(const CFX_WideString& csFieldName);
-FX_BOOL NeedPDFEncodeForFieldTree(CPDF_Dictionary* pFieldDict, int nLevel = 0);
-void EncodeFieldName(const CFX_WideString& csName, CFX_ByteString& csT);
-void UpdateEncodeFieldName(CPDF_Dictionary* pFieldDict, int nLevel = 0);
-CFX_WideString GetFullName(CPDF_Dictionary* pFieldDict)
-{
- CFX_WideString full_name;
- CPDF_Dictionary* pLevel = pFieldDict;
- while (pLevel) {
- CFX_WideString short_name = pLevel->GetUnicodeText("T");
- if (short_name != L"") {
- if (full_name == L"") {
- full_name = short_name;
- } else {
- full_name = short_name + L"." + full_name;
- }
- }
- pLevel = pLevel->GetDict("Parent");
- }
- return full_name;
-}
-FX_BOOL CPDF_DefaultAppearance::HasFont()
-{
- if (m_csDA.IsEmpty()) {
- return FALSE;
- }
- CPDF_SimpleParser syntax(m_csDA);
- return syntax.FindTagParam("Tf", 2);
-}
-CFX_ByteString CPDF_DefaultAppearance::GetFontString()
-{
- CFX_ByteString csFont;
- if (m_csDA.IsEmpty()) {
- return csFont;
- }
- CPDF_SimpleParser syntax(m_csDA);
- if (syntax.FindTagParam("Tf", 2)) {
- csFont += (CFX_ByteString)syntax.GetWord();
- csFont += " ";
- csFont += (CFX_ByteString)syntax.GetWord();
- csFont += " ";
- csFont += (CFX_ByteString)syntax.GetWord();
- }
- return csFont;
-}
-void CPDF_DefaultAppearance::GetFont(CFX_ByteString& csFontNameTag, FX_FLOAT& fFontSize)
-{
- csFontNameTag = "";
- fFontSize = 0;
- if (m_csDA.IsEmpty()) {
- return;
- }
- CPDF_SimpleParser syntax(m_csDA);
- if (syntax.FindTagParam("Tf", 2)) {
- csFontNameTag = (CFX_ByteString)syntax.GetWord();
- csFontNameTag.Delete(0, 1);
- fFontSize = FX_atof((CFX_ByteString)syntax.GetWord());
- }
- csFontNameTag = PDF_NameDecode(csFontNameTag);
-}
-FX_BOOL CPDF_DefaultAppearance::HasColor(FX_BOOL bStrokingOperation)
-{
- if (m_csDA.IsEmpty()) {
- return FALSE;
- }
- CPDF_SimpleParser syntax(m_csDA);
- if (syntax.FindTagParam(bStrokingOperation ? "G" : "g", 1)) {
- return TRUE;
- }
- syntax.SetPos(0);
- if (syntax.FindTagParam(bStrokingOperation ? "RG" : "rg", 3)) {
- return TRUE;
- }
- syntax.SetPos(0);
- return syntax.FindTagParam(bStrokingOperation ? "K" : "k", 4);
-}
-CFX_ByteString CPDF_DefaultAppearance::GetColorString(FX_BOOL bStrokingOperation)
-{
- CFX_ByteString csColor;
- if (m_csDA.IsEmpty()) {
- return csColor;
- }
- CPDF_SimpleParser syntax(m_csDA);
- if (syntax.FindTagParam(bStrokingOperation ? "G" : "g", 1)) {
- csColor += (CFX_ByteString)syntax.GetWord();
- csColor += " ";
- csColor += (CFX_ByteString)syntax.GetWord();
- return csColor;
- }
- syntax.SetPos(0);
- if (syntax.FindTagParam(bStrokingOperation ? "RG" : "rg", 3)) {
- csColor += (CFX_ByteString)syntax.GetWord();
- csColor += " ";
- csColor += (CFX_ByteString)syntax.GetWord();
- csColor += " ";
- csColor += (CFX_ByteString)syntax.GetWord();
- csColor += " ";
- csColor += (CFX_ByteString)syntax.GetWord();
- return csColor;
- }
- syntax.SetPos(0);
- if (syntax.FindTagParam(bStrokingOperation ? "K" : "k", 4)) {
- csColor += (CFX_ByteString)syntax.GetWord();
- csColor += " ";
- csColor += (CFX_ByteString)syntax.GetWord();
- csColor += " ";
- csColor += (CFX_ByteString)syntax.GetWord();
- csColor += " ";
- csColor += (CFX_ByteString)syntax.GetWord();
- csColor += " ";
- csColor += (CFX_ByteString)syntax.GetWord();
- }
- return csColor;
-}
-void CPDF_DefaultAppearance::GetColor(int& iColorType, FX_FLOAT fc[4], FX_BOOL bStrokingOperation)
-{
- iColorType = COLORTYPE_TRANSPARENT;
- for (int c = 0; c < 4; c ++) {
- fc[c] = 0;
- }
- if (m_csDA.IsEmpty()) {
- return;
- }
- CPDF_SimpleParser syntax(m_csDA);
- if (syntax.FindTagParam(bStrokingOperation ? "G" : "g", 1)) {
- iColorType = COLORTYPE_GRAY;
- fc[0] = FX_atof((CFX_ByteString)syntax.GetWord());
- return;
- }
- syntax.SetPos(0);
- if (syntax.FindTagParam(bStrokingOperation ? "RG" : "rg", 3)) {
- iColorType = COLORTYPE_RGB;
- fc[0] = FX_atof((CFX_ByteString)syntax.GetWord());
- fc[1] = FX_atof((CFX_ByteString)syntax.GetWord());
- fc[2] = FX_atof((CFX_ByteString)syntax.GetWord());
- return;
- }
- syntax.SetPos(0);
- if (syntax.FindTagParam(bStrokingOperation ? "K" : "k", 4)) {
- iColorType = COLORTYPE_CMYK;
- fc[0] = FX_atof((CFX_ByteString)syntax.GetWord());
- fc[1] = FX_atof((CFX_ByteString)syntax.GetWord());
- fc[2] = FX_atof((CFX_ByteString)syntax.GetWord());
- fc[3] = FX_atof((CFX_ByteString)syntax.GetWord());
- }
-}
-void CPDF_DefaultAppearance::GetColor(FX_ARGB& color, int& iColorType, FX_BOOL bStrokingOperation)
-{
- color = 0;
- iColorType = COLORTYPE_TRANSPARENT;
- if (m_csDA.IsEmpty()) {
- return;
- }
- CPDF_SimpleParser syntax(m_csDA);
- if (syntax.FindTagParam(bStrokingOperation ? "G" : "g", 1)) {
- iColorType = COLORTYPE_GRAY;
- FX_FLOAT g = FX_atof((CFX_ByteString)syntax.GetWord()) * 255 + 0.5f;
- color = ArgbEncode(255, (int)g, (int)g, (int)g);
- return;
- }
- syntax.SetPos(0);
- if (syntax.FindTagParam(bStrokingOperation ? "RG" : "rg", 3)) {
- iColorType = COLORTYPE_RGB;
- FX_FLOAT r = FX_atof((CFX_ByteString)syntax.GetWord()) * 255 + 0.5f;
- FX_FLOAT g = FX_atof((CFX_ByteString)syntax.GetWord()) * 255 + 0.5f;
- FX_FLOAT b = FX_atof((CFX_ByteString)syntax.GetWord()) * 255 + 0.5f;
- color = ArgbEncode(255, (int)r, (int)g, (int)b);
- return;
- }
- syntax.SetPos(0);
- if (syntax.FindTagParam(bStrokingOperation ? "K" : "k", 4)) {
- iColorType = COLORTYPE_CMYK;
- FX_FLOAT c = FX_atof((CFX_ByteString)syntax.GetWord());
- FX_FLOAT m = FX_atof((CFX_ByteString)syntax.GetWord());
- FX_FLOAT y = FX_atof((CFX_ByteString)syntax.GetWord());
- FX_FLOAT k = FX_atof((CFX_ByteString)syntax.GetWord());
- FX_FLOAT r = 1.0f - FX_MIN(1.0f, c + k);
- FX_FLOAT g = 1.0f - FX_MIN(1.0f, m + k);
- FX_FLOAT b = 1.0f - FX_MIN(1.0f, y + k);
- color = ArgbEncode(255, (int)(r * 255 + 0.5f), (int)(g * 255 + 0.5f), (int)(b * 255 + 0.5f));
- }
-}
-FX_BOOL CPDF_DefaultAppearance::HasTextMatrix()
-{
- if (m_csDA.IsEmpty()) {
- return FALSE;
- }
- CPDF_SimpleParser syntax(m_csDA);
- return syntax.FindTagParam("Tm", 6);
-}
-CFX_ByteString CPDF_DefaultAppearance::GetTextMatrixString()
-{
- CFX_ByteString csTM;
- if (m_csDA.IsEmpty()) {
- return csTM;
- }
- CPDF_SimpleParser syntax(m_csDA);
- if (syntax.FindTagParam("Tm", 6)) {
- for (int i = 0; i < 6; i ++) {
- csTM += (CFX_ByteString)syntax.GetWord();
- csTM += " ";
- }
- csTM += (CFX_ByteString)syntax.GetWord();
- }
- return csTM;
-}
-CFX_AffineMatrix CPDF_DefaultAppearance::GetTextMatrix()
-{
- CFX_AffineMatrix tm;
- if (m_csDA.IsEmpty()) {
- return tm;
- }
- CPDF_SimpleParser syntax(m_csDA);
- if (syntax.FindTagParam("Tm", 6)) {
- FX_FLOAT f[6];
- for (int i = 0; i < 6; i ++) {
- f[i] = FX_atof((CFX_ByteString)syntax.GetWord());
- }
- tm.Set(f[0], f[1], f[2], f[3], f[4], f[5]);
- }
- return tm;
-}
-void InitInterFormDict(CPDF_Dictionary*& pFormDict, CPDF_Document* pDocument)
-{
- if (pDocument == NULL) {
- return;
- }
- if (pFormDict == NULL) {
- pFormDict = CPDF_Dictionary::Create();
- if (pFormDict == NULL) {
- return;
- }
- FX_DWORD dwObjNum = pDocument->AddIndirectObject(pFormDict);
- CPDF_Dictionary* pRoot = pDocument->GetRoot();
- pRoot->SetAtReference("AcroForm", pDocument, dwObjNum);
- }
- CFX_ByteString csDA;
- if (!pFormDict->KeyExist("DR")) {
- CPDF_Font* pFont = NULL;
- CFX_ByteString csBaseName, csDefault;
- FX_BYTE charSet = CPDF_InterForm::GetNativeCharSet();
- pFont = CPDF_InterForm::AddStandardFont(pDocument, "Helvetica");
- if (pFont != NULL) {
- AddInterFormFont(pFormDict, pDocument, pFont, csBaseName);
- csDefault = csBaseName;
- }
- if (charSet != 0) {
- CFX_ByteString csFontName = CPDF_InterForm::GetNativeFont(charSet, NULL);
- if (pFont == NULL || csFontName != "Helvetica") {
- pFont = CPDF_InterForm::AddNativeFont(pDocument);
- if (pFont != NULL) {
- csBaseName = "";
- AddInterFormFont(pFormDict, pDocument, pFont, csBaseName);
- csDefault = csBaseName;
- }
- }
- }
- if (pFont != NULL) {
- csDA = "/" + PDF_NameEncode(csDefault) + " 0 Tf";
- }
- }
- if (!csDA.IsEmpty()) {
- csDA += " ";
- }
- csDA += "0 g";
- if (!pFormDict->KeyExist("DA")) {
- pFormDict->SetAtString("DA", csDA);
- }
-}
-FX_DWORD CountInterFormFonts(CPDF_Dictionary* pFormDict)
-{
- if (pFormDict == NULL) {
- return 0;
- }
- CPDF_Dictionary* pDR = pFormDict->GetDict("DR");
- if (pDR == NULL) {
- return 0;
- }
- CPDF_Dictionary* pFonts = pDR->GetDict("Font");
- if (pFonts == NULL) {
- return 0;
- }
- FX_DWORD dwCount = 0;
- FX_POSITION pos = pFonts->GetStartPos();
- while (pos) {
- CPDF_Object* pObj = NULL;
- CFX_ByteString csKey;
- pObj = pFonts->GetNextElement(pos, csKey);
- if (pObj == NULL) {
- continue;
- }
- CPDF_Object* pDirect = pObj->GetDirect();
- if (pDirect != NULL && pDirect->GetType() == PDFOBJ_DICTIONARY) {
- if (((CPDF_Dictionary*)pDirect)->GetString("Type") == "Font") {
- dwCount ++;
- }
- }
- }
- return dwCount;
-}
-CPDF_Font* GetInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, FX_DWORD index, CFX_ByteString& csNameTag)
-{
- if (pFormDict == NULL) {
- return NULL;
- }
- CPDF_Dictionary* pDR = pFormDict->GetDict("DR");
- if (pDR == NULL) {
- return NULL;
- }
- CPDF_Dictionary* pFonts = pDR->GetDict("Font");
- if (pFonts == NULL) {
- return NULL;
- }
- FX_DWORD dwCount = 0;
- FX_POSITION pos = pFonts->GetStartPos();
- while (pos) {
- CPDF_Object* pObj = NULL;
- CFX_ByteString csKey;
- pObj = pFonts->GetNextElement(pos, csKey);
- if (pObj == NULL) {
- continue;
- }
- CPDF_Object* pDirect = pObj->GetDirect();
- if (pDirect == NULL || pDirect->GetType() != PDFOBJ_DICTIONARY) {
- continue;
- }
- CPDF_Dictionary* pElement = (CPDF_Dictionary*)pDirect;
- if (pElement->GetString("Type") != "Font") {
- continue;
- }
- if (dwCount == index) {
- csNameTag = csKey;
- return pDocument->LoadFont(pElement);
- }
- dwCount ++;
- }
- return NULL;
-}
-CPDF_Font* GetInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, CFX_ByteString csNameTag)
-{
- CFX_ByteString csAlias = PDF_NameDecode(csNameTag);
- if (pFormDict == NULL || csAlias.IsEmpty()) {
- return NULL;
- }
- CPDF_Dictionary* pDR = pFormDict->GetDict("DR");
- if (pDR == NULL) {
- return NULL;
- }
- CPDF_Dictionary* pFonts = pDR->GetDict("Font");
- if (pFonts == NULL) {
- return NULL;
- }
- CPDF_Dictionary* pElement = pFonts->GetDict(csAlias);
- if (pElement == NULL) {
- return NULL;
- }
- if (pElement->GetString("Type") == "Font") {
- return pDocument->LoadFont(pElement);
- }
- return NULL;
-}
-CPDF_Font* GetInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, CFX_ByteString csFontName, CFX_ByteString& csNameTag)
-{
- if (pFormDict == NULL || csFontName.IsEmpty()) {
- return NULL;
- }
- CPDF_Dictionary* pDR = pFormDict->GetDict("DR");
- if (pDR == NULL) {
- return NULL;
- }
- CPDF_Dictionary* pFonts = pDR->GetDict("Font");
- if (pFonts == NULL) {
- return NULL;
- }
- FX_POSITION pos = pFonts->GetStartPos();
- while (pos) {
- CPDF_Object* pObj = NULL;
- CFX_ByteString csKey;
- pObj = pFonts->GetNextElement(pos, csKey);
- if (pObj == NULL) {
- continue;
- }
- CPDF_Object* pDirect = pObj->GetDirect();
- if (pDirect == NULL || pDirect->GetType() != PDFOBJ_DICTIONARY) {
- continue;
- }
- CPDF_Dictionary* pElement = (CPDF_Dictionary*)pDirect;
- if (pElement->GetString("Type") != "Font") {
- continue;
- }
- CPDF_Font* pFind = pDocument->LoadFont(pElement);
- if (pFind == NULL) {
- continue;
- }
- CFX_ByteString csBaseFont;
- csBaseFont = pFind->GetBaseFont();
- csBaseFont.Remove(' ');
- if (csBaseFont == csFontName) {
- csNameTag = csKey;
- return pFind;
- }
- }
- return NULL;
-}
-CPDF_Font* GetNativeInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, FX_BYTE charSet, CFX_ByteString& csNameTag)
-{
- if (pFormDict == NULL) {
- return NULL;
- }
- CPDF_Dictionary* pDR = pFormDict->GetDict("DR");
- if (pDR == NULL) {
- return NULL;
- }
- CPDF_Dictionary* pFonts = pDR->GetDict("Font");
- if (pFonts == NULL) {
- return NULL;
- }
- FX_POSITION pos = pFonts->GetStartPos();
- while (pos) {
- CPDF_Object* pObj = NULL;
- CFX_ByteString csKey;
- pObj = pFonts->GetNextElement(pos, csKey);
- if (pObj == NULL) {
- continue;
- }
- CPDF_Object* pDirect = pObj->GetDirect();
- if (pDirect == NULL || pDirect->GetType() != PDFOBJ_DICTIONARY) {
- continue;
- }
- CPDF_Dictionary* pElement = (CPDF_Dictionary*)pDirect;
- if (pElement->GetString("Type") != "Font") {
- continue;
- }
- CPDF_Font* pFind = pDocument->LoadFont(pElement);
- if (pFind == NULL) {
- continue;
- }
- CFX_SubstFont* pSubst = (CFX_SubstFont*)pFind->GetSubstFont();
- if (pSubst == NULL) {
- continue;
- }
- if (pSubst->m_Charset == (int)charSet) {
- csNameTag = csKey;
- return pFind;
- }
- }
- return NULL;
-}
-CPDF_Font* GetNativeInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, CFX_ByteString& csNameTag)
-{
- csNameTag = "";
- FX_BYTE charSet = CPDF_InterForm::GetNativeCharSet();
- CFX_SubstFont* pSubst;
- CPDF_Font* pFont = GetDefaultInterFormFont(pFormDict, pDocument);
- if (pFont != NULL) {
- pSubst = (CFX_SubstFont*)pFont->GetSubstFont();
- if (pSubst != NULL && pSubst->m_Charset == (int)charSet) {
- FindInterFormFont(pFormDict, pFont, csNameTag);
- return pFont;
- }
- }
- return GetNativeInterFormFont(pFormDict, pDocument, charSet, csNameTag);
-}
-FX_BOOL FindInterFormFont(CPDF_Dictionary* pFormDict, const CPDF_Font* pFont, CFX_ByteString& csNameTag)
-{
- if (pFormDict == NULL || pFont == NULL) {
- return FALSE;
- }
- CPDF_Dictionary* pDR = pFormDict->GetDict("DR");
- if (pDR == NULL) {
- return FALSE;
- }
- CPDF_Dictionary* pFonts = pDR->GetDict("Font");
- if (pFonts == NULL) {
- return FALSE;
- }
- FX_POSITION pos = pFonts->GetStartPos();
- while (pos) {
- CPDF_Object* pObj = NULL;
- CFX_ByteString csKey;
- pObj = pFonts->GetNextElement(pos, csKey);
- if (pObj == NULL) {
- continue;
- }
- CPDF_Object* pDirect = pObj->GetDirect();
- if (pDirect == NULL || pDirect->GetType() != PDFOBJ_DICTIONARY) {
- continue;
- }
- CPDF_Dictionary* pElement = (CPDF_Dictionary*)pDirect;
- if (pElement->GetString("Type") != "Font") {
- continue;
- }
- if (pFont->GetFontDict() == pElement) {
- csNameTag = csKey;
- return TRUE;
- }
- }
- return FALSE;
-}
-FX_BOOL FindInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, CFX_ByteString csFontName, CPDF_Font*& pFont, CFX_ByteString& csNameTag)
-{
- if (pFormDict == NULL) {
- return FALSE;
- }
- CPDF_Dictionary* pDR = pFormDict->GetDict("DR");
- if (pDR == NULL) {
- return FALSE;
- }
- CPDF_Dictionary* pFonts = pDR->GetDict("Font");
- if (pFonts == NULL) {
- return FALSE;
- }
- if (csFontName.GetLength() > 0) {
- csFontName.Remove(' ');
- }
- FX_POSITION pos = pFonts->GetStartPos();
- while (pos) {
- CPDF_Object* pObj = NULL;
- CFX_ByteString csKey, csTmp;
- pObj = pFonts->GetNextElement(pos, csKey);
- if (pObj == NULL) {
- continue;
- }
- CPDF_Object* pDirect = pObj->GetDirect();
- if (pDirect == NULL || pDirect->GetType() != PDFOBJ_DICTIONARY) {
- continue;
- }
- CPDF_Dictionary* pElement = (CPDF_Dictionary*)pDirect;
- if (pElement->GetString("Type") != "Font") {
- continue;
- }
- pFont = pDocument->LoadFont(pElement);
- if (pFont == NULL) {
- continue;
- }
- CFX_ByteString csBaseFont;
- csBaseFont = pFont->GetBaseFont();
- csBaseFont.Remove(' ');
- if (csBaseFont == csFontName) {
- csNameTag = csKey;
- return TRUE;
- }
- }
- return FALSE;
-}
-void AddInterFormFont(CPDF_Dictionary*& pFormDict, CPDF_Document* pDocument, const CPDF_Font* pFont, CFX_ByteString& csNameTag)
-{
- if (pFont == NULL) {
- return;
- }
- if (pFormDict == NULL) {
- InitInterFormDict(pFormDict, pDocument);
- }
- CFX_ByteString csTag;
- if (FindInterFormFont(pFormDict, pFont, csTag)) {
- csNameTag = csTag;
- return;
- }
- if (pFormDict == NULL) {
- InitInterFormDict(pFormDict, pDocument);
- }
- CPDF_Dictionary* pDR = pFormDict->GetDict("DR");
- if (pDR == NULL) {
- pDR = CPDF_Dictionary::Create();
- if (pDR == NULL) {
- return;
- }
- pFormDict->SetAt("DR", pDR);
- }
- CPDF_Dictionary* pFonts = pDR->GetDict("Font");
- if (pFonts == NULL) {
- pFonts = CPDF_Dictionary::Create();
- pDR->SetAt("Font", pFonts);
- }
- if (csNameTag.IsEmpty()) {
- csNameTag = pFont->GetBaseFont();
- }
- csNameTag.Remove(' ');
- csNameTag = CPDF_InterForm::GenerateNewResourceName(pDR, "Font", 4, csNameTag);
- pFonts->SetAtReference(csNameTag, pDocument, pFont->GetFontDict());
-}
-CPDF_Font* AddNativeInterFormFont(CPDF_Dictionary*& pFormDict, CPDF_Document* pDocument, FX_BYTE charSet, CFX_ByteString& csNameTag)
-{
- if (pFormDict == NULL) {
- InitInterFormDict(pFormDict, pDocument);
- }
- CFX_ByteString csTemp;
- CPDF_Font* pFont = GetNativeInterFormFont(pFormDict, pDocument, charSet, csTemp);
- if (pFont != NULL) {
- csNameTag = csTemp;
- return pFont;
- }
- CFX_ByteString csFontName = CPDF_InterForm::GetNativeFont(charSet);
- if (!csFontName.IsEmpty()) {
- if (FindInterFormFont(pFormDict, pDocument, csFontName, pFont, csNameTag)) {
- return pFont;
- }
- }
- pFont = CPDF_InterForm::AddNativeFont(charSet, pDocument);
- if (pFont != NULL) {
- AddInterFormFont(pFormDict, pDocument, pFont, csNameTag);
- }
- return pFont;
-}
-CPDF_Font* AddNativeInterFormFont(CPDF_Dictionary*& pFormDict, CPDF_Document* pDocument, CFX_ByteString& csNameTag)
-{
- FX_BYTE charSet = CPDF_InterForm::GetNativeCharSet();
- return AddNativeInterFormFont(pFormDict, pDocument, charSet, csNameTag);
-}
-void RemoveInterFormFont(CPDF_Dictionary* pFormDict, const CPDF_Font* pFont)
-{
- if (pFormDict == NULL || pFont == NULL) {
- return;
- }
- CFX_ByteString csTag;
- if (!FindInterFormFont(pFormDict, pFont, csTag)) {
- return;
- }
- CPDF_Dictionary* pDR = pFormDict->GetDict("DR");
- CPDF_Dictionary* pFonts = pDR->GetDict("Font");
- pFonts->RemoveAt(csTag);
-}
-void RemoveInterFormFont(CPDF_Dictionary* pFormDict, CFX_ByteString csNameTag)
-{
- if (pFormDict == NULL || csNameTag.IsEmpty()) {
- return;
- }
- CPDF_Dictionary* pDR = pFormDict->GetDict("DR");
- if (pDR == NULL) {
- return;
- }
- CPDF_Dictionary* pFonts = pDR->GetDict("Font");
- if (pFonts == NULL) {
- return;
- }
- pFonts->RemoveAt(csNameTag);
-}
-CPDF_Font* GetDefaultInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument)
-{
- if (pFormDict == NULL) {
- return NULL;
- }
- CPDF_DefaultAppearance cDA = pFormDict->GetString("DA");
- CFX_ByteString csFontNameTag;
- FX_FLOAT fFontSize;
- cDA.GetFont(csFontNameTag, fFontSize);
- return GetInterFormFont(pFormDict, pDocument, csFontNameTag);
-}
-CPDF_IconFit::ScaleMethod CPDF_IconFit::GetScaleMethod()
-{
- if (m_pDict == NULL) {
- return Always;
- }
- CFX_ByteString csSW = m_pDict->GetString("SW", "A");
- if (csSW == "B") {
- return Bigger;
- } else if (csSW == "S") {
- return Smaller;
- } else if (csSW == "N") {
- return Never;
- }
- return Always;
-}
-FX_BOOL CPDF_IconFit::IsProportionalScale()
-{
- if (m_pDict == NULL) {
- return TRUE;
- }
- return m_pDict->GetString("S", "P") != "A";
-}
-void CPDF_IconFit::GetIconPosition(FX_FLOAT& fLeft, FX_FLOAT& fBottom)
-{
- fLeft = fBottom = 0.5;
- if (m_pDict == NULL) {
- return;
- }
- CPDF_Array* pA = m_pDict->GetArray("A");
- if (pA != NULL) {
- FX_DWORD dwCount = pA->GetCount();
- if (dwCount > 0) {
- fLeft = pA->GetNumber(0);
- }
- if (dwCount > 1) {
- fBottom = pA->GetNumber(1);
- }
- }
-}
-FX_BOOL CPDF_IconFit::GetFittingBounds()
-{
- if (m_pDict == NULL) {
- return FALSE;
- }
- return m_pDict->GetBoolean("FB");
-}
-void SaveCheckedFieldStatus(CPDF_FormField* pField, CFX_ByteArray& statusArray)
-{
- int iCount = pField->CountControls();
- for (int i = 0; i < iCount; i ++) {
- CPDF_FormControl* pControl = pField->GetControl(i);
- if (pControl == NULL) {
- continue;
- }
- statusArray.Add(pControl->IsChecked() ? 1 : 0);
- }
-}
-CPDF_Object* FPDF_GetFieldAttr(CPDF_Dictionary* pFieldDict, const FX_CHAR* name, int nLevel)
-{
- if (nLevel > FPDFDOC_UTILS_MAXRECURSION) {
- return NULL;
- }
- if (pFieldDict == NULL) {
- return NULL;
- }
- CPDF_Object* pAttr = pFieldDict->GetElementValue(name);
- if (pAttr) {
- return pAttr;
- }
- CPDF_Dictionary* pParent = pFieldDict->GetDict("Parent");
- if (pParent == NULL) {
- return NULL;
- }
- return FPDF_GetFieldAttr(pParent, name, nLevel + 1);
-}
+// 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
+
+#include "../../include/fpdfdoc/fpdf_doc.h"
+static const int FPDFDOC_UTILS_MAXRECURSION = 32;
+CFX_WideString GetFullName(CPDF_Dictionary* pFieldDict);
+void InitInterFormDict(CPDF_Dictionary*& pFormDict, CPDF_Document* pDocument);
+FX_DWORD CountInterFormFonts(CPDF_Dictionary* pFormDict);
+CPDF_Font* GetInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, FX_DWORD index, CFX_ByteString& csNameTag);
+CPDF_Font* GetInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, CFX_ByteString csNameTag);
+CPDF_Font* GetInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, CFX_ByteString csFontName, CFX_ByteString& csNameTag);
+CPDF_Font* GetNativeInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, FX_BYTE charSet, CFX_ByteString& csNameTag);
+CPDF_Font* GetNativeInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, CFX_ByteString& csNameTag);
+FX_BOOL FindInterFormFont(CPDF_Dictionary* pFormDict, const CPDF_Font* pFont, CFX_ByteString& csNameTag);
+FX_BOOL FindInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, CFX_ByteString csFontName, CPDF_Font*& pFont, CFX_ByteString& csNameTag);
+void AddInterFormFont(CPDF_Dictionary*& pFormDict, CPDF_Document* pDocument, const CPDF_Font* pFont, CFX_ByteString& csNameTag);
+CPDF_Font* AddNativeInterFormFont(CPDF_Dictionary*& pFormDict, CPDF_Document* pDocument, FX_BYTE charSet, CFX_ByteString& csNameTag);
+CPDF_Font* AddNativeInterFormFont(CPDF_Dictionary*& pFormDict, CPDF_Document* pDocument, CFX_ByteString& csNameTag);
+void RemoveInterFormFont(CPDF_Dictionary* pFormDict, const CPDF_Font* pFont);
+void RemoveInterFormFont(CPDF_Dictionary* pFormDict, CFX_ByteString csNameTag);
+CPDF_Font* GetDefaultInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument);
+void SetDefaultInterFormFont(CPDF_Dictionary*& pFormDict, CPDF_Document* pDocument, const CPDF_Font* pFont);
+void SaveCheckedFieldStatus(CPDF_FormField* pField, CFX_ByteArray& statusArray);
+FX_BOOL NeedPDFEncodeForFieldFullName(const CFX_WideString& csFieldName);
+FX_BOOL NeedPDFEncodeForFieldTree(CPDF_Dictionary* pFieldDict, int nLevel = 0);
+void EncodeFieldName(const CFX_WideString& csName, CFX_ByteString& csT);
+void UpdateEncodeFieldName(CPDF_Dictionary* pFieldDict, int nLevel = 0);
+CFX_WideString GetFullName(CPDF_Dictionary* pFieldDict)
+{
+ CFX_WideString full_name;
+ CPDF_Dictionary* pLevel = pFieldDict;
+ while (pLevel) {
+ CFX_WideString short_name = pLevel->GetUnicodeText("T");
+ if (short_name != L"") {
+ if (full_name == L"") {
+ full_name = short_name;
+ } else {
+ full_name = short_name + L"." + full_name;
+ }
+ }
+ pLevel = pLevel->GetDict("Parent");
+ }
+ return full_name;
+}
+FX_BOOL CPDF_DefaultAppearance::HasFont()
+{
+ if (m_csDA.IsEmpty()) {
+ return FALSE;
+ }
+ CPDF_SimpleParser syntax(m_csDA);
+ return syntax.FindTagParam("Tf", 2);
+}
+CFX_ByteString CPDF_DefaultAppearance::GetFontString()
+{
+ CFX_ByteString csFont;
+ if (m_csDA.IsEmpty()) {
+ return csFont;
+ }
+ CPDF_SimpleParser syntax(m_csDA);
+ if (syntax.FindTagParam("Tf", 2)) {
+ csFont += (CFX_ByteString)syntax.GetWord();
+ csFont += " ";
+ csFont += (CFX_ByteString)syntax.GetWord();
+ csFont += " ";
+ csFont += (CFX_ByteString)syntax.GetWord();
+ }
+ return csFont;
+}
+void CPDF_DefaultAppearance::GetFont(CFX_ByteString& csFontNameTag, FX_FLOAT& fFontSize)
+{
+ csFontNameTag = "";
+ fFontSize = 0;
+ if (m_csDA.IsEmpty()) {
+ return;
+ }
+ CPDF_SimpleParser syntax(m_csDA);
+ if (syntax.FindTagParam("Tf", 2)) {
+ csFontNameTag = (CFX_ByteString)syntax.GetWord();
+ csFontNameTag.Delete(0, 1);
+ fFontSize = FX_atof((CFX_ByteString)syntax.GetWord());
+ }
+ csFontNameTag = PDF_NameDecode(csFontNameTag);
+}
+FX_BOOL CPDF_DefaultAppearance::HasColor(FX_BOOL bStrokingOperation)
+{
+ if (m_csDA.IsEmpty()) {
+ return FALSE;
+ }
+ CPDF_SimpleParser syntax(m_csDA);
+ if (syntax.FindTagParam(bStrokingOperation ? "G" : "g", 1)) {
+ return TRUE;
+ }
+ syntax.SetPos(0);
+ if (syntax.FindTagParam(bStrokingOperation ? "RG" : "rg", 3)) {
+ return TRUE;
+ }
+ syntax.SetPos(0);
+ return syntax.FindTagParam(bStrokingOperation ? "K" : "k", 4);
+}
+CFX_ByteString CPDF_DefaultAppearance::GetColorString(FX_BOOL bStrokingOperation)
+{
+ CFX_ByteString csColor;
+ if (m_csDA.IsEmpty()) {
+ return csColor;
+ }
+ CPDF_SimpleParser syntax(m_csDA);
+ if (syntax.FindTagParam(bStrokingOperation ? "G" : "g", 1)) {
+ csColor += (CFX_ByteString)syntax.GetWord();
+ csColor += " ";
+ csColor += (CFX_ByteString)syntax.GetWord();
+ return csColor;
+ }
+ syntax.SetPos(0);
+ if (syntax.FindTagParam(bStrokingOperation ? "RG" : "rg", 3)) {
+ csColor += (CFX_ByteString)syntax.GetWord();
+ csColor += " ";
+ csColor += (CFX_ByteString)syntax.GetWord();
+ csColor += " ";
+ csColor += (CFX_ByteString)syntax.GetWord();
+ csColor += " ";
+ csColor += (CFX_ByteString)syntax.GetWord();
+ return csColor;
+ }
+ syntax.SetPos(0);
+ if (syntax.FindTagParam(bStrokingOperation ? "K" : "k", 4)) {
+ csColor += (CFX_ByteString)syntax.GetWord();
+ csColor += " ";
+ csColor += (CFX_ByteString)syntax.GetWord();
+ csColor += " ";
+ csColor += (CFX_ByteString)syntax.GetWord();
+ csColor += " ";
+ csColor += (CFX_ByteString)syntax.GetWord();
+ csColor += " ";
+ csColor += (CFX_ByteString)syntax.GetWord();
+ }
+ return csColor;
+}
+void CPDF_DefaultAppearance::GetColor(int& iColorType, FX_FLOAT fc[4], FX_BOOL bStrokingOperation)
+{
+ iColorType = COLORTYPE_TRANSPARENT;
+ for (int c = 0; c < 4; c ++) {
+ fc[c] = 0;
+ }
+ if (m_csDA.IsEmpty()) {
+ return;
+ }
+ CPDF_SimpleParser syntax(m_csDA);
+ if (syntax.FindTagParam(bStrokingOperation ? "G" : "g", 1)) {
+ iColorType = COLORTYPE_GRAY;
+ fc[0] = FX_atof((CFX_ByteString)syntax.GetWord());
+ return;
+ }
+ syntax.SetPos(0);
+ if (syntax.FindTagParam(bStrokingOperation ? "RG" : "rg", 3)) {
+ iColorType = COLORTYPE_RGB;
+ fc[0] = FX_atof((CFX_ByteString)syntax.GetWord());
+ fc[1] = FX_atof((CFX_ByteString)syntax.GetWord());
+ fc[2] = FX_atof((CFX_ByteString)syntax.GetWord());
+ return;
+ }
+ syntax.SetPos(0);
+ if (syntax.FindTagParam(bStrokingOperation ? "K" : "k", 4)) {
+ iColorType = COLORTYPE_CMYK;
+ fc[0] = FX_atof((CFX_ByteString)syntax.GetWord());
+ fc[1] = FX_atof((CFX_ByteString)syntax.GetWord());
+ fc[2] = FX_atof((CFX_ByteString)syntax.GetWord());
+ fc[3] = FX_atof((CFX_ByteString)syntax.GetWord());
+ }
+}
+void CPDF_DefaultAppearance::GetColor(FX_ARGB& color, int& iColorType, FX_BOOL bStrokingOperation)
+{
+ color = 0;
+ iColorType = COLORTYPE_TRANSPARENT;
+ if (m_csDA.IsEmpty()) {
+ return;
+ }
+ CPDF_SimpleParser syntax(m_csDA);
+ if (syntax.FindTagParam(bStrokingOperation ? "G" : "g", 1)) {
+ iColorType = COLORTYPE_GRAY;
+ FX_FLOAT g = FX_atof((CFX_ByteString)syntax.GetWord()) * 255 + 0.5f;
+ color = ArgbEncode(255, (int)g, (int)g, (int)g);
+ return;
+ }
+ syntax.SetPos(0);
+ if (syntax.FindTagParam(bStrokingOperation ? "RG" : "rg", 3)) {
+ iColorType = COLORTYPE_RGB;
+ FX_FLOAT r = FX_atof((CFX_ByteString)syntax.GetWord()) * 255 + 0.5f;
+ FX_FLOAT g = FX_atof((CFX_ByteString)syntax.GetWord()) * 255 + 0.5f;
+ FX_FLOAT b = FX_atof((CFX_ByteString)syntax.GetWord()) * 255 + 0.5f;
+ color = ArgbEncode(255, (int)r, (int)g, (int)b);
+ return;
+ }
+ syntax.SetPos(0);
+ if (syntax.FindTagParam(bStrokingOperation ? "K" : "k", 4)) {
+ iColorType = COLORTYPE_CMYK;
+ FX_FLOAT c = FX_atof((CFX_ByteString)syntax.GetWord());
+ FX_FLOAT m = FX_atof((CFX_ByteString)syntax.GetWord());
+ FX_FLOAT y = FX_atof((CFX_ByteString)syntax.GetWord());
+ FX_FLOAT k = FX_atof((CFX_ByteString)syntax.GetWord());
+ FX_FLOAT r = 1.0f - FX_MIN(1.0f, c + k);
+ FX_FLOAT g = 1.0f - FX_MIN(1.0f, m + k);
+ FX_FLOAT b = 1.0f - FX_MIN(1.0f, y + k);
+ color = ArgbEncode(255, (int)(r * 255 + 0.5f), (int)(g * 255 + 0.5f), (int)(b * 255 + 0.5f));
+ }
+}
+FX_BOOL CPDF_DefaultAppearance::HasTextMatrix()
+{
+ if (m_csDA.IsEmpty()) {
+ return FALSE;
+ }
+ CPDF_SimpleParser syntax(m_csDA);
+ return syntax.FindTagParam("Tm", 6);
+}
+CFX_ByteString CPDF_DefaultAppearance::GetTextMatrixString()
+{
+ CFX_ByteString csTM;
+ if (m_csDA.IsEmpty()) {
+ return csTM;
+ }
+ CPDF_SimpleParser syntax(m_csDA);
+ if (syntax.FindTagParam("Tm", 6)) {
+ for (int i = 0; i < 6; i ++) {
+ csTM += (CFX_ByteString)syntax.GetWord();
+ csTM += " ";
+ }
+ csTM += (CFX_ByteString)syntax.GetWord();
+ }
+ return csTM;
+}
+CFX_AffineMatrix CPDF_DefaultAppearance::GetTextMatrix()
+{
+ CFX_AffineMatrix tm;
+ if (m_csDA.IsEmpty()) {
+ return tm;
+ }
+ CPDF_SimpleParser syntax(m_csDA);
+ if (syntax.FindTagParam("Tm", 6)) {
+ FX_FLOAT f[6];
+ for (int i = 0; i < 6; i ++) {
+ f[i] = FX_atof((CFX_ByteString)syntax.GetWord());
+ }
+ tm.Set(f[0], f[1], f[2], f[3], f[4], f[5]);
+ }
+ return tm;
+}
+void InitInterFormDict(CPDF_Dictionary*& pFormDict, CPDF_Document* pDocument)
+{
+ if (pDocument == NULL) {
+ return;
+ }
+ if (pFormDict == NULL) {
+ pFormDict = CPDF_Dictionary::Create();
+ if (pFormDict == NULL) {
+ return;
+ }
+ FX_DWORD dwObjNum = pDocument->AddIndirectObject(pFormDict);
+ CPDF_Dictionary* pRoot = pDocument->GetRoot();
+ pRoot->SetAtReference("AcroForm", pDocument, dwObjNum);
+ }
+ CFX_ByteString csDA;
+ if (!pFormDict->KeyExist("DR")) {
+ CPDF_Font* pFont = NULL;
+ CFX_ByteString csBaseName, csDefault;
+ FX_BYTE charSet = CPDF_InterForm::GetNativeCharSet();
+ pFont = CPDF_InterForm::AddStandardFont(pDocument, "Helvetica");
+ if (pFont != NULL) {
+ AddInterFormFont(pFormDict, pDocument, pFont, csBaseName);
+ csDefault = csBaseName;
+ }
+ if (charSet != 0) {
+ CFX_ByteString csFontName = CPDF_InterForm::GetNativeFont(charSet, NULL);
+ if (pFont == NULL || csFontName != "Helvetica") {
+ pFont = CPDF_InterForm::AddNativeFont(pDocument);
+ if (pFont != NULL) {
+ csBaseName = "";
+ AddInterFormFont(pFormDict, pDocument, pFont, csBaseName);
+ csDefault = csBaseName;
+ }
+ }
+ }
+ if (pFont != NULL) {
+ csDA = "/" + PDF_NameEncode(csDefault) + " 0 Tf";
+ }
+ }
+ if (!csDA.IsEmpty()) {
+ csDA += " ";
+ }
+ csDA += "0 g";
+ if (!pFormDict->KeyExist("DA")) {
+ pFormDict->SetAtString("DA", csDA);
+ }
+}
+FX_DWORD CountInterFormFonts(CPDF_Dictionary* pFormDict)
+{
+ if (pFormDict == NULL) {
+ return 0;
+ }
+ CPDF_Dictionary* pDR = pFormDict->GetDict("DR");
+ if (pDR == NULL) {
+ return 0;
+ }
+ CPDF_Dictionary* pFonts = pDR->GetDict("Font");
+ if (pFonts == NULL) {
+ return 0;
+ }
+ FX_DWORD dwCount = 0;
+ FX_POSITION pos = pFonts->GetStartPos();
+ while (pos) {
+ CPDF_Object* pObj = NULL;
+ CFX_ByteString csKey;
+ pObj = pFonts->GetNextElement(pos, csKey);
+ if (pObj == NULL) {
+ continue;
+ }
+ CPDF_Object* pDirect = pObj->GetDirect();
+ if (pDirect != NULL && pDirect->GetType() == PDFOBJ_DICTIONARY) {
+ if (((CPDF_Dictionary*)pDirect)->GetString("Type") == "Font") {
+ dwCount ++;
+ }
+ }
+ }
+ return dwCount;
+}
+CPDF_Font* GetInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, FX_DWORD index, CFX_ByteString& csNameTag)
+{
+ if (pFormDict == NULL) {
+ return NULL;
+ }
+ CPDF_Dictionary* pDR = pFormDict->GetDict("DR");
+ if (pDR == NULL) {
+ return NULL;
+ }
+ CPDF_Dictionary* pFonts = pDR->GetDict("Font");
+ if (pFonts == NULL) {
+ return NULL;
+ }
+ FX_DWORD dwCount = 0;
+ FX_POSITION pos = pFonts->GetStartPos();
+ while (pos) {
+ CPDF_Object* pObj = NULL;
+ CFX_ByteString csKey;
+ pObj = pFonts->GetNextElement(pos, csKey);
+ if (pObj == NULL) {
+ continue;
+ }
+ CPDF_Object* pDirect = pObj->GetDirect();
+ if (pDirect == NULL || pDirect->GetType() != PDFOBJ_DICTIONARY) {
+ continue;
+ }
+ CPDF_Dictionary* pElement = (CPDF_Dictionary*)pDirect;
+ if (pElement->GetString("Type") != "Font") {
+ continue;
+ }
+ if (dwCount == index) {
+ csNameTag = csKey;
+ return pDocument->LoadFont(pElement);
+ }
+ dwCount ++;
+ }
+ return NULL;
+}
+CPDF_Font* GetInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, CFX_ByteString csNameTag)
+{
+ CFX_ByteString csAlias = PDF_NameDecode(csNameTag);
+ if (pFormDict == NULL || csAlias.IsEmpty()) {
+ return NULL;
+ }
+ CPDF_Dictionary* pDR = pFormDict->GetDict("DR");
+ if (pDR == NULL) {
+ return NULL;
+ }
+ CPDF_Dictionary* pFonts = pDR->GetDict("Font");
+ if (pFonts == NULL) {
+ return NULL;
+ }
+ CPDF_Dictionary* pElement = pFonts->GetDict(csAlias);
+ if (pElement == NULL) {
+ return NULL;
+ }
+ if (pElement->GetString("Type") == "Font") {
+ return pDocument->LoadFont(pElement);
+ }
+ return NULL;
+}
+CPDF_Font* GetInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, CFX_ByteString csFontName, CFX_ByteString& csNameTag)
+{
+ if (pFormDict == NULL || csFontName.IsEmpty()) {
+ return NULL;
+ }
+ CPDF_Dictionary* pDR = pFormDict->GetDict("DR");
+ if (pDR == NULL) {
+ return NULL;
+ }
+ CPDF_Dictionary* pFonts = pDR->GetDict("Font");
+ if (pFonts == NULL) {
+ return NULL;
+ }
+ FX_POSITION pos = pFonts->GetStartPos();
+ while (pos) {
+ CPDF_Object* pObj = NULL;
+ CFX_ByteString csKey;
+ pObj = pFonts->GetNextElement(pos, csKey);
+ if (pObj == NULL) {
+ continue;
+ }
+ CPDF_Object* pDirect = pObj->GetDirect();
+ if (pDirect == NULL || pDirect->GetType() != PDFOBJ_DICTIONARY) {
+ continue;
+ }
+ CPDF_Dictionary* pElement = (CPDF_Dictionary*)pDirect;
+ if (pElement->GetString("Type") != "Font") {
+ continue;
+ }
+ CPDF_Font* pFind = pDocument->LoadFont(pElement);
+ if (pFind == NULL) {
+ continue;
+ }
+ CFX_ByteString csBaseFont;
+ csBaseFont = pFind->GetBaseFont();
+ csBaseFont.Remove(' ');
+ if (csBaseFont == csFontName) {
+ csNameTag = csKey;
+ return pFind;
+ }
+ }
+ return NULL;
+}
+CPDF_Font* GetNativeInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, FX_BYTE charSet, CFX_ByteString& csNameTag)
+{
+ if (pFormDict == NULL) {
+ return NULL;
+ }
+ CPDF_Dictionary* pDR = pFormDict->GetDict("DR");
+ if (pDR == NULL) {
+ return NULL;
+ }
+ CPDF_Dictionary* pFonts = pDR->GetDict("Font");
+ if (pFonts == NULL) {
+ return NULL;
+ }
+ FX_POSITION pos = pFonts->GetStartPos();
+ while (pos) {
+ CPDF_Object* pObj = NULL;
+ CFX_ByteString csKey;
+ pObj = pFonts->GetNextElement(pos, csKey);
+ if (pObj == NULL) {
+ continue;
+ }
+ CPDF_Object* pDirect = pObj->GetDirect();
+ if (pDirect == NULL || pDirect->GetType() != PDFOBJ_DICTIONARY) {
+ continue;
+ }
+ CPDF_Dictionary* pElement = (CPDF_Dictionary*)pDirect;
+ if (pElement->GetString("Type") != "Font") {
+ continue;
+ }
+ CPDF_Font* pFind = pDocument->LoadFont(pElement);
+ if (pFind == NULL) {
+ continue;
+ }
+ CFX_SubstFont* pSubst = (CFX_SubstFont*)pFind->GetSubstFont();
+ if (pSubst == NULL) {
+ continue;
+ }
+ if (pSubst->m_Charset == (int)charSet) {
+ csNameTag = csKey;
+ return pFind;
+ }
+ }
+ return NULL;
+}
+CPDF_Font* GetNativeInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, CFX_ByteString& csNameTag)
+{
+ csNameTag = "";
+ FX_BYTE charSet = CPDF_InterForm::GetNativeCharSet();
+ CFX_SubstFont* pSubst;
+ CPDF_Font* pFont = GetDefaultInterFormFont(pFormDict, pDocument);
+ if (pFont != NULL) {
+ pSubst = (CFX_SubstFont*)pFont->GetSubstFont();
+ if (pSubst != NULL && pSubst->m_Charset == (int)charSet) {
+ FindInterFormFont(pFormDict, pFont, csNameTag);
+ return pFont;
+ }
+ }
+ return GetNativeInterFormFont(pFormDict, pDocument, charSet, csNameTag);
+}
+FX_BOOL FindInterFormFont(CPDF_Dictionary* pFormDict, const CPDF_Font* pFont, CFX_ByteString& csNameTag)
+{
+ if (pFormDict == NULL || pFont == NULL) {
+ return FALSE;
+ }
+ CPDF_Dictionary* pDR = pFormDict->GetDict("DR");
+ if (pDR == NULL) {
+ return FALSE;
+ }
+ CPDF_Dictionary* pFonts = pDR->GetDict("Font");
+ if (pFonts == NULL) {
+ return FALSE;
+ }
+ FX_POSITION pos = pFonts->GetStartPos();
+ while (pos) {
+ CPDF_Object* pObj = NULL;
+ CFX_ByteString csKey;
+ pObj = pFonts->GetNextElement(pos, csKey);
+ if (pObj == NULL) {
+ continue;
+ }
+ CPDF_Object* pDirect = pObj->GetDirect();
+ if (pDirect == NULL || pDirect->GetType() != PDFOBJ_DICTIONARY) {
+ continue;
+ }
+ CPDF_Dictionary* pElement = (CPDF_Dictionary*)pDirect;
+ if (pElement->GetString("Type") != "Font") {
+ continue;
+ }
+ if (pFont->GetFontDict() == pElement) {
+ csNameTag = csKey;
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+FX_BOOL FindInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument, CFX_ByteString csFontName, CPDF_Font*& pFont, CFX_ByteString& csNameTag)
+{
+ if (pFormDict == NULL) {
+ return FALSE;
+ }
+ CPDF_Dictionary* pDR = pFormDict->GetDict("DR");
+ if (pDR == NULL) {
+ return FALSE;
+ }
+ CPDF_Dictionary* pFonts = pDR->GetDict("Font");
+ if (pFonts == NULL) {
+ return FALSE;
+ }
+ if (csFontName.GetLength() > 0) {
+ csFontName.Remove(' ');
+ }
+ FX_POSITION pos = pFonts->GetStartPos();
+ while (pos) {
+ CPDF_Object* pObj = NULL;
+ CFX_ByteString csKey, csTmp;
+ pObj = pFonts->GetNextElement(pos, csKey);
+ if (pObj == NULL) {
+ continue;
+ }
+ CPDF_Object* pDirect = pObj->GetDirect();
+ if (pDirect == NULL || pDirect->GetType() != PDFOBJ_DICTIONARY) {
+ continue;
+ }
+ CPDF_Dictionary* pElement = (CPDF_Dictionary*)pDirect;
+ if (pElement->GetString("Type") != "Font") {
+ continue;
+ }
+ pFont = pDocument->LoadFont(pElement);
+ if (pFont == NULL) {
+ continue;
+ }
+ CFX_ByteString csBaseFont;
+ csBaseFont = pFont->GetBaseFont();
+ csBaseFont.Remove(' ');
+ if (csBaseFont == csFontName) {
+ csNameTag = csKey;
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+void AddInterFormFont(CPDF_Dictionary*& pFormDict, CPDF_Document* pDocument, const CPDF_Font* pFont, CFX_ByteString& csNameTag)
+{
+ if (pFont == NULL) {
+ return;
+ }
+ if (pFormDict == NULL) {
+ InitInterFormDict(pFormDict, pDocument);
+ }
+ CFX_ByteString csTag;
+ if (FindInterFormFont(pFormDict, pFont, csTag)) {
+ csNameTag = csTag;
+ return;
+ }
+ if (pFormDict == NULL) {
+ InitInterFormDict(pFormDict, pDocument);
+ }
+ CPDF_Dictionary* pDR = pFormDict->GetDict("DR");
+ if (pDR == NULL) {
+ pDR = CPDF_Dictionary::Create();
+ if (pDR == NULL) {
+ return;
+ }
+ pFormDict->SetAt("DR", pDR);
+ }
+ CPDF_Dictionary* pFonts = pDR->GetDict("Font");
+ if (pFonts == NULL) {
+ pFonts = CPDF_Dictionary::Create();
+ pDR->SetAt("Font", pFonts);
+ }
+ if (csNameTag.IsEmpty()) {
+ csNameTag = pFont->GetBaseFont();
+ }
+ csNameTag.Remove(' ');
+ csNameTag = CPDF_InterForm::GenerateNewResourceName(pDR, "Font", 4, csNameTag);
+ pFonts->SetAtReference(csNameTag, pDocument, pFont->GetFontDict());
+}
+CPDF_Font* AddNativeInterFormFont(CPDF_Dictionary*& pFormDict, CPDF_Document* pDocument, FX_BYTE charSet, CFX_ByteString& csNameTag)
+{
+ if (pFormDict == NULL) {
+ InitInterFormDict(pFormDict, pDocument);
+ }
+ CFX_ByteString csTemp;
+ CPDF_Font* pFont = GetNativeInterFormFont(pFormDict, pDocument, charSet, csTemp);
+ if (pFont != NULL) {
+ csNameTag = csTemp;
+ return pFont;
+ }
+ CFX_ByteString csFontName = CPDF_InterForm::GetNativeFont(charSet);
+ if (!csFontName.IsEmpty()) {
+ if (FindInterFormFont(pFormDict, pDocument, csFontName, pFont, csNameTag)) {
+ return pFont;
+ }
+ }
+ pFont = CPDF_InterForm::AddNativeFont(charSet, pDocument);
+ if (pFont != NULL) {
+ AddInterFormFont(pFormDict, pDocument, pFont, csNameTag);
+ }
+ return pFont;
+}
+CPDF_Font* AddNativeInterFormFont(CPDF_Dictionary*& pFormDict, CPDF_Document* pDocument, CFX_ByteString& csNameTag)
+{
+ FX_BYTE charSet = CPDF_InterForm::GetNativeCharSet();
+ return AddNativeInterFormFont(pFormDict, pDocument, charSet, csNameTag);
+}
+void RemoveInterFormFont(CPDF_Dictionary* pFormDict, const CPDF_Font* pFont)
+{
+ if (pFormDict == NULL || pFont == NULL) {
+ return;
+ }
+ CFX_ByteString csTag;
+ if (!FindInterFormFont(pFormDict, pFont, csTag)) {
+ return;
+ }
+ CPDF_Dictionary* pDR = pFormDict->GetDict("DR");
+ CPDF_Dictionary* pFonts = pDR->GetDict("Font");
+ pFonts->RemoveAt(csTag);
+}
+void RemoveInterFormFont(CPDF_Dictionary* pFormDict, CFX_ByteString csNameTag)
+{
+ if (pFormDict == NULL || csNameTag.IsEmpty()) {
+ return;
+ }
+ CPDF_Dictionary* pDR = pFormDict->GetDict("DR");
+ if (pDR == NULL) {
+ return;
+ }
+ CPDF_Dictionary* pFonts = pDR->GetDict("Font");
+ if (pFonts == NULL) {
+ return;
+ }
+ pFonts->RemoveAt(csNameTag);
+}
+CPDF_Font* GetDefaultInterFormFont(CPDF_Dictionary* pFormDict, CPDF_Document* pDocument)
+{
+ if (pFormDict == NULL) {
+ return NULL;
+ }
+ CPDF_DefaultAppearance cDA = pFormDict->GetString("DA");
+ CFX_ByteString csFontNameTag;
+ FX_FLOAT fFontSize;
+ cDA.GetFont(csFontNameTag, fFontSize);
+ return GetInterFormFont(pFormDict, pDocument, csFontNameTag);
+}
+CPDF_IconFit::ScaleMethod CPDF_IconFit::GetScaleMethod()
+{
+ if (m_pDict == NULL) {
+ return Always;
+ }
+ CFX_ByteString csSW = m_pDict->GetString("SW", "A");
+ if (csSW == "B") {
+ return Bigger;
+ } else if (csSW == "S") {
+ return Smaller;
+ } else if (csSW == "N") {
+ return Never;
+ }
+ return Always;
+}
+FX_BOOL CPDF_IconFit::IsProportionalScale()
+{
+ if (m_pDict == NULL) {
+ return TRUE;
+ }
+ return m_pDict->GetString("S", "P") != "A";
+}
+void CPDF_IconFit::GetIconPosition(FX_FLOAT& fLeft, FX_FLOAT& fBottom)
+{
+ fLeft = fBottom = 0.5;
+ if (m_pDict == NULL) {
+ return;
+ }
+ CPDF_Array* pA = m_pDict->GetArray("A");
+ if (pA != NULL) {
+ FX_DWORD dwCount = pA->GetCount();
+ if (dwCount > 0) {
+ fLeft = pA->GetNumber(0);
+ }
+ if (dwCount > 1) {
+ fBottom = pA->GetNumber(1);
+ }
+ }
+}
+FX_BOOL CPDF_IconFit::GetFittingBounds()
+{
+ if (m_pDict == NULL) {
+ return FALSE;
+ }
+ return m_pDict->GetBoolean("FB");
+}
+void SaveCheckedFieldStatus(CPDF_FormField* pField, CFX_ByteArray& statusArray)
+{
+ int iCount = pField->CountControls();
+ for (int i = 0; i < iCount; i ++) {
+ CPDF_FormControl* pControl = pField->GetControl(i);
+ if (pControl == NULL) {
+ continue;
+ }
+ statusArray.Add(pControl->IsChecked() ? 1 : 0);
+ }
+}
+CPDF_Object* FPDF_GetFieldAttr(CPDF_Dictionary* pFieldDict, const FX_CHAR* name, int nLevel)
+{
+ if (nLevel > FPDFDOC_UTILS_MAXRECURSION) {
+ return NULL;
+ }
+ if (pFieldDict == NULL) {
+ return NULL;
+ }
+ CPDF_Object* pAttr = pFieldDict->GetElementValue(name);
+ if (pAttr) {
+ return pAttr;
+ }
+ CPDF_Dictionary* pParent = pFieldDict->GetDict("Parent");
+ if (pParent == NULL) {
+ return NULL;
+ }
+ return FPDF_GetFieldAttr(pParent, name, nLevel + 1);
+}
diff --git a/core/src/fpdfdoc/doc_viewerPreferences.cpp b/core/src/fpdfdoc/doc_viewerPreferences.cpp
index 80af0b50fd..617485cfc2 100644
--- a/core/src/fpdfdoc/doc_viewerPreferences.cpp
+++ b/core/src/fpdfdoc/doc_viewerPreferences.cpp
@@ -1,31 +1,31 @@
-// 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
-
-#include "../../include/fpdfdoc/fpdf_doc.h"
-CPDF_ViewerPreferences::CPDF_ViewerPreferences(CPDF_Document *pDoc): m_pDoc(pDoc)
-{
-}
-CPDF_ViewerPreferences::~CPDF_ViewerPreferences()
-{
-}
-FX_BOOL CPDF_ViewerPreferences::IsDirectionR2L() const
-{
- CPDF_Dictionary *pDict = m_pDoc->GetRoot();
- pDict = pDict->GetDict(FX_BSTRC("ViewerPreferences"));
- if (!pDict) {
- return FALSE;
- }
- return FX_BSTRC("R2L") == pDict->GetString(FX_BSTRC("Direction"));
-}
-FX_BOOL CPDF_ViewerPreferences::PrintScaling() const
-{
- CPDF_Dictionary *pDict = m_pDoc->GetRoot();
- pDict = pDict->GetDict(FX_BSTRC("ViewerPreferences"));
- if (!pDict) {
- return TRUE;
- }
- return FX_BSTRC("None") != pDict->GetString(FX_BSTRC("PrintScaling"));
-}
+// 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
+
+#include "../../include/fpdfdoc/fpdf_doc.h"
+CPDF_ViewerPreferences::CPDF_ViewerPreferences(CPDF_Document *pDoc): m_pDoc(pDoc)
+{
+}
+CPDF_ViewerPreferences::~CPDF_ViewerPreferences()
+{
+}
+FX_BOOL CPDF_ViewerPreferences::IsDirectionR2L() const
+{
+ CPDF_Dictionary *pDict = m_pDoc->GetRoot();
+ pDict = pDict->GetDict(FX_BSTRC("ViewerPreferences"));
+ if (!pDict) {
+ return FALSE;
+ }
+ return FX_BSTRC("R2L") == pDict->GetString(FX_BSTRC("Direction"));
+}
+FX_BOOL CPDF_ViewerPreferences::PrintScaling() const
+{
+ CPDF_Dictionary *pDict = m_pDoc->GetRoot();
+ pDict = pDict->GetDict(FX_BSTRC("ViewerPreferences"));
+ if (!pDict) {
+ return TRUE;
+ }
+ return FX_BSTRC("None") != pDict->GetString(FX_BSTRC("PrintScaling"));
+}
diff --git a/core/src/fpdfdoc/doc_vt.cpp b/core/src/fpdfdoc/doc_vt.cpp
index 251173da22..9de9ffd426 100644
--- a/core/src/fpdfdoc/doc_vt.cpp
+++ b/core/src/fpdfdoc/doc_vt.cpp
@@ -1,1864 +1,1864 @@
-// 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
-
-#include "../../include/fpdfdoc/fpdf_doc.h"
-#include "../../include/fpdfdoc/fpdf_vt.h"
-#include "pdf_vt.h"
-const FX_BYTE gFontSizeSteps[] = { 4, 6, 8, 9, 10, 12, 14, 18, 20, 25, 30, 35, 40, 45, 50, 55, 60, 70, 80, 90, 100, 110, 120, 130, 144};
-#define PVT_RETURN_LENGTH 1
-#define PVT_DEFAULT_FONTSIZE 18.0f
-#define PVTWORD_SCRIPT_NORMAL 0
-#define PVTWORD_SCRIPT_SUPER 1
-#define PVTWORD_SCRIPT_SUB 2
-#define PVT_FONTSCALE 0.001f
-#define PVT_PERCENT 0.01f
-#define PVT_HALF 0.5f
-CLine::CLine()
-{
-}
-CLine::~CLine()
-{
-}
-CPVT_WordPlace CLine::GetBeginWordPlace() const
-{
- return CPVT_WordPlace(LinePlace.nSecIndex, LinePlace.nLineIndex, -1);
-}
-CPVT_WordPlace CLine::GetEndWordPlace() const
-{
- return CPVT_WordPlace(LinePlace.nSecIndex, LinePlace.nLineIndex, m_LineInfo.nEndWordIndex);
-}
-CPVT_WordPlace CLine::GetPrevWordPlace(const CPVT_WordPlace & place) const
-{
- if (place.nWordIndex > m_LineInfo.nEndWordIndex) {
- return CPVT_WordPlace(place.nSecIndex, place.nLineIndex, m_LineInfo.nEndWordIndex);
- }
- return CPVT_WordPlace(place.nSecIndex, place.nLineIndex, place.nWordIndex - 1);
-}
-CPVT_WordPlace CLine::GetNextWordPlace(const CPVT_WordPlace & place) const
-{
- if (place.nWordIndex < m_LineInfo.nBeginWordIndex) {
- return CPVT_WordPlace(place.nSecIndex, place.nLineIndex, m_LineInfo.nBeginWordIndex);
- }
- return CPVT_WordPlace(place.nSecIndex, place.nLineIndex, place.nWordIndex + 1);
-}
-CSection::CSection(CPDF_VariableText * pVT) : m_pVT(pVT)
-{
-}
-CSection::~CSection()
-{
- ResetAll();
-}
-void CSection::ResetAll()
-{
- ResetWordArray();
- ResetLineArray();
-}
-void CSection::ResetLineArray()
-{
- m_LineArray.RemoveAll();
-}
-void CSection::ResetWordArray()
-{
- for (FX_INT32 i = 0, sz = m_WordArray.GetSize(); i < sz; i++) {
- delete m_WordArray.GetAt(i);
- }
- m_WordArray.RemoveAll();
-}
-void CSection::ResetLinePlace()
-{
- for (FX_INT32 i = 0, sz = m_LineArray.GetSize(); i < sz; i++) {
- if (CLine * pLine = m_LineArray.GetAt(i)) {
- pLine->LinePlace = CPVT_WordPlace(SecPlace.nSecIndex, i, -1);
- }
- }
-}
-CPVT_WordPlace CSection::AddWord(const CPVT_WordPlace & place, const CPVT_WordInfo & wordinfo)
-{
- if (CPVT_WordInfo * pWord = FX_NEW CPVT_WordInfo(wordinfo)) {
- FX_INT32 nWordIndex = FPDF_MAX(FPDF_MIN(place.nWordIndex, this->m_WordArray.GetSize()), 0);
- if (nWordIndex == m_WordArray.GetSize()) {
- m_WordArray.Add(pWord);
- } else {
- m_WordArray.InsertAt(nWordIndex, pWord);
- }
- }
- return place;
-}
-CPVT_WordPlace CSection::AddLine(const CPVT_LineInfo & lineinfo)
-{
- return CPVT_WordPlace(SecPlace.nSecIndex, m_LineArray.Add(lineinfo), -1);
-}
-CPVT_FloatRect CSection::Rearrange()
-{
- ASSERT(m_pVT != NULL);
- if (m_pVT->m_nCharArray > 0) {
- return CTypeset(this).CharArray();
- } else {
- return CTypeset(this).Typeset();
- }
-}
-CPVT_Size CSection::GetSectionSize(FX_FLOAT fFontSize)
-{
- return CTypeset(this).GetEditSize(fFontSize);
-}
-CPVT_WordPlace CSection::GetBeginWordPlace() const
-{
- if (CLine * pLine = m_LineArray.GetAt(0)) {
- return pLine->GetBeginWordPlace();
- } else {
- return SecPlace;
- }
-}
-CPVT_WordPlace CSection::GetEndWordPlace() const
-{
- if (CLine * pLine = m_LineArray.GetAt(m_LineArray.GetSize() - 1)) {
- return pLine->GetEndWordPlace();
- } else {
- return this->SecPlace;
- }
-}
-CPVT_WordPlace CSection::GetPrevWordPlace(const CPVT_WordPlace & place) const
-{
- if (place.nLineIndex < 0) {
- return GetBeginWordPlace();
- }
- if (place.nLineIndex >= m_LineArray.GetSize()) {
- return GetEndWordPlace();
- }
- if (CLine * pLine = m_LineArray.GetAt(place.nLineIndex)) {
- if (place.nWordIndex == pLine->m_LineInfo.nBeginWordIndex) {
- return CPVT_WordPlace(place.nSecIndex, place.nLineIndex, -1);
- } else if (place.nWordIndex < pLine->m_LineInfo.nBeginWordIndex) {
- if (CLine * pPrevLine = m_LineArray.GetAt(place.nLineIndex - 1)) {
- return pPrevLine->GetEndWordPlace();
- }
- } else {
- return pLine->GetPrevWordPlace(place);
- }
- }
- return place;
-}
-CPVT_WordPlace CSection::GetNextWordPlace(const CPVT_WordPlace & place) const
-{
- if (place.nLineIndex < 0) {
- return GetBeginWordPlace();
- }
- if (place.nLineIndex >= m_LineArray.GetSize()) {
- return GetEndWordPlace();
- }
- if (CLine * pLine = m_LineArray.GetAt(place.nLineIndex)) {
- if (place.nWordIndex >= pLine->m_LineInfo.nEndWordIndex) {
- if (CLine * pNextLine = m_LineArray.GetAt(place.nLineIndex + 1)) {
- return pNextLine->GetBeginWordPlace();
- }
- } else {
- return pLine->GetNextWordPlace(place);
- }
- }
- return place;
-}
-void CSection::UpdateWordPlace(CPVT_WordPlace & place) const
-{
- FX_INT32 nLeft = 0;
- FX_INT32 nRight = m_LineArray.GetSize() - 1;
- FX_INT32 nMid = (nLeft + nRight) / 2;
- while (nLeft <= nRight) {
- if (CLine * pLine = m_LineArray.GetAt(nMid)) {
- if (place.nWordIndex < pLine->m_LineInfo.nBeginWordIndex) {
- nRight = nMid - 1;
- nMid = (nLeft + nRight) / 2;
- } else if (place.nWordIndex > pLine->m_LineInfo.nEndWordIndex) {
- nLeft = nMid + 1;
- nMid = (nLeft + nRight) / 2;
- } else {
- place.nLineIndex = nMid;
- return;
- }
- } else {
- break;
- }
- }
-}
-CPVT_WordPlace CSection::SearchWordPlace(const CPDF_Point & point) const
-{
- ASSERT(m_pVT != NULL);
- CPVT_WordPlace place = GetBeginWordPlace();
- FX_BOOL bUp = TRUE;
- FX_BOOL bDown = TRUE;
- FX_INT32 nLeft = 0;
- FX_INT32 nRight = m_LineArray.GetSize() - 1;
- FX_INT32 nMid = m_LineArray.GetSize() / 2;
- FX_FLOAT fTop = 0;
- FX_FLOAT fBottom = 0;
- while (nLeft <= nRight) {
- if (CLine * pLine = m_LineArray.GetAt(nMid)) {
- fTop = pLine->m_LineInfo.fLineY - pLine->m_LineInfo.fLineAscent - m_pVT->GetLineLeading(m_SecInfo);
- fBottom = pLine->m_LineInfo.fLineY - pLine->m_LineInfo.fLineDescent;
- if (IsFloatBigger(point.y, fTop)) {
- bUp = FALSE;
- }
- if (IsFloatSmaller(point.y, fBottom)) {
- bDown = FALSE;
- }
- if (IsFloatSmaller(point.y, fTop)) {
- nRight = nMid - 1;
- nMid = (nLeft + nRight) / 2;
- continue;
- } else if (IsFloatBigger(point.y, fBottom)) {
- nLeft = nMid + 1;
- nMid = (nLeft + nRight) / 2;
- continue;
- } else {
- place = SearchWordPlace(point.x,
- CPVT_WordRange(pLine->GetNextWordPlace(pLine->GetBeginWordPlace()), pLine->GetEndWordPlace())
- );
- place.nLineIndex = nMid;
- return place;
- }
- }
- }
- if (bUp) {
- place = GetBeginWordPlace();
- }
- if (bDown) {
- place = GetEndWordPlace();
- }
- return place;
-}
-CPVT_WordPlace CSection::SearchWordPlace(FX_FLOAT fx, const CPVT_WordPlace & lineplace) const
-{
- if (CLine * pLine = m_LineArray.GetAt(lineplace.nLineIndex)) {
- return SearchWordPlace(fx - m_SecInfo.rcSection.left,
- CPVT_WordRange(pLine->GetNextWordPlace(pLine->GetBeginWordPlace()), pLine->GetEndWordPlace()));
- }
- return GetBeginWordPlace();
-}
-CPVT_WordPlace CSection::SearchWordPlace(FX_FLOAT fx, const CPVT_WordRange & range) const
-{
- CPVT_WordPlace wordplace = range.BeginPos;
- wordplace.nWordIndex = -1;
- if (!m_pVT) {
- return wordplace;
- }
- FX_INT32 nLeft = range.BeginPos.nWordIndex;
- FX_INT32 nRight = range.EndPos.nWordIndex + 1;
- FX_INT32 nMid = (nLeft + nRight) / 2;
- while (nLeft < nRight) {
- if (nMid == nLeft) {
- break;
- }
- if (nMid == nRight) {
- nMid--;
- break;
- }
- if (CPVT_WordInfo * pWord = m_WordArray.GetAt(nMid)) {
- if (fx > pWord->fWordX + m_pVT->GetWordWidth(*pWord) * PVT_HALF) {
- nLeft = nMid;
- nMid = (nLeft + nRight) / 2;
- continue;
- } else {
- nRight = nMid;
- nMid = (nLeft + nRight) / 2;
- continue;
- }
- } else {
- break;
- }
- }
- if (CPVT_WordInfo * pWord = m_WordArray.GetAt(nMid)) {
- if (fx > pWord->fWordX + m_pVT->GetWordWidth(*pWord) * PVT_HALF) {
- wordplace.nWordIndex = nMid;
- }
- }
- return wordplace;
-}
-void CSection::ClearLeftWords(FX_INT32 nWordIndex)
-{
- for (FX_INT32 i = nWordIndex; i >= 0; i--) {
- delete m_WordArray.GetAt(i);
- m_WordArray.RemoveAt(i);
- }
-}
-void CSection::ClearRightWords(FX_INT32 nWordIndex)
-{
- for (FX_INT32 i = m_WordArray.GetSize() - 1; i > nWordIndex; i--) {
- delete m_WordArray.GetAt(i);
- m_WordArray.RemoveAt(i);
- }
-}
-void CSection::ClearMidWords(FX_INT32 nBeginIndex, FX_INT32 nEndIndex)
-{
- for (FX_INT32 i = nEndIndex; i > nBeginIndex; i--) {
- delete m_WordArray.GetAt(i);
- m_WordArray.RemoveAt(i);
- }
-}
-void CSection::ClearWords(const CPVT_WordRange & PlaceRange)
-{
- CPVT_WordPlace SecBeginPos = GetBeginWordPlace();
- CPVT_WordPlace SecEndPos = GetEndWordPlace();
- if (PlaceRange.BeginPos.WordCmp(SecBeginPos) >= 0) {
- if (PlaceRange.EndPos.WordCmp(SecEndPos) <= 0) {
- ClearMidWords(PlaceRange.BeginPos.nWordIndex, PlaceRange.EndPos.nWordIndex);
- } else {
- ClearRightWords(PlaceRange.BeginPos.nWordIndex);
- }
- } else if (PlaceRange.EndPos.WordCmp(SecEndPos) <= 0) {
- ClearLeftWords(PlaceRange.EndPos.nWordIndex);
- } else {
- ResetWordArray();
- }
-}
-void CSection::ClearWord(const CPVT_WordPlace & place)
-{
- delete m_WordArray.GetAt(place.nWordIndex);
- m_WordArray.RemoveAt(place.nWordIndex);
-}
-CTypeset::CTypeset(CSection * pSection) : m_pSection(pSection), m_pVT(pSection->m_pVT), m_rcRet(0.0f, 0.0f, 0.0f, 0.0f)
-{
-}
-CTypeset::~CTypeset()
-{
-}
-CPVT_FloatRect CTypeset::CharArray()
-{
- ASSERT(m_pSection != NULL);
- ASSERT(m_pVT != NULL);
- FX_FLOAT fLineAscent = m_pVT->GetFontAscent(m_pVT->GetDefaultFontIndex(), m_pVT->GetFontSize());
- FX_FLOAT fLineDescent = m_pVT->GetFontDescent(m_pVT->GetDefaultFontIndex(), m_pVT->GetFontSize());
- m_rcRet.Default();
- FX_FLOAT x = 0.0f, y = 0.0f;
- FX_FLOAT fNextWidth;
- FX_INT32 nStart = 0;
- FX_FLOAT fNodeWidth = m_pVT->GetPlateWidth() / (m_pVT->m_nCharArray <= 0 ? 1 : m_pVT->m_nCharArray);
- if (CLine * pLine = m_pSection->m_LineArray.GetAt(0)) {
- x = 0.0f;
- y += m_pVT->GetLineLeading(m_pSection->m_SecInfo);
- y += fLineAscent;
- nStart = 0;
- switch (m_pVT->GetAlignment(m_pSection->m_SecInfo)) {
- case 0:
- pLine->m_LineInfo.fLineX = fNodeWidth * PVT_HALF;
- break;
- case 1:
- nStart = (m_pVT->m_nCharArray - m_pSection->m_WordArray.GetSize()) / 2;
- pLine->m_LineInfo.fLineX = fNodeWidth * nStart - fNodeWidth * PVT_HALF;
- break;
- case 2:
- nStart = m_pVT->m_nCharArray - m_pSection->m_WordArray.GetSize();
- pLine->m_LineInfo.fLineX = fNodeWidth * nStart - fNodeWidth * PVT_HALF;
- break;
- }
- for (FX_INT32 w = 0, sz = m_pSection->m_WordArray.GetSize(); w < sz; w++) {
- if (w >= m_pVT->m_nCharArray) {
- break;
- }
- fNextWidth = 0;
- if (CPVT_WordInfo * pNextWord = (CPVT_WordInfo *)m_pSection->m_WordArray.GetAt(w + 1)) {
- pNextWord->fWordTail = 0;
- fNextWidth = m_pVT->GetWordWidth(*pNextWord);
- }
- if (CPVT_WordInfo * pWord = (CPVT_WordInfo *)m_pSection->m_WordArray.GetAt(w)) {
- pWord->fWordTail = 0;
- FX_FLOAT fWordWidth = m_pVT->GetWordWidth(*pWord);
- FX_FLOAT fWordAscent = m_pVT->GetWordAscent(*pWord);
- FX_FLOAT fWordDescent = m_pVT->GetWordDescent(*pWord);
- x = (FX_FLOAT)(fNodeWidth * (w + nStart + 0.5) - fWordWidth * PVT_HALF);
- pWord->fWordX = x;
- pWord->fWordY = y;
- if (w == 0) {
- pLine->m_LineInfo.fLineX = x;
- }
- if (w != m_pSection->m_WordArray.GetSize() - 1)
- pWord->fWordTail = (fNodeWidth - (fWordWidth + fNextWidth) * PVT_HALF > 0 ?
- fNodeWidth - (fWordWidth + fNextWidth) * PVT_HALF : 0);
- else {
- pWord->fWordTail = 0;
- }
- x += fWordWidth;
- fLineAscent = FPDF_MAX(fLineAscent, fWordAscent);
- fLineDescent = FPDF_MIN(fLineDescent, fWordDescent);
- }
- }
- pLine->m_LineInfo.nBeginWordIndex = 0;
- pLine->m_LineInfo.nEndWordIndex = m_pSection->m_WordArray.GetSize() - 1;
- pLine->m_LineInfo.fLineY = y;
- pLine->m_LineInfo.fLineWidth = x - pLine->m_LineInfo.fLineX;
- pLine->m_LineInfo.fLineAscent = fLineAscent;
- pLine->m_LineInfo.fLineDescent = fLineDescent;
- y += (-fLineDescent);
- }
- return m_rcRet = CPVT_FloatRect(0, 0, x, y);
-}
-CPVT_Size CTypeset::GetEditSize(FX_FLOAT fFontSize)
-{
- ASSERT(m_pSection != NULL);
- ASSERT(m_pVT != NULL);
- SplitLines(FALSE, fFontSize);
- return CPVT_Size(m_rcRet.Width(), m_rcRet.Height());
-}
-CPVT_FloatRect CTypeset::Typeset()
-{
- ASSERT(m_pSection != NULL);
- ASSERT(m_pVT != NULL);
- m_pSection->m_LineArray.Empty();
- SplitLines(TRUE, 0.0f);
- m_pSection->m_LineArray.Clear();
- OutputLines();
- return m_rcRet;
-}
-static int special_chars[128] = {
- 0x0000, 0x000C, 0x0008, 0x000C, 0x0008, 0x0000, 0x0020, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0008, 0x0008, 0x0000, 0x0010, 0x0000, 0x0000, 0x0028,
- 0x000C, 0x0008, 0x0000, 0x0000, 0x0028, 0x0028, 0x0028, 0x0028,
- 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002,
- 0x0002, 0x0002, 0x0008, 0x0008, 0x0000, 0x0000, 0x0000, 0x0008,
- 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001,
- 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001,
- 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001,
- 0x0001, 0x0001, 0x0001, 0x000C, 0x0000, 0x0008, 0x0000, 0x0000,
- 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001,
- 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001,
- 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001,
- 0x0001, 0x0001, 0x0001, 0x000C, 0x0000, 0x0008, 0x0000, 0x0000,
-};
-static FX_BOOL IsLatin(FX_WORD word)
-{
- if (word <= 0x007F) {
- if (special_chars[word] & 0x0001) {
- return TRUE;
- }
- }
- if ((word >= 0x00C0 && word <= 0x00FF) ||
- (word >= 0x0100 && word <= 0x024F) ||
- (word >= 0x1E00 && word <= 0x1EFF) ||
- (word >= 0x2C60 && word <= 0x2C7F) ||
- (word >= 0xA720 && word <= 0xA7FF) ||
- (word >= 0xFF21 && word <= 0xFF3A) ||
- (word >= 0xFF41 && word <= 0xFF5A)) {
- return TRUE;
- }
- return FALSE;
-}
-static FX_BOOL IsDigit(FX_DWORD word)
-{
- return (word >= 0x0030 && word <= 0x0039) ? TRUE : FALSE;
-}
-static FX_BOOL IsCJK(FX_DWORD word)
-{
- if ((word >= 0x1100 && word <= 0x11FF) ||
- (word >= 0x2E80 && word <= 0x2FFF) ||
- (word >= 0x3040 && word <= 0x9FBF) ||
- (word >= 0xAC00 && word <= 0xD7AF) ||
- (word >= 0xF900 && word <= 0xFAFF) ||
- (word >= 0xFE30 && word <= 0xFE4F) ||
- (word >= 0x20000 && word <= 0x2A6DF) ||
- (word >= 0x2F800 && word <= 0x2FA1F)) {
- return TRUE;
- }
- if (word >= 0x3000 && word <= 0x303F) {
- if (word == 0x3005 || word == 0x3006 || word == 0x3021 || word == 0x3022 ||
- word == 0x3023 || word == 0x3024 || word == 0x3025 || word == 0x3026 ||
- word == 0x3027 || word == 0x3028 || word == 0x3029 || word == 0x3031 ||
- word == 0x3032 || word == 0x3033 || word == 0x3034 || word == 0x3035) {
- return TRUE;
- }
- return FALSE;
- }
- if (word >= 0xFF66 && word <= 0xFF9D) {
- return TRUE;
- }
- return FALSE;
-}
-static FX_BOOL IsPunctuation(FX_DWORD word)
-{
- if (word <= 0x007F) {
- if ((special_chars[word] >> 3) & 1) {
- return TRUE;
- }
- } else if (word >= 0x0080 && word <= 0x00FF) {
- if (word == 0x0082 || word == 0x0084 || word == 0x0085 || word == 0x0091 ||
- word == 0x0092 || word == 0x0093 || word <= 0x0094 || word == 0x0096 ||
- word == 0x00B4 || word == 0x00B8) {
- return TRUE;
- }
- } else if (word >= 0x2000 && word <= 0x206F) {
- if (word == 0x2010 || word == 0x2011 || word == 0x2012 || word == 0x2013 ||
- word == 0x2018 || word == 0x2019 || word == 0x201A || word == 0x201B ||
- word == 0x201C || word == 0x201D || word == 0x201E || word == 0x201F ||
- word == 0x2032 || word == 0x2033 || word == 0x2034 || word == 0x2035 ||
- word == 0x2036 || word == 0x2037 || word == 0x203C || word == 0x203D ||
- word == 0x203E || word == 0x2044) {
- return TRUE;
- }
- } else if (word >= 0x3000 && word <= 0x303F) {
- if (word == 0x3001 || word == 0x3002 || word == 0x3003 || word == 0x3005 ||
- word == 0x3009 || word == 0x300A || word == 0x300B || word == 0x300C ||
- word == 0x300D || word == 0x300F || word == 0x300E || word == 0x3010 ||
- word == 0x3011 || word == 0x3014 || word == 0x3015 || word == 0x3016 ||
- word == 0x3017 || word == 0x3018 || word == 0x3019 || word == 0x301A ||
- word == 0x301B || word == 0x301D || word == 0x301E || word == 0x301F) {
- return TRUE;
- }
- } else if (word >= 0xFE50 && word <= 0xFE6F) {
- if ((word >= 0xFE50 && word <= 0xFE5E) || word == 0xFE63) {
- return TRUE;
- }
- } else if (word >= 0xFF00 && word <= 0xFFEF) {
- if (word == 0xFF01 || word == 0xFF02 || word == 0xFF07 || word == 0xFF08 ||
- word == 0xFF09 || word == 0xFF0C || word == 0xFF0E || word == 0xFF0F ||
- word == 0xFF1A || word == 0xFF1B || word == 0xFF1F || word == 0xFF3B ||
- word == 0xFF3D || word == 0xFF40 || word == 0xFF5B || word == 0xFF5C ||
- word == 0xFF5D || word == 0xFF61 || word == 0xFF62 || word == 0xFF63 ||
- word == 0xFF64 || word == 0xFF65 || word == 0xFF9E || word == 0xFF9F) {
- return TRUE;
- }
- }
- return FALSE;
-}
-static FX_BOOL IsConnectiveSymbol(FX_DWORD word)
-{
- if (word <= 0x007F) {
- if ((special_chars[word] >> 5) & 1) {
- return TRUE;
- }
- }
- return FALSE;
-}
-static FX_BOOL IsOpenStylePunctuation(FX_DWORD word)
-{
- if (word <= 0x007F) {
- if ((special_chars[word] >> 2) & 1) {
- return TRUE;
- }
- } else if (word == 0x300A || word == 0x300C || word == 0x300E || word == 0x3010 ||
- word == 0x3014 || word == 0x3016 || word == 0x3018 || word == 0x301A ||
- word == 0xFF08 || word == 0xFF3B || word == 0xFF5B || word == 0xFF62) {
- return TRUE;
- }
- return FALSE;
-}
-static FX_BOOL IsCurrencySymbol(FX_WORD word)
-{
- if (word == 0x0024 || word == 0x0080 || word == 0x00A2 || word == 0x00A3 ||
- word == 0x00A4 || word == 0x00A5 || (word >= 0x20A0 && word <= 0x20CF) ||
- word == 0xFE69 || word == 0xFF04 || word == 0xFFE0 || word == 0xFFE1 ||
- word == 0xFFE5 || word == 0xFFE6) {
- return TRUE;
- }
- return FALSE;
-}
-static FX_BOOL IsPrefixSymbol(FX_WORD word)
-{
- if (IsCurrencySymbol(word)) {
- return TRUE;
- }
- if (word == 0x2116) {
- return TRUE;
- }
- return FALSE;
-}
-static FX_BOOL IsSpace(FX_WORD word)
-{
- return (word == 0x0020 || word == 0x3000) ? TRUE : FALSE;
-}
-static FX_BOOL NeedDivision(FX_WORD prevWord, FX_WORD curWord)
-{
- if ((IsLatin(prevWord) || IsDigit(prevWord)) && (IsLatin(curWord) || IsDigit(curWord))) {
- return FALSE;
- } else if (IsSpace(curWord) || IsPunctuation(curWord)) {
- return FALSE;
- } else if (IsConnectiveSymbol(prevWord) || IsConnectiveSymbol(curWord)) {
- return FALSE;
- } else if (IsSpace(prevWord) || IsPunctuation(prevWord)) {
- return TRUE;
- } else if (IsPrefixSymbol(prevWord)) {
- return FALSE;
- } else if (IsPrefixSymbol(curWord) || IsCJK(curWord)) {
- return TRUE;
- } else if (IsCJK(prevWord)) {
- return TRUE;
- }
- return FALSE;
-}
-void CTypeset::SplitLines(FX_BOOL bTypeset, FX_FLOAT fFontSize)
-{
- ASSERT(m_pVT != NULL);
- ASSERT(m_pSection != NULL);
- FX_INT32 nLineHead = 0;
- FX_INT32 nLineTail = 0;
- FX_FLOAT fMaxX = 0.0f, fMaxY = 0.0f;
- FX_FLOAT fLineWidth = 0.0f, fBackupLineWidth = 0.0f;
- FX_FLOAT fLineAscent = 0.0f, fBackupLineAscent = 0.0f;
- FX_FLOAT fLineDescent = 0.0f, fBackupLineDescent = 0.0f;
- FX_INT32 nWordStartPos = 0;
- FX_BOOL bFullWord = FALSE;
- FX_INT32 nLineFullWordIndex = 0;
- FX_INT32 nCharIndex = 0;
- CPVT_LineInfo line;
- FX_FLOAT fWordWidth = 0;
- FX_FLOAT fTypesetWidth = FPDF_MAX(m_pVT->GetPlateWidth() - m_pVT->GetLineIndent(m_pSection->m_SecInfo), 0.0f);
- FX_INT32 nTotalWords = m_pSection->m_WordArray.GetSize();
- FX_BOOL bOpened = FALSE;
- if (nTotalWords > 0) {
- FX_INT32 i = 0;
- while (i < nTotalWords) {
- CPVT_WordInfo * pWord = m_pSection->m_WordArray.GetAt(i);
- CPVT_WordInfo* pOldWord = pWord;
- if (i > 0) {
- pOldWord = m_pSection->m_WordArray.GetAt(i - 1);
- }
- if (pWord) {
- if (bTypeset) {
- fLineAscent = FPDF_MAX(fLineAscent, m_pVT->GetWordAscent(*pWord, TRUE));
- fLineDescent = FPDF_MIN(fLineDescent, m_pVT->GetWordDescent(*pWord, TRUE));
- fWordWidth = m_pVT->GetWordWidth(*pWord);
- } else {
- fLineAscent = FPDF_MAX(fLineAscent, m_pVT->GetWordAscent(*pWord, fFontSize));
- fLineDescent = FPDF_MIN(fLineDescent, m_pVT->GetWordDescent(*pWord, fFontSize));
- fWordWidth = m_pVT->GetWordWidth(pWord->nFontIndex,
- pWord->Word,
- m_pVT->m_wSubWord,
- m_pVT->m_fCharSpace,
- m_pVT->m_nHorzScale,
- fFontSize,
- pWord->fWordTail,
- 0);
- }
- if (!bOpened) {
- if (IsOpenStylePunctuation(pWord->Word)) {
- bOpened = TRUE;
- bFullWord = TRUE;
- } else if (pOldWord != NULL) {
- if (NeedDivision(pOldWord->Word, pWord->Word)) {
- bFullWord = TRUE;
- }
- }
- } else {
- if (!IsSpace(pWord->Word) && !IsOpenStylePunctuation(pWord->Word)) {
- bOpened = FALSE;
- }
- }
- if (bFullWord) {
- bFullWord = FALSE;
- if (nCharIndex > 0) {
- nLineFullWordIndex ++;
- }
- nWordStartPos = i;
- fBackupLineWidth = fLineWidth;
- fBackupLineAscent = fLineAscent;
- fBackupLineDescent = fLineDescent;
- }
- nCharIndex++;
- }
- if (m_pVT->m_bLimitWidth && fTypesetWidth > 0 &&
- fLineWidth + fWordWidth > fTypesetWidth) {
- if (nLineFullWordIndex > 0) {
- i = nWordStartPos;
- fLineWidth = fBackupLineWidth;
- fLineAscent = fBackupLineAscent;
- fLineDescent = fBackupLineDescent;
- }
- if (nCharIndex == 1) {
- fLineWidth = fWordWidth;
- i++;
- }
- nLineTail = i - 1;
- if (bTypeset) {
- line.nBeginWordIndex = nLineHead;
- line.nEndWordIndex = nLineTail;
- line.nTotalWord = nLineTail - nLineHead + 1;
- line.fLineWidth = fLineWidth;
- line.fLineAscent = fLineAscent;
- line.fLineDescent = fLineDescent;
- m_pSection->AddLine(line);
- }
- fMaxY += (fLineAscent + m_pVT->GetLineLeading(m_pSection->m_SecInfo));
- fMaxY += (-fLineDescent);
- fMaxX = FPDF_MAX(fLineWidth, fMaxX);
- nLineHead = i;
- fLineWidth = 0.0f;
- fLineAscent = 0.0f;
- fLineDescent = 0.0f;
- nCharIndex = 0;
- nLineFullWordIndex = 0;
- bFullWord = FALSE;
- } else {
- fLineWidth += fWordWidth;
- i++;
- }
- }
- if (nLineHead <= nTotalWords - 1) {
- nLineTail = nTotalWords - 1;
- if (bTypeset) {
- line.nBeginWordIndex = nLineHead;
- line.nEndWordIndex = nLineTail;
- line.nTotalWord = nLineTail - nLineHead + 1;
- line.fLineWidth = fLineWidth;
- line.fLineAscent = fLineAscent;
- line.fLineDescent = fLineDescent;
- m_pSection->AddLine(line);
- }
- fMaxY += (fLineAscent + m_pVT->GetLineLeading(m_pSection->m_SecInfo));
- fMaxY += (-fLineDescent);
- fMaxX = FPDF_MAX(fLineWidth, fMaxX);
- }
- } else {
- if (bTypeset) {
- fLineAscent = m_pVT->GetLineAscent(m_pSection->m_SecInfo);
- fLineDescent = m_pVT->GetLineDescent(m_pSection->m_SecInfo);
- } else {
- fLineAscent = m_pVT->GetFontAscent(m_pVT->GetDefaultFontIndex(), fFontSize);
- fLineDescent = m_pVT->GetFontDescent(m_pVT->GetDefaultFontIndex(), fFontSize);
- }
- if (bTypeset) {
- line.nBeginWordIndex = -1;
- line.nEndWordIndex = -1;
- line.nTotalWord = 0;
- line.fLineWidth = 0;
- line.fLineAscent = fLineAscent;
- line.fLineDescent = fLineDescent;
- m_pSection->AddLine(line);
- }
- fMaxY += (m_pVT->GetLineLeading(m_pSection->m_SecInfo) + fLineAscent + (-fLineDescent));
- }
- m_rcRet = CPVT_FloatRect(0, 0, fMaxX, fMaxY);
-}
-void CTypeset::OutputLines()
-{
- ASSERT(m_pVT != NULL);
- ASSERT(m_pSection != NULL);
- FX_FLOAT fMinX = 0.0f, fMinY = 0.0f, fMaxX = 0.0f, fMaxY = 0.0f;
- FX_FLOAT fPosX = 0.0f, fPosY = 0.0f;
- FX_FLOAT fLineIndent = m_pVT->GetLineIndent(m_pSection->m_SecInfo);
- FX_FLOAT fTypesetWidth = FPDF_MAX(m_pVT->GetPlateWidth() - fLineIndent, 0.0f);
- switch (m_pVT->GetAlignment(m_pSection->m_SecInfo)) {
- default:
- case 0:
- fMinX = 0.0f;
- break;
- case 1:
- fMinX = (fTypesetWidth - m_rcRet.Width()) * PVT_HALF;
- break;
- case 2:
- fMinX = fTypesetWidth - m_rcRet.Width();
- break;
- }
- fMaxX = fMinX + m_rcRet.Width();
- fMinY = 0.0f;
- fMaxY = m_rcRet.Height();
- FX_INT32 nTotalLines = m_pSection->m_LineArray.GetSize();
- if (nTotalLines > 0) {
- m_pSection->m_SecInfo.nTotalLine = nTotalLines;
- for (FX_INT32 l = 0; l < nTotalLines; l++) {
- if (CLine * pLine = m_pSection->m_LineArray.GetAt(l)) {
- switch (m_pVT->GetAlignment(m_pSection->m_SecInfo)) {
- default:
- case 0:
- fPosX = 0;
- break;
- case 1:
- fPosX = (fTypesetWidth - pLine->m_LineInfo.fLineWidth) * PVT_HALF;
- break;
- case 2:
- fPosX = fTypesetWidth - pLine->m_LineInfo.fLineWidth;
- break;
- }
- fPosX += fLineIndent;
- fPosY += m_pVT->GetLineLeading(m_pSection->m_SecInfo);
- fPosY += pLine->m_LineInfo.fLineAscent;
- pLine->m_LineInfo.fLineX = fPosX - fMinX;
- pLine->m_LineInfo.fLineY = fPosY - fMinY;
- for (FX_INT32 w = pLine->m_LineInfo.nBeginWordIndex; w <= pLine->m_LineInfo.nEndWordIndex; w++) {
- if (CPVT_WordInfo * pWord = m_pSection->m_WordArray.GetAt(w)) {
- pWord->fWordX = fPosX - fMinX;
- if (pWord->pWordProps) {
- switch (pWord->pWordProps->nScriptType) {
- default:
- case PVTWORD_SCRIPT_NORMAL:
- pWord->fWordY = fPosY - fMinY;
- break;
- case PVTWORD_SCRIPT_SUPER:
- pWord->fWordY = fPosY - m_pVT->GetWordAscent(*pWord) - fMinY;
- break;
- case PVTWORD_SCRIPT_SUB:
- pWord->fWordY = fPosY - m_pVT->GetWordDescent(*pWord) - fMinY;
- break;
- }
- } else {
- pWord->fWordY = fPosY - fMinY;
- }
- fPosX += m_pVT->GetWordWidth(*pWord);
- }
- }
- fPosY += (-pLine->m_LineInfo.fLineDescent);
- }
- }
- }
- m_rcRet = CPVT_FloatRect(fMinX, fMinY, fMaxX, fMaxY);
-}
-CPDF_VariableText::CPDF_VariableText() :
- m_pVTProvider(NULL),
- m_pVTIterator(NULL),
- m_bInitial(FALSE),
- m_bRichText(FALSE),
- m_bMultiLine(FALSE),
- m_bLimitWidth(FALSE),
- m_bAutoFontSize(FALSE),
- m_nLimitChar(0),
- m_nCharArray(0),
- m_nAlignment(0),
- m_fCharSpace(0.0f),
- m_fWordSpace(0.0f),
- m_fFontSize(0.0f),
- m_nHorzScale(100),
- m_wSubWord(0),
- m_fLineLeading(0.0f)
-{
-}
-CPDF_VariableText::~CPDF_VariableText()
-{
- if (m_pVTIterator) {
- delete m_pVTIterator;
- m_pVTIterator = NULL;
- }
- ResetAll();
-}
-void CPDF_VariableText::Initialize()
-{
- if (!m_bInitial) {
- CPVT_SectionInfo secinfo;
- if (m_bRichText) {
- secinfo.pSecProps = FX_NEW CPVT_SecProps(0.0f, 0.0f, 0);
- secinfo.pWordProps = FX_NEW CPVT_WordProps(GetDefaultFontIndex(), PVT_DEFAULT_FONTSIZE, 0, 0, 0);
- }
- CPVT_WordPlace place;
- place.nSecIndex = 0;
- AddSection(place, secinfo);
- CPVT_LineInfo lineinfo;
- lineinfo.fLineAscent = GetFontAscent(GetDefaultFontIndex(), GetFontSize());
- lineinfo.fLineDescent = GetFontDescent(GetDefaultFontIndex(), GetFontSize());
- AddLine(place, lineinfo);
- if (CSection * pSection = m_SectionArray.GetAt(0)) {
- pSection->ResetLinePlace();
- }
- m_bInitial = TRUE;
- }
-}
-void CPDF_VariableText::ResetAll()
-{
- m_bInitial = FALSE;
- ResetSectionArray();
-}
-CPVT_WordPlace CPDF_VariableText::InsertWord(const CPVT_WordPlace & place, FX_WORD word, FX_INT32 charset,
- const CPVT_WordProps * pWordProps)
-{
- FX_INT32 nTotlaWords = this->GetTotalWords();
- if (m_nLimitChar > 0 && nTotlaWords >= m_nLimitChar) {
- return place;
- }
- if (m_nCharArray > 0 && nTotlaWords >= m_nCharArray) {
- return place;
- }
- CPVT_WordPlace newplace = place;
- newplace.nWordIndex ++;
- if (m_bRichText) {
- CPVT_WordProps * pNewProps = pWordProps ? FX_NEW CPVT_WordProps(*pWordProps) : FX_NEW CPVT_WordProps();
- if (pNewProps) {
- pNewProps->nFontIndex = GetWordFontIndex(word, charset, pWordProps->nFontIndex);
- return AddWord(newplace, CPVT_WordInfo(word, charset, -1, pNewProps));
- }
- } else {
- FX_INT32 nFontIndex = GetSubWord() > 0 ? GetDefaultFontIndex() : GetWordFontIndex(word, charset, GetDefaultFontIndex());
- return AddWord(newplace, CPVT_WordInfo(word, charset, nFontIndex, NULL));
- }
- return place;
-}
-CPVT_WordPlace CPDF_VariableText::InsertSection(const CPVT_WordPlace & place, const CPVT_SecProps * pSecProps,
- const CPVT_WordProps * pWordProps)
-{
- FX_INT32 nTotlaWords = this->GetTotalWords();
- if (m_nLimitChar > 0 && nTotlaWords >= m_nLimitChar) {
- return place;
- }
- if (m_nCharArray > 0 && nTotlaWords >= m_nCharArray) {
- return place;
- }
- if (!m_bMultiLine) {
- return place;
- }
- CPVT_WordPlace wordplace = place;
- UpdateWordPlace(wordplace);
- CPVT_WordPlace newplace = place;
- if (CSection * pSection = m_SectionArray.GetAt(wordplace.nSecIndex)) {
- CPVT_WordPlace NewPlace(wordplace.nSecIndex + 1, 0, -1);
- CPVT_SectionInfo secinfo;
- if (m_bRichText) {
- if (pSecProps) {
- secinfo.pSecProps = FX_NEW CPVT_SecProps(*pSecProps);
- }
- if (pWordProps) {
- secinfo.pWordProps = FX_NEW CPVT_WordProps(*pWordProps);
- }
- }
- AddSection(NewPlace, secinfo);
- newplace = NewPlace;
- if (CSection * pNewSection = m_SectionArray.GetAt(NewPlace.nSecIndex)) {
- for (FX_INT32 w = wordplace.nWordIndex + 1, sz = pSection->m_WordArray.GetSize(); w < sz; w++) {
- if (CPVT_WordInfo * pWord = pSection->m_WordArray.GetAt(w)) {
- NewPlace.nWordIndex++;
- pNewSection->AddWord(NewPlace, *pWord);
- }
- }
- }
- ClearSectionRightWords(wordplace);
- }
- return newplace;
-}
-CPVT_WordPlace CPDF_VariableText::InsertText(const CPVT_WordPlace & place, FX_LPCWSTR text, FX_INT32 charset,
- const CPVT_SecProps * pSecProps, const CPVT_WordProps * pProps)
-{
- CFX_WideString swText = text;
- CPVT_WordPlace wp = place;
- for (FX_INT32 i = 0, sz = swText.GetLength(); i < sz; i++) {
- CPVT_WordPlace oldwp = wp;
- FX_WORD word = swText.GetAt(i);
- switch (word) {
- case 0x0D:
- if (m_bMultiLine) {
- if (swText.GetAt(i + 1) == 0x0A) {
- i += 1;
- }
- wp = InsertSection(wp, pSecProps, pProps);
- }
- break;
- case 0x0A:
- if (m_bMultiLine) {
- if (swText.GetAt(i + 1) == 0x0D) {
- i += 1;
- }
- wp = InsertSection(wp, pSecProps, pProps);
- }
- break;
- case 0x09:
- word = 0x20;
- default:
- wp = InsertWord(wp, word, charset, pProps);
- break;
- }
- if (wp == oldwp) {
- break;
- }
- }
- return wp;
-}
-CPVT_WordPlace CPDF_VariableText::DeleteWords(const CPVT_WordRange & PlaceRange)
-{
- FX_BOOL bLastSecPos = FALSE;
- if (CSection * pSection = m_SectionArray.GetAt(PlaceRange.EndPos.nSecIndex)) {
- bLastSecPos = (PlaceRange.EndPos == pSection->GetEndWordPlace());
- }
- ClearWords(PlaceRange);
- if (PlaceRange.BeginPos.nSecIndex != PlaceRange.EndPos.nSecIndex) {
- ClearEmptySections(PlaceRange);
- if (!bLastSecPos) {
- LinkLatterSection(PlaceRange.BeginPos);
- }
- }
- return PlaceRange.BeginPos;
-}
-CPVT_WordPlace CPDF_VariableText::DeleteWord(const CPVT_WordPlace & place)
-{
- return ClearRightWord(AjustLineHeader(place, TRUE));
-}
-CPVT_WordPlace CPDF_VariableText::BackSpaceWord(const CPVT_WordPlace & place)
-{
- return ClearLeftWord(AjustLineHeader(place, TRUE));
-}
-void CPDF_VariableText::SetText(FX_LPCWSTR text, FX_INT32 charset, const CPVT_SecProps * pSecProps,
- const CPVT_WordProps * pWordProps)
-{
- DeleteWords(CPVT_WordRange(GetBeginWordPlace(), GetEndWordPlace()));
- CFX_WideString swText = text;
- CPVT_WordPlace wp(0, 0, -1);
- CPVT_SectionInfo secinfo;
- if (m_bRichText) {
- if (pSecProps) {
- secinfo.pSecProps = FX_NEW CPVT_SecProps(*pSecProps);
- }
- if (pWordProps) {
- secinfo.pWordProps = FX_NEW CPVT_WordProps(*pWordProps);
- }
- }
- if (CSection * pSection = m_SectionArray.GetAt(0)) {
- pSection->m_SecInfo = secinfo;
- }
- FX_INT32 nCharCount = 0;
- for (FX_INT32 i = 0, sz = swText.GetLength(); i < sz; i++) {
- if (m_nLimitChar > 0 && nCharCount >= m_nLimitChar) {
- break;
- }
- if (m_nCharArray > 0 && nCharCount >= m_nCharArray) {
- break;
- }
- FX_WORD word = swText.GetAt(i);
- switch (word) {
- case 0x0D:
- if (m_bMultiLine) {
- if (swText.GetAt(i + 1) == 0x0A) {
- i += 1;
- }
- wp.nSecIndex ++;
- wp.nLineIndex = 0;
- wp.nWordIndex = -1;
- AddSection(wp, secinfo);
- }
- break;
- case 0x0A:
- if (m_bMultiLine) {
- if (swText.GetAt(i + 1) == 0x0D) {
- i += 1;
- }
- wp.nSecIndex ++;
- wp.nLineIndex = 0;
- wp.nWordIndex = -1;
- AddSection(wp, secinfo);
- }
- break;
- case 0x09:
- word = 0x20;
- default:
- wp = InsertWord(wp, word, charset, pWordProps);
- break;
- }
- nCharCount++;
- }
-}
-void CPDF_VariableText::UpdateWordPlace(CPVT_WordPlace & place) const
-{
- if (place.nSecIndex < 0) {
- place = GetBeginWordPlace();
- }
- if (place.nSecIndex >= m_SectionArray.GetSize()) {
- place = GetEndWordPlace();
- }
- place = AjustLineHeader(place, TRUE);
- if (CSection * pSection = m_SectionArray.GetAt(place.nSecIndex)) {
- pSection->UpdateWordPlace(place);
- }
-}
-FX_INT32 CPDF_VariableText::WordPlaceToWordIndex(const CPVT_WordPlace & place) const
-{
- CPVT_WordPlace newplace = place;
- UpdateWordPlace(newplace);
- FX_INT32 nIndex = 0;
- FX_INT32 i = 0;
- FX_INT32 sz = 0;
- for (i = 0, sz = m_SectionArray.GetSize(); i < sz && i < newplace.nSecIndex; i++) {
- if (CSection * pSection = m_SectionArray.GetAt(i)) {
- nIndex += pSection->m_WordArray.GetSize();
- if (i != m_SectionArray.GetSize() - 1) {
- nIndex += PVT_RETURN_LENGTH;
- }
- }
- }
- if (i >= 0 && i < m_SectionArray.GetSize()) {
- nIndex += newplace.nWordIndex + PVT_RETURN_LENGTH;
- }
- return nIndex;
-}
-CPVT_WordPlace CPDF_VariableText::WordIndexToWordPlace(FX_INT32 index) const
-{
- CPVT_WordPlace place = GetBeginWordPlace();
- FX_INT32 nOldIndex = 0 , nIndex = 0;
- FX_BOOL bFind = FALSE;
- for (FX_INT32 i = 0, sz = m_SectionArray.GetSize(); i < sz; i++) {
- if (CSection * pSection = m_SectionArray.GetAt(i)) {
- nIndex += pSection->m_WordArray.GetSize();
- if (nIndex == index) {
- place = pSection->GetEndWordPlace();
- bFind = TRUE;
- break;
- } else if (nIndex > index) {
- place.nSecIndex = i;
- place.nWordIndex = index - nOldIndex - 1;
- pSection->UpdateWordPlace(place);
- bFind = TRUE;
- break;
- }
- if (i != m_SectionArray.GetSize() - 1) {
- nIndex += PVT_RETURN_LENGTH;
- }
- nOldIndex = nIndex;
- }
- }
- if (!bFind) {
- place = GetEndWordPlace();
- }
- return place;
-}
-CPVT_WordPlace CPDF_VariableText::GetBeginWordPlace() const
-{
- return m_bInitial ? CPVT_WordPlace(0, 0, -1) : CPVT_WordPlace();
-}
-CPVT_WordPlace CPDF_VariableText::GetEndWordPlace() const
-{
- if (CSection * pSection = m_SectionArray.GetAt(m_SectionArray.GetSize() - 1)) {
- return pSection->GetEndWordPlace();
- }
- return CPVT_WordPlace();
-}
-CPVT_WordPlace CPDF_VariableText::GetPrevWordPlace(const CPVT_WordPlace & place) const
-{
- if( place.nSecIndex < 0) {
- return GetBeginWordPlace();
- }
- if (place.nSecIndex >= m_SectionArray.GetSize()) {
- return GetEndWordPlace();
- }
- if (CSection * pSection = m_SectionArray.GetAt(place.nSecIndex)) {
- if (place.WordCmp(pSection->GetBeginWordPlace()) <= 0) {
- if (CSection * pPrevSection = m_SectionArray.GetAt(place.nSecIndex - 1)) {
- return pPrevSection->GetEndWordPlace();
- } else {
- return GetBeginWordPlace();
- }
- } else {
- return pSection->GetPrevWordPlace(place);
- }
- }
- return place;
-}
-CPVT_WordPlace CPDF_VariableText::GetNextWordPlace(const CPVT_WordPlace & place) const
-{
- if (place.nSecIndex < 0) {
- return GetBeginWordPlace();
- }
- if (place.nSecIndex >= m_SectionArray.GetSize()) {
- return GetEndWordPlace();
- }
- if (CSection * pSection = m_SectionArray.GetAt(place.nSecIndex)) {
- if (place.WordCmp(pSection->GetEndWordPlace()) >= 0) {
- if (CSection * pNextSection = m_SectionArray.GetAt(place.nSecIndex + 1)) {
- return pNextSection->GetBeginWordPlace();
- } else {
- return GetEndWordPlace();
- }
- } else {
- return pSection->GetNextWordPlace(place);
- }
- }
- return place;
-}
-CPVT_WordPlace CPDF_VariableText::SearchWordPlace(const CPDF_Point & point) const
-{
- CPDF_Point pt = OutToIn(point);
- CPVT_WordPlace place = GetBeginWordPlace();
- FX_INT32 nLeft = 0;
- FX_INT32 nRight = m_SectionArray.GetSize() - 1;
- FX_INT32 nMid = m_SectionArray.GetSize() / 2;
- FX_BOOL bUp = TRUE;
- FX_BOOL bDown = TRUE;
- while (nLeft <= nRight) {
- if (CSection * pSection = m_SectionArray.GetAt(nMid)) {
- if (IsFloatBigger(pt.y, pSection->m_SecInfo.rcSection.top)) {
- bUp = FALSE;
- }
- if (IsFloatBigger(pSection->m_SecInfo.rcSection.bottom, pt.y)) {
- bDown = FALSE;
- }
- if (IsFloatSmaller(pt.y, pSection->m_SecInfo.rcSection.top)) {
- nRight = nMid - 1;
- nMid = (nLeft + nRight) / 2;
- continue;
- } else if (IsFloatBigger(pt.y, pSection->m_SecInfo.rcSection.bottom)) {
- nLeft = nMid + 1;
- nMid = (nLeft + nRight) / 2;
- continue;
- } else {
- place = pSection->SearchWordPlace(
- CPDF_Point(pt.x - pSection->m_SecInfo.rcSection.left, pt.y - pSection->m_SecInfo.rcSection.top)
- );
- place.nSecIndex = nMid;
- return place;
- }
- } else {
- break;
- }
- }
- if (bUp) {
- place = GetBeginWordPlace();
- }
- if (bDown) {
- place = GetEndWordPlace();
- }
- return place;
-}
-CPVT_WordPlace CPDF_VariableText::GetUpWordPlace(const CPVT_WordPlace & place, const CPDF_Point & point) const
-{
- if (CSection * pSection = m_SectionArray.GetAt(place.nSecIndex)) {
- CPVT_WordPlace temp = place;
- CPDF_Point pt = OutToIn(point);
- if (temp.nLineIndex-- > 0) {
- return pSection->SearchWordPlace(pt.x - pSection->m_SecInfo.rcSection.left, temp);
- } else {
- if (temp.nSecIndex-- > 0) {
- if (CSection * pLastSection = m_SectionArray.GetAt(temp.nSecIndex)) {
- temp.nLineIndex = pLastSection->m_LineArray.GetSize() - 1;
- return pLastSection->SearchWordPlace(pt.x - pLastSection->m_SecInfo.rcSection.left, temp);
- }
- }
- }
- }
- return place;
-}
-CPVT_WordPlace CPDF_VariableText::GetDownWordPlace(const CPVT_WordPlace & place, const CPDF_Point & point) const
-{
- if (CSection * pSection = m_SectionArray.GetAt(place.nSecIndex)) {
- CPVT_WordPlace temp = place;
- CPDF_Point pt = OutToIn(point);
- if (temp.nLineIndex++ < pSection->m_LineArray.GetSize() - 1) {
- return pSection->SearchWordPlace(pt.x - pSection->m_SecInfo.rcSection.left, temp);
- } else {
- if (temp.nSecIndex++ < m_SectionArray.GetSize() - 1) {
- if (CSection * pNextSection = m_SectionArray.GetAt(temp.nSecIndex)) {
- temp.nLineIndex = 0;
- return pNextSection->SearchWordPlace(pt.x - pSection->m_SecInfo.rcSection.left, temp);
- }
- }
- }
- }
- return place;
-}
-CPVT_WordPlace CPDF_VariableText::GetLineBeginPlace(const CPVT_WordPlace & place) const
-{
- return CPVT_WordPlace(place.nSecIndex, place.nLineIndex, -1);
-}
-CPVT_WordPlace CPDF_VariableText::GetLineEndPlace(const CPVT_WordPlace & place) const
-{
- if (CSection * pSection = m_SectionArray.GetAt(place.nSecIndex))
- if (CLine * pLine = pSection->m_LineArray.GetAt(place.nLineIndex)) {
- return pLine->GetEndWordPlace();
- }
- return place;
-}
-CPVT_WordPlace CPDF_VariableText::GetSectionBeginPlace(const CPVT_WordPlace & place) const
-{
- return CPVT_WordPlace(place.nSecIndex, 0, -1);
-}
-CPVT_WordPlace CPDF_VariableText::GetSectionEndPlace(const CPVT_WordPlace & place) const
-{
- if (CSection * pSection = m_SectionArray.GetAt(place.nSecIndex)) {
- return pSection->GetEndWordPlace();
- }
- return place;
-}
-FX_INT32 CPDF_VariableText::GetTotalWords() const
-{
- FX_INT32 nTotal = 0;
- for (FX_INT32 i = 0, sz = m_SectionArray.GetSize(); i < sz; i++)
- if (CSection * pSection = m_SectionArray.GetAt(i)) {
- nTotal += (pSection->m_WordArray.GetSize() + PVT_RETURN_LENGTH);
- }
- return nTotal - PVT_RETURN_LENGTH;
-}
-void CPDF_VariableText::ResetSectionArray()
-{
- for (FX_INT32 s = 0, sz = m_SectionArray.GetSize(); s < sz; s++) {
- delete m_SectionArray.GetAt(s);
- }
- m_SectionArray.RemoveAll();
-}
-CPVT_WordPlace CPDF_VariableText::AddSection(const CPVT_WordPlace & place, const CPVT_SectionInfo & secinfo)
-{
- if (IsValid() && !m_bMultiLine) {
- return place;
- }
- FX_INT32 nSecIndex = FPDF_MAX(FPDF_MIN(place.nSecIndex, m_SectionArray.GetSize()), 0);
- CSection * pSection = FX_NEW CSection(this);
- if (!pSection) {
- return place;
- }
- pSection->m_SecInfo = secinfo;
- pSection->SecPlace.nSecIndex = nSecIndex;
- if (nSecIndex == m_SectionArray.GetSize()) {
- m_SectionArray.Add(pSection);
- } else {
- m_SectionArray.InsertAt(nSecIndex, pSection);
- }
- return place;
-}
-CPVT_WordPlace CPDF_VariableText::AddLine(const CPVT_WordPlace & place, const CPVT_LineInfo & lineinfo)
-{
- if (m_SectionArray.IsEmpty()) {
- return place;
- }
- if (CSection * pSection = m_SectionArray.GetAt(place.nSecIndex)) {
- return pSection->AddLine(lineinfo);
- }
- return place;
-}
-CPVT_WordPlace CPDF_VariableText::AddWord(const CPVT_WordPlace & place, const CPVT_WordInfo & wordinfo)
-{
- if (m_SectionArray.GetSize() <= 0) {
- return place;
- }
- CPVT_WordPlace newplace = place;
- newplace.nSecIndex = FPDF_MAX(FPDF_MIN(newplace.nSecIndex, m_SectionArray.GetSize() - 1), 0);
- if (CSection * pSection = m_SectionArray.GetAt(newplace.nSecIndex)) {
- return pSection->AddWord(newplace, wordinfo);
- }
- return place;
-}
-FX_BOOL CPDF_VariableText::GetWordInfo(const CPVT_WordPlace & place, CPVT_WordInfo & wordinfo)
-{
- if (CSection * pSection = m_SectionArray.GetAt(place.nSecIndex)) {
- if (CPVT_WordInfo * pWord = pSection->m_WordArray.GetAt(place.nWordIndex)) {
- wordinfo = *pWord;
- return TRUE;
- }
- }
- return FALSE;
-}
-FX_BOOL CPDF_VariableText::SetWordInfo(const CPVT_WordPlace & place, const CPVT_WordInfo & wordinfo)
-{
- if (CSection * pSection = m_SectionArray.GetAt(place.nSecIndex)) {
- if (CPVT_WordInfo * pWord = pSection->m_WordArray.GetAt(place.nWordIndex)) {
- *pWord = wordinfo;
- return TRUE;
- }
- }
- return FALSE;
-}
-FX_BOOL CPDF_VariableText::GetLineInfo(const CPVT_WordPlace & place, CPVT_LineInfo & lineinfo)
-{
- if (CSection * pSection = m_SectionArray.GetAt(place.nSecIndex)) {
- if (CLine * pLine = pSection->m_LineArray.GetAt(place.nLineIndex)) {
- lineinfo = pLine->m_LineInfo;
- return TRUE;
- }
- }
- return FALSE;
-}
-FX_BOOL CPDF_VariableText::GetSectionInfo(const CPVT_WordPlace & place, CPVT_SectionInfo & secinfo)
-{
- if (CSection * pSection = m_SectionArray.GetAt(place.nSecIndex)) {
- secinfo = pSection->m_SecInfo;
- return TRUE;
- }
- return FALSE;
-}
-CPDF_Rect CPDF_VariableText::GetContentRect() const
-{
- return InToOut(CPDF_EditContainer::GetContentRect());
-}
-FX_FLOAT CPDF_VariableText::GetWordFontSize(const CPVT_WordInfo & WordInfo, FX_BOOL bFactFontSize)
-{
- return m_bRichText && WordInfo.pWordProps ? (WordInfo.pWordProps->nScriptType == PVTWORD_SCRIPT_NORMAL || bFactFontSize ? WordInfo.pWordProps->fFontSize : WordInfo.pWordProps->fFontSize * PVT_HALF) : GetFontSize();
-}
-FX_INT32 CPDF_VariableText::GetWordFontIndex(const CPVT_WordInfo & WordInfo)
-{
- return m_bRichText && WordInfo.pWordProps ? WordInfo.pWordProps->nFontIndex : WordInfo.nFontIndex;
-}
-FX_FLOAT CPDF_VariableText::GetWordWidth(FX_INT32 nFontIndex, FX_WORD Word, FX_WORD SubWord,
- FX_FLOAT fCharSpace, FX_INT32 nHorzScale,
- FX_FLOAT fFontSize, FX_FLOAT fWordTail, FX_INT32 nWordStyle)
-{
- return (GetCharWidth(nFontIndex, Word, SubWord, nWordStyle) * fFontSize * PVT_FONTSCALE + fCharSpace) * nHorzScale * PVT_PERCENT + fWordTail;
-}
-FX_FLOAT CPDF_VariableText::GetWordWidth(const CPVT_WordInfo & WordInfo)
-{
- return GetWordWidth(GetWordFontIndex(WordInfo), WordInfo.Word, GetSubWord(), GetCharSpace(WordInfo), GetHorzScale(WordInfo),
- GetWordFontSize(WordInfo), WordInfo.fWordTail,
- WordInfo.pWordProps ? WordInfo.pWordProps->nWordStyle : 0);
-}
-FX_FLOAT CPDF_VariableText::GetLineAscent(const CPVT_SectionInfo & SecInfo)
-{
- return m_bRichText && SecInfo.pWordProps ? GetFontAscent(SecInfo.pWordProps->nFontIndex, SecInfo.pWordProps->fFontSize) :
- GetFontAscent(GetDefaultFontIndex(), GetFontSize());
-}
-FX_FLOAT CPDF_VariableText::GetLineDescent(const CPVT_SectionInfo & SecInfo)
-{
- return m_bRichText && SecInfo.pWordProps ? GetFontDescent(SecInfo.pWordProps->nFontIndex, SecInfo.pWordProps->fFontSize) :
- GetFontDescent(GetDefaultFontIndex(), GetFontSize());
-}
-FX_FLOAT CPDF_VariableText::GetFontAscent(FX_INT32 nFontIndex, FX_FLOAT fFontSize)
-{
- return (FX_FLOAT)GetTypeAscent(nFontIndex) * fFontSize * PVT_FONTSCALE;
-}
-FX_FLOAT CPDF_VariableText::GetFontDescent(FX_INT32 nFontIndex, FX_FLOAT fFontSize)
-{
- return (FX_FLOAT)GetTypeDescent(nFontIndex) * fFontSize * PVT_FONTSCALE;
-}
-FX_FLOAT CPDF_VariableText::GetWordAscent(const CPVT_WordInfo & WordInfo, FX_FLOAT fFontSize)
-{
- return GetFontAscent(GetWordFontIndex(WordInfo), fFontSize);
-}
-FX_FLOAT CPDF_VariableText::GetWordDescent(const CPVT_WordInfo & WordInfo, FX_FLOAT fFontSize)
-{
- return GetFontDescent(GetWordFontIndex(WordInfo), fFontSize);
-}
-FX_FLOAT CPDF_VariableText::GetWordAscent(const CPVT_WordInfo & WordInfo, FX_BOOL bFactFontSize)
-{
- return GetFontAscent(GetWordFontIndex(WordInfo), GetWordFontSize(WordInfo, bFactFontSize));
-}
-FX_FLOAT CPDF_VariableText::GetWordDescent(const CPVT_WordInfo & WordInfo, FX_BOOL bFactFontSize)
-{
- return GetFontDescent(GetWordFontIndex(WordInfo), GetWordFontSize(WordInfo, bFactFontSize));
-}
-FX_FLOAT CPDF_VariableText::GetLineLeading(const CPVT_SectionInfo & SecInfo)
-{
- return m_bRichText && SecInfo.pSecProps ? SecInfo.pSecProps->fLineLeading : m_fLineLeading;
-}
-FX_FLOAT CPDF_VariableText::GetLineIndent(const CPVT_SectionInfo & SecInfo)
-{
- return m_bRichText && SecInfo.pSecProps ? SecInfo.pSecProps->fLineIndent : 0.0f;
-}
-FX_INT32 CPDF_VariableText::GetAlignment(const CPVT_SectionInfo& SecInfo)
-{
- return m_bRichText && SecInfo.pSecProps ? SecInfo.pSecProps->nAlignment : this->m_nAlignment;
-}
-FX_FLOAT CPDF_VariableText::GetCharSpace(const CPVT_WordInfo & WordInfo)
-{
- return m_bRichText && WordInfo.pWordProps ? WordInfo.pWordProps->fCharSpace : m_fCharSpace;
-}
-FX_INT32 CPDF_VariableText::GetHorzScale(const CPVT_WordInfo & WordInfo)
-{
- return m_bRichText && WordInfo.pWordProps ? WordInfo.pWordProps->nHorzScale : m_nHorzScale;
-}
-void CPDF_VariableText::ClearSectionRightWords(const CPVT_WordPlace & place)
-{
- CPVT_WordPlace wordplace = AjustLineHeader(place, TRUE);
- if (CSection * pSection = m_SectionArray.GetAt(place.nSecIndex)) {
- for (FX_INT32 w = pSection->m_WordArray.GetSize() - 1; w > wordplace.nWordIndex; w--) {
- delete pSection->m_WordArray.GetAt(w);
- pSection->m_WordArray.RemoveAt(w);
- }
- }
-}
-CPVT_WordPlace CPDF_VariableText::AjustLineHeader(const CPVT_WordPlace & place, FX_BOOL bPrevOrNext) const
-{
- if (place.nWordIndex < 0 && place.nLineIndex > 0) {
- if (bPrevOrNext) {
- return GetPrevWordPlace(place);
- } else {
- return GetNextWordPlace(place);
- }
- }
- return place;
-}
-FX_BOOL CPDF_VariableText::ClearEmptySection(const CPVT_WordPlace & place)
-{
- if (place.nSecIndex == 0 && m_SectionArray.GetSize() == 1) {
- return FALSE;
- }
- if (CSection * pSection = m_SectionArray.GetAt(place.nSecIndex)) {
- if (pSection->m_WordArray.GetSize() == 0) {
- delete pSection;
- m_SectionArray.RemoveAt(place.nSecIndex);
- return TRUE;
- }
- }
- return FALSE;
-}
-void CPDF_VariableText::ClearEmptySections(const CPVT_WordRange & PlaceRange)
-{
- CPVT_WordPlace wordplace;
- for (FX_INT32 s = PlaceRange.EndPos.nSecIndex; s > PlaceRange.BeginPos.nSecIndex; s--) {
- wordplace.nSecIndex = s;
- ClearEmptySection(wordplace);
- }
-}
-void CPDF_VariableText::LinkLatterSection(const CPVT_WordPlace & place)
-{
- CPVT_WordPlace oldplace = AjustLineHeader(place, TRUE);
- if (CSection * pNextSection = m_SectionArray.GetAt(place.nSecIndex + 1)) {
- if (CSection * pSection = m_SectionArray.GetAt(oldplace.nSecIndex)) {
- for (FX_INT32 w = 0, sz = pNextSection->m_WordArray.GetSize(); w < sz; w++) {
- if (CPVT_WordInfo * pWord = pNextSection->m_WordArray.GetAt(w)) {
- oldplace.nWordIndex ++;
- pSection->AddWord(oldplace, *pWord);
- }
- }
- }
- delete pNextSection;
- m_SectionArray.RemoveAt(place.nSecIndex + 1);
- }
-}
-void CPDF_VariableText::ClearWords(const CPVT_WordRange & PlaceRange)
-{
- CPVT_WordRange NewRange;
- NewRange.BeginPos = AjustLineHeader(PlaceRange.BeginPos, TRUE);
- NewRange.EndPos = AjustLineHeader(PlaceRange.EndPos, TRUE);
- for (FX_INT32 s = NewRange.EndPos.nSecIndex; s >= NewRange.BeginPos.nSecIndex; s--) {
- if (CSection * pSection = m_SectionArray.GetAt(s)) {
- pSection->ClearWords(NewRange);
- }
- }
-}
-CPVT_WordPlace CPDF_VariableText::ClearLeftWord(const CPVT_WordPlace & place)
-{
- if (CSection * pSection = m_SectionArray.GetAt(place.nSecIndex)) {
- CPVT_WordPlace leftplace = this->GetPrevWordPlace(place);
- if (leftplace != place) {
- if (leftplace.nSecIndex != place.nSecIndex) {
- if (pSection->m_WordArray.GetSize() == 0) {
- this->ClearEmptySection(place);
- } else {
- this->LinkLatterSection(leftplace);
- }
- } else {
- pSection->ClearWord(place);
- }
- }
- return leftplace;
- }
- return place;
-}
-CPVT_WordPlace CPDF_VariableText::ClearRightWord(const CPVT_WordPlace & place)
-{
- if (CSection * pSection = m_SectionArray.GetAt(place.nSecIndex)) {
- CPVT_WordPlace rightplace = AjustLineHeader(this->GetNextWordPlace(place), FALSE);
- if (rightplace != place) {
- if(rightplace.nSecIndex != place.nSecIndex) {
- LinkLatterSection(place);
- } else {
- pSection->ClearWord(rightplace);
- }
- }
- }
- return place;
-}
-void CPDF_VariableText::RearrangeAll()
-{
- Rearrange(CPVT_WordRange(GetBeginWordPlace(), GetEndWordPlace()));
-}
-void CPDF_VariableText::RearrangePart(const CPVT_WordRange & PlaceRange)
-{
- Rearrange(PlaceRange);
-}
-CPVT_FloatRect CPDF_VariableText::Rearrange(const CPVT_WordRange & PlaceRange)
-{
- CPVT_FloatRect rcRet;
- if (IsValid()) {
- if (m_bAutoFontSize) {
- SetFontSize(GetAutoFontSize());
- rcRet = RearrangeSections(CPVT_WordRange(GetBeginWordPlace(), GetEndWordPlace()));
- } else {
- rcRet = RearrangeSections(PlaceRange);
- }
- }
- SetContentRect(rcRet);
- return rcRet;
-}
-FX_FLOAT CPDF_VariableText::GetAutoFontSize()
-{
- FX_INT32 nTotal = sizeof(gFontSizeSteps) / sizeof(FX_BYTE);
- if (IsMultiLine()) {
- nTotal /= 4;
- }
- if (nTotal <= 0) {
- return 0;
- }
- if (GetPlateWidth() <= 0) {
- return 0;
- }
- FX_INT32 nLeft = 0;
- FX_INT32 nRight = nTotal - 1;
- FX_INT32 nMid = nTotal / 2;
- while (nLeft <= nRight) {
- if (IsBigger(gFontSizeSteps[nMid])) {
- nRight = nMid - 1;
- nMid = (nLeft + nRight) / 2;
- continue;
- } else {
- nLeft = nMid + 1;
- nMid = (nLeft + nRight) / 2;
- continue;
- }
- }
- return (FX_FLOAT)gFontSizeSteps[nMid];
-}
-FX_BOOL CPDF_VariableText::IsBigger(FX_FLOAT fFontSize)
-{
- FX_BOOL bBigger = FALSE;
- CPVT_Size szTotal;
- for (FX_INT32 s = 0, sz = m_SectionArray.GetSize(); s < sz; s++) {
- if (CSection * pSection = m_SectionArray.GetAt(s)) {
- CPVT_Size size = pSection->GetSectionSize(fFontSize);
- szTotal.x = FPDF_MAX(size.x, szTotal.x);
- szTotal.y += size.y;
- if (IsFloatBigger(szTotal.x, GetPlateWidth())
- || IsFloatBigger(szTotal.y, GetPlateHeight())
- ) {
- bBigger = TRUE;
- break;
- }
- }
- }
- return bBigger;
-}
-CPVT_FloatRect CPDF_VariableText::RearrangeSections(const CPVT_WordRange & PlaceRange)
-{
- CPVT_WordPlace place;
- FX_FLOAT fPosY = 0;
- FX_FLOAT fOldHeight;
- FX_INT32 nSSecIndex = PlaceRange.BeginPos.nSecIndex;
- FX_INT32 nESecIndex = PlaceRange.EndPos.nSecIndex;
- CPVT_FloatRect rcRet;
- for (FX_INT32 s = 0, sz = m_SectionArray.GetSize(); s < sz; s++) {
- place.nSecIndex = s;
- if (CSection * pSection = m_SectionArray.GetAt(s)) {
- pSection->SecPlace = place;
- CPVT_FloatRect rcSec = pSection->m_SecInfo.rcSection;
- if (s >= nSSecIndex) {
- if (s <= nESecIndex) {
- rcSec = pSection->Rearrange();
- rcSec.top += fPosY;
- rcSec.bottom += fPosY;
- } else {
- fOldHeight = pSection->m_SecInfo.rcSection.bottom - pSection->m_SecInfo.rcSection.top;
- rcSec.top = fPosY;
- rcSec.bottom = fPosY + fOldHeight;
- }
- pSection->m_SecInfo.rcSection = rcSec;
- pSection->ResetLinePlace();
- }
- if (s == 0) {
- rcRet = rcSec;
- } else {
- rcRet.left = FPDF_MIN(rcSec.left, rcRet.left);
- rcRet.top = FPDF_MIN(rcSec.top, rcRet.top);
- rcRet.right = FPDF_MAX(rcSec.right, rcRet.right);
- rcRet.bottom = FPDF_MAX(rcSec.bottom, rcRet.bottom);
- }
- fPosY += rcSec.Height();
- }
- }
- return rcRet;
-}
-FX_INT32 CPDF_VariableText::GetCharWidth(FX_INT32 nFontIndex, FX_WORD Word, FX_WORD SubWord, FX_INT32 nWordStyle)
-{
- if (m_pVTProvider) {
- if (SubWord > 0) {
- return m_pVTProvider->GetCharWidth(nFontIndex, SubWord, nWordStyle);
- } else {
- return m_pVTProvider->GetCharWidth(nFontIndex, Word, nWordStyle);
- }
- }
- return 0;
-}
-FX_INT32 CPDF_VariableText::GetTypeAscent(FX_INT32 nFontIndex)
-{
- return m_pVTProvider ? m_pVTProvider->GetTypeAscent(nFontIndex) : 0;
-}
-FX_INT32 CPDF_VariableText::GetTypeDescent(FX_INT32 nFontIndex)
-{
- return m_pVTProvider ? m_pVTProvider->GetTypeDescent(nFontIndex) : 0;
-}
-FX_INT32 CPDF_VariableText::GetWordFontIndex(FX_WORD word, FX_INT32 charset, FX_INT32 nFontIndex)
-{
- return m_pVTProvider ? m_pVTProvider->GetWordFontIndex(word, charset, nFontIndex) : -1;
-}
-FX_INT32 CPDF_VariableText::GetDefaultFontIndex()
-{
- return m_pVTProvider ? m_pVTProvider->GetDefaultFontIndex() : -1;
-}
-FX_BOOL CPDF_VariableText::IsLatinWord(FX_WORD word)
-{
- return m_pVTProvider ? m_pVTProvider->IsLatinWord(word) : FALSE;
-}
-IPDF_VariableText_Iterator * CPDF_VariableText::GetIterator()
-{
- if (!m_pVTIterator) {
- return m_pVTIterator = FX_NEW CPDF_VariableText_Iterator(this);
- }
- return m_pVTIterator;
-}
-IPDF_VariableText_Provider* CPDF_VariableText::SetProvider(IPDF_VariableText_Provider * pProvider)
-{
- IPDF_VariableText_Provider* pOld = m_pVTProvider;
- m_pVTProvider = pProvider;
- return pOld;
-}
-CPDF_VariableText_Iterator::CPDF_VariableText_Iterator(CPDF_VariableText * pVT):
- m_pVT(pVT),
- m_CurPos(-1, -1, -1)
-{
-}
-CPDF_VariableText_Iterator::~CPDF_VariableText_Iterator()
-{
-}
-void CPDF_VariableText_Iterator::SetAt(FX_INT32 nWordIndex)
-{
- ASSERT(m_pVT != NULL);
- m_CurPos = m_pVT->WordIndexToWordPlace(nWordIndex);
-}
-void CPDF_VariableText_Iterator::SetAt(const CPVT_WordPlace & place)
-{
- ASSERT(m_pVT != NULL);
- m_CurPos = place;
-}
-FX_BOOL CPDF_VariableText_Iterator::NextWord()
-{
- ASSERT(m_pVT != NULL);
- if (m_CurPos == m_pVT->GetEndWordPlace()) {
- return FALSE;
- }
- m_CurPos = m_pVT->GetNextWordPlace(m_CurPos);
- return TRUE;
-}
-FX_BOOL CPDF_VariableText_Iterator::PrevWord()
-{
- ASSERT(m_pVT != NULL);
- if (m_CurPos == m_pVT->GetBeginWordPlace()) {
- return FALSE;
- }
- m_CurPos = m_pVT->GetPrevWordPlace(m_CurPos);
- return TRUE;
-}
-FX_BOOL CPDF_VariableText_Iterator::NextLine()
-{
- ASSERT(m_pVT != NULL);
- if (CSection * pSection = m_pVT->m_SectionArray.GetAt(m_CurPos.nSecIndex)) {
- if (m_CurPos.nLineIndex < pSection->m_LineArray.GetSize() - 1) {
- m_CurPos = CPVT_WordPlace(m_CurPos.nSecIndex, m_CurPos.nLineIndex + 1, -1);
- return TRUE;
- } else {
- if (m_CurPos.nSecIndex < m_pVT->m_SectionArray.GetSize() - 1) {
- m_CurPos = CPVT_WordPlace(m_CurPos.nSecIndex + 1, 0, -1);
- return TRUE;
- }
- }
- }
- return FALSE;
-}
-FX_BOOL CPDF_VariableText_Iterator::PrevLine()
-{
- ASSERT(m_pVT != NULL);
- if (CSection * pSection = m_pVT->m_SectionArray.GetAt(m_CurPos.nSecIndex)) {
- if (m_CurPos.nLineIndex > 0) {
- m_CurPos = CPVT_WordPlace(m_CurPos.nSecIndex, m_CurPos.nLineIndex - 1, -1);
- return TRUE;
- } else {
- if (m_CurPos.nSecIndex > 0) {
- if (CSection * pLastSection = m_pVT->m_SectionArray.GetAt(m_CurPos.nSecIndex - 1)) {
- m_CurPos = CPVT_WordPlace(m_CurPos.nSecIndex - 1, pLastSection->m_LineArray.GetSize() - 1, -1);
- return TRUE;
- }
- }
- }
- }
- return FALSE;
-}
-FX_BOOL CPDF_VariableText_Iterator::NextSection()
-{
- ASSERT(m_pVT != NULL);
- if (m_CurPos.nSecIndex < m_pVT->m_SectionArray.GetSize() - 1) {
- m_CurPos = CPVT_WordPlace(m_CurPos.nSecIndex + 1, 0, -1);
- return TRUE;
- }
- return FALSE;
-}
-FX_BOOL CPDF_VariableText_Iterator::PrevSection()
-{
- ASSERT(m_pVT != NULL);
- if (m_CurPos.nSecIndex > 0) {
- m_CurPos = CPVT_WordPlace(m_CurPos.nSecIndex - 1, 0, -1);
- return TRUE;
- }
- return FALSE;
-}
-FX_BOOL CPDF_VariableText_Iterator::GetWord(CPVT_Word & word) const
-{
- ASSERT(m_pVT != NULL);
- word.WordPlace = m_CurPos;
- if (CSection * pSection = m_pVT->m_SectionArray.GetAt(m_CurPos.nSecIndex)) {
- if (CLine * pLine = pSection->m_LineArray.GetAt(m_CurPos.nLineIndex)) {
- if (CPVT_WordInfo * pWord = pSection->m_WordArray.GetAt(m_CurPos.nWordIndex)) {
- word.Word = pWord->Word;
- word.nCharset = pWord->nCharset;
- word.fWidth = m_pVT->GetWordWidth(*pWord);
- word.ptWord = m_pVT->InToOut(
- CPDF_Point(pWord->fWordX + pSection->m_SecInfo.rcSection.left,
- pWord->fWordY + pSection->m_SecInfo.rcSection.top) );
- word.fAscent = m_pVT->GetWordAscent(*pWord);
- word.fDescent = m_pVT->GetWordDescent(*pWord);
- if (pWord->pWordProps) {
- word.WordProps = *pWord->pWordProps;
- }
- word.nFontIndex = m_pVT->GetWordFontIndex(*pWord);
- word.fFontSize = m_pVT->GetWordFontSize(*pWord);
- return TRUE;
- }
- }
- }
- return FALSE;
-}
-FX_BOOL CPDF_VariableText_Iterator::SetWord(const CPVT_Word & word)
-{
- ASSERT(m_pVT != NULL);
- if (CSection * pSection = m_pVT->m_SectionArray.GetAt(m_CurPos.nSecIndex)) {
- if (CPVT_WordInfo * pWord = pSection->m_WordArray.GetAt(m_CurPos.nWordIndex)) {
- if (pWord->pWordProps) {
- *pWord->pWordProps = word.WordProps;
- }
- return TRUE;
- }
- }
- return FALSE;
-}
-FX_BOOL CPDF_VariableText_Iterator::GetLine(CPVT_Line & line) const
-{
- ASSERT(m_pVT != NULL);
- line.lineplace = CPVT_WordPlace(m_CurPos.nSecIndex, m_CurPos.nLineIndex, -1);
- if (CSection * pSection = m_pVT->m_SectionArray.GetAt(m_CurPos.nSecIndex)) {
- if (CLine * pLine = pSection->m_LineArray.GetAt(m_CurPos.nLineIndex)) {
- line.ptLine = m_pVT->InToOut(
- CPDF_Point(pLine->m_LineInfo.fLineX + pSection->m_SecInfo.rcSection.left,
- pLine->m_LineInfo.fLineY + pSection->m_SecInfo.rcSection.top) );
- line.fLineWidth = pLine->m_LineInfo.fLineWidth;
- line.fLineAscent = pLine->m_LineInfo.fLineAscent;
- line.fLineDescent = pLine->m_LineInfo.fLineDescent;
- line.lineEnd = pLine->GetEndWordPlace();
- return TRUE;
- }
- }
- return FALSE;
-}
-FX_BOOL CPDF_VariableText_Iterator::GetSection(CPVT_Section & section) const
-{
- ASSERT(m_pVT != NULL);
- section.secplace = CPVT_WordPlace(m_CurPos.nSecIndex, 0, -1);
- if (CSection * pSection = m_pVT->m_SectionArray.GetAt(m_CurPos.nSecIndex)) {
- section.rcSection = m_pVT->InToOut(pSection->m_SecInfo.rcSection);
- if (pSection->m_SecInfo.pSecProps) {
- section.SecProps = *pSection->m_SecInfo.pSecProps;
- }
- if (pSection->m_SecInfo.pWordProps) {
- section.WordProps = *pSection->m_SecInfo.pWordProps;
- }
- return TRUE;
- }
- return FALSE;
-}
-FX_BOOL CPDF_VariableText_Iterator::SetSection(const CPVT_Section & section)
-{
- ASSERT(m_pVT != NULL);
- if (CSection * pSection = m_pVT->m_SectionArray.GetAt(m_CurPos.nSecIndex)) {
- if (pSection->m_SecInfo.pSecProps) {
- *pSection->m_SecInfo.pSecProps = section.SecProps;
- }
- if (pSection->m_SecInfo.pWordProps) {
- *pSection->m_SecInfo.pWordProps = section.WordProps;
- }
- return TRUE;
- }
- return FALSE;
-}
+// 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
+
+#include "../../include/fpdfdoc/fpdf_doc.h"
+#include "../../include/fpdfdoc/fpdf_vt.h"
+#include "pdf_vt.h"
+const FX_BYTE gFontSizeSteps[] = { 4, 6, 8, 9, 10, 12, 14, 18, 20, 25, 30, 35, 40, 45, 50, 55, 60, 70, 80, 90, 100, 110, 120, 130, 144};
+#define PVT_RETURN_LENGTH 1
+#define PVT_DEFAULT_FONTSIZE 18.0f
+#define PVTWORD_SCRIPT_NORMAL 0
+#define PVTWORD_SCRIPT_SUPER 1
+#define PVTWORD_SCRIPT_SUB 2
+#define PVT_FONTSCALE 0.001f
+#define PVT_PERCENT 0.01f
+#define PVT_HALF 0.5f
+CLine::CLine()
+{
+}
+CLine::~CLine()
+{
+}
+CPVT_WordPlace CLine::GetBeginWordPlace() const
+{
+ return CPVT_WordPlace(LinePlace.nSecIndex, LinePlace.nLineIndex, -1);
+}
+CPVT_WordPlace CLine::GetEndWordPlace() const
+{
+ return CPVT_WordPlace(LinePlace.nSecIndex, LinePlace.nLineIndex, m_LineInfo.nEndWordIndex);
+}
+CPVT_WordPlace CLine::GetPrevWordPlace(const CPVT_WordPlace & place) const
+{
+ if (place.nWordIndex > m_LineInfo.nEndWordIndex) {
+ return CPVT_WordPlace(place.nSecIndex, place.nLineIndex, m_LineInfo.nEndWordIndex);
+ }
+ return CPVT_WordPlace(place.nSecIndex, place.nLineIndex, place.nWordIndex - 1);
+}
+CPVT_WordPlace CLine::GetNextWordPlace(const CPVT_WordPlace & place) const
+{
+ if (place.nWordIndex < m_LineInfo.nBeginWordIndex) {
+ return CPVT_WordPlace(place.nSecIndex, place.nLineIndex, m_LineInfo.nBeginWordIndex);
+ }
+ return CPVT_WordPlace(place.nSecIndex, place.nLineIndex, place.nWordIndex + 1);
+}
+CSection::CSection(CPDF_VariableText * pVT) : m_pVT(pVT)
+{
+}
+CSection::~CSection()
+{
+ ResetAll();
+}
+void CSection::ResetAll()
+{
+ ResetWordArray();
+ ResetLineArray();
+}
+void CSection::ResetLineArray()
+{
+ m_LineArray.RemoveAll();
+}
+void CSection::ResetWordArray()
+{
+ for (FX_INT32 i = 0, sz = m_WordArray.GetSize(); i < sz; i++) {
+ delete m_WordArray.GetAt(i);
+ }
+ m_WordArray.RemoveAll();
+}
+void CSection::ResetLinePlace()
+{
+ for (FX_INT32 i = 0, sz = m_LineArray.GetSize(); i < sz; i++) {
+ if (CLine * pLine = m_LineArray.GetAt(i)) {
+ pLine->LinePlace = CPVT_WordPlace(SecPlace.nSecIndex, i, -1);
+ }
+ }
+}
+CPVT_WordPlace CSection::AddWord(const CPVT_WordPlace & place, const CPVT_WordInfo & wordinfo)
+{
+ if (CPVT_WordInfo * pWord = FX_NEW CPVT_WordInfo(wordinfo)) {
+ FX_INT32 nWordIndex = FPDF_MAX(FPDF_MIN(place.nWordIndex, this->m_WordArray.GetSize()), 0);
+ if (nWordIndex == m_WordArray.GetSize()) {
+ m_WordArray.Add(pWord);
+ } else {
+ m_WordArray.InsertAt(nWordIndex, pWord);
+ }
+ }
+ return place;
+}
+CPVT_WordPlace CSection::AddLine(const CPVT_LineInfo & lineinfo)
+{
+ return CPVT_WordPlace(SecPlace.nSecIndex, m_LineArray.Add(lineinfo), -1);
+}
+CPVT_FloatRect CSection::Rearrange()
+{
+ ASSERT(m_pVT != NULL);
+ if (m_pVT->m_nCharArray > 0) {
+ return CTypeset(this).CharArray();
+ } else {
+ return CTypeset(this).Typeset();
+ }
+}
+CPVT_Size CSection::GetSectionSize(FX_FLOAT fFontSize)
+{
+ return CTypeset(this).GetEditSize(fFontSize);
+}
+CPVT_WordPlace CSection::GetBeginWordPlace() const
+{
+ if (CLine * pLine = m_LineArray.GetAt(0)) {
+ return pLine->GetBeginWordPlace();
+ } else {
+ return SecPlace;
+ }
+}
+CPVT_WordPlace CSection::GetEndWordPlace() const
+{
+ if (CLine * pLine = m_LineArray.GetAt(m_LineArray.GetSize() - 1)) {
+ return pLine->GetEndWordPlace();
+ } else {
+ return this->SecPlace;
+ }
+}
+CPVT_WordPlace CSection::GetPrevWordPlace(const CPVT_WordPlace & place) const
+{
+ if (place.nLineIndex < 0) {
+ return GetBeginWordPlace();
+ }
+ if (place.nLineIndex >= m_LineArray.GetSize()) {
+ return GetEndWordPlace();
+ }
+ if (CLine * pLine = m_LineArray.GetAt(place.nLineIndex)) {
+ if (place.nWordIndex == pLine->m_LineInfo.nBeginWordIndex) {
+ return CPVT_WordPlace(place.nSecIndex, place.nLineIndex, -1);
+ } else if (place.nWordIndex < pLine->m_LineInfo.nBeginWordIndex) {
+ if (CLine * pPrevLine = m_LineArray.GetAt(place.nLineIndex - 1)) {
+ return pPrevLine->GetEndWordPlace();
+ }
+ } else {
+ return pLine->GetPrevWordPlace(place);
+ }
+ }
+ return place;
+}
+CPVT_WordPlace CSection::GetNextWordPlace(const CPVT_WordPlace & place) const
+{
+ if (place.nLineIndex < 0) {
+ return GetBeginWordPlace();
+ }
+ if (place.nLineIndex >= m_LineArray.GetSize()) {
+ return GetEndWordPlace();
+ }
+ if (CLine * pLine = m_LineArray.GetAt(place.nLineIndex)) {
+ if (place.nWordIndex >= pLine->m_LineInfo.nEndWordIndex) {
+ if (CLine * pNextLine = m_LineArray.GetAt(place.nLineIndex + 1)) {
+ return pNextLine->GetBeginWordPlace();
+ }
+ } else {
+ return pLine->GetNextWordPlace(place);
+ }
+ }
+ return place;
+}
+void CSection::UpdateWordPlace(CPVT_WordPlace & place) const
+{
+ FX_INT32 nLeft = 0;
+ FX_INT32 nRight = m_LineArray.GetSize() - 1;
+ FX_INT32 nMid = (nLeft + nRight) / 2;
+ while (nLeft <= nRight) {
+ if (CLine * pLine = m_LineArray.GetAt(nMid)) {
+ if (place.nWordIndex < pLine->m_LineInfo.nBeginWordIndex) {
+ nRight = nMid - 1;
+ nMid = (nLeft + nRight) / 2;
+ } else if (place.nWordIndex > pLine->m_LineInfo.nEndWordIndex) {
+ nLeft = nMid + 1;
+ nMid = (nLeft + nRight) / 2;
+ } else {
+ place.nLineIndex = nMid;
+ return;
+ }
+ } else {
+ break;
+ }
+ }
+}
+CPVT_WordPlace CSection::SearchWordPlace(const CPDF_Point & point) const
+{
+ ASSERT(m_pVT != NULL);
+ CPVT_WordPlace place = GetBeginWordPlace();
+ FX_BOOL bUp = TRUE;
+ FX_BOOL bDown = TRUE;
+ FX_INT32 nLeft = 0;
+ FX_INT32 nRight = m_LineArray.GetSize() - 1;
+ FX_INT32 nMid = m_LineArray.GetSize() / 2;
+ FX_FLOAT fTop = 0;
+ FX_FLOAT fBottom = 0;
+ while (nLeft <= nRight) {
+ if (CLine * pLine = m_LineArray.GetAt(nMid)) {
+ fTop = pLine->m_LineInfo.fLineY - pLine->m_LineInfo.fLineAscent - m_pVT->GetLineLeading(m_SecInfo);
+ fBottom = pLine->m_LineInfo.fLineY - pLine->m_LineInfo.fLineDescent;
+ if (IsFloatBigger(point.y, fTop)) {
+ bUp = FALSE;
+ }
+ if (IsFloatSmaller(point.y, fBottom)) {
+ bDown = FALSE;
+ }
+ if (IsFloatSmaller(point.y, fTop)) {
+ nRight = nMid - 1;
+ nMid = (nLeft + nRight) / 2;
+ continue;
+ } else if (IsFloatBigger(point.y, fBottom)) {
+ nLeft = nMid + 1;
+ nMid = (nLeft + nRight) / 2;
+ continue;
+ } else {
+ place = SearchWordPlace(point.x,
+ CPVT_WordRange(pLine->GetNextWordPlace(pLine->GetBeginWordPlace()), pLine->GetEndWordPlace())
+ );
+ place.nLineIndex = nMid;
+ return place;
+ }
+ }
+ }
+ if (bUp) {
+ place = GetBeginWordPlace();
+ }
+ if (bDown) {
+ place = GetEndWordPlace();
+ }
+ return place;
+}
+CPVT_WordPlace CSection::SearchWordPlace(FX_FLOAT fx, const CPVT_WordPlace & lineplace) const
+{
+ if (CLine * pLine = m_LineArray.GetAt(lineplace.nLineIndex)) {
+ return SearchWordPlace(fx - m_SecInfo.rcSection.left,
+ CPVT_WordRange(pLine->GetNextWordPlace(pLine->GetBeginWordPlace()), pLine->GetEndWordPlace()));
+ }
+ return GetBeginWordPlace();
+}
+CPVT_WordPlace CSection::SearchWordPlace(FX_FLOAT fx, const CPVT_WordRange & range) const
+{
+ CPVT_WordPlace wordplace = range.BeginPos;
+ wordplace.nWordIndex = -1;
+ if (!m_pVT) {
+ return wordplace;
+ }
+ FX_INT32 nLeft = range.BeginPos.nWordIndex;
+ FX_INT32 nRight = range.EndPos.nWordIndex + 1;
+ FX_INT32 nMid = (nLeft + nRight) / 2;
+ while (nLeft < nRight) {
+ if (nMid == nLeft) {
+ break;
+ }
+ if (nMid == nRight) {
+ nMid--;
+ break;
+ }
+ if (CPVT_WordInfo * pWord = m_WordArray.GetAt(nMid)) {
+ if (fx > pWord->fWordX + m_pVT->GetWordWidth(*pWord) * PVT_HALF) {
+ nLeft = nMid;
+ nMid = (nLeft + nRight) / 2;
+ continue;
+ } else {
+ nRight = nMid;
+ nMid = (nLeft + nRight) / 2;
+ continue;
+ }
+ } else {
+ break;
+ }
+ }
+ if (CPVT_WordInfo * pWord = m_WordArray.GetAt(nMid)) {
+ if (fx > pWord->fWordX + m_pVT->GetWordWidth(*pWord) * PVT_HALF) {
+ wordplace.nWordIndex = nMid;
+ }
+ }
+ return wordplace;
+}
+void CSection::ClearLeftWords(FX_INT32 nWordIndex)
+{
+ for (FX_INT32 i = nWordIndex; i >= 0; i--) {
+ delete m_WordArray.GetAt(i);
+ m_WordArray.RemoveAt(i);
+ }
+}
+void CSection::ClearRightWords(FX_INT32 nWordIndex)
+{
+ for (FX_INT32 i = m_WordArray.GetSize() - 1; i > nWordIndex; i--) {
+ delete m_WordArray.GetAt(i);
+ m_WordArray.RemoveAt(i);
+ }
+}
+void CSection::ClearMidWords(FX_INT32 nBeginIndex, FX_INT32 nEndIndex)
+{
+ for (FX_INT32 i = nEndIndex; i > nBeginIndex; i--) {
+ delete m_WordArray.GetAt(i);
+ m_WordArray.RemoveAt(i);
+ }
+}
+void CSection::ClearWords(const CPVT_WordRange & PlaceRange)
+{
+ CPVT_WordPlace SecBeginPos = GetBeginWordPlace();
+ CPVT_WordPlace SecEndPos = GetEndWordPlace();
+ if (PlaceRange.BeginPos.WordCmp(SecBeginPos) >= 0) {
+ if (PlaceRange.EndPos.WordCmp(SecEndPos) <= 0) {
+ ClearMidWords(PlaceRange.BeginPos.nWordIndex, PlaceRange.EndPos.nWordIndex);
+ } else {
+ ClearRightWords(PlaceRange.BeginPos.nWordIndex);
+ }
+ } else if (PlaceRange.EndPos.WordCmp(SecEndPos) <= 0) {
+ ClearLeftWords(PlaceRange.EndPos.nWordIndex);
+ } else {
+ ResetWordArray();
+ }
+}
+void CSection::ClearWord(const CPVT_WordPlace & place)
+{
+ delete m_WordArray.GetAt(place.nWordIndex);
+ m_WordArray.RemoveAt(place.nWordIndex);
+}
+CTypeset::CTypeset(CSection * pSection) : m_pSection(pSection), m_pVT(pSection->m_pVT), m_rcRet(0.0f, 0.0f, 0.0f, 0.0f)
+{
+}
+CTypeset::~CTypeset()
+{
+}
+CPVT_FloatRect CTypeset::CharArray()
+{
+ ASSERT(m_pSection != NULL);
+ ASSERT(m_pVT != NULL);
+ FX_FLOAT fLineAscent = m_pVT->GetFontAscent(m_pVT->GetDefaultFontIndex(), m_pVT->GetFontSize());
+ FX_FLOAT fLineDescent = m_pVT->GetFontDescent(m_pVT->GetDefaultFontIndex(), m_pVT->GetFontSize());
+ m_rcRet.Default();
+ FX_FLOAT x = 0.0f, y = 0.0f;
+ FX_FLOAT fNextWidth;
+ FX_INT32 nStart = 0;
+ FX_FLOAT fNodeWidth = m_pVT->GetPlateWidth() / (m_pVT->m_nCharArray <= 0 ? 1 : m_pVT->m_nCharArray);
+ if (CLine * pLine = m_pSection->m_LineArray.GetAt(0)) {
+ x = 0.0f;
+ y += m_pVT->GetLineLeading(m_pSection->m_SecInfo);
+ y += fLineAscent;
+ nStart = 0;
+ switch (m_pVT->GetAlignment(m_pSection->m_SecInfo)) {
+ case 0:
+ pLine->m_LineInfo.fLineX = fNodeWidth * PVT_HALF;
+ break;
+ case 1:
+ nStart = (m_pVT->m_nCharArray - m_pSection->m_WordArray.GetSize()) / 2;
+ pLine->m_LineInfo.fLineX = fNodeWidth * nStart - fNodeWidth * PVT_HALF;
+ break;
+ case 2:
+ nStart = m_pVT->m_nCharArray - m_pSection->m_WordArray.GetSize();
+ pLine->m_LineInfo.fLineX = fNodeWidth * nStart - fNodeWidth * PVT_HALF;
+ break;
+ }
+ for (FX_INT32 w = 0, sz = m_pSection->m_WordArray.GetSize(); w < sz; w++) {
+ if (w >= m_pVT->m_nCharArray) {
+ break;
+ }
+ fNextWidth = 0;
+ if (CPVT_WordInfo * pNextWord = (CPVT_WordInfo *)m_pSection->m_WordArray.GetAt(w + 1)) {
+ pNextWord->fWordTail = 0;
+ fNextWidth = m_pVT->GetWordWidth(*pNextWord);
+ }
+ if (CPVT_WordInfo * pWord = (CPVT_WordInfo *)m_pSection->m_WordArray.GetAt(w)) {
+ pWord->fWordTail = 0;
+ FX_FLOAT fWordWidth = m_pVT->GetWordWidth(*pWord);
+ FX_FLOAT fWordAscent = m_pVT->GetWordAscent(*pWord);
+ FX_FLOAT fWordDescent = m_pVT->GetWordDescent(*pWord);
+ x = (FX_FLOAT)(fNodeWidth * (w + nStart + 0.5) - fWordWidth * PVT_HALF);
+ pWord->fWordX = x;
+ pWord->fWordY = y;
+ if (w == 0) {
+ pLine->m_LineInfo.fLineX = x;
+ }
+ if (w != m_pSection->m_WordArray.GetSize() - 1)
+ pWord->fWordTail = (fNodeWidth - (fWordWidth + fNextWidth) * PVT_HALF > 0 ?
+ fNodeWidth - (fWordWidth + fNextWidth) * PVT_HALF : 0);
+ else {
+ pWord->fWordTail = 0;
+ }
+ x += fWordWidth;
+ fLineAscent = FPDF_MAX(fLineAscent, fWordAscent);
+ fLineDescent = FPDF_MIN(fLineDescent, fWordDescent);
+ }
+ }
+ pLine->m_LineInfo.nBeginWordIndex = 0;
+ pLine->m_LineInfo.nEndWordIndex = m_pSection->m_WordArray.GetSize() - 1;
+ pLine->m_LineInfo.fLineY = y;
+ pLine->m_LineInfo.fLineWidth = x - pLine->m_LineInfo.fLineX;
+ pLine->m_LineInfo.fLineAscent = fLineAscent;
+ pLine->m_LineInfo.fLineDescent = fLineDescent;
+ y += (-fLineDescent);
+ }
+ return m_rcRet = CPVT_FloatRect(0, 0, x, y);
+}
+CPVT_Size CTypeset::GetEditSize(FX_FLOAT fFontSize)
+{
+ ASSERT(m_pSection != NULL);
+ ASSERT(m_pVT != NULL);
+ SplitLines(FALSE, fFontSize);
+ return CPVT_Size(m_rcRet.Width(), m_rcRet.Height());
+}
+CPVT_FloatRect CTypeset::Typeset()
+{
+ ASSERT(m_pSection != NULL);
+ ASSERT(m_pVT != NULL);
+ m_pSection->m_LineArray.Empty();
+ SplitLines(TRUE, 0.0f);
+ m_pSection->m_LineArray.Clear();
+ OutputLines();
+ return m_rcRet;
+}
+static int special_chars[128] = {
+ 0x0000, 0x000C, 0x0008, 0x000C, 0x0008, 0x0000, 0x0020, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0008, 0x0008, 0x0000, 0x0010, 0x0000, 0x0000, 0x0028,
+ 0x000C, 0x0008, 0x0000, 0x0000, 0x0028, 0x0028, 0x0028, 0x0028,
+ 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002,
+ 0x0002, 0x0002, 0x0008, 0x0008, 0x0000, 0x0000, 0x0000, 0x0008,
+ 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001,
+ 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001,
+ 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001,
+ 0x0001, 0x0001, 0x0001, 0x000C, 0x0000, 0x0008, 0x0000, 0x0000,
+ 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001,
+ 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001,
+ 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001,
+ 0x0001, 0x0001, 0x0001, 0x000C, 0x0000, 0x0008, 0x0000, 0x0000,
+};
+static FX_BOOL IsLatin(FX_WORD word)
+{
+ if (word <= 0x007F) {
+ if (special_chars[word] & 0x0001) {
+ return TRUE;
+ }
+ }
+ if ((word >= 0x00C0 && word <= 0x00FF) ||
+ (word >= 0x0100 && word <= 0x024F) ||
+ (word >= 0x1E00 && word <= 0x1EFF) ||
+ (word >= 0x2C60 && word <= 0x2C7F) ||
+ (word >= 0xA720 && word <= 0xA7FF) ||
+ (word >= 0xFF21 && word <= 0xFF3A) ||
+ (word >= 0xFF41 && word <= 0xFF5A)) {
+ return TRUE;
+ }
+ return FALSE;
+}
+static FX_BOOL IsDigit(FX_DWORD word)
+{
+ return (word >= 0x0030 && word <= 0x0039) ? TRUE : FALSE;
+}
+static FX_BOOL IsCJK(FX_DWORD word)
+{
+ if ((word >= 0x1100 && word <= 0x11FF) ||
+ (word >= 0x2E80 && word <= 0x2FFF) ||
+ (word >= 0x3040 && word <= 0x9FBF) ||
+ (word >= 0xAC00 && word <= 0xD7AF) ||
+ (word >= 0xF900 && word <= 0xFAFF) ||
+ (word >= 0xFE30 && word <= 0xFE4F) ||
+ (word >= 0x20000 && word <= 0x2A6DF) ||
+ (word >= 0x2F800 && word <= 0x2FA1F)) {
+ return TRUE;
+ }
+ if (word >= 0x3000 && word <= 0x303F) {
+ if (word == 0x3005 || word == 0x3006 || word == 0x3021 || word == 0x3022 ||
+ word == 0x3023 || word == 0x3024 || word == 0x3025 || word == 0x3026 ||
+ word == 0x3027 || word == 0x3028 || word == 0x3029 || word == 0x3031 ||
+ word == 0x3032 || word == 0x3033 || word == 0x3034 || word == 0x3035) {
+ return TRUE;
+ }
+ return FALSE;
+ }
+ if (word >= 0xFF66 && word <= 0xFF9D) {
+ return TRUE;
+ }
+ return FALSE;
+}
+static FX_BOOL IsPunctuation(FX_DWORD word)
+{
+ if (word <= 0x007F) {
+ if ((special_chars[word] >> 3) & 1) {
+ return TRUE;
+ }
+ } else if (word >= 0x0080 && word <= 0x00FF) {
+ if (word == 0x0082 || word == 0x0084 || word == 0x0085 || word == 0x0091 ||
+ word == 0x0092 || word == 0x0093 || word <= 0x0094 || word == 0x0096 ||
+ word == 0x00B4 || word == 0x00B8) {
+ return TRUE;
+ }
+ } else if (word >= 0x2000 && word <= 0x206F) {
+ if (word == 0x2010 || word == 0x2011 || word == 0x2012 || word == 0x2013 ||
+ word == 0x2018 || word == 0x2019 || word == 0x201A || word == 0x201B ||
+ word == 0x201C || word == 0x201D || word == 0x201E || word == 0x201F ||
+ word == 0x2032 || word == 0x2033 || word == 0x2034 || word == 0x2035 ||
+ word == 0x2036 || word == 0x2037 || word == 0x203C || word == 0x203D ||
+ word == 0x203E || word == 0x2044) {
+ return TRUE;
+ }
+ } else if (word >= 0x3000 && word <= 0x303F) {
+ if (word == 0x3001 || word == 0x3002 || word == 0x3003 || word == 0x3005 ||
+ word == 0x3009 || word == 0x300A || word == 0x300B || word == 0x300C ||
+ word == 0x300D || word == 0x300F || word == 0x300E || word == 0x3010 ||
+ word == 0x3011 || word == 0x3014 || word == 0x3015 || word == 0x3016 ||
+ word == 0x3017 || word == 0x3018 || word == 0x3019 || word == 0x301A ||
+ word == 0x301B || word == 0x301D || word == 0x301E || word == 0x301F) {
+ return TRUE;
+ }
+ } else if (word >= 0xFE50 && word <= 0xFE6F) {
+ if ((word >= 0xFE50 && word <= 0xFE5E) || word == 0xFE63) {
+ return TRUE;
+ }
+ } else if (word >= 0xFF00 && word <= 0xFFEF) {
+ if (word == 0xFF01 || word == 0xFF02 || word == 0xFF07 || word == 0xFF08 ||
+ word == 0xFF09 || word == 0xFF0C || word == 0xFF0E || word == 0xFF0F ||
+ word == 0xFF1A || word == 0xFF1B || word == 0xFF1F || word == 0xFF3B ||
+ word == 0xFF3D || word == 0xFF40 || word == 0xFF5B || word == 0xFF5C ||
+ word == 0xFF5D || word == 0xFF61 || word == 0xFF62 || word == 0xFF63 ||
+ word == 0xFF64 || word == 0xFF65 || word == 0xFF9E || word == 0xFF9F) {
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+static FX_BOOL IsConnectiveSymbol(FX_DWORD word)
+{
+ if (word <= 0x007F) {
+ if ((special_chars[word] >> 5) & 1) {
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+static FX_BOOL IsOpenStylePunctuation(FX_DWORD word)
+{
+ if (word <= 0x007F) {
+ if ((special_chars[word] >> 2) & 1) {
+ return TRUE;
+ }
+ } else if (word == 0x300A || word == 0x300C || word == 0x300E || word == 0x3010 ||
+ word == 0x3014 || word == 0x3016 || word == 0x3018 || word == 0x301A ||
+ word == 0xFF08 || word == 0xFF3B || word == 0xFF5B || word == 0xFF62) {
+ return TRUE;
+ }
+ return FALSE;
+}
+static FX_BOOL IsCurrencySymbol(FX_WORD word)
+{
+ if (word == 0x0024 || word == 0x0080 || word == 0x00A2 || word == 0x00A3 ||
+ word == 0x00A4 || word == 0x00A5 || (word >= 0x20A0 && word <= 0x20CF) ||
+ word == 0xFE69 || word == 0xFF04 || word == 0xFFE0 || word == 0xFFE1 ||
+ word == 0xFFE5 || word == 0xFFE6) {
+ return TRUE;
+ }
+ return FALSE;
+}
+static FX_BOOL IsPrefixSymbol(FX_WORD word)
+{
+ if (IsCurrencySymbol(word)) {
+ return TRUE;
+ }
+ if (word == 0x2116) {
+ return TRUE;
+ }
+ return FALSE;
+}
+static FX_BOOL IsSpace(FX_WORD word)
+{
+ return (word == 0x0020 || word == 0x3000) ? TRUE : FALSE;
+}
+static FX_BOOL NeedDivision(FX_WORD prevWord, FX_WORD curWord)
+{
+ if ((IsLatin(prevWord) || IsDigit(prevWord)) && (IsLatin(curWord) || IsDigit(curWord))) {
+ return FALSE;
+ } else if (IsSpace(curWord) || IsPunctuation(curWord)) {
+ return FALSE;
+ } else if (IsConnectiveSymbol(prevWord) || IsConnectiveSymbol(curWord)) {
+ return FALSE;
+ } else if (IsSpace(prevWord) || IsPunctuation(prevWord)) {
+ return TRUE;
+ } else if (IsPrefixSymbol(prevWord)) {
+ return FALSE;
+ } else if (IsPrefixSymbol(curWord) || IsCJK(curWord)) {
+ return TRUE;
+ } else if (IsCJK(prevWord)) {
+ return TRUE;
+ }
+ return FALSE;
+}
+void CTypeset::SplitLines(FX_BOOL bTypeset, FX_FLOAT fFontSize)
+{
+ ASSERT(m_pVT != NULL);
+ ASSERT(m_pSection != NULL);
+ FX_INT32 nLineHead = 0;
+ FX_INT32 nLineTail = 0;
+ FX_FLOAT fMaxX = 0.0f, fMaxY = 0.0f;
+ FX_FLOAT fLineWidth = 0.0f, fBackupLineWidth = 0.0f;
+ FX_FLOAT fLineAscent = 0.0f, fBackupLineAscent = 0.0f;
+ FX_FLOAT fLineDescent = 0.0f, fBackupLineDescent = 0.0f;
+ FX_INT32 nWordStartPos = 0;
+ FX_BOOL bFullWord = FALSE;
+ FX_INT32 nLineFullWordIndex = 0;
+ FX_INT32 nCharIndex = 0;
+ CPVT_LineInfo line;
+ FX_FLOAT fWordWidth = 0;
+ FX_FLOAT fTypesetWidth = FPDF_MAX(m_pVT->GetPlateWidth() - m_pVT->GetLineIndent(m_pSection->m_SecInfo), 0.0f);
+ FX_INT32 nTotalWords = m_pSection->m_WordArray.GetSize();
+ FX_BOOL bOpened = FALSE;
+ if (nTotalWords > 0) {
+ FX_INT32 i = 0;
+ while (i < nTotalWords) {
+ CPVT_WordInfo * pWord = m_pSection->m_WordArray.GetAt(i);
+ CPVT_WordInfo* pOldWord = pWord;
+ if (i > 0) {
+ pOldWord = m_pSection->m_WordArray.GetAt(i - 1);
+ }
+ if (pWord) {
+ if (bTypeset) {
+ fLineAscent = FPDF_MAX(fLineAscent, m_pVT->GetWordAscent(*pWord, TRUE));
+ fLineDescent = FPDF_MIN(fLineDescent, m_pVT->GetWordDescent(*pWord, TRUE));
+ fWordWidth = m_pVT->GetWordWidth(*pWord);
+ } else {
+ fLineAscent = FPDF_MAX(fLineAscent, m_pVT->GetWordAscent(*pWord, fFontSize));
+ fLineDescent = FPDF_MIN(fLineDescent, m_pVT->GetWordDescent(*pWord, fFontSize));
+ fWordWidth = m_pVT->GetWordWidth(pWord->nFontIndex,
+ pWord->Word,
+ m_pVT->m_wSubWord,
+ m_pVT->m_fCharSpace,
+ m_pVT->m_nHorzScale,
+ fFontSize,
+ pWord->fWordTail,
+ 0);
+ }
+ if (!bOpened) {
+ if (IsOpenStylePunctuation(pWord->Word)) {
+ bOpened = TRUE;
+ bFullWord = TRUE;
+ } else if (pOldWord != NULL) {
+ if (NeedDivision(pOldWord->Word, pWord->Word)) {
+ bFullWord = TRUE;
+ }
+ }
+ } else {
+ if (!IsSpace(pWord->Word) && !IsOpenStylePunctuation(pWord->Word)) {
+ bOpened = FALSE;
+ }
+ }
+ if (bFullWord) {
+ bFullWord = FALSE;
+ if (nCharIndex > 0) {
+ nLineFullWordIndex ++;
+ }
+ nWordStartPos = i;
+ fBackupLineWidth = fLineWidth;
+ fBackupLineAscent = fLineAscent;
+ fBackupLineDescent = fLineDescent;
+ }
+ nCharIndex++;
+ }
+ if (m_pVT->m_bLimitWidth && fTypesetWidth > 0 &&
+ fLineWidth + fWordWidth > fTypesetWidth) {
+ if (nLineFullWordIndex > 0) {
+ i = nWordStartPos;
+ fLineWidth = fBackupLineWidth;
+ fLineAscent = fBackupLineAscent;
+ fLineDescent = fBackupLineDescent;
+ }
+ if (nCharIndex == 1) {
+ fLineWidth = fWordWidth;
+ i++;
+ }
+ nLineTail = i - 1;
+ if (bTypeset) {
+ line.nBeginWordIndex = nLineHead;
+ line.nEndWordIndex = nLineTail;
+ line.nTotalWord = nLineTail - nLineHead + 1;
+ line.fLineWidth = fLineWidth;
+ line.fLineAscent = fLineAscent;
+ line.fLineDescent = fLineDescent;
+ m_pSection->AddLine(line);
+ }
+ fMaxY += (fLineAscent + m_pVT->GetLineLeading(m_pSection->m_SecInfo));
+ fMaxY += (-fLineDescent);
+ fMaxX = FPDF_MAX(fLineWidth, fMaxX);
+ nLineHead = i;
+ fLineWidth = 0.0f;
+ fLineAscent = 0.0f;
+ fLineDescent = 0.0f;
+ nCharIndex = 0;
+ nLineFullWordIndex = 0;
+ bFullWord = FALSE;
+ } else {
+ fLineWidth += fWordWidth;
+ i++;
+ }
+ }
+ if (nLineHead <= nTotalWords - 1) {
+ nLineTail = nTotalWords - 1;
+ if (bTypeset) {
+ line.nBeginWordIndex = nLineHead;
+ line.nEndWordIndex = nLineTail;
+ line.nTotalWord = nLineTail - nLineHead + 1;
+ line.fLineWidth = fLineWidth;
+ line.fLineAscent = fLineAscent;
+ line.fLineDescent = fLineDescent;
+ m_pSection->AddLine(line);
+ }
+ fMaxY += (fLineAscent + m_pVT->GetLineLeading(m_pSection->m_SecInfo));
+ fMaxY += (-fLineDescent);
+ fMaxX = FPDF_MAX(fLineWidth, fMaxX);
+ }
+ } else {
+ if (bTypeset) {
+ fLineAscent = m_pVT->GetLineAscent(m_pSection->m_SecInfo);
+ fLineDescent = m_pVT->GetLineDescent(m_pSection->m_SecInfo);
+ } else {
+ fLineAscent = m_pVT->GetFontAscent(m_pVT->GetDefaultFontIndex(), fFontSize);
+ fLineDescent = m_pVT->GetFontDescent(m_pVT->GetDefaultFontIndex(), fFontSize);
+ }
+ if (bTypeset) {
+ line.nBeginWordIndex = -1;
+ line.nEndWordIndex = -1;
+ line.nTotalWord = 0;
+ line.fLineWidth = 0;
+ line.fLineAscent = fLineAscent;
+ line.fLineDescent = fLineDescent;
+ m_pSection->AddLine(line);
+ }
+ fMaxY += (m_pVT->GetLineLeading(m_pSection->m_SecInfo) + fLineAscent + (-fLineDescent));
+ }
+ m_rcRet = CPVT_FloatRect(0, 0, fMaxX, fMaxY);
+}
+void CTypeset::OutputLines()
+{
+ ASSERT(m_pVT != NULL);
+ ASSERT(m_pSection != NULL);
+ FX_FLOAT fMinX = 0.0f, fMinY = 0.0f, fMaxX = 0.0f, fMaxY = 0.0f;
+ FX_FLOAT fPosX = 0.0f, fPosY = 0.0f;
+ FX_FLOAT fLineIndent = m_pVT->GetLineIndent(m_pSection->m_SecInfo);
+ FX_FLOAT fTypesetWidth = FPDF_MAX(m_pVT->GetPlateWidth() - fLineIndent, 0.0f);
+ switch (m_pVT->GetAlignment(m_pSection->m_SecInfo)) {
+ default:
+ case 0:
+ fMinX = 0.0f;
+ break;
+ case 1:
+ fMinX = (fTypesetWidth - m_rcRet.Width()) * PVT_HALF;
+ break;
+ case 2:
+ fMinX = fTypesetWidth - m_rcRet.Width();
+ break;
+ }
+ fMaxX = fMinX + m_rcRet.Width();
+ fMinY = 0.0f;
+ fMaxY = m_rcRet.Height();
+ FX_INT32 nTotalLines = m_pSection->m_LineArray.GetSize();
+ if (nTotalLines > 0) {
+ m_pSection->m_SecInfo.nTotalLine = nTotalLines;
+ for (FX_INT32 l = 0; l < nTotalLines; l++) {
+ if (CLine * pLine = m_pSection->m_LineArray.GetAt(l)) {
+ switch (m_pVT->GetAlignment(m_pSection->m_SecInfo)) {
+ default:
+ case 0:
+ fPosX = 0;
+ break;
+ case 1:
+ fPosX = (fTypesetWidth - pLine->m_LineInfo.fLineWidth) * PVT_HALF;
+ break;
+ case 2:
+ fPosX = fTypesetWidth - pLine->m_LineInfo.fLineWidth;
+ break;
+ }
+ fPosX += fLineIndent;
+ fPosY += m_pVT->GetLineLeading(m_pSection->m_SecInfo);
+ fPosY += pLine->m_LineInfo.fLineAscent;
+ pLine->m_LineInfo.fLineX = fPosX - fMinX;
+ pLine->m_LineInfo.fLineY = fPosY - fMinY;
+ for (FX_INT32 w = pLine->m_LineInfo.nBeginWordIndex; w <= pLine->m_LineInfo.nEndWordIndex; w++) {
+ if (CPVT_WordInfo * pWord = m_pSection->m_WordArray.GetAt(w)) {
+ pWord->fWordX = fPosX - fMinX;
+ if (pWord->pWordProps) {
+ switch (pWord->pWordProps->nScriptType) {
+ default:
+ case PVTWORD_SCRIPT_NORMAL:
+ pWord->fWordY = fPosY - fMinY;
+ break;
+ case PVTWORD_SCRIPT_SUPER:
+ pWord->fWordY = fPosY - m_pVT->GetWordAscent(*pWord) - fMinY;
+ break;
+ case PVTWORD_SCRIPT_SUB:
+ pWord->fWordY = fPosY - m_pVT->GetWordDescent(*pWord) - fMinY;
+ break;
+ }
+ } else {
+ pWord->fWordY = fPosY - fMinY;
+ }
+ fPosX += m_pVT->GetWordWidth(*pWord);
+ }
+ }
+ fPosY += (-pLine->m_LineInfo.fLineDescent);
+ }
+ }
+ }
+ m_rcRet = CPVT_FloatRect(fMinX, fMinY, fMaxX, fMaxY);
+}
+CPDF_VariableText::CPDF_VariableText() :
+ m_pVTProvider(NULL),
+ m_pVTIterator(NULL),
+ m_bInitial(FALSE),
+ m_bRichText(FALSE),
+ m_bMultiLine(FALSE),
+ m_bLimitWidth(FALSE),
+ m_bAutoFontSize(FALSE),
+ m_nLimitChar(0),
+ m_nCharArray(0),
+ m_nAlignment(0),
+ m_fCharSpace(0.0f),
+ m_fWordSpace(0.0f),
+ m_fFontSize(0.0f),
+ m_nHorzScale(100),
+ m_wSubWord(0),
+ m_fLineLeading(0.0f)
+{
+}
+CPDF_VariableText::~CPDF_VariableText()
+{
+ if (m_pVTIterator) {
+ delete m_pVTIterator;
+ m_pVTIterator = NULL;
+ }
+ ResetAll();
+}
+void CPDF_VariableText::Initialize()
+{
+ if (!m_bInitial) {
+ CPVT_SectionInfo secinfo;
+ if (m_bRichText) {
+ secinfo.pSecProps = FX_NEW CPVT_SecProps(0.0f, 0.0f, 0);
+ secinfo.pWordProps = FX_NEW CPVT_WordProps(GetDefaultFontIndex(), PVT_DEFAULT_FONTSIZE, 0, 0, 0);
+ }
+ CPVT_WordPlace place;
+ place.nSecIndex = 0;
+ AddSection(place, secinfo);
+ CPVT_LineInfo lineinfo;
+ lineinfo.fLineAscent = GetFontAscent(GetDefaultFontIndex(), GetFontSize());
+ lineinfo.fLineDescent = GetFontDescent(GetDefaultFontIndex(), GetFontSize());
+ AddLine(place, lineinfo);
+ if (CSection * pSection = m_SectionArray.GetAt(0)) {
+ pSection->ResetLinePlace();
+ }
+ m_bInitial = TRUE;
+ }
+}
+void CPDF_VariableText::ResetAll()
+{
+ m_bInitial = FALSE;
+ ResetSectionArray();
+}
+CPVT_WordPlace CPDF_VariableText::InsertWord(const CPVT_WordPlace & place, FX_WORD word, FX_INT32 charset,
+ const CPVT_WordProps * pWordProps)
+{
+ FX_INT32 nTotlaWords = this->GetTotalWords();
+ if (m_nLimitChar > 0 && nTotlaWords >= m_nLimitChar) {
+ return place;
+ }
+ if (m_nCharArray > 0 && nTotlaWords >= m_nCharArray) {
+ return place;
+ }
+ CPVT_WordPlace newplace = place;
+ newplace.nWordIndex ++;
+ if (m_bRichText) {
+ CPVT_WordProps * pNewProps = pWordProps ? FX_NEW CPVT_WordProps(*pWordProps) : FX_NEW CPVT_WordProps();
+ if (pNewProps) {
+ pNewProps->nFontIndex = GetWordFontIndex(word, charset, pWordProps->nFontIndex);
+ return AddWord(newplace, CPVT_WordInfo(word, charset, -1, pNewProps));
+ }
+ } else {
+ FX_INT32 nFontIndex = GetSubWord() > 0 ? GetDefaultFontIndex() : GetWordFontIndex(word, charset, GetDefaultFontIndex());
+ return AddWord(newplace, CPVT_WordInfo(word, charset, nFontIndex, NULL));
+ }
+ return place;
+}
+CPVT_WordPlace CPDF_VariableText::InsertSection(const CPVT_WordPlace & place, const CPVT_SecProps * pSecProps,
+ const CPVT_WordProps * pWordProps)
+{
+ FX_INT32 nTotlaWords = this->GetTotalWords();
+ if (m_nLimitChar > 0 && nTotlaWords >= m_nLimitChar) {
+ return place;
+ }
+ if (m_nCharArray > 0 && nTotlaWords >= m_nCharArray) {
+ return place;
+ }
+ if (!m_bMultiLine) {
+ return place;
+ }
+ CPVT_WordPlace wordplace = place;
+ UpdateWordPlace(wordplace);
+ CPVT_WordPlace newplace = place;
+ if (CSection * pSection = m_SectionArray.GetAt(wordplace.nSecIndex)) {
+ CPVT_WordPlace NewPlace(wordplace.nSecIndex + 1, 0, -1);
+ CPVT_SectionInfo secinfo;
+ if (m_bRichText) {
+ if (pSecProps) {
+ secinfo.pSecProps = FX_NEW CPVT_SecProps(*pSecProps);
+ }
+ if (pWordProps) {
+ secinfo.pWordProps = FX_NEW CPVT_WordProps(*pWordProps);
+ }
+ }
+ AddSection(NewPlace, secinfo);
+ newplace = NewPlace;
+ if (CSection * pNewSection = m_SectionArray.GetAt(NewPlace.nSecIndex)) {
+ for (FX_INT32 w = wordplace.nWordIndex + 1, sz = pSection->m_WordArray.GetSize(); w < sz; w++) {
+ if (CPVT_WordInfo * pWord = pSection->m_WordArray.GetAt(w)) {
+ NewPlace.nWordIndex++;
+ pNewSection->AddWord(NewPlace, *pWord);
+ }
+ }
+ }
+ ClearSectionRightWords(wordplace);
+ }
+ return newplace;
+}
+CPVT_WordPlace CPDF_VariableText::InsertText(const CPVT_WordPlace & place, FX_LPCWSTR text, FX_INT32 charset,
+ const CPVT_SecProps * pSecProps, const CPVT_WordProps * pProps)
+{
+ CFX_WideString swText = text;
+ CPVT_WordPlace wp = place;
+ for (FX_INT32 i = 0, sz = swText.GetLength(); i < sz; i++) {
+ CPVT_WordPlace oldwp = wp;
+ FX_WORD word = swText.GetAt(i);
+ switch (word) {
+ case 0x0D:
+ if (m_bMultiLine) {
+ if (swText.GetAt(i + 1) == 0x0A) {
+ i += 1;
+ }
+ wp = InsertSection(wp, pSecProps, pProps);
+ }
+ break;
+ case 0x0A:
+ if (m_bMultiLine) {
+ if (swText.GetAt(i + 1) == 0x0D) {
+ i += 1;
+ }
+ wp = InsertSection(wp, pSecProps, pProps);
+ }
+ break;
+ case 0x09:
+ word = 0x20;
+ default:
+ wp = InsertWord(wp, word, charset, pProps);
+ break;
+ }
+ if (wp == oldwp) {
+ break;
+ }
+ }
+ return wp;
+}
+CPVT_WordPlace CPDF_VariableText::DeleteWords(const CPVT_WordRange & PlaceRange)
+{
+ FX_BOOL bLastSecPos = FALSE;
+ if (CSection * pSection = m_SectionArray.GetAt(PlaceRange.EndPos.nSecIndex)) {
+ bLastSecPos = (PlaceRange.EndPos == pSection->GetEndWordPlace());
+ }
+ ClearWords(PlaceRange);
+ if (PlaceRange.BeginPos.nSecIndex != PlaceRange.EndPos.nSecIndex) {
+ ClearEmptySections(PlaceRange);
+ if (!bLastSecPos) {
+ LinkLatterSection(PlaceRange.BeginPos);
+ }
+ }
+ return PlaceRange.BeginPos;
+}
+CPVT_WordPlace CPDF_VariableText::DeleteWord(const CPVT_WordPlace & place)
+{
+ return ClearRightWord(AjustLineHeader(place, TRUE));
+}
+CPVT_WordPlace CPDF_VariableText::BackSpaceWord(const CPVT_WordPlace & place)
+{
+ return ClearLeftWord(AjustLineHeader(place, TRUE));
+}
+void CPDF_VariableText::SetText(FX_LPCWSTR text, FX_INT32 charset, const CPVT_SecProps * pSecProps,
+ const CPVT_WordProps * pWordProps)
+{
+ DeleteWords(CPVT_WordRange(GetBeginWordPlace(), GetEndWordPlace()));
+ CFX_WideString swText = text;
+ CPVT_WordPlace wp(0, 0, -1);
+ CPVT_SectionInfo secinfo;
+ if (m_bRichText) {
+ if (pSecProps) {
+ secinfo.pSecProps = FX_NEW CPVT_SecProps(*pSecProps);
+ }
+ if (pWordProps) {
+ secinfo.pWordProps = FX_NEW CPVT_WordProps(*pWordProps);
+ }
+ }
+ if (CSection * pSection = m_SectionArray.GetAt(0)) {
+ pSection->m_SecInfo = secinfo;
+ }
+ FX_INT32 nCharCount = 0;
+ for (FX_INT32 i = 0, sz = swText.GetLength(); i < sz; i++) {
+ if (m_nLimitChar > 0 && nCharCount >= m_nLimitChar) {
+ break;
+ }
+ if (m_nCharArray > 0 && nCharCount >= m_nCharArray) {
+ break;
+ }
+ FX_WORD word = swText.GetAt(i);
+ switch (word) {
+ case 0x0D:
+ if (m_bMultiLine) {
+ if (swText.GetAt(i + 1) == 0x0A) {
+ i += 1;
+ }
+ wp.nSecIndex ++;
+ wp.nLineIndex = 0;
+ wp.nWordIndex = -1;
+ AddSection(wp, secinfo);
+ }
+ break;
+ case 0x0A:
+ if (m_bMultiLine) {
+ if (swText.GetAt(i + 1) == 0x0D) {
+ i += 1;
+ }
+ wp.nSecIndex ++;
+ wp.nLineIndex = 0;
+ wp.nWordIndex = -1;
+ AddSection(wp, secinfo);
+ }
+ break;
+ case 0x09:
+ word = 0x20;
+ default:
+ wp = InsertWord(wp, word, charset, pWordProps);
+ break;
+ }
+ nCharCount++;
+ }
+}
+void CPDF_VariableText::UpdateWordPlace(CPVT_WordPlace & place) const
+{
+ if (place.nSecIndex < 0) {
+ place = GetBeginWordPlace();
+ }
+ if (place.nSecIndex >= m_SectionArray.GetSize()) {
+ place = GetEndWordPlace();
+ }
+ place = AjustLineHeader(place, TRUE);
+ if (CSection * pSection = m_SectionArray.GetAt(place.nSecIndex)) {
+ pSection->UpdateWordPlace(place);
+ }
+}
+FX_INT32 CPDF_VariableText::WordPlaceToWordIndex(const CPVT_WordPlace & place) const
+{
+ CPVT_WordPlace newplace = place;
+ UpdateWordPlace(newplace);
+ FX_INT32 nIndex = 0;
+ FX_INT32 i = 0;
+ FX_INT32 sz = 0;
+ for (i = 0, sz = m_SectionArray.GetSize(); i < sz && i < newplace.nSecIndex; i++) {
+ if (CSection * pSection = m_SectionArray.GetAt(i)) {
+ nIndex += pSection->m_WordArray.GetSize();
+ if (i != m_SectionArray.GetSize() - 1) {
+ nIndex += PVT_RETURN_LENGTH;
+ }
+ }
+ }
+ if (i >= 0 && i < m_SectionArray.GetSize()) {
+ nIndex += newplace.nWordIndex + PVT_RETURN_LENGTH;
+ }
+ return nIndex;
+}
+CPVT_WordPlace CPDF_VariableText::WordIndexToWordPlace(FX_INT32 index) const
+{
+ CPVT_WordPlace place = GetBeginWordPlace();
+ FX_INT32 nOldIndex = 0 , nIndex = 0;
+ FX_BOOL bFind = FALSE;
+ for (FX_INT32 i = 0, sz = m_SectionArray.GetSize(); i < sz; i++) {
+ if (CSection * pSection = m_SectionArray.GetAt(i)) {
+ nIndex += pSection->m_WordArray.GetSize();
+ if (nIndex == index) {
+ place = pSection->GetEndWordPlace();
+ bFind = TRUE;
+ break;
+ } else if (nIndex > index) {
+ place.nSecIndex = i;
+ place.nWordIndex = index - nOldIndex - 1;
+ pSection->UpdateWordPlace(place);
+ bFind = TRUE;
+ break;
+ }
+ if (i != m_SectionArray.GetSize() - 1) {
+ nIndex += PVT_RETURN_LENGTH;
+ }
+ nOldIndex = nIndex;
+ }
+ }
+ if (!bFind) {
+ place = GetEndWordPlace();
+ }
+ return place;
+}
+CPVT_WordPlace CPDF_VariableText::GetBeginWordPlace() const
+{
+ return m_bInitial ? CPVT_WordPlace(0, 0, -1) : CPVT_WordPlace();
+}
+CPVT_WordPlace CPDF_VariableText::GetEndWordPlace() const
+{
+ if (CSection * pSection = m_SectionArray.GetAt(m_SectionArray.GetSize() - 1)) {
+ return pSection->GetEndWordPlace();
+ }
+ return CPVT_WordPlace();
+}
+CPVT_WordPlace CPDF_VariableText::GetPrevWordPlace(const CPVT_WordPlace & place) const
+{
+ if( place.nSecIndex < 0) {
+ return GetBeginWordPlace();
+ }
+ if (place.nSecIndex >= m_SectionArray.GetSize()) {
+ return GetEndWordPlace();
+ }
+ if (CSection * pSection = m_SectionArray.GetAt(place.nSecIndex)) {
+ if (place.WordCmp(pSection->GetBeginWordPlace()) <= 0) {
+ if (CSection * pPrevSection = m_SectionArray.GetAt(place.nSecIndex - 1)) {
+ return pPrevSection->GetEndWordPlace();
+ } else {
+ return GetBeginWordPlace();
+ }
+ } else {
+ return pSection->GetPrevWordPlace(place);
+ }
+ }
+ return place;
+}
+CPVT_WordPlace CPDF_VariableText::GetNextWordPlace(const CPVT_WordPlace & place) const
+{
+ if (place.nSecIndex < 0) {
+ return GetBeginWordPlace();
+ }
+ if (place.nSecIndex >= m_SectionArray.GetSize()) {
+ return GetEndWordPlace();
+ }
+ if (CSection * pSection = m_SectionArray.GetAt(place.nSecIndex)) {
+ if (place.WordCmp(pSection->GetEndWordPlace()) >= 0) {
+ if (CSection * pNextSection = m_SectionArray.GetAt(place.nSecIndex + 1)) {
+ return pNextSection->GetBeginWordPlace();
+ } else {
+ return GetEndWordPlace();
+ }
+ } else {
+ return pSection->GetNextWordPlace(place);
+ }
+ }
+ return place;
+}
+CPVT_WordPlace CPDF_VariableText::SearchWordPlace(const CPDF_Point & point) const
+{
+ CPDF_Point pt = OutToIn(point);
+ CPVT_WordPlace place = GetBeginWordPlace();
+ FX_INT32 nLeft = 0;
+ FX_INT32 nRight = m_SectionArray.GetSize() - 1;
+ FX_INT32 nMid = m_SectionArray.GetSize() / 2;
+ FX_BOOL bUp = TRUE;
+ FX_BOOL bDown = TRUE;
+ while (nLeft <= nRight) {
+ if (CSection * pSection = m_SectionArray.GetAt(nMid)) {
+ if (IsFloatBigger(pt.y, pSection->m_SecInfo.rcSection.top)) {
+ bUp = FALSE;
+ }
+ if (IsFloatBigger(pSection->m_SecInfo.rcSection.bottom, pt.y)) {
+ bDown = FALSE;
+ }
+ if (IsFloatSmaller(pt.y, pSection->m_SecInfo.rcSection.top)) {
+ nRight = nMid - 1;
+ nMid = (nLeft + nRight) / 2;
+ continue;
+ } else if (IsFloatBigger(pt.y, pSection->m_SecInfo.rcSection.bottom)) {
+ nLeft = nMid + 1;
+ nMid = (nLeft + nRight) / 2;
+ continue;
+ } else {
+ place = pSection->SearchWordPlace(
+ CPDF_Point(pt.x - pSection->m_SecInfo.rcSection.left, pt.y - pSection->m_SecInfo.rcSection.top)
+ );
+ place.nSecIndex = nMid;
+ return place;
+ }
+ } else {
+ break;
+ }
+ }
+ if (bUp) {
+ place = GetBeginWordPlace();
+ }
+ if (bDown) {
+ place = GetEndWordPlace();
+ }
+ return place;
+}
+CPVT_WordPlace CPDF_VariableText::GetUpWordPlace(const CPVT_WordPlace & place, const CPDF_Point & point) const
+{
+ if (CSection * pSection = m_SectionArray.GetAt(place.nSecIndex)) {
+ CPVT_WordPlace temp = place;
+ CPDF_Point pt = OutToIn(point);
+ if (temp.nLineIndex-- > 0) {
+ return pSection->SearchWordPlace(pt.x - pSection->m_SecInfo.rcSection.left, temp);
+ } else {
+ if (temp.nSecIndex-- > 0) {
+ if (CSection * pLastSection = m_SectionArray.GetAt(temp.nSecIndex)) {
+ temp.nLineIndex = pLastSection->m_LineArray.GetSize() - 1;
+ return pLastSection->SearchWordPlace(pt.x - pLastSection->m_SecInfo.rcSection.left, temp);
+ }
+ }
+ }
+ }
+ return place;
+}
+CPVT_WordPlace CPDF_VariableText::GetDownWordPlace(const CPVT_WordPlace & place, const CPDF_Point & point) const
+{
+ if (CSection * pSection = m_SectionArray.GetAt(place.nSecIndex)) {
+ CPVT_WordPlace temp = place;
+ CPDF_Point pt = OutToIn(point);
+ if (temp.nLineIndex++ < pSection->m_LineArray.GetSize() - 1) {
+ return pSection->SearchWordPlace(pt.x - pSection->m_SecInfo.rcSection.left, temp);
+ } else {
+ if (temp.nSecIndex++ < m_SectionArray.GetSize() - 1) {
+ if (CSection * pNextSection = m_SectionArray.GetAt(temp.nSecIndex)) {
+ temp.nLineIndex = 0;
+ return pNextSection->SearchWordPlace(pt.x - pSection->m_SecInfo.rcSection.left, temp);
+ }
+ }
+ }
+ }
+ return place;
+}
+CPVT_WordPlace CPDF_VariableText::GetLineBeginPlace(const CPVT_WordPlace & place) const
+{
+ return CPVT_WordPlace(place.nSecIndex, place.nLineIndex, -1);
+}
+CPVT_WordPlace CPDF_VariableText::GetLineEndPlace(const CPVT_WordPlace & place) const
+{
+ if (CSection * pSection = m_SectionArray.GetAt(place.nSecIndex))
+ if (CLine * pLine = pSection->m_LineArray.GetAt(place.nLineIndex)) {
+ return pLine->GetEndWordPlace();
+ }
+ return place;
+}
+CPVT_WordPlace CPDF_VariableText::GetSectionBeginPlace(const CPVT_WordPlace & place) const
+{
+ return CPVT_WordPlace(place.nSecIndex, 0, -1);
+}
+CPVT_WordPlace CPDF_VariableText::GetSectionEndPlace(const CPVT_WordPlace & place) const
+{
+ if (CSection * pSection = m_SectionArray.GetAt(place.nSecIndex)) {
+ return pSection->GetEndWordPlace();
+ }
+ return place;
+}
+FX_INT32 CPDF_VariableText::GetTotalWords() const
+{
+ FX_INT32 nTotal = 0;
+ for (FX_INT32 i = 0, sz = m_SectionArray.GetSize(); i < sz; i++)
+ if (CSection * pSection = m_SectionArray.GetAt(i)) {
+ nTotal += (pSection->m_WordArray.GetSize() + PVT_RETURN_LENGTH);
+ }
+ return nTotal - PVT_RETURN_LENGTH;
+}
+void CPDF_VariableText::ResetSectionArray()
+{
+ for (FX_INT32 s = 0, sz = m_SectionArray.GetSize(); s < sz; s++) {
+ delete m_SectionArray.GetAt(s);
+ }
+ m_SectionArray.RemoveAll();
+}
+CPVT_WordPlace CPDF_VariableText::AddSection(const CPVT_WordPlace & place, const CPVT_SectionInfo & secinfo)
+{
+ if (IsValid() && !m_bMultiLine) {
+ return place;
+ }
+ FX_INT32 nSecIndex = FPDF_MAX(FPDF_MIN(place.nSecIndex, m_SectionArray.GetSize()), 0);
+ CSection * pSection = FX_NEW CSection(this);
+ if (!pSection) {
+ return place;
+ }
+ pSection->m_SecInfo = secinfo;
+ pSection->SecPlace.nSecIndex = nSecIndex;
+ if (nSecIndex == m_SectionArray.GetSize()) {
+ m_SectionArray.Add(pSection);
+ } else {
+ m_SectionArray.InsertAt(nSecIndex, pSection);
+ }
+ return place;
+}
+CPVT_WordPlace CPDF_VariableText::AddLine(const CPVT_WordPlace & place, const CPVT_LineInfo & lineinfo)
+{
+ if (m_SectionArray.IsEmpty()) {
+ return place;
+ }
+ if (CSection * pSection = m_SectionArray.GetAt(place.nSecIndex)) {
+ return pSection->AddLine(lineinfo);
+ }
+ return place;
+}
+CPVT_WordPlace CPDF_VariableText::AddWord(const CPVT_WordPlace & place, const CPVT_WordInfo & wordinfo)
+{
+ if (m_SectionArray.GetSize() <= 0) {
+ return place;
+ }
+ CPVT_WordPlace newplace = place;
+ newplace.nSecIndex = FPDF_MAX(FPDF_MIN(newplace.nSecIndex, m_SectionArray.GetSize() - 1), 0);
+ if (CSection * pSection = m_SectionArray.GetAt(newplace.nSecIndex)) {
+ return pSection->AddWord(newplace, wordinfo);
+ }
+ return place;
+}
+FX_BOOL CPDF_VariableText::GetWordInfo(const CPVT_WordPlace & place, CPVT_WordInfo & wordinfo)
+{
+ if (CSection * pSection = m_SectionArray.GetAt(place.nSecIndex)) {
+ if (CPVT_WordInfo * pWord = pSection->m_WordArray.GetAt(place.nWordIndex)) {
+ wordinfo = *pWord;
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+FX_BOOL CPDF_VariableText::SetWordInfo(const CPVT_WordPlace & place, const CPVT_WordInfo & wordinfo)
+{
+ if (CSection * pSection = m_SectionArray.GetAt(place.nSecIndex)) {
+ if (CPVT_WordInfo * pWord = pSection->m_WordArray.GetAt(place.nWordIndex)) {
+ *pWord = wordinfo;
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+FX_BOOL CPDF_VariableText::GetLineInfo(const CPVT_WordPlace & place, CPVT_LineInfo & lineinfo)
+{
+ if (CSection * pSection = m_SectionArray.GetAt(place.nSecIndex)) {
+ if (CLine * pLine = pSection->m_LineArray.GetAt(place.nLineIndex)) {
+ lineinfo = pLine->m_LineInfo;
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+FX_BOOL CPDF_VariableText::GetSectionInfo(const CPVT_WordPlace & place, CPVT_SectionInfo & secinfo)
+{
+ if (CSection * pSection = m_SectionArray.GetAt(place.nSecIndex)) {
+ secinfo = pSection->m_SecInfo;
+ return TRUE;
+ }
+ return FALSE;
+}
+CPDF_Rect CPDF_VariableText::GetContentRect() const
+{
+ return InToOut(CPDF_EditContainer::GetContentRect());
+}
+FX_FLOAT CPDF_VariableText::GetWordFontSize(const CPVT_WordInfo & WordInfo, FX_BOOL bFactFontSize)
+{
+ return m_bRichText && WordInfo.pWordProps ? (WordInfo.pWordProps->nScriptType == PVTWORD_SCRIPT_NORMAL || bFactFontSize ? WordInfo.pWordProps->fFontSize : WordInfo.pWordProps->fFontSize * PVT_HALF) : GetFontSize();
+}
+FX_INT32 CPDF_VariableText::GetWordFontIndex(const CPVT_WordInfo & WordInfo)
+{
+ return m_bRichText && WordInfo.pWordProps ? WordInfo.pWordProps->nFontIndex : WordInfo.nFontIndex;
+}
+FX_FLOAT CPDF_VariableText::GetWordWidth(FX_INT32 nFontIndex, FX_WORD Word, FX_WORD SubWord,
+ FX_FLOAT fCharSpace, FX_INT32 nHorzScale,
+ FX_FLOAT fFontSize, FX_FLOAT fWordTail, FX_INT32 nWordStyle)
+{
+ return (GetCharWidth(nFontIndex, Word, SubWord, nWordStyle) * fFontSize * PVT_FONTSCALE + fCharSpace) * nHorzScale * PVT_PERCENT + fWordTail;
+}
+FX_FLOAT CPDF_VariableText::GetWordWidth(const CPVT_WordInfo & WordInfo)
+{
+ return GetWordWidth(GetWordFontIndex(WordInfo), WordInfo.Word, GetSubWord(), GetCharSpace(WordInfo), GetHorzScale(WordInfo),
+ GetWordFontSize(WordInfo), WordInfo.fWordTail,
+ WordInfo.pWordProps ? WordInfo.pWordProps->nWordStyle : 0);
+}
+FX_FLOAT CPDF_VariableText::GetLineAscent(const CPVT_SectionInfo & SecInfo)
+{
+ return m_bRichText && SecInfo.pWordProps ? GetFontAscent(SecInfo.pWordProps->nFontIndex, SecInfo.pWordProps->fFontSize) :
+ GetFontAscent(GetDefaultFontIndex(), GetFontSize());
+}
+FX_FLOAT CPDF_VariableText::GetLineDescent(const CPVT_SectionInfo & SecInfo)
+{
+ return m_bRichText && SecInfo.pWordProps ? GetFontDescent(SecInfo.pWordProps->nFontIndex, SecInfo.pWordProps->fFontSize) :
+ GetFontDescent(GetDefaultFontIndex(), GetFontSize());
+}
+FX_FLOAT CPDF_VariableText::GetFontAscent(FX_INT32 nFontIndex, FX_FLOAT fFontSize)
+{
+ return (FX_FLOAT)GetTypeAscent(nFontIndex) * fFontSize * PVT_FONTSCALE;
+}
+FX_FLOAT CPDF_VariableText::GetFontDescent(FX_INT32 nFontIndex, FX_FLOAT fFontSize)
+{
+ return (FX_FLOAT)GetTypeDescent(nFontIndex) * fFontSize * PVT_FONTSCALE;
+}
+FX_FLOAT CPDF_VariableText::GetWordAscent(const CPVT_WordInfo & WordInfo, FX_FLOAT fFontSize)
+{
+ return GetFontAscent(GetWordFontIndex(WordInfo), fFontSize);
+}
+FX_FLOAT CPDF_VariableText::GetWordDescent(const CPVT_WordInfo & WordInfo, FX_FLOAT fFontSize)
+{
+ return GetFontDescent(GetWordFontIndex(WordInfo), fFontSize);
+}
+FX_FLOAT CPDF_VariableText::GetWordAscent(const CPVT_WordInfo & WordInfo, FX_BOOL bFactFontSize)
+{
+ return GetFontAscent(GetWordFontIndex(WordInfo), GetWordFontSize(WordInfo, bFactFontSize));
+}
+FX_FLOAT CPDF_VariableText::GetWordDescent(const CPVT_WordInfo & WordInfo, FX_BOOL bFactFontSize)
+{
+ return GetFontDescent(GetWordFontIndex(WordInfo), GetWordFontSize(WordInfo, bFactFontSize));
+}
+FX_FLOAT CPDF_VariableText::GetLineLeading(const CPVT_SectionInfo & SecInfo)
+{
+ return m_bRichText && SecInfo.pSecProps ? SecInfo.pSecProps->fLineLeading : m_fLineLeading;
+}
+FX_FLOAT CPDF_VariableText::GetLineIndent(const CPVT_SectionInfo & SecInfo)
+{
+ return m_bRichText && SecInfo.pSecProps ? SecInfo.pSecProps->fLineIndent : 0.0f;
+}
+FX_INT32 CPDF_VariableText::GetAlignment(const CPVT_SectionInfo& SecInfo)
+{
+ return m_bRichText && SecInfo.pSecProps ? SecInfo.pSecProps->nAlignment : this->m_nAlignment;
+}
+FX_FLOAT CPDF_VariableText::GetCharSpace(const CPVT_WordInfo & WordInfo)
+{
+ return m_bRichText && WordInfo.pWordProps ? WordInfo.pWordProps->fCharSpace : m_fCharSpace;
+}
+FX_INT32 CPDF_VariableText::GetHorzScale(const CPVT_WordInfo & WordInfo)
+{
+ return m_bRichText && WordInfo.pWordProps ? WordInfo.pWordProps->nHorzScale : m_nHorzScale;
+}
+void CPDF_VariableText::ClearSectionRightWords(const CPVT_WordPlace & place)
+{
+ CPVT_WordPlace wordplace = AjustLineHeader(place, TRUE);
+ if (CSection * pSection = m_SectionArray.GetAt(place.nSecIndex)) {
+ for (FX_INT32 w = pSection->m_WordArray.GetSize() - 1; w > wordplace.nWordIndex; w--) {
+ delete pSection->m_WordArray.GetAt(w);
+ pSection->m_WordArray.RemoveAt(w);
+ }
+ }
+}
+CPVT_WordPlace CPDF_VariableText::AjustLineHeader(const CPVT_WordPlace & place, FX_BOOL bPrevOrNext) const
+{
+ if (place.nWordIndex < 0 && place.nLineIndex > 0) {
+ if (bPrevOrNext) {
+ return GetPrevWordPlace(place);
+ } else {
+ return GetNextWordPlace(place);
+ }
+ }
+ return place;
+}
+FX_BOOL CPDF_VariableText::ClearEmptySection(const CPVT_WordPlace & place)
+{
+ if (place.nSecIndex == 0 && m_SectionArray.GetSize() == 1) {
+ return FALSE;
+ }
+ if (CSection * pSection = m_SectionArray.GetAt(place.nSecIndex)) {
+ if (pSection->m_WordArray.GetSize() == 0) {
+ delete pSection;
+ m_SectionArray.RemoveAt(place.nSecIndex);
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+void CPDF_VariableText::ClearEmptySections(const CPVT_WordRange & PlaceRange)
+{
+ CPVT_WordPlace wordplace;
+ for (FX_INT32 s = PlaceRange.EndPos.nSecIndex; s > PlaceRange.BeginPos.nSecIndex; s--) {
+ wordplace.nSecIndex = s;
+ ClearEmptySection(wordplace);
+ }
+}
+void CPDF_VariableText::LinkLatterSection(const CPVT_WordPlace & place)
+{
+ CPVT_WordPlace oldplace = AjustLineHeader(place, TRUE);
+ if (CSection * pNextSection = m_SectionArray.GetAt(place.nSecIndex + 1)) {
+ if (CSection * pSection = m_SectionArray.GetAt(oldplace.nSecIndex)) {
+ for (FX_INT32 w = 0, sz = pNextSection->m_WordArray.GetSize(); w < sz; w++) {
+ if (CPVT_WordInfo * pWord = pNextSection->m_WordArray.GetAt(w)) {
+ oldplace.nWordIndex ++;
+ pSection->AddWord(oldplace, *pWord);
+ }
+ }
+ }
+ delete pNextSection;
+ m_SectionArray.RemoveAt(place.nSecIndex + 1);
+ }
+}
+void CPDF_VariableText::ClearWords(const CPVT_WordRange & PlaceRange)
+{
+ CPVT_WordRange NewRange;
+ NewRange.BeginPos = AjustLineHeader(PlaceRange.BeginPos, TRUE);
+ NewRange.EndPos = AjustLineHeader(PlaceRange.EndPos, TRUE);
+ for (FX_INT32 s = NewRange.EndPos.nSecIndex; s >= NewRange.BeginPos.nSecIndex; s--) {
+ if (CSection * pSection = m_SectionArray.GetAt(s)) {
+ pSection->ClearWords(NewRange);
+ }
+ }
+}
+CPVT_WordPlace CPDF_VariableText::ClearLeftWord(const CPVT_WordPlace & place)
+{
+ if (CSection * pSection = m_SectionArray.GetAt(place.nSecIndex)) {
+ CPVT_WordPlace leftplace = this->GetPrevWordPlace(place);
+ if (leftplace != place) {
+ if (leftplace.nSecIndex != place.nSecIndex) {
+ if (pSection->m_WordArray.GetSize() == 0) {
+ this->ClearEmptySection(place);
+ } else {
+ this->LinkLatterSection(leftplace);
+ }
+ } else {
+ pSection->ClearWord(place);
+ }
+ }
+ return leftplace;
+ }
+ return place;
+}
+CPVT_WordPlace CPDF_VariableText::ClearRightWord(const CPVT_WordPlace & place)
+{
+ if (CSection * pSection = m_SectionArray.GetAt(place.nSecIndex)) {
+ CPVT_WordPlace rightplace = AjustLineHeader(this->GetNextWordPlace(place), FALSE);
+ if (rightplace != place) {
+ if(rightplace.nSecIndex != place.nSecIndex) {
+ LinkLatterSection(place);
+ } else {
+ pSection->ClearWord(rightplace);
+ }
+ }
+ }
+ return place;
+}
+void CPDF_VariableText::RearrangeAll()
+{
+ Rearrange(CPVT_WordRange(GetBeginWordPlace(), GetEndWordPlace()));
+}
+void CPDF_VariableText::RearrangePart(const CPVT_WordRange & PlaceRange)
+{
+ Rearrange(PlaceRange);
+}
+CPVT_FloatRect CPDF_VariableText::Rearrange(const CPVT_WordRange & PlaceRange)
+{
+ CPVT_FloatRect rcRet;
+ if (IsValid()) {
+ if (m_bAutoFontSize) {
+ SetFontSize(GetAutoFontSize());
+ rcRet = RearrangeSections(CPVT_WordRange(GetBeginWordPlace(), GetEndWordPlace()));
+ } else {
+ rcRet = RearrangeSections(PlaceRange);
+ }
+ }
+ SetContentRect(rcRet);
+ return rcRet;
+}
+FX_FLOAT CPDF_VariableText::GetAutoFontSize()
+{
+ FX_INT32 nTotal = sizeof(gFontSizeSteps) / sizeof(FX_BYTE);
+ if (IsMultiLine()) {
+ nTotal /= 4;
+ }
+ if (nTotal <= 0) {
+ return 0;
+ }
+ if (GetPlateWidth() <= 0) {
+ return 0;
+ }
+ FX_INT32 nLeft = 0;
+ FX_INT32 nRight = nTotal - 1;
+ FX_INT32 nMid = nTotal / 2;
+ while (nLeft <= nRight) {
+ if (IsBigger(gFontSizeSteps[nMid])) {
+ nRight = nMid - 1;
+ nMid = (nLeft + nRight) / 2;
+ continue;
+ } else {
+ nLeft = nMid + 1;
+ nMid = (nLeft + nRight) / 2;
+ continue;
+ }
+ }
+ return (FX_FLOAT)gFontSizeSteps[nMid];
+}
+FX_BOOL CPDF_VariableText::IsBigger(FX_FLOAT fFontSize)
+{
+ FX_BOOL bBigger = FALSE;
+ CPVT_Size szTotal;
+ for (FX_INT32 s = 0, sz = m_SectionArray.GetSize(); s < sz; s++) {
+ if (CSection * pSection = m_SectionArray.GetAt(s)) {
+ CPVT_Size size = pSection->GetSectionSize(fFontSize);
+ szTotal.x = FPDF_MAX(size.x, szTotal.x);
+ szTotal.y += size.y;
+ if (IsFloatBigger(szTotal.x, GetPlateWidth())
+ || IsFloatBigger(szTotal.y, GetPlateHeight())
+ ) {
+ bBigger = TRUE;
+ break;
+ }
+ }
+ }
+ return bBigger;
+}
+CPVT_FloatRect CPDF_VariableText::RearrangeSections(const CPVT_WordRange & PlaceRange)
+{
+ CPVT_WordPlace place;
+ FX_FLOAT fPosY = 0;
+ FX_FLOAT fOldHeight;
+ FX_INT32 nSSecIndex = PlaceRange.BeginPos.nSecIndex;
+ FX_INT32 nESecIndex = PlaceRange.EndPos.nSecIndex;
+ CPVT_FloatRect rcRet;
+ for (FX_INT32 s = 0, sz = m_SectionArray.GetSize(); s < sz; s++) {
+ place.nSecIndex = s;
+ if (CSection * pSection = m_SectionArray.GetAt(s)) {
+ pSection->SecPlace = place;
+ CPVT_FloatRect rcSec = pSection->m_SecInfo.rcSection;
+ if (s >= nSSecIndex) {
+ if (s <= nESecIndex) {
+ rcSec = pSection->Rearrange();
+ rcSec.top += fPosY;
+ rcSec.bottom += fPosY;
+ } else {
+ fOldHeight = pSection->m_SecInfo.rcSection.bottom - pSection->m_SecInfo.rcSection.top;
+ rcSec.top = fPosY;
+ rcSec.bottom = fPosY + fOldHeight;
+ }
+ pSection->m_SecInfo.rcSection = rcSec;
+ pSection->ResetLinePlace();
+ }
+ if (s == 0) {
+ rcRet = rcSec;
+ } else {
+ rcRet.left = FPDF_MIN(rcSec.left, rcRet.left);
+ rcRet.top = FPDF_MIN(rcSec.top, rcRet.top);
+ rcRet.right = FPDF_MAX(rcSec.right, rcRet.right);
+ rcRet.bottom = FPDF_MAX(rcSec.bottom, rcRet.bottom);
+ }
+ fPosY += rcSec.Height();
+ }
+ }
+ return rcRet;
+}
+FX_INT32 CPDF_VariableText::GetCharWidth(FX_INT32 nFontIndex, FX_WORD Word, FX_WORD SubWord, FX_INT32 nWordStyle)
+{
+ if (m_pVTProvider) {
+ if (SubWord > 0) {
+ return m_pVTProvider->GetCharWidth(nFontIndex, SubWord, nWordStyle);
+ } else {
+ return m_pVTProvider->GetCharWidth(nFontIndex, Word, nWordStyle);
+ }
+ }
+ return 0;
+}
+FX_INT32 CPDF_VariableText::GetTypeAscent(FX_INT32 nFontIndex)
+{
+ return m_pVTProvider ? m_pVTProvider->GetTypeAscent(nFontIndex) : 0;
+}
+FX_INT32 CPDF_VariableText::GetTypeDescent(FX_INT32 nFontIndex)
+{
+ return m_pVTProvider ? m_pVTProvider->GetTypeDescent(nFontIndex) : 0;
+}
+FX_INT32 CPDF_VariableText::GetWordFontIndex(FX_WORD word, FX_INT32 charset, FX_INT32 nFontIndex)
+{
+ return m_pVTProvider ? m_pVTProvider->GetWordFontIndex(word, charset, nFontIndex) : -1;
+}
+FX_INT32 CPDF_VariableText::GetDefaultFontIndex()
+{
+ return m_pVTProvider ? m_pVTProvider->GetDefaultFontIndex() : -1;
+}
+FX_BOOL CPDF_VariableText::IsLatinWord(FX_WORD word)
+{
+ return m_pVTProvider ? m_pVTProvider->IsLatinWord(word) : FALSE;
+}
+IPDF_VariableText_Iterator * CPDF_VariableText::GetIterator()
+{
+ if (!m_pVTIterator) {
+ return m_pVTIterator = FX_NEW CPDF_VariableText_Iterator(this);
+ }
+ return m_pVTIterator;
+}
+IPDF_VariableText_Provider* CPDF_VariableText::SetProvider(IPDF_VariableText_Provider * pProvider)
+{
+ IPDF_VariableText_Provider* pOld = m_pVTProvider;
+ m_pVTProvider = pProvider;
+ return pOld;
+}
+CPDF_VariableText_Iterator::CPDF_VariableText_Iterator(CPDF_VariableText * pVT):
+ m_pVT(pVT),
+ m_CurPos(-1, -1, -1)
+{
+}
+CPDF_VariableText_Iterator::~CPDF_VariableText_Iterator()
+{
+}
+void CPDF_VariableText_Iterator::SetAt(FX_INT32 nWordIndex)
+{
+ ASSERT(m_pVT != NULL);
+ m_CurPos = m_pVT->WordIndexToWordPlace(nWordIndex);
+}
+void CPDF_VariableText_Iterator::SetAt(const CPVT_WordPlace & place)
+{
+ ASSERT(m_pVT != NULL);
+ m_CurPos = place;
+}
+FX_BOOL CPDF_VariableText_Iterator::NextWord()
+{
+ ASSERT(m_pVT != NULL);
+ if (m_CurPos == m_pVT->GetEndWordPlace()) {
+ return FALSE;
+ }
+ m_CurPos = m_pVT->GetNextWordPlace(m_CurPos);
+ return TRUE;
+}
+FX_BOOL CPDF_VariableText_Iterator::PrevWord()
+{
+ ASSERT(m_pVT != NULL);
+ if (m_CurPos == m_pVT->GetBeginWordPlace()) {
+ return FALSE;
+ }
+ m_CurPos = m_pVT->GetPrevWordPlace(m_CurPos);
+ return TRUE;
+}
+FX_BOOL CPDF_VariableText_Iterator::NextLine()
+{
+ ASSERT(m_pVT != NULL);
+ if (CSection * pSection = m_pVT->m_SectionArray.GetAt(m_CurPos.nSecIndex)) {
+ if (m_CurPos.nLineIndex < pSection->m_LineArray.GetSize() - 1) {
+ m_CurPos = CPVT_WordPlace(m_CurPos.nSecIndex, m_CurPos.nLineIndex + 1, -1);
+ return TRUE;
+ } else {
+ if (m_CurPos.nSecIndex < m_pVT->m_SectionArray.GetSize() - 1) {
+ m_CurPos = CPVT_WordPlace(m_CurPos.nSecIndex + 1, 0, -1);
+ return TRUE;
+ }
+ }
+ }
+ return FALSE;
+}
+FX_BOOL CPDF_VariableText_Iterator::PrevLine()
+{
+ ASSERT(m_pVT != NULL);
+ if (CSection * pSection = m_pVT->m_SectionArray.GetAt(m_CurPos.nSecIndex)) {
+ if (m_CurPos.nLineIndex > 0) {
+ m_CurPos = CPVT_WordPlace(m_CurPos.nSecIndex, m_CurPos.nLineIndex - 1, -1);
+ return TRUE;
+ } else {
+ if (m_CurPos.nSecIndex > 0) {
+ if (CSection * pLastSection = m_pVT->m_SectionArray.GetAt(m_CurPos.nSecIndex - 1)) {
+ m_CurPos = CPVT_WordPlace(m_CurPos.nSecIndex - 1, pLastSection->m_LineArray.GetSize() - 1, -1);
+ return TRUE;
+ }
+ }
+ }
+ }
+ return FALSE;
+}
+FX_BOOL CPDF_VariableText_Iterator::NextSection()
+{
+ ASSERT(m_pVT != NULL);
+ if (m_CurPos.nSecIndex < m_pVT->m_SectionArray.GetSize() - 1) {
+ m_CurPos = CPVT_WordPlace(m_CurPos.nSecIndex + 1, 0, -1);
+ return TRUE;
+ }
+ return FALSE;
+}
+FX_BOOL CPDF_VariableText_Iterator::PrevSection()
+{
+ ASSERT(m_pVT != NULL);
+ if (m_CurPos.nSecIndex > 0) {
+ m_CurPos = CPVT_WordPlace(m_CurPos.nSecIndex - 1, 0, -1);
+ return TRUE;
+ }
+ return FALSE;
+}
+FX_BOOL CPDF_VariableText_Iterator::GetWord(CPVT_Word & word) const
+{
+ ASSERT(m_pVT != NULL);
+ word.WordPlace = m_CurPos;
+ if (CSection * pSection = m_pVT->m_SectionArray.GetAt(m_CurPos.nSecIndex)) {
+ if (CLine * pLine = pSection->m_LineArray.GetAt(m_CurPos.nLineIndex)) {
+ if (CPVT_WordInfo * pWord = pSection->m_WordArray.GetAt(m_CurPos.nWordIndex)) {
+ word.Word = pWord->Word;
+ word.nCharset = pWord->nCharset;
+ word.fWidth = m_pVT->GetWordWidth(*pWord);
+ word.ptWord = m_pVT->InToOut(
+ CPDF_Point(pWord->fWordX + pSection->m_SecInfo.rcSection.left,
+ pWord->fWordY + pSection->m_SecInfo.rcSection.top) );
+ word.fAscent = m_pVT->GetWordAscent(*pWord);
+ word.fDescent = m_pVT->GetWordDescent(*pWord);
+ if (pWord->pWordProps) {
+ word.WordProps = *pWord->pWordProps;
+ }
+ word.nFontIndex = m_pVT->GetWordFontIndex(*pWord);
+ word.fFontSize = m_pVT->GetWordFontSize(*pWord);
+ return TRUE;
+ }
+ }
+ }
+ return FALSE;
+}
+FX_BOOL CPDF_VariableText_Iterator::SetWord(const CPVT_Word & word)
+{
+ ASSERT(m_pVT != NULL);
+ if (CSection * pSection = m_pVT->m_SectionArray.GetAt(m_CurPos.nSecIndex)) {
+ if (CPVT_WordInfo * pWord = pSection->m_WordArray.GetAt(m_CurPos.nWordIndex)) {
+ if (pWord->pWordProps) {
+ *pWord->pWordProps = word.WordProps;
+ }
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+FX_BOOL CPDF_VariableText_Iterator::GetLine(CPVT_Line & line) const
+{
+ ASSERT(m_pVT != NULL);
+ line.lineplace = CPVT_WordPlace(m_CurPos.nSecIndex, m_CurPos.nLineIndex, -1);
+ if (CSection * pSection = m_pVT->m_SectionArray.GetAt(m_CurPos.nSecIndex)) {
+ if (CLine * pLine = pSection->m_LineArray.GetAt(m_CurPos.nLineIndex)) {
+ line.ptLine = m_pVT->InToOut(
+ CPDF_Point(pLine->m_LineInfo.fLineX + pSection->m_SecInfo.rcSection.left,
+ pLine->m_LineInfo.fLineY + pSection->m_SecInfo.rcSection.top) );
+ line.fLineWidth = pLine->m_LineInfo.fLineWidth;
+ line.fLineAscent = pLine->m_LineInfo.fLineAscent;
+ line.fLineDescent = pLine->m_LineInfo.fLineDescent;
+ line.lineEnd = pLine->GetEndWordPlace();
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+FX_BOOL CPDF_VariableText_Iterator::GetSection(CPVT_Section & section) const
+{
+ ASSERT(m_pVT != NULL);
+ section.secplace = CPVT_WordPlace(m_CurPos.nSecIndex, 0, -1);
+ if (CSection * pSection = m_pVT->m_SectionArray.GetAt(m_CurPos.nSecIndex)) {
+ section.rcSection = m_pVT->InToOut(pSection->m_SecInfo.rcSection);
+ if (pSection->m_SecInfo.pSecProps) {
+ section.SecProps = *pSection->m_SecInfo.pSecProps;
+ }
+ if (pSection->m_SecInfo.pWordProps) {
+ section.WordProps = *pSection->m_SecInfo.pWordProps;
+ }
+ return TRUE;
+ }
+ return FALSE;
+}
+FX_BOOL CPDF_VariableText_Iterator::SetSection(const CPVT_Section & section)
+{
+ ASSERT(m_pVT != NULL);
+ if (CSection * pSection = m_pVT->m_SectionArray.GetAt(m_CurPos.nSecIndex)) {
+ if (pSection->m_SecInfo.pSecProps) {
+ *pSection->m_SecInfo.pSecProps = section.SecProps;
+ }
+ if (pSection->m_SecInfo.pWordProps) {
+ *pSection->m_SecInfo.pWordProps = section.WordProps;
+ }
+ return TRUE;
+ }
+ return FALSE;
+}
diff --git a/core/src/fpdfdoc/doc_vtmodule.cpp b/core/src/fpdfdoc/doc_vtmodule.cpp
index 8bc4e7b771..c44cbacf3c 100644
--- a/core/src/fpdfdoc/doc_vtmodule.cpp
+++ b/core/src/fpdfdoc/doc_vtmodule.cpp
@@ -1,17 +1,17 @@
-// 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
-
-#include "../../include/fpdfdoc/fpdf_doc.h"
-#include "../../include/fpdfdoc/fpdf_vt.h"
-#include "pdf_vt.h"
-IPDF_VariableText* IPDF_VariableText::NewVariableText()
-{
- return FX_NEW CPDF_VariableText();
-}
-void IPDF_VariableText::DelVariableText(IPDF_VariableText* pVT)
-{
- delete (CPDF_VariableText*)pVT;
-}
+// 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
+
+#include "../../include/fpdfdoc/fpdf_doc.h"
+#include "../../include/fpdfdoc/fpdf_vt.h"
+#include "pdf_vt.h"
+IPDF_VariableText* IPDF_VariableText::NewVariableText()
+{
+ return FX_NEW CPDF_VariableText();
+}
+void IPDF_VariableText::DelVariableText(IPDF_VariableText* pVT)
+{
+ delete (CPDF_VariableText*)pVT;
+}
diff --git a/core/src/fpdfdoc/pdf_vt.h b/core/src/fpdfdoc/pdf_vt.h
index fc1af0415f..6b2d5e5eef 100644
--- a/core/src/fpdfdoc/pdf_vt.h
+++ b/core/src/fpdfdoc/pdf_vt.h
@@ -1,642 +1,642 @@
-// 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
-
-#define _PDF_VT_H_
-class CPVT_Size;
-class CPVT_FloatRect;
-struct CPVT_SectionInfo;
-struct CPVT_LineInfo;
-struct CPVT_WordInfo;
-class CLine;
-class CLines;
-class CSection;
-class CTypeset;
-class CPDF_EditContainer;
-class CPDF_VariableText;
-class CPDF_VariableText_Iterator;
-#define IsFloatZero(f) ((f) < 0.0001 && (f) > -0.0001)
-#define IsFloatBigger(fa,fb) ((fa) > (fb) && !IsFloatZero((fa) - (fb)))
-#define IsFloatSmaller(fa,fb) ((fa) < (fb) && !IsFloatZero((fa) - (fb)))
-template<class T> T FPDF_MIN (const T & i, const T & j)
-{
- return ((i < j) ? i : j);
-}
-template<class T> T FPDF_MAX (const T & i, const T & j)
-{
- return ((i > j) ? i : j);
-}
-class CPVT_Size
-{
-public:
- CPVT_Size() : x(0.0f), y(0.0f)
- {
- }
- CPVT_Size(FX_FLOAT x, FX_FLOAT y)
- {
- this->x = x;
- this->y = y;
- }
- FX_FLOAT x, y;
-};
-class CPVT_FloatRect : public CFX_FloatRect
-{
-public:
- CPVT_FloatRect()
- {
- left = top = right = bottom = 0.0f;
- }
- CPVT_FloatRect(FX_FLOAT left, FX_FLOAT top,
- FX_FLOAT right, FX_FLOAT bottom)
- {
- this->left = left;
- this->top = top;
- this->right = right;
- this->bottom = bottom;
- }
- CPVT_FloatRect(const CPDF_Rect & rect)
- {
- this->left = rect.left;
- this->top = rect.top;
- this->right = rect.right;
- this->bottom = rect.bottom;
- }
- void Default()
- {
- left = top = right = bottom = 0.0f;
- }
- FX_FLOAT Height() const
- {
- if(this->top > this->bottom) {
- return this->top - this->bottom;
- } else {
- return this->bottom - this->top;
- }
- }
-};
-struct CPVT_SectionInfo {
- CPVT_SectionInfo() : rcSection(), nTotalLine(0), pSecProps(NULL), pWordProps(NULL)
- {
- }
- virtual ~CPVT_SectionInfo()
- {
- if (pSecProps) {
- delete pSecProps;
- }
- if (pWordProps) {
- delete pWordProps;
- }
- }
- CPVT_SectionInfo(const CPVT_SectionInfo & other): rcSection(), nTotalLine(0), pSecProps(NULL), pWordProps(NULL)
- {
- operator = (other);
- }
- void operator = (const CPVT_SectionInfo & other)
- {
- if (this == &other) {
- return;
- }
- this->rcSection = other.rcSection;
- this->nTotalLine = other.nTotalLine;
- if (other.pSecProps) {
- if (pSecProps) {
- *pSecProps = *other.pSecProps;
- } else {
- pSecProps = FX_NEW CPVT_SecProps(*other.pSecProps);
- }
- }
- if (other.pWordProps) {
- if (pWordProps) {
- *pWordProps = *other.pWordProps;
- } else {
- pWordProps = FX_NEW CPVT_WordProps(*other.pWordProps);
- }
- }
- }
- CPVT_FloatRect rcSection;
- FX_INT32 nTotalLine;
- CPVT_SecProps* pSecProps;
- CPVT_WordProps* pWordProps;
-};
-struct CPVT_LineInfo {
- CPVT_LineInfo() : nTotalWord(0), nBeginWordIndex(-1), nEndWordIndex(-1),
- fLineX(0.0f), fLineY(0.0f), fLineWidth(0.0f), fLineAscent(0.0f), fLineDescent(0.0f)
- {
- }
- FX_INT32 nTotalWord;
- FX_INT32 nBeginWordIndex;
- FX_INT32 nEndWordIndex;
- FX_FLOAT fLineX;
- FX_FLOAT fLineY;
- FX_FLOAT fLineWidth;
- FX_FLOAT fLineAscent;
- FX_FLOAT fLineDescent;
-};
-struct CPVT_WordInfo : public CFX_Object {
- CPVT_WordInfo() : Word(0), nCharset(0),
- fWordX(0.0f), fWordY(0.0f), fWordTail(0.0f), nFontIndex(-1), pWordProps(NULL)
- {
- }
- CPVT_WordInfo(FX_WORD word, FX_INT32 charset, FX_INT32 fontIndex, CPVT_WordProps * pProps):
- Word(word), nCharset(charset), fWordX(0.0f), fWordY(0.0f), fWordTail(0.0f),
- nFontIndex(fontIndex), pWordProps(pProps)
- {
- }
- virtual ~CPVT_WordInfo()
- {
- if (pWordProps) {
- delete pWordProps;
- }
- }
- CPVT_WordInfo(const CPVT_WordInfo & word): Word(0), nCharset(0),
- fWordX(0.0f), fWordY(0.0f), fWordTail(0.0f), nFontIndex(-1), pWordProps(NULL)
- {
- operator = (word);
- }
- void operator = (const CPVT_WordInfo & word)
- {
- if (this == &word) {
- return;
- }
- this->Word = word.Word;
- this->nCharset = word.nCharset;
- this->nFontIndex = word.nFontIndex;
- if (word.pWordProps) {
- if (pWordProps) {
- *pWordProps = *word.pWordProps;
- } else {
- pWordProps = FX_NEW CPVT_WordProps(*word.pWordProps);
- }
- }
- }
- FX_WORD Word;
- FX_INT32 nCharset;
- FX_FLOAT fWordX;
- FX_FLOAT fWordY;
- FX_FLOAT fWordTail;
- FX_INT32 nFontIndex;
- CPVT_WordProps* pWordProps;
-};
-struct CPVT_FloatRange {
- CPVT_FloatRange() : fMin(0.0f), fMax(0.0f)
- {
- }
- CPVT_FloatRange(FX_FLOAT min, FX_FLOAT max) : fMin(min), fMax(max)
- {
- }
- FX_FLOAT Range() const
- {
- return fMax - fMin;
- }
- FX_FLOAT fMin, fMax;
-};
-template<class TYPE> class CPVT_ArrayTemplate : public CFX_ArrayTemplate<TYPE>
-{
-public:
- FX_BOOL IsEmpty()
- {
- return CFX_ArrayTemplate<TYPE>::GetSize() <= 0;
- }
- TYPE GetAt(int nIndex) const
- {
- if (nIndex >= 0 && nIndex < CFX_ArrayTemplate<TYPE>::GetSize()) {
- return CFX_ArrayTemplate<TYPE>::GetAt(nIndex);
- }
- return NULL;
- }
- void RemoveAt(int nIndex)
- {
- if (nIndex >= 0 && nIndex < CFX_ArrayTemplate<TYPE>::GetSize()) {
- CFX_ArrayTemplate<TYPE>::RemoveAt(nIndex);
- }
- }
-};
-class CLine : public CFX_Object
-{
-public:
- CLine();
- virtual ~CLine();
- CPVT_WordPlace GetBeginWordPlace() const;
- CPVT_WordPlace GetEndWordPlace() const;
- CPVT_WordPlace GetPrevWordPlace(const CPVT_WordPlace & place) const;
- CPVT_WordPlace GetNextWordPlace(const CPVT_WordPlace & place) const;
- CPVT_WordPlace LinePlace;
- CPVT_LineInfo m_LineInfo;
-};
-class CLines
-{
-public:
- CLines() : m_nTotal(0) {}
- virtual ~CLines()
- {
- RemoveAll();
- }
- FX_INT32 GetSize() const
- {
- return m_Lines.GetSize();
- }
- CLine * GetAt(FX_INT32 nIndex) const
- {
- return m_Lines.GetAt(nIndex);
- }
- void Empty()
- {
- m_nTotal = 0;
- }
- void RemoveAll()
- {
- for (FX_INT32 i = 0, sz = GetSize(); i < sz; i++) {
- delete GetAt(i);
- }
- m_Lines.RemoveAll();
- m_nTotal = 0;
- }
- FX_INT32 Add(const CPVT_LineInfo & lineinfo)
- {
- if (m_nTotal >= GetSize()) {
- if (CLine * pLine = FX_NEW CLine) {
- pLine->m_LineInfo = lineinfo;
- m_Lines.Add(pLine);
- return m_nTotal++;
- }
- return m_nTotal;
- } else {
- if (CLine * pLine = GetAt(m_nTotal)) {
- pLine->m_LineInfo = lineinfo;
- }
- return m_nTotal++;
- }
- }
- void Clear()
- {
- for (FX_INT32 i = GetSize() - 1; i >= m_nTotal; i--) {
- delete GetAt(i);
- m_Lines.RemoveAt(i);
- }
- }
-private:
- CPVT_ArrayTemplate<CLine*> m_Lines;
- FX_INT32 m_nTotal;
-};
-class CSection : public CFX_Object
-{
- friend class CTypeset;
-public:
- CSection(CPDF_VariableText * pVT);
- virtual ~CSection();
- void ResetAll();
- void ResetLineArray();
- void ResetWordArray();
- void ResetLinePlace();
- CPVT_WordPlace AddWord(const CPVT_WordPlace & place, const CPVT_WordInfo & wordinfo);
- CPVT_WordPlace AddLine(const CPVT_LineInfo & lineinfo);
- void ClearWords(const CPVT_WordRange & PlaceRange);
- void ClearWord(const CPVT_WordPlace & place);
- CPVT_FloatRect Rearrange();
- CPVT_Size GetSectionSize(FX_FLOAT fFontSize);
- CPVT_WordPlace GetBeginWordPlace() const;
- CPVT_WordPlace GetEndWordPlace() const;
- CPVT_WordPlace GetPrevWordPlace(const CPVT_WordPlace & place) const;
- CPVT_WordPlace GetNextWordPlace(const CPVT_WordPlace & place) const;
- void UpdateWordPlace(CPVT_WordPlace & place) const;
- CPVT_WordPlace SearchWordPlace(const CPDF_Point & point) const;
- CPVT_WordPlace SearchWordPlace(FX_FLOAT fx, const CPVT_WordPlace & lineplace) const;
- CPVT_WordPlace SearchWordPlace(FX_FLOAT fx, const CPVT_WordRange & range) const;
-public:
- CPVT_WordPlace SecPlace;
- CPVT_SectionInfo m_SecInfo;
- CLines m_LineArray;
- CPVT_ArrayTemplate<CPVT_WordInfo*> m_WordArray;
-private:
- void ClearLeftWords(FX_INT32 nWordIndex);
- void ClearRightWords(FX_INT32 nWordIndex);
- void ClearMidWords(FX_INT32 nBeginIndex, FX_INT32 nEndIndex);
-
- CPDF_VariableText *m_pVT;
-};
-class CTypeset
-{
-public:
- CTypeset(CSection * pSection);
- virtual ~CTypeset();
- CPVT_Size GetEditSize(FX_FLOAT fFontSize);
- CPVT_FloatRect Typeset();
- CPVT_FloatRect CharArray();
-private:
- void SplitLines(FX_BOOL bTypeset, FX_FLOAT fFontSize);
- void OutputLines();
-
- CPVT_FloatRect m_rcRet;
- CPDF_VariableText * m_pVT;
- CSection * m_pSection;
-};
-class CPDF_EditContainer
-{
-public:
- CPDF_EditContainer(): m_rcPlate(0, 0, 0, 0), m_rcContent(0, 0, 0, 0) {};
- virtual ~CPDF_EditContainer() {};
- virtual void SetPlateRect(const CPDF_Rect & rect)
- {
- m_rcPlate = rect;
- };
- virtual const CPDF_Rect & GetPlateRect() const
- {
- return m_rcPlate;
- };
- virtual void SetContentRect(const CPVT_FloatRect & rect)
- {
- m_rcContent = rect;
- };
- virtual CPDF_Rect GetContentRect() const
- {
- return m_rcContent;
- };
- FX_FLOAT GetPlateWidth() const
- {
- return m_rcPlate.right - m_rcPlate.left;
- };
- FX_FLOAT GetPlateHeight() const
- {
- return m_rcPlate.top - m_rcPlate.bottom;
- };
- CPVT_Size GetPlateSize() const
- {
- return CPVT_Size(GetPlateWidth(), GetPlateHeight());
- };
- CPDF_Point GetBTPoint() const
- {
- return CPDF_Point(m_rcPlate.left, m_rcPlate.top);
- };
- CPDF_Point GetETPoint() const
- {
- return CPDF_Point(m_rcPlate.right, m_rcPlate.bottom);
- };
- inline CPDF_Point InToOut(const CPDF_Point & point) const
- {
- return CPDF_Point(point.x + GetBTPoint().x, GetBTPoint().y - point.y);
- };
- inline CPDF_Point OutToIn(const CPDF_Point & point) const
- {
- return CPDF_Point(point.x - GetBTPoint().x, GetBTPoint().y - point.y);
- };
- inline CPDF_Rect InToOut(const CPVT_FloatRect & rect) const
- {
- CPDF_Point ptLeftTop = InToOut(CPDF_Point(rect.left, rect.top));
- CPDF_Point ptRightBottom = InToOut(CPDF_Point(rect.right, rect.bottom));
- return CPDF_Rect(ptLeftTop.x, ptRightBottom.y, ptRightBottom.x, ptLeftTop.y);
- };
- inline CPVT_FloatRect OutToIn(const CPDF_Rect & rect) const
- {
- CPDF_Point ptLeftTop = OutToIn(CPDF_Point(rect.left, rect.top));
- CPDF_Point ptRightBottom = OutToIn(CPDF_Point(rect.right, rect.bottom));
- return CPVT_FloatRect(ptLeftTop.x, ptLeftTop.y, ptRightBottom.x, ptRightBottom.y);
- };
-
-private:
- CPDF_Rect m_rcPlate;
- CPVT_FloatRect m_rcContent;
-};
-class CPDF_VariableText : public IPDF_VariableText, public CFX_Object, private CPDF_EditContainer
-{
- friend class CTypeset;
- friend class CSection;
- friend class CPDF_VariableText_Iterator;
-public:
- CPDF_VariableText();
- virtual ~CPDF_VariableText();
- IPDF_VariableText_Provider* SetProvider(IPDF_VariableText_Provider * pProvider);
- IPDF_VariableText_Iterator* GetIterator();
- void SetPlateRect(const CPDF_Rect & rect)
- {
- CPDF_EditContainer::SetPlateRect(rect);
- }
- void SetAlignment(FX_INT32 nFormat = 0)
- {
- m_nAlignment = nFormat;
- }
- void SetPasswordChar(FX_WORD wSubWord = '*')
- {
- m_wSubWord = wSubWord;
- }
- void SetLimitChar(FX_INT32 nLimitChar = 0)
- {
- m_nLimitChar = nLimitChar;
- }
- void SetCharSpace(FX_FLOAT fCharSpace = 0.0f)
- {
- m_fCharSpace = fCharSpace;
- }
- void SetHorzScale(FX_INT32 nHorzScale = 100)
- {
- m_nHorzScale = nHorzScale;
- }
- void SetMultiLine(FX_BOOL bMultiLine = TRUE)
- {
- m_bMultiLine = bMultiLine;
- }
- void SetAutoReturn(FX_BOOL bAuto = TRUE)
- {
- m_bLimitWidth = bAuto;
- }
- void SetFontSize(FX_FLOAT fFontSize)
- {
- m_fFontSize = fFontSize;
- }
- void SetCharArray(FX_INT32 nCharArray = 0)
- {
- m_nCharArray = nCharArray;
- }
- void SetAutoFontSize(FX_BOOL bAuto = TRUE)
- {
- m_bAutoFontSize = bAuto;
- }
- void SetRichText(FX_BOOL bRichText)
- {
- m_bRichText = bRichText;
- }
- void SetLineLeading(FX_FLOAT fLineLeading)
- {
- m_fLineLeading = fLineLeading;
- }
- void Initialize();
- FX_BOOL IsValid() const
- {
- return m_bInitial;
- }
- FX_BOOL IsRichText() const
- {
- return m_bRichText;
- }
- void RearrangeAll();
- void RearrangePart(const CPVT_WordRange & PlaceRange);
- void ResetAll();
- void SetText(FX_LPCWSTR text, FX_INT32 charset = 1, const CPVT_SecProps * pSecProps = NULL,
- const CPVT_WordProps * pWordProps = NULL);
- CPVT_WordPlace InsertWord(const CPVT_WordPlace & place, FX_WORD word, FX_INT32 charset = 1,
- const CPVT_WordProps * pWordProps = NULL);
- CPVT_WordPlace InsertSection(const CPVT_WordPlace & place, const CPVT_SecProps * pSecProps = NULL,
- const CPVT_WordProps * pWordProps = NULL);
- CPVT_WordPlace InsertText(const CPVT_WordPlace & place, FX_LPCWSTR text, FX_INT32 charset = 1,
- const CPVT_SecProps * pSecProps = NULL, const CPVT_WordProps * pWordProps = NULL);
- CPVT_WordPlace DeleteWords(const CPVT_WordRange & PlaceRange);
- CPVT_WordPlace DeleteWord(const CPVT_WordPlace & place);
- CPVT_WordPlace BackSpaceWord(const CPVT_WordPlace & place);
- const CPDF_Rect & GetPlateRect() const
- {
- return CPDF_EditContainer::GetPlateRect();
- }
- CPDF_Rect GetContentRect() const;
- FX_INT32 GetTotalWords() const;
- FX_FLOAT GetFontSize() const
- {
- return m_fFontSize;
- }
- FX_INT32 GetAlignment() const
- {
- return m_nAlignment;
- }
- FX_INT32 GetCharArray() const
- {
- return m_nCharArray;
- }
- FX_INT32 GetLimitChar() const
- {
- return m_nLimitChar;
- }
- FX_BOOL IsMultiLine() const
- {
- return m_bMultiLine;
- }
- FX_INT32 GetHorzScale() const
- {
- return m_nHorzScale;
- }
- FX_FLOAT GetCharSpace() const
- {
- return m_fCharSpace;
- }
-
- inline CPVT_WordPlace GetBeginWordPlace() const;
- inline CPVT_WordPlace GetEndWordPlace() const;
- CPVT_WordPlace GetPrevWordPlace(const CPVT_WordPlace & place) const;
- CPVT_WordPlace GetNextWordPlace(const CPVT_WordPlace & place) const;
- CPVT_WordPlace SearchWordPlace(const CPDF_Point & point) const;
- CPVT_WordPlace GetUpWordPlace(const CPVT_WordPlace & place, const CPDF_Point & point) const;
- CPVT_WordPlace GetDownWordPlace(const CPVT_WordPlace & place, const CPDF_Point & point) const;
- CPVT_WordPlace GetLineBeginPlace(const CPVT_WordPlace & place) const;
- CPVT_WordPlace GetLineEndPlace(const CPVT_WordPlace & place) const;
- CPVT_WordPlace GetSectionBeginPlace(const CPVT_WordPlace & place) const;
- CPVT_WordPlace GetSectionEndPlace(const CPVT_WordPlace & place) const;
- void UpdateWordPlace(CPVT_WordPlace & place) const;
- FX_INT32 WordPlaceToWordIndex(const CPVT_WordPlace & place) const;
- CPVT_WordPlace WordIndexToWordPlace(FX_INT32 index) const;
- FX_WORD GetPasswordChar() const
- {
- return GetSubWord();
- }
- FX_WORD GetSubWord() const
- {
- return m_wSubWord;
- }
-private:
- FX_INT32 GetCharWidth(FX_INT32 nFontIndex, FX_WORD Word, FX_WORD SubWord, FX_INT32 nWordStyle);
- FX_INT32 GetTypeAscent(FX_INT32 nFontIndex);
- FX_INT32 GetTypeDescent(FX_INT32 nFontIndex);
- FX_INT32 GetWordFontIndex(FX_WORD word, FX_INT32 charset, FX_INT32 nFontIndex);
- FX_INT32 GetDefaultFontIndex();
- FX_BOOL IsLatinWord(FX_WORD word);
-private:
-
- CPVT_WordPlace AddSection(const CPVT_WordPlace & place, const CPVT_SectionInfo & secinfo);
- CPVT_WordPlace AddLine(const CPVT_WordPlace & place, const CPVT_LineInfo & lineinfo);
- CPVT_WordPlace AddWord(const CPVT_WordPlace & place, const CPVT_WordInfo & wordinfo);
- FX_BOOL GetWordInfo(const CPVT_WordPlace & place, CPVT_WordInfo & wordinfo);
- FX_BOOL SetWordInfo(const CPVT_WordPlace & place, const CPVT_WordInfo & wordinfo);
- FX_BOOL GetLineInfo(const CPVT_WordPlace & place, CPVT_LineInfo & lineinfo);
- FX_BOOL GetSectionInfo(const CPVT_WordPlace & place, CPVT_SectionInfo & secinfo);
- FX_FLOAT GetWordFontSize(const CPVT_WordInfo & WordInfo, FX_BOOL bFactFontSize = FALSE);
- FX_FLOAT GetWordWidth(FX_INT32 nFontIndex, FX_WORD Word, FX_WORD SubWord,
- FX_FLOAT fCharSpace, FX_INT32 nHorzScale,
- FX_FLOAT fFontSize, FX_FLOAT fWordTail, FX_INT32 nWordStyle);
- FX_FLOAT GetWordWidth(const CPVT_WordInfo & WordInfo);
- FX_FLOAT GetWordAscent(const CPVT_WordInfo & WordInfo, FX_FLOAT fFontSize);
- FX_FLOAT GetWordDescent(const CPVT_WordInfo & WordInfo, FX_FLOAT fFontSize);
- FX_FLOAT GetWordAscent(const CPVT_WordInfo & WordInfo, FX_BOOL bFactFontSize = FALSE);
- FX_FLOAT GetWordDescent(const CPVT_WordInfo & WordInfo, FX_BOOL bFactFontSize = FALSE);
- FX_FLOAT GetLineAscent(const CPVT_SectionInfo & SecInfo);
- FX_FLOAT GetLineDescent(const CPVT_SectionInfo & SecInfo);
- FX_FLOAT GetFontAscent(FX_INT32 nFontIndex, FX_FLOAT fFontSize);
- FX_FLOAT GetFontDescent(FX_INT32 nFontIndex, FX_FLOAT fFontSize);
- FX_INT32 GetWordFontIndex(const CPVT_WordInfo & WordInfo);
- FX_FLOAT GetCharSpace(const CPVT_WordInfo & WordInfo);
- FX_INT32 GetHorzScale(const CPVT_WordInfo & WordInfo);
- FX_FLOAT GetLineLeading(const CPVT_SectionInfo & SecInfo);
- FX_FLOAT GetLineIndent(const CPVT_SectionInfo & SecInfo);
- FX_INT32 GetAlignment(const CPVT_SectionInfo& SecInfo);
-
- void ClearSectionRightWords(const CPVT_WordPlace & place);
- CPVT_WordPlace AjustLineHeader(const CPVT_WordPlace & place, FX_BOOL bPrevOrNext) const;
- FX_BOOL ClearEmptySection(const CPVT_WordPlace & place);
- void ClearEmptySections(const CPVT_WordRange & PlaceRange);
- void LinkLatterSection(const CPVT_WordPlace & place);
- void ClearWords(const CPVT_WordRange & PlaceRange);
- CPVT_WordPlace ClearLeftWord(const CPVT_WordPlace & place);
- CPVT_WordPlace ClearRightWord(const CPVT_WordPlace & place);
-private:
- CPVT_FloatRect Rearrange(const CPVT_WordRange & PlaceRange);
- FX_FLOAT GetAutoFontSize();
- FX_BOOL IsBigger(FX_FLOAT fFontSize);
- CPVT_FloatRect RearrangeSections(const CPVT_WordRange & PlaceRange);
-private:
- void ResetSectionArray();
-private:
- CPVT_ArrayTemplate<CSection*> m_SectionArray;
- FX_INT32 m_nLimitChar;
- FX_INT32 m_nCharArray;
- FX_BOOL m_bMultiLine;
- FX_BOOL m_bLimitWidth;
- FX_BOOL m_bAutoFontSize;
- FX_INT32 m_nAlignment;
- FX_FLOAT m_fLineLeading;
- FX_FLOAT m_fCharSpace;
- FX_INT32 m_nHorzScale;
- FX_WORD m_wSubWord;
- FX_FLOAT m_fWordSpace;
- FX_FLOAT m_fFontSize;
-
-private:
- FX_BOOL m_bInitial;
- FX_BOOL m_bRichText;
- FX_FLOAT m_fCaretOriginX;
- FX_INT32 m_nCurFontIndex;
- IPDF_VariableText_Provider * m_pVTProvider;
- CPDF_VariableText_Iterator * m_pVTIterator;
-};
-class CPDF_VariableText_Iterator : public IPDF_VariableText_Iterator, public CFX_Object
-{
-public:
- CPDF_VariableText_Iterator(CPDF_VariableText * pVT);
- virtual ~CPDF_VariableText_Iterator();
- FX_BOOL NextWord();
- FX_BOOL PrevWord();
- FX_BOOL NextLine();
- FX_BOOL PrevLine();
- FX_BOOL NextSection();
- FX_BOOL PrevSection();
- FX_BOOL SetWord(const CPVT_Word & word);
- FX_BOOL GetWord(CPVT_Word & word) const;
- FX_BOOL GetLine(CPVT_Line & line) const;
- FX_BOOL GetSection(CPVT_Section & section) const;
- FX_BOOL SetSection(const CPVT_Section & section);
- void SetAt(FX_INT32 nWordIndex);
- void SetAt(const CPVT_WordPlace & place);
- const CPVT_WordPlace & GetAt() const
- {
- return m_CurPos;
- };
-private:
- CPVT_WordPlace m_CurPos;
- CPDF_VariableText * m_pVT;
-};
+// 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
+
+#define _PDF_VT_H_
+class CPVT_Size;
+class CPVT_FloatRect;
+struct CPVT_SectionInfo;
+struct CPVT_LineInfo;
+struct CPVT_WordInfo;
+class CLine;
+class CLines;
+class CSection;
+class CTypeset;
+class CPDF_EditContainer;
+class CPDF_VariableText;
+class CPDF_VariableText_Iterator;
+#define IsFloatZero(f) ((f) < 0.0001 && (f) > -0.0001)
+#define IsFloatBigger(fa,fb) ((fa) > (fb) && !IsFloatZero((fa) - (fb)))
+#define IsFloatSmaller(fa,fb) ((fa) < (fb) && !IsFloatZero((fa) - (fb)))
+template<class T> T FPDF_MIN (const T & i, const T & j)
+{
+ return ((i < j) ? i : j);
+}
+template<class T> T FPDF_MAX (const T & i, const T & j)
+{
+ return ((i > j) ? i : j);
+}
+class CPVT_Size
+{
+public:
+ CPVT_Size() : x(0.0f), y(0.0f)
+ {
+ }
+ CPVT_Size(FX_FLOAT x, FX_FLOAT y)
+ {
+ this->x = x;
+ this->y = y;
+ }
+ FX_FLOAT x, y;
+};
+class CPVT_FloatRect : public CFX_FloatRect
+{
+public:
+ CPVT_FloatRect()
+ {
+ left = top = right = bottom = 0.0f;
+ }
+ CPVT_FloatRect(FX_FLOAT left, FX_FLOAT top,
+ FX_FLOAT right, FX_FLOAT bottom)
+ {
+ this->left = left;
+ this->top = top;
+ this->right = right;
+ this->bottom = bottom;
+ }
+ CPVT_FloatRect(const CPDF_Rect & rect)
+ {
+ this->left = rect.left;
+ this->top = rect.top;
+ this->right = rect.right;
+ this->bottom = rect.bottom;
+ }
+ void Default()
+ {
+ left = top = right = bottom = 0.0f;
+ }
+ FX_FLOAT Height() const
+ {
+ if(this->top > this->bottom) {
+ return this->top - this->bottom;
+ } else {
+ return this->bottom - this->top;
+ }
+ }
+};
+struct CPVT_SectionInfo {
+ CPVT_SectionInfo() : rcSection(), nTotalLine(0), pSecProps(NULL), pWordProps(NULL)
+ {
+ }
+ virtual ~CPVT_SectionInfo()
+ {
+ if (pSecProps) {
+ delete pSecProps;
+ }
+ if (pWordProps) {
+ delete pWordProps;
+ }
+ }
+ CPVT_SectionInfo(const CPVT_SectionInfo & other): rcSection(), nTotalLine(0), pSecProps(NULL), pWordProps(NULL)
+ {
+ operator = (other);
+ }
+ void operator = (const CPVT_SectionInfo & other)
+ {
+ if (this == &other) {
+ return;
+ }
+ this->rcSection = other.rcSection;
+ this->nTotalLine = other.nTotalLine;
+ if (other.pSecProps) {
+ if (pSecProps) {
+ *pSecProps = *other.pSecProps;
+ } else {
+ pSecProps = FX_NEW CPVT_SecProps(*other.pSecProps);
+ }
+ }
+ if (other.pWordProps) {
+ if (pWordProps) {
+ *pWordProps = *other.pWordProps;
+ } else {
+ pWordProps = FX_NEW CPVT_WordProps(*other.pWordProps);
+ }
+ }
+ }
+ CPVT_FloatRect rcSection;
+ FX_INT32 nTotalLine;
+ CPVT_SecProps* pSecProps;
+ CPVT_WordProps* pWordProps;
+};
+struct CPVT_LineInfo {
+ CPVT_LineInfo() : nTotalWord(0), nBeginWordIndex(-1), nEndWordIndex(-1),
+ fLineX(0.0f), fLineY(0.0f), fLineWidth(0.0f), fLineAscent(0.0f), fLineDescent(0.0f)
+ {
+ }
+ FX_INT32 nTotalWord;
+ FX_INT32 nBeginWordIndex;
+ FX_INT32 nEndWordIndex;
+ FX_FLOAT fLineX;
+ FX_FLOAT fLineY;
+ FX_FLOAT fLineWidth;
+ FX_FLOAT fLineAscent;
+ FX_FLOAT fLineDescent;
+};
+struct CPVT_WordInfo : public CFX_Object {
+ CPVT_WordInfo() : Word(0), nCharset(0),
+ fWordX(0.0f), fWordY(0.0f), fWordTail(0.0f), nFontIndex(-1), pWordProps(NULL)
+ {
+ }
+ CPVT_WordInfo(FX_WORD word, FX_INT32 charset, FX_INT32 fontIndex, CPVT_WordProps * pProps):
+ Word(word), nCharset(charset), fWordX(0.0f), fWordY(0.0f), fWordTail(0.0f),
+ nFontIndex(fontIndex), pWordProps(pProps)
+ {
+ }
+ virtual ~CPVT_WordInfo()
+ {
+ if (pWordProps) {
+ delete pWordProps;
+ }
+ }
+ CPVT_WordInfo(const CPVT_WordInfo & word): Word(0), nCharset(0),
+ fWordX(0.0f), fWordY(0.0f), fWordTail(0.0f), nFontIndex(-1), pWordProps(NULL)
+ {
+ operator = (word);
+ }
+ void operator = (const CPVT_WordInfo & word)
+ {
+ if (this == &word) {
+ return;
+ }
+ this->Word = word.Word;
+ this->nCharset = word.nCharset;
+ this->nFontIndex = word.nFontIndex;
+ if (word.pWordProps) {
+ if (pWordProps) {
+ *pWordProps = *word.pWordProps;
+ } else {
+ pWordProps = FX_NEW CPVT_WordProps(*word.pWordProps);
+ }
+ }
+ }
+ FX_WORD Word;
+ FX_INT32 nCharset;
+ FX_FLOAT fWordX;
+ FX_FLOAT fWordY;
+ FX_FLOAT fWordTail;
+ FX_INT32 nFontIndex;
+ CPVT_WordProps* pWordProps;
+};
+struct CPVT_FloatRange {
+ CPVT_FloatRange() : fMin(0.0f), fMax(0.0f)
+ {
+ }
+ CPVT_FloatRange(FX_FLOAT min, FX_FLOAT max) : fMin(min), fMax(max)
+ {
+ }
+ FX_FLOAT Range() const
+ {
+ return fMax - fMin;
+ }
+ FX_FLOAT fMin, fMax;
+};
+template<class TYPE> class CPVT_ArrayTemplate : public CFX_ArrayTemplate<TYPE>
+{
+public:
+ FX_BOOL IsEmpty()
+ {
+ return CFX_ArrayTemplate<TYPE>::GetSize() <= 0;
+ }
+ TYPE GetAt(int nIndex) const
+ {
+ if (nIndex >= 0 && nIndex < CFX_ArrayTemplate<TYPE>::GetSize()) {
+ return CFX_ArrayTemplate<TYPE>::GetAt(nIndex);
+ }
+ return NULL;
+ }
+ void RemoveAt(int nIndex)
+ {
+ if (nIndex >= 0 && nIndex < CFX_ArrayTemplate<TYPE>::GetSize()) {
+ CFX_ArrayTemplate<TYPE>::RemoveAt(nIndex);
+ }
+ }
+};
+class CLine : public CFX_Object
+{
+public:
+ CLine();
+ virtual ~CLine();
+ CPVT_WordPlace GetBeginWordPlace() const;
+ CPVT_WordPlace GetEndWordPlace() const;
+ CPVT_WordPlace GetPrevWordPlace(const CPVT_WordPlace & place) const;
+ CPVT_WordPlace GetNextWordPlace(const CPVT_WordPlace & place) const;
+ CPVT_WordPlace LinePlace;
+ CPVT_LineInfo m_LineInfo;
+};
+class CLines
+{
+public:
+ CLines() : m_nTotal(0) {}
+ virtual ~CLines()
+ {
+ RemoveAll();
+ }
+ FX_INT32 GetSize() const
+ {
+ return m_Lines.GetSize();
+ }
+ CLine * GetAt(FX_INT32 nIndex) const
+ {
+ return m_Lines.GetAt(nIndex);
+ }
+ void Empty()
+ {
+ m_nTotal = 0;
+ }
+ void RemoveAll()
+ {
+ for (FX_INT32 i = 0, sz = GetSize(); i < sz; i++) {
+ delete GetAt(i);
+ }
+ m_Lines.RemoveAll();
+ m_nTotal = 0;
+ }
+ FX_INT32 Add(const CPVT_LineInfo & lineinfo)
+ {
+ if (m_nTotal >= GetSize()) {
+ if (CLine * pLine = FX_NEW CLine) {
+ pLine->m_LineInfo = lineinfo;
+ m_Lines.Add(pLine);
+ return m_nTotal++;
+ }
+ return m_nTotal;
+ } else {
+ if (CLine * pLine = GetAt(m_nTotal)) {
+ pLine->m_LineInfo = lineinfo;
+ }
+ return m_nTotal++;
+ }
+ }
+ void Clear()
+ {
+ for (FX_INT32 i = GetSize() - 1; i >= m_nTotal; i--) {
+ delete GetAt(i);
+ m_Lines.RemoveAt(i);
+ }
+ }
+private:
+ CPVT_ArrayTemplate<CLine*> m_Lines;
+ FX_INT32 m_nTotal;
+};
+class CSection : public CFX_Object
+{
+ friend class CTypeset;
+public:
+ CSection(CPDF_VariableText * pVT);
+ virtual ~CSection();
+ void ResetAll();
+ void ResetLineArray();
+ void ResetWordArray();
+ void ResetLinePlace();
+ CPVT_WordPlace AddWord(const CPVT_WordPlace & place, const CPVT_WordInfo & wordinfo);
+ CPVT_WordPlace AddLine(const CPVT_LineInfo & lineinfo);
+ void ClearWords(const CPVT_WordRange & PlaceRange);
+ void ClearWord(const CPVT_WordPlace & place);
+ CPVT_FloatRect Rearrange();
+ CPVT_Size GetSectionSize(FX_FLOAT fFontSize);
+ CPVT_WordPlace GetBeginWordPlace() const;
+ CPVT_WordPlace GetEndWordPlace() const;
+ CPVT_WordPlace GetPrevWordPlace(const CPVT_WordPlace & place) const;
+ CPVT_WordPlace GetNextWordPlace(const CPVT_WordPlace & place) const;
+ void UpdateWordPlace(CPVT_WordPlace & place) const;
+ CPVT_WordPlace SearchWordPlace(const CPDF_Point & point) const;
+ CPVT_WordPlace SearchWordPlace(FX_FLOAT fx, const CPVT_WordPlace & lineplace) const;
+ CPVT_WordPlace SearchWordPlace(FX_FLOAT fx, const CPVT_WordRange & range) const;
+public:
+ CPVT_WordPlace SecPlace;
+ CPVT_SectionInfo m_SecInfo;
+ CLines m_LineArray;
+ CPVT_ArrayTemplate<CPVT_WordInfo*> m_WordArray;
+private:
+ void ClearLeftWords(FX_INT32 nWordIndex);
+ void ClearRightWords(FX_INT32 nWordIndex);
+ void ClearMidWords(FX_INT32 nBeginIndex, FX_INT32 nEndIndex);
+
+ CPDF_VariableText *m_pVT;
+};
+class CTypeset
+{
+public:
+ CTypeset(CSection * pSection);
+ virtual ~CTypeset();
+ CPVT_Size GetEditSize(FX_FLOAT fFontSize);
+ CPVT_FloatRect Typeset();
+ CPVT_FloatRect CharArray();
+private:
+ void SplitLines(FX_BOOL bTypeset, FX_FLOAT fFontSize);
+ void OutputLines();
+
+ CPVT_FloatRect m_rcRet;
+ CPDF_VariableText * m_pVT;
+ CSection * m_pSection;
+};
+class CPDF_EditContainer
+{
+public:
+ CPDF_EditContainer(): m_rcPlate(0, 0, 0, 0), m_rcContent(0, 0, 0, 0) {};
+ virtual ~CPDF_EditContainer() {};
+ virtual void SetPlateRect(const CPDF_Rect & rect)
+ {
+ m_rcPlate = rect;
+ };
+ virtual const CPDF_Rect & GetPlateRect() const
+ {
+ return m_rcPlate;
+ };
+ virtual void SetContentRect(const CPVT_FloatRect & rect)
+ {
+ m_rcContent = rect;
+ };
+ virtual CPDF_Rect GetContentRect() const
+ {
+ return m_rcContent;
+ };
+ FX_FLOAT GetPlateWidth() const
+ {
+ return m_rcPlate.right - m_rcPlate.left;
+ };
+ FX_FLOAT GetPlateHeight() const
+ {
+ return m_rcPlate.top - m_rcPlate.bottom;
+ };
+ CPVT_Size GetPlateSize() const
+ {
+ return CPVT_Size(GetPlateWidth(), GetPlateHeight());
+ };
+ CPDF_Point GetBTPoint() const
+ {
+ return CPDF_Point(m_rcPlate.left, m_rcPlate.top);
+ };
+ CPDF_Point GetETPoint() const
+ {
+ return CPDF_Point(m_rcPlate.right, m_rcPlate.bottom);
+ };
+ inline CPDF_Point InToOut(const CPDF_Point & point) const
+ {
+ return CPDF_Point(point.x + GetBTPoint().x, GetBTPoint().y - point.y);
+ };
+ inline CPDF_Point OutToIn(const CPDF_Point & point) const
+ {
+ return CPDF_Point(point.x - GetBTPoint().x, GetBTPoint().y - point.y);
+ };
+ inline CPDF_Rect InToOut(const CPVT_FloatRect & rect) const
+ {
+ CPDF_Point ptLeftTop = InToOut(CPDF_Point(rect.left, rect.top));
+ CPDF_Point ptRightBottom = InToOut(CPDF_Point(rect.right, rect.bottom));
+ return CPDF_Rect(ptLeftTop.x, ptRightBottom.y, ptRightBottom.x, ptLeftTop.y);
+ };
+ inline CPVT_FloatRect OutToIn(const CPDF_Rect & rect) const
+ {
+ CPDF_Point ptLeftTop = OutToIn(CPDF_Point(rect.left, rect.top));
+ CPDF_Point ptRightBottom = OutToIn(CPDF_Point(rect.right, rect.bottom));
+ return CPVT_FloatRect(ptLeftTop.x, ptLeftTop.y, ptRightBottom.x, ptRightBottom.y);
+ };
+
+private:
+ CPDF_Rect m_rcPlate;
+ CPVT_FloatRect m_rcContent;
+};
+class CPDF_VariableText : public IPDF_VariableText, public CFX_Object, private CPDF_EditContainer
+{
+ friend class CTypeset;
+ friend class CSection;
+ friend class CPDF_VariableText_Iterator;
+public:
+ CPDF_VariableText();
+ virtual ~CPDF_VariableText();
+ IPDF_VariableText_Provider* SetProvider(IPDF_VariableText_Provider * pProvider);
+ IPDF_VariableText_Iterator* GetIterator();
+ void SetPlateRect(const CPDF_Rect & rect)
+ {
+ CPDF_EditContainer::SetPlateRect(rect);
+ }
+ void SetAlignment(FX_INT32 nFormat = 0)
+ {
+ m_nAlignment = nFormat;
+ }
+ void SetPasswordChar(FX_WORD wSubWord = '*')
+ {
+ m_wSubWord = wSubWord;
+ }
+ void SetLimitChar(FX_INT32 nLimitChar = 0)
+ {
+ m_nLimitChar = nLimitChar;
+ }
+ void SetCharSpace(FX_FLOAT fCharSpace = 0.0f)
+ {
+ m_fCharSpace = fCharSpace;
+ }
+ void SetHorzScale(FX_INT32 nHorzScale = 100)
+ {
+ m_nHorzScale = nHorzScale;
+ }
+ void SetMultiLine(FX_BOOL bMultiLine = TRUE)
+ {
+ m_bMultiLine = bMultiLine;
+ }
+ void SetAutoReturn(FX_BOOL bAuto = TRUE)
+ {
+ m_bLimitWidth = bAuto;
+ }
+ void SetFontSize(FX_FLOAT fFontSize)
+ {
+ m_fFontSize = fFontSize;
+ }
+ void SetCharArray(FX_INT32 nCharArray = 0)
+ {
+ m_nCharArray = nCharArray;
+ }
+ void SetAutoFontSize(FX_BOOL bAuto = TRUE)
+ {
+ m_bAutoFontSize = bAuto;
+ }
+ void SetRichText(FX_BOOL bRichText)
+ {
+ m_bRichText = bRichText;
+ }
+ void SetLineLeading(FX_FLOAT fLineLeading)
+ {
+ m_fLineLeading = fLineLeading;
+ }
+ void Initialize();
+ FX_BOOL IsValid() const
+ {
+ return m_bInitial;
+ }
+ FX_BOOL IsRichText() const
+ {
+ return m_bRichText;
+ }
+ void RearrangeAll();
+ void RearrangePart(const CPVT_WordRange & PlaceRange);
+ void ResetAll();
+ void SetText(FX_LPCWSTR text, FX_INT32 charset = 1, const CPVT_SecProps * pSecProps = NULL,
+ const CPVT_WordProps * pWordProps = NULL);
+ CPVT_WordPlace InsertWord(const CPVT_WordPlace & place, FX_WORD word, FX_INT32 charset = 1,
+ const CPVT_WordProps * pWordProps = NULL);
+ CPVT_WordPlace InsertSection(const CPVT_WordPlace & place, const CPVT_SecProps * pSecProps = NULL,
+ const CPVT_WordProps * pWordProps = NULL);
+ CPVT_WordPlace InsertText(const CPVT_WordPlace & place, FX_LPCWSTR text, FX_INT32 charset = 1,
+ const CPVT_SecProps * pSecProps = NULL, const CPVT_WordProps * pWordProps = NULL);
+ CPVT_WordPlace DeleteWords(const CPVT_WordRange & PlaceRange);
+ CPVT_WordPlace DeleteWord(const CPVT_WordPlace & place);
+ CPVT_WordPlace BackSpaceWord(const CPVT_WordPlace & place);
+ const CPDF_Rect & GetPlateRect() const
+ {
+ return CPDF_EditContainer::GetPlateRect();
+ }
+ CPDF_Rect GetContentRect() const;
+ FX_INT32 GetTotalWords() const;
+ FX_FLOAT GetFontSize() const
+ {
+ return m_fFontSize;
+ }
+ FX_INT32 GetAlignment() const
+ {
+ return m_nAlignment;
+ }
+ FX_INT32 GetCharArray() const
+ {
+ return m_nCharArray;
+ }
+ FX_INT32 GetLimitChar() const
+ {
+ return m_nLimitChar;
+ }
+ FX_BOOL IsMultiLine() const
+ {
+ return m_bMultiLine;
+ }
+ FX_INT32 GetHorzScale() const
+ {
+ return m_nHorzScale;
+ }
+ FX_FLOAT GetCharSpace() const
+ {
+ return m_fCharSpace;
+ }
+
+ inline CPVT_WordPlace GetBeginWordPlace() const;
+ inline CPVT_WordPlace GetEndWordPlace() const;
+ CPVT_WordPlace GetPrevWordPlace(const CPVT_WordPlace & place) const;
+ CPVT_WordPlace GetNextWordPlace(const CPVT_WordPlace & place) const;
+ CPVT_WordPlace SearchWordPlace(const CPDF_Point & point) const;
+ CPVT_WordPlace GetUpWordPlace(const CPVT_WordPlace & place, const CPDF_Point & point) const;
+ CPVT_WordPlace GetDownWordPlace(const CPVT_WordPlace & place, const CPDF_Point & point) const;
+ CPVT_WordPlace GetLineBeginPlace(const CPVT_WordPlace & place) const;
+ CPVT_WordPlace GetLineEndPlace(const CPVT_WordPlace & place) const;
+ CPVT_WordPlace GetSectionBeginPlace(const CPVT_WordPlace & place) const;
+ CPVT_WordPlace GetSectionEndPlace(const CPVT_WordPlace & place) const;
+ void UpdateWordPlace(CPVT_WordPlace & place) const;
+ FX_INT32 WordPlaceToWordIndex(const CPVT_WordPlace & place) const;
+ CPVT_WordPlace WordIndexToWordPlace(FX_INT32 index) const;
+ FX_WORD GetPasswordChar() const
+ {
+ return GetSubWord();
+ }
+ FX_WORD GetSubWord() const
+ {
+ return m_wSubWord;
+ }
+private:
+ FX_INT32 GetCharWidth(FX_INT32 nFontIndex, FX_WORD Word, FX_WORD SubWord, FX_INT32 nWordStyle);
+ FX_INT32 GetTypeAscent(FX_INT32 nFontIndex);
+ FX_INT32 GetTypeDescent(FX_INT32 nFontIndex);
+ FX_INT32 GetWordFontIndex(FX_WORD word, FX_INT32 charset, FX_INT32 nFontIndex);
+ FX_INT32 GetDefaultFontIndex();
+ FX_BOOL IsLatinWord(FX_WORD word);
+private:
+
+ CPVT_WordPlace AddSection(const CPVT_WordPlace & place, const CPVT_SectionInfo & secinfo);
+ CPVT_WordPlace AddLine(const CPVT_WordPlace & place, const CPVT_LineInfo & lineinfo);
+ CPVT_WordPlace AddWord(const CPVT_WordPlace & place, const CPVT_WordInfo & wordinfo);
+ FX_BOOL GetWordInfo(const CPVT_WordPlace & place, CPVT_WordInfo & wordinfo);
+ FX_BOOL SetWordInfo(const CPVT_WordPlace & place, const CPVT_WordInfo & wordinfo);
+ FX_BOOL GetLineInfo(const CPVT_WordPlace & place, CPVT_LineInfo & lineinfo);
+ FX_BOOL GetSectionInfo(const CPVT_WordPlace & place, CPVT_SectionInfo & secinfo);
+ FX_FLOAT GetWordFontSize(const CPVT_WordInfo & WordInfo, FX_BOOL bFactFontSize = FALSE);
+ FX_FLOAT GetWordWidth(FX_INT32 nFontIndex, FX_WORD Word, FX_WORD SubWord,
+ FX_FLOAT fCharSpace, FX_INT32 nHorzScale,
+ FX_FLOAT fFontSize, FX_FLOAT fWordTail, FX_INT32 nWordStyle);
+ FX_FLOAT GetWordWidth(const CPVT_WordInfo & WordInfo);
+ FX_FLOAT GetWordAscent(const CPVT_WordInfo & WordInfo, FX_FLOAT fFontSize);
+ FX_FLOAT GetWordDescent(const CPVT_WordInfo & WordInfo, FX_FLOAT fFontSize);
+ FX_FLOAT GetWordAscent(const CPVT_WordInfo & WordInfo, FX_BOOL bFactFontSize = FALSE);
+ FX_FLOAT GetWordDescent(const CPVT_WordInfo & WordInfo, FX_BOOL bFactFontSize = FALSE);
+ FX_FLOAT GetLineAscent(const CPVT_SectionInfo & SecInfo);
+ FX_FLOAT GetLineDescent(const CPVT_SectionInfo & SecInfo);
+ FX_FLOAT GetFontAscent(FX_INT32 nFontIndex, FX_FLOAT fFontSize);
+ FX_FLOAT GetFontDescent(FX_INT32 nFontIndex, FX_FLOAT fFontSize);
+ FX_INT32 GetWordFontIndex(const CPVT_WordInfo & WordInfo);
+ FX_FLOAT GetCharSpace(const CPVT_WordInfo & WordInfo);
+ FX_INT32 GetHorzScale(const CPVT_WordInfo & WordInfo);
+ FX_FLOAT GetLineLeading(const CPVT_SectionInfo & SecInfo);
+ FX_FLOAT GetLineIndent(const CPVT_SectionInfo & SecInfo);
+ FX_INT32 GetAlignment(const CPVT_SectionInfo& SecInfo);
+
+ void ClearSectionRightWords(const CPVT_WordPlace & place);
+ CPVT_WordPlace AjustLineHeader(const CPVT_WordPlace & place, FX_BOOL bPrevOrNext) const;
+ FX_BOOL ClearEmptySection(const CPVT_WordPlace & place);
+ void ClearEmptySections(const CPVT_WordRange & PlaceRange);
+ void LinkLatterSection(const CPVT_WordPlace & place);
+ void ClearWords(const CPVT_WordRange & PlaceRange);
+ CPVT_WordPlace ClearLeftWord(const CPVT_WordPlace & place);
+ CPVT_WordPlace ClearRightWord(const CPVT_WordPlace & place);
+private:
+ CPVT_FloatRect Rearrange(const CPVT_WordRange & PlaceRange);
+ FX_FLOAT GetAutoFontSize();
+ FX_BOOL IsBigger(FX_FLOAT fFontSize);
+ CPVT_FloatRect RearrangeSections(const CPVT_WordRange & PlaceRange);
+private:
+ void ResetSectionArray();
+private:
+ CPVT_ArrayTemplate<CSection*> m_SectionArray;
+ FX_INT32 m_nLimitChar;
+ FX_INT32 m_nCharArray;
+ FX_BOOL m_bMultiLine;
+ FX_BOOL m_bLimitWidth;
+ FX_BOOL m_bAutoFontSize;
+ FX_INT32 m_nAlignment;
+ FX_FLOAT m_fLineLeading;
+ FX_FLOAT m_fCharSpace;
+ FX_INT32 m_nHorzScale;
+ FX_WORD m_wSubWord;
+ FX_FLOAT m_fWordSpace;
+ FX_FLOAT m_fFontSize;
+
+private:
+ FX_BOOL m_bInitial;
+ FX_BOOL m_bRichText;
+ FX_FLOAT m_fCaretOriginX;
+ FX_INT32 m_nCurFontIndex;
+ IPDF_VariableText_Provider * m_pVTProvider;
+ CPDF_VariableText_Iterator * m_pVTIterator;
+};
+class CPDF_VariableText_Iterator : public IPDF_VariableText_Iterator, public CFX_Object
+{
+public:
+ CPDF_VariableText_Iterator(CPDF_VariableText * pVT);
+ virtual ~CPDF_VariableText_Iterator();
+ FX_BOOL NextWord();
+ FX_BOOL PrevWord();
+ FX_BOOL NextLine();
+ FX_BOOL PrevLine();
+ FX_BOOL NextSection();
+ FX_BOOL PrevSection();
+ FX_BOOL SetWord(const CPVT_Word & word);
+ FX_BOOL GetWord(CPVT_Word & word) const;
+ FX_BOOL GetLine(CPVT_Line & line) const;
+ FX_BOOL GetSection(CPVT_Section & section) const;
+ FX_BOOL SetSection(const CPVT_Section & section);
+ void SetAt(FX_INT32 nWordIndex);
+ void SetAt(const CPVT_WordPlace & place);
+ const CPVT_WordPlace & GetAt() const
+ {
+ return m_CurPos;
+ };
+private:
+ CPVT_WordPlace m_CurPos;
+ CPDF_VariableText * m_pVT;
+};
diff --git a/core/src/fpdfdoc/tagged_int.h b/core/src/fpdfdoc/tagged_int.h
index a343a801f3..0ebf4084a4 100644
--- a/core/src/fpdfdoc/tagged_int.h
+++ b/core/src/fpdfdoc/tagged_int.h
@@ -1,91 +1,91 @@
-// 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 _FPDF_TAGGED_INT_H_
-#define _FPDF_TAGGED_INT_H_
-class CPDF_StructTreeImpl;
-class CPDF_StructElementImpl;
-class CPDF_StructTreeImpl : public CPDF_StructTree
-{
-public:
- CPDF_StructTreeImpl(const CPDF_Document* pDoc);
- ~CPDF_StructTreeImpl();
- int CountTopElements() const
- {
- return m_Kids.GetSize();
- }
- CPDF_StructElement* GetTopElement(int i) const
- {
- return (CPDF_StructElement*)m_Kids.GetAt(i);
- }
- void LoadDocTree();
- void LoadPageTree(const CPDF_Dictionary* pPageDict);
- CPDF_StructElementImpl* AddPageNode(CPDF_Dictionary* pElement, CFX_MapPtrToPtr& map, int nLevel = 0);
- FX_BOOL AddTopLevelNode(CPDF_Dictionary* pDict, CPDF_StructElementImpl* pElement);
-protected:
- const CPDF_Dictionary* m_pTreeRoot;
- const CPDF_Dictionary* m_pRoleMap;
- const CPDF_Dictionary* m_pPage;
- CFX_ArrayTemplate<CPDF_StructElementImpl*> m_Kids;
- friend class CPDF_StructElementImpl;
-};
-class CPDF_StructElementImpl : public CPDF_StructElement
-{
-public:
- CPDF_StructElementImpl(CPDF_StructTreeImpl* pTree, CPDF_StructElementImpl* pParent, CPDF_Dictionary* pDict);
- ~CPDF_StructElementImpl();
- CPDF_StructTree* GetTree() const
- {
- return m_pTree;
- }
- const CFX_ByteString& GetType() const
- {
- return m_Type;
- }
- CPDF_StructElement* GetParent() const
- {
- return m_pParent;
- }
- CPDF_Dictionary * GetDict() const
- {
- return m_pDict;
- }
- int CountKids() const
- {
- return m_Kids.GetSize();
- }
- const CPDF_StructKid& GetKid(int index) const
- {
- return m_Kids.GetData()[index];
- }
- CFX_PtrArray* GetObjectArray()
- {
- return &m_ObjectArray;
- }
-
- CPDF_Object* GetAttr(FX_BSTR owner, FX_BSTR name, FX_BOOL bInheritable = FALSE, FX_FLOAT fLevel = 0.0F);
-
- CFX_ByteString GetName(FX_BSTR owner, FX_BSTR name, FX_BSTR default_value, FX_BOOL bInheritable = FALSE, int subindex = -1);
- FX_ARGB GetColor(FX_BSTR owner, FX_BSTR name, FX_ARGB default_value, FX_BOOL bInheritable = FALSE, int subindex = -1);
- FX_FLOAT GetNumber(FX_BSTR owner, FX_BSTR name, FX_FLOAT default_value, FX_BOOL bInheritable = FALSE, int subindex = -1);
- int GetInteger(FX_BSTR owner, FX_BSTR name, int default_value, FX_BOOL bInheritable = FALSE, int subindex = -1);
- CFX_PtrArray m_ObjectArray;
- void LoadKids(CPDF_Dictionary* pDict);
- void LoadKid(FX_DWORD PageObjNum, CPDF_Object* pObj, CPDF_StructKid* pKid);
- CPDF_Object* GetAttr(FX_BSTR owner, FX_BSTR name, FX_BOOL bInheritable, int subindex);
- CPDF_StructElementImpl* Retain();
- void Release();
-protected:
- CPDF_StructTreeImpl* m_pTree;
- CFX_ByteString m_Type;
- CPDF_StructElementImpl* m_pParent;
- CPDF_Dictionary* m_pDict;
- CFX_ArrayTemplate<CPDF_StructKid> m_Kids;
-
- int m_RefCount;
- friend class CPDF_StructTreeImpl;
-};
-#endif
+// 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 _FPDF_TAGGED_INT_H_
+#define _FPDF_TAGGED_INT_H_
+class CPDF_StructTreeImpl;
+class CPDF_StructElementImpl;
+class CPDF_StructTreeImpl : public CPDF_StructTree
+{
+public:
+ CPDF_StructTreeImpl(const CPDF_Document* pDoc);
+ ~CPDF_StructTreeImpl();
+ int CountTopElements() const
+ {
+ return m_Kids.GetSize();
+ }
+ CPDF_StructElement* GetTopElement(int i) const
+ {
+ return (CPDF_StructElement*)m_Kids.GetAt(i);
+ }
+ void LoadDocTree();
+ void LoadPageTree(const CPDF_Dictionary* pPageDict);
+ CPDF_StructElementImpl* AddPageNode(CPDF_Dictionary* pElement, CFX_MapPtrToPtr& map, int nLevel = 0);
+ FX_BOOL AddTopLevelNode(CPDF_Dictionary* pDict, CPDF_StructElementImpl* pElement);
+protected:
+ const CPDF_Dictionary* m_pTreeRoot;
+ const CPDF_Dictionary* m_pRoleMap;
+ const CPDF_Dictionary* m_pPage;
+ CFX_ArrayTemplate<CPDF_StructElementImpl*> m_Kids;
+ friend class CPDF_StructElementImpl;
+};
+class CPDF_StructElementImpl : public CPDF_StructElement
+{
+public:
+ CPDF_StructElementImpl(CPDF_StructTreeImpl* pTree, CPDF_StructElementImpl* pParent, CPDF_Dictionary* pDict);
+ ~CPDF_StructElementImpl();
+ CPDF_StructTree* GetTree() const
+ {
+ return m_pTree;
+ }
+ const CFX_ByteString& GetType() const
+ {
+ return m_Type;
+ }
+ CPDF_StructElement* GetParent() const
+ {
+ return m_pParent;
+ }
+ CPDF_Dictionary * GetDict() const
+ {
+ return m_pDict;
+ }
+ int CountKids() const
+ {
+ return m_Kids.GetSize();
+ }
+ const CPDF_StructKid& GetKid(int index) const
+ {
+ return m_Kids.GetData()[index];
+ }
+ CFX_PtrArray* GetObjectArray()
+ {
+ return &m_ObjectArray;
+ }
+
+ CPDF_Object* GetAttr(FX_BSTR owner, FX_BSTR name, FX_BOOL bInheritable = FALSE, FX_FLOAT fLevel = 0.0F);
+
+ CFX_ByteString GetName(FX_BSTR owner, FX_BSTR name, FX_BSTR default_value, FX_BOOL bInheritable = FALSE, int subindex = -1);
+ FX_ARGB GetColor(FX_BSTR owner, FX_BSTR name, FX_ARGB default_value, FX_BOOL bInheritable = FALSE, int subindex = -1);
+ FX_FLOAT GetNumber(FX_BSTR owner, FX_BSTR name, FX_FLOAT default_value, FX_BOOL bInheritable = FALSE, int subindex = -1);
+ int GetInteger(FX_BSTR owner, FX_BSTR name, int default_value, FX_BOOL bInheritable = FALSE, int subindex = -1);
+ CFX_PtrArray m_ObjectArray;
+ void LoadKids(CPDF_Dictionary* pDict);
+ void LoadKid(FX_DWORD PageObjNum, CPDF_Object* pObj, CPDF_StructKid* pKid);
+ CPDF_Object* GetAttr(FX_BSTR owner, FX_BSTR name, FX_BOOL bInheritable, int subindex);
+ CPDF_StructElementImpl* Retain();
+ void Release();
+protected:
+ CPDF_StructTreeImpl* m_pTree;
+ CFX_ByteString m_Type;
+ CPDF_StructElementImpl* m_pParent;
+ CPDF_Dictionary* m_pDict;
+ CFX_ArrayTemplate<CPDF_StructKid> m_Kids;
+
+ int m_RefCount;
+ friend class CPDF_StructTreeImpl;
+};
+#endif
diff --git a/core/src/fpdftext/fpdf_text.cpp b/core/src/fpdftext/fpdf_text.cpp
index 2576b757b6..048ebde2be 100644
--- a/core/src/fpdftext/fpdf_text.cpp
+++ b/core/src/fpdftext/fpdf_text.cpp
@@ -1,791 +1,791 @@
-// 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
-
-#include "../../include/fpdfapi/fpdf_page.h"
-#include "../../include/fpdfapi/fpdf_pageobj.h"
-#include "../../include/fpdftext/fpdf_text.h"
-#include "txtproc.h"
-#include "text_int.h"
-#if !defined(_FPDFAPI_MINI_) || defined(_FXCORE_FEATURE_ALL_)
-extern FX_LPCSTR FCS_GetAltStr(FX_WCHAR);
-CFX_ByteString CharFromUnicodeAlt(FX_WCHAR unicode, int destcp, FX_LPCSTR defchar)
-{
- if (destcp == 0) {
- if (unicode < 0x80) {
- return CFX_ByteString((char)unicode);
- }
- FX_LPCSTR altstr = FCS_GetAltStr(unicode);
- if (altstr) {
- return CFX_ByteString(altstr, -1);
- }
- return CFX_ByteString(defchar, -1);
- }
- FX_BOOL bDef = FALSE;
- char buf[10];
- int ret = FXSYS_WideCharToMultiByte(destcp, 0, (wchar_t*)&unicode, 1, buf, 10, NULL, &bDef);
- if (ret && !bDef) {
- return CFX_ByteString(buf, ret);
- }
- FX_LPCSTR altstr = FCS_GetAltStr(unicode);
- if (altstr) {
- return CFX_ByteString(altstr, -1);
- }
- return CFX_ByteString(defchar, -1);
-}
-CTextPage::CTextPage()
-{
-}
-CTextPage::~CTextPage()
-{
- int i;
- for (i = 0; i < m_BaseLines.GetSize(); i ++) {
- CTextBaseLine* pBaseLine = (CTextBaseLine*)m_BaseLines.GetAt(i);
- delete pBaseLine;
- }
- for (i = 0; i < m_TextColumns.GetSize(); i ++) {
- CTextColumn* pTextColumn = (CTextColumn*)m_TextColumns.GetAt(i);
- delete pTextColumn;
- }
-}
-void CTextPage::ProcessObject(CPDF_PageObject* pObject)
-{
- if (pObject->m_Type != PDFPAGE_TEXT) {
- return;
- }
- CPDF_TextObject* pText = (CPDF_TextObject*)pObject;
- CPDF_Font* pFont = pText->m_TextState.GetFont();
- int count = pText->CountItems();
- FX_FLOAT* pPosArray = FX_Alloc(FX_FLOAT, count * 2);
- if (pPosArray) {
- pText->CalcCharPos(pPosArray);
- }
- FX_FLOAT fontsize_h = pText->m_TextState.GetFontSizeH();
- FX_FLOAT fontsize_v = pText->m_TextState.GetFontSizeV();
- FX_DWORD space_charcode = pFont->CharCodeFromUnicode(' ');
- FX_FLOAT spacew = 0;
- if (space_charcode != -1) {
- spacew = fontsize_h * pFont->GetCharWidthF(space_charcode) / 1000;
- }
- if (spacew == 0) {
- spacew = fontsize_h / 4;
- }
- if (pText->m_TextState.GetBaselineAngle() != 0) {
- int cc = 0;
- CFX_AffineMatrix matrix;
- pText->GetTextMatrix(&matrix);
- for (int i = 0; i < pText->m_nChars; i ++) {
- FX_DWORD charcode = pText->m_nChars == 1 ? (FX_DWORD)(FX_UINTPTR)pText->m_pCharCodes : pText->m_pCharCodes[i];
- if (charcode == (FX_DWORD) - 1) {
- continue;
- }
- FX_RECT char_box;
- pFont->GetCharBBox(charcode, char_box);
- FX_FLOAT char_left = pPosArray ? pPosArray[cc * 2] : char_box.left * pText->m_TextState.GetFontSize() / 1000;
- FX_FLOAT char_right = pPosArray ? pPosArray[cc * 2 + 1] : char_box.right * pText->m_TextState.GetFontSize() / 1000;
- FX_FLOAT char_top = char_box.top * pText->m_TextState.GetFontSize() / 1000;
- FX_FLOAT char_bottom = char_box.bottom * pText->m_TextState.GetFontSize() / 1000;
- cc ++;
- FX_FLOAT char_origx, char_origy;
- matrix.Transform(char_left, 0, char_origx, char_origy);
- matrix.TransformRect(char_left, char_right, char_top, char_bottom);
- CFX_ByteString str;
- pFont->AppendChar(str, charcode);
- InsertTextBox(NULL, char_origy, char_left, char_right, char_top,
- char_bottom, spacew, fontsize_v, str, pFont);
- }
- if (pPosArray) {
- FX_Free(pPosArray);
- }
- return;
- }
- FX_FLOAT ratio_h = fontsize_h / pText->m_TextState.GetFontSize();
- for (int ii = 0; ii < count * 2; ii ++) {
- pPosArray[ii] *= ratio_h;
- }
- FX_FLOAT baseline = pText->m_PosY;
- CTextBaseLine* pBaseLine = NULL;
- FX_FLOAT topy = pText->m_Top;
- FX_FLOAT bottomy = pText->m_Bottom;
- FX_FLOAT leftx = pText->m_Left;
- int cc = 0;
- CFX_ByteString segment;
- int space_count = 0;
- FX_FLOAT last_left = 0, last_right = 0, segment_left = 0, segment_right = 0;
- for (int i = 0; i < pText->m_nChars; i ++) {
- FX_DWORD charcode = pText->m_nChars == 1 ? (FX_DWORD)(FX_UINTPTR)pText->m_pCharCodes : pText->m_pCharCodes[i];
- if (charcode == (FX_DWORD) - 1) {
- continue;
- }
- FX_FLOAT char_left = pPosArray[cc * 2];
- FX_FLOAT char_right = pPosArray[cc * 2 + 1];
- cc ++;
- if (char_left < last_left || (char_left - last_right) > spacew / 2) {
- pBaseLine = InsertTextBox(pBaseLine, baseline, leftx + segment_left, leftx + segment_right,
- topy, bottomy, spacew, fontsize_v, segment, pFont);
- segment_left = char_left;
- segment = "";
- }
- CFX_WideString wCh = pText->GetFont()->UnicodeFromCharCode(charcode);
- FX_DWORD ch = wCh.GetLength() > 0 ? wCh.GetAt(0) : charcode;
- if (space_count > 1) {
- pBaseLine = InsertTextBox(pBaseLine, baseline, leftx + segment_left, leftx + segment_right,
- topy, bottomy, spacew, fontsize_v, segment, pFont);
- segment = "";
- } else if (space_count == 1) {
- pFont->AppendChar(segment, ' ');
- }
- if (segment.GetLength() == 0) {
- segment_left = char_left;
- }
- segment_right = char_right;
- pFont->AppendChar(segment, charcode);
- space_count = 0;
- last_left = char_left;
- last_right = char_right;
- }
- if (segment.GetLength())
- pBaseLine = InsertTextBox(pBaseLine, baseline, leftx + segment_left, leftx + segment_right,
- topy, bottomy, spacew, fontsize_v, segment, pFont);
- FX_Free(pPosArray);
-}
-static void ConvertPDFString(CFX_ByteString& result, CFX_ByteString& src, CPDF_Font* pFont);
-CTextBaseLine* CTextPage::InsertTextBox(CTextBaseLine* pBaseLine, FX_FLOAT basey, FX_FLOAT leftx,
- FX_FLOAT rightx, FX_FLOAT topy, FX_FLOAT bottomy, FX_FLOAT spacew, FX_FLOAT fontsize_v,
- CFX_ByteString& str, CPDF_Font* pFont)
-{
- if (str.GetLength() == 0) {
- return NULL;
- }
- if (pBaseLine == NULL) {
- int i;
- for (i = 0; i < m_BaseLines.GetSize(); i ++) {
- CTextBaseLine* pExistLine = (CTextBaseLine*)m_BaseLines.GetAt(i);
- if (pExistLine->m_BaseLine == basey) {
- pBaseLine = pExistLine;
- break;
- }
- if (pExistLine->m_BaseLine < basey) {
- break;
- }
- }
- if (pBaseLine == NULL) {
- pBaseLine = FX_NEW CTextBaseLine;
- if (NULL == pBaseLine) {
- return NULL;
- }
- pBaseLine->m_BaseLine = basey;
- m_BaseLines.InsertAt(i, pBaseLine);
- }
- }
- CFX_WideString text;
- FX_LPCSTR pStr = str;
- int len = str.GetLength(), offset = 0;
- while (offset < len) {
- FX_DWORD ch = pFont->GetNextChar(pStr, offset);
- CFX_WideString unicode_str = pFont->UnicodeFromCharCode(ch);
- text += unicode_str;
- }
- pBaseLine->InsertTextBox(leftx, rightx, topy, bottomy, spacew, fontsize_v, text);
- return pBaseLine;
-}
-void CTextPage::WriteOutput(CFX_WideStringArray& lines, int iMinWidth)
-{
- FX_FLOAT lastheight = -1;
- FX_FLOAT lastbaseline = -1;
- FX_FLOAT MinLeftX = 1000000;
- FX_FLOAT MaxRightX = 0;
- int i;
- for (i = 0; i < m_BaseLines.GetSize(); i ++) {
- CTextBaseLine* pBaseLine = (CTextBaseLine*)m_BaseLines.GetAt(i);
- FX_FLOAT leftx, rightx;
- if (pBaseLine->GetWidth(leftx, rightx)) {
- if (leftx < MinLeftX) {
- MinLeftX = leftx;
- }
- if (rightx > MaxRightX) {
- MaxRightX = rightx;
- }
- }
- }
- for (i = 0; i < m_BaseLines.GetSize(); i ++) {
- CTextBaseLine* pBaseLine = (CTextBaseLine*)m_BaseLines.GetAt(i);
- pBaseLine->MergeBoxes();
- }
- for (i = 1; i < m_BaseLines.GetSize(); i ++) {
- CTextBaseLine* pBaseLine = (CTextBaseLine*)m_BaseLines.GetAt(i);
- CTextBaseLine* pPrevLine = (CTextBaseLine*)m_BaseLines.GetAt(i - 1);
- if (pBaseLine->CanMerge(pPrevLine)) {
- pPrevLine->Merge(pBaseLine);
- delete pBaseLine;
- m_BaseLines.RemoveAt(i);
- i --;
- }
- }
- if (m_bAutoWidth) {
- int* widths = FX_Alloc(int, m_BaseLines.GetSize());
- if (widths) {
- for (i = 0; i < m_BaseLines.GetSize(); i ++) {
- widths[i] = 0;
- CTextBaseLine* pBaseLine = (CTextBaseLine*)m_BaseLines.GetAt(i);
- int TotalChars = 0;
- FX_FLOAT TotalWidth = 0;
- int minchars;
- pBaseLine->CountChars(TotalChars, TotalWidth, minchars);
- if (TotalChars) {
- FX_FLOAT charwidth = TotalWidth / TotalChars;
- widths[i] = (int)((MaxRightX - MinLeftX) / charwidth);
- }
- if (widths[i] > 1000) {
- widths[i] = 1000;
- }
- if (widths[i] < minchars) {
- widths[i] = minchars;
- }
- }
- int AvgWidth = 0, widthcount = 0;
- for (i = 0; i < m_BaseLines.GetSize(); i ++)
- if (widths[i]) {
- AvgWidth += widths[i];
- widthcount ++;
- }
- AvgWidth = int((FX_FLOAT)AvgWidth / widthcount + 0.5);
- int MaxWidth = 0;
- for (i = 0; i < m_BaseLines.GetSize(); i ++)
- if (MaxWidth < widths[i]) {
- MaxWidth = widths[i];
- }
- if (MaxWidth > AvgWidth * 6 / 5) {
- MaxWidth = AvgWidth * 6 / 5;
- }
- FX_Free(widths);
- if (iMinWidth < MaxWidth) {
- iMinWidth = MaxWidth;
- }
- }
- }
- for (i = 0; i < m_BaseLines.GetSize(); i ++) {
- CTextBaseLine* pBaseLine = (CTextBaseLine*)m_BaseLines.GetAt(i);
- pBaseLine->MergeBoxes();
- }
- if (m_bKeepColumn) {
- FindColumns();
- }
- for (i = 0; i < m_BaseLines.GetSize(); i ++) {
- CTextBaseLine* pBaseLine = (CTextBaseLine*)m_BaseLines.GetAt(i);
- if (lastheight >= 0) {
- FX_FLOAT dy = lastbaseline - pBaseLine->m_BaseLine;
- if (dy >= (pBaseLine->m_MaxFontSizeV) * 1.5 || dy >= lastheight * 1.5) {
- lines.Add(L"");
- }
- }
- lastheight = pBaseLine->m_MaxFontSizeV;
- lastbaseline = pBaseLine->m_BaseLine;
- CFX_WideString str;
- pBaseLine->WriteOutput(str, MinLeftX, MaxRightX - MinLeftX, iMinWidth);
- lines.Add(str);
- }
-}
-void NormalizeCompositeChar(FX_WCHAR wChar, CFX_WideString& sDest)
-{
- wChar = FX_GetMirrorChar(wChar, TRUE, FALSE);
- FX_LPWSTR pDst = NULL;
- FX_STRSIZE nCount = FX_Unicode_GetNormalization(wChar, pDst);
- if (nCount < 1 ) {
- sDest += wChar;
- return;
- }
- pDst = new FX_WCHAR[nCount];
- FX_Unicode_GetNormalization(wChar, pDst);
- for (int nIndex = 0; nIndex < nCount; nIndex++) {
- sDest += pDst[nIndex];
- }
- delete[] pDst;
-}
-void NormalizeString(CFX_WideString& str)
-{
- if (str.GetLength() <= 0) {
- return;
- }
- CFX_WideString sBuffer;
- IFX_BidiChar* BidiChar = IFX_BidiChar::Create();
- if (NULL == BidiChar) {
- return;
- }
- CFX_WordArray order;
- FX_BOOL bR2L = FALSE;
- FX_INT32 start = 0, count = 0, i = 0;
- int nR2L = 0, nL2R = 0;
- for (i = 0; i < str.GetLength(); i++) {
- if(BidiChar->AppendChar(str.GetAt(i))) {
- FX_INT32 ret = BidiChar->GetBidiInfo(start, count);
- order.Add(start);
- order.Add(count);
- order.Add(ret);
- if(!bR2L) {
- if(ret == 2) {
- nR2L++;
- } else if (ret == 1) {
- nL2R++;
- }
- }
- }
- }
- if(BidiChar->EndChar()) {
- FX_INT32 ret = BidiChar->GetBidiInfo(start, count);
- order.Add(start);
- order.Add(count);
- order.Add(ret);
- if(!bR2L) {
- if(ret == 2) {
- nR2L++;
- } else if(ret == 1) {
- nL2R++;
- }
- }
- }
- if(nR2L > 0 && nR2L >= nL2R) {
- bR2L = TRUE;
- }
- if(bR2L) {
- int count = order.GetSize();
- for(int j = count - 1; j > 0; j -= 3) {
- int ret = order.GetAt(j);
- int start = order.GetAt(j - 2);
- int count1 = order.GetAt(j - 1);
- if(ret == 2 || ret == 0) {
- for(int i = start + count1 - 1; i >= start; i--) {
- NormalizeCompositeChar(str[i], sBuffer);
- }
- } else {
- i = j;
- FX_BOOL bSymbol = FALSE;
- while(i > 0 && order.GetAt(i) != 2) {
- bSymbol = !order.GetAt(i);
- i -= 3;
- }
- int end = start + count1 ;
- int n = 0;
- if(bSymbol) {
- n = i + 6;
- } else {
- n = i + 3;
- }
- if(n >= j) {
- for(int m = start; m < end; m++) {
- sBuffer += str[m];
- }
- } else {
- i = j;
- j = n;
- for(; n <= i; n += 3) {
- int ret = order.GetAt(n);
- int start = order.GetAt(n - 2);
- int count1 = order.GetAt(n - 1);
- int end = start + count1 ;
- for(int m = start; m < end; m++) {
- sBuffer += str[m];
- }
- }
- }
- }
- }
- } else {
- int count = order.GetSize();
- FX_BOOL bL2R = FALSE;
- for(int j = 0; j < count; j += 3) {
- int ret = order.GetAt(j + 2);
- int start = order.GetAt(j);
- int count1 = order.GetAt(j + 1);
- if(ret == 2 || (j == 0 && ret == 0 && !bL2R)) {
- int i = j + 3;
- while(bR2L && i < count) {
- if(order.GetAt(i + 2) == 1) {
- break;
- } else {
- i += 3;
- }
- }
- if(i == 3) {
- j = -3;
- bL2R = TRUE;
- continue;
- }
- int end = str.GetLength() - 1;
- if(i < count) {
- end = order.GetAt(i) - 1;
- }
- j = i - 3;
- for(int n = end; n >= start; n--) {
- NormalizeCompositeChar(str[i], sBuffer);
- }
- } else {
- int end = start + count1 ;
- for(int i = start; i < end; i++) {
- sBuffer += str[i];
- }
- }
- }
- }
- str.Empty();
- str += sBuffer;
- BidiChar->Release();
-}
-static FX_BOOL IsNumber(CFX_WideString& str)
-{
- for (int i = 0; i < str.GetLength(); i ++) {
- FX_WCHAR ch = str[i];
- if ((ch < '0' || ch > '9') && ch != '-' && ch != '+' && ch != '.' && ch != ' ') {
- return FALSE;
- }
- }
- return TRUE;
-}
-void CTextPage::FindColumns()
-{
- int i;
- for (i = 0; i < m_BaseLines.GetSize(); i ++) {
- CTextBaseLine* pBaseLine = (CTextBaseLine*)m_BaseLines.GetAt(i);
- for (int j = 0; j < pBaseLine->m_TextList.GetSize(); j ++) {
- CTextBox* pTextBox = (CTextBox*)pBaseLine->m_TextList.GetAt(j);
- CTextColumn* pColumn = FindColumn(pTextBox->m_Right);
- if (pColumn == NULL) {
- pColumn = FX_NEW CTextColumn;
- if (pColumn) {
- pColumn->m_Count = 1;
- pColumn->m_AvgPos = pTextBox->m_Right;
- pColumn->m_TextPos = -1;
- m_TextColumns.Add(pColumn);
- }
- } else {
- pColumn->m_AvgPos = (pColumn->m_Count * pColumn->m_AvgPos + pTextBox->m_Right) /
- (pColumn->m_Count + 1);
- pColumn->m_Count ++;
- }
- }
- }
- int mincount = m_BaseLines.GetSize() / 4;
- for (i = 0; i < m_TextColumns.GetSize(); i ++) {
- CTextColumn* pTextColumn = (CTextColumn*)m_TextColumns.GetAt(i);
- if (pTextColumn->m_Count >= mincount) {
- continue;
- }
- delete pTextColumn;
- m_TextColumns.RemoveAt(i);
- i --;
- }
- for (i = 0; i < m_BaseLines.GetSize(); i ++) {
- CTextBaseLine* pBaseLine = (CTextBaseLine*)m_BaseLines.GetAt(i);
- for (int j = 0; j < pBaseLine->m_TextList.GetSize(); j ++) {
- CTextBox* pTextBox = (CTextBox*)pBaseLine->m_TextList.GetAt(j);
- if (IsNumber(pTextBox->m_Text)) {
- pTextBox->m_pColumn = FindColumn(pTextBox->m_Right);
- }
- }
- }
-}
-CTextColumn* CTextPage::FindColumn(FX_FLOAT xpos)
-{
- for (int i = 0; i < m_TextColumns.GetSize(); i ++) {
- CTextColumn* pColumn = (CTextColumn*)m_TextColumns.GetAt(i);
- if (pColumn->m_AvgPos < xpos + 1 && pColumn->m_AvgPos > xpos - 1) {
- return pColumn;
- }
- }
- return NULL;
-}
-void CTextPage::BreakSpace(CPDF_TextObject* pTextObj)
-{
-}
-CTextBaseLine::CTextBaseLine()
-{
- m_Top = -100000;
- m_Bottom = 100000;
- m_MaxFontSizeV = 0;
-}
-CTextBaseLine::~CTextBaseLine()
-{
- for (int i = 0; i < m_TextList.GetSize(); i ++) {
- CTextBox* pText = (CTextBox*)m_TextList.GetAt(i);
- delete pText;
- }
-}
-void CTextBaseLine::InsertTextBox(FX_FLOAT leftx, FX_FLOAT rightx, FX_FLOAT topy, FX_FLOAT bottomy,
- FX_FLOAT spacew, FX_FLOAT fontsize_v, const CFX_WideString& text)
-{
- if (m_Top < topy) {
- m_Top = topy;
- }
- if (m_Bottom > bottomy) {
- m_Bottom = bottomy;
- }
- if (m_MaxFontSizeV < fontsize_v) {
- m_MaxFontSizeV = fontsize_v;
- }
- int i;
- for (i = 0; i < m_TextList.GetSize(); i ++) {
- CTextBox* pText = (CTextBox*)m_TextList.GetAt(i);
- if (pText->m_Left > leftx) {
- break;
- }
- }
- CTextBox* pText = FX_NEW CTextBox;
- if (NULL == pText) {
- return;
- }
- pText->m_Text = text;
- pText->m_Left = leftx;
- pText->m_Right = rightx;
- pText->m_Top = topy;
- pText->m_Bottom = bottomy;
- pText->m_SpaceWidth = spacew;
- pText->m_FontSizeV = fontsize_v;
- pText->m_pColumn = NULL;
- m_TextList.InsertAt(i, pText);
-}
-FX_BOOL GetIntersection(FX_FLOAT low1, FX_FLOAT high1, FX_FLOAT low2, FX_FLOAT high2,
- FX_FLOAT& interlow, FX_FLOAT& interhigh);
-FX_BOOL CTextBaseLine::CanMerge(CTextBaseLine* pOther)
-{
- FX_FLOAT inter_top, inter_bottom;
- if (!GetIntersection(m_Bottom, m_Top, pOther->m_Bottom, pOther->m_Top,
- inter_bottom, inter_top)) {
- return FALSE;
- }
- FX_FLOAT inter_h = inter_top - inter_bottom;
- if (inter_h < (m_Top - m_Bottom) / 2 && inter_h < (pOther->m_Top - pOther->m_Bottom) / 2) {
- return FALSE;
- }
- FX_FLOAT dy = (FX_FLOAT)FXSYS_fabs(m_BaseLine - pOther->m_BaseLine);
- for (int i = 0; i < m_TextList.GetSize(); i ++) {
- CTextBox* pText = (CTextBox*)m_TextList.GetAt(i);
- FX_FLOAT width = pText->m_Right - pText->m_Left;
- for (int j = 0; j < pOther->m_TextList.GetSize(); j ++) {
- CTextBox* pOtherText = (CTextBox*)pOther->m_TextList.GetAt(j);
- FX_FLOAT inter_left, inter_right;
- if (!GetIntersection(pText->m_Left, pText->m_Right,
- pOtherText->m_Left, pOtherText->m_Right, inter_left, inter_right)) {
- continue;
- }
- FX_FLOAT inter_w = inter_right - inter_left;
- if (inter_w < pText->m_SpaceWidth / 2 && inter_w < pOtherText->m_SpaceWidth / 2) {
- continue;
- }
- if (dy >= (pText->m_Bottom - pText->m_Top) / 2 ||
- dy >= (pOtherText->m_Bottom - pOtherText->m_Top) / 2) {
- return FALSE;
- }
- }
- }
- return TRUE;
-}
-void CTextBaseLine::Merge(CTextBaseLine* pOther)
-{
- for (int i = 0; i < pOther->m_TextList.GetSize(); i ++) {
- CTextBox* pText = (CTextBox*)pOther->m_TextList.GetAt(i);
- InsertTextBox(pText->m_Left, pText->m_Right, pText->m_Top, pText->m_Bottom,
- pText->m_SpaceWidth, pText->m_FontSizeV, pText->m_Text);
- }
-}
-FX_BOOL CTextBaseLine::GetWidth(FX_FLOAT& leftx, FX_FLOAT& rightx)
-{
- int i;
- for (i = 0; i < m_TextList.GetSize(); i ++) {
- CTextBox* pText = (CTextBox*)m_TextList.GetAt(i);
- if (pText->m_Text != L" ") {
- break;
- }
- }
- if (i == m_TextList.GetSize()) {
- return FALSE;
- }
- CTextBox* pText = (CTextBox*)m_TextList.GetAt(i);
- leftx = pText->m_Left;
- for (i = m_TextList.GetSize() - 1; i >= 0; i --) {
- CTextBox* pText = (CTextBox*)m_TextList.GetAt(i);
- if (pText->m_Text != L" ") {
- break;
- }
- }
- pText = (CTextBox*)m_TextList.GetAt(i);
- rightx = pText->m_Right;
- return TRUE;
-}
-void CTextBaseLine::MergeBoxes()
-{
- int i = 0;
- while (1) {
- if (i >= m_TextList.GetSize() - 1) {
- break;
- }
- CTextBox* pThisText = (CTextBox*)m_TextList.GetAt(i);
- CTextBox* pNextText = (CTextBox*)m_TextList.GetAt(i + 1);
- FX_FLOAT dx = pNextText->m_Left - pThisText->m_Right;
- FX_FLOAT spacew = (pThisText->m_SpaceWidth == 0.0) ?
- pNextText->m_SpaceWidth : pThisText->m_SpaceWidth;
- if (spacew > 0.0 && dx < spacew * 2) {
- pThisText->m_Right = pNextText->m_Right;
- if (dx > spacew * 1.5) {
- pThisText->m_Text += L" ";
- } else if (dx > spacew / 3) {
- pThisText->m_Text += L' ';
- }
- pThisText->m_Text += pNextText->m_Text;
- pThisText->m_SpaceWidth = pNextText->m_SpaceWidth == 0.0 ?
- spacew : pNextText->m_SpaceWidth;
- m_TextList.RemoveAt(i + 1);
- delete pNextText;
- } else {
- i ++;
- }
- }
-}
-void CTextBaseLine::WriteOutput(CFX_WideString& str, FX_FLOAT leftx, FX_FLOAT pagewidth,
- int iTextWidth)
-{
- int lastpos = -1;
- for (int i = 0; i < m_TextList.GetSize(); i ++) {
- CTextBox* pText = (CTextBox*)m_TextList.GetAt(i);
- int xpos;
- if (pText->m_pColumn) {
- xpos = (int)((pText->m_pColumn->m_AvgPos - leftx) * iTextWidth / pagewidth + 0.5);
- xpos -= pText->m_Text.GetLength();
- } else {
- xpos = (int)((pText->m_Left - leftx) * iTextWidth / pagewidth + 0.5);
- }
- if (xpos <= lastpos) {
- xpos = lastpos + 1;
- }
- for (int j = lastpos + 1; j < xpos; j ++) {
- str += ' ';
- }
- CFX_WideString sSrc(pText->m_Text);
- NormalizeString(sSrc);
- str += sSrc;
- str += ' ';
- lastpos = xpos + pText->m_Text.GetLength();
- }
-}
-void CTextBaseLine::CountChars(int& count, FX_FLOAT& width, int& minchars)
-{
- minchars = 0;
- for (int i = 0; i < m_TextList.GetSize(); i ++) {
- CTextBox* pText = (CTextBox*)m_TextList.GetAt(i);
- if (pText->m_Right - pText->m_Left < 0.002) {
- continue;
- }
- count += pText->m_Text.GetLength();
- width += pText->m_Right - pText->m_Left;
- minchars += pText->m_Text.GetLength() + 1;
- }
-}
-#define PI 3.1415926535897932384626433832795
-static void CheckRotate(CPDF_Page& page, CFX_FloatRect& page_bbox)
-{
- int total_count = 0, rotated_count[3] = {0, 0, 0};
- FX_POSITION pos = page.GetFirstObjectPosition();
- while (pos) {
- CPDF_PageObject* pObj = page.GetNextObject(pos);
- if (pObj->m_Type != PDFPAGE_TEXT) {
- continue;
- }
- total_count ++;
- CPDF_TextObject* pText = (CPDF_TextObject*)pObj;
- FX_FLOAT angle = pText->m_TextState.GetBaselineAngle();
- if (angle == 0.0) {
- continue;
- }
- int degree = (int)(angle * 180 / PI + 0.5);
- if (degree % 90) {
- continue;
- }
- if (degree < 0) {
- degree += 360;
- }
- int index = degree / 90 % 3 - 1;
- if (index < 0) {
- continue;
- }
- rotated_count[index] ++;
- }
- if (total_count == 0) {
- return;
- }
- CFX_AffineMatrix matrix;
- if (rotated_count[0] > total_count * 2 / 3) {
- matrix.Set(0, -1, 1, 0, 0, page.GetPageHeight());
- } else if (rotated_count[1] > total_count * 2 / 3) {
- matrix.Set(-1, 0, 0, -1, page.GetPageWidth(), page.GetPageHeight());
- } else if (rotated_count[2] > total_count * 2 / 3) {
- matrix.Set(0, 1, -1, 0, page.GetPageWidth(), 0);
- } else {
- return;
- }
- page.Transform(matrix);
- page_bbox.Transform(&matrix);
-}
-void PDF_GetPageText_Unicode(CFX_WideStringArray& lines, CPDF_Document* pDoc, CPDF_Dictionary* pPage,
- int iMinWidth, FX_DWORD flags)
-{
- lines.RemoveAll();
- if (pPage == NULL) {
- return;
- }
- CPDF_Page page;
- page.Load(pDoc, pPage);
- CPDF_ParseOptions options;
- options.m_bTextOnly = TRUE;
- options.m_bSeparateForm = FALSE;
- page.ParseContent(&options);
- CFX_FloatRect page_bbox = page.GetPageBBox();
- if (flags & PDF2TXT_AUTO_ROTATE) {
- CheckRotate(page, page_bbox);
- }
- CTextPage texts;
- texts.m_bAutoWidth = flags & PDF2TXT_AUTO_WIDTH;
- texts.m_bKeepColumn = flags & PDF2TXT_KEEP_COLUMN;
- texts.m_bBreakSpace = TRUE;
- FX_POSITION pos = page.GetFirstObjectPosition();
- while (pos) {
- CPDF_PageObject* pObject = page.GetNextObject(pos);
- if (!(flags & PDF2TXT_INCLUDE_INVISIBLE)) {
- CFX_FloatRect rect(pObject->m_Left, pObject->m_Bottom, pObject->m_Right, pObject->m_Top);
- if (!page_bbox.Contains(rect)) {
- continue;
- }
- }
- texts.ProcessObject(pObject);
- }
- texts.WriteOutput(lines, iMinWidth);
-}
-void PDF_GetPageText(CFX_ByteStringArray& lines, CPDF_Document* pDoc, CPDF_Dictionary* pPage,
- int iMinWidth, FX_DWORD flags)
-{
- lines.RemoveAll();
- CFX_WideStringArray wlines;
- PDF_GetPageText_Unicode(wlines, pDoc, pPage, iMinWidth, flags);
- for (int i = 0; i < wlines.GetSize(); i ++) {
- CFX_WideString wstr = wlines[i];
- CFX_ByteString str;
- for (int c = 0; c < wstr.GetLength(); c ++) {
- str += CharFromUnicodeAlt(wstr[c], FXSYS_GetACP(), "?");
- }
- lines.Add(str);
- }
-}
-#endif
-extern void _PDF_GetTextStream_Unicode(CFX_WideTextBuf& buffer, CPDF_PageObjects* pPage, FX_BOOL bUseLF,
- CFX_PtrArray* pObjArray);
-void PDF_GetTextStream_Unicode(CFX_WideTextBuf& buffer, CPDF_Document* pDoc, CPDF_Dictionary* pPage, FX_DWORD flags)
-{
- buffer.EstimateSize(0, 10240);
- CPDF_Page page;
- page.Load(pDoc, pPage);
- CPDF_ParseOptions options;
- options.m_bTextOnly = TRUE;
- options.m_bSeparateForm = FALSE;
- page.ParseContent(&options);
- _PDF_GetTextStream_Unicode(buffer, &page, TRUE, NULL);
-}
+// 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
+
+#include "../../include/fpdfapi/fpdf_page.h"
+#include "../../include/fpdfapi/fpdf_pageobj.h"
+#include "../../include/fpdftext/fpdf_text.h"
+#include "txtproc.h"
+#include "text_int.h"
+#if !defined(_FPDFAPI_MINI_) || defined(_FXCORE_FEATURE_ALL_)
+extern FX_LPCSTR FCS_GetAltStr(FX_WCHAR);
+CFX_ByteString CharFromUnicodeAlt(FX_WCHAR unicode, int destcp, FX_LPCSTR defchar)
+{
+ if (destcp == 0) {
+ if (unicode < 0x80) {
+ return CFX_ByteString((char)unicode);
+ }
+ FX_LPCSTR altstr = FCS_GetAltStr(unicode);
+ if (altstr) {
+ return CFX_ByteString(altstr, -1);
+ }
+ return CFX_ByteString(defchar, -1);
+ }
+ FX_BOOL bDef = FALSE;
+ char buf[10];
+ int ret = FXSYS_WideCharToMultiByte(destcp, 0, (wchar_t*)&unicode, 1, buf, 10, NULL, &bDef);
+ if (ret && !bDef) {
+ return CFX_ByteString(buf, ret);
+ }
+ FX_LPCSTR altstr = FCS_GetAltStr(unicode);
+ if (altstr) {
+ return CFX_ByteString(altstr, -1);
+ }
+ return CFX_ByteString(defchar, -1);
+}
+CTextPage::CTextPage()
+{
+}
+CTextPage::~CTextPage()
+{
+ int i;
+ for (i = 0; i < m_BaseLines.GetSize(); i ++) {
+ CTextBaseLine* pBaseLine = (CTextBaseLine*)m_BaseLines.GetAt(i);
+ delete pBaseLine;
+ }
+ for (i = 0; i < m_TextColumns.GetSize(); i ++) {
+ CTextColumn* pTextColumn = (CTextColumn*)m_TextColumns.GetAt(i);
+ delete pTextColumn;
+ }
+}
+void CTextPage::ProcessObject(CPDF_PageObject* pObject)
+{
+ if (pObject->m_Type != PDFPAGE_TEXT) {
+ return;
+ }
+ CPDF_TextObject* pText = (CPDF_TextObject*)pObject;
+ CPDF_Font* pFont = pText->m_TextState.GetFont();
+ int count = pText->CountItems();
+ FX_FLOAT* pPosArray = FX_Alloc(FX_FLOAT, count * 2);
+ if (pPosArray) {
+ pText->CalcCharPos(pPosArray);
+ }
+ FX_FLOAT fontsize_h = pText->m_TextState.GetFontSizeH();
+ FX_FLOAT fontsize_v = pText->m_TextState.GetFontSizeV();
+ FX_DWORD space_charcode = pFont->CharCodeFromUnicode(' ');
+ FX_FLOAT spacew = 0;
+ if (space_charcode != -1) {
+ spacew = fontsize_h * pFont->GetCharWidthF(space_charcode) / 1000;
+ }
+ if (spacew == 0) {
+ spacew = fontsize_h / 4;
+ }
+ if (pText->m_TextState.GetBaselineAngle() != 0) {
+ int cc = 0;
+ CFX_AffineMatrix matrix;
+ pText->GetTextMatrix(&matrix);
+ for (int i = 0; i < pText->m_nChars; i ++) {
+ FX_DWORD charcode = pText->m_nChars == 1 ? (FX_DWORD)(FX_UINTPTR)pText->m_pCharCodes : pText->m_pCharCodes[i];
+ if (charcode == (FX_DWORD) - 1) {
+ continue;
+ }
+ FX_RECT char_box;
+ pFont->GetCharBBox(charcode, char_box);
+ FX_FLOAT char_left = pPosArray ? pPosArray[cc * 2] : char_box.left * pText->m_TextState.GetFontSize() / 1000;
+ FX_FLOAT char_right = pPosArray ? pPosArray[cc * 2 + 1] : char_box.right * pText->m_TextState.GetFontSize() / 1000;
+ FX_FLOAT char_top = char_box.top * pText->m_TextState.GetFontSize() / 1000;
+ FX_FLOAT char_bottom = char_box.bottom * pText->m_TextState.GetFontSize() / 1000;
+ cc ++;
+ FX_FLOAT char_origx, char_origy;
+ matrix.Transform(char_left, 0, char_origx, char_origy);
+ matrix.TransformRect(char_left, char_right, char_top, char_bottom);
+ CFX_ByteString str;
+ pFont->AppendChar(str, charcode);
+ InsertTextBox(NULL, char_origy, char_left, char_right, char_top,
+ char_bottom, spacew, fontsize_v, str, pFont);
+ }
+ if (pPosArray) {
+ FX_Free(pPosArray);
+ }
+ return;
+ }
+ FX_FLOAT ratio_h = fontsize_h / pText->m_TextState.GetFontSize();
+ for (int ii = 0; ii < count * 2; ii ++) {
+ pPosArray[ii] *= ratio_h;
+ }
+ FX_FLOAT baseline = pText->m_PosY;
+ CTextBaseLine* pBaseLine = NULL;
+ FX_FLOAT topy = pText->m_Top;
+ FX_FLOAT bottomy = pText->m_Bottom;
+ FX_FLOAT leftx = pText->m_Left;
+ int cc = 0;
+ CFX_ByteString segment;
+ int space_count = 0;
+ FX_FLOAT last_left = 0, last_right = 0, segment_left = 0, segment_right = 0;
+ for (int i = 0; i < pText->m_nChars; i ++) {
+ FX_DWORD charcode = pText->m_nChars == 1 ? (FX_DWORD)(FX_UINTPTR)pText->m_pCharCodes : pText->m_pCharCodes[i];
+ if (charcode == (FX_DWORD) - 1) {
+ continue;
+ }
+ FX_FLOAT char_left = pPosArray[cc * 2];
+ FX_FLOAT char_right = pPosArray[cc * 2 + 1];
+ cc ++;
+ if (char_left < last_left || (char_left - last_right) > spacew / 2) {
+ pBaseLine = InsertTextBox(pBaseLine, baseline, leftx + segment_left, leftx + segment_right,
+ topy, bottomy, spacew, fontsize_v, segment, pFont);
+ segment_left = char_left;
+ segment = "";
+ }
+ CFX_WideString wCh = pText->GetFont()->UnicodeFromCharCode(charcode);
+ FX_DWORD ch = wCh.GetLength() > 0 ? wCh.GetAt(0) : charcode;
+ if (space_count > 1) {
+ pBaseLine = InsertTextBox(pBaseLine, baseline, leftx + segment_left, leftx + segment_right,
+ topy, bottomy, spacew, fontsize_v, segment, pFont);
+ segment = "";
+ } else if (space_count == 1) {
+ pFont->AppendChar(segment, ' ');
+ }
+ if (segment.GetLength() == 0) {
+ segment_left = char_left;
+ }
+ segment_right = char_right;
+ pFont->AppendChar(segment, charcode);
+ space_count = 0;
+ last_left = char_left;
+ last_right = char_right;
+ }
+ if (segment.GetLength())
+ pBaseLine = InsertTextBox(pBaseLine, baseline, leftx + segment_left, leftx + segment_right,
+ topy, bottomy, spacew, fontsize_v, segment, pFont);
+ FX_Free(pPosArray);
+}
+static void ConvertPDFString(CFX_ByteString& result, CFX_ByteString& src, CPDF_Font* pFont);
+CTextBaseLine* CTextPage::InsertTextBox(CTextBaseLine* pBaseLine, FX_FLOAT basey, FX_FLOAT leftx,
+ FX_FLOAT rightx, FX_FLOAT topy, FX_FLOAT bottomy, FX_FLOAT spacew, FX_FLOAT fontsize_v,
+ CFX_ByteString& str, CPDF_Font* pFont)
+{
+ if (str.GetLength() == 0) {
+ return NULL;
+ }
+ if (pBaseLine == NULL) {
+ int i;
+ for (i = 0; i < m_BaseLines.GetSize(); i ++) {
+ CTextBaseLine* pExistLine = (CTextBaseLine*)m_BaseLines.GetAt(i);
+ if (pExistLine->m_BaseLine == basey) {
+ pBaseLine = pExistLine;
+ break;
+ }
+ if (pExistLine->m_BaseLine < basey) {
+ break;
+ }
+ }
+ if (pBaseLine == NULL) {
+ pBaseLine = FX_NEW CTextBaseLine;
+ if (NULL == pBaseLine) {
+ return NULL;
+ }
+ pBaseLine->m_BaseLine = basey;
+ m_BaseLines.InsertAt(i, pBaseLine);
+ }
+ }
+ CFX_WideString text;
+ FX_LPCSTR pStr = str;
+ int len = str.GetLength(), offset = 0;
+ while (offset < len) {
+ FX_DWORD ch = pFont->GetNextChar(pStr, offset);
+ CFX_WideString unicode_str = pFont->UnicodeFromCharCode(ch);
+ text += unicode_str;
+ }
+ pBaseLine->InsertTextBox(leftx, rightx, topy, bottomy, spacew, fontsize_v, text);
+ return pBaseLine;
+}
+void CTextPage::WriteOutput(CFX_WideStringArray& lines, int iMinWidth)
+{
+ FX_FLOAT lastheight = -1;
+ FX_FLOAT lastbaseline = -1;
+ FX_FLOAT MinLeftX = 1000000;
+ FX_FLOAT MaxRightX = 0;
+ int i;
+ for (i = 0; i < m_BaseLines.GetSize(); i ++) {
+ CTextBaseLine* pBaseLine = (CTextBaseLine*)m_BaseLines.GetAt(i);
+ FX_FLOAT leftx, rightx;
+ if (pBaseLine->GetWidth(leftx, rightx)) {
+ if (leftx < MinLeftX) {
+ MinLeftX = leftx;
+ }
+ if (rightx > MaxRightX) {
+ MaxRightX = rightx;
+ }
+ }
+ }
+ for (i = 0; i < m_BaseLines.GetSize(); i ++) {
+ CTextBaseLine* pBaseLine = (CTextBaseLine*)m_BaseLines.GetAt(i);
+ pBaseLine->MergeBoxes();
+ }
+ for (i = 1; i < m_BaseLines.GetSize(); i ++) {
+ CTextBaseLine* pBaseLine = (CTextBaseLine*)m_BaseLines.GetAt(i);
+ CTextBaseLine* pPrevLine = (CTextBaseLine*)m_BaseLines.GetAt(i - 1);
+ if (pBaseLine->CanMerge(pPrevLine)) {
+ pPrevLine->Merge(pBaseLine);
+ delete pBaseLine;
+ m_BaseLines.RemoveAt(i);
+ i --;
+ }
+ }
+ if (m_bAutoWidth) {
+ int* widths = FX_Alloc(int, m_BaseLines.GetSize());
+ if (widths) {
+ for (i = 0; i < m_BaseLines.GetSize(); i ++) {
+ widths[i] = 0;
+ CTextBaseLine* pBaseLine = (CTextBaseLine*)m_BaseLines.GetAt(i);
+ int TotalChars = 0;
+ FX_FLOAT TotalWidth = 0;
+ int minchars;
+ pBaseLine->CountChars(TotalChars, TotalWidth, minchars);
+ if (TotalChars) {
+ FX_FLOAT charwidth = TotalWidth / TotalChars;
+ widths[i] = (int)((MaxRightX - MinLeftX) / charwidth);
+ }
+ if (widths[i] > 1000) {
+ widths[i] = 1000;
+ }
+ if (widths[i] < minchars) {
+ widths[i] = minchars;
+ }
+ }
+ int AvgWidth = 0, widthcount = 0;
+ for (i = 0; i < m_BaseLines.GetSize(); i ++)
+ if (widths[i]) {
+ AvgWidth += widths[i];
+ widthcount ++;
+ }
+ AvgWidth = int((FX_FLOAT)AvgWidth / widthcount + 0.5);
+ int MaxWidth = 0;
+ for (i = 0; i < m_BaseLines.GetSize(); i ++)
+ if (MaxWidth < widths[i]) {
+ MaxWidth = widths[i];
+ }
+ if (MaxWidth > AvgWidth * 6 / 5) {
+ MaxWidth = AvgWidth * 6 / 5;
+ }
+ FX_Free(widths);
+ if (iMinWidth < MaxWidth) {
+ iMinWidth = MaxWidth;
+ }
+ }
+ }
+ for (i = 0; i < m_BaseLines.GetSize(); i ++) {
+ CTextBaseLine* pBaseLine = (CTextBaseLine*)m_BaseLines.GetAt(i);
+ pBaseLine->MergeBoxes();
+ }
+ if (m_bKeepColumn) {
+ FindColumns();
+ }
+ for (i = 0; i < m_BaseLines.GetSize(); i ++) {
+ CTextBaseLine* pBaseLine = (CTextBaseLine*)m_BaseLines.GetAt(i);
+ if (lastheight >= 0) {
+ FX_FLOAT dy = lastbaseline - pBaseLine->m_BaseLine;
+ if (dy >= (pBaseLine->m_MaxFontSizeV) * 1.5 || dy >= lastheight * 1.5) {
+ lines.Add(L"");
+ }
+ }
+ lastheight = pBaseLine->m_MaxFontSizeV;
+ lastbaseline = pBaseLine->m_BaseLine;
+ CFX_WideString str;
+ pBaseLine->WriteOutput(str, MinLeftX, MaxRightX - MinLeftX, iMinWidth);
+ lines.Add(str);
+ }
+}
+void NormalizeCompositeChar(FX_WCHAR wChar, CFX_WideString& sDest)
+{
+ wChar = FX_GetMirrorChar(wChar, TRUE, FALSE);
+ FX_LPWSTR pDst = NULL;
+ FX_STRSIZE nCount = FX_Unicode_GetNormalization(wChar, pDst);
+ if (nCount < 1 ) {
+ sDest += wChar;
+ return;
+ }
+ pDst = new FX_WCHAR[nCount];
+ FX_Unicode_GetNormalization(wChar, pDst);
+ for (int nIndex = 0; nIndex < nCount; nIndex++) {
+ sDest += pDst[nIndex];
+ }
+ delete[] pDst;
+}
+void NormalizeString(CFX_WideString& str)
+{
+ if (str.GetLength() <= 0) {
+ return;
+ }
+ CFX_WideString sBuffer;
+ IFX_BidiChar* BidiChar = IFX_BidiChar::Create();
+ if (NULL == BidiChar) {
+ return;
+ }
+ CFX_WordArray order;
+ FX_BOOL bR2L = FALSE;
+ FX_INT32 start = 0, count = 0, i = 0;
+ int nR2L = 0, nL2R = 0;
+ for (i = 0; i < str.GetLength(); i++) {
+ if(BidiChar->AppendChar(str.GetAt(i))) {
+ FX_INT32 ret = BidiChar->GetBidiInfo(start, count);
+ order.Add(start);
+ order.Add(count);
+ order.Add(ret);
+ if(!bR2L) {
+ if(ret == 2) {
+ nR2L++;
+ } else if (ret == 1) {
+ nL2R++;
+ }
+ }
+ }
+ }
+ if(BidiChar->EndChar()) {
+ FX_INT32 ret = BidiChar->GetBidiInfo(start, count);
+ order.Add(start);
+ order.Add(count);
+ order.Add(ret);
+ if(!bR2L) {
+ if(ret == 2) {
+ nR2L++;
+ } else if(ret == 1) {
+ nL2R++;
+ }
+ }
+ }
+ if(nR2L > 0 && nR2L >= nL2R) {
+ bR2L = TRUE;
+ }
+ if(bR2L) {
+ int count = order.GetSize();
+ for(int j = count - 1; j > 0; j -= 3) {
+ int ret = order.GetAt(j);
+ int start = order.GetAt(j - 2);
+ int count1 = order.GetAt(j - 1);
+ if(ret == 2 || ret == 0) {
+ for(int i = start + count1 - 1; i >= start; i--) {
+ NormalizeCompositeChar(str[i], sBuffer);
+ }
+ } else {
+ i = j;
+ FX_BOOL bSymbol = FALSE;
+ while(i > 0 && order.GetAt(i) != 2) {
+ bSymbol = !order.GetAt(i);
+ i -= 3;
+ }
+ int end = start + count1 ;
+ int n = 0;
+ if(bSymbol) {
+ n = i + 6;
+ } else {
+ n = i + 3;
+ }
+ if(n >= j) {
+ for(int m = start; m < end; m++) {
+ sBuffer += str[m];
+ }
+ } else {
+ i = j;
+ j = n;
+ for(; n <= i; n += 3) {
+ int ret = order.GetAt(n);
+ int start = order.GetAt(n - 2);
+ int count1 = order.GetAt(n - 1);
+ int end = start + count1 ;
+ for(int m = start; m < end; m++) {
+ sBuffer += str[m];
+ }
+ }
+ }
+ }
+ }
+ } else {
+ int count = order.GetSize();
+ FX_BOOL bL2R = FALSE;
+ for(int j = 0; j < count; j += 3) {
+ int ret = order.GetAt(j + 2);
+ int start = order.GetAt(j);
+ int count1 = order.GetAt(j + 1);
+ if(ret == 2 || (j == 0 && ret == 0 && !bL2R)) {
+ int i = j + 3;
+ while(bR2L && i < count) {
+ if(order.GetAt(i + 2) == 1) {
+ break;
+ } else {
+ i += 3;
+ }
+ }
+ if(i == 3) {
+ j = -3;
+ bL2R = TRUE;
+ continue;
+ }
+ int end = str.GetLength() - 1;
+ if(i < count) {
+ end = order.GetAt(i) - 1;
+ }
+ j = i - 3;
+ for(int n = end; n >= start; n--) {
+ NormalizeCompositeChar(str[i], sBuffer);
+ }
+ } else {
+ int end = start + count1 ;
+ for(int i = start; i < end; i++) {
+ sBuffer += str[i];
+ }
+ }
+ }
+ }
+ str.Empty();
+ str += sBuffer;
+ BidiChar->Release();
+}
+static FX_BOOL IsNumber(CFX_WideString& str)
+{
+ for (int i = 0; i < str.GetLength(); i ++) {
+ FX_WCHAR ch = str[i];
+ if ((ch < '0' || ch > '9') && ch != '-' && ch != '+' && ch != '.' && ch != ' ') {
+ return FALSE;
+ }
+ }
+ return TRUE;
+}
+void CTextPage::FindColumns()
+{
+ int i;
+ for (i = 0; i < m_BaseLines.GetSize(); i ++) {
+ CTextBaseLine* pBaseLine = (CTextBaseLine*)m_BaseLines.GetAt(i);
+ for (int j = 0; j < pBaseLine->m_TextList.GetSize(); j ++) {
+ CTextBox* pTextBox = (CTextBox*)pBaseLine->m_TextList.GetAt(j);
+ CTextColumn* pColumn = FindColumn(pTextBox->m_Right);
+ if (pColumn == NULL) {
+ pColumn = FX_NEW CTextColumn;
+ if (pColumn) {
+ pColumn->m_Count = 1;
+ pColumn->m_AvgPos = pTextBox->m_Right;
+ pColumn->m_TextPos = -1;
+ m_TextColumns.Add(pColumn);
+ }
+ } else {
+ pColumn->m_AvgPos = (pColumn->m_Count * pColumn->m_AvgPos + pTextBox->m_Right) /
+ (pColumn->m_Count + 1);
+ pColumn->m_Count ++;
+ }
+ }
+ }
+ int mincount = m_BaseLines.GetSize() / 4;
+ for (i = 0; i < m_TextColumns.GetSize(); i ++) {
+ CTextColumn* pTextColumn = (CTextColumn*)m_TextColumns.GetAt(i);
+ if (pTextColumn->m_Count >= mincount) {
+ continue;
+ }
+ delete pTextColumn;
+ m_TextColumns.RemoveAt(i);
+ i --;
+ }
+ for (i = 0; i < m_BaseLines.GetSize(); i ++) {
+ CTextBaseLine* pBaseLine = (CTextBaseLine*)m_BaseLines.GetAt(i);
+ for (int j = 0; j < pBaseLine->m_TextList.GetSize(); j ++) {
+ CTextBox* pTextBox = (CTextBox*)pBaseLine->m_TextList.GetAt(j);
+ if (IsNumber(pTextBox->m_Text)) {
+ pTextBox->m_pColumn = FindColumn(pTextBox->m_Right);
+ }
+ }
+ }
+}
+CTextColumn* CTextPage::FindColumn(FX_FLOAT xpos)
+{
+ for (int i = 0; i < m_TextColumns.GetSize(); i ++) {
+ CTextColumn* pColumn = (CTextColumn*)m_TextColumns.GetAt(i);
+ if (pColumn->m_AvgPos < xpos + 1 && pColumn->m_AvgPos > xpos - 1) {
+ return pColumn;
+ }
+ }
+ return NULL;
+}
+void CTextPage::BreakSpace(CPDF_TextObject* pTextObj)
+{
+}
+CTextBaseLine::CTextBaseLine()
+{
+ m_Top = -100000;
+ m_Bottom = 100000;
+ m_MaxFontSizeV = 0;
+}
+CTextBaseLine::~CTextBaseLine()
+{
+ for (int i = 0; i < m_TextList.GetSize(); i ++) {
+ CTextBox* pText = (CTextBox*)m_TextList.GetAt(i);
+ delete pText;
+ }
+}
+void CTextBaseLine::InsertTextBox(FX_FLOAT leftx, FX_FLOAT rightx, FX_FLOAT topy, FX_FLOAT bottomy,
+ FX_FLOAT spacew, FX_FLOAT fontsize_v, const CFX_WideString& text)
+{
+ if (m_Top < topy) {
+ m_Top = topy;
+ }
+ if (m_Bottom > bottomy) {
+ m_Bottom = bottomy;
+ }
+ if (m_MaxFontSizeV < fontsize_v) {
+ m_MaxFontSizeV = fontsize_v;
+ }
+ int i;
+ for (i = 0; i < m_TextList.GetSize(); i ++) {
+ CTextBox* pText = (CTextBox*)m_TextList.GetAt(i);
+ if (pText->m_Left > leftx) {
+ break;
+ }
+ }
+ CTextBox* pText = FX_NEW CTextBox;
+ if (NULL == pText) {
+ return;
+ }
+ pText->m_Text = text;
+ pText->m_Left = leftx;
+ pText->m_Right = rightx;
+ pText->m_Top = topy;
+ pText->m_Bottom = bottomy;
+ pText->m_SpaceWidth = spacew;
+ pText->m_FontSizeV = fontsize_v;
+ pText->m_pColumn = NULL;
+ m_TextList.InsertAt(i, pText);
+}
+FX_BOOL GetIntersection(FX_FLOAT low1, FX_FLOAT high1, FX_FLOAT low2, FX_FLOAT high2,
+ FX_FLOAT& interlow, FX_FLOAT& interhigh);
+FX_BOOL CTextBaseLine::CanMerge(CTextBaseLine* pOther)
+{
+ FX_FLOAT inter_top, inter_bottom;
+ if (!GetIntersection(m_Bottom, m_Top, pOther->m_Bottom, pOther->m_Top,
+ inter_bottom, inter_top)) {
+ return FALSE;
+ }
+ FX_FLOAT inter_h = inter_top - inter_bottom;
+ if (inter_h < (m_Top - m_Bottom) / 2 && inter_h < (pOther->m_Top - pOther->m_Bottom) / 2) {
+ return FALSE;
+ }
+ FX_FLOAT dy = (FX_FLOAT)FXSYS_fabs(m_BaseLine - pOther->m_BaseLine);
+ for (int i = 0; i < m_TextList.GetSize(); i ++) {
+ CTextBox* pText = (CTextBox*)m_TextList.GetAt(i);
+ FX_FLOAT width = pText->m_Right - pText->m_Left;
+ for (int j = 0; j < pOther->m_TextList.GetSize(); j ++) {
+ CTextBox* pOtherText = (CTextBox*)pOther->m_TextList.GetAt(j);
+ FX_FLOAT inter_left, inter_right;
+ if (!GetIntersection(pText->m_Left, pText->m_Right,
+ pOtherText->m_Left, pOtherText->m_Right, inter_left, inter_right)) {
+ continue;
+ }
+ FX_FLOAT inter_w = inter_right - inter_left;
+ if (inter_w < pText->m_SpaceWidth / 2 && inter_w < pOtherText->m_SpaceWidth / 2) {
+ continue;
+ }
+ if (dy >= (pText->m_Bottom - pText->m_Top) / 2 ||
+ dy >= (pOtherText->m_Bottom - pOtherText->m_Top) / 2) {
+ return FALSE;
+ }
+ }
+ }
+ return TRUE;
+}
+void CTextBaseLine::Merge(CTextBaseLine* pOther)
+{
+ for (int i = 0; i < pOther->m_TextList.GetSize(); i ++) {
+ CTextBox* pText = (CTextBox*)pOther->m_TextList.GetAt(i);
+ InsertTextBox(pText->m_Left, pText->m_Right, pText->m_Top, pText->m_Bottom,
+ pText->m_SpaceWidth, pText->m_FontSizeV, pText->m_Text);
+ }
+}
+FX_BOOL CTextBaseLine::GetWidth(FX_FLOAT& leftx, FX_FLOAT& rightx)
+{
+ int i;
+ for (i = 0; i < m_TextList.GetSize(); i ++) {
+ CTextBox* pText = (CTextBox*)m_TextList.GetAt(i);
+ if (pText->m_Text != L" ") {
+ break;
+ }
+ }
+ if (i == m_TextList.GetSize()) {
+ return FALSE;
+ }
+ CTextBox* pText = (CTextBox*)m_TextList.GetAt(i);
+ leftx = pText->m_Left;
+ for (i = m_TextList.GetSize() - 1; i >= 0; i --) {
+ CTextBox* pText = (CTextBox*)m_TextList.GetAt(i);
+ if (pText->m_Text != L" ") {
+ break;
+ }
+ }
+ pText = (CTextBox*)m_TextList.GetAt(i);
+ rightx = pText->m_Right;
+ return TRUE;
+}
+void CTextBaseLine::MergeBoxes()
+{
+ int i = 0;
+ while (1) {
+ if (i >= m_TextList.GetSize() - 1) {
+ break;
+ }
+ CTextBox* pThisText = (CTextBox*)m_TextList.GetAt(i);
+ CTextBox* pNextText = (CTextBox*)m_TextList.GetAt(i + 1);
+ FX_FLOAT dx = pNextText->m_Left - pThisText->m_Right;
+ FX_FLOAT spacew = (pThisText->m_SpaceWidth == 0.0) ?
+ pNextText->m_SpaceWidth : pThisText->m_SpaceWidth;
+ if (spacew > 0.0 && dx < spacew * 2) {
+ pThisText->m_Right = pNextText->m_Right;
+ if (dx > spacew * 1.5) {
+ pThisText->m_Text += L" ";
+ } else if (dx > spacew / 3) {
+ pThisText->m_Text += L' ';
+ }
+ pThisText->m_Text += pNextText->m_Text;
+ pThisText->m_SpaceWidth = pNextText->m_SpaceWidth == 0.0 ?
+ spacew : pNextText->m_SpaceWidth;
+ m_TextList.RemoveAt(i + 1);
+ delete pNextText;
+ } else {
+ i ++;
+ }
+ }
+}
+void CTextBaseLine::WriteOutput(CFX_WideString& str, FX_FLOAT leftx, FX_FLOAT pagewidth,
+ int iTextWidth)
+{
+ int lastpos = -1;
+ for (int i = 0; i < m_TextList.GetSize(); i ++) {
+ CTextBox* pText = (CTextBox*)m_TextList.GetAt(i);
+ int xpos;
+ if (pText->m_pColumn) {
+ xpos = (int)((pText->m_pColumn->m_AvgPos - leftx) * iTextWidth / pagewidth + 0.5);
+ xpos -= pText->m_Text.GetLength();
+ } else {
+ xpos = (int)((pText->m_Left - leftx) * iTextWidth / pagewidth + 0.5);
+ }
+ if (xpos <= lastpos) {
+ xpos = lastpos + 1;
+ }
+ for (int j = lastpos + 1; j < xpos; j ++) {
+ str += ' ';
+ }
+ CFX_WideString sSrc(pText->m_Text);
+ NormalizeString(sSrc);
+ str += sSrc;
+ str += ' ';
+ lastpos = xpos + pText->m_Text.GetLength();
+ }
+}
+void CTextBaseLine::CountChars(int& count, FX_FLOAT& width, int& minchars)
+{
+ minchars = 0;
+ for (int i = 0; i < m_TextList.GetSize(); i ++) {
+ CTextBox* pText = (CTextBox*)m_TextList.GetAt(i);
+ if (pText->m_Right - pText->m_Left < 0.002) {
+ continue;
+ }
+ count += pText->m_Text.GetLength();
+ width += pText->m_Right - pText->m_Left;
+ minchars += pText->m_Text.GetLength() + 1;
+ }
+}
+#define PI 3.1415926535897932384626433832795
+static void CheckRotate(CPDF_Page& page, CFX_FloatRect& page_bbox)
+{
+ int total_count = 0, rotated_count[3] = {0, 0, 0};
+ FX_POSITION pos = page.GetFirstObjectPosition();
+ while (pos) {
+ CPDF_PageObject* pObj = page.GetNextObject(pos);
+ if (pObj->m_Type != PDFPAGE_TEXT) {
+ continue;
+ }
+ total_count ++;
+ CPDF_TextObject* pText = (CPDF_TextObject*)pObj;
+ FX_FLOAT angle = pText->m_TextState.GetBaselineAngle();
+ if (angle == 0.0) {
+ continue;
+ }
+ int degree = (int)(angle * 180 / PI + 0.5);
+ if (degree % 90) {
+ continue;
+ }
+ if (degree < 0) {
+ degree += 360;
+ }
+ int index = degree / 90 % 3 - 1;
+ if (index < 0) {
+ continue;
+ }
+ rotated_count[index] ++;
+ }
+ if (total_count == 0) {
+ return;
+ }
+ CFX_AffineMatrix matrix;
+ if (rotated_count[0] > total_count * 2 / 3) {
+ matrix.Set(0, -1, 1, 0, 0, page.GetPageHeight());
+ } else if (rotated_count[1] > total_count * 2 / 3) {
+ matrix.Set(-1, 0, 0, -1, page.GetPageWidth(), page.GetPageHeight());
+ } else if (rotated_count[2] > total_count * 2 / 3) {
+ matrix.Set(0, 1, -1, 0, page.GetPageWidth(), 0);
+ } else {
+ return;
+ }
+ page.Transform(matrix);
+ page_bbox.Transform(&matrix);
+}
+void PDF_GetPageText_Unicode(CFX_WideStringArray& lines, CPDF_Document* pDoc, CPDF_Dictionary* pPage,
+ int iMinWidth, FX_DWORD flags)
+{
+ lines.RemoveAll();
+ if (pPage == NULL) {
+ return;
+ }
+ CPDF_Page page;
+ page.Load(pDoc, pPage);
+ CPDF_ParseOptions options;
+ options.m_bTextOnly = TRUE;
+ options.m_bSeparateForm = FALSE;
+ page.ParseContent(&options);
+ CFX_FloatRect page_bbox = page.GetPageBBox();
+ if (flags & PDF2TXT_AUTO_ROTATE) {
+ CheckRotate(page, page_bbox);
+ }
+ CTextPage texts;
+ texts.m_bAutoWidth = flags & PDF2TXT_AUTO_WIDTH;
+ texts.m_bKeepColumn = flags & PDF2TXT_KEEP_COLUMN;
+ texts.m_bBreakSpace = TRUE;
+ FX_POSITION pos = page.GetFirstObjectPosition();
+ while (pos) {
+ CPDF_PageObject* pObject = page.GetNextObject(pos);
+ if (!(flags & PDF2TXT_INCLUDE_INVISIBLE)) {
+ CFX_FloatRect rect(pObject->m_Left, pObject->m_Bottom, pObject->m_Right, pObject->m_Top);
+ if (!page_bbox.Contains(rect)) {
+ continue;
+ }
+ }
+ texts.ProcessObject(pObject);
+ }
+ texts.WriteOutput(lines, iMinWidth);
+}
+void PDF_GetPageText(CFX_ByteStringArray& lines, CPDF_Document* pDoc, CPDF_Dictionary* pPage,
+ int iMinWidth, FX_DWORD flags)
+{
+ lines.RemoveAll();
+ CFX_WideStringArray wlines;
+ PDF_GetPageText_Unicode(wlines, pDoc, pPage, iMinWidth, flags);
+ for (int i = 0; i < wlines.GetSize(); i ++) {
+ CFX_WideString wstr = wlines[i];
+ CFX_ByteString str;
+ for (int c = 0; c < wstr.GetLength(); c ++) {
+ str += CharFromUnicodeAlt(wstr[c], FXSYS_GetACP(), "?");
+ }
+ lines.Add(str);
+ }
+}
+#endif
+extern void _PDF_GetTextStream_Unicode(CFX_WideTextBuf& buffer, CPDF_PageObjects* pPage, FX_BOOL bUseLF,
+ CFX_PtrArray* pObjArray);
+void PDF_GetTextStream_Unicode(CFX_WideTextBuf& buffer, CPDF_Document* pDoc, CPDF_Dictionary* pPage, FX_DWORD flags)
+{
+ buffer.EstimateSize(0, 10240);
+ CPDF_Page page;
+ page.Load(pDoc, pPage);
+ CPDF_ParseOptions options;
+ options.m_bTextOnly = TRUE;
+ options.m_bSeparateForm = FALSE;
+ page.ParseContent(&options);
+ _PDF_GetTextStream_Unicode(buffer, &page, TRUE, NULL);
+}
diff --git a/core/src/fpdftext/fpdf_text_int.cpp b/core/src/fpdftext/fpdf_text_int.cpp
index 36b0442ffc..0e0d52ec1a 100644
--- a/core/src/fpdftext/fpdf_text_int.cpp
+++ b/core/src/fpdftext/fpdf_text_int.cpp
@@ -1,2804 +1,2804 @@
-// 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
-
-#include "../../include/fpdfapi/fpdf_resource.h"
-#include "../../include/fpdfapi/fpdf_pageobj.h"
-#include "../../include/fpdftext/fpdf_text.h"
-#include "../../include/fpdfapi/fpdf_page.h"
-#include "../../include/fpdfapi/fpdf_module.h"
-#include <ctype.h>
-#include "text_int.h"
-FX_BOOL _IsIgnoreSpaceCharacter(FX_WCHAR curChar)
-{
- if(curChar < 255 ) {
- return FALSE;
- }
- if ( (curChar >= 0x0600 && curChar <= 0x06FF)
- || (curChar >= 0xFE70 && curChar <= 0xFEFF)
- || (curChar >= 0xFB50 && curChar <= 0xFDFF)
- || (curChar >= 0x0400 && curChar <= 0x04FF)
- || (curChar >= 0x0500 && curChar <= 0x052F)
- || (curChar >= 0xA640 && curChar <= 0xA69F)
- || (curChar >= 0x2DE0 && curChar <= 0x2DFF)
- || curChar == 8467
- || (curChar >= 0x2000 && curChar <= 0x206F)) {
- return FALSE;
- }
- return TRUE;
-}
-CPDFText_ParseOptions::CPDFText_ParseOptions()
- : m_bGetCharCodeOnly(FALSE), m_bNormalizeObjs(TRUE), m_bOutputHyphen(FALSE)
-{
-}
-IPDF_TextPage* IPDF_TextPage::CreateTextPage(const CPDF_Page* pPage, CPDFText_ParseOptions ParserOptions)
-{
- CPDF_TextPage* pTextPageEx = FX_NEW CPDF_TextPage(pPage, ParserOptions);
- return pTextPageEx;
-}
-IPDF_TextPage* IPDF_TextPage::CreateTextPage(const CPDF_Page* pPage, int flags)
-{
- CPDF_TextPage* pTextPage = FX_NEW CPDF_TextPage(pPage, flags);
- return pTextPage;
-}
-IPDF_TextPage* IPDF_TextPage::CreateTextPage(const CPDF_PageObjects* pObjs, int flags)
-{
- CPDF_TextPage* pTextPage = FX_NEW CPDF_TextPage(pObjs, flags);
- return pTextPage;
-}
-IPDF_TextPageFind* IPDF_TextPageFind::CreatePageFind(const IPDF_TextPage* pTextPage)
-{
- if (!pTextPage) {
- return NULL;
- }
- return FX_NEW CPDF_TextPageFind(pTextPage);
-}
-IPDF_LinkExtract* IPDF_LinkExtract::CreateLinkExtract()
-{
- return FX_NEW CPDF_LinkExtract();
-}
-#define TEXT_BLANK_CHAR L' '
-#define TEXT_LINEFEED_CHAR L'\n'
-#define TEXT_RETURN_CHAR L'\r'
-#define TEXT_EMPTY L""
-#define TEXT_BLANK L" "
-#define TEXT_RETURN_LINEFEED L"\r\n"
-#define TEXT_LINEFEED L"\n"
-#define TEXT_CHARRATIO_GAPDELTA 0.070
-CPDF_TextPage::CPDF_TextPage(const CPDF_Page* pPage, int flags)
- : m_pPreTextObj(NULL),
- m_IsParsered(FALSE),
- m_charList(512),
- m_TempCharList(50),
- m_TextlineDir(-1),
- m_CurlineRect(0, 0, 0, 0)
-{
- m_pPage = pPage;
- m_parserflag = flags;
- m_TextBuf.EstimateSize(0, 10240);
- pPage->GetDisplayMatrix(m_DisplayMatrix, 0, 0, (int) pPage->GetPageWidth(), (int)pPage->GetPageHeight(), 0);
-}
-CPDF_TextPage::CPDF_TextPage(const CPDF_Page* pPage, CPDFText_ParseOptions ParserOptions)
- : m_pPreTextObj(NULL)
- , m_IsParsered(FALSE)
- , m_charList(512)
- , m_TempCharList(50)
- , m_TextlineDir(-1)
- , m_CurlineRect(0, 0, 0, 0)
- , m_ParseOptions(ParserOptions)
-{
- m_pPage = pPage;
- m_parserflag = 0;
- m_TextBuf.EstimateSize(0, 10240);
- pPage->GetDisplayMatrix(m_DisplayMatrix, 0, 0, (int) pPage->GetPageWidth(), (int)pPage->GetPageHeight(), 0);
-}
-CPDF_TextPage::CPDF_TextPage(const CPDF_PageObjects* pPage, int flags)
- : m_pPreTextObj(NULL),
- m_IsParsered(FALSE),
- m_charList(512),
- m_TempCharList(50),
- m_TextlineDir(-1),
- m_CurlineRect(0, 0, 0, 0)
-{
- m_pPage = pPage;
- m_parserflag = flags;
- m_TextBuf.EstimateSize(0, 10240);
- CFX_FloatRect pageRect = pPage->CalcBoundingBox();
- m_DisplayMatrix = CFX_AffineMatrix(1, 0, 0, -1, pageRect.right, pageRect.top);
-}
-void CPDF_TextPage::NormalizeObjects(FX_BOOL bNormalize)
-{
- m_ParseOptions.m_bNormalizeObjs = bNormalize;
-}
-FX_BOOL CPDF_TextPage::IsControlChar(PAGECHAR_INFO* pCharInfo)
-{
- if(!pCharInfo) {
- return FALSE;
- }
- switch(pCharInfo->m_Unicode) {
- case 0x2:
- case 0x3:
- case 0x93:
- case 0x94:
- case 0x96:
- case 0x97:
- case 0x98:
- case 0xfffe:
- if(pCharInfo->m_Flag == FPDFTEXT_CHAR_HYPHEN) {
- return FALSE;
- } else {
- return TRUE;
- }
- default:
- return FALSE;
- }
-}
-FX_BOOL CPDF_TextPage::ParseTextPage()
-{
- if (!m_pPage) {
- m_IsParsered = FALSE;
- return FALSE;
- }
- m_IsParsered = FALSE;
- m_TextBuf.Clear();
- m_charList.RemoveAll();
- m_pPreTextObj = NULL;
- ProcessObject();
- m_IsParsered = TRUE;
- if(!m_ParseOptions.m_bGetCharCodeOnly) {
- m_CharIndex.RemoveAll();
- int nCount = m_charList.GetSize();
- if(nCount) {
- m_CharIndex.Add(0);
- }
- for(int i = 0; i < nCount; i++) {
- int indexSize = m_CharIndex.GetSize();
- FX_BOOL bNormal = FALSE;
- PAGECHAR_INFO charinfo = *(PAGECHAR_INFO*)m_charList.GetAt(i);
- if(charinfo.m_Flag == FPDFTEXT_CHAR_GENERATED) {
- bNormal = TRUE;
- }
-#ifdef FOXIT_CHROME_BUILD
- else if(charinfo.m_Unicode == 0 || IsControlChar(&charinfo))
-#else
- else if(charinfo.m_Unicode == 0)
-#endif
- bNormal = FALSE;
- else {
- bNormal = TRUE;
- }
- if(bNormal) {
- if(indexSize % 2) {
- m_CharIndex.Add(1);
- } else {
- if(indexSize <= 0) {
- continue;
- }
- m_CharIndex.SetAt(indexSize - 1, m_CharIndex.GetAt(indexSize - 1) + 1);
- }
- } else {
- if(indexSize % 2) {
- if(indexSize <= 0) {
- continue;
- }
- m_CharIndex.SetAt(indexSize - 1, i + 1);
- } else {
- m_CharIndex.Add(i + 1);
- }
- }
- }
- int indexSize = m_CharIndex.GetSize();
- if(indexSize % 2) {
- m_CharIndex.RemoveAt(indexSize - 1);
- }
- }
- return TRUE;
-}
-int CPDF_TextPage::CountChars() const
-{
- if(m_ParseOptions.m_bGetCharCodeOnly) {
- return m_TextBuf.GetSize();
- }
- return m_charList.GetSize();
-}
-int CPDF_TextPage::CharIndexFromTextIndex(int TextIndex) const
-{
- int indexSize = m_CharIndex.GetSize();
- int count = 0;
- for(int i = 0; i < indexSize; i += 2) {
- count += m_CharIndex.GetAt(i + 1);
- if(count > TextIndex) {
- return TextIndex - count + m_CharIndex.GetAt(i + 1) + m_CharIndex.GetAt(i);
- }
- }
- return -1;
-}
-int CPDF_TextPage::TextIndexFromCharIndex(int CharIndex) const
-{
- int indexSize = m_CharIndex.GetSize();
- int count = 0;
- for(int i = 0; i < indexSize; i += 2) {
- count += m_CharIndex.GetAt(i + 1);
- if(m_CharIndex.GetAt(i + 1) + m_CharIndex.GetAt(i) > CharIndex) {
- if(CharIndex - m_CharIndex.GetAt(i) < 0) {
- return -1;
- }
- return CharIndex - m_CharIndex.GetAt(i) + count - m_CharIndex.GetAt(i + 1);
- }
- }
- return -1;
-}
-void CPDF_TextPage::GetRectArray(int start, int nCount, CFX_RectArray& rectArray) const
-{
- if(m_ParseOptions.m_bGetCharCodeOnly) {
- return;
- }
- if(start < 0 || nCount == 0) {
- return;
- }
- if (!m_IsParsered) {
- return;
- }
- PAGECHAR_INFO info_curchar;
- CPDF_TextObject* pCurObj = NULL;
- CFX_FloatRect rect;
- int curPos = start;
- FX_BOOL flagNewRect = TRUE;
- if (nCount + start > m_charList.GetSize() || nCount == -1) {
- nCount = m_charList.GetSize() - start;
- }
- while (nCount--) {
- info_curchar = *(PAGECHAR_INFO*)m_charList.GetAt(curPos++);
- if (info_curchar.m_Flag == FPDFTEXT_CHAR_GENERATED) {
- continue;
- }
- if(info_curchar.m_CharBox.Width() < 0.01 || info_curchar.m_CharBox.Height() < 0.01) {
- continue;
- }
- if(!pCurObj) {
- pCurObj = info_curchar.m_pTextObj;
- }
- if (pCurObj != info_curchar.m_pTextObj) {
- rectArray.Add(rect);
- pCurObj = info_curchar.m_pTextObj;
- flagNewRect = TRUE;
- }
- if (flagNewRect) {
- FX_FLOAT orgX = info_curchar.m_OriginX, orgY = info_curchar.m_OriginY;
- CFX_AffineMatrix matrix, matrix_reverse;
- info_curchar.m_pTextObj->GetTextMatrix(&matrix);
- matrix.Concat(info_curchar.m_Matrix);
- matrix_reverse.SetReverse(matrix);
- matrix_reverse.Transform(orgX, orgY);
- rect.left = info_curchar.m_CharBox.left;
- rect.right = info_curchar.m_CharBox.right;
- if (pCurObj->GetFont()->GetTypeDescent()) {
- rect.bottom = orgY + pCurObj->GetFont()->GetTypeDescent() * pCurObj->GetFontSize() / 1000;
- FX_FLOAT xPosTemp = orgX;
- matrix.Transform(xPosTemp, rect.bottom);
- } else {
- rect.bottom = info_curchar.m_CharBox.bottom;
- }
- if (pCurObj->GetFont()->GetTypeAscent()) {
- rect.top = orgY + pCurObj->GetFont()->GetTypeAscent() * pCurObj->GetFontSize() / 1000;
- FX_FLOAT xPosTemp = orgX + GetCharWidth(info_curchar.m_CharCode, pCurObj->GetFont()) * pCurObj->GetFontSize() / 1000;
- matrix.Transform(xPosTemp, rect.top);
- } else {
- rect.top = info_curchar.m_CharBox.top;
- }
- flagNewRect = FALSE;
- rect = info_curchar.m_CharBox;
- rect.Normalize();
- } else {
- info_curchar.m_CharBox.Normalize();
- if (rect.left > info_curchar.m_CharBox.left) {
- rect.left = info_curchar.m_CharBox.left;
- }
- if (rect.right < info_curchar.m_CharBox.right) {
- rect.right = info_curchar.m_CharBox.right;
- }
- if ( rect.top < info_curchar.m_CharBox.top) {
- rect.top = info_curchar.m_CharBox.top;
- }
- if (rect.bottom > info_curchar.m_CharBox.bottom) {
- rect.bottom = info_curchar.m_CharBox.bottom;
- }
- }
- }
- rectArray.Add(rect);
- return;
-}
-int CPDF_TextPage::GetIndexAtPos(CPDF_Point point , FX_FLOAT xTorelance, FX_FLOAT yTorelance) const
-{
- if(m_ParseOptions.m_bGetCharCodeOnly) {
- return -3;
- }
- if (!m_IsParsered) {
- return -3;
- }
- FX_FLOAT distance = 0;
- int pos = 0;
- int NearPos = -1;
- double xdif = 5000, ydif = 5000;
- while(pos < m_charList.GetSize()) {
- PAGECHAR_INFO charinfo = *(PAGECHAR_INFO*)(m_charList.GetAt(pos));
- CFX_FloatRect charrect = charinfo.m_CharBox;
- if (charrect.Contains(point.x, point.y)) {
- break;
- }
- if (xTorelance > 0 || yTorelance > 0) {
- CFX_FloatRect charRectExt;
- charrect.Normalize();
- charRectExt.left = charrect.left - xTorelance / 2;
- charRectExt.right = charrect.right + xTorelance / 2;
- charRectExt.top = charrect.top + yTorelance / 2;
- charRectExt.bottom = charrect.bottom - yTorelance / 2;
- if (charRectExt.Contains(point.x, point.y)) {
- double curXdif, curYdif;
- curXdif = FXSYS_fabs(point.x - charrect.left) < FXSYS_fabs(point.x - charrect.right) ? FXSYS_fabs(point.x - charrect.left) : FXSYS_fabs(point.x - charrect.right);
- curYdif = FXSYS_fabs(point.y - charrect.bottom) < FXSYS_fabs(point.y - charrect.top ) ? FXSYS_fabs(point.y - charrect.bottom) : FXSYS_fabs(point.y - charrect.top);
- if (curYdif + curXdif < xdif + ydif) {
- ydif = curYdif;
- xdif = curXdif;
- NearPos = pos;
- }
- }
- }
- ++pos;
- }
- if (pos >= m_charList.GetSize()) {
- pos = NearPos;
- }
- return pos;
-}
-CFX_WideString CPDF_TextPage::GetTextByRect(CFX_FloatRect rect) const
-{
- CFX_WideString strText;
- if(m_ParseOptions.m_bGetCharCodeOnly || !m_IsParsered) {
- return strText;
- }
- int nCount = m_charList.GetSize();
- int pos = 0;
- FX_FLOAT posy = 0;
- FX_BOOL IsContainPreChar = FALSE;
- FX_BOOL ISAddLineFeed = FALSE;
- while (pos < nCount) {
- PAGECHAR_INFO charinfo = *(PAGECHAR_INFO*)m_charList.GetAt(pos++);
- if (IsRectIntersect(rect, charinfo.m_CharBox)) {
- if (FXSYS_fabs(posy - charinfo.m_OriginY) > 0 && !IsContainPreChar && ISAddLineFeed) {
- posy = charinfo.m_OriginY;
- if (strText.GetLength() > 0) {
- strText += L"\r\n";
- }
- }
- IsContainPreChar = TRUE;
- ISAddLineFeed = FALSE;
- if (charinfo.m_Unicode) {
- strText += charinfo.m_Unicode;
- }
- } else if (charinfo.m_Unicode == 32) {
- if (IsContainPreChar && charinfo.m_Unicode) {
- strText += charinfo.m_Unicode;
- IsContainPreChar = FALSE;
- ISAddLineFeed = FALSE;
- }
- } else {
- IsContainPreChar = FALSE;
- ISAddLineFeed = TRUE;
- }
- }
- return strText;
-}
-void CPDF_TextPage::GetRectsArrayByRect(CFX_FloatRect rect, CFX_RectArray& resRectArray) const
-{
- if(m_ParseOptions.m_bGetCharCodeOnly) {
- return;
- }
- if (!m_IsParsered) {
- return;
- }
- CFX_FloatRect curRect;
- FX_BOOL flagNewRect = TRUE;
- CPDF_TextObject* pCurObj = NULL;
- int nCount = m_charList.GetSize();
- int pos = 0;
- while (pos < nCount) {
- PAGECHAR_INFO info_curchar = *(PAGECHAR_INFO*)m_charList.GetAt(pos++);
- if (info_curchar.m_Flag == FPDFTEXT_CHAR_GENERATED) {
- continue;
- }
- if(pos == 494) {
- int a = 0;
- }
- if (IsRectIntersect(rect, info_curchar.m_CharBox)) {
- if(!pCurObj) {
- pCurObj = info_curchar.m_pTextObj;
- }
- if (pCurObj != info_curchar.m_pTextObj) {
- resRectArray.Add(curRect);
- pCurObj = info_curchar.m_pTextObj;
- flagNewRect = TRUE;
- }
- if (flagNewRect) {
- curRect = info_curchar.m_CharBox;
- flagNewRect = FALSE;
- curRect.Normalize();
- } else {
- info_curchar.m_CharBox.Normalize();
- if (curRect.left > info_curchar.m_CharBox.left) {
- curRect.left = info_curchar.m_CharBox.left;
- }
- if (curRect.right < info_curchar.m_CharBox.right) {
- curRect.right = info_curchar.m_CharBox.right;
- }
- if ( curRect.top < info_curchar.m_CharBox.top) {
- curRect.top = info_curchar.m_CharBox.top;
- }
- if (curRect.bottom > info_curchar.m_CharBox.bottom) {
- curRect.bottom = info_curchar.m_CharBox.bottom;
- }
- }
- }
- }
- resRectArray.Add(curRect);
- return;
-}
-int CPDF_TextPage::GetIndexAtPos(FX_FLOAT x, FX_FLOAT y, FX_FLOAT xTorelance, FX_FLOAT yTorelance) const
-{
- if(m_ParseOptions.m_bGetCharCodeOnly) {
- return -3;
- }
- CPDF_Point point(x, y);
- return GetIndexAtPos(point, xTorelance, yTorelance);
-}
-int CPDF_TextPage::GetOrderByDirection(int order, int direction) const
-{
- if(m_ParseOptions.m_bGetCharCodeOnly) {
- return -3;
- }
- if (!m_IsParsered) {
- return -3;
- }
- if (direction == FPDFTEXT_RIGHT || direction == FPDFTEXT_LEFT) {
- order += direction;
- while(order >= 0 && order < m_charList.GetSize()) {
- PAGECHAR_INFO cinfo = *(PAGECHAR_INFO*)m_charList.GetAt(order);
- if (cinfo.m_Flag != FPDFTEXT_CHAR_GENERATED) {
- break;
- } else {
- if (cinfo.m_Unicode == TEXT_LINEFEED_CHAR || cinfo.m_Unicode == TEXT_RETURN_CHAR) {
- order += direction;
- } else {
- break;
- }
- }
- }
- if (order >= m_charList.GetSize()) {
- order = -2;
- }
- return order;
- }
- PAGECHAR_INFO charinfo;
- charinfo = *(PAGECHAR_INFO*)m_charList.GetAt(order);
- CPDF_Point curPos(charinfo.m_OriginX, charinfo.m_OriginY);
- FX_FLOAT difPosY = 0.0, minXdif = 1000;
- int minIndex = -2;
- int index = order;
- FX_FLOAT height = charinfo.m_CharBox.Height();
- if (direction == FPDFTEXT_UP) {
- minIndex = -1;
- while (1) {
- if (--index < 0) {
- return -1;
- }
- charinfo = *(PAGECHAR_INFO*)m_charList.GetAt(index);
- if (FXSYS_fabs(charinfo.m_OriginY - curPos.y) > FX_MAX(height, charinfo.m_CharBox.Height()) / 2) {
- difPosY = charinfo.m_OriginY;
- minIndex = index;
- break;
- }
- }
- FX_FLOAT PreXdif = charinfo.m_OriginX - curPos.x;
- minXdif = PreXdif;
- if (PreXdif == 0) {
- return index;
- }
- FX_FLOAT curXdif = 0;
- while (--index >= 0) {
- charinfo = *(PAGECHAR_INFO*)m_charList.GetAt(index);
- if (difPosY != charinfo.m_OriginY) {
- break;
- }
- curXdif = charinfo.m_OriginX - curPos.x;
- if (curXdif == 0) {
- return index;
- }
- int signflag = 0;
- if (curXdif > 0) {
- signflag = 1;
- } else {
- signflag = -1;
- }
- if (signflag * PreXdif < 0) {
- if (FXSYS_fabs(PreXdif) < FXSYS_fabs(curXdif)) {
- return index + 1;
- } else {
- return index;
- }
- }
- if (FXSYS_fabs(curXdif) < FXSYS_fabs(minXdif)) {
- minIndex = index;
- minXdif = curXdif;
- }
- PreXdif = curXdif;
- if (difPosY != charinfo.m_OriginY) {
- break;
- }
- }
- return minIndex;
- } else if(FPDFTEXT_DOWN) {
- minIndex = -2;
- while (1) {
- if (++index > m_charList.GetSize() - 1) {
- return minIndex;
- }
- charinfo = *(PAGECHAR_INFO*)m_charList.GetAt(index);
- if (FXSYS_fabs(charinfo.m_OriginY - curPos.y) > FX_MAX(height, charinfo.m_CharBox.Height()) / 2) {
- difPosY = charinfo.m_OriginY;
- minIndex = index;
- break;
- }
- }
- FX_FLOAT PreXdif = charinfo.m_OriginX - curPos.x;
- minXdif = PreXdif;
- if (PreXdif == 0) {
- return index;
- }
- FX_FLOAT curXdif = 0;
- while (++index < m_charList.GetSize()) {
- charinfo = *(PAGECHAR_INFO*)m_charList.GetAt(index);
- if (difPosY != charinfo.m_OriginY) {
- break;
- }
- curXdif = charinfo.m_OriginX - curPos.x;
- if (curXdif == 0) {
- return index;
- }
- int signflag = 0;
- if (curXdif > 0) {
- signflag = 1;
- } else {
- signflag = -1;
- }
- if (signflag * PreXdif < 0) {
- if (FXSYS_fabs(PreXdif) < FXSYS_fabs(curXdif)) {
- return index - 1;
- } else {
- return index;
- }
- }
- if (FXSYS_fabs(curXdif) < FXSYS_fabs(minXdif)) {
- minXdif = curXdif;
- minIndex = index;
- }
- PreXdif = curXdif;
- }
- return minIndex;
- }
-}
-void CPDF_TextPage::GetCharInfo(int index, FPDF_CHAR_INFO & info) const
-{
- if(m_ParseOptions.m_bGetCharCodeOnly) {
- return;
- }
- if (!m_IsParsered) {
- return;
- }
- if (index < 0 || index >= m_charList.GetSize()) {
- return;
- }
- PAGECHAR_INFO charinfo;
- charinfo = *(PAGECHAR_INFO*)m_charList.GetAt(index);
- info.m_Charcode = charinfo.m_CharCode;
- info.m_OriginX = charinfo.m_OriginX;
- info.m_OriginY = charinfo.m_OriginY;
- info.m_Unicode = charinfo.m_Unicode;
- info.m_Flag = charinfo.m_Flag;
- info.m_CharBox = charinfo.m_CharBox;
- info.m_pTextObj = charinfo.m_pTextObj;
- if (charinfo.m_pTextObj && charinfo.m_pTextObj->GetFont()) {
- info.m_FontSize = charinfo.m_pTextObj->GetFontSize();
- }
- info.m_Matrix.Copy(charinfo.m_Matrix);
- return;
-}
-void CPDF_TextPage::CheckMarkedContentObject(FX_INT32& start, FX_INT32& nCount) const
-{
- PAGECHAR_INFO charinfo = *(PAGECHAR_INFO*)m_charList.GetAt(start);
- PAGECHAR_INFO charinfo2 = *(PAGECHAR_INFO*)m_charList.GetAt(start + nCount - 1);
- if (FPDFTEXT_CHAR_PIECE != charinfo.m_Flag && FPDFTEXT_CHAR_PIECE != charinfo2.m_Flag) {
- return;
- }
- if (FPDFTEXT_CHAR_PIECE == charinfo.m_Flag) {
- PAGECHAR_INFO charinfo1 = charinfo;
- int startIndex = start;
- while(FPDFTEXT_CHAR_PIECE == charinfo1.m_Flag && charinfo1.m_Index == charinfo.m_Index) {
- startIndex--;
- if (startIndex < 0) {
- break;
- }
- charinfo1 = *(PAGECHAR_INFO*)m_charList.GetAt(startIndex);
- }
- startIndex++;
- start = startIndex;
- }
- if (FPDFTEXT_CHAR_PIECE == charinfo2.m_Flag) {
- PAGECHAR_INFO charinfo3 = charinfo2;
- int endIndex = start + nCount - 1;
- while(FPDFTEXT_CHAR_PIECE == charinfo3.m_Flag && charinfo3.m_Index == charinfo2.m_Index) {
- endIndex++;
- if (endIndex >= m_charList.GetSize()) {
- break;
- }
- charinfo3 = *(PAGECHAR_INFO*)m_charList.GetAt(endIndex);
- }
- endIndex--;
- nCount = endIndex - start + 1;
- }
-}
-CFX_WideString CPDF_TextPage::GetPageText(int start , int nCount) const
-{
- if (!m_IsParsered || nCount == 0) {
- return L"";
- }
- if (start < 0) {
- start = 0;
- }
- if (nCount == -1) {
- nCount = m_charList.GetSize() - start;
- return m_TextBuf.GetWideString().Mid(start, m_TextBuf.GetWideString().GetLength());
- }
- if(nCount <= 0 || m_charList.GetSize() <= 0) {
- return L"";
- }
- if(nCount + start > m_charList.GetSize() - 1) {
- nCount = m_charList.GetSize() - start;
- }
- if (nCount <= 0) {
- return L"";
- }
- CheckMarkedContentObject(start, nCount);
- int startindex = 0;
- PAGECHAR_INFO charinfo = *(PAGECHAR_INFO*)m_charList.GetAt(start);
- int startOffset = 0;
- while(charinfo.m_Index == -1) {
- startOffset++;
- if (startOffset > nCount || start + startOffset >= m_charList.GetSize()) {
- return L"";
- }
- charinfo = *(PAGECHAR_INFO*)m_charList.GetAt(start + startOffset);
- }
- startindex = charinfo.m_Index;
- charinfo = *(PAGECHAR_INFO*)m_charList.GetAt(start + nCount - 1);
- int nCountOffset = 0;
- while (charinfo.m_Index == -1) {
- nCountOffset++;
- if (nCountOffset >= nCount) {
- return L"";
- }
- charinfo = *(PAGECHAR_INFO*)m_charList.GetAt(start + nCount - nCountOffset - 1);
- }
- nCount = start + nCount - nCountOffset - startindex;
- if(nCount <= 0) {
- return L"";
- }
- return m_TextBuf.GetWideString().Mid(startindex, nCount);
-}
-int CPDF_TextPage::CountRects(int start, int nCount)
-{
- if(m_ParseOptions.m_bGetCharCodeOnly) {
- return -1;
- }
- if (!m_IsParsered) {
- return -1;
- }
- if (start < 0) {
- return -1;
- }
- if (nCount == -1 || nCount + start > m_charList.GetSize() ) {
- nCount = m_charList.GetSize() - start;
- }
- m_SelRects.RemoveAll();
- GetRectArray(start, nCount, m_SelRects);
- return m_SelRects.GetSize();
-}
-void CPDF_TextPage::GetRect(int rectIndex, FX_FLOAT& left, FX_FLOAT& top, FX_FLOAT& right, FX_FLOAT &bottom) const
-{
- if(m_ParseOptions.m_bGetCharCodeOnly) {
- return ;
- }
- if (!m_IsParsered || rectIndex < 0 || rectIndex >= m_SelRects.GetSize()) {
- return;
- }
- left = m_SelRects.GetAt(rectIndex).left;
- top = m_SelRects.GetAt(rectIndex).top;
- right = m_SelRects.GetAt(rectIndex).right;
- bottom = m_SelRects.GetAt(rectIndex).bottom;
-}
-FX_BOOL CPDF_TextPage::GetBaselineRotate(int start, int end, int& Rotate)
-{
- if(m_ParseOptions.m_bGetCharCodeOnly) {
- return FALSE;
- }
- if(end == start) {
- return FALSE;
- }
- FX_FLOAT dx, dy;
- FPDF_CHAR_INFO info1, info2;
- GetCharInfo(start, info1);
- GetCharInfo(end, info2);
- while(info2.m_CharBox.Width() == 0 || info2.m_CharBox.Height() == 0) {
- end--;
- if(end <= start) {
- return FALSE;
- }
- GetCharInfo(end, info2);
- }
- dx = (info2.m_OriginX - info1.m_OriginX);
- dy = (info2.m_OriginY - info1.m_OriginY);
- if(dx == 0) {
- if(dy > 0) {
- Rotate = 90;
- } else if (dy < 0) {
- Rotate = 270;
- } else {
- Rotate = 0;
- }
- } else {
- float a = FXSYS_atan2(dy, dx);
- Rotate = (int)(a * 180 / FX_PI + 0.5);
- }
- if(Rotate < 0) {
- Rotate = -Rotate;
- } else if(Rotate > 0) {
- Rotate = 360 - Rotate;
- }
- return TRUE;
-}
-FX_BOOL CPDF_TextPage::GetBaselineRotate(CFX_FloatRect rect , int& Rotate)
-{
- if(m_ParseOptions.m_bGetCharCodeOnly) {
- return FALSE;
- }
- int start, end, count, n = CountBoundedSegments(rect.left, rect.top, rect.right, rect.bottom, TRUE);
- if(n < 1) {
- return FALSE;
- }
- if(n > 1) {
- GetBoundedSegment(n - 1, start, count);
- end = start + count - 1;
- GetBoundedSegment(0, start, count);
- } else {
- GetBoundedSegment(0, start, count);
- end = start + count - 1;
- }
- return GetBaselineRotate(start, end, Rotate);
-}
-FX_BOOL CPDF_TextPage::GetBaselineRotate(int rectIndex, int& Rotate)
-{
- if(m_ParseOptions.m_bGetCharCodeOnly) {
- return FALSE;
- }
- if (!m_IsParsered || rectIndex < 0 || rectIndex > m_SelRects.GetSize()) {
- return FALSE;
- }
- CFX_FloatRect rect = m_SelRects.GetAt(rectIndex);
- return GetBaselineRotate(rect , Rotate);
-}
-int CPDF_TextPage::CountBoundedSegments(FX_FLOAT left, FX_FLOAT top, FX_FLOAT right, FX_FLOAT bottom, FX_BOOL bContains )
-{
- if(m_ParseOptions.m_bGetCharCodeOnly) {
- return -1;
- }
- m_Segment.RemoveAll();
- if (!m_IsParsered) {
- return -1;
- }
- CFX_FloatRect rect(left, bottom, right, top);
- rect.Normalize();
- int nCount = m_charList.GetSize();
- int pos = 0;
- FPDF_SEGMENT segment;
- segment.m_Start = 0;
- segment.m_nCount = 0;
- FX_BOOL segmentStatus = 0;
- FX_BOOL IsContainPreChar = FALSE;
- while (pos < nCount) {
- if(pos == 493) {
- int a = 0;
- }
- PAGECHAR_INFO charinfo = *(PAGECHAR_INFO*)m_charList.GetAt(pos);
- if(bContains && rect.Contains(charinfo.m_CharBox)) {
- if (segmentStatus == 0 || segmentStatus == 2) {
- segment.m_Start = pos;
- segment.m_nCount = 1;
- segmentStatus = 1;
- } else if (segmentStatus == 1) {
- segment.m_nCount++;
- }
- IsContainPreChar = TRUE;
- } else if (!bContains && (IsRectIntersect(rect, charinfo.m_CharBox) || rect.Contains(charinfo.m_OriginX, charinfo.m_OriginY))) {
- if (segmentStatus == 0 || segmentStatus == 2) {
- segment.m_Start = pos;
- segment.m_nCount = 1;
- segmentStatus = 1;
- } else if (segmentStatus == 1) {
- segment.m_nCount++;
- }
- IsContainPreChar = TRUE;
- } else if (charinfo.m_Unicode == 32) {
- if (IsContainPreChar == TRUE) {
- if (segmentStatus == 0 || segmentStatus == 2) {
- segment.m_Start = pos;
- segment.m_nCount = 1;
- segmentStatus = 1;
- } else if (segmentStatus == 1) {
- segment.m_nCount++;
- }
- IsContainPreChar = FALSE;
- } else {
- if (segmentStatus == 1) {
- segmentStatus = 2;
- m_Segment.Add(segment);
- segment.m_Start = 0;
- segment.m_nCount = 0;
- }
- }
- } else {
- if (segmentStatus == 1) {
- segmentStatus = 2;
- m_Segment.Add(segment);
- segment.m_Start = 0;
- segment.m_nCount = 0;
- }
- IsContainPreChar = FALSE;
- }
- pos++;
- }
- if (segmentStatus == 1) {
- segmentStatus = 2;
- m_Segment.Add(segment);
- segment.m_Start = 0;
- segment.m_nCount = 0;
- }
- return m_Segment.GetSize();
-}
-void CPDF_TextPage::GetBoundedSegment(int index, int& start, int& count) const
-{
- if(m_ParseOptions.m_bGetCharCodeOnly) {
- return ;
- }
- if (index < 0 || index >= m_Segment.GetSize()) {
- return;
- }
- start = m_Segment.GetAt(index).m_Start;
- count = m_Segment.GetAt(index).m_nCount;
-}
-int CPDF_TextPage::GetWordBreak(int index, int direction) const
-{
- if(m_ParseOptions.m_bGetCharCodeOnly) {
- return -1;
- }
- if (!m_IsParsered) {
- return -1;
- }
- if (direction != FPDFTEXT_LEFT && direction != FPDFTEXT_RIGHT) {
- return -1;
- }
- if (index < 0 || index >= m_charList.GetSize()) {
- return -1;
- }
- PAGECHAR_INFO charinfo;
- charinfo = *(PAGECHAR_INFO*)m_charList.GetAt(index);
- if (charinfo.m_Index == -1 || charinfo.m_Flag == FPDFTEXT_CHAR_GENERATED) {
- return index;
- }
- if (!IsLetter(charinfo.m_Unicode)) {
- return index;
- }
- int breakPos = index;
- if (direction == FPDFTEXT_LEFT) {
- while (--breakPos > 0) {
- charinfo = *(PAGECHAR_INFO*)m_charList.GetAt(breakPos);
- if (!IsLetter(charinfo.m_Unicode)) {
- return breakPos;
- }
- }
- return breakPos;
- } else if (direction == FPDFTEXT_RIGHT) {
- while (++breakPos < m_charList.GetSize()) {
- charinfo = *(PAGECHAR_INFO*)m_charList.GetAt(breakPos);
- if (!IsLetter(charinfo.m_Unicode)) {
- return breakPos;
- }
- }
- return breakPos;
- }
- return breakPos;
-}
-FX_INT32 CPDF_TextPage::FindTextlineFlowDirection()
-{
- if (!m_pPage) {
- return -1;
- }
- const FX_INT32 nPageWidth = (FX_INT32)((CPDF_Page*)m_pPage)->GetPageWidth();
- const FX_INT32 nPageHeight = (FX_INT32)((CPDF_Page*)m_pPage)->GetPageHeight();
- CFX_ByteArray nHorizontalMask;
- if (!nHorizontalMask.SetSize(nPageWidth)) {
- return -1;
- }
- FX_BYTE* pDataH = nHorizontalMask.GetData();
- CFX_ByteArray nVerticalMask;
- if (!nVerticalMask.SetSize(nPageHeight)) {
- return -1;
- }
- FX_BYTE* pDataV = nVerticalMask.GetData();
- FX_INT32 index = 0;
- FX_FLOAT fLineHeight = 0.0f;
- CPDF_PageObject* pPageObj = NULL;
- FX_POSITION pos = NULL;
- pos = m_pPage->GetFirstObjectPosition();
- if(!pos) {
- return -1;
- }
- while(pos) {
- pPageObj = m_pPage->GetNextObject(pos);
- if(NULL == pPageObj) {
- continue;
- }
- if(PDFPAGE_TEXT != pPageObj->m_Type) {
- continue;
- }
- FX_INT32 minH = (FX_INT32)pPageObj->m_Left < 0 ? 0 : (FX_INT32)pPageObj->m_Left;
- FX_INT32 maxH = (FX_INT32)pPageObj->m_Right > nPageWidth ? nPageWidth : (FX_INT32)pPageObj->m_Right;
- FX_INT32 minV = (FX_INT32)pPageObj->m_Bottom < 0 ? 0 : (FX_INT32)pPageObj->m_Bottom;
- FX_INT32 maxV = (FX_INT32)pPageObj->m_Top > nPageHeight ? nPageHeight : (FX_INT32)pPageObj->m_Top;
- if (minH >= maxH || minV >= maxV){
- continue;
- }
-
- FXSYS_memset8(pDataH + minH, 1, maxH - minH);
- FXSYS_memset8(pDataV + minV, 1, maxV - minV);
-
- if (fLineHeight <= 0.0f) {
- fLineHeight = pPageObj->m_Top - pPageObj->m_Bottom;
- }
-
- pPageObj = NULL;
- }
- FX_INT32 nStartH = 0;
- FX_INT32 nEndH = 0;
- FX_FLOAT nSumH = 0.0f;
- for (index = 0; index < nPageWidth; index++)
- if(1 == nHorizontalMask[index]) {
- break;
- }
- nStartH = index;
- for (index = nPageWidth; index > 0; index--)
- if(1 == nHorizontalMask[index - 1]) {
- break;
- }
- nEndH = index;
- for (index = nStartH; index < nEndH; index++) {
- nSumH += nHorizontalMask[index];
- }
- nSumH /= nEndH - nStartH;
- FX_INT32 nStartV = 0;
- FX_INT32 nEndV = 0;
- FX_FLOAT nSumV = 0.0f;
- for (index = 0; index < nPageHeight; index++)
- if(1 == nVerticalMask[index]) {
- break;
- }
- nStartV = index;
- for (index = nPageHeight; index > 0; index--)
- if(1 == nVerticalMask[index - 1]) {
- break;
- }
- nEndV = index;
- for (index = nStartV; index < nEndV; index++) {
- nSumV += nVerticalMask[index];
- }
- nSumV /= nEndV - nStartV;
- if ((nEndV - nStartV) < (FX_INT32)(2 * fLineHeight)) {
- return 0;
- }
- if ((nEndH - nStartH) < (FX_INT32)(2 * fLineHeight)) {
- return 1;
- }
- if (nSumH > 0.8f) {
- return 0;
- }
- if (nSumH - nSumV > 0.0f) {
- return 0;
- }
- if (nSumV - nSumH > 0.0f) {
- return 1;
- }
- return -1;
-}
-void CPDF_TextPage::ProcessObject()
-{
- CPDF_PageObject* pPageObj = NULL;
- if (!m_pPage) {
- return;
- }
- FX_POSITION pos;
- pos = m_pPage->GetFirstObjectPosition();
- if (!pos) {
- return;
- }
- m_TextlineDir = FindTextlineFlowDirection();
- int nCount = 0;
- while (pos) {
- pPageObj = m_pPage->GetNextObject(pos);
- if(pPageObj) {
- if(pPageObj->m_Type == PDFPAGE_TEXT) {
- if (nCount == 3) {
- nCount = nCount;
- }
- CFX_AffineMatrix matrix;
- ProcessTextObject((CPDF_TextObject*)pPageObj, matrix, pos);
- nCount++;
- } else if (pPageObj->m_Type == PDFPAGE_FORM) {
- CFX_AffineMatrix formMatrix(1, 0, 0, 1, 0, 0);
- ProcessFormObject((CPDF_FormObject*)pPageObj, formMatrix);
- }
- }
- pPageObj = NULL;
- }
- int count = m_LineObj.GetSize();
- for(int i = 0; i < count; i++) {
- ProcessTextObject(m_LineObj.GetAt(i));
- }
- m_LineObj.RemoveAll();
- CloseTempLine();
-}
-void CPDF_TextPage::ProcessFormObject(CPDF_FormObject* pFormObj, CFX_AffineMatrix formMatrix)
-{
- CPDF_PageObject* pPageObj = NULL;
- FX_POSITION pos;
- if (!pFormObj) {
- return;
- }
- pos = pFormObj->m_pForm->GetFirstObjectPosition();
- if (!pos) {
- return;
- }
- CFX_AffineMatrix curFormMatrix;
- curFormMatrix.Copy(pFormObj->m_FormMatrix);
- curFormMatrix.Concat(formMatrix);
- while (pos) {
- pPageObj = pFormObj->m_pForm->GetNextObject(pos);
- if(pPageObj) {
- if(pPageObj->m_Type == PDFPAGE_TEXT) {
- ProcessTextObject((CPDF_TextObject*)pPageObj, curFormMatrix, pos);
- } else if (pPageObj->m_Type == PDFPAGE_FORM) {
- ProcessFormObject((CPDF_FormObject*)pPageObj, curFormMatrix);
- }
- }
- pPageObj = NULL;
- }
-}
-int CPDF_TextPage::GetCharWidth(FX_DWORD charCode, CPDF_Font* pFont) const
-{
- if(charCode == -1) {
- return 0;
- }
- int w = pFont->GetCharWidthF(charCode);
- if(w == 0) {
- CFX_ByteString str;
- pFont->AppendChar(str, charCode);
- w = pFont->GetStringWidth(str, 1);
- if(w == 0) {
- FX_RECT BBox;
- pFont->GetCharBBox(charCode, BBox);
- w = BBox.right - BBox.left;
- }
- }
- return w;
-}
-void CPDF_TextPage::OnPiece(IFX_BidiChar* pBidi, CFX_WideString& str)
-{
- FX_INT32 start, count;
- FX_INT32 ret = pBidi->GetBidiInfo(start, count);
- if(ret == 2) {
- for(int i = start + count - 1; i >= start; i--) {
- m_TextBuf.AppendChar(str.GetAt(i));
- m_charList.Add(*(PAGECHAR_INFO*)m_TempCharList.GetAt(i));
- }
- } else {
- int end = start + count ;
- for(int i = start; i < end; i++) {
- m_TextBuf.AppendChar(str.GetAt(i));
- m_charList.Add(*(PAGECHAR_INFO*)m_TempCharList.GetAt(i));
- }
- }
-}
-void CPDF_TextPage::AddCharInfoByLRDirection(CFX_WideString& str, int i)
-{
- PAGECHAR_INFO Info = *(PAGECHAR_INFO*)m_TempCharList.GetAt(i);
- FX_WCHAR wChar = str.GetAt(i);
-#ifdef FOXIT_CHROME_BUILD
- if(!IsControlChar(&Info)) {
-#else
- if(wChar != 0xfffe) {
-#endif
- Info.m_Index = m_TextBuf.GetLength();
- if (wChar >= 0xFB00 && wChar <= 0xFB06) {
- FX_LPWSTR pDst = NULL;
- FX_STRSIZE nCount = FX_Unicode_GetNormalization(wChar, pDst);
- if (nCount >= 1) {
- pDst = FX_Alloc(FX_WCHAR, nCount);
- if (!pDst) {
- return;
- }
- FX_Unicode_GetNormalization(wChar, pDst);
- for (int nIndex = 0; nIndex < nCount; nIndex++) {
- PAGECHAR_INFO Info2 = Info;
- Info2.m_Unicode = pDst[nIndex];
- Info2.m_Flag = FPDFTEXT_CHAR_PIECE;
- m_TextBuf.AppendChar(Info2.m_Unicode);
- if( !m_ParseOptions.m_bGetCharCodeOnly) {
- m_charList.Add(Info2);
- }
- }
- FX_Free(pDst);
- return;
- }
- }
- m_TextBuf.AppendChar(wChar);
- } else {
- Info.m_Index = -1;
- }
- if( !m_ParseOptions.m_bGetCharCodeOnly) {
- m_charList.Add(Info);
- }
-}
-void CPDF_TextPage::AddCharInfoByRLDirection(CFX_WideString& str, int i)
-{
- PAGECHAR_INFO Info = *(PAGECHAR_INFO*)m_TempCharList.GetAt(i);
-#ifdef FOXIT_CHROME_BUILD
- if(!IsControlChar(&Info)) {
-#else
- if(str.GetAt(i) != 0xfffe) {
-#endif
- Info.m_Index = m_TextBuf.GetLength();
- FX_WCHAR wChar = FX_GetMirrorChar(str.GetAt(i), TRUE, FALSE);
- FX_LPWSTR pDst = NULL;
- FX_STRSIZE nCount = FX_Unicode_GetNormalization(wChar, pDst);
- if (nCount >= 1) {
- pDst = FX_Alloc(FX_WCHAR, nCount);
- if (!pDst) {
- return;
- }
- FX_Unicode_GetNormalization(wChar, pDst);
- for (int nIndex = 0; nIndex < nCount; nIndex++) {
- PAGECHAR_INFO Info2 = Info;
- Info2.m_Unicode = pDst[nIndex];
- Info2.m_Flag = FPDFTEXT_CHAR_PIECE;
- m_TextBuf.AppendChar(Info2.m_Unicode);
- if( !m_ParseOptions.m_bGetCharCodeOnly) {
- m_charList.Add(Info2);
- }
- }
- FX_Free(pDst);
- return;
- } else {
- Info.m_Unicode = wChar;
- }
- m_TextBuf.AppendChar(Info.m_Unicode);
- } else {
- Info.m_Index = -1;
- }
- if( !m_ParseOptions.m_bGetCharCodeOnly) {
- m_charList.Add(Info);
- }
-}
-void CPDF_TextPage::CloseTempLine()
-{
- int count1 = m_TempCharList.GetSize();
- if (count1 <= 0) {
- return;
- }
- IFX_BidiChar* BidiChar = IFX_BidiChar::Create();
- CFX_WideString str = m_TempTextBuf.GetWideString();
- CFX_WordArray order;
- FX_BOOL bR2L = FALSE;
- FX_INT32 start = 0, count = 0, i = 0;
- int nR2L = 0, nL2R = 0;
- FX_BOOL bPrevSpace = FALSE;
- for (i = 0; i < str.GetLength(); i++) {
- if(str.GetAt(i) == 32) {
- if(bPrevSpace) {
- m_TempTextBuf.Delete(i, 1);
- m_TempCharList.Delete(i);
- str.Delete(i);
- count1 --;
- i--;
- continue;
- }
- bPrevSpace = TRUE;
- } else {
- bPrevSpace = FALSE;
- }
- if(BidiChar && BidiChar->AppendChar(str.GetAt(i))) {
- FX_INT32 ret = BidiChar->GetBidiInfo(start, count);
- order.Add(start);
- order.Add(count);
- order.Add(ret);
- if(!bR2L) {
- if(ret == 2) {
- nR2L++;
- } else if (ret == 1) {
- nL2R++;
- }
- }
- }
- }
- if(BidiChar && BidiChar->EndChar()) {
- FX_INT32 ret = BidiChar->GetBidiInfo(start, count);
- order.Add(start);
- order.Add(count);
- order.Add(ret);
- if(!bR2L) {
- if(ret == 2) {
- nR2L++;
- } else if(ret == 1) {
- nL2R++;
- }
- }
- }
- if(nR2L > 0 && nR2L >= nL2R) {
- bR2L = TRUE;
- }
- if(this->m_parserflag == FPDFTEXT_RLTB || bR2L) {
- int count = order.GetSize();
- for(int j = count - 1; j > 0; j -= 3) {
- int ret = order.GetAt(j);
- int start = order.GetAt(j - 2);
- int count1 = order.GetAt(j - 1);
- if(ret == 2 || ret == 0) {
- for(int i = start + count1 - 1; i >= start; i--) {
- AddCharInfoByRLDirection(str, i);
- }
- } else {
- i = j;
- FX_BOOL bSymbol = FALSE;
- while(i > 0 && order.GetAt(i) != 2) {
- bSymbol = !order.GetAt(i);
- i -= 3;
- }
- int end = start + count1 ;
- int n = 0;
- if(bSymbol) {
- n = i + 6;
- } else {
- n = i + 3;
- }
- if(n >= j) {
- for(int m = start; m < end; m++) {
- AddCharInfoByLRDirection(str, m);
- }
- } else {
- i = j;
- j = n;
- for(; n <= i; n += 3) {
- int ret = order.GetAt(n);
- int start = order.GetAt(n - 2);
- int count1 = order.GetAt(n - 1);
- int end = start + count1 ;
- for(int m = start; m < end; m++) {
- AddCharInfoByLRDirection(str, m);
- }
- }
- }
- }
- }
- } else {
- int count = order.GetSize();
- FX_BOOL bL2R = FALSE;
- for(int j = 0; j < count; j += 3) {
- int ret = order.GetAt(j + 2);
- int start = order.GetAt(j);
- int count1 = order.GetAt(j + 1);
- if(ret == 2 || (j == 0 && ret == 0 && !bL2R)) {
- int i = j + 3;
- while(bR2L && i < count) {
- if(order.GetAt(i + 2) == 1) {
- break;
- } else {
- i += 3;
- }
- }
- if(i == 3) {
- j = -3;
- bL2R = TRUE;
- continue;
- }
- int end = m_TempCharList.GetSize() - 1;
- if(i < count) {
- end = order.GetAt(i) - 1;
- }
- j = i - 3;
- for(int n = end; n >= start; n--) {
- AddCharInfoByRLDirection(str, n);
- }
- } else {
- int end = start + count1 ;
- for(int i = start; i < end; i++) {
- AddCharInfoByLRDirection(str, i);
- }
- }
- }
- }
- int ntext = m_TextBuf.GetSize();
- ntext = m_charList.GetSize();
- order.RemoveAll();
- m_TempCharList.RemoveAll();
- m_TempTextBuf.Delete(0, m_TempTextBuf.GetLength());
- BidiChar->Release();
-}
-void CPDF_TextPage::ProcessTextObject(CPDF_TextObject* pTextObj, CFX_AffineMatrix formMatrix, FX_POSITION ObjPos)
-{
- CFX_FloatRect re(pTextObj->m_Left, pTextObj->m_Bottom, pTextObj->m_Right, pTextObj->m_Top);
- if(FXSYS_fabs(pTextObj->m_Right - pTextObj->m_Left) < 0.01f ) {
- return;
- }
- int count = m_LineObj.GetSize();
- PDFTEXT_Obj Obj;
- Obj.m_pTextObj = pTextObj;
- Obj.m_formMatrix = formMatrix;
- if(count == 0) {
- m_LineObj.Add(Obj);
- return;
- }
- if (IsSameAsPreTextObject(pTextObj, ObjPos)) {
- return;
- }
- PDFTEXT_Obj prev_Obj = m_LineObj.GetAt(count - 1);
- CPDF_TextObjectItem item;
- int nItem = prev_Obj.m_pTextObj->CountItems();
- prev_Obj.m_pTextObj->GetItemInfo(nItem - 1, &item);
- FX_FLOAT prev_width = GetCharWidth(item.m_CharCode, prev_Obj.m_pTextObj->GetFont()) * prev_Obj.m_pTextObj->GetFontSize() / 1000;
- CFX_AffineMatrix prev_matrix;
- prev_Obj.m_pTextObj->GetTextMatrix(&prev_matrix);
- prev_width = FXSYS_fabs(prev_width);
- prev_matrix.Concat(prev_Obj.m_formMatrix);
- prev_width = prev_matrix.TransformDistance(prev_width);
- pTextObj->GetItemInfo(0, &item);
- FX_FLOAT this_width = GetCharWidth(item.m_CharCode, pTextObj->GetFont()) * pTextObj->GetFontSize() / 1000;
- this_width = FXSYS_fabs(this_width);
- CFX_AffineMatrix this_matrix;
- pTextObj->GetTextMatrix(&this_matrix);
- this_width = FXSYS_fabs(this_width);
- this_matrix.Concat(formMatrix);
- this_width = this_matrix.TransformDistance(this_width);
- FX_FLOAT threshold = prev_width > this_width ? prev_width / 4 : this_width / 4;
- FX_FLOAT prev_x = prev_Obj.m_pTextObj->GetPosX(), prev_y = prev_Obj.m_pTextObj->GetPosY();
- prev_Obj.m_formMatrix.Transform(prev_x, prev_y);
- m_DisplayMatrix.Transform(prev_x, prev_y);
- FX_FLOAT this_x = pTextObj->GetPosX(), this_y = pTextObj->GetPosY();
- formMatrix.Transform(this_x, this_y);
- m_DisplayMatrix.Transform(this_x, this_y);
- if (FXSYS_fabs(this_y - prev_y) > threshold * 2) {
- for(int i = 0; i < count; i++) {
- ProcessTextObject(m_LineObj.GetAt(i));
- }
- m_LineObj.RemoveAll();
- m_LineObj.Add(Obj);
- return;
- }
- int i = 0;
- if(m_ParseOptions.m_bNormalizeObjs) {
- for(i = count - 1; i >= 0; i--) {
- PDFTEXT_Obj prev_Obj = m_LineObj.GetAt(i);
- CFX_AffineMatrix prev_matrix;
- prev_Obj.m_pTextObj->GetTextMatrix(&prev_matrix);
- FX_FLOAT Prev_x = prev_Obj.m_pTextObj->GetPosX(), Prev_y = prev_Obj.m_pTextObj->GetPosY();
- prev_Obj.m_formMatrix.Transform(Prev_x, Prev_y);
- m_DisplayMatrix.Transform(Prev_x, Prev_y);
- if(this_x >= Prev_x) {
- if(i == count - 1) {
- m_LineObj.Add(Obj);
- } else {
- m_LineObj.InsertAt(i + 1, Obj);
- }
- break;
- }
- }
- if(i < 0) {
- m_LineObj.InsertAt(0, Obj);
- }
- } else {
- m_LineObj.Add(Obj);
- }
-}
-FX_INT32 CPDF_TextPage::PreMarkedContent(PDFTEXT_Obj Obj)
-{
- CPDF_TextObject* pTextObj = Obj.m_pTextObj;
- CPDF_ContentMarkData* pMarkData = (CPDF_ContentMarkData*)pTextObj->m_ContentMark.GetObject();
- if(!pMarkData) {
- return FPDFTEXT_MC_PASS;
- }
- int nContentMark = pMarkData->CountItems();
- if (nContentMark < 1) {
- return FPDFTEXT_MC_PASS;
- }
- CFX_WideString actText;
- FX_BOOL bExist = FALSE;
- CPDF_Dictionary* pDict = NULL;
- int n = 0;
- for (n = 0; n < nContentMark; n++) {
- CPDF_ContentMarkItem& item = pMarkData->GetItem(n);
- CFX_ByteString tagStr = (CFX_ByteString)item.GetName();
- pDict = (CPDF_Dictionary*)item.GetParam();
- CPDF_String* temp = (CPDF_String*)pDict->GetElement(FX_BSTRC("ActualText"));
- if (temp) {
- bExist = TRUE;
- actText = temp->GetUnicodeText();
- }
- }
- if (!bExist) {
- return FPDFTEXT_MC_PASS;
- }
- if (m_pPreTextObj) {
- if (CPDF_ContentMarkData* pPreMarkData = (CPDF_ContentMarkData*)m_pPreTextObj->m_ContentMark.GetObject()) {
- if (pPreMarkData->CountItems() == n) {
- CPDF_ContentMarkItem& item = pPreMarkData->GetItem(n - 1);
- if (pDict == item.GetParam()) {
- return FPDFTEXT_MC_DONE;
- }
- }
- }
- }
- CPDF_Font* pFont = pTextObj->GetFont();
- FX_STRSIZE nItems = actText.GetLength();
- if (nItems < 1) {
- return FPDFTEXT_MC_PASS;
- }
- bExist = FALSE;
- for (FX_STRSIZE i = 0; i < nItems; i++) {
- FX_WCHAR wChar = actText.GetAt(i);
- if (-1 == pFont->CharCodeFromUnicode(wChar)) {
- continue;
- } else {
- bExist = TRUE;
- break;
- }
- }
- if (!bExist) {
- return FPDFTEXT_MC_PASS;
- }
- bExist = FALSE;
- for (FX_STRSIZE j = 0; j < nItems; j++) {
- FX_WCHAR wChar = actText.GetAt(j);
- if ((wChar > 0x80 && wChar < 0xFFFD) || (wChar <= 0x80 && isprint(wChar))) {
- bExist = TRUE;
- break;
- }
- }
- if (!bExist) {
- return FPDFTEXT_MC_DONE;
- }
- return FPDFTEXT_MC_DELAY;
-}
-void CPDF_TextPage::ProcessMarkedContent(PDFTEXT_Obj Obj)
-{
- CPDF_TextObject* pTextObj = Obj.m_pTextObj;
- CPDF_ContentMarkData* pMarkData = (CPDF_ContentMarkData*)pTextObj->m_ContentMark.GetObject();
- if(!pMarkData) {
- return;
- }
- int nContentMark = pMarkData->CountItems();
- if (nContentMark < 1) {
- return;
- }
- CFX_WideString actText;
- CPDF_Dictionary* pDict = NULL;
- int n = 0;
- for (n = 0; n < nContentMark; n++) {
- CPDF_ContentMarkItem& item = pMarkData->GetItem(n);
- CFX_ByteString tagStr = (CFX_ByteString)item.GetName();
- pDict = (CPDF_Dictionary*)item.GetParam();
- CPDF_String* temp = (CPDF_String*)pDict->GetElement(FX_BSTRC("ActualText"));
- if (temp) {
- actText = temp->GetUnicodeText();
- }
- }
- FX_STRSIZE nItems = actText.GetLength();
- if (nItems < 1) {
- return;
- }
- CPDF_Font* pFont = pTextObj->GetFont();
- CFX_AffineMatrix formMatrix = Obj.m_formMatrix;
- CFX_AffineMatrix matrix;
- pTextObj->GetTextMatrix(&matrix);
- matrix.Concat(formMatrix);
- FX_FLOAT fPosX = pTextObj->GetPosX();
- FX_FLOAT fPosY = pTextObj->GetPosY();
- int nCharInfoIndex = m_TextBuf.GetLength();
- CFX_FloatRect charBox;
- charBox.top = pTextObj->m_Top;
- charBox.left = pTextObj->m_Left;
- charBox.right = pTextObj->m_Right;
- charBox.bottom = pTextObj->m_Bottom;
- for (FX_STRSIZE k = 0; k < nItems; k++) {
- FX_WCHAR wChar = actText.GetAt(k);
- if (wChar <= 0x80 && !isprint(wChar)) {
- wChar = 0x20;
- }
- if (wChar >= 0xFFFD) {
- continue;
- }
- PAGECHAR_INFO charinfo;
- charinfo.m_OriginX = fPosX;
- charinfo.m_OriginY = fPosY;
- charinfo.m_Index = nCharInfoIndex;
- charinfo.m_Unicode = wChar;
- charinfo.m_CharCode = pFont->CharCodeFromUnicode(wChar);
- charinfo.m_Flag = FPDFTEXT_CHAR_PIECE;
- charinfo.m_pTextObj = pTextObj;
- charinfo.m_CharBox.top = charBox.top;
- charinfo.m_CharBox.left = charBox.left;
- charinfo.m_CharBox.right = charBox.right;
- charinfo.m_CharBox.bottom = charBox.bottom;
- charinfo.m_Matrix.Copy(matrix);
- m_TempTextBuf.AppendChar(wChar);
- m_TempCharList.Add(charinfo);
- }
-}
-void CPDF_TextPage::FindPreviousTextObject(void)
-{
- if (m_TempCharList.GetSize() < 1 && m_charList.GetSize() < 1) {
- return;
- }
- PAGECHAR_INFO preChar;
- if (m_TempCharList.GetSize() >= 1) {
- preChar = *(PAGECHAR_INFO*)m_TempCharList.GetAt(m_TempCharList.GetSize() - 1);
- } else {
- preChar = *(PAGECHAR_INFO*)m_charList.GetAt(m_charList.GetSize() - 1);
- }
- if (preChar.m_pTextObj) {
- m_pPreTextObj = preChar.m_pTextObj;
- }
-}
-void CPDF_TextPage::ProcessTextObject(PDFTEXT_Obj Obj)
-{
- CPDF_TextObject* pTextObj = Obj.m_pTextObj;
- if(FXSYS_fabs(pTextObj->m_Right - pTextObj->m_Left) < 0.01f ) {
- return;
- }
- CFX_AffineMatrix formMatrix = Obj.m_formMatrix;
- CPDF_Font* pFont = pTextObj->GetFont();
- CFX_AffineMatrix matrix;
- pTextObj->GetTextMatrix(&matrix);
- matrix.Concat(formMatrix);
- FX_INT32 bPreMKC = PreMarkedContent(Obj);
- if (FPDFTEXT_MC_DONE == bPreMKC) {
- m_pPreTextObj = pTextObj;
- m_perMatrix.Copy(formMatrix);
- return;
- }
- int result = 0;
- if (m_pPreTextObj) {
- result = ProcessInsertObject(pTextObj, formMatrix);
- if (2 == result) {
- m_CurlineRect = CFX_FloatRect(Obj.m_pTextObj->m_Left, Obj.m_pTextObj->m_Bottom, Obj.m_pTextObj->m_Right, Obj.m_pTextObj->m_Top);
- } else {
- m_CurlineRect.Union(CFX_FloatRect(Obj.m_pTextObj->m_Left, Obj.m_pTextObj->m_Bottom, Obj.m_pTextObj->m_Right, Obj.m_pTextObj->m_Top));
- }
- PAGECHAR_INFO generateChar;
- if (result == 1) {
- if (GenerateCharInfo(TEXT_BLANK_CHAR, generateChar)) {
- if (!formMatrix.IsIdentity()) {
- generateChar.m_Matrix.Copy(formMatrix);
- }
- m_TempTextBuf.AppendChar(TEXT_BLANK_CHAR);
- m_TempCharList.Add(generateChar);
- }
- } else if(result == 2) {
- CloseTempLine();
- if(m_TextBuf.GetSize()) {
- if(m_ParseOptions.m_bGetCharCodeOnly) {
- m_TextBuf.AppendChar(TEXT_RETURN_CHAR);
- m_TextBuf.AppendChar(TEXT_LINEFEED_CHAR);
- } else {
- if(GenerateCharInfo(TEXT_RETURN_CHAR, generateChar)) {
- m_TextBuf.AppendChar(TEXT_RETURN_CHAR);
- if (!formMatrix.IsIdentity()) {
- generateChar.m_Matrix.Copy(formMatrix);
- }
- m_charList.Add(generateChar);
- }
- if(GenerateCharInfo(TEXT_LINEFEED_CHAR, generateChar)) {
- m_TextBuf.AppendChar(TEXT_LINEFEED_CHAR);
- if (!formMatrix.IsIdentity()) {
- generateChar.m_Matrix.Copy(formMatrix);
- }
- m_charList.Add(generateChar);
- }
- }
- }
- } else if (result == 3 && !m_ParseOptions.m_bOutputHyphen) {
- FX_INT32 nChars = pTextObj->CountChars();
- if (nChars == 1) {
- CPDF_TextObjectItem item;
- pTextObj->GetCharInfo(0, &item);
- CFX_WideString wstrItem = pTextObj->GetFont()->UnicodeFromCharCode(item.m_CharCode);
- if(wstrItem.IsEmpty()) {
- wstrItem += (FX_WCHAR)item.m_CharCode;
- }
- FX_WCHAR curChar = wstrItem.GetAt(0);
- if (0x2D == curChar || 0xAD == curChar) {
- return;
- }
- }
- while (m_TempTextBuf.GetSize() > 0 && m_TempTextBuf.GetWideString().GetAt(m_TempTextBuf.GetLength() - 1) == 0x20) {
- m_TempTextBuf.Delete(m_TempTextBuf.GetLength() - 1, 1);
- m_TempCharList.Delete(m_TempCharList.GetSize() - 1);
- }
- PAGECHAR_INFO* cha = (PAGECHAR_INFO*)m_TempCharList.GetAt(m_TempCharList.GetSize() - 1);
- m_TempTextBuf.Delete(m_TempTextBuf.GetLength() - 1, 1);
-#ifdef FOXIT_CHROME_BUILD
- cha->m_Unicode = 0x2;
- cha->m_Flag = FPDFTEXT_CHAR_HYPHEN;
- m_TempTextBuf.AppendChar(0xfffe);
-#else
- cha->m_Unicode = 0;
- m_TempTextBuf.AppendChar(0xfffe);
-#endif
- }
- } else {
- m_CurlineRect = CFX_FloatRect(Obj.m_pTextObj->m_Left, Obj.m_pTextObj->m_Bottom, Obj.m_pTextObj->m_Right, Obj.m_pTextObj->m_Top);
- }
- if (FPDFTEXT_MC_DELAY == bPreMKC) {
- ProcessMarkedContent(Obj);
- m_pPreTextObj = pTextObj;
- m_perMatrix.Copy(formMatrix);
- return;
- }
- m_pPreTextObj = pTextObj;
- m_perMatrix.Copy(formMatrix);
- int nItems = pTextObj->CountItems();
- FX_FLOAT spacing = 0;
- FX_FLOAT baseSpace = 0.0;
- FX_BOOL bAllChar = TRUE;
- if (pTextObj->m_TextState.GetObject()->m_CharSpace && nItems >= 3) {
- spacing = matrix.TransformDistance(pTextObj->m_TextState.GetObject()->m_CharSpace);
- baseSpace = spacing;
- for (int i = 0; i < nItems; i++) {
- CPDF_TextObjectItem item;
- pTextObj->GetItemInfo(i, &item);
- if (item.m_CharCode == (FX_DWORD) - 1) {
- FX_FLOAT fontsize_h = pTextObj->m_TextState.GetFontSizeH();
- FX_FLOAT kerning = -fontsize_h * item.m_OriginX / 1000;
- if(kerning + spacing < baseSpace) {
- baseSpace = kerning + spacing;
- }
- bAllChar = FALSE;
- }
- }
- spacing = 0;
- if(baseSpace < 0.0 || (nItems == 3 && !bAllChar)) {
- baseSpace = 0.0;
- }
- }
- for (int i = 0; i < nItems; i++) {
- CPDF_TextObjectItem item;
- PAGECHAR_INFO charinfo;
- charinfo.m_OriginX = 0;
- charinfo.m_OriginY = 0;
- pTextObj->GetItemInfo(i, &item);
- if (item.m_CharCode == (FX_DWORD) - 1) {
- CFX_WideString str = m_TempTextBuf.GetWideString();
- if(str.IsEmpty()) {
- str = m_TextBuf.GetWideString();
- }
- if (str.IsEmpty() || str.GetAt(str.GetLength() - 1) == TEXT_BLANK_CHAR) {
- continue;
- }
- FX_FLOAT fontsize_h = pTextObj->m_TextState.GetFontSizeH();
- spacing = -fontsize_h * item.m_OriginX / 1000;
- continue;
- }
- FX_FLOAT charSpace = pTextObj->m_TextState.GetObject()->m_CharSpace;
- if (charSpace > 0.001) {
- spacing += matrix.TransformDistance(charSpace);
- } else if(charSpace < -0.001) {
- spacing -= matrix.TransformDistance(FXSYS_fabs(charSpace));
- }
- spacing -= baseSpace;
- if (spacing && i > 0) {
- int last_width = 0;
- FX_FLOAT fontsize_h = pTextObj->m_TextState.GetFontSizeH();
- FX_DWORD space_charcode = pFont->CharCodeFromUnicode(' ');
- FX_FLOAT threshold = 0;
- if (space_charcode != -1) {
- threshold = fontsize_h * pFont->GetCharWidthF(space_charcode) / 1000 ;
- }
- if (threshold > fontsize_h / 3) {
- threshold = 0;
- } else {
- threshold /= 2;
- }
- if (threshold == 0) {
- threshold = fontsize_h;
- int this_width = FXSYS_abs(GetCharWidth(item.m_CharCode, pFont));
- threshold = this_width > last_width ? (FX_FLOAT)this_width : (FX_FLOAT)last_width;
- int nDivide = 6;
- if (threshold < 300) {
- nDivide = 2;
- } else if (threshold < 500) {
- nDivide = 4;
- } else if (threshold < 700) {
- nDivide = 5;
- }
- threshold = threshold / nDivide;
- threshold = fontsize_h * threshold / 1000;
- }
- if (threshold && (spacing && spacing >= threshold) ) {
- charinfo.m_Unicode = TEXT_BLANK_CHAR;
- charinfo.m_Flag = FPDFTEXT_CHAR_GENERATED;
- charinfo.m_pTextObj = pTextObj;
- charinfo.m_Index = m_TextBuf.GetLength();
- m_TempTextBuf.AppendChar(TEXT_BLANK_CHAR);
- charinfo.m_CharCode = -1;
- charinfo.m_Matrix.Copy(formMatrix);
- matrix.Transform(item.m_OriginX, item.m_OriginY, charinfo.m_OriginX, charinfo.m_OriginY);
- charinfo.m_CharBox = CFX_FloatRect(charinfo.m_OriginX, charinfo.m_OriginY, charinfo.m_OriginX, charinfo.m_OriginY);
- m_TempCharList.Add(charinfo);
- }
- if (item.m_CharCode == (FX_DWORD) - 1) {
- continue;
- }
- }
- spacing = 0;
- CFX_WideString wstrItem = pFont->UnicodeFromCharCode(item.m_CharCode);
- FX_BOOL bNoUnicode = FALSE;
- FX_WCHAR wChar = wstrItem.GetAt(0);
- if ((wstrItem.IsEmpty() || wChar == 0) && item.m_CharCode) {
- if(wstrItem.IsEmpty()) {
- wstrItem += (FX_WCHAR)item.m_CharCode;
- } else {
- wstrItem.SetAt(0, (FX_WCHAR)item.m_CharCode);
- }
- bNoUnicode = TRUE;
- }
- charinfo.m_Index = -1;
- charinfo.m_CharCode = item.m_CharCode;
- if(bNoUnicode) {
- charinfo.m_Flag = FPDFTEXT_CHAR_UNUNICODE;
- } else {
- charinfo.m_Flag = FPDFTEXT_CHAR_NORMAL;
- }
- charinfo.m_pTextObj = pTextObj;
- charinfo.m_OriginX = 0, charinfo.m_OriginY = 0;
- matrix.Transform(item.m_OriginX, item.m_OriginY, charinfo.m_OriginX, charinfo.m_OriginY);
- FX_RECT rect(0, 0, 0, 0);
- rect.Intersect(0, 0, 0, 0);
- charinfo.m_pTextObj->GetFont()->GetCharBBox(charinfo.m_CharCode, rect);
- charinfo.m_CharBox.top = rect.top * pTextObj->GetFontSize() / 1000 + item.m_OriginY;
- charinfo.m_CharBox.left = rect.left * pTextObj->GetFontSize() / 1000 + item.m_OriginX;
- charinfo.m_CharBox.right = rect.right * pTextObj->GetFontSize() / 1000 + item.m_OriginX;
- charinfo.m_CharBox.bottom = rect.bottom * pTextObj->GetFontSize() / 1000 + item.m_OriginY;
- if (fabsf(charinfo.m_CharBox.top - charinfo.m_CharBox.bottom) < 0.01f) {
- charinfo.m_CharBox.top = charinfo.m_CharBox.bottom + pTextObj->GetFontSize();
- }
- if (fabsf(charinfo.m_CharBox.right - charinfo.m_CharBox.left) < 0.01f) {
- charinfo.m_CharBox.right = charinfo.m_CharBox.left + pTextObj->GetCharWidth(charinfo.m_CharCode);
- }
- matrix.TransformRect(charinfo.m_CharBox);
- charinfo.m_Matrix.Copy(matrix);
- if (wstrItem.IsEmpty()) {
- charinfo.m_Unicode = 0;
- m_TempCharList.Add(charinfo);
- m_TempTextBuf.AppendChar(0xfffe);
- continue;
- } else {
- int nTotal = wstrItem.GetLength();
- int n = 0;
- FX_BOOL bDel = FALSE;
- while (n < m_TempCharList.GetSize() && n < 7) {
- n++;
- PAGECHAR_INFO* charinfo1 = (PAGECHAR_INFO*)m_TempCharList.GetAt(m_TempCharList.GetSize() - n);
- if(charinfo1->m_CharCode == charinfo.m_CharCode &&
- charinfo1->m_pTextObj->GetFont() == charinfo.m_pTextObj->GetFont() &&
- FXSYS_fabs(charinfo1->m_OriginX - charinfo.m_OriginX) < TEXT_CHARRATIO_GAPDELTA * pTextObj->GetFontSize() &&
- FXSYS_fabs(charinfo1->m_OriginY - charinfo.m_OriginY) < TEXT_CHARRATIO_GAPDELTA * pTextObj->GetFontSize() ) {
- bDel = TRUE;
- break;
- }
- }
- if(!bDel) {
- for (int nIndex = 0; nIndex < nTotal; nIndex++) {
- charinfo.m_Unicode = wstrItem.GetAt(nIndex);
- if (charinfo.m_Unicode) {
- charinfo.m_Index = m_TextBuf.GetLength();
- m_TempTextBuf.AppendChar(charinfo.m_Unicode);
- } else {
- m_TempTextBuf.AppendChar(0xfffe);
- }
- m_TempCharList.Add(charinfo);
- }
- } else if(i == 0) {
- CFX_WideString str = m_TempTextBuf.GetWideString();
- if (!str.IsEmpty() && str.GetAt(str.GetLength() - 1) == TEXT_BLANK_CHAR) {
- m_TempTextBuf.Delete(m_TempTextBuf.GetLength() - 1, 1);
- m_TempCharList.Delete(m_TempCharList.GetSize() - 1);
- }
- }
- }
- }
-}
-FX_INT32 CPDF_TextPage::GetTextObjectWritingMode(const CPDF_TextObject* pTextObj)
-{
- FX_INT32 nChars = pTextObj->CountChars();
- if (nChars == 1) {
- return m_TextlineDir;
- }
- CPDF_TextObjectItem first, last;
- pTextObj->GetCharInfo(0, &first);
- pTextObj->GetCharInfo(nChars - 1, &last);
- CFX_Matrix textMatrix;
- pTextObj->GetTextMatrix(&textMatrix);
- textMatrix.TransformPoint(first.m_OriginX, first.m_OriginY);
- textMatrix.TransformPoint(last.m_OriginX, last.m_OriginY);
- FX_FLOAT dX = FXSYS_fabs(last.m_OriginX - first.m_OriginX);
- FX_FLOAT dY = FXSYS_fabs(last.m_OriginY - first.m_OriginY);
- if (dX <= 0.0001f && dY <= 0.0001f) {
- return -1;
- }
- CFX_VectorF v;
- v.Set(dX, dY);
- v.Normalize();
- if (v.y <= 0.0872f) {
- if (v.x <= 0.0872f) {
- return m_TextlineDir;
- }
- return 0;
- } else if (v.x <= 0.0872f) {
- return 1;
- }
- return m_TextlineDir;
-}
-FX_BOOL CPDF_TextPage::IsHyphen(FX_WCHAR curChar)
-{
- CFX_WideString strCurText = m_TempTextBuf.GetWideString();
- if(strCurText.GetLength() == 0) {
- strCurText = m_TextBuf.GetWideString();
- }
- FX_STRSIZE nCount = strCurText.GetLength();
- int nIndex = nCount - 1;
- FX_WCHAR wcTmp = strCurText.GetAt(nIndex);
- while(wcTmp == 0x20 && nIndex <= nCount - 1 && nIndex >= 0) {
- wcTmp = strCurText.GetAt(--nIndex);
- }
- if (0x2D == wcTmp || 0xAD == wcTmp) {
- if (--nIndex > 0) {
- FX_WCHAR preChar = strCurText.GetAt((nIndex));
- if (((preChar >= L'A' && preChar <= L'Z') || (preChar >= L'a' && preChar <= L'z'))
- && ((curChar >= L'A' && curChar <= L'Z') || (curChar >= L'a' && curChar <= L'z'))) {
- return TRUE;
- }
- }
- int size = m_TempCharList.GetSize();
- PAGECHAR_INFO preChar;
- if (size) {
- preChar = (PAGECHAR_INFO)m_TempCharList[size - 1];
- } else {
- size = m_charList.GetSize();
- if(size == 0) {
- return FALSE;
- }
- preChar = (PAGECHAR_INFO)m_charList[size - 1];
- }
- if (FPDFTEXT_CHAR_PIECE == preChar.m_Flag)
- if (0xAD == preChar.m_Unicode || 0x2D == preChar.m_Unicode) {
- return TRUE;
- }
- }
- return FALSE;
-}
-int CPDF_TextPage::ProcessInsertObject(const CPDF_TextObject* pObj, CFX_AffineMatrix formMatrix)
-{
- FindPreviousTextObject();
- FX_BOOL bNewline = FALSE;
- int WritingMode = GetTextObjectWritingMode(pObj);
- if(WritingMode == -1) {
- WritingMode = GetTextObjectWritingMode(m_pPreTextObj);
- }
- CFX_FloatRect this_rect(pObj->m_Left, pObj->m_Bottom, pObj->m_Right, pObj->m_Top);
- CFX_FloatRect prev_rect(m_pPreTextObj->m_Left, m_pPreTextObj->m_Bottom, m_pPreTextObj->m_Right, m_pPreTextObj->m_Top);
- CPDF_TextObjectItem PrevItem, item;
- int nItem = m_pPreTextObj->CountItems();
- m_pPreTextObj->GetItemInfo(nItem - 1, &PrevItem);
- pObj->GetItemInfo(0, &item);
- CFX_WideString wstrItem = pObj->GetFont()->UnicodeFromCharCode(item.m_CharCode);
- if(wstrItem.IsEmpty()) {
- wstrItem += (FX_WCHAR)item.m_CharCode;
- }
- FX_WCHAR curChar = wstrItem.GetAt(0);
- if(WritingMode == 0) {
- if(this_rect.Height() > 4.5 && prev_rect.Height() > 4.5) {
- FX_FLOAT top = this_rect.top < prev_rect.top ? this_rect.top : prev_rect.top;
- FX_FLOAT bottom = this_rect.bottom > prev_rect.bottom ? this_rect.bottom : prev_rect.bottom;
- if(bottom >= top) {
- if(IsHyphen(curChar)) {
- return 3;
- }
- return 2;
- }
- }
- } else if (WritingMode == 1) {
- if(this_rect.Width() > pObj->GetFontSize() * 0.1f && prev_rect.Width() > m_pPreTextObj->GetFontSize() * 0.1f) {
- FX_FLOAT left = this_rect.left > m_CurlineRect.left ? this_rect.left : m_CurlineRect.left;
- FX_FLOAT right = this_rect.right < m_CurlineRect.right ? this_rect.right : m_CurlineRect.right;
- if(right <= left) {
- if(IsHyphen(curChar)) {
- return 3;
- }
- return 2;
- }
- }
- }
- FX_FLOAT last_pos = PrevItem.m_OriginX;
- int nLastWidth = GetCharWidth(PrevItem.m_CharCode, m_pPreTextObj->GetFont());
- FX_FLOAT last_width = nLastWidth * m_pPreTextObj->GetFontSize() / 1000;
- last_width = FXSYS_fabs(last_width);
- int nThisWidth = GetCharWidth(item.m_CharCode, pObj->GetFont());
- FX_FLOAT this_width = nThisWidth * pObj->GetFontSize() / 1000;
- this_width = FXSYS_fabs(this_width);
- FX_FLOAT threshold = last_width > this_width ? last_width / 4 : this_width / 4;
- CFX_AffineMatrix prev_matrix, prev_reverse;
- m_pPreTextObj->GetTextMatrix(&prev_matrix);
- prev_matrix.Concat(m_perMatrix);
- prev_reverse.SetReverse(prev_matrix);
- FX_FLOAT x = pObj->GetPosX();
- FX_FLOAT y = pObj->GetPosY();
- formMatrix.Transform(x, y);
- prev_reverse.Transform(x, y);
- if(last_width < this_width) {
- threshold = prev_reverse.TransformDistance(threshold);
- }
- CFX_FloatRect rect1(m_pPreTextObj->m_Left, pObj->m_Bottom, m_pPreTextObj->m_Right, pObj->m_Top);
- CFX_FloatRect rect2(m_pPreTextObj->m_Left, m_pPreTextObj->m_Bottom, m_pPreTextObj->m_Right, m_pPreTextObj->m_Top);
- CFX_FloatRect rect3 = rect1;
- rect1.Intersect(rect2);
- if (WritingMode == 0) {
- if ((rect1.IsEmpty() && rect2.Height() > 5 && rect3.Height() > 5)
- || ((y > threshold * 2 || y < threshold * -3) && (FXSYS_fabs(y) < 1 ? FXSYS_fabs(x) < FXSYS_fabs(y) : TRUE))) {
- bNewline = TRUE;
- if(nItem > 1 ) {
- CPDF_TextObjectItem tempItem;
- m_pPreTextObj->GetItemInfo(0, &tempItem);
- CFX_AffineMatrix m;
- m_pPreTextObj->GetTextMatrix(&m);
- if(PrevItem.m_OriginX > tempItem.m_OriginX &&
- m_DisplayMatrix.a > 0.9 && m_DisplayMatrix.b < 0.1 &&
- m_DisplayMatrix.c < 0.1 && m_DisplayMatrix.d < -0.9
- && m.b < 0.1 && m.c < 0.1 ) {
- CFX_FloatRect re(0, m_pPreTextObj->m_Bottom, 1000, m_pPreTextObj->m_Top);
- if(re.Contains(pObj->GetPosX(), pObj->GetPosY())) {
- bNewline = FALSE;
- } else {
- CFX_FloatRect re(0, pObj->m_Bottom, 1000, pObj->m_Top);
- if(re.Contains(m_pPreTextObj->GetPosX(), m_pPreTextObj->GetPosY())) {
- bNewline = FALSE;
- }
- }
- }
- }
- }
- }
- if(bNewline) {
- if(IsHyphen(curChar)) {
- return 3;
- }
- return 2;
- }
- FX_INT32 nChars = pObj->CountChars();
- if (nChars == 1 && ( 0x2D == curChar || 0xAD == curChar))
- if (IsHyphen(curChar)) {
- return 3;
- }
- CFX_WideString PrevStr = m_pPreTextObj->GetFont()->UnicodeFromCharCode(PrevItem.m_CharCode);
- FX_WCHAR preChar = PrevStr.GetAt(PrevStr.GetLength() - 1);
- CFX_AffineMatrix matrix;
- pObj->GetTextMatrix(&matrix);
- matrix.Concat(formMatrix);
- threshold = (FX_FLOAT)(nLastWidth > nThisWidth ? nLastWidth : nThisWidth);
- threshold = threshold > 400 ? (threshold < 700 ? threshold / 4 : (threshold > 800 ? threshold / 6 : threshold / 5)) : (threshold / 2);
- if(nLastWidth >= nThisWidth) {
- threshold *= FXSYS_fabs(m_pPreTextObj->GetFontSize());
- } else {
- threshold *= FXSYS_fabs(pObj->GetFontSize());
- threshold = matrix.TransformDistance(threshold);
- threshold = prev_reverse.TransformDistance(threshold);
- }
- threshold /= 1000;
- if((threshold < 1.4881 && threshold > 1.4879)
- || (threshold < 1.39001 && threshold > 1.38999)) {
- threshold *= 1.5;
- }
- if (FXSYS_fabs(last_pos + last_width - x) > threshold && curChar != L' ' && preChar != L' ')
- if (curChar != L' ' && preChar != L' ') {
- if((x - last_pos - last_width) > threshold || (last_pos - x - last_width) > threshold) {
- return 1;
- }
- if(x < 0 && (last_pos - x - last_width) > threshold) {
- return 1;
- }
- if((x - last_pos - last_width) > this_width || (x - last_pos - this_width) > last_width ) {
- return 1;
- }
- }
- return 0;
-}
-FX_BOOL CPDF_TextPage::IsSameTextObject(CPDF_TextObject* pTextObj1, CPDF_TextObject* pTextObj2)
-{
- if (!pTextObj1 || !pTextObj2) {
- return FALSE;
- }
- CFX_FloatRect rcPreObj(pTextObj2->m_Left, pTextObj2->m_Bottom, pTextObj2->m_Right, pTextObj2->m_Top);
- CFX_FloatRect rcCurObj(pTextObj1->m_Left, pTextObj1->m_Bottom, pTextObj1->m_Right, pTextObj1->m_Top);
- if (rcPreObj.IsEmpty() && rcCurObj.IsEmpty() && !m_ParseOptions.m_bGetCharCodeOnly) {
- FX_FLOAT dbXdif = FXSYS_fabs(rcPreObj.left - rcCurObj.left);
- int nCount = m_charList.GetSize();
- if (nCount >= 2) {
- PAGECHAR_INFO perCharTemp = (PAGECHAR_INFO)m_charList[nCount - 2];
- FX_FLOAT dbSpace = perCharTemp.m_CharBox.Width();
- if (dbXdif > dbSpace) {
- return FALSE;
- }
- }
- }
- if (!rcPreObj.IsEmpty() || !rcCurObj.IsEmpty()) {
- rcPreObj.Intersect(rcCurObj);
- if (rcPreObj.IsEmpty()) {
- return FALSE;
- }
- if (FXSYS_fabs(rcPreObj.Width() - rcCurObj.Width()) > rcCurObj.Width() / 2) {
- return FALSE;
- }
- if (pTextObj2->GetFontSize() != pTextObj1->GetFontSize()) {
- return FALSE;
- }
- }
- int nPreCount = pTextObj2->CountItems();
- int nCurCount = pTextObj1->CountItems();
- if (nPreCount != nCurCount) {
- return FALSE;
- }
- CPDF_TextObjectItem itemPer, itemCur;
- for (int i = 0; i < nPreCount; i++) {
- pTextObj2->GetItemInfo(i, &itemPer);
- pTextObj1->GetItemInfo(i, &itemCur);
- if (itemCur.m_CharCode != itemPer.m_CharCode) {
- return FALSE;
- }
- }
- if(FXSYS_fabs(pTextObj1->GetPosX() - pTextObj2->GetPosX()) > GetCharWidth(itemPer.m_CharCode, pTextObj2->GetFont())*pTextObj2->GetFontSize() / 1000 * 0.9 ||
- FXSYS_fabs(pTextObj1->GetPosY() - pTextObj2->GetPosY()) >
- FX_MAX(FX_MAX(rcPreObj.Height() , rcPreObj.Width()), pTextObj2->GetFontSize()) / 8) {
- return FALSE;
- }
- return TRUE;
-}
-FX_BOOL CPDF_TextPage::IsSameAsPreTextObject(CPDF_TextObject* pTextObj, FX_POSITION ObjPos)
-{
- if (!pTextObj) {
- return FALSE;
- }
- int i = 0;
- if (!ObjPos) {
- ObjPos = m_pPage->GetLastObjectPosition();
- }
- CPDF_PageObject* pObj = m_pPage->GetPrevObject(ObjPos);
- while (i < 5 && ObjPos) {
- pObj = m_pPage->GetPrevObject(ObjPos);
- if(pObj == pTextObj) {
- continue;
- }
- if(pObj->m_Type != PDFPAGE_TEXT) {
- continue;
- }
- if(IsSameTextObject((CPDF_TextObject*)pObj, pTextObj)) {
- return TRUE;
- }
- i++;
- }
- return FALSE;
-}
-FX_BOOL CPDF_TextPage::GenerateCharInfo(FX_WCHAR unicode, PAGECHAR_INFO& info)
-{
- int size = m_TempCharList.GetSize();
- PAGECHAR_INFO preChar;
- if (size) {
- preChar = (PAGECHAR_INFO)m_TempCharList[size - 1];
- } else {
- size = m_charList.GetSize();
- if(size == 0) {
- return FALSE;
- }
- preChar = (PAGECHAR_INFO)m_charList[size - 1];
- }
- info.m_Index = m_TextBuf.GetLength();
- info.m_Unicode = unicode;
- info.m_pTextObj = NULL;
- info.m_CharCode = -1;
- info.m_Flag = FPDFTEXT_CHAR_GENERATED;
- int preWidth = 0;
- if (preChar.m_pTextObj && preChar.m_CharCode != (FX_DWORD) - 1) {
- preWidth = GetCharWidth(preChar.m_CharCode, preChar.m_pTextObj->GetFont());
- }
- FX_FLOAT fs = 0;
- if(preChar.m_pTextObj) {
- fs = preChar.m_pTextObj->GetFontSize();
- } else {
- fs = preChar.m_CharBox.Height();
- }
- if(!fs) {
- fs = 1;
- }
- info.m_OriginX = preChar.m_OriginX + preWidth * (fs) / 1000;
- info.m_OriginY = preChar.m_OriginY;
- info.m_CharBox = CFX_FloatRect(info.m_OriginX, info.m_OriginY, info.m_OriginX, info.m_OriginY);
- return TRUE;
-}
-FX_BOOL CPDF_TextPage::IsRectIntersect(CFX_FloatRect rect1, CFX_FloatRect rect2)
-{
- rect1.Intersect(rect2);
- if(rect1.IsEmpty()) {
- return FALSE;
- }
- return TRUE;
-}
-FX_BOOL CPDF_TextPage::IsLetter(FX_WCHAR unicode)
-{
- if (unicode < L'A') {
- return FALSE;
- }
- if (unicode > L'Z' && unicode < L'a') {
- return FALSE;
- }
- if (unicode > L'z') {
- return FALSE;
- }
- return TRUE;
-}
-CPDF_TextPageFind::CPDF_TextPageFind(const IPDF_TextPage* pTextPage)
- : m_IsFind(FALSE),
- m_pTextPage(NULL)
-{
- if (!pTextPage) {
- return;
- }
- CPDF_ModuleMgr* pPDFModule = CPDF_ModuleMgr::Get();
- m_pTextPage = pTextPage;
- m_strText = m_pTextPage->GetPageText();
- int nCount = pTextPage->CountChars();
- if(nCount) {
- m_CharIndex.Add(0);
- }
- for(int i = 0; i < nCount; i++) {
- FPDF_CHAR_INFO info;
- pTextPage->GetCharInfo(i, info);
- int indexSize = m_CharIndex.GetSize();
- if(info.m_Flag == CHAR_NORMAL || info.m_Flag == CHAR_GENERATED) {
- if(indexSize % 2) {
- m_CharIndex.Add(1);
- } else {
- if(indexSize <= 0) {
- continue;
- }
- m_CharIndex.SetAt(indexSize - 1, m_CharIndex.GetAt(indexSize - 1) + 1);
- }
- } else {
- if(indexSize % 2) {
- if(indexSize <= 0) {
- continue;
- }
- m_CharIndex.SetAt(indexSize - 1, i + 1);
- } else {
- m_CharIndex.Add(i + 1);
- }
- }
- }
- int indexSize = m_CharIndex.GetSize();
- if(indexSize % 2) {
- m_CharIndex.RemoveAt(indexSize - 1);
- }
- m_resStart = 0;
- m_resEnd = -1;
-}
-int CPDF_TextPageFind::GetCharIndex(int index) const
-{
- return m_pTextPage->CharIndexFromTextIndex(index);
- int indexSize = m_CharIndex.GetSize();
- int count = 0;
- for(int i = 0; i < indexSize; i += 2) {
- count += m_CharIndex.GetAt(i + 1);
- if(count > index) {
- return index - count + m_CharIndex.GetAt(i + 1) + m_CharIndex.GetAt(i);
- }
- }
- return -1;
-}
-FX_BOOL CPDF_TextPageFind::FindFirst(CFX_WideString findwhat, int flags, int startPos)
-{
- if (!m_pTextPage) {
- return FALSE;
- }
- if (m_strText.IsEmpty() || m_bMatchCase != (flags & FPDFTEXT_MATCHCASE)) {
- m_strText = m_pTextPage->GetPageText();
- }
- m_findWhat = findwhat;
- m_flags = flags;
- m_bMatchCase = flags & FPDFTEXT_MATCHCASE;
- if (m_strText.IsEmpty()) {
- m_IsFind = FALSE;
- return TRUE;
- }
- FX_STRSIZE len = findwhat.GetLength();
- if (!m_bMatchCase) {
- findwhat.MakeLower();
- m_strText.MakeLower();
- }
- m_bMatchWholeWord = flags & FPDFTEXT_MATCHWHOLEWORD;
- m_findNextStart = startPos;
- if (startPos == -1) {
- m_findPreStart = m_strText.GetLength() - 1;
- } else {
- m_findPreStart = startPos;
- }
- m_csFindWhatArray.RemoveAll();
- int i = 0;
- while(i < len) {
- if(findwhat.GetAt(i) != ' ') {
- break;
- }
- i++;
- }
- if(i < len) {
- ExtractFindWhat(findwhat);
- } else {
- m_csFindWhatArray.Add(findwhat);
- }
- if(m_csFindWhatArray.GetSize() <= 0) {
- return FALSE;
- }
- m_IsFind = TRUE;
- m_resStart = 0;
- m_resEnd = -1;
- return TRUE;
-}
-FX_BOOL CPDF_TextPageFind::FindNext()
-{
- if (!m_pTextPage) {
- return FALSE;
- }
- m_resArray.RemoveAll();
- if(m_findNextStart == -1) {
- return FALSE;
- }
- if(m_strText.IsEmpty()) {
- m_IsFind = FALSE;
- return m_IsFind;
- }
- int strLen = m_strText.GetLength();
- if (m_findNextStart > strLen - 1) {
- m_IsFind = FALSE;
- return m_IsFind;
- }
- int nCount = m_csFindWhatArray.GetSize();
- int nResultPos = 0;
- int nStartPos = 0;
- nStartPos = m_findNextStart;
- FX_BOOL bSpaceStart = FALSE;
- for(int iWord = 0; iWord < nCount; iWord++) {
- CFX_WideString csWord = m_csFindWhatArray[iWord];
- if(csWord.IsEmpty()) {
- if(iWord == nCount - 1) {
- FX_WCHAR strInsert = m_strText.GetAt(nStartPos);
- if(strInsert == TEXT_LINEFEED_CHAR || strInsert == TEXT_BLANK_CHAR || strInsert == TEXT_RETURN_CHAR || strInsert == 160) {
- nResultPos = nStartPos + 1;
- break;
- }
- iWord = -1;
- } else if(iWord == 0) {
- bSpaceStart = TRUE;
- }
- continue;
- }
- int endIndex;
- nResultPos = m_strText.Find(csWord, nStartPos);
- if (nResultPos == -1) {
- m_IsFind = FALSE;
- return m_IsFind;
- }
- endIndex = nResultPos + csWord.GetLength() - 1;
- if(iWord == 0) {
- m_resStart = nResultPos;
- }
- FX_BOOL bMatch = TRUE;
- if(iWord != 0 && !bSpaceStart) {
- int PreResEndPos = nStartPos;
- int curChar = csWord.GetAt(0);
- CFX_WideString lastWord = m_csFindWhatArray[iWord - 1];
- int lastChar = lastWord.GetAt(lastWord.GetLength() - 1);
- if(nStartPos == nResultPos && !(_IsIgnoreSpaceCharacter(lastChar) || _IsIgnoreSpaceCharacter(curChar))) {
- bMatch = FALSE;
- }
- for(int d = PreResEndPos; d < nResultPos; d++) {
- FX_WCHAR strInsert = m_strText.GetAt(d);
- if(strInsert != TEXT_LINEFEED_CHAR && strInsert != TEXT_BLANK_CHAR && strInsert != TEXT_RETURN_CHAR && strInsert != 160) {
- bMatch = FALSE;
- break;
- }
- }
- } else if(bSpaceStart) {
- if(nResultPos > 0) {
- FX_WCHAR strInsert = m_strText.GetAt(nResultPos - 1);
- if(strInsert != TEXT_LINEFEED_CHAR && strInsert != TEXT_BLANK_CHAR && strInsert != TEXT_RETURN_CHAR && strInsert != 160) {
- bMatch = FALSE;
- m_resStart = nResultPos;
- } else {
- m_resStart = nResultPos - 1;
- }
- }
- }
- if(m_bMatchWholeWord && bMatch) {
- bMatch = IsMatchWholeWord(m_strText, nResultPos, endIndex);
- }
- nStartPos = endIndex + 1;
- if(!bMatch) {
- iWord = -1;
- if(bSpaceStart) {
- nStartPos = m_resStart + m_csFindWhatArray[1].GetLength();
- } else {
- nStartPos = m_resStart + m_csFindWhatArray[0].GetLength();
- }
- }
- }
- m_resEnd = nResultPos + m_csFindWhatArray[m_csFindWhatArray.GetSize() - 1].GetLength() - 1;
- m_IsFind = TRUE;
- int resStart = GetCharIndex(m_resStart);
- int resEnd = GetCharIndex(m_resEnd);
- m_pTextPage->GetRectArray(resStart, resEnd - resStart + 1, m_resArray);
- if(m_flags & FPDFTEXT_CONSECUTIVE) {
- m_findNextStart = m_resStart + 1;
- m_findPreStart = m_resEnd - 1;
- } else {
- m_findNextStart = m_resEnd + 1;
- m_findPreStart = m_resStart - 1;
- }
- return m_IsFind;
-}
-FX_BOOL CPDF_TextPageFind::FindPrev()
-{
- if (!m_pTextPage) {
- return FALSE;
- }
- m_resArray.RemoveAll();
- if(m_strText.IsEmpty() || m_findPreStart < 0) {
- m_IsFind = FALSE;
- return m_IsFind;
- }
- CPDF_TextPageFind findEngine(m_pTextPage);
- FX_BOOL ret = findEngine.FindFirst(m_findWhat, m_flags);
- if(!ret) {
- m_IsFind = FALSE;
- return m_IsFind;
- }
- int order = -1, MatchedCount = 0;
- while(ret) {
- ret = findEngine.FindNext();
- if(ret) {
- int order1 = findEngine.GetCurOrder() ;
- int MatchedCount1 = findEngine.GetMatchedCount();
- if(((order1 + MatchedCount1) - 1) > m_findPreStart) {
- break;
- }
- order = order1;
- MatchedCount = MatchedCount1;
- }
- }
- if(order == -1) {
- m_IsFind = FALSE;
- return m_IsFind;
- }
- m_resStart = m_pTextPage->TextIndexFromCharIndex(order);
- m_resEnd = m_pTextPage->TextIndexFromCharIndex(order + MatchedCount - 1);
- m_IsFind = TRUE;
- m_pTextPage->GetRectArray(order, MatchedCount, m_resArray);
- if(m_flags & FPDFTEXT_CONSECUTIVE) {
- m_findNextStart = m_resStart + 1;
- m_findPreStart = m_resEnd - 1;
- } else {
- m_findNextStart = m_resEnd + 1;
- m_findPreStart = m_resStart - 1;
- }
- return m_IsFind;
-}
-void CPDF_TextPageFind::ExtractFindWhat(CFX_WideString findwhat)
-{
- if(findwhat.IsEmpty()) {
- return ;
- }
- int index = 0;
- while(1) {
- CFX_WideString csWord = TEXT_EMPTY;
- int ret = ExtractSubString(csWord, findwhat, index, TEXT_BLANK_CHAR);
- if(csWord.IsEmpty()) {
- if(ret) {
- m_csFindWhatArray.Add(CFX_WideString(L""));
- index++;
- continue;
- } else {
- break;
- }
- }
- int pos = 0;
- FX_BOOL bLastIgnore = FALSE;
- while(pos < csWord.GetLength()) {
- CFX_WideString curStr = csWord.Mid(pos, 1);
- FX_WCHAR curChar = csWord.GetAt(pos);
- if (_IsIgnoreSpaceCharacter(curChar)) {
- if (pos > 0 && curChar == 0x2019) {
- pos++;
- continue;
- }
- if (pos > 0 ) {
- CFX_WideString preStr = csWord.Mid(0, pos);
- m_csFindWhatArray.Add(preStr);
- }
- m_csFindWhatArray.Add(curStr);
- if (pos == csWord.GetLength() - 1) {
- csWord.Empty();
- break;
- }
- csWord = csWord.Right(csWord.GetLength() - pos - 1);
- pos = 0;
- bLastIgnore = TRUE;
- continue;
- } else {
- bLastIgnore = FALSE;
- }
- pos++;
- }
- if (!csWord.IsEmpty()) {
- m_csFindWhatArray.Add(csWord);
- }
- index++;
- }
- return;
-}
-FX_BOOL CPDF_TextPageFind::IsMatchWholeWord(CFX_WideString csPageText, int startPos, int endPos)
-{
- int char_left = 0;
- int char_right = 0;
- int char_count = endPos - startPos + 1;
- if(char_count < 1) {
- return FALSE;
- }
- if (char_count == 1 && csPageText.GetAt(startPos) > 255) {
- return TRUE;
- }
- if(startPos - 1 >= 0 ) {
- char_left = csPageText.GetAt(startPos - 1);
- }
- if(startPos + char_count < csPageText.GetLength()) {
- char_right = csPageText.GetAt(startPos + char_count);
- }
- if(char_left == 0x61) {
- int a = 0;
- }
- if ((char_left > 'A' && char_left < 'a') || (char_left > 'a' && char_left < 'z') || (char_left > 0xfb00 && char_left < 0xfb06) || (char_left >= '0' && char_left <= '9') ||
- (char_right > 'A' && char_right < 'a') || (char_right > 'a' && char_right < 'z') || (char_right > 0xfb00 && char_right < 0xfb06) || (char_right >= '0' && char_right <= '9')) {
- return FALSE;
- }
- if(!(('A' > char_left || char_left > 'Z') && ('a' > char_left || char_left > 'z')
- && ('A' > char_right || char_right > 'Z') && ('a' > char_right || char_right > 'z'))) {
- return FALSE;
- }
- if (char_count > 0) {
- if (csPageText.GetAt(startPos) >= L'0' && csPageText.GetAt(startPos) <= L'9' && char_left >= L'0' && char_left <= L'9') {
- return FALSE;
- }
- if (csPageText.GetAt(endPos) >= L'0' && csPageText.GetAt(endPos) <= L'9' && char_right >= L'0' && char_right <= L'9') {
- return FALSE;
- }
- }
- return TRUE;
-}
-FX_BOOL CPDF_TextPageFind::ExtractSubString(CFX_WideString& rString, FX_LPCWSTR lpszFullString,
- int iSubString, FX_WCHAR chSep)
-{
- if (lpszFullString == NULL) {
- return FALSE;
- }
- while (iSubString--) {
- lpszFullString = FXSYS_wcschr(lpszFullString, chSep);
- if (lpszFullString == NULL) {
- rString.Empty();
- return FALSE;
- }
- lpszFullString++;
- while(*lpszFullString == chSep) {
- lpszFullString++;
- }
- }
- FX_LPCWSTR lpchEnd = FXSYS_wcschr(lpszFullString, chSep);
- int nLen = (lpchEnd == NULL) ?
- (int)FXSYS_wcslen(lpszFullString) : (int)(lpchEnd - lpszFullString);
- ASSERT(nLen >= 0);
- FXSYS_memcpy32(rString.GetBuffer(nLen), lpszFullString, nLen * sizeof(FX_WCHAR));
- rString.ReleaseBuffer();
- return TRUE;
-}
-CFX_WideString CPDF_TextPageFind::MakeReverse(const CFX_WideString str)
-{
- CFX_WideString str2;
- str2.Empty();
- int nlen = str.GetLength();
- for(int i = nlen - 1; i >= 0; i--) {
- str2 += str.GetAt(i);
- }
- return str2;
-}
-void CPDF_TextPageFind::GetRectArray(CFX_RectArray& rects) const
-{
- rects.Copy(m_resArray);
-}
-int CPDF_TextPageFind::GetCurOrder() const
-{
- return GetCharIndex(m_resStart);
-}
-int CPDF_TextPageFind::GetMatchedCount()const
-{
- int resStart = GetCharIndex(m_resStart);
- int resEnd = GetCharIndex(m_resEnd);
- return resEnd - resStart + 1;
-}
-CPDF_LinkExtract::CPDF_LinkExtract()
- : m_pTextPage(NULL),
- m_IsParserd(FALSE)
-{
-}
-CPDF_LinkExtract::~CPDF_LinkExtract()
-{
- DeleteLinkList();
-}
-FX_BOOL CPDF_LinkExtract::ExtractLinks(const IPDF_TextPage* pTextPage)
-{
- if (!pTextPage || !pTextPage->IsParsered()) {
- return FALSE;
- }
- m_pTextPage = (const CPDF_TextPage*)pTextPage;
- m_strPageText = m_pTextPage->GetPageText(0, -1);
- DeleteLinkList();
- if (m_strPageText.IsEmpty()) {
- return FALSE;
- }
- parserLink();
- m_IsParserd = TRUE;
- return TRUE;
-}
-void CPDF_LinkExtract::DeleteLinkList()
-{
- while (m_LinkList.GetSize()) {
- CPDF_LinkExt* linkinfo = NULL;
- linkinfo = m_LinkList.GetAt(0);
- m_LinkList.RemoveAt(0);
- delete linkinfo;
- }
- m_LinkList.RemoveAll();
-}
-int CPDF_LinkExtract::CountLinks() const
-{
- if (!m_IsParserd) {
- return -1;
- }
- return m_LinkList.GetSize();
-}
-void CPDF_LinkExtract::parserLink()
-{
- int start = 0, pos = 0;
- int TotalChar = m_pTextPage->CountChars();
- while (pos < TotalChar) {
- FPDF_CHAR_INFO pageChar;
- m_pTextPage->GetCharInfo(pos, pageChar);
- if (pageChar.m_Flag == CHAR_GENERATED || pageChar.m_Unicode == 0x20 || pos == TotalChar - 1) {
- int nCount = pos - start;
- if(pos == TotalChar - 1) {
- nCount++;
- }
- CFX_WideString strBeCheck;
- strBeCheck = m_pTextPage->GetPageText(start, nCount);
- if (strBeCheck.GetLength() > 5) {
- while(strBeCheck.GetLength() > 0) {
- FX_WCHAR ch = strBeCheck.GetAt(strBeCheck.GetLength() - 1);
- if (ch == L')' || ch == L',' || ch == L'>' || ch == L'.') {
- strBeCheck = strBeCheck.Mid(0, strBeCheck.GetLength() - 1);
- nCount--;
- } else {
- break;
- }
- }
- if (nCount > 5 && (CheckWebLink(strBeCheck) || CheckMailLink(strBeCheck))) {
- if (!AppendToLinkList(start, nCount, strBeCheck)) {
- break;
- }
- }
- }
- start = ++pos;
- } else {
- pos++;
- }
- }
-}
-FX_BOOL CPDF_LinkExtract::CheckWebLink(CFX_WideString& strBeCheck)
-{
- CFX_WideString str = strBeCheck;
- str.MakeLower();
- if (str.Find(L"http://www.") != -1) {
- strBeCheck = strBeCheck.Right(str.GetLength() - str.Find(L"http://www."));
- return TRUE;
- } else if (str.Find(L"http://") != -1) {
- strBeCheck = strBeCheck.Right(str.GetLength() - str.Find(L"http://"));
- return TRUE;
- } else if (str.Find(L"https://www.") != -1) {
- strBeCheck = strBeCheck.Right(str.GetLength() - str.Find(L"https://www."));
- return TRUE;
- } else if (str.Find(L"https://") != -1) {
- strBeCheck = strBeCheck.Right(str.GetLength() - str.Find(L"https://"));
- return TRUE;
- } else if (str.Find(L"www.") != -1) {
- strBeCheck = strBeCheck.Right(str.GetLength() - str.Find(L"www."));
- strBeCheck = L"http://" + strBeCheck;
- return TRUE;
- } else {
- return FALSE;
- }
-}
-FX_BOOL CPDF_LinkExtract::CheckMailLink(CFX_WideString& str)
-{
- str.MakeLower();
- int aPos = str.Find(L'@');
- if (aPos < 1) {
- return FALSE;
- }
- if (str.GetAt(aPos - 1) == L'.' || str.GetAt(aPos - 1) == L'_') {
- return FALSE;
- }
- int i;
- for (i = aPos - 1; i >= 0; i--) {
- FX_WCHAR ch = str.GetAt(i);
- if (ch == L'_' || ch == L'.' || (ch >= L'a' && ch <= L'z') || (ch >= L'0' && ch <= L'9')) {
- continue;
- } else {
- if (i == aPos - 1) {
- return FALSE;
- }
- str = str.Right(str.GetLength() - i - 1);
- break;
- }
- }
- aPos = str.Find(L'@');
- if (aPos < 1) {
- return FALSE;
- }
- CFX_WideString strtemp = L"";
- for (i = 0; i < aPos; i++) {
- FX_WCHAR wch = str.GetAt(i);
- if (wch >= L'a' && wch <= L'z') {
- break;
- } else {
- strtemp = str.Right(str.GetLength() - i + 1);
- }
- }
- if (strtemp != L"") {
- str = strtemp;
- }
- aPos = str.Find(L'@');
- if (aPos < 1) {
- return FALSE;
- }
- str.TrimRight(L'.');
- strtemp = str;
- int ePos = str.Find(L'.');
- if (ePos == -1) {
- return FALSE;
- }
- while (ePos != -1) {
- strtemp = strtemp.Right(strtemp.GetLength() - ePos - 1);
- ePos = strtemp.Find('.');
- }
- ePos = strtemp.GetLength();
- for (i = 0; i < ePos; i++) {
- FX_WCHAR wch = str.GetAt(i);
- if ((wch >= L'a' && wch <= L'z') || (wch >= L'0' && wch <= L'9')) {
- continue;
- } else {
- str = str.Left(str.GetLength() - ePos + i + 1);
- ePos = ePos - i - 1;
- break;
- }
- }
- int nLen = str.GetLength();
- for (i = aPos + 1; i < nLen - ePos; i++) {
- FX_WCHAR wch = str.GetAt(i);
- if (wch == L'-' || wch == L'.' || (wch >= L'a' && wch <= L'z') || (wch >= L'0' && wch <= L'9')) {
- continue;
- } else {
- return FALSE;
- }
- }
- if (str.Find(L"mailto:") == -1) {
- str = L"mailto:" + str;
- }
- return TRUE;
-}
-FX_BOOL CPDF_LinkExtract::AppendToLinkList(int start, int count, CFX_WideString strUrl)
-{
- CPDF_LinkExt* linkInfo = NULL;
- linkInfo = FX_NEW CPDF_LinkExt;
- if (!linkInfo) {
- return FALSE;
- }
- linkInfo->m_strUrl = strUrl;
- linkInfo->m_Start = start;
- linkInfo->m_Count = count;
- m_LinkList.Add(linkInfo);
- return TRUE;
-}
-CFX_WideString CPDF_LinkExtract::GetURL(int index) const
-{
- if (!m_IsParserd || index < 0 || index >= m_LinkList.GetSize()) {
- return L"";
- }
- CPDF_LinkExt* link = NULL;
- link = m_LinkList.GetAt(index);
- if (!link) {
- return L"";
- }
- return link->m_strUrl;
-}
-void CPDF_LinkExtract::GetBoundedSegment(int index, int& start, int& count) const
-{
- if (!m_IsParserd || index < 0 || index >= m_LinkList.GetSize()) {
- return ;
- }
- CPDF_LinkExt* link = NULL;
- link = m_LinkList.GetAt(index);
- if (!link) {
- return ;
- }
- start = link->m_Start;
- count = link->m_Count;
-}
-void CPDF_LinkExtract::GetRects(int index, CFX_RectArray& rects) const
-{
- if (!m_IsParserd || index < 0 || index >= m_LinkList.GetSize()) {
- return;
- }
- CPDF_LinkExt* link = NULL;
- link = m_LinkList.GetAt(index);
- if (!link) {
- return ;
- }
- m_pTextPage->GetRectArray(link->m_Start, link->m_Count, rects);
-}
+// 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
+
+#include "../../include/fpdfapi/fpdf_resource.h"
+#include "../../include/fpdfapi/fpdf_pageobj.h"
+#include "../../include/fpdftext/fpdf_text.h"
+#include "../../include/fpdfapi/fpdf_page.h"
+#include "../../include/fpdfapi/fpdf_module.h"
+#include <ctype.h>
+#include "text_int.h"
+FX_BOOL _IsIgnoreSpaceCharacter(FX_WCHAR curChar)
+{
+ if(curChar < 255 ) {
+ return FALSE;
+ }
+ if ( (curChar >= 0x0600 && curChar <= 0x06FF)
+ || (curChar >= 0xFE70 && curChar <= 0xFEFF)
+ || (curChar >= 0xFB50 && curChar <= 0xFDFF)
+ || (curChar >= 0x0400 && curChar <= 0x04FF)
+ || (curChar >= 0x0500 && curChar <= 0x052F)
+ || (curChar >= 0xA640 && curChar <= 0xA69F)
+ || (curChar >= 0x2DE0 && curChar <= 0x2DFF)
+ || curChar == 8467
+ || (curChar >= 0x2000 && curChar <= 0x206F)) {
+ return FALSE;
+ }
+ return TRUE;
+}
+CPDFText_ParseOptions::CPDFText_ParseOptions()
+ : m_bGetCharCodeOnly(FALSE), m_bNormalizeObjs(TRUE), m_bOutputHyphen(FALSE)
+{
+}
+IPDF_TextPage* IPDF_TextPage::CreateTextPage(const CPDF_Page* pPage, CPDFText_ParseOptions ParserOptions)
+{
+ CPDF_TextPage* pTextPageEx = FX_NEW CPDF_TextPage(pPage, ParserOptions);
+ return pTextPageEx;
+}
+IPDF_TextPage* IPDF_TextPage::CreateTextPage(const CPDF_Page* pPage, int flags)
+{
+ CPDF_TextPage* pTextPage = FX_NEW CPDF_TextPage(pPage, flags);
+ return pTextPage;
+}
+IPDF_TextPage* IPDF_TextPage::CreateTextPage(const CPDF_PageObjects* pObjs, int flags)
+{
+ CPDF_TextPage* pTextPage = FX_NEW CPDF_TextPage(pObjs, flags);
+ return pTextPage;
+}
+IPDF_TextPageFind* IPDF_TextPageFind::CreatePageFind(const IPDF_TextPage* pTextPage)
+{
+ if (!pTextPage) {
+ return NULL;
+ }
+ return FX_NEW CPDF_TextPageFind(pTextPage);
+}
+IPDF_LinkExtract* IPDF_LinkExtract::CreateLinkExtract()
+{
+ return FX_NEW CPDF_LinkExtract();
+}
+#define TEXT_BLANK_CHAR L' '
+#define TEXT_LINEFEED_CHAR L'\n'
+#define TEXT_RETURN_CHAR L'\r'
+#define TEXT_EMPTY L""
+#define TEXT_BLANK L" "
+#define TEXT_RETURN_LINEFEED L"\r\n"
+#define TEXT_LINEFEED L"\n"
+#define TEXT_CHARRATIO_GAPDELTA 0.070
+CPDF_TextPage::CPDF_TextPage(const CPDF_Page* pPage, int flags)
+ : m_pPreTextObj(NULL),
+ m_IsParsered(FALSE),
+ m_charList(512),
+ m_TempCharList(50),
+ m_TextlineDir(-1),
+ m_CurlineRect(0, 0, 0, 0)
+{
+ m_pPage = pPage;
+ m_parserflag = flags;
+ m_TextBuf.EstimateSize(0, 10240);
+ pPage->GetDisplayMatrix(m_DisplayMatrix, 0, 0, (int) pPage->GetPageWidth(), (int)pPage->GetPageHeight(), 0);
+}
+CPDF_TextPage::CPDF_TextPage(const CPDF_Page* pPage, CPDFText_ParseOptions ParserOptions)
+ : m_pPreTextObj(NULL)
+ , m_IsParsered(FALSE)
+ , m_charList(512)
+ , m_TempCharList(50)
+ , m_TextlineDir(-1)
+ , m_CurlineRect(0, 0, 0, 0)
+ , m_ParseOptions(ParserOptions)
+{
+ m_pPage = pPage;
+ m_parserflag = 0;
+ m_TextBuf.EstimateSize(0, 10240);
+ pPage->GetDisplayMatrix(m_DisplayMatrix, 0, 0, (int) pPage->GetPageWidth(), (int)pPage->GetPageHeight(), 0);
+}
+CPDF_TextPage::CPDF_TextPage(const CPDF_PageObjects* pPage, int flags)
+ : m_pPreTextObj(NULL),
+ m_IsParsered(FALSE),
+ m_charList(512),
+ m_TempCharList(50),
+ m_TextlineDir(-1),
+ m_CurlineRect(0, 0, 0, 0)
+{
+ m_pPage = pPage;
+ m_parserflag = flags;
+ m_TextBuf.EstimateSize(0, 10240);
+ CFX_FloatRect pageRect = pPage->CalcBoundingBox();
+ m_DisplayMatrix = CFX_AffineMatrix(1, 0, 0, -1, pageRect.right, pageRect.top);
+}
+void CPDF_TextPage::NormalizeObjects(FX_BOOL bNormalize)
+{
+ m_ParseOptions.m_bNormalizeObjs = bNormalize;
+}
+FX_BOOL CPDF_TextPage::IsControlChar(PAGECHAR_INFO* pCharInfo)
+{
+ if(!pCharInfo) {
+ return FALSE;
+ }
+ switch(pCharInfo->m_Unicode) {
+ case 0x2:
+ case 0x3:
+ case 0x93:
+ case 0x94:
+ case 0x96:
+ case 0x97:
+ case 0x98:
+ case 0xfffe:
+ if(pCharInfo->m_Flag == FPDFTEXT_CHAR_HYPHEN) {
+ return FALSE;
+ } else {
+ return TRUE;
+ }
+ default:
+ return FALSE;
+ }
+}
+FX_BOOL CPDF_TextPage::ParseTextPage()
+{
+ if (!m_pPage) {
+ m_IsParsered = FALSE;
+ return FALSE;
+ }
+ m_IsParsered = FALSE;
+ m_TextBuf.Clear();
+ m_charList.RemoveAll();
+ m_pPreTextObj = NULL;
+ ProcessObject();
+ m_IsParsered = TRUE;
+ if(!m_ParseOptions.m_bGetCharCodeOnly) {
+ m_CharIndex.RemoveAll();
+ int nCount = m_charList.GetSize();
+ if(nCount) {
+ m_CharIndex.Add(0);
+ }
+ for(int i = 0; i < nCount; i++) {
+ int indexSize = m_CharIndex.GetSize();
+ FX_BOOL bNormal = FALSE;
+ PAGECHAR_INFO charinfo = *(PAGECHAR_INFO*)m_charList.GetAt(i);
+ if(charinfo.m_Flag == FPDFTEXT_CHAR_GENERATED) {
+ bNormal = TRUE;
+ }
+#ifdef FOXIT_CHROME_BUILD
+ else if(charinfo.m_Unicode == 0 || IsControlChar(&charinfo))
+#else
+ else if(charinfo.m_Unicode == 0)
+#endif
+ bNormal = FALSE;
+ else {
+ bNormal = TRUE;
+ }
+ if(bNormal) {
+ if(indexSize % 2) {
+ m_CharIndex.Add(1);
+ } else {
+ if(indexSize <= 0) {
+ continue;
+ }
+ m_CharIndex.SetAt(indexSize - 1, m_CharIndex.GetAt(indexSize - 1) + 1);
+ }
+ } else {
+ if(indexSize % 2) {
+ if(indexSize <= 0) {
+ continue;
+ }
+ m_CharIndex.SetAt(indexSize - 1, i + 1);
+ } else {
+ m_CharIndex.Add(i + 1);
+ }
+ }
+ }
+ int indexSize = m_CharIndex.GetSize();
+ if(indexSize % 2) {
+ m_CharIndex.RemoveAt(indexSize - 1);
+ }
+ }
+ return TRUE;
+}
+int CPDF_TextPage::CountChars() const
+{
+ if(m_ParseOptions.m_bGetCharCodeOnly) {
+ return m_TextBuf.GetSize();
+ }
+ return m_charList.GetSize();
+}
+int CPDF_TextPage::CharIndexFromTextIndex(int TextIndex) const
+{
+ int indexSize = m_CharIndex.GetSize();
+ int count = 0;
+ for(int i = 0; i < indexSize; i += 2) {
+ count += m_CharIndex.GetAt(i + 1);
+ if(count > TextIndex) {
+ return TextIndex - count + m_CharIndex.GetAt(i + 1) + m_CharIndex.GetAt(i);
+ }
+ }
+ return -1;
+}
+int CPDF_TextPage::TextIndexFromCharIndex(int CharIndex) const
+{
+ int indexSize = m_CharIndex.GetSize();
+ int count = 0;
+ for(int i = 0; i < indexSize; i += 2) {
+ count += m_CharIndex.GetAt(i + 1);
+ if(m_CharIndex.GetAt(i + 1) + m_CharIndex.GetAt(i) > CharIndex) {
+ if(CharIndex - m_CharIndex.GetAt(i) < 0) {
+ return -1;
+ }
+ return CharIndex - m_CharIndex.GetAt(i) + count - m_CharIndex.GetAt(i + 1);
+ }
+ }
+ return -1;
+}
+void CPDF_TextPage::GetRectArray(int start, int nCount, CFX_RectArray& rectArray) const
+{
+ if(m_ParseOptions.m_bGetCharCodeOnly) {
+ return;
+ }
+ if(start < 0 || nCount == 0) {
+ return;
+ }
+ if (!m_IsParsered) {
+ return;
+ }
+ PAGECHAR_INFO info_curchar;
+ CPDF_TextObject* pCurObj = NULL;
+ CFX_FloatRect rect;
+ int curPos = start;
+ FX_BOOL flagNewRect = TRUE;
+ if (nCount + start > m_charList.GetSize() || nCount == -1) {
+ nCount = m_charList.GetSize() - start;
+ }
+ while (nCount--) {
+ info_curchar = *(PAGECHAR_INFO*)m_charList.GetAt(curPos++);
+ if (info_curchar.m_Flag == FPDFTEXT_CHAR_GENERATED) {
+ continue;
+ }
+ if(info_curchar.m_CharBox.Width() < 0.01 || info_curchar.m_CharBox.Height() < 0.01) {
+ continue;
+ }
+ if(!pCurObj) {
+ pCurObj = info_curchar.m_pTextObj;
+ }
+ if (pCurObj != info_curchar.m_pTextObj) {
+ rectArray.Add(rect);
+ pCurObj = info_curchar.m_pTextObj;
+ flagNewRect = TRUE;
+ }
+ if (flagNewRect) {
+ FX_FLOAT orgX = info_curchar.m_OriginX, orgY = info_curchar.m_OriginY;
+ CFX_AffineMatrix matrix, matrix_reverse;
+ info_curchar.m_pTextObj->GetTextMatrix(&matrix);
+ matrix.Concat(info_curchar.m_Matrix);
+ matrix_reverse.SetReverse(matrix);
+ matrix_reverse.Transform(orgX, orgY);
+ rect.left = info_curchar.m_CharBox.left;
+ rect.right = info_curchar.m_CharBox.right;
+ if (pCurObj->GetFont()->GetTypeDescent()) {
+ rect.bottom = orgY + pCurObj->GetFont()->GetTypeDescent() * pCurObj->GetFontSize() / 1000;
+ FX_FLOAT xPosTemp = orgX;
+ matrix.Transform(xPosTemp, rect.bottom);
+ } else {
+ rect.bottom = info_curchar.m_CharBox.bottom;
+ }
+ if (pCurObj->GetFont()->GetTypeAscent()) {
+ rect.top = orgY + pCurObj->GetFont()->GetTypeAscent() * pCurObj->GetFontSize() / 1000;
+ FX_FLOAT xPosTemp = orgX + GetCharWidth(info_curchar.m_CharCode, pCurObj->GetFont()) * pCurObj->GetFontSize() / 1000;
+ matrix.Transform(xPosTemp, rect.top);
+ } else {
+ rect.top = info_curchar.m_CharBox.top;
+ }
+ flagNewRect = FALSE;
+ rect = info_curchar.m_CharBox;
+ rect.Normalize();
+ } else {
+ info_curchar.m_CharBox.Normalize();
+ if (rect.left > info_curchar.m_CharBox.left) {
+ rect.left = info_curchar.m_CharBox.left;
+ }
+ if (rect.right < info_curchar.m_CharBox.right) {
+ rect.right = info_curchar.m_CharBox.right;
+ }
+ if ( rect.top < info_curchar.m_CharBox.top) {
+ rect.top = info_curchar.m_CharBox.top;
+ }
+ if (rect.bottom > info_curchar.m_CharBox.bottom) {
+ rect.bottom = info_curchar.m_CharBox.bottom;
+ }
+ }
+ }
+ rectArray.Add(rect);
+ return;
+}
+int CPDF_TextPage::GetIndexAtPos(CPDF_Point point , FX_FLOAT xTorelance, FX_FLOAT yTorelance) const
+{
+ if(m_ParseOptions.m_bGetCharCodeOnly) {
+ return -3;
+ }
+ if (!m_IsParsered) {
+ return -3;
+ }
+ FX_FLOAT distance = 0;
+ int pos = 0;
+ int NearPos = -1;
+ double xdif = 5000, ydif = 5000;
+ while(pos < m_charList.GetSize()) {
+ PAGECHAR_INFO charinfo = *(PAGECHAR_INFO*)(m_charList.GetAt(pos));
+ CFX_FloatRect charrect = charinfo.m_CharBox;
+ if (charrect.Contains(point.x, point.y)) {
+ break;
+ }
+ if (xTorelance > 0 || yTorelance > 0) {
+ CFX_FloatRect charRectExt;
+ charrect.Normalize();
+ charRectExt.left = charrect.left - xTorelance / 2;
+ charRectExt.right = charrect.right + xTorelance / 2;
+ charRectExt.top = charrect.top + yTorelance / 2;
+ charRectExt.bottom = charrect.bottom - yTorelance / 2;
+ if (charRectExt.Contains(point.x, point.y)) {
+ double curXdif, curYdif;
+ curXdif = FXSYS_fabs(point.x - charrect.left) < FXSYS_fabs(point.x - charrect.right) ? FXSYS_fabs(point.x - charrect.left) : FXSYS_fabs(point.x - charrect.right);
+ curYdif = FXSYS_fabs(point.y - charrect.bottom) < FXSYS_fabs(point.y - charrect.top ) ? FXSYS_fabs(point.y - charrect.bottom) : FXSYS_fabs(point.y - charrect.top);
+ if (curYdif + curXdif < xdif + ydif) {
+ ydif = curYdif;
+ xdif = curXdif;
+ NearPos = pos;
+ }
+ }
+ }
+ ++pos;
+ }
+ if (pos >= m_charList.GetSize()) {
+ pos = NearPos;
+ }
+ return pos;
+}
+CFX_WideString CPDF_TextPage::GetTextByRect(CFX_FloatRect rect) const
+{
+ CFX_WideString strText;
+ if(m_ParseOptions.m_bGetCharCodeOnly || !m_IsParsered) {
+ return strText;
+ }
+ int nCount = m_charList.GetSize();
+ int pos = 0;
+ FX_FLOAT posy = 0;
+ FX_BOOL IsContainPreChar = FALSE;
+ FX_BOOL ISAddLineFeed = FALSE;
+ while (pos < nCount) {
+ PAGECHAR_INFO charinfo = *(PAGECHAR_INFO*)m_charList.GetAt(pos++);
+ if (IsRectIntersect(rect, charinfo.m_CharBox)) {
+ if (FXSYS_fabs(posy - charinfo.m_OriginY) > 0 && !IsContainPreChar && ISAddLineFeed) {
+ posy = charinfo.m_OriginY;
+ if (strText.GetLength() > 0) {
+ strText += L"\r\n";
+ }
+ }
+ IsContainPreChar = TRUE;
+ ISAddLineFeed = FALSE;
+ if (charinfo.m_Unicode) {
+ strText += charinfo.m_Unicode;
+ }
+ } else if (charinfo.m_Unicode == 32) {
+ if (IsContainPreChar && charinfo.m_Unicode) {
+ strText += charinfo.m_Unicode;
+ IsContainPreChar = FALSE;
+ ISAddLineFeed = FALSE;
+ }
+ } else {
+ IsContainPreChar = FALSE;
+ ISAddLineFeed = TRUE;
+ }
+ }
+ return strText;
+}
+void CPDF_TextPage::GetRectsArrayByRect(CFX_FloatRect rect, CFX_RectArray& resRectArray) const
+{
+ if(m_ParseOptions.m_bGetCharCodeOnly) {
+ return;
+ }
+ if (!m_IsParsered) {
+ return;
+ }
+ CFX_FloatRect curRect;
+ FX_BOOL flagNewRect = TRUE;
+ CPDF_TextObject* pCurObj = NULL;
+ int nCount = m_charList.GetSize();
+ int pos = 0;
+ while (pos < nCount) {
+ PAGECHAR_INFO info_curchar = *(PAGECHAR_INFO*)m_charList.GetAt(pos++);
+ if (info_curchar.m_Flag == FPDFTEXT_CHAR_GENERATED) {
+ continue;
+ }
+ if(pos == 494) {
+ int a = 0;
+ }
+ if (IsRectIntersect(rect, info_curchar.m_CharBox)) {
+ if(!pCurObj) {
+ pCurObj = info_curchar.m_pTextObj;
+ }
+ if (pCurObj != info_curchar.m_pTextObj) {
+ resRectArray.Add(curRect);
+ pCurObj = info_curchar.m_pTextObj;
+ flagNewRect = TRUE;
+ }
+ if (flagNewRect) {
+ curRect = info_curchar.m_CharBox;
+ flagNewRect = FALSE;
+ curRect.Normalize();
+ } else {
+ info_curchar.m_CharBox.Normalize();
+ if (curRect.left > info_curchar.m_CharBox.left) {
+ curRect.left = info_curchar.m_CharBox.left;
+ }
+ if (curRect.right < info_curchar.m_CharBox.right) {
+ curRect.right = info_curchar.m_CharBox.right;
+ }
+ if ( curRect.top < info_curchar.m_CharBox.top) {
+ curRect.top = info_curchar.m_CharBox.top;
+ }
+ if (curRect.bottom > info_curchar.m_CharBox.bottom) {
+ curRect.bottom = info_curchar.m_CharBox.bottom;
+ }
+ }
+ }
+ }
+ resRectArray.Add(curRect);
+ return;
+}
+int CPDF_TextPage::GetIndexAtPos(FX_FLOAT x, FX_FLOAT y, FX_FLOAT xTorelance, FX_FLOAT yTorelance) const
+{
+ if(m_ParseOptions.m_bGetCharCodeOnly) {
+ return -3;
+ }
+ CPDF_Point point(x, y);
+ return GetIndexAtPos(point, xTorelance, yTorelance);
+}
+int CPDF_TextPage::GetOrderByDirection(int order, int direction) const
+{
+ if(m_ParseOptions.m_bGetCharCodeOnly) {
+ return -3;
+ }
+ if (!m_IsParsered) {
+ return -3;
+ }
+ if (direction == FPDFTEXT_RIGHT || direction == FPDFTEXT_LEFT) {
+ order += direction;
+ while(order >= 0 && order < m_charList.GetSize()) {
+ PAGECHAR_INFO cinfo = *(PAGECHAR_INFO*)m_charList.GetAt(order);
+ if (cinfo.m_Flag != FPDFTEXT_CHAR_GENERATED) {
+ break;
+ } else {
+ if (cinfo.m_Unicode == TEXT_LINEFEED_CHAR || cinfo.m_Unicode == TEXT_RETURN_CHAR) {
+ order += direction;
+ } else {
+ break;
+ }
+ }
+ }
+ if (order >= m_charList.GetSize()) {
+ order = -2;
+ }
+ return order;
+ }
+ PAGECHAR_INFO charinfo;
+ charinfo = *(PAGECHAR_INFO*)m_charList.GetAt(order);
+ CPDF_Point curPos(charinfo.m_OriginX, charinfo.m_OriginY);
+ FX_FLOAT difPosY = 0.0, minXdif = 1000;
+ int minIndex = -2;
+ int index = order;
+ FX_FLOAT height = charinfo.m_CharBox.Height();
+ if (direction == FPDFTEXT_UP) {
+ minIndex = -1;
+ while (1) {
+ if (--index < 0) {
+ return -1;
+ }
+ charinfo = *(PAGECHAR_INFO*)m_charList.GetAt(index);
+ if (FXSYS_fabs(charinfo.m_OriginY - curPos.y) > FX_MAX(height, charinfo.m_CharBox.Height()) / 2) {
+ difPosY = charinfo.m_OriginY;
+ minIndex = index;
+ break;
+ }
+ }
+ FX_FLOAT PreXdif = charinfo.m_OriginX - curPos.x;
+ minXdif = PreXdif;
+ if (PreXdif == 0) {
+ return index;
+ }
+ FX_FLOAT curXdif = 0;
+ while (--index >= 0) {
+ charinfo = *(PAGECHAR_INFO*)m_charList.GetAt(index);
+ if (difPosY != charinfo.m_OriginY) {
+ break;
+ }
+ curXdif = charinfo.m_OriginX - curPos.x;
+ if (curXdif == 0) {
+ return index;
+ }
+ int signflag = 0;
+ if (curXdif > 0) {
+ signflag = 1;
+ } else {
+ signflag = -1;
+ }
+ if (signflag * PreXdif < 0) {
+ if (FXSYS_fabs(PreXdif) < FXSYS_fabs(curXdif)) {
+ return index + 1;
+ } else {
+ return index;
+ }
+ }
+ if (FXSYS_fabs(curXdif) < FXSYS_fabs(minXdif)) {
+ minIndex = index;
+ minXdif = curXdif;
+ }
+ PreXdif = curXdif;
+ if (difPosY != charinfo.m_OriginY) {
+ break;
+ }
+ }
+ return minIndex;
+ } else if(FPDFTEXT_DOWN) {
+ minIndex = -2;
+ while (1) {
+ if (++index > m_charList.GetSize() - 1) {
+ return minIndex;
+ }
+ charinfo = *(PAGECHAR_INFO*)m_charList.GetAt(index);
+ if (FXSYS_fabs(charinfo.m_OriginY - curPos.y) > FX_MAX(height, charinfo.m_CharBox.Height()) / 2) {
+ difPosY = charinfo.m_OriginY;
+ minIndex = index;
+ break;
+ }
+ }
+ FX_FLOAT PreXdif = charinfo.m_OriginX - curPos.x;
+ minXdif = PreXdif;
+ if (PreXdif == 0) {
+ return index;
+ }
+ FX_FLOAT curXdif = 0;
+ while (++index < m_charList.GetSize()) {
+ charinfo = *(PAGECHAR_INFO*)m_charList.GetAt(index);
+ if (difPosY != charinfo.m_OriginY) {
+ break;
+ }
+ curXdif = charinfo.m_OriginX - curPos.x;
+ if (curXdif == 0) {
+ return index;
+ }
+ int signflag = 0;
+ if (curXdif > 0) {
+ signflag = 1;
+ } else {
+ signflag = -1;
+ }
+ if (signflag * PreXdif < 0) {
+ if (FXSYS_fabs(PreXdif) < FXSYS_fabs(curXdif)) {
+ return index - 1;
+ } else {
+ return index;
+ }
+ }
+ if (FXSYS_fabs(curXdif) < FXSYS_fabs(minXdif)) {
+ minXdif = curXdif;
+ minIndex = index;
+ }
+ PreXdif = curXdif;
+ }
+ return minIndex;
+ }
+}
+void CPDF_TextPage::GetCharInfo(int index, FPDF_CHAR_INFO & info) const
+{
+ if(m_ParseOptions.m_bGetCharCodeOnly) {
+ return;
+ }
+ if (!m_IsParsered) {
+ return;
+ }
+ if (index < 0 || index >= m_charList.GetSize()) {
+ return;
+ }
+ PAGECHAR_INFO charinfo;
+ charinfo = *(PAGECHAR_INFO*)m_charList.GetAt(index);
+ info.m_Charcode = charinfo.m_CharCode;
+ info.m_OriginX = charinfo.m_OriginX;
+ info.m_OriginY = charinfo.m_OriginY;
+ info.m_Unicode = charinfo.m_Unicode;
+ info.m_Flag = charinfo.m_Flag;
+ info.m_CharBox = charinfo.m_CharBox;
+ info.m_pTextObj = charinfo.m_pTextObj;
+ if (charinfo.m_pTextObj && charinfo.m_pTextObj->GetFont()) {
+ info.m_FontSize = charinfo.m_pTextObj->GetFontSize();
+ }
+ info.m_Matrix.Copy(charinfo.m_Matrix);
+ return;
+}
+void CPDF_TextPage::CheckMarkedContentObject(FX_INT32& start, FX_INT32& nCount) const
+{
+ PAGECHAR_INFO charinfo = *(PAGECHAR_INFO*)m_charList.GetAt(start);
+ PAGECHAR_INFO charinfo2 = *(PAGECHAR_INFO*)m_charList.GetAt(start + nCount - 1);
+ if (FPDFTEXT_CHAR_PIECE != charinfo.m_Flag && FPDFTEXT_CHAR_PIECE != charinfo2.m_Flag) {
+ return;
+ }
+ if (FPDFTEXT_CHAR_PIECE == charinfo.m_Flag) {
+ PAGECHAR_INFO charinfo1 = charinfo;
+ int startIndex = start;
+ while(FPDFTEXT_CHAR_PIECE == charinfo1.m_Flag && charinfo1.m_Index == charinfo.m_Index) {
+ startIndex--;
+ if (startIndex < 0) {
+ break;
+ }
+ charinfo1 = *(PAGECHAR_INFO*)m_charList.GetAt(startIndex);
+ }
+ startIndex++;
+ start = startIndex;
+ }
+ if (FPDFTEXT_CHAR_PIECE == charinfo2.m_Flag) {
+ PAGECHAR_INFO charinfo3 = charinfo2;
+ int endIndex = start + nCount - 1;
+ while(FPDFTEXT_CHAR_PIECE == charinfo3.m_Flag && charinfo3.m_Index == charinfo2.m_Index) {
+ endIndex++;
+ if (endIndex >= m_charList.GetSize()) {
+ break;
+ }
+ charinfo3 = *(PAGECHAR_INFO*)m_charList.GetAt(endIndex);
+ }
+ endIndex--;
+ nCount = endIndex - start + 1;
+ }
+}
+CFX_WideString CPDF_TextPage::GetPageText(int start , int nCount) const
+{
+ if (!m_IsParsered || nCount == 0) {
+ return L"";
+ }
+ if (start < 0) {
+ start = 0;
+ }
+ if (nCount == -1) {
+ nCount = m_charList.GetSize() - start;
+ return m_TextBuf.GetWideString().Mid(start, m_TextBuf.GetWideString().GetLength());
+ }
+ if(nCount <= 0 || m_charList.GetSize() <= 0) {
+ return L"";
+ }
+ if(nCount + start > m_charList.GetSize() - 1) {
+ nCount = m_charList.GetSize() - start;
+ }
+ if (nCount <= 0) {
+ return L"";
+ }
+ CheckMarkedContentObject(start, nCount);
+ int startindex = 0;
+ PAGECHAR_INFO charinfo = *(PAGECHAR_INFO*)m_charList.GetAt(start);
+ int startOffset = 0;
+ while(charinfo.m_Index == -1) {
+ startOffset++;
+ if (startOffset > nCount || start + startOffset >= m_charList.GetSize()) {
+ return L"";
+ }
+ charinfo = *(PAGECHAR_INFO*)m_charList.GetAt(start + startOffset);
+ }
+ startindex = charinfo.m_Index;
+ charinfo = *(PAGECHAR_INFO*)m_charList.GetAt(start + nCount - 1);
+ int nCountOffset = 0;
+ while (charinfo.m_Index == -1) {
+ nCountOffset++;
+ if (nCountOffset >= nCount) {
+ return L"";
+ }
+ charinfo = *(PAGECHAR_INFO*)m_charList.GetAt(start + nCount - nCountOffset - 1);
+ }
+ nCount = start + nCount - nCountOffset - startindex;
+ if(nCount <= 0) {
+ return L"";
+ }
+ return m_TextBuf.GetWideString().Mid(startindex, nCount);
+}
+int CPDF_TextPage::CountRects(int start, int nCount)
+{
+ if(m_ParseOptions.m_bGetCharCodeOnly) {
+ return -1;
+ }
+ if (!m_IsParsered) {
+ return -1;
+ }
+ if (start < 0) {
+ return -1;
+ }
+ if (nCount == -1 || nCount + start > m_charList.GetSize() ) {
+ nCount = m_charList.GetSize() - start;
+ }
+ m_SelRects.RemoveAll();
+ GetRectArray(start, nCount, m_SelRects);
+ return m_SelRects.GetSize();
+}
+void CPDF_TextPage::GetRect(int rectIndex, FX_FLOAT& left, FX_FLOAT& top, FX_FLOAT& right, FX_FLOAT &bottom) const
+{
+ if(m_ParseOptions.m_bGetCharCodeOnly) {
+ return ;
+ }
+ if (!m_IsParsered || rectIndex < 0 || rectIndex >= m_SelRects.GetSize()) {
+ return;
+ }
+ left = m_SelRects.GetAt(rectIndex).left;
+ top = m_SelRects.GetAt(rectIndex).top;
+ right = m_SelRects.GetAt(rectIndex).right;
+ bottom = m_SelRects.GetAt(rectIndex).bottom;
+}
+FX_BOOL CPDF_TextPage::GetBaselineRotate(int start, int end, int& Rotate)
+{
+ if(m_ParseOptions.m_bGetCharCodeOnly) {
+ return FALSE;
+ }
+ if(end == start) {
+ return FALSE;
+ }
+ FX_FLOAT dx, dy;
+ FPDF_CHAR_INFO info1, info2;
+ GetCharInfo(start, info1);
+ GetCharInfo(end, info2);
+ while(info2.m_CharBox.Width() == 0 || info2.m_CharBox.Height() == 0) {
+ end--;
+ if(end <= start) {
+ return FALSE;
+ }
+ GetCharInfo(end, info2);
+ }
+ dx = (info2.m_OriginX - info1.m_OriginX);
+ dy = (info2.m_OriginY - info1.m_OriginY);
+ if(dx == 0) {
+ if(dy > 0) {
+ Rotate = 90;
+ } else if (dy < 0) {
+ Rotate = 270;
+ } else {
+ Rotate = 0;
+ }
+ } else {
+ float a = FXSYS_atan2(dy, dx);
+ Rotate = (int)(a * 180 / FX_PI + 0.5);
+ }
+ if(Rotate < 0) {
+ Rotate = -Rotate;
+ } else if(Rotate > 0) {
+ Rotate = 360 - Rotate;
+ }
+ return TRUE;
+}
+FX_BOOL CPDF_TextPage::GetBaselineRotate(CFX_FloatRect rect , int& Rotate)
+{
+ if(m_ParseOptions.m_bGetCharCodeOnly) {
+ return FALSE;
+ }
+ int start, end, count, n = CountBoundedSegments(rect.left, rect.top, rect.right, rect.bottom, TRUE);
+ if(n < 1) {
+ return FALSE;
+ }
+ if(n > 1) {
+ GetBoundedSegment(n - 1, start, count);
+ end = start + count - 1;
+ GetBoundedSegment(0, start, count);
+ } else {
+ GetBoundedSegment(0, start, count);
+ end = start + count - 1;
+ }
+ return GetBaselineRotate(start, end, Rotate);
+}
+FX_BOOL CPDF_TextPage::GetBaselineRotate(int rectIndex, int& Rotate)
+{
+ if(m_ParseOptions.m_bGetCharCodeOnly) {
+ return FALSE;
+ }
+ if (!m_IsParsered || rectIndex < 0 || rectIndex > m_SelRects.GetSize()) {
+ return FALSE;
+ }
+ CFX_FloatRect rect = m_SelRects.GetAt(rectIndex);
+ return GetBaselineRotate(rect , Rotate);
+}
+int CPDF_TextPage::CountBoundedSegments(FX_FLOAT left, FX_FLOAT top, FX_FLOAT right, FX_FLOAT bottom, FX_BOOL bContains )
+{
+ if(m_ParseOptions.m_bGetCharCodeOnly) {
+ return -1;
+ }
+ m_Segment.RemoveAll();
+ if (!m_IsParsered) {
+ return -1;
+ }
+ CFX_FloatRect rect(left, bottom, right, top);
+ rect.Normalize();
+ int nCount = m_charList.GetSize();
+ int pos = 0;
+ FPDF_SEGMENT segment;
+ segment.m_Start = 0;
+ segment.m_nCount = 0;
+ FX_BOOL segmentStatus = 0;
+ FX_BOOL IsContainPreChar = FALSE;
+ while (pos < nCount) {
+ if(pos == 493) {
+ int a = 0;
+ }
+ PAGECHAR_INFO charinfo = *(PAGECHAR_INFO*)m_charList.GetAt(pos);
+ if(bContains && rect.Contains(charinfo.m_CharBox)) {
+ if (segmentStatus == 0 || segmentStatus == 2) {
+ segment.m_Start = pos;
+ segment.m_nCount = 1;
+ segmentStatus = 1;
+ } else if (segmentStatus == 1) {
+ segment.m_nCount++;
+ }
+ IsContainPreChar = TRUE;
+ } else if (!bContains && (IsRectIntersect(rect, charinfo.m_CharBox) || rect.Contains(charinfo.m_OriginX, charinfo.m_OriginY))) {
+ if (segmentStatus == 0 || segmentStatus == 2) {
+ segment.m_Start = pos;
+ segment.m_nCount = 1;
+ segmentStatus = 1;
+ } else if (segmentStatus == 1) {
+ segment.m_nCount++;
+ }
+ IsContainPreChar = TRUE;
+ } else if (charinfo.m_Unicode == 32) {
+ if (IsContainPreChar == TRUE) {
+ if (segmentStatus == 0 || segmentStatus == 2) {
+ segment.m_Start = pos;
+ segment.m_nCount = 1;
+ segmentStatus = 1;
+ } else if (segmentStatus == 1) {
+ segment.m_nCount++;
+ }
+ IsContainPreChar = FALSE;
+ } else {
+ if (segmentStatus == 1) {
+ segmentStatus = 2;
+ m_Segment.Add(segment);
+ segment.m_Start = 0;
+ segment.m_nCount = 0;
+ }
+ }
+ } else {
+ if (segmentStatus == 1) {
+ segmentStatus = 2;
+ m_Segment.Add(segment);
+ segment.m_Start = 0;
+ segment.m_nCount = 0;
+ }
+ IsContainPreChar = FALSE;
+ }
+ pos++;
+ }
+ if (segmentStatus == 1) {
+ segmentStatus = 2;
+ m_Segment.Add(segment);
+ segment.m_Start = 0;
+ segment.m_nCount = 0;
+ }
+ return m_Segment.GetSize();
+}
+void CPDF_TextPage::GetBoundedSegment(int index, int& start, int& count) const
+{
+ if(m_ParseOptions.m_bGetCharCodeOnly) {
+ return ;
+ }
+ if (index < 0 || index >= m_Segment.GetSize()) {
+ return;
+ }
+ start = m_Segment.GetAt(index).m_Start;
+ count = m_Segment.GetAt(index).m_nCount;
+}
+int CPDF_TextPage::GetWordBreak(int index, int direction) const
+{
+ if(m_ParseOptions.m_bGetCharCodeOnly) {
+ return -1;
+ }
+ if (!m_IsParsered) {
+ return -1;
+ }
+ if (direction != FPDFTEXT_LEFT && direction != FPDFTEXT_RIGHT) {
+ return -1;
+ }
+ if (index < 0 || index >= m_charList.GetSize()) {
+ return -1;
+ }
+ PAGECHAR_INFO charinfo;
+ charinfo = *(PAGECHAR_INFO*)m_charList.GetAt(index);
+ if (charinfo.m_Index == -1 || charinfo.m_Flag == FPDFTEXT_CHAR_GENERATED) {
+ return index;
+ }
+ if (!IsLetter(charinfo.m_Unicode)) {
+ return index;
+ }
+ int breakPos = index;
+ if (direction == FPDFTEXT_LEFT) {
+ while (--breakPos > 0) {
+ charinfo = *(PAGECHAR_INFO*)m_charList.GetAt(breakPos);
+ if (!IsLetter(charinfo.m_Unicode)) {
+ return breakPos;
+ }
+ }
+ return breakPos;
+ } else if (direction == FPDFTEXT_RIGHT) {
+ while (++breakPos < m_charList.GetSize()) {
+ charinfo = *(PAGECHAR_INFO*)m_charList.GetAt(breakPos);
+ if (!IsLetter(charinfo.m_Unicode)) {
+ return breakPos;
+ }
+ }
+ return breakPos;
+ }
+ return breakPos;
+}
+FX_INT32 CPDF_TextPage::FindTextlineFlowDirection()
+{
+ if (!m_pPage) {
+ return -1;
+ }
+ const FX_INT32 nPageWidth = (FX_INT32)((CPDF_Page*)m_pPage)->GetPageWidth();
+ const FX_INT32 nPageHeight = (FX_INT32)((CPDF_Page*)m_pPage)->GetPageHeight();
+ CFX_ByteArray nHorizontalMask;
+ if (!nHorizontalMask.SetSize(nPageWidth)) {
+ return -1;
+ }
+ FX_BYTE* pDataH = nHorizontalMask.GetData();
+ CFX_ByteArray nVerticalMask;
+ if (!nVerticalMask.SetSize(nPageHeight)) {
+ return -1;
+ }
+ FX_BYTE* pDataV = nVerticalMask.GetData();
+ FX_INT32 index = 0;
+ FX_FLOAT fLineHeight = 0.0f;
+ CPDF_PageObject* pPageObj = NULL;
+ FX_POSITION pos = NULL;
+ pos = m_pPage->GetFirstObjectPosition();
+ if(!pos) {
+ return -1;
+ }
+ while(pos) {
+ pPageObj = m_pPage->GetNextObject(pos);
+ if(NULL == pPageObj) {
+ continue;
+ }
+ if(PDFPAGE_TEXT != pPageObj->m_Type) {
+ continue;
+ }
+ FX_INT32 minH = (FX_INT32)pPageObj->m_Left < 0 ? 0 : (FX_INT32)pPageObj->m_Left;
+ FX_INT32 maxH = (FX_INT32)pPageObj->m_Right > nPageWidth ? nPageWidth : (FX_INT32)pPageObj->m_Right;
+ FX_INT32 minV = (FX_INT32)pPageObj->m_Bottom < 0 ? 0 : (FX_INT32)pPageObj->m_Bottom;
+ FX_INT32 maxV = (FX_INT32)pPageObj->m_Top > nPageHeight ? nPageHeight : (FX_INT32)pPageObj->m_Top;
+ if (minH >= maxH || minV >= maxV){
+ continue;
+ }
+
+ FXSYS_memset8(pDataH + minH, 1, maxH - minH);
+ FXSYS_memset8(pDataV + minV, 1, maxV - minV);
+
+ if (fLineHeight <= 0.0f) {
+ fLineHeight = pPageObj->m_Top - pPageObj->m_Bottom;
+ }
+
+ pPageObj = NULL;
+ }
+ FX_INT32 nStartH = 0;
+ FX_INT32 nEndH = 0;
+ FX_FLOAT nSumH = 0.0f;
+ for (index = 0; index < nPageWidth; index++)
+ if(1 == nHorizontalMask[index]) {
+ break;
+ }
+ nStartH = index;
+ for (index = nPageWidth; index > 0; index--)
+ if(1 == nHorizontalMask[index - 1]) {
+ break;
+ }
+ nEndH = index;
+ for (index = nStartH; index < nEndH; index++) {
+ nSumH += nHorizontalMask[index];
+ }
+ nSumH /= nEndH - nStartH;
+ FX_INT32 nStartV = 0;
+ FX_INT32 nEndV = 0;
+ FX_FLOAT nSumV = 0.0f;
+ for (index = 0; index < nPageHeight; index++)
+ if(1 == nVerticalMask[index]) {
+ break;
+ }
+ nStartV = index;
+ for (index = nPageHeight; index > 0; index--)
+ if(1 == nVerticalMask[index - 1]) {
+ break;
+ }
+ nEndV = index;
+ for (index = nStartV; index < nEndV; index++) {
+ nSumV += nVerticalMask[index];
+ }
+ nSumV /= nEndV - nStartV;
+ if ((nEndV - nStartV) < (FX_INT32)(2 * fLineHeight)) {
+ return 0;
+ }
+ if ((nEndH - nStartH) < (FX_INT32)(2 * fLineHeight)) {
+ return 1;
+ }
+ if (nSumH > 0.8f) {
+ return 0;
+ }
+ if (nSumH - nSumV > 0.0f) {
+ return 0;
+ }
+ if (nSumV - nSumH > 0.0f) {
+ return 1;
+ }
+ return -1;
+}
+void CPDF_TextPage::ProcessObject()
+{
+ CPDF_PageObject* pPageObj = NULL;
+ if (!m_pPage) {
+ return;
+ }
+ FX_POSITION pos;
+ pos = m_pPage->GetFirstObjectPosition();
+ if (!pos) {
+ return;
+ }
+ m_TextlineDir = FindTextlineFlowDirection();
+ int nCount = 0;
+ while (pos) {
+ pPageObj = m_pPage->GetNextObject(pos);
+ if(pPageObj) {
+ if(pPageObj->m_Type == PDFPAGE_TEXT) {
+ if (nCount == 3) {
+ nCount = nCount;
+ }
+ CFX_AffineMatrix matrix;
+ ProcessTextObject((CPDF_TextObject*)pPageObj, matrix, pos);
+ nCount++;
+ } else if (pPageObj->m_Type == PDFPAGE_FORM) {
+ CFX_AffineMatrix formMatrix(1, 0, 0, 1, 0, 0);
+ ProcessFormObject((CPDF_FormObject*)pPageObj, formMatrix);
+ }
+ }
+ pPageObj = NULL;
+ }
+ int count = m_LineObj.GetSize();
+ for(int i = 0; i < count; i++) {
+ ProcessTextObject(m_LineObj.GetAt(i));
+ }
+ m_LineObj.RemoveAll();
+ CloseTempLine();
+}
+void CPDF_TextPage::ProcessFormObject(CPDF_FormObject* pFormObj, CFX_AffineMatrix formMatrix)
+{
+ CPDF_PageObject* pPageObj = NULL;
+ FX_POSITION pos;
+ if (!pFormObj) {
+ return;
+ }
+ pos = pFormObj->m_pForm->GetFirstObjectPosition();
+ if (!pos) {
+ return;
+ }
+ CFX_AffineMatrix curFormMatrix;
+ curFormMatrix.Copy(pFormObj->m_FormMatrix);
+ curFormMatrix.Concat(formMatrix);
+ while (pos) {
+ pPageObj = pFormObj->m_pForm->GetNextObject(pos);
+ if(pPageObj) {
+ if(pPageObj->m_Type == PDFPAGE_TEXT) {
+ ProcessTextObject((CPDF_TextObject*)pPageObj, curFormMatrix, pos);
+ } else if (pPageObj->m_Type == PDFPAGE_FORM) {
+ ProcessFormObject((CPDF_FormObject*)pPageObj, curFormMatrix);
+ }
+ }
+ pPageObj = NULL;
+ }
+}
+int CPDF_TextPage::GetCharWidth(FX_DWORD charCode, CPDF_Font* pFont) const
+{
+ if(charCode == -1) {
+ return 0;
+ }
+ int w = pFont->GetCharWidthF(charCode);
+ if(w == 0) {
+ CFX_ByteString str;
+ pFont->AppendChar(str, charCode);
+ w = pFont->GetStringWidth(str, 1);
+ if(w == 0) {
+ FX_RECT BBox;
+ pFont->GetCharBBox(charCode, BBox);
+ w = BBox.right - BBox.left;
+ }
+ }
+ return w;
+}
+void CPDF_TextPage::OnPiece(IFX_BidiChar* pBidi, CFX_WideString& str)
+{
+ FX_INT32 start, count;
+ FX_INT32 ret = pBidi->GetBidiInfo(start, count);
+ if(ret == 2) {
+ for(int i = start + count - 1; i >= start; i--) {
+ m_TextBuf.AppendChar(str.GetAt(i));
+ m_charList.Add(*(PAGECHAR_INFO*)m_TempCharList.GetAt(i));
+ }
+ } else {
+ int end = start + count ;
+ for(int i = start; i < end; i++) {
+ m_TextBuf.AppendChar(str.GetAt(i));
+ m_charList.Add(*(PAGECHAR_INFO*)m_TempCharList.GetAt(i));
+ }
+ }
+}
+void CPDF_TextPage::AddCharInfoByLRDirection(CFX_WideString& str, int i)
+{
+ PAGECHAR_INFO Info = *(PAGECHAR_INFO*)m_TempCharList.GetAt(i);
+ FX_WCHAR wChar = str.GetAt(i);
+#ifdef FOXIT_CHROME_BUILD
+ if(!IsControlChar(&Info)) {
+#else
+ if(wChar != 0xfffe) {
+#endif
+ Info.m_Index = m_TextBuf.GetLength();
+ if (wChar >= 0xFB00 && wChar <= 0xFB06) {
+ FX_LPWSTR pDst = NULL;
+ FX_STRSIZE nCount = FX_Unicode_GetNormalization(wChar, pDst);
+ if (nCount >= 1) {
+ pDst = FX_Alloc(FX_WCHAR, nCount);
+ if (!pDst) {
+ return;
+ }
+ FX_Unicode_GetNormalization(wChar, pDst);
+ for (int nIndex = 0; nIndex < nCount; nIndex++) {
+ PAGECHAR_INFO Info2 = Info;
+ Info2.m_Unicode = pDst[nIndex];
+ Info2.m_Flag = FPDFTEXT_CHAR_PIECE;
+ m_TextBuf.AppendChar(Info2.m_Unicode);
+ if( !m_ParseOptions.m_bGetCharCodeOnly) {
+ m_charList.Add(Info2);
+ }
+ }
+ FX_Free(pDst);
+ return;
+ }
+ }
+ m_TextBuf.AppendChar(wChar);
+ } else {
+ Info.m_Index = -1;
+ }
+ if( !m_ParseOptions.m_bGetCharCodeOnly) {
+ m_charList.Add(Info);
+ }
+}
+void CPDF_TextPage::AddCharInfoByRLDirection(CFX_WideString& str, int i)
+{
+ PAGECHAR_INFO Info = *(PAGECHAR_INFO*)m_TempCharList.GetAt(i);
+#ifdef FOXIT_CHROME_BUILD
+ if(!IsControlChar(&Info)) {
+#else
+ if(str.GetAt(i) != 0xfffe) {
+#endif
+ Info.m_Index = m_TextBuf.GetLength();
+ FX_WCHAR wChar = FX_GetMirrorChar(str.GetAt(i), TRUE, FALSE);
+ FX_LPWSTR pDst = NULL;
+ FX_STRSIZE nCount = FX_Unicode_GetNormalization(wChar, pDst);
+ if (nCount >= 1) {
+ pDst = FX_Alloc(FX_WCHAR, nCount);
+ if (!pDst) {
+ return;
+ }
+ FX_Unicode_GetNormalization(wChar, pDst);
+ for (int nIndex = 0; nIndex < nCount; nIndex++) {
+ PAGECHAR_INFO Info2 = Info;
+ Info2.m_Unicode = pDst[nIndex];
+ Info2.m_Flag = FPDFTEXT_CHAR_PIECE;
+ m_TextBuf.AppendChar(Info2.m_Unicode);
+ if( !m_ParseOptions.m_bGetCharCodeOnly) {
+ m_charList.Add(Info2);
+ }
+ }
+ FX_Free(pDst);
+ return;
+ } else {
+ Info.m_Unicode = wChar;
+ }
+ m_TextBuf.AppendChar(Info.m_Unicode);
+ } else {
+ Info.m_Index = -1;
+ }
+ if( !m_ParseOptions.m_bGetCharCodeOnly) {
+ m_charList.Add(Info);
+ }
+}
+void CPDF_TextPage::CloseTempLine()
+{
+ int count1 = m_TempCharList.GetSize();
+ if (count1 <= 0) {
+ return;
+ }
+ IFX_BidiChar* BidiChar = IFX_BidiChar::Create();
+ CFX_WideString str = m_TempTextBuf.GetWideString();
+ CFX_WordArray order;
+ FX_BOOL bR2L = FALSE;
+ FX_INT32 start = 0, count = 0, i = 0;
+ int nR2L = 0, nL2R = 0;
+ FX_BOOL bPrevSpace = FALSE;
+ for (i = 0; i < str.GetLength(); i++) {
+ if(str.GetAt(i) == 32) {
+ if(bPrevSpace) {
+ m_TempTextBuf.Delete(i, 1);
+ m_TempCharList.Delete(i);
+ str.Delete(i);
+ count1 --;
+ i--;
+ continue;
+ }
+ bPrevSpace = TRUE;
+ } else {
+ bPrevSpace = FALSE;
+ }
+ if(BidiChar && BidiChar->AppendChar(str.GetAt(i))) {
+ FX_INT32 ret = BidiChar->GetBidiInfo(start, count);
+ order.Add(start);
+ order.Add(count);
+ order.Add(ret);
+ if(!bR2L) {
+ if(ret == 2) {
+ nR2L++;
+ } else if (ret == 1) {
+ nL2R++;
+ }
+ }
+ }
+ }
+ if(BidiChar && BidiChar->EndChar()) {
+ FX_INT32 ret = BidiChar->GetBidiInfo(start, count);
+ order.Add(start);
+ order.Add(count);
+ order.Add(ret);
+ if(!bR2L) {
+ if(ret == 2) {
+ nR2L++;
+ } else if(ret == 1) {
+ nL2R++;
+ }
+ }
+ }
+ if(nR2L > 0 && nR2L >= nL2R) {
+ bR2L = TRUE;
+ }
+ if(this->m_parserflag == FPDFTEXT_RLTB || bR2L) {
+ int count = order.GetSize();
+ for(int j = count - 1; j > 0; j -= 3) {
+ int ret = order.GetAt(j);
+ int start = order.GetAt(j - 2);
+ int count1 = order.GetAt(j - 1);
+ if(ret == 2 || ret == 0) {
+ for(int i = start + count1 - 1; i >= start; i--) {
+ AddCharInfoByRLDirection(str, i);
+ }
+ } else {
+ i = j;
+ FX_BOOL bSymbol = FALSE;
+ while(i > 0 && order.GetAt(i) != 2) {
+ bSymbol = !order.GetAt(i);
+ i -= 3;
+ }
+ int end = start + count1 ;
+ int n = 0;
+ if(bSymbol) {
+ n = i + 6;
+ } else {
+ n = i + 3;
+ }
+ if(n >= j) {
+ for(int m = start; m < end; m++) {
+ AddCharInfoByLRDirection(str, m);
+ }
+ } else {
+ i = j;
+ j = n;
+ for(; n <= i; n += 3) {
+ int ret = order.GetAt(n);
+ int start = order.GetAt(n - 2);
+ int count1 = order.GetAt(n - 1);
+ int end = start + count1 ;
+ for(int m = start; m < end; m++) {
+ AddCharInfoByLRDirection(str, m);
+ }
+ }
+ }
+ }
+ }
+ } else {
+ int count = order.GetSize();
+ FX_BOOL bL2R = FALSE;
+ for(int j = 0; j < count; j += 3) {
+ int ret = order.GetAt(j + 2);
+ int start = order.GetAt(j);
+ int count1 = order.GetAt(j + 1);
+ if(ret == 2 || (j == 0 && ret == 0 && !bL2R)) {
+ int i = j + 3;
+ while(bR2L && i < count) {
+ if(order.GetAt(i + 2) == 1) {
+ break;
+ } else {
+ i += 3;
+ }
+ }
+ if(i == 3) {
+ j = -3;
+ bL2R = TRUE;
+ continue;
+ }
+ int end = m_TempCharList.GetSize() - 1;
+ if(i < count) {
+ end = order.GetAt(i) - 1;
+ }
+ j = i - 3;
+ for(int n = end; n >= start; n--) {
+ AddCharInfoByRLDirection(str, n);
+ }
+ } else {
+ int end = start + count1 ;
+ for(int i = start; i < end; i++) {
+ AddCharInfoByLRDirection(str, i);
+ }
+ }
+ }
+ }
+ int ntext = m_TextBuf.GetSize();
+ ntext = m_charList.GetSize();
+ order.RemoveAll();
+ m_TempCharList.RemoveAll();
+ m_TempTextBuf.Delete(0, m_TempTextBuf.GetLength());
+ BidiChar->Release();
+}
+void CPDF_TextPage::ProcessTextObject(CPDF_TextObject* pTextObj, CFX_AffineMatrix formMatrix, FX_POSITION ObjPos)
+{
+ CFX_FloatRect re(pTextObj->m_Left, pTextObj->m_Bottom, pTextObj->m_Right, pTextObj->m_Top);
+ if(FXSYS_fabs(pTextObj->m_Right - pTextObj->m_Left) < 0.01f ) {
+ return;
+ }
+ int count = m_LineObj.GetSize();
+ PDFTEXT_Obj Obj;
+ Obj.m_pTextObj = pTextObj;
+ Obj.m_formMatrix = formMatrix;
+ if(count == 0) {
+ m_LineObj.Add(Obj);
+ return;
+ }
+ if (IsSameAsPreTextObject(pTextObj, ObjPos)) {
+ return;
+ }
+ PDFTEXT_Obj prev_Obj = m_LineObj.GetAt(count - 1);
+ CPDF_TextObjectItem item;
+ int nItem = prev_Obj.m_pTextObj->CountItems();
+ prev_Obj.m_pTextObj->GetItemInfo(nItem - 1, &item);
+ FX_FLOAT prev_width = GetCharWidth(item.m_CharCode, prev_Obj.m_pTextObj->GetFont()) * prev_Obj.m_pTextObj->GetFontSize() / 1000;
+ CFX_AffineMatrix prev_matrix;
+ prev_Obj.m_pTextObj->GetTextMatrix(&prev_matrix);
+ prev_width = FXSYS_fabs(prev_width);
+ prev_matrix.Concat(prev_Obj.m_formMatrix);
+ prev_width = prev_matrix.TransformDistance(prev_width);
+ pTextObj->GetItemInfo(0, &item);
+ FX_FLOAT this_width = GetCharWidth(item.m_CharCode, pTextObj->GetFont()) * pTextObj->GetFontSize() / 1000;
+ this_width = FXSYS_fabs(this_width);
+ CFX_AffineMatrix this_matrix;
+ pTextObj->GetTextMatrix(&this_matrix);
+ this_width = FXSYS_fabs(this_width);
+ this_matrix.Concat(formMatrix);
+ this_width = this_matrix.TransformDistance(this_width);
+ FX_FLOAT threshold = prev_width > this_width ? prev_width / 4 : this_width / 4;
+ FX_FLOAT prev_x = prev_Obj.m_pTextObj->GetPosX(), prev_y = prev_Obj.m_pTextObj->GetPosY();
+ prev_Obj.m_formMatrix.Transform(prev_x, prev_y);
+ m_DisplayMatrix.Transform(prev_x, prev_y);
+ FX_FLOAT this_x = pTextObj->GetPosX(), this_y = pTextObj->GetPosY();
+ formMatrix.Transform(this_x, this_y);
+ m_DisplayMatrix.Transform(this_x, this_y);
+ if (FXSYS_fabs(this_y - prev_y) > threshold * 2) {
+ for(int i = 0; i < count; i++) {
+ ProcessTextObject(m_LineObj.GetAt(i));
+ }
+ m_LineObj.RemoveAll();
+ m_LineObj.Add(Obj);
+ return;
+ }
+ int i = 0;
+ if(m_ParseOptions.m_bNormalizeObjs) {
+ for(i = count - 1; i >= 0; i--) {
+ PDFTEXT_Obj prev_Obj = m_LineObj.GetAt(i);
+ CFX_AffineMatrix prev_matrix;
+ prev_Obj.m_pTextObj->GetTextMatrix(&prev_matrix);
+ FX_FLOAT Prev_x = prev_Obj.m_pTextObj->GetPosX(), Prev_y = prev_Obj.m_pTextObj->GetPosY();
+ prev_Obj.m_formMatrix.Transform(Prev_x, Prev_y);
+ m_DisplayMatrix.Transform(Prev_x, Prev_y);
+ if(this_x >= Prev_x) {
+ if(i == count - 1) {
+ m_LineObj.Add(Obj);
+ } else {
+ m_LineObj.InsertAt(i + 1, Obj);
+ }
+ break;
+ }
+ }
+ if(i < 0) {
+ m_LineObj.InsertAt(0, Obj);
+ }
+ } else {
+ m_LineObj.Add(Obj);
+ }
+}
+FX_INT32 CPDF_TextPage::PreMarkedContent(PDFTEXT_Obj Obj)
+{
+ CPDF_TextObject* pTextObj = Obj.m_pTextObj;
+ CPDF_ContentMarkData* pMarkData = (CPDF_ContentMarkData*)pTextObj->m_ContentMark.GetObject();
+ if(!pMarkData) {
+ return FPDFTEXT_MC_PASS;
+ }
+ int nContentMark = pMarkData->CountItems();
+ if (nContentMark < 1) {
+ return FPDFTEXT_MC_PASS;
+ }
+ CFX_WideString actText;
+ FX_BOOL bExist = FALSE;
+ CPDF_Dictionary* pDict = NULL;
+ int n = 0;
+ for (n = 0; n < nContentMark; n++) {
+ CPDF_ContentMarkItem& item = pMarkData->GetItem(n);
+ CFX_ByteString tagStr = (CFX_ByteString)item.GetName();
+ pDict = (CPDF_Dictionary*)item.GetParam();
+ CPDF_String* temp = (CPDF_String*)pDict->GetElement(FX_BSTRC("ActualText"));
+ if (temp) {
+ bExist = TRUE;
+ actText = temp->GetUnicodeText();
+ }
+ }
+ if (!bExist) {
+ return FPDFTEXT_MC_PASS;
+ }
+ if (m_pPreTextObj) {
+ if (CPDF_ContentMarkData* pPreMarkData = (CPDF_ContentMarkData*)m_pPreTextObj->m_ContentMark.GetObject()) {
+ if (pPreMarkData->CountItems() == n) {
+ CPDF_ContentMarkItem& item = pPreMarkData->GetItem(n - 1);
+ if (pDict == item.GetParam()) {
+ return FPDFTEXT_MC_DONE;
+ }
+ }
+ }
+ }
+ CPDF_Font* pFont = pTextObj->GetFont();
+ FX_STRSIZE nItems = actText.GetLength();
+ if (nItems < 1) {
+ return FPDFTEXT_MC_PASS;
+ }
+ bExist = FALSE;
+ for (FX_STRSIZE i = 0; i < nItems; i++) {
+ FX_WCHAR wChar = actText.GetAt(i);
+ if (-1 == pFont->CharCodeFromUnicode(wChar)) {
+ continue;
+ } else {
+ bExist = TRUE;
+ break;
+ }
+ }
+ if (!bExist) {
+ return FPDFTEXT_MC_PASS;
+ }
+ bExist = FALSE;
+ for (FX_STRSIZE j = 0; j < nItems; j++) {
+ FX_WCHAR wChar = actText.GetAt(j);
+ if ((wChar > 0x80 && wChar < 0xFFFD) || (wChar <= 0x80 && isprint(wChar))) {
+ bExist = TRUE;
+ break;
+ }
+ }
+ if (!bExist) {
+ return FPDFTEXT_MC_DONE;
+ }
+ return FPDFTEXT_MC_DELAY;
+}
+void CPDF_TextPage::ProcessMarkedContent(PDFTEXT_Obj Obj)
+{
+ CPDF_TextObject* pTextObj = Obj.m_pTextObj;
+ CPDF_ContentMarkData* pMarkData = (CPDF_ContentMarkData*)pTextObj->m_ContentMark.GetObject();
+ if(!pMarkData) {
+ return;
+ }
+ int nContentMark = pMarkData->CountItems();
+ if (nContentMark < 1) {
+ return;
+ }
+ CFX_WideString actText;
+ CPDF_Dictionary* pDict = NULL;
+ int n = 0;
+ for (n = 0; n < nContentMark; n++) {
+ CPDF_ContentMarkItem& item = pMarkData->GetItem(n);
+ CFX_ByteString tagStr = (CFX_ByteString)item.GetName();
+ pDict = (CPDF_Dictionary*)item.GetParam();
+ CPDF_String* temp = (CPDF_String*)pDict->GetElement(FX_BSTRC("ActualText"));
+ if (temp) {
+ actText = temp->GetUnicodeText();
+ }
+ }
+ FX_STRSIZE nItems = actText.GetLength();
+ if (nItems < 1) {
+ return;
+ }
+ CPDF_Font* pFont = pTextObj->GetFont();
+ CFX_AffineMatrix formMatrix = Obj.m_formMatrix;
+ CFX_AffineMatrix matrix;
+ pTextObj->GetTextMatrix(&matrix);
+ matrix.Concat(formMatrix);
+ FX_FLOAT fPosX = pTextObj->GetPosX();
+ FX_FLOAT fPosY = pTextObj->GetPosY();
+ int nCharInfoIndex = m_TextBuf.GetLength();
+ CFX_FloatRect charBox;
+ charBox.top = pTextObj->m_Top;
+ charBox.left = pTextObj->m_Left;
+ charBox.right = pTextObj->m_Right;
+ charBox.bottom = pTextObj->m_Bottom;
+ for (FX_STRSIZE k = 0; k < nItems; k++) {
+ FX_WCHAR wChar = actText.GetAt(k);
+ if (wChar <= 0x80 && !isprint(wChar)) {
+ wChar = 0x20;
+ }
+ if (wChar >= 0xFFFD) {
+ continue;
+ }
+ PAGECHAR_INFO charinfo;
+ charinfo.m_OriginX = fPosX;
+ charinfo.m_OriginY = fPosY;
+ charinfo.m_Index = nCharInfoIndex;
+ charinfo.m_Unicode = wChar;
+ charinfo.m_CharCode = pFont->CharCodeFromUnicode(wChar);
+ charinfo.m_Flag = FPDFTEXT_CHAR_PIECE;
+ charinfo.m_pTextObj = pTextObj;
+ charinfo.m_CharBox.top = charBox.top;
+ charinfo.m_CharBox.left = charBox.left;
+ charinfo.m_CharBox.right = charBox.right;
+ charinfo.m_CharBox.bottom = charBox.bottom;
+ charinfo.m_Matrix.Copy(matrix);
+ m_TempTextBuf.AppendChar(wChar);
+ m_TempCharList.Add(charinfo);
+ }
+}
+void CPDF_TextPage::FindPreviousTextObject(void)
+{
+ if (m_TempCharList.GetSize() < 1 && m_charList.GetSize() < 1) {
+ return;
+ }
+ PAGECHAR_INFO preChar;
+ if (m_TempCharList.GetSize() >= 1) {
+ preChar = *(PAGECHAR_INFO*)m_TempCharList.GetAt(m_TempCharList.GetSize() - 1);
+ } else {
+ preChar = *(PAGECHAR_INFO*)m_charList.GetAt(m_charList.GetSize() - 1);
+ }
+ if (preChar.m_pTextObj) {
+ m_pPreTextObj = preChar.m_pTextObj;
+ }
+}
+void CPDF_TextPage::ProcessTextObject(PDFTEXT_Obj Obj)
+{
+ CPDF_TextObject* pTextObj = Obj.m_pTextObj;
+ if(FXSYS_fabs(pTextObj->m_Right - pTextObj->m_Left) < 0.01f ) {
+ return;
+ }
+ CFX_AffineMatrix formMatrix = Obj.m_formMatrix;
+ CPDF_Font* pFont = pTextObj->GetFont();
+ CFX_AffineMatrix matrix;
+ pTextObj->GetTextMatrix(&matrix);
+ matrix.Concat(formMatrix);
+ FX_INT32 bPreMKC = PreMarkedContent(Obj);
+ if (FPDFTEXT_MC_DONE == bPreMKC) {
+ m_pPreTextObj = pTextObj;
+ m_perMatrix.Copy(formMatrix);
+ return;
+ }
+ int result = 0;
+ if (m_pPreTextObj) {
+ result = ProcessInsertObject(pTextObj, formMatrix);
+ if (2 == result) {
+ m_CurlineRect = CFX_FloatRect(Obj.m_pTextObj->m_Left, Obj.m_pTextObj->m_Bottom, Obj.m_pTextObj->m_Right, Obj.m_pTextObj->m_Top);
+ } else {
+ m_CurlineRect.Union(CFX_FloatRect(Obj.m_pTextObj->m_Left, Obj.m_pTextObj->m_Bottom, Obj.m_pTextObj->m_Right, Obj.m_pTextObj->m_Top));
+ }
+ PAGECHAR_INFO generateChar;
+ if (result == 1) {
+ if (GenerateCharInfo(TEXT_BLANK_CHAR, generateChar)) {
+ if (!formMatrix.IsIdentity()) {
+ generateChar.m_Matrix.Copy(formMatrix);
+ }
+ m_TempTextBuf.AppendChar(TEXT_BLANK_CHAR);
+ m_TempCharList.Add(generateChar);
+ }
+ } else if(result == 2) {
+ CloseTempLine();
+ if(m_TextBuf.GetSize()) {
+ if(m_ParseOptions.m_bGetCharCodeOnly) {
+ m_TextBuf.AppendChar(TEXT_RETURN_CHAR);
+ m_TextBuf.AppendChar(TEXT_LINEFEED_CHAR);
+ } else {
+ if(GenerateCharInfo(TEXT_RETURN_CHAR, generateChar)) {
+ m_TextBuf.AppendChar(TEXT_RETURN_CHAR);
+ if (!formMatrix.IsIdentity()) {
+ generateChar.m_Matrix.Copy(formMatrix);
+ }
+ m_charList.Add(generateChar);
+ }
+ if(GenerateCharInfo(TEXT_LINEFEED_CHAR, generateChar)) {
+ m_TextBuf.AppendChar(TEXT_LINEFEED_CHAR);
+ if (!formMatrix.IsIdentity()) {
+ generateChar.m_Matrix.Copy(formMatrix);
+ }
+ m_charList.Add(generateChar);
+ }
+ }
+ }
+ } else if (result == 3 && !m_ParseOptions.m_bOutputHyphen) {
+ FX_INT32 nChars = pTextObj->CountChars();
+ if (nChars == 1) {
+ CPDF_TextObjectItem item;
+ pTextObj->GetCharInfo(0, &item);
+ CFX_WideString wstrItem = pTextObj->GetFont()->UnicodeFromCharCode(item.m_CharCode);
+ if(wstrItem.IsEmpty()) {
+ wstrItem += (FX_WCHAR)item.m_CharCode;
+ }
+ FX_WCHAR curChar = wstrItem.GetAt(0);
+ if (0x2D == curChar || 0xAD == curChar) {
+ return;
+ }
+ }
+ while (m_TempTextBuf.GetSize() > 0 && m_TempTextBuf.GetWideString().GetAt(m_TempTextBuf.GetLength() - 1) == 0x20) {
+ m_TempTextBuf.Delete(m_TempTextBuf.GetLength() - 1, 1);
+ m_TempCharList.Delete(m_TempCharList.GetSize() - 1);
+ }
+ PAGECHAR_INFO* cha = (PAGECHAR_INFO*)m_TempCharList.GetAt(m_TempCharList.GetSize() - 1);
+ m_TempTextBuf.Delete(m_TempTextBuf.GetLength() - 1, 1);
+#ifdef FOXIT_CHROME_BUILD
+ cha->m_Unicode = 0x2;
+ cha->m_Flag = FPDFTEXT_CHAR_HYPHEN;
+ m_TempTextBuf.AppendChar(0xfffe);
+#else
+ cha->m_Unicode = 0;
+ m_TempTextBuf.AppendChar(0xfffe);
+#endif
+ }
+ } else {
+ m_CurlineRect = CFX_FloatRect(Obj.m_pTextObj->m_Left, Obj.m_pTextObj->m_Bottom, Obj.m_pTextObj->m_Right, Obj.m_pTextObj->m_Top);
+ }
+ if (FPDFTEXT_MC_DELAY == bPreMKC) {
+ ProcessMarkedContent(Obj);
+ m_pPreTextObj = pTextObj;
+ m_perMatrix.Copy(formMatrix);
+ return;
+ }
+ m_pPreTextObj = pTextObj;
+ m_perMatrix.Copy(formMatrix);
+ int nItems = pTextObj->CountItems();
+ FX_FLOAT spacing = 0;
+ FX_FLOAT baseSpace = 0.0;
+ FX_BOOL bAllChar = TRUE;
+ if (pTextObj->m_TextState.GetObject()->m_CharSpace && nItems >= 3) {
+ spacing = matrix.TransformDistance(pTextObj->m_TextState.GetObject()->m_CharSpace);
+ baseSpace = spacing;
+ for (int i = 0; i < nItems; i++) {
+ CPDF_TextObjectItem item;
+ pTextObj->GetItemInfo(i, &item);
+ if (item.m_CharCode == (FX_DWORD) - 1) {
+ FX_FLOAT fontsize_h = pTextObj->m_TextState.GetFontSizeH();
+ FX_FLOAT kerning = -fontsize_h * item.m_OriginX / 1000;
+ if(kerning + spacing < baseSpace) {
+ baseSpace = kerning + spacing;
+ }
+ bAllChar = FALSE;
+ }
+ }
+ spacing = 0;
+ if(baseSpace < 0.0 || (nItems == 3 && !bAllChar)) {
+ baseSpace = 0.0;
+ }
+ }
+ for (int i = 0; i < nItems; i++) {
+ CPDF_TextObjectItem item;
+ PAGECHAR_INFO charinfo;
+ charinfo.m_OriginX = 0;
+ charinfo.m_OriginY = 0;
+ pTextObj->GetItemInfo(i, &item);
+ if (item.m_CharCode == (FX_DWORD) - 1) {
+ CFX_WideString str = m_TempTextBuf.GetWideString();
+ if(str.IsEmpty()) {
+ str = m_TextBuf.GetWideString();
+ }
+ if (str.IsEmpty() || str.GetAt(str.GetLength() - 1) == TEXT_BLANK_CHAR) {
+ continue;
+ }
+ FX_FLOAT fontsize_h = pTextObj->m_TextState.GetFontSizeH();
+ spacing = -fontsize_h * item.m_OriginX / 1000;
+ continue;
+ }
+ FX_FLOAT charSpace = pTextObj->m_TextState.GetObject()->m_CharSpace;
+ if (charSpace > 0.001) {
+ spacing += matrix.TransformDistance(charSpace);
+ } else if(charSpace < -0.001) {
+ spacing -= matrix.TransformDistance(FXSYS_fabs(charSpace));
+ }
+ spacing -= baseSpace;
+ if (spacing && i > 0) {
+ int last_width = 0;
+ FX_FLOAT fontsize_h = pTextObj->m_TextState.GetFontSizeH();
+ FX_DWORD space_charcode = pFont->CharCodeFromUnicode(' ');
+ FX_FLOAT threshold = 0;
+ if (space_charcode != -1) {
+ threshold = fontsize_h * pFont->GetCharWidthF(space_charcode) / 1000 ;
+ }
+ if (threshold > fontsize_h / 3) {
+ threshold = 0;
+ } else {
+ threshold /= 2;
+ }
+ if (threshold == 0) {
+ threshold = fontsize_h;
+ int this_width = FXSYS_abs(GetCharWidth(item.m_CharCode, pFont));
+ threshold = this_width > last_width ? (FX_FLOAT)this_width : (FX_FLOAT)last_width;
+ int nDivide = 6;
+ if (threshold < 300) {
+ nDivide = 2;
+ } else if (threshold < 500) {
+ nDivide = 4;
+ } else if (threshold < 700) {
+ nDivide = 5;
+ }
+ threshold = threshold / nDivide;
+ threshold = fontsize_h * threshold / 1000;
+ }
+ if (threshold && (spacing && spacing >= threshold) ) {
+ charinfo.m_Unicode = TEXT_BLANK_CHAR;
+ charinfo.m_Flag = FPDFTEXT_CHAR_GENERATED;
+ charinfo.m_pTextObj = pTextObj;
+ charinfo.m_Index = m_TextBuf.GetLength();
+ m_TempTextBuf.AppendChar(TEXT_BLANK_CHAR);
+ charinfo.m_CharCode = -1;
+ charinfo.m_Matrix.Copy(formMatrix);
+ matrix.Transform(item.m_OriginX, item.m_OriginY, charinfo.m_OriginX, charinfo.m_OriginY);
+ charinfo.m_CharBox = CFX_FloatRect(charinfo.m_OriginX, charinfo.m_OriginY, charinfo.m_OriginX, charinfo.m_OriginY);
+ m_TempCharList.Add(charinfo);
+ }
+ if (item.m_CharCode == (FX_DWORD) - 1) {
+ continue;
+ }
+ }
+ spacing = 0;
+ CFX_WideString wstrItem = pFont->UnicodeFromCharCode(item.m_CharCode);
+ FX_BOOL bNoUnicode = FALSE;
+ FX_WCHAR wChar = wstrItem.GetAt(0);
+ if ((wstrItem.IsEmpty() || wChar == 0) && item.m_CharCode) {
+ if(wstrItem.IsEmpty()) {
+ wstrItem += (FX_WCHAR)item.m_CharCode;
+ } else {
+ wstrItem.SetAt(0, (FX_WCHAR)item.m_CharCode);
+ }
+ bNoUnicode = TRUE;
+ }
+ charinfo.m_Index = -1;
+ charinfo.m_CharCode = item.m_CharCode;
+ if(bNoUnicode) {
+ charinfo.m_Flag = FPDFTEXT_CHAR_UNUNICODE;
+ } else {
+ charinfo.m_Flag = FPDFTEXT_CHAR_NORMAL;
+ }
+ charinfo.m_pTextObj = pTextObj;
+ charinfo.m_OriginX = 0, charinfo.m_OriginY = 0;
+ matrix.Transform(item.m_OriginX, item.m_OriginY, charinfo.m_OriginX, charinfo.m_OriginY);
+ FX_RECT rect(0, 0, 0, 0);
+ rect.Intersect(0, 0, 0, 0);
+ charinfo.m_pTextObj->GetFont()->GetCharBBox(charinfo.m_CharCode, rect);
+ charinfo.m_CharBox.top = rect.top * pTextObj->GetFontSize() / 1000 + item.m_OriginY;
+ charinfo.m_CharBox.left = rect.left * pTextObj->GetFontSize() / 1000 + item.m_OriginX;
+ charinfo.m_CharBox.right = rect.right * pTextObj->GetFontSize() / 1000 + item.m_OriginX;
+ charinfo.m_CharBox.bottom = rect.bottom * pTextObj->GetFontSize() / 1000 + item.m_OriginY;
+ if (fabsf(charinfo.m_CharBox.top - charinfo.m_CharBox.bottom) < 0.01f) {
+ charinfo.m_CharBox.top = charinfo.m_CharBox.bottom + pTextObj->GetFontSize();
+ }
+ if (fabsf(charinfo.m_CharBox.right - charinfo.m_CharBox.left) < 0.01f) {
+ charinfo.m_CharBox.right = charinfo.m_CharBox.left + pTextObj->GetCharWidth(charinfo.m_CharCode);
+ }
+ matrix.TransformRect(charinfo.m_CharBox);
+ charinfo.m_Matrix.Copy(matrix);
+ if (wstrItem.IsEmpty()) {
+ charinfo.m_Unicode = 0;
+ m_TempCharList.Add(charinfo);
+ m_TempTextBuf.AppendChar(0xfffe);
+ continue;
+ } else {
+ int nTotal = wstrItem.GetLength();
+ int n = 0;
+ FX_BOOL bDel = FALSE;
+ while (n < m_TempCharList.GetSize() && n < 7) {
+ n++;
+ PAGECHAR_INFO* charinfo1 = (PAGECHAR_INFO*)m_TempCharList.GetAt(m_TempCharList.GetSize() - n);
+ if(charinfo1->m_CharCode == charinfo.m_CharCode &&
+ charinfo1->m_pTextObj->GetFont() == charinfo.m_pTextObj->GetFont() &&
+ FXSYS_fabs(charinfo1->m_OriginX - charinfo.m_OriginX) < TEXT_CHARRATIO_GAPDELTA * pTextObj->GetFontSize() &&
+ FXSYS_fabs(charinfo1->m_OriginY - charinfo.m_OriginY) < TEXT_CHARRATIO_GAPDELTA * pTextObj->GetFontSize() ) {
+ bDel = TRUE;
+ break;
+ }
+ }
+ if(!bDel) {
+ for (int nIndex = 0; nIndex < nTotal; nIndex++) {
+ charinfo.m_Unicode = wstrItem.GetAt(nIndex);
+ if (charinfo.m_Unicode) {
+ charinfo.m_Index = m_TextBuf.GetLength();
+ m_TempTextBuf.AppendChar(charinfo.m_Unicode);
+ } else {
+ m_TempTextBuf.AppendChar(0xfffe);
+ }
+ m_TempCharList.Add(charinfo);
+ }
+ } else if(i == 0) {
+ CFX_WideString str = m_TempTextBuf.GetWideString();
+ if (!str.IsEmpty() && str.GetAt(str.GetLength() - 1) == TEXT_BLANK_CHAR) {
+ m_TempTextBuf.Delete(m_TempTextBuf.GetLength() - 1, 1);
+ m_TempCharList.Delete(m_TempCharList.GetSize() - 1);
+ }
+ }
+ }
+ }
+}
+FX_INT32 CPDF_TextPage::GetTextObjectWritingMode(const CPDF_TextObject* pTextObj)
+{
+ FX_INT32 nChars = pTextObj->CountChars();
+ if (nChars == 1) {
+ return m_TextlineDir;
+ }
+ CPDF_TextObjectItem first, last;
+ pTextObj->GetCharInfo(0, &first);
+ pTextObj->GetCharInfo(nChars - 1, &last);
+ CFX_Matrix textMatrix;
+ pTextObj->GetTextMatrix(&textMatrix);
+ textMatrix.TransformPoint(first.m_OriginX, first.m_OriginY);
+ textMatrix.TransformPoint(last.m_OriginX, last.m_OriginY);
+ FX_FLOAT dX = FXSYS_fabs(last.m_OriginX - first.m_OriginX);
+ FX_FLOAT dY = FXSYS_fabs(last.m_OriginY - first.m_OriginY);
+ if (dX <= 0.0001f && dY <= 0.0001f) {
+ return -1;
+ }
+ CFX_VectorF v;
+ v.Set(dX, dY);
+ v.Normalize();
+ if (v.y <= 0.0872f) {
+ if (v.x <= 0.0872f) {
+ return m_TextlineDir;
+ }
+ return 0;
+ } else if (v.x <= 0.0872f) {
+ return 1;
+ }
+ return m_TextlineDir;
+}
+FX_BOOL CPDF_TextPage::IsHyphen(FX_WCHAR curChar)
+{
+ CFX_WideString strCurText = m_TempTextBuf.GetWideString();
+ if(strCurText.GetLength() == 0) {
+ strCurText = m_TextBuf.GetWideString();
+ }
+ FX_STRSIZE nCount = strCurText.GetLength();
+ int nIndex = nCount - 1;
+ FX_WCHAR wcTmp = strCurText.GetAt(nIndex);
+ while(wcTmp == 0x20 && nIndex <= nCount - 1 && nIndex >= 0) {
+ wcTmp = strCurText.GetAt(--nIndex);
+ }
+ if (0x2D == wcTmp || 0xAD == wcTmp) {
+ if (--nIndex > 0) {
+ FX_WCHAR preChar = strCurText.GetAt((nIndex));
+ if (((preChar >= L'A' && preChar <= L'Z') || (preChar >= L'a' && preChar <= L'z'))
+ && ((curChar >= L'A' && curChar <= L'Z') || (curChar >= L'a' && curChar <= L'z'))) {
+ return TRUE;
+ }
+ }
+ int size = m_TempCharList.GetSize();
+ PAGECHAR_INFO preChar;
+ if (size) {
+ preChar = (PAGECHAR_INFO)m_TempCharList[size - 1];
+ } else {
+ size = m_charList.GetSize();
+ if(size == 0) {
+ return FALSE;
+ }
+ preChar = (PAGECHAR_INFO)m_charList[size - 1];
+ }
+ if (FPDFTEXT_CHAR_PIECE == preChar.m_Flag)
+ if (0xAD == preChar.m_Unicode || 0x2D == preChar.m_Unicode) {
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+int CPDF_TextPage::ProcessInsertObject(const CPDF_TextObject* pObj, CFX_AffineMatrix formMatrix)
+{
+ FindPreviousTextObject();
+ FX_BOOL bNewline = FALSE;
+ int WritingMode = GetTextObjectWritingMode(pObj);
+ if(WritingMode == -1) {
+ WritingMode = GetTextObjectWritingMode(m_pPreTextObj);
+ }
+ CFX_FloatRect this_rect(pObj->m_Left, pObj->m_Bottom, pObj->m_Right, pObj->m_Top);
+ CFX_FloatRect prev_rect(m_pPreTextObj->m_Left, m_pPreTextObj->m_Bottom, m_pPreTextObj->m_Right, m_pPreTextObj->m_Top);
+ CPDF_TextObjectItem PrevItem, item;
+ int nItem = m_pPreTextObj->CountItems();
+ m_pPreTextObj->GetItemInfo(nItem - 1, &PrevItem);
+ pObj->GetItemInfo(0, &item);
+ CFX_WideString wstrItem = pObj->GetFont()->UnicodeFromCharCode(item.m_CharCode);
+ if(wstrItem.IsEmpty()) {
+ wstrItem += (FX_WCHAR)item.m_CharCode;
+ }
+ FX_WCHAR curChar = wstrItem.GetAt(0);
+ if(WritingMode == 0) {
+ if(this_rect.Height() > 4.5 && prev_rect.Height() > 4.5) {
+ FX_FLOAT top = this_rect.top < prev_rect.top ? this_rect.top : prev_rect.top;
+ FX_FLOAT bottom = this_rect.bottom > prev_rect.bottom ? this_rect.bottom : prev_rect.bottom;
+ if(bottom >= top) {
+ if(IsHyphen(curChar)) {
+ return 3;
+ }
+ return 2;
+ }
+ }
+ } else if (WritingMode == 1) {
+ if(this_rect.Width() > pObj->GetFontSize() * 0.1f && prev_rect.Width() > m_pPreTextObj->GetFontSize() * 0.1f) {
+ FX_FLOAT left = this_rect.left > m_CurlineRect.left ? this_rect.left : m_CurlineRect.left;
+ FX_FLOAT right = this_rect.right < m_CurlineRect.right ? this_rect.right : m_CurlineRect.right;
+ if(right <= left) {
+ if(IsHyphen(curChar)) {
+ return 3;
+ }
+ return 2;
+ }
+ }
+ }
+ FX_FLOAT last_pos = PrevItem.m_OriginX;
+ int nLastWidth = GetCharWidth(PrevItem.m_CharCode, m_pPreTextObj->GetFont());
+ FX_FLOAT last_width = nLastWidth * m_pPreTextObj->GetFontSize() / 1000;
+ last_width = FXSYS_fabs(last_width);
+ int nThisWidth = GetCharWidth(item.m_CharCode, pObj->GetFont());
+ FX_FLOAT this_width = nThisWidth * pObj->GetFontSize() / 1000;
+ this_width = FXSYS_fabs(this_width);
+ FX_FLOAT threshold = last_width > this_width ? last_width / 4 : this_width / 4;
+ CFX_AffineMatrix prev_matrix, prev_reverse;
+ m_pPreTextObj->GetTextMatrix(&prev_matrix);
+ prev_matrix.Concat(m_perMatrix);
+ prev_reverse.SetReverse(prev_matrix);
+ FX_FLOAT x = pObj->GetPosX();
+ FX_FLOAT y = pObj->GetPosY();
+ formMatrix.Transform(x, y);
+ prev_reverse.Transform(x, y);
+ if(last_width < this_width) {
+ threshold = prev_reverse.TransformDistance(threshold);
+ }
+ CFX_FloatRect rect1(m_pPreTextObj->m_Left, pObj->m_Bottom, m_pPreTextObj->m_Right, pObj->m_Top);
+ CFX_FloatRect rect2(m_pPreTextObj->m_Left, m_pPreTextObj->m_Bottom, m_pPreTextObj->m_Right, m_pPreTextObj->m_Top);
+ CFX_FloatRect rect3 = rect1;
+ rect1.Intersect(rect2);
+ if (WritingMode == 0) {
+ if ((rect1.IsEmpty() && rect2.Height() > 5 && rect3.Height() > 5)
+ || ((y > threshold * 2 || y < threshold * -3) && (FXSYS_fabs(y) < 1 ? FXSYS_fabs(x) < FXSYS_fabs(y) : TRUE))) {
+ bNewline = TRUE;
+ if(nItem > 1 ) {
+ CPDF_TextObjectItem tempItem;
+ m_pPreTextObj->GetItemInfo(0, &tempItem);
+ CFX_AffineMatrix m;
+ m_pPreTextObj->GetTextMatrix(&m);
+ if(PrevItem.m_OriginX > tempItem.m_OriginX &&
+ m_DisplayMatrix.a > 0.9 && m_DisplayMatrix.b < 0.1 &&
+ m_DisplayMatrix.c < 0.1 && m_DisplayMatrix.d < -0.9
+ && m.b < 0.1 && m.c < 0.1 ) {
+ CFX_FloatRect re(0, m_pPreTextObj->m_Bottom, 1000, m_pPreTextObj->m_Top);
+ if(re.Contains(pObj->GetPosX(), pObj->GetPosY())) {
+ bNewline = FALSE;
+ } else {
+ CFX_FloatRect re(0, pObj->m_Bottom, 1000, pObj->m_Top);
+ if(re.Contains(m_pPreTextObj->GetPosX(), m_pPreTextObj->GetPosY())) {
+ bNewline = FALSE;
+ }
+ }
+ }
+ }
+ }
+ }
+ if(bNewline) {
+ if(IsHyphen(curChar)) {
+ return 3;
+ }
+ return 2;
+ }
+ FX_INT32 nChars = pObj->CountChars();
+ if (nChars == 1 && ( 0x2D == curChar || 0xAD == curChar))
+ if (IsHyphen(curChar)) {
+ return 3;
+ }
+ CFX_WideString PrevStr = m_pPreTextObj->GetFont()->UnicodeFromCharCode(PrevItem.m_CharCode);
+ FX_WCHAR preChar = PrevStr.GetAt(PrevStr.GetLength() - 1);
+ CFX_AffineMatrix matrix;
+ pObj->GetTextMatrix(&matrix);
+ matrix.Concat(formMatrix);
+ threshold = (FX_FLOAT)(nLastWidth > nThisWidth ? nLastWidth : nThisWidth);
+ threshold = threshold > 400 ? (threshold < 700 ? threshold / 4 : (threshold > 800 ? threshold / 6 : threshold / 5)) : (threshold / 2);
+ if(nLastWidth >= nThisWidth) {
+ threshold *= FXSYS_fabs(m_pPreTextObj->GetFontSize());
+ } else {
+ threshold *= FXSYS_fabs(pObj->GetFontSize());
+ threshold = matrix.TransformDistance(threshold);
+ threshold = prev_reverse.TransformDistance(threshold);
+ }
+ threshold /= 1000;
+ if((threshold < 1.4881 && threshold > 1.4879)
+ || (threshold < 1.39001 && threshold > 1.38999)) {
+ threshold *= 1.5;
+ }
+ if (FXSYS_fabs(last_pos + last_width - x) > threshold && curChar != L' ' && preChar != L' ')
+ if (curChar != L' ' && preChar != L' ') {
+ if((x - last_pos - last_width) > threshold || (last_pos - x - last_width) > threshold) {
+ return 1;
+ }
+ if(x < 0 && (last_pos - x - last_width) > threshold) {
+ return 1;
+ }
+ if((x - last_pos - last_width) > this_width || (x - last_pos - this_width) > last_width ) {
+ return 1;
+ }
+ }
+ return 0;
+}
+FX_BOOL CPDF_TextPage::IsSameTextObject(CPDF_TextObject* pTextObj1, CPDF_TextObject* pTextObj2)
+{
+ if (!pTextObj1 || !pTextObj2) {
+ return FALSE;
+ }
+ CFX_FloatRect rcPreObj(pTextObj2->m_Left, pTextObj2->m_Bottom, pTextObj2->m_Right, pTextObj2->m_Top);
+ CFX_FloatRect rcCurObj(pTextObj1->m_Left, pTextObj1->m_Bottom, pTextObj1->m_Right, pTextObj1->m_Top);
+ if (rcPreObj.IsEmpty() && rcCurObj.IsEmpty() && !m_ParseOptions.m_bGetCharCodeOnly) {
+ FX_FLOAT dbXdif = FXSYS_fabs(rcPreObj.left - rcCurObj.left);
+ int nCount = m_charList.GetSize();
+ if (nCount >= 2) {
+ PAGECHAR_INFO perCharTemp = (PAGECHAR_INFO)m_charList[nCount - 2];
+ FX_FLOAT dbSpace = perCharTemp.m_CharBox.Width();
+ if (dbXdif > dbSpace) {
+ return FALSE;
+ }
+ }
+ }
+ if (!rcPreObj.IsEmpty() || !rcCurObj.IsEmpty()) {
+ rcPreObj.Intersect(rcCurObj);
+ if (rcPreObj.IsEmpty()) {
+ return FALSE;
+ }
+ if (FXSYS_fabs(rcPreObj.Width() - rcCurObj.Width()) > rcCurObj.Width() / 2) {
+ return FALSE;
+ }
+ if (pTextObj2->GetFontSize() != pTextObj1->GetFontSize()) {
+ return FALSE;
+ }
+ }
+ int nPreCount = pTextObj2->CountItems();
+ int nCurCount = pTextObj1->CountItems();
+ if (nPreCount != nCurCount) {
+ return FALSE;
+ }
+ CPDF_TextObjectItem itemPer, itemCur;
+ for (int i = 0; i < nPreCount; i++) {
+ pTextObj2->GetItemInfo(i, &itemPer);
+ pTextObj1->GetItemInfo(i, &itemCur);
+ if (itemCur.m_CharCode != itemPer.m_CharCode) {
+ return FALSE;
+ }
+ }
+ if(FXSYS_fabs(pTextObj1->GetPosX() - pTextObj2->GetPosX()) > GetCharWidth(itemPer.m_CharCode, pTextObj2->GetFont())*pTextObj2->GetFontSize() / 1000 * 0.9 ||
+ FXSYS_fabs(pTextObj1->GetPosY() - pTextObj2->GetPosY()) >
+ FX_MAX(FX_MAX(rcPreObj.Height() , rcPreObj.Width()), pTextObj2->GetFontSize()) / 8) {
+ return FALSE;
+ }
+ return TRUE;
+}
+FX_BOOL CPDF_TextPage::IsSameAsPreTextObject(CPDF_TextObject* pTextObj, FX_POSITION ObjPos)
+{
+ if (!pTextObj) {
+ return FALSE;
+ }
+ int i = 0;
+ if (!ObjPos) {
+ ObjPos = m_pPage->GetLastObjectPosition();
+ }
+ CPDF_PageObject* pObj = m_pPage->GetPrevObject(ObjPos);
+ while (i < 5 && ObjPos) {
+ pObj = m_pPage->GetPrevObject(ObjPos);
+ if(pObj == pTextObj) {
+ continue;
+ }
+ if(pObj->m_Type != PDFPAGE_TEXT) {
+ continue;
+ }
+ if(IsSameTextObject((CPDF_TextObject*)pObj, pTextObj)) {
+ return TRUE;
+ }
+ i++;
+ }
+ return FALSE;
+}
+FX_BOOL CPDF_TextPage::GenerateCharInfo(FX_WCHAR unicode, PAGECHAR_INFO& info)
+{
+ int size = m_TempCharList.GetSize();
+ PAGECHAR_INFO preChar;
+ if (size) {
+ preChar = (PAGECHAR_INFO)m_TempCharList[size - 1];
+ } else {
+ size = m_charList.GetSize();
+ if(size == 0) {
+ return FALSE;
+ }
+ preChar = (PAGECHAR_INFO)m_charList[size - 1];
+ }
+ info.m_Index = m_TextBuf.GetLength();
+ info.m_Unicode = unicode;
+ info.m_pTextObj = NULL;
+ info.m_CharCode = -1;
+ info.m_Flag = FPDFTEXT_CHAR_GENERATED;
+ int preWidth = 0;
+ if (preChar.m_pTextObj && preChar.m_CharCode != (FX_DWORD) - 1) {
+ preWidth = GetCharWidth(preChar.m_CharCode, preChar.m_pTextObj->GetFont());
+ }
+ FX_FLOAT fs = 0;
+ if(preChar.m_pTextObj) {
+ fs = preChar.m_pTextObj->GetFontSize();
+ } else {
+ fs = preChar.m_CharBox.Height();
+ }
+ if(!fs) {
+ fs = 1;
+ }
+ info.m_OriginX = preChar.m_OriginX + preWidth * (fs) / 1000;
+ info.m_OriginY = preChar.m_OriginY;
+ info.m_CharBox = CFX_FloatRect(info.m_OriginX, info.m_OriginY, info.m_OriginX, info.m_OriginY);
+ return TRUE;
+}
+FX_BOOL CPDF_TextPage::IsRectIntersect(CFX_FloatRect rect1, CFX_FloatRect rect2)
+{
+ rect1.Intersect(rect2);
+ if(rect1.IsEmpty()) {
+ return FALSE;
+ }
+ return TRUE;
+}
+FX_BOOL CPDF_TextPage::IsLetter(FX_WCHAR unicode)
+{
+ if (unicode < L'A') {
+ return FALSE;
+ }
+ if (unicode > L'Z' && unicode < L'a') {
+ return FALSE;
+ }
+ if (unicode > L'z') {
+ return FALSE;
+ }
+ return TRUE;
+}
+CPDF_TextPageFind::CPDF_TextPageFind(const IPDF_TextPage* pTextPage)
+ : m_IsFind(FALSE),
+ m_pTextPage(NULL)
+{
+ if (!pTextPage) {
+ return;
+ }
+ CPDF_ModuleMgr* pPDFModule = CPDF_ModuleMgr::Get();
+ m_pTextPage = pTextPage;
+ m_strText = m_pTextPage->GetPageText();
+ int nCount = pTextPage->CountChars();
+ if(nCount) {
+ m_CharIndex.Add(0);
+ }
+ for(int i = 0; i < nCount; i++) {
+ FPDF_CHAR_INFO info;
+ pTextPage->GetCharInfo(i, info);
+ int indexSize = m_CharIndex.GetSize();
+ if(info.m_Flag == CHAR_NORMAL || info.m_Flag == CHAR_GENERATED) {
+ if(indexSize % 2) {
+ m_CharIndex.Add(1);
+ } else {
+ if(indexSize <= 0) {
+ continue;
+ }
+ m_CharIndex.SetAt(indexSize - 1, m_CharIndex.GetAt(indexSize - 1) + 1);
+ }
+ } else {
+ if(indexSize % 2) {
+ if(indexSize <= 0) {
+ continue;
+ }
+ m_CharIndex.SetAt(indexSize - 1, i + 1);
+ } else {
+ m_CharIndex.Add(i + 1);
+ }
+ }
+ }
+ int indexSize = m_CharIndex.GetSize();
+ if(indexSize % 2) {
+ m_CharIndex.RemoveAt(indexSize - 1);
+ }
+ m_resStart = 0;
+ m_resEnd = -1;
+}
+int CPDF_TextPageFind::GetCharIndex(int index) const
+{
+ return m_pTextPage->CharIndexFromTextIndex(index);
+ int indexSize = m_CharIndex.GetSize();
+ int count = 0;
+ for(int i = 0; i < indexSize; i += 2) {
+ count += m_CharIndex.GetAt(i + 1);
+ if(count > index) {
+ return index - count + m_CharIndex.GetAt(i + 1) + m_CharIndex.GetAt(i);
+ }
+ }
+ return -1;
+}
+FX_BOOL CPDF_TextPageFind::FindFirst(CFX_WideString findwhat, int flags, int startPos)
+{
+ if (!m_pTextPage) {
+ return FALSE;
+ }
+ if (m_strText.IsEmpty() || m_bMatchCase != (flags & FPDFTEXT_MATCHCASE)) {
+ m_strText = m_pTextPage->GetPageText();
+ }
+ m_findWhat = findwhat;
+ m_flags = flags;
+ m_bMatchCase = flags & FPDFTEXT_MATCHCASE;
+ if (m_strText.IsEmpty()) {
+ m_IsFind = FALSE;
+ return TRUE;
+ }
+ FX_STRSIZE len = findwhat.GetLength();
+ if (!m_bMatchCase) {
+ findwhat.MakeLower();
+ m_strText.MakeLower();
+ }
+ m_bMatchWholeWord = flags & FPDFTEXT_MATCHWHOLEWORD;
+ m_findNextStart = startPos;
+ if (startPos == -1) {
+ m_findPreStart = m_strText.GetLength() - 1;
+ } else {
+ m_findPreStart = startPos;
+ }
+ m_csFindWhatArray.RemoveAll();
+ int i = 0;
+ while(i < len) {
+ if(findwhat.GetAt(i) != ' ') {
+ break;
+ }
+ i++;
+ }
+ if(i < len) {
+ ExtractFindWhat(findwhat);
+ } else {
+ m_csFindWhatArray.Add(findwhat);
+ }
+ if(m_csFindWhatArray.GetSize() <= 0) {
+ return FALSE;
+ }
+ m_IsFind = TRUE;
+ m_resStart = 0;
+ m_resEnd = -1;
+ return TRUE;
+}
+FX_BOOL CPDF_TextPageFind::FindNext()
+{
+ if (!m_pTextPage) {
+ return FALSE;
+ }
+ m_resArray.RemoveAll();
+ if(m_findNextStart == -1) {
+ return FALSE;
+ }
+ if(m_strText.IsEmpty()) {
+ m_IsFind = FALSE;
+ return m_IsFind;
+ }
+ int strLen = m_strText.GetLength();
+ if (m_findNextStart > strLen - 1) {
+ m_IsFind = FALSE;
+ return m_IsFind;
+ }
+ int nCount = m_csFindWhatArray.GetSize();
+ int nResultPos = 0;
+ int nStartPos = 0;
+ nStartPos = m_findNextStart;
+ FX_BOOL bSpaceStart = FALSE;
+ for(int iWord = 0; iWord < nCount; iWord++) {
+ CFX_WideString csWord = m_csFindWhatArray[iWord];
+ if(csWord.IsEmpty()) {
+ if(iWord == nCount - 1) {
+ FX_WCHAR strInsert = m_strText.GetAt(nStartPos);
+ if(strInsert == TEXT_LINEFEED_CHAR || strInsert == TEXT_BLANK_CHAR || strInsert == TEXT_RETURN_CHAR || strInsert == 160) {
+ nResultPos = nStartPos + 1;
+ break;
+ }
+ iWord = -1;
+ } else if(iWord == 0) {
+ bSpaceStart = TRUE;
+ }
+ continue;
+ }
+ int endIndex;
+ nResultPos = m_strText.Find(csWord, nStartPos);
+ if (nResultPos == -1) {
+ m_IsFind = FALSE;
+ return m_IsFind;
+ }
+ endIndex = nResultPos + csWord.GetLength() - 1;
+ if(iWord == 0) {
+ m_resStart = nResultPos;
+ }
+ FX_BOOL bMatch = TRUE;
+ if(iWord != 0 && !bSpaceStart) {
+ int PreResEndPos = nStartPos;
+ int curChar = csWord.GetAt(0);
+ CFX_WideString lastWord = m_csFindWhatArray[iWord - 1];
+ int lastChar = lastWord.GetAt(lastWord.GetLength() - 1);
+ if(nStartPos == nResultPos && !(_IsIgnoreSpaceCharacter(lastChar) || _IsIgnoreSpaceCharacter(curChar))) {
+ bMatch = FALSE;
+ }
+ for(int d = PreResEndPos; d < nResultPos; d++) {
+ FX_WCHAR strInsert = m_strText.GetAt(d);
+ if(strInsert != TEXT_LINEFEED_CHAR && strInsert != TEXT_BLANK_CHAR && strInsert != TEXT_RETURN_CHAR && strInsert != 160) {
+ bMatch = FALSE;
+ break;
+ }
+ }
+ } else if(bSpaceStart) {
+ if(nResultPos > 0) {
+ FX_WCHAR strInsert = m_strText.GetAt(nResultPos - 1);
+ if(strInsert != TEXT_LINEFEED_CHAR && strInsert != TEXT_BLANK_CHAR && strInsert != TEXT_RETURN_CHAR && strInsert != 160) {
+ bMatch = FALSE;
+ m_resStart = nResultPos;
+ } else {
+ m_resStart = nResultPos - 1;
+ }
+ }
+ }
+ if(m_bMatchWholeWord && bMatch) {
+ bMatch = IsMatchWholeWord(m_strText, nResultPos, endIndex);
+ }
+ nStartPos = endIndex + 1;
+ if(!bMatch) {
+ iWord = -1;
+ if(bSpaceStart) {
+ nStartPos = m_resStart + m_csFindWhatArray[1].GetLength();
+ } else {
+ nStartPos = m_resStart + m_csFindWhatArray[0].GetLength();
+ }
+ }
+ }
+ m_resEnd = nResultPos + m_csFindWhatArray[m_csFindWhatArray.GetSize() - 1].GetLength() - 1;
+ m_IsFind = TRUE;
+ int resStart = GetCharIndex(m_resStart);
+ int resEnd = GetCharIndex(m_resEnd);
+ m_pTextPage->GetRectArray(resStart, resEnd - resStart + 1, m_resArray);
+ if(m_flags & FPDFTEXT_CONSECUTIVE) {
+ m_findNextStart = m_resStart + 1;
+ m_findPreStart = m_resEnd - 1;
+ } else {
+ m_findNextStart = m_resEnd + 1;
+ m_findPreStart = m_resStart - 1;
+ }
+ return m_IsFind;
+}
+FX_BOOL CPDF_TextPageFind::FindPrev()
+{
+ if (!m_pTextPage) {
+ return FALSE;
+ }
+ m_resArray.RemoveAll();
+ if(m_strText.IsEmpty() || m_findPreStart < 0) {
+ m_IsFind = FALSE;
+ return m_IsFind;
+ }
+ CPDF_TextPageFind findEngine(m_pTextPage);
+ FX_BOOL ret = findEngine.FindFirst(m_findWhat, m_flags);
+ if(!ret) {
+ m_IsFind = FALSE;
+ return m_IsFind;
+ }
+ int order = -1, MatchedCount = 0;
+ while(ret) {
+ ret = findEngine.FindNext();
+ if(ret) {
+ int order1 = findEngine.GetCurOrder() ;
+ int MatchedCount1 = findEngine.GetMatchedCount();
+ if(((order1 + MatchedCount1) - 1) > m_findPreStart) {
+ break;
+ }
+ order = order1;
+ MatchedCount = MatchedCount1;
+ }
+ }
+ if(order == -1) {
+ m_IsFind = FALSE;
+ return m_IsFind;
+ }
+ m_resStart = m_pTextPage->TextIndexFromCharIndex(order);
+ m_resEnd = m_pTextPage->TextIndexFromCharIndex(order + MatchedCount - 1);
+ m_IsFind = TRUE;
+ m_pTextPage->GetRectArray(order, MatchedCount, m_resArray);
+ if(m_flags & FPDFTEXT_CONSECUTIVE) {
+ m_findNextStart = m_resStart + 1;
+ m_findPreStart = m_resEnd - 1;
+ } else {
+ m_findNextStart = m_resEnd + 1;
+ m_findPreStart = m_resStart - 1;
+ }
+ return m_IsFind;
+}
+void CPDF_TextPageFind::ExtractFindWhat(CFX_WideString findwhat)
+{
+ if(findwhat.IsEmpty()) {
+ return ;
+ }
+ int index = 0;
+ while(1) {
+ CFX_WideString csWord = TEXT_EMPTY;
+ int ret = ExtractSubString(csWord, findwhat, index, TEXT_BLANK_CHAR);
+ if(csWord.IsEmpty()) {
+ if(ret) {
+ m_csFindWhatArray.Add(CFX_WideString(L""));
+ index++;
+ continue;
+ } else {
+ break;
+ }
+ }
+ int pos = 0;
+ FX_BOOL bLastIgnore = FALSE;
+ while(pos < csWord.GetLength()) {
+ CFX_WideString curStr = csWord.Mid(pos, 1);
+ FX_WCHAR curChar = csWord.GetAt(pos);
+ if (_IsIgnoreSpaceCharacter(curChar)) {
+ if (pos > 0 && curChar == 0x2019) {
+ pos++;
+ continue;
+ }
+ if (pos > 0 ) {
+ CFX_WideString preStr = csWord.Mid(0, pos);
+ m_csFindWhatArray.Add(preStr);
+ }
+ m_csFindWhatArray.Add(curStr);
+ if (pos == csWord.GetLength() - 1) {
+ csWord.Empty();
+ break;
+ }
+ csWord = csWord.Right(csWord.GetLength() - pos - 1);
+ pos = 0;
+ bLastIgnore = TRUE;
+ continue;
+ } else {
+ bLastIgnore = FALSE;
+ }
+ pos++;
+ }
+ if (!csWord.IsEmpty()) {
+ m_csFindWhatArray.Add(csWord);
+ }
+ index++;
+ }
+ return;
+}
+FX_BOOL CPDF_TextPageFind::IsMatchWholeWord(CFX_WideString csPageText, int startPos, int endPos)
+{
+ int char_left = 0;
+ int char_right = 0;
+ int char_count = endPos - startPos + 1;
+ if(char_count < 1) {
+ return FALSE;
+ }
+ if (char_count == 1 && csPageText.GetAt(startPos) > 255) {
+ return TRUE;
+ }
+ if(startPos - 1 >= 0 ) {
+ char_left = csPageText.GetAt(startPos - 1);
+ }
+ if(startPos + char_count < csPageText.GetLength()) {
+ char_right = csPageText.GetAt(startPos + char_count);
+ }
+ if(char_left == 0x61) {
+ int a = 0;
+ }
+ if ((char_left > 'A' && char_left < 'a') || (char_left > 'a' && char_left < 'z') || (char_left > 0xfb00 && char_left < 0xfb06) || (char_left >= '0' && char_left <= '9') ||
+ (char_right > 'A' && char_right < 'a') || (char_right > 'a' && char_right < 'z') || (char_right > 0xfb00 && char_right < 0xfb06) || (char_right >= '0' && char_right <= '9')) {
+ return FALSE;
+ }
+ if(!(('A' > char_left || char_left > 'Z') && ('a' > char_left || char_left > 'z')
+ && ('A' > char_right || char_right > 'Z') && ('a' > char_right || char_right > 'z'))) {
+ return FALSE;
+ }
+ if (char_count > 0) {
+ if (csPageText.GetAt(startPos) >= L'0' && csPageText.GetAt(startPos) <= L'9' && char_left >= L'0' && char_left <= L'9') {
+ return FALSE;
+ }
+ if (csPageText.GetAt(endPos) >= L'0' && csPageText.GetAt(endPos) <= L'9' && char_right >= L'0' && char_right <= L'9') {
+ return FALSE;
+ }
+ }
+ return TRUE;
+}
+FX_BOOL CPDF_TextPageFind::ExtractSubString(CFX_WideString& rString, FX_LPCWSTR lpszFullString,
+ int iSubString, FX_WCHAR chSep)
+{
+ if (lpszFullString == NULL) {
+ return FALSE;
+ }
+ while (iSubString--) {
+ lpszFullString = FXSYS_wcschr(lpszFullString, chSep);
+ if (lpszFullString == NULL) {
+ rString.Empty();
+ return FALSE;
+ }
+ lpszFullString++;
+ while(*lpszFullString == chSep) {
+ lpszFullString++;
+ }
+ }
+ FX_LPCWSTR lpchEnd = FXSYS_wcschr(lpszFullString, chSep);
+ int nLen = (lpchEnd == NULL) ?
+ (int)FXSYS_wcslen(lpszFullString) : (int)(lpchEnd - lpszFullString);
+ ASSERT(nLen >= 0);
+ FXSYS_memcpy32(rString.GetBuffer(nLen), lpszFullString, nLen * sizeof(FX_WCHAR));
+ rString.ReleaseBuffer();
+ return TRUE;
+}
+CFX_WideString CPDF_TextPageFind::MakeReverse(const CFX_WideString str)
+{
+ CFX_WideString str2;
+ str2.Empty();
+ int nlen = str.GetLength();
+ for(int i = nlen - 1; i >= 0; i--) {
+ str2 += str.GetAt(i);
+ }
+ return str2;
+}
+void CPDF_TextPageFind::GetRectArray(CFX_RectArray& rects) const
+{
+ rects.Copy(m_resArray);
+}
+int CPDF_TextPageFind::GetCurOrder() const
+{
+ return GetCharIndex(m_resStart);
+}
+int CPDF_TextPageFind::GetMatchedCount()const
+{
+ int resStart = GetCharIndex(m_resStart);
+ int resEnd = GetCharIndex(m_resEnd);
+ return resEnd - resStart + 1;
+}
+CPDF_LinkExtract::CPDF_LinkExtract()
+ : m_pTextPage(NULL),
+ m_IsParserd(FALSE)
+{
+}
+CPDF_LinkExtract::~CPDF_LinkExtract()
+{
+ DeleteLinkList();
+}
+FX_BOOL CPDF_LinkExtract::ExtractLinks(const IPDF_TextPage* pTextPage)
+{
+ if (!pTextPage || !pTextPage->IsParsered()) {
+ return FALSE;
+ }
+ m_pTextPage = (const CPDF_TextPage*)pTextPage;
+ m_strPageText = m_pTextPage->GetPageText(0, -1);
+ DeleteLinkList();
+ if (m_strPageText.IsEmpty()) {
+ return FALSE;
+ }
+ parserLink();
+ m_IsParserd = TRUE;
+ return TRUE;
+}
+void CPDF_LinkExtract::DeleteLinkList()
+{
+ while (m_LinkList.GetSize()) {
+ CPDF_LinkExt* linkinfo = NULL;
+ linkinfo = m_LinkList.GetAt(0);
+ m_LinkList.RemoveAt(0);
+ delete linkinfo;
+ }
+ m_LinkList.RemoveAll();
+}
+int CPDF_LinkExtract::CountLinks() const
+{
+ if (!m_IsParserd) {
+ return -1;
+ }
+ return m_LinkList.GetSize();
+}
+void CPDF_LinkExtract::parserLink()
+{
+ int start = 0, pos = 0;
+ int TotalChar = m_pTextPage->CountChars();
+ while (pos < TotalChar) {
+ FPDF_CHAR_INFO pageChar;
+ m_pTextPage->GetCharInfo(pos, pageChar);
+ if (pageChar.m_Flag == CHAR_GENERATED || pageChar.m_Unicode == 0x20 || pos == TotalChar - 1) {
+ int nCount = pos - start;
+ if(pos == TotalChar - 1) {
+ nCount++;
+ }
+ CFX_WideString strBeCheck;
+ strBeCheck = m_pTextPage->GetPageText(start, nCount);
+ if (strBeCheck.GetLength() > 5) {
+ while(strBeCheck.GetLength() > 0) {
+ FX_WCHAR ch = strBeCheck.GetAt(strBeCheck.GetLength() - 1);
+ if (ch == L')' || ch == L',' || ch == L'>' || ch == L'.') {
+ strBeCheck = strBeCheck.Mid(0, strBeCheck.GetLength() - 1);
+ nCount--;
+ } else {
+ break;
+ }
+ }
+ if (nCount > 5 && (CheckWebLink(strBeCheck) || CheckMailLink(strBeCheck))) {
+ if (!AppendToLinkList(start, nCount, strBeCheck)) {
+ break;
+ }
+ }
+ }
+ start = ++pos;
+ } else {
+ pos++;
+ }
+ }
+}
+FX_BOOL CPDF_LinkExtract::CheckWebLink(CFX_WideString& strBeCheck)
+{
+ CFX_WideString str = strBeCheck;
+ str.MakeLower();
+ if (str.Find(L"http://www.") != -1) {
+ strBeCheck = strBeCheck.Right(str.GetLength() - str.Find(L"http://www."));
+ return TRUE;
+ } else if (str.Find(L"http://") != -1) {
+ strBeCheck = strBeCheck.Right(str.GetLength() - str.Find(L"http://"));
+ return TRUE;
+ } else if (str.Find(L"https://www.") != -1) {
+ strBeCheck = strBeCheck.Right(str.GetLength() - str.Find(L"https://www."));
+ return TRUE;
+ } else if (str.Find(L"https://") != -1) {
+ strBeCheck = strBeCheck.Right(str.GetLength() - str.Find(L"https://"));
+ return TRUE;
+ } else if (str.Find(L"www.") != -1) {
+ strBeCheck = strBeCheck.Right(str.GetLength() - str.Find(L"www."));
+ strBeCheck = L"http://" + strBeCheck;
+ return TRUE;
+ } else {
+ return FALSE;
+ }
+}
+FX_BOOL CPDF_LinkExtract::CheckMailLink(CFX_WideString& str)
+{
+ str.MakeLower();
+ int aPos = str.Find(L'@');
+ if (aPos < 1) {
+ return FALSE;
+ }
+ if (str.GetAt(aPos - 1) == L'.' || str.GetAt(aPos - 1) == L'_') {
+ return FALSE;
+ }
+ int i;
+ for (i = aPos - 1; i >= 0; i--) {
+ FX_WCHAR ch = str.GetAt(i);
+ if (ch == L'_' || ch == L'.' || (ch >= L'a' && ch <= L'z') || (ch >= L'0' && ch <= L'9')) {
+ continue;
+ } else {
+ if (i == aPos - 1) {
+ return FALSE;
+ }
+ str = str.Right(str.GetLength() - i - 1);
+ break;
+ }
+ }
+ aPos = str.Find(L'@');
+ if (aPos < 1) {
+ return FALSE;
+ }
+ CFX_WideString strtemp = L"";
+ for (i = 0; i < aPos; i++) {
+ FX_WCHAR wch = str.GetAt(i);
+ if (wch >= L'a' && wch <= L'z') {
+ break;
+ } else {
+ strtemp = str.Right(str.GetLength() - i + 1);
+ }
+ }
+ if (strtemp != L"") {
+ str = strtemp;
+ }
+ aPos = str.Find(L'@');
+ if (aPos < 1) {
+ return FALSE;
+ }
+ str.TrimRight(L'.');
+ strtemp = str;
+ int ePos = str.Find(L'.');
+ if (ePos == -1) {
+ return FALSE;
+ }
+ while (ePos != -1) {
+ strtemp = strtemp.Right(strtemp.GetLength() - ePos - 1);
+ ePos = strtemp.Find('.');
+ }
+ ePos = strtemp.GetLength();
+ for (i = 0; i < ePos; i++) {
+ FX_WCHAR wch = str.GetAt(i);
+ if ((wch >= L'a' && wch <= L'z') || (wch >= L'0' && wch <= L'9')) {
+ continue;
+ } else {
+ str = str.Left(str.GetLength() - ePos + i + 1);
+ ePos = ePos - i - 1;
+ break;
+ }
+ }
+ int nLen = str.GetLength();
+ for (i = aPos + 1; i < nLen - ePos; i++) {
+ FX_WCHAR wch = str.GetAt(i);
+ if (wch == L'-' || wch == L'.' || (wch >= L'a' && wch <= L'z') || (wch >= L'0' && wch <= L'9')) {
+ continue;
+ } else {
+ return FALSE;
+ }
+ }
+ if (str.Find(L"mailto:") == -1) {
+ str = L"mailto:" + str;
+ }
+ return TRUE;
+}
+FX_BOOL CPDF_LinkExtract::AppendToLinkList(int start, int count, CFX_WideString strUrl)
+{
+ CPDF_LinkExt* linkInfo = NULL;
+ linkInfo = FX_NEW CPDF_LinkExt;
+ if (!linkInfo) {
+ return FALSE;
+ }
+ linkInfo->m_strUrl = strUrl;
+ linkInfo->m_Start = start;
+ linkInfo->m_Count = count;
+ m_LinkList.Add(linkInfo);
+ return TRUE;
+}
+CFX_WideString CPDF_LinkExtract::GetURL(int index) const
+{
+ if (!m_IsParserd || index < 0 || index >= m_LinkList.GetSize()) {
+ return L"";
+ }
+ CPDF_LinkExt* link = NULL;
+ link = m_LinkList.GetAt(index);
+ if (!link) {
+ return L"";
+ }
+ return link->m_strUrl;
+}
+void CPDF_LinkExtract::GetBoundedSegment(int index, int& start, int& count) const
+{
+ if (!m_IsParserd || index < 0 || index >= m_LinkList.GetSize()) {
+ return ;
+ }
+ CPDF_LinkExt* link = NULL;
+ link = m_LinkList.GetAt(index);
+ if (!link) {
+ return ;
+ }
+ start = link->m_Start;
+ count = link->m_Count;
+}
+void CPDF_LinkExtract::GetRects(int index, CFX_RectArray& rects) const
+{
+ if (!m_IsParserd || index < 0 || index >= m_LinkList.GetSize()) {
+ return;
+ }
+ CPDF_LinkExt* link = NULL;
+ link = m_LinkList.GetAt(index);
+ if (!link) {
+ return ;
+ }
+ m_pTextPage->GetRectArray(link->m_Start, link->m_Count, rects);
+}
diff --git a/core/src/fpdftext/fpdf_text_search.cpp b/core/src/fpdftext/fpdf_text_search.cpp
index b029f69048..8c81ad9f66 100644
--- a/core/src/fpdftext/fpdf_text_search.cpp
+++ b/core/src/fpdftext/fpdf_text_search.cpp
@@ -1,325 +1,325 @@
-// 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
-
-#include "../../include/fpdfapi/fpdf_pageobj.h"
-#include "../../include/fpdftext/fpdf_text.h"
-#include "../../include/fpdfapi/fpdf_page.h"
-class CPDF_TextStream : public CFX_Object
-{
-public:
- CPDF_TextStream(CFX_WideTextBuf& buffer, FX_BOOL bUseLF, CFX_PtrArray* pObjArray);
- ~CPDF_TextStream() {}
- FX_BOOL ProcessObject(const CPDF_TextObject* pObj, FX_BOOL bFirstLine);
- CFX_WideTextBuf& m_Buffer;
- FX_BOOL m_bUseLF;
- CFX_PtrArray* m_pObjArray;
- const CPDF_TextObject* m_pLastObj;
-};
-CPDF_TextStream::CPDF_TextStream(CFX_WideTextBuf& buffer, FX_BOOL bUseLF, CFX_PtrArray* pObjArray) : m_Buffer(buffer)
-{
- m_pLastObj = NULL;
- m_bUseLF = bUseLF;
- m_pObjArray = pObjArray;
-}
-FX_BOOL FPDFText_IsSameTextObject(const CPDF_TextObject* pTextObj1, const CPDF_TextObject* pTextObj2)
-{
- if (!pTextObj1 || !pTextObj2) {
- return FALSE;
- }
- CFX_FloatRect rcPreObj(pTextObj2->m_Left, pTextObj2->m_Bottom, pTextObj2->m_Right, pTextObj2->m_Top);
- CFX_FloatRect rcCurObj(pTextObj1->m_Left, pTextObj1->m_Bottom, pTextObj1->m_Right, pTextObj1->m_Top);
- if (rcPreObj.IsEmpty() && rcCurObj.IsEmpty()) {
- return TRUE;
- }
- if (!rcPreObj.IsEmpty() || !rcCurObj.IsEmpty()) {
- rcPreObj.Intersect(rcCurObj);
- if (rcPreObj.IsEmpty()) {
- return FALSE;
- }
- if (FXSYS_fabs(rcPreObj.Width() - rcCurObj.Width()) > rcCurObj.Width() / 2) {
- return FALSE;
- }
- if (pTextObj2->GetFontSize() != pTextObj1->GetFontSize()) {
- return FALSE;
- }
- }
- int nPreCount = pTextObj2->CountItems();
- int nCurCount = pTextObj1->CountItems();
- if (nPreCount != nCurCount) {
- return FALSE;
- }
- for (int i = 0; i < nPreCount; i++) {
- CPDF_TextObjectItem itemPer, itemCur;
- pTextObj2->GetItemInfo(i, &itemPer);
- pTextObj1->GetItemInfo(i, &itemCur);
- if (itemCur.m_CharCode != itemPer.m_CharCode) {
- return FALSE;
- }
- }
- return TRUE;
-}
-int GetCharWidth(FX_DWORD charCode, CPDF_Font* pFont)
-{
- if(charCode == -1) {
- return 0;
- }
- int w = pFont->GetCharWidthF(charCode);
- if(w == 0) {
- CFX_ByteString str;
- pFont->AppendChar(str, charCode);
- w = pFont->GetStringWidth(str, 1);
- if(w == 0) {
- FX_RECT BBox;
- pFont->GetCharBBox(charCode, BBox);
- w = BBox.right - BBox.left;
- }
- }
- return w;
-}
-int FPDFText_ProcessInterObj(const CPDF_TextObject* pPrevObj, const CPDF_TextObject* pObj)
-{
- if(FPDFText_IsSameTextObject(pPrevObj, pObj)) {
- return -1;
- }
- CPDF_TextObjectItem item;
- int nItem = pPrevObj->CountItems();
- pPrevObj->GetItemInfo(nItem - 1, &item);
- FX_WCHAR preChar = 0, curChar = 0;
- CFX_WideString wstr = pPrevObj->GetFont()->UnicodeFromCharCode(item.m_CharCode);
- if(wstr.GetLength()) {
- preChar = wstr.GetAt(0);
- }
- FX_FLOAT last_pos = item.m_OriginX;
- int nLastWidth = GetCharWidth(item.m_CharCode, pPrevObj->GetFont());
- FX_FLOAT last_width = nLastWidth * pPrevObj->GetFontSize() / 1000;
- last_width = FXSYS_fabs(last_width);
- pObj->GetItemInfo(0, &item);
- wstr = pObj->GetFont()->UnicodeFromCharCode(item.m_CharCode);
- if(wstr.GetLength()) {
- curChar = wstr.GetAt(0);
- }
- int nThisWidth = GetCharWidth(item.m_CharCode, pObj->GetFont());
- FX_FLOAT this_width = nThisWidth * pObj->GetFontSize() / 1000;
- this_width = FXSYS_fabs(this_width);
- FX_FLOAT threshold = last_width > this_width ? last_width / 4 : this_width / 4;
- CFX_AffineMatrix prev_matrix, prev_reverse;
- pPrevObj->GetTextMatrix(&prev_matrix);
- prev_reverse.SetReverse(prev_matrix);
- FX_FLOAT x = pObj->GetPosX(), y = pObj->GetPosY();
- prev_reverse.Transform(x, y);
- if (FXSYS_fabs(y) > threshold * 2) {
- return 2;
- }
- threshold = (FX_FLOAT)(nLastWidth > nThisWidth ? nLastWidth : nThisWidth);
- threshold = threshold > 400 ? (threshold < 700 ? threshold / 4 : threshold / 5) : (threshold / 2);
- threshold *= nLastWidth > nThisWidth ? FXSYS_fabs(pPrevObj->GetFontSize()) : FXSYS_fabs(pObj->GetFontSize());
- threshold /= 1000;
- if (FXSYS_fabs(last_pos + last_width - x) > threshold && curChar != L' ' && preChar != L' ')
- if(curChar != L' ' && preChar != L' ') {
- if((x - last_pos - last_width) > threshold || (last_pos - x - last_width) > threshold) {
- return 1;
- }
- if(x < 0 && (last_pos - x - last_width) > threshold) {
- return 1;
- }
- if((x - last_pos - last_width) > this_width || (x - last_pos - this_width) > last_width ) {
- return 1;
- }
- }
- if(last_pos + last_width > x + this_width && curChar == L' ') {
- return 3;
- }
- return 0;
-}
-FX_BOOL CPDF_TextStream::ProcessObject(const CPDF_TextObject* pObj, FX_BOOL bFirstLine)
-{
- if(pObj->m_Bottom > 380 && pObj->m_Left < 45 && pObj->m_Top < 402) {
- int i = 0;
- }
- CPDF_Font* pFont = pObj->GetFont();
- CFX_AffineMatrix matrix;
- pObj->GetTextMatrix(&matrix);
- FX_FLOAT fs = pObj->GetFontSize();
- int item_index = 0;
- if (m_pLastObj) {
- int result = FPDFText_ProcessInterObj(m_pLastObj, pObj);
- if (result == 2) {
- int len = m_Buffer.GetLength();
- if (len && m_bUseLF && m_Buffer.GetBuffer()[len - 1] == L'-') {
- m_Buffer.Delete(len - 1, 1);
- if (m_pObjArray) {
- m_pObjArray->RemoveAt((len - 1) * 2, 2);
- }
- } else {
- if (bFirstLine) {
- return TRUE;
- }
- if (m_bUseLF) {
- m_Buffer.AppendChar(L'\r');
- m_Buffer.AppendChar(L'\n');
- if (m_pObjArray) {
- for (int i = 0; i < 4; i ++) {
- m_pObjArray->Add(NULL);
- }
- }
- } else {
- m_Buffer.AppendChar(' ');
- if (m_pObjArray) {
- m_pObjArray->Add(NULL);
- m_pObjArray->Add(NULL);
- }
- }
- }
- } else if (result == 1) {
- m_Buffer.AppendChar(L' ');
- if (m_pObjArray) {
- m_pObjArray->Add(NULL);
- m_pObjArray->Add(NULL);
- }
- } else if (result == -1) {
- m_pLastObj = pObj;
- return FALSE;
- } else if (result == 3) {
- item_index = 1;
- }
- }
- m_pLastObj = pObj;
- int nItems = pObj->CountItems();
- FX_FLOAT Ignorekerning = 0;
- for(int i = 1; i < nItems - 1; i += 2) {
- CPDF_TextObjectItem item;
- pObj->GetItemInfo(i, &item);
- if (item.m_CharCode == (FX_DWORD) - 1) {
- if(i == 1) {
- Ignorekerning = item.m_OriginX;
- } else if(Ignorekerning > item.m_OriginX) {
- Ignorekerning = item.m_OriginX;
- }
- } else {
- Ignorekerning = 0;
- break;
- }
- }
- FX_FLOAT spacing = 0;
- for (; item_index < nItems; item_index ++) {
- CPDF_TextObjectItem item;
- pObj->GetItemInfo(item_index, &item);
- if (item.m_CharCode == (FX_DWORD) - 1) {
- CFX_WideString wstr = m_Buffer.GetWideString();
- if (wstr.IsEmpty() || wstr.GetAt(wstr.GetLength() - 1) == L' ') {
- continue;
- }
- FX_FLOAT fontsize_h = pObj->m_TextState.GetFontSizeH();
- spacing = -fontsize_h * (item.m_OriginX - Ignorekerning) / 1000;
- continue;
- }
- FX_FLOAT charSpace = pObj->m_TextState.GetObject()->m_CharSpace;
- if(nItems > 3 && !spacing) {
- charSpace = 0;
- }
- if((spacing || charSpace) && item_index > 0) {
- int last_width = 0;
- FX_FLOAT fontsize_h = pObj->m_TextState.GetFontSizeH();
- FX_DWORD space_charcode = pFont->CharCodeFromUnicode(' ');
- FX_FLOAT threshold = 0;
- if (space_charcode != -1) {
- threshold = fontsize_h * pFont->GetCharWidthF(space_charcode) / 1000 ;
- }
- if(threshold > fontsize_h / 3) {
- threshold = 0;
- } else {
- threshold /= 2;
- }
- if (threshold == 0) {
- threshold = fontsize_h;
- int this_width = FXSYS_abs(GetCharWidth(item.m_CharCode, pFont));
- threshold = this_width > last_width ? (FX_FLOAT)this_width : (FX_FLOAT)last_width;
- int nDivide = 6;
- if (threshold < 300) {
- nDivide = 2;
- } else if (threshold < 500) {
- nDivide = 4;
- } else if (threshold < 700) {
- nDivide = 5;
- }
- threshold = threshold / nDivide;
- threshold = fontsize_h * threshold / 1000;
- }
- if(charSpace > 0.001) {
- spacing += matrix.TransformDistance(charSpace);
- } else if(charSpace < -0.001) {
- spacing -= matrix.TransformDistance(FXSYS_fabs(charSpace));
- }
- if (threshold && (spacing && spacing >= threshold) ) {
- m_Buffer.AppendChar(L' ');
- if (m_pObjArray) {
- m_pObjArray->Add(NULL);
- m_pObjArray->Add(NULL);
- }
- }
- if (item.m_CharCode == (FX_DWORD) - 1) {
- continue;
- }
- spacing = 0;
- }
- CFX_WideString unicode_str = pFont->UnicodeFromCharCode(item.m_CharCode);
- if (unicode_str.IsEmpty()) {
- m_Buffer.AppendChar((FX_WCHAR)item.m_CharCode);
- if (m_pObjArray) {
- m_pObjArray->Add((void*)pObj);
- m_pObjArray->Add((void*)(FX_INTPTR)item_index);
- }
- } else {
- m_Buffer << unicode_str;
- if (m_pObjArray) {
- for (int i = 0; i < unicode_str.GetLength(); i ++) {
- m_pObjArray->Add((void*)pObj);
- m_pObjArray->Add((void*)(FX_INTPTR)item_index);
- }
- }
- }
- }
- return FALSE;
-}
-void _PDF_GetTextStream_Unicode(CFX_WideTextBuf& buffer, CPDF_PageObjects* pPage, FX_BOOL bUseLF,
- CFX_PtrArray* pObjArray)
-{
- CPDF_TextStream textstream(buffer, bUseLF, pObjArray);
- FX_POSITION pos = pPage->GetFirstObjectPosition();
- while (pos) {
- CPDF_PageObject* pObject = pPage->GetNextObject(pos);
- if (pObject == NULL) {
- continue;
- }
- if (pObject->m_Type != PDFPAGE_TEXT) {
- continue;
- }
- textstream.ProcessObject((CPDF_TextObject*)pObject, FALSE);
- }
-}
-CFX_WideString PDF_GetFirstTextLine_Unicode(CPDF_Document* pDoc, CPDF_Dictionary* pPage)
-{
- CFX_WideTextBuf buffer;
- buffer.EstimateSize(0, 1024);
- CPDF_Page page;
- page.Load(pDoc, pPage);
- CPDF_ParseOptions options;
- options.m_bTextOnly = TRUE;
- options.m_bSeparateForm = FALSE;
- page.ParseContent(&options);
- CPDF_TextStream textstream(buffer, FALSE, NULL);
- FX_POSITION pos = page.GetFirstObjectPosition();
- while (pos) {
- CPDF_PageObject* pObject = page.GetNextObject(pos);
- if (pObject->m_Type != PDFPAGE_TEXT) {
- continue;
- }
- if (textstream.ProcessObject((CPDF_TextObject*)pObject, TRUE)) {
- break;
- }
- }
- return buffer.GetWideString();
-}
+// 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
+
+#include "../../include/fpdfapi/fpdf_pageobj.h"
+#include "../../include/fpdftext/fpdf_text.h"
+#include "../../include/fpdfapi/fpdf_page.h"
+class CPDF_TextStream : public CFX_Object
+{
+public:
+ CPDF_TextStream(CFX_WideTextBuf& buffer, FX_BOOL bUseLF, CFX_PtrArray* pObjArray);
+ ~CPDF_TextStream() {}
+ FX_BOOL ProcessObject(const CPDF_TextObject* pObj, FX_BOOL bFirstLine);
+ CFX_WideTextBuf& m_Buffer;
+ FX_BOOL m_bUseLF;
+ CFX_PtrArray* m_pObjArray;
+ const CPDF_TextObject* m_pLastObj;
+};
+CPDF_TextStream::CPDF_TextStream(CFX_WideTextBuf& buffer, FX_BOOL bUseLF, CFX_PtrArray* pObjArray) : m_Buffer(buffer)
+{
+ m_pLastObj = NULL;
+ m_bUseLF = bUseLF;
+ m_pObjArray = pObjArray;
+}
+FX_BOOL FPDFText_IsSameTextObject(const CPDF_TextObject* pTextObj1, const CPDF_TextObject* pTextObj2)
+{
+ if (!pTextObj1 || !pTextObj2) {
+ return FALSE;
+ }
+ CFX_FloatRect rcPreObj(pTextObj2->m_Left, pTextObj2->m_Bottom, pTextObj2->m_Right, pTextObj2->m_Top);
+ CFX_FloatRect rcCurObj(pTextObj1->m_Left, pTextObj1->m_Bottom, pTextObj1->m_Right, pTextObj1->m_Top);
+ if (rcPreObj.IsEmpty() && rcCurObj.IsEmpty()) {
+ return TRUE;
+ }
+ if (!rcPreObj.IsEmpty() || !rcCurObj.IsEmpty()) {
+ rcPreObj.Intersect(rcCurObj);
+ if (rcPreObj.IsEmpty()) {
+ return FALSE;
+ }
+ if (FXSYS_fabs(rcPreObj.Width() - rcCurObj.Width()) > rcCurObj.Width() / 2) {
+ return FALSE;
+ }
+ if (pTextObj2->GetFontSize() != pTextObj1->GetFontSize()) {
+ return FALSE;
+ }
+ }
+ int nPreCount = pTextObj2->CountItems();
+ int nCurCount = pTextObj1->CountItems();
+ if (nPreCount != nCurCount) {
+ return FALSE;
+ }
+ for (int i = 0; i < nPreCount; i++) {
+ CPDF_TextObjectItem itemPer, itemCur;
+ pTextObj2->GetItemInfo(i, &itemPer);
+ pTextObj1->GetItemInfo(i, &itemCur);
+ if (itemCur.m_CharCode != itemPer.m_CharCode) {
+ return FALSE;
+ }
+ }
+ return TRUE;
+}
+int GetCharWidth(FX_DWORD charCode, CPDF_Font* pFont)
+{
+ if(charCode == -1) {
+ return 0;
+ }
+ int w = pFont->GetCharWidthF(charCode);
+ if(w == 0) {
+ CFX_ByteString str;
+ pFont->AppendChar(str, charCode);
+ w = pFont->GetStringWidth(str, 1);
+ if(w == 0) {
+ FX_RECT BBox;
+ pFont->GetCharBBox(charCode, BBox);
+ w = BBox.right - BBox.left;
+ }
+ }
+ return w;
+}
+int FPDFText_ProcessInterObj(const CPDF_TextObject* pPrevObj, const CPDF_TextObject* pObj)
+{
+ if(FPDFText_IsSameTextObject(pPrevObj, pObj)) {
+ return -1;
+ }
+ CPDF_TextObjectItem item;
+ int nItem = pPrevObj->CountItems();
+ pPrevObj->GetItemInfo(nItem - 1, &item);
+ FX_WCHAR preChar = 0, curChar = 0;
+ CFX_WideString wstr = pPrevObj->GetFont()->UnicodeFromCharCode(item.m_CharCode);
+ if(wstr.GetLength()) {
+ preChar = wstr.GetAt(0);
+ }
+ FX_FLOAT last_pos = item.m_OriginX;
+ int nLastWidth = GetCharWidth(item.m_CharCode, pPrevObj->GetFont());
+ FX_FLOAT last_width = nLastWidth * pPrevObj->GetFontSize() / 1000;
+ last_width = FXSYS_fabs(last_width);
+ pObj->GetItemInfo(0, &item);
+ wstr = pObj->GetFont()->UnicodeFromCharCode(item.m_CharCode);
+ if(wstr.GetLength()) {
+ curChar = wstr.GetAt(0);
+ }
+ int nThisWidth = GetCharWidth(item.m_CharCode, pObj->GetFont());
+ FX_FLOAT this_width = nThisWidth * pObj->GetFontSize() / 1000;
+ this_width = FXSYS_fabs(this_width);
+ FX_FLOAT threshold = last_width > this_width ? last_width / 4 : this_width / 4;
+ CFX_AffineMatrix prev_matrix, prev_reverse;
+ pPrevObj->GetTextMatrix(&prev_matrix);
+ prev_reverse.SetReverse(prev_matrix);
+ FX_FLOAT x = pObj->GetPosX(), y = pObj->GetPosY();
+ prev_reverse.Transform(x, y);
+ if (FXSYS_fabs(y) > threshold * 2) {
+ return 2;
+ }
+ threshold = (FX_FLOAT)(nLastWidth > nThisWidth ? nLastWidth : nThisWidth);
+ threshold = threshold > 400 ? (threshold < 700 ? threshold / 4 : threshold / 5) : (threshold / 2);
+ threshold *= nLastWidth > nThisWidth ? FXSYS_fabs(pPrevObj->GetFontSize()) : FXSYS_fabs(pObj->GetFontSize());
+ threshold /= 1000;
+ if (FXSYS_fabs(last_pos + last_width - x) > threshold && curChar != L' ' && preChar != L' ')
+ if(curChar != L' ' && preChar != L' ') {
+ if((x - last_pos - last_width) > threshold || (last_pos - x - last_width) > threshold) {
+ return 1;
+ }
+ if(x < 0 && (last_pos - x - last_width) > threshold) {
+ return 1;
+ }
+ if((x - last_pos - last_width) > this_width || (x - last_pos - this_width) > last_width ) {
+ return 1;
+ }
+ }
+ if(last_pos + last_width > x + this_width && curChar == L' ') {
+ return 3;
+ }
+ return 0;
+}
+FX_BOOL CPDF_TextStream::ProcessObject(const CPDF_TextObject* pObj, FX_BOOL bFirstLine)
+{
+ if(pObj->m_Bottom > 380 && pObj->m_Left < 45 && pObj->m_Top < 402) {
+ int i = 0;
+ }
+ CPDF_Font* pFont = pObj->GetFont();
+ CFX_AffineMatrix matrix;
+ pObj->GetTextMatrix(&matrix);
+ FX_FLOAT fs = pObj->GetFontSize();
+ int item_index = 0;
+ if (m_pLastObj) {
+ int result = FPDFText_ProcessInterObj(m_pLastObj, pObj);
+ if (result == 2) {
+ int len = m_Buffer.GetLength();
+ if (len && m_bUseLF && m_Buffer.GetBuffer()[len - 1] == L'-') {
+ m_Buffer.Delete(len - 1, 1);
+ if (m_pObjArray) {
+ m_pObjArray->RemoveAt((len - 1) * 2, 2);
+ }
+ } else {
+ if (bFirstLine) {
+ return TRUE;
+ }
+ if (m_bUseLF) {
+ m_Buffer.AppendChar(L'\r');
+ m_Buffer.AppendChar(L'\n');
+ if (m_pObjArray) {
+ for (int i = 0; i < 4; i ++) {
+ m_pObjArray->Add(NULL);
+ }
+ }
+ } else {
+ m_Buffer.AppendChar(' ');
+ if (m_pObjArray) {
+ m_pObjArray->Add(NULL);
+ m_pObjArray->Add(NULL);
+ }
+ }
+ }
+ } else if (result == 1) {
+ m_Buffer.AppendChar(L' ');
+ if (m_pObjArray) {
+ m_pObjArray->Add(NULL);
+ m_pObjArray->Add(NULL);
+ }
+ } else if (result == -1) {
+ m_pLastObj = pObj;
+ return FALSE;
+ } else if (result == 3) {
+ item_index = 1;
+ }
+ }
+ m_pLastObj = pObj;
+ int nItems = pObj->CountItems();
+ FX_FLOAT Ignorekerning = 0;
+ for(int i = 1; i < nItems - 1; i += 2) {
+ CPDF_TextObjectItem item;
+ pObj->GetItemInfo(i, &item);
+ if (item.m_CharCode == (FX_DWORD) - 1) {
+ if(i == 1) {
+ Ignorekerning = item.m_OriginX;
+ } else if(Ignorekerning > item.m_OriginX) {
+ Ignorekerning = item.m_OriginX;
+ }
+ } else {
+ Ignorekerning = 0;
+ break;
+ }
+ }
+ FX_FLOAT spacing = 0;
+ for (; item_index < nItems; item_index ++) {
+ CPDF_TextObjectItem item;
+ pObj->GetItemInfo(item_index, &item);
+ if (item.m_CharCode == (FX_DWORD) - 1) {
+ CFX_WideString wstr = m_Buffer.GetWideString();
+ if (wstr.IsEmpty() || wstr.GetAt(wstr.GetLength() - 1) == L' ') {
+ continue;
+ }
+ FX_FLOAT fontsize_h = pObj->m_TextState.GetFontSizeH();
+ spacing = -fontsize_h * (item.m_OriginX - Ignorekerning) / 1000;
+ continue;
+ }
+ FX_FLOAT charSpace = pObj->m_TextState.GetObject()->m_CharSpace;
+ if(nItems > 3 && !spacing) {
+ charSpace = 0;
+ }
+ if((spacing || charSpace) && item_index > 0) {
+ int last_width = 0;
+ FX_FLOAT fontsize_h = pObj->m_TextState.GetFontSizeH();
+ FX_DWORD space_charcode = pFont->CharCodeFromUnicode(' ');
+ FX_FLOAT threshold = 0;
+ if (space_charcode != -1) {
+ threshold = fontsize_h * pFont->GetCharWidthF(space_charcode) / 1000 ;
+ }
+ if(threshold > fontsize_h / 3) {
+ threshold = 0;
+ } else {
+ threshold /= 2;
+ }
+ if (threshold == 0) {
+ threshold = fontsize_h;
+ int this_width = FXSYS_abs(GetCharWidth(item.m_CharCode, pFont));
+ threshold = this_width > last_width ? (FX_FLOAT)this_width : (FX_FLOAT)last_width;
+ int nDivide = 6;
+ if (threshold < 300) {
+ nDivide = 2;
+ } else if (threshold < 500) {
+ nDivide = 4;
+ } else if (threshold < 700) {
+ nDivide = 5;
+ }
+ threshold = threshold / nDivide;
+ threshold = fontsize_h * threshold / 1000;
+ }
+ if(charSpace > 0.001) {
+ spacing += matrix.TransformDistance(charSpace);
+ } else if(charSpace < -0.001) {
+ spacing -= matrix.TransformDistance(FXSYS_fabs(charSpace));
+ }
+ if (threshold && (spacing && spacing >= threshold) ) {
+ m_Buffer.AppendChar(L' ');
+ if (m_pObjArray) {
+ m_pObjArray->Add(NULL);
+ m_pObjArray->Add(NULL);
+ }
+ }
+ if (item.m_CharCode == (FX_DWORD) - 1) {
+ continue;
+ }
+ spacing = 0;
+ }
+ CFX_WideString unicode_str = pFont->UnicodeFromCharCode(item.m_CharCode);
+ if (unicode_str.IsEmpty()) {
+ m_Buffer.AppendChar((FX_WCHAR)item.m_CharCode);
+ if (m_pObjArray) {
+ m_pObjArray->Add((void*)pObj);
+ m_pObjArray->Add((void*)(FX_INTPTR)item_index);
+ }
+ } else {
+ m_Buffer << unicode_str;
+ if (m_pObjArray) {
+ for (int i = 0; i < unicode_str.GetLength(); i ++) {
+ m_pObjArray->Add((void*)pObj);
+ m_pObjArray->Add((void*)(FX_INTPTR)item_index);
+ }
+ }
+ }
+ }
+ return FALSE;
+}
+void _PDF_GetTextStream_Unicode(CFX_WideTextBuf& buffer, CPDF_PageObjects* pPage, FX_BOOL bUseLF,
+ CFX_PtrArray* pObjArray)
+{
+ CPDF_TextStream textstream(buffer, bUseLF, pObjArray);
+ FX_POSITION pos = pPage->GetFirstObjectPosition();
+ while (pos) {
+ CPDF_PageObject* pObject = pPage->GetNextObject(pos);
+ if (pObject == NULL) {
+ continue;
+ }
+ if (pObject->m_Type != PDFPAGE_TEXT) {
+ continue;
+ }
+ textstream.ProcessObject((CPDF_TextObject*)pObject, FALSE);
+ }
+}
+CFX_WideString PDF_GetFirstTextLine_Unicode(CPDF_Document* pDoc, CPDF_Dictionary* pPage)
+{
+ CFX_WideTextBuf buffer;
+ buffer.EstimateSize(0, 1024);
+ CPDF_Page page;
+ page.Load(pDoc, pPage);
+ CPDF_ParseOptions options;
+ options.m_bTextOnly = TRUE;
+ options.m_bSeparateForm = FALSE;
+ page.ParseContent(&options);
+ CPDF_TextStream textstream(buffer, FALSE, NULL);
+ FX_POSITION pos = page.GetFirstObjectPosition();
+ while (pos) {
+ CPDF_PageObject* pObject = page.GetNextObject(pos);
+ if (pObject->m_Type != PDFPAGE_TEXT) {
+ continue;
+ }
+ if (textstream.ProcessObject((CPDF_TextObject*)pObject, TRUE)) {
+ break;
+ }
+ }
+ return buffer.GetWideString();
+}
diff --git a/core/src/fpdftext/text_int.h b/core/src/fpdftext/text_int.h
index a0af51eb60..39dc721eee 100644
--- a/core/src/fpdftext/text_int.h
+++ b/core/src/fpdftext/text_int.h
@@ -1,215 +1,215 @@
-// 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 _PDF_TEXT_INT_H_
-#define _PDF_TEXT_INT_H_
-class CPDF_TextParseOptions : public CFX_Object
-{
-public:
- CPDF_TextParseOptions();
- FX_BOOL m_bCheckObjectOrder;
- FX_BOOL m_bCheckDirection;
- int m_nCheckSameObject;
-};
-class CPDF_TextPage;
-class CPDF_LinkExtract;
-class CPDF_TextPageFind;
-class CPDF_DocProgressiveSearch;
-#define FPDFTEXT_CHAR_ERROR -1
-#define FPDFTEXT_CHAR_NORMAL 0
-#define FPDFTEXT_CHAR_GENERATED 1
-#define FPDFTEXT_CHAR_UNUNICODE 2
-#define FPDFTEXT_CHAR_HYPHEN 3
-#define FPDFTEXT_CHAR_PIECE 4
-#define FPDFTEXT_MC_PASS 0
-#define FPDFTEXT_MC_DONE 1
-#define FPDFTEXT_MC_DELAY 2
-typedef struct _PAGECHAR_INFO: public CFX_Object {
- int m_CharCode;
- FX_WCHAR m_Unicode;
- FX_FLOAT m_OriginX;
- FX_FLOAT m_OriginY;
- FX_INT32 m_Flag;
- CFX_FloatRect m_CharBox;
- CPDF_TextObject* m_pTextObj;
- CFX_AffineMatrix m_Matrix;
- int m_Index;
-} PAGECHAR_INFO;
-typedef CFX_SegmentedArray<PAGECHAR_INFO> PAGECHAR_InfoArray;
-typedef struct {
- int m_Start;
- int m_nCount;
-} FPDF_SEGMENT;
-typedef CFX_ArrayTemplate<FPDF_SEGMENT> SEGMENT_Array;
-typedef struct {
- CPDF_TextObject* m_pTextObj;
- CFX_AffineMatrix m_formMatrix;
-} PDFTEXT_Obj;
-typedef CFX_ArrayTemplate<PDFTEXT_Obj> LINEOBJ;
-class CPDF_TextPage: public IPDF_TextPage
-{
-public:
- CPDF_TextPage(const CPDF_Page* pPage, int flags = 0);
- CPDF_TextPage(const CPDF_PageObjects* pPage, int flags = 0);
- CPDF_TextPage(const CPDF_Page* pPage, CPDFText_ParseOptions ParserOptions);
- virtual FX_BOOL ParseTextPage();
- virtual void NormalizeObjects(FX_BOOL bNormalize);
- virtual FX_BOOL IsParsered() const
- {
- return m_IsParsered;
- }
- virtual ~CPDF_TextPage() {};
-public:
- virtual int CharIndexFromTextIndex(int TextIndex)const ;
- virtual int TextIndexFromCharIndex(int CharIndex)const;
- virtual int CountChars() const;
- virtual void GetCharInfo(int index, FPDF_CHAR_INFO & info) const;
- virtual void GetRectArray(int start, int nCount, CFX_RectArray& rectArray) const;
- virtual int GetIndexAtPos(CPDF_Point point, FX_FLOAT xTorelance, FX_FLOAT yTorelance) const;
- virtual int GetIndexAtPos(FX_FLOAT x, FX_FLOAT y, FX_FLOAT xTorelance,
- FX_FLOAT yTorelance) const;
- virtual CFX_WideString GetTextByRect(CFX_FloatRect rect) const;
- virtual void GetRectsArrayByRect(CFX_FloatRect rect, CFX_RectArray& resRectArray) const;
- virtual int GetOrderByDirection(int order, int direction) const;
- virtual CFX_WideString GetPageText(int start = 0, int nCount = -1) const;
-
- virtual int CountRects(int start, int nCount);
- virtual void GetRect(int rectIndex, FX_FLOAT& left, FX_FLOAT& top
- , FX_FLOAT& right, FX_FLOAT &bottom) const;
- virtual FX_BOOL GetBaselineRotate(int rectIndex, int& Rotate);
- virtual FX_BOOL GetBaselineRotate(CFX_FloatRect rect, int& Rotate);
- virtual int CountBoundedSegments(FX_FLOAT left, FX_FLOAT top,
- FX_FLOAT right, FX_FLOAT bottom, FX_BOOL bContains = FALSE);
- virtual void GetBoundedSegment(int index, int& start, int& count) const;
- virtual int GetWordBreak(int index, int direction) const;
-public:
- const PAGECHAR_InfoArray* GetCharList() const
- {
- return &m_charList;
- }
- static FX_BOOL IsRectIntersect(CFX_FloatRect rect1, CFX_FloatRect rect2);
- static FX_BOOL IsLetter(FX_WCHAR unicode);
-private:
- FX_BOOL IsHyphen(FX_WCHAR curChar);
- FX_BOOL IsControlChar(PAGECHAR_INFO* pCharInfo);
- FX_BOOL GetBaselineRotate(int start, int end, int& Rotate);
- void ProcessObject();
- void ProcessFormObject(CPDF_FormObject* pFormObj, CFX_AffineMatrix formMatrix);
- void ProcessTextObject(PDFTEXT_Obj pObj);
- void ProcessTextObject(CPDF_TextObject* pTextObj, CFX_AffineMatrix formMatrix, FX_POSITION ObjPos);
- int ProcessInsertObject(const CPDF_TextObject* pObj, CFX_AffineMatrix formMatrix);
- FX_BOOL GenerateCharInfo(FX_WCHAR unicode, PAGECHAR_INFO& info);
- FX_BOOL IsSameAsPreTextObject(CPDF_TextObject* pTextObj, FX_POSITION ObjPos);
- FX_BOOL IsSameTextObject(CPDF_TextObject* pTextObj1, CPDF_TextObject* pTextObj2);
- int GetCharWidth(FX_DWORD charCode, CPDF_Font* pFont) const;
- void CloseTempLine();
- void OnPiece(IFX_BidiChar* pBidi, CFX_WideString& str);
- FX_INT32 PreMarkedContent(PDFTEXT_Obj pObj);
- void ProcessMarkedContent(PDFTEXT_Obj pObj);
- void CheckMarkedContentObject(FX_INT32& start, FX_INT32& nCount) const;
- void FindPreviousTextObject(void);
- void AddCharInfoByLRDirection(CFX_WideString& str, int i);
- void AddCharInfoByRLDirection(CFX_WideString& str, int i);
- FX_INT32 GetTextObjectWritingMode(const CPDF_TextObject* pTextObj);
- FX_INT32 FindTextlineFlowDirection();
-protected:
- CPDFText_ParseOptions m_ParseOptions;
- CFX_WordArray m_CharIndex;
- const CPDF_PageObjects* m_pPage;
- PAGECHAR_InfoArray m_charList;
- CFX_WideTextBuf m_TextBuf;
- PAGECHAR_InfoArray m_TempCharList;
- CFX_WideTextBuf m_TempTextBuf;
- int m_parserflag;
- CPDF_TextObject* m_pPreTextObj;
- CFX_AffineMatrix m_perMatrix;
- FX_BOOL m_IsParsered;
- CFX_AffineMatrix m_DisplayMatrix;
-
- SEGMENT_Array m_Segment;
- CFX_RectArray m_SelRects;
- LINEOBJ m_LineObj;
- FX_BOOL m_TextlineDir;
- CFX_FloatRect m_CurlineRect;
-};
-class CPDF_TextPageFind: public IPDF_TextPageFind
-{
-public:
- CPDF_TextPageFind(const IPDF_TextPage* pTextPage);
- virtual ~CPDF_TextPageFind() {};
-public:
- virtual FX_BOOL FindFirst(CFX_WideString findwhat, int flags, int startPos = 0);
- virtual FX_BOOL FindNext();
- virtual FX_BOOL FindPrev();
-
- virtual void GetRectArray(CFX_RectArray& rects) const;
- virtual int GetCurOrder() const;
- virtual int GetMatchedCount()const;
-protected:
- void ExtractFindWhat(CFX_WideString findwhat);
- FX_BOOL IsMatchWholeWord(CFX_WideString csPageText, int startPos, int endPos);
- FX_BOOL ExtractSubString(CFX_WideString& rString, FX_LPCWSTR lpszFullString,
- int iSubString, FX_WCHAR chSep);
- CFX_WideString MakeReverse(const CFX_WideString str);
- int ReverseFind(CFX_WideString csPageText, CFX_WideString csWord, int nStartPos, int& WordLength);
- int GetCharIndex(int index) const;
-private:
- CFX_WordArray m_CharIndex;
- const IPDF_TextPage* m_pTextPage;
- CFX_WideString m_strText;
- CFX_WideString m_findWhat;
- int m_flags;
- CFX_WideStringArray m_csFindWhatArray;
- int m_findNextStart;
- int m_findPreStart;
- FX_BOOL m_bMatchCase;
- FX_BOOL m_bMatchWholeWord;
- int m_resStart;
- int m_resEnd;
- CFX_RectArray m_resArray;
- FX_BOOL m_IsFind;
-};
-class CPDF_LinkExt: public CFX_Object
-{
-public:
- CPDF_LinkExt() {};
- int m_Start;
- int m_Count;
- CFX_WideString m_strUrl;
- virtual ~CPDF_LinkExt() {};
-};
-typedef CFX_ArrayTemplate<CPDF_LinkExt*> LINK_InfoArray;
-class CPDF_LinkExtract: public IPDF_LinkExtract
-{
-public:
- CPDF_LinkExtract();
- virtual ~CPDF_LinkExtract();
- virtual FX_BOOL ExtractLinks(const IPDF_TextPage* pTextPage);
- virtual FX_BOOL IsExtract() const
- {
- return m_IsParserd;
- }
-public:
- virtual int CountLinks() const;
- virtual CFX_WideString GetURL(int index) const;
- virtual void GetBoundedSegment(int index, int& start, int& count) const;
- virtual void GetRects(int index, CFX_RectArray& rects)const;
-protected:
- void parserLink();
- void DeleteLinkList();
- FX_BOOL CheckWebLink(CFX_WideString& strBeCheck);
- FX_BOOL CheckMailLink(CFX_WideString& str);
- FX_BOOL AppendToLinkList(int start, int count, CFX_WideString strUrl);
-private:
- LINK_InfoArray m_LinkList;
- const CPDF_TextPage* m_pTextPage;
- CFX_WideString m_strPageText;
- FX_BOOL m_IsParserd;
-};
-FX_STRSIZE FX_Unicode_GetNormalization(FX_WCHAR wch, FX_LPWSTR pDst);
-void NormalizeString(CFX_WideString& str);
-void NormalizeCompositeChar(FX_WCHAR wChar, CFX_WideString& sDest);
-#endif
+// 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 _PDF_TEXT_INT_H_
+#define _PDF_TEXT_INT_H_
+class CPDF_TextParseOptions : public CFX_Object
+{
+public:
+ CPDF_TextParseOptions();
+ FX_BOOL m_bCheckObjectOrder;
+ FX_BOOL m_bCheckDirection;
+ int m_nCheckSameObject;
+};
+class CPDF_TextPage;
+class CPDF_LinkExtract;
+class CPDF_TextPageFind;
+class CPDF_DocProgressiveSearch;
+#define FPDFTEXT_CHAR_ERROR -1
+#define FPDFTEXT_CHAR_NORMAL 0
+#define FPDFTEXT_CHAR_GENERATED 1
+#define FPDFTEXT_CHAR_UNUNICODE 2
+#define FPDFTEXT_CHAR_HYPHEN 3
+#define FPDFTEXT_CHAR_PIECE 4
+#define FPDFTEXT_MC_PASS 0
+#define FPDFTEXT_MC_DONE 1
+#define FPDFTEXT_MC_DELAY 2
+typedef struct _PAGECHAR_INFO: public CFX_Object {
+ int m_CharCode;
+ FX_WCHAR m_Unicode;
+ FX_FLOAT m_OriginX;
+ FX_FLOAT m_OriginY;
+ FX_INT32 m_Flag;
+ CFX_FloatRect m_CharBox;
+ CPDF_TextObject* m_pTextObj;
+ CFX_AffineMatrix m_Matrix;
+ int m_Index;
+} PAGECHAR_INFO;
+typedef CFX_SegmentedArray<PAGECHAR_INFO> PAGECHAR_InfoArray;
+typedef struct {
+ int m_Start;
+ int m_nCount;
+} FPDF_SEGMENT;
+typedef CFX_ArrayTemplate<FPDF_SEGMENT> SEGMENT_Array;
+typedef struct {
+ CPDF_TextObject* m_pTextObj;
+ CFX_AffineMatrix m_formMatrix;
+} PDFTEXT_Obj;
+typedef CFX_ArrayTemplate<PDFTEXT_Obj> LINEOBJ;
+class CPDF_TextPage: public IPDF_TextPage
+{
+public:
+ CPDF_TextPage(const CPDF_Page* pPage, int flags = 0);
+ CPDF_TextPage(const CPDF_PageObjects* pPage, int flags = 0);
+ CPDF_TextPage(const CPDF_Page* pPage, CPDFText_ParseOptions ParserOptions);
+ virtual FX_BOOL ParseTextPage();
+ virtual void NormalizeObjects(FX_BOOL bNormalize);
+ virtual FX_BOOL IsParsered() const
+ {
+ return m_IsParsered;
+ }
+ virtual ~CPDF_TextPage() {};
+public:
+ virtual int CharIndexFromTextIndex(int TextIndex)const ;
+ virtual int TextIndexFromCharIndex(int CharIndex)const;
+ virtual int CountChars() const;
+ virtual void GetCharInfo(int index, FPDF_CHAR_INFO & info) const;
+ virtual void GetRectArray(int start, int nCount, CFX_RectArray& rectArray) const;
+ virtual int GetIndexAtPos(CPDF_Point point, FX_FLOAT xTorelance, FX_FLOAT yTorelance) const;
+ virtual int GetIndexAtPos(FX_FLOAT x, FX_FLOAT y, FX_FLOAT xTorelance,
+ FX_FLOAT yTorelance) const;
+ virtual CFX_WideString GetTextByRect(CFX_FloatRect rect) const;
+ virtual void GetRectsArrayByRect(CFX_FloatRect rect, CFX_RectArray& resRectArray) const;
+ virtual int GetOrderByDirection(int order, int direction) const;
+ virtual CFX_WideString GetPageText(int start = 0, int nCount = -1) const;
+
+ virtual int CountRects(int start, int nCount);
+ virtual void GetRect(int rectIndex, FX_FLOAT& left, FX_FLOAT& top
+ , FX_FLOAT& right, FX_FLOAT &bottom) const;
+ virtual FX_BOOL GetBaselineRotate(int rectIndex, int& Rotate);
+ virtual FX_BOOL GetBaselineRotate(CFX_FloatRect rect, int& Rotate);
+ virtual int CountBoundedSegments(FX_FLOAT left, FX_FLOAT top,
+ FX_FLOAT right, FX_FLOAT bottom, FX_BOOL bContains = FALSE);
+ virtual void GetBoundedSegment(int index, int& start, int& count) const;
+ virtual int GetWordBreak(int index, int direction) const;
+public:
+ const PAGECHAR_InfoArray* GetCharList() const
+ {
+ return &m_charList;
+ }
+ static FX_BOOL IsRectIntersect(CFX_FloatRect rect1, CFX_FloatRect rect2);
+ static FX_BOOL IsLetter(FX_WCHAR unicode);
+private:
+ FX_BOOL IsHyphen(FX_WCHAR curChar);
+ FX_BOOL IsControlChar(PAGECHAR_INFO* pCharInfo);
+ FX_BOOL GetBaselineRotate(int start, int end, int& Rotate);
+ void ProcessObject();
+ void ProcessFormObject(CPDF_FormObject* pFormObj, CFX_AffineMatrix formMatrix);
+ void ProcessTextObject(PDFTEXT_Obj pObj);
+ void ProcessTextObject(CPDF_TextObject* pTextObj, CFX_AffineMatrix formMatrix, FX_POSITION ObjPos);
+ int ProcessInsertObject(const CPDF_TextObject* pObj, CFX_AffineMatrix formMatrix);
+ FX_BOOL GenerateCharInfo(FX_WCHAR unicode, PAGECHAR_INFO& info);
+ FX_BOOL IsSameAsPreTextObject(CPDF_TextObject* pTextObj, FX_POSITION ObjPos);
+ FX_BOOL IsSameTextObject(CPDF_TextObject* pTextObj1, CPDF_TextObject* pTextObj2);
+ int GetCharWidth(FX_DWORD charCode, CPDF_Font* pFont) const;
+ void CloseTempLine();
+ void OnPiece(IFX_BidiChar* pBidi, CFX_WideString& str);
+ FX_INT32 PreMarkedContent(PDFTEXT_Obj pObj);
+ void ProcessMarkedContent(PDFTEXT_Obj pObj);
+ void CheckMarkedContentObject(FX_INT32& start, FX_INT32& nCount) const;
+ void FindPreviousTextObject(void);
+ void AddCharInfoByLRDirection(CFX_WideString& str, int i);
+ void AddCharInfoByRLDirection(CFX_WideString& str, int i);
+ FX_INT32 GetTextObjectWritingMode(const CPDF_TextObject* pTextObj);
+ FX_INT32 FindTextlineFlowDirection();
+protected:
+ CPDFText_ParseOptions m_ParseOptions;
+ CFX_WordArray m_CharIndex;
+ const CPDF_PageObjects* m_pPage;
+ PAGECHAR_InfoArray m_charList;
+ CFX_WideTextBuf m_TextBuf;
+ PAGECHAR_InfoArray m_TempCharList;
+ CFX_WideTextBuf m_TempTextBuf;
+ int m_parserflag;
+ CPDF_TextObject* m_pPreTextObj;
+ CFX_AffineMatrix m_perMatrix;
+ FX_BOOL m_IsParsered;
+ CFX_AffineMatrix m_DisplayMatrix;
+
+ SEGMENT_Array m_Segment;
+ CFX_RectArray m_SelRects;
+ LINEOBJ m_LineObj;
+ FX_BOOL m_TextlineDir;
+ CFX_FloatRect m_CurlineRect;
+};
+class CPDF_TextPageFind: public IPDF_TextPageFind
+{
+public:
+ CPDF_TextPageFind(const IPDF_TextPage* pTextPage);
+ virtual ~CPDF_TextPageFind() {};
+public:
+ virtual FX_BOOL FindFirst(CFX_WideString findwhat, int flags, int startPos = 0);
+ virtual FX_BOOL FindNext();
+ virtual FX_BOOL FindPrev();
+
+ virtual void GetRectArray(CFX_RectArray& rects) const;
+ virtual int GetCurOrder() const;
+ virtual int GetMatchedCount()const;
+protected:
+ void ExtractFindWhat(CFX_WideString findwhat);
+ FX_BOOL IsMatchWholeWord(CFX_WideString csPageText, int startPos, int endPos);
+ FX_BOOL ExtractSubString(CFX_WideString& rString, FX_LPCWSTR lpszFullString,
+ int iSubString, FX_WCHAR chSep);
+ CFX_WideString MakeReverse(const CFX_WideString str);
+ int ReverseFind(CFX_WideString csPageText, CFX_WideString csWord, int nStartPos, int& WordLength);
+ int GetCharIndex(int index) const;
+private:
+ CFX_WordArray m_CharIndex;
+ const IPDF_TextPage* m_pTextPage;
+ CFX_WideString m_strText;
+ CFX_WideString m_findWhat;
+ int m_flags;
+ CFX_WideStringArray m_csFindWhatArray;
+ int m_findNextStart;
+ int m_findPreStart;
+ FX_BOOL m_bMatchCase;
+ FX_BOOL m_bMatchWholeWord;
+ int m_resStart;
+ int m_resEnd;
+ CFX_RectArray m_resArray;
+ FX_BOOL m_IsFind;
+};
+class CPDF_LinkExt: public CFX_Object
+{
+public:
+ CPDF_LinkExt() {};
+ int m_Start;
+ int m_Count;
+ CFX_WideString m_strUrl;
+ virtual ~CPDF_LinkExt() {};
+};
+typedef CFX_ArrayTemplate<CPDF_LinkExt*> LINK_InfoArray;
+class CPDF_LinkExtract: public IPDF_LinkExtract
+{
+public:
+ CPDF_LinkExtract();
+ virtual ~CPDF_LinkExtract();
+ virtual FX_BOOL ExtractLinks(const IPDF_TextPage* pTextPage);
+ virtual FX_BOOL IsExtract() const
+ {
+ return m_IsParserd;
+ }
+public:
+ virtual int CountLinks() const;
+ virtual CFX_WideString GetURL(int index) const;
+ virtual void GetBoundedSegment(int index, int& start, int& count) const;
+ virtual void GetRects(int index, CFX_RectArray& rects)const;
+protected:
+ void parserLink();
+ void DeleteLinkList();
+ FX_BOOL CheckWebLink(CFX_WideString& strBeCheck);
+ FX_BOOL CheckMailLink(CFX_WideString& str);
+ FX_BOOL AppendToLinkList(int start, int count, CFX_WideString strUrl);
+private:
+ LINK_InfoArray m_LinkList;
+ const CPDF_TextPage* m_pTextPage;
+ CFX_WideString m_strPageText;
+ FX_BOOL m_IsParserd;
+};
+FX_STRSIZE FX_Unicode_GetNormalization(FX_WCHAR wch, FX_LPWSTR pDst);
+void NormalizeString(CFX_WideString& str);
+void NormalizeCompositeChar(FX_WCHAR wChar, CFX_WideString& sDest);
+#endif
diff --git a/core/src/fpdftext/txtproc.h b/core/src/fpdftext/txtproc.h
index 3ec850d9db..5a88ee52f9 100644
--- a/core/src/fpdftext/txtproc.h
+++ b/core/src/fpdftext/txtproc.h
@@ -1,70 +1,70 @@
-// 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 _PDF_TXTPROC_H_
-#define _PDF_TXTPROC_H_
-class CTextColumn : public CFX_Object
-{
-public:
- FX_FLOAT m_AvgPos;
- int m_Count;
- int m_TextPos;
-};
-class CTextBox : public CFX_Object
-{
-public:
- CFX_WideString m_Text;
- FX_FLOAT m_Left;
- FX_FLOAT m_Right;
- FX_FLOAT m_SpaceWidth;
- FX_FLOAT m_Top;
- FX_FLOAT m_Bottom;
- FX_FLOAT m_FontSizeV;
- CTextColumn* m_pColumn;
-};
-class CTextBaseLine : public CFX_Object
-{
-public:
- CTextBaseLine();
- ~CTextBaseLine();
- void InsertTextBox(FX_FLOAT leftx, FX_FLOAT rightx, FX_FLOAT topy, FX_FLOAT bottomy,
- FX_FLOAT spacew, FX_FLOAT fontsize_v, const CFX_WideString& str);
- FX_BOOL GetWidth(FX_FLOAT& leftx, FX_FLOAT& rightx);
- FX_BOOL CanMerge(CTextBaseLine* pOther);
- void Merge(CTextBaseLine* pOther);
- void MergeBoxes();
- void CountChars(int& count, FX_FLOAT& width, int& minchars);
- void WriteOutput(CFX_WideString& str, FX_FLOAT leftx, FX_FLOAT width, int iWidth);
- FX_FLOAT m_BaseLine;
- FX_FLOAT m_Top;
- FX_FLOAT m_Bottom;
- FX_FLOAT m_MaxFontSizeV;
- CFX_PtrArray m_TextList;
-};
-class CPDF_PageObject;
-class CPDF_TextObject;
-class CTextPage : public CFX_Object
-{
-public:
- CTextPage();
- ~CTextPage();
- void ProcessObject(CPDF_PageObject* pObj);
- CTextBaseLine* InsertTextBox(CTextBaseLine* pBaseLine, FX_FLOAT basey, FX_FLOAT leftx,
- FX_FLOAT rightx, FX_FLOAT topy, FX_FLOAT bottomy, FX_FLOAT spacew, FX_FLOAT fontsize_v,
- CFX_ByteString& str, CPDF_Font* pFont);
- void WriteOutput(CFX_WideStringArray& lines, int iMinWidth);
- FX_BOOL m_bAutoWidth;
- FX_BOOL m_bKeepColumn;
- FX_BOOL m_bBreakSpace;
- FX_BOOL m_bOCR;
-private:
- CFX_PtrArray m_BaseLines;
- CFX_PtrArray m_TextColumns;
- void FindColumns();
- CTextColumn* FindColumn(FX_FLOAT xpos);
- void BreakSpace(CPDF_TextObject* pTextObj);
-};
-#endif
+// 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 _PDF_TXTPROC_H_
+#define _PDF_TXTPROC_H_
+class CTextColumn : public CFX_Object
+{
+public:
+ FX_FLOAT m_AvgPos;
+ int m_Count;
+ int m_TextPos;
+};
+class CTextBox : public CFX_Object
+{
+public:
+ CFX_WideString m_Text;
+ FX_FLOAT m_Left;
+ FX_FLOAT m_Right;
+ FX_FLOAT m_SpaceWidth;
+ FX_FLOAT m_Top;
+ FX_FLOAT m_Bottom;
+ FX_FLOAT m_FontSizeV;
+ CTextColumn* m_pColumn;
+};
+class CTextBaseLine : public CFX_Object
+{
+public:
+ CTextBaseLine();
+ ~CTextBaseLine();
+ void InsertTextBox(FX_FLOAT leftx, FX_FLOAT rightx, FX_FLOAT topy, FX_FLOAT bottomy,
+ FX_FLOAT spacew, FX_FLOAT fontsize_v, const CFX_WideString& str);
+ FX_BOOL GetWidth(FX_FLOAT& leftx, FX_FLOAT& rightx);
+ FX_BOOL CanMerge(CTextBaseLine* pOther);
+ void Merge(CTextBaseLine* pOther);
+ void MergeBoxes();
+ void CountChars(int& count, FX_FLOAT& width, int& minchars);
+ void WriteOutput(CFX_WideString& str, FX_FLOAT leftx, FX_FLOAT width, int iWidth);
+ FX_FLOAT m_BaseLine;
+ FX_FLOAT m_Top;
+ FX_FLOAT m_Bottom;
+ FX_FLOAT m_MaxFontSizeV;
+ CFX_PtrArray m_TextList;
+};
+class CPDF_PageObject;
+class CPDF_TextObject;
+class CTextPage : public CFX_Object
+{
+public:
+ CTextPage();
+ ~CTextPage();
+ void ProcessObject(CPDF_PageObject* pObj);
+ CTextBaseLine* InsertTextBox(CTextBaseLine* pBaseLine, FX_FLOAT basey, FX_FLOAT leftx,
+ FX_FLOAT rightx, FX_FLOAT topy, FX_FLOAT bottomy, FX_FLOAT spacew, FX_FLOAT fontsize_v,
+ CFX_ByteString& str, CPDF_Font* pFont);
+ void WriteOutput(CFX_WideStringArray& lines, int iMinWidth);
+ FX_BOOL m_bAutoWidth;
+ FX_BOOL m_bKeepColumn;
+ FX_BOOL m_bBreakSpace;
+ FX_BOOL m_bOCR;
+private:
+ CFX_PtrArray m_BaseLines;
+ CFX_PtrArray m_TextColumns;
+ void FindColumns();
+ CTextColumn* FindColumn(FX_FLOAT xpos);
+ void BreakSpace(CPDF_TextObject* pTextObj);
+};
+#endif
diff --git a/core/src/fpdftext/unicodenormalization.cpp b/core/src/fpdftext/unicodenormalization.cpp
index b92787b952..1d36b8576a 100644
--- a/core/src/fpdftext/unicodenormalization.cpp
+++ b/core/src/fpdftext/unicodenormalization.cpp
@@ -1,75 +1,75 @@
-// 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
-
-#include "../../include/fpdftext/fpdf_text.h"
-extern const FX_WCHAR g_UnicodeData_Normalization[65536];
-extern const FX_WCHAR g_UnicodeData_Normalization_Map1[5376];
-extern const FX_WCHAR g_UnicodeData_Normalization_Map2[1734];
-extern const FX_WCHAR g_UnicodeData_Normalization_Map3[1164];
-extern const FX_WCHAR g_UnicodeData_Normalization_Map4[488];
-FX_LPCWSTR g_UnicodeData_Normalization_Maps[5] = {
- NULL,
- g_UnicodeData_Normalization_Map1,
- g_UnicodeData_Normalization_Map2,
- g_UnicodeData_Normalization_Map3,
- g_UnicodeData_Normalization_Map4
-};
-FX_STRSIZE FX_Unicode_GetNormalization(FX_WCHAR wch, FX_LPWSTR pDst)
-{
- wch = wch & 0xFFFF;
- FX_WCHAR wFind = g_UnicodeData_Normalization[wch];
- if (!wFind) {
- if (pDst) {
- *pDst = wch;
- }
- return 1;
- }
- if(wFind >= 0x8000) {
- wch = wFind - 0x8000;
- wFind = 1;
- } else {
- wch = wFind & 0x0FFF;
- wFind >>= 12;
- }
- FX_LPCWSTR pMap = g_UnicodeData_Normalization_Maps[wFind];
- if (pMap == g_UnicodeData_Normalization_Map4) {
- pMap = g_UnicodeData_Normalization_Map4 + wch;
- wFind = (FX_WCHAR)(*pMap ++);
- } else {
- pMap += wch;
- }
- if (pDst) {
- FX_WCHAR n = wFind;
- while (n --) {
- *pDst ++ = *pMap ++;
- }
- }
- return (FX_STRSIZE)wFind;
-}
-FX_STRSIZE FX_WideString_GetNormalization(FX_WSTR wsSrc, FX_LPWSTR pDst)
-{
- FX_STRSIZE nCount = 0;
- for (FX_STRSIZE len = 0; len < wsSrc.GetLength(); len ++) {
- FX_WCHAR wch = wsSrc.GetAt(len);
- if(pDst) {
- nCount += FX_Unicode_GetNormalization(wch, pDst + nCount);
- } else {
- nCount += FX_Unicode_GetNormalization(wch, pDst);
- }
- }
- return nCount;
-}
-FX_STRSIZE FX_WideString_GetNormalization(FX_WSTR wsSrc, CFX_WideString &wsDst)
-{
- FX_STRSIZE nLen = FX_WideString_GetNormalization(wsSrc, (FX_LPWSTR)NULL);
- if (!nLen) {
- return 0;
- }
- FX_LPWSTR pBuf = wsDst.GetBuffer(nLen);
- FX_WideString_GetNormalization(wsSrc, pBuf);
- wsDst.ReleaseBuffer(nLen);
- return nLen;
-}
+// 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
+
+#include "../../include/fpdftext/fpdf_text.h"
+extern const FX_WCHAR g_UnicodeData_Normalization[65536];
+extern const FX_WCHAR g_UnicodeData_Normalization_Map1[5376];
+extern const FX_WCHAR g_UnicodeData_Normalization_Map2[1734];
+extern const FX_WCHAR g_UnicodeData_Normalization_Map3[1164];
+extern const FX_WCHAR g_UnicodeData_Normalization_Map4[488];
+FX_LPCWSTR g_UnicodeData_Normalization_Maps[5] = {
+ NULL,
+ g_UnicodeData_Normalization_Map1,
+ g_UnicodeData_Normalization_Map2,
+ g_UnicodeData_Normalization_Map3,
+ g_UnicodeData_Normalization_Map4
+};
+FX_STRSIZE FX_Unicode_GetNormalization(FX_WCHAR wch, FX_LPWSTR pDst)
+{
+ wch = wch & 0xFFFF;
+ FX_WCHAR wFind = g_UnicodeData_Normalization[wch];
+ if (!wFind) {
+ if (pDst) {
+ *pDst = wch;
+ }
+ return 1;
+ }
+ if(wFind >= 0x8000) {
+ wch = wFind - 0x8000;
+ wFind = 1;
+ } else {
+ wch = wFind & 0x0FFF;
+ wFind >>= 12;
+ }
+ FX_LPCWSTR pMap = g_UnicodeData_Normalization_Maps[wFind];
+ if (pMap == g_UnicodeData_Normalization_Map4) {
+ pMap = g_UnicodeData_Normalization_Map4 + wch;
+ wFind = (FX_WCHAR)(*pMap ++);
+ } else {
+ pMap += wch;
+ }
+ if (pDst) {
+ FX_WCHAR n = wFind;
+ while (n --) {
+ *pDst ++ = *pMap ++;
+ }
+ }
+ return (FX_STRSIZE)wFind;
+}
+FX_STRSIZE FX_WideString_GetNormalization(FX_WSTR wsSrc, FX_LPWSTR pDst)
+{
+ FX_STRSIZE nCount = 0;
+ for (FX_STRSIZE len = 0; len < wsSrc.GetLength(); len ++) {
+ FX_WCHAR wch = wsSrc.GetAt(len);
+ if(pDst) {
+ nCount += FX_Unicode_GetNormalization(wch, pDst + nCount);
+ } else {
+ nCount += FX_Unicode_GetNormalization(wch, pDst);
+ }
+ }
+ return nCount;
+}
+FX_STRSIZE FX_WideString_GetNormalization(FX_WSTR wsSrc, CFX_WideString &wsDst)
+{
+ FX_STRSIZE nLen = FX_WideString_GetNormalization(wsSrc, (FX_LPWSTR)NULL);
+ if (!nLen) {
+ return 0;
+ }
+ FX_LPWSTR pBuf = wsDst.GetBuffer(nLen);
+ FX_WideString_GetNormalization(wsSrc, pBuf);
+ wsDst.ReleaseBuffer(nLen);
+ return nLen;
+}
diff --git a/core/src/fpdftext/unicodenormalizationdata.cpp b/core/src/fpdftext/unicodenormalizationdata.cpp
index 750382b010..37ccdc94ae 100644
--- a/core/src/fpdftext/unicodenormalizationdata.cpp
+++ b/core/src/fpdftext/unicodenormalizationdata.cpp
@@ -1,4661 +1,4661 @@
-// 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
-
-#include "../../include/fxcrt/fx_system.h"
-extern const FX_WCHAR g_UnicodeData_Normalization[65536] = {
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x8000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8001, 0x0000, 0x2000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2002, 0x8002, 0x0000, 0x2004, 0x0000, 0x0000, 0x8003,
- 0x8004, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8005, 0x0000, 0x8006, 0x0000, 0x0000, 0x0000, 0x8007, 0x8008,
- 0x0000, 0x0000, 0x8009, 0x800A, 0x800B, 0x800C, 0x0000, 0x0000, 0x800D, 0x800E, 0x800F, 0x0000, 0x3000, 0x3003, 0x3006, 0x0000,
- 0x8010, 0x8011, 0x8012, 0x8013, 0x8014, 0x8015, 0x0000, 0x8016, 0x8017, 0x8018, 0x8019, 0x801A, 0x801B, 0x801C, 0x801D, 0x801E,
- 0x801F, 0x8020, 0x8021, 0x8022, 0x8023, 0x8024, 0x8025, 0x0000, 0x8026, 0x8027, 0x8028, 0x8029, 0x802A, 0x802B, 0x0000, 0x0000,
- 0x802C, 0x802D, 0x802E, 0x802F, 0x8030, 0x8031, 0x0000, 0x8032, 0x8033, 0x8034, 0x8035, 0x8036, 0x8037, 0x8038, 0x8039, 0x803A,
- 0x0000, 0x803B, 0x803C, 0x803D, 0x803E, 0x803F, 0x8040, 0x0000, 0x8041, 0x8042, 0x8043, 0x8044, 0x8045, 0x8046, 0x0000, 0x8047,
- 0x8048, 0x8049, 0x804A, 0x804B, 0x804C, 0x804D, 0x804E, 0x804F, 0x8050, 0x8051, 0x8052, 0x8053, 0x8054, 0x8055, 0x8056, 0x8057,
- 0x8058, 0x8059, 0x805A, 0x805B, 0x805C, 0x805D, 0x805E, 0x805F, 0x8060, 0x8061, 0x8062, 0x8063, 0x8064, 0x8065, 0x8066, 0x8067,
- 0x8068, 0x8069, 0x806A, 0x806B, 0x806C, 0x806D, 0x806E, 0x806F, 0x8070, 0x8071, 0x8072, 0x8073, 0x8074, 0x8075, 0x8076, 0x8077,
- 0x8078, 0x0000, 0x2006, 0x2008, 0x8079, 0x807A, 0x807B, 0x807C, 0x807D, 0x807E, 0x807F, 0x8080, 0x8081, 0x8082, 0x8083, 0x8084,
- 0x8085, 0x8086, 0x8087, 0x8088, 0x8089, 0x808A, 0x808B, 0x808C, 0x808D, 0x808E, 0x0000, 0x0000, 0x808F, 0x8090, 0x8091, 0x8092,
- 0x8093, 0x8094, 0x200A, 0x200C, 0x8095, 0x8096, 0x8097, 0x8098, 0x8099, 0x809A, 0x809B, 0x809C, 0x809D, 0x809E, 0x809F, 0x80A0,
- 0x80A1, 0x80A2, 0x80A3, 0x80A4, 0x80A5, 0x80A6, 0x80A7, 0x80A8, 0x80A9, 0x80AA, 0x80AB, 0x80AC, 0x80AD, 0x80AE, 0x80AF, 0x80B0,
- 0x80B1, 0x80B2, 0x80B3, 0x80B4, 0x80B5, 0x80B6, 0x80B7, 0x80B8, 0x80B9, 0x80BA, 0x80BB, 0x80BC, 0x80BD, 0x80BE, 0x80BF, 0x80C0,
- 0x80C1, 0x80C2, 0x80C3, 0x80C4, 0x0000, 0x0000, 0x0000, 0x80C5, 0x80C6, 0x80C7, 0x80C8, 0x80C9, 0x80CA, 0x0000, 0x80CB, 0x0000,
- 0x80CC, 0x80CD, 0x80CE, 0x80CF, 0x0000, 0x0000, 0x0000, 0x80D0, 0x80D1, 0x80D2, 0x80D3, 0x0000, 0x80D4, 0x80D5, 0x80D6, 0x80D7,
- 0x80D8, 0x80D9, 0x0000, 0x0000, 0x80DA, 0x80DB, 0x0000, 0x0000, 0x0000, 0x0000, 0x80DC, 0x80DD, 0x80DE, 0x80DF, 0x80E0, 0x80E1,
- 0x80E2, 0x0000, 0x80E3, 0x80E4, 0x80E5, 0x80E6, 0x80E7, 0x0000, 0x80E8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x200E, 0x2010, 0x2012, 0x2014, 0x2016, 0x2018, 0x201A, 0x201C, 0x201E, 0x80E9, 0x80EA, 0x80EB,
- 0x80EC, 0x80ED, 0x80EE, 0x80EF, 0x80F0, 0x80F1, 0x80F2, 0x80F3, 0x80F4, 0x80F5, 0x80F6, 0x80F7, 0x80F8, 0x80F9, 0x80FA, 0x80FB,
- 0x80FC, 0x80FD, 0x80FE, 0x80FF, 0x8100, 0x8101, 0x8102, 0x8103, 0x8104, 0x8105, 0x8106, 0x8107, 0x8108, 0x8109, 0x810A, 0x810B,
- 0x810C, 0x2020, 0x2022, 0x2024, 0x810D, 0x810E, 0x0000, 0x0000, 0x810F, 0x8110, 0x8111, 0x8112, 0x8113, 0x8114, 0x8115, 0x8116,
- 0x8117, 0x8118, 0x8119, 0x811A, 0x811B, 0x811C, 0x811D, 0x811E, 0x811F, 0x8120, 0x8121, 0x8122, 0x8123, 0x8124, 0x8125, 0x8126,
- 0x8127, 0x8128, 0x8129, 0x812A, 0x812B, 0x812C, 0x812D, 0x812E, 0x812F, 0x8130, 0x8131, 0x8132, 0x0000, 0x0000, 0x8133, 0x8134,
- 0x8135, 0x8136, 0x0000, 0x0000, 0x8137, 0x8138, 0x8139, 0x813A, 0x813B, 0x813C, 0x813D, 0x813E, 0x813F, 0x8140, 0x8141, 0x8142,
- 0x8143, 0x8144, 0x8145, 0x8146, 0x8147, 0x8148, 0x8149, 0x814A, 0x2026, 0x2028, 0x814B, 0x814C, 0x814D, 0x814E, 0x814F, 0x8150,
- 0x8151, 0x0000, 0x0000, 0x8152, 0x8153, 0x8154, 0x8155, 0x8156, 0x8157, 0x8158, 0x8159, 0x815A, 0x815B, 0x815C, 0x815D, 0x815E,
- 0x815F, 0x0000, 0x8160, 0x8161, 0x8162, 0x8163, 0x8164, 0x8165, 0x8166, 0x0000, 0x8167, 0x8168, 0x8169, 0x816A, 0x816B, 0x816C,
- 0x816D, 0x816E, 0x816F, 0x0000, 0x0000, 0x8170, 0x8171, 0x0000, 0x8172, 0x0000, 0x8173, 0x8174, 0x8175, 0x8176, 0x0000, 0x8177,
- 0x8178, 0x8179, 0x817A, 0x817B, 0x817C, 0x817D, 0x202A, 0x0000, 0x0000, 0x817E, 0x817F, 0x8180, 0x8181, 0x8182, 0x8183, 0x8184,
- 0x8185, 0x8186, 0x8187, 0x0000, 0x8188, 0x8189, 0x818A, 0x818B, 0x818C, 0x818D, 0x0000, 0x818E, 0x818F, 0x8190, 0x8191, 0x8192,
- 0x8193, 0x8194, 0x0000, 0x8195, 0x0000, 0x0000, 0x0000, 0x8196, 0x0000, 0x8197, 0x8198, 0x8199, 0x819A, 0x819B, 0x819C, 0x819D,
- 0x819E, 0x0000, 0x0000, 0x202C, 0x202E, 0x2030, 0x2032, 0x2034, 0x2036, 0x2038, 0x203A, 0x203C, 0x0000, 0x0000, 0x819F, 0x81A0,
- 0x81A1, 0x81A2, 0x81A3, 0x81A4, 0x81A5, 0x81A6, 0x81A7, 0x81A8, 0x81A9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x81AA, 0x81AB, 0x81AC, 0x81AD, 0x81AE, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x81AF, 0x81B0, 0x0000, 0x81B1, 0x81B2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x81B3, 0x81B4, 0x81B5, 0x81B6, 0x81B7, 0x81B8, 0x81B9, 0x81BA, 0x81BB, 0x81BC, 0x81BD, 0x81BE, 0x81BF,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x81C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x81C1, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x81C2, 0x81C3, 0x81C4, 0x81C5, 0x81C6, 0x81C7, 0x81C8, 0x0000, 0x81C9, 0x0000, 0x81CA, 0x81CB,
- 0x81CC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x81CD, 0x81CE, 0x81CF, 0x81D0, 0x81D1, 0x81D2,
- 0x81D3, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x81D4, 0x81D5, 0x81D6, 0x81D7, 0x81D8, 0x0000,
- 0x81D9, 0x81DA, 0x81DB, 0x81DC, 0x81DD, 0x81DE, 0x81DF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x81E0, 0x81E1, 0x81E2, 0x0000, 0x81E3, 0x81E4, 0x0000, 0x0000, 0x0000, 0x81E5, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x81E6, 0x81E7, 0x0000, 0x81E8, 0x0000, 0x0000, 0x0000, 0x81E9, 0x0000, 0x0000, 0x0000, 0x0000, 0x81EA, 0x81EB, 0x81EC, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x81ED, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x81EE, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x81EF, 0x81F0, 0x0000, 0x81F1, 0x0000, 0x0000, 0x0000, 0x81F2, 0x0000, 0x0000, 0x0000, 0x0000, 0x81F3, 0x81F4, 0x81F5, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x81F6, 0x81F7, 0x0000, 0x0000, 0x81F8, 0x81F9, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x81FA, 0x81FB, 0x0000, 0x0000, 0x0000, 0x0000, 0x81FC, 0x81FD, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x81FE, 0x81FF, 0x0000, 0x0000, 0x8200, 0x8201,
- 0x8202, 0x8203, 0x8204, 0x8205, 0x8206, 0x8207, 0x8208, 0x8209, 0x820A, 0x820B, 0x820C, 0x820D, 0x820E, 0x820F, 0x8210, 0x8211,
- 0x8212, 0x8213, 0x8214, 0x8215, 0x203E, 0x2040, 0x8216, 0x8217, 0x0000, 0x0000, 0x8218, 0x8219, 0x821A, 0x821B, 0x0000, 0x0000,
- 0x821C, 0x821D, 0x821E, 0x821F, 0x2042, 0x2044, 0x8220, 0x8221, 0x8222, 0x8223, 0x0000, 0x0000, 0x8224, 0x8225, 0x8226, 0x8227,
- 0x0000, 0x8228, 0x8229, 0x822A, 0x822B, 0x822C, 0x822D, 0x822E, 0x822F, 0x8230, 0x8231, 0x0000, 0x0000, 0x8232, 0x8233, 0x0000,
- 0x8234, 0x8235, 0x8236, 0x8237, 0x2046, 0x2048, 0x8238, 0x8239, 0x0000, 0x0000, 0x823A, 0x823B, 0x823C, 0x823D, 0x823E, 0x823F,
- 0x0000, 0x0000, 0x8240, 0x8241, 0x8242, 0x8243, 0x8244, 0x8245, 0x0000, 0x0000, 0x8246, 0x8247, 0x8248, 0x8249, 0x824A, 0x824B,
- 0x824C, 0x824D, 0x824E, 0x824F, 0x8250, 0x8251, 0x8252, 0x8253, 0x8254, 0x8255, 0x8256, 0x8257, 0x8258, 0x8259, 0x825A, 0x825B,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x825C, 0x825D, 0x825E, 0x825F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x204A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x204C, 0x204E, 0x2050, 0x2052, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x2054, 0x0000, 0x2056, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x2058, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x205A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x205C, 0x0000, 0x0000, 0x205E, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2060, 0x2062, 0x2064, 0x2066, 0x2068, 0x206A, 0x206C, 0x206E,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2070, 0x2072, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2074, 0x2076, 0x0000, 0x2078,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x207A, 0x0000, 0x0000, 0x207C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x207E, 0x2080, 0x2082, 0x0000, 0x0000, 0x2084, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2086, 0x0000, 0x0000, 0x2088, 0x208A, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x208C, 0x208E, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x2090, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2092, 0x2094, 0x2096, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2098, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x209A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x209C, 0x209E, 0x0000, 0x20A0, 0x20A2, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x20A4, 0x20A6, 0x20A8, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x20AA, 0x0000, 0x20AC, 0x20AE, 0x20B0, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x20B2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x20B4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x20B6, 0x20B8, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8260, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x20BA, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x20BC, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x20BE, 0x0000, 0x0000, 0x0000, 0x0000, 0x20C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x20C2, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x20C4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x20C6, 0x0000, 0x20C8, 0x20CA, 0x20CC, 0x20CE, 0x20D0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x20D2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x20D4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x20D6, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x20D8, 0x0000, 0x0000, 0x0000, 0x0000, 0x20DA, 0x0000, 0x0000, 0x0000, 0x0000, 0x20DC, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x20DE, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x20E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8261, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x20E2, 0x0000, 0x20E4, 0x0000, 0x20E6, 0x0000, 0x20E8, 0x0000, 0x20EA, 0x0000,
- 0x0000, 0x0000, 0x20EC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x20EE, 0x0000, 0x20F0, 0x0000, 0x0000,
- 0x20F2, 0x20F4, 0x0000, 0x20F6, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8262, 0x8263, 0x8264, 0x8265,
- 0x8266, 0x8267, 0x8268, 0x8269, 0x826A, 0x826B, 0x826C, 0x826D, 0x826E, 0x826F, 0x8270, 0x0000, 0x8271, 0x8272, 0x8273, 0x8274,
- 0x8275, 0x8276, 0x8277, 0x8278, 0x8279, 0x827A, 0x827B, 0x827C, 0x827D, 0x827E, 0x827F, 0x8280, 0x8281, 0x8282, 0x0000, 0x8283,
- 0x8284, 0x8285, 0x8286, 0x8287, 0x8288, 0x8289, 0x828A, 0x828B, 0x828C, 0x828D, 0x828E, 0x828F, 0x8290, 0x8291, 0x8292, 0x8293,
- 0x8294, 0x8295, 0x8296, 0x8297, 0x8298, 0x8299, 0x829A, 0x829B, 0x829C, 0x829D, 0x829E, 0x0000, 0x829F, 0x82A0, 0x82A1, 0x82A2,
- 0x82A3, 0x82A4, 0x82A5, 0x82A6, 0x82A7, 0x82A8, 0x82A9, 0x82AA, 0x82AB, 0x0000, 0x20F8, 0x82AC, 0x0000, 0x82AD, 0x82AE, 0x82AF,
- 0x82B0, 0x82B1, 0x82B2, 0x82B3, 0x82B4, 0x82B5, 0x82B6, 0x82B7, 0x82B8, 0x82B9, 0x82BA, 0x82BB, 0x82BC, 0x82BD, 0x82BE, 0x82BF,
- 0x82C0, 0x82C1, 0x82C2, 0x82C3, 0x82C4, 0x82C5, 0x82C6, 0x0000, 0x82C7, 0x0000, 0x0000, 0x82C8, 0x82C9, 0x82CA, 0x82CB, 0x82CC,
- 0x82CD, 0x82CE, 0x82CF, 0x82D0, 0x82D1, 0x82D2, 0x82D3, 0x82D4, 0x82D5, 0x82D6, 0x82D7, 0x82D8, 0x82D9, 0x82DA, 0x82DB, 0x82DC,
- 0x82DD, 0x82DE, 0x82DF, 0x82E0, 0x82E1, 0x82E2, 0x82E3, 0x82E4, 0x82E5, 0x82E6, 0x82E7, 0x82E8, 0x82E9, 0x82EA, 0x82EB, 0x82EC,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x82ED, 0x82EE, 0x82EF, 0x82F0, 0x82F1, 0x82F2, 0x82F3, 0x82F4, 0x82F5, 0x82F6, 0x82F7, 0x82F8, 0x82F9, 0x82FA, 0x82FB, 0x82FC,
- 0x82FD, 0x82FE, 0x82FF, 0x8300, 0x8301, 0x8302, 0x8303, 0x8304, 0x8305, 0x8306, 0x8307, 0x8308, 0x8309, 0x830A, 0x830B, 0x830C,
- 0x830D, 0x830E, 0x830F, 0x8310, 0x8311, 0x8312, 0x8313, 0x8314, 0x8315, 0x8316, 0x8317, 0x8318, 0x8319, 0x831A, 0x831B, 0x831C,
- 0x831D, 0x831E, 0x831F, 0x8320, 0x8321, 0x8322, 0x8323, 0x8324, 0x8325, 0x8326, 0x8327, 0x8328, 0x8329, 0x832A, 0x832B, 0x832C,
- 0x832D, 0x832E, 0x832F, 0x8330, 0x8331, 0x8332, 0x8333, 0x8334, 0x8335, 0x8336, 0x8337, 0x8338, 0x8339, 0x833A, 0x833B, 0x833C,
- 0x833D, 0x833E, 0x833F, 0x8340, 0x8341, 0x8342, 0x8343, 0x8344, 0x8345, 0x8346, 0x8347, 0x8348, 0x8349, 0x834A, 0x834B, 0x834C,
- 0x834D, 0x834E, 0x834F, 0x8350, 0x8351, 0x8352, 0x8353, 0x8354, 0x8355, 0x8356, 0x8357, 0x8358, 0x8359, 0x835A, 0x835B, 0x835C,
- 0x835D, 0x835E, 0x835F, 0x8360, 0x8361, 0x8362, 0x8363, 0x8364, 0x8365, 0x8366, 0x8367, 0x8368, 0x8369, 0x836A, 0x836B, 0x836C,
- 0x836D, 0x836E, 0x836F, 0x8370, 0x8371, 0x8372, 0x8373, 0x8374, 0x8375, 0x8376, 0x8377, 0x8378, 0x8379, 0x837A, 0x837B, 0x837C,
- 0x837D, 0x837E, 0x837F, 0x8380, 0x8381, 0x8382, 0x8383, 0x8384, 0x8385, 0x8386, 0x8387, 0x8388, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x8389, 0x838A, 0x838B, 0x838C, 0x838D, 0x838E, 0x838F, 0x8390, 0x8391, 0x8392, 0x8393, 0x8394, 0x8395, 0x8396, 0x8397, 0x8398,
- 0x8399, 0x839A, 0x839B, 0x839C, 0x839D, 0x839E, 0x839F, 0x83A0, 0x83A1, 0x83A2, 0x83A3, 0x83A4, 0x83A5, 0x83A6, 0x83A7, 0x83A8,
- 0x83A9, 0x83AA, 0x83AB, 0x83AC, 0x83AD, 0x83AE, 0x83AF, 0x83B0, 0x83B1, 0x83B2, 0x83B3, 0x83B4, 0x83B5, 0x83B6, 0x83B7, 0x83B8,
- 0x83B9, 0x83BA, 0x83BB, 0x83BC, 0x83BD, 0x83BE, 0x83BF, 0x83C0, 0x83C1, 0x83C2, 0x83C3, 0x83C4, 0x83C5, 0x83C6, 0x83C7, 0x83C8,
- 0x83C9, 0x83CA, 0x83CB, 0x83CC, 0x83CD, 0x83CE, 0x83CF, 0x83D0, 0x83D1, 0x83D2, 0x83D3, 0x83D4, 0x83D5, 0x83D6, 0x83D7, 0x83D8,
- 0x83D9, 0x83DA, 0x83DB, 0x83DC, 0x83DD, 0x83DE, 0x83DF, 0x83E0, 0x83E1, 0x83E2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x83E3, 0x83E4, 0x83E5, 0x83E6, 0x83E7, 0x83E8, 0x83E9, 0x83EA, 0x83EB, 0x83EC, 0x83ED, 0x83EE, 0x83EF, 0x83F0, 0x83F1, 0x83F2,
- 0x83F3, 0x83F4, 0x83F5, 0x83F6, 0x83F7, 0x83F8, 0x0000, 0x0000, 0x83F9, 0x83FA, 0x83FB, 0x83FC, 0x83FD, 0x83FE, 0x0000, 0x0000,
- 0x83FF, 0x8400, 0x8401, 0x8402, 0x8403, 0x8404, 0x8405, 0x8406, 0x8407, 0x8408, 0x8409, 0x840A, 0x840B, 0x840C, 0x840D, 0x840E,
- 0x840F, 0x8410, 0x8411, 0x8412, 0x8413, 0x8414, 0x8415, 0x8416, 0x8417, 0x8418, 0x8419, 0x841A, 0x841B, 0x841C, 0x841D, 0x841E,
- 0x841F, 0x8420, 0x8421, 0x8422, 0x8423, 0x8424, 0x0000, 0x0000, 0x8425, 0x8426, 0x8427, 0x8428, 0x8429, 0x842A, 0x0000, 0x0000,
- 0x842B, 0x842C, 0x842D, 0x842E, 0x842F, 0x8430, 0x8431, 0x8432, 0x0000, 0x8433, 0x0000, 0x8434, 0x0000, 0x8435, 0x0000, 0x8436,
- 0x8437, 0x8438, 0x8439, 0x843A, 0x843B, 0x843C, 0x843D, 0x843E, 0x843F, 0x8440, 0x8441, 0x8442, 0x8443, 0x8444, 0x8445, 0x8446,
- 0x8447, 0x8448, 0x8449, 0x844A, 0x844B, 0x844C, 0x844D, 0x844E, 0x844F, 0x8450, 0x8451, 0x8452, 0x8453, 0x8454, 0x0000, 0x0000,
- 0x8455, 0x8456, 0x8457, 0x8458, 0x8459, 0x845A, 0x845B, 0x845C, 0x845D, 0x845E, 0x845F, 0x8460, 0x8461, 0x8462, 0x8463, 0x8464,
- 0x8465, 0x8466, 0x8467, 0x8468, 0x8469, 0x846A, 0x846B, 0x846C, 0x846D, 0x846E, 0x846F, 0x8470, 0x8471, 0x8472, 0x8473, 0x8474,
- 0x8475, 0x8476, 0x8477, 0x8478, 0x8479, 0x847A, 0x847B, 0x847C, 0x847D, 0x847E, 0x847F, 0x8480, 0x8481, 0x8482, 0x8483, 0x8484,
- 0x8485, 0x8486, 0x8487, 0x8488, 0x8489, 0x0000, 0x848A, 0x848B, 0x848C, 0x848D, 0x848E, 0x848F, 0x8490, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x8491, 0x8492, 0x8493, 0x0000, 0x8494, 0x8495, 0x8496, 0x8497, 0x8498, 0x8499, 0x849A, 0x0000, 0x0000, 0x0000,
- 0x849B, 0x849C, 0x849D, 0x849E, 0x0000, 0x0000, 0x849F, 0x84A0, 0x84A1, 0x84A2, 0x84A3, 0x84A4, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x84A5, 0x84A6, 0x84A7, 0x84A8, 0x84A9, 0x84AA, 0x84AB, 0x84AC, 0x84AD, 0x84AE, 0x84AF, 0x84B0, 0x84B1, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x84B2, 0x84B3, 0x84B4, 0x0000, 0x84B5, 0x84B6, 0x84B7, 0x84B8, 0x84B9, 0x84BA, 0x84BB, 0x84BC, 0x84BD, 0x0000,
- 0x84BE, 0x84BF, 0x84C0, 0x84C1, 0x84C2, 0x84C3, 0x84C4, 0x84C5, 0x84C6, 0x84C7, 0x84C8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x84C9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x84CA, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x84CB, 0x20FA, 0x3009, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x84CC,
- 0x0000, 0x0000, 0x0000, 0x20FC, 0x300C, 0x0000, 0x20FE, 0x300F, 0x0000, 0x0000, 0x0000, 0x0000, 0x2100, 0x0000, 0x2102, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2104, 0x2106, 0x2108, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x4000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x84CD,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x84CE, 0x84CF, 0x0000, 0x0000, 0x84D0, 0x84D1, 0x84D2, 0x84D3, 0x84D4, 0x84D5, 0x84D6, 0x84D7, 0x84D8, 0x84D9, 0x84DA, 0x84DB,
- 0x84DC, 0x84DD, 0x84DE, 0x84DF, 0x84E0, 0x84E1, 0x84E2, 0x84E3, 0x84E4, 0x84E5, 0x84E6, 0x84E7, 0x84E8, 0x84E9, 0x84EA, 0x0000,
- 0x84EB, 0x84EC, 0x84ED, 0x84EE, 0x84EF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x210A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x3012, 0x3015, 0x84F0, 0x210C, 0x0000, 0x3018, 0x301B, 0x84F1, 0x0000, 0x210E, 0x84F2, 0x84F3, 0x84F4, 0x84F5, 0x84F6, 0x84F7,
- 0x84F8, 0x84F9, 0x84FA, 0x84FB, 0x0000, 0x84FC, 0x2110, 0x0000, 0x0000, 0x84FD, 0x84FE, 0x84FF, 0x8500, 0x8501, 0x8502, 0x8503,
- 0x2112, 0x301E, 0x2114, 0x8504, 0x8505, 0x0000, 0x8506, 0x8507, 0x8508, 0x0000, 0x8509, 0x850A, 0x850B, 0x850C, 0x850D, 0x850E,
- 0x850F, 0x8510, 0x0000, 0x8511, 0x8512, 0x8513, 0x8514, 0x8515, 0x8516, 0x8517, 0x0000, 0x3021, 0x8518, 0x8519, 0x851A, 0x851B,
- 0x851C, 0x0000, 0x0000, 0x0000, 0x0000, 0x851D, 0x851E, 0x851F, 0x8520, 0x8521, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x3024, 0x3027, 0x4005, 0x302A, 0x302D, 0x3030, 0x3033, 0x3036, 0x3039, 0x303C, 0x303F, 0x3042, 0x3045, 0x3048, 0x304B, 0x2116,
- 0x8522, 0x2118, 0x304E, 0x211A, 0x8523, 0x211C, 0x3051, 0x400A, 0x211E, 0x8524, 0x2120, 0x3054, 0x8525, 0x8526, 0x8527, 0x8528,
- 0x8529, 0x2122, 0x3057, 0x2124, 0x852A, 0x2126, 0x305A, 0x400F, 0x2128, 0x852B, 0x212A, 0x305D, 0x852C, 0x852D, 0x852E, 0x852F,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x3060, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x212C, 0x212E, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2130, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2132, 0x2134, 0x2136,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x8530, 0x0000, 0x0000, 0x0000, 0x0000, 0x8531, 0x0000, 0x0000, 0x8532, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x2138, 0x0000, 0x213A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x213C, 0x3063, 0x0000, 0x213E,
- 0x3066, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x2140, 0x0000, 0x0000, 0x2142, 0x0000, 0x0000, 0x2144, 0x0000, 0x2146, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x2148, 0x0000, 0x214A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x214C, 0x214E, 0x2150,
- 0x2152, 0x2154, 0x0000, 0x0000, 0x2156, 0x2158, 0x0000, 0x0000, 0x215A, 0x215C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x215E, 0x2160, 0x0000, 0x0000, 0x2162, 0x2164, 0x0000, 0x0000, 0x2166, 0x2168, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x216A, 0x216C, 0x216E, 0x2170,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x2172, 0x2174, 0x2176, 0x2178, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x217A, 0x217C, 0x217E, 0x2180, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8533, 0x8534, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x3069, 0x306C, 0x306F, 0x3072, 0x3075, 0x3078, 0x307B, 0x307E, 0x2182, 0x2184, 0x2186, 0x2188, 0x218A, 0x218C, 0x218E, 0x2190,
- 0x3081, 0x3084, 0x3087, 0x308A, 0x308D, 0x3090, 0x3093, 0x3096, 0x3099, 0x2192, 0x309C, 0x309F, 0x2194, 0x2196, 0x2198, 0x219A,
- 0x219C, 0x30A2, 0x8535, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x8536, 0x8537, 0x8538, 0x8539, 0x853A, 0x853B, 0x853C, 0x853D, 0x853E, 0x219E, 0x21A0, 0x21A2, 0x21A4, 0x21A6, 0x21A8, 0x21AA,
- 0x21AC, 0x21AE, 0x21B0, 0x21B2, 0x30A5, 0x30A8, 0x30AB, 0x30AE, 0x30B1, 0x30B4, 0x30B7, 0x30BA, 0x30BD, 0x4014, 0x4019, 0x401E,
- 0x4023, 0x4028, 0x402D, 0x4032, 0x4037, 0x403C, 0x4041, 0x4046, 0x21B4, 0x21B6, 0x21B8, 0x21BA, 0x21BC, 0x21BE, 0x21C0, 0x21C2,
- 0x21C4, 0x30C0, 0x30C3, 0x30C6, 0x30C9, 0x30CC, 0x30CF, 0x30D2, 0x30D5, 0x30D8, 0x30DB, 0x30DE, 0x30E1, 0x30E4, 0x30E7, 0x30EA,
- 0x30ED, 0x30F0, 0x30F3, 0x30F6, 0x30F9, 0x30FC, 0x30FF, 0x3102, 0x3105, 0x3108, 0x310B, 0x310E, 0x3111, 0x3114, 0x3117, 0x311A,
- 0x311D, 0x3120, 0x3123, 0x3126, 0x3129, 0x312C, 0x853F, 0x8540, 0x8541, 0x8542, 0x8543, 0x8544, 0x8545, 0x8546, 0x8547, 0x8548,
- 0x8549, 0x854A, 0x854B, 0x854C, 0x854D, 0x854E, 0x854F, 0x8550, 0x8551, 0x8552, 0x8553, 0x8554, 0x8555, 0x8556, 0x8557, 0x8558,
- 0x8559, 0x855A, 0x855B, 0x855C, 0x855D, 0x855E, 0x855F, 0x8560, 0x8561, 0x8562, 0x8563, 0x8564, 0x8565, 0x8566, 0x8567, 0x8568,
- 0x8569, 0x856A, 0x856B, 0x856C, 0x856D, 0x856E, 0x856F, 0x8570, 0x8571, 0x8572, 0x8573, 0x21C6, 0x21C8, 0x21CA, 0x21CC, 0x21CE,
- 0x21D0, 0x21D2, 0x21D4, 0x21D6, 0x21D8, 0x8574, 0x8575, 0x8576, 0x8577, 0x8578, 0x8579, 0x857A, 0x857B, 0x857C, 0x21DA, 0x857D,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x857E, 0x857F, 0x8580, 0x8581, 0x8582, 0x8583, 0x8584, 0x8585, 0x8586, 0x21DC,
- 0x8587, 0x8588, 0x8589, 0x858A, 0x858B, 0x858C, 0x858D, 0x858E, 0x858F, 0x21DE, 0x8590, 0x8591, 0x8592, 0x8593, 0x8594, 0x8595,
- 0x8596, 0x8597, 0x8598, 0x21E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x404B, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x312F, 0x21E2, 0x3132, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x21E4, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x8599, 0x859A, 0x859B, 0x859C, 0x859D, 0x859E, 0x859F, 0x85A0, 0x85A1, 0x85A2, 0x85A3, 0x85A4, 0x85A5, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x85A6, 0x85A7, 0x85A8, 0x85A9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x85AA, 0x85AB, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x85AC,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x85AD,
- 0x85AE, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x85AF, 0x0000, 0x0000, 0x85B0, 0x0000, 0x85B1, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x85B2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x85B3, 0x0000, 0x0000, 0x0000, 0x0000, 0x85B4, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x85B5, 0x85B6, 0x0000, 0x0000, 0x0000, 0x85B7, 0x85B8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x85B9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x85BA, 0x85BB, 0x85BC, 0x85BD, 0x85BE, 0x85BF, 0x85C0, 0x85C1, 0x85C2, 0x85C3, 0x85C4, 0x85C5, 0x85C6, 0x85C7, 0x85C8, 0x85C9,
- 0x85CA, 0x85CB, 0x85CC, 0x85CD, 0x85CE, 0x85CF, 0x85D0, 0x85D1, 0x85D2, 0x85D3, 0x85D4, 0x85D5, 0x85D6, 0x85D7, 0x85D8, 0x85D9,
- 0x85DA, 0x85DB, 0x85DC, 0x85DD, 0x85DE, 0x85DF, 0x85E0, 0x85E1, 0x85E2, 0x85E3, 0x85E4, 0x85E5, 0x85E6, 0x85E7, 0x85E8, 0x85E9,
- 0x85EA, 0x85EB, 0x85EC, 0x85ED, 0x85EE, 0x85EF, 0x85F0, 0x85F1, 0x85F2, 0x85F3, 0x85F4, 0x85F5, 0x85F6, 0x85F7, 0x85F8, 0x85F9,
- 0x85FA, 0x85FB, 0x85FC, 0x85FD, 0x85FE, 0x85FF, 0x8600, 0x8601, 0x8602, 0x8603, 0x8604, 0x8605, 0x8606, 0x8607, 0x8608, 0x8609,
- 0x860A, 0x860B, 0x860C, 0x860D, 0x860E, 0x860F, 0x8610, 0x8611, 0x8612, 0x8613, 0x8614, 0x8615, 0x8616, 0x8617, 0x8618, 0x8619,
- 0x861A, 0x861B, 0x861C, 0x861D, 0x861E, 0x861F, 0x8620, 0x8621, 0x8622, 0x8623, 0x8624, 0x8625, 0x8626, 0x8627, 0x8628, 0x8629,
- 0x862A, 0x862B, 0x862C, 0x862D, 0x862E, 0x862F, 0x8630, 0x8631, 0x8632, 0x8633, 0x8634, 0x8635, 0x8636, 0x8637, 0x8638, 0x8639,
- 0x863A, 0x863B, 0x863C, 0x863D, 0x863E, 0x863F, 0x8640, 0x8641, 0x8642, 0x8643, 0x8644, 0x8645, 0x8646, 0x8647, 0x8648, 0x8649,
- 0x864A, 0x864B, 0x864C, 0x864D, 0x864E, 0x864F, 0x8650, 0x8651, 0x8652, 0x8653, 0x8654, 0x8655, 0x8656, 0x8657, 0x8658, 0x8659,
- 0x865A, 0x865B, 0x865C, 0x865D, 0x865E, 0x865F, 0x8660, 0x8661, 0x8662, 0x8663, 0x8664, 0x8665, 0x8666, 0x8667, 0x8668, 0x8669,
- 0x866A, 0x866B, 0x866C, 0x866D, 0x866E, 0x866F, 0x8670, 0x8671, 0x8672, 0x8673, 0x8674, 0x8675, 0x8676, 0x8677, 0x8678, 0x8679,
- 0x867A, 0x867B, 0x867C, 0x867D, 0x867E, 0x867F, 0x8680, 0x8681, 0x8682, 0x8683, 0x8684, 0x8685, 0x8686, 0x8687, 0x8688, 0x8689,
- 0x868A, 0x868B, 0x868C, 0x868D, 0x868E, 0x868F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x8690, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8691, 0x0000, 0x8692, 0x8693, 0x8694, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x21E6, 0x0000, 0x21E8, 0x0000,
- 0x21EA, 0x0000, 0x21EC, 0x0000, 0x21EE, 0x0000, 0x21F0, 0x0000, 0x21F2, 0x0000, 0x21F4, 0x0000, 0x21F6, 0x0000, 0x21F8, 0x0000,
- 0x21FA, 0x0000, 0x21FC, 0x0000, 0x0000, 0x21FE, 0x0000, 0x2200, 0x0000, 0x2202, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x2204, 0x2206, 0x0000, 0x2208, 0x220A, 0x0000, 0x220C, 0x220E, 0x0000, 0x2210, 0x2212, 0x0000, 0x2214, 0x2216, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x2218, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x221A, 0x221C, 0x0000, 0x221E, 0x2220,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2222, 0x0000, 0x2224, 0x0000,
- 0x2226, 0x0000, 0x2228, 0x0000, 0x222A, 0x0000, 0x222C, 0x0000, 0x222E, 0x0000, 0x2230, 0x0000, 0x2232, 0x0000, 0x2234, 0x0000,
- 0x2236, 0x0000, 0x2238, 0x0000, 0x0000, 0x223A, 0x0000, 0x223C, 0x0000, 0x223E, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x2240, 0x2242, 0x0000, 0x2244, 0x2246, 0x0000, 0x2248, 0x224A, 0x0000, 0x224C, 0x224E, 0x0000, 0x2250, 0x2252, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x2254, 0x0000, 0x0000, 0x2256, 0x2258, 0x225A, 0x225C, 0x0000, 0x0000, 0x0000, 0x225E, 0x2260,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x8695, 0x8696, 0x8697, 0x8698, 0x8699, 0x869A, 0x869B, 0x869C, 0x869D, 0x869E, 0x869F, 0x86A0, 0x86A1, 0x86A2, 0x86A3,
- 0x86A4, 0x86A5, 0x86A6, 0x86A7, 0x86A8, 0x86A9, 0x86AA, 0x86AB, 0x86AC, 0x86AD, 0x86AE, 0x86AF, 0x86B0, 0x86B1, 0x86B2, 0x86B3,
- 0x86B4, 0x86B5, 0x86B6, 0x86B7, 0x86B8, 0x86B9, 0x86BA, 0x86BB, 0x86BC, 0x86BD, 0x86BE, 0x86BF, 0x86C0, 0x86C1, 0x86C2, 0x86C3,
- 0x86C4, 0x86C5, 0x86C6, 0x86C7, 0x86C8, 0x86C9, 0x86CA, 0x86CB, 0x86CC, 0x86CD, 0x86CE, 0x86CF, 0x86D0, 0x86D1, 0x86D2, 0x86D3,
- 0x86D4, 0x86D5, 0x86D6, 0x86D7, 0x86D8, 0x86D9, 0x86DA, 0x86DB, 0x86DC, 0x86DD, 0x86DE, 0x86DF, 0x86E0, 0x86E1, 0x86E2, 0x86E3,
- 0x86E4, 0x86E5, 0x86E6, 0x86E7, 0x86E8, 0x86E9, 0x86EA, 0x86EB, 0x86EC, 0x86ED, 0x86EE, 0x86EF, 0x86F0, 0x86F1, 0x86F2, 0x0000,
- 0x0000, 0x0000, 0x86F3, 0x86F4, 0x86F5, 0x86F6, 0x86F7, 0x86F8, 0x86F9, 0x86FA, 0x86FB, 0x86FC, 0x86FD, 0x86FE, 0x86FF, 0x8700,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x3135, 0x3138, 0x313B, 0x313E, 0x3141, 0x3144, 0x3147, 0x314A, 0x314D, 0x3150, 0x3153, 0x3156, 0x3159, 0x315C, 0x4050, 0x4055,
- 0x405A, 0x405F, 0x4064, 0x4069, 0x406E, 0x4073, 0x4078, 0x407D, 0x4082, 0x4087, 0x408C, 0x4091, 0x4096, 0x409B, 0x40A3, 0x0000,
- 0x315F, 0x3162, 0x3165, 0x3168, 0x316B, 0x316E, 0x3171, 0x3174, 0x3177, 0x317A, 0x317D, 0x3180, 0x3183, 0x3186, 0x3189, 0x318C,
- 0x318F, 0x3192, 0x3195, 0x3198, 0x319B, 0x319E, 0x31A1, 0x31A4, 0x31A7, 0x31AA, 0x31AD, 0x31B0, 0x31B3, 0x31B6, 0x31B9, 0x31BC,
- 0x31BF, 0x31C2, 0x31C5, 0x31C8, 0x8701, 0x8702, 0x8703, 0x8704, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x31CB, 0x2262, 0x2264, 0x2266, 0x2268, 0x226A, 0x226C, 0x226E, 0x2270, 0x2272, 0x2274, 0x2276, 0x2278, 0x227A, 0x227C, 0x227E,
- 0x8705, 0x8706, 0x8707, 0x8708, 0x8709, 0x870A, 0x870B, 0x870C, 0x870D, 0x870E, 0x870F, 0x8710, 0x8711, 0x8712, 0x2280, 0x2282,
- 0x2284, 0x2286, 0x2288, 0x228A, 0x228C, 0x228E, 0x2290, 0x2292, 0x2294, 0x2296, 0x2298, 0x229A, 0x40AA, 0x40B0, 0x229C, 0x0000,
- 0x8713, 0x8714, 0x8715, 0x8716, 0x8717, 0x8718, 0x8719, 0x871A, 0x871B, 0x871C, 0x871D, 0x871E, 0x871F, 0x8720, 0x8721, 0x8722,
- 0x8723, 0x8724, 0x8725, 0x8726, 0x8727, 0x8728, 0x8729, 0x872A, 0x872B, 0x872C, 0x872D, 0x872E, 0x872F, 0x8730, 0x8731, 0x8732,
- 0x8733, 0x8734, 0x8735, 0x8736, 0x8737, 0x8738, 0x8739, 0x873A, 0x873B, 0x873C, 0x873D, 0x873E, 0x873F, 0x8740, 0x8741, 0x8742,
- 0x8743, 0x229E, 0x22A0, 0x22A2, 0x22A4, 0x22A6, 0x22A8, 0x22AA, 0x22AC, 0x22AE, 0x22B0, 0x22B2, 0x22B4, 0x22B6, 0x22B8, 0x22BA,
- 0x22BC, 0x22BE, 0x22C0, 0x22C2, 0x22C4, 0x22C6, 0x22C8, 0x22CA, 0x22CC, 0x31CE, 0x31D1, 0x31D4, 0x22CE, 0x31D7, 0x22D0, 0x31DA,
- 0x8744, 0x8745, 0x8746, 0x8747, 0x8748, 0x8749, 0x874A, 0x874B, 0x874C, 0x874D, 0x874E, 0x874F, 0x8750, 0x8751, 0x8752, 0x8753,
- 0x8754, 0x8755, 0x8756, 0x8757, 0x8758, 0x8759, 0x875A, 0x875B, 0x875C, 0x875D, 0x875E, 0x875F, 0x8760, 0x8761, 0x8762, 0x8763,
- 0x8764, 0x8765, 0x8766, 0x8767, 0x8768, 0x8769, 0x876A, 0x876B, 0x876C, 0x876D, 0x876E, 0x876F, 0x8770, 0x8771, 0x8772, 0x0000,
- 0x40B5, 0x40BA, 0x40BF, 0x31DD, 0x40C4, 0x31E0, 0x31E3, 0x40C9, 0x40CF, 0x31E6, 0x31E9, 0x31EC, 0x40D4, 0x40D9, 0x31EF, 0x31F2,
- 0x22D2, 0x31F5, 0x40DE, 0x40E3, 0x22D4, 0x40E8, 0x40EE, 0x40F5, 0x31F8, 0x40FB, 0x4101, 0x4107, 0x31FB, 0x31FE, 0x3201, 0x410C,
- 0x4111, 0x4117, 0x3204, 0x3207, 0x320A, 0x22D6, 0x22D8, 0x22DA, 0x22DC, 0x320D, 0x3210, 0x411C, 0x3213, 0x4122, 0x4127, 0x3216,
- 0x22DE, 0x22E0, 0x412D, 0x4133, 0x4138, 0x3219, 0x413E, 0x22E2, 0x321C, 0x321F, 0x3222, 0x3225, 0x3228, 0x4144, 0x322B, 0x22E4,
- 0x322E, 0x3231, 0x3234, 0x4149, 0x3237, 0x323A, 0x323D, 0x414E, 0x4154, 0x22E6, 0x4159, 0x22E8, 0x415F, 0x4164, 0x3240, 0x3243,
- 0x3246, 0x4169, 0x22EA, 0x3249, 0x416E, 0x22EC, 0x4173, 0x324C, 0x22EE, 0x22F0, 0x22F2, 0x22F4, 0x22F6, 0x22F8, 0x22FA, 0x22FC,
- 0x22FE, 0x2300, 0x324F, 0x3252, 0x3255, 0x3258, 0x325B, 0x325E, 0x3261, 0x3264, 0x3267, 0x326A, 0x326D, 0x3270, 0x3273, 0x3276,
- 0x3279, 0x327C, 0x2302, 0x2304, 0x327F, 0x2306, 0x2308, 0x230A, 0x3282, 0x3285, 0x230C, 0x230E, 0x2310, 0x2312, 0x2314, 0x4179,
- 0x2316, 0x2318, 0x231A, 0x231C, 0x231E, 0x2320, 0x2322, 0x2324, 0x3288, 0x417E, 0x2326, 0x2328, 0x232A, 0x232C, 0x232E, 0x2330,
- 0x2332, 0x328B, 0x328E, 0x3291, 0x3294, 0x2334, 0x2336, 0x2338, 0x233A, 0x233C, 0x233E, 0x2340, 0x2342, 0x2344, 0x2346, 0x3297,
- 0x329A, 0x2348, 0x329D, 0x32A0, 0x32A3, 0x234A, 0x32A6, 0x32A9, 0x4183, 0x234C, 0x32AC, 0x32AF, 0x32B2, 0x32B5, 0x4188, 0x418E,
- 0x234E, 0x2350, 0x2352, 0x2354, 0x2356, 0x2358, 0x235A, 0x235C, 0x235E, 0x2360, 0x2362, 0x2364, 0x2366, 0x2368, 0x236A, 0x236C,
- 0x236E, 0x2370, 0x4195, 0x2372, 0x2374, 0x2376, 0x419A, 0x32B8, 0x2378, 0x237A, 0x237C, 0x237E, 0x2380, 0x2382, 0x2384, 0x2386,
- 0x2388, 0x238A, 0x32BB, 0x238C, 0x238E, 0x32BE, 0x32C1, 0x2390, 0x419F, 0x32C4, 0x2392, 0x2394, 0x2396, 0x2398, 0x32C7, 0x32CA,
- 0x239A, 0x239C, 0x239E, 0x23A0, 0x23A2, 0x23A4, 0x23A6, 0x23A8, 0x23AA, 0x32CD, 0x32D0, 0x32D3, 0x32D6, 0x32D9, 0x32DC, 0x32DF,
- 0x32E2, 0x32E5, 0x32E8, 0x32EB, 0x32EE, 0x32F1, 0x32F4, 0x32F7, 0x32FA, 0x32FD, 0x3300, 0x3303, 0x3306, 0x3309, 0x330C, 0x330F,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8773,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8774, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8775, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8776, 0x0000,
- 0x0000, 0x0000, 0x8777, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8778, 0x0000, 0x0000, 0x0000, 0x0000, 0x8779, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x877A, 0x877B, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x877C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x877D, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x877E, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x877F, 0x8780, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x8781, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x8782, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8783, 0x0000, 0x0000, 0x8784, 0x0000, 0x8785, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x8786, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8787, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8788, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x8789, 0x878A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x878B, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x878C, 0x0000, 0x0000, 0x0000, 0x0000, 0x878D, 0x0000, 0x878E, 0x878F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x8790, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8791, 0x0000, 0x8792,
- 0x0000, 0x0000, 0x0000, 0x8793, 0x8794, 0x8795, 0x0000, 0x8796, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8797, 0x0000,
- 0x0000, 0x0000, 0x8798, 0x0000, 0x0000, 0x8799, 0x0000, 0x0000, 0x0000, 0x879A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x879B, 0x0000, 0x0000, 0x0000, 0x879C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x879D, 0x0000, 0x0000, 0x879E, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x879F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x87A0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x87A1, 0x0000, 0x87A2, 0x0000, 0x87A3, 0x0000, 0x0000, 0x0000, 0x0000, 0x87A4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x87A5, 0x0000, 0x0000, 0x0000, 0x87A6, 0x87A7, 0x0000, 0x0000, 0x87A8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x87A9,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x87AA, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x87AB, 0x0000, 0x0000, 0x0000, 0x0000, 0x87AC, 0x0000, 0x0000, 0x87AD, 0x87AE, 0x87AF, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x87B0, 0x0000, 0x0000, 0x0000, 0x0000, 0x87B1, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x87B2, 0x0000, 0x0000, 0x0000, 0x0000, 0x87B3, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x87B4, 0x0000, 0x87B5, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x87B6, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x87B7, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x87B8, 0x87B9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x87BA, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x87BB, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x87BC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x87BD, 0x0000, 0x0000, 0x0000, 0x0000, 0x87BE, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x87BF, 0x0000, 0x0000, 0x87C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x87C1, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x87C2, 0x0000, 0x87C3, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x87C4, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x87C5, 0x87C6, 0x0000, 0x87C7, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x87C8, 0x0000, 0x0000, 0x0000, 0x87C9, 0x0000, 0x87CA, 0x87CB, 0x0000, 0x87CC, 0x87CD, 0x0000, 0x0000,
- 0x0000, 0x87CE, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x87CF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x87D0, 0x0000, 0x87D1, 0x0000, 0x87D2, 0x0000, 0x0000, 0x0000, 0x87D3, 0x87D4, 0x0000,
- 0x0000, 0x0000, 0x87D5, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x87D6, 0x0000, 0x87D7, 0x0000, 0x87D8, 0x0000, 0x0000, 0x87D9, 0x0000, 0x0000, 0x87DA, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x87DB, 0x0000, 0x87DC,
- 0x0000, 0x87DD, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x87DE, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x87DF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x87E0, 0x0000, 0x87E1, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x87E2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x87E3, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x87E4, 0x0000, 0x87E5, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x87E6, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x87E7, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x87E8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x87E9, 0x0000, 0x0000, 0x87EA, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x87EB, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x87EC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x87ED, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x87EE, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x87EF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x87F0,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x87F1, 0x87F2,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x87F3, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x87F4, 0x0000, 0x87F5, 0x0000, 0x87F6, 0x0000,
- 0x0000, 0x0000, 0x87F7, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x87F8, 0x87F9, 0x0000, 0x0000, 0x87FA, 0x0000, 0x0000, 0x0000, 0x87FB, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x87FC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x87FD, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x87FE, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x87FF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8800, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x8801, 0x0000, 0x8802, 0x8803, 0x0000, 0x0000, 0x0000, 0x0000, 0x8804, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8805, 0x0000, 0x0000, 0x0000, 0x0000, 0x8806, 0x8807,
- 0x8808, 0x0000, 0x0000, 0x0000, 0x0000, 0x8809, 0x0000, 0x0000, 0x880A, 0x0000, 0x0000, 0x0000, 0x0000, 0x880B, 0x0000, 0x0000,
- 0x0000, 0x880C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x880D, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x880E, 0x0000, 0x0000,
- 0x880F, 0x0000, 0x0000, 0x0000, 0x0000, 0x8810, 0x8811, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8812,
- 0x0000, 0x0000, 0x8813, 0x0000, 0x8814, 0x0000, 0x0000, 0x0000, 0x8815, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x8816, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8817, 0x0000, 0x0000, 0x0000, 0x0000, 0x8818, 0x0000, 0x0000, 0x0000,
- 0x8819, 0x0000, 0x0000, 0x0000, 0x0000, 0x881A, 0x0000, 0x0000, 0x0000, 0x881B, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x881C, 0x0000, 0x881D, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x881E, 0x881F, 0x8820, 0x0000, 0x8821, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x8822, 0x8823, 0x8824, 0x0000, 0x0000, 0x8825, 0x0000, 0x0000, 0x8826, 0x8827, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x8828, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8829, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x882A, 0x0000, 0x0000, 0x0000, 0x882B, 0x0000, 0x882C, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x882D, 0x882E, 0x0000, 0x0000, 0x882F, 0x0000, 0x8830, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x8831, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8832, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8833, 0x0000, 0x0000, 0x0000, 0x0000, 0x8834, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8835, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8836,
- 0x0000, 0x8837, 0x0000, 0x0000, 0x8838, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8839, 0x883A, 0x0000, 0x0000, 0x0000, 0x883B,
- 0x0000, 0x0000, 0x883C, 0x0000, 0x0000, 0x0000, 0x0000, 0x883D, 0x0000, 0x0000, 0x883E, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x883F, 0x0000, 0x8840, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8841, 0x0000, 0x0000, 0x0000, 0x8842, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8843, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8844, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8845, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x8846, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8847, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8848, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x8849, 0x0000, 0x0000, 0x0000, 0x0000, 0x884A, 0x884B, 0x884C, 0x0000, 0x0000, 0x0000, 0x884D, 0x884E,
- 0x0000, 0x0000, 0x884F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8850, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8851,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8852, 0x0000, 0x8853, 0x8854, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x8855, 0x0000, 0x8856, 0x0000, 0x0000, 0x8857, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8858, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x8859, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x885A, 0x0000, 0x885B, 0x885C, 0x0000, 0x0000, 0x0000, 0x885D, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x885E, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x885F, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8860, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8861, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8862, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x8863, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8864, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8865, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8866, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8867,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8868, 0x8869, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x886A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x886B, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x886C, 0x0000, 0x0000, 0x0000, 0x886D,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x886E, 0x0000, 0x0000, 0x886F, 0x8870, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8871, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x8872, 0x0000, 0x0000, 0x8873, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8874, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x8875, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8876, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8877, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8878, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8879, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x887A,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x887B, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x887C, 0x0000, 0x0000, 0x0000, 0x887D, 0x887E, 0x0000, 0x887F, 0x0000, 0x8880, 0x8881, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8882, 0x8883, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8884, 0x8885, 0x0000, 0x0000, 0x8886, 0x0000, 0x8887, 0x8888, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8889, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x888A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x888B, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x888C, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x888D, 0x0000, 0x888E, 0x0000, 0x0000, 0x888F, 0x8890, 0x0000, 0x0000, 0x0000, 0x8891, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x8892, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x8893, 0x0000, 0x8894, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8895, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8896, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8897, 0x0000, 0x8898, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x8899, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x889A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x889B, 0x0000, 0x0000, 0x889C, 0x0000, 0x0000, 0x889D, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x889E, 0x0000, 0x0000, 0x889F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x88A0, 0x0000, 0x88A1, 0x0000, 0x0000, 0x0000, 0x0000, 0x88A2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88A3, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x88A4, 0x0000, 0x0000, 0x0000, 0x88A5, 0x0000, 0x88A6, 0x0000, 0x88A7, 0x88A8, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88A9, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x88AA, 0x0000, 0x88AB, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x88AC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88AD, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88AE, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x88AF, 0x0000, 0x0000, 0x88B0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x88B1, 0x0000, 0x0000, 0x88B2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88B3, 0x88B4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88B5,
- 0x0000, 0x0000, 0x0000, 0x88B6, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88B7, 0x88B8, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88B9, 0x0000, 0x0000, 0x0000, 0x0000, 0x88BA, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88BB, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x88BC, 0x88BD, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88BE, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88BF, 0x0000, 0x0000, 0x88C0, 0x0000, 0x88C1,
- 0x88C2, 0x88C3, 0x88C4, 0x88C5, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88C6, 0x0000, 0x0000, 0x88C7, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x88C8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x88C9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x88CA, 0x0000, 0x88CB, 0x0000, 0x88CC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88CD, 0x0000, 0x0000, 0x0000, 0x88CE, 0x0000, 0x88CF, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88D0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88D1, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x88D2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88D3, 0x0000,
- 0x88D4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88D5, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88D6, 0x0000, 0x0000, 0x0000, 0x88D7, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88D8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88D9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88DA, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88DB, 0x88DC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x88DD, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x88DE, 0x88DF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88E0, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88E1, 0x88E2, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88E3, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x88E4, 0x0000, 0x0000, 0x88E5, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88E6, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88E7, 0x0000, 0x88E8, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88E9, 0x0000, 0x88EA, 0x0000, 0x0000, 0x0000, 0x0000, 0x88EB,
- 0x0000, 0x0000, 0x0000, 0x88EC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88ED, 0x88EE, 0x0000, 0x0000, 0x88EF, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x88F0, 0x0000, 0x0000, 0x88F1, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x88F2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88F3, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x88F4, 0x88F5, 0x88F6, 0x0000, 0x0000, 0x0000, 0x88F7, 0x0000, 0x0000, 0x0000, 0x88F8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x88F9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88FA, 0x0000, 0x0000, 0x88FB, 0x0000,
- 0x0000, 0x0000, 0x88FC, 0x0000, 0x0000, 0x0000, 0x88FD, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88FE, 0x0000, 0x88FF, 0x0000, 0x0000, 0x8900, 0x8901, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8902,
- 0x0000, 0x0000, 0x0000, 0x8903, 0x0000, 0x0000, 0x0000, 0x0000, 0x8904, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x8905, 0x0000, 0x0000, 0x0000, 0x8906, 0x8907, 0x8908, 0x0000, 0x8909, 0x0000, 0x890A, 0x0000, 0x890B, 0x0000,
- 0x890C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x890D, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x890E, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x890F, 0x0000, 0x8910, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x8911, 0x0000, 0x8912, 0x0000, 0x0000, 0x0000, 0x8913, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8914, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8915, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8916, 0x0000, 0x0000, 0x8917, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x8918, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x8919, 0x891A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x891B, 0x0000, 0x891C, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x891D, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x891E, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x891F, 0x8920, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8921, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8922, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8923, 0x8924, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8925, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x8926, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8927, 0x0000, 0x0000, 0x8928,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8929,
- 0x0000, 0x0000, 0x0000, 0x892A, 0x0000, 0x0000, 0x892B, 0x0000, 0x0000, 0x0000, 0x0000, 0x892C, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x892D, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x892E, 0x0000, 0x0000, 0x892F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8930,
- 0x0000, 0x0000, 0x0000, 0x8931, 0x0000, 0x8932, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8933, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x8934, 0x8935, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8936, 0x0000, 0x0000, 0x8937, 0x8938,
- 0x0000, 0x8939, 0x0000, 0x0000, 0x893A, 0x0000, 0x0000, 0x893B, 0x0000, 0x0000, 0x893C, 0x893D, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x893E, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x893F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x8940, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8941, 0x0000, 0x0000, 0x8942,
- 0x8943, 0x8944, 0x8945, 0x0000, 0x8946, 0x0000, 0x0000, 0x8947, 0x0000, 0x0000, 0x8948, 0x8949, 0x894A, 0x0000, 0x894B, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x894C, 0x0000, 0x894D, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x894E,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x894F, 0x0000, 0x8950, 0x0000, 0x0000, 0x8951, 0x0000, 0x8952, 0x8953, 0x8954, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x8955, 0x8956, 0x8957, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8958, 0x0000, 0x8959, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x895A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x895B, 0x895C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x895D, 0x0000, 0x0000, 0x895E, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x895F, 0x8960, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8961, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8962, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8963, 0x0000, 0x0000, 0x0000, 0x0000, 0x8964, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8965, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x8966, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8967, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8968, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8969, 0x896A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x896B, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x896C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x896D, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x896E, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x896F, 0x0000, 0x8970, 0x8971, 0x0000, 0x8972, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8973, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x8974, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8975, 0x0000, 0x0000, 0x0000, 0x8976, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8977, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x8978, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8979, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x897A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x897B, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x897C,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x897D, 0x0000, 0x0000, 0x0000, 0x897E, 0x0000, 0x0000, 0x0000, 0x0000, 0x897F, 0x0000, 0x8980,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x8981, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8982, 0x8983, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8984,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8985, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x8986, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8987,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8988, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x8989, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x898A, 0x0000, 0x0000, 0x0000, 0x0000, 0x898B, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x898C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x898D, 0x0000, 0x0000, 0x0000, 0x898E, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x898F,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8990, 0x0000, 0x8991, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x8992, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x8993, 0x0000, 0x0000, 0x8994, 0x8995, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x8996, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x8997, 0x8998, 0x0000, 0x0000, 0x8999, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x899A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x899B, 0x0000, 0x0000, 0x0000, 0x0000, 0x899C, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x899D, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x899E, 0x899F, 0x89A0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89A1, 0x0000, 0x0000, 0x89A2, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89A3,
- 0x0000, 0x0000, 0x89A4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89A5, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x89A6, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89A7, 0x0000, 0x89A8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x89A9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89AA, 0x0000, 0x0000, 0x89AB,
- 0x0000, 0x0000, 0x89AC, 0x89AD, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89AE, 0x89AF,
- 0x0000, 0x0000, 0x0000, 0x89B0, 0x0000, 0x0000, 0x0000, 0x0000, 0x89B1, 0x0000, 0x0000, 0x89B2, 0x0000, 0x0000, 0x89B3, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x89B4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x89B5, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89B6, 0x89B7, 0x0000, 0x89B8, 0x89B9, 0x89BA,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89BB, 0x0000, 0x89BC, 0x89BD, 0x0000, 0x89BE, 0x89BF, 0x89C0, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x89C1, 0x0000, 0x0000, 0x0000, 0x0000, 0x89C2, 0x0000, 0x89C3, 0x89C4, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x89C5, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89C6, 0x0000, 0x0000, 0x0000, 0x0000, 0x89C7,
- 0x0000, 0x0000, 0x89C8, 0x0000, 0x0000, 0x0000, 0x89C9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89CA, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x89CB, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89CC,
- 0x0000, 0x89CD, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x89CE, 0x0000, 0x0000, 0x0000, 0x0000, 0x89CF, 0x89D0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89D1,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89D2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89D3, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x89D4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89D5, 0x0000, 0x0000, 0x89D6, 0x89D7,
- 0x0000, 0x0000, 0x89D8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89D9, 0x0000, 0x89DA, 0x0000, 0x0000, 0x0000,
- 0x89DB, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89DC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89DD,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89DE, 0x0000, 0x0000, 0x0000, 0x89DF, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x89E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89E1, 0x89E2, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x89E3, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89E4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89E5, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89E6, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x89E7, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x89E8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89E9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89EA, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89EB, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89EC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89ED, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x89EE, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89EF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89F0, 0x0000, 0x0000, 0x89F1, 0x0000, 0x89F2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89F3, 0x89F4, 0x0000, 0x0000, 0x0000, 0x89F5, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89F6, 0x0000, 0x89F7, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x89F8, 0x0000, 0x0000, 0x0000, 0x89F9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89FA, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89FB, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89FC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89FD, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89FE, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89FF, 0x8A00,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A01, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A02, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A03, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A04, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x8A05, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A06, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x8A07, 0x8A08, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A09, 0x0000, 0x8A0A, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A0B, 0x0000, 0x0000, 0x8A0C,
- 0x0000, 0x0000, 0x8A0D, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A0E, 0x0000, 0x0000, 0x8A0F, 0x0000, 0x0000, 0x8A10, 0x8A11,
- 0x0000, 0x8A12, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A13, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A14, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x8A15, 0x8A16, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A17, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x8A18, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A19, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A1A,
- 0x0000, 0x8A1B, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x8A1C, 0x0000, 0x0000, 0x8A1D, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A1E, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x8A1F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A20,
- 0x8A21, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A22,
- 0x8A23, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A24, 0x8A25, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x8A26, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A27, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x8A28, 0x0000, 0x0000, 0x0000, 0x8A29, 0x0000, 0x8A2A, 0x0000, 0x0000, 0x8A2B, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A2C, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x8A2D, 0x0000, 0x8A2E, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A2F, 0x0000, 0x0000, 0x8A30, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A31,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x8A32, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A33, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x8A34, 0x8A35, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A36, 0x0000, 0x8A37, 0x0000, 0x8A38, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A39, 0x8A3A, 0x0000, 0x0000, 0x8A3B, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A3C,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A3D, 0x0000, 0x0000, 0x8A3E, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A3F, 0x0000, 0x8A40,
- 0x8A41, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A42, 0x8A43, 0x8A44, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x8A45, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A46, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x8A47, 0x8A48, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x8A49, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A4A, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A4B, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x8A4C, 0x8A4D, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A4E, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A4F, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A50, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A51,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x8A52, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x8A53, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A54, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x8A55, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A56, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x8A57, 0x0000, 0x0000, 0x8A58, 0x0000, 0x0000, 0x0000, 0x8A59, 0x0000, 0x0000, 0x8A5A, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x8A5B, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A5C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x8A5D, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A5E, 0x0000,
- 0x0000, 0x8A5F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A60, 0x8A61, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x8A62, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A63, 0x0000, 0x0000, 0x8A64, 0x0000, 0x0000, 0x8A65,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A66, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A67, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x8A68, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A69, 0x0000, 0x8A6A, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A6B, 0x0000, 0x0000,
- 0x8A6C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A6D, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A6E, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x8A6F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A70, 0x0000, 0x0000, 0x0000, 0x8A71, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A72, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A73, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A74, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A75, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A76, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x8A77, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A78, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x8A79, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A7A, 0x0000, 0x0000, 0x0000, 0x8A7B, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A7C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A7D, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A7E, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x8A7F, 0x0000, 0x0000, 0x8A80, 0x8A81, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A82, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A83, 0x0000, 0x8A84, 0x8A85, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x8A86, 0x0000, 0x8A87, 0x0000, 0x0000, 0x8A88, 0x0000, 0x8A89, 0x8A8A, 0x0000, 0x8A8B, 0x8A8C, 0x8A8D, 0x0000, 0x0000, 0x0000,
- 0x8A8E, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A8F, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A90, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A91,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A92, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x8A93, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x8A94, 0x8A95, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A96, 0x8A97, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A98,
- 0x0000, 0x0000, 0x8A99, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A9A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x8A9B, 0x0000, 0x8A9C, 0x0000, 0x0000, 0x8A9D, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A9E, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x8A9F, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AA0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AA1, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AA2, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AA3,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x8AA4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AA5, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AA6, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AA7, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x8AA8, 0x8AA9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AAA, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x8AAB, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AAC, 0x8AAD, 0x0000, 0x0000, 0x0000,
- 0x8AAE, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AAF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AB0, 0x0000, 0x0000, 0x8AB1, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AB2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x8AB3, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AB4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x8AB5, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AB6, 0x0000, 0x8AB7, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x8AB8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AB9, 0x0000,
- 0x0000, 0x8ABA, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8ABB, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x8ABC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8ABD, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x8ABE, 0x0000, 0x0000, 0x0000, 0x8ABF, 0x8AC0, 0x0000, 0x8AC1, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AC2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AC3,
- 0x0000, 0x0000, 0x8AC4, 0x0000, 0x8AC5, 0x0000, 0x0000, 0x8AC6, 0x0000, 0x8AC7, 0x0000, 0x0000, 0x8AC8, 0x8AC9, 0x8ACA, 0x0000,
- 0x8ACB, 0x8ACC, 0x8ACD, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8ACE, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8ACF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x8AD0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AD1, 0x0000, 0x8AD2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x8AD3, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AD4, 0x0000, 0x8AD5, 0x0000,
- 0x0000, 0x8AD6, 0x0000, 0x8AD7, 0x8AD8, 0x0000, 0x0000, 0x8AD9, 0x0000, 0x0000, 0x8ADA, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8ADB, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8ADC, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8ADD,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8ADE, 0x0000, 0x8ADF, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AE0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AE1, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AE2, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AE3, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AE4, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x8AE5, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AE6, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AE7,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AE8, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x8AE9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AEA, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x8AEB, 0x0000, 0x0000, 0x0000, 0x8AEC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AED,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AEE, 0x0000, 0x0000, 0x0000, 0x8AEF, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AF0, 0x0000, 0x8AF1, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x8AF2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AF3, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x8AF4, 0x0000, 0x0000, 0x0000, 0x8AF5, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AF6,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AF7, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x8AF8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AF9, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AFA, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AFB, 0x0000, 0x0000, 0x0000, 0x8AFC, 0x8AFD, 0x8AFE, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x8AFF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B00,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B01, 0x8B02, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B03, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B04, 0x0000, 0x0000, 0x0000, 0x8B05, 0x0000, 0x0000, 0x0000, 0x8B06, 0x0000,
- 0x0000, 0x8B07, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B08,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B09, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B0A, 0x0000, 0x0000, 0x8B0B, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B0C, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B0D, 0x0000,
- 0x0000, 0x8B0E, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B0F, 0x8B10, 0x8B11, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x8B12, 0x8B13, 0x8B14, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B15, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B16, 0x8B17, 0x0000, 0x0000, 0x0000, 0x8B18, 0x8B19,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B1A, 0x8B1B, 0x0000, 0x0000, 0x0000, 0x8B1C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x8B1D, 0x8B1E, 0x0000, 0x8B1F, 0x0000, 0x0000, 0x8B20, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B21, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B22, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B23, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B24, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B25, 0x0000, 0x0000, 0x0000, 0x8B26,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x8B27, 0x0000, 0x0000, 0x0000, 0x8B28, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B29, 0x0000, 0x8B2A, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x8B2B, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x8B2C, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B2D, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x8B2E, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x8B2F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B30, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B31, 0x0000,
- 0x0000, 0x8B32, 0x0000, 0x8B33, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B34, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B35, 0x0000, 0x8B36, 0x0000, 0x0000, 0x0000, 0x8B37, 0x8B38, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x8B39, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B3A, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B3B, 0x0000, 0x8B3C, 0x8B3D, 0x0000, 0x0000, 0x8B3E,
- 0x8B3F, 0x0000, 0x0000, 0x0000, 0x8B40, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B41, 0x0000, 0x0000, 0x8B42, 0x0000, 0x8B43, 0x0000,
- 0x0000, 0x0000, 0x8B44, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B45, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B46, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B47, 0x8B48, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B49, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x8B4A, 0x8B4B, 0x0000, 0x8B4C, 0x0000, 0x8B4D, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B4E, 0x0000,
- 0x8B4F, 0x0000, 0x8B50, 0x0000, 0x8B51, 0x8B52, 0x8B53, 0x8B54, 0x8B55, 0x8B56, 0x0000, 0x8B57, 0x0000, 0x8B58, 0x0000, 0x0000,
- 0x8B59, 0x0000, 0x0000, 0x8B5A, 0x8B5B, 0x8B5C, 0x0000, 0x8B5D, 0x0000, 0x8B5E, 0x8B5F, 0x8B60, 0x8B61, 0x8B62, 0x0000, 0x0000,
- 0x0000, 0x8B63, 0x0000, 0x0000, 0x0000, 0x8B64, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B65, 0x0000,
- 0x8B66, 0x8B67, 0x8B68, 0x8B69, 0x0000, 0x8B6A, 0x0000, 0x0000, 0x0000, 0x8B6B, 0x8B6C, 0x0000, 0x8B6D, 0x0000, 0x0000, 0x8B6E,
- 0x8B6F, 0x0000, 0x8B70, 0x8B71, 0x8B72, 0x0000, 0x8B73, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B74, 0x0000,
- 0x8B75, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B76, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B77, 0x0000, 0x8B78, 0x8B79, 0x0000,
- 0x0000, 0x8B7A, 0x8B7B, 0x0000, 0x0000, 0x0000, 0x8B7C, 0x0000, 0x8B7D, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x8B7E, 0x8B7F, 0x8B80, 0x8B81, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B82, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x8B83, 0x0000, 0x8B84, 0x0000, 0x0000, 0x8B85, 0x0000, 0x8B86, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B87,
- 0x0000, 0x0000, 0x0000, 0x8B88, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B89, 0x0000, 0x8B8A, 0x0000,
- 0x8B8B, 0x0000, 0x8B8C, 0x8B8D, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B8E, 0x8B8F, 0x0000, 0x0000,
- 0x8B90, 0x8B91, 0x8B92, 0x0000, 0x8B93, 0x0000, 0x0000, 0x0000, 0x8B94, 0x8B95, 0x8B96, 0x8B97, 0x0000, 0x8B98, 0x8B99, 0x8B9A,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x8B9B, 0x0000, 0x0000, 0x8B9C, 0x0000, 0x0000, 0x8B9D, 0x8B9E, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x8B9F, 0x0000, 0x0000, 0x0000, 0x0000, 0x8BA0, 0x8BA1, 0x8BA2, 0x8BA3, 0x0000, 0x0000, 0x8BA4, 0x8BA5, 0x0000,
- 0x8BA6, 0x8BA7, 0x0000, 0x8BA8, 0x0000, 0x0000, 0x8BA9, 0x0000, 0x8BAA, 0x8BAB, 0x0000, 0x0000, 0x8BAC, 0x0000, 0x0000, 0x8BAD,
- 0x0000, 0x8BAE, 0x8BAF, 0x0000, 0x8BB0, 0x0000, 0x8BB1, 0x0000, 0x0000, 0x8BB2, 0x0000, 0x8BB3, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8BB4, 0x8BB5, 0x8BB6, 0x8BB7, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x8BB8, 0x8BB9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8BBA, 0x0000, 0x0000, 0x0000, 0x8BBB, 0x0000, 0x8BBC, 0x8BBD, 0x8BBE,
- 0x0000, 0x0000, 0x0000, 0x8BBF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8BC0, 0x0000, 0x0000, 0x8BC1, 0x0000,
- 0x0000, 0x8BC2, 0x8BC3, 0x0000, 0x0000, 0x8BC4, 0x8BC5, 0x8BC6, 0x0000, 0x8BC7, 0x0000, 0x0000, 0x0000, 0x8BC8, 0x8BC9, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x8BCA, 0x0000, 0x8BCB, 0x8BCC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x8BCD, 0x0000, 0x8BCE, 0x8BCF, 0x0000, 0x0000, 0x0000, 0x0000, 0x8BD0, 0x0000, 0x0000, 0x0000, 0x8BD1, 0x0000,
- 0x0000, 0x8BD2, 0x8BD3, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8BD4, 0x8BD5, 0x8BD6, 0x0000, 0x8BD7, 0x0000, 0x8BD8,
- 0x8BD9, 0x0000, 0x0000, 0x8BDA, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8BDB, 0x0000, 0x0000, 0x8BDC, 0x8BDD, 0x8BDE, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8BDF, 0x0000, 0x8BE0, 0x0000, 0x8BE1, 0x0000, 0x0000, 0x8BE2,
- 0x0000, 0x0000, 0x0000, 0x8BE3, 0x0000, 0x0000, 0x8BE4, 0x0000, 0x8BE5, 0x0000, 0x0000, 0x0000, 0x8BE6, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8BE7, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8BE8, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x8BE9, 0x0000, 0x0000, 0x0000, 0x0000, 0x8BEA, 0x0000, 0x8BEB, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8BEC, 0x8BED, 0x0000, 0x8BEE, 0x0000, 0x0000, 0x8BEF, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8BF0, 0x0000, 0x0000, 0x8BF1, 0x8BF2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8BF3, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x8BF4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x8BF5, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8BF6, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8BF7, 0x0000, 0x0000, 0x0000, 0x8BF8, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8BF9, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8BFA, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8BFB, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8BFC,
- 0x8BFD, 0x0000, 0x8BFE, 0x8BFF, 0x0000, 0x8C00, 0x8C01, 0x8C02, 0x0000, 0x8C03, 0x0000, 0x0000, 0x0000, 0x8C04, 0x8C05, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C06, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C07, 0x0000, 0x0000, 0x8C08, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C09, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C0A, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C0B, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C0C, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C0D, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x8C0E, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C0F, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C10, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x8C11, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C12, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x8C13, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C14, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C15, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x8C16, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C17, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C18, 0x8C19, 0x8C1A,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C1B, 0x0000, 0x0000, 0x0000, 0x8C1C, 0x0000, 0x8C1D,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C1E, 0x0000, 0x8C1F, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C20,
- 0x8C21, 0x0000, 0x8C22, 0x0000, 0x0000, 0x8C23, 0x0000, 0x0000, 0x8C24, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C25, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C26, 0x8C27, 0x8C28, 0x8C29, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C2A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x8C2B, 0x0000, 0x8C2C, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C2D, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x8C2E, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C2F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x8C30, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C31, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C32, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x8C33, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C34, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x8C35, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C36, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C37, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x8C38, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C39, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C3A,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C3B, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C3C, 0x0000, 0x0000, 0x8C3D, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C3E, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C3F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C40, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x8C41, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C42, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C43, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C44, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x8C45, 0x0000, 0x0000, 0x0000, 0x8C46, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C47, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C48, 0x0000, 0x0000, 0x0000,
- 0x8C49, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C4A, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C4B, 0x8C4C,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x8C4D, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C4E, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C4F, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x8C50, 0x0000, 0x8C51, 0x8C52, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C53, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x8C54, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C55, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C56, 0x0000,
- 0x0000, 0x0000, 0x8C57, 0x0000, 0x0000, 0x8C58, 0x0000, 0x0000, 0x8C59, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x8C5A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C5B, 0x0000, 0x0000, 0x8C5C, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C5D, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C5E, 0x0000, 0x8C5F, 0x0000, 0x8C60, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x8C61, 0x0000, 0x0000, 0x8C62, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C63,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C64, 0x0000, 0x0000, 0x8C65, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C66, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C67, 0x0000, 0x0000, 0x0000, 0x8C68, 0x8C69, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C6A, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C6B, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C6C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C6D, 0x0000, 0x0000, 0x8C6E, 0x8C6F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x8C70, 0x0000, 0x0000, 0x0000, 0x8C71, 0x0000, 0x8C72, 0x8C73, 0x0000, 0x0000, 0x8C74, 0x8C75, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C76, 0x0000, 0x0000, 0x8C77, 0x0000, 0x0000, 0x0000, 0x8C78, 0x0000,
- 0x0000, 0x0000, 0x8C79, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C7A, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C7B, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C7C,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C7D, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C7E, 0x8C7F, 0x0000, 0x0000, 0x8C80,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C81, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C82,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C83, 0x8C84, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C85, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C86, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C87,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C88, 0x0000, 0x8C89, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C8A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x8C8B, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C8C, 0x0000,
- 0x0000, 0x0000, 0x8C8D, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C8E, 0x0000, 0x0000, 0x0000, 0x8C8F,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x8C90, 0x0000, 0x0000, 0x0000, 0x8C91, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C92, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x8C93, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C94, 0x0000, 0x0000, 0x8C95,
- 0x0000, 0x0000, 0x8C96, 0x0000, 0x0000, 0x0000, 0x8C97, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C98, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x8C99, 0x0000, 0x0000, 0x0000, 0x8C9A, 0x8C9B, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C9C, 0x0000, 0x0000,
- 0x8C9D, 0x8C9E, 0x0000, 0x0000, 0x8C9F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8CA0,
- 0x0000, 0x0000, 0x0000, 0x8CA1, 0x0000, 0x0000, 0x0000, 0x0000, 0x8CA2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x8CA3, 0x0000, 0x0000, 0x0000, 0x0000, 0x8CA4, 0x0000, 0x0000, 0x0000, 0x0000, 0x8CA5, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8CA6, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x8CA7, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8CA8, 0x0000, 0x8CA9, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8CAA, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8CAB, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8CAC, 0x8CAD, 0x0000, 0x0000,
- 0x0000, 0x8CAE, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8CAF, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8CB0, 0x0000, 0x0000, 0x0000, 0x0000, 0x8CB1, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8CB2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x8CB3, 0x8CB4, 0x0000, 0x8CB5, 0x0000, 0x0000, 0x8CB6, 0x0000, 0x0000, 0x8CB7, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8CB8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8CB9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8CBA, 0x0000, 0x0000,
- 0x8CBB, 0x0000, 0x0000, 0x0000, 0x8CBC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8CBD, 0x0000, 0x0000, 0x0000, 0x0000, 0x8CBE,
- 0x0000, 0x0000, 0x8CBF, 0x0000, 0x8CC0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8CC1, 0x0000, 0x0000, 0x0000, 0x8CC2,
- 0x0000, 0x0000, 0x0000, 0x8CC3, 0x0000, 0x0000, 0x8CC4, 0x0000, 0x8CC5, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x8CC6, 0x0000, 0x0000, 0x0000, 0x8CC7, 0x8CC8, 0x0000, 0x0000, 0x0000, 0x8CC9, 0x0000, 0x8CCA, 0x0000, 0x0000, 0x8CCB,
- 0x0000, 0x0000, 0x8CCC, 0x0000, 0x0000, 0x0000, 0x0000, 0x8CCD, 0x0000, 0x0000, 0x8CCE, 0x0000, 0x0000, 0x8CCF, 0x0000, 0x8CD0,
- 0x8CD1, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x8CD2, 0x0000, 0x8CD3, 0x0000, 0x8CD4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x8CD5, 0x8CD6, 0x0000, 0x0000, 0x0000, 0x0000, 0x8CD7, 0x0000, 0x8CD8, 0x0000, 0x8CD9, 0x0000, 0x8CDA, 0x0000,
- 0x8CDB, 0x0000, 0x0000, 0x8CDC, 0x0000, 0x8CDD, 0x8CDE, 0x8CDF, 0x8CE0, 0x0000, 0x0000, 0x8CE1, 0x0000, 0x8CE2, 0x0000, 0x8CE3,
- 0x0000, 0x0000, 0x0000, 0x8CE4, 0x0000, 0x8CE5, 0x0000, 0x0000, 0x0000, 0x0000, 0x8CE6, 0x0000, 0x0000, 0x8CE7, 0x0000, 0x0000,
- 0x0000, 0x8CE8, 0x0000, 0x0000, 0x8CE9, 0x0000, 0x8CEA, 0x0000, 0x0000, 0x0000, 0x8CEB, 0x0000, 0x8CEC, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x8CED, 0x0000, 0x0000, 0x0000, 0x0000, 0x8CEE, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8CEF, 0x0000,
- 0x8CF0, 0x0000, 0x8CF1, 0x0000, 0x8CF2, 0x8CF3, 0x0000, 0x0000, 0x8CF4, 0x0000, 0x0000, 0x8CF5, 0x0000, 0x0000, 0x8CF6, 0x0000,
- 0x8CF7, 0x8CF8, 0x8CF9, 0x8CFA, 0x0000, 0x0000, 0x8CFB, 0x0000, 0x0000, 0x8CFC, 0x0000, 0x8CFD, 0x8CFE, 0x8CFF, 0x8D00, 0x0000,
- 0x8D01, 0x8D02, 0x8D03, 0x8D04, 0x0000, 0x8D05, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8D06, 0x0000, 0x0000, 0x8D07,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x8D08, 0x8D09, 0x8D0A, 0x8D0B, 0x0000, 0x0000, 0x0000, 0x0000, 0x8D0C, 0x8D0D, 0x0000, 0x0000,
- 0x0000, 0x8D0E, 0x8D0F, 0x0000, 0x0000, 0x8D10, 0x0000, 0x0000, 0x8D11, 0x0000, 0x8D12, 0x0000, 0x0000, 0x0000, 0x8D13, 0x0000,
- 0x8D14, 0x8D15, 0x0000, 0x8D16, 0x8D17, 0x8D18, 0x8D19, 0x0000, 0x8D1A, 0x0000, 0x8D1B, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x8D1C, 0x0000, 0x8D1D, 0x0000, 0x0000, 0x0000, 0x8D1E, 0x0000, 0x0000, 0x8D1F, 0x0000, 0x0000, 0x8D20, 0x0000, 0x0000, 0x8D21,
- 0x0000, 0x0000, 0x8D22, 0x0000, 0x8D23, 0x0000, 0x0000, 0x8D24, 0x0000, 0x8D25, 0x0000, 0x8D26, 0x0000, 0x8D27, 0x0000, 0x8D28,
- 0x0000, 0x8D29, 0x8D2A, 0x0000, 0x0000, 0x0000, 0x8D2B, 0x8D2C, 0x0000, 0x0000, 0x0000, 0x8D2D, 0x8D2E, 0x8D2F, 0x8D30, 0x0000,
- 0x0000, 0x8D31, 0x8D32, 0x0000, 0x8D33, 0x0000, 0x8D34, 0x8D35, 0x0000, 0x0000, 0x0000, 0x8D36, 0x0000, 0x8D37, 0x8D38, 0x0000,
- 0x0000, 0x8D39, 0x0000, 0x8D3A, 0x0000, 0x0000, 0x8D3B, 0x8D3C, 0x8D3D, 0x0000, 0x8D3E, 0x0000, 0x8D3F, 0x0000, 0x8D40, 0x0000,
- 0x8D41, 0x8D42, 0x8D43, 0x0000, 0x8D44, 0x8D45, 0x0000, 0x0000, 0x0000, 0x0000, 0x8D46, 0x0000, 0x0000, 0x0000, 0x8D47, 0x0000,
- 0x8D48, 0x0000, 0x0000, 0x0000, 0x8D49, 0x0000, 0x8D4A, 0x8D4B, 0x0000, 0x8D4C, 0x0000, 0x8D4D, 0x0000, 0x8D4E, 0x0000, 0x0000,
- 0x8D4F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8D50, 0x0000, 0x0000, 0x8D51, 0x8D52, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x8D53, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8D54, 0x0000, 0x0000, 0x0000, 0x0000, 0x8D55, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8D56, 0x0000, 0x0000, 0x0000, 0x0000, 0x8D57, 0x8D58,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8D59, 0x0000, 0x8D5A, 0x8D5B, 0x8D5C, 0x0000, 0x8D5D, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8D5E, 0x0000, 0x0000, 0x0000, 0x8D5F,
- 0x8D60, 0x0000, 0x0000, 0x0000, 0x8D61, 0x0000, 0x0000, 0x8D62, 0x8D63, 0x0000, 0x0000, 0x0000, 0x0000, 0x8D64, 0x8D65, 0x0000,
- 0x8D66, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8D67, 0x8D68, 0x0000, 0x0000, 0x8D69, 0x0000,
- 0x0000, 0x0000, 0x8D6A, 0x8D6B, 0x0000, 0x8D6C, 0x8D6D, 0x0000, 0x0000, 0x0000, 0x8D6E, 0x0000, 0x8D6F, 0x0000, 0x8D70, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8D71, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8D72, 0x0000,
- 0x8D73, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8D74, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8D75, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x8D76, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8D77, 0x8D78, 0x0000,
- 0x8D79, 0x8D7A, 0x8D7B, 0x0000, 0x0000, 0x0000, 0x0000, 0x8D7C, 0x8D7D, 0x8D7E, 0x8D7F, 0x8D80, 0x8D81, 0x0000, 0x0000, 0x8D82,
- 0x8D83, 0x0000, 0x8D84, 0x8D85, 0x8D86, 0x0000, 0x8D87, 0x8D88, 0x8D89, 0x0000, 0x8D8A, 0x8D8B, 0x8D8C, 0x8D8D, 0x0000, 0x8D8E,
- 0x8D8F, 0x8D90, 0x8D91, 0x8D92, 0x8D93, 0x8D94, 0x0000, 0x8D95, 0x8D96, 0x0000, 0x8D97, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x8D98, 0x8D99, 0x8D9A, 0x0000, 0x8D9B, 0x0000, 0x0000, 0x0000, 0x8D9C, 0x8D9D, 0x0000, 0x8D9E, 0x0000, 0x8D9F, 0x0000,
- 0x8DA0, 0x8DA1, 0x8DA2, 0x8DA3, 0x8DA4, 0x0000, 0x8DA5, 0x8DA6, 0x0000, 0x0000, 0x8DA7, 0x0000, 0x8DA8, 0x8DA9, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x8DAA, 0x8DAB, 0x0000, 0x0000, 0x0000, 0x0000, 0x8DAC, 0x8DAD, 0x8DAE, 0x8DAF, 0x8DB0, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x8DB1, 0x8DB2, 0x0000, 0x8DB3, 0x8DB4, 0x0000, 0x8DB5, 0x0000, 0x0000, 0x8DB6, 0x0000, 0x8DB7,
- 0x8DB8, 0x0000, 0x0000, 0x8DB9, 0x8DBA, 0x0000, 0x8DBB, 0x8DBC, 0x0000, 0x0000, 0x0000, 0x8DBD, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8DBE, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8DBF, 0x0000, 0x0000, 0x0000, 0x8DC0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8DC1, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x8DC2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x8DC3, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x8DC4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x8DC5, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8DC6, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8DC7, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x8DC8, 0x0000, 0x0000, 0x8DC9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8DCA, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x8DCB, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8DCC, 0x8DCD, 0x8DCE, 0x0000, 0x8DCF, 0x0000, 0x0000,
- 0x0000, 0x8DD0, 0x8DD1, 0x8DD2, 0x0000, 0x8DD3, 0x0000, 0x0000, 0x0000, 0x0000, 0x8DD4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x8DD5, 0x0000, 0x0000, 0x0000, 0x8DD6, 0x8DD7, 0x0000, 0x0000, 0x0000, 0x8DD8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x8DD9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8DDA, 0x8DDB, 0x8DDC, 0x8DDD, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x8DDE, 0x0000, 0x8DDF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8DE0, 0x0000, 0x0000, 0x0000, 0x8DE1,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8DE2, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x8DE3, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8DE4, 0x8DE5, 0x8DE6, 0x8DE7, 0x8DE8, 0x0000, 0x8DE9, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x8DEA, 0x0000, 0x8DEB, 0x0000, 0x8DEC, 0x8DED, 0x8DEE, 0x8DEF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x8DF0, 0x0000, 0x8DF1, 0x8DF2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8DF3, 0x8DF4, 0x8DF5, 0x8DF6, 0x8DF7,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8DF8, 0x8DF9, 0x0000, 0x0000, 0x8DFA, 0x8DFB, 0x0000, 0x0000, 0x0000, 0x0000, 0x8DFC,
- 0x0000, 0x0000, 0x0000, 0x8DFD, 0x0000, 0x0000, 0x0000, 0x0000, 0x8DFE, 0x0000, 0x0000, 0x8DFF, 0x0000, 0x0000, 0x8E00, 0x8E01,
- 0x8E02, 0x0000, 0x8E03, 0x0000, 0x8E04, 0x8E05, 0x8E06, 0x0000, 0x0000, 0x8E07, 0x0000, 0x0000, 0x0000, 0x8E08, 0x8E09, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x8E0A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8E0B,
- 0x0000, 0x8E0C, 0x8E0D, 0x0000, 0x8E0E, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8E0F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8E10, 0x8E11, 0x8E12,
- 0x0000, 0x0000, 0x8E13, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8E14, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x8E15, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x8E16, 0x8E17, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8E18, 0x8E19, 0x0000, 0x0000, 0x8E1A, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x8E1B, 0x8E1C, 0x0000, 0x0000, 0x0000, 0x8E1D, 0x0000, 0x0000, 0x8E1E, 0x0000, 0x8E1F, 0x0000,
- 0x8E20, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8E21, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x8E22, 0x0000, 0x0000, 0x0000, 0x0000, 0x8E23, 0x8E24, 0x0000, 0x8E25, 0x0000, 0x8E26, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x8E27, 0x0000, 0x0000, 0x8E28, 0x0000, 0x0000, 0x8E29, 0x0000, 0x0000, 0x8E2A, 0x0000, 0x0000, 0x0000, 0x0000, 0x8E2B,
- 0x8E2C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8E2D,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8E2E, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8E2F, 0x0000, 0x0000, 0x8E30, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x8E31, 0x0000, 0x8E32, 0x0000, 0x8E33, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8E34, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8E35, 0x0000, 0x0000,
- 0x8E36, 0x0000, 0x8E37, 0x0000, 0x8E38, 0x0000, 0x8E39, 0x0000, 0x0000, 0x0000, 0x8E3A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8E3B, 0x8E3C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x8E3D, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8E3E, 0x0000, 0x8E3F, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8E40, 0x8E41, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x8E42, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x8E43, 0x8E44, 0x0000, 0x8E45, 0x0000, 0x8E46, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8E47, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x8E48, 0x8E49, 0x0000, 0x8E4A, 0x8E4B, 0x8E4C, 0x0000, 0x0000, 0x0000, 0x8E4D, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x8E4E, 0x8E4F, 0x0000, 0x0000, 0x8E50, 0x0000, 0x8E51, 0x0000, 0x0000, 0x8E52, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8E53, 0x0000, 0x8E54, 0x0000, 0x8E55, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x8E56, 0x8E57, 0x0000, 0x8E58, 0x8E59, 0x0000, 0x0000, 0x0000, 0x0000, 0x8E5A, 0x0000, 0x0000, 0x0000, 0x8E5B, 0x0000, 0x0000,
- 0x8E5C, 0x8E5D, 0x0000, 0x0000, 0x8E5E, 0x8E5F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8E60, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x8E61, 0x0000, 0x0000, 0x8E62, 0x8E63, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8E64, 0x0000,
- 0x8E65, 0x0000, 0x0000, 0x8E66, 0x8E67, 0x0000, 0x0000, 0x8E68, 0x8E69, 0x8E6A, 0x8E6B, 0x0000, 0x0000, 0x8E6C, 0x8E6D, 0x8E6E,
- 0x8E6F, 0x0000, 0x0000, 0x0000, 0x0000, 0x8E70, 0x0000, 0x0000, 0x8E71, 0x8E72, 0x0000, 0x8E73, 0x0000, 0x8E74, 0x0000, 0x0000,
- 0x0000, 0x8E75, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8E76, 0x0000, 0x0000, 0x8E77, 0x8E78, 0x0000, 0x0000, 0x8E79, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x8E7A, 0x0000, 0x8E7B, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8E7C, 0x8E7D, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8E7E, 0x0000, 0x8E7F, 0x0000, 0x8E80, 0x8E81, 0x0000, 0x0000, 0x0000, 0x8E82,
- 0x8E83, 0x0000, 0x0000, 0x8E84, 0x0000, 0x8E85, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8E86, 0x0000, 0x0000,
- 0x0000, 0x8E87, 0x0000, 0x8E88, 0x0000, 0x0000, 0x8E89, 0x0000, 0x8E8A, 0x0000, 0x8E8B, 0x8E8C, 0x8E8D, 0x0000, 0x0000, 0x0000,
- 0x8E8E, 0x0000, 0x0000, 0x8E8F, 0x0000, 0x8E90, 0x8E91, 0x0000, 0x8E92, 0x0000, 0x8E93, 0x8E94, 0x8E95, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x8E96, 0x0000, 0x0000, 0x0000, 0x8E97, 0x0000, 0x8E98, 0x0000, 0x8E99, 0x8E9A, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x8E9B, 0x0000, 0x8E9C, 0x0000, 0x8E9D, 0x0000, 0x8E9E, 0x0000, 0x0000, 0x0000, 0x0000, 0x8E9F, 0x0000, 0x0000, 0x8EA0,
- 0x0000, 0x0000, 0x8EA1, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8EA2, 0x0000, 0x8EA3,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x8EA4, 0x8EA5, 0x8EA6, 0x0000, 0x8EA7, 0x8EA8, 0x8EA9, 0x0000, 0x0000, 0x0000, 0x8EAA, 0x8EAB,
- 0x8EAC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8EAD, 0x0000, 0x0000, 0x0000, 0x8EAE, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x8EAF, 0x0000, 0x0000, 0x8EB0, 0x0000, 0x8EB1, 0x0000, 0x8EB2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8EB3,
- 0x8EB4, 0x0000, 0x8EB5, 0x0000, 0x0000, 0x8EB6, 0x0000, 0x0000, 0x8EB7, 0x8EB8, 0x8EB9, 0x8EBA, 0x0000, 0x0000, 0x0000, 0x8EBB,
- 0x8EBC, 0x8EBD, 0x8EBE, 0x0000, 0x0000, 0x0000, 0x8EBF, 0x0000, 0x8EC0, 0x8EC1, 0x0000, 0x8EC2, 0x0000, 0x0000, 0x8EC3, 0x8EC4,
- 0x0000, 0x0000, 0x0000, 0x8EC5, 0x0000, 0x0000, 0x8EC6, 0x0000, 0x8EC7, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x8EC8, 0x0000, 0x0000, 0x0000, 0x0000, 0x8EC9, 0x8ECA, 0x0000, 0x0000, 0x8ECB, 0x8ECC, 0x0000, 0x8ECD, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x8ECE, 0x0000, 0x0000, 0x0000, 0x8ECF, 0x0000, 0x8ED0, 0x8ED1, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x8ED2, 0x0000, 0x0000, 0x0000, 0x8ED3, 0x8ED4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8ED5, 0x0000, 0x0000, 0x0000,
- 0x8ED6, 0x0000, 0x0000, 0x0000, 0x0000, 0x8ED7, 0x8ED8, 0x0000, 0x0000, 0x0000, 0x8ED9, 0x0000, 0x0000, 0x0000, 0x8EDA, 0x0000,
- 0x0000, 0x0000, 0x8EDB, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8EDC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x8EDD, 0x0000, 0x8EDE, 0x0000, 0x8EDF, 0x0000, 0x0000, 0x8EE0, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x8EE1, 0x8EE2, 0x8EE3, 0x0000, 0x0000, 0x8EE4, 0x8EE5, 0x0000, 0x8EE6, 0x8EE7, 0x0000, 0x8EE8, 0x0000, 0x8EE9, 0x0000,
- 0x8EEA, 0x0000, 0x0000, 0x8EEB, 0x0000, 0x8EEC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x8EED, 0x0000, 0x0000, 0x0000, 0x8EEE, 0x8EEF, 0x0000, 0x0000, 0x0000, 0x8EF0, 0x8EF1, 0x0000, 0x0000,
- 0x8EF2, 0x8EF3, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8EF4, 0x8EF5, 0x0000, 0x0000, 0x0000, 0x8EF6, 0x8EF7, 0x8EF8, 0x8EF9,
- 0x0000, 0x8EFA, 0x8EFB, 0x0000, 0x8EFC, 0x0000, 0x0000, 0x0000, 0x8EFD, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x8EFE, 0x0000, 0x0000, 0x0000, 0x0000, 0x8EFF, 0x0000, 0x0000, 0x0000, 0x8F00, 0x0000, 0x0000, 0x0000, 0x8F01, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x8F02, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x8F03, 0x0000, 0x0000, 0x8F04, 0x8F05, 0x0000, 0x0000, 0x0000, 0x8F06, 0x8F07, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8F08, 0x8F09, 0x0000, 0x0000, 0x8F0A, 0x0000, 0x0000, 0x8F0B, 0x0000,
- 0x0000, 0x0000, 0x8F0C, 0x8F0D, 0x0000, 0x8F0E, 0x8F0F, 0x0000, 0x8F10, 0x0000, 0x8F11, 0x0000, 0x0000, 0x0000, 0x0000, 0x8F12,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x8F13, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8F14, 0x0000, 0x8F15, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x8F16, 0x0000, 0x0000, 0x0000, 0x8F17, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8F18, 0x0000,
- 0x8F19, 0x0000, 0x0000, 0x8F1A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8F1B, 0x0000, 0x0000,
- 0x8F1C, 0x8F1D, 0x8F1E, 0x0000, 0x0000, 0x0000, 0x0000, 0x8F1F, 0x0000, 0x8F20, 0x0000, 0x0000, 0x8F21, 0x8F22, 0x8F23, 0x8F24,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8F25, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x8F26, 0x0000, 0x8F27, 0x8F28, 0x0000, 0x0000, 0x8F29, 0x0000, 0x8F2A, 0x8F2B, 0x0000, 0x8F2C, 0x8F2D, 0x0000, 0x8F2E, 0x8F2F,
- 0x0000, 0x0000, 0x8F30, 0x8F31, 0x8F32, 0x0000, 0x0000, 0x0000, 0x8F33, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x8F34, 0x0000, 0x8F35, 0x0000, 0x8F36, 0x0000, 0x0000, 0x8F37, 0x8F38, 0x0000, 0x8F39, 0x8F3A, 0x8F3B, 0x0000, 0x0000,
- 0x0000, 0x8F3C, 0x0000, 0x0000, 0x0000, 0x0000, 0x8F3D, 0x0000, 0x0000, 0x8F3E, 0x0000, 0x8F3F, 0x8F40, 0x8F41, 0x8F42, 0x8F43,
- 0x0000, 0x0000, 0x0000, 0x8F44, 0x0000, 0x0000, 0x8F45, 0x8F46, 0x8F47, 0x0000, 0x8F48, 0x8F49, 0x8F4A, 0x0000, 0x0000, 0x0000,
- 0x8F4B, 0x0000, 0x8F4C, 0x8F4D, 0x8F4E, 0x8F4F, 0x8F50, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8F51, 0x0000, 0x8F52, 0x0000,
- 0x8F53, 0x8F54, 0x8F55, 0x0000, 0x8F56, 0x8F57, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8F58, 0x0000, 0x0000, 0x0000, 0x0000, 0x8F59, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x8F5A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x8F5B, 0x0000, 0x0000, 0x8F5C, 0x0000, 0x0000, 0x0000, 0x0000, 0x8F5D, 0x0000, 0x0000, 0x0000, 0x0000, 0x8F5E, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8F5F, 0x8F60, 0x0000, 0x0000, 0x0000, 0x8F61, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8F62, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8F63, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8F64, 0x0000, 0x8F65, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x8F66, 0x0000, 0x0000, 0x8F67, 0x0000, 0x0000, 0x0000, 0x8F68, 0x0000, 0x0000, 0x8F69, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8F6A, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8F6B, 0x0000, 0x0000, 0x8F6C, 0x0000, 0x8F6D, 0x8F6E, 0x0000, 0x8F6F, 0x0000,
- 0x0000, 0x0000, 0x8F70, 0x8F71, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x8F72, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8F73, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x8F74, 0x0000, 0x0000, 0x0000, 0x0000, 0x8F75, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8F76, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x8F77, 0x0000, 0x8F78, 0x0000, 0x8F79, 0x0000, 0x8F7A, 0x8F7B, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8F7C, 0x0000, 0x8F7D, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8F7E, 0x0000, 0x8F7F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x8F80, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8F81,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8F82, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x8F83, 0x0000, 0x8F84, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8F85, 0x0000, 0x8F86, 0x8F87, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x8F88, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8F89, 0x0000, 0x0000, 0x8F8A, 0x0000, 0x8F8B, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8F8C, 0x0000, 0x0000, 0x0000, 0x8F8D,
- 0x0000, 0x8F8E, 0x8F8F, 0x8F90, 0x0000, 0x8F91, 0x8F92, 0x8F93, 0x8F94, 0x0000, 0x8F95, 0x0000, 0x8F96, 0x0000, 0x8F97, 0x8F98,
- 0x8F99, 0x8F9A, 0x8F9B, 0x8F9C, 0x0000, 0x0000, 0x0000, 0x8F9D, 0x8F9E, 0x0000, 0x0000, 0x0000, 0x8F9F, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x8FA0, 0x0000, 0x0000, 0x8FA1, 0x0000, 0x8FA2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8FA3, 0x0000, 0x0000,
- 0x8FA4, 0x0000, 0x8FA5, 0x0000, 0x0000, 0x0000, 0x0000, 0x8FA6, 0x8FA7, 0x8FA8, 0x0000, 0x8FA9, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8FAA, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8FAB, 0x8FAC, 0x8FAD, 0x8FAE,
- 0x0000, 0x0000, 0x8FAF, 0x8FB0, 0x0000, 0x0000, 0x0000, 0x0000, 0x8FB1, 0x8FB2, 0x0000, 0x8FB3, 0x0000, 0x0000, 0x8FB4, 0x0000,
- 0x0000, 0x0000, 0x8FB5, 0x0000, 0x0000, 0x8FB6, 0x0000, 0x8FB7, 0x0000, 0x0000, 0x0000, 0x8FB8, 0x8FB9, 0x0000, 0x0000, 0x8FBA,
- 0x8FBB, 0x8FBC, 0x0000, 0x8FBD, 0x8FBE, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8FBF, 0x0000, 0x0000, 0x0000, 0x0000, 0x8FC0, 0x8FC1, 0x8FC2,
- 0x0000, 0x8FC3, 0x0000, 0x0000, 0x0000, 0x0000, 0x8FC4, 0x0000, 0x8FC5, 0x0000, 0x8FC6, 0x8FC7, 0x8FC8, 0x0000, 0x0000, 0x0000,
- 0x8FC9, 0x0000, 0x0000, 0x0000, 0x8FCA, 0x0000, 0x8FCB, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8FCC, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x8FCD, 0x8FCE, 0x0000, 0x8FCF, 0x0000, 0x0000, 0x0000, 0x8FD0, 0x8FD1, 0x8FD2, 0x0000, 0x8FD3, 0x0000, 0x8FD4,
- 0x0000, 0x0000, 0x8FD5, 0x0000, 0x8FD6, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8FD7, 0x8FD8, 0x8FD9, 0x8FDA,
- 0x0000, 0x0000, 0x0000, 0x8FDB, 0x8FDC, 0x8FDD, 0x0000, 0x0000, 0x0000, 0x8FDE, 0x8FDF, 0x0000, 0x8FE0, 0x0000, 0x8FE1, 0x0000,
- 0x0000, 0x8FE2, 0x8FE3, 0x8FE4, 0x0000, 0x0000, 0x8FE5, 0x0000, 0x8FE6, 0x0000, 0x8FE7, 0x8FE8, 0x8FE9, 0x0000, 0x8FEA, 0x0000,
- 0x0000, 0x8FEB, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8FEC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x8FED, 0x0000, 0x8FEE, 0x0000, 0x8FEF, 0x8FF0, 0x0000, 0x0000, 0x0000, 0x8FF1, 0x0000, 0x8FF2, 0x0000, 0x8FF3, 0x8FF4,
- 0x0000, 0x8FF5, 0x0000, 0x8FF6, 0x0000, 0x8FF7, 0x0000, 0x0000, 0x8FF8, 0x8FF9, 0x0000, 0x8FFA, 0x8FFB, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x8FFC, 0x0000, 0x0000, 0x0000, 0x0000, 0x8FFD, 0x0000, 0x0000, 0x0000, 0x0000, 0x8FFE, 0x0000, 0x8FFF, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x9000, 0x9001, 0x9002, 0x0000,
- 0x0000, 0x9003, 0x0000, 0x9004, 0x9005, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x9006, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x9007, 0x9008, 0x9009, 0x0000, 0x900A, 0x900B, 0x0000, 0x0000, 0x900C, 0x900D, 0x0000, 0x900E, 0x0000, 0x900F, 0x0000, 0x9010,
- 0x0000, 0x0000, 0x9011, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x9012, 0x0000, 0x0000,
- 0x9013, 0x9014, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x9015, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x9016,
- 0x0000, 0x9017, 0x9018, 0x0000, 0x0000, 0x9019, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x901A, 0x901B, 0x901C,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x901D, 0x0000, 0x0000, 0x901E, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x901F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x9020, 0x0000, 0x9021, 0x9022, 0x0000,
- 0x9023, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x9024, 0x9025, 0x9026, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x9027, 0x0000,
- 0x9028, 0x9029, 0x902A, 0x902B, 0x902C, 0x902D, 0x0000, 0x0000, 0x0000, 0x0000, 0x902E, 0x0000, 0x902F, 0x9030, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x9031, 0x0000, 0x9032, 0x0000, 0x0000, 0x9033, 0x9034, 0x0000, 0x0000, 0x0000, 0x9035,
- 0x0000, 0x0000, 0x9036, 0x0000, 0x9037, 0x9038, 0x9039, 0x0000, 0x0000, 0x0000, 0x903A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x903B,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x903C,
- 0x0000, 0x0000, 0x903D, 0x0000, 0x903E, 0x903F, 0x9040, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x9041, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x9042, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x9043, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x9044, 0x0000, 0x0000, 0x9045, 0x0000, 0x9046, 0x0000, 0x9047, 0x0000, 0x0000, 0x0000, 0x0000, 0x9048, 0x0000,
- 0x0000, 0x9049, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x904A, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x904B, 0x0000, 0x904C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x904D, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x904E,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x904F, 0x0000, 0x0000, 0x9050, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x9051, 0x0000, 0x9052, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x9053, 0x9054, 0x0000,
- 0x9055, 0x9056, 0x9057, 0x9058, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x9059, 0x0000, 0x0000, 0x0000, 0x905A, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x905B, 0x0000, 0x0000, 0x0000, 0x905C, 0x905D, 0x0000, 0x905E, 0x905F, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x9060, 0x9061, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x9062, 0x0000, 0x9063, 0x9064, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x9065, 0x9066, 0x9067, 0x9068, 0x0000, 0x0000, 0x0000, 0x9069, 0x0000, 0x906A, 0x0000, 0x0000,
- 0x0000, 0x906B, 0x906C, 0x0000, 0x906D, 0x0000, 0x0000, 0x906E, 0x906F, 0x0000, 0x9070, 0x9071, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x9072, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x9073, 0x0000, 0x9074,
- 0x0000, 0x0000, 0x9075, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x9076, 0x9077, 0x0000, 0x0000, 0x0000, 0x9078, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x9079, 0x907A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x907B, 0x0000, 0x0000, 0x907C,
- 0x0000, 0x0000, 0x0000, 0x907D, 0x0000, 0x907E, 0x0000, 0x0000, 0x907F, 0x9080, 0x0000, 0x0000, 0x0000, 0x9081, 0x9082, 0x0000,
- 0x0000, 0x9083, 0x9084, 0x0000, 0x0000, 0x0000, 0x0000, 0x9085, 0x0000, 0x9086, 0x9087, 0x9088, 0x0000, 0x0000, 0x9089, 0x0000,
- 0x0000, 0x0000, 0x908A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x908B, 0x908C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x908D, 0x0000, 0x908E, 0x0000, 0x908F, 0x9090, 0x9091, 0x0000, 0x0000, 0x0000, 0x0000, 0x9092, 0x0000, 0x9093,
- 0x9094, 0x0000, 0x0000, 0x9095, 0x0000, 0x0000, 0x0000, 0x9096, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x9097, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x9098, 0x9099, 0x0000, 0x909A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x909B, 0x0000, 0x909C, 0x0000, 0x909D, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x909E, 0x909F, 0x90A0, 0x0000, 0x90A1, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x90A2, 0x90A3, 0x0000, 0x90A4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x90A5, 0x0000, 0x0000, 0x90A6, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x90A7, 0x0000, 0x90A8, 0x90A9, 0x90AA,
- 0x0000, 0x0000, 0x0000, 0x90AB, 0x0000, 0x0000, 0x90AC, 0x0000, 0x90AD, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x90AE,
- 0x90AF, 0x0000, 0x0000, 0x0000, 0x90B0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x90B1, 0x0000, 0x0000, 0x0000, 0x90B2,
- 0x0000, 0x0000, 0x90B3, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x90B4, 0x90B5, 0x90B6, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x90B7, 0x90B8, 0x0000, 0x0000,
- 0x90B9, 0x90BA, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x90BB, 0x0000, 0x90BC, 0x0000, 0x0000, 0x90BD,
- 0x0000, 0x0000, 0x90BE, 0x0000, 0x0000, 0x0000, 0x0000, 0x90BF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x90C0, 0x0000, 0x90C1, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x90C2, 0x0000, 0x0000, 0x90C3, 0x0000, 0x90C4, 0x0000, 0x90C5, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x90C6, 0x0000, 0x0000, 0x90C7, 0x90C8, 0x0000, 0x0000, 0x0000, 0x90C9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x90CA,
- 0x0000, 0x0000, 0x90CB, 0x0000, 0x90CC, 0x0000, 0x0000, 0x0000, 0x0000, 0x90CD, 0x90CE, 0x90CF, 0x90D0, 0x0000, 0x0000, 0x90D1,
- 0x0000, 0x90D2, 0x90D3, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x90D4, 0x0000, 0x0000, 0x90D5, 0x90D6, 0x0000, 0x90D7, 0x90D8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x90D9, 0x90DA, 0x0000, 0x0000, 0x0000, 0x0000, 0x90DB, 0x0000, 0x0000, 0x0000, 0x90DC,
- 0x0000, 0x0000, 0x90DD, 0x0000, 0x90DE, 0x0000, 0x0000, 0x0000, 0x90DF, 0x90E0, 0x90E1, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x90E2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x90E3, 0x0000, 0x0000, 0x90E4, 0x0000, 0x90E5, 0x90E6, 0x0000, 0x90E7, 0x90E8, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x90E9, 0x0000, 0x0000, 0x0000, 0x0000, 0x90EA, 0x0000, 0x90EB, 0x90EC, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x90ED, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x90EE, 0x0000, 0x0000, 0x0000, 0x90EF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x90F0, 0x90F1, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x90F2, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x90F3, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x90F4, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x90F5, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x90F6, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x90F7, 0x0000, 0x90F8, 0x90F9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x90FA, 0x0000, 0x90FB,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x90FC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x90FD, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x90FE, 0x90FF, 0x0000, 0x0000, 0x9100, 0x9101,
- 0x0000, 0x0000, 0x9102, 0x0000, 0x9103, 0x9104, 0x0000, 0x0000, 0x0000, 0x9105, 0x0000, 0x0000, 0x9106, 0x0000, 0x0000, 0x9107,
- 0x9108, 0x9109, 0x0000, 0x0000, 0x0000, 0x0000, 0x910A, 0x0000, 0x0000, 0x0000, 0x910B, 0x0000, 0x910C, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x910D, 0x0000, 0x0000, 0x0000, 0x0000, 0x910E, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x910F, 0x9110, 0x0000,
- 0x9111, 0x0000, 0x0000, 0x0000, 0x9112, 0x9113, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x9114, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x9115, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x9116, 0x9117, 0x9118, 0x9119, 0x911A, 0x911B, 0x911C, 0x911D, 0x911E, 0x911F, 0x9120, 0x9121, 0x9122, 0x9123, 0x9124, 0x9125,
- 0x9126, 0x9127, 0x9128, 0x9129, 0x912A, 0x912B, 0x912C, 0x912D, 0x912E, 0x912F, 0x9130, 0x9131, 0x9132, 0x9133, 0x9134, 0x9135,
- 0x9136, 0x9137, 0x9138, 0x9139, 0x913A, 0x913B, 0x913C, 0x913D, 0x913E, 0x913F, 0x9140, 0x9141, 0x9142, 0x9143, 0x9144, 0x9145,
- 0x9146, 0x9147, 0x9148, 0x9149, 0x914A, 0x914B, 0x914C, 0x914D, 0x914E, 0x914F, 0x9150, 0x9151, 0x9152, 0x9153, 0x9154, 0x9155,
- 0x9156, 0x9157, 0x9158, 0x9159, 0x915A, 0x915B, 0x915C, 0x915D, 0x915E, 0x915F, 0x9160, 0x9161, 0x9162, 0x9163, 0x9164, 0x9165,
- 0x9166, 0x9167, 0x9168, 0x9169, 0x916A, 0x916B, 0x916C, 0x916D, 0x916E, 0x916F, 0x9170, 0x9171, 0x9172, 0x9173, 0x9174, 0x9175,
- 0x9176, 0x9177, 0x9178, 0x9179, 0x917A, 0x917B, 0x917C, 0x917D, 0x917E, 0x917F, 0x9180, 0x9181, 0x9182, 0x9183, 0x9184, 0x9185,
- 0x9186, 0x9187, 0x9188, 0x9189, 0x918A, 0x918B, 0x918C, 0x918D, 0x918E, 0x918F, 0x9190, 0x9191, 0x9192, 0x9193, 0x9194, 0x9195,
- 0x9196, 0x9197, 0x9198, 0x9199, 0x919A, 0x919B, 0x919C, 0x919D, 0x919E, 0x919F, 0x91A0, 0x91A1, 0x91A2, 0x91A3, 0x91A4, 0x91A5,
- 0x91A6, 0x91A7, 0x91A8, 0x91A9, 0x91AA, 0x91AB, 0x91AC, 0x91AD, 0x91AE, 0x91AF, 0x91B0, 0x91B1, 0x91B2, 0x91B3, 0x91B4, 0x91B5,
- 0x91B6, 0x91B7, 0x91B8, 0x91B9, 0x91BA, 0x91BB, 0x91BC, 0x91BD, 0x91BE, 0x91BF, 0x91C0, 0x91C1, 0x91C2, 0x91C3, 0x91C4, 0x91C5,
- 0x91C6, 0x91C7, 0x91C8, 0x91C9, 0x91CA, 0x91CB, 0x91CC, 0x91CD, 0x91CE, 0x91CF, 0x91D0, 0x91D1, 0x91D2, 0x91D3, 0x91D4, 0x91D5,
- 0x91D6, 0x91D7, 0x91D8, 0x91D9, 0x91DA, 0x91DB, 0x91DC, 0x91DD, 0x91DE, 0x91DF, 0x91E0, 0x91E1, 0x91E2, 0x91E3, 0x91E4, 0x91E5,
- 0x91E6, 0x91E7, 0x91E8, 0x91E9, 0x91EA, 0x91EB, 0x91EC, 0x91ED, 0x91EE, 0x91EF, 0x91F0, 0x91F1, 0x91F2, 0x91F3, 0x91F4, 0x91F5,
- 0x91F6, 0x91F7, 0x91F8, 0x91F9, 0x91FA, 0x91FB, 0x91FC, 0x91FD, 0x91FE, 0x91FF, 0x9200, 0x9201, 0x9202, 0x9203, 0x9204, 0x9205,
- 0x9206, 0x9207, 0x9208, 0x9209, 0x920A, 0x920B, 0x920C, 0x920D, 0x920E, 0x920F, 0x9210, 0x9211, 0x9212, 0x9213, 0x9214, 0x9215,
- 0x9216, 0x9217, 0x9218, 0x9219, 0x921A, 0x921B, 0x921C, 0x921D, 0x921E, 0x921F, 0x9220, 0x9221, 0x9222, 0x9223, 0x0000, 0x0000,
- 0x9224, 0x0000, 0x9225, 0x0000, 0x0000, 0x9226, 0x9227, 0x9228, 0x9229, 0x922A, 0x922B, 0x922C, 0x922D, 0x922E, 0x922F, 0x0000,
- 0x9230, 0x0000, 0x9231, 0x0000, 0x0000, 0x9232, 0x9233, 0x0000, 0x0000, 0x0000, 0x9234, 0x9235, 0x9236, 0x9237, 0x0000, 0x0000,
- 0x9238, 0x9239, 0x923A, 0x923B, 0x923C, 0x923D, 0x923E, 0x923F, 0x9240, 0x9241, 0x9242, 0x9243, 0x9244, 0x9245, 0x9246, 0x9247,
- 0x9248, 0x9249, 0x924A, 0x924B, 0x924C, 0x924D, 0x924E, 0x924F, 0x9250, 0x9251, 0x9252, 0x9253, 0x9254, 0x9255, 0x9256, 0x9257,
- 0x9258, 0x9259, 0x925A, 0x925B, 0x925C, 0x925D, 0x925E, 0x925F, 0x9260, 0x9261, 0x9262, 0x9263, 0x9264, 0x9265, 0x9266, 0x9267,
- 0x9268, 0x9269, 0x926A, 0x926B, 0x926C, 0x926D, 0x926E, 0x926F, 0x9270, 0x9271, 0x9272, 0x9273, 0x0000, 0x9274, 0x0000, 0x0000,
- 0x9275, 0x9276, 0x9277, 0x9278, 0x9279, 0x927A, 0x927B, 0x927C, 0x927D, 0x927E, 0x927F, 0x9280, 0x9281, 0x9282, 0x9283, 0x9284,
- 0x9285, 0x9286, 0x9287, 0x9288, 0x9289, 0x928A, 0x928B, 0x928C, 0x928D, 0x928E, 0x928F, 0x9290, 0x9291, 0x9292, 0x9293, 0x9294,
- 0x9295, 0x9296, 0x9297, 0x9298, 0x9299, 0x929A, 0x929B, 0x929C, 0x929D, 0x929E, 0x929F, 0x92A0, 0x92A1, 0x92A2, 0x92A3, 0x92A4,
- 0x92A5, 0x92A6, 0x92A7, 0x92A8, 0x92A9, 0x92AA, 0x92AB, 0x92AC, 0x92AD, 0x92AE, 0x92AF, 0x92B0, 0x92B1, 0x92B2, 0x92B3, 0x92B4,
- 0x92B5, 0x92B6, 0x92B7, 0x92B8, 0x92B9, 0x92BA, 0x92BB, 0x92BC, 0x92BD, 0x92BE, 0x92BF, 0x92C0, 0x92C1, 0x92C2, 0x92C3, 0x92C4,
- 0x92C5, 0x92C6, 0x92C7, 0x92C8, 0x92C9, 0x92CA, 0x92CB, 0x92CC, 0x92CD, 0x92CE, 0x92CF, 0x92D0, 0x92D1, 0x92D2, 0x92D3, 0x0000,
- 0x0000, 0x0000, 0x92D4, 0x92D5, 0x92D6, 0x0000, 0x0000, 0x0000, 0x92D7, 0x92D8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x23AC, 0x23AE, 0x23B0, 0x3312, 0x3315, 0x23B2, 0x23B4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x23B6, 0x23B8, 0x23BA, 0x23BC, 0x23BE, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x23C0, 0x0000, 0x23C2,
- 0x92D9, 0x92DA, 0x92DB, 0x92DC, 0x92DD, 0x92DE, 0x92DF, 0x92E0, 0x92E1, 0x92E2, 0x23C4, 0x23C6, 0x23C8, 0x23CA, 0x23CC, 0x23CE,
- 0x23D0, 0x23D2, 0x23D4, 0x23D6, 0x23D8, 0x23DA, 0x23DC, 0x0000, 0x23DE, 0x23E0, 0x23E2, 0x23E4, 0x23E6, 0x0000, 0x23E8, 0x0000,
- 0x23EA, 0x23EC, 0x0000, 0x23EE, 0x23F0, 0x0000, 0x23F2, 0x23F4, 0x23F6, 0x23F8, 0x23FA, 0x23FC, 0x23FE, 0x2400, 0x2402, 0x2404,
- 0x92E3, 0x92E4, 0x92E5, 0x92E6, 0x92E7, 0x92E8, 0x92E9, 0x92EA, 0x92EB, 0x92EC, 0x92ED, 0x92EE, 0x92EF, 0x92F0, 0x92F1, 0x92F2,
- 0x92F3, 0x92F4, 0x92F5, 0x92F6, 0x92F7, 0x92F8, 0x92F9, 0x92FA, 0x92FB, 0x92FC, 0x92FD, 0x92FE, 0x92FF, 0x9300, 0x9301, 0x9302,
- 0x9303, 0x9304, 0x9305, 0x9306, 0x9307, 0x9308, 0x9309, 0x930A, 0x930B, 0x930C, 0x930D, 0x930E, 0x930F, 0x9310, 0x9311, 0x9312,
- 0x9313, 0x9314, 0x9315, 0x9316, 0x9317, 0x9318, 0x9319, 0x931A, 0x931B, 0x931C, 0x931D, 0x931E, 0x931F, 0x9320, 0x9321, 0x9322,
- 0x9323, 0x9324, 0x9325, 0x9326, 0x9327, 0x9328, 0x9329, 0x932A, 0x932B, 0x932C, 0x932D, 0x932E, 0x932F, 0x9330, 0x9331, 0x9332,
- 0x9333, 0x9334, 0x9335, 0x9336, 0x9337, 0x9338, 0x9339, 0x933A, 0x933B, 0x933C, 0x933D, 0x933E, 0x933F, 0x9340, 0x9341, 0x9342,
- 0x9343, 0x9344, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x9345, 0x9346, 0x9347, 0x9348, 0x9349, 0x934A, 0x934B, 0x934C, 0x934D, 0x934E, 0x934F, 0x9350, 0x9351,
- 0x9352, 0x9353, 0x9354, 0x9355, 0x9356, 0x9357, 0x9358, 0x9359, 0x935A, 0x935B, 0x2406, 0x2408, 0x240A, 0x240C, 0x240E, 0x2410,
- 0x2412, 0x2414, 0x2416, 0x2418, 0x241A, 0x241C, 0x241E, 0x2420, 0x2422, 0x2424, 0x2426, 0x2428, 0x935C, 0x935D, 0x935E, 0x935F,
- 0x242A, 0x242C, 0x242E, 0x2430, 0x2432, 0x2434, 0x2436, 0x2438, 0x243A, 0x243C, 0x243E, 0x2440, 0x2442, 0x2444, 0x2446, 0x2448,
- 0x244A, 0x244C, 0x244E, 0x2450, 0x2452, 0x2454, 0x2456, 0x2458, 0x245A, 0x245C, 0x245E, 0x2460, 0x2462, 0x2464, 0x2466, 0x2468,
- 0x246A, 0x246C, 0x246E, 0x2470, 0x2472, 0x2474, 0x2476, 0x2478, 0x247A, 0x247C, 0x247E, 0x2480, 0x2482, 0x2484, 0x2486, 0x2488,
- 0x248A, 0x248C, 0x248E, 0x2490, 0x2492, 0x2494, 0x2496, 0x2498, 0x249A, 0x249C, 0x249E, 0x24A0, 0x24A2, 0x24A4, 0x24A6, 0x24A8,
- 0x24AA, 0x24AC, 0x24AE, 0x24B0, 0x24B2, 0x24B4, 0x24B6, 0x24B8, 0x24BA, 0x24BC, 0x24BE, 0x24C0, 0x24C2, 0x24C4, 0x24C6, 0x24C8,
- 0x24CA, 0x24CC, 0x24CE, 0x24D0, 0x24D2, 0x24D4, 0x24D6, 0x24D8, 0x24DA, 0x24DC, 0x24DE, 0x24E0, 0x24E2, 0x24E4, 0x24E6, 0x24E8,
- 0x24EA, 0x24EC, 0x24EE, 0x24F0, 0x24F2, 0x24F4, 0x24F6, 0x24F8, 0x24FA, 0x24FC, 0x24FE, 0x2500, 0x2502, 0x2504, 0x2506, 0x2508,
- 0x250A, 0x250C, 0x250E, 0x2510, 0x2512, 0x2514, 0x2516, 0x2518, 0x251A, 0x251C, 0x251E, 0x2520, 0x2522, 0x2524, 0x2526, 0x2528,
- 0x252A, 0x252C, 0x252E, 0x2530, 0x2532, 0x2534, 0x2536, 0x2538, 0x253A, 0x253C, 0x253E, 0x2540, 0x2542, 0x2544, 0x2546, 0x2548,
- 0x254A, 0x254C, 0x254E, 0x2550, 0x2552, 0x2554, 0x2556, 0x2558, 0x255A, 0x255C, 0x255E, 0x2560, 0x2562, 0x2564, 0x2566, 0x2568,
- 0x256A, 0x256C, 0x256E, 0x2570, 0x2572, 0x2574, 0x2576, 0x2578, 0x257A, 0x257C, 0x257E, 0x2580, 0x2582, 0x2584, 0x2586, 0x2588,
- 0x258A, 0x258C, 0x258E, 0x2590, 0x2592, 0x2594, 0x2596, 0x2598, 0x259A, 0x259C, 0x259E, 0x25A0, 0x25A2, 0x25A4, 0x25A6, 0x25A8,
- 0x25AA, 0x25AC, 0x25AE, 0x25B0, 0x25B2, 0x25B4, 0x25B6, 0x25B8, 0x25BA, 0x25BC, 0x25BE, 0x25C0, 0x25C2, 0x25C4, 0x25C6, 0x25C8,
- 0x25CA, 0x25CC, 0x25CE, 0x25D0, 0x25D2, 0x25D4, 0x25D6, 0x25D8, 0x25DA, 0x25DC, 0x25DE, 0x25E0, 0x25E2, 0x25E4, 0x25E6, 0x25E8,
- 0x25EA, 0x25EC, 0x25EE, 0x25F0, 0x25F2, 0x25F4, 0x25F6, 0x25F8, 0x25FA, 0x25FC, 0x25FE, 0x2600, 0x2602, 0x2604, 0x2606, 0x2608,
- 0x260A, 0x260C, 0x3318, 0x331B, 0x331E, 0x260E, 0x2610, 0x2612, 0x2614, 0x2616, 0x2618, 0x261A, 0x261C, 0x261E, 0x2620, 0x2622,
- 0x2624, 0x2626, 0x2628, 0x262A, 0x262C, 0x262E, 0x2630, 0x2632, 0x2634, 0x2636, 0x2638, 0x263A, 0x263C, 0x263E, 0x2640, 0x2642,
- 0x2644, 0x2646, 0x2648, 0x264A, 0x264C, 0x264E, 0x2650, 0x2652, 0x2654, 0x2656, 0x2658, 0x265A, 0x265C, 0x265E, 0x2660, 0x2662,
- 0x2664, 0x2666, 0x2668, 0x266A, 0x266C, 0x266E, 0x2670, 0x2672, 0x2674, 0x2676, 0x2678, 0x267A, 0x267C, 0x267E, 0x2680, 0x2682,
- 0x2684, 0x2686, 0x2688, 0x268A, 0x268C, 0x268E, 0x2690, 0x2692, 0x2694, 0x2696, 0x2698, 0x269A, 0x269C, 0x269E, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x3321, 0x3324, 0x3327, 0x332A, 0x332D, 0x3330, 0x3333, 0x3336, 0x3339, 0x333C, 0x333F, 0x3342, 0x3345, 0x3348, 0x334B, 0x334E,
- 0x3351, 0x3354, 0x3357, 0x335A, 0x335D, 0x3360, 0x3363, 0x3366, 0x3369, 0x336C, 0x336F, 0x3372, 0x3375, 0x3378, 0x337B, 0x337E,
- 0x3381, 0x3384, 0x3387, 0x338A, 0x338D, 0x3390, 0x3393, 0x3396, 0x3399, 0x339C, 0x339F, 0x33A2, 0x33A5, 0x33A8, 0x33AB, 0x33AE,
- 0x33B1, 0x33B4, 0x33B7, 0x33BA, 0x33BD, 0x33C0, 0x33C3, 0x33C6, 0x33C9, 0x33CC, 0x33CF, 0x33D2, 0x33D5, 0x33D8, 0x33DB, 0x33DE,
- 0x0000, 0x0000, 0x33E1, 0x33E4, 0x33E7, 0x33EA, 0x33ED, 0x33F0, 0x33F3, 0x33F6, 0x33F9, 0x33FC, 0x33FF, 0x3402, 0x3405, 0x3408,
- 0x340B, 0x340E, 0x3411, 0x3414, 0x3417, 0x341A, 0x341D, 0x3420, 0x3423, 0x3426, 0x3429, 0x342C, 0x342F, 0x3432, 0x3435, 0x3438,
- 0x343B, 0x343E, 0x3441, 0x3444, 0x3447, 0x344A, 0x344D, 0x3450, 0x3453, 0x3456, 0x3459, 0x345C, 0x345F, 0x3462, 0x3465, 0x3468,
- 0x346B, 0x346E, 0x3471, 0x3474, 0x3477, 0x347A, 0x347D, 0x3480, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x3483, 0x3486, 0x41A4, 0x41A9, 0x41AE, 0x41B3, 0x41B8, 0x41BD, 0x41C2, 0x3489, 0x41C7, 0x41DA, 0x41E3, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x9360, 0x9361, 0x9362, 0x9363, 0x9364, 0x9365, 0x9366, 0x9367, 0x9368, 0x9369, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x936A, 0x936B, 0x936C, 0x936D, 0x936E, 0x936F, 0x9370, 0x9371, 0x9372, 0x9373, 0x9374, 0x9375, 0x9376, 0x9377, 0x9378, 0x9379,
- 0x937A, 0x937B, 0x937C, 0x937D, 0x937E, 0x0000, 0x0000, 0x937F, 0x9380, 0x9381, 0x9382, 0x9383, 0x9384, 0x9385, 0x9386, 0x9387,
- 0x9388, 0x9389, 0x938A, 0x0000, 0x938B, 0x938C, 0x938D, 0x938E, 0x938F, 0x9390, 0x9391, 0x9392, 0x9393, 0x9394, 0x9395, 0x9396,
- 0x9397, 0x9398, 0x9399, 0x939A, 0x939B, 0x939C, 0x939D, 0x0000, 0x939E, 0x939F, 0x93A0, 0x93A1, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x93A2, 0x26A0, 0x93A3, 0x0000, 0x93A4, 0x0000, 0x93A5, 0x26A2, 0x93A6, 0x26A4, 0x93A7, 0x26A6, 0x93A8, 0x26A8, 0x93A9, 0x26AA,
- 0x93AA, 0x93AB, 0x93AC, 0x93AD, 0x93AE, 0x93AF, 0x93B0, 0x93B1, 0x93B2, 0x93B3, 0x93B4, 0x93B5, 0x93B6, 0x93B7, 0x93B8, 0x93B9,
- 0x93BA, 0x93BB, 0x93BC, 0x93BD, 0x93BE, 0x93BF, 0x93C0, 0x93C1, 0x93C2, 0x93C3, 0x93C4, 0x93C5, 0x93C6, 0x93C7, 0x93C8, 0x93C9,
- 0x93CA, 0x93CB, 0x93CC, 0x93CD, 0x93CE, 0x93CF, 0x93D0, 0x93D1, 0x93D2, 0x93D3, 0x93D4, 0x93D5, 0x93D6, 0x93D7, 0x93D8, 0x93D9,
- 0x93DA, 0x93DB, 0x93DC, 0x93DD, 0x93DE, 0x93DF, 0x93E0, 0x93E1, 0x93E2, 0x93E3, 0x93E4, 0x93E5, 0x93E6, 0x93E7, 0x93E8, 0x93E9,
- 0x93EA, 0x93EB, 0x93EC, 0x93ED, 0x93EE, 0x93EF, 0x93F0, 0x93F1, 0x93F2, 0x93F3, 0x93F4, 0x93F5, 0x93F6, 0x93F7, 0x93F8, 0x93F9,
- 0x93FA, 0x93FB, 0x93FC, 0x93FD, 0x93FE, 0x93FF, 0x9400, 0x9401, 0x9402, 0x9403, 0x9404, 0x9405, 0x9406, 0x9407, 0x9408, 0x9409,
- 0x940A, 0x940B, 0x940C, 0x940D, 0x940E, 0x940F, 0x9410, 0x9411, 0x9412, 0x9413, 0x9414, 0x9415, 0x9416, 0x9417, 0x9418, 0x9419,
- 0x941A, 0x941B, 0x941C, 0x941D, 0x941E, 0x26AC, 0x26AE, 0x26B0, 0x26B2, 0x26B4, 0x26B6, 0x26B8, 0x26BA, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x941F, 0x9420, 0x9421, 0x9422, 0x9423, 0x9424, 0x9425, 0x9426, 0x9427, 0x9428, 0x9429, 0x942A, 0x942B, 0x942C, 0x942D,
- 0x942E, 0x942F, 0x9430, 0x9431, 0x9432, 0x9433, 0x9434, 0x9435, 0x9436, 0x9437, 0x9438, 0x9439, 0x943A, 0x943B, 0x943C, 0x943D,
- 0x943E, 0x943F, 0x9440, 0x9441, 0x9442, 0x9443, 0x9444, 0x9445, 0x9446, 0x9447, 0x9448, 0x9449, 0x944A, 0x944B, 0x944C, 0x944D,
- 0x944E, 0x944F, 0x9450, 0x9451, 0x9452, 0x9453, 0x9454, 0x9455, 0x9456, 0x9457, 0x9458, 0x9459, 0x945A, 0x945B, 0x945C, 0x945D,
- 0x945E, 0x945F, 0x9460, 0x9461, 0x9462, 0x9463, 0x9464, 0x9465, 0x9466, 0x9467, 0x9468, 0x9469, 0x946A, 0x946B, 0x946C, 0x946D,
- 0x946E, 0x946F, 0x9470, 0x9471, 0x9472, 0x9473, 0x9474, 0x9475, 0x9476, 0x9477, 0x9478, 0x9479, 0x947A, 0x947B, 0x947C, 0x947D,
- 0x947E, 0x947F, 0x9480, 0x9481, 0x9482, 0x9483, 0x9484, 0x9485, 0x9486, 0x9487, 0x9488, 0x9489, 0x948A, 0x948B, 0x948C, 0x948D,
- 0x948E, 0x948F, 0x9490, 0x9491, 0x9492, 0x9493, 0x9494, 0x9495, 0x9496, 0x9497, 0x9498, 0x9499, 0x949A, 0x949B, 0x949C, 0x949D,
- 0x949E, 0x949F, 0x94A0, 0x94A1, 0x94A2, 0x94A3, 0x94A4, 0x94A5, 0x94A6, 0x94A7, 0x94A8, 0x94A9, 0x94AA, 0x94AB, 0x94AC, 0x94AD,
- 0x94AE, 0x94AF, 0x94B0, 0x94B1, 0x94B2, 0x94B3, 0x94B4, 0x94B5, 0x94B6, 0x94B7, 0x94B8, 0x94B9, 0x94BA, 0x94BB, 0x94BC, 0x94BD,
- 0x94BE, 0x94BF, 0x94C0, 0x94C1, 0x94C2, 0x94C3, 0x94C4, 0x94C5, 0x94C6, 0x94C7, 0x94C8, 0x94C9, 0x94CA, 0x94CB, 0x94CC, 0x94CD,
- 0x94CE, 0x94CF, 0x94D0, 0x94D1, 0x94D2, 0x94D3, 0x94D4, 0x94D5, 0x94D6, 0x94D7, 0x94D8, 0x94D9, 0x94DA, 0x94DB, 0x94DC, 0x0000,
- 0x0000, 0x0000, 0x94DD, 0x94DE, 0x94DF, 0x94E0, 0x94E1, 0x94E2, 0x0000, 0x0000, 0x94E3, 0x94E4, 0x94E5, 0x94E6, 0x94E7, 0x94E8,
- 0x0000, 0x0000, 0x94E9, 0x94EA, 0x94EB, 0x94EC, 0x94ED, 0x94EE, 0x0000, 0x0000, 0x94EF, 0x94F0, 0x94F1, 0x0000, 0x0000, 0x0000,
- 0x94F2, 0x94F3, 0x94F4, 0x94F5, 0x94F6, 0x94F7, 0x94F8, 0x0000, 0x94F9, 0x94FA, 0x94FB, 0x94FC, 0x94FD, 0x94FE, 0x94FF, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
-};
-extern const FX_WCHAR g_UnicodeData_Normalization_Map1[5376] = {
- 0x0066, 0x0053, 0x0053, 0x0059, 0x0020, 0x0308, 0x0061, 0x0052, 0x0304, 0x0032, 0x0033, 0x0301, 0x03BC, 0x0327, 0x0031, 0x006F,
- 0x0041, 0x0041, 0x0041, 0x0041, 0x0041, 0x0041, 0x0043, 0x0045, 0x0045, 0x0045, 0x0045, 0x0049, 0x0049, 0x0049, 0x0049, 0x0044,
- 0x004E, 0x004F, 0x004F, 0x004F, 0x004F, 0x004F, 0x004F, 0x0055, 0x0055, 0x0055, 0x0055, 0x0059, 0x0061, 0x0061, 0x0061, 0x0061,
- 0x0061, 0x0061, 0x0063, 0x0065, 0x0065, 0x0065, 0x0065, 0x0069, 0x0069, 0x0069, 0x0069, 0x006E, 0x006F, 0x006F, 0x006F, 0x006F,
- 0x006F, 0x006F, 0x0075, 0x0075, 0x0075, 0x0075, 0x0079, 0x0079, 0x0041, 0x0061, 0x0041, 0x0061, 0x0041, 0x0061, 0x0043, 0x0063,
- 0x0043, 0x0063, 0x0043, 0x0063, 0x0043, 0x0063, 0x0044, 0x0064, 0x0044, 0x0064, 0x0045, 0x0065, 0x0045, 0x0065, 0x0045, 0x0065,
- 0x0045, 0x0065, 0x0045, 0x0065, 0x0047, 0x0067, 0x0047, 0x0067, 0x0047, 0x0067, 0x0047, 0x0067, 0x0048, 0x0068, 0x0048, 0x0068,
- 0x0049, 0x0069, 0x0049, 0x0069, 0x0049, 0x0069, 0x0049, 0x0069, 0x0049, 0x004A, 0x006A, 0x004B, 0x006B, 0x004B, 0x004C, 0x006C,
- 0x004C, 0x006C, 0x004C, 0x006C, 0x004C, 0x006C, 0x004C, 0x006C, 0x004E, 0x006E, 0x004E, 0x006E, 0x004E, 0x006E, 0x006E, 0x004F,
- 0x006F, 0x004F, 0x006F, 0x004F, 0x006F, 0x0052, 0x0072, 0x0052, 0x0072, 0x0052, 0x0072, 0x0053, 0x0073, 0x0053, 0x0073, 0x0053,
- 0x0073, 0x0053, 0x0073, 0x0054, 0x0074, 0x0054, 0x0074, 0x0054, 0x0074, 0x0055, 0x0075, 0x0055, 0x0075, 0x0055, 0x0075, 0x0055,
- 0x0075, 0x0055, 0x0075, 0x0055, 0x0075, 0x0057, 0x0077, 0x0059, 0x0079, 0x0059, 0x005A, 0x007A, 0x005A, 0x007A, 0x005A, 0x007A,
- 0x0073, 0x0062, 0x0042, 0x0042, 0x0062, 0x0043, 0x0063, 0x0044, 0x0044, 0x0044, 0x0064, 0x0045, 0x0045, 0x0046, 0x0066, 0x0047,
- 0x0049, 0x004B, 0x006B, 0x006C, 0x004D, 0x004E, 0x006E, 0x004F, 0x004F, 0x006F, 0x0050, 0x0070, 0x0283, 0x0074, 0x0054, 0x0074,
- 0x0054, 0x0055, 0x0075, 0x0056, 0x0059, 0x0079, 0x005A, 0x007A, 0x01B7, 0x0041, 0x0061, 0x0049, 0x0069, 0x004F, 0x006F, 0x0055,
- 0x0075, 0x00DC, 0x00FC, 0x00DC, 0x00FC, 0x00DC, 0x00FC, 0x00DC, 0x00FC, 0x0065, 0x0041, 0x0061, 0x0041, 0x0061, 0x00C6, 0x00E6,
- 0x0047, 0x0067, 0x0047, 0x0067, 0x004B, 0x006B, 0x004F, 0x006F, 0x01EA, 0x01EB, 0x01B7, 0x0292, 0x006A, 0x0047, 0x0067, 0x004E,
- 0x006E, 0x0041, 0x0061, 0x00C6, 0x00E6, 0x00D8, 0x00F8, 0x0041, 0x0061, 0x0041, 0x0061, 0x0045, 0x0065, 0x0045, 0x0065, 0x0049,
- 0x0069, 0x0049, 0x0069, 0x004F, 0x006F, 0x004F, 0x006F, 0x0052, 0x0072, 0x0052, 0x0072, 0x0055, 0x0075, 0x0055, 0x0075, 0x0053,
- 0x0073, 0x0054, 0x0074, 0x0048, 0x0068, 0x004E, 0x0064, 0x005A, 0x007A, 0x0041, 0x0061, 0x0045, 0x0065, 0x00D6, 0x00F6, 0x00D5,
- 0x00F5, 0x004F, 0x006F, 0x022E, 0x022F, 0x0059, 0x0079, 0x006C, 0x006E, 0x0074, 0x006A, 0x0041, 0x0043, 0x0063, 0x004C, 0x0054,
- 0x0053, 0x005A, 0x0042, 0x0055, 0x0056, 0x0045, 0x0065, 0x004A, 0x006A, 0x0051, 0x0071, 0x0052, 0x0072, 0x0059, 0x0079, 0x0061,
- 0x0251, 0x0062, 0x006F, 0x0063, 0x0064, 0x0064, 0x0065, 0x0259, 0x0065, 0x0065, 0x0065, 0x0065, 0x006A, 0x0067, 0x0067, 0x0047,
- 0x0068, 0x0068, 0x0069, 0x0049, 0x006C, 0x006C, 0x006C, 0x006D, 0x006D, 0x006D, 0x006E, 0x006E, 0x006E, 0x006F, 0x0072, 0x0072,
- 0x0072, 0x0072, 0x0072, 0x0072, 0x0072, 0x0052, 0x0052, 0x0073, 0x006A, 0x0283, 0x0283, 0x0074, 0x0074, 0x0055, 0x0076, 0x0076,
- 0x0077, 0x0079, 0x0059, 0x007A, 0x007A, 0x0292, 0x0043, 0x0042, 0x0065, 0x0047, 0x0048, 0x006A, 0x006B, 0x004C, 0x0071, 0x0068,
- 0x0068, 0x0068, 0x0068, 0x006A, 0x0072, 0x0279, 0x027B, 0x0281, 0x0077, 0x0079, 0x0263, 0x006C, 0x0073, 0x0078, 0x0295, 0x0300,
- 0x0301, 0x0313, 0x0308, 0x0061, 0x0065, 0x0069, 0x006F, 0x0075, 0x0063, 0x0064, 0x0068, 0x006D, 0x0072, 0x0074, 0x0076, 0x0078,
- 0x02B9, 0x003B, 0x0020, 0x00A8, 0x0391, 0x00B7, 0x0395, 0x0397, 0x0399, 0x039F, 0x03A5, 0x03A9, 0x03CA, 0x0399, 0x03A5, 0x03B1,
- 0x03B5, 0x03B7, 0x03B9, 0x03CB, 0x03B9, 0x03C5, 0x03BF, 0x03C5, 0x03C9, 0x03B2, 0x03B8, 0x03A5, 0x03D2, 0x03D2, 0x03C6, 0x03C0,
- 0x03BA, 0x03C1, 0x03C2, 0x0398, 0x03B5, 0x03A3, 0x0415, 0x0415, 0x0413, 0x0406, 0x041A, 0x0418, 0x0423, 0x0418, 0x0438, 0x0435,
- 0x0435, 0x0433, 0x0456, 0x043A, 0x0438, 0x0443, 0x0466, 0x0467, 0x046A, 0x046B, 0x0474, 0x0475, 0x0460, 0x0461, 0x0419, 0x0439,
- 0x0420, 0x0440, 0x0413, 0x0433, 0x0413, 0x0433, 0x0413, 0x0433, 0x0416, 0x0436, 0x0417, 0x0437, 0x041A, 0x043A, 0x041A, 0x043A,
- 0x041A, 0x043A, 0x041A, 0x043A, 0x041D, 0x043D, 0x041F, 0x043F, 0x0421, 0x0441, 0x0422, 0x0442, 0x04AE, 0x04AF, 0x0425, 0x0445,
- 0x0427, 0x0447, 0x0427, 0x0447, 0x0416, 0x0436, 0x04BC, 0x04BD, 0x0416, 0x0436, 0x041A, 0x043A, 0x041B, 0x043B, 0x041D, 0x043D,
- 0x041D, 0x043D, 0x041C, 0x043C, 0x0410, 0x0430, 0x0410, 0x0430, 0x0415, 0x0435, 0x04D8, 0x04D9, 0x0416, 0x0436, 0x0417, 0x0437,
- 0x0418, 0x0438, 0x0418, 0x0438, 0x041E, 0x043E, 0x04E8, 0x04E9, 0x042D, 0x044D, 0x0423, 0x0443, 0x0423, 0x0443, 0x0423, 0x0443,
- 0x0427, 0x0447, 0x0413, 0x0433, 0x042B, 0x044B, 0x0413, 0x0433, 0x0425, 0x0445, 0x0425, 0x0445, 0x0417, 0x0437, 0x041B, 0x043B,
- 0x0F0B, 0x10DC, 0x0041, 0x00C6, 0x0042, 0x0042, 0x0044, 0x0045, 0x018E, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D,
- 0x004E, 0x004F, 0x0222, 0x0050, 0x0052, 0x0054, 0x0055, 0x0057, 0x0061, 0x0250, 0x0251, 0x1D02, 0x0062, 0x0064, 0x0065, 0x0259,
- 0x025B, 0x025C, 0x0067, 0x006B, 0x006D, 0x014B, 0x006F, 0x0254, 0x1D16, 0x1D17, 0x0070, 0x0074, 0x0075, 0x1D1D, 0x026F, 0x0076,
- 0x1D25, 0x03B2, 0x03B3, 0x03B4, 0x03C6, 0x03C7, 0x0069, 0x0072, 0x0075, 0x0076, 0x03B2, 0x03B3, 0x03C1, 0x03C6, 0x03C7, 0x0062,
- 0x0064, 0x0066, 0x006D, 0x006E, 0x0070, 0x0072, 0x0072, 0x0073, 0x0074, 0x007A, 0x0067, 0x043D, 0x004C, 0x0070, 0x0055, 0x028A,
- 0x0062, 0x0064, 0x0066, 0x0067, 0x006B, 0x006C, 0x006D, 0x006E, 0x0070, 0x0072, 0x0073, 0x0283, 0x0076, 0x0078, 0x007A, 0x0061,
- 0x0251, 0x0064, 0x0065, 0x0065, 0x0065, 0x0065, 0x0069, 0x0283, 0x0252, 0x0063, 0x0255, 0x00F0, 0x025C, 0x0066, 0x025F, 0x0261,
- 0x0265, 0x0268, 0x0269, 0x026A, 0x1D7B, 0x029D, 0x026D, 0x1D85, 0x029F, 0x0271, 0x0270, 0x0272, 0x0273, 0x0274, 0x0275, 0x0278,
- 0x0282, 0x0283, 0x01AB, 0x0289, 0x028A, 0x1D1C, 0x028B, 0x028C, 0x007A, 0x0290, 0x0291, 0x0292, 0x03B8, 0x0041, 0x0061, 0x0042,
- 0x0062, 0x0042, 0x0062, 0x0042, 0x0062, 0x0043, 0x0063, 0x0044, 0x0064, 0x0044, 0x0064, 0x0044, 0x0064, 0x0044, 0x0064, 0x0044,
- 0x0064, 0x0045, 0x0065, 0x0045, 0x0065, 0x0045, 0x0065, 0x0045, 0x0065, 0x0228, 0x0229, 0x0046, 0x0066, 0x0047, 0x0067, 0x0048,
- 0x0068, 0x0048, 0x0068, 0x0048, 0x0068, 0x0048, 0x0068, 0x0048, 0x0068, 0x0049, 0x0069, 0x00CF, 0x00EF, 0x004B, 0x006B, 0x004B,
- 0x006B, 0x004B, 0x006B, 0x004C, 0x006C, 0x004C, 0x006C, 0x004C, 0x006C, 0x004C, 0x006C, 0x004D, 0x006D, 0x004D, 0x006D, 0x004D,
- 0x006D, 0x004E, 0x006E, 0x004E, 0x006E, 0x004E, 0x006E, 0x004E, 0x006E, 0x00D5, 0x00F5, 0x00D5, 0x00F5, 0x014C, 0x014D, 0x014C,
- 0x014D, 0x0050, 0x0070, 0x0050, 0x0070, 0x0052, 0x0072, 0x0052, 0x0072, 0x0052, 0x0072, 0x0052, 0x0072, 0x0053, 0x0073, 0x0053,
- 0x0073, 0x0053, 0x0073, 0x0053, 0x0073, 0x0053, 0x0073, 0x0054, 0x0074, 0x0054, 0x0074, 0x0054, 0x0074, 0x0054, 0x0074, 0x0055,
- 0x0075, 0x0055, 0x0075, 0x0055, 0x0075, 0x0168, 0x0169, 0x016A, 0x016B, 0x0056, 0x0076, 0x0056, 0x0076, 0x0057, 0x0077, 0x0057,
- 0x0077, 0x0057, 0x0077, 0x0057, 0x0077, 0x0057, 0x0077, 0x0058, 0x0078, 0x0058, 0x0078, 0x0059, 0x0079, 0x005A, 0x007A, 0x005A,
- 0x007A, 0x005A, 0x007A, 0x0068, 0x0074, 0x0077, 0x0079, 0x0061, 0x017F, 0x0041, 0x0061, 0x0041, 0x0061, 0x0041, 0x0061, 0x0041,
- 0x0061, 0x0041, 0x0061, 0x0041, 0x0061, 0x0041, 0x0061, 0x0041, 0x0061, 0x0041, 0x0061, 0x0041, 0x0061, 0x0041, 0x0061, 0x0041,
- 0x0061, 0x0045, 0x0065, 0x0045, 0x0065, 0x0045, 0x0065, 0x0045, 0x0065, 0x0045, 0x0065, 0x0045, 0x0065, 0x0045, 0x0065, 0x0045,
- 0x0065, 0x0049, 0x0069, 0x0049, 0x0069, 0x004F, 0x006F, 0x004F, 0x006F, 0x004F, 0x006F, 0x004F, 0x006F, 0x004F, 0x006F, 0x004F,
- 0x006F, 0x004F, 0x006F, 0x004F, 0x006F, 0x004F, 0x006F, 0x004F, 0x006F, 0x004F, 0x006F, 0x004F, 0x006F, 0x0055, 0x0075, 0x0055,
- 0x0075, 0x0055, 0x0075, 0x0055, 0x0075, 0x0055, 0x0075, 0x0055, 0x0075, 0x0055, 0x0075, 0x0059, 0x0079, 0x0059, 0x0079, 0x0059,
- 0x0079, 0x0059, 0x0079, 0x03B1, 0x03B1, 0x03B1, 0x03B1, 0x03B1, 0x03B1, 0x03B1, 0x03B1, 0x0391, 0x0391, 0x0391, 0x0391, 0x0391,
- 0x0391, 0x0391, 0x0391, 0x03B5, 0x03B5, 0x03B5, 0x03B5, 0x03B5, 0x03B5, 0x0395, 0x0395, 0x0395, 0x0395, 0x0395, 0x0395, 0x03B7,
- 0x03B7, 0x03B7, 0x03B7, 0x03B7, 0x03B7, 0x03B7, 0x03B7, 0x0397, 0x0397, 0x0397, 0x0397, 0x0397, 0x0397, 0x0397, 0x0397, 0x03B9,
- 0x03B9, 0x03B9, 0x03B9, 0x03B9, 0x03B9, 0x03B9, 0x03B9, 0x0399, 0x0399, 0x0399, 0x0399, 0x0399, 0x0399, 0x0399, 0x0399, 0x03BF,
- 0x03BF, 0x03BF, 0x03BF, 0x03BF, 0x03BF, 0x039F, 0x039F, 0x039F, 0x039F, 0x039F, 0x039F, 0x03C5, 0x03C5, 0x03C5, 0x03C5, 0x03C5,
- 0x03C5, 0x03C5, 0x03C5, 0x03A5, 0x03A5, 0x03A5, 0x03A5, 0x03C9, 0x03C9, 0x03C9, 0x03C9, 0x03C9, 0x03C9, 0x03C9, 0x03C9, 0x03A9,
- 0x03A9, 0x03A9, 0x03A9, 0x03A9, 0x03A9, 0x03A9, 0x03A9, 0x03B1, 0x03B1, 0x03B5, 0x03B5, 0x03B7, 0x03B7, 0x03B9, 0x03B9, 0x03BF,
- 0x03BF, 0x03C5, 0x03C5, 0x03C9, 0x03C9, 0x03B1, 0x03B1, 0x03B1, 0x03B1, 0x03B1, 0x03B1, 0x03B1, 0x03B1, 0x0391, 0x0391, 0x0391,
- 0x0391, 0x0391, 0x0391, 0x0391, 0x0391, 0x03B7, 0x03B7, 0x03B7, 0x03B7, 0x03B7, 0x03B7, 0x03B7, 0x03B7, 0x0397, 0x0397, 0x0397,
- 0x0397, 0x0397, 0x0397, 0x0397, 0x0397, 0x03C9, 0x03C9, 0x03C9, 0x03C9, 0x03C9, 0x03C9, 0x03C9, 0x03C9, 0x03A9, 0x03A9, 0x03A9,
- 0x03A9, 0x03A9, 0x03A9, 0x03A9, 0x03A9, 0x03B1, 0x03B1, 0x03B1, 0x03B1, 0x03B1, 0x03B1, 0x03B1, 0x0391, 0x0391, 0x0391, 0x0391,
- 0x0391, 0x03B7, 0x03B7, 0x03B7, 0x03B7, 0x03B7, 0x0395, 0x0395, 0x0397, 0x0397, 0x0397, 0x03B9, 0x03B9, 0x03B9, 0x03B9, 0x03B9,
- 0x03B9, 0x0399, 0x0399, 0x0399, 0x0399, 0x03C5, 0x03C5, 0x03C5, 0x03C5, 0x03C1, 0x03C1, 0x03C5, 0x03C5, 0x03A5, 0x03A5, 0x03A5,
- 0x03A5, 0x03A1, 0x03C9, 0x03C9, 0x03C9, 0x03C9, 0x03C9, 0x039F, 0x039F, 0x03A9, 0x03A9, 0x03A9, 0x00B4, 0x0314, 0x0020, 0x0020,
- 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x2010, 0x0333, 0x002E, 0x0020, 0x0020, 0x0030, 0x0069,
- 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x002B, 0x2212, 0x003D, 0x0028, 0x0029, 0x006E, 0x0030, 0x0031, 0x0032, 0x0033,
- 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x002B, 0x2212, 0x003D, 0x0028, 0x0029, 0x0061, 0x0065, 0x006F, 0x0078, 0x0259,
- 0x0043, 0x0190, 0x0067, 0x0048, 0x0048, 0x0048, 0x0068, 0x0068, 0x0049, 0x0049, 0x004C, 0x006C, 0x004E, 0x0050, 0x0051, 0x0052,
- 0x0052, 0x0052, 0x0052, 0x0052, 0x0056, 0x005A, 0x03A9, 0x01B1, 0x005A, 0x004B, 0x00C5, 0x0042, 0x0043, 0x0065, 0x0065, 0x0045,
- 0x0046, 0x004D, 0x006F, 0x05D0, 0x05D1, 0x05D2, 0x05D3, 0x0069, 0x03C0, 0x03B3, 0x0393, 0x03A0, 0x2211, 0x0044, 0x0064, 0x0065,
- 0x0069, 0x006A, 0x0049, 0x0056, 0x0058, 0x004C, 0x0043, 0x0044, 0x004D, 0x0069, 0x0076, 0x0078, 0x006C, 0x0063, 0x0064, 0x006D,
- 0x2203, 0x2208, 0x220B, 0x3008, 0x3009, 0x0062, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x0041,
- 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051,
- 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067,
- 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077,
- 0x0078, 0x0079, 0x007A, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x0030, 0x0031, 0x0032,
- 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039,
- 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x004C, 0x006C, 0x004C, 0x0050, 0x0052, 0x0061, 0x0074,
- 0x0048, 0x0068, 0x004B, 0x006B, 0x005A, 0x007A, 0x0076, 0x0057, 0x0058, 0x0076, 0x006A, 0x0056, 0x2D61, 0x6BCD, 0x6C11, 0x864E,
- 0x897F, 0x89D2, 0x957F, 0x9752, 0x98DF, 0x9AA8, 0x9B3C, 0x9EA6, 0x9EC4, 0x9F9F, 0x4E00, 0x4E28, 0x4E36, 0x4E3F, 0x4E59, 0x4E85,
- 0x4E8C, 0x4EA0, 0x4EBA, 0x513F, 0x5165, 0x516B, 0x5182, 0x5196, 0x51AB, 0x51E0, 0x51F5, 0x5200, 0x529B, 0x52F9, 0x5315, 0x531A,
- 0x5338, 0x5341, 0x535C, 0x5369, 0x5382, 0x53B6, 0x53C8, 0x53E3, 0x56D7, 0x571F, 0x58EB, 0x5902, 0x590A, 0x5915, 0x5927, 0x5973,
- 0x5B50, 0x5B80, 0x5BF8, 0x5C0F, 0x5C22, 0x5C38, 0x5C6E, 0x5C71, 0x5DDB, 0x5DE5, 0x5DF1, 0x5DFE, 0x5E72, 0x5E7A, 0x5E7F, 0x5EF4,
- 0x5EFE, 0x5F0B, 0x5F13, 0x5F50, 0x5F61, 0x5F73, 0x5FC3, 0x6208, 0x6236, 0x624B, 0x652F, 0x6534, 0x6587, 0x6597, 0x65A4, 0x65B9,
- 0x65E0, 0x65E5, 0x66F0, 0x6708, 0x6728, 0x6B20, 0x6B62, 0x6B79, 0x6BB3, 0x6BCB, 0x6BD4, 0x6BDB, 0x6C0F, 0x6C14, 0x6C34, 0x706B,
- 0x722A, 0x7236, 0x723B, 0x723F, 0x7247, 0x7259, 0x725B, 0x72AC, 0x7384, 0x7389, 0x74DC, 0x74E6, 0x7518, 0x751F, 0x7528, 0x7530,
- 0x758B, 0x7592, 0x7676, 0x767D, 0x76AE, 0x76BF, 0x76EE, 0x77DB, 0x77E2, 0x77F3, 0x793A, 0x79B8, 0x79BE, 0x7A74, 0x7ACB, 0x7AF9,
- 0x7C73, 0x7CF8, 0x7F36, 0x7F51, 0x7F8A, 0x7FBD, 0x8001, 0x800C, 0x8012, 0x8033, 0x807F, 0x8089, 0x81E3, 0x81EA, 0x81F3, 0x81FC,
- 0x820C, 0x821B, 0x821F, 0x826E, 0x8272, 0x8278, 0x864D, 0x866B, 0x8840, 0x884C, 0x8863, 0x897E, 0x898B, 0x89D2, 0x8A00, 0x8C37,
- 0x8C46, 0x8C55, 0x8C78, 0x8C9D, 0x8D64, 0x8D70, 0x8DB3, 0x8EAB, 0x8ECA, 0x8F9B, 0x8FB0, 0x8FB5, 0x9091, 0x9149, 0x91C6, 0x91CC,
- 0x91D1, 0x9577, 0x9580, 0x961C, 0x96B6, 0x96B9, 0x96E8, 0x9751, 0x975E, 0x9762, 0x9769, 0x97CB, 0x97ED, 0x97F3, 0x9801, 0x98A8,
- 0x98DB, 0x98DF, 0x9996, 0x9999, 0x99AC, 0x9AA8, 0x9AD8, 0x9ADF, 0x9B25, 0x9B2F, 0x9B32, 0x9B3C, 0x9B5A, 0x9CE5, 0x9E75, 0x9E7F,
- 0x9EA5, 0x9EBB, 0x9EC3, 0x9ECD, 0x9ED1, 0x9EF9, 0x9EFD, 0x9F0E, 0x9F13, 0x9F20, 0x9F3B, 0x9F4A, 0x9F52, 0x9F8D, 0x9F9C, 0x9FA0,
- 0x0020, 0x3012, 0x5341, 0x5344, 0x5345, 0x1100, 0x1101, 0x11AA, 0x1102, 0x11AC, 0x11AD, 0x1103, 0x1104, 0x1105, 0x11B0, 0x11B1,
- 0x11B2, 0x11B3, 0x11B4, 0x11B5, 0x111A, 0x1106, 0x1107, 0x1108, 0x1121, 0x1109, 0x110A, 0x110B, 0x110C, 0x110D, 0x110E, 0x110F,
- 0x1110, 0x1111, 0x1112, 0x1161, 0x1162, 0x1163, 0x1164, 0x1165, 0x1166, 0x1167, 0x1168, 0x1169, 0x116A, 0x116B, 0x116C, 0x116D,
- 0x116E, 0x116F, 0x1170, 0x1171, 0x1172, 0x1173, 0x1174, 0x1175, 0x1160, 0x1114, 0x1115, 0x11C7, 0x11C8, 0x11CC, 0x11CE, 0x11D3,
- 0x11D7, 0x11D9, 0x111C, 0x11DD, 0x11DF, 0x111D, 0x111E, 0x1120, 0x1122, 0x1123, 0x1127, 0x1129, 0x112B, 0x112C, 0x112D, 0x112E,
- 0x112F, 0x1132, 0x1136, 0x1140, 0x1147, 0x114C, 0x11F1, 0x11F2, 0x1157, 0x1158, 0x1159, 0x1184, 0x1185, 0x1188, 0x1191, 0x1192,
- 0x1194, 0x119E, 0x11A1, 0x4E00, 0x4E8C, 0x4E09, 0x56DB, 0x4E0A, 0x4E2D, 0x4E0B, 0x7532, 0x4E59, 0x4E19, 0x4E01, 0x5929, 0x5730,
- 0x4EBA, 0x554F, 0x5E7C, 0x6587, 0x7B8F, 0x1100, 0x1102, 0x1103, 0x1105, 0x1106, 0x1107, 0x1109, 0x110B, 0x110C, 0x110E, 0x110F,
- 0x1110, 0x1111, 0x1112, 0x4E00, 0x4E8C, 0x4E09, 0x56DB, 0x4E94, 0x516D, 0x4E03, 0x516B, 0x4E5D, 0x5341, 0x6708, 0x706B, 0x6C34,
- 0x6728, 0x91D1, 0x571F, 0x65E5, 0x682A, 0x6709, 0x793E, 0x540D, 0x7279, 0x8CA1, 0x795D, 0x52B4, 0x79D8, 0x7537, 0x5973, 0x9069,
- 0x512A, 0x5370, 0x6CE8, 0x9805, 0x4F11, 0x5199, 0x6B63, 0x4E0A, 0x4E2D, 0x4E0B, 0x5DE6, 0x53F3, 0x533B, 0x5B97, 0x5B66, 0x76E3,
- 0x4F01, 0x8CC7, 0x5354, 0x591C, 0x30A2, 0x30A4, 0x30A6, 0x30A8, 0x30AA, 0x30AB, 0x30AD, 0x30AF, 0x30B1, 0x30B3, 0x30B5, 0x30B7,
- 0x30B9, 0x30BB, 0x30BD, 0x30BF, 0x30C1, 0x30C4, 0x30C6, 0x30C8, 0x30CA, 0x30CB, 0x30CC, 0x30CD, 0x30CE, 0x30CF, 0x30D2, 0x30D5,
- 0x30D8, 0x30DB, 0x30DE, 0x30DF, 0x30E0, 0x30E1, 0x30E2, 0x30E4, 0x30E6, 0x30E8, 0x30E9, 0x30EA, 0x30EB, 0x30EC, 0x30ED, 0x30EF,
- 0x30F0, 0x30F1, 0x30F2, 0x4E22, 0x5E76, 0x5E7A, 0x5E72, 0x4E71, 0x4E98, 0x4E9A, 0x4F2B, 0x5E03, 0x5360, 0x6765, 0x4FA3, 0x4FE3,
- 0x7CFB, 0x4FA0, 0x4F25, 0x4FE9, 0x4ED3, 0x4E2A, 0x4EEC, 0x4F26, 0x4F1F, 0x4FA7, 0x4FA6, 0x4F2A, 0x6770, 0x4F27, 0x4F1E, 0x5907,
- 0x5BB6, 0x4F63, 0x506C, 0x4F20, 0x4F1B, 0x503A, 0x4F24, 0x503E, 0x507B, 0x4EC5, 0x4F65, 0x4FA8, 0x4EC6, 0x4FA5, 0x507E, 0x96C7,
- 0x4EF7, 0x4EEA, 0x4FAC, 0x4EBF, 0x4FED, 0x50A7, 0x4FE6, 0x4FAA, 0x5C3D, 0x507F, 0x4F18, 0x50A8, 0x4FEA, 0x50A9, 0x50A5, 0x4FE8,
- 0x51F6, 0x5151, 0x513F, 0x5156, 0x5185, 0x4E24, 0x518C, 0x80C4, 0x5199, 0x5E42, 0x51BB, 0x51DB, 0x51EF, 0x522B, 0x5220, 0x522D,
- 0x5219, 0x5239, 0x521A, 0x5265, 0x5250, 0x5240, 0x521B, 0x522C, 0x5212, 0x5267, 0x5218, 0x523D, 0x523F, 0x5251, 0x5242, 0x52B2,
- 0x52A8, 0x52D6, 0x52A1, 0x80DC, 0x52B3, 0x52BF, 0x52A2, 0x52CB, 0x52B1, 0x529D, 0x5300, 0x5326, 0x6C47, 0x532E, 0x533A, 0x534F,
- 0x6064, 0x5374, 0x538D, 0x538C, 0x5389, 0x53A3, 0x53C2, 0x4E1B, 0x54A4, 0x5434, 0x5450, 0x5415, 0x5458, 0x55B1, 0x5457, 0x5FF5,
- 0x95EE, 0x54D1, 0x542F, 0x5524, 0x4E27, 0x4E54, 0x5355, 0x54DF, 0x545B, 0x556C, 0x551D, 0x5417, 0x545C, 0x5522, 0x54D4, 0x53F9,
- 0x55BD, 0x5455, 0x5567, 0x5C1D, 0x551B, 0x54D7, 0x5520, 0x5578, 0x53FD, 0x54D3, 0x5452, 0x5574, 0x6076, 0x5618, 0x549D, 0x54D2,
- 0x54DD, 0x54D5, 0x55F3, 0x54D9, 0x55B7, 0x5428, 0x549B, 0x5413, 0x54DC, 0x5C1D, 0x565C, 0x556E, 0x5456, 0x5499, 0x4EB8, 0x55BE,
- 0x4E25, 0x5624, 0x556D, 0x55EB, 0x56A3, 0x5181, 0x5453, 0x5570, 0x5631, 0x56F1, 0x56F5, 0x56FD, 0x56F4, 0x56ED, 0x5706, 0x56FE,
- 0x56E2, 0x57AD, 0x6267, 0x575A, 0x57A9, 0x57DA, 0x5C27, 0x62A5, 0x573A, 0x5757, 0x8314, 0x57B2, 0x57D8, 0x6D82, 0x51A2, 0x575E,
- 0x57D9, 0x5C18, 0x5811, 0x57AB, 0x5760, 0x5815, 0x575F, 0x57A6, 0x575B, 0x538B, 0x5792, 0x5739, 0x5786, 0x574F, 0x5785, 0x575C,
- 0x575D, 0x58EE, 0x58F6, 0x58F8, 0x5BFF, 0x591F, 0x68A6, 0x4F19, 0x5939, 0x5942, 0x5965, 0x5941, 0x593A, 0x594B, 0x59F9, 0x5986,
- 0x59D7, 0x5978, 0x5A31, 0x5A04, 0x5987, 0x5A05, 0x5A32, 0x59AB, 0x5AAA, 0x5988, 0x59AA, 0x59A9, 0x5A34, 0x5A73, 0x5A06, 0x5A75,
- 0x5A07, 0x5AF1, 0x5AD2, 0x5B37, 0x5AD4, 0x5A74, 0x5A76, 0x5A08, 0x5B59, 0x5B66, 0x5B6A, 0x5BAB, 0x5BDD, 0x5B9E, 0x5B81, 0x5BA1,
- 0x5199, 0x5BBD, 0x5BA0, 0x5B9D, 0x5C06, 0x4E13, 0x5BFB, 0x5BF9, 0x5BFC, 0x5C34, 0x5C4A, 0x5C38, 0x5C49, 0x5C61, 0x5C42, 0x5C5F,
- 0x5C66, 0x5C5E, 0x5188, 0x5C98, 0x5C9B, 0x5CE1, 0x5D03, 0x5C97, 0x4ED1, 0x5CE5, 0x5C9A, 0x5D5D, 0x5D2D, 0x5C96, 0x5D5A, 0x5D02,
- 0x5CE4, 0x5CE3, 0x5CC4, 0x5D04, 0x5C99, 0x5D58, 0x5CAD, 0x5C7F, 0x5CB3, 0x5CBF, 0x5CE6, 0x5DC5, 0x5DEF, 0x5E05, 0x5E08, 0x5E10,
- 0x5E26, 0x5E27, 0x5E0F, 0x5E3C, 0x5E3B, 0x5E1C, 0x5E01, 0x5E2E, 0x5E31, 0x5E72, 0x51E0, 0x5E93, 0x5395, 0x53A2, 0x53A6, 0x53A8,
- 0x53AE, 0x5E99, 0x5382, 0x5E91, 0x5E9F, 0x5E7F, 0x5EEA, 0x5E90, 0x5385, 0x5F11, 0x5F2A, 0x5F20, 0x5F3A, 0x5F39, 0x5F25, 0x5F2F,
- 0x5F66, 0x540E, 0x5F84, 0x4ECE, 0x5F95, 0x590D, 0x5F81, 0x5F7B, 0x6052, 0x803B, 0x60A6, 0x6005, 0x95F7, 0x6076, 0x607C, 0x607D,
- 0x607B, 0x7231, 0x60EC, 0x60AB, 0x6006, 0x607A, 0x5FFE, 0x6001, 0x6120, 0x60E8, 0x60ED, 0x6078, 0x60EF, 0x6004, 0x6002, 0x8651,
- 0x60AD, 0x5E86, 0x5FE7, 0x60EB, 0x601C, 0x51ED, 0x6126, 0x616D, 0x60EE, 0x6124, 0x60AF, 0x6003, 0x5BAA, 0x5FC6, 0x6073, 0x5E94,
- 0x603F, 0x61D4, 0x603C, 0x61D1, 0x6079, 0x60E9, 0x61D2, 0x6000, 0x60AC, 0x5FCF, 0x60E7, 0x6151, 0x604B, 0x6206, 0x620B, 0x6217,
- 0x622C, 0x6218, 0x620F, 0x6237, 0x629B, 0x631F, 0x820D, 0x626A, 0x5377, 0x626B, 0x62A1, 0x6323, 0x6302, 0x91C7, 0x62E3, 0x626C,
- 0x6362, 0x6325, 0x635F, 0x6447, 0x6363, 0x62A2, 0x63B4, 0x63BC, 0x6402, 0x631A, 0x62A0, 0x629F, 0x63BA, 0x635E, 0x6491, 0x6320,
- 0x6322, 0x63B8, 0x62E8, 0x629A, 0x6251, 0x63FF, 0x631E, 0x631D, 0x6361, 0x62E5, 0x63B3, 0x62E9, 0x51FB, 0x6321, 0x62C5, 0x636E,
- 0x6324, 0x62DF, 0x6448, 0x62E7, 0x6401, 0x63B7, 0x6269, 0x64B7, 0x6446, 0x64DE, 0x64B8, 0x6270, 0x6445, 0x64B5, 0x62E2, 0x62E6,
- 0x6484, 0x6400, 0x64BA, 0x643A, 0x6444, 0x6512, 0x631B, 0x644A, 0x6405, 0x63FD, 0x668B, 0x8D25, 0x53D9, 0x654C, 0x6570, 0x655B,
- 0x6BD9, 0x6593, 0x65A9, 0x65AD, 0x4E8E, 0x5347, 0x65F6, 0x664B, 0x663C, 0x6655, 0x6656, 0x65F8, 0x7545, 0x6682, 0x6635, 0x6654,
- 0x5386, 0x6619, 0x6653, 0x66A7, 0x65F7, 0x663D, 0x6652, 0x4E66, 0x4F1A, 0x80E7, 0x4E1C, 0x6805, 0x6746, 0x6800, 0x67A7, 0x6761,
- 0x67AD, 0x5F03, 0x67A8, 0x67A3, 0x680B, 0x6808, 0x6816, 0x6860, 0x6768, 0x67AB, 0x6862, 0x4E1A, 0x6781, 0x6769, 0x8363, 0x6864,
- 0x6784, 0x67AA, 0x6760, 0x68BF, 0x6920, 0x6901, 0x6868, 0x6869, 0x4E50, 0x679E, 0x697C, 0x6807, 0x67A2, 0x6837, 0x6734, 0x6811,
- 0x6866, 0x6861, 0x6865, 0x673A, 0x692D, 0x6A2A, 0x6AA9, 0x69DC, 0x67FD, 0x6863, 0x6867, 0x69DA, 0x68C0, 0x6A2F, 0x68BC, 0x53F0,
- 0x69DF, 0x67E0, 0x69DB, 0x82D8, 0x67DC, 0x6A79, 0x6988, 0x6809, 0x691F, 0x6A7C, 0x680E, 0x6A71, 0x69E0, 0x680C, 0x67A5, 0x6A65,
- 0x6987, 0x680A, 0x6989, 0x68C2, 0x6A31, 0x680F, 0x6743, 0x6924, 0x683E, 0x6984, 0x94A6, 0x6B27, 0x6B24, 0x6B22, 0x5C81, 0x5386,
- 0x5F52, 0x6B81, 0x6B8B, 0x6B92, 0x6B87, 0x6B9A, 0x6B93, 0x6BA1, 0x6B7C, 0x6740, 0x58F3, 0x6BC1, 0x6BB4, 0x6BF5, 0x6BE1, 0x6C07,
- 0x6C14, 0x6C22, 0x6C29, 0x6C32, 0x51FC, 0x51B3, 0x51B1, 0x6CA1, 0x51B5, 0x6CC4, 0x6C79, 0x6D43, 0x6CFE, 0x51C9, 0x51C4, 0x6CEA,
- 0x6E0C, 0x51C0, 0x6CA6, 0x6E0A, 0x6D9E, 0x6D45, 0x6DA3, 0x51CF, 0x6CA8, 0x6DA1, 0x6D4B, 0x6D51, 0x51D1, 0x6D48, 0x6D8C, 0x6D07,
- 0x6C64, 0x6CA9, 0x51C6, 0x6C9F, 0x6E29, 0x6DA2, 0x6E7F, 0x6CA7, 0x706D, 0x6DA4, 0x8365, 0x6CAA, 0x6EDE, 0x6E17, 0x6D52, 0x6D50,
- 0x6EDA, 0x6EE1, 0x6E14, 0x6E87, 0x6CA4, 0x6C49, 0x6D9F, 0x6E0D, 0x6DA8, 0x6E10, 0x6D46, 0x988D, 0x6CFC, 0x6D01, 0x6F5C, 0x6DA6,
- 0x6D54, 0x6E83, 0x6DA0, 0x6DA9, 0x6D47, 0x6D9D, 0x6C84, 0x6DA7, 0x6E11, 0x6CFD, 0x6EEA, 0x6CF6, 0x6D4D, 0x6D4A, 0x6D53, 0x6E7F,
- 0x6CDE, 0x6D4E, 0x6D9B, 0x6EE5, 0x6F4D, 0x6EE8, 0x6E85, 0x6CFA, 0x6EE4, 0x6EE2, 0x6E0E, 0x6CFB, 0x6D4F, 0x6FD2, 0x6CF8, 0x6CA5,
- 0x6F47, 0x6F46, 0x6F74, 0x6CF7, 0x6FD1, 0x6F4B, 0x6F9C, 0x6CA3, 0x6EE0, 0x6D12, 0x6EE9, 0x704F, 0x6E7E, 0x6EE6, 0x6EDF, 0x707E,
- 0x4E3A, 0x4E4C, 0x70C3, 0x65E0, 0x70BC, 0x709C, 0x70DF, 0x8315, 0x7115, 0x70E6, 0x7080, 0x8367, 0x709D, 0x70ED, 0x70BD, 0x70E8,
- 0x706F, 0x7096, 0x70E7, 0x70EB, 0x7116, 0x8425, 0x707F, 0x70DB, 0x70E9, 0x70EC, 0x7118, 0x70C1, 0x7089, 0x70C2, 0x4E89, 0x4E3A,
- 0x7237, 0x5C14, 0x5899, 0x724D, 0x7275, 0x8366, 0x7266, 0x728A, 0x727A, 0x72B6, 0x72ED, 0x72C8, 0x72F0, 0x72B9, 0x72F2, 0x72B8,
- 0x72F1, 0x72EE, 0x5956, 0x72EC, 0x72EF, 0x7303, 0x72DE, 0x83B7, 0x730E, 0x72B7, 0x517D, 0x736D, 0x732E, 0x7315, 0x7321, 0x73B0,
- 0x73D0, 0x73F2, 0x73AE, 0x739A, 0x7410, 0x7476, 0x83B9, 0x739B, 0x7405, 0x73B1, 0x740F, 0x740E, 0x7391, 0x7477, 0x73F0, 0x73AF,
- 0x7399, 0x73BA, 0x743C, 0x73D1, 0x748E, 0x74D2, 0x74EF, 0x74EE, 0x4EA7, 0x4EA7, 0x4EA9, 0x6BD5, 0x753B, 0x7572, 0x5F02, 0x5F53,
- 0x7574, 0x53E0, 0x75C9, 0x9178, 0x75F9, 0x75D6, 0x75AF, 0x75A1, 0x75EA, 0x7617, 0x75AE, 0x759F, 0x75AD, 0x7618, 0x7597, 0x75E8,
- 0x75EB, 0x7605, 0x75A0, 0x762A, 0x75D2, 0x7596, 0x75AC, 0x765E, 0x7663, 0x763F, 0x763E, 0x75C8, 0x762B, 0x766B, 0x53D1, 0x7691,
- 0x75B1, 0x76B2, 0x76B1, 0x676F, 0x76D7, 0x76CF, 0x5C3D, 0x76D1, 0x76D8, 0x5362, 0x8361, 0x7726, 0x4F17, 0x56F0, 0x7741, 0x7750,
- 0x772F, 0x7792, 0x4E86, 0x7786, 0x7751, 0x772C, 0x77A9, 0x77EB, 0x7845, 0x70AE, 0x7841, 0x7856, 0x7817, 0x781A, 0x7855, 0x7800,
- 0x786E, 0x7801, 0x7859, 0x7816, 0x789C, 0x789B, 0x77F6, 0x7857, 0x785A, 0x7840, 0x788D, 0x77FF, 0x783A, 0x783E, 0x77FE, 0x783B,
- 0x7984, 0x7978, 0x796F, 0x794E, 0x5FA1, 0x7985, 0x793C, 0x7977, 0x79C3, 0x7C7C, 0x7A0E, 0x79C6, 0x68F1, 0x79CD, 0x79F0, 0x7A23,
- 0x79EF, 0x9896, 0x79FE, 0x7A51, 0x79FD, 0x7A33, 0x7A9D, 0x6D3C, 0x7A77, 0x7A91, 0x7A8E, 0x7AAD, 0x7AA5, 0x7A9C, 0x7A8D, 0x7AA6,
- 0x7A83, 0x7ADE, 0x7B14, 0x7B0B, 0x7B15, 0x7B3A, 0x7B5D, 0x8282, 0x8303, 0x7B51, 0x7BA7, 0x7B7C, 0x7B03, 0x7B5B, 0x7B5A, 0x7BA6,
- 0x7BD3, 0x7BAA, 0x7B80, 0x7BD1, 0x7BAB, 0x6A90, 0x7B5C, 0x7B7E, 0x5E18, 0x7BEE, 0x7B79, 0x7B93, 0x7BEF, 0x7BA8, 0x7C41, 0x7B3C,
- 0x7B7E, 0x7B3E, 0x7BF1, 0x7BA9, 0x5401, 0x5986, 0x7CA4, 0x7CC1, 0x7CAA, 0x7CAE, 0x7CF5, 0x7C9D, 0x7C74, 0x7C9C, 0x7EA0, 0x7EAA,
- 0x7EA3, 0x7EA6, 0x7EA2, 0x7EA1, 0x7EA5, 0x7EA8, 0x7EAB, 0x7EB9, 0x7EB3, 0x7EBD, 0x7EBE, 0x7EAF, 0x7EB0, 0x7EB1, 0x7EB8, 0x7EA7,
- 0x7EB7, 0x7EAD, 0x7EB4, 0x7EBA, 0x624E, 0x624E, 0x7EC6, 0x7EC2, 0x7EC1, 0x7EC5, 0x7EBB, 0x7ECD, 0x7EC0, 0x7ECB, 0x7ED0, 0x7ECC,
- 0x7EC8, 0x5F26, 0x7EC4, 0x7ECA, 0x7ED7, 0x7ED3, 0x7EDD, 0x7EE6, 0x7ED4, 0x7EDE, 0x7EDC, 0x7EDA, 0x7ED9, 0x7ED2, 0x7ED6, 0x7EDF,
- 0x4E1D, 0x7EDB, 0x7EE2, 0x7ED1, 0x7EE1, 0x7EE0, 0x7EE8, 0x7EE5, 0x7ECF, 0x7EFC, 0x7F0D, 0x7EFF, 0x7EF8, 0x7EFB, 0x7EF6, 0x7EF4,
- 0x7EFE, 0x7EB2, 0x7F51, 0x7F00, 0x7EB6, 0x7EFA, 0x7EEE, 0x7EFD, 0x7EF0, 0x7EEB, 0x7EF5, 0x7EF2, 0x7F01, 0x7D27, 0x7EEF, 0x7EEA,
- 0x7F03, 0x7F04, 0x7F02, 0x7EBF, 0x7F09, 0x7F0E, 0x7F14, 0x7F17, 0x7F18, 0x7F0C, 0x7F16, 0x7F13, 0x7F05, 0x7EAC, 0x7F11, 0x7F08,
- 0x7EC3, 0x7F0F, 0x7F07, 0x81F4, 0x8426, 0x7F19, 0x7F22, 0x7F12, 0x7EC9, 0x7F23, 0x7F1E, 0x7F1A, 0x7F1C, 0x7F1F, 0x7F1B, 0x53BF,
- 0x7F1D, 0x7F29, 0x7EB5, 0x7F27, 0x7F26, 0x7D77, 0x7F15, 0x7F25, 0x603B, 0x7EE9, 0x7EF7, 0x7F2B, 0x7F2A, 0x7F2F, 0x7EC7, 0x7F2E,
- 0x7F2D, 0x7ED5, 0x7EE3, 0x7F0B, 0x7EF3, 0x7ED8, 0x7CFB, 0x8327, 0x7F33, 0x7F32, 0x7F34, 0x7ECE, 0x7EE7, 0x7F24, 0x7F31, 0x7F2C,
- 0x7EA9, 0x7EED, 0x7F20, 0x7F28, 0x7EA4, 0x7F35, 0x7F06, 0x94B5, 0x7F42, 0x7F5A, 0x9A82, 0x7F62, 0x7F57, 0x7F74, 0x7F81, 0x8288,
- 0x7F9F, 0x7FA1, 0x4E49, 0x81BB, 0x4E60, 0x7FC6, 0x7FDA, 0x7FD8, 0x7FD9, 0x8027, 0x5723, 0x95FB, 0x8054, 0x806A, 0x58F0, 0x8038,
- 0x8069, 0x8042, 0x804C, 0x804D, 0x542C, 0x804B, 0x8083, 0x80C1, 0x8109, 0x80EB, 0x8131, 0x80C0, 0x80BE, 0x80E8, 0x8136, 0x8111,
- 0x80BF, 0x811A, 0x80A0, 0x817D, 0x8158, 0x80A4, 0x80F6, 0x817B, 0x80C6, 0x810D, 0x8113, 0x8138, 0x8110, 0x8191, 0x814A, 0x80EA,
- 0x810F, 0x8114, 0x81DC, 0x5367, 0x4E34, 0x53F0, 0x4E0E, 0x5174, 0x4E3E, 0x65E7, 0x8231, 0x8223, 0x8230, 0x823B, 0x8270, 0x8273,
- 0x82C4, 0x520D, 0x82CE, 0x5179, 0x8346, 0x8C46, 0x5E84, 0x830E, 0x835A, 0x82CB, 0x534E, 0x70DF, 0x82CC, 0x83B1, 0x4E07, 0x83B4,
- 0x53F6, 0x836D, 0x7740, 0x82C7, 0x8364, 0x641C, 0x83B3, 0x8385, 0x82CD, 0x836A, 0x76D6, 0x83B2, 0x82C1, 0x83BC, 0x835C, 0x848C,
- 0x848B, 0x8471, 0x8311, 0x836B, 0x8368, 0x8487, 0x835E, 0x836C, 0x83B8, 0x835B, 0x8489, 0x829C, 0x8427, 0x84E3, 0x835F, 0x84DF,
- 0x8297, 0x59DC, 0x8537, 0x83B6, 0x8350, 0x8428, 0x8360, 0x501F, 0x84DD, 0x8369, 0x827A, 0x836F, 0x85AE, 0x82C8, 0x853C, 0x853A,
- 0x841A, 0x8572, 0x82A6, 0x82CF, 0x8574, 0x82F9, 0x8616, 0x85D3, 0x8539, 0x830F, 0x5170, 0x84E0, 0x841D, 0x5904, 0x865A, 0x864F,
- 0x53F7, 0x4E8F, 0x866C, 0x86F1, 0x8715, 0x86AC, 0x8680, 0x732C, 0x867E, 0x8671, 0x8717, 0x86F3, 0x8682, 0x8424, 0x877C, 0x8780,
- 0x86F0, 0x8748, 0x87A8, 0x866E, 0x8749, 0x86F2, 0x866B, 0x86CF, 0x8681, 0x8683, 0x8747, 0x867F, 0x874E, 0x86F4, 0x877E, 0x869D,
- 0x8721, 0x86CE, 0x87CF, 0x86CA, 0x8695, 0x86EE, 0x4F17, 0x672F, 0x536B, 0x51B2, 0x886E, 0x8885, 0x8865, 0x88C5, 0x91CC, 0x5236,
- 0x590D, 0x88C8, 0x8886, 0x88E4, 0x88E2, 0x7F21, 0x891B, 0x4EB5, 0x88E5, 0x8884, 0x88E3, 0x88C6, 0x8934, 0x889C, 0x886C, 0x88AD,
- 0x8955, 0x89C1, 0x89C4, 0x89C5, 0x89C6, 0x89C7, 0x89CB, 0x89CD, 0x89CE, 0x4EB2, 0x89CA, 0x89CF, 0x89D0, 0x89D1, 0x89C9, 0x89C8,
- 0x89CC, 0x89C2, 0x89DE, 0x89EF, 0x89E6, 0x8BA2, 0x8BA3, 0x8BA1, 0x8BAF, 0x8BA7, 0x8BA8, 0x8BA6, 0x8BAD, 0x8BAA, 0x8BAB, 0x8BAC,
- 0x8BB0, 0x8BB9, 0x8BB6, 0x8BBC, 0x8BC0, 0x8BB7, 0x8BBF, 0x8BBE, 0x8BB8, 0x8BC9, 0x8BC3, 0x8BCA, 0x8BC1, 0x8BC2, 0x8BCB, 0x8BB5,
- 0x8BC8, 0x8BD2, 0x8BCF, 0x8BC4, 0x8BCE, 0x8BC5, 0x8BCD, 0x548F, 0x8BE9, 0x8BE2, 0x8BE3, 0x8BD5, 0x8BD7, 0x8BE7, 0x8BDF, 0x8BE1,
- 0x8BE0, 0x8BD8, 0x8BDD, 0x8BE5, 0x8BE6, 0x8BDC, 0x8BD9, 0x8BD6, 0x8BD4, 0x8BDB, 0x8BD3, 0x5938, 0x5FD7, 0x8BA4, 0x8BF3, 0x8BF6,
- 0x8BDE, 0x8BF1, 0x8BEE, 0x8BED, 0x8BDA, 0x8BEB, 0x8BEC, 0x8BEF, 0x8BF0, 0x8BF5, 0x8BF2, 0x8BF4, 0x8C01, 0x8BFE, 0x8C07, 0x8BFD,
- 0x8C0A, 0x8C03, 0x8C04, 0x8C06, 0x8C08, 0x8BFF, 0x8BF7, 0x8BE4, 0x8BF9, 0x8BFC, 0x8C05, 0x8BBA, 0x8C02, 0x8C00, 0x8C0D, 0x8C1E,
- 0x8C1D, 0x8C25, 0x8BE8, 0x8C14, 0x8C1B, 0x8C10, 0x8C0F, 0x8C15, 0x8C18, 0x8BB3, 0x8C19, 0x8C0C, 0x8BBD, 0x8BF8, 0x8C1A, 0x8C16,
- 0x8BFA, 0x8C0B, 0x8C12, 0x8C13, 0x8A8A, 0x8BCC, 0x8C0E, 0x8C1C, 0x8C27, 0x8C11, 0x8C21, 0x8C24, 0x8C26, 0x8BB2, 0x8C22, 0x8C23,
- 0x8C1F, 0x8C2A, 0x8C2C, 0x8BB4, 0x8C28, 0x8C29, 0x8BC1, 0x8C32, 0x8BA5, 0x8C2E, 0x8BC6, 0x8C2F, 0x8C2D, 0x8C31, 0x8C35, 0x8BD1,
- 0x8BAE, 0x8C34, 0x62A4, 0x8BEA, 0x8A89, 0x8C2B, 0x8BFB, 0x53D8, 0x8A5F, 0x96E0, 0x8C17, 0x8BA9, 0x8C30, 0x8C36, 0x8D5E, 0x8C20,
- 0x8C33, 0x5C82, 0x7AD6, 0x4E30, 0x732A, 0x8C6E, 0x732B, 0x8D1D, 0x8D1E, 0x8D1F, 0x8D22, 0x8D21, 0x8D2B, 0x8D27, 0x8D29, 0x8D2A,
- 0x8D2F, 0x8D23, 0x8D2E, 0x8D33, 0x8D40, 0x8D30, 0x8D35, 0x8D2C, 0x4E70, 0x8D37, 0x8D36, 0x8D39, 0x8D34, 0x8D3B, 0x8D38, 0x8D3A,
- 0x8D32, 0x8D42, 0x8D41, 0x8D3F, 0x8D45, 0x8D44, 0x8D3E, 0x8D3C, 0x8D48, 0x8D4A, 0x5BBE, 0x8D47, 0x8D52, 0x8D49, 0x8D50, 0x8D4F,
- 0x8D54, 0x8D53, 0x8D24, 0x5356, 0x8D31, 0x8D4B, 0x8D55, 0x8D28, 0x8D26, 0x8D4C, 0x8D56, 0x8D57, 0x8D5A, 0x8D59, 0x8D2D, 0x8D5B,
- 0x8D5C, 0x8D3D, 0x8D58, 0x8D5F, 0x8D60, 0x8D5E, 0x8D61, 0x8D62, 0x8D46, 0x8D43, 0x8D51, 0x8D4E, 0x8D5D, 0x8D63, 0x8D6A, 0x8D76,
- 0x8D75, 0x8D8B, 0x8DB1, 0x8FF9, 0x8DF5, 0x8E0A, 0x8DC4, 0x8DF8, 0x8DD6, 0x8E52, 0x8DF7, 0x8DF6, 0x8DB8, 0x8E0C, 0x8DFB, 0x8DC3,
- 0x8E2F, 0x8DDE, 0x8E2C, 0x8E70, 0x8DF9, 0x8E51, 0x8E7F, 0x8E9C, 0x8E8F, 0x8EAF, 0x8F66, 0x8F67, 0x8F68, 0x519B, 0x8F69, 0x8F6B,
- 0x8F6D, 0x8F6F, 0x8F78, 0x8F71, 0x8F74, 0x8F75, 0x8F7A, 0x8F72, 0x8F76, 0x8F7C, 0x8F83, 0x8F82, 0x8F81, 0x8F80, 0x8F7D, 0x8F7E,
- 0x8F84, 0x8F85, 0x8F7B, 0x8F86, 0x8F8E, 0x8F89, 0x8F8B, 0x8F8D, 0x8F8A, 0x8F87, 0x8F88, 0x8F6E, 0x8F91, 0x8F8F, 0x8F93, 0x8F90,
- 0x8F97, 0x8206, 0x8F92, 0x6BC2, 0x8F96, 0x8F95, 0x8F98, 0x8F6C, 0x8F99, 0x8F7F, 0x8F9A, 0x8F70, 0x8F94, 0x8F79, 0x8F73, 0x529E,
- 0x8F9E, 0x8FAB, 0x8FA9, 0x519C, 0x8FD9, 0x8FDE, 0x5468, 0x8FDB, 0x6E38, 0x8FD0, 0x8FC7, 0x8FBE, 0x8FDD, 0x9065, 0x900A, 0x9012,
- 0x8FDC, 0x9002, 0x8FDF, 0x8FC1, 0x9009, 0x9057, 0x8FBD, 0x8FC8, 0x8FD8, 0x8FE9, 0x8FB9, 0x903B, 0x9026, 0x90CF, 0x90AE, 0x90D3,
- 0x4E61, 0x90B9, 0x90AC, 0x90E7, 0x9093, 0x90D1, 0x90BB, 0x90F8, 0x90BA, 0x90D0, 0x909D, 0x9142, 0x90E6, 0x814C, 0x4E11, 0x915D,
- 0x533B, 0x9171, 0x9166, 0x917F, 0x8845, 0x917E, 0x917D, 0x91CA, 0x9487, 0x948C, 0x948A, 0x9489, 0x948B, 0x9488, 0x9493, 0x9490,
- 0x948F, 0x9492, 0x948E, 0x9497, 0x948D, 0x9495, 0x94AF, 0x94AB, 0x9498, 0x94AD, 0x94A0, 0x949D, 0x94A4, 0x94A3, 0x949E, 0x94AE,
- 0x94A7, 0x9499, 0x949B, 0x94AA, 0x94CC, 0x94C8, 0x94B6, 0x94C3, 0x94B4, 0x94B9, 0x94CD, 0x94B0, 0x94B8, 0x94C0, 0x94BF, 0x94BE,
- 0x949C, 0x94CA, 0x94C9, 0x94C7, 0x94CB, 0x94C2, 0x94B3, 0x94C6, 0x94C5, 0x94BA, 0x94A9, 0x94B2, 0x94BC, 0x94BD, 0x94CF, 0x94F0,
- 0x94D2, 0x94EC, 0x94EA, 0x94F6, 0x94F3, 0x94DC, 0x94DA, 0x94E3, 0x94E8, 0x94E2, 0x94ED, 0x94EB, 0x94E6, 0x8854, 0x94D1, 0x94F7,
- 0x94F1, 0x94DF, 0x94F5, 0x94D5, 0x94EF, 0x94D0, 0x9510, 0x9500, 0x9508, 0x9511, 0x9509, 0x94DD, 0x9512, 0x950C, 0x94A1, 0x94E4,
- 0x94D7, 0x950B, 0x950A, 0x9513, 0x9504, 0x9503, 0x9514, 0x9507, 0x94D3, 0x94FA, 0x94D6, 0x9506, 0x9502, 0x952F, 0x94A2, 0x951E,
- 0x5F55, 0x9516, 0x9529, 0x94D4, 0x9525, 0x9515, 0x951F, 0x9524, 0x9531, 0x94EE, 0x951B, 0x952C, 0x952D, 0x951C, 0x94B1, 0x9526,
- 0x951A, 0x9520, 0x9521, 0x9522, 0x9519, 0x9530, 0x8868, 0x94FC, 0x9528, 0x9494, 0x9534, 0x94FE, 0x9505, 0x9540, 0x9537, 0x94E1,
- 0x9496, 0x953B, 0x953D, 0x9538, 0x9532, 0x9539, 0x953E, 0x952E, 0x9536, 0x9517, 0x953A, 0x9541, 0x9551, 0x9555, 0x9501, 0x9549,
- 0x9548, 0x9543, 0x94A8, 0x84E5, 0x954F, 0x94E0, 0x94E9, 0x953C, 0x9550, 0x9547, 0x9552, 0x954D, 0x9553, 0x955E, 0x955F, 0x94FE,
- 0x9546, 0x9559, 0x9560, 0x955D, 0x94FF, 0x9535, 0x9557, 0x9558, 0x955B, 0x94F2, 0x955C, 0x9556, 0x9542, 0x933E, 0x955A, 0x94E7,
- 0x956A, 0x9508, 0x94D9, 0x9563, 0x9566, 0x9561, 0x949F, 0x956B, 0x950F, 0x9544, 0x954C, 0x9570, 0x956F, 0x956D, 0x94C1, 0x956E,
- 0x94CE, 0x94DB, 0x9571, 0x94F8, 0x956C, 0x9554, 0x9274, 0x9527, 0x9574, 0x94C4, 0x9573, 0x9567, 0x94A5, 0x9575, 0x9576, 0x954A,
- 0x9569, 0x9523, 0x94BB, 0x92AE, 0x51FF, 0x957F, 0x95E8, 0x95E9, 0x95EA, 0x95EB, 0x95EC, 0x95ED, 0x5F00, 0x95F6, 0x95F3, 0x95F0,
- 0x95F2, 0x95F4, 0x95F5, 0x95F8, 0x9602, 0x9601, 0x9600, 0x95FA, 0x95FD, 0x9603, 0x9606, 0x95FE, 0x9605, 0x960A, 0x9609, 0x960E,
- 0x960F, 0x960D, 0x9608, 0x960C, 0x9612, 0x677F, 0x6697, 0x95F1, 0x9614, 0x9615, 0x9611, 0x9617, 0x9618, 0x95FF, 0x9616, 0x9619,
- 0x95EF, 0x5173, 0x961A, 0x9613, 0x9610, 0x8F9F, 0x961B, 0x95FC, 0x9649, 0x9655, 0x9635, 0x9634, 0x9648, 0x9646, 0x9633, 0x9667,
- 0x961F, 0x9636, 0x9668, 0x9645, 0x968F, 0x9669, 0x9690, 0x9647, 0x96B6, 0x53EA, 0x96BD, 0x867D, 0x53CC, 0x96CF, 0x6742, 0x9E21,
- 0x79BB, 0x96BE, 0x4E91, 0x7535, 0x9721, 0x96FE, 0x9701, 0x96F3, 0x972D, 0x53C7, 0x7075, 0x53C6, 0x9753, 0x9759, 0x817C, 0x9765,
- 0x9F17, 0x5DE9, 0x979F, 0x7F30, 0x9791, 0x97AF, 0x97E6, 0x97E7, 0x97E9, 0x97EA, 0x97EC, 0x97EB, 0x97F5, 0x54CD, 0x9875, 0x9876,
- 0x9877, 0x9879, 0x987A, 0x9878, 0x987B, 0x987C, 0x9882, 0x9880, 0x9883, 0x9884, 0x987D, 0x9881, 0x987F, 0x9887, 0x9886, 0x988C,
- 0x9889, 0x9890, 0x988F, 0x5934, 0x988A, 0x988B, 0x9894, 0x9888, 0x9893, 0x9891, 0x9897, 0x9898, 0x989D, 0x989A, 0x989C, 0x9899,
- 0x989B, 0x613F, 0x98A1, 0x98A0, 0x7C7B, 0x989F, 0x98A2, 0x987E, 0x98A4, 0x98A5, 0x663E, 0x98A6, 0x9885, 0x989E, 0x98A7, 0x98CE,
- 0x98D0, 0x98D1, 0x98D2, 0x53F0, 0x98D3, 0x98D4, 0x98CF, 0x98D6, 0x98D5, 0x98D7, 0x98D8, 0x98D9, 0x98DE, 0x9965, 0x9964, 0x9966,
- 0x9968, 0x996A, 0x996B, 0x996C, 0x996D, 0x996E, 0x9974, 0x9972, 0x9971, 0x9970, 0x9973, 0x997A, 0x9978, 0x997C, 0x9977, 0x517B,
- 0x9975, 0x9979, 0x997D, 0x9981, 0x997F, 0x997E, 0x4F59, 0x80B4, 0x9984, 0x9983, 0x996F, 0x9985, 0x9986, 0x7CC7, 0x9967, 0x5582,
- 0x9989, 0x998E, 0x9969, 0x998F, 0x998A, 0x998C, 0x998D, 0x9992, 0x9990, 0x9991, 0x9988, 0x9994, 0x9976, 0x98E8, 0x990D, 0x998B,
- 0x9A6C, 0x9A6D, 0x51AF, 0x9A6E, 0x9A70, 0x9A6F, 0x9A73, 0x9A7B, 0x9A7D, 0x9A79, 0x9A75, 0x9A7E, 0x9A80, 0x9A78, 0x9A76, 0x9A7C,
- 0x9A77, 0x9A88, 0x9A87, 0x9A83, 0x9A86, 0x9A8E, 0x9A8F, 0x9A8B, 0x9A8D, 0x9A93, 0x9A92, 0x9A91, 0x9A90, 0x9A9B, 0x9A97, 0x9A99,
- 0x9A9E, 0x9A98, 0x9A9D, 0x817E, 0x9A7A, 0x9A9A, 0x9A9F, 0x9AA1, 0x84E6, 0x9A9C, 0x9A96, 0x9AA0, 0x9AA2, 0x9A71, 0x9A85, 0x9A95,
- 0x9A81, 0x9A84, 0x9A8C, 0x60CA, 0x9A7F, 0x9AA4, 0x9A74, 0x9AA7, 0x9AA5, 0x9AA6, 0x9A8A, 0x80AE, 0x9AC5, 0x810F, 0x4F53, 0x9ACC,
- 0x9ACB, 0x53D1, 0x677E, 0x80E1, 0x9B13, 0x6597, 0x95F9, 0x960B, 0x9604, 0x90C1, 0x9B49, 0x9B47, 0x9C7C, 0x9C80, 0x9C81, 0x9C82,
- 0x9C7F, 0x9C85, 0x9C86, 0x9C8F, 0x9C87, 0x9C90, 0x9C8D, 0x9C8B, 0x9C8A, 0x9C92, 0x9C95, 0x9C96, 0x9C94, 0x9C9B, 0x9C91, 0x9C9C,
- 0x9CA7, 0x9CA0, 0x9CA9, 0x9CA4, 0x9CA8, 0x9CBB, 0x9CAF, 0x9CAD, 0x9C9E, 0x9CB7, 0x9CB4, 0x9CB1, 0x9CB5, 0x9CB2, 0x9CB3, 0x9CB8,
- 0x9CAE, 0x9CB0, 0x9CB6, 0x9CAB, 0x9CCA, 0x9C97, 0x9CBD, 0x9CC7, 0x9CC5, 0x9CC6, 0x9CC3, 0x9CD2, 0x9CD1, 0x9CA5, 0x9CCF, 0x9CCE,
- 0x9CD0, 0x9CCD, 0x9CC1, 0x9CA2, 0x9CCC, 0x9CA6, 0x9CA3, 0x9CB9, 0x9CD7, 0x9CD4, 0x9CC9, 0x9CD5, 0x9CD6, 0x9CDF, 0x9CDD, 0x9CDC,
- 0x9CDE, 0x9C9F, 0x9CBC, 0x9C8E, 0x9C99, 0x9CE3, 0x9CE2, 0x9C9A, 0x9CC4, 0x9C88, 0x9CA1, 0x9E1F, 0x51EB, 0x9E20, 0x9E24, 0x51E4,
- 0x9E23, 0x9E22, 0x9E29, 0x9E28, 0x9E26, 0x9E30, 0x9E35, 0x9E33, 0x9E32, 0x9E2E, 0x9E31, 0x9E2A, 0x9E2F, 0x9E2D, 0x9E38, 0x9E39,
- 0x9E3B, 0x9E3F, 0x9E3D, 0x9E3A, 0x9E43, 0x9E46, 0x9E41, 0x9E48, 0x9E45, 0x9E44, 0x9E49, 0x9E4C, 0x9E4F, 0x9E4E, 0x9E4A, 0x9E53,
- 0x9E2B, 0x9E51, 0x9E4B, 0x9E59, 0x9E55, 0x9E57, 0x9E56, 0x9E4D, 0x9E5B, 0x9E5C, 0x83BA, 0x9E5F, 0x9E64, 0x9E60, 0x9E61, 0x9E58,
- 0x9E63, 0x9E5A, 0x9E62, 0x9E5E, 0x9E67, 0x9E65, 0x9E25, 0x9E37, 0x9E68, 0x9E36, 0x9E6A, 0x9E54, 0x9E69, 0x9E6B, 0x9E47, 0x9E6C,
- 0x9E70, 0x9E6D, 0x9E6F, 0x9E2C, 0x9E74, 0x9E66, 0x9E73, 0x9E42, 0x9E3E, 0x5364, 0x9E7E, 0x7877, 0x76D0, 0x4E3D, 0x9EA6, 0x9EB8,
- 0x9EB9, 0x9762, 0x4E48, 0x9EC4, 0x9EC9, 0x70B9, 0x515A, 0x9709, 0x9EE1, 0x9EE9, 0x9EFE, 0x9F0B, 0x9F0D, 0x9F39, 0x9F50, 0x658B,
- 0x8D4D, 0x9F51, 0x9F7F, 0x9F80, 0x9F81, 0x9F85, 0x9F87, 0x9F83, 0x9F86, 0x9F84, 0x9F88, 0x9F8A, 0x9F89, 0x9F8B, 0x9F8C, 0x9F99,
- 0x5390, 0x5E9E, 0x9F9A, 0x9F9B, 0x9F9F, 0xA76F, 0x8C48, 0x66F4, 0x8ECA, 0x8CC8, 0x6ED1, 0x4E32, 0x53E5, 0x9F9C, 0x9F9C, 0x5951,
- 0x91D1, 0x5587, 0x5948, 0x61F6, 0x7669, 0x7F85, 0x863F, 0x87BA, 0x88F8, 0x908F, 0x6A02, 0x6D1B, 0x70D9, 0x73DE, 0x843D, 0x916A,
- 0x99F1, 0x4E82, 0x5375, 0x6B04, 0x721B, 0x862D, 0x9E1E, 0x5D50, 0x6FEB, 0x85CD, 0x8964, 0x62C9, 0x81D8, 0x881F, 0x5ECA, 0x6717,
- 0x6D6A, 0x72FC, 0x90CE, 0x4F86, 0x51B7, 0x52DE, 0x64C4, 0x6AD3, 0x7210, 0x76E7, 0x8001, 0x8606, 0x865C, 0x8DEF, 0x9732, 0x9B6F,
- 0x9DFA, 0x788C, 0x797F, 0x7DA0, 0x83C9, 0x9304, 0x9E7F, 0x8AD6, 0x58DF, 0x5F04, 0x7C60, 0x807E, 0x7262, 0x78CA, 0x8CC2, 0x96F7,
- 0x58D8, 0x5C62, 0x6A13, 0x6DDA, 0x6F0F, 0x7D2F, 0x7E37, 0x964B, 0x52D2, 0x808B, 0x51DC, 0x51CC, 0x7A1C, 0x7DBE, 0x83F1, 0x9675,
- 0x8B80, 0x62CF, 0x6A02, 0x8AFE, 0x4E39, 0x5BE7, 0x6012, 0x7387, 0x7570, 0x5317, 0x78FB, 0x4FBF, 0x5FA9, 0x4E0D, 0x6CCC, 0x6578,
- 0x7D22, 0x53C3, 0x585E, 0x7701, 0x8449, 0x8AAA, 0x6BBA, 0x8FB0, 0x6C88, 0x62FE, 0x82E5, 0x63A0, 0x7565, 0x4EAE, 0x5169, 0x51C9,
- 0x6881, 0x7CE7, 0x826F, 0x8AD2, 0x91CF, 0x52F5, 0x5442, 0x5973, 0x5EEC, 0x65C5, 0x6FFE, 0x792A, 0x95AD, 0x9A6A, 0x9E97, 0x9ECE,
- 0x529B, 0x66C6, 0x6B77, 0x8F62, 0x5E74, 0x6190, 0x6200, 0x649A, 0x6F23, 0x7149, 0x7489, 0x79CA, 0x7DF4, 0x806F, 0x8F26, 0x84EE,
- 0x9023, 0x934A, 0x5217, 0x52A3, 0x54BD, 0x70C8, 0x88C2, 0x8AAA, 0x5EC9, 0x5FF5, 0x637B, 0x6BAE, 0x7C3E, 0x7375, 0x4EE4, 0x56F9,
- 0x5BE7, 0x5DBA, 0x601C, 0x73B2, 0x7469, 0x7F9A, 0x8046, 0x9234, 0x96F6, 0x9748, 0x9818, 0x4F8B, 0x79AE, 0x91B4, 0x96B8, 0x60E1,
- 0x4E86, 0x50DA, 0x5BEE, 0x5C3F, 0x6599, 0x6A02, 0x71CE, 0x7642, 0x84FC, 0x907C, 0x9F8D, 0x6688, 0x962E, 0x5289, 0x677B, 0x67F3,
- 0x6D41, 0x6E9C, 0x7409, 0x7559, 0x786B, 0x7D10, 0x985E, 0x516D, 0x622E, 0x9678, 0x502B, 0x5D19, 0x6DEA, 0x8F2A, 0x5F8B, 0x6144,
- 0x6817, 0x7387, 0x9686, 0x5229, 0x540F, 0x5C65, 0x6613, 0x674E, 0x68A8, 0x6CE5, 0x7406, 0x75E2, 0x7F79, 0x88CF, 0x88E1, 0x91CC,
- 0x96E2, 0x533F, 0x6EBA, 0x541D, 0x71D0, 0x7498, 0x85FA, 0x96A3, 0x9C57, 0x9E9F, 0x6797, 0x6DCB, 0x81E8, 0x7ACB, 0x7B20, 0x7C92,
- 0x72C0, 0x7099, 0x8B58, 0x4EC0, 0x8336, 0x523A, 0x5207, 0x5EA6, 0x62D3, 0x7CD6, 0x5B85, 0x6D1E, 0x66B4, 0x8F3B, 0x884C, 0x964D,
- 0x898B, 0x5ED3, 0x5140, 0x55C0, 0x585A, 0x6674, 0x51DE, 0x732A, 0x76CA, 0x793C, 0x795E, 0x7965, 0x798F, 0x9756, 0x7CBE, 0x7FBD,
- 0x8612, 0x8AF8, 0x9038, 0x90FD, 0x98EF, 0x98FC, 0x9928, 0x9DB4, 0x4FAE, 0x50E7, 0x514D, 0x52C9, 0x52E4, 0x5351, 0x559D, 0x5606,
- 0x5668, 0x5840, 0x58A8, 0x5C64, 0x5C6E, 0x6094, 0x6168, 0x618E, 0x61F2, 0x654F, 0x65E2, 0x6691, 0x6885, 0x6D77, 0x6E1A, 0x6F22,
- 0x716E, 0x722B, 0x7422, 0x7891, 0x793E, 0x7949, 0x7948, 0x7950, 0x7956, 0x795D, 0x798D, 0x798E, 0x7A40, 0x7A81, 0x7BC0, 0x7DF4,
- 0x7E09, 0x7E41, 0x7F72, 0x8005, 0x81ED, 0x8279, 0x8279, 0x8457, 0x8910, 0x8996, 0x8B01, 0x8B39, 0x8CD3, 0x8D08, 0x8FB6, 0x9038,
- 0x96E3, 0x97FF, 0x983B, 0x6075, 0x8218, 0x4E26, 0x51B5, 0x5168, 0x4F80, 0x5145, 0x5180, 0x52C7, 0x52FA, 0x559D, 0x5555, 0x5599,
- 0x55E2, 0x585A, 0x58B3, 0x5944, 0x5954, 0x5A62, 0x5B28, 0x5ED2, 0x5ED9, 0x5F69, 0x5FAD, 0x60D8, 0x614E, 0x6108, 0x618E, 0x6160,
- 0x61F2, 0x6234, 0x63C4, 0x641C, 0x6452, 0x6556, 0x6674, 0x6717, 0x671B, 0x6756, 0x6B79, 0x6BBA, 0x6D41, 0x6EDB, 0x6ECB, 0x6F22,
- 0x701E, 0x716E, 0x77A7, 0x7235, 0x72AF, 0x732A, 0x7471, 0x7506, 0x753B, 0x761D, 0x761F, 0x76CA, 0x76DB, 0x76F4, 0x774A, 0x7740,
- 0x78CC, 0x7AB1, 0x7BC0, 0x7C7B, 0x7D5B, 0x7DF4, 0x7F3E, 0x8005, 0x8352, 0x83EF, 0x8779, 0x8941, 0x8986, 0x8996, 0x8ABF, 0x8AF8,
- 0x8ACB, 0x8B01, 0x8AFE, 0x8AED, 0x8B39, 0x8B8A, 0x8D08, 0x8F38, 0x9072, 0x9199, 0x9276, 0x967C, 0x96E3, 0x9756, 0x97DB, 0x97FF,
- 0x980B, 0x983B, 0x9B12, 0x9F9C, 0x3B9D, 0x4018, 0x4039, 0x9F43, 0x9F8E, 0x05E2, 0x05D0, 0x05D3, 0x05D4, 0x05DB, 0x05DC, 0x05DD,
- 0x05E8, 0x05EA, 0x002B, 0x0671, 0x0671, 0x067B, 0x067B, 0x067B, 0x067B, 0x067E, 0x067E, 0x067E, 0x067E, 0x0680, 0x0680, 0x0680,
- 0x0680, 0x067A, 0x067A, 0x067A, 0x067A, 0x067F, 0x067F, 0x067F, 0x067F, 0x0679, 0x0679, 0x0679, 0x0679, 0x06A4, 0x06A4, 0x06A4,
- 0x06A4, 0x06A6, 0x06A6, 0x06A6, 0x06A6, 0x0684, 0x0684, 0x0684, 0x0684, 0x0683, 0x0683, 0x0683, 0x0683, 0x0686, 0x0686, 0x0686,
- 0x0686, 0x0687, 0x0687, 0x0687, 0x0687, 0x068D, 0x068D, 0x068C, 0x068C, 0x068E, 0x068E, 0x0688, 0x0688, 0x0698, 0x0698, 0x0691,
- 0x0691, 0x06A9, 0x06A9, 0x06A9, 0x06A9, 0x06AF, 0x06AF, 0x06AF, 0x06AF, 0x06B3, 0x06B3, 0x06B3, 0x06B3, 0x06B1, 0x06B1, 0x06B1,
- 0x06B1, 0x06BA, 0x06BA, 0x06BB, 0x06BB, 0x06BB, 0x06BB, 0x06C0, 0x06C0, 0x06C1, 0x06C1, 0x06C1, 0x06C1, 0x06BE, 0x06BE, 0x06BE,
- 0x06BE, 0x06D2, 0x06D2, 0x06D3, 0x06D3, 0x06AD, 0x06AD, 0x06AD, 0x06AD, 0x06C7, 0x06C7, 0x06C6, 0x06C6, 0x06C8, 0x06C8, 0x0677,
- 0x06CB, 0x06CB, 0x06C5, 0x06C5, 0x06C9, 0x06C9, 0x06D0, 0x06D0, 0x06D0, 0x06D0, 0x0649, 0x0649, 0x06CC, 0x06CC, 0x06CC, 0x06CC,
- 0x002C, 0x3001, 0x3002, 0x003A, 0x003B, 0x0021, 0x003F, 0x3016, 0x3017, 0x2026, 0x2025, 0x2014, 0x2013, 0x005F, 0x005F, 0x0028,
- 0x0029, 0x007B, 0x007D, 0x3014, 0x3015, 0x3010, 0x3011, 0x300A, 0x300B, 0x3008, 0x3009, 0x300C, 0x300D, 0x300E, 0x300F, 0x005B,
- 0x005D, 0x203E, 0x203E, 0x203E, 0x203E, 0x005F, 0x005F, 0x005F, 0x002C, 0x3001, 0x002E, 0x003B, 0x003A, 0x003F, 0x0021, 0x2014,
- 0x0028, 0x0029, 0x007B, 0x007D, 0x3014, 0x3015, 0x0023, 0x0026, 0x002A, 0x002B, 0x002D, 0x003C, 0x003E, 0x003D, 0x005C, 0x0024,
- 0x0025, 0x0040, 0x064B, 0x064C, 0x064D, 0x064E, 0x064F, 0x0650, 0x0651, 0x0652, 0x0621, 0x0622, 0x0622, 0x0623, 0x0623, 0x0624,
- 0x0624, 0x0625, 0x0625, 0x0626, 0x0626, 0x0626, 0x0626, 0x0627, 0x0627, 0x0628, 0x0628, 0x0628, 0x0628, 0x0629, 0x0629, 0x062A,
- 0x062A, 0x062A, 0x062A, 0x062B, 0x062B, 0x062B, 0x062B, 0x062C, 0x062C, 0x062C, 0x062C, 0x062D, 0x062D, 0x062D, 0x062D, 0x062E,
- 0x062E, 0x062E, 0x062E, 0x062F, 0x062F, 0x0630, 0x0630, 0x0631, 0x0631, 0x0632, 0x0632, 0x0633, 0x0633, 0x0633, 0x0633, 0x0634,
- 0x0634, 0x0634, 0x0634, 0x0635, 0x0635, 0x0635, 0x0635, 0x0636, 0x0636, 0x0636, 0x0636, 0x0637, 0x0637, 0x0637, 0x0637, 0x0638,
- 0x0638, 0x0638, 0x0638, 0x0639, 0x0639, 0x0639, 0x0639, 0x063A, 0x063A, 0x063A, 0x063A, 0x0641, 0x0641, 0x0641, 0x0641, 0x0642,
- 0x0642, 0x0642, 0x0642, 0x0643, 0x0643, 0x0643, 0x0643, 0x0644, 0x0644, 0x0644, 0x0644, 0x0645, 0x0645, 0x0645, 0x0645, 0x0646,
- 0x0646, 0x0646, 0x0646, 0x0647, 0x0647, 0x0647, 0x0647, 0x0648, 0x0648, 0x0649, 0x0649, 0x064A, 0x064A, 0x064A, 0x064A, 0x0021,
- 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 0x0030, 0x0031,
- 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 0x0040, 0x0041,
- 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051,
- 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, 0x0060, 0x0061,
- 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071,
- 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x2985, 0x2986, 0x3002,
- 0x300C, 0x300D, 0x3001, 0x30FB, 0x30F2, 0x30A1, 0x30A3, 0x30A5, 0x30A7, 0x30A9, 0x30E3, 0x30E5, 0x30E7, 0x30C3, 0x30FC, 0x30A2,
- 0x30A4, 0x30A6, 0x30A8, 0x30AA, 0x30AB, 0x30AD, 0x30AF, 0x30B1, 0x30B3, 0x30B5, 0x30B7, 0x30B9, 0x30BB, 0x30BD, 0x30BF, 0x30C1,
- 0x30C4, 0x30C6, 0x30C8, 0x30CA, 0x30CB, 0x30CC, 0x30CD, 0x30CE, 0x30CF, 0x30D2, 0x30D5, 0x30D8, 0x30DB, 0x30DE, 0x30DF, 0x30E0,
- 0x30E1, 0x30E2, 0x30E4, 0x30E6, 0x30E8, 0x30E9, 0x30EA, 0x30EB, 0x30EC, 0x30ED, 0x30EF, 0x30F3, 0x3099, 0x309A, 0x3164, 0x3131,
- 0x3132, 0x3133, 0x3134, 0x3135, 0x3136, 0x3137, 0x3138, 0x3139, 0x313A, 0x313B, 0x313C, 0x313D, 0x313E, 0x313F, 0x3140, 0x3141,
- 0x3142, 0x3143, 0x3144, 0x3145, 0x3146, 0x3147, 0x3148, 0x3149, 0x314A, 0x314B, 0x314C, 0x314D, 0x314E, 0x314F, 0x3150, 0x3151,
- 0x3152, 0x3153, 0x3154, 0x3155, 0x3156, 0x3157, 0x3158, 0x3159, 0x315A, 0x315B, 0x315C, 0x315D, 0x315E, 0x315F, 0x3160, 0x3161,
- 0x3162, 0x3163, 0x00A2, 0x00A3, 0x00AC, 0x00AF, 0x00A6, 0x00A5, 0x20A9, 0x2502, 0x2190, 0x2191, 0x2192, 0x2193, 0x25A0, 0x25CB
-};
-extern const FX_WCHAR g_UnicodeData_Normalization_Map2[1724] = {
- 0x004F, 0x0045, 0x0054, 0x004D, 0x006F, 0x0065, 0x0049, 0x004A, 0x0069, 0x006A, 0x004F, 0x0045, 0x006F, 0x0065, 0x0044, 0x017D,
- 0x0044, 0x017E, 0x0064, 0x017E, 0x004C, 0x004A, 0x004C, 0x006A, 0x006C, 0x006A, 0x004E, 0x004A, 0x004E, 0x006A, 0x006E, 0x006A,
- 0x0044, 0x005A, 0x0044, 0x007A, 0x0064, 0x007A, 0x0064, 0x0062, 0x0071, 0x0070, 0x004F, 0x0045, 0x0064, 0x007A, 0x0064, 0x0292,
- 0x0064, 0x007A, 0x0074, 0x0073, 0x0074, 0x0283, 0x0074, 0x0063, 0x0066, 0x014B, 0x006C, 0x0073, 0x006C, 0x007A, 0x041D, 0x0413,
- 0x043D, 0x0433, 0x0422, 0x0426, 0x0442, 0x0446, 0x0410, 0x0415, 0x0430, 0x0435, 0x0565, 0x0582, 0x0627, 0x0674, 0x0648, 0x0674,
- 0x06C7, 0x0674, 0x064A, 0x0674, 0x06D5, 0x0654, 0x06C1, 0x0654, 0x06D2, 0x0654, 0x0928, 0x093C, 0x0930, 0x093C, 0x0933, 0x093C,
- 0x0915, 0x093C, 0x0916, 0x093C, 0x0917, 0x093C, 0x091C, 0x093C, 0x0921, 0x093C, 0x0922, 0x093C, 0x092B, 0x093C, 0x092F, 0x093C,
- 0x09C7, 0x09BE, 0x09C7, 0x09D7, 0x09A1, 0x09BC, 0x09A2, 0x09BC, 0x09AF, 0x09BC, 0x0A32, 0x0A3C, 0x0A38, 0x0A3C, 0x0A16, 0x0A3C,
- 0x0A17, 0x0A3C, 0x0A1C, 0x0A3C, 0x0A2B, 0x0A3C, 0x0B47, 0x0B56, 0x0B47, 0x0B3E, 0x0B47, 0x0B57, 0x0B21, 0x0B3C, 0x0B22, 0x0B3C,
- 0x0B92, 0x0BD7, 0x0BC6, 0x0BBE, 0x0BC7, 0x0BBE, 0x0BC6, 0x0BD7, 0x0C46, 0x0C56, 0x0CBF, 0x0CD5, 0x0CC6, 0x0CD5, 0x0CC6, 0x0CD6,
- 0x0CC6, 0x0CC2, 0x0CCA, 0x0CD5, 0x0D46, 0x0D3E, 0x0D47, 0x0D3E, 0x0D46, 0x0D57, 0x0DD9, 0x0DCA, 0x0DD9, 0x0DCF, 0x0DDC, 0x0DCA,
- 0x0DD9, 0x0DDF, 0x0E4D, 0x0E32, 0x0ECD, 0x0EB2, 0x0EAB, 0x0E99, 0x0EAB, 0x0EA1, 0x0F42, 0x0FB7, 0x0F4C, 0x0FB7, 0x0F51, 0x0FB7,
- 0x0F56, 0x0FB7, 0x0F5B, 0x0FB7, 0x0F40, 0x0FB5, 0x0F71, 0x0F72, 0x0F71, 0x0F74, 0x0FB2, 0x0F80, 0x0FB2, 0x0F81, 0x0FB3, 0x0F80,
- 0x0FB3, 0x0F81, 0x0F71, 0x0F80, 0x0F92, 0x0FB7, 0x0F9C, 0x0FB7, 0x0FA1, 0x0FB7, 0x0FA6, 0x0FB7, 0x0FAB, 0x0FB7, 0x0F90, 0x0FB5,
- 0x1025, 0x102E, 0x1B05, 0x1B35, 0x1B07, 0x1B35, 0x1B09, 0x1B35, 0x1B0B, 0x1B35, 0x1B0D, 0x1B35, 0x1B11, 0x1B35, 0x1B3A, 0x1B35,
- 0x1B3C, 0x1B35, 0x1B3E, 0x1B35, 0x1B3F, 0x1B35, 0x1B42, 0x1B35, 0x0074, 0x0068, 0x002E, 0x002E, 0x2032, 0x2032, 0x2035, 0x2035,
- 0x0021, 0x0021, 0x0020, 0x0305, 0x003F, 0x003F, 0x003F, 0x0021, 0x0021, 0x003F, 0x0052, 0x0073, 0x00B0, 0x0043, 0x00B0, 0x0046,
- 0x004E, 0x006F, 0x0053, 0x004D, 0x0054, 0x004D, 0x0031, 0x002F, 0x0049, 0x0049, 0x0049, 0x0056, 0x0056, 0x0049, 0x0049, 0x0058,
- 0x0058, 0x0049, 0x0069, 0x0069, 0x0069, 0x0076, 0x0076, 0x0069, 0x0069, 0x0078, 0x0078, 0x0069, 0x2190, 0x0338, 0x2192, 0x0338,
- 0x2194, 0x0338, 0x21D0, 0x0338, 0x21D4, 0x0338, 0x21D2, 0x0338, 0x2223, 0x0338, 0x2225, 0x0338, 0x222B, 0x222B, 0x222E, 0x222E,
- 0x223C, 0x0338, 0x2243, 0x0338, 0x2245, 0x0338, 0x2248, 0x0338, 0x003D, 0x002F, 0x2261, 0x002F, 0x224D, 0x002F, 0x003C, 0x002F,
- 0x003E, 0x002F, 0x2264, 0x002F, 0x2265, 0x002F, 0x2272, 0x002F, 0x2273, 0x002F, 0x2276, 0x002F, 0x2277, 0x002F, 0x227A, 0x002F,
- 0x227B, 0x002F, 0x2282, 0x002F, 0x2283, 0x002F, 0x2286, 0x002F, 0x2287, 0x002F, 0x22A2, 0x002F, 0x22A8, 0x002F, 0x22A9, 0x002F,
- 0x22AB, 0x002F, 0x227C, 0x002F, 0x227D, 0x002F, 0x2291, 0x002F, 0x2292, 0x002F, 0x22B2, 0x002F, 0x22B3, 0x002F, 0x22B4, 0x002F,
- 0x22B5, 0x002F, 0x0042, 0x0053, 0x0048, 0x0054, 0x004C, 0x0046, 0x0056, 0x0054, 0x0046, 0x0046, 0x0043, 0x0052, 0x0053, 0x0053,
- 0x0053, 0x0049, 0x0045, 0x004D, 0x0046, 0x0053, 0x0047, 0x0053, 0x0052, 0x0053, 0x0055, 0x0053, 0x0053, 0x0050, 0x0031, 0x0030,
- 0x0031, 0x0031, 0x0031, 0x0032, 0x0031, 0x0033, 0x0031, 0x0034, 0x0031, 0x0035, 0x0031, 0x0036, 0x0031, 0x0037, 0x0031, 0x0038,
- 0x0031, 0x0039, 0x0032, 0x0030, 0x0031, 0x002E, 0x0032, 0x002E, 0x0033, 0x002E, 0x0034, 0x002E, 0x0035, 0x002E, 0x0036, 0x002E,
- 0x0037, 0x002E, 0x0038, 0x002E, 0x0039, 0x002E, 0x0031, 0x0031, 0x0031, 0x0032, 0x0031, 0x0033, 0x0031, 0x0034, 0x0031, 0x0035,
- 0x0031, 0x0036, 0x0031, 0x0037, 0x0031, 0x0038, 0x0031, 0x0039, 0x0032, 0x0030, 0x0031, 0x0030, 0x0031, 0x0030, 0x0031, 0x0030,
- 0x0031, 0x0030, 0x003D, 0x003D, 0x2ADD, 0x002F, 0x304B, 0x3099, 0x304D, 0x3099, 0x304F, 0x3099, 0x3051, 0x3099, 0x3053, 0x3099,
- 0x3055, 0x3099, 0x3057, 0x3099, 0x3059, 0x3099, 0x305B, 0x3099, 0x305D, 0x3099, 0x305F, 0x3099, 0x3061, 0x3099, 0x3064, 0x3099,
- 0x3066, 0x3099, 0x3068, 0x3099, 0x306F, 0x3099, 0x306F, 0x309A, 0x3072, 0x3099, 0x3072, 0x309A, 0x3075, 0x3099, 0x3075, 0x309A,
- 0x3078, 0x3099, 0x3078, 0x309A, 0x307B, 0x3099, 0x307B, 0x309A, 0x3046, 0x3099, 0x0020, 0x3099, 0x0020, 0x309A, 0x309D, 0x3099,
- 0x3088, 0x308A, 0x30AB, 0x3099, 0x30AD, 0x3099, 0x30AF, 0x3099, 0x30B1, 0x3099, 0x30B3, 0x3099, 0x30B5, 0x3099, 0x30B7, 0x3099,
- 0x30B9, 0x3099, 0x30BB, 0x3099, 0x30BD, 0x3099, 0x30BF, 0x3099, 0x30C1, 0x3099, 0x30C4, 0x3099, 0x30C6, 0x3099, 0x30C8, 0x3099,
- 0x30CF, 0x3099, 0x30CF, 0x309A, 0x30D2, 0x3099, 0x30D2, 0x309A, 0x30D5, 0x3099, 0x30D5, 0x309A, 0x30D8, 0x3099, 0x30D8, 0x309A,
- 0x30DB, 0x3099, 0x30DB, 0x309A, 0x30A6, 0x3099, 0x30EF, 0x3099, 0x30F0, 0x3099, 0x30F1, 0x3099, 0x30F2, 0x3099, 0x30FD, 0x3099,
- 0x30B3, 0x30C8, 0x0032, 0x0031, 0x0032, 0x0032, 0x0032, 0x0033, 0x0032, 0x0034, 0x0032, 0x0035, 0x0032, 0x0036, 0x0032, 0x0037,
- 0x0032, 0x0038, 0x0032, 0x0039, 0x0033, 0x0030, 0x0033, 0x0031, 0x0033, 0x0032, 0x0033, 0x0033, 0x0033, 0x0034, 0x0033, 0x0035,
- 0x1100, 0x1161, 0x1102, 0x1161, 0x1103, 0x1161, 0x1105, 0x1161, 0x1106, 0x1161, 0x1107, 0x1161, 0x1109, 0x1161, 0x110B, 0x1161,
- 0x110C, 0x1161, 0x110E, 0x1161, 0x110F, 0x1161, 0x1110, 0x1161, 0x1111, 0x1161, 0x1112, 0x1161, 0x110B, 0x116E, 0x0033, 0x0036,
- 0x0033, 0x0037, 0x0033, 0x0038, 0x0033, 0x0039, 0x0034, 0x0030, 0x0034, 0x0031, 0x0034, 0x0032, 0x0034, 0x0033, 0x0034, 0x0034,
- 0x0034, 0x0035, 0x0034, 0x0036, 0x0034, 0x0037, 0x0034, 0x0038, 0x0034, 0x0039, 0x0035, 0x0030, 0x0031, 0x6708, 0x0032, 0x6708,
- 0x0033, 0x6708, 0x0034, 0x6708, 0x0035, 0x6708, 0x0036, 0x6708, 0x0037, 0x6708, 0x0038, 0x6708, 0x0039, 0x6708, 0x0048, 0x0067,
- 0x0065, 0x0056, 0x30AE, 0x30AC, 0x30AD, 0x30ED, 0x30C7, 0x30B7, 0x30C9, 0x30EB, 0x30C8, 0x30F3, 0x30CA, 0x30CE, 0x30D4, 0x30B3,
- 0x30D3, 0x30EB, 0x30DA, 0x30BD, 0x30DB, 0x30F3, 0x30DF, 0x30EA, 0x30E1, 0x30AC, 0x30EA, 0x30E9, 0x30EC, 0x30E0, 0x0030, 0x70B9,
- 0x0031, 0x70B9, 0x0032, 0x70B9, 0x0033, 0x70B9, 0x0034, 0x70B9, 0x0035, 0x70B9, 0x0036, 0x70B9, 0x0037, 0x70B9, 0x0038, 0x70B9,
- 0x0039, 0x70B9, 0x0064, 0x0061, 0x0041, 0x0055, 0x006F, 0x0056, 0x0070, 0x0063, 0x0064, 0x006D, 0x0049, 0x0055, 0x5E73, 0x6210,
- 0x662D, 0x548C, 0x5927, 0x6B63, 0x660E, 0x6CBB, 0x0070, 0x0041, 0x006E, 0x0041, 0x03BC, 0x0041, 0x006D, 0x0041, 0x006B, 0x0041,
- 0x004B, 0x0042, 0x004D, 0x0042, 0x0047, 0x0042, 0x0070, 0x0046, 0x006E, 0x0046, 0x03BC, 0x0046, 0x03BC, 0x0067, 0x006D, 0x0067,
- 0x006B, 0x0067, 0x0048, 0x007A, 0x03BC, 0x2113, 0x006D, 0x2113, 0x0064, 0x2113, 0x006B, 0x2113, 0x0066, 0x006D, 0x006E, 0x006D,
- 0x03BC, 0x006D, 0x006D, 0x006D, 0x0063, 0x006D, 0x006B, 0x006D, 0x006D, 0x00B2, 0x006D, 0x00B3, 0x0050, 0x0061, 0x0070, 0x0073,
- 0x006E, 0x0073, 0x03BC, 0x0073, 0x006D, 0x0073, 0x0070, 0x0056, 0x006E, 0x0056, 0x03BC, 0x0056, 0x006D, 0x0056, 0x006B, 0x0056,
- 0x004D, 0x0056, 0x0070, 0x0057, 0x006E, 0x0057, 0x03BC, 0x0057, 0x006D, 0x0057, 0x006B, 0x0057, 0x004D, 0x0057, 0x006B, 0x03A9,
- 0x004D, 0x03A9, 0x0042, 0x0071, 0x0063, 0x0063, 0x0063, 0x0064, 0x0064, 0x0042, 0x0047, 0x0079, 0x0068, 0x0061, 0x0048, 0x0050,
- 0x0069, 0x006E, 0x004B, 0x004B, 0x004B, 0x004D, 0x006B, 0x0074, 0x006C, 0x006D, 0x006C, 0x006E, 0x006C, 0x0078, 0x006D, 0x0062,
- 0x0050, 0x0048, 0x0050, 0x0052, 0x0073, 0x0072, 0x0053, 0x0076, 0x0057, 0x0062, 0x0031, 0x65E5, 0x0032, 0x65E5, 0x0033, 0x65E5,
- 0x0034, 0x65E5, 0x0035, 0x65E5, 0x0036, 0x65E5, 0x0037, 0x65E5, 0x0038, 0x65E5, 0x0039, 0x65E5, 0x0066, 0x0066, 0x0066, 0x0069,
- 0x0066, 0x006C, 0x017F, 0x0074, 0x0073, 0x0074, 0x0574, 0x0576, 0x0574, 0x0565, 0x0574, 0x056B, 0x057E, 0x0576, 0x0574, 0x056D,
- 0x05D9, 0x05B4, 0x05F2, 0x05B7, 0x05E9, 0x05C1, 0x05E9, 0x05C2, 0xFB49, 0x05C1, 0xFB49, 0x05C2, 0x05D0, 0x05B7, 0x05D0, 0x05B8,
- 0x05D0, 0x05BC, 0x05D1, 0x05BC, 0x05D2, 0x05BC, 0x05D3, 0x05BC, 0x05D4, 0x05BC, 0x05D5, 0x05BC, 0x05D6, 0x05BC, 0x05D8, 0x05BC,
- 0x05D9, 0x05BC, 0x05DA, 0x05BC, 0x05DB, 0x05BC, 0x05DC, 0x05BC, 0x05DE, 0x05BC, 0x05E0, 0x05BC, 0x05E1, 0x05BC, 0x05E3, 0x05BC,
- 0x05E4, 0x05BC, 0x05E6, 0x05BC, 0x05E7, 0x05BC, 0x05E8, 0x05BC, 0x05E9, 0x05BC, 0x05EA, 0x05BC, 0x05D5, 0x05B9, 0x05D1, 0x05BF,
- 0x05DB, 0x05BF, 0x05E4, 0x05BF, 0x05D0, 0x05DC, 0x0626, 0x0627, 0x0626, 0x0627, 0x0626, 0x06D5, 0x0626, 0x06D5, 0x0626, 0x0648,
- 0x0626, 0x0648, 0x0626, 0x06C7, 0x0626, 0x06C7, 0x0626, 0x06C6, 0x0626, 0x06C6, 0x0626, 0x06C8, 0x0626, 0x06C8, 0x0626, 0x06D0,
- 0x0626, 0x06D0, 0x0626, 0x06D0, 0x0626, 0x0649, 0x0626, 0x0649, 0x0626, 0x0649, 0x0626, 0x062C, 0x0626, 0x062D, 0x0626, 0x0645,
- 0x0626, 0x0649, 0x0626, 0x064A, 0x0628, 0x062C, 0x0628, 0x062D, 0x0628, 0x062E, 0x0628, 0x0645, 0x0628, 0x0649, 0x0628, 0x064A,
- 0x062A, 0x062C, 0x062A, 0x062D, 0x062A, 0x062E, 0x062A, 0x0645, 0x062A, 0x0649, 0x062A, 0x064A, 0x062B, 0x062C, 0x062B, 0x0645,
- 0x062B, 0x0649, 0x062B, 0x064A, 0x062C, 0x062D, 0x062C, 0x0645, 0x062D, 0x062C, 0x062D, 0x0645, 0x062E, 0x062C, 0x062E, 0x062D,
- 0x062E, 0x0645, 0x0633, 0x062C, 0x0633, 0x062D, 0x0633, 0x062E, 0x0633, 0x0645, 0x0635, 0x062D, 0x0635, 0x0645, 0x0636, 0x062C,
- 0x0636, 0x062D, 0x0636, 0x062E, 0x0636, 0x0645, 0x0637, 0x062D, 0x0637, 0x0645, 0x0638, 0x0645, 0x0639, 0x062C, 0x0639, 0x0645,
- 0x063A, 0x062C, 0x063A, 0x0645, 0x0641, 0x062C, 0x0641, 0x062D, 0x0641, 0x062E, 0x0641, 0x0645, 0x0641, 0x0649, 0x0641, 0x064A,
- 0x0642, 0x062D, 0x0642, 0x0645, 0x0642, 0x0649, 0x0642, 0x064A, 0x0643, 0x0627, 0x0643, 0x062C, 0x0643, 0x062D, 0x0643, 0x062E,
- 0x0643, 0x0644, 0x0643, 0x0645, 0x0643, 0x0649, 0x0643, 0x064A, 0x0644, 0x062C, 0x0644, 0x062D, 0x0644, 0x062E, 0x0644, 0x0645,
- 0x0644, 0x0649, 0x0644, 0x064A, 0x0645, 0x062C, 0x0645, 0x062D, 0x0645, 0x062E, 0x0645, 0x0645, 0x0645, 0x0649, 0x0645, 0x064A,
- 0x0646, 0x062C, 0x0646, 0x062D, 0x0646, 0x062E, 0x0646, 0x0645, 0x0646, 0x0649, 0x0646, 0x064A, 0x0647, 0x062C, 0x0647, 0x0645,
- 0x0647, 0x0649, 0x0647, 0x064A, 0x064A, 0x062C, 0x064A, 0x062D, 0x064A, 0x062E, 0x064A, 0x0645, 0x064A, 0x0649, 0x064A, 0x064A,
- 0x0630, 0x0670, 0x0631, 0x0670, 0x0649, 0x0670, 0x064C, 0x0651, 0x064D, 0x0651, 0x064E, 0x0651, 0x064F, 0x0651, 0x0650, 0x0651,
- 0x0651, 0x0670, 0x0626, 0x0631, 0x0626, 0x0632, 0x0626, 0x0645, 0x0626, 0x0646, 0x0626, 0x0649, 0x0626, 0x064A, 0x0628, 0x0631,
- 0x0628, 0x0632, 0x0628, 0x0645, 0x0628, 0x0646, 0x0628, 0x0649, 0x0628, 0x064A, 0x062A, 0x0631, 0x062A, 0x0632, 0x062A, 0x0645,
- 0x062A, 0x0646, 0x062A, 0x0649, 0x062A, 0x064A, 0x062B, 0x0631, 0x062B, 0x0632, 0x062B, 0x0645, 0x062B, 0x0646, 0x062B, 0x0649,
- 0x062B, 0x064A, 0x0641, 0x0649, 0x0641, 0x064A, 0x0642, 0x0649, 0x0642, 0x064A, 0x0643, 0x0627, 0x0643, 0x0644, 0x0643, 0x0645,
- 0x0643, 0x0649, 0x0643, 0x064A, 0x0644, 0x0645, 0x0644, 0x0649, 0x0644, 0x064A, 0x0645, 0x0627, 0x0645, 0x0645, 0x0646, 0x0631,
- 0x0646, 0x0632, 0x0646, 0x0645, 0x0646, 0x0646, 0x0646, 0x0649, 0x0646, 0x064A, 0x0649, 0x0670, 0x064A, 0x0631, 0x064A, 0x0632,
- 0x064A, 0x0645, 0x064A, 0x0646, 0x064A, 0x0649, 0x064A, 0x064A, 0x0626, 0x062C, 0x0626, 0x062D, 0x0626, 0x062E, 0x0626, 0x0645,
- 0x0626, 0x0647, 0x0628, 0x062C, 0x0628, 0x062D, 0x0628, 0x062E, 0x0628, 0x0645, 0x0628, 0x0647, 0x062A, 0x062C, 0x062A, 0x062D,
- 0x062A, 0x062E, 0x062A, 0x0645, 0x062A, 0x0647, 0x062B, 0x0645, 0x062C, 0x062D, 0x062C, 0x0645, 0x062D, 0x062C, 0x062D, 0x0645,
- 0x062E, 0x062C, 0x062E, 0x0645, 0x0633, 0x062C, 0x0633, 0x062D, 0x0633, 0x062E, 0x0633, 0x0645, 0x0635, 0x062D, 0x0635, 0x062E,
- 0x0635, 0x0645, 0x0636, 0x062C, 0x0636, 0x062D, 0x0636, 0x062E, 0x0636, 0x0645, 0x0637, 0x062D, 0x0638, 0x0645, 0x0639, 0x062C,
- 0x0639, 0x0645, 0x063A, 0x062C, 0x063A, 0x0645, 0x0641, 0x062C, 0x0641, 0x062D, 0x0641, 0x062E, 0x0641, 0x0645, 0x0642, 0x062D,
- 0x0642, 0x0645, 0x0643, 0x062C, 0x0643, 0x062D, 0x0643, 0x062E, 0x0643, 0x0644, 0x0643, 0x0645, 0x0644, 0x062C, 0x0644, 0x062D,
- 0x0644, 0x062E, 0x0644, 0x0645, 0x0644, 0x0647, 0x0645, 0x062C, 0x0645, 0x062D, 0x0645, 0x062E, 0x0645, 0x0645, 0x0646, 0x062C,
- 0x0646, 0x062D, 0x0646, 0x062E, 0x0646, 0x0645, 0x0646, 0x0647, 0x0647, 0x062C, 0x0647, 0x0645, 0x0647, 0x0670, 0x064A, 0x062C,
- 0x064A, 0x062D, 0x064A, 0x062E, 0x064A, 0x0645, 0x064A, 0x0647, 0x0626, 0x0645, 0x0626, 0x0647, 0x0628, 0x0645, 0x0628, 0x0647,
- 0x062A, 0x0645, 0x062A, 0x0647, 0x062B, 0x0645, 0x062B, 0x0647, 0x0633, 0x0645, 0x0633, 0x0647, 0x0634, 0x0645, 0x0634, 0x0647,
- 0x0643, 0x0644, 0x0643, 0x0645, 0x0644, 0x0645, 0x0646, 0x0645, 0x0646, 0x0647, 0x064A, 0x0645, 0x064A, 0x0647, 0x0637, 0x0649,
- 0x0637, 0x064A, 0x0639, 0x0649, 0x0639, 0x064A, 0x063A, 0x0649, 0x063A, 0x064A, 0x0633, 0x0649, 0x0633, 0x064A, 0x0634, 0x0649,
- 0x0634, 0x064A, 0x062D, 0x0649, 0x062D, 0x064A, 0x062C, 0x0649, 0x062C, 0x064A, 0x062E, 0x0649, 0x062E, 0x064A, 0x0635, 0x0649,
- 0x0635, 0x064A, 0x0636, 0x0649, 0x0636, 0x064A, 0x0634, 0x062C, 0x0634, 0x062D, 0x0634, 0x062E, 0x0634, 0x0645, 0x0634, 0x0631,
- 0x0633, 0x0631, 0x0635, 0x0631, 0x0636, 0x0631, 0x0637, 0x0649, 0x0637, 0x064A, 0x0639, 0x0649, 0x0639, 0x064A, 0x063A, 0x0649,
- 0x063A, 0x064A, 0x0633, 0x0649, 0x0633, 0x064A, 0x0634, 0x0649, 0x0634, 0x064A, 0x062D, 0x0649, 0x062D, 0x064A, 0x062C, 0x0649,
- 0x062C, 0x064A, 0x062E, 0x0649, 0x062E, 0x064A, 0x0635, 0x0649, 0x0635, 0x064A, 0x0636, 0x0649, 0x0636, 0x064A, 0x0634, 0x062C,
- 0x0634, 0x062D, 0x0634, 0x062E, 0x0634, 0x0645, 0x0634, 0x0631, 0x0633, 0x0631, 0x0635, 0x0631, 0x0636, 0x0631, 0x0634, 0x062C,
- 0x0634, 0x062D, 0x0634, 0x062E, 0x0634, 0x0645, 0x0633, 0x0647, 0x0634, 0x0647, 0x0637, 0x0645, 0x0633, 0x062C, 0x0633, 0x062D,
- 0x0633, 0x062E, 0x0634, 0x062C, 0x0634, 0x062D, 0x0634, 0x062E, 0x0637, 0x0645, 0x0638, 0x0645, 0x0627, 0x064B, 0x0627, 0x064B,
- 0x0640, 0x064B, 0x0640, 0x064E, 0x0640, 0x064F, 0x0640, 0x0650, 0x0640, 0x0651, 0x0640, 0x0652, 0x0644, 0x0622, 0x0644, 0x0622,
- 0x0644, 0x0623, 0x0644, 0x0623, 0x0644, 0x0625, 0x0644, 0x0625, 0x0644, 0x0627, 0x0644, 0x0627
-};
-extern const FX_WCHAR g_UnicodeData_Normalization_Map3[1164] = {
- 0x0031, 0x002F, 0x0034, 0x0031, 0x002F, 0x0032, 0x0033, 0x002F, 0x0034, 0x002E, 0x002E, 0x002E, 0x2032, 0x2032, 0x2032, 0x2035,
- 0x2035, 0x2035, 0x0061, 0x002F, 0x0063, 0x0061, 0x002F, 0x0073, 0x0063, 0x002F, 0x006F, 0x0063, 0x002F, 0x0075, 0x0054, 0x0045,
- 0x004C, 0x0046, 0x0041, 0x0058, 0x0031, 0x002F, 0x0037, 0x0031, 0x002F, 0x0039, 0x0031, 0x002F, 0x0033, 0x0032, 0x002F, 0x0033,
- 0x0031, 0x002F, 0x0035, 0x0032, 0x002F, 0x0035, 0x0033, 0x002F, 0x0035, 0x0034, 0x002F, 0x0035, 0x0031, 0x002F, 0x0036, 0x0035,
- 0x002F, 0x0036, 0x0031, 0x002F, 0x0038, 0x0033, 0x002F, 0x0038, 0x0035, 0x002F, 0x0038, 0x0037, 0x002F, 0x0038, 0x0049, 0x0049,
- 0x0049, 0x0056, 0x0049, 0x0049, 0x0058, 0x0049, 0x0049, 0x0069, 0x0069, 0x0069, 0x0076, 0x0069, 0x0069, 0x0078, 0x0069, 0x0069,
- 0x0030, 0x2044, 0x0033, 0x222B, 0x222B, 0x222B, 0x222E, 0x222E, 0x222E, 0x004E, 0x0055, 0x004C, 0x0053, 0x004F, 0x0048, 0x0053,
- 0x0054, 0x0058, 0x0045, 0x0054, 0x0058, 0x0045, 0x004F, 0x0054, 0x0045, 0x004E, 0x0051, 0x0041, 0x0043, 0x004B, 0x0042, 0x0045,
- 0x004C, 0x0044, 0x004C, 0x0045, 0x0044, 0x0043, 0x0031, 0x0044, 0x0043, 0x0032, 0x0044, 0x0043, 0x0033, 0x0044, 0x0043, 0x0034,
- 0x004E, 0x0041, 0x004B, 0x0053, 0x0059, 0x004E, 0x0045, 0x0054, 0x0042, 0x0043, 0x0041, 0x004E, 0x0053, 0x0055, 0x0042, 0x0045,
- 0x0053, 0x0043, 0x0044, 0x0045, 0x004C, 0x0028, 0x0031, 0x0029, 0x0028, 0x0032, 0x0029, 0x0028, 0x0033, 0x0029, 0x0028, 0x0034,
- 0x0029, 0x0028, 0x0035, 0x0029, 0x0028, 0x0036, 0x0029, 0x0028, 0x0037, 0x0029, 0x0028, 0x0038, 0x0029, 0x0028, 0x0039, 0x0029,
- 0x0031, 0x0030, 0x002E, 0x0031, 0x0031, 0x002E, 0x0031, 0x0032, 0x002E, 0x0031, 0x0033, 0x002E, 0x0031, 0x0034, 0x002E, 0x0031,
- 0x0035, 0x002E, 0x0031, 0x0036, 0x002E, 0x0031, 0x0037, 0x002E, 0x0031, 0x0038, 0x002E, 0x0031, 0x0039, 0x002E, 0x0032, 0x0030,
- 0x002E, 0x0028, 0x0061, 0x0029, 0x0028, 0x0062, 0x0029, 0x0028, 0x0063, 0x0029, 0x0028, 0x0064, 0x0029, 0x0028, 0x0065, 0x0029,
- 0x0028, 0x0066, 0x0029, 0x0028, 0x0067, 0x0029, 0x0028, 0x0068, 0x0029, 0x0028, 0x0069, 0x0029, 0x0028, 0x006A, 0x0029, 0x0028,
- 0x006B, 0x0029, 0x0028, 0x006C, 0x0029, 0x0028, 0x006D, 0x0029, 0x0028, 0x006E, 0x0029, 0x0028, 0x006F, 0x0029, 0x0028, 0x0070,
- 0x0029, 0x0028, 0x0071, 0x0029, 0x0028, 0x0072, 0x0029, 0x0028, 0x0073, 0x0029, 0x0028, 0x0074, 0x0029, 0x0028, 0x0075, 0x0029,
- 0x0028, 0x0076, 0x0029, 0x0028, 0x0077, 0x0029, 0x0028, 0x0078, 0x0029, 0x0028, 0x0079, 0x0029, 0x0028, 0x007A, 0x0029, 0x003A,
- 0x003A, 0x003D, 0x003D, 0x003D, 0x003D, 0x0028, 0x1100, 0x0029, 0x0028, 0x1102, 0x0029, 0x0028, 0x1103, 0x0029, 0x0028, 0x1105,
- 0x0029, 0x0028, 0x1106, 0x0029, 0x0028, 0x1107, 0x0029, 0x0028, 0x1109, 0x0029, 0x0028, 0x110B, 0x0029, 0x0028, 0x110C, 0x0029,
- 0x0028, 0x110E, 0x0029, 0x0028, 0x110F, 0x0029, 0x0028, 0x1110, 0x0029, 0x0028, 0x1111, 0x0029, 0x0028, 0x1112, 0x0029, 0x0028,
- 0x4E00, 0x0029, 0x0028, 0x4E8C, 0x0029, 0x0028, 0x4E09, 0x0029, 0x0028, 0x56DB, 0x0029, 0x0028, 0x4E94, 0x0029, 0x0028, 0x516D,
- 0x0029, 0x0028, 0x4E03, 0x0029, 0x0028, 0x516B, 0x0029, 0x0028, 0x4E5D, 0x0029, 0x0028, 0x5341, 0x0029, 0x0028, 0x6708, 0x0029,
- 0x0028, 0x706B, 0x0029, 0x0028, 0x6C34, 0x0029, 0x0028, 0x6728, 0x0029, 0x0028, 0x91D1, 0x0029, 0x0028, 0x571F, 0x0029, 0x0028,
- 0x65E5, 0x0029, 0x0028, 0x682A, 0x0029, 0x0028, 0x6709, 0x0029, 0x0028, 0x793E, 0x0029, 0x0028, 0x540D, 0x0029, 0x0028, 0x7279,
- 0x0029, 0x0028, 0x8CA1, 0x0029, 0x0028, 0x795D, 0x0029, 0x0028, 0x52B4, 0x0029, 0x0028, 0x4EE3, 0x0029, 0x0028, 0x547C, 0x0029,
- 0x0028, 0x5B66, 0x0029, 0x0028, 0x76E3, 0x0029, 0x0028, 0x4F01, 0x0029, 0x0028, 0x8CC7, 0x0029, 0x0028, 0x5354, 0x0029, 0x0028,
- 0x796D, 0x0029, 0x0028, 0x4F11, 0x0029, 0x0028, 0x81EA, 0x0029, 0x0028, 0x81F3, 0x0029, 0x0050, 0x0054, 0x0045, 0x0031, 0x0030,
- 0x6708, 0x0031, 0x0031, 0x6708, 0x0031, 0x0032, 0x6708, 0x0065, 0x0072, 0x0067, 0x004C, 0x0054, 0x0044, 0x30A2, 0x30FC, 0x30EB,
- 0x30A4, 0x30F3, 0x30C1, 0x30A6, 0x30A9, 0x30F3, 0x30AA, 0x30F3, 0x30B9, 0x30AA, 0x30FC, 0x30E0, 0x30AB, 0x30A4, 0x30EA, 0x30AC,
- 0x30ED, 0x30F3, 0x30AC, 0x30F3, 0x30DE, 0x30AE, 0x30CB, 0x30FC, 0x30B0, 0x30E9, 0x30E0, 0x30B1, 0x30FC, 0x30B9, 0x30B3, 0x30EB,
- 0x30CA, 0x30B3, 0x30FC, 0x30DD, 0x30BB, 0x30F3, 0x30C1, 0x30BB, 0x30F3, 0x30C8, 0x30C0, 0x30FC, 0x30B9, 0x30CE, 0x30C3, 0x30C8,
- 0x30CF, 0x30A4, 0x30C4, 0x30D1, 0x30FC, 0x30C4, 0x30D4, 0x30AF, 0x30EB, 0x30D5, 0x30E9, 0x30F3, 0x30DA, 0x30CB, 0x30D2, 0x30D8,
- 0x30EB, 0x30C4, 0x30DA, 0x30F3, 0x30B9, 0x30DA, 0x30FC, 0x30B8, 0x30D9, 0x30FC, 0x30BF, 0x30DC, 0x30EB, 0x30C8, 0x30DD, 0x30F3,
- 0x30C9, 0x30DB, 0x30FC, 0x30EB, 0x30DB, 0x30FC, 0x30F3, 0x30DE, 0x30A4, 0x30EB, 0x30DE, 0x30C3, 0x30CF, 0x30DE, 0x30EB, 0x30AF,
- 0x30E4, 0x30FC, 0x30C9, 0x30E4, 0x30FC, 0x30EB, 0x30E6, 0x30A2, 0x30F3, 0x30EB, 0x30D4, 0x30FC, 0x30EF, 0x30C3, 0x30C8, 0x0031,
- 0x0030, 0x70B9, 0x0031, 0x0031, 0x70B9, 0x0031, 0x0032, 0x70B9, 0x0031, 0x0033, 0x70B9, 0x0031, 0x0034, 0x70B9, 0x0031, 0x0035,
- 0x70B9, 0x0031, 0x0036, 0x70B9, 0x0031, 0x0037, 0x70B9, 0x0031, 0x0038, 0x70B9, 0x0031, 0x0039, 0x70B9, 0x0032, 0x0030, 0x70B9,
- 0x0032, 0x0031, 0x70B9, 0x0032, 0x0032, 0x70B9, 0x0032, 0x0033, 0x70B9, 0x0032, 0x0034, 0x70B9, 0x0068, 0x0050, 0x0061, 0x0062,
- 0x0061, 0x0072, 0x0064, 0x006D, 0x00B2, 0x0064, 0x006D, 0x00B3, 0x0063, 0x0061, 0x006C, 0x006B, 0x0048, 0x007A, 0x004D, 0x0048,
- 0x007A, 0x0047, 0x0048, 0x007A, 0x0054, 0x0048, 0x007A, 0x006D, 0x006D, 0x00B2, 0x0063, 0x006D, 0x00B2, 0x006B, 0x006D, 0x00B2,
- 0x006D, 0x006D, 0x00B3, 0x0063, 0x006D, 0x00B3, 0x006B, 0x006D, 0x00B3, 0x006D, 0x2215, 0x0073, 0x006B, 0x0050, 0x0061, 0x004D,
- 0x0050, 0x0061, 0x0047, 0x0050, 0x0061, 0x0072, 0x0061, 0x0064, 0x0043, 0x006F, 0x002E, 0x006C, 0x006F, 0x0067, 0x006D, 0x0069,
- 0x006C, 0x006D, 0x006F, 0x006C, 0x0050, 0x0050, 0x004D, 0x0056, 0x2215, 0x006D, 0x0041, 0x2215, 0x006D, 0x0031, 0x0030, 0x65E5,
- 0x0031, 0x0031, 0x65E5, 0x0031, 0x0032, 0x65E5, 0x0031, 0x0033, 0x65E5, 0x0031, 0x0034, 0x65E5, 0x0031, 0x0035, 0x65E5, 0x0031,
- 0x0036, 0x65E5, 0x0031, 0x0037, 0x65E5, 0x0031, 0x0038, 0x65E5, 0x0031, 0x0039, 0x65E5, 0x0032, 0x0030, 0x65E5, 0x0032, 0x0031,
- 0x65E5, 0x0032, 0x0032, 0x65E5, 0x0032, 0x0033, 0x65E5, 0x0032, 0x0034, 0x65E5, 0x0032, 0x0035, 0x65E5, 0x0032, 0x0036, 0x65E5,
- 0x0032, 0x0037, 0x65E5, 0x0032, 0x0038, 0x65E5, 0x0032, 0x0039, 0x65E5, 0x0033, 0x0030, 0x65E5, 0x0033, 0x0031, 0x65E5, 0x0067,
- 0x0061, 0x006C, 0x0066, 0x0066, 0x0069, 0x0066, 0x0066, 0x006C, 0x0640, 0x064E, 0x0651, 0x0640, 0x064F, 0x0651, 0x0640, 0x0650,
- 0x0651, 0x062A, 0x062C, 0x0645, 0x062A, 0x062D, 0x062C, 0x062A, 0x062D, 0x062C, 0x062A, 0x062D, 0x0645, 0x062A, 0x062E, 0x0645,
- 0x062A, 0x0645, 0x062C, 0x062A, 0x0645, 0x062D, 0x062A, 0x0645, 0x062E, 0x062C, 0x0645, 0x062D, 0x062C, 0x0645, 0x062D, 0x062D,
- 0x0645, 0x064A, 0x062D, 0x0645, 0x0649, 0x0633, 0x062D, 0x062C, 0x0633, 0x062C, 0x062D, 0x0633, 0x062C, 0x0649, 0x0633, 0x0645,
- 0x062D, 0x0633, 0x0645, 0x062D, 0x0633, 0x0645, 0x062C, 0x0633, 0x0645, 0x0645, 0x0633, 0x0645, 0x0645, 0x0635, 0x062D, 0x062D,
- 0x0635, 0x062D, 0x062D, 0x0635, 0x0645, 0x0645, 0x0634, 0x062D, 0x0645, 0x0634, 0x062D, 0x0645, 0x0634, 0x062C, 0x064A, 0x0634,
- 0x0645, 0x062E, 0x0634, 0x0645, 0x062E, 0x0634, 0x0645, 0x0645, 0x0634, 0x0645, 0x0645, 0x0636, 0x062D, 0x0649, 0x0636, 0x062E,
- 0x0645, 0x0636, 0x062E, 0x0645, 0x0637, 0x0645, 0x062D, 0x0637, 0x0645, 0x062D, 0x0637, 0x0645, 0x0645, 0x0637, 0x0645, 0x064A,
- 0x0639, 0x062C, 0x0645, 0x0639, 0x0645, 0x0645, 0x0639, 0x0645, 0x0645, 0x0639, 0x0645, 0x0649, 0x063A, 0x0645, 0x0645, 0x063A,
- 0x0645, 0x064A, 0x063A, 0x0645, 0x0649, 0x0641, 0x062E, 0x0645, 0x0641, 0x062E, 0x0645, 0x0642, 0x0645, 0x062D, 0x0642, 0x0645,
- 0x0645, 0x0644, 0x062D, 0x0645, 0x0644, 0x062D, 0x064A, 0x0644, 0x062D, 0x0649, 0x0644, 0x062C, 0x062C, 0x0644, 0x062C, 0x062C,
- 0x0644, 0x062E, 0x0645, 0x0644, 0x062E, 0x0645, 0x0644, 0x0645, 0x062D, 0x0644, 0x0645, 0x062D, 0x0645, 0x062D, 0x062C, 0x0645,
- 0x062D, 0x0645, 0x0645, 0x062D, 0x064A, 0x0645, 0x062C, 0x062D, 0x0645, 0x062C, 0x0645, 0x0645, 0x062E, 0x062C, 0x0645, 0x062E,
- 0x0645, 0x0645, 0x062C, 0x062E, 0x0647, 0x0645, 0x062C, 0x0647, 0x0645, 0x0645, 0x0646, 0x062D, 0x0645, 0x0646, 0x062D, 0x0649,
- 0x0646, 0x062C, 0x0645, 0x0646, 0x062C, 0x0645, 0x0646, 0x062C, 0x0649, 0x0646, 0x0645, 0x064A, 0x0646, 0x0645, 0x0649, 0x064A,
- 0x0645, 0x0645, 0x064A, 0x0645, 0x0645, 0x0628, 0x062E, 0x064A, 0x062A, 0x062C, 0x064A, 0x062A, 0x062C, 0x0649, 0x062A, 0x062E,
- 0x064A, 0x062A, 0x062E, 0x0649, 0x062A, 0x0645, 0x064A, 0x062A, 0x0645, 0x0649, 0x062C, 0x0645, 0x064A, 0x062C, 0x062D, 0x0649,
- 0x062C, 0x0645, 0x0649, 0x0633, 0x062E, 0x0649, 0x0635, 0x062D, 0x064A, 0x0634, 0x062D, 0x064A, 0x0636, 0x062D, 0x064A, 0x0644,
- 0x062C, 0x064A, 0x0644, 0x0645, 0x064A, 0x064A, 0x062D, 0x064A, 0x064A, 0x062C, 0x064A, 0x064A, 0x0645, 0x064A, 0x0645, 0x0645,
- 0x064A, 0x0642, 0x0645, 0x064A, 0x0646, 0x062D, 0x064A, 0x0642, 0x0645, 0x062D, 0x0644, 0x062D, 0x0645, 0x0639, 0x0645, 0x064A,
- 0x0643, 0x0645, 0x064A, 0x0646, 0x062C, 0x062D, 0x0645, 0x062E, 0x064A, 0x0644, 0x062C, 0x0645, 0x0643, 0x0645, 0x0645, 0x0644,
- 0x062C, 0x0645, 0x0646, 0x062C, 0x062D, 0x062C, 0x062D, 0x064A, 0x062D, 0x062C, 0x064A, 0x0645, 0x062C, 0x064A, 0x0641, 0x0645,
- 0x064A, 0x0628, 0x062D, 0x064A, 0x0643, 0x0645, 0x0645, 0x0639, 0x062C, 0x0645, 0x0635, 0x0645, 0x0645, 0x0633, 0x062E, 0x064A,
- 0x0646, 0x062C, 0x064A, 0x0635, 0x0644, 0x06D2, 0x0642, 0x0644, 0x06D2, 0x0635, 0x0644, 0x0649
-};
-extern const FX_WCHAR g_UnicodeData_Normalization_Map4[488] = {
- 0x0004, 0x2032, 0x2032, 0x2032, 0x2032, 0x0004, 0x0031, 0x002F, 0x0031, 0x0030, 0x0004, 0x0056, 0x0049, 0x0049, 0x0049, 0x0004,
- 0x0076, 0x0069, 0x0069, 0x0069, 0x0004, 0x0028, 0x0031, 0x0030, 0x0029, 0x0004, 0x0028, 0x0031, 0x0031, 0x0029, 0x0004, 0x0028,
- 0x0031, 0x0032, 0x0029, 0x0004, 0x0028, 0x0031, 0x0033, 0x0029, 0x0004, 0x0028, 0x0031, 0x0034, 0x0029, 0x0004, 0x0028, 0x0031,
- 0x0035, 0x0029, 0x0004, 0x0028, 0x0031, 0x0036, 0x0029, 0x0004, 0x0028, 0x0031, 0x0037, 0x0029, 0x0004, 0x0028, 0x0031, 0x0038,
- 0x0029, 0x0004, 0x0028, 0x0031, 0x0039, 0x0029, 0x0004, 0x0028, 0x0032, 0x0030, 0x0029, 0x0004, 0x222B, 0x222B, 0x222B, 0x222B,
- 0x0004, 0x0028, 0x1100, 0x1161, 0x0029, 0x0004, 0x0028, 0x1102, 0x1161, 0x0029, 0x0004, 0x0028, 0x1103, 0x1161, 0x0029, 0x0004,
- 0x0028, 0x1105, 0x1161, 0x0029, 0x0004, 0x0028, 0x1106, 0x1161, 0x0029, 0x0004, 0x0028, 0x1107, 0x1161, 0x0029, 0x0004, 0x0028,
- 0x1109, 0x1161, 0x0029, 0x0004, 0x0028, 0x110B, 0x1161, 0x0029, 0x0004, 0x0028, 0x110C, 0x1161, 0x0029, 0x0004, 0x0028, 0x110E,
- 0x1161, 0x0029, 0x0004, 0x0028, 0x110F, 0x1161, 0x0029, 0x0004, 0x0028, 0x1110, 0x1161, 0x0029, 0x0004, 0x0028, 0x1111, 0x1161,
- 0x0029, 0x0004, 0x0028, 0x1112, 0x1161, 0x0029, 0x0004, 0x0028, 0x110C, 0x116E, 0x0029, 0x0007, 0x0028, 0x110B, 0x1169, 0x110C,
- 0x1165, 0x11AB, 0x0029, 0x0006, 0x0028, 0x110B, 0x1169, 0x1112, 0x116E, 0x0029, 0x0005, 0x110E, 0x1161, 0x11B7, 0x1100, 0x1169,
- 0x0004, 0x110C, 0x116E, 0x110B, 0x1174, 0x0004, 0x30A2, 0x30D1, 0x30FC, 0x30C8, 0x0004, 0x30A2, 0x30EB, 0x30D5, 0x30A1, 0x0004,
- 0x30A2, 0x30F3, 0x30DA, 0x30A2, 0x0004, 0x30A4, 0x30CB, 0x30F3, 0x30B0, 0x0005, 0x30A8, 0x30B9, 0x30AF, 0x30FC, 0x30C9, 0x0004,
- 0x30A8, 0x30FC, 0x30AB, 0x30FC, 0x0004, 0x30AB, 0x30E9, 0x30C3, 0x30C8, 0x0004, 0x30AB, 0x30ED, 0x30EA, 0x30FC, 0x0004, 0x30AD,
- 0x30E5, 0x30EA, 0x30FC, 0x0004, 0x30AE, 0x30EB, 0x30C0, 0x30FC, 0x0005, 0x30AD, 0x30ED, 0x30B0, 0x30E9, 0x30E0, 0x0006, 0x30AD,
- 0x30ED, 0x30E1, 0x30FC, 0x30C8, 0x30EB, 0x0005, 0x30AD, 0x30ED, 0x30EF, 0x30C3, 0x30C8, 0x0005, 0x30B0, 0x30E9, 0x30E0, 0x30C8,
- 0x30F3, 0x0005, 0x30AF, 0x30EB, 0x30BC, 0x30A4, 0x30ED, 0x0004, 0x30AF, 0x30ED, 0x30FC, 0x30CD, 0x0004, 0x30B5, 0x30A4, 0x30AF,
- 0x30EB, 0x0005, 0x30B5, 0x30F3, 0x30C1, 0x30FC, 0x30E0, 0x0004, 0x30B7, 0x30EA, 0x30F3, 0x30B0, 0x0005, 0x30D1, 0x30FC, 0x30BB,
- 0x30F3, 0x30C8, 0x0004, 0x30D0, 0x30FC, 0x30EC, 0x30EB, 0x0005, 0x30D4, 0x30A2, 0x30B9, 0x30C8, 0x30EB, 0x0005, 0x30D5, 0x30A1,
- 0x30E9, 0x30C3, 0x30C9, 0x0004, 0x30D5, 0x30A3, 0x30FC, 0x30C8, 0x0005, 0x30D6, 0x30C3, 0x30B7, 0x30A7, 0x30EB, 0x0005, 0x30D8,
- 0x30AF, 0x30BF, 0x30FC, 0x30EB, 0x0004, 0x30DD, 0x30A4, 0x30F3, 0x30C8, 0x0004, 0x30DE, 0x30A4, 0x30AF, 0x30ED, 0x0005, 0x30DE,
- 0x30F3, 0x30B7, 0x30E7, 0x30F3, 0x0004, 0x30DF, 0x30AF, 0x30ED, 0x30F3, 0x0005, 0x30DF, 0x30EA, 0x30D0, 0x30FC, 0x30EB, 0x0004,
- 0x30E1, 0x30AC, 0x30C8, 0x30F3, 0x0004, 0x30E1, 0x30FC, 0x30C8, 0x30EB, 0x0004, 0x30EA, 0x30C3, 0x30C8, 0x30EB, 0x0004, 0x30EB,
- 0x30FC, 0x30D6, 0x30EB, 0x0005, 0x30EC, 0x30F3, 0x30C8, 0x30B2, 0x30F3, 0x0004, 0x682A, 0x5F0F, 0x4F1A, 0x793E, 0x0004, 0x006B,
- 0x0063, 0x0061, 0x006C, 0x0004, 0x006D, 0x2215, 0x0073, 0x00B2, 0x0005, 0x0072, 0x0061, 0x0064, 0x2215, 0x0073, 0x0006, 0x0072,
- 0x0061, 0x0064, 0x2215, 0x0073, 0x00B2, 0x0004, 0x0061, 0x002E, 0x006D, 0x002E, 0x0004, 0x0043, 0x2215, 0x006B, 0x0067, 0x0004,
- 0x0070, 0x002E, 0x006D, 0x002E, 0x0004, 0x0627, 0x0644, 0x0644, 0x0647, 0x0004, 0x0627, 0x0643, 0x0628, 0x0631, 0x0004, 0x0645,
- 0x062D, 0x0645, 0x062F, 0x0004, 0x0635, 0x0644, 0x0639, 0x0645, 0x0004, 0x0631, 0x0633, 0x0648, 0x0644, 0x0004, 0x0639, 0x0644,
- 0x064A, 0x0647, 0x0004, 0x0648, 0x0633, 0x0644, 0x0645, 0x0012, 0x0635, 0x0644, 0x0649, 0x0020, 0x0627, 0x0644, 0x0644, 0x0647,
- 0x0020, 0x0639, 0x0644, 0x064A, 0x0647, 0x0020, 0x0648, 0x0633, 0x0644, 0x0645, 0x0008, 0x062C, 0x0644, 0x0020, 0x062C, 0x0644,
- 0x0627, 0x0644, 0x0647, 0x0004, 0x0631, 0x06CC, 0x0627, 0x0644
-};
+// 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
+
+#include "../../include/fxcrt/fx_system.h"
+extern const FX_WCHAR g_UnicodeData_Normalization[65536] = {
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x8000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8001, 0x0000, 0x2000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2002, 0x8002, 0x0000, 0x2004, 0x0000, 0x0000, 0x8003,
+ 0x8004, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8005, 0x0000, 0x8006, 0x0000, 0x0000, 0x0000, 0x8007, 0x8008,
+ 0x0000, 0x0000, 0x8009, 0x800A, 0x800B, 0x800C, 0x0000, 0x0000, 0x800D, 0x800E, 0x800F, 0x0000, 0x3000, 0x3003, 0x3006, 0x0000,
+ 0x8010, 0x8011, 0x8012, 0x8013, 0x8014, 0x8015, 0x0000, 0x8016, 0x8017, 0x8018, 0x8019, 0x801A, 0x801B, 0x801C, 0x801D, 0x801E,
+ 0x801F, 0x8020, 0x8021, 0x8022, 0x8023, 0x8024, 0x8025, 0x0000, 0x8026, 0x8027, 0x8028, 0x8029, 0x802A, 0x802B, 0x0000, 0x0000,
+ 0x802C, 0x802D, 0x802E, 0x802F, 0x8030, 0x8031, 0x0000, 0x8032, 0x8033, 0x8034, 0x8035, 0x8036, 0x8037, 0x8038, 0x8039, 0x803A,
+ 0x0000, 0x803B, 0x803C, 0x803D, 0x803E, 0x803F, 0x8040, 0x0000, 0x8041, 0x8042, 0x8043, 0x8044, 0x8045, 0x8046, 0x0000, 0x8047,
+ 0x8048, 0x8049, 0x804A, 0x804B, 0x804C, 0x804D, 0x804E, 0x804F, 0x8050, 0x8051, 0x8052, 0x8053, 0x8054, 0x8055, 0x8056, 0x8057,
+ 0x8058, 0x8059, 0x805A, 0x805B, 0x805C, 0x805D, 0x805E, 0x805F, 0x8060, 0x8061, 0x8062, 0x8063, 0x8064, 0x8065, 0x8066, 0x8067,
+ 0x8068, 0x8069, 0x806A, 0x806B, 0x806C, 0x806D, 0x806E, 0x806F, 0x8070, 0x8071, 0x8072, 0x8073, 0x8074, 0x8075, 0x8076, 0x8077,
+ 0x8078, 0x0000, 0x2006, 0x2008, 0x8079, 0x807A, 0x807B, 0x807C, 0x807D, 0x807E, 0x807F, 0x8080, 0x8081, 0x8082, 0x8083, 0x8084,
+ 0x8085, 0x8086, 0x8087, 0x8088, 0x8089, 0x808A, 0x808B, 0x808C, 0x808D, 0x808E, 0x0000, 0x0000, 0x808F, 0x8090, 0x8091, 0x8092,
+ 0x8093, 0x8094, 0x200A, 0x200C, 0x8095, 0x8096, 0x8097, 0x8098, 0x8099, 0x809A, 0x809B, 0x809C, 0x809D, 0x809E, 0x809F, 0x80A0,
+ 0x80A1, 0x80A2, 0x80A3, 0x80A4, 0x80A5, 0x80A6, 0x80A7, 0x80A8, 0x80A9, 0x80AA, 0x80AB, 0x80AC, 0x80AD, 0x80AE, 0x80AF, 0x80B0,
+ 0x80B1, 0x80B2, 0x80B3, 0x80B4, 0x80B5, 0x80B6, 0x80B7, 0x80B8, 0x80B9, 0x80BA, 0x80BB, 0x80BC, 0x80BD, 0x80BE, 0x80BF, 0x80C0,
+ 0x80C1, 0x80C2, 0x80C3, 0x80C4, 0x0000, 0x0000, 0x0000, 0x80C5, 0x80C6, 0x80C7, 0x80C8, 0x80C9, 0x80CA, 0x0000, 0x80CB, 0x0000,
+ 0x80CC, 0x80CD, 0x80CE, 0x80CF, 0x0000, 0x0000, 0x0000, 0x80D0, 0x80D1, 0x80D2, 0x80D3, 0x0000, 0x80D4, 0x80D5, 0x80D6, 0x80D7,
+ 0x80D8, 0x80D9, 0x0000, 0x0000, 0x80DA, 0x80DB, 0x0000, 0x0000, 0x0000, 0x0000, 0x80DC, 0x80DD, 0x80DE, 0x80DF, 0x80E0, 0x80E1,
+ 0x80E2, 0x0000, 0x80E3, 0x80E4, 0x80E5, 0x80E6, 0x80E7, 0x0000, 0x80E8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x200E, 0x2010, 0x2012, 0x2014, 0x2016, 0x2018, 0x201A, 0x201C, 0x201E, 0x80E9, 0x80EA, 0x80EB,
+ 0x80EC, 0x80ED, 0x80EE, 0x80EF, 0x80F0, 0x80F1, 0x80F2, 0x80F3, 0x80F4, 0x80F5, 0x80F6, 0x80F7, 0x80F8, 0x80F9, 0x80FA, 0x80FB,
+ 0x80FC, 0x80FD, 0x80FE, 0x80FF, 0x8100, 0x8101, 0x8102, 0x8103, 0x8104, 0x8105, 0x8106, 0x8107, 0x8108, 0x8109, 0x810A, 0x810B,
+ 0x810C, 0x2020, 0x2022, 0x2024, 0x810D, 0x810E, 0x0000, 0x0000, 0x810F, 0x8110, 0x8111, 0x8112, 0x8113, 0x8114, 0x8115, 0x8116,
+ 0x8117, 0x8118, 0x8119, 0x811A, 0x811B, 0x811C, 0x811D, 0x811E, 0x811F, 0x8120, 0x8121, 0x8122, 0x8123, 0x8124, 0x8125, 0x8126,
+ 0x8127, 0x8128, 0x8129, 0x812A, 0x812B, 0x812C, 0x812D, 0x812E, 0x812F, 0x8130, 0x8131, 0x8132, 0x0000, 0x0000, 0x8133, 0x8134,
+ 0x8135, 0x8136, 0x0000, 0x0000, 0x8137, 0x8138, 0x8139, 0x813A, 0x813B, 0x813C, 0x813D, 0x813E, 0x813F, 0x8140, 0x8141, 0x8142,
+ 0x8143, 0x8144, 0x8145, 0x8146, 0x8147, 0x8148, 0x8149, 0x814A, 0x2026, 0x2028, 0x814B, 0x814C, 0x814D, 0x814E, 0x814F, 0x8150,
+ 0x8151, 0x0000, 0x0000, 0x8152, 0x8153, 0x8154, 0x8155, 0x8156, 0x8157, 0x8158, 0x8159, 0x815A, 0x815B, 0x815C, 0x815D, 0x815E,
+ 0x815F, 0x0000, 0x8160, 0x8161, 0x8162, 0x8163, 0x8164, 0x8165, 0x8166, 0x0000, 0x8167, 0x8168, 0x8169, 0x816A, 0x816B, 0x816C,
+ 0x816D, 0x816E, 0x816F, 0x0000, 0x0000, 0x8170, 0x8171, 0x0000, 0x8172, 0x0000, 0x8173, 0x8174, 0x8175, 0x8176, 0x0000, 0x8177,
+ 0x8178, 0x8179, 0x817A, 0x817B, 0x817C, 0x817D, 0x202A, 0x0000, 0x0000, 0x817E, 0x817F, 0x8180, 0x8181, 0x8182, 0x8183, 0x8184,
+ 0x8185, 0x8186, 0x8187, 0x0000, 0x8188, 0x8189, 0x818A, 0x818B, 0x818C, 0x818D, 0x0000, 0x818E, 0x818F, 0x8190, 0x8191, 0x8192,
+ 0x8193, 0x8194, 0x0000, 0x8195, 0x0000, 0x0000, 0x0000, 0x8196, 0x0000, 0x8197, 0x8198, 0x8199, 0x819A, 0x819B, 0x819C, 0x819D,
+ 0x819E, 0x0000, 0x0000, 0x202C, 0x202E, 0x2030, 0x2032, 0x2034, 0x2036, 0x2038, 0x203A, 0x203C, 0x0000, 0x0000, 0x819F, 0x81A0,
+ 0x81A1, 0x81A2, 0x81A3, 0x81A4, 0x81A5, 0x81A6, 0x81A7, 0x81A8, 0x81A9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x81AA, 0x81AB, 0x81AC, 0x81AD, 0x81AE, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x81AF, 0x81B0, 0x0000, 0x81B1, 0x81B2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x81B3, 0x81B4, 0x81B5, 0x81B6, 0x81B7, 0x81B8, 0x81B9, 0x81BA, 0x81BB, 0x81BC, 0x81BD, 0x81BE, 0x81BF,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x81C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x81C1, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x81C2, 0x81C3, 0x81C4, 0x81C5, 0x81C6, 0x81C7, 0x81C8, 0x0000, 0x81C9, 0x0000, 0x81CA, 0x81CB,
+ 0x81CC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x81CD, 0x81CE, 0x81CF, 0x81D0, 0x81D1, 0x81D2,
+ 0x81D3, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x81D4, 0x81D5, 0x81D6, 0x81D7, 0x81D8, 0x0000,
+ 0x81D9, 0x81DA, 0x81DB, 0x81DC, 0x81DD, 0x81DE, 0x81DF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x81E0, 0x81E1, 0x81E2, 0x0000, 0x81E3, 0x81E4, 0x0000, 0x0000, 0x0000, 0x81E5, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x81E6, 0x81E7, 0x0000, 0x81E8, 0x0000, 0x0000, 0x0000, 0x81E9, 0x0000, 0x0000, 0x0000, 0x0000, 0x81EA, 0x81EB, 0x81EC, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x81ED, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x81EE, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x81EF, 0x81F0, 0x0000, 0x81F1, 0x0000, 0x0000, 0x0000, 0x81F2, 0x0000, 0x0000, 0x0000, 0x0000, 0x81F3, 0x81F4, 0x81F5, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x81F6, 0x81F7, 0x0000, 0x0000, 0x81F8, 0x81F9, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x81FA, 0x81FB, 0x0000, 0x0000, 0x0000, 0x0000, 0x81FC, 0x81FD, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x81FE, 0x81FF, 0x0000, 0x0000, 0x8200, 0x8201,
+ 0x8202, 0x8203, 0x8204, 0x8205, 0x8206, 0x8207, 0x8208, 0x8209, 0x820A, 0x820B, 0x820C, 0x820D, 0x820E, 0x820F, 0x8210, 0x8211,
+ 0x8212, 0x8213, 0x8214, 0x8215, 0x203E, 0x2040, 0x8216, 0x8217, 0x0000, 0x0000, 0x8218, 0x8219, 0x821A, 0x821B, 0x0000, 0x0000,
+ 0x821C, 0x821D, 0x821E, 0x821F, 0x2042, 0x2044, 0x8220, 0x8221, 0x8222, 0x8223, 0x0000, 0x0000, 0x8224, 0x8225, 0x8226, 0x8227,
+ 0x0000, 0x8228, 0x8229, 0x822A, 0x822B, 0x822C, 0x822D, 0x822E, 0x822F, 0x8230, 0x8231, 0x0000, 0x0000, 0x8232, 0x8233, 0x0000,
+ 0x8234, 0x8235, 0x8236, 0x8237, 0x2046, 0x2048, 0x8238, 0x8239, 0x0000, 0x0000, 0x823A, 0x823B, 0x823C, 0x823D, 0x823E, 0x823F,
+ 0x0000, 0x0000, 0x8240, 0x8241, 0x8242, 0x8243, 0x8244, 0x8245, 0x0000, 0x0000, 0x8246, 0x8247, 0x8248, 0x8249, 0x824A, 0x824B,
+ 0x824C, 0x824D, 0x824E, 0x824F, 0x8250, 0x8251, 0x8252, 0x8253, 0x8254, 0x8255, 0x8256, 0x8257, 0x8258, 0x8259, 0x825A, 0x825B,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x825C, 0x825D, 0x825E, 0x825F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x204A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x204C, 0x204E, 0x2050, 0x2052, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x2054, 0x0000, 0x2056, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x2058, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x205A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x205C, 0x0000, 0x0000, 0x205E, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2060, 0x2062, 0x2064, 0x2066, 0x2068, 0x206A, 0x206C, 0x206E,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2070, 0x2072, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2074, 0x2076, 0x0000, 0x2078,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x207A, 0x0000, 0x0000, 0x207C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x207E, 0x2080, 0x2082, 0x0000, 0x0000, 0x2084, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2086, 0x0000, 0x0000, 0x2088, 0x208A, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x208C, 0x208E, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x2090, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2092, 0x2094, 0x2096, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2098, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x209A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x209C, 0x209E, 0x0000, 0x20A0, 0x20A2, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x20A4, 0x20A6, 0x20A8, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x20AA, 0x0000, 0x20AC, 0x20AE, 0x20B0, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x20B2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x20B4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x20B6, 0x20B8, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8260, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x20BA, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x20BC, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x20BE, 0x0000, 0x0000, 0x0000, 0x0000, 0x20C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x20C2, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x20C4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x20C6, 0x0000, 0x20C8, 0x20CA, 0x20CC, 0x20CE, 0x20D0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x20D2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x20D4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x20D6, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x20D8, 0x0000, 0x0000, 0x0000, 0x0000, 0x20DA, 0x0000, 0x0000, 0x0000, 0x0000, 0x20DC, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x20DE, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x20E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8261, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x20E2, 0x0000, 0x20E4, 0x0000, 0x20E6, 0x0000, 0x20E8, 0x0000, 0x20EA, 0x0000,
+ 0x0000, 0x0000, 0x20EC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x20EE, 0x0000, 0x20F0, 0x0000, 0x0000,
+ 0x20F2, 0x20F4, 0x0000, 0x20F6, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8262, 0x8263, 0x8264, 0x8265,
+ 0x8266, 0x8267, 0x8268, 0x8269, 0x826A, 0x826B, 0x826C, 0x826D, 0x826E, 0x826F, 0x8270, 0x0000, 0x8271, 0x8272, 0x8273, 0x8274,
+ 0x8275, 0x8276, 0x8277, 0x8278, 0x8279, 0x827A, 0x827B, 0x827C, 0x827D, 0x827E, 0x827F, 0x8280, 0x8281, 0x8282, 0x0000, 0x8283,
+ 0x8284, 0x8285, 0x8286, 0x8287, 0x8288, 0x8289, 0x828A, 0x828B, 0x828C, 0x828D, 0x828E, 0x828F, 0x8290, 0x8291, 0x8292, 0x8293,
+ 0x8294, 0x8295, 0x8296, 0x8297, 0x8298, 0x8299, 0x829A, 0x829B, 0x829C, 0x829D, 0x829E, 0x0000, 0x829F, 0x82A0, 0x82A1, 0x82A2,
+ 0x82A3, 0x82A4, 0x82A5, 0x82A6, 0x82A7, 0x82A8, 0x82A9, 0x82AA, 0x82AB, 0x0000, 0x20F8, 0x82AC, 0x0000, 0x82AD, 0x82AE, 0x82AF,
+ 0x82B0, 0x82B1, 0x82B2, 0x82B3, 0x82B4, 0x82B5, 0x82B6, 0x82B7, 0x82B8, 0x82B9, 0x82BA, 0x82BB, 0x82BC, 0x82BD, 0x82BE, 0x82BF,
+ 0x82C0, 0x82C1, 0x82C2, 0x82C3, 0x82C4, 0x82C5, 0x82C6, 0x0000, 0x82C7, 0x0000, 0x0000, 0x82C8, 0x82C9, 0x82CA, 0x82CB, 0x82CC,
+ 0x82CD, 0x82CE, 0x82CF, 0x82D0, 0x82D1, 0x82D2, 0x82D3, 0x82D4, 0x82D5, 0x82D6, 0x82D7, 0x82D8, 0x82D9, 0x82DA, 0x82DB, 0x82DC,
+ 0x82DD, 0x82DE, 0x82DF, 0x82E0, 0x82E1, 0x82E2, 0x82E3, 0x82E4, 0x82E5, 0x82E6, 0x82E7, 0x82E8, 0x82E9, 0x82EA, 0x82EB, 0x82EC,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x82ED, 0x82EE, 0x82EF, 0x82F0, 0x82F1, 0x82F2, 0x82F3, 0x82F4, 0x82F5, 0x82F6, 0x82F7, 0x82F8, 0x82F9, 0x82FA, 0x82FB, 0x82FC,
+ 0x82FD, 0x82FE, 0x82FF, 0x8300, 0x8301, 0x8302, 0x8303, 0x8304, 0x8305, 0x8306, 0x8307, 0x8308, 0x8309, 0x830A, 0x830B, 0x830C,
+ 0x830D, 0x830E, 0x830F, 0x8310, 0x8311, 0x8312, 0x8313, 0x8314, 0x8315, 0x8316, 0x8317, 0x8318, 0x8319, 0x831A, 0x831B, 0x831C,
+ 0x831D, 0x831E, 0x831F, 0x8320, 0x8321, 0x8322, 0x8323, 0x8324, 0x8325, 0x8326, 0x8327, 0x8328, 0x8329, 0x832A, 0x832B, 0x832C,
+ 0x832D, 0x832E, 0x832F, 0x8330, 0x8331, 0x8332, 0x8333, 0x8334, 0x8335, 0x8336, 0x8337, 0x8338, 0x8339, 0x833A, 0x833B, 0x833C,
+ 0x833D, 0x833E, 0x833F, 0x8340, 0x8341, 0x8342, 0x8343, 0x8344, 0x8345, 0x8346, 0x8347, 0x8348, 0x8349, 0x834A, 0x834B, 0x834C,
+ 0x834D, 0x834E, 0x834F, 0x8350, 0x8351, 0x8352, 0x8353, 0x8354, 0x8355, 0x8356, 0x8357, 0x8358, 0x8359, 0x835A, 0x835B, 0x835C,
+ 0x835D, 0x835E, 0x835F, 0x8360, 0x8361, 0x8362, 0x8363, 0x8364, 0x8365, 0x8366, 0x8367, 0x8368, 0x8369, 0x836A, 0x836B, 0x836C,
+ 0x836D, 0x836E, 0x836F, 0x8370, 0x8371, 0x8372, 0x8373, 0x8374, 0x8375, 0x8376, 0x8377, 0x8378, 0x8379, 0x837A, 0x837B, 0x837C,
+ 0x837D, 0x837E, 0x837F, 0x8380, 0x8381, 0x8382, 0x8383, 0x8384, 0x8385, 0x8386, 0x8387, 0x8388, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x8389, 0x838A, 0x838B, 0x838C, 0x838D, 0x838E, 0x838F, 0x8390, 0x8391, 0x8392, 0x8393, 0x8394, 0x8395, 0x8396, 0x8397, 0x8398,
+ 0x8399, 0x839A, 0x839B, 0x839C, 0x839D, 0x839E, 0x839F, 0x83A0, 0x83A1, 0x83A2, 0x83A3, 0x83A4, 0x83A5, 0x83A6, 0x83A7, 0x83A8,
+ 0x83A9, 0x83AA, 0x83AB, 0x83AC, 0x83AD, 0x83AE, 0x83AF, 0x83B0, 0x83B1, 0x83B2, 0x83B3, 0x83B4, 0x83B5, 0x83B6, 0x83B7, 0x83B8,
+ 0x83B9, 0x83BA, 0x83BB, 0x83BC, 0x83BD, 0x83BE, 0x83BF, 0x83C0, 0x83C1, 0x83C2, 0x83C3, 0x83C4, 0x83C5, 0x83C6, 0x83C7, 0x83C8,
+ 0x83C9, 0x83CA, 0x83CB, 0x83CC, 0x83CD, 0x83CE, 0x83CF, 0x83D0, 0x83D1, 0x83D2, 0x83D3, 0x83D4, 0x83D5, 0x83D6, 0x83D7, 0x83D8,
+ 0x83D9, 0x83DA, 0x83DB, 0x83DC, 0x83DD, 0x83DE, 0x83DF, 0x83E0, 0x83E1, 0x83E2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x83E3, 0x83E4, 0x83E5, 0x83E6, 0x83E7, 0x83E8, 0x83E9, 0x83EA, 0x83EB, 0x83EC, 0x83ED, 0x83EE, 0x83EF, 0x83F0, 0x83F1, 0x83F2,
+ 0x83F3, 0x83F4, 0x83F5, 0x83F6, 0x83F7, 0x83F8, 0x0000, 0x0000, 0x83F9, 0x83FA, 0x83FB, 0x83FC, 0x83FD, 0x83FE, 0x0000, 0x0000,
+ 0x83FF, 0x8400, 0x8401, 0x8402, 0x8403, 0x8404, 0x8405, 0x8406, 0x8407, 0x8408, 0x8409, 0x840A, 0x840B, 0x840C, 0x840D, 0x840E,
+ 0x840F, 0x8410, 0x8411, 0x8412, 0x8413, 0x8414, 0x8415, 0x8416, 0x8417, 0x8418, 0x8419, 0x841A, 0x841B, 0x841C, 0x841D, 0x841E,
+ 0x841F, 0x8420, 0x8421, 0x8422, 0x8423, 0x8424, 0x0000, 0x0000, 0x8425, 0x8426, 0x8427, 0x8428, 0x8429, 0x842A, 0x0000, 0x0000,
+ 0x842B, 0x842C, 0x842D, 0x842E, 0x842F, 0x8430, 0x8431, 0x8432, 0x0000, 0x8433, 0x0000, 0x8434, 0x0000, 0x8435, 0x0000, 0x8436,
+ 0x8437, 0x8438, 0x8439, 0x843A, 0x843B, 0x843C, 0x843D, 0x843E, 0x843F, 0x8440, 0x8441, 0x8442, 0x8443, 0x8444, 0x8445, 0x8446,
+ 0x8447, 0x8448, 0x8449, 0x844A, 0x844B, 0x844C, 0x844D, 0x844E, 0x844F, 0x8450, 0x8451, 0x8452, 0x8453, 0x8454, 0x0000, 0x0000,
+ 0x8455, 0x8456, 0x8457, 0x8458, 0x8459, 0x845A, 0x845B, 0x845C, 0x845D, 0x845E, 0x845F, 0x8460, 0x8461, 0x8462, 0x8463, 0x8464,
+ 0x8465, 0x8466, 0x8467, 0x8468, 0x8469, 0x846A, 0x846B, 0x846C, 0x846D, 0x846E, 0x846F, 0x8470, 0x8471, 0x8472, 0x8473, 0x8474,
+ 0x8475, 0x8476, 0x8477, 0x8478, 0x8479, 0x847A, 0x847B, 0x847C, 0x847D, 0x847E, 0x847F, 0x8480, 0x8481, 0x8482, 0x8483, 0x8484,
+ 0x8485, 0x8486, 0x8487, 0x8488, 0x8489, 0x0000, 0x848A, 0x848B, 0x848C, 0x848D, 0x848E, 0x848F, 0x8490, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x8491, 0x8492, 0x8493, 0x0000, 0x8494, 0x8495, 0x8496, 0x8497, 0x8498, 0x8499, 0x849A, 0x0000, 0x0000, 0x0000,
+ 0x849B, 0x849C, 0x849D, 0x849E, 0x0000, 0x0000, 0x849F, 0x84A0, 0x84A1, 0x84A2, 0x84A3, 0x84A4, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x84A5, 0x84A6, 0x84A7, 0x84A8, 0x84A9, 0x84AA, 0x84AB, 0x84AC, 0x84AD, 0x84AE, 0x84AF, 0x84B0, 0x84B1, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x84B2, 0x84B3, 0x84B4, 0x0000, 0x84B5, 0x84B6, 0x84B7, 0x84B8, 0x84B9, 0x84BA, 0x84BB, 0x84BC, 0x84BD, 0x0000,
+ 0x84BE, 0x84BF, 0x84C0, 0x84C1, 0x84C2, 0x84C3, 0x84C4, 0x84C5, 0x84C6, 0x84C7, 0x84C8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x84C9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x84CA, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x84CB, 0x20FA, 0x3009, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x84CC,
+ 0x0000, 0x0000, 0x0000, 0x20FC, 0x300C, 0x0000, 0x20FE, 0x300F, 0x0000, 0x0000, 0x0000, 0x0000, 0x2100, 0x0000, 0x2102, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2104, 0x2106, 0x2108, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x4000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x84CD,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x84CE, 0x84CF, 0x0000, 0x0000, 0x84D0, 0x84D1, 0x84D2, 0x84D3, 0x84D4, 0x84D5, 0x84D6, 0x84D7, 0x84D8, 0x84D9, 0x84DA, 0x84DB,
+ 0x84DC, 0x84DD, 0x84DE, 0x84DF, 0x84E0, 0x84E1, 0x84E2, 0x84E3, 0x84E4, 0x84E5, 0x84E6, 0x84E7, 0x84E8, 0x84E9, 0x84EA, 0x0000,
+ 0x84EB, 0x84EC, 0x84ED, 0x84EE, 0x84EF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x210A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x3012, 0x3015, 0x84F0, 0x210C, 0x0000, 0x3018, 0x301B, 0x84F1, 0x0000, 0x210E, 0x84F2, 0x84F3, 0x84F4, 0x84F5, 0x84F6, 0x84F7,
+ 0x84F8, 0x84F9, 0x84FA, 0x84FB, 0x0000, 0x84FC, 0x2110, 0x0000, 0x0000, 0x84FD, 0x84FE, 0x84FF, 0x8500, 0x8501, 0x8502, 0x8503,
+ 0x2112, 0x301E, 0x2114, 0x8504, 0x8505, 0x0000, 0x8506, 0x8507, 0x8508, 0x0000, 0x8509, 0x850A, 0x850B, 0x850C, 0x850D, 0x850E,
+ 0x850F, 0x8510, 0x0000, 0x8511, 0x8512, 0x8513, 0x8514, 0x8515, 0x8516, 0x8517, 0x0000, 0x3021, 0x8518, 0x8519, 0x851A, 0x851B,
+ 0x851C, 0x0000, 0x0000, 0x0000, 0x0000, 0x851D, 0x851E, 0x851F, 0x8520, 0x8521, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x3024, 0x3027, 0x4005, 0x302A, 0x302D, 0x3030, 0x3033, 0x3036, 0x3039, 0x303C, 0x303F, 0x3042, 0x3045, 0x3048, 0x304B, 0x2116,
+ 0x8522, 0x2118, 0x304E, 0x211A, 0x8523, 0x211C, 0x3051, 0x400A, 0x211E, 0x8524, 0x2120, 0x3054, 0x8525, 0x8526, 0x8527, 0x8528,
+ 0x8529, 0x2122, 0x3057, 0x2124, 0x852A, 0x2126, 0x305A, 0x400F, 0x2128, 0x852B, 0x212A, 0x305D, 0x852C, 0x852D, 0x852E, 0x852F,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x3060, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x212C, 0x212E, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2130, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2132, 0x2134, 0x2136,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x8530, 0x0000, 0x0000, 0x0000, 0x0000, 0x8531, 0x0000, 0x0000, 0x8532, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x2138, 0x0000, 0x213A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x213C, 0x3063, 0x0000, 0x213E,
+ 0x3066, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x2140, 0x0000, 0x0000, 0x2142, 0x0000, 0x0000, 0x2144, 0x0000, 0x2146, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x2148, 0x0000, 0x214A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x214C, 0x214E, 0x2150,
+ 0x2152, 0x2154, 0x0000, 0x0000, 0x2156, 0x2158, 0x0000, 0x0000, 0x215A, 0x215C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x215E, 0x2160, 0x0000, 0x0000, 0x2162, 0x2164, 0x0000, 0x0000, 0x2166, 0x2168, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x216A, 0x216C, 0x216E, 0x2170,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x2172, 0x2174, 0x2176, 0x2178, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x217A, 0x217C, 0x217E, 0x2180, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8533, 0x8534, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x3069, 0x306C, 0x306F, 0x3072, 0x3075, 0x3078, 0x307B, 0x307E, 0x2182, 0x2184, 0x2186, 0x2188, 0x218A, 0x218C, 0x218E, 0x2190,
+ 0x3081, 0x3084, 0x3087, 0x308A, 0x308D, 0x3090, 0x3093, 0x3096, 0x3099, 0x2192, 0x309C, 0x309F, 0x2194, 0x2196, 0x2198, 0x219A,
+ 0x219C, 0x30A2, 0x8535, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x8536, 0x8537, 0x8538, 0x8539, 0x853A, 0x853B, 0x853C, 0x853D, 0x853E, 0x219E, 0x21A0, 0x21A2, 0x21A4, 0x21A6, 0x21A8, 0x21AA,
+ 0x21AC, 0x21AE, 0x21B0, 0x21B2, 0x30A5, 0x30A8, 0x30AB, 0x30AE, 0x30B1, 0x30B4, 0x30B7, 0x30BA, 0x30BD, 0x4014, 0x4019, 0x401E,
+ 0x4023, 0x4028, 0x402D, 0x4032, 0x4037, 0x403C, 0x4041, 0x4046, 0x21B4, 0x21B6, 0x21B8, 0x21BA, 0x21BC, 0x21BE, 0x21C0, 0x21C2,
+ 0x21C4, 0x30C0, 0x30C3, 0x30C6, 0x30C9, 0x30CC, 0x30CF, 0x30D2, 0x30D5, 0x30D8, 0x30DB, 0x30DE, 0x30E1, 0x30E4, 0x30E7, 0x30EA,
+ 0x30ED, 0x30F0, 0x30F3, 0x30F6, 0x30F9, 0x30FC, 0x30FF, 0x3102, 0x3105, 0x3108, 0x310B, 0x310E, 0x3111, 0x3114, 0x3117, 0x311A,
+ 0x311D, 0x3120, 0x3123, 0x3126, 0x3129, 0x312C, 0x853F, 0x8540, 0x8541, 0x8542, 0x8543, 0x8544, 0x8545, 0x8546, 0x8547, 0x8548,
+ 0x8549, 0x854A, 0x854B, 0x854C, 0x854D, 0x854E, 0x854F, 0x8550, 0x8551, 0x8552, 0x8553, 0x8554, 0x8555, 0x8556, 0x8557, 0x8558,
+ 0x8559, 0x855A, 0x855B, 0x855C, 0x855D, 0x855E, 0x855F, 0x8560, 0x8561, 0x8562, 0x8563, 0x8564, 0x8565, 0x8566, 0x8567, 0x8568,
+ 0x8569, 0x856A, 0x856B, 0x856C, 0x856D, 0x856E, 0x856F, 0x8570, 0x8571, 0x8572, 0x8573, 0x21C6, 0x21C8, 0x21CA, 0x21CC, 0x21CE,
+ 0x21D0, 0x21D2, 0x21D4, 0x21D6, 0x21D8, 0x8574, 0x8575, 0x8576, 0x8577, 0x8578, 0x8579, 0x857A, 0x857B, 0x857C, 0x21DA, 0x857D,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x857E, 0x857F, 0x8580, 0x8581, 0x8582, 0x8583, 0x8584, 0x8585, 0x8586, 0x21DC,
+ 0x8587, 0x8588, 0x8589, 0x858A, 0x858B, 0x858C, 0x858D, 0x858E, 0x858F, 0x21DE, 0x8590, 0x8591, 0x8592, 0x8593, 0x8594, 0x8595,
+ 0x8596, 0x8597, 0x8598, 0x21E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x404B, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x312F, 0x21E2, 0x3132, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x21E4, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x8599, 0x859A, 0x859B, 0x859C, 0x859D, 0x859E, 0x859F, 0x85A0, 0x85A1, 0x85A2, 0x85A3, 0x85A4, 0x85A5, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x85A6, 0x85A7, 0x85A8, 0x85A9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x85AA, 0x85AB, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x85AC,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x85AD,
+ 0x85AE, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x85AF, 0x0000, 0x0000, 0x85B0, 0x0000, 0x85B1, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x85B2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x85B3, 0x0000, 0x0000, 0x0000, 0x0000, 0x85B4, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x85B5, 0x85B6, 0x0000, 0x0000, 0x0000, 0x85B7, 0x85B8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x85B9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x85BA, 0x85BB, 0x85BC, 0x85BD, 0x85BE, 0x85BF, 0x85C0, 0x85C1, 0x85C2, 0x85C3, 0x85C4, 0x85C5, 0x85C6, 0x85C7, 0x85C8, 0x85C9,
+ 0x85CA, 0x85CB, 0x85CC, 0x85CD, 0x85CE, 0x85CF, 0x85D0, 0x85D1, 0x85D2, 0x85D3, 0x85D4, 0x85D5, 0x85D6, 0x85D7, 0x85D8, 0x85D9,
+ 0x85DA, 0x85DB, 0x85DC, 0x85DD, 0x85DE, 0x85DF, 0x85E0, 0x85E1, 0x85E2, 0x85E3, 0x85E4, 0x85E5, 0x85E6, 0x85E7, 0x85E8, 0x85E9,
+ 0x85EA, 0x85EB, 0x85EC, 0x85ED, 0x85EE, 0x85EF, 0x85F0, 0x85F1, 0x85F2, 0x85F3, 0x85F4, 0x85F5, 0x85F6, 0x85F7, 0x85F8, 0x85F9,
+ 0x85FA, 0x85FB, 0x85FC, 0x85FD, 0x85FE, 0x85FF, 0x8600, 0x8601, 0x8602, 0x8603, 0x8604, 0x8605, 0x8606, 0x8607, 0x8608, 0x8609,
+ 0x860A, 0x860B, 0x860C, 0x860D, 0x860E, 0x860F, 0x8610, 0x8611, 0x8612, 0x8613, 0x8614, 0x8615, 0x8616, 0x8617, 0x8618, 0x8619,
+ 0x861A, 0x861B, 0x861C, 0x861D, 0x861E, 0x861F, 0x8620, 0x8621, 0x8622, 0x8623, 0x8624, 0x8625, 0x8626, 0x8627, 0x8628, 0x8629,
+ 0x862A, 0x862B, 0x862C, 0x862D, 0x862E, 0x862F, 0x8630, 0x8631, 0x8632, 0x8633, 0x8634, 0x8635, 0x8636, 0x8637, 0x8638, 0x8639,
+ 0x863A, 0x863B, 0x863C, 0x863D, 0x863E, 0x863F, 0x8640, 0x8641, 0x8642, 0x8643, 0x8644, 0x8645, 0x8646, 0x8647, 0x8648, 0x8649,
+ 0x864A, 0x864B, 0x864C, 0x864D, 0x864E, 0x864F, 0x8650, 0x8651, 0x8652, 0x8653, 0x8654, 0x8655, 0x8656, 0x8657, 0x8658, 0x8659,
+ 0x865A, 0x865B, 0x865C, 0x865D, 0x865E, 0x865F, 0x8660, 0x8661, 0x8662, 0x8663, 0x8664, 0x8665, 0x8666, 0x8667, 0x8668, 0x8669,
+ 0x866A, 0x866B, 0x866C, 0x866D, 0x866E, 0x866F, 0x8670, 0x8671, 0x8672, 0x8673, 0x8674, 0x8675, 0x8676, 0x8677, 0x8678, 0x8679,
+ 0x867A, 0x867B, 0x867C, 0x867D, 0x867E, 0x867F, 0x8680, 0x8681, 0x8682, 0x8683, 0x8684, 0x8685, 0x8686, 0x8687, 0x8688, 0x8689,
+ 0x868A, 0x868B, 0x868C, 0x868D, 0x868E, 0x868F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x8690, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8691, 0x0000, 0x8692, 0x8693, 0x8694, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x21E6, 0x0000, 0x21E8, 0x0000,
+ 0x21EA, 0x0000, 0x21EC, 0x0000, 0x21EE, 0x0000, 0x21F0, 0x0000, 0x21F2, 0x0000, 0x21F4, 0x0000, 0x21F6, 0x0000, 0x21F8, 0x0000,
+ 0x21FA, 0x0000, 0x21FC, 0x0000, 0x0000, 0x21FE, 0x0000, 0x2200, 0x0000, 0x2202, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x2204, 0x2206, 0x0000, 0x2208, 0x220A, 0x0000, 0x220C, 0x220E, 0x0000, 0x2210, 0x2212, 0x0000, 0x2214, 0x2216, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x2218, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x221A, 0x221C, 0x0000, 0x221E, 0x2220,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2222, 0x0000, 0x2224, 0x0000,
+ 0x2226, 0x0000, 0x2228, 0x0000, 0x222A, 0x0000, 0x222C, 0x0000, 0x222E, 0x0000, 0x2230, 0x0000, 0x2232, 0x0000, 0x2234, 0x0000,
+ 0x2236, 0x0000, 0x2238, 0x0000, 0x0000, 0x223A, 0x0000, 0x223C, 0x0000, 0x223E, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x2240, 0x2242, 0x0000, 0x2244, 0x2246, 0x0000, 0x2248, 0x224A, 0x0000, 0x224C, 0x224E, 0x0000, 0x2250, 0x2252, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x2254, 0x0000, 0x0000, 0x2256, 0x2258, 0x225A, 0x225C, 0x0000, 0x0000, 0x0000, 0x225E, 0x2260,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x8695, 0x8696, 0x8697, 0x8698, 0x8699, 0x869A, 0x869B, 0x869C, 0x869D, 0x869E, 0x869F, 0x86A0, 0x86A1, 0x86A2, 0x86A3,
+ 0x86A4, 0x86A5, 0x86A6, 0x86A7, 0x86A8, 0x86A9, 0x86AA, 0x86AB, 0x86AC, 0x86AD, 0x86AE, 0x86AF, 0x86B0, 0x86B1, 0x86B2, 0x86B3,
+ 0x86B4, 0x86B5, 0x86B6, 0x86B7, 0x86B8, 0x86B9, 0x86BA, 0x86BB, 0x86BC, 0x86BD, 0x86BE, 0x86BF, 0x86C0, 0x86C1, 0x86C2, 0x86C3,
+ 0x86C4, 0x86C5, 0x86C6, 0x86C7, 0x86C8, 0x86C9, 0x86CA, 0x86CB, 0x86CC, 0x86CD, 0x86CE, 0x86CF, 0x86D0, 0x86D1, 0x86D2, 0x86D3,
+ 0x86D4, 0x86D5, 0x86D6, 0x86D7, 0x86D8, 0x86D9, 0x86DA, 0x86DB, 0x86DC, 0x86DD, 0x86DE, 0x86DF, 0x86E0, 0x86E1, 0x86E2, 0x86E3,
+ 0x86E4, 0x86E5, 0x86E6, 0x86E7, 0x86E8, 0x86E9, 0x86EA, 0x86EB, 0x86EC, 0x86ED, 0x86EE, 0x86EF, 0x86F0, 0x86F1, 0x86F2, 0x0000,
+ 0x0000, 0x0000, 0x86F3, 0x86F4, 0x86F5, 0x86F6, 0x86F7, 0x86F8, 0x86F9, 0x86FA, 0x86FB, 0x86FC, 0x86FD, 0x86FE, 0x86FF, 0x8700,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x3135, 0x3138, 0x313B, 0x313E, 0x3141, 0x3144, 0x3147, 0x314A, 0x314D, 0x3150, 0x3153, 0x3156, 0x3159, 0x315C, 0x4050, 0x4055,
+ 0x405A, 0x405F, 0x4064, 0x4069, 0x406E, 0x4073, 0x4078, 0x407D, 0x4082, 0x4087, 0x408C, 0x4091, 0x4096, 0x409B, 0x40A3, 0x0000,
+ 0x315F, 0x3162, 0x3165, 0x3168, 0x316B, 0x316E, 0x3171, 0x3174, 0x3177, 0x317A, 0x317D, 0x3180, 0x3183, 0x3186, 0x3189, 0x318C,
+ 0x318F, 0x3192, 0x3195, 0x3198, 0x319B, 0x319E, 0x31A1, 0x31A4, 0x31A7, 0x31AA, 0x31AD, 0x31B0, 0x31B3, 0x31B6, 0x31B9, 0x31BC,
+ 0x31BF, 0x31C2, 0x31C5, 0x31C8, 0x8701, 0x8702, 0x8703, 0x8704, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x31CB, 0x2262, 0x2264, 0x2266, 0x2268, 0x226A, 0x226C, 0x226E, 0x2270, 0x2272, 0x2274, 0x2276, 0x2278, 0x227A, 0x227C, 0x227E,
+ 0x8705, 0x8706, 0x8707, 0x8708, 0x8709, 0x870A, 0x870B, 0x870C, 0x870D, 0x870E, 0x870F, 0x8710, 0x8711, 0x8712, 0x2280, 0x2282,
+ 0x2284, 0x2286, 0x2288, 0x228A, 0x228C, 0x228E, 0x2290, 0x2292, 0x2294, 0x2296, 0x2298, 0x229A, 0x40AA, 0x40B0, 0x229C, 0x0000,
+ 0x8713, 0x8714, 0x8715, 0x8716, 0x8717, 0x8718, 0x8719, 0x871A, 0x871B, 0x871C, 0x871D, 0x871E, 0x871F, 0x8720, 0x8721, 0x8722,
+ 0x8723, 0x8724, 0x8725, 0x8726, 0x8727, 0x8728, 0x8729, 0x872A, 0x872B, 0x872C, 0x872D, 0x872E, 0x872F, 0x8730, 0x8731, 0x8732,
+ 0x8733, 0x8734, 0x8735, 0x8736, 0x8737, 0x8738, 0x8739, 0x873A, 0x873B, 0x873C, 0x873D, 0x873E, 0x873F, 0x8740, 0x8741, 0x8742,
+ 0x8743, 0x229E, 0x22A0, 0x22A2, 0x22A4, 0x22A6, 0x22A8, 0x22AA, 0x22AC, 0x22AE, 0x22B0, 0x22B2, 0x22B4, 0x22B6, 0x22B8, 0x22BA,
+ 0x22BC, 0x22BE, 0x22C0, 0x22C2, 0x22C4, 0x22C6, 0x22C8, 0x22CA, 0x22CC, 0x31CE, 0x31D1, 0x31D4, 0x22CE, 0x31D7, 0x22D0, 0x31DA,
+ 0x8744, 0x8745, 0x8746, 0x8747, 0x8748, 0x8749, 0x874A, 0x874B, 0x874C, 0x874D, 0x874E, 0x874F, 0x8750, 0x8751, 0x8752, 0x8753,
+ 0x8754, 0x8755, 0x8756, 0x8757, 0x8758, 0x8759, 0x875A, 0x875B, 0x875C, 0x875D, 0x875E, 0x875F, 0x8760, 0x8761, 0x8762, 0x8763,
+ 0x8764, 0x8765, 0x8766, 0x8767, 0x8768, 0x8769, 0x876A, 0x876B, 0x876C, 0x876D, 0x876E, 0x876F, 0x8770, 0x8771, 0x8772, 0x0000,
+ 0x40B5, 0x40BA, 0x40BF, 0x31DD, 0x40C4, 0x31E0, 0x31E3, 0x40C9, 0x40CF, 0x31E6, 0x31E9, 0x31EC, 0x40D4, 0x40D9, 0x31EF, 0x31F2,
+ 0x22D2, 0x31F5, 0x40DE, 0x40E3, 0x22D4, 0x40E8, 0x40EE, 0x40F5, 0x31F8, 0x40FB, 0x4101, 0x4107, 0x31FB, 0x31FE, 0x3201, 0x410C,
+ 0x4111, 0x4117, 0x3204, 0x3207, 0x320A, 0x22D6, 0x22D8, 0x22DA, 0x22DC, 0x320D, 0x3210, 0x411C, 0x3213, 0x4122, 0x4127, 0x3216,
+ 0x22DE, 0x22E0, 0x412D, 0x4133, 0x4138, 0x3219, 0x413E, 0x22E2, 0x321C, 0x321F, 0x3222, 0x3225, 0x3228, 0x4144, 0x322B, 0x22E4,
+ 0x322E, 0x3231, 0x3234, 0x4149, 0x3237, 0x323A, 0x323D, 0x414E, 0x4154, 0x22E6, 0x4159, 0x22E8, 0x415F, 0x4164, 0x3240, 0x3243,
+ 0x3246, 0x4169, 0x22EA, 0x3249, 0x416E, 0x22EC, 0x4173, 0x324C, 0x22EE, 0x22F0, 0x22F2, 0x22F4, 0x22F6, 0x22F8, 0x22FA, 0x22FC,
+ 0x22FE, 0x2300, 0x324F, 0x3252, 0x3255, 0x3258, 0x325B, 0x325E, 0x3261, 0x3264, 0x3267, 0x326A, 0x326D, 0x3270, 0x3273, 0x3276,
+ 0x3279, 0x327C, 0x2302, 0x2304, 0x327F, 0x2306, 0x2308, 0x230A, 0x3282, 0x3285, 0x230C, 0x230E, 0x2310, 0x2312, 0x2314, 0x4179,
+ 0x2316, 0x2318, 0x231A, 0x231C, 0x231E, 0x2320, 0x2322, 0x2324, 0x3288, 0x417E, 0x2326, 0x2328, 0x232A, 0x232C, 0x232E, 0x2330,
+ 0x2332, 0x328B, 0x328E, 0x3291, 0x3294, 0x2334, 0x2336, 0x2338, 0x233A, 0x233C, 0x233E, 0x2340, 0x2342, 0x2344, 0x2346, 0x3297,
+ 0x329A, 0x2348, 0x329D, 0x32A0, 0x32A3, 0x234A, 0x32A6, 0x32A9, 0x4183, 0x234C, 0x32AC, 0x32AF, 0x32B2, 0x32B5, 0x4188, 0x418E,
+ 0x234E, 0x2350, 0x2352, 0x2354, 0x2356, 0x2358, 0x235A, 0x235C, 0x235E, 0x2360, 0x2362, 0x2364, 0x2366, 0x2368, 0x236A, 0x236C,
+ 0x236E, 0x2370, 0x4195, 0x2372, 0x2374, 0x2376, 0x419A, 0x32B8, 0x2378, 0x237A, 0x237C, 0x237E, 0x2380, 0x2382, 0x2384, 0x2386,
+ 0x2388, 0x238A, 0x32BB, 0x238C, 0x238E, 0x32BE, 0x32C1, 0x2390, 0x419F, 0x32C4, 0x2392, 0x2394, 0x2396, 0x2398, 0x32C7, 0x32CA,
+ 0x239A, 0x239C, 0x239E, 0x23A0, 0x23A2, 0x23A4, 0x23A6, 0x23A8, 0x23AA, 0x32CD, 0x32D0, 0x32D3, 0x32D6, 0x32D9, 0x32DC, 0x32DF,
+ 0x32E2, 0x32E5, 0x32E8, 0x32EB, 0x32EE, 0x32F1, 0x32F4, 0x32F7, 0x32FA, 0x32FD, 0x3300, 0x3303, 0x3306, 0x3309, 0x330C, 0x330F,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8773,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8774, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8775, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8776, 0x0000,
+ 0x0000, 0x0000, 0x8777, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8778, 0x0000, 0x0000, 0x0000, 0x0000, 0x8779, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x877A, 0x877B, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x877C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x877D, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x877E, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x877F, 0x8780, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x8781, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x8782, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8783, 0x0000, 0x0000, 0x8784, 0x0000, 0x8785, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x8786, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8787, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8788, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x8789, 0x878A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x878B, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x878C, 0x0000, 0x0000, 0x0000, 0x0000, 0x878D, 0x0000, 0x878E, 0x878F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x8790, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8791, 0x0000, 0x8792,
+ 0x0000, 0x0000, 0x0000, 0x8793, 0x8794, 0x8795, 0x0000, 0x8796, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8797, 0x0000,
+ 0x0000, 0x0000, 0x8798, 0x0000, 0x0000, 0x8799, 0x0000, 0x0000, 0x0000, 0x879A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x879B, 0x0000, 0x0000, 0x0000, 0x879C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x879D, 0x0000, 0x0000, 0x879E, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x879F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x87A0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x87A1, 0x0000, 0x87A2, 0x0000, 0x87A3, 0x0000, 0x0000, 0x0000, 0x0000, 0x87A4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x87A5, 0x0000, 0x0000, 0x0000, 0x87A6, 0x87A7, 0x0000, 0x0000, 0x87A8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x87A9,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x87AA, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x87AB, 0x0000, 0x0000, 0x0000, 0x0000, 0x87AC, 0x0000, 0x0000, 0x87AD, 0x87AE, 0x87AF, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x87B0, 0x0000, 0x0000, 0x0000, 0x0000, 0x87B1, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x87B2, 0x0000, 0x0000, 0x0000, 0x0000, 0x87B3, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x87B4, 0x0000, 0x87B5, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x87B6, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x87B7, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x87B8, 0x87B9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x87BA, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x87BB, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x87BC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x87BD, 0x0000, 0x0000, 0x0000, 0x0000, 0x87BE, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x87BF, 0x0000, 0x0000, 0x87C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x87C1, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x87C2, 0x0000, 0x87C3, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x87C4, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x87C5, 0x87C6, 0x0000, 0x87C7, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x87C8, 0x0000, 0x0000, 0x0000, 0x87C9, 0x0000, 0x87CA, 0x87CB, 0x0000, 0x87CC, 0x87CD, 0x0000, 0x0000,
+ 0x0000, 0x87CE, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x87CF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x87D0, 0x0000, 0x87D1, 0x0000, 0x87D2, 0x0000, 0x0000, 0x0000, 0x87D3, 0x87D4, 0x0000,
+ 0x0000, 0x0000, 0x87D5, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x87D6, 0x0000, 0x87D7, 0x0000, 0x87D8, 0x0000, 0x0000, 0x87D9, 0x0000, 0x0000, 0x87DA, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x87DB, 0x0000, 0x87DC,
+ 0x0000, 0x87DD, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x87DE, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x87DF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x87E0, 0x0000, 0x87E1, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x87E2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x87E3, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x87E4, 0x0000, 0x87E5, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x87E6, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x87E7, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x87E8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x87E9, 0x0000, 0x0000, 0x87EA, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x87EB, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x87EC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x87ED, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x87EE, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x87EF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x87F0,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x87F1, 0x87F2,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x87F3, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x87F4, 0x0000, 0x87F5, 0x0000, 0x87F6, 0x0000,
+ 0x0000, 0x0000, 0x87F7, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x87F8, 0x87F9, 0x0000, 0x0000, 0x87FA, 0x0000, 0x0000, 0x0000, 0x87FB, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x87FC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x87FD, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x87FE, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x87FF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8800, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x8801, 0x0000, 0x8802, 0x8803, 0x0000, 0x0000, 0x0000, 0x0000, 0x8804, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8805, 0x0000, 0x0000, 0x0000, 0x0000, 0x8806, 0x8807,
+ 0x8808, 0x0000, 0x0000, 0x0000, 0x0000, 0x8809, 0x0000, 0x0000, 0x880A, 0x0000, 0x0000, 0x0000, 0x0000, 0x880B, 0x0000, 0x0000,
+ 0x0000, 0x880C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x880D, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x880E, 0x0000, 0x0000,
+ 0x880F, 0x0000, 0x0000, 0x0000, 0x0000, 0x8810, 0x8811, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8812,
+ 0x0000, 0x0000, 0x8813, 0x0000, 0x8814, 0x0000, 0x0000, 0x0000, 0x8815, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x8816, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8817, 0x0000, 0x0000, 0x0000, 0x0000, 0x8818, 0x0000, 0x0000, 0x0000,
+ 0x8819, 0x0000, 0x0000, 0x0000, 0x0000, 0x881A, 0x0000, 0x0000, 0x0000, 0x881B, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x881C, 0x0000, 0x881D, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x881E, 0x881F, 0x8820, 0x0000, 0x8821, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x8822, 0x8823, 0x8824, 0x0000, 0x0000, 0x8825, 0x0000, 0x0000, 0x8826, 0x8827, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x8828, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8829, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x882A, 0x0000, 0x0000, 0x0000, 0x882B, 0x0000, 0x882C, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x882D, 0x882E, 0x0000, 0x0000, 0x882F, 0x0000, 0x8830, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x8831, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8832, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8833, 0x0000, 0x0000, 0x0000, 0x0000, 0x8834, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8835, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8836,
+ 0x0000, 0x8837, 0x0000, 0x0000, 0x8838, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8839, 0x883A, 0x0000, 0x0000, 0x0000, 0x883B,
+ 0x0000, 0x0000, 0x883C, 0x0000, 0x0000, 0x0000, 0x0000, 0x883D, 0x0000, 0x0000, 0x883E, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x883F, 0x0000, 0x8840, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8841, 0x0000, 0x0000, 0x0000, 0x8842, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8843, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8844, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8845, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x8846, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8847, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8848, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x8849, 0x0000, 0x0000, 0x0000, 0x0000, 0x884A, 0x884B, 0x884C, 0x0000, 0x0000, 0x0000, 0x884D, 0x884E,
+ 0x0000, 0x0000, 0x884F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8850, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8851,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8852, 0x0000, 0x8853, 0x8854, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x8855, 0x0000, 0x8856, 0x0000, 0x0000, 0x8857, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8858, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x8859, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x885A, 0x0000, 0x885B, 0x885C, 0x0000, 0x0000, 0x0000, 0x885D, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x885E, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x885F, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8860, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8861, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8862, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x8863, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8864, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8865, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8866, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8867,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8868, 0x8869, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x886A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x886B, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x886C, 0x0000, 0x0000, 0x0000, 0x886D,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x886E, 0x0000, 0x0000, 0x886F, 0x8870, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8871, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x8872, 0x0000, 0x0000, 0x8873, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8874, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x8875, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8876, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8877, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8878, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8879, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x887A,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x887B, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x887C, 0x0000, 0x0000, 0x0000, 0x887D, 0x887E, 0x0000, 0x887F, 0x0000, 0x8880, 0x8881, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8882, 0x8883, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8884, 0x8885, 0x0000, 0x0000, 0x8886, 0x0000, 0x8887, 0x8888, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8889, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x888A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x888B, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x888C, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x888D, 0x0000, 0x888E, 0x0000, 0x0000, 0x888F, 0x8890, 0x0000, 0x0000, 0x0000, 0x8891, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x8892, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x8893, 0x0000, 0x8894, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8895, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8896, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8897, 0x0000, 0x8898, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x8899, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x889A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x889B, 0x0000, 0x0000, 0x889C, 0x0000, 0x0000, 0x889D, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x889E, 0x0000, 0x0000, 0x889F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x88A0, 0x0000, 0x88A1, 0x0000, 0x0000, 0x0000, 0x0000, 0x88A2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88A3, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x88A4, 0x0000, 0x0000, 0x0000, 0x88A5, 0x0000, 0x88A6, 0x0000, 0x88A7, 0x88A8, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88A9, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x88AA, 0x0000, 0x88AB, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x88AC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88AD, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88AE, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x88AF, 0x0000, 0x0000, 0x88B0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x88B1, 0x0000, 0x0000, 0x88B2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88B3, 0x88B4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88B5,
+ 0x0000, 0x0000, 0x0000, 0x88B6, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88B7, 0x88B8, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88B9, 0x0000, 0x0000, 0x0000, 0x0000, 0x88BA, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88BB, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x88BC, 0x88BD, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88BE, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88BF, 0x0000, 0x0000, 0x88C0, 0x0000, 0x88C1,
+ 0x88C2, 0x88C3, 0x88C4, 0x88C5, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88C6, 0x0000, 0x0000, 0x88C7, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x88C8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x88C9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x88CA, 0x0000, 0x88CB, 0x0000, 0x88CC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88CD, 0x0000, 0x0000, 0x0000, 0x88CE, 0x0000, 0x88CF, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88D0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88D1, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x88D2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88D3, 0x0000,
+ 0x88D4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88D5, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88D6, 0x0000, 0x0000, 0x0000, 0x88D7, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88D8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88D9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88DA, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88DB, 0x88DC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x88DD, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x88DE, 0x88DF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88E0, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88E1, 0x88E2, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88E3, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x88E4, 0x0000, 0x0000, 0x88E5, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88E6, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88E7, 0x0000, 0x88E8, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88E9, 0x0000, 0x88EA, 0x0000, 0x0000, 0x0000, 0x0000, 0x88EB,
+ 0x0000, 0x0000, 0x0000, 0x88EC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88ED, 0x88EE, 0x0000, 0x0000, 0x88EF, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x88F0, 0x0000, 0x0000, 0x88F1, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x88F2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88F3, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x88F4, 0x88F5, 0x88F6, 0x0000, 0x0000, 0x0000, 0x88F7, 0x0000, 0x0000, 0x0000, 0x88F8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x88F9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88FA, 0x0000, 0x0000, 0x88FB, 0x0000,
+ 0x0000, 0x0000, 0x88FC, 0x0000, 0x0000, 0x0000, 0x88FD, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x88FE, 0x0000, 0x88FF, 0x0000, 0x0000, 0x8900, 0x8901, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8902,
+ 0x0000, 0x0000, 0x0000, 0x8903, 0x0000, 0x0000, 0x0000, 0x0000, 0x8904, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x8905, 0x0000, 0x0000, 0x0000, 0x8906, 0x8907, 0x8908, 0x0000, 0x8909, 0x0000, 0x890A, 0x0000, 0x890B, 0x0000,
+ 0x890C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x890D, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x890E, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x890F, 0x0000, 0x8910, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x8911, 0x0000, 0x8912, 0x0000, 0x0000, 0x0000, 0x8913, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8914, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8915, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8916, 0x0000, 0x0000, 0x8917, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x8918, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x8919, 0x891A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x891B, 0x0000, 0x891C, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x891D, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x891E, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x891F, 0x8920, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8921, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8922, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8923, 0x8924, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8925, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x8926, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8927, 0x0000, 0x0000, 0x8928,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8929,
+ 0x0000, 0x0000, 0x0000, 0x892A, 0x0000, 0x0000, 0x892B, 0x0000, 0x0000, 0x0000, 0x0000, 0x892C, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x892D, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x892E, 0x0000, 0x0000, 0x892F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8930,
+ 0x0000, 0x0000, 0x0000, 0x8931, 0x0000, 0x8932, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8933, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x8934, 0x8935, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8936, 0x0000, 0x0000, 0x8937, 0x8938,
+ 0x0000, 0x8939, 0x0000, 0x0000, 0x893A, 0x0000, 0x0000, 0x893B, 0x0000, 0x0000, 0x893C, 0x893D, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x893E, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x893F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x8940, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8941, 0x0000, 0x0000, 0x8942,
+ 0x8943, 0x8944, 0x8945, 0x0000, 0x8946, 0x0000, 0x0000, 0x8947, 0x0000, 0x0000, 0x8948, 0x8949, 0x894A, 0x0000, 0x894B, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x894C, 0x0000, 0x894D, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x894E,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x894F, 0x0000, 0x8950, 0x0000, 0x0000, 0x8951, 0x0000, 0x8952, 0x8953, 0x8954, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x8955, 0x8956, 0x8957, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8958, 0x0000, 0x8959, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x895A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x895B, 0x895C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x895D, 0x0000, 0x0000, 0x895E, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x895F, 0x8960, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8961, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8962, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8963, 0x0000, 0x0000, 0x0000, 0x0000, 0x8964, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8965, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x8966, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8967, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8968, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8969, 0x896A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x896B, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x896C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x896D, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x896E, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x896F, 0x0000, 0x8970, 0x8971, 0x0000, 0x8972, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8973, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x8974, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8975, 0x0000, 0x0000, 0x0000, 0x8976, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8977, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x8978, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8979, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x897A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x897B, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x897C,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x897D, 0x0000, 0x0000, 0x0000, 0x897E, 0x0000, 0x0000, 0x0000, 0x0000, 0x897F, 0x0000, 0x8980,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x8981, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8982, 0x8983, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8984,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8985, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x8986, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8987,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8988, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x8989, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x898A, 0x0000, 0x0000, 0x0000, 0x0000, 0x898B, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x898C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x898D, 0x0000, 0x0000, 0x0000, 0x898E, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x898F,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8990, 0x0000, 0x8991, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x8992, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x8993, 0x0000, 0x0000, 0x8994, 0x8995, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x8996, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x8997, 0x8998, 0x0000, 0x0000, 0x8999, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x899A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x899B, 0x0000, 0x0000, 0x0000, 0x0000, 0x899C, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x899D, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x899E, 0x899F, 0x89A0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89A1, 0x0000, 0x0000, 0x89A2, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89A3,
+ 0x0000, 0x0000, 0x89A4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89A5, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x89A6, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89A7, 0x0000, 0x89A8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x89A9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89AA, 0x0000, 0x0000, 0x89AB,
+ 0x0000, 0x0000, 0x89AC, 0x89AD, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89AE, 0x89AF,
+ 0x0000, 0x0000, 0x0000, 0x89B0, 0x0000, 0x0000, 0x0000, 0x0000, 0x89B1, 0x0000, 0x0000, 0x89B2, 0x0000, 0x0000, 0x89B3, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x89B4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x89B5, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89B6, 0x89B7, 0x0000, 0x89B8, 0x89B9, 0x89BA,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89BB, 0x0000, 0x89BC, 0x89BD, 0x0000, 0x89BE, 0x89BF, 0x89C0, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x89C1, 0x0000, 0x0000, 0x0000, 0x0000, 0x89C2, 0x0000, 0x89C3, 0x89C4, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x89C5, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89C6, 0x0000, 0x0000, 0x0000, 0x0000, 0x89C7,
+ 0x0000, 0x0000, 0x89C8, 0x0000, 0x0000, 0x0000, 0x89C9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89CA, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x89CB, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89CC,
+ 0x0000, 0x89CD, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x89CE, 0x0000, 0x0000, 0x0000, 0x0000, 0x89CF, 0x89D0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89D1,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89D2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89D3, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x89D4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89D5, 0x0000, 0x0000, 0x89D6, 0x89D7,
+ 0x0000, 0x0000, 0x89D8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89D9, 0x0000, 0x89DA, 0x0000, 0x0000, 0x0000,
+ 0x89DB, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89DC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89DD,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89DE, 0x0000, 0x0000, 0x0000, 0x89DF, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x89E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89E1, 0x89E2, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x89E3, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89E4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89E5, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89E6, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x89E7, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x89E8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89E9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89EA, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89EB, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89EC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89ED, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x89EE, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89EF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89F0, 0x0000, 0x0000, 0x89F1, 0x0000, 0x89F2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89F3, 0x89F4, 0x0000, 0x0000, 0x0000, 0x89F5, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89F6, 0x0000, 0x89F7, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x89F8, 0x0000, 0x0000, 0x0000, 0x89F9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89FA, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89FB, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89FC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89FD, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89FE, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x89FF, 0x8A00,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A01, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A02, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A03, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A04, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x8A05, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A06, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x8A07, 0x8A08, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A09, 0x0000, 0x8A0A, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A0B, 0x0000, 0x0000, 0x8A0C,
+ 0x0000, 0x0000, 0x8A0D, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A0E, 0x0000, 0x0000, 0x8A0F, 0x0000, 0x0000, 0x8A10, 0x8A11,
+ 0x0000, 0x8A12, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A13, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A14, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x8A15, 0x8A16, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A17, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x8A18, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A19, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A1A,
+ 0x0000, 0x8A1B, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x8A1C, 0x0000, 0x0000, 0x8A1D, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A1E, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x8A1F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A20,
+ 0x8A21, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A22,
+ 0x8A23, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A24, 0x8A25, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x8A26, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A27, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x8A28, 0x0000, 0x0000, 0x0000, 0x8A29, 0x0000, 0x8A2A, 0x0000, 0x0000, 0x8A2B, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A2C, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x8A2D, 0x0000, 0x8A2E, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A2F, 0x0000, 0x0000, 0x8A30, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A31,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x8A32, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A33, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x8A34, 0x8A35, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A36, 0x0000, 0x8A37, 0x0000, 0x8A38, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A39, 0x8A3A, 0x0000, 0x0000, 0x8A3B, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A3C,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A3D, 0x0000, 0x0000, 0x8A3E, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A3F, 0x0000, 0x8A40,
+ 0x8A41, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A42, 0x8A43, 0x8A44, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x8A45, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A46, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x8A47, 0x8A48, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x8A49, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A4A, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A4B, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x8A4C, 0x8A4D, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A4E, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A4F, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A50, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A51,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x8A52, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x8A53, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A54, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x8A55, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A56, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x8A57, 0x0000, 0x0000, 0x8A58, 0x0000, 0x0000, 0x0000, 0x8A59, 0x0000, 0x0000, 0x8A5A, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x8A5B, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A5C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x8A5D, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A5E, 0x0000,
+ 0x0000, 0x8A5F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A60, 0x8A61, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x8A62, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A63, 0x0000, 0x0000, 0x8A64, 0x0000, 0x0000, 0x8A65,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A66, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A67, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x8A68, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A69, 0x0000, 0x8A6A, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A6B, 0x0000, 0x0000,
+ 0x8A6C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A6D, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A6E, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x8A6F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A70, 0x0000, 0x0000, 0x0000, 0x8A71, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A72, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A73, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A74, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A75, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A76, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x8A77, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A78, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x8A79, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A7A, 0x0000, 0x0000, 0x0000, 0x8A7B, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A7C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A7D, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A7E, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x8A7F, 0x0000, 0x0000, 0x8A80, 0x8A81, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A82, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A83, 0x0000, 0x8A84, 0x8A85, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x8A86, 0x0000, 0x8A87, 0x0000, 0x0000, 0x8A88, 0x0000, 0x8A89, 0x8A8A, 0x0000, 0x8A8B, 0x8A8C, 0x8A8D, 0x0000, 0x0000, 0x0000,
+ 0x8A8E, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A8F, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A90, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A91,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A92, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x8A93, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x8A94, 0x8A95, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A96, 0x8A97, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A98,
+ 0x0000, 0x0000, 0x8A99, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A9A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x8A9B, 0x0000, 0x8A9C, 0x0000, 0x0000, 0x8A9D, 0x0000, 0x0000, 0x0000, 0x0000, 0x8A9E, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x8A9F, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AA0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AA1, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AA2, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AA3,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x8AA4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AA5, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AA6, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AA7, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x8AA8, 0x8AA9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AAA, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x8AAB, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AAC, 0x8AAD, 0x0000, 0x0000, 0x0000,
+ 0x8AAE, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AAF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AB0, 0x0000, 0x0000, 0x8AB1, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AB2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x8AB3, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AB4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x8AB5, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AB6, 0x0000, 0x8AB7, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x8AB8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AB9, 0x0000,
+ 0x0000, 0x8ABA, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8ABB, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x8ABC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8ABD, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x8ABE, 0x0000, 0x0000, 0x0000, 0x8ABF, 0x8AC0, 0x0000, 0x8AC1, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AC2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AC3,
+ 0x0000, 0x0000, 0x8AC4, 0x0000, 0x8AC5, 0x0000, 0x0000, 0x8AC6, 0x0000, 0x8AC7, 0x0000, 0x0000, 0x8AC8, 0x8AC9, 0x8ACA, 0x0000,
+ 0x8ACB, 0x8ACC, 0x8ACD, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8ACE, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8ACF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x8AD0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AD1, 0x0000, 0x8AD2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x8AD3, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AD4, 0x0000, 0x8AD5, 0x0000,
+ 0x0000, 0x8AD6, 0x0000, 0x8AD7, 0x8AD8, 0x0000, 0x0000, 0x8AD9, 0x0000, 0x0000, 0x8ADA, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8ADB, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8ADC, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8ADD,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8ADE, 0x0000, 0x8ADF, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AE0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AE1, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AE2, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AE3, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AE4, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x8AE5, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AE6, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AE7,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AE8, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x8AE9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AEA, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x8AEB, 0x0000, 0x0000, 0x0000, 0x8AEC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AED,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AEE, 0x0000, 0x0000, 0x0000, 0x8AEF, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AF0, 0x0000, 0x8AF1, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x8AF2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AF3, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x8AF4, 0x0000, 0x0000, 0x0000, 0x8AF5, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AF6,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AF7, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x8AF8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AF9, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AFA, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8AFB, 0x0000, 0x0000, 0x0000, 0x8AFC, 0x8AFD, 0x8AFE, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x8AFF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B00,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B01, 0x8B02, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B03, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B04, 0x0000, 0x0000, 0x0000, 0x8B05, 0x0000, 0x0000, 0x0000, 0x8B06, 0x0000,
+ 0x0000, 0x8B07, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B08,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B09, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B0A, 0x0000, 0x0000, 0x8B0B, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B0C, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B0D, 0x0000,
+ 0x0000, 0x8B0E, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B0F, 0x8B10, 0x8B11, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x8B12, 0x8B13, 0x8B14, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B15, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B16, 0x8B17, 0x0000, 0x0000, 0x0000, 0x8B18, 0x8B19,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B1A, 0x8B1B, 0x0000, 0x0000, 0x0000, 0x8B1C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x8B1D, 0x8B1E, 0x0000, 0x8B1F, 0x0000, 0x0000, 0x8B20, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B21, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B22, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B23, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B24, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B25, 0x0000, 0x0000, 0x0000, 0x8B26,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x8B27, 0x0000, 0x0000, 0x0000, 0x8B28, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B29, 0x0000, 0x8B2A, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x8B2B, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x8B2C, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B2D, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x8B2E, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x8B2F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B30, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B31, 0x0000,
+ 0x0000, 0x8B32, 0x0000, 0x8B33, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B34, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B35, 0x0000, 0x8B36, 0x0000, 0x0000, 0x0000, 0x8B37, 0x8B38, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x8B39, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B3A, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B3B, 0x0000, 0x8B3C, 0x8B3D, 0x0000, 0x0000, 0x8B3E,
+ 0x8B3F, 0x0000, 0x0000, 0x0000, 0x8B40, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B41, 0x0000, 0x0000, 0x8B42, 0x0000, 0x8B43, 0x0000,
+ 0x0000, 0x0000, 0x8B44, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B45, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B46, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B47, 0x8B48, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B49, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x8B4A, 0x8B4B, 0x0000, 0x8B4C, 0x0000, 0x8B4D, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B4E, 0x0000,
+ 0x8B4F, 0x0000, 0x8B50, 0x0000, 0x8B51, 0x8B52, 0x8B53, 0x8B54, 0x8B55, 0x8B56, 0x0000, 0x8B57, 0x0000, 0x8B58, 0x0000, 0x0000,
+ 0x8B59, 0x0000, 0x0000, 0x8B5A, 0x8B5B, 0x8B5C, 0x0000, 0x8B5D, 0x0000, 0x8B5E, 0x8B5F, 0x8B60, 0x8B61, 0x8B62, 0x0000, 0x0000,
+ 0x0000, 0x8B63, 0x0000, 0x0000, 0x0000, 0x8B64, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B65, 0x0000,
+ 0x8B66, 0x8B67, 0x8B68, 0x8B69, 0x0000, 0x8B6A, 0x0000, 0x0000, 0x0000, 0x8B6B, 0x8B6C, 0x0000, 0x8B6D, 0x0000, 0x0000, 0x8B6E,
+ 0x8B6F, 0x0000, 0x8B70, 0x8B71, 0x8B72, 0x0000, 0x8B73, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B74, 0x0000,
+ 0x8B75, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B76, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B77, 0x0000, 0x8B78, 0x8B79, 0x0000,
+ 0x0000, 0x8B7A, 0x8B7B, 0x0000, 0x0000, 0x0000, 0x8B7C, 0x0000, 0x8B7D, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x8B7E, 0x8B7F, 0x8B80, 0x8B81, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B82, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x8B83, 0x0000, 0x8B84, 0x0000, 0x0000, 0x8B85, 0x0000, 0x8B86, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B87,
+ 0x0000, 0x0000, 0x0000, 0x8B88, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B89, 0x0000, 0x8B8A, 0x0000,
+ 0x8B8B, 0x0000, 0x8B8C, 0x8B8D, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8B8E, 0x8B8F, 0x0000, 0x0000,
+ 0x8B90, 0x8B91, 0x8B92, 0x0000, 0x8B93, 0x0000, 0x0000, 0x0000, 0x8B94, 0x8B95, 0x8B96, 0x8B97, 0x0000, 0x8B98, 0x8B99, 0x8B9A,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x8B9B, 0x0000, 0x0000, 0x8B9C, 0x0000, 0x0000, 0x8B9D, 0x8B9E, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x8B9F, 0x0000, 0x0000, 0x0000, 0x0000, 0x8BA0, 0x8BA1, 0x8BA2, 0x8BA3, 0x0000, 0x0000, 0x8BA4, 0x8BA5, 0x0000,
+ 0x8BA6, 0x8BA7, 0x0000, 0x8BA8, 0x0000, 0x0000, 0x8BA9, 0x0000, 0x8BAA, 0x8BAB, 0x0000, 0x0000, 0x8BAC, 0x0000, 0x0000, 0x8BAD,
+ 0x0000, 0x8BAE, 0x8BAF, 0x0000, 0x8BB0, 0x0000, 0x8BB1, 0x0000, 0x0000, 0x8BB2, 0x0000, 0x8BB3, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8BB4, 0x8BB5, 0x8BB6, 0x8BB7, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x8BB8, 0x8BB9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8BBA, 0x0000, 0x0000, 0x0000, 0x8BBB, 0x0000, 0x8BBC, 0x8BBD, 0x8BBE,
+ 0x0000, 0x0000, 0x0000, 0x8BBF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8BC0, 0x0000, 0x0000, 0x8BC1, 0x0000,
+ 0x0000, 0x8BC2, 0x8BC3, 0x0000, 0x0000, 0x8BC4, 0x8BC5, 0x8BC6, 0x0000, 0x8BC7, 0x0000, 0x0000, 0x0000, 0x8BC8, 0x8BC9, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x8BCA, 0x0000, 0x8BCB, 0x8BCC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x8BCD, 0x0000, 0x8BCE, 0x8BCF, 0x0000, 0x0000, 0x0000, 0x0000, 0x8BD0, 0x0000, 0x0000, 0x0000, 0x8BD1, 0x0000,
+ 0x0000, 0x8BD2, 0x8BD3, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8BD4, 0x8BD5, 0x8BD6, 0x0000, 0x8BD7, 0x0000, 0x8BD8,
+ 0x8BD9, 0x0000, 0x0000, 0x8BDA, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8BDB, 0x0000, 0x0000, 0x8BDC, 0x8BDD, 0x8BDE, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8BDF, 0x0000, 0x8BE0, 0x0000, 0x8BE1, 0x0000, 0x0000, 0x8BE2,
+ 0x0000, 0x0000, 0x0000, 0x8BE3, 0x0000, 0x0000, 0x8BE4, 0x0000, 0x8BE5, 0x0000, 0x0000, 0x0000, 0x8BE6, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8BE7, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8BE8, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x8BE9, 0x0000, 0x0000, 0x0000, 0x0000, 0x8BEA, 0x0000, 0x8BEB, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8BEC, 0x8BED, 0x0000, 0x8BEE, 0x0000, 0x0000, 0x8BEF, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8BF0, 0x0000, 0x0000, 0x8BF1, 0x8BF2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8BF3, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x8BF4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x8BF5, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8BF6, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8BF7, 0x0000, 0x0000, 0x0000, 0x8BF8, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8BF9, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8BFA, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8BFB, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8BFC,
+ 0x8BFD, 0x0000, 0x8BFE, 0x8BFF, 0x0000, 0x8C00, 0x8C01, 0x8C02, 0x0000, 0x8C03, 0x0000, 0x0000, 0x0000, 0x8C04, 0x8C05, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C06, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C07, 0x0000, 0x0000, 0x8C08, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C09, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C0A, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C0B, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C0C, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C0D, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x8C0E, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C0F, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C10, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x8C11, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C12, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x8C13, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C14, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C15, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x8C16, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C17, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C18, 0x8C19, 0x8C1A,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C1B, 0x0000, 0x0000, 0x0000, 0x8C1C, 0x0000, 0x8C1D,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C1E, 0x0000, 0x8C1F, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C20,
+ 0x8C21, 0x0000, 0x8C22, 0x0000, 0x0000, 0x8C23, 0x0000, 0x0000, 0x8C24, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C25, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C26, 0x8C27, 0x8C28, 0x8C29, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C2A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x8C2B, 0x0000, 0x8C2C, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C2D, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x8C2E, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C2F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x8C30, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C31, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C32, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x8C33, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C34, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x8C35, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C36, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C37, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x8C38, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C39, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C3A,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C3B, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C3C, 0x0000, 0x0000, 0x8C3D, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C3E, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C3F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C40, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x8C41, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C42, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C43, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C44, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x8C45, 0x0000, 0x0000, 0x0000, 0x8C46, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C47, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C48, 0x0000, 0x0000, 0x0000,
+ 0x8C49, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C4A, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C4B, 0x8C4C,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x8C4D, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C4E, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C4F, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x8C50, 0x0000, 0x8C51, 0x8C52, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C53, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x8C54, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C55, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C56, 0x0000,
+ 0x0000, 0x0000, 0x8C57, 0x0000, 0x0000, 0x8C58, 0x0000, 0x0000, 0x8C59, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x8C5A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C5B, 0x0000, 0x0000, 0x8C5C, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C5D, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C5E, 0x0000, 0x8C5F, 0x0000, 0x8C60, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x8C61, 0x0000, 0x0000, 0x8C62, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C63,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C64, 0x0000, 0x0000, 0x8C65, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C66, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C67, 0x0000, 0x0000, 0x0000, 0x8C68, 0x8C69, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C6A, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C6B, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C6C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C6D, 0x0000, 0x0000, 0x8C6E, 0x8C6F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x8C70, 0x0000, 0x0000, 0x0000, 0x8C71, 0x0000, 0x8C72, 0x8C73, 0x0000, 0x0000, 0x8C74, 0x8C75, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C76, 0x0000, 0x0000, 0x8C77, 0x0000, 0x0000, 0x0000, 0x8C78, 0x0000,
+ 0x0000, 0x0000, 0x8C79, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C7A, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C7B, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C7C,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C7D, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C7E, 0x8C7F, 0x0000, 0x0000, 0x8C80,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C81, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C82,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C83, 0x8C84, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C85, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C86, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C87,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C88, 0x0000, 0x8C89, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C8A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x8C8B, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C8C, 0x0000,
+ 0x0000, 0x0000, 0x8C8D, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C8E, 0x0000, 0x0000, 0x0000, 0x8C8F,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x8C90, 0x0000, 0x0000, 0x0000, 0x8C91, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C92, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x8C93, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C94, 0x0000, 0x0000, 0x8C95,
+ 0x0000, 0x0000, 0x8C96, 0x0000, 0x0000, 0x0000, 0x8C97, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C98, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x8C99, 0x0000, 0x0000, 0x0000, 0x8C9A, 0x8C9B, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8C9C, 0x0000, 0x0000,
+ 0x8C9D, 0x8C9E, 0x0000, 0x0000, 0x8C9F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8CA0,
+ 0x0000, 0x0000, 0x0000, 0x8CA1, 0x0000, 0x0000, 0x0000, 0x0000, 0x8CA2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x8CA3, 0x0000, 0x0000, 0x0000, 0x0000, 0x8CA4, 0x0000, 0x0000, 0x0000, 0x0000, 0x8CA5, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8CA6, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x8CA7, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8CA8, 0x0000, 0x8CA9, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8CAA, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8CAB, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8CAC, 0x8CAD, 0x0000, 0x0000,
+ 0x0000, 0x8CAE, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8CAF, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8CB0, 0x0000, 0x0000, 0x0000, 0x0000, 0x8CB1, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8CB2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x8CB3, 0x8CB4, 0x0000, 0x8CB5, 0x0000, 0x0000, 0x8CB6, 0x0000, 0x0000, 0x8CB7, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8CB8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8CB9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8CBA, 0x0000, 0x0000,
+ 0x8CBB, 0x0000, 0x0000, 0x0000, 0x8CBC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8CBD, 0x0000, 0x0000, 0x0000, 0x0000, 0x8CBE,
+ 0x0000, 0x0000, 0x8CBF, 0x0000, 0x8CC0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8CC1, 0x0000, 0x0000, 0x0000, 0x8CC2,
+ 0x0000, 0x0000, 0x0000, 0x8CC3, 0x0000, 0x0000, 0x8CC4, 0x0000, 0x8CC5, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x8CC6, 0x0000, 0x0000, 0x0000, 0x8CC7, 0x8CC8, 0x0000, 0x0000, 0x0000, 0x8CC9, 0x0000, 0x8CCA, 0x0000, 0x0000, 0x8CCB,
+ 0x0000, 0x0000, 0x8CCC, 0x0000, 0x0000, 0x0000, 0x0000, 0x8CCD, 0x0000, 0x0000, 0x8CCE, 0x0000, 0x0000, 0x8CCF, 0x0000, 0x8CD0,
+ 0x8CD1, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x8CD2, 0x0000, 0x8CD3, 0x0000, 0x8CD4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x8CD5, 0x8CD6, 0x0000, 0x0000, 0x0000, 0x0000, 0x8CD7, 0x0000, 0x8CD8, 0x0000, 0x8CD9, 0x0000, 0x8CDA, 0x0000,
+ 0x8CDB, 0x0000, 0x0000, 0x8CDC, 0x0000, 0x8CDD, 0x8CDE, 0x8CDF, 0x8CE0, 0x0000, 0x0000, 0x8CE1, 0x0000, 0x8CE2, 0x0000, 0x8CE3,
+ 0x0000, 0x0000, 0x0000, 0x8CE4, 0x0000, 0x8CE5, 0x0000, 0x0000, 0x0000, 0x0000, 0x8CE6, 0x0000, 0x0000, 0x8CE7, 0x0000, 0x0000,
+ 0x0000, 0x8CE8, 0x0000, 0x0000, 0x8CE9, 0x0000, 0x8CEA, 0x0000, 0x0000, 0x0000, 0x8CEB, 0x0000, 0x8CEC, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x8CED, 0x0000, 0x0000, 0x0000, 0x0000, 0x8CEE, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8CEF, 0x0000,
+ 0x8CF0, 0x0000, 0x8CF1, 0x0000, 0x8CF2, 0x8CF3, 0x0000, 0x0000, 0x8CF4, 0x0000, 0x0000, 0x8CF5, 0x0000, 0x0000, 0x8CF6, 0x0000,
+ 0x8CF7, 0x8CF8, 0x8CF9, 0x8CFA, 0x0000, 0x0000, 0x8CFB, 0x0000, 0x0000, 0x8CFC, 0x0000, 0x8CFD, 0x8CFE, 0x8CFF, 0x8D00, 0x0000,
+ 0x8D01, 0x8D02, 0x8D03, 0x8D04, 0x0000, 0x8D05, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8D06, 0x0000, 0x0000, 0x8D07,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x8D08, 0x8D09, 0x8D0A, 0x8D0B, 0x0000, 0x0000, 0x0000, 0x0000, 0x8D0C, 0x8D0D, 0x0000, 0x0000,
+ 0x0000, 0x8D0E, 0x8D0F, 0x0000, 0x0000, 0x8D10, 0x0000, 0x0000, 0x8D11, 0x0000, 0x8D12, 0x0000, 0x0000, 0x0000, 0x8D13, 0x0000,
+ 0x8D14, 0x8D15, 0x0000, 0x8D16, 0x8D17, 0x8D18, 0x8D19, 0x0000, 0x8D1A, 0x0000, 0x8D1B, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x8D1C, 0x0000, 0x8D1D, 0x0000, 0x0000, 0x0000, 0x8D1E, 0x0000, 0x0000, 0x8D1F, 0x0000, 0x0000, 0x8D20, 0x0000, 0x0000, 0x8D21,
+ 0x0000, 0x0000, 0x8D22, 0x0000, 0x8D23, 0x0000, 0x0000, 0x8D24, 0x0000, 0x8D25, 0x0000, 0x8D26, 0x0000, 0x8D27, 0x0000, 0x8D28,
+ 0x0000, 0x8D29, 0x8D2A, 0x0000, 0x0000, 0x0000, 0x8D2B, 0x8D2C, 0x0000, 0x0000, 0x0000, 0x8D2D, 0x8D2E, 0x8D2F, 0x8D30, 0x0000,
+ 0x0000, 0x8D31, 0x8D32, 0x0000, 0x8D33, 0x0000, 0x8D34, 0x8D35, 0x0000, 0x0000, 0x0000, 0x8D36, 0x0000, 0x8D37, 0x8D38, 0x0000,
+ 0x0000, 0x8D39, 0x0000, 0x8D3A, 0x0000, 0x0000, 0x8D3B, 0x8D3C, 0x8D3D, 0x0000, 0x8D3E, 0x0000, 0x8D3F, 0x0000, 0x8D40, 0x0000,
+ 0x8D41, 0x8D42, 0x8D43, 0x0000, 0x8D44, 0x8D45, 0x0000, 0x0000, 0x0000, 0x0000, 0x8D46, 0x0000, 0x0000, 0x0000, 0x8D47, 0x0000,
+ 0x8D48, 0x0000, 0x0000, 0x0000, 0x8D49, 0x0000, 0x8D4A, 0x8D4B, 0x0000, 0x8D4C, 0x0000, 0x8D4D, 0x0000, 0x8D4E, 0x0000, 0x0000,
+ 0x8D4F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8D50, 0x0000, 0x0000, 0x8D51, 0x8D52, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x8D53, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8D54, 0x0000, 0x0000, 0x0000, 0x0000, 0x8D55, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8D56, 0x0000, 0x0000, 0x0000, 0x0000, 0x8D57, 0x8D58,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8D59, 0x0000, 0x8D5A, 0x8D5B, 0x8D5C, 0x0000, 0x8D5D, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8D5E, 0x0000, 0x0000, 0x0000, 0x8D5F,
+ 0x8D60, 0x0000, 0x0000, 0x0000, 0x8D61, 0x0000, 0x0000, 0x8D62, 0x8D63, 0x0000, 0x0000, 0x0000, 0x0000, 0x8D64, 0x8D65, 0x0000,
+ 0x8D66, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8D67, 0x8D68, 0x0000, 0x0000, 0x8D69, 0x0000,
+ 0x0000, 0x0000, 0x8D6A, 0x8D6B, 0x0000, 0x8D6C, 0x8D6D, 0x0000, 0x0000, 0x0000, 0x8D6E, 0x0000, 0x8D6F, 0x0000, 0x8D70, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8D71, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8D72, 0x0000,
+ 0x8D73, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8D74, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8D75, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x8D76, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8D77, 0x8D78, 0x0000,
+ 0x8D79, 0x8D7A, 0x8D7B, 0x0000, 0x0000, 0x0000, 0x0000, 0x8D7C, 0x8D7D, 0x8D7E, 0x8D7F, 0x8D80, 0x8D81, 0x0000, 0x0000, 0x8D82,
+ 0x8D83, 0x0000, 0x8D84, 0x8D85, 0x8D86, 0x0000, 0x8D87, 0x8D88, 0x8D89, 0x0000, 0x8D8A, 0x8D8B, 0x8D8C, 0x8D8D, 0x0000, 0x8D8E,
+ 0x8D8F, 0x8D90, 0x8D91, 0x8D92, 0x8D93, 0x8D94, 0x0000, 0x8D95, 0x8D96, 0x0000, 0x8D97, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x8D98, 0x8D99, 0x8D9A, 0x0000, 0x8D9B, 0x0000, 0x0000, 0x0000, 0x8D9C, 0x8D9D, 0x0000, 0x8D9E, 0x0000, 0x8D9F, 0x0000,
+ 0x8DA0, 0x8DA1, 0x8DA2, 0x8DA3, 0x8DA4, 0x0000, 0x8DA5, 0x8DA6, 0x0000, 0x0000, 0x8DA7, 0x0000, 0x8DA8, 0x8DA9, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x8DAA, 0x8DAB, 0x0000, 0x0000, 0x0000, 0x0000, 0x8DAC, 0x8DAD, 0x8DAE, 0x8DAF, 0x8DB0, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x8DB1, 0x8DB2, 0x0000, 0x8DB3, 0x8DB4, 0x0000, 0x8DB5, 0x0000, 0x0000, 0x8DB6, 0x0000, 0x8DB7,
+ 0x8DB8, 0x0000, 0x0000, 0x8DB9, 0x8DBA, 0x0000, 0x8DBB, 0x8DBC, 0x0000, 0x0000, 0x0000, 0x8DBD, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8DBE, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8DBF, 0x0000, 0x0000, 0x0000, 0x8DC0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8DC1, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x8DC2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x8DC3, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x8DC4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x8DC5, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8DC6, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8DC7, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x8DC8, 0x0000, 0x0000, 0x8DC9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8DCA, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x8DCB, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8DCC, 0x8DCD, 0x8DCE, 0x0000, 0x8DCF, 0x0000, 0x0000,
+ 0x0000, 0x8DD0, 0x8DD1, 0x8DD2, 0x0000, 0x8DD3, 0x0000, 0x0000, 0x0000, 0x0000, 0x8DD4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x8DD5, 0x0000, 0x0000, 0x0000, 0x8DD6, 0x8DD7, 0x0000, 0x0000, 0x0000, 0x8DD8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x8DD9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8DDA, 0x8DDB, 0x8DDC, 0x8DDD, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x8DDE, 0x0000, 0x8DDF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8DE0, 0x0000, 0x0000, 0x0000, 0x8DE1,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8DE2, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x8DE3, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8DE4, 0x8DE5, 0x8DE6, 0x8DE7, 0x8DE8, 0x0000, 0x8DE9, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x8DEA, 0x0000, 0x8DEB, 0x0000, 0x8DEC, 0x8DED, 0x8DEE, 0x8DEF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x8DF0, 0x0000, 0x8DF1, 0x8DF2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8DF3, 0x8DF4, 0x8DF5, 0x8DF6, 0x8DF7,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8DF8, 0x8DF9, 0x0000, 0x0000, 0x8DFA, 0x8DFB, 0x0000, 0x0000, 0x0000, 0x0000, 0x8DFC,
+ 0x0000, 0x0000, 0x0000, 0x8DFD, 0x0000, 0x0000, 0x0000, 0x0000, 0x8DFE, 0x0000, 0x0000, 0x8DFF, 0x0000, 0x0000, 0x8E00, 0x8E01,
+ 0x8E02, 0x0000, 0x8E03, 0x0000, 0x8E04, 0x8E05, 0x8E06, 0x0000, 0x0000, 0x8E07, 0x0000, 0x0000, 0x0000, 0x8E08, 0x8E09, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x8E0A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8E0B,
+ 0x0000, 0x8E0C, 0x8E0D, 0x0000, 0x8E0E, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8E0F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8E10, 0x8E11, 0x8E12,
+ 0x0000, 0x0000, 0x8E13, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8E14, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x8E15, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x8E16, 0x8E17, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8E18, 0x8E19, 0x0000, 0x0000, 0x8E1A, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x8E1B, 0x8E1C, 0x0000, 0x0000, 0x0000, 0x8E1D, 0x0000, 0x0000, 0x8E1E, 0x0000, 0x8E1F, 0x0000,
+ 0x8E20, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8E21, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x8E22, 0x0000, 0x0000, 0x0000, 0x0000, 0x8E23, 0x8E24, 0x0000, 0x8E25, 0x0000, 0x8E26, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x8E27, 0x0000, 0x0000, 0x8E28, 0x0000, 0x0000, 0x8E29, 0x0000, 0x0000, 0x8E2A, 0x0000, 0x0000, 0x0000, 0x0000, 0x8E2B,
+ 0x8E2C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8E2D,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8E2E, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8E2F, 0x0000, 0x0000, 0x8E30, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x8E31, 0x0000, 0x8E32, 0x0000, 0x8E33, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8E34, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8E35, 0x0000, 0x0000,
+ 0x8E36, 0x0000, 0x8E37, 0x0000, 0x8E38, 0x0000, 0x8E39, 0x0000, 0x0000, 0x0000, 0x8E3A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8E3B, 0x8E3C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x8E3D, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8E3E, 0x0000, 0x8E3F, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8E40, 0x8E41, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x8E42, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x8E43, 0x8E44, 0x0000, 0x8E45, 0x0000, 0x8E46, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8E47, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x8E48, 0x8E49, 0x0000, 0x8E4A, 0x8E4B, 0x8E4C, 0x0000, 0x0000, 0x0000, 0x8E4D, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x8E4E, 0x8E4F, 0x0000, 0x0000, 0x8E50, 0x0000, 0x8E51, 0x0000, 0x0000, 0x8E52, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8E53, 0x0000, 0x8E54, 0x0000, 0x8E55, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x8E56, 0x8E57, 0x0000, 0x8E58, 0x8E59, 0x0000, 0x0000, 0x0000, 0x0000, 0x8E5A, 0x0000, 0x0000, 0x0000, 0x8E5B, 0x0000, 0x0000,
+ 0x8E5C, 0x8E5D, 0x0000, 0x0000, 0x8E5E, 0x8E5F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8E60, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x8E61, 0x0000, 0x0000, 0x8E62, 0x8E63, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8E64, 0x0000,
+ 0x8E65, 0x0000, 0x0000, 0x8E66, 0x8E67, 0x0000, 0x0000, 0x8E68, 0x8E69, 0x8E6A, 0x8E6B, 0x0000, 0x0000, 0x8E6C, 0x8E6D, 0x8E6E,
+ 0x8E6F, 0x0000, 0x0000, 0x0000, 0x0000, 0x8E70, 0x0000, 0x0000, 0x8E71, 0x8E72, 0x0000, 0x8E73, 0x0000, 0x8E74, 0x0000, 0x0000,
+ 0x0000, 0x8E75, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8E76, 0x0000, 0x0000, 0x8E77, 0x8E78, 0x0000, 0x0000, 0x8E79, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x8E7A, 0x0000, 0x8E7B, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8E7C, 0x8E7D, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8E7E, 0x0000, 0x8E7F, 0x0000, 0x8E80, 0x8E81, 0x0000, 0x0000, 0x0000, 0x8E82,
+ 0x8E83, 0x0000, 0x0000, 0x8E84, 0x0000, 0x8E85, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8E86, 0x0000, 0x0000,
+ 0x0000, 0x8E87, 0x0000, 0x8E88, 0x0000, 0x0000, 0x8E89, 0x0000, 0x8E8A, 0x0000, 0x8E8B, 0x8E8C, 0x8E8D, 0x0000, 0x0000, 0x0000,
+ 0x8E8E, 0x0000, 0x0000, 0x8E8F, 0x0000, 0x8E90, 0x8E91, 0x0000, 0x8E92, 0x0000, 0x8E93, 0x8E94, 0x8E95, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x8E96, 0x0000, 0x0000, 0x0000, 0x8E97, 0x0000, 0x8E98, 0x0000, 0x8E99, 0x8E9A, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x8E9B, 0x0000, 0x8E9C, 0x0000, 0x8E9D, 0x0000, 0x8E9E, 0x0000, 0x0000, 0x0000, 0x0000, 0x8E9F, 0x0000, 0x0000, 0x8EA0,
+ 0x0000, 0x0000, 0x8EA1, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8EA2, 0x0000, 0x8EA3,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x8EA4, 0x8EA5, 0x8EA6, 0x0000, 0x8EA7, 0x8EA8, 0x8EA9, 0x0000, 0x0000, 0x0000, 0x8EAA, 0x8EAB,
+ 0x8EAC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8EAD, 0x0000, 0x0000, 0x0000, 0x8EAE, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x8EAF, 0x0000, 0x0000, 0x8EB0, 0x0000, 0x8EB1, 0x0000, 0x8EB2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8EB3,
+ 0x8EB4, 0x0000, 0x8EB5, 0x0000, 0x0000, 0x8EB6, 0x0000, 0x0000, 0x8EB7, 0x8EB8, 0x8EB9, 0x8EBA, 0x0000, 0x0000, 0x0000, 0x8EBB,
+ 0x8EBC, 0x8EBD, 0x8EBE, 0x0000, 0x0000, 0x0000, 0x8EBF, 0x0000, 0x8EC0, 0x8EC1, 0x0000, 0x8EC2, 0x0000, 0x0000, 0x8EC3, 0x8EC4,
+ 0x0000, 0x0000, 0x0000, 0x8EC5, 0x0000, 0x0000, 0x8EC6, 0x0000, 0x8EC7, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x8EC8, 0x0000, 0x0000, 0x0000, 0x0000, 0x8EC9, 0x8ECA, 0x0000, 0x0000, 0x8ECB, 0x8ECC, 0x0000, 0x8ECD, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x8ECE, 0x0000, 0x0000, 0x0000, 0x8ECF, 0x0000, 0x8ED0, 0x8ED1, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x8ED2, 0x0000, 0x0000, 0x0000, 0x8ED3, 0x8ED4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8ED5, 0x0000, 0x0000, 0x0000,
+ 0x8ED6, 0x0000, 0x0000, 0x0000, 0x0000, 0x8ED7, 0x8ED8, 0x0000, 0x0000, 0x0000, 0x8ED9, 0x0000, 0x0000, 0x0000, 0x8EDA, 0x0000,
+ 0x0000, 0x0000, 0x8EDB, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8EDC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x8EDD, 0x0000, 0x8EDE, 0x0000, 0x8EDF, 0x0000, 0x0000, 0x8EE0, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x8EE1, 0x8EE2, 0x8EE3, 0x0000, 0x0000, 0x8EE4, 0x8EE5, 0x0000, 0x8EE6, 0x8EE7, 0x0000, 0x8EE8, 0x0000, 0x8EE9, 0x0000,
+ 0x8EEA, 0x0000, 0x0000, 0x8EEB, 0x0000, 0x8EEC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x8EED, 0x0000, 0x0000, 0x0000, 0x8EEE, 0x8EEF, 0x0000, 0x0000, 0x0000, 0x8EF0, 0x8EF1, 0x0000, 0x0000,
+ 0x8EF2, 0x8EF3, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8EF4, 0x8EF5, 0x0000, 0x0000, 0x0000, 0x8EF6, 0x8EF7, 0x8EF8, 0x8EF9,
+ 0x0000, 0x8EFA, 0x8EFB, 0x0000, 0x8EFC, 0x0000, 0x0000, 0x0000, 0x8EFD, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x8EFE, 0x0000, 0x0000, 0x0000, 0x0000, 0x8EFF, 0x0000, 0x0000, 0x0000, 0x8F00, 0x0000, 0x0000, 0x0000, 0x8F01, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x8F02, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x8F03, 0x0000, 0x0000, 0x8F04, 0x8F05, 0x0000, 0x0000, 0x0000, 0x8F06, 0x8F07, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8F08, 0x8F09, 0x0000, 0x0000, 0x8F0A, 0x0000, 0x0000, 0x8F0B, 0x0000,
+ 0x0000, 0x0000, 0x8F0C, 0x8F0D, 0x0000, 0x8F0E, 0x8F0F, 0x0000, 0x8F10, 0x0000, 0x8F11, 0x0000, 0x0000, 0x0000, 0x0000, 0x8F12,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x8F13, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8F14, 0x0000, 0x8F15, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x8F16, 0x0000, 0x0000, 0x0000, 0x8F17, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8F18, 0x0000,
+ 0x8F19, 0x0000, 0x0000, 0x8F1A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8F1B, 0x0000, 0x0000,
+ 0x8F1C, 0x8F1D, 0x8F1E, 0x0000, 0x0000, 0x0000, 0x0000, 0x8F1F, 0x0000, 0x8F20, 0x0000, 0x0000, 0x8F21, 0x8F22, 0x8F23, 0x8F24,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8F25, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x8F26, 0x0000, 0x8F27, 0x8F28, 0x0000, 0x0000, 0x8F29, 0x0000, 0x8F2A, 0x8F2B, 0x0000, 0x8F2C, 0x8F2D, 0x0000, 0x8F2E, 0x8F2F,
+ 0x0000, 0x0000, 0x8F30, 0x8F31, 0x8F32, 0x0000, 0x0000, 0x0000, 0x8F33, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x8F34, 0x0000, 0x8F35, 0x0000, 0x8F36, 0x0000, 0x0000, 0x8F37, 0x8F38, 0x0000, 0x8F39, 0x8F3A, 0x8F3B, 0x0000, 0x0000,
+ 0x0000, 0x8F3C, 0x0000, 0x0000, 0x0000, 0x0000, 0x8F3D, 0x0000, 0x0000, 0x8F3E, 0x0000, 0x8F3F, 0x8F40, 0x8F41, 0x8F42, 0x8F43,
+ 0x0000, 0x0000, 0x0000, 0x8F44, 0x0000, 0x0000, 0x8F45, 0x8F46, 0x8F47, 0x0000, 0x8F48, 0x8F49, 0x8F4A, 0x0000, 0x0000, 0x0000,
+ 0x8F4B, 0x0000, 0x8F4C, 0x8F4D, 0x8F4E, 0x8F4F, 0x8F50, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8F51, 0x0000, 0x8F52, 0x0000,
+ 0x8F53, 0x8F54, 0x8F55, 0x0000, 0x8F56, 0x8F57, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8F58, 0x0000, 0x0000, 0x0000, 0x0000, 0x8F59, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x8F5A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x8F5B, 0x0000, 0x0000, 0x8F5C, 0x0000, 0x0000, 0x0000, 0x0000, 0x8F5D, 0x0000, 0x0000, 0x0000, 0x0000, 0x8F5E, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8F5F, 0x8F60, 0x0000, 0x0000, 0x0000, 0x8F61, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8F62, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8F63, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8F64, 0x0000, 0x8F65, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x8F66, 0x0000, 0x0000, 0x8F67, 0x0000, 0x0000, 0x0000, 0x8F68, 0x0000, 0x0000, 0x8F69, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8F6A, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8F6B, 0x0000, 0x0000, 0x8F6C, 0x0000, 0x8F6D, 0x8F6E, 0x0000, 0x8F6F, 0x0000,
+ 0x0000, 0x0000, 0x8F70, 0x8F71, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x8F72, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8F73, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x8F74, 0x0000, 0x0000, 0x0000, 0x0000, 0x8F75, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8F76, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x8F77, 0x0000, 0x8F78, 0x0000, 0x8F79, 0x0000, 0x8F7A, 0x8F7B, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8F7C, 0x0000, 0x8F7D, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8F7E, 0x0000, 0x8F7F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x8F80, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8F81,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8F82, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x8F83, 0x0000, 0x8F84, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8F85, 0x0000, 0x8F86, 0x8F87, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x8F88, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8F89, 0x0000, 0x0000, 0x8F8A, 0x0000, 0x8F8B, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8F8C, 0x0000, 0x0000, 0x0000, 0x8F8D,
+ 0x0000, 0x8F8E, 0x8F8F, 0x8F90, 0x0000, 0x8F91, 0x8F92, 0x8F93, 0x8F94, 0x0000, 0x8F95, 0x0000, 0x8F96, 0x0000, 0x8F97, 0x8F98,
+ 0x8F99, 0x8F9A, 0x8F9B, 0x8F9C, 0x0000, 0x0000, 0x0000, 0x8F9D, 0x8F9E, 0x0000, 0x0000, 0x0000, 0x8F9F, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x8FA0, 0x0000, 0x0000, 0x8FA1, 0x0000, 0x8FA2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8FA3, 0x0000, 0x0000,
+ 0x8FA4, 0x0000, 0x8FA5, 0x0000, 0x0000, 0x0000, 0x0000, 0x8FA6, 0x8FA7, 0x8FA8, 0x0000, 0x8FA9, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8FAA, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8FAB, 0x8FAC, 0x8FAD, 0x8FAE,
+ 0x0000, 0x0000, 0x8FAF, 0x8FB0, 0x0000, 0x0000, 0x0000, 0x0000, 0x8FB1, 0x8FB2, 0x0000, 0x8FB3, 0x0000, 0x0000, 0x8FB4, 0x0000,
+ 0x0000, 0x0000, 0x8FB5, 0x0000, 0x0000, 0x8FB6, 0x0000, 0x8FB7, 0x0000, 0x0000, 0x0000, 0x8FB8, 0x8FB9, 0x0000, 0x0000, 0x8FBA,
+ 0x8FBB, 0x8FBC, 0x0000, 0x8FBD, 0x8FBE, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8FBF, 0x0000, 0x0000, 0x0000, 0x0000, 0x8FC0, 0x8FC1, 0x8FC2,
+ 0x0000, 0x8FC3, 0x0000, 0x0000, 0x0000, 0x0000, 0x8FC4, 0x0000, 0x8FC5, 0x0000, 0x8FC6, 0x8FC7, 0x8FC8, 0x0000, 0x0000, 0x0000,
+ 0x8FC9, 0x0000, 0x0000, 0x0000, 0x8FCA, 0x0000, 0x8FCB, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8FCC, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x8FCD, 0x8FCE, 0x0000, 0x8FCF, 0x0000, 0x0000, 0x0000, 0x8FD0, 0x8FD1, 0x8FD2, 0x0000, 0x8FD3, 0x0000, 0x8FD4,
+ 0x0000, 0x0000, 0x8FD5, 0x0000, 0x8FD6, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8FD7, 0x8FD8, 0x8FD9, 0x8FDA,
+ 0x0000, 0x0000, 0x0000, 0x8FDB, 0x8FDC, 0x8FDD, 0x0000, 0x0000, 0x0000, 0x8FDE, 0x8FDF, 0x0000, 0x8FE0, 0x0000, 0x8FE1, 0x0000,
+ 0x0000, 0x8FE2, 0x8FE3, 0x8FE4, 0x0000, 0x0000, 0x8FE5, 0x0000, 0x8FE6, 0x0000, 0x8FE7, 0x8FE8, 0x8FE9, 0x0000, 0x8FEA, 0x0000,
+ 0x0000, 0x8FEB, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8FEC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x8FED, 0x0000, 0x8FEE, 0x0000, 0x8FEF, 0x8FF0, 0x0000, 0x0000, 0x0000, 0x8FF1, 0x0000, 0x8FF2, 0x0000, 0x8FF3, 0x8FF4,
+ 0x0000, 0x8FF5, 0x0000, 0x8FF6, 0x0000, 0x8FF7, 0x0000, 0x0000, 0x8FF8, 0x8FF9, 0x0000, 0x8FFA, 0x8FFB, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x8FFC, 0x0000, 0x0000, 0x0000, 0x0000, 0x8FFD, 0x0000, 0x0000, 0x0000, 0x0000, 0x8FFE, 0x0000, 0x8FFF, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x9000, 0x9001, 0x9002, 0x0000,
+ 0x0000, 0x9003, 0x0000, 0x9004, 0x9005, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x9006, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x9007, 0x9008, 0x9009, 0x0000, 0x900A, 0x900B, 0x0000, 0x0000, 0x900C, 0x900D, 0x0000, 0x900E, 0x0000, 0x900F, 0x0000, 0x9010,
+ 0x0000, 0x0000, 0x9011, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x9012, 0x0000, 0x0000,
+ 0x9013, 0x9014, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x9015, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x9016,
+ 0x0000, 0x9017, 0x9018, 0x0000, 0x0000, 0x9019, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x901A, 0x901B, 0x901C,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x901D, 0x0000, 0x0000, 0x901E, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x901F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x9020, 0x0000, 0x9021, 0x9022, 0x0000,
+ 0x9023, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x9024, 0x9025, 0x9026, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x9027, 0x0000,
+ 0x9028, 0x9029, 0x902A, 0x902B, 0x902C, 0x902D, 0x0000, 0x0000, 0x0000, 0x0000, 0x902E, 0x0000, 0x902F, 0x9030, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x9031, 0x0000, 0x9032, 0x0000, 0x0000, 0x9033, 0x9034, 0x0000, 0x0000, 0x0000, 0x9035,
+ 0x0000, 0x0000, 0x9036, 0x0000, 0x9037, 0x9038, 0x9039, 0x0000, 0x0000, 0x0000, 0x903A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x903B,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x903C,
+ 0x0000, 0x0000, 0x903D, 0x0000, 0x903E, 0x903F, 0x9040, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x9041, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x9042, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x9043, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x9044, 0x0000, 0x0000, 0x9045, 0x0000, 0x9046, 0x0000, 0x9047, 0x0000, 0x0000, 0x0000, 0x0000, 0x9048, 0x0000,
+ 0x0000, 0x9049, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x904A, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x904B, 0x0000, 0x904C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x904D, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x904E,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x904F, 0x0000, 0x0000, 0x9050, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x9051, 0x0000, 0x9052, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x9053, 0x9054, 0x0000,
+ 0x9055, 0x9056, 0x9057, 0x9058, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x9059, 0x0000, 0x0000, 0x0000, 0x905A, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x905B, 0x0000, 0x0000, 0x0000, 0x905C, 0x905D, 0x0000, 0x905E, 0x905F, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x9060, 0x9061, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x9062, 0x0000, 0x9063, 0x9064, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x9065, 0x9066, 0x9067, 0x9068, 0x0000, 0x0000, 0x0000, 0x9069, 0x0000, 0x906A, 0x0000, 0x0000,
+ 0x0000, 0x906B, 0x906C, 0x0000, 0x906D, 0x0000, 0x0000, 0x906E, 0x906F, 0x0000, 0x9070, 0x9071, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x9072, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x9073, 0x0000, 0x9074,
+ 0x0000, 0x0000, 0x9075, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x9076, 0x9077, 0x0000, 0x0000, 0x0000, 0x9078, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x9079, 0x907A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x907B, 0x0000, 0x0000, 0x907C,
+ 0x0000, 0x0000, 0x0000, 0x907D, 0x0000, 0x907E, 0x0000, 0x0000, 0x907F, 0x9080, 0x0000, 0x0000, 0x0000, 0x9081, 0x9082, 0x0000,
+ 0x0000, 0x9083, 0x9084, 0x0000, 0x0000, 0x0000, 0x0000, 0x9085, 0x0000, 0x9086, 0x9087, 0x9088, 0x0000, 0x0000, 0x9089, 0x0000,
+ 0x0000, 0x0000, 0x908A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x908B, 0x908C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x908D, 0x0000, 0x908E, 0x0000, 0x908F, 0x9090, 0x9091, 0x0000, 0x0000, 0x0000, 0x0000, 0x9092, 0x0000, 0x9093,
+ 0x9094, 0x0000, 0x0000, 0x9095, 0x0000, 0x0000, 0x0000, 0x9096, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x9097, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x9098, 0x9099, 0x0000, 0x909A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x909B, 0x0000, 0x909C, 0x0000, 0x909D, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x909E, 0x909F, 0x90A0, 0x0000, 0x90A1, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x90A2, 0x90A3, 0x0000, 0x90A4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x90A5, 0x0000, 0x0000, 0x90A6, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x90A7, 0x0000, 0x90A8, 0x90A9, 0x90AA,
+ 0x0000, 0x0000, 0x0000, 0x90AB, 0x0000, 0x0000, 0x90AC, 0x0000, 0x90AD, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x90AE,
+ 0x90AF, 0x0000, 0x0000, 0x0000, 0x90B0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x90B1, 0x0000, 0x0000, 0x0000, 0x90B2,
+ 0x0000, 0x0000, 0x90B3, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x90B4, 0x90B5, 0x90B6, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x90B7, 0x90B8, 0x0000, 0x0000,
+ 0x90B9, 0x90BA, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x90BB, 0x0000, 0x90BC, 0x0000, 0x0000, 0x90BD,
+ 0x0000, 0x0000, 0x90BE, 0x0000, 0x0000, 0x0000, 0x0000, 0x90BF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x90C0, 0x0000, 0x90C1, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x90C2, 0x0000, 0x0000, 0x90C3, 0x0000, 0x90C4, 0x0000, 0x90C5, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x90C6, 0x0000, 0x0000, 0x90C7, 0x90C8, 0x0000, 0x0000, 0x0000, 0x90C9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x90CA,
+ 0x0000, 0x0000, 0x90CB, 0x0000, 0x90CC, 0x0000, 0x0000, 0x0000, 0x0000, 0x90CD, 0x90CE, 0x90CF, 0x90D0, 0x0000, 0x0000, 0x90D1,
+ 0x0000, 0x90D2, 0x90D3, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x90D4, 0x0000, 0x0000, 0x90D5, 0x90D6, 0x0000, 0x90D7, 0x90D8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x90D9, 0x90DA, 0x0000, 0x0000, 0x0000, 0x0000, 0x90DB, 0x0000, 0x0000, 0x0000, 0x90DC,
+ 0x0000, 0x0000, 0x90DD, 0x0000, 0x90DE, 0x0000, 0x0000, 0x0000, 0x90DF, 0x90E0, 0x90E1, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x90E2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x90E3, 0x0000, 0x0000, 0x90E4, 0x0000, 0x90E5, 0x90E6, 0x0000, 0x90E7, 0x90E8, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x90E9, 0x0000, 0x0000, 0x0000, 0x0000, 0x90EA, 0x0000, 0x90EB, 0x90EC, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x90ED, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x90EE, 0x0000, 0x0000, 0x0000, 0x90EF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x90F0, 0x90F1, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x90F2, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x90F3, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x90F4, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x90F5, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x90F6, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x90F7, 0x0000, 0x90F8, 0x90F9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x90FA, 0x0000, 0x90FB,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x90FC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x90FD, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x90FE, 0x90FF, 0x0000, 0x0000, 0x9100, 0x9101,
+ 0x0000, 0x0000, 0x9102, 0x0000, 0x9103, 0x9104, 0x0000, 0x0000, 0x0000, 0x9105, 0x0000, 0x0000, 0x9106, 0x0000, 0x0000, 0x9107,
+ 0x9108, 0x9109, 0x0000, 0x0000, 0x0000, 0x0000, 0x910A, 0x0000, 0x0000, 0x0000, 0x910B, 0x0000, 0x910C, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x910D, 0x0000, 0x0000, 0x0000, 0x0000, 0x910E, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x910F, 0x9110, 0x0000,
+ 0x9111, 0x0000, 0x0000, 0x0000, 0x9112, 0x9113, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x9114, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x9115, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x9116, 0x9117, 0x9118, 0x9119, 0x911A, 0x911B, 0x911C, 0x911D, 0x911E, 0x911F, 0x9120, 0x9121, 0x9122, 0x9123, 0x9124, 0x9125,
+ 0x9126, 0x9127, 0x9128, 0x9129, 0x912A, 0x912B, 0x912C, 0x912D, 0x912E, 0x912F, 0x9130, 0x9131, 0x9132, 0x9133, 0x9134, 0x9135,
+ 0x9136, 0x9137, 0x9138, 0x9139, 0x913A, 0x913B, 0x913C, 0x913D, 0x913E, 0x913F, 0x9140, 0x9141, 0x9142, 0x9143, 0x9144, 0x9145,
+ 0x9146, 0x9147, 0x9148, 0x9149, 0x914A, 0x914B, 0x914C, 0x914D, 0x914E, 0x914F, 0x9150, 0x9151, 0x9152, 0x9153, 0x9154, 0x9155,
+ 0x9156, 0x9157, 0x9158, 0x9159, 0x915A, 0x915B, 0x915C, 0x915D, 0x915E, 0x915F, 0x9160, 0x9161, 0x9162, 0x9163, 0x9164, 0x9165,
+ 0x9166, 0x9167, 0x9168, 0x9169, 0x916A, 0x916B, 0x916C, 0x916D, 0x916E, 0x916F, 0x9170, 0x9171, 0x9172, 0x9173, 0x9174, 0x9175,
+ 0x9176, 0x9177, 0x9178, 0x9179, 0x917A, 0x917B, 0x917C, 0x917D, 0x917E, 0x917F, 0x9180, 0x9181, 0x9182, 0x9183, 0x9184, 0x9185,
+ 0x9186, 0x9187, 0x9188, 0x9189, 0x918A, 0x918B, 0x918C, 0x918D, 0x918E, 0x918F, 0x9190, 0x9191, 0x9192, 0x9193, 0x9194, 0x9195,
+ 0x9196, 0x9197, 0x9198, 0x9199, 0x919A, 0x919B, 0x919C, 0x919D, 0x919E, 0x919F, 0x91A0, 0x91A1, 0x91A2, 0x91A3, 0x91A4, 0x91A5,
+ 0x91A6, 0x91A7, 0x91A8, 0x91A9, 0x91AA, 0x91AB, 0x91AC, 0x91AD, 0x91AE, 0x91AF, 0x91B0, 0x91B1, 0x91B2, 0x91B3, 0x91B4, 0x91B5,
+ 0x91B6, 0x91B7, 0x91B8, 0x91B9, 0x91BA, 0x91BB, 0x91BC, 0x91BD, 0x91BE, 0x91BF, 0x91C0, 0x91C1, 0x91C2, 0x91C3, 0x91C4, 0x91C5,
+ 0x91C6, 0x91C7, 0x91C8, 0x91C9, 0x91CA, 0x91CB, 0x91CC, 0x91CD, 0x91CE, 0x91CF, 0x91D0, 0x91D1, 0x91D2, 0x91D3, 0x91D4, 0x91D5,
+ 0x91D6, 0x91D7, 0x91D8, 0x91D9, 0x91DA, 0x91DB, 0x91DC, 0x91DD, 0x91DE, 0x91DF, 0x91E0, 0x91E1, 0x91E2, 0x91E3, 0x91E4, 0x91E5,
+ 0x91E6, 0x91E7, 0x91E8, 0x91E9, 0x91EA, 0x91EB, 0x91EC, 0x91ED, 0x91EE, 0x91EF, 0x91F0, 0x91F1, 0x91F2, 0x91F3, 0x91F4, 0x91F5,
+ 0x91F6, 0x91F7, 0x91F8, 0x91F9, 0x91FA, 0x91FB, 0x91FC, 0x91FD, 0x91FE, 0x91FF, 0x9200, 0x9201, 0x9202, 0x9203, 0x9204, 0x9205,
+ 0x9206, 0x9207, 0x9208, 0x9209, 0x920A, 0x920B, 0x920C, 0x920D, 0x920E, 0x920F, 0x9210, 0x9211, 0x9212, 0x9213, 0x9214, 0x9215,
+ 0x9216, 0x9217, 0x9218, 0x9219, 0x921A, 0x921B, 0x921C, 0x921D, 0x921E, 0x921F, 0x9220, 0x9221, 0x9222, 0x9223, 0x0000, 0x0000,
+ 0x9224, 0x0000, 0x9225, 0x0000, 0x0000, 0x9226, 0x9227, 0x9228, 0x9229, 0x922A, 0x922B, 0x922C, 0x922D, 0x922E, 0x922F, 0x0000,
+ 0x9230, 0x0000, 0x9231, 0x0000, 0x0000, 0x9232, 0x9233, 0x0000, 0x0000, 0x0000, 0x9234, 0x9235, 0x9236, 0x9237, 0x0000, 0x0000,
+ 0x9238, 0x9239, 0x923A, 0x923B, 0x923C, 0x923D, 0x923E, 0x923F, 0x9240, 0x9241, 0x9242, 0x9243, 0x9244, 0x9245, 0x9246, 0x9247,
+ 0x9248, 0x9249, 0x924A, 0x924B, 0x924C, 0x924D, 0x924E, 0x924F, 0x9250, 0x9251, 0x9252, 0x9253, 0x9254, 0x9255, 0x9256, 0x9257,
+ 0x9258, 0x9259, 0x925A, 0x925B, 0x925C, 0x925D, 0x925E, 0x925F, 0x9260, 0x9261, 0x9262, 0x9263, 0x9264, 0x9265, 0x9266, 0x9267,
+ 0x9268, 0x9269, 0x926A, 0x926B, 0x926C, 0x926D, 0x926E, 0x926F, 0x9270, 0x9271, 0x9272, 0x9273, 0x0000, 0x9274, 0x0000, 0x0000,
+ 0x9275, 0x9276, 0x9277, 0x9278, 0x9279, 0x927A, 0x927B, 0x927C, 0x927D, 0x927E, 0x927F, 0x9280, 0x9281, 0x9282, 0x9283, 0x9284,
+ 0x9285, 0x9286, 0x9287, 0x9288, 0x9289, 0x928A, 0x928B, 0x928C, 0x928D, 0x928E, 0x928F, 0x9290, 0x9291, 0x9292, 0x9293, 0x9294,
+ 0x9295, 0x9296, 0x9297, 0x9298, 0x9299, 0x929A, 0x929B, 0x929C, 0x929D, 0x929E, 0x929F, 0x92A0, 0x92A1, 0x92A2, 0x92A3, 0x92A4,
+ 0x92A5, 0x92A6, 0x92A7, 0x92A8, 0x92A9, 0x92AA, 0x92AB, 0x92AC, 0x92AD, 0x92AE, 0x92AF, 0x92B0, 0x92B1, 0x92B2, 0x92B3, 0x92B4,
+ 0x92B5, 0x92B6, 0x92B7, 0x92B8, 0x92B9, 0x92BA, 0x92BB, 0x92BC, 0x92BD, 0x92BE, 0x92BF, 0x92C0, 0x92C1, 0x92C2, 0x92C3, 0x92C4,
+ 0x92C5, 0x92C6, 0x92C7, 0x92C8, 0x92C9, 0x92CA, 0x92CB, 0x92CC, 0x92CD, 0x92CE, 0x92CF, 0x92D0, 0x92D1, 0x92D2, 0x92D3, 0x0000,
+ 0x0000, 0x0000, 0x92D4, 0x92D5, 0x92D6, 0x0000, 0x0000, 0x0000, 0x92D7, 0x92D8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x23AC, 0x23AE, 0x23B0, 0x3312, 0x3315, 0x23B2, 0x23B4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x23B6, 0x23B8, 0x23BA, 0x23BC, 0x23BE, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x23C0, 0x0000, 0x23C2,
+ 0x92D9, 0x92DA, 0x92DB, 0x92DC, 0x92DD, 0x92DE, 0x92DF, 0x92E0, 0x92E1, 0x92E2, 0x23C4, 0x23C6, 0x23C8, 0x23CA, 0x23CC, 0x23CE,
+ 0x23D0, 0x23D2, 0x23D4, 0x23D6, 0x23D8, 0x23DA, 0x23DC, 0x0000, 0x23DE, 0x23E0, 0x23E2, 0x23E4, 0x23E6, 0x0000, 0x23E8, 0x0000,
+ 0x23EA, 0x23EC, 0x0000, 0x23EE, 0x23F0, 0x0000, 0x23F2, 0x23F4, 0x23F6, 0x23F8, 0x23FA, 0x23FC, 0x23FE, 0x2400, 0x2402, 0x2404,
+ 0x92E3, 0x92E4, 0x92E5, 0x92E6, 0x92E7, 0x92E8, 0x92E9, 0x92EA, 0x92EB, 0x92EC, 0x92ED, 0x92EE, 0x92EF, 0x92F0, 0x92F1, 0x92F2,
+ 0x92F3, 0x92F4, 0x92F5, 0x92F6, 0x92F7, 0x92F8, 0x92F9, 0x92FA, 0x92FB, 0x92FC, 0x92FD, 0x92FE, 0x92FF, 0x9300, 0x9301, 0x9302,
+ 0x9303, 0x9304, 0x9305, 0x9306, 0x9307, 0x9308, 0x9309, 0x930A, 0x930B, 0x930C, 0x930D, 0x930E, 0x930F, 0x9310, 0x9311, 0x9312,
+ 0x9313, 0x9314, 0x9315, 0x9316, 0x9317, 0x9318, 0x9319, 0x931A, 0x931B, 0x931C, 0x931D, 0x931E, 0x931F, 0x9320, 0x9321, 0x9322,
+ 0x9323, 0x9324, 0x9325, 0x9326, 0x9327, 0x9328, 0x9329, 0x932A, 0x932B, 0x932C, 0x932D, 0x932E, 0x932F, 0x9330, 0x9331, 0x9332,
+ 0x9333, 0x9334, 0x9335, 0x9336, 0x9337, 0x9338, 0x9339, 0x933A, 0x933B, 0x933C, 0x933D, 0x933E, 0x933F, 0x9340, 0x9341, 0x9342,
+ 0x9343, 0x9344, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x9345, 0x9346, 0x9347, 0x9348, 0x9349, 0x934A, 0x934B, 0x934C, 0x934D, 0x934E, 0x934F, 0x9350, 0x9351,
+ 0x9352, 0x9353, 0x9354, 0x9355, 0x9356, 0x9357, 0x9358, 0x9359, 0x935A, 0x935B, 0x2406, 0x2408, 0x240A, 0x240C, 0x240E, 0x2410,
+ 0x2412, 0x2414, 0x2416, 0x2418, 0x241A, 0x241C, 0x241E, 0x2420, 0x2422, 0x2424, 0x2426, 0x2428, 0x935C, 0x935D, 0x935E, 0x935F,
+ 0x242A, 0x242C, 0x242E, 0x2430, 0x2432, 0x2434, 0x2436, 0x2438, 0x243A, 0x243C, 0x243E, 0x2440, 0x2442, 0x2444, 0x2446, 0x2448,
+ 0x244A, 0x244C, 0x244E, 0x2450, 0x2452, 0x2454, 0x2456, 0x2458, 0x245A, 0x245C, 0x245E, 0x2460, 0x2462, 0x2464, 0x2466, 0x2468,
+ 0x246A, 0x246C, 0x246E, 0x2470, 0x2472, 0x2474, 0x2476, 0x2478, 0x247A, 0x247C, 0x247E, 0x2480, 0x2482, 0x2484, 0x2486, 0x2488,
+ 0x248A, 0x248C, 0x248E, 0x2490, 0x2492, 0x2494, 0x2496, 0x2498, 0x249A, 0x249C, 0x249E, 0x24A0, 0x24A2, 0x24A4, 0x24A6, 0x24A8,
+ 0x24AA, 0x24AC, 0x24AE, 0x24B0, 0x24B2, 0x24B4, 0x24B6, 0x24B8, 0x24BA, 0x24BC, 0x24BE, 0x24C0, 0x24C2, 0x24C4, 0x24C6, 0x24C8,
+ 0x24CA, 0x24CC, 0x24CE, 0x24D0, 0x24D2, 0x24D4, 0x24D6, 0x24D8, 0x24DA, 0x24DC, 0x24DE, 0x24E0, 0x24E2, 0x24E4, 0x24E6, 0x24E8,
+ 0x24EA, 0x24EC, 0x24EE, 0x24F0, 0x24F2, 0x24F4, 0x24F6, 0x24F8, 0x24FA, 0x24FC, 0x24FE, 0x2500, 0x2502, 0x2504, 0x2506, 0x2508,
+ 0x250A, 0x250C, 0x250E, 0x2510, 0x2512, 0x2514, 0x2516, 0x2518, 0x251A, 0x251C, 0x251E, 0x2520, 0x2522, 0x2524, 0x2526, 0x2528,
+ 0x252A, 0x252C, 0x252E, 0x2530, 0x2532, 0x2534, 0x2536, 0x2538, 0x253A, 0x253C, 0x253E, 0x2540, 0x2542, 0x2544, 0x2546, 0x2548,
+ 0x254A, 0x254C, 0x254E, 0x2550, 0x2552, 0x2554, 0x2556, 0x2558, 0x255A, 0x255C, 0x255E, 0x2560, 0x2562, 0x2564, 0x2566, 0x2568,
+ 0x256A, 0x256C, 0x256E, 0x2570, 0x2572, 0x2574, 0x2576, 0x2578, 0x257A, 0x257C, 0x257E, 0x2580, 0x2582, 0x2584, 0x2586, 0x2588,
+ 0x258A, 0x258C, 0x258E, 0x2590, 0x2592, 0x2594, 0x2596, 0x2598, 0x259A, 0x259C, 0x259E, 0x25A0, 0x25A2, 0x25A4, 0x25A6, 0x25A8,
+ 0x25AA, 0x25AC, 0x25AE, 0x25B0, 0x25B2, 0x25B4, 0x25B6, 0x25B8, 0x25BA, 0x25BC, 0x25BE, 0x25C0, 0x25C2, 0x25C4, 0x25C6, 0x25C8,
+ 0x25CA, 0x25CC, 0x25CE, 0x25D0, 0x25D2, 0x25D4, 0x25D6, 0x25D8, 0x25DA, 0x25DC, 0x25DE, 0x25E0, 0x25E2, 0x25E4, 0x25E6, 0x25E8,
+ 0x25EA, 0x25EC, 0x25EE, 0x25F0, 0x25F2, 0x25F4, 0x25F6, 0x25F8, 0x25FA, 0x25FC, 0x25FE, 0x2600, 0x2602, 0x2604, 0x2606, 0x2608,
+ 0x260A, 0x260C, 0x3318, 0x331B, 0x331E, 0x260E, 0x2610, 0x2612, 0x2614, 0x2616, 0x2618, 0x261A, 0x261C, 0x261E, 0x2620, 0x2622,
+ 0x2624, 0x2626, 0x2628, 0x262A, 0x262C, 0x262E, 0x2630, 0x2632, 0x2634, 0x2636, 0x2638, 0x263A, 0x263C, 0x263E, 0x2640, 0x2642,
+ 0x2644, 0x2646, 0x2648, 0x264A, 0x264C, 0x264E, 0x2650, 0x2652, 0x2654, 0x2656, 0x2658, 0x265A, 0x265C, 0x265E, 0x2660, 0x2662,
+ 0x2664, 0x2666, 0x2668, 0x266A, 0x266C, 0x266E, 0x2670, 0x2672, 0x2674, 0x2676, 0x2678, 0x267A, 0x267C, 0x267E, 0x2680, 0x2682,
+ 0x2684, 0x2686, 0x2688, 0x268A, 0x268C, 0x268E, 0x2690, 0x2692, 0x2694, 0x2696, 0x2698, 0x269A, 0x269C, 0x269E, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x3321, 0x3324, 0x3327, 0x332A, 0x332D, 0x3330, 0x3333, 0x3336, 0x3339, 0x333C, 0x333F, 0x3342, 0x3345, 0x3348, 0x334B, 0x334E,
+ 0x3351, 0x3354, 0x3357, 0x335A, 0x335D, 0x3360, 0x3363, 0x3366, 0x3369, 0x336C, 0x336F, 0x3372, 0x3375, 0x3378, 0x337B, 0x337E,
+ 0x3381, 0x3384, 0x3387, 0x338A, 0x338D, 0x3390, 0x3393, 0x3396, 0x3399, 0x339C, 0x339F, 0x33A2, 0x33A5, 0x33A8, 0x33AB, 0x33AE,
+ 0x33B1, 0x33B4, 0x33B7, 0x33BA, 0x33BD, 0x33C0, 0x33C3, 0x33C6, 0x33C9, 0x33CC, 0x33CF, 0x33D2, 0x33D5, 0x33D8, 0x33DB, 0x33DE,
+ 0x0000, 0x0000, 0x33E1, 0x33E4, 0x33E7, 0x33EA, 0x33ED, 0x33F0, 0x33F3, 0x33F6, 0x33F9, 0x33FC, 0x33FF, 0x3402, 0x3405, 0x3408,
+ 0x340B, 0x340E, 0x3411, 0x3414, 0x3417, 0x341A, 0x341D, 0x3420, 0x3423, 0x3426, 0x3429, 0x342C, 0x342F, 0x3432, 0x3435, 0x3438,
+ 0x343B, 0x343E, 0x3441, 0x3444, 0x3447, 0x344A, 0x344D, 0x3450, 0x3453, 0x3456, 0x3459, 0x345C, 0x345F, 0x3462, 0x3465, 0x3468,
+ 0x346B, 0x346E, 0x3471, 0x3474, 0x3477, 0x347A, 0x347D, 0x3480, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x3483, 0x3486, 0x41A4, 0x41A9, 0x41AE, 0x41B3, 0x41B8, 0x41BD, 0x41C2, 0x3489, 0x41C7, 0x41DA, 0x41E3, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x9360, 0x9361, 0x9362, 0x9363, 0x9364, 0x9365, 0x9366, 0x9367, 0x9368, 0x9369, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x936A, 0x936B, 0x936C, 0x936D, 0x936E, 0x936F, 0x9370, 0x9371, 0x9372, 0x9373, 0x9374, 0x9375, 0x9376, 0x9377, 0x9378, 0x9379,
+ 0x937A, 0x937B, 0x937C, 0x937D, 0x937E, 0x0000, 0x0000, 0x937F, 0x9380, 0x9381, 0x9382, 0x9383, 0x9384, 0x9385, 0x9386, 0x9387,
+ 0x9388, 0x9389, 0x938A, 0x0000, 0x938B, 0x938C, 0x938D, 0x938E, 0x938F, 0x9390, 0x9391, 0x9392, 0x9393, 0x9394, 0x9395, 0x9396,
+ 0x9397, 0x9398, 0x9399, 0x939A, 0x939B, 0x939C, 0x939D, 0x0000, 0x939E, 0x939F, 0x93A0, 0x93A1, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x93A2, 0x26A0, 0x93A3, 0x0000, 0x93A4, 0x0000, 0x93A5, 0x26A2, 0x93A6, 0x26A4, 0x93A7, 0x26A6, 0x93A8, 0x26A8, 0x93A9, 0x26AA,
+ 0x93AA, 0x93AB, 0x93AC, 0x93AD, 0x93AE, 0x93AF, 0x93B0, 0x93B1, 0x93B2, 0x93B3, 0x93B4, 0x93B5, 0x93B6, 0x93B7, 0x93B8, 0x93B9,
+ 0x93BA, 0x93BB, 0x93BC, 0x93BD, 0x93BE, 0x93BF, 0x93C0, 0x93C1, 0x93C2, 0x93C3, 0x93C4, 0x93C5, 0x93C6, 0x93C7, 0x93C8, 0x93C9,
+ 0x93CA, 0x93CB, 0x93CC, 0x93CD, 0x93CE, 0x93CF, 0x93D0, 0x93D1, 0x93D2, 0x93D3, 0x93D4, 0x93D5, 0x93D6, 0x93D7, 0x93D8, 0x93D9,
+ 0x93DA, 0x93DB, 0x93DC, 0x93DD, 0x93DE, 0x93DF, 0x93E0, 0x93E1, 0x93E2, 0x93E3, 0x93E4, 0x93E5, 0x93E6, 0x93E7, 0x93E8, 0x93E9,
+ 0x93EA, 0x93EB, 0x93EC, 0x93ED, 0x93EE, 0x93EF, 0x93F0, 0x93F1, 0x93F2, 0x93F3, 0x93F4, 0x93F5, 0x93F6, 0x93F7, 0x93F8, 0x93F9,
+ 0x93FA, 0x93FB, 0x93FC, 0x93FD, 0x93FE, 0x93FF, 0x9400, 0x9401, 0x9402, 0x9403, 0x9404, 0x9405, 0x9406, 0x9407, 0x9408, 0x9409,
+ 0x940A, 0x940B, 0x940C, 0x940D, 0x940E, 0x940F, 0x9410, 0x9411, 0x9412, 0x9413, 0x9414, 0x9415, 0x9416, 0x9417, 0x9418, 0x9419,
+ 0x941A, 0x941B, 0x941C, 0x941D, 0x941E, 0x26AC, 0x26AE, 0x26B0, 0x26B2, 0x26B4, 0x26B6, 0x26B8, 0x26BA, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x941F, 0x9420, 0x9421, 0x9422, 0x9423, 0x9424, 0x9425, 0x9426, 0x9427, 0x9428, 0x9429, 0x942A, 0x942B, 0x942C, 0x942D,
+ 0x942E, 0x942F, 0x9430, 0x9431, 0x9432, 0x9433, 0x9434, 0x9435, 0x9436, 0x9437, 0x9438, 0x9439, 0x943A, 0x943B, 0x943C, 0x943D,
+ 0x943E, 0x943F, 0x9440, 0x9441, 0x9442, 0x9443, 0x9444, 0x9445, 0x9446, 0x9447, 0x9448, 0x9449, 0x944A, 0x944B, 0x944C, 0x944D,
+ 0x944E, 0x944F, 0x9450, 0x9451, 0x9452, 0x9453, 0x9454, 0x9455, 0x9456, 0x9457, 0x9458, 0x9459, 0x945A, 0x945B, 0x945C, 0x945D,
+ 0x945E, 0x945F, 0x9460, 0x9461, 0x9462, 0x9463, 0x9464, 0x9465, 0x9466, 0x9467, 0x9468, 0x9469, 0x946A, 0x946B, 0x946C, 0x946D,
+ 0x946E, 0x946F, 0x9470, 0x9471, 0x9472, 0x9473, 0x9474, 0x9475, 0x9476, 0x9477, 0x9478, 0x9479, 0x947A, 0x947B, 0x947C, 0x947D,
+ 0x947E, 0x947F, 0x9480, 0x9481, 0x9482, 0x9483, 0x9484, 0x9485, 0x9486, 0x9487, 0x9488, 0x9489, 0x948A, 0x948B, 0x948C, 0x948D,
+ 0x948E, 0x948F, 0x9490, 0x9491, 0x9492, 0x9493, 0x9494, 0x9495, 0x9496, 0x9497, 0x9498, 0x9499, 0x949A, 0x949B, 0x949C, 0x949D,
+ 0x949E, 0x949F, 0x94A0, 0x94A1, 0x94A2, 0x94A3, 0x94A4, 0x94A5, 0x94A6, 0x94A7, 0x94A8, 0x94A9, 0x94AA, 0x94AB, 0x94AC, 0x94AD,
+ 0x94AE, 0x94AF, 0x94B0, 0x94B1, 0x94B2, 0x94B3, 0x94B4, 0x94B5, 0x94B6, 0x94B7, 0x94B8, 0x94B9, 0x94BA, 0x94BB, 0x94BC, 0x94BD,
+ 0x94BE, 0x94BF, 0x94C0, 0x94C1, 0x94C2, 0x94C3, 0x94C4, 0x94C5, 0x94C6, 0x94C7, 0x94C8, 0x94C9, 0x94CA, 0x94CB, 0x94CC, 0x94CD,
+ 0x94CE, 0x94CF, 0x94D0, 0x94D1, 0x94D2, 0x94D3, 0x94D4, 0x94D5, 0x94D6, 0x94D7, 0x94D8, 0x94D9, 0x94DA, 0x94DB, 0x94DC, 0x0000,
+ 0x0000, 0x0000, 0x94DD, 0x94DE, 0x94DF, 0x94E0, 0x94E1, 0x94E2, 0x0000, 0x0000, 0x94E3, 0x94E4, 0x94E5, 0x94E6, 0x94E7, 0x94E8,
+ 0x0000, 0x0000, 0x94E9, 0x94EA, 0x94EB, 0x94EC, 0x94ED, 0x94EE, 0x0000, 0x0000, 0x94EF, 0x94F0, 0x94F1, 0x0000, 0x0000, 0x0000,
+ 0x94F2, 0x94F3, 0x94F4, 0x94F5, 0x94F6, 0x94F7, 0x94F8, 0x0000, 0x94F9, 0x94FA, 0x94FB, 0x94FC, 0x94FD, 0x94FE, 0x94FF, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
+};
+extern const FX_WCHAR g_UnicodeData_Normalization_Map1[5376] = {
+ 0x0066, 0x0053, 0x0053, 0x0059, 0x0020, 0x0308, 0x0061, 0x0052, 0x0304, 0x0032, 0x0033, 0x0301, 0x03BC, 0x0327, 0x0031, 0x006F,
+ 0x0041, 0x0041, 0x0041, 0x0041, 0x0041, 0x0041, 0x0043, 0x0045, 0x0045, 0x0045, 0x0045, 0x0049, 0x0049, 0x0049, 0x0049, 0x0044,
+ 0x004E, 0x004F, 0x004F, 0x004F, 0x004F, 0x004F, 0x004F, 0x0055, 0x0055, 0x0055, 0x0055, 0x0059, 0x0061, 0x0061, 0x0061, 0x0061,
+ 0x0061, 0x0061, 0x0063, 0x0065, 0x0065, 0x0065, 0x0065, 0x0069, 0x0069, 0x0069, 0x0069, 0x006E, 0x006F, 0x006F, 0x006F, 0x006F,
+ 0x006F, 0x006F, 0x0075, 0x0075, 0x0075, 0x0075, 0x0079, 0x0079, 0x0041, 0x0061, 0x0041, 0x0061, 0x0041, 0x0061, 0x0043, 0x0063,
+ 0x0043, 0x0063, 0x0043, 0x0063, 0x0043, 0x0063, 0x0044, 0x0064, 0x0044, 0x0064, 0x0045, 0x0065, 0x0045, 0x0065, 0x0045, 0x0065,
+ 0x0045, 0x0065, 0x0045, 0x0065, 0x0047, 0x0067, 0x0047, 0x0067, 0x0047, 0x0067, 0x0047, 0x0067, 0x0048, 0x0068, 0x0048, 0x0068,
+ 0x0049, 0x0069, 0x0049, 0x0069, 0x0049, 0x0069, 0x0049, 0x0069, 0x0049, 0x004A, 0x006A, 0x004B, 0x006B, 0x004B, 0x004C, 0x006C,
+ 0x004C, 0x006C, 0x004C, 0x006C, 0x004C, 0x006C, 0x004C, 0x006C, 0x004E, 0x006E, 0x004E, 0x006E, 0x004E, 0x006E, 0x006E, 0x004F,
+ 0x006F, 0x004F, 0x006F, 0x004F, 0x006F, 0x0052, 0x0072, 0x0052, 0x0072, 0x0052, 0x0072, 0x0053, 0x0073, 0x0053, 0x0073, 0x0053,
+ 0x0073, 0x0053, 0x0073, 0x0054, 0x0074, 0x0054, 0x0074, 0x0054, 0x0074, 0x0055, 0x0075, 0x0055, 0x0075, 0x0055, 0x0075, 0x0055,
+ 0x0075, 0x0055, 0x0075, 0x0055, 0x0075, 0x0057, 0x0077, 0x0059, 0x0079, 0x0059, 0x005A, 0x007A, 0x005A, 0x007A, 0x005A, 0x007A,
+ 0x0073, 0x0062, 0x0042, 0x0042, 0x0062, 0x0043, 0x0063, 0x0044, 0x0044, 0x0044, 0x0064, 0x0045, 0x0045, 0x0046, 0x0066, 0x0047,
+ 0x0049, 0x004B, 0x006B, 0x006C, 0x004D, 0x004E, 0x006E, 0x004F, 0x004F, 0x006F, 0x0050, 0x0070, 0x0283, 0x0074, 0x0054, 0x0074,
+ 0x0054, 0x0055, 0x0075, 0x0056, 0x0059, 0x0079, 0x005A, 0x007A, 0x01B7, 0x0041, 0x0061, 0x0049, 0x0069, 0x004F, 0x006F, 0x0055,
+ 0x0075, 0x00DC, 0x00FC, 0x00DC, 0x00FC, 0x00DC, 0x00FC, 0x00DC, 0x00FC, 0x0065, 0x0041, 0x0061, 0x0041, 0x0061, 0x00C6, 0x00E6,
+ 0x0047, 0x0067, 0x0047, 0x0067, 0x004B, 0x006B, 0x004F, 0x006F, 0x01EA, 0x01EB, 0x01B7, 0x0292, 0x006A, 0x0047, 0x0067, 0x004E,
+ 0x006E, 0x0041, 0x0061, 0x00C6, 0x00E6, 0x00D8, 0x00F8, 0x0041, 0x0061, 0x0041, 0x0061, 0x0045, 0x0065, 0x0045, 0x0065, 0x0049,
+ 0x0069, 0x0049, 0x0069, 0x004F, 0x006F, 0x004F, 0x006F, 0x0052, 0x0072, 0x0052, 0x0072, 0x0055, 0x0075, 0x0055, 0x0075, 0x0053,
+ 0x0073, 0x0054, 0x0074, 0x0048, 0x0068, 0x004E, 0x0064, 0x005A, 0x007A, 0x0041, 0x0061, 0x0045, 0x0065, 0x00D6, 0x00F6, 0x00D5,
+ 0x00F5, 0x004F, 0x006F, 0x022E, 0x022F, 0x0059, 0x0079, 0x006C, 0x006E, 0x0074, 0x006A, 0x0041, 0x0043, 0x0063, 0x004C, 0x0054,
+ 0x0053, 0x005A, 0x0042, 0x0055, 0x0056, 0x0045, 0x0065, 0x004A, 0x006A, 0x0051, 0x0071, 0x0052, 0x0072, 0x0059, 0x0079, 0x0061,
+ 0x0251, 0x0062, 0x006F, 0x0063, 0x0064, 0x0064, 0x0065, 0x0259, 0x0065, 0x0065, 0x0065, 0x0065, 0x006A, 0x0067, 0x0067, 0x0047,
+ 0x0068, 0x0068, 0x0069, 0x0049, 0x006C, 0x006C, 0x006C, 0x006D, 0x006D, 0x006D, 0x006E, 0x006E, 0x006E, 0x006F, 0x0072, 0x0072,
+ 0x0072, 0x0072, 0x0072, 0x0072, 0x0072, 0x0052, 0x0052, 0x0073, 0x006A, 0x0283, 0x0283, 0x0074, 0x0074, 0x0055, 0x0076, 0x0076,
+ 0x0077, 0x0079, 0x0059, 0x007A, 0x007A, 0x0292, 0x0043, 0x0042, 0x0065, 0x0047, 0x0048, 0x006A, 0x006B, 0x004C, 0x0071, 0x0068,
+ 0x0068, 0x0068, 0x0068, 0x006A, 0x0072, 0x0279, 0x027B, 0x0281, 0x0077, 0x0079, 0x0263, 0x006C, 0x0073, 0x0078, 0x0295, 0x0300,
+ 0x0301, 0x0313, 0x0308, 0x0061, 0x0065, 0x0069, 0x006F, 0x0075, 0x0063, 0x0064, 0x0068, 0x006D, 0x0072, 0x0074, 0x0076, 0x0078,
+ 0x02B9, 0x003B, 0x0020, 0x00A8, 0x0391, 0x00B7, 0x0395, 0x0397, 0x0399, 0x039F, 0x03A5, 0x03A9, 0x03CA, 0x0399, 0x03A5, 0x03B1,
+ 0x03B5, 0x03B7, 0x03B9, 0x03CB, 0x03B9, 0x03C5, 0x03BF, 0x03C5, 0x03C9, 0x03B2, 0x03B8, 0x03A5, 0x03D2, 0x03D2, 0x03C6, 0x03C0,
+ 0x03BA, 0x03C1, 0x03C2, 0x0398, 0x03B5, 0x03A3, 0x0415, 0x0415, 0x0413, 0x0406, 0x041A, 0x0418, 0x0423, 0x0418, 0x0438, 0x0435,
+ 0x0435, 0x0433, 0x0456, 0x043A, 0x0438, 0x0443, 0x0466, 0x0467, 0x046A, 0x046B, 0x0474, 0x0475, 0x0460, 0x0461, 0x0419, 0x0439,
+ 0x0420, 0x0440, 0x0413, 0x0433, 0x0413, 0x0433, 0x0413, 0x0433, 0x0416, 0x0436, 0x0417, 0x0437, 0x041A, 0x043A, 0x041A, 0x043A,
+ 0x041A, 0x043A, 0x041A, 0x043A, 0x041D, 0x043D, 0x041F, 0x043F, 0x0421, 0x0441, 0x0422, 0x0442, 0x04AE, 0x04AF, 0x0425, 0x0445,
+ 0x0427, 0x0447, 0x0427, 0x0447, 0x0416, 0x0436, 0x04BC, 0x04BD, 0x0416, 0x0436, 0x041A, 0x043A, 0x041B, 0x043B, 0x041D, 0x043D,
+ 0x041D, 0x043D, 0x041C, 0x043C, 0x0410, 0x0430, 0x0410, 0x0430, 0x0415, 0x0435, 0x04D8, 0x04D9, 0x0416, 0x0436, 0x0417, 0x0437,
+ 0x0418, 0x0438, 0x0418, 0x0438, 0x041E, 0x043E, 0x04E8, 0x04E9, 0x042D, 0x044D, 0x0423, 0x0443, 0x0423, 0x0443, 0x0423, 0x0443,
+ 0x0427, 0x0447, 0x0413, 0x0433, 0x042B, 0x044B, 0x0413, 0x0433, 0x0425, 0x0445, 0x0425, 0x0445, 0x0417, 0x0437, 0x041B, 0x043B,
+ 0x0F0B, 0x10DC, 0x0041, 0x00C6, 0x0042, 0x0042, 0x0044, 0x0045, 0x018E, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D,
+ 0x004E, 0x004F, 0x0222, 0x0050, 0x0052, 0x0054, 0x0055, 0x0057, 0x0061, 0x0250, 0x0251, 0x1D02, 0x0062, 0x0064, 0x0065, 0x0259,
+ 0x025B, 0x025C, 0x0067, 0x006B, 0x006D, 0x014B, 0x006F, 0x0254, 0x1D16, 0x1D17, 0x0070, 0x0074, 0x0075, 0x1D1D, 0x026F, 0x0076,
+ 0x1D25, 0x03B2, 0x03B3, 0x03B4, 0x03C6, 0x03C7, 0x0069, 0x0072, 0x0075, 0x0076, 0x03B2, 0x03B3, 0x03C1, 0x03C6, 0x03C7, 0x0062,
+ 0x0064, 0x0066, 0x006D, 0x006E, 0x0070, 0x0072, 0x0072, 0x0073, 0x0074, 0x007A, 0x0067, 0x043D, 0x004C, 0x0070, 0x0055, 0x028A,
+ 0x0062, 0x0064, 0x0066, 0x0067, 0x006B, 0x006C, 0x006D, 0x006E, 0x0070, 0x0072, 0x0073, 0x0283, 0x0076, 0x0078, 0x007A, 0x0061,
+ 0x0251, 0x0064, 0x0065, 0x0065, 0x0065, 0x0065, 0x0069, 0x0283, 0x0252, 0x0063, 0x0255, 0x00F0, 0x025C, 0x0066, 0x025F, 0x0261,
+ 0x0265, 0x0268, 0x0269, 0x026A, 0x1D7B, 0x029D, 0x026D, 0x1D85, 0x029F, 0x0271, 0x0270, 0x0272, 0x0273, 0x0274, 0x0275, 0x0278,
+ 0x0282, 0x0283, 0x01AB, 0x0289, 0x028A, 0x1D1C, 0x028B, 0x028C, 0x007A, 0x0290, 0x0291, 0x0292, 0x03B8, 0x0041, 0x0061, 0x0042,
+ 0x0062, 0x0042, 0x0062, 0x0042, 0x0062, 0x0043, 0x0063, 0x0044, 0x0064, 0x0044, 0x0064, 0x0044, 0x0064, 0x0044, 0x0064, 0x0044,
+ 0x0064, 0x0045, 0x0065, 0x0045, 0x0065, 0x0045, 0x0065, 0x0045, 0x0065, 0x0228, 0x0229, 0x0046, 0x0066, 0x0047, 0x0067, 0x0048,
+ 0x0068, 0x0048, 0x0068, 0x0048, 0x0068, 0x0048, 0x0068, 0x0048, 0x0068, 0x0049, 0x0069, 0x00CF, 0x00EF, 0x004B, 0x006B, 0x004B,
+ 0x006B, 0x004B, 0x006B, 0x004C, 0x006C, 0x004C, 0x006C, 0x004C, 0x006C, 0x004C, 0x006C, 0x004D, 0x006D, 0x004D, 0x006D, 0x004D,
+ 0x006D, 0x004E, 0x006E, 0x004E, 0x006E, 0x004E, 0x006E, 0x004E, 0x006E, 0x00D5, 0x00F5, 0x00D5, 0x00F5, 0x014C, 0x014D, 0x014C,
+ 0x014D, 0x0050, 0x0070, 0x0050, 0x0070, 0x0052, 0x0072, 0x0052, 0x0072, 0x0052, 0x0072, 0x0052, 0x0072, 0x0053, 0x0073, 0x0053,
+ 0x0073, 0x0053, 0x0073, 0x0053, 0x0073, 0x0053, 0x0073, 0x0054, 0x0074, 0x0054, 0x0074, 0x0054, 0x0074, 0x0054, 0x0074, 0x0055,
+ 0x0075, 0x0055, 0x0075, 0x0055, 0x0075, 0x0168, 0x0169, 0x016A, 0x016B, 0x0056, 0x0076, 0x0056, 0x0076, 0x0057, 0x0077, 0x0057,
+ 0x0077, 0x0057, 0x0077, 0x0057, 0x0077, 0x0057, 0x0077, 0x0058, 0x0078, 0x0058, 0x0078, 0x0059, 0x0079, 0x005A, 0x007A, 0x005A,
+ 0x007A, 0x005A, 0x007A, 0x0068, 0x0074, 0x0077, 0x0079, 0x0061, 0x017F, 0x0041, 0x0061, 0x0041, 0x0061, 0x0041, 0x0061, 0x0041,
+ 0x0061, 0x0041, 0x0061, 0x0041, 0x0061, 0x0041, 0x0061, 0x0041, 0x0061, 0x0041, 0x0061, 0x0041, 0x0061, 0x0041, 0x0061, 0x0041,
+ 0x0061, 0x0045, 0x0065, 0x0045, 0x0065, 0x0045, 0x0065, 0x0045, 0x0065, 0x0045, 0x0065, 0x0045, 0x0065, 0x0045, 0x0065, 0x0045,
+ 0x0065, 0x0049, 0x0069, 0x0049, 0x0069, 0x004F, 0x006F, 0x004F, 0x006F, 0x004F, 0x006F, 0x004F, 0x006F, 0x004F, 0x006F, 0x004F,
+ 0x006F, 0x004F, 0x006F, 0x004F, 0x006F, 0x004F, 0x006F, 0x004F, 0x006F, 0x004F, 0x006F, 0x004F, 0x006F, 0x0055, 0x0075, 0x0055,
+ 0x0075, 0x0055, 0x0075, 0x0055, 0x0075, 0x0055, 0x0075, 0x0055, 0x0075, 0x0055, 0x0075, 0x0059, 0x0079, 0x0059, 0x0079, 0x0059,
+ 0x0079, 0x0059, 0x0079, 0x03B1, 0x03B1, 0x03B1, 0x03B1, 0x03B1, 0x03B1, 0x03B1, 0x03B1, 0x0391, 0x0391, 0x0391, 0x0391, 0x0391,
+ 0x0391, 0x0391, 0x0391, 0x03B5, 0x03B5, 0x03B5, 0x03B5, 0x03B5, 0x03B5, 0x0395, 0x0395, 0x0395, 0x0395, 0x0395, 0x0395, 0x03B7,
+ 0x03B7, 0x03B7, 0x03B7, 0x03B7, 0x03B7, 0x03B7, 0x03B7, 0x0397, 0x0397, 0x0397, 0x0397, 0x0397, 0x0397, 0x0397, 0x0397, 0x03B9,
+ 0x03B9, 0x03B9, 0x03B9, 0x03B9, 0x03B9, 0x03B9, 0x03B9, 0x0399, 0x0399, 0x0399, 0x0399, 0x0399, 0x0399, 0x0399, 0x0399, 0x03BF,
+ 0x03BF, 0x03BF, 0x03BF, 0x03BF, 0x03BF, 0x039F, 0x039F, 0x039F, 0x039F, 0x039F, 0x039F, 0x03C5, 0x03C5, 0x03C5, 0x03C5, 0x03C5,
+ 0x03C5, 0x03C5, 0x03C5, 0x03A5, 0x03A5, 0x03A5, 0x03A5, 0x03C9, 0x03C9, 0x03C9, 0x03C9, 0x03C9, 0x03C9, 0x03C9, 0x03C9, 0x03A9,
+ 0x03A9, 0x03A9, 0x03A9, 0x03A9, 0x03A9, 0x03A9, 0x03A9, 0x03B1, 0x03B1, 0x03B5, 0x03B5, 0x03B7, 0x03B7, 0x03B9, 0x03B9, 0x03BF,
+ 0x03BF, 0x03C5, 0x03C5, 0x03C9, 0x03C9, 0x03B1, 0x03B1, 0x03B1, 0x03B1, 0x03B1, 0x03B1, 0x03B1, 0x03B1, 0x0391, 0x0391, 0x0391,
+ 0x0391, 0x0391, 0x0391, 0x0391, 0x0391, 0x03B7, 0x03B7, 0x03B7, 0x03B7, 0x03B7, 0x03B7, 0x03B7, 0x03B7, 0x0397, 0x0397, 0x0397,
+ 0x0397, 0x0397, 0x0397, 0x0397, 0x0397, 0x03C9, 0x03C9, 0x03C9, 0x03C9, 0x03C9, 0x03C9, 0x03C9, 0x03C9, 0x03A9, 0x03A9, 0x03A9,
+ 0x03A9, 0x03A9, 0x03A9, 0x03A9, 0x03A9, 0x03B1, 0x03B1, 0x03B1, 0x03B1, 0x03B1, 0x03B1, 0x03B1, 0x0391, 0x0391, 0x0391, 0x0391,
+ 0x0391, 0x03B7, 0x03B7, 0x03B7, 0x03B7, 0x03B7, 0x0395, 0x0395, 0x0397, 0x0397, 0x0397, 0x03B9, 0x03B9, 0x03B9, 0x03B9, 0x03B9,
+ 0x03B9, 0x0399, 0x0399, 0x0399, 0x0399, 0x03C5, 0x03C5, 0x03C5, 0x03C5, 0x03C1, 0x03C1, 0x03C5, 0x03C5, 0x03A5, 0x03A5, 0x03A5,
+ 0x03A5, 0x03A1, 0x03C9, 0x03C9, 0x03C9, 0x03C9, 0x03C9, 0x039F, 0x039F, 0x03A9, 0x03A9, 0x03A9, 0x00B4, 0x0314, 0x0020, 0x0020,
+ 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x2010, 0x0333, 0x002E, 0x0020, 0x0020, 0x0030, 0x0069,
+ 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x002B, 0x2212, 0x003D, 0x0028, 0x0029, 0x006E, 0x0030, 0x0031, 0x0032, 0x0033,
+ 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x002B, 0x2212, 0x003D, 0x0028, 0x0029, 0x0061, 0x0065, 0x006F, 0x0078, 0x0259,
+ 0x0043, 0x0190, 0x0067, 0x0048, 0x0048, 0x0048, 0x0068, 0x0068, 0x0049, 0x0049, 0x004C, 0x006C, 0x004E, 0x0050, 0x0051, 0x0052,
+ 0x0052, 0x0052, 0x0052, 0x0052, 0x0056, 0x005A, 0x03A9, 0x01B1, 0x005A, 0x004B, 0x00C5, 0x0042, 0x0043, 0x0065, 0x0065, 0x0045,
+ 0x0046, 0x004D, 0x006F, 0x05D0, 0x05D1, 0x05D2, 0x05D3, 0x0069, 0x03C0, 0x03B3, 0x0393, 0x03A0, 0x2211, 0x0044, 0x0064, 0x0065,
+ 0x0069, 0x006A, 0x0049, 0x0056, 0x0058, 0x004C, 0x0043, 0x0044, 0x004D, 0x0069, 0x0076, 0x0078, 0x006C, 0x0063, 0x0064, 0x006D,
+ 0x2203, 0x2208, 0x220B, 0x3008, 0x3009, 0x0062, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x0041,
+ 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051,
+ 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067,
+ 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077,
+ 0x0078, 0x0079, 0x007A, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x0030, 0x0031, 0x0032,
+ 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039,
+ 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x004C, 0x006C, 0x004C, 0x0050, 0x0052, 0x0061, 0x0074,
+ 0x0048, 0x0068, 0x004B, 0x006B, 0x005A, 0x007A, 0x0076, 0x0057, 0x0058, 0x0076, 0x006A, 0x0056, 0x2D61, 0x6BCD, 0x6C11, 0x864E,
+ 0x897F, 0x89D2, 0x957F, 0x9752, 0x98DF, 0x9AA8, 0x9B3C, 0x9EA6, 0x9EC4, 0x9F9F, 0x4E00, 0x4E28, 0x4E36, 0x4E3F, 0x4E59, 0x4E85,
+ 0x4E8C, 0x4EA0, 0x4EBA, 0x513F, 0x5165, 0x516B, 0x5182, 0x5196, 0x51AB, 0x51E0, 0x51F5, 0x5200, 0x529B, 0x52F9, 0x5315, 0x531A,
+ 0x5338, 0x5341, 0x535C, 0x5369, 0x5382, 0x53B6, 0x53C8, 0x53E3, 0x56D7, 0x571F, 0x58EB, 0x5902, 0x590A, 0x5915, 0x5927, 0x5973,
+ 0x5B50, 0x5B80, 0x5BF8, 0x5C0F, 0x5C22, 0x5C38, 0x5C6E, 0x5C71, 0x5DDB, 0x5DE5, 0x5DF1, 0x5DFE, 0x5E72, 0x5E7A, 0x5E7F, 0x5EF4,
+ 0x5EFE, 0x5F0B, 0x5F13, 0x5F50, 0x5F61, 0x5F73, 0x5FC3, 0x6208, 0x6236, 0x624B, 0x652F, 0x6534, 0x6587, 0x6597, 0x65A4, 0x65B9,
+ 0x65E0, 0x65E5, 0x66F0, 0x6708, 0x6728, 0x6B20, 0x6B62, 0x6B79, 0x6BB3, 0x6BCB, 0x6BD4, 0x6BDB, 0x6C0F, 0x6C14, 0x6C34, 0x706B,
+ 0x722A, 0x7236, 0x723B, 0x723F, 0x7247, 0x7259, 0x725B, 0x72AC, 0x7384, 0x7389, 0x74DC, 0x74E6, 0x7518, 0x751F, 0x7528, 0x7530,
+ 0x758B, 0x7592, 0x7676, 0x767D, 0x76AE, 0x76BF, 0x76EE, 0x77DB, 0x77E2, 0x77F3, 0x793A, 0x79B8, 0x79BE, 0x7A74, 0x7ACB, 0x7AF9,
+ 0x7C73, 0x7CF8, 0x7F36, 0x7F51, 0x7F8A, 0x7FBD, 0x8001, 0x800C, 0x8012, 0x8033, 0x807F, 0x8089, 0x81E3, 0x81EA, 0x81F3, 0x81FC,
+ 0x820C, 0x821B, 0x821F, 0x826E, 0x8272, 0x8278, 0x864D, 0x866B, 0x8840, 0x884C, 0x8863, 0x897E, 0x898B, 0x89D2, 0x8A00, 0x8C37,
+ 0x8C46, 0x8C55, 0x8C78, 0x8C9D, 0x8D64, 0x8D70, 0x8DB3, 0x8EAB, 0x8ECA, 0x8F9B, 0x8FB0, 0x8FB5, 0x9091, 0x9149, 0x91C6, 0x91CC,
+ 0x91D1, 0x9577, 0x9580, 0x961C, 0x96B6, 0x96B9, 0x96E8, 0x9751, 0x975E, 0x9762, 0x9769, 0x97CB, 0x97ED, 0x97F3, 0x9801, 0x98A8,
+ 0x98DB, 0x98DF, 0x9996, 0x9999, 0x99AC, 0x9AA8, 0x9AD8, 0x9ADF, 0x9B25, 0x9B2F, 0x9B32, 0x9B3C, 0x9B5A, 0x9CE5, 0x9E75, 0x9E7F,
+ 0x9EA5, 0x9EBB, 0x9EC3, 0x9ECD, 0x9ED1, 0x9EF9, 0x9EFD, 0x9F0E, 0x9F13, 0x9F20, 0x9F3B, 0x9F4A, 0x9F52, 0x9F8D, 0x9F9C, 0x9FA0,
+ 0x0020, 0x3012, 0x5341, 0x5344, 0x5345, 0x1100, 0x1101, 0x11AA, 0x1102, 0x11AC, 0x11AD, 0x1103, 0x1104, 0x1105, 0x11B0, 0x11B1,
+ 0x11B2, 0x11B3, 0x11B4, 0x11B5, 0x111A, 0x1106, 0x1107, 0x1108, 0x1121, 0x1109, 0x110A, 0x110B, 0x110C, 0x110D, 0x110E, 0x110F,
+ 0x1110, 0x1111, 0x1112, 0x1161, 0x1162, 0x1163, 0x1164, 0x1165, 0x1166, 0x1167, 0x1168, 0x1169, 0x116A, 0x116B, 0x116C, 0x116D,
+ 0x116E, 0x116F, 0x1170, 0x1171, 0x1172, 0x1173, 0x1174, 0x1175, 0x1160, 0x1114, 0x1115, 0x11C7, 0x11C8, 0x11CC, 0x11CE, 0x11D3,
+ 0x11D7, 0x11D9, 0x111C, 0x11DD, 0x11DF, 0x111D, 0x111E, 0x1120, 0x1122, 0x1123, 0x1127, 0x1129, 0x112B, 0x112C, 0x112D, 0x112E,
+ 0x112F, 0x1132, 0x1136, 0x1140, 0x1147, 0x114C, 0x11F1, 0x11F2, 0x1157, 0x1158, 0x1159, 0x1184, 0x1185, 0x1188, 0x1191, 0x1192,
+ 0x1194, 0x119E, 0x11A1, 0x4E00, 0x4E8C, 0x4E09, 0x56DB, 0x4E0A, 0x4E2D, 0x4E0B, 0x7532, 0x4E59, 0x4E19, 0x4E01, 0x5929, 0x5730,
+ 0x4EBA, 0x554F, 0x5E7C, 0x6587, 0x7B8F, 0x1100, 0x1102, 0x1103, 0x1105, 0x1106, 0x1107, 0x1109, 0x110B, 0x110C, 0x110E, 0x110F,
+ 0x1110, 0x1111, 0x1112, 0x4E00, 0x4E8C, 0x4E09, 0x56DB, 0x4E94, 0x516D, 0x4E03, 0x516B, 0x4E5D, 0x5341, 0x6708, 0x706B, 0x6C34,
+ 0x6728, 0x91D1, 0x571F, 0x65E5, 0x682A, 0x6709, 0x793E, 0x540D, 0x7279, 0x8CA1, 0x795D, 0x52B4, 0x79D8, 0x7537, 0x5973, 0x9069,
+ 0x512A, 0x5370, 0x6CE8, 0x9805, 0x4F11, 0x5199, 0x6B63, 0x4E0A, 0x4E2D, 0x4E0B, 0x5DE6, 0x53F3, 0x533B, 0x5B97, 0x5B66, 0x76E3,
+ 0x4F01, 0x8CC7, 0x5354, 0x591C, 0x30A2, 0x30A4, 0x30A6, 0x30A8, 0x30AA, 0x30AB, 0x30AD, 0x30AF, 0x30B1, 0x30B3, 0x30B5, 0x30B7,
+ 0x30B9, 0x30BB, 0x30BD, 0x30BF, 0x30C1, 0x30C4, 0x30C6, 0x30C8, 0x30CA, 0x30CB, 0x30CC, 0x30CD, 0x30CE, 0x30CF, 0x30D2, 0x30D5,
+ 0x30D8, 0x30DB, 0x30DE, 0x30DF, 0x30E0, 0x30E1, 0x30E2, 0x30E4, 0x30E6, 0x30E8, 0x30E9, 0x30EA, 0x30EB, 0x30EC, 0x30ED, 0x30EF,
+ 0x30F0, 0x30F1, 0x30F2, 0x4E22, 0x5E76, 0x5E7A, 0x5E72, 0x4E71, 0x4E98, 0x4E9A, 0x4F2B, 0x5E03, 0x5360, 0x6765, 0x4FA3, 0x4FE3,
+ 0x7CFB, 0x4FA0, 0x4F25, 0x4FE9, 0x4ED3, 0x4E2A, 0x4EEC, 0x4F26, 0x4F1F, 0x4FA7, 0x4FA6, 0x4F2A, 0x6770, 0x4F27, 0x4F1E, 0x5907,
+ 0x5BB6, 0x4F63, 0x506C, 0x4F20, 0x4F1B, 0x503A, 0x4F24, 0x503E, 0x507B, 0x4EC5, 0x4F65, 0x4FA8, 0x4EC6, 0x4FA5, 0x507E, 0x96C7,
+ 0x4EF7, 0x4EEA, 0x4FAC, 0x4EBF, 0x4FED, 0x50A7, 0x4FE6, 0x4FAA, 0x5C3D, 0x507F, 0x4F18, 0x50A8, 0x4FEA, 0x50A9, 0x50A5, 0x4FE8,
+ 0x51F6, 0x5151, 0x513F, 0x5156, 0x5185, 0x4E24, 0x518C, 0x80C4, 0x5199, 0x5E42, 0x51BB, 0x51DB, 0x51EF, 0x522B, 0x5220, 0x522D,
+ 0x5219, 0x5239, 0x521A, 0x5265, 0x5250, 0x5240, 0x521B, 0x522C, 0x5212, 0x5267, 0x5218, 0x523D, 0x523F, 0x5251, 0x5242, 0x52B2,
+ 0x52A8, 0x52D6, 0x52A1, 0x80DC, 0x52B3, 0x52BF, 0x52A2, 0x52CB, 0x52B1, 0x529D, 0x5300, 0x5326, 0x6C47, 0x532E, 0x533A, 0x534F,
+ 0x6064, 0x5374, 0x538D, 0x538C, 0x5389, 0x53A3, 0x53C2, 0x4E1B, 0x54A4, 0x5434, 0x5450, 0x5415, 0x5458, 0x55B1, 0x5457, 0x5FF5,
+ 0x95EE, 0x54D1, 0x542F, 0x5524, 0x4E27, 0x4E54, 0x5355, 0x54DF, 0x545B, 0x556C, 0x551D, 0x5417, 0x545C, 0x5522, 0x54D4, 0x53F9,
+ 0x55BD, 0x5455, 0x5567, 0x5C1D, 0x551B, 0x54D7, 0x5520, 0x5578, 0x53FD, 0x54D3, 0x5452, 0x5574, 0x6076, 0x5618, 0x549D, 0x54D2,
+ 0x54DD, 0x54D5, 0x55F3, 0x54D9, 0x55B7, 0x5428, 0x549B, 0x5413, 0x54DC, 0x5C1D, 0x565C, 0x556E, 0x5456, 0x5499, 0x4EB8, 0x55BE,
+ 0x4E25, 0x5624, 0x556D, 0x55EB, 0x56A3, 0x5181, 0x5453, 0x5570, 0x5631, 0x56F1, 0x56F5, 0x56FD, 0x56F4, 0x56ED, 0x5706, 0x56FE,
+ 0x56E2, 0x57AD, 0x6267, 0x575A, 0x57A9, 0x57DA, 0x5C27, 0x62A5, 0x573A, 0x5757, 0x8314, 0x57B2, 0x57D8, 0x6D82, 0x51A2, 0x575E,
+ 0x57D9, 0x5C18, 0x5811, 0x57AB, 0x5760, 0x5815, 0x575F, 0x57A6, 0x575B, 0x538B, 0x5792, 0x5739, 0x5786, 0x574F, 0x5785, 0x575C,
+ 0x575D, 0x58EE, 0x58F6, 0x58F8, 0x5BFF, 0x591F, 0x68A6, 0x4F19, 0x5939, 0x5942, 0x5965, 0x5941, 0x593A, 0x594B, 0x59F9, 0x5986,
+ 0x59D7, 0x5978, 0x5A31, 0x5A04, 0x5987, 0x5A05, 0x5A32, 0x59AB, 0x5AAA, 0x5988, 0x59AA, 0x59A9, 0x5A34, 0x5A73, 0x5A06, 0x5A75,
+ 0x5A07, 0x5AF1, 0x5AD2, 0x5B37, 0x5AD4, 0x5A74, 0x5A76, 0x5A08, 0x5B59, 0x5B66, 0x5B6A, 0x5BAB, 0x5BDD, 0x5B9E, 0x5B81, 0x5BA1,
+ 0x5199, 0x5BBD, 0x5BA0, 0x5B9D, 0x5C06, 0x4E13, 0x5BFB, 0x5BF9, 0x5BFC, 0x5C34, 0x5C4A, 0x5C38, 0x5C49, 0x5C61, 0x5C42, 0x5C5F,
+ 0x5C66, 0x5C5E, 0x5188, 0x5C98, 0x5C9B, 0x5CE1, 0x5D03, 0x5C97, 0x4ED1, 0x5CE5, 0x5C9A, 0x5D5D, 0x5D2D, 0x5C96, 0x5D5A, 0x5D02,
+ 0x5CE4, 0x5CE3, 0x5CC4, 0x5D04, 0x5C99, 0x5D58, 0x5CAD, 0x5C7F, 0x5CB3, 0x5CBF, 0x5CE6, 0x5DC5, 0x5DEF, 0x5E05, 0x5E08, 0x5E10,
+ 0x5E26, 0x5E27, 0x5E0F, 0x5E3C, 0x5E3B, 0x5E1C, 0x5E01, 0x5E2E, 0x5E31, 0x5E72, 0x51E0, 0x5E93, 0x5395, 0x53A2, 0x53A6, 0x53A8,
+ 0x53AE, 0x5E99, 0x5382, 0x5E91, 0x5E9F, 0x5E7F, 0x5EEA, 0x5E90, 0x5385, 0x5F11, 0x5F2A, 0x5F20, 0x5F3A, 0x5F39, 0x5F25, 0x5F2F,
+ 0x5F66, 0x540E, 0x5F84, 0x4ECE, 0x5F95, 0x590D, 0x5F81, 0x5F7B, 0x6052, 0x803B, 0x60A6, 0x6005, 0x95F7, 0x6076, 0x607C, 0x607D,
+ 0x607B, 0x7231, 0x60EC, 0x60AB, 0x6006, 0x607A, 0x5FFE, 0x6001, 0x6120, 0x60E8, 0x60ED, 0x6078, 0x60EF, 0x6004, 0x6002, 0x8651,
+ 0x60AD, 0x5E86, 0x5FE7, 0x60EB, 0x601C, 0x51ED, 0x6126, 0x616D, 0x60EE, 0x6124, 0x60AF, 0x6003, 0x5BAA, 0x5FC6, 0x6073, 0x5E94,
+ 0x603F, 0x61D4, 0x603C, 0x61D1, 0x6079, 0x60E9, 0x61D2, 0x6000, 0x60AC, 0x5FCF, 0x60E7, 0x6151, 0x604B, 0x6206, 0x620B, 0x6217,
+ 0x622C, 0x6218, 0x620F, 0x6237, 0x629B, 0x631F, 0x820D, 0x626A, 0x5377, 0x626B, 0x62A1, 0x6323, 0x6302, 0x91C7, 0x62E3, 0x626C,
+ 0x6362, 0x6325, 0x635F, 0x6447, 0x6363, 0x62A2, 0x63B4, 0x63BC, 0x6402, 0x631A, 0x62A0, 0x629F, 0x63BA, 0x635E, 0x6491, 0x6320,
+ 0x6322, 0x63B8, 0x62E8, 0x629A, 0x6251, 0x63FF, 0x631E, 0x631D, 0x6361, 0x62E5, 0x63B3, 0x62E9, 0x51FB, 0x6321, 0x62C5, 0x636E,
+ 0x6324, 0x62DF, 0x6448, 0x62E7, 0x6401, 0x63B7, 0x6269, 0x64B7, 0x6446, 0x64DE, 0x64B8, 0x6270, 0x6445, 0x64B5, 0x62E2, 0x62E6,
+ 0x6484, 0x6400, 0x64BA, 0x643A, 0x6444, 0x6512, 0x631B, 0x644A, 0x6405, 0x63FD, 0x668B, 0x8D25, 0x53D9, 0x654C, 0x6570, 0x655B,
+ 0x6BD9, 0x6593, 0x65A9, 0x65AD, 0x4E8E, 0x5347, 0x65F6, 0x664B, 0x663C, 0x6655, 0x6656, 0x65F8, 0x7545, 0x6682, 0x6635, 0x6654,
+ 0x5386, 0x6619, 0x6653, 0x66A7, 0x65F7, 0x663D, 0x6652, 0x4E66, 0x4F1A, 0x80E7, 0x4E1C, 0x6805, 0x6746, 0x6800, 0x67A7, 0x6761,
+ 0x67AD, 0x5F03, 0x67A8, 0x67A3, 0x680B, 0x6808, 0x6816, 0x6860, 0x6768, 0x67AB, 0x6862, 0x4E1A, 0x6781, 0x6769, 0x8363, 0x6864,
+ 0x6784, 0x67AA, 0x6760, 0x68BF, 0x6920, 0x6901, 0x6868, 0x6869, 0x4E50, 0x679E, 0x697C, 0x6807, 0x67A2, 0x6837, 0x6734, 0x6811,
+ 0x6866, 0x6861, 0x6865, 0x673A, 0x692D, 0x6A2A, 0x6AA9, 0x69DC, 0x67FD, 0x6863, 0x6867, 0x69DA, 0x68C0, 0x6A2F, 0x68BC, 0x53F0,
+ 0x69DF, 0x67E0, 0x69DB, 0x82D8, 0x67DC, 0x6A79, 0x6988, 0x6809, 0x691F, 0x6A7C, 0x680E, 0x6A71, 0x69E0, 0x680C, 0x67A5, 0x6A65,
+ 0x6987, 0x680A, 0x6989, 0x68C2, 0x6A31, 0x680F, 0x6743, 0x6924, 0x683E, 0x6984, 0x94A6, 0x6B27, 0x6B24, 0x6B22, 0x5C81, 0x5386,
+ 0x5F52, 0x6B81, 0x6B8B, 0x6B92, 0x6B87, 0x6B9A, 0x6B93, 0x6BA1, 0x6B7C, 0x6740, 0x58F3, 0x6BC1, 0x6BB4, 0x6BF5, 0x6BE1, 0x6C07,
+ 0x6C14, 0x6C22, 0x6C29, 0x6C32, 0x51FC, 0x51B3, 0x51B1, 0x6CA1, 0x51B5, 0x6CC4, 0x6C79, 0x6D43, 0x6CFE, 0x51C9, 0x51C4, 0x6CEA,
+ 0x6E0C, 0x51C0, 0x6CA6, 0x6E0A, 0x6D9E, 0x6D45, 0x6DA3, 0x51CF, 0x6CA8, 0x6DA1, 0x6D4B, 0x6D51, 0x51D1, 0x6D48, 0x6D8C, 0x6D07,
+ 0x6C64, 0x6CA9, 0x51C6, 0x6C9F, 0x6E29, 0x6DA2, 0x6E7F, 0x6CA7, 0x706D, 0x6DA4, 0x8365, 0x6CAA, 0x6EDE, 0x6E17, 0x6D52, 0x6D50,
+ 0x6EDA, 0x6EE1, 0x6E14, 0x6E87, 0x6CA4, 0x6C49, 0x6D9F, 0x6E0D, 0x6DA8, 0x6E10, 0x6D46, 0x988D, 0x6CFC, 0x6D01, 0x6F5C, 0x6DA6,
+ 0x6D54, 0x6E83, 0x6DA0, 0x6DA9, 0x6D47, 0x6D9D, 0x6C84, 0x6DA7, 0x6E11, 0x6CFD, 0x6EEA, 0x6CF6, 0x6D4D, 0x6D4A, 0x6D53, 0x6E7F,
+ 0x6CDE, 0x6D4E, 0x6D9B, 0x6EE5, 0x6F4D, 0x6EE8, 0x6E85, 0x6CFA, 0x6EE4, 0x6EE2, 0x6E0E, 0x6CFB, 0x6D4F, 0x6FD2, 0x6CF8, 0x6CA5,
+ 0x6F47, 0x6F46, 0x6F74, 0x6CF7, 0x6FD1, 0x6F4B, 0x6F9C, 0x6CA3, 0x6EE0, 0x6D12, 0x6EE9, 0x704F, 0x6E7E, 0x6EE6, 0x6EDF, 0x707E,
+ 0x4E3A, 0x4E4C, 0x70C3, 0x65E0, 0x70BC, 0x709C, 0x70DF, 0x8315, 0x7115, 0x70E6, 0x7080, 0x8367, 0x709D, 0x70ED, 0x70BD, 0x70E8,
+ 0x706F, 0x7096, 0x70E7, 0x70EB, 0x7116, 0x8425, 0x707F, 0x70DB, 0x70E9, 0x70EC, 0x7118, 0x70C1, 0x7089, 0x70C2, 0x4E89, 0x4E3A,
+ 0x7237, 0x5C14, 0x5899, 0x724D, 0x7275, 0x8366, 0x7266, 0x728A, 0x727A, 0x72B6, 0x72ED, 0x72C8, 0x72F0, 0x72B9, 0x72F2, 0x72B8,
+ 0x72F1, 0x72EE, 0x5956, 0x72EC, 0x72EF, 0x7303, 0x72DE, 0x83B7, 0x730E, 0x72B7, 0x517D, 0x736D, 0x732E, 0x7315, 0x7321, 0x73B0,
+ 0x73D0, 0x73F2, 0x73AE, 0x739A, 0x7410, 0x7476, 0x83B9, 0x739B, 0x7405, 0x73B1, 0x740F, 0x740E, 0x7391, 0x7477, 0x73F0, 0x73AF,
+ 0x7399, 0x73BA, 0x743C, 0x73D1, 0x748E, 0x74D2, 0x74EF, 0x74EE, 0x4EA7, 0x4EA7, 0x4EA9, 0x6BD5, 0x753B, 0x7572, 0x5F02, 0x5F53,
+ 0x7574, 0x53E0, 0x75C9, 0x9178, 0x75F9, 0x75D6, 0x75AF, 0x75A1, 0x75EA, 0x7617, 0x75AE, 0x759F, 0x75AD, 0x7618, 0x7597, 0x75E8,
+ 0x75EB, 0x7605, 0x75A0, 0x762A, 0x75D2, 0x7596, 0x75AC, 0x765E, 0x7663, 0x763F, 0x763E, 0x75C8, 0x762B, 0x766B, 0x53D1, 0x7691,
+ 0x75B1, 0x76B2, 0x76B1, 0x676F, 0x76D7, 0x76CF, 0x5C3D, 0x76D1, 0x76D8, 0x5362, 0x8361, 0x7726, 0x4F17, 0x56F0, 0x7741, 0x7750,
+ 0x772F, 0x7792, 0x4E86, 0x7786, 0x7751, 0x772C, 0x77A9, 0x77EB, 0x7845, 0x70AE, 0x7841, 0x7856, 0x7817, 0x781A, 0x7855, 0x7800,
+ 0x786E, 0x7801, 0x7859, 0x7816, 0x789C, 0x789B, 0x77F6, 0x7857, 0x785A, 0x7840, 0x788D, 0x77FF, 0x783A, 0x783E, 0x77FE, 0x783B,
+ 0x7984, 0x7978, 0x796F, 0x794E, 0x5FA1, 0x7985, 0x793C, 0x7977, 0x79C3, 0x7C7C, 0x7A0E, 0x79C6, 0x68F1, 0x79CD, 0x79F0, 0x7A23,
+ 0x79EF, 0x9896, 0x79FE, 0x7A51, 0x79FD, 0x7A33, 0x7A9D, 0x6D3C, 0x7A77, 0x7A91, 0x7A8E, 0x7AAD, 0x7AA5, 0x7A9C, 0x7A8D, 0x7AA6,
+ 0x7A83, 0x7ADE, 0x7B14, 0x7B0B, 0x7B15, 0x7B3A, 0x7B5D, 0x8282, 0x8303, 0x7B51, 0x7BA7, 0x7B7C, 0x7B03, 0x7B5B, 0x7B5A, 0x7BA6,
+ 0x7BD3, 0x7BAA, 0x7B80, 0x7BD1, 0x7BAB, 0x6A90, 0x7B5C, 0x7B7E, 0x5E18, 0x7BEE, 0x7B79, 0x7B93, 0x7BEF, 0x7BA8, 0x7C41, 0x7B3C,
+ 0x7B7E, 0x7B3E, 0x7BF1, 0x7BA9, 0x5401, 0x5986, 0x7CA4, 0x7CC1, 0x7CAA, 0x7CAE, 0x7CF5, 0x7C9D, 0x7C74, 0x7C9C, 0x7EA0, 0x7EAA,
+ 0x7EA3, 0x7EA6, 0x7EA2, 0x7EA1, 0x7EA5, 0x7EA8, 0x7EAB, 0x7EB9, 0x7EB3, 0x7EBD, 0x7EBE, 0x7EAF, 0x7EB0, 0x7EB1, 0x7EB8, 0x7EA7,
+ 0x7EB7, 0x7EAD, 0x7EB4, 0x7EBA, 0x624E, 0x624E, 0x7EC6, 0x7EC2, 0x7EC1, 0x7EC5, 0x7EBB, 0x7ECD, 0x7EC0, 0x7ECB, 0x7ED0, 0x7ECC,
+ 0x7EC8, 0x5F26, 0x7EC4, 0x7ECA, 0x7ED7, 0x7ED3, 0x7EDD, 0x7EE6, 0x7ED4, 0x7EDE, 0x7EDC, 0x7EDA, 0x7ED9, 0x7ED2, 0x7ED6, 0x7EDF,
+ 0x4E1D, 0x7EDB, 0x7EE2, 0x7ED1, 0x7EE1, 0x7EE0, 0x7EE8, 0x7EE5, 0x7ECF, 0x7EFC, 0x7F0D, 0x7EFF, 0x7EF8, 0x7EFB, 0x7EF6, 0x7EF4,
+ 0x7EFE, 0x7EB2, 0x7F51, 0x7F00, 0x7EB6, 0x7EFA, 0x7EEE, 0x7EFD, 0x7EF0, 0x7EEB, 0x7EF5, 0x7EF2, 0x7F01, 0x7D27, 0x7EEF, 0x7EEA,
+ 0x7F03, 0x7F04, 0x7F02, 0x7EBF, 0x7F09, 0x7F0E, 0x7F14, 0x7F17, 0x7F18, 0x7F0C, 0x7F16, 0x7F13, 0x7F05, 0x7EAC, 0x7F11, 0x7F08,
+ 0x7EC3, 0x7F0F, 0x7F07, 0x81F4, 0x8426, 0x7F19, 0x7F22, 0x7F12, 0x7EC9, 0x7F23, 0x7F1E, 0x7F1A, 0x7F1C, 0x7F1F, 0x7F1B, 0x53BF,
+ 0x7F1D, 0x7F29, 0x7EB5, 0x7F27, 0x7F26, 0x7D77, 0x7F15, 0x7F25, 0x603B, 0x7EE9, 0x7EF7, 0x7F2B, 0x7F2A, 0x7F2F, 0x7EC7, 0x7F2E,
+ 0x7F2D, 0x7ED5, 0x7EE3, 0x7F0B, 0x7EF3, 0x7ED8, 0x7CFB, 0x8327, 0x7F33, 0x7F32, 0x7F34, 0x7ECE, 0x7EE7, 0x7F24, 0x7F31, 0x7F2C,
+ 0x7EA9, 0x7EED, 0x7F20, 0x7F28, 0x7EA4, 0x7F35, 0x7F06, 0x94B5, 0x7F42, 0x7F5A, 0x9A82, 0x7F62, 0x7F57, 0x7F74, 0x7F81, 0x8288,
+ 0x7F9F, 0x7FA1, 0x4E49, 0x81BB, 0x4E60, 0x7FC6, 0x7FDA, 0x7FD8, 0x7FD9, 0x8027, 0x5723, 0x95FB, 0x8054, 0x806A, 0x58F0, 0x8038,
+ 0x8069, 0x8042, 0x804C, 0x804D, 0x542C, 0x804B, 0x8083, 0x80C1, 0x8109, 0x80EB, 0x8131, 0x80C0, 0x80BE, 0x80E8, 0x8136, 0x8111,
+ 0x80BF, 0x811A, 0x80A0, 0x817D, 0x8158, 0x80A4, 0x80F6, 0x817B, 0x80C6, 0x810D, 0x8113, 0x8138, 0x8110, 0x8191, 0x814A, 0x80EA,
+ 0x810F, 0x8114, 0x81DC, 0x5367, 0x4E34, 0x53F0, 0x4E0E, 0x5174, 0x4E3E, 0x65E7, 0x8231, 0x8223, 0x8230, 0x823B, 0x8270, 0x8273,
+ 0x82C4, 0x520D, 0x82CE, 0x5179, 0x8346, 0x8C46, 0x5E84, 0x830E, 0x835A, 0x82CB, 0x534E, 0x70DF, 0x82CC, 0x83B1, 0x4E07, 0x83B4,
+ 0x53F6, 0x836D, 0x7740, 0x82C7, 0x8364, 0x641C, 0x83B3, 0x8385, 0x82CD, 0x836A, 0x76D6, 0x83B2, 0x82C1, 0x83BC, 0x835C, 0x848C,
+ 0x848B, 0x8471, 0x8311, 0x836B, 0x8368, 0x8487, 0x835E, 0x836C, 0x83B8, 0x835B, 0x8489, 0x829C, 0x8427, 0x84E3, 0x835F, 0x84DF,
+ 0x8297, 0x59DC, 0x8537, 0x83B6, 0x8350, 0x8428, 0x8360, 0x501F, 0x84DD, 0x8369, 0x827A, 0x836F, 0x85AE, 0x82C8, 0x853C, 0x853A,
+ 0x841A, 0x8572, 0x82A6, 0x82CF, 0x8574, 0x82F9, 0x8616, 0x85D3, 0x8539, 0x830F, 0x5170, 0x84E0, 0x841D, 0x5904, 0x865A, 0x864F,
+ 0x53F7, 0x4E8F, 0x866C, 0x86F1, 0x8715, 0x86AC, 0x8680, 0x732C, 0x867E, 0x8671, 0x8717, 0x86F3, 0x8682, 0x8424, 0x877C, 0x8780,
+ 0x86F0, 0x8748, 0x87A8, 0x866E, 0x8749, 0x86F2, 0x866B, 0x86CF, 0x8681, 0x8683, 0x8747, 0x867F, 0x874E, 0x86F4, 0x877E, 0x869D,
+ 0x8721, 0x86CE, 0x87CF, 0x86CA, 0x8695, 0x86EE, 0x4F17, 0x672F, 0x536B, 0x51B2, 0x886E, 0x8885, 0x8865, 0x88C5, 0x91CC, 0x5236,
+ 0x590D, 0x88C8, 0x8886, 0x88E4, 0x88E2, 0x7F21, 0x891B, 0x4EB5, 0x88E5, 0x8884, 0x88E3, 0x88C6, 0x8934, 0x889C, 0x886C, 0x88AD,
+ 0x8955, 0x89C1, 0x89C4, 0x89C5, 0x89C6, 0x89C7, 0x89CB, 0x89CD, 0x89CE, 0x4EB2, 0x89CA, 0x89CF, 0x89D0, 0x89D1, 0x89C9, 0x89C8,
+ 0x89CC, 0x89C2, 0x89DE, 0x89EF, 0x89E6, 0x8BA2, 0x8BA3, 0x8BA1, 0x8BAF, 0x8BA7, 0x8BA8, 0x8BA6, 0x8BAD, 0x8BAA, 0x8BAB, 0x8BAC,
+ 0x8BB0, 0x8BB9, 0x8BB6, 0x8BBC, 0x8BC0, 0x8BB7, 0x8BBF, 0x8BBE, 0x8BB8, 0x8BC9, 0x8BC3, 0x8BCA, 0x8BC1, 0x8BC2, 0x8BCB, 0x8BB5,
+ 0x8BC8, 0x8BD2, 0x8BCF, 0x8BC4, 0x8BCE, 0x8BC5, 0x8BCD, 0x548F, 0x8BE9, 0x8BE2, 0x8BE3, 0x8BD5, 0x8BD7, 0x8BE7, 0x8BDF, 0x8BE1,
+ 0x8BE0, 0x8BD8, 0x8BDD, 0x8BE5, 0x8BE6, 0x8BDC, 0x8BD9, 0x8BD6, 0x8BD4, 0x8BDB, 0x8BD3, 0x5938, 0x5FD7, 0x8BA4, 0x8BF3, 0x8BF6,
+ 0x8BDE, 0x8BF1, 0x8BEE, 0x8BED, 0x8BDA, 0x8BEB, 0x8BEC, 0x8BEF, 0x8BF0, 0x8BF5, 0x8BF2, 0x8BF4, 0x8C01, 0x8BFE, 0x8C07, 0x8BFD,
+ 0x8C0A, 0x8C03, 0x8C04, 0x8C06, 0x8C08, 0x8BFF, 0x8BF7, 0x8BE4, 0x8BF9, 0x8BFC, 0x8C05, 0x8BBA, 0x8C02, 0x8C00, 0x8C0D, 0x8C1E,
+ 0x8C1D, 0x8C25, 0x8BE8, 0x8C14, 0x8C1B, 0x8C10, 0x8C0F, 0x8C15, 0x8C18, 0x8BB3, 0x8C19, 0x8C0C, 0x8BBD, 0x8BF8, 0x8C1A, 0x8C16,
+ 0x8BFA, 0x8C0B, 0x8C12, 0x8C13, 0x8A8A, 0x8BCC, 0x8C0E, 0x8C1C, 0x8C27, 0x8C11, 0x8C21, 0x8C24, 0x8C26, 0x8BB2, 0x8C22, 0x8C23,
+ 0x8C1F, 0x8C2A, 0x8C2C, 0x8BB4, 0x8C28, 0x8C29, 0x8BC1, 0x8C32, 0x8BA5, 0x8C2E, 0x8BC6, 0x8C2F, 0x8C2D, 0x8C31, 0x8C35, 0x8BD1,
+ 0x8BAE, 0x8C34, 0x62A4, 0x8BEA, 0x8A89, 0x8C2B, 0x8BFB, 0x53D8, 0x8A5F, 0x96E0, 0x8C17, 0x8BA9, 0x8C30, 0x8C36, 0x8D5E, 0x8C20,
+ 0x8C33, 0x5C82, 0x7AD6, 0x4E30, 0x732A, 0x8C6E, 0x732B, 0x8D1D, 0x8D1E, 0x8D1F, 0x8D22, 0x8D21, 0x8D2B, 0x8D27, 0x8D29, 0x8D2A,
+ 0x8D2F, 0x8D23, 0x8D2E, 0x8D33, 0x8D40, 0x8D30, 0x8D35, 0x8D2C, 0x4E70, 0x8D37, 0x8D36, 0x8D39, 0x8D34, 0x8D3B, 0x8D38, 0x8D3A,
+ 0x8D32, 0x8D42, 0x8D41, 0x8D3F, 0x8D45, 0x8D44, 0x8D3E, 0x8D3C, 0x8D48, 0x8D4A, 0x5BBE, 0x8D47, 0x8D52, 0x8D49, 0x8D50, 0x8D4F,
+ 0x8D54, 0x8D53, 0x8D24, 0x5356, 0x8D31, 0x8D4B, 0x8D55, 0x8D28, 0x8D26, 0x8D4C, 0x8D56, 0x8D57, 0x8D5A, 0x8D59, 0x8D2D, 0x8D5B,
+ 0x8D5C, 0x8D3D, 0x8D58, 0x8D5F, 0x8D60, 0x8D5E, 0x8D61, 0x8D62, 0x8D46, 0x8D43, 0x8D51, 0x8D4E, 0x8D5D, 0x8D63, 0x8D6A, 0x8D76,
+ 0x8D75, 0x8D8B, 0x8DB1, 0x8FF9, 0x8DF5, 0x8E0A, 0x8DC4, 0x8DF8, 0x8DD6, 0x8E52, 0x8DF7, 0x8DF6, 0x8DB8, 0x8E0C, 0x8DFB, 0x8DC3,
+ 0x8E2F, 0x8DDE, 0x8E2C, 0x8E70, 0x8DF9, 0x8E51, 0x8E7F, 0x8E9C, 0x8E8F, 0x8EAF, 0x8F66, 0x8F67, 0x8F68, 0x519B, 0x8F69, 0x8F6B,
+ 0x8F6D, 0x8F6F, 0x8F78, 0x8F71, 0x8F74, 0x8F75, 0x8F7A, 0x8F72, 0x8F76, 0x8F7C, 0x8F83, 0x8F82, 0x8F81, 0x8F80, 0x8F7D, 0x8F7E,
+ 0x8F84, 0x8F85, 0x8F7B, 0x8F86, 0x8F8E, 0x8F89, 0x8F8B, 0x8F8D, 0x8F8A, 0x8F87, 0x8F88, 0x8F6E, 0x8F91, 0x8F8F, 0x8F93, 0x8F90,
+ 0x8F97, 0x8206, 0x8F92, 0x6BC2, 0x8F96, 0x8F95, 0x8F98, 0x8F6C, 0x8F99, 0x8F7F, 0x8F9A, 0x8F70, 0x8F94, 0x8F79, 0x8F73, 0x529E,
+ 0x8F9E, 0x8FAB, 0x8FA9, 0x519C, 0x8FD9, 0x8FDE, 0x5468, 0x8FDB, 0x6E38, 0x8FD0, 0x8FC7, 0x8FBE, 0x8FDD, 0x9065, 0x900A, 0x9012,
+ 0x8FDC, 0x9002, 0x8FDF, 0x8FC1, 0x9009, 0x9057, 0x8FBD, 0x8FC8, 0x8FD8, 0x8FE9, 0x8FB9, 0x903B, 0x9026, 0x90CF, 0x90AE, 0x90D3,
+ 0x4E61, 0x90B9, 0x90AC, 0x90E7, 0x9093, 0x90D1, 0x90BB, 0x90F8, 0x90BA, 0x90D0, 0x909D, 0x9142, 0x90E6, 0x814C, 0x4E11, 0x915D,
+ 0x533B, 0x9171, 0x9166, 0x917F, 0x8845, 0x917E, 0x917D, 0x91CA, 0x9487, 0x948C, 0x948A, 0x9489, 0x948B, 0x9488, 0x9493, 0x9490,
+ 0x948F, 0x9492, 0x948E, 0x9497, 0x948D, 0x9495, 0x94AF, 0x94AB, 0x9498, 0x94AD, 0x94A0, 0x949D, 0x94A4, 0x94A3, 0x949E, 0x94AE,
+ 0x94A7, 0x9499, 0x949B, 0x94AA, 0x94CC, 0x94C8, 0x94B6, 0x94C3, 0x94B4, 0x94B9, 0x94CD, 0x94B0, 0x94B8, 0x94C0, 0x94BF, 0x94BE,
+ 0x949C, 0x94CA, 0x94C9, 0x94C7, 0x94CB, 0x94C2, 0x94B3, 0x94C6, 0x94C5, 0x94BA, 0x94A9, 0x94B2, 0x94BC, 0x94BD, 0x94CF, 0x94F0,
+ 0x94D2, 0x94EC, 0x94EA, 0x94F6, 0x94F3, 0x94DC, 0x94DA, 0x94E3, 0x94E8, 0x94E2, 0x94ED, 0x94EB, 0x94E6, 0x8854, 0x94D1, 0x94F7,
+ 0x94F1, 0x94DF, 0x94F5, 0x94D5, 0x94EF, 0x94D0, 0x9510, 0x9500, 0x9508, 0x9511, 0x9509, 0x94DD, 0x9512, 0x950C, 0x94A1, 0x94E4,
+ 0x94D7, 0x950B, 0x950A, 0x9513, 0x9504, 0x9503, 0x9514, 0x9507, 0x94D3, 0x94FA, 0x94D6, 0x9506, 0x9502, 0x952F, 0x94A2, 0x951E,
+ 0x5F55, 0x9516, 0x9529, 0x94D4, 0x9525, 0x9515, 0x951F, 0x9524, 0x9531, 0x94EE, 0x951B, 0x952C, 0x952D, 0x951C, 0x94B1, 0x9526,
+ 0x951A, 0x9520, 0x9521, 0x9522, 0x9519, 0x9530, 0x8868, 0x94FC, 0x9528, 0x9494, 0x9534, 0x94FE, 0x9505, 0x9540, 0x9537, 0x94E1,
+ 0x9496, 0x953B, 0x953D, 0x9538, 0x9532, 0x9539, 0x953E, 0x952E, 0x9536, 0x9517, 0x953A, 0x9541, 0x9551, 0x9555, 0x9501, 0x9549,
+ 0x9548, 0x9543, 0x94A8, 0x84E5, 0x954F, 0x94E0, 0x94E9, 0x953C, 0x9550, 0x9547, 0x9552, 0x954D, 0x9553, 0x955E, 0x955F, 0x94FE,
+ 0x9546, 0x9559, 0x9560, 0x955D, 0x94FF, 0x9535, 0x9557, 0x9558, 0x955B, 0x94F2, 0x955C, 0x9556, 0x9542, 0x933E, 0x955A, 0x94E7,
+ 0x956A, 0x9508, 0x94D9, 0x9563, 0x9566, 0x9561, 0x949F, 0x956B, 0x950F, 0x9544, 0x954C, 0x9570, 0x956F, 0x956D, 0x94C1, 0x956E,
+ 0x94CE, 0x94DB, 0x9571, 0x94F8, 0x956C, 0x9554, 0x9274, 0x9527, 0x9574, 0x94C4, 0x9573, 0x9567, 0x94A5, 0x9575, 0x9576, 0x954A,
+ 0x9569, 0x9523, 0x94BB, 0x92AE, 0x51FF, 0x957F, 0x95E8, 0x95E9, 0x95EA, 0x95EB, 0x95EC, 0x95ED, 0x5F00, 0x95F6, 0x95F3, 0x95F0,
+ 0x95F2, 0x95F4, 0x95F5, 0x95F8, 0x9602, 0x9601, 0x9600, 0x95FA, 0x95FD, 0x9603, 0x9606, 0x95FE, 0x9605, 0x960A, 0x9609, 0x960E,
+ 0x960F, 0x960D, 0x9608, 0x960C, 0x9612, 0x677F, 0x6697, 0x95F1, 0x9614, 0x9615, 0x9611, 0x9617, 0x9618, 0x95FF, 0x9616, 0x9619,
+ 0x95EF, 0x5173, 0x961A, 0x9613, 0x9610, 0x8F9F, 0x961B, 0x95FC, 0x9649, 0x9655, 0x9635, 0x9634, 0x9648, 0x9646, 0x9633, 0x9667,
+ 0x961F, 0x9636, 0x9668, 0x9645, 0x968F, 0x9669, 0x9690, 0x9647, 0x96B6, 0x53EA, 0x96BD, 0x867D, 0x53CC, 0x96CF, 0x6742, 0x9E21,
+ 0x79BB, 0x96BE, 0x4E91, 0x7535, 0x9721, 0x96FE, 0x9701, 0x96F3, 0x972D, 0x53C7, 0x7075, 0x53C6, 0x9753, 0x9759, 0x817C, 0x9765,
+ 0x9F17, 0x5DE9, 0x979F, 0x7F30, 0x9791, 0x97AF, 0x97E6, 0x97E7, 0x97E9, 0x97EA, 0x97EC, 0x97EB, 0x97F5, 0x54CD, 0x9875, 0x9876,
+ 0x9877, 0x9879, 0x987A, 0x9878, 0x987B, 0x987C, 0x9882, 0x9880, 0x9883, 0x9884, 0x987D, 0x9881, 0x987F, 0x9887, 0x9886, 0x988C,
+ 0x9889, 0x9890, 0x988F, 0x5934, 0x988A, 0x988B, 0x9894, 0x9888, 0x9893, 0x9891, 0x9897, 0x9898, 0x989D, 0x989A, 0x989C, 0x9899,
+ 0x989B, 0x613F, 0x98A1, 0x98A0, 0x7C7B, 0x989F, 0x98A2, 0x987E, 0x98A4, 0x98A5, 0x663E, 0x98A6, 0x9885, 0x989E, 0x98A7, 0x98CE,
+ 0x98D0, 0x98D1, 0x98D2, 0x53F0, 0x98D3, 0x98D4, 0x98CF, 0x98D6, 0x98D5, 0x98D7, 0x98D8, 0x98D9, 0x98DE, 0x9965, 0x9964, 0x9966,
+ 0x9968, 0x996A, 0x996B, 0x996C, 0x996D, 0x996E, 0x9974, 0x9972, 0x9971, 0x9970, 0x9973, 0x997A, 0x9978, 0x997C, 0x9977, 0x517B,
+ 0x9975, 0x9979, 0x997D, 0x9981, 0x997F, 0x997E, 0x4F59, 0x80B4, 0x9984, 0x9983, 0x996F, 0x9985, 0x9986, 0x7CC7, 0x9967, 0x5582,
+ 0x9989, 0x998E, 0x9969, 0x998F, 0x998A, 0x998C, 0x998D, 0x9992, 0x9990, 0x9991, 0x9988, 0x9994, 0x9976, 0x98E8, 0x990D, 0x998B,
+ 0x9A6C, 0x9A6D, 0x51AF, 0x9A6E, 0x9A70, 0x9A6F, 0x9A73, 0x9A7B, 0x9A7D, 0x9A79, 0x9A75, 0x9A7E, 0x9A80, 0x9A78, 0x9A76, 0x9A7C,
+ 0x9A77, 0x9A88, 0x9A87, 0x9A83, 0x9A86, 0x9A8E, 0x9A8F, 0x9A8B, 0x9A8D, 0x9A93, 0x9A92, 0x9A91, 0x9A90, 0x9A9B, 0x9A97, 0x9A99,
+ 0x9A9E, 0x9A98, 0x9A9D, 0x817E, 0x9A7A, 0x9A9A, 0x9A9F, 0x9AA1, 0x84E6, 0x9A9C, 0x9A96, 0x9AA0, 0x9AA2, 0x9A71, 0x9A85, 0x9A95,
+ 0x9A81, 0x9A84, 0x9A8C, 0x60CA, 0x9A7F, 0x9AA4, 0x9A74, 0x9AA7, 0x9AA5, 0x9AA6, 0x9A8A, 0x80AE, 0x9AC5, 0x810F, 0x4F53, 0x9ACC,
+ 0x9ACB, 0x53D1, 0x677E, 0x80E1, 0x9B13, 0x6597, 0x95F9, 0x960B, 0x9604, 0x90C1, 0x9B49, 0x9B47, 0x9C7C, 0x9C80, 0x9C81, 0x9C82,
+ 0x9C7F, 0x9C85, 0x9C86, 0x9C8F, 0x9C87, 0x9C90, 0x9C8D, 0x9C8B, 0x9C8A, 0x9C92, 0x9C95, 0x9C96, 0x9C94, 0x9C9B, 0x9C91, 0x9C9C,
+ 0x9CA7, 0x9CA0, 0x9CA9, 0x9CA4, 0x9CA8, 0x9CBB, 0x9CAF, 0x9CAD, 0x9C9E, 0x9CB7, 0x9CB4, 0x9CB1, 0x9CB5, 0x9CB2, 0x9CB3, 0x9CB8,
+ 0x9CAE, 0x9CB0, 0x9CB6, 0x9CAB, 0x9CCA, 0x9C97, 0x9CBD, 0x9CC7, 0x9CC5, 0x9CC6, 0x9CC3, 0x9CD2, 0x9CD1, 0x9CA5, 0x9CCF, 0x9CCE,
+ 0x9CD0, 0x9CCD, 0x9CC1, 0x9CA2, 0x9CCC, 0x9CA6, 0x9CA3, 0x9CB9, 0x9CD7, 0x9CD4, 0x9CC9, 0x9CD5, 0x9CD6, 0x9CDF, 0x9CDD, 0x9CDC,
+ 0x9CDE, 0x9C9F, 0x9CBC, 0x9C8E, 0x9C99, 0x9CE3, 0x9CE2, 0x9C9A, 0x9CC4, 0x9C88, 0x9CA1, 0x9E1F, 0x51EB, 0x9E20, 0x9E24, 0x51E4,
+ 0x9E23, 0x9E22, 0x9E29, 0x9E28, 0x9E26, 0x9E30, 0x9E35, 0x9E33, 0x9E32, 0x9E2E, 0x9E31, 0x9E2A, 0x9E2F, 0x9E2D, 0x9E38, 0x9E39,
+ 0x9E3B, 0x9E3F, 0x9E3D, 0x9E3A, 0x9E43, 0x9E46, 0x9E41, 0x9E48, 0x9E45, 0x9E44, 0x9E49, 0x9E4C, 0x9E4F, 0x9E4E, 0x9E4A, 0x9E53,
+ 0x9E2B, 0x9E51, 0x9E4B, 0x9E59, 0x9E55, 0x9E57, 0x9E56, 0x9E4D, 0x9E5B, 0x9E5C, 0x83BA, 0x9E5F, 0x9E64, 0x9E60, 0x9E61, 0x9E58,
+ 0x9E63, 0x9E5A, 0x9E62, 0x9E5E, 0x9E67, 0x9E65, 0x9E25, 0x9E37, 0x9E68, 0x9E36, 0x9E6A, 0x9E54, 0x9E69, 0x9E6B, 0x9E47, 0x9E6C,
+ 0x9E70, 0x9E6D, 0x9E6F, 0x9E2C, 0x9E74, 0x9E66, 0x9E73, 0x9E42, 0x9E3E, 0x5364, 0x9E7E, 0x7877, 0x76D0, 0x4E3D, 0x9EA6, 0x9EB8,
+ 0x9EB9, 0x9762, 0x4E48, 0x9EC4, 0x9EC9, 0x70B9, 0x515A, 0x9709, 0x9EE1, 0x9EE9, 0x9EFE, 0x9F0B, 0x9F0D, 0x9F39, 0x9F50, 0x658B,
+ 0x8D4D, 0x9F51, 0x9F7F, 0x9F80, 0x9F81, 0x9F85, 0x9F87, 0x9F83, 0x9F86, 0x9F84, 0x9F88, 0x9F8A, 0x9F89, 0x9F8B, 0x9F8C, 0x9F99,
+ 0x5390, 0x5E9E, 0x9F9A, 0x9F9B, 0x9F9F, 0xA76F, 0x8C48, 0x66F4, 0x8ECA, 0x8CC8, 0x6ED1, 0x4E32, 0x53E5, 0x9F9C, 0x9F9C, 0x5951,
+ 0x91D1, 0x5587, 0x5948, 0x61F6, 0x7669, 0x7F85, 0x863F, 0x87BA, 0x88F8, 0x908F, 0x6A02, 0x6D1B, 0x70D9, 0x73DE, 0x843D, 0x916A,
+ 0x99F1, 0x4E82, 0x5375, 0x6B04, 0x721B, 0x862D, 0x9E1E, 0x5D50, 0x6FEB, 0x85CD, 0x8964, 0x62C9, 0x81D8, 0x881F, 0x5ECA, 0x6717,
+ 0x6D6A, 0x72FC, 0x90CE, 0x4F86, 0x51B7, 0x52DE, 0x64C4, 0x6AD3, 0x7210, 0x76E7, 0x8001, 0x8606, 0x865C, 0x8DEF, 0x9732, 0x9B6F,
+ 0x9DFA, 0x788C, 0x797F, 0x7DA0, 0x83C9, 0x9304, 0x9E7F, 0x8AD6, 0x58DF, 0x5F04, 0x7C60, 0x807E, 0x7262, 0x78CA, 0x8CC2, 0x96F7,
+ 0x58D8, 0x5C62, 0x6A13, 0x6DDA, 0x6F0F, 0x7D2F, 0x7E37, 0x964B, 0x52D2, 0x808B, 0x51DC, 0x51CC, 0x7A1C, 0x7DBE, 0x83F1, 0x9675,
+ 0x8B80, 0x62CF, 0x6A02, 0x8AFE, 0x4E39, 0x5BE7, 0x6012, 0x7387, 0x7570, 0x5317, 0x78FB, 0x4FBF, 0x5FA9, 0x4E0D, 0x6CCC, 0x6578,
+ 0x7D22, 0x53C3, 0x585E, 0x7701, 0x8449, 0x8AAA, 0x6BBA, 0x8FB0, 0x6C88, 0x62FE, 0x82E5, 0x63A0, 0x7565, 0x4EAE, 0x5169, 0x51C9,
+ 0x6881, 0x7CE7, 0x826F, 0x8AD2, 0x91CF, 0x52F5, 0x5442, 0x5973, 0x5EEC, 0x65C5, 0x6FFE, 0x792A, 0x95AD, 0x9A6A, 0x9E97, 0x9ECE,
+ 0x529B, 0x66C6, 0x6B77, 0x8F62, 0x5E74, 0x6190, 0x6200, 0x649A, 0x6F23, 0x7149, 0x7489, 0x79CA, 0x7DF4, 0x806F, 0x8F26, 0x84EE,
+ 0x9023, 0x934A, 0x5217, 0x52A3, 0x54BD, 0x70C8, 0x88C2, 0x8AAA, 0x5EC9, 0x5FF5, 0x637B, 0x6BAE, 0x7C3E, 0x7375, 0x4EE4, 0x56F9,
+ 0x5BE7, 0x5DBA, 0x601C, 0x73B2, 0x7469, 0x7F9A, 0x8046, 0x9234, 0x96F6, 0x9748, 0x9818, 0x4F8B, 0x79AE, 0x91B4, 0x96B8, 0x60E1,
+ 0x4E86, 0x50DA, 0x5BEE, 0x5C3F, 0x6599, 0x6A02, 0x71CE, 0x7642, 0x84FC, 0x907C, 0x9F8D, 0x6688, 0x962E, 0x5289, 0x677B, 0x67F3,
+ 0x6D41, 0x6E9C, 0x7409, 0x7559, 0x786B, 0x7D10, 0x985E, 0x516D, 0x622E, 0x9678, 0x502B, 0x5D19, 0x6DEA, 0x8F2A, 0x5F8B, 0x6144,
+ 0x6817, 0x7387, 0x9686, 0x5229, 0x540F, 0x5C65, 0x6613, 0x674E, 0x68A8, 0x6CE5, 0x7406, 0x75E2, 0x7F79, 0x88CF, 0x88E1, 0x91CC,
+ 0x96E2, 0x533F, 0x6EBA, 0x541D, 0x71D0, 0x7498, 0x85FA, 0x96A3, 0x9C57, 0x9E9F, 0x6797, 0x6DCB, 0x81E8, 0x7ACB, 0x7B20, 0x7C92,
+ 0x72C0, 0x7099, 0x8B58, 0x4EC0, 0x8336, 0x523A, 0x5207, 0x5EA6, 0x62D3, 0x7CD6, 0x5B85, 0x6D1E, 0x66B4, 0x8F3B, 0x884C, 0x964D,
+ 0x898B, 0x5ED3, 0x5140, 0x55C0, 0x585A, 0x6674, 0x51DE, 0x732A, 0x76CA, 0x793C, 0x795E, 0x7965, 0x798F, 0x9756, 0x7CBE, 0x7FBD,
+ 0x8612, 0x8AF8, 0x9038, 0x90FD, 0x98EF, 0x98FC, 0x9928, 0x9DB4, 0x4FAE, 0x50E7, 0x514D, 0x52C9, 0x52E4, 0x5351, 0x559D, 0x5606,
+ 0x5668, 0x5840, 0x58A8, 0x5C64, 0x5C6E, 0x6094, 0x6168, 0x618E, 0x61F2, 0x654F, 0x65E2, 0x6691, 0x6885, 0x6D77, 0x6E1A, 0x6F22,
+ 0x716E, 0x722B, 0x7422, 0x7891, 0x793E, 0x7949, 0x7948, 0x7950, 0x7956, 0x795D, 0x798D, 0x798E, 0x7A40, 0x7A81, 0x7BC0, 0x7DF4,
+ 0x7E09, 0x7E41, 0x7F72, 0x8005, 0x81ED, 0x8279, 0x8279, 0x8457, 0x8910, 0x8996, 0x8B01, 0x8B39, 0x8CD3, 0x8D08, 0x8FB6, 0x9038,
+ 0x96E3, 0x97FF, 0x983B, 0x6075, 0x8218, 0x4E26, 0x51B5, 0x5168, 0x4F80, 0x5145, 0x5180, 0x52C7, 0x52FA, 0x559D, 0x5555, 0x5599,
+ 0x55E2, 0x585A, 0x58B3, 0x5944, 0x5954, 0x5A62, 0x5B28, 0x5ED2, 0x5ED9, 0x5F69, 0x5FAD, 0x60D8, 0x614E, 0x6108, 0x618E, 0x6160,
+ 0x61F2, 0x6234, 0x63C4, 0x641C, 0x6452, 0x6556, 0x6674, 0x6717, 0x671B, 0x6756, 0x6B79, 0x6BBA, 0x6D41, 0x6EDB, 0x6ECB, 0x6F22,
+ 0x701E, 0x716E, 0x77A7, 0x7235, 0x72AF, 0x732A, 0x7471, 0x7506, 0x753B, 0x761D, 0x761F, 0x76CA, 0x76DB, 0x76F4, 0x774A, 0x7740,
+ 0x78CC, 0x7AB1, 0x7BC0, 0x7C7B, 0x7D5B, 0x7DF4, 0x7F3E, 0x8005, 0x8352, 0x83EF, 0x8779, 0x8941, 0x8986, 0x8996, 0x8ABF, 0x8AF8,
+ 0x8ACB, 0x8B01, 0x8AFE, 0x8AED, 0x8B39, 0x8B8A, 0x8D08, 0x8F38, 0x9072, 0x9199, 0x9276, 0x967C, 0x96E3, 0x9756, 0x97DB, 0x97FF,
+ 0x980B, 0x983B, 0x9B12, 0x9F9C, 0x3B9D, 0x4018, 0x4039, 0x9F43, 0x9F8E, 0x05E2, 0x05D0, 0x05D3, 0x05D4, 0x05DB, 0x05DC, 0x05DD,
+ 0x05E8, 0x05EA, 0x002B, 0x0671, 0x0671, 0x067B, 0x067B, 0x067B, 0x067B, 0x067E, 0x067E, 0x067E, 0x067E, 0x0680, 0x0680, 0x0680,
+ 0x0680, 0x067A, 0x067A, 0x067A, 0x067A, 0x067F, 0x067F, 0x067F, 0x067F, 0x0679, 0x0679, 0x0679, 0x0679, 0x06A4, 0x06A4, 0x06A4,
+ 0x06A4, 0x06A6, 0x06A6, 0x06A6, 0x06A6, 0x0684, 0x0684, 0x0684, 0x0684, 0x0683, 0x0683, 0x0683, 0x0683, 0x0686, 0x0686, 0x0686,
+ 0x0686, 0x0687, 0x0687, 0x0687, 0x0687, 0x068D, 0x068D, 0x068C, 0x068C, 0x068E, 0x068E, 0x0688, 0x0688, 0x0698, 0x0698, 0x0691,
+ 0x0691, 0x06A9, 0x06A9, 0x06A9, 0x06A9, 0x06AF, 0x06AF, 0x06AF, 0x06AF, 0x06B3, 0x06B3, 0x06B3, 0x06B3, 0x06B1, 0x06B1, 0x06B1,
+ 0x06B1, 0x06BA, 0x06BA, 0x06BB, 0x06BB, 0x06BB, 0x06BB, 0x06C0, 0x06C0, 0x06C1, 0x06C1, 0x06C1, 0x06C1, 0x06BE, 0x06BE, 0x06BE,
+ 0x06BE, 0x06D2, 0x06D2, 0x06D3, 0x06D3, 0x06AD, 0x06AD, 0x06AD, 0x06AD, 0x06C7, 0x06C7, 0x06C6, 0x06C6, 0x06C8, 0x06C8, 0x0677,
+ 0x06CB, 0x06CB, 0x06C5, 0x06C5, 0x06C9, 0x06C9, 0x06D0, 0x06D0, 0x06D0, 0x06D0, 0x0649, 0x0649, 0x06CC, 0x06CC, 0x06CC, 0x06CC,
+ 0x002C, 0x3001, 0x3002, 0x003A, 0x003B, 0x0021, 0x003F, 0x3016, 0x3017, 0x2026, 0x2025, 0x2014, 0x2013, 0x005F, 0x005F, 0x0028,
+ 0x0029, 0x007B, 0x007D, 0x3014, 0x3015, 0x3010, 0x3011, 0x300A, 0x300B, 0x3008, 0x3009, 0x300C, 0x300D, 0x300E, 0x300F, 0x005B,
+ 0x005D, 0x203E, 0x203E, 0x203E, 0x203E, 0x005F, 0x005F, 0x005F, 0x002C, 0x3001, 0x002E, 0x003B, 0x003A, 0x003F, 0x0021, 0x2014,
+ 0x0028, 0x0029, 0x007B, 0x007D, 0x3014, 0x3015, 0x0023, 0x0026, 0x002A, 0x002B, 0x002D, 0x003C, 0x003E, 0x003D, 0x005C, 0x0024,
+ 0x0025, 0x0040, 0x064B, 0x064C, 0x064D, 0x064E, 0x064F, 0x0650, 0x0651, 0x0652, 0x0621, 0x0622, 0x0622, 0x0623, 0x0623, 0x0624,
+ 0x0624, 0x0625, 0x0625, 0x0626, 0x0626, 0x0626, 0x0626, 0x0627, 0x0627, 0x0628, 0x0628, 0x0628, 0x0628, 0x0629, 0x0629, 0x062A,
+ 0x062A, 0x062A, 0x062A, 0x062B, 0x062B, 0x062B, 0x062B, 0x062C, 0x062C, 0x062C, 0x062C, 0x062D, 0x062D, 0x062D, 0x062D, 0x062E,
+ 0x062E, 0x062E, 0x062E, 0x062F, 0x062F, 0x0630, 0x0630, 0x0631, 0x0631, 0x0632, 0x0632, 0x0633, 0x0633, 0x0633, 0x0633, 0x0634,
+ 0x0634, 0x0634, 0x0634, 0x0635, 0x0635, 0x0635, 0x0635, 0x0636, 0x0636, 0x0636, 0x0636, 0x0637, 0x0637, 0x0637, 0x0637, 0x0638,
+ 0x0638, 0x0638, 0x0638, 0x0639, 0x0639, 0x0639, 0x0639, 0x063A, 0x063A, 0x063A, 0x063A, 0x0641, 0x0641, 0x0641, 0x0641, 0x0642,
+ 0x0642, 0x0642, 0x0642, 0x0643, 0x0643, 0x0643, 0x0643, 0x0644, 0x0644, 0x0644, 0x0644, 0x0645, 0x0645, 0x0645, 0x0645, 0x0646,
+ 0x0646, 0x0646, 0x0646, 0x0647, 0x0647, 0x0647, 0x0647, 0x0648, 0x0648, 0x0649, 0x0649, 0x064A, 0x064A, 0x064A, 0x064A, 0x0021,
+ 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 0x0030, 0x0031,
+ 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 0x0040, 0x0041,
+ 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051,
+ 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, 0x0060, 0x0061,
+ 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071,
+ 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x2985, 0x2986, 0x3002,
+ 0x300C, 0x300D, 0x3001, 0x30FB, 0x30F2, 0x30A1, 0x30A3, 0x30A5, 0x30A7, 0x30A9, 0x30E3, 0x30E5, 0x30E7, 0x30C3, 0x30FC, 0x30A2,
+ 0x30A4, 0x30A6, 0x30A8, 0x30AA, 0x30AB, 0x30AD, 0x30AF, 0x30B1, 0x30B3, 0x30B5, 0x30B7, 0x30B9, 0x30BB, 0x30BD, 0x30BF, 0x30C1,
+ 0x30C4, 0x30C6, 0x30C8, 0x30CA, 0x30CB, 0x30CC, 0x30CD, 0x30CE, 0x30CF, 0x30D2, 0x30D5, 0x30D8, 0x30DB, 0x30DE, 0x30DF, 0x30E0,
+ 0x30E1, 0x30E2, 0x30E4, 0x30E6, 0x30E8, 0x30E9, 0x30EA, 0x30EB, 0x30EC, 0x30ED, 0x30EF, 0x30F3, 0x3099, 0x309A, 0x3164, 0x3131,
+ 0x3132, 0x3133, 0x3134, 0x3135, 0x3136, 0x3137, 0x3138, 0x3139, 0x313A, 0x313B, 0x313C, 0x313D, 0x313E, 0x313F, 0x3140, 0x3141,
+ 0x3142, 0x3143, 0x3144, 0x3145, 0x3146, 0x3147, 0x3148, 0x3149, 0x314A, 0x314B, 0x314C, 0x314D, 0x314E, 0x314F, 0x3150, 0x3151,
+ 0x3152, 0x3153, 0x3154, 0x3155, 0x3156, 0x3157, 0x3158, 0x3159, 0x315A, 0x315B, 0x315C, 0x315D, 0x315E, 0x315F, 0x3160, 0x3161,
+ 0x3162, 0x3163, 0x00A2, 0x00A3, 0x00AC, 0x00AF, 0x00A6, 0x00A5, 0x20A9, 0x2502, 0x2190, 0x2191, 0x2192, 0x2193, 0x25A0, 0x25CB
+};
+extern const FX_WCHAR g_UnicodeData_Normalization_Map2[1724] = {
+ 0x004F, 0x0045, 0x0054, 0x004D, 0x006F, 0x0065, 0x0049, 0x004A, 0x0069, 0x006A, 0x004F, 0x0045, 0x006F, 0x0065, 0x0044, 0x017D,
+ 0x0044, 0x017E, 0x0064, 0x017E, 0x004C, 0x004A, 0x004C, 0x006A, 0x006C, 0x006A, 0x004E, 0x004A, 0x004E, 0x006A, 0x006E, 0x006A,
+ 0x0044, 0x005A, 0x0044, 0x007A, 0x0064, 0x007A, 0x0064, 0x0062, 0x0071, 0x0070, 0x004F, 0x0045, 0x0064, 0x007A, 0x0064, 0x0292,
+ 0x0064, 0x007A, 0x0074, 0x0073, 0x0074, 0x0283, 0x0074, 0x0063, 0x0066, 0x014B, 0x006C, 0x0073, 0x006C, 0x007A, 0x041D, 0x0413,
+ 0x043D, 0x0433, 0x0422, 0x0426, 0x0442, 0x0446, 0x0410, 0x0415, 0x0430, 0x0435, 0x0565, 0x0582, 0x0627, 0x0674, 0x0648, 0x0674,
+ 0x06C7, 0x0674, 0x064A, 0x0674, 0x06D5, 0x0654, 0x06C1, 0x0654, 0x06D2, 0x0654, 0x0928, 0x093C, 0x0930, 0x093C, 0x0933, 0x093C,
+ 0x0915, 0x093C, 0x0916, 0x093C, 0x0917, 0x093C, 0x091C, 0x093C, 0x0921, 0x093C, 0x0922, 0x093C, 0x092B, 0x093C, 0x092F, 0x093C,
+ 0x09C7, 0x09BE, 0x09C7, 0x09D7, 0x09A1, 0x09BC, 0x09A2, 0x09BC, 0x09AF, 0x09BC, 0x0A32, 0x0A3C, 0x0A38, 0x0A3C, 0x0A16, 0x0A3C,
+ 0x0A17, 0x0A3C, 0x0A1C, 0x0A3C, 0x0A2B, 0x0A3C, 0x0B47, 0x0B56, 0x0B47, 0x0B3E, 0x0B47, 0x0B57, 0x0B21, 0x0B3C, 0x0B22, 0x0B3C,
+ 0x0B92, 0x0BD7, 0x0BC6, 0x0BBE, 0x0BC7, 0x0BBE, 0x0BC6, 0x0BD7, 0x0C46, 0x0C56, 0x0CBF, 0x0CD5, 0x0CC6, 0x0CD5, 0x0CC6, 0x0CD6,
+ 0x0CC6, 0x0CC2, 0x0CCA, 0x0CD5, 0x0D46, 0x0D3E, 0x0D47, 0x0D3E, 0x0D46, 0x0D57, 0x0DD9, 0x0DCA, 0x0DD9, 0x0DCF, 0x0DDC, 0x0DCA,
+ 0x0DD9, 0x0DDF, 0x0E4D, 0x0E32, 0x0ECD, 0x0EB2, 0x0EAB, 0x0E99, 0x0EAB, 0x0EA1, 0x0F42, 0x0FB7, 0x0F4C, 0x0FB7, 0x0F51, 0x0FB7,
+ 0x0F56, 0x0FB7, 0x0F5B, 0x0FB7, 0x0F40, 0x0FB5, 0x0F71, 0x0F72, 0x0F71, 0x0F74, 0x0FB2, 0x0F80, 0x0FB2, 0x0F81, 0x0FB3, 0x0F80,
+ 0x0FB3, 0x0F81, 0x0F71, 0x0F80, 0x0F92, 0x0FB7, 0x0F9C, 0x0FB7, 0x0FA1, 0x0FB7, 0x0FA6, 0x0FB7, 0x0FAB, 0x0FB7, 0x0F90, 0x0FB5,
+ 0x1025, 0x102E, 0x1B05, 0x1B35, 0x1B07, 0x1B35, 0x1B09, 0x1B35, 0x1B0B, 0x1B35, 0x1B0D, 0x1B35, 0x1B11, 0x1B35, 0x1B3A, 0x1B35,
+ 0x1B3C, 0x1B35, 0x1B3E, 0x1B35, 0x1B3F, 0x1B35, 0x1B42, 0x1B35, 0x0074, 0x0068, 0x002E, 0x002E, 0x2032, 0x2032, 0x2035, 0x2035,
+ 0x0021, 0x0021, 0x0020, 0x0305, 0x003F, 0x003F, 0x003F, 0x0021, 0x0021, 0x003F, 0x0052, 0x0073, 0x00B0, 0x0043, 0x00B0, 0x0046,
+ 0x004E, 0x006F, 0x0053, 0x004D, 0x0054, 0x004D, 0x0031, 0x002F, 0x0049, 0x0049, 0x0049, 0x0056, 0x0056, 0x0049, 0x0049, 0x0058,
+ 0x0058, 0x0049, 0x0069, 0x0069, 0x0069, 0x0076, 0x0076, 0x0069, 0x0069, 0x0078, 0x0078, 0x0069, 0x2190, 0x0338, 0x2192, 0x0338,
+ 0x2194, 0x0338, 0x21D0, 0x0338, 0x21D4, 0x0338, 0x21D2, 0x0338, 0x2223, 0x0338, 0x2225, 0x0338, 0x222B, 0x222B, 0x222E, 0x222E,
+ 0x223C, 0x0338, 0x2243, 0x0338, 0x2245, 0x0338, 0x2248, 0x0338, 0x003D, 0x002F, 0x2261, 0x002F, 0x224D, 0x002F, 0x003C, 0x002F,
+ 0x003E, 0x002F, 0x2264, 0x002F, 0x2265, 0x002F, 0x2272, 0x002F, 0x2273, 0x002F, 0x2276, 0x002F, 0x2277, 0x002F, 0x227A, 0x002F,
+ 0x227B, 0x002F, 0x2282, 0x002F, 0x2283, 0x002F, 0x2286, 0x002F, 0x2287, 0x002F, 0x22A2, 0x002F, 0x22A8, 0x002F, 0x22A9, 0x002F,
+ 0x22AB, 0x002F, 0x227C, 0x002F, 0x227D, 0x002F, 0x2291, 0x002F, 0x2292, 0x002F, 0x22B2, 0x002F, 0x22B3, 0x002F, 0x22B4, 0x002F,
+ 0x22B5, 0x002F, 0x0042, 0x0053, 0x0048, 0x0054, 0x004C, 0x0046, 0x0056, 0x0054, 0x0046, 0x0046, 0x0043, 0x0052, 0x0053, 0x0053,
+ 0x0053, 0x0049, 0x0045, 0x004D, 0x0046, 0x0053, 0x0047, 0x0053, 0x0052, 0x0053, 0x0055, 0x0053, 0x0053, 0x0050, 0x0031, 0x0030,
+ 0x0031, 0x0031, 0x0031, 0x0032, 0x0031, 0x0033, 0x0031, 0x0034, 0x0031, 0x0035, 0x0031, 0x0036, 0x0031, 0x0037, 0x0031, 0x0038,
+ 0x0031, 0x0039, 0x0032, 0x0030, 0x0031, 0x002E, 0x0032, 0x002E, 0x0033, 0x002E, 0x0034, 0x002E, 0x0035, 0x002E, 0x0036, 0x002E,
+ 0x0037, 0x002E, 0x0038, 0x002E, 0x0039, 0x002E, 0x0031, 0x0031, 0x0031, 0x0032, 0x0031, 0x0033, 0x0031, 0x0034, 0x0031, 0x0035,
+ 0x0031, 0x0036, 0x0031, 0x0037, 0x0031, 0x0038, 0x0031, 0x0039, 0x0032, 0x0030, 0x0031, 0x0030, 0x0031, 0x0030, 0x0031, 0x0030,
+ 0x0031, 0x0030, 0x003D, 0x003D, 0x2ADD, 0x002F, 0x304B, 0x3099, 0x304D, 0x3099, 0x304F, 0x3099, 0x3051, 0x3099, 0x3053, 0x3099,
+ 0x3055, 0x3099, 0x3057, 0x3099, 0x3059, 0x3099, 0x305B, 0x3099, 0x305D, 0x3099, 0x305F, 0x3099, 0x3061, 0x3099, 0x3064, 0x3099,
+ 0x3066, 0x3099, 0x3068, 0x3099, 0x306F, 0x3099, 0x306F, 0x309A, 0x3072, 0x3099, 0x3072, 0x309A, 0x3075, 0x3099, 0x3075, 0x309A,
+ 0x3078, 0x3099, 0x3078, 0x309A, 0x307B, 0x3099, 0x307B, 0x309A, 0x3046, 0x3099, 0x0020, 0x3099, 0x0020, 0x309A, 0x309D, 0x3099,
+ 0x3088, 0x308A, 0x30AB, 0x3099, 0x30AD, 0x3099, 0x30AF, 0x3099, 0x30B1, 0x3099, 0x30B3, 0x3099, 0x30B5, 0x3099, 0x30B7, 0x3099,
+ 0x30B9, 0x3099, 0x30BB, 0x3099, 0x30BD, 0x3099, 0x30BF, 0x3099, 0x30C1, 0x3099, 0x30C4, 0x3099, 0x30C6, 0x3099, 0x30C8, 0x3099,
+ 0x30CF, 0x3099, 0x30CF, 0x309A, 0x30D2, 0x3099, 0x30D2, 0x309A, 0x30D5, 0x3099, 0x30D5, 0x309A, 0x30D8, 0x3099, 0x30D8, 0x309A,
+ 0x30DB, 0x3099, 0x30DB, 0x309A, 0x30A6, 0x3099, 0x30EF, 0x3099, 0x30F0, 0x3099, 0x30F1, 0x3099, 0x30F2, 0x3099, 0x30FD, 0x3099,
+ 0x30B3, 0x30C8, 0x0032, 0x0031, 0x0032, 0x0032, 0x0032, 0x0033, 0x0032, 0x0034, 0x0032, 0x0035, 0x0032, 0x0036, 0x0032, 0x0037,
+ 0x0032, 0x0038, 0x0032, 0x0039, 0x0033, 0x0030, 0x0033, 0x0031, 0x0033, 0x0032, 0x0033, 0x0033, 0x0033, 0x0034, 0x0033, 0x0035,
+ 0x1100, 0x1161, 0x1102, 0x1161, 0x1103, 0x1161, 0x1105, 0x1161, 0x1106, 0x1161, 0x1107, 0x1161, 0x1109, 0x1161, 0x110B, 0x1161,
+ 0x110C, 0x1161, 0x110E, 0x1161, 0x110F, 0x1161, 0x1110, 0x1161, 0x1111, 0x1161, 0x1112, 0x1161, 0x110B, 0x116E, 0x0033, 0x0036,
+ 0x0033, 0x0037, 0x0033, 0x0038, 0x0033, 0x0039, 0x0034, 0x0030, 0x0034, 0x0031, 0x0034, 0x0032, 0x0034, 0x0033, 0x0034, 0x0034,
+ 0x0034, 0x0035, 0x0034, 0x0036, 0x0034, 0x0037, 0x0034, 0x0038, 0x0034, 0x0039, 0x0035, 0x0030, 0x0031, 0x6708, 0x0032, 0x6708,
+ 0x0033, 0x6708, 0x0034, 0x6708, 0x0035, 0x6708, 0x0036, 0x6708, 0x0037, 0x6708, 0x0038, 0x6708, 0x0039, 0x6708, 0x0048, 0x0067,
+ 0x0065, 0x0056, 0x30AE, 0x30AC, 0x30AD, 0x30ED, 0x30C7, 0x30B7, 0x30C9, 0x30EB, 0x30C8, 0x30F3, 0x30CA, 0x30CE, 0x30D4, 0x30B3,
+ 0x30D3, 0x30EB, 0x30DA, 0x30BD, 0x30DB, 0x30F3, 0x30DF, 0x30EA, 0x30E1, 0x30AC, 0x30EA, 0x30E9, 0x30EC, 0x30E0, 0x0030, 0x70B9,
+ 0x0031, 0x70B9, 0x0032, 0x70B9, 0x0033, 0x70B9, 0x0034, 0x70B9, 0x0035, 0x70B9, 0x0036, 0x70B9, 0x0037, 0x70B9, 0x0038, 0x70B9,
+ 0x0039, 0x70B9, 0x0064, 0x0061, 0x0041, 0x0055, 0x006F, 0x0056, 0x0070, 0x0063, 0x0064, 0x006D, 0x0049, 0x0055, 0x5E73, 0x6210,
+ 0x662D, 0x548C, 0x5927, 0x6B63, 0x660E, 0x6CBB, 0x0070, 0x0041, 0x006E, 0x0041, 0x03BC, 0x0041, 0x006D, 0x0041, 0x006B, 0x0041,
+ 0x004B, 0x0042, 0x004D, 0x0042, 0x0047, 0x0042, 0x0070, 0x0046, 0x006E, 0x0046, 0x03BC, 0x0046, 0x03BC, 0x0067, 0x006D, 0x0067,
+ 0x006B, 0x0067, 0x0048, 0x007A, 0x03BC, 0x2113, 0x006D, 0x2113, 0x0064, 0x2113, 0x006B, 0x2113, 0x0066, 0x006D, 0x006E, 0x006D,
+ 0x03BC, 0x006D, 0x006D, 0x006D, 0x0063, 0x006D, 0x006B, 0x006D, 0x006D, 0x00B2, 0x006D, 0x00B3, 0x0050, 0x0061, 0x0070, 0x0073,
+ 0x006E, 0x0073, 0x03BC, 0x0073, 0x006D, 0x0073, 0x0070, 0x0056, 0x006E, 0x0056, 0x03BC, 0x0056, 0x006D, 0x0056, 0x006B, 0x0056,
+ 0x004D, 0x0056, 0x0070, 0x0057, 0x006E, 0x0057, 0x03BC, 0x0057, 0x006D, 0x0057, 0x006B, 0x0057, 0x004D, 0x0057, 0x006B, 0x03A9,
+ 0x004D, 0x03A9, 0x0042, 0x0071, 0x0063, 0x0063, 0x0063, 0x0064, 0x0064, 0x0042, 0x0047, 0x0079, 0x0068, 0x0061, 0x0048, 0x0050,
+ 0x0069, 0x006E, 0x004B, 0x004B, 0x004B, 0x004D, 0x006B, 0x0074, 0x006C, 0x006D, 0x006C, 0x006E, 0x006C, 0x0078, 0x006D, 0x0062,
+ 0x0050, 0x0048, 0x0050, 0x0052, 0x0073, 0x0072, 0x0053, 0x0076, 0x0057, 0x0062, 0x0031, 0x65E5, 0x0032, 0x65E5, 0x0033, 0x65E5,
+ 0x0034, 0x65E5, 0x0035, 0x65E5, 0x0036, 0x65E5, 0x0037, 0x65E5, 0x0038, 0x65E5, 0x0039, 0x65E5, 0x0066, 0x0066, 0x0066, 0x0069,
+ 0x0066, 0x006C, 0x017F, 0x0074, 0x0073, 0x0074, 0x0574, 0x0576, 0x0574, 0x0565, 0x0574, 0x056B, 0x057E, 0x0576, 0x0574, 0x056D,
+ 0x05D9, 0x05B4, 0x05F2, 0x05B7, 0x05E9, 0x05C1, 0x05E9, 0x05C2, 0xFB49, 0x05C1, 0xFB49, 0x05C2, 0x05D0, 0x05B7, 0x05D0, 0x05B8,
+ 0x05D0, 0x05BC, 0x05D1, 0x05BC, 0x05D2, 0x05BC, 0x05D3, 0x05BC, 0x05D4, 0x05BC, 0x05D5, 0x05BC, 0x05D6, 0x05BC, 0x05D8, 0x05BC,
+ 0x05D9, 0x05BC, 0x05DA, 0x05BC, 0x05DB, 0x05BC, 0x05DC, 0x05BC, 0x05DE, 0x05BC, 0x05E0, 0x05BC, 0x05E1, 0x05BC, 0x05E3, 0x05BC,
+ 0x05E4, 0x05BC, 0x05E6, 0x05BC, 0x05E7, 0x05BC, 0x05E8, 0x05BC, 0x05E9, 0x05BC, 0x05EA, 0x05BC, 0x05D5, 0x05B9, 0x05D1, 0x05BF,
+ 0x05DB, 0x05BF, 0x05E4, 0x05BF, 0x05D0, 0x05DC, 0x0626, 0x0627, 0x0626, 0x0627, 0x0626, 0x06D5, 0x0626, 0x06D5, 0x0626, 0x0648,
+ 0x0626, 0x0648, 0x0626, 0x06C7, 0x0626, 0x06C7, 0x0626, 0x06C6, 0x0626, 0x06C6, 0x0626, 0x06C8, 0x0626, 0x06C8, 0x0626, 0x06D0,
+ 0x0626, 0x06D0, 0x0626, 0x06D0, 0x0626, 0x0649, 0x0626, 0x0649, 0x0626, 0x0649, 0x0626, 0x062C, 0x0626, 0x062D, 0x0626, 0x0645,
+ 0x0626, 0x0649, 0x0626, 0x064A, 0x0628, 0x062C, 0x0628, 0x062D, 0x0628, 0x062E, 0x0628, 0x0645, 0x0628, 0x0649, 0x0628, 0x064A,
+ 0x062A, 0x062C, 0x062A, 0x062D, 0x062A, 0x062E, 0x062A, 0x0645, 0x062A, 0x0649, 0x062A, 0x064A, 0x062B, 0x062C, 0x062B, 0x0645,
+ 0x062B, 0x0649, 0x062B, 0x064A, 0x062C, 0x062D, 0x062C, 0x0645, 0x062D, 0x062C, 0x062D, 0x0645, 0x062E, 0x062C, 0x062E, 0x062D,
+ 0x062E, 0x0645, 0x0633, 0x062C, 0x0633, 0x062D, 0x0633, 0x062E, 0x0633, 0x0645, 0x0635, 0x062D, 0x0635, 0x0645, 0x0636, 0x062C,
+ 0x0636, 0x062D, 0x0636, 0x062E, 0x0636, 0x0645, 0x0637, 0x062D, 0x0637, 0x0645, 0x0638, 0x0645, 0x0639, 0x062C, 0x0639, 0x0645,
+ 0x063A, 0x062C, 0x063A, 0x0645, 0x0641, 0x062C, 0x0641, 0x062D, 0x0641, 0x062E, 0x0641, 0x0645, 0x0641, 0x0649, 0x0641, 0x064A,
+ 0x0642, 0x062D, 0x0642, 0x0645, 0x0642, 0x0649, 0x0642, 0x064A, 0x0643, 0x0627, 0x0643, 0x062C, 0x0643, 0x062D, 0x0643, 0x062E,
+ 0x0643, 0x0644, 0x0643, 0x0645, 0x0643, 0x0649, 0x0643, 0x064A, 0x0644, 0x062C, 0x0644, 0x062D, 0x0644, 0x062E, 0x0644, 0x0645,
+ 0x0644, 0x0649, 0x0644, 0x064A, 0x0645, 0x062C, 0x0645, 0x062D, 0x0645, 0x062E, 0x0645, 0x0645, 0x0645, 0x0649, 0x0645, 0x064A,
+ 0x0646, 0x062C, 0x0646, 0x062D, 0x0646, 0x062E, 0x0646, 0x0645, 0x0646, 0x0649, 0x0646, 0x064A, 0x0647, 0x062C, 0x0647, 0x0645,
+ 0x0647, 0x0649, 0x0647, 0x064A, 0x064A, 0x062C, 0x064A, 0x062D, 0x064A, 0x062E, 0x064A, 0x0645, 0x064A, 0x0649, 0x064A, 0x064A,
+ 0x0630, 0x0670, 0x0631, 0x0670, 0x0649, 0x0670, 0x064C, 0x0651, 0x064D, 0x0651, 0x064E, 0x0651, 0x064F, 0x0651, 0x0650, 0x0651,
+ 0x0651, 0x0670, 0x0626, 0x0631, 0x0626, 0x0632, 0x0626, 0x0645, 0x0626, 0x0646, 0x0626, 0x0649, 0x0626, 0x064A, 0x0628, 0x0631,
+ 0x0628, 0x0632, 0x0628, 0x0645, 0x0628, 0x0646, 0x0628, 0x0649, 0x0628, 0x064A, 0x062A, 0x0631, 0x062A, 0x0632, 0x062A, 0x0645,
+ 0x062A, 0x0646, 0x062A, 0x0649, 0x062A, 0x064A, 0x062B, 0x0631, 0x062B, 0x0632, 0x062B, 0x0645, 0x062B, 0x0646, 0x062B, 0x0649,
+ 0x062B, 0x064A, 0x0641, 0x0649, 0x0641, 0x064A, 0x0642, 0x0649, 0x0642, 0x064A, 0x0643, 0x0627, 0x0643, 0x0644, 0x0643, 0x0645,
+ 0x0643, 0x0649, 0x0643, 0x064A, 0x0644, 0x0645, 0x0644, 0x0649, 0x0644, 0x064A, 0x0645, 0x0627, 0x0645, 0x0645, 0x0646, 0x0631,
+ 0x0646, 0x0632, 0x0646, 0x0645, 0x0646, 0x0646, 0x0646, 0x0649, 0x0646, 0x064A, 0x0649, 0x0670, 0x064A, 0x0631, 0x064A, 0x0632,
+ 0x064A, 0x0645, 0x064A, 0x0646, 0x064A, 0x0649, 0x064A, 0x064A, 0x0626, 0x062C, 0x0626, 0x062D, 0x0626, 0x062E, 0x0626, 0x0645,
+ 0x0626, 0x0647, 0x0628, 0x062C, 0x0628, 0x062D, 0x0628, 0x062E, 0x0628, 0x0645, 0x0628, 0x0647, 0x062A, 0x062C, 0x062A, 0x062D,
+ 0x062A, 0x062E, 0x062A, 0x0645, 0x062A, 0x0647, 0x062B, 0x0645, 0x062C, 0x062D, 0x062C, 0x0645, 0x062D, 0x062C, 0x062D, 0x0645,
+ 0x062E, 0x062C, 0x062E, 0x0645, 0x0633, 0x062C, 0x0633, 0x062D, 0x0633, 0x062E, 0x0633, 0x0645, 0x0635, 0x062D, 0x0635, 0x062E,
+ 0x0635, 0x0645, 0x0636, 0x062C, 0x0636, 0x062D, 0x0636, 0x062E, 0x0636, 0x0645, 0x0637, 0x062D, 0x0638, 0x0645, 0x0639, 0x062C,
+ 0x0639, 0x0645, 0x063A, 0x062C, 0x063A, 0x0645, 0x0641, 0x062C, 0x0641, 0x062D, 0x0641, 0x062E, 0x0641, 0x0645, 0x0642, 0x062D,
+ 0x0642, 0x0645, 0x0643, 0x062C, 0x0643, 0x062D, 0x0643, 0x062E, 0x0643, 0x0644, 0x0643, 0x0645, 0x0644, 0x062C, 0x0644, 0x062D,
+ 0x0644, 0x062E, 0x0644, 0x0645, 0x0644, 0x0647, 0x0645, 0x062C, 0x0645, 0x062D, 0x0645, 0x062E, 0x0645, 0x0645, 0x0646, 0x062C,
+ 0x0646, 0x062D, 0x0646, 0x062E, 0x0646, 0x0645, 0x0646, 0x0647, 0x0647, 0x062C, 0x0647, 0x0645, 0x0647, 0x0670, 0x064A, 0x062C,
+ 0x064A, 0x062D, 0x064A, 0x062E, 0x064A, 0x0645, 0x064A, 0x0647, 0x0626, 0x0645, 0x0626, 0x0647, 0x0628, 0x0645, 0x0628, 0x0647,
+ 0x062A, 0x0645, 0x062A, 0x0647, 0x062B, 0x0645, 0x062B, 0x0647, 0x0633, 0x0645, 0x0633, 0x0647, 0x0634, 0x0645, 0x0634, 0x0647,
+ 0x0643, 0x0644, 0x0643, 0x0645, 0x0644, 0x0645, 0x0646, 0x0645, 0x0646, 0x0647, 0x064A, 0x0645, 0x064A, 0x0647, 0x0637, 0x0649,
+ 0x0637, 0x064A, 0x0639, 0x0649, 0x0639, 0x064A, 0x063A, 0x0649, 0x063A, 0x064A, 0x0633, 0x0649, 0x0633, 0x064A, 0x0634, 0x0649,
+ 0x0634, 0x064A, 0x062D, 0x0649, 0x062D, 0x064A, 0x062C, 0x0649, 0x062C, 0x064A, 0x062E, 0x0649, 0x062E, 0x064A, 0x0635, 0x0649,
+ 0x0635, 0x064A, 0x0636, 0x0649, 0x0636, 0x064A, 0x0634, 0x062C, 0x0634, 0x062D, 0x0634, 0x062E, 0x0634, 0x0645, 0x0634, 0x0631,
+ 0x0633, 0x0631, 0x0635, 0x0631, 0x0636, 0x0631, 0x0637, 0x0649, 0x0637, 0x064A, 0x0639, 0x0649, 0x0639, 0x064A, 0x063A, 0x0649,
+ 0x063A, 0x064A, 0x0633, 0x0649, 0x0633, 0x064A, 0x0634, 0x0649, 0x0634, 0x064A, 0x062D, 0x0649, 0x062D, 0x064A, 0x062C, 0x0649,
+ 0x062C, 0x064A, 0x062E, 0x0649, 0x062E, 0x064A, 0x0635, 0x0649, 0x0635, 0x064A, 0x0636, 0x0649, 0x0636, 0x064A, 0x0634, 0x062C,
+ 0x0634, 0x062D, 0x0634, 0x062E, 0x0634, 0x0645, 0x0634, 0x0631, 0x0633, 0x0631, 0x0635, 0x0631, 0x0636, 0x0631, 0x0634, 0x062C,
+ 0x0634, 0x062D, 0x0634, 0x062E, 0x0634, 0x0645, 0x0633, 0x0647, 0x0634, 0x0647, 0x0637, 0x0645, 0x0633, 0x062C, 0x0633, 0x062D,
+ 0x0633, 0x062E, 0x0634, 0x062C, 0x0634, 0x062D, 0x0634, 0x062E, 0x0637, 0x0645, 0x0638, 0x0645, 0x0627, 0x064B, 0x0627, 0x064B,
+ 0x0640, 0x064B, 0x0640, 0x064E, 0x0640, 0x064F, 0x0640, 0x0650, 0x0640, 0x0651, 0x0640, 0x0652, 0x0644, 0x0622, 0x0644, 0x0622,
+ 0x0644, 0x0623, 0x0644, 0x0623, 0x0644, 0x0625, 0x0644, 0x0625, 0x0644, 0x0627, 0x0644, 0x0627
+};
+extern const FX_WCHAR g_UnicodeData_Normalization_Map3[1164] = {
+ 0x0031, 0x002F, 0x0034, 0x0031, 0x002F, 0x0032, 0x0033, 0x002F, 0x0034, 0x002E, 0x002E, 0x002E, 0x2032, 0x2032, 0x2032, 0x2035,
+ 0x2035, 0x2035, 0x0061, 0x002F, 0x0063, 0x0061, 0x002F, 0x0073, 0x0063, 0x002F, 0x006F, 0x0063, 0x002F, 0x0075, 0x0054, 0x0045,
+ 0x004C, 0x0046, 0x0041, 0x0058, 0x0031, 0x002F, 0x0037, 0x0031, 0x002F, 0x0039, 0x0031, 0x002F, 0x0033, 0x0032, 0x002F, 0x0033,
+ 0x0031, 0x002F, 0x0035, 0x0032, 0x002F, 0x0035, 0x0033, 0x002F, 0x0035, 0x0034, 0x002F, 0x0035, 0x0031, 0x002F, 0x0036, 0x0035,
+ 0x002F, 0x0036, 0x0031, 0x002F, 0x0038, 0x0033, 0x002F, 0x0038, 0x0035, 0x002F, 0x0038, 0x0037, 0x002F, 0x0038, 0x0049, 0x0049,
+ 0x0049, 0x0056, 0x0049, 0x0049, 0x0058, 0x0049, 0x0049, 0x0069, 0x0069, 0x0069, 0x0076, 0x0069, 0x0069, 0x0078, 0x0069, 0x0069,
+ 0x0030, 0x2044, 0x0033, 0x222B, 0x222B, 0x222B, 0x222E, 0x222E, 0x222E, 0x004E, 0x0055, 0x004C, 0x0053, 0x004F, 0x0048, 0x0053,
+ 0x0054, 0x0058, 0x0045, 0x0054, 0x0058, 0x0045, 0x004F, 0x0054, 0x0045, 0x004E, 0x0051, 0x0041, 0x0043, 0x004B, 0x0042, 0x0045,
+ 0x004C, 0x0044, 0x004C, 0x0045, 0x0044, 0x0043, 0x0031, 0x0044, 0x0043, 0x0032, 0x0044, 0x0043, 0x0033, 0x0044, 0x0043, 0x0034,
+ 0x004E, 0x0041, 0x004B, 0x0053, 0x0059, 0x004E, 0x0045, 0x0054, 0x0042, 0x0043, 0x0041, 0x004E, 0x0053, 0x0055, 0x0042, 0x0045,
+ 0x0053, 0x0043, 0x0044, 0x0045, 0x004C, 0x0028, 0x0031, 0x0029, 0x0028, 0x0032, 0x0029, 0x0028, 0x0033, 0x0029, 0x0028, 0x0034,
+ 0x0029, 0x0028, 0x0035, 0x0029, 0x0028, 0x0036, 0x0029, 0x0028, 0x0037, 0x0029, 0x0028, 0x0038, 0x0029, 0x0028, 0x0039, 0x0029,
+ 0x0031, 0x0030, 0x002E, 0x0031, 0x0031, 0x002E, 0x0031, 0x0032, 0x002E, 0x0031, 0x0033, 0x002E, 0x0031, 0x0034, 0x002E, 0x0031,
+ 0x0035, 0x002E, 0x0031, 0x0036, 0x002E, 0x0031, 0x0037, 0x002E, 0x0031, 0x0038, 0x002E, 0x0031, 0x0039, 0x002E, 0x0032, 0x0030,
+ 0x002E, 0x0028, 0x0061, 0x0029, 0x0028, 0x0062, 0x0029, 0x0028, 0x0063, 0x0029, 0x0028, 0x0064, 0x0029, 0x0028, 0x0065, 0x0029,
+ 0x0028, 0x0066, 0x0029, 0x0028, 0x0067, 0x0029, 0x0028, 0x0068, 0x0029, 0x0028, 0x0069, 0x0029, 0x0028, 0x006A, 0x0029, 0x0028,
+ 0x006B, 0x0029, 0x0028, 0x006C, 0x0029, 0x0028, 0x006D, 0x0029, 0x0028, 0x006E, 0x0029, 0x0028, 0x006F, 0x0029, 0x0028, 0x0070,
+ 0x0029, 0x0028, 0x0071, 0x0029, 0x0028, 0x0072, 0x0029, 0x0028, 0x0073, 0x0029, 0x0028, 0x0074, 0x0029, 0x0028, 0x0075, 0x0029,
+ 0x0028, 0x0076, 0x0029, 0x0028, 0x0077, 0x0029, 0x0028, 0x0078, 0x0029, 0x0028, 0x0079, 0x0029, 0x0028, 0x007A, 0x0029, 0x003A,
+ 0x003A, 0x003D, 0x003D, 0x003D, 0x003D, 0x0028, 0x1100, 0x0029, 0x0028, 0x1102, 0x0029, 0x0028, 0x1103, 0x0029, 0x0028, 0x1105,
+ 0x0029, 0x0028, 0x1106, 0x0029, 0x0028, 0x1107, 0x0029, 0x0028, 0x1109, 0x0029, 0x0028, 0x110B, 0x0029, 0x0028, 0x110C, 0x0029,
+ 0x0028, 0x110E, 0x0029, 0x0028, 0x110F, 0x0029, 0x0028, 0x1110, 0x0029, 0x0028, 0x1111, 0x0029, 0x0028, 0x1112, 0x0029, 0x0028,
+ 0x4E00, 0x0029, 0x0028, 0x4E8C, 0x0029, 0x0028, 0x4E09, 0x0029, 0x0028, 0x56DB, 0x0029, 0x0028, 0x4E94, 0x0029, 0x0028, 0x516D,
+ 0x0029, 0x0028, 0x4E03, 0x0029, 0x0028, 0x516B, 0x0029, 0x0028, 0x4E5D, 0x0029, 0x0028, 0x5341, 0x0029, 0x0028, 0x6708, 0x0029,
+ 0x0028, 0x706B, 0x0029, 0x0028, 0x6C34, 0x0029, 0x0028, 0x6728, 0x0029, 0x0028, 0x91D1, 0x0029, 0x0028, 0x571F, 0x0029, 0x0028,
+ 0x65E5, 0x0029, 0x0028, 0x682A, 0x0029, 0x0028, 0x6709, 0x0029, 0x0028, 0x793E, 0x0029, 0x0028, 0x540D, 0x0029, 0x0028, 0x7279,
+ 0x0029, 0x0028, 0x8CA1, 0x0029, 0x0028, 0x795D, 0x0029, 0x0028, 0x52B4, 0x0029, 0x0028, 0x4EE3, 0x0029, 0x0028, 0x547C, 0x0029,
+ 0x0028, 0x5B66, 0x0029, 0x0028, 0x76E3, 0x0029, 0x0028, 0x4F01, 0x0029, 0x0028, 0x8CC7, 0x0029, 0x0028, 0x5354, 0x0029, 0x0028,
+ 0x796D, 0x0029, 0x0028, 0x4F11, 0x0029, 0x0028, 0x81EA, 0x0029, 0x0028, 0x81F3, 0x0029, 0x0050, 0x0054, 0x0045, 0x0031, 0x0030,
+ 0x6708, 0x0031, 0x0031, 0x6708, 0x0031, 0x0032, 0x6708, 0x0065, 0x0072, 0x0067, 0x004C, 0x0054, 0x0044, 0x30A2, 0x30FC, 0x30EB,
+ 0x30A4, 0x30F3, 0x30C1, 0x30A6, 0x30A9, 0x30F3, 0x30AA, 0x30F3, 0x30B9, 0x30AA, 0x30FC, 0x30E0, 0x30AB, 0x30A4, 0x30EA, 0x30AC,
+ 0x30ED, 0x30F3, 0x30AC, 0x30F3, 0x30DE, 0x30AE, 0x30CB, 0x30FC, 0x30B0, 0x30E9, 0x30E0, 0x30B1, 0x30FC, 0x30B9, 0x30B3, 0x30EB,
+ 0x30CA, 0x30B3, 0x30FC, 0x30DD, 0x30BB, 0x30F3, 0x30C1, 0x30BB, 0x30F3, 0x30C8, 0x30C0, 0x30FC, 0x30B9, 0x30CE, 0x30C3, 0x30C8,
+ 0x30CF, 0x30A4, 0x30C4, 0x30D1, 0x30FC, 0x30C4, 0x30D4, 0x30AF, 0x30EB, 0x30D5, 0x30E9, 0x30F3, 0x30DA, 0x30CB, 0x30D2, 0x30D8,
+ 0x30EB, 0x30C4, 0x30DA, 0x30F3, 0x30B9, 0x30DA, 0x30FC, 0x30B8, 0x30D9, 0x30FC, 0x30BF, 0x30DC, 0x30EB, 0x30C8, 0x30DD, 0x30F3,
+ 0x30C9, 0x30DB, 0x30FC, 0x30EB, 0x30DB, 0x30FC, 0x30F3, 0x30DE, 0x30A4, 0x30EB, 0x30DE, 0x30C3, 0x30CF, 0x30DE, 0x30EB, 0x30AF,
+ 0x30E4, 0x30FC, 0x30C9, 0x30E4, 0x30FC, 0x30EB, 0x30E6, 0x30A2, 0x30F3, 0x30EB, 0x30D4, 0x30FC, 0x30EF, 0x30C3, 0x30C8, 0x0031,
+ 0x0030, 0x70B9, 0x0031, 0x0031, 0x70B9, 0x0031, 0x0032, 0x70B9, 0x0031, 0x0033, 0x70B9, 0x0031, 0x0034, 0x70B9, 0x0031, 0x0035,
+ 0x70B9, 0x0031, 0x0036, 0x70B9, 0x0031, 0x0037, 0x70B9, 0x0031, 0x0038, 0x70B9, 0x0031, 0x0039, 0x70B9, 0x0032, 0x0030, 0x70B9,
+ 0x0032, 0x0031, 0x70B9, 0x0032, 0x0032, 0x70B9, 0x0032, 0x0033, 0x70B9, 0x0032, 0x0034, 0x70B9, 0x0068, 0x0050, 0x0061, 0x0062,
+ 0x0061, 0x0072, 0x0064, 0x006D, 0x00B2, 0x0064, 0x006D, 0x00B3, 0x0063, 0x0061, 0x006C, 0x006B, 0x0048, 0x007A, 0x004D, 0x0048,
+ 0x007A, 0x0047, 0x0048, 0x007A, 0x0054, 0x0048, 0x007A, 0x006D, 0x006D, 0x00B2, 0x0063, 0x006D, 0x00B2, 0x006B, 0x006D, 0x00B2,
+ 0x006D, 0x006D, 0x00B3, 0x0063, 0x006D, 0x00B3, 0x006B, 0x006D, 0x00B3, 0x006D, 0x2215, 0x0073, 0x006B, 0x0050, 0x0061, 0x004D,
+ 0x0050, 0x0061, 0x0047, 0x0050, 0x0061, 0x0072, 0x0061, 0x0064, 0x0043, 0x006F, 0x002E, 0x006C, 0x006F, 0x0067, 0x006D, 0x0069,
+ 0x006C, 0x006D, 0x006F, 0x006C, 0x0050, 0x0050, 0x004D, 0x0056, 0x2215, 0x006D, 0x0041, 0x2215, 0x006D, 0x0031, 0x0030, 0x65E5,
+ 0x0031, 0x0031, 0x65E5, 0x0031, 0x0032, 0x65E5, 0x0031, 0x0033, 0x65E5, 0x0031, 0x0034, 0x65E5, 0x0031, 0x0035, 0x65E5, 0x0031,
+ 0x0036, 0x65E5, 0x0031, 0x0037, 0x65E5, 0x0031, 0x0038, 0x65E5, 0x0031, 0x0039, 0x65E5, 0x0032, 0x0030, 0x65E5, 0x0032, 0x0031,
+ 0x65E5, 0x0032, 0x0032, 0x65E5, 0x0032, 0x0033, 0x65E5, 0x0032, 0x0034, 0x65E5, 0x0032, 0x0035, 0x65E5, 0x0032, 0x0036, 0x65E5,
+ 0x0032, 0x0037, 0x65E5, 0x0032, 0x0038, 0x65E5, 0x0032, 0x0039, 0x65E5, 0x0033, 0x0030, 0x65E5, 0x0033, 0x0031, 0x65E5, 0x0067,
+ 0x0061, 0x006C, 0x0066, 0x0066, 0x0069, 0x0066, 0x0066, 0x006C, 0x0640, 0x064E, 0x0651, 0x0640, 0x064F, 0x0651, 0x0640, 0x0650,
+ 0x0651, 0x062A, 0x062C, 0x0645, 0x062A, 0x062D, 0x062C, 0x062A, 0x062D, 0x062C, 0x062A, 0x062D, 0x0645, 0x062A, 0x062E, 0x0645,
+ 0x062A, 0x0645, 0x062C, 0x062A, 0x0645, 0x062D, 0x062A, 0x0645, 0x062E, 0x062C, 0x0645, 0x062D, 0x062C, 0x0645, 0x062D, 0x062D,
+ 0x0645, 0x064A, 0x062D, 0x0645, 0x0649, 0x0633, 0x062D, 0x062C, 0x0633, 0x062C, 0x062D, 0x0633, 0x062C, 0x0649, 0x0633, 0x0645,
+ 0x062D, 0x0633, 0x0645, 0x062D, 0x0633, 0x0645, 0x062C, 0x0633, 0x0645, 0x0645, 0x0633, 0x0645, 0x0645, 0x0635, 0x062D, 0x062D,
+ 0x0635, 0x062D, 0x062D, 0x0635, 0x0645, 0x0645, 0x0634, 0x062D, 0x0645, 0x0634, 0x062D, 0x0645, 0x0634, 0x062C, 0x064A, 0x0634,
+ 0x0645, 0x062E, 0x0634, 0x0645, 0x062E, 0x0634, 0x0645, 0x0645, 0x0634, 0x0645, 0x0645, 0x0636, 0x062D, 0x0649, 0x0636, 0x062E,
+ 0x0645, 0x0636, 0x062E, 0x0645, 0x0637, 0x0645, 0x062D, 0x0637, 0x0645, 0x062D, 0x0637, 0x0645, 0x0645, 0x0637, 0x0645, 0x064A,
+ 0x0639, 0x062C, 0x0645, 0x0639, 0x0645, 0x0645, 0x0639, 0x0645, 0x0645, 0x0639, 0x0645, 0x0649, 0x063A, 0x0645, 0x0645, 0x063A,
+ 0x0645, 0x064A, 0x063A, 0x0645, 0x0649, 0x0641, 0x062E, 0x0645, 0x0641, 0x062E, 0x0645, 0x0642, 0x0645, 0x062D, 0x0642, 0x0645,
+ 0x0645, 0x0644, 0x062D, 0x0645, 0x0644, 0x062D, 0x064A, 0x0644, 0x062D, 0x0649, 0x0644, 0x062C, 0x062C, 0x0644, 0x062C, 0x062C,
+ 0x0644, 0x062E, 0x0645, 0x0644, 0x062E, 0x0645, 0x0644, 0x0645, 0x062D, 0x0644, 0x0645, 0x062D, 0x0645, 0x062D, 0x062C, 0x0645,
+ 0x062D, 0x0645, 0x0645, 0x062D, 0x064A, 0x0645, 0x062C, 0x062D, 0x0645, 0x062C, 0x0645, 0x0645, 0x062E, 0x062C, 0x0645, 0x062E,
+ 0x0645, 0x0645, 0x062C, 0x062E, 0x0647, 0x0645, 0x062C, 0x0647, 0x0645, 0x0645, 0x0646, 0x062D, 0x0645, 0x0646, 0x062D, 0x0649,
+ 0x0646, 0x062C, 0x0645, 0x0646, 0x062C, 0x0645, 0x0646, 0x062C, 0x0649, 0x0646, 0x0645, 0x064A, 0x0646, 0x0645, 0x0649, 0x064A,
+ 0x0645, 0x0645, 0x064A, 0x0645, 0x0645, 0x0628, 0x062E, 0x064A, 0x062A, 0x062C, 0x064A, 0x062A, 0x062C, 0x0649, 0x062A, 0x062E,
+ 0x064A, 0x062A, 0x062E, 0x0649, 0x062A, 0x0645, 0x064A, 0x062A, 0x0645, 0x0649, 0x062C, 0x0645, 0x064A, 0x062C, 0x062D, 0x0649,
+ 0x062C, 0x0645, 0x0649, 0x0633, 0x062E, 0x0649, 0x0635, 0x062D, 0x064A, 0x0634, 0x062D, 0x064A, 0x0636, 0x062D, 0x064A, 0x0644,
+ 0x062C, 0x064A, 0x0644, 0x0645, 0x064A, 0x064A, 0x062D, 0x064A, 0x064A, 0x062C, 0x064A, 0x064A, 0x0645, 0x064A, 0x0645, 0x0645,
+ 0x064A, 0x0642, 0x0645, 0x064A, 0x0646, 0x062D, 0x064A, 0x0642, 0x0645, 0x062D, 0x0644, 0x062D, 0x0645, 0x0639, 0x0645, 0x064A,
+ 0x0643, 0x0645, 0x064A, 0x0646, 0x062C, 0x062D, 0x0645, 0x062E, 0x064A, 0x0644, 0x062C, 0x0645, 0x0643, 0x0645, 0x0645, 0x0644,
+ 0x062C, 0x0645, 0x0646, 0x062C, 0x062D, 0x062C, 0x062D, 0x064A, 0x062D, 0x062C, 0x064A, 0x0645, 0x062C, 0x064A, 0x0641, 0x0645,
+ 0x064A, 0x0628, 0x062D, 0x064A, 0x0643, 0x0645, 0x0645, 0x0639, 0x062C, 0x0645, 0x0635, 0x0645, 0x0645, 0x0633, 0x062E, 0x064A,
+ 0x0646, 0x062C, 0x064A, 0x0635, 0x0644, 0x06D2, 0x0642, 0x0644, 0x06D2, 0x0635, 0x0644, 0x0649
+};
+extern const FX_WCHAR g_UnicodeData_Normalization_Map4[488] = {
+ 0x0004, 0x2032, 0x2032, 0x2032, 0x2032, 0x0004, 0x0031, 0x002F, 0x0031, 0x0030, 0x0004, 0x0056, 0x0049, 0x0049, 0x0049, 0x0004,
+ 0x0076, 0x0069, 0x0069, 0x0069, 0x0004, 0x0028, 0x0031, 0x0030, 0x0029, 0x0004, 0x0028, 0x0031, 0x0031, 0x0029, 0x0004, 0x0028,
+ 0x0031, 0x0032, 0x0029, 0x0004, 0x0028, 0x0031, 0x0033, 0x0029, 0x0004, 0x0028, 0x0031, 0x0034, 0x0029, 0x0004, 0x0028, 0x0031,
+ 0x0035, 0x0029, 0x0004, 0x0028, 0x0031, 0x0036, 0x0029, 0x0004, 0x0028, 0x0031, 0x0037, 0x0029, 0x0004, 0x0028, 0x0031, 0x0038,
+ 0x0029, 0x0004, 0x0028, 0x0031, 0x0039, 0x0029, 0x0004, 0x0028, 0x0032, 0x0030, 0x0029, 0x0004, 0x222B, 0x222B, 0x222B, 0x222B,
+ 0x0004, 0x0028, 0x1100, 0x1161, 0x0029, 0x0004, 0x0028, 0x1102, 0x1161, 0x0029, 0x0004, 0x0028, 0x1103, 0x1161, 0x0029, 0x0004,
+ 0x0028, 0x1105, 0x1161, 0x0029, 0x0004, 0x0028, 0x1106, 0x1161, 0x0029, 0x0004, 0x0028, 0x1107, 0x1161, 0x0029, 0x0004, 0x0028,
+ 0x1109, 0x1161, 0x0029, 0x0004, 0x0028, 0x110B, 0x1161, 0x0029, 0x0004, 0x0028, 0x110C, 0x1161, 0x0029, 0x0004, 0x0028, 0x110E,
+ 0x1161, 0x0029, 0x0004, 0x0028, 0x110F, 0x1161, 0x0029, 0x0004, 0x0028, 0x1110, 0x1161, 0x0029, 0x0004, 0x0028, 0x1111, 0x1161,
+ 0x0029, 0x0004, 0x0028, 0x1112, 0x1161, 0x0029, 0x0004, 0x0028, 0x110C, 0x116E, 0x0029, 0x0007, 0x0028, 0x110B, 0x1169, 0x110C,
+ 0x1165, 0x11AB, 0x0029, 0x0006, 0x0028, 0x110B, 0x1169, 0x1112, 0x116E, 0x0029, 0x0005, 0x110E, 0x1161, 0x11B7, 0x1100, 0x1169,
+ 0x0004, 0x110C, 0x116E, 0x110B, 0x1174, 0x0004, 0x30A2, 0x30D1, 0x30FC, 0x30C8, 0x0004, 0x30A2, 0x30EB, 0x30D5, 0x30A1, 0x0004,
+ 0x30A2, 0x30F3, 0x30DA, 0x30A2, 0x0004, 0x30A4, 0x30CB, 0x30F3, 0x30B0, 0x0005, 0x30A8, 0x30B9, 0x30AF, 0x30FC, 0x30C9, 0x0004,
+ 0x30A8, 0x30FC, 0x30AB, 0x30FC, 0x0004, 0x30AB, 0x30E9, 0x30C3, 0x30C8, 0x0004, 0x30AB, 0x30ED, 0x30EA, 0x30FC, 0x0004, 0x30AD,
+ 0x30E5, 0x30EA, 0x30FC, 0x0004, 0x30AE, 0x30EB, 0x30C0, 0x30FC, 0x0005, 0x30AD, 0x30ED, 0x30B0, 0x30E9, 0x30E0, 0x0006, 0x30AD,
+ 0x30ED, 0x30E1, 0x30FC, 0x30C8, 0x30EB, 0x0005, 0x30AD, 0x30ED, 0x30EF, 0x30C3, 0x30C8, 0x0005, 0x30B0, 0x30E9, 0x30E0, 0x30C8,
+ 0x30F3, 0x0005, 0x30AF, 0x30EB, 0x30BC, 0x30A4, 0x30ED, 0x0004, 0x30AF, 0x30ED, 0x30FC, 0x30CD, 0x0004, 0x30B5, 0x30A4, 0x30AF,
+ 0x30EB, 0x0005, 0x30B5, 0x30F3, 0x30C1, 0x30FC, 0x30E0, 0x0004, 0x30B7, 0x30EA, 0x30F3, 0x30B0, 0x0005, 0x30D1, 0x30FC, 0x30BB,
+ 0x30F3, 0x30C8, 0x0004, 0x30D0, 0x30FC, 0x30EC, 0x30EB, 0x0005, 0x30D4, 0x30A2, 0x30B9, 0x30C8, 0x30EB, 0x0005, 0x30D5, 0x30A1,
+ 0x30E9, 0x30C3, 0x30C9, 0x0004, 0x30D5, 0x30A3, 0x30FC, 0x30C8, 0x0005, 0x30D6, 0x30C3, 0x30B7, 0x30A7, 0x30EB, 0x0005, 0x30D8,
+ 0x30AF, 0x30BF, 0x30FC, 0x30EB, 0x0004, 0x30DD, 0x30A4, 0x30F3, 0x30C8, 0x0004, 0x30DE, 0x30A4, 0x30AF, 0x30ED, 0x0005, 0x30DE,
+ 0x30F3, 0x30B7, 0x30E7, 0x30F3, 0x0004, 0x30DF, 0x30AF, 0x30ED, 0x30F3, 0x0005, 0x30DF, 0x30EA, 0x30D0, 0x30FC, 0x30EB, 0x0004,
+ 0x30E1, 0x30AC, 0x30C8, 0x30F3, 0x0004, 0x30E1, 0x30FC, 0x30C8, 0x30EB, 0x0004, 0x30EA, 0x30C3, 0x30C8, 0x30EB, 0x0004, 0x30EB,
+ 0x30FC, 0x30D6, 0x30EB, 0x0005, 0x30EC, 0x30F3, 0x30C8, 0x30B2, 0x30F3, 0x0004, 0x682A, 0x5F0F, 0x4F1A, 0x793E, 0x0004, 0x006B,
+ 0x0063, 0x0061, 0x006C, 0x0004, 0x006D, 0x2215, 0x0073, 0x00B2, 0x0005, 0x0072, 0x0061, 0x0064, 0x2215, 0x0073, 0x0006, 0x0072,
+ 0x0061, 0x0064, 0x2215, 0x0073, 0x00B2, 0x0004, 0x0061, 0x002E, 0x006D, 0x002E, 0x0004, 0x0043, 0x2215, 0x006B, 0x0067, 0x0004,
+ 0x0070, 0x002E, 0x006D, 0x002E, 0x0004, 0x0627, 0x0644, 0x0644, 0x0647, 0x0004, 0x0627, 0x0643, 0x0628, 0x0631, 0x0004, 0x0645,
+ 0x062D, 0x0645, 0x062F, 0x0004, 0x0635, 0x0644, 0x0639, 0x0645, 0x0004, 0x0631, 0x0633, 0x0648, 0x0644, 0x0004, 0x0639, 0x0644,
+ 0x064A, 0x0647, 0x0004, 0x0648, 0x0633, 0x0644, 0x0645, 0x0012, 0x0635, 0x0644, 0x0649, 0x0020, 0x0627, 0x0644, 0x0644, 0x0647,
+ 0x0020, 0x0639, 0x0644, 0x064A, 0x0647, 0x0020, 0x0648, 0x0633, 0x0644, 0x0645, 0x0008, 0x062C, 0x0644, 0x0020, 0x062C, 0x0644,
+ 0x0627, 0x0644, 0x0647, 0x0004, 0x0631, 0x06CC, 0x0627, 0x0644
+};
diff --git a/core/src/fx_freetype.h b/core/src/fx_freetype.h
index 7c50f68ca3..d160036042 100644
--- a/core/src/fx_freetype.h
+++ b/core/src/fx_freetype.h
@@ -1,15 +1,15 @@
-// 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 _FX_SRC_FREETYPE_H_
-#define _FX_SRC_FREETYPE_H_
-#include "./fxge/fx_freetype/fxft2.5.01/include/ft2build.h"
-#include "./fxge/fx_freetype/fxft2.5.01/include/freetype/freetype.h"
-#include "./fxge/fx_freetype/fxft2.5.01/include/freetype/ftoutln.h"
-#include "./fxge/fx_freetype/fxft2.5.01/include/freetype/ftmm.h"
-#include "./fxge/fx_freetype/fxft2.5.01/include/freetype/internal/ftobjs.h"
-#include "./fxge/fx_freetype/fxft2.5.01/include/freetype/tttables.h"
-#endif
+// 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 _FX_SRC_FREETYPE_H_
+#define _FX_SRC_FREETYPE_H_
+#include "./fxge/fx_freetype/fxft2.5.01/include/ft2build.h"
+#include "./fxge/fx_freetype/fxft2.5.01/include/freetype/freetype.h"
+#include "./fxge/fx_freetype/fxft2.5.01/include/freetype/ftoutln.h"
+#include "./fxge/fx_freetype/fxft2.5.01/include/freetype/ftmm.h"
+#include "./fxge/fx_freetype/fxft2.5.01/include/freetype/internal/ftobjs.h"
+#include "./fxge/fx_freetype/fxft2.5.01/include/freetype/tttables.h"
+#endif
diff --git a/core/src/fx_jpeglib.h b/core/src/fx_jpeglib.h
index 1ce2172328..028a5ee8b9 100644
--- a/core/src/fx_jpeglib.h
+++ b/core/src/fx_jpeglib.h
@@ -1,10 +1,10 @@
-// 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 _FX_SRC_JPEGLIB_H_
-#define _FX_SRC_JPEGLIB_H_
-#include "./fxcodec/libjpeg/jpeglib.h"
-#endif
+// 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 _FX_SRC_JPEGLIB_H_
+#define _FX_SRC_JPEGLIB_H_
+#include "./fxcodec/libjpeg/jpeglib.h"
+#endif
diff --git a/core/src/fx_zlib.h b/core/src/fx_zlib.h
index 3c6c5a8e78..cc5560bf05 100644
--- a/core/src/fx_zlib.h
+++ b/core/src/fx_zlib.h
@@ -1,10 +1,10 @@
-// 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 _FX_SRC_ZLIB_H_
-#define _FX_SRC_ZLIB_H_
-#include "./fxcodec/fx_zlib/zlib_v128/zlib.h"
-#endif
+// 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 _FX_SRC_ZLIB_H_
+#define _FX_SRC_ZLIB_H_
+#include "./fxcodec/fx_zlib/zlib_v128/zlib.h"
+#endif
diff --git a/core/src/fxcodec/codec/codec_int.h b/core/src/fxcodec/codec/codec_int.h
index 571af61470..638d96db85 100644
--- a/core/src/fxcodec/codec/codec_int.h
+++ b/core/src/fxcodec/codec/codec_int.h
@@ -1,270 +1,270 @@
-// 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
-
-#include <limits.h>
-class CCodec_BasicModule : public ICodec_BasicModule
-{
-public:
- virtual FX_BOOL RunLengthEncode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf,
- FX_DWORD& dest_size);
- virtual FX_BOOL A85Encode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf,
- FX_DWORD& dest_size);
- virtual ICodec_ScanlineDecoder* CreateRunLengthDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height,
- int nComps, int bpc);
-};
-struct CCodec_ImageDataCache {
- int m_Width, m_Height;
- int m_nCachedLines;
- FX_BYTE m_Data;
-};
-class CCodec_ScanlineDecoder : public ICodec_ScanlineDecoder
-{
-public:
-
- CCodec_ScanlineDecoder();
-
- virtual ~CCodec_ScanlineDecoder();
-
- virtual FX_DWORD GetSrcOffset()
- {
- return -1;
- }
-
- virtual void DownScale(int dest_width, int dest_height);
-
- FX_LPBYTE GetScanline(int line);
-
- FX_BOOL SkipToScanline(int line, IFX_Pause* pPause);
-
- int GetWidth()
- {
- return m_OutputWidth;
- }
-
- int GetHeight()
- {
- return m_OutputHeight;
- }
-
- int CountComps()
- {
- return m_nComps;
- }
-
- int GetBPC()
- {
- return m_bpc;
- }
-
- FX_BOOL IsColorTransformed()
- {
- return m_bColorTransformed;
- }
-
- void ClearImageData()
- {
- if (m_pDataCache) {
- FX_Free(m_pDataCache);
- }
- m_pDataCache = NULL;
- }
-protected:
-
- int m_OrigWidth;
-
- int m_OrigHeight;
-
- int m_DownScale;
-
- int m_OutputWidth;
-
- int m_OutputHeight;
-
- int m_nComps;
-
- int m_bpc;
-
- int m_Pitch;
-
- FX_BOOL m_bColorTransformed;
-
- FX_LPBYTE ReadNextLine();
-
- virtual FX_BOOL v_Rewind() = 0;
-
- virtual FX_LPBYTE v_GetNextLine() = 0;
-
- virtual void v_DownScale(int dest_width, int dest_height) = 0;
-
- int m_NextLine;
-
- FX_LPBYTE m_pLastScanline;
-
- CCodec_ImageDataCache* m_pDataCache;
-};
-class CCodec_FaxModule : public ICodec_FaxModule
-{
-public:
- virtual ICodec_ScanlineDecoder* CreateDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height,
- int K, FX_BOOL EndOfLine, FX_BOOL EncodedByteAlign, FX_BOOL BlackIs1, int Columns, int Rows);
- FX_BOOL Encode(FX_LPCBYTE src_buf, int width, int height, int pitch, FX_LPBYTE& dest_buf, FX_DWORD& dest_size);
-};
-class CCodec_FlateModule : public ICodec_FlateModule
-{
-public:
- virtual ICodec_ScanlineDecoder* CreateDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height,
- int nComps, int bpc, int predictor, int Colors, int BitsPerComponent, int Columns);
- virtual FX_DWORD FlateOrLZWDecode(FX_BOOL bLZW, const FX_BYTE* src_buf, FX_DWORD src_size, FX_BOOL bEarlyChange,
- int predictor, int Colors, int BitsPerComponent, int Columns,
- FX_DWORD estimated_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size);
- virtual FX_BOOL Encode(const FX_BYTE* src_buf, FX_DWORD src_size,
- int predictor, int Colors, int BitsPerComponent, int Columns,
- FX_LPBYTE& dest_buf, FX_DWORD& dest_size);
- virtual FX_BOOL Encode(FX_LPCBYTE src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size);
-};
-class CCodec_JpegModule : public ICodec_JpegModule
-{
-public:
- CCodec_JpegModule() : m_pExtProvider(NULL) {}
- void SetPovider(IFX_JpegProvider* pJP)
- {
- m_pExtProvider = pJP;
- }
- ICodec_ScanlineDecoder* CreateDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size,
- int width, int height, int nComps, FX_BOOL ColorTransform);
- FX_BOOL LoadInfo(FX_LPCBYTE src_buf, FX_DWORD src_size, int& width, int& height,
- int& num_components, int& bits_per_components, FX_BOOL& color_transform,
- FX_LPBYTE* icc_buf_ptr, FX_DWORD* icc_length);
- FX_BOOL Encode(const CFX_DIBSource* pSource, FX_LPBYTE& dest_buf, FX_STRSIZE& dest_size, int quality, FX_LPCBYTE icc_buf, FX_DWORD icc_length);
- virtual void* Start();
- virtual void Finish(void* pContext);
- virtual void Input(void* pContext, FX_LPCBYTE src_buf, FX_DWORD src_size);
- virtual int ReadHeader(void* pContext, int* width, int* height, int* nComps);
- virtual FX_BOOL StartScanline(void* pContext, int down_scale);
- virtual FX_BOOL ReadScanline(void* pContext, FX_LPBYTE dest_buf);
- virtual FX_DWORD GetAvailInput(void* pContext, FX_LPBYTE* avail_buf_ptr);
-protected:
- IFX_JpegProvider* m_pExtProvider;
-};
-class CCodec_IccModule : public ICodec_IccModule
-{
-public:
- virtual IccCS GetProfileCS(FX_LPCBYTE pProfileData, unsigned int dwProfileSize);
- virtual IccCS GetProfileCS(IFX_FileRead* pFile);
- virtual FX_LPVOID CreateTransform(ICodec_IccModule::IccParam* pInputParam,
- ICodec_IccModule::IccParam* pOutputParam,
- ICodec_IccModule::IccParam* pProofParam = NULL,
- FX_DWORD dwIntent = Icc_INTENT_PERCEPTUAL,
- FX_DWORD dwFlag = Icc_FLAGS_DEFAULT,
- FX_DWORD dwPrfIntent = Icc_INTENT_ABSOLUTE_COLORIMETRIC,
- FX_DWORD dwPrfFlag = Icc_FLAGS_SOFTPROOFING
- );
- virtual FX_LPVOID CreateTransform_sRGB(FX_LPCBYTE pProfileData, unsigned int dwProfileSize, int nComponents, int intent = 0,
- FX_DWORD dwSrcFormat = Icc_FORMAT_DEFAULT);
- virtual FX_LPVOID CreateTransform_CMYK(FX_LPCBYTE pSrcProfileData, unsigned int dwSrcProfileSize, int nSrcComponents,
- FX_LPCBYTE pDstProfileData, unsigned int dwDstProfileSize, int intent = 0,
- FX_DWORD dwSrcFormat = Icc_FORMAT_DEFAULT,
- FX_DWORD dwDstFormat = Icc_FORMAT_DEFAULT
- );
- virtual void DestroyTransform(FX_LPVOID pTransform);
- virtual void Translate(FX_LPVOID pTransform, FX_FLOAT* pSrcValues, FX_FLOAT* pDestValues);
- virtual void TranslateScanline(FX_LPVOID pTransform, FX_LPBYTE pDest, FX_LPCBYTE pSrc, int pixels);
- virtual ~CCodec_IccModule();
-protected:
- CFX_MapByteStringToPtr m_MapTranform;
- CFX_MapByteStringToPtr m_MapProfile;
- typedef enum {
- Icc_CLASS_INPUT = 0,
- Icc_CLASS_OUTPUT,
- Icc_CLASS_PROOF,
- Icc_CLASS_MAX
- } Icc_CLASS;
- FX_LPVOID CreateProfile(ICodec_IccModule::IccParam* pIccParam, Icc_CLASS ic, CFX_BinaryBuf* pTransformKey);
-};
-class CCodec_JpxModule : public ICodec_JpxModule
-{
-public:
- CCodec_JpxModule();
- void* CreateDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, FX_BOOL useColorSpace = FALSE);
- void GetImageInfo(FX_LPVOID ctx, FX_DWORD& width, FX_DWORD& height,
- FX_DWORD& codestream_nComps, FX_DWORD& output_nComps);
- FX_BOOL Decode(void* ctx, FX_LPBYTE dest_data, int pitch, FX_BOOL bTranslateColor, FX_LPBYTE offsets);
- void DestroyDecoder(void* ctx);
-};
-#include "../jbig2/JBig2_Context.h"
-class CPDF_Jbig2Interface : public CFX_Object, public CJBig2_Module
-{
-public:
- virtual void *JBig2_Malloc(FX_DWORD dwSize)
- {
- return FX_Alloc(FX_BYTE, dwSize);
- }
- virtual void *JBig2_Malloc2(FX_DWORD num, FX_DWORD dwSize)
- {
- if (dwSize && num >= UINT_MAX / dwSize) {
- return NULL;
- }
- return FX_Alloc(FX_BYTE, num * dwSize);
- }
- virtual void *JBig2_Malloc3(FX_DWORD num, FX_DWORD dwSize, FX_DWORD dwSize2)
- {
- if (dwSize2 && dwSize >= UINT_MAX / dwSize2) {
- return NULL;
- }
- FX_DWORD size = dwSize2 * dwSize;
- if (size && num >= UINT_MAX / size) {
- return NULL;
- }
- return FX_Alloc(FX_BYTE, num * size);
- }
- virtual void *JBig2_Realloc(FX_LPVOID pMem, FX_DWORD dwSize)
- {
- return FX_Realloc(FX_BYTE, pMem, dwSize);
- }
- virtual void JBig2_Free(FX_LPVOID pMem)
- {
- FX_Free(pMem);
- }
-};
-class CCodec_Jbig2Context : public CFX_Object
-{
-public:
- CCodec_Jbig2Context();
- ~CCodec_Jbig2Context() {};
- IFX_FileRead* m_file_ptr;
- FX_DWORD m_width;
- FX_DWORD m_height;
- FX_LPBYTE m_src_buf;
- FX_DWORD m_src_size;
- FX_LPCBYTE m_global_data;
- FX_DWORD m_global_size;
- FX_LPBYTE m_dest_buf;
- FX_DWORD m_dest_pitch;
- FX_BOOL m_bFileReader;
- IFX_Pause* m_pPause;
- CJBig2_Context* m_pContext;
- CJBig2_Image* m_dest_image;
-};
-class CCodec_Jbig2Module : public ICodec_Jbig2Module
-{
-public:
- CCodec_Jbig2Module() {};
- ~CCodec_Jbig2Module();
- FX_BOOL Decode(FX_DWORD width, FX_DWORD height, FX_LPCBYTE src_buf, FX_DWORD src_size,
- FX_LPCBYTE global_data, FX_DWORD global_size, FX_LPBYTE dest_buf, FX_DWORD dest_pitch);
- FX_BOOL Decode(IFX_FileRead* file_ptr,
- FX_DWORD& width, FX_DWORD& height, FX_DWORD& pitch, FX_LPBYTE& dest_buf);
- void* CreateJbig2Context();
- FXCODEC_STATUS StartDecode(void* pJbig2Context, FX_DWORD width, FX_DWORD height, FX_LPCBYTE src_buf, FX_DWORD src_size,
- FX_LPCBYTE global_data, FX_DWORD global_size, FX_LPBYTE dest_buf, FX_DWORD dest_pitch, IFX_Pause* pPause);
-
- FXCODEC_STATUS StartDecode(void* pJbig2Context, IFX_FileRead* file_ptr,
- FX_DWORD& width, FX_DWORD& height, FX_DWORD& pitch, FX_LPBYTE& dest_buf, IFX_Pause* pPause);
- FXCODEC_STATUS ContinueDecode(void* pJbig2Context, IFX_Pause* pPause);
- void DestroyJbig2Context(void* pJbig2Context);
- CPDF_Jbig2Interface m_Module;
-private:
-};
+// 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
+
+#include <limits.h>
+class CCodec_BasicModule : public ICodec_BasicModule
+{
+public:
+ virtual FX_BOOL RunLengthEncode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf,
+ FX_DWORD& dest_size);
+ virtual FX_BOOL A85Encode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf,
+ FX_DWORD& dest_size);
+ virtual ICodec_ScanlineDecoder* CreateRunLengthDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height,
+ int nComps, int bpc);
+};
+struct CCodec_ImageDataCache {
+ int m_Width, m_Height;
+ int m_nCachedLines;
+ FX_BYTE m_Data;
+};
+class CCodec_ScanlineDecoder : public ICodec_ScanlineDecoder
+{
+public:
+
+ CCodec_ScanlineDecoder();
+
+ virtual ~CCodec_ScanlineDecoder();
+
+ virtual FX_DWORD GetSrcOffset()
+ {
+ return -1;
+ }
+
+ virtual void DownScale(int dest_width, int dest_height);
+
+ FX_LPBYTE GetScanline(int line);
+
+ FX_BOOL SkipToScanline(int line, IFX_Pause* pPause);
+
+ int GetWidth()
+ {
+ return m_OutputWidth;
+ }
+
+ int GetHeight()
+ {
+ return m_OutputHeight;
+ }
+
+ int CountComps()
+ {
+ return m_nComps;
+ }
+
+ int GetBPC()
+ {
+ return m_bpc;
+ }
+
+ FX_BOOL IsColorTransformed()
+ {
+ return m_bColorTransformed;
+ }
+
+ void ClearImageData()
+ {
+ if (m_pDataCache) {
+ FX_Free(m_pDataCache);
+ }
+ m_pDataCache = NULL;
+ }
+protected:
+
+ int m_OrigWidth;
+
+ int m_OrigHeight;
+
+ int m_DownScale;
+
+ int m_OutputWidth;
+
+ int m_OutputHeight;
+
+ int m_nComps;
+
+ int m_bpc;
+
+ int m_Pitch;
+
+ FX_BOOL m_bColorTransformed;
+
+ FX_LPBYTE ReadNextLine();
+
+ virtual FX_BOOL v_Rewind() = 0;
+
+ virtual FX_LPBYTE v_GetNextLine() = 0;
+
+ virtual void v_DownScale(int dest_width, int dest_height) = 0;
+
+ int m_NextLine;
+
+ FX_LPBYTE m_pLastScanline;
+
+ CCodec_ImageDataCache* m_pDataCache;
+};
+class CCodec_FaxModule : public ICodec_FaxModule
+{
+public:
+ virtual ICodec_ScanlineDecoder* CreateDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height,
+ int K, FX_BOOL EndOfLine, FX_BOOL EncodedByteAlign, FX_BOOL BlackIs1, int Columns, int Rows);
+ FX_BOOL Encode(FX_LPCBYTE src_buf, int width, int height, int pitch, FX_LPBYTE& dest_buf, FX_DWORD& dest_size);
+};
+class CCodec_FlateModule : public ICodec_FlateModule
+{
+public:
+ virtual ICodec_ScanlineDecoder* CreateDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height,
+ int nComps, int bpc, int predictor, int Colors, int BitsPerComponent, int Columns);
+ virtual FX_DWORD FlateOrLZWDecode(FX_BOOL bLZW, const FX_BYTE* src_buf, FX_DWORD src_size, FX_BOOL bEarlyChange,
+ int predictor, int Colors, int BitsPerComponent, int Columns,
+ FX_DWORD estimated_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size);
+ virtual FX_BOOL Encode(const FX_BYTE* src_buf, FX_DWORD src_size,
+ int predictor, int Colors, int BitsPerComponent, int Columns,
+ FX_LPBYTE& dest_buf, FX_DWORD& dest_size);
+ virtual FX_BOOL Encode(FX_LPCBYTE src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size);
+};
+class CCodec_JpegModule : public ICodec_JpegModule
+{
+public:
+ CCodec_JpegModule() : m_pExtProvider(NULL) {}
+ void SetPovider(IFX_JpegProvider* pJP)
+ {
+ m_pExtProvider = pJP;
+ }
+ ICodec_ScanlineDecoder* CreateDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size,
+ int width, int height, int nComps, FX_BOOL ColorTransform);
+ FX_BOOL LoadInfo(FX_LPCBYTE src_buf, FX_DWORD src_size, int& width, int& height,
+ int& num_components, int& bits_per_components, FX_BOOL& color_transform,
+ FX_LPBYTE* icc_buf_ptr, FX_DWORD* icc_length);
+ FX_BOOL Encode(const CFX_DIBSource* pSource, FX_LPBYTE& dest_buf, FX_STRSIZE& dest_size, int quality, FX_LPCBYTE icc_buf, FX_DWORD icc_length);
+ virtual void* Start();
+ virtual void Finish(void* pContext);
+ virtual void Input(void* pContext, FX_LPCBYTE src_buf, FX_DWORD src_size);
+ virtual int ReadHeader(void* pContext, int* width, int* height, int* nComps);
+ virtual FX_BOOL StartScanline(void* pContext, int down_scale);
+ virtual FX_BOOL ReadScanline(void* pContext, FX_LPBYTE dest_buf);
+ virtual FX_DWORD GetAvailInput(void* pContext, FX_LPBYTE* avail_buf_ptr);
+protected:
+ IFX_JpegProvider* m_pExtProvider;
+};
+class CCodec_IccModule : public ICodec_IccModule
+{
+public:
+ virtual IccCS GetProfileCS(FX_LPCBYTE pProfileData, unsigned int dwProfileSize);
+ virtual IccCS GetProfileCS(IFX_FileRead* pFile);
+ virtual FX_LPVOID CreateTransform(ICodec_IccModule::IccParam* pInputParam,
+ ICodec_IccModule::IccParam* pOutputParam,
+ ICodec_IccModule::IccParam* pProofParam = NULL,
+ FX_DWORD dwIntent = Icc_INTENT_PERCEPTUAL,
+ FX_DWORD dwFlag = Icc_FLAGS_DEFAULT,
+ FX_DWORD dwPrfIntent = Icc_INTENT_ABSOLUTE_COLORIMETRIC,
+ FX_DWORD dwPrfFlag = Icc_FLAGS_SOFTPROOFING
+ );
+ virtual FX_LPVOID CreateTransform_sRGB(FX_LPCBYTE pProfileData, unsigned int dwProfileSize, int nComponents, int intent = 0,
+ FX_DWORD dwSrcFormat = Icc_FORMAT_DEFAULT);
+ virtual FX_LPVOID CreateTransform_CMYK(FX_LPCBYTE pSrcProfileData, unsigned int dwSrcProfileSize, int nSrcComponents,
+ FX_LPCBYTE pDstProfileData, unsigned int dwDstProfileSize, int intent = 0,
+ FX_DWORD dwSrcFormat = Icc_FORMAT_DEFAULT,
+ FX_DWORD dwDstFormat = Icc_FORMAT_DEFAULT
+ );
+ virtual void DestroyTransform(FX_LPVOID pTransform);
+ virtual void Translate(FX_LPVOID pTransform, FX_FLOAT* pSrcValues, FX_FLOAT* pDestValues);
+ virtual void TranslateScanline(FX_LPVOID pTransform, FX_LPBYTE pDest, FX_LPCBYTE pSrc, int pixels);
+ virtual ~CCodec_IccModule();
+protected:
+ CFX_MapByteStringToPtr m_MapTranform;
+ CFX_MapByteStringToPtr m_MapProfile;
+ typedef enum {
+ Icc_CLASS_INPUT = 0,
+ Icc_CLASS_OUTPUT,
+ Icc_CLASS_PROOF,
+ Icc_CLASS_MAX
+ } Icc_CLASS;
+ FX_LPVOID CreateProfile(ICodec_IccModule::IccParam* pIccParam, Icc_CLASS ic, CFX_BinaryBuf* pTransformKey);
+};
+class CCodec_JpxModule : public ICodec_JpxModule
+{
+public:
+ CCodec_JpxModule();
+ void* CreateDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, FX_BOOL useColorSpace = FALSE);
+ void GetImageInfo(FX_LPVOID ctx, FX_DWORD& width, FX_DWORD& height,
+ FX_DWORD& codestream_nComps, FX_DWORD& output_nComps);
+ FX_BOOL Decode(void* ctx, FX_LPBYTE dest_data, int pitch, FX_BOOL bTranslateColor, FX_LPBYTE offsets);
+ void DestroyDecoder(void* ctx);
+};
+#include "../jbig2/JBig2_Context.h"
+class CPDF_Jbig2Interface : public CFX_Object, public CJBig2_Module
+{
+public:
+ virtual void *JBig2_Malloc(FX_DWORD dwSize)
+ {
+ return FX_Alloc(FX_BYTE, dwSize);
+ }
+ virtual void *JBig2_Malloc2(FX_DWORD num, FX_DWORD dwSize)
+ {
+ if (dwSize && num >= UINT_MAX / dwSize) {
+ return NULL;
+ }
+ return FX_Alloc(FX_BYTE, num * dwSize);
+ }
+ virtual void *JBig2_Malloc3(FX_DWORD num, FX_DWORD dwSize, FX_DWORD dwSize2)
+ {
+ if (dwSize2 && dwSize >= UINT_MAX / dwSize2) {
+ return NULL;
+ }
+ FX_DWORD size = dwSize2 * dwSize;
+ if (size && num >= UINT_MAX / size) {
+ return NULL;
+ }
+ return FX_Alloc(FX_BYTE, num * size);
+ }
+ virtual void *JBig2_Realloc(FX_LPVOID pMem, FX_DWORD dwSize)
+ {
+ return FX_Realloc(FX_BYTE, pMem, dwSize);
+ }
+ virtual void JBig2_Free(FX_LPVOID pMem)
+ {
+ FX_Free(pMem);
+ }
+};
+class CCodec_Jbig2Context : public CFX_Object
+{
+public:
+ CCodec_Jbig2Context();
+ ~CCodec_Jbig2Context() {};
+ IFX_FileRead* m_file_ptr;
+ FX_DWORD m_width;
+ FX_DWORD m_height;
+ FX_LPBYTE m_src_buf;
+ FX_DWORD m_src_size;
+ FX_LPCBYTE m_global_data;
+ FX_DWORD m_global_size;
+ FX_LPBYTE m_dest_buf;
+ FX_DWORD m_dest_pitch;
+ FX_BOOL m_bFileReader;
+ IFX_Pause* m_pPause;
+ CJBig2_Context* m_pContext;
+ CJBig2_Image* m_dest_image;
+};
+class CCodec_Jbig2Module : public ICodec_Jbig2Module
+{
+public:
+ CCodec_Jbig2Module() {};
+ ~CCodec_Jbig2Module();
+ FX_BOOL Decode(FX_DWORD width, FX_DWORD height, FX_LPCBYTE src_buf, FX_DWORD src_size,
+ FX_LPCBYTE global_data, FX_DWORD global_size, FX_LPBYTE dest_buf, FX_DWORD dest_pitch);
+ FX_BOOL Decode(IFX_FileRead* file_ptr,
+ FX_DWORD& width, FX_DWORD& height, FX_DWORD& pitch, FX_LPBYTE& dest_buf);
+ void* CreateJbig2Context();
+ FXCODEC_STATUS StartDecode(void* pJbig2Context, FX_DWORD width, FX_DWORD height, FX_LPCBYTE src_buf, FX_DWORD src_size,
+ FX_LPCBYTE global_data, FX_DWORD global_size, FX_LPBYTE dest_buf, FX_DWORD dest_pitch, IFX_Pause* pPause);
+
+ FXCODEC_STATUS StartDecode(void* pJbig2Context, IFX_FileRead* file_ptr,
+ FX_DWORD& width, FX_DWORD& height, FX_DWORD& pitch, FX_LPBYTE& dest_buf, IFX_Pause* pPause);
+ FXCODEC_STATUS ContinueDecode(void* pJbig2Context, IFX_Pause* pPause);
+ void DestroyJbig2Context(void* pJbig2Context);
+ CPDF_Jbig2Interface m_Module;
+private:
+};
diff --git a/core/src/fxcodec/codec/fx_codec.cpp b/core/src/fxcodec/codec/fx_codec.cpp
index 2f586ca94b..c6b3ccee43 100644
--- a/core/src/fxcodec/codec/fx_codec.cpp
+++ b/core/src/fxcodec/codec/fx_codec.cpp
@@ -1,447 +1,447 @@
-// 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
-
-#include "../../../include/fxcodec/fx_codec.h"
-#include "codec_int.h"
-CCodec_ModuleMgr::CCodec_ModuleMgr()
-{
- m_pBasicModule = FX_NEW CCodec_BasicModule;
- m_pFaxModule = FX_NEW CCodec_FaxModule;
- m_pJpegModule = FX_NEW CCodec_JpegModule;
- m_pJpxModule = FX_NEW CCodec_JpxModule;
- m_pJbig2Module = FX_NEW CCodec_Jbig2Module;
- m_pIccModule = FX_NEW CCodec_IccModule;
- m_pFlateModule = FX_NEW CCodec_FlateModule;
-}
-CCodec_ModuleMgr::~CCodec_ModuleMgr()
-{
- delete m_pBasicModule;
- delete m_pFaxModule;
- delete m_pJpegModule;
- delete m_pFlateModule;
- delete m_pJpxModule;
- delete m_pJbig2Module;
- delete m_pIccModule;
-}
-void CCodec_ModuleMgr::InitJbig2Decoder()
-{
-}
-void CCodec_ModuleMgr::InitJpxDecoder()
-{
-}
-void CCodec_ModuleMgr::InitIccDecoder()
-{
-}
-CCodec_ScanlineDecoder::CCodec_ScanlineDecoder()
-{
- m_NextLine = -1;
- m_pDataCache = NULL;
- m_pLastScanline = NULL;
-}
-CCodec_ScanlineDecoder::~CCodec_ScanlineDecoder()
-{
- if (m_pDataCache) {
- FX_Free(m_pDataCache);
- }
-}
-FX_LPBYTE CCodec_ScanlineDecoder::GetScanline(int line)
-{
- if (m_pDataCache && line < m_pDataCache->m_nCachedLines) {
- return &m_pDataCache->m_Data + line * m_Pitch;
- }
- if (m_NextLine == line + 1) {
- return m_pLastScanline;
- }
- if (m_NextLine < 0 || m_NextLine > line) {
- if (!v_Rewind()) {
- return NULL;
- }
- m_NextLine = 0;
- }
- while (m_NextLine < line) {
- ReadNextLine();
- m_NextLine ++;
- }
- m_pLastScanline = ReadNextLine();
- m_NextLine ++;
- return m_pLastScanline;
-}
-FX_BOOL CCodec_ScanlineDecoder::SkipToScanline(int line, IFX_Pause* pPause)
-{
- if (m_pDataCache && line < m_pDataCache->m_nCachedLines) {
- return FALSE;
- }
- if (m_NextLine == line || m_NextLine == line + 1) {
- return FALSE;
- }
- if (m_NextLine < 0 || m_NextLine > line) {
- v_Rewind();
- m_NextLine = 0;
- }
- m_pLastScanline = NULL;
- while (m_NextLine < line) {
- m_pLastScanline = ReadNextLine();
- m_NextLine ++;
- if (pPause && pPause->NeedToPauseNow()) {
- return TRUE;
- }
- }
- return FALSE;
-}
-FX_LPBYTE CCodec_ScanlineDecoder::ReadNextLine()
-{
- FX_LPBYTE pLine = v_GetNextLine();
- if (pLine == NULL) {
- return NULL;
- }
- if (m_pDataCache && m_NextLine == m_pDataCache->m_nCachedLines) {
- FXSYS_memcpy32(&m_pDataCache->m_Data + m_NextLine * m_Pitch, pLine, m_Pitch);
- m_pDataCache->m_nCachedLines ++;
- }
- return pLine;
-}
-void CCodec_ScanlineDecoder::DownScale(int dest_width, int dest_height)
-{
- if (dest_width < 0) {
- dest_width = -dest_width;
- }
- if (dest_height < 0) {
- dest_height = -dest_height;
- }
- v_DownScale(dest_width, dest_height);
- if (m_pDataCache) {
- if (m_pDataCache->m_Height == m_OutputHeight && m_pDataCache->m_Width == m_OutputWidth) {
- return;
- }
- FX_Free(m_pDataCache);
- m_pDataCache = NULL;
- }
- m_pDataCache = (CCodec_ImageDataCache*)FXMEM_DefaultAlloc(
- sizeof(CCodec_ImageDataCache) + m_Pitch * m_OutputHeight, FXMEM_NONLEAVE);
- if (m_pDataCache == NULL) {
- return;
- }
- m_pDataCache->m_Height = m_OutputHeight;
- m_pDataCache->m_Width = m_OutputWidth;
- m_pDataCache->m_nCachedLines = 0;
-}
-FX_BOOL CCodec_BasicModule::RunLengthEncode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf,
- FX_DWORD& dest_size)
-{
- return FALSE;
-}
-extern "C" double FXstrtod(const char* nptr, char** endptr)
-{
- double ret = 0.0;
- const char* ptr = nptr;
- const char* exp_ptr = NULL;
- int e_number = 0,
- e_signal = 0,
- e_point = 0,
- is_negative = 0;
- int exp_ret = 0, exp_sig = 1,
- fra_ret = 0, fra_count = 0, fra_base = 1;
- if(nptr == NULL) {
- return 0.0;
- }
- for (;; ptr++) {
- if(!e_number && !e_point && (*ptr == '\t' || *ptr == ' ')) {
- continue;
- }
- if(*ptr >= '0' && *ptr <= '9') {
- if(!e_number) {
- e_number = 1;
- }
- if(!e_point) {
- ret *= 10;
- ret += (*ptr - '0');
- } else {
- fra_count++;
- fra_ret *= 10;
- fra_ret += (*ptr - '0');
- }
- continue;
- }
- if(!e_point && *ptr == '.') {
- e_point = 1;
- continue;
- }
- if(!e_number && !e_point && !e_signal) {
- switch(*ptr) {
- case '-':
- is_negative = 1;
- case '+':
- e_signal = 1;
- continue;
- }
- }
- if(e_number && (*ptr == 'e' || *ptr == 'E')) {
-#define EXPONENT_DETECT(ptr) \
- for(;;ptr++){ \
- if(*ptr < '0' || *ptr > '9'){ \
- if(endptr) *endptr = (char*)ptr; \
- break; \
- }else{ \
- exp_ret *= 10; \
- exp_ret += (*ptr - '0'); \
- continue; \
- } \
- }
- exp_ptr = ptr++;
- if(*ptr == '+' || *ptr == '-') {
- exp_sig = (*ptr++ == '+') ? 1 : -1;
- if(*ptr < '0' || *ptr > '9') {
- if(endptr) {
- *endptr = (char*)exp_ptr;
- }
- break;
- }
- EXPONENT_DETECT(ptr);
- } else if(*ptr >= '0' && *ptr <= '9') {
- EXPONENT_DETECT(ptr);
- } else {
- if(endptr) {
- *endptr = (char*)exp_ptr;
- }
- break;
- }
-#undef EXPONENT_DETECT
- break;
- }
- if(ptr != nptr && !e_number) {
- if(endptr) {
- *endptr = (char*)nptr;
- }
- break;
- }
- if(endptr) {
- *endptr = (char*)ptr;
- }
- break;
- }
- while(fra_count--) {
- fra_base *= 10;
- }
- ret += (double)fra_ret / (double)fra_base;
- if(exp_sig == 1) {
- while(exp_ret--) {
- ret *= 10.0;
- }
- } else {
- while(exp_ret--) {
- ret /= 10.0;
- }
- }
- return is_negative ? -ret : ret;
-}
-FX_BOOL CCodec_BasicModule::A85Encode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf,
- FX_DWORD& dest_size)
-{
- return FALSE;
-}
-CCodec_ModuleMgr* CCodec_ModuleMgr::Create()
-{
- return FX_NEW CCodec_ModuleMgr;
-}
-void CCodec_ModuleMgr::Destroy()
-{
- delete this;
-}
-class CCodec_RLScanlineDecoder : public CCodec_ScanlineDecoder
-{
-public:
- CCodec_RLScanlineDecoder();
- virtual ~CCodec_RLScanlineDecoder();
- FX_BOOL Create(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height, int nComps, int bpc);
- virtual void v_DownScale(int dest_width, int dest_height) {}
- virtual FX_BOOL v_Rewind();
- virtual FX_LPBYTE v_GetNextLine();
- virtual FX_DWORD GetSrcOffset()
- {
- return m_SrcOffset;
- }
-protected:
- FX_BOOL CheckDestSize();
- void GetNextOperator();
- void UpdateOperator(FX_BYTE used_bytes);
-
- FX_LPBYTE m_pScanline;
- FX_LPCBYTE m_pSrcBuf;
- FX_DWORD m_SrcSize;
- FX_DWORD m_dwLineBytes;
- FX_DWORD m_SrcOffset;
- FX_BOOL m_bEOD;
- FX_BYTE m_Operator;
-};
-CCodec_RLScanlineDecoder::CCodec_RLScanlineDecoder()
- : m_pScanline(NULL)
- , m_pSrcBuf(NULL)
- , m_SrcSize(0)
- , m_dwLineBytes(0)
- , m_SrcOffset(0)
- , m_bEOD(FALSE)
- , m_Operator(0)
-{
-}
-CCodec_RLScanlineDecoder::~CCodec_RLScanlineDecoder()
-{
- if (m_pScanline) {
- FX_Free(m_pScanline);
- }
-}
-FX_BOOL CCodec_RLScanlineDecoder::CheckDestSize()
-{
- FX_DWORD i = 0;
- FX_DWORD old_size = 0;
- FX_DWORD dest_size = 0;
- while (i < m_SrcSize) {
- if (m_pSrcBuf[i] < 128) {
- old_size = dest_size;
- dest_size += m_pSrcBuf[i] + 1;
- if (dest_size < old_size) {
- return FALSE;
- }
- i += m_pSrcBuf[i] + 2;
- } else if (m_pSrcBuf[i] > 128) {
- old_size = dest_size;
- dest_size += 257 - m_pSrcBuf[i];
- if (dest_size < old_size) {
- return FALSE;
- }
- i += 2;
- } else {
- break;
- }
- }
- if (((FX_DWORD)m_OrigWidth * m_nComps * m_bpc * m_OrigHeight + 7) / 8 > dest_size) {
- return FALSE;
- }
- return TRUE;
-}
-FX_BOOL CCodec_RLScanlineDecoder::Create(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height, int nComps, int bpc)
-{
- m_pSrcBuf = src_buf;
- m_SrcSize = src_size;
- m_OutputWidth = m_OrigWidth = width;
- m_OutputHeight = m_OrigHeight = height;
- m_nComps = nComps;
- m_bpc = bpc;
- m_bColorTransformed = FALSE;
- m_DownScale = 1;
- m_Pitch = (width * nComps * bpc + 31) / 32 * 4;
- m_dwLineBytes = (width * nComps * bpc + 7) / 8;
- m_pScanline = FX_Alloc(FX_BYTE, m_Pitch);
- if (m_pScanline == NULL) {
- return FALSE;
- }
- FXSYS_memset32(m_pScanline, 0, m_Pitch);
- return CheckDestSize();
-}
-FX_BOOL CCodec_RLScanlineDecoder::v_Rewind()
-{
- FXSYS_memset32(m_pScanline, 0, m_Pitch);
- m_SrcOffset = 0;
- m_bEOD = FALSE;
- m_Operator = 0;
- return TRUE;
-}
-FX_LPBYTE CCodec_RLScanlineDecoder::v_GetNextLine()
-{
- if (m_SrcOffset == 0) {
- GetNextOperator();
- } else {
- if (m_bEOD) {
- return NULL;
- }
- }
- FXSYS_memset32(m_pScanline, 0, m_Pitch);
- FX_DWORD col_pos = 0;
- FX_BOOL eol = FALSE;
- while (m_SrcOffset < m_SrcSize && !eol) {
- if (m_Operator < 128) {
- FX_DWORD copy_len = m_Operator + 1;
- if (col_pos + copy_len >= m_dwLineBytes) {
- copy_len = m_dwLineBytes - col_pos;
- eol = TRUE;
- }
- if (copy_len >= m_SrcSize - m_SrcOffset) {
- copy_len = m_SrcSize - m_SrcOffset;
- m_bEOD = TRUE;
- }
- FXSYS_memcpy32(m_pScanline + col_pos, m_pSrcBuf + m_SrcOffset, copy_len);
- col_pos += copy_len;
- UpdateOperator((FX_BYTE)copy_len);
- } else if (m_Operator > 128) {
- int fill = 0;
- if (m_SrcOffset - 1 < m_SrcSize - 1) {
- fill = m_pSrcBuf[m_SrcOffset];
- }
- FX_DWORD duplicate_len = 257 - m_Operator;
- if (col_pos + duplicate_len >= m_dwLineBytes) {
- duplicate_len = m_dwLineBytes - col_pos;
- eol = TRUE;
- }
- FXSYS_memset8(m_pScanline + col_pos, fill, duplicate_len);
- col_pos += duplicate_len;
- UpdateOperator((FX_BYTE)duplicate_len);
- } else {
- m_bEOD = TRUE;
- break;
- }
- }
- return m_pScanline;
-}
-void CCodec_RLScanlineDecoder::GetNextOperator()
-{
- if (m_SrcOffset >= m_SrcSize) {
- m_Operator = 128;
- return;
- }
- m_Operator = m_pSrcBuf[m_SrcOffset];
- m_SrcOffset ++;
-}
-void CCodec_RLScanlineDecoder::UpdateOperator(FX_BYTE used_bytes)
-{
- if (used_bytes == 0) {
- return;
- }
- if (m_Operator < 128) {
- FXSYS_assert((FX_DWORD)m_Operator + 1 >= used_bytes);
- if (used_bytes == m_Operator + 1) {
- m_SrcOffset += used_bytes;
- GetNextOperator();
- return;
- }
- m_Operator -= used_bytes;
- m_SrcOffset += used_bytes;
- if (m_SrcOffset >= m_SrcSize) {
- m_Operator = 128;
- }
- return;
- }
- FX_BYTE count = 257 - m_Operator;
- FXSYS_assert((FX_DWORD)count >= used_bytes);
- if (used_bytes == count) {
- m_SrcOffset ++;
- GetNextOperator();
- return;
- }
- count -= used_bytes;
- m_Operator = 257 - count;
-}
-ICodec_ScanlineDecoder* CCodec_BasicModule::CreateRunLengthDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height,
- int nComps, int bpc)
-{
- CCodec_RLScanlineDecoder* pRLScanlineDecoder = FX_NEW CCodec_RLScanlineDecoder;
- if (pRLScanlineDecoder == NULL) {
- return NULL;
- }
- if (!pRLScanlineDecoder->Create(src_buf, src_size, width, height, nComps, bpc)) {
- delete pRLScanlineDecoder;
- return NULL;
- }
- return pRLScanlineDecoder;
-}
+// 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
+
+#include "../../../include/fxcodec/fx_codec.h"
+#include "codec_int.h"
+CCodec_ModuleMgr::CCodec_ModuleMgr()
+{
+ m_pBasicModule = FX_NEW CCodec_BasicModule;
+ m_pFaxModule = FX_NEW CCodec_FaxModule;
+ m_pJpegModule = FX_NEW CCodec_JpegModule;
+ m_pJpxModule = FX_NEW CCodec_JpxModule;
+ m_pJbig2Module = FX_NEW CCodec_Jbig2Module;
+ m_pIccModule = FX_NEW CCodec_IccModule;
+ m_pFlateModule = FX_NEW CCodec_FlateModule;
+}
+CCodec_ModuleMgr::~CCodec_ModuleMgr()
+{
+ delete m_pBasicModule;
+ delete m_pFaxModule;
+ delete m_pJpegModule;
+ delete m_pFlateModule;
+ delete m_pJpxModule;
+ delete m_pJbig2Module;
+ delete m_pIccModule;
+}
+void CCodec_ModuleMgr::InitJbig2Decoder()
+{
+}
+void CCodec_ModuleMgr::InitJpxDecoder()
+{
+}
+void CCodec_ModuleMgr::InitIccDecoder()
+{
+}
+CCodec_ScanlineDecoder::CCodec_ScanlineDecoder()
+{
+ m_NextLine = -1;
+ m_pDataCache = NULL;
+ m_pLastScanline = NULL;
+}
+CCodec_ScanlineDecoder::~CCodec_ScanlineDecoder()
+{
+ if (m_pDataCache) {
+ FX_Free(m_pDataCache);
+ }
+}
+FX_LPBYTE CCodec_ScanlineDecoder::GetScanline(int line)
+{
+ if (m_pDataCache && line < m_pDataCache->m_nCachedLines) {
+ return &m_pDataCache->m_Data + line * m_Pitch;
+ }
+ if (m_NextLine == line + 1) {
+ return m_pLastScanline;
+ }
+ if (m_NextLine < 0 || m_NextLine > line) {
+ if (!v_Rewind()) {
+ return NULL;
+ }
+ m_NextLine = 0;
+ }
+ while (m_NextLine < line) {
+ ReadNextLine();
+ m_NextLine ++;
+ }
+ m_pLastScanline = ReadNextLine();
+ m_NextLine ++;
+ return m_pLastScanline;
+}
+FX_BOOL CCodec_ScanlineDecoder::SkipToScanline(int line, IFX_Pause* pPause)
+{
+ if (m_pDataCache && line < m_pDataCache->m_nCachedLines) {
+ return FALSE;
+ }
+ if (m_NextLine == line || m_NextLine == line + 1) {
+ return FALSE;
+ }
+ if (m_NextLine < 0 || m_NextLine > line) {
+ v_Rewind();
+ m_NextLine = 0;
+ }
+ m_pLastScanline = NULL;
+ while (m_NextLine < line) {
+ m_pLastScanline = ReadNextLine();
+ m_NextLine ++;
+ if (pPause && pPause->NeedToPauseNow()) {
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+FX_LPBYTE CCodec_ScanlineDecoder::ReadNextLine()
+{
+ FX_LPBYTE pLine = v_GetNextLine();
+ if (pLine == NULL) {
+ return NULL;
+ }
+ if (m_pDataCache && m_NextLine == m_pDataCache->m_nCachedLines) {
+ FXSYS_memcpy32(&m_pDataCache->m_Data + m_NextLine * m_Pitch, pLine, m_Pitch);
+ m_pDataCache->m_nCachedLines ++;
+ }
+ return pLine;
+}
+void CCodec_ScanlineDecoder::DownScale(int dest_width, int dest_height)
+{
+ if (dest_width < 0) {
+ dest_width = -dest_width;
+ }
+ if (dest_height < 0) {
+ dest_height = -dest_height;
+ }
+ v_DownScale(dest_width, dest_height);
+ if (m_pDataCache) {
+ if (m_pDataCache->m_Height == m_OutputHeight && m_pDataCache->m_Width == m_OutputWidth) {
+ return;
+ }
+ FX_Free(m_pDataCache);
+ m_pDataCache = NULL;
+ }
+ m_pDataCache = (CCodec_ImageDataCache*)FXMEM_DefaultAlloc(
+ sizeof(CCodec_ImageDataCache) + m_Pitch * m_OutputHeight, FXMEM_NONLEAVE);
+ if (m_pDataCache == NULL) {
+ return;
+ }
+ m_pDataCache->m_Height = m_OutputHeight;
+ m_pDataCache->m_Width = m_OutputWidth;
+ m_pDataCache->m_nCachedLines = 0;
+}
+FX_BOOL CCodec_BasicModule::RunLengthEncode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf,
+ FX_DWORD& dest_size)
+{
+ return FALSE;
+}
+extern "C" double FXstrtod(const char* nptr, char** endptr)
+{
+ double ret = 0.0;
+ const char* ptr = nptr;
+ const char* exp_ptr = NULL;
+ int e_number = 0,
+ e_signal = 0,
+ e_point = 0,
+ is_negative = 0;
+ int exp_ret = 0, exp_sig = 1,
+ fra_ret = 0, fra_count = 0, fra_base = 1;
+ if(nptr == NULL) {
+ return 0.0;
+ }
+ for (;; ptr++) {
+ if(!e_number && !e_point && (*ptr == '\t' || *ptr == ' ')) {
+ continue;
+ }
+ if(*ptr >= '0' && *ptr <= '9') {
+ if(!e_number) {
+ e_number = 1;
+ }
+ if(!e_point) {
+ ret *= 10;
+ ret += (*ptr - '0');
+ } else {
+ fra_count++;
+ fra_ret *= 10;
+ fra_ret += (*ptr - '0');
+ }
+ continue;
+ }
+ if(!e_point && *ptr == '.') {
+ e_point = 1;
+ continue;
+ }
+ if(!e_number && !e_point && !e_signal) {
+ switch(*ptr) {
+ case '-':
+ is_negative = 1;
+ case '+':
+ e_signal = 1;
+ continue;
+ }
+ }
+ if(e_number && (*ptr == 'e' || *ptr == 'E')) {
+#define EXPONENT_DETECT(ptr) \
+ for(;;ptr++){ \
+ if(*ptr < '0' || *ptr > '9'){ \
+ if(endptr) *endptr = (char*)ptr; \
+ break; \
+ }else{ \
+ exp_ret *= 10; \
+ exp_ret += (*ptr - '0'); \
+ continue; \
+ } \
+ }
+ exp_ptr = ptr++;
+ if(*ptr == '+' || *ptr == '-') {
+ exp_sig = (*ptr++ == '+') ? 1 : -1;
+ if(*ptr < '0' || *ptr > '9') {
+ if(endptr) {
+ *endptr = (char*)exp_ptr;
+ }
+ break;
+ }
+ EXPONENT_DETECT(ptr);
+ } else if(*ptr >= '0' && *ptr <= '9') {
+ EXPONENT_DETECT(ptr);
+ } else {
+ if(endptr) {
+ *endptr = (char*)exp_ptr;
+ }
+ break;
+ }
+#undef EXPONENT_DETECT
+ break;
+ }
+ if(ptr != nptr && !e_number) {
+ if(endptr) {
+ *endptr = (char*)nptr;
+ }
+ break;
+ }
+ if(endptr) {
+ *endptr = (char*)ptr;
+ }
+ break;
+ }
+ while(fra_count--) {
+ fra_base *= 10;
+ }
+ ret += (double)fra_ret / (double)fra_base;
+ if(exp_sig == 1) {
+ while(exp_ret--) {
+ ret *= 10.0;
+ }
+ } else {
+ while(exp_ret--) {
+ ret /= 10.0;
+ }
+ }
+ return is_negative ? -ret : ret;
+}
+FX_BOOL CCodec_BasicModule::A85Encode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf,
+ FX_DWORD& dest_size)
+{
+ return FALSE;
+}
+CCodec_ModuleMgr* CCodec_ModuleMgr::Create()
+{
+ return FX_NEW CCodec_ModuleMgr;
+}
+void CCodec_ModuleMgr::Destroy()
+{
+ delete this;
+}
+class CCodec_RLScanlineDecoder : public CCodec_ScanlineDecoder
+{
+public:
+ CCodec_RLScanlineDecoder();
+ virtual ~CCodec_RLScanlineDecoder();
+ FX_BOOL Create(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height, int nComps, int bpc);
+ virtual void v_DownScale(int dest_width, int dest_height) {}
+ virtual FX_BOOL v_Rewind();
+ virtual FX_LPBYTE v_GetNextLine();
+ virtual FX_DWORD GetSrcOffset()
+ {
+ return m_SrcOffset;
+ }
+protected:
+ FX_BOOL CheckDestSize();
+ void GetNextOperator();
+ void UpdateOperator(FX_BYTE used_bytes);
+
+ FX_LPBYTE m_pScanline;
+ FX_LPCBYTE m_pSrcBuf;
+ FX_DWORD m_SrcSize;
+ FX_DWORD m_dwLineBytes;
+ FX_DWORD m_SrcOffset;
+ FX_BOOL m_bEOD;
+ FX_BYTE m_Operator;
+};
+CCodec_RLScanlineDecoder::CCodec_RLScanlineDecoder()
+ : m_pScanline(NULL)
+ , m_pSrcBuf(NULL)
+ , m_SrcSize(0)
+ , m_dwLineBytes(0)
+ , m_SrcOffset(0)
+ , m_bEOD(FALSE)
+ , m_Operator(0)
+{
+}
+CCodec_RLScanlineDecoder::~CCodec_RLScanlineDecoder()
+{
+ if (m_pScanline) {
+ FX_Free(m_pScanline);
+ }
+}
+FX_BOOL CCodec_RLScanlineDecoder::CheckDestSize()
+{
+ FX_DWORD i = 0;
+ FX_DWORD old_size = 0;
+ FX_DWORD dest_size = 0;
+ while (i < m_SrcSize) {
+ if (m_pSrcBuf[i] < 128) {
+ old_size = dest_size;
+ dest_size += m_pSrcBuf[i] + 1;
+ if (dest_size < old_size) {
+ return FALSE;
+ }
+ i += m_pSrcBuf[i] + 2;
+ } else if (m_pSrcBuf[i] > 128) {
+ old_size = dest_size;
+ dest_size += 257 - m_pSrcBuf[i];
+ if (dest_size < old_size) {
+ return FALSE;
+ }
+ i += 2;
+ } else {
+ break;
+ }
+ }
+ if (((FX_DWORD)m_OrigWidth * m_nComps * m_bpc * m_OrigHeight + 7) / 8 > dest_size) {
+ return FALSE;
+ }
+ return TRUE;
+}
+FX_BOOL CCodec_RLScanlineDecoder::Create(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height, int nComps, int bpc)
+{
+ m_pSrcBuf = src_buf;
+ m_SrcSize = src_size;
+ m_OutputWidth = m_OrigWidth = width;
+ m_OutputHeight = m_OrigHeight = height;
+ m_nComps = nComps;
+ m_bpc = bpc;
+ m_bColorTransformed = FALSE;
+ m_DownScale = 1;
+ m_Pitch = (width * nComps * bpc + 31) / 32 * 4;
+ m_dwLineBytes = (width * nComps * bpc + 7) / 8;
+ m_pScanline = FX_Alloc(FX_BYTE, m_Pitch);
+ if (m_pScanline == NULL) {
+ return FALSE;
+ }
+ FXSYS_memset32(m_pScanline, 0, m_Pitch);
+ return CheckDestSize();
+}
+FX_BOOL CCodec_RLScanlineDecoder::v_Rewind()
+{
+ FXSYS_memset32(m_pScanline, 0, m_Pitch);
+ m_SrcOffset = 0;
+ m_bEOD = FALSE;
+ m_Operator = 0;
+ return TRUE;
+}
+FX_LPBYTE CCodec_RLScanlineDecoder::v_GetNextLine()
+{
+ if (m_SrcOffset == 0) {
+ GetNextOperator();
+ } else {
+ if (m_bEOD) {
+ return NULL;
+ }
+ }
+ FXSYS_memset32(m_pScanline, 0, m_Pitch);
+ FX_DWORD col_pos = 0;
+ FX_BOOL eol = FALSE;
+ while (m_SrcOffset < m_SrcSize && !eol) {
+ if (m_Operator < 128) {
+ FX_DWORD copy_len = m_Operator + 1;
+ if (col_pos + copy_len >= m_dwLineBytes) {
+ copy_len = m_dwLineBytes - col_pos;
+ eol = TRUE;
+ }
+ if (copy_len >= m_SrcSize - m_SrcOffset) {
+ copy_len = m_SrcSize - m_SrcOffset;
+ m_bEOD = TRUE;
+ }
+ FXSYS_memcpy32(m_pScanline + col_pos, m_pSrcBuf + m_SrcOffset, copy_len);
+ col_pos += copy_len;
+ UpdateOperator((FX_BYTE)copy_len);
+ } else if (m_Operator > 128) {
+ int fill = 0;
+ if (m_SrcOffset - 1 < m_SrcSize - 1) {
+ fill = m_pSrcBuf[m_SrcOffset];
+ }
+ FX_DWORD duplicate_len = 257 - m_Operator;
+ if (col_pos + duplicate_len >= m_dwLineBytes) {
+ duplicate_len = m_dwLineBytes - col_pos;
+ eol = TRUE;
+ }
+ FXSYS_memset8(m_pScanline + col_pos, fill, duplicate_len);
+ col_pos += duplicate_len;
+ UpdateOperator((FX_BYTE)duplicate_len);
+ } else {
+ m_bEOD = TRUE;
+ break;
+ }
+ }
+ return m_pScanline;
+}
+void CCodec_RLScanlineDecoder::GetNextOperator()
+{
+ if (m_SrcOffset >= m_SrcSize) {
+ m_Operator = 128;
+ return;
+ }
+ m_Operator = m_pSrcBuf[m_SrcOffset];
+ m_SrcOffset ++;
+}
+void CCodec_RLScanlineDecoder::UpdateOperator(FX_BYTE used_bytes)
+{
+ if (used_bytes == 0) {
+ return;
+ }
+ if (m_Operator < 128) {
+ FXSYS_assert((FX_DWORD)m_Operator + 1 >= used_bytes);
+ if (used_bytes == m_Operator + 1) {
+ m_SrcOffset += used_bytes;
+ GetNextOperator();
+ return;
+ }
+ m_Operator -= used_bytes;
+ m_SrcOffset += used_bytes;
+ if (m_SrcOffset >= m_SrcSize) {
+ m_Operator = 128;
+ }
+ return;
+ }
+ FX_BYTE count = 257 - m_Operator;
+ FXSYS_assert((FX_DWORD)count >= used_bytes);
+ if (used_bytes == count) {
+ m_SrcOffset ++;
+ GetNextOperator();
+ return;
+ }
+ count -= used_bytes;
+ m_Operator = 257 - count;
+}
+ICodec_ScanlineDecoder* CCodec_BasicModule::CreateRunLengthDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height,
+ int nComps, int bpc)
+{
+ CCodec_RLScanlineDecoder* pRLScanlineDecoder = FX_NEW CCodec_RLScanlineDecoder;
+ if (pRLScanlineDecoder == NULL) {
+ return NULL;
+ }
+ if (!pRLScanlineDecoder->Create(src_buf, src_size, width, height, nComps, bpc)) {
+ delete pRLScanlineDecoder;
+ return NULL;
+ }
+ return pRLScanlineDecoder;
+}
diff --git a/core/src/fxcodec/codec/fx_codec_fax.cpp b/core/src/fxcodec/codec/fx_codec_fax.cpp
index 21c7deb076..979df38197 100644
--- a/core/src/fxcodec/codec/fx_codec_fax.cpp
+++ b/core/src/fxcodec/codec/fx_codec_fax.cpp
@@ -1,968 +1,968 @@
-// 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
-
-#include "../../../include/fxcodec/fx_codec.h"
-#include "codec_int.h"
-extern const FX_BYTE OneLeadPos[256];
-extern const FX_BYTE ZeroLeadPos[256];
-int _FindBit(const FX_BYTE* data_buf, int max_pos, int start_pos, int bit)
-{
- if (start_pos >= max_pos) {
- return max_pos;
- }
- FX_LPCBYTE leading_pos = bit ? OneLeadPos : ZeroLeadPos;
- if (start_pos % 8) {
- FX_BYTE data = data_buf[start_pos / 8];
- if (bit) {
- data &= 0xff >> (start_pos % 8);
- } else {
- data |= 0xff << (8 - start_pos % 8);
- }
- if (leading_pos[data] < 8) {
- return start_pos / 8 * 8 + leading_pos[data];
- }
- start_pos += 7;
- }
- FX_BYTE skip = bit ? 0x00 : 0xff;
- int byte_pos = start_pos / 8;
- int max_byte = (max_pos + 7) / 8;
- while (byte_pos < max_byte) {
- if (data_buf[byte_pos] != skip) {
- break;
- }
- byte_pos ++;
- }
- if (byte_pos == max_byte) {
- return max_pos;
- }
- int pos = leading_pos[data_buf[byte_pos]] + byte_pos * 8;
- if (pos > max_pos) {
- pos = max_pos;
- }
- return pos;
-}
-void _FaxG4FindB1B2(const FX_BYTE* ref_buf, int columns, int a0, FX_BOOL a0color, int& b1, int& b2)
-{
- if (a0color) {
- a0color = 1;
- }
- FX_BYTE first_bit = (a0 < 0) ? 1 : ((ref_buf[a0 / 8] & (1 << (7 - a0 % 8))) != 0);
- b1 = _FindBit(ref_buf, columns, a0 + 1, !first_bit);
- if (b1 >= columns) {
- b1 = b2 = columns;
- return;
- }
- if (first_bit == !a0color) {
- b1 = _FindBit(ref_buf, columns, b1 + 1, first_bit);
- first_bit = !first_bit;
- }
- if (b1 >= columns) {
- b1 = b2 = columns;
- return;
- }
- b2 = _FindBit(ref_buf, columns, b1 + 1, first_bit);
-}
-void _FaxFillBits(FX_LPBYTE dest_buf, int columns, int startpos, int endpos)
-{
- if (startpos < 0) {
- startpos = 0;
- }
- if (endpos < 0) {
- endpos = 0;
- }
- if (endpos >= columns) {
- endpos = columns;
- }
- if (startpos >= endpos) {
- return;
- }
- int first_byte = startpos / 8;
- int last_byte = (endpos - 1) / 8;
- if (first_byte == last_byte) {
- for (int i = startpos % 8; i <= (endpos - 1) % 8; i ++) {
- dest_buf[first_byte] -= 1 << (7 - i);
- }
- return;
- }
- int i;
- for (i = startpos % 8; i < 8; i ++) {
- dest_buf[first_byte] -= 1 << (7 - i);
- }
- for (i = 0; i <= (endpos - 1) % 8; i ++) {
- dest_buf[last_byte] -= 1 << (7 - i);
- }
- if (last_byte > first_byte + 1) {
- FXSYS_memset32(dest_buf + first_byte + 1, 0, last_byte - first_byte - 1);
- }
-}
-#define NEXTBIT src_buf[bitpos/8] & (1 << (7-bitpos%8)); bitpos ++;
-#define ADDBIT(code, bit) code = code << 1; if (bit) code ++;
-#define GETBIT(bitpos) src_buf[bitpos/8] & (1 << (7-bitpos%8))
-static const FX_BYTE FaxBlackRunIns[] = {
- 0,
- 2,
- 0x02, 3, 0,
- 0x03, 2, 0,
- 2,
- 0x02, 1, 0,
- 0x03, 4, 0,
- 2,
- 0x02, 6, 0,
- 0x03, 5, 0,
- 1,
- 0x03, 7, 0,
- 2,
- 0x04, 9, 0,
- 0x05, 8, 0,
- 3,
- 0x04, 10, 0,
- 0x05, 11, 0,
- 0x07, 12, 0,
- 2,
- 0x04, 13, 0,
- 0x07, 14, 0,
- 1,
- 0x18, 15, 0,
- 5,
- 0x08, 18, 0,
- 0x0f, 64, 0,
- 0x17, 16, 0,
- 0x18, 17, 0,
- 0x37, 0, 0,
- 10,
- 0x08, 0x00, 0x07,
- 0x0c, 0x40, 0x07,
- 0x0d, 0x80, 0x07,
- 0x17, 24, 0,
- 0x18, 25, 0,
- 0x28, 23, 0,
- 0x37, 22, 0,
- 0x67, 19, 0,
- 0x68, 20, 0,
- 0x6c, 21, 0,
- 54,
- 0x12, 1984 % 256, 1984 / 256,
- 0x13, 2048 % 256, 2048 / 256,
- 0x14, 2112 % 256, 2112 / 256,
- 0x15, 2176 % 256, 2176 / 256,
- 0x16, 2240 % 256, 2240 / 256,
- 0x17, 2304 % 256, 2304 / 256,
- 0x1c, 2368 % 256, 2368 / 256,
- 0x1d, 2432 % 256, 2432 / 256,
- 0x1e, 2496 % 256, 2496 / 256,
- 0x1f, 2560 % 256, 2560 / 256,
- 0x24, 52, 0,
- 0x27, 55, 0,
- 0x28, 56, 0,
- 0x2b, 59, 0,
- 0x2c, 60, 0,
- 0x33, 320 % 256, 320 / 256,
- 0x34, 384 % 256, 384 / 256,
- 0x35, 448 % 256, 448 / 256,
- 0x37, 53, 0,
- 0x38, 54, 0,
- 0x52, 50, 0,
- 0x53, 51, 0,
- 0x54, 44, 0,
- 0x55, 45, 0,
- 0x56, 46, 0,
- 0x57, 47, 0,
- 0x58, 57, 0,
- 0x59, 58, 0,
- 0x5a, 61, 0,
- 0x5b, 256 % 256, 256 / 256,
- 0x64, 48, 0,
- 0x65, 49, 0,
- 0x66, 62, 0,
- 0x67, 63, 0,
- 0x68, 30, 0,
- 0x69, 31, 0,
- 0x6a, 32, 0,
- 0x6b, 33, 0,
- 0x6c, 40, 0,
- 0x6d, 41, 0,
- 0xc8, 128, 0,
- 0xc9, 192, 0,
- 0xca, 26, 0,
- 0xcb, 27, 0,
- 0xcc, 28, 0,
- 0xcd, 29, 0,
- 0xd2, 34, 0,
- 0xd3, 35, 0,
- 0xd4, 36, 0,
- 0xd5, 37, 0,
- 0xd6, 38, 0,
- 0xd7, 39, 0,
- 0xda, 42, 0,
- 0xdb, 43, 0,
- 20,
- 0x4a, 640 % 256, 640 / 256,
- 0x4b, 704 % 256, 704 / 256,
- 0x4c, 768 % 256, 768 / 256,
- 0x4d, 832 % 256, 832 / 256,
- 0x52, 1280 % 256, 1280 / 256,
- 0x53, 1344 % 256, 1344 / 256,
- 0x54, 1408 % 256, 1408 / 256,
- 0x55, 1472 % 256, 1472 / 256,
- 0x5a, 1536 % 256, 1536 / 256,
- 0x5b, 1600 % 256, 1600 / 256,
- 0x64, 1664 % 256, 1664 / 256,
- 0x65, 1728 % 256, 1728 / 256,
- 0x6c, 512 % 256, 512 / 256,
- 0x6d, 576 % 256, 576 / 256,
- 0x72, 896 % 256, 896 / 256,
- 0x73, 960 % 256, 960 / 256,
- 0x74, 1024 % 256, 1024 / 256,
- 0x75, 1088 % 256, 1088 / 256,
- 0x76, 1152 % 256, 1152 / 256,
- 0x77, 1216 % 256, 1216 / 256,
- 0xff
-};
-static const FX_BYTE FaxWhiteRunIns[] = {
- 0,
- 0,
- 0,
- 6,
- 0x07, 2, 0,
- 0x08, 3, 0,
- 0x0B, 4, 0,
- 0x0C, 5, 0,
- 0x0E, 6, 0,
- 0x0F, 7, 0,
- 6,
- 0x07, 10, 0,
- 0x08, 11, 0,
- 0x12, 128, 0,
- 0x13, 8, 0,
- 0x14, 9, 0,
- 0x1b, 64, 0,
- 9,
- 0x03, 13, 0,
- 0x07, 1, 0,
- 0x08, 12, 0,
- 0x17, 192, 0,
- 0x18, 1664 % 256, 1664 / 256,
- 0x2a, 16, 0,
- 0x2B, 17, 0,
- 0x34, 14, 0,
- 0x35, 15, 0,
- 12,
- 0x03, 22, 0,
- 0x04, 23, 0,
- 0x08, 20, 0,
- 0x0c, 19, 0,
- 0x13, 26, 0,
- 0x17, 21, 0,
- 0x18, 28, 0,
- 0x24, 27, 0,
- 0x27, 18, 0,
- 0x28, 24, 0,
- 0x2B, 25, 0,
- 0x37, 256 % 256, 256 / 256,
- 42,
- 0x02, 29, 0,
- 0x03, 30, 0,
- 0x04, 45, 0,
- 0x05, 46, 0,
- 0x0a, 47, 0,
- 0x0b, 48, 0,
- 0x12, 33, 0,
- 0x13, 34, 0,
- 0x14, 35, 0,
- 0x15, 36, 0,
- 0x16, 37, 0,
- 0x17, 38, 0,
- 0x1a, 31, 0,
- 0x1b, 32, 0,
- 0x24, 53, 0,
- 0x25, 54, 0,
- 0x28, 39, 0,
- 0x29, 40, 0,
- 0x2a, 41, 0,
- 0x2b, 42, 0,
- 0x2c, 43, 0,
- 0x2d, 44, 0,
- 0x32, 61, 0,
- 0x33, 62, 0,
- 0x34, 63, 0,
- 0x35, 0, 0,
- 0x36, 320 % 256, 320 / 256,
- 0x37, 384 % 256, 384 / 256,
- 0x4a, 59, 0,
- 0x4b, 60, 0,
- 0x52, 49, 0,
- 0x53, 50, 0,
- 0x54, 51, 0,
- 0x55, 52, 0,
- 0x58, 55, 0,
- 0x59, 56, 0,
- 0x5a, 57, 0,
- 0x5b, 58, 0,
- 0x64, 448 % 256, 448 / 256,
- 0x65, 512 % 256, 512 / 256,
- 0x67, 640 % 256, 640 / 256,
- 0x68, 576 % 256, 576 / 256,
- 16,
- 0x98, 1472 % 256, 1472 / 256,
- 0x99, 1536 % 256, 1536 / 256,
- 0x9a, 1600 % 256, 1600 / 256,
- 0x9b, 1728 % 256, 1728 / 256,
- 0xcc, 704 % 256, 704 / 256,
- 0xcd, 768 % 256, 768 / 256,
- 0xd2, 832 % 256, 832 / 256,
- 0xd3, 896 % 256, 896 / 256,
- 0xd4, 960 % 256, 960 / 256,
- 0xd5, 1024 % 256, 1024 / 256,
- 0xd6, 1088 % 256, 1088 / 256,
- 0xd7, 1152 % 256, 1152 / 256,
- 0xd8, 1216 % 256, 1216 / 256,
- 0xd9, 1280 % 256, 1280 / 256,
- 0xda, 1344 % 256, 1344 / 256,
- 0xdb, 1408 % 256, 1408 / 256,
- 0,
- 3,
- 0x08, 1792 % 256, 1792 / 256,
- 0x0c, 1856 % 256, 1856 / 256,
- 0x0d, 1920 % 256, 1920 / 256,
- 10,
- 0x12, 1984 % 256, 1984 / 256,
- 0x13, 2048 % 256, 2048 / 256,
- 0x14, 2112 % 256, 2112 / 256,
- 0x15, 2176 % 256, 2176 / 256,
- 0x16, 2240 % 256, 2240 / 256,
- 0x17, 2304 % 256, 2304 / 256,
- 0x1c, 2368 % 256, 2368 / 256,
- 0x1d, 2432 % 256, 2432 / 256,
- 0x1e, 2496 % 256, 2496 / 256,
- 0x1f, 2560 % 256, 2560 / 256,
- 0xff,
-};
-int _FaxGetRun(FX_LPCBYTE ins_array, const FX_BYTE* src_buf, int& bitpos, int bitsize)
-{
- FX_DWORD code = 0;
- int ins_off = 0;
- while (1) {
- FX_BYTE ins = ins_array[ins_off++];
- if (ins == 0xff) {
- return -1;
- }
- if (bitpos >= bitsize) {
- return -1;
- }
- code <<= 1;
- if (src_buf[bitpos / 8] & (1 << (7 - bitpos % 8))) {
- code ++;
- }
- bitpos ++;
- int next_off = ins_off + ins * 3;
- for (; ins_off < next_off; ins_off += 3) {
- if (ins_array[ins_off] == code) {
- return ins_array[ins_off + 1] + ins_array[ins_off + 2] * 256;
- }
- }
- }
-}
-FX_BOOL _FaxG4GetRow(const FX_BYTE* src_buf, int bitsize, int& bitpos, FX_LPBYTE dest_buf, const FX_BYTE* ref_buf, int columns)
-{
- int a0 = -1, a0color = 1;
- while (1) {
- if (bitpos >= bitsize) {
- return FALSE;
- }
- int a1, a2, b1, b2;
- _FaxG4FindB1B2(ref_buf, columns, a0, a0color, b1, b2);
- FX_BOOL bit = NEXTBIT;
- int v_delta = 0;
- if (bit) {
- } else {
- if (bitpos >= bitsize) {
- return FALSE;
- }
- FX_BOOL bit1 = NEXTBIT;
- if (bitpos >= bitsize) {
- return FALSE;
- }
- FX_BOOL bit2 = NEXTBIT;
- if (bit1 && bit2) {
- v_delta = 1;
- } else if (bit1) {
- v_delta = -1;
- } else if (bit2) {
- int run_len1 = 0;
- while (1) {
- int run = _FaxGetRun(a0color ? FaxWhiteRunIns : FaxBlackRunIns, src_buf, bitpos, bitsize);
- run_len1 += run;
- if (run < 64) {
- break;
- }
- }
- if (a0 < 0) {
- run_len1 ++;
- }
- a1 = a0 + run_len1;
- if (!a0color) {
- _FaxFillBits(dest_buf, columns, a0, a1);
- }
- int run_len2 = 0;
- while (1) {
- int run = _FaxGetRun(a0color ? FaxBlackRunIns : FaxWhiteRunIns, src_buf, bitpos, bitsize);
- run_len2 += run;
- if (run < 64) {
- break;
- }
- }
- a2 = a1 + run_len2;
- if (a0color) {
- _FaxFillBits(dest_buf, columns, a1, a2);
- }
- a0 = a2;
- if (a0 < columns) {
- continue;
- }
- return TRUE;
- } else {
- if (bitpos >= bitsize) {
- return FALSE;
- }
- bit = NEXTBIT;
- if (bit) {
- if (!a0color) {
- _FaxFillBits(dest_buf, columns, a0, b2);
- }
- if (b2 >= columns) {
- return TRUE;
- }
- a0 = b2;
- continue;
- } else {
- if (bitpos >= bitsize) {
- return FALSE;
- }
- FX_BOOL bit1 = NEXTBIT;
- if (bitpos >= bitsize) {
- return FALSE;
- }
- FX_BOOL bit2 = NEXTBIT;
- if (bit1 && bit2) {
- v_delta = 2;
- } else if (bit1) {
- v_delta = -2;
- } else if (bit2) {
- if (bitpos >= bitsize) {
- return FALSE;
- }
- bit = NEXTBIT;
- if (bit) {
- v_delta = 3;
- } else {
- v_delta = -3;
- }
- } else {
- if (bitpos >= bitsize) {
- return FALSE;
- }
- bit = NEXTBIT;
- if (bit) {
- bitpos += 3;
- continue;
- } else {
- bitpos += 5;
- return TRUE;
- }
- }
- }
- }
- }
- a1 = b1 + v_delta;
- if (!a0color) {
- _FaxFillBits(dest_buf, columns, a0, a1);
- }
- if (a1 >= columns) {
- return TRUE;
- }
- a0 = a1;
- a0color = !a0color;
- }
-}
-FX_BOOL _FaxSkipEOL(const FX_BYTE* src_buf, int bitsize, int& bitpos)
-{
- int startbit = bitpos;
- while (bitpos < bitsize) {
- int bit = NEXTBIT;
- if (bit) {
- if (bitpos - startbit <= 11) {
- bitpos = startbit;
- }
- return TRUE;
- }
- }
- return FALSE;
-}
-FX_BOOL _FaxGet1DLine(const FX_BYTE* src_buf, int bitsize, int& bitpos, FX_LPBYTE dest_buf, int columns)
-{
- int color = TRUE;
- int startpos = 0;
- while (1) {
- if (bitpos >= bitsize) {
- return FALSE;
- }
- int run_len = 0;
- while (1) {
- int run = _FaxGetRun(color ? FaxWhiteRunIns : FaxBlackRunIns, src_buf, bitpos, bitsize);
- if (run < 0) {
- while (bitpos < bitsize) {
- int bit = NEXTBIT;
- if (bit) {
- return TRUE;
- }
- }
- return FALSE;
- }
- run_len += run;
- if (run < 64) {
- break;
- }
- }
- if (!color) {
- _FaxFillBits(dest_buf, columns, startpos, startpos + run_len);
- }
- startpos += run_len;
- if (startpos >= columns) {
- break;
- }
- color = !color;
- }
- return TRUE;
-}
-class CCodec_FaxDecoder : public CCodec_ScanlineDecoder
-{
-public:
- CCodec_FaxDecoder();
- virtual ~CCodec_FaxDecoder();
- FX_BOOL Create(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height,
- int K, FX_BOOL EndOfLine, FX_BOOL EncodedByteAlign, FX_BOOL BlackIs1, int Columns, int Rows);
- virtual void v_DownScale(int dest_width, int dest_height) {}
- virtual FX_BOOL v_Rewind();
- virtual FX_LPBYTE v_GetNextLine();
- virtual FX_DWORD GetSrcOffset();
- int m_Encoding, m_bEndOfLine, m_bByteAlign, m_bBlack;
- int bitpos;
- FX_LPCBYTE m_pSrcBuf;
- FX_DWORD m_SrcSize;
- FX_LPBYTE m_pScanlineBuf, m_pRefBuf;
-};
-CCodec_FaxDecoder::CCodec_FaxDecoder()
-{
- m_pScanlineBuf = NULL;
- m_pRefBuf = NULL;
-}
-CCodec_FaxDecoder::~CCodec_FaxDecoder()
-{
- if (m_pScanlineBuf) {
- FX_Free(m_pScanlineBuf);
- }
- if (m_pRefBuf) {
- FX_Free(m_pRefBuf);
- }
-}
-FX_BOOL CCodec_FaxDecoder::Create(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height,
- int K, FX_BOOL EndOfLine, FX_BOOL EncodedByteAlign, FX_BOOL BlackIs1, int Columns, int Rows)
-{
- m_Encoding = K;
- m_bEndOfLine = EndOfLine;
- m_bByteAlign = EncodedByteAlign;
- m_bBlack = BlackIs1;
- m_OrigWidth = Columns;
- m_OrigHeight = Rows;
- if (m_OrigWidth == 0) {
- m_OrigWidth = width;
- }
- if (m_OrigHeight == 0) {
- m_OrigHeight = height;
- }
- m_Pitch = (m_OrigWidth + 31) / 32 * 4;
- m_OutputWidth = m_OrigWidth;
- m_OutputHeight = m_OrigHeight;
- m_pScanlineBuf = FX_Alloc(FX_BYTE, m_Pitch);
- if (m_pScanlineBuf == NULL) {
- return FALSE;
- }
- m_pRefBuf = FX_Alloc(FX_BYTE, m_Pitch);
- if (m_pRefBuf == NULL) {
- return FALSE;
- }
- m_pSrcBuf = src_buf;
- m_SrcSize = src_size;
- m_nComps = 1;
- m_bpc = 1;
- m_bColorTransformed = FALSE;
- return TRUE;
-}
-FX_BOOL CCodec_FaxDecoder::v_Rewind()
-{
- FXSYS_memset8(m_pRefBuf, 0xff, m_Pitch);
- bitpos = 0;
- return TRUE;
-}
-FX_LPBYTE CCodec_FaxDecoder::v_GetNextLine()
-{
- int bitsize = m_SrcSize * 8;
- _FaxSkipEOL(m_pSrcBuf, bitsize, bitpos);
- if (bitpos >= bitsize) {
- return NULL;
- }
- FXSYS_memset8(m_pScanlineBuf, 0xff, m_Pitch);
- if (m_Encoding < 0) {
- _FaxG4GetRow(m_pSrcBuf, bitsize, bitpos, m_pScanlineBuf, m_pRefBuf, m_OrigWidth);
- FXSYS_memcpy32(m_pRefBuf, m_pScanlineBuf, m_Pitch);
- } else if (m_Encoding == 0) {
- _FaxGet1DLine(m_pSrcBuf, bitsize, bitpos, m_pScanlineBuf, m_OrigWidth);
- } else {
- FX_BOOL bNext1D = m_pSrcBuf[bitpos / 8] & (1 << (7 - bitpos % 8));
- bitpos ++;
- if (bNext1D) {
- _FaxGet1DLine(m_pSrcBuf, bitsize, bitpos, m_pScanlineBuf, m_OrigWidth);
- } else {
- _FaxG4GetRow(m_pSrcBuf, bitsize, bitpos, m_pScanlineBuf, m_pRefBuf, m_OrigWidth);
- }
- FXSYS_memcpy32(m_pRefBuf, m_pScanlineBuf, m_Pitch);
- }
- if (m_bEndOfLine) {
- _FaxSkipEOL(m_pSrcBuf, bitsize, bitpos);
- }
- if (m_bByteAlign && bitpos < bitsize) {
- int bitpos0 = bitpos;
- int bitpos1 = (bitpos + 7) / 8 * 8;
- while (m_bByteAlign && bitpos0 < bitpos1) {
- int bit = m_pSrcBuf[bitpos0 / 8] & (1 << (7 - bitpos0 % 8));
- if (bit != 0) {
- m_bByteAlign = FALSE;
- } else {
- bitpos0 ++;
- }
- }
- if (m_bByteAlign) {
- bitpos = bitpos1;
- }
- }
- if (m_bBlack) {
- for (int i = 0; i < m_Pitch; i ++) {
- m_pScanlineBuf[i] = ~m_pScanlineBuf[i];
- }
- }
- return m_pScanlineBuf;
-}
-FX_DWORD CCodec_FaxDecoder::GetSrcOffset()
-{
- FX_DWORD ret = (bitpos + 7) / 8;
- if (ret > m_SrcSize) {
- ret = m_SrcSize;
- }
- return ret;
-}
-extern "C" {
- void _FaxG4Decode(void*, FX_LPCBYTE src_buf, FX_DWORD src_size, int* pbitpos, FX_LPBYTE dest_buf, int width, int height, int pitch)
- {
- if (pitch == 0) {
- pitch = (width + 7) / 8;
- }
- FX_LPBYTE ref_buf = FX_Alloc(FX_BYTE, pitch);
- if (ref_buf == NULL) {
- return;
- }
- FXSYS_memset8(ref_buf, 0xff, pitch);
- int bitpos = *pbitpos;
- for (int iRow = 0; iRow < height; iRow ++) {
- FX_LPBYTE line_buf = dest_buf + iRow * pitch;
- FXSYS_memset8(line_buf, 0xff, pitch);
- _FaxG4GetRow(src_buf, src_size << 3, bitpos, line_buf, ref_buf, width);
- FXSYS_memcpy32(ref_buf, line_buf, pitch);
- }
- FX_Free(ref_buf);
- *pbitpos = bitpos;
- }
-};
-static const FX_BYTE BlackRunTerminator[128] = {
- 0x37, 10, 0x02, 3, 0x03, 2, 0x02, 2, 0x03, 3, 0x03, 4, 0x02, 4, 0x03, 5,
- 0x05, 6, 0x04, 6, 0x04, 7, 0x05, 7, 0x07, 7, 0x04, 8, 0x07, 8, 0x18, 9,
- 0x17, 10, 0x18, 10, 0x08, 10, 0x67, 11, 0x68, 11, 0x6c, 11, 0x37, 11, 0x28, 11,
- 0x17, 11, 0x18, 11, 0xca, 12, 0xcb, 12, 0xcc, 12, 0xcd, 12, 0x68, 12, 0x69, 12,
- 0x6a, 12, 0x6b, 12, 0xd2, 12, 0xd3, 12, 0xd4, 12, 0xd5, 12, 0xd6, 12, 0xd7, 12,
- 0x6c, 12, 0x6d, 12, 0xda, 12, 0xdb, 12, 0x54, 12, 0x55, 12, 0x56, 12, 0x57, 12,
- 0x64, 12, 0x65, 12, 0x52, 12, 0x53, 12, 0x24, 12, 0x37, 12, 0x38, 12, 0x27, 12,
- 0x28, 12, 0x58, 12, 0x59, 12, 0x2b, 12, 0x2c, 12, 0x5a, 12, 0x66, 12, 0x67, 12,
-};
-static const FX_BYTE BlackRunMarkup[80] = {
- 0x0f, 10, 0xc8, 12, 0xc9, 12, 0x5b, 12, 0x33, 12, 0x34, 12, 0x35, 12, 0x6c, 13,
- 0x6d, 13, 0x4a, 13, 0x4b, 13, 0x4c, 13, 0x4d, 13, 0x72, 13, 0x73, 13, 0x74, 13,
- 0x75, 13, 0x76, 13, 0x77, 13, 0x52, 13, 0x53, 13, 0x54, 13, 0x55, 13, 0x5a, 13,
- 0x5b, 13, 0x64, 13, 0x65, 13, 0x08, 11, 0x0c, 11, 0x0d, 11, 0x12, 12, 0x13, 12,
- 0x14, 12, 0x15, 12, 0x16, 12, 0x17, 12, 0x1c, 12, 0x1d, 12, 0x1e, 12, 0x1f, 12,
-};
-static const FX_BYTE WhiteRunTerminator[128] = {
- 0x35, 8,
- 0x07, 6,
- 0x07, 4,
- 0x08, 4,
- 0x0B, 4,
- 0x0C, 4,
- 0x0E, 4,
- 0x0F, 4,
- 0x13, 5,
- 0x14, 5,
- 0x07, 5,
- 0x08, 5,
- 0x08, 6,
- 0x03, 6,
- 0x34, 6,
- 0x35, 6,
- 0x2a, 6,
- 0x2B, 6,
- 0x27, 7,
- 0x0c, 7,
- 0x08, 7,
- 0x17, 7,
- 0x03, 7,
- 0x04, 7,
- 0x28, 7,
- 0x2B, 7,
- 0x13, 7,
- 0x24, 7,
- 0x18, 7,
- 0x02, 8,
- 0x03, 8,
- 0x1a, 8,
- 0x1b, 8,
- 0x12, 8,
- 0x13, 8,
- 0x14, 8,
- 0x15, 8,
- 0x16, 8,
- 0x17, 8,
- 0x28, 8,
- 0x29, 8,
- 0x2a, 8,
- 0x2b, 8,
- 0x2c, 8,
- 0x2d, 8,
- 0x04, 8,
- 0x05, 8,
- 0x0a, 8,
- 0x0b, 8,
- 0x52, 8,
- 0x53, 8,
- 0x54, 8,
- 0x55, 8,
- 0x24, 8,
- 0x25, 8,
- 0x58, 8,
- 0x59, 8,
- 0x5a, 8,
- 0x5b, 8,
- 0x4a, 8,
- 0x4b, 8,
- 0x32, 8,
- 0x33, 8,
- 0x34, 8,
-};
-static const FX_BYTE WhiteRunMarkup[80] = {
- 0x1b, 5,
- 0x12, 5,
- 0x17, 6,
- 0x37, 7,
- 0x36, 8,
- 0x37, 8,
- 0x64, 8,
- 0x65, 8,
- 0x68, 8,
- 0x67, 8,
- 0xcc, 9,
- 0xcd, 9,
- 0xd2, 9,
- 0xd3, 9,
- 0xd4, 9,
- 0xd5, 9,
- 0xd6, 9,
- 0xd7, 9,
- 0xd8, 9,
- 0xd9, 9,
- 0xda, 9,
- 0xdb, 9,
- 0x98, 9,
- 0x99, 9,
- 0x9a, 9,
- 0x18, 6,
- 0x9b, 9,
- 0x08, 11,
- 0x0c, 11,
- 0x0d, 11,
- 0x12, 12,
- 0x13, 12,
- 0x14, 12,
- 0x15, 12,
- 0x16, 12,
- 0x17, 12,
- 0x1c, 12,
- 0x1d, 12,
- 0x1e, 12,
- 0x1f, 12,
-};
-static void _AddBitStream(FX_LPBYTE dest_buf, int& dest_bitpos, int data, int bitlen)
-{
- for (int i = bitlen - 1; i >= 0; i --) {
- if (data & (1 << i)) {
- dest_buf[dest_bitpos / 8] |= 1 << (7 - dest_bitpos % 8);
- }
- dest_bitpos ++;
- }
-}
-static void _FaxEncodeRun(FX_LPBYTE dest_buf, int& dest_bitpos, int run, FX_BOOL bWhite)
-{
- while (run >= 2560) {
- _AddBitStream(dest_buf, dest_bitpos, 0x1f, 12);
- run -= 2560;
- }
- if (run >= 64) {
- int markup = run - run % 64;
- FX_LPCBYTE p = bWhite ? WhiteRunMarkup : BlackRunMarkup;
- p += (markup / 64 - 1) * 2;
- _AddBitStream(dest_buf, dest_bitpos, *p, p[1]);
- }
- run %= 64;
- FX_LPCBYTE p = bWhite ? WhiteRunTerminator : BlackRunTerminator;
- p += run * 2;
- _AddBitStream(dest_buf, dest_bitpos, *p, p[1]);
-}
-static void _FaxEncode2DLine(FX_LPBYTE dest_buf, int& dest_bitpos, FX_LPCBYTE src_buf, FX_LPCBYTE ref_buf, int cols)
-{
- int a0 = -1, a0color = 1;
- while (1) {
- int a1 = _FindBit(src_buf, cols, a0 + 1, 1 - a0color);
- int b1, b2;
- _FaxG4FindB1B2(ref_buf, cols, a0, a0color, b1, b2);
- if (b2 < a1) {
- dest_bitpos += 3;
- dest_buf[dest_bitpos / 8] |= 1 << (7 - dest_bitpos % 8);
- dest_bitpos ++;
- a0 = b2;
- } else if (a1 - b1 <= 3 && b1 - a1 <= 3) {
- int delta = a1 - b1;
- switch (delta) {
- case 0:
- dest_buf[dest_bitpos / 8] |= 1 << (7 - dest_bitpos % 8);
- break;
- case 1:
- case 2:
- case 3:
- dest_bitpos += delta == 1 ? 1 : delta + 2;
- dest_buf[dest_bitpos / 8] |= 1 << (7 - dest_bitpos % 8);
- dest_bitpos ++;
- dest_buf[dest_bitpos / 8] |= 1 << (7 - dest_bitpos % 8);
- break;
- case -1:
- case -2:
- case -3:
- dest_bitpos += delta == -1 ? 1 : -delta + 2;
- dest_buf[dest_bitpos / 8] |= 1 << (7 - dest_bitpos % 8);
- dest_bitpos ++;
- break;
- }
- dest_bitpos ++;
- a0 = a1;
- a0color = 1 - a0color;
- } else {
- int a2 = _FindBit(src_buf, cols, a1 + 1, a0color);
- dest_bitpos ++;
- dest_bitpos ++;
- dest_buf[dest_bitpos / 8] |= 1 << (7 - dest_bitpos % 8);
- dest_bitpos ++;
- if (a0 < 0) {
- a0 = 0;
- }
- _FaxEncodeRun(dest_buf, dest_bitpos, a1 - a0, a0color);
- _FaxEncodeRun(dest_buf, dest_bitpos, a2 - a1, 1 - a0color);
- a0 = a2;
- }
- if (a0 >= cols) {
- return;
- }
- }
-}
-class CCodec_FaxEncoder : public CFX_Object
-{
-public:
- CCodec_FaxEncoder(FX_LPCBYTE src_buf, int width, int height, int pitch);
- ~CCodec_FaxEncoder();
- void Encode(FX_LPBYTE& dest_buf, FX_DWORD& dest_size);
- void Encode2DLine(FX_LPCBYTE scan_line);
- CFX_BinaryBuf m_DestBuf;
- FX_LPBYTE m_pRefLine, m_pLineBuf;
- int m_Cols, m_Rows, m_Pitch;
- FX_LPCBYTE m_pSrcBuf;
-};
-CCodec_FaxEncoder::CCodec_FaxEncoder(FX_LPCBYTE src_buf, int width, int height, int pitch)
-{
- m_pSrcBuf = src_buf;
- m_Cols = width;
- m_Rows = height;
- m_Pitch = pitch;
- m_pRefLine = FX_Alloc(FX_BYTE, m_Pitch);
- if (m_pRefLine == NULL) {
- return;
- }
- FXSYS_memset8(m_pRefLine, 0xff, m_Pitch);
- m_pLineBuf = FX_Alloc(FX_BYTE, m_Pitch * 8);
- if (m_pLineBuf == NULL) {
- return;
- }
- m_DestBuf.EstimateSize(0, 10240);
-}
-CCodec_FaxEncoder::~CCodec_FaxEncoder()
-{
- if (m_pRefLine) {
- FX_Free(m_pRefLine);
- }
- if (m_pLineBuf) {
- FX_Free(m_pLineBuf);
- }
-}
-void CCodec_FaxEncoder::Encode(FX_LPBYTE& dest_buf, FX_DWORD& dest_size)
-{
- int dest_bitpos = 0;
- FX_BYTE last_byte = 0;
- for (int i = 0; i < m_Rows; i ++) {
- FX_LPCBYTE scan_line = m_pSrcBuf + i * m_Pitch;
- FXSYS_memset32(m_pLineBuf, 0, m_Pitch * 8);
- m_pLineBuf[0] = last_byte;
- _FaxEncode2DLine(m_pLineBuf, dest_bitpos, scan_line, m_pRefLine, m_Cols);
- m_DestBuf.AppendBlock(m_pLineBuf, dest_bitpos / 8);
- last_byte = m_pLineBuf[dest_bitpos / 8];
- dest_bitpos %= 8;
- FXSYS_memcpy32(m_pRefLine, scan_line, m_Pitch);
- }
- if (dest_bitpos) {
- m_DestBuf.AppendByte(last_byte);
- }
- dest_buf = m_DestBuf.GetBuffer();
- dest_size = m_DestBuf.GetSize();
- m_DestBuf.DetachBuffer();
-}
-FX_BOOL CCodec_FaxModule::Encode(FX_LPCBYTE src_buf, int width, int height, int pitch, FX_LPBYTE& dest_buf, FX_DWORD& dest_size)
-{
- CCodec_FaxEncoder encoder(src_buf, width, height, pitch);
- encoder.Encode(dest_buf, dest_size);
- return TRUE;
-}
-ICodec_ScanlineDecoder* CCodec_FaxModule::CreateDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height,
- int K, FX_BOOL EndOfLine, FX_BOOL EncodedByteAlign, FX_BOOL BlackIs1, int Columns, int Rows)
-{
- CCodec_FaxDecoder* pDecoder = FX_NEW CCodec_FaxDecoder;
- if (pDecoder == NULL) {
- return NULL;
- }
- pDecoder->Create(src_buf, src_size, width, height, K, EndOfLine, EncodedByteAlign, BlackIs1, Columns, Rows);
- return pDecoder;
-}
+// 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
+
+#include "../../../include/fxcodec/fx_codec.h"
+#include "codec_int.h"
+extern const FX_BYTE OneLeadPos[256];
+extern const FX_BYTE ZeroLeadPos[256];
+int _FindBit(const FX_BYTE* data_buf, int max_pos, int start_pos, int bit)
+{
+ if (start_pos >= max_pos) {
+ return max_pos;
+ }
+ FX_LPCBYTE leading_pos = bit ? OneLeadPos : ZeroLeadPos;
+ if (start_pos % 8) {
+ FX_BYTE data = data_buf[start_pos / 8];
+ if (bit) {
+ data &= 0xff >> (start_pos % 8);
+ } else {
+ data |= 0xff << (8 - start_pos % 8);
+ }
+ if (leading_pos[data] < 8) {
+ return start_pos / 8 * 8 + leading_pos[data];
+ }
+ start_pos += 7;
+ }
+ FX_BYTE skip = bit ? 0x00 : 0xff;
+ int byte_pos = start_pos / 8;
+ int max_byte = (max_pos + 7) / 8;
+ while (byte_pos < max_byte) {
+ if (data_buf[byte_pos] != skip) {
+ break;
+ }
+ byte_pos ++;
+ }
+ if (byte_pos == max_byte) {
+ return max_pos;
+ }
+ int pos = leading_pos[data_buf[byte_pos]] + byte_pos * 8;
+ if (pos > max_pos) {
+ pos = max_pos;
+ }
+ return pos;
+}
+void _FaxG4FindB1B2(const FX_BYTE* ref_buf, int columns, int a0, FX_BOOL a0color, int& b1, int& b2)
+{
+ if (a0color) {
+ a0color = 1;
+ }
+ FX_BYTE first_bit = (a0 < 0) ? 1 : ((ref_buf[a0 / 8] & (1 << (7 - a0 % 8))) != 0);
+ b1 = _FindBit(ref_buf, columns, a0 + 1, !first_bit);
+ if (b1 >= columns) {
+ b1 = b2 = columns;
+ return;
+ }
+ if (first_bit == !a0color) {
+ b1 = _FindBit(ref_buf, columns, b1 + 1, first_bit);
+ first_bit = !first_bit;
+ }
+ if (b1 >= columns) {
+ b1 = b2 = columns;
+ return;
+ }
+ b2 = _FindBit(ref_buf, columns, b1 + 1, first_bit);
+}
+void _FaxFillBits(FX_LPBYTE dest_buf, int columns, int startpos, int endpos)
+{
+ if (startpos < 0) {
+ startpos = 0;
+ }
+ if (endpos < 0) {
+ endpos = 0;
+ }
+ if (endpos >= columns) {
+ endpos = columns;
+ }
+ if (startpos >= endpos) {
+ return;
+ }
+ int first_byte = startpos / 8;
+ int last_byte = (endpos - 1) / 8;
+ if (first_byte == last_byte) {
+ for (int i = startpos % 8; i <= (endpos - 1) % 8; i ++) {
+ dest_buf[first_byte] -= 1 << (7 - i);
+ }
+ return;
+ }
+ int i;
+ for (i = startpos % 8; i < 8; i ++) {
+ dest_buf[first_byte] -= 1 << (7 - i);
+ }
+ for (i = 0; i <= (endpos - 1) % 8; i ++) {
+ dest_buf[last_byte] -= 1 << (7 - i);
+ }
+ if (last_byte > first_byte + 1) {
+ FXSYS_memset32(dest_buf + first_byte + 1, 0, last_byte - first_byte - 1);
+ }
+}
+#define NEXTBIT src_buf[bitpos/8] & (1 << (7-bitpos%8)); bitpos ++;
+#define ADDBIT(code, bit) code = code << 1; if (bit) code ++;
+#define GETBIT(bitpos) src_buf[bitpos/8] & (1 << (7-bitpos%8))
+static const FX_BYTE FaxBlackRunIns[] = {
+ 0,
+ 2,
+ 0x02, 3, 0,
+ 0x03, 2, 0,
+ 2,
+ 0x02, 1, 0,
+ 0x03, 4, 0,
+ 2,
+ 0x02, 6, 0,
+ 0x03, 5, 0,
+ 1,
+ 0x03, 7, 0,
+ 2,
+ 0x04, 9, 0,
+ 0x05, 8, 0,
+ 3,
+ 0x04, 10, 0,
+ 0x05, 11, 0,
+ 0x07, 12, 0,
+ 2,
+ 0x04, 13, 0,
+ 0x07, 14, 0,
+ 1,
+ 0x18, 15, 0,
+ 5,
+ 0x08, 18, 0,
+ 0x0f, 64, 0,
+ 0x17, 16, 0,
+ 0x18, 17, 0,
+ 0x37, 0, 0,
+ 10,
+ 0x08, 0x00, 0x07,
+ 0x0c, 0x40, 0x07,
+ 0x0d, 0x80, 0x07,
+ 0x17, 24, 0,
+ 0x18, 25, 0,
+ 0x28, 23, 0,
+ 0x37, 22, 0,
+ 0x67, 19, 0,
+ 0x68, 20, 0,
+ 0x6c, 21, 0,
+ 54,
+ 0x12, 1984 % 256, 1984 / 256,
+ 0x13, 2048 % 256, 2048 / 256,
+ 0x14, 2112 % 256, 2112 / 256,
+ 0x15, 2176 % 256, 2176 / 256,
+ 0x16, 2240 % 256, 2240 / 256,
+ 0x17, 2304 % 256, 2304 / 256,
+ 0x1c, 2368 % 256, 2368 / 256,
+ 0x1d, 2432 % 256, 2432 / 256,
+ 0x1e, 2496 % 256, 2496 / 256,
+ 0x1f, 2560 % 256, 2560 / 256,
+ 0x24, 52, 0,
+ 0x27, 55, 0,
+ 0x28, 56, 0,
+ 0x2b, 59, 0,
+ 0x2c, 60, 0,
+ 0x33, 320 % 256, 320 / 256,
+ 0x34, 384 % 256, 384 / 256,
+ 0x35, 448 % 256, 448 / 256,
+ 0x37, 53, 0,
+ 0x38, 54, 0,
+ 0x52, 50, 0,
+ 0x53, 51, 0,
+ 0x54, 44, 0,
+ 0x55, 45, 0,
+ 0x56, 46, 0,
+ 0x57, 47, 0,
+ 0x58, 57, 0,
+ 0x59, 58, 0,
+ 0x5a, 61, 0,
+ 0x5b, 256 % 256, 256 / 256,
+ 0x64, 48, 0,
+ 0x65, 49, 0,
+ 0x66, 62, 0,
+ 0x67, 63, 0,
+ 0x68, 30, 0,
+ 0x69, 31, 0,
+ 0x6a, 32, 0,
+ 0x6b, 33, 0,
+ 0x6c, 40, 0,
+ 0x6d, 41, 0,
+ 0xc8, 128, 0,
+ 0xc9, 192, 0,
+ 0xca, 26, 0,
+ 0xcb, 27, 0,
+ 0xcc, 28, 0,
+ 0xcd, 29, 0,
+ 0xd2, 34, 0,
+ 0xd3, 35, 0,
+ 0xd4, 36, 0,
+ 0xd5, 37, 0,
+ 0xd6, 38, 0,
+ 0xd7, 39, 0,
+ 0xda, 42, 0,
+ 0xdb, 43, 0,
+ 20,
+ 0x4a, 640 % 256, 640 / 256,
+ 0x4b, 704 % 256, 704 / 256,
+ 0x4c, 768 % 256, 768 / 256,
+ 0x4d, 832 % 256, 832 / 256,
+ 0x52, 1280 % 256, 1280 / 256,
+ 0x53, 1344 % 256, 1344 / 256,
+ 0x54, 1408 % 256, 1408 / 256,
+ 0x55, 1472 % 256, 1472 / 256,
+ 0x5a, 1536 % 256, 1536 / 256,
+ 0x5b, 1600 % 256, 1600 / 256,
+ 0x64, 1664 % 256, 1664 / 256,
+ 0x65, 1728 % 256, 1728 / 256,
+ 0x6c, 512 % 256, 512 / 256,
+ 0x6d, 576 % 256, 576 / 256,
+ 0x72, 896 % 256, 896 / 256,
+ 0x73, 960 % 256, 960 / 256,
+ 0x74, 1024 % 256, 1024 / 256,
+ 0x75, 1088 % 256, 1088 / 256,
+ 0x76, 1152 % 256, 1152 / 256,
+ 0x77, 1216 % 256, 1216 / 256,
+ 0xff
+};
+static const FX_BYTE FaxWhiteRunIns[] = {
+ 0,
+ 0,
+ 0,
+ 6,
+ 0x07, 2, 0,
+ 0x08, 3, 0,
+ 0x0B, 4, 0,
+ 0x0C, 5, 0,
+ 0x0E, 6, 0,
+ 0x0F, 7, 0,
+ 6,
+ 0x07, 10, 0,
+ 0x08, 11, 0,
+ 0x12, 128, 0,
+ 0x13, 8, 0,
+ 0x14, 9, 0,
+ 0x1b, 64, 0,
+ 9,
+ 0x03, 13, 0,
+ 0x07, 1, 0,
+ 0x08, 12, 0,
+ 0x17, 192, 0,
+ 0x18, 1664 % 256, 1664 / 256,
+ 0x2a, 16, 0,
+ 0x2B, 17, 0,
+ 0x34, 14, 0,
+ 0x35, 15, 0,
+ 12,
+ 0x03, 22, 0,
+ 0x04, 23, 0,
+ 0x08, 20, 0,
+ 0x0c, 19, 0,
+ 0x13, 26, 0,
+ 0x17, 21, 0,
+ 0x18, 28, 0,
+ 0x24, 27, 0,
+ 0x27, 18, 0,
+ 0x28, 24, 0,
+ 0x2B, 25, 0,
+ 0x37, 256 % 256, 256 / 256,
+ 42,
+ 0x02, 29, 0,
+ 0x03, 30, 0,
+ 0x04, 45, 0,
+ 0x05, 46, 0,
+ 0x0a, 47, 0,
+ 0x0b, 48, 0,
+ 0x12, 33, 0,
+ 0x13, 34, 0,
+ 0x14, 35, 0,
+ 0x15, 36, 0,
+ 0x16, 37, 0,
+ 0x17, 38, 0,
+ 0x1a, 31, 0,
+ 0x1b, 32, 0,
+ 0x24, 53, 0,
+ 0x25, 54, 0,
+ 0x28, 39, 0,
+ 0x29, 40, 0,
+ 0x2a, 41, 0,
+ 0x2b, 42, 0,
+ 0x2c, 43, 0,
+ 0x2d, 44, 0,
+ 0x32, 61, 0,
+ 0x33, 62, 0,
+ 0x34, 63, 0,
+ 0x35, 0, 0,
+ 0x36, 320 % 256, 320 / 256,
+ 0x37, 384 % 256, 384 / 256,
+ 0x4a, 59, 0,
+ 0x4b, 60, 0,
+ 0x52, 49, 0,
+ 0x53, 50, 0,
+ 0x54, 51, 0,
+ 0x55, 52, 0,
+ 0x58, 55, 0,
+ 0x59, 56, 0,
+ 0x5a, 57, 0,
+ 0x5b, 58, 0,
+ 0x64, 448 % 256, 448 / 256,
+ 0x65, 512 % 256, 512 / 256,
+ 0x67, 640 % 256, 640 / 256,
+ 0x68, 576 % 256, 576 / 256,
+ 16,
+ 0x98, 1472 % 256, 1472 / 256,
+ 0x99, 1536 % 256, 1536 / 256,
+ 0x9a, 1600 % 256, 1600 / 256,
+ 0x9b, 1728 % 256, 1728 / 256,
+ 0xcc, 704 % 256, 704 / 256,
+ 0xcd, 768 % 256, 768 / 256,
+ 0xd2, 832 % 256, 832 / 256,
+ 0xd3, 896 % 256, 896 / 256,
+ 0xd4, 960 % 256, 960 / 256,
+ 0xd5, 1024 % 256, 1024 / 256,
+ 0xd6, 1088 % 256, 1088 / 256,
+ 0xd7, 1152 % 256, 1152 / 256,
+ 0xd8, 1216 % 256, 1216 / 256,
+ 0xd9, 1280 % 256, 1280 / 256,
+ 0xda, 1344 % 256, 1344 / 256,
+ 0xdb, 1408 % 256, 1408 / 256,
+ 0,
+ 3,
+ 0x08, 1792 % 256, 1792 / 256,
+ 0x0c, 1856 % 256, 1856 / 256,
+ 0x0d, 1920 % 256, 1920 / 256,
+ 10,
+ 0x12, 1984 % 256, 1984 / 256,
+ 0x13, 2048 % 256, 2048 / 256,
+ 0x14, 2112 % 256, 2112 / 256,
+ 0x15, 2176 % 256, 2176 / 256,
+ 0x16, 2240 % 256, 2240 / 256,
+ 0x17, 2304 % 256, 2304 / 256,
+ 0x1c, 2368 % 256, 2368 / 256,
+ 0x1d, 2432 % 256, 2432 / 256,
+ 0x1e, 2496 % 256, 2496 / 256,
+ 0x1f, 2560 % 256, 2560 / 256,
+ 0xff,
+};
+int _FaxGetRun(FX_LPCBYTE ins_array, const FX_BYTE* src_buf, int& bitpos, int bitsize)
+{
+ FX_DWORD code = 0;
+ int ins_off = 0;
+ while (1) {
+ FX_BYTE ins = ins_array[ins_off++];
+ if (ins == 0xff) {
+ return -1;
+ }
+ if (bitpos >= bitsize) {
+ return -1;
+ }
+ code <<= 1;
+ if (src_buf[bitpos / 8] & (1 << (7 - bitpos % 8))) {
+ code ++;
+ }
+ bitpos ++;
+ int next_off = ins_off + ins * 3;
+ for (; ins_off < next_off; ins_off += 3) {
+ if (ins_array[ins_off] == code) {
+ return ins_array[ins_off + 1] + ins_array[ins_off + 2] * 256;
+ }
+ }
+ }
+}
+FX_BOOL _FaxG4GetRow(const FX_BYTE* src_buf, int bitsize, int& bitpos, FX_LPBYTE dest_buf, const FX_BYTE* ref_buf, int columns)
+{
+ int a0 = -1, a0color = 1;
+ while (1) {
+ if (bitpos >= bitsize) {
+ return FALSE;
+ }
+ int a1, a2, b1, b2;
+ _FaxG4FindB1B2(ref_buf, columns, a0, a0color, b1, b2);
+ FX_BOOL bit = NEXTBIT;
+ int v_delta = 0;
+ if (bit) {
+ } else {
+ if (bitpos >= bitsize) {
+ return FALSE;
+ }
+ FX_BOOL bit1 = NEXTBIT;
+ if (bitpos >= bitsize) {
+ return FALSE;
+ }
+ FX_BOOL bit2 = NEXTBIT;
+ if (bit1 && bit2) {
+ v_delta = 1;
+ } else if (bit1) {
+ v_delta = -1;
+ } else if (bit2) {
+ int run_len1 = 0;
+ while (1) {
+ int run = _FaxGetRun(a0color ? FaxWhiteRunIns : FaxBlackRunIns, src_buf, bitpos, bitsize);
+ run_len1 += run;
+ if (run < 64) {
+ break;
+ }
+ }
+ if (a0 < 0) {
+ run_len1 ++;
+ }
+ a1 = a0 + run_len1;
+ if (!a0color) {
+ _FaxFillBits(dest_buf, columns, a0, a1);
+ }
+ int run_len2 = 0;
+ while (1) {
+ int run = _FaxGetRun(a0color ? FaxBlackRunIns : FaxWhiteRunIns, src_buf, bitpos, bitsize);
+ run_len2 += run;
+ if (run < 64) {
+ break;
+ }
+ }
+ a2 = a1 + run_len2;
+ if (a0color) {
+ _FaxFillBits(dest_buf, columns, a1, a2);
+ }
+ a0 = a2;
+ if (a0 < columns) {
+ continue;
+ }
+ return TRUE;
+ } else {
+ if (bitpos >= bitsize) {
+ return FALSE;
+ }
+ bit = NEXTBIT;
+ if (bit) {
+ if (!a0color) {
+ _FaxFillBits(dest_buf, columns, a0, b2);
+ }
+ if (b2 >= columns) {
+ return TRUE;
+ }
+ a0 = b2;
+ continue;
+ } else {
+ if (bitpos >= bitsize) {
+ return FALSE;
+ }
+ FX_BOOL bit1 = NEXTBIT;
+ if (bitpos >= bitsize) {
+ return FALSE;
+ }
+ FX_BOOL bit2 = NEXTBIT;
+ if (bit1 && bit2) {
+ v_delta = 2;
+ } else if (bit1) {
+ v_delta = -2;
+ } else if (bit2) {
+ if (bitpos >= bitsize) {
+ return FALSE;
+ }
+ bit = NEXTBIT;
+ if (bit) {
+ v_delta = 3;
+ } else {
+ v_delta = -3;
+ }
+ } else {
+ if (bitpos >= bitsize) {
+ return FALSE;
+ }
+ bit = NEXTBIT;
+ if (bit) {
+ bitpos += 3;
+ continue;
+ } else {
+ bitpos += 5;
+ return TRUE;
+ }
+ }
+ }
+ }
+ }
+ a1 = b1 + v_delta;
+ if (!a0color) {
+ _FaxFillBits(dest_buf, columns, a0, a1);
+ }
+ if (a1 >= columns) {
+ return TRUE;
+ }
+ a0 = a1;
+ a0color = !a0color;
+ }
+}
+FX_BOOL _FaxSkipEOL(const FX_BYTE* src_buf, int bitsize, int& bitpos)
+{
+ int startbit = bitpos;
+ while (bitpos < bitsize) {
+ int bit = NEXTBIT;
+ if (bit) {
+ if (bitpos - startbit <= 11) {
+ bitpos = startbit;
+ }
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+FX_BOOL _FaxGet1DLine(const FX_BYTE* src_buf, int bitsize, int& bitpos, FX_LPBYTE dest_buf, int columns)
+{
+ int color = TRUE;
+ int startpos = 0;
+ while (1) {
+ if (bitpos >= bitsize) {
+ return FALSE;
+ }
+ int run_len = 0;
+ while (1) {
+ int run = _FaxGetRun(color ? FaxWhiteRunIns : FaxBlackRunIns, src_buf, bitpos, bitsize);
+ if (run < 0) {
+ while (bitpos < bitsize) {
+ int bit = NEXTBIT;
+ if (bit) {
+ return TRUE;
+ }
+ }
+ return FALSE;
+ }
+ run_len += run;
+ if (run < 64) {
+ break;
+ }
+ }
+ if (!color) {
+ _FaxFillBits(dest_buf, columns, startpos, startpos + run_len);
+ }
+ startpos += run_len;
+ if (startpos >= columns) {
+ break;
+ }
+ color = !color;
+ }
+ return TRUE;
+}
+class CCodec_FaxDecoder : public CCodec_ScanlineDecoder
+{
+public:
+ CCodec_FaxDecoder();
+ virtual ~CCodec_FaxDecoder();
+ FX_BOOL Create(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height,
+ int K, FX_BOOL EndOfLine, FX_BOOL EncodedByteAlign, FX_BOOL BlackIs1, int Columns, int Rows);
+ virtual void v_DownScale(int dest_width, int dest_height) {}
+ virtual FX_BOOL v_Rewind();
+ virtual FX_LPBYTE v_GetNextLine();
+ virtual FX_DWORD GetSrcOffset();
+ int m_Encoding, m_bEndOfLine, m_bByteAlign, m_bBlack;
+ int bitpos;
+ FX_LPCBYTE m_pSrcBuf;
+ FX_DWORD m_SrcSize;
+ FX_LPBYTE m_pScanlineBuf, m_pRefBuf;
+};
+CCodec_FaxDecoder::CCodec_FaxDecoder()
+{
+ m_pScanlineBuf = NULL;
+ m_pRefBuf = NULL;
+}
+CCodec_FaxDecoder::~CCodec_FaxDecoder()
+{
+ if (m_pScanlineBuf) {
+ FX_Free(m_pScanlineBuf);
+ }
+ if (m_pRefBuf) {
+ FX_Free(m_pRefBuf);
+ }
+}
+FX_BOOL CCodec_FaxDecoder::Create(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height,
+ int K, FX_BOOL EndOfLine, FX_BOOL EncodedByteAlign, FX_BOOL BlackIs1, int Columns, int Rows)
+{
+ m_Encoding = K;
+ m_bEndOfLine = EndOfLine;
+ m_bByteAlign = EncodedByteAlign;
+ m_bBlack = BlackIs1;
+ m_OrigWidth = Columns;
+ m_OrigHeight = Rows;
+ if (m_OrigWidth == 0) {
+ m_OrigWidth = width;
+ }
+ if (m_OrigHeight == 0) {
+ m_OrigHeight = height;
+ }
+ m_Pitch = (m_OrigWidth + 31) / 32 * 4;
+ m_OutputWidth = m_OrigWidth;
+ m_OutputHeight = m_OrigHeight;
+ m_pScanlineBuf = FX_Alloc(FX_BYTE, m_Pitch);
+ if (m_pScanlineBuf == NULL) {
+ return FALSE;
+ }
+ m_pRefBuf = FX_Alloc(FX_BYTE, m_Pitch);
+ if (m_pRefBuf == NULL) {
+ return FALSE;
+ }
+ m_pSrcBuf = src_buf;
+ m_SrcSize = src_size;
+ m_nComps = 1;
+ m_bpc = 1;
+ m_bColorTransformed = FALSE;
+ return TRUE;
+}
+FX_BOOL CCodec_FaxDecoder::v_Rewind()
+{
+ FXSYS_memset8(m_pRefBuf, 0xff, m_Pitch);
+ bitpos = 0;
+ return TRUE;
+}
+FX_LPBYTE CCodec_FaxDecoder::v_GetNextLine()
+{
+ int bitsize = m_SrcSize * 8;
+ _FaxSkipEOL(m_pSrcBuf, bitsize, bitpos);
+ if (bitpos >= bitsize) {
+ return NULL;
+ }
+ FXSYS_memset8(m_pScanlineBuf, 0xff, m_Pitch);
+ if (m_Encoding < 0) {
+ _FaxG4GetRow(m_pSrcBuf, bitsize, bitpos, m_pScanlineBuf, m_pRefBuf, m_OrigWidth);
+ FXSYS_memcpy32(m_pRefBuf, m_pScanlineBuf, m_Pitch);
+ } else if (m_Encoding == 0) {
+ _FaxGet1DLine(m_pSrcBuf, bitsize, bitpos, m_pScanlineBuf, m_OrigWidth);
+ } else {
+ FX_BOOL bNext1D = m_pSrcBuf[bitpos / 8] & (1 << (7 - bitpos % 8));
+ bitpos ++;
+ if (bNext1D) {
+ _FaxGet1DLine(m_pSrcBuf, bitsize, bitpos, m_pScanlineBuf, m_OrigWidth);
+ } else {
+ _FaxG4GetRow(m_pSrcBuf, bitsize, bitpos, m_pScanlineBuf, m_pRefBuf, m_OrigWidth);
+ }
+ FXSYS_memcpy32(m_pRefBuf, m_pScanlineBuf, m_Pitch);
+ }
+ if (m_bEndOfLine) {
+ _FaxSkipEOL(m_pSrcBuf, bitsize, bitpos);
+ }
+ if (m_bByteAlign && bitpos < bitsize) {
+ int bitpos0 = bitpos;
+ int bitpos1 = (bitpos + 7) / 8 * 8;
+ while (m_bByteAlign && bitpos0 < bitpos1) {
+ int bit = m_pSrcBuf[bitpos0 / 8] & (1 << (7 - bitpos0 % 8));
+ if (bit != 0) {
+ m_bByteAlign = FALSE;
+ } else {
+ bitpos0 ++;
+ }
+ }
+ if (m_bByteAlign) {
+ bitpos = bitpos1;
+ }
+ }
+ if (m_bBlack) {
+ for (int i = 0; i < m_Pitch; i ++) {
+ m_pScanlineBuf[i] = ~m_pScanlineBuf[i];
+ }
+ }
+ return m_pScanlineBuf;
+}
+FX_DWORD CCodec_FaxDecoder::GetSrcOffset()
+{
+ FX_DWORD ret = (bitpos + 7) / 8;
+ if (ret > m_SrcSize) {
+ ret = m_SrcSize;
+ }
+ return ret;
+}
+extern "C" {
+ void _FaxG4Decode(void*, FX_LPCBYTE src_buf, FX_DWORD src_size, int* pbitpos, FX_LPBYTE dest_buf, int width, int height, int pitch)
+ {
+ if (pitch == 0) {
+ pitch = (width + 7) / 8;
+ }
+ FX_LPBYTE ref_buf = FX_Alloc(FX_BYTE, pitch);
+ if (ref_buf == NULL) {
+ return;
+ }
+ FXSYS_memset8(ref_buf, 0xff, pitch);
+ int bitpos = *pbitpos;
+ for (int iRow = 0; iRow < height; iRow ++) {
+ FX_LPBYTE line_buf = dest_buf + iRow * pitch;
+ FXSYS_memset8(line_buf, 0xff, pitch);
+ _FaxG4GetRow(src_buf, src_size << 3, bitpos, line_buf, ref_buf, width);
+ FXSYS_memcpy32(ref_buf, line_buf, pitch);
+ }
+ FX_Free(ref_buf);
+ *pbitpos = bitpos;
+ }
+};
+static const FX_BYTE BlackRunTerminator[128] = {
+ 0x37, 10, 0x02, 3, 0x03, 2, 0x02, 2, 0x03, 3, 0x03, 4, 0x02, 4, 0x03, 5,
+ 0x05, 6, 0x04, 6, 0x04, 7, 0x05, 7, 0x07, 7, 0x04, 8, 0x07, 8, 0x18, 9,
+ 0x17, 10, 0x18, 10, 0x08, 10, 0x67, 11, 0x68, 11, 0x6c, 11, 0x37, 11, 0x28, 11,
+ 0x17, 11, 0x18, 11, 0xca, 12, 0xcb, 12, 0xcc, 12, 0xcd, 12, 0x68, 12, 0x69, 12,
+ 0x6a, 12, 0x6b, 12, 0xd2, 12, 0xd3, 12, 0xd4, 12, 0xd5, 12, 0xd6, 12, 0xd7, 12,
+ 0x6c, 12, 0x6d, 12, 0xda, 12, 0xdb, 12, 0x54, 12, 0x55, 12, 0x56, 12, 0x57, 12,
+ 0x64, 12, 0x65, 12, 0x52, 12, 0x53, 12, 0x24, 12, 0x37, 12, 0x38, 12, 0x27, 12,
+ 0x28, 12, 0x58, 12, 0x59, 12, 0x2b, 12, 0x2c, 12, 0x5a, 12, 0x66, 12, 0x67, 12,
+};
+static const FX_BYTE BlackRunMarkup[80] = {
+ 0x0f, 10, 0xc8, 12, 0xc9, 12, 0x5b, 12, 0x33, 12, 0x34, 12, 0x35, 12, 0x6c, 13,
+ 0x6d, 13, 0x4a, 13, 0x4b, 13, 0x4c, 13, 0x4d, 13, 0x72, 13, 0x73, 13, 0x74, 13,
+ 0x75, 13, 0x76, 13, 0x77, 13, 0x52, 13, 0x53, 13, 0x54, 13, 0x55, 13, 0x5a, 13,
+ 0x5b, 13, 0x64, 13, 0x65, 13, 0x08, 11, 0x0c, 11, 0x0d, 11, 0x12, 12, 0x13, 12,
+ 0x14, 12, 0x15, 12, 0x16, 12, 0x17, 12, 0x1c, 12, 0x1d, 12, 0x1e, 12, 0x1f, 12,
+};
+static const FX_BYTE WhiteRunTerminator[128] = {
+ 0x35, 8,
+ 0x07, 6,
+ 0x07, 4,
+ 0x08, 4,
+ 0x0B, 4,
+ 0x0C, 4,
+ 0x0E, 4,
+ 0x0F, 4,
+ 0x13, 5,
+ 0x14, 5,
+ 0x07, 5,
+ 0x08, 5,
+ 0x08, 6,
+ 0x03, 6,
+ 0x34, 6,
+ 0x35, 6,
+ 0x2a, 6,
+ 0x2B, 6,
+ 0x27, 7,
+ 0x0c, 7,
+ 0x08, 7,
+ 0x17, 7,
+ 0x03, 7,
+ 0x04, 7,
+ 0x28, 7,
+ 0x2B, 7,
+ 0x13, 7,
+ 0x24, 7,
+ 0x18, 7,
+ 0x02, 8,
+ 0x03, 8,
+ 0x1a, 8,
+ 0x1b, 8,
+ 0x12, 8,
+ 0x13, 8,
+ 0x14, 8,
+ 0x15, 8,
+ 0x16, 8,
+ 0x17, 8,
+ 0x28, 8,
+ 0x29, 8,
+ 0x2a, 8,
+ 0x2b, 8,
+ 0x2c, 8,
+ 0x2d, 8,
+ 0x04, 8,
+ 0x05, 8,
+ 0x0a, 8,
+ 0x0b, 8,
+ 0x52, 8,
+ 0x53, 8,
+ 0x54, 8,
+ 0x55, 8,
+ 0x24, 8,
+ 0x25, 8,
+ 0x58, 8,
+ 0x59, 8,
+ 0x5a, 8,
+ 0x5b, 8,
+ 0x4a, 8,
+ 0x4b, 8,
+ 0x32, 8,
+ 0x33, 8,
+ 0x34, 8,
+};
+static const FX_BYTE WhiteRunMarkup[80] = {
+ 0x1b, 5,
+ 0x12, 5,
+ 0x17, 6,
+ 0x37, 7,
+ 0x36, 8,
+ 0x37, 8,
+ 0x64, 8,
+ 0x65, 8,
+ 0x68, 8,
+ 0x67, 8,
+ 0xcc, 9,
+ 0xcd, 9,
+ 0xd2, 9,
+ 0xd3, 9,
+ 0xd4, 9,
+ 0xd5, 9,
+ 0xd6, 9,
+ 0xd7, 9,
+ 0xd8, 9,
+ 0xd9, 9,
+ 0xda, 9,
+ 0xdb, 9,
+ 0x98, 9,
+ 0x99, 9,
+ 0x9a, 9,
+ 0x18, 6,
+ 0x9b, 9,
+ 0x08, 11,
+ 0x0c, 11,
+ 0x0d, 11,
+ 0x12, 12,
+ 0x13, 12,
+ 0x14, 12,
+ 0x15, 12,
+ 0x16, 12,
+ 0x17, 12,
+ 0x1c, 12,
+ 0x1d, 12,
+ 0x1e, 12,
+ 0x1f, 12,
+};
+static void _AddBitStream(FX_LPBYTE dest_buf, int& dest_bitpos, int data, int bitlen)
+{
+ for (int i = bitlen - 1; i >= 0; i --) {
+ if (data & (1 << i)) {
+ dest_buf[dest_bitpos / 8] |= 1 << (7 - dest_bitpos % 8);
+ }
+ dest_bitpos ++;
+ }
+}
+static void _FaxEncodeRun(FX_LPBYTE dest_buf, int& dest_bitpos, int run, FX_BOOL bWhite)
+{
+ while (run >= 2560) {
+ _AddBitStream(dest_buf, dest_bitpos, 0x1f, 12);
+ run -= 2560;
+ }
+ if (run >= 64) {
+ int markup = run - run % 64;
+ FX_LPCBYTE p = bWhite ? WhiteRunMarkup : BlackRunMarkup;
+ p += (markup / 64 - 1) * 2;
+ _AddBitStream(dest_buf, dest_bitpos, *p, p[1]);
+ }
+ run %= 64;
+ FX_LPCBYTE p = bWhite ? WhiteRunTerminator : BlackRunTerminator;
+ p += run * 2;
+ _AddBitStream(dest_buf, dest_bitpos, *p, p[1]);
+}
+static void _FaxEncode2DLine(FX_LPBYTE dest_buf, int& dest_bitpos, FX_LPCBYTE src_buf, FX_LPCBYTE ref_buf, int cols)
+{
+ int a0 = -1, a0color = 1;
+ while (1) {
+ int a1 = _FindBit(src_buf, cols, a0 + 1, 1 - a0color);
+ int b1, b2;
+ _FaxG4FindB1B2(ref_buf, cols, a0, a0color, b1, b2);
+ if (b2 < a1) {
+ dest_bitpos += 3;
+ dest_buf[dest_bitpos / 8] |= 1 << (7 - dest_bitpos % 8);
+ dest_bitpos ++;
+ a0 = b2;
+ } else if (a1 - b1 <= 3 && b1 - a1 <= 3) {
+ int delta = a1 - b1;
+ switch (delta) {
+ case 0:
+ dest_buf[dest_bitpos / 8] |= 1 << (7 - dest_bitpos % 8);
+ break;
+ case 1:
+ case 2:
+ case 3:
+ dest_bitpos += delta == 1 ? 1 : delta + 2;
+ dest_buf[dest_bitpos / 8] |= 1 << (7 - dest_bitpos % 8);
+ dest_bitpos ++;
+ dest_buf[dest_bitpos / 8] |= 1 << (7 - dest_bitpos % 8);
+ break;
+ case -1:
+ case -2:
+ case -3:
+ dest_bitpos += delta == -1 ? 1 : -delta + 2;
+ dest_buf[dest_bitpos / 8] |= 1 << (7 - dest_bitpos % 8);
+ dest_bitpos ++;
+ break;
+ }
+ dest_bitpos ++;
+ a0 = a1;
+ a0color = 1 - a0color;
+ } else {
+ int a2 = _FindBit(src_buf, cols, a1 + 1, a0color);
+ dest_bitpos ++;
+ dest_bitpos ++;
+ dest_buf[dest_bitpos / 8] |= 1 << (7 - dest_bitpos % 8);
+ dest_bitpos ++;
+ if (a0 < 0) {
+ a0 = 0;
+ }
+ _FaxEncodeRun(dest_buf, dest_bitpos, a1 - a0, a0color);
+ _FaxEncodeRun(dest_buf, dest_bitpos, a2 - a1, 1 - a0color);
+ a0 = a2;
+ }
+ if (a0 >= cols) {
+ return;
+ }
+ }
+}
+class CCodec_FaxEncoder : public CFX_Object
+{
+public:
+ CCodec_FaxEncoder(FX_LPCBYTE src_buf, int width, int height, int pitch);
+ ~CCodec_FaxEncoder();
+ void Encode(FX_LPBYTE& dest_buf, FX_DWORD& dest_size);
+ void Encode2DLine(FX_LPCBYTE scan_line);
+ CFX_BinaryBuf m_DestBuf;
+ FX_LPBYTE m_pRefLine, m_pLineBuf;
+ int m_Cols, m_Rows, m_Pitch;
+ FX_LPCBYTE m_pSrcBuf;
+};
+CCodec_FaxEncoder::CCodec_FaxEncoder(FX_LPCBYTE src_buf, int width, int height, int pitch)
+{
+ m_pSrcBuf = src_buf;
+ m_Cols = width;
+ m_Rows = height;
+ m_Pitch = pitch;
+ m_pRefLine = FX_Alloc(FX_BYTE, m_Pitch);
+ if (m_pRefLine == NULL) {
+ return;
+ }
+ FXSYS_memset8(m_pRefLine, 0xff, m_Pitch);
+ m_pLineBuf = FX_Alloc(FX_BYTE, m_Pitch * 8);
+ if (m_pLineBuf == NULL) {
+ return;
+ }
+ m_DestBuf.EstimateSize(0, 10240);
+}
+CCodec_FaxEncoder::~CCodec_FaxEncoder()
+{
+ if (m_pRefLine) {
+ FX_Free(m_pRefLine);
+ }
+ if (m_pLineBuf) {
+ FX_Free(m_pLineBuf);
+ }
+}
+void CCodec_FaxEncoder::Encode(FX_LPBYTE& dest_buf, FX_DWORD& dest_size)
+{
+ int dest_bitpos = 0;
+ FX_BYTE last_byte = 0;
+ for (int i = 0; i < m_Rows; i ++) {
+ FX_LPCBYTE scan_line = m_pSrcBuf + i * m_Pitch;
+ FXSYS_memset32(m_pLineBuf, 0, m_Pitch * 8);
+ m_pLineBuf[0] = last_byte;
+ _FaxEncode2DLine(m_pLineBuf, dest_bitpos, scan_line, m_pRefLine, m_Cols);
+ m_DestBuf.AppendBlock(m_pLineBuf, dest_bitpos / 8);
+ last_byte = m_pLineBuf[dest_bitpos / 8];
+ dest_bitpos %= 8;
+ FXSYS_memcpy32(m_pRefLine, scan_line, m_Pitch);
+ }
+ if (dest_bitpos) {
+ m_DestBuf.AppendByte(last_byte);
+ }
+ dest_buf = m_DestBuf.GetBuffer();
+ dest_size = m_DestBuf.GetSize();
+ m_DestBuf.DetachBuffer();
+}
+FX_BOOL CCodec_FaxModule::Encode(FX_LPCBYTE src_buf, int width, int height, int pitch, FX_LPBYTE& dest_buf, FX_DWORD& dest_size)
+{
+ CCodec_FaxEncoder encoder(src_buf, width, height, pitch);
+ encoder.Encode(dest_buf, dest_size);
+ return TRUE;
+}
+ICodec_ScanlineDecoder* CCodec_FaxModule::CreateDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height,
+ int K, FX_BOOL EndOfLine, FX_BOOL EncodedByteAlign, FX_BOOL BlackIs1, int Columns, int Rows)
+{
+ CCodec_FaxDecoder* pDecoder = FX_NEW CCodec_FaxDecoder;
+ if (pDecoder == NULL) {
+ return NULL;
+ }
+ pDecoder->Create(src_buf, src_size, width, height, K, EndOfLine, EncodedByteAlign, BlackIs1, Columns, Rows);
+ return pDecoder;
+}
diff --git a/core/src/fxcodec/codec/fx_codec_flate.cpp b/core/src/fxcodec/codec/fx_codec_flate.cpp
index b6f94e021c..4724593a94 100644
--- a/core/src/fxcodec/codec/fx_codec_flate.cpp
+++ b/core/src/fxcodec/codec/fx_codec_flate.cpp
@@ -1,945 +1,945 @@
-// 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
-
-#include "../../fx_zlib.h"
-#include "../../../include/fxcodec/fx_codec.h"
-#include "codec_int.h"
-extern "C"
-{
- static void* my_alloc_func (void* opaque, unsigned int items, unsigned int size)
- {
- return FX_Alloc(FX_BYTE, items * size);
- }
- static void my_free_func (void* opaque, void* address)
- {
- FX_Free(address);
- }
- void* FPDFAPI_FlateInit(void* (*alloc_func)(void*, unsigned int, unsigned int),
- void (*free_func)(void*, void*))
- {
- z_stream* p = (z_stream*)alloc_func(0, 1, sizeof(z_stream));
- if (p == NULL) {
- return NULL;
- }
- FXSYS_memset32(p, 0, sizeof(z_stream));
- p->zalloc = alloc_func;
- p->zfree = free_func;
- inflateInit(p);
- return p;
- }
- void FPDFAPI_FlateInput(void* context, const unsigned char* src_buf, unsigned int src_size)
- {
- ((z_stream*)context)->next_in = (unsigned char*)src_buf;
- ((z_stream*)context)->avail_in = src_size;
- }
- int FPDFAPI_FlateGetTotalOut(void* context)
- {
- return ((z_stream*)context)->total_out;
- }
- int FPDFAPI_FlateOutput(void* context, unsigned char* dest_buf, unsigned int dest_size)
- {
- ((z_stream*)context)->next_out = dest_buf;
- ((z_stream*)context)->avail_out = dest_size;
- unsigned int pre_pos = (unsigned int)FPDFAPI_FlateGetTotalOut(context);
- int ret = inflate((z_stream*)context, Z_SYNC_FLUSH);
- unsigned int post_pos = (unsigned int)FPDFAPI_FlateGetTotalOut(context);
- unsigned int written = post_pos - pre_pos;
- if (written < dest_size) {
- FXSYS_memset8(dest_buf + written, '\0', dest_size - written);
- }
- return ret;
- }
- int FPDFAPI_FlateGetTotalIn(void* context)
- {
- return ((z_stream*)context)->total_in;
- }
- int FPDFAPI_FlateGetAvailOut(void* context)
- {
- return ((z_stream*)context)->avail_out;
- }
- int FPDFAPI_FlateGetAvailIn(void* context)
- {
- return ((z_stream*)context)->avail_in;
- }
- void FPDFAPI_FlateEnd(void* context)
- {
- inflateEnd((z_stream*)context);
- ((z_stream*)context)->zfree(0, context);
- }
- void FPDFAPI_FlateCompress(unsigned char* dest_buf, unsigned long* dest_size, const unsigned char* src_buf, unsigned long src_size)
- {
- compress(dest_buf, dest_size, src_buf, src_size);
- }
-}
-class CLZWDecoder : public CFX_Object
-{
-public:
- FX_BOOL Decode(FX_LPBYTE output, FX_DWORD& outlen, const FX_BYTE* input, FX_DWORD& size, FX_BOOL bEarlyChange);
-private:
- FX_DWORD m_InPos;
- FX_DWORD m_OutPos;
- FX_LPBYTE m_pOutput;
- const FX_BYTE* m_pInput;
- FX_BOOL m_Early;
- void AddCode(FX_DWORD prefix_code, FX_BYTE append_char);
- FX_DWORD m_CodeArray[5021];
- FX_DWORD m_nCodes;
- FX_BYTE m_DecodeStack[4000];
- FX_DWORD m_StackLen;
- void DecodeString(FX_DWORD code);
- int m_CodeLen;
-};
-void CLZWDecoder::AddCode(FX_DWORD prefix_code, FX_BYTE append_char)
-{
- if (m_nCodes + m_Early == 4094) {
- return;
- }
- m_CodeArray[m_nCodes ++] = (prefix_code << 16) | append_char;
- if (m_nCodes + m_Early == 512 - 258) {
- m_CodeLen = 10;
- } else if (m_nCodes + m_Early == 1024 - 258) {
- m_CodeLen = 11;
- } else if (m_nCodes + m_Early == 2048 - 258) {
- m_CodeLen = 12;
- }
-}
-void CLZWDecoder::DecodeString(FX_DWORD code)
-{
- while (1) {
- int index = code - 258;
- if (index < 0 || index >= (int)m_nCodes) {
- break;
- }
- FX_DWORD data = m_CodeArray[index];
- if (m_StackLen >= sizeof(m_DecodeStack)) {
- return;
- }
- m_DecodeStack[m_StackLen++] = (FX_BYTE)data;
- code = data >> 16;
- }
- if (m_StackLen >= sizeof(m_DecodeStack)) {
- return;
- }
- m_DecodeStack[m_StackLen++] = (FX_BYTE)code;
-}
-int CLZWDecoder::Decode(FX_LPBYTE dest_buf, FX_DWORD& dest_size, const FX_BYTE* src_buf, FX_DWORD& src_size, FX_BOOL bEarlyChange)
-{
- m_CodeLen = 9;
- m_InPos = 0;
- m_OutPos = 0;
- m_pInput = src_buf;
- m_pOutput = dest_buf;
- m_Early = bEarlyChange ? 1 : 0;
- m_nCodes = 0;
- FX_DWORD old_code = (FX_DWORD) - 1;
- FX_BYTE last_char;
- while (1) {
- if (m_InPos + m_CodeLen > src_size * 8) {
- break;
- }
- int byte_pos = m_InPos / 8;
- int bit_pos = m_InPos % 8, bit_left = m_CodeLen;
- FX_DWORD code = 0;
- if (bit_pos) {
- bit_left -= 8 - bit_pos;
- code = (m_pInput[byte_pos++] & ((1 << (8 - bit_pos)) - 1)) << bit_left;
- }
- if (bit_left < 8) {
- code |= m_pInput[byte_pos] >> (8 - bit_left);
- } else {
- bit_left -= 8;
- code |= m_pInput[byte_pos++] << bit_left;
- if (bit_left) {
- code |= m_pInput[byte_pos] >> (8 - bit_left);
- }
- }
- m_InPos += m_CodeLen;
- if (code < 256) {
- if (m_OutPos == dest_size) {
- return -5;
- }
- if (m_pOutput) {
- m_pOutput[m_OutPos] = (FX_BYTE)code;
- }
- m_OutPos ++;
- last_char = (FX_BYTE)code;
- if (old_code != (FX_DWORD) - 1) {
- AddCode(old_code, last_char);
- }
- old_code = code;
- } else if (code == 256) {
- m_CodeLen = 9;
- m_nCodes = 0;
- old_code = (FX_DWORD) - 1;
- } else if (code == 257) {
- break;
- } else {
- if (old_code == (FX_DWORD) - 1) {
- return 2;
- }
- m_StackLen = 0;
- if (code >= m_nCodes + 258) {
- if (m_StackLen < sizeof(m_DecodeStack)) {
- m_DecodeStack[m_StackLen++] = last_char;
- }
- DecodeString(old_code);
- } else {
- DecodeString(code);
- }
- if (m_OutPos + m_StackLen > dest_size) {
- return -5;
- }
- if (m_pOutput) {
- for (FX_DWORD i = 0; i < m_StackLen; i ++) {
- m_pOutput[m_OutPos + i] = m_DecodeStack[m_StackLen - i - 1];
- }
- }
- m_OutPos += m_StackLen;
- last_char = m_DecodeStack[m_StackLen - 1];
- if (old_code < 256) {
- AddCode(old_code, last_char);
- } else if (old_code - 258 >= m_nCodes) {
- dest_size = m_OutPos;
- src_size = (m_InPos + 7) / 8;
- return 0;
- } else {
- AddCode(old_code, last_char);
- }
- old_code = code;
- }
- }
- dest_size = m_OutPos;
- src_size = (m_InPos + 7) / 8;
- return 0;
-}
-static FX_BYTE PaethPredictor(int a, int b, int c)
-{
- int p = a + b - c;
- int pa = FXSYS_abs(p - a);
- int pb = FXSYS_abs(p - b);
- int pc = FXSYS_abs(p - c);
- if (pa <= pb && pa <= pc) {
- return (FX_BYTE)a;
- }
- if (pb <= pc) {
- return (FX_BYTE)b;
- }
- return (FX_BYTE)c;
-}
-static void PNG_PredictorEncode(FX_LPBYTE& data_buf, FX_DWORD& data_size, int predictor, int Colors, int BitsPerComponent, int Columns)
-{
- int BytesPerPixel = (Colors * BitsPerComponent + 7) / 8;
- int row_size = (Colors * BitsPerComponent * Columns + 7) / 8;
- int row_count = (data_size + row_size - 1) / row_size;
- int last_row_size = data_size % row_size;
- FX_LPBYTE dest_buf = FX_Alloc( FX_BYTE, (row_size + 1) * row_count);
- if (dest_buf == NULL) {
- return;
- }
- int byte_cnt = 0;
- FX_LPBYTE pSrcData = data_buf;
- FX_LPBYTE pDestData = dest_buf;
- for (int row = 0; row < row_count; row++) {
- if (predictor == 10) {
- pDestData[0] = 0;
- int move_size = row_size;
- if (move_size * (row + 1) > (int)data_size) {
- move_size = data_size - (move_size * row);
- }
- FXSYS_memmove32(pDestData + 1, pSrcData, move_size);
- pDestData += (move_size + 1);
- pSrcData += move_size;
- byte_cnt += move_size;
- continue;
- }
- for (int byte = 0; byte < row_size && byte_cnt < (int)data_size; byte++) {
- switch (predictor) {
- case 11: {
- pDestData[0] = 1;
- FX_BYTE left = 0;
- if (byte >= BytesPerPixel) {
- left = pSrcData[byte - BytesPerPixel];
- }
- pDestData[byte + 1] = pSrcData[byte] - left;
- }
- break;
- case 12: {
- pDestData[0] = 2;
- FX_BYTE up = 0;
- if (row) {
- up = pSrcData[byte - row_size];
- }
- pDestData[byte + 1] = pSrcData[byte] - up;
- }
- break;
- case 13: {
- pDestData[0] = 3;
- FX_BYTE left = 0;
- if (byte >= BytesPerPixel) {
- left = pSrcData[byte - BytesPerPixel];
- }
- FX_BYTE up = 0;
- if (row) {
- up = pSrcData[byte - row_size];
- }
- pDestData[byte + 1] = pSrcData[byte] - (left + up) / 2;
- }
- break;
- case 14: {
- pDestData[0] = 4;
- FX_BYTE left = 0;
- if (byte >= BytesPerPixel) {
- left = pSrcData[byte - BytesPerPixel];
- }
- FX_BYTE up = 0;
- if (row) {
- up = pSrcData[byte - row_size];
- }
- FX_BYTE upper_left = 0;
- if (byte >= BytesPerPixel && row) {
- upper_left = pSrcData[byte - row_size - BytesPerPixel];
- }
- pDestData[byte + 1] = pSrcData[byte] - PaethPredictor(left, up, upper_left);
- }
- break;
- default: {
- pDestData[byte + 1] = pSrcData[byte];
- }
- break;
- }
- byte_cnt++;
- }
- pDestData += (row_size + 1);
- pSrcData += row_size;
- }
- FX_Free(data_buf);
- data_buf = dest_buf;
- data_size = (row_size + 1) * row_count - (last_row_size > 0 ? (row_size - last_row_size) : 0);
-}
-static void PNG_PredictLine(FX_LPBYTE pDestData, FX_LPCBYTE pSrcData, FX_LPCBYTE pLastLine,
- int bpc, int nColors, int nPixels)
-{
- int row_size = (nPixels * bpc * nColors + 7) / 8;
- int BytesPerPixel = (bpc * nColors + 7) / 8;
- FX_BYTE tag = pSrcData[0];
- if (tag == 0) {
- FXSYS_memmove32(pDestData, pSrcData + 1, row_size);
- return;
- }
- for (int byte = 0; byte < row_size; byte ++) {
- FX_BYTE raw_byte = pSrcData[byte + 1];
- switch (tag) {
- case 1: {
- FX_BYTE left = 0;
- if (byte >= BytesPerPixel) {
- left = pDestData[byte - BytesPerPixel];
- }
- pDestData[byte] = raw_byte + left;
- break;
- }
- case 2: {
- FX_BYTE up = 0;
- if (pLastLine) {
- up = pLastLine[byte];
- }
- pDestData[byte] = raw_byte + up;
- break;
- }
- case 3: {
- FX_BYTE left = 0;
- if (byte >= BytesPerPixel) {
- left = pDestData[byte - BytesPerPixel];
- }
- FX_BYTE up = 0;
- if (pLastLine) {
- up = pLastLine[byte];
- }
- pDestData[byte] = raw_byte + (up + left) / 2;
- break;
- }
- case 4: {
- FX_BYTE left = 0;
- if (byte >= BytesPerPixel) {
- left = pDestData[byte - BytesPerPixel];
- }
- FX_BYTE up = 0;
- if (pLastLine) {
- up = pLastLine[byte];
- }
- FX_BYTE upper_left = 0;
- if (byte >= BytesPerPixel && pLastLine) {
- upper_left = pLastLine[byte - BytesPerPixel];
- }
- pDestData[byte] = raw_byte + PaethPredictor(left, up, upper_left);
- break;
- }
- default:
- pDestData[byte] = raw_byte;
- break;
- }
- }
-}
-static void PNG_Predictor(FX_LPBYTE& data_buf, FX_DWORD& data_size,
- int Colors, int BitsPerComponent, int Columns)
-{
- int BytesPerPixel = (Colors * BitsPerComponent + 7) / 8;
- int row_size = (Colors * BitsPerComponent * Columns + 7) / 8;
- int row_count = (data_size + row_size) / (row_size + 1);
- int last_row_size = data_size % (row_size + 1);
- FX_LPBYTE dest_buf = FX_Alloc( FX_BYTE, row_size * row_count);
- if (dest_buf == NULL) {
- return;
- }
- int byte_cnt = 0;
- FX_LPBYTE pSrcData = data_buf;
- FX_LPBYTE pDestData = dest_buf;
- for (int row = 0; row < row_count; row ++) {
- FX_BYTE tag = pSrcData[0];
- if (tag == 0) {
- int move_size = row_size;
- if ((row + 1) * (move_size + 1) > (int)data_size) {
- move_size = last_row_size - 1;
- }
- FXSYS_memmove32(pDestData, pSrcData + 1, move_size);
- pSrcData += move_size + 1;
- pDestData += move_size;
- byte_cnt += move_size + 1;
- continue;
- }
- for (int byte = 0; byte < row_size && byte_cnt < (int)data_size; byte ++) {
- FX_BYTE raw_byte = pSrcData[byte + 1];
- switch (tag) {
- case 1: {
- FX_BYTE left = 0;
- if (byte >= BytesPerPixel) {
- left = pDestData[byte - BytesPerPixel];
- }
- pDestData[byte] = raw_byte + left;
- break;
- }
- case 2: {
- FX_BYTE up = 0;
- if (row) {
- up = pDestData[byte - row_size];
- }
- pDestData[byte] = raw_byte + up;
- break;
- }
- case 3: {
- FX_BYTE left = 0;
- if (byte >= BytesPerPixel) {
- left = pDestData[byte - BytesPerPixel];
- }
- FX_BYTE up = 0;
- if (row) {
- up = pDestData[byte - row_size];
- }
- pDestData[byte] = raw_byte + (up + left) / 2;
- break;
- }
- case 4: {
- FX_BYTE left = 0;
- if (byte >= BytesPerPixel) {
- left = pDestData[byte - BytesPerPixel];
- }
- FX_BYTE up = 0;
- if (row) {
- up = pDestData[byte - row_size];
- }
- FX_BYTE upper_left = 0;
- if (byte >= BytesPerPixel && row) {
- upper_left = pDestData[byte - row_size - BytesPerPixel];
- }
- pDestData[byte] = raw_byte + PaethPredictor(left, up, upper_left);
- break;
- }
- default:
- pDestData[byte] = raw_byte;
- break;
- }
- byte_cnt++;
- }
- pSrcData += row_size + 1;
- pDestData += row_size;
- byte_cnt++;
- }
- FX_Free(data_buf);
- data_buf = dest_buf;
- data_size = row_size * row_count - (last_row_size > 0 ? (row_size + 1 - last_row_size) : 0);
-}
-static void TIFF_PredictorEncodeLine(FX_LPBYTE dest_buf, int row_size, int BitsPerComponent, int Colors, int Columns)
-{
- int BytesPerPixel = BitsPerComponent * Colors / 8;
- if (BitsPerComponent < 8) {
- FX_BYTE mask = 0x01;
- if (BitsPerComponent == 2) {
- mask = 0x03;
- } else if (BitsPerComponent == 4) {
- mask = 0x0F;
- }
- int row_bits = Colors * BitsPerComponent * Columns;
- for (int i = row_bits - BitsPerComponent; i >= BitsPerComponent; i -= BitsPerComponent) {
- int col = i % 8;
- int index = i / 8;
- int col_pre = (col == 0) ? (8 - BitsPerComponent) : (col - BitsPerComponent);
- int index_pre = (col == 0) ? (index - 1) : index;
- FX_BYTE cur = (dest_buf[index] >> (8 - col - BitsPerComponent)) & mask;
- FX_BYTE left = (dest_buf[index_pre] >> (8 - col_pre - BitsPerComponent)) & mask;
- cur -= left;
- cur &= mask;
- cur <<= (8 - col - BitsPerComponent);
- dest_buf[index] &= ~(mask << ((8 - col - BitsPerComponent)));
- dest_buf[index] |= cur;
- }
- } else if (BitsPerComponent == 8) {
- for (int i = row_size - 1; i >= BytesPerPixel; i--) {
- dest_buf[i] -= dest_buf[i - BytesPerPixel];
- }
- } else {
- for (int i = row_size - BytesPerPixel; i >= BytesPerPixel; i -= BytesPerPixel) {
- FX_WORD pixel = (dest_buf[i] << 8) | dest_buf[i + 1];
- pixel -= (dest_buf[i - BytesPerPixel] << 8) | dest_buf[i - BytesPerPixel + 1];
- dest_buf[i] = pixel >> 8;
- dest_buf[i + 1] = (FX_BYTE)pixel;
- }
- }
-}
-static void TIFF_PredictorEncode(FX_LPBYTE& data_buf, FX_DWORD& data_size,
- int Colors, int BitsPerComponent, int Columns)
-{
- int row_size = (Colors * BitsPerComponent * Columns + 7) / 8;
- int row_count = (data_size + row_size - 1) / row_size;
- int last_row_size = data_size % row_size;
- for (int row = 0; row < row_count; row++) {
- FX_LPBYTE scan_line = data_buf + row * row_size;
- if ((row + 1) * row_size > (int)data_size) {
- row_size = last_row_size;
- }
- TIFF_PredictorEncodeLine(scan_line, row_size, BitsPerComponent, Colors, Columns);
- }
-}
-static void TIFF_PredictLine(FX_LPBYTE dest_buf, int row_size, int BitsPerComponent, int Colors, int Columns)
-{
- if (BitsPerComponent == 1) {
- int row_bits = BitsPerComponent * Colors * Columns;
- for(int i = 1; i < row_bits; i ++) {
- int col = i % 8;
- int index = i / 8;
- int index_pre = (col == 0) ? (index - 1) : index;
- int col_pre = (col == 0) ? 8 : col;
- if( ((dest_buf[index] >> (7 - col)) & 1) ^ ((dest_buf[index_pre] >> (8 - col_pre)) & 1) ) {
- dest_buf[index] |= 1 << (7 - col);
- } else {
- dest_buf[index] &= ~(1 << (7 - col));
- }
- }
- return;
- }
- int BytesPerPixel = BitsPerComponent * Colors / 8;
- if (BitsPerComponent == 16) {
- for (int i = BytesPerPixel; i < row_size; i += 2) {
- FX_WORD pixel = (dest_buf[i - BytesPerPixel] << 8) | dest_buf[i - BytesPerPixel + 1];
- pixel += (dest_buf[i] << 8) | dest_buf[i + 1];
- dest_buf[i] = pixel >> 8;
- dest_buf[i + 1] = (FX_BYTE)pixel;
- }
- } else {
- for (int i = BytesPerPixel; i < row_size; i ++) {
- dest_buf[i] += dest_buf[i - BytesPerPixel];
- }
- }
-}
-static void TIFF_Predictor(FX_LPBYTE& data_buf, FX_DWORD& data_size,
- int Colors, int BitsPerComponent, int Columns)
-{
- int row_size = (Colors * BitsPerComponent * Columns + 7) / 8;
- int row_count = (data_size + row_size - 1) / row_size;
- int last_row_size = data_size % row_size;
- for (int row = 0; row < row_count; row ++) {
- FX_LPBYTE scan_line = data_buf + row * row_size;
- if ((row + 1) * row_size > (int)data_size) {
- row_size = last_row_size;
- }
- TIFF_PredictLine(scan_line, row_size, BitsPerComponent, Colors, Columns);
- }
-}
-class CCodec_FlateScanlineDecoder : public CCodec_ScanlineDecoder
-{
-public:
- CCodec_FlateScanlineDecoder();
- ~CCodec_FlateScanlineDecoder();
- FX_BOOL Create(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height, int nComps, int bpc,
- int predictor, int Colors, int BitsPerComponent, int Columns);
- virtual void Destroy()
- {
- delete this;
- }
- virtual void v_DownScale(int dest_width, int dest_height) {}
- virtual FX_BOOL v_Rewind();
- virtual FX_LPBYTE v_GetNextLine();
- virtual FX_DWORD GetSrcOffset();
- void* m_pFlate;
- FX_LPCBYTE m_SrcBuf;
- FX_DWORD m_SrcSize;
- FX_LPBYTE m_pScanline;
- FX_LPBYTE m_pLastLine;
- FX_LPBYTE m_pPredictBuffer;
- FX_LPBYTE m_pPredictRaw;
- int m_Predictor;
- int m_Colors, m_BitsPerComponent, m_Columns, m_PredictPitch, m_LeftOver;
-};
-CCodec_FlateScanlineDecoder::CCodec_FlateScanlineDecoder()
-{
- m_pFlate = NULL;
- m_pScanline = NULL;
- m_pLastLine = NULL;
- m_pPredictBuffer = NULL;
- m_pPredictRaw = NULL;
- m_LeftOver = 0;
-}
-CCodec_FlateScanlineDecoder::~CCodec_FlateScanlineDecoder()
-{
- if (m_pScanline) {
- FX_Free(m_pScanline);
- }
- if (m_pLastLine) {
- FX_Free(m_pLastLine);
- }
- if (m_pPredictBuffer) {
- FX_Free(m_pPredictBuffer);
- }
- if (m_pPredictRaw) {
- FX_Free(m_pPredictRaw);
- }
- if (m_pFlate) {
- FPDFAPI_FlateEnd(m_pFlate);
- }
-}
-FX_BOOL CCodec_FlateScanlineDecoder::Create(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height,
- int nComps, int bpc, int predictor, int Colors, int BitsPerComponent, int Columns)
-{
- m_SrcBuf = src_buf;
- m_SrcSize = src_size;
- m_OutputWidth = m_OrigWidth = width;
- m_OutputHeight = m_OrigHeight = height;
- m_nComps = nComps;
- m_bpc = bpc;
- m_bColorTransformed = FALSE;
- m_Pitch = (width * nComps * bpc + 7) / 8;
- m_pScanline = FX_Alloc(FX_BYTE, m_Pitch);
- if (m_pScanline == NULL) {
- return FALSE;
- }
- m_Predictor = 0;
- if (predictor) {
- if (predictor >= 10) {
- m_Predictor = 2;
- } else if (predictor == 2) {
- m_Predictor = 1;
- }
- if (m_Predictor) {
- if (BitsPerComponent * Colors * Columns == 0) {
- BitsPerComponent = m_bpc;
- Colors = m_nComps;
- Columns = m_OrigWidth;
- }
- m_Colors = Colors;
- m_BitsPerComponent = BitsPerComponent;
- m_Columns = Columns;
- m_PredictPitch = (m_BitsPerComponent * m_Colors * m_Columns + 7) / 8;
- m_pLastLine = FX_Alloc(FX_BYTE, m_PredictPitch);
- if (m_pLastLine == NULL) {
- return FALSE;
- }
- FXSYS_memset32(m_pLastLine, 0, m_PredictPitch);
- m_pPredictRaw = FX_Alloc(FX_BYTE, m_PredictPitch + 1);
- if (m_pPredictRaw == NULL) {
- return FALSE;
- }
- m_pPredictBuffer = FX_Alloc(FX_BYTE, m_PredictPitch);
- if (m_pPredictBuffer == NULL) {
- return FALSE;
- }
- }
- }
- return TRUE;
-}
-FX_BOOL CCodec_FlateScanlineDecoder::v_Rewind()
-{
- if (m_pFlate) {
- FPDFAPI_FlateEnd(m_pFlate);
- }
- m_pFlate = FPDFAPI_FlateInit(my_alloc_func, my_free_func);
- if (m_pFlate == NULL) {
- return FALSE;
- }
- FPDFAPI_FlateInput(m_pFlate, m_SrcBuf, m_SrcSize);
- m_LeftOver = 0;
- return TRUE;
-}
-FX_LPBYTE CCodec_FlateScanlineDecoder::v_GetNextLine()
-{
- if (m_Predictor) {
- if (m_Pitch == m_PredictPitch) {
- if (m_Predictor == 2) {
- FPDFAPI_FlateOutput(m_pFlate, m_pPredictRaw, m_PredictPitch + 1);
- PNG_PredictLine(m_pScanline, m_pPredictRaw, m_pLastLine, m_BitsPerComponent, m_Colors, m_Columns);
- FXSYS_memcpy32(m_pLastLine, m_pScanline, m_PredictPitch);
- } else {
- FPDFAPI_FlateOutput(m_pFlate, m_pScanline, m_Pitch);
- TIFF_PredictLine(m_pScanline, m_PredictPitch, m_bpc, m_nComps, m_OutputWidth);
- }
- } else {
- int bytes_to_go = m_Pitch;
- int read_leftover = m_LeftOver > bytes_to_go ? bytes_to_go : m_LeftOver;
- if (read_leftover) {
- FXSYS_memcpy32(m_pScanline, m_pPredictBuffer + m_PredictPitch - m_LeftOver, read_leftover);
- m_LeftOver -= read_leftover;
- bytes_to_go -= read_leftover;
- }
- while (bytes_to_go) {
- if (m_Predictor == 2) {
- FPDFAPI_FlateOutput(m_pFlate, m_pPredictRaw, m_PredictPitch + 1);
- PNG_PredictLine(m_pPredictBuffer, m_pPredictRaw, m_pLastLine, m_BitsPerComponent, m_Colors, m_Columns);
- FXSYS_memcpy32(m_pLastLine, m_pPredictBuffer, m_PredictPitch);
- } else {
- FPDFAPI_FlateOutput(m_pFlate, m_pPredictBuffer, m_PredictPitch);
- TIFF_PredictLine(m_pPredictBuffer, m_PredictPitch, m_BitsPerComponent, m_Colors, m_Columns);
- }
- int read_bytes = m_PredictPitch > bytes_to_go ? bytes_to_go : m_PredictPitch;
- FXSYS_memcpy32(m_pScanline + m_Pitch - bytes_to_go, m_pPredictBuffer, read_bytes);
- m_LeftOver += m_PredictPitch - read_bytes;
- bytes_to_go -= read_bytes;
- }
- }
- } else {
- FPDFAPI_FlateOutput(m_pFlate, m_pScanline, m_Pitch);
- }
- return m_pScanline;
-}
-FX_DWORD CCodec_FlateScanlineDecoder::GetSrcOffset()
-{
- return FPDFAPI_FlateGetTotalIn(m_pFlate);
-}
-static void FlateUncompress(FX_LPCBYTE src_buf, FX_DWORD src_size, FX_DWORD orig_size,
- FX_LPBYTE& dest_buf, FX_DWORD& dest_size, FX_DWORD& offset)
-{
- FX_DWORD guess_size = orig_size ? orig_size : src_size * 2;
- FX_DWORD alloc_step = orig_size ? 10240 : (src_size < 10240 ? 10240 : src_size);
- static const FX_DWORD kMaxInitialAllocSize = 10000000;
- if (guess_size > kMaxInitialAllocSize) {
- guess_size = kMaxInitialAllocSize;
- alloc_step = kMaxInitialAllocSize;
- }
- FX_LPBYTE guess_buf = FX_Alloc(FX_BYTE, guess_size + 1);
- if (!guess_buf) {
- dest_buf = NULL;
- dest_size = 0;
- return;
- }
- guess_buf[guess_size] = '\0';
- FX_BOOL useOldImpl = src_size < 10240;
- void* context = FPDFAPI_FlateInit(my_alloc_func, my_free_func);
- if (context == NULL) {
- dest_buf = NULL;
- dest_size = 0;
- return ;
- }
- FPDFAPI_FlateInput(context, src_buf, src_size);
- CFX_ArrayTemplate<FX_LPBYTE> result_tmp_bufs;
- FX_LPBYTE buf = guess_buf;
- FX_DWORD buf_size = guess_size;
- FX_DWORD last_buf_size = buf_size;
- while (1) {
- FX_INT32 ret = FPDFAPI_FlateOutput(context, buf, buf_size);
- FX_INT32 avail_buf_size = FPDFAPI_FlateGetAvailOut(context);
- if (!useOldImpl) {
- if (ret != Z_OK) {
- last_buf_size = buf_size - avail_buf_size;
- result_tmp_bufs.Add(buf);
- break;
- }
- if (avail_buf_size == 0) {
- result_tmp_bufs.Add(buf);
- buf = NULL;
- buf = FX_Alloc(FX_BYTE, buf_size + 1);
- if (!buf) {
- dest_buf = NULL;
- dest_size = 0;
- return;
- }
- buf[buf_size] = '\0';
- } else {
- last_buf_size = buf_size - avail_buf_size;
- result_tmp_bufs.Add(buf);
- buf = NULL;
- break;
- }
- } else {
- if (ret != Z_OK) {
- break;
- }
- if (avail_buf_size == 0) {
- FX_DWORD old_size = guess_size;
- guess_size += alloc_step;
- if (guess_size < old_size || guess_size + 1 < guess_size) {
- dest_buf = NULL;
- dest_size = 0;
- return;
- }
- guess_buf = FX_Realloc(FX_BYTE, guess_buf, guess_size + 1);
- if (!guess_buf) {
- dest_buf = NULL;
- dest_size = 0;
- return;
- }
- guess_buf[guess_size] = '\0';
- buf = guess_buf + old_size;
- buf_size = guess_size - old_size;
- } else {
- break;
- }
- }
- }
- dest_size = FPDFAPI_FlateGetTotalOut(context);
- offset = FPDFAPI_FlateGetTotalIn(context);
- if (!useOldImpl) {
- if (result_tmp_bufs.GetSize() == 1) {
- dest_buf = result_tmp_bufs[0];
- } else {
- FX_LPBYTE result_buf = FX_Alloc(FX_BYTE, dest_size);
- if (!result_buf) {
- dest_buf = NULL;
- dest_size = 0;
- return;
- }
- FX_DWORD result_pos = 0;
- for (FX_INT32 i = 0; i < result_tmp_bufs.GetSize(); i++) {
- FX_LPBYTE tmp_buf = result_tmp_bufs[i];
- FX_DWORD tmp_buf_size = buf_size;
- if (i == result_tmp_bufs.GetSize() - 1) {
- tmp_buf_size = last_buf_size;
- }
- FXSYS_memcpy32(result_buf + result_pos, tmp_buf, tmp_buf_size);
- result_pos += tmp_buf_size;
- FX_Free(tmp_buf);
- tmp_buf = NULL;
- result_tmp_bufs[i] = NULL;
- }
- dest_buf = result_buf;
- }
- } else {
- if (guess_size / 2 > dest_size) {
- guess_buf = FX_Realloc(FX_BYTE, guess_buf, dest_size + 1);
- if (!guess_buf) {
- dest_buf = NULL;
- dest_size = 0;
- return;
- }
- guess_size = dest_size;
- guess_buf[guess_size] = '\0';
- }
- dest_buf = guess_buf;
- }
- FPDFAPI_FlateEnd(context);
- context = NULL;
-}
-ICodec_ScanlineDecoder* CCodec_FlateModule::CreateDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height,
- int nComps, int bpc, int predictor, int Colors, int BitsPerComponent, int Columns)
-{
- CCodec_FlateScanlineDecoder* pDecoder = FX_NEW CCodec_FlateScanlineDecoder;
- if (pDecoder == NULL) {
- return NULL;
- }
- pDecoder->Create(src_buf, src_size, width, height, nComps, bpc, predictor, Colors, BitsPerComponent, Columns);
- return pDecoder;
-}
-FX_DWORD CCodec_FlateModule::FlateOrLZWDecode(FX_BOOL bLZW, const FX_BYTE* src_buf, FX_DWORD src_size, FX_BOOL bEarlyChange,
- int predictor, int Colors, int BitsPerComponent, int Columns,
- FX_DWORD estimated_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size)
-{
- CLZWDecoder* pDecoder = NULL;
- dest_buf = NULL;
- FX_DWORD offset = 0;
- int predictor_type = 0;
- if (predictor) {
- if (predictor >= 10) {
- predictor_type = 2;
- } else if (predictor == 2) {
- predictor_type = 1;
- }
- }
- if (bLZW) {
- pDecoder = FX_NEW CLZWDecoder;
- if (pDecoder == NULL) {
- return -1;
- }
- dest_size = (FX_DWORD) - 1;
- offset = src_size;
- int err = pDecoder->Decode(NULL, dest_size, src_buf, offset, bEarlyChange);
- delete pDecoder;
- if (err || dest_size == 0 || dest_size + 1 < dest_size) {
- return (FX_DWORD) - 1;
- }
- pDecoder = FX_NEW CLZWDecoder;
- if (pDecoder == NULL) {
- return -1;
- }
- dest_buf = FX_Alloc( FX_BYTE, dest_size + 1);
- if (dest_buf == NULL) {
- return -1;
- }
- dest_buf[dest_size] = '\0';
- pDecoder->Decode(dest_buf, dest_size, src_buf, offset, bEarlyChange);
- delete pDecoder;
- } else {
- FlateUncompress(src_buf, src_size, estimated_size, dest_buf, dest_size, offset);
- }
- if (predictor_type == 0) {
- return offset;
- }
- if (predictor_type == 2) {
- PNG_Predictor(dest_buf, dest_size, Colors, BitsPerComponent, Columns);
- } else if (predictor_type == 1) {
- TIFF_Predictor(dest_buf, dest_size, Colors, BitsPerComponent, Columns);
- }
- return offset;
-}
-FX_BOOL CCodec_FlateModule::Encode(const FX_BYTE* src_buf, FX_DWORD src_size,
- int predictor, int Colors, int BitsPerComponent, int Columns,
- FX_LPBYTE& dest_buf, FX_DWORD& dest_size)
-{
- if (predictor != 2 && predictor < 10) {
- return Encode(src_buf, src_size, dest_buf, dest_size);
- }
- FX_BOOL ret = FALSE;
- FX_LPBYTE pSrcBuf = NULL;
- pSrcBuf = FX_Alloc(FX_BYTE, src_size);
- if (pSrcBuf == NULL) {
- return FALSE;
- }
- FXSYS_memcpy32(pSrcBuf, src_buf, src_size);
- if (predictor == 2) {
- TIFF_PredictorEncode(pSrcBuf, src_size, Colors, BitsPerComponent, Columns);
- } else if (predictor >= 10) {
- PNG_PredictorEncode(pSrcBuf, src_size, predictor, Colors, BitsPerComponent, Columns);
- }
- ret = Encode(pSrcBuf, src_size, dest_buf, dest_size);
- FX_Free(pSrcBuf);
- return ret;
-}
-FX_BOOL CCodec_FlateModule::Encode(FX_LPCBYTE src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size)
-{
- dest_size = src_size + src_size / 1000 + 12;
- dest_buf = FX_Alloc( FX_BYTE, dest_size);
- if (dest_buf == NULL) {
- return FALSE;
- }
- unsigned long temp_size = dest_size;
- FPDFAPI_FlateCompress(dest_buf, &temp_size, src_buf, src_size);
- dest_size = (FX_DWORD)temp_size;
- return TRUE;
-}
+// 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
+
+#include "../../fx_zlib.h"
+#include "../../../include/fxcodec/fx_codec.h"
+#include "codec_int.h"
+extern "C"
+{
+ static void* my_alloc_func (void* opaque, unsigned int items, unsigned int size)
+ {
+ return FX_Alloc(FX_BYTE, items * size);
+ }
+ static void my_free_func (void* opaque, void* address)
+ {
+ FX_Free(address);
+ }
+ void* FPDFAPI_FlateInit(void* (*alloc_func)(void*, unsigned int, unsigned int),
+ void (*free_func)(void*, void*))
+ {
+ z_stream* p = (z_stream*)alloc_func(0, 1, sizeof(z_stream));
+ if (p == NULL) {
+ return NULL;
+ }
+ FXSYS_memset32(p, 0, sizeof(z_stream));
+ p->zalloc = alloc_func;
+ p->zfree = free_func;
+ inflateInit(p);
+ return p;
+ }
+ void FPDFAPI_FlateInput(void* context, const unsigned char* src_buf, unsigned int src_size)
+ {
+ ((z_stream*)context)->next_in = (unsigned char*)src_buf;
+ ((z_stream*)context)->avail_in = src_size;
+ }
+ int FPDFAPI_FlateGetTotalOut(void* context)
+ {
+ return ((z_stream*)context)->total_out;
+ }
+ int FPDFAPI_FlateOutput(void* context, unsigned char* dest_buf, unsigned int dest_size)
+ {
+ ((z_stream*)context)->next_out = dest_buf;
+ ((z_stream*)context)->avail_out = dest_size;
+ unsigned int pre_pos = (unsigned int)FPDFAPI_FlateGetTotalOut(context);
+ int ret = inflate((z_stream*)context, Z_SYNC_FLUSH);
+ unsigned int post_pos = (unsigned int)FPDFAPI_FlateGetTotalOut(context);
+ unsigned int written = post_pos - pre_pos;
+ if (written < dest_size) {
+ FXSYS_memset8(dest_buf + written, '\0', dest_size - written);
+ }
+ return ret;
+ }
+ int FPDFAPI_FlateGetTotalIn(void* context)
+ {
+ return ((z_stream*)context)->total_in;
+ }
+ int FPDFAPI_FlateGetAvailOut(void* context)
+ {
+ return ((z_stream*)context)->avail_out;
+ }
+ int FPDFAPI_FlateGetAvailIn(void* context)
+ {
+ return ((z_stream*)context)->avail_in;
+ }
+ void FPDFAPI_FlateEnd(void* context)
+ {
+ inflateEnd((z_stream*)context);
+ ((z_stream*)context)->zfree(0, context);
+ }
+ void FPDFAPI_FlateCompress(unsigned char* dest_buf, unsigned long* dest_size, const unsigned char* src_buf, unsigned long src_size)
+ {
+ compress(dest_buf, dest_size, src_buf, src_size);
+ }
+}
+class CLZWDecoder : public CFX_Object
+{
+public:
+ FX_BOOL Decode(FX_LPBYTE output, FX_DWORD& outlen, const FX_BYTE* input, FX_DWORD& size, FX_BOOL bEarlyChange);
+private:
+ FX_DWORD m_InPos;
+ FX_DWORD m_OutPos;
+ FX_LPBYTE m_pOutput;
+ const FX_BYTE* m_pInput;
+ FX_BOOL m_Early;
+ void AddCode(FX_DWORD prefix_code, FX_BYTE append_char);
+ FX_DWORD m_CodeArray[5021];
+ FX_DWORD m_nCodes;
+ FX_BYTE m_DecodeStack[4000];
+ FX_DWORD m_StackLen;
+ void DecodeString(FX_DWORD code);
+ int m_CodeLen;
+};
+void CLZWDecoder::AddCode(FX_DWORD prefix_code, FX_BYTE append_char)
+{
+ if (m_nCodes + m_Early == 4094) {
+ return;
+ }
+ m_CodeArray[m_nCodes ++] = (prefix_code << 16) | append_char;
+ if (m_nCodes + m_Early == 512 - 258) {
+ m_CodeLen = 10;
+ } else if (m_nCodes + m_Early == 1024 - 258) {
+ m_CodeLen = 11;
+ } else if (m_nCodes + m_Early == 2048 - 258) {
+ m_CodeLen = 12;
+ }
+}
+void CLZWDecoder::DecodeString(FX_DWORD code)
+{
+ while (1) {
+ int index = code - 258;
+ if (index < 0 || index >= (int)m_nCodes) {
+ break;
+ }
+ FX_DWORD data = m_CodeArray[index];
+ if (m_StackLen >= sizeof(m_DecodeStack)) {
+ return;
+ }
+ m_DecodeStack[m_StackLen++] = (FX_BYTE)data;
+ code = data >> 16;
+ }
+ if (m_StackLen >= sizeof(m_DecodeStack)) {
+ return;
+ }
+ m_DecodeStack[m_StackLen++] = (FX_BYTE)code;
+}
+int CLZWDecoder::Decode(FX_LPBYTE dest_buf, FX_DWORD& dest_size, const FX_BYTE* src_buf, FX_DWORD& src_size, FX_BOOL bEarlyChange)
+{
+ m_CodeLen = 9;
+ m_InPos = 0;
+ m_OutPos = 0;
+ m_pInput = src_buf;
+ m_pOutput = dest_buf;
+ m_Early = bEarlyChange ? 1 : 0;
+ m_nCodes = 0;
+ FX_DWORD old_code = (FX_DWORD) - 1;
+ FX_BYTE last_char;
+ while (1) {
+ if (m_InPos + m_CodeLen > src_size * 8) {
+ break;
+ }
+ int byte_pos = m_InPos / 8;
+ int bit_pos = m_InPos % 8, bit_left = m_CodeLen;
+ FX_DWORD code = 0;
+ if (bit_pos) {
+ bit_left -= 8 - bit_pos;
+ code = (m_pInput[byte_pos++] & ((1 << (8 - bit_pos)) - 1)) << bit_left;
+ }
+ if (bit_left < 8) {
+ code |= m_pInput[byte_pos] >> (8 - bit_left);
+ } else {
+ bit_left -= 8;
+ code |= m_pInput[byte_pos++] << bit_left;
+ if (bit_left) {
+ code |= m_pInput[byte_pos] >> (8 - bit_left);
+ }
+ }
+ m_InPos += m_CodeLen;
+ if (code < 256) {
+ if (m_OutPos == dest_size) {
+ return -5;
+ }
+ if (m_pOutput) {
+ m_pOutput[m_OutPos] = (FX_BYTE)code;
+ }
+ m_OutPos ++;
+ last_char = (FX_BYTE)code;
+ if (old_code != (FX_DWORD) - 1) {
+ AddCode(old_code, last_char);
+ }
+ old_code = code;
+ } else if (code == 256) {
+ m_CodeLen = 9;
+ m_nCodes = 0;
+ old_code = (FX_DWORD) - 1;
+ } else if (code == 257) {
+ break;
+ } else {
+ if (old_code == (FX_DWORD) - 1) {
+ return 2;
+ }
+ m_StackLen = 0;
+ if (code >= m_nCodes + 258) {
+ if (m_StackLen < sizeof(m_DecodeStack)) {
+ m_DecodeStack[m_StackLen++] = last_char;
+ }
+ DecodeString(old_code);
+ } else {
+ DecodeString(code);
+ }
+ if (m_OutPos + m_StackLen > dest_size) {
+ return -5;
+ }
+ if (m_pOutput) {
+ for (FX_DWORD i = 0; i < m_StackLen; i ++) {
+ m_pOutput[m_OutPos + i] = m_DecodeStack[m_StackLen - i - 1];
+ }
+ }
+ m_OutPos += m_StackLen;
+ last_char = m_DecodeStack[m_StackLen - 1];
+ if (old_code < 256) {
+ AddCode(old_code, last_char);
+ } else if (old_code - 258 >= m_nCodes) {
+ dest_size = m_OutPos;
+ src_size = (m_InPos + 7) / 8;
+ return 0;
+ } else {
+ AddCode(old_code, last_char);
+ }
+ old_code = code;
+ }
+ }
+ dest_size = m_OutPos;
+ src_size = (m_InPos + 7) / 8;
+ return 0;
+}
+static FX_BYTE PaethPredictor(int a, int b, int c)
+{
+ int p = a + b - c;
+ int pa = FXSYS_abs(p - a);
+ int pb = FXSYS_abs(p - b);
+ int pc = FXSYS_abs(p - c);
+ if (pa <= pb && pa <= pc) {
+ return (FX_BYTE)a;
+ }
+ if (pb <= pc) {
+ return (FX_BYTE)b;
+ }
+ return (FX_BYTE)c;
+}
+static void PNG_PredictorEncode(FX_LPBYTE& data_buf, FX_DWORD& data_size, int predictor, int Colors, int BitsPerComponent, int Columns)
+{
+ int BytesPerPixel = (Colors * BitsPerComponent + 7) / 8;
+ int row_size = (Colors * BitsPerComponent * Columns + 7) / 8;
+ int row_count = (data_size + row_size - 1) / row_size;
+ int last_row_size = data_size % row_size;
+ FX_LPBYTE dest_buf = FX_Alloc( FX_BYTE, (row_size + 1) * row_count);
+ if (dest_buf == NULL) {
+ return;
+ }
+ int byte_cnt = 0;
+ FX_LPBYTE pSrcData = data_buf;
+ FX_LPBYTE pDestData = dest_buf;
+ for (int row = 0; row < row_count; row++) {
+ if (predictor == 10) {
+ pDestData[0] = 0;
+ int move_size = row_size;
+ if (move_size * (row + 1) > (int)data_size) {
+ move_size = data_size - (move_size * row);
+ }
+ FXSYS_memmove32(pDestData + 1, pSrcData, move_size);
+ pDestData += (move_size + 1);
+ pSrcData += move_size;
+ byte_cnt += move_size;
+ continue;
+ }
+ for (int byte = 0; byte < row_size && byte_cnt < (int)data_size; byte++) {
+ switch (predictor) {
+ case 11: {
+ pDestData[0] = 1;
+ FX_BYTE left = 0;
+ if (byte >= BytesPerPixel) {
+ left = pSrcData[byte - BytesPerPixel];
+ }
+ pDestData[byte + 1] = pSrcData[byte] - left;
+ }
+ break;
+ case 12: {
+ pDestData[0] = 2;
+ FX_BYTE up = 0;
+ if (row) {
+ up = pSrcData[byte - row_size];
+ }
+ pDestData[byte + 1] = pSrcData[byte] - up;
+ }
+ break;
+ case 13: {
+ pDestData[0] = 3;
+ FX_BYTE left = 0;
+ if (byte >= BytesPerPixel) {
+ left = pSrcData[byte - BytesPerPixel];
+ }
+ FX_BYTE up = 0;
+ if (row) {
+ up = pSrcData[byte - row_size];
+ }
+ pDestData[byte + 1] = pSrcData[byte] - (left + up) / 2;
+ }
+ break;
+ case 14: {
+ pDestData[0] = 4;
+ FX_BYTE left = 0;
+ if (byte >= BytesPerPixel) {
+ left = pSrcData[byte - BytesPerPixel];
+ }
+ FX_BYTE up = 0;
+ if (row) {
+ up = pSrcData[byte - row_size];
+ }
+ FX_BYTE upper_left = 0;
+ if (byte >= BytesPerPixel && row) {
+ upper_left = pSrcData[byte - row_size - BytesPerPixel];
+ }
+ pDestData[byte + 1] = pSrcData[byte] - PaethPredictor(left, up, upper_left);
+ }
+ break;
+ default: {
+ pDestData[byte + 1] = pSrcData[byte];
+ }
+ break;
+ }
+ byte_cnt++;
+ }
+ pDestData += (row_size + 1);
+ pSrcData += row_size;
+ }
+ FX_Free(data_buf);
+ data_buf = dest_buf;
+ data_size = (row_size + 1) * row_count - (last_row_size > 0 ? (row_size - last_row_size) : 0);
+}
+static void PNG_PredictLine(FX_LPBYTE pDestData, FX_LPCBYTE pSrcData, FX_LPCBYTE pLastLine,
+ int bpc, int nColors, int nPixels)
+{
+ int row_size = (nPixels * bpc * nColors + 7) / 8;
+ int BytesPerPixel = (bpc * nColors + 7) / 8;
+ FX_BYTE tag = pSrcData[0];
+ if (tag == 0) {
+ FXSYS_memmove32(pDestData, pSrcData + 1, row_size);
+ return;
+ }
+ for (int byte = 0; byte < row_size; byte ++) {
+ FX_BYTE raw_byte = pSrcData[byte + 1];
+ switch (tag) {
+ case 1: {
+ FX_BYTE left = 0;
+ if (byte >= BytesPerPixel) {
+ left = pDestData[byte - BytesPerPixel];
+ }
+ pDestData[byte] = raw_byte + left;
+ break;
+ }
+ case 2: {
+ FX_BYTE up = 0;
+ if (pLastLine) {
+ up = pLastLine[byte];
+ }
+ pDestData[byte] = raw_byte + up;
+ break;
+ }
+ case 3: {
+ FX_BYTE left = 0;
+ if (byte >= BytesPerPixel) {
+ left = pDestData[byte - BytesPerPixel];
+ }
+ FX_BYTE up = 0;
+ if (pLastLine) {
+ up = pLastLine[byte];
+ }
+ pDestData[byte] = raw_byte + (up + left) / 2;
+ break;
+ }
+ case 4: {
+ FX_BYTE left = 0;
+ if (byte >= BytesPerPixel) {
+ left = pDestData[byte - BytesPerPixel];
+ }
+ FX_BYTE up = 0;
+ if (pLastLine) {
+ up = pLastLine[byte];
+ }
+ FX_BYTE upper_left = 0;
+ if (byte >= BytesPerPixel && pLastLine) {
+ upper_left = pLastLine[byte - BytesPerPixel];
+ }
+ pDestData[byte] = raw_byte + PaethPredictor(left, up, upper_left);
+ break;
+ }
+ default:
+ pDestData[byte] = raw_byte;
+ break;
+ }
+ }
+}
+static void PNG_Predictor(FX_LPBYTE& data_buf, FX_DWORD& data_size,
+ int Colors, int BitsPerComponent, int Columns)
+{
+ int BytesPerPixel = (Colors * BitsPerComponent + 7) / 8;
+ int row_size = (Colors * BitsPerComponent * Columns + 7) / 8;
+ int row_count = (data_size + row_size) / (row_size + 1);
+ int last_row_size = data_size % (row_size + 1);
+ FX_LPBYTE dest_buf = FX_Alloc( FX_BYTE, row_size * row_count);
+ if (dest_buf == NULL) {
+ return;
+ }
+ int byte_cnt = 0;
+ FX_LPBYTE pSrcData = data_buf;
+ FX_LPBYTE pDestData = dest_buf;
+ for (int row = 0; row < row_count; row ++) {
+ FX_BYTE tag = pSrcData[0];
+ if (tag == 0) {
+ int move_size = row_size;
+ if ((row + 1) * (move_size + 1) > (int)data_size) {
+ move_size = last_row_size - 1;
+ }
+ FXSYS_memmove32(pDestData, pSrcData + 1, move_size);
+ pSrcData += move_size + 1;
+ pDestData += move_size;
+ byte_cnt += move_size + 1;
+ continue;
+ }
+ for (int byte = 0; byte < row_size && byte_cnt < (int)data_size; byte ++) {
+ FX_BYTE raw_byte = pSrcData[byte + 1];
+ switch (tag) {
+ case 1: {
+ FX_BYTE left = 0;
+ if (byte >= BytesPerPixel) {
+ left = pDestData[byte - BytesPerPixel];
+ }
+ pDestData[byte] = raw_byte + left;
+ break;
+ }
+ case 2: {
+ FX_BYTE up = 0;
+ if (row) {
+ up = pDestData[byte - row_size];
+ }
+ pDestData[byte] = raw_byte + up;
+ break;
+ }
+ case 3: {
+ FX_BYTE left = 0;
+ if (byte >= BytesPerPixel) {
+ left = pDestData[byte - BytesPerPixel];
+ }
+ FX_BYTE up = 0;
+ if (row) {
+ up = pDestData[byte - row_size];
+ }
+ pDestData[byte] = raw_byte + (up + left) / 2;
+ break;
+ }
+ case 4: {
+ FX_BYTE left = 0;
+ if (byte >= BytesPerPixel) {
+ left = pDestData[byte - BytesPerPixel];
+ }
+ FX_BYTE up = 0;
+ if (row) {
+ up = pDestData[byte - row_size];
+ }
+ FX_BYTE upper_left = 0;
+ if (byte >= BytesPerPixel && row) {
+ upper_left = pDestData[byte - row_size - BytesPerPixel];
+ }
+ pDestData[byte] = raw_byte + PaethPredictor(left, up, upper_left);
+ break;
+ }
+ default:
+ pDestData[byte] = raw_byte;
+ break;
+ }
+ byte_cnt++;
+ }
+ pSrcData += row_size + 1;
+ pDestData += row_size;
+ byte_cnt++;
+ }
+ FX_Free(data_buf);
+ data_buf = dest_buf;
+ data_size = row_size * row_count - (last_row_size > 0 ? (row_size + 1 - last_row_size) : 0);
+}
+static void TIFF_PredictorEncodeLine(FX_LPBYTE dest_buf, int row_size, int BitsPerComponent, int Colors, int Columns)
+{
+ int BytesPerPixel = BitsPerComponent * Colors / 8;
+ if (BitsPerComponent < 8) {
+ FX_BYTE mask = 0x01;
+ if (BitsPerComponent == 2) {
+ mask = 0x03;
+ } else if (BitsPerComponent == 4) {
+ mask = 0x0F;
+ }
+ int row_bits = Colors * BitsPerComponent * Columns;
+ for (int i = row_bits - BitsPerComponent; i >= BitsPerComponent; i -= BitsPerComponent) {
+ int col = i % 8;
+ int index = i / 8;
+ int col_pre = (col == 0) ? (8 - BitsPerComponent) : (col - BitsPerComponent);
+ int index_pre = (col == 0) ? (index - 1) : index;
+ FX_BYTE cur = (dest_buf[index] >> (8 - col - BitsPerComponent)) & mask;
+ FX_BYTE left = (dest_buf[index_pre] >> (8 - col_pre - BitsPerComponent)) & mask;
+ cur -= left;
+ cur &= mask;
+ cur <<= (8 - col - BitsPerComponent);
+ dest_buf[index] &= ~(mask << ((8 - col - BitsPerComponent)));
+ dest_buf[index] |= cur;
+ }
+ } else if (BitsPerComponent == 8) {
+ for (int i = row_size - 1; i >= BytesPerPixel; i--) {
+ dest_buf[i] -= dest_buf[i - BytesPerPixel];
+ }
+ } else {
+ for (int i = row_size - BytesPerPixel; i >= BytesPerPixel; i -= BytesPerPixel) {
+ FX_WORD pixel = (dest_buf[i] << 8) | dest_buf[i + 1];
+ pixel -= (dest_buf[i - BytesPerPixel] << 8) | dest_buf[i - BytesPerPixel + 1];
+ dest_buf[i] = pixel >> 8;
+ dest_buf[i + 1] = (FX_BYTE)pixel;
+ }
+ }
+}
+static void TIFF_PredictorEncode(FX_LPBYTE& data_buf, FX_DWORD& data_size,
+ int Colors, int BitsPerComponent, int Columns)
+{
+ int row_size = (Colors * BitsPerComponent * Columns + 7) / 8;
+ int row_count = (data_size + row_size - 1) / row_size;
+ int last_row_size = data_size % row_size;
+ for (int row = 0; row < row_count; row++) {
+ FX_LPBYTE scan_line = data_buf + row * row_size;
+ if ((row + 1) * row_size > (int)data_size) {
+ row_size = last_row_size;
+ }
+ TIFF_PredictorEncodeLine(scan_line, row_size, BitsPerComponent, Colors, Columns);
+ }
+}
+static void TIFF_PredictLine(FX_LPBYTE dest_buf, int row_size, int BitsPerComponent, int Colors, int Columns)
+{
+ if (BitsPerComponent == 1) {
+ int row_bits = BitsPerComponent * Colors * Columns;
+ for(int i = 1; i < row_bits; i ++) {
+ int col = i % 8;
+ int index = i / 8;
+ int index_pre = (col == 0) ? (index - 1) : index;
+ int col_pre = (col == 0) ? 8 : col;
+ if( ((dest_buf[index] >> (7 - col)) & 1) ^ ((dest_buf[index_pre] >> (8 - col_pre)) & 1) ) {
+ dest_buf[index] |= 1 << (7 - col);
+ } else {
+ dest_buf[index] &= ~(1 << (7 - col));
+ }
+ }
+ return;
+ }
+ int BytesPerPixel = BitsPerComponent * Colors / 8;
+ if (BitsPerComponent == 16) {
+ for (int i = BytesPerPixel; i < row_size; i += 2) {
+ FX_WORD pixel = (dest_buf[i - BytesPerPixel] << 8) | dest_buf[i - BytesPerPixel + 1];
+ pixel += (dest_buf[i] << 8) | dest_buf[i + 1];
+ dest_buf[i] = pixel >> 8;
+ dest_buf[i + 1] = (FX_BYTE)pixel;
+ }
+ } else {
+ for (int i = BytesPerPixel; i < row_size; i ++) {
+ dest_buf[i] += dest_buf[i - BytesPerPixel];
+ }
+ }
+}
+static void TIFF_Predictor(FX_LPBYTE& data_buf, FX_DWORD& data_size,
+ int Colors, int BitsPerComponent, int Columns)
+{
+ int row_size = (Colors * BitsPerComponent * Columns + 7) / 8;
+ int row_count = (data_size + row_size - 1) / row_size;
+ int last_row_size = data_size % row_size;
+ for (int row = 0; row < row_count; row ++) {
+ FX_LPBYTE scan_line = data_buf + row * row_size;
+ if ((row + 1) * row_size > (int)data_size) {
+ row_size = last_row_size;
+ }
+ TIFF_PredictLine(scan_line, row_size, BitsPerComponent, Colors, Columns);
+ }
+}
+class CCodec_FlateScanlineDecoder : public CCodec_ScanlineDecoder
+{
+public:
+ CCodec_FlateScanlineDecoder();
+ ~CCodec_FlateScanlineDecoder();
+ FX_BOOL Create(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height, int nComps, int bpc,
+ int predictor, int Colors, int BitsPerComponent, int Columns);
+ virtual void Destroy()
+ {
+ delete this;
+ }
+ virtual void v_DownScale(int dest_width, int dest_height) {}
+ virtual FX_BOOL v_Rewind();
+ virtual FX_LPBYTE v_GetNextLine();
+ virtual FX_DWORD GetSrcOffset();
+ void* m_pFlate;
+ FX_LPCBYTE m_SrcBuf;
+ FX_DWORD m_SrcSize;
+ FX_LPBYTE m_pScanline;
+ FX_LPBYTE m_pLastLine;
+ FX_LPBYTE m_pPredictBuffer;
+ FX_LPBYTE m_pPredictRaw;
+ int m_Predictor;
+ int m_Colors, m_BitsPerComponent, m_Columns, m_PredictPitch, m_LeftOver;
+};
+CCodec_FlateScanlineDecoder::CCodec_FlateScanlineDecoder()
+{
+ m_pFlate = NULL;
+ m_pScanline = NULL;
+ m_pLastLine = NULL;
+ m_pPredictBuffer = NULL;
+ m_pPredictRaw = NULL;
+ m_LeftOver = 0;
+}
+CCodec_FlateScanlineDecoder::~CCodec_FlateScanlineDecoder()
+{
+ if (m_pScanline) {
+ FX_Free(m_pScanline);
+ }
+ if (m_pLastLine) {
+ FX_Free(m_pLastLine);
+ }
+ if (m_pPredictBuffer) {
+ FX_Free(m_pPredictBuffer);
+ }
+ if (m_pPredictRaw) {
+ FX_Free(m_pPredictRaw);
+ }
+ if (m_pFlate) {
+ FPDFAPI_FlateEnd(m_pFlate);
+ }
+}
+FX_BOOL CCodec_FlateScanlineDecoder::Create(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height,
+ int nComps, int bpc, int predictor, int Colors, int BitsPerComponent, int Columns)
+{
+ m_SrcBuf = src_buf;
+ m_SrcSize = src_size;
+ m_OutputWidth = m_OrigWidth = width;
+ m_OutputHeight = m_OrigHeight = height;
+ m_nComps = nComps;
+ m_bpc = bpc;
+ m_bColorTransformed = FALSE;
+ m_Pitch = (width * nComps * bpc + 7) / 8;
+ m_pScanline = FX_Alloc(FX_BYTE, m_Pitch);
+ if (m_pScanline == NULL) {
+ return FALSE;
+ }
+ m_Predictor = 0;
+ if (predictor) {
+ if (predictor >= 10) {
+ m_Predictor = 2;
+ } else if (predictor == 2) {
+ m_Predictor = 1;
+ }
+ if (m_Predictor) {
+ if (BitsPerComponent * Colors * Columns == 0) {
+ BitsPerComponent = m_bpc;
+ Colors = m_nComps;
+ Columns = m_OrigWidth;
+ }
+ m_Colors = Colors;
+ m_BitsPerComponent = BitsPerComponent;
+ m_Columns = Columns;
+ m_PredictPitch = (m_BitsPerComponent * m_Colors * m_Columns + 7) / 8;
+ m_pLastLine = FX_Alloc(FX_BYTE, m_PredictPitch);
+ if (m_pLastLine == NULL) {
+ return FALSE;
+ }
+ FXSYS_memset32(m_pLastLine, 0, m_PredictPitch);
+ m_pPredictRaw = FX_Alloc(FX_BYTE, m_PredictPitch + 1);
+ if (m_pPredictRaw == NULL) {
+ return FALSE;
+ }
+ m_pPredictBuffer = FX_Alloc(FX_BYTE, m_PredictPitch);
+ if (m_pPredictBuffer == NULL) {
+ return FALSE;
+ }
+ }
+ }
+ return TRUE;
+}
+FX_BOOL CCodec_FlateScanlineDecoder::v_Rewind()
+{
+ if (m_pFlate) {
+ FPDFAPI_FlateEnd(m_pFlate);
+ }
+ m_pFlate = FPDFAPI_FlateInit(my_alloc_func, my_free_func);
+ if (m_pFlate == NULL) {
+ return FALSE;
+ }
+ FPDFAPI_FlateInput(m_pFlate, m_SrcBuf, m_SrcSize);
+ m_LeftOver = 0;
+ return TRUE;
+}
+FX_LPBYTE CCodec_FlateScanlineDecoder::v_GetNextLine()
+{
+ if (m_Predictor) {
+ if (m_Pitch == m_PredictPitch) {
+ if (m_Predictor == 2) {
+ FPDFAPI_FlateOutput(m_pFlate, m_pPredictRaw, m_PredictPitch + 1);
+ PNG_PredictLine(m_pScanline, m_pPredictRaw, m_pLastLine, m_BitsPerComponent, m_Colors, m_Columns);
+ FXSYS_memcpy32(m_pLastLine, m_pScanline, m_PredictPitch);
+ } else {
+ FPDFAPI_FlateOutput(m_pFlate, m_pScanline, m_Pitch);
+ TIFF_PredictLine(m_pScanline, m_PredictPitch, m_bpc, m_nComps, m_OutputWidth);
+ }
+ } else {
+ int bytes_to_go = m_Pitch;
+ int read_leftover = m_LeftOver > bytes_to_go ? bytes_to_go : m_LeftOver;
+ if (read_leftover) {
+ FXSYS_memcpy32(m_pScanline, m_pPredictBuffer + m_PredictPitch - m_LeftOver, read_leftover);
+ m_LeftOver -= read_leftover;
+ bytes_to_go -= read_leftover;
+ }
+ while (bytes_to_go) {
+ if (m_Predictor == 2) {
+ FPDFAPI_FlateOutput(m_pFlate, m_pPredictRaw, m_PredictPitch + 1);
+ PNG_PredictLine(m_pPredictBuffer, m_pPredictRaw, m_pLastLine, m_BitsPerComponent, m_Colors, m_Columns);
+ FXSYS_memcpy32(m_pLastLine, m_pPredictBuffer, m_PredictPitch);
+ } else {
+ FPDFAPI_FlateOutput(m_pFlate, m_pPredictBuffer, m_PredictPitch);
+ TIFF_PredictLine(m_pPredictBuffer, m_PredictPitch, m_BitsPerComponent, m_Colors, m_Columns);
+ }
+ int read_bytes = m_PredictPitch > bytes_to_go ? bytes_to_go : m_PredictPitch;
+ FXSYS_memcpy32(m_pScanline + m_Pitch - bytes_to_go, m_pPredictBuffer, read_bytes);
+ m_LeftOver += m_PredictPitch - read_bytes;
+ bytes_to_go -= read_bytes;
+ }
+ }
+ } else {
+ FPDFAPI_FlateOutput(m_pFlate, m_pScanline, m_Pitch);
+ }
+ return m_pScanline;
+}
+FX_DWORD CCodec_FlateScanlineDecoder::GetSrcOffset()
+{
+ return FPDFAPI_FlateGetTotalIn(m_pFlate);
+}
+static void FlateUncompress(FX_LPCBYTE src_buf, FX_DWORD src_size, FX_DWORD orig_size,
+ FX_LPBYTE& dest_buf, FX_DWORD& dest_size, FX_DWORD& offset)
+{
+ FX_DWORD guess_size = orig_size ? orig_size : src_size * 2;
+ FX_DWORD alloc_step = orig_size ? 10240 : (src_size < 10240 ? 10240 : src_size);
+ static const FX_DWORD kMaxInitialAllocSize = 10000000;
+ if (guess_size > kMaxInitialAllocSize) {
+ guess_size = kMaxInitialAllocSize;
+ alloc_step = kMaxInitialAllocSize;
+ }
+ FX_LPBYTE guess_buf = FX_Alloc(FX_BYTE, guess_size + 1);
+ if (!guess_buf) {
+ dest_buf = NULL;
+ dest_size = 0;
+ return;
+ }
+ guess_buf[guess_size] = '\0';
+ FX_BOOL useOldImpl = src_size < 10240;
+ void* context = FPDFAPI_FlateInit(my_alloc_func, my_free_func);
+ if (context == NULL) {
+ dest_buf = NULL;
+ dest_size = 0;
+ return ;
+ }
+ FPDFAPI_FlateInput(context, src_buf, src_size);
+ CFX_ArrayTemplate<FX_LPBYTE> result_tmp_bufs;
+ FX_LPBYTE buf = guess_buf;
+ FX_DWORD buf_size = guess_size;
+ FX_DWORD last_buf_size = buf_size;
+ while (1) {
+ FX_INT32 ret = FPDFAPI_FlateOutput(context, buf, buf_size);
+ FX_INT32 avail_buf_size = FPDFAPI_FlateGetAvailOut(context);
+ if (!useOldImpl) {
+ if (ret != Z_OK) {
+ last_buf_size = buf_size - avail_buf_size;
+ result_tmp_bufs.Add(buf);
+ break;
+ }
+ if (avail_buf_size == 0) {
+ result_tmp_bufs.Add(buf);
+ buf = NULL;
+ buf = FX_Alloc(FX_BYTE, buf_size + 1);
+ if (!buf) {
+ dest_buf = NULL;
+ dest_size = 0;
+ return;
+ }
+ buf[buf_size] = '\0';
+ } else {
+ last_buf_size = buf_size - avail_buf_size;
+ result_tmp_bufs.Add(buf);
+ buf = NULL;
+ break;
+ }
+ } else {
+ if (ret != Z_OK) {
+ break;
+ }
+ if (avail_buf_size == 0) {
+ FX_DWORD old_size = guess_size;
+ guess_size += alloc_step;
+ if (guess_size < old_size || guess_size + 1 < guess_size) {
+ dest_buf = NULL;
+ dest_size = 0;
+ return;
+ }
+ guess_buf = FX_Realloc(FX_BYTE, guess_buf, guess_size + 1);
+ if (!guess_buf) {
+ dest_buf = NULL;
+ dest_size = 0;
+ return;
+ }
+ guess_buf[guess_size] = '\0';
+ buf = guess_buf + old_size;
+ buf_size = guess_size - old_size;
+ } else {
+ break;
+ }
+ }
+ }
+ dest_size = FPDFAPI_FlateGetTotalOut(context);
+ offset = FPDFAPI_FlateGetTotalIn(context);
+ if (!useOldImpl) {
+ if (result_tmp_bufs.GetSize() == 1) {
+ dest_buf = result_tmp_bufs[0];
+ } else {
+ FX_LPBYTE result_buf = FX_Alloc(FX_BYTE, dest_size);
+ if (!result_buf) {
+ dest_buf = NULL;
+ dest_size = 0;
+ return;
+ }
+ FX_DWORD result_pos = 0;
+ for (FX_INT32 i = 0; i < result_tmp_bufs.GetSize(); i++) {
+ FX_LPBYTE tmp_buf = result_tmp_bufs[i];
+ FX_DWORD tmp_buf_size = buf_size;
+ if (i == result_tmp_bufs.GetSize() - 1) {
+ tmp_buf_size = last_buf_size;
+ }
+ FXSYS_memcpy32(result_buf + result_pos, tmp_buf, tmp_buf_size);
+ result_pos += tmp_buf_size;
+ FX_Free(tmp_buf);
+ tmp_buf = NULL;
+ result_tmp_bufs[i] = NULL;
+ }
+ dest_buf = result_buf;
+ }
+ } else {
+ if (guess_size / 2 > dest_size) {
+ guess_buf = FX_Realloc(FX_BYTE, guess_buf, dest_size + 1);
+ if (!guess_buf) {
+ dest_buf = NULL;
+ dest_size = 0;
+ return;
+ }
+ guess_size = dest_size;
+ guess_buf[guess_size] = '\0';
+ }
+ dest_buf = guess_buf;
+ }
+ FPDFAPI_FlateEnd(context);
+ context = NULL;
+}
+ICodec_ScanlineDecoder* CCodec_FlateModule::CreateDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height,
+ int nComps, int bpc, int predictor, int Colors, int BitsPerComponent, int Columns)
+{
+ CCodec_FlateScanlineDecoder* pDecoder = FX_NEW CCodec_FlateScanlineDecoder;
+ if (pDecoder == NULL) {
+ return NULL;
+ }
+ pDecoder->Create(src_buf, src_size, width, height, nComps, bpc, predictor, Colors, BitsPerComponent, Columns);
+ return pDecoder;
+}
+FX_DWORD CCodec_FlateModule::FlateOrLZWDecode(FX_BOOL bLZW, const FX_BYTE* src_buf, FX_DWORD src_size, FX_BOOL bEarlyChange,
+ int predictor, int Colors, int BitsPerComponent, int Columns,
+ FX_DWORD estimated_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size)
+{
+ CLZWDecoder* pDecoder = NULL;
+ dest_buf = NULL;
+ FX_DWORD offset = 0;
+ int predictor_type = 0;
+ if (predictor) {
+ if (predictor >= 10) {
+ predictor_type = 2;
+ } else if (predictor == 2) {
+ predictor_type = 1;
+ }
+ }
+ if (bLZW) {
+ pDecoder = FX_NEW CLZWDecoder;
+ if (pDecoder == NULL) {
+ return -1;
+ }
+ dest_size = (FX_DWORD) - 1;
+ offset = src_size;
+ int err = pDecoder->Decode(NULL, dest_size, src_buf, offset, bEarlyChange);
+ delete pDecoder;
+ if (err || dest_size == 0 || dest_size + 1 < dest_size) {
+ return (FX_DWORD) - 1;
+ }
+ pDecoder = FX_NEW CLZWDecoder;
+ if (pDecoder == NULL) {
+ return -1;
+ }
+ dest_buf = FX_Alloc( FX_BYTE, dest_size + 1);
+ if (dest_buf == NULL) {
+ return -1;
+ }
+ dest_buf[dest_size] = '\0';
+ pDecoder->Decode(dest_buf, dest_size, src_buf, offset, bEarlyChange);
+ delete pDecoder;
+ } else {
+ FlateUncompress(src_buf, src_size, estimated_size, dest_buf, dest_size, offset);
+ }
+ if (predictor_type == 0) {
+ return offset;
+ }
+ if (predictor_type == 2) {
+ PNG_Predictor(dest_buf, dest_size, Colors, BitsPerComponent, Columns);
+ } else if (predictor_type == 1) {
+ TIFF_Predictor(dest_buf, dest_size, Colors, BitsPerComponent, Columns);
+ }
+ return offset;
+}
+FX_BOOL CCodec_FlateModule::Encode(const FX_BYTE* src_buf, FX_DWORD src_size,
+ int predictor, int Colors, int BitsPerComponent, int Columns,
+ FX_LPBYTE& dest_buf, FX_DWORD& dest_size)
+{
+ if (predictor != 2 && predictor < 10) {
+ return Encode(src_buf, src_size, dest_buf, dest_size);
+ }
+ FX_BOOL ret = FALSE;
+ FX_LPBYTE pSrcBuf = NULL;
+ pSrcBuf = FX_Alloc(FX_BYTE, src_size);
+ if (pSrcBuf == NULL) {
+ return FALSE;
+ }
+ FXSYS_memcpy32(pSrcBuf, src_buf, src_size);
+ if (predictor == 2) {
+ TIFF_PredictorEncode(pSrcBuf, src_size, Colors, BitsPerComponent, Columns);
+ } else if (predictor >= 10) {
+ PNG_PredictorEncode(pSrcBuf, src_size, predictor, Colors, BitsPerComponent, Columns);
+ }
+ ret = Encode(pSrcBuf, src_size, dest_buf, dest_size);
+ FX_Free(pSrcBuf);
+ return ret;
+}
+FX_BOOL CCodec_FlateModule::Encode(FX_LPCBYTE src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size)
+{
+ dest_size = src_size + src_size / 1000 + 12;
+ dest_buf = FX_Alloc( FX_BYTE, dest_size);
+ if (dest_buf == NULL) {
+ return FALSE;
+ }
+ unsigned long temp_size = dest_size;
+ FPDFAPI_FlateCompress(dest_buf, &temp_size, src_buf, src_size);
+ dest_size = (FX_DWORD)temp_size;
+ return TRUE;
+}
diff --git a/core/src/fxcodec/codec/fx_codec_icc.cpp b/core/src/fxcodec/codec/fx_codec_icc.cpp
index 65617642fe..22659ba9ff 100644
--- a/core/src/fxcodec/codec/fx_codec_icc.cpp
+++ b/core/src/fxcodec/codec/fx_codec_icc.cpp
@@ -1,1360 +1,1360 @@
-// 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
-
-#include "../../../include/fxcodec/fx_codec.h"
-#include "codec_int.h"
-#include "../lcms2/include/fx_lcms2.h"
-FX_BOOL MD5ComputeID( FX_LPCVOID buf, FX_DWORD dwSize, FX_BYTE ID[16] )
-{
- return cmsMD5computeIDExt(buf, dwSize, ID);
-}
-struct CLcmsCmm : public CFX_Object {
- cmsHTRANSFORM m_hTransform;
- int m_nSrcComponents;
- int m_nDstComponents;
- FX_BOOL m_bLab;
-};
-extern "C" {
- int ourHandler(int ErrorCode, const char *ErrorText)
- {
- return TRUE;
- }
-};
-FX_BOOL CheckComponents(cmsColorSpaceSignature cs, int nComponents, FX_BOOL bDst)
-{
- if (nComponents <= 0 || nComponents > 15) {
- return FALSE;
- }
- switch(cs) {
- case cmsSigLabData:
- if (nComponents < 3) {
- return FALSE;
- }
- break;
- case cmsSigGrayData:
- if (bDst && nComponents != 1) {
- return FALSE;
- } else if (!bDst && nComponents > 2) {
- return FALSE;
- }
- break;
- case cmsSigRgbData:
- if (bDst && nComponents != 3) {
- return FALSE;
- }
- break;
- case cmsSigCmykData:
- if (bDst && nComponents != 4) {
- return FALSE;
- }
- break;
- default:
- if (nComponents != 3) {
- return FALSE;
- }
- break;
- }
- return TRUE;
-}
-void* IccLib_CreateTransform(const unsigned char* pSrcProfileData, unsigned int dwSrcProfileSize, int nSrcComponents,
- const unsigned char* pDstProfileData, unsigned int dwDstProfileSize, int nDstComponents,
- int intent, FX_DWORD dwSrcFormat = Icc_FORMAT_DEFAULT, FX_DWORD dwDstFormat = Icc_FORMAT_DEFAULT)
-{
- cmsHPROFILE srcProfile = NULL;
- cmsHPROFILE dstProfile = NULL;
- cmsHTRANSFORM hTransform = NULL;
- CLcmsCmm* pCmm = NULL;
- srcProfile = cmsOpenProfileFromMem((void*)pSrcProfileData, dwSrcProfileSize);
- if (srcProfile == NULL) {
- return NULL;
- }
- if(pDstProfileData == NULL && dwDstProfileSize == 0 && nDstComponents == 3) {
- dstProfile = cmsCreate_sRGBProfile();
- } else {
- dstProfile = cmsOpenProfileFromMem((void*)pDstProfileData, dwDstProfileSize);
- }
- if (dstProfile == NULL) {
- cmsCloseProfile(srcProfile);
- return NULL;
- }
- int srcFormat;
- FX_BOOL bLab = FALSE;
- cmsColorSpaceSignature srcCS = cmsGetColorSpace(srcProfile);
- if (!CheckComponents(srcCS, nSrcComponents, FALSE)) {
- cmsCloseProfile(srcProfile);
- cmsCloseProfile(dstProfile);
- return NULL;
- }
- if (srcCS == cmsSigLabData) {
- srcFormat = COLORSPACE_SH(PT_Lab) | CHANNELS_SH(nSrcComponents) | BYTES_SH(0);
- bLab = TRUE;
- } else {
- srcFormat = COLORSPACE_SH(PT_ANY) | CHANNELS_SH(nSrcComponents) | BYTES_SH(1);
- if (srcCS == cmsSigRgbData && T_DOSWAP(dwSrcFormat)) {
- srcFormat |= DOSWAP_SH(1);
- }
- }
- cmsColorSpaceSignature dstCS = cmsGetColorSpace(dstProfile);
- if (!CheckComponents(dstCS, nDstComponents, TRUE)) {
- cmsCloseProfile(srcProfile);
- cmsCloseProfile(dstProfile);
- return NULL;
- }
- switch(dstCS) {
- case cmsSigGrayData:
- hTransform = cmsCreateTransform(srcProfile, srcFormat, dstProfile, TYPE_GRAY_8, intent, 0);
- break;
- case cmsSigRgbData:
- hTransform = cmsCreateTransform(srcProfile, srcFormat, dstProfile, TYPE_BGR_8, intent, 0);
- break;
- case cmsSigCmykData:
- hTransform = cmsCreateTransform(srcProfile, srcFormat, dstProfile,
- T_DOSWAP(dwDstFormat) ? TYPE_KYMC_8 : TYPE_CMYK_8,
- intent, 0);
- break;
- default:
- break;
- }
- if (hTransform == NULL) {
- cmsCloseProfile(srcProfile);
- cmsCloseProfile(dstProfile);
- return NULL;
- }
- pCmm = FX_NEW CLcmsCmm;
- if (pCmm == NULL) {
- return NULL;
- }
- pCmm->m_nSrcComponents = nSrcComponents;
- pCmm->m_nDstComponents = nDstComponents;
- pCmm->m_hTransform = hTransform;
- pCmm->m_bLab = bLab;
- cmsCloseProfile(srcProfile);
- cmsCloseProfile(dstProfile);
- return pCmm;
-}
-void* IccLib_CreateTransform_sRGB(const unsigned char* pProfileData, unsigned int dwProfileSize, int nComponents, int intent, FX_DWORD dwSrcFormat)
-{
- return IccLib_CreateTransform(pProfileData, dwProfileSize, nComponents, NULL, 0, 3, intent, dwSrcFormat);
-}
-void IccLib_DestroyTransform(void* pTransform)
-{
- if (pTransform == NULL) {
- return;
- }
- cmsDeleteTransform(((CLcmsCmm*)pTransform)->m_hTransform);
- delete (CLcmsCmm*)pTransform;
-}
-void IccLib_Translate(void* pTransform, FX_FLOAT* pSrcValues, FX_FLOAT* pDestValues)
-{
- if (pTransform == NULL) {
- return;
- }
- CLcmsCmm* p = (CLcmsCmm*)pTransform;
- FX_BYTE output[4];
- if (p->m_bLab) {
- CFX_FixedBufGrow<double, 16> inputs(p->m_nSrcComponents);
- double* input = inputs;
- for (int i = 0; i < p->m_nSrcComponents; i ++) {
- input[i] = pSrcValues[i];
- }
- cmsDoTransform(p->m_hTransform, input, output, 1);
- } else {
- CFX_FixedBufGrow<FX_BYTE, 16> inputs(p->m_nSrcComponents);
- FX_BYTE* input = inputs;
- for (int i = 0; i < p->m_nSrcComponents; i ++) {
- if (pSrcValues[i] > 1.0f) {
- input[i] = 255;
- } else if (pSrcValues[i] < 0) {
- input[i] = 0;
- } else {
- input[i] = (int)(pSrcValues[i] * 255.0f);
- }
- }
- cmsDoTransform(p->m_hTransform, input, output, 1);
- }
- switch(p->m_nDstComponents) {
- case 1:
- pDestValues[0] = output[0] / 255.0f;
- break;
- case 3:
- pDestValues[0] = output[2] / 255.0f;
- pDestValues[1] = output[1] / 255.0f;
- pDestValues[2] = output[0] / 255.0f;
- break;
- case 4:
- pDestValues[0] = output[0] / 255.0f;
- pDestValues[1] = output[1] / 255.0f;
- pDestValues[2] = output[2] / 255.0f;
- pDestValues[3] = output[3] / 255.0f;
- break;
- }
-}
-void IccLib_TranslateImage(void* pTransform, unsigned char* pDest, const unsigned char* pSrc, int pixels)
-{
- cmsDoTransform(((CLcmsCmm*)pTransform)->m_hTransform, (void*)pSrc, pDest, pixels);
-}
-FX_LPVOID CreateProfile_Gray(double gamma)
-{
- cmsCIExyY* D50 = (cmsCIExyY*)cmsD50_xyY();
- if (!cmsWhitePointFromTemp(D50, 6504)) {
- return NULL;
- }
- cmsToneCurve* curve = cmsBuildGamma(NULL, gamma);
- if (curve == NULL) {
- return NULL;
- }
- FX_LPVOID profile = cmsCreateGrayProfile(D50, curve);
- cmsFreeToneCurve(curve);
- return profile;
-}
-ICodec_IccModule::IccCS GetProfileCSFromHandle(FX_LPVOID pProfile)
-{
- if (pProfile == NULL) {
- return ICodec_IccModule::IccCS_Unknown;
- }
- switch (cmsGetColorSpace(pProfile)) {
- case cmsSigXYZData:
- return ICodec_IccModule::IccCS_XYZ;
- case cmsSigLabData:
- return ICodec_IccModule::IccCS_Lab;
- case cmsSigLuvData:
- return ICodec_IccModule::IccCS_Luv;
- case cmsSigYCbCrData:
- return ICodec_IccModule::IccCS_YCbCr;
- case cmsSigYxyData:
- return ICodec_IccModule::IccCS_Yxy;
- case cmsSigRgbData:
- return ICodec_IccModule::IccCS_Rgb;
- case cmsSigGrayData:
- return ICodec_IccModule::IccCS_Gray;
- case cmsSigHsvData:
- return ICodec_IccModule::IccCS_Hsv;
- case cmsSigHlsData:
- return ICodec_IccModule::IccCS_Hls;
- case cmsSigCmykData:
- return ICodec_IccModule::IccCS_Cmyk;
- case cmsSigCmyData:
- return ICodec_IccModule::IccCS_Cmy;
- default:
- return ICodec_IccModule::IccCS_Unknown;
- }
-}
-ICodec_IccModule::IccCS CCodec_IccModule::GetProfileCS(FX_LPCBYTE pProfileData, unsigned int dwProfileSize)
-{
- ICodec_IccModule::IccCS cs;
- cmsHPROFILE hProfile = cmsOpenProfileFromMem((void*)pProfileData, dwProfileSize);
- if (hProfile == NULL) {
- return IccCS_Unknown;
- }
- cs = GetProfileCSFromHandle(hProfile);
- if (hProfile) {
- cmsCloseProfile(hProfile);
- }
- return cs;
-}
-ICodec_IccModule::IccCS CCodec_IccModule::GetProfileCS(IFX_FileRead* pFile)
-{
- if (pFile == NULL) {
- return IccCS_Unknown;
- }
- ICodec_IccModule::IccCS cs;
- FX_DWORD dwSize = (FX_DWORD)pFile->GetSize();
- FX_LPBYTE pBuf = FX_Alloc(FX_BYTE, dwSize);
- if (pBuf == NULL) {
- return IccCS_Unknown;
- }
- pFile->ReadBlock(pBuf, 0, dwSize);
- cs = GetProfileCS(pBuf, dwSize);
- FX_Free(pBuf);
- return cs;
-}
-FX_DWORD TransferProfileType(FX_LPVOID pProfile, FX_DWORD dwFormat)
-{
- cmsColorSpaceSignature cs = cmsGetColorSpace(pProfile);
- switch (cs) {
- case cmsSigXYZData:
- return TYPE_XYZ_16;
- case cmsSigLabData:
- return TYPE_Lab_DBL;
- case cmsSigLuvData:
- return TYPE_YUV_8;
- case cmsSigYCbCrData:
- return TYPE_YCbCr_8;
- case cmsSigYxyData:
- return TYPE_Yxy_16;
- case cmsSigRgbData:
- return T_DOSWAP(dwFormat) ? TYPE_RGB_8 : TYPE_BGR_8;
- case cmsSigGrayData:
- return TYPE_GRAY_8;
- case cmsSigHsvData:
- return TYPE_HSV_8;
- case cmsSigHlsData:
- return TYPE_HLS_8;
- case cmsSigCmykData:
- return T_DOSWAP(dwFormat) ? TYPE_KYMC_8 : TYPE_CMYK_8;
- case cmsSigCmyData:
- return TYPE_CMY_8;
- case cmsSigMCH5Data:
- return T_DOSWAP(dwFormat) ? TYPE_KYMC5_8 : TYPE_CMYK5_8;
- case cmsSigMCH6Data:
- return TYPE_CMYK6_8;
- case cmsSigMCH7Data:
- return T_DOSWAP(dwFormat) ? TYPE_KYMC7_8 : TYPE_CMYK7_8;
- case cmsSigMCH8Data:
- return T_DOSWAP(dwFormat) ? TYPE_KYMC8_8 : TYPE_CMYK8_8;
- case cmsSigMCH9Data:
- return T_DOSWAP(dwFormat) ? TYPE_KYMC9_8 : TYPE_CMYK9_8;
- case cmsSigMCHAData:
- return T_DOSWAP(dwFormat) ? TYPE_KYMC10_8 : TYPE_CMYK10_8;
- case cmsSigMCHBData:
- return T_DOSWAP(dwFormat) ? TYPE_KYMC11_8 : TYPE_CMYK11_8;
- case cmsSigMCHCData:
- return T_DOSWAP(dwFormat) ? TYPE_KYMC12_8 : TYPE_CMYK12_8;
- default:
- return 0;
- }
-}
-class CFX_IccProfileCache : public CFX_Object
-{
-public:
- CFX_IccProfileCache();
- ~CFX_IccProfileCache();
- FX_LPVOID m_pProfile;
- FX_DWORD m_dwRate;
-protected:
- void Purge();
-};
-CFX_IccProfileCache::CFX_IccProfileCache()
-{
- m_pProfile = NULL;
- m_dwRate = 1;
-}
-CFX_IccProfileCache::~CFX_IccProfileCache()
-{
- if (m_pProfile) {
- cmsCloseProfile(m_pProfile);
- }
-}
-void CFX_IccProfileCache::Purge()
-{
-}
-class CFX_IccTransformCache : public CFX_Object
-{
-public:
- CFX_IccTransformCache(CLcmsCmm* pCmm = NULL);
- ~CFX_IccTransformCache();
- FX_LPVOID m_pIccTransform;
- FX_DWORD m_dwRate;
- CLcmsCmm* m_pCmm;
-protected:
- void Purge();
-};
-CFX_IccTransformCache::CFX_IccTransformCache(CLcmsCmm* pCmm)
-{
- m_pIccTransform = NULL;
- m_dwRate = 1;
- m_pCmm = pCmm;
-}
-CFX_IccTransformCache::~CFX_IccTransformCache()
-{
- if (m_pIccTransform) {
- cmsDeleteTransform(m_pIccTransform);
- }
- if (m_pCmm) {
- FX_Free(m_pCmm);
- }
-}
-void CFX_IccTransformCache::Purge()
-{
-}
-class CFX_ByteStringKey : public CFX_BinaryBuf
-{
-public:
- CFX_ByteStringKey() : CFX_BinaryBuf() {}
- CFX_ByteStringKey& operator << (FX_DWORD i);
-};
-CFX_ByteStringKey& CFX_ByteStringKey::operator << (FX_DWORD i)
-{
- AppendBlock(&i, sizeof(FX_DWORD));
- return *this;
-}
-FX_LPVOID CCodec_IccModule::CreateProfile(ICodec_IccModule::IccParam* pIccParam, Icc_CLASS ic, CFX_BinaryBuf* pTransformKey)
-{
- CFX_IccProfileCache* pCache = NULL;
- CFX_ByteStringKey key;
- CFX_ByteString text;
- key << pIccParam->ColorSpace << (pIccParam->dwProfileType | ic << 8);
- FX_BYTE ID[16];
- switch (pIccParam->dwProfileType) {
- case Icc_PARAMTYPE_NONE:
- return NULL;
- case Icc_PARAMTYPE_BUFFER:
- MD5ComputeID(pIccParam->pProfileData, pIccParam->dwProfileSize, ID);
- break;
- case Icc_PARAMTYPE_PARAM:
- FXSYS_memset32(ID, 0, 16);
- switch (pIccParam->ColorSpace) {
- case IccCS_Gray:
- text.Format("%lf", pIccParam->Gamma);
- break;
- default:
- ;
- }
- MD5ComputeID(text.GetBuffer(0), text.GetLength(), ID);
- break;
- default:
- ;
- }
- key.AppendBlock(ID, 16);
- CFX_ByteString ProfileKey(key.GetBuffer(), key.GetSize());
- ASSERT(pTransformKey);
- pTransformKey->AppendBlock(ProfileKey.GetBuffer(0), ProfileKey.GetLength());
- if (!m_MapProfile.Lookup(ProfileKey, (FX_LPVOID&)pCache)) {
- pCache = FX_NEW CFX_IccProfileCache;
- if (pCache == NULL) {
- return NULL;
- }
- switch (pIccParam->dwProfileType) {
- case Icc_PARAMTYPE_BUFFER:
- pCache->m_pProfile = cmsOpenProfileFromMem(pIccParam->pProfileData, pIccParam->dwProfileSize);
- break;
- case Icc_PARAMTYPE_PARAM:
- switch (pIccParam->ColorSpace) {
- case IccCS_Rgb:
- pCache->m_pProfile = cmsCreate_sRGBProfile();
- break;
- case IccCS_Gray:
- pCache->m_pProfile = CreateProfile_Gray(pIccParam->Gamma);
- break;
- default:
- break;
- }
- break;
- default:
- break;
- }
- m_MapProfile.SetAt(ProfileKey, pCache);
- } else {
- pCache->m_dwRate++;
- }
- return pCache->m_pProfile;
-}
-FX_LPVOID CCodec_IccModule::CreateTransform(ICodec_IccModule::IccParam* pInputParam,
- ICodec_IccModule::IccParam* pOutputParam,
- ICodec_IccModule::IccParam* pProofParam,
- FX_DWORD dwIntent, FX_DWORD dwFlag, FX_DWORD dwPrfIntent, FX_DWORD dwPrfFlag)
-{
- CLcmsCmm* pCmm = NULL;
- ASSERT(pInputParam && pOutputParam);
- CFX_ByteStringKey key;
- FX_LPVOID pInputProfile = CreateProfile(pInputParam, Icc_CLASS_INPUT, &key);
- if (pInputProfile == NULL) {
- return NULL;
- }
- FX_LPVOID pOutputProfile = CreateProfile(pOutputParam, Icc_CLASS_OUTPUT, &key);
- if (pOutputProfile == NULL) {
- return NULL;
- }
- FX_DWORD dwInputProfileType = TransferProfileType(pInputProfile, pInputParam->dwFormat);
- FX_DWORD dwOutputProfileType = TransferProfileType(pOutputProfile, pOutputParam->dwFormat);
- if (dwInputProfileType == 0 || dwOutputProfileType == 0) {
- return NULL;
- }
- FX_LPVOID pProofProfile = NULL;
- if (pProofParam) {
- pProofProfile = CreateProfile(pProofParam, Icc_CLASS_PROOF, &key);
- }
- key << dwInputProfileType << dwOutputProfileType << dwIntent << dwFlag << (pProofProfile != NULL) << dwPrfIntent << dwPrfFlag;
- CFX_ByteStringC TransformKey(key.GetBuffer(), key.GetSize());
- CFX_IccTransformCache* pTransformCache;
- if (!m_MapTranform.Lookup(TransformKey, (FX_LPVOID&)pTransformCache)) {
- pCmm = FX_Alloc(CLcmsCmm, 1);
- if (pCmm == NULL) {
- return NULL;
- }
- pCmm->m_nSrcComponents = T_CHANNELS(dwInputProfileType);
- pCmm->m_nDstComponents = T_CHANNELS(dwOutputProfileType);
- pCmm->m_bLab = T_COLORSPACE(pInputParam->dwFormat) == PT_Lab;
- pTransformCache = FX_NEW CFX_IccTransformCache(pCmm);
- if (pTransformCache == NULL) {
- FX_Free(pCmm);
- return NULL;
- }
- if (pProofProfile) {
- pTransformCache->m_pIccTransform = cmsCreateProofingTransform(pInputProfile, dwInputProfileType, pOutputProfile, dwOutputProfileType,
- pProofProfile, dwIntent, dwPrfIntent, dwPrfFlag);
- } else {
- pTransformCache->m_pIccTransform = cmsCreateTransform(pInputProfile, dwInputProfileType, pOutputProfile, dwOutputProfileType,
- dwIntent, dwFlag);
- }
- pCmm->m_hTransform = pTransformCache->m_pIccTransform;
- m_MapTranform.SetAt(TransformKey, pTransformCache);
- } else {
- pTransformCache->m_dwRate++;
- }
- return pTransformCache->m_pCmm;
-}
-CCodec_IccModule::~CCodec_IccModule()
-{
- FX_POSITION pos = m_MapProfile.GetStartPosition();
- CFX_ByteString key;
- CFX_IccProfileCache* pProfileCache;
- while (pos) {
- m_MapProfile.GetNextAssoc(pos, key, (FX_LPVOID&)pProfileCache);
- if (pProfileCache) {
- delete pProfileCache;
- }
- }
- pos = m_MapTranform.GetStartPosition();
- CFX_IccTransformCache* pTransformCache;
- while (pos) {
- m_MapTranform.GetNextAssoc(pos, key, (FX_LPVOID&)pTransformCache);
- if (pTransformCache) {
- delete pTransformCache;
- }
- }
-}
-void* CCodec_IccModule::CreateTransform_sRGB(FX_LPCBYTE pProfileData, unsigned int dwProfileSize, int nComponents, int intent, FX_DWORD dwSrcFormat)
-{
- return IccLib_CreateTransform_sRGB(pProfileData, dwProfileSize, nComponents, intent, dwSrcFormat);
-}
-void* CCodec_IccModule::CreateTransform_CMYK(FX_LPCBYTE pSrcProfileData, unsigned int dwSrcProfileSize, int nSrcComponents,
- FX_LPCBYTE pDstProfileData, unsigned int dwDstProfileSize, int intent,
- FX_DWORD dwSrcFormat , FX_DWORD dwDstFormat)
-{
- return IccLib_CreateTransform(pSrcProfileData, dwSrcProfileSize, nSrcComponents,
- pDstProfileData, dwDstProfileSize, 4, intent, dwSrcFormat, dwDstFormat);
-}
-void CCodec_IccModule::DestroyTransform(void* pTransform)
-{
- IccLib_DestroyTransform(pTransform);
-}
-void CCodec_IccModule::Translate(void* pTransform, FX_FLOAT* pSrcValues, FX_FLOAT* pDestValues)
-{
- IccLib_Translate(pTransform, pSrcValues, pDestValues);
-}
-void CCodec_IccModule::TranslateScanline(void* pTransform, FX_LPBYTE pDest, FX_LPCBYTE pSrc, int pixels)
-{
- IccLib_TranslateImage(pTransform, pDest, pSrc, pixels);
-}
-const FX_BYTE g_CMYKSamples[81 * 81 * 3] = {
- 255, 255, 255, 225, 226, 228, 199, 200, 202, 173, 174, 178, 147, 149, 152, 123, 125, 128, 99, 99, 102, 69, 70, 71, 34, 30, 31,
- 255, 253, 229, 226, 224, 203, 200, 199, 182, 173, 173, 158, 149, 148, 135, 125, 124, 113, 99, 99, 90, 70, 69, 63, 33, 29, 24,
- 255, 251, 204, 228, 223, 182, 201, 198, 163, 174, 172, 142, 150, 147, 122, 125, 123, 101, 99, 98, 80, 70, 68, 54, 32, 28, 16,
- 255, 249, 179, 230, 222, 160, 203, 197, 144, 174, 170, 124, 150, 145, 105, 125, 122, 88, 99, 97, 69, 70, 68, 46, 31, 28, 6,
- 255, 247, 154, 229, 220, 138, 203, 195, 122, 176, 169, 107, 150, 145, 91, 125, 121, 74, 100, 96, 57, 70, 67, 35, 29, 26, 0,
- 255, 246, 128, 231, 217, 114, 205, 194, 101, 176, 167, 88, 150, 144, 75, 125, 120, 60, 100, 96, 44, 70, 66, 24, 28, 26, 0,
- 255, 244, 96, 231, 217, 87, 203, 192, 78, 175, 167, 66, 150, 143, 56, 125, 119, 43, 100, 95, 29, 69, 66, 7, 26, 26, 0,
- 255, 243, 51, 232, 215, 51, 204, 191, 43, 176, 165, 38, 150, 142, 28, 125, 118, 17, 99, 94, 0, 68, 65, 0, 24, 25, 0,
- 255, 241, 0, 231, 215, 0, 203, 190, 0, 176, 164, 0, 150, 141, 0, 126, 117, 0, 99, 93, 0, 68, 65, 0, 24, 25, 0,
- 252, 228, 238, 222, 201, 211, 197, 180, 190, 171, 156, 166, 147, 133, 143, 123, 111, 119, 99, 88, 94, 71, 61, 66, 34, 22, 26,
- 254, 226, 213, 224, 201, 191, 199, 179, 171, 172, 155, 148, 147, 133, 128, 123, 110, 106, 98, 87, 83, 70, 59, 57, 33, 21, 18,
- 254, 224, 191, 224, 199, 172, 200, 177, 153, 173, 154, 133, 147, 132, 115, 123, 109, 94, 98, 86, 74, 70, 59, 49, 32, 21, 9,
- 255, 222, 168, 227, 198, 150, 200, 175, 135, 173, 153, 118, 148, 130, 99, 123, 109, 82, 98, 86, 64, 69, 58, 40, 31, 19, 0,
- 255, 221, 145, 227, 196, 129, 201, 174, 115, 173, 151, 99, 148, 129, 85, 124, 108, 69, 98, 85, 52, 69, 58, 30, 30, 19, 0,
- 255, 219, 121, 227, 195, 109, 201, 174, 97, 174, 150, 83, 148, 129, 70, 124, 107, 55, 98, 84, 40, 69, 58, 19, 28, 18, 0,
- 255, 218, 92, 229, 194, 82, 202, 173, 75, 174, 150, 63, 149, 128, 51, 124, 106, 39, 98, 84, 24, 68, 57, 3, 26, 18, 0,
- 255, 217, 54, 228, 193, 52, 201, 172, 46, 174, 148, 36, 148, 127, 27, 123, 105, 14, 98, 83, 0, 68, 56, 0, 25, 18, 0,
- 255, 216, 0, 229, 192, 2, 202, 171, 4, 173, 148, 0, 148, 126, 0, 124, 105, 0, 98, 83, 0, 68, 56, 0, 24, 17, 0,
- 249, 204, 223, 219, 181, 199, 195, 160, 178, 170, 140, 156, 146, 119, 134, 123, 99, 112, 98, 77, 88, 70, 52, 61, 34, 11, 20,
- 250, 201, 200, 221, 180, 178, 197, 159, 161, 171, 139, 139, 147, 119, 120, 123, 98, 99, 98, 77, 78, 69, 51, 52, 34, 11, 10,
- 252, 201, 180, 223, 179, 162, 197, 159, 144, 170, 138, 125, 146, 117, 107, 122, 97, 89, 98, 76, 69, 69, 50, 44, 32, 11, 2,
- 252, 199, 158, 222, 177, 143, 199, 158, 127, 171, 137, 110, 147, 117, 93, 122, 96, 76, 97, 75, 58, 69, 50, 36, 32, 10, 0,
- 253, 198, 137, 223, 177, 123, 198, 156, 110, 171, 136, 95, 146, 116, 80, 122, 96, 65, 97, 75, 47, 69, 50, 25, 30, 10, 0,
- 254, 197, 115, 225, 175, 104, 198, 156, 92, 172, 135, 79, 147, 115, 66, 123, 95, 52, 98, 74, 37, 69, 49, 15, 29, 10, 0,
- 254, 196, 89, 224, 175, 80, 199, 154, 70, 172, 134, 59, 146, 114, 48, 122, 95, 36, 97, 74, 21, 68, 49, 0, 27, 9, 0,
- 255, 195, 57, 225, 173, 52, 198, 154, 44, 172, 133, 36, 147, 113, 26, 123, 94, 14, 98, 74, 0, 68, 49, 0, 26, 10, 0,
- 254, 194, 15, 225, 172, 12, 198, 153, 7, 172, 132, 3, 146, 113, 0, 123, 93, 0, 98, 73, 0, 68, 49, 0, 26, 9, 0,
- 246, 178, 209, 218, 159, 186, 194, 140, 166, 168, 122, 145, 144, 104, 125, 121, 85, 103, 97, 65, 81, 69, 41, 55, 34, 0, 12,
- 248, 176, 186, 219, 157, 166, 195, 139, 149, 168, 121, 130, 144, 103, 111, 121, 85, 91, 97, 65, 71, 69, 41, 46, 34, 0, 4,
- 249, 175, 168, 220, 156, 150, 196, 139, 135, 169, 121, 116, 144, 103, 100, 122, 84, 83, 98, 65, 63, 70, 41, 39, 33, 0, 0,
- 249, 175, 148, 220, 155, 133, 196, 138, 119, 169, 120, 103, 145, 101, 87, 121, 83, 71, 97, 65, 54, 69, 41, 31, 32, 0, 0,
- 249, 173, 128, 222, 154, 115, 195, 137, 102, 170, 119, 88, 145, 101, 74, 122, 83, 59, 97, 64, 43, 68, 40, 20, 30, 0, 0,
- 250, 172, 108, 221, 154, 98, 195, 136, 86, 170, 118, 73, 145, 100, 61, 122, 82, 48, 97, 63, 32, 69, 40, 11, 28, 0, 0,
- 250, 171, 85, 221, 153, 76, 196, 136, 67, 170, 117, 56, 145, 99, 44, 121, 82, 33, 97, 63, 17, 68, 40, 0, 28, 0, 0,
- 251, 171, 58, 222, 152, 50, 197, 135, 43, 169, 117, 34, 146, 99, 25, 121, 81, 10, 96, 63, 0, 68, 40, 0, 27, 0, 0,
- 250, 170, 26, 222, 151, 19, 196, 134, 13, 169, 116, 4, 145, 99, 0, 122, 81, 0, 97, 63, 0, 67, 40, 0, 26, 0, 0,
- 244, 153, 194, 215, 136, 173, 192, 121, 155, 167, 104, 135, 143, 89, 115, 121, 72, 96, 97, 54, 75, 70, 31, 49, 34, 0, 6,
- 245, 153, 173, 216, 136, 155, 192, 120, 138, 167, 104, 121, 144, 88, 103, 121, 71, 85, 97, 54, 66, 69, 31, 42, 34, 0, 0,
- 246, 152, 157, 217, 135, 140, 193, 120, 126, 167, 103, 109, 143, 88, 92, 121, 72, 76, 97, 54, 58, 69, 31, 35, 33, 0, 0,
- 245, 150, 139, 218, 134, 125, 193, 119, 111, 167, 103, 96, 144, 87, 80, 121, 71, 66, 96, 53, 49, 68, 31, 26, 32, 0, 0,
- 246, 151, 122, 218, 133, 108, 194, 118, 96, 168, 102, 81, 144, 86, 69, 120, 71, 55, 95, 53, 39, 68, 30, 17, 31, 0, 0,
- 248, 150, 103, 218, 133, 91, 193, 118, 81, 168, 102, 69, 143, 86, 56, 120, 70, 43, 96, 53, 28, 68, 31, 6, 29, 0, 0,
- 247, 149, 81, 218, 132, 72, 194, 117, 62, 168, 101, 52, 144, 86, 42, 121, 70, 29, 96, 52, 13, 68, 30, 0, 28, 0, 0,
- 247, 148, 55, 219, 131, 50, 194, 117, 43, 167, 101, 32, 144, 85, 22, 120, 69, 8, 96, 52, 0, 67, 30, 0, 27, 0, 0,
- 247, 147, 29, 218, 131, 24, 194, 116, 20, 168, 100, 11, 144, 85, 0, 120, 69, 0, 96, 52, 0, 67, 30, 0, 26, 0, 0,
- 242, 130, 179, 214, 114, 160, 190, 101, 143, 166, 87, 125, 143, 72, 107, 120, 58, 88, 96, 42, 68, 69, 17, 44, 35, 0, 0,
- 243, 129, 161, 215, 114, 143, 191, 101, 128, 166, 87, 113, 143, 73, 96, 120, 58, 79, 96, 41, 60, 69, 18, 37, 33, 0, 0,
- 243, 129, 146, 216, 114, 130, 192, 101, 117, 166, 87, 101, 143, 72, 86, 121, 58, 69, 96, 42, 52, 69, 18, 29, 31, 0, 0,
- 243, 128, 130, 216, 114, 115, 191, 101, 102, 165, 86, 88, 142, 72, 75, 120, 58, 60, 95, 42, 43, 68, 19, 21, 30, 0, 0,
- 244, 127, 112, 217, 113, 101, 192, 99, 89, 166, 85, 75, 142, 72, 63, 119, 57, 50, 96, 41, 35, 68, 19, 13, 30, 0, 0,
- 244, 127, 96, 216, 112, 86, 191, 99, 75, 166, 86, 64, 143, 72, 52, 120, 57, 40, 95, 41, 24, 67, 20, 1, 29, 0, 0,
- 245, 126, 77, 216, 113, 68, 191, 100, 59, 166, 85, 49, 142, 71, 38, 119, 57, 26, 95, 41, 10, 67, 20, 0, 28, 0, 0,
- 244, 126, 55, 216, 112, 48, 191, 99, 40, 166, 85, 31, 143, 71, 20, 119, 57, 6, 95, 42, 0, 67, 20, 0, 28, 0, 0,
- 245, 126, 33, 217, 112, 26, 192, 99, 22, 166, 84, 11, 142, 70, 0, 119, 57, 0, 95, 41, 0, 66, 20, 0, 27, 0, 0,
- 241, 102, 167, 213, 90, 149, 189, 79, 133, 165, 66, 115, 141, 54, 98, 119, 41, 81, 96, 25, 63, 69, 0, 38, 30, 0, 0,
- 241, 102, 149, 213, 90, 133, 189, 79, 119, 165, 66, 103, 142, 55, 88, 119, 41, 71, 96, 25, 53, 69, 0, 31, 28, 0, 0,
- 241, 102, 135, 214, 90, 121, 190, 79, 108, 165, 66, 92, 141, 55, 78, 119, 42, 63, 96, 26, 46, 69, 0, 24, 28, 0, 0,
- 241, 101, 120, 214, 90, 107, 189, 79, 95, 165, 67, 83, 141, 54, 68, 118, 41, 54, 95, 27, 39, 68, 0, 16, 27, 0, 0,
- 241, 102, 106, 213, 90, 93, 189, 78, 82, 164, 67, 70, 141, 55, 58, 118, 42, 45, 94, 27, 29, 67, 2, 6, 27, 0, 0,
- 242, 101, 90, 214, 89, 79, 190, 79, 69, 166, 67, 59, 141, 55, 47, 118, 41, 35, 95, 27, 19, 67, 3, 0, 26, 0, 0,
- 242, 102, 72, 213, 89, 63, 191, 79, 56, 164, 67, 45, 141, 55, 34, 118, 42, 22, 94, 28, 6, 67, 3, 0, 26, 0, 0,
- 242, 100, 51, 214, 89, 45, 190, 78, 38, 164, 67, 30, 141, 55, 18, 118, 42, 3, 95, 28, 0, 66, 4, 0, 26, 0, 0,
- 243, 100, 33, 214, 90, 27, 190, 78, 22, 165, 67, 13, 141, 55, 0, 118, 43, 0, 94, 29, 0, 66, 5, 0, 26, 0, 0,
- 237, 69, 153, 211, 58, 135, 187, 51, 121, 163, 41, 105, 141, 28, 90, 118, 15, 73, 96, 0, 56, 68, 0, 33, 25, 0, 0,
- 239, 67, 137, 212, 60, 123, 189, 50, 110, 163, 41, 94, 141, 29, 79, 118, 17, 65, 95, 0, 48, 69, 0, 26, 25, 0, 0,
- 240, 69, 124, 211, 60, 111, 188, 50, 98, 163, 42, 85, 141, 31, 72, 118, 18, 57, 94, 0, 41, 68, 0, 19, 25, 0, 0,
- 240, 70, 112, 212, 61, 99, 188, 52, 87, 163, 41, 74, 140, 31, 62, 118, 20, 48, 94, 2, 32, 68, 0, 11, 24, 0, 0,
- 239, 70, 98, 212, 62, 86, 188, 53, 77, 164, 42, 64, 140, 32, 52, 118, 20, 40, 94, 3, 24, 67, 0, 3, 23, 0, 0,
- 239, 71, 85, 212, 61, 74, 187, 53, 65, 163, 44, 54, 140, 34, 43, 118, 22, 30, 95, 3, 14, 67, 0, 0, 23, 0, 0,
- 239, 70, 67, 212, 62, 59, 188, 53, 51, 163, 45, 42, 141, 34, 31, 117, 22, 17, 94, 5, 2, 66, 0, 0, 23, 0, 0,
- 239, 71, 50, 213, 62, 43, 188, 54, 37, 164, 45, 28, 139, 34, 16, 117, 22, 2, 94, 7, 0, 65, 0, 0, 23, 0, 0,
- 240, 71, 34, 212, 63, 29, 189, 54, 24, 163, 46, 15, 139, 36, 2, 117, 25, 0, 94, 8, 0, 66, 0, 0, 23, 0, 0,
- 237, 0, 140, 209, 0, 124, 186, 0, 112, 162, 0, 97, 141, 0, 82, 118, 0, 67, 95, 0, 49, 68, 0, 27, 20, 0, 0,
- 237, 0, 126, 210, 0, 113, 187, 0, 99, 163, 0, 86, 139, 0, 72, 118, 0, 58, 95, 0, 42, 67, 0, 20, 20, 0, 0,
- 237, 1, 114, 209, 1, 102, 187, 0, 90, 163, 0, 78, 139, 0, 64, 118, 0, 50, 95, 0, 35, 67, 0, 13, 20, 0, 0,
- 236, 16, 102, 209, 7, 91, 186, 0, 80, 162, 0, 68, 139, 0, 56, 117, 0, 43, 94, 0, 27, 67, 0, 6, 20, 0, 0,
- 238, 15, 89, 209, 13, 79, 186, 6, 69, 162, 0, 58, 139, 0, 47, 117, 0, 34, 93, 0, 20, 66, 0, 2, 20, 0, 0,
- 237, 20, 78, 210, 12, 68, 187, 4, 59, 163, 0, 49, 139, 0, 38, 116, 0, 26, 94, 0, 11, 66, 0, 0, 20, 0, 0,
- 237, 25, 64, 210, 18, 56, 186, 11, 48, 162, 4, 39, 138, 0, 27, 117, 0, 14, 93, 0, 0, 66, 0, 0, 20, 0, 0,
- 238, 25, 48, 210, 22, 43, 186, 15, 35, 162, 8, 26, 140, 0, 14, 117, 0, 0, 93, 0, 0, 65, 0, 0, 20, 0, 0,
- 238, 28, 35, 210, 21, 30, 187, 15, 24, 162, 8, 16, 139, 1, 2, 117, 0, 0, 93, 0, 0, 65, 0, 0, 22, 0, 0,
- 219, 242, 252, 195, 214, 225, 172, 191, 201, 148, 165, 175, 127, 142, 150, 106, 119, 126, 84, 95, 101, 58, 66, 72, 24, 27, 32,
- 222, 239, 226, 196, 213, 202, 173, 189, 180, 150, 165, 158, 129, 141, 135, 107, 118, 113, 85, 94, 90, 58, 66, 63, 21, 26, 24,
- 223, 237, 203, 198, 211, 182, 175, 188, 163, 152, 164, 141, 129, 140, 121, 107, 117, 101, 85, 93, 80, 58, 64, 54, 21, 26, 18,
- 226, 236, 179, 201, 210, 160, 177, 187, 143, 153, 162, 125, 130, 139, 106, 108, 116, 89, 85, 92, 69, 58, 64, 45, 20, 25, 8,
- 227, 234, 153, 201, 208, 139, 178, 185, 124, 154, 161, 107, 131, 138, 91, 108, 115, 75, 85, 91, 58, 58, 63, 35, 17, 25, 0,
- 229, 233, 130, 203, 207, 116, 178, 184, 104, 154, 160, 90, 131, 137, 76, 109, 114, 62, 85, 90, 46, 58, 63, 25, 16, 24, 0,
- 230, 231, 100, 202, 205, 90, 179, 183, 80, 154, 159, 69, 131, 136, 57, 109, 113, 46, 86, 90, 32, 58, 63, 10, 14, 24, 0,
- 230, 230, 65, 204, 204, 58, 180, 182, 52, 155, 157, 44, 132, 135, 35, 110, 113, 24, 86, 89, 9, 57, 62, 0, 11, 24, 0,
- 232, 230, 19, 204, 204, 19, 180, 181, 17, 155, 157, 10, 131, 134, 2, 109, 112, 0, 85, 89, 0, 57, 62, 0, 10, 23, 0,
- 218, 216, 236, 194, 192, 211, 172, 171, 188, 149, 149, 164, 128, 127, 141, 106, 106, 119, 84, 84, 94, 59, 57, 66, 25, 18, 26,
- 221, 214, 211, 196, 191, 190, 174, 170, 170, 150, 148, 148, 128, 126, 127, 107, 105, 106, 85, 83, 84, 59, 56, 58, 23, 17, 18,
- 222, 213, 190, 197, 189, 170, 175, 169, 153, 151, 147, 133, 129, 126, 113, 108, 105, 94, 85, 82, 74, 59, 56, 49, 22, 17, 11,
- 224, 211, 168, 199, 188, 151, 175, 168, 135, 152, 146, 117, 129, 124, 99, 107, 103, 82, 84, 82, 64, 59, 55, 41, 21, 17, 1,
- 224, 210, 145, 199, 187, 130, 176, 166, 117, 152, 145, 101, 129, 123, 86, 107, 103, 70, 85, 81, 53, 58, 55, 31, 19, 17, 0,
- 227, 208, 123, 200, 186, 110, 177, 165, 98, 153, 143, 84, 130, 122, 70, 108, 102, 57, 85, 80, 41, 58, 54, 20, 18, 16, 0,
- 227, 208, 97, 202, 185, 86, 177, 164, 77, 153, 142, 65, 130, 122, 54, 108, 101, 42, 85, 80, 27, 58, 54, 7, 16, 16, 0,
- 228, 206, 66, 202, 184, 58, 178, 163, 50, 154, 141, 42, 131, 121, 33, 109, 101, 21, 86, 79, 5, 58, 54, 0, 13, 16, 0,
- 228, 206, 29, 202, 183, 25, 178, 163, 20, 154, 141, 15, 131, 121, 5, 108, 100, 0, 85, 79, 0, 58, 53, 0, 13, 16, 0,
- 217, 193, 221, 193, 172, 198, 172, 153, 178, 149, 133, 154, 128, 114, 132, 107, 94, 111, 85, 74, 89, 59, 49, 61, 25, 8, 22,
- 219, 191, 198, 195, 171, 178, 173, 153, 159, 149, 132, 139, 128, 113, 119, 107, 94, 100, 85, 73, 79, 59, 48, 52, 25, 7, 14,
- 221, 191, 180, 196, 170, 160, 174, 152, 144, 150, 132, 125, 129, 113, 107, 107, 93, 89, 85, 73, 69, 59, 48, 45, 23, 7, 4,
- 222, 189, 159, 197, 169, 142, 174, 151, 127, 151, 131, 110, 129, 112, 94, 108, 93, 78, 85, 72, 60, 58, 47, 37, 22, 7, 0,
- 223, 188, 138, 197, 168, 123, 175, 150, 109, 151, 130, 95, 130, 111, 81, 108, 92, 65, 85, 72, 49, 59, 47, 27, 21, 7, 0,
- 224, 187, 118, 198, 167, 105, 176, 149, 93, 152, 129, 79, 130, 110, 68, 108, 91, 54, 85, 71, 38, 59, 47, 17, 18, 7, 0,
- 224, 187, 93, 199, 166, 83, 176, 148, 73, 152, 128, 62, 129, 109, 51, 108, 90, 39, 85, 71, 25, 58, 46, 3, 16, 8, 0,
- 226, 186, 64, 200, 165, 57, 177, 147, 50, 153, 127, 40, 130, 108, 31, 108, 90, 19, 85, 70, 3, 58, 46, 0, 16, 8, 0,
- 227, 185, 35, 200, 165, 30, 176, 146, 25, 152, 127, 18, 130, 108, 7, 108, 89, 0, 85, 70, 0, 57, 46, 0, 14, 8, 0,
- 216, 169, 205, 192, 150, 184, 171, 134, 164, 149, 116, 144, 128, 99, 124, 107, 81, 103, 85, 63, 81, 60, 39, 55, 26, 0, 15,
- 217, 168, 186, 193, 150, 165, 172, 134, 149, 150, 116, 130, 128, 99, 111, 107, 81, 92, 85, 62, 72, 59, 39, 47, 25, 0, 6,
- 219, 168, 168, 194, 149, 150, 173, 133, 135, 150, 116, 117, 128, 98, 99, 107, 80, 82, 86, 62, 63, 59, 38, 39, 24, 0, 0,
- 219, 166, 148, 195, 149, 133, 173, 133, 119, 150, 115, 103, 128, 98, 88, 107, 80, 72, 85, 61, 54, 59, 38, 32, 23, 0, 0,
- 220, 166, 129, 196, 148, 116, 174, 132, 103, 151, 114, 89, 129, 97, 75, 107, 79, 60, 85, 61, 44, 59, 38, 22, 21, 0, 0,
- 222, 164, 110, 197, 147, 99, 175, 131, 87, 151, 113, 75, 129, 96, 63, 107, 79, 49, 85, 61, 33, 58, 38, 12, 19, 0, 0,
- 222, 164, 88, 197, 146, 79, 174, 130, 69, 151, 113, 58, 129, 95, 47, 107, 78, 35, 85, 60, 20, 58, 38, 0, 18, 0, 0,
- 223, 164, 63, 198, 145, 55, 175, 129, 48, 151, 112, 39, 129, 95, 29, 107, 78, 16, 85, 60, 1, 58, 38, 0, 17, 0, 0,
- 223, 163, 36, 198, 145, 32, 174, 129, 26, 151, 111, 17, 129, 95, 7, 107, 78, 0, 84, 60, 0, 57, 37, 0, 15, 0, 0,
- 215, 147, 192, 191, 130, 172, 170, 116, 153, 148, 100, 133, 127, 85, 115, 107, 69, 96, 85, 51, 75, 60, 28, 50, 25, 0, 8,
- 217, 146, 173, 192, 130, 154, 171, 115, 138, 149, 100, 121, 128, 84, 103, 107, 68, 85, 85, 51, 66, 60, 28, 42, 25, 0, 0,
- 217, 145, 157, 193, 129, 140, 173, 115, 125, 149, 100, 109, 128, 84, 92, 107, 68, 76, 85, 51, 58, 59, 28, 35, 23, 0, 0,
- 218, 145, 140, 193, 129, 125, 172, 114, 110, 149, 99, 96, 128, 83, 81, 107, 67, 65, 84, 51, 49, 59, 29, 27, 22, 0, 0,
- 219, 144, 121, 194, 128, 108, 172, 113, 96, 149, 98, 83, 128, 83, 69, 107, 68, 55, 85, 50, 40, 59, 28, 18, 20, 0, 0,
- 220, 143, 104, 195, 128, 93, 173, 114, 82, 150, 98, 69, 127, 82, 58, 107, 67, 45, 85, 50, 30, 59, 28, 7, 19, 0, 0,
- 220, 143, 84, 195, 127, 74, 173, 113, 65, 149, 97, 55, 128, 82, 44, 106, 67, 32, 84, 50, 16, 58, 28, 0, 18, 0, 0,
- 221, 142, 62, 196, 126, 53, 173, 112, 46, 150, 97, 37, 128, 82, 26, 107, 66, 14, 84, 50, 0, 58, 28, 0, 16, 0, 0,
- 222, 142, 38, 196, 126, 34, 174, 112, 27, 150, 96, 17, 128, 82, 6, 106, 66, 0, 84, 50, 0, 57, 29, 0, 16, 0, 0,
- 214, 123, 179, 191, 110, 159, 169, 98, 143, 147, 84, 124, 126, 70, 106, 107, 55, 88, 85, 39, 69, 60, 15, 45, 23, 0, 2,
- 216, 123, 161, 192, 110, 144, 170, 98, 129, 148, 84, 112, 127, 70, 95, 107, 55, 79, 85, 39, 61, 60, 15, 37, 20, 0, 0,
- 217, 122, 145, 192, 110, 130, 170, 97, 116, 149, 84, 101, 127, 70, 85, 106, 55, 70, 85, 39, 53, 59, 16, 30, 19, 0, 0,
- 217, 123, 131, 192, 109, 116, 171, 96, 103, 149, 83, 89, 127, 70, 75, 106, 55, 60, 85, 40, 45, 59, 16, 23, 17, 0, 0,
- 217, 122, 114, 193, 109, 101, 172, 96, 91, 149, 82, 77, 128, 69, 64, 106, 55, 50, 84, 39, 35, 59, 17, 14, 17, 0, 0,
- 218, 122, 98, 194, 108, 87, 171, 96, 77, 149, 82, 65, 127, 69, 52, 106, 55, 40, 84, 40, 25, 59, 18, 3, 15, 0, 0,
- 219, 122, 80, 193, 108, 70, 172, 95, 61, 149, 82, 51, 127, 69, 40, 106, 55, 28, 84, 39, 12, 58, 17, 0, 13, 0, 0,
- 219, 121, 59, 194, 108, 52, 172, 96, 44, 149, 82, 35, 127, 68, 24, 106, 55, 11, 84, 40, 0, 57, 18, 0, 13, 0, 0,
- 219, 121, 40, 193, 108, 33, 172, 95, 26, 149, 81, 19, 128, 68, 6, 106, 54, 0, 84, 39, 0, 57, 18, 0, 13, 0, 0,
- 213, 99, 165, 189, 87, 148, 169, 76, 132, 147, 64, 115, 126, 52, 98, 106, 39, 81, 85, 23, 63, 60, 0, 39, 16, 0, 0,
- 214, 98, 149, 191, 87, 133, 170, 76, 119, 148, 65, 103, 127, 53, 88, 106, 39, 72, 85, 24, 55, 60, 0, 32, 15, 0, 0,
- 215, 99, 136, 191, 87, 121, 170, 77, 108, 148, 65, 93, 126, 53, 79, 106, 40, 64, 85, 24, 47, 59, 0, 25, 14, 0, 0,
- 215, 99, 121, 192, 87, 108, 170, 77, 96, 148, 65, 82, 126, 53, 69, 106, 40, 55, 85, 25, 39, 59, 0, 18, 13, 0, 0,
- 216, 99, 106, 191, 87, 95, 170, 76, 83, 148, 65, 71, 126, 53, 58, 106, 41, 45, 85, 26, 30, 59, 0, 8, 11, 0, 0,
- 216, 98, 91, 192, 88, 82, 170, 77, 71, 148, 65, 60, 127, 53, 48, 105, 41, 36, 83, 26, 21, 58, 1, 2, 11, 0, 0,
- 217, 99, 75, 192, 87, 66, 170, 76, 57, 148, 65, 47, 126, 53, 36, 105, 41, 24, 83, 26, 8, 57, 2, 0, 9, 0, 0,
- 217, 98, 57, 192, 87, 49, 171, 77, 41, 147, 65, 32, 126, 53, 21, 105, 41, 8, 84, 27, 0, 57, 3, 0, 9, 0, 0,
- 217, 98, 40, 193, 87, 34, 171, 76, 27, 148, 65, 19, 126, 53, 6, 105, 41, 0, 83, 27, 0, 57, 4, 0, 9, 0, 0,
- 211, 67, 152, 189, 58, 136, 168, 50, 122, 147, 39, 105, 127, 28, 89, 106, 14, 74, 85, 0, 56, 59, 0, 33, 9, 0, 0,
- 213, 68, 138, 190, 59, 123, 169, 51, 109, 148, 40, 95, 126, 30, 80, 106, 16, 65, 85, 0, 48, 59, 0, 27, 9, 0, 0,
- 214, 69, 125, 190, 59, 111, 168, 51, 99, 148, 41, 86, 126, 31, 72, 106, 18, 58, 85, 0, 41, 59, 0, 20, 7, 0, 0,
- 215, 70, 112, 190, 61, 100, 169, 52, 88, 147, 42, 76, 126, 32, 63, 106, 19, 49, 84, 1, 34, 58, 0, 13, 7, 0, 0,
- 214, 70, 99, 190, 62, 88, 169, 53, 77, 147, 43, 65, 125, 32, 53, 106, 20, 40, 84, 3, 26, 58, 0, 4, 7, 0, 0,
- 214, 71, 86, 190, 61, 75, 169, 53, 65, 146, 43, 54, 126, 33, 44, 105, 21, 31, 83, 4, 17, 57, 0, 0, 7, 0, 0,
- 215, 71, 71, 191, 62, 62, 169, 53, 53, 147, 44, 44, 126, 34, 33, 105, 22, 20, 83, 5, 4, 57, 0, 0, 7, 0, 0,
- 215, 71, 54, 191, 62, 47, 169, 54, 39, 147, 44, 30, 126, 35, 20, 105, 23, 6, 83, 6, 0, 56, 0, 0, 5, 0, 0,
- 215, 71, 41, 191, 63, 34, 170, 54, 27, 147, 45, 17, 126, 35, 6, 105, 23, 0, 83, 8, 0, 56, 0, 0, 5, 0, 0,
- 210, 13, 140, 189, 1, 125, 167, 0, 110, 146, 0, 96, 126, 0, 81, 106, 0, 67, 85, 0, 51, 59, 0, 28, 4, 0, 0,
- 212, 18, 126, 190, 7, 113, 168, 0, 100, 146, 0, 86, 126, 0, 73, 106, 0, 59, 84, 0, 43, 59, 0, 22, 4, 0, 0,
- 212, 21, 115, 190, 13, 103, 168, 3, 91, 146, 0, 78, 125, 0, 65, 105, 0, 52, 84, 0, 36, 58, 0, 16, 4, 0, 0,
- 213, 24, 103, 189, 19, 91, 168, 9, 82, 146, 0, 69, 125, 0, 57, 105, 0, 44, 84, 0, 29, 58, 0, 7, 4, 0, 0,
- 213, 27, 92, 188, 21, 81, 168, 14, 71, 146, 1, 59, 125, 0, 48, 105, 0, 36, 84, 0, 21, 58, 0, 4, 4, 0, 0,
- 213, 30, 80, 189, 22, 69, 168, 17, 61, 146, 5, 50, 125, 0, 39, 104, 0, 27, 83, 0, 12, 57, 0, 0, 4, 0, 0,
- 214, 30, 67, 189, 25, 57, 168, 20, 50, 146, 9, 40, 125, 0, 29, 104, 0, 17, 83, 0, 2, 56, 0, 0, 4, 0, 0,
- 214, 32, 53, 189, 27, 44, 169, 20, 38, 146, 13, 28, 124, 2, 17, 104, 0, 4, 83, 0, 0, 56, 0, 0, 4, 0, 0,
- 214, 33, 41, 190, 27, 33, 168, 23, 27, 146, 13, 18, 125, 3, 5, 105, 0, 0, 83, 0, 0, 56, 0, 0, 4, 0, 0,
- 185, 229, 250, 164, 204, 223, 146, 182, 199, 127, 158, 174, 108, 136, 149, 89, 113, 125, 70, 90, 100, 46, 62, 71, 10, 25, 33,
- 189, 227, 225, 168, 202, 201, 148, 181, 179, 129, 157, 156, 109, 135, 134, 90, 113, 113, 70, 89, 90, 46, 62, 62, 8, 24, 25,
- 192, 226, 202, 170, 202, 182, 151, 179, 162, 130, 156, 141, 110, 133, 121, 91, 112, 101, 71, 89, 80, 46, 61, 54, 7, 24, 19,
- 194, 224, 179, 173, 200, 160, 153, 178, 144, 132, 155, 125, 112, 133, 107, 92, 111, 89, 71, 88, 69, 46, 61, 45, 6, 23, 10,
- 196, 223, 155, 174, 198, 139, 154, 176, 124, 132, 153, 107, 113, 131, 91, 92, 110, 75, 72, 87, 58, 47, 60, 37, 4, 23, 0,
- 198, 221, 131, 175, 197, 117, 155, 175, 105, 133, 152, 91, 113, 130, 76, 92, 109, 63, 72, 86, 47, 46, 60, 26, 3, 23, 0,
- 200, 220, 104, 176, 196, 94, 156, 175, 84, 134, 151, 72, 113, 129, 59, 93, 108, 47, 72, 85, 33, 46, 59, 13, 0, 23, 0,
- 201, 219, 73, 179, 195, 65, 157, 173, 57, 135, 150, 48, 114, 129, 39, 94, 108, 28, 72, 85, 15, 47, 59, 0, 0, 22, 0,
- 203, 219, 42, 178, 195, 37, 157, 173, 32, 135, 150, 26, 114, 128, 16, 94, 107, 6, 73, 85, 0, 46, 58, 0, 0, 22, 0,
- 186, 205, 233, 165, 183, 209, 148, 163, 187, 128, 142, 163, 109, 121, 140, 91, 101, 118, 71, 80, 94, 48, 54, 66, 12, 15, 27,
- 189, 204, 211, 169, 182, 189, 151, 163, 169, 131, 141, 147, 111, 121, 126, 92, 101, 105, 72, 79, 84, 48, 54, 58, 11, 15, 19,
- 192, 202, 190, 171, 181, 170, 152, 161, 152, 131, 141, 133, 112, 120, 113, 93, 100, 94, 72, 79, 74, 48, 53, 50, 10, 15, 11,
- 195, 201, 169, 172, 179, 151, 153, 160, 135, 132, 139, 117, 113, 119, 100, 93, 99, 82, 72, 78, 64, 48, 53, 41, 9, 14, 3,
- 195, 200, 146, 174, 179, 131, 154, 159, 117, 133, 138, 101, 113, 118, 86, 93, 98, 70, 73, 77, 53, 48, 52, 32, 8, 15, 0,
- 198, 199, 125, 175, 177, 111, 155, 158, 100, 133, 137, 85, 113, 117, 71, 93, 97, 57, 72, 77, 42, 47, 52, 22, 5, 14, 0,
- 199, 198, 101, 176, 177, 89, 155, 157, 79, 134, 136, 68, 113, 116, 56, 94, 97, 44, 73, 76, 30, 47, 52, 10, 2, 15, 0,
- 200, 197, 72, 178, 176, 63, 157, 156, 56, 135, 136, 46, 114, 116, 37, 94, 96, 26, 73, 76, 11, 47, 51, 0, 0, 14, 0,
- 201, 197, 45, 177, 175, 38, 156, 155, 31, 135, 135, 25, 114, 115, 17, 94, 96, 5, 73, 75, 0, 46, 51, 0, 0, 14, 0,
- 187, 183, 218, 167, 165, 197, 149, 147, 176, 129, 127, 153, 111, 109, 132, 92, 90, 111, 73, 70, 89, 49, 46, 62, 15, 4, 22,
- 190, 183, 197, 170, 164, 177, 151, 146, 159, 130, 127, 139, 112, 109, 119, 93, 90, 99, 72, 70, 78, 49, 45, 53, 14, 4, 15,
- 192, 182, 179, 171, 163, 161, 153, 145, 144, 132, 126, 125, 113, 108, 107, 93, 89, 88, 73, 70, 69, 49, 45, 45, 13, 5, 6,
- 195, 181, 159, 172, 162, 142, 152, 145, 127, 132, 125, 111, 113, 107, 94, 93, 88, 77, 73, 69, 59, 48, 45, 37, 11, 5, 0,
- 195, 180, 139, 173, 161, 124, 153, 143, 110, 133, 125, 96, 113, 106, 81, 94, 88, 66, 73, 68, 49, 49, 44, 28, 9, 6, 0,
- 196, 179, 118, 174, 160, 106, 154, 142, 94, 133, 124, 81, 113, 105, 68, 94, 87, 54, 73, 68, 39, 48, 44, 18, 5, 5, 0,
- 197, 178, 96, 176, 159, 86, 155, 141, 75, 134, 123, 64, 114, 105, 53, 94, 87, 40, 73, 68, 26, 48, 44, 5, 2, 6, 0,
- 199, 178, 70, 176, 158, 62, 156, 141, 54, 134, 122, 44, 114, 104, 35, 94, 86, 23, 73, 67, 8, 47, 44, 0, 2, 6, 0,
- 199, 177, 45, 178, 158, 40, 156, 140, 32, 135, 122, 26, 114, 104, 16, 94, 86, 4, 73, 67, 0, 47, 44, 0, 0, 7, 0,
- 188, 161, 204, 168, 144, 183, 149, 129, 164, 130, 112, 144, 112, 95, 123, 93, 78, 103, 74, 60, 81, 50, 36, 56, 16, 0, 16,
- 190, 160, 185, 170, 144, 165, 151, 128, 148, 132, 111, 130, 112, 95, 110, 93, 78, 92, 74, 59, 72, 50, 36, 48, 16, 0, 8,
- 192, 160, 167, 171, 143, 150, 153, 128, 134, 132, 111, 117, 112, 94, 100, 94, 77, 82, 74, 59, 63, 50, 36, 40, 14, 0, 0,
- 193, 159, 149, 172, 143, 134, 153, 127, 119, 133, 110, 103, 113, 94, 87, 93, 77, 72, 73, 59, 54, 50, 36, 32, 12, 0, 0,
- 195, 159, 131, 173, 142, 117, 153, 127, 104, 132, 110, 90, 113, 93, 76, 93, 76, 61, 74, 59, 45, 49, 36, 23, 9, 0, 0,
- 196, 158, 113, 174, 141, 101, 155, 126, 89, 133, 109, 76, 113, 93, 64, 94, 76, 51, 74, 58, 35, 49, 36, 14, 6, 0, 0,
- 197, 157, 92, 174, 141, 80, 154, 125, 71, 134, 108, 60, 114, 92, 50, 94, 75, 37, 73, 58, 22, 48, 36, 1, 5, 0, 0,
- 197, 157, 68, 175, 140, 59, 155, 124, 51, 134, 108, 41, 113, 91, 32, 94, 75, 21, 73, 57, 5, 48, 35, 0, 5, 0, 0,
- 198, 156, 46, 176, 140, 40, 155, 124, 32, 134, 107, 24, 114, 91, 14, 94, 75, 2, 73, 57, 0, 48, 36, 0, 3, 0, 0,
- 189, 140, 191, 168, 126, 172, 150, 112, 154, 131, 97, 134, 112, 82, 115, 94, 66, 96, 74, 49, 75, 51, 25, 50, 12, 0, 10,
- 191, 139, 173, 170, 125, 154, 152, 111, 138, 132, 96, 121, 113, 81, 103, 94, 66, 85, 74, 48, 66, 50, 26, 42, 12, 0, 1,
- 192, 139, 157, 171, 125, 140, 152, 111, 125, 132, 96, 109, 113, 81, 92, 94, 65, 76, 74, 48, 58, 50, 26, 35, 9, 0, 0,
- 193, 139, 140, 172, 124, 125, 153, 110, 112, 133, 95, 96, 113, 80, 82, 94, 65, 66, 74, 49, 50, 50, 26, 28, 7, 0, 0,
- 194, 138, 123, 172, 123, 109, 153, 110, 97, 133, 95, 84, 113, 80, 70, 94, 65, 56, 74, 48, 40, 50, 26, 20, 6, 0, 0,
- 194, 138, 105, 173, 123, 94, 153, 109, 83, 133, 94, 70, 112, 79, 59, 94, 64, 46, 74, 48, 31, 50, 26, 9, 4, 0, 0,
- 196, 138, 87, 174, 122, 77, 153, 109, 67, 133, 93, 56, 113, 79, 46, 94, 64, 34, 73, 48, 18, 49, 27, 0, 4, 0, 0,
- 196, 137, 65, 174, 122, 57, 154, 108, 49, 133, 93, 39, 113, 79, 29, 94, 64, 18, 74, 48, 3, 49, 27, 0, 2, 0, 0,
- 197, 137, 47, 175, 122, 40, 155, 108, 32, 133, 93, 23, 114, 79, 14, 94, 64, 1, 73, 48, 0, 48, 27, 0, 2, 0, 0,
- 189, 119, 177, 168, 106, 159, 150, 94, 142, 131, 81, 124, 113, 67, 107, 94, 53, 89, 74, 37, 69, 51, 11, 45, 6, 0, 3,
- 191, 119, 161, 170, 106, 144, 152, 94, 129, 132, 81, 112, 113, 67, 96, 94, 53, 79, 74, 37, 61, 51, 13, 38, 6, 0, 0,
- 192, 119, 146, 170, 106, 131, 152, 94, 117, 132, 80, 101, 112, 67, 85, 94, 53, 70, 74, 37, 53, 50, 14, 31, 4, 0, 0,
- 192, 119, 131, 171, 106, 117, 153, 94, 105, 132, 80, 89, 113, 67, 75, 94, 54, 61, 74, 38, 45, 51, 14, 23, 3, 0, 0,
- 193, 118, 114, 171, 106, 102, 153, 93, 90, 132, 80, 78, 113, 67, 65, 94, 53, 52, 74, 37, 36, 50, 15, 16, 1, 0, 0,
- 194, 118, 99, 172, 105, 89, 153, 93, 78, 132, 80, 66, 113, 67, 54, 94, 53, 42, 74, 38, 27, 50, 16, 5, 1, 0, 0,
- 194, 118, 82, 173, 105, 72, 153, 93, 63, 132, 79, 53, 113, 67, 42, 94, 53, 30, 74, 38, 15, 49, 16, 0, 0, 0, 0,
- 195, 117, 63, 173, 105, 55, 154, 93, 47, 133, 79, 37, 113, 66, 27, 94, 53, 15, 73, 38, 0, 48, 16, 0, 0, 0, 0,
- 195, 117, 46, 173, 104, 39, 154, 92, 32, 133, 79, 22, 113, 66, 13, 94, 53, 0, 73, 38, 0, 48, 17, 0, 0, 0, 0,
- 189, 96, 166, 168, 85, 147, 150, 74, 132, 131, 62, 115, 113, 51, 99, 94, 38, 82, 74, 21, 63, 51, 0, 40, 1, 0, 0,
- 190, 96, 150, 170, 85, 133, 152, 75, 119, 132, 63, 104, 113, 51, 88, 94, 38, 72, 75, 22, 55, 51, 0, 33, 1, 0, 0,
- 192, 96, 137, 170, 85, 121, 152, 74, 108, 132, 64, 94, 113, 52, 79, 94, 39, 64, 74, 23, 48, 50, 0, 26, 0, 0, 0,
- 192, 96, 122, 171, 86, 109, 152, 75, 96, 132, 63, 83, 113, 52, 69, 94, 39, 56, 74, 24, 41, 50, 0, 19, 0, 0, 0,
- 193, 96, 107, 171, 85, 96, 152, 75, 84, 132, 64, 72, 113, 52, 60, 94, 39, 47, 74, 24, 32, 50, 1, 10, 0, 0, 0,
- 193, 96, 93, 172, 85, 82, 152, 75, 72, 133, 63, 61, 113, 51, 49, 94, 39, 37, 73, 25, 23, 49, 2, 2, 0, 0, 0,
- 194, 96, 78, 172, 85, 68, 152, 75, 59, 132, 63, 49, 113, 52, 39, 94, 40, 26, 73, 25, 11, 48, 3, 0, 0, 0, 0,
- 194, 96, 60, 173, 85, 52, 153, 75, 44, 132, 64, 35, 112, 52, 25, 94, 40, 12, 73, 26, 0, 48, 4, 0, 0, 0, 0,
- 195, 96, 46, 173, 85, 38, 154, 74, 31, 133, 63, 22, 113, 52, 11, 93, 40, 0, 73, 26, 0, 47, 5, 0, 0, 0, 0,
- 188, 67, 153, 168, 58, 137, 151, 49, 122, 131, 39, 106, 113, 28, 90, 94, 13, 75, 75, 0, 57, 51, 0, 35, 0, 0, 0,
- 190, 68, 138, 170, 59, 123, 152, 50, 110, 132, 41, 96, 113, 29, 80, 94, 16, 66, 75, 0, 49, 50, 0, 27, 0, 0, 0,
- 191, 69, 126, 170, 59, 112, 151, 52, 100, 132, 42, 86, 113, 30, 73, 95, 17, 58, 75, 0, 42, 50, 0, 21, 0, 0, 0,
- 192, 70, 113, 170, 61, 100, 151, 52, 89, 132, 42, 77, 113, 31, 64, 94, 19, 50, 74, 1, 35, 50, 0, 14, 0, 0, 0,
- 192, 70, 100, 170, 62, 89, 151, 53, 77, 131, 43, 66, 112, 32, 54, 94, 20, 42, 74, 2, 27, 49, 0, 5, 0, 0, 0,
- 192, 71, 87, 171, 61, 77, 152, 53, 67, 131, 44, 57, 112, 33, 45, 94, 21, 33, 74, 4, 19, 49, 0, 1, 0, 0, 0,
- 193, 71, 74, 171, 62, 64, 152, 53, 55, 132, 44, 45, 113, 34, 34, 94, 22, 23, 73, 5, 7, 48, 0, 0, 0, 0, 0,
- 193, 70, 58, 172, 62, 50, 152, 54, 42, 132, 44, 32, 112, 35, 22, 93, 23, 10, 73, 6, 0, 47, 0, 0, 0, 0, 0,
- 193, 70, 45, 172, 62, 38, 153, 54, 31, 132, 44, 21, 112, 35, 9, 94, 23, 0, 73, 7, 0, 47, 0, 0, 0, 0, 0,
- 189, 26, 141, 169, 15, 126, 150, 2, 112, 131, 0, 97, 113, 0, 82, 94, 0, 67, 75, 0, 51, 50, 0, 29, 0, 0, 0,
- 190, 28, 128, 170, 18, 114, 151, 8, 101, 132, 0, 88, 113, 0, 74, 94, 0, 60, 75, 0, 44, 50, 0, 23, 0, 0, 0,
- 191, 30, 117, 170, 23, 104, 152, 11, 92, 132, 1, 79, 113, 0, 67, 95, 0, 53, 75, 0, 37, 50, 0, 17, 0, 0, 0,
- 191, 33, 105, 170, 26, 93, 151, 18, 83, 132, 6, 70, 112, 0, 58, 94, 0, 45, 75, 0, 30, 49, 0, 8, 0, 0, 0,
- 191, 34, 93, 170, 27, 82, 151, 20, 72, 131, 8, 61, 112, 0, 49, 94, 0, 38, 74, 0, 23, 49, 0, 4, 0, 0, 0,
- 191, 36, 82, 170, 29, 71, 151, 22, 63, 131, 11, 52, 112, 0, 41, 93, 0, 29, 74, 0, 14, 48, 0, 1, 0, 0, 0,
- 191, 38, 69, 170, 31, 60, 151, 24, 51, 131, 14, 41, 112, 1, 31, 93, 0, 19, 73, 0, 3, 48, 0, 0, 0, 0, 0,
- 192, 37, 56, 171, 31, 47, 152, 25, 40, 131, 17, 30, 112, 4, 19, 93, 0, 7, 73, 0, 0, 47, 0, 0, 0, 0, 0,
- 192, 38, 45, 171, 33, 36, 152, 26, 30, 131, 18, 21, 111, 7, 9, 93, 0, 0, 73, 0, 0, 47, 0, 0, 0, 0, 0,
- 149, 218, 248, 133, 194, 222, 119, 173, 198, 102, 151, 173, 86, 130, 148, 70, 108, 125, 53, 85, 100, 32, 59, 71, 0, 22, 33,
- 154, 216, 223, 137, 193, 200, 122, 172, 178, 106, 150, 156, 89, 128, 133, 73, 107, 112, 54, 85, 89, 31, 59, 63, 0, 22, 26,
- 159, 215, 202, 141, 192, 181, 126, 171, 161, 108, 149, 141, 90, 128, 121, 74, 107, 100, 55, 85, 80, 32, 58, 55, 0, 22, 19,
- 161, 213, 179, 144, 190, 160, 126, 170, 143, 109, 148, 125, 92, 127, 107, 74, 106, 89, 56, 84, 69, 32, 58, 46, 0, 21, 11,
- 163, 211, 156, 144, 189, 139, 129, 168, 125, 110, 147, 108, 93, 126, 92, 75, 105, 76, 57, 83, 58, 33, 58, 37, 0, 21, 1,
- 167, 211, 133, 147, 188, 120, 130, 167, 105, 110, 145, 92, 93, 125, 78, 76, 104, 64, 58, 83, 48, 33, 57, 27, 0, 21, 0,
- 169, 210, 108, 149, 187, 96, 131, 166, 86, 112, 144, 74, 94, 124, 62, 77, 103, 49, 58, 82, 35, 33, 57, 15, 0, 21, 0,
- 170, 209, 80, 151, 186, 71, 133, 165, 62, 114, 143, 52, 95, 123, 42, 77, 103, 32, 58, 81, 18, 33, 56, 0, 0, 21, 0,
- 173, 208, 55, 152, 186, 49, 134, 165, 41, 114, 143, 34, 95, 122, 25, 77, 102, 14, 58, 81, 0, 33, 56, 0, 0, 21, 0,
- 154, 195, 232, 137, 174, 207, 122, 156, 185, 105, 136, 163, 89, 116, 140, 73, 97, 117, 56, 76, 94, 35, 51, 66, 0, 13, 28,
- 158, 194, 209, 141, 174, 187, 125, 155, 167, 109, 135, 146, 91, 116, 125, 75, 96, 105, 57, 75, 83, 35, 50, 57, 0, 12, 21,
- 161, 193, 189, 144, 173, 169, 128, 154, 151, 110, 134, 132, 93, 115, 113, 77, 95, 94, 58, 75, 74, 35, 50, 50, 0, 12, 13,
- 164, 192, 168, 145, 171, 151, 129, 153, 134, 111, 133, 117, 94, 114, 100, 76, 95, 82, 58, 75, 64, 36, 50, 42, 0, 12, 5,
- 165, 191, 147, 147, 170, 131, 130, 152, 117, 113, 132, 102, 95, 113, 86, 77, 94, 71, 58, 74, 54, 35, 50, 33, 0, 13, 0,
- 167, 189, 126, 148, 169, 113, 132, 151, 100, 113, 131, 86, 96, 112, 73, 77, 93, 59, 59, 73, 43, 35, 49, 23, 0, 12, 0,
- 170, 189, 104, 150, 168, 91, 133, 150, 81, 114, 130, 69, 96, 111, 57, 78, 92, 46, 59, 73, 31, 35, 49, 11, 0, 13, 0,
- 171, 188, 78, 152, 168, 68, 134, 149, 60, 115, 130, 50, 96, 111, 41, 78, 92, 29, 60, 73, 15, 35, 49, 0, 0, 12, 0,
- 173, 187, 55, 153, 167, 47, 134, 149, 39, 115, 129, 33, 97, 110, 24, 79, 92, 13, 60, 72, 0, 35, 48, 0, 0, 12, 0,
- 157, 175, 217, 139, 157, 196, 125, 141, 175, 109, 122, 153, 92, 104, 132, 76, 86, 110, 59, 67, 88, 37, 43, 61, 1, 1, 23,
- 161, 174, 196, 144, 156, 176, 127, 140, 158, 110, 121, 137, 94, 104, 118, 77, 85, 98, 59, 67, 78, 37, 43, 53, 0, 2, 16,
- 163, 174, 178, 146, 156, 160, 130, 139, 143, 112, 121, 124, 95, 103, 106, 78, 85, 88, 60, 66, 69, 37, 42, 46, 0, 2, 7,
- 166, 173, 159, 147, 154, 142, 130, 138, 127, 113, 120, 111, 96, 103, 95, 78, 84, 77, 60, 66, 59, 37, 43, 37, 0, 2, 0,
- 166, 172, 139, 148, 154, 125, 131, 137, 112, 113, 120, 96, 96, 102, 81, 78, 84, 66, 60, 65, 50, 37, 42, 29, 0, 3, 0,
- 167, 171, 120, 149, 153, 107, 133, 137, 95, 114, 118, 81, 97, 101, 69, 79, 84, 56, 60, 65, 40, 37, 42, 19, 0, 3, 0,
- 170, 170, 99, 151, 152, 87, 134, 136, 77, 115, 118, 66, 97, 101, 55, 79, 83, 42, 61, 65, 28, 37, 42, 7, 0, 3, 0,
- 172, 170, 75, 152, 151, 65, 134, 135, 57, 115, 117, 48, 97, 100, 38, 79, 83, 27, 61, 64, 12, 36, 42, 0, 0, 3, 0,
- 172, 169, 55, 154, 151, 46, 135, 134, 40, 116, 116, 32, 97, 99, 21, 80, 82, 10, 61, 64, 0, 36, 41, 0, 0, 3, 0,
- 160, 154, 203, 143, 139, 182, 127, 124, 164, 111, 107, 143, 95, 91, 122, 78, 75, 103, 60, 57, 81, 39, 33, 56, 1, 0, 18,
- 163, 154, 184, 146, 138, 165, 130, 123, 148, 113, 107, 129, 96, 90, 110, 79, 74, 92, 61, 56, 72, 39, 34, 48, 2, 0, 9,
- 165, 154, 167, 147, 137, 149, 131, 122, 134, 114, 106, 117, 96, 90, 100, 79, 74, 82, 61, 56, 64, 39, 33, 40, 2, 0, 1,
- 166, 153, 150, 149, 137, 133, 132, 122, 119, 114, 106, 104, 97, 90, 88, 79, 74, 72, 61, 56, 55, 39, 34, 33, 0, 0, 0,
- 168, 152, 132, 149, 136, 117, 132, 121, 104, 114, 105, 90, 97, 89, 76, 79, 73, 62, 61, 56, 46, 38, 34, 25, 0, 0, 0,
- 169, 151, 114, 150, 135, 101, 133, 121, 90, 114, 104, 77, 97, 89, 65, 80, 73, 51, 61, 56, 36, 38, 34, 16, 0, 0, 0,
- 170, 150, 94, 151, 135, 83, 134, 120, 73, 115, 104, 62, 98, 88, 51, 80, 72, 39, 61, 56, 24, 38, 34, 3, 0, 0, 0,
- 172, 150, 72, 153, 134, 63, 135, 119, 55, 115, 103, 45, 98, 88, 36, 80, 72, 24, 61, 55, 9, 38, 34, 0, 0, 0, 0,
- 172, 150, 54, 153, 134, 47, 135, 119, 38, 116, 103, 30, 98, 87, 21, 80, 72, 8, 62, 55, 0, 37, 34, 0, 0, 0, 0,
- 162, 134, 190, 145, 120, 171, 129, 108, 153, 113, 93, 134, 97, 78, 115, 80, 63, 96, 62, 46, 75, 41, 23, 51, 0, 0, 11,
- 165, 134, 173, 147, 120, 154, 131, 107, 138, 114, 92, 120, 97, 78, 103, 80, 63, 85, 62, 46, 66, 40, 23, 43, 0, 0, 2,
- 166, 134, 157, 148, 120, 140, 132, 106, 125, 114, 92, 109, 97, 77, 93, 81, 63, 77, 62, 46, 58, 40, 24, 36, 0, 0, 0,
- 168, 133, 140, 149, 119, 125, 132, 106, 112, 115, 92, 97, 98, 77, 82, 81, 62, 67, 62, 46, 50, 40, 24, 29, 0, 0, 0,
- 168, 133, 123, 150, 119, 110, 133, 106, 97, 115, 91, 84, 98, 77, 70, 81, 62, 57, 62, 46, 41, 40, 24, 20, 0, 0, 0,
- 169, 132, 107, 150, 118, 94, 133, 105, 84, 115, 91, 72, 98, 76, 60, 80, 62, 47, 62, 46, 32, 39, 25, 11, 0, 0, 0,
- 171, 132, 89, 152, 118, 79, 135, 105, 69, 115, 90, 58, 98, 76, 47, 80, 62, 36, 62, 46, 21, 39, 25, 0, 0, 0, 0,
- 171, 132, 69, 153, 117, 60, 135, 104, 52, 116, 90, 42, 98, 76, 33, 81, 61, 21, 62, 46, 6, 38, 25, 0, 0, 0, 0,
- 172, 132, 54, 153, 118, 45, 135, 104, 38, 116, 90, 28, 98, 76, 18, 81, 61, 6, 62, 46, 0, 38, 25, 0, 0, 0, 0,
- 164, 115, 177, 146, 103, 159, 130, 91, 143, 114, 78, 125, 97, 65, 107, 81, 51, 89, 63, 34, 69, 41, 9, 46, 0, 0, 4,
- 166, 115, 161, 148, 103, 144, 132, 91, 129, 115, 78, 112, 98, 65, 96, 81, 51, 79, 63, 35, 61, 41, 11, 38, 0, 0, 0,
- 167, 115, 146, 150, 102, 131, 132, 91, 117, 115, 78, 101, 98, 65, 86, 81, 51, 71, 63, 35, 54, 41, 12, 32, 0, 0, 0,
- 168, 114, 132, 150, 103, 118, 133, 91, 105, 116, 78, 91, 98, 64, 76, 82, 51, 61, 63, 36, 46, 41, 13, 24, 0, 0, 0,
- 169, 114, 116, 150, 102, 103, 134, 90, 91, 116, 78, 79, 98, 65, 66, 81, 51, 53, 63, 36, 37, 40, 14, 17, 0, 0, 0,
- 169, 114, 101, 151, 101, 89, 134, 90, 79, 116, 77, 67, 98, 64, 56, 81, 51, 44, 63, 36, 29, 40, 15, 7, 0, 0, 0,
- 170, 114, 85, 152, 101, 75, 135, 90, 65, 116, 77, 54, 98, 64, 44, 81, 51, 32, 63, 36, 17, 39, 15, 0, 0, 0, 0,
- 172, 113, 66, 152, 101, 58, 135, 89, 49, 116, 77, 40, 99, 64, 30, 81, 51, 18, 62, 36, 3, 38, 16, 0, 0, 0, 0,
- 171, 113, 51, 153, 101, 44, 136, 89, 36, 116, 77, 28, 99, 64, 18, 81, 51, 5, 62, 36, 0, 38, 16, 0, 0, 0, 0,
- 165, 94, 166, 147, 82, 147, 132, 72, 132, 115, 61, 115, 98, 49, 99, 82, 36, 82, 64, 19, 64, 42, 0, 41, 0, 0, 0,
- 167, 93, 150, 150, 83, 134, 133, 73, 120, 116, 62, 104, 99, 49, 88, 82, 36, 72, 64, 20, 55, 41, 0, 33, 0, 0, 0,
- 169, 93, 137, 150, 83, 122, 134, 73, 109, 116, 61, 94, 99, 50, 80, 82, 37, 65, 64, 21, 49, 41, 0, 27, 0, 0, 0,
- 169, 94, 123, 150, 83, 110, 133, 73, 97, 116, 61, 83, 99, 50, 70, 82, 38, 57, 63, 23, 42, 41, 0, 20, 0, 0, 0,
- 169, 94, 109, 150, 84, 97, 134, 73, 85, 116, 62, 73, 99, 51, 61, 81, 38, 48, 63, 23, 33, 41, 1, 11, 0, 0, 0,
- 170, 94, 96, 150, 83, 84, 134, 73, 74, 116, 61, 62, 99, 50, 51, 82, 38, 39, 64, 23, 24, 40, 3, 4, 0, 0, 0,
- 171, 93, 79, 152, 82, 70, 135, 73, 61, 116, 62, 51, 98, 51, 40, 81, 38, 28, 63, 24, 14, 39, 4, 0, 0, 0, 0,
- 171, 94, 64, 152, 83, 55, 135, 73, 47, 116, 62, 37, 98, 50, 27, 81, 38, 15, 63, 24, 1, 39, 4, 0, 0, 0, 0,
- 172, 93, 51, 153, 82, 42, 135, 73, 35, 117, 62, 26, 99, 51, 16, 81, 39, 3, 63, 25, 0, 38, 5, 0, 0, 0, 0,
- 166, 68, 153, 148, 59, 137, 133, 49, 121, 115, 39, 106, 99, 28, 91, 82, 13, 75, 65, 0, 58, 42, 0, 36, 0, 0, 0,
- 168, 68, 139, 150, 59, 124, 134, 50, 110, 116, 40, 96, 99, 30, 81, 82, 16, 66, 64, 0, 50, 41, 0, 29, 0, 0, 0,
- 169, 69, 126, 150, 59, 113, 134, 51, 101, 117, 42, 87, 100, 30, 73, 82, 17, 59, 65, 0, 43, 41, 0, 23, 0, 0, 0,
- 169, 70, 115, 150, 61, 102, 134, 52, 89, 116, 42, 77, 99, 32, 65, 82, 19, 52, 64, 0, 36, 41, 0, 15, 0, 0, 0,
- 169, 70, 101, 150, 61, 90, 134, 52, 79, 116, 43, 68, 99, 32, 55, 82, 21, 43, 64, 2, 28, 41, 0, 6, 0, 0, 0,
- 170, 70, 89, 151, 62, 79, 134, 53, 69, 116, 44, 58, 99, 33, 46, 81, 21, 34, 64, 3, 20, 41, 0, 2, 0, 0, 0,
- 170, 71, 76, 152, 62, 66, 134, 53, 57, 116, 43, 46, 99, 33, 36, 82, 22, 24, 64, 5, 10, 40, 0, 0, 0, 0, 0,
- 171, 70, 61, 152, 62, 52, 135, 53, 44, 116, 44, 35, 99, 34, 24, 82, 22, 12, 63, 6, 0, 39, 0, 0, 0, 0, 0,
- 171, 71, 49, 153, 62, 41, 135, 54, 33, 117, 45, 25, 98, 34, 13, 81, 23, 0, 63, 7, 0, 39, 0, 0, 0, 0, 0,
- 167, 33, 142, 149, 24, 127, 134, 10, 113, 116, 0, 97, 100, 0, 83, 83, 0, 68, 65, 0, 52, 40, 0, 30, 0, 0, 0,
- 169, 33, 129, 150, 26, 115, 134, 17, 102, 116, 3, 89, 100, 0, 75, 83, 0, 60, 65, 0, 45, 40, 0, 24, 0, 0, 0,
- 169, 36, 118, 151, 27, 104, 134, 19, 93, 116, 7, 80, 100, 0, 67, 83, 0, 54, 65, 0, 38, 41, 0, 17, 0, 0, 0,
- 169, 39, 107, 150, 30, 94, 134, 22, 84, 116, 11, 71, 99, 0, 59, 83, 0, 46, 64, 0, 31, 40, 0, 9, 0, 0, 0,
- 169, 39, 95, 151, 31, 83, 134, 24, 73, 116, 15, 62, 100, 1, 51, 83, 0, 38, 64, 0, 24, 40, 0, 5, 0, 0, 0,
- 169, 41, 83, 151, 33, 73, 134, 26, 64, 117, 17, 54, 99, 4, 42, 82, 0, 30, 64, 0, 16, 40, 0, 1, 0, 0, 0,
- 170, 42, 71, 152, 34, 62, 134, 28, 53, 117, 19, 44, 99, 6, 33, 82, 0, 21, 63, 0, 4, 39, 0, 0, 0, 0, 0,
- 171, 42, 59, 152, 35, 50, 134, 29, 42, 117, 21, 32, 99, 9, 22, 82, 0, 9, 63, 0, 0, 38, 0, 0, 0, 0, 0,
- 172, 42, 48, 152, 36, 40, 135, 29, 32, 117, 21, 23, 99, 10, 12, 82, 0, 0, 63, 0, 0, 38, 0, 0, 0, 0, 0,
- 107, 207, 246, 96, 185, 220, 86, 165, 196, 73, 144, 171, 60, 123, 147, 46, 103, 125, 32, 82, 100, 9, 56, 71, 0, 20, 33,
- 115, 206, 221, 104, 184, 198, 92, 164, 178, 78, 143, 154, 64, 123, 133, 51, 102, 111, 34, 81, 89, 10, 56, 63, 0, 20, 27,
- 122, 204, 200, 108, 183, 180, 95, 163, 161, 82, 142, 140, 68, 122, 120, 54, 102, 101, 36, 81, 79, 11, 56, 55, 0, 20, 20,
- 125, 203, 179, 111, 181, 160, 97, 162, 143, 85, 141, 124, 70, 121, 107, 55, 101, 89, 38, 80, 69, 14, 55, 46, 0, 19, 10,
- 128, 202, 156, 113, 180, 140, 102, 161, 125, 87, 140, 108, 71, 120, 92, 56, 100, 76, 39, 79, 59, 14, 55, 38, 0, 20, 3,
- 132, 200, 135, 117, 179, 121, 103, 159, 106, 88, 139, 93, 73, 119, 79, 57, 100, 65, 41, 79, 49, 15, 54, 28, 0, 19, 0,
- 134, 200, 111, 119, 178, 98, 105, 158, 87, 89, 138, 76, 74, 118, 64, 58, 99, 51, 41, 78, 37, 16, 54, 17, 0, 19, 0,
- 137, 199, 85, 122, 177, 75, 108, 158, 66, 91, 137, 56, 75, 118, 46, 59, 98, 35, 42, 78, 22, 16, 54, 3, 0, 19, 0,
- 140, 198, 62, 125, 177, 55, 109, 158, 47, 92, 137, 40, 76, 117, 32, 59, 98, 21, 42, 78, 6, 16, 54, 0, 0, 18, 0,
- 118, 186, 231, 106, 167, 206, 93, 149, 184, 81, 130, 161, 67, 111, 139, 54, 92, 117, 39, 72, 93, 17, 48, 66, 0, 10, 29,
- 123, 185, 207, 110, 166, 186, 98, 148, 167, 85, 129, 145, 71, 111, 125, 56, 92, 104, 40, 72, 83, 18, 48, 57, 0, 10, 22,
- 128, 184, 188, 113, 165, 168, 102, 147, 151, 88, 128, 131, 73, 110, 113, 58, 91, 94, 42, 71, 74, 19, 48, 50, 0, 9, 15,
- 131, 183, 168, 116, 164, 151, 104, 146, 134, 89, 127, 117, 73, 109, 100, 58, 90, 83, 42, 71, 65, 20, 48, 42, 0, 9, 5,
- 134, 182, 148, 120, 163, 131, 105, 145, 118, 90, 126, 102, 75, 108, 86, 59, 90, 72, 43, 71, 55, 19, 47, 34, 0, 9, 0,
- 136, 181, 128, 122, 162, 115, 107, 144, 102, 92, 125, 87, 76, 107, 74, 61, 89, 60, 44, 70, 45, 20, 47, 24, 0, 8, 0,
- 139, 180, 106, 124, 161, 95, 109, 144, 83, 93, 124, 71, 77, 107, 60, 61, 89, 47, 44, 70, 33, 20, 47, 13, 0, 8, 0,
- 142, 179, 82, 125, 160, 72, 111, 143, 63, 94, 124, 54, 77, 106, 44, 61, 88, 32, 44, 69, 18, 20, 46, 0, 0, 8, 0,
- 143, 179, 62, 127, 160, 54, 111, 142, 47, 94, 124, 39, 78, 106, 29, 62, 88, 18, 45, 69, 3, 20, 46, 0, 0, 8, 0,
- 124, 167, 216, 112, 150, 194, 99, 134, 174, 87, 117, 153, 73, 100, 131, 58, 82, 110, 43, 64, 88, 23, 40, 61, 0, 0, 24,
- 129, 166, 195, 116, 150, 175, 103, 134, 158, 89, 116, 137, 75, 99, 118, 60, 82, 98, 44, 63, 78, 23, 40, 53, 0, 0, 17,
- 132, 166, 177, 119, 149, 160, 106, 133, 143, 90, 115, 124, 76, 99, 107, 61, 81, 88, 45, 63, 69, 24, 40, 46, 0, 0, 9,
- 136, 166, 159, 121, 148, 143, 107, 132, 126, 92, 115, 111, 77, 98, 94, 62, 81, 78, 46, 63, 60, 23, 40, 38, 0, 0, 0,
- 138, 164, 140, 122, 147, 125, 108, 131, 111, 93, 114, 97, 79, 98, 82, 63, 80, 67, 46, 62, 50, 24, 40, 29, 0, 0, 0,
- 139, 163, 122, 124, 146, 109, 110, 131, 96, 94, 114, 83, 79, 97, 70, 63, 81, 57, 46, 62, 41, 24, 40, 21, 0, 0, 0,
- 141, 163, 101, 126, 145, 90, 111, 130, 79, 95, 113, 68, 79, 96, 56, 63, 80, 44, 47, 62, 30, 23, 40, 10, 0, 0, 0,
- 144, 162, 79, 127, 145, 70, 112, 129, 60, 95, 112, 51, 79, 96, 41, 64, 79, 30, 47, 61, 15, 23, 40, 0, 0, 0, 0,
- 145, 162, 60, 129, 145, 52, 113, 129, 46, 96, 112, 37, 79, 95, 27, 64, 79, 16, 47, 61, 1, 23, 39, 0, 0, 0, 0,
- 131, 147, 202, 117, 133, 181, 105, 119, 162, 91, 103, 142, 77, 87, 122, 62, 71, 102, 47, 54, 81, 26, 31, 56, 0, 0, 18,
- 135, 147, 183, 120, 132, 164, 107, 118, 147, 93, 102, 128, 78, 87, 110, 63, 71, 92, 47, 54, 72, 26, 31, 48, 0, 0, 10,
- 138, 147, 166, 123, 131, 149, 108, 118, 133, 94, 102, 116, 79, 86, 100, 64, 71, 82, 48, 54, 64, 27, 31, 41, 0, 0, 2,
- 139, 146, 149, 124, 131, 134, 111, 117, 119, 94, 101, 103, 79, 86, 88, 64, 70, 72, 48, 53, 55, 27, 31, 33, 0, 0, 0,
- 141, 146, 132, 125, 131, 117, 111, 117, 104, 95, 101, 91, 80, 86, 77, 65, 70, 62, 48, 53, 46, 26, 31, 25, 0, 0, 0,
- 143, 145, 115, 126, 130, 101, 112, 116, 90, 96, 100, 78, 80, 85, 65, 65, 70, 52, 49, 53, 37, 27, 32, 17, 0, 0, 0,
- 144, 144, 96, 128, 129, 85, 112, 115, 75, 97, 100, 64, 81, 85, 52, 65, 69, 40, 49, 53, 26, 26, 31, 5, 0, 0, 0,
- 146, 144, 76, 129, 129, 67, 114, 115, 58, 97, 99, 48, 82, 84, 38, 66, 69, 27, 49, 53, 12, 26, 32, 0, 0, 0, 0,
- 146, 144, 59, 130, 128, 51, 114, 114, 43, 98, 99, 35, 82, 84, 25, 66, 69, 13, 49, 53, 0, 26, 32, 0, 0, 0, 0,
- 135, 129, 189, 122, 115, 170, 107, 103, 152, 94, 89, 133, 79, 74, 114, 64, 60, 95, 49, 43, 75, 29, 20, 51, 0, 0, 12,
- 138, 129, 171, 124, 115, 153, 110, 103, 138, 95, 89, 120, 81, 74, 103, 66, 60, 86, 50, 44, 67, 28, 21, 43, 0, 0, 3,
- 140, 129, 156, 125, 115, 140, 111, 103, 125, 96, 89, 109, 81, 74, 93, 67, 60, 76, 50, 44, 59, 29, 22, 36, 0, 0, 0,
- 142, 128, 140, 127, 115, 125, 112, 102, 112, 97, 88, 97, 82, 74, 83, 67, 60, 67, 50, 44, 51, 29, 22, 29, 0, 0, 0,
- 142, 128, 124, 127, 114, 111, 113, 102, 98, 98, 88, 85, 82, 74, 71, 66, 60, 58, 50, 44, 42, 29, 22, 21, 0, 0, 0,
- 144, 127, 108, 128, 114, 96, 113, 101, 85, 98, 87, 73, 82, 74, 61, 67, 60, 48, 50, 44, 33, 28, 23, 12, 0, 0, 0,
- 145, 127, 91, 129, 114, 81, 115, 101, 71, 98, 87, 60, 82, 73, 48, 67, 59, 37, 50, 44, 22, 29, 23, 1, 0, 0, 0,
- 147, 127, 73, 130, 113, 63, 115, 101, 55, 98, 87, 45, 83, 73, 35, 67, 59, 24, 50, 44, 10, 28, 24, 0, 0, 0, 0,
- 147, 127, 58, 131, 113, 49, 115, 100, 42, 99, 86, 33, 83, 73, 23, 67, 59, 10, 50, 44, 0, 27, 24, 0, 0, 0, 0,
- 138, 110, 177, 124, 99, 159, 110, 88, 142, 96, 75, 125, 82, 62, 107, 66, 48, 89, 51, 33, 70, 30, 8, 46, 0, 0, 5,
- 142, 111, 160, 127, 99, 144, 113, 88, 130, 98, 75, 112, 82, 62, 96, 68, 49, 80, 51, 33, 61, 30, 10, 39, 0, 0, 0,
- 143, 111, 146, 128, 99, 131, 114, 88, 118, 98, 75, 101, 83, 62, 86, 68, 49, 71, 52, 33, 54, 30, 11, 32, 0, 0, 0,
- 144, 111, 132, 128, 99, 118, 113, 88, 106, 99, 75, 91, 83, 62, 77, 68, 49, 62, 52, 34, 46, 30, 12, 25, 0, 0, 0,
- 144, 111, 117, 129, 98, 104, 114, 87, 92, 99, 75, 80, 83, 62, 67, 68, 49, 53, 51, 34, 38, 30, 13, 18, 0, 0, 0,
- 145, 111, 103, 130, 98, 91, 114, 87, 80, 99, 75, 68, 83, 63, 57, 68, 50, 45, 51, 34, 30, 30, 14, 8, 0, 0, 0,
- 146, 110, 87, 131, 98, 76, 115, 87, 67, 99, 75, 56, 83, 62, 45, 68, 49, 33, 52, 35, 19, 30, 15, 2, 0, 0, 0,
- 148, 110, 70, 131, 98, 60, 116, 86, 52, 99, 74, 43, 84, 62, 33, 69, 49, 21, 52, 35, 6, 29, 15, 0, 0, 0, 0,
- 148, 110, 56, 132, 97, 48, 117, 87, 40, 100, 75, 31, 84, 62, 22, 68, 49, 9, 51, 35, 0, 28, 15, 0, 0, 0, 0,
- 142, 91, 166, 126, 80, 148, 113, 71, 132, 98, 59, 115, 83, 47, 99, 69, 34, 82, 53, 17, 64, 32, 0, 41, 0, 0, 0,
- 143, 91, 150, 128, 81, 135, 114, 71, 120, 99, 60, 104, 85, 48, 89, 69, 35, 73, 53, 19, 56, 32, 0, 34, 0, 0, 0,
- 145, 91, 137, 129, 81, 122, 115, 71, 109, 100, 60, 94, 85, 48, 81, 69, 35, 65, 53, 19, 49, 32, 0, 28, 0, 0, 0,
- 146, 92, 124, 130, 81, 110, 115, 71, 98, 100, 60, 84, 85, 49, 71, 69, 36, 57, 53, 21, 42, 32, 0, 21, 0, 0, 0,
- 147, 91, 110, 130, 81, 97, 115, 71, 86, 100, 60, 74, 84, 49, 62, 69, 36, 48, 53, 22, 34, 32, 0, 13, 0, 0, 0,
- 147, 92, 97, 130, 81, 85, 116, 72, 76, 100, 60, 63, 85, 49, 52, 69, 37, 40, 53, 22, 26, 31, 1, 5, 0, 0, 0,
- 148, 92, 82, 131, 81, 71, 116, 71, 62, 100, 60, 53, 84, 49, 42, 69, 37, 30, 52, 23, 16, 31, 2, 0, 0, 0, 0,
- 148, 91, 67, 132, 81, 57, 117, 71, 49, 100, 60, 39, 84, 49, 30, 69, 37, 18, 52, 23, 2, 30, 2, 0, 0, 0, 0,
- 149, 91, 54, 132, 81, 46, 118, 71, 39, 101, 60, 29, 85, 49, 19, 69, 37, 6, 52, 23, 0, 29, 3, 0, 0, 0, 0,
- 143, 68, 153, 128, 59, 137, 115, 49, 122, 99, 39, 107, 85, 28, 91, 70, 13, 75, 54, 0, 58, 32, 0, 36, 0, 0, 0,
- 146, 68, 140, 131, 59, 125, 116, 51, 111, 100, 40, 97, 85, 29, 82, 70, 15, 67, 54, 0, 50, 32, 0, 29, 0, 0, 0,
- 147, 68, 127, 131, 59, 114, 117, 51, 102, 101, 41, 88, 86, 30, 74, 70, 17, 60, 54, 0, 44, 32, 0, 23, 0, 0, 0,
- 147, 70, 115, 131, 60, 103, 116, 52, 91, 100, 42, 78, 85, 32, 65, 70, 19, 53, 54, 1, 38, 32, 0, 17, 0, 0, 0,
- 147, 70, 103, 131, 61, 91, 117, 53, 81, 101, 43, 69, 86, 32, 57, 70, 20, 44, 54, 2, 30, 32, 0, 7, 0, 0, 0,
- 148, 70, 91, 132, 61, 80, 117, 52, 70, 101, 43, 59, 85, 33, 48, 70, 21, 36, 53, 4, 22, 32, 0, 3, 0, 0, 0,
- 148, 70, 78, 132, 62, 68, 117, 53, 58, 101, 43, 48, 85, 34, 38, 70, 22, 26, 53, 6, 12, 31, 0, 0, 0, 0, 0,
- 149, 71, 64, 132, 62, 54, 118, 54, 46, 101, 44, 37, 85, 34, 27, 69, 23, 15, 53, 7, 1, 30, 0, 0, 0, 0, 0,
- 150, 70, 53, 134, 61, 44, 118, 54, 36, 101, 44, 28, 85, 35, 17, 69, 23, 4, 52, 8, 0, 30, 0, 0, 0, 0, 0,
- 145, 38, 143, 130, 29, 128, 117, 18, 114, 101, 3, 98, 87, 0, 84, 72, 0, 69, 54, 0, 53, 30, 0, 31, 0, 0, 0,
- 147, 38, 130, 132, 30, 116, 117, 22, 103, 101, 8, 89, 87, 0, 76, 72, 0, 62, 54, 0, 46, 30, 0, 24, 0, 0, 0,
- 148, 40, 119, 132, 31, 105, 117, 23, 94, 101, 13, 81, 87, 0, 68, 71, 0, 55, 54, 0, 39, 30, 0, 18, 0, 0, 0,
- 148, 42, 108, 132, 34, 96, 117, 25, 85, 102, 15, 73, 86, 2, 60, 71, 0, 47, 54, 0, 33, 30, 0, 11, 0, 0, 0,
- 148, 43, 96, 133, 35, 85, 117, 28, 75, 102, 18, 64, 87, 5, 52, 71, 0, 40, 54, 0, 25, 30, 0, 5, 0, 0, 0,
- 149, 44, 85, 132, 36, 75, 118, 29, 66, 101, 20, 55, 86, 8, 44, 70, 0, 32, 53, 0, 18, 29, 0, 2, 0, 0, 0,
- 149, 45, 74, 133, 37, 64, 118, 31, 55, 102, 21, 45, 85, 10, 34, 70, 0, 22, 53, 0, 6, 28, 0, 0, 0, 0, 0,
- 150, 46, 61, 133, 39, 52, 118, 31, 44, 102, 23, 34, 85, 12, 24, 70, 0, 12, 52, 0, 0, 28, 0, 0, 0, 0, 0,
- 150, 46, 51, 133, 40, 42, 119, 32, 35, 102, 24, 25, 85, 13, 14, 70, 0, 1, 52, 0, 0, 27, 0, 0, 0, 0, 0,
- 53, 198, 244, 49, 177, 218, 41, 158, 195, 32, 138, 171, 22, 118, 147, 11, 98, 124, 0, 78, 100, 0, 54, 71, 0, 18, 34,
- 69, 196, 220, 64, 175, 196, 54, 157, 176, 45, 137, 154, 32, 117, 133, 19, 98, 111, 0, 78, 89, 0, 53, 63, 0, 17, 27,
- 80, 195, 198, 69, 175, 179, 60, 156, 159, 50, 136, 139, 38, 116, 120, 25, 98, 101, 4, 77, 80, 0, 53, 55, 0, 17, 21,
- 84, 193, 177, 75, 173, 159, 64, 155, 142, 55, 135, 124, 41, 116, 107, 27, 97, 89, 9, 76, 70, 0, 53, 47, 0, 17, 11,
- 89, 193, 157, 79, 172, 140, 70, 154, 125, 57, 134, 109, 44, 115, 92, 32, 96, 76, 13, 76, 59, 0, 52, 39, 0, 16, 4,
- 94, 191, 135, 85, 171, 121, 72, 152, 108, 60, 133, 94, 47, 114, 80, 32, 95, 65, 15, 76, 49, 0, 52, 29, 0, 16, 0,
- 98, 190, 113, 87, 170, 100, 76, 152, 89, 62, 132, 77, 49, 113, 65, 35, 95, 52, 18, 75, 37, 0, 52, 18, 0, 15, 0,
- 103, 190, 89, 90, 169, 80, 78, 151, 70, 64, 132, 60, 51, 113, 49, 37, 94, 38, 20, 75, 25, 0, 52, 5, 0, 15, 0,
- 106, 189, 69, 93, 169, 61, 80, 151, 53, 66, 131, 45, 52, 113, 36, 37, 94, 25, 19, 74, 11, 0, 51, 0, 0, 15, 0,
- 76, 178, 229, 68, 159, 205, 61, 142, 183, 50, 124, 160, 40, 106, 138, 28, 88, 116, 12, 69, 93, 0, 45, 66, 0, 5, 29,
- 86, 177, 207, 78, 158, 184, 67, 142, 166, 56, 123, 145, 45, 106, 125, 31, 88, 105, 16, 69, 83, 0, 45, 58, 0, 6, 22,
- 93, 176, 187, 81, 158, 168, 71, 141, 150, 61, 123, 131, 47, 105, 113, 35, 87, 94, 20, 68, 74, 0, 45, 51, 0, 5, 16,
- 98, 175, 168, 84, 157, 150, 75, 140, 134, 63, 122, 117, 50, 104, 100, 37, 87, 83, 21, 68, 65, 0, 45, 42, 0, 4, 7,
- 100, 174, 149, 89, 155, 132, 76, 139, 117, 65, 121, 102, 53, 104, 87, 39, 86, 72, 23, 67, 55, 0, 45, 34, 0, 3, 0,
- 103, 173, 130, 92, 155, 115, 80, 138, 102, 68, 120, 88, 53, 103, 75, 40, 86, 61, 24, 67, 45, 0, 45, 25, 0, 3, 0,
- 107, 172, 108, 95, 154, 96, 82, 137, 85, 70, 119, 73, 55, 102, 61, 42, 85, 49, 25, 67, 34, 0, 45, 14, 0, 3, 0,
- 110, 172, 86, 97, 153, 76, 85, 137, 67, 70, 119, 57, 56, 102, 46, 42, 84, 35, 26, 66, 21, 0, 44, 1, 0, 3, 0,
- 112, 171, 67, 98, 153, 59, 86, 137, 52, 71, 119, 44, 58, 102, 34, 44, 85, 22, 27, 66, 7, 0, 44, 0, 0, 3, 0,
- 90, 160, 215, 81, 144, 193, 70, 129, 173, 61, 112, 151, 49, 95, 131, 37, 79, 109, 22, 61, 87, 0, 38, 61, 0, 0, 25,
- 96, 160, 194, 86, 143, 174, 75, 128, 157, 65, 112, 137, 53, 95, 117, 40, 78, 98, 25, 60, 78, 0, 38, 53, 0, 0, 17,
- 100, 159, 177, 89, 143, 159, 79, 128, 143, 67, 111, 124, 55, 95, 107, 42, 78, 89, 27, 60, 70, 2, 38, 46, 0, 0, 9,
- 104, 158, 159, 92, 142, 143, 81, 127, 127, 69, 110, 110, 56, 94, 94, 43, 78, 78, 28, 60, 60, 2, 38, 38, 0, 0, 1,
- 107, 157, 140, 94, 141, 125, 82, 126, 112, 71, 110, 97, 59, 94, 82, 45, 77, 67, 29, 59, 51, 4, 37, 30, 0, 0, 0,
- 110, 156, 122, 97, 140, 109, 85, 125, 97, 72, 109, 83, 58, 93, 71, 45, 77, 57, 29, 60, 42, 5, 38, 22, 0, 0, 0,
- 111, 156, 103, 99, 139, 91, 87, 125, 81, 73, 108, 69, 60, 92, 58, 46, 77, 45, 30, 59, 31, 5, 38, 12, 0, 0, 0,
- 115, 156, 82, 101, 140, 73, 88, 124, 63, 74, 108, 53, 60, 92, 44, 46, 76, 32, 31, 59, 18, 6, 37, 0, 0, 0, 0,
- 116, 155, 65, 102, 139, 58, 89, 124, 49, 75, 108, 41, 61, 92, 32, 48, 76, 21, 31, 59, 6, 5, 37, 0, 0, 0, 0,
- 100, 141, 201, 88, 127, 181, 79, 114, 162, 69, 99, 142, 57, 83, 122, 44, 68, 102, 30, 51, 81, 7, 28, 56, 0, 0, 19,
- 105, 141, 182, 94, 127, 163, 83, 114, 146, 71, 98, 128, 59, 83, 110, 46, 68, 91, 31, 51, 72, 10, 28, 48, 0, 0, 11,
- 108, 141, 166, 96, 127, 149, 85, 113, 133, 73, 98, 116, 60, 83, 99, 46, 68, 82, 32, 51, 64, 11, 29, 41, 0, 0, 2,
- 111, 141, 149, 98, 126, 134, 88, 112, 119, 74, 97, 103, 61, 83, 88, 48, 67, 72, 33, 51, 56, 11, 29, 34, 0, 0, 0,
- 112, 140, 132, 100, 125, 118, 89, 112, 105, 75, 97, 91, 62, 82, 77, 49, 68, 62, 33, 51, 47, 12, 29, 26, 0, 0, 0,
- 115, 140, 116, 102, 125, 103, 90, 111, 91, 76, 96, 78, 62, 82, 65, 49, 67, 52, 34, 51, 38, 13, 29, 18, 0, 0, 0,
- 117, 139, 97, 103, 124, 87, 91, 111, 77, 78, 96, 65, 63, 81, 54, 49, 67, 41, 34, 51, 27, 12, 29, 7, 0, 0, 0,
- 119, 138, 78, 105, 124, 69, 92, 110, 60, 78, 95, 50, 65, 81, 40, 50, 67, 29, 34, 51, 15, 13, 30, 0, 0, 0, 0,
- 120, 138, 64, 106, 124, 54, 93, 110, 47, 78, 95, 38, 65, 81, 29, 50, 66, 17, 34, 50, 2, 13, 29, 0, 0, 0, 0,
- 107, 124, 189, 96, 111, 169, 85, 99, 152, 73, 85, 132, 61, 71, 114, 48, 57, 95, 34, 41, 75, 14, 18, 51, 0, 0, 13,
- 111, 124, 171, 100, 111, 153, 88, 99, 137, 75, 85, 120, 63, 72, 103, 50, 58, 85, 36, 41, 66, 15, 19, 43, 0, 0, 4,
- 113, 124, 156, 101, 111, 139, 90, 99, 125, 77, 85, 109, 64, 71, 93, 51, 57, 77, 36, 42, 59, 17, 20, 37, 0, 0, 0,
- 115, 124, 140, 103, 111, 125, 90, 99, 112, 78, 85, 97, 64, 71, 82, 52, 57, 67, 36, 42, 50, 16, 20, 30, 0, 0, 0,
- 117, 123, 125, 104, 110, 111, 92, 98, 99, 79, 85, 86, 65, 71, 72, 51, 58, 59, 37, 42, 43, 17, 21, 22, 0, 0, 0,
- 118, 123, 110, 105, 110, 97, 93, 98, 86, 78, 84, 74, 66, 71, 62, 52, 57, 49, 37, 42, 34, 17, 22, 14, 0, 0, 0,
- 120, 123, 93, 106, 109, 82, 94, 97, 72, 80, 84, 61, 66, 71, 50, 52, 57, 38, 37, 42, 24, 17, 22, 2, 0, 0, 0,
- 121, 122, 75, 108, 109, 66, 95, 97, 58, 80, 84, 48, 66, 71, 37, 52, 57, 26, 37, 42, 12, 16, 22, 0, 0, 0, 0,
- 122, 123, 62, 108, 109, 52, 95, 97, 45, 81, 84, 36, 67, 70, 26, 52, 57, 14, 37, 42, 0, 15, 22, 0, 0, 0, 0,
- 113, 107, 177, 102, 96, 159, 89, 85, 141, 78, 72, 124, 65, 60, 107, 52, 46, 89, 37, 30, 70, 18, 5, 46, 0, 0, 6,
- 116, 107, 160, 104, 96, 144, 92, 85, 129, 80, 72, 112, 67, 60, 96, 53, 47, 80, 38, 31, 62, 19, 7, 39, 0, 0, 0,
- 118, 107, 147, 105, 96, 131, 93, 85, 118, 80, 72, 101, 67, 60, 87, 54, 47, 71, 39, 31, 54, 19, 8, 32, 0, 0, 0,
- 119, 107, 132, 106, 96, 118, 94, 85, 106, 81, 73, 91, 67, 60, 77, 54, 47, 63, 39, 32, 47, 20, 9, 25, 0, 0, 0,
- 119, 107, 118, 106, 95, 105, 94, 85, 93, 81, 72, 80, 68, 60, 68, 54, 47, 54, 39, 32, 39, 20, 11, 18, 0, 0, 0,
- 121, 107, 104, 107, 96, 92, 95, 84, 80, 81, 72, 69, 68, 61, 58, 54, 48, 46, 39, 33, 31, 20, 12, 9, 0, 0, 0,
- 123, 107, 88, 108, 95, 77, 96, 84, 68, 82, 72, 57, 68, 60, 46, 54, 47, 35, 39, 33, 20, 19, 13, 2, 0, 0, 0,
- 123, 106, 72, 110, 95, 63, 96, 84, 54, 82, 72, 45, 69, 60, 35, 55, 48, 23, 39, 33, 9, 18, 14, 0, 0, 0, 0,
- 125, 106, 60, 110, 94, 50, 98, 84, 42, 83, 72, 34, 69, 60, 25, 55, 48, 12, 39, 33, 0, 17, 13, 0, 0, 0, 0,
- 118, 89, 165, 105, 79, 148, 93, 69, 132, 81, 57, 115, 68, 45, 99, 55, 32, 82, 41, 15, 64, 21, 0, 41, 0, 0, 0,
- 120, 89, 150, 107, 79, 135, 96, 69, 121, 82, 58, 105, 70, 46, 89, 56, 34, 73, 41, 17, 56, 21, 0, 34, 0, 0, 0,
- 121, 89, 137, 108, 79, 123, 96, 69, 109, 82, 58, 95, 70, 47, 81, 56, 34, 66, 41, 18, 49, 21, 0, 28, 0, 0, 0,
- 122, 90, 124, 109, 79, 110, 96, 69, 99, 83, 58, 85, 70, 47, 72, 56, 35, 58, 41, 19, 42, 21, 0, 22, 0, 0, 0,
- 123, 90, 111, 110, 79, 98, 97, 69, 87, 83, 59, 75, 70, 47, 63, 56, 35, 50, 41, 20, 35, 21, 0, 14, 0, 0, 0,
- 123, 90, 98, 110, 79, 87, 97, 70, 76, 84, 58, 64, 70, 48, 53, 56, 36, 41, 40, 21, 26, 21, 0, 5, 0, 0, 0,
- 125, 89, 84, 111, 79, 73, 97, 69, 64, 84, 59, 54, 70, 48, 43, 56, 36, 31, 40, 22, 17, 20, 1, 1, 0, 0, 0,
- 125, 89, 69, 112, 79, 60, 98, 70, 51, 84, 59, 42, 70, 48, 32, 56, 36, 20, 41, 22, 5, 19, 2, 0, 0, 0, 0,
- 126, 89, 57, 112, 79, 49, 99, 70, 41, 84, 59, 32, 70, 48, 22, 56, 36, 10, 40, 22, 0, 18, 2, 0, 0, 0, 0,
- 121, 67, 154, 108, 58, 138, 97, 50, 124, 84, 39, 107, 71, 28, 92, 58, 12, 76, 43, 0, 59, 20, 0, 37, 0, 0, 0,
- 124, 68, 140, 111, 59, 126, 98, 50, 112, 84, 40, 98, 71, 29, 83, 58, 15, 67, 42, 0, 51, 20, 0, 30, 0, 0, 0,
- 124, 68, 129, 111, 59, 114, 99, 51, 102, 86, 41, 88, 71, 30, 75, 58, 17, 60, 42, 0, 45, 20, 0, 24, 0, 0, 0,
- 125, 70, 116, 111, 60, 103, 99, 51, 92, 85, 41, 79, 71, 31, 66, 58, 19, 53, 42, 3, 38, 20, 0, 17, 0, 0, 0,
- 125, 70, 104, 111, 61, 93, 99, 52, 81, 85, 43, 69, 72, 32, 58, 58, 20, 45, 42, 4, 31, 20, 0, 8, 0, 0, 0,
- 126, 70, 92, 111, 61, 81, 99, 52, 71, 85, 42, 60, 71, 33, 49, 57, 21, 37, 42, 6, 23, 20, 0, 3, 0, 0, 0,
- 126, 70, 79, 112, 61, 70, 99, 53, 60, 85, 43, 50, 71, 33, 39, 57, 22, 28, 41, 7, 13, 19, 0, 0, 0, 0, 0,
- 127, 71, 66, 113, 62, 56, 100, 53, 48, 86, 44, 39, 71, 34, 29, 57, 23, 18, 41, 8, 2, 18, 0, 0, 0, 0, 0,
- 128, 70, 55, 114, 62, 46, 100, 54, 39, 86, 44, 30, 71, 34, 20, 57, 23, 7, 41, 9, 0, 18, 0, 0, 0, 0, 0,
- 124, 41, 145, 111, 32, 128, 99, 23, 114, 86, 10, 100, 73, 0, 85, 60, 0, 71, 43, 0, 54, 17, 0, 32, 0, 0, 0,
- 126, 42, 131, 113, 33, 117, 100, 25, 104, 86, 14, 90, 73, 0, 77, 60, 0, 63, 44, 0, 47, 18, 0, 25, 0, 0, 0,
- 127, 43, 120, 113, 34, 106, 101, 26, 95, 86, 17, 82, 73, 2, 69, 59, 0, 56, 43, 0, 41, 18, 0, 19, 0, 0, 0,
- 127, 45, 109, 113, 37, 97, 101, 28, 85, 86, 19, 74, 73, 5, 61, 59, 0, 48, 43, 0, 34, 19, 0, 11, 0, 0, 0,
- 127, 46, 98, 114, 38, 86, 100, 30, 76, 87, 21, 65, 73, 9, 54, 59, 0, 41, 43, 0, 26, 18, 0, 5, 0, 0, 0,
- 127, 47, 87, 113, 39, 76, 101, 31, 67, 86, 22, 56, 72, 11, 45, 59, 0, 33, 43, 0, 19, 18, 0, 2, 0, 0, 0,
- 128, 48, 75, 114, 39, 65, 101, 33, 56, 86, 23, 46, 72, 12, 36, 58, 0, 24, 42, 0, 9, 17, 0, 0, 0, 0, 0,
- 129, 48, 63, 114, 41, 54, 102, 33, 46, 87, 24, 36, 72, 14, 26, 58, 1, 14, 42, 0, 2, 16, 0, 0, 0, 0, 0,
- 128, 48, 53, 114, 41, 44, 102, 34, 37, 87, 25, 27, 72, 15, 17, 58, 1, 3, 41, 0, 0, 15, 0, 0, 0, 0, 0,
- 0, 189, 242, 0, 169, 217, 0, 151, 194, 0, 132, 170, 0, 113, 147, 0, 94, 123, 0, 74, 99, 0, 51, 71, 0, 15, 34,
- 1, 187, 219, 1, 167, 195, 0, 150, 175, 0, 131, 153, 0, 113, 132, 0, 94, 111, 0, 74, 89, 0, 50, 63, 0, 13, 28,
- 1, 186, 198, 1, 167, 178, 0, 149, 158, 0, 130, 139, 0, 111, 119, 0, 93, 100, 0, 74, 80, 0, 50, 55, 0, 13, 22,
- 1, 185, 176, 1, 165, 159, 1, 148, 142, 0, 129, 123, 0, 111, 106, 0, 93, 89, 0, 73, 70, 0, 50, 47, 0, 13, 13,
- 1, 184, 157, 1, 164, 141, 1, 147, 125, 0, 128, 110, 0, 110, 93, 0, 92, 77, 0, 73, 60, 0, 50, 39, 0, 12, 5,
- 25, 182, 137, 25, 163, 122, 17, 146, 109, 0, 128, 96, 0, 110, 81, 0, 92, 66, 0, 73, 51, 0, 50, 30, 0, 10, 0,
- 42, 181, 114, 35, 163, 102, 30, 145, 91, 14, 127, 80, 0, 109, 67, 0, 91, 53, 0, 72, 39, 0, 50, 19, 0, 10, 0,
- 52, 181, 92, 43, 162, 83, 32, 145, 73, 19, 126, 63, 0, 108, 52, 0, 90, 40, 0, 72, 27, 0, 50, 7, 0, 10, 0,
- 57, 181, 74, 48, 162, 66, 37, 144, 57, 24, 126, 49, 7, 108, 40, 0, 90, 29, 0, 72, 15, 0, 49, 0, 0, 10, 0,
- 1, 170, 227, 1, 152, 203, 0, 136, 182, 0, 119, 159, 0, 101, 137, 0, 84, 115, 0, 65, 92, 0, 43, 66, 0, 1, 29,
- 1, 169, 206, 1, 151, 184, 1, 136, 165, 0, 118, 144, 0, 102, 125, 0, 84, 105, 0, 65, 83, 0, 43, 58, 0, 0, 22,
- 29, 168, 186, 21, 151, 167, 14, 135, 150, 4, 118, 131, 0, 101, 112, 0, 83, 94, 0, 65, 75, 0, 43, 51, 0, 0, 16,
- 41, 167, 167, 33, 150, 150, 31, 134, 134, 19, 117, 117, 4, 100, 100, 0, 83, 83, 0, 65, 65, 0, 42, 43, 0, 0, 8,
- 48, 167, 149, 41, 149, 133, 33, 133, 118, 25, 116, 103, 13, 99, 88, 0, 83, 73, 0, 65, 56, 0, 42, 35, 0, 0, 0,
- 58, 165, 130, 49, 148, 115, 42, 132, 103, 31, 115, 89, 18, 99, 75, 0, 82, 61, 0, 64, 46, 0, 42, 26, 0, 0, 0,
- 62, 164, 110, 55, 147, 97, 45, 132, 87, 35, 115, 75, 22, 98, 63, 5, 82, 50, 0, 64, 36, 0, 42, 16, 0, 0, 0,
- 69, 164, 89, 60, 147, 78, 50, 131, 70, 37, 114, 59, 26, 98, 49, 10, 81, 37, 0, 64, 24, 0, 42, 4, 0, 0, 0,
- 71, 164, 71, 63, 147, 63, 53, 131, 55, 40, 114, 47, 28, 98, 38, 13, 81, 26, 0, 64, 12, 0, 42, 0, 0, 0, 0,
- 28, 153, 214, 24, 138, 193, 23, 123, 171, 16, 107, 150, 0, 91, 130, 0, 75, 109, 0, 58, 87, 0, 35, 61, 0, 0, 25,
- 48, 153, 194, 41, 138, 174, 34, 123, 156, 27, 107, 136, 16, 91, 117, 1, 75, 98, 0, 57, 78, 0, 35, 53, 0, 0, 17,
- 55, 153, 177, 47, 137, 158, 42, 122, 142, 33, 107, 124, 22, 91, 106, 6, 75, 88, 0, 57, 70, 0, 35, 46, 0, 0, 9,
- 61, 152, 158, 53, 136, 143, 45, 122, 127, 36, 106, 111, 24, 90, 94, 10, 74, 78, 0, 57, 61, 0, 35, 39, 0, 0, 2,
- 67, 151, 141, 59, 135, 126, 49, 121, 112, 39, 105, 98, 29, 90, 83, 14, 74, 68, 0, 57, 52, 0, 35, 31, 0, 0, 0,
- 71, 150, 123, 62, 135, 110, 54, 120, 98, 42, 105, 84, 31, 89, 71, 16, 74, 58, 0, 57, 43, 0, 35, 22, 0, 0, 0,
- 74, 150, 105, 64, 134, 92, 55, 120, 83, 45, 104, 71, 34, 89, 59, 20, 73, 47, 0, 57, 32, 0, 35, 13, 0, 0, 0,
- 78, 149, 84, 69, 134, 75, 59, 120, 66, 47, 103, 56, 34, 88, 46, 22, 73, 34, 1, 57, 20, 0, 35, 1, 0, 0, 0,
- 80, 149, 69, 70, 133, 61, 60, 119, 53, 49, 103, 44, 36, 88, 35, 23, 73, 24, 2, 56, 10, 0, 35, 0, 0, 0, 0,
- 58, 136, 200, 50, 122, 180, 45, 109, 162, 38, 94, 141, 27, 80, 121, 15, 65, 102, 0, 48, 81, 0, 26, 56, 0, 0, 19,
- 66, 136, 182, 59, 122, 163, 52, 109, 146, 42, 94, 128, 32, 80, 109, 20, 65, 91, 2, 48, 72, 0, 26, 49, 0, 0, 11,
- 70, 136, 165, 62, 122, 149, 55, 108, 133, 46, 94, 116, 35, 80, 99, 21, 65, 82, 4, 49, 64, 0, 26, 41, 0, 0, 3,
- 76, 135, 149, 66, 121, 133, 58, 108, 119, 48, 94, 103, 36, 79, 88, 23, 65, 73, 7, 49, 56, 0, 27, 34, 0, 0, 0,
- 78, 135, 133, 69, 120, 118, 60, 107, 106, 50, 93, 92, 39, 79, 77, 26, 65, 63, 8, 49, 47, 0, 27, 26, 0, 0, 0,
- 82, 134, 117, 71, 120, 104, 62, 107, 92, 51, 93, 79, 39, 78, 66, 27, 64, 53, 10, 48, 39, 0, 27, 18, 0, 0, 0,
- 84, 134, 99, 73, 119, 87, 64, 106, 77, 53, 92, 66, 42, 78, 55, 28, 64, 42, 11, 48, 29, 0, 28, 9, 0, 0, 0,
- 87, 133, 81, 76, 119, 72, 66, 106, 62, 55, 92, 52, 43, 78, 42, 29, 64, 31, 12, 48, 17, 0, 28, 0, 0, 0, 0,
- 88, 134, 67, 77, 119, 58, 68, 106, 51, 56, 92, 42, 44, 78, 32, 30, 64, 20, 12, 48, 6, 0, 28, 0, 0, 0, 0,
- 73, 120, 189, 64, 107, 168, 57, 96, 151, 47, 82, 133, 38, 69, 114, 26, 55, 95, 11, 39, 75, 0, 16, 51, 0, 0, 14,
- 78, 120, 171, 69, 107, 153, 62, 95, 137, 51, 82, 119, 40, 69, 102, 29, 55, 85, 15, 39, 66, 0, 17, 44, 0, 0, 4,
- 81, 120, 156, 71, 107, 140, 64, 95, 125, 53, 82, 109, 42, 69, 93, 31, 55, 77, 16, 39, 59, 0, 18, 37, 0, 0, 0,
- 85, 120, 141, 74, 107, 126, 65, 95, 112, 54, 82, 97, 43, 69, 82, 32, 55, 67, 17, 39, 51, 0, 19, 30, 0, 0, 0,
- 86, 119, 126, 76, 106, 112, 66, 95, 100, 56, 81, 85, 45, 69, 72, 33, 55, 59, 18, 40, 43, 0, 19, 22, 0, 0, 0,
- 89, 119, 110, 78, 106, 98, 69, 94, 87, 56, 81, 75, 46, 68, 62, 33, 55, 49, 18, 40, 35, 0, 20, 15, 0, 0, 0,
- 89, 119, 95, 80, 106, 83, 70, 94, 73, 58, 81, 63, 46, 68, 51, 34, 55, 39, 19, 40, 25, 0, 20, 4, 0, 0, 0,
- 92, 118, 78, 82, 106, 68, 70, 93, 59, 59, 81, 49, 47, 68, 39, 34, 55, 28, 19, 40, 14, 0, 20, 0, 0, 0, 0,
- 93, 118, 65, 82, 105, 55, 72, 93, 48, 60, 81, 39, 47, 68, 29, 34, 55, 18, 20, 40, 2, 0, 20, 0, 0, 0, 0,
- 83, 104, 177, 74, 93, 159, 65, 82, 142, 56, 70, 124, 45, 57, 106, 33, 44, 89, 20, 28, 70, 1, 4, 46, 0, 0, 8,
- 86, 104, 161, 78, 93, 145, 68, 82, 128, 58, 70, 112, 48, 58, 96, 35, 45, 80, 21, 29, 62, 1, 6, 40, 0, 0, 0,
- 89, 104, 147, 79, 93, 131, 69, 82, 118, 59, 70, 102, 47, 58, 87, 36, 45, 72, 23, 29, 55, 3, 7, 33, 0, 0, 0,
- 90, 104, 132, 80, 93, 119, 71, 82, 106, 60, 70, 91, 48, 58, 77, 37, 45, 62, 23, 30, 47, 4, 7, 26, 0, 0, 0,
- 92, 104, 118, 82, 93, 105, 72, 82, 93, 61, 69, 80, 50, 58, 68, 37, 45, 55, 23, 30, 39, 4, 8, 18, 0, 0, 0,
- 94, 104, 105, 82, 92, 93, 72, 82, 82, 61, 70, 70, 50, 58, 58, 38, 46, 46, 23, 31, 31, 6, 10, 11, 0, 0, 0,
- 95, 104, 90, 84, 92, 79, 74, 82, 70, 62, 70, 58, 50, 58, 48, 37, 46, 36, 23, 31, 22, 4, 11, 3, 0, 0, 0,
- 96, 103, 74, 85, 92, 65, 75, 81, 56, 63, 70, 47, 50, 58, 37, 38, 46, 25, 24, 31, 11, 3, 11, 0, 0, 0, 0,
- 97, 103, 62, 86, 92, 53, 76, 81, 45, 63, 69, 36, 51, 58, 27, 38, 46, 15, 23, 31, 0, 3, 11, 0, 0, 0, 0,
- 90, 87, 165, 81, 77, 148, 72, 67, 132, 62, 55, 116, 50, 44, 99, 39, 31, 82, 25, 14, 64, 1, 0, 42, 0, 0, 1,
- 93, 87, 150, 83, 77, 135, 74, 67, 121, 63, 56, 105, 52, 45, 90, 40, 32, 74, 25, 16, 57, 3, 0, 35, 0, 0, 0,
- 95, 87, 138, 85, 77, 123, 75, 67, 109, 63, 57, 95, 53, 45, 81, 41, 33, 66, 26, 17, 50, 4, 0, 28, 0, 0, 0,
- 95, 88, 124, 85, 77, 111, 75, 67, 99, 63, 57, 86, 53, 45, 72, 41, 33, 58, 26, 18, 43, 5, 1, 22, 0, 0, 0,
- 97, 88, 112, 87, 77, 100, 76, 68, 88, 64, 57, 76, 53, 46, 63, 41, 34, 50, 26, 19, 35, 5, 2, 14, 0, 0, 0,
- 99, 87, 99, 87, 78, 88, 76, 68, 77, 65, 57, 65, 53, 46, 54, 41, 35, 42, 27, 20, 27, 6, 2, 5, 0, 0, 0,
- 100, 87, 85, 88, 77, 75, 77, 68, 65, 65, 57, 54, 53, 46, 44, 41, 35, 32, 27, 21, 19, 5, 3, 2, 0, 0, 0,
- 100, 88, 71, 89, 77, 61, 78, 68, 53, 66, 57, 44, 53, 47, 33, 41, 35, 22, 27, 21, 7, 5, 3, 0, 0, 0, 0,
- 101, 87, 60, 90, 77, 52, 79, 68, 44, 66, 58, 34, 53, 47, 25, 41, 35, 13, 26, 22, 0, 5, 3, 0, 0, 0, 0,
- 97, 67, 155, 86, 58, 138, 77, 50, 125, 66, 39, 108, 55, 28, 92, 43, 12, 76, 29, 0, 59, 2, 0, 37, 0, 0, 0,
- 99, 67, 141, 88, 59, 127, 78, 50, 113, 68, 40, 98, 56, 29, 83, 44, 15, 68, 29, 0, 52, 3, 0, 30, 0, 0, 0,
- 100, 68, 129, 89, 59, 115, 80, 51, 103, 68, 41, 89, 56, 30, 75, 44, 16, 61, 30, 0, 45, 4, 0, 24, 0, 0, 0,
- 100, 69, 118, 90, 60, 104, 80, 51, 92, 67, 41, 79, 56, 31, 66, 44, 18, 53, 29, 2, 38, 4, 0, 18, 0, 0, 0,
- 101, 69, 104, 90, 61, 93, 79, 51, 82, 67, 42, 70, 56, 32, 59, 44, 20, 46, 29, 4, 31, 6, 0, 9, 0, 0, 0,
- 102, 69, 93, 90, 61, 83, 80, 52, 72, 68, 42, 61, 56, 33, 50, 43, 20, 38, 29, 5, 23, 7, 0, 4, 0, 0, 0,
- 102, 70, 80, 91, 61, 71, 80, 52, 61, 68, 43, 51, 56, 32, 40, 44, 21, 29, 30, 6, 14, 7, 0, 0, 0, 0, 0,
- 103, 70, 68, 92, 61, 58, 81, 53, 50, 69, 43, 41, 56, 34, 31, 43, 22, 19, 29, 7, 3, 7, 0, 0, 0, 0, 0,
- 104, 70, 57, 92, 61, 48, 82, 53, 40, 69, 43, 32, 56, 34, 22, 43, 23, 10, 29, 8, 0, 6, 0, 0, 0, 0, 0,
- 101, 45, 145, 91, 35, 129, 80, 26, 116, 69, 15, 101, 59, 0, 86, 46, 0, 71, 31, 0, 55, 0, 0, 33, 0, 0, 0,
- 104, 44, 132, 92, 36, 118, 82, 28, 105, 71, 17, 91, 58, 3, 77, 46, 0, 63, 31, 0, 48, 2, 0, 26, 0, 0, 0,
- 104, 46, 121, 93, 37, 107, 82, 30, 96, 70, 20, 83, 58, 6, 70, 46, 0, 57, 32, 0, 41, 4, 0, 20, 0, 0, 0,
- 104, 48, 110, 93, 40, 98, 82, 31, 87, 70, 22, 74, 59, 9, 62, 45, 0, 49, 31, 0, 35, 6, 0, 13, 0, 0, 0,
- 104, 48, 99, 92, 41, 88, 82, 32, 77, 70, 23, 65, 58, 11, 54, 46, 0, 42, 32, 0, 27, 7, 0, 5, 0, 0, 0,
- 105, 50, 88, 93, 41, 77, 82, 34, 68, 71, 24, 57, 58, 13, 46, 45, 1, 35, 31, 0, 21, 7, 0, 2, 0, 0, 0,
- 105, 50, 76, 94, 41, 66, 83, 34, 57, 71, 25, 47, 58, 15, 37, 45, 2, 25, 32, 0, 11, 7, 0, 0, 0, 0, 0,
- 106, 50, 64, 94, 42, 55, 83, 35, 47, 71, 26, 38, 58, 16, 27, 45, 4, 17, 31, 0, 4, 7, 0, 0, 0, 0, 0,
- 106, 51, 54, 95, 42, 45, 83, 35, 38, 71, 27, 30, 58, 16, 19, 45, 5, 7, 30, 0, 0, 6, 0, 0, 0, 0, 0,
- 0, 181, 240, 0, 162, 216, 0, 144, 193, 0, 126, 168, 0, 109, 146, 0, 91, 123, 0, 71, 98, 0, 48, 71, 0, 9, 34,
- 0, 179, 218, 0, 161, 195, 0, 144, 174, 0, 126, 153, 0, 108, 132, 0, 90, 110, 0, 71, 88, 0, 48, 63, 0, 8, 29,
- 0, 178, 197, 0, 159, 177, 0, 143, 159, 0, 125, 139, 0, 107, 119, 0, 90, 99, 0, 71, 79, 0, 48, 55, 0, 8, 22,
- 0, 177, 177, 0, 158, 158, 0, 142, 141, 0, 124, 123, 0, 107, 106, 0, 89, 88, 0, 71, 70, 0, 48, 47, 0, 8, 14,
- 0, 176, 157, 0, 158, 141, 0, 141, 126, 0, 123, 109, 0, 106, 93, 0, 89, 78, 0, 70, 60, 0, 47, 39, 0, 7, 5,
- 0, 175, 138, 0, 157, 123, 0, 141, 110, 0, 123, 96, 0, 105, 81, 0, 88, 67, 0, 70, 51, 0, 48, 30, 0, 6, 0,
- 0, 173, 115, 0, 155, 104, 0, 140, 92, 0, 122, 80, 0, 105, 67, 0, 88, 55, 0, 69, 40, 0, 47, 20, 0, 6, 0,
- 0, 173, 94, 0, 155, 85, 0, 139, 75, 0, 121, 64, 0, 104, 53, 0, 88, 42, 0, 70, 28, 0, 47, 9, 0, 6, 0,
- 0, 173, 76, 0, 155, 70, 0, 138, 61, 0, 122, 53, 0, 104, 44, 0, 87, 32, 0, 69, 18, 0, 47, 0, 0, 6, 0,
- 0, 164, 226, 0, 147, 203, 0, 131, 181, 0, 114, 158, 0, 97, 136, 0, 80, 115, 0, 63, 92, 0, 40, 65, 0, 0, 30,
- 0, 162, 205, 0, 145, 184, 0, 130, 164, 0, 114, 143, 0, 97, 124, 0, 81, 104, 0, 63, 83, 0, 40, 58, 0, 0, 23,
- 0, 162, 187, 0, 145, 167, 0, 130, 150, 0, 113, 131, 0, 96, 112, 0, 80, 93, 0, 62, 74, 0, 40, 50, 0, 0, 16,
- 0, 160, 167, 0, 144, 150, 0, 129, 134, 0, 112, 116, 0, 96, 100, 0, 80, 82, 0, 62, 65, 0, 40, 43, 0, 0, 7,
- 0, 160, 148, 0, 143, 133, 0, 128, 118, 0, 111, 103, 0, 96, 88, 0, 80, 73, 0, 62, 56, 0, 40, 35, 0, 0, 0,
- 0, 158, 130, 0, 142, 117, 0, 127, 104, 0, 111, 89, 0, 95, 76, 0, 79, 62, 0, 62, 46, 0, 40, 26, 0, 0, 0,
- 0, 158, 111, 0, 141, 99, 0, 127, 88, 0, 111, 76, 0, 95, 63, 0, 79, 51, 0, 62, 37, 0, 40, 18, 0, 0, 0,
- 0, 158, 91, 0, 141, 81, 0, 126, 72, 0, 110, 62, 0, 94, 50, 0, 79, 39, 0, 62, 25, 0, 40, 5, 0, 0, 0,
- 0, 157, 74, 0, 141, 66, 0, 126, 59, 0, 110, 49, 0, 94, 40, 0, 78, 29, 0, 61, 15, 0, 40, 0, 0, 0, 0,
- 0, 148, 214, 0, 133, 192, 0, 119, 171, 0, 103, 150, 0, 87, 129, 0, 72, 108, 0, 55, 86, 0, 32, 61, 0, 0, 25,
- 0, 147, 193, 0, 132, 173, 0, 118, 155, 0, 103, 136, 0, 87, 116, 0, 72, 98, 0, 55, 78, 0, 32, 53, 0, 0, 17,
- 0, 147, 176, 0, 132, 158, 0, 118, 142, 0, 102, 124, 0, 87, 106, 0, 72, 88, 0, 55, 69, 0, 33, 46, 0, 0, 9,
- 0, 146, 159, 0, 131, 142, 0, 117, 127, 0, 102, 111, 0, 87, 95, 0, 71, 79, 0, 55, 61, 0, 33, 39, 0, 0, 2,
- 0, 145, 140, 0, 130, 126, 0, 117, 112, 0, 101, 98, 0, 86, 83, 0, 71, 68, 0, 55, 52, 0, 33, 31, 0, 0, 0,
- 0, 144, 124, 0, 130, 111, 0, 116, 99, 0, 101, 84, 0, 86, 72, 0, 71, 59, 0, 55, 43, 0, 33, 23, 0, 0, 0,
- 0, 144, 106, 0, 129, 94, 0, 115, 83, 0, 101, 72, 0, 85, 60, 0, 71, 48, 0, 55, 34, 0, 33, 14, 0, 0, 0,
- 3, 143, 86, 0, 129, 77, 0, 115, 68, 0, 100, 58, 0, 85, 48, 0, 70, 36, 0, 54, 22, 0, 33, 3, 0, 0, 0,
- 18, 143, 72, 13, 128, 63, 0, 115, 57, 0, 100, 47, 0, 85, 37, 0, 70, 26, 0, 54, 13, 0, 33, 0, 0, 0, 0,
- 0, 132, 200, 0, 118, 179, 0, 105, 161, 0, 91, 140, 0, 76, 121, 0, 62, 101, 0, 46, 81, 0, 24, 56, 0, 0, 19,
- 0, 131, 182, 0, 118, 163, 0, 105, 146, 0, 91, 128, 0, 77, 110, 0, 62, 91, 0, 46, 72, 0, 25, 48, 0, 0, 11,
- 0, 131, 165, 0, 117, 149, 0, 104, 133, 0, 91, 116, 0, 77, 99, 0, 62, 82, 0, 46, 64, 0, 25, 41, 0, 0, 4,
- 0, 131, 149, 0, 116, 134, 0, 104, 119, 0, 91, 104, 0, 77, 89, 0, 62, 73, 0, 46, 56, 0, 25, 34, 0, 0, 0,
- 10, 130, 133, 2, 116, 119, 0, 104, 106, 0, 90, 91, 0, 76, 78, 0, 62, 64, 0, 46, 48, 0, 26, 27, 0, 0, 0,
- 23, 130, 118, 20, 116, 104, 13, 103, 93, 3, 89, 79, 0, 76, 67, 0, 62, 54, 0, 46, 39, 0, 26, 19, 0, 0, 0,
- 33, 129, 101, 27, 115, 89, 19, 103, 79, 9, 89, 67, 0, 75, 56, 0, 61, 43, 0, 46, 29, 0, 26, 10, 0, 0, 0,
- 41, 128, 83, 35, 115, 73, 27, 102, 64, 15, 89, 55, 0, 76, 45, 0, 62, 33, 0, 46, 18, 0, 26, 0, 0, 0, 0,
- 43, 129, 69, 38, 115, 61, 30, 102, 54, 17, 89, 45, 2, 75, 34, 0, 61, 23, 0, 46, 9, 0, 26, 0, 0, 0, 0,
- 1, 116, 188, 1, 104, 168, 0, 92, 151, 0, 79, 132, 0, 66, 113, 0, 52, 94, 0, 36, 75, 0, 14, 52, 0, 0, 14,
- 17, 116, 171, 16, 104, 153, 14, 92, 137, 8, 79, 119, 0, 67, 102, 0, 53, 85, 0, 37, 67, 0, 16, 44, 0, 0, 4,
- 31, 116, 155, 27, 104, 140, 21, 92, 125, 13, 79, 109, 3, 66, 93, 0, 53, 77, 0, 37, 59, 0, 16, 38, 0, 0, 0,
- 37, 115, 141, 30, 103, 126, 26, 92, 112, 16, 79, 98, 5, 66, 83, 0, 53, 67, 0, 38, 51, 0, 17, 31, 0, 0, 0,
- 41, 115, 126, 37, 103, 112, 31, 92, 100, 22, 79, 86, 10, 66, 72, 0, 53, 59, 0, 38, 44, 0, 17, 23, 0, 0, 0,
- 48, 115, 111, 41, 102, 99, 34, 91, 88, 24, 78, 76, 14, 66, 63, 0, 53, 50, 0, 38, 36, 0, 18, 15, 0, 0, 0,
- 51, 115, 95, 46, 102, 85, 37, 91, 74, 26, 78, 63, 16, 66, 52, 0, 53, 40, 0, 38, 26, 0, 18, 5, 0, 0, 0,
- 55, 114, 80, 47, 102, 69, 40, 90, 60, 30, 78, 51, 19, 66, 41, 3, 53, 29, 0, 38, 15, 0, 17, 0, 0, 0, 0,
- 56, 114, 66, 50, 102, 58, 40, 91, 50, 32, 78, 41, 18, 66, 32, 4, 53, 21, 0, 38, 5, 0, 17, 0, 0, 0, 0,
- 39, 102, 178, 37, 90, 159, 30, 79, 142, 21, 68, 124, 14, 55, 106, 0, 42, 89, 0, 26, 70, 0, 4, 46, 0, 0, 8,
- 48, 102, 161, 42, 90, 145, 35, 79, 128, 26, 68, 112, 19, 55, 96, 3, 43, 79, 0, 27, 62, 0, 6, 40, 0, 0, 0,
- 50, 102, 147, 44, 90, 132, 37, 79, 118, 30, 68, 102, 20, 56, 87, 7, 43, 72, 0, 28, 55, 0, 6, 34, 0, 0, 0,
- 53, 101, 133, 47, 90, 118, 41, 79, 106, 32, 68, 91, 21, 56, 78, 9, 43, 63, 0, 28, 47, 0, 6, 26, 0, 0, 0,
- 57, 101, 119, 50, 89, 106, 42, 79, 94, 34, 67, 81, 24, 56, 68, 9, 44, 55, 0, 29, 40, 0, 6, 19, 0, 0, 0,
- 60, 100, 105, 50, 90, 94, 45, 80, 83, 36, 68, 71, 24, 56, 59, 11, 44, 46, 0, 29, 32, 0, 7, 12, 0, 0, 0,
- 63, 101, 91, 55, 90, 80, 46, 79, 70, 37, 68, 59, 26, 56, 49, 12, 44, 37, 1, 29, 23, 0, 7, 3, 0, 0, 0,
- 64, 101, 75, 56, 89, 67, 48, 79, 57, 37, 68, 48, 27, 56, 37, 15, 44, 26, 0, 29, 12, 0, 7, 0, 0, 0, 0,
- 66, 101, 64, 58, 89, 55, 49, 79, 47, 39, 68, 38, 27, 56, 29, 14, 44, 18, 1, 30, 2, 0, 7, 0, 0, 0, 0,
- 57, 86, 165, 51, 75, 148, 45, 65, 133, 38, 54, 116, 28, 43, 100, 16, 29, 83, 0, 13, 64, 0, 0, 42, 0, 0, 3,
- 60, 86, 151, 55, 75, 135, 47, 66, 121, 39, 55, 105, 30, 44, 90, 18, 31, 74, 3, 16, 57, 0, 1, 35, 0, 0, 0,
- 62, 86, 139, 56, 75, 123, 49, 66, 110, 40, 55, 95, 30, 44, 81, 19, 31, 66, 4, 17, 51, 0, 1, 29, 0, 0, 0,
- 65, 86, 125, 56, 76, 112, 49, 66, 99, 39, 55, 86, 31, 44, 72, 19, 32, 59, 5, 18, 44, 0, 1, 23, 0, 0, 0,
- 67, 86, 113, 58, 75, 100, 51, 66, 88, 41, 56, 77, 31, 45, 64, 20, 32, 51, 6, 18, 35, 0, 1, 14, 0, 0, 0,
- 69, 86, 99, 61, 76, 88, 52, 66, 78, 43, 56, 66, 32, 45, 55, 20, 33, 42, 7, 19, 27, 0, 1, 6, 0, 0, 0,
- 69, 86, 86, 61, 76, 75, 53, 67, 66, 43, 56, 55, 33, 45, 45, 21, 34, 34, 8, 20, 20, 0, 2, 2, 0, 0, 0,
- 71, 86, 72, 63, 75, 62, 54, 66, 55, 45, 56, 45, 33, 45, 35, 22, 34, 23, 7, 20, 8, 0, 2, 0, 0, 0, 0,
- 71, 86, 62, 64, 75, 53, 55, 66, 46, 45, 56, 36, 33, 46, 27, 22, 34, 15, 8, 20, 0, 0, 2, 0, 0, 0, 0,
- 69, 67, 156, 61, 58, 140, 53, 50, 125, 45, 39, 108, 35, 28, 93, 25, 12, 77, 12, 0, 59, 0, 0, 37, 0, 0, 0,
- 71, 68, 142, 63, 59, 126, 56, 50, 114, 47, 40, 98, 37, 28, 84, 26, 15, 68, 12, 0, 53, 0, 0, 30, 0, 0, 0,
- 72, 68, 130, 63, 59, 116, 56, 50, 104, 47, 40, 90, 38, 30, 75, 27, 16, 61, 13, 0, 46, 0, 0, 24, 0, 0, 0,
- 73, 69, 118, 65, 59, 105, 57, 51, 92, 47, 41, 80, 37, 30, 67, 26, 18, 53, 14, 1, 39, 0, 0, 18, 0, 0, 0,
- 74, 69, 106, 65, 60, 93, 57, 51, 82, 48, 41, 70, 38, 31, 59, 26, 19, 46, 13, 2, 32, 0, 0, 10, 0, 0, 0,
- 76, 69, 95, 66, 61, 84, 58, 52, 73, 48, 42, 61, 37, 32, 50, 26, 20, 38, 14, 4, 24, 0, 0, 4, 0, 0, 0,
- 76, 69, 81, 68, 60, 72, 58, 52, 62, 48, 42, 51, 38, 32, 41, 27, 21, 30, 14, 4, 16, 0, 0, 1, 0, 0, 0,
- 76, 69, 68, 68, 61, 60, 60, 52, 51, 49, 43, 41, 38, 33, 32, 27, 21, 20, 14, 5, 5, 0, 0, 0, 0, 0, 0,
- 78, 70, 59, 69, 61, 50, 60, 52, 42, 49, 43, 34, 39, 33, 24, 27, 22, 13, 14, 7, 1, 0, 0, 0, 0, 0, 0,
- 75, 46, 146, 68, 38, 131, 60, 30, 117, 50, 19, 102, 41, 4, 87, 29, 0, 72, 13, 0, 55, 0, 0, 33, 0, 0, 0,
- 78, 47, 132, 70, 39, 119, 61, 30, 105, 53, 20, 92, 42, 5, 78, 30, 0, 64, 13, 0, 49, 0, 0, 27, 0, 0, 0,
- 79, 48, 122, 70, 40, 108, 62, 32, 96, 52, 22, 84, 42, 9, 71, 30, 0, 58, 14, 0, 42, 0, 0, 20, 0, 0, 0,
- 79, 50, 111, 70, 42, 99, 62, 33, 88, 52, 23, 74, 41, 11, 63, 29, 0, 50, 14, 0, 36, 0, 0, 14, 0, 0, 0,
- 80, 50, 99, 70, 42, 89, 61, 34, 78, 52, 25, 67, 41, 14, 55, 30, 0, 42, 15, 0, 28, 0, 0, 6, 0, 0, 0,
- 81, 51, 89, 71, 43, 78, 62, 35, 69, 52, 25, 58, 42, 15, 47, 30, 3, 36, 15, 0, 22, 0, 0, 3, 0, 0, 0,
- 81, 51, 77, 71, 44, 68, 63, 36, 59, 53, 26, 49, 41, 16, 38, 31, 4, 27, 16, 0, 12, 0, 0, 0, 0, 0, 0,
- 81, 52, 65, 72, 43, 56, 63, 36, 48, 53, 27, 39, 41, 17, 29, 30, 4, 18, 14, 0, 3, 0, 0, 0, 0, 0, 0,
- 81, 52, 55, 73, 44, 47, 64, 36, 39, 53, 28, 32, 42, 18, 21, 31, 6, 9, 14, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 174, 239, 0, 156, 214, 0, 139, 192, 0, 121, 168, 0, 105, 145, 0, 87, 123, 0, 68, 98, 0, 46, 70, 0, 3, 35,
- 0, 172, 217, 0, 155, 194, 0, 139, 173, 0, 121, 152, 0, 104, 130, 0, 87, 110, 0, 69, 88, 0, 46, 63, 0, 4, 28,
- 0, 171, 197, 0, 153, 175, 0, 138, 158, 0, 121, 139, 0, 103, 118, 0, 86, 100, 0, 68, 79, 0, 46, 55, 0, 4, 22,
- 0, 170, 177, 0, 152, 158, 0, 136, 141, 0, 119, 124, 0, 103, 106, 0, 86, 88, 0, 68, 70, 0, 45, 47, 0, 3, 14,
- 0, 169, 157, 0, 152, 141, 0, 136, 126, 0, 119, 109, 0, 102, 94, 0, 86, 78, 0, 68, 60, 0, 46, 39, 0, 3, 5,
- 0, 167, 138, 0, 150, 124, 0, 135, 111, 0, 118, 97, 0, 102, 82, 0, 85, 68, 0, 68, 52, 0, 46, 31, 0, 3, 0,
- 0, 167, 118, 0, 150, 104, 0, 135, 94, 0, 118, 81, 0, 101, 69, 0, 84, 56, 0, 67, 41, 0, 45, 21, 0, 3, 0,
- 0, 166, 97, 0, 149, 87, 0, 134, 77, 0, 117, 67, 0, 101, 56, 0, 85, 44, 0, 67, 30, 0, 45, 10, 0, 3, 0,
- 0, 165, 79, 0, 149, 73, 0, 133, 64, 0, 117, 56, 0, 101, 46, 0, 85, 34, 0, 68, 21, 0, 46, 1, 0, 3, 0,
- 0, 158, 225, 0, 141, 201, 0, 126, 180, 0, 109, 158, 0, 94, 136, 0, 78, 114, 0, 60, 91, 0, 38, 66, 0, 0, 30,
- 0, 156, 203, 0, 140, 183, 0, 125, 164, 0, 109, 143, 0, 94, 124, 0, 78, 104, 0, 61, 83, 0, 38, 57, 0, 0, 23,
- 0, 156, 186, 0, 140, 166, 0, 125, 150, 0, 109, 130, 0, 93, 111, 0, 77, 93, 0, 60, 74, 0, 38, 50, 0, 0, 17,
- 0, 155, 167, 0, 138, 149, 0, 124, 134, 0, 109, 117, 0, 93, 100, 0, 76, 83, 0, 60, 65, 0, 38, 43, 0, 0, 9,
- 0, 153, 147, 0, 138, 134, 0, 124, 120, 0, 107, 103, 0, 92, 88, 0, 77, 73, 0, 60, 56, 0, 38, 35, 0, 0, 0,
- 0, 153, 131, 0, 137, 118, 0, 122, 105, 0, 107, 90, 0, 91, 76, 0, 76, 63, 0, 60, 47, 0, 39, 28, 0, 0, 0,
- 0, 153, 111, 0, 136, 100, 0, 123, 90, 0, 107, 77, 0, 92, 65, 0, 76, 52, 0, 60, 37, 0, 38, 18, 0, 0, 0,
- 0, 152, 93, 0, 136, 82, 0, 122, 74, 0, 106, 63, 0, 91, 52, 0, 76, 40, 0, 59, 26, 0, 38, 6, 0, 0, 0,
- 0, 151, 78, 0, 136, 69, 0, 121, 61, 0, 106, 52, 0, 91, 43, 0, 76, 32, 0, 59, 17, 0, 38, 0, 0, 0, 0,
- 0, 143, 213, 0, 128, 191, 0, 115, 171, 0, 100, 149, 0, 84, 128, 0, 69, 108, 0, 52, 86, 0, 30, 61, 0, 0, 25,
- 0, 142, 193, 0, 127, 173, 0, 114, 154, 0, 99, 134, 0, 84, 116, 0, 69, 98, 0, 52, 77, 0, 31, 53, 0, 0, 18,
- 0, 141, 176, 0, 127, 158, 0, 114, 141, 0, 98, 122, 0, 84, 105, 0, 69, 88, 0, 53, 69, 0, 31, 46, 0, 0, 9,
- 0, 141, 159, 0, 126, 142, 0, 113, 127, 0, 98, 110, 0, 83, 95, 0, 69, 78, 0, 53, 60, 0, 32, 39, 0, 0, 2,
- 0, 140, 140, 0, 126, 126, 0, 112, 112, 0, 98, 98, 0, 83, 83, 0, 68, 69, 0, 52, 52, 0, 31, 31, 0, 0, 0,
- 0, 140, 124, 0, 125, 112, 0, 112, 100, 0, 97, 86, 0, 83, 72, 0, 68, 59, 0, 52, 44, 0, 31, 23, 0, 0, 0,
- 0, 139, 106, 0, 125, 96, 0, 111, 85, 0, 97, 72, 0, 83, 62, 0, 68, 49, 0, 52, 35, 0, 31, 15, 0, 0, 0,
- 0, 138, 88, 0, 124, 79, 0, 111, 70, 0, 96, 59, 0, 82, 48, 0, 68, 38, 0, 52, 24, 0, 31, 4, 0, 0, 0,
- 0, 139, 76, 0, 124, 66, 0, 111, 58, 0, 96, 50, 0, 82, 40, 0, 68, 29, 0, 52, 15, 0, 31, 0, 0, 0, 0,
- 0, 129, 200, 0, 114, 179, 0, 102, 160, 0, 87, 139, 0, 74, 120, 0, 60, 101, 0, 44, 81, 0, 22, 56, 0, 0, 19,
- 0, 127, 181, 0, 114, 163, 0, 102, 146, 0, 88, 127, 0, 74, 109, 0, 60, 91, 0, 44, 72, 0, 23, 48, 0, 0, 11,
- 0, 127, 166, 0, 113, 148, 0, 101, 133, 0, 87, 115, 0, 74, 99, 0, 60, 82, 0, 44, 64, 0, 23, 42, 0, 0, 4,
- 0, 127, 150, 0, 113, 134, 0, 101, 119, 0, 87, 104, 0, 74, 89, 0, 60, 73, 0, 44, 56, 0, 23, 35, 0, 0, 0,
- 0, 125, 134, 0, 112, 118, 0, 100, 106, 0, 87, 92, 0, 73, 78, 0, 60, 64, 0, 44, 48, 0, 23, 27, 0, 0, 0,
- 0, 125, 118, 0, 112, 105, 0, 100, 94, 0, 86, 80, 0, 73, 68, 0, 60, 54, 0, 44, 39, 0, 23, 20, 0, 0, 0,
- 0, 125, 101, 0, 111, 90, 0, 99, 80, 0, 86, 69, 0, 73, 58, 0, 59, 45, 0, 44, 30, 0, 23, 11, 0, 0, 0,
- 0, 124, 85, 0, 111, 75, 0, 99, 66, 0, 86, 56, 0, 73, 45, 0, 59, 34, 0, 44, 20, 0, 23, 1, 0, 0, 0,
- 0, 125, 72, 0, 111, 62, 0, 99, 56, 0, 86, 46, 0, 73, 36, 0, 60, 26, 0, 44, 12, 0, 23, 0, 0, 0, 0,
- 0, 114, 188, 0, 101, 167, 0, 89, 150, 0, 77, 131, 0, 64, 113, 0, 50, 95, 0, 34, 75, 0, 12, 52, 0, 0, 14,
- 0, 113, 170, 0, 101, 153, 0, 89, 137, 0, 77, 120, 0, 64, 102, 0, 50, 85, 0, 35, 67, 0, 12, 44, 0, 0, 4,
- 0, 113, 156, 0, 100, 139, 0, 89, 125, 0, 77, 109, 0, 64, 92, 0, 51, 77, 0, 35, 60, 0, 12, 38, 0, 0, 0,
- 0, 112, 141, 0, 100, 126, 0, 89, 113, 0, 77, 98, 0, 64, 83, 0, 51, 68, 0, 35, 51, 0, 12, 30, 0, 0, 0,
- 0, 112, 127, 0, 100, 112, 0, 89, 100, 0, 76, 87, 0, 64, 74, 0, 51, 59, 0, 35, 44, 0, 13, 24, 0, 0, 0,
- 0, 112, 111, 0, 100, 100, 0, 88, 88, 0, 76, 76, 0, 64, 64, 0, 51, 52, 0, 36, 37, 0, 13, 17, 0, 0, 0,
- 0, 111, 96, 0, 99, 85, 0, 88, 76, 0, 76, 64, 0, 64, 53, 0, 51, 41, 0, 36, 27, 0, 13, 6, 0, 0, 0,
- 0, 111, 81, 0, 99, 71, 0, 88, 62, 0, 76, 52, 0, 64, 43, 0, 51, 31, 0, 36, 17, 0, 13, 0, 0, 0, 0,
- 0, 111, 69, 0, 99, 60, 0, 88, 52, 0, 75, 43, 0, 63, 34, 0, 51, 21, 0, 36, 7, 0, 13, 0, 0, 0, 0,
- 0, 99, 177, 0, 88, 158, 0, 77, 141, 0, 66, 123, 0, 53, 106, 0, 40, 89, 0, 25, 71, 0, 5, 47, 0, 0, 8,
- 0, 99, 160, 0, 88, 144, 0, 77, 129, 0, 66, 112, 0, 54, 97, 0, 41, 80, 0, 26, 62, 0, 5, 40, 0, 0, 0,
- 0, 99, 147, 0, 87, 132, 0, 78, 117, 0, 66, 102, 0, 54, 87, 0, 42, 72, 0, 26, 55, 0, 5, 34, 0, 0, 0,
- 0, 99, 134, 0, 88, 119, 0, 77, 107, 0, 66, 92, 0, 54, 78, 0, 42, 64, 0, 27, 48, 0, 5, 27, 0, 0, 0,
- 0, 99, 120, 0, 87, 107, 0, 78, 94, 0, 66, 81, 0, 54, 68, 0, 42, 55, 0, 27, 40, 0, 6, 20, 0, 0, 0,
- 0, 98, 105, 0, 87, 94, 0, 77, 84, 0, 65, 71, 0, 55, 59, 0, 42, 47, 0, 28, 33, 0, 6, 12, 0, 0, 0,
- 0, 98, 93, 0, 87, 81, 0, 77, 72, 0, 66, 61, 0, 54, 49, 0, 42, 37, 0, 28, 24, 0, 6, 4, 0, 0, 0,
- 0, 98, 77, 0, 87, 68, 0, 77, 59, 0, 65, 49, 0, 54, 39, 0, 42, 27, 0, 29, 14, 0, 6, 0, 0, 0, 0,
- 1, 98, 65, 7, 87, 56, 0, 77, 49, 0, 66, 41, 0, 54, 30, 0, 42, 19, 0, 29, 3, 0, 6, 0, 0, 0, 0,
- 0, 84, 166, 0, 74, 149, 0, 64, 134, 0, 53, 117, 0, 41, 100, 0, 28, 83, 0, 11, 64, 0, 0, 42, 0, 0, 3,
- 0, 84, 151, 0, 74, 135, 0, 64, 121, 0, 53, 105, 0, 42, 90, 0, 30, 75, 0, 14, 58, 0, 0, 36, 0, 0, 0,
- 0, 84, 138, 0, 74, 124, 1, 64, 110, 0, 54, 95, 0, 43, 81, 0, 30, 67, 0, 15, 51, 0, 1, 29, 0, 0, 0,
- 14, 84, 126, 12, 74, 112, 2, 65, 99, 0, 54, 85, 0, 44, 73, 0, 31, 59, 0, 16, 44, 0, 1, 23, 0, 0, 0,
- 16, 84, 113, 13, 74, 100, 6, 65, 89, 0, 54, 77, 0, 44, 65, 0, 31, 51, 0, 17, 36, 0, 1, 16, 0, 0, 0,
- 24, 84, 100, 18, 74, 88, 13, 65, 78, 2, 55, 68, 0, 44, 55, 0, 32, 43, 0, 18, 28, 0, 1, 6, 0, 0, 0,
- 26, 84, 87, 24, 74, 76, 17, 65, 67, 7, 54, 57, 0, 44, 46, 0, 32, 35, 0, 19, 21, 0, 2, 3, 0, 0, 0,
- 30, 84, 74, 28, 74, 64, 20, 65, 55, 12, 55, 46, 0, 44, 35, 0, 32, 24, 0, 18, 9, 0, 1, 0, 0, 0, 0,
- 32, 84, 63, 28, 74, 54, 21, 65, 47, 13, 54, 38, 0, 44, 28, 0, 32, 16, 0, 18, 1, 0, 1, 0, 0, 0, 0,
- 30, 67, 155, 20, 58, 139, 20, 49, 126, 12, 39, 110, 0, 27, 94, 0, 13, 77, 0, 0, 60, 0, 0, 37, 0, 0, 0,
- 35, 67, 142, 30, 58, 126, 23, 50, 114, 16, 40, 99, 7, 29, 85, 0, 15, 69, 0, 0, 52, 0, 0, 30, 0, 0, 0,
- 35, 68, 131, 30, 59, 116, 27, 50, 104, 18, 40, 90, 9, 29, 76, 0, 17, 62, 0, 2, 46, 0, 0, 24, 0, 0, 0,
- 37, 69, 119, 33, 59, 106, 27, 51, 94, 21, 41, 80, 9, 30, 67, 0, 18, 54, 0, 3, 39, 0, 0, 18, 0, 0, 0,
- 40, 69, 107, 36, 59, 94, 28, 51, 84, 18, 41, 72, 10, 31, 60, 0, 19, 47, 0, 4, 32, 0, 0, 10, 0, 0, 0,
- 42, 69, 95, 36, 59, 84, 29, 51, 74, 19, 41, 63, 10, 31, 52, 0, 20, 39, 0, 4, 25, 0, 0, 4, 0, 0, 0,
- 43, 69, 83, 38, 60, 73, 32, 51, 62, 23, 42, 53, 11, 31, 42, 0, 20, 31, 0, 5, 17, 0, 0, 1, 0, 0, 0,
- 45, 69, 70, 39, 60, 60, 33, 51, 52, 24, 42, 43, 13, 32, 33, 0, 21, 21, 0, 5, 6, 0, 0, 0, 0, 0, 0,
- 47, 69, 59, 41, 60, 51, 34, 51, 43, 24, 42, 35, 12, 33, 26, 1, 22, 14, 0, 5, 1, 0, 0, 0, 0, 0, 0,
- 46, 48, 146, 42, 40, 131, 36, 32, 118, 27, 22, 103, 17, 6, 88, 5, 0, 73, 0, 0, 55, 0, 0, 33, 0, 0, 0,
- 48, 48, 133, 44, 40, 119, 37, 32, 107, 28, 22, 93, 20, 8, 79, 7, 0, 65, 0, 0, 49, 0, 0, 27, 0, 0, 0,
- 48, 50, 123, 44, 41, 109, 37, 33, 97, 30, 23, 83, 21, 11, 71, 8, 0, 58, 0, 0, 42, 0, 0, 21, 0, 0, 0,
- 49, 51, 111, 45, 42, 99, 38, 34, 87, 29, 25, 75, 20, 13, 63, 8, 0, 51, 0, 0, 36, 0, 0, 14, 0, 0, 0,
- 52, 52, 100, 44, 43, 89, 38, 35, 79, 29, 26, 68, 19, 15, 56, 10, 1, 43, 0, 0, 28, 0, 0, 6, 0, 0, 0,
- 52, 52, 90, 47, 44, 79, 39, 36, 70, 30, 27, 59, 20, 16, 47, 9, 2, 36, 0, 0, 22, 0, 0, 2, 0, 0, 0,
- 52, 53, 78, 46, 44, 68, 39, 37, 60, 32, 27, 49, 22, 17, 39, 10, 3, 28, 0, 0, 12, 0, 0, 0, 0, 0, 0,
- 53, 53, 66, 47, 44, 57, 40, 36, 48, 32, 27, 39, 22, 18, 30, 9, 4, 18, 0, 0, 3, 0, 0, 0, 0, 0, 0,
- 54, 53, 57, 48, 45, 49, 41, 37, 41, 33, 28, 32, 22, 19, 23, 11, 6, 10, 1, 0, 0, 0, 0, 0, 0, 0, 0,
-};
-void AdobeCMYK_to_sRGB1(FX_BYTE c, FX_BYTE m, FX_BYTE y, FX_BYTE k, FX_BYTE& R, FX_BYTE& G, FX_BYTE& B)
-{
- int fix_c = c << 8;
- int fix_m = m << 8;
- int fix_y = y << 8;
- int fix_k = k << 8;
- int c_index = (fix_c + 4096) >> 13;
- int m_index = (fix_m + 4096) >> 13;
- int y_index = (fix_y + 4096) >> 13;
- int k_index = (fix_k + 4096) >> 13;
- int pos = (c_index * 9 * 9 * 9 + m_index * 9 * 9 + y_index * 9 + k_index) * 3;
- int fix_r = g_CMYKSamples[pos] << 8;
- int fix_g = g_CMYKSamples[pos + 1] << 8;
- int fix_b = g_CMYKSamples[pos + 2] << 8;
- int c1_index = fix_c >> 13;
- if (c1_index == c_index) {
- c1_index = c1_index == 8 ? c1_index - 1 : c1_index + 1;
- }
- int m1_index = fix_m >> 13;
- if (m1_index == m_index) {
- m1_index = m1_index == 8 ? m1_index - 1 : m1_index + 1;
- }
- int y1_index = fix_y >> 13;
- if (y1_index == y_index) {
- y1_index = y1_index == 8 ? y1_index - 1 : y1_index + 1;
- }
- int k1_index = fix_k >> 13;
- if (k1_index == k_index) {
- k1_index = k1_index == 8 ? k1_index - 1 : k1_index + 1;
- }
- int c1_pos = pos + (c1_index - c_index) * 9 * 9 * 9 * 3;
- int m1_pos = pos + (m1_index - m_index) * 9 * 9 * 3;
- int y1_pos = pos + (y1_index - y_index) * 9 * 3;
- int k1_pos = pos + (k1_index - k_index) * 3;
- int c_r_delta = g_CMYKSamples[pos] - g_CMYKSamples[c1_pos];
- int c_g_delta = g_CMYKSamples[pos + 1] - g_CMYKSamples[c1_pos + 1];
- int c_b_delta = g_CMYKSamples[pos + 2] - g_CMYKSamples[c1_pos + 2];
- int m_r_delta = g_CMYKSamples[pos] - g_CMYKSamples[m1_pos];
- int m_g_delta = g_CMYKSamples[pos + 1] - g_CMYKSamples[m1_pos + 1];
- int m_b_delta = g_CMYKSamples[pos + 2] - g_CMYKSamples[m1_pos + 2];
- int y_r_delta = g_CMYKSamples[pos] - g_CMYKSamples[y1_pos];
- int y_g_delta = g_CMYKSamples[pos + 1] - g_CMYKSamples[y1_pos + 1];
- int y_b_delta = g_CMYKSamples[pos + 2] - g_CMYKSamples[y1_pos + 2];
- int k_r_delta = g_CMYKSamples[pos] - g_CMYKSamples[k1_pos];
- int k_g_delta = g_CMYKSamples[pos + 1] - g_CMYKSamples[k1_pos + 1];
- int k_b_delta = g_CMYKSamples[pos + 2] - g_CMYKSamples[k1_pos + 2];
- int c_rate = (fix_c - (c_index << 13)) * (c_index - c1_index);
- fix_r += c_r_delta * c_rate / 32;
- fix_g += c_g_delta * c_rate / 32;
- fix_b += c_b_delta * c_rate / 32;
- int m_rate = (fix_m - (m_index << 13)) * (m_index - m1_index);
- fix_r += m_r_delta * m_rate / 32;
- fix_g += m_g_delta * m_rate / 32;
- fix_b += m_b_delta * m_rate / 32;
- int y_rate = (fix_y - (y_index << 13)) * (y_index - y1_index);
- fix_r += y_r_delta * y_rate / 32;
- fix_g += y_g_delta * y_rate / 32;
- fix_b += y_b_delta * y_rate / 32;
- int k_rate = (fix_k - (k_index << 13)) * (k_index - k1_index);
- fix_r += k_r_delta * k_rate / 32;
- fix_g += k_g_delta * k_rate / 32;
- fix_b += k_b_delta * k_rate / 32;
- if (fix_r < 0) {
- fix_r = 0;
- }
- if (fix_g < 0) {
- fix_g = 0;
- }
- if (fix_b < 0) {
- fix_b = 0;
- }
- R = fix_r >> 8;
- G = fix_g >> 8;
- B = fix_b >> 8;
-}
-void AdobeCMYK_to_sRGB(FX_FLOAT c, FX_FLOAT m, FX_FLOAT y, FX_FLOAT k, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B)
-{
- FX_BYTE c1 = FXSYS_round(c * 255);
- FX_BYTE m1 = FXSYS_round(m * 255);
- FX_BYTE y1 = FXSYS_round(y * 255);
- FX_BYTE k1 = FXSYS_round(k * 255);
- FX_BYTE r, g, b;
- AdobeCMYK_to_sRGB1(c1, m1, y1, k1, r, g, b);
- R = 1.0f * r / 255;
- G = 1.0f * g / 255;
- B = 1.0f * b / 255;
-}
+// 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
+
+#include "../../../include/fxcodec/fx_codec.h"
+#include "codec_int.h"
+#include "../lcms2/include/fx_lcms2.h"
+FX_BOOL MD5ComputeID( FX_LPCVOID buf, FX_DWORD dwSize, FX_BYTE ID[16] )
+{
+ return cmsMD5computeIDExt(buf, dwSize, ID);
+}
+struct CLcmsCmm : public CFX_Object {
+ cmsHTRANSFORM m_hTransform;
+ int m_nSrcComponents;
+ int m_nDstComponents;
+ FX_BOOL m_bLab;
+};
+extern "C" {
+ int ourHandler(int ErrorCode, const char *ErrorText)
+ {
+ return TRUE;
+ }
+};
+FX_BOOL CheckComponents(cmsColorSpaceSignature cs, int nComponents, FX_BOOL bDst)
+{
+ if (nComponents <= 0 || nComponents > 15) {
+ return FALSE;
+ }
+ switch(cs) {
+ case cmsSigLabData:
+ if (nComponents < 3) {
+ return FALSE;
+ }
+ break;
+ case cmsSigGrayData:
+ if (bDst && nComponents != 1) {
+ return FALSE;
+ } else if (!bDst && nComponents > 2) {
+ return FALSE;
+ }
+ break;
+ case cmsSigRgbData:
+ if (bDst && nComponents != 3) {
+ return FALSE;
+ }
+ break;
+ case cmsSigCmykData:
+ if (bDst && nComponents != 4) {
+ return FALSE;
+ }
+ break;
+ default:
+ if (nComponents != 3) {
+ return FALSE;
+ }
+ break;
+ }
+ return TRUE;
+}
+void* IccLib_CreateTransform(const unsigned char* pSrcProfileData, unsigned int dwSrcProfileSize, int nSrcComponents,
+ const unsigned char* pDstProfileData, unsigned int dwDstProfileSize, int nDstComponents,
+ int intent, FX_DWORD dwSrcFormat = Icc_FORMAT_DEFAULT, FX_DWORD dwDstFormat = Icc_FORMAT_DEFAULT)
+{
+ cmsHPROFILE srcProfile = NULL;
+ cmsHPROFILE dstProfile = NULL;
+ cmsHTRANSFORM hTransform = NULL;
+ CLcmsCmm* pCmm = NULL;
+ srcProfile = cmsOpenProfileFromMem((void*)pSrcProfileData, dwSrcProfileSize);
+ if (srcProfile == NULL) {
+ return NULL;
+ }
+ if(pDstProfileData == NULL && dwDstProfileSize == 0 && nDstComponents == 3) {
+ dstProfile = cmsCreate_sRGBProfile();
+ } else {
+ dstProfile = cmsOpenProfileFromMem((void*)pDstProfileData, dwDstProfileSize);
+ }
+ if (dstProfile == NULL) {
+ cmsCloseProfile(srcProfile);
+ return NULL;
+ }
+ int srcFormat;
+ FX_BOOL bLab = FALSE;
+ cmsColorSpaceSignature srcCS = cmsGetColorSpace(srcProfile);
+ if (!CheckComponents(srcCS, nSrcComponents, FALSE)) {
+ cmsCloseProfile(srcProfile);
+ cmsCloseProfile(dstProfile);
+ return NULL;
+ }
+ if (srcCS == cmsSigLabData) {
+ srcFormat = COLORSPACE_SH(PT_Lab) | CHANNELS_SH(nSrcComponents) | BYTES_SH(0);
+ bLab = TRUE;
+ } else {
+ srcFormat = COLORSPACE_SH(PT_ANY) | CHANNELS_SH(nSrcComponents) | BYTES_SH(1);
+ if (srcCS == cmsSigRgbData && T_DOSWAP(dwSrcFormat)) {
+ srcFormat |= DOSWAP_SH(1);
+ }
+ }
+ cmsColorSpaceSignature dstCS = cmsGetColorSpace(dstProfile);
+ if (!CheckComponents(dstCS, nDstComponents, TRUE)) {
+ cmsCloseProfile(srcProfile);
+ cmsCloseProfile(dstProfile);
+ return NULL;
+ }
+ switch(dstCS) {
+ case cmsSigGrayData:
+ hTransform = cmsCreateTransform(srcProfile, srcFormat, dstProfile, TYPE_GRAY_8, intent, 0);
+ break;
+ case cmsSigRgbData:
+ hTransform = cmsCreateTransform(srcProfile, srcFormat, dstProfile, TYPE_BGR_8, intent, 0);
+ break;
+ case cmsSigCmykData:
+ hTransform = cmsCreateTransform(srcProfile, srcFormat, dstProfile,
+ T_DOSWAP(dwDstFormat) ? TYPE_KYMC_8 : TYPE_CMYK_8,
+ intent, 0);
+ break;
+ default:
+ break;
+ }
+ if (hTransform == NULL) {
+ cmsCloseProfile(srcProfile);
+ cmsCloseProfile(dstProfile);
+ return NULL;
+ }
+ pCmm = FX_NEW CLcmsCmm;
+ if (pCmm == NULL) {
+ return NULL;
+ }
+ pCmm->m_nSrcComponents = nSrcComponents;
+ pCmm->m_nDstComponents = nDstComponents;
+ pCmm->m_hTransform = hTransform;
+ pCmm->m_bLab = bLab;
+ cmsCloseProfile(srcProfile);
+ cmsCloseProfile(dstProfile);
+ return pCmm;
+}
+void* IccLib_CreateTransform_sRGB(const unsigned char* pProfileData, unsigned int dwProfileSize, int nComponents, int intent, FX_DWORD dwSrcFormat)
+{
+ return IccLib_CreateTransform(pProfileData, dwProfileSize, nComponents, NULL, 0, 3, intent, dwSrcFormat);
+}
+void IccLib_DestroyTransform(void* pTransform)
+{
+ if (pTransform == NULL) {
+ return;
+ }
+ cmsDeleteTransform(((CLcmsCmm*)pTransform)->m_hTransform);
+ delete (CLcmsCmm*)pTransform;
+}
+void IccLib_Translate(void* pTransform, FX_FLOAT* pSrcValues, FX_FLOAT* pDestValues)
+{
+ if (pTransform == NULL) {
+ return;
+ }
+ CLcmsCmm* p = (CLcmsCmm*)pTransform;
+ FX_BYTE output[4];
+ if (p->m_bLab) {
+ CFX_FixedBufGrow<double, 16> inputs(p->m_nSrcComponents);
+ double* input = inputs;
+ for (int i = 0; i < p->m_nSrcComponents; i ++) {
+ input[i] = pSrcValues[i];
+ }
+ cmsDoTransform(p->m_hTransform, input, output, 1);
+ } else {
+ CFX_FixedBufGrow<FX_BYTE, 16> inputs(p->m_nSrcComponents);
+ FX_BYTE* input = inputs;
+ for (int i = 0; i < p->m_nSrcComponents; i ++) {
+ if (pSrcValues[i] > 1.0f) {
+ input[i] = 255;
+ } else if (pSrcValues[i] < 0) {
+ input[i] = 0;
+ } else {
+ input[i] = (int)(pSrcValues[i] * 255.0f);
+ }
+ }
+ cmsDoTransform(p->m_hTransform, input, output, 1);
+ }
+ switch(p->m_nDstComponents) {
+ case 1:
+ pDestValues[0] = output[0] / 255.0f;
+ break;
+ case 3:
+ pDestValues[0] = output[2] / 255.0f;
+ pDestValues[1] = output[1] / 255.0f;
+ pDestValues[2] = output[0] / 255.0f;
+ break;
+ case 4:
+ pDestValues[0] = output[0] / 255.0f;
+ pDestValues[1] = output[1] / 255.0f;
+ pDestValues[2] = output[2] / 255.0f;
+ pDestValues[3] = output[3] / 255.0f;
+ break;
+ }
+}
+void IccLib_TranslateImage(void* pTransform, unsigned char* pDest, const unsigned char* pSrc, int pixels)
+{
+ cmsDoTransform(((CLcmsCmm*)pTransform)->m_hTransform, (void*)pSrc, pDest, pixels);
+}
+FX_LPVOID CreateProfile_Gray(double gamma)
+{
+ cmsCIExyY* D50 = (cmsCIExyY*)cmsD50_xyY();
+ if (!cmsWhitePointFromTemp(D50, 6504)) {
+ return NULL;
+ }
+ cmsToneCurve* curve = cmsBuildGamma(NULL, gamma);
+ if (curve == NULL) {
+ return NULL;
+ }
+ FX_LPVOID profile = cmsCreateGrayProfile(D50, curve);
+ cmsFreeToneCurve(curve);
+ return profile;
+}
+ICodec_IccModule::IccCS GetProfileCSFromHandle(FX_LPVOID pProfile)
+{
+ if (pProfile == NULL) {
+ return ICodec_IccModule::IccCS_Unknown;
+ }
+ switch (cmsGetColorSpace(pProfile)) {
+ case cmsSigXYZData:
+ return ICodec_IccModule::IccCS_XYZ;
+ case cmsSigLabData:
+ return ICodec_IccModule::IccCS_Lab;
+ case cmsSigLuvData:
+ return ICodec_IccModule::IccCS_Luv;
+ case cmsSigYCbCrData:
+ return ICodec_IccModule::IccCS_YCbCr;
+ case cmsSigYxyData:
+ return ICodec_IccModule::IccCS_Yxy;
+ case cmsSigRgbData:
+ return ICodec_IccModule::IccCS_Rgb;
+ case cmsSigGrayData:
+ return ICodec_IccModule::IccCS_Gray;
+ case cmsSigHsvData:
+ return ICodec_IccModule::IccCS_Hsv;
+ case cmsSigHlsData:
+ return ICodec_IccModule::IccCS_Hls;
+ case cmsSigCmykData:
+ return ICodec_IccModule::IccCS_Cmyk;
+ case cmsSigCmyData:
+ return ICodec_IccModule::IccCS_Cmy;
+ default:
+ return ICodec_IccModule::IccCS_Unknown;
+ }
+}
+ICodec_IccModule::IccCS CCodec_IccModule::GetProfileCS(FX_LPCBYTE pProfileData, unsigned int dwProfileSize)
+{
+ ICodec_IccModule::IccCS cs;
+ cmsHPROFILE hProfile = cmsOpenProfileFromMem((void*)pProfileData, dwProfileSize);
+ if (hProfile == NULL) {
+ return IccCS_Unknown;
+ }
+ cs = GetProfileCSFromHandle(hProfile);
+ if (hProfile) {
+ cmsCloseProfile(hProfile);
+ }
+ return cs;
+}
+ICodec_IccModule::IccCS CCodec_IccModule::GetProfileCS(IFX_FileRead* pFile)
+{
+ if (pFile == NULL) {
+ return IccCS_Unknown;
+ }
+ ICodec_IccModule::IccCS cs;
+ FX_DWORD dwSize = (FX_DWORD)pFile->GetSize();
+ FX_LPBYTE pBuf = FX_Alloc(FX_BYTE, dwSize);
+ if (pBuf == NULL) {
+ return IccCS_Unknown;
+ }
+ pFile->ReadBlock(pBuf, 0, dwSize);
+ cs = GetProfileCS(pBuf, dwSize);
+ FX_Free(pBuf);
+ return cs;
+}
+FX_DWORD TransferProfileType(FX_LPVOID pProfile, FX_DWORD dwFormat)
+{
+ cmsColorSpaceSignature cs = cmsGetColorSpace(pProfile);
+ switch (cs) {
+ case cmsSigXYZData:
+ return TYPE_XYZ_16;
+ case cmsSigLabData:
+ return TYPE_Lab_DBL;
+ case cmsSigLuvData:
+ return TYPE_YUV_8;
+ case cmsSigYCbCrData:
+ return TYPE_YCbCr_8;
+ case cmsSigYxyData:
+ return TYPE_Yxy_16;
+ case cmsSigRgbData:
+ return T_DOSWAP(dwFormat) ? TYPE_RGB_8 : TYPE_BGR_8;
+ case cmsSigGrayData:
+ return TYPE_GRAY_8;
+ case cmsSigHsvData:
+ return TYPE_HSV_8;
+ case cmsSigHlsData:
+ return TYPE_HLS_8;
+ case cmsSigCmykData:
+ return T_DOSWAP(dwFormat) ? TYPE_KYMC_8 : TYPE_CMYK_8;
+ case cmsSigCmyData:
+ return TYPE_CMY_8;
+ case cmsSigMCH5Data:
+ return T_DOSWAP(dwFormat) ? TYPE_KYMC5_8 : TYPE_CMYK5_8;
+ case cmsSigMCH6Data:
+ return TYPE_CMYK6_8;
+ case cmsSigMCH7Data:
+ return T_DOSWAP(dwFormat) ? TYPE_KYMC7_8 : TYPE_CMYK7_8;
+ case cmsSigMCH8Data:
+ return T_DOSWAP(dwFormat) ? TYPE_KYMC8_8 : TYPE_CMYK8_8;
+ case cmsSigMCH9Data:
+ return T_DOSWAP(dwFormat) ? TYPE_KYMC9_8 : TYPE_CMYK9_8;
+ case cmsSigMCHAData:
+ return T_DOSWAP(dwFormat) ? TYPE_KYMC10_8 : TYPE_CMYK10_8;
+ case cmsSigMCHBData:
+ return T_DOSWAP(dwFormat) ? TYPE_KYMC11_8 : TYPE_CMYK11_8;
+ case cmsSigMCHCData:
+ return T_DOSWAP(dwFormat) ? TYPE_KYMC12_8 : TYPE_CMYK12_8;
+ default:
+ return 0;
+ }
+}
+class CFX_IccProfileCache : public CFX_Object
+{
+public:
+ CFX_IccProfileCache();
+ ~CFX_IccProfileCache();
+ FX_LPVOID m_pProfile;
+ FX_DWORD m_dwRate;
+protected:
+ void Purge();
+};
+CFX_IccProfileCache::CFX_IccProfileCache()
+{
+ m_pProfile = NULL;
+ m_dwRate = 1;
+}
+CFX_IccProfileCache::~CFX_IccProfileCache()
+{
+ if (m_pProfile) {
+ cmsCloseProfile(m_pProfile);
+ }
+}
+void CFX_IccProfileCache::Purge()
+{
+}
+class CFX_IccTransformCache : public CFX_Object
+{
+public:
+ CFX_IccTransformCache(CLcmsCmm* pCmm = NULL);
+ ~CFX_IccTransformCache();
+ FX_LPVOID m_pIccTransform;
+ FX_DWORD m_dwRate;
+ CLcmsCmm* m_pCmm;
+protected:
+ void Purge();
+};
+CFX_IccTransformCache::CFX_IccTransformCache(CLcmsCmm* pCmm)
+{
+ m_pIccTransform = NULL;
+ m_dwRate = 1;
+ m_pCmm = pCmm;
+}
+CFX_IccTransformCache::~CFX_IccTransformCache()
+{
+ if (m_pIccTransform) {
+ cmsDeleteTransform(m_pIccTransform);
+ }
+ if (m_pCmm) {
+ FX_Free(m_pCmm);
+ }
+}
+void CFX_IccTransformCache::Purge()
+{
+}
+class CFX_ByteStringKey : public CFX_BinaryBuf
+{
+public:
+ CFX_ByteStringKey() : CFX_BinaryBuf() {}
+ CFX_ByteStringKey& operator << (FX_DWORD i);
+};
+CFX_ByteStringKey& CFX_ByteStringKey::operator << (FX_DWORD i)
+{
+ AppendBlock(&i, sizeof(FX_DWORD));
+ return *this;
+}
+FX_LPVOID CCodec_IccModule::CreateProfile(ICodec_IccModule::IccParam* pIccParam, Icc_CLASS ic, CFX_BinaryBuf* pTransformKey)
+{
+ CFX_IccProfileCache* pCache = NULL;
+ CFX_ByteStringKey key;
+ CFX_ByteString text;
+ key << pIccParam->ColorSpace << (pIccParam->dwProfileType | ic << 8);
+ FX_BYTE ID[16];
+ switch (pIccParam->dwProfileType) {
+ case Icc_PARAMTYPE_NONE:
+ return NULL;
+ case Icc_PARAMTYPE_BUFFER:
+ MD5ComputeID(pIccParam->pProfileData, pIccParam->dwProfileSize, ID);
+ break;
+ case Icc_PARAMTYPE_PARAM:
+ FXSYS_memset32(ID, 0, 16);
+ switch (pIccParam->ColorSpace) {
+ case IccCS_Gray:
+ text.Format("%lf", pIccParam->Gamma);
+ break;
+ default:
+ ;
+ }
+ MD5ComputeID(text.GetBuffer(0), text.GetLength(), ID);
+ break;
+ default:
+ ;
+ }
+ key.AppendBlock(ID, 16);
+ CFX_ByteString ProfileKey(key.GetBuffer(), key.GetSize());
+ ASSERT(pTransformKey);
+ pTransformKey->AppendBlock(ProfileKey.GetBuffer(0), ProfileKey.GetLength());
+ if (!m_MapProfile.Lookup(ProfileKey, (FX_LPVOID&)pCache)) {
+ pCache = FX_NEW CFX_IccProfileCache;
+ if (pCache == NULL) {
+ return NULL;
+ }
+ switch (pIccParam->dwProfileType) {
+ case Icc_PARAMTYPE_BUFFER:
+ pCache->m_pProfile = cmsOpenProfileFromMem(pIccParam->pProfileData, pIccParam->dwProfileSize);
+ break;
+ case Icc_PARAMTYPE_PARAM:
+ switch (pIccParam->ColorSpace) {
+ case IccCS_Rgb:
+ pCache->m_pProfile = cmsCreate_sRGBProfile();
+ break;
+ case IccCS_Gray:
+ pCache->m_pProfile = CreateProfile_Gray(pIccParam->Gamma);
+ break;
+ default:
+ break;
+ }
+ break;
+ default:
+ break;
+ }
+ m_MapProfile.SetAt(ProfileKey, pCache);
+ } else {
+ pCache->m_dwRate++;
+ }
+ return pCache->m_pProfile;
+}
+FX_LPVOID CCodec_IccModule::CreateTransform(ICodec_IccModule::IccParam* pInputParam,
+ ICodec_IccModule::IccParam* pOutputParam,
+ ICodec_IccModule::IccParam* pProofParam,
+ FX_DWORD dwIntent, FX_DWORD dwFlag, FX_DWORD dwPrfIntent, FX_DWORD dwPrfFlag)
+{
+ CLcmsCmm* pCmm = NULL;
+ ASSERT(pInputParam && pOutputParam);
+ CFX_ByteStringKey key;
+ FX_LPVOID pInputProfile = CreateProfile(pInputParam, Icc_CLASS_INPUT, &key);
+ if (pInputProfile == NULL) {
+ return NULL;
+ }
+ FX_LPVOID pOutputProfile = CreateProfile(pOutputParam, Icc_CLASS_OUTPUT, &key);
+ if (pOutputProfile == NULL) {
+ return NULL;
+ }
+ FX_DWORD dwInputProfileType = TransferProfileType(pInputProfile, pInputParam->dwFormat);
+ FX_DWORD dwOutputProfileType = TransferProfileType(pOutputProfile, pOutputParam->dwFormat);
+ if (dwInputProfileType == 0 || dwOutputProfileType == 0) {
+ return NULL;
+ }
+ FX_LPVOID pProofProfile = NULL;
+ if (pProofParam) {
+ pProofProfile = CreateProfile(pProofParam, Icc_CLASS_PROOF, &key);
+ }
+ key << dwInputProfileType << dwOutputProfileType << dwIntent << dwFlag << (pProofProfile != NULL) << dwPrfIntent << dwPrfFlag;
+ CFX_ByteStringC TransformKey(key.GetBuffer(), key.GetSize());
+ CFX_IccTransformCache* pTransformCache;
+ if (!m_MapTranform.Lookup(TransformKey, (FX_LPVOID&)pTransformCache)) {
+ pCmm = FX_Alloc(CLcmsCmm, 1);
+ if (pCmm == NULL) {
+ return NULL;
+ }
+ pCmm->m_nSrcComponents = T_CHANNELS(dwInputProfileType);
+ pCmm->m_nDstComponents = T_CHANNELS(dwOutputProfileType);
+ pCmm->m_bLab = T_COLORSPACE(pInputParam->dwFormat) == PT_Lab;
+ pTransformCache = FX_NEW CFX_IccTransformCache(pCmm);
+ if (pTransformCache == NULL) {
+ FX_Free(pCmm);
+ return NULL;
+ }
+ if (pProofProfile) {
+ pTransformCache->m_pIccTransform = cmsCreateProofingTransform(pInputProfile, dwInputProfileType, pOutputProfile, dwOutputProfileType,
+ pProofProfile, dwIntent, dwPrfIntent, dwPrfFlag);
+ } else {
+ pTransformCache->m_pIccTransform = cmsCreateTransform(pInputProfile, dwInputProfileType, pOutputProfile, dwOutputProfileType,
+ dwIntent, dwFlag);
+ }
+ pCmm->m_hTransform = pTransformCache->m_pIccTransform;
+ m_MapTranform.SetAt(TransformKey, pTransformCache);
+ } else {
+ pTransformCache->m_dwRate++;
+ }
+ return pTransformCache->m_pCmm;
+}
+CCodec_IccModule::~CCodec_IccModule()
+{
+ FX_POSITION pos = m_MapProfile.GetStartPosition();
+ CFX_ByteString key;
+ CFX_IccProfileCache* pProfileCache;
+ while (pos) {
+ m_MapProfile.GetNextAssoc(pos, key, (FX_LPVOID&)pProfileCache);
+ if (pProfileCache) {
+ delete pProfileCache;
+ }
+ }
+ pos = m_MapTranform.GetStartPosition();
+ CFX_IccTransformCache* pTransformCache;
+ while (pos) {
+ m_MapTranform.GetNextAssoc(pos, key, (FX_LPVOID&)pTransformCache);
+ if (pTransformCache) {
+ delete pTransformCache;
+ }
+ }
+}
+void* CCodec_IccModule::CreateTransform_sRGB(FX_LPCBYTE pProfileData, unsigned int dwProfileSize, int nComponents, int intent, FX_DWORD dwSrcFormat)
+{
+ return IccLib_CreateTransform_sRGB(pProfileData, dwProfileSize, nComponents, intent, dwSrcFormat);
+}
+void* CCodec_IccModule::CreateTransform_CMYK(FX_LPCBYTE pSrcProfileData, unsigned int dwSrcProfileSize, int nSrcComponents,
+ FX_LPCBYTE pDstProfileData, unsigned int dwDstProfileSize, int intent,
+ FX_DWORD dwSrcFormat , FX_DWORD dwDstFormat)
+{
+ return IccLib_CreateTransform(pSrcProfileData, dwSrcProfileSize, nSrcComponents,
+ pDstProfileData, dwDstProfileSize, 4, intent, dwSrcFormat, dwDstFormat);
+}
+void CCodec_IccModule::DestroyTransform(void* pTransform)
+{
+ IccLib_DestroyTransform(pTransform);
+}
+void CCodec_IccModule::Translate(void* pTransform, FX_FLOAT* pSrcValues, FX_FLOAT* pDestValues)
+{
+ IccLib_Translate(pTransform, pSrcValues, pDestValues);
+}
+void CCodec_IccModule::TranslateScanline(void* pTransform, FX_LPBYTE pDest, FX_LPCBYTE pSrc, int pixels)
+{
+ IccLib_TranslateImage(pTransform, pDest, pSrc, pixels);
+}
+const FX_BYTE g_CMYKSamples[81 * 81 * 3] = {
+ 255, 255, 255, 225, 226, 228, 199, 200, 202, 173, 174, 178, 147, 149, 152, 123, 125, 128, 99, 99, 102, 69, 70, 71, 34, 30, 31,
+ 255, 253, 229, 226, 224, 203, 200, 199, 182, 173, 173, 158, 149, 148, 135, 125, 124, 113, 99, 99, 90, 70, 69, 63, 33, 29, 24,
+ 255, 251, 204, 228, 223, 182, 201, 198, 163, 174, 172, 142, 150, 147, 122, 125, 123, 101, 99, 98, 80, 70, 68, 54, 32, 28, 16,
+ 255, 249, 179, 230, 222, 160, 203, 197, 144, 174, 170, 124, 150, 145, 105, 125, 122, 88, 99, 97, 69, 70, 68, 46, 31, 28, 6,
+ 255, 247, 154, 229, 220, 138, 203, 195, 122, 176, 169, 107, 150, 145, 91, 125, 121, 74, 100, 96, 57, 70, 67, 35, 29, 26, 0,
+ 255, 246, 128, 231, 217, 114, 205, 194, 101, 176, 167, 88, 150, 144, 75, 125, 120, 60, 100, 96, 44, 70, 66, 24, 28, 26, 0,
+ 255, 244, 96, 231, 217, 87, 203, 192, 78, 175, 167, 66, 150, 143, 56, 125, 119, 43, 100, 95, 29, 69, 66, 7, 26, 26, 0,
+ 255, 243, 51, 232, 215, 51, 204, 191, 43, 176, 165, 38, 150, 142, 28, 125, 118, 17, 99, 94, 0, 68, 65, 0, 24, 25, 0,
+ 255, 241, 0, 231, 215, 0, 203, 190, 0, 176, 164, 0, 150, 141, 0, 126, 117, 0, 99, 93, 0, 68, 65, 0, 24, 25, 0,
+ 252, 228, 238, 222, 201, 211, 197, 180, 190, 171, 156, 166, 147, 133, 143, 123, 111, 119, 99, 88, 94, 71, 61, 66, 34, 22, 26,
+ 254, 226, 213, 224, 201, 191, 199, 179, 171, 172, 155, 148, 147, 133, 128, 123, 110, 106, 98, 87, 83, 70, 59, 57, 33, 21, 18,
+ 254, 224, 191, 224, 199, 172, 200, 177, 153, 173, 154, 133, 147, 132, 115, 123, 109, 94, 98, 86, 74, 70, 59, 49, 32, 21, 9,
+ 255, 222, 168, 227, 198, 150, 200, 175, 135, 173, 153, 118, 148, 130, 99, 123, 109, 82, 98, 86, 64, 69, 58, 40, 31, 19, 0,
+ 255, 221, 145, 227, 196, 129, 201, 174, 115, 173, 151, 99, 148, 129, 85, 124, 108, 69, 98, 85, 52, 69, 58, 30, 30, 19, 0,
+ 255, 219, 121, 227, 195, 109, 201, 174, 97, 174, 150, 83, 148, 129, 70, 124, 107, 55, 98, 84, 40, 69, 58, 19, 28, 18, 0,
+ 255, 218, 92, 229, 194, 82, 202, 173, 75, 174, 150, 63, 149, 128, 51, 124, 106, 39, 98, 84, 24, 68, 57, 3, 26, 18, 0,
+ 255, 217, 54, 228, 193, 52, 201, 172, 46, 174, 148, 36, 148, 127, 27, 123, 105, 14, 98, 83, 0, 68, 56, 0, 25, 18, 0,
+ 255, 216, 0, 229, 192, 2, 202, 171, 4, 173, 148, 0, 148, 126, 0, 124, 105, 0, 98, 83, 0, 68, 56, 0, 24, 17, 0,
+ 249, 204, 223, 219, 181, 199, 195, 160, 178, 170, 140, 156, 146, 119, 134, 123, 99, 112, 98, 77, 88, 70, 52, 61, 34, 11, 20,
+ 250, 201, 200, 221, 180, 178, 197, 159, 161, 171, 139, 139, 147, 119, 120, 123, 98, 99, 98, 77, 78, 69, 51, 52, 34, 11, 10,
+ 252, 201, 180, 223, 179, 162, 197, 159, 144, 170, 138, 125, 146, 117, 107, 122, 97, 89, 98, 76, 69, 69, 50, 44, 32, 11, 2,
+ 252, 199, 158, 222, 177, 143, 199, 158, 127, 171, 137, 110, 147, 117, 93, 122, 96, 76, 97, 75, 58, 69, 50, 36, 32, 10, 0,
+ 253, 198, 137, 223, 177, 123, 198, 156, 110, 171, 136, 95, 146, 116, 80, 122, 96, 65, 97, 75, 47, 69, 50, 25, 30, 10, 0,
+ 254, 197, 115, 225, 175, 104, 198, 156, 92, 172, 135, 79, 147, 115, 66, 123, 95, 52, 98, 74, 37, 69, 49, 15, 29, 10, 0,
+ 254, 196, 89, 224, 175, 80, 199, 154, 70, 172, 134, 59, 146, 114, 48, 122, 95, 36, 97, 74, 21, 68, 49, 0, 27, 9, 0,
+ 255, 195, 57, 225, 173, 52, 198, 154, 44, 172, 133, 36, 147, 113, 26, 123, 94, 14, 98, 74, 0, 68, 49, 0, 26, 10, 0,
+ 254, 194, 15, 225, 172, 12, 198, 153, 7, 172, 132, 3, 146, 113, 0, 123, 93, 0, 98, 73, 0, 68, 49, 0, 26, 9, 0,
+ 246, 178, 209, 218, 159, 186, 194, 140, 166, 168, 122, 145, 144, 104, 125, 121, 85, 103, 97, 65, 81, 69, 41, 55, 34, 0, 12,
+ 248, 176, 186, 219, 157, 166, 195, 139, 149, 168, 121, 130, 144, 103, 111, 121, 85, 91, 97, 65, 71, 69, 41, 46, 34, 0, 4,
+ 249, 175, 168, 220, 156, 150, 196, 139, 135, 169, 121, 116, 144, 103, 100, 122, 84, 83, 98, 65, 63, 70, 41, 39, 33, 0, 0,
+ 249, 175, 148, 220, 155, 133, 196, 138, 119, 169, 120, 103, 145, 101, 87, 121, 83, 71, 97, 65, 54, 69, 41, 31, 32, 0, 0,
+ 249, 173, 128, 222, 154, 115, 195, 137, 102, 170, 119, 88, 145, 101, 74, 122, 83, 59, 97, 64, 43, 68, 40, 20, 30, 0, 0,
+ 250, 172, 108, 221, 154, 98, 195, 136, 86, 170, 118, 73, 145, 100, 61, 122, 82, 48, 97, 63, 32, 69, 40, 11, 28, 0, 0,
+ 250, 171, 85, 221, 153, 76, 196, 136, 67, 170, 117, 56, 145, 99, 44, 121, 82, 33, 97, 63, 17, 68, 40, 0, 28, 0, 0,
+ 251, 171, 58, 222, 152, 50, 197, 135, 43, 169, 117, 34, 146, 99, 25, 121, 81, 10, 96, 63, 0, 68, 40, 0, 27, 0, 0,
+ 250, 170, 26, 222, 151, 19, 196, 134, 13, 169, 116, 4, 145, 99, 0, 122, 81, 0, 97, 63, 0, 67, 40, 0, 26, 0, 0,
+ 244, 153, 194, 215, 136, 173, 192, 121, 155, 167, 104, 135, 143, 89, 115, 121, 72, 96, 97, 54, 75, 70, 31, 49, 34, 0, 6,
+ 245, 153, 173, 216, 136, 155, 192, 120, 138, 167, 104, 121, 144, 88, 103, 121, 71, 85, 97, 54, 66, 69, 31, 42, 34, 0, 0,
+ 246, 152, 157, 217, 135, 140, 193, 120, 126, 167, 103, 109, 143, 88, 92, 121, 72, 76, 97, 54, 58, 69, 31, 35, 33, 0, 0,
+ 245, 150, 139, 218, 134, 125, 193, 119, 111, 167, 103, 96, 144, 87, 80, 121, 71, 66, 96, 53, 49, 68, 31, 26, 32, 0, 0,
+ 246, 151, 122, 218, 133, 108, 194, 118, 96, 168, 102, 81, 144, 86, 69, 120, 71, 55, 95, 53, 39, 68, 30, 17, 31, 0, 0,
+ 248, 150, 103, 218, 133, 91, 193, 118, 81, 168, 102, 69, 143, 86, 56, 120, 70, 43, 96, 53, 28, 68, 31, 6, 29, 0, 0,
+ 247, 149, 81, 218, 132, 72, 194, 117, 62, 168, 101, 52, 144, 86, 42, 121, 70, 29, 96, 52, 13, 68, 30, 0, 28, 0, 0,
+ 247, 148, 55, 219, 131, 50, 194, 117, 43, 167, 101, 32, 144, 85, 22, 120, 69, 8, 96, 52, 0, 67, 30, 0, 27, 0, 0,
+ 247, 147, 29, 218, 131, 24, 194, 116, 20, 168, 100, 11, 144, 85, 0, 120, 69, 0, 96, 52, 0, 67, 30, 0, 26, 0, 0,
+ 242, 130, 179, 214, 114, 160, 190, 101, 143, 166, 87, 125, 143, 72, 107, 120, 58, 88, 96, 42, 68, 69, 17, 44, 35, 0, 0,
+ 243, 129, 161, 215, 114, 143, 191, 101, 128, 166, 87, 113, 143, 73, 96, 120, 58, 79, 96, 41, 60, 69, 18, 37, 33, 0, 0,
+ 243, 129, 146, 216, 114, 130, 192, 101, 117, 166, 87, 101, 143, 72, 86, 121, 58, 69, 96, 42, 52, 69, 18, 29, 31, 0, 0,
+ 243, 128, 130, 216, 114, 115, 191, 101, 102, 165, 86, 88, 142, 72, 75, 120, 58, 60, 95, 42, 43, 68, 19, 21, 30, 0, 0,
+ 244, 127, 112, 217, 113, 101, 192, 99, 89, 166, 85, 75, 142, 72, 63, 119, 57, 50, 96, 41, 35, 68, 19, 13, 30, 0, 0,
+ 244, 127, 96, 216, 112, 86, 191, 99, 75, 166, 86, 64, 143, 72, 52, 120, 57, 40, 95, 41, 24, 67, 20, 1, 29, 0, 0,
+ 245, 126, 77, 216, 113, 68, 191, 100, 59, 166, 85, 49, 142, 71, 38, 119, 57, 26, 95, 41, 10, 67, 20, 0, 28, 0, 0,
+ 244, 126, 55, 216, 112, 48, 191, 99, 40, 166, 85, 31, 143, 71, 20, 119, 57, 6, 95, 42, 0, 67, 20, 0, 28, 0, 0,
+ 245, 126, 33, 217, 112, 26, 192, 99, 22, 166, 84, 11, 142, 70, 0, 119, 57, 0, 95, 41, 0, 66, 20, 0, 27, 0, 0,
+ 241, 102, 167, 213, 90, 149, 189, 79, 133, 165, 66, 115, 141, 54, 98, 119, 41, 81, 96, 25, 63, 69, 0, 38, 30, 0, 0,
+ 241, 102, 149, 213, 90, 133, 189, 79, 119, 165, 66, 103, 142, 55, 88, 119, 41, 71, 96, 25, 53, 69, 0, 31, 28, 0, 0,
+ 241, 102, 135, 214, 90, 121, 190, 79, 108, 165, 66, 92, 141, 55, 78, 119, 42, 63, 96, 26, 46, 69, 0, 24, 28, 0, 0,
+ 241, 101, 120, 214, 90, 107, 189, 79, 95, 165, 67, 83, 141, 54, 68, 118, 41, 54, 95, 27, 39, 68, 0, 16, 27, 0, 0,
+ 241, 102, 106, 213, 90, 93, 189, 78, 82, 164, 67, 70, 141, 55, 58, 118, 42, 45, 94, 27, 29, 67, 2, 6, 27, 0, 0,
+ 242, 101, 90, 214, 89, 79, 190, 79, 69, 166, 67, 59, 141, 55, 47, 118, 41, 35, 95, 27, 19, 67, 3, 0, 26, 0, 0,
+ 242, 102, 72, 213, 89, 63, 191, 79, 56, 164, 67, 45, 141, 55, 34, 118, 42, 22, 94, 28, 6, 67, 3, 0, 26, 0, 0,
+ 242, 100, 51, 214, 89, 45, 190, 78, 38, 164, 67, 30, 141, 55, 18, 118, 42, 3, 95, 28, 0, 66, 4, 0, 26, 0, 0,
+ 243, 100, 33, 214, 90, 27, 190, 78, 22, 165, 67, 13, 141, 55, 0, 118, 43, 0, 94, 29, 0, 66, 5, 0, 26, 0, 0,
+ 237, 69, 153, 211, 58, 135, 187, 51, 121, 163, 41, 105, 141, 28, 90, 118, 15, 73, 96, 0, 56, 68, 0, 33, 25, 0, 0,
+ 239, 67, 137, 212, 60, 123, 189, 50, 110, 163, 41, 94, 141, 29, 79, 118, 17, 65, 95, 0, 48, 69, 0, 26, 25, 0, 0,
+ 240, 69, 124, 211, 60, 111, 188, 50, 98, 163, 42, 85, 141, 31, 72, 118, 18, 57, 94, 0, 41, 68, 0, 19, 25, 0, 0,
+ 240, 70, 112, 212, 61, 99, 188, 52, 87, 163, 41, 74, 140, 31, 62, 118, 20, 48, 94, 2, 32, 68, 0, 11, 24, 0, 0,
+ 239, 70, 98, 212, 62, 86, 188, 53, 77, 164, 42, 64, 140, 32, 52, 118, 20, 40, 94, 3, 24, 67, 0, 3, 23, 0, 0,
+ 239, 71, 85, 212, 61, 74, 187, 53, 65, 163, 44, 54, 140, 34, 43, 118, 22, 30, 95, 3, 14, 67, 0, 0, 23, 0, 0,
+ 239, 70, 67, 212, 62, 59, 188, 53, 51, 163, 45, 42, 141, 34, 31, 117, 22, 17, 94, 5, 2, 66, 0, 0, 23, 0, 0,
+ 239, 71, 50, 213, 62, 43, 188, 54, 37, 164, 45, 28, 139, 34, 16, 117, 22, 2, 94, 7, 0, 65, 0, 0, 23, 0, 0,
+ 240, 71, 34, 212, 63, 29, 189, 54, 24, 163, 46, 15, 139, 36, 2, 117, 25, 0, 94, 8, 0, 66, 0, 0, 23, 0, 0,
+ 237, 0, 140, 209, 0, 124, 186, 0, 112, 162, 0, 97, 141, 0, 82, 118, 0, 67, 95, 0, 49, 68, 0, 27, 20, 0, 0,
+ 237, 0, 126, 210, 0, 113, 187, 0, 99, 163, 0, 86, 139, 0, 72, 118, 0, 58, 95, 0, 42, 67, 0, 20, 20, 0, 0,
+ 237, 1, 114, 209, 1, 102, 187, 0, 90, 163, 0, 78, 139, 0, 64, 118, 0, 50, 95, 0, 35, 67, 0, 13, 20, 0, 0,
+ 236, 16, 102, 209, 7, 91, 186, 0, 80, 162, 0, 68, 139, 0, 56, 117, 0, 43, 94, 0, 27, 67, 0, 6, 20, 0, 0,
+ 238, 15, 89, 209, 13, 79, 186, 6, 69, 162, 0, 58, 139, 0, 47, 117, 0, 34, 93, 0, 20, 66, 0, 2, 20, 0, 0,
+ 237, 20, 78, 210, 12, 68, 187, 4, 59, 163, 0, 49, 139, 0, 38, 116, 0, 26, 94, 0, 11, 66, 0, 0, 20, 0, 0,
+ 237, 25, 64, 210, 18, 56, 186, 11, 48, 162, 4, 39, 138, 0, 27, 117, 0, 14, 93, 0, 0, 66, 0, 0, 20, 0, 0,
+ 238, 25, 48, 210, 22, 43, 186, 15, 35, 162, 8, 26, 140, 0, 14, 117, 0, 0, 93, 0, 0, 65, 0, 0, 20, 0, 0,
+ 238, 28, 35, 210, 21, 30, 187, 15, 24, 162, 8, 16, 139, 1, 2, 117, 0, 0, 93, 0, 0, 65, 0, 0, 22, 0, 0,
+ 219, 242, 252, 195, 214, 225, 172, 191, 201, 148, 165, 175, 127, 142, 150, 106, 119, 126, 84, 95, 101, 58, 66, 72, 24, 27, 32,
+ 222, 239, 226, 196, 213, 202, 173, 189, 180, 150, 165, 158, 129, 141, 135, 107, 118, 113, 85, 94, 90, 58, 66, 63, 21, 26, 24,
+ 223, 237, 203, 198, 211, 182, 175, 188, 163, 152, 164, 141, 129, 140, 121, 107, 117, 101, 85, 93, 80, 58, 64, 54, 21, 26, 18,
+ 226, 236, 179, 201, 210, 160, 177, 187, 143, 153, 162, 125, 130, 139, 106, 108, 116, 89, 85, 92, 69, 58, 64, 45, 20, 25, 8,
+ 227, 234, 153, 201, 208, 139, 178, 185, 124, 154, 161, 107, 131, 138, 91, 108, 115, 75, 85, 91, 58, 58, 63, 35, 17, 25, 0,
+ 229, 233, 130, 203, 207, 116, 178, 184, 104, 154, 160, 90, 131, 137, 76, 109, 114, 62, 85, 90, 46, 58, 63, 25, 16, 24, 0,
+ 230, 231, 100, 202, 205, 90, 179, 183, 80, 154, 159, 69, 131, 136, 57, 109, 113, 46, 86, 90, 32, 58, 63, 10, 14, 24, 0,
+ 230, 230, 65, 204, 204, 58, 180, 182, 52, 155, 157, 44, 132, 135, 35, 110, 113, 24, 86, 89, 9, 57, 62, 0, 11, 24, 0,
+ 232, 230, 19, 204, 204, 19, 180, 181, 17, 155, 157, 10, 131, 134, 2, 109, 112, 0, 85, 89, 0, 57, 62, 0, 10, 23, 0,
+ 218, 216, 236, 194, 192, 211, 172, 171, 188, 149, 149, 164, 128, 127, 141, 106, 106, 119, 84, 84, 94, 59, 57, 66, 25, 18, 26,
+ 221, 214, 211, 196, 191, 190, 174, 170, 170, 150, 148, 148, 128, 126, 127, 107, 105, 106, 85, 83, 84, 59, 56, 58, 23, 17, 18,
+ 222, 213, 190, 197, 189, 170, 175, 169, 153, 151, 147, 133, 129, 126, 113, 108, 105, 94, 85, 82, 74, 59, 56, 49, 22, 17, 11,
+ 224, 211, 168, 199, 188, 151, 175, 168, 135, 152, 146, 117, 129, 124, 99, 107, 103, 82, 84, 82, 64, 59, 55, 41, 21, 17, 1,
+ 224, 210, 145, 199, 187, 130, 176, 166, 117, 152, 145, 101, 129, 123, 86, 107, 103, 70, 85, 81, 53, 58, 55, 31, 19, 17, 0,
+ 227, 208, 123, 200, 186, 110, 177, 165, 98, 153, 143, 84, 130, 122, 70, 108, 102, 57, 85, 80, 41, 58, 54, 20, 18, 16, 0,
+ 227, 208, 97, 202, 185, 86, 177, 164, 77, 153, 142, 65, 130, 122, 54, 108, 101, 42, 85, 80, 27, 58, 54, 7, 16, 16, 0,
+ 228, 206, 66, 202, 184, 58, 178, 163, 50, 154, 141, 42, 131, 121, 33, 109, 101, 21, 86, 79, 5, 58, 54, 0, 13, 16, 0,
+ 228, 206, 29, 202, 183, 25, 178, 163, 20, 154, 141, 15, 131, 121, 5, 108, 100, 0, 85, 79, 0, 58, 53, 0, 13, 16, 0,
+ 217, 193, 221, 193, 172, 198, 172, 153, 178, 149, 133, 154, 128, 114, 132, 107, 94, 111, 85, 74, 89, 59, 49, 61, 25, 8, 22,
+ 219, 191, 198, 195, 171, 178, 173, 153, 159, 149, 132, 139, 128, 113, 119, 107, 94, 100, 85, 73, 79, 59, 48, 52, 25, 7, 14,
+ 221, 191, 180, 196, 170, 160, 174, 152, 144, 150, 132, 125, 129, 113, 107, 107, 93, 89, 85, 73, 69, 59, 48, 45, 23, 7, 4,
+ 222, 189, 159, 197, 169, 142, 174, 151, 127, 151, 131, 110, 129, 112, 94, 108, 93, 78, 85, 72, 60, 58, 47, 37, 22, 7, 0,
+ 223, 188, 138, 197, 168, 123, 175, 150, 109, 151, 130, 95, 130, 111, 81, 108, 92, 65, 85, 72, 49, 59, 47, 27, 21, 7, 0,
+ 224, 187, 118, 198, 167, 105, 176, 149, 93, 152, 129, 79, 130, 110, 68, 108, 91, 54, 85, 71, 38, 59, 47, 17, 18, 7, 0,
+ 224, 187, 93, 199, 166, 83, 176, 148, 73, 152, 128, 62, 129, 109, 51, 108, 90, 39, 85, 71, 25, 58, 46, 3, 16, 8, 0,
+ 226, 186, 64, 200, 165, 57, 177, 147, 50, 153, 127, 40, 130, 108, 31, 108, 90, 19, 85, 70, 3, 58, 46, 0, 16, 8, 0,
+ 227, 185, 35, 200, 165, 30, 176, 146, 25, 152, 127, 18, 130, 108, 7, 108, 89, 0, 85, 70, 0, 57, 46, 0, 14, 8, 0,
+ 216, 169, 205, 192, 150, 184, 171, 134, 164, 149, 116, 144, 128, 99, 124, 107, 81, 103, 85, 63, 81, 60, 39, 55, 26, 0, 15,
+ 217, 168, 186, 193, 150, 165, 172, 134, 149, 150, 116, 130, 128, 99, 111, 107, 81, 92, 85, 62, 72, 59, 39, 47, 25, 0, 6,
+ 219, 168, 168, 194, 149, 150, 173, 133, 135, 150, 116, 117, 128, 98, 99, 107, 80, 82, 86, 62, 63, 59, 38, 39, 24, 0, 0,
+ 219, 166, 148, 195, 149, 133, 173, 133, 119, 150, 115, 103, 128, 98, 88, 107, 80, 72, 85, 61, 54, 59, 38, 32, 23, 0, 0,
+ 220, 166, 129, 196, 148, 116, 174, 132, 103, 151, 114, 89, 129, 97, 75, 107, 79, 60, 85, 61, 44, 59, 38, 22, 21, 0, 0,
+ 222, 164, 110, 197, 147, 99, 175, 131, 87, 151, 113, 75, 129, 96, 63, 107, 79, 49, 85, 61, 33, 58, 38, 12, 19, 0, 0,
+ 222, 164, 88, 197, 146, 79, 174, 130, 69, 151, 113, 58, 129, 95, 47, 107, 78, 35, 85, 60, 20, 58, 38, 0, 18, 0, 0,
+ 223, 164, 63, 198, 145, 55, 175, 129, 48, 151, 112, 39, 129, 95, 29, 107, 78, 16, 85, 60, 1, 58, 38, 0, 17, 0, 0,
+ 223, 163, 36, 198, 145, 32, 174, 129, 26, 151, 111, 17, 129, 95, 7, 107, 78, 0, 84, 60, 0, 57, 37, 0, 15, 0, 0,
+ 215, 147, 192, 191, 130, 172, 170, 116, 153, 148, 100, 133, 127, 85, 115, 107, 69, 96, 85, 51, 75, 60, 28, 50, 25, 0, 8,
+ 217, 146, 173, 192, 130, 154, 171, 115, 138, 149, 100, 121, 128, 84, 103, 107, 68, 85, 85, 51, 66, 60, 28, 42, 25, 0, 0,
+ 217, 145, 157, 193, 129, 140, 173, 115, 125, 149, 100, 109, 128, 84, 92, 107, 68, 76, 85, 51, 58, 59, 28, 35, 23, 0, 0,
+ 218, 145, 140, 193, 129, 125, 172, 114, 110, 149, 99, 96, 128, 83, 81, 107, 67, 65, 84, 51, 49, 59, 29, 27, 22, 0, 0,
+ 219, 144, 121, 194, 128, 108, 172, 113, 96, 149, 98, 83, 128, 83, 69, 107, 68, 55, 85, 50, 40, 59, 28, 18, 20, 0, 0,
+ 220, 143, 104, 195, 128, 93, 173, 114, 82, 150, 98, 69, 127, 82, 58, 107, 67, 45, 85, 50, 30, 59, 28, 7, 19, 0, 0,
+ 220, 143, 84, 195, 127, 74, 173, 113, 65, 149, 97, 55, 128, 82, 44, 106, 67, 32, 84, 50, 16, 58, 28, 0, 18, 0, 0,
+ 221, 142, 62, 196, 126, 53, 173, 112, 46, 150, 97, 37, 128, 82, 26, 107, 66, 14, 84, 50, 0, 58, 28, 0, 16, 0, 0,
+ 222, 142, 38, 196, 126, 34, 174, 112, 27, 150, 96, 17, 128, 82, 6, 106, 66, 0, 84, 50, 0, 57, 29, 0, 16, 0, 0,
+ 214, 123, 179, 191, 110, 159, 169, 98, 143, 147, 84, 124, 126, 70, 106, 107, 55, 88, 85, 39, 69, 60, 15, 45, 23, 0, 2,
+ 216, 123, 161, 192, 110, 144, 170, 98, 129, 148, 84, 112, 127, 70, 95, 107, 55, 79, 85, 39, 61, 60, 15, 37, 20, 0, 0,
+ 217, 122, 145, 192, 110, 130, 170, 97, 116, 149, 84, 101, 127, 70, 85, 106, 55, 70, 85, 39, 53, 59, 16, 30, 19, 0, 0,
+ 217, 123, 131, 192, 109, 116, 171, 96, 103, 149, 83, 89, 127, 70, 75, 106, 55, 60, 85, 40, 45, 59, 16, 23, 17, 0, 0,
+ 217, 122, 114, 193, 109, 101, 172, 96, 91, 149, 82, 77, 128, 69, 64, 106, 55, 50, 84, 39, 35, 59, 17, 14, 17, 0, 0,
+ 218, 122, 98, 194, 108, 87, 171, 96, 77, 149, 82, 65, 127, 69, 52, 106, 55, 40, 84, 40, 25, 59, 18, 3, 15, 0, 0,
+ 219, 122, 80, 193, 108, 70, 172, 95, 61, 149, 82, 51, 127, 69, 40, 106, 55, 28, 84, 39, 12, 58, 17, 0, 13, 0, 0,
+ 219, 121, 59, 194, 108, 52, 172, 96, 44, 149, 82, 35, 127, 68, 24, 106, 55, 11, 84, 40, 0, 57, 18, 0, 13, 0, 0,
+ 219, 121, 40, 193, 108, 33, 172, 95, 26, 149, 81, 19, 128, 68, 6, 106, 54, 0, 84, 39, 0, 57, 18, 0, 13, 0, 0,
+ 213, 99, 165, 189, 87, 148, 169, 76, 132, 147, 64, 115, 126, 52, 98, 106, 39, 81, 85, 23, 63, 60, 0, 39, 16, 0, 0,
+ 214, 98, 149, 191, 87, 133, 170, 76, 119, 148, 65, 103, 127, 53, 88, 106, 39, 72, 85, 24, 55, 60, 0, 32, 15, 0, 0,
+ 215, 99, 136, 191, 87, 121, 170, 77, 108, 148, 65, 93, 126, 53, 79, 106, 40, 64, 85, 24, 47, 59, 0, 25, 14, 0, 0,
+ 215, 99, 121, 192, 87, 108, 170, 77, 96, 148, 65, 82, 126, 53, 69, 106, 40, 55, 85, 25, 39, 59, 0, 18, 13, 0, 0,
+ 216, 99, 106, 191, 87, 95, 170, 76, 83, 148, 65, 71, 126, 53, 58, 106, 41, 45, 85, 26, 30, 59, 0, 8, 11, 0, 0,
+ 216, 98, 91, 192, 88, 82, 170, 77, 71, 148, 65, 60, 127, 53, 48, 105, 41, 36, 83, 26, 21, 58, 1, 2, 11, 0, 0,
+ 217, 99, 75, 192, 87, 66, 170, 76, 57, 148, 65, 47, 126, 53, 36, 105, 41, 24, 83, 26, 8, 57, 2, 0, 9, 0, 0,
+ 217, 98, 57, 192, 87, 49, 171, 77, 41, 147, 65, 32, 126, 53, 21, 105, 41, 8, 84, 27, 0, 57, 3, 0, 9, 0, 0,
+ 217, 98, 40, 193, 87, 34, 171, 76, 27, 148, 65, 19, 126, 53, 6, 105, 41, 0, 83, 27, 0, 57, 4, 0, 9, 0, 0,
+ 211, 67, 152, 189, 58, 136, 168, 50, 122, 147, 39, 105, 127, 28, 89, 106, 14, 74, 85, 0, 56, 59, 0, 33, 9, 0, 0,
+ 213, 68, 138, 190, 59, 123, 169, 51, 109, 148, 40, 95, 126, 30, 80, 106, 16, 65, 85, 0, 48, 59, 0, 27, 9, 0, 0,
+ 214, 69, 125, 190, 59, 111, 168, 51, 99, 148, 41, 86, 126, 31, 72, 106, 18, 58, 85, 0, 41, 59, 0, 20, 7, 0, 0,
+ 215, 70, 112, 190, 61, 100, 169, 52, 88, 147, 42, 76, 126, 32, 63, 106, 19, 49, 84, 1, 34, 58, 0, 13, 7, 0, 0,
+ 214, 70, 99, 190, 62, 88, 169, 53, 77, 147, 43, 65, 125, 32, 53, 106, 20, 40, 84, 3, 26, 58, 0, 4, 7, 0, 0,
+ 214, 71, 86, 190, 61, 75, 169, 53, 65, 146, 43, 54, 126, 33, 44, 105, 21, 31, 83, 4, 17, 57, 0, 0, 7, 0, 0,
+ 215, 71, 71, 191, 62, 62, 169, 53, 53, 147, 44, 44, 126, 34, 33, 105, 22, 20, 83, 5, 4, 57, 0, 0, 7, 0, 0,
+ 215, 71, 54, 191, 62, 47, 169, 54, 39, 147, 44, 30, 126, 35, 20, 105, 23, 6, 83, 6, 0, 56, 0, 0, 5, 0, 0,
+ 215, 71, 41, 191, 63, 34, 170, 54, 27, 147, 45, 17, 126, 35, 6, 105, 23, 0, 83, 8, 0, 56, 0, 0, 5, 0, 0,
+ 210, 13, 140, 189, 1, 125, 167, 0, 110, 146, 0, 96, 126, 0, 81, 106, 0, 67, 85, 0, 51, 59, 0, 28, 4, 0, 0,
+ 212, 18, 126, 190, 7, 113, 168, 0, 100, 146, 0, 86, 126, 0, 73, 106, 0, 59, 84, 0, 43, 59, 0, 22, 4, 0, 0,
+ 212, 21, 115, 190, 13, 103, 168, 3, 91, 146, 0, 78, 125, 0, 65, 105, 0, 52, 84, 0, 36, 58, 0, 16, 4, 0, 0,
+ 213, 24, 103, 189, 19, 91, 168, 9, 82, 146, 0, 69, 125, 0, 57, 105, 0, 44, 84, 0, 29, 58, 0, 7, 4, 0, 0,
+ 213, 27, 92, 188, 21, 81, 168, 14, 71, 146, 1, 59, 125, 0, 48, 105, 0, 36, 84, 0, 21, 58, 0, 4, 4, 0, 0,
+ 213, 30, 80, 189, 22, 69, 168, 17, 61, 146, 5, 50, 125, 0, 39, 104, 0, 27, 83, 0, 12, 57, 0, 0, 4, 0, 0,
+ 214, 30, 67, 189, 25, 57, 168, 20, 50, 146, 9, 40, 125, 0, 29, 104, 0, 17, 83, 0, 2, 56, 0, 0, 4, 0, 0,
+ 214, 32, 53, 189, 27, 44, 169, 20, 38, 146, 13, 28, 124, 2, 17, 104, 0, 4, 83, 0, 0, 56, 0, 0, 4, 0, 0,
+ 214, 33, 41, 190, 27, 33, 168, 23, 27, 146, 13, 18, 125, 3, 5, 105, 0, 0, 83, 0, 0, 56, 0, 0, 4, 0, 0,
+ 185, 229, 250, 164, 204, 223, 146, 182, 199, 127, 158, 174, 108, 136, 149, 89, 113, 125, 70, 90, 100, 46, 62, 71, 10, 25, 33,
+ 189, 227, 225, 168, 202, 201, 148, 181, 179, 129, 157, 156, 109, 135, 134, 90, 113, 113, 70, 89, 90, 46, 62, 62, 8, 24, 25,
+ 192, 226, 202, 170, 202, 182, 151, 179, 162, 130, 156, 141, 110, 133, 121, 91, 112, 101, 71, 89, 80, 46, 61, 54, 7, 24, 19,
+ 194, 224, 179, 173, 200, 160, 153, 178, 144, 132, 155, 125, 112, 133, 107, 92, 111, 89, 71, 88, 69, 46, 61, 45, 6, 23, 10,
+ 196, 223, 155, 174, 198, 139, 154, 176, 124, 132, 153, 107, 113, 131, 91, 92, 110, 75, 72, 87, 58, 47, 60, 37, 4, 23, 0,
+ 198, 221, 131, 175, 197, 117, 155, 175, 105, 133, 152, 91, 113, 130, 76, 92, 109, 63, 72, 86, 47, 46, 60, 26, 3, 23, 0,
+ 200, 220, 104, 176, 196, 94, 156, 175, 84, 134, 151, 72, 113, 129, 59, 93, 108, 47, 72, 85, 33, 46, 59, 13, 0, 23, 0,
+ 201, 219, 73, 179, 195, 65, 157, 173, 57, 135, 150, 48, 114, 129, 39, 94, 108, 28, 72, 85, 15, 47, 59, 0, 0, 22, 0,
+ 203, 219, 42, 178, 195, 37, 157, 173, 32, 135, 150, 26, 114, 128, 16, 94, 107, 6, 73, 85, 0, 46, 58, 0, 0, 22, 0,
+ 186, 205, 233, 165, 183, 209, 148, 163, 187, 128, 142, 163, 109, 121, 140, 91, 101, 118, 71, 80, 94, 48, 54, 66, 12, 15, 27,
+ 189, 204, 211, 169, 182, 189, 151, 163, 169, 131, 141, 147, 111, 121, 126, 92, 101, 105, 72, 79, 84, 48, 54, 58, 11, 15, 19,
+ 192, 202, 190, 171, 181, 170, 152, 161, 152, 131, 141, 133, 112, 120, 113, 93, 100, 94, 72, 79, 74, 48, 53, 50, 10, 15, 11,
+ 195, 201, 169, 172, 179, 151, 153, 160, 135, 132, 139, 117, 113, 119, 100, 93, 99, 82, 72, 78, 64, 48, 53, 41, 9, 14, 3,
+ 195, 200, 146, 174, 179, 131, 154, 159, 117, 133, 138, 101, 113, 118, 86, 93, 98, 70, 73, 77, 53, 48, 52, 32, 8, 15, 0,
+ 198, 199, 125, 175, 177, 111, 155, 158, 100, 133, 137, 85, 113, 117, 71, 93, 97, 57, 72, 77, 42, 47, 52, 22, 5, 14, 0,
+ 199, 198, 101, 176, 177, 89, 155, 157, 79, 134, 136, 68, 113, 116, 56, 94, 97, 44, 73, 76, 30, 47, 52, 10, 2, 15, 0,
+ 200, 197, 72, 178, 176, 63, 157, 156, 56, 135, 136, 46, 114, 116, 37, 94, 96, 26, 73, 76, 11, 47, 51, 0, 0, 14, 0,
+ 201, 197, 45, 177, 175, 38, 156, 155, 31, 135, 135, 25, 114, 115, 17, 94, 96, 5, 73, 75, 0, 46, 51, 0, 0, 14, 0,
+ 187, 183, 218, 167, 165, 197, 149, 147, 176, 129, 127, 153, 111, 109, 132, 92, 90, 111, 73, 70, 89, 49, 46, 62, 15, 4, 22,
+ 190, 183, 197, 170, 164, 177, 151, 146, 159, 130, 127, 139, 112, 109, 119, 93, 90, 99, 72, 70, 78, 49, 45, 53, 14, 4, 15,
+ 192, 182, 179, 171, 163, 161, 153, 145, 144, 132, 126, 125, 113, 108, 107, 93, 89, 88, 73, 70, 69, 49, 45, 45, 13, 5, 6,
+ 195, 181, 159, 172, 162, 142, 152, 145, 127, 132, 125, 111, 113, 107, 94, 93, 88, 77, 73, 69, 59, 48, 45, 37, 11, 5, 0,
+ 195, 180, 139, 173, 161, 124, 153, 143, 110, 133, 125, 96, 113, 106, 81, 94, 88, 66, 73, 68, 49, 49, 44, 28, 9, 6, 0,
+ 196, 179, 118, 174, 160, 106, 154, 142, 94, 133, 124, 81, 113, 105, 68, 94, 87, 54, 73, 68, 39, 48, 44, 18, 5, 5, 0,
+ 197, 178, 96, 176, 159, 86, 155, 141, 75, 134, 123, 64, 114, 105, 53, 94, 87, 40, 73, 68, 26, 48, 44, 5, 2, 6, 0,
+ 199, 178, 70, 176, 158, 62, 156, 141, 54, 134, 122, 44, 114, 104, 35, 94, 86, 23, 73, 67, 8, 47, 44, 0, 2, 6, 0,
+ 199, 177, 45, 178, 158, 40, 156, 140, 32, 135, 122, 26, 114, 104, 16, 94, 86, 4, 73, 67, 0, 47, 44, 0, 0, 7, 0,
+ 188, 161, 204, 168, 144, 183, 149, 129, 164, 130, 112, 144, 112, 95, 123, 93, 78, 103, 74, 60, 81, 50, 36, 56, 16, 0, 16,
+ 190, 160, 185, 170, 144, 165, 151, 128, 148, 132, 111, 130, 112, 95, 110, 93, 78, 92, 74, 59, 72, 50, 36, 48, 16, 0, 8,
+ 192, 160, 167, 171, 143, 150, 153, 128, 134, 132, 111, 117, 112, 94, 100, 94, 77, 82, 74, 59, 63, 50, 36, 40, 14, 0, 0,
+ 193, 159, 149, 172, 143, 134, 153, 127, 119, 133, 110, 103, 113, 94, 87, 93, 77, 72, 73, 59, 54, 50, 36, 32, 12, 0, 0,
+ 195, 159, 131, 173, 142, 117, 153, 127, 104, 132, 110, 90, 113, 93, 76, 93, 76, 61, 74, 59, 45, 49, 36, 23, 9, 0, 0,
+ 196, 158, 113, 174, 141, 101, 155, 126, 89, 133, 109, 76, 113, 93, 64, 94, 76, 51, 74, 58, 35, 49, 36, 14, 6, 0, 0,
+ 197, 157, 92, 174, 141, 80, 154, 125, 71, 134, 108, 60, 114, 92, 50, 94, 75, 37, 73, 58, 22, 48, 36, 1, 5, 0, 0,
+ 197, 157, 68, 175, 140, 59, 155, 124, 51, 134, 108, 41, 113, 91, 32, 94, 75, 21, 73, 57, 5, 48, 35, 0, 5, 0, 0,
+ 198, 156, 46, 176, 140, 40, 155, 124, 32, 134, 107, 24, 114, 91, 14, 94, 75, 2, 73, 57, 0, 48, 36, 0, 3, 0, 0,
+ 189, 140, 191, 168, 126, 172, 150, 112, 154, 131, 97, 134, 112, 82, 115, 94, 66, 96, 74, 49, 75, 51, 25, 50, 12, 0, 10,
+ 191, 139, 173, 170, 125, 154, 152, 111, 138, 132, 96, 121, 113, 81, 103, 94, 66, 85, 74, 48, 66, 50, 26, 42, 12, 0, 1,
+ 192, 139, 157, 171, 125, 140, 152, 111, 125, 132, 96, 109, 113, 81, 92, 94, 65, 76, 74, 48, 58, 50, 26, 35, 9, 0, 0,
+ 193, 139, 140, 172, 124, 125, 153, 110, 112, 133, 95, 96, 113, 80, 82, 94, 65, 66, 74, 49, 50, 50, 26, 28, 7, 0, 0,
+ 194, 138, 123, 172, 123, 109, 153, 110, 97, 133, 95, 84, 113, 80, 70, 94, 65, 56, 74, 48, 40, 50, 26, 20, 6, 0, 0,
+ 194, 138, 105, 173, 123, 94, 153, 109, 83, 133, 94, 70, 112, 79, 59, 94, 64, 46, 74, 48, 31, 50, 26, 9, 4, 0, 0,
+ 196, 138, 87, 174, 122, 77, 153, 109, 67, 133, 93, 56, 113, 79, 46, 94, 64, 34, 73, 48, 18, 49, 27, 0, 4, 0, 0,
+ 196, 137, 65, 174, 122, 57, 154, 108, 49, 133, 93, 39, 113, 79, 29, 94, 64, 18, 74, 48, 3, 49, 27, 0, 2, 0, 0,
+ 197, 137, 47, 175, 122, 40, 155, 108, 32, 133, 93, 23, 114, 79, 14, 94, 64, 1, 73, 48, 0, 48, 27, 0, 2, 0, 0,
+ 189, 119, 177, 168, 106, 159, 150, 94, 142, 131, 81, 124, 113, 67, 107, 94, 53, 89, 74, 37, 69, 51, 11, 45, 6, 0, 3,
+ 191, 119, 161, 170, 106, 144, 152, 94, 129, 132, 81, 112, 113, 67, 96, 94, 53, 79, 74, 37, 61, 51, 13, 38, 6, 0, 0,
+ 192, 119, 146, 170, 106, 131, 152, 94, 117, 132, 80, 101, 112, 67, 85, 94, 53, 70, 74, 37, 53, 50, 14, 31, 4, 0, 0,
+ 192, 119, 131, 171, 106, 117, 153, 94, 105, 132, 80, 89, 113, 67, 75, 94, 54, 61, 74, 38, 45, 51, 14, 23, 3, 0, 0,
+ 193, 118, 114, 171, 106, 102, 153, 93, 90, 132, 80, 78, 113, 67, 65, 94, 53, 52, 74, 37, 36, 50, 15, 16, 1, 0, 0,
+ 194, 118, 99, 172, 105, 89, 153, 93, 78, 132, 80, 66, 113, 67, 54, 94, 53, 42, 74, 38, 27, 50, 16, 5, 1, 0, 0,
+ 194, 118, 82, 173, 105, 72, 153, 93, 63, 132, 79, 53, 113, 67, 42, 94, 53, 30, 74, 38, 15, 49, 16, 0, 0, 0, 0,
+ 195, 117, 63, 173, 105, 55, 154, 93, 47, 133, 79, 37, 113, 66, 27, 94, 53, 15, 73, 38, 0, 48, 16, 0, 0, 0, 0,
+ 195, 117, 46, 173, 104, 39, 154, 92, 32, 133, 79, 22, 113, 66, 13, 94, 53, 0, 73, 38, 0, 48, 17, 0, 0, 0, 0,
+ 189, 96, 166, 168, 85, 147, 150, 74, 132, 131, 62, 115, 113, 51, 99, 94, 38, 82, 74, 21, 63, 51, 0, 40, 1, 0, 0,
+ 190, 96, 150, 170, 85, 133, 152, 75, 119, 132, 63, 104, 113, 51, 88, 94, 38, 72, 75, 22, 55, 51, 0, 33, 1, 0, 0,
+ 192, 96, 137, 170, 85, 121, 152, 74, 108, 132, 64, 94, 113, 52, 79, 94, 39, 64, 74, 23, 48, 50, 0, 26, 0, 0, 0,
+ 192, 96, 122, 171, 86, 109, 152, 75, 96, 132, 63, 83, 113, 52, 69, 94, 39, 56, 74, 24, 41, 50, 0, 19, 0, 0, 0,
+ 193, 96, 107, 171, 85, 96, 152, 75, 84, 132, 64, 72, 113, 52, 60, 94, 39, 47, 74, 24, 32, 50, 1, 10, 0, 0, 0,
+ 193, 96, 93, 172, 85, 82, 152, 75, 72, 133, 63, 61, 113, 51, 49, 94, 39, 37, 73, 25, 23, 49, 2, 2, 0, 0, 0,
+ 194, 96, 78, 172, 85, 68, 152, 75, 59, 132, 63, 49, 113, 52, 39, 94, 40, 26, 73, 25, 11, 48, 3, 0, 0, 0, 0,
+ 194, 96, 60, 173, 85, 52, 153, 75, 44, 132, 64, 35, 112, 52, 25, 94, 40, 12, 73, 26, 0, 48, 4, 0, 0, 0, 0,
+ 195, 96, 46, 173, 85, 38, 154, 74, 31, 133, 63, 22, 113, 52, 11, 93, 40, 0, 73, 26, 0, 47, 5, 0, 0, 0, 0,
+ 188, 67, 153, 168, 58, 137, 151, 49, 122, 131, 39, 106, 113, 28, 90, 94, 13, 75, 75, 0, 57, 51, 0, 35, 0, 0, 0,
+ 190, 68, 138, 170, 59, 123, 152, 50, 110, 132, 41, 96, 113, 29, 80, 94, 16, 66, 75, 0, 49, 50, 0, 27, 0, 0, 0,
+ 191, 69, 126, 170, 59, 112, 151, 52, 100, 132, 42, 86, 113, 30, 73, 95, 17, 58, 75, 0, 42, 50, 0, 21, 0, 0, 0,
+ 192, 70, 113, 170, 61, 100, 151, 52, 89, 132, 42, 77, 113, 31, 64, 94, 19, 50, 74, 1, 35, 50, 0, 14, 0, 0, 0,
+ 192, 70, 100, 170, 62, 89, 151, 53, 77, 131, 43, 66, 112, 32, 54, 94, 20, 42, 74, 2, 27, 49, 0, 5, 0, 0, 0,
+ 192, 71, 87, 171, 61, 77, 152, 53, 67, 131, 44, 57, 112, 33, 45, 94, 21, 33, 74, 4, 19, 49, 0, 1, 0, 0, 0,
+ 193, 71, 74, 171, 62, 64, 152, 53, 55, 132, 44, 45, 113, 34, 34, 94, 22, 23, 73, 5, 7, 48, 0, 0, 0, 0, 0,
+ 193, 70, 58, 172, 62, 50, 152, 54, 42, 132, 44, 32, 112, 35, 22, 93, 23, 10, 73, 6, 0, 47, 0, 0, 0, 0, 0,
+ 193, 70, 45, 172, 62, 38, 153, 54, 31, 132, 44, 21, 112, 35, 9, 94, 23, 0, 73, 7, 0, 47, 0, 0, 0, 0, 0,
+ 189, 26, 141, 169, 15, 126, 150, 2, 112, 131, 0, 97, 113, 0, 82, 94, 0, 67, 75, 0, 51, 50, 0, 29, 0, 0, 0,
+ 190, 28, 128, 170, 18, 114, 151, 8, 101, 132, 0, 88, 113, 0, 74, 94, 0, 60, 75, 0, 44, 50, 0, 23, 0, 0, 0,
+ 191, 30, 117, 170, 23, 104, 152, 11, 92, 132, 1, 79, 113, 0, 67, 95, 0, 53, 75, 0, 37, 50, 0, 17, 0, 0, 0,
+ 191, 33, 105, 170, 26, 93, 151, 18, 83, 132, 6, 70, 112, 0, 58, 94, 0, 45, 75, 0, 30, 49, 0, 8, 0, 0, 0,
+ 191, 34, 93, 170, 27, 82, 151, 20, 72, 131, 8, 61, 112, 0, 49, 94, 0, 38, 74, 0, 23, 49, 0, 4, 0, 0, 0,
+ 191, 36, 82, 170, 29, 71, 151, 22, 63, 131, 11, 52, 112, 0, 41, 93, 0, 29, 74, 0, 14, 48, 0, 1, 0, 0, 0,
+ 191, 38, 69, 170, 31, 60, 151, 24, 51, 131, 14, 41, 112, 1, 31, 93, 0, 19, 73, 0, 3, 48, 0, 0, 0, 0, 0,
+ 192, 37, 56, 171, 31, 47, 152, 25, 40, 131, 17, 30, 112, 4, 19, 93, 0, 7, 73, 0, 0, 47, 0, 0, 0, 0, 0,
+ 192, 38, 45, 171, 33, 36, 152, 26, 30, 131, 18, 21, 111, 7, 9, 93, 0, 0, 73, 0, 0, 47, 0, 0, 0, 0, 0,
+ 149, 218, 248, 133, 194, 222, 119, 173, 198, 102, 151, 173, 86, 130, 148, 70, 108, 125, 53, 85, 100, 32, 59, 71, 0, 22, 33,
+ 154, 216, 223, 137, 193, 200, 122, 172, 178, 106, 150, 156, 89, 128, 133, 73, 107, 112, 54, 85, 89, 31, 59, 63, 0, 22, 26,
+ 159, 215, 202, 141, 192, 181, 126, 171, 161, 108, 149, 141, 90, 128, 121, 74, 107, 100, 55, 85, 80, 32, 58, 55, 0, 22, 19,
+ 161, 213, 179, 144, 190, 160, 126, 170, 143, 109, 148, 125, 92, 127, 107, 74, 106, 89, 56, 84, 69, 32, 58, 46, 0, 21, 11,
+ 163, 211, 156, 144, 189, 139, 129, 168, 125, 110, 147, 108, 93, 126, 92, 75, 105, 76, 57, 83, 58, 33, 58, 37, 0, 21, 1,
+ 167, 211, 133, 147, 188, 120, 130, 167, 105, 110, 145, 92, 93, 125, 78, 76, 104, 64, 58, 83, 48, 33, 57, 27, 0, 21, 0,
+ 169, 210, 108, 149, 187, 96, 131, 166, 86, 112, 144, 74, 94, 124, 62, 77, 103, 49, 58, 82, 35, 33, 57, 15, 0, 21, 0,
+ 170, 209, 80, 151, 186, 71, 133, 165, 62, 114, 143, 52, 95, 123, 42, 77, 103, 32, 58, 81, 18, 33, 56, 0, 0, 21, 0,
+ 173, 208, 55, 152, 186, 49, 134, 165, 41, 114, 143, 34, 95, 122, 25, 77, 102, 14, 58, 81, 0, 33, 56, 0, 0, 21, 0,
+ 154, 195, 232, 137, 174, 207, 122, 156, 185, 105, 136, 163, 89, 116, 140, 73, 97, 117, 56, 76, 94, 35, 51, 66, 0, 13, 28,
+ 158, 194, 209, 141, 174, 187, 125, 155, 167, 109, 135, 146, 91, 116, 125, 75, 96, 105, 57, 75, 83, 35, 50, 57, 0, 12, 21,
+ 161, 193, 189, 144, 173, 169, 128, 154, 151, 110, 134, 132, 93, 115, 113, 77, 95, 94, 58, 75, 74, 35, 50, 50, 0, 12, 13,
+ 164, 192, 168, 145, 171, 151, 129, 153, 134, 111, 133, 117, 94, 114, 100, 76, 95, 82, 58, 75, 64, 36, 50, 42, 0, 12, 5,
+ 165, 191, 147, 147, 170, 131, 130, 152, 117, 113, 132, 102, 95, 113, 86, 77, 94, 71, 58, 74, 54, 35, 50, 33, 0, 13, 0,
+ 167, 189, 126, 148, 169, 113, 132, 151, 100, 113, 131, 86, 96, 112, 73, 77, 93, 59, 59, 73, 43, 35, 49, 23, 0, 12, 0,
+ 170, 189, 104, 150, 168, 91, 133, 150, 81, 114, 130, 69, 96, 111, 57, 78, 92, 46, 59, 73, 31, 35, 49, 11, 0, 13, 0,
+ 171, 188, 78, 152, 168, 68, 134, 149, 60, 115, 130, 50, 96, 111, 41, 78, 92, 29, 60, 73, 15, 35, 49, 0, 0, 12, 0,
+ 173, 187, 55, 153, 167, 47, 134, 149, 39, 115, 129, 33, 97, 110, 24, 79, 92, 13, 60, 72, 0, 35, 48, 0, 0, 12, 0,
+ 157, 175, 217, 139, 157, 196, 125, 141, 175, 109, 122, 153, 92, 104, 132, 76, 86, 110, 59, 67, 88, 37, 43, 61, 1, 1, 23,
+ 161, 174, 196, 144, 156, 176, 127, 140, 158, 110, 121, 137, 94, 104, 118, 77, 85, 98, 59, 67, 78, 37, 43, 53, 0, 2, 16,
+ 163, 174, 178, 146, 156, 160, 130, 139, 143, 112, 121, 124, 95, 103, 106, 78, 85, 88, 60, 66, 69, 37, 42, 46, 0, 2, 7,
+ 166, 173, 159, 147, 154, 142, 130, 138, 127, 113, 120, 111, 96, 103, 95, 78, 84, 77, 60, 66, 59, 37, 43, 37, 0, 2, 0,
+ 166, 172, 139, 148, 154, 125, 131, 137, 112, 113, 120, 96, 96, 102, 81, 78, 84, 66, 60, 65, 50, 37, 42, 29, 0, 3, 0,
+ 167, 171, 120, 149, 153, 107, 133, 137, 95, 114, 118, 81, 97, 101, 69, 79, 84, 56, 60, 65, 40, 37, 42, 19, 0, 3, 0,
+ 170, 170, 99, 151, 152, 87, 134, 136, 77, 115, 118, 66, 97, 101, 55, 79, 83, 42, 61, 65, 28, 37, 42, 7, 0, 3, 0,
+ 172, 170, 75, 152, 151, 65, 134, 135, 57, 115, 117, 48, 97, 100, 38, 79, 83, 27, 61, 64, 12, 36, 42, 0, 0, 3, 0,
+ 172, 169, 55, 154, 151, 46, 135, 134, 40, 116, 116, 32, 97, 99, 21, 80, 82, 10, 61, 64, 0, 36, 41, 0, 0, 3, 0,
+ 160, 154, 203, 143, 139, 182, 127, 124, 164, 111, 107, 143, 95, 91, 122, 78, 75, 103, 60, 57, 81, 39, 33, 56, 1, 0, 18,
+ 163, 154, 184, 146, 138, 165, 130, 123, 148, 113, 107, 129, 96, 90, 110, 79, 74, 92, 61, 56, 72, 39, 34, 48, 2, 0, 9,
+ 165, 154, 167, 147, 137, 149, 131, 122, 134, 114, 106, 117, 96, 90, 100, 79, 74, 82, 61, 56, 64, 39, 33, 40, 2, 0, 1,
+ 166, 153, 150, 149, 137, 133, 132, 122, 119, 114, 106, 104, 97, 90, 88, 79, 74, 72, 61, 56, 55, 39, 34, 33, 0, 0, 0,
+ 168, 152, 132, 149, 136, 117, 132, 121, 104, 114, 105, 90, 97, 89, 76, 79, 73, 62, 61, 56, 46, 38, 34, 25, 0, 0, 0,
+ 169, 151, 114, 150, 135, 101, 133, 121, 90, 114, 104, 77, 97, 89, 65, 80, 73, 51, 61, 56, 36, 38, 34, 16, 0, 0, 0,
+ 170, 150, 94, 151, 135, 83, 134, 120, 73, 115, 104, 62, 98, 88, 51, 80, 72, 39, 61, 56, 24, 38, 34, 3, 0, 0, 0,
+ 172, 150, 72, 153, 134, 63, 135, 119, 55, 115, 103, 45, 98, 88, 36, 80, 72, 24, 61, 55, 9, 38, 34, 0, 0, 0, 0,
+ 172, 150, 54, 153, 134, 47, 135, 119, 38, 116, 103, 30, 98, 87, 21, 80, 72, 8, 62, 55, 0, 37, 34, 0, 0, 0, 0,
+ 162, 134, 190, 145, 120, 171, 129, 108, 153, 113, 93, 134, 97, 78, 115, 80, 63, 96, 62, 46, 75, 41, 23, 51, 0, 0, 11,
+ 165, 134, 173, 147, 120, 154, 131, 107, 138, 114, 92, 120, 97, 78, 103, 80, 63, 85, 62, 46, 66, 40, 23, 43, 0, 0, 2,
+ 166, 134, 157, 148, 120, 140, 132, 106, 125, 114, 92, 109, 97, 77, 93, 81, 63, 77, 62, 46, 58, 40, 24, 36, 0, 0, 0,
+ 168, 133, 140, 149, 119, 125, 132, 106, 112, 115, 92, 97, 98, 77, 82, 81, 62, 67, 62, 46, 50, 40, 24, 29, 0, 0, 0,
+ 168, 133, 123, 150, 119, 110, 133, 106, 97, 115, 91, 84, 98, 77, 70, 81, 62, 57, 62, 46, 41, 40, 24, 20, 0, 0, 0,
+ 169, 132, 107, 150, 118, 94, 133, 105, 84, 115, 91, 72, 98, 76, 60, 80, 62, 47, 62, 46, 32, 39, 25, 11, 0, 0, 0,
+ 171, 132, 89, 152, 118, 79, 135, 105, 69, 115, 90, 58, 98, 76, 47, 80, 62, 36, 62, 46, 21, 39, 25, 0, 0, 0, 0,
+ 171, 132, 69, 153, 117, 60, 135, 104, 52, 116, 90, 42, 98, 76, 33, 81, 61, 21, 62, 46, 6, 38, 25, 0, 0, 0, 0,
+ 172, 132, 54, 153, 118, 45, 135, 104, 38, 116, 90, 28, 98, 76, 18, 81, 61, 6, 62, 46, 0, 38, 25, 0, 0, 0, 0,
+ 164, 115, 177, 146, 103, 159, 130, 91, 143, 114, 78, 125, 97, 65, 107, 81, 51, 89, 63, 34, 69, 41, 9, 46, 0, 0, 4,
+ 166, 115, 161, 148, 103, 144, 132, 91, 129, 115, 78, 112, 98, 65, 96, 81, 51, 79, 63, 35, 61, 41, 11, 38, 0, 0, 0,
+ 167, 115, 146, 150, 102, 131, 132, 91, 117, 115, 78, 101, 98, 65, 86, 81, 51, 71, 63, 35, 54, 41, 12, 32, 0, 0, 0,
+ 168, 114, 132, 150, 103, 118, 133, 91, 105, 116, 78, 91, 98, 64, 76, 82, 51, 61, 63, 36, 46, 41, 13, 24, 0, 0, 0,
+ 169, 114, 116, 150, 102, 103, 134, 90, 91, 116, 78, 79, 98, 65, 66, 81, 51, 53, 63, 36, 37, 40, 14, 17, 0, 0, 0,
+ 169, 114, 101, 151, 101, 89, 134, 90, 79, 116, 77, 67, 98, 64, 56, 81, 51, 44, 63, 36, 29, 40, 15, 7, 0, 0, 0,
+ 170, 114, 85, 152, 101, 75, 135, 90, 65, 116, 77, 54, 98, 64, 44, 81, 51, 32, 63, 36, 17, 39, 15, 0, 0, 0, 0,
+ 172, 113, 66, 152, 101, 58, 135, 89, 49, 116, 77, 40, 99, 64, 30, 81, 51, 18, 62, 36, 3, 38, 16, 0, 0, 0, 0,
+ 171, 113, 51, 153, 101, 44, 136, 89, 36, 116, 77, 28, 99, 64, 18, 81, 51, 5, 62, 36, 0, 38, 16, 0, 0, 0, 0,
+ 165, 94, 166, 147, 82, 147, 132, 72, 132, 115, 61, 115, 98, 49, 99, 82, 36, 82, 64, 19, 64, 42, 0, 41, 0, 0, 0,
+ 167, 93, 150, 150, 83, 134, 133, 73, 120, 116, 62, 104, 99, 49, 88, 82, 36, 72, 64, 20, 55, 41, 0, 33, 0, 0, 0,
+ 169, 93, 137, 150, 83, 122, 134, 73, 109, 116, 61, 94, 99, 50, 80, 82, 37, 65, 64, 21, 49, 41, 0, 27, 0, 0, 0,
+ 169, 94, 123, 150, 83, 110, 133, 73, 97, 116, 61, 83, 99, 50, 70, 82, 38, 57, 63, 23, 42, 41, 0, 20, 0, 0, 0,
+ 169, 94, 109, 150, 84, 97, 134, 73, 85, 116, 62, 73, 99, 51, 61, 81, 38, 48, 63, 23, 33, 41, 1, 11, 0, 0, 0,
+ 170, 94, 96, 150, 83, 84, 134, 73, 74, 116, 61, 62, 99, 50, 51, 82, 38, 39, 64, 23, 24, 40, 3, 4, 0, 0, 0,
+ 171, 93, 79, 152, 82, 70, 135, 73, 61, 116, 62, 51, 98, 51, 40, 81, 38, 28, 63, 24, 14, 39, 4, 0, 0, 0, 0,
+ 171, 94, 64, 152, 83, 55, 135, 73, 47, 116, 62, 37, 98, 50, 27, 81, 38, 15, 63, 24, 1, 39, 4, 0, 0, 0, 0,
+ 172, 93, 51, 153, 82, 42, 135, 73, 35, 117, 62, 26, 99, 51, 16, 81, 39, 3, 63, 25, 0, 38, 5, 0, 0, 0, 0,
+ 166, 68, 153, 148, 59, 137, 133, 49, 121, 115, 39, 106, 99, 28, 91, 82, 13, 75, 65, 0, 58, 42, 0, 36, 0, 0, 0,
+ 168, 68, 139, 150, 59, 124, 134, 50, 110, 116, 40, 96, 99, 30, 81, 82, 16, 66, 64, 0, 50, 41, 0, 29, 0, 0, 0,
+ 169, 69, 126, 150, 59, 113, 134, 51, 101, 117, 42, 87, 100, 30, 73, 82, 17, 59, 65, 0, 43, 41, 0, 23, 0, 0, 0,
+ 169, 70, 115, 150, 61, 102, 134, 52, 89, 116, 42, 77, 99, 32, 65, 82, 19, 52, 64, 0, 36, 41, 0, 15, 0, 0, 0,
+ 169, 70, 101, 150, 61, 90, 134, 52, 79, 116, 43, 68, 99, 32, 55, 82, 21, 43, 64, 2, 28, 41, 0, 6, 0, 0, 0,
+ 170, 70, 89, 151, 62, 79, 134, 53, 69, 116, 44, 58, 99, 33, 46, 81, 21, 34, 64, 3, 20, 41, 0, 2, 0, 0, 0,
+ 170, 71, 76, 152, 62, 66, 134, 53, 57, 116, 43, 46, 99, 33, 36, 82, 22, 24, 64, 5, 10, 40, 0, 0, 0, 0, 0,
+ 171, 70, 61, 152, 62, 52, 135, 53, 44, 116, 44, 35, 99, 34, 24, 82, 22, 12, 63, 6, 0, 39, 0, 0, 0, 0, 0,
+ 171, 71, 49, 153, 62, 41, 135, 54, 33, 117, 45, 25, 98, 34, 13, 81, 23, 0, 63, 7, 0, 39, 0, 0, 0, 0, 0,
+ 167, 33, 142, 149, 24, 127, 134, 10, 113, 116, 0, 97, 100, 0, 83, 83, 0, 68, 65, 0, 52, 40, 0, 30, 0, 0, 0,
+ 169, 33, 129, 150, 26, 115, 134, 17, 102, 116, 3, 89, 100, 0, 75, 83, 0, 60, 65, 0, 45, 40, 0, 24, 0, 0, 0,
+ 169, 36, 118, 151, 27, 104, 134, 19, 93, 116, 7, 80, 100, 0, 67, 83, 0, 54, 65, 0, 38, 41, 0, 17, 0, 0, 0,
+ 169, 39, 107, 150, 30, 94, 134, 22, 84, 116, 11, 71, 99, 0, 59, 83, 0, 46, 64, 0, 31, 40, 0, 9, 0, 0, 0,
+ 169, 39, 95, 151, 31, 83, 134, 24, 73, 116, 15, 62, 100, 1, 51, 83, 0, 38, 64, 0, 24, 40, 0, 5, 0, 0, 0,
+ 169, 41, 83, 151, 33, 73, 134, 26, 64, 117, 17, 54, 99, 4, 42, 82, 0, 30, 64, 0, 16, 40, 0, 1, 0, 0, 0,
+ 170, 42, 71, 152, 34, 62, 134, 28, 53, 117, 19, 44, 99, 6, 33, 82, 0, 21, 63, 0, 4, 39, 0, 0, 0, 0, 0,
+ 171, 42, 59, 152, 35, 50, 134, 29, 42, 117, 21, 32, 99, 9, 22, 82, 0, 9, 63, 0, 0, 38, 0, 0, 0, 0, 0,
+ 172, 42, 48, 152, 36, 40, 135, 29, 32, 117, 21, 23, 99, 10, 12, 82, 0, 0, 63, 0, 0, 38, 0, 0, 0, 0, 0,
+ 107, 207, 246, 96, 185, 220, 86, 165, 196, 73, 144, 171, 60, 123, 147, 46, 103, 125, 32, 82, 100, 9, 56, 71, 0, 20, 33,
+ 115, 206, 221, 104, 184, 198, 92, 164, 178, 78, 143, 154, 64, 123, 133, 51, 102, 111, 34, 81, 89, 10, 56, 63, 0, 20, 27,
+ 122, 204, 200, 108, 183, 180, 95, 163, 161, 82, 142, 140, 68, 122, 120, 54, 102, 101, 36, 81, 79, 11, 56, 55, 0, 20, 20,
+ 125, 203, 179, 111, 181, 160, 97, 162, 143, 85, 141, 124, 70, 121, 107, 55, 101, 89, 38, 80, 69, 14, 55, 46, 0, 19, 10,
+ 128, 202, 156, 113, 180, 140, 102, 161, 125, 87, 140, 108, 71, 120, 92, 56, 100, 76, 39, 79, 59, 14, 55, 38, 0, 20, 3,
+ 132, 200, 135, 117, 179, 121, 103, 159, 106, 88, 139, 93, 73, 119, 79, 57, 100, 65, 41, 79, 49, 15, 54, 28, 0, 19, 0,
+ 134, 200, 111, 119, 178, 98, 105, 158, 87, 89, 138, 76, 74, 118, 64, 58, 99, 51, 41, 78, 37, 16, 54, 17, 0, 19, 0,
+ 137, 199, 85, 122, 177, 75, 108, 158, 66, 91, 137, 56, 75, 118, 46, 59, 98, 35, 42, 78, 22, 16, 54, 3, 0, 19, 0,
+ 140, 198, 62, 125, 177, 55, 109, 158, 47, 92, 137, 40, 76, 117, 32, 59, 98, 21, 42, 78, 6, 16, 54, 0, 0, 18, 0,
+ 118, 186, 231, 106, 167, 206, 93, 149, 184, 81, 130, 161, 67, 111, 139, 54, 92, 117, 39, 72, 93, 17, 48, 66, 0, 10, 29,
+ 123, 185, 207, 110, 166, 186, 98, 148, 167, 85, 129, 145, 71, 111, 125, 56, 92, 104, 40, 72, 83, 18, 48, 57, 0, 10, 22,
+ 128, 184, 188, 113, 165, 168, 102, 147, 151, 88, 128, 131, 73, 110, 113, 58, 91, 94, 42, 71, 74, 19, 48, 50, 0, 9, 15,
+ 131, 183, 168, 116, 164, 151, 104, 146, 134, 89, 127, 117, 73, 109, 100, 58, 90, 83, 42, 71, 65, 20, 48, 42, 0, 9, 5,
+ 134, 182, 148, 120, 163, 131, 105, 145, 118, 90, 126, 102, 75, 108, 86, 59, 90, 72, 43, 71, 55, 19, 47, 34, 0, 9, 0,
+ 136, 181, 128, 122, 162, 115, 107, 144, 102, 92, 125, 87, 76, 107, 74, 61, 89, 60, 44, 70, 45, 20, 47, 24, 0, 8, 0,
+ 139, 180, 106, 124, 161, 95, 109, 144, 83, 93, 124, 71, 77, 107, 60, 61, 89, 47, 44, 70, 33, 20, 47, 13, 0, 8, 0,
+ 142, 179, 82, 125, 160, 72, 111, 143, 63, 94, 124, 54, 77, 106, 44, 61, 88, 32, 44, 69, 18, 20, 46, 0, 0, 8, 0,
+ 143, 179, 62, 127, 160, 54, 111, 142, 47, 94, 124, 39, 78, 106, 29, 62, 88, 18, 45, 69, 3, 20, 46, 0, 0, 8, 0,
+ 124, 167, 216, 112, 150, 194, 99, 134, 174, 87, 117, 153, 73, 100, 131, 58, 82, 110, 43, 64, 88, 23, 40, 61, 0, 0, 24,
+ 129, 166, 195, 116, 150, 175, 103, 134, 158, 89, 116, 137, 75, 99, 118, 60, 82, 98, 44, 63, 78, 23, 40, 53, 0, 0, 17,
+ 132, 166, 177, 119, 149, 160, 106, 133, 143, 90, 115, 124, 76, 99, 107, 61, 81, 88, 45, 63, 69, 24, 40, 46, 0, 0, 9,
+ 136, 166, 159, 121, 148, 143, 107, 132, 126, 92, 115, 111, 77, 98, 94, 62, 81, 78, 46, 63, 60, 23, 40, 38, 0, 0, 0,
+ 138, 164, 140, 122, 147, 125, 108, 131, 111, 93, 114, 97, 79, 98, 82, 63, 80, 67, 46, 62, 50, 24, 40, 29, 0, 0, 0,
+ 139, 163, 122, 124, 146, 109, 110, 131, 96, 94, 114, 83, 79, 97, 70, 63, 81, 57, 46, 62, 41, 24, 40, 21, 0, 0, 0,
+ 141, 163, 101, 126, 145, 90, 111, 130, 79, 95, 113, 68, 79, 96, 56, 63, 80, 44, 47, 62, 30, 23, 40, 10, 0, 0, 0,
+ 144, 162, 79, 127, 145, 70, 112, 129, 60, 95, 112, 51, 79, 96, 41, 64, 79, 30, 47, 61, 15, 23, 40, 0, 0, 0, 0,
+ 145, 162, 60, 129, 145, 52, 113, 129, 46, 96, 112, 37, 79, 95, 27, 64, 79, 16, 47, 61, 1, 23, 39, 0, 0, 0, 0,
+ 131, 147, 202, 117, 133, 181, 105, 119, 162, 91, 103, 142, 77, 87, 122, 62, 71, 102, 47, 54, 81, 26, 31, 56, 0, 0, 18,
+ 135, 147, 183, 120, 132, 164, 107, 118, 147, 93, 102, 128, 78, 87, 110, 63, 71, 92, 47, 54, 72, 26, 31, 48, 0, 0, 10,
+ 138, 147, 166, 123, 131, 149, 108, 118, 133, 94, 102, 116, 79, 86, 100, 64, 71, 82, 48, 54, 64, 27, 31, 41, 0, 0, 2,
+ 139, 146, 149, 124, 131, 134, 111, 117, 119, 94, 101, 103, 79, 86, 88, 64, 70, 72, 48, 53, 55, 27, 31, 33, 0, 0, 0,
+ 141, 146, 132, 125, 131, 117, 111, 117, 104, 95, 101, 91, 80, 86, 77, 65, 70, 62, 48, 53, 46, 26, 31, 25, 0, 0, 0,
+ 143, 145, 115, 126, 130, 101, 112, 116, 90, 96, 100, 78, 80, 85, 65, 65, 70, 52, 49, 53, 37, 27, 32, 17, 0, 0, 0,
+ 144, 144, 96, 128, 129, 85, 112, 115, 75, 97, 100, 64, 81, 85, 52, 65, 69, 40, 49, 53, 26, 26, 31, 5, 0, 0, 0,
+ 146, 144, 76, 129, 129, 67, 114, 115, 58, 97, 99, 48, 82, 84, 38, 66, 69, 27, 49, 53, 12, 26, 32, 0, 0, 0, 0,
+ 146, 144, 59, 130, 128, 51, 114, 114, 43, 98, 99, 35, 82, 84, 25, 66, 69, 13, 49, 53, 0, 26, 32, 0, 0, 0, 0,
+ 135, 129, 189, 122, 115, 170, 107, 103, 152, 94, 89, 133, 79, 74, 114, 64, 60, 95, 49, 43, 75, 29, 20, 51, 0, 0, 12,
+ 138, 129, 171, 124, 115, 153, 110, 103, 138, 95, 89, 120, 81, 74, 103, 66, 60, 86, 50, 44, 67, 28, 21, 43, 0, 0, 3,
+ 140, 129, 156, 125, 115, 140, 111, 103, 125, 96, 89, 109, 81, 74, 93, 67, 60, 76, 50, 44, 59, 29, 22, 36, 0, 0, 0,
+ 142, 128, 140, 127, 115, 125, 112, 102, 112, 97, 88, 97, 82, 74, 83, 67, 60, 67, 50, 44, 51, 29, 22, 29, 0, 0, 0,
+ 142, 128, 124, 127, 114, 111, 113, 102, 98, 98, 88, 85, 82, 74, 71, 66, 60, 58, 50, 44, 42, 29, 22, 21, 0, 0, 0,
+ 144, 127, 108, 128, 114, 96, 113, 101, 85, 98, 87, 73, 82, 74, 61, 67, 60, 48, 50, 44, 33, 28, 23, 12, 0, 0, 0,
+ 145, 127, 91, 129, 114, 81, 115, 101, 71, 98, 87, 60, 82, 73, 48, 67, 59, 37, 50, 44, 22, 29, 23, 1, 0, 0, 0,
+ 147, 127, 73, 130, 113, 63, 115, 101, 55, 98, 87, 45, 83, 73, 35, 67, 59, 24, 50, 44, 10, 28, 24, 0, 0, 0, 0,
+ 147, 127, 58, 131, 113, 49, 115, 100, 42, 99, 86, 33, 83, 73, 23, 67, 59, 10, 50, 44, 0, 27, 24, 0, 0, 0, 0,
+ 138, 110, 177, 124, 99, 159, 110, 88, 142, 96, 75, 125, 82, 62, 107, 66, 48, 89, 51, 33, 70, 30, 8, 46, 0, 0, 5,
+ 142, 111, 160, 127, 99, 144, 113, 88, 130, 98, 75, 112, 82, 62, 96, 68, 49, 80, 51, 33, 61, 30, 10, 39, 0, 0, 0,
+ 143, 111, 146, 128, 99, 131, 114, 88, 118, 98, 75, 101, 83, 62, 86, 68, 49, 71, 52, 33, 54, 30, 11, 32, 0, 0, 0,
+ 144, 111, 132, 128, 99, 118, 113, 88, 106, 99, 75, 91, 83, 62, 77, 68, 49, 62, 52, 34, 46, 30, 12, 25, 0, 0, 0,
+ 144, 111, 117, 129, 98, 104, 114, 87, 92, 99, 75, 80, 83, 62, 67, 68, 49, 53, 51, 34, 38, 30, 13, 18, 0, 0, 0,
+ 145, 111, 103, 130, 98, 91, 114, 87, 80, 99, 75, 68, 83, 63, 57, 68, 50, 45, 51, 34, 30, 30, 14, 8, 0, 0, 0,
+ 146, 110, 87, 131, 98, 76, 115, 87, 67, 99, 75, 56, 83, 62, 45, 68, 49, 33, 52, 35, 19, 30, 15, 2, 0, 0, 0,
+ 148, 110, 70, 131, 98, 60, 116, 86, 52, 99, 74, 43, 84, 62, 33, 69, 49, 21, 52, 35, 6, 29, 15, 0, 0, 0, 0,
+ 148, 110, 56, 132, 97, 48, 117, 87, 40, 100, 75, 31, 84, 62, 22, 68, 49, 9, 51, 35, 0, 28, 15, 0, 0, 0, 0,
+ 142, 91, 166, 126, 80, 148, 113, 71, 132, 98, 59, 115, 83, 47, 99, 69, 34, 82, 53, 17, 64, 32, 0, 41, 0, 0, 0,
+ 143, 91, 150, 128, 81, 135, 114, 71, 120, 99, 60, 104, 85, 48, 89, 69, 35, 73, 53, 19, 56, 32, 0, 34, 0, 0, 0,
+ 145, 91, 137, 129, 81, 122, 115, 71, 109, 100, 60, 94, 85, 48, 81, 69, 35, 65, 53, 19, 49, 32, 0, 28, 0, 0, 0,
+ 146, 92, 124, 130, 81, 110, 115, 71, 98, 100, 60, 84, 85, 49, 71, 69, 36, 57, 53, 21, 42, 32, 0, 21, 0, 0, 0,
+ 147, 91, 110, 130, 81, 97, 115, 71, 86, 100, 60, 74, 84, 49, 62, 69, 36, 48, 53, 22, 34, 32, 0, 13, 0, 0, 0,
+ 147, 92, 97, 130, 81, 85, 116, 72, 76, 100, 60, 63, 85, 49, 52, 69, 37, 40, 53, 22, 26, 31, 1, 5, 0, 0, 0,
+ 148, 92, 82, 131, 81, 71, 116, 71, 62, 100, 60, 53, 84, 49, 42, 69, 37, 30, 52, 23, 16, 31, 2, 0, 0, 0, 0,
+ 148, 91, 67, 132, 81, 57, 117, 71, 49, 100, 60, 39, 84, 49, 30, 69, 37, 18, 52, 23, 2, 30, 2, 0, 0, 0, 0,
+ 149, 91, 54, 132, 81, 46, 118, 71, 39, 101, 60, 29, 85, 49, 19, 69, 37, 6, 52, 23, 0, 29, 3, 0, 0, 0, 0,
+ 143, 68, 153, 128, 59, 137, 115, 49, 122, 99, 39, 107, 85, 28, 91, 70, 13, 75, 54, 0, 58, 32, 0, 36, 0, 0, 0,
+ 146, 68, 140, 131, 59, 125, 116, 51, 111, 100, 40, 97, 85, 29, 82, 70, 15, 67, 54, 0, 50, 32, 0, 29, 0, 0, 0,
+ 147, 68, 127, 131, 59, 114, 117, 51, 102, 101, 41, 88, 86, 30, 74, 70, 17, 60, 54, 0, 44, 32, 0, 23, 0, 0, 0,
+ 147, 70, 115, 131, 60, 103, 116, 52, 91, 100, 42, 78, 85, 32, 65, 70, 19, 53, 54, 1, 38, 32, 0, 17, 0, 0, 0,
+ 147, 70, 103, 131, 61, 91, 117, 53, 81, 101, 43, 69, 86, 32, 57, 70, 20, 44, 54, 2, 30, 32, 0, 7, 0, 0, 0,
+ 148, 70, 91, 132, 61, 80, 117, 52, 70, 101, 43, 59, 85, 33, 48, 70, 21, 36, 53, 4, 22, 32, 0, 3, 0, 0, 0,
+ 148, 70, 78, 132, 62, 68, 117, 53, 58, 101, 43, 48, 85, 34, 38, 70, 22, 26, 53, 6, 12, 31, 0, 0, 0, 0, 0,
+ 149, 71, 64, 132, 62, 54, 118, 54, 46, 101, 44, 37, 85, 34, 27, 69, 23, 15, 53, 7, 1, 30, 0, 0, 0, 0, 0,
+ 150, 70, 53, 134, 61, 44, 118, 54, 36, 101, 44, 28, 85, 35, 17, 69, 23, 4, 52, 8, 0, 30, 0, 0, 0, 0, 0,
+ 145, 38, 143, 130, 29, 128, 117, 18, 114, 101, 3, 98, 87, 0, 84, 72, 0, 69, 54, 0, 53, 30, 0, 31, 0, 0, 0,
+ 147, 38, 130, 132, 30, 116, 117, 22, 103, 101, 8, 89, 87, 0, 76, 72, 0, 62, 54, 0, 46, 30, 0, 24, 0, 0, 0,
+ 148, 40, 119, 132, 31, 105, 117, 23, 94, 101, 13, 81, 87, 0, 68, 71, 0, 55, 54, 0, 39, 30, 0, 18, 0, 0, 0,
+ 148, 42, 108, 132, 34, 96, 117, 25, 85, 102, 15, 73, 86, 2, 60, 71, 0, 47, 54, 0, 33, 30, 0, 11, 0, 0, 0,
+ 148, 43, 96, 133, 35, 85, 117, 28, 75, 102, 18, 64, 87, 5, 52, 71, 0, 40, 54, 0, 25, 30, 0, 5, 0, 0, 0,
+ 149, 44, 85, 132, 36, 75, 118, 29, 66, 101, 20, 55, 86, 8, 44, 70, 0, 32, 53, 0, 18, 29, 0, 2, 0, 0, 0,
+ 149, 45, 74, 133, 37, 64, 118, 31, 55, 102, 21, 45, 85, 10, 34, 70, 0, 22, 53, 0, 6, 28, 0, 0, 0, 0, 0,
+ 150, 46, 61, 133, 39, 52, 118, 31, 44, 102, 23, 34, 85, 12, 24, 70, 0, 12, 52, 0, 0, 28, 0, 0, 0, 0, 0,
+ 150, 46, 51, 133, 40, 42, 119, 32, 35, 102, 24, 25, 85, 13, 14, 70, 0, 1, 52, 0, 0, 27, 0, 0, 0, 0, 0,
+ 53, 198, 244, 49, 177, 218, 41, 158, 195, 32, 138, 171, 22, 118, 147, 11, 98, 124, 0, 78, 100, 0, 54, 71, 0, 18, 34,
+ 69, 196, 220, 64, 175, 196, 54, 157, 176, 45, 137, 154, 32, 117, 133, 19, 98, 111, 0, 78, 89, 0, 53, 63, 0, 17, 27,
+ 80, 195, 198, 69, 175, 179, 60, 156, 159, 50, 136, 139, 38, 116, 120, 25, 98, 101, 4, 77, 80, 0, 53, 55, 0, 17, 21,
+ 84, 193, 177, 75, 173, 159, 64, 155, 142, 55, 135, 124, 41, 116, 107, 27, 97, 89, 9, 76, 70, 0, 53, 47, 0, 17, 11,
+ 89, 193, 157, 79, 172, 140, 70, 154, 125, 57, 134, 109, 44, 115, 92, 32, 96, 76, 13, 76, 59, 0, 52, 39, 0, 16, 4,
+ 94, 191, 135, 85, 171, 121, 72, 152, 108, 60, 133, 94, 47, 114, 80, 32, 95, 65, 15, 76, 49, 0, 52, 29, 0, 16, 0,
+ 98, 190, 113, 87, 170, 100, 76, 152, 89, 62, 132, 77, 49, 113, 65, 35, 95, 52, 18, 75, 37, 0, 52, 18, 0, 15, 0,
+ 103, 190, 89, 90, 169, 80, 78, 151, 70, 64, 132, 60, 51, 113, 49, 37, 94, 38, 20, 75, 25, 0, 52, 5, 0, 15, 0,
+ 106, 189, 69, 93, 169, 61, 80, 151, 53, 66, 131, 45, 52, 113, 36, 37, 94, 25, 19, 74, 11, 0, 51, 0, 0, 15, 0,
+ 76, 178, 229, 68, 159, 205, 61, 142, 183, 50, 124, 160, 40, 106, 138, 28, 88, 116, 12, 69, 93, 0, 45, 66, 0, 5, 29,
+ 86, 177, 207, 78, 158, 184, 67, 142, 166, 56, 123, 145, 45, 106, 125, 31, 88, 105, 16, 69, 83, 0, 45, 58, 0, 6, 22,
+ 93, 176, 187, 81, 158, 168, 71, 141, 150, 61, 123, 131, 47, 105, 113, 35, 87, 94, 20, 68, 74, 0, 45, 51, 0, 5, 16,
+ 98, 175, 168, 84, 157, 150, 75, 140, 134, 63, 122, 117, 50, 104, 100, 37, 87, 83, 21, 68, 65, 0, 45, 42, 0, 4, 7,
+ 100, 174, 149, 89, 155, 132, 76, 139, 117, 65, 121, 102, 53, 104, 87, 39, 86, 72, 23, 67, 55, 0, 45, 34, 0, 3, 0,
+ 103, 173, 130, 92, 155, 115, 80, 138, 102, 68, 120, 88, 53, 103, 75, 40, 86, 61, 24, 67, 45, 0, 45, 25, 0, 3, 0,
+ 107, 172, 108, 95, 154, 96, 82, 137, 85, 70, 119, 73, 55, 102, 61, 42, 85, 49, 25, 67, 34, 0, 45, 14, 0, 3, 0,
+ 110, 172, 86, 97, 153, 76, 85, 137, 67, 70, 119, 57, 56, 102, 46, 42, 84, 35, 26, 66, 21, 0, 44, 1, 0, 3, 0,
+ 112, 171, 67, 98, 153, 59, 86, 137, 52, 71, 119, 44, 58, 102, 34, 44, 85, 22, 27, 66, 7, 0, 44, 0, 0, 3, 0,
+ 90, 160, 215, 81, 144, 193, 70, 129, 173, 61, 112, 151, 49, 95, 131, 37, 79, 109, 22, 61, 87, 0, 38, 61, 0, 0, 25,
+ 96, 160, 194, 86, 143, 174, 75, 128, 157, 65, 112, 137, 53, 95, 117, 40, 78, 98, 25, 60, 78, 0, 38, 53, 0, 0, 17,
+ 100, 159, 177, 89, 143, 159, 79, 128, 143, 67, 111, 124, 55, 95, 107, 42, 78, 89, 27, 60, 70, 2, 38, 46, 0, 0, 9,
+ 104, 158, 159, 92, 142, 143, 81, 127, 127, 69, 110, 110, 56, 94, 94, 43, 78, 78, 28, 60, 60, 2, 38, 38, 0, 0, 1,
+ 107, 157, 140, 94, 141, 125, 82, 126, 112, 71, 110, 97, 59, 94, 82, 45, 77, 67, 29, 59, 51, 4, 37, 30, 0, 0, 0,
+ 110, 156, 122, 97, 140, 109, 85, 125, 97, 72, 109, 83, 58, 93, 71, 45, 77, 57, 29, 60, 42, 5, 38, 22, 0, 0, 0,
+ 111, 156, 103, 99, 139, 91, 87, 125, 81, 73, 108, 69, 60, 92, 58, 46, 77, 45, 30, 59, 31, 5, 38, 12, 0, 0, 0,
+ 115, 156, 82, 101, 140, 73, 88, 124, 63, 74, 108, 53, 60, 92, 44, 46, 76, 32, 31, 59, 18, 6, 37, 0, 0, 0, 0,
+ 116, 155, 65, 102, 139, 58, 89, 124, 49, 75, 108, 41, 61, 92, 32, 48, 76, 21, 31, 59, 6, 5, 37, 0, 0, 0, 0,
+ 100, 141, 201, 88, 127, 181, 79, 114, 162, 69, 99, 142, 57, 83, 122, 44, 68, 102, 30, 51, 81, 7, 28, 56, 0, 0, 19,
+ 105, 141, 182, 94, 127, 163, 83, 114, 146, 71, 98, 128, 59, 83, 110, 46, 68, 91, 31, 51, 72, 10, 28, 48, 0, 0, 11,
+ 108, 141, 166, 96, 127, 149, 85, 113, 133, 73, 98, 116, 60, 83, 99, 46, 68, 82, 32, 51, 64, 11, 29, 41, 0, 0, 2,
+ 111, 141, 149, 98, 126, 134, 88, 112, 119, 74, 97, 103, 61, 83, 88, 48, 67, 72, 33, 51, 56, 11, 29, 34, 0, 0, 0,
+ 112, 140, 132, 100, 125, 118, 89, 112, 105, 75, 97, 91, 62, 82, 77, 49, 68, 62, 33, 51, 47, 12, 29, 26, 0, 0, 0,
+ 115, 140, 116, 102, 125, 103, 90, 111, 91, 76, 96, 78, 62, 82, 65, 49, 67, 52, 34, 51, 38, 13, 29, 18, 0, 0, 0,
+ 117, 139, 97, 103, 124, 87, 91, 111, 77, 78, 96, 65, 63, 81, 54, 49, 67, 41, 34, 51, 27, 12, 29, 7, 0, 0, 0,
+ 119, 138, 78, 105, 124, 69, 92, 110, 60, 78, 95, 50, 65, 81, 40, 50, 67, 29, 34, 51, 15, 13, 30, 0, 0, 0, 0,
+ 120, 138, 64, 106, 124, 54, 93, 110, 47, 78, 95, 38, 65, 81, 29, 50, 66, 17, 34, 50, 2, 13, 29, 0, 0, 0, 0,
+ 107, 124, 189, 96, 111, 169, 85, 99, 152, 73, 85, 132, 61, 71, 114, 48, 57, 95, 34, 41, 75, 14, 18, 51, 0, 0, 13,
+ 111, 124, 171, 100, 111, 153, 88, 99, 137, 75, 85, 120, 63, 72, 103, 50, 58, 85, 36, 41, 66, 15, 19, 43, 0, 0, 4,
+ 113, 124, 156, 101, 111, 139, 90, 99, 125, 77, 85, 109, 64, 71, 93, 51, 57, 77, 36, 42, 59, 17, 20, 37, 0, 0, 0,
+ 115, 124, 140, 103, 111, 125, 90, 99, 112, 78, 85, 97, 64, 71, 82, 52, 57, 67, 36, 42, 50, 16, 20, 30, 0, 0, 0,
+ 117, 123, 125, 104, 110, 111, 92, 98, 99, 79, 85, 86, 65, 71, 72, 51, 58, 59, 37, 42, 43, 17, 21, 22, 0, 0, 0,
+ 118, 123, 110, 105, 110, 97, 93, 98, 86, 78, 84, 74, 66, 71, 62, 52, 57, 49, 37, 42, 34, 17, 22, 14, 0, 0, 0,
+ 120, 123, 93, 106, 109, 82, 94, 97, 72, 80, 84, 61, 66, 71, 50, 52, 57, 38, 37, 42, 24, 17, 22, 2, 0, 0, 0,
+ 121, 122, 75, 108, 109, 66, 95, 97, 58, 80, 84, 48, 66, 71, 37, 52, 57, 26, 37, 42, 12, 16, 22, 0, 0, 0, 0,
+ 122, 123, 62, 108, 109, 52, 95, 97, 45, 81, 84, 36, 67, 70, 26, 52, 57, 14, 37, 42, 0, 15, 22, 0, 0, 0, 0,
+ 113, 107, 177, 102, 96, 159, 89, 85, 141, 78, 72, 124, 65, 60, 107, 52, 46, 89, 37, 30, 70, 18, 5, 46, 0, 0, 6,
+ 116, 107, 160, 104, 96, 144, 92, 85, 129, 80, 72, 112, 67, 60, 96, 53, 47, 80, 38, 31, 62, 19, 7, 39, 0, 0, 0,
+ 118, 107, 147, 105, 96, 131, 93, 85, 118, 80, 72, 101, 67, 60, 87, 54, 47, 71, 39, 31, 54, 19, 8, 32, 0, 0, 0,
+ 119, 107, 132, 106, 96, 118, 94, 85, 106, 81, 73, 91, 67, 60, 77, 54, 47, 63, 39, 32, 47, 20, 9, 25, 0, 0, 0,
+ 119, 107, 118, 106, 95, 105, 94, 85, 93, 81, 72, 80, 68, 60, 68, 54, 47, 54, 39, 32, 39, 20, 11, 18, 0, 0, 0,
+ 121, 107, 104, 107, 96, 92, 95, 84, 80, 81, 72, 69, 68, 61, 58, 54, 48, 46, 39, 33, 31, 20, 12, 9, 0, 0, 0,
+ 123, 107, 88, 108, 95, 77, 96, 84, 68, 82, 72, 57, 68, 60, 46, 54, 47, 35, 39, 33, 20, 19, 13, 2, 0, 0, 0,
+ 123, 106, 72, 110, 95, 63, 96, 84, 54, 82, 72, 45, 69, 60, 35, 55, 48, 23, 39, 33, 9, 18, 14, 0, 0, 0, 0,
+ 125, 106, 60, 110, 94, 50, 98, 84, 42, 83, 72, 34, 69, 60, 25, 55, 48, 12, 39, 33, 0, 17, 13, 0, 0, 0, 0,
+ 118, 89, 165, 105, 79, 148, 93, 69, 132, 81, 57, 115, 68, 45, 99, 55, 32, 82, 41, 15, 64, 21, 0, 41, 0, 0, 0,
+ 120, 89, 150, 107, 79, 135, 96, 69, 121, 82, 58, 105, 70, 46, 89, 56, 34, 73, 41, 17, 56, 21, 0, 34, 0, 0, 0,
+ 121, 89, 137, 108, 79, 123, 96, 69, 109, 82, 58, 95, 70, 47, 81, 56, 34, 66, 41, 18, 49, 21, 0, 28, 0, 0, 0,
+ 122, 90, 124, 109, 79, 110, 96, 69, 99, 83, 58, 85, 70, 47, 72, 56, 35, 58, 41, 19, 42, 21, 0, 22, 0, 0, 0,
+ 123, 90, 111, 110, 79, 98, 97, 69, 87, 83, 59, 75, 70, 47, 63, 56, 35, 50, 41, 20, 35, 21, 0, 14, 0, 0, 0,
+ 123, 90, 98, 110, 79, 87, 97, 70, 76, 84, 58, 64, 70, 48, 53, 56, 36, 41, 40, 21, 26, 21, 0, 5, 0, 0, 0,
+ 125, 89, 84, 111, 79, 73, 97, 69, 64, 84, 59, 54, 70, 48, 43, 56, 36, 31, 40, 22, 17, 20, 1, 1, 0, 0, 0,
+ 125, 89, 69, 112, 79, 60, 98, 70, 51, 84, 59, 42, 70, 48, 32, 56, 36, 20, 41, 22, 5, 19, 2, 0, 0, 0, 0,
+ 126, 89, 57, 112, 79, 49, 99, 70, 41, 84, 59, 32, 70, 48, 22, 56, 36, 10, 40, 22, 0, 18, 2, 0, 0, 0, 0,
+ 121, 67, 154, 108, 58, 138, 97, 50, 124, 84, 39, 107, 71, 28, 92, 58, 12, 76, 43, 0, 59, 20, 0, 37, 0, 0, 0,
+ 124, 68, 140, 111, 59, 126, 98, 50, 112, 84, 40, 98, 71, 29, 83, 58, 15, 67, 42, 0, 51, 20, 0, 30, 0, 0, 0,
+ 124, 68, 129, 111, 59, 114, 99, 51, 102, 86, 41, 88, 71, 30, 75, 58, 17, 60, 42, 0, 45, 20, 0, 24, 0, 0, 0,
+ 125, 70, 116, 111, 60, 103, 99, 51, 92, 85, 41, 79, 71, 31, 66, 58, 19, 53, 42, 3, 38, 20, 0, 17, 0, 0, 0,
+ 125, 70, 104, 111, 61, 93, 99, 52, 81, 85, 43, 69, 72, 32, 58, 58, 20, 45, 42, 4, 31, 20, 0, 8, 0, 0, 0,
+ 126, 70, 92, 111, 61, 81, 99, 52, 71, 85, 42, 60, 71, 33, 49, 57, 21, 37, 42, 6, 23, 20, 0, 3, 0, 0, 0,
+ 126, 70, 79, 112, 61, 70, 99, 53, 60, 85, 43, 50, 71, 33, 39, 57, 22, 28, 41, 7, 13, 19, 0, 0, 0, 0, 0,
+ 127, 71, 66, 113, 62, 56, 100, 53, 48, 86, 44, 39, 71, 34, 29, 57, 23, 18, 41, 8, 2, 18, 0, 0, 0, 0, 0,
+ 128, 70, 55, 114, 62, 46, 100, 54, 39, 86, 44, 30, 71, 34, 20, 57, 23, 7, 41, 9, 0, 18, 0, 0, 0, 0, 0,
+ 124, 41, 145, 111, 32, 128, 99, 23, 114, 86, 10, 100, 73, 0, 85, 60, 0, 71, 43, 0, 54, 17, 0, 32, 0, 0, 0,
+ 126, 42, 131, 113, 33, 117, 100, 25, 104, 86, 14, 90, 73, 0, 77, 60, 0, 63, 44, 0, 47, 18, 0, 25, 0, 0, 0,
+ 127, 43, 120, 113, 34, 106, 101, 26, 95, 86, 17, 82, 73, 2, 69, 59, 0, 56, 43, 0, 41, 18, 0, 19, 0, 0, 0,
+ 127, 45, 109, 113, 37, 97, 101, 28, 85, 86, 19, 74, 73, 5, 61, 59, 0, 48, 43, 0, 34, 19, 0, 11, 0, 0, 0,
+ 127, 46, 98, 114, 38, 86, 100, 30, 76, 87, 21, 65, 73, 9, 54, 59, 0, 41, 43, 0, 26, 18, 0, 5, 0, 0, 0,
+ 127, 47, 87, 113, 39, 76, 101, 31, 67, 86, 22, 56, 72, 11, 45, 59, 0, 33, 43, 0, 19, 18, 0, 2, 0, 0, 0,
+ 128, 48, 75, 114, 39, 65, 101, 33, 56, 86, 23, 46, 72, 12, 36, 58, 0, 24, 42, 0, 9, 17, 0, 0, 0, 0, 0,
+ 129, 48, 63, 114, 41, 54, 102, 33, 46, 87, 24, 36, 72, 14, 26, 58, 1, 14, 42, 0, 2, 16, 0, 0, 0, 0, 0,
+ 128, 48, 53, 114, 41, 44, 102, 34, 37, 87, 25, 27, 72, 15, 17, 58, 1, 3, 41, 0, 0, 15, 0, 0, 0, 0, 0,
+ 0, 189, 242, 0, 169, 217, 0, 151, 194, 0, 132, 170, 0, 113, 147, 0, 94, 123, 0, 74, 99, 0, 51, 71, 0, 15, 34,
+ 1, 187, 219, 1, 167, 195, 0, 150, 175, 0, 131, 153, 0, 113, 132, 0, 94, 111, 0, 74, 89, 0, 50, 63, 0, 13, 28,
+ 1, 186, 198, 1, 167, 178, 0, 149, 158, 0, 130, 139, 0, 111, 119, 0, 93, 100, 0, 74, 80, 0, 50, 55, 0, 13, 22,
+ 1, 185, 176, 1, 165, 159, 1, 148, 142, 0, 129, 123, 0, 111, 106, 0, 93, 89, 0, 73, 70, 0, 50, 47, 0, 13, 13,
+ 1, 184, 157, 1, 164, 141, 1, 147, 125, 0, 128, 110, 0, 110, 93, 0, 92, 77, 0, 73, 60, 0, 50, 39, 0, 12, 5,
+ 25, 182, 137, 25, 163, 122, 17, 146, 109, 0, 128, 96, 0, 110, 81, 0, 92, 66, 0, 73, 51, 0, 50, 30, 0, 10, 0,
+ 42, 181, 114, 35, 163, 102, 30, 145, 91, 14, 127, 80, 0, 109, 67, 0, 91, 53, 0, 72, 39, 0, 50, 19, 0, 10, 0,
+ 52, 181, 92, 43, 162, 83, 32, 145, 73, 19, 126, 63, 0, 108, 52, 0, 90, 40, 0, 72, 27, 0, 50, 7, 0, 10, 0,
+ 57, 181, 74, 48, 162, 66, 37, 144, 57, 24, 126, 49, 7, 108, 40, 0, 90, 29, 0, 72, 15, 0, 49, 0, 0, 10, 0,
+ 1, 170, 227, 1, 152, 203, 0, 136, 182, 0, 119, 159, 0, 101, 137, 0, 84, 115, 0, 65, 92, 0, 43, 66, 0, 1, 29,
+ 1, 169, 206, 1, 151, 184, 1, 136, 165, 0, 118, 144, 0, 102, 125, 0, 84, 105, 0, 65, 83, 0, 43, 58, 0, 0, 22,
+ 29, 168, 186, 21, 151, 167, 14, 135, 150, 4, 118, 131, 0, 101, 112, 0, 83, 94, 0, 65, 75, 0, 43, 51, 0, 0, 16,
+ 41, 167, 167, 33, 150, 150, 31, 134, 134, 19, 117, 117, 4, 100, 100, 0, 83, 83, 0, 65, 65, 0, 42, 43, 0, 0, 8,
+ 48, 167, 149, 41, 149, 133, 33, 133, 118, 25, 116, 103, 13, 99, 88, 0, 83, 73, 0, 65, 56, 0, 42, 35, 0, 0, 0,
+ 58, 165, 130, 49, 148, 115, 42, 132, 103, 31, 115, 89, 18, 99, 75, 0, 82, 61, 0, 64, 46, 0, 42, 26, 0, 0, 0,
+ 62, 164, 110, 55, 147, 97, 45, 132, 87, 35, 115, 75, 22, 98, 63, 5, 82, 50, 0, 64, 36, 0, 42, 16, 0, 0, 0,
+ 69, 164, 89, 60, 147, 78, 50, 131, 70, 37, 114, 59, 26, 98, 49, 10, 81, 37, 0, 64, 24, 0, 42, 4, 0, 0, 0,
+ 71, 164, 71, 63, 147, 63, 53, 131, 55, 40, 114, 47, 28, 98, 38, 13, 81, 26, 0, 64, 12, 0, 42, 0, 0, 0, 0,
+ 28, 153, 214, 24, 138, 193, 23, 123, 171, 16, 107, 150, 0, 91, 130, 0, 75, 109, 0, 58, 87, 0, 35, 61, 0, 0, 25,
+ 48, 153, 194, 41, 138, 174, 34, 123, 156, 27, 107, 136, 16, 91, 117, 1, 75, 98, 0, 57, 78, 0, 35, 53, 0, 0, 17,
+ 55, 153, 177, 47, 137, 158, 42, 122, 142, 33, 107, 124, 22, 91, 106, 6, 75, 88, 0, 57, 70, 0, 35, 46, 0, 0, 9,
+ 61, 152, 158, 53, 136, 143, 45, 122, 127, 36, 106, 111, 24, 90, 94, 10, 74, 78, 0, 57, 61, 0, 35, 39, 0, 0, 2,
+ 67, 151, 141, 59, 135, 126, 49, 121, 112, 39, 105, 98, 29, 90, 83, 14, 74, 68, 0, 57, 52, 0, 35, 31, 0, 0, 0,
+ 71, 150, 123, 62, 135, 110, 54, 120, 98, 42, 105, 84, 31, 89, 71, 16, 74, 58, 0, 57, 43, 0, 35, 22, 0, 0, 0,
+ 74, 150, 105, 64, 134, 92, 55, 120, 83, 45, 104, 71, 34, 89, 59, 20, 73, 47, 0, 57, 32, 0, 35, 13, 0, 0, 0,
+ 78, 149, 84, 69, 134, 75, 59, 120, 66, 47, 103, 56, 34, 88, 46, 22, 73, 34, 1, 57, 20, 0, 35, 1, 0, 0, 0,
+ 80, 149, 69, 70, 133, 61, 60, 119, 53, 49, 103, 44, 36, 88, 35, 23, 73, 24, 2, 56, 10, 0, 35, 0, 0, 0, 0,
+ 58, 136, 200, 50, 122, 180, 45, 109, 162, 38, 94, 141, 27, 80, 121, 15, 65, 102, 0, 48, 81, 0, 26, 56, 0, 0, 19,
+ 66, 136, 182, 59, 122, 163, 52, 109, 146, 42, 94, 128, 32, 80, 109, 20, 65, 91, 2, 48, 72, 0, 26, 49, 0, 0, 11,
+ 70, 136, 165, 62, 122, 149, 55, 108, 133, 46, 94, 116, 35, 80, 99, 21, 65, 82, 4, 49, 64, 0, 26, 41, 0, 0, 3,
+ 76, 135, 149, 66, 121, 133, 58, 108, 119, 48, 94, 103, 36, 79, 88, 23, 65, 73, 7, 49, 56, 0, 27, 34, 0, 0, 0,
+ 78, 135, 133, 69, 120, 118, 60, 107, 106, 50, 93, 92, 39, 79, 77, 26, 65, 63, 8, 49, 47, 0, 27, 26, 0, 0, 0,
+ 82, 134, 117, 71, 120, 104, 62, 107, 92, 51, 93, 79, 39, 78, 66, 27, 64, 53, 10, 48, 39, 0, 27, 18, 0, 0, 0,
+ 84, 134, 99, 73, 119, 87, 64, 106, 77, 53, 92, 66, 42, 78, 55, 28, 64, 42, 11, 48, 29, 0, 28, 9, 0, 0, 0,
+ 87, 133, 81, 76, 119, 72, 66, 106, 62, 55, 92, 52, 43, 78, 42, 29, 64, 31, 12, 48, 17, 0, 28, 0, 0, 0, 0,
+ 88, 134, 67, 77, 119, 58, 68, 106, 51, 56, 92, 42, 44, 78, 32, 30, 64, 20, 12, 48, 6, 0, 28, 0, 0, 0, 0,
+ 73, 120, 189, 64, 107, 168, 57, 96, 151, 47, 82, 133, 38, 69, 114, 26, 55, 95, 11, 39, 75, 0, 16, 51, 0, 0, 14,
+ 78, 120, 171, 69, 107, 153, 62, 95, 137, 51, 82, 119, 40, 69, 102, 29, 55, 85, 15, 39, 66, 0, 17, 44, 0, 0, 4,
+ 81, 120, 156, 71, 107, 140, 64, 95, 125, 53, 82, 109, 42, 69, 93, 31, 55, 77, 16, 39, 59, 0, 18, 37, 0, 0, 0,
+ 85, 120, 141, 74, 107, 126, 65, 95, 112, 54, 82, 97, 43, 69, 82, 32, 55, 67, 17, 39, 51, 0, 19, 30, 0, 0, 0,
+ 86, 119, 126, 76, 106, 112, 66, 95, 100, 56, 81, 85, 45, 69, 72, 33, 55, 59, 18, 40, 43, 0, 19, 22, 0, 0, 0,
+ 89, 119, 110, 78, 106, 98, 69, 94, 87, 56, 81, 75, 46, 68, 62, 33, 55, 49, 18, 40, 35, 0, 20, 15, 0, 0, 0,
+ 89, 119, 95, 80, 106, 83, 70, 94, 73, 58, 81, 63, 46, 68, 51, 34, 55, 39, 19, 40, 25, 0, 20, 4, 0, 0, 0,
+ 92, 118, 78, 82, 106, 68, 70, 93, 59, 59, 81, 49, 47, 68, 39, 34, 55, 28, 19, 40, 14, 0, 20, 0, 0, 0, 0,
+ 93, 118, 65, 82, 105, 55, 72, 93, 48, 60, 81, 39, 47, 68, 29, 34, 55, 18, 20, 40, 2, 0, 20, 0, 0, 0, 0,
+ 83, 104, 177, 74, 93, 159, 65, 82, 142, 56, 70, 124, 45, 57, 106, 33, 44, 89, 20, 28, 70, 1, 4, 46, 0, 0, 8,
+ 86, 104, 161, 78, 93, 145, 68, 82, 128, 58, 70, 112, 48, 58, 96, 35, 45, 80, 21, 29, 62, 1, 6, 40, 0, 0, 0,
+ 89, 104, 147, 79, 93, 131, 69, 82, 118, 59, 70, 102, 47, 58, 87, 36, 45, 72, 23, 29, 55, 3, 7, 33, 0, 0, 0,
+ 90, 104, 132, 80, 93, 119, 71, 82, 106, 60, 70, 91, 48, 58, 77, 37, 45, 62, 23, 30, 47, 4, 7, 26, 0, 0, 0,
+ 92, 104, 118, 82, 93, 105, 72, 82, 93, 61, 69, 80, 50, 58, 68, 37, 45, 55, 23, 30, 39, 4, 8, 18, 0, 0, 0,
+ 94, 104, 105, 82, 92, 93, 72, 82, 82, 61, 70, 70, 50, 58, 58, 38, 46, 46, 23, 31, 31, 6, 10, 11, 0, 0, 0,
+ 95, 104, 90, 84, 92, 79, 74, 82, 70, 62, 70, 58, 50, 58, 48, 37, 46, 36, 23, 31, 22, 4, 11, 3, 0, 0, 0,
+ 96, 103, 74, 85, 92, 65, 75, 81, 56, 63, 70, 47, 50, 58, 37, 38, 46, 25, 24, 31, 11, 3, 11, 0, 0, 0, 0,
+ 97, 103, 62, 86, 92, 53, 76, 81, 45, 63, 69, 36, 51, 58, 27, 38, 46, 15, 23, 31, 0, 3, 11, 0, 0, 0, 0,
+ 90, 87, 165, 81, 77, 148, 72, 67, 132, 62, 55, 116, 50, 44, 99, 39, 31, 82, 25, 14, 64, 1, 0, 42, 0, 0, 1,
+ 93, 87, 150, 83, 77, 135, 74, 67, 121, 63, 56, 105, 52, 45, 90, 40, 32, 74, 25, 16, 57, 3, 0, 35, 0, 0, 0,
+ 95, 87, 138, 85, 77, 123, 75, 67, 109, 63, 57, 95, 53, 45, 81, 41, 33, 66, 26, 17, 50, 4, 0, 28, 0, 0, 0,
+ 95, 88, 124, 85, 77, 111, 75, 67, 99, 63, 57, 86, 53, 45, 72, 41, 33, 58, 26, 18, 43, 5, 1, 22, 0, 0, 0,
+ 97, 88, 112, 87, 77, 100, 76, 68, 88, 64, 57, 76, 53, 46, 63, 41, 34, 50, 26, 19, 35, 5, 2, 14, 0, 0, 0,
+ 99, 87, 99, 87, 78, 88, 76, 68, 77, 65, 57, 65, 53, 46, 54, 41, 35, 42, 27, 20, 27, 6, 2, 5, 0, 0, 0,
+ 100, 87, 85, 88, 77, 75, 77, 68, 65, 65, 57, 54, 53, 46, 44, 41, 35, 32, 27, 21, 19, 5, 3, 2, 0, 0, 0,
+ 100, 88, 71, 89, 77, 61, 78, 68, 53, 66, 57, 44, 53, 47, 33, 41, 35, 22, 27, 21, 7, 5, 3, 0, 0, 0, 0,
+ 101, 87, 60, 90, 77, 52, 79, 68, 44, 66, 58, 34, 53, 47, 25, 41, 35, 13, 26, 22, 0, 5, 3, 0, 0, 0, 0,
+ 97, 67, 155, 86, 58, 138, 77, 50, 125, 66, 39, 108, 55, 28, 92, 43, 12, 76, 29, 0, 59, 2, 0, 37, 0, 0, 0,
+ 99, 67, 141, 88, 59, 127, 78, 50, 113, 68, 40, 98, 56, 29, 83, 44, 15, 68, 29, 0, 52, 3, 0, 30, 0, 0, 0,
+ 100, 68, 129, 89, 59, 115, 80, 51, 103, 68, 41, 89, 56, 30, 75, 44, 16, 61, 30, 0, 45, 4, 0, 24, 0, 0, 0,
+ 100, 69, 118, 90, 60, 104, 80, 51, 92, 67, 41, 79, 56, 31, 66, 44, 18, 53, 29, 2, 38, 4, 0, 18, 0, 0, 0,
+ 101, 69, 104, 90, 61, 93, 79, 51, 82, 67, 42, 70, 56, 32, 59, 44, 20, 46, 29, 4, 31, 6, 0, 9, 0, 0, 0,
+ 102, 69, 93, 90, 61, 83, 80, 52, 72, 68, 42, 61, 56, 33, 50, 43, 20, 38, 29, 5, 23, 7, 0, 4, 0, 0, 0,
+ 102, 70, 80, 91, 61, 71, 80, 52, 61, 68, 43, 51, 56, 32, 40, 44, 21, 29, 30, 6, 14, 7, 0, 0, 0, 0, 0,
+ 103, 70, 68, 92, 61, 58, 81, 53, 50, 69, 43, 41, 56, 34, 31, 43, 22, 19, 29, 7, 3, 7, 0, 0, 0, 0, 0,
+ 104, 70, 57, 92, 61, 48, 82, 53, 40, 69, 43, 32, 56, 34, 22, 43, 23, 10, 29, 8, 0, 6, 0, 0, 0, 0, 0,
+ 101, 45, 145, 91, 35, 129, 80, 26, 116, 69, 15, 101, 59, 0, 86, 46, 0, 71, 31, 0, 55, 0, 0, 33, 0, 0, 0,
+ 104, 44, 132, 92, 36, 118, 82, 28, 105, 71, 17, 91, 58, 3, 77, 46, 0, 63, 31, 0, 48, 2, 0, 26, 0, 0, 0,
+ 104, 46, 121, 93, 37, 107, 82, 30, 96, 70, 20, 83, 58, 6, 70, 46, 0, 57, 32, 0, 41, 4, 0, 20, 0, 0, 0,
+ 104, 48, 110, 93, 40, 98, 82, 31, 87, 70, 22, 74, 59, 9, 62, 45, 0, 49, 31, 0, 35, 6, 0, 13, 0, 0, 0,
+ 104, 48, 99, 92, 41, 88, 82, 32, 77, 70, 23, 65, 58, 11, 54, 46, 0, 42, 32, 0, 27, 7, 0, 5, 0, 0, 0,
+ 105, 50, 88, 93, 41, 77, 82, 34, 68, 71, 24, 57, 58, 13, 46, 45, 1, 35, 31, 0, 21, 7, 0, 2, 0, 0, 0,
+ 105, 50, 76, 94, 41, 66, 83, 34, 57, 71, 25, 47, 58, 15, 37, 45, 2, 25, 32, 0, 11, 7, 0, 0, 0, 0, 0,
+ 106, 50, 64, 94, 42, 55, 83, 35, 47, 71, 26, 38, 58, 16, 27, 45, 4, 17, 31, 0, 4, 7, 0, 0, 0, 0, 0,
+ 106, 51, 54, 95, 42, 45, 83, 35, 38, 71, 27, 30, 58, 16, 19, 45, 5, 7, 30, 0, 0, 6, 0, 0, 0, 0, 0,
+ 0, 181, 240, 0, 162, 216, 0, 144, 193, 0, 126, 168, 0, 109, 146, 0, 91, 123, 0, 71, 98, 0, 48, 71, 0, 9, 34,
+ 0, 179, 218, 0, 161, 195, 0, 144, 174, 0, 126, 153, 0, 108, 132, 0, 90, 110, 0, 71, 88, 0, 48, 63, 0, 8, 29,
+ 0, 178, 197, 0, 159, 177, 0, 143, 159, 0, 125, 139, 0, 107, 119, 0, 90, 99, 0, 71, 79, 0, 48, 55, 0, 8, 22,
+ 0, 177, 177, 0, 158, 158, 0, 142, 141, 0, 124, 123, 0, 107, 106, 0, 89, 88, 0, 71, 70, 0, 48, 47, 0, 8, 14,
+ 0, 176, 157, 0, 158, 141, 0, 141, 126, 0, 123, 109, 0, 106, 93, 0, 89, 78, 0, 70, 60, 0, 47, 39, 0, 7, 5,
+ 0, 175, 138, 0, 157, 123, 0, 141, 110, 0, 123, 96, 0, 105, 81, 0, 88, 67, 0, 70, 51, 0, 48, 30, 0, 6, 0,
+ 0, 173, 115, 0, 155, 104, 0, 140, 92, 0, 122, 80, 0, 105, 67, 0, 88, 55, 0, 69, 40, 0, 47, 20, 0, 6, 0,
+ 0, 173, 94, 0, 155, 85, 0, 139, 75, 0, 121, 64, 0, 104, 53, 0, 88, 42, 0, 70, 28, 0, 47, 9, 0, 6, 0,
+ 0, 173, 76, 0, 155, 70, 0, 138, 61, 0, 122, 53, 0, 104, 44, 0, 87, 32, 0, 69, 18, 0, 47, 0, 0, 6, 0,
+ 0, 164, 226, 0, 147, 203, 0, 131, 181, 0, 114, 158, 0, 97, 136, 0, 80, 115, 0, 63, 92, 0, 40, 65, 0, 0, 30,
+ 0, 162, 205, 0, 145, 184, 0, 130, 164, 0, 114, 143, 0, 97, 124, 0, 81, 104, 0, 63, 83, 0, 40, 58, 0, 0, 23,
+ 0, 162, 187, 0, 145, 167, 0, 130, 150, 0, 113, 131, 0, 96, 112, 0, 80, 93, 0, 62, 74, 0, 40, 50, 0, 0, 16,
+ 0, 160, 167, 0, 144, 150, 0, 129, 134, 0, 112, 116, 0, 96, 100, 0, 80, 82, 0, 62, 65, 0, 40, 43, 0, 0, 7,
+ 0, 160, 148, 0, 143, 133, 0, 128, 118, 0, 111, 103, 0, 96, 88, 0, 80, 73, 0, 62, 56, 0, 40, 35, 0, 0, 0,
+ 0, 158, 130, 0, 142, 117, 0, 127, 104, 0, 111, 89, 0, 95, 76, 0, 79, 62, 0, 62, 46, 0, 40, 26, 0, 0, 0,
+ 0, 158, 111, 0, 141, 99, 0, 127, 88, 0, 111, 76, 0, 95, 63, 0, 79, 51, 0, 62, 37, 0, 40, 18, 0, 0, 0,
+ 0, 158, 91, 0, 141, 81, 0, 126, 72, 0, 110, 62, 0, 94, 50, 0, 79, 39, 0, 62, 25, 0, 40, 5, 0, 0, 0,
+ 0, 157, 74, 0, 141, 66, 0, 126, 59, 0, 110, 49, 0, 94, 40, 0, 78, 29, 0, 61, 15, 0, 40, 0, 0, 0, 0,
+ 0, 148, 214, 0, 133, 192, 0, 119, 171, 0, 103, 150, 0, 87, 129, 0, 72, 108, 0, 55, 86, 0, 32, 61, 0, 0, 25,
+ 0, 147, 193, 0, 132, 173, 0, 118, 155, 0, 103, 136, 0, 87, 116, 0, 72, 98, 0, 55, 78, 0, 32, 53, 0, 0, 17,
+ 0, 147, 176, 0, 132, 158, 0, 118, 142, 0, 102, 124, 0, 87, 106, 0, 72, 88, 0, 55, 69, 0, 33, 46, 0, 0, 9,
+ 0, 146, 159, 0, 131, 142, 0, 117, 127, 0, 102, 111, 0, 87, 95, 0, 71, 79, 0, 55, 61, 0, 33, 39, 0, 0, 2,
+ 0, 145, 140, 0, 130, 126, 0, 117, 112, 0, 101, 98, 0, 86, 83, 0, 71, 68, 0, 55, 52, 0, 33, 31, 0, 0, 0,
+ 0, 144, 124, 0, 130, 111, 0, 116, 99, 0, 101, 84, 0, 86, 72, 0, 71, 59, 0, 55, 43, 0, 33, 23, 0, 0, 0,
+ 0, 144, 106, 0, 129, 94, 0, 115, 83, 0, 101, 72, 0, 85, 60, 0, 71, 48, 0, 55, 34, 0, 33, 14, 0, 0, 0,
+ 3, 143, 86, 0, 129, 77, 0, 115, 68, 0, 100, 58, 0, 85, 48, 0, 70, 36, 0, 54, 22, 0, 33, 3, 0, 0, 0,
+ 18, 143, 72, 13, 128, 63, 0, 115, 57, 0, 100, 47, 0, 85, 37, 0, 70, 26, 0, 54, 13, 0, 33, 0, 0, 0, 0,
+ 0, 132, 200, 0, 118, 179, 0, 105, 161, 0, 91, 140, 0, 76, 121, 0, 62, 101, 0, 46, 81, 0, 24, 56, 0, 0, 19,
+ 0, 131, 182, 0, 118, 163, 0, 105, 146, 0, 91, 128, 0, 77, 110, 0, 62, 91, 0, 46, 72, 0, 25, 48, 0, 0, 11,
+ 0, 131, 165, 0, 117, 149, 0, 104, 133, 0, 91, 116, 0, 77, 99, 0, 62, 82, 0, 46, 64, 0, 25, 41, 0, 0, 4,
+ 0, 131, 149, 0, 116, 134, 0, 104, 119, 0, 91, 104, 0, 77, 89, 0, 62, 73, 0, 46, 56, 0, 25, 34, 0, 0, 0,
+ 10, 130, 133, 2, 116, 119, 0, 104, 106, 0, 90, 91, 0, 76, 78, 0, 62, 64, 0, 46, 48, 0, 26, 27, 0, 0, 0,
+ 23, 130, 118, 20, 116, 104, 13, 103, 93, 3, 89, 79, 0, 76, 67, 0, 62, 54, 0, 46, 39, 0, 26, 19, 0, 0, 0,
+ 33, 129, 101, 27, 115, 89, 19, 103, 79, 9, 89, 67, 0, 75, 56, 0, 61, 43, 0, 46, 29, 0, 26, 10, 0, 0, 0,
+ 41, 128, 83, 35, 115, 73, 27, 102, 64, 15, 89, 55, 0, 76, 45, 0, 62, 33, 0, 46, 18, 0, 26, 0, 0, 0, 0,
+ 43, 129, 69, 38, 115, 61, 30, 102, 54, 17, 89, 45, 2, 75, 34, 0, 61, 23, 0, 46, 9, 0, 26, 0, 0, 0, 0,
+ 1, 116, 188, 1, 104, 168, 0, 92, 151, 0, 79, 132, 0, 66, 113, 0, 52, 94, 0, 36, 75, 0, 14, 52, 0, 0, 14,
+ 17, 116, 171, 16, 104, 153, 14, 92, 137, 8, 79, 119, 0, 67, 102, 0, 53, 85, 0, 37, 67, 0, 16, 44, 0, 0, 4,
+ 31, 116, 155, 27, 104, 140, 21, 92, 125, 13, 79, 109, 3, 66, 93, 0, 53, 77, 0, 37, 59, 0, 16, 38, 0, 0, 0,
+ 37, 115, 141, 30, 103, 126, 26, 92, 112, 16, 79, 98, 5, 66, 83, 0, 53, 67, 0, 38, 51, 0, 17, 31, 0, 0, 0,
+ 41, 115, 126, 37, 103, 112, 31, 92, 100, 22, 79, 86, 10, 66, 72, 0, 53, 59, 0, 38, 44, 0, 17, 23, 0, 0, 0,
+ 48, 115, 111, 41, 102, 99, 34, 91, 88, 24, 78, 76, 14, 66, 63, 0, 53, 50, 0, 38, 36, 0, 18, 15, 0, 0, 0,
+ 51, 115, 95, 46, 102, 85, 37, 91, 74, 26, 78, 63, 16, 66, 52, 0, 53, 40, 0, 38, 26, 0, 18, 5, 0, 0, 0,
+ 55, 114, 80, 47, 102, 69, 40, 90, 60, 30, 78, 51, 19, 66, 41, 3, 53, 29, 0, 38, 15, 0, 17, 0, 0, 0, 0,
+ 56, 114, 66, 50, 102, 58, 40, 91, 50, 32, 78, 41, 18, 66, 32, 4, 53, 21, 0, 38, 5, 0, 17, 0, 0, 0, 0,
+ 39, 102, 178, 37, 90, 159, 30, 79, 142, 21, 68, 124, 14, 55, 106, 0, 42, 89, 0, 26, 70, 0, 4, 46, 0, 0, 8,
+ 48, 102, 161, 42, 90, 145, 35, 79, 128, 26, 68, 112, 19, 55, 96, 3, 43, 79, 0, 27, 62, 0, 6, 40, 0, 0, 0,
+ 50, 102, 147, 44, 90, 132, 37, 79, 118, 30, 68, 102, 20, 56, 87, 7, 43, 72, 0, 28, 55, 0, 6, 34, 0, 0, 0,
+ 53, 101, 133, 47, 90, 118, 41, 79, 106, 32, 68, 91, 21, 56, 78, 9, 43, 63, 0, 28, 47, 0, 6, 26, 0, 0, 0,
+ 57, 101, 119, 50, 89, 106, 42, 79, 94, 34, 67, 81, 24, 56, 68, 9, 44, 55, 0, 29, 40, 0, 6, 19, 0, 0, 0,
+ 60, 100, 105, 50, 90, 94, 45, 80, 83, 36, 68, 71, 24, 56, 59, 11, 44, 46, 0, 29, 32, 0, 7, 12, 0, 0, 0,
+ 63, 101, 91, 55, 90, 80, 46, 79, 70, 37, 68, 59, 26, 56, 49, 12, 44, 37, 1, 29, 23, 0, 7, 3, 0, 0, 0,
+ 64, 101, 75, 56, 89, 67, 48, 79, 57, 37, 68, 48, 27, 56, 37, 15, 44, 26, 0, 29, 12, 0, 7, 0, 0, 0, 0,
+ 66, 101, 64, 58, 89, 55, 49, 79, 47, 39, 68, 38, 27, 56, 29, 14, 44, 18, 1, 30, 2, 0, 7, 0, 0, 0, 0,
+ 57, 86, 165, 51, 75, 148, 45, 65, 133, 38, 54, 116, 28, 43, 100, 16, 29, 83, 0, 13, 64, 0, 0, 42, 0, 0, 3,
+ 60, 86, 151, 55, 75, 135, 47, 66, 121, 39, 55, 105, 30, 44, 90, 18, 31, 74, 3, 16, 57, 0, 1, 35, 0, 0, 0,
+ 62, 86, 139, 56, 75, 123, 49, 66, 110, 40, 55, 95, 30, 44, 81, 19, 31, 66, 4, 17, 51, 0, 1, 29, 0, 0, 0,
+ 65, 86, 125, 56, 76, 112, 49, 66, 99, 39, 55, 86, 31, 44, 72, 19, 32, 59, 5, 18, 44, 0, 1, 23, 0, 0, 0,
+ 67, 86, 113, 58, 75, 100, 51, 66, 88, 41, 56, 77, 31, 45, 64, 20, 32, 51, 6, 18, 35, 0, 1, 14, 0, 0, 0,
+ 69, 86, 99, 61, 76, 88, 52, 66, 78, 43, 56, 66, 32, 45, 55, 20, 33, 42, 7, 19, 27, 0, 1, 6, 0, 0, 0,
+ 69, 86, 86, 61, 76, 75, 53, 67, 66, 43, 56, 55, 33, 45, 45, 21, 34, 34, 8, 20, 20, 0, 2, 2, 0, 0, 0,
+ 71, 86, 72, 63, 75, 62, 54, 66, 55, 45, 56, 45, 33, 45, 35, 22, 34, 23, 7, 20, 8, 0, 2, 0, 0, 0, 0,
+ 71, 86, 62, 64, 75, 53, 55, 66, 46, 45, 56, 36, 33, 46, 27, 22, 34, 15, 8, 20, 0, 0, 2, 0, 0, 0, 0,
+ 69, 67, 156, 61, 58, 140, 53, 50, 125, 45, 39, 108, 35, 28, 93, 25, 12, 77, 12, 0, 59, 0, 0, 37, 0, 0, 0,
+ 71, 68, 142, 63, 59, 126, 56, 50, 114, 47, 40, 98, 37, 28, 84, 26, 15, 68, 12, 0, 53, 0, 0, 30, 0, 0, 0,
+ 72, 68, 130, 63, 59, 116, 56, 50, 104, 47, 40, 90, 38, 30, 75, 27, 16, 61, 13, 0, 46, 0, 0, 24, 0, 0, 0,
+ 73, 69, 118, 65, 59, 105, 57, 51, 92, 47, 41, 80, 37, 30, 67, 26, 18, 53, 14, 1, 39, 0, 0, 18, 0, 0, 0,
+ 74, 69, 106, 65, 60, 93, 57, 51, 82, 48, 41, 70, 38, 31, 59, 26, 19, 46, 13, 2, 32, 0, 0, 10, 0, 0, 0,
+ 76, 69, 95, 66, 61, 84, 58, 52, 73, 48, 42, 61, 37, 32, 50, 26, 20, 38, 14, 4, 24, 0, 0, 4, 0, 0, 0,
+ 76, 69, 81, 68, 60, 72, 58, 52, 62, 48, 42, 51, 38, 32, 41, 27, 21, 30, 14, 4, 16, 0, 0, 1, 0, 0, 0,
+ 76, 69, 68, 68, 61, 60, 60, 52, 51, 49, 43, 41, 38, 33, 32, 27, 21, 20, 14, 5, 5, 0, 0, 0, 0, 0, 0,
+ 78, 70, 59, 69, 61, 50, 60, 52, 42, 49, 43, 34, 39, 33, 24, 27, 22, 13, 14, 7, 1, 0, 0, 0, 0, 0, 0,
+ 75, 46, 146, 68, 38, 131, 60, 30, 117, 50, 19, 102, 41, 4, 87, 29, 0, 72, 13, 0, 55, 0, 0, 33, 0, 0, 0,
+ 78, 47, 132, 70, 39, 119, 61, 30, 105, 53, 20, 92, 42, 5, 78, 30, 0, 64, 13, 0, 49, 0, 0, 27, 0, 0, 0,
+ 79, 48, 122, 70, 40, 108, 62, 32, 96, 52, 22, 84, 42, 9, 71, 30, 0, 58, 14, 0, 42, 0, 0, 20, 0, 0, 0,
+ 79, 50, 111, 70, 42, 99, 62, 33, 88, 52, 23, 74, 41, 11, 63, 29, 0, 50, 14, 0, 36, 0, 0, 14, 0, 0, 0,
+ 80, 50, 99, 70, 42, 89, 61, 34, 78, 52, 25, 67, 41, 14, 55, 30, 0, 42, 15, 0, 28, 0, 0, 6, 0, 0, 0,
+ 81, 51, 89, 71, 43, 78, 62, 35, 69, 52, 25, 58, 42, 15, 47, 30, 3, 36, 15, 0, 22, 0, 0, 3, 0, 0, 0,
+ 81, 51, 77, 71, 44, 68, 63, 36, 59, 53, 26, 49, 41, 16, 38, 31, 4, 27, 16, 0, 12, 0, 0, 0, 0, 0, 0,
+ 81, 52, 65, 72, 43, 56, 63, 36, 48, 53, 27, 39, 41, 17, 29, 30, 4, 18, 14, 0, 3, 0, 0, 0, 0, 0, 0,
+ 81, 52, 55, 73, 44, 47, 64, 36, 39, 53, 28, 32, 42, 18, 21, 31, 6, 9, 14, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 174, 239, 0, 156, 214, 0, 139, 192, 0, 121, 168, 0, 105, 145, 0, 87, 123, 0, 68, 98, 0, 46, 70, 0, 3, 35,
+ 0, 172, 217, 0, 155, 194, 0, 139, 173, 0, 121, 152, 0, 104, 130, 0, 87, 110, 0, 69, 88, 0, 46, 63, 0, 4, 28,
+ 0, 171, 197, 0, 153, 175, 0, 138, 158, 0, 121, 139, 0, 103, 118, 0, 86, 100, 0, 68, 79, 0, 46, 55, 0, 4, 22,
+ 0, 170, 177, 0, 152, 158, 0, 136, 141, 0, 119, 124, 0, 103, 106, 0, 86, 88, 0, 68, 70, 0, 45, 47, 0, 3, 14,
+ 0, 169, 157, 0, 152, 141, 0, 136, 126, 0, 119, 109, 0, 102, 94, 0, 86, 78, 0, 68, 60, 0, 46, 39, 0, 3, 5,
+ 0, 167, 138, 0, 150, 124, 0, 135, 111, 0, 118, 97, 0, 102, 82, 0, 85, 68, 0, 68, 52, 0, 46, 31, 0, 3, 0,
+ 0, 167, 118, 0, 150, 104, 0, 135, 94, 0, 118, 81, 0, 101, 69, 0, 84, 56, 0, 67, 41, 0, 45, 21, 0, 3, 0,
+ 0, 166, 97, 0, 149, 87, 0, 134, 77, 0, 117, 67, 0, 101, 56, 0, 85, 44, 0, 67, 30, 0, 45, 10, 0, 3, 0,
+ 0, 165, 79, 0, 149, 73, 0, 133, 64, 0, 117, 56, 0, 101, 46, 0, 85, 34, 0, 68, 21, 0, 46, 1, 0, 3, 0,
+ 0, 158, 225, 0, 141, 201, 0, 126, 180, 0, 109, 158, 0, 94, 136, 0, 78, 114, 0, 60, 91, 0, 38, 66, 0, 0, 30,
+ 0, 156, 203, 0, 140, 183, 0, 125, 164, 0, 109, 143, 0, 94, 124, 0, 78, 104, 0, 61, 83, 0, 38, 57, 0, 0, 23,
+ 0, 156, 186, 0, 140, 166, 0, 125, 150, 0, 109, 130, 0, 93, 111, 0, 77, 93, 0, 60, 74, 0, 38, 50, 0, 0, 17,
+ 0, 155, 167, 0, 138, 149, 0, 124, 134, 0, 109, 117, 0, 93, 100, 0, 76, 83, 0, 60, 65, 0, 38, 43, 0, 0, 9,
+ 0, 153, 147, 0, 138, 134, 0, 124, 120, 0, 107, 103, 0, 92, 88, 0, 77, 73, 0, 60, 56, 0, 38, 35, 0, 0, 0,
+ 0, 153, 131, 0, 137, 118, 0, 122, 105, 0, 107, 90, 0, 91, 76, 0, 76, 63, 0, 60, 47, 0, 39, 28, 0, 0, 0,
+ 0, 153, 111, 0, 136, 100, 0, 123, 90, 0, 107, 77, 0, 92, 65, 0, 76, 52, 0, 60, 37, 0, 38, 18, 0, 0, 0,
+ 0, 152, 93, 0, 136, 82, 0, 122, 74, 0, 106, 63, 0, 91, 52, 0, 76, 40, 0, 59, 26, 0, 38, 6, 0, 0, 0,
+ 0, 151, 78, 0, 136, 69, 0, 121, 61, 0, 106, 52, 0, 91, 43, 0, 76, 32, 0, 59, 17, 0, 38, 0, 0, 0, 0,
+ 0, 143, 213, 0, 128, 191, 0, 115, 171, 0, 100, 149, 0, 84, 128, 0, 69, 108, 0, 52, 86, 0, 30, 61, 0, 0, 25,
+ 0, 142, 193, 0, 127, 173, 0, 114, 154, 0, 99, 134, 0, 84, 116, 0, 69, 98, 0, 52, 77, 0, 31, 53, 0, 0, 18,
+ 0, 141, 176, 0, 127, 158, 0, 114, 141, 0, 98, 122, 0, 84, 105, 0, 69, 88, 0, 53, 69, 0, 31, 46, 0, 0, 9,
+ 0, 141, 159, 0, 126, 142, 0, 113, 127, 0, 98, 110, 0, 83, 95, 0, 69, 78, 0, 53, 60, 0, 32, 39, 0, 0, 2,
+ 0, 140, 140, 0, 126, 126, 0, 112, 112, 0, 98, 98, 0, 83, 83, 0, 68, 69, 0, 52, 52, 0, 31, 31, 0, 0, 0,
+ 0, 140, 124, 0, 125, 112, 0, 112, 100, 0, 97, 86, 0, 83, 72, 0, 68, 59, 0, 52, 44, 0, 31, 23, 0, 0, 0,
+ 0, 139, 106, 0, 125, 96, 0, 111, 85, 0, 97, 72, 0, 83, 62, 0, 68, 49, 0, 52, 35, 0, 31, 15, 0, 0, 0,
+ 0, 138, 88, 0, 124, 79, 0, 111, 70, 0, 96, 59, 0, 82, 48, 0, 68, 38, 0, 52, 24, 0, 31, 4, 0, 0, 0,
+ 0, 139, 76, 0, 124, 66, 0, 111, 58, 0, 96, 50, 0, 82, 40, 0, 68, 29, 0, 52, 15, 0, 31, 0, 0, 0, 0,
+ 0, 129, 200, 0, 114, 179, 0, 102, 160, 0, 87, 139, 0, 74, 120, 0, 60, 101, 0, 44, 81, 0, 22, 56, 0, 0, 19,
+ 0, 127, 181, 0, 114, 163, 0, 102, 146, 0, 88, 127, 0, 74, 109, 0, 60, 91, 0, 44, 72, 0, 23, 48, 0, 0, 11,
+ 0, 127, 166, 0, 113, 148, 0, 101, 133, 0, 87, 115, 0, 74, 99, 0, 60, 82, 0, 44, 64, 0, 23, 42, 0, 0, 4,
+ 0, 127, 150, 0, 113, 134, 0, 101, 119, 0, 87, 104, 0, 74, 89, 0, 60, 73, 0, 44, 56, 0, 23, 35, 0, 0, 0,
+ 0, 125, 134, 0, 112, 118, 0, 100, 106, 0, 87, 92, 0, 73, 78, 0, 60, 64, 0, 44, 48, 0, 23, 27, 0, 0, 0,
+ 0, 125, 118, 0, 112, 105, 0, 100, 94, 0, 86, 80, 0, 73, 68, 0, 60, 54, 0, 44, 39, 0, 23, 20, 0, 0, 0,
+ 0, 125, 101, 0, 111, 90, 0, 99, 80, 0, 86, 69, 0, 73, 58, 0, 59, 45, 0, 44, 30, 0, 23, 11, 0, 0, 0,
+ 0, 124, 85, 0, 111, 75, 0, 99, 66, 0, 86, 56, 0, 73, 45, 0, 59, 34, 0, 44, 20, 0, 23, 1, 0, 0, 0,
+ 0, 125, 72, 0, 111, 62, 0, 99, 56, 0, 86, 46, 0, 73, 36, 0, 60, 26, 0, 44, 12, 0, 23, 0, 0, 0, 0,
+ 0, 114, 188, 0, 101, 167, 0, 89, 150, 0, 77, 131, 0, 64, 113, 0, 50, 95, 0, 34, 75, 0, 12, 52, 0, 0, 14,
+ 0, 113, 170, 0, 101, 153, 0, 89, 137, 0, 77, 120, 0, 64, 102, 0, 50, 85, 0, 35, 67, 0, 12, 44, 0, 0, 4,
+ 0, 113, 156, 0, 100, 139, 0, 89, 125, 0, 77, 109, 0, 64, 92, 0, 51, 77, 0, 35, 60, 0, 12, 38, 0, 0, 0,
+ 0, 112, 141, 0, 100, 126, 0, 89, 113, 0, 77, 98, 0, 64, 83, 0, 51, 68, 0, 35, 51, 0, 12, 30, 0, 0, 0,
+ 0, 112, 127, 0, 100, 112, 0, 89, 100, 0, 76, 87, 0, 64, 74, 0, 51, 59, 0, 35, 44, 0, 13, 24, 0, 0, 0,
+ 0, 112, 111, 0, 100, 100, 0, 88, 88, 0, 76, 76, 0, 64, 64, 0, 51, 52, 0, 36, 37, 0, 13, 17, 0, 0, 0,
+ 0, 111, 96, 0, 99, 85, 0, 88, 76, 0, 76, 64, 0, 64, 53, 0, 51, 41, 0, 36, 27, 0, 13, 6, 0, 0, 0,
+ 0, 111, 81, 0, 99, 71, 0, 88, 62, 0, 76, 52, 0, 64, 43, 0, 51, 31, 0, 36, 17, 0, 13, 0, 0, 0, 0,
+ 0, 111, 69, 0, 99, 60, 0, 88, 52, 0, 75, 43, 0, 63, 34, 0, 51, 21, 0, 36, 7, 0, 13, 0, 0, 0, 0,
+ 0, 99, 177, 0, 88, 158, 0, 77, 141, 0, 66, 123, 0, 53, 106, 0, 40, 89, 0, 25, 71, 0, 5, 47, 0, 0, 8,
+ 0, 99, 160, 0, 88, 144, 0, 77, 129, 0, 66, 112, 0, 54, 97, 0, 41, 80, 0, 26, 62, 0, 5, 40, 0, 0, 0,
+ 0, 99, 147, 0, 87, 132, 0, 78, 117, 0, 66, 102, 0, 54, 87, 0, 42, 72, 0, 26, 55, 0, 5, 34, 0, 0, 0,
+ 0, 99, 134, 0, 88, 119, 0, 77, 107, 0, 66, 92, 0, 54, 78, 0, 42, 64, 0, 27, 48, 0, 5, 27, 0, 0, 0,
+ 0, 99, 120, 0, 87, 107, 0, 78, 94, 0, 66, 81, 0, 54, 68, 0, 42, 55, 0, 27, 40, 0, 6, 20, 0, 0, 0,
+ 0, 98, 105, 0, 87, 94, 0, 77, 84, 0, 65, 71, 0, 55, 59, 0, 42, 47, 0, 28, 33, 0, 6, 12, 0, 0, 0,
+ 0, 98, 93, 0, 87, 81, 0, 77, 72, 0, 66, 61, 0, 54, 49, 0, 42, 37, 0, 28, 24, 0, 6, 4, 0, 0, 0,
+ 0, 98, 77, 0, 87, 68, 0, 77, 59, 0, 65, 49, 0, 54, 39, 0, 42, 27, 0, 29, 14, 0, 6, 0, 0, 0, 0,
+ 1, 98, 65, 7, 87, 56, 0, 77, 49, 0, 66, 41, 0, 54, 30, 0, 42, 19, 0, 29, 3, 0, 6, 0, 0, 0, 0,
+ 0, 84, 166, 0, 74, 149, 0, 64, 134, 0, 53, 117, 0, 41, 100, 0, 28, 83, 0, 11, 64, 0, 0, 42, 0, 0, 3,
+ 0, 84, 151, 0, 74, 135, 0, 64, 121, 0, 53, 105, 0, 42, 90, 0, 30, 75, 0, 14, 58, 0, 0, 36, 0, 0, 0,
+ 0, 84, 138, 0, 74, 124, 1, 64, 110, 0, 54, 95, 0, 43, 81, 0, 30, 67, 0, 15, 51, 0, 1, 29, 0, 0, 0,
+ 14, 84, 126, 12, 74, 112, 2, 65, 99, 0, 54, 85, 0, 44, 73, 0, 31, 59, 0, 16, 44, 0, 1, 23, 0, 0, 0,
+ 16, 84, 113, 13, 74, 100, 6, 65, 89, 0, 54, 77, 0, 44, 65, 0, 31, 51, 0, 17, 36, 0, 1, 16, 0, 0, 0,
+ 24, 84, 100, 18, 74, 88, 13, 65, 78, 2, 55, 68, 0, 44, 55, 0, 32, 43, 0, 18, 28, 0, 1, 6, 0, 0, 0,
+ 26, 84, 87, 24, 74, 76, 17, 65, 67, 7, 54, 57, 0, 44, 46, 0, 32, 35, 0, 19, 21, 0, 2, 3, 0, 0, 0,
+ 30, 84, 74, 28, 74, 64, 20, 65, 55, 12, 55, 46, 0, 44, 35, 0, 32, 24, 0, 18, 9, 0, 1, 0, 0, 0, 0,
+ 32, 84, 63, 28, 74, 54, 21, 65, 47, 13, 54, 38, 0, 44, 28, 0, 32, 16, 0, 18, 1, 0, 1, 0, 0, 0, 0,
+ 30, 67, 155, 20, 58, 139, 20, 49, 126, 12, 39, 110, 0, 27, 94, 0, 13, 77, 0, 0, 60, 0, 0, 37, 0, 0, 0,
+ 35, 67, 142, 30, 58, 126, 23, 50, 114, 16, 40, 99, 7, 29, 85, 0, 15, 69, 0, 0, 52, 0, 0, 30, 0, 0, 0,
+ 35, 68, 131, 30, 59, 116, 27, 50, 104, 18, 40, 90, 9, 29, 76, 0, 17, 62, 0, 2, 46, 0, 0, 24, 0, 0, 0,
+ 37, 69, 119, 33, 59, 106, 27, 51, 94, 21, 41, 80, 9, 30, 67, 0, 18, 54, 0, 3, 39, 0, 0, 18, 0, 0, 0,
+ 40, 69, 107, 36, 59, 94, 28, 51, 84, 18, 41, 72, 10, 31, 60, 0, 19, 47, 0, 4, 32, 0, 0, 10, 0, 0, 0,
+ 42, 69, 95, 36, 59, 84, 29, 51, 74, 19, 41, 63, 10, 31, 52, 0, 20, 39, 0, 4, 25, 0, 0, 4, 0, 0, 0,
+ 43, 69, 83, 38, 60, 73, 32, 51, 62, 23, 42, 53, 11, 31, 42, 0, 20, 31, 0, 5, 17, 0, 0, 1, 0, 0, 0,
+ 45, 69, 70, 39, 60, 60, 33, 51, 52, 24, 42, 43, 13, 32, 33, 0, 21, 21, 0, 5, 6, 0, 0, 0, 0, 0, 0,
+ 47, 69, 59, 41, 60, 51, 34, 51, 43, 24, 42, 35, 12, 33, 26, 1, 22, 14, 0, 5, 1, 0, 0, 0, 0, 0, 0,
+ 46, 48, 146, 42, 40, 131, 36, 32, 118, 27, 22, 103, 17, 6, 88, 5, 0, 73, 0, 0, 55, 0, 0, 33, 0, 0, 0,
+ 48, 48, 133, 44, 40, 119, 37, 32, 107, 28, 22, 93, 20, 8, 79, 7, 0, 65, 0, 0, 49, 0, 0, 27, 0, 0, 0,
+ 48, 50, 123, 44, 41, 109, 37, 33, 97, 30, 23, 83, 21, 11, 71, 8, 0, 58, 0, 0, 42, 0, 0, 21, 0, 0, 0,
+ 49, 51, 111, 45, 42, 99, 38, 34, 87, 29, 25, 75, 20, 13, 63, 8, 0, 51, 0, 0, 36, 0, 0, 14, 0, 0, 0,
+ 52, 52, 100, 44, 43, 89, 38, 35, 79, 29, 26, 68, 19, 15, 56, 10, 1, 43, 0, 0, 28, 0, 0, 6, 0, 0, 0,
+ 52, 52, 90, 47, 44, 79, 39, 36, 70, 30, 27, 59, 20, 16, 47, 9, 2, 36, 0, 0, 22, 0, 0, 2, 0, 0, 0,
+ 52, 53, 78, 46, 44, 68, 39, 37, 60, 32, 27, 49, 22, 17, 39, 10, 3, 28, 0, 0, 12, 0, 0, 0, 0, 0, 0,
+ 53, 53, 66, 47, 44, 57, 40, 36, 48, 32, 27, 39, 22, 18, 30, 9, 4, 18, 0, 0, 3, 0, 0, 0, 0, 0, 0,
+ 54, 53, 57, 48, 45, 49, 41, 37, 41, 33, 28, 32, 22, 19, 23, 11, 6, 10, 1, 0, 0, 0, 0, 0, 0, 0, 0,
+};
+void AdobeCMYK_to_sRGB1(FX_BYTE c, FX_BYTE m, FX_BYTE y, FX_BYTE k, FX_BYTE& R, FX_BYTE& G, FX_BYTE& B)
+{
+ int fix_c = c << 8;
+ int fix_m = m << 8;
+ int fix_y = y << 8;
+ int fix_k = k << 8;
+ int c_index = (fix_c + 4096) >> 13;
+ int m_index = (fix_m + 4096) >> 13;
+ int y_index = (fix_y + 4096) >> 13;
+ int k_index = (fix_k + 4096) >> 13;
+ int pos = (c_index * 9 * 9 * 9 + m_index * 9 * 9 + y_index * 9 + k_index) * 3;
+ int fix_r = g_CMYKSamples[pos] << 8;
+ int fix_g = g_CMYKSamples[pos + 1] << 8;
+ int fix_b = g_CMYKSamples[pos + 2] << 8;
+ int c1_index = fix_c >> 13;
+ if (c1_index == c_index) {
+ c1_index = c1_index == 8 ? c1_index - 1 : c1_index + 1;
+ }
+ int m1_index = fix_m >> 13;
+ if (m1_index == m_index) {
+ m1_index = m1_index == 8 ? m1_index - 1 : m1_index + 1;
+ }
+ int y1_index = fix_y >> 13;
+ if (y1_index == y_index) {
+ y1_index = y1_index == 8 ? y1_index - 1 : y1_index + 1;
+ }
+ int k1_index = fix_k >> 13;
+ if (k1_index == k_index) {
+ k1_index = k1_index == 8 ? k1_index - 1 : k1_index + 1;
+ }
+ int c1_pos = pos + (c1_index - c_index) * 9 * 9 * 9 * 3;
+ int m1_pos = pos + (m1_index - m_index) * 9 * 9 * 3;
+ int y1_pos = pos + (y1_index - y_index) * 9 * 3;
+ int k1_pos = pos + (k1_index - k_index) * 3;
+ int c_r_delta = g_CMYKSamples[pos] - g_CMYKSamples[c1_pos];
+ int c_g_delta = g_CMYKSamples[pos + 1] - g_CMYKSamples[c1_pos + 1];
+ int c_b_delta = g_CMYKSamples[pos + 2] - g_CMYKSamples[c1_pos + 2];
+ int m_r_delta = g_CMYKSamples[pos] - g_CMYKSamples[m1_pos];
+ int m_g_delta = g_CMYKSamples[pos + 1] - g_CMYKSamples[m1_pos + 1];
+ int m_b_delta = g_CMYKSamples[pos + 2] - g_CMYKSamples[m1_pos + 2];
+ int y_r_delta = g_CMYKSamples[pos] - g_CMYKSamples[y1_pos];
+ int y_g_delta = g_CMYKSamples[pos + 1] - g_CMYKSamples[y1_pos + 1];
+ int y_b_delta = g_CMYKSamples[pos + 2] - g_CMYKSamples[y1_pos + 2];
+ int k_r_delta = g_CMYKSamples[pos] - g_CMYKSamples[k1_pos];
+ int k_g_delta = g_CMYKSamples[pos + 1] - g_CMYKSamples[k1_pos + 1];
+ int k_b_delta = g_CMYKSamples[pos + 2] - g_CMYKSamples[k1_pos + 2];
+ int c_rate = (fix_c - (c_index << 13)) * (c_index - c1_index);
+ fix_r += c_r_delta * c_rate / 32;
+ fix_g += c_g_delta * c_rate / 32;
+ fix_b += c_b_delta * c_rate / 32;
+ int m_rate = (fix_m - (m_index << 13)) * (m_index - m1_index);
+ fix_r += m_r_delta * m_rate / 32;
+ fix_g += m_g_delta * m_rate / 32;
+ fix_b += m_b_delta * m_rate / 32;
+ int y_rate = (fix_y - (y_index << 13)) * (y_index - y1_index);
+ fix_r += y_r_delta * y_rate / 32;
+ fix_g += y_g_delta * y_rate / 32;
+ fix_b += y_b_delta * y_rate / 32;
+ int k_rate = (fix_k - (k_index << 13)) * (k_index - k1_index);
+ fix_r += k_r_delta * k_rate / 32;
+ fix_g += k_g_delta * k_rate / 32;
+ fix_b += k_b_delta * k_rate / 32;
+ if (fix_r < 0) {
+ fix_r = 0;
+ }
+ if (fix_g < 0) {
+ fix_g = 0;
+ }
+ if (fix_b < 0) {
+ fix_b = 0;
+ }
+ R = fix_r >> 8;
+ G = fix_g >> 8;
+ B = fix_b >> 8;
+}
+void AdobeCMYK_to_sRGB(FX_FLOAT c, FX_FLOAT m, FX_FLOAT y, FX_FLOAT k, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B)
+{
+ FX_BYTE c1 = FXSYS_round(c * 255);
+ FX_BYTE m1 = FXSYS_round(m * 255);
+ FX_BYTE y1 = FXSYS_round(y * 255);
+ FX_BYTE k1 = FXSYS_round(k * 255);
+ FX_BYTE r, g, b;
+ AdobeCMYK_to_sRGB1(c1, m1, y1, k1, r, g, b);
+ R = 1.0f * r / 255;
+ G = 1.0f * g / 255;
+ B = 1.0f * b / 255;
+}
diff --git a/core/src/fxcodec/codec/fx_codec_jbig.cpp b/core/src/fxcodec/codec/fx_codec_jbig.cpp
index a644e99c5d..996ad60f8a 100644
--- a/core/src/fxcodec/codec/fx_codec_jbig.cpp
+++ b/core/src/fxcodec/codec/fx_codec_jbig.cpp
@@ -1,212 +1,212 @@
-// 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
-
-#include "../../../include/fxcodec/fx_codec.h"
-#include "codec_int.h"
-CCodec_Jbig2Context::CCodec_Jbig2Context()
-{
- FXSYS_memset32(this, 0, sizeof(CCodec_Jbig2Context));
-}
-CCodec_Jbig2Module::~CCodec_Jbig2Module()
-{
-}
-void* CCodec_Jbig2Module::CreateJbig2Context()
-{
- return FX_NEW CCodec_Jbig2Context();
-}
-void CCodec_Jbig2Module::DestroyJbig2Context(void* pJbig2Content)
-{
- if(pJbig2Content) {
- CJBig2_Context::DestroyContext(((CCodec_Jbig2Context*)pJbig2Content)->m_pContext);
- delete (CCodec_Jbig2Context*)pJbig2Content;
- }
- pJbig2Content = NULL;
-}
-FX_BOOL CCodec_Jbig2Module::Decode(FX_DWORD width, FX_DWORD height, FX_LPCBYTE src_buf, FX_DWORD src_size,
- FX_LPCBYTE global_data, FX_DWORD global_size, FX_LPBYTE dest_buf, FX_DWORD dest_pitch)
-{
- FXSYS_memset32(dest_buf, 0, height * dest_pitch);
- CJBig2_Context* pContext = CJBig2_Context::CreateContext(&m_Module,
- (FX_LPBYTE)global_data, global_size, (FX_LPBYTE)src_buf, src_size, JBIG2_EMBED_STREAM);
- if (pContext == NULL) {
- return FALSE;
- }
- int ret = pContext->getFirstPage(dest_buf, width, height, dest_pitch, NULL);
- CJBig2_Context::DestroyContext(pContext);
- if (ret != JBIG2_SUCCESS) {
- return FALSE;
- }
- int dword_size = height * dest_pitch / 4;
- FX_DWORD* dword_buf = (FX_DWORD*)dest_buf;
- for (int i = 0; i < dword_size; i ++) {
- dword_buf[i] = ~dword_buf[i];
- }
- return TRUE;
-}
-FX_BOOL CCodec_Jbig2Module::Decode(IFX_FileRead* file_ptr,
- FX_DWORD& width, FX_DWORD& height, FX_DWORD& pitch, FX_LPBYTE& dest_buf)
-{
- CJBig2_Context* pContext = NULL;
- CJBig2_Image* dest_image = NULL;
- FX_DWORD src_size = (FX_DWORD)file_ptr->GetSize();
- FX_LPBYTE src_buf = FX_Alloc(FX_BYTE, src_size);
- if (src_buf == NULL) {
- return FALSE;
- }
- int ret = 0;
- if(!file_ptr->ReadBlock(src_buf, 0, src_size)) {
- goto failed;
- }
- pContext = CJBig2_Context::CreateContext(&m_Module, NULL, 0, src_buf, src_size, JBIG2_FILE_STREAM);
- if(pContext == NULL) {
- goto failed;
- }
- ret = pContext->getFirstPage(&dest_image, NULL);
- CJBig2_Context::DestroyContext(pContext);
- if (ret != JBIG2_SUCCESS) {
- goto failed;
- }
- width = (FX_DWORD)dest_image->m_nWidth;
- height = (FX_DWORD)dest_image->m_nHeight;
- pitch = (FX_DWORD)dest_image->m_nStride;
- dest_buf = dest_image->m_pData;
- dest_image->m_bNeedFree = FALSE;
- delete dest_image;
- FX_Free(src_buf);
- return TRUE;
-failed:
- if(src_buf) {
- FX_Free(src_buf);
- }
- return FALSE;
-}
-FXCODEC_STATUS CCodec_Jbig2Module::StartDecode(void* pJbig2Context, FX_DWORD width, FX_DWORD height, FX_LPCBYTE src_buf, FX_DWORD src_size,
- FX_LPCBYTE global_data, FX_DWORD global_size, FX_LPBYTE dest_buf, FX_DWORD dest_pitch, IFX_Pause* pPause)
-{
- if(!pJbig2Context) {
- return FXCODEC_STATUS_ERR_PARAMS;
- }
- CCodec_Jbig2Context* m_pJbig2Context = (CCodec_Jbig2Context*)pJbig2Context;
- m_pJbig2Context->m_width = width;
- m_pJbig2Context->m_height = height;
- m_pJbig2Context->m_src_buf = (unsigned char *)src_buf;
- m_pJbig2Context->m_src_size = src_size;
- m_pJbig2Context->m_global_data = global_data;
- m_pJbig2Context->m_global_size = global_size;
- m_pJbig2Context->m_dest_buf = dest_buf;
- m_pJbig2Context->m_dest_pitch = dest_pitch;
- m_pJbig2Context->m_pPause = pPause;
- m_pJbig2Context->m_bFileReader = FALSE;
- FXSYS_memset32(dest_buf, 0, height * dest_pitch);
- m_pJbig2Context->m_pContext = CJBig2_Context::CreateContext(&m_Module,
- (FX_LPBYTE)global_data, global_size, (FX_LPBYTE)src_buf, src_size, JBIG2_EMBED_STREAM, pPause);
- if(!m_pJbig2Context->m_pContext) {
- return FXCODEC_STATUS_ERROR;
- }
- int ret = m_pJbig2Context->m_pContext->getFirstPage(dest_buf, width, height, dest_pitch, pPause);
- if(m_pJbig2Context->m_pContext->GetProcessiveStatus() == FXCODEC_STATUS_DECODE_FINISH) {
- CJBig2_Context::DestroyContext(m_pJbig2Context->m_pContext);
- m_pJbig2Context->m_pContext = NULL;
- if (ret != JBIG2_SUCCESS) {
- return FXCODEC_STATUS_ERROR;
- }
- int dword_size = height * dest_pitch / 4;
- FX_DWORD* dword_buf = (FX_DWORD*)dest_buf;
- for (int i = 0; i < dword_size; i ++) {
- dword_buf[i] = ~dword_buf[i];
- }
- return FXCODEC_STATUS_DECODE_FINISH;
- }
- return m_pJbig2Context->m_pContext->GetProcessiveStatus();
-}
-FXCODEC_STATUS CCodec_Jbig2Module::StartDecode(void* pJbig2Context, IFX_FileRead* file_ptr,
- FX_DWORD& width, FX_DWORD& height, FX_DWORD& pitch, FX_LPBYTE& dest_buf, IFX_Pause* pPause)
-{
- if(!pJbig2Context) {
- return FXCODEC_STATUS_ERR_PARAMS;
- }
- CCodec_Jbig2Context* m_pJbig2Context = (CCodec_Jbig2Context*)pJbig2Context;
- m_pJbig2Context->m_bFileReader = TRUE;
- m_pJbig2Context->m_dest_image = NULL;
- m_pJbig2Context->m_src_size = (FX_DWORD)file_ptr->GetSize();
- m_pJbig2Context->m_src_buf = FX_Alloc(FX_BYTE, m_pJbig2Context->m_src_size);
- if (m_pJbig2Context->m_src_buf == NULL) {
- return FXCODEC_STATUS_ERR_MEMORY;
- }
- int ret = 0;
- if(!file_ptr->ReadBlock((void*)m_pJbig2Context->m_src_buf, 0, m_pJbig2Context->m_src_size)) {
- goto failed;
- }
- m_pJbig2Context->m_pContext = CJBig2_Context::CreateContext(&m_Module, NULL, 0, m_pJbig2Context->m_src_buf, m_pJbig2Context->m_src_size, JBIG2_FILE_STREAM, pPause);
- if(m_pJbig2Context->m_pContext == NULL) {
- goto failed;
- }
- ret = m_pJbig2Context->m_pContext->getFirstPage(&m_pJbig2Context->m_dest_image, pPause);
- if(m_pJbig2Context->m_pContext->GetProcessiveStatus() == FXCODEC_STATUS_DECODE_TOBECONTINUE) {
- width = (FX_DWORD)m_pJbig2Context->m_dest_image->m_nWidth;
- height = (FX_DWORD)m_pJbig2Context->m_dest_image->m_nHeight;
- pitch = (FX_DWORD)m_pJbig2Context->m_dest_image->m_nStride;
- dest_buf = m_pJbig2Context->m_dest_image->m_pData;
- m_pJbig2Context->m_dest_image->m_bNeedFree = FALSE;
- return FXCODEC_STATUS_DECODE_TOBECONTINUE;
- }
- CJBig2_Context::DestroyContext(m_pJbig2Context->m_pContext);
- m_pJbig2Context->m_pContext = NULL;
- if (ret != JBIG2_SUCCESS) {
- goto failed;
- }
- width = (FX_DWORD)m_pJbig2Context->m_dest_image->m_nWidth;
- height = (FX_DWORD)m_pJbig2Context->m_dest_image->m_nHeight;
- pitch = (FX_DWORD)m_pJbig2Context->m_dest_image->m_nStride;
- dest_buf = m_pJbig2Context->m_dest_image->m_pData;
- m_pJbig2Context->m_dest_image->m_bNeedFree = FALSE;
- delete m_pJbig2Context->m_dest_image;
- FX_Free(m_pJbig2Context->m_src_buf);
- return FXCODEC_STATUS_DECODE_FINISH;
-failed:
- if(m_pJbig2Context->m_src_buf) {
- FX_Free(m_pJbig2Context->m_src_buf);
- }
- m_pJbig2Context->m_src_buf = NULL;
- return FXCODEC_STATUS_ERROR;
-}
-FXCODEC_STATUS CCodec_Jbig2Module::ContinueDecode(void* pJbig2Context, IFX_Pause* pPause)
-{
- CCodec_Jbig2Context* m_pJbig2Context = (CCodec_Jbig2Context*)pJbig2Context;
- int ret = m_pJbig2Context->m_pContext->Continue(pPause);
- if(m_pJbig2Context->m_pContext->GetProcessiveStatus() == FXCODEC_STATUS_DECODE_FINISH) {
- if(m_pJbig2Context->m_bFileReader) {
- CJBig2_Context::DestroyContext(m_pJbig2Context->m_pContext);
- m_pJbig2Context->m_pContext = NULL;
- if (ret != JBIG2_SUCCESS) {
- if(m_pJbig2Context->m_src_buf) {
- FX_Free(m_pJbig2Context->m_src_buf);
- }
- m_pJbig2Context->m_src_buf = NULL;
- return FXCODEC_STATUS_ERROR;
- }
- delete m_pJbig2Context->m_dest_image;
- FX_Free(m_pJbig2Context->m_src_buf);
- return FXCODEC_STATUS_DECODE_FINISH;
- } else {
- CJBig2_Context::DestroyContext(m_pJbig2Context->m_pContext);
- m_pJbig2Context->m_pContext = NULL;
- if (ret != JBIG2_SUCCESS) {
- return FXCODEC_STATUS_ERROR;
- }
- int dword_size = m_pJbig2Context->m_height * m_pJbig2Context->m_dest_pitch / 4;
- FX_DWORD* dword_buf = (FX_DWORD*)m_pJbig2Context->m_dest_buf;
- for (int i = 0; i < dword_size; i ++) {
- dword_buf[i] = ~dword_buf[i];
- }
- return FXCODEC_STATUS_DECODE_FINISH;
- }
- }
- return m_pJbig2Context->m_pContext->GetProcessiveStatus();
-}
-
-
-
+// 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
+
+#include "../../../include/fxcodec/fx_codec.h"
+#include "codec_int.h"
+CCodec_Jbig2Context::CCodec_Jbig2Context()
+{
+ FXSYS_memset32(this, 0, sizeof(CCodec_Jbig2Context));
+}
+CCodec_Jbig2Module::~CCodec_Jbig2Module()
+{
+}
+void* CCodec_Jbig2Module::CreateJbig2Context()
+{
+ return FX_NEW CCodec_Jbig2Context();
+}
+void CCodec_Jbig2Module::DestroyJbig2Context(void* pJbig2Content)
+{
+ if(pJbig2Content) {
+ CJBig2_Context::DestroyContext(((CCodec_Jbig2Context*)pJbig2Content)->m_pContext);
+ delete (CCodec_Jbig2Context*)pJbig2Content;
+ }
+ pJbig2Content = NULL;
+}
+FX_BOOL CCodec_Jbig2Module::Decode(FX_DWORD width, FX_DWORD height, FX_LPCBYTE src_buf, FX_DWORD src_size,
+ FX_LPCBYTE global_data, FX_DWORD global_size, FX_LPBYTE dest_buf, FX_DWORD dest_pitch)
+{
+ FXSYS_memset32(dest_buf, 0, height * dest_pitch);
+ CJBig2_Context* pContext = CJBig2_Context::CreateContext(&m_Module,
+ (FX_LPBYTE)global_data, global_size, (FX_LPBYTE)src_buf, src_size, JBIG2_EMBED_STREAM);
+ if (pContext == NULL) {
+ return FALSE;
+ }
+ int ret = pContext->getFirstPage(dest_buf, width, height, dest_pitch, NULL);
+ CJBig2_Context::DestroyContext(pContext);
+ if (ret != JBIG2_SUCCESS) {
+ return FALSE;
+ }
+ int dword_size = height * dest_pitch / 4;
+ FX_DWORD* dword_buf = (FX_DWORD*)dest_buf;
+ for (int i = 0; i < dword_size; i ++) {
+ dword_buf[i] = ~dword_buf[i];
+ }
+ return TRUE;
+}
+FX_BOOL CCodec_Jbig2Module::Decode(IFX_FileRead* file_ptr,
+ FX_DWORD& width, FX_DWORD& height, FX_DWORD& pitch, FX_LPBYTE& dest_buf)
+{
+ CJBig2_Context* pContext = NULL;
+ CJBig2_Image* dest_image = NULL;
+ FX_DWORD src_size = (FX_DWORD)file_ptr->GetSize();
+ FX_LPBYTE src_buf = FX_Alloc(FX_BYTE, src_size);
+ if (src_buf == NULL) {
+ return FALSE;
+ }
+ int ret = 0;
+ if(!file_ptr->ReadBlock(src_buf, 0, src_size)) {
+ goto failed;
+ }
+ pContext = CJBig2_Context::CreateContext(&m_Module, NULL, 0, src_buf, src_size, JBIG2_FILE_STREAM);
+ if(pContext == NULL) {
+ goto failed;
+ }
+ ret = pContext->getFirstPage(&dest_image, NULL);
+ CJBig2_Context::DestroyContext(pContext);
+ if (ret != JBIG2_SUCCESS) {
+ goto failed;
+ }
+ width = (FX_DWORD)dest_image->m_nWidth;
+ height = (FX_DWORD)dest_image->m_nHeight;
+ pitch = (FX_DWORD)dest_image->m_nStride;
+ dest_buf = dest_image->m_pData;
+ dest_image->m_bNeedFree = FALSE;
+ delete dest_image;
+ FX_Free(src_buf);
+ return TRUE;
+failed:
+ if(src_buf) {
+ FX_Free(src_buf);
+ }
+ return FALSE;
+}
+FXCODEC_STATUS CCodec_Jbig2Module::StartDecode(void* pJbig2Context, FX_DWORD width, FX_DWORD height, FX_LPCBYTE src_buf, FX_DWORD src_size,
+ FX_LPCBYTE global_data, FX_DWORD global_size, FX_LPBYTE dest_buf, FX_DWORD dest_pitch, IFX_Pause* pPause)
+{
+ if(!pJbig2Context) {
+ return FXCODEC_STATUS_ERR_PARAMS;
+ }
+ CCodec_Jbig2Context* m_pJbig2Context = (CCodec_Jbig2Context*)pJbig2Context;
+ m_pJbig2Context->m_width = width;
+ m_pJbig2Context->m_height = height;
+ m_pJbig2Context->m_src_buf = (unsigned char *)src_buf;
+ m_pJbig2Context->m_src_size = src_size;
+ m_pJbig2Context->m_global_data = global_data;
+ m_pJbig2Context->m_global_size = global_size;
+ m_pJbig2Context->m_dest_buf = dest_buf;
+ m_pJbig2Context->m_dest_pitch = dest_pitch;
+ m_pJbig2Context->m_pPause = pPause;
+ m_pJbig2Context->m_bFileReader = FALSE;
+ FXSYS_memset32(dest_buf, 0, height * dest_pitch);
+ m_pJbig2Context->m_pContext = CJBig2_Context::CreateContext(&m_Module,
+ (FX_LPBYTE)global_data, global_size, (FX_LPBYTE)src_buf, src_size, JBIG2_EMBED_STREAM, pPause);
+ if(!m_pJbig2Context->m_pContext) {
+ return FXCODEC_STATUS_ERROR;
+ }
+ int ret = m_pJbig2Context->m_pContext->getFirstPage(dest_buf, width, height, dest_pitch, pPause);
+ if(m_pJbig2Context->m_pContext->GetProcessiveStatus() == FXCODEC_STATUS_DECODE_FINISH) {
+ CJBig2_Context::DestroyContext(m_pJbig2Context->m_pContext);
+ m_pJbig2Context->m_pContext = NULL;
+ if (ret != JBIG2_SUCCESS) {
+ return FXCODEC_STATUS_ERROR;
+ }
+ int dword_size = height * dest_pitch / 4;
+ FX_DWORD* dword_buf = (FX_DWORD*)dest_buf;
+ for (int i = 0; i < dword_size; i ++) {
+ dword_buf[i] = ~dword_buf[i];
+ }
+ return FXCODEC_STATUS_DECODE_FINISH;
+ }
+ return m_pJbig2Context->m_pContext->GetProcessiveStatus();
+}
+FXCODEC_STATUS CCodec_Jbig2Module::StartDecode(void* pJbig2Context, IFX_FileRead* file_ptr,
+ FX_DWORD& width, FX_DWORD& height, FX_DWORD& pitch, FX_LPBYTE& dest_buf, IFX_Pause* pPause)
+{
+ if(!pJbig2Context) {
+ return FXCODEC_STATUS_ERR_PARAMS;
+ }
+ CCodec_Jbig2Context* m_pJbig2Context = (CCodec_Jbig2Context*)pJbig2Context;
+ m_pJbig2Context->m_bFileReader = TRUE;
+ m_pJbig2Context->m_dest_image = NULL;
+ m_pJbig2Context->m_src_size = (FX_DWORD)file_ptr->GetSize();
+ m_pJbig2Context->m_src_buf = FX_Alloc(FX_BYTE, m_pJbig2Context->m_src_size);
+ if (m_pJbig2Context->m_src_buf == NULL) {
+ return FXCODEC_STATUS_ERR_MEMORY;
+ }
+ int ret = 0;
+ if(!file_ptr->ReadBlock((void*)m_pJbig2Context->m_src_buf, 0, m_pJbig2Context->m_src_size)) {
+ goto failed;
+ }
+ m_pJbig2Context->m_pContext = CJBig2_Context::CreateContext(&m_Module, NULL, 0, m_pJbig2Context->m_src_buf, m_pJbig2Context->m_src_size, JBIG2_FILE_STREAM, pPause);
+ if(m_pJbig2Context->m_pContext == NULL) {
+ goto failed;
+ }
+ ret = m_pJbig2Context->m_pContext->getFirstPage(&m_pJbig2Context->m_dest_image, pPause);
+ if(m_pJbig2Context->m_pContext->GetProcessiveStatus() == FXCODEC_STATUS_DECODE_TOBECONTINUE) {
+ width = (FX_DWORD)m_pJbig2Context->m_dest_image->m_nWidth;
+ height = (FX_DWORD)m_pJbig2Context->m_dest_image->m_nHeight;
+ pitch = (FX_DWORD)m_pJbig2Context->m_dest_image->m_nStride;
+ dest_buf = m_pJbig2Context->m_dest_image->m_pData;
+ m_pJbig2Context->m_dest_image->m_bNeedFree = FALSE;
+ return FXCODEC_STATUS_DECODE_TOBECONTINUE;
+ }
+ CJBig2_Context::DestroyContext(m_pJbig2Context->m_pContext);
+ m_pJbig2Context->m_pContext = NULL;
+ if (ret != JBIG2_SUCCESS) {
+ goto failed;
+ }
+ width = (FX_DWORD)m_pJbig2Context->m_dest_image->m_nWidth;
+ height = (FX_DWORD)m_pJbig2Context->m_dest_image->m_nHeight;
+ pitch = (FX_DWORD)m_pJbig2Context->m_dest_image->m_nStride;
+ dest_buf = m_pJbig2Context->m_dest_image->m_pData;
+ m_pJbig2Context->m_dest_image->m_bNeedFree = FALSE;
+ delete m_pJbig2Context->m_dest_image;
+ FX_Free(m_pJbig2Context->m_src_buf);
+ return FXCODEC_STATUS_DECODE_FINISH;
+failed:
+ if(m_pJbig2Context->m_src_buf) {
+ FX_Free(m_pJbig2Context->m_src_buf);
+ }
+ m_pJbig2Context->m_src_buf = NULL;
+ return FXCODEC_STATUS_ERROR;
+}
+FXCODEC_STATUS CCodec_Jbig2Module::ContinueDecode(void* pJbig2Context, IFX_Pause* pPause)
+{
+ CCodec_Jbig2Context* m_pJbig2Context = (CCodec_Jbig2Context*)pJbig2Context;
+ int ret = m_pJbig2Context->m_pContext->Continue(pPause);
+ if(m_pJbig2Context->m_pContext->GetProcessiveStatus() == FXCODEC_STATUS_DECODE_FINISH) {
+ if(m_pJbig2Context->m_bFileReader) {
+ CJBig2_Context::DestroyContext(m_pJbig2Context->m_pContext);
+ m_pJbig2Context->m_pContext = NULL;
+ if (ret != JBIG2_SUCCESS) {
+ if(m_pJbig2Context->m_src_buf) {
+ FX_Free(m_pJbig2Context->m_src_buf);
+ }
+ m_pJbig2Context->m_src_buf = NULL;
+ return FXCODEC_STATUS_ERROR;
+ }
+ delete m_pJbig2Context->m_dest_image;
+ FX_Free(m_pJbig2Context->m_src_buf);
+ return FXCODEC_STATUS_DECODE_FINISH;
+ } else {
+ CJBig2_Context::DestroyContext(m_pJbig2Context->m_pContext);
+ m_pJbig2Context->m_pContext = NULL;
+ if (ret != JBIG2_SUCCESS) {
+ return FXCODEC_STATUS_ERROR;
+ }
+ int dword_size = m_pJbig2Context->m_height * m_pJbig2Context->m_dest_pitch / 4;
+ FX_DWORD* dword_buf = (FX_DWORD*)m_pJbig2Context->m_dest_buf;
+ for (int i = 0; i < dword_size; i ++) {
+ dword_buf[i] = ~dword_buf[i];
+ }
+ return FXCODEC_STATUS_DECODE_FINISH;
+ }
+ }
+ return m_pJbig2Context->m_pContext->GetProcessiveStatus();
+}
+
+
+
diff --git a/core/src/fxcodec/codec/fx_codec_jpeg.cpp b/core/src/fxcodec/codec/fx_codec_jpeg.cpp
index fc91a6c162..5e78e134aa 100644
--- a/core/src/fxcodec/codec/fx_codec_jpeg.cpp
+++ b/core/src/fxcodec/codec/fx_codec_jpeg.cpp
@@ -1,735 +1,735 @@
-// 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
-
-#include "../../../include/fxcodec/fx_codec.h"
-#include "../../../include/fxge/fx_dib.h"
-#include "codec_int.h"
-extern "C" {
- static void _JpegScanSOI(const FX_BYTE*& src_buf, FX_DWORD& src_size)
- {
- if (src_size == 0) {
- return;
- }
- FX_DWORD offset = 0;
- while (offset < src_size - 1) {
- if (src_buf[offset] == 0xff && src_buf[offset + 1] == 0xd8) {
- src_buf += offset;
- src_size -= offset;
- return;
- }
- offset ++;
- }
- }
-};
-extern "C" {
-#undef FAR
-#include "../../fx_jpeglib.h"
-}
-extern "C" {
- static void _src_do_nothing(struct jpeg_decompress_struct* cinfo) {}
-};
-extern "C" {
- static void _error_fatal(j_common_ptr cinfo)
- {
- longjmp(*(jmp_buf*)cinfo->client_data, -1);
- }
-};
-extern "C" {
- static void _src_skip_data(struct jpeg_decompress_struct* cinfo, long num)
- {
- if (num > (long)cinfo->src->bytes_in_buffer) {
- _error_fatal((j_common_ptr)cinfo);
- }
- cinfo->src->next_input_byte += num;
- cinfo->src->bytes_in_buffer -= num;
- }
-};
-extern "C" {
- static boolean _src_fill_buffer(j_decompress_ptr cinfo)
- {
- return 0;
- }
-};
-extern "C" {
- static boolean _src_resync(j_decompress_ptr cinfo, int desired)
- {
- return 0;
- }
-};
-extern "C" {
- static void _error_do_nothing(j_common_ptr cinfo) {}
-};
-extern "C" {
- static void _error_do_nothing1(j_common_ptr cinfo, int) {}
-};
-extern "C" {
- static void _error_do_nothing2(j_common_ptr cinfo, char*) {}
-};
-#define JPEG_MARKER_EXIF (JPEG_APP0 + 1)
-#define JPEG_MARKER_ICC (JPEG_APP0 + 2)
-#define JPEG_MARKER_AUTHORTIME (JPEG_APP0 + 3)
-#define JPEG_MARKER_MAXSIZE 0xFFFF
-#define JPEG_OVERHEAD_LEN 14
-static FX_BOOL _JpegIsIccMarker(jpeg_saved_marker_ptr marker)
-{
- if (marker->marker == JPEG_MARKER_ICC &&
- marker->data_length >= JPEG_OVERHEAD_LEN &&
- (FXSYS_memcmp32(marker->data, "\x49\x43\x43\x5f\x50\x52\x4f\x46\x49\x4c\x45\x00", 12) == 0)) {
- return TRUE;
- }
- return FALSE;
-}
-static FX_BOOL _JpegLoadIccProfile(j_decompress_ptr cinfo, FX_LPBYTE* icc_buf_ptr, FX_DWORD* icc_length)
-{
- if(icc_buf_ptr == NULL || icc_length == NULL) {
- return FALSE;
- }
- *icc_buf_ptr = NULL;
- *icc_length = 0;
- FX_LPBYTE icc_data_ptr = NULL;
- FX_DWORD icc_data_len = 0;
- FX_BYTE count_icc_marker = 0;
- FX_BYTE num_icc_marker = 0;
- jpeg_saved_marker_ptr marker_list[256] = {NULL};
- for (jpeg_saved_marker_ptr cur_marker = cinfo->marker_list;
- cur_marker != NULL;
- cur_marker = cur_marker->next) {
- if(_JpegIsIccMarker(cur_marker)) {
- if(count_icc_marker == 0) {
- num_icc_marker = cur_marker->data[13];
- } else if(num_icc_marker != cur_marker->data[13]) {
- return FALSE;
- }
- int sn = cur_marker->data[12] - 1;
- if(sn < 0 || sn >= num_icc_marker) {
- return FALSE;
- }
- if(marker_list[sn] == NULL) {
- marker_list[sn] = cur_marker;
- } else {
- return FALSE;
- }
- count_icc_marker ++;
- icc_data_len += (cur_marker->data_length - JPEG_OVERHEAD_LEN);
- }
- }
- if(count_icc_marker != num_icc_marker) {
- return FALSE;
- }
- if(num_icc_marker == 0) {
- return TRUE;
- }
- icc_data_ptr = FX_Alloc(FX_BYTE, icc_data_len);
- if(icc_buf_ptr == NULL) {
- return FALSE;
- }
- *icc_buf_ptr = icc_data_ptr;
- *icc_length = icc_data_len;
- for (int idx = 0; idx < num_icc_marker; idx++) {
- icc_data_len = marker_list[idx]->data_length - JPEG_OVERHEAD_LEN;
- FXSYS_memcpy32(icc_data_ptr, marker_list[idx]->data + JPEG_OVERHEAD_LEN, icc_data_len);
- icc_data_ptr += icc_data_len;
- }
- return TRUE;
-}
-static FX_BOOL _JpegEmbedIccProfile(j_compress_ptr cinfo, FX_LPCBYTE icc_buf_ptr, FX_DWORD icc_length)
-{
- if(icc_buf_ptr == NULL || icc_length == 0) {
- return FALSE;
- }
- FX_DWORD icc_segment_size = (JPEG_MARKER_MAXSIZE - 2 - JPEG_OVERHEAD_LEN);
- FX_DWORD icc_segment_num = (icc_length / icc_segment_size) + 1;
- if (icc_segment_num > 255) {
- return FALSE;
- }
- FX_DWORD icc_data_length = JPEG_OVERHEAD_LEN + (icc_segment_num > 1 ? icc_segment_size : icc_length);
- FX_LPBYTE icc_data = FX_Alloc(FX_BYTE, icc_data_length);
- if (icc_data == NULL) {
- return FALSE;
- }
- FXSYS_memcpy32(icc_data, "\x49\x43\x43\x5f\x50\x52\x4f\x46\x49\x4c\x45\x00", 12);
- icc_data[13] = (FX_BYTE)icc_segment_num;
- for (FX_BYTE i = 0; i < (icc_segment_num - 1); i++) {
- icc_data[12] = i + 1;
- FXSYS_memcpy32(icc_data + JPEG_OVERHEAD_LEN, icc_buf_ptr + i * icc_segment_size, icc_segment_size);
- jpeg_write_marker(cinfo, JPEG_MARKER_ICC, icc_data, icc_data_length);
- }
- icc_data[12] = (FX_BYTE)icc_segment_num;
- FX_DWORD icc_size = (icc_segment_num - 1) * icc_segment_size;
- FXSYS_memcpy32(icc_data + JPEG_OVERHEAD_LEN, icc_buf_ptr + icc_size, icc_length - icc_size);
- jpeg_write_marker(cinfo, JPEG_MARKER_ICC, icc_data, JPEG_OVERHEAD_LEN + icc_length - icc_size);
- FX_Free(icc_data);
- return TRUE;
-}
-extern "C" {
- static void _dest_do_nothing(j_compress_ptr cinfo) {}
-};
-extern "C" {
- static boolean _dest_empty(j_compress_ptr cinfo)
- {
- return FALSE;
- }
-};
-#define JPEG_BLOCK_SIZE 1048576
-static void _JpegEncode(const CFX_DIBSource* pSource, FX_LPBYTE& dest_buf, FX_STRSIZE& dest_size, int quality, FX_LPCBYTE icc_buf, FX_DWORD icc_length)
-{
- struct jpeg_compress_struct cinfo;
- struct jpeg_error_mgr jerr;
- jerr.error_exit = _error_do_nothing;
- jerr.emit_message = _error_do_nothing1;
- jerr.output_message = _error_do_nothing;
- jerr.format_message = _error_do_nothing2;
- jerr.reset_error_mgr = _error_do_nothing;
- cinfo.err = &jerr;
- jpeg_create_compress(&cinfo);
- int Bpp = pSource->GetBPP() / 8;
- int nComponents = Bpp >= 3 ? (pSource->IsCmykImage() ? 4 : 3) : 1;
- int pitch = pSource->GetPitch();
- int width = pSource->GetWidth();
- int height = pSource->GetHeight();
- FX_DWORD dest_buf_length = width * height * nComponents + 1024 + (icc_length ? (icc_length + 255 * 18) : 0);
- dest_buf = FX_Alloc(FX_BYTE, dest_buf_length);
- while (dest_buf == NULL) {
- dest_buf_length >>= 1;
- dest_buf = FX_Alloc(FX_BYTE, dest_buf_length);
- }
- FXSYS_memset32(dest_buf, 0, dest_buf_length);
- struct jpeg_destination_mgr dest;
- dest.init_destination = _dest_do_nothing;
- dest.term_destination = _dest_do_nothing;
- dest.empty_output_buffer = _dest_empty;
- dest.next_output_byte = dest_buf;
- dest.free_in_buffer = dest_buf_length;
- cinfo.dest = &dest;
- cinfo.image_width = width;
- cinfo.image_height = height;
- cinfo.input_components = nComponents;
- if (nComponents == 1) {
- cinfo.in_color_space = JCS_GRAYSCALE;
- } else if (nComponents == 3) {
- cinfo.in_color_space = JCS_RGB;
- } else {
- cinfo.in_color_space = JCS_CMYK;
- }
- FX_LPBYTE line_buf = NULL;
- if (nComponents > 1) {
- line_buf = FX_Alloc(FX_BYTE, width * nComponents);
- if (line_buf == NULL) {
- return;
- }
- }
- jpeg_set_defaults(&cinfo);
- if(quality != 75) {
- jpeg_set_quality(&cinfo, quality, TRUE);
- }
- jpeg_start_compress(&cinfo, TRUE);
- _JpegEmbedIccProfile(&cinfo, icc_buf, icc_length);
- JSAMPROW row_pointer[1];
- JDIMENSION row;
- while (cinfo.next_scanline < cinfo.image_height) {
- FX_LPCBYTE src_scan = pSource->GetScanline(cinfo.next_scanline);
- if (nComponents > 1) {
- FX_LPBYTE dest_scan = line_buf;
- if (nComponents == 3) {
- for (int i = 0; i < width; i ++) {
- dest_scan[0] = src_scan[2];
- dest_scan[1] = src_scan[1];
- dest_scan[2] = src_scan[0];
- dest_scan += 3;
- src_scan += Bpp;
- }
- } else {
- for (int i = 0; i < pitch; i ++) {
- *dest_scan++ = ~*src_scan++;
- }
- }
- row_pointer[0] = line_buf;
- } else {
- row_pointer[0] = (FX_LPBYTE)src_scan;
- }
- row = cinfo.next_scanline;
- jpeg_write_scanlines(&cinfo, row_pointer, 1);
- if (cinfo.next_scanline == row) {
- dest_buf = FX_Realloc(FX_BYTE, dest_buf, dest_buf_length + JPEG_BLOCK_SIZE);
- if (dest_buf == NULL) {
- FX_Free(line_buf);
- return;
- }
- dest.next_output_byte = dest_buf + dest_buf_length - dest.free_in_buffer;
- dest_buf_length += JPEG_BLOCK_SIZE;
- dest.free_in_buffer += JPEG_BLOCK_SIZE;
- }
- }
- jpeg_finish_compress(&cinfo);
- jpeg_destroy_compress(&cinfo);
- if (line_buf) {
- FX_Free(line_buf);
- }
- dest_size = dest_buf_length - (FX_STRSIZE)dest.free_in_buffer;
-}
-static FX_BOOL _JpegLoadInfo(FX_LPCBYTE src_buf, FX_DWORD src_size, int& width, int& height,
- int& num_components, int& bits_per_components, FX_BOOL& color_transform,
- FX_LPBYTE* icc_buf_ptr, FX_DWORD* icc_length)
-{
- _JpegScanSOI(src_buf, src_size);
- struct jpeg_decompress_struct cinfo;
- struct jpeg_error_mgr jerr;
- jerr.error_exit = _error_fatal;
- jerr.emit_message = _error_do_nothing1;
- jerr.output_message = _error_do_nothing;
- jerr.format_message = _error_do_nothing2;
- jerr.reset_error_mgr = _error_do_nothing;
- cinfo.err = &jerr;
- jmp_buf mark;
- cinfo.client_data = &mark;
- if (setjmp(mark) == -1) {
- return FALSE;
- }
- jpeg_create_decompress(&cinfo);
- struct jpeg_source_mgr src;
- src.init_source = _src_do_nothing;
- src.term_source = _src_do_nothing;
- src.skip_input_data = _src_skip_data;
- src.fill_input_buffer = _src_fill_buffer;
- src.resync_to_restart = _src_resync;
- src.bytes_in_buffer = src_size;
- src.next_input_byte = src_buf;
- cinfo.src = &src;
- if (setjmp(mark) == -1) {
- jpeg_destroy_decompress(&cinfo);
- return FALSE;
- }
- if(icc_buf_ptr && icc_length) {
- jpeg_save_markers(&cinfo, JPEG_MARKER_ICC, JPEG_MARKER_MAXSIZE);
- }
- int ret = jpeg_read_header(&cinfo, TRUE);
- if (ret != JPEG_HEADER_OK) {
- jpeg_destroy_decompress(&cinfo);
- return FALSE;
- }
- width = cinfo.image_width;
- height = cinfo.image_height;
- num_components = cinfo.num_components;
- color_transform = cinfo.jpeg_color_space == JCS_YCbCr || cinfo.jpeg_color_space == JCS_YCCK;
- bits_per_components = cinfo.data_precision;
- if(icc_buf_ptr != NULL) {
- *icc_buf_ptr = NULL;
- }
- if(icc_length != NULL) {
- *icc_length = 0;
- }
- jpeg_destroy_decompress(&cinfo);
- return TRUE;
-}
-class CCodec_JpegDecoder : public CCodec_ScanlineDecoder
-{
-public:
- CCodec_JpegDecoder();
- ~CCodec_JpegDecoder();
- FX_BOOL Create(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height, int nComps,
- FX_BOOL ColorTransform, IFX_JpegProvider* pJP);
- virtual void Destroy()
- {
- delete this;
- }
- virtual void v_DownScale(int dest_width, int dest_height);
- virtual FX_BOOL v_Rewind();
- virtual FX_LPBYTE v_GetNextLine();
- virtual FX_DWORD GetSrcOffset();
- jmp_buf m_JmpBuf;
- struct jpeg_decompress_struct cinfo;
- struct jpeg_error_mgr jerr;
- struct jpeg_source_mgr src;
- FX_LPCBYTE m_SrcBuf;
- FX_DWORD m_SrcSize;
- FX_LPBYTE m_pScanlineBuf;
- FX_BOOL InitDecode();
- FX_BOOL m_bInited, m_bStarted, m_bJpegTransform;
-protected:
- IFX_JpegProvider* m_pExtProvider;
- void* m_pExtContext;
- FX_DWORD m_nDefaultScaleDenom;
-};
-CCodec_JpegDecoder::CCodec_JpegDecoder()
-{
- m_pScanlineBuf = NULL;
- m_DownScale = 1;
- m_bStarted = FALSE;
- m_bInited = FALSE;
- m_pExtProvider = NULL;
- m_pExtContext = NULL;
- FXSYS_memset32(&cinfo, 0, sizeof(cinfo));
- FXSYS_memset32(&jerr, 0, sizeof(jerr));
- FXSYS_memset32(&src, 0, sizeof(src));
- m_nDefaultScaleDenom = 1;
-}
-CCodec_JpegDecoder::~CCodec_JpegDecoder()
-{
- if (m_pExtProvider) {
- m_pExtProvider->DestroyDecoder(m_pExtContext);
- return;
- }
- if (m_pScanlineBuf) {
- FX_Free(m_pScanlineBuf);
- }
- if (m_bInited) {
- jpeg_destroy_decompress(&cinfo);
- }
-}
-FX_BOOL CCodec_JpegDecoder::InitDecode()
-{
- cinfo.err = &jerr;
- cinfo.client_data = &m_JmpBuf;
- if (setjmp(m_JmpBuf) == -1) {
- return FALSE;
- }
- jpeg_create_decompress(&cinfo);
- m_bInited = TRUE;
- cinfo.src = &src;
- src.bytes_in_buffer = m_SrcSize;
- src.next_input_byte = m_SrcBuf;
- if (setjmp(m_JmpBuf) == -1) {
- jpeg_destroy_decompress(&cinfo);
- m_bInited = FALSE;
- return FALSE;
- }
- cinfo.image_width = m_OrigWidth;
- cinfo.image_height = m_OrigHeight;
- int ret = jpeg_read_header(&cinfo, TRUE);
- if (ret != JPEG_HEADER_OK) {
- return FALSE;
- }
- if (cinfo.saw_Adobe_marker) {
- m_bJpegTransform = TRUE;
- }
- if (cinfo.num_components == 3 && !m_bJpegTransform) {
- cinfo.out_color_space = cinfo.jpeg_color_space;
- }
- m_OrigWidth = cinfo.image_width;
- m_OrigHeight = cinfo.image_height;
- m_OutputWidth = m_OrigWidth;
- m_OutputHeight = m_OutputHeight;
- m_nDefaultScaleDenom = cinfo.scale_denom;
- return TRUE;
-}
-FX_BOOL CCodec_JpegDecoder::Create(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height,
- int nComps, FX_BOOL ColorTransform, IFX_JpegProvider* pJP)
-{
- if (pJP) {
- m_pExtProvider = pJP;
- m_pExtContext = m_pExtProvider->CreateDecoder(src_buf, src_size, width, height, nComps, ColorTransform);
- return m_pExtContext != NULL;
- }
- _JpegScanSOI(src_buf, src_size);
- m_SrcBuf = src_buf;
- m_SrcSize = src_size;
- jerr.error_exit = _error_fatal;
- jerr.emit_message = _error_do_nothing1;
- jerr.output_message = _error_do_nothing;
- jerr.format_message = _error_do_nothing2;
- jerr.reset_error_mgr = _error_do_nothing;
- src.init_source = _src_do_nothing;
- src.term_source = _src_do_nothing;
- src.skip_input_data = _src_skip_data;
- src.fill_input_buffer = _src_fill_buffer;
- src.resync_to_restart = _src_resync;
- m_bJpegTransform = ColorTransform;
- if(src_size > 1 && FXSYS_memcmp32(src_buf + src_size - 2, "\xFF\xD9", 2) != 0) {
- ((FX_LPBYTE)src_buf)[src_size - 2] = 0xFF;
- ((FX_LPBYTE)src_buf)[src_size - 1] = 0xD9;
- }
- m_OutputWidth = m_OrigWidth = width;
- m_OutputHeight = m_OrigHeight = height;
- if (!InitDecode()) {
- return FALSE;
- }
- if (cinfo.num_components < nComps) {
- return FALSE;
- }
- if ((int)cinfo.image_width < width) {
- return FALSE;
- }
- m_Pitch = (cinfo.image_width * cinfo.num_components + 3) / 4 * 4;
- m_pScanlineBuf = FX_Alloc(FX_BYTE, m_Pitch);
- if (m_pScanlineBuf == NULL) {
- return FALSE;
- }
- m_nComps = cinfo.num_components;
- m_bpc = 8;
- m_bColorTransformed = FALSE;
- m_bStarted = FALSE;
- return TRUE;
-}
-extern "C" {
- FX_INT32 FX_GetDownsampleRatio(FX_INT32 originWidth, FX_INT32 originHeight, FX_INT32 downsampleWidth, FX_INT32 downsampleHeight)
- {
- int iratio_w = originWidth / downsampleWidth;
- int iratio_h = originHeight / downsampleHeight;
- int ratio = (iratio_w > iratio_h) ? iratio_h : iratio_w;
- if (ratio >= 8) {
- return 8;
- } else if (ratio >= 4) {
- return 4;
- } else if (ratio >= 2) {
- return 2;
- }
- return 1;
- }
-}
-void CCodec_JpegDecoder::v_DownScale(int dest_width, int dest_height)
-{
- if (m_pExtProvider) {
- m_pExtProvider->DownScale(m_pExtContext, dest_width, dest_height);
- return;
- }
- int old_scale = m_DownScale;
- m_DownScale = FX_GetDownsampleRatio(m_OrigWidth, m_OrigHeight, dest_width, dest_height);
- m_OutputWidth = (m_OrigWidth + m_DownScale - 1) / m_DownScale;
- m_OutputHeight = (m_OrigHeight + m_DownScale - 1) / m_DownScale;
- m_Pitch = (m_OutputWidth * m_nComps + 3) / 4 * 4;
- if (old_scale != m_DownScale) {
- m_NextLine = -1;
- }
-}
-FX_BOOL CCodec_JpegDecoder::v_Rewind()
-{
- if (m_pExtProvider) {
- return m_pExtProvider->Rewind(m_pExtContext);
- }
- if (m_bStarted) {
- jpeg_destroy_decompress(&cinfo);
- if (!InitDecode()) {
- return FALSE;
- }
- }
- if (setjmp(m_JmpBuf) == -1) {
- return FALSE;
- }
- cinfo.scale_denom = m_nDefaultScaleDenom * m_DownScale;
- m_OutputWidth = (m_OrigWidth + m_DownScale - 1) / m_DownScale;
- m_OutputHeight = (m_OrigHeight + m_DownScale - 1) / m_DownScale;
- if (!jpeg_start_decompress(&cinfo)) {
- jpeg_destroy_decompress(&cinfo);
- return FALSE;
- }
- if ((int)cinfo.output_width > m_OrigWidth) {
- FXSYS_assert(FALSE);
- return FALSE;
- }
- m_bStarted = TRUE;
- return TRUE;
-}
-FX_LPBYTE CCodec_JpegDecoder::v_GetNextLine()
-{
- if (m_pExtProvider) {
- return m_pExtProvider->GetNextLine(m_pExtContext);
- }
- int nlines = jpeg_read_scanlines(&cinfo, &m_pScanlineBuf, 1);
- if (nlines < 1) {
- return NULL;
- }
- return m_pScanlineBuf;
-}
-FX_DWORD CCodec_JpegDecoder::GetSrcOffset()
-{
- if (m_pExtProvider) {
- return m_pExtProvider->GetSrcOffset(m_pExtContext);
- }
- return (FX_DWORD)(m_SrcSize - src.bytes_in_buffer);
-}
-ICodec_ScanlineDecoder* CCodec_JpegModule::CreateDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size,
- int width, int height, int nComps, FX_BOOL ColorTransform)
-{
- if (src_buf == NULL || src_size == 0) {
- return NULL;
- }
- CCodec_JpegDecoder* pDecoder = FX_NEW CCodec_JpegDecoder;
- if (pDecoder == NULL) {
- return NULL;
- }
- if (!pDecoder->Create(src_buf, src_size, width, height, nComps, ColorTransform, m_pExtProvider)) {
- delete pDecoder;
- return NULL;
- }
- return pDecoder;
-}
-FX_BOOL CCodec_JpegModule::LoadInfo(FX_LPCBYTE src_buf, FX_DWORD src_size, int& width, int& height,
- int& num_components, int& bits_per_components, FX_BOOL& color_transform,
- FX_LPBYTE* icc_buf_ptr, FX_DWORD* icc_length)
-{
- if (m_pExtProvider) {
- return m_pExtProvider->LoadInfo(src_buf, src_size, width, height,
- num_components, bits_per_components, color_transform,
- icc_buf_ptr, icc_length);
- }
- return _JpegLoadInfo(src_buf, src_size, width, height, num_components, bits_per_components, color_transform, icc_buf_ptr, icc_length);
-}
-FX_BOOL CCodec_JpegModule::Encode(const CFX_DIBSource* pSource, FX_LPBYTE& dest_buf, FX_STRSIZE& dest_size, int quality, FX_LPCBYTE icc_buf, FX_DWORD icc_length)
-{
- if (m_pExtProvider) {
- return m_pExtProvider->Encode(pSource, dest_buf, dest_size, quality, icc_buf, icc_length);
- }
- if(pSource->GetBPP() < 8 || pSource->GetPalette() != NULL) {
- ASSERT(pSource->GetBPP() >= 8 && pSource->GetPalette() == NULL);
- return FALSE;
- }
- _JpegEncode(pSource, dest_buf, dest_size, quality, icc_buf, icc_length);
- return TRUE;
-}
-struct FXJPEG_Context {
- jmp_buf m_JumpMark;
- jpeg_decompress_struct m_Info;
- jpeg_error_mgr m_ErrMgr;
- jpeg_source_mgr m_SrcMgr;
- unsigned int m_SkipSize;
- void* (*m_AllocFunc)(unsigned int);
- void (*m_FreeFunc)(void*);
-};
-extern "C" {
- static void _error_fatal1(j_common_ptr cinfo)
- {
- longjmp(((FXJPEG_Context*)cinfo->client_data)->m_JumpMark, -1);
- }
-};
-extern "C" {
- static void _src_skip_data1(struct jpeg_decompress_struct* cinfo, long num)
- {
- if (cinfo->src->bytes_in_buffer < (size_t)num) {
- ((FXJPEG_Context*)cinfo->client_data)->m_SkipSize = (unsigned int)(num - cinfo->src->bytes_in_buffer);
- cinfo->src->bytes_in_buffer = 0;
- } else {
- cinfo->src->next_input_byte += num;
- cinfo->src->bytes_in_buffer -= num;
- }
- }
-};
-static void* jpeg_alloc_func(unsigned int size)
-{
- return FX_Alloc(char, size);
-}
-static void jpeg_free_func(void* p)
-{
- FX_Free(p);
-}
-void* CCodec_JpegModule::Start()
-{
- if (m_pExtProvider) {
- return m_pExtProvider->Start();
- }
- FXJPEG_Context* p = (FXJPEG_Context*)FX_Alloc(FX_BYTE, sizeof(FXJPEG_Context));
- if (p == NULL) {
- return NULL;
- }
- p->m_AllocFunc = jpeg_alloc_func;
- p->m_FreeFunc = jpeg_free_func;
- p->m_ErrMgr.error_exit = _error_fatal1;
- p->m_ErrMgr.emit_message = _error_do_nothing1;
- p->m_ErrMgr.output_message = _error_do_nothing;
- p->m_ErrMgr.format_message = _error_do_nothing2;
- p->m_ErrMgr.reset_error_mgr = _error_do_nothing;
- p->m_SrcMgr.init_source = _src_do_nothing;
- p->m_SrcMgr.term_source = _src_do_nothing;
- p->m_SrcMgr.skip_input_data = _src_skip_data1;
- p->m_SrcMgr.fill_input_buffer = _src_fill_buffer;
- p->m_SrcMgr.resync_to_restart = _src_resync;
- p->m_Info.client_data = p;
- p->m_Info.err = &p->m_ErrMgr;
- if (setjmp(p->m_JumpMark) == -1) {
- return 0;
- }
- jpeg_create_decompress(&p->m_Info);
- p->m_Info.src = &p->m_SrcMgr;
- p->m_SkipSize = 0;
- return p;
-}
-void CCodec_JpegModule::Finish(void* pContext)
-{
- if (m_pExtProvider) {
- m_pExtProvider->Finish(pContext);
- return;
- }
- FXJPEG_Context* p = (FXJPEG_Context*)pContext;
- jpeg_destroy_decompress(&p->m_Info);
- p->m_FreeFunc(p);
-}
-void CCodec_JpegModule::Input(void* pContext, const unsigned char* src_buf, FX_DWORD src_size)
-{
- if (m_pExtProvider) {
- m_pExtProvider->Input(pContext, src_buf, src_size);
- return;
- }
- FXJPEG_Context* p = (FXJPEG_Context*)pContext;
- if (p->m_SkipSize) {
- if (p->m_SkipSize > src_size) {
- p->m_SrcMgr.bytes_in_buffer = 0;
- p->m_SkipSize -= src_size;
- return;
- }
- src_size -= p->m_SkipSize;
- src_buf += p->m_SkipSize;
- p->m_SkipSize = 0;
- }
- p->m_SrcMgr.next_input_byte = src_buf;
- p->m_SrcMgr.bytes_in_buffer = src_size;
-}
-int CCodec_JpegModule::ReadHeader(void* pContext, int* width, int* height, int* nComps)
-{
- if (m_pExtProvider) {
- return m_pExtProvider->ReadHeader(pContext, width, height, nComps);
- }
- FXJPEG_Context* p = (FXJPEG_Context*)pContext;
- if (setjmp(p->m_JumpMark) == -1) {
- return 1;
- }
- int ret = jpeg_read_header(&p->m_Info, true);
- if (ret == JPEG_SUSPENDED) {
- return 2;
- }
- if (ret != JPEG_HEADER_OK) {
- return 1;
- }
- *width = p->m_Info.image_width;
- *height = p->m_Info.image_height;
- *nComps = p->m_Info.num_components;
- return 0;
-}
-FX_BOOL CCodec_JpegModule::StartScanline(void* pContext, int down_scale)
-{
- if (m_pExtProvider) {
- return m_pExtProvider->StartScanline(pContext, down_scale);
- }
- FXJPEG_Context* p = (FXJPEG_Context*)pContext;
- if (setjmp(p->m_JumpMark) == -1) {
- return FALSE;
- }
- p->m_Info.scale_denom = down_scale;
- return jpeg_start_decompress(&p->m_Info);
-}
-FX_BOOL CCodec_JpegModule::ReadScanline(void* pContext, unsigned char* dest_buf)
-{
- if (m_pExtProvider) {
- return m_pExtProvider->ReadScanline(pContext, dest_buf);
- }
- FXJPEG_Context* p = (FXJPEG_Context*)pContext;
- if (setjmp(p->m_JumpMark) == -1) {
- return FALSE;
- }
- int nlines = jpeg_read_scanlines(&p->m_Info, &dest_buf, 1);
- return nlines == 1;
-}
-FX_DWORD CCodec_JpegModule::GetAvailInput(void* pContext, FX_LPBYTE* avail_buf_ptr)
-{
- if (m_pExtProvider) {
- return m_pExtProvider->GetAvailInput(pContext, avail_buf_ptr);
- }
- if(avail_buf_ptr != NULL) {
- *avail_buf_ptr = NULL;
- if(((FXJPEG_Context*)pContext)->m_SrcMgr.bytes_in_buffer > 0) {
- *avail_buf_ptr = (FX_LPBYTE)((FXJPEG_Context*)pContext)->m_SrcMgr.next_input_byte;
- }
- }
- return (FX_DWORD)((FXJPEG_Context*)pContext)->m_SrcMgr.bytes_in_buffer;
-}
+// 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
+
+#include "../../../include/fxcodec/fx_codec.h"
+#include "../../../include/fxge/fx_dib.h"
+#include "codec_int.h"
+extern "C" {
+ static void _JpegScanSOI(const FX_BYTE*& src_buf, FX_DWORD& src_size)
+ {
+ if (src_size == 0) {
+ return;
+ }
+ FX_DWORD offset = 0;
+ while (offset < src_size - 1) {
+ if (src_buf[offset] == 0xff && src_buf[offset + 1] == 0xd8) {
+ src_buf += offset;
+ src_size -= offset;
+ return;
+ }
+ offset ++;
+ }
+ }
+};
+extern "C" {
+#undef FAR
+#include "../../fx_jpeglib.h"
+}
+extern "C" {
+ static void _src_do_nothing(struct jpeg_decompress_struct* cinfo) {}
+};
+extern "C" {
+ static void _error_fatal(j_common_ptr cinfo)
+ {
+ longjmp(*(jmp_buf*)cinfo->client_data, -1);
+ }
+};
+extern "C" {
+ static void _src_skip_data(struct jpeg_decompress_struct* cinfo, long num)
+ {
+ if (num > (long)cinfo->src->bytes_in_buffer) {
+ _error_fatal((j_common_ptr)cinfo);
+ }
+ cinfo->src->next_input_byte += num;
+ cinfo->src->bytes_in_buffer -= num;
+ }
+};
+extern "C" {
+ static boolean _src_fill_buffer(j_decompress_ptr cinfo)
+ {
+ return 0;
+ }
+};
+extern "C" {
+ static boolean _src_resync(j_decompress_ptr cinfo, int desired)
+ {
+ return 0;
+ }
+};
+extern "C" {
+ static void _error_do_nothing(j_common_ptr cinfo) {}
+};
+extern "C" {
+ static void _error_do_nothing1(j_common_ptr cinfo, int) {}
+};
+extern "C" {
+ static void _error_do_nothing2(j_common_ptr cinfo, char*) {}
+};
+#define JPEG_MARKER_EXIF (JPEG_APP0 + 1)
+#define JPEG_MARKER_ICC (JPEG_APP0 + 2)
+#define JPEG_MARKER_AUTHORTIME (JPEG_APP0 + 3)
+#define JPEG_MARKER_MAXSIZE 0xFFFF
+#define JPEG_OVERHEAD_LEN 14
+static FX_BOOL _JpegIsIccMarker(jpeg_saved_marker_ptr marker)
+{
+ if (marker->marker == JPEG_MARKER_ICC &&
+ marker->data_length >= JPEG_OVERHEAD_LEN &&
+ (FXSYS_memcmp32(marker->data, "\x49\x43\x43\x5f\x50\x52\x4f\x46\x49\x4c\x45\x00", 12) == 0)) {
+ return TRUE;
+ }
+ return FALSE;
+}
+static FX_BOOL _JpegLoadIccProfile(j_decompress_ptr cinfo, FX_LPBYTE* icc_buf_ptr, FX_DWORD* icc_length)
+{
+ if(icc_buf_ptr == NULL || icc_length == NULL) {
+ return FALSE;
+ }
+ *icc_buf_ptr = NULL;
+ *icc_length = 0;
+ FX_LPBYTE icc_data_ptr = NULL;
+ FX_DWORD icc_data_len = 0;
+ FX_BYTE count_icc_marker = 0;
+ FX_BYTE num_icc_marker = 0;
+ jpeg_saved_marker_ptr marker_list[256] = {NULL};
+ for (jpeg_saved_marker_ptr cur_marker = cinfo->marker_list;
+ cur_marker != NULL;
+ cur_marker = cur_marker->next) {
+ if(_JpegIsIccMarker(cur_marker)) {
+ if(count_icc_marker == 0) {
+ num_icc_marker = cur_marker->data[13];
+ } else if(num_icc_marker != cur_marker->data[13]) {
+ return FALSE;
+ }
+ int sn = cur_marker->data[12] - 1;
+ if(sn < 0 || sn >= num_icc_marker) {
+ return FALSE;
+ }
+ if(marker_list[sn] == NULL) {
+ marker_list[sn] = cur_marker;
+ } else {
+ return FALSE;
+ }
+ count_icc_marker ++;
+ icc_data_len += (cur_marker->data_length - JPEG_OVERHEAD_LEN);
+ }
+ }
+ if(count_icc_marker != num_icc_marker) {
+ return FALSE;
+ }
+ if(num_icc_marker == 0) {
+ return TRUE;
+ }
+ icc_data_ptr = FX_Alloc(FX_BYTE, icc_data_len);
+ if(icc_buf_ptr == NULL) {
+ return FALSE;
+ }
+ *icc_buf_ptr = icc_data_ptr;
+ *icc_length = icc_data_len;
+ for (int idx = 0; idx < num_icc_marker; idx++) {
+ icc_data_len = marker_list[idx]->data_length - JPEG_OVERHEAD_LEN;
+ FXSYS_memcpy32(icc_data_ptr, marker_list[idx]->data + JPEG_OVERHEAD_LEN, icc_data_len);
+ icc_data_ptr += icc_data_len;
+ }
+ return TRUE;
+}
+static FX_BOOL _JpegEmbedIccProfile(j_compress_ptr cinfo, FX_LPCBYTE icc_buf_ptr, FX_DWORD icc_length)
+{
+ if(icc_buf_ptr == NULL || icc_length == 0) {
+ return FALSE;
+ }
+ FX_DWORD icc_segment_size = (JPEG_MARKER_MAXSIZE - 2 - JPEG_OVERHEAD_LEN);
+ FX_DWORD icc_segment_num = (icc_length / icc_segment_size) + 1;
+ if (icc_segment_num > 255) {
+ return FALSE;
+ }
+ FX_DWORD icc_data_length = JPEG_OVERHEAD_LEN + (icc_segment_num > 1 ? icc_segment_size : icc_length);
+ FX_LPBYTE icc_data = FX_Alloc(FX_BYTE, icc_data_length);
+ if (icc_data == NULL) {
+ return FALSE;
+ }
+ FXSYS_memcpy32(icc_data, "\x49\x43\x43\x5f\x50\x52\x4f\x46\x49\x4c\x45\x00", 12);
+ icc_data[13] = (FX_BYTE)icc_segment_num;
+ for (FX_BYTE i = 0; i < (icc_segment_num - 1); i++) {
+ icc_data[12] = i + 1;
+ FXSYS_memcpy32(icc_data + JPEG_OVERHEAD_LEN, icc_buf_ptr + i * icc_segment_size, icc_segment_size);
+ jpeg_write_marker(cinfo, JPEG_MARKER_ICC, icc_data, icc_data_length);
+ }
+ icc_data[12] = (FX_BYTE)icc_segment_num;
+ FX_DWORD icc_size = (icc_segment_num - 1) * icc_segment_size;
+ FXSYS_memcpy32(icc_data + JPEG_OVERHEAD_LEN, icc_buf_ptr + icc_size, icc_length - icc_size);
+ jpeg_write_marker(cinfo, JPEG_MARKER_ICC, icc_data, JPEG_OVERHEAD_LEN + icc_length - icc_size);
+ FX_Free(icc_data);
+ return TRUE;
+}
+extern "C" {
+ static void _dest_do_nothing(j_compress_ptr cinfo) {}
+};
+extern "C" {
+ static boolean _dest_empty(j_compress_ptr cinfo)
+ {
+ return FALSE;
+ }
+};
+#define JPEG_BLOCK_SIZE 1048576
+static void _JpegEncode(const CFX_DIBSource* pSource, FX_LPBYTE& dest_buf, FX_STRSIZE& dest_size, int quality, FX_LPCBYTE icc_buf, FX_DWORD icc_length)
+{
+ struct jpeg_compress_struct cinfo;
+ struct jpeg_error_mgr jerr;
+ jerr.error_exit = _error_do_nothing;
+ jerr.emit_message = _error_do_nothing1;
+ jerr.output_message = _error_do_nothing;
+ jerr.format_message = _error_do_nothing2;
+ jerr.reset_error_mgr = _error_do_nothing;
+ cinfo.err = &jerr;
+ jpeg_create_compress(&cinfo);
+ int Bpp = pSource->GetBPP() / 8;
+ int nComponents = Bpp >= 3 ? (pSource->IsCmykImage() ? 4 : 3) : 1;
+ int pitch = pSource->GetPitch();
+ int width = pSource->GetWidth();
+ int height = pSource->GetHeight();
+ FX_DWORD dest_buf_length = width * height * nComponents + 1024 + (icc_length ? (icc_length + 255 * 18) : 0);
+ dest_buf = FX_Alloc(FX_BYTE, dest_buf_length);
+ while (dest_buf == NULL) {
+ dest_buf_length >>= 1;
+ dest_buf = FX_Alloc(FX_BYTE, dest_buf_length);
+ }
+ FXSYS_memset32(dest_buf, 0, dest_buf_length);
+ struct jpeg_destination_mgr dest;
+ dest.init_destination = _dest_do_nothing;
+ dest.term_destination = _dest_do_nothing;
+ dest.empty_output_buffer = _dest_empty;
+ dest.next_output_byte = dest_buf;
+ dest.free_in_buffer = dest_buf_length;
+ cinfo.dest = &dest;
+ cinfo.image_width = width;
+ cinfo.image_height = height;
+ cinfo.input_components = nComponents;
+ if (nComponents == 1) {
+ cinfo.in_color_space = JCS_GRAYSCALE;
+ } else if (nComponents == 3) {
+ cinfo.in_color_space = JCS_RGB;
+ } else {
+ cinfo.in_color_space = JCS_CMYK;
+ }
+ FX_LPBYTE line_buf = NULL;
+ if (nComponents > 1) {
+ line_buf = FX_Alloc(FX_BYTE, width * nComponents);
+ if (line_buf == NULL) {
+ return;
+ }
+ }
+ jpeg_set_defaults(&cinfo);
+ if(quality != 75) {
+ jpeg_set_quality(&cinfo, quality, TRUE);
+ }
+ jpeg_start_compress(&cinfo, TRUE);
+ _JpegEmbedIccProfile(&cinfo, icc_buf, icc_length);
+ JSAMPROW row_pointer[1];
+ JDIMENSION row;
+ while (cinfo.next_scanline < cinfo.image_height) {
+ FX_LPCBYTE src_scan = pSource->GetScanline(cinfo.next_scanline);
+ if (nComponents > 1) {
+ FX_LPBYTE dest_scan = line_buf;
+ if (nComponents == 3) {
+ for (int i = 0; i < width; i ++) {
+ dest_scan[0] = src_scan[2];
+ dest_scan[1] = src_scan[1];
+ dest_scan[2] = src_scan[0];
+ dest_scan += 3;
+ src_scan += Bpp;
+ }
+ } else {
+ for (int i = 0; i < pitch; i ++) {
+ *dest_scan++ = ~*src_scan++;
+ }
+ }
+ row_pointer[0] = line_buf;
+ } else {
+ row_pointer[0] = (FX_LPBYTE)src_scan;
+ }
+ row = cinfo.next_scanline;
+ jpeg_write_scanlines(&cinfo, row_pointer, 1);
+ if (cinfo.next_scanline == row) {
+ dest_buf = FX_Realloc(FX_BYTE, dest_buf, dest_buf_length + JPEG_BLOCK_SIZE);
+ if (dest_buf == NULL) {
+ FX_Free(line_buf);
+ return;
+ }
+ dest.next_output_byte = dest_buf + dest_buf_length - dest.free_in_buffer;
+ dest_buf_length += JPEG_BLOCK_SIZE;
+ dest.free_in_buffer += JPEG_BLOCK_SIZE;
+ }
+ }
+ jpeg_finish_compress(&cinfo);
+ jpeg_destroy_compress(&cinfo);
+ if (line_buf) {
+ FX_Free(line_buf);
+ }
+ dest_size = dest_buf_length - (FX_STRSIZE)dest.free_in_buffer;
+}
+static FX_BOOL _JpegLoadInfo(FX_LPCBYTE src_buf, FX_DWORD src_size, int& width, int& height,
+ int& num_components, int& bits_per_components, FX_BOOL& color_transform,
+ FX_LPBYTE* icc_buf_ptr, FX_DWORD* icc_length)
+{
+ _JpegScanSOI(src_buf, src_size);
+ struct jpeg_decompress_struct cinfo;
+ struct jpeg_error_mgr jerr;
+ jerr.error_exit = _error_fatal;
+ jerr.emit_message = _error_do_nothing1;
+ jerr.output_message = _error_do_nothing;
+ jerr.format_message = _error_do_nothing2;
+ jerr.reset_error_mgr = _error_do_nothing;
+ cinfo.err = &jerr;
+ jmp_buf mark;
+ cinfo.client_data = &mark;
+ if (setjmp(mark) == -1) {
+ return FALSE;
+ }
+ jpeg_create_decompress(&cinfo);
+ struct jpeg_source_mgr src;
+ src.init_source = _src_do_nothing;
+ src.term_source = _src_do_nothing;
+ src.skip_input_data = _src_skip_data;
+ src.fill_input_buffer = _src_fill_buffer;
+ src.resync_to_restart = _src_resync;
+ src.bytes_in_buffer = src_size;
+ src.next_input_byte = src_buf;
+ cinfo.src = &src;
+ if (setjmp(mark) == -1) {
+ jpeg_destroy_decompress(&cinfo);
+ return FALSE;
+ }
+ if(icc_buf_ptr && icc_length) {
+ jpeg_save_markers(&cinfo, JPEG_MARKER_ICC, JPEG_MARKER_MAXSIZE);
+ }
+ int ret = jpeg_read_header(&cinfo, TRUE);
+ if (ret != JPEG_HEADER_OK) {
+ jpeg_destroy_decompress(&cinfo);
+ return FALSE;
+ }
+ width = cinfo.image_width;
+ height = cinfo.image_height;
+ num_components = cinfo.num_components;
+ color_transform = cinfo.jpeg_color_space == JCS_YCbCr || cinfo.jpeg_color_space == JCS_YCCK;
+ bits_per_components = cinfo.data_precision;
+ if(icc_buf_ptr != NULL) {
+ *icc_buf_ptr = NULL;
+ }
+ if(icc_length != NULL) {
+ *icc_length = 0;
+ }
+ jpeg_destroy_decompress(&cinfo);
+ return TRUE;
+}
+class CCodec_JpegDecoder : public CCodec_ScanlineDecoder
+{
+public:
+ CCodec_JpegDecoder();
+ ~CCodec_JpegDecoder();
+ FX_BOOL Create(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height, int nComps,
+ FX_BOOL ColorTransform, IFX_JpegProvider* pJP);
+ virtual void Destroy()
+ {
+ delete this;
+ }
+ virtual void v_DownScale(int dest_width, int dest_height);
+ virtual FX_BOOL v_Rewind();
+ virtual FX_LPBYTE v_GetNextLine();
+ virtual FX_DWORD GetSrcOffset();
+ jmp_buf m_JmpBuf;
+ struct jpeg_decompress_struct cinfo;
+ struct jpeg_error_mgr jerr;
+ struct jpeg_source_mgr src;
+ FX_LPCBYTE m_SrcBuf;
+ FX_DWORD m_SrcSize;
+ FX_LPBYTE m_pScanlineBuf;
+ FX_BOOL InitDecode();
+ FX_BOOL m_bInited, m_bStarted, m_bJpegTransform;
+protected:
+ IFX_JpegProvider* m_pExtProvider;
+ void* m_pExtContext;
+ FX_DWORD m_nDefaultScaleDenom;
+};
+CCodec_JpegDecoder::CCodec_JpegDecoder()
+{
+ m_pScanlineBuf = NULL;
+ m_DownScale = 1;
+ m_bStarted = FALSE;
+ m_bInited = FALSE;
+ m_pExtProvider = NULL;
+ m_pExtContext = NULL;
+ FXSYS_memset32(&cinfo, 0, sizeof(cinfo));
+ FXSYS_memset32(&jerr, 0, sizeof(jerr));
+ FXSYS_memset32(&src, 0, sizeof(src));
+ m_nDefaultScaleDenom = 1;
+}
+CCodec_JpegDecoder::~CCodec_JpegDecoder()
+{
+ if (m_pExtProvider) {
+ m_pExtProvider->DestroyDecoder(m_pExtContext);
+ return;
+ }
+ if (m_pScanlineBuf) {
+ FX_Free(m_pScanlineBuf);
+ }
+ if (m_bInited) {
+ jpeg_destroy_decompress(&cinfo);
+ }
+}
+FX_BOOL CCodec_JpegDecoder::InitDecode()
+{
+ cinfo.err = &jerr;
+ cinfo.client_data = &m_JmpBuf;
+ if (setjmp(m_JmpBuf) == -1) {
+ return FALSE;
+ }
+ jpeg_create_decompress(&cinfo);
+ m_bInited = TRUE;
+ cinfo.src = &src;
+ src.bytes_in_buffer = m_SrcSize;
+ src.next_input_byte = m_SrcBuf;
+ if (setjmp(m_JmpBuf) == -1) {
+ jpeg_destroy_decompress(&cinfo);
+ m_bInited = FALSE;
+ return FALSE;
+ }
+ cinfo.image_width = m_OrigWidth;
+ cinfo.image_height = m_OrigHeight;
+ int ret = jpeg_read_header(&cinfo, TRUE);
+ if (ret != JPEG_HEADER_OK) {
+ return FALSE;
+ }
+ if (cinfo.saw_Adobe_marker) {
+ m_bJpegTransform = TRUE;
+ }
+ if (cinfo.num_components == 3 && !m_bJpegTransform) {
+ cinfo.out_color_space = cinfo.jpeg_color_space;
+ }
+ m_OrigWidth = cinfo.image_width;
+ m_OrigHeight = cinfo.image_height;
+ m_OutputWidth = m_OrigWidth;
+ m_OutputHeight = m_OutputHeight;
+ m_nDefaultScaleDenom = cinfo.scale_denom;
+ return TRUE;
+}
+FX_BOOL CCodec_JpegDecoder::Create(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height,
+ int nComps, FX_BOOL ColorTransform, IFX_JpegProvider* pJP)
+{
+ if (pJP) {
+ m_pExtProvider = pJP;
+ m_pExtContext = m_pExtProvider->CreateDecoder(src_buf, src_size, width, height, nComps, ColorTransform);
+ return m_pExtContext != NULL;
+ }
+ _JpegScanSOI(src_buf, src_size);
+ m_SrcBuf = src_buf;
+ m_SrcSize = src_size;
+ jerr.error_exit = _error_fatal;
+ jerr.emit_message = _error_do_nothing1;
+ jerr.output_message = _error_do_nothing;
+ jerr.format_message = _error_do_nothing2;
+ jerr.reset_error_mgr = _error_do_nothing;
+ src.init_source = _src_do_nothing;
+ src.term_source = _src_do_nothing;
+ src.skip_input_data = _src_skip_data;
+ src.fill_input_buffer = _src_fill_buffer;
+ src.resync_to_restart = _src_resync;
+ m_bJpegTransform = ColorTransform;
+ if(src_size > 1 && FXSYS_memcmp32(src_buf + src_size - 2, "\xFF\xD9", 2) != 0) {
+ ((FX_LPBYTE)src_buf)[src_size - 2] = 0xFF;
+ ((FX_LPBYTE)src_buf)[src_size - 1] = 0xD9;
+ }
+ m_OutputWidth = m_OrigWidth = width;
+ m_OutputHeight = m_OrigHeight = height;
+ if (!InitDecode()) {
+ return FALSE;
+ }
+ if (cinfo.num_components < nComps) {
+ return FALSE;
+ }
+ if ((int)cinfo.image_width < width) {
+ return FALSE;
+ }
+ m_Pitch = (cinfo.image_width * cinfo.num_components + 3) / 4 * 4;
+ m_pScanlineBuf = FX_Alloc(FX_BYTE, m_Pitch);
+ if (m_pScanlineBuf == NULL) {
+ return FALSE;
+ }
+ m_nComps = cinfo.num_components;
+ m_bpc = 8;
+ m_bColorTransformed = FALSE;
+ m_bStarted = FALSE;
+ return TRUE;
+}
+extern "C" {
+ FX_INT32 FX_GetDownsampleRatio(FX_INT32 originWidth, FX_INT32 originHeight, FX_INT32 downsampleWidth, FX_INT32 downsampleHeight)
+ {
+ int iratio_w = originWidth / downsampleWidth;
+ int iratio_h = originHeight / downsampleHeight;
+ int ratio = (iratio_w > iratio_h) ? iratio_h : iratio_w;
+ if (ratio >= 8) {
+ return 8;
+ } else if (ratio >= 4) {
+ return 4;
+ } else if (ratio >= 2) {
+ return 2;
+ }
+ return 1;
+ }
+}
+void CCodec_JpegDecoder::v_DownScale(int dest_width, int dest_height)
+{
+ if (m_pExtProvider) {
+ m_pExtProvider->DownScale(m_pExtContext, dest_width, dest_height);
+ return;
+ }
+ int old_scale = m_DownScale;
+ m_DownScale = FX_GetDownsampleRatio(m_OrigWidth, m_OrigHeight, dest_width, dest_height);
+ m_OutputWidth = (m_OrigWidth + m_DownScale - 1) / m_DownScale;
+ m_OutputHeight = (m_OrigHeight + m_DownScale - 1) / m_DownScale;
+ m_Pitch = (m_OutputWidth * m_nComps + 3) / 4 * 4;
+ if (old_scale != m_DownScale) {
+ m_NextLine = -1;
+ }
+}
+FX_BOOL CCodec_JpegDecoder::v_Rewind()
+{
+ if (m_pExtProvider) {
+ return m_pExtProvider->Rewind(m_pExtContext);
+ }
+ if (m_bStarted) {
+ jpeg_destroy_decompress(&cinfo);
+ if (!InitDecode()) {
+ return FALSE;
+ }
+ }
+ if (setjmp(m_JmpBuf) == -1) {
+ return FALSE;
+ }
+ cinfo.scale_denom = m_nDefaultScaleDenom * m_DownScale;
+ m_OutputWidth = (m_OrigWidth + m_DownScale - 1) / m_DownScale;
+ m_OutputHeight = (m_OrigHeight + m_DownScale - 1) / m_DownScale;
+ if (!jpeg_start_decompress(&cinfo)) {
+ jpeg_destroy_decompress(&cinfo);
+ return FALSE;
+ }
+ if ((int)cinfo.output_width > m_OrigWidth) {
+ FXSYS_assert(FALSE);
+ return FALSE;
+ }
+ m_bStarted = TRUE;
+ return TRUE;
+}
+FX_LPBYTE CCodec_JpegDecoder::v_GetNextLine()
+{
+ if (m_pExtProvider) {
+ return m_pExtProvider->GetNextLine(m_pExtContext);
+ }
+ int nlines = jpeg_read_scanlines(&cinfo, &m_pScanlineBuf, 1);
+ if (nlines < 1) {
+ return NULL;
+ }
+ return m_pScanlineBuf;
+}
+FX_DWORD CCodec_JpegDecoder::GetSrcOffset()
+{
+ if (m_pExtProvider) {
+ return m_pExtProvider->GetSrcOffset(m_pExtContext);
+ }
+ return (FX_DWORD)(m_SrcSize - src.bytes_in_buffer);
+}
+ICodec_ScanlineDecoder* CCodec_JpegModule::CreateDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size,
+ int width, int height, int nComps, FX_BOOL ColorTransform)
+{
+ if (src_buf == NULL || src_size == 0) {
+ return NULL;
+ }
+ CCodec_JpegDecoder* pDecoder = FX_NEW CCodec_JpegDecoder;
+ if (pDecoder == NULL) {
+ return NULL;
+ }
+ if (!pDecoder->Create(src_buf, src_size, width, height, nComps, ColorTransform, m_pExtProvider)) {
+ delete pDecoder;
+ return NULL;
+ }
+ return pDecoder;
+}
+FX_BOOL CCodec_JpegModule::LoadInfo(FX_LPCBYTE src_buf, FX_DWORD src_size, int& width, int& height,
+ int& num_components, int& bits_per_components, FX_BOOL& color_transform,
+ FX_LPBYTE* icc_buf_ptr, FX_DWORD* icc_length)
+{
+ if (m_pExtProvider) {
+ return m_pExtProvider->LoadInfo(src_buf, src_size, width, height,
+ num_components, bits_per_components, color_transform,
+ icc_buf_ptr, icc_length);
+ }
+ return _JpegLoadInfo(src_buf, src_size, width, height, num_components, bits_per_components, color_transform, icc_buf_ptr, icc_length);
+}
+FX_BOOL CCodec_JpegModule::Encode(const CFX_DIBSource* pSource, FX_LPBYTE& dest_buf, FX_STRSIZE& dest_size, int quality, FX_LPCBYTE icc_buf, FX_DWORD icc_length)
+{
+ if (m_pExtProvider) {
+ return m_pExtProvider->Encode(pSource, dest_buf, dest_size, quality, icc_buf, icc_length);
+ }
+ if(pSource->GetBPP() < 8 || pSource->GetPalette() != NULL) {
+ ASSERT(pSource->GetBPP() >= 8 && pSource->GetPalette() == NULL);
+ return FALSE;
+ }
+ _JpegEncode(pSource, dest_buf, dest_size, quality, icc_buf, icc_length);
+ return TRUE;
+}
+struct FXJPEG_Context {
+ jmp_buf m_JumpMark;
+ jpeg_decompress_struct m_Info;
+ jpeg_error_mgr m_ErrMgr;
+ jpeg_source_mgr m_SrcMgr;
+ unsigned int m_SkipSize;
+ void* (*m_AllocFunc)(unsigned int);
+ void (*m_FreeFunc)(void*);
+};
+extern "C" {
+ static void _error_fatal1(j_common_ptr cinfo)
+ {
+ longjmp(((FXJPEG_Context*)cinfo->client_data)->m_JumpMark, -1);
+ }
+};
+extern "C" {
+ static void _src_skip_data1(struct jpeg_decompress_struct* cinfo, long num)
+ {
+ if (cinfo->src->bytes_in_buffer < (size_t)num) {
+ ((FXJPEG_Context*)cinfo->client_data)->m_SkipSize = (unsigned int)(num - cinfo->src->bytes_in_buffer);
+ cinfo->src->bytes_in_buffer = 0;
+ } else {
+ cinfo->src->next_input_byte += num;
+ cinfo->src->bytes_in_buffer -= num;
+ }
+ }
+};
+static void* jpeg_alloc_func(unsigned int size)
+{
+ return FX_Alloc(char, size);
+}
+static void jpeg_free_func(void* p)
+{
+ FX_Free(p);
+}
+void* CCodec_JpegModule::Start()
+{
+ if (m_pExtProvider) {
+ return m_pExtProvider->Start();
+ }
+ FXJPEG_Context* p = (FXJPEG_Context*)FX_Alloc(FX_BYTE, sizeof(FXJPEG_Context));
+ if (p == NULL) {
+ return NULL;
+ }
+ p->m_AllocFunc = jpeg_alloc_func;
+ p->m_FreeFunc = jpeg_free_func;
+ p->m_ErrMgr.error_exit = _error_fatal1;
+ p->m_ErrMgr.emit_message = _error_do_nothing1;
+ p->m_ErrMgr.output_message = _error_do_nothing;
+ p->m_ErrMgr.format_message = _error_do_nothing2;
+ p->m_ErrMgr.reset_error_mgr = _error_do_nothing;
+ p->m_SrcMgr.init_source = _src_do_nothing;
+ p->m_SrcMgr.term_source = _src_do_nothing;
+ p->m_SrcMgr.skip_input_data = _src_skip_data1;
+ p->m_SrcMgr.fill_input_buffer = _src_fill_buffer;
+ p->m_SrcMgr.resync_to_restart = _src_resync;
+ p->m_Info.client_data = p;
+ p->m_Info.err = &p->m_ErrMgr;
+ if (setjmp(p->m_JumpMark) == -1) {
+ return 0;
+ }
+ jpeg_create_decompress(&p->m_Info);
+ p->m_Info.src = &p->m_SrcMgr;
+ p->m_SkipSize = 0;
+ return p;
+}
+void CCodec_JpegModule::Finish(void* pContext)
+{
+ if (m_pExtProvider) {
+ m_pExtProvider->Finish(pContext);
+ return;
+ }
+ FXJPEG_Context* p = (FXJPEG_Context*)pContext;
+ jpeg_destroy_decompress(&p->m_Info);
+ p->m_FreeFunc(p);
+}
+void CCodec_JpegModule::Input(void* pContext, const unsigned char* src_buf, FX_DWORD src_size)
+{
+ if (m_pExtProvider) {
+ m_pExtProvider->Input(pContext, src_buf, src_size);
+ return;
+ }
+ FXJPEG_Context* p = (FXJPEG_Context*)pContext;
+ if (p->m_SkipSize) {
+ if (p->m_SkipSize > src_size) {
+ p->m_SrcMgr.bytes_in_buffer = 0;
+ p->m_SkipSize -= src_size;
+ return;
+ }
+ src_size -= p->m_SkipSize;
+ src_buf += p->m_SkipSize;
+ p->m_SkipSize = 0;
+ }
+ p->m_SrcMgr.next_input_byte = src_buf;
+ p->m_SrcMgr.bytes_in_buffer = src_size;
+}
+int CCodec_JpegModule::ReadHeader(void* pContext, int* width, int* height, int* nComps)
+{
+ if (m_pExtProvider) {
+ return m_pExtProvider->ReadHeader(pContext, width, height, nComps);
+ }
+ FXJPEG_Context* p = (FXJPEG_Context*)pContext;
+ if (setjmp(p->m_JumpMark) == -1) {
+ return 1;
+ }
+ int ret = jpeg_read_header(&p->m_Info, true);
+ if (ret == JPEG_SUSPENDED) {
+ return 2;
+ }
+ if (ret != JPEG_HEADER_OK) {
+ return 1;
+ }
+ *width = p->m_Info.image_width;
+ *height = p->m_Info.image_height;
+ *nComps = p->m_Info.num_components;
+ return 0;
+}
+FX_BOOL CCodec_JpegModule::StartScanline(void* pContext, int down_scale)
+{
+ if (m_pExtProvider) {
+ return m_pExtProvider->StartScanline(pContext, down_scale);
+ }
+ FXJPEG_Context* p = (FXJPEG_Context*)pContext;
+ if (setjmp(p->m_JumpMark) == -1) {
+ return FALSE;
+ }
+ p->m_Info.scale_denom = down_scale;
+ return jpeg_start_decompress(&p->m_Info);
+}
+FX_BOOL CCodec_JpegModule::ReadScanline(void* pContext, unsigned char* dest_buf)
+{
+ if (m_pExtProvider) {
+ return m_pExtProvider->ReadScanline(pContext, dest_buf);
+ }
+ FXJPEG_Context* p = (FXJPEG_Context*)pContext;
+ if (setjmp(p->m_JumpMark) == -1) {
+ return FALSE;
+ }
+ int nlines = jpeg_read_scanlines(&p->m_Info, &dest_buf, 1);
+ return nlines == 1;
+}
+FX_DWORD CCodec_JpegModule::GetAvailInput(void* pContext, FX_LPBYTE* avail_buf_ptr)
+{
+ if (m_pExtProvider) {
+ return m_pExtProvider->GetAvailInput(pContext, avail_buf_ptr);
+ }
+ if(avail_buf_ptr != NULL) {
+ *avail_buf_ptr = NULL;
+ if(((FXJPEG_Context*)pContext)->m_SrcMgr.bytes_in_buffer > 0) {
+ *avail_buf_ptr = (FX_LPBYTE)((FXJPEG_Context*)pContext)->m_SrcMgr.next_input_byte;
+ }
+ }
+ return (FX_DWORD)((FXJPEG_Context*)pContext)->m_SrcMgr.bytes_in_buffer;
+}
diff --git a/core/src/fxcodec/codec/fx_codec_jpx_opj.cpp b/core/src/fxcodec/codec/fx_codec_jpx_opj.cpp
index 423819f69f..32cb10076d 100644
--- a/core/src/fxcodec/codec/fx_codec_jpx_opj.cpp
+++ b/core/src/fxcodec/codec/fx_codec_jpx_opj.cpp
@@ -1,799 +1,799 @@
-// 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
-
-#include "../../../include/fxcodec/fx_codec.h"
-#include "codec_int.h"
-#include "../fx_libopenjpeg/libopenjpeg20/openjpeg.h"
-#include "../lcms2/include/fx_lcms2.h"
-static void fx_error_callback(const char *msg, void *client_data)
-{
- (void)client_data;
-}
-static void fx_warning_callback(const char *msg, void *client_data)
-{
- (void)client_data;
-}
-static void fx_info_callback(const char *msg, void *client_data)
-{
- (void)client_data;
-}
-typedef struct {
- const unsigned char* src_data;
- int src_size;
- int offset;
-} decodeData;
-static OPJ_SIZE_T opj_read_from_memory (void * p_buffer, OPJ_SIZE_T p_nb_bytes, decodeData* srcData)
-{
- if(srcData == NULL || srcData->src_size == 0 || srcData->src_data == NULL || srcData->offset >= srcData->src_size) {
- return -1;
- }
- OPJ_SIZE_T readlength = p_nb_bytes;
- OPJ_SIZE_T bufferLength = (OPJ_SIZE_T)(srcData->src_size - srcData->offset);
- if(bufferLength <= 0) {
- return 0;
- }
- if(bufferLength <= p_nb_bytes) {
- readlength = bufferLength;
- }
- memcpy(p_buffer, &(srcData->src_data[srcData->offset]), readlength);
- srcData->offset += (int)readlength;
- return readlength;
-}
-static OPJ_SIZE_T opj_write_from_memory (void * p_buffer, OPJ_SIZE_T p_nb_bytes, decodeData* srcData)
-{
- if(srcData == NULL || srcData->src_size == 0 || srcData->src_data == NULL || srcData->offset >= srcData->src_size) {
- return -1;
- }
- OPJ_SIZE_T writeLength = p_nb_bytes;
- OPJ_SIZE_T bufferLength = (OPJ_SIZE_T)(srcData->src_size - srcData->offset);
- if(bufferLength <= p_nb_bytes) {
- writeLength = bufferLength;
- }
- memcpy((void*&)(srcData->src_data[srcData->offset]), p_buffer, writeLength);
- srcData->offset += (int)writeLength;
- return writeLength;
-}
-static OPJ_OFF_T opj_skip_from_memory (OPJ_OFF_T p_nb_bytes, decodeData* srcData)
-{
- if(srcData == NULL || srcData->src_size == 0 || srcData->src_data == NULL || srcData->offset >= srcData->src_size) {
- return -1;
- }
- OPJ_OFF_T postion = srcData->offset + p_nb_bytes;
- if(postion < 0 ) {
- postion = 0;
- } else if (postion > srcData->src_size) {
- }
- srcData->offset = (int)postion;
- return p_nb_bytes;
-}
-static OPJ_BOOL opj_seek_from_memory (OPJ_OFF_T p_nb_bytes, decodeData * srcData)
-{
- if(srcData == NULL || srcData->src_size == 0 || srcData->src_data == NULL || srcData->offset >= srcData->src_size) {
- return -1;
- }
- srcData->offset = (int)p_nb_bytes;
- if(srcData->offset < 0) {
- srcData->offset = 0;
- } else if(srcData->offset > srcData->src_size) {
- srcData->offset = srcData->src_size;
- }
- return OPJ_TRUE;
-}
-opj_stream_t* fx_opj_stream_create_memory_stream (decodeData* data, OPJ_SIZE_T p_size, OPJ_BOOL p_is_read_stream)
-{
- opj_stream_t* l_stream = 00;
- if (!data || ! data->src_data || data->src_size <= 0 ) {
- return NULL;
- }
- l_stream = opj_stream_create(p_size, p_is_read_stream);
- if (! l_stream) {
- return NULL;
- }
- opj_stream_set_user_data_v3(l_stream, data, NULL);
- opj_stream_set_user_data_length(l_stream, data->src_size);
- opj_stream_set_read_function(l_stream, (opj_stream_read_fn) opj_read_from_memory);
- opj_stream_set_write_function(l_stream, (opj_stream_write_fn) opj_write_from_memory);
- opj_stream_set_skip_function(l_stream, (opj_stream_skip_fn) opj_skip_from_memory);
- opj_stream_set_seek_function(l_stream, (opj_stream_seek_fn) opj_seek_from_memory);
- return l_stream;
-}
-static void sycc_to_rgb(int offset, int upb, int y, int cb, int cr,
- int *out_r, int *out_g, int *out_b)
-{
- int r, g, b;
- cb -= offset;
- cr -= offset;
- r = y + (int)(1.402 * (float)cr);
- if(r < 0) {
- r = 0;
- } else if(r > upb) {
- r = upb;
- } *out_r = r;
- g = y - (int)(0.344 * (float)cb + 0.714 * (float)cr);
- if(g < 0) {
- g = 0;
- } else if(g > upb) {
- g = upb;
- } *out_g = g;
- b = y + (int)(1.772 * (float)cb);
- if(b < 0) {
- b = 0;
- } else if(b > upb) {
- b = upb;
- } *out_b = b;
-}
-static void sycc444_to_rgb(opj_image_t *img)
-{
- int *d0, *d1, *d2, *r, *g, *b;
- const int *y, *cb, *cr;
- int maxw, maxh, max, i, offset, upb;
- i = (int)img->comps[0].prec;
- offset = 1 << (i - 1);
- upb = (1 << i) - 1;
- maxw = (int)img->comps[0].w;
- maxh = (int)img->comps[0].h;
- max = maxw * maxh;
- y = img->comps[0].data;
- cb = img->comps[1].data;
- cr = img->comps[2].data;
- d0 = r = FX_Alloc(int, (size_t)max);
- d1 = g = FX_Alloc(int, (size_t)max);
- d2 = b = FX_Alloc(int, (size_t)max);
- for(i = 0; i < max; ++i) {
- sycc_to_rgb(offset, upb, *y, *cb, *cr, r, g, b);
- ++y;
- ++cb;
- ++cr;
- ++r;
- ++g;
- ++b;
- }
- FX_Free(img->comps[0].data);
- img->comps[0].data = d0;
- FX_Free(img->comps[1].data);
- img->comps[1].data = d1;
- FX_Free(img->comps[2].data);
- img->comps[2].data = d2;
-}
-static void sycc422_to_rgb(opj_image_t *img)
-{
- int *d0, *d1, *d2, *r, *g, *b;
- const int *y, *cb, *cr;
- int maxw, maxh, max, offset, upb;
- int i, j;
- i = (int)img->comps[0].prec;
- offset = 1 << (i - 1);
- upb = (1 << i) - 1;
- maxw = (int)img->comps[0].w;
- maxh = (int)img->comps[0].h;
- max = maxw * maxh;
- y = img->comps[0].data;
- cb = img->comps[1].data;
- cr = img->comps[2].data;
- d0 = r = FX_Alloc(int, (size_t)max);
- d1 = g = FX_Alloc(int, (size_t)max);
- d2 = b = FX_Alloc(int, (size_t)max);
- for(i = 0; i < maxh; ++i) {
- for(j = 0; j < maxw; j += 2) {
- sycc_to_rgb(offset, upb, *y, *cb, *cr, r, g, b);
- ++y;
- ++r;
- ++g;
- ++b;
- sycc_to_rgb(offset, upb, *y, *cb, *cr, r, g, b);
- ++y;
- ++r;
- ++g;
- ++b;
- ++cb;
- ++cr;
- }
- }
- FX_Free(img->comps[0].data);
- img->comps[0].data = d0;
- FX_Free(img->comps[1].data);
- img->comps[1].data = d1;
- FX_Free(img->comps[2].data);
- img->comps[2].data = d2;
- img->comps[1].w = maxw;
- img->comps[1].h = maxh;
- img->comps[2].w = maxw;
- img->comps[2].h = maxh;
- img->comps[1].w = (OPJ_UINT32)maxw;
- img->comps[1].h = (OPJ_UINT32)maxh;
- img->comps[2].w = (OPJ_UINT32)maxw;
- img->comps[2].h = (OPJ_UINT32)maxh;
- img->comps[1].dx = img->comps[0].dx;
- img->comps[2].dx = img->comps[0].dx;
- img->comps[1].dy = img->comps[0].dy;
- img->comps[2].dy = img->comps[0].dy;
-}
-static void sycc420_to_rgb(opj_image_t *img)
-{
- int *d0, *d1, *d2, *r, *g, *b, *nr, *ng, *nb;
- const int *y, *cb, *cr, *ny;
- int maxw, maxh, max, offset, upb;
- int i, j;
- i = (int)img->comps[0].prec;
- offset = 1 << (i - 1);
- upb = (1 << i) - 1;
- maxw = (int)img->comps[0].w;
- maxh = (int)img->comps[0].h;
- max = maxw * maxh;
- y = img->comps[0].data;
- cb = img->comps[1].data;
- cr = img->comps[2].data;
- d0 = r = FX_Alloc(int, (size_t)max);
- d1 = g = FX_Alloc(int, (size_t)max);
- d2 = b = FX_Alloc(int, (size_t)max);
- for(i = 0; i < maxh; i += 2) {
- ny = y + maxw;
- nr = r + maxw;
- ng = g + maxw;
- nb = b + maxw;
- for(j = 0; j < maxw; j += 2) {
- sycc_to_rgb(offset, upb, *y, *cb, *cr, r, g, b);
- ++y;
- ++r;
- ++g;
- ++b;
- sycc_to_rgb(offset, upb, *y, *cb, *cr, r, g, b);
- ++y;
- ++r;
- ++g;
- ++b;
- sycc_to_rgb(offset, upb, *ny, *cb, *cr, nr, ng, nb);
- ++ny;
- ++nr;
- ++ng;
- ++nb;
- sycc_to_rgb(offset, upb, *ny, *cb, *cr, nr, ng, nb);
- ++ny;
- ++nr;
- ++ng;
- ++nb;
- ++cb;
- ++cr;
- }
- y += maxw;
- r += maxw;
- g += maxw;
- b += maxw;
- }
- FX_Free(img->comps[0].data);
- img->comps[0].data = d0;
- FX_Free(img->comps[1].data);
- img->comps[1].data = d1;
- FX_Free(img->comps[2].data);
- img->comps[2].data = d2;
- img->comps[1].w = maxw;
- img->comps[1].h = maxh;
- img->comps[2].w = maxw;
- img->comps[2].h = maxh;
- img->comps[1].w = (OPJ_UINT32)maxw;
- img->comps[1].h = (OPJ_UINT32)maxh;
- img->comps[2].w = (OPJ_UINT32)maxw;
- img->comps[2].h = (OPJ_UINT32)maxh;
- img->comps[1].dx = img->comps[0].dx;
- img->comps[2].dx = img->comps[0].dx;
- img->comps[1].dy = img->comps[0].dy;
- img->comps[2].dy = img->comps[0].dy;
-}
-void color_sycc_to_rgb(opj_image_t *img)
-{
- if(img->numcomps < 3) {
- img->color_space = OPJ_CLRSPC_GRAY;
- return;
- }
- if((img->comps[0].dx == 1)
- && (img->comps[1].dx == 2)
- && (img->comps[2].dx == 2)
- && (img->comps[0].dy == 1)
- && (img->comps[1].dy == 2)
- && (img->comps[2].dy == 2)) {
- sycc420_to_rgb(img);
- } else if((img->comps[0].dx == 1)
- && (img->comps[1].dx == 2)
- && (img->comps[2].dx == 2)
- && (img->comps[0].dy == 1)
- && (img->comps[1].dy == 1)
- && (img->comps[2].dy == 1)) {
- sycc422_to_rgb(img);
- } else if((img->comps[0].dx == 1)
- && (img->comps[1].dx == 1)
- && (img->comps[2].dx == 1)
- && (img->comps[0].dy == 1)
- && (img->comps[1].dy == 1)
- && (img->comps[2].dy == 1)) {
- sycc444_to_rgb(img);
- } else {
- return;
- }
- img->color_space = OPJ_CLRSPC_SRGB;
-}
-void color_apply_icc_profile(opj_image_t *image)
-{
- cmsHPROFILE in_prof, out_prof;
- cmsHTRANSFORM transform;
- cmsColorSpaceSignature in_space, out_space;
- cmsUInt32Number intent, in_type, out_type, nr_samples;
- int *r, *g, *b;
- int prec, i, max, max_w, max_h;
- OPJ_COLOR_SPACE oldspace;
- in_prof =
- cmsOpenProfileFromMem(image->icc_profile_buf, image->icc_profile_len);
- if(in_prof == NULL) {
- return;
- }
- in_space = cmsGetPCS(in_prof);
- out_space = cmsGetColorSpace(in_prof);
- intent = cmsGetHeaderRenderingIntent(in_prof);
- max_w = (int)image->comps[0].w;
- max_h = (int)image->comps[0].h;
- prec = (int)image->comps[0].prec;
- oldspace = image->color_space;
- if(out_space == cmsSigRgbData) {
- if( prec <= 8 ) {
- in_type = TYPE_RGB_8;
- out_type = TYPE_RGB_8;
- } else {
- in_type = TYPE_RGB_16;
- out_type = TYPE_RGB_16;
- }
- out_prof = cmsCreate_sRGBProfile();
- image->color_space = OPJ_CLRSPC_SRGB;
- } else if(out_space == cmsSigGrayData) {
- if( prec <= 8 ) {
- in_type = TYPE_GRAY_8;
- out_type = TYPE_RGB_8;
- } else {
- in_type = TYPE_GRAY_16;
- out_type = TYPE_RGB_16;
- }
- out_prof = cmsCreate_sRGBProfile();
- image->color_space = OPJ_CLRSPC_SRGB;
- } else if(out_space == cmsSigYCbCrData) {
- in_type = TYPE_YCbCr_16;
- out_type = TYPE_RGB_16;
- out_prof = cmsCreate_sRGBProfile();
- image->color_space = OPJ_CLRSPC_SRGB;
- } else {
- return;
- }
- transform = cmsCreateTransform(in_prof, in_type,
- out_prof, out_type, intent, 0);
- cmsCloseProfile(in_prof);
- cmsCloseProfile(out_prof);
- if(transform == NULL) {
- image->color_space = oldspace;
- return;
- }
- if(image->numcomps > 2) {
- if( prec <= 8 ) {
- unsigned char *inbuf, *outbuf, *in, *out;
- max = max_w * max_h;
- nr_samples = (cmsUInt32Number)max * 3 * (cmsUInt32Number)sizeof(unsigned char);
- in = inbuf = FX_Alloc(unsigned char, nr_samples);
- out = outbuf = FX_Alloc(unsigned char, nr_samples);
- r = image->comps[0].data;
- g = image->comps[1].data;
- b = image->comps[2].data;
- for(i = 0; i < max; ++i) {
- *in++ = (unsigned char) * r++;
- *in++ = (unsigned char) * g++;
- *in++ = (unsigned char) * b++;
- }
- cmsDoTransform(transform, inbuf, outbuf, (cmsUInt32Number)max);
- r = image->comps[0].data;
- g = image->comps[1].data;
- b = image->comps[2].data;
- for(i = 0; i < max; ++i) {
- *r++ = (int) * out++;
- *g++ = (int) * out++;
- *b++ = (int) * out++;
- }
- FX_Free(inbuf);
- FX_Free(outbuf);
- } else {
- unsigned short *inbuf, *outbuf, *in, *out;
- max = max_w * max_h;
- nr_samples = (cmsUInt32Number)max * 3 * (cmsUInt32Number)sizeof(unsigned short);
- in = inbuf = FX_Alloc(unsigned short, nr_samples);
- out = outbuf = FX_Alloc(unsigned short, nr_samples);
- r = image->comps[0].data;
- g = image->comps[1].data;
- b = image->comps[2].data;
- for(i = 0; i < max; ++i) {
- *in++ = (unsigned short) * r++;
- *in++ = (unsigned short) * g++;
- *in++ = (unsigned short) * b++;
- }
- cmsDoTransform(transform, inbuf, outbuf, (cmsUInt32Number)max);
- r = image->comps[0].data;
- g = image->comps[1].data;
- b = image->comps[2].data;
- for(i = 0; i < max; ++i) {
- *r++ = (int) * out++;
- *g++ = (int) * out++;
- *b++ = (int) * out++;
- }
- FX_Free(inbuf);
- FX_Free(outbuf);
- }
- } else {
- unsigned char *in, *inbuf, *out, *outbuf;
- max = max_w * max_h;
- nr_samples = (cmsUInt32Number)max * 3 * sizeof(unsigned char);
- in = inbuf = FX_Alloc(unsigned char, nr_samples);
- out = outbuf = FX_Alloc(unsigned char, nr_samples);
- image->comps = (opj_image_comp_t*)
- realloc(image->comps, (image->numcomps + 2) * sizeof(opj_image_comp_t));
- if(image->numcomps == 2) {
- image->comps[3] = image->comps[1];
- }
- image->comps[1] = image->comps[0];
- image->comps[2] = image->comps[0];
- image->comps[1].data = FX_Alloc(int, (size_t)max);
- FXSYS_memset8(image->comps[1].data, 0, sizeof(int) * (size_t)max);
- image->comps[2].data = FX_Alloc(int, (size_t)max);
- FXSYS_memset8(image->comps[2].data, 0, sizeof(int) * (size_t)max);
- image->numcomps += 2;
- r = image->comps[0].data;
- for(i = 0; i < max; ++i) {
- *in++ = (unsigned char) * r++;
- }
- cmsDoTransform(transform, inbuf, outbuf, (cmsUInt32Number)max);
- r = image->comps[0].data;
- g = image->comps[1].data;
- b = image->comps[2].data;
- for(i = 0; i < max; ++i) {
- *r++ = (int) * out++;
- *g++ = (int) * out++;
- *b++ = (int) * out++;
- }
- FX_Free(inbuf);
- FX_Free(outbuf);
- }
- cmsDeleteTransform(transform);
-}
-void color_apply_conversion(opj_image_t *image)
-{
- int *row;
- int enumcs, numcomps;
- numcomps = image->numcomps;
- if(numcomps < 3) {
- return;
- }
- row = (int*)image->icc_profile_buf;
- enumcs = row[0];
- if(enumcs == 14) {
- int *L, *a, *b, *red, *green, *blue, *src0, *src1, *src2;
- double rl, ol, ra, oa, rb, ob, prec0, prec1, prec2;
- double minL, maxL, mina, maxa, minb, maxb;
- unsigned int default_type, il;
- unsigned int i, max, illu;
- cmsHPROFILE in, out;
- cmsHTRANSFORM transform;
- cmsUInt16Number RGB[3];
- cmsCIELab Lab;
- illu = 0;
- il = 0;
- in = cmsCreateLab4Profile(NULL);
- out = cmsCreate_sRGBProfile();
- transform =
- cmsCreateTransform(in, TYPE_Lab_DBL, out, TYPE_RGB_16,
- INTENT_PERCEPTUAL, 0);
- cmsCloseProfile(in);
- cmsCloseProfile(out);
- if(transform == NULL) {
- return;
- }
- prec0 = (double)image->comps[0].prec;
- prec1 = (double)image->comps[1].prec;
- prec2 = (double)image->comps[2].prec;
- default_type = row[1];
- if(default_type == 0x44454600) {
- rl = 100;
- ra = 170;
- rb = 200;
- ol = 0;
- oa = pow(2, prec1 - 1);
- ob = pow(2, prec2 - 2) + pow(2, prec2 - 3);
- } else {
- rl = row[2];
- ra = row[4];
- rb = row[6];
- ol = row[3];
- oa = row[5];
- ob = row[7];
- }
- L = src0 = image->comps[0].data;
- a = src1 = image->comps[1].data;
- b = src2 = image->comps[2].data;
- max = image->comps[0].w * image->comps[0].h;
- red = FX_Alloc(int, max);
- image->comps[0].data = red;
- green = FX_Alloc(int, max);
- image->comps[1].data = green;
- blue = FX_Alloc(int, max);
- image->comps[2].data = blue;
- minL = -(rl * ol) / (pow(2, prec0) - 1);
- maxL = minL + rl;
- mina = -(ra * oa) / (pow(2, prec1) - 1);
- maxa = mina + ra;
- minb = -(rb * ob) / (pow(2, prec2) - 1);
- maxb = minb + rb;
- for(i = 0; i < max; ++i) {
- Lab.L = minL + (double)(*L) * (maxL - minL) / (pow(2, prec0) - 1);
- ++L;
- Lab.a = mina + (double)(*a) * (maxa - mina) / (pow(2, prec1) - 1);
- ++a;
- Lab.b = minb + (double)(*b) * (maxb - minb) / (pow(2, prec2) - 1);
- ++b;
- cmsDoTransform(transform, &Lab, RGB, 1);
- *red++ = RGB[0];
- *green++ = RGB[1];
- *blue++ = RGB[2];
- }
- cmsDeleteTransform(transform);
- FX_Free(src0);
- FX_Free(src1);
- FX_Free(src2);
- image->color_space = OPJ_CLRSPC_SRGB;
- image->comps[0].prec = 16;
- image->comps[1].prec = 16;
- image->comps[2].prec = 16;
- return;
- }
-}
-class CJPX_Decoder : public CFX_Object
-{
-public:
- CJPX_Decoder();
- ~CJPX_Decoder();
- FX_BOOL Init(const unsigned char* src_data, int src_size);
- void GetInfo(FX_DWORD& width, FX_DWORD& height, FX_DWORD& codestream_nComps, FX_DWORD& output_nComps);
- FX_BOOL Decode(FX_LPBYTE dest_buf, int pitch, FX_BOOL bTranslateColor, FX_LPBYTE offsets);
- FX_LPCBYTE m_SrcData;
- int m_SrcSize;
- opj_image_t *image;
- opj_codec_t* l_codec;
- opj_stream_t *l_stream;
- FX_BOOL m_useColorSpace;
-};
-CJPX_Decoder::CJPX_Decoder(): image(NULL), l_codec(NULL), l_stream(NULL), m_useColorSpace(FALSE)
-{
-}
-CJPX_Decoder::~CJPX_Decoder()
-{
- if(l_codec) {
- opj_destroy_codec(l_codec);
- }
- if(l_stream) {
- opj_stream_destroy(l_stream);
- }
- if(image) {
- opj_image_destroy(image);
- }
-}
-FX_BOOL CJPX_Decoder::Init(const unsigned char* src_data, int src_size)
-{
- opj_dparameters_t parameters;
- try {
- image = NULL;
- m_SrcData = src_data;
- m_SrcSize = src_size;
- decodeData srcData;
- srcData.offset = 0;
- srcData.src_size = src_size;
- srcData.src_data = src_data;
- l_stream = fx_opj_stream_create_memory_stream(&srcData, OPJ_J2K_STREAM_CHUNK_SIZE, 1);
- if (l_stream == NULL) {
- return FALSE;
- }
- opj_set_default_decoder_parameters(&parameters);
- parameters.decod_format = 0;
- parameters.cod_format = 3;
- if(FXSYS_memcmp32(m_SrcData, "\x00\x00\x00\x0c\x6a\x50\x20\x20\x0d\x0a\x87\x0a", 12) == 0) {
- l_codec = opj_create_decompress(OPJ_CODEC_JP2);
- parameters.decod_format = 1;
- } else {
- l_codec = opj_create_decompress(OPJ_CODEC_J2K);
- }
- if(!l_codec) {
- return FALSE;
- }
- opj_set_info_handler(l_codec, fx_info_callback, 00);
- opj_set_warning_handler(l_codec, fx_warning_callback, 00);
- opj_set_error_handler(l_codec, fx_error_callback, 00);
- if ( !opj_setup_decoder(l_codec, &parameters) ) {
- return FALSE;
- }
- if(! opj_read_header(l_stream, l_codec, &image)) {
- image = NULL;
- return FALSE;
- }
- if(this->m_useColorSpace) {
- image->useColorSpace = 1;
- } else {
- image->useColorSpace = 0;
- }
- if (!parameters.nb_tile_to_decode) {
- if (!opj_set_decode_area(l_codec, image, parameters.DA_x0,
- parameters.DA_y0, parameters.DA_x1, parameters.DA_y1)) {
- opj_image_destroy(image);
- image = NULL;
- return FALSE;
- }
- if (!(opj_decode(l_codec, l_stream, image) && opj_end_decompress(l_codec, l_stream))) {
- opj_image_destroy(image);
- image = NULL;
- return FALSE;
- }
- } else {
- if (!opj_get_decoded_tile(l_codec, l_stream, image, parameters.tile_index)) {
- return FALSE;
- }
- }
- opj_stream_destroy(l_stream);
- l_stream = NULL;
- if( image->color_space != OPJ_CLRSPC_SYCC
- && image->numcomps == 3 && image->comps[0].dx == image->comps[0].dy
- && image->comps[1].dx != 1 ) {
- image->color_space = OPJ_CLRSPC_SYCC;
- } else if (image->numcomps <= 2) {
- image->color_space = OPJ_CLRSPC_GRAY;
- }
- if(image->color_space == OPJ_CLRSPC_SYCC) {
- color_sycc_to_rgb(image);
- }
- if(image->icc_profile_buf && !image->useColorSpace) {
- FX_Free(image->icc_profile_buf);
- image->icc_profile_buf = NULL;
- image->icc_profile_len = 0;
- }
- if(!image) {
- return FALSE;
- }
- } catch (...) {
- return FALSE;
- }
- return TRUE;
-}
-void CJPX_Decoder::GetInfo(FX_DWORD& width, FX_DWORD& height, FX_DWORD& codestream_nComps, FX_DWORD& output_nComps)
-{
- width = (FX_DWORD)image->x1;
- height = (FX_DWORD)image->y1;
- output_nComps = codestream_nComps = (FX_DWORD)image->numcomps;
-}
-FX_BOOL CJPX_Decoder::Decode(FX_LPBYTE dest_buf, int pitch, FX_BOOL bTranslateColor, FX_LPBYTE offsets)
-{
- FX_BYTE** channel_bufs;
- int* adjust_comps;
- int i, wid, hei, row, col, channel, src;
- FX_BOOL flag;
- FX_LPBYTE pChannel, pScanline, pPixel;
- try {
- if(image->comps[0].w != image->x1 || image->comps[0].h != image->y1) {
- return FALSE;
- }
- if(pitch < (int)(image->comps[0].w * 8 * image->numcomps + 31) >> 5 << 2) {
- return FALSE;
- }
- FXSYS_memset8(dest_buf, 0xff, image->y1 * pitch);
- channel_bufs = FX_Alloc(FX_BYTE*, image->numcomps);
- if (channel_bufs == NULL) {
- return FALSE;
- }
- adjust_comps = FX_Alloc(int, image->numcomps);
- if (adjust_comps == NULL) {
- FX_Free(channel_bufs);
- return FALSE;
- }
- flag = TRUE;
- for (i = 0; i < (int)image->numcomps; i ++) {
- channel_bufs[i] = dest_buf + offsets[i];
- adjust_comps[i] = image->comps[i].prec - 8;
- if(i > 0) {
- if(image->comps[i].dx != image->comps[i - 1].dx
- || image->comps[i].dy != image->comps[i - 1].dy
- || image->comps[i].prec != image->comps[i - 1].prec) {
- flag = FALSE;
- goto failed;
- }
- }
- }
- wid = image->comps[0].w;
- hei = image->comps[0].h;
- for (channel = 0; channel < (int)image->numcomps; channel++) {
- pChannel = channel_bufs[channel];
- if(adjust_comps[channel] < 0) {
- for(row = 0; row < hei; row++) {
- pScanline = pChannel + row * pitch;
- for (col = 0; col < wid; col++) {
- pPixel = pScanline + col * image->numcomps;
- src = image->comps[channel].data[row * wid + col];
- src += image->comps[channel].sgnd ? 1 << (image->comps[channel].prec - 1) : 0;
- if (adjust_comps[channel] > 0) {
- *pPixel = 0;
- } else {
- *pPixel = (FX_BYTE)(src << -adjust_comps[channel]);
- }
- }
- }
- } else {
- for(row = 0; row < hei; row++) {
- pScanline = pChannel + row * pitch;
- for (col = 0; col < wid; col++) {
- pPixel = pScanline + col * image->numcomps;
- if (!image->comps[channel].data) continue;
- src = image->comps[channel].data[row * wid + col];
- src += image->comps[channel].sgnd ? 1 << (image->comps[channel].prec - 1) : 0;
- if (adjust_comps[channel] - 1 < 0) {
- *pPixel = (FX_BYTE)((src >> adjust_comps[channel]));
- } else {
- int tmpPixel = (src >> adjust_comps[channel]) + ((src >> (adjust_comps[channel] - 1)) % 2);
- if (tmpPixel > 255) {
- tmpPixel = 255;
- } else if (tmpPixel < 0) {
- tmpPixel = 0;
- }
- *pPixel = (FX_BYTE)tmpPixel;
- }
- }
- }
- }
- }
- } catch (...) {
- if (channel_bufs) {
- FX_Free(channel_bufs);
- }
- FX_Free(adjust_comps);
- return FALSE;
- }
- FX_Free(channel_bufs);
- FX_Free(adjust_comps);
- return TRUE;
-failed:
- FX_Free(channel_bufs);
- FX_Free(adjust_comps);
- return FALSE;
-}
-void initialize_transition_table();
-void initialize_significance_luts();
-void initialize_sign_lut();
-CCodec_JpxModule::CCodec_JpxModule()
-{
-}
-void* CCodec_JpxModule::CreateDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size , FX_BOOL useColorSpace)
-{
- CJPX_Decoder* pDecoder = FX_NEW CJPX_Decoder;
- if (pDecoder == NULL) {
- return NULL;
- }
- pDecoder->m_useColorSpace = useColorSpace;
- if (!pDecoder->Init(src_buf, src_size)) {
- delete pDecoder;
- return NULL;
- }
- return pDecoder;
-}
-void CCodec_JpxModule::GetImageInfo(FX_LPVOID ctx, FX_DWORD& width, FX_DWORD& height,
- FX_DWORD& codestream_nComps, FX_DWORD& output_nComps)
-{
- CJPX_Decoder* pDecoder = (CJPX_Decoder*)ctx;
- pDecoder->GetInfo(width, height, codestream_nComps, output_nComps);
-}
-FX_BOOL CCodec_JpxModule::Decode(void* ctx, FX_LPBYTE dest_data, int pitch, FX_BOOL bTranslateColor, FX_LPBYTE offsets)
-{
- CJPX_Decoder* pDecoder = (CJPX_Decoder*)ctx;
- return pDecoder->Decode(dest_data, pitch, bTranslateColor, offsets);
-}
-void CCodec_JpxModule::DestroyDecoder(void* ctx)
-{
- CJPX_Decoder* pDecoder = (CJPX_Decoder*)ctx;
- delete pDecoder;
-}
+// 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
+
+#include "../../../include/fxcodec/fx_codec.h"
+#include "codec_int.h"
+#include "../fx_libopenjpeg/libopenjpeg20/openjpeg.h"
+#include "../lcms2/include/fx_lcms2.h"
+static void fx_error_callback(const char *msg, void *client_data)
+{
+ (void)client_data;
+}
+static void fx_warning_callback(const char *msg, void *client_data)
+{
+ (void)client_data;
+}
+static void fx_info_callback(const char *msg, void *client_data)
+{
+ (void)client_data;
+}
+typedef struct {
+ const unsigned char* src_data;
+ int src_size;
+ int offset;
+} decodeData;
+static OPJ_SIZE_T opj_read_from_memory (void * p_buffer, OPJ_SIZE_T p_nb_bytes, decodeData* srcData)
+{
+ if(srcData == NULL || srcData->src_size == 0 || srcData->src_data == NULL || srcData->offset >= srcData->src_size) {
+ return -1;
+ }
+ OPJ_SIZE_T readlength = p_nb_bytes;
+ OPJ_SIZE_T bufferLength = (OPJ_SIZE_T)(srcData->src_size - srcData->offset);
+ if(bufferLength <= 0) {
+ return 0;
+ }
+ if(bufferLength <= p_nb_bytes) {
+ readlength = bufferLength;
+ }
+ memcpy(p_buffer, &(srcData->src_data[srcData->offset]), readlength);
+ srcData->offset += (int)readlength;
+ return readlength;
+}
+static OPJ_SIZE_T opj_write_from_memory (void * p_buffer, OPJ_SIZE_T p_nb_bytes, decodeData* srcData)
+{
+ if(srcData == NULL || srcData->src_size == 0 || srcData->src_data == NULL || srcData->offset >= srcData->src_size) {
+ return -1;
+ }
+ OPJ_SIZE_T writeLength = p_nb_bytes;
+ OPJ_SIZE_T bufferLength = (OPJ_SIZE_T)(srcData->src_size - srcData->offset);
+ if(bufferLength <= p_nb_bytes) {
+ writeLength = bufferLength;
+ }
+ memcpy((void*&)(srcData->src_data[srcData->offset]), p_buffer, writeLength);
+ srcData->offset += (int)writeLength;
+ return writeLength;
+}
+static OPJ_OFF_T opj_skip_from_memory (OPJ_OFF_T p_nb_bytes, decodeData* srcData)
+{
+ if(srcData == NULL || srcData->src_size == 0 || srcData->src_data == NULL || srcData->offset >= srcData->src_size) {
+ return -1;
+ }
+ OPJ_OFF_T postion = srcData->offset + p_nb_bytes;
+ if(postion < 0 ) {
+ postion = 0;
+ } else if (postion > srcData->src_size) {
+ }
+ srcData->offset = (int)postion;
+ return p_nb_bytes;
+}
+static OPJ_BOOL opj_seek_from_memory (OPJ_OFF_T p_nb_bytes, decodeData * srcData)
+{
+ if(srcData == NULL || srcData->src_size == 0 || srcData->src_data == NULL || srcData->offset >= srcData->src_size) {
+ return -1;
+ }
+ srcData->offset = (int)p_nb_bytes;
+ if(srcData->offset < 0) {
+ srcData->offset = 0;
+ } else if(srcData->offset > srcData->src_size) {
+ srcData->offset = srcData->src_size;
+ }
+ return OPJ_TRUE;
+}
+opj_stream_t* fx_opj_stream_create_memory_stream (decodeData* data, OPJ_SIZE_T p_size, OPJ_BOOL p_is_read_stream)
+{
+ opj_stream_t* l_stream = 00;
+ if (!data || ! data->src_data || data->src_size <= 0 ) {
+ return NULL;
+ }
+ l_stream = opj_stream_create(p_size, p_is_read_stream);
+ if (! l_stream) {
+ return NULL;
+ }
+ opj_stream_set_user_data_v3(l_stream, data, NULL);
+ opj_stream_set_user_data_length(l_stream, data->src_size);
+ opj_stream_set_read_function(l_stream, (opj_stream_read_fn) opj_read_from_memory);
+ opj_stream_set_write_function(l_stream, (opj_stream_write_fn) opj_write_from_memory);
+ opj_stream_set_skip_function(l_stream, (opj_stream_skip_fn) opj_skip_from_memory);
+ opj_stream_set_seek_function(l_stream, (opj_stream_seek_fn) opj_seek_from_memory);
+ return l_stream;
+}
+static void sycc_to_rgb(int offset, int upb, int y, int cb, int cr,
+ int *out_r, int *out_g, int *out_b)
+{
+ int r, g, b;
+ cb -= offset;
+ cr -= offset;
+ r = y + (int)(1.402 * (float)cr);
+ if(r < 0) {
+ r = 0;
+ } else if(r > upb) {
+ r = upb;
+ } *out_r = r;
+ g = y - (int)(0.344 * (float)cb + 0.714 * (float)cr);
+ if(g < 0) {
+ g = 0;
+ } else if(g > upb) {
+ g = upb;
+ } *out_g = g;
+ b = y + (int)(1.772 * (float)cb);
+ if(b < 0) {
+ b = 0;
+ } else if(b > upb) {
+ b = upb;
+ } *out_b = b;
+}
+static void sycc444_to_rgb(opj_image_t *img)
+{
+ int *d0, *d1, *d2, *r, *g, *b;
+ const int *y, *cb, *cr;
+ int maxw, maxh, max, i, offset, upb;
+ i = (int)img->comps[0].prec;
+ offset = 1 << (i - 1);
+ upb = (1 << i) - 1;
+ maxw = (int)img->comps[0].w;
+ maxh = (int)img->comps[0].h;
+ max = maxw * maxh;
+ y = img->comps[0].data;
+ cb = img->comps[1].data;
+ cr = img->comps[2].data;
+ d0 = r = FX_Alloc(int, (size_t)max);
+ d1 = g = FX_Alloc(int, (size_t)max);
+ d2 = b = FX_Alloc(int, (size_t)max);
+ for(i = 0; i < max; ++i) {
+ sycc_to_rgb(offset, upb, *y, *cb, *cr, r, g, b);
+ ++y;
+ ++cb;
+ ++cr;
+ ++r;
+ ++g;
+ ++b;
+ }
+ FX_Free(img->comps[0].data);
+ img->comps[0].data = d0;
+ FX_Free(img->comps[1].data);
+ img->comps[1].data = d1;
+ FX_Free(img->comps[2].data);
+ img->comps[2].data = d2;
+}
+static void sycc422_to_rgb(opj_image_t *img)
+{
+ int *d0, *d1, *d2, *r, *g, *b;
+ const int *y, *cb, *cr;
+ int maxw, maxh, max, offset, upb;
+ int i, j;
+ i = (int)img->comps[0].prec;
+ offset = 1 << (i - 1);
+ upb = (1 << i) - 1;
+ maxw = (int)img->comps[0].w;
+ maxh = (int)img->comps[0].h;
+ max = maxw * maxh;
+ y = img->comps[0].data;
+ cb = img->comps[1].data;
+ cr = img->comps[2].data;
+ d0 = r = FX_Alloc(int, (size_t)max);
+ d1 = g = FX_Alloc(int, (size_t)max);
+ d2 = b = FX_Alloc(int, (size_t)max);
+ for(i = 0; i < maxh; ++i) {
+ for(j = 0; j < maxw; j += 2) {
+ sycc_to_rgb(offset, upb, *y, *cb, *cr, r, g, b);
+ ++y;
+ ++r;
+ ++g;
+ ++b;
+ sycc_to_rgb(offset, upb, *y, *cb, *cr, r, g, b);
+ ++y;
+ ++r;
+ ++g;
+ ++b;
+ ++cb;
+ ++cr;
+ }
+ }
+ FX_Free(img->comps[0].data);
+ img->comps[0].data = d0;
+ FX_Free(img->comps[1].data);
+ img->comps[1].data = d1;
+ FX_Free(img->comps[2].data);
+ img->comps[2].data = d2;
+ img->comps[1].w = maxw;
+ img->comps[1].h = maxh;
+ img->comps[2].w = maxw;
+ img->comps[2].h = maxh;
+ img->comps[1].w = (OPJ_UINT32)maxw;
+ img->comps[1].h = (OPJ_UINT32)maxh;
+ img->comps[2].w = (OPJ_UINT32)maxw;
+ img->comps[2].h = (OPJ_UINT32)maxh;
+ img->comps[1].dx = img->comps[0].dx;
+ img->comps[2].dx = img->comps[0].dx;
+ img->comps[1].dy = img->comps[0].dy;
+ img->comps[2].dy = img->comps[0].dy;
+}
+static void sycc420_to_rgb(opj_image_t *img)
+{
+ int *d0, *d1, *d2, *r, *g, *b, *nr, *ng, *nb;
+ const int *y, *cb, *cr, *ny;
+ int maxw, maxh, max, offset, upb;
+ int i, j;
+ i = (int)img->comps[0].prec;
+ offset = 1 << (i - 1);
+ upb = (1 << i) - 1;
+ maxw = (int)img->comps[0].w;
+ maxh = (int)img->comps[0].h;
+ max = maxw * maxh;
+ y = img->comps[0].data;
+ cb = img->comps[1].data;
+ cr = img->comps[2].data;
+ d0 = r = FX_Alloc(int, (size_t)max);
+ d1 = g = FX_Alloc(int, (size_t)max);
+ d2 = b = FX_Alloc(int, (size_t)max);
+ for(i = 0; i < maxh; i += 2) {
+ ny = y + maxw;
+ nr = r + maxw;
+ ng = g + maxw;
+ nb = b + maxw;
+ for(j = 0; j < maxw; j += 2) {
+ sycc_to_rgb(offset, upb, *y, *cb, *cr, r, g, b);
+ ++y;
+ ++r;
+ ++g;
+ ++b;
+ sycc_to_rgb(offset, upb, *y, *cb, *cr, r, g, b);
+ ++y;
+ ++r;
+ ++g;
+ ++b;
+ sycc_to_rgb(offset, upb, *ny, *cb, *cr, nr, ng, nb);
+ ++ny;
+ ++nr;
+ ++ng;
+ ++nb;
+ sycc_to_rgb(offset, upb, *ny, *cb, *cr, nr, ng, nb);
+ ++ny;
+ ++nr;
+ ++ng;
+ ++nb;
+ ++cb;
+ ++cr;
+ }
+ y += maxw;
+ r += maxw;
+ g += maxw;
+ b += maxw;
+ }
+ FX_Free(img->comps[0].data);
+ img->comps[0].data = d0;
+ FX_Free(img->comps[1].data);
+ img->comps[1].data = d1;
+ FX_Free(img->comps[2].data);
+ img->comps[2].data = d2;
+ img->comps[1].w = maxw;
+ img->comps[1].h = maxh;
+ img->comps[2].w = maxw;
+ img->comps[2].h = maxh;
+ img->comps[1].w = (OPJ_UINT32)maxw;
+ img->comps[1].h = (OPJ_UINT32)maxh;
+ img->comps[2].w = (OPJ_UINT32)maxw;
+ img->comps[2].h = (OPJ_UINT32)maxh;
+ img->comps[1].dx = img->comps[0].dx;
+ img->comps[2].dx = img->comps[0].dx;
+ img->comps[1].dy = img->comps[0].dy;
+ img->comps[2].dy = img->comps[0].dy;
+}
+void color_sycc_to_rgb(opj_image_t *img)
+{
+ if(img->numcomps < 3) {
+ img->color_space = OPJ_CLRSPC_GRAY;
+ return;
+ }
+ if((img->comps[0].dx == 1)
+ && (img->comps[1].dx == 2)
+ && (img->comps[2].dx == 2)
+ && (img->comps[0].dy == 1)
+ && (img->comps[1].dy == 2)
+ && (img->comps[2].dy == 2)) {
+ sycc420_to_rgb(img);
+ } else if((img->comps[0].dx == 1)
+ && (img->comps[1].dx == 2)
+ && (img->comps[2].dx == 2)
+ && (img->comps[0].dy == 1)
+ && (img->comps[1].dy == 1)
+ && (img->comps[2].dy == 1)) {
+ sycc422_to_rgb(img);
+ } else if((img->comps[0].dx == 1)
+ && (img->comps[1].dx == 1)
+ && (img->comps[2].dx == 1)
+ && (img->comps[0].dy == 1)
+ && (img->comps[1].dy == 1)
+ && (img->comps[2].dy == 1)) {
+ sycc444_to_rgb(img);
+ } else {
+ return;
+ }
+ img->color_space = OPJ_CLRSPC_SRGB;
+}
+void color_apply_icc_profile(opj_image_t *image)
+{
+ cmsHPROFILE in_prof, out_prof;
+ cmsHTRANSFORM transform;
+ cmsColorSpaceSignature in_space, out_space;
+ cmsUInt32Number intent, in_type, out_type, nr_samples;
+ int *r, *g, *b;
+ int prec, i, max, max_w, max_h;
+ OPJ_COLOR_SPACE oldspace;
+ in_prof =
+ cmsOpenProfileFromMem(image->icc_profile_buf, image->icc_profile_len);
+ if(in_prof == NULL) {
+ return;
+ }
+ in_space = cmsGetPCS(in_prof);
+ out_space = cmsGetColorSpace(in_prof);
+ intent = cmsGetHeaderRenderingIntent(in_prof);
+ max_w = (int)image->comps[0].w;
+ max_h = (int)image->comps[0].h;
+ prec = (int)image->comps[0].prec;
+ oldspace = image->color_space;
+ if(out_space == cmsSigRgbData) {
+ if( prec <= 8 ) {
+ in_type = TYPE_RGB_8;
+ out_type = TYPE_RGB_8;
+ } else {
+ in_type = TYPE_RGB_16;
+ out_type = TYPE_RGB_16;
+ }
+ out_prof = cmsCreate_sRGBProfile();
+ image->color_space = OPJ_CLRSPC_SRGB;
+ } else if(out_space == cmsSigGrayData) {
+ if( prec <= 8 ) {
+ in_type = TYPE_GRAY_8;
+ out_type = TYPE_RGB_8;
+ } else {
+ in_type = TYPE_GRAY_16;
+ out_type = TYPE_RGB_16;
+ }
+ out_prof = cmsCreate_sRGBProfile();
+ image->color_space = OPJ_CLRSPC_SRGB;
+ } else if(out_space == cmsSigYCbCrData) {
+ in_type = TYPE_YCbCr_16;
+ out_type = TYPE_RGB_16;
+ out_prof = cmsCreate_sRGBProfile();
+ image->color_space = OPJ_CLRSPC_SRGB;
+ } else {
+ return;
+ }
+ transform = cmsCreateTransform(in_prof, in_type,
+ out_prof, out_type, intent, 0);
+ cmsCloseProfile(in_prof);
+ cmsCloseProfile(out_prof);
+ if(transform == NULL) {
+ image->color_space = oldspace;
+ return;
+ }
+ if(image->numcomps > 2) {
+ if( prec <= 8 ) {
+ unsigned char *inbuf, *outbuf, *in, *out;
+ max = max_w * max_h;
+ nr_samples = (cmsUInt32Number)max * 3 * (cmsUInt32Number)sizeof(unsigned char);
+ in = inbuf = FX_Alloc(unsigned char, nr_samples);
+ out = outbuf = FX_Alloc(unsigned char, nr_samples);
+ r = image->comps[0].data;
+ g = image->comps[1].data;
+ b = image->comps[2].data;
+ for(i = 0; i < max; ++i) {
+ *in++ = (unsigned char) * r++;
+ *in++ = (unsigned char) * g++;
+ *in++ = (unsigned char) * b++;
+ }
+ cmsDoTransform(transform, inbuf, outbuf, (cmsUInt32Number)max);
+ r = image->comps[0].data;
+ g = image->comps[1].data;
+ b = image->comps[2].data;
+ for(i = 0; i < max; ++i) {
+ *r++ = (int) * out++;
+ *g++ = (int) * out++;
+ *b++ = (int) * out++;
+ }
+ FX_Free(inbuf);
+ FX_Free(outbuf);
+ } else {
+ unsigned short *inbuf, *outbuf, *in, *out;
+ max = max_w * max_h;
+ nr_samples = (cmsUInt32Number)max * 3 * (cmsUInt32Number)sizeof(unsigned short);
+ in = inbuf = FX_Alloc(unsigned short, nr_samples);
+ out = outbuf = FX_Alloc(unsigned short, nr_samples);
+ r = image->comps[0].data;
+ g = image->comps[1].data;
+ b = image->comps[2].data;
+ for(i = 0; i < max; ++i) {
+ *in++ = (unsigned short) * r++;
+ *in++ = (unsigned short) * g++;
+ *in++ = (unsigned short) * b++;
+ }
+ cmsDoTransform(transform, inbuf, outbuf, (cmsUInt32Number)max);
+ r = image->comps[0].data;
+ g = image->comps[1].data;
+ b = image->comps[2].data;
+ for(i = 0; i < max; ++i) {
+ *r++ = (int) * out++;
+ *g++ = (int) * out++;
+ *b++ = (int) * out++;
+ }
+ FX_Free(inbuf);
+ FX_Free(outbuf);
+ }
+ } else {
+ unsigned char *in, *inbuf, *out, *outbuf;
+ max = max_w * max_h;
+ nr_samples = (cmsUInt32Number)max * 3 * sizeof(unsigned char);
+ in = inbuf = FX_Alloc(unsigned char, nr_samples);
+ out = outbuf = FX_Alloc(unsigned char, nr_samples);
+ image->comps = (opj_image_comp_t*)
+ realloc(image->comps, (image->numcomps + 2) * sizeof(opj_image_comp_t));
+ if(image->numcomps == 2) {
+ image->comps[3] = image->comps[1];
+ }
+ image->comps[1] = image->comps[0];
+ image->comps[2] = image->comps[0];
+ image->comps[1].data = FX_Alloc(int, (size_t)max);
+ FXSYS_memset8(image->comps[1].data, 0, sizeof(int) * (size_t)max);
+ image->comps[2].data = FX_Alloc(int, (size_t)max);
+ FXSYS_memset8(image->comps[2].data, 0, sizeof(int) * (size_t)max);
+ image->numcomps += 2;
+ r = image->comps[0].data;
+ for(i = 0; i < max; ++i) {
+ *in++ = (unsigned char) * r++;
+ }
+ cmsDoTransform(transform, inbuf, outbuf, (cmsUInt32Number)max);
+ r = image->comps[0].data;
+ g = image->comps[1].data;
+ b = image->comps[2].data;
+ for(i = 0; i < max; ++i) {
+ *r++ = (int) * out++;
+ *g++ = (int) * out++;
+ *b++ = (int) * out++;
+ }
+ FX_Free(inbuf);
+ FX_Free(outbuf);
+ }
+ cmsDeleteTransform(transform);
+}
+void color_apply_conversion(opj_image_t *image)
+{
+ int *row;
+ int enumcs, numcomps;
+ numcomps = image->numcomps;
+ if(numcomps < 3) {
+ return;
+ }
+ row = (int*)image->icc_profile_buf;
+ enumcs = row[0];
+ if(enumcs == 14) {
+ int *L, *a, *b, *red, *green, *blue, *src0, *src1, *src2;
+ double rl, ol, ra, oa, rb, ob, prec0, prec1, prec2;
+ double minL, maxL, mina, maxa, minb, maxb;
+ unsigned int default_type, il;
+ unsigned int i, max, illu;
+ cmsHPROFILE in, out;
+ cmsHTRANSFORM transform;
+ cmsUInt16Number RGB[3];
+ cmsCIELab Lab;
+ illu = 0;
+ il = 0;
+ in = cmsCreateLab4Profile(NULL);
+ out = cmsCreate_sRGBProfile();
+ transform =
+ cmsCreateTransform(in, TYPE_Lab_DBL, out, TYPE_RGB_16,
+ INTENT_PERCEPTUAL, 0);
+ cmsCloseProfile(in);
+ cmsCloseProfile(out);
+ if(transform == NULL) {
+ return;
+ }
+ prec0 = (double)image->comps[0].prec;
+ prec1 = (double)image->comps[1].prec;
+ prec2 = (double)image->comps[2].prec;
+ default_type = row[1];
+ if(default_type == 0x44454600) {
+ rl = 100;
+ ra = 170;
+ rb = 200;
+ ol = 0;
+ oa = pow(2, prec1 - 1);
+ ob = pow(2, prec2 - 2) + pow(2, prec2 - 3);
+ } else {
+ rl = row[2];
+ ra = row[4];
+ rb = row[6];
+ ol = row[3];
+ oa = row[5];
+ ob = row[7];
+ }
+ L = src0 = image->comps[0].data;
+ a = src1 = image->comps[1].data;
+ b = src2 = image->comps[2].data;
+ max = image->comps[0].w * image->comps[0].h;
+ red = FX_Alloc(int, max);
+ image->comps[0].data = red;
+ green = FX_Alloc(int, max);
+ image->comps[1].data = green;
+ blue = FX_Alloc(int, max);
+ image->comps[2].data = blue;
+ minL = -(rl * ol) / (pow(2, prec0) - 1);
+ maxL = minL + rl;
+ mina = -(ra * oa) / (pow(2, prec1) - 1);
+ maxa = mina + ra;
+ minb = -(rb * ob) / (pow(2, prec2) - 1);
+ maxb = minb + rb;
+ for(i = 0; i < max; ++i) {
+ Lab.L = minL + (double)(*L) * (maxL - minL) / (pow(2, prec0) - 1);
+ ++L;
+ Lab.a = mina + (double)(*a) * (maxa - mina) / (pow(2, prec1) - 1);
+ ++a;
+ Lab.b = minb + (double)(*b) * (maxb - minb) / (pow(2, prec2) - 1);
+ ++b;
+ cmsDoTransform(transform, &Lab, RGB, 1);
+ *red++ = RGB[0];
+ *green++ = RGB[1];
+ *blue++ = RGB[2];
+ }
+ cmsDeleteTransform(transform);
+ FX_Free(src0);
+ FX_Free(src1);
+ FX_Free(src2);
+ image->color_space = OPJ_CLRSPC_SRGB;
+ image->comps[0].prec = 16;
+ image->comps[1].prec = 16;
+ image->comps[2].prec = 16;
+ return;
+ }
+}
+class CJPX_Decoder : public CFX_Object
+{
+public:
+ CJPX_Decoder();
+ ~CJPX_Decoder();
+ FX_BOOL Init(const unsigned char* src_data, int src_size);
+ void GetInfo(FX_DWORD& width, FX_DWORD& height, FX_DWORD& codestream_nComps, FX_DWORD& output_nComps);
+ FX_BOOL Decode(FX_LPBYTE dest_buf, int pitch, FX_BOOL bTranslateColor, FX_LPBYTE offsets);
+ FX_LPCBYTE m_SrcData;
+ int m_SrcSize;
+ opj_image_t *image;
+ opj_codec_t* l_codec;
+ opj_stream_t *l_stream;
+ FX_BOOL m_useColorSpace;
+};
+CJPX_Decoder::CJPX_Decoder(): image(NULL), l_codec(NULL), l_stream(NULL), m_useColorSpace(FALSE)
+{
+}
+CJPX_Decoder::~CJPX_Decoder()
+{
+ if(l_codec) {
+ opj_destroy_codec(l_codec);
+ }
+ if(l_stream) {
+ opj_stream_destroy(l_stream);
+ }
+ if(image) {
+ opj_image_destroy(image);
+ }
+}
+FX_BOOL CJPX_Decoder::Init(const unsigned char* src_data, int src_size)
+{
+ opj_dparameters_t parameters;
+ try {
+ image = NULL;
+ m_SrcData = src_data;
+ m_SrcSize = src_size;
+ decodeData srcData;
+ srcData.offset = 0;
+ srcData.src_size = src_size;
+ srcData.src_data = src_data;
+ l_stream = fx_opj_stream_create_memory_stream(&srcData, OPJ_J2K_STREAM_CHUNK_SIZE, 1);
+ if (l_stream == NULL) {
+ return FALSE;
+ }
+ opj_set_default_decoder_parameters(&parameters);
+ parameters.decod_format = 0;
+ parameters.cod_format = 3;
+ if(FXSYS_memcmp32(m_SrcData, "\x00\x00\x00\x0c\x6a\x50\x20\x20\x0d\x0a\x87\x0a", 12) == 0) {
+ l_codec = opj_create_decompress(OPJ_CODEC_JP2);
+ parameters.decod_format = 1;
+ } else {
+ l_codec = opj_create_decompress(OPJ_CODEC_J2K);
+ }
+ if(!l_codec) {
+ return FALSE;
+ }
+ opj_set_info_handler(l_codec, fx_info_callback, 00);
+ opj_set_warning_handler(l_codec, fx_warning_callback, 00);
+ opj_set_error_handler(l_codec, fx_error_callback, 00);
+ if ( !opj_setup_decoder(l_codec, &parameters) ) {
+ return FALSE;
+ }
+ if(! opj_read_header(l_stream, l_codec, &image)) {
+ image = NULL;
+ return FALSE;
+ }
+ if(this->m_useColorSpace) {
+ image->useColorSpace = 1;
+ } else {
+ image->useColorSpace = 0;
+ }
+ if (!parameters.nb_tile_to_decode) {
+ if (!opj_set_decode_area(l_codec, image, parameters.DA_x0,
+ parameters.DA_y0, parameters.DA_x1, parameters.DA_y1)) {
+ opj_image_destroy(image);
+ image = NULL;
+ return FALSE;
+ }
+ if (!(opj_decode(l_codec, l_stream, image) && opj_end_decompress(l_codec, l_stream))) {
+ opj_image_destroy(image);
+ image = NULL;
+ return FALSE;
+ }
+ } else {
+ if (!opj_get_decoded_tile(l_codec, l_stream, image, parameters.tile_index)) {
+ return FALSE;
+ }
+ }
+ opj_stream_destroy(l_stream);
+ l_stream = NULL;
+ if( image->color_space != OPJ_CLRSPC_SYCC
+ && image->numcomps == 3 && image->comps[0].dx == image->comps[0].dy
+ && image->comps[1].dx != 1 ) {
+ image->color_space = OPJ_CLRSPC_SYCC;
+ } else if (image->numcomps <= 2) {
+ image->color_space = OPJ_CLRSPC_GRAY;
+ }
+ if(image->color_space == OPJ_CLRSPC_SYCC) {
+ color_sycc_to_rgb(image);
+ }
+ if(image->icc_profile_buf && !image->useColorSpace) {
+ FX_Free(image->icc_profile_buf);
+ image->icc_profile_buf = NULL;
+ image->icc_profile_len = 0;
+ }
+ if(!image) {
+ return FALSE;
+ }
+ } catch (...) {
+ return FALSE;
+ }
+ return TRUE;
+}
+void CJPX_Decoder::GetInfo(FX_DWORD& width, FX_DWORD& height, FX_DWORD& codestream_nComps, FX_DWORD& output_nComps)
+{
+ width = (FX_DWORD)image->x1;
+ height = (FX_DWORD)image->y1;
+ output_nComps = codestream_nComps = (FX_DWORD)image->numcomps;
+}
+FX_BOOL CJPX_Decoder::Decode(FX_LPBYTE dest_buf, int pitch, FX_BOOL bTranslateColor, FX_LPBYTE offsets)
+{
+ FX_BYTE** channel_bufs;
+ int* adjust_comps;
+ int i, wid, hei, row, col, channel, src;
+ FX_BOOL flag;
+ FX_LPBYTE pChannel, pScanline, pPixel;
+ try {
+ if(image->comps[0].w != image->x1 || image->comps[0].h != image->y1) {
+ return FALSE;
+ }
+ if(pitch < (int)(image->comps[0].w * 8 * image->numcomps + 31) >> 5 << 2) {
+ return FALSE;
+ }
+ FXSYS_memset8(dest_buf, 0xff, image->y1 * pitch);
+ channel_bufs = FX_Alloc(FX_BYTE*, image->numcomps);
+ if (channel_bufs == NULL) {
+ return FALSE;
+ }
+ adjust_comps = FX_Alloc(int, image->numcomps);
+ if (adjust_comps == NULL) {
+ FX_Free(channel_bufs);
+ return FALSE;
+ }
+ flag = TRUE;
+ for (i = 0; i < (int)image->numcomps; i ++) {
+ channel_bufs[i] = dest_buf + offsets[i];
+ adjust_comps[i] = image->comps[i].prec - 8;
+ if(i > 0) {
+ if(image->comps[i].dx != image->comps[i - 1].dx
+ || image->comps[i].dy != image->comps[i - 1].dy
+ || image->comps[i].prec != image->comps[i - 1].prec) {
+ flag = FALSE;
+ goto failed;
+ }
+ }
+ }
+ wid = image->comps[0].w;
+ hei = image->comps[0].h;
+ for (channel = 0; channel < (int)image->numcomps; channel++) {
+ pChannel = channel_bufs[channel];
+ if(adjust_comps[channel] < 0) {
+ for(row = 0; row < hei; row++) {
+ pScanline = pChannel + row * pitch;
+ for (col = 0; col < wid; col++) {
+ pPixel = pScanline + col * image->numcomps;
+ src = image->comps[channel].data[row * wid + col];
+ src += image->comps[channel].sgnd ? 1 << (image->comps[channel].prec - 1) : 0;
+ if (adjust_comps[channel] > 0) {
+ *pPixel = 0;
+ } else {
+ *pPixel = (FX_BYTE)(src << -adjust_comps[channel]);
+ }
+ }
+ }
+ } else {
+ for(row = 0; row < hei; row++) {
+ pScanline = pChannel + row * pitch;
+ for (col = 0; col < wid; col++) {
+ pPixel = pScanline + col * image->numcomps;
+ if (!image->comps[channel].data) continue;
+ src = image->comps[channel].data[row * wid + col];
+ src += image->comps[channel].sgnd ? 1 << (image->comps[channel].prec - 1) : 0;
+ if (adjust_comps[channel] - 1 < 0) {
+ *pPixel = (FX_BYTE)((src >> adjust_comps[channel]));
+ } else {
+ int tmpPixel = (src >> adjust_comps[channel]) + ((src >> (adjust_comps[channel] - 1)) % 2);
+ if (tmpPixel > 255) {
+ tmpPixel = 255;
+ } else if (tmpPixel < 0) {
+ tmpPixel = 0;
+ }
+ *pPixel = (FX_BYTE)tmpPixel;
+ }
+ }
+ }
+ }
+ }
+ } catch (...) {
+ if (channel_bufs) {
+ FX_Free(channel_bufs);
+ }
+ FX_Free(adjust_comps);
+ return FALSE;
+ }
+ FX_Free(channel_bufs);
+ FX_Free(adjust_comps);
+ return TRUE;
+failed:
+ FX_Free(channel_bufs);
+ FX_Free(adjust_comps);
+ return FALSE;
+}
+void initialize_transition_table();
+void initialize_significance_luts();
+void initialize_sign_lut();
+CCodec_JpxModule::CCodec_JpxModule()
+{
+}
+void* CCodec_JpxModule::CreateDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size , FX_BOOL useColorSpace)
+{
+ CJPX_Decoder* pDecoder = FX_NEW CJPX_Decoder;
+ if (pDecoder == NULL) {
+ return NULL;
+ }
+ pDecoder->m_useColorSpace = useColorSpace;
+ if (!pDecoder->Init(src_buf, src_size)) {
+ delete pDecoder;
+ return NULL;
+ }
+ return pDecoder;
+}
+void CCodec_JpxModule::GetImageInfo(FX_LPVOID ctx, FX_DWORD& width, FX_DWORD& height,
+ FX_DWORD& codestream_nComps, FX_DWORD& output_nComps)
+{
+ CJPX_Decoder* pDecoder = (CJPX_Decoder*)ctx;
+ pDecoder->GetInfo(width, height, codestream_nComps, output_nComps);
+}
+FX_BOOL CCodec_JpxModule::Decode(void* ctx, FX_LPBYTE dest_data, int pitch, FX_BOOL bTranslateColor, FX_LPBYTE offsets)
+{
+ CJPX_Decoder* pDecoder = (CJPX_Decoder*)ctx;
+ return pDecoder->Decode(dest_data, pitch, bTranslateColor, offsets);
+}
+void CCodec_JpxModule::DestroyDecoder(void* ctx)
+{
+ CJPX_Decoder* pDecoder = (CJPX_Decoder*)ctx;
+ delete pDecoder;
+}
diff --git a/core/src/fxcodec/jbig2/JBig2_ArithDecoder.h b/core/src/fxcodec/jbig2/JBig2_ArithDecoder.h
index 1664257411..214688d3b2 100644
--- a/core/src/fxcodec/jbig2/JBig2_ArithDecoder.h
+++ b/core/src/fxcodec/jbig2/JBig2_ArithDecoder.h
@@ -1,126 +1,126 @@
-// 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 _JBIG2_ARITHMETIC_DECODER_H_
-#define _JBIG2_ARITHMETIC_DECODER_H_
-#include "JBig2_Define.h"
-#include "JBig2_BitStream.h"
-#include "JBig2_ArithQe.h"
-typedef struct {
- unsigned int MPS;
- unsigned int I;
-} JBig2ArithCtx;
-class CJBig2_ArithDecoder : public CJBig2_Object
-{
-public:
-
- CJBig2_ArithDecoder(CJBig2_BitStream *pStream);
-
- ~CJBig2_ArithDecoder();
-
- int DECODE(JBig2ArithCtx *pCX);
-private:
-
- void INITDEC();
-
- void BYTEIN();
- unsigned char B;
- unsigned int C;
- unsigned int A;
- unsigned int CT;
- CJBig2_BitStream *m_pStream;
-};
-inline CJBig2_ArithDecoder::CJBig2_ArithDecoder(CJBig2_BitStream *pStream)
-{
- m_pStream = pStream;
- INITDEC();
-}
-inline CJBig2_ArithDecoder::~CJBig2_ArithDecoder()
-{
-}
-inline void CJBig2_ArithDecoder::INITDEC()
-{
- B = m_pStream->getCurByte_arith();
- C = (B ^ 0xff) << 16;;
- BYTEIN();
- C = C << 7;
- CT = CT - 7;
- A = 0x8000;
-}
-inline void CJBig2_ArithDecoder::BYTEIN()
-{
- unsigned char B1;
- if(B == 0xff) {
- B1 = m_pStream->getNextByte_arith();
- if(B1 > 0x8f) {
- CT = 8;
- } else {
- m_pStream->incByteIdx();
- B = B1;
- C = C + 0xfe00 - (B << 9);
- CT = 7;
- }
- } else {
- m_pStream->incByteIdx();
- B = m_pStream->getCurByte_arith();
- C = C + 0xff00 - (B << 8);
- CT = 8;
- }
-}
-inline int CJBig2_ArithDecoder::DECODE(JBig2ArithCtx *pCX)
-{
- int D;
- const JBig2ArithQe * qe = &QeTable[pCX->I];
- A = A - qe->Qe;
- if((C >> 16) < A) {
- if(A & 0x8000) {
- D = pCX->MPS;
- } else {
- if(A < qe->Qe) {
- D = 1 - pCX->MPS;
- if(qe->nSwitch == 1) {
- pCX->MPS = 1 - pCX->MPS;
- }
- pCX->I = qe->NLPS;
- } else {
- D = pCX->MPS;
- pCX->I = qe->NMPS;
- }
- do {
- if (CT == 0) {
- BYTEIN();
- }
- A <<= 1;
- C <<= 1;
- CT--;
- } while ((A & 0x8000) == 0);
- }
- } else {
- C -= A << 16;
- if(A < qe->Qe) {
- A = qe->Qe;
- D = pCX->MPS;
- pCX->I = qe->NMPS;
- } else {
- A = qe->Qe;
- D = 1 - pCX->MPS;
- if(qe->nSwitch == 1) {
- pCX->MPS = 1 - pCX->MPS;
- }
- pCX->I = qe->NLPS;
- }
- do {
- if (CT == 0) {
- BYTEIN();
- }
- A <<= 1;
- C <<= 1;
- CT--;
- } while ((A & 0x8000) == 0);
- }
- return D;
-}
-#endif
+// 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 _JBIG2_ARITHMETIC_DECODER_H_
+#define _JBIG2_ARITHMETIC_DECODER_H_
+#include "JBig2_Define.h"
+#include "JBig2_BitStream.h"
+#include "JBig2_ArithQe.h"
+typedef struct {
+ unsigned int MPS;
+ unsigned int I;
+} JBig2ArithCtx;
+class CJBig2_ArithDecoder : public CJBig2_Object
+{
+public:
+
+ CJBig2_ArithDecoder(CJBig2_BitStream *pStream);
+
+ ~CJBig2_ArithDecoder();
+
+ int DECODE(JBig2ArithCtx *pCX);
+private:
+
+ void INITDEC();
+
+ void BYTEIN();
+ unsigned char B;
+ unsigned int C;
+ unsigned int A;
+ unsigned int CT;
+ CJBig2_BitStream *m_pStream;
+};
+inline CJBig2_ArithDecoder::CJBig2_ArithDecoder(CJBig2_BitStream *pStream)
+{
+ m_pStream = pStream;
+ INITDEC();
+}
+inline CJBig2_ArithDecoder::~CJBig2_ArithDecoder()
+{
+}
+inline void CJBig2_ArithDecoder::INITDEC()
+{
+ B = m_pStream->getCurByte_arith();
+ C = (B ^ 0xff) << 16;;
+ BYTEIN();
+ C = C << 7;
+ CT = CT - 7;
+ A = 0x8000;
+}
+inline void CJBig2_ArithDecoder::BYTEIN()
+{
+ unsigned char B1;
+ if(B == 0xff) {
+ B1 = m_pStream->getNextByte_arith();
+ if(B1 > 0x8f) {
+ CT = 8;
+ } else {
+ m_pStream->incByteIdx();
+ B = B1;
+ C = C + 0xfe00 - (B << 9);
+ CT = 7;
+ }
+ } else {
+ m_pStream->incByteIdx();
+ B = m_pStream->getCurByte_arith();
+ C = C + 0xff00 - (B << 8);
+ CT = 8;
+ }
+}
+inline int CJBig2_ArithDecoder::DECODE(JBig2ArithCtx *pCX)
+{
+ int D;
+ const JBig2ArithQe * qe = &QeTable[pCX->I];
+ A = A - qe->Qe;
+ if((C >> 16) < A) {
+ if(A & 0x8000) {
+ D = pCX->MPS;
+ } else {
+ if(A < qe->Qe) {
+ D = 1 - pCX->MPS;
+ if(qe->nSwitch == 1) {
+ pCX->MPS = 1 - pCX->MPS;
+ }
+ pCX->I = qe->NLPS;
+ } else {
+ D = pCX->MPS;
+ pCX->I = qe->NMPS;
+ }
+ do {
+ if (CT == 0) {
+ BYTEIN();
+ }
+ A <<= 1;
+ C <<= 1;
+ CT--;
+ } while ((A & 0x8000) == 0);
+ }
+ } else {
+ C -= A << 16;
+ if(A < qe->Qe) {
+ A = qe->Qe;
+ D = pCX->MPS;
+ pCX->I = qe->NMPS;
+ } else {
+ A = qe->Qe;
+ D = 1 - pCX->MPS;
+ if(qe->nSwitch == 1) {
+ pCX->MPS = 1 - pCX->MPS;
+ }
+ pCX->I = qe->NLPS;
+ }
+ do {
+ if (CT == 0) {
+ BYTEIN();
+ }
+ A <<= 1;
+ C <<= 1;
+ CT--;
+ } while ((A & 0x8000) == 0);
+ }
+ return D;
+}
+#endif
diff --git a/core/src/fxcodec/jbig2/JBig2_ArithIntDecoder.cpp b/core/src/fxcodec/jbig2/JBig2_ArithIntDecoder.cpp
index bb4e0bba9f..1e115848a3 100644
--- a/core/src/fxcodec/jbig2/JBig2_ArithIntDecoder.cpp
+++ b/core/src/fxcodec/jbig2/JBig2_ArithIntDecoder.cpp
@@ -1,105 +1,105 @@
-// 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
-
-#include "JBig2_ArithIntDecoder.h"
-CJBig2_ArithIntDecoder::CJBig2_ArithIntDecoder()
-{
- IAx = (JBig2ArithCtx*)m_pModule->JBig2_Malloc2(sizeof(JBig2ArithCtx), 512);
- JBIG2_memset(IAx, 0, sizeof(JBig2ArithCtx) * 512);
-}
-CJBig2_ArithIntDecoder::~CJBig2_ArithIntDecoder()
-{
- m_pModule->JBig2_Free(IAx);
-}
-int CJBig2_ArithIntDecoder::decode(CJBig2_ArithDecoder *pArithDecoder, int *nResult)
-{
- int PREV, V;
- int S, D;
- int nNeedBits, nTemp, i;
- PREV = 1;
- S = pArithDecoder->DECODE(IAx + PREV);
- PREV = (PREV << 1) | S;
- D = pArithDecoder->DECODE(IAx + PREV);
- PREV = (PREV << 1) | D;
- if(D) {
- D = pArithDecoder->DECODE(IAx + PREV);
- PREV = (PREV << 1) | D;
- if(D) {
- D = pArithDecoder->DECODE(IAx + PREV);
- PREV = (PREV << 1) | D;
- if(D) {
- D = pArithDecoder->DECODE(IAx + PREV);
- PREV = (PREV << 1) | D;
- if(D) {
- D = pArithDecoder->DECODE(IAx + PREV);
- PREV = (PREV << 1) | D;
- if(D) {
- nNeedBits = 32;
- V = 4436;
- } else {
- nNeedBits = 12;
- V = 340;
- }
- } else {
- nNeedBits = 8;
- V = 84;
- }
- } else {
- nNeedBits = 6;
- V = 20;
- }
- } else {
- nNeedBits = 4;
- V = 4;
- }
- } else {
- nNeedBits = 2;
- V = 0;
- }
- nTemp = 0;
- for(i = 0; i < nNeedBits; i++) {
- D = pArithDecoder->DECODE(IAx + PREV);
- if(PREV < 256) {
- PREV = (PREV << 1) | D;
- } else {
- PREV = (((PREV << 1) | D) & 511) | 256;
- }
- nTemp = (nTemp << 1) | D;
- }
- V += nTemp;
- if(S == 1 && V > 0) {
- V = -V;
- }
- *nResult = V;
- if(S == 1 && V == 0) {
- return JBIG2_OOB;
- }
- return 0;
-}
-CJBig2_ArithIaidDecoder::CJBig2_ArithIaidDecoder(unsigned char SBSYMCODELENA)
-{
- SBSYMCODELEN = SBSYMCODELENA;
- IAID = (JBig2ArithCtx*)m_pModule->JBig2_Malloc2(sizeof(JBig2ArithCtx), (1 << SBSYMCODELEN));
- JBIG2_memset(IAID, 0, sizeof(JBig2ArithCtx) * (int)(1 << SBSYMCODELEN));
-}
-CJBig2_ArithIaidDecoder::~CJBig2_ArithIaidDecoder()
-{
- m_pModule->JBig2_Free(IAID);
-}
-int CJBig2_ArithIaidDecoder::decode(CJBig2_ArithDecoder *pArithDecoder, int *nResult)
-{
- int PREV;
- int D;
- int i;
- PREV = 1;
- for(i = 0; i < SBSYMCODELEN; i++) {
- D = pArithDecoder->DECODE(IAID + PREV);
- PREV = (PREV << 1) | D;
- }
- PREV = PREV - (1 << SBSYMCODELEN);
- *nResult = PREV;
- return 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
+
+#include "JBig2_ArithIntDecoder.h"
+CJBig2_ArithIntDecoder::CJBig2_ArithIntDecoder()
+{
+ IAx = (JBig2ArithCtx*)m_pModule->JBig2_Malloc2(sizeof(JBig2ArithCtx), 512);
+ JBIG2_memset(IAx, 0, sizeof(JBig2ArithCtx) * 512);
+}
+CJBig2_ArithIntDecoder::~CJBig2_ArithIntDecoder()
+{
+ m_pModule->JBig2_Free(IAx);
+}
+int CJBig2_ArithIntDecoder::decode(CJBig2_ArithDecoder *pArithDecoder, int *nResult)
+{
+ int PREV, V;
+ int S, D;
+ int nNeedBits, nTemp, i;
+ PREV = 1;
+ S = pArithDecoder->DECODE(IAx + PREV);
+ PREV = (PREV << 1) | S;
+ D = pArithDecoder->DECODE(IAx + PREV);
+ PREV = (PREV << 1) | D;
+ if(D) {
+ D = pArithDecoder->DECODE(IAx + PREV);
+ PREV = (PREV << 1) | D;
+ if(D) {
+ D = pArithDecoder->DECODE(IAx + PREV);
+ PREV = (PREV << 1) | D;
+ if(D) {
+ D = pArithDecoder->DECODE(IAx + PREV);
+ PREV = (PREV << 1) | D;
+ if(D) {
+ D = pArithDecoder->DECODE(IAx + PREV);
+ PREV = (PREV << 1) | D;
+ if(D) {
+ nNeedBits = 32;
+ V = 4436;
+ } else {
+ nNeedBits = 12;
+ V = 340;
+ }
+ } else {
+ nNeedBits = 8;
+ V = 84;
+ }
+ } else {
+ nNeedBits = 6;
+ V = 20;
+ }
+ } else {
+ nNeedBits = 4;
+ V = 4;
+ }
+ } else {
+ nNeedBits = 2;
+ V = 0;
+ }
+ nTemp = 0;
+ for(i = 0; i < nNeedBits; i++) {
+ D = pArithDecoder->DECODE(IAx + PREV);
+ if(PREV < 256) {
+ PREV = (PREV << 1) | D;
+ } else {
+ PREV = (((PREV << 1) | D) & 511) | 256;
+ }
+ nTemp = (nTemp << 1) | D;
+ }
+ V += nTemp;
+ if(S == 1 && V > 0) {
+ V = -V;
+ }
+ *nResult = V;
+ if(S == 1 && V == 0) {
+ return JBIG2_OOB;
+ }
+ return 0;
+}
+CJBig2_ArithIaidDecoder::CJBig2_ArithIaidDecoder(unsigned char SBSYMCODELENA)
+{
+ SBSYMCODELEN = SBSYMCODELENA;
+ IAID = (JBig2ArithCtx*)m_pModule->JBig2_Malloc2(sizeof(JBig2ArithCtx), (1 << SBSYMCODELEN));
+ JBIG2_memset(IAID, 0, sizeof(JBig2ArithCtx) * (int)(1 << SBSYMCODELEN));
+}
+CJBig2_ArithIaidDecoder::~CJBig2_ArithIaidDecoder()
+{
+ m_pModule->JBig2_Free(IAID);
+}
+int CJBig2_ArithIaidDecoder::decode(CJBig2_ArithDecoder *pArithDecoder, int *nResult)
+{
+ int PREV;
+ int D;
+ int i;
+ PREV = 1;
+ for(i = 0; i < SBSYMCODELEN; i++) {
+ D = pArithDecoder->DECODE(IAID + PREV);
+ PREV = (PREV << 1) | D;
+ }
+ PREV = PREV - (1 << SBSYMCODELEN);
+ *nResult = PREV;
+ return 0;
+}
diff --git a/core/src/fxcodec/jbig2/JBig2_ArithIntDecoder.h b/core/src/fxcodec/jbig2/JBig2_ArithIntDecoder.h
index ad4656f54d..4ea104cf65 100644
--- a/core/src/fxcodec/jbig2/JBig2_ArithIntDecoder.h
+++ b/core/src/fxcodec/jbig2/JBig2_ArithIntDecoder.h
@@ -1,39 +1,39 @@
-// 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 _JBIG2_ARITH_INT_DECODER_H_
-#define _JBIG2_ARITH_INT_DECODER_H_
-#include "JBig2_Module.h"
-#include "JBig2_ArithDecoder.h"
-class CJBig2_ArithIntDecoder : public CJBig2_Object
-{
-public:
-
- CJBig2_ArithIntDecoder();
-
- ~CJBig2_ArithIntDecoder();
-
- int decode(CJBig2_ArithDecoder *pArithDecoder, int *nResult);
-private:
-
- JBig2ArithCtx *IAx;
-};
-class CJBig2_ArithIaidDecoder : public CJBig2_Object
-{
-public:
-
- CJBig2_ArithIaidDecoder(unsigned char SBSYMCODELENA);
-
- ~CJBig2_ArithIaidDecoder();
-
- int decode(CJBig2_ArithDecoder *pArithDecoder, int *nResult);
-private:
-
- JBig2ArithCtx *IAID;
-
- unsigned char SBSYMCODELEN;
-};
-#endif
+// 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 _JBIG2_ARITH_INT_DECODER_H_
+#define _JBIG2_ARITH_INT_DECODER_H_
+#include "JBig2_Module.h"
+#include "JBig2_ArithDecoder.h"
+class CJBig2_ArithIntDecoder : public CJBig2_Object
+{
+public:
+
+ CJBig2_ArithIntDecoder();
+
+ ~CJBig2_ArithIntDecoder();
+
+ int decode(CJBig2_ArithDecoder *pArithDecoder, int *nResult);
+private:
+
+ JBig2ArithCtx *IAx;
+};
+class CJBig2_ArithIaidDecoder : public CJBig2_Object
+{
+public:
+
+ CJBig2_ArithIaidDecoder(unsigned char SBSYMCODELENA);
+
+ ~CJBig2_ArithIaidDecoder();
+
+ int decode(CJBig2_ArithDecoder *pArithDecoder, int *nResult);
+private:
+
+ JBig2ArithCtx *IAID;
+
+ unsigned char SBSYMCODELEN;
+};
+#endif
diff --git a/core/src/fxcodec/jbig2/JBig2_ArithQe.h b/core/src/fxcodec/jbig2/JBig2_ArithQe.h
index 17bc18aa03..60fbbc9ac3 100644
--- a/core/src/fxcodec/jbig2/JBig2_ArithQe.h
+++ b/core/src/fxcodec/jbig2/JBig2_ArithQe.h
@@ -1,64 +1,64 @@
-// 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 _JBIG2_ARITH_QE_H_
-#define _JBIG2_ARITH_QE_H_
-typedef struct {
- unsigned int Qe;
- unsigned int NMPS;
- unsigned int NLPS;
- unsigned int nSwitch;
-} JBig2ArithQe;
-const JBig2ArithQe QeTable[] = {
- { 0x5601, 1, 1, 1 },
- { 0x3401, 2, 6, 0 },
- { 0x1801, 3, 9, 0 },
- { 0x0AC1, 4, 12, 0 },
- { 0x0521, 5, 29, 0 },
- { 0x0221, 38, 33, 0 },
- { 0x5601, 7, 6, 1 },
- { 0x5401, 8, 14, 0 },
- { 0x4801, 9, 14, 0 },
- { 0x3801, 10, 14, 0 },
- { 0x3001, 11, 17, 0 },
- { 0x2401, 12, 18, 0 },
- { 0x1C01, 13, 20, 0 },
- { 0x1601, 29, 21, 0 },
- { 0x5601, 15, 14, 1 },
- { 0x5401, 16, 14, 0 },
- { 0x5101, 17, 15, 0 },
- { 0x4801, 18, 16, 0 },
- { 0x3801, 19, 17, 0 },
- { 0x3401, 20, 18, 0 },
- { 0x3001, 21, 19, 0 },
- { 0x2801, 22, 19, 0 },
- { 0x2401, 23, 20, 0 },
- { 0x2201, 24, 21, 0 },
- { 0x1C01, 25, 22, 0 },
- { 0x1801, 26, 23, 0 },
- { 0x1601, 27, 24, 0 },
- { 0x1401, 28, 25, 0 },
- { 0x1201, 29, 26, 0 },
- { 0x1101, 30, 27, 0 },
- { 0x0AC1, 31, 28, 0 },
- { 0x09C1, 32, 29, 0 },
- { 0x08A1, 33, 30, 0 },
- { 0x0521, 34, 31, 0 },
- { 0x0441, 35, 32, 0 },
- { 0x02A1, 36, 33, 0 },
- { 0x0221, 37, 34, 0 },
- { 0x0141, 38, 35, 0 },
- { 0x0111, 39, 36, 0 },
- { 0x0085, 40, 37, 0 },
- { 0x0049, 41, 38, 0 },
- { 0x0025, 42, 39, 0 },
- { 0x0015, 43, 40, 0 },
- { 0x0009, 44, 41, 0 },
- { 0x0005, 45, 42, 0 },
- { 0x0001, 45, 43, 0 },
- { 0x5601, 46, 46, 0 }
-};
-#endif
+// 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 _JBIG2_ARITH_QE_H_
+#define _JBIG2_ARITH_QE_H_
+typedef struct {
+ unsigned int Qe;
+ unsigned int NMPS;
+ unsigned int NLPS;
+ unsigned int nSwitch;
+} JBig2ArithQe;
+const JBig2ArithQe QeTable[] = {
+ { 0x5601, 1, 1, 1 },
+ { 0x3401, 2, 6, 0 },
+ { 0x1801, 3, 9, 0 },
+ { 0x0AC1, 4, 12, 0 },
+ { 0x0521, 5, 29, 0 },
+ { 0x0221, 38, 33, 0 },
+ { 0x5601, 7, 6, 1 },
+ { 0x5401, 8, 14, 0 },
+ { 0x4801, 9, 14, 0 },
+ { 0x3801, 10, 14, 0 },
+ { 0x3001, 11, 17, 0 },
+ { 0x2401, 12, 18, 0 },
+ { 0x1C01, 13, 20, 0 },
+ { 0x1601, 29, 21, 0 },
+ { 0x5601, 15, 14, 1 },
+ { 0x5401, 16, 14, 0 },
+ { 0x5101, 17, 15, 0 },
+ { 0x4801, 18, 16, 0 },
+ { 0x3801, 19, 17, 0 },
+ { 0x3401, 20, 18, 0 },
+ { 0x3001, 21, 19, 0 },
+ { 0x2801, 22, 19, 0 },
+ { 0x2401, 23, 20, 0 },
+ { 0x2201, 24, 21, 0 },
+ { 0x1C01, 25, 22, 0 },
+ { 0x1801, 26, 23, 0 },
+ { 0x1601, 27, 24, 0 },
+ { 0x1401, 28, 25, 0 },
+ { 0x1201, 29, 26, 0 },
+ { 0x1101, 30, 27, 0 },
+ { 0x0AC1, 31, 28, 0 },
+ { 0x09C1, 32, 29, 0 },
+ { 0x08A1, 33, 30, 0 },
+ { 0x0521, 34, 31, 0 },
+ { 0x0441, 35, 32, 0 },
+ { 0x02A1, 36, 33, 0 },
+ { 0x0221, 37, 34, 0 },
+ { 0x0141, 38, 35, 0 },
+ { 0x0111, 39, 36, 0 },
+ { 0x0085, 40, 37, 0 },
+ { 0x0049, 41, 38, 0 },
+ { 0x0025, 42, 39, 0 },
+ { 0x0015, 43, 40, 0 },
+ { 0x0009, 44, 41, 0 },
+ { 0x0005, 45, 42, 0 },
+ { 0x0001, 45, 43, 0 },
+ { 0x5601, 46, 46, 0 }
+};
+#endif
diff --git a/core/src/fxcodec/jbig2/JBig2_BitStream.h b/core/src/fxcodec/jbig2/JBig2_BitStream.h
index 8ed473a150..9d5d29468f 100644
--- a/core/src/fxcodec/jbig2/JBig2_BitStream.h
+++ b/core/src/fxcodec/jbig2/JBig2_BitStream.h
@@ -1,316 +1,316 @@
-// 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 _JBIG2_BIT_STREAM_H_
-#define _JBIG2_BIT_STREAM_H_
-#include "JBig2_Define.h"
-class CJBig2_BitStream : public CJBig2_Object
-{
-public:
-
- CJBig2_BitStream(FX_BYTE *pBuffer, FX_DWORD dwLength);
-
- CJBig2_BitStream(CJBig2_BitStream &bs);
-
- ~CJBig2_BitStream();
-
- FX_INT32 readNBits(FX_DWORD nBits, FX_DWORD *dwResult);
-
- FX_INT32 readNBits(FX_DWORD nBits, FX_INT32 *nResult);
-
- FX_INT32 read1Bit(FX_DWORD *dwResult);
-
- FX_INT32 read1Bit(FX_BOOL *bResult);
-
- FX_INT32 read1Byte(FX_BYTE *cResult);
-
- FX_INT32 readInteger(FX_DWORD *dwResult);
-
- FX_INT32 readShortInteger(FX_WORD *wResult);
-
- void alignByte();
-
- void align4Byte();
-
- FX_BYTE getAt(FX_DWORD dwOffset);
-
- FX_BYTE getCurByte();
-
- FX_BYTE getNextByte();
-
- FX_INT32 incByteIdx();
-
- FX_BYTE getCurByte_arith();
-
- FX_BYTE getNextByte_arith();
-
- FX_DWORD getOffset();
-
- void setOffset(FX_DWORD dwOffset);
-
- FX_DWORD getBitPos();
-
- void setBitPos(FX_DWORD dwBitPos);
-
- FX_BYTE *getBuf();
-
- FX_DWORD getLength()
- {
- return m_dwLength;
- }
-
- FX_BYTE *getPointer();
-
- void offset(FX_DWORD dwOffset);
-
- FX_DWORD getByteLeft();
-private:
-
- FX_BYTE *m_pBuf;
-
- FX_DWORD m_dwLength;
-
- FX_DWORD m_dwByteIdx;
-
- FX_DWORD m_dwBitIdx;
-};
-inline CJBig2_BitStream::CJBig2_BitStream(FX_BYTE *pBuffer, FX_DWORD dwLength)
-{
- m_pBuf = pBuffer;
- m_dwLength = dwLength;
- m_dwByteIdx = 0;
- m_dwBitIdx = 0;
- if (m_dwLength > 256 * 1024 * 1024) {
- m_dwLength = 0;
- m_pBuf = NULL;
- }
-}
-inline CJBig2_BitStream::CJBig2_BitStream(CJBig2_BitStream &bs)
-{
- m_pBuf = bs.m_pBuf;
- m_dwLength = bs.m_dwLength;
- m_dwByteIdx = bs.m_dwByteIdx;
- m_dwBitIdx = bs.m_dwBitIdx;
-}
-inline CJBig2_BitStream::~CJBig2_BitStream()
-{
-}
-inline FX_INT32 CJBig2_BitStream::readNBits(FX_DWORD dwBits, FX_DWORD *dwResult)
-{
- FX_DWORD dwTemp = (m_dwByteIdx << 3) + m_dwBitIdx;
- if(dwTemp <= (m_dwLength << 3)) {
- *dwResult = 0;
- if(dwTemp + dwBits <= (m_dwLength << 3)) {
- dwTemp = dwBits;
- } else {
- dwTemp = (m_dwLength << 3) - dwTemp;
- }
- while(dwTemp > 0) {
- *dwResult = (*dwResult << 1) | ((m_pBuf[m_dwByteIdx] >> (7 - m_dwBitIdx)) & 0x01);
- if(m_dwBitIdx == 7) {
- m_dwByteIdx ++;
- m_dwBitIdx = 0;
- } else {
- m_dwBitIdx ++;
- }
- dwTemp --;
- }
- return 0;
- } else {
- return -1;
- }
-}
-inline FX_INT32 CJBig2_BitStream::readNBits(FX_DWORD dwBits, FX_INT32 *nResult)
-{
- FX_DWORD dwTemp = (m_dwByteIdx << 3) + m_dwBitIdx;
- if(dwTemp <= (m_dwLength << 3)) {
- *nResult = 0;
- if(dwTemp + dwBits <= (m_dwLength << 3)) {
- dwTemp = dwBits;
- } else {
- dwTemp = (m_dwLength << 3) - dwTemp;
- }
- while(dwTemp > 0) {
- *nResult = (*nResult << 1) | ((m_pBuf[m_dwByteIdx] >> (7 - m_dwBitIdx)) & 0x01);
- if(m_dwBitIdx == 7) {
- m_dwByteIdx ++;
- m_dwBitIdx = 0;
- } else {
- m_dwBitIdx ++;
- }
- dwTemp --;
- }
- return 0;
- } else {
- return -1;
- }
-}
-
-inline FX_INT32 CJBig2_BitStream::read1Bit(FX_DWORD *dwResult)
-{
- if(m_dwByteIdx < m_dwLength) {
- *dwResult = (m_pBuf[m_dwByteIdx] >> (7 - m_dwBitIdx)) & 0x01;
- if(m_dwBitIdx == 7) {
- m_dwByteIdx ++;
- m_dwBitIdx = 0;
- } else {
- m_dwBitIdx ++;
- }
- return 0;
- } else {
- return -1;
- }
-}
-
-inline FX_INT32 CJBig2_BitStream::read1Bit(FX_BOOL *bResult)
-{
- if(m_dwByteIdx < m_dwLength) {
- *bResult = (m_pBuf[m_dwByteIdx] >> (7 - m_dwBitIdx)) & 0x01;
- if(m_dwBitIdx == 7) {
- m_dwByteIdx ++;
- m_dwBitIdx = 0;
- } else {
- m_dwBitIdx ++;
- }
- return 0;
- } else {
- return -1;
- }
-}
-inline FX_INT32 CJBig2_BitStream::read1Byte(FX_BYTE *cResult)
-{
- if(m_dwByteIdx < m_dwLength) {
- *cResult = m_pBuf[m_dwByteIdx];
- m_dwByteIdx ++;
- return 0;
- } else {
- return -1;
- }
-}
-
-inline FX_INT32 CJBig2_BitStream::readInteger(FX_DWORD *dwResult)
-{
- if(m_dwByteIdx + 3 < m_dwLength) {
- *dwResult = (m_pBuf[m_dwByteIdx] << 24) | (m_pBuf[m_dwByteIdx + 1] << 16)
- | (m_pBuf[m_dwByteIdx + 2] << 8) | m_pBuf[m_dwByteIdx + 3];
- m_dwByteIdx += 4;
- return 0;
- } else {
- return -1;
- }
-}
-
-inline FX_INT32 CJBig2_BitStream::readShortInteger(FX_WORD *dwResult)
-{
- if(m_dwByteIdx + 1 < m_dwLength) {
- *dwResult = (m_pBuf[m_dwByteIdx] << 8) | m_pBuf[m_dwByteIdx + 1];
- m_dwByteIdx += 2;
- return 0;
- } else {
- return -1;
- }
-}
-inline void CJBig2_BitStream::alignByte()
-{
- if(m_dwBitIdx != 0) {
- m_dwByteIdx ++;
- m_dwBitIdx = 0;
- }
-}
-inline void CJBig2_BitStream::align4Byte()
-{
- if(m_dwBitIdx != 0) {
- m_dwByteIdx ++;
- m_dwBitIdx = 0;
- }
- m_dwByteIdx = (m_dwByteIdx + 3) & -4;
-}
-inline FX_BYTE CJBig2_BitStream::getAt(FX_DWORD dwOffset)
-{
- if(dwOffset < m_dwLength) {
- return m_pBuf[dwOffset];
- } else {
- return 0;
- }
-}
-inline FX_BYTE CJBig2_BitStream::getCurByte()
-{
- if(m_dwByteIdx < m_dwLength) {
- return m_pBuf[m_dwByteIdx];
- } else {
- return 0;
- }
-}
-inline FX_BYTE CJBig2_BitStream::getNextByte()
-{
- if(m_dwByteIdx + 1 < m_dwLength) {
- return m_pBuf[m_dwByteIdx + 1];
- } else {
- return 0;
- }
-}
-inline FX_INT32 CJBig2_BitStream::incByteIdx()
-{
- if(m_dwByteIdx < m_dwLength) {
- m_dwByteIdx ++;
- return 0;
- } else {
- return -1;
- }
-}
-inline FX_BYTE CJBig2_BitStream::getCurByte_arith()
-{
- if(m_dwByteIdx < m_dwLength) {
- return m_pBuf[m_dwByteIdx];
- } else {
- return 0xff;
- }
-}
-inline FX_BYTE CJBig2_BitStream::getNextByte_arith()
-{
- if(m_dwByteIdx + 1 < m_dwLength) {
- return m_pBuf[m_dwByteIdx + 1];
- } else {
- return 0xff;
- }
-}
-inline FX_DWORD CJBig2_BitStream::getOffset()
-{
- return m_dwByteIdx;
-}
-inline void CJBig2_BitStream::setOffset(FX_DWORD dwOffset)
-{
- if (dwOffset > m_dwLength) {
- dwOffset = m_dwLength;
- }
- m_dwByteIdx = dwOffset;
-}
-inline FX_DWORD CJBig2_BitStream::getBitPos()
-{
- return (m_dwByteIdx << 3) + m_dwBitIdx;
-}
-inline void CJBig2_BitStream::setBitPos(FX_DWORD dwBitPos)
-{
- m_dwByteIdx = dwBitPos >> 3;
- m_dwBitIdx = dwBitPos & 7;
-}
-inline FX_BYTE *CJBig2_BitStream::getBuf()
-{
- return m_pBuf;
-}
-inline FX_BYTE *CJBig2_BitStream::getPointer()
-{
- return m_pBuf + m_dwByteIdx;
-}
-inline void CJBig2_BitStream::offset(FX_DWORD dwOffset)
-{
- m_dwByteIdx += dwOffset;
-}
-inline FX_DWORD CJBig2_BitStream::getByteLeft()
-{
- return m_dwLength - m_dwByteIdx;
-}
-#endif
+// 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 _JBIG2_BIT_STREAM_H_
+#define _JBIG2_BIT_STREAM_H_
+#include "JBig2_Define.h"
+class CJBig2_BitStream : public CJBig2_Object
+{
+public:
+
+ CJBig2_BitStream(FX_BYTE *pBuffer, FX_DWORD dwLength);
+
+ CJBig2_BitStream(CJBig2_BitStream &bs);
+
+ ~CJBig2_BitStream();
+
+ FX_INT32 readNBits(FX_DWORD nBits, FX_DWORD *dwResult);
+
+ FX_INT32 readNBits(FX_DWORD nBits, FX_INT32 *nResult);
+
+ FX_INT32 read1Bit(FX_DWORD *dwResult);
+
+ FX_INT32 read1Bit(FX_BOOL *bResult);
+
+ FX_INT32 read1Byte(FX_BYTE *cResult);
+
+ FX_INT32 readInteger(FX_DWORD *dwResult);
+
+ FX_INT32 readShortInteger(FX_WORD *wResult);
+
+ void alignByte();
+
+ void align4Byte();
+
+ FX_BYTE getAt(FX_DWORD dwOffset);
+
+ FX_BYTE getCurByte();
+
+ FX_BYTE getNextByte();
+
+ FX_INT32 incByteIdx();
+
+ FX_BYTE getCurByte_arith();
+
+ FX_BYTE getNextByte_arith();
+
+ FX_DWORD getOffset();
+
+ void setOffset(FX_DWORD dwOffset);
+
+ FX_DWORD getBitPos();
+
+ void setBitPos(FX_DWORD dwBitPos);
+
+ FX_BYTE *getBuf();
+
+ FX_DWORD getLength()
+ {
+ return m_dwLength;
+ }
+
+ FX_BYTE *getPointer();
+
+ void offset(FX_DWORD dwOffset);
+
+ FX_DWORD getByteLeft();
+private:
+
+ FX_BYTE *m_pBuf;
+
+ FX_DWORD m_dwLength;
+
+ FX_DWORD m_dwByteIdx;
+
+ FX_DWORD m_dwBitIdx;
+};
+inline CJBig2_BitStream::CJBig2_BitStream(FX_BYTE *pBuffer, FX_DWORD dwLength)
+{
+ m_pBuf = pBuffer;
+ m_dwLength = dwLength;
+ m_dwByteIdx = 0;
+ m_dwBitIdx = 0;
+ if (m_dwLength > 256 * 1024 * 1024) {
+ m_dwLength = 0;
+ m_pBuf = NULL;
+ }
+}
+inline CJBig2_BitStream::CJBig2_BitStream(CJBig2_BitStream &bs)
+{
+ m_pBuf = bs.m_pBuf;
+ m_dwLength = bs.m_dwLength;
+ m_dwByteIdx = bs.m_dwByteIdx;
+ m_dwBitIdx = bs.m_dwBitIdx;
+}
+inline CJBig2_BitStream::~CJBig2_BitStream()
+{
+}
+inline FX_INT32 CJBig2_BitStream::readNBits(FX_DWORD dwBits, FX_DWORD *dwResult)
+{
+ FX_DWORD dwTemp = (m_dwByteIdx << 3) + m_dwBitIdx;
+ if(dwTemp <= (m_dwLength << 3)) {
+ *dwResult = 0;
+ if(dwTemp + dwBits <= (m_dwLength << 3)) {
+ dwTemp = dwBits;
+ } else {
+ dwTemp = (m_dwLength << 3) - dwTemp;
+ }
+ while(dwTemp > 0) {
+ *dwResult = (*dwResult << 1) | ((m_pBuf[m_dwByteIdx] >> (7 - m_dwBitIdx)) & 0x01);
+ if(m_dwBitIdx == 7) {
+ m_dwByteIdx ++;
+ m_dwBitIdx = 0;
+ } else {
+ m_dwBitIdx ++;
+ }
+ dwTemp --;
+ }
+ return 0;
+ } else {
+ return -1;
+ }
+}
+inline FX_INT32 CJBig2_BitStream::readNBits(FX_DWORD dwBits, FX_INT32 *nResult)
+{
+ FX_DWORD dwTemp = (m_dwByteIdx << 3) + m_dwBitIdx;
+ if(dwTemp <= (m_dwLength << 3)) {
+ *nResult = 0;
+ if(dwTemp + dwBits <= (m_dwLength << 3)) {
+ dwTemp = dwBits;
+ } else {
+ dwTemp = (m_dwLength << 3) - dwTemp;
+ }
+ while(dwTemp > 0) {
+ *nResult = (*nResult << 1) | ((m_pBuf[m_dwByteIdx] >> (7 - m_dwBitIdx)) & 0x01);
+ if(m_dwBitIdx == 7) {
+ m_dwByteIdx ++;
+ m_dwBitIdx = 0;
+ } else {
+ m_dwBitIdx ++;
+ }
+ dwTemp --;
+ }
+ return 0;
+ } else {
+ return -1;
+ }
+}
+
+inline FX_INT32 CJBig2_BitStream::read1Bit(FX_DWORD *dwResult)
+{
+ if(m_dwByteIdx < m_dwLength) {
+ *dwResult = (m_pBuf[m_dwByteIdx] >> (7 - m_dwBitIdx)) & 0x01;
+ if(m_dwBitIdx == 7) {
+ m_dwByteIdx ++;
+ m_dwBitIdx = 0;
+ } else {
+ m_dwBitIdx ++;
+ }
+ return 0;
+ } else {
+ return -1;
+ }
+}
+
+inline FX_INT32 CJBig2_BitStream::read1Bit(FX_BOOL *bResult)
+{
+ if(m_dwByteIdx < m_dwLength) {
+ *bResult = (m_pBuf[m_dwByteIdx] >> (7 - m_dwBitIdx)) & 0x01;
+ if(m_dwBitIdx == 7) {
+ m_dwByteIdx ++;
+ m_dwBitIdx = 0;
+ } else {
+ m_dwBitIdx ++;
+ }
+ return 0;
+ } else {
+ return -1;
+ }
+}
+inline FX_INT32 CJBig2_BitStream::read1Byte(FX_BYTE *cResult)
+{
+ if(m_dwByteIdx < m_dwLength) {
+ *cResult = m_pBuf[m_dwByteIdx];
+ m_dwByteIdx ++;
+ return 0;
+ } else {
+ return -1;
+ }
+}
+
+inline FX_INT32 CJBig2_BitStream::readInteger(FX_DWORD *dwResult)
+{
+ if(m_dwByteIdx + 3 < m_dwLength) {
+ *dwResult = (m_pBuf[m_dwByteIdx] << 24) | (m_pBuf[m_dwByteIdx + 1] << 16)
+ | (m_pBuf[m_dwByteIdx + 2] << 8) | m_pBuf[m_dwByteIdx + 3];
+ m_dwByteIdx += 4;
+ return 0;
+ } else {
+ return -1;
+ }
+}
+
+inline FX_INT32 CJBig2_BitStream::readShortInteger(FX_WORD *dwResult)
+{
+ if(m_dwByteIdx + 1 < m_dwLength) {
+ *dwResult = (m_pBuf[m_dwByteIdx] << 8) | m_pBuf[m_dwByteIdx + 1];
+ m_dwByteIdx += 2;
+ return 0;
+ } else {
+ return -1;
+ }
+}
+inline void CJBig2_BitStream::alignByte()
+{
+ if(m_dwBitIdx != 0) {
+ m_dwByteIdx ++;
+ m_dwBitIdx = 0;
+ }
+}
+inline void CJBig2_BitStream::align4Byte()
+{
+ if(m_dwBitIdx != 0) {
+ m_dwByteIdx ++;
+ m_dwBitIdx = 0;
+ }
+ m_dwByteIdx = (m_dwByteIdx + 3) & -4;
+}
+inline FX_BYTE CJBig2_BitStream::getAt(FX_DWORD dwOffset)
+{
+ if(dwOffset < m_dwLength) {
+ return m_pBuf[dwOffset];
+ } else {
+ return 0;
+ }
+}
+inline FX_BYTE CJBig2_BitStream::getCurByte()
+{
+ if(m_dwByteIdx < m_dwLength) {
+ return m_pBuf[m_dwByteIdx];
+ } else {
+ return 0;
+ }
+}
+inline FX_BYTE CJBig2_BitStream::getNextByte()
+{
+ if(m_dwByteIdx + 1 < m_dwLength) {
+ return m_pBuf[m_dwByteIdx + 1];
+ } else {
+ return 0;
+ }
+}
+inline FX_INT32 CJBig2_BitStream::incByteIdx()
+{
+ if(m_dwByteIdx < m_dwLength) {
+ m_dwByteIdx ++;
+ return 0;
+ } else {
+ return -1;
+ }
+}
+inline FX_BYTE CJBig2_BitStream::getCurByte_arith()
+{
+ if(m_dwByteIdx < m_dwLength) {
+ return m_pBuf[m_dwByteIdx];
+ } else {
+ return 0xff;
+ }
+}
+inline FX_BYTE CJBig2_BitStream::getNextByte_arith()
+{
+ if(m_dwByteIdx + 1 < m_dwLength) {
+ return m_pBuf[m_dwByteIdx + 1];
+ } else {
+ return 0xff;
+ }
+}
+inline FX_DWORD CJBig2_BitStream::getOffset()
+{
+ return m_dwByteIdx;
+}
+inline void CJBig2_BitStream::setOffset(FX_DWORD dwOffset)
+{
+ if (dwOffset > m_dwLength) {
+ dwOffset = m_dwLength;
+ }
+ m_dwByteIdx = dwOffset;
+}
+inline FX_DWORD CJBig2_BitStream::getBitPos()
+{
+ return (m_dwByteIdx << 3) + m_dwBitIdx;
+}
+inline void CJBig2_BitStream::setBitPos(FX_DWORD dwBitPos)
+{
+ m_dwByteIdx = dwBitPos >> 3;
+ m_dwBitIdx = dwBitPos & 7;
+}
+inline FX_BYTE *CJBig2_BitStream::getBuf()
+{
+ return m_pBuf;
+}
+inline FX_BYTE *CJBig2_BitStream::getPointer()
+{
+ return m_pBuf + m_dwByteIdx;
+}
+inline void CJBig2_BitStream::offset(FX_DWORD dwOffset)
+{
+ m_dwByteIdx += dwOffset;
+}
+inline FX_DWORD CJBig2_BitStream::getByteLeft()
+{
+ return m_dwLength - m_dwByteIdx;
+}
+#endif
diff --git a/core/src/fxcodec/jbig2/JBig2_Context.cpp b/core/src/fxcodec/jbig2/JBig2_Context.cpp
index 856c0c3bda..543f9abf63 100644
--- a/core/src/fxcodec/jbig2/JBig2_Context.cpp
+++ b/core/src/fxcodec/jbig2/JBig2_Context.cpp
@@ -1,1812 +1,1812 @@
-// 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
-
-#include "JBig2_Context.h"
-void OutputBitmap(CJBig2_Image* pImage)
-{
- if(!pImage) {
- return;
- }
-}
-CJBig2_Context *CJBig2_Context::CreateContext(CJBig2_Module *pModule, FX_BYTE *pGlobalData, FX_DWORD dwGlobalLength,
- FX_BYTE *pData, FX_DWORD dwLength, FX_INT32 nStreamType, IFX_Pause* pPause)
-{
- return new(pModule) CJBig2_Context(pGlobalData, dwGlobalLength, pData, dwLength, nStreamType, pPause);
-}
-void CJBig2_Context::DestroyContext(CJBig2_Context *pContext)
-{
- if(pContext) {
- delete pContext;
- }
-}
-CJBig2_Context::CJBig2_Context(FX_BYTE *pGlobalData, FX_DWORD dwGlobalLength,
- FX_BYTE *pData, FX_DWORD dwLength, FX_INT32 nStreamType, IFX_Pause* pPause)
-{
- if(pGlobalData && (dwGlobalLength > 0)) {
- JBIG2_ALLOC(m_pGlobalContext, CJBig2_Context(NULL, 0, pGlobalData, dwGlobalLength,
- JBIG2_EMBED_STREAM, pPause));
- } else {
- m_pGlobalContext = NULL;
- }
- JBIG2_ALLOC(m_pStream, CJBig2_BitStream(pData, dwLength));
- m_nStreamType = nStreamType;
- m_nState = JBIG2_OUT_OF_PAGE;
- JBIG2_ALLOC(m_pSegmentList, CJBig2_List<CJBig2_Segment>);
- JBIG2_ALLOC(m_pPageInfoList, CJBig2_List<JBig2PageInfo>(1));
- m_pPage = NULL;
- m_bBufSpecified = FALSE;
- m_pPause = pPause;
- m_nSegmentDecoded = 0;
- m_PauseStep = 10;
- m_pArithDecoder = NULL;
- m_pGRD = NULL;
- m_gbContext = NULL;
- m_pSegment = NULL;
- m_dwOffset = 0;
- m_ProcessiveStatus = FXCODEC_STATUS_FRAME_READY;
-}
-CJBig2_Context::~CJBig2_Context()
-{
- if(m_pArithDecoder) {
- delete m_pArithDecoder;
- }
- m_pArithDecoder = NULL;
- if(m_pGRD) {
- delete m_pGRD;
- }
- m_pGRD = NULL;
- if(m_gbContext) {
- delete m_gbContext;
- }
- m_gbContext = NULL;
- if(m_pGlobalContext) {
- delete m_pGlobalContext;
- }
- m_pGlobalContext = NULL;
- if(m_pPageInfoList) {
- delete m_pPageInfoList;
- }
- m_pPageInfoList = NULL;
- if(m_bBufSpecified && m_pPage) {
- delete m_pPage;
- }
- m_pPage = NULL;
- if(m_pStream) {
- delete m_pStream;
- }
- m_pStream = NULL;
- if(m_pSegmentList) {
- delete m_pSegmentList;
- }
- m_pSegmentList = NULL;
-}
-FX_INT32 CJBig2_Context::decodeFile(IFX_Pause* pPause)
-{
- FX_BYTE cFlags;
- FX_DWORD dwTemp;
- const FX_BYTE fileID[] = {0x97, 0x4A, 0x42, 0x32, 0x0D, 0x0A, 0x1A, 0x0A};
- FX_INT32 nRet;
- if(m_pStream->getByteLeft() < 8) {
- m_pModule->JBig2_Error("file header too short.");
- nRet = JBIG2_ERROR_TOO_SHORT;
- goto failed;
- }
- if(JBIG2_memcmp(m_pStream->getPointer(), fileID, 8) != 0) {
- m_pModule->JBig2_Error("not jbig2 file");
- nRet = JBIG2_ERROR_FILE_FORMAT;
- goto failed;
- }
- m_pStream->offset(8);
- if(m_pStream->read1Byte(&cFlags) != 0) {
- m_pModule->JBig2_Error("file header too short.");
- nRet = JBIG2_ERROR_TOO_SHORT;
- goto failed;
- }
- if(!(cFlags & 0x02)) {
- if(m_pStream->readInteger(&dwTemp) != 0) {
- m_pModule->JBig2_Error("file header too short.");
- nRet = JBIG2_ERROR_TOO_SHORT;
- goto failed;
- }
- if(dwTemp > 0) {
- delete m_pPageInfoList;
- JBIG2_ALLOC(m_pPageInfoList, CJBig2_List<JBig2PageInfo>(dwTemp));
- }
- }
- if(cFlags & 0x01) {
- m_nStreamType = JBIG2_SQUENTIAL_STREAM;
- return decode_SquentialOrgnazation(pPause);
- } else {
- m_nStreamType = JBIG2_RANDOM_STREAM;
- return decode_RandomOrgnazation_FirstPage(pPause);
- }
-failed:
- return nRet;
-}
-FX_INT32 CJBig2_Context::decode_SquentialOrgnazation(IFX_Pause* pPause)
-{
- FX_INT32 nRet;
- if(m_pStream->getByteLeft() > 0) {
- while(m_pStream->getByteLeft() >= JBIG2_MIN_SEGMENT_SIZE) {
- if(m_pSegment == NULL) {
- JBIG2_ALLOC(m_pSegment, CJBig2_Segment());
- nRet = parseSegmentHeader(m_pSegment);
- if(nRet != JBIG2_SUCCESS) {
- delete m_pSegment;
- m_pSegment = NULL;
- return nRet;
- }
- m_dwOffset = m_pStream->getOffset();
- }
- nRet = parseSegmentData(m_pSegment, pPause);
- if(m_ProcessiveStatus == FXCODEC_STATUS_DECODE_TOBECONTINUE) {
- m_ProcessiveStatus = FXCODEC_STATUS_DECODE_TOBECONTINUE;
- m_PauseStep = 2;
- return JBIG2_SUCCESS;
- }
- if((nRet == JBIG2_END_OF_PAGE) || (nRet == JBIG2_END_OF_FILE)) {
- delete m_pSegment;
- m_pSegment = NULL;
- break;
- } else if(nRet != JBIG2_SUCCESS) {
- delete m_pSegment;
- m_pSegment = NULL;
- return nRet;
- }
- m_pSegmentList->addItem(m_pSegment);
- if(m_pSegment->m_dwData_length != 0xffffffff) {
- m_dwOffset = m_dwOffset + m_pSegment->m_dwData_length;
- m_pStream->setOffset(m_dwOffset);
- } else {
- m_pStream->offset(4);
- }
- OutputBitmap(m_pPage);
- m_pSegment = NULL;
- if(m_pStream->getByteLeft() > 0 && m_pPage && pPause && pPause->NeedToPauseNow()) {
- m_ProcessiveStatus = FXCODEC_STATUS_DECODE_TOBECONTINUE;
- m_PauseStep = 2;
- return JBIG2_SUCCESS;
- }
- }
- } else {
- return JBIG2_END_OF_FILE;
- }
- return JBIG2_SUCCESS;
-}
-FX_INT32 CJBig2_Context::decode_EmbedOrgnazation(IFX_Pause* pPause)
-{
- return decode_SquentialOrgnazation(pPause);
-}
-FX_INT32 CJBig2_Context::decode_RandomOrgnazation_FirstPage(IFX_Pause* pPause)
-{
- CJBig2_Segment *pSegment;
- FX_INT32 nRet;
- while(m_pStream->getByteLeft() > JBIG2_MIN_SEGMENT_SIZE) {
- JBIG2_ALLOC(pSegment, CJBig2_Segment());
- nRet = parseSegmentHeader(pSegment);
- if(nRet != JBIG2_SUCCESS) {
- delete pSegment;
- return nRet;
- } else if(pSegment->m_cFlags.s.type == 51) {
- delete pSegment;
- break;
- }
- m_pSegmentList->addItem(pSegment);
- if(pPause && m_pPause && pPause->NeedToPauseNow()) {
- m_PauseStep = 3;
- m_ProcessiveStatus = FXCODEC_STATUS_DECODE_TOBECONTINUE;
- return JBIG2_SUCCESS;
- }
- }
- m_nSegmentDecoded = 0;
- return decode_RandomOrgnazation(pPause);
-}
-FX_INT32 CJBig2_Context::decode_RandomOrgnazation(IFX_Pause* pPause)
-{
- FX_INT32 nRet;
- for(; m_nSegmentDecoded < m_pSegmentList->getLength(); m_nSegmentDecoded++) {
- nRet = parseSegmentData(m_pSegmentList->getAt(m_nSegmentDecoded), pPause);
- if((nRet == JBIG2_END_OF_PAGE) || (nRet == JBIG2_END_OF_FILE)) {
- break;
- } else if(nRet != JBIG2_SUCCESS) {
- return nRet;
- }
- if(m_pPage && pPause && pPause->NeedToPauseNow()) {
- m_PauseStep = 4;
- m_ProcessiveStatus = FXCODEC_STATUS_DECODE_TOBECONTINUE;
- return JBIG2_SUCCESS;
- }
- }
- return JBIG2_SUCCESS;
-}
-FX_INT32 CJBig2_Context::getFirstPage(FX_BYTE *pBuf, FX_INT32 width, FX_INT32 height, FX_INT32 stride, IFX_Pause* pPause)
-{
- FX_INT32 nRet = 0;
- if(m_pGlobalContext) {
- nRet = m_pGlobalContext->decode_EmbedOrgnazation(pPause);
- if(nRet != JBIG2_SUCCESS) {
- m_ProcessiveStatus = FXCODEC_STATUS_ERROR;
- return nRet;
- }
- }
- m_bFirstPage = TRUE;
- m_PauseStep = 0;
- if(m_pPage) {
- delete m_pPage;
- }
- JBIG2_ALLOC(m_pPage, CJBig2_Image(width, height, stride, pBuf));
- m_bBufSpecified = TRUE;
- if(m_pPage && pPause && pPause->NeedToPauseNow()) {
- m_PauseStep = 1;
- m_ProcessiveStatus = FXCODEC_STATUS_DECODE_TOBECONTINUE;
- return nRet;
- }
- int ret = Continue(pPause);
- return ret;
-}
-FX_INT32 CJBig2_Context::Continue(IFX_Pause* pPause)
-{
- m_ProcessiveStatus = FXCODEC_STATUS_DECODE_READY;
- FX_INT32 nRet;
- if(m_PauseStep <= 1) {
- switch(m_nStreamType) {
- case JBIG2_FILE_STREAM:
- nRet = decodeFile(pPause);
- break;
- case JBIG2_SQUENTIAL_STREAM:
- nRet = decode_SquentialOrgnazation(pPause);
- break;
- case JBIG2_RANDOM_STREAM:
- if(m_bFirstPage) {
- nRet = decode_RandomOrgnazation_FirstPage(pPause);
- } else {
- nRet = decode_RandomOrgnazation(pPause);
- }
- break;
- case JBIG2_EMBED_STREAM:
- nRet = decode_EmbedOrgnazation(pPause);
- break;
- default:
- m_ProcessiveStatus = FXCODEC_STATUS_ERROR;
- return JBIG2_ERROR_STREAM_TYPE;
- }
- } else if(m_PauseStep == 2) {
- nRet = decode_SquentialOrgnazation(pPause);
- } else if(m_PauseStep == 3) {
- nRet = decode_RandomOrgnazation_FirstPage(pPause);
- } else if(m_PauseStep == 4) {
- nRet = decode_RandomOrgnazation(pPause);
- } else if(m_PauseStep == 5) {
- m_ProcessiveStatus = FXCODEC_STATUS_DECODE_FINISH;
- return JBIG2_SUCCESS;
- }
- if(m_ProcessiveStatus == FXCODEC_STATUS_DECODE_TOBECONTINUE) {
- return nRet;
- }
- m_PauseStep = 5;
- if(!m_bBufSpecified && nRet == JBIG2_SUCCESS) {
- m_ProcessiveStatus = FXCODEC_STATUS_DECODE_FINISH;
- return JBIG2_SUCCESS;
- }
- if(nRet == JBIG2_SUCCESS) {
- m_ProcessiveStatus = FXCODEC_STATUS_DECODE_FINISH;
- } else {
- m_ProcessiveStatus = FXCODEC_STATUS_ERROR;
- }
- return nRet;
-}
-FX_INT32 CJBig2_Context::getNextPage(FX_BYTE *pBuf, FX_INT32 width, FX_INT32 height, FX_INT32 stride, IFX_Pause* pPause)
-{
- FX_INT32 nRet = JBIG2_ERROR_STREAM_TYPE;
- m_bFirstPage = FALSE;
- m_PauseStep = 0;
- if(m_pPage) {
- delete m_pPage;
- }
- JBIG2_ALLOC(m_pPage, CJBig2_Image(width, height, stride, pBuf));
- m_bBufSpecified = TRUE;
- if(m_pPage && pPause && pPause->NeedToPauseNow()) {
- m_PauseStep = 1;
- m_ProcessiveStatus = FXCODEC_STATUS_DECODE_TOBECONTINUE;
- return nRet;
- }
- return Continue(pPause);
- switch(m_nStreamType) {
- case JBIG2_FILE_STREAM:
- nRet = decodeFile(pPause);
- break;
- case JBIG2_SQUENTIAL_STREAM:
- nRet = decode_SquentialOrgnazation(pPause);
- break;
- case JBIG2_RANDOM_STREAM:
- nRet = decode_RandomOrgnazation(pPause);
- break;
- case JBIG2_EMBED_STREAM:
- nRet = decode_EmbedOrgnazation(pPause);
- break;
- default:
- return JBIG2_ERROR_STREAM_TYPE;
- }
- return nRet;
-}
-FX_INT32 CJBig2_Context::getFirstPage(CJBig2_Image **image, IFX_Pause* pPause)
-{
- FX_INT32 nRet;
- m_bFirstPage = TRUE;
- m_PauseStep = 0;
- if(m_pGlobalContext) {
- nRet = m_pGlobalContext->decode_EmbedOrgnazation(pPause);
- if(nRet != JBIG2_SUCCESS) {
- return nRet;
- }
- }
- m_bBufSpecified = FALSE;
- return Continue(pPause);
-}
-FX_INT32 CJBig2_Context::getNextPage(CJBig2_Image **image, IFX_Pause* pPause)
-{
- FX_INT32 nRet;
- m_bBufSpecified = FALSE;
- m_bFirstPage = FALSE;
- m_PauseStep = 0;
- switch(m_nStreamType) {
- case JBIG2_FILE_STREAM:
- nRet = decodeFile(pPause);
- break;
- case JBIG2_SQUENTIAL_STREAM:
- nRet = decode_SquentialOrgnazation(pPause);
- break;
- case JBIG2_RANDOM_STREAM:
- nRet = decode_RandomOrgnazation(pPause);
- break;
- case JBIG2_EMBED_STREAM:
- nRet = decode_EmbedOrgnazation(pPause);
- break;
- default:
- return JBIG2_ERROR_STREAM_TYPE;
- }
- if(nRet == JBIG2_SUCCESS) {
- *image = m_pPage;
- m_pPage = NULL;
- return JBIG2_SUCCESS;
- }
- return nRet;
-}
-CJBig2_Segment *CJBig2_Context::findSegmentByNumber(FX_DWORD dwNumber)
-{
- CJBig2_Segment *pSeg;
- FX_INT32 i;
- if(m_pGlobalContext) {
- pSeg = m_pGlobalContext->findSegmentByNumber(dwNumber);
- if(pSeg) {
- return pSeg;
- }
- }
- for(i = 0; i < m_pSegmentList->getLength(); i++) {
- pSeg = m_pSegmentList->getAt(i);
- if(pSeg->m_dwNumber == dwNumber) {
- return pSeg;
- }
- }
- return NULL;
-}
-CJBig2_Segment *CJBig2_Context::findReferredSegmentByTypeAndIndex(CJBig2_Segment *pSegment,
- FX_BYTE cType, FX_INT32 nIndex)
-{
- CJBig2_Segment *pSeg;
- FX_INT32 i, count;
- count = 0;
- for(i = 0; i < pSegment->m_nReferred_to_segment_count; i++) {
- pSeg = findSegmentByNumber(pSegment->m_pReferred_to_segment_numbers[i]);
- if(pSeg && pSeg->m_cFlags.s.type == cType) {
- if(count == nIndex) {
- return pSeg;
- } else {
- count ++;
- }
- }
- }
- return NULL;
-}
-FX_INT32 CJBig2_Context::parseSegmentHeader(CJBig2_Segment *pSegment)
-{
- FX_BYTE cSSize, cPSize;
- FX_BYTE cTemp;
- FX_WORD wTemp;
- FX_DWORD dwTemp;
- if((m_pStream->readInteger(&pSegment->m_dwNumber) != 0)
- || (m_pStream->read1Byte(&pSegment->m_cFlags.c) != 0)) {
- goto failed;
- }
- cTemp = m_pStream->getCurByte();
- if((cTemp >> 5) == 7) {
- if(m_pStream->readInteger((FX_DWORD*)&pSegment->m_nReferred_to_segment_count) != 0) {
- goto failed;
- }
- pSegment->m_nReferred_to_segment_count &= 0x1fffffff;
- if (pSegment->m_nReferred_to_segment_count > JBIG2_MAX_REFERRED_SEGMENT_COUNT) {
- m_pModule->JBig2_Error("Too many referred segments.");
- return JBIG2_ERROR_LIMIT;
- }
- dwTemp = 5 + 4 + (pSegment->m_nReferred_to_segment_count + 1) / 8;
- } else {
- if(m_pStream->read1Byte(&cTemp) != 0) {
- goto failed;
- }
- pSegment->m_nReferred_to_segment_count = cTemp >> 5;
- dwTemp = 5 + 1;
- }
- cSSize = pSegment->m_dwNumber > 65536 ? 4 : pSegment->m_dwNumber > 256 ? 2 : 1;
- cPSize = pSegment->m_cFlags.s.page_association_size ? 4 : 1;
- if(pSegment->m_nReferred_to_segment_count) {
- pSegment->m_pReferred_to_segment_numbers = (FX_DWORD*)m_pModule->JBig2_Malloc2(
- sizeof(FX_DWORD), pSegment->m_nReferred_to_segment_count);
- for(FX_INT32 i = 0; i < pSegment->m_nReferred_to_segment_count; i++) {
- switch(cSSize) {
- case 1:
- if(m_pStream->read1Byte(&cTemp) != 0) {
- goto failed;
- }
- pSegment->m_pReferred_to_segment_numbers[i] = cTemp;
- break;
- case 2:
- if(m_pStream->readShortInteger(&wTemp) != 0) {
- goto failed;
- }
- pSegment->m_pReferred_to_segment_numbers[i] = wTemp;
- break;
- case 4:
- if(m_pStream->readInteger(&dwTemp) != 0) {
- goto failed;
- }
- pSegment->m_pReferred_to_segment_numbers[i] = dwTemp;
- break;
- }
- if (pSegment->m_pReferred_to_segment_numbers[i] >= pSegment->m_dwNumber) {
- m_pModule->JBig2_Error("The referred segment number is greater than this segment number.");
- goto failed;
- }
- }
- }
- if(cPSize == 1) {
- if(m_pStream->read1Byte(&cTemp) != 0) {
- goto failed;
- }
- pSegment->m_dwPage_association = cTemp;
- } else {
- if(m_pStream->readInteger(&pSegment->m_dwPage_association) != 0) {
- goto failed;
- }
- }
- if(m_pStream->readInteger(&pSegment->m_dwData_length) != 0) {
- goto failed;
- }
- pSegment->m_pData = m_pStream->getPointer();
- pSegment->m_State = JBIG2_SEGMENT_DATA_UNPARSED;
- return JBIG2_SUCCESS;
-failed:
- m_pModule->JBig2_Error("header too short.");
- return JBIG2_ERROR_TOO_SHORT;
-}
-FX_INT32 CJBig2_Context::parseSegmentData(CJBig2_Segment *pSegment, IFX_Pause* pPause)
-{
- FX_INT32 ret = ProcessiveParseSegmentData(pSegment, pPause);
- while(m_ProcessiveStatus == FXCODEC_STATUS_DECODE_TOBECONTINUE && m_pStream->getByteLeft() > 0) {
- ret = ProcessiveParseSegmentData(pSegment, pPause);
- }
- return ret;
-}
-FX_INT32 CJBig2_Context::ProcessiveParseSegmentData(CJBig2_Segment *pSegment, IFX_Pause* pPause)
-{
- switch(pSegment->m_cFlags.s.type) {
- case 0:
- return parseSymbolDict(pSegment, pPause);
- case 4:
- case 6:
- case 7:
- if(m_nState == JBIG2_OUT_OF_PAGE) {
- goto failed2;
- } else {
- return parseTextRegion(pSegment);
- }
- case 16:
- return parsePatternDict(pSegment, pPause);
- case 20:
- case 22:
- case 23:
- if(m_nState == JBIG2_OUT_OF_PAGE) {
- goto failed2;
- } else {
- return parseHalftoneRegion(pSegment, pPause);
- }
- case 36:
- case 38:
- case 39:
- if(m_nState == JBIG2_OUT_OF_PAGE) {
- goto failed2;
- } else {
- return parseGenericRegion(pSegment, pPause);
- }
- case 40:
- case 42:
- case 43:
- if(m_nState == JBIG2_OUT_OF_PAGE) {
- goto failed2;
- } else {
- return parseGenericRefinementRegion(pSegment);
- }
- case 48: {
- FX_WORD wTemp;
- JBig2PageInfo *pPageInfo;
- JBIG2_ALLOC(pPageInfo, JBig2PageInfo);
- if((m_pStream->readInteger(&pPageInfo->m_dwWidth) != 0)
- || (m_pStream->readInteger(&pPageInfo->m_dwHeight) != 0)
- || (m_pStream->readInteger(&pPageInfo->m_dwResolutionX) != 0)
- || (m_pStream->readInteger(&pPageInfo->m_dwResolutionY) != 0)
- || (m_pStream->read1Byte(&pPageInfo->m_cFlags) != 0)
- || (m_pStream->readShortInteger(&wTemp) != 0)) {
- delete pPageInfo;
- goto failed1;
- }
- pPageInfo->m_bIsStriped = ((wTemp >> 15) & 1) ? 1 : 0;
- pPageInfo->m_wMaxStripeSize = wTemp & 0x7fff;
- if((pPageInfo->m_dwHeight == 0xffffffff) && (pPageInfo->m_bIsStriped != 1)) {
- m_pModule->JBig2_Warn("page height = 0xffffffff buf stripe field is 0");
- pPageInfo->m_bIsStriped = 1;
- }
- if(!m_bBufSpecified) {
- if(m_pPage) {
- delete m_pPage;
- }
- if(pPageInfo->m_dwHeight == 0xffffffff) {
- JBIG2_ALLOC(m_pPage, CJBig2_Image(pPageInfo->m_dwWidth, pPageInfo->m_wMaxStripeSize));
- } else {
- JBIG2_ALLOC(m_pPage, CJBig2_Image(pPageInfo->m_dwWidth, pPageInfo->m_dwHeight));
- }
- }
- m_pPage->fill((pPageInfo->m_cFlags & 4) ? 1 : 0);
- m_pPageInfoList->addItem(pPageInfo);
- m_nState = JBIG2_IN_PAGE;
- }
- break;
- case 49:
- m_nState = JBIG2_OUT_OF_PAGE;
- return JBIG2_END_OF_PAGE;
- break;
- case 50:
- m_pStream->offset(pSegment->m_dwData_length);
- break;
- case 51:
- return JBIG2_END_OF_FILE;
- case 52:
- m_pStream->offset(pSegment->m_dwData_length);
- break;
- case 53:
- return parseTable(pSegment);
- case 62:
- m_pStream->offset(pSegment->m_dwData_length);
- break;
- default:
- break;
- }
- return JBIG2_SUCCESS;
-failed1:
- m_pModule->JBig2_Error("segment data too short.");
- return JBIG2_ERROR_TOO_SHORT;
-failed2:
- m_pModule->JBig2_Error("segment syntax error.");
- return JBIG2_ERROR_FETAL;
-}
-FX_INT32 CJBig2_Context::parseSymbolDict(CJBig2_Segment *pSegment, IFX_Pause* pPause)
-{
- FX_DWORD dwTemp;
- FX_WORD wFlags;
- FX_BYTE cSDHUFFDH, cSDHUFFDW, cSDHUFFBMSIZE, cSDHUFFAGGINST;
- CJBig2_HuffmanTable *Table_B1 = NULL, *Table_B2 = NULL, *Table_B3 = NULL, *Table_B4 = NULL, *Table_B5 = NULL;
- FX_INT32 i, nIndex, nRet;
- CJBig2_Segment *pSeg = NULL, *pLRSeg = NULL;
- FX_BOOL bUsed;
- CJBig2_Image ** SDINSYMS = NULL;
- CJBig2_SDDProc *pSymbolDictDecoder;
- JBig2ArithCtx *gbContext = NULL, *grContext = NULL;
- CJBig2_ArithDecoder *pArithDecoder;
- JBIG2_ALLOC(pSymbolDictDecoder, CJBig2_SDDProc());
- if(m_pStream->readShortInteger(&wFlags) != 0) {
- m_pModule->JBig2_Error("symbol dictionary segment : data header too short.");
- nRet = JBIG2_ERROR_TOO_SHORT;
- goto failed;
- }
- pSymbolDictDecoder->SDHUFF = wFlags & 0x0001;
- pSymbolDictDecoder->SDREFAGG = (wFlags >> 1) & 0x0001;
- pSymbolDictDecoder->SDTEMPLATE = (wFlags >> 10) & 0x0003;
- pSymbolDictDecoder->SDRTEMPLATE = (wFlags >> 12) & 0x0003;
- cSDHUFFDH = (wFlags >> 2) & 0x0003;
- cSDHUFFDW = (wFlags >> 4) & 0x0003;
- cSDHUFFBMSIZE = (wFlags >> 6) & 0x0001;
- cSDHUFFAGGINST = (wFlags >> 7) & 0x0001;
- if(pSymbolDictDecoder->SDHUFF == 0) {
- if(pSymbolDictDecoder->SDTEMPLATE == 0) {
- dwTemp = 8;
- } else {
- dwTemp = 2;
- }
- for(i = 0; i < (FX_INT32)dwTemp; i++) {
- if(m_pStream->read1Byte((FX_BYTE*)&pSymbolDictDecoder->SDAT[i]) != 0) {
- m_pModule->JBig2_Error("symbol dictionary segment : data header too short.");
- nRet = JBIG2_ERROR_TOO_SHORT;
- goto failed;
- }
- }
- }
- if((pSymbolDictDecoder->SDREFAGG == 1) && (pSymbolDictDecoder->SDRTEMPLATE == 0)) {
- for(i = 0; i < 4; i++) {
- if(m_pStream->read1Byte((FX_BYTE*)&pSymbolDictDecoder->SDRAT[i]) != 0) {
- m_pModule->JBig2_Error("symbol dictionary segment : data header too short.");
- nRet = JBIG2_ERROR_TOO_SHORT;
- goto failed;
- }
- }
- }
- if((m_pStream->readInteger(&pSymbolDictDecoder->SDNUMEXSYMS) != 0)
- || (m_pStream->readInteger(&pSymbolDictDecoder->SDNUMNEWSYMS) != 0)) {
- m_pModule->JBig2_Error("symbol dictionary segment : data header too short.");
- nRet = JBIG2_ERROR_TOO_SHORT;
- goto failed;
- }
- if (pSymbolDictDecoder->SDNUMEXSYMS > JBIG2_MAX_EXPORT_SYSMBOLS
- || pSymbolDictDecoder->SDNUMNEWSYMS > JBIG2_MAX_NEW_SYSMBOLS) {
- m_pModule->JBig2_Error("symbol dictionary segment : too many export/new symbols.");
- nRet = JBIG2_ERROR_LIMIT;
- goto failed;
- }
- for(i = 0; i < pSegment->m_nReferred_to_segment_count; i++) {
- if(!findSegmentByNumber(pSegment->m_pReferred_to_segment_numbers[i])) {
- m_pModule->JBig2_Error("symbol dictionary segment : can't find refered to segments");
- nRet = JBIG2_ERROR_FETAL;
- goto failed;
- }
- }
- pSymbolDictDecoder->SDNUMINSYMS = 0;
- for(i = 0; i < pSegment->m_nReferred_to_segment_count; i++) {
- pSeg = findSegmentByNumber(pSegment->m_pReferred_to_segment_numbers[i]);
- if(pSeg->m_cFlags.s.type == 0) {
- pSymbolDictDecoder->SDNUMINSYMS += pSeg->m_Result.sd->SDNUMEXSYMS;
- pLRSeg = pSeg;
- }
- }
- if(pSymbolDictDecoder->SDNUMINSYMS == 0) {
- SDINSYMS = NULL;
- } else {
- SDINSYMS = (CJBig2_Image**)m_pModule->JBig2_Malloc2(
- sizeof(CJBig2_Image*), pSymbolDictDecoder->SDNUMINSYMS);
- dwTemp = 0;
- for(i = 0; i < pSegment->m_nReferred_to_segment_count; i++) {
- pSeg = findSegmentByNumber(pSegment->m_pReferred_to_segment_numbers[i]);
- if(pSeg->m_cFlags.s.type == 0) {
- JBIG2_memcpy(SDINSYMS + dwTemp, pSeg->m_Result.sd->SDEXSYMS,
- pSeg->m_Result.sd->SDNUMEXSYMS * sizeof(CJBig2_Image*));
- dwTemp += pSeg->m_Result.sd->SDNUMEXSYMS;
- }
- }
- }
- pSymbolDictDecoder->SDINSYMS = SDINSYMS;
- if(pSymbolDictDecoder->SDHUFF == 1) {
- if((cSDHUFFDH == 2) || (cSDHUFFDW == 2)) {
- m_pModule->JBig2_Error("symbol dictionary segment : SDHUFFDH=2 or SDHUFFDW=2 is not permitted.");
- nRet = JBIG2_ERROR_FETAL;
- goto failed;
- }
- nIndex = 0;
- if(cSDHUFFDH == 0) {
- JBIG2_ALLOC(Table_B4, CJBig2_HuffmanTable(HuffmanTable_B4,
- sizeof(HuffmanTable_B4) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B4));
- pSymbolDictDecoder->SDHUFFDH = Table_B4;
- } else if(cSDHUFFDH == 1) {
- JBIG2_ALLOC(Table_B5, CJBig2_HuffmanTable(HuffmanTable_B5,
- sizeof(HuffmanTable_B5) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B5));
- pSymbolDictDecoder->SDHUFFDH = Table_B5;
- } else {
- pSeg = findReferredSegmentByTypeAndIndex(pSegment, 53, nIndex++);
- if(!pSeg) {
- m_pModule->JBig2_Error("symbol dictionary segment : SDHUFFDH can't find user supplied table.");
- nRet = JBIG2_ERROR_FETAL;
- goto failed;
- }
- pSymbolDictDecoder->SDHUFFDH = pSeg->m_Result.ht;
- }
- if(cSDHUFFDW == 0) {
- JBIG2_ALLOC(Table_B2, CJBig2_HuffmanTable(HuffmanTable_B2,
- sizeof(HuffmanTable_B2) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B2));
- pSymbolDictDecoder->SDHUFFDW = Table_B2;
- } else if(cSDHUFFDW == 1) {
- JBIG2_ALLOC(Table_B3, CJBig2_HuffmanTable(HuffmanTable_B3,
- sizeof(HuffmanTable_B3) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B3));
- pSymbolDictDecoder->SDHUFFDW = Table_B3;
- } else {
- pSeg = findReferredSegmentByTypeAndIndex(pSegment, 53, nIndex++);
- if(!pSeg) {
- m_pModule->JBig2_Error("symbol dictionary segment : SDHUFFDW can't find user supplied table.");
- nRet = JBIG2_ERROR_FETAL;
- goto failed;
- }
- pSymbolDictDecoder->SDHUFFDW = pSeg->m_Result.ht;
- }
- if(cSDHUFFBMSIZE == 0) {
- JBIG2_ALLOC(Table_B1, CJBig2_HuffmanTable(HuffmanTable_B1,
- sizeof(HuffmanTable_B1) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B1));
- pSymbolDictDecoder->SDHUFFBMSIZE = Table_B1;
- } else {
- pSeg = findReferredSegmentByTypeAndIndex(pSegment, 53, nIndex++);
- if(!pSeg) {
- m_pModule->JBig2_Error("symbol dictionary segment : SDHUFFBMSIZE can't find user supplied table.");
- nRet = JBIG2_ERROR_FETAL;
- goto failed;
- }
- pSymbolDictDecoder->SDHUFFBMSIZE = pSeg->m_Result.ht;
- }
- if(pSymbolDictDecoder->SDREFAGG == 1) {
- if(cSDHUFFAGGINST == 0) {
- if(!Table_B1) {
- JBIG2_ALLOC(Table_B1, CJBig2_HuffmanTable(HuffmanTable_B1,
- sizeof(HuffmanTable_B1) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B1));
- }
- pSymbolDictDecoder->SDHUFFAGGINST = Table_B1;
- } else {
- pSeg = findReferredSegmentByTypeAndIndex(pSegment, 53, nIndex++);
- if(!pSeg) {
- m_pModule->JBig2_Error("symbol dictionary segment : SDHUFFAGGINST can't find user supplied table.");
- nRet = JBIG2_ERROR_FETAL;
- goto failed;
- }
- pSymbolDictDecoder->SDHUFFAGGINST = pSeg->m_Result.ht;
- }
- }
- }
- if((wFlags & 0x0100) && pLRSeg && pLRSeg->m_Result.sd->m_bContextRetained) {
- if (pSymbolDictDecoder->SDHUFF == 0) {
- dwTemp = pSymbolDictDecoder->SDTEMPLATE == 0 ? 65536 : pSymbolDictDecoder->SDTEMPLATE == 1 ?
- 8192 : 1024;
- gbContext = (JBig2ArithCtx*)m_pModule->JBig2_Malloc2(sizeof(JBig2ArithCtx), dwTemp);
- JBIG2_memcpy(gbContext, pLRSeg->m_Result.sd->m_gbContext, sizeof(JBig2ArithCtx)*dwTemp);
- }
- if (pSymbolDictDecoder->SDREFAGG == 1) {
- dwTemp = pSymbolDictDecoder->SDRTEMPLATE ? 1 << 10 : 1 << 13;
- grContext = (JBig2ArithCtx*)m_pModule->JBig2_Malloc2(sizeof(JBig2ArithCtx), dwTemp);
- JBIG2_memcpy(grContext, pLRSeg->m_Result.sd->m_grContext, sizeof(JBig2ArithCtx)*dwTemp);
- }
- } else {
- if (pSymbolDictDecoder->SDHUFF == 0) {
- dwTemp = pSymbolDictDecoder->SDTEMPLATE == 0 ? 65536 : pSymbolDictDecoder->SDTEMPLATE == 1 ?
- 8192 : 1024;
- gbContext = (JBig2ArithCtx*)m_pModule->JBig2_Malloc2(sizeof(JBig2ArithCtx), dwTemp);
- JBIG2_memset(gbContext, 0, sizeof(JBig2ArithCtx)*dwTemp);
- }
- if (pSymbolDictDecoder->SDREFAGG == 1) {
- dwTemp = pSymbolDictDecoder->SDRTEMPLATE ? 1 << 10 : 1 << 13;
- grContext = (JBig2ArithCtx*)m_pModule->JBig2_Malloc2(sizeof(JBig2ArithCtx), dwTemp);
- JBIG2_memset(grContext, 0, sizeof(JBig2ArithCtx)*dwTemp);
- }
- }
- pSegment->m_nResultType = JBIG2_SYMBOL_DICT_POINTER;
- if(pSymbolDictDecoder->SDHUFF == 0) {
- JBIG2_ALLOC(pArithDecoder, CJBig2_ArithDecoder(m_pStream));
- pSegment->m_Result.sd = pSymbolDictDecoder->decode_Arith(pArithDecoder, gbContext, grContext);
- delete pArithDecoder;
- if(pSegment->m_Result.sd == NULL) {
- nRet = JBIG2_ERROR_FETAL;
- goto failed;
- }
- m_pStream->alignByte();
- m_pStream->offset(2);
- } else {
- pSegment->m_Result.sd = pSymbolDictDecoder->decode_Huffman(m_pStream, gbContext, grContext, pPause);
- if(pSegment->m_Result.sd == NULL) {
- nRet = JBIG2_ERROR_FETAL;
- goto failed;
- }
- m_pStream->alignByte();
- }
- if(wFlags & 0x0200) {
- pSegment->m_Result.sd->m_bContextRetained = TRUE;
- if(pSymbolDictDecoder->SDHUFF == 0) {
- pSegment->m_Result.sd->m_gbContext = gbContext;
- }
- if(pSymbolDictDecoder->SDREFAGG == 1) {
- pSegment->m_Result.sd->m_grContext = grContext;
- }
- bUsed = TRUE;
- } else {
- bUsed = FALSE;
- }
- delete pSymbolDictDecoder;
- if(SDINSYMS) {
- m_pModule->JBig2_Free(SDINSYMS);
- }
- if(Table_B1) {
- delete Table_B1;
- }
- if(Table_B2) {
- delete Table_B2;
- }
- if(Table_B3) {
- delete Table_B3;
- }
- if(Table_B4) {
- delete Table_B4;
- }
- if(Table_B5) {
- delete Table_B5;
- }
- if(bUsed == FALSE) {
- if(gbContext) {
- m_pModule->JBig2_Free(gbContext);
- }
- if(grContext) {
- m_pModule->JBig2_Free(grContext);
- }
- }
- return JBIG2_SUCCESS;
-failed:
- delete pSymbolDictDecoder;
- if(SDINSYMS) {
- m_pModule->JBig2_Free(SDINSYMS);
- }
- if(Table_B1) {
- delete Table_B1;
- }
- if(Table_B2) {
- delete Table_B2;
- }
- if(Table_B3) {
- delete Table_B3;
- }
- if(Table_B4) {
- delete Table_B4;
- }
- if(Table_B5) {
- delete Table_B5;
- }
- if(gbContext) {
- m_pModule->JBig2_Free(gbContext);
- }
- if(grContext) {
- m_pModule->JBig2_Free(grContext);
- }
- return nRet;
-}
-
-FX_BOOL CJBig2_Context::parseTextRegion(CJBig2_Segment *pSegment)
-{
- FX_DWORD dwTemp;
- FX_WORD wFlags;
- FX_INT32 i, nIndex, nRet;
- JBig2RegionInfo ri;
- CJBig2_Segment *pSeg;
- CJBig2_Image **SBSYMS = NULL;
- JBig2HuffmanCode *SBSYMCODES = NULL;
- FX_BYTE cSBHUFFFS, cSBHUFFDS, cSBHUFFDT, cSBHUFFRDW, cSBHUFFRDH, cSBHUFFRDX, cSBHUFFRDY, cSBHUFFRSIZE;
- CJBig2_HuffmanTable *Table_B1 = NULL,
- *Table_B6 = NULL,
- *Table_B7 = NULL,
- *Table_B8 = NULL,
- *Table_B9 = NULL,
- *Table_B10 = NULL,
- *Table_B11 = NULL,
- *Table_B12 = NULL,
- *Table_B13 = NULL,
- *Table_B14 = NULL,
- *Table_B15 = NULL;
- JBig2ArithCtx *grContext = NULL;
- CJBig2_ArithDecoder *pArithDecoder;
- CJBig2_TRDProc *pTRD;
- JBIG2_ALLOC(pTRD, CJBig2_TRDProc());
- if((parseRegionInfo(&ri) != JBIG2_SUCCESS)
- || (m_pStream->readShortInteger(&wFlags) != 0)) {
- m_pModule->JBig2_Error("text region segment : data header too short.");
- nRet = JBIG2_ERROR_TOO_SHORT;
- goto failed;
- }
- pTRD->SBW = ri.width;
- pTRD->SBH = ri.height;
- pTRD->SBHUFF = wFlags & 0x0001;
- pTRD->SBREFINE = (wFlags >> 1) & 0x0001;
- dwTemp = (wFlags >> 2) & 0x0003;
- pTRD->SBSTRIPS = 1 << dwTemp;
- pTRD->REFCORNER = (JBig2Corner)((wFlags >> 4) & 0x0003);
- pTRD->TRANSPOSED = (wFlags >> 6) & 0x0001;
- pTRD->SBCOMBOP = (JBig2ComposeOp)((wFlags >> 7) & 0x0003);
- pTRD->SBDEFPIXEL = (wFlags >> 9) & 0x0001;
- pTRD->SBDSOFFSET = (wFlags >> 10) & 0x001f;
- if(pTRD->SBDSOFFSET >= 0x0010) {
- pTRD->SBDSOFFSET = pTRD->SBDSOFFSET - 0x0020;
- }
- pTRD->SBRTEMPLATE = (wFlags >> 15) & 0x0001;
- if(pTRD->SBHUFF == 1) {
- if(m_pStream->readShortInteger(&wFlags) != 0) {
- m_pModule->JBig2_Error("text region segment : data header too short.");
- nRet = JBIG2_ERROR_TOO_SHORT;
- goto failed;
- }
- cSBHUFFFS = wFlags & 0x0003;
- cSBHUFFDS = (wFlags >> 2) & 0x0003;
- cSBHUFFDT = (wFlags >> 4) & 0x0003;
- cSBHUFFRDW = (wFlags >> 6) & 0x0003;
- cSBHUFFRDH = (wFlags >> 8) & 0x0003;
- cSBHUFFRDX = (wFlags >> 10) & 0x0003;
- cSBHUFFRDY = (wFlags >> 12) & 0x0003;
- cSBHUFFRSIZE = (wFlags >> 14) & 0x0001;
- }
- if((pTRD->SBREFINE == 1) && (pTRD->SBRTEMPLATE == 0)) {
- for(i = 0; i < 4; i++) {
- if(m_pStream->read1Byte((FX_BYTE*)&pTRD->SBRAT[i]) != 0) {
- m_pModule->JBig2_Error("text region segment : data header too short.");
- nRet = JBIG2_ERROR_TOO_SHORT;
- goto failed;
- }
- }
- }
- if(m_pStream->readInteger(&pTRD->SBNUMINSTANCES) != 0) {
- m_pModule->JBig2_Error("text region segment : data header too short.");
- nRet = JBIG2_ERROR_TOO_SHORT;
- goto failed;
- }
- for(i = 0; i < pSegment->m_nReferred_to_segment_count; i++) {
- if(!findSegmentByNumber(pSegment->m_pReferred_to_segment_numbers[i])) {
- m_pModule->JBig2_Error("text region segment : can't find refered to segments");
- nRet = JBIG2_ERROR_FETAL;
- goto failed;
- }
- }
- pTRD->SBNUMSYMS = 0;
- for(i = 0; i < pSegment->m_nReferred_to_segment_count; i++) {
- pSeg = findSegmentByNumber(pSegment->m_pReferred_to_segment_numbers[i]);
- if(pSeg->m_cFlags.s.type == 0) {
- pTRD->SBNUMSYMS += pSeg->m_Result.sd->SDNUMEXSYMS;
- }
- }
- if (pTRD->SBNUMSYMS > 0) {
- SBSYMS = (CJBig2_Image**)m_pModule->JBig2_Malloc2(
- sizeof(CJBig2_Image*), pTRD->SBNUMSYMS);
- dwTemp = 0;
- for(i = 0; i < pSegment->m_nReferred_to_segment_count; i++) {
- pSeg = findSegmentByNumber(pSegment->m_pReferred_to_segment_numbers[i]);
- if(pSeg->m_cFlags.s.type == 0) {
- JBIG2_memcpy(SBSYMS + dwTemp, pSeg->m_Result.sd->SDEXSYMS,
- pSeg->m_Result.sd->SDNUMEXSYMS * sizeof(CJBig2_Image*));
- dwTemp += pSeg->m_Result.sd->SDNUMEXSYMS;
- }
- }
- pTRD->SBSYMS = SBSYMS;
- } else {
- pTRD->SBSYMS = NULL;
- }
- if(pTRD->SBHUFF == 1) {
- SBSYMCODES = decodeSymbolIDHuffmanTable(m_pStream, pTRD->SBNUMSYMS);
- if(SBSYMCODES == NULL) {
- m_pModule->JBig2_Error("text region segment: symbol ID huffman table decode failure!");
- nRet = JBIG2_ERROR_FETAL;
- goto failed;
- }
- m_pStream->alignByte();
- pTRD->SBSYMCODES = SBSYMCODES;
- } else {
- dwTemp = 0;
- while((FX_DWORD)(1 << dwTemp) < pTRD->SBNUMSYMS) {
- dwTemp ++;
- }
- pTRD->SBSYMCODELEN = (FX_BYTE)dwTemp;
- }
- if(pTRD->SBHUFF == 1) {
- if((cSBHUFFFS == 2) || (cSBHUFFRDW == 2) || (cSBHUFFRDH == 2)
- || (cSBHUFFRDX == 2) || (cSBHUFFRDY == 2)) {
- m_pModule->JBig2_Error("text region segment : SBHUFFFS=2 or SBHUFFRDW=2 or "
- "SBHUFFRDH=2 or SBHUFFRDX=2 or SBHUFFRDY=2 is not permitted");
- nRet = JBIG2_ERROR_FETAL;
- goto failed;
- }
- nIndex = 0;
- if(cSBHUFFFS == 0) {
- JBIG2_ALLOC(Table_B6, CJBig2_HuffmanTable(HuffmanTable_B6,
- sizeof(HuffmanTable_B6) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B6));
- pTRD->SBHUFFFS = Table_B6;
- } else if(cSBHUFFFS == 1) {
- JBIG2_ALLOC(Table_B7, CJBig2_HuffmanTable(HuffmanTable_B7,
- sizeof(HuffmanTable_B7) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B7));
- pTRD->SBHUFFFS = Table_B7;
- } else {
- pSeg = findReferredSegmentByTypeAndIndex(pSegment, 53, nIndex++);
- if(!pSeg) {
- m_pModule->JBig2_Error("text region segment : SBHUFFFS can't find user supplied table");
- nRet = JBIG2_ERROR_FETAL;
- goto failed;
- }
- pTRD->SBHUFFFS = pSeg->m_Result.ht;
- }
- if(cSBHUFFDS == 0) {
- JBIG2_ALLOC(Table_B8, CJBig2_HuffmanTable(HuffmanTable_B8,
- sizeof(HuffmanTable_B8) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B8));
- pTRD->SBHUFFDS = Table_B8;
- } else if(cSBHUFFDS == 1) {
- JBIG2_ALLOC(Table_B9, CJBig2_HuffmanTable(HuffmanTable_B9,
- sizeof(HuffmanTable_B9) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B9));
- pTRD->SBHUFFDS = Table_B9;
- } else if(cSBHUFFDS == 2) {
- JBIG2_ALLOC(Table_B10, CJBig2_HuffmanTable(HuffmanTable_B10,
- sizeof(HuffmanTable_B10) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B10));
- pTRD->SBHUFFDS = Table_B10;
- } else {
- pSeg = findReferredSegmentByTypeAndIndex(pSegment, 53, nIndex++);
- if(!pSeg) {
- m_pModule->JBig2_Error("text region segment : SBHUFFDS can't find user supplied table");
- nRet = JBIG2_ERROR_FETAL;
- goto failed;
- }
- pTRD->SBHUFFDS = pSeg->m_Result.ht;
- }
- if(cSBHUFFDT == 0) {
- JBIG2_ALLOC(Table_B11, CJBig2_HuffmanTable(HuffmanTable_B11,
- sizeof(HuffmanTable_B11) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B11));
- pTRD->SBHUFFDT = Table_B11;
- } else if(cSBHUFFDT == 1) {
- JBIG2_ALLOC(Table_B12, CJBig2_HuffmanTable(HuffmanTable_B12,
- sizeof(HuffmanTable_B12) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B12));
- pTRD->SBHUFFDT = Table_B12;
- } else if(cSBHUFFDT == 2) {
- JBIG2_ALLOC(Table_B13, CJBig2_HuffmanTable(HuffmanTable_B13,
- sizeof(HuffmanTable_B13) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B13));
- pTRD->SBHUFFDT = Table_B13;
- } else {
- pSeg = findReferredSegmentByTypeAndIndex(pSegment, 53, nIndex++);
- if(!pSeg) {
- m_pModule->JBig2_Error("text region segment : SBHUFFDT can't find user supplied table");
- nRet = JBIG2_ERROR_FETAL;
- goto failed;
- }
- pTRD->SBHUFFDT = pSeg->m_Result.ht;
- }
- if(cSBHUFFRDW == 0) {
- JBIG2_ALLOC(Table_B14, CJBig2_HuffmanTable(HuffmanTable_B14,
- sizeof(HuffmanTable_B14) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B14));
- pTRD->SBHUFFRDW = Table_B14;
- } else if(cSBHUFFRDW == 1) {
- JBIG2_ALLOC(Table_B15, CJBig2_HuffmanTable(HuffmanTable_B15,
- sizeof(HuffmanTable_B15) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B15));
- pTRD->SBHUFFRDW = Table_B15;
- } else {
- pSeg = findReferredSegmentByTypeAndIndex(pSegment, 53, nIndex++);
- if(!pSeg) {
- m_pModule->JBig2_Error("text region segment : SBHUFFRDW can't find user supplied table");
- nRet = JBIG2_ERROR_FETAL;
- goto failed;
- }
- pTRD->SBHUFFRDW = pSeg->m_Result.ht;
- }
- if(cSBHUFFRDH == 0) {
- if(!Table_B14) {
- JBIG2_ALLOC(Table_B14, CJBig2_HuffmanTable(HuffmanTable_B14,
- sizeof(HuffmanTable_B14) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B14));
- }
- pTRD->SBHUFFRDH = Table_B14;
- } else if(cSBHUFFRDH == 1) {
- if(!Table_B15) {
- JBIG2_ALLOC(Table_B15, CJBig2_HuffmanTable(HuffmanTable_B15,
- sizeof(HuffmanTable_B15) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B15));
- }
- pTRD->SBHUFFRDH = Table_B15;
- } else {
- pSeg = findReferredSegmentByTypeAndIndex(pSegment, 53, nIndex++);
- if(!pSeg) {
- m_pModule->JBig2_Error("text region segment : SBHUFFRDH can't find user supplied table");
- nRet = JBIG2_ERROR_FETAL;
- goto failed;
- }
- pTRD->SBHUFFRDH = pSeg->m_Result.ht;
- }
- if(cSBHUFFRDX == 0) {
- if(!Table_B14) {
- JBIG2_ALLOC(Table_B14, CJBig2_HuffmanTable(HuffmanTable_B14,
- sizeof(HuffmanTable_B14) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B14));
- }
- pTRD->SBHUFFRDX = Table_B14;
- } else if(cSBHUFFRDX == 1) {
- if(!Table_B15) {
- JBIG2_ALLOC(Table_B15, CJBig2_HuffmanTable(HuffmanTable_B15,
- sizeof(HuffmanTable_B15) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B15));
- }
- pTRD->SBHUFFRDX = Table_B15;
- } else {
- pSeg = findReferredSegmentByTypeAndIndex(pSegment, 53, nIndex++);
- if(!pSeg) {
- m_pModule->JBig2_Error("text region segment : SBHUFFRDX can't find user supplied table");
- nRet = JBIG2_ERROR_FETAL;
- goto failed;
- }
- pTRD->SBHUFFRDX = pSeg->m_Result.ht;
- }
- if(cSBHUFFRDY == 0) {
- if(!Table_B14) {
- JBIG2_ALLOC(Table_B14, CJBig2_HuffmanTable(HuffmanTable_B14,
- sizeof(HuffmanTable_B14) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B14));
- }
- pTRD->SBHUFFRDY = Table_B14;
- } else if(cSBHUFFRDY == 1) {
- if(!Table_B15) {
- JBIG2_ALLOC(Table_B15, CJBig2_HuffmanTable(HuffmanTable_B15,
- sizeof(HuffmanTable_B15) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B15));
- }
- pTRD->SBHUFFRDY = Table_B15;
- } else {
- pSeg = findReferredSegmentByTypeAndIndex(pSegment, 53, nIndex++);
- if(!pSeg) {
- m_pModule->JBig2_Error("text region segment : SBHUFFRDY can't find user supplied table");
- nRet = JBIG2_ERROR_FETAL;
- goto failed;
- }
- pTRD->SBHUFFRDY = pSeg->m_Result.ht;
- }
- if(cSBHUFFRSIZE == 0) {
- JBIG2_ALLOC(Table_B1, CJBig2_HuffmanTable(HuffmanTable_B1,
- sizeof(HuffmanTable_B1) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B1));
- pTRD->SBHUFFRSIZE = Table_B1;
- } else {
- pSeg = findReferredSegmentByTypeAndIndex(pSegment, 53, nIndex++);
- if(!pSeg) {
- m_pModule->JBig2_Error("text region segment : SBHUFFRSIZE can't find user supplied table");
- nRet = JBIG2_ERROR_FETAL;
- goto failed;
- }
- pTRD->SBHUFFRSIZE = pSeg->m_Result.ht;
- }
- }
- if(pTRD->SBREFINE == 1) {
- dwTemp = pTRD->SBRTEMPLATE ? 1 << 10 : 1 << 13;
- grContext = (JBig2ArithCtx*)m_pModule->JBig2_Malloc2(sizeof(JBig2ArithCtx), dwTemp);
- JBIG2_memset(grContext, 0, sizeof(JBig2ArithCtx)*dwTemp);
- }
- if(pTRD->SBHUFF == 0) {
- JBIG2_ALLOC(pArithDecoder, CJBig2_ArithDecoder(m_pStream));
- pSegment->m_nResultType = JBIG2_IMAGE_POINTER;
- pSegment->m_Result.im = pTRD->decode_Arith(pArithDecoder, grContext);
- delete pArithDecoder;
- if(pSegment->m_Result.im == NULL) {
- nRet = JBIG2_ERROR_FETAL;
- goto failed;
- }
- m_pStream->alignByte();
- m_pStream->offset(2);
- } else {
- pSegment->m_nResultType = JBIG2_IMAGE_POINTER;
- pSegment->m_Result.im = pTRD->decode_Huffman(m_pStream, grContext);
- if(pSegment->m_Result.im == NULL) {
- nRet = JBIG2_ERROR_FETAL;
- goto failed;
- }
- m_pStream->alignByte();
- }
- if(pSegment->m_cFlags.s.type != 4) {
- if(!m_bBufSpecified) {
- JBig2PageInfo *pPageInfo = m_pPageInfoList->getLast();
- if ((pPageInfo->m_bIsStriped == 1) && (ri.y + ri.height > m_pPage->m_nHeight)) {
- m_pPage->expand(ri.y + ri.height, (pPageInfo->m_cFlags & 4) ? 1 : 0);
- }
- }
- m_pPage->composeFrom(ri.x, ri.y, pSegment->m_Result.im, (JBig2ComposeOp)(ri.flags & 0x03));
- delete pSegment->m_Result.im;
- pSegment->m_Result.im = NULL;
- }
- delete pTRD;
- if(SBSYMS) {
- m_pModule->JBig2_Free(SBSYMS);
- }
- if(SBSYMCODES) {
- m_pModule->JBig2_Free(SBSYMCODES);
- }
- if(grContext) {
- m_pModule->JBig2_Free(grContext);
- }
- if(Table_B1) {
- delete Table_B1;
- }
- if(Table_B6) {
- delete Table_B6;
- }
- if(Table_B7) {
- delete Table_B7;
- }
- if(Table_B8) {
- delete Table_B8;
- }
- if(Table_B9) {
- delete Table_B9;
- }
- if(Table_B10) {
- delete Table_B10;
- }
- if(Table_B11) {
- delete Table_B11;
- }
- if(Table_B12) {
- delete Table_B12;
- }
- if(Table_B13) {
- delete Table_B13;
- }
- if(Table_B14) {
- delete Table_B14;
- }
- if(Table_B15) {
- delete Table_B15;
- }
- return JBIG2_SUCCESS;
-failed:
- delete pTRD;
- if(SBSYMS) {
- m_pModule->JBig2_Free(SBSYMS);
- }
- if(SBSYMCODES) {
- m_pModule->JBig2_Free(SBSYMCODES);
- }
- if(grContext) {
- m_pModule->JBig2_Free(grContext);
- }
- if(Table_B1) {
- delete Table_B1;
- }
- if(Table_B6) {
- delete Table_B6;
- }
- if(Table_B7) {
- delete Table_B7;
- }
- if(Table_B8) {
- delete Table_B8;
- }
- if(Table_B9) {
- delete Table_B9;
- }
- if(Table_B10) {
- delete Table_B10;
- }
- if(Table_B11) {
- delete Table_B11;
- }
- if(Table_B12) {
- delete Table_B12;
- }
- if(Table_B13) {
- delete Table_B13;
- }
- if(Table_B14) {
- delete Table_B14;
- }
- if(Table_B15) {
- delete Table_B15;
- }
- return nRet;
-}
-
-FX_BOOL CJBig2_Context::parsePatternDict(CJBig2_Segment *pSegment, IFX_Pause* pPause)
-{
- FX_DWORD dwTemp;
- FX_BYTE cFlags;
- JBig2ArithCtx *gbContext;
- CJBig2_ArithDecoder *pArithDecoder;
- CJBig2_PDDProc *pPDD;
- FX_INT32 nRet;
- JBIG2_ALLOC(pPDD, CJBig2_PDDProc());
- if((m_pStream->read1Byte(&cFlags) != 0)
- || (m_pStream->read1Byte(&pPDD->HDPW) != 0)
- || (m_pStream->read1Byte(&pPDD->HDPH) != 0)
- || (m_pStream->readInteger(&pPDD->GRAYMAX) != 0)) {
- m_pModule->JBig2_Error("pattern dictionary segment : data header too short.");
- nRet = JBIG2_ERROR_TOO_SHORT;
- goto failed;
- }
- if (pPDD->GRAYMAX > JBIG2_MAX_PATTERN_INDEX) {
- m_pModule->JBig2_Error("pattern dictionary segment : too max gray max.");
- nRet = JBIG2_ERROR_LIMIT;
- goto failed;
- }
- pPDD->HDMMR = cFlags & 0x01;
- pPDD->HDTEMPLATE = (cFlags >> 1) & 0x03;
- pSegment->m_nResultType = JBIG2_PATTERN_DICT_POINTER;
- if(pPDD->HDMMR == 0) {
- dwTemp = pPDD->HDTEMPLATE == 0 ? 65536 : pPDD->HDTEMPLATE == 1 ? 8192 : 1024;
- gbContext = (JBig2ArithCtx*)m_pModule->JBig2_Malloc2(sizeof(JBig2ArithCtx), dwTemp);
- JBIG2_memset(gbContext, 0, sizeof(JBig2ArithCtx)*dwTemp);
- JBIG2_ALLOC(pArithDecoder, CJBig2_ArithDecoder(m_pStream));
- pSegment->m_Result.pd = pPDD->decode_Arith(pArithDecoder, gbContext, pPause);
- delete pArithDecoder;
- if(pSegment->m_Result.pd == NULL) {
- m_pModule->JBig2_Free(gbContext);
- nRet = JBIG2_ERROR_FETAL;
- goto failed;
- }
- m_pModule->JBig2_Free(gbContext);
- m_pStream->alignByte();
- m_pStream->offset(2);
- } else {
- pSegment->m_Result.pd = pPDD->decode_MMR(m_pStream, pPause);
- if(pSegment->m_Result.pd == NULL) {
- nRet = JBIG2_ERROR_FETAL;
- goto failed;
- }
- m_pStream->alignByte();
- }
- delete pPDD;
- return JBIG2_SUCCESS;
-failed:
- delete pPDD;
- return nRet;
-}
-FX_BOOL CJBig2_Context::parseHalftoneRegion(CJBig2_Segment *pSegment, IFX_Pause* pPause)
-{
- FX_DWORD dwTemp;
- FX_BYTE cFlags;
- JBig2RegionInfo ri;
- CJBig2_Segment *pSeg;
- CJBig2_PatternDict *pPatternDict;
- JBig2ArithCtx *gbContext;
- CJBig2_ArithDecoder *pArithDecoder;
- CJBig2_HTRDProc *pHRD;
- FX_INT32 nRet;
- JBIG2_ALLOC(pHRD, CJBig2_HTRDProc());
- if((parseRegionInfo(&ri) != JBIG2_SUCCESS)
- || (m_pStream->read1Byte(&cFlags) != 0)
- || (m_pStream->readInteger(&pHRD->HGW) != 0)
- || (m_pStream->readInteger(&pHRD->HGH) != 0)
- || (m_pStream->readInteger((FX_DWORD*)&pHRD->HGX) != 0)
- || (m_pStream->readInteger((FX_DWORD*)&pHRD->HGY) != 0)
- || (m_pStream->readShortInteger(&pHRD->HRX) != 0)
- || (m_pStream->readShortInteger(&pHRD->HRY) != 0)) {
- m_pModule->JBig2_Error("halftone region segment : data header too short.");
- nRet = JBIG2_ERROR_TOO_SHORT;
- goto failed;
- }
- pHRD->HBW = ri.width;
- pHRD->HBH = ri.height;
- pHRD->HMMR = cFlags & 0x01;
- pHRD->HTEMPLATE = (cFlags >> 1) & 0x03;
- pHRD->HENABLESKIP = (cFlags >> 3) & 0x01;
- pHRD->HCOMBOP = (JBig2ComposeOp)((cFlags >> 4) & 0x07);
- pHRD->HDEFPIXEL = (cFlags >> 7) & 0x01;
- if(pSegment->m_nReferred_to_segment_count != 1) {
- m_pModule->JBig2_Error("halftone region segment : refered to segment count not equals 1");
- nRet = JBIG2_ERROR_FETAL;
- goto failed;
- }
- pSeg = findSegmentByNumber(pSegment->m_pReferred_to_segment_numbers[0]);
- if( (pSeg == NULL) || (pSeg->m_cFlags.s.type != 16)) {
- m_pModule->JBig2_Error("halftone region segment : refered to segment is not pattern dict");
- nRet = JBIG2_ERROR_FETAL;
- goto failed;
- }
- pPatternDict = pSeg->m_Result.pd;
- if((pPatternDict == NULL) || (pPatternDict->NUMPATS == 0)) {
- m_pModule->JBig2_Error("halftone region segment : has no patterns input");
- nRet = JBIG2_ERROR_FETAL;
- goto failed;
- }
- pHRD->HNUMPATS = pPatternDict->NUMPATS;
- pHRD->HPATS = pPatternDict->HDPATS;
- pHRD->HPW = pPatternDict->HDPATS[0]->m_nWidth;
- pHRD->HPH = pPatternDict->HDPATS[0]->m_nHeight;
- pSegment->m_nResultType = JBIG2_IMAGE_POINTER;
- if(pHRD->HMMR == 0) {
- dwTemp = pHRD->HTEMPLATE == 0 ? 65536 : pHRD->HTEMPLATE == 1 ? 8192 : 1024;
- gbContext = (JBig2ArithCtx*)m_pModule->JBig2_Malloc2(sizeof(JBig2ArithCtx), dwTemp);
- JBIG2_memset(gbContext, 0, sizeof(JBig2ArithCtx)*dwTemp);
- JBIG2_ALLOC(pArithDecoder, CJBig2_ArithDecoder(m_pStream));
- pSegment->m_Result.im = pHRD->decode_Arith(pArithDecoder, gbContext, pPause);
- delete pArithDecoder;
- if(pSegment->m_Result.im == NULL) {
- m_pModule->JBig2_Free(gbContext);
- nRet = JBIG2_ERROR_FETAL;
- goto failed;
- }
- m_pModule->JBig2_Free(gbContext);
- m_pStream->alignByte();
- m_pStream->offset(2);
- } else {
- pSegment->m_Result.im = pHRD->decode_MMR(m_pStream, pPause);
- if(pSegment->m_Result.im == NULL) {
- nRet = JBIG2_ERROR_FETAL;
- goto failed;
- }
- m_pStream->alignByte();
- }
- if(pSegment->m_cFlags.s.type != 20) {
- if(!m_bBufSpecified) {
- JBig2PageInfo *pPageInfo = m_pPageInfoList->getLast();
- if ((pPageInfo->m_bIsStriped == 1) && (ri.y + ri.height > m_pPage->m_nHeight)) {
- m_pPage->expand(ri.y + ri.height, (pPageInfo->m_cFlags & 4) ? 1 : 0);
- }
- }
- m_pPage->composeFrom(ri.x, ri.y, pSegment->m_Result.im, (JBig2ComposeOp)(ri.flags & 0x03));
- delete pSegment->m_Result.im;
- pSegment->m_Result.im = NULL;
- }
- delete pHRD;
- return JBIG2_SUCCESS;
-failed:
- delete pHRD;
- return nRet;
-}
-
-FX_BOOL CJBig2_Context::parseGenericRegion(CJBig2_Segment *pSegment, IFX_Pause* pPause)
-{
- FX_DWORD dwTemp;
- FX_BYTE cFlags;
- FX_INT32 i, nRet;
- if(m_pGRD == NULL) {
- JBIG2_ALLOC(m_pGRD, CJBig2_GRDProc());
- if((parseRegionInfo(&m_ri) != JBIG2_SUCCESS)
- || (m_pStream->read1Byte(&cFlags) != 0)) {
- m_pModule->JBig2_Error("generic region segment : data header too short.");
- nRet = JBIG2_ERROR_TOO_SHORT;
- goto failed;
- }
- if (m_ri.height < 0 || m_ri.width < 0) {
- m_pModule->JBig2_Error("generic region segment : wrong data.");
- nRet = JBIG2_FAILED;
- goto failed;
- }
- m_pGRD->GBW = m_ri.width;
- m_pGRD->GBH = m_ri.height;
- m_pGRD->MMR = cFlags & 0x01;
- m_pGRD->GBTEMPLATE = (cFlags >> 1) & 0x03;
- m_pGRD->TPGDON = (cFlags >> 3) & 0x01;
- if(m_pGRD->MMR == 0) {
- if(m_pGRD->GBTEMPLATE == 0) {
- for(i = 0; i < 8; i++) {
- if(m_pStream->read1Byte((FX_BYTE*)&m_pGRD->GBAT[i]) != 0) {
- m_pModule->JBig2_Error("generic region segment : data header too short.");
- nRet = JBIG2_ERROR_TOO_SHORT;
- goto failed;
- }
- }
- } else {
- for(i = 0; i < 2; i++) {
- if(m_pStream->read1Byte((FX_BYTE*)&m_pGRD->GBAT[i]) != 0) {
- m_pModule->JBig2_Error("generic region segment : data header too short.");
- nRet = JBIG2_ERROR_TOO_SHORT;
- goto failed;
- }
- }
- }
- }
- m_pGRD->USESKIP = 0;
- }
- pSegment->m_nResultType = JBIG2_IMAGE_POINTER;
- if(m_pGRD->MMR == 0) {
- dwTemp = m_pGRD->GBTEMPLATE == 0 ? 65536 : m_pGRD->GBTEMPLATE == 1 ? 8192 : 1024;
- if(m_gbContext == NULL) {
- m_gbContext = (JBig2ArithCtx*)m_pModule->JBig2_Malloc(sizeof(JBig2ArithCtx) * dwTemp);
- JBIG2_memset(m_gbContext, 0, sizeof(JBig2ArithCtx)*dwTemp);
- }
- if(m_pArithDecoder == NULL) {
- JBIG2_ALLOC(m_pArithDecoder, CJBig2_ArithDecoder(m_pStream));
- m_ProcessiveStatus = m_pGRD->Start_decode_Arith(&pSegment->m_Result.im, m_pArithDecoder, m_gbContext, pPause);
- } else {
- m_ProcessiveStatus = m_pGRD->Continue_decode(pPause);
- }
- OutputBitmap(pSegment->m_Result.im);
- if(m_ProcessiveStatus == FXCODEC_STATUS_DECODE_TOBECONTINUE) {
- if(pSegment->m_cFlags.s.type != 36) {
- if(!m_bBufSpecified) {
- JBig2PageInfo *pPageInfo = m_pPageInfoList->getLast();
- if ((pPageInfo->m_bIsStriped == 1) && (m_ri.y + m_ri.height > m_pPage->m_nHeight)) {
- m_pPage->expand(m_ri.y + m_ri.height, (pPageInfo->m_cFlags & 4) ? 1 : 0);
- }
- }
- FX_RECT Rect = m_pGRD->GetReplaceRect();
- m_pPage->composeFrom(m_ri.x + Rect.left, m_ri.y + Rect.top, pSegment->m_Result.im, (JBig2ComposeOp)(m_ri.flags & 0x03), &Rect);
- }
- return JBIG2_SUCCESS;
- } else {
- delete m_pArithDecoder;
- m_pArithDecoder = NULL;
- if(pSegment->m_Result.im == NULL) {
- m_pModule->JBig2_Free(m_gbContext);
- nRet = JBIG2_ERROR_FETAL;
- m_gbContext = NULL;
- m_ProcessiveStatus = FXCODEC_STATUS_ERROR;
- goto failed;
- }
- m_pModule->JBig2_Free(m_gbContext);
- m_gbContext = NULL;
- m_pStream->alignByte();
- m_pStream->offset(2);
- }
- } else {
- FXCODEC_STATUS status = m_pGRD->Start_decode_MMR(&pSegment->m_Result.im, m_pStream, pPause);
- while(status == FXCODEC_STATUS_DECODE_TOBECONTINUE) {
- m_pGRD->Continue_decode(pPause);
- }
- if(pSegment->m_Result.im == NULL) {
- nRet = JBIG2_ERROR_FETAL;
- goto failed;
- }
- m_pStream->alignByte();
- }
- if(pSegment->m_cFlags.s.type != 36) {
- if(!m_bBufSpecified) {
- JBig2PageInfo *pPageInfo = m_pPageInfoList->getLast();
- if ((pPageInfo->m_bIsStriped == 1) && (m_ri.y + m_ri.height > m_pPage->m_nHeight)) {
- m_pPage->expand(m_ri.y + m_ri.height, (pPageInfo->m_cFlags & 4) ? 1 : 0);
- }
- }
- FX_RECT Rect = m_pGRD->GetReplaceRect();
- m_pPage->composeFrom(m_ri.x + Rect.left, m_ri.y + Rect.top, pSegment->m_Result.im, (JBig2ComposeOp)(m_ri.flags & 0x03), &Rect);
- delete pSegment->m_Result.im;
- pSegment->m_Result.im = NULL;
- }
- delete m_pGRD;
- m_pGRD = NULL;
- return JBIG2_SUCCESS;
-failed:
- delete m_pGRD;
- m_pGRD = NULL;
- return nRet;
-}
-
-FX_BOOL CJBig2_Context::parseGenericRefinementRegion(CJBig2_Segment *pSegment)
-{
- FX_DWORD dwTemp;
- JBig2RegionInfo ri;
- CJBig2_Segment *pSeg;
- FX_INT32 i, nRet;
- FX_BYTE cFlags;
- JBig2ArithCtx *grContext;
- CJBig2_GRRDProc *pGRRD;
- CJBig2_ArithDecoder *pArithDecoder;
- JBIG2_ALLOC(pGRRD, CJBig2_GRRDProc());
- if((parseRegionInfo(&ri) != JBIG2_SUCCESS)
- || (m_pStream->read1Byte(&cFlags) != 0)) {
- m_pModule->JBig2_Error("generic refinement region segment : data header too short.");
- nRet = JBIG2_ERROR_TOO_SHORT;
- goto failed;
- }
- pGRRD->GRW = ri.width;
- pGRRD->GRH = ri.height;
- pGRRD->GRTEMPLATE = cFlags & 0x01;
- pGRRD->TPGRON = (cFlags >> 1) & 0x01;
- if(pGRRD->GRTEMPLATE == 0) {
- for(i = 0; i < 4; i++) {
- if(m_pStream->read1Byte((FX_BYTE*)&pGRRD->GRAT[i]) != 0) {
- m_pModule->JBig2_Error("generic refinement region segment : data header too short.");
- nRet = JBIG2_ERROR_TOO_SHORT;
- goto failed;
- }
- }
- }
- pSeg = NULL;
- if(pSegment->m_nReferred_to_segment_count > 0) {
- for(i = 0; i < pSegment->m_nReferred_to_segment_count; i++) {
- pSeg = this->findSegmentByNumber(pSegment->m_pReferred_to_segment_numbers[0]);
- if(pSeg == NULL) {
- m_pModule->JBig2_Error("generic refinement region segment : can't find refered to segments");
- nRet = JBIG2_ERROR_FETAL;
- goto failed;
- }
- if((pSeg->m_cFlags.s.type == 4) || (pSeg->m_cFlags.s.type == 20)
- || (pSeg->m_cFlags.s.type == 36) || (pSeg->m_cFlags.s.type == 40)) {
- break;
- }
- }
- if(i >= pSegment->m_nReferred_to_segment_count) {
- m_pModule->JBig2_Error("generic refinement region segment : can't find refered to intermediate region");
- nRet = JBIG2_ERROR_FETAL;
- goto failed;
- }
- pGRRD->GRREFERENCE = pSeg->m_Result.im;
- } else {
- pGRRD->GRREFERENCE = m_pPage;
- }
- pGRRD->GRREFERENCEDX = 0;
- pGRRD->GRREFERENCEDY = 0;
- dwTemp = pGRRD->GRTEMPLATE ? 1 << 10 : 1 << 13;
- grContext = (JBig2ArithCtx*)m_pModule->JBig2_Malloc2(sizeof(JBig2ArithCtx), dwTemp);
- JBIG2_memset(grContext, 0, sizeof(JBig2ArithCtx)*dwTemp);
- JBIG2_ALLOC(pArithDecoder, CJBig2_ArithDecoder(m_pStream));
- pSegment->m_nResultType = JBIG2_IMAGE_POINTER;
- pSegment->m_Result.im = pGRRD->decode(pArithDecoder, grContext);
- delete pArithDecoder;
- if(pSegment->m_Result.im == NULL) {
- m_pModule->JBig2_Free(grContext);
- nRet = JBIG2_ERROR_FETAL;
- goto failed;
- }
- m_pModule->JBig2_Free(grContext);
- m_pStream->alignByte();
- m_pStream->offset(2);
- if(pSegment->m_cFlags.s.type != 40) {
- if(!m_bBufSpecified) {
- JBig2PageInfo *pPageInfo = m_pPageInfoList->getLast();
- if ((pPageInfo->m_bIsStriped == 1) && (ri.y + ri.height > m_pPage->m_nHeight)) {
- m_pPage->expand(ri.y + ri.height, (pPageInfo->m_cFlags & 4) ? 1 : 0);
- }
- }
- m_pPage->composeFrom(ri.x, ri.y, pSegment->m_Result.im, (JBig2ComposeOp)(ri.flags & 0x03));
- delete pSegment->m_Result.im;
- pSegment->m_Result.im = NULL;
- }
- delete pGRRD;
- return JBIG2_SUCCESS;
-failed:
- delete pGRRD;
- return nRet;
-}
-FX_BOOL CJBig2_Context::parseTable(CJBig2_Segment *pSegment)
-{
- pSegment->m_nResultType = JBIG2_HUFFMAN_TABLE_POINTER;
- JBIG2_ALLOC(pSegment->m_Result.ht, CJBig2_HuffmanTable(m_pStream));
- if(!pSegment->m_Result.ht->isOK()) {
- delete pSegment->m_Result.ht;
- pSegment->m_Result.ht = NULL;
- return JBIG2_ERROR_FETAL;
- }
- m_pStream->alignByte();
- return JBIG2_SUCCESS;
-}
-FX_INT32 CJBig2_Context::parseRegionInfo(JBig2RegionInfo *pRI)
-{
- if((m_pStream->readInteger((FX_DWORD*)&pRI->width) != 0)
- || (m_pStream->readInteger((FX_DWORD*)&pRI->height) != 0)
- || (m_pStream->readInteger((FX_DWORD*)&pRI->x) != 0)
- || (m_pStream->readInteger((FX_DWORD*)&pRI->y) != 0)
- || (m_pStream->read1Byte(&pRI->flags) != 0)) {
- return JBIG2_ERROR_TOO_SHORT;
- }
- return JBIG2_SUCCESS;
-}
-JBig2HuffmanCode *CJBig2_Context::decodeSymbolIDHuffmanTable(CJBig2_BitStream *pStream,
- FX_DWORD SBNUMSYMS)
-{
- JBig2HuffmanCode *SBSYMCODES;
- FX_INT32 runcodes[35], runcodes_len[35], runcode;
- FX_INT32 i, j, nTemp, nVal, nBits;
- FX_INT32 run;
- SBSYMCODES = (JBig2HuffmanCode*)m_pModule->JBig2_Malloc2(sizeof(JBig2HuffmanCode), SBNUMSYMS);
- for (i = 0; i < 35; i ++) {
- if(pStream->readNBits(4, &runcodes_len[i]) != 0) {
- goto failed;
- }
- }
- huffman_assign_code(runcodes, runcodes_len, 35);
- i = 0;
- while(i < (int)SBNUMSYMS) {
- nVal = 0;
- nBits = 0;
- for(;;) {
- if(pStream->read1Bit(&nTemp) != 0) {
- goto failed;
- }
- nVal = (nVal << 1) | nTemp;
- nBits ++;
- for(j = 0; j < 35; j++) {
- if((nBits == runcodes_len[j]) && (nVal == runcodes[j])) {
- break;
- }
- }
- if(j < 35) {
- break;
- }
- }
- runcode = j;
- if(runcode < 32) {
- SBSYMCODES[i].codelen = runcode;
- run = 0;
- } else if(runcode == 32) {
- if(pStream->readNBits(2, &nTemp) != 0) {
- goto failed;
- }
- run = nTemp + 3;
- } else if(runcode == 33) {
- if(pStream->readNBits(3, &nTemp) != 0) {
- goto failed;
- }
- run = nTemp + 3;
- } else if(runcode == 34) {
- if(pStream->readNBits(7, &nTemp) != 0) {
- goto failed;
- }
- run = nTemp + 11;
- }
- if(run > 0) {
- if (i + run > (int)SBNUMSYMS) {
- goto failed;
- }
- for(j = 0; j < run; j++) {
- if(runcode == 32 && i > 0) {
- SBSYMCODES[i + j].codelen = SBSYMCODES[i - 1].codelen;
- } else {
- SBSYMCODES[i + j].codelen = 0;
- }
- }
- i += run;
- } else {
- i ++;
- }
- }
- huffman_assign_code(SBSYMCODES, SBNUMSYMS);
- return SBSYMCODES;
-failed:
- m_pModule->JBig2_Free(SBSYMCODES);
- return NULL;
-}
-void CJBig2_Context::huffman_assign_code(int* CODES, int* PREFLEN, int NTEMP)
-{
- int CURLEN, LENMAX, CURCODE, CURTEMP, i;
- int *LENCOUNT;
- int *FIRSTCODE;
- LENMAX = 0;
- for(i = 0; i < NTEMP; i++) {
- if(PREFLEN[i] > LENMAX) {
- LENMAX = PREFLEN[i];
- }
- }
- LENCOUNT = (int*)m_pModule->JBig2_Malloc2(sizeof(int), (LENMAX + 1));
- JBIG2_memset(LENCOUNT, 0, sizeof(int) * (LENMAX + 1));
- FIRSTCODE = (int*)m_pModule->JBig2_Malloc2(sizeof(int), (LENMAX + 1));
- for(i = 0; i < NTEMP; i++) {
- LENCOUNT[PREFLEN[i]] ++;
- }
- CURLEN = 1;
- FIRSTCODE[0] = 0;
- LENCOUNT[0] = 0;
- while(CURLEN <= LENMAX) {
- FIRSTCODE[CURLEN] = (FIRSTCODE[CURLEN - 1] + LENCOUNT[CURLEN - 1]) << 1;
- CURCODE = FIRSTCODE[CURLEN];
- CURTEMP = 0;
- while(CURTEMP < NTEMP) {
- if(PREFLEN[CURTEMP] == CURLEN) {
- CODES[CURTEMP] = CURCODE;
- CURCODE = CURCODE + 1;
- }
- CURTEMP = CURTEMP + 1;
- }
- CURLEN = CURLEN + 1;
- }
- m_pModule->JBig2_Free(LENCOUNT);
- m_pModule->JBig2_Free(FIRSTCODE);
-}
-void CJBig2_Context::huffman_assign_code(JBig2HuffmanCode *SBSYMCODES, int NTEMP)
-{
- int CURLEN, LENMAX, CURCODE, CURTEMP, i;
- int *LENCOUNT;
- int *FIRSTCODE;
- LENMAX = 0;
- for(i = 0; i < NTEMP; i++) {
- if(SBSYMCODES[i].codelen > LENMAX) {
- LENMAX = SBSYMCODES[i].codelen;
- }
- }
- LENCOUNT = (int*)m_pModule->JBig2_Malloc2(sizeof(int), (LENMAX + 1));
- JBIG2_memset(LENCOUNT, 0, sizeof(int) * (LENMAX + 1));
- FIRSTCODE = (int*)m_pModule->JBig2_Malloc2(sizeof(int), (LENMAX + 1));
- for(i = 0; i < NTEMP; i++) {
- LENCOUNT[SBSYMCODES[i].codelen] ++;
- }
- CURLEN = 1;
- FIRSTCODE[0] = 0;
- LENCOUNT[0] = 0;
- while(CURLEN <= LENMAX) {
- FIRSTCODE[CURLEN] = (FIRSTCODE[CURLEN - 1] + LENCOUNT[CURLEN - 1]) << 1;
- CURCODE = FIRSTCODE[CURLEN];
- CURTEMP = 0;
- while(CURTEMP < NTEMP) {
- if(SBSYMCODES[CURTEMP].codelen == CURLEN) {
- SBSYMCODES[CURTEMP].code = CURCODE;
- CURCODE = CURCODE + 1;
- }
- CURTEMP = CURTEMP + 1;
- }
- CURLEN = CURLEN + 1;
- }
- m_pModule->JBig2_Free(LENCOUNT);
- m_pModule->JBig2_Free(FIRSTCODE);
-}
+// 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
+
+#include "JBig2_Context.h"
+void OutputBitmap(CJBig2_Image* pImage)
+{
+ if(!pImage) {
+ return;
+ }
+}
+CJBig2_Context *CJBig2_Context::CreateContext(CJBig2_Module *pModule, FX_BYTE *pGlobalData, FX_DWORD dwGlobalLength,
+ FX_BYTE *pData, FX_DWORD dwLength, FX_INT32 nStreamType, IFX_Pause* pPause)
+{
+ return new(pModule) CJBig2_Context(pGlobalData, dwGlobalLength, pData, dwLength, nStreamType, pPause);
+}
+void CJBig2_Context::DestroyContext(CJBig2_Context *pContext)
+{
+ if(pContext) {
+ delete pContext;
+ }
+}
+CJBig2_Context::CJBig2_Context(FX_BYTE *pGlobalData, FX_DWORD dwGlobalLength,
+ FX_BYTE *pData, FX_DWORD dwLength, FX_INT32 nStreamType, IFX_Pause* pPause)
+{
+ if(pGlobalData && (dwGlobalLength > 0)) {
+ JBIG2_ALLOC(m_pGlobalContext, CJBig2_Context(NULL, 0, pGlobalData, dwGlobalLength,
+ JBIG2_EMBED_STREAM, pPause));
+ } else {
+ m_pGlobalContext = NULL;
+ }
+ JBIG2_ALLOC(m_pStream, CJBig2_BitStream(pData, dwLength));
+ m_nStreamType = nStreamType;
+ m_nState = JBIG2_OUT_OF_PAGE;
+ JBIG2_ALLOC(m_pSegmentList, CJBig2_List<CJBig2_Segment>);
+ JBIG2_ALLOC(m_pPageInfoList, CJBig2_List<JBig2PageInfo>(1));
+ m_pPage = NULL;
+ m_bBufSpecified = FALSE;
+ m_pPause = pPause;
+ m_nSegmentDecoded = 0;
+ m_PauseStep = 10;
+ m_pArithDecoder = NULL;
+ m_pGRD = NULL;
+ m_gbContext = NULL;
+ m_pSegment = NULL;
+ m_dwOffset = 0;
+ m_ProcessiveStatus = FXCODEC_STATUS_FRAME_READY;
+}
+CJBig2_Context::~CJBig2_Context()
+{
+ if(m_pArithDecoder) {
+ delete m_pArithDecoder;
+ }
+ m_pArithDecoder = NULL;
+ if(m_pGRD) {
+ delete m_pGRD;
+ }
+ m_pGRD = NULL;
+ if(m_gbContext) {
+ delete m_gbContext;
+ }
+ m_gbContext = NULL;
+ if(m_pGlobalContext) {
+ delete m_pGlobalContext;
+ }
+ m_pGlobalContext = NULL;
+ if(m_pPageInfoList) {
+ delete m_pPageInfoList;
+ }
+ m_pPageInfoList = NULL;
+ if(m_bBufSpecified && m_pPage) {
+ delete m_pPage;
+ }
+ m_pPage = NULL;
+ if(m_pStream) {
+ delete m_pStream;
+ }
+ m_pStream = NULL;
+ if(m_pSegmentList) {
+ delete m_pSegmentList;
+ }
+ m_pSegmentList = NULL;
+}
+FX_INT32 CJBig2_Context::decodeFile(IFX_Pause* pPause)
+{
+ FX_BYTE cFlags;
+ FX_DWORD dwTemp;
+ const FX_BYTE fileID[] = {0x97, 0x4A, 0x42, 0x32, 0x0D, 0x0A, 0x1A, 0x0A};
+ FX_INT32 nRet;
+ if(m_pStream->getByteLeft() < 8) {
+ m_pModule->JBig2_Error("file header too short.");
+ nRet = JBIG2_ERROR_TOO_SHORT;
+ goto failed;
+ }
+ if(JBIG2_memcmp(m_pStream->getPointer(), fileID, 8) != 0) {
+ m_pModule->JBig2_Error("not jbig2 file");
+ nRet = JBIG2_ERROR_FILE_FORMAT;
+ goto failed;
+ }
+ m_pStream->offset(8);
+ if(m_pStream->read1Byte(&cFlags) != 0) {
+ m_pModule->JBig2_Error("file header too short.");
+ nRet = JBIG2_ERROR_TOO_SHORT;
+ goto failed;
+ }
+ if(!(cFlags & 0x02)) {
+ if(m_pStream->readInteger(&dwTemp) != 0) {
+ m_pModule->JBig2_Error("file header too short.");
+ nRet = JBIG2_ERROR_TOO_SHORT;
+ goto failed;
+ }
+ if(dwTemp > 0) {
+ delete m_pPageInfoList;
+ JBIG2_ALLOC(m_pPageInfoList, CJBig2_List<JBig2PageInfo>(dwTemp));
+ }
+ }
+ if(cFlags & 0x01) {
+ m_nStreamType = JBIG2_SQUENTIAL_STREAM;
+ return decode_SquentialOrgnazation(pPause);
+ } else {
+ m_nStreamType = JBIG2_RANDOM_STREAM;
+ return decode_RandomOrgnazation_FirstPage(pPause);
+ }
+failed:
+ return nRet;
+}
+FX_INT32 CJBig2_Context::decode_SquentialOrgnazation(IFX_Pause* pPause)
+{
+ FX_INT32 nRet;
+ if(m_pStream->getByteLeft() > 0) {
+ while(m_pStream->getByteLeft() >= JBIG2_MIN_SEGMENT_SIZE) {
+ if(m_pSegment == NULL) {
+ JBIG2_ALLOC(m_pSegment, CJBig2_Segment());
+ nRet = parseSegmentHeader(m_pSegment);
+ if(nRet != JBIG2_SUCCESS) {
+ delete m_pSegment;
+ m_pSegment = NULL;
+ return nRet;
+ }
+ m_dwOffset = m_pStream->getOffset();
+ }
+ nRet = parseSegmentData(m_pSegment, pPause);
+ if(m_ProcessiveStatus == FXCODEC_STATUS_DECODE_TOBECONTINUE) {
+ m_ProcessiveStatus = FXCODEC_STATUS_DECODE_TOBECONTINUE;
+ m_PauseStep = 2;
+ return JBIG2_SUCCESS;
+ }
+ if((nRet == JBIG2_END_OF_PAGE) || (nRet == JBIG2_END_OF_FILE)) {
+ delete m_pSegment;
+ m_pSegment = NULL;
+ break;
+ } else if(nRet != JBIG2_SUCCESS) {
+ delete m_pSegment;
+ m_pSegment = NULL;
+ return nRet;
+ }
+ m_pSegmentList->addItem(m_pSegment);
+ if(m_pSegment->m_dwData_length != 0xffffffff) {
+ m_dwOffset = m_dwOffset + m_pSegment->m_dwData_length;
+ m_pStream->setOffset(m_dwOffset);
+ } else {
+ m_pStream->offset(4);
+ }
+ OutputBitmap(m_pPage);
+ m_pSegment = NULL;
+ if(m_pStream->getByteLeft() > 0 && m_pPage && pPause && pPause->NeedToPauseNow()) {
+ m_ProcessiveStatus = FXCODEC_STATUS_DECODE_TOBECONTINUE;
+ m_PauseStep = 2;
+ return JBIG2_SUCCESS;
+ }
+ }
+ } else {
+ return JBIG2_END_OF_FILE;
+ }
+ return JBIG2_SUCCESS;
+}
+FX_INT32 CJBig2_Context::decode_EmbedOrgnazation(IFX_Pause* pPause)
+{
+ return decode_SquentialOrgnazation(pPause);
+}
+FX_INT32 CJBig2_Context::decode_RandomOrgnazation_FirstPage(IFX_Pause* pPause)
+{
+ CJBig2_Segment *pSegment;
+ FX_INT32 nRet;
+ while(m_pStream->getByteLeft() > JBIG2_MIN_SEGMENT_SIZE) {
+ JBIG2_ALLOC(pSegment, CJBig2_Segment());
+ nRet = parseSegmentHeader(pSegment);
+ if(nRet != JBIG2_SUCCESS) {
+ delete pSegment;
+ return nRet;
+ } else if(pSegment->m_cFlags.s.type == 51) {
+ delete pSegment;
+ break;
+ }
+ m_pSegmentList->addItem(pSegment);
+ if(pPause && m_pPause && pPause->NeedToPauseNow()) {
+ m_PauseStep = 3;
+ m_ProcessiveStatus = FXCODEC_STATUS_DECODE_TOBECONTINUE;
+ return JBIG2_SUCCESS;
+ }
+ }
+ m_nSegmentDecoded = 0;
+ return decode_RandomOrgnazation(pPause);
+}
+FX_INT32 CJBig2_Context::decode_RandomOrgnazation(IFX_Pause* pPause)
+{
+ FX_INT32 nRet;
+ for(; m_nSegmentDecoded < m_pSegmentList->getLength(); m_nSegmentDecoded++) {
+ nRet = parseSegmentData(m_pSegmentList->getAt(m_nSegmentDecoded), pPause);
+ if((nRet == JBIG2_END_OF_PAGE) || (nRet == JBIG2_END_OF_FILE)) {
+ break;
+ } else if(nRet != JBIG2_SUCCESS) {
+ return nRet;
+ }
+ if(m_pPage && pPause && pPause->NeedToPauseNow()) {
+ m_PauseStep = 4;
+ m_ProcessiveStatus = FXCODEC_STATUS_DECODE_TOBECONTINUE;
+ return JBIG2_SUCCESS;
+ }
+ }
+ return JBIG2_SUCCESS;
+}
+FX_INT32 CJBig2_Context::getFirstPage(FX_BYTE *pBuf, FX_INT32 width, FX_INT32 height, FX_INT32 stride, IFX_Pause* pPause)
+{
+ FX_INT32 nRet = 0;
+ if(m_pGlobalContext) {
+ nRet = m_pGlobalContext->decode_EmbedOrgnazation(pPause);
+ if(nRet != JBIG2_SUCCESS) {
+ m_ProcessiveStatus = FXCODEC_STATUS_ERROR;
+ return nRet;
+ }
+ }
+ m_bFirstPage = TRUE;
+ m_PauseStep = 0;
+ if(m_pPage) {
+ delete m_pPage;
+ }
+ JBIG2_ALLOC(m_pPage, CJBig2_Image(width, height, stride, pBuf));
+ m_bBufSpecified = TRUE;
+ if(m_pPage && pPause && pPause->NeedToPauseNow()) {
+ m_PauseStep = 1;
+ m_ProcessiveStatus = FXCODEC_STATUS_DECODE_TOBECONTINUE;
+ return nRet;
+ }
+ int ret = Continue(pPause);
+ return ret;
+}
+FX_INT32 CJBig2_Context::Continue(IFX_Pause* pPause)
+{
+ m_ProcessiveStatus = FXCODEC_STATUS_DECODE_READY;
+ FX_INT32 nRet;
+ if(m_PauseStep <= 1) {
+ switch(m_nStreamType) {
+ case JBIG2_FILE_STREAM:
+ nRet = decodeFile(pPause);
+ break;
+ case JBIG2_SQUENTIAL_STREAM:
+ nRet = decode_SquentialOrgnazation(pPause);
+ break;
+ case JBIG2_RANDOM_STREAM:
+ if(m_bFirstPage) {
+ nRet = decode_RandomOrgnazation_FirstPage(pPause);
+ } else {
+ nRet = decode_RandomOrgnazation(pPause);
+ }
+ break;
+ case JBIG2_EMBED_STREAM:
+ nRet = decode_EmbedOrgnazation(pPause);
+ break;
+ default:
+ m_ProcessiveStatus = FXCODEC_STATUS_ERROR;
+ return JBIG2_ERROR_STREAM_TYPE;
+ }
+ } else if(m_PauseStep == 2) {
+ nRet = decode_SquentialOrgnazation(pPause);
+ } else if(m_PauseStep == 3) {
+ nRet = decode_RandomOrgnazation_FirstPage(pPause);
+ } else if(m_PauseStep == 4) {
+ nRet = decode_RandomOrgnazation(pPause);
+ } else if(m_PauseStep == 5) {
+ m_ProcessiveStatus = FXCODEC_STATUS_DECODE_FINISH;
+ return JBIG2_SUCCESS;
+ }
+ if(m_ProcessiveStatus == FXCODEC_STATUS_DECODE_TOBECONTINUE) {
+ return nRet;
+ }
+ m_PauseStep = 5;
+ if(!m_bBufSpecified && nRet == JBIG2_SUCCESS) {
+ m_ProcessiveStatus = FXCODEC_STATUS_DECODE_FINISH;
+ return JBIG2_SUCCESS;
+ }
+ if(nRet == JBIG2_SUCCESS) {
+ m_ProcessiveStatus = FXCODEC_STATUS_DECODE_FINISH;
+ } else {
+ m_ProcessiveStatus = FXCODEC_STATUS_ERROR;
+ }
+ return nRet;
+}
+FX_INT32 CJBig2_Context::getNextPage(FX_BYTE *pBuf, FX_INT32 width, FX_INT32 height, FX_INT32 stride, IFX_Pause* pPause)
+{
+ FX_INT32 nRet = JBIG2_ERROR_STREAM_TYPE;
+ m_bFirstPage = FALSE;
+ m_PauseStep = 0;
+ if(m_pPage) {
+ delete m_pPage;
+ }
+ JBIG2_ALLOC(m_pPage, CJBig2_Image(width, height, stride, pBuf));
+ m_bBufSpecified = TRUE;
+ if(m_pPage && pPause && pPause->NeedToPauseNow()) {
+ m_PauseStep = 1;
+ m_ProcessiveStatus = FXCODEC_STATUS_DECODE_TOBECONTINUE;
+ return nRet;
+ }
+ return Continue(pPause);
+ switch(m_nStreamType) {
+ case JBIG2_FILE_STREAM:
+ nRet = decodeFile(pPause);
+ break;
+ case JBIG2_SQUENTIAL_STREAM:
+ nRet = decode_SquentialOrgnazation(pPause);
+ break;
+ case JBIG2_RANDOM_STREAM:
+ nRet = decode_RandomOrgnazation(pPause);
+ break;
+ case JBIG2_EMBED_STREAM:
+ nRet = decode_EmbedOrgnazation(pPause);
+ break;
+ default:
+ return JBIG2_ERROR_STREAM_TYPE;
+ }
+ return nRet;
+}
+FX_INT32 CJBig2_Context::getFirstPage(CJBig2_Image **image, IFX_Pause* pPause)
+{
+ FX_INT32 nRet;
+ m_bFirstPage = TRUE;
+ m_PauseStep = 0;
+ if(m_pGlobalContext) {
+ nRet = m_pGlobalContext->decode_EmbedOrgnazation(pPause);
+ if(nRet != JBIG2_SUCCESS) {
+ return nRet;
+ }
+ }
+ m_bBufSpecified = FALSE;
+ return Continue(pPause);
+}
+FX_INT32 CJBig2_Context::getNextPage(CJBig2_Image **image, IFX_Pause* pPause)
+{
+ FX_INT32 nRet;
+ m_bBufSpecified = FALSE;
+ m_bFirstPage = FALSE;
+ m_PauseStep = 0;
+ switch(m_nStreamType) {
+ case JBIG2_FILE_STREAM:
+ nRet = decodeFile(pPause);
+ break;
+ case JBIG2_SQUENTIAL_STREAM:
+ nRet = decode_SquentialOrgnazation(pPause);
+ break;
+ case JBIG2_RANDOM_STREAM:
+ nRet = decode_RandomOrgnazation(pPause);
+ break;
+ case JBIG2_EMBED_STREAM:
+ nRet = decode_EmbedOrgnazation(pPause);
+ break;
+ default:
+ return JBIG2_ERROR_STREAM_TYPE;
+ }
+ if(nRet == JBIG2_SUCCESS) {
+ *image = m_pPage;
+ m_pPage = NULL;
+ return JBIG2_SUCCESS;
+ }
+ return nRet;
+}
+CJBig2_Segment *CJBig2_Context::findSegmentByNumber(FX_DWORD dwNumber)
+{
+ CJBig2_Segment *pSeg;
+ FX_INT32 i;
+ if(m_pGlobalContext) {
+ pSeg = m_pGlobalContext->findSegmentByNumber(dwNumber);
+ if(pSeg) {
+ return pSeg;
+ }
+ }
+ for(i = 0; i < m_pSegmentList->getLength(); i++) {
+ pSeg = m_pSegmentList->getAt(i);
+ if(pSeg->m_dwNumber == dwNumber) {
+ return pSeg;
+ }
+ }
+ return NULL;
+}
+CJBig2_Segment *CJBig2_Context::findReferredSegmentByTypeAndIndex(CJBig2_Segment *pSegment,
+ FX_BYTE cType, FX_INT32 nIndex)
+{
+ CJBig2_Segment *pSeg;
+ FX_INT32 i, count;
+ count = 0;
+ for(i = 0; i < pSegment->m_nReferred_to_segment_count; i++) {
+ pSeg = findSegmentByNumber(pSegment->m_pReferred_to_segment_numbers[i]);
+ if(pSeg && pSeg->m_cFlags.s.type == cType) {
+ if(count == nIndex) {
+ return pSeg;
+ } else {
+ count ++;
+ }
+ }
+ }
+ return NULL;
+}
+FX_INT32 CJBig2_Context::parseSegmentHeader(CJBig2_Segment *pSegment)
+{
+ FX_BYTE cSSize, cPSize;
+ FX_BYTE cTemp;
+ FX_WORD wTemp;
+ FX_DWORD dwTemp;
+ if((m_pStream->readInteger(&pSegment->m_dwNumber) != 0)
+ || (m_pStream->read1Byte(&pSegment->m_cFlags.c) != 0)) {
+ goto failed;
+ }
+ cTemp = m_pStream->getCurByte();
+ if((cTemp >> 5) == 7) {
+ if(m_pStream->readInteger((FX_DWORD*)&pSegment->m_nReferred_to_segment_count) != 0) {
+ goto failed;
+ }
+ pSegment->m_nReferred_to_segment_count &= 0x1fffffff;
+ if (pSegment->m_nReferred_to_segment_count > JBIG2_MAX_REFERRED_SEGMENT_COUNT) {
+ m_pModule->JBig2_Error("Too many referred segments.");
+ return JBIG2_ERROR_LIMIT;
+ }
+ dwTemp = 5 + 4 + (pSegment->m_nReferred_to_segment_count + 1) / 8;
+ } else {
+ if(m_pStream->read1Byte(&cTemp) != 0) {
+ goto failed;
+ }
+ pSegment->m_nReferred_to_segment_count = cTemp >> 5;
+ dwTemp = 5 + 1;
+ }
+ cSSize = pSegment->m_dwNumber > 65536 ? 4 : pSegment->m_dwNumber > 256 ? 2 : 1;
+ cPSize = pSegment->m_cFlags.s.page_association_size ? 4 : 1;
+ if(pSegment->m_nReferred_to_segment_count) {
+ pSegment->m_pReferred_to_segment_numbers = (FX_DWORD*)m_pModule->JBig2_Malloc2(
+ sizeof(FX_DWORD), pSegment->m_nReferred_to_segment_count);
+ for(FX_INT32 i = 0; i < pSegment->m_nReferred_to_segment_count; i++) {
+ switch(cSSize) {
+ case 1:
+ if(m_pStream->read1Byte(&cTemp) != 0) {
+ goto failed;
+ }
+ pSegment->m_pReferred_to_segment_numbers[i] = cTemp;
+ break;
+ case 2:
+ if(m_pStream->readShortInteger(&wTemp) != 0) {
+ goto failed;
+ }
+ pSegment->m_pReferred_to_segment_numbers[i] = wTemp;
+ break;
+ case 4:
+ if(m_pStream->readInteger(&dwTemp) != 0) {
+ goto failed;
+ }
+ pSegment->m_pReferred_to_segment_numbers[i] = dwTemp;
+ break;
+ }
+ if (pSegment->m_pReferred_to_segment_numbers[i] >= pSegment->m_dwNumber) {
+ m_pModule->JBig2_Error("The referred segment number is greater than this segment number.");
+ goto failed;
+ }
+ }
+ }
+ if(cPSize == 1) {
+ if(m_pStream->read1Byte(&cTemp) != 0) {
+ goto failed;
+ }
+ pSegment->m_dwPage_association = cTemp;
+ } else {
+ if(m_pStream->readInteger(&pSegment->m_dwPage_association) != 0) {
+ goto failed;
+ }
+ }
+ if(m_pStream->readInteger(&pSegment->m_dwData_length) != 0) {
+ goto failed;
+ }
+ pSegment->m_pData = m_pStream->getPointer();
+ pSegment->m_State = JBIG2_SEGMENT_DATA_UNPARSED;
+ return JBIG2_SUCCESS;
+failed:
+ m_pModule->JBig2_Error("header too short.");
+ return JBIG2_ERROR_TOO_SHORT;
+}
+FX_INT32 CJBig2_Context::parseSegmentData(CJBig2_Segment *pSegment, IFX_Pause* pPause)
+{
+ FX_INT32 ret = ProcessiveParseSegmentData(pSegment, pPause);
+ while(m_ProcessiveStatus == FXCODEC_STATUS_DECODE_TOBECONTINUE && m_pStream->getByteLeft() > 0) {
+ ret = ProcessiveParseSegmentData(pSegment, pPause);
+ }
+ return ret;
+}
+FX_INT32 CJBig2_Context::ProcessiveParseSegmentData(CJBig2_Segment *pSegment, IFX_Pause* pPause)
+{
+ switch(pSegment->m_cFlags.s.type) {
+ case 0:
+ return parseSymbolDict(pSegment, pPause);
+ case 4:
+ case 6:
+ case 7:
+ if(m_nState == JBIG2_OUT_OF_PAGE) {
+ goto failed2;
+ } else {
+ return parseTextRegion(pSegment);
+ }
+ case 16:
+ return parsePatternDict(pSegment, pPause);
+ case 20:
+ case 22:
+ case 23:
+ if(m_nState == JBIG2_OUT_OF_PAGE) {
+ goto failed2;
+ } else {
+ return parseHalftoneRegion(pSegment, pPause);
+ }
+ case 36:
+ case 38:
+ case 39:
+ if(m_nState == JBIG2_OUT_OF_PAGE) {
+ goto failed2;
+ } else {
+ return parseGenericRegion(pSegment, pPause);
+ }
+ case 40:
+ case 42:
+ case 43:
+ if(m_nState == JBIG2_OUT_OF_PAGE) {
+ goto failed2;
+ } else {
+ return parseGenericRefinementRegion(pSegment);
+ }
+ case 48: {
+ FX_WORD wTemp;
+ JBig2PageInfo *pPageInfo;
+ JBIG2_ALLOC(pPageInfo, JBig2PageInfo);
+ if((m_pStream->readInteger(&pPageInfo->m_dwWidth) != 0)
+ || (m_pStream->readInteger(&pPageInfo->m_dwHeight) != 0)
+ || (m_pStream->readInteger(&pPageInfo->m_dwResolutionX) != 0)
+ || (m_pStream->readInteger(&pPageInfo->m_dwResolutionY) != 0)
+ || (m_pStream->read1Byte(&pPageInfo->m_cFlags) != 0)
+ || (m_pStream->readShortInteger(&wTemp) != 0)) {
+ delete pPageInfo;
+ goto failed1;
+ }
+ pPageInfo->m_bIsStriped = ((wTemp >> 15) & 1) ? 1 : 0;
+ pPageInfo->m_wMaxStripeSize = wTemp & 0x7fff;
+ if((pPageInfo->m_dwHeight == 0xffffffff) && (pPageInfo->m_bIsStriped != 1)) {
+ m_pModule->JBig2_Warn("page height = 0xffffffff buf stripe field is 0");
+ pPageInfo->m_bIsStriped = 1;
+ }
+ if(!m_bBufSpecified) {
+ if(m_pPage) {
+ delete m_pPage;
+ }
+ if(pPageInfo->m_dwHeight == 0xffffffff) {
+ JBIG2_ALLOC(m_pPage, CJBig2_Image(pPageInfo->m_dwWidth, pPageInfo->m_wMaxStripeSize));
+ } else {
+ JBIG2_ALLOC(m_pPage, CJBig2_Image(pPageInfo->m_dwWidth, pPageInfo->m_dwHeight));
+ }
+ }
+ m_pPage->fill((pPageInfo->m_cFlags & 4) ? 1 : 0);
+ m_pPageInfoList->addItem(pPageInfo);
+ m_nState = JBIG2_IN_PAGE;
+ }
+ break;
+ case 49:
+ m_nState = JBIG2_OUT_OF_PAGE;
+ return JBIG2_END_OF_PAGE;
+ break;
+ case 50:
+ m_pStream->offset(pSegment->m_dwData_length);
+ break;
+ case 51:
+ return JBIG2_END_OF_FILE;
+ case 52:
+ m_pStream->offset(pSegment->m_dwData_length);
+ break;
+ case 53:
+ return parseTable(pSegment);
+ case 62:
+ m_pStream->offset(pSegment->m_dwData_length);
+ break;
+ default:
+ break;
+ }
+ return JBIG2_SUCCESS;
+failed1:
+ m_pModule->JBig2_Error("segment data too short.");
+ return JBIG2_ERROR_TOO_SHORT;
+failed2:
+ m_pModule->JBig2_Error("segment syntax error.");
+ return JBIG2_ERROR_FETAL;
+}
+FX_INT32 CJBig2_Context::parseSymbolDict(CJBig2_Segment *pSegment, IFX_Pause* pPause)
+{
+ FX_DWORD dwTemp;
+ FX_WORD wFlags;
+ FX_BYTE cSDHUFFDH, cSDHUFFDW, cSDHUFFBMSIZE, cSDHUFFAGGINST;
+ CJBig2_HuffmanTable *Table_B1 = NULL, *Table_B2 = NULL, *Table_B3 = NULL, *Table_B4 = NULL, *Table_B5 = NULL;
+ FX_INT32 i, nIndex, nRet;
+ CJBig2_Segment *pSeg = NULL, *pLRSeg = NULL;
+ FX_BOOL bUsed;
+ CJBig2_Image ** SDINSYMS = NULL;
+ CJBig2_SDDProc *pSymbolDictDecoder;
+ JBig2ArithCtx *gbContext = NULL, *grContext = NULL;
+ CJBig2_ArithDecoder *pArithDecoder;
+ JBIG2_ALLOC(pSymbolDictDecoder, CJBig2_SDDProc());
+ if(m_pStream->readShortInteger(&wFlags) != 0) {
+ m_pModule->JBig2_Error("symbol dictionary segment : data header too short.");
+ nRet = JBIG2_ERROR_TOO_SHORT;
+ goto failed;
+ }
+ pSymbolDictDecoder->SDHUFF = wFlags & 0x0001;
+ pSymbolDictDecoder->SDREFAGG = (wFlags >> 1) & 0x0001;
+ pSymbolDictDecoder->SDTEMPLATE = (wFlags >> 10) & 0x0003;
+ pSymbolDictDecoder->SDRTEMPLATE = (wFlags >> 12) & 0x0003;
+ cSDHUFFDH = (wFlags >> 2) & 0x0003;
+ cSDHUFFDW = (wFlags >> 4) & 0x0003;
+ cSDHUFFBMSIZE = (wFlags >> 6) & 0x0001;
+ cSDHUFFAGGINST = (wFlags >> 7) & 0x0001;
+ if(pSymbolDictDecoder->SDHUFF == 0) {
+ if(pSymbolDictDecoder->SDTEMPLATE == 0) {
+ dwTemp = 8;
+ } else {
+ dwTemp = 2;
+ }
+ for(i = 0; i < (FX_INT32)dwTemp; i++) {
+ if(m_pStream->read1Byte((FX_BYTE*)&pSymbolDictDecoder->SDAT[i]) != 0) {
+ m_pModule->JBig2_Error("symbol dictionary segment : data header too short.");
+ nRet = JBIG2_ERROR_TOO_SHORT;
+ goto failed;
+ }
+ }
+ }
+ if((pSymbolDictDecoder->SDREFAGG == 1) && (pSymbolDictDecoder->SDRTEMPLATE == 0)) {
+ for(i = 0; i < 4; i++) {
+ if(m_pStream->read1Byte((FX_BYTE*)&pSymbolDictDecoder->SDRAT[i]) != 0) {
+ m_pModule->JBig2_Error("symbol dictionary segment : data header too short.");
+ nRet = JBIG2_ERROR_TOO_SHORT;
+ goto failed;
+ }
+ }
+ }
+ if((m_pStream->readInteger(&pSymbolDictDecoder->SDNUMEXSYMS) != 0)
+ || (m_pStream->readInteger(&pSymbolDictDecoder->SDNUMNEWSYMS) != 0)) {
+ m_pModule->JBig2_Error("symbol dictionary segment : data header too short.");
+ nRet = JBIG2_ERROR_TOO_SHORT;
+ goto failed;
+ }
+ if (pSymbolDictDecoder->SDNUMEXSYMS > JBIG2_MAX_EXPORT_SYSMBOLS
+ || pSymbolDictDecoder->SDNUMNEWSYMS > JBIG2_MAX_NEW_SYSMBOLS) {
+ m_pModule->JBig2_Error("symbol dictionary segment : too many export/new symbols.");
+ nRet = JBIG2_ERROR_LIMIT;
+ goto failed;
+ }
+ for(i = 0; i < pSegment->m_nReferred_to_segment_count; i++) {
+ if(!findSegmentByNumber(pSegment->m_pReferred_to_segment_numbers[i])) {
+ m_pModule->JBig2_Error("symbol dictionary segment : can't find refered to segments");
+ nRet = JBIG2_ERROR_FETAL;
+ goto failed;
+ }
+ }
+ pSymbolDictDecoder->SDNUMINSYMS = 0;
+ for(i = 0; i < pSegment->m_nReferred_to_segment_count; i++) {
+ pSeg = findSegmentByNumber(pSegment->m_pReferred_to_segment_numbers[i]);
+ if(pSeg->m_cFlags.s.type == 0) {
+ pSymbolDictDecoder->SDNUMINSYMS += pSeg->m_Result.sd->SDNUMEXSYMS;
+ pLRSeg = pSeg;
+ }
+ }
+ if(pSymbolDictDecoder->SDNUMINSYMS == 0) {
+ SDINSYMS = NULL;
+ } else {
+ SDINSYMS = (CJBig2_Image**)m_pModule->JBig2_Malloc2(
+ sizeof(CJBig2_Image*), pSymbolDictDecoder->SDNUMINSYMS);
+ dwTemp = 0;
+ for(i = 0; i < pSegment->m_nReferred_to_segment_count; i++) {
+ pSeg = findSegmentByNumber(pSegment->m_pReferred_to_segment_numbers[i]);
+ if(pSeg->m_cFlags.s.type == 0) {
+ JBIG2_memcpy(SDINSYMS + dwTemp, pSeg->m_Result.sd->SDEXSYMS,
+ pSeg->m_Result.sd->SDNUMEXSYMS * sizeof(CJBig2_Image*));
+ dwTemp += pSeg->m_Result.sd->SDNUMEXSYMS;
+ }
+ }
+ }
+ pSymbolDictDecoder->SDINSYMS = SDINSYMS;
+ if(pSymbolDictDecoder->SDHUFF == 1) {
+ if((cSDHUFFDH == 2) || (cSDHUFFDW == 2)) {
+ m_pModule->JBig2_Error("symbol dictionary segment : SDHUFFDH=2 or SDHUFFDW=2 is not permitted.");
+ nRet = JBIG2_ERROR_FETAL;
+ goto failed;
+ }
+ nIndex = 0;
+ if(cSDHUFFDH == 0) {
+ JBIG2_ALLOC(Table_B4, CJBig2_HuffmanTable(HuffmanTable_B4,
+ sizeof(HuffmanTable_B4) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B4));
+ pSymbolDictDecoder->SDHUFFDH = Table_B4;
+ } else if(cSDHUFFDH == 1) {
+ JBIG2_ALLOC(Table_B5, CJBig2_HuffmanTable(HuffmanTable_B5,
+ sizeof(HuffmanTable_B5) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B5));
+ pSymbolDictDecoder->SDHUFFDH = Table_B5;
+ } else {
+ pSeg = findReferredSegmentByTypeAndIndex(pSegment, 53, nIndex++);
+ if(!pSeg) {
+ m_pModule->JBig2_Error("symbol dictionary segment : SDHUFFDH can't find user supplied table.");
+ nRet = JBIG2_ERROR_FETAL;
+ goto failed;
+ }
+ pSymbolDictDecoder->SDHUFFDH = pSeg->m_Result.ht;
+ }
+ if(cSDHUFFDW == 0) {
+ JBIG2_ALLOC(Table_B2, CJBig2_HuffmanTable(HuffmanTable_B2,
+ sizeof(HuffmanTable_B2) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B2));
+ pSymbolDictDecoder->SDHUFFDW = Table_B2;
+ } else if(cSDHUFFDW == 1) {
+ JBIG2_ALLOC(Table_B3, CJBig2_HuffmanTable(HuffmanTable_B3,
+ sizeof(HuffmanTable_B3) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B3));
+ pSymbolDictDecoder->SDHUFFDW = Table_B3;
+ } else {
+ pSeg = findReferredSegmentByTypeAndIndex(pSegment, 53, nIndex++);
+ if(!pSeg) {
+ m_pModule->JBig2_Error("symbol dictionary segment : SDHUFFDW can't find user supplied table.");
+ nRet = JBIG2_ERROR_FETAL;
+ goto failed;
+ }
+ pSymbolDictDecoder->SDHUFFDW = pSeg->m_Result.ht;
+ }
+ if(cSDHUFFBMSIZE == 0) {
+ JBIG2_ALLOC(Table_B1, CJBig2_HuffmanTable(HuffmanTable_B1,
+ sizeof(HuffmanTable_B1) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B1));
+ pSymbolDictDecoder->SDHUFFBMSIZE = Table_B1;
+ } else {
+ pSeg = findReferredSegmentByTypeAndIndex(pSegment, 53, nIndex++);
+ if(!pSeg) {
+ m_pModule->JBig2_Error("symbol dictionary segment : SDHUFFBMSIZE can't find user supplied table.");
+ nRet = JBIG2_ERROR_FETAL;
+ goto failed;
+ }
+ pSymbolDictDecoder->SDHUFFBMSIZE = pSeg->m_Result.ht;
+ }
+ if(pSymbolDictDecoder->SDREFAGG == 1) {
+ if(cSDHUFFAGGINST == 0) {
+ if(!Table_B1) {
+ JBIG2_ALLOC(Table_B1, CJBig2_HuffmanTable(HuffmanTable_B1,
+ sizeof(HuffmanTable_B1) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B1));
+ }
+ pSymbolDictDecoder->SDHUFFAGGINST = Table_B1;
+ } else {
+ pSeg = findReferredSegmentByTypeAndIndex(pSegment, 53, nIndex++);
+ if(!pSeg) {
+ m_pModule->JBig2_Error("symbol dictionary segment : SDHUFFAGGINST can't find user supplied table.");
+ nRet = JBIG2_ERROR_FETAL;
+ goto failed;
+ }
+ pSymbolDictDecoder->SDHUFFAGGINST = pSeg->m_Result.ht;
+ }
+ }
+ }
+ if((wFlags & 0x0100) && pLRSeg && pLRSeg->m_Result.sd->m_bContextRetained) {
+ if (pSymbolDictDecoder->SDHUFF == 0) {
+ dwTemp = pSymbolDictDecoder->SDTEMPLATE == 0 ? 65536 : pSymbolDictDecoder->SDTEMPLATE == 1 ?
+ 8192 : 1024;
+ gbContext = (JBig2ArithCtx*)m_pModule->JBig2_Malloc2(sizeof(JBig2ArithCtx), dwTemp);
+ JBIG2_memcpy(gbContext, pLRSeg->m_Result.sd->m_gbContext, sizeof(JBig2ArithCtx)*dwTemp);
+ }
+ if (pSymbolDictDecoder->SDREFAGG == 1) {
+ dwTemp = pSymbolDictDecoder->SDRTEMPLATE ? 1 << 10 : 1 << 13;
+ grContext = (JBig2ArithCtx*)m_pModule->JBig2_Malloc2(sizeof(JBig2ArithCtx), dwTemp);
+ JBIG2_memcpy(grContext, pLRSeg->m_Result.sd->m_grContext, sizeof(JBig2ArithCtx)*dwTemp);
+ }
+ } else {
+ if (pSymbolDictDecoder->SDHUFF == 0) {
+ dwTemp = pSymbolDictDecoder->SDTEMPLATE == 0 ? 65536 : pSymbolDictDecoder->SDTEMPLATE == 1 ?
+ 8192 : 1024;
+ gbContext = (JBig2ArithCtx*)m_pModule->JBig2_Malloc2(sizeof(JBig2ArithCtx), dwTemp);
+ JBIG2_memset(gbContext, 0, sizeof(JBig2ArithCtx)*dwTemp);
+ }
+ if (pSymbolDictDecoder->SDREFAGG == 1) {
+ dwTemp = pSymbolDictDecoder->SDRTEMPLATE ? 1 << 10 : 1 << 13;
+ grContext = (JBig2ArithCtx*)m_pModule->JBig2_Malloc2(sizeof(JBig2ArithCtx), dwTemp);
+ JBIG2_memset(grContext, 0, sizeof(JBig2ArithCtx)*dwTemp);
+ }
+ }
+ pSegment->m_nResultType = JBIG2_SYMBOL_DICT_POINTER;
+ if(pSymbolDictDecoder->SDHUFF == 0) {
+ JBIG2_ALLOC(pArithDecoder, CJBig2_ArithDecoder(m_pStream));
+ pSegment->m_Result.sd = pSymbolDictDecoder->decode_Arith(pArithDecoder, gbContext, grContext);
+ delete pArithDecoder;
+ if(pSegment->m_Result.sd == NULL) {
+ nRet = JBIG2_ERROR_FETAL;
+ goto failed;
+ }
+ m_pStream->alignByte();
+ m_pStream->offset(2);
+ } else {
+ pSegment->m_Result.sd = pSymbolDictDecoder->decode_Huffman(m_pStream, gbContext, grContext, pPause);
+ if(pSegment->m_Result.sd == NULL) {
+ nRet = JBIG2_ERROR_FETAL;
+ goto failed;
+ }
+ m_pStream->alignByte();
+ }
+ if(wFlags & 0x0200) {
+ pSegment->m_Result.sd->m_bContextRetained = TRUE;
+ if(pSymbolDictDecoder->SDHUFF == 0) {
+ pSegment->m_Result.sd->m_gbContext = gbContext;
+ }
+ if(pSymbolDictDecoder->SDREFAGG == 1) {
+ pSegment->m_Result.sd->m_grContext = grContext;
+ }
+ bUsed = TRUE;
+ } else {
+ bUsed = FALSE;
+ }
+ delete pSymbolDictDecoder;
+ if(SDINSYMS) {
+ m_pModule->JBig2_Free(SDINSYMS);
+ }
+ if(Table_B1) {
+ delete Table_B1;
+ }
+ if(Table_B2) {
+ delete Table_B2;
+ }
+ if(Table_B3) {
+ delete Table_B3;
+ }
+ if(Table_B4) {
+ delete Table_B4;
+ }
+ if(Table_B5) {
+ delete Table_B5;
+ }
+ if(bUsed == FALSE) {
+ if(gbContext) {
+ m_pModule->JBig2_Free(gbContext);
+ }
+ if(grContext) {
+ m_pModule->JBig2_Free(grContext);
+ }
+ }
+ return JBIG2_SUCCESS;
+failed:
+ delete pSymbolDictDecoder;
+ if(SDINSYMS) {
+ m_pModule->JBig2_Free(SDINSYMS);
+ }
+ if(Table_B1) {
+ delete Table_B1;
+ }
+ if(Table_B2) {
+ delete Table_B2;
+ }
+ if(Table_B3) {
+ delete Table_B3;
+ }
+ if(Table_B4) {
+ delete Table_B4;
+ }
+ if(Table_B5) {
+ delete Table_B5;
+ }
+ if(gbContext) {
+ m_pModule->JBig2_Free(gbContext);
+ }
+ if(grContext) {
+ m_pModule->JBig2_Free(grContext);
+ }
+ return nRet;
+}
+
+FX_BOOL CJBig2_Context::parseTextRegion(CJBig2_Segment *pSegment)
+{
+ FX_DWORD dwTemp;
+ FX_WORD wFlags;
+ FX_INT32 i, nIndex, nRet;
+ JBig2RegionInfo ri;
+ CJBig2_Segment *pSeg;
+ CJBig2_Image **SBSYMS = NULL;
+ JBig2HuffmanCode *SBSYMCODES = NULL;
+ FX_BYTE cSBHUFFFS, cSBHUFFDS, cSBHUFFDT, cSBHUFFRDW, cSBHUFFRDH, cSBHUFFRDX, cSBHUFFRDY, cSBHUFFRSIZE;
+ CJBig2_HuffmanTable *Table_B1 = NULL,
+ *Table_B6 = NULL,
+ *Table_B7 = NULL,
+ *Table_B8 = NULL,
+ *Table_B9 = NULL,
+ *Table_B10 = NULL,
+ *Table_B11 = NULL,
+ *Table_B12 = NULL,
+ *Table_B13 = NULL,
+ *Table_B14 = NULL,
+ *Table_B15 = NULL;
+ JBig2ArithCtx *grContext = NULL;
+ CJBig2_ArithDecoder *pArithDecoder;
+ CJBig2_TRDProc *pTRD;
+ JBIG2_ALLOC(pTRD, CJBig2_TRDProc());
+ if((parseRegionInfo(&ri) != JBIG2_SUCCESS)
+ || (m_pStream->readShortInteger(&wFlags) != 0)) {
+ m_pModule->JBig2_Error("text region segment : data header too short.");
+ nRet = JBIG2_ERROR_TOO_SHORT;
+ goto failed;
+ }
+ pTRD->SBW = ri.width;
+ pTRD->SBH = ri.height;
+ pTRD->SBHUFF = wFlags & 0x0001;
+ pTRD->SBREFINE = (wFlags >> 1) & 0x0001;
+ dwTemp = (wFlags >> 2) & 0x0003;
+ pTRD->SBSTRIPS = 1 << dwTemp;
+ pTRD->REFCORNER = (JBig2Corner)((wFlags >> 4) & 0x0003);
+ pTRD->TRANSPOSED = (wFlags >> 6) & 0x0001;
+ pTRD->SBCOMBOP = (JBig2ComposeOp)((wFlags >> 7) & 0x0003);
+ pTRD->SBDEFPIXEL = (wFlags >> 9) & 0x0001;
+ pTRD->SBDSOFFSET = (wFlags >> 10) & 0x001f;
+ if(pTRD->SBDSOFFSET >= 0x0010) {
+ pTRD->SBDSOFFSET = pTRD->SBDSOFFSET - 0x0020;
+ }
+ pTRD->SBRTEMPLATE = (wFlags >> 15) & 0x0001;
+ if(pTRD->SBHUFF == 1) {
+ if(m_pStream->readShortInteger(&wFlags) != 0) {
+ m_pModule->JBig2_Error("text region segment : data header too short.");
+ nRet = JBIG2_ERROR_TOO_SHORT;
+ goto failed;
+ }
+ cSBHUFFFS = wFlags & 0x0003;
+ cSBHUFFDS = (wFlags >> 2) & 0x0003;
+ cSBHUFFDT = (wFlags >> 4) & 0x0003;
+ cSBHUFFRDW = (wFlags >> 6) & 0x0003;
+ cSBHUFFRDH = (wFlags >> 8) & 0x0003;
+ cSBHUFFRDX = (wFlags >> 10) & 0x0003;
+ cSBHUFFRDY = (wFlags >> 12) & 0x0003;
+ cSBHUFFRSIZE = (wFlags >> 14) & 0x0001;
+ }
+ if((pTRD->SBREFINE == 1) && (pTRD->SBRTEMPLATE == 0)) {
+ for(i = 0; i < 4; i++) {
+ if(m_pStream->read1Byte((FX_BYTE*)&pTRD->SBRAT[i]) != 0) {
+ m_pModule->JBig2_Error("text region segment : data header too short.");
+ nRet = JBIG2_ERROR_TOO_SHORT;
+ goto failed;
+ }
+ }
+ }
+ if(m_pStream->readInteger(&pTRD->SBNUMINSTANCES) != 0) {
+ m_pModule->JBig2_Error("text region segment : data header too short.");
+ nRet = JBIG2_ERROR_TOO_SHORT;
+ goto failed;
+ }
+ for(i = 0; i < pSegment->m_nReferred_to_segment_count; i++) {
+ if(!findSegmentByNumber(pSegment->m_pReferred_to_segment_numbers[i])) {
+ m_pModule->JBig2_Error("text region segment : can't find refered to segments");
+ nRet = JBIG2_ERROR_FETAL;
+ goto failed;
+ }
+ }
+ pTRD->SBNUMSYMS = 0;
+ for(i = 0; i < pSegment->m_nReferred_to_segment_count; i++) {
+ pSeg = findSegmentByNumber(pSegment->m_pReferred_to_segment_numbers[i]);
+ if(pSeg->m_cFlags.s.type == 0) {
+ pTRD->SBNUMSYMS += pSeg->m_Result.sd->SDNUMEXSYMS;
+ }
+ }
+ if (pTRD->SBNUMSYMS > 0) {
+ SBSYMS = (CJBig2_Image**)m_pModule->JBig2_Malloc2(
+ sizeof(CJBig2_Image*), pTRD->SBNUMSYMS);
+ dwTemp = 0;
+ for(i = 0; i < pSegment->m_nReferred_to_segment_count; i++) {
+ pSeg = findSegmentByNumber(pSegment->m_pReferred_to_segment_numbers[i]);
+ if(pSeg->m_cFlags.s.type == 0) {
+ JBIG2_memcpy(SBSYMS + dwTemp, pSeg->m_Result.sd->SDEXSYMS,
+ pSeg->m_Result.sd->SDNUMEXSYMS * sizeof(CJBig2_Image*));
+ dwTemp += pSeg->m_Result.sd->SDNUMEXSYMS;
+ }
+ }
+ pTRD->SBSYMS = SBSYMS;
+ } else {
+ pTRD->SBSYMS = NULL;
+ }
+ if(pTRD->SBHUFF == 1) {
+ SBSYMCODES = decodeSymbolIDHuffmanTable(m_pStream, pTRD->SBNUMSYMS);
+ if(SBSYMCODES == NULL) {
+ m_pModule->JBig2_Error("text region segment: symbol ID huffman table decode failure!");
+ nRet = JBIG2_ERROR_FETAL;
+ goto failed;
+ }
+ m_pStream->alignByte();
+ pTRD->SBSYMCODES = SBSYMCODES;
+ } else {
+ dwTemp = 0;
+ while((FX_DWORD)(1 << dwTemp) < pTRD->SBNUMSYMS) {
+ dwTemp ++;
+ }
+ pTRD->SBSYMCODELEN = (FX_BYTE)dwTemp;
+ }
+ if(pTRD->SBHUFF == 1) {
+ if((cSBHUFFFS == 2) || (cSBHUFFRDW == 2) || (cSBHUFFRDH == 2)
+ || (cSBHUFFRDX == 2) || (cSBHUFFRDY == 2)) {
+ m_pModule->JBig2_Error("text region segment : SBHUFFFS=2 or SBHUFFRDW=2 or "
+ "SBHUFFRDH=2 or SBHUFFRDX=2 or SBHUFFRDY=2 is not permitted");
+ nRet = JBIG2_ERROR_FETAL;
+ goto failed;
+ }
+ nIndex = 0;
+ if(cSBHUFFFS == 0) {
+ JBIG2_ALLOC(Table_B6, CJBig2_HuffmanTable(HuffmanTable_B6,
+ sizeof(HuffmanTable_B6) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B6));
+ pTRD->SBHUFFFS = Table_B6;
+ } else if(cSBHUFFFS == 1) {
+ JBIG2_ALLOC(Table_B7, CJBig2_HuffmanTable(HuffmanTable_B7,
+ sizeof(HuffmanTable_B7) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B7));
+ pTRD->SBHUFFFS = Table_B7;
+ } else {
+ pSeg = findReferredSegmentByTypeAndIndex(pSegment, 53, nIndex++);
+ if(!pSeg) {
+ m_pModule->JBig2_Error("text region segment : SBHUFFFS can't find user supplied table");
+ nRet = JBIG2_ERROR_FETAL;
+ goto failed;
+ }
+ pTRD->SBHUFFFS = pSeg->m_Result.ht;
+ }
+ if(cSBHUFFDS == 0) {
+ JBIG2_ALLOC(Table_B8, CJBig2_HuffmanTable(HuffmanTable_B8,
+ sizeof(HuffmanTable_B8) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B8));
+ pTRD->SBHUFFDS = Table_B8;
+ } else if(cSBHUFFDS == 1) {
+ JBIG2_ALLOC(Table_B9, CJBig2_HuffmanTable(HuffmanTable_B9,
+ sizeof(HuffmanTable_B9) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B9));
+ pTRD->SBHUFFDS = Table_B9;
+ } else if(cSBHUFFDS == 2) {
+ JBIG2_ALLOC(Table_B10, CJBig2_HuffmanTable(HuffmanTable_B10,
+ sizeof(HuffmanTable_B10) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B10));
+ pTRD->SBHUFFDS = Table_B10;
+ } else {
+ pSeg = findReferredSegmentByTypeAndIndex(pSegment, 53, nIndex++);
+ if(!pSeg) {
+ m_pModule->JBig2_Error("text region segment : SBHUFFDS can't find user supplied table");
+ nRet = JBIG2_ERROR_FETAL;
+ goto failed;
+ }
+ pTRD->SBHUFFDS = pSeg->m_Result.ht;
+ }
+ if(cSBHUFFDT == 0) {
+ JBIG2_ALLOC(Table_B11, CJBig2_HuffmanTable(HuffmanTable_B11,
+ sizeof(HuffmanTable_B11) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B11));
+ pTRD->SBHUFFDT = Table_B11;
+ } else if(cSBHUFFDT == 1) {
+ JBIG2_ALLOC(Table_B12, CJBig2_HuffmanTable(HuffmanTable_B12,
+ sizeof(HuffmanTable_B12) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B12));
+ pTRD->SBHUFFDT = Table_B12;
+ } else if(cSBHUFFDT == 2) {
+ JBIG2_ALLOC(Table_B13, CJBig2_HuffmanTable(HuffmanTable_B13,
+ sizeof(HuffmanTable_B13) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B13));
+ pTRD->SBHUFFDT = Table_B13;
+ } else {
+ pSeg = findReferredSegmentByTypeAndIndex(pSegment, 53, nIndex++);
+ if(!pSeg) {
+ m_pModule->JBig2_Error("text region segment : SBHUFFDT can't find user supplied table");
+ nRet = JBIG2_ERROR_FETAL;
+ goto failed;
+ }
+ pTRD->SBHUFFDT = pSeg->m_Result.ht;
+ }
+ if(cSBHUFFRDW == 0) {
+ JBIG2_ALLOC(Table_B14, CJBig2_HuffmanTable(HuffmanTable_B14,
+ sizeof(HuffmanTable_B14) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B14));
+ pTRD->SBHUFFRDW = Table_B14;
+ } else if(cSBHUFFRDW == 1) {
+ JBIG2_ALLOC(Table_B15, CJBig2_HuffmanTable(HuffmanTable_B15,
+ sizeof(HuffmanTable_B15) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B15));
+ pTRD->SBHUFFRDW = Table_B15;
+ } else {
+ pSeg = findReferredSegmentByTypeAndIndex(pSegment, 53, nIndex++);
+ if(!pSeg) {
+ m_pModule->JBig2_Error("text region segment : SBHUFFRDW can't find user supplied table");
+ nRet = JBIG2_ERROR_FETAL;
+ goto failed;
+ }
+ pTRD->SBHUFFRDW = pSeg->m_Result.ht;
+ }
+ if(cSBHUFFRDH == 0) {
+ if(!Table_B14) {
+ JBIG2_ALLOC(Table_B14, CJBig2_HuffmanTable(HuffmanTable_B14,
+ sizeof(HuffmanTable_B14) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B14));
+ }
+ pTRD->SBHUFFRDH = Table_B14;
+ } else if(cSBHUFFRDH == 1) {
+ if(!Table_B15) {
+ JBIG2_ALLOC(Table_B15, CJBig2_HuffmanTable(HuffmanTable_B15,
+ sizeof(HuffmanTable_B15) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B15));
+ }
+ pTRD->SBHUFFRDH = Table_B15;
+ } else {
+ pSeg = findReferredSegmentByTypeAndIndex(pSegment, 53, nIndex++);
+ if(!pSeg) {
+ m_pModule->JBig2_Error("text region segment : SBHUFFRDH can't find user supplied table");
+ nRet = JBIG2_ERROR_FETAL;
+ goto failed;
+ }
+ pTRD->SBHUFFRDH = pSeg->m_Result.ht;
+ }
+ if(cSBHUFFRDX == 0) {
+ if(!Table_B14) {
+ JBIG2_ALLOC(Table_B14, CJBig2_HuffmanTable(HuffmanTable_B14,
+ sizeof(HuffmanTable_B14) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B14));
+ }
+ pTRD->SBHUFFRDX = Table_B14;
+ } else if(cSBHUFFRDX == 1) {
+ if(!Table_B15) {
+ JBIG2_ALLOC(Table_B15, CJBig2_HuffmanTable(HuffmanTable_B15,
+ sizeof(HuffmanTable_B15) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B15));
+ }
+ pTRD->SBHUFFRDX = Table_B15;
+ } else {
+ pSeg = findReferredSegmentByTypeAndIndex(pSegment, 53, nIndex++);
+ if(!pSeg) {
+ m_pModule->JBig2_Error("text region segment : SBHUFFRDX can't find user supplied table");
+ nRet = JBIG2_ERROR_FETAL;
+ goto failed;
+ }
+ pTRD->SBHUFFRDX = pSeg->m_Result.ht;
+ }
+ if(cSBHUFFRDY == 0) {
+ if(!Table_B14) {
+ JBIG2_ALLOC(Table_B14, CJBig2_HuffmanTable(HuffmanTable_B14,
+ sizeof(HuffmanTable_B14) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B14));
+ }
+ pTRD->SBHUFFRDY = Table_B14;
+ } else if(cSBHUFFRDY == 1) {
+ if(!Table_B15) {
+ JBIG2_ALLOC(Table_B15, CJBig2_HuffmanTable(HuffmanTable_B15,
+ sizeof(HuffmanTable_B15) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B15));
+ }
+ pTRD->SBHUFFRDY = Table_B15;
+ } else {
+ pSeg = findReferredSegmentByTypeAndIndex(pSegment, 53, nIndex++);
+ if(!pSeg) {
+ m_pModule->JBig2_Error("text region segment : SBHUFFRDY can't find user supplied table");
+ nRet = JBIG2_ERROR_FETAL;
+ goto failed;
+ }
+ pTRD->SBHUFFRDY = pSeg->m_Result.ht;
+ }
+ if(cSBHUFFRSIZE == 0) {
+ JBIG2_ALLOC(Table_B1, CJBig2_HuffmanTable(HuffmanTable_B1,
+ sizeof(HuffmanTable_B1) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B1));
+ pTRD->SBHUFFRSIZE = Table_B1;
+ } else {
+ pSeg = findReferredSegmentByTypeAndIndex(pSegment, 53, nIndex++);
+ if(!pSeg) {
+ m_pModule->JBig2_Error("text region segment : SBHUFFRSIZE can't find user supplied table");
+ nRet = JBIG2_ERROR_FETAL;
+ goto failed;
+ }
+ pTRD->SBHUFFRSIZE = pSeg->m_Result.ht;
+ }
+ }
+ if(pTRD->SBREFINE == 1) {
+ dwTemp = pTRD->SBRTEMPLATE ? 1 << 10 : 1 << 13;
+ grContext = (JBig2ArithCtx*)m_pModule->JBig2_Malloc2(sizeof(JBig2ArithCtx), dwTemp);
+ JBIG2_memset(grContext, 0, sizeof(JBig2ArithCtx)*dwTemp);
+ }
+ if(pTRD->SBHUFF == 0) {
+ JBIG2_ALLOC(pArithDecoder, CJBig2_ArithDecoder(m_pStream));
+ pSegment->m_nResultType = JBIG2_IMAGE_POINTER;
+ pSegment->m_Result.im = pTRD->decode_Arith(pArithDecoder, grContext);
+ delete pArithDecoder;
+ if(pSegment->m_Result.im == NULL) {
+ nRet = JBIG2_ERROR_FETAL;
+ goto failed;
+ }
+ m_pStream->alignByte();
+ m_pStream->offset(2);
+ } else {
+ pSegment->m_nResultType = JBIG2_IMAGE_POINTER;
+ pSegment->m_Result.im = pTRD->decode_Huffman(m_pStream, grContext);
+ if(pSegment->m_Result.im == NULL) {
+ nRet = JBIG2_ERROR_FETAL;
+ goto failed;
+ }
+ m_pStream->alignByte();
+ }
+ if(pSegment->m_cFlags.s.type != 4) {
+ if(!m_bBufSpecified) {
+ JBig2PageInfo *pPageInfo = m_pPageInfoList->getLast();
+ if ((pPageInfo->m_bIsStriped == 1) && (ri.y + ri.height > m_pPage->m_nHeight)) {
+ m_pPage->expand(ri.y + ri.height, (pPageInfo->m_cFlags & 4) ? 1 : 0);
+ }
+ }
+ m_pPage->composeFrom(ri.x, ri.y, pSegment->m_Result.im, (JBig2ComposeOp)(ri.flags & 0x03));
+ delete pSegment->m_Result.im;
+ pSegment->m_Result.im = NULL;
+ }
+ delete pTRD;
+ if(SBSYMS) {
+ m_pModule->JBig2_Free(SBSYMS);
+ }
+ if(SBSYMCODES) {
+ m_pModule->JBig2_Free(SBSYMCODES);
+ }
+ if(grContext) {
+ m_pModule->JBig2_Free(grContext);
+ }
+ if(Table_B1) {
+ delete Table_B1;
+ }
+ if(Table_B6) {
+ delete Table_B6;
+ }
+ if(Table_B7) {
+ delete Table_B7;
+ }
+ if(Table_B8) {
+ delete Table_B8;
+ }
+ if(Table_B9) {
+ delete Table_B9;
+ }
+ if(Table_B10) {
+ delete Table_B10;
+ }
+ if(Table_B11) {
+ delete Table_B11;
+ }
+ if(Table_B12) {
+ delete Table_B12;
+ }
+ if(Table_B13) {
+ delete Table_B13;
+ }
+ if(Table_B14) {
+ delete Table_B14;
+ }
+ if(Table_B15) {
+ delete Table_B15;
+ }
+ return JBIG2_SUCCESS;
+failed:
+ delete pTRD;
+ if(SBSYMS) {
+ m_pModule->JBig2_Free(SBSYMS);
+ }
+ if(SBSYMCODES) {
+ m_pModule->JBig2_Free(SBSYMCODES);
+ }
+ if(grContext) {
+ m_pModule->JBig2_Free(grContext);
+ }
+ if(Table_B1) {
+ delete Table_B1;
+ }
+ if(Table_B6) {
+ delete Table_B6;
+ }
+ if(Table_B7) {
+ delete Table_B7;
+ }
+ if(Table_B8) {
+ delete Table_B8;
+ }
+ if(Table_B9) {
+ delete Table_B9;
+ }
+ if(Table_B10) {
+ delete Table_B10;
+ }
+ if(Table_B11) {
+ delete Table_B11;
+ }
+ if(Table_B12) {
+ delete Table_B12;
+ }
+ if(Table_B13) {
+ delete Table_B13;
+ }
+ if(Table_B14) {
+ delete Table_B14;
+ }
+ if(Table_B15) {
+ delete Table_B15;
+ }
+ return nRet;
+}
+
+FX_BOOL CJBig2_Context::parsePatternDict(CJBig2_Segment *pSegment, IFX_Pause* pPause)
+{
+ FX_DWORD dwTemp;
+ FX_BYTE cFlags;
+ JBig2ArithCtx *gbContext;
+ CJBig2_ArithDecoder *pArithDecoder;
+ CJBig2_PDDProc *pPDD;
+ FX_INT32 nRet;
+ JBIG2_ALLOC(pPDD, CJBig2_PDDProc());
+ if((m_pStream->read1Byte(&cFlags) != 0)
+ || (m_pStream->read1Byte(&pPDD->HDPW) != 0)
+ || (m_pStream->read1Byte(&pPDD->HDPH) != 0)
+ || (m_pStream->readInteger(&pPDD->GRAYMAX) != 0)) {
+ m_pModule->JBig2_Error("pattern dictionary segment : data header too short.");
+ nRet = JBIG2_ERROR_TOO_SHORT;
+ goto failed;
+ }
+ if (pPDD->GRAYMAX > JBIG2_MAX_PATTERN_INDEX) {
+ m_pModule->JBig2_Error("pattern dictionary segment : too max gray max.");
+ nRet = JBIG2_ERROR_LIMIT;
+ goto failed;
+ }
+ pPDD->HDMMR = cFlags & 0x01;
+ pPDD->HDTEMPLATE = (cFlags >> 1) & 0x03;
+ pSegment->m_nResultType = JBIG2_PATTERN_DICT_POINTER;
+ if(pPDD->HDMMR == 0) {
+ dwTemp = pPDD->HDTEMPLATE == 0 ? 65536 : pPDD->HDTEMPLATE == 1 ? 8192 : 1024;
+ gbContext = (JBig2ArithCtx*)m_pModule->JBig2_Malloc2(sizeof(JBig2ArithCtx), dwTemp);
+ JBIG2_memset(gbContext, 0, sizeof(JBig2ArithCtx)*dwTemp);
+ JBIG2_ALLOC(pArithDecoder, CJBig2_ArithDecoder(m_pStream));
+ pSegment->m_Result.pd = pPDD->decode_Arith(pArithDecoder, gbContext, pPause);
+ delete pArithDecoder;
+ if(pSegment->m_Result.pd == NULL) {
+ m_pModule->JBig2_Free(gbContext);
+ nRet = JBIG2_ERROR_FETAL;
+ goto failed;
+ }
+ m_pModule->JBig2_Free(gbContext);
+ m_pStream->alignByte();
+ m_pStream->offset(2);
+ } else {
+ pSegment->m_Result.pd = pPDD->decode_MMR(m_pStream, pPause);
+ if(pSegment->m_Result.pd == NULL) {
+ nRet = JBIG2_ERROR_FETAL;
+ goto failed;
+ }
+ m_pStream->alignByte();
+ }
+ delete pPDD;
+ return JBIG2_SUCCESS;
+failed:
+ delete pPDD;
+ return nRet;
+}
+FX_BOOL CJBig2_Context::parseHalftoneRegion(CJBig2_Segment *pSegment, IFX_Pause* pPause)
+{
+ FX_DWORD dwTemp;
+ FX_BYTE cFlags;
+ JBig2RegionInfo ri;
+ CJBig2_Segment *pSeg;
+ CJBig2_PatternDict *pPatternDict;
+ JBig2ArithCtx *gbContext;
+ CJBig2_ArithDecoder *pArithDecoder;
+ CJBig2_HTRDProc *pHRD;
+ FX_INT32 nRet;
+ JBIG2_ALLOC(pHRD, CJBig2_HTRDProc());
+ if((parseRegionInfo(&ri) != JBIG2_SUCCESS)
+ || (m_pStream->read1Byte(&cFlags) != 0)
+ || (m_pStream->readInteger(&pHRD->HGW) != 0)
+ || (m_pStream->readInteger(&pHRD->HGH) != 0)
+ || (m_pStream->readInteger((FX_DWORD*)&pHRD->HGX) != 0)
+ || (m_pStream->readInteger((FX_DWORD*)&pHRD->HGY) != 0)
+ || (m_pStream->readShortInteger(&pHRD->HRX) != 0)
+ || (m_pStream->readShortInteger(&pHRD->HRY) != 0)) {
+ m_pModule->JBig2_Error("halftone region segment : data header too short.");
+ nRet = JBIG2_ERROR_TOO_SHORT;
+ goto failed;
+ }
+ pHRD->HBW = ri.width;
+ pHRD->HBH = ri.height;
+ pHRD->HMMR = cFlags & 0x01;
+ pHRD->HTEMPLATE = (cFlags >> 1) & 0x03;
+ pHRD->HENABLESKIP = (cFlags >> 3) & 0x01;
+ pHRD->HCOMBOP = (JBig2ComposeOp)((cFlags >> 4) & 0x07);
+ pHRD->HDEFPIXEL = (cFlags >> 7) & 0x01;
+ if(pSegment->m_nReferred_to_segment_count != 1) {
+ m_pModule->JBig2_Error("halftone region segment : refered to segment count not equals 1");
+ nRet = JBIG2_ERROR_FETAL;
+ goto failed;
+ }
+ pSeg = findSegmentByNumber(pSegment->m_pReferred_to_segment_numbers[0]);
+ if( (pSeg == NULL) || (pSeg->m_cFlags.s.type != 16)) {
+ m_pModule->JBig2_Error("halftone region segment : refered to segment is not pattern dict");
+ nRet = JBIG2_ERROR_FETAL;
+ goto failed;
+ }
+ pPatternDict = pSeg->m_Result.pd;
+ if((pPatternDict == NULL) || (pPatternDict->NUMPATS == 0)) {
+ m_pModule->JBig2_Error("halftone region segment : has no patterns input");
+ nRet = JBIG2_ERROR_FETAL;
+ goto failed;
+ }
+ pHRD->HNUMPATS = pPatternDict->NUMPATS;
+ pHRD->HPATS = pPatternDict->HDPATS;
+ pHRD->HPW = pPatternDict->HDPATS[0]->m_nWidth;
+ pHRD->HPH = pPatternDict->HDPATS[0]->m_nHeight;
+ pSegment->m_nResultType = JBIG2_IMAGE_POINTER;
+ if(pHRD->HMMR == 0) {
+ dwTemp = pHRD->HTEMPLATE == 0 ? 65536 : pHRD->HTEMPLATE == 1 ? 8192 : 1024;
+ gbContext = (JBig2ArithCtx*)m_pModule->JBig2_Malloc2(sizeof(JBig2ArithCtx), dwTemp);
+ JBIG2_memset(gbContext, 0, sizeof(JBig2ArithCtx)*dwTemp);
+ JBIG2_ALLOC(pArithDecoder, CJBig2_ArithDecoder(m_pStream));
+ pSegment->m_Result.im = pHRD->decode_Arith(pArithDecoder, gbContext, pPause);
+ delete pArithDecoder;
+ if(pSegment->m_Result.im == NULL) {
+ m_pModule->JBig2_Free(gbContext);
+ nRet = JBIG2_ERROR_FETAL;
+ goto failed;
+ }
+ m_pModule->JBig2_Free(gbContext);
+ m_pStream->alignByte();
+ m_pStream->offset(2);
+ } else {
+ pSegment->m_Result.im = pHRD->decode_MMR(m_pStream, pPause);
+ if(pSegment->m_Result.im == NULL) {
+ nRet = JBIG2_ERROR_FETAL;
+ goto failed;
+ }
+ m_pStream->alignByte();
+ }
+ if(pSegment->m_cFlags.s.type != 20) {
+ if(!m_bBufSpecified) {
+ JBig2PageInfo *pPageInfo = m_pPageInfoList->getLast();
+ if ((pPageInfo->m_bIsStriped == 1) && (ri.y + ri.height > m_pPage->m_nHeight)) {
+ m_pPage->expand(ri.y + ri.height, (pPageInfo->m_cFlags & 4) ? 1 : 0);
+ }
+ }
+ m_pPage->composeFrom(ri.x, ri.y, pSegment->m_Result.im, (JBig2ComposeOp)(ri.flags & 0x03));
+ delete pSegment->m_Result.im;
+ pSegment->m_Result.im = NULL;
+ }
+ delete pHRD;
+ return JBIG2_SUCCESS;
+failed:
+ delete pHRD;
+ return nRet;
+}
+
+FX_BOOL CJBig2_Context::parseGenericRegion(CJBig2_Segment *pSegment, IFX_Pause* pPause)
+{
+ FX_DWORD dwTemp;
+ FX_BYTE cFlags;
+ FX_INT32 i, nRet;
+ if(m_pGRD == NULL) {
+ JBIG2_ALLOC(m_pGRD, CJBig2_GRDProc());
+ if((parseRegionInfo(&m_ri) != JBIG2_SUCCESS)
+ || (m_pStream->read1Byte(&cFlags) != 0)) {
+ m_pModule->JBig2_Error("generic region segment : data header too short.");
+ nRet = JBIG2_ERROR_TOO_SHORT;
+ goto failed;
+ }
+ if (m_ri.height < 0 || m_ri.width < 0) {
+ m_pModule->JBig2_Error("generic region segment : wrong data.");
+ nRet = JBIG2_FAILED;
+ goto failed;
+ }
+ m_pGRD->GBW = m_ri.width;
+ m_pGRD->GBH = m_ri.height;
+ m_pGRD->MMR = cFlags & 0x01;
+ m_pGRD->GBTEMPLATE = (cFlags >> 1) & 0x03;
+ m_pGRD->TPGDON = (cFlags >> 3) & 0x01;
+ if(m_pGRD->MMR == 0) {
+ if(m_pGRD->GBTEMPLATE == 0) {
+ for(i = 0; i < 8; i++) {
+ if(m_pStream->read1Byte((FX_BYTE*)&m_pGRD->GBAT[i]) != 0) {
+ m_pModule->JBig2_Error("generic region segment : data header too short.");
+ nRet = JBIG2_ERROR_TOO_SHORT;
+ goto failed;
+ }
+ }
+ } else {
+ for(i = 0; i < 2; i++) {
+ if(m_pStream->read1Byte((FX_BYTE*)&m_pGRD->GBAT[i]) != 0) {
+ m_pModule->JBig2_Error("generic region segment : data header too short.");
+ nRet = JBIG2_ERROR_TOO_SHORT;
+ goto failed;
+ }
+ }
+ }
+ }
+ m_pGRD->USESKIP = 0;
+ }
+ pSegment->m_nResultType = JBIG2_IMAGE_POINTER;
+ if(m_pGRD->MMR == 0) {
+ dwTemp = m_pGRD->GBTEMPLATE == 0 ? 65536 : m_pGRD->GBTEMPLATE == 1 ? 8192 : 1024;
+ if(m_gbContext == NULL) {
+ m_gbContext = (JBig2ArithCtx*)m_pModule->JBig2_Malloc(sizeof(JBig2ArithCtx) * dwTemp);
+ JBIG2_memset(m_gbContext, 0, sizeof(JBig2ArithCtx)*dwTemp);
+ }
+ if(m_pArithDecoder == NULL) {
+ JBIG2_ALLOC(m_pArithDecoder, CJBig2_ArithDecoder(m_pStream));
+ m_ProcessiveStatus = m_pGRD->Start_decode_Arith(&pSegment->m_Result.im, m_pArithDecoder, m_gbContext, pPause);
+ } else {
+ m_ProcessiveStatus = m_pGRD->Continue_decode(pPause);
+ }
+ OutputBitmap(pSegment->m_Result.im);
+ if(m_ProcessiveStatus == FXCODEC_STATUS_DECODE_TOBECONTINUE) {
+ if(pSegment->m_cFlags.s.type != 36) {
+ if(!m_bBufSpecified) {
+ JBig2PageInfo *pPageInfo = m_pPageInfoList->getLast();
+ if ((pPageInfo->m_bIsStriped == 1) && (m_ri.y + m_ri.height > m_pPage->m_nHeight)) {
+ m_pPage->expand(m_ri.y + m_ri.height, (pPageInfo->m_cFlags & 4) ? 1 : 0);
+ }
+ }
+ FX_RECT Rect = m_pGRD->GetReplaceRect();
+ m_pPage->composeFrom(m_ri.x + Rect.left, m_ri.y + Rect.top, pSegment->m_Result.im, (JBig2ComposeOp)(m_ri.flags & 0x03), &Rect);
+ }
+ return JBIG2_SUCCESS;
+ } else {
+ delete m_pArithDecoder;
+ m_pArithDecoder = NULL;
+ if(pSegment->m_Result.im == NULL) {
+ m_pModule->JBig2_Free(m_gbContext);
+ nRet = JBIG2_ERROR_FETAL;
+ m_gbContext = NULL;
+ m_ProcessiveStatus = FXCODEC_STATUS_ERROR;
+ goto failed;
+ }
+ m_pModule->JBig2_Free(m_gbContext);
+ m_gbContext = NULL;
+ m_pStream->alignByte();
+ m_pStream->offset(2);
+ }
+ } else {
+ FXCODEC_STATUS status = m_pGRD->Start_decode_MMR(&pSegment->m_Result.im, m_pStream, pPause);
+ while(status == FXCODEC_STATUS_DECODE_TOBECONTINUE) {
+ m_pGRD->Continue_decode(pPause);
+ }
+ if(pSegment->m_Result.im == NULL) {
+ nRet = JBIG2_ERROR_FETAL;
+ goto failed;
+ }
+ m_pStream->alignByte();
+ }
+ if(pSegment->m_cFlags.s.type != 36) {
+ if(!m_bBufSpecified) {
+ JBig2PageInfo *pPageInfo = m_pPageInfoList->getLast();
+ if ((pPageInfo->m_bIsStriped == 1) && (m_ri.y + m_ri.height > m_pPage->m_nHeight)) {
+ m_pPage->expand(m_ri.y + m_ri.height, (pPageInfo->m_cFlags & 4) ? 1 : 0);
+ }
+ }
+ FX_RECT Rect = m_pGRD->GetReplaceRect();
+ m_pPage->composeFrom(m_ri.x + Rect.left, m_ri.y + Rect.top, pSegment->m_Result.im, (JBig2ComposeOp)(m_ri.flags & 0x03), &Rect);
+ delete pSegment->m_Result.im;
+ pSegment->m_Result.im = NULL;
+ }
+ delete m_pGRD;
+ m_pGRD = NULL;
+ return JBIG2_SUCCESS;
+failed:
+ delete m_pGRD;
+ m_pGRD = NULL;
+ return nRet;
+}
+
+FX_BOOL CJBig2_Context::parseGenericRefinementRegion(CJBig2_Segment *pSegment)
+{
+ FX_DWORD dwTemp;
+ JBig2RegionInfo ri;
+ CJBig2_Segment *pSeg;
+ FX_INT32 i, nRet;
+ FX_BYTE cFlags;
+ JBig2ArithCtx *grContext;
+ CJBig2_GRRDProc *pGRRD;
+ CJBig2_ArithDecoder *pArithDecoder;
+ JBIG2_ALLOC(pGRRD, CJBig2_GRRDProc());
+ if((parseRegionInfo(&ri) != JBIG2_SUCCESS)
+ || (m_pStream->read1Byte(&cFlags) != 0)) {
+ m_pModule->JBig2_Error("generic refinement region segment : data header too short.");
+ nRet = JBIG2_ERROR_TOO_SHORT;
+ goto failed;
+ }
+ pGRRD->GRW = ri.width;
+ pGRRD->GRH = ri.height;
+ pGRRD->GRTEMPLATE = cFlags & 0x01;
+ pGRRD->TPGRON = (cFlags >> 1) & 0x01;
+ if(pGRRD->GRTEMPLATE == 0) {
+ for(i = 0; i < 4; i++) {
+ if(m_pStream->read1Byte((FX_BYTE*)&pGRRD->GRAT[i]) != 0) {
+ m_pModule->JBig2_Error("generic refinement region segment : data header too short.");
+ nRet = JBIG2_ERROR_TOO_SHORT;
+ goto failed;
+ }
+ }
+ }
+ pSeg = NULL;
+ if(pSegment->m_nReferred_to_segment_count > 0) {
+ for(i = 0; i < pSegment->m_nReferred_to_segment_count; i++) {
+ pSeg = this->findSegmentByNumber(pSegment->m_pReferred_to_segment_numbers[0]);
+ if(pSeg == NULL) {
+ m_pModule->JBig2_Error("generic refinement region segment : can't find refered to segments");
+ nRet = JBIG2_ERROR_FETAL;
+ goto failed;
+ }
+ if((pSeg->m_cFlags.s.type == 4) || (pSeg->m_cFlags.s.type == 20)
+ || (pSeg->m_cFlags.s.type == 36) || (pSeg->m_cFlags.s.type == 40)) {
+ break;
+ }
+ }
+ if(i >= pSegment->m_nReferred_to_segment_count) {
+ m_pModule->JBig2_Error("generic refinement region segment : can't find refered to intermediate region");
+ nRet = JBIG2_ERROR_FETAL;
+ goto failed;
+ }
+ pGRRD->GRREFERENCE = pSeg->m_Result.im;
+ } else {
+ pGRRD->GRREFERENCE = m_pPage;
+ }
+ pGRRD->GRREFERENCEDX = 0;
+ pGRRD->GRREFERENCEDY = 0;
+ dwTemp = pGRRD->GRTEMPLATE ? 1 << 10 : 1 << 13;
+ grContext = (JBig2ArithCtx*)m_pModule->JBig2_Malloc2(sizeof(JBig2ArithCtx), dwTemp);
+ JBIG2_memset(grContext, 0, sizeof(JBig2ArithCtx)*dwTemp);
+ JBIG2_ALLOC(pArithDecoder, CJBig2_ArithDecoder(m_pStream));
+ pSegment->m_nResultType = JBIG2_IMAGE_POINTER;
+ pSegment->m_Result.im = pGRRD->decode(pArithDecoder, grContext);
+ delete pArithDecoder;
+ if(pSegment->m_Result.im == NULL) {
+ m_pModule->JBig2_Free(grContext);
+ nRet = JBIG2_ERROR_FETAL;
+ goto failed;
+ }
+ m_pModule->JBig2_Free(grContext);
+ m_pStream->alignByte();
+ m_pStream->offset(2);
+ if(pSegment->m_cFlags.s.type != 40) {
+ if(!m_bBufSpecified) {
+ JBig2PageInfo *pPageInfo = m_pPageInfoList->getLast();
+ if ((pPageInfo->m_bIsStriped == 1) && (ri.y + ri.height > m_pPage->m_nHeight)) {
+ m_pPage->expand(ri.y + ri.height, (pPageInfo->m_cFlags & 4) ? 1 : 0);
+ }
+ }
+ m_pPage->composeFrom(ri.x, ri.y, pSegment->m_Result.im, (JBig2ComposeOp)(ri.flags & 0x03));
+ delete pSegment->m_Result.im;
+ pSegment->m_Result.im = NULL;
+ }
+ delete pGRRD;
+ return JBIG2_SUCCESS;
+failed:
+ delete pGRRD;
+ return nRet;
+}
+FX_BOOL CJBig2_Context::parseTable(CJBig2_Segment *pSegment)
+{
+ pSegment->m_nResultType = JBIG2_HUFFMAN_TABLE_POINTER;
+ JBIG2_ALLOC(pSegment->m_Result.ht, CJBig2_HuffmanTable(m_pStream));
+ if(!pSegment->m_Result.ht->isOK()) {
+ delete pSegment->m_Result.ht;
+ pSegment->m_Result.ht = NULL;
+ return JBIG2_ERROR_FETAL;
+ }
+ m_pStream->alignByte();
+ return JBIG2_SUCCESS;
+}
+FX_INT32 CJBig2_Context::parseRegionInfo(JBig2RegionInfo *pRI)
+{
+ if((m_pStream->readInteger((FX_DWORD*)&pRI->width) != 0)
+ || (m_pStream->readInteger((FX_DWORD*)&pRI->height) != 0)
+ || (m_pStream->readInteger((FX_DWORD*)&pRI->x) != 0)
+ || (m_pStream->readInteger((FX_DWORD*)&pRI->y) != 0)
+ || (m_pStream->read1Byte(&pRI->flags) != 0)) {
+ return JBIG2_ERROR_TOO_SHORT;
+ }
+ return JBIG2_SUCCESS;
+}
+JBig2HuffmanCode *CJBig2_Context::decodeSymbolIDHuffmanTable(CJBig2_BitStream *pStream,
+ FX_DWORD SBNUMSYMS)
+{
+ JBig2HuffmanCode *SBSYMCODES;
+ FX_INT32 runcodes[35], runcodes_len[35], runcode;
+ FX_INT32 i, j, nTemp, nVal, nBits;
+ FX_INT32 run;
+ SBSYMCODES = (JBig2HuffmanCode*)m_pModule->JBig2_Malloc2(sizeof(JBig2HuffmanCode), SBNUMSYMS);
+ for (i = 0; i < 35; i ++) {
+ if(pStream->readNBits(4, &runcodes_len[i]) != 0) {
+ goto failed;
+ }
+ }
+ huffman_assign_code(runcodes, runcodes_len, 35);
+ i = 0;
+ while(i < (int)SBNUMSYMS) {
+ nVal = 0;
+ nBits = 0;
+ for(;;) {
+ if(pStream->read1Bit(&nTemp) != 0) {
+ goto failed;
+ }
+ nVal = (nVal << 1) | nTemp;
+ nBits ++;
+ for(j = 0; j < 35; j++) {
+ if((nBits == runcodes_len[j]) && (nVal == runcodes[j])) {
+ break;
+ }
+ }
+ if(j < 35) {
+ break;
+ }
+ }
+ runcode = j;
+ if(runcode < 32) {
+ SBSYMCODES[i].codelen = runcode;
+ run = 0;
+ } else if(runcode == 32) {
+ if(pStream->readNBits(2, &nTemp) != 0) {
+ goto failed;
+ }
+ run = nTemp + 3;
+ } else if(runcode == 33) {
+ if(pStream->readNBits(3, &nTemp) != 0) {
+ goto failed;
+ }
+ run = nTemp + 3;
+ } else if(runcode == 34) {
+ if(pStream->readNBits(7, &nTemp) != 0) {
+ goto failed;
+ }
+ run = nTemp + 11;
+ }
+ if(run > 0) {
+ if (i + run > (int)SBNUMSYMS) {
+ goto failed;
+ }
+ for(j = 0; j < run; j++) {
+ if(runcode == 32 && i > 0) {
+ SBSYMCODES[i + j].codelen = SBSYMCODES[i - 1].codelen;
+ } else {
+ SBSYMCODES[i + j].codelen = 0;
+ }
+ }
+ i += run;
+ } else {
+ i ++;
+ }
+ }
+ huffman_assign_code(SBSYMCODES, SBNUMSYMS);
+ return SBSYMCODES;
+failed:
+ m_pModule->JBig2_Free(SBSYMCODES);
+ return NULL;
+}
+void CJBig2_Context::huffman_assign_code(int* CODES, int* PREFLEN, int NTEMP)
+{
+ int CURLEN, LENMAX, CURCODE, CURTEMP, i;
+ int *LENCOUNT;
+ int *FIRSTCODE;
+ LENMAX = 0;
+ for(i = 0; i < NTEMP; i++) {
+ if(PREFLEN[i] > LENMAX) {
+ LENMAX = PREFLEN[i];
+ }
+ }
+ LENCOUNT = (int*)m_pModule->JBig2_Malloc2(sizeof(int), (LENMAX + 1));
+ JBIG2_memset(LENCOUNT, 0, sizeof(int) * (LENMAX + 1));
+ FIRSTCODE = (int*)m_pModule->JBig2_Malloc2(sizeof(int), (LENMAX + 1));
+ for(i = 0; i < NTEMP; i++) {
+ LENCOUNT[PREFLEN[i]] ++;
+ }
+ CURLEN = 1;
+ FIRSTCODE[0] = 0;
+ LENCOUNT[0] = 0;
+ while(CURLEN <= LENMAX) {
+ FIRSTCODE[CURLEN] = (FIRSTCODE[CURLEN - 1] + LENCOUNT[CURLEN - 1]) << 1;
+ CURCODE = FIRSTCODE[CURLEN];
+ CURTEMP = 0;
+ while(CURTEMP < NTEMP) {
+ if(PREFLEN[CURTEMP] == CURLEN) {
+ CODES[CURTEMP] = CURCODE;
+ CURCODE = CURCODE + 1;
+ }
+ CURTEMP = CURTEMP + 1;
+ }
+ CURLEN = CURLEN + 1;
+ }
+ m_pModule->JBig2_Free(LENCOUNT);
+ m_pModule->JBig2_Free(FIRSTCODE);
+}
+void CJBig2_Context::huffman_assign_code(JBig2HuffmanCode *SBSYMCODES, int NTEMP)
+{
+ int CURLEN, LENMAX, CURCODE, CURTEMP, i;
+ int *LENCOUNT;
+ int *FIRSTCODE;
+ LENMAX = 0;
+ for(i = 0; i < NTEMP; i++) {
+ if(SBSYMCODES[i].codelen > LENMAX) {
+ LENMAX = SBSYMCODES[i].codelen;
+ }
+ }
+ LENCOUNT = (int*)m_pModule->JBig2_Malloc2(sizeof(int), (LENMAX + 1));
+ JBIG2_memset(LENCOUNT, 0, sizeof(int) * (LENMAX + 1));
+ FIRSTCODE = (int*)m_pModule->JBig2_Malloc2(sizeof(int), (LENMAX + 1));
+ for(i = 0; i < NTEMP; i++) {
+ LENCOUNT[SBSYMCODES[i].codelen] ++;
+ }
+ CURLEN = 1;
+ FIRSTCODE[0] = 0;
+ LENCOUNT[0] = 0;
+ while(CURLEN <= LENMAX) {
+ FIRSTCODE[CURLEN] = (FIRSTCODE[CURLEN - 1] + LENCOUNT[CURLEN - 1]) << 1;
+ CURCODE = FIRSTCODE[CURLEN];
+ CURTEMP = 0;
+ while(CURTEMP < NTEMP) {
+ if(SBSYMCODES[CURTEMP].codelen == CURLEN) {
+ SBSYMCODES[CURTEMP].code = CURCODE;
+ CURCODE = CURCODE + 1;
+ }
+ CURTEMP = CURTEMP + 1;
+ }
+ CURLEN = CURLEN + 1;
+ }
+ m_pModule->JBig2_Free(LENCOUNT);
+ m_pModule->JBig2_Free(FIRSTCODE);
+}
diff --git a/core/src/fxcodec/jbig2/JBig2_Context.h b/core/src/fxcodec/jbig2/JBig2_Context.h
index 369dba3512..90bd7ddbbe 100644
--- a/core/src/fxcodec/jbig2/JBig2_Context.h
+++ b/core/src/fxcodec/jbig2/JBig2_Context.h
@@ -1,135 +1,135 @@
-// 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 _JBIG2_CONTEXT_H_
-#define _JBIG2_CONTEXT_H_
-#include "JBig2_Module.h"
-#include "JBig2_List.h"
-#include "JBig2_Segment.h"
-#include "JBig2_Page.h"
-#include "JBig2_GeneralDecoder.h"
-#include "../../../include/fxcodec/fx_codec_def.h"
-#include "../../../include/fxcrt/fx_basic.h"
-typedef enum {
- JBIG2_OUT_OF_PAGE = 0,
- JBIG2_IN_PAGE,
-} JBig2State;
-#define JBIG2_SUCCESS 0
-#define JBIG2_FAILED -1
-#define JBIG2_ERROR_TOO_SHORT -2
-#define JBIG2_ERROR_FETAL -3
-#define JBIG2_END_OF_PAGE 2
-#define JBIG2_END_OF_FILE 3
-#define JBIG2_ERROR_FILE_FORMAT -4
-#define JBIG2_ERROR_STREAM_TYPE -5
-#define JBIG2_ERROR_LIMIT -6
-#define JBIG2_FILE_STREAM 0
-#define JBIG2_SQUENTIAL_STREAM 1
-#define JBIG2_RANDOM_STREAM 2
-#define JBIG2_EMBED_STREAM 3
-#define JBIG2_MIN_SEGMENT_SIZE 11
-class CJBig2_Context : public CJBig2_Object
-{
-public:
-
- static CJBig2_Context *CreateContext(CJBig2_Module *pModule, FX_BYTE *pGlobalData, FX_DWORD dwGlobalLength,
- FX_BYTE *pData, FX_DWORD dwLength, FX_INT32 nStreamType, IFX_Pause* pPause = NULL);
-
- static void DestroyContext(CJBig2_Context *pContext);
-
- FX_INT32 getFirstPage(FX_BYTE *pBuf, FX_INT32 width, FX_INT32 height, FX_INT32 stride, IFX_Pause* pPause);
-
- FX_INT32 getNextPage(FX_BYTE *pBuf, FX_INT32 width, FX_INT32 height, FX_INT32 stride, IFX_Pause* pPause);
-
- FX_INT32 getFirstPage(CJBig2_Image **image, IFX_Pause* pPause);
-
- FX_INT32 getNextPage(CJBig2_Image **image, IFX_Pause* pPause);
- FX_INT32 Continue(IFX_Pause* pPause);
- FXCODEC_STATUS GetProcessiveStatus()
- {
- return m_ProcessiveStatus;
- };
-private:
-
- CJBig2_Context(FX_BYTE *pGlobalData, FX_DWORD dwGlobalLength,
- FX_BYTE *pData, FX_DWORD dwLength, FX_INT32 nStreamType, IFX_Pause* pPause);
-
- ~CJBig2_Context();
-
- FX_INT32 decodeFile(IFX_Pause* pPause);
-
- FX_INT32 decode_SquentialOrgnazation(IFX_Pause* pPause);
-
- FX_INT32 decode_EmbedOrgnazation(IFX_Pause* pPause);
-
- FX_INT32 decode_RandomOrgnazation_FirstPage(IFX_Pause* pPause);
-
- FX_INT32 decode_RandomOrgnazation(IFX_Pause* pPause);
-
- CJBig2_Segment *findSegmentByNumber(FX_DWORD dwNumber);
-
- CJBig2_Segment *findReferredSegmentByTypeAndIndex(CJBig2_Segment *pSegment, FX_BYTE cType, FX_INT32 nIndex);
-
- FX_INT32 parseSegmentHeader(CJBig2_Segment *pSegment);
-
- FX_INT32 parseSegmentData(CJBig2_Segment *pSegment, IFX_Pause* pPause);
- FX_INT32 ProcessiveParseSegmentData(CJBig2_Segment *pSegment, IFX_Pause* pPause);
-
- FX_INT32 parseSymbolDict(CJBig2_Segment *pSegment, IFX_Pause* pPause);
-
- FX_INT32 parseTextRegion(CJBig2_Segment *pSegment);
-
- FX_INT32 parsePatternDict(CJBig2_Segment *pSegment, IFX_Pause* pPause);
-
- FX_INT32 parseHalftoneRegion(CJBig2_Segment *pSegment, IFX_Pause* pPause);
-
- FX_INT32 parseGenericRegion(CJBig2_Segment *pSegment, IFX_Pause* pPause);
-
- FX_INT32 parseGenericRefinementRegion(CJBig2_Segment *pSegment);
-
- FX_INT32 parseTable(CJBig2_Segment *pSegment);
-
- FX_INT32 parseRegionInfo(JBig2RegionInfo *pRI);
-
-
-
- JBig2HuffmanCode *decodeSymbolIDHuffmanTable(CJBig2_BitStream *pStream, FX_DWORD SBNUMSYMS);
-
- void huffman_assign_code(int* CODES, int* PREFLEN, int NTEMP);
-
- void huffman_assign_code(JBig2HuffmanCode *SBSYMCODES, int NTEMP);
-
-private:
-
- CJBig2_Context *m_pGlobalContext;
-
- FX_INT32 m_nStreamType;
-
- CJBig2_BitStream *m_pStream;
-
- FX_INT32 m_nState;
-
- CJBig2_List<CJBig2_Segment> *m_pSegmentList;
-
- CJBig2_List<JBig2PageInfo> *m_pPageInfoList;
-
- CJBig2_Image *m_pPage;
-
- FX_BOOL m_bBufSpecified;
-
- FX_INT32 m_nSegmentDecoded;
- IFX_Pause* m_pPause;
- FX_INT32 m_PauseStep;
- FXCODEC_STATUS m_ProcessiveStatus;
- FX_BOOL m_bFirstPage;
- CJBig2_ArithDecoder *m_pArithDecoder;
- CJBig2_GRDProc *m_pGRD;
- JBig2ArithCtx *m_gbContext;
- CJBig2_Segment *m_pSegment;
- FX_DWORD m_dwOffset;
- JBig2RegionInfo m_ri;
-};
-#endif
+// 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 _JBIG2_CONTEXT_H_
+#define _JBIG2_CONTEXT_H_
+#include "JBig2_Module.h"
+#include "JBig2_List.h"
+#include "JBig2_Segment.h"
+#include "JBig2_Page.h"
+#include "JBig2_GeneralDecoder.h"
+#include "../../../include/fxcodec/fx_codec_def.h"
+#include "../../../include/fxcrt/fx_basic.h"
+typedef enum {
+ JBIG2_OUT_OF_PAGE = 0,
+ JBIG2_IN_PAGE,
+} JBig2State;
+#define JBIG2_SUCCESS 0
+#define JBIG2_FAILED -1
+#define JBIG2_ERROR_TOO_SHORT -2
+#define JBIG2_ERROR_FETAL -3
+#define JBIG2_END_OF_PAGE 2
+#define JBIG2_END_OF_FILE 3
+#define JBIG2_ERROR_FILE_FORMAT -4
+#define JBIG2_ERROR_STREAM_TYPE -5
+#define JBIG2_ERROR_LIMIT -6
+#define JBIG2_FILE_STREAM 0
+#define JBIG2_SQUENTIAL_STREAM 1
+#define JBIG2_RANDOM_STREAM 2
+#define JBIG2_EMBED_STREAM 3
+#define JBIG2_MIN_SEGMENT_SIZE 11
+class CJBig2_Context : public CJBig2_Object
+{
+public:
+
+ static CJBig2_Context *CreateContext(CJBig2_Module *pModule, FX_BYTE *pGlobalData, FX_DWORD dwGlobalLength,
+ FX_BYTE *pData, FX_DWORD dwLength, FX_INT32 nStreamType, IFX_Pause* pPause = NULL);
+
+ static void DestroyContext(CJBig2_Context *pContext);
+
+ FX_INT32 getFirstPage(FX_BYTE *pBuf, FX_INT32 width, FX_INT32 height, FX_INT32 stride, IFX_Pause* pPause);
+
+ FX_INT32 getNextPage(FX_BYTE *pBuf, FX_INT32 width, FX_INT32 height, FX_INT32 stride, IFX_Pause* pPause);
+
+ FX_INT32 getFirstPage(CJBig2_Image **image, IFX_Pause* pPause);
+
+ FX_INT32 getNextPage(CJBig2_Image **image, IFX_Pause* pPause);
+ FX_INT32 Continue(IFX_Pause* pPause);
+ FXCODEC_STATUS GetProcessiveStatus()
+ {
+ return m_ProcessiveStatus;
+ };
+private:
+
+ CJBig2_Context(FX_BYTE *pGlobalData, FX_DWORD dwGlobalLength,
+ FX_BYTE *pData, FX_DWORD dwLength, FX_INT32 nStreamType, IFX_Pause* pPause);
+
+ ~CJBig2_Context();
+
+ FX_INT32 decodeFile(IFX_Pause* pPause);
+
+ FX_INT32 decode_SquentialOrgnazation(IFX_Pause* pPause);
+
+ FX_INT32 decode_EmbedOrgnazation(IFX_Pause* pPause);
+
+ FX_INT32 decode_RandomOrgnazation_FirstPage(IFX_Pause* pPause);
+
+ FX_INT32 decode_RandomOrgnazation(IFX_Pause* pPause);
+
+ CJBig2_Segment *findSegmentByNumber(FX_DWORD dwNumber);
+
+ CJBig2_Segment *findReferredSegmentByTypeAndIndex(CJBig2_Segment *pSegment, FX_BYTE cType, FX_INT32 nIndex);
+
+ FX_INT32 parseSegmentHeader(CJBig2_Segment *pSegment);
+
+ FX_INT32 parseSegmentData(CJBig2_Segment *pSegment, IFX_Pause* pPause);
+ FX_INT32 ProcessiveParseSegmentData(CJBig2_Segment *pSegment, IFX_Pause* pPause);
+
+ FX_INT32 parseSymbolDict(CJBig2_Segment *pSegment, IFX_Pause* pPause);
+
+ FX_INT32 parseTextRegion(CJBig2_Segment *pSegment);
+
+ FX_INT32 parsePatternDict(CJBig2_Segment *pSegment, IFX_Pause* pPause);
+
+ FX_INT32 parseHalftoneRegion(CJBig2_Segment *pSegment, IFX_Pause* pPause);
+
+ FX_INT32 parseGenericRegion(CJBig2_Segment *pSegment, IFX_Pause* pPause);
+
+ FX_INT32 parseGenericRefinementRegion(CJBig2_Segment *pSegment);
+
+ FX_INT32 parseTable(CJBig2_Segment *pSegment);
+
+ FX_INT32 parseRegionInfo(JBig2RegionInfo *pRI);
+
+
+
+ JBig2HuffmanCode *decodeSymbolIDHuffmanTable(CJBig2_BitStream *pStream, FX_DWORD SBNUMSYMS);
+
+ void huffman_assign_code(int* CODES, int* PREFLEN, int NTEMP);
+
+ void huffman_assign_code(JBig2HuffmanCode *SBSYMCODES, int NTEMP);
+
+private:
+
+ CJBig2_Context *m_pGlobalContext;
+
+ FX_INT32 m_nStreamType;
+
+ CJBig2_BitStream *m_pStream;
+
+ FX_INT32 m_nState;
+
+ CJBig2_List<CJBig2_Segment> *m_pSegmentList;
+
+ CJBig2_List<JBig2PageInfo> *m_pPageInfoList;
+
+ CJBig2_Image *m_pPage;
+
+ FX_BOOL m_bBufSpecified;
+
+ FX_INT32 m_nSegmentDecoded;
+ IFX_Pause* m_pPause;
+ FX_INT32 m_PauseStep;
+ FXCODEC_STATUS m_ProcessiveStatus;
+ FX_BOOL m_bFirstPage;
+ CJBig2_ArithDecoder *m_pArithDecoder;
+ CJBig2_GRDProc *m_pGRD;
+ JBig2ArithCtx *m_gbContext;
+ CJBig2_Segment *m_pSegment;
+ FX_DWORD m_dwOffset;
+ JBig2RegionInfo m_ri;
+};
+#endif
diff --git a/core/src/fxcodec/jbig2/JBig2_Define.h b/core/src/fxcodec/jbig2/JBig2_Define.h
index 1019b6af5d..ccf15d07ba 100644
--- a/core/src/fxcodec/jbig2/JBig2_Define.h
+++ b/core/src/fxcodec/jbig2/JBig2_Define.h
@@ -1,34 +1,34 @@
-// 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 _JBIG2_DEFINE_H_
-#define _JBIG2_DEFINE_H_
-#include "../../../include/fxcrt/fx_system.h"
-#define JBIG2_memset FXSYS_memset8
-#define JBIG2_memcmp FXSYS_memcmp32
-#define JBIG2_memcpy FXSYS_memcpy32
-#include "JBig2_Object.h"
-#define JBIG2_OOB 1
-typedef struct {
- FX_INT32 width,
- height;
- FX_INT32 x,
- y;
- FX_BYTE flags;
-} JBig2RegionInfo;
-typedef struct {
- FX_INT32 codelen;
- FX_INT32 code;
-} JBig2HuffmanCode;
-extern "C" {
- void _FaxG4Decode(void *pModule, FX_LPCBYTE src_buf, FX_DWORD src_size, int* pbitpos, FX_LPBYTE dest_buf, int width, int height, int pitch = 0);
-};
-#define JBIG2_MAX_REFERRED_SEGMENT_COUNT 64
-#define JBIG2_MAX_EXPORT_SYSMBOLS 65535
-#define JBIG2_MAX_NEW_SYSMBOLS 65535
-#define JBIG2_MAX_PATTERN_INDEX 65535
-#define JBIG2_MAX_IMAGE_SIZE 65535
-#endif
+// 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 _JBIG2_DEFINE_H_
+#define _JBIG2_DEFINE_H_
+#include "../../../include/fxcrt/fx_system.h"
+#define JBIG2_memset FXSYS_memset8
+#define JBIG2_memcmp FXSYS_memcmp32
+#define JBIG2_memcpy FXSYS_memcpy32
+#include "JBig2_Object.h"
+#define JBIG2_OOB 1
+typedef struct {
+ FX_INT32 width,
+ height;
+ FX_INT32 x,
+ y;
+ FX_BYTE flags;
+} JBig2RegionInfo;
+typedef struct {
+ FX_INT32 codelen;
+ FX_INT32 code;
+} JBig2HuffmanCode;
+extern "C" {
+ void _FaxG4Decode(void *pModule, FX_LPCBYTE src_buf, FX_DWORD src_size, int* pbitpos, FX_LPBYTE dest_buf, int width, int height, int pitch = 0);
+};
+#define JBIG2_MAX_REFERRED_SEGMENT_COUNT 64
+#define JBIG2_MAX_EXPORT_SYSMBOLS 65535
+#define JBIG2_MAX_NEW_SYSMBOLS 65535
+#define JBIG2_MAX_PATTERN_INDEX 65535
+#define JBIG2_MAX_IMAGE_SIZE 65535
+#endif
diff --git a/core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp b/core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp
index 9aa714a228..5847b20a93 100644
--- a/core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp
+++ b/core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp
@@ -1,4290 +1,4290 @@
-// 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
-
-#include "JBig2_GeneralDecoder.h"
-#include "JBig2_ArithDecoder.h"
-#include "JBig2_ArithIntDecoder.h"
-#include "JBig2_HuffmanDecoder.h"
-#include "JBig2_HuffmanTable.h"
-#include "JBig2_PatternDict.h"
-CJBig2_Image *CJBig2_GRDProc::decode_Arith(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext)
-{
- if (GBW == 0 || GBH == 0) {
- CJBig2_Image* pImage;
- JBIG2_ALLOC(pImage, CJBig2_Image(GBW, GBH));
- return pImage;
- }
- if(GBTEMPLATE == 0) {
- if((GBAT[0] == 3) && (GBAT[1] == (signed char) - 1)
- && (GBAT[2] == (signed char) - 3) && (GBAT[3] == (signed char) - 1)
- && (GBAT[4] == 2) && (GBAT[5] == (signed char) - 2)
- && (GBAT[6] == (signed char) - 2) && (GBAT[7] == (signed char) - 2)) {
- return decode_Arith_Template0_opt3(pArithDecoder, gbContext);
- } else {
- return decode_Arith_Template0_unopt(pArithDecoder, gbContext);
- }
- } else if(GBTEMPLATE == 1) {
- if((GBAT[0] == 3) && (GBAT[1] == (signed char) - 1)) {
- return decode_Arith_Template1_opt3(pArithDecoder, gbContext);
- } else {
- return decode_Arith_Template1_unopt(pArithDecoder, gbContext);
- }
- } else if(GBTEMPLATE == 2) {
- if((GBAT[0] == 2) && (GBAT[1] == (signed char) - 1)) {
- return decode_Arith_Template2_opt3(pArithDecoder, gbContext);
- } else {
- return decode_Arith_Template2_unopt(pArithDecoder, gbContext);
- }
- } else {
- if((GBAT[0] == 2) && (GBAT[1] == (signed char) - 1)) {
- return decode_Arith_Template3_opt3(pArithDecoder, gbContext);
- } else {
- return decode_Arith_Template3_unopt(pArithDecoder, gbContext);
- }
- }
-}
-CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template0_opt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext)
-{
- FX_BOOL LTP, SLTP, bVal;
- FX_DWORD CONTEXT;
- CJBig2_Image *GBREG;
- FX_DWORD line1, line2, line3;
- LTP = 0;
- JBIG2_ALLOC(GBREG, CJBig2_Image(GBW, GBH));
- GBREG->fill(0);
- for(FX_DWORD h = 0; h < GBH; h++) {
- if(TPGDON) {
- SLTP = pArithDecoder->DECODE(&gbContext[0x9b25]);
- LTP = LTP ^ SLTP;
- }
- if(LTP == 1) {
- GBREG->copyLine(h, h - 1);
- } else {
- line1 = GBREG->getPixel(2, h - 2);
- line1 |= GBREG->getPixel(1, h - 2) << 1;
- line1 |= GBREG->getPixel(0, h - 2) << 2;
- line2 = GBREG->getPixel(3, h - 1);
- line2 |= GBREG->getPixel(2, h - 1) << 1;
- line2 |= GBREG->getPixel(1, h - 1) << 2;
- line2 |= GBREG->getPixel(0, h - 1) << 3;
- line3 = 0;
- for(FX_DWORD w = 0; w < GBW; w++) {
- if(USESKIP && SKIP->getPixel(w, h)) {
- bVal = 0;
- } else {
- CONTEXT = line3;
- CONTEXT |= line2 << 4;
- CONTEXT |= line1 << 11;
- bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
- }
- if(bVal) {
- GBREG->setPixel(w, h, bVal);
- }
- line1 = ((line1 << 1) | GBREG->getPixel(w + 3, h - 2)) & 0x1f;
- line2 = ((line2 << 1) | GBREG->getPixel(w + 4, h - 1)) & 0x7f;
- line3 = ((line3 << 1) | bVal) & 0x0f;
- }
- }
- }
- return GBREG;
-}
-CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template0_opt2(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext)
-{
- FX_BOOL LTP, SLTP, bVal;
- FX_DWORD CONTEXT;
- CJBig2_Image *GBREG;
- FX_DWORD line1, line2;
- FX_BYTE *pLine, cVal;
- FX_INTPTR nStride, nStride2;
- FX_INT32 nBits, k;
- LTP = 0;
- JBIG2_ALLOC(GBREG, CJBig2_Image(GBW, GBH));
- if (GBREG->m_pData == NULL) {
- delete GBREG;
- m_pModule->JBig2_Error("Generic region decoding procedure: Create Image Failed with width = %d, height = %d\n", GBW, GBH);
- return NULL;
- }
- pLine = GBREG->m_pData;
- nStride = GBREG->m_nStride;
- nStride2 = nStride << 1;
- for(FX_DWORD h = 0; h < GBH; h++) {
- if(TPGDON) {
- SLTP = pArithDecoder->DECODE(&gbContext[0x9b25]);
- LTP = LTP ^ SLTP;
- }
- if(LTP == 1) {
- GBREG->copyLine(h, h - 1);
- } else {
- line1 = (h > 1) ? pLine[-nStride2] << 6 : 0;
- line2 = (h > 0) ? pLine[-nStride] : 0;
- CONTEXT = (line1 & 0xf800) | (line2 & 0x07f0);
- for(FX_DWORD w = 0; w < GBW; w += 8) {
- if(w + 8 < GBW) {
- nBits = 8;
- if(h > 1) {
- line1 = (line1 << 8) | (pLine[-nStride2 + (w >> 3) + 1] << 6);
- }
- if(h > 0) {
- line2 = (line2 << 8) | (pLine[-nStride + (w >> 3) + 1]);
- }
- } else {
- nBits = GBW - w;
- if(h > 1) {
- line1 <<= 8;
- }
- if(h > 0) {
- line2 <<= 8;
- }
- }
- cVal = 0;
- for(k = 0; k < nBits; k++) {
- if(USESKIP && SKIP->getPixel(w, h)) {
- bVal = 0;
- } else {
- bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
- }
- cVal |= bVal << (7 - k);
- CONTEXT = ((CONTEXT & 0x7bf7) << 1) | bVal
- | ((line1 >> (7 - k)) & 0x0800)
- | ((line2 >> (7 - k)) & 0x0010);
- }
- pLine[w >> 3] = cVal;
- }
- }
- pLine += nStride;
- }
- return GBREG;
-}
-CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template0_opt3(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext)
-{
- FX_BOOL LTP, SLTP, bVal;
- FX_DWORD CONTEXT;
- CJBig2_Image *GBREG;
- FX_DWORD line1, line2;
- FX_BYTE *pLine, *pLine1, *pLine2, cVal;
- FX_INT32 nStride, nStride2, k;
- FX_INT32 nLineBytes, nBitsLeft, cc;
- LTP = 0;
- JBIG2_ALLOC(GBREG, CJBig2_Image(GBW, GBH));
- if (GBREG->m_pData == NULL) {
- delete GBREG;
- m_pModule->JBig2_Error("Generic region decoding procedure: Create Image Failed with width = %d, height = %d\n", GBW, GBH);
- return NULL;
- }
- pLine = GBREG->m_pData;
- nStride = GBREG->m_nStride;
- nStride2 = nStride << 1;
- nLineBytes = ((GBW + 7) >> 3) - 1;
- nBitsLeft = GBW - (nLineBytes << 3);
- FX_DWORD height = GBH & 0x7fffffff;
- for(FX_DWORD h = 0; h < height; h++) {
- if(TPGDON) {
- SLTP = pArithDecoder->DECODE(&gbContext[0x9b25]);
- LTP = LTP ^ SLTP;
- }
- if(LTP == 1) {
- GBREG->copyLine(h, h - 1);
- } else {
- if(h > 1) {
- pLine1 = pLine - nStride2;
- pLine2 = pLine - nStride;
- line1 = (*pLine1++) << 6;
- line2 = *pLine2++;
- CONTEXT = ((line1 & 0xf800) | (line2 & 0x07f0));
- for(cc = 0; cc < nLineBytes; cc++) {
- line1 = (line1 << 8) | ((*pLine1++) << 6);
- line2 = (line2 << 8) | (*pLine2++);
- cVal = 0;
- for(k = 7; k >= 0; k--) {
- bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
- cVal |= bVal << k;
- CONTEXT = (((CONTEXT & 0x7bf7) << 1) | bVal
- | ((line1 >> k) & 0x0800)
- | ((line2 >> k) & 0x0010));
- }
- pLine[cc] = cVal;
- }
- line1 <<= 8;
- line2 <<= 8;
- cVal = 0;
- for(k = 0; k < nBitsLeft; k++) {
- bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
- cVal |= bVal << (7 - k);
- CONTEXT = (((CONTEXT & 0x7bf7) << 1) | bVal
- | ((line1 >> (7 - k)) & 0x0800)
- | ((line2 >> (7 - k)) & 0x0010));
- }
- pLine[nLineBytes] = cVal;
- } else {
- pLine2 = pLine - nStride;
- line2 = (h & 1) ? (*pLine2++) : 0;
- CONTEXT = (line2 & 0x07f0);
- for(cc = 0; cc < nLineBytes; cc++) {
- if(h & 1) {
- line2 = (line2 << 8) | (*pLine2++);
- }
- cVal = 0;
- for(k = 7; k >= 0; k--) {
- bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
- cVal |= bVal << k;
- CONTEXT = (((CONTEXT & 0x7bf7) << 1) | bVal
- | ((line2 >> k) & 0x0010));
- }
- pLine[cc] = cVal;
- }
- line2 <<= 8;
- cVal = 0;
- for(k = 0; k < nBitsLeft; k++) {
- bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
- cVal |= bVal << (7 - k);
- CONTEXT = (((CONTEXT & 0x7bf7) << 1) | bVal
- | (((line2 >> (7 - k))) & 0x0010));
- }
- pLine[nLineBytes] = cVal;
- }
- }
- pLine += nStride;
- }
- return GBREG;
-}
-CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template0_unopt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext)
-{
- FX_BOOL LTP, SLTP, bVal;
- FX_DWORD CONTEXT;
- CJBig2_Image *GBREG;
- FX_DWORD line1, line2, line3;
- LTP = 0;
- JBIG2_ALLOC(GBREG, CJBig2_Image(GBW, GBH));
- GBREG->fill(0);
- for(FX_DWORD h = 0; h < GBH; h++) {
- if(TPGDON) {
- SLTP = pArithDecoder->DECODE(&gbContext[0x9b25]);
- LTP = LTP ^ SLTP;
- }
- if(LTP == 1) {
- GBREG->copyLine(h, h - 1);
- } else {
- line1 = GBREG->getPixel(1, h - 2);
- line1 |= GBREG->getPixel(0, h - 2) << 1;
- line2 = GBREG->getPixel(2, h - 1);
- line2 |= GBREG->getPixel(1, h - 1) << 1;
- line2 |= GBREG->getPixel(0, h - 1) << 2;
- line3 = 0;
- for(FX_DWORD w = 0; w < GBW; w++) {
- if(USESKIP && SKIP->getPixel(w, h)) {
- bVal = 0;
- } else {
- CONTEXT = line3;
- CONTEXT |= GBREG->getPixel(w + GBAT[0], h + GBAT[1]) << 4;
- CONTEXT |= line2 << 5;
- CONTEXT |= GBREG->getPixel(w + GBAT[2], h + GBAT[3]) << 10;
- CONTEXT |= GBREG->getPixel(w + GBAT[4], h + GBAT[5]) << 11;
- CONTEXT |= line1 << 12;
- CONTEXT |= GBREG->getPixel(w + GBAT[6], h + GBAT[7]) << 15;
- bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
- }
- if(bVal) {
- GBREG->setPixel(w, h, bVal);
- }
- line1 = ((line1 << 1) | GBREG->getPixel(w + 2, h - 2)) & 0x07;
- line2 = ((line2 << 1) | GBREG->getPixel(w + 3, h - 1)) & 0x1f;
- line3 = ((line3 << 1) | bVal) & 0x0f;
- }
- }
- }
- return GBREG;
-}
-CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template1_opt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext)
-{
- FX_BOOL LTP, SLTP, bVal;
- FX_DWORD CONTEXT;
- CJBig2_Image *GBREG;
- FX_DWORD line1, line2, line3;
- LTP = 0;
- JBIG2_ALLOC(GBREG, CJBig2_Image(GBW, GBH));
- GBREG->fill(0);
- for(FX_DWORD h = 0; h < GBH; h++) {
- if(TPGDON) {
- SLTP = pArithDecoder->DECODE(&gbContext[0x0795]);
- LTP = LTP ^ SLTP;
- }
- if(LTP == 1) {
- GBREG->copyLine(h, h - 1);
- } else {
- line1 = GBREG->getPixel(2, h - 2);
- line1 |= GBREG->getPixel(1, h - 2) << 1;
- line1 |= GBREG->getPixel(0, h - 2) << 2;
- line2 = GBREG->getPixel(3, h - 1);
- line2 |= GBREG->getPixel(2, h - 1) << 1;
- line2 |= GBREG->getPixel(1, h - 1) << 2;
- line2 |= GBREG->getPixel(0, h - 1) << 3;
- line3 = 0;
- for(FX_DWORD w = 0; w < GBW; w++) {
- if(USESKIP && SKIP->getPixel(w, h)) {
- bVal = 0;
- } else {
- CONTEXT = line3;
- CONTEXT |= line2 << 3;
- CONTEXT |= line1 << 9;
- bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
- }
- if(bVal) {
- GBREG->setPixel(w, h, bVal);
- }
- line1 = ((line1 << 1) | GBREG->getPixel(w + 3, h - 2)) & 0x0f;
- line2 = ((line2 << 1) | GBREG->getPixel(w + 4, h - 1)) & 0x3f;
- line3 = ((line3 << 1) | bVal) & 0x07;
- }
- }
- }
- return GBREG;
-}
-CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template1_opt2(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext)
-{
- FX_BOOL LTP, SLTP, bVal;
- FX_DWORD CONTEXT;
- CJBig2_Image *GBREG;
- FX_DWORD line1, line2;
- FX_BYTE *pLine, cVal;
- FX_INTPTR nStride, nStride2;
- FX_INT32 nBits, k;
- LTP = 0;
- JBIG2_ALLOC(GBREG, CJBig2_Image(GBW, GBH));
- if (GBREG->m_pData == NULL) {
- delete GBREG;
- m_pModule->JBig2_Error("Generic region decoding procedure: Create Image Failed with width = %d, height = %d\n", GBW, GBH);
- return NULL;
- }
- pLine = GBREG->m_pData;
- nStride = GBREG->m_nStride;
- nStride2 = nStride << 1;
- for(FX_DWORD h = 0; h < GBH; h++) {
- if(TPGDON) {
- SLTP = pArithDecoder->DECODE(&gbContext[0x0795]);
- LTP = LTP ^ SLTP;
- }
- if(LTP == 1) {
- GBREG->copyLine(h, h - 1);
- } else {
- line1 = (h > 1) ? pLine[-nStride2] << 4 : 0;
- line2 = (h > 0) ? pLine[-nStride] : 0;
- CONTEXT = (line1 & 0x1e00) | ((line2 >> 1) & 0x01f8);
- for(FX_DWORD w = 0; w < GBW; w += 8) {
- if(w + 8 < GBW) {
- nBits = 8;
- if(h > 1) {
- line1 = (line1 << 8) | (pLine[-nStride2 + (w >> 3) + 1] << 4);
- }
- if(h > 0) {
- line2 = (line2 << 8) | (pLine[-nStride + (w >> 3) + 1]);
- }
- } else {
- nBits = GBW - w;
- if(h > 1) {
- line1 <<= 8;
- }
- if(h > 0) {
- line2 <<= 8;
- }
- }
- cVal = 0;
- for(k = 0; k < nBits; k++) {
- if(USESKIP && SKIP->getPixel(w, h)) {
- bVal = 0;
- } else {
- bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
- }
- cVal |= bVal << (7 - k);
- CONTEXT = ((CONTEXT & 0x0efb) << 1) | bVal
- | ((line1 >> (7 - k)) & 0x0200)
- | ((line2 >> (8 - k)) & 0x0008);
- }
- pLine[w >> 3] = cVal;
- }
- }
- pLine += nStride;
- }
- return GBREG;
-}
-CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template1_opt3(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext)
-{
- FX_BOOL LTP, SLTP, bVal;
- FX_DWORD CONTEXT;
- CJBig2_Image *GBREG;
- FX_DWORD line1, line2;
- FX_BYTE *pLine, *pLine1, *pLine2, cVal;
- FX_INT32 nStride, nStride2, k;
- FX_INT32 nLineBytes, nBitsLeft, cc;
- LTP = 0;
- JBIG2_ALLOC(GBREG, CJBig2_Image(GBW, GBH));
- if (GBREG->m_pData == NULL) {
- delete GBREG;
- m_pModule->JBig2_Error("Generic region decoding procedure: Create Image Failed with width = %d, height = %d\n", GBW, GBH);
- return NULL;
- }
- pLine = GBREG->m_pData;
- nStride = GBREG->m_nStride;
- nStride2 = nStride << 1;
- nLineBytes = ((GBW + 7) >> 3) - 1;
- nBitsLeft = GBW - (nLineBytes << 3);
- for(FX_DWORD h = 0; h < GBH; h++) {
- if(TPGDON) {
- SLTP = pArithDecoder->DECODE(&gbContext[0x0795]);
- LTP = LTP ^ SLTP;
- }
- if(LTP == 1) {
- GBREG->copyLine(h, h - 1);
- } else {
- if(h > 1) {
- pLine1 = pLine - nStride2;
- pLine2 = pLine - nStride;
- line1 = (*pLine1++) << 4;
- line2 = *pLine2++;
- CONTEXT = (line1 & 0x1e00) | ((line2 >> 1) & 0x01f8);
- for(cc = 0; cc < nLineBytes; cc++) {
- line1 = (line1 << 8) | ((*pLine1++) << 4);
- line2 = (line2 << 8) | (*pLine2++);
- cVal = 0;
- for(k = 7; k >= 0; k--) {
- bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
- cVal |= bVal << k;
- CONTEXT = ((CONTEXT & 0x0efb) << 1) | bVal
- | ((line1 >> k) & 0x0200)
- | ((line2 >> (k + 1)) & 0x0008);
- }
- pLine[cc] = cVal;
- }
- line1 <<= 8;
- line2 <<= 8;
- cVal = 0;
- for(k = 0; k < nBitsLeft; k++) {
- bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
- cVal |= bVal << (7 - k);
- CONTEXT = ((CONTEXT & 0x0efb) << 1) | bVal
- | ((line1 >> (7 - k)) & 0x0200)
- | ((line2 >> (8 - k)) & 0x0008);
- }
- pLine[nLineBytes] = cVal;
- } else {
- pLine2 = pLine - nStride;
- line2 = (h & 1) ? (*pLine2++) : 0;
- CONTEXT = (line2 >> 1) & 0x01f8;
- for(cc = 0; cc < nLineBytes; cc++) {
- if(h & 1) {
- line2 = (line2 << 8) | (*pLine2++);
- }
- cVal = 0;
- for(k = 7; k >= 0; k--) {
- bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
- cVal |= bVal << k;
- CONTEXT = ((CONTEXT & 0x0efb) << 1) | bVal
- | ((line2 >> (k + 1)) & 0x0008);
- }
- pLine[cc] = cVal;
- }
- line2 <<= 8;
- cVal = 0;
- for(k = 0; k < nBitsLeft; k++) {
- bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
- cVal |= bVal << (7 - k);
- CONTEXT = ((CONTEXT & 0x0efb) << 1) | bVal
- | ((line2 >> (8 - k)) & 0x0008);
- }
- pLine[nLineBytes] = cVal;
- }
- }
- pLine += nStride;
- }
- return GBREG;
-}
-CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template1_unopt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext)
-{
- FX_BOOL LTP, SLTP, bVal;
- FX_DWORD CONTEXT;
- CJBig2_Image *GBREG;
- FX_DWORD line1, line2, line3;
- LTP = 0;
- JBIG2_ALLOC(GBREG, CJBig2_Image(GBW, GBH));
- GBREG->fill(0);
- for(FX_DWORD h = 0; h < GBH; h++) {
- if(TPGDON) {
- SLTP = pArithDecoder->DECODE(&gbContext[0x0795]);
- LTP = LTP ^ SLTP;
- }
- if(LTP == 1) {
- GBREG->copyLine(h, h - 1);
- } else {
- line1 = GBREG->getPixel(2, h - 2);
- line1 |= GBREG->getPixel(1, h - 2) << 1;
- line1 |= GBREG->getPixel(0, h - 2) << 2;
- line2 = GBREG->getPixel(2, h - 1);
- line2 |= GBREG->getPixel(1, h - 1) << 1;
- line2 |= GBREG->getPixel(0, h - 1) << 2;
- line3 = 0;
- for(FX_DWORD w = 0; w < GBW; w++) {
- if(USESKIP && SKIP->getPixel(w, h)) {
- bVal = 0;
- } else {
- CONTEXT = line3;
- CONTEXT |= GBREG->getPixel(w + GBAT[0], h + GBAT[1]) << 3;
- CONTEXT |= line2 << 4;
- CONTEXT |= line1 << 9;
- bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
- }
- if(bVal) {
- GBREG->setPixel(w, h, bVal);
- }
- line1 = ((line1 << 1) | GBREG->getPixel(w + 3, h - 2)) & 0x0f;
- line2 = ((line2 << 1) | GBREG->getPixel(w + 3, h - 1)) & 0x1f;
- line3 = ((line3 << 1) | bVal) & 0x07;
- }
- }
- }
- return GBREG;
-}
-CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template2_opt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext)
-{
- FX_BOOL LTP, SLTP, bVal;
- FX_DWORD CONTEXT;
- CJBig2_Image *GBREG;
- FX_DWORD line1, line2, line3;
- LTP = 0;
- JBIG2_ALLOC(GBREG, CJBig2_Image(GBW, GBH));
- GBREG->fill(0);
- for(FX_DWORD h = 0; h < GBH; h++) {
- if(TPGDON) {
- SLTP = pArithDecoder->DECODE(&gbContext[0x00e5]);
- LTP = LTP ^ SLTP;
- }
- if(LTP == 1) {
- GBREG->copyLine(h, h - 1);
- } else {
- line1 = GBREG->getPixel(1, h - 2);
- line1 |= GBREG->getPixel(0, h - 2) << 1;
- line2 = GBREG->getPixel(2, h - 1);
- line2 |= GBREG->getPixel(1, h - 1) << 1;
- line2 |= GBREG->getPixel(0, h - 1) << 2;
- line3 = 0;
- for(FX_DWORD w = 0; w < GBW; w++) {
- if(USESKIP && SKIP->getPixel(w, h)) {
- bVal = 0;
- } else {
- CONTEXT = line3;
- CONTEXT |= line2 << 2;
- CONTEXT |= line1 << 7;
- bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
- }
- if(bVal) {
- GBREG->setPixel(w, h, bVal);
- }
- line1 = ((line1 << 1) | GBREG->getPixel(w + 2, h - 2)) & 0x07;
- line2 = ((line2 << 1) | GBREG->getPixel(w + 3, h - 1)) & 0x1f;
- line3 = ((line3 << 1) | bVal) & 0x03;
- }
- }
- }
- return GBREG;
-}
-CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template2_opt2(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext)
-{
- FX_BOOL LTP, SLTP, bVal;
- FX_DWORD CONTEXT;
- CJBig2_Image *GBREG;
- FX_DWORD line1, line2;
- FX_BYTE *pLine, cVal;
- FX_INTPTR nStride, nStride2;
- FX_INT32 nBits, k;
- LTP = 0;
- JBIG2_ALLOC(GBREG, CJBig2_Image(GBW, GBH));
- if (GBREG->m_pData == NULL) {
- delete GBREG;
- m_pModule->JBig2_Error("Generic region decoding procedure: Create Image Failed with width = %d, height = %d\n", GBW, GBH);
- return NULL;
- }
- pLine = GBREG->m_pData;
- nStride = GBREG->m_nStride;
- nStride2 = nStride << 1;
- for(FX_DWORD h = 0; h < GBH; h++) {
- if(TPGDON) {
- SLTP = pArithDecoder->DECODE(&gbContext[0x00e5]);
- LTP = LTP ^ SLTP;
- }
- if(LTP == 1) {
- GBREG->copyLine(h, h - 1);
- } else {
- line1 = (h > 1) ? pLine[-nStride2] << 1 : 0;
- line2 = (h > 0) ? pLine[-nStride] : 0;
- CONTEXT = (line1 & 0x0380) | ((line2 >> 3) & 0x007c);
- for(FX_DWORD w = 0; w < GBW; w += 8) {
- if(w + 8 < GBW) {
- nBits = 8;
- if(h > 1) {
- line1 = (line1 << 8) | (pLine[-nStride2 + (w >> 3) + 1] << 1);
- }
- if(h > 0) {
- line2 = (line2 << 8) | (pLine[-nStride + (w >> 3) + 1]);
- }
- } else {
- nBits = GBW - w;
- if(h > 1) {
- line1 <<= 8;
- }
- if(h > 0) {
- line2 <<= 8;
- }
- }
- cVal = 0;
- for(k = 0; k < nBits; k++) {
- if(USESKIP && SKIP->getPixel(w, h)) {
- bVal = 0;
- } else {
- bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
- }
- cVal |= bVal << (7 - k);
- CONTEXT = ((CONTEXT & 0x01bd) << 1) | bVal
- | ((line1 >> (7 - k)) & 0x0080)
- | ((line2 >> (10 - k)) & 0x0004);
- }
- pLine[w >> 3] = cVal;
- }
- }
- pLine += nStride;
- }
- return GBREG;
-}
-CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template2_opt3(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext)
-{
- FX_BOOL LTP, SLTP, bVal;
- FX_DWORD CONTEXT;
- CJBig2_Image *GBREG;
- FX_DWORD line1, line2;
- FX_BYTE *pLine, *pLine1, *pLine2, cVal;
- FX_INT32 nStride, nStride2, k;
- FX_INT32 nLineBytes, nBitsLeft, cc;
- LTP = 0;
- JBIG2_ALLOC(GBREG, CJBig2_Image(GBW, GBH));
- if (GBREG->m_pData == NULL) {
- delete GBREG;
- m_pModule->JBig2_Error("Generic region decoding procedure: Create Image Failed with width = %d, height = %d\n", GBW, GBH);
- return NULL;
- }
- pLine = GBREG->m_pData;
- nStride = GBREG->m_nStride;
- nStride2 = nStride << 1;
- nLineBytes = ((GBW + 7) >> 3) - 1;
- nBitsLeft = GBW - (nLineBytes << 3);
- for(FX_DWORD h = 0; h < GBH; h++) {
- if(TPGDON) {
- SLTP = pArithDecoder->DECODE(&gbContext[0x00e5]);
- LTP = LTP ^ SLTP;
- }
- if(LTP == 1) {
- GBREG->copyLine(h, h - 1);
- } else {
- if(h > 1) {
- pLine1 = pLine - nStride2;
- pLine2 = pLine - nStride;
- line1 = (*pLine1++) << 1;
- line2 = *pLine2++;
- CONTEXT = (line1 & 0x0380) | ((line2 >> 3) & 0x007c);
- for(cc = 0; cc < nLineBytes; cc++) {
- line1 = (line1 << 8) | ((*pLine1++) << 1);
- line2 = (line2 << 8) | (*pLine2++);
- cVal = 0;
- for(k = 7; k >= 0; k--) {
- bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
- cVal |= bVal << k;
- CONTEXT = ((CONTEXT & 0x01bd) << 1) | bVal
- | ((line1 >> k) & 0x0080)
- | ((line2 >> (k + 3)) & 0x0004);
- }
- pLine[cc] = cVal;
- }
- line1 <<= 8;
- line2 <<= 8;
- cVal = 0;
- for(k = 0; k < nBitsLeft; k++) {
- bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
- cVal |= bVal << (7 - k);
- CONTEXT = ((CONTEXT & 0x01bd) << 1) | bVal
- | ((line1 >> (7 - k)) & 0x0080)
- | ((line2 >> (10 - k)) & 0x0004);
- }
- pLine[nLineBytes] = cVal;
- } else {
- pLine2 = pLine - nStride;
- line2 = (h & 1) ? (*pLine2++) : 0;
- CONTEXT = (line2 >> 3) & 0x007c;
- for(cc = 0; cc < nLineBytes; cc++) {
- if(h & 1) {
- line2 = (line2 << 8) | (*pLine2++);
- }
- cVal = 0;
- for(k = 7; k >= 0; k--) {
- bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
- cVal |= bVal << k;
- CONTEXT = ((CONTEXT & 0x01bd) << 1) | bVal
- | ((line2 >> (k + 3)) & 0x0004);
- }
- pLine[cc] = cVal;
- }
- line2 <<= 8;
- cVal = 0;
- for(k = 0; k < nBitsLeft; k++) {
- bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
- cVal |= bVal << (7 - k);
- CONTEXT = ((CONTEXT & 0x01bd) << 1) | bVal
- | (((line2 >> (10 - k))) & 0x0004);
- }
- pLine[nLineBytes] = cVal;
- }
- }
- pLine += nStride;
- }
- return GBREG;
-}
-CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template2_unopt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext)
-{
- FX_BOOL LTP, SLTP, bVal;
- FX_DWORD CONTEXT;
- CJBig2_Image *GBREG;
- FX_DWORD line1, line2, line3;
- LTP = 0;
- JBIG2_ALLOC(GBREG, CJBig2_Image(GBW, GBH));
- GBREG->fill(0);
- for(FX_DWORD h = 0; h < GBH; h++) {
- if(TPGDON) {
- SLTP = pArithDecoder->DECODE(&gbContext[0x00e5]);
- LTP = LTP ^ SLTP;
- }
- if(LTP == 1) {
- GBREG->copyLine(h, h - 1);
- } else {
- line1 = GBREG->getPixel(1, h - 2);
- line1 |= GBREG->getPixel(0, h - 2) << 1;
- line2 = GBREG->getPixel(1, h - 1);
- line2 |= GBREG->getPixel(0, h - 1) << 1;
- line3 = 0;
- for(FX_DWORD w = 0; w < GBW; w++) {
- if(USESKIP && SKIP->getPixel(w, h)) {
- bVal = 0;
- } else {
- CONTEXT = line3;
- CONTEXT |= GBREG->getPixel(w + GBAT[0], h + GBAT[1]) << 2;
- CONTEXT |= line2 << 3;
- CONTEXT |= line1 << 7;
- bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
- }
- if(bVal) {
- GBREG->setPixel(w, h, bVal);
- }
- line1 = ((line1 << 1) | GBREG->getPixel(w + 2, h - 2)) & 0x07;
- line2 = ((line2 << 1) | GBREG->getPixel(w + 2, h - 1)) & 0x0f;
- line3 = ((line3 << 1) | bVal) & 0x03;
- }
- }
- }
- return GBREG;
-}
-CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template3_opt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext)
-{
- FX_BOOL LTP, SLTP, bVal;
- FX_DWORD CONTEXT;
- CJBig2_Image *GBREG;
- FX_DWORD line1, line2;
- LTP = 0;
- JBIG2_ALLOC(GBREG, CJBig2_Image(GBW, GBH));
- GBREG->fill(0);
- for(FX_DWORD h = 0; h < GBH; h++) {
- if(TPGDON) {
- SLTP = pArithDecoder->DECODE(&gbContext[0x0195]);
- LTP = LTP ^ SLTP;
- }
- if(LTP == 1) {
- GBREG->copyLine(h, h - 1);
- } else {
- line1 = GBREG->getPixel(2, h - 1);
- line1 |= GBREG->getPixel(1, h - 1) << 1;
- line1 |= GBREG->getPixel(0, h - 1) << 2;
- line2 = 0;
- for(FX_DWORD w = 0; w < GBW; w++) {
- if(USESKIP && SKIP->getPixel(w, h)) {
- bVal = 0;
- } else {
- CONTEXT = line2;
- CONTEXT |= line1 << 4;
- bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
- }
- if(bVal) {
- GBREG->setPixel(w, h, bVal);
- }
- line1 = ((line1 << 1) | GBREG->getPixel(w + 3, h - 1)) & 0x3f;
- line2 = ((line2 << 1) | bVal) & 0x0f;
- }
- }
- }
- return GBREG;
-}
-CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template3_opt2(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext)
-{
- FX_BOOL LTP, SLTP, bVal;
- FX_DWORD CONTEXT;
- CJBig2_Image *GBREG;
- FX_DWORD line1;
- FX_BYTE *pLine, cVal;
- FX_INTPTR nStride, nStride2;
- FX_INT32 nBits, k;
- LTP = 0;
- JBIG2_ALLOC(GBREG, CJBig2_Image(GBW, GBH));
- if (GBREG->m_pData == NULL) {
- delete GBREG;
- m_pModule->JBig2_Error("Generic region decoding procedure: Create Image Failed with width = %d, height = %d\n", GBW, GBH);
- return NULL;
- }
- pLine = GBREG->m_pData;
- nStride = GBREG->m_nStride;
- nStride2 = nStride << 1;
- for(FX_DWORD h = 0; h < GBH; h++) {
- if(TPGDON) {
- SLTP = pArithDecoder->DECODE(&gbContext[0x0195]);
- LTP = LTP ^ SLTP;
- }
- if(LTP == 1) {
- GBREG->copyLine(h, h - 1);
- } else {
- line1 = (h > 0) ? pLine[-nStride] : 0;
- CONTEXT = (line1 >> 1) & 0x03f0;
- for(FX_DWORD w = 0; w < GBW; w += 8) {
- if(w + 8 < GBW) {
- nBits = 8;
- if(h > 0) {
- line1 = (line1 << 8) | (pLine[-nStride + (w >> 3) + 1]);
- }
- } else {
- nBits = GBW - w;
- if(h > 0) {
- line1 <<= 8;
- }
- }
- cVal = 0;
- for(k = 0; k < nBits; k++) {
- if(USESKIP && SKIP->getPixel(w, h)) {
- bVal = 0;
- } else {
- bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
- }
- cVal |= bVal << (7 - k);
- CONTEXT = ((CONTEXT & 0x01f7) << 1) | bVal
- | ((line1 >> (8 - k)) & 0x0010);
- }
- pLine[w >> 3] = cVal;
- }
- }
- pLine += nStride;
- }
- return GBREG;
-}
-CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template3_opt3(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext)
-{
- FX_BOOL LTP, SLTP, bVal;
- FX_DWORD CONTEXT;
- CJBig2_Image *GBREG;
- FX_DWORD line1;
- FX_BYTE *pLine, *pLine1, cVal;
- FX_INT32 nStride, k;
- FX_INT32 nLineBytes, nBitsLeft, cc;
- LTP = 0;
- JBIG2_ALLOC(GBREG, CJBig2_Image(GBW, GBH));
- if (GBREG->m_pData == NULL) {
- delete GBREG;
- m_pModule->JBig2_Error("Generic region decoding procedure: Create Image Failed with width = %d, height = %d\n", GBW, GBH);
- return NULL;
- }
- pLine = GBREG->m_pData;
- nStride = GBREG->m_nStride;
- nLineBytes = ((GBW + 7) >> 3) - 1;
- nBitsLeft = GBW - (nLineBytes << 3);
- for(FX_DWORD h = 0; h < GBH; h++) {
- if(TPGDON) {
- SLTP = pArithDecoder->DECODE(&gbContext[0x0195]);
- LTP = LTP ^ SLTP;
- }
- if(LTP == 1) {
- GBREG->copyLine(h, h - 1);
- } else {
- if(h > 0) {
- pLine1 = pLine - nStride;
- line1 = *pLine1++;
- CONTEXT = (line1 >> 1) & 0x03f0;
- for(cc = 0; cc < nLineBytes; cc++) {
- line1 = (line1 << 8) | (*pLine1++);
- cVal = 0;
- for(k = 7; k >= 0; k--) {
- bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
- cVal |= bVal << k;
- CONTEXT = ((CONTEXT & 0x01f7) << 1) | bVal
- | ((line1 >> (k + 1)) & 0x0010);
- }
- pLine[cc] = cVal;
- }
- line1 <<= 8;
- cVal = 0;
- for(k = 0; k < nBitsLeft; k++) {
- bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
- cVal |= bVal << (7 - k);
- CONTEXT = ((CONTEXT & 0x01f7) << 1) | bVal
- | ((line1 >> (8 - k)) & 0x0010);
- }
- pLine[nLineBytes] = cVal;
- } else {
- CONTEXT = 0;
- for(cc = 0; cc < nLineBytes; cc++) {
- cVal = 0;
- for(k = 7; k >= 0; k--) {
- bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
- cVal |= bVal << k;
- CONTEXT = ((CONTEXT & 0x01f7) << 1) | bVal;
- }
- pLine[cc] = cVal;
- }
- cVal = 0;
- for(k = 0; k < nBitsLeft; k++) {
- bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
- cVal |= bVal << (7 - k);
- CONTEXT = ((CONTEXT & 0x01f7) << 1) | bVal;
- }
- pLine[nLineBytes] = cVal;
- }
- }
- pLine += nStride;
- }
- return GBREG;
-}
-CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template3_unopt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext)
-{
- FX_BOOL LTP, SLTP, bVal;
- FX_DWORD CONTEXT;
- CJBig2_Image *GBREG;
- FX_DWORD line1, line2;
- LTP = 0;
- JBIG2_ALLOC(GBREG, CJBig2_Image(GBW, GBH));
- GBREG->fill(0);
- for(FX_DWORD h = 0; h < GBH; h++) {
- if(TPGDON) {
- SLTP = pArithDecoder->DECODE(&gbContext[0x0195]);
- LTP = LTP ^ SLTP;
- }
- if(LTP == 1) {
- GBREG->copyLine(h, h - 1);
- } else {
- line1 = GBREG->getPixel(1, h - 1);
- line1 |= GBREG->getPixel(0, h - 1) << 1;
- line2 = 0;
- for(FX_DWORD w = 0; w < GBW; w++) {
- if(USESKIP && SKIP->getPixel(w, h)) {
- bVal = 0;
- } else {
- CONTEXT = line2;
- CONTEXT |= GBREG->getPixel(w + GBAT[0], h + GBAT[1]) << 4;
- CONTEXT |= line1 << 5;
- bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
- }
- if(bVal) {
- GBREG->setPixel(w, h, bVal);
- }
- line1 = ((line1 << 1) | GBREG->getPixel(w + 2, h - 1)) & 0x1f;
- line2 = ((line2 << 1) | bVal) & 0x0f;
- }
- }
- }
- return GBREG;
-}
-CJBig2_Image *CJBig2_GRDProc::decode_Arith_V2(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext)
-{
- FX_BOOL LTP, SLTP, bVal;
- FX_DWORD CONTEXT;
- CJBig2_Image *GBREG;
- FX_DWORD line1, line2, line3;
- LTP = 0;
- JBIG2_ALLOC(GBREG, CJBig2_Image(GBW, GBH));
- GBREG->fill(0);
- for(FX_DWORD h = 0; h < GBH; h++) {
- if(TPGDON) {
- switch(GBTEMPLATE) {
- case 0:
- CONTEXT = 0x9b25;
- break;
- case 1:
- CONTEXT = 0x0795;
- break;
- case 2:
- CONTEXT = 0x00e5;
- break;
- case 3:
- CONTEXT = 0x0195;
- break;
- }
- SLTP = pArithDecoder->DECODE(&gbContext[CONTEXT]);
- LTP = LTP ^ SLTP;
- }
- if(LTP == 1) {
- GBREG->copyLine(h, h - 1);
- } else {
- switch(GBTEMPLATE) {
- case 0: {
- line1 = GBREG->getPixel(1, h - 2);
- line1 |= GBREG->getPixel(0, h - 2) << 1;
- line2 = GBREG->getPixel(2, h - 1);
- line2 |= GBREG->getPixel(1, h - 1) << 1;
- line2 |= GBREG->getPixel(0, h - 1) << 2;
- line3 = 0;
- for(FX_DWORD w = 0; w < GBW; w++) {
- if(USESKIP && SKIP->getPixel(w, h)) {
- bVal = 0;
- } else {
- CONTEXT = line3;
- CONTEXT |= GBREG->getPixel(w + GBAT[0], h + GBAT[1]) << 4;
- CONTEXT |= line2 << 5;
- CONTEXT |= GBREG->getPixel(w + GBAT[2], h + GBAT[3]) << 10;
- CONTEXT |= GBREG->getPixel(w + GBAT[4], h + GBAT[5]) << 11;
- CONTEXT |= line1 << 12;
- CONTEXT |= GBREG->getPixel(w + GBAT[6], h + GBAT[7]) << 15;
- bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
- }
- if(bVal) {
- GBREG->setPixel(w, h, bVal);
- }
- line1 = ((line1 << 1) | GBREG->getPixel(w + 2, h - 2)) & 0x07;
- line2 = ((line2 << 1) | GBREG->getPixel(w + 3, h - 1)) & 0x1f;
- line3 = ((line3 << 1) | bVal) & 0x0f;
- }
- }
- break;
- case 1: {
- line1 = GBREG->getPixel(2, h - 2);
- line1 |= GBREG->getPixel(1, h - 2) << 1;
- line1 |= GBREG->getPixel(0, h - 2) << 2;
- line2 = GBREG->getPixel(2, h - 1);
- line2 |= GBREG->getPixel(1, h - 1) << 1;
- line2 |= GBREG->getPixel(0, h - 1) << 2;
- line3 = 0;
- for(FX_DWORD w = 0; w < GBW; w++) {
- if(USESKIP && SKIP->getPixel(w, h)) {
- bVal = 0;
- } else {
- CONTEXT = line3;
- CONTEXT |= GBREG->getPixel(w + GBAT[0], h + GBAT[1]) << 3;
- CONTEXT |= line2 << 4;
- CONTEXT |= line1 << 9;
- bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
- }
- if(bVal) {
- GBREG->setPixel(w, h, bVal);
- }
- line1 = ((line1 << 1) | GBREG->getPixel(w + 3, h - 2)) & 0x0f;
- line2 = ((line2 << 1) | GBREG->getPixel(w + 3, h - 1)) & 0x1f;
- line3 = ((line3 << 1) | bVal) & 0x07;
- }
- }
- break;
- case 2: {
- line1 = GBREG->getPixel(1, h - 2);
- line1 |= GBREG->getPixel(0, h - 2) << 1;
- line2 = GBREG->getPixel(1, h - 1);
- line2 |= GBREG->getPixel(0, h - 1) << 1;
- line3 = 0;
- for(FX_DWORD w = 0; w < GBW; w++) {
- if(USESKIP && SKIP->getPixel(w, h)) {
- bVal = 0;
- } else {
- CONTEXT = line3;
- CONTEXT |= GBREG->getPixel(w + GBAT[0], h + GBAT[1]) << 2;
- CONTEXT |= line2 << 3;
- CONTEXT |= line1 << 7;
- bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
- }
- if(bVal) {
- GBREG->setPixel(w, h, bVal);
- }
- line1 = ((line1 << 1) | GBREG->getPixel(w + 2, h - 2)) & 0x07;
- line2 = ((line2 << 1) | GBREG->getPixel(w + 2, h - 1)) & 0x0f;
- line3 = ((line3 << 1) | bVal) & 0x03;
- }
- }
- break;
- case 3: {
- line1 = GBREG->getPixel(1, h - 1);
- line1 |= GBREG->getPixel(0, h - 1) << 1;
- line2 = 0;
- for(FX_DWORD w = 0; w < GBW; w++) {
- if(USESKIP && SKIP->getPixel(w, h)) {
- bVal = 0;
- } else {
- CONTEXT = line2;
- CONTEXT |= GBREG->getPixel(w + GBAT[0], h + GBAT[1]) << 4;
- CONTEXT |= line1 << 5;
- bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
- }
- if(bVal) {
- GBREG->setPixel(w, h, bVal);
- }
- line1 = ((line1 << 1) | GBREG->getPixel(w + 2, h - 1)) & 0x1f;
- line2 = ((line2 << 1) | bVal) & 0x0f;
- }
- }
- break;
- }
- }
- }
- return GBREG;
-}
-CJBig2_Image *CJBig2_GRDProc::decode_Arith_V1(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext)
-{
- FX_BOOL LTP, SLTP, bVal;
- FX_DWORD CONTEXT = 0;
- CJBig2_Image *GBREG;
- LTP = 0;
- JBIG2_ALLOC(GBREG, CJBig2_Image(GBW, GBH));
- GBREG->fill(0);
- for(FX_DWORD h = 0; h < GBH; h++) {
- if(TPGDON) {
- switch(GBTEMPLATE) {
- case 0:
- CONTEXT = 0x9b25;
- break;
- case 1:
- CONTEXT = 0x0795;
- break;
- case 2:
- CONTEXT = 0x00e5;
- break;
- case 3:
- CONTEXT = 0x0195;
- break;
- }
- SLTP = pArithDecoder->DECODE(&gbContext[CONTEXT]);
- LTP = LTP ^ SLTP;
- }
- if(LTP == 1) {
- for(FX_DWORD w = 0; w < GBW; w++) {
- GBREG->setPixel(w, h, GBREG->getPixel(w, h - 1));
- }
- } else {
- for(FX_DWORD w = 0; w < GBW; w++) {
- if(USESKIP && SKIP->getPixel(w, h)) {
- GBREG->setPixel(w, h, 0);
- } else {
- CONTEXT = 0;
- switch(GBTEMPLATE) {
- case 0:
- CONTEXT |= GBREG->getPixel(w - 1, h);
- CONTEXT |= GBREG->getPixel(w - 2, h) << 1;
- CONTEXT |= GBREG->getPixel(w - 3, h) << 2;
- CONTEXT |= GBREG->getPixel(w - 4, h) << 3;
- CONTEXT |= GBREG->getPixel(w + GBAT[0], h + GBAT[1]) << 4;
- CONTEXT |= GBREG->getPixel(w + 2, h - 1) << 5;
- CONTEXT |= GBREG->getPixel(w + 1, h - 1) << 6;
- CONTEXT |= GBREG->getPixel(w, h - 1) << 7;
- CONTEXT |= GBREG->getPixel(w - 1, h - 1) << 8;
- CONTEXT |= GBREG->getPixel(w - 2, h - 1) << 9;
- CONTEXT |= GBREG->getPixel(w + GBAT[2], h + GBAT[3]) << 10;
- CONTEXT |= GBREG->getPixel(w + GBAT[4], h + GBAT[5]) << 11;
- CONTEXT |= GBREG->getPixel(w + 1, h - 2) << 12;
- CONTEXT |= GBREG->getPixel(w, h - 2) << 13;
- CONTEXT |= GBREG->getPixel(w - 1, h - 2) << 14;
- CONTEXT |= GBREG->getPixel(w + GBAT[6], h + GBAT[7]) << 15;
- break;
- case 1:
- CONTEXT |= GBREG->getPixel(w - 1, h);
- CONTEXT |= GBREG->getPixel(w - 2, h) << 1;
- CONTEXT |= GBREG->getPixel(w - 3, h) << 2;
- CONTEXT |= GBREG->getPixel(w + GBAT[0], h + GBAT[1]) << 3;
- CONTEXT |= GBREG->getPixel(w + 2, h - 1) << 4;
- CONTEXT |= GBREG->getPixel(w + 1, h - 1) << 5;
- CONTEXT |= GBREG->getPixel(w, h - 1) << 6;
- CONTEXT |= GBREG->getPixel(w - 1, h - 1) << 7;
- CONTEXT |= GBREG->getPixel(w - 2, h - 1) << 8;
- CONTEXT |= GBREG->getPixel(w + 2, h - 2) << 9;
- CONTEXT |= GBREG->getPixel(w + 1, h - 2) << 10;
- CONTEXT |= GBREG->getPixel(w, h - 2) << 11;
- CONTEXT |= GBREG->getPixel(w - 1, h - 2) << 12;
- break;
- case 2:
- CONTEXT |= GBREG->getPixel(w - 1, h);
- CONTEXT |= GBREG->getPixel(w - 2, h) << 1;
- CONTEXT |= GBREG->getPixel(w + GBAT[0], h + GBAT[1]) << 2;
- CONTEXT |= GBREG->getPixel(w + 1, h - 1) << 3;
- CONTEXT |= GBREG->getPixel(w, h - 1) << 4;
- CONTEXT |= GBREG->getPixel(w - 1, h - 1) << 5;
- CONTEXT |= GBREG->getPixel(w - 2, h - 1) << 6;
- CONTEXT |= GBREG->getPixel(w + 1, h - 2) << 7;
- CONTEXT |= GBREG->getPixel(w, h - 2) << 8;
- CONTEXT |= GBREG->getPixel(w - 1, h - 2) << 9;
- break;
- case 3:
- CONTEXT |= GBREG->getPixel(w - 1, h);
- CONTEXT |= GBREG->getPixel(w - 2, h) << 1;
- CONTEXT |= GBREG->getPixel(w - 3, h) << 2;
- CONTEXT |= GBREG->getPixel(w - 4, h) << 3;
- CONTEXT |= GBREG->getPixel(w + GBAT[0], h + GBAT[1]) << 4;
- CONTEXT |= GBREG->getPixel(w + 1, h - 1) << 5;
- CONTEXT |= GBREG->getPixel(w, h - 1) << 6;
- CONTEXT |= GBREG->getPixel(w - 1, h - 1) << 7;
- CONTEXT |= GBREG->getPixel(w - 2, h - 1) << 8;
- CONTEXT |= GBREG->getPixel(w - 3, h - 1) << 9;
- break;
- }
- bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
- GBREG->setPixel(w, h, bVal);
- }
- }
- }
- }
- return GBREG;
-}
-CJBig2_Image *CJBig2_GRDProc::decode_MMR(CJBig2_BitStream *pStream)
-{
- int bitpos, i;
- CJBig2_Image *pImage;
- JBIG2_ALLOC(pImage, CJBig2_Image(GBW, GBH));
- if (pImage->m_pData == NULL) {
- delete pImage;
- m_pModule->JBig2_Error("Generic region decoding procedure: Create Image Failed with width = %d, height = %d\n", GBW, GBH);
- return NULL;
- }
- bitpos = (int)pStream->getBitPos();
- _FaxG4Decode(m_pModule, pStream->getBuf(), pStream->getLength(), &bitpos, pImage->m_pData, GBW, GBH, pImage->m_nStride);
- pStream->setBitPos(bitpos);
- for(i = 0; (FX_DWORD)i < pImage->m_nStride * GBH; i++) {
- pImage->m_pData[i] = ~pImage->m_pData[i];
- }
- return pImage;
-}
-CJBig2_Image *CJBig2_GRRDProc::decode(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *grContext)
-{
- if (GRW == 0 || GRH == 0) {
- CJBig2_Image* pImage;
- JBIG2_ALLOC(pImage, CJBig2_Image(GRW, GRH));
- return pImage;
- }
- if(GRTEMPLATE == 0) {
- if((GRAT[0] == (signed char) - 1) && (GRAT[1] == (signed char) - 1)
- && (GRAT[2] == (signed char) - 1) && (GRAT[3] == (signed char) - 1)
- && (GRREFERENCEDX == 0) && (GRW == (FX_DWORD)GRREFERENCE->m_nWidth)) {
- return decode_Template0_opt(pArithDecoder, grContext);
- } else {
- return decode_Template0_unopt(pArithDecoder, grContext);
- }
- } else {
- if((GRREFERENCEDX == 0) && (GRW == (FX_DWORD)GRREFERENCE->m_nWidth)) {
- return decode_Template1_opt(pArithDecoder, grContext);
- } else {
- return decode_Template1_unopt(pArithDecoder, grContext);
- }
- }
-}
-CJBig2_Image *CJBig2_GRRDProc::decode_Template0_unopt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *grContext)
-{
- FX_BOOL LTP, SLTP, bVal;
- FX_DWORD CONTEXT;
- CJBig2_Image *GRREG;
- FX_DWORD line1, line2, line3, line4, line5;
- LTP = 0;
- JBIG2_ALLOC(GRREG, CJBig2_Image(GRW, GRH));
- GRREG->fill(0);
- for(FX_DWORD h = 0; h < GRH; h++) {
- if(TPGRON) {
- SLTP = pArithDecoder->DECODE(&grContext[0x0010]);
- LTP = LTP ^ SLTP;
- }
- if(LTP == 0) {
- line1 = GRREG->getPixel(1, h - 1);
- line1 |= GRREG->getPixel(0, h - 1) << 1;
- line2 = 0;
- line3 = GRREFERENCE->getPixel(-GRREFERENCEDX + 1, h - GRREFERENCEDY - 1);
- line3 |= GRREFERENCE->getPixel(-GRREFERENCEDX, h - GRREFERENCEDY - 1) << 1;
- line4 = GRREFERENCE->getPixel(-GRREFERENCEDX + 1, h - GRREFERENCEDY);
- line4 |= GRREFERENCE->getPixel(-GRREFERENCEDX, h - GRREFERENCEDY) << 1;
- line4 |= GRREFERENCE->getPixel(-GRREFERENCEDX - 1, h - GRREFERENCEDY) << 2;
- line5 = GRREFERENCE->getPixel(-GRREFERENCEDX + 1, h - GRREFERENCEDY + 1);
- line5 |= GRREFERENCE->getPixel(-GRREFERENCEDX, h - GRREFERENCEDY + 1) << 1;
- line5 |= GRREFERENCE->getPixel(-GRREFERENCEDX - 1, h - GRREFERENCEDY + 1) << 2;
- for(FX_DWORD w = 0; w < GRW; w++) {
- CONTEXT = line5;
- CONTEXT |= line4 << 3;
- CONTEXT |= line3 << 6;
- CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX + GRAT[2], h - GRREFERENCEDY + GRAT[3]) << 8;
- CONTEXT |= line2 << 9;
- CONTEXT |= line1 << 10;
- CONTEXT |= GRREG->getPixel(w + GRAT[0], h + GRAT[1]) << 12;
- bVal = pArithDecoder->DECODE(&grContext[CONTEXT]);
- GRREG->setPixel(w, h, bVal);
- line1 = ((line1 << 1) | GRREG->getPixel(w + 2, h - 1)) & 0x03;
- line2 = ((line2 << 1) | bVal) & 0x01;
- line3 = ((line3 << 1) | GRREFERENCE->getPixel(w - GRREFERENCEDX + 2, h - GRREFERENCEDY - 1)) & 0x03;
- line4 = ((line4 << 1) | GRREFERENCE->getPixel(w - GRREFERENCEDX + 2, h - GRREFERENCEDY)) & 0x07;
- line5 = ((line5 << 1) | GRREFERENCE->getPixel(w - GRREFERENCEDX + 2, h - GRREFERENCEDY + 1)) & 0x07;
- }
- } else {
- line1 = GRREG->getPixel(1, h - 1);
- line1 |= GRREG->getPixel(0, h - 1) << 1;
- line2 = 0;
- line3 = GRREFERENCE->getPixel(-GRREFERENCEDX + 1, h - GRREFERENCEDY - 1);
- line3 |= GRREFERENCE->getPixel(-GRREFERENCEDX, h - GRREFERENCEDY - 1) << 1;
- line4 = GRREFERENCE->getPixel(-GRREFERENCEDX + 1, h - GRREFERENCEDY);
- line4 |= GRREFERENCE->getPixel(-GRREFERENCEDX, h - GRREFERENCEDY) << 1;
- line4 |= GRREFERENCE->getPixel(-GRREFERENCEDX - 1, h - GRREFERENCEDY) << 2;
- line5 = GRREFERENCE->getPixel(-GRREFERENCEDX + 1, h - GRREFERENCEDY + 1);
- line5 |= GRREFERENCE->getPixel(-GRREFERENCEDX, h - GRREFERENCEDY + 1) << 1;
- line5 |= GRREFERENCE->getPixel(-GRREFERENCEDX - 1, h - GRREFERENCEDY + 1) << 2;
- for(FX_DWORD w = 0; w < GRW; w++) {
- bVal = GRREFERENCE->getPixel(w, h);
- if(!(TPGRON && (bVal == GRREFERENCE->getPixel(w - 1, h - 1))
- && (bVal == GRREFERENCE->getPixel(w, h - 1))
- && (bVal == GRREFERENCE->getPixel(w + 1, h - 1))
- && (bVal == GRREFERENCE->getPixel(w - 1, h))
- && (bVal == GRREFERENCE->getPixel(w + 1, h))
- && (bVal == GRREFERENCE->getPixel(w - 1, h + 1))
- && (bVal == GRREFERENCE->getPixel(w, h + 1))
- && (bVal == GRREFERENCE->getPixel(w + 1, h + 1)))) {
- CONTEXT = line5;
- CONTEXT |= line4 << 3;
- CONTEXT |= line3 << 6;
- CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX + GRAT[2], h - GRREFERENCEDY + GRAT[3]) << 8;
- CONTEXT |= line2 << 9;
- CONTEXT |= line1 << 10;
- CONTEXT |= GRREG->getPixel(w + GRAT[0], h + GRAT[1]) << 12;
- bVal = pArithDecoder->DECODE(&grContext[CONTEXT]);
- }
- GRREG->setPixel(w, h, bVal);
- line1 = ((line1 << 1) | GRREG->getPixel(w + 2, h - 1)) & 0x03;
- line2 = ((line2 << 1) | bVal) & 0x01;
- line3 = ((line3 << 1) | GRREFERENCE->getPixel(w - GRREFERENCEDX + 2, h - GRREFERENCEDY - 1)) & 0x03;
- line4 = ((line4 << 1) | GRREFERENCE->getPixel(w - GRREFERENCEDX + 2, h - GRREFERENCEDY)) & 0x07;
- line5 = ((line5 << 1) | GRREFERENCE->getPixel(w - GRREFERENCEDX + 2, h - GRREFERENCEDY + 1)) & 0x07;
- }
- }
- }
- return GRREG;
-}
-CJBig2_Image *CJBig2_GRRDProc::decode_Template0_opt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *grContext)
-{
- FX_BOOL LTP, SLTP, bVal;
- FX_DWORD CONTEXT;
- CJBig2_Image *GRREG;
- FX_DWORD line1, line1_r, line2_r, line3_r;
- FX_BYTE *pLine, *pLineR, cVal;
- FX_INTPTR nStride, nStrideR, nOffset;
- FX_INT32 k, nBits;
- FX_INT32 GRWR, GRHR;
- FX_INT32 GRW, GRH;
- GRW = (FX_INT32)CJBig2_GRRDProc::GRW;
- GRH = (FX_INT32)CJBig2_GRRDProc::GRH;
- LTP = 0;
- JBIG2_ALLOC(GRREG, CJBig2_Image(GRW, GRH));
- if (GRREG->m_pData == NULL) {
- delete GRREG;
- m_pModule->JBig2_Error("Generic refinement region decoding procedure: Create Image Failed with width = %d, height = %d\n", GRW, GRH);
- return NULL;
- }
- pLine = GRREG->m_pData;
- pLineR = GRREFERENCE->m_pData;
- nStride = GRREG->m_nStride;
- nStrideR = GRREFERENCE->m_nStride;
- GRWR = (FX_INT32)GRREFERENCE->m_nWidth;
- GRHR = (FX_INT32)GRREFERENCE->m_nHeight;
- if (GRREFERENCEDY < -GRHR + 1 || GRREFERENCEDY > GRHR - 1) {
- GRREFERENCEDY = 0;
- }
- nOffset = -GRREFERENCEDY * nStrideR;
- for (FX_INT32 h = 0; h < GRH; h++) {
- if(TPGRON) {
- SLTP = pArithDecoder->DECODE(&grContext[0x0010]);
- LTP = LTP ^ SLTP;
- }
- line1 = (h > 0) ? pLine[-nStride] << 4 : 0;
- FX_INT32 reference_h = h - GRREFERENCEDY;
- FX_BOOL line1_r_ok = (reference_h > 0 && reference_h < GRHR + 1);
- FX_BOOL line2_r_ok = (reference_h > -1 && reference_h < GRHR);
- FX_BOOL line3_r_ok = (reference_h > -2 && reference_h < GRHR - 1);
- line1_r = line1_r_ok ? pLineR[nOffset - nStrideR] : 0;
- line2_r = line2_r_ok ? pLineR[nOffset] : 0;
- line3_r = line3_r_ok ? pLineR[nOffset + nStrideR] : 0;
- if(LTP == 0) {
- CONTEXT = (line1 & 0x1c00) | (line1_r & 0x01c0)
- | ((line2_r >> 3) & 0x0038) | ((line3_r >> 6) & 0x0007);
- for (FX_INT32 w = 0; w < GRW; w += 8) {
- nBits = GRW - w > 8 ? 8 : GRW - w;
- if (h > 0)
- line1 = (line1 << 8) |
- (w + 8 < GRW ? pLine[-nStride + (w >> 3) + 1] << 4 : 0);
- if (h > GRHR + GRREFERENCEDY + 1) {
- line1_r = 0;
- line2_r = 0;
- line3_r = 0;
- } else {
- if(line1_r_ok)
- line1_r = (line1_r << 8) |
- (w + 8 < GRWR ? pLineR[nOffset - nStrideR + (w >> 3) + 1] : 0);
- if(line2_r_ok)
- line2_r = (line2_r << 8) |
- (w + 8 < GRWR ? pLineR[nOffset + (w >> 3) + 1] : 0);
- if(line3_r_ok)
- line3_r = (line3_r << 8) |
- (w + 8 < GRWR ? pLineR[nOffset + nStrideR + (w >> 3) + 1] : 0);
- else {
- line3_r = 0;
- }
- }
- cVal = 0;
- for (k = 0; k < nBits; k++) {
- bVal = pArithDecoder->DECODE(&grContext[CONTEXT]);
- cVal |= bVal << (7 - k);
- CONTEXT = ((CONTEXT & 0x0cdb) << 1) | (bVal << 9) |
- ((line1 >> (7 - k)) & 0x0400) |
- ((line1_r >> (7 - k)) & 0x0040) |
- ((line2_r >> (10 - k)) & 0x0008) |
- ((line3_r >> (13 - k)) & 0x0001);
- }
- pLine[w >> 3] = cVal;
- }
- } else {
- CONTEXT = (line1 & 0x1c00) | (line1_r & 0x01c0)
- | ((line2_r >> 3) & 0x0038) | ((line3_r >> 6) & 0x0007);
- for (FX_INT32 w = 0; w < GRW; w += 8) {
- nBits = GRW - w > 8 ? 8 : GRW - w;
- if (h > 0)
- line1 = (line1 << 8) |
- (w + 8 < GRW ? pLine[-nStride + (w >> 3) + 1] << 4 : 0);
- if(line1_r_ok)
- line1_r = (line1_r << 8) |
- (w + 8 < GRWR ? pLineR[nOffset - nStrideR + (w >> 3) + 1] : 0);
- if(line2_r_ok)
- line2_r = (line2_r << 8) |
- (w + 8 < GRWR ? pLineR[nOffset + (w >> 3) + 1] : 0);
- if(line3_r_ok)
- line3_r = (line3_r << 8) |
- (w + 8 < GRWR ? pLineR[nOffset + nStrideR + (w >> 3) + 1] : 0);
- else {
- line3_r = 0;
- }
- cVal = 0;
- for (k = 0; k < nBits; k++) {
- bVal = GRREFERENCE->getPixel(w + k, h);
- if(!(TPGRON && (bVal == GRREFERENCE->getPixel(w + k - 1, h - 1))
- && (bVal == GRREFERENCE->getPixel(w + k, h - 1))
- && (bVal == GRREFERENCE->getPixel(w + k + 1, h - 1))
- && (bVal == GRREFERENCE->getPixel(w + k - 1, h))
- && (bVal == GRREFERENCE->getPixel(w + k + 1, h))
- && (bVal == GRREFERENCE->getPixel(w + k - 1, h + 1))
- && (bVal == GRREFERENCE->getPixel(w + k, h + 1))
- && (bVal == GRREFERENCE->getPixel(w + k + 1, h + 1)))) {
- bVal = pArithDecoder->DECODE(&grContext[CONTEXT]);
- }
- cVal |= bVal << (7 - k);
- CONTEXT = ((CONTEXT & 0x0cdb) << 1) | (bVal << 9) |
- ((line1 >> (7 - k)) & 0x0400) |
- ((line1_r >> (7 - k)) & 0x0040) |
- ((line2_r >> (10 - k)) & 0x0008) |
- ((line3_r >> (13 - k)) & 0x0001);
- }
- pLine[w >> 3] = cVal;
- }
- }
- pLine += nStride;
- if (h < GRHR + GRREFERENCEDY) {
- pLineR += nStrideR;
- }
- }
- return GRREG;
-}
-CJBig2_Image *CJBig2_GRRDProc::decode_Template1_unopt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *grContext)
-{
- FX_BOOL LTP, SLTP, bVal;
- FX_DWORD CONTEXT;
- CJBig2_Image *GRREG;
- FX_DWORD line1, line2, line3, line4, line5;
- LTP = 0;
- JBIG2_ALLOC(GRREG, CJBig2_Image(GRW, GRH));
- GRREG->fill(0);
- for(FX_DWORD h = 0; h < GRH; h++) {
- if(TPGRON) {
- SLTP = pArithDecoder->DECODE(&grContext[0x0008]);
- LTP = LTP ^ SLTP;
- }
- if(LTP == 0) {
- line1 = GRREG->getPixel(1, h - 1);
- line1 |= GRREG->getPixel(0, h - 1) << 1;
- line1 |= GRREG->getPixel(-1, h - 1) << 2;
- line2 = 0;
- line3 = GRREFERENCE->getPixel(-GRREFERENCEDX, h - GRREFERENCEDY - 1);
- line4 = GRREFERENCE->getPixel(-GRREFERENCEDX + 1, h - GRREFERENCEDY);
- line4 |= GRREFERENCE->getPixel(-GRREFERENCEDX, h - GRREFERENCEDY) << 1;
- line4 |= GRREFERENCE->getPixel(-GRREFERENCEDX - 1, h - GRREFERENCEDY) << 2;
- line5 = GRREFERENCE->getPixel(-GRREFERENCEDX + 1, h - GRREFERENCEDY + 1);
- line5 |= GRREFERENCE->getPixel(-GRREFERENCEDX, h - GRREFERENCEDY + 1) << 1;
- for(FX_DWORD w = 0; w < GRW; w++) {
- CONTEXT = line5;
- CONTEXT |= line4 << 2;
- CONTEXT |= line3 << 5;
- CONTEXT |= line2 << 6;
- CONTEXT |= line1 << 7;
- bVal = pArithDecoder->DECODE(&grContext[CONTEXT]);
- GRREG->setPixel(w, h, bVal);
- line1 = ((line1 << 1) | GRREG->getPixel(w + 2, h - 1)) & 0x07;
- line2 = ((line2 << 1) | bVal) & 0x01;
- line3 = ((line3 << 1) | GRREFERENCE->getPixel(w - GRREFERENCEDX + 1, h - GRREFERENCEDY - 1)) & 0x01;
- line4 = ((line4 << 1) | GRREFERENCE->getPixel(w - GRREFERENCEDX + 2, h - GRREFERENCEDY)) & 0x07;
- line5 = ((line5 << 1) | GRREFERENCE->getPixel(w - GRREFERENCEDX + 2, h - GRREFERENCEDY + 1)) & 0x03;
- }
- } else {
- line1 = GRREG->getPixel(1, h - 1);
- line1 |= GRREG->getPixel(0, h - 1) << 1;
- line1 |= GRREG->getPixel(-1, h - 1) << 2;
- line2 = 0;
- line3 = GRREFERENCE->getPixel(-GRREFERENCEDX, h - GRREFERENCEDY - 1);
- line4 = GRREFERENCE->getPixel(-GRREFERENCEDX + 1, h - GRREFERENCEDY);
- line4 |= GRREFERENCE->getPixel(-GRREFERENCEDX, h - GRREFERENCEDY) << 1;
- line4 |= GRREFERENCE->getPixel(-GRREFERENCEDX - 1, h - GRREFERENCEDY) << 2;
- line5 = GRREFERENCE->getPixel(-GRREFERENCEDX + 1, h - GRREFERENCEDY + 1);
- line5 |= GRREFERENCE->getPixel(-GRREFERENCEDX, h - GRREFERENCEDY + 1) << 1;
- for(FX_DWORD w = 0; w < GRW; w++) {
- bVal = GRREFERENCE->getPixel(w, h);
- if(!(TPGRON && (bVal == GRREFERENCE->getPixel(w - 1, h - 1))
- && (bVal == GRREFERENCE->getPixel(w, h - 1))
- && (bVal == GRREFERENCE->getPixel(w + 1, h - 1))
- && (bVal == GRREFERENCE->getPixel(w - 1, h))
- && (bVal == GRREFERENCE->getPixel(w + 1, h))
- && (bVal == GRREFERENCE->getPixel(w - 1, h + 1))
- && (bVal == GRREFERENCE->getPixel(w, h + 1))
- && (bVal == GRREFERENCE->getPixel(w + 1, h + 1)))) {
- CONTEXT = line5;
- CONTEXT |= line4 << 2;
- CONTEXT |= line3 << 5;
- CONTEXT |= line2 << 6;
- CONTEXT |= line1 << 7;
- bVal = pArithDecoder->DECODE(&grContext[CONTEXT]);
- }
- GRREG->setPixel(w, h, bVal);
- line1 = ((line1 << 1) | GRREG->getPixel(w + 2, h - 1)) & 0x07;
- line2 = ((line2 << 1) | bVal) & 0x01;
- line3 = ((line3 << 1) | GRREFERENCE->getPixel(w - GRREFERENCEDX + 1, h - GRREFERENCEDY - 1)) & 0x01;
- line4 = ((line4 << 1) | GRREFERENCE->getPixel(w - GRREFERENCEDX + 2, h - GRREFERENCEDY)) & 0x07;
- line5 = ((line5 << 1) | GRREFERENCE->getPixel(w - GRREFERENCEDX + 2, h - GRREFERENCEDY + 1)) & 0x03;
- }
- }
- }
- return GRREG;
-}
-CJBig2_Image *CJBig2_GRRDProc::decode_Template1_opt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *grContext)
-{
- FX_BOOL LTP, SLTP, bVal;
- FX_DWORD CONTEXT;
- CJBig2_Image *GRREG;
- FX_DWORD line1, line1_r, line2_r, line3_r;
- FX_BYTE *pLine, *pLineR, cVal;
- FX_INTPTR nStride, nStrideR, nOffset;
- FX_INT32 k, nBits;
- FX_INT32 GRWR, GRHR;
- FX_INT32 GRW, GRH;
- GRW = (FX_INT32)CJBig2_GRRDProc::GRW;
- GRH = (FX_INT32)CJBig2_GRRDProc::GRH;
- LTP = 0;
- JBIG2_ALLOC(GRREG, CJBig2_Image(GRW, GRH));
- if (GRREG->m_pData == NULL) {
- delete GRREG;
- m_pModule->JBig2_Error("Generic refinement region decoding procedure: Create Image Failed with width = %d, height = %d\n", GRW, GRH);
- return NULL;
- }
- pLine = GRREG->m_pData;
- pLineR = GRREFERENCE->m_pData;
- nStride = GRREG->m_nStride;
- nStrideR = GRREFERENCE->m_nStride;
- GRWR = (FX_INT32)GRREFERENCE->m_nWidth;
- GRHR = (FX_INT32)GRREFERENCE->m_nHeight;
- if (GRREFERENCEDY < -GRHR + 1 || GRREFERENCEDY > GRHR - 1) {
- GRREFERENCEDY = 0;
- }
- nOffset = -GRREFERENCEDY * nStrideR;
- for (FX_INT32 h = 0; h < GRH; h++) {
- if(TPGRON) {
- SLTP = pArithDecoder->DECODE(&grContext[0x0008]);
- LTP = LTP ^ SLTP;
- }
- line1 = (h > 0) ? pLine[-nStride] << 1 : 0;
- FX_INT32 reference_h = h - GRREFERENCEDY;
- FX_BOOL line1_r_ok = (reference_h > 0 && reference_h < GRHR + 1);
- FX_BOOL line2_r_ok = (reference_h > -1 && reference_h < GRHR);
- FX_BOOL line3_r_ok = (reference_h > -2 && reference_h < GRHR - 1);
- line1_r = line1_r_ok ? pLineR[nOffset - nStrideR] : 0;
- line2_r = line2_r_ok ? pLineR[nOffset] : 0;
- line3_r = line3_r_ok ? pLineR[nOffset + nStrideR] : 0;
- if(LTP == 0) {
- CONTEXT = (line1 & 0x0380) | ((line1_r >> 2) & 0x0020)
- | ((line2_r >> 4) & 0x001c) | ((line3_r >> 6) & 0x0003);
- for (FX_INT32 w = 0; w < GRW; w += 8) {
- nBits = GRW - w > 8 ? 8 : GRW - w;
- if (h > 0)
- line1 = (line1 << 8) |
- (w + 8 < GRW ? pLine[-nStride + (w >> 3) + 1] << 1 : 0);
- if(line1_r_ok)
- line1_r = (line1_r << 8) |
- (w + 8 < GRWR ? pLineR[nOffset - nStrideR + (w >> 3) + 1] : 0);
- if(line2_r_ok)
- line2_r = (line2_r << 8) |
- (w + 8 < GRWR ? pLineR[nOffset + (w >> 3) + 1] : 0);
- if(line3_r_ok)
- line3_r = (line3_r << 8) |
- (w + 8 < GRWR ? pLineR[nOffset + nStrideR + (w >> 3) + 1] : 0);
- else {
- line3_r = 0;
- }
- cVal = 0;
- for (k = 0; k < nBits; k++) {
- bVal = pArithDecoder->DECODE(&grContext[CONTEXT]);
- cVal |= bVal << (7 - k);
- CONTEXT = ((CONTEXT & 0x018d) << 1) | (bVal << 6) |
- ((line1 >> (7 - k)) & 0x0080) |
- ((line1_r >> (9 - k)) & 0x0020) |
- ((line2_r >> (11 - k)) & 0x0004) |
- ((line3_r >> (13 - k)) & 0x0001);
- }
- pLine[w >> 3] = cVal;
- }
- } else {
- CONTEXT = (line1 & 0x0380) | ((line1_r >> 2) & 0x0020)
- | ((line2_r >> 4) & 0x001c) | ((line3_r >> 6) & 0x0003);
- for (FX_INT32 w = 0; w < GRW; w += 8) {
- nBits = GRW - w > 8 ? 8 : GRW - w;
- if (h > 0)
- line1 = (line1 << 8) |
- (w + 8 < GRW ? pLine[-nStride + (w >> 3) + 1] << 1 : 0);
- if(line1_r_ok)
- line1_r = (line1_r << 8) |
- (w + 8 < GRWR ? pLineR[nOffset - nStrideR + (w >> 3) + 1] : 0);
- if(line2_r_ok)
- line2_r = (line2_r << 8) |
- (w + 8 < GRWR ? pLineR[nOffset + (w >> 3) + 1] : 0);
- if(line3_r_ok)
- line3_r = (line3_r << 8) |
- (w + 8 < GRWR ? pLineR[nOffset + nStrideR + (w >> 3) + 1] : 0);
- else {
- line3_r = 0;
- }
- cVal = 0;
- for (k = 0; k < nBits; k++) {
- bVal = GRREFERENCE->getPixel(w + k, h);
- if(!(TPGRON && (bVal == GRREFERENCE->getPixel(w + k - 1, h - 1))
- && (bVal == GRREFERENCE->getPixel(w + k, h - 1))
- && (bVal == GRREFERENCE->getPixel(w + k + 1, h - 1))
- && (bVal == GRREFERENCE->getPixel(w + k - 1, h))
- && (bVal == GRREFERENCE->getPixel(w + k + 1, h))
- && (bVal == GRREFERENCE->getPixel(w + k - 1, h + 1))
- && (bVal == GRREFERENCE->getPixel(w + k, h + 1))
- && (bVal == GRREFERENCE->getPixel(w + k + 1, h + 1)))) {
- bVal = pArithDecoder->DECODE(&grContext[CONTEXT]);
- }
- cVal |= bVal << (7 - k);
- CONTEXT = ((CONTEXT & 0x018d) << 1) | (bVal << 6) |
- ((line1 >> (7 - k)) & 0x0080) |
- ((line1_r >> (9 - k)) & 0x0020) |
- ((line2_r >> (11 - k)) & 0x0004) |
- ((line3_r >> (13 - k)) & 0x0001);
- }
- pLine[w >> 3] = cVal;
- }
- }
- pLine += nStride;
- if (h < GRHR + GRREFERENCEDY) {
- pLineR += nStrideR;
- }
- }
- return GRREG;
-}
-CJBig2_Image *CJBig2_GRRDProc::decode_V1(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *grContext)
-{
- FX_BOOL LTP, SLTP, bVal;
- FX_BOOL TPGRPIX, TPGRVAL;
- FX_DWORD CONTEXT;
- CJBig2_Image *GRREG;
- LTP = 0;
- JBIG2_ALLOC(GRREG, CJBig2_Image(GRW, GRH));
- GRREG->fill(0);
- for(FX_DWORD h = 0; h < GRH; h++) {
- if(TPGRON) {
- switch(GRTEMPLATE) {
- case 0:
- CONTEXT = 0x0010;
- break;
- case 1:
- CONTEXT = 0x0008;
- break;
- }
- SLTP = pArithDecoder->DECODE(&grContext[CONTEXT]);
- LTP = LTP ^ SLTP;
- }
- if(LTP == 0) {
- for(FX_DWORD w = 0; w < GRW; w++) {
- CONTEXT = 0;
- switch(GRTEMPLATE) {
- case 0:
- CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX + 1, h - GRREFERENCEDY + 1);
- CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX, h - GRREFERENCEDY + 1) << 1;
- CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX - 1, h - GRREFERENCEDY + 1) << 2;
- CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX + 1, h - GRREFERENCEDY) << 3;
- CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX, h - GRREFERENCEDY) << 4;
- CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX - 1, h - GRREFERENCEDY) << 5;
- CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX + 1, h - GRREFERENCEDY - 1) << 6;
- CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX, h - GRREFERENCEDY - 1) << 7;
- CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX + GRAT[2], h - GRREFERENCEDY + GRAT[3]) << 8;
- CONTEXT |= GRREG->getPixel(w - 1, h) << 9;
- CONTEXT |= GRREG->getPixel(w + 1, h - 1) << 10;
- CONTEXT |= GRREG->getPixel(w, h - 1) << 11;
- CONTEXT |= GRREG->getPixel(w + GRAT[0], h + GRAT[1]) << 12;
- break;
- case 1:
- CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX + 1, h - GRREFERENCEDY + 1);
- CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX, h - GRREFERENCEDY + 1) << 1;
- CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX + 1, h - GRREFERENCEDY) << 2;
- CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX, h - GRREFERENCEDY) << 3;
- CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX - 1, h - GRREFERENCEDY) << 4;
- CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX, h - GRREFERENCEDY - 1) << 5;
- CONTEXT |= GRREG->getPixel(w - 1, h) << 6;
- CONTEXT |= GRREG->getPixel(w + 1, h - 1) << 7;
- CONTEXT |= GRREG->getPixel(w, h - 1) << 8;
- CONTEXT |= GRREG->getPixel(w - 1, h - 1) << 9;
- break;
- }
- bVal = pArithDecoder->DECODE(&grContext[CONTEXT]);
- GRREG->setPixel(w, h, bVal);
- }
- } else {
- for(FX_DWORD w = 0; w < GRW; w++) {
- bVal = GRREFERENCE->getPixel(w, h);
- if(TPGRON && (bVal == GRREFERENCE->getPixel(w - 1, h - 1))
- && (bVal == GRREFERENCE->getPixel(w, h - 1))
- && (bVal == GRREFERENCE->getPixel(w + 1, h - 1))
- && (bVal == GRREFERENCE->getPixel(w - 1, h))
- && (bVal == GRREFERENCE->getPixel(w + 1, h))
- && (bVal == GRREFERENCE->getPixel(w - 1, h + 1))
- && (bVal == GRREFERENCE->getPixel(w, h + 1))
- && (bVal == GRREFERENCE->getPixel(w + 1, h + 1))) {
- TPGRPIX = 1;
- TPGRVAL = bVal;
- } else {
- TPGRPIX = 0;
- }
- if(TPGRPIX) {
- GRREG->setPixel(w, h, TPGRVAL);
- } else {
- CONTEXT = 0;
- switch(GRTEMPLATE) {
- case 0:
- CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX + 1, h - GRREFERENCEDY + 1);
- CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX, h - GRREFERENCEDY + 1) << 1;
- CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX - 1, h - GRREFERENCEDY + 1) << 2;
- CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX + 1, h - GRREFERENCEDY) << 3;
- CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX, h - GRREFERENCEDY) << 4;
- CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX - 1, h - GRREFERENCEDY) << 5;
- CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX + 1, h - GRREFERENCEDY - 1) << 6;
- CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX, h - GRREFERENCEDY - 1) << 7;
- CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX + GRAT[2], h - GRREFERENCEDY + GRAT[3]) << 8;
- CONTEXT |= GRREG->getPixel(w - 1, h) << 9;
- CONTEXT |= GRREG->getPixel(w + 1, h - 1) << 10;
- CONTEXT |= GRREG->getPixel(w, h - 1) << 11;
- CONTEXT |= GRREG->getPixel(w + GRAT[0], h + GRAT[1]) << 12;
- break;
- case 1:
- CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX + 1, h - GRREFERENCEDY + 1);
- CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX, h - GRREFERENCEDY + 1) << 1;
- CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX + 1, h - GRREFERENCEDY) << 2;
- CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX, h - GRREFERENCEDY) << 3;
- CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX - 1, h - GRREFERENCEDY) << 4;
- CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX, h - GRREFERENCEDY - 1) << 5;
- CONTEXT |= GRREG->getPixel(w - 1, h) << 6;
- CONTEXT |= GRREG->getPixel(w + 1, h - 1) << 7;
- CONTEXT |= GRREG->getPixel(w, h - 1) << 8;
- CONTEXT |= GRREG->getPixel(w - 1, h - 1) << 9;
- break;
- }
- bVal = pArithDecoder->DECODE(&grContext[CONTEXT]);
- GRREG->setPixel(w, h, bVal);
- }
- }
- }
- }
- return GRREG;
-}
-CJBig2_Image *CJBig2_TRDProc::decode_Huffman(CJBig2_BitStream *pStream, JBig2ArithCtx *grContext)
-{
- FX_INT32 STRIPT, FIRSTS;
- FX_DWORD NINSTANCES;
- FX_INT32 DT, DFS, CURS;
- FX_BYTE CURT;
- FX_INT32 SI, TI;
- FX_DWORD IDI;
- CJBig2_Image *IBI;
- FX_DWORD WI, HI;
- FX_INT32 IDS;
- FX_BOOL RI;
- FX_INT32 RDWI, RDHI, RDXI, RDYI;
- CJBig2_Image *IBOI;
- FX_DWORD WOI, HOI;
- CJBig2_Image *SBREG;
- FX_BOOL bFirst;
- FX_DWORD nTmp;
- FX_INT32 nVal, nBits;
- CJBig2_HuffmanDecoder *pHuffmanDecoder;
- CJBig2_GRRDProc *pGRRD;
- CJBig2_ArithDecoder *pArithDecoder;
- JBIG2_ALLOC(pHuffmanDecoder, CJBig2_HuffmanDecoder(pStream));
- JBIG2_ALLOC(SBREG, CJBig2_Image(SBW, SBH));
- SBREG->fill(SBDEFPIXEL);
- if(pHuffmanDecoder->decodeAValue(SBHUFFDT, &STRIPT) != 0) {
- m_pModule->JBig2_Error("text region decoding procedure (huffman): too short.");
- goto failed;
- }
- STRIPT *= SBSTRIPS;
- STRIPT = -STRIPT;
- FIRSTS = 0;
- NINSTANCES = 0;
- while(NINSTANCES < SBNUMINSTANCES) {
- if(pHuffmanDecoder->decodeAValue(SBHUFFDT, &DT) != 0) {
- m_pModule->JBig2_Error("text region decoding procedure (huffman): too short.");
- goto failed;
- }
- DT *= SBSTRIPS;
- STRIPT = STRIPT + DT;
- bFirst = TRUE;
- for(;;) {
- if(bFirst) {
- if(pHuffmanDecoder->decodeAValue(SBHUFFFS, &DFS) != 0) {
- m_pModule->JBig2_Error("text region decoding procedure (huffman): too short.");
- goto failed;
- }
- FIRSTS = FIRSTS + DFS;
- CURS = FIRSTS;
- bFirst = FALSE;
- } else {
- nVal = pHuffmanDecoder->decodeAValue(SBHUFFDS, &IDS);
- if(nVal == JBIG2_OOB) {
- break;
- } else if(nVal != 0) {
- m_pModule->JBig2_Error("text region decoding procedure (huffman): too short.");
- goto failed;
- } else {
- CURS = CURS + IDS + SBDSOFFSET;
- }
- }
- if(SBSTRIPS == 1) {
- CURT = 0;
- } else {
- nTmp = 1;
- while((FX_DWORD)(1 << nTmp) < SBSTRIPS) {
- nTmp ++;
- }
- if(pStream->readNBits(nTmp, &nVal) != 0) {
- m_pModule->JBig2_Error("text region decoding procedure (huffman): too short.");
- goto failed;
- }
- CURT = nVal;
- }
- TI = STRIPT + CURT;
- nVal = 0;
- nBits = 0;
- for(;;) {
- if(pStream->read1Bit(&nTmp) != 0) {
- m_pModule->JBig2_Error("text region decoding procedure (huffman): too short.");
- goto failed;
- }
- nVal = (nVal << 1) | nTmp;
- nBits ++;
- for(IDI = 0; IDI < SBNUMSYMS; IDI++) {
- if((nBits == SBSYMCODES[IDI].codelen) && (nVal == SBSYMCODES[IDI].code)) {
- break;
- }
- }
- if(IDI < SBNUMSYMS) {
- break;
- }
- }
- if(SBREFINE == 0) {
- RI = 0;
- } else {
- if(pStream->read1Bit(&RI) != 0) {
- m_pModule->JBig2_Error("text region decoding procedure (huffman): too short.");
- goto failed;
- }
- }
- if(RI == 0) {
- IBI = SBSYMS[IDI];
- } else {
- if((pHuffmanDecoder->decodeAValue(SBHUFFRDW, &RDWI) != 0)
- || (pHuffmanDecoder->decodeAValue(SBHUFFRDH, &RDHI) != 0)
- || (pHuffmanDecoder->decodeAValue(SBHUFFRDX, &RDXI) != 0)
- || (pHuffmanDecoder->decodeAValue(SBHUFFRDY, &RDYI) != 0)
- || (pHuffmanDecoder->decodeAValue(SBHUFFRSIZE, &nVal) != 0)) {
- m_pModule->JBig2_Error("text region decoding procedure (huffman): too short.");
- goto failed;
- }
- pStream->alignByte();
- nTmp = pStream->getOffset();
- IBOI = SBSYMS[IDI];
- if (!IBOI) {
- goto failed;
- }
- WOI = IBOI->m_nWidth;
- HOI = IBOI->m_nHeight;
- if ((int)(WOI + RDWI) < 0 || (int)(HOI + RDHI) < 0) {
- m_pModule->JBig2_Error("text region decoding procedure (huffman): Invalid RDWI or RDHI value.");
- goto failed;
- }
- JBIG2_ALLOC(pGRRD, CJBig2_GRRDProc());
- pGRRD->GRW = WOI + RDWI;
- pGRRD->GRH = HOI + RDHI;
- pGRRD->GRTEMPLATE = SBRTEMPLATE;
- pGRRD->GRREFERENCE = IBOI;
- pGRRD->GRREFERENCEDX = (RDWI >> 2) + RDXI;
- pGRRD->GRREFERENCEDY = (RDHI >> 2) + RDYI;
- pGRRD->TPGRON = 0;
- pGRRD->GRAT[0] = SBRAT[0];
- pGRRD->GRAT[1] = SBRAT[1];
- pGRRD->GRAT[2] = SBRAT[2];
- pGRRD->GRAT[3] = SBRAT[3];
- JBIG2_ALLOC(pArithDecoder, CJBig2_ArithDecoder(pStream));
- IBI = pGRRD->decode(pArithDecoder, grContext);
- if(IBI == NULL) {
- delete pGRRD;
- delete pArithDecoder;
- goto failed;
- }
- delete pArithDecoder;
- pStream->alignByte();
- pStream->offset(2);
- if((FX_DWORD)nVal != (pStream->getOffset() - nTmp)) {
- delete IBI;
- delete pGRRD;
- m_pModule->JBig2_Error("text region decoding procedure (huffman):"
- "bytes processed by generic refinement region decoding procedure doesn't equal SBHUFFRSIZE.");
- goto failed;
- }
- delete pGRRD;
- }
- if (!IBI) {
- continue;
- }
- WI = IBI->m_nWidth;
- HI = IBI->m_nHeight;
- if(TRANSPOSED == 0 && ((REFCORNER == JBIG2_CORNER_TOPRIGHT)
- || (REFCORNER == JBIG2_CORNER_BOTTOMRIGHT))) {
- CURS = CURS + WI - 1;
- } else if(TRANSPOSED == 1 && ((REFCORNER == JBIG2_CORNER_BOTTOMLEFT)
- || (REFCORNER == JBIG2_CORNER_BOTTOMRIGHT))) {
- CURS = CURS + HI - 1;
- }
- SI = CURS;
- if(TRANSPOSED == 0) {
- switch(REFCORNER) {
- case JBIG2_CORNER_TOPLEFT:
- SBREG->composeFrom(SI, TI, IBI, SBCOMBOP);
- break;
- case JBIG2_CORNER_TOPRIGHT:
- SBREG->composeFrom(SI - WI + 1, TI, IBI, SBCOMBOP);
- break;
- case JBIG2_CORNER_BOTTOMLEFT:
- SBREG->composeFrom(SI, TI - HI + 1, IBI, SBCOMBOP);
- break;
- case JBIG2_CORNER_BOTTOMRIGHT:
- SBREG->composeFrom(SI - WI + 1, TI - HI + 1, IBI, SBCOMBOP);
- break;
- }
- } else {
- switch(REFCORNER) {
- case JBIG2_CORNER_TOPLEFT:
- SBREG->composeFrom(TI, SI, IBI, SBCOMBOP);
- break;
- case JBIG2_CORNER_TOPRIGHT:
- SBREG->composeFrom(TI - WI + 1, SI, IBI, SBCOMBOP);
- break;
- case JBIG2_CORNER_BOTTOMLEFT:
- SBREG->composeFrom(TI, SI - HI + 1, IBI, SBCOMBOP);
- break;
- case JBIG2_CORNER_BOTTOMRIGHT:
- SBREG->composeFrom(TI - WI + 1, SI - HI + 1, IBI, SBCOMBOP);
- break;
- }
- }
- if(RI != 0) {
- delete IBI;
- }
- if(TRANSPOSED == 0 && ((REFCORNER == JBIG2_CORNER_TOPLEFT)
- || (REFCORNER == JBIG2_CORNER_BOTTOMLEFT))) {
- CURS = CURS + WI - 1;
- } else if(TRANSPOSED == 1 && ((REFCORNER == JBIG2_CORNER_TOPLEFT)
- || (REFCORNER == JBIG2_CORNER_TOPRIGHT))) {
- CURS = CURS + HI - 1;
- }
- NINSTANCES = NINSTANCES + 1;
- }
- }
- delete pHuffmanDecoder;
- return SBREG;
-failed:
- delete pHuffmanDecoder;
- delete SBREG;
- return NULL;
-}
-CJBig2_Image *CJBig2_TRDProc::decode_Arith(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *grContext,
- JBig2IntDecoderState *pIDS)
-{
- FX_INT32 STRIPT, FIRSTS;
- FX_DWORD NINSTANCES;
- FX_INT32 DT, DFS, CURS;
- FX_INT32 CURT;
- FX_INT32 SI, TI;
- FX_DWORD IDI;
- CJBig2_Image *IBI;
- FX_DWORD WI, HI;
- FX_INT32 IDS;
- FX_BOOL RI;
- FX_INT32 RDWI, RDHI, RDXI, RDYI;
- CJBig2_Image *IBOI;
- FX_DWORD WOI, HOI;
- CJBig2_Image *SBREG;
- FX_BOOL bFirst;
- FX_INT32 nRet, nVal;
- FX_INT32 bRetained;
- CJBig2_ArithIntDecoder *IADT, *IAFS, *IADS, *IAIT, *IARI, *IARDW, *IARDH, *IARDX, *IARDY;
- CJBig2_ArithIaidDecoder *IAID;
- CJBig2_GRRDProc *pGRRD;
- if(pIDS) {
- IADT = pIDS->IADT;
- IAFS = pIDS->IAFS;
- IADS = pIDS->IADS;
- IAIT = pIDS->IAIT;
- IARI = pIDS->IARI;
- IARDW = pIDS->IARDW;
- IARDH = pIDS->IARDH;
- IARDX = pIDS->IARDX;
- IARDY = pIDS->IARDY;
- IAID = pIDS->IAID;
- bRetained = TRUE;
- } else {
- JBIG2_ALLOC(IADT, CJBig2_ArithIntDecoder());
- JBIG2_ALLOC(IAFS, CJBig2_ArithIntDecoder());
- JBIG2_ALLOC(IADS, CJBig2_ArithIntDecoder());
- JBIG2_ALLOC(IAIT, CJBig2_ArithIntDecoder());
- JBIG2_ALLOC(IARI, CJBig2_ArithIntDecoder());
- JBIG2_ALLOC(IARDW, CJBig2_ArithIntDecoder());
- JBIG2_ALLOC(IARDH, CJBig2_ArithIntDecoder());
- JBIG2_ALLOC(IARDX, CJBig2_ArithIntDecoder());
- JBIG2_ALLOC(IARDY, CJBig2_ArithIntDecoder());
- JBIG2_ALLOC(IAID , CJBig2_ArithIaidDecoder(SBSYMCODELEN));
- bRetained = FALSE;
- }
- JBIG2_ALLOC(SBREG, CJBig2_Image(SBW, SBH));
- SBREG->fill(SBDEFPIXEL);
- if(IADT->decode(pArithDecoder, &STRIPT) == -1) {
- m_pModule->JBig2_Error("text region decoding procedure (arith): too short.");
- goto failed;
- }
- STRIPT *= SBSTRIPS;
- STRIPT = -STRIPT;
- FIRSTS = 0;
- NINSTANCES = 0;
- while(NINSTANCES < SBNUMINSTANCES) {
- if(IADT->decode(pArithDecoder, &DT) == -1) {
- m_pModule->JBig2_Error("text region decoding procedure (arith): too short.");
- goto failed;
- }
- DT *= SBSTRIPS;
- STRIPT = STRIPT + DT;
- bFirst = TRUE;
- for(;;) {
- if(bFirst) {
- if(IAFS->decode(pArithDecoder, &DFS) == -1) {
- m_pModule->JBig2_Error("text region decoding procedure (arith): too short.");
- goto failed;
- }
- FIRSTS = FIRSTS + DFS;
- CURS = FIRSTS;
- bFirst = FALSE;
- } else {
- nRet = IADS->decode(pArithDecoder, &IDS);
- if(nRet == JBIG2_OOB) {
- break;
- } else if(nRet != 0) {
- m_pModule->JBig2_Error("text region decoding procedure (arith): too short.");
- goto failed;
- } else {
- CURS = CURS + IDS + SBDSOFFSET;
- }
- }
- if (NINSTANCES >= SBNUMINSTANCES) {
- break;
- }
- if(SBSTRIPS == 1) {
- CURT = 0;
- } else {
- if(IAIT->decode(pArithDecoder, &nVal) == -1) {
- m_pModule->JBig2_Error("text region decoding procedure (arith): too short.");
- goto failed;
- }
- CURT = nVal;
- }
- TI = STRIPT + CURT;
- if(IAID->decode(pArithDecoder, &nVal) == -1) {
- m_pModule->JBig2_Error("text region decoding procedure (arith): too short.");
- goto failed;
- }
- IDI = nVal;
- if(IDI >= SBNUMSYMS) {
- m_pModule->JBig2_Error("text region decoding procedure (arith): symbol id out of range.(%d/%d)",
- IDI, SBNUMSYMS);
- goto failed;
- }
- if(SBREFINE == 0) {
- RI = 0;
- } else {
- if(IARI->decode(pArithDecoder, &RI) == -1) {
- m_pModule->JBig2_Error("text region decoding procedure (arith): too short.");
- goto failed;
- }
- }
- if (!SBSYMS[IDI]) {
- goto failed;
- }
- if(RI == 0) {
- IBI = SBSYMS[IDI];
- } else {
- if((IARDW->decode(pArithDecoder, &RDWI) == -1)
- || (IARDH->decode(pArithDecoder, &RDHI) == -1)
- || (IARDX->decode(pArithDecoder, &RDXI) == -1)
- || (IARDY->decode(pArithDecoder, &RDYI) == -1)) {
- m_pModule->JBig2_Error("text region decoding procedure (arith): too short.");
- goto failed;
- }
- IBOI = SBSYMS[IDI];
- WOI = IBOI->m_nWidth;
- HOI = IBOI->m_nHeight;
- if ((int)(WOI + RDWI) < 0 || (int)(HOI + RDHI) < 0) {
- m_pModule->JBig2_Error("text region decoding procedure (arith): Invalid RDWI or RDHI value.");
- goto failed;
- }
- JBIG2_ALLOC(pGRRD, CJBig2_GRRDProc());
- pGRRD->GRW = WOI + RDWI;
- pGRRD->GRH = HOI + RDHI;
- pGRRD->GRTEMPLATE = SBRTEMPLATE;
- pGRRD->GRREFERENCE = IBOI;
- pGRRD->GRREFERENCEDX = (RDWI >> 1) + RDXI;
- pGRRD->GRREFERENCEDY = (RDHI >> 1) + RDYI;
- pGRRD->TPGRON = 0;
- pGRRD->GRAT[0] = SBRAT[0];
- pGRRD->GRAT[1] = SBRAT[1];
- pGRRD->GRAT[2] = SBRAT[2];
- pGRRD->GRAT[3] = SBRAT[3];
- IBI = pGRRD->decode(pArithDecoder, grContext);
- if(IBI == NULL) {
- delete pGRRD;
- goto failed;
- }
- delete pGRRD;
- }
- WI = IBI->m_nWidth;
- HI = IBI->m_nHeight;
- if(TRANSPOSED == 0 && ((REFCORNER == JBIG2_CORNER_TOPRIGHT)
- || (REFCORNER == JBIG2_CORNER_BOTTOMRIGHT))) {
- CURS = CURS + WI - 1;
- } else if(TRANSPOSED == 1 && ((REFCORNER == JBIG2_CORNER_BOTTOMLEFT)
- || (REFCORNER == JBIG2_CORNER_BOTTOMRIGHT))) {
- CURS = CURS + HI - 1;
- }
- SI = CURS;
- if(TRANSPOSED == 0) {
- switch(REFCORNER) {
- case JBIG2_CORNER_TOPLEFT:
- SBREG->composeFrom(SI, TI, IBI, SBCOMBOP);
- break;
- case JBIG2_CORNER_TOPRIGHT:
- SBREG->composeFrom(SI - WI + 1, TI, IBI, SBCOMBOP);
- break;
- case JBIG2_CORNER_BOTTOMLEFT:
- SBREG->composeFrom(SI, TI - HI + 1, IBI, SBCOMBOP);
- break;
- case JBIG2_CORNER_BOTTOMRIGHT:
- SBREG->composeFrom(SI - WI + 1, TI - HI + 1, IBI, SBCOMBOP);
- break;
- }
- } else {
- switch(REFCORNER) {
- case JBIG2_CORNER_TOPLEFT:
- SBREG->composeFrom(TI, SI, IBI, SBCOMBOP);
- break;
- case JBIG2_CORNER_TOPRIGHT:
- SBREG->composeFrom(TI - WI + 1, SI, IBI, SBCOMBOP);
- break;
- case JBIG2_CORNER_BOTTOMLEFT:
- SBREG->composeFrom(TI, SI - HI + 1, IBI, SBCOMBOP);
- break;
- case JBIG2_CORNER_BOTTOMRIGHT:
- SBREG->composeFrom(TI - WI + 1, SI - HI + 1, IBI, SBCOMBOP);
- break;
- }
- }
- if(RI != 0) {
- delete IBI;
- }
- if(TRANSPOSED == 0 && ((REFCORNER == JBIG2_CORNER_TOPLEFT)
- || (REFCORNER == JBIG2_CORNER_BOTTOMLEFT))) {
- CURS = CURS + WI - 1;
- } else if(TRANSPOSED == 1 && ((REFCORNER == JBIG2_CORNER_TOPLEFT)
- || (REFCORNER == JBIG2_CORNER_TOPRIGHT))) {
- CURS = CURS + HI - 1;
- }
- NINSTANCES = NINSTANCES + 1;
- }
- }
- if(bRetained == FALSE) {
- delete IADT;
- delete IAFS;
- delete IADS;
- delete IAIT;
- delete IARI;
- delete IARDW;
- delete IARDH;
- delete IARDX;
- delete IARDY;
- delete IAID;
- }
- return SBREG;
-failed:
- if(bRetained == FALSE) {
- delete IADT;
- delete IAFS;
- delete IADS;
- delete IAIT;
- delete IARI;
- delete IARDW;
- delete IARDH;
- delete IARDX;
- delete IARDY;
- delete IAID;
- }
- delete SBREG;
- return NULL;
-}
-CJBig2_SymbolDict *CJBig2_SDDProc::decode_Arith(CJBig2_ArithDecoder *pArithDecoder,
- JBig2ArithCtx *gbContext, JBig2ArithCtx *grContext)
-{
- CJBig2_Image **SDNEWSYMS;
- FX_DWORD HCHEIGHT, NSYMSDECODED;
- FX_INT32 HCDH;
- FX_DWORD SYMWIDTH, TOTWIDTH, HCFIRSTSYM;
- FX_INT32 DW;
- CJBig2_Image *BS;
- FX_DWORD I, J, REFAGGNINST;
- FX_BOOL *EXFLAGS;
- FX_DWORD EXINDEX;
- FX_BOOL CUREXFLAG;
- FX_DWORD EXRUNLENGTH;
- FX_INT32 nVal;
- FX_DWORD nTmp;
- FX_BOOL SBHUFF;
- FX_DWORD SBNUMSYMS;
- FX_BYTE SBSYMCODELEN;
- FX_DWORD IDI;
- FX_INT32 RDXI, RDYI;
- CJBig2_Image **SBSYMS;
- CJBig2_HuffmanTable *SBHUFFFS, *SBHUFFDS, *SBHUFFDT, *SBHUFFRDW, *SBHUFFRDH, *SBHUFFRDX, *SBHUFFRDY,
- *SBHUFFRSIZE;
- CJBig2_GRRDProc *pGRRD;
- CJBig2_GRDProc *pGRD;
- CJBig2_ArithIntDecoder *IADH, *IADW, *IAAI, *IARDX, *IARDY, *IAEX,
- *IADT, *IAFS, *IADS, *IAIT, *IARI, *IARDW, *IARDH;
- CJBig2_ArithIaidDecoder *IAID;
- CJBig2_SymbolDict *pDict;
- JBIG2_ALLOC(IADH, CJBig2_ArithIntDecoder());
- JBIG2_ALLOC(IADW, CJBig2_ArithIntDecoder());
- JBIG2_ALLOC(IAAI, CJBig2_ArithIntDecoder());
- JBIG2_ALLOC(IARDX, CJBig2_ArithIntDecoder());
- JBIG2_ALLOC(IARDY, CJBig2_ArithIntDecoder());
- JBIG2_ALLOC(IAEX, CJBig2_ArithIntDecoder());
- JBIG2_ALLOC(IADT, CJBig2_ArithIntDecoder());
- JBIG2_ALLOC(IAFS, CJBig2_ArithIntDecoder());
- JBIG2_ALLOC(IADS, CJBig2_ArithIntDecoder());
- JBIG2_ALLOC(IAIT, CJBig2_ArithIntDecoder());
- JBIG2_ALLOC(IARI, CJBig2_ArithIntDecoder());
- JBIG2_ALLOC(IARDW, CJBig2_ArithIntDecoder());
- JBIG2_ALLOC(IARDH, CJBig2_ArithIntDecoder());
- nTmp = 0;
- while((FX_DWORD)(1 << nTmp) < (SDNUMINSYMS + SDNUMNEWSYMS)) {
- nTmp ++;
- }
- JBIG2_ALLOC(IAID, CJBig2_ArithIaidDecoder((FX_BYTE)nTmp));
- SDNEWSYMS = (CJBig2_Image**)m_pModule->JBig2_Malloc2(SDNUMNEWSYMS, sizeof(CJBig2_Image*));
- FXSYS_memset32(SDNEWSYMS, 0 , SDNUMNEWSYMS * sizeof(CJBig2_Image*));
- HCHEIGHT = 0;
- NSYMSDECODED = 0;
- while(NSYMSDECODED < SDNUMNEWSYMS) {
- BS = NULL;
- if(IADH->decode(pArithDecoder, &HCDH) == -1) {
- m_pModule->JBig2_Error("symbol dictionary decoding procedure (arith): too short.");
- goto failed;
- }
- HCHEIGHT = HCHEIGHT + HCDH;
- if ((int)HCHEIGHT < 0 || (int)HCHEIGHT > JBIG2_MAX_IMAGE_SIZE) {
- m_pModule->JBig2_Error("symbol dictionary decoding procedure (arith): invalid HCHEIGHT value.");
- goto failed;
- }
- SYMWIDTH = 0;
- TOTWIDTH = 0;
- HCFIRSTSYM = NSYMSDECODED;
- for(;;) {
- nVal = IADW->decode(pArithDecoder, &DW);
- if(nVal == JBIG2_OOB) {
- break;
- } else if(nVal != 0) {
- m_pModule->JBig2_Error("symbol dictionary decoding procedure (arith): too short.");
- goto failed;
- } else {
- if (NSYMSDECODED >= SDNUMNEWSYMS) {
- m_pModule->JBig2_Error("symbol dictionary decoding procedure (arith): NSYMSDECODED >= SDNUMNEWSYMS.");
- goto failed;
- }
- SYMWIDTH = SYMWIDTH + DW;
- if ((int)SYMWIDTH < 0 || (int)SYMWIDTH > JBIG2_MAX_IMAGE_SIZE) {
- m_pModule->JBig2_Error("symbol dictionary decoding procedure (arith): invalid SYMWIDTH value.");
- goto failed;
- } else if (HCHEIGHT == 0 || SYMWIDTH == 0) {
- TOTWIDTH = TOTWIDTH + SYMWIDTH;
- SDNEWSYMS[NSYMSDECODED] = NULL;
- NSYMSDECODED = NSYMSDECODED + 1;
- continue;
- }
- TOTWIDTH = TOTWIDTH + SYMWIDTH;
- }
- if(SDREFAGG == 0) {
- JBIG2_ALLOC(pGRD, CJBig2_GRDProc());
- pGRD->MMR = 0;
- pGRD->GBW = SYMWIDTH;
- pGRD->GBH = HCHEIGHT;
- pGRD->GBTEMPLATE = SDTEMPLATE;
- pGRD->TPGDON = 0;
- pGRD->USESKIP = 0;
- pGRD->GBAT[0] = SDAT[0];
- pGRD->GBAT[1] = SDAT[1];
- pGRD->GBAT[2] = SDAT[2];
- pGRD->GBAT[3] = SDAT[3];
- pGRD->GBAT[4] = SDAT[4];
- pGRD->GBAT[5] = SDAT[5];
- pGRD->GBAT[6] = SDAT[6];
- pGRD->GBAT[7] = SDAT[7];
- BS = pGRD->decode_Arith(pArithDecoder, gbContext);
- if(BS == NULL) {
- delete pGRD;
- goto failed;
- }
- delete pGRD;
- } else {
- if(IAAI->decode(pArithDecoder, (int*)&REFAGGNINST) == -1) {
- m_pModule->JBig2_Error("symbol dictionary decoding procedure (arith): too short.");
- goto failed;
- }
- if(REFAGGNINST > 1) {
- CJBig2_TRDProc *pDecoder;
- JBIG2_ALLOC(pDecoder, CJBig2_TRDProc());
- pDecoder->SBHUFF = SDHUFF;
- pDecoder->SBREFINE = 1;
- pDecoder->SBW = SYMWIDTH;
- pDecoder->SBH = HCHEIGHT;
- pDecoder->SBNUMINSTANCES = REFAGGNINST;
- pDecoder->SBSTRIPS = 1;
- pDecoder->SBNUMSYMS = SDNUMINSYMS + NSYMSDECODED;
- SBNUMSYMS = pDecoder->SBNUMSYMS;
- nTmp = 0;
- while((FX_DWORD)(1 << nTmp) < SBNUMSYMS) {
- nTmp ++;
- }
- SBSYMCODELEN = (FX_BYTE)nTmp;
- pDecoder->SBSYMCODELEN = SBSYMCODELEN;
- SBSYMS = (CJBig2_Image**)m_pModule->JBig2_Malloc2(SBNUMSYMS, sizeof(CJBig2_Image*));
- JBIG2_memcpy(SBSYMS, SDINSYMS, SDNUMINSYMS * sizeof(CJBig2_Image*));
- JBIG2_memcpy(SBSYMS + SDNUMINSYMS, SDNEWSYMS, NSYMSDECODED * sizeof(CJBig2_Image*));
- pDecoder->SBSYMS = SBSYMS;
- pDecoder->SBDEFPIXEL = 0;
- pDecoder->SBCOMBOP = JBIG2_COMPOSE_OR;
- pDecoder->TRANSPOSED = 0;
- pDecoder->REFCORNER = JBIG2_CORNER_TOPLEFT;
- pDecoder->SBDSOFFSET = 0;
- JBIG2_ALLOC(SBHUFFFS, CJBig2_HuffmanTable(HuffmanTable_B6,
- sizeof(HuffmanTable_B6) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B6));
- JBIG2_ALLOC(SBHUFFDS, CJBig2_HuffmanTable(HuffmanTable_B8,
- sizeof(HuffmanTable_B8) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B8));
- JBIG2_ALLOC(SBHUFFDT, CJBig2_HuffmanTable(HuffmanTable_B11,
- sizeof(HuffmanTable_B11) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B11));
- JBIG2_ALLOC(SBHUFFRDW, CJBig2_HuffmanTable(HuffmanTable_B15,
- sizeof(HuffmanTable_B15) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B15));
- JBIG2_ALLOC(SBHUFFRDH, CJBig2_HuffmanTable(HuffmanTable_B15,
- sizeof(HuffmanTable_B15) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B15));
- JBIG2_ALLOC(SBHUFFRDX, CJBig2_HuffmanTable(HuffmanTable_B15,
- sizeof(HuffmanTable_B15) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B15));
- JBIG2_ALLOC(SBHUFFRDY, CJBig2_HuffmanTable(HuffmanTable_B15,
- sizeof(HuffmanTable_B15) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B15));
- JBIG2_ALLOC(SBHUFFRSIZE, CJBig2_HuffmanTable(HuffmanTable_B1,
- sizeof(HuffmanTable_B1) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B1));
- pDecoder->SBHUFFFS = SBHUFFFS;
- pDecoder->SBHUFFDS = SBHUFFDS;
- pDecoder->SBHUFFDT = SBHUFFDT;
- pDecoder->SBHUFFRDW = SBHUFFRDW;
- pDecoder->SBHUFFRDH = SBHUFFRDH;
- pDecoder->SBHUFFRDX = SBHUFFRDX;
- pDecoder->SBHUFFRDY = SBHUFFRDY;
- pDecoder->SBHUFFRSIZE = SBHUFFRSIZE;
- pDecoder->SBRTEMPLATE = SDRTEMPLATE;
- pDecoder->SBRAT[0] = SDRAT[0];
- pDecoder->SBRAT[1] = SDRAT[1];
- pDecoder->SBRAT[2] = SDRAT[2];
- pDecoder->SBRAT[3] = SDRAT[3];
- JBig2IntDecoderState ids;
- ids.IADT = IADT;
- ids.IAFS = IAFS;
- ids.IADS = IADS;
- ids.IAIT = IAIT;
- ids.IARI = IARI;
- ids.IARDW = IARDW;
- ids.IARDH = IARDH;
- ids.IARDX = IARDX;
- ids.IARDY = IARDY;
- ids.IAID = IAID;
- BS = pDecoder->decode_Arith(pArithDecoder, grContext, &ids);
- if(BS == NULL) {
- m_pModule->JBig2_Free(SBSYMS);
- delete SBHUFFFS;
- delete SBHUFFDS;
- delete SBHUFFDT;
- delete SBHUFFRDW;
- delete SBHUFFRDH;
- delete SBHUFFRDX;
- delete SBHUFFRDY;
- delete SBHUFFRSIZE;
- delete pDecoder;
- goto failed;
- }
- m_pModule->JBig2_Free(SBSYMS);
- delete SBHUFFFS;
- delete SBHUFFDS;
- delete SBHUFFDT;
- delete SBHUFFRDW;
- delete SBHUFFRDH;
- delete SBHUFFRDX;
- delete SBHUFFRDY;
- delete SBHUFFRSIZE;
- delete pDecoder;
- } else if(REFAGGNINST == 1) {
- SBHUFF = SDHUFF;
- SBNUMSYMS = SDNUMINSYMS + NSYMSDECODED;
- if(IAID->decode(pArithDecoder, (int*)&IDI) == -1) {
- m_pModule->JBig2_Error("symbol dictionary decoding procedure (arith): too short.");
- goto failed;
- }
- if((IARDX->decode(pArithDecoder, &RDXI) == -1)
- || (IARDY->decode(pArithDecoder, &RDYI) == -1)) {
- m_pModule->JBig2_Error("symbol dictionary decoding procedure (arith): too short.");
- goto failed;
- }
- if (IDI >= SBNUMSYMS) {
- m_pModule->JBig2_Error("symbol dictionary decoding procedure (arith):"
- " refinement references unknown symbol %d", IDI);
- goto failed;
- }
- SBSYMS = (CJBig2_Image**)m_pModule->JBig2_Malloc2(SBNUMSYMS, sizeof(CJBig2_Image*));
- JBIG2_memcpy(SBSYMS, SDINSYMS, SDNUMINSYMS * sizeof(CJBig2_Image*));
- JBIG2_memcpy(SBSYMS + SDNUMINSYMS, SDNEWSYMS, NSYMSDECODED * sizeof(CJBig2_Image*));
- if (!SBSYMS[IDI]) {
- m_pModule->JBig2_Free(SBSYMS);
- goto failed;
- }
- JBIG2_ALLOC(pGRRD, CJBig2_GRRDProc());
- pGRRD->GRW = SYMWIDTH;
- pGRRD->GRH = HCHEIGHT;
- pGRRD->GRTEMPLATE = SDRTEMPLATE;
- pGRRD->GRREFERENCE = SBSYMS[IDI];
- pGRRD->GRREFERENCEDX = RDXI;
- pGRRD->GRREFERENCEDY = RDYI;
- pGRRD->TPGRON = 0;
- pGRRD->GRAT[0] = SDRAT[0];
- pGRRD->GRAT[1] = SDRAT[1];
- pGRRD->GRAT[2] = SDRAT[2];
- pGRRD->GRAT[3] = SDRAT[3];
- BS = pGRRD->decode(pArithDecoder, grContext);
- if(BS == NULL) {
- m_pModule->JBig2_Free(SBSYMS);
- delete pGRRD;
- goto failed;
- }
- m_pModule->JBig2_Free(SBSYMS);
- delete pGRRD;
- }
- }
- SDNEWSYMS[NSYMSDECODED] = BS;
- BS = NULL;
- NSYMSDECODED = NSYMSDECODED + 1;
- }
- }
- EXINDEX = 0;
- CUREXFLAG = 0;
- EXFLAGS = (FX_BOOL*)m_pModule->JBig2_Malloc2(sizeof(FX_BOOL), (SDNUMINSYMS + SDNUMNEWSYMS));
- while(EXINDEX < SDNUMINSYMS + SDNUMNEWSYMS) {
- if(IAEX->decode(pArithDecoder, (int*)&EXRUNLENGTH) == -1) {
- m_pModule->JBig2_Free(EXFLAGS);
- m_pModule->JBig2_Error("symbol dictionary decoding procedure (arith): too short.");
- goto failed;
- }
- if (EXINDEX + EXRUNLENGTH > SDNUMINSYMS + SDNUMNEWSYMS) {
- m_pModule->JBig2_Free(EXFLAGS);
- m_pModule->JBig2_Error("symbol dictionary decoding procedure (arith): Invalid EXRUNLENGTH value.");
- goto failed;
- }
- if(EXRUNLENGTH != 0) {
- for(I = EXINDEX; I < EXINDEX + EXRUNLENGTH; I++) {
- EXFLAGS[I] = CUREXFLAG;
- }
- }
- EXINDEX = EXINDEX + EXRUNLENGTH;
- CUREXFLAG = !CUREXFLAG;
- }
- JBIG2_ALLOC(pDict, CJBig2_SymbolDict());
- pDict->SDNUMEXSYMS = SDNUMEXSYMS;
- pDict->SDEXSYMS = (CJBig2_Image**)m_pModule->JBig2_Malloc2(sizeof(CJBig2_Image*), SDNUMEXSYMS);
- I = J = 0;
- for(I = 0; I < SDNUMINSYMS + SDNUMNEWSYMS; I++) {
- if(EXFLAGS[I] && J < SDNUMEXSYMS) {
- if(I < SDNUMINSYMS) {
- JBIG2_ALLOC(pDict->SDEXSYMS[J], CJBig2_Image(*SDINSYMS[I]));
- } else {
- pDict->SDEXSYMS[J] = SDNEWSYMS[I - SDNUMINSYMS];
- }
- J = J + 1;
- } else if (!EXFLAGS[I] && I >= SDNUMINSYMS) {
- delete SDNEWSYMS[I - SDNUMINSYMS];
- }
- }
- if (J < SDNUMEXSYMS) {
- pDict->SDNUMEXSYMS = J;
- }
- m_pModule->JBig2_Free(EXFLAGS);
- m_pModule->JBig2_Free(SDNEWSYMS);
- delete IADH;
- delete IADW;
- delete IAAI;
- delete IARDX;
- delete IARDY;
- delete IAEX;
- delete IAID;
- delete IADT;
- delete IAFS;
- delete IADS;
- delete IAIT;
- delete IARI;
- delete IARDW;
- delete IARDH;
- return pDict;
-failed:
- for(I = 0; I < NSYMSDECODED; I++) {
- if (SDNEWSYMS[I]) {
- delete SDNEWSYMS[I];
- SDNEWSYMS[I] = NULL;
- }
- }
- m_pModule->JBig2_Free(SDNEWSYMS);
- delete IADH;
- delete IADW;
- delete IAAI;
- delete IARDX;
- delete IARDY;
- delete IAEX;
- delete IAID;
- delete IADT;
- delete IAFS;
- delete IADS;
- delete IAIT;
- delete IARI;
- delete IARDW;
- delete IARDH;
- return NULL;
-}
-CJBig2_SymbolDict *CJBig2_SDDProc::decode_Huffman(CJBig2_BitStream *pStream,
- JBig2ArithCtx *gbContext, JBig2ArithCtx *grContext, IFX_Pause* pPause)
-{
- CJBig2_Image **SDNEWSYMS;
- FX_DWORD *SDNEWSYMWIDTHS;
- FX_DWORD HCHEIGHT, NSYMSDECODED;
- FX_INT32 HCDH;
- FX_DWORD SYMWIDTH, TOTWIDTH, HCFIRSTSYM;
- FX_INT32 DW;
- CJBig2_Image *BS, *BHC;
- FX_DWORD I, J, REFAGGNINST;
- FX_BOOL *EXFLAGS;
- FX_DWORD EXINDEX;
- FX_BOOL CUREXFLAG;
- FX_DWORD EXRUNLENGTH;
- FX_INT32 nVal, nBits;
- FX_DWORD nTmp;
- FX_BOOL SBHUFF;
- FX_DWORD SBNUMSYMS;
- FX_BYTE SBSYMCODELEN;
- JBig2HuffmanCode *SBSYMCODES;
- FX_DWORD IDI;
- FX_INT32 RDXI, RDYI;
- FX_DWORD BMSIZE;
- FX_DWORD stride;
- CJBig2_Image **SBSYMS;
- CJBig2_HuffmanTable *SBHUFFFS, *SBHUFFDS, *SBHUFFDT, *SBHUFFRDW, *SBHUFFRDH, *SBHUFFRDX, *SBHUFFRDY,
- *SBHUFFRSIZE, *pTable;
- CJBig2_HuffmanDecoder *pHuffmanDecoder;
- CJBig2_GRRDProc *pGRRD;
- CJBig2_ArithDecoder *pArithDecoder;
- CJBig2_GRDProc *pGRD;
- CJBig2_SymbolDict *pDict;
- JBIG2_ALLOC(pHuffmanDecoder, CJBig2_HuffmanDecoder(pStream));
- SDNEWSYMS = (CJBig2_Image**)m_pModule->JBig2_Malloc2(SDNUMNEWSYMS, sizeof(CJBig2_Image*));
- FXSYS_memset32(SDNEWSYMS, 0 , SDNUMNEWSYMS * sizeof(CJBig2_Image*));
- SDNEWSYMWIDTHS = NULL;
- BHC = NULL;
- if(SDREFAGG == 0) {
- SDNEWSYMWIDTHS = (FX_DWORD *)m_pModule->JBig2_Malloc2(SDNUMNEWSYMS, sizeof(FX_DWORD));
- FXSYS_memset32(SDNEWSYMWIDTHS, 0 , SDNUMNEWSYMS * sizeof(FX_DWORD));
- }
- HCHEIGHT = 0;
- NSYMSDECODED = 0;
- BS = NULL;
- while(NSYMSDECODED < SDNUMNEWSYMS) {
- if(pHuffmanDecoder->decodeAValue(SDHUFFDH, &HCDH) != 0) {
- m_pModule->JBig2_Error("symbol dictionary decoding procedure (huffman): too short.");
- goto failed;
- }
- HCHEIGHT = HCHEIGHT + HCDH;
- if ((int)HCHEIGHT < 0 || (int)HCHEIGHT > JBIG2_MAX_IMAGE_SIZE) {
- m_pModule->JBig2_Error("symbol dictionary decoding procedure (huffman): invalid HCHEIGHT value.");
- goto failed;
- }
- SYMWIDTH = 0;
- TOTWIDTH = 0;
- HCFIRSTSYM = NSYMSDECODED;
- for(;;) {
- nVal = pHuffmanDecoder->decodeAValue(SDHUFFDW, &DW);
- if(nVal == JBIG2_OOB) {
- break;
- } else if(nVal != 0) {
- m_pModule->JBig2_Error("symbol dictionary decoding procedure (huffman): too short.");
- goto failed;
- } else {
- if (NSYMSDECODED >= SDNUMNEWSYMS) {
- m_pModule->JBig2_Error("symbol dictionary decoding procedure (huffman): NSYMSDECODED >= SDNUMNEWSYMS.");
- goto failed;
- }
- SYMWIDTH = SYMWIDTH + DW;
- if ((int)SYMWIDTH < 0 || (int)SYMWIDTH > JBIG2_MAX_IMAGE_SIZE) {
- m_pModule->JBig2_Error("symbol dictionary decoding procedure (huffman): invalid SYMWIDTH value.");
- goto failed;
- } else if (HCHEIGHT == 0 || SYMWIDTH == 0) {
- TOTWIDTH = TOTWIDTH + SYMWIDTH;
- SDNEWSYMS[NSYMSDECODED] = NULL;
- NSYMSDECODED = NSYMSDECODED + 1;
- continue;
- }
- TOTWIDTH = TOTWIDTH + SYMWIDTH;
- }
- if(SDREFAGG == 1) {
- if(pHuffmanDecoder->decodeAValue(SDHUFFAGGINST, (int*)&REFAGGNINST) != 0) {
- m_pModule->JBig2_Error("symbol dictionary decoding procedure (huffman): too short.");
- goto failed;
- }
- BS = NULL;
- if(REFAGGNINST > 1) {
- CJBig2_TRDProc *pDecoder;
- JBIG2_ALLOC(pDecoder, CJBig2_TRDProc());
- pDecoder->SBHUFF = SDHUFF;
- pDecoder->SBREFINE = 1;
- pDecoder->SBW = SYMWIDTH;
- pDecoder->SBH = HCHEIGHT;
- pDecoder->SBNUMINSTANCES = REFAGGNINST;
- pDecoder->SBSTRIPS = 1;
- pDecoder->SBNUMSYMS = SDNUMINSYMS + NSYMSDECODED;
- SBNUMSYMS = pDecoder->SBNUMSYMS;
- SBSYMCODES = (JBig2HuffmanCode*)m_pModule->JBig2_Malloc2(SBNUMSYMS, sizeof(JBig2HuffmanCode));
- nTmp = 1;
- while((FX_DWORD)(1 << nTmp) < SBNUMSYMS) {
- nTmp ++;
- }
- for(I = 0; I < SBNUMSYMS; I++) {
- SBSYMCODES[I].codelen = nTmp;
- SBSYMCODES[I].code = I;
- }
- pDecoder->SBSYMCODES = SBSYMCODES;
- SBSYMS = (CJBig2_Image**)m_pModule->JBig2_Malloc2(SBNUMSYMS, sizeof(CJBig2_Image*));
- JBIG2_memcpy(SBSYMS, SDINSYMS, SDNUMINSYMS * sizeof(CJBig2_Image*));
- JBIG2_memcpy(SBSYMS + SDNUMINSYMS, SDNEWSYMS, NSYMSDECODED * sizeof(CJBig2_Image*));
- pDecoder->SBSYMS = SBSYMS;
- pDecoder->SBDEFPIXEL = 0;
- pDecoder->SBCOMBOP = JBIG2_COMPOSE_OR;
- pDecoder->TRANSPOSED = 0;
- pDecoder->REFCORNER = JBIG2_CORNER_TOPLEFT;
- pDecoder->SBDSOFFSET = 0;
- JBIG2_ALLOC(SBHUFFFS, CJBig2_HuffmanTable(HuffmanTable_B6,
- sizeof(HuffmanTable_B6) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B6));
- JBIG2_ALLOC(SBHUFFDS, CJBig2_HuffmanTable(HuffmanTable_B8,
- sizeof(HuffmanTable_B8) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B8));
- JBIG2_ALLOC(SBHUFFDT, CJBig2_HuffmanTable(HuffmanTable_B11,
- sizeof(HuffmanTable_B11) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B11));
- JBIG2_ALLOC(SBHUFFRDW, CJBig2_HuffmanTable(HuffmanTable_B15,
- sizeof(HuffmanTable_B15) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B15));
- JBIG2_ALLOC(SBHUFFRDH, CJBig2_HuffmanTable(HuffmanTable_B15,
- sizeof(HuffmanTable_B15) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B15));
- JBIG2_ALLOC(SBHUFFRDX, CJBig2_HuffmanTable(HuffmanTable_B15,
- sizeof(HuffmanTable_B15) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B15));
- JBIG2_ALLOC(SBHUFFRDY, CJBig2_HuffmanTable(HuffmanTable_B15,
- sizeof(HuffmanTable_B15) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B15));
- JBIG2_ALLOC(SBHUFFRSIZE, CJBig2_HuffmanTable(HuffmanTable_B1,
- sizeof(HuffmanTable_B1) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B1));
- pDecoder->SBHUFFFS = SBHUFFFS;
- pDecoder->SBHUFFDS = SBHUFFDS;
- pDecoder->SBHUFFDT = SBHUFFDT;
- pDecoder->SBHUFFRDW = SBHUFFRDW;
- pDecoder->SBHUFFRDH = SBHUFFRDH;
- pDecoder->SBHUFFRDX = SBHUFFRDX;
- pDecoder->SBHUFFRDY = SBHUFFRDY;
- pDecoder->SBHUFFRSIZE = SBHUFFRSIZE;
- pDecoder->SBRTEMPLATE = SDRTEMPLATE;
- pDecoder->SBRAT[0] = SDRAT[0];
- pDecoder->SBRAT[1] = SDRAT[1];
- pDecoder->SBRAT[2] = SDRAT[2];
- pDecoder->SBRAT[3] = SDRAT[3];
- BS = pDecoder->decode_Huffman(pStream, grContext);
- if(BS == NULL) {
- m_pModule->JBig2_Free(SBSYMCODES);
- m_pModule->JBig2_Free(SBSYMS);
- delete SBHUFFFS;
- delete SBHUFFDS;
- delete SBHUFFDT;
- delete SBHUFFRDW;
- delete SBHUFFRDH;
- delete SBHUFFRDX;
- delete SBHUFFRDY;
- delete SBHUFFRSIZE;
- delete pDecoder;
- goto failed;
- }
- m_pModule->JBig2_Free(SBSYMCODES);
- m_pModule->JBig2_Free(SBSYMS);
- delete SBHUFFFS;
- delete SBHUFFDS;
- delete SBHUFFDT;
- delete SBHUFFRDW;
- delete SBHUFFRDH;
- delete SBHUFFRDX;
- delete SBHUFFRDY;
- delete SBHUFFRSIZE;
- delete pDecoder;
- } else if(REFAGGNINST == 1) {
- SBHUFF = SDHUFF;
- SBNUMSYMS = SDNUMINSYMS + SDNUMNEWSYMS;
- nTmp = 1;
- while((FX_DWORD)(1 << nTmp) < SBNUMSYMS) {
- nTmp ++;
- }
- SBSYMCODELEN = (FX_BYTE)nTmp;
- SBSYMCODES = (JBig2HuffmanCode*)m_pModule->JBig2_Malloc2(SBNUMSYMS, sizeof(JBig2HuffmanCode));
- for(I = 0; I < SBNUMSYMS; I++) {
- SBSYMCODES[I].codelen = SBSYMCODELEN;
- SBSYMCODES[I].code = I;
- }
- nVal = 0;
- nBits = 0;
- for(;;) {
- if(pStream->read1Bit(&nTmp) != 0) {
- m_pModule->JBig2_Free(SBSYMCODES);
- m_pModule->JBig2_Error("symbol dictionary decoding procedure (huffman): too short.");
- goto failed;
- }
- nVal = (nVal << 1) | nTmp;
- for(IDI = 0; IDI < SBNUMSYMS; IDI++) {
- if((nVal == SBSYMCODES[IDI].code)
- && (nBits == SBSYMCODES[IDI].codelen)) {
- break;
- }
- }
- if(IDI < SBNUMSYMS) {
- break;
- }
- }
- m_pModule->JBig2_Free(SBSYMCODES);
- JBIG2_ALLOC(SBHUFFRDX, CJBig2_HuffmanTable(HuffmanTable_B15,
- sizeof(HuffmanTable_B15) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B15));
- JBIG2_ALLOC(SBHUFFRSIZE, CJBig2_HuffmanTable(HuffmanTable_B1,
- sizeof(HuffmanTable_B1) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B1));
- if((pHuffmanDecoder->decodeAValue(SBHUFFRDX, &RDXI) != 0)
- || (pHuffmanDecoder->decodeAValue(SBHUFFRDX, &RDYI) != 0)
- || (pHuffmanDecoder->decodeAValue(SBHUFFRSIZE, &nVal) != 0)) {
- delete SBHUFFRDX;
- delete SBHUFFRSIZE;
- m_pModule->JBig2_Error("symbol dictionary decoding procedure (huffman): too short.");
- goto failed;
- }
- delete SBHUFFRDX;
- delete SBHUFFRSIZE;
- pStream->alignByte();
- nTmp = pStream->getOffset();
- SBSYMS = (CJBig2_Image**)m_pModule->JBig2_Malloc2(SBNUMSYMS, sizeof(CJBig2_Image*));
- JBIG2_memcpy(SBSYMS, SDINSYMS, SDNUMINSYMS * sizeof(CJBig2_Image*));
- JBIG2_memcpy(SBSYMS + SDNUMINSYMS, SDNEWSYMS, NSYMSDECODED * sizeof(CJBig2_Image*));
- JBIG2_ALLOC(pGRRD, CJBig2_GRRDProc());
- pGRRD->GRW = SYMWIDTH;
- pGRRD->GRH = HCHEIGHT;
- pGRRD->GRTEMPLATE = SDRTEMPLATE;
- pGRRD->GRREFERENCE = SBSYMS[IDI];
- pGRRD->GRREFERENCEDX = RDXI;
- pGRRD->GRREFERENCEDY = RDYI;
- pGRRD->TPGRON = 0;
- pGRRD->GRAT[0] = SDRAT[0];
- pGRRD->GRAT[1] = SDRAT[1];
- pGRRD->GRAT[2] = SDRAT[2];
- pGRRD->GRAT[3] = SDRAT[3];
- JBIG2_ALLOC(pArithDecoder, CJBig2_ArithDecoder(pStream));
- BS = pGRRD->decode(pArithDecoder, grContext);
- if(BS == NULL) {
- m_pModule->JBig2_Free(SBSYMS);
- delete pGRRD;
- delete pArithDecoder;
- goto failed;
- }
- pStream->alignByte();
- pStream->offset(2);
- if((FX_DWORD)nVal != (pStream->getOffset() - nTmp)) {
- delete BS;
- m_pModule->JBig2_Free(SBSYMS);
- delete pGRRD;
- delete pArithDecoder;
- m_pModule->JBig2_Error("symbol dictionary decoding procedure (huffman):"
- "bytes processed by generic refinement region decoding procedure doesn't equal SBHUFFRSIZE.");
- goto failed;
- }
- m_pModule->JBig2_Free(SBSYMS);
- delete pGRRD;
- delete pArithDecoder;
- }
- SDNEWSYMS[NSYMSDECODED] = BS;
- }
- if(SDREFAGG == 0) {
- SDNEWSYMWIDTHS[NSYMSDECODED] = SYMWIDTH;
- }
- NSYMSDECODED = NSYMSDECODED + 1;
- }
- if(SDREFAGG == 0) {
- if(pHuffmanDecoder->decodeAValue(SDHUFFBMSIZE, (FX_INT32*)&BMSIZE) != 0) {
- m_pModule->JBig2_Error("symbol dictionary decoding procedure (huffman): too short.");
- goto failed;
- }
- pStream->alignByte();
- if(BMSIZE == 0) {
- stride = (TOTWIDTH + 7) >> 3;
- if(pStream->getByteLeft() >= stride * HCHEIGHT) {
- JBIG2_ALLOC(BHC, CJBig2_Image(TOTWIDTH, HCHEIGHT));
- for(I = 0; I < HCHEIGHT; I ++) {
- JBIG2_memcpy(BHC->m_pData + I * BHC->m_nStride, pStream->getPointer(), stride);
- pStream->offset(stride);
- }
- } else {
- m_pModule->JBig2_Error("symbol dictionary decoding procedure (huffman): too short.");
- goto failed;
- }
- } else {
- JBIG2_ALLOC(pGRD, CJBig2_GRDProc());
- pGRD->MMR = 1;
- pGRD->GBW = TOTWIDTH;
- pGRD->GBH = HCHEIGHT;
- FXCODEC_STATUS status = pGRD->Start_decode_MMR(&BHC, pStream);
- while(status == FXCODEC_STATUS_DECODE_TOBECONTINUE) {
- pGRD->Continue_decode(pPause);
- }
- delete pGRD;
- pStream->alignByte();
- }
- nTmp = 0;
- if (!BHC) {
- continue;
- }
- for(I = HCFIRSTSYM; I < NSYMSDECODED; I++) {
- SDNEWSYMS[I] = BHC->subImage(nTmp, 0, SDNEWSYMWIDTHS[I], HCHEIGHT);
- nTmp += SDNEWSYMWIDTHS[I];
- }
- delete BHC;
- BHC = NULL;
- }
- }
- EXINDEX = 0;
- CUREXFLAG = 0;
- JBIG2_ALLOC(pTable, CJBig2_HuffmanTable(HuffmanTable_B1,
- sizeof(HuffmanTable_B1) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B1));
- EXFLAGS = (FX_BOOL*)m_pModule->JBig2_Malloc2(sizeof(FX_BOOL), (SDNUMINSYMS + SDNUMNEWSYMS));
- while(EXINDEX < SDNUMINSYMS + SDNUMNEWSYMS) {
- if(pHuffmanDecoder->decodeAValue(pTable, (int*)&EXRUNLENGTH) != 0) {
- delete pTable;
- m_pModule->JBig2_Free(EXFLAGS);
- m_pModule->JBig2_Error("symbol dictionary decoding procedure (huffman): too short.");
- goto failed;
- }
- if (EXINDEX + EXRUNLENGTH > SDNUMINSYMS + SDNUMNEWSYMS) {
- delete pTable;
- m_pModule->JBig2_Free(EXFLAGS);
- m_pModule->JBig2_Error("symbol dictionary decoding procedure (arith): Invalid EXRUNLENGTH value.");
- goto failed;
- }
- if(EXRUNLENGTH != 0) {
- for(I = EXINDEX; I < EXINDEX + EXRUNLENGTH; I++) {
- EXFLAGS[I] = CUREXFLAG;
- }
- }
- EXINDEX = EXINDEX + EXRUNLENGTH;
- CUREXFLAG = !CUREXFLAG;
- }
- delete pTable;
- JBIG2_ALLOC(pDict, CJBig2_SymbolDict());
- pDict->SDNUMEXSYMS = SDNUMEXSYMS;
- pDict->SDEXSYMS = (CJBig2_Image**)m_pModule->JBig2_Malloc2(sizeof(CJBig2_Image*), SDNUMEXSYMS);
- I = J = 0;
- for(I = 0; I < SDNUMINSYMS + SDNUMNEWSYMS; I++) {
- if(EXFLAGS[I] && J < SDNUMEXSYMS) {
- if(I < SDNUMINSYMS) {
- JBIG2_ALLOC(pDict->SDEXSYMS[J], CJBig2_Image(*SDINSYMS[I]));
- } else {
- pDict->SDEXSYMS[J] = SDNEWSYMS[I - SDNUMINSYMS];
- }
- J = J + 1;
- } else if (!EXFLAGS[I] && I >= SDNUMINSYMS) {
- delete SDNEWSYMS[I - SDNUMINSYMS];
- }
- }
- if (J < SDNUMEXSYMS) {
- pDict->SDNUMEXSYMS = J;
- }
- m_pModule->JBig2_Free(EXFLAGS);
- m_pModule->JBig2_Free(SDNEWSYMS);
- if(SDREFAGG == 0) {
- m_pModule->JBig2_Free(SDNEWSYMWIDTHS);
- }
- delete pHuffmanDecoder;
- return pDict;
-failed:
- for(I = 0; I < NSYMSDECODED; I++) {
- if (SDNEWSYMS[I]) {
- delete SDNEWSYMS[I];
- }
- }
- m_pModule->JBig2_Free(SDNEWSYMS);
- if(SDREFAGG == 0) {
- m_pModule->JBig2_Free(SDNEWSYMWIDTHS);
- }
- delete pHuffmanDecoder;
- return NULL;
-}
-CJBig2_Image *CJBig2_HTRDProc::decode_Arith(CJBig2_ArithDecoder *pArithDecoder,
- JBig2ArithCtx *gbContext, IFX_Pause* pPause)
-{
- FX_DWORD ng, mg;
- FX_INT32 x, y;
- CJBig2_Image *HSKIP;
- FX_DWORD HBPP;
- FX_DWORD *GI;
- CJBig2_Image *HTREG;
- CJBig2_GSIDProc *pGID;
- JBIG2_ALLOC(HTREG, CJBig2_Image(HBW, HBH));
- HTREG->fill(HDEFPIXEL);
- HSKIP = NULL;
- if(HENABLESKIP == 1) {
- JBIG2_ALLOC(HSKIP, CJBig2_Image(HGW, HGH));
- for(mg = 0; mg < HGH; mg++) {
- for(ng = 0; ng < HGW; ng++) {
- x = (HGX + mg * HRY + ng * HRX) >> 8;
- y = (HGY + mg * HRX - ng * HRY) >> 8;
- if((x + HPW <= 0) | (x >= (FX_INT32)HBW)
- | (y + HPH <= 0) | (y >= (FX_INT32)HPH)) {
- HSKIP->setPixel(ng, mg, 1);
- } else {
- HSKIP->setPixel(ng, mg, 0);
- }
- }
- }
- }
- HBPP = 1;
- while((FX_DWORD)(1 << HBPP) < HNUMPATS) {
- HBPP ++;
- }
- JBIG2_ALLOC(pGID, CJBig2_GSIDProc());
- pGID->GSMMR = HMMR;
- pGID->GSW = HGW;
- pGID->GSH = HGH;
- pGID->GSBPP = (FX_BYTE)HBPP;
- pGID->GSUSESKIP = HENABLESKIP;
- pGID->GSKIP = HSKIP;
- pGID->GSTEMPLATE = HTEMPLATE;
- GI = pGID->decode_Arith(pArithDecoder, gbContext, pPause);
- if(GI == NULL) {
- goto failed;
- }
- for(mg = 0; mg < HGH; mg++) {
- for(ng = 0; ng < HGW; ng++) {
- x = (HGX + mg * HRY + ng * HRX) >> 8;
- y = (HGY + mg * HRX - ng * HRY) >> 8;
- FX_DWORD pat_index = GI[mg * HGW + ng];
- if (pat_index >= HNUMPATS) {
- pat_index = HNUMPATS - 1;
- }
- HTREG->composeFrom(x, y, HPATS[pat_index], HCOMBOP);
- }
- }
- m_pModule->JBig2_Free(GI);
- if(HSKIP) {
- delete HSKIP;
- }
- delete pGID;
- return HTREG;
-failed:
- if(HSKIP) {
- delete HSKIP;
- }
- delete pGID;
- delete HTREG;
- return NULL;
-}
-CJBig2_Image *CJBig2_HTRDProc::decode_MMR(CJBig2_BitStream *pStream, IFX_Pause* pPause)
-{
- FX_DWORD ng, mg;
- FX_INT32 x, y;
- FX_DWORD HBPP;
- FX_DWORD *GI;
- CJBig2_Image *HTREG;
- CJBig2_GSIDProc *pGID;
- JBIG2_ALLOC(HTREG, CJBig2_Image(HBW, HBH));
- HTREG->fill(HDEFPIXEL);
- HBPP = 1;
- while((FX_DWORD)(1 << HBPP) < HNUMPATS) {
- HBPP ++;
- }
- JBIG2_ALLOC(pGID, CJBig2_GSIDProc());
- pGID->GSMMR = HMMR;
- pGID->GSW = HGW;
- pGID->GSH = HGH;
- pGID->GSBPP = (FX_BYTE)HBPP;
- pGID->GSUSESKIP = 0;
- GI = pGID->decode_MMR(pStream, pPause);
- if(GI == NULL) {
- goto failed;
- }
- for(mg = 0; mg < HGH; mg++) {
- for(ng = 0; ng < HGW; ng++) {
- x = (HGX + mg * HRY + ng * HRX) >> 8;
- y = (HGY + mg * HRX - ng * HRY) >> 8;
- FX_DWORD pat_index = GI[mg * HGW + ng];
- if (pat_index >= HNUMPATS) {
- pat_index = HNUMPATS - 1;
- }
- HTREG->composeFrom(x, y, HPATS[pat_index], HCOMBOP);
- }
- }
- m_pModule->JBig2_Free(GI);
- delete pGID;
- return HTREG;
-failed:
- delete pGID;
- delete HTREG;
- return NULL;
-}
-CJBig2_PatternDict *CJBig2_PDDProc::decode_Arith(CJBig2_ArithDecoder *pArithDecoder,
- JBig2ArithCtx *gbContext, IFX_Pause* pPause)
-{
- FX_DWORD GRAY;
- CJBig2_Image *BHDC = NULL;
- CJBig2_PatternDict *pDict;
- CJBig2_GRDProc *pGRD;
- JBIG2_ALLOC(pDict, CJBig2_PatternDict());
- pDict->NUMPATS = GRAYMAX + 1;
- pDict->HDPATS = (CJBig2_Image**)m_pModule->JBig2_Malloc2(sizeof(CJBig2_Image*), pDict->NUMPATS);
- JBIG2_memset(pDict->HDPATS, 0, sizeof(CJBig2_Image*)*pDict->NUMPATS);
- JBIG2_ALLOC(pGRD, CJBig2_GRDProc());
- pGRD->MMR = HDMMR;
- pGRD->GBW = (GRAYMAX + 1) * HDPW;
- pGRD->GBH = HDPH;
- pGRD->GBTEMPLATE = HDTEMPLATE;
- pGRD->TPGDON = 0;
- pGRD->USESKIP = 0;
- pGRD->GBAT[0] = -(FX_INT32)HDPW;
- pGRD->GBAT[1] = 0;
- if(pGRD->GBTEMPLATE == 0) {
- pGRD->GBAT[2] = -3;
- pGRD->GBAT[3] = -1;
- pGRD->GBAT[4] = 2;
- pGRD->GBAT[5] = -2;
- pGRD->GBAT[6] = -2;
- pGRD->GBAT[7] = -2;
- }
- FXCODEC_STATUS status = pGRD->Start_decode_Arith(&BHDC, pArithDecoder, gbContext);
- while(status == FXCODEC_STATUS_DECODE_TOBECONTINUE) {
- pGRD->Continue_decode(pPause);
- }
- if(BHDC == NULL) {
- delete pGRD;
- goto failed;
- }
- delete pGRD;
- GRAY = 0;
- while(GRAY <= GRAYMAX) {
- pDict->HDPATS[GRAY] = BHDC->subImage(HDPW * GRAY, 0, HDPW, HDPH);
- GRAY = GRAY + 1;
- }
- delete BHDC;
- return pDict;
-failed:
- delete pDict;
- return NULL;
-}
-
-CJBig2_PatternDict *CJBig2_PDDProc::decode_MMR(CJBig2_BitStream *pStream, IFX_Pause* pPause)
-{
- FX_DWORD GRAY;
- CJBig2_Image *BHDC = NULL;
- CJBig2_PatternDict *pDict;
- CJBig2_GRDProc *pGRD;
- JBIG2_ALLOC(pDict, CJBig2_PatternDict());
- pDict->NUMPATS = GRAYMAX + 1;
- pDict->HDPATS = (CJBig2_Image**)m_pModule->JBig2_Malloc2(sizeof(CJBig2_Image*), pDict->NUMPATS);
- JBIG2_memset(pDict->HDPATS, 0, sizeof(CJBig2_Image*)*pDict->NUMPATS);
- JBIG2_ALLOC(pGRD, CJBig2_GRDProc());
- pGRD->MMR = HDMMR;
- pGRD->GBW = (GRAYMAX + 1) * HDPW;
- pGRD->GBH = HDPH;
- FXCODEC_STATUS status = pGRD->Start_decode_MMR(&BHDC, pStream);
- while(status == FXCODEC_STATUS_DECODE_TOBECONTINUE) {
- pGRD->Continue_decode(pPause);
- }
- if(BHDC == NULL) {
- delete pGRD;
- goto failed;
- }
- delete pGRD;
- GRAY = 0;
- while(GRAY <= GRAYMAX) {
- pDict->HDPATS[GRAY] = BHDC->subImage(HDPW * GRAY, 0, HDPW, HDPH);
- GRAY = GRAY + 1;
- }
- delete BHDC;
- return pDict;
-failed:
- delete pDict;
- return NULL;
-}
-FX_DWORD *CJBig2_GSIDProc::decode_Arith(CJBig2_ArithDecoder *pArithDecoder,
- JBig2ArithCtx *gbContext, IFX_Pause* pPause)
-{
- CJBig2_Image **GSPLANES;
- FX_INT32 J, K;
- FX_DWORD x, y;
- FX_DWORD *GSVALS;
- CJBig2_GRDProc *pGRD;
- GSPLANES = (CJBig2_Image **)m_pModule->JBig2_Malloc2(sizeof(CJBig2_Image*), GSBPP);
- if (!GSPLANES) {
- return NULL;
- }
- GSVALS = (FX_DWORD*)m_pModule->JBig2_Malloc3(sizeof(FX_DWORD), GSW, GSH);
- if (!GSVALS) {
- m_pModule->JBig2_Free(GSPLANES);
- return NULL;
- }
- JBIG2_memset(GSPLANES, 0, sizeof(CJBig2_Image*)*GSBPP);
- JBIG2_memset(GSVALS, 0, sizeof(FX_DWORD)*GSW * GSH);
- JBIG2_ALLOC(pGRD, CJBig2_GRDProc());
- pGRD->MMR = GSMMR;
- pGRD->GBW = GSW;
- pGRD->GBH = GSH;
- pGRD->GBTEMPLATE = GSTEMPLATE;
- pGRD->TPGDON = 0;
- pGRD->USESKIP = GSUSESKIP;
- pGRD->SKIP = GSKIP;
- if(GSTEMPLATE <= 1) {
- pGRD->GBAT[0] = 3;
- } else {
- pGRD->GBAT[0] = 2;
- }
- pGRD->GBAT[1] = -1;
- if(pGRD->GBTEMPLATE == 0) {
- pGRD->GBAT[2] = -3;
- pGRD->GBAT[3] = -1;
- pGRD->GBAT[4] = 2;
- pGRD->GBAT[5] = -2;
- pGRD->GBAT[6] = -2;
- pGRD->GBAT[7] = -2;
- }
- FXCODEC_STATUS status = pGRD->Start_decode_Arith(&GSPLANES[GSBPP - 1], pArithDecoder, gbContext);
- while(status == FXCODEC_STATUS_DECODE_TOBECONTINUE) {
- pGRD->Continue_decode(pPause);
- }
- if(GSPLANES[GSBPP - 1] == NULL) {
- goto failed;
- }
- J = GSBPP - 2;
- while(J >= 0) {
- FXCODEC_STATUS status = pGRD->Start_decode_Arith(&GSPLANES[J], pArithDecoder, gbContext);
- while(status == FXCODEC_STATUS_DECODE_TOBECONTINUE) {
- pGRD->Continue_decode(pPause);
- }
- if(GSPLANES[J] == NULL) {
- for(K = GSBPP - 1; K > J; K--) {
- delete GSPLANES[K];
- goto failed;
- }
- }
- GSPLANES[J]->composeFrom(0, 0, GSPLANES[J + 1], JBIG2_COMPOSE_XOR);
- J = J - 1;
- }
- for(y = 0; y < GSH; y++) {
- for(x = 0; x < GSW; x++) {
- for(J = 0; J < GSBPP; J++) {
- GSVALS[y * GSW + x] |= GSPLANES[J]->getPixel(x, y) << J;
- }
- }
- }
- for(J = 0; J < GSBPP; J++) {
- delete GSPLANES[J];
- }
- m_pModule->JBig2_Free(GSPLANES);
- delete pGRD;
- return GSVALS;
-failed:
- m_pModule->JBig2_Free(GSPLANES);
- delete pGRD;
- m_pModule->JBig2_Free(GSVALS);
- return NULL;
-}
-FX_DWORD *CJBig2_GSIDProc::decode_MMR(CJBig2_BitStream *pStream, IFX_Pause* pPause)
-{
- CJBig2_Image **GSPLANES;
- FX_INT32 J, K;
- FX_DWORD x, y;
- FX_DWORD *GSVALS;
- CJBig2_GRDProc *pGRD;
- GSPLANES = (CJBig2_Image **)m_pModule->JBig2_Malloc2(sizeof(CJBig2_Image*), GSBPP);
- if (!GSPLANES) {
- return NULL;
- }
- GSVALS = (FX_DWORD*)m_pModule->JBig2_Malloc3(sizeof(FX_DWORD), GSW, GSH);
- if (!GSVALS) {
- if (GSPLANES) {
- m_pModule->JBig2_Free(GSPLANES);
- }
- return NULL;
- }
- JBIG2_memset(GSPLANES, 0, sizeof(CJBig2_Image*)*GSBPP);
- JBIG2_memset(GSVALS, 0, sizeof(FX_DWORD)*GSW * GSH);
- JBIG2_ALLOC(pGRD, CJBig2_GRDProc());
- pGRD->MMR = GSMMR;
- pGRD->GBW = GSW;
- pGRD->GBH = GSH;
- FXCODEC_STATUS status = pGRD->Start_decode_MMR(&GSPLANES[GSBPP - 1], pStream);
- while(status == FXCODEC_STATUS_DECODE_TOBECONTINUE) {
- pGRD->Continue_decode(pPause);
- }
- if(GSPLANES[GSBPP - 1] == NULL) {
- goto failed;
- }
- pStream->alignByte();
- pStream->offset(3);
- J = GSBPP - 2;
- while(J >= 0) {
- FXCODEC_STATUS status = pGRD->Start_decode_MMR(&GSPLANES[J], pStream);
- while(status == FXCODEC_STATUS_DECODE_TOBECONTINUE) {
- pGRD->Continue_decode(pPause);
- }
- if(GSPLANES[J] == NULL) {
- for(K = GSBPP - 1; K > J; K--) {
- delete GSPLANES[K];
- goto failed;
- }
- }
- pStream->alignByte();
- pStream->offset(3);
- GSPLANES[J]->composeFrom(0, 0, GSPLANES[J + 1], JBIG2_COMPOSE_XOR);
- J = J - 1;
- }
- for(y = 0; y < GSH; y++) {
- for(x = 0; x < GSW; x++) {
- for(J = 0; J < GSBPP; J++) {
- GSVALS[y * GSW + x] |= GSPLANES[J]->getPixel(x, y) << J;
- }
- }
- }
- for(J = 0; J < GSBPP; J++) {
- delete GSPLANES[J];
- }
- m_pModule->JBig2_Free(GSPLANES);
- delete pGRD;
- return GSVALS;
-failed:
- m_pModule->JBig2_Free(GSPLANES);
- delete pGRD;
- m_pModule->JBig2_Free(GSVALS);
- return NULL;
-}
-FXCODEC_STATUS CJBig2_GRDProc::Start_decode_Arith(CJBig2_Image** pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause)
-{
- if (GBW == 0 || GBH == 0) {
- m_ProssiveStatus = FXCODEC_STATUS_DECODE_FINISH;
- return FXCODEC_STATUS_DECODE_FINISH;
- }
- m_ProssiveStatus = FXCODEC_STATUS_DECODE_READY;
- m_pPause = pPause;
- if(*pImage == NULL) {
- JBIG2_ALLOC((*pImage), CJBig2_Image(GBW, GBH));
- }
- if ((*pImage)->m_pData == NULL) {
- delete *pImage;
- *pImage = NULL;
- m_pModule->JBig2_Error("Generic region decoding procedure: Create Image Failed with width = %d, height = %d\n", GBW, GBH);
- m_ProssiveStatus = FXCODEC_STATUS_ERROR;
- return FXCODEC_STATUS_ERROR;
- }
- m_DecodeType = 1;
- m_pImage = pImage;
- (*m_pImage)->fill(0);
- m_pArithDecoder = pArithDecoder;
- m_gbContext = gbContext;
- LTP = 0;
- m_pLine = NULL;
- m_loopIndex = 0;
- return decode_Arith(pPause);
-}
-FXCODEC_STATUS CJBig2_GRDProc::decode_Arith(IFX_Pause* pPause)
-{
- int iline = m_loopIndex;
- CJBig2_Image* pImage = *m_pImage;
- if(GBTEMPLATE == 0) {
- if((GBAT[0] == 3) && (GBAT[1] == (signed char) - 1)
- && (GBAT[2] == (signed char) - 3) && (GBAT[3] == (signed char) - 1)
- && (GBAT[4] == 2) && (GBAT[5] == (signed char) - 2)
- && (GBAT[6] == (signed char) - 2) && (GBAT[7] == (signed char) - 2)) {
- m_ProssiveStatus = decode_Arith_Template0_opt3(pImage, m_pArithDecoder, m_gbContext, pPause);
- } else {
- m_ProssiveStatus = decode_Arith_Template0_unopt(pImage, m_pArithDecoder, m_gbContext, pPause);
- }
- } else if(GBTEMPLATE == 1) {
- if((GBAT[0] == 3) && (GBAT[1] == (signed char) - 1)) {
- m_ProssiveStatus = decode_Arith_Template1_opt3(pImage, m_pArithDecoder, m_gbContext, pPause);
- } else {
- m_ProssiveStatus = decode_Arith_Template1_unopt(pImage, m_pArithDecoder, m_gbContext, pPause);
- }
- } else if(GBTEMPLATE == 2) {
- if((GBAT[0] == 2) && (GBAT[1] == (signed char) - 1)) {
- m_ProssiveStatus = decode_Arith_Template2_opt3(pImage, m_pArithDecoder, m_gbContext, pPause);
- } else {
- m_ProssiveStatus = decode_Arith_Template2_unopt(pImage, m_pArithDecoder, m_gbContext, pPause);
- }
- } else {
- if((GBAT[0] == 2) && (GBAT[1] == (signed char) - 1)) {
- m_ProssiveStatus = decode_Arith_Template3_opt3(pImage, m_pArithDecoder, m_gbContext, pPause);
- } else {
- m_ProssiveStatus = decode_Arith_Template3_unopt(pImage, m_pArithDecoder, m_gbContext, pPause);
- }
- }
- m_ReplaceRect.left = 0;
- m_ReplaceRect.right = pImage->m_nWidth;
- m_ReplaceRect.top = iline;
- m_ReplaceRect.bottom = m_loopIndex;
- if(m_ProssiveStatus == FXCODEC_STATUS_DECODE_FINISH) {
- m_loopIndex = 0;
- }
- return m_ProssiveStatus;
-}
-FXCODEC_STATUS CJBig2_GRDProc::Start_decode_Arith_V2(CJBig2_Image** pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause)
-{
- if(GBW == 0 || GBH == 0) {
- * pImage = NULL;
- m_ProssiveStatus = FXCODEC_STATUS_DECODE_FINISH;
- return FXCODEC_STATUS_DECODE_FINISH;
- }
- if(*pImage == NULL) {
- JBIG2_ALLOC((*pImage), CJBig2_Image(GBW, GBH));
- }
- if ((*pImage)->m_pData == NULL) {
- delete *pImage;
- *pImage = NULL;
- m_pModule->JBig2_Error("Generic region decoding procedure: Create Image Failed with width = %d, height = %d\n", GBW, GBH);
- m_ProssiveStatus = FXCODEC_STATUS_ERROR;
- return FXCODEC_STATUS_ERROR;
- }
- m_ProssiveStatus = FXCODEC_STATUS_DECODE_READY;
- m_DecodeType = 2;
- m_pPause = pPause;
- m_pImage = pImage;
- (*m_pImage)->fill(0);
- LTP = 0;
- m_loopIndex = 0;
- m_pArithDecoder = pArithDecoder;
- m_gbContext = gbContext;
- return decode_Arith_V2(pPause);
-}
-FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_V2(IFX_Pause* pPause)
-{
- FX_BOOL SLTP, bVal;
- FX_DWORD CONTEXT;
- CJBig2_Image *GBREG = *m_pImage;
- FX_DWORD line1, line2, line3;
- LTP = 0;
- JBIG2_ALLOC(GBREG, CJBig2_Image(GBW, GBH));
- GBREG->fill(0);
- for(; m_loopIndex < GBH; m_loopIndex++) {
- if(TPGDON) {
- switch(GBTEMPLATE) {
- case 0:
- CONTEXT = 0x9b25;
- break;
- case 1:
- CONTEXT = 0x0795;
- break;
- case 2:
- CONTEXT = 0x00e5;
- break;
- case 3:
- CONTEXT = 0x0195;
- break;
- }
- SLTP = m_pArithDecoder->DECODE(&m_gbContext[CONTEXT]);
- LTP = LTP ^ SLTP;
- }
- if(LTP == 1) {
- GBREG->copyLine(m_loopIndex, m_loopIndex - 1);
- } else {
- switch(GBTEMPLATE) {
- case 0: {
- line1 = GBREG->getPixel(1, m_loopIndex - 2);
- line1 |= GBREG->getPixel(0, m_loopIndex - 2) << 1;
- line2 = GBREG->getPixel(2, m_loopIndex - 1);
- line2 |= GBREG->getPixel(1, m_loopIndex - 1) << 1;
- line2 |= GBREG->getPixel(0, m_loopIndex - 1) << 2;
- line3 = 0;
- for(FX_DWORD w = 0; w < GBW; w++) {
- if(USESKIP && SKIP->getPixel(w, m_loopIndex)) {
- bVal = 0;
- } else {
- CONTEXT = line3;
- CONTEXT |= GBREG->getPixel(w + GBAT[0], m_loopIndex + GBAT[1]) << 4;
- CONTEXT |= line2 << 5;
- CONTEXT |= GBREG->getPixel(w + GBAT[2], m_loopIndex + GBAT[3]) << 10;
- CONTEXT |= GBREG->getPixel(w + GBAT[4], m_loopIndex + GBAT[5]) << 11;
- CONTEXT |= line1 << 12;
- CONTEXT |= GBREG->getPixel(w + GBAT[6], m_loopIndex + GBAT[7]) << 15;
- bVal = m_pArithDecoder->DECODE(&m_gbContext[CONTEXT]);
- }
- if(bVal) {
- GBREG->setPixel(w, m_loopIndex, bVal);
- }
- line1 = ((line1 << 1) | GBREG->getPixel(w + 2, m_loopIndex - 2)) & 0x07;
- line2 = ((line2 << 1) | GBREG->getPixel(w + 3, m_loopIndex - 1)) & 0x1f;
- line3 = ((line3 << 1) | bVal) & 0x0f;
- }
- }
- break;
- case 1: {
- line1 = GBREG->getPixel(2, m_loopIndex - 2);
- line1 |= GBREG->getPixel(1, m_loopIndex - 2) << 1;
- line1 |= GBREG->getPixel(0, m_loopIndex - 2) << 2;
- line2 = GBREG->getPixel(2, m_loopIndex - 1);
- line2 |= GBREG->getPixel(1, m_loopIndex - 1) << 1;
- line2 |= GBREG->getPixel(0, m_loopIndex - 1) << 2;
- line3 = 0;
- for(FX_DWORD w = 0; w < GBW; w++) {
- if(USESKIP && SKIP->getPixel(w, m_loopIndex)) {
- bVal = 0;
- } else {
- CONTEXT = line3;
- CONTEXT |= GBREG->getPixel(w + GBAT[0], m_loopIndex + GBAT[1]) << 3;
- CONTEXT |= line2 << 4;
- CONTEXT |= line1 << 9;
- bVal = m_pArithDecoder->DECODE(&m_gbContext[CONTEXT]);
- }
- if(bVal) {
- GBREG->setPixel(w, m_loopIndex, bVal);
- }
- line1 = ((line1 << 1) | GBREG->getPixel(w + 3, m_loopIndex - 2)) & 0x0f;
- line2 = ((line2 << 1) | GBREG->getPixel(w + 3, m_loopIndex - 1)) & 0x1f;
- line3 = ((line3 << 1) | bVal) & 0x07;
- }
- }
- break;
- case 2: {
- line1 = GBREG->getPixel(1, m_loopIndex - 2);
- line1 |= GBREG->getPixel(0, m_loopIndex - 2) << 1;
- line2 = GBREG->getPixel(1, m_loopIndex - 1);
- line2 |= GBREG->getPixel(0, m_loopIndex - 1) << 1;
- line3 = 0;
- for(FX_DWORD w = 0; w < GBW; w++) {
- if(USESKIP && SKIP->getPixel(w, m_loopIndex)) {
- bVal = 0;
- } else {
- CONTEXT = line3;
- CONTEXT |= GBREG->getPixel(w + GBAT[0], m_loopIndex + GBAT[1]) << 2;
- CONTEXT |= line2 << 3;
- CONTEXT |= line1 << 7;
- bVal = m_pArithDecoder->DECODE(&m_gbContext[CONTEXT]);
- }
- if(bVal) {
- GBREG->setPixel(w, m_loopIndex, bVal);
- }
- line1 = ((line1 << 1) | GBREG->getPixel(w + 2, m_loopIndex - 2)) & 0x07;
- line2 = ((line2 << 1) | GBREG->getPixel(w + 2, m_loopIndex - 1)) & 0x0f;
- line3 = ((line3 << 1) | bVal) & 0x03;
- }
- }
- break;
- case 3: {
- line1 = GBREG->getPixel(1, m_loopIndex - 1);
- line1 |= GBREG->getPixel(0, m_loopIndex - 1) << 1;
- line2 = 0;
- for(FX_DWORD w = 0; w < GBW; w++) {
- if(USESKIP && SKIP->getPixel(w, m_loopIndex)) {
- bVal = 0;
- } else {
- CONTEXT = line2;
- CONTEXT |= GBREG->getPixel(w + GBAT[0], m_loopIndex + GBAT[1]) << 4;
- CONTEXT |= line1 << 5;
- bVal = m_pArithDecoder->DECODE(&m_gbContext[CONTEXT]);
- }
- if(bVal) {
- GBREG->setPixel(w, m_loopIndex, bVal);
- }
- line1 = ((line1 << 1) | GBREG->getPixel(w + 2, m_loopIndex - 1)) & 0x1f;
- line2 = ((line2 << 1) | bVal) & 0x0f;
- }
- }
- break;
- }
- }
- if(pPause && pPause->NeedToPauseNow()) {
- m_loopIndex ++;
- m_ProssiveStatus = FXCODEC_STATUS_DECODE_TOBECONTINUE;
- return FXCODEC_STATUS_DECODE_TOBECONTINUE;
- }
- }
- m_ProssiveStatus = FXCODEC_STATUS_DECODE_FINISH;
- return FXCODEC_STATUS_DECODE_FINISH;
-}
-FXCODEC_STATUS CJBig2_GRDProc::Start_decode_Arith_V1(CJBig2_Image** pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause)
-{
- if(GBW == 0 || GBH == 0) {
- * pImage = NULL;
- m_ProssiveStatus = FXCODEC_STATUS_DECODE_FINISH;
- return FXCODEC_STATUS_DECODE_FINISH;
- }
- if(*pImage == NULL) {
- JBIG2_ALLOC((*pImage), CJBig2_Image(GBW, GBH));
- }
- if ((*pImage)->m_pData == NULL) {
- delete *pImage;
- *pImage = NULL;
- m_pModule->JBig2_Error("Generic region decoding procedure: Create Image Failed with width = %d, height = %d\n", GBW, GBH);
- m_ProssiveStatus = FXCODEC_STATUS_ERROR;
- return FXCODEC_STATUS_ERROR;
- }
- m_ProssiveStatus = FXCODEC_STATUS_DECODE_READY;
- m_pPause = pPause;
- m_pImage = pImage;
- m_DecodeType = 3;
- (*m_pImage)->fill(0);
- LTP = 0;
- m_loopIndex = 0;
- m_pArithDecoder = pArithDecoder;
- m_gbContext = gbContext;
- return decode_Arith_V1(pPause);
-}
-FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_V1(IFX_Pause* pPause)
-{
- FX_BOOL SLTP, bVal;
- FX_DWORD CONTEXT = 0;
- CJBig2_Image *GBREG = (*m_pImage);
- for(; m_loopIndex < GBH; m_loopIndex++) {
- if(TPGDON) {
- switch(GBTEMPLATE) {
- case 0:
- CONTEXT = 0x9b25;
- break;
- case 1:
- CONTEXT = 0x0795;
- break;
- case 2:
- CONTEXT = 0x00e5;
- break;
- case 3:
- CONTEXT = 0x0195;
- break;
- }
- SLTP = m_pArithDecoder->DECODE(&m_gbContext[CONTEXT]);
- LTP = LTP ^ SLTP;
- }
- if(LTP == 1) {
- for(FX_DWORD w = 0; w < GBW; w++) {
- GBREG->setPixel(w, m_loopIndex, GBREG->getPixel(w, m_loopIndex - 1));
- }
- } else {
- for(FX_DWORD w = 0; w < GBW; w++) {
- if(USESKIP && SKIP->getPixel(w, m_loopIndex)) {
- GBREG->setPixel(w, m_loopIndex, 0);
- } else {
- CONTEXT = 0;
- switch(GBTEMPLATE) {
- case 0:
- CONTEXT |= GBREG->getPixel(w - 1, m_loopIndex);
- CONTEXT |= GBREG->getPixel(w - 2, m_loopIndex) << 1;
- CONTEXT |= GBREG->getPixel(w - 3, m_loopIndex) << 2;
- CONTEXT |= GBREG->getPixel(w - 4, m_loopIndex) << 3;
- CONTEXT |= GBREG->getPixel(w + GBAT[0], m_loopIndex + GBAT[1]) << 4;
- CONTEXT |= GBREG->getPixel(w + 2, m_loopIndex - 1) << 5;
- CONTEXT |= GBREG->getPixel(w + 1, m_loopIndex - 1) << 6;
- CONTEXT |= GBREG->getPixel(w, m_loopIndex - 1) << 7;
- CONTEXT |= GBREG->getPixel(w - 1, m_loopIndex - 1) << 8;
- CONTEXT |= GBREG->getPixel(w - 2, m_loopIndex - 1) << 9;
- CONTEXT |= GBREG->getPixel(w + GBAT[2], m_loopIndex + GBAT[3]) << 10;
- CONTEXT |= GBREG->getPixel(w + GBAT[4], m_loopIndex + GBAT[5]) << 11;
- CONTEXT |= GBREG->getPixel(w + 1, m_loopIndex - 2) << 12;
- CONTEXT |= GBREG->getPixel(w, m_loopIndex - 2) << 13;
- CONTEXT |= GBREG->getPixel(w - 1, m_loopIndex - 2) << 14;
- CONTEXT |= GBREG->getPixel(w + GBAT[6], m_loopIndex + GBAT[7]) << 15;
- break;
- case 1:
- CONTEXT |= GBREG->getPixel(w - 1, m_loopIndex);
- CONTEXT |= GBREG->getPixel(w - 2, m_loopIndex) << 1;
- CONTEXT |= GBREG->getPixel(w - 3, m_loopIndex) << 2;
- CONTEXT |= GBREG->getPixel(w + GBAT[0], m_loopIndex + GBAT[1]) << 3;
- CONTEXT |= GBREG->getPixel(w + 2, m_loopIndex - 1) << 4;
- CONTEXT |= GBREG->getPixel(w + 1, m_loopIndex - 1) << 5;
- CONTEXT |= GBREG->getPixel(w, m_loopIndex - 1) << 6;
- CONTEXT |= GBREG->getPixel(w - 1, m_loopIndex - 1) << 7;
- CONTEXT |= GBREG->getPixel(w - 2, m_loopIndex - 1) << 8;
- CONTEXT |= GBREG->getPixel(w + 2, m_loopIndex - 2) << 9;
- CONTEXT |= GBREG->getPixel(w + 1, m_loopIndex - 2) << 10;
- CONTEXT |= GBREG->getPixel(w, m_loopIndex - 2) << 11;
- CONTEXT |= GBREG->getPixel(w - 1, m_loopIndex - 2) << 12;
- break;
- case 2:
- CONTEXT |= GBREG->getPixel(w - 1, m_loopIndex);
- CONTEXT |= GBREG->getPixel(w - 2, m_loopIndex) << 1;
- CONTEXT |= GBREG->getPixel(w + GBAT[0], m_loopIndex + GBAT[1]) << 2;
- CONTEXT |= GBREG->getPixel(w + 1, m_loopIndex - 1) << 3;
- CONTEXT |= GBREG->getPixel(w, m_loopIndex - 1) << 4;
- CONTEXT |= GBREG->getPixel(w - 1, m_loopIndex - 1) << 5;
- CONTEXT |= GBREG->getPixel(w - 2, m_loopIndex - 1) << 6;
- CONTEXT |= GBREG->getPixel(w + 1, m_loopIndex - 2) << 7;
- CONTEXT |= GBREG->getPixel(w, m_loopIndex - 2) << 8;
- CONTEXT |= GBREG->getPixel(w - 1, m_loopIndex - 2) << 9;
- break;
- case 3:
- CONTEXT |= GBREG->getPixel(w - 1, m_loopIndex);
- CONTEXT |= GBREG->getPixel(w - 2, m_loopIndex) << 1;
- CONTEXT |= GBREG->getPixel(w - 3, m_loopIndex) << 2;
- CONTEXT |= GBREG->getPixel(w - 4, m_loopIndex) << 3;
- CONTEXT |= GBREG->getPixel(w + GBAT[0], m_loopIndex + GBAT[1]) << 4;
- CONTEXT |= GBREG->getPixel(w + 1, m_loopIndex - 1) << 5;
- CONTEXT |= GBREG->getPixel(w, m_loopIndex - 1) << 6;
- CONTEXT |= GBREG->getPixel(w - 1, m_loopIndex - 1) << 7;
- CONTEXT |= GBREG->getPixel(w - 2, m_loopIndex - 1) << 8;
- CONTEXT |= GBREG->getPixel(w - 3, m_loopIndex - 1) << 9;
- break;
- }
- bVal = m_pArithDecoder->DECODE(&m_gbContext[CONTEXT]);
- GBREG->setPixel(w, m_loopIndex, bVal);
- }
- }
- }
- if(pPause && pPause->NeedToPauseNow()) {
- m_loopIndex ++;
- m_ProssiveStatus = FXCODEC_STATUS_DECODE_TOBECONTINUE;
- return FXCODEC_STATUS_DECODE_TOBECONTINUE;
- }
- }
- m_ProssiveStatus = FXCODEC_STATUS_DECODE_FINISH;
- return FXCODEC_STATUS_DECODE_FINISH;
-}
-FXCODEC_STATUS CJBig2_GRDProc::Start_decode_MMR(CJBig2_Image** pImage, CJBig2_BitStream *pStream, IFX_Pause* pPause)
-{
- int bitpos, i;
- JBIG2_ALLOC((* pImage), CJBig2_Image(GBW, GBH));
- if ((* pImage)->m_pData == NULL) {
- delete (* pImage);
- (* pImage) = NULL;
- m_pModule->JBig2_Error("Generic region decoding procedure: Create Image Failed with width = %d, height = %d\n", GBW, GBH);
- m_ProssiveStatus = FXCODEC_STATUS_ERROR;
- return m_ProssiveStatus;
- }
- bitpos = (int)pStream->getBitPos();
- _FaxG4Decode(m_pModule, pStream->getBuf(), pStream->getLength(), &bitpos, (* pImage)->m_pData, GBW, GBH, (* pImage)->m_nStride);
- pStream->setBitPos(bitpos);
- for(i = 0; (FX_DWORD)i < (* pImage)->m_nStride * GBH; i++) {
- (* pImage)->m_pData[i] = ~(* pImage)->m_pData[i];
- }
- m_ProssiveStatus = FXCODEC_STATUS_DECODE_FINISH;
- return m_ProssiveStatus;
-}
-FXCODEC_STATUS CJBig2_GRDProc::decode_MMR()
-{
- return m_ProssiveStatus;
-}
-FXCODEC_STATUS CJBig2_GRDProc::Continue_decode(IFX_Pause* pPause)
-{
- if(m_ProssiveStatus != FXCODEC_STATUS_DECODE_TOBECONTINUE) {
- return m_ProssiveStatus;
- }
- switch (m_DecodeType) {
- case 1:
- return decode_Arith(pPause);
- case 2:
- return decode_Arith_V2(pPause);
- case 3:
- return decode_Arith_V1(pPause);
- case 4:
- return decode_MMR();
- }
- m_ProssiveStatus = FXCODEC_STATUS_ERROR;
- return m_ProssiveStatus;
-}
-FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template0_opt3(CJBig2_Image *pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause)
-{
- FX_BOOL SLTP, bVal;
- FX_DWORD CONTEXT;
- FX_DWORD line1, line2;
- FX_BYTE *pLine1, *pLine2, cVal;
- FX_INT32 nStride, nStride2, k;
- FX_INT32 nLineBytes, nBitsLeft, cc;
- if(m_pLine == NULL) {
- m_pLine = pImage->m_pData;
- }
- nStride = pImage->m_nStride;
- nStride2 = nStride << 1;
- nLineBytes = ((GBW + 7) >> 3) - 1;
- nBitsLeft = GBW - (nLineBytes << 3);
- FX_DWORD height = GBH & 0x7fffffff;
- for(; m_loopIndex < height; m_loopIndex++) {
- if(TPGDON) {
- SLTP = pArithDecoder->DECODE(&gbContext[0x9b25]);
- LTP = LTP ^ SLTP;
- }
- if(LTP == 1) {
- pImage->copyLine(m_loopIndex, m_loopIndex - 1);
- } else {
- if(m_loopIndex > 1) {
- pLine1 = m_pLine - nStride2;
- pLine2 = m_pLine - nStride;
- line1 = (*pLine1++) << 6;
- line2 = *pLine2++;
- CONTEXT = ((line1 & 0xf800) | (line2 & 0x07f0));
- for(cc = 0; cc < nLineBytes; cc++) {
- line1 = (line1 << 8) | ((*pLine1++) << 6);
- line2 = (line2 << 8) | (*pLine2++);
- cVal = 0;
- for(k = 7; k >= 0; k--) {
- bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
- cVal |= bVal << k;
- CONTEXT = (((CONTEXT & 0x7bf7) << 1) | bVal
- | ((line1 >> k) & 0x0800)
- | ((line2 >> k) & 0x0010));
- }
- m_pLine[cc] = cVal;
- }
- line1 <<= 8;
- line2 <<= 8;
- cVal = 0;
- for(k = 0; k < nBitsLeft; k++) {
- bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
- cVal |= bVal << (7 - k);
- CONTEXT = (((CONTEXT & 0x7bf7) << 1) | bVal
- | ((line1 >> (7 - k)) & 0x0800)
- | ((line2 >> (7 - k)) & 0x0010));
- }
- m_pLine[nLineBytes] = cVal;
- } else {
- pLine2 = m_pLine - nStride;
- line2 = (m_loopIndex & 1) ? (*pLine2++) : 0;
- CONTEXT = (line2 & 0x07f0);
- for(cc = 0; cc < nLineBytes; cc++) {
- if(m_loopIndex & 1) {
- line2 = (line2 << 8) | (*pLine2++);
- }
- cVal = 0;
- for(k = 7; k >= 0; k--) {
- bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
- cVal |= bVal << k;
- CONTEXT = (((CONTEXT & 0x7bf7) << 1) | bVal
- | ((line2 >> k) & 0x0010));
- }
- m_pLine[cc] = cVal;
- }
- line2 <<= 8;
- cVal = 0;
- for(k = 0; k < nBitsLeft; k++) {
- bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
- cVal |= bVal << (7 - k);
- CONTEXT = (((CONTEXT & 0x7bf7) << 1) | bVal
- | ((line2 >> (7 - k)) & 0x0010));
- }
- m_pLine[nLineBytes] = cVal;
- }
- }
- m_pLine += nStride;
- if(pPause && pPause->NeedToPauseNow()) {
- m_loopIndex++;
- m_ProssiveStatus = FXCODEC_STATUS_DECODE_TOBECONTINUE;
- return FXCODEC_STATUS_DECODE_TOBECONTINUE;
- }
- }
- m_ProssiveStatus = FXCODEC_STATUS_DECODE_FINISH;
- return FXCODEC_STATUS_DECODE_FINISH;
-}
-FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template0_unopt(CJBig2_Image * pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause)
-{
- FX_BOOL SLTP, bVal;
- FX_DWORD CONTEXT;
- FX_DWORD line1, line2, line3;
- for(; m_loopIndex < GBH; m_loopIndex++) {
- if(TPGDON) {
- SLTP = pArithDecoder->DECODE(&gbContext[0x9b25]);
- LTP = LTP ^ SLTP;
- }
- if(LTP == 1) {
- pImage->copyLine(m_loopIndex, m_loopIndex - 1);
- } else {
- line1 = pImage->getPixel(1, m_loopIndex - 2);
- line1 |= pImage->getPixel(0, m_loopIndex - 2) << 1;
- line2 = pImage->getPixel(2, m_loopIndex - 1);
- line2 |= pImage->getPixel(1, m_loopIndex - 1) << 1;
- line2 |= pImage->getPixel(0, m_loopIndex - 1) << 2;
- line3 = 0;
- for(FX_DWORD w = 0; w < GBW; w++) {
- if(USESKIP && SKIP->getPixel(w, m_loopIndex)) {
- bVal = 0;
- } else {
- CONTEXT = line3;
- CONTEXT |= pImage->getPixel(w + GBAT[0], m_loopIndex + GBAT[1]) << 4;
- CONTEXT |= line2 << 5;
- CONTEXT |= pImage->getPixel(w + GBAT[2], m_loopIndex + GBAT[3]) << 10;
- CONTEXT |= pImage->getPixel(w + GBAT[4], m_loopIndex + GBAT[5]) << 11;
- CONTEXT |= line1 << 12;
- CONTEXT |= pImage->getPixel(w + GBAT[6], m_loopIndex + GBAT[7]) << 15;
- bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
- }
- if(bVal) {
- pImage->setPixel(w, m_loopIndex, bVal);
- }
- line1 = ((line1 << 1) | pImage->getPixel(w + 2, m_loopIndex - 2)) & 0x07;
- line2 = ((line2 << 1) | pImage->getPixel(w + 3, m_loopIndex - 1)) & 0x1f;
- line3 = ((line3 << 1) | bVal) & 0x0f;
- }
- }
- if(pPause && pPause->NeedToPauseNow()) {
- m_loopIndex++;
- m_ProssiveStatus = FXCODEC_STATUS_DECODE_TOBECONTINUE;
- return FXCODEC_STATUS_DECODE_TOBECONTINUE;
- }
- }
- m_ProssiveStatus = FXCODEC_STATUS_DECODE_FINISH;
- return FXCODEC_STATUS_DECODE_FINISH;
-}
-FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template1_opt3(CJBig2_Image *pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause)
-{
- FX_BOOL SLTP, bVal;
- FX_DWORD CONTEXT;
- FX_DWORD line1, line2;
- FX_BYTE *pLine1, *pLine2, cVal;
- FX_INT32 nStride, nStride2, k;
- FX_INT32 nLineBytes, nBitsLeft, cc;
- if (!m_pLine) {
- m_pLine = pImage->m_pData;
- }
- nStride = pImage->m_nStride;
- nStride2 = nStride << 1;
- nLineBytes = ((GBW + 7) >> 3) - 1;
- nBitsLeft = GBW - (nLineBytes << 3);
- for(; m_loopIndex < GBH; m_loopIndex++) {
- if(TPGDON) {
- SLTP = pArithDecoder->DECODE(&gbContext[0x0795]);
- LTP = LTP ^ SLTP;
- }
- if(LTP == 1) {
- pImage->copyLine(m_loopIndex, m_loopIndex - 1);
- } else {
- if(m_loopIndex > 1) {
- pLine1 = m_pLine - nStride2;
- pLine2 = m_pLine - nStride;
- line1 = (*pLine1++) << 4;
- line2 = *pLine2++;
- CONTEXT = (line1 & 0x1e00) | ((line2 >> 1) & 0x01f8);
- for(cc = 0; cc < nLineBytes; cc++) {
- line1 = (line1 << 8) | ((*pLine1++) << 4);
- line2 = (line2 << 8) | (*pLine2++);
- cVal = 0;
- for(k = 7; k >= 0; k--) {
- bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
- cVal |= bVal << k;
- CONTEXT = ((CONTEXT & 0x0efb) << 1) | bVal
- | ((line1 >> k) & 0x0200)
- | ((line2 >> (k + 1)) & 0x0008);
- }
- m_pLine[cc] = cVal;
- }
- line1 <<= 8;
- line2 <<= 8;
- cVal = 0;
- for(k = 0; k < nBitsLeft; k++) {
- bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
- cVal |= bVal << (7 - k);
- CONTEXT = ((CONTEXT & 0x0efb) << 1) | bVal
- | ((line1 >> (7 - k)) & 0x0200)
- | ((line2 >> (8 - k)) & 0x0008);
- }
- m_pLine[nLineBytes] = cVal;
- } else {
- pLine2 = m_pLine - nStride;
- line2 = (m_loopIndex & 1) ? (*pLine2++) : 0;
- CONTEXT = (line2 >> 1) & 0x01f8;
- for(cc = 0; cc < nLineBytes; cc++) {
- if(m_loopIndex & 1) {
- line2 = (line2 << 8) | (*pLine2++);
- }
- cVal = 0;
- for(k = 7; k >= 0; k--) {
- bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
- cVal |= bVal << k;
- CONTEXT = ((CONTEXT & 0x0efb) << 1) | bVal
- | ((line2 >> (k + 1)) & 0x0008);
- }
- m_pLine[cc] = cVal;
- }
- line2 <<= 8;
- cVal = 0;
- for(k = 0; k < nBitsLeft; k++) {
- bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
- cVal |= bVal << (7 - k);
- CONTEXT = ((CONTEXT & 0x0efb) << 1) | bVal
- | ((line2 >> (8 - k)) & 0x0008);
- }
- m_pLine[nLineBytes] = cVal;
- }
- }
- m_pLine += nStride;
- if(pPause && pPause->NeedToPauseNow()) {
- m_loopIndex++;
- m_ProssiveStatus = FXCODEC_STATUS_DECODE_TOBECONTINUE;
- return FXCODEC_STATUS_DECODE_TOBECONTINUE;
- }
- }
- m_ProssiveStatus = FXCODEC_STATUS_DECODE_FINISH;
- return FXCODEC_STATUS_DECODE_FINISH;
-}
-FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template1_unopt(CJBig2_Image * pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause)
-{
- FX_BOOL SLTP, bVal;
- FX_DWORD CONTEXT;
- FX_DWORD line1, line2, line3;
- for(FX_DWORD h = 0; h < GBH; h++) {
- if(TPGDON) {
- SLTP = pArithDecoder->DECODE(&gbContext[0x0795]);
- LTP = LTP ^ SLTP;
- }
- if(LTP == 1) {
- pImage->copyLine(h, h - 1);
- } else {
- line1 = pImage->getPixel(2, h - 2);
- line1 |= pImage->getPixel(1, h - 2) << 1;
- line1 |= pImage->getPixel(0, h - 2) << 2;
- line2 = pImage->getPixel(2, h - 1);
- line2 |= pImage->getPixel(1, h - 1) << 1;
- line2 |= pImage->getPixel(0, h - 1) << 2;
- line3 = 0;
- for(FX_DWORD w = 0; w < GBW; w++) {
- if(USESKIP && SKIP->getPixel(w, h)) {
- bVal = 0;
- } else {
- CONTEXT = line3;
- CONTEXT |= pImage->getPixel(w + GBAT[0], h + GBAT[1]) << 3;
- CONTEXT |= line2 << 4;
- CONTEXT |= line1 << 9;
- bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
- }
- if(bVal) {
- pImage->setPixel(w, h, bVal);
- }
- line1 = ((line1 << 1) | pImage->getPixel(w + 3, h - 2)) & 0x0f;
- line2 = ((line2 << 1) | pImage->getPixel(w + 3, h - 1)) & 0x1f;
- line3 = ((line3 << 1) | bVal) & 0x07;
- }
- }
- if(pPause && pPause->NeedToPauseNow()) {
- m_loopIndex++;
- m_ProssiveStatus = FXCODEC_STATUS_DECODE_TOBECONTINUE;
- return FXCODEC_STATUS_DECODE_TOBECONTINUE;
- }
- }
- m_ProssiveStatus = FXCODEC_STATUS_DECODE_FINISH;
- return FXCODEC_STATUS_DECODE_FINISH;
-}
-FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template2_opt3(CJBig2_Image *pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause)
-{
- FX_BOOL SLTP, bVal;
- FX_DWORD CONTEXT;
- FX_DWORD line1, line2;
- FX_BYTE *pLine1, *pLine2, cVal;
- FX_INT32 nStride, nStride2, k;
- FX_INT32 nLineBytes, nBitsLeft, cc;
- if(!m_pLine) {
- m_pLine = pImage->m_pData;
- }
- nStride = pImage->m_nStride;
- nStride2 = nStride << 1;
- nLineBytes = ((GBW + 7) >> 3) - 1;
- nBitsLeft = GBW - (nLineBytes << 3);
- for(; m_loopIndex < GBH; m_loopIndex++) {
- if(TPGDON) {
- SLTP = pArithDecoder->DECODE(&gbContext[0x00e5]);
- LTP = LTP ^ SLTP;
- }
- if(LTP == 1) {
- pImage->copyLine(m_loopIndex, m_loopIndex - 1);
- } else {
- if(m_loopIndex > 1) {
- pLine1 = m_pLine - nStride2;
- pLine2 = m_pLine - nStride;
- line1 = (*pLine1++) << 1;
- line2 = *pLine2++;
- CONTEXT = (line1 & 0x0380) | ((line2 >> 3) & 0x007c);
- for(cc = 0; cc < nLineBytes; cc++) {
- line1 = (line1 << 8) | ((*pLine1++) << 1);
- line2 = (line2 << 8) | (*pLine2++);
- cVal = 0;
- for(k = 7; k >= 0; k--) {
- bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
- cVal |= bVal << k;
- CONTEXT = ((CONTEXT & 0x01bd) << 1) | bVal
- | ((line1 >> k) & 0x0080)
- | ((line2 >> (k + 3)) & 0x0004);
- }
- m_pLine[cc] = cVal;
- }
- line1 <<= 8;
- line2 <<= 8;
- cVal = 0;
- for(k = 0; k < nBitsLeft; k++) {
- bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
- cVal |= bVal << (7 - k);
- CONTEXT = ((CONTEXT & 0x01bd) << 1) | bVal
- | ((line1 >> (7 - k)) & 0x0080)
- | ((line2 >> (10 - k)) & 0x0004);
- }
- m_pLine[nLineBytes] = cVal;
- } else {
- pLine2 = m_pLine - nStride;
- line2 = (m_loopIndex & 1) ? (*pLine2++) : 0;
- CONTEXT = (line2 >> 3) & 0x007c;
- for(cc = 0; cc < nLineBytes; cc++) {
- if(m_loopIndex & 1) {
- line2 = (line2 << 8) | (*pLine2++);
- }
- cVal = 0;
- for(k = 7; k >= 0; k--) {
- bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
- cVal |= bVal << k;
- CONTEXT = ((CONTEXT & 0x01bd) << 1) | bVal
- | ((line2 >> (k + 3)) & 0x0004);
- }
- m_pLine[cc] = cVal;
- }
- line2 <<= 8;
- cVal = 0;
- for(k = 0; k < nBitsLeft; k++) {
- bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
- cVal |= bVal << (7 - k);
- CONTEXT = ((CONTEXT & 0x01bd) << 1) | bVal
- | (((line2 >> (10 - k))) & 0x0004);
- }
- m_pLine[nLineBytes] = cVal;
- }
- }
- m_pLine += nStride;
- if(pPause && m_loopIndex % 50 == 0 && pPause->NeedToPauseNow()) {
- m_loopIndex++;
- m_ProssiveStatus = FXCODEC_STATUS_DECODE_TOBECONTINUE;
- return FXCODEC_STATUS_DECODE_TOBECONTINUE;
- }
- }
- m_ProssiveStatus = FXCODEC_STATUS_DECODE_FINISH;
- return FXCODEC_STATUS_DECODE_FINISH;
-}
-FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template2_unopt(CJBig2_Image * pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause)
-{
- FX_BOOL SLTP, bVal;
- FX_DWORD CONTEXT;
- FX_DWORD line1, line2, line3;
- for(; m_loopIndex < GBH; m_loopIndex++) {
- if(TPGDON) {
- SLTP = pArithDecoder->DECODE(&gbContext[0x00e5]);
- LTP = LTP ^ SLTP;
- }
- if(LTP == 1) {
- pImage->copyLine(m_loopIndex, m_loopIndex - 1);
- } else {
- line1 = pImage->getPixel(1, m_loopIndex - 2);
- line1 |= pImage->getPixel(0, m_loopIndex - 2) << 1;
- line2 = pImage->getPixel(1, m_loopIndex - 1);
- line2 |= pImage->getPixel(0, m_loopIndex - 1) << 1;
- line3 = 0;
- for(FX_DWORD w = 0; w < GBW; w++) {
- if(USESKIP && SKIP->getPixel(w, m_loopIndex)) {
- bVal = 0;
- } else {
- CONTEXT = line3;
- CONTEXT |= pImage->getPixel(w + GBAT[0], m_loopIndex + GBAT[1]) << 2;
- CONTEXT |= line2 << 3;
- CONTEXT |= line1 << 7;
- bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
- }
- if(bVal) {
- pImage->setPixel(w, m_loopIndex, bVal);
- }
- line1 = ((line1 << 1) | pImage->getPixel(w + 2, m_loopIndex - 2)) & 0x07;
- line2 = ((line2 << 1) | pImage->getPixel(w + 2, m_loopIndex - 1)) & 0x0f;
- line3 = ((line3 << 1) | bVal) & 0x03;
- }
- }
- if(pPause && pPause->NeedToPauseNow()) {
- m_loopIndex++;
- m_ProssiveStatus = FXCODEC_STATUS_DECODE_TOBECONTINUE;
- return FXCODEC_STATUS_DECODE_TOBECONTINUE;
- }
- }
- m_ProssiveStatus = FXCODEC_STATUS_DECODE_FINISH;
- return FXCODEC_STATUS_DECODE_FINISH;
-}
-FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template3_opt3(CJBig2_Image *pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause)
-{
- FX_BOOL SLTP, bVal;
- FX_DWORD CONTEXT;
- FX_DWORD line1;
- FX_BYTE *pLine1, cVal;
- FX_INT32 nStride, k;
- FX_INT32 nLineBytes, nBitsLeft, cc;
- if (!m_pLine) {
- m_pLine = pImage->m_pData;
- }
- nStride = pImage->m_nStride;
- nLineBytes = ((GBW + 7) >> 3) - 1;
- nBitsLeft = GBW - (nLineBytes << 3);
- for(; m_loopIndex < GBH; m_loopIndex++) {
- if(TPGDON) {
- SLTP = pArithDecoder->DECODE(&gbContext[0x0195]);
- LTP = LTP ^ SLTP;
- }
- if(LTP == 1) {
- pImage->copyLine(m_loopIndex, m_loopIndex - 1);
- } else {
- if(m_loopIndex > 0) {
- pLine1 = m_pLine - nStride;
- line1 = *pLine1++;
- CONTEXT = (line1 >> 1) & 0x03f0;
- for(cc = 0; cc < nLineBytes; cc++) {
- line1 = (line1 << 8) | (*pLine1++);
- cVal = 0;
- for(k = 7; k >= 0; k--) {
- bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
- cVal |= bVal << k;
- CONTEXT = ((CONTEXT & 0x01f7) << 1) | bVal
- | ((line1 >> (k + 1)) & 0x0010);
- }
- m_pLine[cc] = cVal;
- }
- line1 <<= 8;
- cVal = 0;
- for(k = 0; k < nBitsLeft; k++) {
- bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
- cVal |= bVal << (7 - k);
- CONTEXT = ((CONTEXT & 0x01f7) << 1) | bVal
- | ((line1 >> (8 - k)) & 0x0010);
- }
- m_pLine[nLineBytes] = cVal;
- } else {
- CONTEXT = 0;
- for(cc = 0; cc < nLineBytes; cc++) {
- cVal = 0;
- for(k = 7; k >= 0; k--) {
- bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
- cVal |= bVal << k;
- CONTEXT = ((CONTEXT & 0x01f7) << 1) | bVal;
- }
- m_pLine[cc] = cVal;
- }
- cVal = 0;
- for(k = 0; k < nBitsLeft; k++) {
- bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
- cVal |= bVal << (7 - k);
- CONTEXT = ((CONTEXT & 0x01f7) << 1) | bVal;
- }
- m_pLine[nLineBytes] = cVal;
- }
- }
- m_pLine += nStride;
- if(pPause && pPause->NeedToPauseNow()) {
- m_loopIndex++;
- m_ProssiveStatus = FXCODEC_STATUS_DECODE_TOBECONTINUE;
- return FXCODEC_STATUS_DECODE_TOBECONTINUE;
- }
- }
- m_ProssiveStatus = FXCODEC_STATUS_DECODE_FINISH;
- return FXCODEC_STATUS_DECODE_FINISH;
-}
-FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template3_unopt(CJBig2_Image * pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause)
-{
- FX_BOOL SLTP, bVal;
- FX_DWORD CONTEXT;
- FX_DWORD line1, line2;
- for(; m_loopIndex < GBH; m_loopIndex++) {
- if(TPGDON) {
- SLTP = pArithDecoder->DECODE(&gbContext[0x0195]);
- LTP = LTP ^ SLTP;
- }
- if(LTP == 1) {
- pImage->copyLine(m_loopIndex, m_loopIndex - 1);
- } else {
- line1 = pImage->getPixel(1, m_loopIndex - 1);
- line1 |= pImage->getPixel(0, m_loopIndex - 1) << 1;
- line2 = 0;
- for(FX_DWORD w = 0; w < GBW; w++) {
- if(USESKIP && SKIP->getPixel(w, m_loopIndex)) {
- bVal = 0;
- } else {
- CONTEXT = line2;
- CONTEXT |= pImage->getPixel(w + GBAT[0], m_loopIndex + GBAT[1]) << 4;
- CONTEXT |= line1 << 5;
- bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
- }
- if(bVal) {
- pImage->setPixel(w, m_loopIndex, bVal);
- }
- line1 = ((line1 << 1) | pImage->getPixel(w + 2, m_loopIndex - 1)) & 0x1f;
- line2 = ((line2 << 1) | bVal) & 0x0f;
- }
- }
- if(pPause && pPause->NeedToPauseNow()) {
- m_loopIndex++;
- m_ProssiveStatus = FXCODEC_STATUS_DECODE_TOBECONTINUE;
- return FXCODEC_STATUS_DECODE_TOBECONTINUE;
- }
- }
- m_ProssiveStatus = FXCODEC_STATUS_DECODE_FINISH;
- return FXCODEC_STATUS_DECODE_FINISH;
-}
+// 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
+
+#include "JBig2_GeneralDecoder.h"
+#include "JBig2_ArithDecoder.h"
+#include "JBig2_ArithIntDecoder.h"
+#include "JBig2_HuffmanDecoder.h"
+#include "JBig2_HuffmanTable.h"
+#include "JBig2_PatternDict.h"
+CJBig2_Image *CJBig2_GRDProc::decode_Arith(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext)
+{
+ if (GBW == 0 || GBH == 0) {
+ CJBig2_Image* pImage;
+ JBIG2_ALLOC(pImage, CJBig2_Image(GBW, GBH));
+ return pImage;
+ }
+ if(GBTEMPLATE == 0) {
+ if((GBAT[0] == 3) && (GBAT[1] == (signed char) - 1)
+ && (GBAT[2] == (signed char) - 3) && (GBAT[3] == (signed char) - 1)
+ && (GBAT[4] == 2) && (GBAT[5] == (signed char) - 2)
+ && (GBAT[6] == (signed char) - 2) && (GBAT[7] == (signed char) - 2)) {
+ return decode_Arith_Template0_opt3(pArithDecoder, gbContext);
+ } else {
+ return decode_Arith_Template0_unopt(pArithDecoder, gbContext);
+ }
+ } else if(GBTEMPLATE == 1) {
+ if((GBAT[0] == 3) && (GBAT[1] == (signed char) - 1)) {
+ return decode_Arith_Template1_opt3(pArithDecoder, gbContext);
+ } else {
+ return decode_Arith_Template1_unopt(pArithDecoder, gbContext);
+ }
+ } else if(GBTEMPLATE == 2) {
+ if((GBAT[0] == 2) && (GBAT[1] == (signed char) - 1)) {
+ return decode_Arith_Template2_opt3(pArithDecoder, gbContext);
+ } else {
+ return decode_Arith_Template2_unopt(pArithDecoder, gbContext);
+ }
+ } else {
+ if((GBAT[0] == 2) && (GBAT[1] == (signed char) - 1)) {
+ return decode_Arith_Template3_opt3(pArithDecoder, gbContext);
+ } else {
+ return decode_Arith_Template3_unopt(pArithDecoder, gbContext);
+ }
+ }
+}
+CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template0_opt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext)
+{
+ FX_BOOL LTP, SLTP, bVal;
+ FX_DWORD CONTEXT;
+ CJBig2_Image *GBREG;
+ FX_DWORD line1, line2, line3;
+ LTP = 0;
+ JBIG2_ALLOC(GBREG, CJBig2_Image(GBW, GBH));
+ GBREG->fill(0);
+ for(FX_DWORD h = 0; h < GBH; h++) {
+ if(TPGDON) {
+ SLTP = pArithDecoder->DECODE(&gbContext[0x9b25]);
+ LTP = LTP ^ SLTP;
+ }
+ if(LTP == 1) {
+ GBREG->copyLine(h, h - 1);
+ } else {
+ line1 = GBREG->getPixel(2, h - 2);
+ line1 |= GBREG->getPixel(1, h - 2) << 1;
+ line1 |= GBREG->getPixel(0, h - 2) << 2;
+ line2 = GBREG->getPixel(3, h - 1);
+ line2 |= GBREG->getPixel(2, h - 1) << 1;
+ line2 |= GBREG->getPixel(1, h - 1) << 2;
+ line2 |= GBREG->getPixel(0, h - 1) << 3;
+ line3 = 0;
+ for(FX_DWORD w = 0; w < GBW; w++) {
+ if(USESKIP && SKIP->getPixel(w, h)) {
+ bVal = 0;
+ } else {
+ CONTEXT = line3;
+ CONTEXT |= line2 << 4;
+ CONTEXT |= line1 << 11;
+ bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
+ }
+ if(bVal) {
+ GBREG->setPixel(w, h, bVal);
+ }
+ line1 = ((line1 << 1) | GBREG->getPixel(w + 3, h - 2)) & 0x1f;
+ line2 = ((line2 << 1) | GBREG->getPixel(w + 4, h - 1)) & 0x7f;
+ line3 = ((line3 << 1) | bVal) & 0x0f;
+ }
+ }
+ }
+ return GBREG;
+}
+CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template0_opt2(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext)
+{
+ FX_BOOL LTP, SLTP, bVal;
+ FX_DWORD CONTEXT;
+ CJBig2_Image *GBREG;
+ FX_DWORD line1, line2;
+ FX_BYTE *pLine, cVal;
+ FX_INTPTR nStride, nStride2;
+ FX_INT32 nBits, k;
+ LTP = 0;
+ JBIG2_ALLOC(GBREG, CJBig2_Image(GBW, GBH));
+ if (GBREG->m_pData == NULL) {
+ delete GBREG;
+ m_pModule->JBig2_Error("Generic region decoding procedure: Create Image Failed with width = %d, height = %d\n", GBW, GBH);
+ return NULL;
+ }
+ pLine = GBREG->m_pData;
+ nStride = GBREG->m_nStride;
+ nStride2 = nStride << 1;
+ for(FX_DWORD h = 0; h < GBH; h++) {
+ if(TPGDON) {
+ SLTP = pArithDecoder->DECODE(&gbContext[0x9b25]);
+ LTP = LTP ^ SLTP;
+ }
+ if(LTP == 1) {
+ GBREG->copyLine(h, h - 1);
+ } else {
+ line1 = (h > 1) ? pLine[-nStride2] << 6 : 0;
+ line2 = (h > 0) ? pLine[-nStride] : 0;
+ CONTEXT = (line1 & 0xf800) | (line2 & 0x07f0);
+ for(FX_DWORD w = 0; w < GBW; w += 8) {
+ if(w + 8 < GBW) {
+ nBits = 8;
+ if(h > 1) {
+ line1 = (line1 << 8) | (pLine[-nStride2 + (w >> 3) + 1] << 6);
+ }
+ if(h > 0) {
+ line2 = (line2 << 8) | (pLine[-nStride + (w >> 3) + 1]);
+ }
+ } else {
+ nBits = GBW - w;
+ if(h > 1) {
+ line1 <<= 8;
+ }
+ if(h > 0) {
+ line2 <<= 8;
+ }
+ }
+ cVal = 0;
+ for(k = 0; k < nBits; k++) {
+ if(USESKIP && SKIP->getPixel(w, h)) {
+ bVal = 0;
+ } else {
+ bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
+ }
+ cVal |= bVal << (7 - k);
+ CONTEXT = ((CONTEXT & 0x7bf7) << 1) | bVal
+ | ((line1 >> (7 - k)) & 0x0800)
+ | ((line2 >> (7 - k)) & 0x0010);
+ }
+ pLine[w >> 3] = cVal;
+ }
+ }
+ pLine += nStride;
+ }
+ return GBREG;
+}
+CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template0_opt3(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext)
+{
+ FX_BOOL LTP, SLTP, bVal;
+ FX_DWORD CONTEXT;
+ CJBig2_Image *GBREG;
+ FX_DWORD line1, line2;
+ FX_BYTE *pLine, *pLine1, *pLine2, cVal;
+ FX_INT32 nStride, nStride2, k;
+ FX_INT32 nLineBytes, nBitsLeft, cc;
+ LTP = 0;
+ JBIG2_ALLOC(GBREG, CJBig2_Image(GBW, GBH));
+ if (GBREG->m_pData == NULL) {
+ delete GBREG;
+ m_pModule->JBig2_Error("Generic region decoding procedure: Create Image Failed with width = %d, height = %d\n", GBW, GBH);
+ return NULL;
+ }
+ pLine = GBREG->m_pData;
+ nStride = GBREG->m_nStride;
+ nStride2 = nStride << 1;
+ nLineBytes = ((GBW + 7) >> 3) - 1;
+ nBitsLeft = GBW - (nLineBytes << 3);
+ FX_DWORD height = GBH & 0x7fffffff;
+ for(FX_DWORD h = 0; h < height; h++) {
+ if(TPGDON) {
+ SLTP = pArithDecoder->DECODE(&gbContext[0x9b25]);
+ LTP = LTP ^ SLTP;
+ }
+ if(LTP == 1) {
+ GBREG->copyLine(h, h - 1);
+ } else {
+ if(h > 1) {
+ pLine1 = pLine - nStride2;
+ pLine2 = pLine - nStride;
+ line1 = (*pLine1++) << 6;
+ line2 = *pLine2++;
+ CONTEXT = ((line1 & 0xf800) | (line2 & 0x07f0));
+ for(cc = 0; cc < nLineBytes; cc++) {
+ line1 = (line1 << 8) | ((*pLine1++) << 6);
+ line2 = (line2 << 8) | (*pLine2++);
+ cVal = 0;
+ for(k = 7; k >= 0; k--) {
+ bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
+ cVal |= bVal << k;
+ CONTEXT = (((CONTEXT & 0x7bf7) << 1) | bVal
+ | ((line1 >> k) & 0x0800)
+ | ((line2 >> k) & 0x0010));
+ }
+ pLine[cc] = cVal;
+ }
+ line1 <<= 8;
+ line2 <<= 8;
+ cVal = 0;
+ for(k = 0; k < nBitsLeft; k++) {
+ bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
+ cVal |= bVal << (7 - k);
+ CONTEXT = (((CONTEXT & 0x7bf7) << 1) | bVal
+ | ((line1 >> (7 - k)) & 0x0800)
+ | ((line2 >> (7 - k)) & 0x0010));
+ }
+ pLine[nLineBytes] = cVal;
+ } else {
+ pLine2 = pLine - nStride;
+ line2 = (h & 1) ? (*pLine2++) : 0;
+ CONTEXT = (line2 & 0x07f0);
+ for(cc = 0; cc < nLineBytes; cc++) {
+ if(h & 1) {
+ line2 = (line2 << 8) | (*pLine2++);
+ }
+ cVal = 0;
+ for(k = 7; k >= 0; k--) {
+ bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
+ cVal |= bVal << k;
+ CONTEXT = (((CONTEXT & 0x7bf7) << 1) | bVal
+ | ((line2 >> k) & 0x0010));
+ }
+ pLine[cc] = cVal;
+ }
+ line2 <<= 8;
+ cVal = 0;
+ for(k = 0; k < nBitsLeft; k++) {
+ bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
+ cVal |= bVal << (7 - k);
+ CONTEXT = (((CONTEXT & 0x7bf7) << 1) | bVal
+ | (((line2 >> (7 - k))) & 0x0010));
+ }
+ pLine[nLineBytes] = cVal;
+ }
+ }
+ pLine += nStride;
+ }
+ return GBREG;
+}
+CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template0_unopt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext)
+{
+ FX_BOOL LTP, SLTP, bVal;
+ FX_DWORD CONTEXT;
+ CJBig2_Image *GBREG;
+ FX_DWORD line1, line2, line3;
+ LTP = 0;
+ JBIG2_ALLOC(GBREG, CJBig2_Image(GBW, GBH));
+ GBREG->fill(0);
+ for(FX_DWORD h = 0; h < GBH; h++) {
+ if(TPGDON) {
+ SLTP = pArithDecoder->DECODE(&gbContext[0x9b25]);
+ LTP = LTP ^ SLTP;
+ }
+ if(LTP == 1) {
+ GBREG->copyLine(h, h - 1);
+ } else {
+ line1 = GBREG->getPixel(1, h - 2);
+ line1 |= GBREG->getPixel(0, h - 2) << 1;
+ line2 = GBREG->getPixel(2, h - 1);
+ line2 |= GBREG->getPixel(1, h - 1) << 1;
+ line2 |= GBREG->getPixel(0, h - 1) << 2;
+ line3 = 0;
+ for(FX_DWORD w = 0; w < GBW; w++) {
+ if(USESKIP && SKIP->getPixel(w, h)) {
+ bVal = 0;
+ } else {
+ CONTEXT = line3;
+ CONTEXT |= GBREG->getPixel(w + GBAT[0], h + GBAT[1]) << 4;
+ CONTEXT |= line2 << 5;
+ CONTEXT |= GBREG->getPixel(w + GBAT[2], h + GBAT[3]) << 10;
+ CONTEXT |= GBREG->getPixel(w + GBAT[4], h + GBAT[5]) << 11;
+ CONTEXT |= line1 << 12;
+ CONTEXT |= GBREG->getPixel(w + GBAT[6], h + GBAT[7]) << 15;
+ bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
+ }
+ if(bVal) {
+ GBREG->setPixel(w, h, bVal);
+ }
+ line1 = ((line1 << 1) | GBREG->getPixel(w + 2, h - 2)) & 0x07;
+ line2 = ((line2 << 1) | GBREG->getPixel(w + 3, h - 1)) & 0x1f;
+ line3 = ((line3 << 1) | bVal) & 0x0f;
+ }
+ }
+ }
+ return GBREG;
+}
+CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template1_opt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext)
+{
+ FX_BOOL LTP, SLTP, bVal;
+ FX_DWORD CONTEXT;
+ CJBig2_Image *GBREG;
+ FX_DWORD line1, line2, line3;
+ LTP = 0;
+ JBIG2_ALLOC(GBREG, CJBig2_Image(GBW, GBH));
+ GBREG->fill(0);
+ for(FX_DWORD h = 0; h < GBH; h++) {
+ if(TPGDON) {
+ SLTP = pArithDecoder->DECODE(&gbContext[0x0795]);
+ LTP = LTP ^ SLTP;
+ }
+ if(LTP == 1) {
+ GBREG->copyLine(h, h - 1);
+ } else {
+ line1 = GBREG->getPixel(2, h - 2);
+ line1 |= GBREG->getPixel(1, h - 2) << 1;
+ line1 |= GBREG->getPixel(0, h - 2) << 2;
+ line2 = GBREG->getPixel(3, h - 1);
+ line2 |= GBREG->getPixel(2, h - 1) << 1;
+ line2 |= GBREG->getPixel(1, h - 1) << 2;
+ line2 |= GBREG->getPixel(0, h - 1) << 3;
+ line3 = 0;
+ for(FX_DWORD w = 0; w < GBW; w++) {
+ if(USESKIP && SKIP->getPixel(w, h)) {
+ bVal = 0;
+ } else {
+ CONTEXT = line3;
+ CONTEXT |= line2 << 3;
+ CONTEXT |= line1 << 9;
+ bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
+ }
+ if(bVal) {
+ GBREG->setPixel(w, h, bVal);
+ }
+ line1 = ((line1 << 1) | GBREG->getPixel(w + 3, h - 2)) & 0x0f;
+ line2 = ((line2 << 1) | GBREG->getPixel(w + 4, h - 1)) & 0x3f;
+ line3 = ((line3 << 1) | bVal) & 0x07;
+ }
+ }
+ }
+ return GBREG;
+}
+CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template1_opt2(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext)
+{
+ FX_BOOL LTP, SLTP, bVal;
+ FX_DWORD CONTEXT;
+ CJBig2_Image *GBREG;
+ FX_DWORD line1, line2;
+ FX_BYTE *pLine, cVal;
+ FX_INTPTR nStride, nStride2;
+ FX_INT32 nBits, k;
+ LTP = 0;
+ JBIG2_ALLOC(GBREG, CJBig2_Image(GBW, GBH));
+ if (GBREG->m_pData == NULL) {
+ delete GBREG;
+ m_pModule->JBig2_Error("Generic region decoding procedure: Create Image Failed with width = %d, height = %d\n", GBW, GBH);
+ return NULL;
+ }
+ pLine = GBREG->m_pData;
+ nStride = GBREG->m_nStride;
+ nStride2 = nStride << 1;
+ for(FX_DWORD h = 0; h < GBH; h++) {
+ if(TPGDON) {
+ SLTP = pArithDecoder->DECODE(&gbContext[0x0795]);
+ LTP = LTP ^ SLTP;
+ }
+ if(LTP == 1) {
+ GBREG->copyLine(h, h - 1);
+ } else {
+ line1 = (h > 1) ? pLine[-nStride2] << 4 : 0;
+ line2 = (h > 0) ? pLine[-nStride] : 0;
+ CONTEXT = (line1 & 0x1e00) | ((line2 >> 1) & 0x01f8);
+ for(FX_DWORD w = 0; w < GBW; w += 8) {
+ if(w + 8 < GBW) {
+ nBits = 8;
+ if(h > 1) {
+ line1 = (line1 << 8) | (pLine[-nStride2 + (w >> 3) + 1] << 4);
+ }
+ if(h > 0) {
+ line2 = (line2 << 8) | (pLine[-nStride + (w >> 3) + 1]);
+ }
+ } else {
+ nBits = GBW - w;
+ if(h > 1) {
+ line1 <<= 8;
+ }
+ if(h > 0) {
+ line2 <<= 8;
+ }
+ }
+ cVal = 0;
+ for(k = 0; k < nBits; k++) {
+ if(USESKIP && SKIP->getPixel(w, h)) {
+ bVal = 0;
+ } else {
+ bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
+ }
+ cVal |= bVal << (7 - k);
+ CONTEXT = ((CONTEXT & 0x0efb) << 1) | bVal
+ | ((line1 >> (7 - k)) & 0x0200)
+ | ((line2 >> (8 - k)) & 0x0008);
+ }
+ pLine[w >> 3] = cVal;
+ }
+ }
+ pLine += nStride;
+ }
+ return GBREG;
+}
+CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template1_opt3(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext)
+{
+ FX_BOOL LTP, SLTP, bVal;
+ FX_DWORD CONTEXT;
+ CJBig2_Image *GBREG;
+ FX_DWORD line1, line2;
+ FX_BYTE *pLine, *pLine1, *pLine2, cVal;
+ FX_INT32 nStride, nStride2, k;
+ FX_INT32 nLineBytes, nBitsLeft, cc;
+ LTP = 0;
+ JBIG2_ALLOC(GBREG, CJBig2_Image(GBW, GBH));
+ if (GBREG->m_pData == NULL) {
+ delete GBREG;
+ m_pModule->JBig2_Error("Generic region decoding procedure: Create Image Failed with width = %d, height = %d\n", GBW, GBH);
+ return NULL;
+ }
+ pLine = GBREG->m_pData;
+ nStride = GBREG->m_nStride;
+ nStride2 = nStride << 1;
+ nLineBytes = ((GBW + 7) >> 3) - 1;
+ nBitsLeft = GBW - (nLineBytes << 3);
+ for(FX_DWORD h = 0; h < GBH; h++) {
+ if(TPGDON) {
+ SLTP = pArithDecoder->DECODE(&gbContext[0x0795]);
+ LTP = LTP ^ SLTP;
+ }
+ if(LTP == 1) {
+ GBREG->copyLine(h, h - 1);
+ } else {
+ if(h > 1) {
+ pLine1 = pLine - nStride2;
+ pLine2 = pLine - nStride;
+ line1 = (*pLine1++) << 4;
+ line2 = *pLine2++;
+ CONTEXT = (line1 & 0x1e00) | ((line2 >> 1) & 0x01f8);
+ for(cc = 0; cc < nLineBytes; cc++) {
+ line1 = (line1 << 8) | ((*pLine1++) << 4);
+ line2 = (line2 << 8) | (*pLine2++);
+ cVal = 0;
+ for(k = 7; k >= 0; k--) {
+ bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
+ cVal |= bVal << k;
+ CONTEXT = ((CONTEXT & 0x0efb) << 1) | bVal
+ | ((line1 >> k) & 0x0200)
+ | ((line2 >> (k + 1)) & 0x0008);
+ }
+ pLine[cc] = cVal;
+ }
+ line1 <<= 8;
+ line2 <<= 8;
+ cVal = 0;
+ for(k = 0; k < nBitsLeft; k++) {
+ bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
+ cVal |= bVal << (7 - k);
+ CONTEXT = ((CONTEXT & 0x0efb) << 1) | bVal
+ | ((line1 >> (7 - k)) & 0x0200)
+ | ((line2 >> (8 - k)) & 0x0008);
+ }
+ pLine[nLineBytes] = cVal;
+ } else {
+ pLine2 = pLine - nStride;
+ line2 = (h & 1) ? (*pLine2++) : 0;
+ CONTEXT = (line2 >> 1) & 0x01f8;
+ for(cc = 0; cc < nLineBytes; cc++) {
+ if(h & 1) {
+ line2 = (line2 << 8) | (*pLine2++);
+ }
+ cVal = 0;
+ for(k = 7; k >= 0; k--) {
+ bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
+ cVal |= bVal << k;
+ CONTEXT = ((CONTEXT & 0x0efb) << 1) | bVal
+ | ((line2 >> (k + 1)) & 0x0008);
+ }
+ pLine[cc] = cVal;
+ }
+ line2 <<= 8;
+ cVal = 0;
+ for(k = 0; k < nBitsLeft; k++) {
+ bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
+ cVal |= bVal << (7 - k);
+ CONTEXT = ((CONTEXT & 0x0efb) << 1) | bVal
+ | ((line2 >> (8 - k)) & 0x0008);
+ }
+ pLine[nLineBytes] = cVal;
+ }
+ }
+ pLine += nStride;
+ }
+ return GBREG;
+}
+CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template1_unopt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext)
+{
+ FX_BOOL LTP, SLTP, bVal;
+ FX_DWORD CONTEXT;
+ CJBig2_Image *GBREG;
+ FX_DWORD line1, line2, line3;
+ LTP = 0;
+ JBIG2_ALLOC(GBREG, CJBig2_Image(GBW, GBH));
+ GBREG->fill(0);
+ for(FX_DWORD h = 0; h < GBH; h++) {
+ if(TPGDON) {
+ SLTP = pArithDecoder->DECODE(&gbContext[0x0795]);
+ LTP = LTP ^ SLTP;
+ }
+ if(LTP == 1) {
+ GBREG->copyLine(h, h - 1);
+ } else {
+ line1 = GBREG->getPixel(2, h - 2);
+ line1 |= GBREG->getPixel(1, h - 2) << 1;
+ line1 |= GBREG->getPixel(0, h - 2) << 2;
+ line2 = GBREG->getPixel(2, h - 1);
+ line2 |= GBREG->getPixel(1, h - 1) << 1;
+ line2 |= GBREG->getPixel(0, h - 1) << 2;
+ line3 = 0;
+ for(FX_DWORD w = 0; w < GBW; w++) {
+ if(USESKIP && SKIP->getPixel(w, h)) {
+ bVal = 0;
+ } else {
+ CONTEXT = line3;
+ CONTEXT |= GBREG->getPixel(w + GBAT[0], h + GBAT[1]) << 3;
+ CONTEXT |= line2 << 4;
+ CONTEXT |= line1 << 9;
+ bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
+ }
+ if(bVal) {
+ GBREG->setPixel(w, h, bVal);
+ }
+ line1 = ((line1 << 1) | GBREG->getPixel(w + 3, h - 2)) & 0x0f;
+ line2 = ((line2 << 1) | GBREG->getPixel(w + 3, h - 1)) & 0x1f;
+ line3 = ((line3 << 1) | bVal) & 0x07;
+ }
+ }
+ }
+ return GBREG;
+}
+CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template2_opt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext)
+{
+ FX_BOOL LTP, SLTP, bVal;
+ FX_DWORD CONTEXT;
+ CJBig2_Image *GBREG;
+ FX_DWORD line1, line2, line3;
+ LTP = 0;
+ JBIG2_ALLOC(GBREG, CJBig2_Image(GBW, GBH));
+ GBREG->fill(0);
+ for(FX_DWORD h = 0; h < GBH; h++) {
+ if(TPGDON) {
+ SLTP = pArithDecoder->DECODE(&gbContext[0x00e5]);
+ LTP = LTP ^ SLTP;
+ }
+ if(LTP == 1) {
+ GBREG->copyLine(h, h - 1);
+ } else {
+ line1 = GBREG->getPixel(1, h - 2);
+ line1 |= GBREG->getPixel(0, h - 2) << 1;
+ line2 = GBREG->getPixel(2, h - 1);
+ line2 |= GBREG->getPixel(1, h - 1) << 1;
+ line2 |= GBREG->getPixel(0, h - 1) << 2;
+ line3 = 0;
+ for(FX_DWORD w = 0; w < GBW; w++) {
+ if(USESKIP && SKIP->getPixel(w, h)) {
+ bVal = 0;
+ } else {
+ CONTEXT = line3;
+ CONTEXT |= line2 << 2;
+ CONTEXT |= line1 << 7;
+ bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
+ }
+ if(bVal) {
+ GBREG->setPixel(w, h, bVal);
+ }
+ line1 = ((line1 << 1) | GBREG->getPixel(w + 2, h - 2)) & 0x07;
+ line2 = ((line2 << 1) | GBREG->getPixel(w + 3, h - 1)) & 0x1f;
+ line3 = ((line3 << 1) | bVal) & 0x03;
+ }
+ }
+ }
+ return GBREG;
+}
+CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template2_opt2(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext)
+{
+ FX_BOOL LTP, SLTP, bVal;
+ FX_DWORD CONTEXT;
+ CJBig2_Image *GBREG;
+ FX_DWORD line1, line2;
+ FX_BYTE *pLine, cVal;
+ FX_INTPTR nStride, nStride2;
+ FX_INT32 nBits, k;
+ LTP = 0;
+ JBIG2_ALLOC(GBREG, CJBig2_Image(GBW, GBH));
+ if (GBREG->m_pData == NULL) {
+ delete GBREG;
+ m_pModule->JBig2_Error("Generic region decoding procedure: Create Image Failed with width = %d, height = %d\n", GBW, GBH);
+ return NULL;
+ }
+ pLine = GBREG->m_pData;
+ nStride = GBREG->m_nStride;
+ nStride2 = nStride << 1;
+ for(FX_DWORD h = 0; h < GBH; h++) {
+ if(TPGDON) {
+ SLTP = pArithDecoder->DECODE(&gbContext[0x00e5]);
+ LTP = LTP ^ SLTP;
+ }
+ if(LTP == 1) {
+ GBREG->copyLine(h, h - 1);
+ } else {
+ line1 = (h > 1) ? pLine[-nStride2] << 1 : 0;
+ line2 = (h > 0) ? pLine[-nStride] : 0;
+ CONTEXT = (line1 & 0x0380) | ((line2 >> 3) & 0x007c);
+ for(FX_DWORD w = 0; w < GBW; w += 8) {
+ if(w + 8 < GBW) {
+ nBits = 8;
+ if(h > 1) {
+ line1 = (line1 << 8) | (pLine[-nStride2 + (w >> 3) + 1] << 1);
+ }
+ if(h > 0) {
+ line2 = (line2 << 8) | (pLine[-nStride + (w >> 3) + 1]);
+ }
+ } else {
+ nBits = GBW - w;
+ if(h > 1) {
+ line1 <<= 8;
+ }
+ if(h > 0) {
+ line2 <<= 8;
+ }
+ }
+ cVal = 0;
+ for(k = 0; k < nBits; k++) {
+ if(USESKIP && SKIP->getPixel(w, h)) {
+ bVal = 0;
+ } else {
+ bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
+ }
+ cVal |= bVal << (7 - k);
+ CONTEXT = ((CONTEXT & 0x01bd) << 1) | bVal
+ | ((line1 >> (7 - k)) & 0x0080)
+ | ((line2 >> (10 - k)) & 0x0004);
+ }
+ pLine[w >> 3] = cVal;
+ }
+ }
+ pLine += nStride;
+ }
+ return GBREG;
+}
+CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template2_opt3(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext)
+{
+ FX_BOOL LTP, SLTP, bVal;
+ FX_DWORD CONTEXT;
+ CJBig2_Image *GBREG;
+ FX_DWORD line1, line2;
+ FX_BYTE *pLine, *pLine1, *pLine2, cVal;
+ FX_INT32 nStride, nStride2, k;
+ FX_INT32 nLineBytes, nBitsLeft, cc;
+ LTP = 0;
+ JBIG2_ALLOC(GBREG, CJBig2_Image(GBW, GBH));
+ if (GBREG->m_pData == NULL) {
+ delete GBREG;
+ m_pModule->JBig2_Error("Generic region decoding procedure: Create Image Failed with width = %d, height = %d\n", GBW, GBH);
+ return NULL;
+ }
+ pLine = GBREG->m_pData;
+ nStride = GBREG->m_nStride;
+ nStride2 = nStride << 1;
+ nLineBytes = ((GBW + 7) >> 3) - 1;
+ nBitsLeft = GBW - (nLineBytes << 3);
+ for(FX_DWORD h = 0; h < GBH; h++) {
+ if(TPGDON) {
+ SLTP = pArithDecoder->DECODE(&gbContext[0x00e5]);
+ LTP = LTP ^ SLTP;
+ }
+ if(LTP == 1) {
+ GBREG->copyLine(h, h - 1);
+ } else {
+ if(h > 1) {
+ pLine1 = pLine - nStride2;
+ pLine2 = pLine - nStride;
+ line1 = (*pLine1++) << 1;
+ line2 = *pLine2++;
+ CONTEXT = (line1 & 0x0380) | ((line2 >> 3) & 0x007c);
+ for(cc = 0; cc < nLineBytes; cc++) {
+ line1 = (line1 << 8) | ((*pLine1++) << 1);
+ line2 = (line2 << 8) | (*pLine2++);
+ cVal = 0;
+ for(k = 7; k >= 0; k--) {
+ bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
+ cVal |= bVal << k;
+ CONTEXT = ((CONTEXT & 0x01bd) << 1) | bVal
+ | ((line1 >> k) & 0x0080)
+ | ((line2 >> (k + 3)) & 0x0004);
+ }
+ pLine[cc] = cVal;
+ }
+ line1 <<= 8;
+ line2 <<= 8;
+ cVal = 0;
+ for(k = 0; k < nBitsLeft; k++) {
+ bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
+ cVal |= bVal << (7 - k);
+ CONTEXT = ((CONTEXT & 0x01bd) << 1) | bVal
+ | ((line1 >> (7 - k)) & 0x0080)
+ | ((line2 >> (10 - k)) & 0x0004);
+ }
+ pLine[nLineBytes] = cVal;
+ } else {
+ pLine2 = pLine - nStride;
+ line2 = (h & 1) ? (*pLine2++) : 0;
+ CONTEXT = (line2 >> 3) & 0x007c;
+ for(cc = 0; cc < nLineBytes; cc++) {
+ if(h & 1) {
+ line2 = (line2 << 8) | (*pLine2++);
+ }
+ cVal = 0;
+ for(k = 7; k >= 0; k--) {
+ bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
+ cVal |= bVal << k;
+ CONTEXT = ((CONTEXT & 0x01bd) << 1) | bVal
+ | ((line2 >> (k + 3)) & 0x0004);
+ }
+ pLine[cc] = cVal;
+ }
+ line2 <<= 8;
+ cVal = 0;
+ for(k = 0; k < nBitsLeft; k++) {
+ bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
+ cVal |= bVal << (7 - k);
+ CONTEXT = ((CONTEXT & 0x01bd) << 1) | bVal
+ | (((line2 >> (10 - k))) & 0x0004);
+ }
+ pLine[nLineBytes] = cVal;
+ }
+ }
+ pLine += nStride;
+ }
+ return GBREG;
+}
+CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template2_unopt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext)
+{
+ FX_BOOL LTP, SLTP, bVal;
+ FX_DWORD CONTEXT;
+ CJBig2_Image *GBREG;
+ FX_DWORD line1, line2, line3;
+ LTP = 0;
+ JBIG2_ALLOC(GBREG, CJBig2_Image(GBW, GBH));
+ GBREG->fill(0);
+ for(FX_DWORD h = 0; h < GBH; h++) {
+ if(TPGDON) {
+ SLTP = pArithDecoder->DECODE(&gbContext[0x00e5]);
+ LTP = LTP ^ SLTP;
+ }
+ if(LTP == 1) {
+ GBREG->copyLine(h, h - 1);
+ } else {
+ line1 = GBREG->getPixel(1, h - 2);
+ line1 |= GBREG->getPixel(0, h - 2) << 1;
+ line2 = GBREG->getPixel(1, h - 1);
+ line2 |= GBREG->getPixel(0, h - 1) << 1;
+ line3 = 0;
+ for(FX_DWORD w = 0; w < GBW; w++) {
+ if(USESKIP && SKIP->getPixel(w, h)) {
+ bVal = 0;
+ } else {
+ CONTEXT = line3;
+ CONTEXT |= GBREG->getPixel(w + GBAT[0], h + GBAT[1]) << 2;
+ CONTEXT |= line2 << 3;
+ CONTEXT |= line1 << 7;
+ bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
+ }
+ if(bVal) {
+ GBREG->setPixel(w, h, bVal);
+ }
+ line1 = ((line1 << 1) | GBREG->getPixel(w + 2, h - 2)) & 0x07;
+ line2 = ((line2 << 1) | GBREG->getPixel(w + 2, h - 1)) & 0x0f;
+ line3 = ((line3 << 1) | bVal) & 0x03;
+ }
+ }
+ }
+ return GBREG;
+}
+CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template3_opt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext)
+{
+ FX_BOOL LTP, SLTP, bVal;
+ FX_DWORD CONTEXT;
+ CJBig2_Image *GBREG;
+ FX_DWORD line1, line2;
+ LTP = 0;
+ JBIG2_ALLOC(GBREG, CJBig2_Image(GBW, GBH));
+ GBREG->fill(0);
+ for(FX_DWORD h = 0; h < GBH; h++) {
+ if(TPGDON) {
+ SLTP = pArithDecoder->DECODE(&gbContext[0x0195]);
+ LTP = LTP ^ SLTP;
+ }
+ if(LTP == 1) {
+ GBREG->copyLine(h, h - 1);
+ } else {
+ line1 = GBREG->getPixel(2, h - 1);
+ line1 |= GBREG->getPixel(1, h - 1) << 1;
+ line1 |= GBREG->getPixel(0, h - 1) << 2;
+ line2 = 0;
+ for(FX_DWORD w = 0; w < GBW; w++) {
+ if(USESKIP && SKIP->getPixel(w, h)) {
+ bVal = 0;
+ } else {
+ CONTEXT = line2;
+ CONTEXT |= line1 << 4;
+ bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
+ }
+ if(bVal) {
+ GBREG->setPixel(w, h, bVal);
+ }
+ line1 = ((line1 << 1) | GBREG->getPixel(w + 3, h - 1)) & 0x3f;
+ line2 = ((line2 << 1) | bVal) & 0x0f;
+ }
+ }
+ }
+ return GBREG;
+}
+CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template3_opt2(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext)
+{
+ FX_BOOL LTP, SLTP, bVal;
+ FX_DWORD CONTEXT;
+ CJBig2_Image *GBREG;
+ FX_DWORD line1;
+ FX_BYTE *pLine, cVal;
+ FX_INTPTR nStride, nStride2;
+ FX_INT32 nBits, k;
+ LTP = 0;
+ JBIG2_ALLOC(GBREG, CJBig2_Image(GBW, GBH));
+ if (GBREG->m_pData == NULL) {
+ delete GBREG;
+ m_pModule->JBig2_Error("Generic region decoding procedure: Create Image Failed with width = %d, height = %d\n", GBW, GBH);
+ return NULL;
+ }
+ pLine = GBREG->m_pData;
+ nStride = GBREG->m_nStride;
+ nStride2 = nStride << 1;
+ for(FX_DWORD h = 0; h < GBH; h++) {
+ if(TPGDON) {
+ SLTP = pArithDecoder->DECODE(&gbContext[0x0195]);
+ LTP = LTP ^ SLTP;
+ }
+ if(LTP == 1) {
+ GBREG->copyLine(h, h - 1);
+ } else {
+ line1 = (h > 0) ? pLine[-nStride] : 0;
+ CONTEXT = (line1 >> 1) & 0x03f0;
+ for(FX_DWORD w = 0; w < GBW; w += 8) {
+ if(w + 8 < GBW) {
+ nBits = 8;
+ if(h > 0) {
+ line1 = (line1 << 8) | (pLine[-nStride + (w >> 3) + 1]);
+ }
+ } else {
+ nBits = GBW - w;
+ if(h > 0) {
+ line1 <<= 8;
+ }
+ }
+ cVal = 0;
+ for(k = 0; k < nBits; k++) {
+ if(USESKIP && SKIP->getPixel(w, h)) {
+ bVal = 0;
+ } else {
+ bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
+ }
+ cVal |= bVal << (7 - k);
+ CONTEXT = ((CONTEXT & 0x01f7) << 1) | bVal
+ | ((line1 >> (8 - k)) & 0x0010);
+ }
+ pLine[w >> 3] = cVal;
+ }
+ }
+ pLine += nStride;
+ }
+ return GBREG;
+}
+CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template3_opt3(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext)
+{
+ FX_BOOL LTP, SLTP, bVal;
+ FX_DWORD CONTEXT;
+ CJBig2_Image *GBREG;
+ FX_DWORD line1;
+ FX_BYTE *pLine, *pLine1, cVal;
+ FX_INT32 nStride, k;
+ FX_INT32 nLineBytes, nBitsLeft, cc;
+ LTP = 0;
+ JBIG2_ALLOC(GBREG, CJBig2_Image(GBW, GBH));
+ if (GBREG->m_pData == NULL) {
+ delete GBREG;
+ m_pModule->JBig2_Error("Generic region decoding procedure: Create Image Failed with width = %d, height = %d\n", GBW, GBH);
+ return NULL;
+ }
+ pLine = GBREG->m_pData;
+ nStride = GBREG->m_nStride;
+ nLineBytes = ((GBW + 7) >> 3) - 1;
+ nBitsLeft = GBW - (nLineBytes << 3);
+ for(FX_DWORD h = 0; h < GBH; h++) {
+ if(TPGDON) {
+ SLTP = pArithDecoder->DECODE(&gbContext[0x0195]);
+ LTP = LTP ^ SLTP;
+ }
+ if(LTP == 1) {
+ GBREG->copyLine(h, h - 1);
+ } else {
+ if(h > 0) {
+ pLine1 = pLine - nStride;
+ line1 = *pLine1++;
+ CONTEXT = (line1 >> 1) & 0x03f0;
+ for(cc = 0; cc < nLineBytes; cc++) {
+ line1 = (line1 << 8) | (*pLine1++);
+ cVal = 0;
+ for(k = 7; k >= 0; k--) {
+ bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
+ cVal |= bVal << k;
+ CONTEXT = ((CONTEXT & 0x01f7) << 1) | bVal
+ | ((line1 >> (k + 1)) & 0x0010);
+ }
+ pLine[cc] = cVal;
+ }
+ line1 <<= 8;
+ cVal = 0;
+ for(k = 0; k < nBitsLeft; k++) {
+ bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
+ cVal |= bVal << (7 - k);
+ CONTEXT = ((CONTEXT & 0x01f7) << 1) | bVal
+ | ((line1 >> (8 - k)) & 0x0010);
+ }
+ pLine[nLineBytes] = cVal;
+ } else {
+ CONTEXT = 0;
+ for(cc = 0; cc < nLineBytes; cc++) {
+ cVal = 0;
+ for(k = 7; k >= 0; k--) {
+ bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
+ cVal |= bVal << k;
+ CONTEXT = ((CONTEXT & 0x01f7) << 1) | bVal;
+ }
+ pLine[cc] = cVal;
+ }
+ cVal = 0;
+ for(k = 0; k < nBitsLeft; k++) {
+ bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
+ cVal |= bVal << (7 - k);
+ CONTEXT = ((CONTEXT & 0x01f7) << 1) | bVal;
+ }
+ pLine[nLineBytes] = cVal;
+ }
+ }
+ pLine += nStride;
+ }
+ return GBREG;
+}
+CJBig2_Image *CJBig2_GRDProc::decode_Arith_Template3_unopt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext)
+{
+ FX_BOOL LTP, SLTP, bVal;
+ FX_DWORD CONTEXT;
+ CJBig2_Image *GBREG;
+ FX_DWORD line1, line2;
+ LTP = 0;
+ JBIG2_ALLOC(GBREG, CJBig2_Image(GBW, GBH));
+ GBREG->fill(0);
+ for(FX_DWORD h = 0; h < GBH; h++) {
+ if(TPGDON) {
+ SLTP = pArithDecoder->DECODE(&gbContext[0x0195]);
+ LTP = LTP ^ SLTP;
+ }
+ if(LTP == 1) {
+ GBREG->copyLine(h, h - 1);
+ } else {
+ line1 = GBREG->getPixel(1, h - 1);
+ line1 |= GBREG->getPixel(0, h - 1) << 1;
+ line2 = 0;
+ for(FX_DWORD w = 0; w < GBW; w++) {
+ if(USESKIP && SKIP->getPixel(w, h)) {
+ bVal = 0;
+ } else {
+ CONTEXT = line2;
+ CONTEXT |= GBREG->getPixel(w + GBAT[0], h + GBAT[1]) << 4;
+ CONTEXT |= line1 << 5;
+ bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
+ }
+ if(bVal) {
+ GBREG->setPixel(w, h, bVal);
+ }
+ line1 = ((line1 << 1) | GBREG->getPixel(w + 2, h - 1)) & 0x1f;
+ line2 = ((line2 << 1) | bVal) & 0x0f;
+ }
+ }
+ }
+ return GBREG;
+}
+CJBig2_Image *CJBig2_GRDProc::decode_Arith_V2(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext)
+{
+ FX_BOOL LTP, SLTP, bVal;
+ FX_DWORD CONTEXT;
+ CJBig2_Image *GBREG;
+ FX_DWORD line1, line2, line3;
+ LTP = 0;
+ JBIG2_ALLOC(GBREG, CJBig2_Image(GBW, GBH));
+ GBREG->fill(0);
+ for(FX_DWORD h = 0; h < GBH; h++) {
+ if(TPGDON) {
+ switch(GBTEMPLATE) {
+ case 0:
+ CONTEXT = 0x9b25;
+ break;
+ case 1:
+ CONTEXT = 0x0795;
+ break;
+ case 2:
+ CONTEXT = 0x00e5;
+ break;
+ case 3:
+ CONTEXT = 0x0195;
+ break;
+ }
+ SLTP = pArithDecoder->DECODE(&gbContext[CONTEXT]);
+ LTP = LTP ^ SLTP;
+ }
+ if(LTP == 1) {
+ GBREG->copyLine(h, h - 1);
+ } else {
+ switch(GBTEMPLATE) {
+ case 0: {
+ line1 = GBREG->getPixel(1, h - 2);
+ line1 |= GBREG->getPixel(0, h - 2) << 1;
+ line2 = GBREG->getPixel(2, h - 1);
+ line2 |= GBREG->getPixel(1, h - 1) << 1;
+ line2 |= GBREG->getPixel(0, h - 1) << 2;
+ line3 = 0;
+ for(FX_DWORD w = 0; w < GBW; w++) {
+ if(USESKIP && SKIP->getPixel(w, h)) {
+ bVal = 0;
+ } else {
+ CONTEXT = line3;
+ CONTEXT |= GBREG->getPixel(w + GBAT[0], h + GBAT[1]) << 4;
+ CONTEXT |= line2 << 5;
+ CONTEXT |= GBREG->getPixel(w + GBAT[2], h + GBAT[3]) << 10;
+ CONTEXT |= GBREG->getPixel(w + GBAT[4], h + GBAT[5]) << 11;
+ CONTEXT |= line1 << 12;
+ CONTEXT |= GBREG->getPixel(w + GBAT[6], h + GBAT[7]) << 15;
+ bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
+ }
+ if(bVal) {
+ GBREG->setPixel(w, h, bVal);
+ }
+ line1 = ((line1 << 1) | GBREG->getPixel(w + 2, h - 2)) & 0x07;
+ line2 = ((line2 << 1) | GBREG->getPixel(w + 3, h - 1)) & 0x1f;
+ line3 = ((line3 << 1) | bVal) & 0x0f;
+ }
+ }
+ break;
+ case 1: {
+ line1 = GBREG->getPixel(2, h - 2);
+ line1 |= GBREG->getPixel(1, h - 2) << 1;
+ line1 |= GBREG->getPixel(0, h - 2) << 2;
+ line2 = GBREG->getPixel(2, h - 1);
+ line2 |= GBREG->getPixel(1, h - 1) << 1;
+ line2 |= GBREG->getPixel(0, h - 1) << 2;
+ line3 = 0;
+ for(FX_DWORD w = 0; w < GBW; w++) {
+ if(USESKIP && SKIP->getPixel(w, h)) {
+ bVal = 0;
+ } else {
+ CONTEXT = line3;
+ CONTEXT |= GBREG->getPixel(w + GBAT[0], h + GBAT[1]) << 3;
+ CONTEXT |= line2 << 4;
+ CONTEXT |= line1 << 9;
+ bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
+ }
+ if(bVal) {
+ GBREG->setPixel(w, h, bVal);
+ }
+ line1 = ((line1 << 1) | GBREG->getPixel(w + 3, h - 2)) & 0x0f;
+ line2 = ((line2 << 1) | GBREG->getPixel(w + 3, h - 1)) & 0x1f;
+ line3 = ((line3 << 1) | bVal) & 0x07;
+ }
+ }
+ break;
+ case 2: {
+ line1 = GBREG->getPixel(1, h - 2);
+ line1 |= GBREG->getPixel(0, h - 2) << 1;
+ line2 = GBREG->getPixel(1, h - 1);
+ line2 |= GBREG->getPixel(0, h - 1) << 1;
+ line3 = 0;
+ for(FX_DWORD w = 0; w < GBW; w++) {
+ if(USESKIP && SKIP->getPixel(w, h)) {
+ bVal = 0;
+ } else {
+ CONTEXT = line3;
+ CONTEXT |= GBREG->getPixel(w + GBAT[0], h + GBAT[1]) << 2;
+ CONTEXT |= line2 << 3;
+ CONTEXT |= line1 << 7;
+ bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
+ }
+ if(bVal) {
+ GBREG->setPixel(w, h, bVal);
+ }
+ line1 = ((line1 << 1) | GBREG->getPixel(w + 2, h - 2)) & 0x07;
+ line2 = ((line2 << 1) | GBREG->getPixel(w + 2, h - 1)) & 0x0f;
+ line3 = ((line3 << 1) | bVal) & 0x03;
+ }
+ }
+ break;
+ case 3: {
+ line1 = GBREG->getPixel(1, h - 1);
+ line1 |= GBREG->getPixel(0, h - 1) << 1;
+ line2 = 0;
+ for(FX_DWORD w = 0; w < GBW; w++) {
+ if(USESKIP && SKIP->getPixel(w, h)) {
+ bVal = 0;
+ } else {
+ CONTEXT = line2;
+ CONTEXT |= GBREG->getPixel(w + GBAT[0], h + GBAT[1]) << 4;
+ CONTEXT |= line1 << 5;
+ bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
+ }
+ if(bVal) {
+ GBREG->setPixel(w, h, bVal);
+ }
+ line1 = ((line1 << 1) | GBREG->getPixel(w + 2, h - 1)) & 0x1f;
+ line2 = ((line2 << 1) | bVal) & 0x0f;
+ }
+ }
+ break;
+ }
+ }
+ }
+ return GBREG;
+}
+CJBig2_Image *CJBig2_GRDProc::decode_Arith_V1(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext)
+{
+ FX_BOOL LTP, SLTP, bVal;
+ FX_DWORD CONTEXT = 0;
+ CJBig2_Image *GBREG;
+ LTP = 0;
+ JBIG2_ALLOC(GBREG, CJBig2_Image(GBW, GBH));
+ GBREG->fill(0);
+ for(FX_DWORD h = 0; h < GBH; h++) {
+ if(TPGDON) {
+ switch(GBTEMPLATE) {
+ case 0:
+ CONTEXT = 0x9b25;
+ break;
+ case 1:
+ CONTEXT = 0x0795;
+ break;
+ case 2:
+ CONTEXT = 0x00e5;
+ break;
+ case 3:
+ CONTEXT = 0x0195;
+ break;
+ }
+ SLTP = pArithDecoder->DECODE(&gbContext[CONTEXT]);
+ LTP = LTP ^ SLTP;
+ }
+ if(LTP == 1) {
+ for(FX_DWORD w = 0; w < GBW; w++) {
+ GBREG->setPixel(w, h, GBREG->getPixel(w, h - 1));
+ }
+ } else {
+ for(FX_DWORD w = 0; w < GBW; w++) {
+ if(USESKIP && SKIP->getPixel(w, h)) {
+ GBREG->setPixel(w, h, 0);
+ } else {
+ CONTEXT = 0;
+ switch(GBTEMPLATE) {
+ case 0:
+ CONTEXT |= GBREG->getPixel(w - 1, h);
+ CONTEXT |= GBREG->getPixel(w - 2, h) << 1;
+ CONTEXT |= GBREG->getPixel(w - 3, h) << 2;
+ CONTEXT |= GBREG->getPixel(w - 4, h) << 3;
+ CONTEXT |= GBREG->getPixel(w + GBAT[0], h + GBAT[1]) << 4;
+ CONTEXT |= GBREG->getPixel(w + 2, h - 1) << 5;
+ CONTEXT |= GBREG->getPixel(w + 1, h - 1) << 6;
+ CONTEXT |= GBREG->getPixel(w, h - 1) << 7;
+ CONTEXT |= GBREG->getPixel(w - 1, h - 1) << 8;
+ CONTEXT |= GBREG->getPixel(w - 2, h - 1) << 9;
+ CONTEXT |= GBREG->getPixel(w + GBAT[2], h + GBAT[3]) << 10;
+ CONTEXT |= GBREG->getPixel(w + GBAT[4], h + GBAT[5]) << 11;
+ CONTEXT |= GBREG->getPixel(w + 1, h - 2) << 12;
+ CONTEXT |= GBREG->getPixel(w, h - 2) << 13;
+ CONTEXT |= GBREG->getPixel(w - 1, h - 2) << 14;
+ CONTEXT |= GBREG->getPixel(w + GBAT[6], h + GBAT[7]) << 15;
+ break;
+ case 1:
+ CONTEXT |= GBREG->getPixel(w - 1, h);
+ CONTEXT |= GBREG->getPixel(w - 2, h) << 1;
+ CONTEXT |= GBREG->getPixel(w - 3, h) << 2;
+ CONTEXT |= GBREG->getPixel(w + GBAT[0], h + GBAT[1]) << 3;
+ CONTEXT |= GBREG->getPixel(w + 2, h - 1) << 4;
+ CONTEXT |= GBREG->getPixel(w + 1, h - 1) << 5;
+ CONTEXT |= GBREG->getPixel(w, h - 1) << 6;
+ CONTEXT |= GBREG->getPixel(w - 1, h - 1) << 7;
+ CONTEXT |= GBREG->getPixel(w - 2, h - 1) << 8;
+ CONTEXT |= GBREG->getPixel(w + 2, h - 2) << 9;
+ CONTEXT |= GBREG->getPixel(w + 1, h - 2) << 10;
+ CONTEXT |= GBREG->getPixel(w, h - 2) << 11;
+ CONTEXT |= GBREG->getPixel(w - 1, h - 2) << 12;
+ break;
+ case 2:
+ CONTEXT |= GBREG->getPixel(w - 1, h);
+ CONTEXT |= GBREG->getPixel(w - 2, h) << 1;
+ CONTEXT |= GBREG->getPixel(w + GBAT[0], h + GBAT[1]) << 2;
+ CONTEXT |= GBREG->getPixel(w + 1, h - 1) << 3;
+ CONTEXT |= GBREG->getPixel(w, h - 1) << 4;
+ CONTEXT |= GBREG->getPixel(w - 1, h - 1) << 5;
+ CONTEXT |= GBREG->getPixel(w - 2, h - 1) << 6;
+ CONTEXT |= GBREG->getPixel(w + 1, h - 2) << 7;
+ CONTEXT |= GBREG->getPixel(w, h - 2) << 8;
+ CONTEXT |= GBREG->getPixel(w - 1, h - 2) << 9;
+ break;
+ case 3:
+ CONTEXT |= GBREG->getPixel(w - 1, h);
+ CONTEXT |= GBREG->getPixel(w - 2, h) << 1;
+ CONTEXT |= GBREG->getPixel(w - 3, h) << 2;
+ CONTEXT |= GBREG->getPixel(w - 4, h) << 3;
+ CONTEXT |= GBREG->getPixel(w + GBAT[0], h + GBAT[1]) << 4;
+ CONTEXT |= GBREG->getPixel(w + 1, h - 1) << 5;
+ CONTEXT |= GBREG->getPixel(w, h - 1) << 6;
+ CONTEXT |= GBREG->getPixel(w - 1, h - 1) << 7;
+ CONTEXT |= GBREG->getPixel(w - 2, h - 1) << 8;
+ CONTEXT |= GBREG->getPixel(w - 3, h - 1) << 9;
+ break;
+ }
+ bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
+ GBREG->setPixel(w, h, bVal);
+ }
+ }
+ }
+ }
+ return GBREG;
+}
+CJBig2_Image *CJBig2_GRDProc::decode_MMR(CJBig2_BitStream *pStream)
+{
+ int bitpos, i;
+ CJBig2_Image *pImage;
+ JBIG2_ALLOC(pImage, CJBig2_Image(GBW, GBH));
+ if (pImage->m_pData == NULL) {
+ delete pImage;
+ m_pModule->JBig2_Error("Generic region decoding procedure: Create Image Failed with width = %d, height = %d\n", GBW, GBH);
+ return NULL;
+ }
+ bitpos = (int)pStream->getBitPos();
+ _FaxG4Decode(m_pModule, pStream->getBuf(), pStream->getLength(), &bitpos, pImage->m_pData, GBW, GBH, pImage->m_nStride);
+ pStream->setBitPos(bitpos);
+ for(i = 0; (FX_DWORD)i < pImage->m_nStride * GBH; i++) {
+ pImage->m_pData[i] = ~pImage->m_pData[i];
+ }
+ return pImage;
+}
+CJBig2_Image *CJBig2_GRRDProc::decode(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *grContext)
+{
+ if (GRW == 0 || GRH == 0) {
+ CJBig2_Image* pImage;
+ JBIG2_ALLOC(pImage, CJBig2_Image(GRW, GRH));
+ return pImage;
+ }
+ if(GRTEMPLATE == 0) {
+ if((GRAT[0] == (signed char) - 1) && (GRAT[1] == (signed char) - 1)
+ && (GRAT[2] == (signed char) - 1) && (GRAT[3] == (signed char) - 1)
+ && (GRREFERENCEDX == 0) && (GRW == (FX_DWORD)GRREFERENCE->m_nWidth)) {
+ return decode_Template0_opt(pArithDecoder, grContext);
+ } else {
+ return decode_Template0_unopt(pArithDecoder, grContext);
+ }
+ } else {
+ if((GRREFERENCEDX == 0) && (GRW == (FX_DWORD)GRREFERENCE->m_nWidth)) {
+ return decode_Template1_opt(pArithDecoder, grContext);
+ } else {
+ return decode_Template1_unopt(pArithDecoder, grContext);
+ }
+ }
+}
+CJBig2_Image *CJBig2_GRRDProc::decode_Template0_unopt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *grContext)
+{
+ FX_BOOL LTP, SLTP, bVal;
+ FX_DWORD CONTEXT;
+ CJBig2_Image *GRREG;
+ FX_DWORD line1, line2, line3, line4, line5;
+ LTP = 0;
+ JBIG2_ALLOC(GRREG, CJBig2_Image(GRW, GRH));
+ GRREG->fill(0);
+ for(FX_DWORD h = 0; h < GRH; h++) {
+ if(TPGRON) {
+ SLTP = pArithDecoder->DECODE(&grContext[0x0010]);
+ LTP = LTP ^ SLTP;
+ }
+ if(LTP == 0) {
+ line1 = GRREG->getPixel(1, h - 1);
+ line1 |= GRREG->getPixel(0, h - 1) << 1;
+ line2 = 0;
+ line3 = GRREFERENCE->getPixel(-GRREFERENCEDX + 1, h - GRREFERENCEDY - 1);
+ line3 |= GRREFERENCE->getPixel(-GRREFERENCEDX, h - GRREFERENCEDY - 1) << 1;
+ line4 = GRREFERENCE->getPixel(-GRREFERENCEDX + 1, h - GRREFERENCEDY);
+ line4 |= GRREFERENCE->getPixel(-GRREFERENCEDX, h - GRREFERENCEDY) << 1;
+ line4 |= GRREFERENCE->getPixel(-GRREFERENCEDX - 1, h - GRREFERENCEDY) << 2;
+ line5 = GRREFERENCE->getPixel(-GRREFERENCEDX + 1, h - GRREFERENCEDY + 1);
+ line5 |= GRREFERENCE->getPixel(-GRREFERENCEDX, h - GRREFERENCEDY + 1) << 1;
+ line5 |= GRREFERENCE->getPixel(-GRREFERENCEDX - 1, h - GRREFERENCEDY + 1) << 2;
+ for(FX_DWORD w = 0; w < GRW; w++) {
+ CONTEXT = line5;
+ CONTEXT |= line4 << 3;
+ CONTEXT |= line3 << 6;
+ CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX + GRAT[2], h - GRREFERENCEDY + GRAT[3]) << 8;
+ CONTEXT |= line2 << 9;
+ CONTEXT |= line1 << 10;
+ CONTEXT |= GRREG->getPixel(w + GRAT[0], h + GRAT[1]) << 12;
+ bVal = pArithDecoder->DECODE(&grContext[CONTEXT]);
+ GRREG->setPixel(w, h, bVal);
+ line1 = ((line1 << 1) | GRREG->getPixel(w + 2, h - 1)) & 0x03;
+ line2 = ((line2 << 1) | bVal) & 0x01;
+ line3 = ((line3 << 1) | GRREFERENCE->getPixel(w - GRREFERENCEDX + 2, h - GRREFERENCEDY - 1)) & 0x03;
+ line4 = ((line4 << 1) | GRREFERENCE->getPixel(w - GRREFERENCEDX + 2, h - GRREFERENCEDY)) & 0x07;
+ line5 = ((line5 << 1) | GRREFERENCE->getPixel(w - GRREFERENCEDX + 2, h - GRREFERENCEDY + 1)) & 0x07;
+ }
+ } else {
+ line1 = GRREG->getPixel(1, h - 1);
+ line1 |= GRREG->getPixel(0, h - 1) << 1;
+ line2 = 0;
+ line3 = GRREFERENCE->getPixel(-GRREFERENCEDX + 1, h - GRREFERENCEDY - 1);
+ line3 |= GRREFERENCE->getPixel(-GRREFERENCEDX, h - GRREFERENCEDY - 1) << 1;
+ line4 = GRREFERENCE->getPixel(-GRREFERENCEDX + 1, h - GRREFERENCEDY);
+ line4 |= GRREFERENCE->getPixel(-GRREFERENCEDX, h - GRREFERENCEDY) << 1;
+ line4 |= GRREFERENCE->getPixel(-GRREFERENCEDX - 1, h - GRREFERENCEDY) << 2;
+ line5 = GRREFERENCE->getPixel(-GRREFERENCEDX + 1, h - GRREFERENCEDY + 1);
+ line5 |= GRREFERENCE->getPixel(-GRREFERENCEDX, h - GRREFERENCEDY + 1) << 1;
+ line5 |= GRREFERENCE->getPixel(-GRREFERENCEDX - 1, h - GRREFERENCEDY + 1) << 2;
+ for(FX_DWORD w = 0; w < GRW; w++) {
+ bVal = GRREFERENCE->getPixel(w, h);
+ if(!(TPGRON && (bVal == GRREFERENCE->getPixel(w - 1, h - 1))
+ && (bVal == GRREFERENCE->getPixel(w, h - 1))
+ && (bVal == GRREFERENCE->getPixel(w + 1, h - 1))
+ && (bVal == GRREFERENCE->getPixel(w - 1, h))
+ && (bVal == GRREFERENCE->getPixel(w + 1, h))
+ && (bVal == GRREFERENCE->getPixel(w - 1, h + 1))
+ && (bVal == GRREFERENCE->getPixel(w, h + 1))
+ && (bVal == GRREFERENCE->getPixel(w + 1, h + 1)))) {
+ CONTEXT = line5;
+ CONTEXT |= line4 << 3;
+ CONTEXT |= line3 << 6;
+ CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX + GRAT[2], h - GRREFERENCEDY + GRAT[3]) << 8;
+ CONTEXT |= line2 << 9;
+ CONTEXT |= line1 << 10;
+ CONTEXT |= GRREG->getPixel(w + GRAT[0], h + GRAT[1]) << 12;
+ bVal = pArithDecoder->DECODE(&grContext[CONTEXT]);
+ }
+ GRREG->setPixel(w, h, bVal);
+ line1 = ((line1 << 1) | GRREG->getPixel(w + 2, h - 1)) & 0x03;
+ line2 = ((line2 << 1) | bVal) & 0x01;
+ line3 = ((line3 << 1) | GRREFERENCE->getPixel(w - GRREFERENCEDX + 2, h - GRREFERENCEDY - 1)) & 0x03;
+ line4 = ((line4 << 1) | GRREFERENCE->getPixel(w - GRREFERENCEDX + 2, h - GRREFERENCEDY)) & 0x07;
+ line5 = ((line5 << 1) | GRREFERENCE->getPixel(w - GRREFERENCEDX + 2, h - GRREFERENCEDY + 1)) & 0x07;
+ }
+ }
+ }
+ return GRREG;
+}
+CJBig2_Image *CJBig2_GRRDProc::decode_Template0_opt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *grContext)
+{
+ FX_BOOL LTP, SLTP, bVal;
+ FX_DWORD CONTEXT;
+ CJBig2_Image *GRREG;
+ FX_DWORD line1, line1_r, line2_r, line3_r;
+ FX_BYTE *pLine, *pLineR, cVal;
+ FX_INTPTR nStride, nStrideR, nOffset;
+ FX_INT32 k, nBits;
+ FX_INT32 GRWR, GRHR;
+ FX_INT32 GRW, GRH;
+ GRW = (FX_INT32)CJBig2_GRRDProc::GRW;
+ GRH = (FX_INT32)CJBig2_GRRDProc::GRH;
+ LTP = 0;
+ JBIG2_ALLOC(GRREG, CJBig2_Image(GRW, GRH));
+ if (GRREG->m_pData == NULL) {
+ delete GRREG;
+ m_pModule->JBig2_Error("Generic refinement region decoding procedure: Create Image Failed with width = %d, height = %d\n", GRW, GRH);
+ return NULL;
+ }
+ pLine = GRREG->m_pData;
+ pLineR = GRREFERENCE->m_pData;
+ nStride = GRREG->m_nStride;
+ nStrideR = GRREFERENCE->m_nStride;
+ GRWR = (FX_INT32)GRREFERENCE->m_nWidth;
+ GRHR = (FX_INT32)GRREFERENCE->m_nHeight;
+ if (GRREFERENCEDY < -GRHR + 1 || GRREFERENCEDY > GRHR - 1) {
+ GRREFERENCEDY = 0;
+ }
+ nOffset = -GRREFERENCEDY * nStrideR;
+ for (FX_INT32 h = 0; h < GRH; h++) {
+ if(TPGRON) {
+ SLTP = pArithDecoder->DECODE(&grContext[0x0010]);
+ LTP = LTP ^ SLTP;
+ }
+ line1 = (h > 0) ? pLine[-nStride] << 4 : 0;
+ FX_INT32 reference_h = h - GRREFERENCEDY;
+ FX_BOOL line1_r_ok = (reference_h > 0 && reference_h < GRHR + 1);
+ FX_BOOL line2_r_ok = (reference_h > -1 && reference_h < GRHR);
+ FX_BOOL line3_r_ok = (reference_h > -2 && reference_h < GRHR - 1);
+ line1_r = line1_r_ok ? pLineR[nOffset - nStrideR] : 0;
+ line2_r = line2_r_ok ? pLineR[nOffset] : 0;
+ line3_r = line3_r_ok ? pLineR[nOffset + nStrideR] : 0;
+ if(LTP == 0) {
+ CONTEXT = (line1 & 0x1c00) | (line1_r & 0x01c0)
+ | ((line2_r >> 3) & 0x0038) | ((line3_r >> 6) & 0x0007);
+ for (FX_INT32 w = 0; w < GRW; w += 8) {
+ nBits = GRW - w > 8 ? 8 : GRW - w;
+ if (h > 0)
+ line1 = (line1 << 8) |
+ (w + 8 < GRW ? pLine[-nStride + (w >> 3) + 1] << 4 : 0);
+ if (h > GRHR + GRREFERENCEDY + 1) {
+ line1_r = 0;
+ line2_r = 0;
+ line3_r = 0;
+ } else {
+ if(line1_r_ok)
+ line1_r = (line1_r << 8) |
+ (w + 8 < GRWR ? pLineR[nOffset - nStrideR + (w >> 3) + 1] : 0);
+ if(line2_r_ok)
+ line2_r = (line2_r << 8) |
+ (w + 8 < GRWR ? pLineR[nOffset + (w >> 3) + 1] : 0);
+ if(line3_r_ok)
+ line3_r = (line3_r << 8) |
+ (w + 8 < GRWR ? pLineR[nOffset + nStrideR + (w >> 3) + 1] : 0);
+ else {
+ line3_r = 0;
+ }
+ }
+ cVal = 0;
+ for (k = 0; k < nBits; k++) {
+ bVal = pArithDecoder->DECODE(&grContext[CONTEXT]);
+ cVal |= bVal << (7 - k);
+ CONTEXT = ((CONTEXT & 0x0cdb) << 1) | (bVal << 9) |
+ ((line1 >> (7 - k)) & 0x0400) |
+ ((line1_r >> (7 - k)) & 0x0040) |
+ ((line2_r >> (10 - k)) & 0x0008) |
+ ((line3_r >> (13 - k)) & 0x0001);
+ }
+ pLine[w >> 3] = cVal;
+ }
+ } else {
+ CONTEXT = (line1 & 0x1c00) | (line1_r & 0x01c0)
+ | ((line2_r >> 3) & 0x0038) | ((line3_r >> 6) & 0x0007);
+ for (FX_INT32 w = 0; w < GRW; w += 8) {
+ nBits = GRW - w > 8 ? 8 : GRW - w;
+ if (h > 0)
+ line1 = (line1 << 8) |
+ (w + 8 < GRW ? pLine[-nStride + (w >> 3) + 1] << 4 : 0);
+ if(line1_r_ok)
+ line1_r = (line1_r << 8) |
+ (w + 8 < GRWR ? pLineR[nOffset - nStrideR + (w >> 3) + 1] : 0);
+ if(line2_r_ok)
+ line2_r = (line2_r << 8) |
+ (w + 8 < GRWR ? pLineR[nOffset + (w >> 3) + 1] : 0);
+ if(line3_r_ok)
+ line3_r = (line3_r << 8) |
+ (w + 8 < GRWR ? pLineR[nOffset + nStrideR + (w >> 3) + 1] : 0);
+ else {
+ line3_r = 0;
+ }
+ cVal = 0;
+ for (k = 0; k < nBits; k++) {
+ bVal = GRREFERENCE->getPixel(w + k, h);
+ if(!(TPGRON && (bVal == GRREFERENCE->getPixel(w + k - 1, h - 1))
+ && (bVal == GRREFERENCE->getPixel(w + k, h - 1))
+ && (bVal == GRREFERENCE->getPixel(w + k + 1, h - 1))
+ && (bVal == GRREFERENCE->getPixel(w + k - 1, h))
+ && (bVal == GRREFERENCE->getPixel(w + k + 1, h))
+ && (bVal == GRREFERENCE->getPixel(w + k - 1, h + 1))
+ && (bVal == GRREFERENCE->getPixel(w + k, h + 1))
+ && (bVal == GRREFERENCE->getPixel(w + k + 1, h + 1)))) {
+ bVal = pArithDecoder->DECODE(&grContext[CONTEXT]);
+ }
+ cVal |= bVal << (7 - k);
+ CONTEXT = ((CONTEXT & 0x0cdb) << 1) | (bVal << 9) |
+ ((line1 >> (7 - k)) & 0x0400) |
+ ((line1_r >> (7 - k)) & 0x0040) |
+ ((line2_r >> (10 - k)) & 0x0008) |
+ ((line3_r >> (13 - k)) & 0x0001);
+ }
+ pLine[w >> 3] = cVal;
+ }
+ }
+ pLine += nStride;
+ if (h < GRHR + GRREFERENCEDY) {
+ pLineR += nStrideR;
+ }
+ }
+ return GRREG;
+}
+CJBig2_Image *CJBig2_GRRDProc::decode_Template1_unopt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *grContext)
+{
+ FX_BOOL LTP, SLTP, bVal;
+ FX_DWORD CONTEXT;
+ CJBig2_Image *GRREG;
+ FX_DWORD line1, line2, line3, line4, line5;
+ LTP = 0;
+ JBIG2_ALLOC(GRREG, CJBig2_Image(GRW, GRH));
+ GRREG->fill(0);
+ for(FX_DWORD h = 0; h < GRH; h++) {
+ if(TPGRON) {
+ SLTP = pArithDecoder->DECODE(&grContext[0x0008]);
+ LTP = LTP ^ SLTP;
+ }
+ if(LTP == 0) {
+ line1 = GRREG->getPixel(1, h - 1);
+ line1 |= GRREG->getPixel(0, h - 1) << 1;
+ line1 |= GRREG->getPixel(-1, h - 1) << 2;
+ line2 = 0;
+ line3 = GRREFERENCE->getPixel(-GRREFERENCEDX, h - GRREFERENCEDY - 1);
+ line4 = GRREFERENCE->getPixel(-GRREFERENCEDX + 1, h - GRREFERENCEDY);
+ line4 |= GRREFERENCE->getPixel(-GRREFERENCEDX, h - GRREFERENCEDY) << 1;
+ line4 |= GRREFERENCE->getPixel(-GRREFERENCEDX - 1, h - GRREFERENCEDY) << 2;
+ line5 = GRREFERENCE->getPixel(-GRREFERENCEDX + 1, h - GRREFERENCEDY + 1);
+ line5 |= GRREFERENCE->getPixel(-GRREFERENCEDX, h - GRREFERENCEDY + 1) << 1;
+ for(FX_DWORD w = 0; w < GRW; w++) {
+ CONTEXT = line5;
+ CONTEXT |= line4 << 2;
+ CONTEXT |= line3 << 5;
+ CONTEXT |= line2 << 6;
+ CONTEXT |= line1 << 7;
+ bVal = pArithDecoder->DECODE(&grContext[CONTEXT]);
+ GRREG->setPixel(w, h, bVal);
+ line1 = ((line1 << 1) | GRREG->getPixel(w + 2, h - 1)) & 0x07;
+ line2 = ((line2 << 1) | bVal) & 0x01;
+ line3 = ((line3 << 1) | GRREFERENCE->getPixel(w - GRREFERENCEDX + 1, h - GRREFERENCEDY - 1)) & 0x01;
+ line4 = ((line4 << 1) | GRREFERENCE->getPixel(w - GRREFERENCEDX + 2, h - GRREFERENCEDY)) & 0x07;
+ line5 = ((line5 << 1) | GRREFERENCE->getPixel(w - GRREFERENCEDX + 2, h - GRREFERENCEDY + 1)) & 0x03;
+ }
+ } else {
+ line1 = GRREG->getPixel(1, h - 1);
+ line1 |= GRREG->getPixel(0, h - 1) << 1;
+ line1 |= GRREG->getPixel(-1, h - 1) << 2;
+ line2 = 0;
+ line3 = GRREFERENCE->getPixel(-GRREFERENCEDX, h - GRREFERENCEDY - 1);
+ line4 = GRREFERENCE->getPixel(-GRREFERENCEDX + 1, h - GRREFERENCEDY);
+ line4 |= GRREFERENCE->getPixel(-GRREFERENCEDX, h - GRREFERENCEDY) << 1;
+ line4 |= GRREFERENCE->getPixel(-GRREFERENCEDX - 1, h - GRREFERENCEDY) << 2;
+ line5 = GRREFERENCE->getPixel(-GRREFERENCEDX + 1, h - GRREFERENCEDY + 1);
+ line5 |= GRREFERENCE->getPixel(-GRREFERENCEDX, h - GRREFERENCEDY + 1) << 1;
+ for(FX_DWORD w = 0; w < GRW; w++) {
+ bVal = GRREFERENCE->getPixel(w, h);
+ if(!(TPGRON && (bVal == GRREFERENCE->getPixel(w - 1, h - 1))
+ && (bVal == GRREFERENCE->getPixel(w, h - 1))
+ && (bVal == GRREFERENCE->getPixel(w + 1, h - 1))
+ && (bVal == GRREFERENCE->getPixel(w - 1, h))
+ && (bVal == GRREFERENCE->getPixel(w + 1, h))
+ && (bVal == GRREFERENCE->getPixel(w - 1, h + 1))
+ && (bVal == GRREFERENCE->getPixel(w, h + 1))
+ && (bVal == GRREFERENCE->getPixel(w + 1, h + 1)))) {
+ CONTEXT = line5;
+ CONTEXT |= line4 << 2;
+ CONTEXT |= line3 << 5;
+ CONTEXT |= line2 << 6;
+ CONTEXT |= line1 << 7;
+ bVal = pArithDecoder->DECODE(&grContext[CONTEXT]);
+ }
+ GRREG->setPixel(w, h, bVal);
+ line1 = ((line1 << 1) | GRREG->getPixel(w + 2, h - 1)) & 0x07;
+ line2 = ((line2 << 1) | bVal) & 0x01;
+ line3 = ((line3 << 1) | GRREFERENCE->getPixel(w - GRREFERENCEDX + 1, h - GRREFERENCEDY - 1)) & 0x01;
+ line4 = ((line4 << 1) | GRREFERENCE->getPixel(w - GRREFERENCEDX + 2, h - GRREFERENCEDY)) & 0x07;
+ line5 = ((line5 << 1) | GRREFERENCE->getPixel(w - GRREFERENCEDX + 2, h - GRREFERENCEDY + 1)) & 0x03;
+ }
+ }
+ }
+ return GRREG;
+}
+CJBig2_Image *CJBig2_GRRDProc::decode_Template1_opt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *grContext)
+{
+ FX_BOOL LTP, SLTP, bVal;
+ FX_DWORD CONTEXT;
+ CJBig2_Image *GRREG;
+ FX_DWORD line1, line1_r, line2_r, line3_r;
+ FX_BYTE *pLine, *pLineR, cVal;
+ FX_INTPTR nStride, nStrideR, nOffset;
+ FX_INT32 k, nBits;
+ FX_INT32 GRWR, GRHR;
+ FX_INT32 GRW, GRH;
+ GRW = (FX_INT32)CJBig2_GRRDProc::GRW;
+ GRH = (FX_INT32)CJBig2_GRRDProc::GRH;
+ LTP = 0;
+ JBIG2_ALLOC(GRREG, CJBig2_Image(GRW, GRH));
+ if (GRREG->m_pData == NULL) {
+ delete GRREG;
+ m_pModule->JBig2_Error("Generic refinement region decoding procedure: Create Image Failed with width = %d, height = %d\n", GRW, GRH);
+ return NULL;
+ }
+ pLine = GRREG->m_pData;
+ pLineR = GRREFERENCE->m_pData;
+ nStride = GRREG->m_nStride;
+ nStrideR = GRREFERENCE->m_nStride;
+ GRWR = (FX_INT32)GRREFERENCE->m_nWidth;
+ GRHR = (FX_INT32)GRREFERENCE->m_nHeight;
+ if (GRREFERENCEDY < -GRHR + 1 || GRREFERENCEDY > GRHR - 1) {
+ GRREFERENCEDY = 0;
+ }
+ nOffset = -GRREFERENCEDY * nStrideR;
+ for (FX_INT32 h = 0; h < GRH; h++) {
+ if(TPGRON) {
+ SLTP = pArithDecoder->DECODE(&grContext[0x0008]);
+ LTP = LTP ^ SLTP;
+ }
+ line1 = (h > 0) ? pLine[-nStride] << 1 : 0;
+ FX_INT32 reference_h = h - GRREFERENCEDY;
+ FX_BOOL line1_r_ok = (reference_h > 0 && reference_h < GRHR + 1);
+ FX_BOOL line2_r_ok = (reference_h > -1 && reference_h < GRHR);
+ FX_BOOL line3_r_ok = (reference_h > -2 && reference_h < GRHR - 1);
+ line1_r = line1_r_ok ? pLineR[nOffset - nStrideR] : 0;
+ line2_r = line2_r_ok ? pLineR[nOffset] : 0;
+ line3_r = line3_r_ok ? pLineR[nOffset + nStrideR] : 0;
+ if(LTP == 0) {
+ CONTEXT = (line1 & 0x0380) | ((line1_r >> 2) & 0x0020)
+ | ((line2_r >> 4) & 0x001c) | ((line3_r >> 6) & 0x0003);
+ for (FX_INT32 w = 0; w < GRW; w += 8) {
+ nBits = GRW - w > 8 ? 8 : GRW - w;
+ if (h > 0)
+ line1 = (line1 << 8) |
+ (w + 8 < GRW ? pLine[-nStride + (w >> 3) + 1] << 1 : 0);
+ if(line1_r_ok)
+ line1_r = (line1_r << 8) |
+ (w + 8 < GRWR ? pLineR[nOffset - nStrideR + (w >> 3) + 1] : 0);
+ if(line2_r_ok)
+ line2_r = (line2_r << 8) |
+ (w + 8 < GRWR ? pLineR[nOffset + (w >> 3) + 1] : 0);
+ if(line3_r_ok)
+ line3_r = (line3_r << 8) |
+ (w + 8 < GRWR ? pLineR[nOffset + nStrideR + (w >> 3) + 1] : 0);
+ else {
+ line3_r = 0;
+ }
+ cVal = 0;
+ for (k = 0; k < nBits; k++) {
+ bVal = pArithDecoder->DECODE(&grContext[CONTEXT]);
+ cVal |= bVal << (7 - k);
+ CONTEXT = ((CONTEXT & 0x018d) << 1) | (bVal << 6) |
+ ((line1 >> (7 - k)) & 0x0080) |
+ ((line1_r >> (9 - k)) & 0x0020) |
+ ((line2_r >> (11 - k)) & 0x0004) |
+ ((line3_r >> (13 - k)) & 0x0001);
+ }
+ pLine[w >> 3] = cVal;
+ }
+ } else {
+ CONTEXT = (line1 & 0x0380) | ((line1_r >> 2) & 0x0020)
+ | ((line2_r >> 4) & 0x001c) | ((line3_r >> 6) & 0x0003);
+ for (FX_INT32 w = 0; w < GRW; w += 8) {
+ nBits = GRW - w > 8 ? 8 : GRW - w;
+ if (h > 0)
+ line1 = (line1 << 8) |
+ (w + 8 < GRW ? pLine[-nStride + (w >> 3) + 1] << 1 : 0);
+ if(line1_r_ok)
+ line1_r = (line1_r << 8) |
+ (w + 8 < GRWR ? pLineR[nOffset - nStrideR + (w >> 3) + 1] : 0);
+ if(line2_r_ok)
+ line2_r = (line2_r << 8) |
+ (w + 8 < GRWR ? pLineR[nOffset + (w >> 3) + 1] : 0);
+ if(line3_r_ok)
+ line3_r = (line3_r << 8) |
+ (w + 8 < GRWR ? pLineR[nOffset + nStrideR + (w >> 3) + 1] : 0);
+ else {
+ line3_r = 0;
+ }
+ cVal = 0;
+ for (k = 0; k < nBits; k++) {
+ bVal = GRREFERENCE->getPixel(w + k, h);
+ if(!(TPGRON && (bVal == GRREFERENCE->getPixel(w + k - 1, h - 1))
+ && (bVal == GRREFERENCE->getPixel(w + k, h - 1))
+ && (bVal == GRREFERENCE->getPixel(w + k + 1, h - 1))
+ && (bVal == GRREFERENCE->getPixel(w + k - 1, h))
+ && (bVal == GRREFERENCE->getPixel(w + k + 1, h))
+ && (bVal == GRREFERENCE->getPixel(w + k - 1, h + 1))
+ && (bVal == GRREFERENCE->getPixel(w + k, h + 1))
+ && (bVal == GRREFERENCE->getPixel(w + k + 1, h + 1)))) {
+ bVal = pArithDecoder->DECODE(&grContext[CONTEXT]);
+ }
+ cVal |= bVal << (7 - k);
+ CONTEXT = ((CONTEXT & 0x018d) << 1) | (bVal << 6) |
+ ((line1 >> (7 - k)) & 0x0080) |
+ ((line1_r >> (9 - k)) & 0x0020) |
+ ((line2_r >> (11 - k)) & 0x0004) |
+ ((line3_r >> (13 - k)) & 0x0001);
+ }
+ pLine[w >> 3] = cVal;
+ }
+ }
+ pLine += nStride;
+ if (h < GRHR + GRREFERENCEDY) {
+ pLineR += nStrideR;
+ }
+ }
+ return GRREG;
+}
+CJBig2_Image *CJBig2_GRRDProc::decode_V1(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *grContext)
+{
+ FX_BOOL LTP, SLTP, bVal;
+ FX_BOOL TPGRPIX, TPGRVAL;
+ FX_DWORD CONTEXT;
+ CJBig2_Image *GRREG;
+ LTP = 0;
+ JBIG2_ALLOC(GRREG, CJBig2_Image(GRW, GRH));
+ GRREG->fill(0);
+ for(FX_DWORD h = 0; h < GRH; h++) {
+ if(TPGRON) {
+ switch(GRTEMPLATE) {
+ case 0:
+ CONTEXT = 0x0010;
+ break;
+ case 1:
+ CONTEXT = 0x0008;
+ break;
+ }
+ SLTP = pArithDecoder->DECODE(&grContext[CONTEXT]);
+ LTP = LTP ^ SLTP;
+ }
+ if(LTP == 0) {
+ for(FX_DWORD w = 0; w < GRW; w++) {
+ CONTEXT = 0;
+ switch(GRTEMPLATE) {
+ case 0:
+ CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX + 1, h - GRREFERENCEDY + 1);
+ CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX, h - GRREFERENCEDY + 1) << 1;
+ CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX - 1, h - GRREFERENCEDY + 1) << 2;
+ CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX + 1, h - GRREFERENCEDY) << 3;
+ CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX, h - GRREFERENCEDY) << 4;
+ CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX - 1, h - GRREFERENCEDY) << 5;
+ CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX + 1, h - GRREFERENCEDY - 1) << 6;
+ CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX, h - GRREFERENCEDY - 1) << 7;
+ CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX + GRAT[2], h - GRREFERENCEDY + GRAT[3]) << 8;
+ CONTEXT |= GRREG->getPixel(w - 1, h) << 9;
+ CONTEXT |= GRREG->getPixel(w + 1, h - 1) << 10;
+ CONTEXT |= GRREG->getPixel(w, h - 1) << 11;
+ CONTEXT |= GRREG->getPixel(w + GRAT[0], h + GRAT[1]) << 12;
+ break;
+ case 1:
+ CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX + 1, h - GRREFERENCEDY + 1);
+ CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX, h - GRREFERENCEDY + 1) << 1;
+ CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX + 1, h - GRREFERENCEDY) << 2;
+ CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX, h - GRREFERENCEDY) << 3;
+ CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX - 1, h - GRREFERENCEDY) << 4;
+ CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX, h - GRREFERENCEDY - 1) << 5;
+ CONTEXT |= GRREG->getPixel(w - 1, h) << 6;
+ CONTEXT |= GRREG->getPixel(w + 1, h - 1) << 7;
+ CONTEXT |= GRREG->getPixel(w, h - 1) << 8;
+ CONTEXT |= GRREG->getPixel(w - 1, h - 1) << 9;
+ break;
+ }
+ bVal = pArithDecoder->DECODE(&grContext[CONTEXT]);
+ GRREG->setPixel(w, h, bVal);
+ }
+ } else {
+ for(FX_DWORD w = 0; w < GRW; w++) {
+ bVal = GRREFERENCE->getPixel(w, h);
+ if(TPGRON && (bVal == GRREFERENCE->getPixel(w - 1, h - 1))
+ && (bVal == GRREFERENCE->getPixel(w, h - 1))
+ && (bVal == GRREFERENCE->getPixel(w + 1, h - 1))
+ && (bVal == GRREFERENCE->getPixel(w - 1, h))
+ && (bVal == GRREFERENCE->getPixel(w + 1, h))
+ && (bVal == GRREFERENCE->getPixel(w - 1, h + 1))
+ && (bVal == GRREFERENCE->getPixel(w, h + 1))
+ && (bVal == GRREFERENCE->getPixel(w + 1, h + 1))) {
+ TPGRPIX = 1;
+ TPGRVAL = bVal;
+ } else {
+ TPGRPIX = 0;
+ }
+ if(TPGRPIX) {
+ GRREG->setPixel(w, h, TPGRVAL);
+ } else {
+ CONTEXT = 0;
+ switch(GRTEMPLATE) {
+ case 0:
+ CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX + 1, h - GRREFERENCEDY + 1);
+ CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX, h - GRREFERENCEDY + 1) << 1;
+ CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX - 1, h - GRREFERENCEDY + 1) << 2;
+ CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX + 1, h - GRREFERENCEDY) << 3;
+ CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX, h - GRREFERENCEDY) << 4;
+ CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX - 1, h - GRREFERENCEDY) << 5;
+ CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX + 1, h - GRREFERENCEDY - 1) << 6;
+ CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX, h - GRREFERENCEDY - 1) << 7;
+ CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX + GRAT[2], h - GRREFERENCEDY + GRAT[3]) << 8;
+ CONTEXT |= GRREG->getPixel(w - 1, h) << 9;
+ CONTEXT |= GRREG->getPixel(w + 1, h - 1) << 10;
+ CONTEXT |= GRREG->getPixel(w, h - 1) << 11;
+ CONTEXT |= GRREG->getPixel(w + GRAT[0], h + GRAT[1]) << 12;
+ break;
+ case 1:
+ CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX + 1, h - GRREFERENCEDY + 1);
+ CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX, h - GRREFERENCEDY + 1) << 1;
+ CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX + 1, h - GRREFERENCEDY) << 2;
+ CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX, h - GRREFERENCEDY) << 3;
+ CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX - 1, h - GRREFERENCEDY) << 4;
+ CONTEXT |= GRREFERENCE->getPixel(w - GRREFERENCEDX, h - GRREFERENCEDY - 1) << 5;
+ CONTEXT |= GRREG->getPixel(w - 1, h) << 6;
+ CONTEXT |= GRREG->getPixel(w + 1, h - 1) << 7;
+ CONTEXT |= GRREG->getPixel(w, h - 1) << 8;
+ CONTEXT |= GRREG->getPixel(w - 1, h - 1) << 9;
+ break;
+ }
+ bVal = pArithDecoder->DECODE(&grContext[CONTEXT]);
+ GRREG->setPixel(w, h, bVal);
+ }
+ }
+ }
+ }
+ return GRREG;
+}
+CJBig2_Image *CJBig2_TRDProc::decode_Huffman(CJBig2_BitStream *pStream, JBig2ArithCtx *grContext)
+{
+ FX_INT32 STRIPT, FIRSTS;
+ FX_DWORD NINSTANCES;
+ FX_INT32 DT, DFS, CURS;
+ FX_BYTE CURT;
+ FX_INT32 SI, TI;
+ FX_DWORD IDI;
+ CJBig2_Image *IBI;
+ FX_DWORD WI, HI;
+ FX_INT32 IDS;
+ FX_BOOL RI;
+ FX_INT32 RDWI, RDHI, RDXI, RDYI;
+ CJBig2_Image *IBOI;
+ FX_DWORD WOI, HOI;
+ CJBig2_Image *SBREG;
+ FX_BOOL bFirst;
+ FX_DWORD nTmp;
+ FX_INT32 nVal, nBits;
+ CJBig2_HuffmanDecoder *pHuffmanDecoder;
+ CJBig2_GRRDProc *pGRRD;
+ CJBig2_ArithDecoder *pArithDecoder;
+ JBIG2_ALLOC(pHuffmanDecoder, CJBig2_HuffmanDecoder(pStream));
+ JBIG2_ALLOC(SBREG, CJBig2_Image(SBW, SBH));
+ SBREG->fill(SBDEFPIXEL);
+ if(pHuffmanDecoder->decodeAValue(SBHUFFDT, &STRIPT) != 0) {
+ m_pModule->JBig2_Error("text region decoding procedure (huffman): too short.");
+ goto failed;
+ }
+ STRIPT *= SBSTRIPS;
+ STRIPT = -STRIPT;
+ FIRSTS = 0;
+ NINSTANCES = 0;
+ while(NINSTANCES < SBNUMINSTANCES) {
+ if(pHuffmanDecoder->decodeAValue(SBHUFFDT, &DT) != 0) {
+ m_pModule->JBig2_Error("text region decoding procedure (huffman): too short.");
+ goto failed;
+ }
+ DT *= SBSTRIPS;
+ STRIPT = STRIPT + DT;
+ bFirst = TRUE;
+ for(;;) {
+ if(bFirst) {
+ if(pHuffmanDecoder->decodeAValue(SBHUFFFS, &DFS) != 0) {
+ m_pModule->JBig2_Error("text region decoding procedure (huffman): too short.");
+ goto failed;
+ }
+ FIRSTS = FIRSTS + DFS;
+ CURS = FIRSTS;
+ bFirst = FALSE;
+ } else {
+ nVal = pHuffmanDecoder->decodeAValue(SBHUFFDS, &IDS);
+ if(nVal == JBIG2_OOB) {
+ break;
+ } else if(nVal != 0) {
+ m_pModule->JBig2_Error("text region decoding procedure (huffman): too short.");
+ goto failed;
+ } else {
+ CURS = CURS + IDS + SBDSOFFSET;
+ }
+ }
+ if(SBSTRIPS == 1) {
+ CURT = 0;
+ } else {
+ nTmp = 1;
+ while((FX_DWORD)(1 << nTmp) < SBSTRIPS) {
+ nTmp ++;
+ }
+ if(pStream->readNBits(nTmp, &nVal) != 0) {
+ m_pModule->JBig2_Error("text region decoding procedure (huffman): too short.");
+ goto failed;
+ }
+ CURT = nVal;
+ }
+ TI = STRIPT + CURT;
+ nVal = 0;
+ nBits = 0;
+ for(;;) {
+ if(pStream->read1Bit(&nTmp) != 0) {
+ m_pModule->JBig2_Error("text region decoding procedure (huffman): too short.");
+ goto failed;
+ }
+ nVal = (nVal << 1) | nTmp;
+ nBits ++;
+ for(IDI = 0; IDI < SBNUMSYMS; IDI++) {
+ if((nBits == SBSYMCODES[IDI].codelen) && (nVal == SBSYMCODES[IDI].code)) {
+ break;
+ }
+ }
+ if(IDI < SBNUMSYMS) {
+ break;
+ }
+ }
+ if(SBREFINE == 0) {
+ RI = 0;
+ } else {
+ if(pStream->read1Bit(&RI) != 0) {
+ m_pModule->JBig2_Error("text region decoding procedure (huffman): too short.");
+ goto failed;
+ }
+ }
+ if(RI == 0) {
+ IBI = SBSYMS[IDI];
+ } else {
+ if((pHuffmanDecoder->decodeAValue(SBHUFFRDW, &RDWI) != 0)
+ || (pHuffmanDecoder->decodeAValue(SBHUFFRDH, &RDHI) != 0)
+ || (pHuffmanDecoder->decodeAValue(SBHUFFRDX, &RDXI) != 0)
+ || (pHuffmanDecoder->decodeAValue(SBHUFFRDY, &RDYI) != 0)
+ || (pHuffmanDecoder->decodeAValue(SBHUFFRSIZE, &nVal) != 0)) {
+ m_pModule->JBig2_Error("text region decoding procedure (huffman): too short.");
+ goto failed;
+ }
+ pStream->alignByte();
+ nTmp = pStream->getOffset();
+ IBOI = SBSYMS[IDI];
+ if (!IBOI) {
+ goto failed;
+ }
+ WOI = IBOI->m_nWidth;
+ HOI = IBOI->m_nHeight;
+ if ((int)(WOI + RDWI) < 0 || (int)(HOI + RDHI) < 0) {
+ m_pModule->JBig2_Error("text region decoding procedure (huffman): Invalid RDWI or RDHI value.");
+ goto failed;
+ }
+ JBIG2_ALLOC(pGRRD, CJBig2_GRRDProc());
+ pGRRD->GRW = WOI + RDWI;
+ pGRRD->GRH = HOI + RDHI;
+ pGRRD->GRTEMPLATE = SBRTEMPLATE;
+ pGRRD->GRREFERENCE = IBOI;
+ pGRRD->GRREFERENCEDX = (RDWI >> 2) + RDXI;
+ pGRRD->GRREFERENCEDY = (RDHI >> 2) + RDYI;
+ pGRRD->TPGRON = 0;
+ pGRRD->GRAT[0] = SBRAT[0];
+ pGRRD->GRAT[1] = SBRAT[1];
+ pGRRD->GRAT[2] = SBRAT[2];
+ pGRRD->GRAT[3] = SBRAT[3];
+ JBIG2_ALLOC(pArithDecoder, CJBig2_ArithDecoder(pStream));
+ IBI = pGRRD->decode(pArithDecoder, grContext);
+ if(IBI == NULL) {
+ delete pGRRD;
+ delete pArithDecoder;
+ goto failed;
+ }
+ delete pArithDecoder;
+ pStream->alignByte();
+ pStream->offset(2);
+ if((FX_DWORD)nVal != (pStream->getOffset() - nTmp)) {
+ delete IBI;
+ delete pGRRD;
+ m_pModule->JBig2_Error("text region decoding procedure (huffman):"
+ "bytes processed by generic refinement region decoding procedure doesn't equal SBHUFFRSIZE.");
+ goto failed;
+ }
+ delete pGRRD;
+ }
+ if (!IBI) {
+ continue;
+ }
+ WI = IBI->m_nWidth;
+ HI = IBI->m_nHeight;
+ if(TRANSPOSED == 0 && ((REFCORNER == JBIG2_CORNER_TOPRIGHT)
+ || (REFCORNER == JBIG2_CORNER_BOTTOMRIGHT))) {
+ CURS = CURS + WI - 1;
+ } else if(TRANSPOSED == 1 && ((REFCORNER == JBIG2_CORNER_BOTTOMLEFT)
+ || (REFCORNER == JBIG2_CORNER_BOTTOMRIGHT))) {
+ CURS = CURS + HI - 1;
+ }
+ SI = CURS;
+ if(TRANSPOSED == 0) {
+ switch(REFCORNER) {
+ case JBIG2_CORNER_TOPLEFT:
+ SBREG->composeFrom(SI, TI, IBI, SBCOMBOP);
+ break;
+ case JBIG2_CORNER_TOPRIGHT:
+ SBREG->composeFrom(SI - WI + 1, TI, IBI, SBCOMBOP);
+ break;
+ case JBIG2_CORNER_BOTTOMLEFT:
+ SBREG->composeFrom(SI, TI - HI + 1, IBI, SBCOMBOP);
+ break;
+ case JBIG2_CORNER_BOTTOMRIGHT:
+ SBREG->composeFrom(SI - WI + 1, TI - HI + 1, IBI, SBCOMBOP);
+ break;
+ }
+ } else {
+ switch(REFCORNER) {
+ case JBIG2_CORNER_TOPLEFT:
+ SBREG->composeFrom(TI, SI, IBI, SBCOMBOP);
+ break;
+ case JBIG2_CORNER_TOPRIGHT:
+ SBREG->composeFrom(TI - WI + 1, SI, IBI, SBCOMBOP);
+ break;
+ case JBIG2_CORNER_BOTTOMLEFT:
+ SBREG->composeFrom(TI, SI - HI + 1, IBI, SBCOMBOP);
+ break;
+ case JBIG2_CORNER_BOTTOMRIGHT:
+ SBREG->composeFrom(TI - WI + 1, SI - HI + 1, IBI, SBCOMBOP);
+ break;
+ }
+ }
+ if(RI != 0) {
+ delete IBI;
+ }
+ if(TRANSPOSED == 0 && ((REFCORNER == JBIG2_CORNER_TOPLEFT)
+ || (REFCORNER == JBIG2_CORNER_BOTTOMLEFT))) {
+ CURS = CURS + WI - 1;
+ } else if(TRANSPOSED == 1 && ((REFCORNER == JBIG2_CORNER_TOPLEFT)
+ || (REFCORNER == JBIG2_CORNER_TOPRIGHT))) {
+ CURS = CURS + HI - 1;
+ }
+ NINSTANCES = NINSTANCES + 1;
+ }
+ }
+ delete pHuffmanDecoder;
+ return SBREG;
+failed:
+ delete pHuffmanDecoder;
+ delete SBREG;
+ return NULL;
+}
+CJBig2_Image *CJBig2_TRDProc::decode_Arith(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *grContext,
+ JBig2IntDecoderState *pIDS)
+{
+ FX_INT32 STRIPT, FIRSTS;
+ FX_DWORD NINSTANCES;
+ FX_INT32 DT, DFS, CURS;
+ FX_INT32 CURT;
+ FX_INT32 SI, TI;
+ FX_DWORD IDI;
+ CJBig2_Image *IBI;
+ FX_DWORD WI, HI;
+ FX_INT32 IDS;
+ FX_BOOL RI;
+ FX_INT32 RDWI, RDHI, RDXI, RDYI;
+ CJBig2_Image *IBOI;
+ FX_DWORD WOI, HOI;
+ CJBig2_Image *SBREG;
+ FX_BOOL bFirst;
+ FX_INT32 nRet, nVal;
+ FX_INT32 bRetained;
+ CJBig2_ArithIntDecoder *IADT, *IAFS, *IADS, *IAIT, *IARI, *IARDW, *IARDH, *IARDX, *IARDY;
+ CJBig2_ArithIaidDecoder *IAID;
+ CJBig2_GRRDProc *pGRRD;
+ if(pIDS) {
+ IADT = pIDS->IADT;
+ IAFS = pIDS->IAFS;
+ IADS = pIDS->IADS;
+ IAIT = pIDS->IAIT;
+ IARI = pIDS->IARI;
+ IARDW = pIDS->IARDW;
+ IARDH = pIDS->IARDH;
+ IARDX = pIDS->IARDX;
+ IARDY = pIDS->IARDY;
+ IAID = pIDS->IAID;
+ bRetained = TRUE;
+ } else {
+ JBIG2_ALLOC(IADT, CJBig2_ArithIntDecoder());
+ JBIG2_ALLOC(IAFS, CJBig2_ArithIntDecoder());
+ JBIG2_ALLOC(IADS, CJBig2_ArithIntDecoder());
+ JBIG2_ALLOC(IAIT, CJBig2_ArithIntDecoder());
+ JBIG2_ALLOC(IARI, CJBig2_ArithIntDecoder());
+ JBIG2_ALLOC(IARDW, CJBig2_ArithIntDecoder());
+ JBIG2_ALLOC(IARDH, CJBig2_ArithIntDecoder());
+ JBIG2_ALLOC(IARDX, CJBig2_ArithIntDecoder());
+ JBIG2_ALLOC(IARDY, CJBig2_ArithIntDecoder());
+ JBIG2_ALLOC(IAID , CJBig2_ArithIaidDecoder(SBSYMCODELEN));
+ bRetained = FALSE;
+ }
+ JBIG2_ALLOC(SBREG, CJBig2_Image(SBW, SBH));
+ SBREG->fill(SBDEFPIXEL);
+ if(IADT->decode(pArithDecoder, &STRIPT) == -1) {
+ m_pModule->JBig2_Error("text region decoding procedure (arith): too short.");
+ goto failed;
+ }
+ STRIPT *= SBSTRIPS;
+ STRIPT = -STRIPT;
+ FIRSTS = 0;
+ NINSTANCES = 0;
+ while(NINSTANCES < SBNUMINSTANCES) {
+ if(IADT->decode(pArithDecoder, &DT) == -1) {
+ m_pModule->JBig2_Error("text region decoding procedure (arith): too short.");
+ goto failed;
+ }
+ DT *= SBSTRIPS;
+ STRIPT = STRIPT + DT;
+ bFirst = TRUE;
+ for(;;) {
+ if(bFirst) {
+ if(IAFS->decode(pArithDecoder, &DFS) == -1) {
+ m_pModule->JBig2_Error("text region decoding procedure (arith): too short.");
+ goto failed;
+ }
+ FIRSTS = FIRSTS + DFS;
+ CURS = FIRSTS;
+ bFirst = FALSE;
+ } else {
+ nRet = IADS->decode(pArithDecoder, &IDS);
+ if(nRet == JBIG2_OOB) {
+ break;
+ } else if(nRet != 0) {
+ m_pModule->JBig2_Error("text region decoding procedure (arith): too short.");
+ goto failed;
+ } else {
+ CURS = CURS + IDS + SBDSOFFSET;
+ }
+ }
+ if (NINSTANCES >= SBNUMINSTANCES) {
+ break;
+ }
+ if(SBSTRIPS == 1) {
+ CURT = 0;
+ } else {
+ if(IAIT->decode(pArithDecoder, &nVal) == -1) {
+ m_pModule->JBig2_Error("text region decoding procedure (arith): too short.");
+ goto failed;
+ }
+ CURT = nVal;
+ }
+ TI = STRIPT + CURT;
+ if(IAID->decode(pArithDecoder, &nVal) == -1) {
+ m_pModule->JBig2_Error("text region decoding procedure (arith): too short.");
+ goto failed;
+ }
+ IDI = nVal;
+ if(IDI >= SBNUMSYMS) {
+ m_pModule->JBig2_Error("text region decoding procedure (arith): symbol id out of range.(%d/%d)",
+ IDI, SBNUMSYMS);
+ goto failed;
+ }
+ if(SBREFINE == 0) {
+ RI = 0;
+ } else {
+ if(IARI->decode(pArithDecoder, &RI) == -1) {
+ m_pModule->JBig2_Error("text region decoding procedure (arith): too short.");
+ goto failed;
+ }
+ }
+ if (!SBSYMS[IDI]) {
+ goto failed;
+ }
+ if(RI == 0) {
+ IBI = SBSYMS[IDI];
+ } else {
+ if((IARDW->decode(pArithDecoder, &RDWI) == -1)
+ || (IARDH->decode(pArithDecoder, &RDHI) == -1)
+ || (IARDX->decode(pArithDecoder, &RDXI) == -1)
+ || (IARDY->decode(pArithDecoder, &RDYI) == -1)) {
+ m_pModule->JBig2_Error("text region decoding procedure (arith): too short.");
+ goto failed;
+ }
+ IBOI = SBSYMS[IDI];
+ WOI = IBOI->m_nWidth;
+ HOI = IBOI->m_nHeight;
+ if ((int)(WOI + RDWI) < 0 || (int)(HOI + RDHI) < 0) {
+ m_pModule->JBig2_Error("text region decoding procedure (arith): Invalid RDWI or RDHI value.");
+ goto failed;
+ }
+ JBIG2_ALLOC(pGRRD, CJBig2_GRRDProc());
+ pGRRD->GRW = WOI + RDWI;
+ pGRRD->GRH = HOI + RDHI;
+ pGRRD->GRTEMPLATE = SBRTEMPLATE;
+ pGRRD->GRREFERENCE = IBOI;
+ pGRRD->GRREFERENCEDX = (RDWI >> 1) + RDXI;
+ pGRRD->GRREFERENCEDY = (RDHI >> 1) + RDYI;
+ pGRRD->TPGRON = 0;
+ pGRRD->GRAT[0] = SBRAT[0];
+ pGRRD->GRAT[1] = SBRAT[1];
+ pGRRD->GRAT[2] = SBRAT[2];
+ pGRRD->GRAT[3] = SBRAT[3];
+ IBI = pGRRD->decode(pArithDecoder, grContext);
+ if(IBI == NULL) {
+ delete pGRRD;
+ goto failed;
+ }
+ delete pGRRD;
+ }
+ WI = IBI->m_nWidth;
+ HI = IBI->m_nHeight;
+ if(TRANSPOSED == 0 && ((REFCORNER == JBIG2_CORNER_TOPRIGHT)
+ || (REFCORNER == JBIG2_CORNER_BOTTOMRIGHT))) {
+ CURS = CURS + WI - 1;
+ } else if(TRANSPOSED == 1 && ((REFCORNER == JBIG2_CORNER_BOTTOMLEFT)
+ || (REFCORNER == JBIG2_CORNER_BOTTOMRIGHT))) {
+ CURS = CURS + HI - 1;
+ }
+ SI = CURS;
+ if(TRANSPOSED == 0) {
+ switch(REFCORNER) {
+ case JBIG2_CORNER_TOPLEFT:
+ SBREG->composeFrom(SI, TI, IBI, SBCOMBOP);
+ break;
+ case JBIG2_CORNER_TOPRIGHT:
+ SBREG->composeFrom(SI - WI + 1, TI, IBI, SBCOMBOP);
+ break;
+ case JBIG2_CORNER_BOTTOMLEFT:
+ SBREG->composeFrom(SI, TI - HI + 1, IBI, SBCOMBOP);
+ break;
+ case JBIG2_CORNER_BOTTOMRIGHT:
+ SBREG->composeFrom(SI - WI + 1, TI - HI + 1, IBI, SBCOMBOP);
+ break;
+ }
+ } else {
+ switch(REFCORNER) {
+ case JBIG2_CORNER_TOPLEFT:
+ SBREG->composeFrom(TI, SI, IBI, SBCOMBOP);
+ break;
+ case JBIG2_CORNER_TOPRIGHT:
+ SBREG->composeFrom(TI - WI + 1, SI, IBI, SBCOMBOP);
+ break;
+ case JBIG2_CORNER_BOTTOMLEFT:
+ SBREG->composeFrom(TI, SI - HI + 1, IBI, SBCOMBOP);
+ break;
+ case JBIG2_CORNER_BOTTOMRIGHT:
+ SBREG->composeFrom(TI - WI + 1, SI - HI + 1, IBI, SBCOMBOP);
+ break;
+ }
+ }
+ if(RI != 0) {
+ delete IBI;
+ }
+ if(TRANSPOSED == 0 && ((REFCORNER == JBIG2_CORNER_TOPLEFT)
+ || (REFCORNER == JBIG2_CORNER_BOTTOMLEFT))) {
+ CURS = CURS + WI - 1;
+ } else if(TRANSPOSED == 1 && ((REFCORNER == JBIG2_CORNER_TOPLEFT)
+ || (REFCORNER == JBIG2_CORNER_TOPRIGHT))) {
+ CURS = CURS + HI - 1;
+ }
+ NINSTANCES = NINSTANCES + 1;
+ }
+ }
+ if(bRetained == FALSE) {
+ delete IADT;
+ delete IAFS;
+ delete IADS;
+ delete IAIT;
+ delete IARI;
+ delete IARDW;
+ delete IARDH;
+ delete IARDX;
+ delete IARDY;
+ delete IAID;
+ }
+ return SBREG;
+failed:
+ if(bRetained == FALSE) {
+ delete IADT;
+ delete IAFS;
+ delete IADS;
+ delete IAIT;
+ delete IARI;
+ delete IARDW;
+ delete IARDH;
+ delete IARDX;
+ delete IARDY;
+ delete IAID;
+ }
+ delete SBREG;
+ return NULL;
+}
+CJBig2_SymbolDict *CJBig2_SDDProc::decode_Arith(CJBig2_ArithDecoder *pArithDecoder,
+ JBig2ArithCtx *gbContext, JBig2ArithCtx *grContext)
+{
+ CJBig2_Image **SDNEWSYMS;
+ FX_DWORD HCHEIGHT, NSYMSDECODED;
+ FX_INT32 HCDH;
+ FX_DWORD SYMWIDTH, TOTWIDTH, HCFIRSTSYM;
+ FX_INT32 DW;
+ CJBig2_Image *BS;
+ FX_DWORD I, J, REFAGGNINST;
+ FX_BOOL *EXFLAGS;
+ FX_DWORD EXINDEX;
+ FX_BOOL CUREXFLAG;
+ FX_DWORD EXRUNLENGTH;
+ FX_INT32 nVal;
+ FX_DWORD nTmp;
+ FX_BOOL SBHUFF;
+ FX_DWORD SBNUMSYMS;
+ FX_BYTE SBSYMCODELEN;
+ FX_DWORD IDI;
+ FX_INT32 RDXI, RDYI;
+ CJBig2_Image **SBSYMS;
+ CJBig2_HuffmanTable *SBHUFFFS, *SBHUFFDS, *SBHUFFDT, *SBHUFFRDW, *SBHUFFRDH, *SBHUFFRDX, *SBHUFFRDY,
+ *SBHUFFRSIZE;
+ CJBig2_GRRDProc *pGRRD;
+ CJBig2_GRDProc *pGRD;
+ CJBig2_ArithIntDecoder *IADH, *IADW, *IAAI, *IARDX, *IARDY, *IAEX,
+ *IADT, *IAFS, *IADS, *IAIT, *IARI, *IARDW, *IARDH;
+ CJBig2_ArithIaidDecoder *IAID;
+ CJBig2_SymbolDict *pDict;
+ JBIG2_ALLOC(IADH, CJBig2_ArithIntDecoder());
+ JBIG2_ALLOC(IADW, CJBig2_ArithIntDecoder());
+ JBIG2_ALLOC(IAAI, CJBig2_ArithIntDecoder());
+ JBIG2_ALLOC(IARDX, CJBig2_ArithIntDecoder());
+ JBIG2_ALLOC(IARDY, CJBig2_ArithIntDecoder());
+ JBIG2_ALLOC(IAEX, CJBig2_ArithIntDecoder());
+ JBIG2_ALLOC(IADT, CJBig2_ArithIntDecoder());
+ JBIG2_ALLOC(IAFS, CJBig2_ArithIntDecoder());
+ JBIG2_ALLOC(IADS, CJBig2_ArithIntDecoder());
+ JBIG2_ALLOC(IAIT, CJBig2_ArithIntDecoder());
+ JBIG2_ALLOC(IARI, CJBig2_ArithIntDecoder());
+ JBIG2_ALLOC(IARDW, CJBig2_ArithIntDecoder());
+ JBIG2_ALLOC(IARDH, CJBig2_ArithIntDecoder());
+ nTmp = 0;
+ while((FX_DWORD)(1 << nTmp) < (SDNUMINSYMS + SDNUMNEWSYMS)) {
+ nTmp ++;
+ }
+ JBIG2_ALLOC(IAID, CJBig2_ArithIaidDecoder((FX_BYTE)nTmp));
+ SDNEWSYMS = (CJBig2_Image**)m_pModule->JBig2_Malloc2(SDNUMNEWSYMS, sizeof(CJBig2_Image*));
+ FXSYS_memset32(SDNEWSYMS, 0 , SDNUMNEWSYMS * sizeof(CJBig2_Image*));
+ HCHEIGHT = 0;
+ NSYMSDECODED = 0;
+ while(NSYMSDECODED < SDNUMNEWSYMS) {
+ BS = NULL;
+ if(IADH->decode(pArithDecoder, &HCDH) == -1) {
+ m_pModule->JBig2_Error("symbol dictionary decoding procedure (arith): too short.");
+ goto failed;
+ }
+ HCHEIGHT = HCHEIGHT + HCDH;
+ if ((int)HCHEIGHT < 0 || (int)HCHEIGHT > JBIG2_MAX_IMAGE_SIZE) {
+ m_pModule->JBig2_Error("symbol dictionary decoding procedure (arith): invalid HCHEIGHT value.");
+ goto failed;
+ }
+ SYMWIDTH = 0;
+ TOTWIDTH = 0;
+ HCFIRSTSYM = NSYMSDECODED;
+ for(;;) {
+ nVal = IADW->decode(pArithDecoder, &DW);
+ if(nVal == JBIG2_OOB) {
+ break;
+ } else if(nVal != 0) {
+ m_pModule->JBig2_Error("symbol dictionary decoding procedure (arith): too short.");
+ goto failed;
+ } else {
+ if (NSYMSDECODED >= SDNUMNEWSYMS) {
+ m_pModule->JBig2_Error("symbol dictionary decoding procedure (arith): NSYMSDECODED >= SDNUMNEWSYMS.");
+ goto failed;
+ }
+ SYMWIDTH = SYMWIDTH + DW;
+ if ((int)SYMWIDTH < 0 || (int)SYMWIDTH > JBIG2_MAX_IMAGE_SIZE) {
+ m_pModule->JBig2_Error("symbol dictionary decoding procedure (arith): invalid SYMWIDTH value.");
+ goto failed;
+ } else if (HCHEIGHT == 0 || SYMWIDTH == 0) {
+ TOTWIDTH = TOTWIDTH + SYMWIDTH;
+ SDNEWSYMS[NSYMSDECODED] = NULL;
+ NSYMSDECODED = NSYMSDECODED + 1;
+ continue;
+ }
+ TOTWIDTH = TOTWIDTH + SYMWIDTH;
+ }
+ if(SDREFAGG == 0) {
+ JBIG2_ALLOC(pGRD, CJBig2_GRDProc());
+ pGRD->MMR = 0;
+ pGRD->GBW = SYMWIDTH;
+ pGRD->GBH = HCHEIGHT;
+ pGRD->GBTEMPLATE = SDTEMPLATE;
+ pGRD->TPGDON = 0;
+ pGRD->USESKIP = 0;
+ pGRD->GBAT[0] = SDAT[0];
+ pGRD->GBAT[1] = SDAT[1];
+ pGRD->GBAT[2] = SDAT[2];
+ pGRD->GBAT[3] = SDAT[3];
+ pGRD->GBAT[4] = SDAT[4];
+ pGRD->GBAT[5] = SDAT[5];
+ pGRD->GBAT[6] = SDAT[6];
+ pGRD->GBAT[7] = SDAT[7];
+ BS = pGRD->decode_Arith(pArithDecoder, gbContext);
+ if(BS == NULL) {
+ delete pGRD;
+ goto failed;
+ }
+ delete pGRD;
+ } else {
+ if(IAAI->decode(pArithDecoder, (int*)&REFAGGNINST) == -1) {
+ m_pModule->JBig2_Error("symbol dictionary decoding procedure (arith): too short.");
+ goto failed;
+ }
+ if(REFAGGNINST > 1) {
+ CJBig2_TRDProc *pDecoder;
+ JBIG2_ALLOC(pDecoder, CJBig2_TRDProc());
+ pDecoder->SBHUFF = SDHUFF;
+ pDecoder->SBREFINE = 1;
+ pDecoder->SBW = SYMWIDTH;
+ pDecoder->SBH = HCHEIGHT;
+ pDecoder->SBNUMINSTANCES = REFAGGNINST;
+ pDecoder->SBSTRIPS = 1;
+ pDecoder->SBNUMSYMS = SDNUMINSYMS + NSYMSDECODED;
+ SBNUMSYMS = pDecoder->SBNUMSYMS;
+ nTmp = 0;
+ while((FX_DWORD)(1 << nTmp) < SBNUMSYMS) {
+ nTmp ++;
+ }
+ SBSYMCODELEN = (FX_BYTE)nTmp;
+ pDecoder->SBSYMCODELEN = SBSYMCODELEN;
+ SBSYMS = (CJBig2_Image**)m_pModule->JBig2_Malloc2(SBNUMSYMS, sizeof(CJBig2_Image*));
+ JBIG2_memcpy(SBSYMS, SDINSYMS, SDNUMINSYMS * sizeof(CJBig2_Image*));
+ JBIG2_memcpy(SBSYMS + SDNUMINSYMS, SDNEWSYMS, NSYMSDECODED * sizeof(CJBig2_Image*));
+ pDecoder->SBSYMS = SBSYMS;
+ pDecoder->SBDEFPIXEL = 0;
+ pDecoder->SBCOMBOP = JBIG2_COMPOSE_OR;
+ pDecoder->TRANSPOSED = 0;
+ pDecoder->REFCORNER = JBIG2_CORNER_TOPLEFT;
+ pDecoder->SBDSOFFSET = 0;
+ JBIG2_ALLOC(SBHUFFFS, CJBig2_HuffmanTable(HuffmanTable_B6,
+ sizeof(HuffmanTable_B6) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B6));
+ JBIG2_ALLOC(SBHUFFDS, CJBig2_HuffmanTable(HuffmanTable_B8,
+ sizeof(HuffmanTable_B8) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B8));
+ JBIG2_ALLOC(SBHUFFDT, CJBig2_HuffmanTable(HuffmanTable_B11,
+ sizeof(HuffmanTable_B11) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B11));
+ JBIG2_ALLOC(SBHUFFRDW, CJBig2_HuffmanTable(HuffmanTable_B15,
+ sizeof(HuffmanTable_B15) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B15));
+ JBIG2_ALLOC(SBHUFFRDH, CJBig2_HuffmanTable(HuffmanTable_B15,
+ sizeof(HuffmanTable_B15) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B15));
+ JBIG2_ALLOC(SBHUFFRDX, CJBig2_HuffmanTable(HuffmanTable_B15,
+ sizeof(HuffmanTable_B15) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B15));
+ JBIG2_ALLOC(SBHUFFRDY, CJBig2_HuffmanTable(HuffmanTable_B15,
+ sizeof(HuffmanTable_B15) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B15));
+ JBIG2_ALLOC(SBHUFFRSIZE, CJBig2_HuffmanTable(HuffmanTable_B1,
+ sizeof(HuffmanTable_B1) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B1));
+ pDecoder->SBHUFFFS = SBHUFFFS;
+ pDecoder->SBHUFFDS = SBHUFFDS;
+ pDecoder->SBHUFFDT = SBHUFFDT;
+ pDecoder->SBHUFFRDW = SBHUFFRDW;
+ pDecoder->SBHUFFRDH = SBHUFFRDH;
+ pDecoder->SBHUFFRDX = SBHUFFRDX;
+ pDecoder->SBHUFFRDY = SBHUFFRDY;
+ pDecoder->SBHUFFRSIZE = SBHUFFRSIZE;
+ pDecoder->SBRTEMPLATE = SDRTEMPLATE;
+ pDecoder->SBRAT[0] = SDRAT[0];
+ pDecoder->SBRAT[1] = SDRAT[1];
+ pDecoder->SBRAT[2] = SDRAT[2];
+ pDecoder->SBRAT[3] = SDRAT[3];
+ JBig2IntDecoderState ids;
+ ids.IADT = IADT;
+ ids.IAFS = IAFS;
+ ids.IADS = IADS;
+ ids.IAIT = IAIT;
+ ids.IARI = IARI;
+ ids.IARDW = IARDW;
+ ids.IARDH = IARDH;
+ ids.IARDX = IARDX;
+ ids.IARDY = IARDY;
+ ids.IAID = IAID;
+ BS = pDecoder->decode_Arith(pArithDecoder, grContext, &ids);
+ if(BS == NULL) {
+ m_pModule->JBig2_Free(SBSYMS);
+ delete SBHUFFFS;
+ delete SBHUFFDS;
+ delete SBHUFFDT;
+ delete SBHUFFRDW;
+ delete SBHUFFRDH;
+ delete SBHUFFRDX;
+ delete SBHUFFRDY;
+ delete SBHUFFRSIZE;
+ delete pDecoder;
+ goto failed;
+ }
+ m_pModule->JBig2_Free(SBSYMS);
+ delete SBHUFFFS;
+ delete SBHUFFDS;
+ delete SBHUFFDT;
+ delete SBHUFFRDW;
+ delete SBHUFFRDH;
+ delete SBHUFFRDX;
+ delete SBHUFFRDY;
+ delete SBHUFFRSIZE;
+ delete pDecoder;
+ } else if(REFAGGNINST == 1) {
+ SBHUFF = SDHUFF;
+ SBNUMSYMS = SDNUMINSYMS + NSYMSDECODED;
+ if(IAID->decode(pArithDecoder, (int*)&IDI) == -1) {
+ m_pModule->JBig2_Error("symbol dictionary decoding procedure (arith): too short.");
+ goto failed;
+ }
+ if((IARDX->decode(pArithDecoder, &RDXI) == -1)
+ || (IARDY->decode(pArithDecoder, &RDYI) == -1)) {
+ m_pModule->JBig2_Error("symbol dictionary decoding procedure (arith): too short.");
+ goto failed;
+ }
+ if (IDI >= SBNUMSYMS) {
+ m_pModule->JBig2_Error("symbol dictionary decoding procedure (arith):"
+ " refinement references unknown symbol %d", IDI);
+ goto failed;
+ }
+ SBSYMS = (CJBig2_Image**)m_pModule->JBig2_Malloc2(SBNUMSYMS, sizeof(CJBig2_Image*));
+ JBIG2_memcpy(SBSYMS, SDINSYMS, SDNUMINSYMS * sizeof(CJBig2_Image*));
+ JBIG2_memcpy(SBSYMS + SDNUMINSYMS, SDNEWSYMS, NSYMSDECODED * sizeof(CJBig2_Image*));
+ if (!SBSYMS[IDI]) {
+ m_pModule->JBig2_Free(SBSYMS);
+ goto failed;
+ }
+ JBIG2_ALLOC(pGRRD, CJBig2_GRRDProc());
+ pGRRD->GRW = SYMWIDTH;
+ pGRRD->GRH = HCHEIGHT;
+ pGRRD->GRTEMPLATE = SDRTEMPLATE;
+ pGRRD->GRREFERENCE = SBSYMS[IDI];
+ pGRRD->GRREFERENCEDX = RDXI;
+ pGRRD->GRREFERENCEDY = RDYI;
+ pGRRD->TPGRON = 0;
+ pGRRD->GRAT[0] = SDRAT[0];
+ pGRRD->GRAT[1] = SDRAT[1];
+ pGRRD->GRAT[2] = SDRAT[2];
+ pGRRD->GRAT[3] = SDRAT[3];
+ BS = pGRRD->decode(pArithDecoder, grContext);
+ if(BS == NULL) {
+ m_pModule->JBig2_Free(SBSYMS);
+ delete pGRRD;
+ goto failed;
+ }
+ m_pModule->JBig2_Free(SBSYMS);
+ delete pGRRD;
+ }
+ }
+ SDNEWSYMS[NSYMSDECODED] = BS;
+ BS = NULL;
+ NSYMSDECODED = NSYMSDECODED + 1;
+ }
+ }
+ EXINDEX = 0;
+ CUREXFLAG = 0;
+ EXFLAGS = (FX_BOOL*)m_pModule->JBig2_Malloc2(sizeof(FX_BOOL), (SDNUMINSYMS + SDNUMNEWSYMS));
+ while(EXINDEX < SDNUMINSYMS + SDNUMNEWSYMS) {
+ if(IAEX->decode(pArithDecoder, (int*)&EXRUNLENGTH) == -1) {
+ m_pModule->JBig2_Free(EXFLAGS);
+ m_pModule->JBig2_Error("symbol dictionary decoding procedure (arith): too short.");
+ goto failed;
+ }
+ if (EXINDEX + EXRUNLENGTH > SDNUMINSYMS + SDNUMNEWSYMS) {
+ m_pModule->JBig2_Free(EXFLAGS);
+ m_pModule->JBig2_Error("symbol dictionary decoding procedure (arith): Invalid EXRUNLENGTH value.");
+ goto failed;
+ }
+ if(EXRUNLENGTH != 0) {
+ for(I = EXINDEX; I < EXINDEX + EXRUNLENGTH; I++) {
+ EXFLAGS[I] = CUREXFLAG;
+ }
+ }
+ EXINDEX = EXINDEX + EXRUNLENGTH;
+ CUREXFLAG = !CUREXFLAG;
+ }
+ JBIG2_ALLOC(pDict, CJBig2_SymbolDict());
+ pDict->SDNUMEXSYMS = SDNUMEXSYMS;
+ pDict->SDEXSYMS = (CJBig2_Image**)m_pModule->JBig2_Malloc2(sizeof(CJBig2_Image*), SDNUMEXSYMS);
+ I = J = 0;
+ for(I = 0; I < SDNUMINSYMS + SDNUMNEWSYMS; I++) {
+ if(EXFLAGS[I] && J < SDNUMEXSYMS) {
+ if(I < SDNUMINSYMS) {
+ JBIG2_ALLOC(pDict->SDEXSYMS[J], CJBig2_Image(*SDINSYMS[I]));
+ } else {
+ pDict->SDEXSYMS[J] = SDNEWSYMS[I - SDNUMINSYMS];
+ }
+ J = J + 1;
+ } else if (!EXFLAGS[I] && I >= SDNUMINSYMS) {
+ delete SDNEWSYMS[I - SDNUMINSYMS];
+ }
+ }
+ if (J < SDNUMEXSYMS) {
+ pDict->SDNUMEXSYMS = J;
+ }
+ m_pModule->JBig2_Free(EXFLAGS);
+ m_pModule->JBig2_Free(SDNEWSYMS);
+ delete IADH;
+ delete IADW;
+ delete IAAI;
+ delete IARDX;
+ delete IARDY;
+ delete IAEX;
+ delete IAID;
+ delete IADT;
+ delete IAFS;
+ delete IADS;
+ delete IAIT;
+ delete IARI;
+ delete IARDW;
+ delete IARDH;
+ return pDict;
+failed:
+ for(I = 0; I < NSYMSDECODED; I++) {
+ if (SDNEWSYMS[I]) {
+ delete SDNEWSYMS[I];
+ SDNEWSYMS[I] = NULL;
+ }
+ }
+ m_pModule->JBig2_Free(SDNEWSYMS);
+ delete IADH;
+ delete IADW;
+ delete IAAI;
+ delete IARDX;
+ delete IARDY;
+ delete IAEX;
+ delete IAID;
+ delete IADT;
+ delete IAFS;
+ delete IADS;
+ delete IAIT;
+ delete IARI;
+ delete IARDW;
+ delete IARDH;
+ return NULL;
+}
+CJBig2_SymbolDict *CJBig2_SDDProc::decode_Huffman(CJBig2_BitStream *pStream,
+ JBig2ArithCtx *gbContext, JBig2ArithCtx *grContext, IFX_Pause* pPause)
+{
+ CJBig2_Image **SDNEWSYMS;
+ FX_DWORD *SDNEWSYMWIDTHS;
+ FX_DWORD HCHEIGHT, NSYMSDECODED;
+ FX_INT32 HCDH;
+ FX_DWORD SYMWIDTH, TOTWIDTH, HCFIRSTSYM;
+ FX_INT32 DW;
+ CJBig2_Image *BS, *BHC;
+ FX_DWORD I, J, REFAGGNINST;
+ FX_BOOL *EXFLAGS;
+ FX_DWORD EXINDEX;
+ FX_BOOL CUREXFLAG;
+ FX_DWORD EXRUNLENGTH;
+ FX_INT32 nVal, nBits;
+ FX_DWORD nTmp;
+ FX_BOOL SBHUFF;
+ FX_DWORD SBNUMSYMS;
+ FX_BYTE SBSYMCODELEN;
+ JBig2HuffmanCode *SBSYMCODES;
+ FX_DWORD IDI;
+ FX_INT32 RDXI, RDYI;
+ FX_DWORD BMSIZE;
+ FX_DWORD stride;
+ CJBig2_Image **SBSYMS;
+ CJBig2_HuffmanTable *SBHUFFFS, *SBHUFFDS, *SBHUFFDT, *SBHUFFRDW, *SBHUFFRDH, *SBHUFFRDX, *SBHUFFRDY,
+ *SBHUFFRSIZE, *pTable;
+ CJBig2_HuffmanDecoder *pHuffmanDecoder;
+ CJBig2_GRRDProc *pGRRD;
+ CJBig2_ArithDecoder *pArithDecoder;
+ CJBig2_GRDProc *pGRD;
+ CJBig2_SymbolDict *pDict;
+ JBIG2_ALLOC(pHuffmanDecoder, CJBig2_HuffmanDecoder(pStream));
+ SDNEWSYMS = (CJBig2_Image**)m_pModule->JBig2_Malloc2(SDNUMNEWSYMS, sizeof(CJBig2_Image*));
+ FXSYS_memset32(SDNEWSYMS, 0 , SDNUMNEWSYMS * sizeof(CJBig2_Image*));
+ SDNEWSYMWIDTHS = NULL;
+ BHC = NULL;
+ if(SDREFAGG == 0) {
+ SDNEWSYMWIDTHS = (FX_DWORD *)m_pModule->JBig2_Malloc2(SDNUMNEWSYMS, sizeof(FX_DWORD));
+ FXSYS_memset32(SDNEWSYMWIDTHS, 0 , SDNUMNEWSYMS * sizeof(FX_DWORD));
+ }
+ HCHEIGHT = 0;
+ NSYMSDECODED = 0;
+ BS = NULL;
+ while(NSYMSDECODED < SDNUMNEWSYMS) {
+ if(pHuffmanDecoder->decodeAValue(SDHUFFDH, &HCDH) != 0) {
+ m_pModule->JBig2_Error("symbol dictionary decoding procedure (huffman): too short.");
+ goto failed;
+ }
+ HCHEIGHT = HCHEIGHT + HCDH;
+ if ((int)HCHEIGHT < 0 || (int)HCHEIGHT > JBIG2_MAX_IMAGE_SIZE) {
+ m_pModule->JBig2_Error("symbol dictionary decoding procedure (huffman): invalid HCHEIGHT value.");
+ goto failed;
+ }
+ SYMWIDTH = 0;
+ TOTWIDTH = 0;
+ HCFIRSTSYM = NSYMSDECODED;
+ for(;;) {
+ nVal = pHuffmanDecoder->decodeAValue(SDHUFFDW, &DW);
+ if(nVal == JBIG2_OOB) {
+ break;
+ } else if(nVal != 0) {
+ m_pModule->JBig2_Error("symbol dictionary decoding procedure (huffman): too short.");
+ goto failed;
+ } else {
+ if (NSYMSDECODED >= SDNUMNEWSYMS) {
+ m_pModule->JBig2_Error("symbol dictionary decoding procedure (huffman): NSYMSDECODED >= SDNUMNEWSYMS.");
+ goto failed;
+ }
+ SYMWIDTH = SYMWIDTH + DW;
+ if ((int)SYMWIDTH < 0 || (int)SYMWIDTH > JBIG2_MAX_IMAGE_SIZE) {
+ m_pModule->JBig2_Error("symbol dictionary decoding procedure (huffman): invalid SYMWIDTH value.");
+ goto failed;
+ } else if (HCHEIGHT == 0 || SYMWIDTH == 0) {
+ TOTWIDTH = TOTWIDTH + SYMWIDTH;
+ SDNEWSYMS[NSYMSDECODED] = NULL;
+ NSYMSDECODED = NSYMSDECODED + 1;
+ continue;
+ }
+ TOTWIDTH = TOTWIDTH + SYMWIDTH;
+ }
+ if(SDREFAGG == 1) {
+ if(pHuffmanDecoder->decodeAValue(SDHUFFAGGINST, (int*)&REFAGGNINST) != 0) {
+ m_pModule->JBig2_Error("symbol dictionary decoding procedure (huffman): too short.");
+ goto failed;
+ }
+ BS = NULL;
+ if(REFAGGNINST > 1) {
+ CJBig2_TRDProc *pDecoder;
+ JBIG2_ALLOC(pDecoder, CJBig2_TRDProc());
+ pDecoder->SBHUFF = SDHUFF;
+ pDecoder->SBREFINE = 1;
+ pDecoder->SBW = SYMWIDTH;
+ pDecoder->SBH = HCHEIGHT;
+ pDecoder->SBNUMINSTANCES = REFAGGNINST;
+ pDecoder->SBSTRIPS = 1;
+ pDecoder->SBNUMSYMS = SDNUMINSYMS + NSYMSDECODED;
+ SBNUMSYMS = pDecoder->SBNUMSYMS;
+ SBSYMCODES = (JBig2HuffmanCode*)m_pModule->JBig2_Malloc2(SBNUMSYMS, sizeof(JBig2HuffmanCode));
+ nTmp = 1;
+ while((FX_DWORD)(1 << nTmp) < SBNUMSYMS) {
+ nTmp ++;
+ }
+ for(I = 0; I < SBNUMSYMS; I++) {
+ SBSYMCODES[I].codelen = nTmp;
+ SBSYMCODES[I].code = I;
+ }
+ pDecoder->SBSYMCODES = SBSYMCODES;
+ SBSYMS = (CJBig2_Image**)m_pModule->JBig2_Malloc2(SBNUMSYMS, sizeof(CJBig2_Image*));
+ JBIG2_memcpy(SBSYMS, SDINSYMS, SDNUMINSYMS * sizeof(CJBig2_Image*));
+ JBIG2_memcpy(SBSYMS + SDNUMINSYMS, SDNEWSYMS, NSYMSDECODED * sizeof(CJBig2_Image*));
+ pDecoder->SBSYMS = SBSYMS;
+ pDecoder->SBDEFPIXEL = 0;
+ pDecoder->SBCOMBOP = JBIG2_COMPOSE_OR;
+ pDecoder->TRANSPOSED = 0;
+ pDecoder->REFCORNER = JBIG2_CORNER_TOPLEFT;
+ pDecoder->SBDSOFFSET = 0;
+ JBIG2_ALLOC(SBHUFFFS, CJBig2_HuffmanTable(HuffmanTable_B6,
+ sizeof(HuffmanTable_B6) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B6));
+ JBIG2_ALLOC(SBHUFFDS, CJBig2_HuffmanTable(HuffmanTable_B8,
+ sizeof(HuffmanTable_B8) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B8));
+ JBIG2_ALLOC(SBHUFFDT, CJBig2_HuffmanTable(HuffmanTable_B11,
+ sizeof(HuffmanTable_B11) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B11));
+ JBIG2_ALLOC(SBHUFFRDW, CJBig2_HuffmanTable(HuffmanTable_B15,
+ sizeof(HuffmanTable_B15) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B15));
+ JBIG2_ALLOC(SBHUFFRDH, CJBig2_HuffmanTable(HuffmanTable_B15,
+ sizeof(HuffmanTable_B15) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B15));
+ JBIG2_ALLOC(SBHUFFRDX, CJBig2_HuffmanTable(HuffmanTable_B15,
+ sizeof(HuffmanTable_B15) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B15));
+ JBIG2_ALLOC(SBHUFFRDY, CJBig2_HuffmanTable(HuffmanTable_B15,
+ sizeof(HuffmanTable_B15) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B15));
+ JBIG2_ALLOC(SBHUFFRSIZE, CJBig2_HuffmanTable(HuffmanTable_B1,
+ sizeof(HuffmanTable_B1) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B1));
+ pDecoder->SBHUFFFS = SBHUFFFS;
+ pDecoder->SBHUFFDS = SBHUFFDS;
+ pDecoder->SBHUFFDT = SBHUFFDT;
+ pDecoder->SBHUFFRDW = SBHUFFRDW;
+ pDecoder->SBHUFFRDH = SBHUFFRDH;
+ pDecoder->SBHUFFRDX = SBHUFFRDX;
+ pDecoder->SBHUFFRDY = SBHUFFRDY;
+ pDecoder->SBHUFFRSIZE = SBHUFFRSIZE;
+ pDecoder->SBRTEMPLATE = SDRTEMPLATE;
+ pDecoder->SBRAT[0] = SDRAT[0];
+ pDecoder->SBRAT[1] = SDRAT[1];
+ pDecoder->SBRAT[2] = SDRAT[2];
+ pDecoder->SBRAT[3] = SDRAT[3];
+ BS = pDecoder->decode_Huffman(pStream, grContext);
+ if(BS == NULL) {
+ m_pModule->JBig2_Free(SBSYMCODES);
+ m_pModule->JBig2_Free(SBSYMS);
+ delete SBHUFFFS;
+ delete SBHUFFDS;
+ delete SBHUFFDT;
+ delete SBHUFFRDW;
+ delete SBHUFFRDH;
+ delete SBHUFFRDX;
+ delete SBHUFFRDY;
+ delete SBHUFFRSIZE;
+ delete pDecoder;
+ goto failed;
+ }
+ m_pModule->JBig2_Free(SBSYMCODES);
+ m_pModule->JBig2_Free(SBSYMS);
+ delete SBHUFFFS;
+ delete SBHUFFDS;
+ delete SBHUFFDT;
+ delete SBHUFFRDW;
+ delete SBHUFFRDH;
+ delete SBHUFFRDX;
+ delete SBHUFFRDY;
+ delete SBHUFFRSIZE;
+ delete pDecoder;
+ } else if(REFAGGNINST == 1) {
+ SBHUFF = SDHUFF;
+ SBNUMSYMS = SDNUMINSYMS + SDNUMNEWSYMS;
+ nTmp = 1;
+ while((FX_DWORD)(1 << nTmp) < SBNUMSYMS) {
+ nTmp ++;
+ }
+ SBSYMCODELEN = (FX_BYTE)nTmp;
+ SBSYMCODES = (JBig2HuffmanCode*)m_pModule->JBig2_Malloc2(SBNUMSYMS, sizeof(JBig2HuffmanCode));
+ for(I = 0; I < SBNUMSYMS; I++) {
+ SBSYMCODES[I].codelen = SBSYMCODELEN;
+ SBSYMCODES[I].code = I;
+ }
+ nVal = 0;
+ nBits = 0;
+ for(;;) {
+ if(pStream->read1Bit(&nTmp) != 0) {
+ m_pModule->JBig2_Free(SBSYMCODES);
+ m_pModule->JBig2_Error("symbol dictionary decoding procedure (huffman): too short.");
+ goto failed;
+ }
+ nVal = (nVal << 1) | nTmp;
+ for(IDI = 0; IDI < SBNUMSYMS; IDI++) {
+ if((nVal == SBSYMCODES[IDI].code)
+ && (nBits == SBSYMCODES[IDI].codelen)) {
+ break;
+ }
+ }
+ if(IDI < SBNUMSYMS) {
+ break;
+ }
+ }
+ m_pModule->JBig2_Free(SBSYMCODES);
+ JBIG2_ALLOC(SBHUFFRDX, CJBig2_HuffmanTable(HuffmanTable_B15,
+ sizeof(HuffmanTable_B15) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B15));
+ JBIG2_ALLOC(SBHUFFRSIZE, CJBig2_HuffmanTable(HuffmanTable_B1,
+ sizeof(HuffmanTable_B1) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B1));
+ if((pHuffmanDecoder->decodeAValue(SBHUFFRDX, &RDXI) != 0)
+ || (pHuffmanDecoder->decodeAValue(SBHUFFRDX, &RDYI) != 0)
+ || (pHuffmanDecoder->decodeAValue(SBHUFFRSIZE, &nVal) != 0)) {
+ delete SBHUFFRDX;
+ delete SBHUFFRSIZE;
+ m_pModule->JBig2_Error("symbol dictionary decoding procedure (huffman): too short.");
+ goto failed;
+ }
+ delete SBHUFFRDX;
+ delete SBHUFFRSIZE;
+ pStream->alignByte();
+ nTmp = pStream->getOffset();
+ SBSYMS = (CJBig2_Image**)m_pModule->JBig2_Malloc2(SBNUMSYMS, sizeof(CJBig2_Image*));
+ JBIG2_memcpy(SBSYMS, SDINSYMS, SDNUMINSYMS * sizeof(CJBig2_Image*));
+ JBIG2_memcpy(SBSYMS + SDNUMINSYMS, SDNEWSYMS, NSYMSDECODED * sizeof(CJBig2_Image*));
+ JBIG2_ALLOC(pGRRD, CJBig2_GRRDProc());
+ pGRRD->GRW = SYMWIDTH;
+ pGRRD->GRH = HCHEIGHT;
+ pGRRD->GRTEMPLATE = SDRTEMPLATE;
+ pGRRD->GRREFERENCE = SBSYMS[IDI];
+ pGRRD->GRREFERENCEDX = RDXI;
+ pGRRD->GRREFERENCEDY = RDYI;
+ pGRRD->TPGRON = 0;
+ pGRRD->GRAT[0] = SDRAT[0];
+ pGRRD->GRAT[1] = SDRAT[1];
+ pGRRD->GRAT[2] = SDRAT[2];
+ pGRRD->GRAT[3] = SDRAT[3];
+ JBIG2_ALLOC(pArithDecoder, CJBig2_ArithDecoder(pStream));
+ BS = pGRRD->decode(pArithDecoder, grContext);
+ if(BS == NULL) {
+ m_pModule->JBig2_Free(SBSYMS);
+ delete pGRRD;
+ delete pArithDecoder;
+ goto failed;
+ }
+ pStream->alignByte();
+ pStream->offset(2);
+ if((FX_DWORD)nVal != (pStream->getOffset() - nTmp)) {
+ delete BS;
+ m_pModule->JBig2_Free(SBSYMS);
+ delete pGRRD;
+ delete pArithDecoder;
+ m_pModule->JBig2_Error("symbol dictionary decoding procedure (huffman):"
+ "bytes processed by generic refinement region decoding procedure doesn't equal SBHUFFRSIZE.");
+ goto failed;
+ }
+ m_pModule->JBig2_Free(SBSYMS);
+ delete pGRRD;
+ delete pArithDecoder;
+ }
+ SDNEWSYMS[NSYMSDECODED] = BS;
+ }
+ if(SDREFAGG == 0) {
+ SDNEWSYMWIDTHS[NSYMSDECODED] = SYMWIDTH;
+ }
+ NSYMSDECODED = NSYMSDECODED + 1;
+ }
+ if(SDREFAGG == 0) {
+ if(pHuffmanDecoder->decodeAValue(SDHUFFBMSIZE, (FX_INT32*)&BMSIZE) != 0) {
+ m_pModule->JBig2_Error("symbol dictionary decoding procedure (huffman): too short.");
+ goto failed;
+ }
+ pStream->alignByte();
+ if(BMSIZE == 0) {
+ stride = (TOTWIDTH + 7) >> 3;
+ if(pStream->getByteLeft() >= stride * HCHEIGHT) {
+ JBIG2_ALLOC(BHC, CJBig2_Image(TOTWIDTH, HCHEIGHT));
+ for(I = 0; I < HCHEIGHT; I ++) {
+ JBIG2_memcpy(BHC->m_pData + I * BHC->m_nStride, pStream->getPointer(), stride);
+ pStream->offset(stride);
+ }
+ } else {
+ m_pModule->JBig2_Error("symbol dictionary decoding procedure (huffman): too short.");
+ goto failed;
+ }
+ } else {
+ JBIG2_ALLOC(pGRD, CJBig2_GRDProc());
+ pGRD->MMR = 1;
+ pGRD->GBW = TOTWIDTH;
+ pGRD->GBH = HCHEIGHT;
+ FXCODEC_STATUS status = pGRD->Start_decode_MMR(&BHC, pStream);
+ while(status == FXCODEC_STATUS_DECODE_TOBECONTINUE) {
+ pGRD->Continue_decode(pPause);
+ }
+ delete pGRD;
+ pStream->alignByte();
+ }
+ nTmp = 0;
+ if (!BHC) {
+ continue;
+ }
+ for(I = HCFIRSTSYM; I < NSYMSDECODED; I++) {
+ SDNEWSYMS[I] = BHC->subImage(nTmp, 0, SDNEWSYMWIDTHS[I], HCHEIGHT);
+ nTmp += SDNEWSYMWIDTHS[I];
+ }
+ delete BHC;
+ BHC = NULL;
+ }
+ }
+ EXINDEX = 0;
+ CUREXFLAG = 0;
+ JBIG2_ALLOC(pTable, CJBig2_HuffmanTable(HuffmanTable_B1,
+ sizeof(HuffmanTable_B1) / sizeof(JBig2TableLine), HuffmanTable_HTOOB_B1));
+ EXFLAGS = (FX_BOOL*)m_pModule->JBig2_Malloc2(sizeof(FX_BOOL), (SDNUMINSYMS + SDNUMNEWSYMS));
+ while(EXINDEX < SDNUMINSYMS + SDNUMNEWSYMS) {
+ if(pHuffmanDecoder->decodeAValue(pTable, (int*)&EXRUNLENGTH) != 0) {
+ delete pTable;
+ m_pModule->JBig2_Free(EXFLAGS);
+ m_pModule->JBig2_Error("symbol dictionary decoding procedure (huffman): too short.");
+ goto failed;
+ }
+ if (EXINDEX + EXRUNLENGTH > SDNUMINSYMS + SDNUMNEWSYMS) {
+ delete pTable;
+ m_pModule->JBig2_Free(EXFLAGS);
+ m_pModule->JBig2_Error("symbol dictionary decoding procedure (arith): Invalid EXRUNLENGTH value.");
+ goto failed;
+ }
+ if(EXRUNLENGTH != 0) {
+ for(I = EXINDEX; I < EXINDEX + EXRUNLENGTH; I++) {
+ EXFLAGS[I] = CUREXFLAG;
+ }
+ }
+ EXINDEX = EXINDEX + EXRUNLENGTH;
+ CUREXFLAG = !CUREXFLAG;
+ }
+ delete pTable;
+ JBIG2_ALLOC(pDict, CJBig2_SymbolDict());
+ pDict->SDNUMEXSYMS = SDNUMEXSYMS;
+ pDict->SDEXSYMS = (CJBig2_Image**)m_pModule->JBig2_Malloc2(sizeof(CJBig2_Image*), SDNUMEXSYMS);
+ I = J = 0;
+ for(I = 0; I < SDNUMINSYMS + SDNUMNEWSYMS; I++) {
+ if(EXFLAGS[I] && J < SDNUMEXSYMS) {
+ if(I < SDNUMINSYMS) {
+ JBIG2_ALLOC(pDict->SDEXSYMS[J], CJBig2_Image(*SDINSYMS[I]));
+ } else {
+ pDict->SDEXSYMS[J] = SDNEWSYMS[I - SDNUMINSYMS];
+ }
+ J = J + 1;
+ } else if (!EXFLAGS[I] && I >= SDNUMINSYMS) {
+ delete SDNEWSYMS[I - SDNUMINSYMS];
+ }
+ }
+ if (J < SDNUMEXSYMS) {
+ pDict->SDNUMEXSYMS = J;
+ }
+ m_pModule->JBig2_Free(EXFLAGS);
+ m_pModule->JBig2_Free(SDNEWSYMS);
+ if(SDREFAGG == 0) {
+ m_pModule->JBig2_Free(SDNEWSYMWIDTHS);
+ }
+ delete pHuffmanDecoder;
+ return pDict;
+failed:
+ for(I = 0; I < NSYMSDECODED; I++) {
+ if (SDNEWSYMS[I]) {
+ delete SDNEWSYMS[I];
+ }
+ }
+ m_pModule->JBig2_Free(SDNEWSYMS);
+ if(SDREFAGG == 0) {
+ m_pModule->JBig2_Free(SDNEWSYMWIDTHS);
+ }
+ delete pHuffmanDecoder;
+ return NULL;
+}
+CJBig2_Image *CJBig2_HTRDProc::decode_Arith(CJBig2_ArithDecoder *pArithDecoder,
+ JBig2ArithCtx *gbContext, IFX_Pause* pPause)
+{
+ FX_DWORD ng, mg;
+ FX_INT32 x, y;
+ CJBig2_Image *HSKIP;
+ FX_DWORD HBPP;
+ FX_DWORD *GI;
+ CJBig2_Image *HTREG;
+ CJBig2_GSIDProc *pGID;
+ JBIG2_ALLOC(HTREG, CJBig2_Image(HBW, HBH));
+ HTREG->fill(HDEFPIXEL);
+ HSKIP = NULL;
+ if(HENABLESKIP == 1) {
+ JBIG2_ALLOC(HSKIP, CJBig2_Image(HGW, HGH));
+ for(mg = 0; mg < HGH; mg++) {
+ for(ng = 0; ng < HGW; ng++) {
+ x = (HGX + mg * HRY + ng * HRX) >> 8;
+ y = (HGY + mg * HRX - ng * HRY) >> 8;
+ if((x + HPW <= 0) | (x >= (FX_INT32)HBW)
+ | (y + HPH <= 0) | (y >= (FX_INT32)HPH)) {
+ HSKIP->setPixel(ng, mg, 1);
+ } else {
+ HSKIP->setPixel(ng, mg, 0);
+ }
+ }
+ }
+ }
+ HBPP = 1;
+ while((FX_DWORD)(1 << HBPP) < HNUMPATS) {
+ HBPP ++;
+ }
+ JBIG2_ALLOC(pGID, CJBig2_GSIDProc());
+ pGID->GSMMR = HMMR;
+ pGID->GSW = HGW;
+ pGID->GSH = HGH;
+ pGID->GSBPP = (FX_BYTE)HBPP;
+ pGID->GSUSESKIP = HENABLESKIP;
+ pGID->GSKIP = HSKIP;
+ pGID->GSTEMPLATE = HTEMPLATE;
+ GI = pGID->decode_Arith(pArithDecoder, gbContext, pPause);
+ if(GI == NULL) {
+ goto failed;
+ }
+ for(mg = 0; mg < HGH; mg++) {
+ for(ng = 0; ng < HGW; ng++) {
+ x = (HGX + mg * HRY + ng * HRX) >> 8;
+ y = (HGY + mg * HRX - ng * HRY) >> 8;
+ FX_DWORD pat_index = GI[mg * HGW + ng];
+ if (pat_index >= HNUMPATS) {
+ pat_index = HNUMPATS - 1;
+ }
+ HTREG->composeFrom(x, y, HPATS[pat_index], HCOMBOP);
+ }
+ }
+ m_pModule->JBig2_Free(GI);
+ if(HSKIP) {
+ delete HSKIP;
+ }
+ delete pGID;
+ return HTREG;
+failed:
+ if(HSKIP) {
+ delete HSKIP;
+ }
+ delete pGID;
+ delete HTREG;
+ return NULL;
+}
+CJBig2_Image *CJBig2_HTRDProc::decode_MMR(CJBig2_BitStream *pStream, IFX_Pause* pPause)
+{
+ FX_DWORD ng, mg;
+ FX_INT32 x, y;
+ FX_DWORD HBPP;
+ FX_DWORD *GI;
+ CJBig2_Image *HTREG;
+ CJBig2_GSIDProc *pGID;
+ JBIG2_ALLOC(HTREG, CJBig2_Image(HBW, HBH));
+ HTREG->fill(HDEFPIXEL);
+ HBPP = 1;
+ while((FX_DWORD)(1 << HBPP) < HNUMPATS) {
+ HBPP ++;
+ }
+ JBIG2_ALLOC(pGID, CJBig2_GSIDProc());
+ pGID->GSMMR = HMMR;
+ pGID->GSW = HGW;
+ pGID->GSH = HGH;
+ pGID->GSBPP = (FX_BYTE)HBPP;
+ pGID->GSUSESKIP = 0;
+ GI = pGID->decode_MMR(pStream, pPause);
+ if(GI == NULL) {
+ goto failed;
+ }
+ for(mg = 0; mg < HGH; mg++) {
+ for(ng = 0; ng < HGW; ng++) {
+ x = (HGX + mg * HRY + ng * HRX) >> 8;
+ y = (HGY + mg * HRX - ng * HRY) >> 8;
+ FX_DWORD pat_index = GI[mg * HGW + ng];
+ if (pat_index >= HNUMPATS) {
+ pat_index = HNUMPATS - 1;
+ }
+ HTREG->composeFrom(x, y, HPATS[pat_index], HCOMBOP);
+ }
+ }
+ m_pModule->JBig2_Free(GI);
+ delete pGID;
+ return HTREG;
+failed:
+ delete pGID;
+ delete HTREG;
+ return NULL;
+}
+CJBig2_PatternDict *CJBig2_PDDProc::decode_Arith(CJBig2_ArithDecoder *pArithDecoder,
+ JBig2ArithCtx *gbContext, IFX_Pause* pPause)
+{
+ FX_DWORD GRAY;
+ CJBig2_Image *BHDC = NULL;
+ CJBig2_PatternDict *pDict;
+ CJBig2_GRDProc *pGRD;
+ JBIG2_ALLOC(pDict, CJBig2_PatternDict());
+ pDict->NUMPATS = GRAYMAX + 1;
+ pDict->HDPATS = (CJBig2_Image**)m_pModule->JBig2_Malloc2(sizeof(CJBig2_Image*), pDict->NUMPATS);
+ JBIG2_memset(pDict->HDPATS, 0, sizeof(CJBig2_Image*)*pDict->NUMPATS);
+ JBIG2_ALLOC(pGRD, CJBig2_GRDProc());
+ pGRD->MMR = HDMMR;
+ pGRD->GBW = (GRAYMAX + 1) * HDPW;
+ pGRD->GBH = HDPH;
+ pGRD->GBTEMPLATE = HDTEMPLATE;
+ pGRD->TPGDON = 0;
+ pGRD->USESKIP = 0;
+ pGRD->GBAT[0] = -(FX_INT32)HDPW;
+ pGRD->GBAT[1] = 0;
+ if(pGRD->GBTEMPLATE == 0) {
+ pGRD->GBAT[2] = -3;
+ pGRD->GBAT[3] = -1;
+ pGRD->GBAT[4] = 2;
+ pGRD->GBAT[5] = -2;
+ pGRD->GBAT[6] = -2;
+ pGRD->GBAT[7] = -2;
+ }
+ FXCODEC_STATUS status = pGRD->Start_decode_Arith(&BHDC, pArithDecoder, gbContext);
+ while(status == FXCODEC_STATUS_DECODE_TOBECONTINUE) {
+ pGRD->Continue_decode(pPause);
+ }
+ if(BHDC == NULL) {
+ delete pGRD;
+ goto failed;
+ }
+ delete pGRD;
+ GRAY = 0;
+ while(GRAY <= GRAYMAX) {
+ pDict->HDPATS[GRAY] = BHDC->subImage(HDPW * GRAY, 0, HDPW, HDPH);
+ GRAY = GRAY + 1;
+ }
+ delete BHDC;
+ return pDict;
+failed:
+ delete pDict;
+ return NULL;
+}
+
+CJBig2_PatternDict *CJBig2_PDDProc::decode_MMR(CJBig2_BitStream *pStream, IFX_Pause* pPause)
+{
+ FX_DWORD GRAY;
+ CJBig2_Image *BHDC = NULL;
+ CJBig2_PatternDict *pDict;
+ CJBig2_GRDProc *pGRD;
+ JBIG2_ALLOC(pDict, CJBig2_PatternDict());
+ pDict->NUMPATS = GRAYMAX + 1;
+ pDict->HDPATS = (CJBig2_Image**)m_pModule->JBig2_Malloc2(sizeof(CJBig2_Image*), pDict->NUMPATS);
+ JBIG2_memset(pDict->HDPATS, 0, sizeof(CJBig2_Image*)*pDict->NUMPATS);
+ JBIG2_ALLOC(pGRD, CJBig2_GRDProc());
+ pGRD->MMR = HDMMR;
+ pGRD->GBW = (GRAYMAX + 1) * HDPW;
+ pGRD->GBH = HDPH;
+ FXCODEC_STATUS status = pGRD->Start_decode_MMR(&BHDC, pStream);
+ while(status == FXCODEC_STATUS_DECODE_TOBECONTINUE) {
+ pGRD->Continue_decode(pPause);
+ }
+ if(BHDC == NULL) {
+ delete pGRD;
+ goto failed;
+ }
+ delete pGRD;
+ GRAY = 0;
+ while(GRAY <= GRAYMAX) {
+ pDict->HDPATS[GRAY] = BHDC->subImage(HDPW * GRAY, 0, HDPW, HDPH);
+ GRAY = GRAY + 1;
+ }
+ delete BHDC;
+ return pDict;
+failed:
+ delete pDict;
+ return NULL;
+}
+FX_DWORD *CJBig2_GSIDProc::decode_Arith(CJBig2_ArithDecoder *pArithDecoder,
+ JBig2ArithCtx *gbContext, IFX_Pause* pPause)
+{
+ CJBig2_Image **GSPLANES;
+ FX_INT32 J, K;
+ FX_DWORD x, y;
+ FX_DWORD *GSVALS;
+ CJBig2_GRDProc *pGRD;
+ GSPLANES = (CJBig2_Image **)m_pModule->JBig2_Malloc2(sizeof(CJBig2_Image*), GSBPP);
+ if (!GSPLANES) {
+ return NULL;
+ }
+ GSVALS = (FX_DWORD*)m_pModule->JBig2_Malloc3(sizeof(FX_DWORD), GSW, GSH);
+ if (!GSVALS) {
+ m_pModule->JBig2_Free(GSPLANES);
+ return NULL;
+ }
+ JBIG2_memset(GSPLANES, 0, sizeof(CJBig2_Image*)*GSBPP);
+ JBIG2_memset(GSVALS, 0, sizeof(FX_DWORD)*GSW * GSH);
+ JBIG2_ALLOC(pGRD, CJBig2_GRDProc());
+ pGRD->MMR = GSMMR;
+ pGRD->GBW = GSW;
+ pGRD->GBH = GSH;
+ pGRD->GBTEMPLATE = GSTEMPLATE;
+ pGRD->TPGDON = 0;
+ pGRD->USESKIP = GSUSESKIP;
+ pGRD->SKIP = GSKIP;
+ if(GSTEMPLATE <= 1) {
+ pGRD->GBAT[0] = 3;
+ } else {
+ pGRD->GBAT[0] = 2;
+ }
+ pGRD->GBAT[1] = -1;
+ if(pGRD->GBTEMPLATE == 0) {
+ pGRD->GBAT[2] = -3;
+ pGRD->GBAT[3] = -1;
+ pGRD->GBAT[4] = 2;
+ pGRD->GBAT[5] = -2;
+ pGRD->GBAT[6] = -2;
+ pGRD->GBAT[7] = -2;
+ }
+ FXCODEC_STATUS status = pGRD->Start_decode_Arith(&GSPLANES[GSBPP - 1], pArithDecoder, gbContext);
+ while(status == FXCODEC_STATUS_DECODE_TOBECONTINUE) {
+ pGRD->Continue_decode(pPause);
+ }
+ if(GSPLANES[GSBPP - 1] == NULL) {
+ goto failed;
+ }
+ J = GSBPP - 2;
+ while(J >= 0) {
+ FXCODEC_STATUS status = pGRD->Start_decode_Arith(&GSPLANES[J], pArithDecoder, gbContext);
+ while(status == FXCODEC_STATUS_DECODE_TOBECONTINUE) {
+ pGRD->Continue_decode(pPause);
+ }
+ if(GSPLANES[J] == NULL) {
+ for(K = GSBPP - 1; K > J; K--) {
+ delete GSPLANES[K];
+ goto failed;
+ }
+ }
+ GSPLANES[J]->composeFrom(0, 0, GSPLANES[J + 1], JBIG2_COMPOSE_XOR);
+ J = J - 1;
+ }
+ for(y = 0; y < GSH; y++) {
+ for(x = 0; x < GSW; x++) {
+ for(J = 0; J < GSBPP; J++) {
+ GSVALS[y * GSW + x] |= GSPLANES[J]->getPixel(x, y) << J;
+ }
+ }
+ }
+ for(J = 0; J < GSBPP; J++) {
+ delete GSPLANES[J];
+ }
+ m_pModule->JBig2_Free(GSPLANES);
+ delete pGRD;
+ return GSVALS;
+failed:
+ m_pModule->JBig2_Free(GSPLANES);
+ delete pGRD;
+ m_pModule->JBig2_Free(GSVALS);
+ return NULL;
+}
+FX_DWORD *CJBig2_GSIDProc::decode_MMR(CJBig2_BitStream *pStream, IFX_Pause* pPause)
+{
+ CJBig2_Image **GSPLANES;
+ FX_INT32 J, K;
+ FX_DWORD x, y;
+ FX_DWORD *GSVALS;
+ CJBig2_GRDProc *pGRD;
+ GSPLANES = (CJBig2_Image **)m_pModule->JBig2_Malloc2(sizeof(CJBig2_Image*), GSBPP);
+ if (!GSPLANES) {
+ return NULL;
+ }
+ GSVALS = (FX_DWORD*)m_pModule->JBig2_Malloc3(sizeof(FX_DWORD), GSW, GSH);
+ if (!GSVALS) {
+ if (GSPLANES) {
+ m_pModule->JBig2_Free(GSPLANES);
+ }
+ return NULL;
+ }
+ JBIG2_memset(GSPLANES, 0, sizeof(CJBig2_Image*)*GSBPP);
+ JBIG2_memset(GSVALS, 0, sizeof(FX_DWORD)*GSW * GSH);
+ JBIG2_ALLOC(pGRD, CJBig2_GRDProc());
+ pGRD->MMR = GSMMR;
+ pGRD->GBW = GSW;
+ pGRD->GBH = GSH;
+ FXCODEC_STATUS status = pGRD->Start_decode_MMR(&GSPLANES[GSBPP - 1], pStream);
+ while(status == FXCODEC_STATUS_DECODE_TOBECONTINUE) {
+ pGRD->Continue_decode(pPause);
+ }
+ if(GSPLANES[GSBPP - 1] == NULL) {
+ goto failed;
+ }
+ pStream->alignByte();
+ pStream->offset(3);
+ J = GSBPP - 2;
+ while(J >= 0) {
+ FXCODEC_STATUS status = pGRD->Start_decode_MMR(&GSPLANES[J], pStream);
+ while(status == FXCODEC_STATUS_DECODE_TOBECONTINUE) {
+ pGRD->Continue_decode(pPause);
+ }
+ if(GSPLANES[J] == NULL) {
+ for(K = GSBPP - 1; K > J; K--) {
+ delete GSPLANES[K];
+ goto failed;
+ }
+ }
+ pStream->alignByte();
+ pStream->offset(3);
+ GSPLANES[J]->composeFrom(0, 0, GSPLANES[J + 1], JBIG2_COMPOSE_XOR);
+ J = J - 1;
+ }
+ for(y = 0; y < GSH; y++) {
+ for(x = 0; x < GSW; x++) {
+ for(J = 0; J < GSBPP; J++) {
+ GSVALS[y * GSW + x] |= GSPLANES[J]->getPixel(x, y) << J;
+ }
+ }
+ }
+ for(J = 0; J < GSBPP; J++) {
+ delete GSPLANES[J];
+ }
+ m_pModule->JBig2_Free(GSPLANES);
+ delete pGRD;
+ return GSVALS;
+failed:
+ m_pModule->JBig2_Free(GSPLANES);
+ delete pGRD;
+ m_pModule->JBig2_Free(GSVALS);
+ return NULL;
+}
+FXCODEC_STATUS CJBig2_GRDProc::Start_decode_Arith(CJBig2_Image** pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause)
+{
+ if (GBW == 0 || GBH == 0) {
+ m_ProssiveStatus = FXCODEC_STATUS_DECODE_FINISH;
+ return FXCODEC_STATUS_DECODE_FINISH;
+ }
+ m_ProssiveStatus = FXCODEC_STATUS_DECODE_READY;
+ m_pPause = pPause;
+ if(*pImage == NULL) {
+ JBIG2_ALLOC((*pImage), CJBig2_Image(GBW, GBH));
+ }
+ if ((*pImage)->m_pData == NULL) {
+ delete *pImage;
+ *pImage = NULL;
+ m_pModule->JBig2_Error("Generic region decoding procedure: Create Image Failed with width = %d, height = %d\n", GBW, GBH);
+ m_ProssiveStatus = FXCODEC_STATUS_ERROR;
+ return FXCODEC_STATUS_ERROR;
+ }
+ m_DecodeType = 1;
+ m_pImage = pImage;
+ (*m_pImage)->fill(0);
+ m_pArithDecoder = pArithDecoder;
+ m_gbContext = gbContext;
+ LTP = 0;
+ m_pLine = NULL;
+ m_loopIndex = 0;
+ return decode_Arith(pPause);
+}
+FXCODEC_STATUS CJBig2_GRDProc::decode_Arith(IFX_Pause* pPause)
+{
+ int iline = m_loopIndex;
+ CJBig2_Image* pImage = *m_pImage;
+ if(GBTEMPLATE == 0) {
+ if((GBAT[0] == 3) && (GBAT[1] == (signed char) - 1)
+ && (GBAT[2] == (signed char) - 3) && (GBAT[3] == (signed char) - 1)
+ && (GBAT[4] == 2) && (GBAT[5] == (signed char) - 2)
+ && (GBAT[6] == (signed char) - 2) && (GBAT[7] == (signed char) - 2)) {
+ m_ProssiveStatus = decode_Arith_Template0_opt3(pImage, m_pArithDecoder, m_gbContext, pPause);
+ } else {
+ m_ProssiveStatus = decode_Arith_Template0_unopt(pImage, m_pArithDecoder, m_gbContext, pPause);
+ }
+ } else if(GBTEMPLATE == 1) {
+ if((GBAT[0] == 3) && (GBAT[1] == (signed char) - 1)) {
+ m_ProssiveStatus = decode_Arith_Template1_opt3(pImage, m_pArithDecoder, m_gbContext, pPause);
+ } else {
+ m_ProssiveStatus = decode_Arith_Template1_unopt(pImage, m_pArithDecoder, m_gbContext, pPause);
+ }
+ } else if(GBTEMPLATE == 2) {
+ if((GBAT[0] == 2) && (GBAT[1] == (signed char) - 1)) {
+ m_ProssiveStatus = decode_Arith_Template2_opt3(pImage, m_pArithDecoder, m_gbContext, pPause);
+ } else {
+ m_ProssiveStatus = decode_Arith_Template2_unopt(pImage, m_pArithDecoder, m_gbContext, pPause);
+ }
+ } else {
+ if((GBAT[0] == 2) && (GBAT[1] == (signed char) - 1)) {
+ m_ProssiveStatus = decode_Arith_Template3_opt3(pImage, m_pArithDecoder, m_gbContext, pPause);
+ } else {
+ m_ProssiveStatus = decode_Arith_Template3_unopt(pImage, m_pArithDecoder, m_gbContext, pPause);
+ }
+ }
+ m_ReplaceRect.left = 0;
+ m_ReplaceRect.right = pImage->m_nWidth;
+ m_ReplaceRect.top = iline;
+ m_ReplaceRect.bottom = m_loopIndex;
+ if(m_ProssiveStatus == FXCODEC_STATUS_DECODE_FINISH) {
+ m_loopIndex = 0;
+ }
+ return m_ProssiveStatus;
+}
+FXCODEC_STATUS CJBig2_GRDProc::Start_decode_Arith_V2(CJBig2_Image** pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause)
+{
+ if(GBW == 0 || GBH == 0) {
+ * pImage = NULL;
+ m_ProssiveStatus = FXCODEC_STATUS_DECODE_FINISH;
+ return FXCODEC_STATUS_DECODE_FINISH;
+ }
+ if(*pImage == NULL) {
+ JBIG2_ALLOC((*pImage), CJBig2_Image(GBW, GBH));
+ }
+ if ((*pImage)->m_pData == NULL) {
+ delete *pImage;
+ *pImage = NULL;
+ m_pModule->JBig2_Error("Generic region decoding procedure: Create Image Failed with width = %d, height = %d\n", GBW, GBH);
+ m_ProssiveStatus = FXCODEC_STATUS_ERROR;
+ return FXCODEC_STATUS_ERROR;
+ }
+ m_ProssiveStatus = FXCODEC_STATUS_DECODE_READY;
+ m_DecodeType = 2;
+ m_pPause = pPause;
+ m_pImage = pImage;
+ (*m_pImage)->fill(0);
+ LTP = 0;
+ m_loopIndex = 0;
+ m_pArithDecoder = pArithDecoder;
+ m_gbContext = gbContext;
+ return decode_Arith_V2(pPause);
+}
+FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_V2(IFX_Pause* pPause)
+{
+ FX_BOOL SLTP, bVal;
+ FX_DWORD CONTEXT;
+ CJBig2_Image *GBREG = *m_pImage;
+ FX_DWORD line1, line2, line3;
+ LTP = 0;
+ JBIG2_ALLOC(GBREG, CJBig2_Image(GBW, GBH));
+ GBREG->fill(0);
+ for(; m_loopIndex < GBH; m_loopIndex++) {
+ if(TPGDON) {
+ switch(GBTEMPLATE) {
+ case 0:
+ CONTEXT = 0x9b25;
+ break;
+ case 1:
+ CONTEXT = 0x0795;
+ break;
+ case 2:
+ CONTEXT = 0x00e5;
+ break;
+ case 3:
+ CONTEXT = 0x0195;
+ break;
+ }
+ SLTP = m_pArithDecoder->DECODE(&m_gbContext[CONTEXT]);
+ LTP = LTP ^ SLTP;
+ }
+ if(LTP == 1) {
+ GBREG->copyLine(m_loopIndex, m_loopIndex - 1);
+ } else {
+ switch(GBTEMPLATE) {
+ case 0: {
+ line1 = GBREG->getPixel(1, m_loopIndex - 2);
+ line1 |= GBREG->getPixel(0, m_loopIndex - 2) << 1;
+ line2 = GBREG->getPixel(2, m_loopIndex - 1);
+ line2 |= GBREG->getPixel(1, m_loopIndex - 1) << 1;
+ line2 |= GBREG->getPixel(0, m_loopIndex - 1) << 2;
+ line3 = 0;
+ for(FX_DWORD w = 0; w < GBW; w++) {
+ if(USESKIP && SKIP->getPixel(w, m_loopIndex)) {
+ bVal = 0;
+ } else {
+ CONTEXT = line3;
+ CONTEXT |= GBREG->getPixel(w + GBAT[0], m_loopIndex + GBAT[1]) << 4;
+ CONTEXT |= line2 << 5;
+ CONTEXT |= GBREG->getPixel(w + GBAT[2], m_loopIndex + GBAT[3]) << 10;
+ CONTEXT |= GBREG->getPixel(w + GBAT[4], m_loopIndex + GBAT[5]) << 11;
+ CONTEXT |= line1 << 12;
+ CONTEXT |= GBREG->getPixel(w + GBAT[6], m_loopIndex + GBAT[7]) << 15;
+ bVal = m_pArithDecoder->DECODE(&m_gbContext[CONTEXT]);
+ }
+ if(bVal) {
+ GBREG->setPixel(w, m_loopIndex, bVal);
+ }
+ line1 = ((line1 << 1) | GBREG->getPixel(w + 2, m_loopIndex - 2)) & 0x07;
+ line2 = ((line2 << 1) | GBREG->getPixel(w + 3, m_loopIndex - 1)) & 0x1f;
+ line3 = ((line3 << 1) | bVal) & 0x0f;
+ }
+ }
+ break;
+ case 1: {
+ line1 = GBREG->getPixel(2, m_loopIndex - 2);
+ line1 |= GBREG->getPixel(1, m_loopIndex - 2) << 1;
+ line1 |= GBREG->getPixel(0, m_loopIndex - 2) << 2;
+ line2 = GBREG->getPixel(2, m_loopIndex - 1);
+ line2 |= GBREG->getPixel(1, m_loopIndex - 1) << 1;
+ line2 |= GBREG->getPixel(0, m_loopIndex - 1) << 2;
+ line3 = 0;
+ for(FX_DWORD w = 0; w < GBW; w++) {
+ if(USESKIP && SKIP->getPixel(w, m_loopIndex)) {
+ bVal = 0;
+ } else {
+ CONTEXT = line3;
+ CONTEXT |= GBREG->getPixel(w + GBAT[0], m_loopIndex + GBAT[1]) << 3;
+ CONTEXT |= line2 << 4;
+ CONTEXT |= line1 << 9;
+ bVal = m_pArithDecoder->DECODE(&m_gbContext[CONTEXT]);
+ }
+ if(bVal) {
+ GBREG->setPixel(w, m_loopIndex, bVal);
+ }
+ line1 = ((line1 << 1) | GBREG->getPixel(w + 3, m_loopIndex - 2)) & 0x0f;
+ line2 = ((line2 << 1) | GBREG->getPixel(w + 3, m_loopIndex - 1)) & 0x1f;
+ line3 = ((line3 << 1) | bVal) & 0x07;
+ }
+ }
+ break;
+ case 2: {
+ line1 = GBREG->getPixel(1, m_loopIndex - 2);
+ line1 |= GBREG->getPixel(0, m_loopIndex - 2) << 1;
+ line2 = GBREG->getPixel(1, m_loopIndex - 1);
+ line2 |= GBREG->getPixel(0, m_loopIndex - 1) << 1;
+ line3 = 0;
+ for(FX_DWORD w = 0; w < GBW; w++) {
+ if(USESKIP && SKIP->getPixel(w, m_loopIndex)) {
+ bVal = 0;
+ } else {
+ CONTEXT = line3;
+ CONTEXT |= GBREG->getPixel(w + GBAT[0], m_loopIndex + GBAT[1]) << 2;
+ CONTEXT |= line2 << 3;
+ CONTEXT |= line1 << 7;
+ bVal = m_pArithDecoder->DECODE(&m_gbContext[CONTEXT]);
+ }
+ if(bVal) {
+ GBREG->setPixel(w, m_loopIndex, bVal);
+ }
+ line1 = ((line1 << 1) | GBREG->getPixel(w + 2, m_loopIndex - 2)) & 0x07;
+ line2 = ((line2 << 1) | GBREG->getPixel(w + 2, m_loopIndex - 1)) & 0x0f;
+ line3 = ((line3 << 1) | bVal) & 0x03;
+ }
+ }
+ break;
+ case 3: {
+ line1 = GBREG->getPixel(1, m_loopIndex - 1);
+ line1 |= GBREG->getPixel(0, m_loopIndex - 1) << 1;
+ line2 = 0;
+ for(FX_DWORD w = 0; w < GBW; w++) {
+ if(USESKIP && SKIP->getPixel(w, m_loopIndex)) {
+ bVal = 0;
+ } else {
+ CONTEXT = line2;
+ CONTEXT |= GBREG->getPixel(w + GBAT[0], m_loopIndex + GBAT[1]) << 4;
+ CONTEXT |= line1 << 5;
+ bVal = m_pArithDecoder->DECODE(&m_gbContext[CONTEXT]);
+ }
+ if(bVal) {
+ GBREG->setPixel(w, m_loopIndex, bVal);
+ }
+ line1 = ((line1 << 1) | GBREG->getPixel(w + 2, m_loopIndex - 1)) & 0x1f;
+ line2 = ((line2 << 1) | bVal) & 0x0f;
+ }
+ }
+ break;
+ }
+ }
+ if(pPause && pPause->NeedToPauseNow()) {
+ m_loopIndex ++;
+ m_ProssiveStatus = FXCODEC_STATUS_DECODE_TOBECONTINUE;
+ return FXCODEC_STATUS_DECODE_TOBECONTINUE;
+ }
+ }
+ m_ProssiveStatus = FXCODEC_STATUS_DECODE_FINISH;
+ return FXCODEC_STATUS_DECODE_FINISH;
+}
+FXCODEC_STATUS CJBig2_GRDProc::Start_decode_Arith_V1(CJBig2_Image** pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause)
+{
+ if(GBW == 0 || GBH == 0) {
+ * pImage = NULL;
+ m_ProssiveStatus = FXCODEC_STATUS_DECODE_FINISH;
+ return FXCODEC_STATUS_DECODE_FINISH;
+ }
+ if(*pImage == NULL) {
+ JBIG2_ALLOC((*pImage), CJBig2_Image(GBW, GBH));
+ }
+ if ((*pImage)->m_pData == NULL) {
+ delete *pImage;
+ *pImage = NULL;
+ m_pModule->JBig2_Error("Generic region decoding procedure: Create Image Failed with width = %d, height = %d\n", GBW, GBH);
+ m_ProssiveStatus = FXCODEC_STATUS_ERROR;
+ return FXCODEC_STATUS_ERROR;
+ }
+ m_ProssiveStatus = FXCODEC_STATUS_DECODE_READY;
+ m_pPause = pPause;
+ m_pImage = pImage;
+ m_DecodeType = 3;
+ (*m_pImage)->fill(0);
+ LTP = 0;
+ m_loopIndex = 0;
+ m_pArithDecoder = pArithDecoder;
+ m_gbContext = gbContext;
+ return decode_Arith_V1(pPause);
+}
+FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_V1(IFX_Pause* pPause)
+{
+ FX_BOOL SLTP, bVal;
+ FX_DWORD CONTEXT = 0;
+ CJBig2_Image *GBREG = (*m_pImage);
+ for(; m_loopIndex < GBH; m_loopIndex++) {
+ if(TPGDON) {
+ switch(GBTEMPLATE) {
+ case 0:
+ CONTEXT = 0x9b25;
+ break;
+ case 1:
+ CONTEXT = 0x0795;
+ break;
+ case 2:
+ CONTEXT = 0x00e5;
+ break;
+ case 3:
+ CONTEXT = 0x0195;
+ break;
+ }
+ SLTP = m_pArithDecoder->DECODE(&m_gbContext[CONTEXT]);
+ LTP = LTP ^ SLTP;
+ }
+ if(LTP == 1) {
+ for(FX_DWORD w = 0; w < GBW; w++) {
+ GBREG->setPixel(w, m_loopIndex, GBREG->getPixel(w, m_loopIndex - 1));
+ }
+ } else {
+ for(FX_DWORD w = 0; w < GBW; w++) {
+ if(USESKIP && SKIP->getPixel(w, m_loopIndex)) {
+ GBREG->setPixel(w, m_loopIndex, 0);
+ } else {
+ CONTEXT = 0;
+ switch(GBTEMPLATE) {
+ case 0:
+ CONTEXT |= GBREG->getPixel(w - 1, m_loopIndex);
+ CONTEXT |= GBREG->getPixel(w - 2, m_loopIndex) << 1;
+ CONTEXT |= GBREG->getPixel(w - 3, m_loopIndex) << 2;
+ CONTEXT |= GBREG->getPixel(w - 4, m_loopIndex) << 3;
+ CONTEXT |= GBREG->getPixel(w + GBAT[0], m_loopIndex + GBAT[1]) << 4;
+ CONTEXT |= GBREG->getPixel(w + 2, m_loopIndex - 1) << 5;
+ CONTEXT |= GBREG->getPixel(w + 1, m_loopIndex - 1) << 6;
+ CONTEXT |= GBREG->getPixel(w, m_loopIndex - 1) << 7;
+ CONTEXT |= GBREG->getPixel(w - 1, m_loopIndex - 1) << 8;
+ CONTEXT |= GBREG->getPixel(w - 2, m_loopIndex - 1) << 9;
+ CONTEXT |= GBREG->getPixel(w + GBAT[2], m_loopIndex + GBAT[3]) << 10;
+ CONTEXT |= GBREG->getPixel(w + GBAT[4], m_loopIndex + GBAT[5]) << 11;
+ CONTEXT |= GBREG->getPixel(w + 1, m_loopIndex - 2) << 12;
+ CONTEXT |= GBREG->getPixel(w, m_loopIndex - 2) << 13;
+ CONTEXT |= GBREG->getPixel(w - 1, m_loopIndex - 2) << 14;
+ CONTEXT |= GBREG->getPixel(w + GBAT[6], m_loopIndex + GBAT[7]) << 15;
+ break;
+ case 1:
+ CONTEXT |= GBREG->getPixel(w - 1, m_loopIndex);
+ CONTEXT |= GBREG->getPixel(w - 2, m_loopIndex) << 1;
+ CONTEXT |= GBREG->getPixel(w - 3, m_loopIndex) << 2;
+ CONTEXT |= GBREG->getPixel(w + GBAT[0], m_loopIndex + GBAT[1]) << 3;
+ CONTEXT |= GBREG->getPixel(w + 2, m_loopIndex - 1) << 4;
+ CONTEXT |= GBREG->getPixel(w + 1, m_loopIndex - 1) << 5;
+ CONTEXT |= GBREG->getPixel(w, m_loopIndex - 1) << 6;
+ CONTEXT |= GBREG->getPixel(w - 1, m_loopIndex - 1) << 7;
+ CONTEXT |= GBREG->getPixel(w - 2, m_loopIndex - 1) << 8;
+ CONTEXT |= GBREG->getPixel(w + 2, m_loopIndex - 2) << 9;
+ CONTEXT |= GBREG->getPixel(w + 1, m_loopIndex - 2) << 10;
+ CONTEXT |= GBREG->getPixel(w, m_loopIndex - 2) << 11;
+ CONTEXT |= GBREG->getPixel(w - 1, m_loopIndex - 2) << 12;
+ break;
+ case 2:
+ CONTEXT |= GBREG->getPixel(w - 1, m_loopIndex);
+ CONTEXT |= GBREG->getPixel(w - 2, m_loopIndex) << 1;
+ CONTEXT |= GBREG->getPixel(w + GBAT[0], m_loopIndex + GBAT[1]) << 2;
+ CONTEXT |= GBREG->getPixel(w + 1, m_loopIndex - 1) << 3;
+ CONTEXT |= GBREG->getPixel(w, m_loopIndex - 1) << 4;
+ CONTEXT |= GBREG->getPixel(w - 1, m_loopIndex - 1) << 5;
+ CONTEXT |= GBREG->getPixel(w - 2, m_loopIndex - 1) << 6;
+ CONTEXT |= GBREG->getPixel(w + 1, m_loopIndex - 2) << 7;
+ CONTEXT |= GBREG->getPixel(w, m_loopIndex - 2) << 8;
+ CONTEXT |= GBREG->getPixel(w - 1, m_loopIndex - 2) << 9;
+ break;
+ case 3:
+ CONTEXT |= GBREG->getPixel(w - 1, m_loopIndex);
+ CONTEXT |= GBREG->getPixel(w - 2, m_loopIndex) << 1;
+ CONTEXT |= GBREG->getPixel(w - 3, m_loopIndex) << 2;
+ CONTEXT |= GBREG->getPixel(w - 4, m_loopIndex) << 3;
+ CONTEXT |= GBREG->getPixel(w + GBAT[0], m_loopIndex + GBAT[1]) << 4;
+ CONTEXT |= GBREG->getPixel(w + 1, m_loopIndex - 1) << 5;
+ CONTEXT |= GBREG->getPixel(w, m_loopIndex - 1) << 6;
+ CONTEXT |= GBREG->getPixel(w - 1, m_loopIndex - 1) << 7;
+ CONTEXT |= GBREG->getPixel(w - 2, m_loopIndex - 1) << 8;
+ CONTEXT |= GBREG->getPixel(w - 3, m_loopIndex - 1) << 9;
+ break;
+ }
+ bVal = m_pArithDecoder->DECODE(&m_gbContext[CONTEXT]);
+ GBREG->setPixel(w, m_loopIndex, bVal);
+ }
+ }
+ }
+ if(pPause && pPause->NeedToPauseNow()) {
+ m_loopIndex ++;
+ m_ProssiveStatus = FXCODEC_STATUS_DECODE_TOBECONTINUE;
+ return FXCODEC_STATUS_DECODE_TOBECONTINUE;
+ }
+ }
+ m_ProssiveStatus = FXCODEC_STATUS_DECODE_FINISH;
+ return FXCODEC_STATUS_DECODE_FINISH;
+}
+FXCODEC_STATUS CJBig2_GRDProc::Start_decode_MMR(CJBig2_Image** pImage, CJBig2_BitStream *pStream, IFX_Pause* pPause)
+{
+ int bitpos, i;
+ JBIG2_ALLOC((* pImage), CJBig2_Image(GBW, GBH));
+ if ((* pImage)->m_pData == NULL) {
+ delete (* pImage);
+ (* pImage) = NULL;
+ m_pModule->JBig2_Error("Generic region decoding procedure: Create Image Failed with width = %d, height = %d\n", GBW, GBH);
+ m_ProssiveStatus = FXCODEC_STATUS_ERROR;
+ return m_ProssiveStatus;
+ }
+ bitpos = (int)pStream->getBitPos();
+ _FaxG4Decode(m_pModule, pStream->getBuf(), pStream->getLength(), &bitpos, (* pImage)->m_pData, GBW, GBH, (* pImage)->m_nStride);
+ pStream->setBitPos(bitpos);
+ for(i = 0; (FX_DWORD)i < (* pImage)->m_nStride * GBH; i++) {
+ (* pImage)->m_pData[i] = ~(* pImage)->m_pData[i];
+ }
+ m_ProssiveStatus = FXCODEC_STATUS_DECODE_FINISH;
+ return m_ProssiveStatus;
+}
+FXCODEC_STATUS CJBig2_GRDProc::decode_MMR()
+{
+ return m_ProssiveStatus;
+}
+FXCODEC_STATUS CJBig2_GRDProc::Continue_decode(IFX_Pause* pPause)
+{
+ if(m_ProssiveStatus != FXCODEC_STATUS_DECODE_TOBECONTINUE) {
+ return m_ProssiveStatus;
+ }
+ switch (m_DecodeType) {
+ case 1:
+ return decode_Arith(pPause);
+ case 2:
+ return decode_Arith_V2(pPause);
+ case 3:
+ return decode_Arith_V1(pPause);
+ case 4:
+ return decode_MMR();
+ }
+ m_ProssiveStatus = FXCODEC_STATUS_ERROR;
+ return m_ProssiveStatus;
+}
+FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template0_opt3(CJBig2_Image *pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause)
+{
+ FX_BOOL SLTP, bVal;
+ FX_DWORD CONTEXT;
+ FX_DWORD line1, line2;
+ FX_BYTE *pLine1, *pLine2, cVal;
+ FX_INT32 nStride, nStride2, k;
+ FX_INT32 nLineBytes, nBitsLeft, cc;
+ if(m_pLine == NULL) {
+ m_pLine = pImage->m_pData;
+ }
+ nStride = pImage->m_nStride;
+ nStride2 = nStride << 1;
+ nLineBytes = ((GBW + 7) >> 3) - 1;
+ nBitsLeft = GBW - (nLineBytes << 3);
+ FX_DWORD height = GBH & 0x7fffffff;
+ for(; m_loopIndex < height; m_loopIndex++) {
+ if(TPGDON) {
+ SLTP = pArithDecoder->DECODE(&gbContext[0x9b25]);
+ LTP = LTP ^ SLTP;
+ }
+ if(LTP == 1) {
+ pImage->copyLine(m_loopIndex, m_loopIndex - 1);
+ } else {
+ if(m_loopIndex > 1) {
+ pLine1 = m_pLine - nStride2;
+ pLine2 = m_pLine - nStride;
+ line1 = (*pLine1++) << 6;
+ line2 = *pLine2++;
+ CONTEXT = ((line1 & 0xf800) | (line2 & 0x07f0));
+ for(cc = 0; cc < nLineBytes; cc++) {
+ line1 = (line1 << 8) | ((*pLine1++) << 6);
+ line2 = (line2 << 8) | (*pLine2++);
+ cVal = 0;
+ for(k = 7; k >= 0; k--) {
+ bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
+ cVal |= bVal << k;
+ CONTEXT = (((CONTEXT & 0x7bf7) << 1) | bVal
+ | ((line1 >> k) & 0x0800)
+ | ((line2 >> k) & 0x0010));
+ }
+ m_pLine[cc] = cVal;
+ }
+ line1 <<= 8;
+ line2 <<= 8;
+ cVal = 0;
+ for(k = 0; k < nBitsLeft; k++) {
+ bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
+ cVal |= bVal << (7 - k);
+ CONTEXT = (((CONTEXT & 0x7bf7) << 1) | bVal
+ | ((line1 >> (7 - k)) & 0x0800)
+ | ((line2 >> (7 - k)) & 0x0010));
+ }
+ m_pLine[nLineBytes] = cVal;
+ } else {
+ pLine2 = m_pLine - nStride;
+ line2 = (m_loopIndex & 1) ? (*pLine2++) : 0;
+ CONTEXT = (line2 & 0x07f0);
+ for(cc = 0; cc < nLineBytes; cc++) {
+ if(m_loopIndex & 1) {
+ line2 = (line2 << 8) | (*pLine2++);
+ }
+ cVal = 0;
+ for(k = 7; k >= 0; k--) {
+ bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
+ cVal |= bVal << k;
+ CONTEXT = (((CONTEXT & 0x7bf7) << 1) | bVal
+ | ((line2 >> k) & 0x0010));
+ }
+ m_pLine[cc] = cVal;
+ }
+ line2 <<= 8;
+ cVal = 0;
+ for(k = 0; k < nBitsLeft; k++) {
+ bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
+ cVal |= bVal << (7 - k);
+ CONTEXT = (((CONTEXT & 0x7bf7) << 1) | bVal
+ | ((line2 >> (7 - k)) & 0x0010));
+ }
+ m_pLine[nLineBytes] = cVal;
+ }
+ }
+ m_pLine += nStride;
+ if(pPause && pPause->NeedToPauseNow()) {
+ m_loopIndex++;
+ m_ProssiveStatus = FXCODEC_STATUS_DECODE_TOBECONTINUE;
+ return FXCODEC_STATUS_DECODE_TOBECONTINUE;
+ }
+ }
+ m_ProssiveStatus = FXCODEC_STATUS_DECODE_FINISH;
+ return FXCODEC_STATUS_DECODE_FINISH;
+}
+FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template0_unopt(CJBig2_Image * pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause)
+{
+ FX_BOOL SLTP, bVal;
+ FX_DWORD CONTEXT;
+ FX_DWORD line1, line2, line3;
+ for(; m_loopIndex < GBH; m_loopIndex++) {
+ if(TPGDON) {
+ SLTP = pArithDecoder->DECODE(&gbContext[0x9b25]);
+ LTP = LTP ^ SLTP;
+ }
+ if(LTP == 1) {
+ pImage->copyLine(m_loopIndex, m_loopIndex - 1);
+ } else {
+ line1 = pImage->getPixel(1, m_loopIndex - 2);
+ line1 |= pImage->getPixel(0, m_loopIndex - 2) << 1;
+ line2 = pImage->getPixel(2, m_loopIndex - 1);
+ line2 |= pImage->getPixel(1, m_loopIndex - 1) << 1;
+ line2 |= pImage->getPixel(0, m_loopIndex - 1) << 2;
+ line3 = 0;
+ for(FX_DWORD w = 0; w < GBW; w++) {
+ if(USESKIP && SKIP->getPixel(w, m_loopIndex)) {
+ bVal = 0;
+ } else {
+ CONTEXT = line3;
+ CONTEXT |= pImage->getPixel(w + GBAT[0], m_loopIndex + GBAT[1]) << 4;
+ CONTEXT |= line2 << 5;
+ CONTEXT |= pImage->getPixel(w + GBAT[2], m_loopIndex + GBAT[3]) << 10;
+ CONTEXT |= pImage->getPixel(w + GBAT[4], m_loopIndex + GBAT[5]) << 11;
+ CONTEXT |= line1 << 12;
+ CONTEXT |= pImage->getPixel(w + GBAT[6], m_loopIndex + GBAT[7]) << 15;
+ bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
+ }
+ if(bVal) {
+ pImage->setPixel(w, m_loopIndex, bVal);
+ }
+ line1 = ((line1 << 1) | pImage->getPixel(w + 2, m_loopIndex - 2)) & 0x07;
+ line2 = ((line2 << 1) | pImage->getPixel(w + 3, m_loopIndex - 1)) & 0x1f;
+ line3 = ((line3 << 1) | bVal) & 0x0f;
+ }
+ }
+ if(pPause && pPause->NeedToPauseNow()) {
+ m_loopIndex++;
+ m_ProssiveStatus = FXCODEC_STATUS_DECODE_TOBECONTINUE;
+ return FXCODEC_STATUS_DECODE_TOBECONTINUE;
+ }
+ }
+ m_ProssiveStatus = FXCODEC_STATUS_DECODE_FINISH;
+ return FXCODEC_STATUS_DECODE_FINISH;
+}
+FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template1_opt3(CJBig2_Image *pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause)
+{
+ FX_BOOL SLTP, bVal;
+ FX_DWORD CONTEXT;
+ FX_DWORD line1, line2;
+ FX_BYTE *pLine1, *pLine2, cVal;
+ FX_INT32 nStride, nStride2, k;
+ FX_INT32 nLineBytes, nBitsLeft, cc;
+ if (!m_pLine) {
+ m_pLine = pImage->m_pData;
+ }
+ nStride = pImage->m_nStride;
+ nStride2 = nStride << 1;
+ nLineBytes = ((GBW + 7) >> 3) - 1;
+ nBitsLeft = GBW - (nLineBytes << 3);
+ for(; m_loopIndex < GBH; m_loopIndex++) {
+ if(TPGDON) {
+ SLTP = pArithDecoder->DECODE(&gbContext[0x0795]);
+ LTP = LTP ^ SLTP;
+ }
+ if(LTP == 1) {
+ pImage->copyLine(m_loopIndex, m_loopIndex - 1);
+ } else {
+ if(m_loopIndex > 1) {
+ pLine1 = m_pLine - nStride2;
+ pLine2 = m_pLine - nStride;
+ line1 = (*pLine1++) << 4;
+ line2 = *pLine2++;
+ CONTEXT = (line1 & 0x1e00) | ((line2 >> 1) & 0x01f8);
+ for(cc = 0; cc < nLineBytes; cc++) {
+ line1 = (line1 << 8) | ((*pLine1++) << 4);
+ line2 = (line2 << 8) | (*pLine2++);
+ cVal = 0;
+ for(k = 7; k >= 0; k--) {
+ bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
+ cVal |= bVal << k;
+ CONTEXT = ((CONTEXT & 0x0efb) << 1) | bVal
+ | ((line1 >> k) & 0x0200)
+ | ((line2 >> (k + 1)) & 0x0008);
+ }
+ m_pLine[cc] = cVal;
+ }
+ line1 <<= 8;
+ line2 <<= 8;
+ cVal = 0;
+ for(k = 0; k < nBitsLeft; k++) {
+ bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
+ cVal |= bVal << (7 - k);
+ CONTEXT = ((CONTEXT & 0x0efb) << 1) | bVal
+ | ((line1 >> (7 - k)) & 0x0200)
+ | ((line2 >> (8 - k)) & 0x0008);
+ }
+ m_pLine[nLineBytes] = cVal;
+ } else {
+ pLine2 = m_pLine - nStride;
+ line2 = (m_loopIndex & 1) ? (*pLine2++) : 0;
+ CONTEXT = (line2 >> 1) & 0x01f8;
+ for(cc = 0; cc < nLineBytes; cc++) {
+ if(m_loopIndex & 1) {
+ line2 = (line2 << 8) | (*pLine2++);
+ }
+ cVal = 0;
+ for(k = 7; k >= 0; k--) {
+ bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
+ cVal |= bVal << k;
+ CONTEXT = ((CONTEXT & 0x0efb) << 1) | bVal
+ | ((line2 >> (k + 1)) & 0x0008);
+ }
+ m_pLine[cc] = cVal;
+ }
+ line2 <<= 8;
+ cVal = 0;
+ for(k = 0; k < nBitsLeft; k++) {
+ bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
+ cVal |= bVal << (7 - k);
+ CONTEXT = ((CONTEXT & 0x0efb) << 1) | bVal
+ | ((line2 >> (8 - k)) & 0x0008);
+ }
+ m_pLine[nLineBytes] = cVal;
+ }
+ }
+ m_pLine += nStride;
+ if(pPause && pPause->NeedToPauseNow()) {
+ m_loopIndex++;
+ m_ProssiveStatus = FXCODEC_STATUS_DECODE_TOBECONTINUE;
+ return FXCODEC_STATUS_DECODE_TOBECONTINUE;
+ }
+ }
+ m_ProssiveStatus = FXCODEC_STATUS_DECODE_FINISH;
+ return FXCODEC_STATUS_DECODE_FINISH;
+}
+FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template1_unopt(CJBig2_Image * pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause)
+{
+ FX_BOOL SLTP, bVal;
+ FX_DWORD CONTEXT;
+ FX_DWORD line1, line2, line3;
+ for(FX_DWORD h = 0; h < GBH; h++) {
+ if(TPGDON) {
+ SLTP = pArithDecoder->DECODE(&gbContext[0x0795]);
+ LTP = LTP ^ SLTP;
+ }
+ if(LTP == 1) {
+ pImage->copyLine(h, h - 1);
+ } else {
+ line1 = pImage->getPixel(2, h - 2);
+ line1 |= pImage->getPixel(1, h - 2) << 1;
+ line1 |= pImage->getPixel(0, h - 2) << 2;
+ line2 = pImage->getPixel(2, h - 1);
+ line2 |= pImage->getPixel(1, h - 1) << 1;
+ line2 |= pImage->getPixel(0, h - 1) << 2;
+ line3 = 0;
+ for(FX_DWORD w = 0; w < GBW; w++) {
+ if(USESKIP && SKIP->getPixel(w, h)) {
+ bVal = 0;
+ } else {
+ CONTEXT = line3;
+ CONTEXT |= pImage->getPixel(w + GBAT[0], h + GBAT[1]) << 3;
+ CONTEXT |= line2 << 4;
+ CONTEXT |= line1 << 9;
+ bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
+ }
+ if(bVal) {
+ pImage->setPixel(w, h, bVal);
+ }
+ line1 = ((line1 << 1) | pImage->getPixel(w + 3, h - 2)) & 0x0f;
+ line2 = ((line2 << 1) | pImage->getPixel(w + 3, h - 1)) & 0x1f;
+ line3 = ((line3 << 1) | bVal) & 0x07;
+ }
+ }
+ if(pPause && pPause->NeedToPauseNow()) {
+ m_loopIndex++;
+ m_ProssiveStatus = FXCODEC_STATUS_DECODE_TOBECONTINUE;
+ return FXCODEC_STATUS_DECODE_TOBECONTINUE;
+ }
+ }
+ m_ProssiveStatus = FXCODEC_STATUS_DECODE_FINISH;
+ return FXCODEC_STATUS_DECODE_FINISH;
+}
+FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template2_opt3(CJBig2_Image *pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause)
+{
+ FX_BOOL SLTP, bVal;
+ FX_DWORD CONTEXT;
+ FX_DWORD line1, line2;
+ FX_BYTE *pLine1, *pLine2, cVal;
+ FX_INT32 nStride, nStride2, k;
+ FX_INT32 nLineBytes, nBitsLeft, cc;
+ if(!m_pLine) {
+ m_pLine = pImage->m_pData;
+ }
+ nStride = pImage->m_nStride;
+ nStride2 = nStride << 1;
+ nLineBytes = ((GBW + 7) >> 3) - 1;
+ nBitsLeft = GBW - (nLineBytes << 3);
+ for(; m_loopIndex < GBH; m_loopIndex++) {
+ if(TPGDON) {
+ SLTP = pArithDecoder->DECODE(&gbContext[0x00e5]);
+ LTP = LTP ^ SLTP;
+ }
+ if(LTP == 1) {
+ pImage->copyLine(m_loopIndex, m_loopIndex - 1);
+ } else {
+ if(m_loopIndex > 1) {
+ pLine1 = m_pLine - nStride2;
+ pLine2 = m_pLine - nStride;
+ line1 = (*pLine1++) << 1;
+ line2 = *pLine2++;
+ CONTEXT = (line1 & 0x0380) | ((line2 >> 3) & 0x007c);
+ for(cc = 0; cc < nLineBytes; cc++) {
+ line1 = (line1 << 8) | ((*pLine1++) << 1);
+ line2 = (line2 << 8) | (*pLine2++);
+ cVal = 0;
+ for(k = 7; k >= 0; k--) {
+ bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
+ cVal |= bVal << k;
+ CONTEXT = ((CONTEXT & 0x01bd) << 1) | bVal
+ | ((line1 >> k) & 0x0080)
+ | ((line2 >> (k + 3)) & 0x0004);
+ }
+ m_pLine[cc] = cVal;
+ }
+ line1 <<= 8;
+ line2 <<= 8;
+ cVal = 0;
+ for(k = 0; k < nBitsLeft; k++) {
+ bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
+ cVal |= bVal << (7 - k);
+ CONTEXT = ((CONTEXT & 0x01bd) << 1) | bVal
+ | ((line1 >> (7 - k)) & 0x0080)
+ | ((line2 >> (10 - k)) & 0x0004);
+ }
+ m_pLine[nLineBytes] = cVal;
+ } else {
+ pLine2 = m_pLine - nStride;
+ line2 = (m_loopIndex & 1) ? (*pLine2++) : 0;
+ CONTEXT = (line2 >> 3) & 0x007c;
+ for(cc = 0; cc < nLineBytes; cc++) {
+ if(m_loopIndex & 1) {
+ line2 = (line2 << 8) | (*pLine2++);
+ }
+ cVal = 0;
+ for(k = 7; k >= 0; k--) {
+ bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
+ cVal |= bVal << k;
+ CONTEXT = ((CONTEXT & 0x01bd) << 1) | bVal
+ | ((line2 >> (k + 3)) & 0x0004);
+ }
+ m_pLine[cc] = cVal;
+ }
+ line2 <<= 8;
+ cVal = 0;
+ for(k = 0; k < nBitsLeft; k++) {
+ bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
+ cVal |= bVal << (7 - k);
+ CONTEXT = ((CONTEXT & 0x01bd) << 1) | bVal
+ | (((line2 >> (10 - k))) & 0x0004);
+ }
+ m_pLine[nLineBytes] = cVal;
+ }
+ }
+ m_pLine += nStride;
+ if(pPause && m_loopIndex % 50 == 0 && pPause->NeedToPauseNow()) {
+ m_loopIndex++;
+ m_ProssiveStatus = FXCODEC_STATUS_DECODE_TOBECONTINUE;
+ return FXCODEC_STATUS_DECODE_TOBECONTINUE;
+ }
+ }
+ m_ProssiveStatus = FXCODEC_STATUS_DECODE_FINISH;
+ return FXCODEC_STATUS_DECODE_FINISH;
+}
+FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template2_unopt(CJBig2_Image * pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause)
+{
+ FX_BOOL SLTP, bVal;
+ FX_DWORD CONTEXT;
+ FX_DWORD line1, line2, line3;
+ for(; m_loopIndex < GBH; m_loopIndex++) {
+ if(TPGDON) {
+ SLTP = pArithDecoder->DECODE(&gbContext[0x00e5]);
+ LTP = LTP ^ SLTP;
+ }
+ if(LTP == 1) {
+ pImage->copyLine(m_loopIndex, m_loopIndex - 1);
+ } else {
+ line1 = pImage->getPixel(1, m_loopIndex - 2);
+ line1 |= pImage->getPixel(0, m_loopIndex - 2) << 1;
+ line2 = pImage->getPixel(1, m_loopIndex - 1);
+ line2 |= pImage->getPixel(0, m_loopIndex - 1) << 1;
+ line3 = 0;
+ for(FX_DWORD w = 0; w < GBW; w++) {
+ if(USESKIP && SKIP->getPixel(w, m_loopIndex)) {
+ bVal = 0;
+ } else {
+ CONTEXT = line3;
+ CONTEXT |= pImage->getPixel(w + GBAT[0], m_loopIndex + GBAT[1]) << 2;
+ CONTEXT |= line2 << 3;
+ CONTEXT |= line1 << 7;
+ bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
+ }
+ if(bVal) {
+ pImage->setPixel(w, m_loopIndex, bVal);
+ }
+ line1 = ((line1 << 1) | pImage->getPixel(w + 2, m_loopIndex - 2)) & 0x07;
+ line2 = ((line2 << 1) | pImage->getPixel(w + 2, m_loopIndex - 1)) & 0x0f;
+ line3 = ((line3 << 1) | bVal) & 0x03;
+ }
+ }
+ if(pPause && pPause->NeedToPauseNow()) {
+ m_loopIndex++;
+ m_ProssiveStatus = FXCODEC_STATUS_DECODE_TOBECONTINUE;
+ return FXCODEC_STATUS_DECODE_TOBECONTINUE;
+ }
+ }
+ m_ProssiveStatus = FXCODEC_STATUS_DECODE_FINISH;
+ return FXCODEC_STATUS_DECODE_FINISH;
+}
+FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template3_opt3(CJBig2_Image *pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause)
+{
+ FX_BOOL SLTP, bVal;
+ FX_DWORD CONTEXT;
+ FX_DWORD line1;
+ FX_BYTE *pLine1, cVal;
+ FX_INT32 nStride, k;
+ FX_INT32 nLineBytes, nBitsLeft, cc;
+ if (!m_pLine) {
+ m_pLine = pImage->m_pData;
+ }
+ nStride = pImage->m_nStride;
+ nLineBytes = ((GBW + 7) >> 3) - 1;
+ nBitsLeft = GBW - (nLineBytes << 3);
+ for(; m_loopIndex < GBH; m_loopIndex++) {
+ if(TPGDON) {
+ SLTP = pArithDecoder->DECODE(&gbContext[0x0195]);
+ LTP = LTP ^ SLTP;
+ }
+ if(LTP == 1) {
+ pImage->copyLine(m_loopIndex, m_loopIndex - 1);
+ } else {
+ if(m_loopIndex > 0) {
+ pLine1 = m_pLine - nStride;
+ line1 = *pLine1++;
+ CONTEXT = (line1 >> 1) & 0x03f0;
+ for(cc = 0; cc < nLineBytes; cc++) {
+ line1 = (line1 << 8) | (*pLine1++);
+ cVal = 0;
+ for(k = 7; k >= 0; k--) {
+ bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
+ cVal |= bVal << k;
+ CONTEXT = ((CONTEXT & 0x01f7) << 1) | bVal
+ | ((line1 >> (k + 1)) & 0x0010);
+ }
+ m_pLine[cc] = cVal;
+ }
+ line1 <<= 8;
+ cVal = 0;
+ for(k = 0; k < nBitsLeft; k++) {
+ bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
+ cVal |= bVal << (7 - k);
+ CONTEXT = ((CONTEXT & 0x01f7) << 1) | bVal
+ | ((line1 >> (8 - k)) & 0x0010);
+ }
+ m_pLine[nLineBytes] = cVal;
+ } else {
+ CONTEXT = 0;
+ for(cc = 0; cc < nLineBytes; cc++) {
+ cVal = 0;
+ for(k = 7; k >= 0; k--) {
+ bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
+ cVal |= bVal << k;
+ CONTEXT = ((CONTEXT & 0x01f7) << 1) | bVal;
+ }
+ m_pLine[cc] = cVal;
+ }
+ cVal = 0;
+ for(k = 0; k < nBitsLeft; k++) {
+ bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
+ cVal |= bVal << (7 - k);
+ CONTEXT = ((CONTEXT & 0x01f7) << 1) | bVal;
+ }
+ m_pLine[nLineBytes] = cVal;
+ }
+ }
+ m_pLine += nStride;
+ if(pPause && pPause->NeedToPauseNow()) {
+ m_loopIndex++;
+ m_ProssiveStatus = FXCODEC_STATUS_DECODE_TOBECONTINUE;
+ return FXCODEC_STATUS_DECODE_TOBECONTINUE;
+ }
+ }
+ m_ProssiveStatus = FXCODEC_STATUS_DECODE_FINISH;
+ return FXCODEC_STATUS_DECODE_FINISH;
+}
+FXCODEC_STATUS CJBig2_GRDProc::decode_Arith_Template3_unopt(CJBig2_Image * pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause)
+{
+ FX_BOOL SLTP, bVal;
+ FX_DWORD CONTEXT;
+ FX_DWORD line1, line2;
+ for(; m_loopIndex < GBH; m_loopIndex++) {
+ if(TPGDON) {
+ SLTP = pArithDecoder->DECODE(&gbContext[0x0195]);
+ LTP = LTP ^ SLTP;
+ }
+ if(LTP == 1) {
+ pImage->copyLine(m_loopIndex, m_loopIndex - 1);
+ } else {
+ line1 = pImage->getPixel(1, m_loopIndex - 1);
+ line1 |= pImage->getPixel(0, m_loopIndex - 1) << 1;
+ line2 = 0;
+ for(FX_DWORD w = 0; w < GBW; w++) {
+ if(USESKIP && SKIP->getPixel(w, m_loopIndex)) {
+ bVal = 0;
+ } else {
+ CONTEXT = line2;
+ CONTEXT |= pImage->getPixel(w + GBAT[0], m_loopIndex + GBAT[1]) << 4;
+ CONTEXT |= line1 << 5;
+ bVal = pArithDecoder->DECODE(&gbContext[CONTEXT]);
+ }
+ if(bVal) {
+ pImage->setPixel(w, m_loopIndex, bVal);
+ }
+ line1 = ((line1 << 1) | pImage->getPixel(w + 2, m_loopIndex - 1)) & 0x1f;
+ line2 = ((line2 << 1) | bVal) & 0x0f;
+ }
+ }
+ if(pPause && pPause->NeedToPauseNow()) {
+ m_loopIndex++;
+ m_ProssiveStatus = FXCODEC_STATUS_DECODE_TOBECONTINUE;
+ return FXCODEC_STATUS_DECODE_TOBECONTINUE;
+ }
+ }
+ m_ProssiveStatus = FXCODEC_STATUS_DECODE_FINISH;
+ return FXCODEC_STATUS_DECODE_FINISH;
+}
diff --git a/core/src/fxcodec/jbig2/JBig2_GeneralDecoder.h b/core/src/fxcodec/jbig2/JBig2_GeneralDecoder.h
index a89d0d62ef..3f43c979a5 100644
--- a/core/src/fxcodec/jbig2/JBig2_GeneralDecoder.h
+++ b/core/src/fxcodec/jbig2/JBig2_GeneralDecoder.h
@@ -1,278 +1,278 @@
-// 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 _JBIG2_GENERAL_DECODER_H_
-#define _JBIG2_GENERAL_DECODER_H_
-#include "../../../include/fxcodec/fx_codec_def.h"
-#include "../../../include/fxcrt/fx_basic.h"
-#include "JBig2_Define.h"
-#include "JBig2_SymbolDict.h"
-#include "JBig2_ArithDecoder.h"
-#include "JBig2_ArithIntDecoder.h"
-#include "../../../include/fxcrt/fx_coordinates.h"
-class CJBig2_HuffmanTable;
-class CJBig2_Image;
-class CJBig2_PatternDict;
-typedef enum {
- JBIG2_CORNER_BOTTOMLEFT = 0,
- JBIG2_CORNER_TOPLEFT = 1,
- JBIG2_CORNER_BOTTOMRIGHT = 2,
- JBIG2_CORNER_TOPRIGHT = 3
-} JBig2Corner;
-class CJBig2_GRDProc : public CJBig2_Object
-{
-public:
- CJBig2_GRDProc()
- {
- m_loopIndex = 0;
- m_pLine = NULL;
- m_pPause = NULL;
- m_DecodeType = 0;
- LTP = 0;
- m_ReplaceRect.left = 0;
- m_ReplaceRect.bottom = 0;
- m_ReplaceRect.top = 0;
- m_ReplaceRect.right = 0;
- }
-
- CJBig2_Image *decode_Arith(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext);
-
- CJBig2_Image *decode_Arith_V2(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext);
-
- CJBig2_Image *decode_Arith_V1(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext);
-
- CJBig2_Image *decode_MMR(CJBig2_BitStream *pStream);
- FXCODEC_STATUS Start_decode_Arith(CJBig2_Image** pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause = NULL);
- FXCODEC_STATUS Start_decode_Arith_V2(CJBig2_Image** pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause = NULL);
- FXCODEC_STATUS Start_decode_Arith_V1(CJBig2_Image** pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause = NULL);
- FXCODEC_STATUS Start_decode_MMR(CJBig2_Image** pImage, CJBig2_BitStream *pStream, IFX_Pause* pPause = NULL);
- FXCODEC_STATUS Continue_decode(IFX_Pause* pPause);
- FX_RECT GetReplaceRect()
- {
- return m_ReplaceRect;
- };
-private:
- FXCODEC_STATUS decode_Arith(IFX_Pause* pPause);
- FXCODEC_STATUS decode_Arith_V2(IFX_Pause* pPause);
- FXCODEC_STATUS decode_Arith_V1(IFX_Pause* pPause);
- FXCODEC_STATUS decode_MMR();
- FXCODEC_STATUS decode_Arith_Template0_opt3(CJBig2_Image*pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause);
- FXCODEC_STATUS decode_Arith_Template0_unopt(CJBig2_Image *pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause);
- FXCODEC_STATUS decode_Arith_Template1_opt3(CJBig2_Image *pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause);
- FXCODEC_STATUS decode_Arith_Template1_unopt(CJBig2_Image * pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause);
- FXCODEC_STATUS decode_Arith_Template2_opt3(CJBig2_Image *pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause);
- FXCODEC_STATUS decode_Arith_Template2_unopt(CJBig2_Image * pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause);
- FXCODEC_STATUS decode_Arith_Template3_opt3(CJBig2_Image *pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause);
- FXCODEC_STATUS decode_Arith_Template3_unopt(CJBig2_Image * pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause);
- FX_DWORD m_loopIndex;
- FX_BYTE * m_pLine;
- IFX_Pause* m_pPause;
- FXCODEC_STATUS m_ProssiveStatus;
- CJBig2_Image** m_pImage;
- CJBig2_ArithDecoder *m_pArithDecoder;
- JBig2ArithCtx *m_gbContext;
- FX_WORD m_DecodeType;
- FX_BOOL LTP;
- FX_RECT m_ReplaceRect;
-private:
-
- CJBig2_Image *decode_Arith_Template0_opt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext);
-
- CJBig2_Image *decode_Arith_Template0_opt2(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext);
-
- CJBig2_Image *decode_Arith_Template0_opt3(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext);
-
- CJBig2_Image *decode_Arith_Template0_unopt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext);
-
- CJBig2_Image *decode_Arith_Template1_opt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext);
-
- CJBig2_Image *decode_Arith_Template1_opt2(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext);
-
- CJBig2_Image *decode_Arith_Template1_opt3(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext);
-
- CJBig2_Image *decode_Arith_Template1_unopt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext);
-
- CJBig2_Image *decode_Arith_Template2_opt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext);
-
- CJBig2_Image *decode_Arith_Template2_opt2(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext);
-
- CJBig2_Image *decode_Arith_Template2_opt3(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext);
-
- CJBig2_Image *decode_Arith_Template2_unopt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext);
-
- CJBig2_Image *decode_Arith_Template3_opt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext);
-
- CJBig2_Image *decode_Arith_Template3_opt2(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext);
-
- CJBig2_Image *decode_Arith_Template3_opt3(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext);
-
- CJBig2_Image *decode_Arith_Template3_unopt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext);
-public:
- FX_BOOL MMR;
- FX_DWORD GBW;
- FX_DWORD GBH;
- FX_BYTE GBTEMPLATE;
- FX_BOOL TPGDON;
- FX_BOOL USESKIP;
- CJBig2_Image * SKIP;
- signed char GBAT[8];
-};
-class CJBig2_GRRDProc : public CJBig2_Object
-{
-public:
-
- CJBig2_Image *decode(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *grContext);
-
- CJBig2_Image *decode_Template0_unopt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *grContext);
-
- CJBig2_Image *decode_Template0_opt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *grContext);
-
- CJBig2_Image *decode_Template1_unopt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *grContext);
-
- CJBig2_Image *decode_Template1_opt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *grContext);
-
- CJBig2_Image *decode_V1(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *grContext);
-public:
- FX_DWORD GRW;
- FX_DWORD GRH;
- FX_BOOL GRTEMPLATE;
- CJBig2_Image *GRREFERENCE;
- FX_INT32 GRREFERENCEDX;
- FX_INT32 GRREFERENCEDY;
- FX_BOOL TPGRON;
- signed char GRAT[4];
-};
-typedef struct {
- CJBig2_ArithIntDecoder *IADT,
- *IAFS,
- *IADS,
- *IAIT,
- *IARI,
- *IARDW,
- *IARDH,
- *IARDX,
- *IARDY;
- CJBig2_ArithIaidDecoder *IAID;
-} JBig2IntDecoderState;
-class CJBig2_TRDProc : public CJBig2_Object
-{
-public:
-
- CJBig2_Image *decode_Huffman(CJBig2_BitStream *pStream, JBig2ArithCtx *grContext);
-
- CJBig2_Image *decode_Arith(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *grContext,
- JBig2IntDecoderState *pIDS = NULL);
-public:
- FX_BOOL SBHUFF;
- FX_BOOL SBREFINE;
- FX_DWORD SBW;
- FX_DWORD SBH;
- FX_DWORD SBNUMINSTANCES;
- FX_DWORD SBSTRIPS;
- FX_DWORD SBNUMSYMS;
-
- JBig2HuffmanCode *SBSYMCODES;
- FX_BYTE SBSYMCODELEN;
-
- CJBig2_Image **SBSYMS;
- FX_BOOL SBDEFPIXEL;
-
- JBig2ComposeOp SBCOMBOP;
- FX_BOOL TRANSPOSED;
-
- JBig2Corner REFCORNER;
- signed char SBDSOFFSET;
- CJBig2_HuffmanTable *SBHUFFFS,
- *SBHUFFDS,
- *SBHUFFDT,
- *SBHUFFRDW,
- *SBHUFFRDH,
- *SBHUFFRDX,
- *SBHUFFRDY,
- *SBHUFFRSIZE;
- FX_BOOL SBRTEMPLATE;
- signed char SBRAT[4];
-};
-class CJBig2_SDDProc : public CJBig2_Object
-{
-public:
-
- CJBig2_SymbolDict *decode_Arith(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, JBig2ArithCtx *grContext);
-
- CJBig2_SymbolDict *decode_Huffman(CJBig2_BitStream *pStream, JBig2ArithCtx *gbContext, JBig2ArithCtx *grContext, IFX_Pause* pPause);
-public:
- FX_BOOL SDHUFF;
- FX_BOOL SDREFAGG;
- FX_DWORD SDNUMINSYMS;
- CJBig2_Image ** SDINSYMS;
- FX_DWORD SDNUMNEWSYMS;
- FX_DWORD SDNUMEXSYMS;
- CJBig2_HuffmanTable *SDHUFFDH,
- *SDHUFFDW,
- *SDHUFFBMSIZE,
- *SDHUFFAGGINST;
- FX_BYTE SDTEMPLATE;
- signed char SDAT[8];
- FX_BOOL SDRTEMPLATE;
- signed char SDRAT[4];
-};
-class CJBig2_HTRDProc : public CJBig2_Object
-{
-public:
-
- CJBig2_Image *decode_Arith(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause);
-
- CJBig2_Image *decode_MMR(CJBig2_BitStream *pStream, IFX_Pause* pPause);
-public:
- FX_DWORD HBW,
- HBH;
- FX_BOOL HMMR;
- FX_BYTE HTEMPLATE;
- FX_DWORD HNUMPATS;
- CJBig2_Image **HPATS;
- FX_BOOL HDEFPIXEL;
- JBig2ComposeOp HCOMBOP;
- FX_BOOL HENABLESKIP;
- FX_DWORD HGW,
- HGH;
- FX_INT32 HGX,
- HGY;
- FX_WORD HRX,
- HRY;
- FX_BYTE HPW,
- HPH;
-};
-class CJBig2_PDDProc : public CJBig2_Object
-{
-public:
-
- CJBig2_PatternDict *decode_Arith(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause);
-
- CJBig2_PatternDict *decode_MMR(CJBig2_BitStream *pStream, IFX_Pause* pPause);
-public:
- FX_BOOL HDMMR;
- FX_BYTE HDPW,
- HDPH;
- FX_DWORD GRAYMAX;
- FX_BYTE HDTEMPLATE;
-};
-class CJBig2_GSIDProc : public CJBig2_Object
-{
-public:
-
- FX_DWORD *decode_Arith(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause);
-
- FX_DWORD *decode_MMR(CJBig2_BitStream *pStream, IFX_Pause* pPause);
-public:
- FX_BOOL GSMMR;
- FX_BOOL GSUSESKIP;
- FX_BYTE GSBPP;
- FX_DWORD GSW,
- GSH;
- FX_BYTE GSTEMPLATE;
- CJBig2_Image *GSKIP;
-};
-#endif
+// 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 _JBIG2_GENERAL_DECODER_H_
+#define _JBIG2_GENERAL_DECODER_H_
+#include "../../../include/fxcodec/fx_codec_def.h"
+#include "../../../include/fxcrt/fx_basic.h"
+#include "JBig2_Define.h"
+#include "JBig2_SymbolDict.h"
+#include "JBig2_ArithDecoder.h"
+#include "JBig2_ArithIntDecoder.h"
+#include "../../../include/fxcrt/fx_coordinates.h"
+class CJBig2_HuffmanTable;
+class CJBig2_Image;
+class CJBig2_PatternDict;
+typedef enum {
+ JBIG2_CORNER_BOTTOMLEFT = 0,
+ JBIG2_CORNER_TOPLEFT = 1,
+ JBIG2_CORNER_BOTTOMRIGHT = 2,
+ JBIG2_CORNER_TOPRIGHT = 3
+} JBig2Corner;
+class CJBig2_GRDProc : public CJBig2_Object
+{
+public:
+ CJBig2_GRDProc()
+ {
+ m_loopIndex = 0;
+ m_pLine = NULL;
+ m_pPause = NULL;
+ m_DecodeType = 0;
+ LTP = 0;
+ m_ReplaceRect.left = 0;
+ m_ReplaceRect.bottom = 0;
+ m_ReplaceRect.top = 0;
+ m_ReplaceRect.right = 0;
+ }
+
+ CJBig2_Image *decode_Arith(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext);
+
+ CJBig2_Image *decode_Arith_V2(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext);
+
+ CJBig2_Image *decode_Arith_V1(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext);
+
+ CJBig2_Image *decode_MMR(CJBig2_BitStream *pStream);
+ FXCODEC_STATUS Start_decode_Arith(CJBig2_Image** pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause = NULL);
+ FXCODEC_STATUS Start_decode_Arith_V2(CJBig2_Image** pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause = NULL);
+ FXCODEC_STATUS Start_decode_Arith_V1(CJBig2_Image** pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause = NULL);
+ FXCODEC_STATUS Start_decode_MMR(CJBig2_Image** pImage, CJBig2_BitStream *pStream, IFX_Pause* pPause = NULL);
+ FXCODEC_STATUS Continue_decode(IFX_Pause* pPause);
+ FX_RECT GetReplaceRect()
+ {
+ return m_ReplaceRect;
+ };
+private:
+ FXCODEC_STATUS decode_Arith(IFX_Pause* pPause);
+ FXCODEC_STATUS decode_Arith_V2(IFX_Pause* pPause);
+ FXCODEC_STATUS decode_Arith_V1(IFX_Pause* pPause);
+ FXCODEC_STATUS decode_MMR();
+ FXCODEC_STATUS decode_Arith_Template0_opt3(CJBig2_Image*pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause);
+ FXCODEC_STATUS decode_Arith_Template0_unopt(CJBig2_Image *pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause);
+ FXCODEC_STATUS decode_Arith_Template1_opt3(CJBig2_Image *pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause);
+ FXCODEC_STATUS decode_Arith_Template1_unopt(CJBig2_Image * pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause);
+ FXCODEC_STATUS decode_Arith_Template2_opt3(CJBig2_Image *pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause);
+ FXCODEC_STATUS decode_Arith_Template2_unopt(CJBig2_Image * pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause);
+ FXCODEC_STATUS decode_Arith_Template3_opt3(CJBig2_Image *pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause);
+ FXCODEC_STATUS decode_Arith_Template3_unopt(CJBig2_Image * pImage, CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause);
+ FX_DWORD m_loopIndex;
+ FX_BYTE * m_pLine;
+ IFX_Pause* m_pPause;
+ FXCODEC_STATUS m_ProssiveStatus;
+ CJBig2_Image** m_pImage;
+ CJBig2_ArithDecoder *m_pArithDecoder;
+ JBig2ArithCtx *m_gbContext;
+ FX_WORD m_DecodeType;
+ FX_BOOL LTP;
+ FX_RECT m_ReplaceRect;
+private:
+
+ CJBig2_Image *decode_Arith_Template0_opt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext);
+
+ CJBig2_Image *decode_Arith_Template0_opt2(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext);
+
+ CJBig2_Image *decode_Arith_Template0_opt3(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext);
+
+ CJBig2_Image *decode_Arith_Template0_unopt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext);
+
+ CJBig2_Image *decode_Arith_Template1_opt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext);
+
+ CJBig2_Image *decode_Arith_Template1_opt2(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext);
+
+ CJBig2_Image *decode_Arith_Template1_opt3(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext);
+
+ CJBig2_Image *decode_Arith_Template1_unopt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext);
+
+ CJBig2_Image *decode_Arith_Template2_opt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext);
+
+ CJBig2_Image *decode_Arith_Template2_opt2(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext);
+
+ CJBig2_Image *decode_Arith_Template2_opt3(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext);
+
+ CJBig2_Image *decode_Arith_Template2_unopt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext);
+
+ CJBig2_Image *decode_Arith_Template3_opt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext);
+
+ CJBig2_Image *decode_Arith_Template3_opt2(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext);
+
+ CJBig2_Image *decode_Arith_Template3_opt3(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext);
+
+ CJBig2_Image *decode_Arith_Template3_unopt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext);
+public:
+ FX_BOOL MMR;
+ FX_DWORD GBW;
+ FX_DWORD GBH;
+ FX_BYTE GBTEMPLATE;
+ FX_BOOL TPGDON;
+ FX_BOOL USESKIP;
+ CJBig2_Image * SKIP;
+ signed char GBAT[8];
+};
+class CJBig2_GRRDProc : public CJBig2_Object
+{
+public:
+
+ CJBig2_Image *decode(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *grContext);
+
+ CJBig2_Image *decode_Template0_unopt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *grContext);
+
+ CJBig2_Image *decode_Template0_opt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *grContext);
+
+ CJBig2_Image *decode_Template1_unopt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *grContext);
+
+ CJBig2_Image *decode_Template1_opt(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *grContext);
+
+ CJBig2_Image *decode_V1(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *grContext);
+public:
+ FX_DWORD GRW;
+ FX_DWORD GRH;
+ FX_BOOL GRTEMPLATE;
+ CJBig2_Image *GRREFERENCE;
+ FX_INT32 GRREFERENCEDX;
+ FX_INT32 GRREFERENCEDY;
+ FX_BOOL TPGRON;
+ signed char GRAT[4];
+};
+typedef struct {
+ CJBig2_ArithIntDecoder *IADT,
+ *IAFS,
+ *IADS,
+ *IAIT,
+ *IARI,
+ *IARDW,
+ *IARDH,
+ *IARDX,
+ *IARDY;
+ CJBig2_ArithIaidDecoder *IAID;
+} JBig2IntDecoderState;
+class CJBig2_TRDProc : public CJBig2_Object
+{
+public:
+
+ CJBig2_Image *decode_Huffman(CJBig2_BitStream *pStream, JBig2ArithCtx *grContext);
+
+ CJBig2_Image *decode_Arith(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *grContext,
+ JBig2IntDecoderState *pIDS = NULL);
+public:
+ FX_BOOL SBHUFF;
+ FX_BOOL SBREFINE;
+ FX_DWORD SBW;
+ FX_DWORD SBH;
+ FX_DWORD SBNUMINSTANCES;
+ FX_DWORD SBSTRIPS;
+ FX_DWORD SBNUMSYMS;
+
+ JBig2HuffmanCode *SBSYMCODES;
+ FX_BYTE SBSYMCODELEN;
+
+ CJBig2_Image **SBSYMS;
+ FX_BOOL SBDEFPIXEL;
+
+ JBig2ComposeOp SBCOMBOP;
+ FX_BOOL TRANSPOSED;
+
+ JBig2Corner REFCORNER;
+ signed char SBDSOFFSET;
+ CJBig2_HuffmanTable *SBHUFFFS,
+ *SBHUFFDS,
+ *SBHUFFDT,
+ *SBHUFFRDW,
+ *SBHUFFRDH,
+ *SBHUFFRDX,
+ *SBHUFFRDY,
+ *SBHUFFRSIZE;
+ FX_BOOL SBRTEMPLATE;
+ signed char SBRAT[4];
+};
+class CJBig2_SDDProc : public CJBig2_Object
+{
+public:
+
+ CJBig2_SymbolDict *decode_Arith(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, JBig2ArithCtx *grContext);
+
+ CJBig2_SymbolDict *decode_Huffman(CJBig2_BitStream *pStream, JBig2ArithCtx *gbContext, JBig2ArithCtx *grContext, IFX_Pause* pPause);
+public:
+ FX_BOOL SDHUFF;
+ FX_BOOL SDREFAGG;
+ FX_DWORD SDNUMINSYMS;
+ CJBig2_Image ** SDINSYMS;
+ FX_DWORD SDNUMNEWSYMS;
+ FX_DWORD SDNUMEXSYMS;
+ CJBig2_HuffmanTable *SDHUFFDH,
+ *SDHUFFDW,
+ *SDHUFFBMSIZE,
+ *SDHUFFAGGINST;
+ FX_BYTE SDTEMPLATE;
+ signed char SDAT[8];
+ FX_BOOL SDRTEMPLATE;
+ signed char SDRAT[4];
+};
+class CJBig2_HTRDProc : public CJBig2_Object
+{
+public:
+
+ CJBig2_Image *decode_Arith(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause);
+
+ CJBig2_Image *decode_MMR(CJBig2_BitStream *pStream, IFX_Pause* pPause);
+public:
+ FX_DWORD HBW,
+ HBH;
+ FX_BOOL HMMR;
+ FX_BYTE HTEMPLATE;
+ FX_DWORD HNUMPATS;
+ CJBig2_Image **HPATS;
+ FX_BOOL HDEFPIXEL;
+ JBig2ComposeOp HCOMBOP;
+ FX_BOOL HENABLESKIP;
+ FX_DWORD HGW,
+ HGH;
+ FX_INT32 HGX,
+ HGY;
+ FX_WORD HRX,
+ HRY;
+ FX_BYTE HPW,
+ HPH;
+};
+class CJBig2_PDDProc : public CJBig2_Object
+{
+public:
+
+ CJBig2_PatternDict *decode_Arith(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause);
+
+ CJBig2_PatternDict *decode_MMR(CJBig2_BitStream *pStream, IFX_Pause* pPause);
+public:
+ FX_BOOL HDMMR;
+ FX_BYTE HDPW,
+ HDPH;
+ FX_DWORD GRAYMAX;
+ FX_BYTE HDTEMPLATE;
+};
+class CJBig2_GSIDProc : public CJBig2_Object
+{
+public:
+
+ FX_DWORD *decode_Arith(CJBig2_ArithDecoder *pArithDecoder, JBig2ArithCtx *gbContext, IFX_Pause* pPause);
+
+ FX_DWORD *decode_MMR(CJBig2_BitStream *pStream, IFX_Pause* pPause);
+public:
+ FX_BOOL GSMMR;
+ FX_BOOL GSUSESKIP;
+ FX_BYTE GSBPP;
+ FX_DWORD GSW,
+ GSH;
+ FX_BYTE GSTEMPLATE;
+ CJBig2_Image *GSKIP;
+};
+#endif
diff --git a/core/src/fxcodec/jbig2/JBig2_HuffmanDecoder.cpp b/core/src/fxcodec/jbig2/JBig2_HuffmanDecoder.cpp
index 8199fe7c21..dd820ae4ca 100644
--- a/core/src/fxcodec/jbig2/JBig2_HuffmanDecoder.cpp
+++ b/core/src/fxcodec/jbig2/JBig2_HuffmanDecoder.cpp
@@ -1,55 +1,55 @@
-// 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
-
-#include "JBig2_HuffmanDecoder.h"
-CJBig2_HuffmanDecoder::CJBig2_HuffmanDecoder(CJBig2_BitStream *pStream)
-{
- m_pStream = pStream;
-}
-CJBig2_HuffmanDecoder::~CJBig2_HuffmanDecoder()
-{
-}
-int CJBig2_HuffmanDecoder::decodeAValue(CJBig2_HuffmanTable *pTable, int *nResult)
-{
- int nVal, nTmp, i, nBits;
- nVal = 0;
- nBits = 0;
- while(1) {
- if(m_pStream->read1Bit(&nTmp) == -1) {
- return -1;
- }
- nVal = (nVal << 1) | nTmp;
- nBits ++;
- for(i = 0; i < pTable->NTEMP; i++) {
- if((pTable->PREFLEN[i] == nBits) && (pTable->CODES[i] == nVal)) {
- if((pTable->HTOOB == 1) && (i == pTable->NTEMP - 1)) {
- return JBIG2_OOB;
- }
- if(m_pStream->readNBits(pTable->RANGELEN[i], &nTmp) == -1) {
- return -1;
- }
- if(pTable->HTOOB) {
- if(i == pTable->NTEMP - 3) {
- *nResult = pTable->RANGELOW[i] - nTmp;
- return 0;
- } else {
- *nResult = pTable->RANGELOW[i] + nTmp;
- return 0;
- }
- } else {
- if(i == pTable->NTEMP - 2) {
- *nResult = pTable->RANGELOW[i] - nTmp;
- return 0;
- } else {
- *nResult = pTable->RANGELOW[i] + nTmp;
- return 0;
- }
- }
- }
- }
- }
- return -2;
-}
+// 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
+
+#include "JBig2_HuffmanDecoder.h"
+CJBig2_HuffmanDecoder::CJBig2_HuffmanDecoder(CJBig2_BitStream *pStream)
+{
+ m_pStream = pStream;
+}
+CJBig2_HuffmanDecoder::~CJBig2_HuffmanDecoder()
+{
+}
+int CJBig2_HuffmanDecoder::decodeAValue(CJBig2_HuffmanTable *pTable, int *nResult)
+{
+ int nVal, nTmp, i, nBits;
+ nVal = 0;
+ nBits = 0;
+ while(1) {
+ if(m_pStream->read1Bit(&nTmp) == -1) {
+ return -1;
+ }
+ nVal = (nVal << 1) | nTmp;
+ nBits ++;
+ for(i = 0; i < pTable->NTEMP; i++) {
+ if((pTable->PREFLEN[i] == nBits) && (pTable->CODES[i] == nVal)) {
+ if((pTable->HTOOB == 1) && (i == pTable->NTEMP - 1)) {
+ return JBIG2_OOB;
+ }
+ if(m_pStream->readNBits(pTable->RANGELEN[i], &nTmp) == -1) {
+ return -1;
+ }
+ if(pTable->HTOOB) {
+ if(i == pTable->NTEMP - 3) {
+ *nResult = pTable->RANGELOW[i] - nTmp;
+ return 0;
+ } else {
+ *nResult = pTable->RANGELOW[i] + nTmp;
+ return 0;
+ }
+ } else {
+ if(i == pTable->NTEMP - 2) {
+ *nResult = pTable->RANGELOW[i] - nTmp;
+ return 0;
+ } else {
+ *nResult = pTable->RANGELOW[i] + nTmp;
+ return 0;
+ }
+ }
+ }
+ }
+ }
+ return -2;
+}
diff --git a/core/src/fxcodec/jbig2/JBig2_HuffmanDecoder.h b/core/src/fxcodec/jbig2/JBig2_HuffmanDecoder.h
index 38b2021d20..60ec2900d3 100644
--- a/core/src/fxcodec/jbig2/JBig2_HuffmanDecoder.h
+++ b/core/src/fxcodec/jbig2/JBig2_HuffmanDecoder.h
@@ -1,24 +1,24 @@
-// 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 _JBIG2_HUFFMAN_DECODER_H_
-#define _JBIG2_HUFFMAN_DECODER_H_
-#include "JBig2_BitStream.h"
-#include "JBig2_HuffmanTable.h"
-class CJBig2_HuffmanDecoder : public CJBig2_Object
-{
-public:
-
- CJBig2_HuffmanDecoder(CJBig2_BitStream *pStream);
-
- ~CJBig2_HuffmanDecoder();
-
- int decodeAValue(CJBig2_HuffmanTable *pTable, int *nResult);
-private:
-
- CJBig2_BitStream *m_pStream;
-};
-#endif
+// 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 _JBIG2_HUFFMAN_DECODER_H_
+#define _JBIG2_HUFFMAN_DECODER_H_
+#include "JBig2_BitStream.h"
+#include "JBig2_HuffmanTable.h"
+class CJBig2_HuffmanDecoder : public CJBig2_Object
+{
+public:
+
+ CJBig2_HuffmanDecoder(CJBig2_BitStream *pStream);
+
+ ~CJBig2_HuffmanDecoder();
+
+ int decodeAValue(CJBig2_HuffmanTable *pTable, int *nResult);
+private:
+
+ CJBig2_BitStream *m_pStream;
+};
+#endif
diff --git a/core/src/fxcodec/jbig2/JBig2_HuffmanTable.cpp b/core/src/fxcodec/jbig2/JBig2_HuffmanTable.cpp
index af4a54988d..0a5bc8e645 100644
--- a/core/src/fxcodec/jbig2/JBig2_HuffmanTable.cpp
+++ b/core/src/fxcodec/jbig2/JBig2_HuffmanTable.cpp
@@ -1,193 +1,193 @@
-// 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
-
-#include "JBig2_HuffmanTable.h"
-#include "JBig2_BitStream.h"
-#include <string.h>
-
-CJBig2_HuffmanTable::CJBig2_HuffmanTable(const JBig2TableLine *pTable, int nLines,
- FX_BOOL bHTOOB)
-{
- init();
- m_bOK = parseFromStandardTable(pTable, nLines, bHTOOB);
-}
-
-CJBig2_HuffmanTable::CJBig2_HuffmanTable(CJBig2_BitStream *pStream)
-{
- init();
- m_bOK = parseFromCodedBuffer(pStream);
-}
-
-CJBig2_HuffmanTable::~CJBig2_HuffmanTable()
-{
- if(CODES) {
- m_pModule->JBig2_Free(CODES);
- }
- if(PREFLEN) {
- m_pModule->JBig2_Free(PREFLEN);
- }
- if(RANGELEN) {
- m_pModule->JBig2_Free(RANGELEN);
- }
- if(RANGELOW) {
- m_pModule->JBig2_Free(RANGELOW);
- }
-}
-void CJBig2_HuffmanTable::init()
-{
- HTOOB = FALSE;
- NTEMP = 0;
- CODES = NULL;
- PREFLEN = NULL;
- RANGELEN = NULL;
- RANGELOW = NULL;
-}
-int CJBig2_HuffmanTable::parseFromStandardTable(const JBig2TableLine *pTable, int nLines, FX_BOOL bHTOOB)
-{
- int CURLEN, LENMAX, CURCODE, CURTEMP, i;
- int *LENCOUNT;
- int *FIRSTCODE;
- HTOOB = bHTOOB;
- NTEMP = nLines;
- CODES = (int*)m_pModule->JBig2_Malloc2(sizeof(int), NTEMP);
- PREFLEN = (int*)m_pModule->JBig2_Malloc2(sizeof(int), NTEMP);
- RANGELEN = (int*)m_pModule->JBig2_Malloc2(sizeof(int), NTEMP);
- RANGELOW = (int*)m_pModule->JBig2_Malloc2(sizeof(int), NTEMP);
- LENMAX = 0;
- for(i = 0; i < NTEMP; i++) {
- PREFLEN[i] = pTable[i].PREFLEN;
- RANGELEN[i] = pTable[i].RANDELEN;
- RANGELOW[i] = pTable[i].RANGELOW;
- if(PREFLEN[i] > LENMAX) {
- LENMAX = PREFLEN[i];
- }
- }
- LENCOUNT = (int*)m_pModule->JBig2_Malloc2(sizeof(int), (LENMAX + 1));
- JBIG2_memset(LENCOUNT, 0, sizeof(int) * (LENMAX + 1));
- FIRSTCODE = (int*)m_pModule->JBig2_Malloc2(sizeof(int), (LENMAX + 1));
- for(i = 0; i < NTEMP; i++) {
- LENCOUNT[PREFLEN[i]] ++;
- }
- CURLEN = 1;
- FIRSTCODE[0] = 0;
- LENCOUNT[0] = 0;
- while(CURLEN <= LENMAX) {
- FIRSTCODE[CURLEN] = (FIRSTCODE[CURLEN - 1] + LENCOUNT[CURLEN - 1]) << 1;
- CURCODE = FIRSTCODE[CURLEN];
- CURTEMP = 0;
- while(CURTEMP < NTEMP) {
- if(PREFLEN[CURTEMP] == CURLEN) {
- CODES[CURTEMP] = CURCODE;
- CURCODE = CURCODE + 1;
- }
- CURTEMP = CURTEMP + 1;
- }
- CURLEN = CURLEN + 1;
- }
- m_pModule->JBig2_Free(LENCOUNT);
- m_pModule->JBig2_Free(FIRSTCODE);
- return 1;
-}
-
-#define HT_CHECK_MEMORY_ADJUST \
- if(NTEMP >= nSize) \
- { \
- nSize += 16; \
- PREFLEN = (int*)m_pModule->JBig2_Realloc(PREFLEN,sizeof(int)*nSize); \
- RANGELEN = (int*)m_pModule->JBig2_Realloc(RANGELEN,sizeof(int)*nSize); \
- RANGELOW = (int*)m_pModule->JBig2_Realloc(RANGELOW,sizeof(int)*nSize); \
- }
-int CJBig2_HuffmanTable::parseFromCodedBuffer(CJBig2_BitStream *pStream)
-{
- unsigned char HTPS, HTRS;
- int HTLOW, HTHIGH;
- int CURRANGELOW;
- int nSize = 16;
- int CURLEN, LENMAX, CURCODE, CURTEMP, i;
- int *LENCOUNT;
- int *FIRSTCODE;
- unsigned char cTemp;
- if(pStream->read1Byte(&cTemp) == -1) {
- goto failed;
- }
- HTOOB = cTemp & 0x01;
- HTPS = ((cTemp >> 1) & 0x07) + 1;
- HTRS = ((cTemp >> 4) & 0x07) + 1;
- if(pStream->readInteger((FX_DWORD*)&HTLOW) == -1 ||
- pStream->readInteger((FX_DWORD*)&HTHIGH) == -1) {
- goto failed;
- }
- PREFLEN = (int*)m_pModule->JBig2_Malloc2(sizeof(int), nSize);
- RANGELEN = (int*)m_pModule->JBig2_Malloc2(sizeof(int), nSize);
- RANGELOW = (int*)m_pModule->JBig2_Malloc2(sizeof(int), nSize);
- CURRANGELOW = HTLOW;
- NTEMP = 0;
- do {
- HT_CHECK_MEMORY_ADJUST
- if((pStream->readNBits(HTPS, &PREFLEN[NTEMP]) == -1)
- || (pStream->readNBits(HTRS, &RANGELEN[NTEMP]) == -1)) {
- goto failed;
- }
- RANGELOW[NTEMP] = CURRANGELOW;
- CURRANGELOW = CURRANGELOW + (1 << RANGELEN[NTEMP]);
- NTEMP = NTEMP + 1;
- } while(CURRANGELOW < HTHIGH);
- HT_CHECK_MEMORY_ADJUST
- if(pStream->readNBits(HTPS, &PREFLEN[NTEMP]) == -1) {
- goto failed;
- }
- RANGELEN[NTEMP] = 32;
- RANGELOW[NTEMP] = HTLOW - 1;
- NTEMP = NTEMP + 1;
- HT_CHECK_MEMORY_ADJUST
- if(pStream->readNBits(HTPS, &PREFLEN[NTEMP]) == -1) {
- goto failed;
- }
- RANGELEN[NTEMP] = 32;
- RANGELOW[NTEMP] = HTHIGH;
- NTEMP = NTEMP + 1;
- if(HTOOB) {
- HT_CHECK_MEMORY_ADJUST
- if(pStream->readNBits(HTPS, &PREFLEN[NTEMP]) == -1) {
- goto failed;
- }
- NTEMP = NTEMP + 1;
- }
- CODES = (int*)m_pModule->JBig2_Malloc2(sizeof(int), NTEMP);
- LENMAX = 0;
- for(i = 0; i < NTEMP; i++) {
- if(PREFLEN[i] > LENMAX) {
- LENMAX = PREFLEN[i];
- }
- }
- LENCOUNT = (int*)m_pModule->JBig2_Malloc2(sizeof(int), (LENMAX + 1));
- JBIG2_memset(LENCOUNT, 0, sizeof(int) * (LENMAX + 1));
- FIRSTCODE = (int*)m_pModule->JBig2_Malloc2(sizeof(int), (LENMAX + 1));
- for(i = 0; i < NTEMP; i++) {
- LENCOUNT[PREFLEN[i]] ++;
- }
- CURLEN = 1;
- FIRSTCODE[0] = 0;
- LENCOUNT[0] = 0;
- while(CURLEN <= LENMAX) {
- FIRSTCODE[CURLEN] = (FIRSTCODE[CURLEN - 1] + LENCOUNT[CURLEN - 1]) << 1;
- CURCODE = FIRSTCODE[CURLEN];
- CURTEMP = 0;
- while(CURTEMP < NTEMP) {
- if(PREFLEN[CURTEMP] == CURLEN) {
- CODES[CURTEMP] = CURCODE;
- CURCODE = CURCODE + 1;
- }
- CURTEMP = CURTEMP + 1;
- }
- CURLEN = CURLEN + 1;
- }
- m_pModule->JBig2_Free(LENCOUNT);
- m_pModule->JBig2_Free(FIRSTCODE);
- return TRUE;
-failed:
- return FALSE;
-}
+// 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
+
+#include "JBig2_HuffmanTable.h"
+#include "JBig2_BitStream.h"
+#include <string.h>
+
+CJBig2_HuffmanTable::CJBig2_HuffmanTable(const JBig2TableLine *pTable, int nLines,
+ FX_BOOL bHTOOB)
+{
+ init();
+ m_bOK = parseFromStandardTable(pTable, nLines, bHTOOB);
+}
+
+CJBig2_HuffmanTable::CJBig2_HuffmanTable(CJBig2_BitStream *pStream)
+{
+ init();
+ m_bOK = parseFromCodedBuffer(pStream);
+}
+
+CJBig2_HuffmanTable::~CJBig2_HuffmanTable()
+{
+ if(CODES) {
+ m_pModule->JBig2_Free(CODES);
+ }
+ if(PREFLEN) {
+ m_pModule->JBig2_Free(PREFLEN);
+ }
+ if(RANGELEN) {
+ m_pModule->JBig2_Free(RANGELEN);
+ }
+ if(RANGELOW) {
+ m_pModule->JBig2_Free(RANGELOW);
+ }
+}
+void CJBig2_HuffmanTable::init()
+{
+ HTOOB = FALSE;
+ NTEMP = 0;
+ CODES = NULL;
+ PREFLEN = NULL;
+ RANGELEN = NULL;
+ RANGELOW = NULL;
+}
+int CJBig2_HuffmanTable::parseFromStandardTable(const JBig2TableLine *pTable, int nLines, FX_BOOL bHTOOB)
+{
+ int CURLEN, LENMAX, CURCODE, CURTEMP, i;
+ int *LENCOUNT;
+ int *FIRSTCODE;
+ HTOOB = bHTOOB;
+ NTEMP = nLines;
+ CODES = (int*)m_pModule->JBig2_Malloc2(sizeof(int), NTEMP);
+ PREFLEN = (int*)m_pModule->JBig2_Malloc2(sizeof(int), NTEMP);
+ RANGELEN = (int*)m_pModule->JBig2_Malloc2(sizeof(int), NTEMP);
+ RANGELOW = (int*)m_pModule->JBig2_Malloc2(sizeof(int), NTEMP);
+ LENMAX = 0;
+ for(i = 0; i < NTEMP; i++) {
+ PREFLEN[i] = pTable[i].PREFLEN;
+ RANGELEN[i] = pTable[i].RANDELEN;
+ RANGELOW[i] = pTable[i].RANGELOW;
+ if(PREFLEN[i] > LENMAX) {
+ LENMAX = PREFLEN[i];
+ }
+ }
+ LENCOUNT = (int*)m_pModule->JBig2_Malloc2(sizeof(int), (LENMAX + 1));
+ JBIG2_memset(LENCOUNT, 0, sizeof(int) * (LENMAX + 1));
+ FIRSTCODE = (int*)m_pModule->JBig2_Malloc2(sizeof(int), (LENMAX + 1));
+ for(i = 0; i < NTEMP; i++) {
+ LENCOUNT[PREFLEN[i]] ++;
+ }
+ CURLEN = 1;
+ FIRSTCODE[0] = 0;
+ LENCOUNT[0] = 0;
+ while(CURLEN <= LENMAX) {
+ FIRSTCODE[CURLEN] = (FIRSTCODE[CURLEN - 1] + LENCOUNT[CURLEN - 1]) << 1;
+ CURCODE = FIRSTCODE[CURLEN];
+ CURTEMP = 0;
+ while(CURTEMP < NTEMP) {
+ if(PREFLEN[CURTEMP] == CURLEN) {
+ CODES[CURTEMP] = CURCODE;
+ CURCODE = CURCODE + 1;
+ }
+ CURTEMP = CURTEMP + 1;
+ }
+ CURLEN = CURLEN + 1;
+ }
+ m_pModule->JBig2_Free(LENCOUNT);
+ m_pModule->JBig2_Free(FIRSTCODE);
+ return 1;
+}
+
+#define HT_CHECK_MEMORY_ADJUST \
+ if(NTEMP >= nSize) \
+ { \
+ nSize += 16; \
+ PREFLEN = (int*)m_pModule->JBig2_Realloc(PREFLEN,sizeof(int)*nSize); \
+ RANGELEN = (int*)m_pModule->JBig2_Realloc(RANGELEN,sizeof(int)*nSize); \
+ RANGELOW = (int*)m_pModule->JBig2_Realloc(RANGELOW,sizeof(int)*nSize); \
+ }
+int CJBig2_HuffmanTable::parseFromCodedBuffer(CJBig2_BitStream *pStream)
+{
+ unsigned char HTPS, HTRS;
+ int HTLOW, HTHIGH;
+ int CURRANGELOW;
+ int nSize = 16;
+ int CURLEN, LENMAX, CURCODE, CURTEMP, i;
+ int *LENCOUNT;
+ int *FIRSTCODE;
+ unsigned char cTemp;
+ if(pStream->read1Byte(&cTemp) == -1) {
+ goto failed;
+ }
+ HTOOB = cTemp & 0x01;
+ HTPS = ((cTemp >> 1) & 0x07) + 1;
+ HTRS = ((cTemp >> 4) & 0x07) + 1;
+ if(pStream->readInteger((FX_DWORD*)&HTLOW) == -1 ||
+ pStream->readInteger((FX_DWORD*)&HTHIGH) == -1) {
+ goto failed;
+ }
+ PREFLEN = (int*)m_pModule->JBig2_Malloc2(sizeof(int), nSize);
+ RANGELEN = (int*)m_pModule->JBig2_Malloc2(sizeof(int), nSize);
+ RANGELOW = (int*)m_pModule->JBig2_Malloc2(sizeof(int), nSize);
+ CURRANGELOW = HTLOW;
+ NTEMP = 0;
+ do {
+ HT_CHECK_MEMORY_ADJUST
+ if((pStream->readNBits(HTPS, &PREFLEN[NTEMP]) == -1)
+ || (pStream->readNBits(HTRS, &RANGELEN[NTEMP]) == -1)) {
+ goto failed;
+ }
+ RANGELOW[NTEMP] = CURRANGELOW;
+ CURRANGELOW = CURRANGELOW + (1 << RANGELEN[NTEMP]);
+ NTEMP = NTEMP + 1;
+ } while(CURRANGELOW < HTHIGH);
+ HT_CHECK_MEMORY_ADJUST
+ if(pStream->readNBits(HTPS, &PREFLEN[NTEMP]) == -1) {
+ goto failed;
+ }
+ RANGELEN[NTEMP] = 32;
+ RANGELOW[NTEMP] = HTLOW - 1;
+ NTEMP = NTEMP + 1;
+ HT_CHECK_MEMORY_ADJUST
+ if(pStream->readNBits(HTPS, &PREFLEN[NTEMP]) == -1) {
+ goto failed;
+ }
+ RANGELEN[NTEMP] = 32;
+ RANGELOW[NTEMP] = HTHIGH;
+ NTEMP = NTEMP + 1;
+ if(HTOOB) {
+ HT_CHECK_MEMORY_ADJUST
+ if(pStream->readNBits(HTPS, &PREFLEN[NTEMP]) == -1) {
+ goto failed;
+ }
+ NTEMP = NTEMP + 1;
+ }
+ CODES = (int*)m_pModule->JBig2_Malloc2(sizeof(int), NTEMP);
+ LENMAX = 0;
+ for(i = 0; i < NTEMP; i++) {
+ if(PREFLEN[i] > LENMAX) {
+ LENMAX = PREFLEN[i];
+ }
+ }
+ LENCOUNT = (int*)m_pModule->JBig2_Malloc2(sizeof(int), (LENMAX + 1));
+ JBIG2_memset(LENCOUNT, 0, sizeof(int) * (LENMAX + 1));
+ FIRSTCODE = (int*)m_pModule->JBig2_Malloc2(sizeof(int), (LENMAX + 1));
+ for(i = 0; i < NTEMP; i++) {
+ LENCOUNT[PREFLEN[i]] ++;
+ }
+ CURLEN = 1;
+ FIRSTCODE[0] = 0;
+ LENCOUNT[0] = 0;
+ while(CURLEN <= LENMAX) {
+ FIRSTCODE[CURLEN] = (FIRSTCODE[CURLEN - 1] + LENCOUNT[CURLEN - 1]) << 1;
+ CURCODE = FIRSTCODE[CURLEN];
+ CURTEMP = 0;
+ while(CURTEMP < NTEMP) {
+ if(PREFLEN[CURTEMP] == CURLEN) {
+ CODES[CURTEMP] = CURCODE;
+ CURCODE = CURCODE + 1;
+ }
+ CURTEMP = CURTEMP + 1;
+ }
+ CURLEN = CURLEN + 1;
+ }
+ m_pModule->JBig2_Free(LENCOUNT);
+ m_pModule->JBig2_Free(FIRSTCODE);
+ return TRUE;
+failed:
+ return FALSE;
+}
diff --git a/core/src/fxcodec/jbig2/JBig2_HuffmanTable.h b/core/src/fxcodec/jbig2/JBig2_HuffmanTable.h
index df051c28d4..d68ced2fca 100644
--- a/core/src/fxcodec/jbig2/JBig2_HuffmanTable.h
+++ b/core/src/fxcodec/jbig2/JBig2_HuffmanTable.h
@@ -1,42 +1,42 @@
-// 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 _JBIG2_HUFFMAN_TABLE_H_
-#define _JBIG2_HUFFMAN_TABLE_H_
-#include "JBig2_Module.h"
-#include "JBig2_HuffmanTable_Standard.h"
-#include "JBig2_BitStream.h"
-class CJBig2_HuffmanTable : public CJBig2_Object
-{
-public:
-
- CJBig2_HuffmanTable(const JBig2TableLine *pTable, int nLines, FX_BOOL bHTOOB);
-
- CJBig2_HuffmanTable(CJBig2_BitStream *pStream);
-
- ~CJBig2_HuffmanTable();
-
- void init();
-
- int parseFromStandardTable(const JBig2TableLine *pTable, int nLines, FX_BOOL bHTOOB);
-
- int parseFromCodedBuffer(CJBig2_BitStream *pStream);
-
- FX_BOOL isOK()
- {
- return m_bOK;
- }
-private:
- FX_BOOL HTOOB;
- int NTEMP;
- int *CODES;
- int *PREFLEN;
- int *RANGELEN;
- int *RANGELOW;
- FX_BOOL m_bOK;
- friend class CJBig2_HuffmanDecoder;
-};
-#endif
+// 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 _JBIG2_HUFFMAN_TABLE_H_
+#define _JBIG2_HUFFMAN_TABLE_H_
+#include "JBig2_Module.h"
+#include "JBig2_HuffmanTable_Standard.h"
+#include "JBig2_BitStream.h"
+class CJBig2_HuffmanTable : public CJBig2_Object
+{
+public:
+
+ CJBig2_HuffmanTable(const JBig2TableLine *pTable, int nLines, FX_BOOL bHTOOB);
+
+ CJBig2_HuffmanTable(CJBig2_BitStream *pStream);
+
+ ~CJBig2_HuffmanTable();
+
+ void init();
+
+ int parseFromStandardTable(const JBig2TableLine *pTable, int nLines, FX_BOOL bHTOOB);
+
+ int parseFromCodedBuffer(CJBig2_BitStream *pStream);
+
+ FX_BOOL isOK()
+ {
+ return m_bOK;
+ }
+private:
+ FX_BOOL HTOOB;
+ int NTEMP;
+ int *CODES;
+ int *PREFLEN;
+ int *RANGELEN;
+ int *RANGELOW;
+ FX_BOOL m_bOK;
+ friend class CJBig2_HuffmanDecoder;
+};
+#endif
diff --git a/core/src/fxcodec/jbig2/JBig2_HuffmanTable_Standard.h b/core/src/fxcodec/jbig2/JBig2_HuffmanTable_Standard.h
index f6114364f1..428b2c3671 100644
--- a/core/src/fxcodec/jbig2/JBig2_HuffmanTable_Standard.h
+++ b/core/src/fxcodec/jbig2/JBig2_HuffmanTable_Standard.h
@@ -1,251 +1,251 @@
-// 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 _JBIG2_HUFFMAN_TABLE_STANDARD_H_
-#define _JBIG2_HUFFMAN_TABLE_STANDARD_H_
-typedef struct {
- int PREFLEN;
- int RANDELEN;
- int RANGELOW;
-} JBig2TableLine;
-const FX_BOOL HuffmanTable_HTOOB_B1 = FALSE;
-const JBig2TableLine HuffmanTable_B1[] = {
- { 1, 4, 0 },
- { 2, 8, 16 },
- { 3, 16, 272 },
- { 0, 32, -1 },
- { 3, 32, 65808 }
-};
-const FX_BOOL HuffmanTable_HTOOB_B2 = TRUE;
-const JBig2TableLine HuffmanTable_B2[] = {
- { 1, 0, 0 },
- { 2, 0, 1 },
- { 3, 0, 2 },
- { 4, 3, 3 },
- { 5, 6, 11 },
- { 0, 32, -1 },
- { 6, 32, 75 },
- { 6, 0, 0 }
-};
-const FX_BOOL HuffmanTable_HTOOB_B3 = TRUE;
-const JBig2TableLine HuffmanTable_B3[] = {
- { 8, 8, -256 },
- { 1, 0, 0 },
- { 2, 0, 1 },
- { 3, 0, 2 },
- { 4, 3, 3 },
- { 5, 6, 11 },
- { 8, 32, -257 },
- { 7, 32, 75 },
- { 6, 0, 0 }
-};
-const FX_BOOL HuffmanTable_HTOOB_B4 = FALSE;
-const JBig2TableLine HuffmanTable_B4[] = {
- { 1, 0, 1 },
- { 2, 0, 2 },
- { 3, 0, 3 },
- { 4, 3, 4 },
- { 5, 6, 12 },
- { 0, 32, -1 },
- { 5, 32, 76 },
-};
-const FX_BOOL HuffmanTable_HTOOB_B5 = FALSE;
-const JBig2TableLine HuffmanTable_B5[] = {
- { 7, 8, -255 },
- { 1, 0, 1 },
- { 2, 0, 2 },
- { 3, 0, 3 },
- { 4, 3, 4 },
- { 5, 6, 12 },
- { 7, 32, -256 },
- { 6, 32, 76 }
-};
-const FX_BOOL HuffmanTable_HTOOB_B6 = FALSE;
-const JBig2TableLine HuffmanTable_B6[] = {
- { 5, 10, -2048 },
- { 4, 9, -1024 },
- { 4, 8, -512 },
- { 4, 7, -256 },
- { 5, 6, -128 },
- { 5, 5, -64 },
- { 4, 5, -32 },
- { 2, 7, 0 },
- { 3, 7, 128 },
- { 3, 8, 256 },
- { 4, 9, 512 },
- { 4, 10, 1024 },
- { 6, 32, -2049 },
- { 6, 32, 2048 }
-};
-const FX_BOOL HuffmanTable_HTOOB_B7 = FALSE;
-const JBig2TableLine HuffmanTable_B7[] = {
- { 4, 9, -1024 },
- { 3, 8, -512 },
- { 4, 7, -256 },
- { 5, 6, -128 },
- { 5, 5, -64 },
- { 4, 5, -32 },
- { 4, 5, 0 },
- { 5, 5, 32 },
- { 5, 6, 64 },
- { 4, 7, 128 },
- { 3, 8, 256 },
- { 3, 9, 512 },
- { 3, 10, 1024 },
- { 5, 32, -1025 },
- { 5, 32, 2048 },
-};
-const FX_BOOL HuffmanTable_HTOOB_B8 = TRUE;
-const JBig2TableLine HuffmanTable_B8[] = {
- { 8, 3, -15 },
- { 9, 1, -7 },
- { 8, 1, -5 },
- { 9, 0, -3 },
- { 7, 0, -2 },
- { 4, 0, -1 },
- { 2, 1, 0 },
- { 5, 0, 2 },
- { 6, 0, 3 },
- { 3, 4, 4 },
- { 6, 1, 20 },
- { 4, 4, 22 },
- { 4, 5, 38 },
- { 5, 6, 70 },
- { 5, 7, 134 },
- { 6, 7, 262 },
- { 7, 8, 390 },
- { 6, 10, 646 },
- { 9, 32, -16 },
- { 9, 32, 1670 },
- { 2, 0, 0 }
-};
-const FX_BOOL HuffmanTable_HTOOB_B9 = TRUE;
-const JBig2TableLine HuffmanTable_B9[] = {
- { 8, 4, -31 },
- { 9, 2, -15 },
- { 8, 2, -11 },
- { 9, 1, -7 },
- { 7, 1, -5 },
- { 4, 1, -3 },
- { 3, 1, -1 },
- { 3, 1, 1 },
- { 5, 1, 3 },
- { 6, 1, 5 },
- { 3, 5, 7 },
- { 6, 2, 39 },
- { 4, 5, 43 },
- { 4, 6, 75 },
- { 5, 7, 139 },
- { 5, 8, 267 },
- { 6, 8, 523 },
- { 7, 9, 779 },
- { 6, 11, 1291 },
- { 9, 32, -32 },
- { 9, 32, 3339 },
- { 2, 0, 0 }
-};
-const FX_BOOL HuffmanTable_HTOOB_B10 = TRUE;
-const JBig2TableLine HuffmanTable_B10[] = {
- { 7, 4, -21 },
- { 8, 0, -5 },
- { 7, 0, -4 },
- { 5, 0, -3 },
- { 2, 2, -2 },
- { 5, 0, 2 },
- { 6, 0, 3 },
- { 7, 0, 4 },
- { 8, 0, 5 },
- { 2, 6, 6 },
- { 5, 5, 70 },
- { 6, 5, 102 },
- { 6, 6, 134 },
- { 6, 7, 198 },
- { 6, 8, 326 },
- { 6, 9, 582 },
- { 6, 10, 1094 },
- { 7, 11, 2118 },
- { 8, 32, -22 },
- { 8, 32, 4166 },
- { 2, 0, 0 }
-};
-const FX_BOOL HuffmanTable_HTOOB_B11 = FALSE;
-const JBig2TableLine HuffmanTable_B11[] = {
- { 1, 0, 1 },
- { 2, 1, 2 },
- { 4, 0, 4 },
- { 4, 1, 5 },
- { 5, 1, 7 },
- { 5, 2, 9 },
- { 6, 2, 13 },
- { 7, 2, 17 },
- { 7, 3, 21 },
- { 7, 4, 29 },
- { 7, 5, 45 },
- { 7, 6, 77 },
- { 0, 32, 0 },
- { 7, 32, 141 }
-};
-const FX_BOOL HuffmanTable_HTOOB_B12 = FALSE;
-const JBig2TableLine HuffmanTable_B12[] = {
- { 1, 0, 1 },
- { 2, 0, 2 },
- { 3, 1, 3 },
- { 5, 0, 5 },
- { 5, 1, 6 },
- { 6, 1, 8 },
- { 7, 0, 10 },
- { 7, 1, 11 },
- { 7, 2, 13 },
- { 7, 3, 17 },
- { 7, 4, 25 },
- { 8, 5, 41 },
- { 0, 32, 0 },
- { 8, 32, 73 }
-};
-const FX_BOOL HuffmanTable_HTOOB_B13 = FALSE;
-const JBig2TableLine HuffmanTable_B13[] = {
- { 1, 0, 1 },
- { 3, 0, 2 },
- { 4, 0, 3 },
- { 5, 0, 4 },
- { 4, 1, 5 },
- { 3, 3, 7 },
- { 6, 1, 15 },
- { 6, 2, 17 },
- { 6, 3, 21 },
- { 6, 4, 29 },
- { 6, 5, 45 },
- { 7, 6, 77 },
- { 0, 32, 0 },
- { 7, 32, 141 }
-};
-const FX_BOOL HuffmanTable_HTOOB_B14 = FALSE;
-const JBig2TableLine HuffmanTable_B14[] = {
- { 3, 0, -2 },
- { 3, 0, -1 },
- { 1, 0, 0 },
- { 3, 0, 1 },
- { 3, 0, 2 },
- { 0, 32, -3 },
- { 0, 32, 3 }
-};
-const FX_BOOL HuffmanTable_HTOOB_B15 = FALSE;
-const JBig2TableLine HuffmanTable_B15[] = {
- { 7, 4, -24 },
- { 6, 2, -8 },
- { 5, 1, -4 },
- { 4, 0, -2 },
- { 3, 0, -1 },
- { 1, 0, 0 },
- { 3, 0, 1 },
- { 4, 0, 2 },
- { 5, 1, 3 },
- { 6, 2, 5 },
- { 7, 4, 9 },
- { 7, 32, -25 },
- { 7, 32, 25 }
-};
-#endif
+// 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 _JBIG2_HUFFMAN_TABLE_STANDARD_H_
+#define _JBIG2_HUFFMAN_TABLE_STANDARD_H_
+typedef struct {
+ int PREFLEN;
+ int RANDELEN;
+ int RANGELOW;
+} JBig2TableLine;
+const FX_BOOL HuffmanTable_HTOOB_B1 = FALSE;
+const JBig2TableLine HuffmanTable_B1[] = {
+ { 1, 4, 0 },
+ { 2, 8, 16 },
+ { 3, 16, 272 },
+ { 0, 32, -1 },
+ { 3, 32, 65808 }
+};
+const FX_BOOL HuffmanTable_HTOOB_B2 = TRUE;
+const JBig2TableLine HuffmanTable_B2[] = {
+ { 1, 0, 0 },
+ { 2, 0, 1 },
+ { 3, 0, 2 },
+ { 4, 3, 3 },
+ { 5, 6, 11 },
+ { 0, 32, -1 },
+ { 6, 32, 75 },
+ { 6, 0, 0 }
+};
+const FX_BOOL HuffmanTable_HTOOB_B3 = TRUE;
+const JBig2TableLine HuffmanTable_B3[] = {
+ { 8, 8, -256 },
+ { 1, 0, 0 },
+ { 2, 0, 1 },
+ { 3, 0, 2 },
+ { 4, 3, 3 },
+ { 5, 6, 11 },
+ { 8, 32, -257 },
+ { 7, 32, 75 },
+ { 6, 0, 0 }
+};
+const FX_BOOL HuffmanTable_HTOOB_B4 = FALSE;
+const JBig2TableLine HuffmanTable_B4[] = {
+ { 1, 0, 1 },
+ { 2, 0, 2 },
+ { 3, 0, 3 },
+ { 4, 3, 4 },
+ { 5, 6, 12 },
+ { 0, 32, -1 },
+ { 5, 32, 76 },
+};
+const FX_BOOL HuffmanTable_HTOOB_B5 = FALSE;
+const JBig2TableLine HuffmanTable_B5[] = {
+ { 7, 8, -255 },
+ { 1, 0, 1 },
+ { 2, 0, 2 },
+ { 3, 0, 3 },
+ { 4, 3, 4 },
+ { 5, 6, 12 },
+ { 7, 32, -256 },
+ { 6, 32, 76 }
+};
+const FX_BOOL HuffmanTable_HTOOB_B6 = FALSE;
+const JBig2TableLine HuffmanTable_B6[] = {
+ { 5, 10, -2048 },
+ { 4, 9, -1024 },
+ { 4, 8, -512 },
+ { 4, 7, -256 },
+ { 5, 6, -128 },
+ { 5, 5, -64 },
+ { 4, 5, -32 },
+ { 2, 7, 0 },
+ { 3, 7, 128 },
+ { 3, 8, 256 },
+ { 4, 9, 512 },
+ { 4, 10, 1024 },
+ { 6, 32, -2049 },
+ { 6, 32, 2048 }
+};
+const FX_BOOL HuffmanTable_HTOOB_B7 = FALSE;
+const JBig2TableLine HuffmanTable_B7[] = {
+ { 4, 9, -1024 },
+ { 3, 8, -512 },
+ { 4, 7, -256 },
+ { 5, 6, -128 },
+ { 5, 5, -64 },
+ { 4, 5, -32 },
+ { 4, 5, 0 },
+ { 5, 5, 32 },
+ { 5, 6, 64 },
+ { 4, 7, 128 },
+ { 3, 8, 256 },
+ { 3, 9, 512 },
+ { 3, 10, 1024 },
+ { 5, 32, -1025 },
+ { 5, 32, 2048 },
+};
+const FX_BOOL HuffmanTable_HTOOB_B8 = TRUE;
+const JBig2TableLine HuffmanTable_B8[] = {
+ { 8, 3, -15 },
+ { 9, 1, -7 },
+ { 8, 1, -5 },
+ { 9, 0, -3 },
+ { 7, 0, -2 },
+ { 4, 0, -1 },
+ { 2, 1, 0 },
+ { 5, 0, 2 },
+ { 6, 0, 3 },
+ { 3, 4, 4 },
+ { 6, 1, 20 },
+ { 4, 4, 22 },
+ { 4, 5, 38 },
+ { 5, 6, 70 },
+ { 5, 7, 134 },
+ { 6, 7, 262 },
+ { 7, 8, 390 },
+ { 6, 10, 646 },
+ { 9, 32, -16 },
+ { 9, 32, 1670 },
+ { 2, 0, 0 }
+};
+const FX_BOOL HuffmanTable_HTOOB_B9 = TRUE;
+const JBig2TableLine HuffmanTable_B9[] = {
+ { 8, 4, -31 },
+ { 9, 2, -15 },
+ { 8, 2, -11 },
+ { 9, 1, -7 },
+ { 7, 1, -5 },
+ { 4, 1, -3 },
+ { 3, 1, -1 },
+ { 3, 1, 1 },
+ { 5, 1, 3 },
+ { 6, 1, 5 },
+ { 3, 5, 7 },
+ { 6, 2, 39 },
+ { 4, 5, 43 },
+ { 4, 6, 75 },
+ { 5, 7, 139 },
+ { 5, 8, 267 },
+ { 6, 8, 523 },
+ { 7, 9, 779 },
+ { 6, 11, 1291 },
+ { 9, 32, -32 },
+ { 9, 32, 3339 },
+ { 2, 0, 0 }
+};
+const FX_BOOL HuffmanTable_HTOOB_B10 = TRUE;
+const JBig2TableLine HuffmanTable_B10[] = {
+ { 7, 4, -21 },
+ { 8, 0, -5 },
+ { 7, 0, -4 },
+ { 5, 0, -3 },
+ { 2, 2, -2 },
+ { 5, 0, 2 },
+ { 6, 0, 3 },
+ { 7, 0, 4 },
+ { 8, 0, 5 },
+ { 2, 6, 6 },
+ { 5, 5, 70 },
+ { 6, 5, 102 },
+ { 6, 6, 134 },
+ { 6, 7, 198 },
+ { 6, 8, 326 },
+ { 6, 9, 582 },
+ { 6, 10, 1094 },
+ { 7, 11, 2118 },
+ { 8, 32, -22 },
+ { 8, 32, 4166 },
+ { 2, 0, 0 }
+};
+const FX_BOOL HuffmanTable_HTOOB_B11 = FALSE;
+const JBig2TableLine HuffmanTable_B11[] = {
+ { 1, 0, 1 },
+ { 2, 1, 2 },
+ { 4, 0, 4 },
+ { 4, 1, 5 },
+ { 5, 1, 7 },
+ { 5, 2, 9 },
+ { 6, 2, 13 },
+ { 7, 2, 17 },
+ { 7, 3, 21 },
+ { 7, 4, 29 },
+ { 7, 5, 45 },
+ { 7, 6, 77 },
+ { 0, 32, 0 },
+ { 7, 32, 141 }
+};
+const FX_BOOL HuffmanTable_HTOOB_B12 = FALSE;
+const JBig2TableLine HuffmanTable_B12[] = {
+ { 1, 0, 1 },
+ { 2, 0, 2 },
+ { 3, 1, 3 },
+ { 5, 0, 5 },
+ { 5, 1, 6 },
+ { 6, 1, 8 },
+ { 7, 0, 10 },
+ { 7, 1, 11 },
+ { 7, 2, 13 },
+ { 7, 3, 17 },
+ { 7, 4, 25 },
+ { 8, 5, 41 },
+ { 0, 32, 0 },
+ { 8, 32, 73 }
+};
+const FX_BOOL HuffmanTable_HTOOB_B13 = FALSE;
+const JBig2TableLine HuffmanTable_B13[] = {
+ { 1, 0, 1 },
+ { 3, 0, 2 },
+ { 4, 0, 3 },
+ { 5, 0, 4 },
+ { 4, 1, 5 },
+ { 3, 3, 7 },
+ { 6, 1, 15 },
+ { 6, 2, 17 },
+ { 6, 3, 21 },
+ { 6, 4, 29 },
+ { 6, 5, 45 },
+ { 7, 6, 77 },
+ { 0, 32, 0 },
+ { 7, 32, 141 }
+};
+const FX_BOOL HuffmanTable_HTOOB_B14 = FALSE;
+const JBig2TableLine HuffmanTable_B14[] = {
+ { 3, 0, -2 },
+ { 3, 0, -1 },
+ { 1, 0, 0 },
+ { 3, 0, 1 },
+ { 3, 0, 2 },
+ { 0, 32, -3 },
+ { 0, 32, 3 }
+};
+const FX_BOOL HuffmanTable_HTOOB_B15 = FALSE;
+const JBig2TableLine HuffmanTable_B15[] = {
+ { 7, 4, -24 },
+ { 6, 2, -8 },
+ { 5, 1, -4 },
+ { 4, 0, -2 },
+ { 3, 0, -1 },
+ { 1, 0, 0 },
+ { 3, 0, 1 },
+ { 4, 0, 2 },
+ { 5, 1, 3 },
+ { 6, 2, 5 },
+ { 7, 4, 9 },
+ { 7, 32, -25 },
+ { 7, 32, 25 }
+};
+#endif
diff --git a/core/src/fxcodec/jbig2/JBig2_Image.cpp b/core/src/fxcodec/jbig2/JBig2_Image.cpp
index 1719028176..09353c0e81 100644
--- a/core/src/fxcodec/jbig2/JBig2_Image.cpp
+++ b/core/src/fxcodec/jbig2/JBig2_Image.cpp
@@ -1,1619 +1,1619 @@
-// 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
-
-#include "JBig2_Image.h"
-#include "../../../include/fxcrt/fx_basic.h"
-#include "../../../include/fxcrt/fx_coordinates.h"
-#include <limits.h>
-CJBig2_Image::CJBig2_Image(FX_INT32 w, FX_INT32 h)
-{
- m_nWidth = w;
- m_nHeight = h;
- if (m_nWidth <= 0 || m_nHeight <= 0 || m_nWidth > INT_MAX - 31) {
- m_pData = NULL;
- m_bNeedFree = FALSE;
- return;
- }
- m_nStride = ((w + 31) >> 5) << 2;
- if (m_nStride * m_nHeight > 0 && 104857600 / (int)m_nStride > m_nHeight) {
- m_pData = (FX_BYTE *)m_pModule->JBig2_Malloc2(m_nStride, m_nHeight);
- } else {
- m_pData = NULL;
- }
- m_bNeedFree = TRUE;
-}
-CJBig2_Image::CJBig2_Image(FX_INT32 w, FX_INT32 h, FX_INT32 stride, FX_BYTE*pBuf)
-{
- m_nWidth = w;
- m_nHeight = h;
- m_nStride = stride;
- m_pData = pBuf;
- m_bNeedFree = FALSE;
-}
-CJBig2_Image::CJBig2_Image(CJBig2_Image &im)
-{
- m_pModule = im.m_pModule;
- m_nWidth = im.m_nWidth;
- m_nHeight = im.m_nHeight;
- m_nStride = im.m_nStride;
- if (im.m_pData) {
- m_pData = (FX_BYTE*)m_pModule->JBig2_Malloc2(m_nStride, m_nHeight);
- JBIG2_memcpy(m_pData, im.m_pData, m_nStride * m_nHeight);
- } else {
- m_pData = NULL;
- }
- m_bNeedFree = TRUE;
-}
-CJBig2_Image::~CJBig2_Image()
-{
- if(m_bNeedFree && m_pData) {
- m_pModule->JBig2_Free(m_pData);
- }
-}
-FX_BOOL CJBig2_Image::getPixel(FX_INT32 x, FX_INT32 y)
-{
- if (!m_pData) {
- return 0;
- }
- FX_INT32 m, n;
- if(x < 0 || x >= m_nWidth) {
- return 0;
- }
- if(y < 0 || y >= m_nHeight) {
- return 0;
- }
- m = y * m_nStride + (x >> 3);
- n = x & 7;
- return ((m_pData[m] >> (7 - n)) & 1);
-}
-
-FX_INT32 CJBig2_Image::setPixel(FX_INT32 x, FX_INT32 y, FX_BOOL v)
-{
- if (!m_pData) {
- return 0;
- }
- FX_INT32 m, n;
- if(x < 0 || x >= m_nWidth) {
- return 0;
- }
- if(y < 0 || y >= m_nHeight) {
- return 0;
- }
- m = y * m_nStride + (x >> 3);
- n = x & 7;
- if(v) {
- m_pData[m] |= 1 << (7 - n);
- } else {
- m_pData[m] &= ~(1 << (7 - n));
- }
- return 1;
-}
-void CJBig2_Image::copyLine(FX_INT32 hTo, FX_INT32 hFrom)
-{
- if (!m_pData) {
- return;
- }
- if(hFrom < 0 || hFrom >= m_nHeight) {
- JBIG2_memset(m_pData + hTo * m_nStride, 0, m_nStride);
- } else {
- JBIG2_memcpy(m_pData + hTo * m_nStride, m_pData + hFrom * m_nStride, m_nStride);
- }
-}
-void CJBig2_Image::fill(FX_BOOL v)
-{
- if (!m_pData) {
- return;
- }
- JBIG2_memset(m_pData, v ? 0xff : 0, m_nStride * m_nHeight);
-}
-FX_BOOL CJBig2_Image::composeTo(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, JBig2ComposeOp op)
-{
- if (!m_pData) {
- return FALSE;
- }
- return composeTo_opt2(pDst, x, y, op);
-}
-FX_BOOL CJBig2_Image::composeTo(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, JBig2ComposeOp op, const FX_RECT* pSrcRect)
-{
- if (!m_pData) {
- return FALSE;
- }
- if (NULL == pSrcRect || *pSrcRect == FX_RECT(0, 0, m_nWidth, m_nHeight)) {
- return composeTo_opt2(pDst, x, y, op);
- }
- return composeTo_opt2(pDst, x, y, op, pSrcRect);
-}
-FX_BOOL CJBig2_Image::composeTo_unopt(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, JBig2ComposeOp op)
-{
- FX_INT32 w, h, dx, dy;
- FX_INT32 i, j;
- w = m_nWidth;
- h = m_nHeight;
- dx = dy = 0;
- if(x < 0) {
- dx += -x;
- w -= -x;
- x = 0;
- }
- if(y < 0) {
- dy += -y;
- h -= -y;
- y = 0;
- }
- if(x + w > pDst->m_nWidth) {
- w = pDst->m_nWidth - x;
- }
- if(y + h > pDst->m_nHeight) {
- h = pDst->m_nHeight - y;
- }
- switch(op) {
- case JBIG2_COMPOSE_OR:
- for(j = 0; j < h; j++) {
- for(i = 0; i < w; i++) {
- pDst->setPixel(x + i, y + j,
- (getPixel(i + dx, j + dy) | pDst->getPixel(x + i, y + j)) & 1);
- }
- }
- break;
- case JBIG2_COMPOSE_AND:
- for(j = 0; j < h; j++) {
- for(i = 0; i < w; i++) {
- pDst->setPixel(x + i, y + j,
- (getPixel(i + dx, j + dy) & pDst->getPixel(x + i, y + j)) & 1);
- }
- }
- break;
- case JBIG2_COMPOSE_XOR:
- for(j = 0; j < h; j++) {
- for(i = 0; i < w; i++) {
- pDst->setPixel(x + i, y + j,
- (getPixel(i + dx, j + dy) ^ pDst->getPixel(x + i, y + j)) & 1);
- }
- }
- break;
- case JBIG2_COMPOSE_XNOR:
- for(j = 0; j < h; j++) {
- for(i = 0; i < w; i++) {
- pDst->setPixel(x + i, y + j,
- (~(getPixel(i + dx, j + dy) ^ pDst->getPixel(x + i, y + j))) & 1);
- }
- }
- break;
- case JBIG2_COMPOSE_REPLACE:
- for(j = 0; j < h; j++) {
- for(i = 0; i < w; i++) {
- pDst->setPixel(x + i, y + j, getPixel(i + dx, j + dy));
- }
- }
- break;
- }
- return TRUE;
-}
-
-FX_BOOL CJBig2_Image::composeTo_opt(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, JBig2ComposeOp op)
-{
- FX_INT32 x0, x1, y0, y1, xx, yy;
- FX_BYTE *pLineSrc, *pLineDst, *srcPtr, *destPtr;
- FX_DWORD src0, src1, src, dest, s1, s2, m1, m2, m3;
- FX_BOOL oneByte;
- if (!m_pData) {
- return FALSE;
- }
- if (y < 0) {
- y0 = -y;
- } else {
- y0 = 0;
- }
- if (y + m_nHeight > pDst->m_nHeight) {
- y1 = pDst->m_nHeight - y;
- } else {
- y1 = m_nHeight;
- }
- if (y0 >= y1) {
- return FALSE;
- }
- if (x >= 0) {
- x0 = x & ~7;
- } else {
- x0 = 0;
- }
- x1 = x + m_nWidth;
- if (x1 > pDst->m_nWidth) {
- x1 = pDst->m_nWidth;
- }
- if (x0 >= x1) {
- return FALSE;
- }
- s1 = x & 7;
- s2 = 8 - s1;
- m1 = 0xff >> (x1 & 7);
- m2 = 0xff << (((x1 & 7) == 0) ? 0 : 8 - (x1 & 7));
- m3 = (0xff >> s1) & m2;
- oneByte = x0 == ((x1 - 1) & ~7);
- pLineDst = pDst->m_pData + y * pDst->m_nStride;
- pLineSrc = m_pData + y0 * m_nStride;
- if(oneByte) {
- if(x >= 0) {
- switch(op) {
- case JBIG2_COMPOSE_OR: {
- for (yy = y0; yy < y1; ++yy) {
- destPtr = pLineDst + (x >> 3);
- srcPtr = pLineSrc;
- dest = *destPtr;
- dest |= (*srcPtr >> s1) & m2;
- *destPtr = (FX_BYTE)dest;
- pLineDst += pDst->m_nStride;
- pLineSrc += m_nStride;
- }
- }
- break;
- case JBIG2_COMPOSE_AND: {
- for (yy = y0; yy < y1; ++yy) {
- destPtr = pLineDst + (x >> 3);
- srcPtr = pLineSrc;
- dest = *destPtr;
- dest &= ((0xff00 | *srcPtr) >> s1) | m1;
- *destPtr = (FX_BYTE)dest;
- pLineDst += pDst->m_nStride;
- pLineSrc += m_nStride;
- }
- }
- break;
- case JBIG2_COMPOSE_XOR: {
- for (yy = y0; yy < y1; ++yy) {
- destPtr = pLineDst + (x >> 3);
- srcPtr = pLineSrc;
- dest = *destPtr;
- dest ^= (*srcPtr >> s1) & m2;
- *destPtr = (FX_BYTE)dest;
- pLineDst += pDst->m_nStride;
- pLineSrc += m_nStride;
- }
- }
- break;
- case JBIG2_COMPOSE_XNOR: {
- for (yy = y0; yy < y1; ++yy) {
- destPtr = pLineDst + (x >> 3);
- srcPtr = pLineSrc;
- dest = *destPtr;
- dest ^= ((*srcPtr ^ 0xff) >> s1) & m2;
- *destPtr = (FX_BYTE)dest;
- pLineDst += pDst->m_nStride;
- pLineSrc += m_nStride;
- }
- }
- break;
- case JBIG2_COMPOSE_REPLACE: {
- for (yy = y0; yy < y1; ++yy) {
- destPtr = pLineDst + (x >> 3);
- srcPtr = pLineSrc;
- dest = *destPtr;
- dest = (dest & ~m3) | ((*srcPtr >> s1) & m3);
- *destPtr = (FX_BYTE)dest;
- pLineDst += pDst->m_nStride;
- pLineSrc += m_nStride;
- }
- }
- break;
- }
- } else {
- switch(op) {
- case JBIG2_COMPOSE_OR: {
- for(yy = y0; yy < y1; ++yy) {
- destPtr = pLineDst;
- srcPtr = pLineSrc + (-x >> 3);
- dest = *destPtr;
- dest |= *srcPtr & m2;
- *destPtr = (FX_BYTE)dest;
- pLineDst += pDst->m_nStride;
- pLineSrc += m_nStride;
- }
- }
- break;
- case JBIG2_COMPOSE_AND: {
- for(yy = y0; yy < y1; ++yy) {
- destPtr = pLineDst;
- srcPtr = pLineSrc + (-x >> 3);
- dest = *destPtr;
- dest &= *srcPtr | m1;
- *destPtr = (FX_BYTE)dest;
- pLineDst += pDst->m_nStride;
- pLineSrc += m_nStride;
- }
- }
- break;
- case JBIG2_COMPOSE_XOR: {
- for(yy = y0; yy < y1; ++yy) {
- destPtr = pLineDst;
- srcPtr = pLineSrc + (-x >> 3);
- dest = *destPtr;
- dest ^= *srcPtr & m2;
- *destPtr = (FX_BYTE)dest;
- pLineDst += pDst->m_nStride;
- pLineSrc += m_nStride;
- }
- }
- break;
- case JBIG2_COMPOSE_XNOR: {
- for(yy = y0; yy < y1; ++yy) {
- destPtr = pLineDst;
- srcPtr = pLineSrc + (-x >> 3);
- dest = *destPtr;
- dest ^= (*srcPtr ^ 0xff) & m2;
- *destPtr = (FX_BYTE)dest;
- pLineDst += pDst->m_nStride;
- pLineSrc += m_nStride;
- }
- }
- break;
- case JBIG2_COMPOSE_REPLACE: {
- for(yy = y0; yy < y1; ++yy) {
- destPtr = pLineDst;
- srcPtr = pLineSrc + (-x >> 3);
- dest = *destPtr;
- dest = (*srcPtr & m2) | (dest & m1);
- *destPtr = (FX_BYTE)dest;
- pLineDst += pDst->m_nStride;
- pLineSrc += m_nStride;
- }
- }
- break;
- }
- }
- } else {
- if(x >= 0) {
- switch(op) {
- case JBIG2_COMPOSE_OR: {
- for(yy = y0; yy < y1; ++yy) {
- destPtr = pLineDst + (x >> 3);
- srcPtr = pLineSrc;
- src1 = *srcPtr++;
- dest = *destPtr;
- dest |= src1 >> s1;
- *destPtr++ = (FX_BYTE)dest;
- xx = x0 + 8;
- for (; xx < x1 - 8; xx += 8) {
- dest = *destPtr;
- src0 = src1;
- src1 = *srcPtr++;
- src = (((src0 << 8) | src1) >> s1) & 0xff;
- dest |= src;
- *destPtr++ = (FX_BYTE)dest;
- }
- dest = *destPtr;
- src0 = src1;
- if(srcPtr - pLineSrc < m_nStride) {
- src1 = *srcPtr++;
- } else {
- src1 = 0;
- }
- src = (((src0 << 8) | src1) >> s1) & 0xff;
- dest |= src & m2;
- *destPtr = (FX_BYTE)dest;
- pLineDst += pDst->m_nStride;
- pLineSrc += m_nStride;
- }
- }
- break;
- case JBIG2_COMPOSE_AND: {
- for(yy = y0; yy < y1; ++yy) {
- destPtr = pLineDst + (x >> 3);
- srcPtr = pLineSrc;
- src1 = *srcPtr++;
- dest = *destPtr;
- dest &= (0xff00 | src1) >> s1;
- *destPtr++ = (FX_BYTE)dest;
- xx = x0 + 8;
- for (; xx < x1 - 8; xx += 8) {
- dest = *destPtr;
- src0 = src1;
- src1 = *srcPtr++;
- src = (((src0 << 8) | src1) >> s1) & 0xff;
- dest &= src;
- *destPtr++ = (FX_BYTE)dest;
- }
- dest = *destPtr;
- src0 = src1;
- if(srcPtr - pLineSrc < m_nStride) {
- src1 = *srcPtr++;
- } else {
- src1 = 0;
- }
- src = (((src0 << 8) | src1) >> s1) & 0xff;
- dest &= src | m1;
- *destPtr = (FX_BYTE)dest;
- pLineDst += pDst->m_nStride;
- pLineSrc += m_nStride;
- }
- }
- break;
- case JBIG2_COMPOSE_XOR: {
- for(yy = y0; yy < y1; ++yy) {
- destPtr = pLineDst + (x >> 3);
- srcPtr = pLineSrc;
- src1 = *srcPtr++;
- dest = *destPtr;
- dest ^= src1 >> s1;
- *destPtr++ = (FX_BYTE)dest;
- xx = x0 + 8;
- for (; xx < x1 - 8; xx += 8) {
- dest = *destPtr;
- src0 = src1;
- src1 = *srcPtr++;
- src = (((src0 << 8) | src1) >> s1) & 0xff;
- dest ^= src;
- *destPtr++ = (FX_BYTE)dest;
- }
- dest = *destPtr;
- src0 = src1;
- if(srcPtr - pLineSrc < m_nStride) {
- src1 = *srcPtr++;
- } else {
- src1 = 0;
- }
- src = (((src0 << 8) | src1) >> s1) & 0xff;
- dest ^= src & m2;
- *destPtr = (FX_BYTE)dest;
- pLineDst += pDst->m_nStride;
- pLineSrc += m_nStride;
- }
- }
- break;
- case JBIG2_COMPOSE_XNOR: {
- for(yy = y0; yy < y1; ++yy) {
- destPtr = pLineDst + (x >> 3);
- srcPtr = pLineSrc;
- src1 = *srcPtr++;
- dest = *destPtr;
- dest ^= (src1 ^ 0xff) >> s1;
- *destPtr++ = (FX_BYTE)dest;
- xx = x0 + 8;
- for (; xx < x1 - 8; xx += 8) {
- dest = *destPtr;
- src0 = src1;
- src1 = *srcPtr++;
- src = (((src0 << 8) | src1) >> s1) & 0xff;
- dest ^= src ^ 0xff;
- *destPtr++ = (FX_BYTE)dest;
- }
- dest = *destPtr;
- src0 = src1;
- if(srcPtr - pLineSrc < m_nStride) {
- src1 = *srcPtr++;
- } else {
- src1 = 0;
- }
- src = (((src0 << 8) | src1) >> s1) & 0xff;
- dest ^= (src ^ 0xff) & m2;
- *destPtr = (FX_BYTE)dest;
- pLineDst += pDst->m_nStride;
- pLineSrc += m_nStride;
- }
- }
- break;
- case JBIG2_COMPOSE_REPLACE: {
- for(yy = y0; yy < y1; ++yy) {
- destPtr = pLineDst + (x >> 3);
- srcPtr = pLineSrc;
- src1 = *srcPtr++;
- dest = *destPtr;
- dest = (dest & (0xff << s2)) | (src1 >> s1);
- *destPtr++ = (FX_BYTE)dest;
- xx = x0 + 8;
- for (; xx < x1 - 8; xx += 8) {
- dest = *destPtr;
- src0 = src1;
- src1 = *srcPtr++;
- src = (((src0 << 8) | src1) >> s1) & 0xff;
- dest = src;
- *destPtr++ = (FX_BYTE)dest;
- }
- dest = *destPtr;
- src0 = src1;
- if(srcPtr - pLineSrc < m_nStride) {
- src1 = *srcPtr++;
- } else {
- src1 = 0;
- }
- src = (((src0 << 8) | src1) >> s1) & 0xff;
- dest = (src & m2) | (dest & m1);
- *destPtr = (FX_BYTE)dest;
- pLineDst += pDst->m_nStride;
- pLineSrc += m_nStride;
- }
- }
- break;
- }
- } else {
- switch(op) {
- case JBIG2_COMPOSE_OR: {
- for(yy = y0; yy < y1; ++yy) {
- destPtr = pLineDst;
- srcPtr = pLineSrc + (-x >> 3);
- src1 = *srcPtr++;
- xx = x0;
- for (; xx < x1 - 8; xx += 8) {
- dest = *destPtr;
- src0 = src1;
- src1 = *srcPtr++;
- src = (((src0 << 8) | src1) >> s1) & 0xff;
- dest |= src;
- *destPtr++ = (FX_BYTE)dest;
- }
- dest = *destPtr;
- src0 = src1;
- if(srcPtr - pLineSrc < m_nStride) {
- src1 = *srcPtr++;
- } else {
- src1 = 0;
- }
- src = (((src0 << 8) | src1) >> s1) & 0xff;
- dest |= src & m2;
- *destPtr = (FX_BYTE)dest;
- pLineDst += pDst->m_nStride;
- pLineSrc += m_nStride;
- }
- }
- break;
- case JBIG2_COMPOSE_AND: {
- for(yy = y0; yy < y1; ++yy) {
- destPtr = pLineDst;
- srcPtr = pLineSrc + (-x >> 3);
- src1 = *srcPtr++;
- xx = x0;
- for (; xx < x1 - 8; xx += 8) {
- dest = *destPtr;
- src0 = src1;
- src1 = *srcPtr++;
- src = (((src0 << 8) | src1) >> s1) & 0xff;
- dest &= src;
- *destPtr++ = (FX_BYTE)dest;
- }
- dest = *destPtr;
- src0 = src1;
- if(srcPtr - pLineSrc < m_nStride) {
- src1 = *srcPtr++;
- } else {
- src1 = 0;
- }
- src = (((src0 << 8) | src1) >> s1) & 0xff;
- dest &= src | m1;
- *destPtr = (FX_BYTE)dest;
- pLineDst += pDst->m_nStride;
- pLineSrc += m_nStride;
- }
- }
- break;
- case JBIG2_COMPOSE_XOR: {
- for(yy = y0; yy < y1; ++yy) {
- destPtr = pLineDst;
- srcPtr = pLineSrc + (-x >> 3);
- src1 = *srcPtr++;
- xx = x0;
- for (; xx < x1 - 8; xx += 8) {
- dest = *destPtr;
- src0 = src1;
- src1 = *srcPtr++;
- src = (((src0 << 8) | src1) >> s1) & 0xff;
- dest ^= src;
- *destPtr++ = (FX_BYTE)dest;
- }
- dest = *destPtr;
- src0 = src1;
- if(srcPtr - pLineSrc < m_nStride) {
- src1 = *srcPtr++;
- } else {
- src1 = 0;
- }
- src = (((src0 << 8) | src1) >> s1) & 0xff;
- dest ^= src & m2;
- *destPtr = (FX_BYTE)dest;
- pLineDst += pDst->m_nStride;
- pLineSrc += m_nStride;
- }
- }
- break;
- case JBIG2_COMPOSE_XNOR: {
- for(yy = y0; yy < y1; ++yy) {
- destPtr = pLineDst;
- srcPtr = pLineSrc + (-x >> 3);
- src1 = *srcPtr++;
- xx = x0;
- for (; xx < x1 - 8; xx += 8) {
- dest = *destPtr;
- src0 = src1;
- src1 = *srcPtr++;
- src = (((src0 << 8) | src1) >> s1) & 0xff;
- dest ^= src ^ 0xff;
- *destPtr++ = (FX_BYTE)dest;
- }
- dest = *destPtr;
- src0 = src1;
- if(srcPtr - pLineSrc < m_nStride) {
- src1 = *srcPtr++;
- } else {
- src1 = 0;
- }
- src = (((src0 << 8) | src1) >> s1) & 0xff;
- dest ^= (src ^ 0xff) & m2;
- *destPtr = (FX_BYTE)dest;
- pLineDst += pDst->m_nStride;
- pLineSrc += m_nStride;
- }
- }
- break;
- case JBIG2_COMPOSE_REPLACE: {
- for(yy = y0; yy < y1; ++yy) {
- destPtr = pLineDst;
- srcPtr = pLineSrc + (-x >> 3);
- src1 = *srcPtr++;
- xx = x0;
- for (; xx < x1 - 8; xx += 8) {
- dest = *destPtr;
- src0 = src1;
- src1 = *srcPtr++;
- src = (((src0 << 8) | src1) >> s1) & 0xff;
- dest = src;
- *destPtr++ = (FX_BYTE)dest;
- }
- dest = *destPtr;
- src0 = src1;
- if(srcPtr - pLineSrc < m_nStride) {
- src1 = *srcPtr++;
- } else {
- src1 = 0;
- }
- src = (((src0 << 8) | src1) >> s1) & 0xff;
- dest = (src & m2) | (dest & m1);
- *destPtr = (FX_BYTE)dest;
- pLineDst += pDst->m_nStride;
- pLineSrc += m_nStride;
- }
- }
- break;
- }
- }
- }
- return TRUE;
-}
-FX_BOOL CJBig2_Image::composeFrom(FX_INT32 x, FX_INT32 y, CJBig2_Image *pSrc, JBig2ComposeOp op)
-{
- if (!m_pData) {
- return FALSE;
- }
- return pSrc->composeTo(this, x, y, op);
-}
-FX_BOOL CJBig2_Image::composeFrom(FX_INT32 x, FX_INT32 y, CJBig2_Image *pSrc, JBig2ComposeOp op, const FX_RECT* pSrcRect)
-{
- if (!m_pData) {
- return FALSE;
- }
- return pSrc->composeTo(this, x, y, op, pSrcRect);
-}
-CJBig2_Image *CJBig2_Image::subImage_unopt(FX_INT32 x, FX_INT32 y, FX_INT32 w, FX_INT32 h)
-{
- CJBig2_Image *pImage;
- FX_INT32 i, j;
- JBIG2_ALLOC(pImage, CJBig2_Image(w, h));
- for(j = 0; j < h; j++) {
- for(i = 0; i < w; i++) {
- pImage->setPixel(i, j, getPixel(x + i, y + j));
- }
- }
- return pImage;
-}
-#define JBIG2_GETDWORD(buf) ((FX_DWORD)(((buf)[0] << 24) | ((buf)[1] << 16) | ((buf)[2] << 8) | (buf)[3]))
-CJBig2_Image *CJBig2_Image::subImage(FX_INT32 x, FX_INT32 y, FX_INT32 w, FX_INT32 h)
-{
- CJBig2_Image *pImage;
- FX_INT32 m, n, j;
- FX_BYTE *pLineSrc, *pLineDst;
- FX_DWORD wTmp;
- FX_BYTE *pSrc, *pSrcEnd, *pDst, *pDstEnd;
- if (w == 0 || h == 0) {
- return NULL;
- }
- JBIG2_ALLOC(pImage, CJBig2_Image(w, h));
- if (!m_pData) {
- pImage->fill(0);
- return pImage;
- }
- if (!pImage->m_pData) {
- return pImage;
- }
- pLineSrc = m_pData + m_nStride * y;
- pLineDst = pImage->m_pData;
- m = (x >> 5) << 2;
- n = x & 31;
- if(n == 0) {
- for(j = 0; j < h; j++) {
- pSrc = pLineSrc + m;
- pSrcEnd = pLineSrc + m_nStride;
- pDst = pLineDst;
- pDstEnd = pLineDst + pImage->m_nStride;
- for(; pDst < pDstEnd; pSrc += 4, pDst += 4) {
- *((FX_DWORD *)pDst) = *((FX_DWORD *)pSrc);
- }
- pLineSrc += m_nStride;
- pLineDst += pImage->m_nStride;
- }
- } else {
- for(j = 0; j < h; j++) {
- pSrc = pLineSrc + m;
- pSrcEnd = pLineSrc + m_nStride;
- pDst = pLineDst;
- pDstEnd = pLineDst + pImage->m_nStride;
- for(; pDst < pDstEnd; pSrc += 4, pDst += 4) {
- if(pSrc + 4 < pSrcEnd) {
- wTmp = (JBIG2_GETDWORD(pSrc) << n) | (JBIG2_GETDWORD(pSrc + 4) >> (32 - n));
- } else {
- wTmp = JBIG2_GETDWORD(pSrc) << n;
- }
- pDst[0] = (FX_BYTE)(wTmp >> 24);
- pDst[1] = (FX_BYTE)(wTmp >> 16);
- pDst[2] = (FX_BYTE)(wTmp >> 8);
- pDst[3] = (FX_BYTE)wTmp;
- }
- pLineSrc += m_nStride;
- pLineDst += pImage->m_nStride;
- }
- }
- return pImage;
-}
-void CJBig2_Image::expand(FX_INT32 h, FX_BOOL v)
-{
- if (!m_pData) {
- return;
- }
- m_pData = (FX_BYTE*)m_pModule->JBig2_Realloc(m_pData, h * m_nStride);
- if(h > m_nHeight) {
- JBIG2_memset(m_pData + m_nHeight * m_nStride, v ? 0xff : 0, (h - m_nHeight)*m_nStride);
- }
- m_nHeight = h;
-}
-FX_BOOL CJBig2_Image::composeTo_opt2(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, JBig2ComposeOp op)
-{
- FX_INT32 xs0, ys0, xs1, ys1, xd0, yd0, xd1, yd1, xx, yy, w, h, middleDwords, lineLeft;
- FX_DWORD s1, d1, d2, shift, shift1, shift2, tmp, tmp1, tmp2, maskL, maskR, maskM;
- FX_BYTE *lineSrc, *lineDst, *sp, *dp;
- if (!m_pData) {
- return FALSE;
- }
- if (x < -1048576 || x > 1048576 || y < -1048576 || y > 1048576) {
- return FALSE;
- }
- if(y < 0) {
- ys0 = -y;
- } else {
- ys0 = 0;
- }
- if(y + m_nHeight > pDst->m_nHeight) {
- ys1 = pDst->m_nHeight - y;
- } else {
- ys1 = m_nHeight;
- }
- if(x < 0) {
- xs0 = -x;
- } else {
- xs0 = 0;
- }
- if(x + m_nWidth > pDst->m_nWidth) {
- xs1 = pDst->m_nWidth - x;
- } else {
- xs1 = m_nWidth;
- }
- if((ys0 >= ys1) || (xs0 >= xs1)) {
- return 0;
- }
- w = xs1 - xs0;
- h = ys1 - ys0;
- if(y < 0) {
- yd0 = 0;
- } else {
- yd0 = y;
- }
- if(x < 0) {
- xd0 = 0;
- } else {
- xd0 = x;
- }
- xd1 = xd0 + w;
- yd1 = yd0 + h;
- d1 = xd0 & 31;
- d2 = xd1 & 31;
- s1 = xs0 & 31;
- maskL = 0xffffffff >> d1;
- maskR = 0xffffffff << ((32 - (xd1 & 31)) % 32);
- maskM = maskL & maskR;
- lineSrc = m_pData + ys0 * m_nStride + ((xs0 >> 5) << 2);
- lineLeft = m_nStride - ((xs0 >> 5) << 2);
- lineDst = pDst->m_pData + yd0 * pDst->m_nStride + ((xd0 >> 5) << 2);
- if((xd0 & ~31) == ((xd1 - 1) & ~31)) {
- if((xs0 & ~31) == ((xs1 - 1) & ~31)) {
- if(s1 > d1) {
- shift = s1 - d1;
- for(yy = yd0; yy < yd1; yy++) {
- tmp1 = JBIG2_GETDWORD(lineSrc) << shift;
- tmp2 = JBIG2_GETDWORD(lineDst);
- switch(op) {
- case JBIG2_COMPOSE_OR:
- tmp = (tmp2 & ~maskM) | ((tmp1 | tmp2) & maskM);
- break;
- case JBIG2_COMPOSE_AND:
- tmp = (tmp2 & ~maskM) | ((tmp1 & tmp2) & maskM);
- break;
- case JBIG2_COMPOSE_XOR:
- tmp = (tmp2 & ~maskM) | ((tmp1 ^ tmp2) & maskM);
- break;
- case JBIG2_COMPOSE_XNOR:
- tmp = (tmp2 & ~maskM) | ((~(tmp1 ^ tmp2)) & maskM);
- break;
- case JBIG2_COMPOSE_REPLACE:
- tmp = (tmp2 & ~maskM) | (tmp1 & maskM);
- break;
- }
- lineDst[0] = (FX_BYTE)(tmp >> 24);
- lineDst[1] = (FX_BYTE)(tmp >> 16);
- lineDst[2] = (FX_BYTE)(tmp >> 8);
- lineDst[3] = (FX_BYTE)tmp;
- lineSrc += m_nStride;
- lineDst += pDst->m_nStride;
- }
- } else {
- shift = d1 - s1;
- for(yy = yd0; yy < yd1; yy++) {
- tmp1 = JBIG2_GETDWORD(lineSrc) >> shift;
- tmp2 = JBIG2_GETDWORD(lineDst);
- switch(op) {
- case JBIG2_COMPOSE_OR:
- tmp = (tmp2 & ~maskM) | ((tmp1 | tmp2) & maskM);
- break;
- case JBIG2_COMPOSE_AND:
- tmp = (tmp2 & ~maskM) | ((tmp1 & tmp2) & maskM);
- break;
- case JBIG2_COMPOSE_XOR:
- tmp = (tmp2 & ~maskM) | ((tmp1 ^ tmp2) & maskM);
- break;
- case JBIG2_COMPOSE_XNOR:
- tmp = (tmp2 & ~maskM) | ((~(tmp1 ^ tmp2)) & maskM);
- break;
- case JBIG2_COMPOSE_REPLACE:
- tmp = (tmp2 & ~maskM) | (tmp1 & maskM);
- break;
- }
- lineDst[0] = (FX_BYTE)(tmp >> 24);
- lineDst[1] = (FX_BYTE)(tmp >> 16);
- lineDst[2] = (FX_BYTE)(tmp >> 8);
- lineDst[3] = (FX_BYTE)tmp;
- lineSrc += m_nStride;
- lineDst += pDst->m_nStride;
- }
- }
- } else {
- shift1 = s1 - d1;
- shift2 = 32 - shift1;
- for(yy = yd0; yy < yd1; yy++) {
- tmp1 = (JBIG2_GETDWORD(lineSrc) << shift1) | (JBIG2_GETDWORD(lineSrc + 4) >> shift2);
- tmp2 = JBIG2_GETDWORD(lineDst);
- switch(op) {
- case JBIG2_COMPOSE_OR:
- tmp = (tmp2 & ~maskM) | ((tmp1 | tmp2) & maskM);
- break;
- case JBIG2_COMPOSE_AND:
- tmp = (tmp2 & ~maskM) | ((tmp1 & tmp2) & maskM);
- break;
- case JBIG2_COMPOSE_XOR:
- tmp = (tmp2 & ~maskM) | ((tmp1 ^ tmp2) & maskM);
- break;
- case JBIG2_COMPOSE_XNOR:
- tmp = (tmp2 & ~maskM) | ((~(tmp1 ^ tmp2)) & maskM);
- break;
- case JBIG2_COMPOSE_REPLACE:
- tmp = (tmp2 & ~maskM) | (tmp1 & maskM);
- break;
- }
- lineDst[0] = (FX_BYTE)(tmp >> 24);
- lineDst[1] = (FX_BYTE)(tmp >> 16);
- lineDst[2] = (FX_BYTE)(tmp >> 8);
- lineDst[3] = (FX_BYTE)tmp;
- lineSrc += m_nStride;
- lineDst += pDst->m_nStride;
- }
- }
- } else {
- if(s1 > d1) {
- shift1 = s1 - d1;
- shift2 = 32 - shift1;
- middleDwords = (xd1 >> 5) - ((xd0 + 31) >> 5);
- for(yy = yd0; yy < yd1; yy++) {
- sp = lineSrc;
- dp = lineDst;
- if(d1 != 0) {
- tmp1 = (JBIG2_GETDWORD(sp) << shift1) | (JBIG2_GETDWORD(sp + 4) >> shift2);
- tmp2 = JBIG2_GETDWORD(dp);
- switch(op) {
- case JBIG2_COMPOSE_OR:
- tmp = (tmp2 & ~maskL) | ((tmp1 | tmp2) & maskL);
- break;
- case JBIG2_COMPOSE_AND:
- tmp = (tmp2 & ~maskL) | ((tmp1 & tmp2) & maskL);
- break;
- case JBIG2_COMPOSE_XOR:
- tmp = (tmp2 & ~maskL) | ((tmp1 ^ tmp2) & maskL);
- break;
- case JBIG2_COMPOSE_XNOR:
- tmp = (tmp2 & ~maskL) | ((~(tmp1 ^ tmp2)) & maskL);
- break;
- case JBIG2_COMPOSE_REPLACE:
- tmp = (tmp2 & ~maskL) | (tmp1 & maskL);
- break;
- }
- dp[0] = (FX_BYTE)(tmp >> 24);
- dp[1] = (FX_BYTE)(tmp >> 16);
- dp[2] = (FX_BYTE)(tmp >> 8);
- dp[3] = (FX_BYTE)tmp;
- sp += 4;
- dp += 4;
- }
- for(xx = 0; xx < middleDwords; xx++) {
- tmp1 = (JBIG2_GETDWORD(sp) << shift1) | (JBIG2_GETDWORD(sp + 4) >> shift2);
- tmp2 = JBIG2_GETDWORD(dp);
- switch(op) {
- case JBIG2_COMPOSE_OR:
- tmp = tmp1 | tmp2;
- break;
- case JBIG2_COMPOSE_AND:
- tmp = tmp1 & tmp2;
- break;
- case JBIG2_COMPOSE_XOR:
- tmp = tmp1 ^ tmp2;
- break;
- case JBIG2_COMPOSE_XNOR:
- tmp = ~(tmp1 ^ tmp2);
- break;
- case JBIG2_COMPOSE_REPLACE:
- tmp = tmp1;
- break;
- }
- dp[0] = (FX_BYTE)(tmp >> 24);
- dp[1] = (FX_BYTE)(tmp >> 16);
- dp[2] = (FX_BYTE)(tmp >> 8);
- dp[3] = (FX_BYTE)tmp;
- sp += 4;
- dp += 4;
- }
- if(d2 != 0) {
- tmp1 = (JBIG2_GETDWORD(sp) << shift1) | (
- ((sp + 4) < lineSrc + lineLeft ? JBIG2_GETDWORD(sp + 4) : 0) >> shift2);
- tmp2 = JBIG2_GETDWORD(dp);
- switch(op) {
- case JBIG2_COMPOSE_OR:
- tmp = (tmp2 & ~maskR) | ((tmp1 | tmp2) & maskR);
- break;
- case JBIG2_COMPOSE_AND:
- tmp = (tmp2 & ~maskR) | ((tmp1 & tmp2) & maskR);
- break;
- case JBIG2_COMPOSE_XOR:
- tmp = (tmp2 & ~maskR) | ((tmp1 ^ tmp2) & maskR);
- break;
- case JBIG2_COMPOSE_XNOR:
- tmp = (tmp2 & ~maskR) | ((~(tmp1 ^ tmp2)) & maskR);
- break;
- case JBIG2_COMPOSE_REPLACE:
- tmp = (tmp2 & ~maskR) | (tmp1 & maskR);
- break;
- }
- dp[0] = (FX_BYTE)(tmp >> 24);
- dp[1] = (FX_BYTE)(tmp >> 16);
- dp[2] = (FX_BYTE)(tmp >> 8);
- dp[3] = (FX_BYTE)tmp;
- }
- lineSrc += m_nStride;
- lineDst += pDst->m_nStride;
- }
- } else if(s1 == d1) {
- middleDwords = (xd1 >> 5) - ((xd0 + 31) >> 5);
- for(yy = yd0; yy < yd1; yy++) {
- sp = lineSrc;
- dp = lineDst;
- if(d1 != 0) {
- tmp1 = JBIG2_GETDWORD(sp);
- tmp2 = JBIG2_GETDWORD(dp);
- switch(op) {
- case JBIG2_COMPOSE_OR:
- tmp = (tmp2 & ~maskL) | ((tmp1 | tmp2) & maskL);
- break;
- case JBIG2_COMPOSE_AND:
- tmp = (tmp2 & ~maskL) | ((tmp1 & tmp2) & maskL);
- break;
- case JBIG2_COMPOSE_XOR:
- tmp = (tmp2 & ~maskL) | ((tmp1 ^ tmp2) & maskL);
- break;
- case JBIG2_COMPOSE_XNOR:
- tmp = (tmp2 & ~maskL) | ((~(tmp1 ^ tmp2)) & maskL);
- break;
- case JBIG2_COMPOSE_REPLACE:
- tmp = (tmp2 & ~maskL) | (tmp1 & maskL);
- break;
- }
- dp[0] = (FX_BYTE)(tmp >> 24);
- dp[1] = (FX_BYTE)(tmp >> 16);
- dp[2] = (FX_BYTE)(tmp >> 8);
- dp[3] = (FX_BYTE)tmp;
- sp += 4;
- dp += 4;
- }
- for(xx = 0; xx < middleDwords; xx++) {
- tmp1 = JBIG2_GETDWORD(sp);
- tmp2 = JBIG2_GETDWORD(dp);
- switch(op) {
- case JBIG2_COMPOSE_OR:
- tmp = tmp1 | tmp2;
- break;
- case JBIG2_COMPOSE_AND:
- tmp = tmp1 & tmp2;
- break;
- case JBIG2_COMPOSE_XOR:
- tmp = tmp1 ^ tmp2;
- break;
- case JBIG2_COMPOSE_XNOR:
- tmp = ~(tmp1 ^ tmp2);
- break;
- case JBIG2_COMPOSE_REPLACE:
- tmp = tmp1;
- break;
- }
- dp[0] = (FX_BYTE)(tmp >> 24);
- dp[1] = (FX_BYTE)(tmp >> 16);
- dp[2] = (FX_BYTE)(tmp >> 8);
- dp[3] = (FX_BYTE)tmp;
- sp += 4;
- dp += 4;
- }
- if(d2 != 0) {
- tmp1 = JBIG2_GETDWORD(sp);
- tmp2 = JBIG2_GETDWORD(dp);
- switch(op) {
- case JBIG2_COMPOSE_OR:
- tmp = (tmp2 & ~maskR) | ((tmp1 | tmp2) & maskR);
- break;
- case JBIG2_COMPOSE_AND:
- tmp = (tmp2 & ~maskR) | ((tmp1 & tmp2) & maskR);
- break;
- case JBIG2_COMPOSE_XOR:
- tmp = (tmp2 & ~maskR) | ((tmp1 ^ tmp2) & maskR);
- break;
- case JBIG2_COMPOSE_XNOR:
- tmp = (tmp2 & ~maskR) | ((~(tmp1 ^ tmp2)) & maskR);
- break;
- case JBIG2_COMPOSE_REPLACE:
- tmp = (tmp2 & ~maskR) | (tmp1 & maskR);
- break;
- }
- dp[0] = (FX_BYTE)(tmp >> 24);
- dp[1] = (FX_BYTE)(tmp >> 16);
- dp[2] = (FX_BYTE)(tmp >> 8);
- dp[3] = (FX_BYTE)tmp;
- }
- lineSrc += m_nStride;
- lineDst += pDst->m_nStride;
- }
- } else {
- shift1 = d1 - s1;
- shift2 = 32 - shift1;
- middleDwords = (xd1 >> 5) - ((xd0 + 31) >> 5);
- for(yy = yd0; yy < yd1; yy++) {
- sp = lineSrc;
- dp = lineDst;
- if(d1 != 0) {
- tmp1 = JBIG2_GETDWORD(sp) >> shift1;
- tmp2 = JBIG2_GETDWORD(dp);
- switch(op) {
- case JBIG2_COMPOSE_OR:
- tmp = (tmp2 & ~maskL) | ((tmp1 | tmp2) & maskL);
- break;
- case JBIG2_COMPOSE_AND:
- tmp = (tmp2 & ~maskL) | ((tmp1 & tmp2) & maskL);
- break;
- case JBIG2_COMPOSE_XOR:
- tmp = (tmp2 & ~maskL) | ((tmp1 ^ tmp2) & maskL);
- break;
- case JBIG2_COMPOSE_XNOR:
- tmp = (tmp2 & ~maskL) | ((~(tmp1 ^ tmp2)) & maskL);
- break;
- case JBIG2_COMPOSE_REPLACE:
- tmp = (tmp2 & ~maskL) | (tmp1 & maskL);
- break;
- }
- dp[0] = (FX_BYTE)(tmp >> 24);
- dp[1] = (FX_BYTE)(tmp >> 16);
- dp[2] = (FX_BYTE)(tmp >> 8);
- dp[3] = (FX_BYTE)tmp;
- dp += 4;
- }
- for(xx = 0; xx < middleDwords; xx++) {
- tmp1 = (JBIG2_GETDWORD(sp) << shift2) | ((JBIG2_GETDWORD(sp + 4)) >> shift1);
- tmp2 = JBIG2_GETDWORD(dp);
- switch(op) {
- case JBIG2_COMPOSE_OR:
- tmp = tmp1 | tmp2;
- break;
- case JBIG2_COMPOSE_AND:
- tmp = tmp1 & tmp2;
- break;
- case JBIG2_COMPOSE_XOR:
- tmp = tmp1 ^ tmp2;
- break;
- case JBIG2_COMPOSE_XNOR:
- tmp = ~(tmp1 ^ tmp2);
- break;
- case JBIG2_COMPOSE_REPLACE:
- tmp = tmp1;
- break;
- }
- dp[0] = (FX_BYTE)(tmp >> 24);
- dp[1] = (FX_BYTE)(tmp >> 16);
- dp[2] = (FX_BYTE)(tmp >> 8);
- dp[3] = (FX_BYTE)tmp;
- sp += 4;
- dp += 4;
- }
- if(d2 != 0) {
- tmp1 = (JBIG2_GETDWORD(sp) << shift2) | (
- ((sp + 4) < lineSrc + lineLeft ? JBIG2_GETDWORD(sp + 4) : 0) >> shift1);
- tmp2 = JBIG2_GETDWORD(dp);
- switch(op) {
- case JBIG2_COMPOSE_OR:
- tmp = (tmp2 & ~maskR) | ((tmp1 | tmp2) & maskR);
- break;
- case JBIG2_COMPOSE_AND:
- tmp = (tmp2 & ~maskR) | ((tmp1 & tmp2) & maskR);
- break;
- case JBIG2_COMPOSE_XOR:
- tmp = (tmp2 & ~maskR) | ((tmp1 ^ tmp2) & maskR);
- break;
- case JBIG2_COMPOSE_XNOR:
- tmp = (tmp2 & ~maskR) | ((~(tmp1 ^ tmp2)) & maskR);
- break;
- case JBIG2_COMPOSE_REPLACE:
- tmp = (tmp2 & ~maskR) | (tmp1 & maskR);
- break;
- }
- dp[0] = (FX_BYTE)(tmp >> 24);
- dp[1] = (FX_BYTE)(tmp >> 16);
- dp[2] = (FX_BYTE)(tmp >> 8);
- dp[3] = (FX_BYTE)tmp;
- }
- lineSrc += m_nStride;
- lineDst += pDst->m_nStride;
- }
- }
- }
- return 1;
-}
-FX_BOOL CJBig2_Image::composeTo_opt2(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, JBig2ComposeOp op, const FX_RECT* pSrcRect)
-{
- FX_INT32 xs0, ys0, xs1, ys1, xd0, yd0, xd1, yd1, xx, yy, w, h, middleDwords, lineLeft;
- FX_DWORD s1, d1, d2, shift, shift1, shift2, tmp, tmp1, tmp2, maskL, maskR, maskM;
- FX_BYTE *lineSrc, *lineDst, *sp, *dp;
- FX_INT32 sw, sh;
- if (!m_pData) {
- return FALSE;
- }
- if (x < -1048576 || x > 1048576 || y < -1048576 || y > 1048576) {
- return FALSE;
- }
- sw = pSrcRect->Width();
- sh = pSrcRect->Height();
- if(y < 0) {
- ys0 = -y;
- } else {
- ys0 = 0;
- }
- if(y + sh > pDst->m_nHeight) {
- ys1 = pDst->m_nHeight - y;
- } else {
- ys1 = sh;
- }
- if(x < 0) {
- xs0 = -x;
- } else {
- xs0 = 0;
- }
- if(x + sw > pDst->m_nWidth) {
- xs1 = pDst->m_nWidth - x;
- } else {
- xs1 = sw;
- }
- if((ys0 >= ys1) || (xs0 >= xs1)) {
- return 0;
- }
- w = xs1 - xs0;
- h = ys1 - ys0;
- if(y < 0) {
- yd0 = 0;
- } else {
- yd0 = y;
- }
- if(x < 0) {
- xd0 = 0;
- } else {
- xd0 = x;
- }
- xd1 = xd0 + w;
- yd1 = yd0 + h;
- d1 = xd0 & 31;
- d2 = xd1 & 31;
- s1 = xs0 & 31;
- maskL = 0xffffffff >> d1;
- maskR = 0xffffffff << ((32 - (xd1 & 31)) % 32);
- maskM = maskL & maskR;
- lineSrc = m_pData + (pSrcRect->top + ys0) * m_nStride + (((xs0 + pSrcRect->left) >> 5) << 2);
- lineLeft = m_nStride - ((xs0 >> 5) << 2);
- lineDst = pDst->m_pData + yd0 * pDst->m_nStride + ((xd0 >> 5) << 2);
- if((xd0 & ~31) == ((xd1 - 1) & ~31)) {
- if((xs0 & ~31) == ((xs1 - 1) & ~31)) {
- if(s1 > d1) {
- shift = s1 - d1;
- for(yy = yd0; yy < yd1; yy++) {
- tmp1 = JBIG2_GETDWORD(lineSrc) << shift;
- tmp2 = JBIG2_GETDWORD(lineDst);
- switch(op) {
- case JBIG2_COMPOSE_OR:
- tmp = (tmp2 & ~maskM) | ((tmp1 | tmp2) & maskM);
- break;
- case JBIG2_COMPOSE_AND:
- tmp = (tmp2 & ~maskM) | ((tmp1 & tmp2) & maskM);
- break;
- case JBIG2_COMPOSE_XOR:
- tmp = (tmp2 & ~maskM) | ((tmp1 ^ tmp2) & maskM);
- break;
- case JBIG2_COMPOSE_XNOR:
- tmp = (tmp2 & ~maskM) | ((~(tmp1 ^ tmp2)) & maskM);
- break;
- case JBIG2_COMPOSE_REPLACE:
- tmp = (tmp2 & ~maskM) | (tmp1 & maskM);
- break;
- }
- lineDst[0] = (FX_BYTE)(tmp >> 24);
- lineDst[1] = (FX_BYTE)(tmp >> 16);
- lineDst[2] = (FX_BYTE)(tmp >> 8);
- lineDst[3] = (FX_BYTE)tmp;
- lineSrc += m_nStride;
- lineDst += pDst->m_nStride;
- }
- } else {
- shift = d1 - s1;
- for(yy = yd0; yy < yd1; yy++) {
- tmp1 = JBIG2_GETDWORD(lineSrc) >> shift;
- tmp2 = JBIG2_GETDWORD(lineDst);
- switch(op) {
- case JBIG2_COMPOSE_OR:
- tmp = (tmp2 & ~maskM) | ((tmp1 | tmp2) & maskM);
- break;
- case JBIG2_COMPOSE_AND:
- tmp = (tmp2 & ~maskM) | ((tmp1 & tmp2) & maskM);
- break;
- case JBIG2_COMPOSE_XOR:
- tmp = (tmp2 & ~maskM) | ((tmp1 ^ tmp2) & maskM);
- break;
- case JBIG2_COMPOSE_XNOR:
- tmp = (tmp2 & ~maskM) | ((~(tmp1 ^ tmp2)) & maskM);
- break;
- case JBIG2_COMPOSE_REPLACE:
- tmp = (tmp2 & ~maskM) | (tmp1 & maskM);
- break;
- }
- lineDst[0] = (FX_BYTE)(tmp >> 24);
- lineDst[1] = (FX_BYTE)(tmp >> 16);
- lineDst[2] = (FX_BYTE)(tmp >> 8);
- lineDst[3] = (FX_BYTE)tmp;
- lineSrc += m_nStride;
- lineDst += pDst->m_nStride;
- }
- }
- } else {
- shift1 = s1 - d1;
- shift2 = 32 - shift1;
- for(yy = yd0; yy < yd1; yy++) {
- tmp1 = (JBIG2_GETDWORD(lineSrc) << shift1) | (JBIG2_GETDWORD(lineSrc + 4) >> shift2);
- tmp2 = JBIG2_GETDWORD(lineDst);
- switch(op) {
- case JBIG2_COMPOSE_OR:
- tmp = (tmp2 & ~maskM) | ((tmp1 | tmp2) & maskM);
- break;
- case JBIG2_COMPOSE_AND:
- tmp = (tmp2 & ~maskM) | ((tmp1 & tmp2) & maskM);
- break;
- case JBIG2_COMPOSE_XOR:
- tmp = (tmp2 & ~maskM) | ((tmp1 ^ tmp2) & maskM);
- break;
- case JBIG2_COMPOSE_XNOR:
- tmp = (tmp2 & ~maskM) | ((~(tmp1 ^ tmp2)) & maskM);
- break;
- case JBIG2_COMPOSE_REPLACE:
- tmp = (tmp2 & ~maskM) | (tmp1 & maskM);
- break;
- }
- lineDst[0] = (FX_BYTE)(tmp >> 24);
- lineDst[1] = (FX_BYTE)(tmp >> 16);
- lineDst[2] = (FX_BYTE)(tmp >> 8);
- lineDst[3] = (FX_BYTE)tmp;
- lineSrc += m_nStride;
- lineDst += pDst->m_nStride;
- }
- }
- } else {
- if(s1 > d1) {
- shift1 = s1 - d1;
- shift2 = 32 - shift1;
- middleDwords = (xd1 >> 5) - ((xd0 + 31) >> 5);
- for(yy = yd0; yy < yd1; yy++) {
- sp = lineSrc;
- dp = lineDst;
- if(d1 != 0) {
- tmp1 = (JBIG2_GETDWORD(sp) << shift1) | (JBIG2_GETDWORD(sp + 4) >> shift2);
- tmp2 = JBIG2_GETDWORD(dp);
- switch(op) {
- case JBIG2_COMPOSE_OR:
- tmp = (tmp2 & ~maskL) | ((tmp1 | tmp2) & maskL);
- break;
- case JBIG2_COMPOSE_AND:
- tmp = (tmp2 & ~maskL) | ((tmp1 & tmp2) & maskL);
- break;
- case JBIG2_COMPOSE_XOR:
- tmp = (tmp2 & ~maskL) | ((tmp1 ^ tmp2) & maskL);
- break;
- case JBIG2_COMPOSE_XNOR:
- tmp = (tmp2 & ~maskL) | ((~(tmp1 ^ tmp2)) & maskL);
- break;
- case JBIG2_COMPOSE_REPLACE:
- tmp = (tmp2 & ~maskL) | (tmp1 & maskL);
- break;
- }
- dp[0] = (FX_BYTE)(tmp >> 24);
- dp[1] = (FX_BYTE)(tmp >> 16);
- dp[2] = (FX_BYTE)(tmp >> 8);
- dp[3] = (FX_BYTE)tmp;
- sp += 4;
- dp += 4;
- }
- for(xx = 0; xx < middleDwords; xx++) {
- tmp1 = (JBIG2_GETDWORD(sp) << shift1) | (JBIG2_GETDWORD(sp + 4) >> shift2);
- tmp2 = JBIG2_GETDWORD(dp);
- switch(op) {
- case JBIG2_COMPOSE_OR:
- tmp = tmp1 | tmp2;
- break;
- case JBIG2_COMPOSE_AND:
- tmp = tmp1 & tmp2;
- break;
- case JBIG2_COMPOSE_XOR:
- tmp = tmp1 ^ tmp2;
- break;
- case JBIG2_COMPOSE_XNOR:
- tmp = ~(tmp1 ^ tmp2);
- break;
- case JBIG2_COMPOSE_REPLACE:
- tmp = tmp1;
- break;
- }
- dp[0] = (FX_BYTE)(tmp >> 24);
- dp[1] = (FX_BYTE)(tmp >> 16);
- dp[2] = (FX_BYTE)(tmp >> 8);
- dp[3] = (FX_BYTE)tmp;
- sp += 4;
- dp += 4;
- }
- if(d2 != 0) {
- tmp1 = (JBIG2_GETDWORD(sp) << shift1) | (
- ((sp + 4) < lineSrc + lineLeft ? JBIG2_GETDWORD(sp + 4) : 0) >> shift2);
- tmp2 = JBIG2_GETDWORD(dp);
- switch(op) {
- case JBIG2_COMPOSE_OR:
- tmp = (tmp2 & ~maskR) | ((tmp1 | tmp2) & maskR);
- break;
- case JBIG2_COMPOSE_AND:
- tmp = (tmp2 & ~maskR) | ((tmp1 & tmp2) & maskR);
- break;
- case JBIG2_COMPOSE_XOR:
- tmp = (tmp2 & ~maskR) | ((tmp1 ^ tmp2) & maskR);
- break;
- case JBIG2_COMPOSE_XNOR:
- tmp = (tmp2 & ~maskR) | ((~(tmp1 ^ tmp2)) & maskR);
- break;
- case JBIG2_COMPOSE_REPLACE:
- tmp = (tmp2 & ~maskR) | (tmp1 & maskR);
- break;
- }
- dp[0] = (FX_BYTE)(tmp >> 24);
- dp[1] = (FX_BYTE)(tmp >> 16);
- dp[2] = (FX_BYTE)(tmp >> 8);
- dp[3] = (FX_BYTE)tmp;
- }
- lineSrc += m_nStride;
- lineDst += pDst->m_nStride;
- }
- } else if(s1 == d1) {
- middleDwords = (xd1 >> 5) - ((xd0 + 31) >> 5);
- for(yy = yd0; yy < yd1; yy++) {
- sp = lineSrc;
- dp = lineDst;
- if(d1 != 0) {
- tmp1 = JBIG2_GETDWORD(sp);
- tmp2 = JBIG2_GETDWORD(dp);
- switch(op) {
- case JBIG2_COMPOSE_OR:
- tmp = (tmp2 & ~maskL) | ((tmp1 | tmp2) & maskL);
- break;
- case JBIG2_COMPOSE_AND:
- tmp = (tmp2 & ~maskL) | ((tmp1 & tmp2) & maskL);
- break;
- case JBIG2_COMPOSE_XOR:
- tmp = (tmp2 & ~maskL) | ((tmp1 ^ tmp2) & maskL);
- break;
- case JBIG2_COMPOSE_XNOR:
- tmp = (tmp2 & ~maskL) | ((~(tmp1 ^ tmp2)) & maskL);
- break;
- case JBIG2_COMPOSE_REPLACE:
- tmp = (tmp2 & ~maskL) | (tmp1 & maskL);
- break;
- }
- dp[0] = (FX_BYTE)(tmp >> 24);
- dp[1] = (FX_BYTE)(tmp >> 16);
- dp[2] = (FX_BYTE)(tmp >> 8);
- dp[3] = (FX_BYTE)tmp;
- sp += 4;
- dp += 4;
- }
- for(xx = 0; xx < middleDwords; xx++) {
- tmp1 = JBIG2_GETDWORD(sp);
- tmp2 = JBIG2_GETDWORD(dp);
- switch(op) {
- case JBIG2_COMPOSE_OR:
- tmp = tmp1 | tmp2;
- break;
- case JBIG2_COMPOSE_AND:
- tmp = tmp1 & tmp2;
- break;
- case JBIG2_COMPOSE_XOR:
- tmp = tmp1 ^ tmp2;
- break;
- case JBIG2_COMPOSE_XNOR:
- tmp = ~(tmp1 ^ tmp2);
- break;
- case JBIG2_COMPOSE_REPLACE:
- tmp = tmp1;
- break;
- }
- dp[0] = (FX_BYTE)(tmp >> 24);
- dp[1] = (FX_BYTE)(tmp >> 16);
- dp[2] = (FX_BYTE)(tmp >> 8);
- dp[3] = (FX_BYTE)tmp;
- sp += 4;
- dp += 4;
- }
- if(d2 != 0) {
- tmp1 = JBIG2_GETDWORD(sp);
- tmp2 = JBIG2_GETDWORD(dp);
- switch(op) {
- case JBIG2_COMPOSE_OR:
- tmp = (tmp2 & ~maskR) | ((tmp1 | tmp2) & maskR);
- break;
- case JBIG2_COMPOSE_AND:
- tmp = (tmp2 & ~maskR) | ((tmp1 & tmp2) & maskR);
- break;
- case JBIG2_COMPOSE_XOR:
- tmp = (tmp2 & ~maskR) | ((tmp1 ^ tmp2) & maskR);
- break;
- case JBIG2_COMPOSE_XNOR:
- tmp = (tmp2 & ~maskR) | ((~(tmp1 ^ tmp2)) & maskR);
- break;
- case JBIG2_COMPOSE_REPLACE:
- tmp = (tmp2 & ~maskR) | (tmp1 & maskR);
- break;
- }
- dp[0] = (FX_BYTE)(tmp >> 24);
- dp[1] = (FX_BYTE)(tmp >> 16);
- dp[2] = (FX_BYTE)(tmp >> 8);
- dp[3] = (FX_BYTE)tmp;
- }
- lineSrc += m_nStride;
- lineDst += pDst->m_nStride;
- }
- } else {
- shift1 = d1 - s1;
- shift2 = 32 - shift1;
- middleDwords = (xd1 >> 5) - ((xd0 + 31) >> 5);
- for(yy = yd0; yy < yd1; yy++) {
- sp = lineSrc;
- dp = lineDst;
- if(d1 != 0) {
- tmp1 = JBIG2_GETDWORD(sp) >> shift1;
- tmp2 = JBIG2_GETDWORD(dp);
- switch(op) {
- case JBIG2_COMPOSE_OR:
- tmp = (tmp2 & ~maskL) | ((tmp1 | tmp2) & maskL);
- break;
- case JBIG2_COMPOSE_AND:
- tmp = (tmp2 & ~maskL) | ((tmp1 & tmp2) & maskL);
- break;
- case JBIG2_COMPOSE_XOR:
- tmp = (tmp2 & ~maskL) | ((tmp1 ^ tmp2) & maskL);
- break;
- case JBIG2_COMPOSE_XNOR:
- tmp = (tmp2 & ~maskL) | ((~(tmp1 ^ tmp2)) & maskL);
- break;
- case JBIG2_COMPOSE_REPLACE:
- tmp = (tmp2 & ~maskL) | (tmp1 & maskL);
- break;
- }
- dp[0] = (FX_BYTE)(tmp >> 24);
- dp[1] = (FX_BYTE)(tmp >> 16);
- dp[2] = (FX_BYTE)(tmp >> 8);
- dp[3] = (FX_BYTE)tmp;
- dp += 4;
- }
- for(xx = 0; xx < middleDwords; xx++) {
- tmp1 = (JBIG2_GETDWORD(sp) << shift2) | ((JBIG2_GETDWORD(sp + 4)) >> shift1);
- tmp2 = JBIG2_GETDWORD(dp);
- switch(op) {
- case JBIG2_COMPOSE_OR:
- tmp = tmp1 | tmp2;
- break;
- case JBIG2_COMPOSE_AND:
- tmp = tmp1 & tmp2;
- break;
- case JBIG2_COMPOSE_XOR:
- tmp = tmp1 ^ tmp2;
- break;
- case JBIG2_COMPOSE_XNOR:
- tmp = ~(tmp1 ^ tmp2);
- break;
- case JBIG2_COMPOSE_REPLACE:
- tmp = tmp1;
- break;
- }
- dp[0] = (FX_BYTE)(tmp >> 24);
- dp[1] = (FX_BYTE)(tmp >> 16);
- dp[2] = (FX_BYTE)(tmp >> 8);
- dp[3] = (FX_BYTE)tmp;
- sp += 4;
- dp += 4;
- }
- if(d2 != 0) {
- tmp1 = (JBIG2_GETDWORD(sp) << shift2) | (
- ((sp + 4) < lineSrc + lineLeft ? JBIG2_GETDWORD(sp + 4) : 0) >> shift1);
- tmp2 = JBIG2_GETDWORD(dp);
- switch(op) {
- case JBIG2_COMPOSE_OR:
- tmp = (tmp2 & ~maskR) | ((tmp1 | tmp2) & maskR);
- break;
- case JBIG2_COMPOSE_AND:
- tmp = (tmp2 & ~maskR) | ((tmp1 & tmp2) & maskR);
- break;
- case JBIG2_COMPOSE_XOR:
- tmp = (tmp2 & ~maskR) | ((tmp1 ^ tmp2) & maskR);
- break;
- case JBIG2_COMPOSE_XNOR:
- tmp = (tmp2 & ~maskR) | ((~(tmp1 ^ tmp2)) & maskR);
- break;
- case JBIG2_COMPOSE_REPLACE:
- tmp = (tmp2 & ~maskR) | (tmp1 & maskR);
- break;
- }
- dp[0] = (FX_BYTE)(tmp >> 24);
- dp[1] = (FX_BYTE)(tmp >> 16);
- dp[2] = (FX_BYTE)(tmp >> 8);
- dp[3] = (FX_BYTE)tmp;
- }
- lineSrc += m_nStride;
- lineDst += pDst->m_nStride;
- }
- }
- }
- return 1;
-}
+// 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
+
+#include "JBig2_Image.h"
+#include "../../../include/fxcrt/fx_basic.h"
+#include "../../../include/fxcrt/fx_coordinates.h"
+#include <limits.h>
+CJBig2_Image::CJBig2_Image(FX_INT32 w, FX_INT32 h)
+{
+ m_nWidth = w;
+ m_nHeight = h;
+ if (m_nWidth <= 0 || m_nHeight <= 0 || m_nWidth > INT_MAX - 31) {
+ m_pData = NULL;
+ m_bNeedFree = FALSE;
+ return;
+ }
+ m_nStride = ((w + 31) >> 5) << 2;
+ if (m_nStride * m_nHeight > 0 && 104857600 / (int)m_nStride > m_nHeight) {
+ m_pData = (FX_BYTE *)m_pModule->JBig2_Malloc2(m_nStride, m_nHeight);
+ } else {
+ m_pData = NULL;
+ }
+ m_bNeedFree = TRUE;
+}
+CJBig2_Image::CJBig2_Image(FX_INT32 w, FX_INT32 h, FX_INT32 stride, FX_BYTE*pBuf)
+{
+ m_nWidth = w;
+ m_nHeight = h;
+ m_nStride = stride;
+ m_pData = pBuf;
+ m_bNeedFree = FALSE;
+}
+CJBig2_Image::CJBig2_Image(CJBig2_Image &im)
+{
+ m_pModule = im.m_pModule;
+ m_nWidth = im.m_nWidth;
+ m_nHeight = im.m_nHeight;
+ m_nStride = im.m_nStride;
+ if (im.m_pData) {
+ m_pData = (FX_BYTE*)m_pModule->JBig2_Malloc2(m_nStride, m_nHeight);
+ JBIG2_memcpy(m_pData, im.m_pData, m_nStride * m_nHeight);
+ } else {
+ m_pData = NULL;
+ }
+ m_bNeedFree = TRUE;
+}
+CJBig2_Image::~CJBig2_Image()
+{
+ if(m_bNeedFree && m_pData) {
+ m_pModule->JBig2_Free(m_pData);
+ }
+}
+FX_BOOL CJBig2_Image::getPixel(FX_INT32 x, FX_INT32 y)
+{
+ if (!m_pData) {
+ return 0;
+ }
+ FX_INT32 m, n;
+ if(x < 0 || x >= m_nWidth) {
+ return 0;
+ }
+ if(y < 0 || y >= m_nHeight) {
+ return 0;
+ }
+ m = y * m_nStride + (x >> 3);
+ n = x & 7;
+ return ((m_pData[m] >> (7 - n)) & 1);
+}
+
+FX_INT32 CJBig2_Image::setPixel(FX_INT32 x, FX_INT32 y, FX_BOOL v)
+{
+ if (!m_pData) {
+ return 0;
+ }
+ FX_INT32 m, n;
+ if(x < 0 || x >= m_nWidth) {
+ return 0;
+ }
+ if(y < 0 || y >= m_nHeight) {
+ return 0;
+ }
+ m = y * m_nStride + (x >> 3);
+ n = x & 7;
+ if(v) {
+ m_pData[m] |= 1 << (7 - n);
+ } else {
+ m_pData[m] &= ~(1 << (7 - n));
+ }
+ return 1;
+}
+void CJBig2_Image::copyLine(FX_INT32 hTo, FX_INT32 hFrom)
+{
+ if (!m_pData) {
+ return;
+ }
+ if(hFrom < 0 || hFrom >= m_nHeight) {
+ JBIG2_memset(m_pData + hTo * m_nStride, 0, m_nStride);
+ } else {
+ JBIG2_memcpy(m_pData + hTo * m_nStride, m_pData + hFrom * m_nStride, m_nStride);
+ }
+}
+void CJBig2_Image::fill(FX_BOOL v)
+{
+ if (!m_pData) {
+ return;
+ }
+ JBIG2_memset(m_pData, v ? 0xff : 0, m_nStride * m_nHeight);
+}
+FX_BOOL CJBig2_Image::composeTo(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, JBig2ComposeOp op)
+{
+ if (!m_pData) {
+ return FALSE;
+ }
+ return composeTo_opt2(pDst, x, y, op);
+}
+FX_BOOL CJBig2_Image::composeTo(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, JBig2ComposeOp op, const FX_RECT* pSrcRect)
+{
+ if (!m_pData) {
+ return FALSE;
+ }
+ if (NULL == pSrcRect || *pSrcRect == FX_RECT(0, 0, m_nWidth, m_nHeight)) {
+ return composeTo_opt2(pDst, x, y, op);
+ }
+ return composeTo_opt2(pDst, x, y, op, pSrcRect);
+}
+FX_BOOL CJBig2_Image::composeTo_unopt(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, JBig2ComposeOp op)
+{
+ FX_INT32 w, h, dx, dy;
+ FX_INT32 i, j;
+ w = m_nWidth;
+ h = m_nHeight;
+ dx = dy = 0;
+ if(x < 0) {
+ dx += -x;
+ w -= -x;
+ x = 0;
+ }
+ if(y < 0) {
+ dy += -y;
+ h -= -y;
+ y = 0;
+ }
+ if(x + w > pDst->m_nWidth) {
+ w = pDst->m_nWidth - x;
+ }
+ if(y + h > pDst->m_nHeight) {
+ h = pDst->m_nHeight - y;
+ }
+ switch(op) {
+ case JBIG2_COMPOSE_OR:
+ for(j = 0; j < h; j++) {
+ for(i = 0; i < w; i++) {
+ pDst->setPixel(x + i, y + j,
+ (getPixel(i + dx, j + dy) | pDst->getPixel(x + i, y + j)) & 1);
+ }
+ }
+ break;
+ case JBIG2_COMPOSE_AND:
+ for(j = 0; j < h; j++) {
+ for(i = 0; i < w; i++) {
+ pDst->setPixel(x + i, y + j,
+ (getPixel(i + dx, j + dy) & pDst->getPixel(x + i, y + j)) & 1);
+ }
+ }
+ break;
+ case JBIG2_COMPOSE_XOR:
+ for(j = 0; j < h; j++) {
+ for(i = 0; i < w; i++) {
+ pDst->setPixel(x + i, y + j,
+ (getPixel(i + dx, j + dy) ^ pDst->getPixel(x + i, y + j)) & 1);
+ }
+ }
+ break;
+ case JBIG2_COMPOSE_XNOR:
+ for(j = 0; j < h; j++) {
+ for(i = 0; i < w; i++) {
+ pDst->setPixel(x + i, y + j,
+ (~(getPixel(i + dx, j + dy) ^ pDst->getPixel(x + i, y + j))) & 1);
+ }
+ }
+ break;
+ case JBIG2_COMPOSE_REPLACE:
+ for(j = 0; j < h; j++) {
+ for(i = 0; i < w; i++) {
+ pDst->setPixel(x + i, y + j, getPixel(i + dx, j + dy));
+ }
+ }
+ break;
+ }
+ return TRUE;
+}
+
+FX_BOOL CJBig2_Image::composeTo_opt(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, JBig2ComposeOp op)
+{
+ FX_INT32 x0, x1, y0, y1, xx, yy;
+ FX_BYTE *pLineSrc, *pLineDst, *srcPtr, *destPtr;
+ FX_DWORD src0, src1, src, dest, s1, s2, m1, m2, m3;
+ FX_BOOL oneByte;
+ if (!m_pData) {
+ return FALSE;
+ }
+ if (y < 0) {
+ y0 = -y;
+ } else {
+ y0 = 0;
+ }
+ if (y + m_nHeight > pDst->m_nHeight) {
+ y1 = pDst->m_nHeight - y;
+ } else {
+ y1 = m_nHeight;
+ }
+ if (y0 >= y1) {
+ return FALSE;
+ }
+ if (x >= 0) {
+ x0 = x & ~7;
+ } else {
+ x0 = 0;
+ }
+ x1 = x + m_nWidth;
+ if (x1 > pDst->m_nWidth) {
+ x1 = pDst->m_nWidth;
+ }
+ if (x0 >= x1) {
+ return FALSE;
+ }
+ s1 = x & 7;
+ s2 = 8 - s1;
+ m1 = 0xff >> (x1 & 7);
+ m2 = 0xff << (((x1 & 7) == 0) ? 0 : 8 - (x1 & 7));
+ m3 = (0xff >> s1) & m2;
+ oneByte = x0 == ((x1 - 1) & ~7);
+ pLineDst = pDst->m_pData + y * pDst->m_nStride;
+ pLineSrc = m_pData + y0 * m_nStride;
+ if(oneByte) {
+ if(x >= 0) {
+ switch(op) {
+ case JBIG2_COMPOSE_OR: {
+ for (yy = y0; yy < y1; ++yy) {
+ destPtr = pLineDst + (x >> 3);
+ srcPtr = pLineSrc;
+ dest = *destPtr;
+ dest |= (*srcPtr >> s1) & m2;
+ *destPtr = (FX_BYTE)dest;
+ pLineDst += pDst->m_nStride;
+ pLineSrc += m_nStride;
+ }
+ }
+ break;
+ case JBIG2_COMPOSE_AND: {
+ for (yy = y0; yy < y1; ++yy) {
+ destPtr = pLineDst + (x >> 3);
+ srcPtr = pLineSrc;
+ dest = *destPtr;
+ dest &= ((0xff00 | *srcPtr) >> s1) | m1;
+ *destPtr = (FX_BYTE)dest;
+ pLineDst += pDst->m_nStride;
+ pLineSrc += m_nStride;
+ }
+ }
+ break;
+ case JBIG2_COMPOSE_XOR: {
+ for (yy = y0; yy < y1; ++yy) {
+ destPtr = pLineDst + (x >> 3);
+ srcPtr = pLineSrc;
+ dest = *destPtr;
+ dest ^= (*srcPtr >> s1) & m2;
+ *destPtr = (FX_BYTE)dest;
+ pLineDst += pDst->m_nStride;
+ pLineSrc += m_nStride;
+ }
+ }
+ break;
+ case JBIG2_COMPOSE_XNOR: {
+ for (yy = y0; yy < y1; ++yy) {
+ destPtr = pLineDst + (x >> 3);
+ srcPtr = pLineSrc;
+ dest = *destPtr;
+ dest ^= ((*srcPtr ^ 0xff) >> s1) & m2;
+ *destPtr = (FX_BYTE)dest;
+ pLineDst += pDst->m_nStride;
+ pLineSrc += m_nStride;
+ }
+ }
+ break;
+ case JBIG2_COMPOSE_REPLACE: {
+ for (yy = y0; yy < y1; ++yy) {
+ destPtr = pLineDst + (x >> 3);
+ srcPtr = pLineSrc;
+ dest = *destPtr;
+ dest = (dest & ~m3) | ((*srcPtr >> s1) & m3);
+ *destPtr = (FX_BYTE)dest;
+ pLineDst += pDst->m_nStride;
+ pLineSrc += m_nStride;
+ }
+ }
+ break;
+ }
+ } else {
+ switch(op) {
+ case JBIG2_COMPOSE_OR: {
+ for(yy = y0; yy < y1; ++yy) {
+ destPtr = pLineDst;
+ srcPtr = pLineSrc + (-x >> 3);
+ dest = *destPtr;
+ dest |= *srcPtr & m2;
+ *destPtr = (FX_BYTE)dest;
+ pLineDst += pDst->m_nStride;
+ pLineSrc += m_nStride;
+ }
+ }
+ break;
+ case JBIG2_COMPOSE_AND: {
+ for(yy = y0; yy < y1; ++yy) {
+ destPtr = pLineDst;
+ srcPtr = pLineSrc + (-x >> 3);
+ dest = *destPtr;
+ dest &= *srcPtr | m1;
+ *destPtr = (FX_BYTE)dest;
+ pLineDst += pDst->m_nStride;
+ pLineSrc += m_nStride;
+ }
+ }
+ break;
+ case JBIG2_COMPOSE_XOR: {
+ for(yy = y0; yy < y1; ++yy) {
+ destPtr = pLineDst;
+ srcPtr = pLineSrc + (-x >> 3);
+ dest = *destPtr;
+ dest ^= *srcPtr & m2;
+ *destPtr = (FX_BYTE)dest;
+ pLineDst += pDst->m_nStride;
+ pLineSrc += m_nStride;
+ }
+ }
+ break;
+ case JBIG2_COMPOSE_XNOR: {
+ for(yy = y0; yy < y1; ++yy) {
+ destPtr = pLineDst;
+ srcPtr = pLineSrc + (-x >> 3);
+ dest = *destPtr;
+ dest ^= (*srcPtr ^ 0xff) & m2;
+ *destPtr = (FX_BYTE)dest;
+ pLineDst += pDst->m_nStride;
+ pLineSrc += m_nStride;
+ }
+ }
+ break;
+ case JBIG2_COMPOSE_REPLACE: {
+ for(yy = y0; yy < y1; ++yy) {
+ destPtr = pLineDst;
+ srcPtr = pLineSrc + (-x >> 3);
+ dest = *destPtr;
+ dest = (*srcPtr & m2) | (dest & m1);
+ *destPtr = (FX_BYTE)dest;
+ pLineDst += pDst->m_nStride;
+ pLineSrc += m_nStride;
+ }
+ }
+ break;
+ }
+ }
+ } else {
+ if(x >= 0) {
+ switch(op) {
+ case JBIG2_COMPOSE_OR: {
+ for(yy = y0; yy < y1; ++yy) {
+ destPtr = pLineDst + (x >> 3);
+ srcPtr = pLineSrc;
+ src1 = *srcPtr++;
+ dest = *destPtr;
+ dest |= src1 >> s1;
+ *destPtr++ = (FX_BYTE)dest;
+ xx = x0 + 8;
+ for (; xx < x1 - 8; xx += 8) {
+ dest = *destPtr;
+ src0 = src1;
+ src1 = *srcPtr++;
+ src = (((src0 << 8) | src1) >> s1) & 0xff;
+ dest |= src;
+ *destPtr++ = (FX_BYTE)dest;
+ }
+ dest = *destPtr;
+ src0 = src1;
+ if(srcPtr - pLineSrc < m_nStride) {
+ src1 = *srcPtr++;
+ } else {
+ src1 = 0;
+ }
+ src = (((src0 << 8) | src1) >> s1) & 0xff;
+ dest |= src & m2;
+ *destPtr = (FX_BYTE)dest;
+ pLineDst += pDst->m_nStride;
+ pLineSrc += m_nStride;
+ }
+ }
+ break;
+ case JBIG2_COMPOSE_AND: {
+ for(yy = y0; yy < y1; ++yy) {
+ destPtr = pLineDst + (x >> 3);
+ srcPtr = pLineSrc;
+ src1 = *srcPtr++;
+ dest = *destPtr;
+ dest &= (0xff00 | src1) >> s1;
+ *destPtr++ = (FX_BYTE)dest;
+ xx = x0 + 8;
+ for (; xx < x1 - 8; xx += 8) {
+ dest = *destPtr;
+ src0 = src1;
+ src1 = *srcPtr++;
+ src = (((src0 << 8) | src1) >> s1) & 0xff;
+ dest &= src;
+ *destPtr++ = (FX_BYTE)dest;
+ }
+ dest = *destPtr;
+ src0 = src1;
+ if(srcPtr - pLineSrc < m_nStride) {
+ src1 = *srcPtr++;
+ } else {
+ src1 = 0;
+ }
+ src = (((src0 << 8) | src1) >> s1) & 0xff;
+ dest &= src | m1;
+ *destPtr = (FX_BYTE)dest;
+ pLineDst += pDst->m_nStride;
+ pLineSrc += m_nStride;
+ }
+ }
+ break;
+ case JBIG2_COMPOSE_XOR: {
+ for(yy = y0; yy < y1; ++yy) {
+ destPtr = pLineDst + (x >> 3);
+ srcPtr = pLineSrc;
+ src1 = *srcPtr++;
+ dest = *destPtr;
+ dest ^= src1 >> s1;
+ *destPtr++ = (FX_BYTE)dest;
+ xx = x0 + 8;
+ for (; xx < x1 - 8; xx += 8) {
+ dest = *destPtr;
+ src0 = src1;
+ src1 = *srcPtr++;
+ src = (((src0 << 8) | src1) >> s1) & 0xff;
+ dest ^= src;
+ *destPtr++ = (FX_BYTE)dest;
+ }
+ dest = *destPtr;
+ src0 = src1;
+ if(srcPtr - pLineSrc < m_nStride) {
+ src1 = *srcPtr++;
+ } else {
+ src1 = 0;
+ }
+ src = (((src0 << 8) | src1) >> s1) & 0xff;
+ dest ^= src & m2;
+ *destPtr = (FX_BYTE)dest;
+ pLineDst += pDst->m_nStride;
+ pLineSrc += m_nStride;
+ }
+ }
+ break;
+ case JBIG2_COMPOSE_XNOR: {
+ for(yy = y0; yy < y1; ++yy) {
+ destPtr = pLineDst + (x >> 3);
+ srcPtr = pLineSrc;
+ src1 = *srcPtr++;
+ dest = *destPtr;
+ dest ^= (src1 ^ 0xff) >> s1;
+ *destPtr++ = (FX_BYTE)dest;
+ xx = x0 + 8;
+ for (; xx < x1 - 8; xx += 8) {
+ dest = *destPtr;
+ src0 = src1;
+ src1 = *srcPtr++;
+ src = (((src0 << 8) | src1) >> s1) & 0xff;
+ dest ^= src ^ 0xff;
+ *destPtr++ = (FX_BYTE)dest;
+ }
+ dest = *destPtr;
+ src0 = src1;
+ if(srcPtr - pLineSrc < m_nStride) {
+ src1 = *srcPtr++;
+ } else {
+ src1 = 0;
+ }
+ src = (((src0 << 8) | src1) >> s1) & 0xff;
+ dest ^= (src ^ 0xff) & m2;
+ *destPtr = (FX_BYTE)dest;
+ pLineDst += pDst->m_nStride;
+ pLineSrc += m_nStride;
+ }
+ }
+ break;
+ case JBIG2_COMPOSE_REPLACE: {
+ for(yy = y0; yy < y1; ++yy) {
+ destPtr = pLineDst + (x >> 3);
+ srcPtr = pLineSrc;
+ src1 = *srcPtr++;
+ dest = *destPtr;
+ dest = (dest & (0xff << s2)) | (src1 >> s1);
+ *destPtr++ = (FX_BYTE)dest;
+ xx = x0 + 8;
+ for (; xx < x1 - 8; xx += 8) {
+ dest = *destPtr;
+ src0 = src1;
+ src1 = *srcPtr++;
+ src = (((src0 << 8) | src1) >> s1) & 0xff;
+ dest = src;
+ *destPtr++ = (FX_BYTE)dest;
+ }
+ dest = *destPtr;
+ src0 = src1;
+ if(srcPtr - pLineSrc < m_nStride) {
+ src1 = *srcPtr++;
+ } else {
+ src1 = 0;
+ }
+ src = (((src0 << 8) | src1) >> s1) & 0xff;
+ dest = (src & m2) | (dest & m1);
+ *destPtr = (FX_BYTE)dest;
+ pLineDst += pDst->m_nStride;
+ pLineSrc += m_nStride;
+ }
+ }
+ break;
+ }
+ } else {
+ switch(op) {
+ case JBIG2_COMPOSE_OR: {
+ for(yy = y0; yy < y1; ++yy) {
+ destPtr = pLineDst;
+ srcPtr = pLineSrc + (-x >> 3);
+ src1 = *srcPtr++;
+ xx = x0;
+ for (; xx < x1 - 8; xx += 8) {
+ dest = *destPtr;
+ src0 = src1;
+ src1 = *srcPtr++;
+ src = (((src0 << 8) | src1) >> s1) & 0xff;
+ dest |= src;
+ *destPtr++ = (FX_BYTE)dest;
+ }
+ dest = *destPtr;
+ src0 = src1;
+ if(srcPtr - pLineSrc < m_nStride) {
+ src1 = *srcPtr++;
+ } else {
+ src1 = 0;
+ }
+ src = (((src0 << 8) | src1) >> s1) & 0xff;
+ dest |= src & m2;
+ *destPtr = (FX_BYTE)dest;
+ pLineDst += pDst->m_nStride;
+ pLineSrc += m_nStride;
+ }
+ }
+ break;
+ case JBIG2_COMPOSE_AND: {
+ for(yy = y0; yy < y1; ++yy) {
+ destPtr = pLineDst;
+ srcPtr = pLineSrc + (-x >> 3);
+ src1 = *srcPtr++;
+ xx = x0;
+ for (; xx < x1 - 8; xx += 8) {
+ dest = *destPtr;
+ src0 = src1;
+ src1 = *srcPtr++;
+ src = (((src0 << 8) | src1) >> s1) & 0xff;
+ dest &= src;
+ *destPtr++ = (FX_BYTE)dest;
+ }
+ dest = *destPtr;
+ src0 = src1;
+ if(srcPtr - pLineSrc < m_nStride) {
+ src1 = *srcPtr++;
+ } else {
+ src1 = 0;
+ }
+ src = (((src0 << 8) | src1) >> s1) & 0xff;
+ dest &= src | m1;
+ *destPtr = (FX_BYTE)dest;
+ pLineDst += pDst->m_nStride;
+ pLineSrc += m_nStride;
+ }
+ }
+ break;
+ case JBIG2_COMPOSE_XOR: {
+ for(yy = y0; yy < y1; ++yy) {
+ destPtr = pLineDst;
+ srcPtr = pLineSrc + (-x >> 3);
+ src1 = *srcPtr++;
+ xx = x0;
+ for (; xx < x1 - 8; xx += 8) {
+ dest = *destPtr;
+ src0 = src1;
+ src1 = *srcPtr++;
+ src = (((src0 << 8) | src1) >> s1) & 0xff;
+ dest ^= src;
+ *destPtr++ = (FX_BYTE)dest;
+ }
+ dest = *destPtr;
+ src0 = src1;
+ if(srcPtr - pLineSrc < m_nStride) {
+ src1 = *srcPtr++;
+ } else {
+ src1 = 0;
+ }
+ src = (((src0 << 8) | src1) >> s1) & 0xff;
+ dest ^= src & m2;
+ *destPtr = (FX_BYTE)dest;
+ pLineDst += pDst->m_nStride;
+ pLineSrc += m_nStride;
+ }
+ }
+ break;
+ case JBIG2_COMPOSE_XNOR: {
+ for(yy = y0; yy < y1; ++yy) {
+ destPtr = pLineDst;
+ srcPtr = pLineSrc + (-x >> 3);
+ src1 = *srcPtr++;
+ xx = x0;
+ for (; xx < x1 - 8; xx += 8) {
+ dest = *destPtr;
+ src0 = src1;
+ src1 = *srcPtr++;
+ src = (((src0 << 8) | src1) >> s1) & 0xff;
+ dest ^= src ^ 0xff;
+ *destPtr++ = (FX_BYTE)dest;
+ }
+ dest = *destPtr;
+ src0 = src1;
+ if(srcPtr - pLineSrc < m_nStride) {
+ src1 = *srcPtr++;
+ } else {
+ src1 = 0;
+ }
+ src = (((src0 << 8) | src1) >> s1) & 0xff;
+ dest ^= (src ^ 0xff) & m2;
+ *destPtr = (FX_BYTE)dest;
+ pLineDst += pDst->m_nStride;
+ pLineSrc += m_nStride;
+ }
+ }
+ break;
+ case JBIG2_COMPOSE_REPLACE: {
+ for(yy = y0; yy < y1; ++yy) {
+ destPtr = pLineDst;
+ srcPtr = pLineSrc + (-x >> 3);
+ src1 = *srcPtr++;
+ xx = x0;
+ for (; xx < x1 - 8; xx += 8) {
+ dest = *destPtr;
+ src0 = src1;
+ src1 = *srcPtr++;
+ src = (((src0 << 8) | src1) >> s1) & 0xff;
+ dest = src;
+ *destPtr++ = (FX_BYTE)dest;
+ }
+ dest = *destPtr;
+ src0 = src1;
+ if(srcPtr - pLineSrc < m_nStride) {
+ src1 = *srcPtr++;
+ } else {
+ src1 = 0;
+ }
+ src = (((src0 << 8) | src1) >> s1) & 0xff;
+ dest = (src & m2) | (dest & m1);
+ *destPtr = (FX_BYTE)dest;
+ pLineDst += pDst->m_nStride;
+ pLineSrc += m_nStride;
+ }
+ }
+ break;
+ }
+ }
+ }
+ return TRUE;
+}
+FX_BOOL CJBig2_Image::composeFrom(FX_INT32 x, FX_INT32 y, CJBig2_Image *pSrc, JBig2ComposeOp op)
+{
+ if (!m_pData) {
+ return FALSE;
+ }
+ return pSrc->composeTo(this, x, y, op);
+}
+FX_BOOL CJBig2_Image::composeFrom(FX_INT32 x, FX_INT32 y, CJBig2_Image *pSrc, JBig2ComposeOp op, const FX_RECT* pSrcRect)
+{
+ if (!m_pData) {
+ return FALSE;
+ }
+ return pSrc->composeTo(this, x, y, op, pSrcRect);
+}
+CJBig2_Image *CJBig2_Image::subImage_unopt(FX_INT32 x, FX_INT32 y, FX_INT32 w, FX_INT32 h)
+{
+ CJBig2_Image *pImage;
+ FX_INT32 i, j;
+ JBIG2_ALLOC(pImage, CJBig2_Image(w, h));
+ for(j = 0; j < h; j++) {
+ for(i = 0; i < w; i++) {
+ pImage->setPixel(i, j, getPixel(x + i, y + j));
+ }
+ }
+ return pImage;
+}
+#define JBIG2_GETDWORD(buf) ((FX_DWORD)(((buf)[0] << 24) | ((buf)[1] << 16) | ((buf)[2] << 8) | (buf)[3]))
+CJBig2_Image *CJBig2_Image::subImage(FX_INT32 x, FX_INT32 y, FX_INT32 w, FX_INT32 h)
+{
+ CJBig2_Image *pImage;
+ FX_INT32 m, n, j;
+ FX_BYTE *pLineSrc, *pLineDst;
+ FX_DWORD wTmp;
+ FX_BYTE *pSrc, *pSrcEnd, *pDst, *pDstEnd;
+ if (w == 0 || h == 0) {
+ return NULL;
+ }
+ JBIG2_ALLOC(pImage, CJBig2_Image(w, h));
+ if (!m_pData) {
+ pImage->fill(0);
+ return pImage;
+ }
+ if (!pImage->m_pData) {
+ return pImage;
+ }
+ pLineSrc = m_pData + m_nStride * y;
+ pLineDst = pImage->m_pData;
+ m = (x >> 5) << 2;
+ n = x & 31;
+ if(n == 0) {
+ for(j = 0; j < h; j++) {
+ pSrc = pLineSrc + m;
+ pSrcEnd = pLineSrc + m_nStride;
+ pDst = pLineDst;
+ pDstEnd = pLineDst + pImage->m_nStride;
+ for(; pDst < pDstEnd; pSrc += 4, pDst += 4) {
+ *((FX_DWORD *)pDst) = *((FX_DWORD *)pSrc);
+ }
+ pLineSrc += m_nStride;
+ pLineDst += pImage->m_nStride;
+ }
+ } else {
+ for(j = 0; j < h; j++) {
+ pSrc = pLineSrc + m;
+ pSrcEnd = pLineSrc + m_nStride;
+ pDst = pLineDst;
+ pDstEnd = pLineDst + pImage->m_nStride;
+ for(; pDst < pDstEnd; pSrc += 4, pDst += 4) {
+ if(pSrc + 4 < pSrcEnd) {
+ wTmp = (JBIG2_GETDWORD(pSrc) << n) | (JBIG2_GETDWORD(pSrc + 4) >> (32 - n));
+ } else {
+ wTmp = JBIG2_GETDWORD(pSrc) << n;
+ }
+ pDst[0] = (FX_BYTE)(wTmp >> 24);
+ pDst[1] = (FX_BYTE)(wTmp >> 16);
+ pDst[2] = (FX_BYTE)(wTmp >> 8);
+ pDst[3] = (FX_BYTE)wTmp;
+ }
+ pLineSrc += m_nStride;
+ pLineDst += pImage->m_nStride;
+ }
+ }
+ return pImage;
+}
+void CJBig2_Image::expand(FX_INT32 h, FX_BOOL v)
+{
+ if (!m_pData) {
+ return;
+ }
+ m_pData = (FX_BYTE*)m_pModule->JBig2_Realloc(m_pData, h * m_nStride);
+ if(h > m_nHeight) {
+ JBIG2_memset(m_pData + m_nHeight * m_nStride, v ? 0xff : 0, (h - m_nHeight)*m_nStride);
+ }
+ m_nHeight = h;
+}
+FX_BOOL CJBig2_Image::composeTo_opt2(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, JBig2ComposeOp op)
+{
+ FX_INT32 xs0, ys0, xs1, ys1, xd0, yd0, xd1, yd1, xx, yy, w, h, middleDwords, lineLeft;
+ FX_DWORD s1, d1, d2, shift, shift1, shift2, tmp, tmp1, tmp2, maskL, maskR, maskM;
+ FX_BYTE *lineSrc, *lineDst, *sp, *dp;
+ if (!m_pData) {
+ return FALSE;
+ }
+ if (x < -1048576 || x > 1048576 || y < -1048576 || y > 1048576) {
+ return FALSE;
+ }
+ if(y < 0) {
+ ys0 = -y;
+ } else {
+ ys0 = 0;
+ }
+ if(y + m_nHeight > pDst->m_nHeight) {
+ ys1 = pDst->m_nHeight - y;
+ } else {
+ ys1 = m_nHeight;
+ }
+ if(x < 0) {
+ xs0 = -x;
+ } else {
+ xs0 = 0;
+ }
+ if(x + m_nWidth > pDst->m_nWidth) {
+ xs1 = pDst->m_nWidth - x;
+ } else {
+ xs1 = m_nWidth;
+ }
+ if((ys0 >= ys1) || (xs0 >= xs1)) {
+ return 0;
+ }
+ w = xs1 - xs0;
+ h = ys1 - ys0;
+ if(y < 0) {
+ yd0 = 0;
+ } else {
+ yd0 = y;
+ }
+ if(x < 0) {
+ xd0 = 0;
+ } else {
+ xd0 = x;
+ }
+ xd1 = xd0 + w;
+ yd1 = yd0 + h;
+ d1 = xd0 & 31;
+ d2 = xd1 & 31;
+ s1 = xs0 & 31;
+ maskL = 0xffffffff >> d1;
+ maskR = 0xffffffff << ((32 - (xd1 & 31)) % 32);
+ maskM = maskL & maskR;
+ lineSrc = m_pData + ys0 * m_nStride + ((xs0 >> 5) << 2);
+ lineLeft = m_nStride - ((xs0 >> 5) << 2);
+ lineDst = pDst->m_pData + yd0 * pDst->m_nStride + ((xd0 >> 5) << 2);
+ if((xd0 & ~31) == ((xd1 - 1) & ~31)) {
+ if((xs0 & ~31) == ((xs1 - 1) & ~31)) {
+ if(s1 > d1) {
+ shift = s1 - d1;
+ for(yy = yd0; yy < yd1; yy++) {
+ tmp1 = JBIG2_GETDWORD(lineSrc) << shift;
+ tmp2 = JBIG2_GETDWORD(lineDst);
+ switch(op) {
+ case JBIG2_COMPOSE_OR:
+ tmp = (tmp2 & ~maskM) | ((tmp1 | tmp2) & maskM);
+ break;
+ case JBIG2_COMPOSE_AND:
+ tmp = (tmp2 & ~maskM) | ((tmp1 & tmp2) & maskM);
+ break;
+ case JBIG2_COMPOSE_XOR:
+ tmp = (tmp2 & ~maskM) | ((tmp1 ^ tmp2) & maskM);
+ break;
+ case JBIG2_COMPOSE_XNOR:
+ tmp = (tmp2 & ~maskM) | ((~(tmp1 ^ tmp2)) & maskM);
+ break;
+ case JBIG2_COMPOSE_REPLACE:
+ tmp = (tmp2 & ~maskM) | (tmp1 & maskM);
+ break;
+ }
+ lineDst[0] = (FX_BYTE)(tmp >> 24);
+ lineDst[1] = (FX_BYTE)(tmp >> 16);
+ lineDst[2] = (FX_BYTE)(tmp >> 8);
+ lineDst[3] = (FX_BYTE)tmp;
+ lineSrc += m_nStride;
+ lineDst += pDst->m_nStride;
+ }
+ } else {
+ shift = d1 - s1;
+ for(yy = yd0; yy < yd1; yy++) {
+ tmp1 = JBIG2_GETDWORD(lineSrc) >> shift;
+ tmp2 = JBIG2_GETDWORD(lineDst);
+ switch(op) {
+ case JBIG2_COMPOSE_OR:
+ tmp = (tmp2 & ~maskM) | ((tmp1 | tmp2) & maskM);
+ break;
+ case JBIG2_COMPOSE_AND:
+ tmp = (tmp2 & ~maskM) | ((tmp1 & tmp2) & maskM);
+ break;
+ case JBIG2_COMPOSE_XOR:
+ tmp = (tmp2 & ~maskM) | ((tmp1 ^ tmp2) & maskM);
+ break;
+ case JBIG2_COMPOSE_XNOR:
+ tmp = (tmp2 & ~maskM) | ((~(tmp1 ^ tmp2)) & maskM);
+ break;
+ case JBIG2_COMPOSE_REPLACE:
+ tmp = (tmp2 & ~maskM) | (tmp1 & maskM);
+ break;
+ }
+ lineDst[0] = (FX_BYTE)(tmp >> 24);
+ lineDst[1] = (FX_BYTE)(tmp >> 16);
+ lineDst[2] = (FX_BYTE)(tmp >> 8);
+ lineDst[3] = (FX_BYTE)tmp;
+ lineSrc += m_nStride;
+ lineDst += pDst->m_nStride;
+ }
+ }
+ } else {
+ shift1 = s1 - d1;
+ shift2 = 32 - shift1;
+ for(yy = yd0; yy < yd1; yy++) {
+ tmp1 = (JBIG2_GETDWORD(lineSrc) << shift1) | (JBIG2_GETDWORD(lineSrc + 4) >> shift2);
+ tmp2 = JBIG2_GETDWORD(lineDst);
+ switch(op) {
+ case JBIG2_COMPOSE_OR:
+ tmp = (tmp2 & ~maskM) | ((tmp1 | tmp2) & maskM);
+ break;
+ case JBIG2_COMPOSE_AND:
+ tmp = (tmp2 & ~maskM) | ((tmp1 & tmp2) & maskM);
+ break;
+ case JBIG2_COMPOSE_XOR:
+ tmp = (tmp2 & ~maskM) | ((tmp1 ^ tmp2) & maskM);
+ break;
+ case JBIG2_COMPOSE_XNOR:
+ tmp = (tmp2 & ~maskM) | ((~(tmp1 ^ tmp2)) & maskM);
+ break;
+ case JBIG2_COMPOSE_REPLACE:
+ tmp = (tmp2 & ~maskM) | (tmp1 & maskM);
+ break;
+ }
+ lineDst[0] = (FX_BYTE)(tmp >> 24);
+ lineDst[1] = (FX_BYTE)(tmp >> 16);
+ lineDst[2] = (FX_BYTE)(tmp >> 8);
+ lineDst[3] = (FX_BYTE)tmp;
+ lineSrc += m_nStride;
+ lineDst += pDst->m_nStride;
+ }
+ }
+ } else {
+ if(s1 > d1) {
+ shift1 = s1 - d1;
+ shift2 = 32 - shift1;
+ middleDwords = (xd1 >> 5) - ((xd0 + 31) >> 5);
+ for(yy = yd0; yy < yd1; yy++) {
+ sp = lineSrc;
+ dp = lineDst;
+ if(d1 != 0) {
+ tmp1 = (JBIG2_GETDWORD(sp) << shift1) | (JBIG2_GETDWORD(sp + 4) >> shift2);
+ tmp2 = JBIG2_GETDWORD(dp);
+ switch(op) {
+ case JBIG2_COMPOSE_OR:
+ tmp = (tmp2 & ~maskL) | ((tmp1 | tmp2) & maskL);
+ break;
+ case JBIG2_COMPOSE_AND:
+ tmp = (tmp2 & ~maskL) | ((tmp1 & tmp2) & maskL);
+ break;
+ case JBIG2_COMPOSE_XOR:
+ tmp = (tmp2 & ~maskL) | ((tmp1 ^ tmp2) & maskL);
+ break;
+ case JBIG2_COMPOSE_XNOR:
+ tmp = (tmp2 & ~maskL) | ((~(tmp1 ^ tmp2)) & maskL);
+ break;
+ case JBIG2_COMPOSE_REPLACE:
+ tmp = (tmp2 & ~maskL) | (tmp1 & maskL);
+ break;
+ }
+ dp[0] = (FX_BYTE)(tmp >> 24);
+ dp[1] = (FX_BYTE)(tmp >> 16);
+ dp[2] = (FX_BYTE)(tmp >> 8);
+ dp[3] = (FX_BYTE)tmp;
+ sp += 4;
+ dp += 4;
+ }
+ for(xx = 0; xx < middleDwords; xx++) {
+ tmp1 = (JBIG2_GETDWORD(sp) << shift1) | (JBIG2_GETDWORD(sp + 4) >> shift2);
+ tmp2 = JBIG2_GETDWORD(dp);
+ switch(op) {
+ case JBIG2_COMPOSE_OR:
+ tmp = tmp1 | tmp2;
+ break;
+ case JBIG2_COMPOSE_AND:
+ tmp = tmp1 & tmp2;
+ break;
+ case JBIG2_COMPOSE_XOR:
+ tmp = tmp1 ^ tmp2;
+ break;
+ case JBIG2_COMPOSE_XNOR:
+ tmp = ~(tmp1 ^ tmp2);
+ break;
+ case JBIG2_COMPOSE_REPLACE:
+ tmp = tmp1;
+ break;
+ }
+ dp[0] = (FX_BYTE)(tmp >> 24);
+ dp[1] = (FX_BYTE)(tmp >> 16);
+ dp[2] = (FX_BYTE)(tmp >> 8);
+ dp[3] = (FX_BYTE)tmp;
+ sp += 4;
+ dp += 4;
+ }
+ if(d2 != 0) {
+ tmp1 = (JBIG2_GETDWORD(sp) << shift1) | (
+ ((sp + 4) < lineSrc + lineLeft ? JBIG2_GETDWORD(sp + 4) : 0) >> shift2);
+ tmp2 = JBIG2_GETDWORD(dp);
+ switch(op) {
+ case JBIG2_COMPOSE_OR:
+ tmp = (tmp2 & ~maskR) | ((tmp1 | tmp2) & maskR);
+ break;
+ case JBIG2_COMPOSE_AND:
+ tmp = (tmp2 & ~maskR) | ((tmp1 & tmp2) & maskR);
+ break;
+ case JBIG2_COMPOSE_XOR:
+ tmp = (tmp2 & ~maskR) | ((tmp1 ^ tmp2) & maskR);
+ break;
+ case JBIG2_COMPOSE_XNOR:
+ tmp = (tmp2 & ~maskR) | ((~(tmp1 ^ tmp2)) & maskR);
+ break;
+ case JBIG2_COMPOSE_REPLACE:
+ tmp = (tmp2 & ~maskR) | (tmp1 & maskR);
+ break;
+ }
+ dp[0] = (FX_BYTE)(tmp >> 24);
+ dp[1] = (FX_BYTE)(tmp >> 16);
+ dp[2] = (FX_BYTE)(tmp >> 8);
+ dp[3] = (FX_BYTE)tmp;
+ }
+ lineSrc += m_nStride;
+ lineDst += pDst->m_nStride;
+ }
+ } else if(s1 == d1) {
+ middleDwords = (xd1 >> 5) - ((xd0 + 31) >> 5);
+ for(yy = yd0; yy < yd1; yy++) {
+ sp = lineSrc;
+ dp = lineDst;
+ if(d1 != 0) {
+ tmp1 = JBIG2_GETDWORD(sp);
+ tmp2 = JBIG2_GETDWORD(dp);
+ switch(op) {
+ case JBIG2_COMPOSE_OR:
+ tmp = (tmp2 & ~maskL) | ((tmp1 | tmp2) & maskL);
+ break;
+ case JBIG2_COMPOSE_AND:
+ tmp = (tmp2 & ~maskL) | ((tmp1 & tmp2) & maskL);
+ break;
+ case JBIG2_COMPOSE_XOR:
+ tmp = (tmp2 & ~maskL) | ((tmp1 ^ tmp2) & maskL);
+ break;
+ case JBIG2_COMPOSE_XNOR:
+ tmp = (tmp2 & ~maskL) | ((~(tmp1 ^ tmp2)) & maskL);
+ break;
+ case JBIG2_COMPOSE_REPLACE:
+ tmp = (tmp2 & ~maskL) | (tmp1 & maskL);
+ break;
+ }
+ dp[0] = (FX_BYTE)(tmp >> 24);
+ dp[1] = (FX_BYTE)(tmp >> 16);
+ dp[2] = (FX_BYTE)(tmp >> 8);
+ dp[3] = (FX_BYTE)tmp;
+ sp += 4;
+ dp += 4;
+ }
+ for(xx = 0; xx < middleDwords; xx++) {
+ tmp1 = JBIG2_GETDWORD(sp);
+ tmp2 = JBIG2_GETDWORD(dp);
+ switch(op) {
+ case JBIG2_COMPOSE_OR:
+ tmp = tmp1 | tmp2;
+ break;
+ case JBIG2_COMPOSE_AND:
+ tmp = tmp1 & tmp2;
+ break;
+ case JBIG2_COMPOSE_XOR:
+ tmp = tmp1 ^ tmp2;
+ break;
+ case JBIG2_COMPOSE_XNOR:
+ tmp = ~(tmp1 ^ tmp2);
+ break;
+ case JBIG2_COMPOSE_REPLACE:
+ tmp = tmp1;
+ break;
+ }
+ dp[0] = (FX_BYTE)(tmp >> 24);
+ dp[1] = (FX_BYTE)(tmp >> 16);
+ dp[2] = (FX_BYTE)(tmp >> 8);
+ dp[3] = (FX_BYTE)tmp;
+ sp += 4;
+ dp += 4;
+ }
+ if(d2 != 0) {
+ tmp1 = JBIG2_GETDWORD(sp);
+ tmp2 = JBIG2_GETDWORD(dp);
+ switch(op) {
+ case JBIG2_COMPOSE_OR:
+ tmp = (tmp2 & ~maskR) | ((tmp1 | tmp2) & maskR);
+ break;
+ case JBIG2_COMPOSE_AND:
+ tmp = (tmp2 & ~maskR) | ((tmp1 & tmp2) & maskR);
+ break;
+ case JBIG2_COMPOSE_XOR:
+ tmp = (tmp2 & ~maskR) | ((tmp1 ^ tmp2) & maskR);
+ break;
+ case JBIG2_COMPOSE_XNOR:
+ tmp = (tmp2 & ~maskR) | ((~(tmp1 ^ tmp2)) & maskR);
+ break;
+ case JBIG2_COMPOSE_REPLACE:
+ tmp = (tmp2 & ~maskR) | (tmp1 & maskR);
+ break;
+ }
+ dp[0] = (FX_BYTE)(tmp >> 24);
+ dp[1] = (FX_BYTE)(tmp >> 16);
+ dp[2] = (FX_BYTE)(tmp >> 8);
+ dp[3] = (FX_BYTE)tmp;
+ }
+ lineSrc += m_nStride;
+ lineDst += pDst->m_nStride;
+ }
+ } else {
+ shift1 = d1 - s1;
+ shift2 = 32 - shift1;
+ middleDwords = (xd1 >> 5) - ((xd0 + 31) >> 5);
+ for(yy = yd0; yy < yd1; yy++) {
+ sp = lineSrc;
+ dp = lineDst;
+ if(d1 != 0) {
+ tmp1 = JBIG2_GETDWORD(sp) >> shift1;
+ tmp2 = JBIG2_GETDWORD(dp);
+ switch(op) {
+ case JBIG2_COMPOSE_OR:
+ tmp = (tmp2 & ~maskL) | ((tmp1 | tmp2) & maskL);
+ break;
+ case JBIG2_COMPOSE_AND:
+ tmp = (tmp2 & ~maskL) | ((tmp1 & tmp2) & maskL);
+ break;
+ case JBIG2_COMPOSE_XOR:
+ tmp = (tmp2 & ~maskL) | ((tmp1 ^ tmp2) & maskL);
+ break;
+ case JBIG2_COMPOSE_XNOR:
+ tmp = (tmp2 & ~maskL) | ((~(tmp1 ^ tmp2)) & maskL);
+ break;
+ case JBIG2_COMPOSE_REPLACE:
+ tmp = (tmp2 & ~maskL) | (tmp1 & maskL);
+ break;
+ }
+ dp[0] = (FX_BYTE)(tmp >> 24);
+ dp[1] = (FX_BYTE)(tmp >> 16);
+ dp[2] = (FX_BYTE)(tmp >> 8);
+ dp[3] = (FX_BYTE)tmp;
+ dp += 4;
+ }
+ for(xx = 0; xx < middleDwords; xx++) {
+ tmp1 = (JBIG2_GETDWORD(sp) << shift2) | ((JBIG2_GETDWORD(sp + 4)) >> shift1);
+ tmp2 = JBIG2_GETDWORD(dp);
+ switch(op) {
+ case JBIG2_COMPOSE_OR:
+ tmp = tmp1 | tmp2;
+ break;
+ case JBIG2_COMPOSE_AND:
+ tmp = tmp1 & tmp2;
+ break;
+ case JBIG2_COMPOSE_XOR:
+ tmp = tmp1 ^ tmp2;
+ break;
+ case JBIG2_COMPOSE_XNOR:
+ tmp = ~(tmp1 ^ tmp2);
+ break;
+ case JBIG2_COMPOSE_REPLACE:
+ tmp = tmp1;
+ break;
+ }
+ dp[0] = (FX_BYTE)(tmp >> 24);
+ dp[1] = (FX_BYTE)(tmp >> 16);
+ dp[2] = (FX_BYTE)(tmp >> 8);
+ dp[3] = (FX_BYTE)tmp;
+ sp += 4;
+ dp += 4;
+ }
+ if(d2 != 0) {
+ tmp1 = (JBIG2_GETDWORD(sp) << shift2) | (
+ ((sp + 4) < lineSrc + lineLeft ? JBIG2_GETDWORD(sp + 4) : 0) >> shift1);
+ tmp2 = JBIG2_GETDWORD(dp);
+ switch(op) {
+ case JBIG2_COMPOSE_OR:
+ tmp = (tmp2 & ~maskR) | ((tmp1 | tmp2) & maskR);
+ break;
+ case JBIG2_COMPOSE_AND:
+ tmp = (tmp2 & ~maskR) | ((tmp1 & tmp2) & maskR);
+ break;
+ case JBIG2_COMPOSE_XOR:
+ tmp = (tmp2 & ~maskR) | ((tmp1 ^ tmp2) & maskR);
+ break;
+ case JBIG2_COMPOSE_XNOR:
+ tmp = (tmp2 & ~maskR) | ((~(tmp1 ^ tmp2)) & maskR);
+ break;
+ case JBIG2_COMPOSE_REPLACE:
+ tmp = (tmp2 & ~maskR) | (tmp1 & maskR);
+ break;
+ }
+ dp[0] = (FX_BYTE)(tmp >> 24);
+ dp[1] = (FX_BYTE)(tmp >> 16);
+ dp[2] = (FX_BYTE)(tmp >> 8);
+ dp[3] = (FX_BYTE)tmp;
+ }
+ lineSrc += m_nStride;
+ lineDst += pDst->m_nStride;
+ }
+ }
+ }
+ return 1;
+}
+FX_BOOL CJBig2_Image::composeTo_opt2(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, JBig2ComposeOp op, const FX_RECT* pSrcRect)
+{
+ FX_INT32 xs0, ys0, xs1, ys1, xd0, yd0, xd1, yd1, xx, yy, w, h, middleDwords, lineLeft;
+ FX_DWORD s1, d1, d2, shift, shift1, shift2, tmp, tmp1, tmp2, maskL, maskR, maskM;
+ FX_BYTE *lineSrc, *lineDst, *sp, *dp;
+ FX_INT32 sw, sh;
+ if (!m_pData) {
+ return FALSE;
+ }
+ if (x < -1048576 || x > 1048576 || y < -1048576 || y > 1048576) {
+ return FALSE;
+ }
+ sw = pSrcRect->Width();
+ sh = pSrcRect->Height();
+ if(y < 0) {
+ ys0 = -y;
+ } else {
+ ys0 = 0;
+ }
+ if(y + sh > pDst->m_nHeight) {
+ ys1 = pDst->m_nHeight - y;
+ } else {
+ ys1 = sh;
+ }
+ if(x < 0) {
+ xs0 = -x;
+ } else {
+ xs0 = 0;
+ }
+ if(x + sw > pDst->m_nWidth) {
+ xs1 = pDst->m_nWidth - x;
+ } else {
+ xs1 = sw;
+ }
+ if((ys0 >= ys1) || (xs0 >= xs1)) {
+ return 0;
+ }
+ w = xs1 - xs0;
+ h = ys1 - ys0;
+ if(y < 0) {
+ yd0 = 0;
+ } else {
+ yd0 = y;
+ }
+ if(x < 0) {
+ xd0 = 0;
+ } else {
+ xd0 = x;
+ }
+ xd1 = xd0 + w;
+ yd1 = yd0 + h;
+ d1 = xd0 & 31;
+ d2 = xd1 & 31;
+ s1 = xs0 & 31;
+ maskL = 0xffffffff >> d1;
+ maskR = 0xffffffff << ((32 - (xd1 & 31)) % 32);
+ maskM = maskL & maskR;
+ lineSrc = m_pData + (pSrcRect->top + ys0) * m_nStride + (((xs0 + pSrcRect->left) >> 5) << 2);
+ lineLeft = m_nStride - ((xs0 >> 5) << 2);
+ lineDst = pDst->m_pData + yd0 * pDst->m_nStride + ((xd0 >> 5) << 2);
+ if((xd0 & ~31) == ((xd1 - 1) & ~31)) {
+ if((xs0 & ~31) == ((xs1 - 1) & ~31)) {
+ if(s1 > d1) {
+ shift = s1 - d1;
+ for(yy = yd0; yy < yd1; yy++) {
+ tmp1 = JBIG2_GETDWORD(lineSrc) << shift;
+ tmp2 = JBIG2_GETDWORD(lineDst);
+ switch(op) {
+ case JBIG2_COMPOSE_OR:
+ tmp = (tmp2 & ~maskM) | ((tmp1 | tmp2) & maskM);
+ break;
+ case JBIG2_COMPOSE_AND:
+ tmp = (tmp2 & ~maskM) | ((tmp1 & tmp2) & maskM);
+ break;
+ case JBIG2_COMPOSE_XOR:
+ tmp = (tmp2 & ~maskM) | ((tmp1 ^ tmp2) & maskM);
+ break;
+ case JBIG2_COMPOSE_XNOR:
+ tmp = (tmp2 & ~maskM) | ((~(tmp1 ^ tmp2)) & maskM);
+ break;
+ case JBIG2_COMPOSE_REPLACE:
+ tmp = (tmp2 & ~maskM) | (tmp1 & maskM);
+ break;
+ }
+ lineDst[0] = (FX_BYTE)(tmp >> 24);
+ lineDst[1] = (FX_BYTE)(tmp >> 16);
+ lineDst[2] = (FX_BYTE)(tmp >> 8);
+ lineDst[3] = (FX_BYTE)tmp;
+ lineSrc += m_nStride;
+ lineDst += pDst->m_nStride;
+ }
+ } else {
+ shift = d1 - s1;
+ for(yy = yd0; yy < yd1; yy++) {
+ tmp1 = JBIG2_GETDWORD(lineSrc) >> shift;
+ tmp2 = JBIG2_GETDWORD(lineDst);
+ switch(op) {
+ case JBIG2_COMPOSE_OR:
+ tmp = (tmp2 & ~maskM) | ((tmp1 | tmp2) & maskM);
+ break;
+ case JBIG2_COMPOSE_AND:
+ tmp = (tmp2 & ~maskM) | ((tmp1 & tmp2) & maskM);
+ break;
+ case JBIG2_COMPOSE_XOR:
+ tmp = (tmp2 & ~maskM) | ((tmp1 ^ tmp2) & maskM);
+ break;
+ case JBIG2_COMPOSE_XNOR:
+ tmp = (tmp2 & ~maskM) | ((~(tmp1 ^ tmp2)) & maskM);
+ break;
+ case JBIG2_COMPOSE_REPLACE:
+ tmp = (tmp2 & ~maskM) | (tmp1 & maskM);
+ break;
+ }
+ lineDst[0] = (FX_BYTE)(tmp >> 24);
+ lineDst[1] = (FX_BYTE)(tmp >> 16);
+ lineDst[2] = (FX_BYTE)(tmp >> 8);
+ lineDst[3] = (FX_BYTE)tmp;
+ lineSrc += m_nStride;
+ lineDst += pDst->m_nStride;
+ }
+ }
+ } else {
+ shift1 = s1 - d1;
+ shift2 = 32 - shift1;
+ for(yy = yd0; yy < yd1; yy++) {
+ tmp1 = (JBIG2_GETDWORD(lineSrc) << shift1) | (JBIG2_GETDWORD(lineSrc + 4) >> shift2);
+ tmp2 = JBIG2_GETDWORD(lineDst);
+ switch(op) {
+ case JBIG2_COMPOSE_OR:
+ tmp = (tmp2 & ~maskM) | ((tmp1 | tmp2) & maskM);
+ break;
+ case JBIG2_COMPOSE_AND:
+ tmp = (tmp2 & ~maskM) | ((tmp1 & tmp2) & maskM);
+ break;
+ case JBIG2_COMPOSE_XOR:
+ tmp = (tmp2 & ~maskM) | ((tmp1 ^ tmp2) & maskM);
+ break;
+ case JBIG2_COMPOSE_XNOR:
+ tmp = (tmp2 & ~maskM) | ((~(tmp1 ^ tmp2)) & maskM);
+ break;
+ case JBIG2_COMPOSE_REPLACE:
+ tmp = (tmp2 & ~maskM) | (tmp1 & maskM);
+ break;
+ }
+ lineDst[0] = (FX_BYTE)(tmp >> 24);
+ lineDst[1] = (FX_BYTE)(tmp >> 16);
+ lineDst[2] = (FX_BYTE)(tmp >> 8);
+ lineDst[3] = (FX_BYTE)tmp;
+ lineSrc += m_nStride;
+ lineDst += pDst->m_nStride;
+ }
+ }
+ } else {
+ if(s1 > d1) {
+ shift1 = s1 - d1;
+ shift2 = 32 - shift1;
+ middleDwords = (xd1 >> 5) - ((xd0 + 31) >> 5);
+ for(yy = yd0; yy < yd1; yy++) {
+ sp = lineSrc;
+ dp = lineDst;
+ if(d1 != 0) {
+ tmp1 = (JBIG2_GETDWORD(sp) << shift1) | (JBIG2_GETDWORD(sp + 4) >> shift2);
+ tmp2 = JBIG2_GETDWORD(dp);
+ switch(op) {
+ case JBIG2_COMPOSE_OR:
+ tmp = (tmp2 & ~maskL) | ((tmp1 | tmp2) & maskL);
+ break;
+ case JBIG2_COMPOSE_AND:
+ tmp = (tmp2 & ~maskL) | ((tmp1 & tmp2) & maskL);
+ break;
+ case JBIG2_COMPOSE_XOR:
+ tmp = (tmp2 & ~maskL) | ((tmp1 ^ tmp2) & maskL);
+ break;
+ case JBIG2_COMPOSE_XNOR:
+ tmp = (tmp2 & ~maskL) | ((~(tmp1 ^ tmp2)) & maskL);
+ break;
+ case JBIG2_COMPOSE_REPLACE:
+ tmp = (tmp2 & ~maskL) | (tmp1 & maskL);
+ break;
+ }
+ dp[0] = (FX_BYTE)(tmp >> 24);
+ dp[1] = (FX_BYTE)(tmp >> 16);
+ dp[2] = (FX_BYTE)(tmp >> 8);
+ dp[3] = (FX_BYTE)tmp;
+ sp += 4;
+ dp += 4;
+ }
+ for(xx = 0; xx < middleDwords; xx++) {
+ tmp1 = (JBIG2_GETDWORD(sp) << shift1) | (JBIG2_GETDWORD(sp + 4) >> shift2);
+ tmp2 = JBIG2_GETDWORD(dp);
+ switch(op) {
+ case JBIG2_COMPOSE_OR:
+ tmp = tmp1 | tmp2;
+ break;
+ case JBIG2_COMPOSE_AND:
+ tmp = tmp1 & tmp2;
+ break;
+ case JBIG2_COMPOSE_XOR:
+ tmp = tmp1 ^ tmp2;
+ break;
+ case JBIG2_COMPOSE_XNOR:
+ tmp = ~(tmp1 ^ tmp2);
+ break;
+ case JBIG2_COMPOSE_REPLACE:
+ tmp = tmp1;
+ break;
+ }
+ dp[0] = (FX_BYTE)(tmp >> 24);
+ dp[1] = (FX_BYTE)(tmp >> 16);
+ dp[2] = (FX_BYTE)(tmp >> 8);
+ dp[3] = (FX_BYTE)tmp;
+ sp += 4;
+ dp += 4;
+ }
+ if(d2 != 0) {
+ tmp1 = (JBIG2_GETDWORD(sp) << shift1) | (
+ ((sp + 4) < lineSrc + lineLeft ? JBIG2_GETDWORD(sp + 4) : 0) >> shift2);
+ tmp2 = JBIG2_GETDWORD(dp);
+ switch(op) {
+ case JBIG2_COMPOSE_OR:
+ tmp = (tmp2 & ~maskR) | ((tmp1 | tmp2) & maskR);
+ break;
+ case JBIG2_COMPOSE_AND:
+ tmp = (tmp2 & ~maskR) | ((tmp1 & tmp2) & maskR);
+ break;
+ case JBIG2_COMPOSE_XOR:
+ tmp = (tmp2 & ~maskR) | ((tmp1 ^ tmp2) & maskR);
+ break;
+ case JBIG2_COMPOSE_XNOR:
+ tmp = (tmp2 & ~maskR) | ((~(tmp1 ^ tmp2)) & maskR);
+ break;
+ case JBIG2_COMPOSE_REPLACE:
+ tmp = (tmp2 & ~maskR) | (tmp1 & maskR);
+ break;
+ }
+ dp[0] = (FX_BYTE)(tmp >> 24);
+ dp[1] = (FX_BYTE)(tmp >> 16);
+ dp[2] = (FX_BYTE)(tmp >> 8);
+ dp[3] = (FX_BYTE)tmp;
+ }
+ lineSrc += m_nStride;
+ lineDst += pDst->m_nStride;
+ }
+ } else if(s1 == d1) {
+ middleDwords = (xd1 >> 5) - ((xd0 + 31) >> 5);
+ for(yy = yd0; yy < yd1; yy++) {
+ sp = lineSrc;
+ dp = lineDst;
+ if(d1 != 0) {
+ tmp1 = JBIG2_GETDWORD(sp);
+ tmp2 = JBIG2_GETDWORD(dp);
+ switch(op) {
+ case JBIG2_COMPOSE_OR:
+ tmp = (tmp2 & ~maskL) | ((tmp1 | tmp2) & maskL);
+ break;
+ case JBIG2_COMPOSE_AND:
+ tmp = (tmp2 & ~maskL) | ((tmp1 & tmp2) & maskL);
+ break;
+ case JBIG2_COMPOSE_XOR:
+ tmp = (tmp2 & ~maskL) | ((tmp1 ^ tmp2) & maskL);
+ break;
+ case JBIG2_COMPOSE_XNOR:
+ tmp = (tmp2 & ~maskL) | ((~(tmp1 ^ tmp2)) & maskL);
+ break;
+ case JBIG2_COMPOSE_REPLACE:
+ tmp = (tmp2 & ~maskL) | (tmp1 & maskL);
+ break;
+ }
+ dp[0] = (FX_BYTE)(tmp >> 24);
+ dp[1] = (FX_BYTE)(tmp >> 16);
+ dp[2] = (FX_BYTE)(tmp >> 8);
+ dp[3] = (FX_BYTE)tmp;
+ sp += 4;
+ dp += 4;
+ }
+ for(xx = 0; xx < middleDwords; xx++) {
+ tmp1 = JBIG2_GETDWORD(sp);
+ tmp2 = JBIG2_GETDWORD(dp);
+ switch(op) {
+ case JBIG2_COMPOSE_OR:
+ tmp = tmp1 | tmp2;
+ break;
+ case JBIG2_COMPOSE_AND:
+ tmp = tmp1 & tmp2;
+ break;
+ case JBIG2_COMPOSE_XOR:
+ tmp = tmp1 ^ tmp2;
+ break;
+ case JBIG2_COMPOSE_XNOR:
+ tmp = ~(tmp1 ^ tmp2);
+ break;
+ case JBIG2_COMPOSE_REPLACE:
+ tmp = tmp1;
+ break;
+ }
+ dp[0] = (FX_BYTE)(tmp >> 24);
+ dp[1] = (FX_BYTE)(tmp >> 16);
+ dp[2] = (FX_BYTE)(tmp >> 8);
+ dp[3] = (FX_BYTE)tmp;
+ sp += 4;
+ dp += 4;
+ }
+ if(d2 != 0) {
+ tmp1 = JBIG2_GETDWORD(sp);
+ tmp2 = JBIG2_GETDWORD(dp);
+ switch(op) {
+ case JBIG2_COMPOSE_OR:
+ tmp = (tmp2 & ~maskR) | ((tmp1 | tmp2) & maskR);
+ break;
+ case JBIG2_COMPOSE_AND:
+ tmp = (tmp2 & ~maskR) | ((tmp1 & tmp2) & maskR);
+ break;
+ case JBIG2_COMPOSE_XOR:
+ tmp = (tmp2 & ~maskR) | ((tmp1 ^ tmp2) & maskR);
+ break;
+ case JBIG2_COMPOSE_XNOR:
+ tmp = (tmp2 & ~maskR) | ((~(tmp1 ^ tmp2)) & maskR);
+ break;
+ case JBIG2_COMPOSE_REPLACE:
+ tmp = (tmp2 & ~maskR) | (tmp1 & maskR);
+ break;
+ }
+ dp[0] = (FX_BYTE)(tmp >> 24);
+ dp[1] = (FX_BYTE)(tmp >> 16);
+ dp[2] = (FX_BYTE)(tmp >> 8);
+ dp[3] = (FX_BYTE)tmp;
+ }
+ lineSrc += m_nStride;
+ lineDst += pDst->m_nStride;
+ }
+ } else {
+ shift1 = d1 - s1;
+ shift2 = 32 - shift1;
+ middleDwords = (xd1 >> 5) - ((xd0 + 31) >> 5);
+ for(yy = yd0; yy < yd1; yy++) {
+ sp = lineSrc;
+ dp = lineDst;
+ if(d1 != 0) {
+ tmp1 = JBIG2_GETDWORD(sp) >> shift1;
+ tmp2 = JBIG2_GETDWORD(dp);
+ switch(op) {
+ case JBIG2_COMPOSE_OR:
+ tmp = (tmp2 & ~maskL) | ((tmp1 | tmp2) & maskL);
+ break;
+ case JBIG2_COMPOSE_AND:
+ tmp = (tmp2 & ~maskL) | ((tmp1 & tmp2) & maskL);
+ break;
+ case JBIG2_COMPOSE_XOR:
+ tmp = (tmp2 & ~maskL) | ((tmp1 ^ tmp2) & maskL);
+ break;
+ case JBIG2_COMPOSE_XNOR:
+ tmp = (tmp2 & ~maskL) | ((~(tmp1 ^ tmp2)) & maskL);
+ break;
+ case JBIG2_COMPOSE_REPLACE:
+ tmp = (tmp2 & ~maskL) | (tmp1 & maskL);
+ break;
+ }
+ dp[0] = (FX_BYTE)(tmp >> 24);
+ dp[1] = (FX_BYTE)(tmp >> 16);
+ dp[2] = (FX_BYTE)(tmp >> 8);
+ dp[3] = (FX_BYTE)tmp;
+ dp += 4;
+ }
+ for(xx = 0; xx < middleDwords; xx++) {
+ tmp1 = (JBIG2_GETDWORD(sp) << shift2) | ((JBIG2_GETDWORD(sp + 4)) >> shift1);
+ tmp2 = JBIG2_GETDWORD(dp);
+ switch(op) {
+ case JBIG2_COMPOSE_OR:
+ tmp = tmp1 | tmp2;
+ break;
+ case JBIG2_COMPOSE_AND:
+ tmp = tmp1 & tmp2;
+ break;
+ case JBIG2_COMPOSE_XOR:
+ tmp = tmp1 ^ tmp2;
+ break;
+ case JBIG2_COMPOSE_XNOR:
+ tmp = ~(tmp1 ^ tmp2);
+ break;
+ case JBIG2_COMPOSE_REPLACE:
+ tmp = tmp1;
+ break;
+ }
+ dp[0] = (FX_BYTE)(tmp >> 24);
+ dp[1] = (FX_BYTE)(tmp >> 16);
+ dp[2] = (FX_BYTE)(tmp >> 8);
+ dp[3] = (FX_BYTE)tmp;
+ sp += 4;
+ dp += 4;
+ }
+ if(d2 != 0) {
+ tmp1 = (JBIG2_GETDWORD(sp) << shift2) | (
+ ((sp + 4) < lineSrc + lineLeft ? JBIG2_GETDWORD(sp + 4) : 0) >> shift1);
+ tmp2 = JBIG2_GETDWORD(dp);
+ switch(op) {
+ case JBIG2_COMPOSE_OR:
+ tmp = (tmp2 & ~maskR) | ((tmp1 | tmp2) & maskR);
+ break;
+ case JBIG2_COMPOSE_AND:
+ tmp = (tmp2 & ~maskR) | ((tmp1 & tmp2) & maskR);
+ break;
+ case JBIG2_COMPOSE_XOR:
+ tmp = (tmp2 & ~maskR) | ((tmp1 ^ tmp2) & maskR);
+ break;
+ case JBIG2_COMPOSE_XNOR:
+ tmp = (tmp2 & ~maskR) | ((~(tmp1 ^ tmp2)) & maskR);
+ break;
+ case JBIG2_COMPOSE_REPLACE:
+ tmp = (tmp2 & ~maskR) | (tmp1 & maskR);
+ break;
+ }
+ dp[0] = (FX_BYTE)(tmp >> 24);
+ dp[1] = (FX_BYTE)(tmp >> 16);
+ dp[2] = (FX_BYTE)(tmp >> 8);
+ dp[3] = (FX_BYTE)tmp;
+ }
+ lineSrc += m_nStride;
+ lineDst += pDst->m_nStride;
+ }
+ }
+ }
+ return 1;
+}
diff --git a/core/src/fxcodec/jbig2/JBig2_Image.h b/core/src/fxcodec/jbig2/JBig2_Image.h
index 3c69f647e3..5d06695c7c 100644
--- a/core/src/fxcodec/jbig2/JBig2_Image.h
+++ b/core/src/fxcodec/jbig2/JBig2_Image.h
@@ -1,68 +1,68 @@
-// 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 _JBIG2_IMAGE_H_
-#define _JBIG2_IMAGE_H_
-#include "JBig2_Define.h"
-#include "JBig2_Module.h"
-typedef enum {
- JBIG2_COMPOSE_OR = 0,
- JBIG2_COMPOSE_AND = 1,
- JBIG2_COMPOSE_XOR = 2,
- JBIG2_COMPOSE_XNOR = 3,
- JBIG2_COMPOSE_REPLACE = 4
-} JBig2ComposeOp;
-struct FX_RECT;
-class CJBig2_Image : public CJBig2_Object
-{
-public:
-
- CJBig2_Image(FX_INT32 w, FX_INT32 h);
-
- CJBig2_Image(FX_INT32 w, FX_INT32 h, FX_INT32 stride, FX_BYTE*pBuf);
-
- CJBig2_Image(CJBig2_Image &im);
-
- ~CJBig2_Image();
-
- FX_BOOL getPixel(FX_INT32 x, FX_INT32 y);
-
- FX_INT32 setPixel(FX_INT32 x, FX_INT32 y, FX_BOOL v);
-
- void copyLine(FX_INT32 hTo, FX_INT32 hFrom);
-
- void fill(FX_BOOL v);
-
- FX_BOOL composeTo(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, JBig2ComposeOp op);
- FX_BOOL composeTo(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, JBig2ComposeOp op, const FX_RECT* pSrcRect);
-
- FX_BOOL composeTo_unopt(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, JBig2ComposeOp op);
-
- FX_BOOL composeTo_opt(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, JBig2ComposeOp op);
-
- FX_BOOL composeTo_opt2(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, JBig2ComposeOp op);
- FX_BOOL composeTo_opt2(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, JBig2ComposeOp op, const FX_RECT* pSrcRect);
-
- FX_BOOL composeFrom(FX_INT32 x, FX_INT32 y, CJBig2_Image *pSrc, JBig2ComposeOp op);
- FX_BOOL composeFrom(FX_INT32 x, FX_INT32 y, CJBig2_Image *pSrc, JBig2ComposeOp op, const FX_RECT* pSrcRect);
- CJBig2_Image *subImage_unopt(FX_INT32 x, FX_INT32 y, FX_INT32 w, FX_INT32 h);
-
- CJBig2_Image *subImage(FX_INT32 x, FX_INT32 y, FX_INT32 w, FX_INT32 h);
-
- void expand(FX_INT32 h, FX_BOOL v);
-public:
-
- FX_INT32 m_nWidth;
-
- FX_INT32 m_nHeight;
-
- FX_INT32 m_nStride;
-
- FX_BYTE *m_pData;
-
- FX_BOOL m_bNeedFree;
-};
-#endif
+// 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 _JBIG2_IMAGE_H_
+#define _JBIG2_IMAGE_H_
+#include "JBig2_Define.h"
+#include "JBig2_Module.h"
+typedef enum {
+ JBIG2_COMPOSE_OR = 0,
+ JBIG2_COMPOSE_AND = 1,
+ JBIG2_COMPOSE_XOR = 2,
+ JBIG2_COMPOSE_XNOR = 3,
+ JBIG2_COMPOSE_REPLACE = 4
+} JBig2ComposeOp;
+struct FX_RECT;
+class CJBig2_Image : public CJBig2_Object
+{
+public:
+
+ CJBig2_Image(FX_INT32 w, FX_INT32 h);
+
+ CJBig2_Image(FX_INT32 w, FX_INT32 h, FX_INT32 stride, FX_BYTE*pBuf);
+
+ CJBig2_Image(CJBig2_Image &im);
+
+ ~CJBig2_Image();
+
+ FX_BOOL getPixel(FX_INT32 x, FX_INT32 y);
+
+ FX_INT32 setPixel(FX_INT32 x, FX_INT32 y, FX_BOOL v);
+
+ void copyLine(FX_INT32 hTo, FX_INT32 hFrom);
+
+ void fill(FX_BOOL v);
+
+ FX_BOOL composeTo(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, JBig2ComposeOp op);
+ FX_BOOL composeTo(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, JBig2ComposeOp op, const FX_RECT* pSrcRect);
+
+ FX_BOOL composeTo_unopt(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, JBig2ComposeOp op);
+
+ FX_BOOL composeTo_opt(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, JBig2ComposeOp op);
+
+ FX_BOOL composeTo_opt2(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, JBig2ComposeOp op);
+ FX_BOOL composeTo_opt2(CJBig2_Image *pDst, FX_INT32 x, FX_INT32 y, JBig2ComposeOp op, const FX_RECT* pSrcRect);
+
+ FX_BOOL composeFrom(FX_INT32 x, FX_INT32 y, CJBig2_Image *pSrc, JBig2ComposeOp op);
+ FX_BOOL composeFrom(FX_INT32 x, FX_INT32 y, CJBig2_Image *pSrc, JBig2ComposeOp op, const FX_RECT* pSrcRect);
+ CJBig2_Image *subImage_unopt(FX_INT32 x, FX_INT32 y, FX_INT32 w, FX_INT32 h);
+
+ CJBig2_Image *subImage(FX_INT32 x, FX_INT32 y, FX_INT32 w, FX_INT32 h);
+
+ void expand(FX_INT32 h, FX_BOOL v);
+public:
+
+ FX_INT32 m_nWidth;
+
+ FX_INT32 m_nHeight;
+
+ FX_INT32 m_nStride;
+
+ FX_BYTE *m_pData;
+
+ FX_BOOL m_bNeedFree;
+};
+#endif
diff --git a/core/src/fxcodec/jbig2/JBig2_List.h b/core/src/fxcodec/jbig2/JBig2_List.h
index a737d9e112..9292724b1e 100644
--- a/core/src/fxcodec/jbig2/JBig2_List.h
+++ b/core/src/fxcodec/jbig2/JBig2_List.h
@@ -1,67 +1,67 @@
-// 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 _JBIG2_LIST_H_
-#define _JBIG2_LIST_H_
-#include "JBig2_Define.h"
-#include "JBig2_Object.h"
-template <class TYPE>
-class CJBig2_List : public CJBig2_Object
-{
-public:
-
- CJBig2_List(FX_INT32 nSize = 8)
- {
- m_nSize = nSize;
- m_pArray = (TYPE**)m_pModule->JBig2_Malloc2(sizeof(TYPE*), nSize);
- m_nLength = 0;
- }
-
- ~CJBig2_List()
- {
- clear();
- m_pModule->JBig2_Free(m_pArray);
- }
-
- void clear()
- {
- FX_INT32 i;
- for(i = 0; i < m_nLength; i++) {
- delete m_pArray[i];
- }
- m_nLength = 0;
- }
-
- void addItem(TYPE *pItem)
- {
- if(m_nLength >= m_nSize) {
- m_nSize += 8;
- m_pArray = (TYPE**)m_pModule->JBig2_Realloc(m_pArray, sizeof(TYPE*)*m_nSize);
- }
- m_pArray[m_nLength++] = pItem;
- }
-
-
- FX_INT32 getLength()
- {
- return m_nLength;
- }
-
- TYPE *getAt(FX_INT32 nIndex)
- {
- return m_pArray[nIndex];
- }
-
- TYPE *getLast()
- {
- return m_pArray[m_nLength - 1];
- }
-private:
- FX_INT32 m_nSize;
- TYPE **m_pArray;
- FX_INT32 m_nLength;
-};
-#endif
+// 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 _JBIG2_LIST_H_
+#define _JBIG2_LIST_H_
+#include "JBig2_Define.h"
+#include "JBig2_Object.h"
+template <class TYPE>
+class CJBig2_List : public CJBig2_Object
+{
+public:
+
+ CJBig2_List(FX_INT32 nSize = 8)
+ {
+ m_nSize = nSize;
+ m_pArray = (TYPE**)m_pModule->JBig2_Malloc2(sizeof(TYPE*), nSize);
+ m_nLength = 0;
+ }
+
+ ~CJBig2_List()
+ {
+ clear();
+ m_pModule->JBig2_Free(m_pArray);
+ }
+
+ void clear()
+ {
+ FX_INT32 i;
+ for(i = 0; i < m_nLength; i++) {
+ delete m_pArray[i];
+ }
+ m_nLength = 0;
+ }
+
+ void addItem(TYPE *pItem)
+ {
+ if(m_nLength >= m_nSize) {
+ m_nSize += 8;
+ m_pArray = (TYPE**)m_pModule->JBig2_Realloc(m_pArray, sizeof(TYPE*)*m_nSize);
+ }
+ m_pArray[m_nLength++] = pItem;
+ }
+
+
+ FX_INT32 getLength()
+ {
+ return m_nLength;
+ }
+
+ TYPE *getAt(FX_INT32 nIndex)
+ {
+ return m_pArray[nIndex];
+ }
+
+ TYPE *getLast()
+ {
+ return m_pArray[m_nLength - 1];
+ }
+private:
+ FX_INT32 m_nSize;
+ TYPE **m_pArray;
+ FX_INT32 m_nLength;
+};
+#endif
diff --git a/core/src/fxcodec/jbig2/JBig2_Module.h b/core/src/fxcodec/jbig2/JBig2_Module.h
index ccde5ade02..3a01eb094c 100644
--- a/core/src/fxcodec/jbig2/JBig2_Module.h
+++ b/core/src/fxcodec/jbig2/JBig2_Module.h
@@ -1,32 +1,32 @@
-// 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 _JBIG2_MODULE_H_
-#define _JBIG2_MODULE_H_
-#include "JBig2_Define.h"
-class CJBig2_Module
-{
-public:
-
- virtual void *JBig2_Malloc(FX_DWORD dwSize) = 0;
-
- virtual void *JBig2_Malloc2(FX_DWORD num, FX_DWORD dwSize) = 0;
-
- virtual void *JBig2_Malloc3(FX_DWORD num, FX_DWORD dwSize, FX_DWORD dwSize2) = 0;
-
- virtual void *JBig2_Realloc(FX_LPVOID pMem, FX_DWORD dwSize) = 0;
-
- virtual void JBig2_Free(FX_LPVOID pMem) = 0;
-
- virtual void JBig2_Assert(FX_INT32 nExpression) {};
-
- virtual void JBig2_Error(FX_LPCSTR format, ...) {};
-
- virtual void JBig2_Warn(FX_LPCSTR format, ...) {};
-
- virtual void JBig2_Log(FX_LPCSTR format, ...) {};
-};
-#endif
+// 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 _JBIG2_MODULE_H_
+#define _JBIG2_MODULE_H_
+#include "JBig2_Define.h"
+class CJBig2_Module
+{
+public:
+
+ virtual void *JBig2_Malloc(FX_DWORD dwSize) = 0;
+
+ virtual void *JBig2_Malloc2(FX_DWORD num, FX_DWORD dwSize) = 0;
+
+ virtual void *JBig2_Malloc3(FX_DWORD num, FX_DWORD dwSize, FX_DWORD dwSize2) = 0;
+
+ virtual void *JBig2_Realloc(FX_LPVOID pMem, FX_DWORD dwSize) = 0;
+
+ virtual void JBig2_Free(FX_LPVOID pMem) = 0;
+
+ virtual void JBig2_Assert(FX_INT32 nExpression) {};
+
+ virtual void JBig2_Error(FX_LPCSTR format, ...) {};
+
+ virtual void JBig2_Warn(FX_LPCSTR format, ...) {};
+
+ virtual void JBig2_Log(FX_LPCSTR format, ...) {};
+};
+#endif
diff --git a/core/src/fxcodec/jbig2/JBig2_Object.cpp b/core/src/fxcodec/jbig2/JBig2_Object.cpp
index 3a94f0e65a..2bb267b085 100644
--- a/core/src/fxcodec/jbig2/JBig2_Object.cpp
+++ b/core/src/fxcodec/jbig2/JBig2_Object.cpp
@@ -1,72 +1,72 @@
-// 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
-
-#include "JBig2_Object.h"
-#include "JBig2_Module.h"
-void *CJBig2_Object::operator new(size_t size, CJBig2_Module *pModule, FX_LPCSTR filename, int line)
-{
- CJBig2_Object *p;
- p = (CJBig2_Object *)pModule->JBig2_Malloc((FX_DWORD)size);
- p->m_pModule = pModule;
- return p;
-}
-void CJBig2_Object::operator delete(void *p, CJBig2_Module *pModule, FX_LPCSTR filename, int line)
-{
- pModule->JBig2_Free(p);
-}
-void *CJBig2_Object::operator new(size_t size, CJBig2_Module *pModule)
-{
- CJBig2_Object *p;
- p = (CJBig2_Object *)pModule->JBig2_Malloc((FX_DWORD)size);
- p->m_pModule = pModule;
- return p;
-}
-void CJBig2_Object::operator delete(void *p)
-{
- ((CJBig2_Object *)p)->m_pModule->JBig2_Free(p);
-}
-void CJBig2_Object::operator delete(void *p, CJBig2_Module *pModule)
-{
- pModule->JBig2_Free(p);
-}
-void *CJBig2_Object::operator new[](size_t size, CJBig2_Module *pModule, size_t unit_size,
- FX_LPCSTR filename, int line)
-{
- void *p;
- FX_BYTE *pCur, *pEnd;
- p = (FX_BYTE *)pModule->JBig2_Malloc((FX_DWORD)size);
- pCur = (FX_BYTE *)p;
- pEnd = pCur + size;
- for(; pCur < pEnd; pCur += unit_size) {
- ((CJBig2_Object *)pCur)->m_pModule = pModule;
- }
- return p;
-}
-void CJBig2_Object::operator delete[](void *p, CJBig2_Module *pModule, size_t unit_size,
- FX_LPCSTR filename, int line)
-{
- pModule->JBig2_Free(p);
-}
-void *CJBig2_Object::operator new[](size_t size, CJBig2_Module *pModule, size_t unit_size)
-{
- void *p;
- FX_BYTE *pCur, *pEnd;
- p = (FX_BYTE *)pModule->JBig2_Malloc((FX_DWORD)size);
- pCur = (FX_BYTE *)p;
- pEnd = pCur + size;
- for(; pCur < pEnd; pCur += unit_size) {
- ((CJBig2_Object *)pCur)->m_pModule = pModule;
- }
- return p;
-}
-void CJBig2_Object::operator delete[](void* p)
-{
- ((CJBig2_Object *)p)->m_pModule->JBig2_Free(p);
-}
-void CJBig2_Object::operator delete[](void *p, CJBig2_Module *pModule, size_t unit_size)
-{
- pModule->JBig2_Free(p);
-}
+// 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
+
+#include "JBig2_Object.h"
+#include "JBig2_Module.h"
+void *CJBig2_Object::operator new(size_t size, CJBig2_Module *pModule, FX_LPCSTR filename, int line)
+{
+ CJBig2_Object *p;
+ p = (CJBig2_Object *)pModule->JBig2_Malloc((FX_DWORD)size);
+ p->m_pModule = pModule;
+ return p;
+}
+void CJBig2_Object::operator delete(void *p, CJBig2_Module *pModule, FX_LPCSTR filename, int line)
+{
+ pModule->JBig2_Free(p);
+}
+void *CJBig2_Object::operator new(size_t size, CJBig2_Module *pModule)
+{
+ CJBig2_Object *p;
+ p = (CJBig2_Object *)pModule->JBig2_Malloc((FX_DWORD)size);
+ p->m_pModule = pModule;
+ return p;
+}
+void CJBig2_Object::operator delete(void *p)
+{
+ ((CJBig2_Object *)p)->m_pModule->JBig2_Free(p);
+}
+void CJBig2_Object::operator delete(void *p, CJBig2_Module *pModule)
+{
+ pModule->JBig2_Free(p);
+}
+void *CJBig2_Object::operator new[](size_t size, CJBig2_Module *pModule, size_t unit_size,
+ FX_LPCSTR filename, int line)
+{
+ void *p;
+ FX_BYTE *pCur, *pEnd;
+ p = (FX_BYTE *)pModule->JBig2_Malloc((FX_DWORD)size);
+ pCur = (FX_BYTE *)p;
+ pEnd = pCur + size;
+ for(; pCur < pEnd; pCur += unit_size) {
+ ((CJBig2_Object *)pCur)->m_pModule = pModule;
+ }
+ return p;
+}
+void CJBig2_Object::operator delete[](void *p, CJBig2_Module *pModule, size_t unit_size,
+ FX_LPCSTR filename, int line)
+{
+ pModule->JBig2_Free(p);
+}
+void *CJBig2_Object::operator new[](size_t size, CJBig2_Module *pModule, size_t unit_size)
+{
+ void *p;
+ FX_BYTE *pCur, *pEnd;
+ p = (FX_BYTE *)pModule->JBig2_Malloc((FX_DWORD)size);
+ pCur = (FX_BYTE *)p;
+ pEnd = pCur + size;
+ for(; pCur < pEnd; pCur += unit_size) {
+ ((CJBig2_Object *)pCur)->m_pModule = pModule;
+ }
+ return p;
+}
+void CJBig2_Object::operator delete[](void* p)
+{
+ ((CJBig2_Object *)p)->m_pModule->JBig2_Free(p);
+}
+void CJBig2_Object::operator delete[](void *p, CJBig2_Module *pModule, size_t unit_size)
+{
+ pModule->JBig2_Free(p);
+}
diff --git a/core/src/fxcodec/jbig2/JBig2_Object.h b/core/src/fxcodec/jbig2/JBig2_Object.h
index 7fef1a21a9..23eecbf171 100644
--- a/core/src/fxcodec/jbig2/JBig2_Object.h
+++ b/core/src/fxcodec/jbig2/JBig2_Object.h
@@ -1,43 +1,43 @@
-// 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 _JBIG2_OBJECT_H_
-#define _JBIG2_OBJECT_H_
-#include "JBig2_Define.h"
-class CJBig2_Module;
-#define _JBIG2_NO_EXPECTION_
-class CJBig2_Object
-{
-public:
-
- void *operator new(size_t size, CJBig2_Module *pModule, FX_LPCSTR filename, int line);
-
- void operator delete(void *p, CJBig2_Module *pModule, FX_LPCSTR filename, int line);
-
- void *operator new(size_t size, CJBig2_Module *pModule);
-
- void operator delete(void *p);
-
- void operator delete(void *p, CJBig2_Module *pModule);
-
- void *operator new[](size_t size, CJBig2_Module *pModule, size_t unit_size,
- FX_LPCSTR filename, int line);
-
- void operator delete[](void *p, CJBig2_Module *pModule, size_t unit_size,
- FX_LPCSTR filename, int line);
-
- void *operator new[](size_t size, CJBig2_Module *pModule, size_t unit_size);
-
- void operator delete[](void* p);
-
- void operator delete[](void *p, CJBig2_Module *pModule, size_t unit_size);
-public:
-
- CJBig2_Module *m_pModule;
-};
-#define JBIG2_NEW new(m_pModule)
-#define JBIG2_ALLOC(p, a) p = JBIG2_NEW a; p->m_pModule = m_pModule;
-#endif
+// 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 _JBIG2_OBJECT_H_
+#define _JBIG2_OBJECT_H_
+#include "JBig2_Define.h"
+class CJBig2_Module;
+#define _JBIG2_NO_EXPECTION_
+class CJBig2_Object
+{
+public:
+
+ void *operator new(size_t size, CJBig2_Module *pModule, FX_LPCSTR filename, int line);
+
+ void operator delete(void *p, CJBig2_Module *pModule, FX_LPCSTR filename, int line);
+
+ void *operator new(size_t size, CJBig2_Module *pModule);
+
+ void operator delete(void *p);
+
+ void operator delete(void *p, CJBig2_Module *pModule);
+
+ void *operator new[](size_t size, CJBig2_Module *pModule, size_t unit_size,
+ FX_LPCSTR filename, int line);
+
+ void operator delete[](void *p, CJBig2_Module *pModule, size_t unit_size,
+ FX_LPCSTR filename, int line);
+
+ void *operator new[](size_t size, CJBig2_Module *pModule, size_t unit_size);
+
+ void operator delete[](void* p);
+
+ void operator delete[](void *p, CJBig2_Module *pModule, size_t unit_size);
+public:
+
+ CJBig2_Module *m_pModule;
+};
+#define JBIG2_NEW new(m_pModule)
+#define JBIG2_ALLOC(p, a) p = JBIG2_NEW a; p->m_pModule = m_pModule;
+#endif
diff --git a/core/src/fxcodec/jbig2/JBig2_Page.h b/core/src/fxcodec/jbig2/JBig2_Page.h
index 490705448c..d7399bd452 100644
--- a/core/src/fxcodec/jbig2/JBig2_Page.h
+++ b/core/src/fxcodec/jbig2/JBig2_Page.h
@@ -1,19 +1,19 @@
-// 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 _JBIG2_PAGE_H_
-#define _JBIG2_PAGE_H_
-#include "JBig2_Image.h"
-struct JBig2PageInfo : public CJBig2_Object {
- FX_DWORD m_dwWidth,
- m_dwHeight;
- FX_DWORD m_dwResolutionX,
- m_dwResolutionY;
- FX_BYTE m_cFlags;
- FX_BOOL m_bIsStriped;
- FX_WORD m_wMaxStripeSize;
-};
-#endif
+// 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 _JBIG2_PAGE_H_
+#define _JBIG2_PAGE_H_
+#include "JBig2_Image.h"
+struct JBig2PageInfo : public CJBig2_Object {
+ FX_DWORD m_dwWidth,
+ m_dwHeight;
+ FX_DWORD m_dwResolutionX,
+ m_dwResolutionY;
+ FX_BYTE m_cFlags;
+ FX_BOOL m_bIsStriped;
+ FX_WORD m_wMaxStripeSize;
+};
+#endif
diff --git a/core/src/fxcodec/jbig2/JBig2_PatternDict.cpp b/core/src/fxcodec/jbig2/JBig2_PatternDict.cpp
index 58c52a5848..0c6e5be8ce 100644
--- a/core/src/fxcodec/jbig2/JBig2_PatternDict.cpp
+++ b/core/src/fxcodec/jbig2/JBig2_PatternDict.cpp
@@ -1,24 +1,24 @@
-// 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
-
-#include "JBig2_PatternDict.h"
-CJBig2_PatternDict::CJBig2_PatternDict()
-{
- NUMPATS = 0;
- HDPATS = NULL;
-}
-
-CJBig2_PatternDict::~CJBig2_PatternDict()
-{
- if(HDPATS) {
- for(FX_DWORD i = 0; i < NUMPATS; i++) {
- if(HDPATS[i]) {
- delete HDPATS[i];
- }
- }
- m_pModule->JBig2_Free(HDPATS);
- }
-}
+// 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
+
+#include "JBig2_PatternDict.h"
+CJBig2_PatternDict::CJBig2_PatternDict()
+{
+ NUMPATS = 0;
+ HDPATS = NULL;
+}
+
+CJBig2_PatternDict::~CJBig2_PatternDict()
+{
+ if(HDPATS) {
+ for(FX_DWORD i = 0; i < NUMPATS; i++) {
+ if(HDPATS[i]) {
+ delete HDPATS[i];
+ }
+ }
+ m_pModule->JBig2_Free(HDPATS);
+ }
+}
diff --git a/core/src/fxcodec/jbig2/JBig2_PatternDict.h b/core/src/fxcodec/jbig2/JBig2_PatternDict.h
index c8686507d9..b75cbde999 100644
--- a/core/src/fxcodec/jbig2/JBig2_PatternDict.h
+++ b/core/src/fxcodec/jbig2/JBig2_PatternDict.h
@@ -1,22 +1,22 @@
-// 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 _JBIG2_PATTERN_DICT_H_
-#define _JBIG2_PATTERN_DICT_H_
-#include "JBig2_Define.h"
-#include "JBig2_Image.h"
-class CJBig2_PatternDict : public CJBig2_Object
-{
-public:
-
- CJBig2_PatternDict();
-
- ~CJBig2_PatternDict();
-public:
- FX_DWORD NUMPATS;
- CJBig2_Image **HDPATS;
-};
-#endif
+// 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 _JBIG2_PATTERN_DICT_H_
+#define _JBIG2_PATTERN_DICT_H_
+#include "JBig2_Define.h"
+#include "JBig2_Image.h"
+class CJBig2_PatternDict : public CJBig2_Object
+{
+public:
+
+ CJBig2_PatternDict();
+
+ ~CJBig2_PatternDict();
+public:
+ FX_DWORD NUMPATS;
+ CJBig2_Image **HDPATS;
+};
+#endif
diff --git a/core/src/fxcodec/jbig2/JBig2_Segment.cpp b/core/src/fxcodec/jbig2/JBig2_Segment.cpp
index 788207dc6e..b7eed35987 100644
--- a/core/src/fxcodec/jbig2/JBig2_Segment.cpp
+++ b/core/src/fxcodec/jbig2/JBig2_Segment.cpp
@@ -1,53 +1,53 @@
-// 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
-
-#include "JBig2_Segment.h"
-CJBig2_Segment::CJBig2_Segment()
-{
- init();
-}
-CJBig2_Segment::~CJBig2_Segment()
-{
- clean();
-}
-void CJBig2_Segment::init()
-{
- m_dwNumber = 0;
- m_cFlags.c = 0;
- m_nReferred_to_segment_count = 0;
- m_pReferred_to_segment_numbers = NULL;
- m_dwPage_association = 0;
- m_dwData_length = 0;
- m_dwHeader_Length = 0;
- m_pData = NULL;
- m_State = JBIG2_SEGMENT_HEADER_UNPARSED;
- m_nResultType = JBIG2_VOID_POINTER;
- m_Result.vd = NULL;
-}
-void CJBig2_Segment::clean()
-{
- if(m_pReferred_to_segment_numbers) {
- m_pModule->JBig2_Free(m_pReferred_to_segment_numbers);
- }
- if(m_Result.vd) {
- switch(m_nResultType) {
- case JBIG2_IMAGE_POINTER:
- delete m_Result.im;
- break;
- case JBIG2_SYMBOL_DICT_POINTER:
- delete m_Result.sd;
- break;
- case JBIG2_PATTERN_DICT_POINTER:
- delete m_Result.pd;
- break;
- case JBIG2_HUFFMAN_TABLE_POINTER:
- delete m_Result.ht;
- break;
- default:
- m_pModule->JBig2_Free(m_Result.vd);
- }
- }
-}
+// 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
+
+#include "JBig2_Segment.h"
+CJBig2_Segment::CJBig2_Segment()
+{
+ init();
+}
+CJBig2_Segment::~CJBig2_Segment()
+{
+ clean();
+}
+void CJBig2_Segment::init()
+{
+ m_dwNumber = 0;
+ m_cFlags.c = 0;
+ m_nReferred_to_segment_count = 0;
+ m_pReferred_to_segment_numbers = NULL;
+ m_dwPage_association = 0;
+ m_dwData_length = 0;
+ m_dwHeader_Length = 0;
+ m_pData = NULL;
+ m_State = JBIG2_SEGMENT_HEADER_UNPARSED;
+ m_nResultType = JBIG2_VOID_POINTER;
+ m_Result.vd = NULL;
+}
+void CJBig2_Segment::clean()
+{
+ if(m_pReferred_to_segment_numbers) {
+ m_pModule->JBig2_Free(m_pReferred_to_segment_numbers);
+ }
+ if(m_Result.vd) {
+ switch(m_nResultType) {
+ case JBIG2_IMAGE_POINTER:
+ delete m_Result.im;
+ break;
+ case JBIG2_SYMBOL_DICT_POINTER:
+ delete m_Result.sd;
+ break;
+ case JBIG2_PATTERN_DICT_POINTER:
+ delete m_Result.pd;
+ break;
+ case JBIG2_HUFFMAN_TABLE_POINTER:
+ delete m_Result.ht;
+ break;
+ default:
+ m_pModule->JBig2_Free(m_Result.vd);
+ }
+ }
+}
diff --git a/core/src/fxcodec/jbig2/JBig2_Segment.h b/core/src/fxcodec/jbig2/JBig2_Segment.h
index 48c31b17bb..33ee721a1b 100644
--- a/core/src/fxcodec/jbig2/JBig2_Segment.h
+++ b/core/src/fxcodec/jbig2/JBig2_Segment.h
@@ -1,68 +1,68 @@
-// 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 _JBIG2_SEGMENT_H_
-#define _JBIG2_SEGMENT_H_
-#include "JBig2_Define.h"
-#include "JBig2_SymbolDict.h"
-#include "JBig2_PatternDict.h"
-#include "JBig2_Module.h"
-#include "JBig2_HuffmanTable.h"
-#define JBIG2_GET_INT32(buf) (((buf)[0]<<24) | ((buf)[1]<<16) | ((buf)[2]<<8) | (buf)[3])
-#define JBIG2_GET_INT16(buf) (((buf)[0]<<8) | (buf)[1])
-typedef enum {
- JBIG2_SEGMENT_HEADER_UNPARSED,
- JBIG2_SEGMENT_DATA_UNPARSED,
- JBIG2_SEGMENT_PARSE_COMPLETE,
- JBIG2_SEGMENT_PAUSED,
- JBIG2_SEGMENT_ERROR
-} JBig2_SegmentState;
-typedef enum {
- JBIG2_VOID_POINTER = 0,
- JBIG2_IMAGE_POINTER,
- JBIG2_SYMBOL_DICT_POINTER,
- JBIG2_PATTERN_DICT_POINTER,
- JBIG2_HUFFMAN_TABLE_POINTER
-} JBig2_ResultType;
-class CJBig2_Segment : public CJBig2_Object
-{
-public:
-
- CJBig2_Segment();
-
- ~CJBig2_Segment();
-
- void init();
-
- void clean();
-public:
- FX_DWORD m_dwNumber;
- union {
- struct {
- FX_BYTE type : 6;
- FX_BYTE page_association_size : 1;
- FX_BYTE deferred_non_retain : 1;
- } s;
- FX_BYTE c;
- } m_cFlags;
- FX_INT32 m_nReferred_to_segment_count;
- FX_DWORD * m_pReferred_to_segment_numbers;
- FX_DWORD m_dwPage_association;
- FX_DWORD m_dwData_length;
-
- FX_DWORD m_dwHeader_Length;
- FX_BYTE *m_pData;
- JBig2_SegmentState m_State;
- JBig2_ResultType m_nResultType;
- union {
- CJBig2_SymbolDict *sd;
- CJBig2_PatternDict *pd;
- CJBig2_Image *im;
- CJBig2_HuffmanTable *ht;
- FX_LPVOID vd;
- } m_Result;
-};
-#endif
+// 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 _JBIG2_SEGMENT_H_
+#define _JBIG2_SEGMENT_H_
+#include "JBig2_Define.h"
+#include "JBig2_SymbolDict.h"
+#include "JBig2_PatternDict.h"
+#include "JBig2_Module.h"
+#include "JBig2_HuffmanTable.h"
+#define JBIG2_GET_INT32(buf) (((buf)[0]<<24) | ((buf)[1]<<16) | ((buf)[2]<<8) | (buf)[3])
+#define JBIG2_GET_INT16(buf) (((buf)[0]<<8) | (buf)[1])
+typedef enum {
+ JBIG2_SEGMENT_HEADER_UNPARSED,
+ JBIG2_SEGMENT_DATA_UNPARSED,
+ JBIG2_SEGMENT_PARSE_COMPLETE,
+ JBIG2_SEGMENT_PAUSED,
+ JBIG2_SEGMENT_ERROR
+} JBig2_SegmentState;
+typedef enum {
+ JBIG2_VOID_POINTER = 0,
+ JBIG2_IMAGE_POINTER,
+ JBIG2_SYMBOL_DICT_POINTER,
+ JBIG2_PATTERN_DICT_POINTER,
+ JBIG2_HUFFMAN_TABLE_POINTER
+} JBig2_ResultType;
+class CJBig2_Segment : public CJBig2_Object
+{
+public:
+
+ CJBig2_Segment();
+
+ ~CJBig2_Segment();
+
+ void init();
+
+ void clean();
+public:
+ FX_DWORD m_dwNumber;
+ union {
+ struct {
+ FX_BYTE type : 6;
+ FX_BYTE page_association_size : 1;
+ FX_BYTE deferred_non_retain : 1;
+ } s;
+ FX_BYTE c;
+ } m_cFlags;
+ FX_INT32 m_nReferred_to_segment_count;
+ FX_DWORD * m_pReferred_to_segment_numbers;
+ FX_DWORD m_dwPage_association;
+ FX_DWORD m_dwData_length;
+
+ FX_DWORD m_dwHeader_Length;
+ FX_BYTE *m_pData;
+ JBig2_SegmentState m_State;
+ JBig2_ResultType m_nResultType;
+ union {
+ CJBig2_SymbolDict *sd;
+ CJBig2_PatternDict *pd;
+ CJBig2_Image *im;
+ CJBig2_HuffmanTable *ht;
+ FX_LPVOID vd;
+ } m_Result;
+};
+#endif
diff --git a/core/src/fxcodec/jbig2/JBig2_SymbolDict.cpp b/core/src/fxcodec/jbig2/JBig2_SymbolDict.cpp
index 8516c045c6..67e54c0cea 100644
--- a/core/src/fxcodec/jbig2/JBig2_SymbolDict.cpp
+++ b/core/src/fxcodec/jbig2/JBig2_SymbolDict.cpp
@@ -1,34 +1,34 @@
-// 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
-
-#include "JBig2_SymbolDict.h"
-CJBig2_SymbolDict::CJBig2_SymbolDict()
-{
- SDNUMEXSYMS = 0;
- SDEXSYMS = NULL;
- m_bContextRetained = FALSE;
- m_gbContext = m_grContext = NULL;
-}
-
-CJBig2_SymbolDict::~CJBig2_SymbolDict()
-{
- if(SDEXSYMS) {
- for(FX_DWORD i = 0; i < SDNUMEXSYMS; i++) {
- if(SDEXSYMS[i]) {
- delete SDEXSYMS[i];
- }
- }
- m_pModule->JBig2_Free(SDEXSYMS);
- }
- if(m_bContextRetained) {
- if(m_gbContext) {
- m_pModule->JBig2_Free(m_gbContext);
- }
- if(m_grContext) {
- m_pModule->JBig2_Free(m_grContext);
- }
- }
-}
+// 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
+
+#include "JBig2_SymbolDict.h"
+CJBig2_SymbolDict::CJBig2_SymbolDict()
+{
+ SDNUMEXSYMS = 0;
+ SDEXSYMS = NULL;
+ m_bContextRetained = FALSE;
+ m_gbContext = m_grContext = NULL;
+}
+
+CJBig2_SymbolDict::~CJBig2_SymbolDict()
+{
+ if(SDEXSYMS) {
+ for(FX_DWORD i = 0; i < SDNUMEXSYMS; i++) {
+ if(SDEXSYMS[i]) {
+ delete SDEXSYMS[i];
+ }
+ }
+ m_pModule->JBig2_Free(SDEXSYMS);
+ }
+ if(m_bContextRetained) {
+ if(m_gbContext) {
+ m_pModule->JBig2_Free(m_gbContext);
+ }
+ if(m_grContext) {
+ m_pModule->JBig2_Free(m_grContext);
+ }
+ }
+}
diff --git a/core/src/fxcodec/jbig2/JBig2_SymbolDict.h b/core/src/fxcodec/jbig2/JBig2_SymbolDict.h
index cb97a167d1..cfe75db4c9 100644
--- a/core/src/fxcodec/jbig2/JBig2_SymbolDict.h
+++ b/core/src/fxcodec/jbig2/JBig2_SymbolDict.h
@@ -1,26 +1,26 @@
-// 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 _JBIG2_SYMBOL_DICT_H_
-#define _JBIG2_SYMBOL_DICT_H_
-#include "JBig2_Define.h"
-#include "JBig2_ArithDecoder.h"
-#include "JBig2_Image.h"
-class CJBig2_SymbolDict : public CJBig2_Object
-{
-public:
-
- CJBig2_SymbolDict();
-
- ~CJBig2_SymbolDict();
-public:
- FX_DWORD SDNUMEXSYMS;
- CJBig2_Image **SDEXSYMS;
- FX_BOOL m_bContextRetained;
- JBig2ArithCtx *m_gbContext,
- *m_grContext;
-};
-#endif
+// 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 _JBIG2_SYMBOL_DICT_H_
+#define _JBIG2_SYMBOL_DICT_H_
+#include "JBig2_Define.h"
+#include "JBig2_ArithDecoder.h"
+#include "JBig2_Image.h"
+class CJBig2_SymbolDict : public CJBig2_Object
+{
+public:
+
+ CJBig2_SymbolDict();
+
+ ~CJBig2_SymbolDict();
+public:
+ FX_DWORD SDNUMEXSYMS;
+ CJBig2_Image **SDEXSYMS;
+ FX_BOOL m_bContextRetained;
+ JBig2ArithCtx *m_gbContext,
+ *m_grContext;
+};
+#endif
diff --git a/core/src/fxcodec/lcms2/include/fx_lcms2.h b/core/src/fxcodec/lcms2/include/fx_lcms2.h
index 53038322d3..e6413188d8 100644
--- a/core/src/fxcodec/lcms2/include/fx_lcms2.h
+++ b/core/src/fxcodec/lcms2/include/fx_lcms2.h
@@ -1,10 +1,10 @@
-// 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 _FX_LCMS2_H_
-#define _FX_LCMS2_H_
-#include "../lcms2-2.6/include/lcms2.h"
-#endif
+// 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 _FX_LCMS2_H_
+#define _FX_LCMS2_H_
+#include "../lcms2-2.6/include/lcms2.h"
+#endif
diff --git a/core/src/fxcodec/lcms2/include/fx_lcms2_plugin.h b/core/src/fxcodec/lcms2/include/fx_lcms2_plugin.h
index 1103b7f698..4ab5775718 100644
--- a/core/src/fxcodec/lcms2/include/fx_lcms2_plugin.h
+++ b/core/src/fxcodec/lcms2/include/fx_lcms2_plugin.h
@@ -1,10 +1,10 @@
-// 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 _FX_LCMS2_H_
-#define _FX_LCMS2_H_
-#include "../lcms2-2.6/include/lcms2_plugin.h"
-#endif
+// 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 _FX_LCMS2_H_
+#define _FX_LCMS2_H_
+#include "../lcms2-2.6/include/lcms2_plugin.h"
+#endif
diff --git a/core/src/fxcodec/lcms2/lcms2-2.6/src/cmserr.c b/core/src/fxcodec/lcms2/lcms2-2.6/src/cmserr.c
index 745238c6e2..87c6320cff 100644
--- a/core/src/fxcodec/lcms2/lcms2-2.6/src/cmserr.c
+++ b/core/src/fxcodec/lcms2/lcms2-2.6/src/cmserr.c
@@ -260,50 +260,50 @@ cmsBool _cmsRegisterMemHandlerPlugin(cmsContext ContextID, cmsPluginBase* Plugi
}
// Generic allocate
-void* CMSEXPORT _cmsMalloc(cmsContext ContextID, cmsUInt32Number size)
-{
- return FXMEM_DefaultAlloc(size, FXMEM_NONLEAVE);
-}
-
-// Generic allocate & zero
-void* CMSEXPORT _cmsMallocZero(cmsContext ContextID, cmsUInt32Number size)
-{
- void* p = FXMEM_DefaultAlloc(size, FXMEM_NONLEAVE);
- if (p) FXSYS_memset32(p, 0, size);
- return p;
-}
-
-// Generic calloc
-void* CMSEXPORT _cmsCalloc(cmsContext ContextID, cmsUInt32Number num, cmsUInt32Number size)
-{
- cmsUInt32Number total = num * size;
- if (total == 0 || total / size != num || total >= 512 * 1024 * 1024)
- return NULL;
-
- return _cmsMallocZero(ContextID, num * size);
-}
-
-// Generic reallocate
-void* CMSEXPORT _cmsRealloc(cmsContext ContextID, void* Ptr, cmsUInt32Number size)
-{
- return FXMEM_DefaultRealloc(Ptr, size, FXMEM_NONLEAVE);
-}
-
-// Generic free memory
-void CMSEXPORT _cmsFree(cmsContext ContextID, void* Ptr)
-{
- if (Ptr != NULL) FXMEM_DefaultFree(Ptr, 0);
-}
-
-// Generic block duplication
-void* CMSEXPORT _cmsDupMem(cmsContext ContextID, const void* Org, cmsUInt32Number size)
-{
- void* p = FXMEM_DefaultAlloc(size, FXMEM_NONLEAVE);
- FXSYS_memmove32(p, Org, size);
- return p;
-}
-
-_cmsMemPluginChunkType _cmsMemPluginChunk = {_cmsMalloc, _cmsMallocZero, _cmsFree,
+void* CMSEXPORT _cmsMalloc(cmsContext ContextID, cmsUInt32Number size)
+{
+ return FXMEM_DefaultAlloc(size, FXMEM_NONLEAVE);
+}
+
+// Generic allocate & zero
+void* CMSEXPORT _cmsMallocZero(cmsContext ContextID, cmsUInt32Number size)
+{
+ void* p = FXMEM_DefaultAlloc(size, FXMEM_NONLEAVE);
+ if (p) FXSYS_memset32(p, 0, size);
+ return p;
+}
+
+// Generic calloc
+void* CMSEXPORT _cmsCalloc(cmsContext ContextID, cmsUInt32Number num, cmsUInt32Number size)
+{
+ cmsUInt32Number total = num * size;
+ if (total == 0 || total / size != num || total >= 512 * 1024 * 1024)
+ return NULL;
+
+ return _cmsMallocZero(ContextID, num * size);
+}
+
+// Generic reallocate
+void* CMSEXPORT _cmsRealloc(cmsContext ContextID, void* Ptr, cmsUInt32Number size)
+{
+ return FXMEM_DefaultRealloc(Ptr, size, FXMEM_NONLEAVE);
+}
+
+// Generic free memory
+void CMSEXPORT _cmsFree(cmsContext ContextID, void* Ptr)
+{
+ if (Ptr != NULL) FXMEM_DefaultFree(Ptr, 0);
+}
+
+// Generic block duplication
+void* CMSEXPORT _cmsDupMem(cmsContext ContextID, const void* Org, cmsUInt32Number size)
+{
+ void* p = FXMEM_DefaultAlloc(size, FXMEM_NONLEAVE);
+ FXSYS_memmove32(p, Org, size);
+ return p;
+}
+
+_cmsMemPluginChunkType _cmsMemPluginChunk = {_cmsMalloc, _cmsMallocZero, _cmsFree,
_cmsRealloc, _cmsCalloc, _cmsDupMem
};
diff --git a/core/src/fxcodec/lcms2/lcms2-2.6/src/cmsgmt.c b/core/src/fxcodec/lcms2/lcms2-2.6/src/cmsgmt.c
index 09427650c9..1103363a78 100644
--- a/core/src/fxcodec/lcms2/lcms2-2.6/src/cmsgmt.c
+++ b/core/src/fxcodec/lcms2/lcms2-2.6/src/cmsgmt.c
@@ -1,590 +1,590 @@
-//---------------------------------------------------------------------------------
-//
-// Little Color Management System
-// Copyright (c) 1998-2012 Marti Maria Saguer
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the "Software"),
-// to deal in the Software without restriction, including without limitation
-// the rights to use, copy, modify, merge, publish, distribute, sublicense,
-// and/or sell copies of the Software, and to permit persons to whom the Software
-// is furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
-// THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-//---------------------------------------------------------------------------------
-//
-
-#include "lcms2_internal.h"
-
-
-// Auxiliar: append a Lab identity after the given sequence of profiles
-// and return the transform. Lab profile is closed, rest of profiles are kept open.
-cmsHTRANSFORM _cmsChain2Lab(cmsContext ContextID,
- cmsUInt32Number nProfiles,
- cmsUInt32Number InputFormat,
- cmsUInt32Number OutputFormat,
- const cmsUInt32Number Intents[],
- const cmsHPROFILE hProfiles[],
- const cmsBool BPC[],
- const cmsFloat64Number AdaptationStates[],
- cmsUInt32Number dwFlags)
-{
- cmsHTRANSFORM xform;
- cmsHPROFILE hLab;
- cmsHPROFILE ProfileList[256];
- cmsBool BPCList[256];
- cmsFloat64Number AdaptationList[256];
- cmsUInt32Number IntentList[256];
- cmsUInt32Number i;
-
- // This is a rather big number and there is no need of dynamic memory
- // since we are adding a profile, 254 + 1 = 255 and this is the limit
- if (nProfiles > 254) return NULL;
-
- // The output space
- hLab = cmsCreateLab4ProfileTHR(ContextID, NULL);
- if (hLab == NULL) return NULL;
-
- // Create a copy of parameters
- for (i=0; i < nProfiles; i++) {
-
- ProfileList[i] = hProfiles[i];
- BPCList[i] = BPC[i];
- AdaptationList[i] = AdaptationStates[i];
- IntentList[i] = Intents[i];
- }
-
- // Place Lab identity at chain's end.
- ProfileList[nProfiles] = hLab;
- BPCList[nProfiles] = 0;
- AdaptationList[nProfiles] = 1.0;
- IntentList[nProfiles] = INTENT_RELATIVE_COLORIMETRIC;
-
- // Create the transform
- xform = cmsCreateExtendedTransform(ContextID, nProfiles + 1, ProfileList,
- BPCList,
- IntentList,
- AdaptationList,
- NULL, 0,
- InputFormat,
- OutputFormat,
- dwFlags);
-
- cmsCloseProfile(hLab);
-
- return xform;
-}
-
-
-// Compute K -> L* relationship. Flags may include black point compensation. In this case,
-// the relationship is assumed from the profile with BPC to a black point zero.
-static
-cmsToneCurve* ComputeKToLstar(cmsContext ContextID,
- cmsUInt32Number nPoints,
- cmsUInt32Number nProfiles,
- const cmsUInt32Number Intents[],
- const cmsHPROFILE hProfiles[],
- const cmsBool BPC[],
- const cmsFloat64Number AdaptationStates[],
- cmsUInt32Number dwFlags)
-{
- cmsToneCurve* out = NULL;
- cmsUInt32Number i;
- cmsHTRANSFORM xform;
- cmsCIELab Lab;
- cmsFloat32Number cmyk[4];
- cmsFloat32Number* SampledPoints;
-
- xform = _cmsChain2Lab(ContextID, nProfiles, TYPE_CMYK_FLT, TYPE_Lab_DBL, Intents, hProfiles, BPC, AdaptationStates, dwFlags);
- if (xform == NULL) return NULL;
-
- SampledPoints = (cmsFloat32Number*) _cmsCalloc(ContextID, nPoints, sizeof(cmsFloat32Number));
- if (SampledPoints == NULL) goto Error;
-
- for (i=0; i < nPoints; i++) {
-
- cmyk[0] = 0;
- cmyk[1] = 0;
- cmyk[2] = 0;
- cmyk[3] = (cmsFloat32Number) ((i * 100.0) / (nPoints-1));
-
- cmsDoTransform(xform, cmyk, &Lab, 1);
- SampledPoints[i]= (cmsFloat32Number) (1.0 - Lab.L / 100.0); // Negate K for easier operation
- }
-
- out = cmsBuildTabulatedToneCurveFloat(ContextID, nPoints, SampledPoints);
-
-Error:
-
- cmsDeleteTransform(xform);
- if (SampledPoints) _cmsFree(ContextID, SampledPoints);
-
- return out;
-}
-
-
-// Compute Black tone curve on a CMYK -> CMYK transform. This is done by
-// using the proof direction on both profiles to find K->L* relationship
-// then joining both curves. dwFlags may include black point compensation.
-cmsToneCurve* _cmsBuildKToneCurve(cmsContext ContextID,
- cmsUInt32Number nPoints,
- cmsUInt32Number nProfiles,
- const cmsUInt32Number Intents[],
- const cmsHPROFILE hProfiles[],
- const cmsBool BPC[],
- const cmsFloat64Number AdaptationStates[],
- cmsUInt32Number dwFlags)
-{
- cmsToneCurve *in, *out, *KTone;
-
- // Make sure CMYK -> CMYK
- if (cmsGetColorSpace(hProfiles[0]) != cmsSigCmykData ||
- cmsGetColorSpace(hProfiles[nProfiles-1])!= cmsSigCmykData) return NULL;
-
-
- // Make sure last is an output profile
- if (cmsGetDeviceClass(hProfiles[nProfiles - 1]) != cmsSigOutputClass) return NULL;
-
- // Create individual curves. BPC works also as each K to L* is
- // computed as a BPC to zero black point in case of L*
- in = ComputeKToLstar(ContextID, nPoints, nProfiles - 1, Intents, hProfiles, BPC, AdaptationStates, dwFlags);
- if (in == NULL) return NULL;
-
- out = ComputeKToLstar(ContextID, nPoints, 1,
- Intents + (nProfiles - 1),
- &hProfiles [nProfiles - 1],
- BPC + (nProfiles - 1),
- AdaptationStates + (nProfiles - 1),
- dwFlags);
- if (out == NULL) {
- cmsFreeToneCurve(in);
- return NULL;
- }
-
- // Build the relationship. This effectively limits the maximum accuracy to 16 bits, but
- // since this is used on black-preserving LUTs, we are not loosing accuracy in any case
- KTone = cmsJoinToneCurve(ContextID, in, out, nPoints);
-
- // Get rid of components
- cmsFreeToneCurve(in); cmsFreeToneCurve(out);
-
- // Something went wrong...
- if (KTone == NULL) return NULL;
-
- // Make sure it is monotonic
- if (!cmsIsToneCurveMonotonic(KTone)) {
- cmsFreeToneCurve(KTone);
- return NULL;
- }
-
- return KTone;
-}
-
-
-// Gamut LUT Creation -----------------------------------------------------------------------------------------
-
-// Used by gamut & softproofing
-
-typedef struct {
-
- cmsHTRANSFORM hInput; // From whatever input color space. 16 bits to DBL
- cmsHTRANSFORM hForward, hReverse; // Transforms going from Lab to colorant and back
- cmsFloat64Number Thereshold; // The thereshold after which is considered out of gamut
-
- } GAMUTCHAIN;
-
-// This sampler does compute gamut boundaries by comparing original
-// values with a transform going back and forth. Values above ERR_THERESHOLD
-// of maximum are considered out of gamut.
-
-#define ERR_THERESHOLD 5
-
-
-static
-int GamutSampler(register const cmsUInt16Number In[], register cmsUInt16Number Out[], register void* Cargo)
-{
- GAMUTCHAIN* t = (GAMUTCHAIN* ) Cargo;
- cmsCIELab LabIn1, LabOut1;
- cmsCIELab LabIn2, LabOut2;
- cmsUInt16Number Proof[cmsMAXCHANNELS], Proof2[cmsMAXCHANNELS];
- cmsFloat64Number dE1, dE2, ErrorRatio;
-
- // Assume in-gamut by default.
- ErrorRatio = 1.0;
-
- // Convert input to Lab
- cmsDoTransform(t -> hInput, In, &LabIn1, 1);
-
- // converts from PCS to colorant. This always
- // does return in-gamut values,
- cmsDoTransform(t -> hForward, &LabIn1, Proof, 1);
-
- // Now, do the inverse, from colorant to PCS.
- cmsDoTransform(t -> hReverse, Proof, &LabOut1, 1);
-
- memmove(&LabIn2, &LabOut1, sizeof(cmsCIELab));
-
- // Try again, but this time taking Check as input
- cmsDoTransform(t -> hForward, &LabOut1, Proof2, 1);
- cmsDoTransform(t -> hReverse, Proof2, &LabOut2, 1);
-
- // Take difference of direct value
- dE1 = cmsDeltaE(&LabIn1, &LabOut1);
-
- // Take difference of converted value
- dE2 = cmsDeltaE(&LabIn2, &LabOut2);
-
-
- // if dE1 is small and dE2 is small, value is likely to be in gamut
- if (dE1 < t->Thereshold && dE2 < t->Thereshold)
- Out[0] = 0;
- else {
-
- // if dE1 is small and dE2 is big, undefined. Assume in gamut
- if (dE1 < t->Thereshold && dE2 > t->Thereshold)
- Out[0] = 0;
- else
- // dE1 is big and dE2 is small, clearly out of gamut
- if (dE1 > t->Thereshold && dE2 < t->Thereshold)
- Out[0] = (cmsUInt16Number) _cmsQuickFloor((dE1 - t->Thereshold) + .5);
- else {
-
- // dE1 is big and dE2 is also big, could be due to perceptual mapping
- // so take error ratio
- if (dE2 == 0.0)
- ErrorRatio = dE1;
- else
- ErrorRatio = dE1 / dE2;
-
- if (ErrorRatio > t->Thereshold)
- Out[0] = (cmsUInt16Number) _cmsQuickFloor((ErrorRatio - t->Thereshold) + .5);
- else
- Out[0] = 0;
- }
- }
-
-
- return TRUE;
-}
-
-// Does compute a gamut LUT going back and forth across pcs -> relativ. colorimetric intent -> pcs
-// the dE obtained is then annotated on the LUT. Values truely out of gamut are clipped to dE = 0xFFFE
-// and values changed are supposed to be handled by any gamut remapping, so, are out of gamut as well.
-//
-// **WARNING: This algorithm does assume that gamut remapping algorithms does NOT move in-gamut colors,
-// of course, many perceptual and saturation intents does not work in such way, but relativ. ones should.
-
-cmsPipeline* _cmsCreateGamutCheckPipeline(cmsContext ContextID,
- cmsHPROFILE hProfiles[],
- cmsBool BPC[],
- cmsUInt32Number Intents[],
- cmsFloat64Number AdaptationStates[],
- cmsUInt32Number nGamutPCSposition,
- cmsHPROFILE hGamut)
-{
- cmsHPROFILE hLab;
- cmsPipeline* Gamut;
- cmsStage* CLUT;
- cmsUInt32Number dwFormat;
- GAMUTCHAIN Chain;
- int nChannels, nGridpoints;
- cmsColorSpaceSignature ColorSpace;
- cmsUInt32Number i;
- cmsHPROFILE ProfileList[256];
- cmsBool BPCList[256];
- cmsFloat64Number AdaptationList[256];
- cmsUInt32Number IntentList[256];
-
- memset(&Chain, 0, sizeof(GAMUTCHAIN));
-
-
- if (nGamutPCSposition <= 0 || nGamutPCSposition > 255) {
- cmsSignalError(ContextID, cmsERROR_RANGE, "Wrong position of PCS. 1..255 expected, %d found.", nGamutPCSposition);
- return NULL;
- }
-
- hLab = cmsCreateLab4ProfileTHR(ContextID, NULL);
- if (hLab == NULL) return NULL;
-
-
- // The figure of merit. On matrix-shaper profiles, should be almost zero as
- // the conversion is pretty exact. On LUT based profiles, different resolutions
- // of input and output CLUT may result in differences.
-
- if (cmsIsMatrixShaper(hGamut)) {
-
- Chain.Thereshold = 1.0;
- }
- else {
- Chain.Thereshold = ERR_THERESHOLD;
- }
-
-
- // Create a copy of parameters
- for (i=0; i < nGamutPCSposition; i++) {
- ProfileList[i] = hProfiles[i];
- BPCList[i] = BPC[i];
- AdaptationList[i] = AdaptationStates[i];
- IntentList[i] = Intents[i];
- }
-
- // Fill Lab identity
- ProfileList[nGamutPCSposition] = hLab;
- BPCList[nGamutPCSposition] = 0;
- AdaptationList[nGamutPCSposition] = 1.0;
- IntentList[nGamutPCSposition] = INTENT_RELATIVE_COLORIMETRIC;
-
-
- ColorSpace = cmsGetColorSpace(hGamut);
-
- nChannels = cmsChannelsOf(ColorSpace);
- nGridpoints = _cmsReasonableGridpointsByColorspace(ColorSpace, cmsFLAGS_HIGHRESPRECALC);
- dwFormat = (CHANNELS_SH(nChannels)|BYTES_SH(2));
-
- // 16 bits to Lab double
- Chain.hInput = cmsCreateExtendedTransform(ContextID,
- nGamutPCSposition + 1,
- ProfileList,
- BPCList,
- IntentList,
- AdaptationList,
- NULL, 0,
- dwFormat, TYPE_Lab_DBL,
- cmsFLAGS_NOCACHE);
-
-
- // Does create the forward step. Lab double to device
- dwFormat = (CHANNELS_SH(nChannels)|BYTES_SH(2));
- Chain.hForward = cmsCreateTransformTHR(ContextID,
- hLab, TYPE_Lab_DBL,
- hGamut, dwFormat,
- INTENT_RELATIVE_COLORIMETRIC,
- cmsFLAGS_NOCACHE);
-
- // Does create the backwards step
- Chain.hReverse = cmsCreateTransformTHR(ContextID, hGamut, dwFormat,
- hLab, TYPE_Lab_DBL,
- INTENT_RELATIVE_COLORIMETRIC,
- cmsFLAGS_NOCACHE);
-
-
- // All ok?
- if (Chain.hInput && Chain.hForward && Chain.hReverse) {
-
- // Go on, try to compute gamut LUT from PCS. This consist on a single channel containing
- // dE when doing a transform back and forth on the colorimetric intent.
-
- Gamut = cmsPipelineAlloc(ContextID, 3, 1);
- if (Gamut != NULL) {
-
- CLUT = cmsStageAllocCLut16bit(ContextID, nGridpoints, nChannels, 1, NULL);
- if (!cmsPipelineInsertStage(Gamut, cmsAT_BEGIN, CLUT)) {
- cmsPipelineFree(Gamut);
- Gamut = NULL;
- }
- else {
- cmsStageSampleCLut16bit(CLUT, GamutSampler, (void*) &Chain, 0);
- }
- }
- }
- else
- Gamut = NULL; // Didn't work...
-
- // Free all needed stuff.
- if (Chain.hInput) cmsDeleteTransform(Chain.hInput);
- if (Chain.hForward) cmsDeleteTransform(Chain.hForward);
- if (Chain.hReverse) cmsDeleteTransform(Chain.hReverse);
- if (hLab) cmsCloseProfile(hLab);
-
- // And return computed hull
- return Gamut;
-}
-
-// Total Area Coverage estimation ----------------------------------------------------------------
-
-typedef struct {
- cmsUInt32Number nOutputChans;
- cmsHTRANSFORM hRoundTrip;
- cmsFloat32Number MaxTAC;
- cmsFloat32Number MaxInput[cmsMAXCHANNELS];
-
-} cmsTACestimator;
-
-
-// This callback just accounts the maximum ink dropped in the given node. It does not populate any
-// memory, as the destination table is NULL. Its only purpose it to know the global maximum.
-static
-int EstimateTAC(register const cmsUInt16Number In[], register cmsUInt16Number Out[], register void * Cargo)
-{
- cmsTACestimator* bp = (cmsTACestimator*) Cargo;
- cmsFloat32Number RoundTrip[cmsMAXCHANNELS];
- cmsUInt32Number i;
- cmsFloat32Number Sum;
-
-
- // Evaluate the xform
- cmsDoTransform(bp->hRoundTrip, In, RoundTrip, 1);
-
- // All all amounts of ink
- for (Sum=0, i=0; i < bp ->nOutputChans; i++)
- Sum += RoundTrip[i];
-
- // If above maximum, keep track of input values
- if (Sum > bp ->MaxTAC) {
-
- bp ->MaxTAC = Sum;
-
- for (i=0; i < bp ->nOutputChans; i++) {
- bp ->MaxInput[i] = In[i];
- }
- }
-
- return TRUE;
-
- cmsUNUSED_PARAMETER(Out);
-}
-
-
-// Detect Total area coverage of the profile
-cmsFloat64Number CMSEXPORT cmsDetectTAC(cmsHPROFILE hProfile)
-{
- cmsTACestimator bp;
- cmsUInt32Number dwFormatter;
- cmsUInt32Number GridPoints[MAX_INPUT_DIMENSIONS];
- cmsHPROFILE hLab;
- cmsContext ContextID = cmsGetProfileContextID(hProfile);
-
- // TAC only works on output profiles
- if (cmsGetDeviceClass(hProfile) != cmsSigOutputClass) {
- return 0;
- }
-
- // Create a fake formatter for result
- dwFormatter = cmsFormatterForColorspaceOfProfile(hProfile, 4, TRUE);
-
- bp.nOutputChans = T_CHANNELS(dwFormatter);
- bp.MaxTAC = 0; // Initial TAC is 0
-
- // for safety
- if (bp.nOutputChans >= cmsMAXCHANNELS) return 0;
-
- hLab = cmsCreateLab4ProfileTHR(ContextID, NULL);
- if (hLab == NULL) return 0;
- // Setup a roundtrip on perceptual intent in output profile for TAC estimation
- bp.hRoundTrip = cmsCreateTransformTHR(ContextID, hLab, TYPE_Lab_16,
- hProfile, dwFormatter, INTENT_PERCEPTUAL, cmsFLAGS_NOOPTIMIZE|cmsFLAGS_NOCACHE);
-
- cmsCloseProfile(hLab);
- if (bp.hRoundTrip == NULL) return 0;
-
- // For L* we only need black and white. For C* we need many points
- GridPoints[0] = 6;
- GridPoints[1] = 74;
- GridPoints[2] = 74;
-
-
- if (!cmsSliceSpace16(3, GridPoints, EstimateTAC, &bp)) {
- bp.MaxTAC = 0;
- }
-
- cmsDeleteTransform(bp.hRoundTrip);
-
- // Results in %
- return bp.MaxTAC;
-}
-
-
-// Carefully, clamp on CIELab space.
-
-cmsBool CMSEXPORT cmsDesaturateLab(cmsCIELab* Lab,
- double amax, double amin,
- double bmax, double bmin)
-{
-
- // Whole Luma surface to zero
-
- if (Lab -> L < 0) {
-
- Lab-> L = Lab->a = Lab-> b = 0.0;
- return FALSE;
- }
-
- // Clamp white, DISCARD HIGHLIGHTS. This is done
- // in such way because icc spec doesn't allow the
- // use of L>100 as a highlight means.
-
- if (Lab->L > 100)
- Lab -> L = 100;
-
- // Check out gamut prism, on a, b faces
-
- if (Lab -> a < amin || Lab->a > amax||
- Lab -> b < bmin || Lab->b > bmax) {
-
- cmsCIELCh LCh;
- double h, slope;
-
- // Falls outside a, b limits. Transports to LCh space,
- // and then do the clipping
-
-
- if (Lab -> a == 0.0) { // Is hue exactly 90?
-
- // atan will not work, so clamp here
- Lab -> b = Lab->b < 0 ? bmin : bmax;
- return TRUE;
- }
-
- cmsLab2LCh(&LCh, Lab);
-
- slope = Lab -> b / Lab -> a;
- h = LCh.h;
-
- // There are 4 zones
-
- if ((h >= 0. && h < 45.) ||
- (h >= 315 && h <= 360.)) {
-
- // clip by amax
- Lab -> a = amax;
- Lab -> b = amax * slope;
- }
- else
- if (h >= 45. && h < 135.)
- {
- // clip by bmax
- Lab -> b = bmax;
- Lab -> a = bmax / slope;
- }
- else
- if (h >= 135. && h < 225.) {
- // clip by amin
- Lab -> a = amin;
- Lab -> b = amin * slope;
-
- }
- else
- if (h >= 225. && h < 315.) {
- // clip by bmin
- Lab -> b = bmin;
- Lab -> a = bmin / slope;
- }
- else {
- cmsSignalError(0, cmsERROR_RANGE, "Invalid angle");
- return FALSE;
- }
-
- }
-
- return TRUE;
-}
+//---------------------------------------------------------------------------------
+//
+// Little Color Management System
+// Copyright (c) 1998-2012 Marti Maria Saguer
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the "Software"),
+// to deal in the Software without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Software, and to permit persons to whom the Software
+// is furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
+// THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+//---------------------------------------------------------------------------------
+//
+
+#include "lcms2_internal.h"
+
+
+// Auxiliar: append a Lab identity after the given sequence of profiles
+// and return the transform. Lab profile is closed, rest of profiles are kept open.
+cmsHTRANSFORM _cmsChain2Lab(cmsContext ContextID,
+ cmsUInt32Number nProfiles,
+ cmsUInt32Number InputFormat,
+ cmsUInt32Number OutputFormat,
+ const cmsUInt32Number Intents[],
+ const cmsHPROFILE hProfiles[],
+ const cmsBool BPC[],
+ const cmsFloat64Number AdaptationStates[],
+ cmsUInt32Number dwFlags)
+{
+ cmsHTRANSFORM xform;
+ cmsHPROFILE hLab;
+ cmsHPROFILE ProfileList[256];
+ cmsBool BPCList[256];
+ cmsFloat64Number AdaptationList[256];
+ cmsUInt32Number IntentList[256];
+ cmsUInt32Number i;
+
+ // This is a rather big number and there is no need of dynamic memory
+ // since we are adding a profile, 254 + 1 = 255 and this is the limit
+ if (nProfiles > 254) return NULL;
+
+ // The output space
+ hLab = cmsCreateLab4ProfileTHR(ContextID, NULL);
+ if (hLab == NULL) return NULL;
+
+ // Create a copy of parameters
+ for (i=0; i < nProfiles; i++) {
+
+ ProfileList[i] = hProfiles[i];
+ BPCList[i] = BPC[i];
+ AdaptationList[i] = AdaptationStates[i];
+ IntentList[i] = Intents[i];
+ }
+
+ // Place Lab identity at chain's end.
+ ProfileList[nProfiles] = hLab;
+ BPCList[nProfiles] = 0;
+ AdaptationList[nProfiles] = 1.0;
+ IntentList[nProfiles] = INTENT_RELATIVE_COLORIMETRIC;
+
+ // Create the transform
+ xform = cmsCreateExtendedTransform(ContextID, nProfiles + 1, ProfileList,
+ BPCList,
+ IntentList,
+ AdaptationList,
+ NULL, 0,
+ InputFormat,
+ OutputFormat,
+ dwFlags);
+
+ cmsCloseProfile(hLab);
+
+ return xform;
+}
+
+
+// Compute K -> L* relationship. Flags may include black point compensation. In this case,
+// the relationship is assumed from the profile with BPC to a black point zero.
+static
+cmsToneCurve* ComputeKToLstar(cmsContext ContextID,
+ cmsUInt32Number nPoints,
+ cmsUInt32Number nProfiles,
+ const cmsUInt32Number Intents[],
+ const cmsHPROFILE hProfiles[],
+ const cmsBool BPC[],
+ const cmsFloat64Number AdaptationStates[],
+ cmsUInt32Number dwFlags)
+{
+ cmsToneCurve* out = NULL;
+ cmsUInt32Number i;
+ cmsHTRANSFORM xform;
+ cmsCIELab Lab;
+ cmsFloat32Number cmyk[4];
+ cmsFloat32Number* SampledPoints;
+
+ xform = _cmsChain2Lab(ContextID, nProfiles, TYPE_CMYK_FLT, TYPE_Lab_DBL, Intents, hProfiles, BPC, AdaptationStates, dwFlags);
+ if (xform == NULL) return NULL;
+
+ SampledPoints = (cmsFloat32Number*) _cmsCalloc(ContextID, nPoints, sizeof(cmsFloat32Number));
+ if (SampledPoints == NULL) goto Error;
+
+ for (i=0; i < nPoints; i++) {
+
+ cmyk[0] = 0;
+ cmyk[1] = 0;
+ cmyk[2] = 0;
+ cmyk[3] = (cmsFloat32Number) ((i * 100.0) / (nPoints-1));
+
+ cmsDoTransform(xform, cmyk, &Lab, 1);
+ SampledPoints[i]= (cmsFloat32Number) (1.0 - Lab.L / 100.0); // Negate K for easier operation
+ }
+
+ out = cmsBuildTabulatedToneCurveFloat(ContextID, nPoints, SampledPoints);
+
+Error:
+
+ cmsDeleteTransform(xform);
+ if (SampledPoints) _cmsFree(ContextID, SampledPoints);
+
+ return out;
+}
+
+
+// Compute Black tone curve on a CMYK -> CMYK transform. This is done by
+// using the proof direction on both profiles to find K->L* relationship
+// then joining both curves. dwFlags may include black point compensation.
+cmsToneCurve* _cmsBuildKToneCurve(cmsContext ContextID,
+ cmsUInt32Number nPoints,
+ cmsUInt32Number nProfiles,
+ const cmsUInt32Number Intents[],
+ const cmsHPROFILE hProfiles[],
+ const cmsBool BPC[],
+ const cmsFloat64Number AdaptationStates[],
+ cmsUInt32Number dwFlags)
+{
+ cmsToneCurve *in, *out, *KTone;
+
+ // Make sure CMYK -> CMYK
+ if (cmsGetColorSpace(hProfiles[0]) != cmsSigCmykData ||
+ cmsGetColorSpace(hProfiles[nProfiles-1])!= cmsSigCmykData) return NULL;
+
+
+ // Make sure last is an output profile
+ if (cmsGetDeviceClass(hProfiles[nProfiles - 1]) != cmsSigOutputClass) return NULL;
+
+ // Create individual curves. BPC works also as each K to L* is
+ // computed as a BPC to zero black point in case of L*
+ in = ComputeKToLstar(ContextID, nPoints, nProfiles - 1, Intents, hProfiles, BPC, AdaptationStates, dwFlags);
+ if (in == NULL) return NULL;
+
+ out = ComputeKToLstar(ContextID, nPoints, 1,
+ Intents + (nProfiles - 1),
+ &hProfiles [nProfiles - 1],
+ BPC + (nProfiles - 1),
+ AdaptationStates + (nProfiles - 1),
+ dwFlags);
+ if (out == NULL) {
+ cmsFreeToneCurve(in);
+ return NULL;
+ }
+
+ // Build the relationship. This effectively limits the maximum accuracy to 16 bits, but
+ // since this is used on black-preserving LUTs, we are not loosing accuracy in any case
+ KTone = cmsJoinToneCurve(ContextID, in, out, nPoints);
+
+ // Get rid of components
+ cmsFreeToneCurve(in); cmsFreeToneCurve(out);
+
+ // Something went wrong...
+ if (KTone == NULL) return NULL;
+
+ // Make sure it is monotonic
+ if (!cmsIsToneCurveMonotonic(KTone)) {
+ cmsFreeToneCurve(KTone);
+ return NULL;
+ }
+
+ return KTone;
+}
+
+
+// Gamut LUT Creation -----------------------------------------------------------------------------------------
+
+// Used by gamut & softproofing
+
+typedef struct {
+
+ cmsHTRANSFORM hInput; // From whatever input color space. 16 bits to DBL
+ cmsHTRANSFORM hForward, hReverse; // Transforms going from Lab to colorant and back
+ cmsFloat64Number Thereshold; // The thereshold after which is considered out of gamut
+
+ } GAMUTCHAIN;
+
+// This sampler does compute gamut boundaries by comparing original
+// values with a transform going back and forth. Values above ERR_THERESHOLD
+// of maximum are considered out of gamut.
+
+#define ERR_THERESHOLD 5
+
+
+static
+int GamutSampler(register const cmsUInt16Number In[], register cmsUInt16Number Out[], register void* Cargo)
+{
+ GAMUTCHAIN* t = (GAMUTCHAIN* ) Cargo;
+ cmsCIELab LabIn1, LabOut1;
+ cmsCIELab LabIn2, LabOut2;
+ cmsUInt16Number Proof[cmsMAXCHANNELS], Proof2[cmsMAXCHANNELS];
+ cmsFloat64Number dE1, dE2, ErrorRatio;
+
+ // Assume in-gamut by default.
+ ErrorRatio = 1.0;
+
+ // Convert input to Lab
+ cmsDoTransform(t -> hInput, In, &LabIn1, 1);
+
+ // converts from PCS to colorant. This always
+ // does return in-gamut values,
+ cmsDoTransform(t -> hForward, &LabIn1, Proof, 1);
+
+ // Now, do the inverse, from colorant to PCS.
+ cmsDoTransform(t -> hReverse, Proof, &LabOut1, 1);
+
+ memmove(&LabIn2, &LabOut1, sizeof(cmsCIELab));
+
+ // Try again, but this time taking Check as input
+ cmsDoTransform(t -> hForward, &LabOut1, Proof2, 1);
+ cmsDoTransform(t -> hReverse, Proof2, &LabOut2, 1);
+
+ // Take difference of direct value
+ dE1 = cmsDeltaE(&LabIn1, &LabOut1);
+
+ // Take difference of converted value
+ dE2 = cmsDeltaE(&LabIn2, &LabOut2);
+
+
+ // if dE1 is small and dE2 is small, value is likely to be in gamut
+ if (dE1 < t->Thereshold && dE2 < t->Thereshold)
+ Out[0] = 0;
+ else {
+
+ // if dE1 is small and dE2 is big, undefined. Assume in gamut
+ if (dE1 < t->Thereshold && dE2 > t->Thereshold)
+ Out[0] = 0;
+ else
+ // dE1 is big and dE2 is small, clearly out of gamut
+ if (dE1 > t->Thereshold && dE2 < t->Thereshold)
+ Out[0] = (cmsUInt16Number) _cmsQuickFloor((dE1 - t->Thereshold) + .5);
+ else {
+
+ // dE1 is big and dE2 is also big, could be due to perceptual mapping
+ // so take error ratio
+ if (dE2 == 0.0)
+ ErrorRatio = dE1;
+ else
+ ErrorRatio = dE1 / dE2;
+
+ if (ErrorRatio > t->Thereshold)
+ Out[0] = (cmsUInt16Number) _cmsQuickFloor((ErrorRatio - t->Thereshold) + .5);
+ else
+ Out[0] = 0;
+ }
+ }
+
+
+ return TRUE;
+}
+
+// Does compute a gamut LUT going back and forth across pcs -> relativ. colorimetric intent -> pcs
+// the dE obtained is then annotated on the LUT. Values truely out of gamut are clipped to dE = 0xFFFE
+// and values changed are supposed to be handled by any gamut remapping, so, are out of gamut as well.
+//
+// **WARNING: This algorithm does assume that gamut remapping algorithms does NOT move in-gamut colors,
+// of course, many perceptual and saturation intents does not work in such way, but relativ. ones should.
+
+cmsPipeline* _cmsCreateGamutCheckPipeline(cmsContext ContextID,
+ cmsHPROFILE hProfiles[],
+ cmsBool BPC[],
+ cmsUInt32Number Intents[],
+ cmsFloat64Number AdaptationStates[],
+ cmsUInt32Number nGamutPCSposition,
+ cmsHPROFILE hGamut)
+{
+ cmsHPROFILE hLab;
+ cmsPipeline* Gamut;
+ cmsStage* CLUT;
+ cmsUInt32Number dwFormat;
+ GAMUTCHAIN Chain;
+ int nChannels, nGridpoints;
+ cmsColorSpaceSignature ColorSpace;
+ cmsUInt32Number i;
+ cmsHPROFILE ProfileList[256];
+ cmsBool BPCList[256];
+ cmsFloat64Number AdaptationList[256];
+ cmsUInt32Number IntentList[256];
+
+ memset(&Chain, 0, sizeof(GAMUTCHAIN));
+
+
+ if (nGamutPCSposition <= 0 || nGamutPCSposition > 255) {
+ cmsSignalError(ContextID, cmsERROR_RANGE, "Wrong position of PCS. 1..255 expected, %d found.", nGamutPCSposition);
+ return NULL;
+ }
+
+ hLab = cmsCreateLab4ProfileTHR(ContextID, NULL);
+ if (hLab == NULL) return NULL;
+
+
+ // The figure of merit. On matrix-shaper profiles, should be almost zero as
+ // the conversion is pretty exact. On LUT based profiles, different resolutions
+ // of input and output CLUT may result in differences.
+
+ if (cmsIsMatrixShaper(hGamut)) {
+
+ Chain.Thereshold = 1.0;
+ }
+ else {
+ Chain.Thereshold = ERR_THERESHOLD;
+ }
+
+
+ // Create a copy of parameters
+ for (i=0; i < nGamutPCSposition; i++) {
+ ProfileList[i] = hProfiles[i];
+ BPCList[i] = BPC[i];
+ AdaptationList[i] = AdaptationStates[i];
+ IntentList[i] = Intents[i];
+ }
+
+ // Fill Lab identity
+ ProfileList[nGamutPCSposition] = hLab;
+ BPCList[nGamutPCSposition] = 0;
+ AdaptationList[nGamutPCSposition] = 1.0;
+ IntentList[nGamutPCSposition] = INTENT_RELATIVE_COLORIMETRIC;
+
+
+ ColorSpace = cmsGetColorSpace(hGamut);
+
+ nChannels = cmsChannelsOf(ColorSpace);
+ nGridpoints = _cmsReasonableGridpointsByColorspace(ColorSpace, cmsFLAGS_HIGHRESPRECALC);
+ dwFormat = (CHANNELS_SH(nChannels)|BYTES_SH(2));
+
+ // 16 bits to Lab double
+ Chain.hInput = cmsCreateExtendedTransform(ContextID,
+ nGamutPCSposition + 1,
+ ProfileList,
+ BPCList,
+ IntentList,
+ AdaptationList,
+ NULL, 0,
+ dwFormat, TYPE_Lab_DBL,
+ cmsFLAGS_NOCACHE);
+
+
+ // Does create the forward step. Lab double to device
+ dwFormat = (CHANNELS_SH(nChannels)|BYTES_SH(2));
+ Chain.hForward = cmsCreateTransformTHR(ContextID,
+ hLab, TYPE_Lab_DBL,
+ hGamut, dwFormat,
+ INTENT_RELATIVE_COLORIMETRIC,
+ cmsFLAGS_NOCACHE);
+
+ // Does create the backwards step
+ Chain.hReverse = cmsCreateTransformTHR(ContextID, hGamut, dwFormat,
+ hLab, TYPE_Lab_DBL,
+ INTENT_RELATIVE_COLORIMETRIC,
+ cmsFLAGS_NOCACHE);
+
+
+ // All ok?
+ if (Chain.hInput && Chain.hForward && Chain.hReverse) {
+
+ // Go on, try to compute gamut LUT from PCS. This consist on a single channel containing
+ // dE when doing a transform back and forth on the colorimetric intent.
+
+ Gamut = cmsPipelineAlloc(ContextID, 3, 1);
+ if (Gamut != NULL) {
+
+ CLUT = cmsStageAllocCLut16bit(ContextID, nGridpoints, nChannels, 1, NULL);
+ if (!cmsPipelineInsertStage(Gamut, cmsAT_BEGIN, CLUT)) {
+ cmsPipelineFree(Gamut);
+ Gamut = NULL;
+ }
+ else {
+ cmsStageSampleCLut16bit(CLUT, GamutSampler, (void*) &Chain, 0);
+ }
+ }
+ }
+ else
+ Gamut = NULL; // Didn't work...
+
+ // Free all needed stuff.
+ if (Chain.hInput) cmsDeleteTransform(Chain.hInput);
+ if (Chain.hForward) cmsDeleteTransform(Chain.hForward);
+ if (Chain.hReverse) cmsDeleteTransform(Chain.hReverse);
+ if (hLab) cmsCloseProfile(hLab);
+
+ // And return computed hull
+ return Gamut;
+}
+
+// Total Area Coverage estimation ----------------------------------------------------------------
+
+typedef struct {
+ cmsUInt32Number nOutputChans;
+ cmsHTRANSFORM hRoundTrip;
+ cmsFloat32Number MaxTAC;
+ cmsFloat32Number MaxInput[cmsMAXCHANNELS];
+
+} cmsTACestimator;
+
+
+// This callback just accounts the maximum ink dropped in the given node. It does not populate any
+// memory, as the destination table is NULL. Its only purpose it to know the global maximum.
+static
+int EstimateTAC(register const cmsUInt16Number In[], register cmsUInt16Number Out[], register void * Cargo)
+{
+ cmsTACestimator* bp = (cmsTACestimator*) Cargo;
+ cmsFloat32Number RoundTrip[cmsMAXCHANNELS];
+ cmsUInt32Number i;
+ cmsFloat32Number Sum;
+
+
+ // Evaluate the xform
+ cmsDoTransform(bp->hRoundTrip, In, RoundTrip, 1);
+
+ // All all amounts of ink
+ for (Sum=0, i=0; i < bp ->nOutputChans; i++)
+ Sum += RoundTrip[i];
+
+ // If above maximum, keep track of input values
+ if (Sum > bp ->MaxTAC) {
+
+ bp ->MaxTAC = Sum;
+
+ for (i=0; i < bp ->nOutputChans; i++) {
+ bp ->MaxInput[i] = In[i];
+ }
+ }
+
+ return TRUE;
+
+ cmsUNUSED_PARAMETER(Out);
+}
+
+
+// Detect Total area coverage of the profile
+cmsFloat64Number CMSEXPORT cmsDetectTAC(cmsHPROFILE hProfile)
+{
+ cmsTACestimator bp;
+ cmsUInt32Number dwFormatter;
+ cmsUInt32Number GridPoints[MAX_INPUT_DIMENSIONS];
+ cmsHPROFILE hLab;
+ cmsContext ContextID = cmsGetProfileContextID(hProfile);
+
+ // TAC only works on output profiles
+ if (cmsGetDeviceClass(hProfile) != cmsSigOutputClass) {
+ return 0;
+ }
+
+ // Create a fake formatter for result
+ dwFormatter = cmsFormatterForColorspaceOfProfile(hProfile, 4, TRUE);
+
+ bp.nOutputChans = T_CHANNELS(dwFormatter);
+ bp.MaxTAC = 0; // Initial TAC is 0
+
+ // for safety
+ if (bp.nOutputChans >= cmsMAXCHANNELS) return 0;
+
+ hLab = cmsCreateLab4ProfileTHR(ContextID, NULL);
+ if (hLab == NULL) return 0;
+ // Setup a roundtrip on perceptual intent in output profile for TAC estimation
+ bp.hRoundTrip = cmsCreateTransformTHR(ContextID, hLab, TYPE_Lab_16,
+ hProfile, dwFormatter, INTENT_PERCEPTUAL, cmsFLAGS_NOOPTIMIZE|cmsFLAGS_NOCACHE);
+
+ cmsCloseProfile(hLab);
+ if (bp.hRoundTrip == NULL) return 0;
+
+ // For L* we only need black and white. For C* we need many points
+ GridPoints[0] = 6;
+ GridPoints[1] = 74;
+ GridPoints[2] = 74;
+
+
+ if (!cmsSliceSpace16(3, GridPoints, EstimateTAC, &bp)) {
+ bp.MaxTAC = 0;
+ }
+
+ cmsDeleteTransform(bp.hRoundTrip);
+
+ // Results in %
+ return bp.MaxTAC;
+}
+
+
+// Carefully, clamp on CIELab space.
+
+cmsBool CMSEXPORT cmsDesaturateLab(cmsCIELab* Lab,
+ double amax, double amin,
+ double bmax, double bmin)
+{
+
+ // Whole Luma surface to zero
+
+ if (Lab -> L < 0) {
+
+ Lab-> L = Lab->a = Lab-> b = 0.0;
+ return FALSE;
+ }
+
+ // Clamp white, DISCARD HIGHLIGHTS. This is done
+ // in such way because icc spec doesn't allow the
+ // use of L>100 as a highlight means.
+
+ if (Lab->L > 100)
+ Lab -> L = 100;
+
+ // Check out gamut prism, on a, b faces
+
+ if (Lab -> a < amin || Lab->a > amax||
+ Lab -> b < bmin || Lab->b > bmax) {
+
+ cmsCIELCh LCh;
+ double h, slope;
+
+ // Falls outside a, b limits. Transports to LCh space,
+ // and then do the clipping
+
+
+ if (Lab -> a == 0.0) { // Is hue exactly 90?
+
+ // atan will not work, so clamp here
+ Lab -> b = Lab->b < 0 ? bmin : bmax;
+ return TRUE;
+ }
+
+ cmsLab2LCh(&LCh, Lab);
+
+ slope = Lab -> b / Lab -> a;
+ h = LCh.h;
+
+ // There are 4 zones
+
+ if ((h >= 0. && h < 45.) ||
+ (h >= 315 && h <= 360.)) {
+
+ // clip by amax
+ Lab -> a = amax;
+ Lab -> b = amax * slope;
+ }
+ else
+ if (h >= 45. && h < 135.)
+ {
+ // clip by bmax
+ Lab -> b = bmax;
+ Lab -> a = bmax / slope;
+ }
+ else
+ if (h >= 135. && h < 225.) {
+ // clip by amin
+ Lab -> a = amin;
+ Lab -> b = amin * slope;
+
+ }
+ else
+ if (h >= 225. && h < 315.) {
+ // clip by bmin
+ Lab -> b = bmin;
+ Lab -> a = bmin / slope;
+ }
+ else {
+ cmsSignalError(0, cmsERROR_RANGE, "Invalid angle");
+ return FALSE;
+ }
+
+ }
+
+ return TRUE;
+}
diff --git a/core/src/fxcodec/lcms2/src/fx_cmscam02.c b/core/src/fxcodec/lcms2/src/fx_cmscam02.c
index 05584aa8f8..3268424870 100644
--- a/core/src/fxcodec/lcms2/src/fx_cmscam02.c
+++ b/core/src/fxcodec/lcms2/src/fx_cmscam02.c
@@ -1,7 +1,7 @@
-// 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
-
-#include "../lcms2-2.6/src/cmscam02.c"
+// 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
+
+#include "../lcms2-2.6/src/cmscam02.c"
diff --git a/core/src/fxcodec/lcms2/src/fx_cmscgats.c b/core/src/fxcodec/lcms2/src/fx_cmscgats.c
index 80dcba7830..9e00fe6c3e 100644
--- a/core/src/fxcodec/lcms2/src/fx_cmscgats.c
+++ b/core/src/fxcodec/lcms2/src/fx_cmscgats.c
@@ -1,7 +1,7 @@
-// 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
-
-#include "../lcms2-2.6/src/cmscgats.c"
+// 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
+
+#include "../lcms2-2.6/src/cmscgats.c"
diff --git a/core/src/fxcodec/lcms2/src/fx_cmscnvrt.c b/core/src/fxcodec/lcms2/src/fx_cmscnvrt.c
index 9b8a292f7b..9b9eb99c70 100644
--- a/core/src/fxcodec/lcms2/src/fx_cmscnvrt.c
+++ b/core/src/fxcodec/lcms2/src/fx_cmscnvrt.c
@@ -1,7 +1,7 @@
-// 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
-
-#include "../lcms2-2.6/src/cmscnvrt.c"
+// 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
+
+#include "../lcms2-2.6/src/cmscnvrt.c"
diff --git a/core/src/fxcodec/lcms2/src/fx_cmserr.c b/core/src/fxcodec/lcms2/src/fx_cmserr.c
index 6929e7b34c..27d0696c85 100644
--- a/core/src/fxcodec/lcms2/src/fx_cmserr.c
+++ b/core/src/fxcodec/lcms2/src/fx_cmserr.c
@@ -1,7 +1,7 @@
-// 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
-
-#include "../lcms2-2.6/src/cmserr.c"
+// 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
+
+#include "../lcms2-2.6/src/cmserr.c"
diff --git a/core/src/fxcodec/lcms2/src/fx_cmsgamma.c b/core/src/fxcodec/lcms2/src/fx_cmsgamma.c
index f5bb690220..9936c62b0f 100644
--- a/core/src/fxcodec/lcms2/src/fx_cmsgamma.c
+++ b/core/src/fxcodec/lcms2/src/fx_cmsgamma.c
@@ -1,7 +1,7 @@
-// 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
-
-#include "../lcms2-2.6/src/cmsgamma.c"
+// 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
+
+#include "../lcms2-2.6/src/cmsgamma.c"
diff --git a/core/src/fxcodec/lcms2/src/fx_cmsgmt.c b/core/src/fxcodec/lcms2/src/fx_cmsgmt.c
index ea82b15be0..dfe4cc86f0 100644
--- a/core/src/fxcodec/lcms2/src/fx_cmsgmt.c
+++ b/core/src/fxcodec/lcms2/src/fx_cmsgmt.c
@@ -1,7 +1,7 @@
-// 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
-
-#include "../lcms2-2.6/src/cmsgmt.c"
+// 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
+
+#include "../lcms2-2.6/src/cmsgmt.c"
diff --git a/core/src/fxcodec/lcms2/src/fx_cmshalf.c b/core/src/fxcodec/lcms2/src/fx_cmshalf.c
index 6ed6b2b075..9c7e07c580 100644
--- a/core/src/fxcodec/lcms2/src/fx_cmshalf.c
+++ b/core/src/fxcodec/lcms2/src/fx_cmshalf.c
@@ -1,7 +1,7 @@
-// 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
-
-#include "../lcms2-2.6/src/cmshalf.c"
+// 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
+
+#include "../lcms2-2.6/src/cmshalf.c"
diff --git a/core/src/fxcodec/lcms2/src/fx_cmsintrp.c b/core/src/fxcodec/lcms2/src/fx_cmsintrp.c
index affca53ca9..8eacd55bc0 100644
--- a/core/src/fxcodec/lcms2/src/fx_cmsintrp.c
+++ b/core/src/fxcodec/lcms2/src/fx_cmsintrp.c
@@ -1,7 +1,7 @@
-// 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
-
-#include "../lcms2-2.6/src/cmsintrp.c"
+// 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
+
+#include "../lcms2-2.6/src/cmsintrp.c"
diff --git a/core/src/fxcodec/lcms2/src/fx_cmsio0.c b/core/src/fxcodec/lcms2/src/fx_cmsio0.c
index 2b6bc689cc..a4aed23c94 100644
--- a/core/src/fxcodec/lcms2/src/fx_cmsio0.c
+++ b/core/src/fxcodec/lcms2/src/fx_cmsio0.c
@@ -1,7 +1,7 @@
-// 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
-
-#include "../lcms2-2.6/src/cmsio0.c"
+// 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
+
+#include "../lcms2-2.6/src/cmsio0.c"
diff --git a/core/src/fxcodec/lcms2/src/fx_cmsio1.c b/core/src/fxcodec/lcms2/src/fx_cmsio1.c
index 192e879063..34ce927c4f 100644
--- a/core/src/fxcodec/lcms2/src/fx_cmsio1.c
+++ b/core/src/fxcodec/lcms2/src/fx_cmsio1.c
@@ -1,7 +1,7 @@
-// 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
-
-#include "../lcms2-2.6/src/cmsio1.c"
+// 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
+
+#include "../lcms2-2.6/src/cmsio1.c"
diff --git a/core/src/fxcodec/lcms2/src/fx_cmslut.c b/core/src/fxcodec/lcms2/src/fx_cmslut.c
index d9a319c774..d032e3b0cb 100644
--- a/core/src/fxcodec/lcms2/src/fx_cmslut.c
+++ b/core/src/fxcodec/lcms2/src/fx_cmslut.c
@@ -1,7 +1,7 @@
-// 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
-
-#include "../lcms2-2.6/src/cmslut.c"
+// 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
+
+#include "../lcms2-2.6/src/cmslut.c"
diff --git a/core/src/fxcodec/lcms2/src/fx_cmsmd5.c b/core/src/fxcodec/lcms2/src/fx_cmsmd5.c
index 3a3a99719c..028db4a8eb 100644
--- a/core/src/fxcodec/lcms2/src/fx_cmsmd5.c
+++ b/core/src/fxcodec/lcms2/src/fx_cmsmd5.c
@@ -1,7 +1,7 @@
-// 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
-
-#include "../lcms2-2.6/src/cmsmd5.c"
+// 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
+
+#include "../lcms2-2.6/src/cmsmd5.c"
diff --git a/core/src/fxcodec/lcms2/src/fx_cmsmtrx.c b/core/src/fxcodec/lcms2/src/fx_cmsmtrx.c
index 667ac1f09e..ad04dcc307 100644
--- a/core/src/fxcodec/lcms2/src/fx_cmsmtrx.c
+++ b/core/src/fxcodec/lcms2/src/fx_cmsmtrx.c
@@ -1,7 +1,7 @@
-// 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
-
-#include "../lcms2-2.6/src/cmsmtrx.c"
+// 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
+
+#include "../lcms2-2.6/src/cmsmtrx.c"
diff --git a/core/src/fxcodec/lcms2/src/fx_cmsnamed.c b/core/src/fxcodec/lcms2/src/fx_cmsnamed.c
index 5e1b028e94..93a0132aa7 100644
--- a/core/src/fxcodec/lcms2/src/fx_cmsnamed.c
+++ b/core/src/fxcodec/lcms2/src/fx_cmsnamed.c
@@ -1,7 +1,7 @@
-// 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
-
-#include "../lcms2-2.6/src/cmsnamed.c"
+// 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
+
+#include "../lcms2-2.6/src/cmsnamed.c"
diff --git a/core/src/fxcodec/lcms2/src/fx_cmsopt.c b/core/src/fxcodec/lcms2/src/fx_cmsopt.c
index f12429c551..e16c735cbb 100644
--- a/core/src/fxcodec/lcms2/src/fx_cmsopt.c
+++ b/core/src/fxcodec/lcms2/src/fx_cmsopt.c
@@ -1,7 +1,7 @@
-// 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
-
-#include "../lcms2-2.6/src/cmsopt.c"
+// 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
+
+#include "../lcms2-2.6/src/cmsopt.c"
diff --git a/core/src/fxcodec/lcms2/src/fx_cmspack.c b/core/src/fxcodec/lcms2/src/fx_cmspack.c
index 6e0640905d..d125d33a32 100644
--- a/core/src/fxcodec/lcms2/src/fx_cmspack.c
+++ b/core/src/fxcodec/lcms2/src/fx_cmspack.c
@@ -1,7 +1,7 @@
-// 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
-
-#include "../lcms2-2.6/src/cmspack.c"
+// 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
+
+#include "../lcms2-2.6/src/cmspack.c"
diff --git a/core/src/fxcodec/lcms2/src/fx_cmspcs.c b/core/src/fxcodec/lcms2/src/fx_cmspcs.c
index 48ce39de52..2a9d6dde99 100644
--- a/core/src/fxcodec/lcms2/src/fx_cmspcs.c
+++ b/core/src/fxcodec/lcms2/src/fx_cmspcs.c
@@ -1,7 +1,7 @@
-// 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
-
-#include "../lcms2-2.6/src/cmspcs.c"
+// 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
+
+#include "../lcms2-2.6/src/cmspcs.c"
diff --git a/core/src/fxcodec/lcms2/src/fx_cmsplugin.c b/core/src/fxcodec/lcms2/src/fx_cmsplugin.c
index 39266c2222..ab7e6c31ee 100644
--- a/core/src/fxcodec/lcms2/src/fx_cmsplugin.c
+++ b/core/src/fxcodec/lcms2/src/fx_cmsplugin.c
@@ -1,7 +1,7 @@
-// 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
-
-#include "../lcms2-2.6/src/cmsplugin.c"
+// 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
+
+#include "../lcms2-2.6/src/cmsplugin.c"
diff --git a/core/src/fxcodec/lcms2/src/fx_cmsps2.c b/core/src/fxcodec/lcms2/src/fx_cmsps2.c
index dcf55409e4..b6a1ea9f97 100644
--- a/core/src/fxcodec/lcms2/src/fx_cmsps2.c
+++ b/core/src/fxcodec/lcms2/src/fx_cmsps2.c
@@ -1,7 +1,7 @@
-// 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
-
-#include "../lcms2-2.6/src/cmsps2.c"
+// 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
+
+#include "../lcms2-2.6/src/cmsps2.c"
diff --git a/core/src/fxcodec/lcms2/src/fx_cmssamp.c b/core/src/fxcodec/lcms2/src/fx_cmssamp.c
index f1468fe16d..5e5c0316b2 100644
--- a/core/src/fxcodec/lcms2/src/fx_cmssamp.c
+++ b/core/src/fxcodec/lcms2/src/fx_cmssamp.c
@@ -1,7 +1,7 @@
-// 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
-
-#include "../lcms2-2.6/src/cmssamp.c"
+// 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
+
+#include "../lcms2-2.6/src/cmssamp.c"
diff --git a/core/src/fxcodec/lcms2/src/fx_cmssm.c b/core/src/fxcodec/lcms2/src/fx_cmssm.c
index a53ad71f42..b8c716041e 100644
--- a/core/src/fxcodec/lcms2/src/fx_cmssm.c
+++ b/core/src/fxcodec/lcms2/src/fx_cmssm.c
@@ -1,7 +1,7 @@
-// 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
-
-#include "../lcms2-2.6/src/cmssm.c"
+// 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
+
+#include "../lcms2-2.6/src/cmssm.c"
diff --git a/core/src/fxcodec/lcms2/src/fx_cmstypes.c b/core/src/fxcodec/lcms2/src/fx_cmstypes.c
index 19f9e706c1..cf64a61dd9 100644
--- a/core/src/fxcodec/lcms2/src/fx_cmstypes.c
+++ b/core/src/fxcodec/lcms2/src/fx_cmstypes.c
@@ -1,7 +1,7 @@
-// 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
-
-#include "../lcms2-2.6/src/cmstypes.c"
+// 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
+
+#include "../lcms2-2.6/src/cmstypes.c"
diff --git a/core/src/fxcodec/lcms2/src/fx_cmsvirt.c b/core/src/fxcodec/lcms2/src/fx_cmsvirt.c
index 3e5397f11b..cc60d1f9f1 100644
--- a/core/src/fxcodec/lcms2/src/fx_cmsvirt.c
+++ b/core/src/fxcodec/lcms2/src/fx_cmsvirt.c
@@ -1,7 +1,7 @@
-// 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
-
-#include "../lcms2-2.6/src/cmsvirt.c"
+// 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
+
+#include "../lcms2-2.6/src/cmsvirt.c"
diff --git a/core/src/fxcodec/lcms2/src/fx_cmswtpnt.c b/core/src/fxcodec/lcms2/src/fx_cmswtpnt.c
index c11afd6016..d46c60a985 100644
--- a/core/src/fxcodec/lcms2/src/fx_cmswtpnt.c
+++ b/core/src/fxcodec/lcms2/src/fx_cmswtpnt.c
@@ -1,7 +1,7 @@
-// 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
-
-#include "../lcms2-2.6/src/cmswtpnt.c"
+// 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
+
+#include "../lcms2-2.6/src/cmswtpnt.c"
diff --git a/core/src/fxcodec/lcms2/src/fx_cmsxform.c b/core/src/fxcodec/lcms2/src/fx_cmsxform.c
index a4b6d85536..e8cd83af42 100644
--- a/core/src/fxcodec/lcms2/src/fx_cmsxform.c
+++ b/core/src/fxcodec/lcms2/src/fx_cmsxform.c
@@ -1,7 +1,7 @@
-// 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
-
-#include "../lcms2-2.6/src/cmsxform.c"
+// 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
+
+#include "../lcms2-2.6/src/cmsxform.c"
diff --git a/core/src/fxcodec/libjpeg/cderror.h b/core/src/fxcodec/libjpeg/cderror.h
index c19d38fb4a..70435e161c 100644
--- a/core/src/fxcodec/libjpeg/cderror.h
+++ b/core/src/fxcodec/libjpeg/cderror.h
@@ -1,132 +1,132 @@
-/*
- * cderror.h
- *
- * Copyright (C) 1994-1997, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- * For conditions of distribution and use, see the accompanying README file.
- *
- * This file defines the error and message codes for the cjpeg/djpeg
- * applications. These strings are not needed as part of the JPEG library
- * proper.
- * Edit this file to add new codes, or to translate the message strings to
- * some other language.
- */
-
-/*
- * To define the enum list of message codes, include this file without
- * defining macro JMESSAGE. To create a message string table, include it
- * again with a suitable JMESSAGE definition (see jerror.c for an example).
- */
-#ifndef JMESSAGE
-#ifndef CDERROR_H
-#define CDERROR_H
-/* First time through, define the enum list */
-#define JMAKE_ENUM_LIST
-#else
-/* Repeated inclusions of this file are no-ops unless JMESSAGE is defined */
-#define JMESSAGE(code,string)
-#endif /* CDERROR_H */
-#endif /* JMESSAGE */
-
-#ifdef JMAKE_ENUM_LIST
-
-typedef enum {
-
-#define JMESSAGE(code,string) code ,
-
-#endif /* JMAKE_ENUM_LIST */
-
-JMESSAGE(JMSG_FIRSTADDONCODE=1000, NULL) /* Must be first entry! */
-
-#ifdef BMP_SUPPORTED
-JMESSAGE(JERR_BMP_BADCMAP, "Unsupported BMP colormap format")
-JMESSAGE(JERR_BMP_BADDEPTH, "Only 8- and 24-bit BMP files are supported")
-JMESSAGE(JERR_BMP_BADHEADER, "Invalid BMP file: bad header length")
-JMESSAGE(JERR_BMP_BADPLANES, "Invalid BMP file: biPlanes not equal to 1")
-JMESSAGE(JERR_BMP_COLORSPACE, "BMP output must be grayscale or RGB")
-JMESSAGE(JERR_BMP_COMPRESSED, "Sorry, compressed BMPs not yet supported")
-JMESSAGE(JERR_BMP_NOT, "Not a BMP file - does not start with BM")
-JMESSAGE(JTRC_BMP, "%ux%u 24-bit BMP image")
-JMESSAGE(JTRC_BMP_MAPPED, "%ux%u 8-bit colormapped BMP image")
-JMESSAGE(JTRC_BMP_OS2, "%ux%u 24-bit OS2 BMP image")
-JMESSAGE(JTRC_BMP_OS2_MAPPED, "%ux%u 8-bit colormapped OS2 BMP image")
-#endif /* BMP_SUPPORTED */
-
-#ifdef GIF_SUPPORTED
-JMESSAGE(JERR_GIF_BUG, "GIF output got confused")
-JMESSAGE(JERR_GIF_CODESIZE, "Bogus GIF codesize %d")
-JMESSAGE(JERR_GIF_COLORSPACE, "GIF output must be grayscale or RGB")
-JMESSAGE(JERR_GIF_IMAGENOTFOUND, "Too few images in GIF file")
-JMESSAGE(JERR_GIF_NOT, "Not a GIF file")
-JMESSAGE(JTRC_GIF, "%ux%ux%d GIF image")
-JMESSAGE(JTRC_GIF_BADVERSION,
- "Warning: unexpected GIF version number '%c%c%c'")
-JMESSAGE(JTRC_GIF_EXTENSION, "Ignoring GIF extension block of type 0x%02x")
-JMESSAGE(JTRC_GIF_NONSQUARE, "Caution: nonsquare pixels in input")
-JMESSAGE(JWRN_GIF_BADDATA, "Corrupt data in GIF file")
-JMESSAGE(JWRN_GIF_CHAR, "Bogus char 0x%02x in GIF file, ignoring")
-JMESSAGE(JWRN_GIF_ENDCODE, "Premature end of GIF image")
-JMESSAGE(JWRN_GIF_NOMOREDATA, "Ran out of GIF bits")
-#endif /* GIF_SUPPORTED */
-
-#ifdef PPM_SUPPORTED
-JMESSAGE(JERR_PPM_COLORSPACE, "PPM output must be grayscale or RGB")
-JMESSAGE(JERR_PPM_NONNUMERIC, "Nonnumeric data in PPM file")
-JMESSAGE(JERR_PPM_NOT, "Not a PPM/PGM file")
-JMESSAGE(JTRC_PGM, "%ux%u PGM image")
-JMESSAGE(JTRC_PGM_TEXT, "%ux%u text PGM image")
-JMESSAGE(JTRC_PPM, "%ux%u PPM image")
-JMESSAGE(JTRC_PPM_TEXT, "%ux%u text PPM image")
-#endif /* PPM_SUPPORTED */
-
-#ifdef RLE_SUPPORTED
-JMESSAGE(JERR_RLE_BADERROR, "Bogus error code from RLE library")
-JMESSAGE(JERR_RLE_COLORSPACE, "RLE output must be grayscale or RGB")
-JMESSAGE(JERR_RLE_DIMENSIONS, "Image dimensions (%ux%u) too large for RLE")
-JMESSAGE(JERR_RLE_EMPTY, "Empty RLE file")
-JMESSAGE(JERR_RLE_EOF, "Premature EOF in RLE header")
-JMESSAGE(JERR_RLE_MEM, "Insufficient memory for RLE header")
-JMESSAGE(JERR_RLE_NOT, "Not an RLE file")
-JMESSAGE(JERR_RLE_TOOMANYCHANNELS, "Cannot handle %d output channels for RLE")
-JMESSAGE(JERR_RLE_UNSUPPORTED, "Cannot handle this RLE setup")
-JMESSAGE(JTRC_RLE, "%ux%u full-color RLE file")
-JMESSAGE(JTRC_RLE_FULLMAP, "%ux%u full-color RLE file with map of length %d")
-JMESSAGE(JTRC_RLE_GRAY, "%ux%u grayscale RLE file")
-JMESSAGE(JTRC_RLE_MAPGRAY, "%ux%u grayscale RLE file with map of length %d")
-JMESSAGE(JTRC_RLE_MAPPED, "%ux%u colormapped RLE file with map of length %d")
-#endif /* RLE_SUPPORTED */
-
-#ifdef TARGA_SUPPORTED
-JMESSAGE(JERR_TGA_BADCMAP, "Unsupported Targa colormap format")
-JMESSAGE(JERR_TGA_BADPARMS, "Invalid or unsupported Targa file")
-JMESSAGE(JERR_TGA_COLORSPACE, "Targa output must be grayscale or RGB")
-JMESSAGE(JTRC_TGA, "%ux%u RGB Targa image")
-JMESSAGE(JTRC_TGA_GRAY, "%ux%u grayscale Targa image")
-JMESSAGE(JTRC_TGA_MAPPED, "%ux%u colormapped Targa image")
-#else
-JMESSAGE(JERR_TGA_NOTCOMP, "Targa support was not compiled")
-#endif /* TARGA_SUPPORTED */
-
-JMESSAGE(JERR_BAD_CMAP_FILE,
- "Color map file is invalid or of unsupported format")
-JMESSAGE(JERR_TOO_MANY_COLORS,
- "Output file format cannot handle %d colormap entries")
-JMESSAGE(JERR_UNGETC_FAILED, "ungetc failed")
-#ifdef TARGA_SUPPORTED
-JMESSAGE(JERR_UNKNOWN_FORMAT,
- "Unrecognized input file format --- perhaps you need -targa")
-#else
-JMESSAGE(JERR_UNKNOWN_FORMAT, "Unrecognized input file format")
-#endif
-JMESSAGE(JERR_UNSUPPORTED_FORMAT, "Unsupported output file format")
-
-#ifdef JMAKE_ENUM_LIST
-
- JMSG_LASTADDONCODE
-} ADDON_MESSAGE_CODE;
-
-#undef JMAKE_ENUM_LIST
-#endif /* JMAKE_ENUM_LIST */
-
-/* Zap JMESSAGE macro so that future re-inclusions do nothing by default */
-#undef JMESSAGE
+/*
+ * cderror.h
+ *
+ * Copyright (C) 1994-1997, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file defines the error and message codes for the cjpeg/djpeg
+ * applications. These strings are not needed as part of the JPEG library
+ * proper.
+ * Edit this file to add new codes, or to translate the message strings to
+ * some other language.
+ */
+
+/*
+ * To define the enum list of message codes, include this file without
+ * defining macro JMESSAGE. To create a message string table, include it
+ * again with a suitable JMESSAGE definition (see jerror.c for an example).
+ */
+#ifndef JMESSAGE
+#ifndef CDERROR_H
+#define CDERROR_H
+/* First time through, define the enum list */
+#define JMAKE_ENUM_LIST
+#else
+/* Repeated inclusions of this file are no-ops unless JMESSAGE is defined */
+#define JMESSAGE(code,string)
+#endif /* CDERROR_H */
+#endif /* JMESSAGE */
+
+#ifdef JMAKE_ENUM_LIST
+
+typedef enum {
+
+#define JMESSAGE(code,string) code ,
+
+#endif /* JMAKE_ENUM_LIST */
+
+JMESSAGE(JMSG_FIRSTADDONCODE=1000, NULL) /* Must be first entry! */
+
+#ifdef BMP_SUPPORTED
+JMESSAGE(JERR_BMP_BADCMAP, "Unsupported BMP colormap format")
+JMESSAGE(JERR_BMP_BADDEPTH, "Only 8- and 24-bit BMP files are supported")
+JMESSAGE(JERR_BMP_BADHEADER, "Invalid BMP file: bad header length")
+JMESSAGE(JERR_BMP_BADPLANES, "Invalid BMP file: biPlanes not equal to 1")
+JMESSAGE(JERR_BMP_COLORSPACE, "BMP output must be grayscale or RGB")
+JMESSAGE(JERR_BMP_COMPRESSED, "Sorry, compressed BMPs not yet supported")
+JMESSAGE(JERR_BMP_NOT, "Not a BMP file - does not start with BM")
+JMESSAGE(JTRC_BMP, "%ux%u 24-bit BMP image")
+JMESSAGE(JTRC_BMP_MAPPED, "%ux%u 8-bit colormapped BMP image")
+JMESSAGE(JTRC_BMP_OS2, "%ux%u 24-bit OS2 BMP image")
+JMESSAGE(JTRC_BMP_OS2_MAPPED, "%ux%u 8-bit colormapped OS2 BMP image")
+#endif /* BMP_SUPPORTED */
+
+#ifdef GIF_SUPPORTED
+JMESSAGE(JERR_GIF_BUG, "GIF output got confused")
+JMESSAGE(JERR_GIF_CODESIZE, "Bogus GIF codesize %d")
+JMESSAGE(JERR_GIF_COLORSPACE, "GIF output must be grayscale or RGB")
+JMESSAGE(JERR_GIF_IMAGENOTFOUND, "Too few images in GIF file")
+JMESSAGE(JERR_GIF_NOT, "Not a GIF file")
+JMESSAGE(JTRC_GIF, "%ux%ux%d GIF image")
+JMESSAGE(JTRC_GIF_BADVERSION,
+ "Warning: unexpected GIF version number '%c%c%c'")
+JMESSAGE(JTRC_GIF_EXTENSION, "Ignoring GIF extension block of type 0x%02x")
+JMESSAGE(JTRC_GIF_NONSQUARE, "Caution: nonsquare pixels in input")
+JMESSAGE(JWRN_GIF_BADDATA, "Corrupt data in GIF file")
+JMESSAGE(JWRN_GIF_CHAR, "Bogus char 0x%02x in GIF file, ignoring")
+JMESSAGE(JWRN_GIF_ENDCODE, "Premature end of GIF image")
+JMESSAGE(JWRN_GIF_NOMOREDATA, "Ran out of GIF bits")
+#endif /* GIF_SUPPORTED */
+
+#ifdef PPM_SUPPORTED
+JMESSAGE(JERR_PPM_COLORSPACE, "PPM output must be grayscale or RGB")
+JMESSAGE(JERR_PPM_NONNUMERIC, "Nonnumeric data in PPM file")
+JMESSAGE(JERR_PPM_NOT, "Not a PPM/PGM file")
+JMESSAGE(JTRC_PGM, "%ux%u PGM image")
+JMESSAGE(JTRC_PGM_TEXT, "%ux%u text PGM image")
+JMESSAGE(JTRC_PPM, "%ux%u PPM image")
+JMESSAGE(JTRC_PPM_TEXT, "%ux%u text PPM image")
+#endif /* PPM_SUPPORTED */
+
+#ifdef RLE_SUPPORTED
+JMESSAGE(JERR_RLE_BADERROR, "Bogus error code from RLE library")
+JMESSAGE(JERR_RLE_COLORSPACE, "RLE output must be grayscale or RGB")
+JMESSAGE(JERR_RLE_DIMENSIONS, "Image dimensions (%ux%u) too large for RLE")
+JMESSAGE(JERR_RLE_EMPTY, "Empty RLE file")
+JMESSAGE(JERR_RLE_EOF, "Premature EOF in RLE header")
+JMESSAGE(JERR_RLE_MEM, "Insufficient memory for RLE header")
+JMESSAGE(JERR_RLE_NOT, "Not an RLE file")
+JMESSAGE(JERR_RLE_TOOMANYCHANNELS, "Cannot handle %d output channels for RLE")
+JMESSAGE(JERR_RLE_UNSUPPORTED, "Cannot handle this RLE setup")
+JMESSAGE(JTRC_RLE, "%ux%u full-color RLE file")
+JMESSAGE(JTRC_RLE_FULLMAP, "%ux%u full-color RLE file with map of length %d")
+JMESSAGE(JTRC_RLE_GRAY, "%ux%u grayscale RLE file")
+JMESSAGE(JTRC_RLE_MAPGRAY, "%ux%u grayscale RLE file with map of length %d")
+JMESSAGE(JTRC_RLE_MAPPED, "%ux%u colormapped RLE file with map of length %d")
+#endif /* RLE_SUPPORTED */
+
+#ifdef TARGA_SUPPORTED
+JMESSAGE(JERR_TGA_BADCMAP, "Unsupported Targa colormap format")
+JMESSAGE(JERR_TGA_BADPARMS, "Invalid or unsupported Targa file")
+JMESSAGE(JERR_TGA_COLORSPACE, "Targa output must be grayscale or RGB")
+JMESSAGE(JTRC_TGA, "%ux%u RGB Targa image")
+JMESSAGE(JTRC_TGA_GRAY, "%ux%u grayscale Targa image")
+JMESSAGE(JTRC_TGA_MAPPED, "%ux%u colormapped Targa image")
+#else
+JMESSAGE(JERR_TGA_NOTCOMP, "Targa support was not compiled")
+#endif /* TARGA_SUPPORTED */
+
+JMESSAGE(JERR_BAD_CMAP_FILE,
+ "Color map file is invalid or of unsupported format")
+JMESSAGE(JERR_TOO_MANY_COLORS,
+ "Output file format cannot handle %d colormap entries")
+JMESSAGE(JERR_UNGETC_FAILED, "ungetc failed")
+#ifdef TARGA_SUPPORTED
+JMESSAGE(JERR_UNKNOWN_FORMAT,
+ "Unrecognized input file format --- perhaps you need -targa")
+#else
+JMESSAGE(JERR_UNKNOWN_FORMAT, "Unrecognized input file format")
+#endif
+JMESSAGE(JERR_UNSUPPORTED_FORMAT, "Unsupported output file format")
+
+#ifdef JMAKE_ENUM_LIST
+
+ JMSG_LASTADDONCODE
+} ADDON_MESSAGE_CODE;
+
+#undef JMAKE_ENUM_LIST
+#endif /* JMAKE_ENUM_LIST */
+
+/* Zap JMESSAGE macro so that future re-inclusions do nothing by default */
+#undef JMESSAGE
diff --git a/core/src/fxcodec/libjpeg/cdjpeg.h b/core/src/fxcodec/libjpeg/cdjpeg.h
index be12278810..3d728ee9c7 100644
--- a/core/src/fxcodec/libjpeg/cdjpeg.h
+++ b/core/src/fxcodec/libjpeg/cdjpeg.h
@@ -1,184 +1,184 @@
-/*
- * cdjpeg.h
- *
- * Copyright (C) 1994-1997, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- * For conditions of distribution and use, see the accompanying README file.
- *
- * This file contains common declarations for the sample applications
- * cjpeg and djpeg. It is NOT used by the core JPEG library.
- */
-
-#define JPEG_CJPEG_DJPEG /* define proper options in jconfig.h */
-#define JPEG_INTERNAL_OPTIONS /* cjpeg.c,djpeg.c need to see xxx_SUPPORTED */
-#include "jinclude.h"
-#include "jpeglib.h"
-#include "jerror.h" /* get library error codes too */
-#include "cderror.h" /* get application-specific error codes */
-
-
-/*
- * Object interface for cjpeg's source file decoding modules
- */
-
-typedef struct cjpeg_source_struct * cjpeg_source_ptr;
-
-struct cjpeg_source_struct {
- JMETHOD(void, start_input, (j_compress_ptr cinfo,
- cjpeg_source_ptr sinfo));
- JMETHOD(JDIMENSION, get_pixel_rows, (j_compress_ptr cinfo,
- cjpeg_source_ptr sinfo));
- JMETHOD(void, finish_input, (j_compress_ptr cinfo,
- cjpeg_source_ptr sinfo));
-
- FXSYS_FILE *input_file;
-
- JSAMPARRAY buffer;
- JDIMENSION buffer_height;
-};
-
-
-/*
- * Object interface for djpeg's output file encoding modules
- */
-
-typedef struct djpeg_dest_struct * djpeg_dest_ptr;
-
-struct djpeg_dest_struct {
- /* start_output is called after jpeg_start_decompress finishes.
- * The color map will be ready at this time, if one is needed.
- */
- JMETHOD(void, start_output, (j_decompress_ptr cinfo,
- djpeg_dest_ptr dinfo));
- /* Emit the specified number of pixel rows from the buffer. */
- JMETHOD(void, put_pixel_rows, (j_decompress_ptr cinfo,
- djpeg_dest_ptr dinfo,
- JDIMENSION rows_supplied));
- /* Finish up at the end of the image. */
- JMETHOD(void, finish_output, (j_decompress_ptr cinfo,
- djpeg_dest_ptr dinfo));
-
- /* Target file spec; filled in by djpeg.c after object is created. */
- FXSYS_FILE * output_file;
-
- /* Output pixel-row buffer. Created by module init or start_output.
- * Width is cinfo->output_width * cinfo->output_components;
- * height is buffer_height.
- */
- JSAMPARRAY buffer;
- JDIMENSION buffer_height;
-};
-
-
-/*
- * cjpeg/djpeg may need to perform extra passes to convert to or from
- * the source/destination file format. The JPEG library does not know
- * about these passes, but we'd like them to be counted by the progress
- * monitor. We use an expanded progress monitor object to hold the
- * additional pass count.
- */
-
-struct cdjpeg_progress_mgr {
- struct jpeg_progress_mgr pub; /* fields known to JPEG library */
- int completed_extra_passes; /* extra passes completed */
- int total_extra_passes; /* total extra */
- /* last printed percentage stored here to avoid multiple printouts */
- int percent_done;
-};
-
-typedef struct cdjpeg_progress_mgr * cd_progress_ptr;
-
-
-/* Short forms of external names for systems with brain-damaged linkers. */
-
-#ifdef NEED_SHORT_EXTERNAL_NAMES
-#define jinit_read_bmp jIRdBMP
-#define jinit_write_bmp jIWrBMP
-#define jinit_read_gif jIRdGIF
-#define jinit_write_gif jIWrGIF
-#define jinit_read_ppm jIRdPPM
-#define jinit_write_ppm jIWrPPM
-#define jinit_read_rle jIRdRLE
-#define jinit_write_rle jIWrRLE
-#define jinit_read_targa jIRdTarga
-#define jinit_write_targa jIWrTarga
-#define read_quant_tables RdQTables
-#define read_scan_script RdScnScript
-#define set_quant_slots SetQSlots
-#define set_sample_factors SetSFacts
-#define read_color_map RdCMap
-#define enable_signal_catcher EnSigCatcher
-#define start_progress_monitor StProgMon
-#define end_progress_monitor EnProgMon
-#define read_stdin RdStdin
-#define write_stdout WrStdout
-#endif /* NEED_SHORT_EXTERNAL_NAMES */
-
-/* Module selection routines for I/O modules. */
-
-EXTERN(cjpeg_source_ptr) jinit_read_bmp JPP((j_compress_ptr cinfo));
-EXTERN(djpeg_dest_ptr) jinit_write_bmp JPP((j_decompress_ptr cinfo,
- boolean is_os2));
-EXTERN(cjpeg_source_ptr) jinit_read_gif JPP((j_compress_ptr cinfo));
-EXTERN(djpeg_dest_ptr) jinit_write_gif JPP((j_decompress_ptr cinfo));
-EXTERN(cjpeg_source_ptr) jinit_read_ppm JPP((j_compress_ptr cinfo));
-EXTERN(djpeg_dest_ptr) jinit_write_ppm JPP((j_decompress_ptr cinfo));
-EXTERN(cjpeg_source_ptr) jinit_read_rle JPP((j_compress_ptr cinfo));
-EXTERN(djpeg_dest_ptr) jinit_write_rle JPP((j_decompress_ptr cinfo));
-EXTERN(cjpeg_source_ptr) jinit_read_targa JPP((j_compress_ptr cinfo));
-EXTERN(djpeg_dest_ptr) jinit_write_targa JPP((j_decompress_ptr cinfo));
-
-/* cjpeg support routines (in rdswitch.c) */
-
-EXTERN(boolean) read_quant_tables JPP((j_compress_ptr cinfo, char * filename,
- int scale_factor, boolean force_baseline));
-EXTERN(boolean) read_scan_script JPP((j_compress_ptr cinfo, char * filename));
-EXTERN(boolean) set_quant_slots JPP((j_compress_ptr cinfo, char *arg));
-EXTERN(boolean) set_sample_factors JPP((j_compress_ptr cinfo, char *arg));
-
-/* djpeg support routines (in rdcolmap.c) */
-
-EXTERN(void) read_color_map JPP((j_decompress_ptr cinfo, FXSYS_FILE * infile));
-
-/* common support routines (in cdjpeg.c) */
-
-EXTERN(void) enable_signal_catcher JPP((j_common_ptr cinfo));
-EXTERN(void) start_progress_monitor JPP((j_common_ptr cinfo,
- cd_progress_ptr progress));
-EXTERN(void) end_progress_monitor JPP((j_common_ptr cinfo));
-EXTERN(boolean) keymatch JPP((char * arg, const char * keyword, int minchars));
-EXTERN(FXSYS_FILE *) read_stdin JPP((void));
-EXTERN(FXSYS_FILE *) write_stdout JPP((void));
-
-/* miscellaneous useful macros */
-
-#ifdef DONT_USE_B_MODE /* define mode parameters for fopen() */
-#define READ_BINARY "r"
-#define WRITE_BINARY "w"
-#else
-#ifdef VMS /* VMS is very nonstandard */
-#define READ_BINARY "rb", "ctx=stm"
-#define WRITE_BINARY "wb", "ctx=stm"
-#else /* standard ANSI-compliant case */
-#define READ_BINARY "rb"
-#define WRITE_BINARY "wb"
-#endif
-#endif
-
-#ifndef EXIT_FAILURE /* define exit() codes if not provided */
-#define EXIT_FAILURE 1
-#endif
-#ifndef EXIT_SUCCESS
-#ifdef VMS
-#define EXIT_SUCCESS 1 /* VMS is very nonstandard */
-#else
-#define EXIT_SUCCESS 0
-#endif
-#endif
-#ifndef EXIT_WARNING
-#ifdef VMS
-#define EXIT_WARNING 1 /* VMS is very nonstandard */
-#else
-#define EXIT_WARNING 2
-#endif
-#endif
+/*
+ * cdjpeg.h
+ *
+ * Copyright (C) 1994-1997, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains common declarations for the sample applications
+ * cjpeg and djpeg. It is NOT used by the core JPEG library.
+ */
+
+#define JPEG_CJPEG_DJPEG /* define proper options in jconfig.h */
+#define JPEG_INTERNAL_OPTIONS /* cjpeg.c,djpeg.c need to see xxx_SUPPORTED */
+#include "jinclude.h"
+#include "jpeglib.h"
+#include "jerror.h" /* get library error codes too */
+#include "cderror.h" /* get application-specific error codes */
+
+
+/*
+ * Object interface for cjpeg's source file decoding modules
+ */
+
+typedef struct cjpeg_source_struct * cjpeg_source_ptr;
+
+struct cjpeg_source_struct {
+ JMETHOD(void, start_input, (j_compress_ptr cinfo,
+ cjpeg_source_ptr sinfo));
+ JMETHOD(JDIMENSION, get_pixel_rows, (j_compress_ptr cinfo,
+ cjpeg_source_ptr sinfo));
+ JMETHOD(void, finish_input, (j_compress_ptr cinfo,
+ cjpeg_source_ptr sinfo));
+
+ FXSYS_FILE *input_file;
+
+ JSAMPARRAY buffer;
+ JDIMENSION buffer_height;
+};
+
+
+/*
+ * Object interface for djpeg's output file encoding modules
+ */
+
+typedef struct djpeg_dest_struct * djpeg_dest_ptr;
+
+struct djpeg_dest_struct {
+ /* start_output is called after jpeg_start_decompress finishes.
+ * The color map will be ready at this time, if one is needed.
+ */
+ JMETHOD(void, start_output, (j_decompress_ptr cinfo,
+ djpeg_dest_ptr dinfo));
+ /* Emit the specified number of pixel rows from the buffer. */
+ JMETHOD(void, put_pixel_rows, (j_decompress_ptr cinfo,
+ djpeg_dest_ptr dinfo,
+ JDIMENSION rows_supplied));
+ /* Finish up at the end of the image. */
+ JMETHOD(void, finish_output, (j_decompress_ptr cinfo,
+ djpeg_dest_ptr dinfo));
+
+ /* Target file spec; filled in by djpeg.c after object is created. */
+ FXSYS_FILE * output_file;
+
+ /* Output pixel-row buffer. Created by module init or start_output.
+ * Width is cinfo->output_width * cinfo->output_components;
+ * height is buffer_height.
+ */
+ JSAMPARRAY buffer;
+ JDIMENSION buffer_height;
+};
+
+
+/*
+ * cjpeg/djpeg may need to perform extra passes to convert to or from
+ * the source/destination file format. The JPEG library does not know
+ * about these passes, but we'd like them to be counted by the progress
+ * monitor. We use an expanded progress monitor object to hold the
+ * additional pass count.
+ */
+
+struct cdjpeg_progress_mgr {
+ struct jpeg_progress_mgr pub; /* fields known to JPEG library */
+ int completed_extra_passes; /* extra passes completed */
+ int total_extra_passes; /* total extra */
+ /* last printed percentage stored here to avoid multiple printouts */
+ int percent_done;
+};
+
+typedef struct cdjpeg_progress_mgr * cd_progress_ptr;
+
+
+/* Short forms of external names for systems with brain-damaged linkers. */
+
+#ifdef NEED_SHORT_EXTERNAL_NAMES
+#define jinit_read_bmp jIRdBMP
+#define jinit_write_bmp jIWrBMP
+#define jinit_read_gif jIRdGIF
+#define jinit_write_gif jIWrGIF
+#define jinit_read_ppm jIRdPPM
+#define jinit_write_ppm jIWrPPM
+#define jinit_read_rle jIRdRLE
+#define jinit_write_rle jIWrRLE
+#define jinit_read_targa jIRdTarga
+#define jinit_write_targa jIWrTarga
+#define read_quant_tables RdQTables
+#define read_scan_script RdScnScript
+#define set_quant_slots SetQSlots
+#define set_sample_factors SetSFacts
+#define read_color_map RdCMap
+#define enable_signal_catcher EnSigCatcher
+#define start_progress_monitor StProgMon
+#define end_progress_monitor EnProgMon
+#define read_stdin RdStdin
+#define write_stdout WrStdout
+#endif /* NEED_SHORT_EXTERNAL_NAMES */
+
+/* Module selection routines for I/O modules. */
+
+EXTERN(cjpeg_source_ptr) jinit_read_bmp JPP((j_compress_ptr cinfo));
+EXTERN(djpeg_dest_ptr) jinit_write_bmp JPP((j_decompress_ptr cinfo,
+ boolean is_os2));
+EXTERN(cjpeg_source_ptr) jinit_read_gif JPP((j_compress_ptr cinfo));
+EXTERN(djpeg_dest_ptr) jinit_write_gif JPP((j_decompress_ptr cinfo));
+EXTERN(cjpeg_source_ptr) jinit_read_ppm JPP((j_compress_ptr cinfo));
+EXTERN(djpeg_dest_ptr) jinit_write_ppm JPP((j_decompress_ptr cinfo));
+EXTERN(cjpeg_source_ptr) jinit_read_rle JPP((j_compress_ptr cinfo));
+EXTERN(djpeg_dest_ptr) jinit_write_rle JPP((j_decompress_ptr cinfo));
+EXTERN(cjpeg_source_ptr) jinit_read_targa JPP((j_compress_ptr cinfo));
+EXTERN(djpeg_dest_ptr) jinit_write_targa JPP((j_decompress_ptr cinfo));
+
+/* cjpeg support routines (in rdswitch.c) */
+
+EXTERN(boolean) read_quant_tables JPP((j_compress_ptr cinfo, char * filename,
+ int scale_factor, boolean force_baseline));
+EXTERN(boolean) read_scan_script JPP((j_compress_ptr cinfo, char * filename));
+EXTERN(boolean) set_quant_slots JPP((j_compress_ptr cinfo, char *arg));
+EXTERN(boolean) set_sample_factors JPP((j_compress_ptr cinfo, char *arg));
+
+/* djpeg support routines (in rdcolmap.c) */
+
+EXTERN(void) read_color_map JPP((j_decompress_ptr cinfo, FXSYS_FILE * infile));
+
+/* common support routines (in cdjpeg.c) */
+
+EXTERN(void) enable_signal_catcher JPP((j_common_ptr cinfo));
+EXTERN(void) start_progress_monitor JPP((j_common_ptr cinfo,
+ cd_progress_ptr progress));
+EXTERN(void) end_progress_monitor JPP((j_common_ptr cinfo));
+EXTERN(boolean) keymatch JPP((char * arg, const char * keyword, int minchars));
+EXTERN(FXSYS_FILE *) read_stdin JPP((void));
+EXTERN(FXSYS_FILE *) write_stdout JPP((void));
+
+/* miscellaneous useful macros */
+
+#ifdef DONT_USE_B_MODE /* define mode parameters for fopen() */
+#define READ_BINARY "r"
+#define WRITE_BINARY "w"
+#else
+#ifdef VMS /* VMS is very nonstandard */
+#define READ_BINARY "rb", "ctx=stm"
+#define WRITE_BINARY "wb", "ctx=stm"
+#else /* standard ANSI-compliant case */
+#define READ_BINARY "rb"
+#define WRITE_BINARY "wb"
+#endif
+#endif
+
+#ifndef EXIT_FAILURE /* define exit() codes if not provided */
+#define EXIT_FAILURE 1
+#endif
+#ifndef EXIT_SUCCESS
+#ifdef VMS
+#define EXIT_SUCCESS 1 /* VMS is very nonstandard */
+#else
+#define EXIT_SUCCESS 0
+#endif
+#endif
+#ifndef EXIT_WARNING
+#ifdef VMS
+#define EXIT_WARNING 1 /* VMS is very nonstandard */
+#else
+#define EXIT_WARNING 2
+#endif
+#endif
diff --git a/core/src/fxcodec/libjpeg/fpdfapi_jcapimin.c b/core/src/fxcodec/libjpeg/fpdfapi_jcapimin.c
index ec88cff26d..ec04fd2f15 100644
--- a/core/src/fxcodec/libjpeg/fpdfapi_jcapimin.c
+++ b/core/src/fxcodec/libjpeg/fpdfapi_jcapimin.c
@@ -1,283 +1,283 @@
-#if !defined(_FX_JPEG_TURBO_)
-/*
- * jcapimin.c
- *
- * Copyright (C) 1994-1998, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- * For conditions of distribution and use, see the accompanying README file.
- *
- * This file contains application interface code for the compression half
- * of the JPEG library. These are the "minimum" API routines that may be
- * needed in either the normal full-compression case or the transcoding-only
- * case.
- *
- * Most of the routines intended to be called directly by an application
- * are in this file or in jcapistd.c. But also see jcparam.c for
- * parameter-setup helper routines, jcomapi.c for routines shared by
- * compression and decompression, and jctrans.c for the transcoding case.
- */
-
-#define JPEG_INTERNALS
-#include "jinclude.h"
-#include "jpeglib.h"
-
-
-/*
- * Initialization of a JPEG compression object.
- * The error manager must already be set up (in case memory manager fails).
- */
-
-GLOBAL(void)
-jpeg_CreateCompress (j_compress_ptr cinfo, int version, size_t structsize)
-{
- int i;
-
- /* Guard against version mismatches between library and caller. */
- cinfo->mem = NULL; /* so jpeg_destroy knows mem mgr not called */
- if (version != JPEG_LIB_VERSION)
- ERREXIT2(cinfo, JERR_BAD_LIB_VERSION, JPEG_LIB_VERSION, version);
- if (structsize != SIZEOF(struct jpeg_compress_struct))
- ERREXIT2(cinfo, JERR_BAD_STRUCT_SIZE,
- (int) SIZEOF(struct jpeg_compress_struct), (int) structsize);
-
- /* For debugging purposes, we zero the whole master structure.
- * But the application has already set the err pointer, and may have set
- * client_data, so we have to save and restore those fields.
- * Note: if application hasn't set client_data, tools like Purify may
- * complain here.
- */
- {
- struct jpeg_error_mgr * err = cinfo->err;
- void * client_data = cinfo->client_data; /* ignore Purify complaint here */
- MEMZERO(cinfo, SIZEOF(struct jpeg_compress_struct));
- cinfo->err = err;
- cinfo->client_data = client_data;
- }
- cinfo->is_decompressor = FALSE;
-
- /* Initialize a memory manager instance for this object */
- jinit_memory_mgr((j_common_ptr) cinfo);
-
- /* Zero out pointers to permanent structures. */
- cinfo->progress = NULL;
- cinfo->dest = NULL;
-
- cinfo->comp_info = NULL;
-
- for (i = 0; i < NUM_QUANT_TBLS; i++)
- cinfo->quant_tbl_ptrs[i] = NULL;
-
- for (i = 0; i < NUM_HUFF_TBLS; i++) {
- cinfo->dc_huff_tbl_ptrs[i] = NULL;
- cinfo->ac_huff_tbl_ptrs[i] = NULL;
- }
-
- cinfo->script_space = NULL;
-
- cinfo->input_gamma = 1.0; /* in case application forgets */
-
- /* OK, I'm ready */
- cinfo->global_state = CSTATE_START;
-}
-
-
-/*
- * Destruction of a JPEG compression object
- */
-
-GLOBAL(void)
-jpeg_destroy_compress (j_compress_ptr cinfo)
-{
- jpeg_destroy((j_common_ptr) cinfo); /* use common routine */
-}
-
-
-/*
- * Abort processing of a JPEG compression operation,
- * but don't destroy the object itself.
- */
-
-GLOBAL(void)
-jpeg_abort_compress (j_compress_ptr cinfo)
-{
- jpeg_abort((j_common_ptr) cinfo); /* use common routine */
-}
-
-
-/*
- * Forcibly suppress or un-suppress all quantization and Huffman tables.
- * Marks all currently defined tables as already written (if suppress)
- * or not written (if !suppress). This will control whether they get emitted
- * by a subsequent jpeg_start_compress call.
- *
- * This routine is exported for use by applications that want to produce
- * abbreviated JPEG datastreams. It logically belongs in jcparam.c, but
- * since it is called by jpeg_start_compress, we put it here --- otherwise
- * jcparam.o would be linked whether the application used it or not.
- */
-
-GLOBAL(void)
-jpeg_suppress_tables (j_compress_ptr cinfo, boolean suppress)
-{
- int i;
- JQUANT_TBL * qtbl;
- JHUFF_TBL * htbl;
-
- for (i = 0; i < NUM_QUANT_TBLS; i++) {
- if ((qtbl = cinfo->quant_tbl_ptrs[i]) != NULL)
- qtbl->sent_table = suppress;
- }
-
- for (i = 0; i < NUM_HUFF_TBLS; i++) {
- if ((htbl = cinfo->dc_huff_tbl_ptrs[i]) != NULL)
- htbl->sent_table = suppress;
- if ((htbl = cinfo->ac_huff_tbl_ptrs[i]) != NULL)
- htbl->sent_table = suppress;
- }
-}
-
-
-/*
- * Finish JPEG compression.
- *
- * If a multipass operating mode was selected, this may do a great deal of
- * work including most of the actual output.
- */
-
-GLOBAL(void)
-jpeg_finish_compress (j_compress_ptr cinfo)
-{
- JDIMENSION iMCU_row;
-
- if (cinfo->global_state == CSTATE_SCANNING ||
- cinfo->global_state == CSTATE_RAW_OK) {
- /* Terminate first pass */
- if (cinfo->next_scanline < cinfo->image_height)
- ERREXIT(cinfo, JERR_TOO_LITTLE_DATA);
- (*cinfo->master->finish_pass) (cinfo);
- } else if (cinfo->global_state != CSTATE_WRCOEFS)
- ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
- /* Perform any remaining passes */
- while (! cinfo->master->is_last_pass) {
- (*cinfo->master->prepare_for_pass) (cinfo);
- for (iMCU_row = 0; iMCU_row < cinfo->total_iMCU_rows; iMCU_row++) {
- if (cinfo->progress != NULL) {
- cinfo->progress->pass_counter = (long) iMCU_row;
- cinfo->progress->pass_limit = (long) cinfo->total_iMCU_rows;
- (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
- }
- /* We bypass the main controller and invoke coef controller directly;
- * all work is being done from the coefficient buffer.
- */
- if (! (*cinfo->coef->compress_data) (cinfo, (JSAMPIMAGE) NULL))
- ERREXIT(cinfo, JERR_CANT_SUSPEND);
- }
- (*cinfo->master->finish_pass) (cinfo);
- }
- /* Write EOI, do final cleanup */
- (*cinfo->marker->write_file_trailer) (cinfo);
- (*cinfo->dest->term_destination) (cinfo);
- /* We can use jpeg_abort to release memory and reset global_state */
- jpeg_abort((j_common_ptr) cinfo);
-}
-
-
-/*
- * Write a special marker.
- * This is only recommended for writing COM or APPn markers.
- * Must be called after jpeg_start_compress() and before
- * first call to jpeg_write_scanlines() or jpeg_write_raw_data().
- */
-
-GLOBAL(void)
-jpeg_write_marker (j_compress_ptr cinfo, int marker,
- const JOCTET *dataptr, unsigned int datalen)
-{
- JMETHOD(void, write_marker_byte, (j_compress_ptr info, int val));
-
- if (cinfo->next_scanline != 0 ||
- (cinfo->global_state != CSTATE_SCANNING &&
- cinfo->global_state != CSTATE_RAW_OK &&
- cinfo->global_state != CSTATE_WRCOEFS))
- ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
-
- (*cinfo->marker->write_marker_header) (cinfo, marker, datalen);
- write_marker_byte = cinfo->marker->write_marker_byte; /* copy for speed */
- while (datalen--) {
- (*write_marker_byte) (cinfo, *dataptr);
- dataptr++;
- }
-}
-
-/* Same, but piecemeal. */
-
-GLOBAL(void)
-jpeg_write_m_header (j_compress_ptr cinfo, int marker, unsigned int datalen)
-{
- if (cinfo->next_scanline != 0 ||
- (cinfo->global_state != CSTATE_SCANNING &&
- cinfo->global_state != CSTATE_RAW_OK &&
- cinfo->global_state != CSTATE_WRCOEFS))
- ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
-
- (*cinfo->marker->write_marker_header) (cinfo, marker, datalen);
-}
-
-GLOBAL(void)
-jpeg_write_m_byte (j_compress_ptr cinfo, int val)
-{
- (*cinfo->marker->write_marker_byte) (cinfo, val);
-}
-
-
-/*
- * Alternate compression function: just write an abbreviated table file.
- * Before calling this, all parameters and a data destination must be set up.
- *
- * To produce a pair of files containing abbreviated tables and abbreviated
- * image data, one would proceed as follows:
- *
- * initialize JPEG object
- * set JPEG parameters
- * set destination to table file
- * jpeg_write_tables(cinfo);
- * set destination to image file
- * jpeg_start_compress(cinfo, FALSE);
- * write data...
- * jpeg_finish_compress(cinfo);
- *
- * jpeg_write_tables has the side effect of marking all tables written
- * (same as jpeg_suppress_tables(..., TRUE)). Thus a subsequent start_compress
- * will not re-emit the tables unless it is passed write_all_tables=TRUE.
- */
-
-GLOBAL(void)
-jpeg_write_tables (j_compress_ptr cinfo)
-{
- if (cinfo->global_state != CSTATE_START)
- ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
-
- /* (Re)initialize error mgr and destination modules */
- (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo);
- (*cinfo->dest->init_destination) (cinfo);
- /* Initialize the marker writer ... bit of a crock to do it here. */
- jinit_marker_writer(cinfo);
- /* Write them tables! */
- (*cinfo->marker->write_tables_only) (cinfo);
- /* And clean up. */
- (*cinfo->dest->term_destination) (cinfo);
- /*
- * In library releases up through v6a, we called jpeg_abort() here to free
- * any working memory allocated by the destination manager and marker
- * writer. Some applications had a problem with that: they allocated space
- * of their own from the library memory manager, and didn't want it to go
- * away during write_tables. So now we do nothing. This will cause a
- * memory leak if an app calls write_tables repeatedly without doing a full
- * compression cycle or otherwise resetting the JPEG object. However, that
- * seems less bad than unexpectedly freeing memory in the normal case.
- * An app that prefers the old behavior can call jpeg_abort for itself after
- * each call to jpeg_write_tables().
- */
-}
-
-#endif //_FX_JPEG_TURBO_
+#if !defined(_FX_JPEG_TURBO_)
+/*
+ * jcapimin.c
+ *
+ * Copyright (C) 1994-1998, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains application interface code for the compression half
+ * of the JPEG library. These are the "minimum" API routines that may be
+ * needed in either the normal full-compression case or the transcoding-only
+ * case.
+ *
+ * Most of the routines intended to be called directly by an application
+ * are in this file or in jcapistd.c. But also see jcparam.c for
+ * parameter-setup helper routines, jcomapi.c for routines shared by
+ * compression and decompression, and jctrans.c for the transcoding case.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+
+
+/*
+ * Initialization of a JPEG compression object.
+ * The error manager must already be set up (in case memory manager fails).
+ */
+
+GLOBAL(void)
+jpeg_CreateCompress (j_compress_ptr cinfo, int version, size_t structsize)
+{
+ int i;
+
+ /* Guard against version mismatches between library and caller. */
+ cinfo->mem = NULL; /* so jpeg_destroy knows mem mgr not called */
+ if (version != JPEG_LIB_VERSION)
+ ERREXIT2(cinfo, JERR_BAD_LIB_VERSION, JPEG_LIB_VERSION, version);
+ if (structsize != SIZEOF(struct jpeg_compress_struct))
+ ERREXIT2(cinfo, JERR_BAD_STRUCT_SIZE,
+ (int) SIZEOF(struct jpeg_compress_struct), (int) structsize);
+
+ /* For debugging purposes, we zero the whole master structure.
+ * But the application has already set the err pointer, and may have set
+ * client_data, so we have to save and restore those fields.
+ * Note: if application hasn't set client_data, tools like Purify may
+ * complain here.
+ */
+ {
+ struct jpeg_error_mgr * err = cinfo->err;
+ void * client_data = cinfo->client_data; /* ignore Purify complaint here */
+ MEMZERO(cinfo, SIZEOF(struct jpeg_compress_struct));
+ cinfo->err = err;
+ cinfo->client_data = client_data;
+ }
+ cinfo->is_decompressor = FALSE;
+
+ /* Initialize a memory manager instance for this object */
+ jinit_memory_mgr((j_common_ptr) cinfo);
+
+ /* Zero out pointers to permanent structures. */
+ cinfo->progress = NULL;
+ cinfo->dest = NULL;
+
+ cinfo->comp_info = NULL;
+
+ for (i = 0; i < NUM_QUANT_TBLS; i++)
+ cinfo->quant_tbl_ptrs[i] = NULL;
+
+ for (i = 0; i < NUM_HUFF_TBLS; i++) {
+ cinfo->dc_huff_tbl_ptrs[i] = NULL;
+ cinfo->ac_huff_tbl_ptrs[i] = NULL;
+ }
+
+ cinfo->script_space = NULL;
+
+ cinfo->input_gamma = 1.0; /* in case application forgets */
+
+ /* OK, I'm ready */
+ cinfo->global_state = CSTATE_START;
+}
+
+
+/*
+ * Destruction of a JPEG compression object
+ */
+
+GLOBAL(void)
+jpeg_destroy_compress (j_compress_ptr cinfo)
+{
+ jpeg_destroy((j_common_ptr) cinfo); /* use common routine */
+}
+
+
+/*
+ * Abort processing of a JPEG compression operation,
+ * but don't destroy the object itself.
+ */
+
+GLOBAL(void)
+jpeg_abort_compress (j_compress_ptr cinfo)
+{
+ jpeg_abort((j_common_ptr) cinfo); /* use common routine */
+}
+
+
+/*
+ * Forcibly suppress or un-suppress all quantization and Huffman tables.
+ * Marks all currently defined tables as already written (if suppress)
+ * or not written (if !suppress). This will control whether they get emitted
+ * by a subsequent jpeg_start_compress call.
+ *
+ * This routine is exported for use by applications that want to produce
+ * abbreviated JPEG datastreams. It logically belongs in jcparam.c, but
+ * since it is called by jpeg_start_compress, we put it here --- otherwise
+ * jcparam.o would be linked whether the application used it or not.
+ */
+
+GLOBAL(void)
+jpeg_suppress_tables (j_compress_ptr cinfo, boolean suppress)
+{
+ int i;
+ JQUANT_TBL * qtbl;
+ JHUFF_TBL * htbl;
+
+ for (i = 0; i < NUM_QUANT_TBLS; i++) {
+ if ((qtbl = cinfo->quant_tbl_ptrs[i]) != NULL)
+ qtbl->sent_table = suppress;
+ }
+
+ for (i = 0; i < NUM_HUFF_TBLS; i++) {
+ if ((htbl = cinfo->dc_huff_tbl_ptrs[i]) != NULL)
+ htbl->sent_table = suppress;
+ if ((htbl = cinfo->ac_huff_tbl_ptrs[i]) != NULL)
+ htbl->sent_table = suppress;
+ }
+}
+
+
+/*
+ * Finish JPEG compression.
+ *
+ * If a multipass operating mode was selected, this may do a great deal of
+ * work including most of the actual output.
+ */
+
+GLOBAL(void)
+jpeg_finish_compress (j_compress_ptr cinfo)
+{
+ JDIMENSION iMCU_row;
+
+ if (cinfo->global_state == CSTATE_SCANNING ||
+ cinfo->global_state == CSTATE_RAW_OK) {
+ /* Terminate first pass */
+ if (cinfo->next_scanline < cinfo->image_height)
+ ERREXIT(cinfo, JERR_TOO_LITTLE_DATA);
+ (*cinfo->master->finish_pass) (cinfo);
+ } else if (cinfo->global_state != CSTATE_WRCOEFS)
+ ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
+ /* Perform any remaining passes */
+ while (! cinfo->master->is_last_pass) {
+ (*cinfo->master->prepare_for_pass) (cinfo);
+ for (iMCU_row = 0; iMCU_row < cinfo->total_iMCU_rows; iMCU_row++) {
+ if (cinfo->progress != NULL) {
+ cinfo->progress->pass_counter = (long) iMCU_row;
+ cinfo->progress->pass_limit = (long) cinfo->total_iMCU_rows;
+ (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
+ }
+ /* We bypass the main controller and invoke coef controller directly;
+ * all work is being done from the coefficient buffer.
+ */
+ if (! (*cinfo->coef->compress_data) (cinfo, (JSAMPIMAGE) NULL))
+ ERREXIT(cinfo, JERR_CANT_SUSPEND);
+ }
+ (*cinfo->master->finish_pass) (cinfo);
+ }
+ /* Write EOI, do final cleanup */
+ (*cinfo->marker->write_file_trailer) (cinfo);
+ (*cinfo->dest->term_destination) (cinfo);
+ /* We can use jpeg_abort to release memory and reset global_state */
+ jpeg_abort((j_common_ptr) cinfo);
+}
+
+
+/*
+ * Write a special marker.
+ * This is only recommended for writing COM or APPn markers.
+ * Must be called after jpeg_start_compress() and before
+ * first call to jpeg_write_scanlines() or jpeg_write_raw_data().
+ */
+
+GLOBAL(void)
+jpeg_write_marker (j_compress_ptr cinfo, int marker,
+ const JOCTET *dataptr, unsigned int datalen)
+{
+ JMETHOD(void, write_marker_byte, (j_compress_ptr info, int val));
+
+ if (cinfo->next_scanline != 0 ||
+ (cinfo->global_state != CSTATE_SCANNING &&
+ cinfo->global_state != CSTATE_RAW_OK &&
+ cinfo->global_state != CSTATE_WRCOEFS))
+ ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
+
+ (*cinfo->marker->write_marker_header) (cinfo, marker, datalen);
+ write_marker_byte = cinfo->marker->write_marker_byte; /* copy for speed */
+ while (datalen--) {
+ (*write_marker_byte) (cinfo, *dataptr);
+ dataptr++;
+ }
+}
+
+/* Same, but piecemeal. */
+
+GLOBAL(void)
+jpeg_write_m_header (j_compress_ptr cinfo, int marker, unsigned int datalen)
+{
+ if (cinfo->next_scanline != 0 ||
+ (cinfo->global_state != CSTATE_SCANNING &&
+ cinfo->global_state != CSTATE_RAW_OK &&
+ cinfo->global_state != CSTATE_WRCOEFS))
+ ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
+
+ (*cinfo->marker->write_marker_header) (cinfo, marker, datalen);
+}
+
+GLOBAL(void)
+jpeg_write_m_byte (j_compress_ptr cinfo, int val)
+{
+ (*cinfo->marker->write_marker_byte) (cinfo, val);
+}
+
+
+/*
+ * Alternate compression function: just write an abbreviated table file.
+ * Before calling this, all parameters and a data destination must be set up.
+ *
+ * To produce a pair of files containing abbreviated tables and abbreviated
+ * image data, one would proceed as follows:
+ *
+ * initialize JPEG object
+ * set JPEG parameters
+ * set destination to table file
+ * jpeg_write_tables(cinfo);
+ * set destination to image file
+ * jpeg_start_compress(cinfo, FALSE);
+ * write data...
+ * jpeg_finish_compress(cinfo);
+ *
+ * jpeg_write_tables has the side effect of marking all tables written
+ * (same as jpeg_suppress_tables(..., TRUE)). Thus a subsequent start_compress
+ * will not re-emit the tables unless it is passed write_all_tables=TRUE.
+ */
+
+GLOBAL(void)
+jpeg_write_tables (j_compress_ptr cinfo)
+{
+ if (cinfo->global_state != CSTATE_START)
+ ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
+
+ /* (Re)initialize error mgr and destination modules */
+ (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo);
+ (*cinfo->dest->init_destination) (cinfo);
+ /* Initialize the marker writer ... bit of a crock to do it here. */
+ jinit_marker_writer(cinfo);
+ /* Write them tables! */
+ (*cinfo->marker->write_tables_only) (cinfo);
+ /* And clean up. */
+ (*cinfo->dest->term_destination) (cinfo);
+ /*
+ * In library releases up through v6a, we called jpeg_abort() here to free
+ * any working memory allocated by the destination manager and marker
+ * writer. Some applications had a problem with that: they allocated space
+ * of their own from the library memory manager, and didn't want it to go
+ * away during write_tables. So now we do nothing. This will cause a
+ * memory leak if an app calls write_tables repeatedly without doing a full
+ * compression cycle or otherwise resetting the JPEG object. However, that
+ * seems less bad than unexpectedly freeing memory in the normal case.
+ * An app that prefers the old behavior can call jpeg_abort for itself after
+ * each call to jpeg_write_tables().
+ */
+}
+
+#endif //_FX_JPEG_TURBO_
diff --git a/core/src/fxcodec/libjpeg/fpdfapi_jcapistd.c b/core/src/fxcodec/libjpeg/fpdfapi_jcapistd.c
index bf13542539..9d765e6f01 100644
--- a/core/src/fxcodec/libjpeg/fpdfapi_jcapistd.c
+++ b/core/src/fxcodec/libjpeg/fpdfapi_jcapistd.c
@@ -1,164 +1,164 @@
-#if !defined(_FX_JPEG_TURBO_)
-/*
- * jcapistd.c
- *
- * Copyright (C) 1994-1996, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- * For conditions of distribution and use, see the accompanying README file.
- *
- * This file contains application interface code for the compression half
- * of the JPEG library. These are the "standard" API routines that are
- * used in the normal full-compression case. They are not used by a
- * transcoding-only application. Note that if an application links in
- * jpeg_start_compress, it will end up linking in the entire compressor.
- * We thus must separate this file from jcapimin.c to avoid linking the
- * whole compression library into a transcoder.
- */
-
-#define JPEG_INTERNALS
-#include "jinclude.h"
-#include "jpeglib.h"
-
-
-/*
- * Compression initialization.
- * Before calling this, all parameters and a data destination must be set up.
- *
- * We require a write_all_tables parameter as a failsafe check when writing
- * multiple datastreams from the same compression object. Since prior runs
- * will have left all the tables marked sent_table=TRUE, a subsequent run
- * would emit an abbreviated stream (no tables) by default. This may be what
- * is wanted, but for safety's sake it should not be the default behavior:
- * programmers should have to make a deliberate choice to emit abbreviated
- * images. Therefore the documentation and examples should encourage people
- * to pass write_all_tables=TRUE; then it will take active thought to do the
- * wrong thing.
- */
-
-GLOBAL(void)
-jpeg_start_compress (j_compress_ptr cinfo, boolean write_all_tables)
-{
- if (cinfo->global_state != CSTATE_START)
- ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
-
- if (write_all_tables)
- jpeg_suppress_tables(cinfo, FALSE); /* mark all tables to be written */
-
- /* (Re)initialize error mgr and destination modules */
- (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo);
- (*cinfo->dest->init_destination) (cinfo);
- /* Perform master selection of active modules */
- jinit_compress_master(cinfo);
- /* Set up for the first pass */
- (*cinfo->master->prepare_for_pass) (cinfo);
- /* Ready for application to drive first pass through jpeg_write_scanlines
- * or jpeg_write_raw_data.
- */
- cinfo->next_scanline = 0;
- cinfo->global_state = (cinfo->raw_data_in ? CSTATE_RAW_OK : CSTATE_SCANNING);
-}
-
-
-/*
- * Write some scanlines of data to the JPEG compressor.
- *
- * The return value will be the number of lines actually written.
- * This should be less than the supplied num_lines only in case that
- * the data destination module has requested suspension of the compressor,
- * or if more than image_height scanlines are passed in.
- *
- * Note: we warn about excess calls to jpeg_write_scanlines() since
- * this likely signals an application programmer error. However,
- * excess scanlines passed in the last valid call are *silently* ignored,
- * so that the application need not adjust num_lines for end-of-image
- * when using a multiple-scanline buffer.
- */
-
-GLOBAL(JDIMENSION)
-jpeg_write_scanlines (j_compress_ptr cinfo, JSAMPARRAY scanlines,
- JDIMENSION num_lines)
-{
- JDIMENSION row_ctr, rows_left;
-
- if (cinfo->global_state != CSTATE_SCANNING)
- ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
- if (cinfo->next_scanline >= cinfo->image_height)
- WARNMS(cinfo, JWRN_TOO_MUCH_DATA);
-
- /* Call progress monitor hook if present */
- if (cinfo->progress != NULL) {
- cinfo->progress->pass_counter = (long) cinfo->next_scanline;
- cinfo->progress->pass_limit = (long) cinfo->image_height;
- (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
- }
-
- /* Give master control module another chance if this is first call to
- * jpeg_write_scanlines. This lets output of the frame/scan headers be
- * delayed so that application can write COM, etc, markers between
- * jpeg_start_compress and jpeg_write_scanlines.
- */
- if (cinfo->master->call_pass_startup)
- (*cinfo->master->pass_startup) (cinfo);
-
- /* Ignore any extra scanlines at bottom of image. */
- rows_left = cinfo->image_height - cinfo->next_scanline;
- if (num_lines > rows_left)
- num_lines = rows_left;
-
- row_ctr = 0;
- (*cinfo->main->process_data) (cinfo, scanlines, &row_ctr, num_lines);
- cinfo->next_scanline += row_ctr;
- return row_ctr;
-}
-
-
-/*
- * Alternate entry point to write raw data.
- * Processes exactly one iMCU row per call, unless suspended.
- */
-
-GLOBAL(JDIMENSION)
-jpeg_write_raw_data (j_compress_ptr cinfo, JSAMPIMAGE data,
- JDIMENSION num_lines)
-{
- JDIMENSION lines_per_iMCU_row;
-
- if (cinfo->global_state != CSTATE_RAW_OK)
- ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
- if (cinfo->next_scanline >= cinfo->image_height) {
- WARNMS(cinfo, JWRN_TOO_MUCH_DATA);
- return 0;
- }
-
- /* Call progress monitor hook if present */
- if (cinfo->progress != NULL) {
- cinfo->progress->pass_counter = (long) cinfo->next_scanline;
- cinfo->progress->pass_limit = (long) cinfo->image_height;
- (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
- }
-
- /* Give master control module another chance if this is first call to
- * jpeg_write_raw_data. This lets output of the frame/scan headers be
- * delayed so that application can write COM, etc, markers between
- * jpeg_start_compress and jpeg_write_raw_data.
- */
- if (cinfo->master->call_pass_startup)
- (*cinfo->master->pass_startup) (cinfo);
-
- /* Verify that at least one iMCU row has been passed. */
- lines_per_iMCU_row = cinfo->max_v_samp_factor * DCTSIZE;
- if (num_lines < lines_per_iMCU_row)
- ERREXIT(cinfo, JERR_BUFFER_SIZE);
-
- /* Directly compress the row. */
- if (! (*cinfo->coef->compress_data) (cinfo, data)) {
- /* If compressor did not consume the whole row, suspend processing. */
- return 0;
- }
-
- /* OK, we processed one iMCU row. */
- cinfo->next_scanline += lines_per_iMCU_row;
- return lines_per_iMCU_row;
-}
-
-#endif //_FX_JPEG_TURBO_
+#if !defined(_FX_JPEG_TURBO_)
+/*
+ * jcapistd.c
+ *
+ * Copyright (C) 1994-1996, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains application interface code for the compression half
+ * of the JPEG library. These are the "standard" API routines that are
+ * used in the normal full-compression case. They are not used by a
+ * transcoding-only application. Note that if an application links in
+ * jpeg_start_compress, it will end up linking in the entire compressor.
+ * We thus must separate this file from jcapimin.c to avoid linking the
+ * whole compression library into a transcoder.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+
+
+/*
+ * Compression initialization.
+ * Before calling this, all parameters and a data destination must be set up.
+ *
+ * We require a write_all_tables parameter as a failsafe check when writing
+ * multiple datastreams from the same compression object. Since prior runs
+ * will have left all the tables marked sent_table=TRUE, a subsequent run
+ * would emit an abbreviated stream (no tables) by default. This may be what
+ * is wanted, but for safety's sake it should not be the default behavior:
+ * programmers should have to make a deliberate choice to emit abbreviated
+ * images. Therefore the documentation and examples should encourage people
+ * to pass write_all_tables=TRUE; then it will take active thought to do the
+ * wrong thing.
+ */
+
+GLOBAL(void)
+jpeg_start_compress (j_compress_ptr cinfo, boolean write_all_tables)
+{
+ if (cinfo->global_state != CSTATE_START)
+ ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
+
+ if (write_all_tables)
+ jpeg_suppress_tables(cinfo, FALSE); /* mark all tables to be written */
+
+ /* (Re)initialize error mgr and destination modules */
+ (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo);
+ (*cinfo->dest->init_destination) (cinfo);
+ /* Perform master selection of active modules */
+ jinit_compress_master(cinfo);
+ /* Set up for the first pass */
+ (*cinfo->master->prepare_for_pass) (cinfo);
+ /* Ready for application to drive first pass through jpeg_write_scanlines
+ * or jpeg_write_raw_data.
+ */
+ cinfo->next_scanline = 0;
+ cinfo->global_state = (cinfo->raw_data_in ? CSTATE_RAW_OK : CSTATE_SCANNING);
+}
+
+
+/*
+ * Write some scanlines of data to the JPEG compressor.
+ *
+ * The return value will be the number of lines actually written.
+ * This should be less than the supplied num_lines only in case that
+ * the data destination module has requested suspension of the compressor,
+ * or if more than image_height scanlines are passed in.
+ *
+ * Note: we warn about excess calls to jpeg_write_scanlines() since
+ * this likely signals an application programmer error. However,
+ * excess scanlines passed in the last valid call are *silently* ignored,
+ * so that the application need not adjust num_lines for end-of-image
+ * when using a multiple-scanline buffer.
+ */
+
+GLOBAL(JDIMENSION)
+jpeg_write_scanlines (j_compress_ptr cinfo, JSAMPARRAY scanlines,
+ JDIMENSION num_lines)
+{
+ JDIMENSION row_ctr, rows_left;
+
+ if (cinfo->global_state != CSTATE_SCANNING)
+ ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
+ if (cinfo->next_scanline >= cinfo->image_height)
+ WARNMS(cinfo, JWRN_TOO_MUCH_DATA);
+
+ /* Call progress monitor hook if present */
+ if (cinfo->progress != NULL) {
+ cinfo->progress->pass_counter = (long) cinfo->next_scanline;
+ cinfo->progress->pass_limit = (long) cinfo->image_height;
+ (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
+ }
+
+ /* Give master control module another chance if this is first call to
+ * jpeg_write_scanlines. This lets output of the frame/scan headers be
+ * delayed so that application can write COM, etc, markers between
+ * jpeg_start_compress and jpeg_write_scanlines.
+ */
+ if (cinfo->master->call_pass_startup)
+ (*cinfo->master->pass_startup) (cinfo);
+
+ /* Ignore any extra scanlines at bottom of image. */
+ rows_left = cinfo->image_height - cinfo->next_scanline;
+ if (num_lines > rows_left)
+ num_lines = rows_left;
+
+ row_ctr = 0;
+ (*cinfo->main->process_data) (cinfo, scanlines, &row_ctr, num_lines);
+ cinfo->next_scanline += row_ctr;
+ return row_ctr;
+}
+
+
+/*
+ * Alternate entry point to write raw data.
+ * Processes exactly one iMCU row per call, unless suspended.
+ */
+
+GLOBAL(JDIMENSION)
+jpeg_write_raw_data (j_compress_ptr cinfo, JSAMPIMAGE data,
+ JDIMENSION num_lines)
+{
+ JDIMENSION lines_per_iMCU_row;
+
+ if (cinfo->global_state != CSTATE_RAW_OK)
+ ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
+ if (cinfo->next_scanline >= cinfo->image_height) {
+ WARNMS(cinfo, JWRN_TOO_MUCH_DATA);
+ return 0;
+ }
+
+ /* Call progress monitor hook if present */
+ if (cinfo->progress != NULL) {
+ cinfo->progress->pass_counter = (long) cinfo->next_scanline;
+ cinfo->progress->pass_limit = (long) cinfo->image_height;
+ (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
+ }
+
+ /* Give master control module another chance if this is first call to
+ * jpeg_write_raw_data. This lets output of the frame/scan headers be
+ * delayed so that application can write COM, etc, markers between
+ * jpeg_start_compress and jpeg_write_raw_data.
+ */
+ if (cinfo->master->call_pass_startup)
+ (*cinfo->master->pass_startup) (cinfo);
+
+ /* Verify that at least one iMCU row has been passed. */
+ lines_per_iMCU_row = cinfo->max_v_samp_factor * DCTSIZE;
+ if (num_lines < lines_per_iMCU_row)
+ ERREXIT(cinfo, JERR_BUFFER_SIZE);
+
+ /* Directly compress the row. */
+ if (! (*cinfo->coef->compress_data) (cinfo, data)) {
+ /* If compressor did not consume the whole row, suspend processing. */
+ return 0;
+ }
+
+ /* OK, we processed one iMCU row. */
+ cinfo->next_scanline += lines_per_iMCU_row;
+ return lines_per_iMCU_row;
+}
+
+#endif //_FX_JPEG_TURBO_
diff --git a/core/src/fxcodec/libjpeg/fpdfapi_jccoefct.c b/core/src/fxcodec/libjpeg/fpdfapi_jccoefct.c
index ea2a4a6cbb..08910ef6f3 100644
--- a/core/src/fxcodec/libjpeg/fpdfapi_jccoefct.c
+++ b/core/src/fxcodec/libjpeg/fpdfapi_jccoefct.c
@@ -1,452 +1,452 @@
-#if !defined(_FX_JPEG_TURBO_)
-/*
- * jccoefct.c
- *
- * Copyright (C) 1994-1997, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- * For conditions of distribution and use, see the accompanying README file.
- *
- * This file contains the coefficient buffer controller for compression.
- * This controller is the top level of the JPEG compressor proper.
- * The coefficient buffer lies between forward-DCT and entropy encoding steps.
- */
-
-#define JPEG_INTERNALS
-#include "jinclude.h"
-#include "jpeglib.h"
-
-
-/* We use a full-image coefficient buffer when doing Huffman optimization,
- * and also for writing multiple-scan JPEG files. In all cases, the DCT
- * step is run during the first pass, and subsequent passes need only read
- * the buffered coefficients.
- */
-#ifdef ENTROPY_OPT_SUPPORTED
-#define FULL_COEF_BUFFER_SUPPORTED
-#else
-#ifdef C_MULTISCAN_FILES_SUPPORTED
-#define FULL_COEF_BUFFER_SUPPORTED
-#endif
-#endif
-
-
-/* Private buffer controller object */
-
-typedef struct {
- struct jpeg_c_coef_controller pub; /* public fields */
-
- JDIMENSION iMCU_row_num; /* iMCU row # within image */
- JDIMENSION mcu_ctr; /* counts MCUs processed in current row */
- int MCU_vert_offset; /* counts MCU rows within iMCU row */
- int MCU_rows_per_iMCU_row; /* number of such rows needed */
-
- /* For single-pass compression, it's sufficient to buffer just one MCU
- * (although this may prove a bit slow in practice). We allocate a
- * workspace of C_MAX_BLOCKS_IN_MCU coefficient blocks, and reuse it for each
- * MCU constructed and sent. (On 80x86, the workspace is FAR even though
- * it's not really very big; this is to keep the module interfaces unchanged
- * when a large coefficient buffer is necessary.)
- * In multi-pass modes, this array points to the current MCU's blocks
- * within the virtual arrays.
- */
- JBLOCKROW MCU_buffer[C_MAX_BLOCKS_IN_MCU];
-
- /* In multi-pass modes, we need a virtual block array for each component. */
- jvirt_barray_ptr whole_image[MAX_COMPONENTS];
-} my_coef_controller;
-
-typedef my_coef_controller * my_coef_ptr;
-
-
-/* Forward declarations */
-METHODDEF(boolean) compress_data
- JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf));
-#ifdef FULL_COEF_BUFFER_SUPPORTED
-METHODDEF(boolean) compress_first_pass
- JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf));
-METHODDEF(boolean) compress_output
- JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf));
-#endif
-
-
-LOCAL(void)
-start_iMCU_row (j_compress_ptr cinfo)
-/* Reset within-iMCU-row counters for a new row */
-{
- my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
-
- /* In an interleaved scan, an MCU row is the same as an iMCU row.
- * In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows.
- * But at the bottom of the image, process only what's left.
- */
- if (cinfo->comps_in_scan > 1) {
- coef->MCU_rows_per_iMCU_row = 1;
- } else {
- if (coef->iMCU_row_num < (cinfo->total_iMCU_rows-1))
- coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->v_samp_factor;
- else
- coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->last_row_height;
- }
-
- coef->mcu_ctr = 0;
- coef->MCU_vert_offset = 0;
-}
-
-
-/*
- * Initialize for a processing pass.
- */
-
-METHODDEF(void)
-start_pass_coef (j_compress_ptr cinfo, J_BUF_MODE pass_mode)
-{
- my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
-
- coef->iMCU_row_num = 0;
- start_iMCU_row(cinfo);
-
- switch (pass_mode) {
- case JBUF_PASS_THRU:
- if (coef->whole_image[0] != NULL)
- ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
- coef->pub.compress_data = compress_data;
- break;
-#ifdef FULL_COEF_BUFFER_SUPPORTED
- case JBUF_SAVE_AND_PASS:
- if (coef->whole_image[0] == NULL)
- ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
- coef->pub.compress_data = compress_first_pass;
- break;
- case JBUF_CRANK_DEST:
- if (coef->whole_image[0] == NULL)
- ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
- coef->pub.compress_data = compress_output;
- break;
-#endif
- default:
- ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
- break;
- }
-}
-
-
-/*
- * Process some data in the single-pass case.
- * We process the equivalent of one fully interleaved MCU row ("iMCU" row)
- * per call, ie, v_samp_factor block rows for each component in the image.
- * Returns TRUE if the iMCU row is completed, FALSE if suspended.
- *
- * NB: input_buf contains a plane for each component in image,
- * which we index according to the component's SOF position.
- */
-
-METHODDEF(boolean)
-compress_data (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
-{
- my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
- JDIMENSION MCU_col_num; /* index of current MCU within row */
- JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1;
- JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;
- int blkn, bi, ci, yindex, yoffset, blockcnt;
- JDIMENSION ypos, xpos;
- jpeg_component_info *compptr;
-
- /* Loop to write as much as one whole iMCU row */
- for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;
- yoffset++) {
- for (MCU_col_num = coef->mcu_ctr; MCU_col_num <= last_MCU_col;
- MCU_col_num++) {
- /* Determine where data comes from in input_buf and do the DCT thing.
- * Each call on forward_DCT processes a horizontal row of DCT blocks
- * as wide as an MCU; we rely on having allocated the MCU_buffer[] blocks
- * sequentially. Dummy blocks at the right or bottom edge are filled in
- * specially. The data in them does not matter for image reconstruction,
- * so we fill them with values that will encode to the smallest amount of
- * data, viz: all zeroes in the AC entries, DC entries equal to previous
- * block's DC value. (Thanks to Thomas Kinsman for this idea.)
- */
- blkn = 0;
- for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
- compptr = cinfo->cur_comp_info[ci];
- blockcnt = (MCU_col_num < last_MCU_col) ? compptr->MCU_width
- : compptr->last_col_width;
- xpos = MCU_col_num * compptr->MCU_sample_width;
- ypos = yoffset * DCTSIZE; /* ypos == (yoffset+yindex) * DCTSIZE */
- for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
- if (coef->iMCU_row_num < last_iMCU_row ||
- yoffset+yindex < compptr->last_row_height) {
- (*cinfo->fdct->forward_DCT) (cinfo, compptr,
- input_buf[compptr->component_index],
- coef->MCU_buffer[blkn],
- ypos, xpos, (JDIMENSION) blockcnt);
- if (blockcnt < compptr->MCU_width) {
- /* Create some dummy blocks at the right edge of the image. */
- jzero_far((void FAR *) coef->MCU_buffer[blkn + blockcnt],
- (compptr->MCU_width - blockcnt) * SIZEOF(JBLOCK));
- for (bi = blockcnt; bi < compptr->MCU_width; bi++) {
- coef->MCU_buffer[blkn+bi][0][0] = coef->MCU_buffer[blkn+bi-1][0][0];
- }
- }
- } else {
- /* Create a row of dummy blocks at the bottom of the image. */
- jzero_far((void FAR *) coef->MCU_buffer[blkn],
- compptr->MCU_width * SIZEOF(JBLOCK));
- for (bi = 0; bi < compptr->MCU_width; bi++) {
- coef->MCU_buffer[blkn+bi][0][0] = coef->MCU_buffer[blkn-1][0][0];
- }
- }
- blkn += compptr->MCU_width;
- ypos += DCTSIZE;
- }
- }
- /* Try to write the MCU. In event of a suspension failure, we will
- * re-DCT the MCU on restart (a bit inefficient, could be fixed...)
- */
- if (! (*cinfo->entropy->encode_mcu) (cinfo, coef->MCU_buffer)) {
- /* Suspension forced; update state counters and exit */
- coef->MCU_vert_offset = yoffset;
- coef->mcu_ctr = MCU_col_num;
- return FALSE;
- }
- }
- /* Completed an MCU row, but perhaps not an iMCU row */
- coef->mcu_ctr = 0;
- }
- /* Completed the iMCU row, advance counters for next one */
- coef->iMCU_row_num++;
- start_iMCU_row(cinfo);
- return TRUE;
-}
-
-
-#ifdef FULL_COEF_BUFFER_SUPPORTED
-
-/*
- * Process some data in the first pass of a multi-pass case.
- * We process the equivalent of one fully interleaved MCU row ("iMCU" row)
- * per call, ie, v_samp_factor block rows for each component in the image.
- * This amount of data is read from the source buffer, DCT'd and quantized,
- * and saved into the virtual arrays. We also generate suitable dummy blocks
- * as needed at the right and lower edges. (The dummy blocks are constructed
- * in the virtual arrays, which have been padded appropriately.) This makes
- * it possible for subsequent passes not to worry about real vs. dummy blocks.
- *
- * We must also emit the data to the entropy encoder. This is conveniently
- * done by calling compress_output() after we've loaded the current strip
- * of the virtual arrays.
- *
- * NB: input_buf contains a plane for each component in image. All
- * components are DCT'd and loaded into the virtual arrays in this pass.
- * However, it may be that only a subset of the components are emitted to
- * the entropy encoder during this first pass; be careful about looking
- * at the scan-dependent variables (MCU dimensions, etc).
- */
-
-METHODDEF(boolean)
-compress_first_pass (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
-{
- my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
- JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;
- JDIMENSION blocks_across, MCUs_across, MCUindex;
- int bi, ci, h_samp_factor, block_row, block_rows, ndummy;
- JCOEF lastDC;
- jpeg_component_info *compptr;
- JBLOCKARRAY buffer;
- JBLOCKROW thisblockrow, lastblockrow;
-
- for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
- ci++, compptr++) {
- /* Align the virtual buffer for this component. */
- buffer = (*cinfo->mem->access_virt_barray)
- ((j_common_ptr) cinfo, coef->whole_image[ci],
- coef->iMCU_row_num * compptr->v_samp_factor,
- (JDIMENSION) compptr->v_samp_factor, TRUE);
- /* Count non-dummy DCT block rows in this iMCU row. */
- if (coef->iMCU_row_num < last_iMCU_row)
- block_rows = compptr->v_samp_factor;
- else {
- /* NB: can't use last_row_height here, since may not be set! */
- block_rows = (int) (compptr->height_in_blocks % compptr->v_samp_factor);
- if (block_rows == 0) block_rows = compptr->v_samp_factor;
- }
- blocks_across = compptr->width_in_blocks;
- h_samp_factor = compptr->h_samp_factor;
- /* Count number of dummy blocks to be added at the right margin. */
- ndummy = (int) (blocks_across % h_samp_factor);
- if (ndummy > 0)
- ndummy = h_samp_factor - ndummy;
- /* Perform DCT for all non-dummy blocks in this iMCU row. Each call
- * on forward_DCT processes a complete horizontal row of DCT blocks.
- */
- for (block_row = 0; block_row < block_rows; block_row++) {
- thisblockrow = buffer[block_row];
- (*cinfo->fdct->forward_DCT) (cinfo, compptr,
- input_buf[ci], thisblockrow,
- (JDIMENSION) (block_row * DCTSIZE),
- (JDIMENSION) 0, blocks_across);
- if (ndummy > 0) {
- /* Create dummy blocks at the right edge of the image. */
- thisblockrow += blocks_across; /* => first dummy block */
- jzero_far((void FAR *) thisblockrow, ndummy * SIZEOF(JBLOCK));
- lastDC = thisblockrow[-1][0];
- for (bi = 0; bi < ndummy; bi++) {
- thisblockrow[bi][0] = lastDC;
- }
- }
- }
- /* If at end of image, create dummy block rows as needed.
- * The tricky part here is that within each MCU, we want the DC values
- * of the dummy blocks to match the last real block's DC value.
- * This squeezes a few more bytes out of the resulting file...
- */
- if (coef->iMCU_row_num == last_iMCU_row) {
- blocks_across += ndummy; /* include lower right corner */
- MCUs_across = blocks_across / h_samp_factor;
- for (block_row = block_rows; block_row < compptr->v_samp_factor;
- block_row++) {
- thisblockrow = buffer[block_row];
- lastblockrow = buffer[block_row-1];
- jzero_far((void FAR *) thisblockrow,
- (size_t) (blocks_across * SIZEOF(JBLOCK)));
- for (MCUindex = 0; MCUindex < MCUs_across; MCUindex++) {
- lastDC = lastblockrow[h_samp_factor-1][0];
- for (bi = 0; bi < h_samp_factor; bi++) {
- thisblockrow[bi][0] = lastDC;
- }
- thisblockrow += h_samp_factor; /* advance to next MCU in row */
- lastblockrow += h_samp_factor;
- }
- }
- }
- }
- /* NB: compress_output will increment iMCU_row_num if successful.
- * A suspension return will result in redoing all the work above next time.
- */
-
- /* Emit data to the entropy encoder, sharing code with subsequent passes */
- return compress_output(cinfo, input_buf);
-}
-
-
-/*
- * Process some data in subsequent passes of a multi-pass case.
- * We process the equivalent of one fully interleaved MCU row ("iMCU" row)
- * per call, ie, v_samp_factor block rows for each component in the scan.
- * The data is obtained from the virtual arrays and fed to the entropy coder.
- * Returns TRUE if the iMCU row is completed, FALSE if suspended.
- *
- * NB: input_buf is ignored; it is likely to be a NULL pointer.
- */
-
-METHODDEF(boolean)
-compress_output (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
-{
- my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
- JDIMENSION MCU_col_num; /* index of current MCU within row */
- int blkn, ci, xindex, yindex, yoffset;
- JDIMENSION start_col;
- JBLOCKARRAY buffer[MAX_COMPS_IN_SCAN];
- JBLOCKROW buffer_ptr;
- jpeg_component_info *compptr;
-
- /* Align the virtual buffers for the components used in this scan.
- * NB: during first pass, this is safe only because the buffers will
- * already be aligned properly, so jmemmgr.c won't need to do any I/O.
- */
- for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
- compptr = cinfo->cur_comp_info[ci];
- buffer[ci] = (*cinfo->mem->access_virt_barray)
- ((j_common_ptr) cinfo, coef->whole_image[compptr->component_index],
- coef->iMCU_row_num * compptr->v_samp_factor,
- (JDIMENSION) compptr->v_samp_factor, FALSE);
- }
-
- /* Loop to process one whole iMCU row */
- for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;
- yoffset++) {
- for (MCU_col_num = coef->mcu_ctr; MCU_col_num < cinfo->MCUs_per_row;
- MCU_col_num++) {
- /* Construct list of pointers to DCT blocks belonging to this MCU */
- blkn = 0; /* index of current DCT block within MCU */
- for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
- compptr = cinfo->cur_comp_info[ci];
- start_col = MCU_col_num * compptr->MCU_width;
- for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
- buffer_ptr = buffer[ci][yindex+yoffset] + start_col;
- for (xindex = 0; xindex < compptr->MCU_width; xindex++) {
- coef->MCU_buffer[blkn++] = buffer_ptr++;
- }
- }
- }
- /* Try to write the MCU. */
- if (! (*cinfo->entropy->encode_mcu) (cinfo, coef->MCU_buffer)) {
- /* Suspension forced; update state counters and exit */
- coef->MCU_vert_offset = yoffset;
- coef->mcu_ctr = MCU_col_num;
- return FALSE;
- }
- }
- /* Completed an MCU row, but perhaps not an iMCU row */
- coef->mcu_ctr = 0;
- }
- /* Completed the iMCU row, advance counters for next one */
- coef->iMCU_row_num++;
- start_iMCU_row(cinfo);
- return TRUE;
-}
-
-#endif /* FULL_COEF_BUFFER_SUPPORTED */
-
-
-/*
- * Initialize coefficient buffer controller.
- */
-
-GLOBAL(void)
-jinit_c_coef_controller (j_compress_ptr cinfo, boolean need_full_buffer)
-{
- my_coef_ptr coef;
-
- coef = (my_coef_ptr)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- SIZEOF(my_coef_controller));
- cinfo->coef = (struct jpeg_c_coef_controller *) coef;
- coef->pub.start_pass = start_pass_coef;
-
- /* Create the coefficient buffer. */
- if (need_full_buffer) {
-#ifdef FULL_COEF_BUFFER_SUPPORTED
- /* Allocate a full-image virtual array for each component, */
- /* padded to a multiple of samp_factor DCT blocks in each direction. */
- int ci;
- jpeg_component_info *compptr;
-
- for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
- ci++, compptr++) {
- coef->whole_image[ci] = (*cinfo->mem->request_virt_barray)
- ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,
- (JDIMENSION) jround_up((long) compptr->width_in_blocks,
- (long) compptr->h_samp_factor),
- (JDIMENSION) jround_up((long) compptr->height_in_blocks,
- (long) compptr->v_samp_factor),
- (JDIMENSION) compptr->v_samp_factor);
- }
-#else
- ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
-#endif
- } else {
- /* We only need a single-MCU buffer. */
- JBLOCKROW buffer;
- int i;
-
- buffer = (JBLOCKROW)
- (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- C_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK));
- for (i = 0; i < C_MAX_BLOCKS_IN_MCU; i++) {
- coef->MCU_buffer[i] = buffer + i;
- }
- coef->whole_image[0] = NULL; /* flag for no virtual arrays */
- }
-}
-
-#endif //_FX_JPEG_TURBO_
+#if !defined(_FX_JPEG_TURBO_)
+/*
+ * jccoefct.c
+ *
+ * Copyright (C) 1994-1997, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains the coefficient buffer controller for compression.
+ * This controller is the top level of the JPEG compressor proper.
+ * The coefficient buffer lies between forward-DCT and entropy encoding steps.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+
+
+/* We use a full-image coefficient buffer when doing Huffman optimization,
+ * and also for writing multiple-scan JPEG files. In all cases, the DCT
+ * step is run during the first pass, and subsequent passes need only read
+ * the buffered coefficients.
+ */
+#ifdef ENTROPY_OPT_SUPPORTED
+#define FULL_COEF_BUFFER_SUPPORTED
+#else
+#ifdef C_MULTISCAN_FILES_SUPPORTED
+#define FULL_COEF_BUFFER_SUPPORTED
+#endif
+#endif
+
+
+/* Private buffer controller object */
+
+typedef struct {
+ struct jpeg_c_coef_controller pub; /* public fields */
+
+ JDIMENSION iMCU_row_num; /* iMCU row # within image */
+ JDIMENSION mcu_ctr; /* counts MCUs processed in current row */
+ int MCU_vert_offset; /* counts MCU rows within iMCU row */
+ int MCU_rows_per_iMCU_row; /* number of such rows needed */
+
+ /* For single-pass compression, it's sufficient to buffer just one MCU
+ * (although this may prove a bit slow in practice). We allocate a
+ * workspace of C_MAX_BLOCKS_IN_MCU coefficient blocks, and reuse it for each
+ * MCU constructed and sent. (On 80x86, the workspace is FAR even though
+ * it's not really very big; this is to keep the module interfaces unchanged
+ * when a large coefficient buffer is necessary.)
+ * In multi-pass modes, this array points to the current MCU's blocks
+ * within the virtual arrays.
+ */
+ JBLOCKROW MCU_buffer[C_MAX_BLOCKS_IN_MCU];
+
+ /* In multi-pass modes, we need a virtual block array for each component. */
+ jvirt_barray_ptr whole_image[MAX_COMPONENTS];
+} my_coef_controller;
+
+typedef my_coef_controller * my_coef_ptr;
+
+
+/* Forward declarations */
+METHODDEF(boolean) compress_data
+ JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf));
+#ifdef FULL_COEF_BUFFER_SUPPORTED
+METHODDEF(boolean) compress_first_pass
+ JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf));
+METHODDEF(boolean) compress_output
+ JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf));
+#endif
+
+
+LOCAL(void)
+start_iMCU_row (j_compress_ptr cinfo)
+/* Reset within-iMCU-row counters for a new row */
+{
+ my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
+
+ /* In an interleaved scan, an MCU row is the same as an iMCU row.
+ * In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows.
+ * But at the bottom of the image, process only what's left.
+ */
+ if (cinfo->comps_in_scan > 1) {
+ coef->MCU_rows_per_iMCU_row = 1;
+ } else {
+ if (coef->iMCU_row_num < (cinfo->total_iMCU_rows-1))
+ coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->v_samp_factor;
+ else
+ coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->last_row_height;
+ }
+
+ coef->mcu_ctr = 0;
+ coef->MCU_vert_offset = 0;
+}
+
+
+/*
+ * Initialize for a processing pass.
+ */
+
+METHODDEF(void)
+start_pass_coef (j_compress_ptr cinfo, J_BUF_MODE pass_mode)
+{
+ my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
+
+ coef->iMCU_row_num = 0;
+ start_iMCU_row(cinfo);
+
+ switch (pass_mode) {
+ case JBUF_PASS_THRU:
+ if (coef->whole_image[0] != NULL)
+ ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
+ coef->pub.compress_data = compress_data;
+ break;
+#ifdef FULL_COEF_BUFFER_SUPPORTED
+ case JBUF_SAVE_AND_PASS:
+ if (coef->whole_image[0] == NULL)
+ ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
+ coef->pub.compress_data = compress_first_pass;
+ break;
+ case JBUF_CRANK_DEST:
+ if (coef->whole_image[0] == NULL)
+ ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
+ coef->pub.compress_data = compress_output;
+ break;
+#endif
+ default:
+ ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
+ break;
+ }
+}
+
+
+/*
+ * Process some data in the single-pass case.
+ * We process the equivalent of one fully interleaved MCU row ("iMCU" row)
+ * per call, ie, v_samp_factor block rows for each component in the image.
+ * Returns TRUE if the iMCU row is completed, FALSE if suspended.
+ *
+ * NB: input_buf contains a plane for each component in image,
+ * which we index according to the component's SOF position.
+ */
+
+METHODDEF(boolean)
+compress_data (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
+{
+ my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
+ JDIMENSION MCU_col_num; /* index of current MCU within row */
+ JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1;
+ JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;
+ int blkn, bi, ci, yindex, yoffset, blockcnt;
+ JDIMENSION ypos, xpos;
+ jpeg_component_info *compptr;
+
+ /* Loop to write as much as one whole iMCU row */
+ for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;
+ yoffset++) {
+ for (MCU_col_num = coef->mcu_ctr; MCU_col_num <= last_MCU_col;
+ MCU_col_num++) {
+ /* Determine where data comes from in input_buf and do the DCT thing.
+ * Each call on forward_DCT processes a horizontal row of DCT blocks
+ * as wide as an MCU; we rely on having allocated the MCU_buffer[] blocks
+ * sequentially. Dummy blocks at the right or bottom edge are filled in
+ * specially. The data in them does not matter for image reconstruction,
+ * so we fill them with values that will encode to the smallest amount of
+ * data, viz: all zeroes in the AC entries, DC entries equal to previous
+ * block's DC value. (Thanks to Thomas Kinsman for this idea.)
+ */
+ blkn = 0;
+ for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
+ compptr = cinfo->cur_comp_info[ci];
+ blockcnt = (MCU_col_num < last_MCU_col) ? compptr->MCU_width
+ : compptr->last_col_width;
+ xpos = MCU_col_num * compptr->MCU_sample_width;
+ ypos = yoffset * DCTSIZE; /* ypos == (yoffset+yindex) * DCTSIZE */
+ for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
+ if (coef->iMCU_row_num < last_iMCU_row ||
+ yoffset+yindex < compptr->last_row_height) {
+ (*cinfo->fdct->forward_DCT) (cinfo, compptr,
+ input_buf[compptr->component_index],
+ coef->MCU_buffer[blkn],
+ ypos, xpos, (JDIMENSION) blockcnt);
+ if (blockcnt < compptr->MCU_width) {
+ /* Create some dummy blocks at the right edge of the image. */
+ jzero_far((void FAR *) coef->MCU_buffer[blkn + blockcnt],
+ (compptr->MCU_width - blockcnt) * SIZEOF(JBLOCK));
+ for (bi = blockcnt; bi < compptr->MCU_width; bi++) {
+ coef->MCU_buffer[blkn+bi][0][0] = coef->MCU_buffer[blkn+bi-1][0][0];
+ }
+ }
+ } else {
+ /* Create a row of dummy blocks at the bottom of the image. */
+ jzero_far((void FAR *) coef->MCU_buffer[blkn],
+ compptr->MCU_width * SIZEOF(JBLOCK));
+ for (bi = 0; bi < compptr->MCU_width; bi++) {
+ coef->MCU_buffer[blkn+bi][0][0] = coef->MCU_buffer[blkn-1][0][0];
+ }
+ }
+ blkn += compptr->MCU_width;
+ ypos += DCTSIZE;
+ }
+ }
+ /* Try to write the MCU. In event of a suspension failure, we will
+ * re-DCT the MCU on restart (a bit inefficient, could be fixed...)
+ */
+ if (! (*cinfo->entropy->encode_mcu) (cinfo, coef->MCU_buffer)) {
+ /* Suspension forced; update state counters and exit */
+ coef->MCU_vert_offset = yoffset;
+ coef->mcu_ctr = MCU_col_num;
+ return FALSE;
+ }
+ }
+ /* Completed an MCU row, but perhaps not an iMCU row */
+ coef->mcu_ctr = 0;
+ }
+ /* Completed the iMCU row, advance counters for next one */
+ coef->iMCU_row_num++;
+ start_iMCU_row(cinfo);
+ return TRUE;
+}
+
+
+#ifdef FULL_COEF_BUFFER_SUPPORTED
+
+/*
+ * Process some data in the first pass of a multi-pass case.
+ * We process the equivalent of one fully interleaved MCU row ("iMCU" row)
+ * per call, ie, v_samp_factor block rows for each component in the image.
+ * This amount of data is read from the source buffer, DCT'd and quantized,
+ * and saved into the virtual arrays. We also generate suitable dummy blocks
+ * as needed at the right and lower edges. (The dummy blocks are constructed
+ * in the virtual arrays, which have been padded appropriately.) This makes
+ * it possible for subsequent passes not to worry about real vs. dummy blocks.
+ *
+ * We must also emit the data to the entropy encoder. This is conveniently
+ * done by calling compress_output() after we've loaded the current strip
+ * of the virtual arrays.
+ *
+ * NB: input_buf contains a plane for each component in image. All
+ * components are DCT'd and loaded into the virtual arrays in this pass.
+ * However, it may be that only a subset of the components are emitted to
+ * the entropy encoder during this first pass; be careful about looking
+ * at the scan-dependent variables (MCU dimensions, etc).
+ */
+
+METHODDEF(boolean)
+compress_first_pass (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
+{
+ my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
+ JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;
+ JDIMENSION blocks_across, MCUs_across, MCUindex;
+ int bi, ci, h_samp_factor, block_row, block_rows, ndummy;
+ JCOEF lastDC;
+ jpeg_component_info *compptr;
+ JBLOCKARRAY buffer;
+ JBLOCKROW thisblockrow, lastblockrow;
+
+ for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+ ci++, compptr++) {
+ /* Align the virtual buffer for this component. */
+ buffer = (*cinfo->mem->access_virt_barray)
+ ((j_common_ptr) cinfo, coef->whole_image[ci],
+ coef->iMCU_row_num * compptr->v_samp_factor,
+ (JDIMENSION) compptr->v_samp_factor, TRUE);
+ /* Count non-dummy DCT block rows in this iMCU row. */
+ if (coef->iMCU_row_num < last_iMCU_row)
+ block_rows = compptr->v_samp_factor;
+ else {
+ /* NB: can't use last_row_height here, since may not be set! */
+ block_rows = (int) (compptr->height_in_blocks % compptr->v_samp_factor);
+ if (block_rows == 0) block_rows = compptr->v_samp_factor;
+ }
+ blocks_across = compptr->width_in_blocks;
+ h_samp_factor = compptr->h_samp_factor;
+ /* Count number of dummy blocks to be added at the right margin. */
+ ndummy = (int) (blocks_across % h_samp_factor);
+ if (ndummy > 0)
+ ndummy = h_samp_factor - ndummy;
+ /* Perform DCT for all non-dummy blocks in this iMCU row. Each call
+ * on forward_DCT processes a complete horizontal row of DCT blocks.
+ */
+ for (block_row = 0; block_row < block_rows; block_row++) {
+ thisblockrow = buffer[block_row];
+ (*cinfo->fdct->forward_DCT) (cinfo, compptr,
+ input_buf[ci], thisblockrow,
+ (JDIMENSION) (block_row * DCTSIZE),
+ (JDIMENSION) 0, blocks_across);
+ if (ndummy > 0) {
+ /* Create dummy blocks at the right edge of the image. */
+ thisblockrow += blocks_across; /* => first dummy block */
+ jzero_far((void FAR *) thisblockrow, ndummy * SIZEOF(JBLOCK));
+ lastDC = thisblockrow[-1][0];
+ for (bi = 0; bi < ndummy; bi++) {
+ thisblockrow[bi][0] = lastDC;
+ }
+ }
+ }
+ /* If at end of image, create dummy block rows as needed.
+ * The tricky part here is that within each MCU, we want the DC values
+ * of the dummy blocks to match the last real block's DC value.
+ * This squeezes a few more bytes out of the resulting file...
+ */
+ if (coef->iMCU_row_num == last_iMCU_row) {
+ blocks_across += ndummy; /* include lower right corner */
+ MCUs_across = blocks_across / h_samp_factor;
+ for (block_row = block_rows; block_row < compptr->v_samp_factor;
+ block_row++) {
+ thisblockrow = buffer[block_row];
+ lastblockrow = buffer[block_row-1];
+ jzero_far((void FAR *) thisblockrow,
+ (size_t) (blocks_across * SIZEOF(JBLOCK)));
+ for (MCUindex = 0; MCUindex < MCUs_across; MCUindex++) {
+ lastDC = lastblockrow[h_samp_factor-1][0];
+ for (bi = 0; bi < h_samp_factor; bi++) {
+ thisblockrow[bi][0] = lastDC;
+ }
+ thisblockrow += h_samp_factor; /* advance to next MCU in row */
+ lastblockrow += h_samp_factor;
+ }
+ }
+ }
+ }
+ /* NB: compress_output will increment iMCU_row_num if successful.
+ * A suspension return will result in redoing all the work above next time.
+ */
+
+ /* Emit data to the entropy encoder, sharing code with subsequent passes */
+ return compress_output(cinfo, input_buf);
+}
+
+
+/*
+ * Process some data in subsequent passes of a multi-pass case.
+ * We process the equivalent of one fully interleaved MCU row ("iMCU" row)
+ * per call, ie, v_samp_factor block rows for each component in the scan.
+ * The data is obtained from the virtual arrays and fed to the entropy coder.
+ * Returns TRUE if the iMCU row is completed, FALSE if suspended.
+ *
+ * NB: input_buf is ignored; it is likely to be a NULL pointer.
+ */
+
+METHODDEF(boolean)
+compress_output (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
+{
+ my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
+ JDIMENSION MCU_col_num; /* index of current MCU within row */
+ int blkn, ci, xindex, yindex, yoffset;
+ JDIMENSION start_col;
+ JBLOCKARRAY buffer[MAX_COMPS_IN_SCAN];
+ JBLOCKROW buffer_ptr;
+ jpeg_component_info *compptr;
+
+ /* Align the virtual buffers for the components used in this scan.
+ * NB: during first pass, this is safe only because the buffers will
+ * already be aligned properly, so jmemmgr.c won't need to do any I/O.
+ */
+ for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
+ compptr = cinfo->cur_comp_info[ci];
+ buffer[ci] = (*cinfo->mem->access_virt_barray)
+ ((j_common_ptr) cinfo, coef->whole_image[compptr->component_index],
+ coef->iMCU_row_num * compptr->v_samp_factor,
+ (JDIMENSION) compptr->v_samp_factor, FALSE);
+ }
+
+ /* Loop to process one whole iMCU row */
+ for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;
+ yoffset++) {
+ for (MCU_col_num = coef->mcu_ctr; MCU_col_num < cinfo->MCUs_per_row;
+ MCU_col_num++) {
+ /* Construct list of pointers to DCT blocks belonging to this MCU */
+ blkn = 0; /* index of current DCT block within MCU */
+ for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
+ compptr = cinfo->cur_comp_info[ci];
+ start_col = MCU_col_num * compptr->MCU_width;
+ for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
+ buffer_ptr = buffer[ci][yindex+yoffset] + start_col;
+ for (xindex = 0; xindex < compptr->MCU_width; xindex++) {
+ coef->MCU_buffer[blkn++] = buffer_ptr++;
+ }
+ }
+ }
+ /* Try to write the MCU. */
+ if (! (*cinfo->entropy->encode_mcu) (cinfo, coef->MCU_buffer)) {
+ /* Suspension forced; update state counters and exit */
+ coef->MCU_vert_offset = yoffset;
+ coef->mcu_ctr = MCU_col_num;
+ return FALSE;
+ }
+ }
+ /* Completed an MCU row, but perhaps not an iMCU row */
+ coef->mcu_ctr = 0;
+ }
+ /* Completed the iMCU row, advance counters for next one */
+ coef->iMCU_row_num++;
+ start_iMCU_row(cinfo);
+ return TRUE;
+}
+
+#endif /* FULL_COEF_BUFFER_SUPPORTED */
+
+
+/*
+ * Initialize coefficient buffer controller.
+ */
+
+GLOBAL(void)
+jinit_c_coef_controller (j_compress_ptr cinfo, boolean need_full_buffer)
+{
+ my_coef_ptr coef;
+
+ coef = (my_coef_ptr)
+ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ SIZEOF(my_coef_controller));
+ cinfo->coef = (struct jpeg_c_coef_controller *) coef;
+ coef->pub.start_pass = start_pass_coef;
+
+ /* Create the coefficient buffer. */
+ if (need_full_buffer) {
+#ifdef FULL_COEF_BUFFER_SUPPORTED
+ /* Allocate a full-image virtual array for each component, */
+ /* padded to a multiple of samp_factor DCT blocks in each direction. */
+ int ci;
+ jpeg_component_info *compptr;
+
+ for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+ ci++, compptr++) {
+ coef->whole_image[ci] = (*cinfo->mem->request_virt_barray)
+ ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,
+ (JDIMENSION) jround_up((long) compptr->width_in_blocks,
+ (long) compptr->h_samp_factor),
+ (JDIMENSION) jround_up((long) compptr->height_in_blocks,
+ (long) compptr->v_samp_factor),
+ (JDIMENSION) compptr->v_samp_factor);
+ }
+#else
+ ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
+#endif
+ } else {
+ /* We only need a single-MCU buffer. */
+ JBLOCKROW buffer;
+ int i;
+
+ buffer = (JBLOCKROW)
+ (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ C_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK));
+ for (i = 0; i < C_MAX_BLOCKS_IN_MCU; i++) {
+ coef->MCU_buffer[i] = buffer + i;
+ }
+ coef->whole_image[0] = NULL; /* flag for no virtual arrays */
+ }
+}
+
+#endif //_FX_JPEG_TURBO_
diff --git a/core/src/fxcodec/libjpeg/fpdfapi_jccolor.c b/core/src/fxcodec/libjpeg/fpdfapi_jccolor.c
index 8ff863a14b..809a05b5a1 100644
--- a/core/src/fxcodec/libjpeg/fpdfapi_jccolor.c
+++ b/core/src/fxcodec/libjpeg/fpdfapi_jccolor.c
@@ -1,462 +1,462 @@
-#if !defined(_FX_JPEG_TURBO_)
-/*
- * jccolor.c
- *
- * Copyright (C) 1991-1996, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- * For conditions of distribution and use, see the accompanying README file.
- *
- * This file contains input colorspace conversion routines.
- */
-
-#define JPEG_INTERNALS
-#include "jinclude.h"
-#include "jpeglib.h"
-
-
-/* Private subobject */
-
-typedef struct {
- struct jpeg_color_converter pub; /* public fields */
-
- /* Private state for RGB->YCC conversion */
- INT32 * rgb_ycc_tab; /* => table for RGB to YCbCr conversion */
-} my_color_converter;
-
-typedef my_color_converter * my_cconvert_ptr;
-
-
-/**************** RGB -> YCbCr conversion: most common case **************/
-
-/*
- * YCbCr is defined per CCIR 601-1, except that Cb and Cr are
- * normalized to the range 0..MAXJSAMPLE rather than -0.5 .. 0.5.
- * The conversion equations to be implemented are therefore
- * Y = 0.29900 * R + 0.58700 * G + 0.11400 * B
- * Cb = -0.16874 * R - 0.33126 * G + 0.50000 * B + CENTERJSAMPLE
- * Cr = 0.50000 * R - 0.41869 * G - 0.08131 * B + CENTERJSAMPLE
- * (These numbers are derived from TIFF 6.0 section 21, dated 3-June-92.)
- * Note: older versions of the IJG code used a zero offset of MAXJSAMPLE/2,
- * rather than CENTERJSAMPLE, for Cb and Cr. This gave equal positive and
- * negative swings for Cb/Cr, but meant that grayscale values (Cb=Cr=0)
- * were not represented exactly. Now we sacrifice exact representation of
- * maximum red and maximum blue in order to get exact grayscales.
- *
- * To avoid floating-point arithmetic, we represent the fractional constants
- * as integers scaled up by 2^16 (about 4 digits precision); we have to divide
- * the products by 2^16, with appropriate rounding, to get the correct answer.
- *
- * For even more speed, we avoid doing any multiplications in the inner loop
- * by precalculating the constants times R,G,B for all possible values.
- * For 8-bit JSAMPLEs this is very reasonable (only 256 entries per table);
- * for 12-bit samples it is still acceptable. It's not very reasonable for
- * 16-bit samples, but if you want lossless storage you shouldn't be changing
- * colorspace anyway.
- * The CENTERJSAMPLE offsets and the rounding fudge-factor of 0.5 are included
- * in the tables to save adding them separately in the inner loop.
- */
-
-#define SCALEBITS 16 /* speediest right-shift on some machines */
-#define CBCR_OFFSET ((INT32) CENTERJSAMPLE << SCALEBITS)
-#define ONE_HALF ((INT32) 1 << (SCALEBITS-1))
-#define FIX(x) ((INT32) ((x) * (1L<<SCALEBITS) + 0.5))
-
-/* We allocate one big table and divide it up into eight parts, instead of
- * doing eight alloc_small requests. This lets us use a single table base
- * address, which can be held in a register in the inner loops on many
- * machines (more than can hold all eight addresses, anyway).
- */
-
-#define R_Y_OFF 0 /* offset to R => Y section */
-#define G_Y_OFF (1*(MAXJSAMPLE+1)) /* offset to G => Y section */
-#define B_Y_OFF (2*(MAXJSAMPLE+1)) /* etc. */
-#define R_CB_OFF (3*(MAXJSAMPLE+1))
-#define G_CB_OFF (4*(MAXJSAMPLE+1))
-#define B_CB_OFF (5*(MAXJSAMPLE+1))
-#define R_CR_OFF B_CB_OFF /* B=>Cb, R=>Cr are the same */
-#define G_CR_OFF (6*(MAXJSAMPLE+1))
-#define B_CR_OFF (7*(MAXJSAMPLE+1))
-#define TABLE_SIZE (8*(MAXJSAMPLE+1))
-
-
-/*
- * Initialize for RGB->YCC colorspace conversion.
- */
-
-METHODDEF(void)
-rgb_ycc_start (j_compress_ptr cinfo)
-{
- my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
- INT32 * rgb_ycc_tab;
- INT32 i;
-
- /* Allocate and fill in the conversion tables. */
- cconvert->rgb_ycc_tab = rgb_ycc_tab = (INT32 *)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- (TABLE_SIZE * SIZEOF(INT32)));
-
- for (i = 0; i <= MAXJSAMPLE; i++) {
- rgb_ycc_tab[i+R_Y_OFF] = FIX(0.29900) * i;
- rgb_ycc_tab[i+G_Y_OFF] = FIX(0.58700) * i;
- rgb_ycc_tab[i+B_Y_OFF] = FIX(0.11400) * i + ONE_HALF;
- rgb_ycc_tab[i+R_CB_OFF] = (-FIX(0.16874)) * i;
- rgb_ycc_tab[i+G_CB_OFF] = (-FIX(0.33126)) * i;
- /* We use a rounding fudge-factor of 0.5-epsilon for Cb and Cr.
- * This ensures that the maximum output will round to MAXJSAMPLE
- * not MAXJSAMPLE+1, and thus that we don't have to range-limit.
- */
- rgb_ycc_tab[i+B_CB_OFF] = FIX(0.50000) * i + CBCR_OFFSET + ONE_HALF-1;
-/* B=>Cb and R=>Cr tables are the same
- rgb_ycc_tab[i+R_CR_OFF] = FIX(0.50000) * i + CBCR_OFFSET + ONE_HALF-1;
-*/
- rgb_ycc_tab[i+G_CR_OFF] = (-FIX(0.41869)) * i;
- rgb_ycc_tab[i+B_CR_OFF] = (-FIX(0.08131)) * i;
- }
-}
-
-
-/*
- * Convert some rows of samples to the JPEG colorspace.
- *
- * Note that we change from the application's interleaved-pixel format
- * to our internal noninterleaved, one-plane-per-component format.
- * The input buffer is therefore three times as wide as the output buffer.
- *
- * A starting row offset is provided only for the output buffer. The caller
- * can easily adjust the passed input_buf value to accommodate any row
- * offset required on that side.
- */
-
-METHODDEF(void)
-rgb_ycc_convert (j_compress_ptr cinfo,
- JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
- JDIMENSION output_row, int num_rows)
-{
- my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
- register int r, g, b;
- register INT32 * ctab = cconvert->rgb_ycc_tab;
- register JSAMPROW inptr;
- register JSAMPROW outptr0, outptr1, outptr2;
- register JDIMENSION col;
- JDIMENSION num_cols = cinfo->image_width;
-
- while (--num_rows >= 0) {
- inptr = *input_buf++;
- outptr0 = output_buf[0][output_row];
- outptr1 = output_buf[1][output_row];
- outptr2 = output_buf[2][output_row];
- output_row++;
- for (col = 0; col < num_cols; col++) {
- r = GETJSAMPLE(inptr[RGB_RED]);
- g = GETJSAMPLE(inptr[RGB_GREEN]);
- b = GETJSAMPLE(inptr[RGB_BLUE]);
- inptr += RGB_PIXELSIZE;
- /* If the inputs are 0..MAXJSAMPLE, the outputs of these equations
- * must be too; we do not need an explicit range-limiting operation.
- * Hence the value being shifted is never negative, and we don't
- * need the general RIGHT_SHIFT macro.
- */
- /* Y */
- outptr0[col] = (JSAMPLE)
- ((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])
- >> SCALEBITS);
- /* Cb */
- outptr1[col] = (JSAMPLE)
- ((ctab[r+R_CB_OFF] + ctab[g+G_CB_OFF] + ctab[b+B_CB_OFF])
- >> SCALEBITS);
- /* Cr */
- outptr2[col] = (JSAMPLE)
- ((ctab[r+R_CR_OFF] + ctab[g+G_CR_OFF] + ctab[b+B_CR_OFF])
- >> SCALEBITS);
- }
- }
-}
-
-
-/**************** Cases other than RGB -> YCbCr **************/
-
-
-/*
- * Convert some rows of samples to the JPEG colorspace.
- * This version handles RGB->grayscale conversion, which is the same
- * as the RGB->Y portion of RGB->YCbCr.
- * We assume rgb_ycc_start has been called (we only use the Y tables).
- */
-
-METHODDEF(void)
-rgb_gray_convert (j_compress_ptr cinfo,
- JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
- JDIMENSION output_row, int num_rows)
-{
- my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
- register int r, g, b;
- register INT32 * ctab = cconvert->rgb_ycc_tab;
- register JSAMPROW inptr;
- register JSAMPROW outptr;
- register JDIMENSION col;
- JDIMENSION num_cols = cinfo->image_width;
-
- while (--num_rows >= 0) {
- inptr = *input_buf++;
- outptr = output_buf[0][output_row];
- output_row++;
- for (col = 0; col < num_cols; col++) {
- r = GETJSAMPLE(inptr[RGB_RED]);
- g = GETJSAMPLE(inptr[RGB_GREEN]);
- b = GETJSAMPLE(inptr[RGB_BLUE]);
- inptr += RGB_PIXELSIZE;
- /* Y */
- outptr[col] = (JSAMPLE)
- ((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])
- >> SCALEBITS);
- }
- }
-}
-
-
-/*
- * Convert some rows of samples to the JPEG colorspace.
- * This version handles Adobe-style CMYK->YCCK conversion,
- * where we convert R=1-C, G=1-M, and B=1-Y to YCbCr using the same
- * conversion as above, while passing K (black) unchanged.
- * We assume rgb_ycc_start has been called.
- */
-
-METHODDEF(void)
-cmyk_ycck_convert (j_compress_ptr cinfo,
- JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
- JDIMENSION output_row, int num_rows)
-{
- my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
- register int r, g, b;
- register INT32 * ctab = cconvert->rgb_ycc_tab;
- register JSAMPROW inptr;
- register JSAMPROW outptr0, outptr1, outptr2, outptr3;
- register JDIMENSION col;
- JDIMENSION num_cols = cinfo->image_width;
-
- while (--num_rows >= 0) {
- inptr = *input_buf++;
- outptr0 = output_buf[0][output_row];
- outptr1 = output_buf[1][output_row];
- outptr2 = output_buf[2][output_row];
- outptr3 = output_buf[3][output_row];
- output_row++;
- for (col = 0; col < num_cols; col++) {
- r = MAXJSAMPLE - GETJSAMPLE(inptr[0]);
- g = MAXJSAMPLE - GETJSAMPLE(inptr[1]);
- b = MAXJSAMPLE - GETJSAMPLE(inptr[2]);
- /* K passes through as-is */
- outptr3[col] = inptr[3]; /* don't need GETJSAMPLE here */
- inptr += 4;
- /* If the inputs are 0..MAXJSAMPLE, the outputs of these equations
- * must be too; we do not need an explicit range-limiting operation.
- * Hence the value being shifted is never negative, and we don't
- * need the general RIGHT_SHIFT macro.
- */
- /* Y */
- outptr0[col] = (JSAMPLE)
- ((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])
- >> SCALEBITS);
- /* Cb */
- outptr1[col] = (JSAMPLE)
- ((ctab[r+R_CB_OFF] + ctab[g+G_CB_OFF] + ctab[b+B_CB_OFF])
- >> SCALEBITS);
- /* Cr */
- outptr2[col] = (JSAMPLE)
- ((ctab[r+R_CR_OFF] + ctab[g+G_CR_OFF] + ctab[b+B_CR_OFF])
- >> SCALEBITS);
- }
- }
-}
-
-
-/*
- * Convert some rows of samples to the JPEG colorspace.
- * This version handles grayscale output with no conversion.
- * The source can be either plain grayscale or YCbCr (since Y == gray).
- */
-
-METHODDEF(void)
-grayscale_convert (j_compress_ptr cinfo,
- JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
- JDIMENSION output_row, int num_rows)
-{
- register JSAMPROW inptr;
- register JSAMPROW outptr;
- register JDIMENSION col;
- JDIMENSION num_cols = cinfo->image_width;
- int instride = cinfo->input_components;
-
- while (--num_rows >= 0) {
- inptr = *input_buf++;
- outptr = output_buf[0][output_row];
- output_row++;
- for (col = 0; col < num_cols; col++) {
- outptr[col] = inptr[0]; /* don't need GETJSAMPLE() here */
- inptr += instride;
- }
- }
-}
-
-
-/*
- * Convert some rows of samples to the JPEG colorspace.
- * This version handles multi-component colorspaces without conversion.
- * We assume input_components == num_components.
- */
-
-METHODDEF(void)
-null_convert (j_compress_ptr cinfo,
- JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
- JDIMENSION output_row, int num_rows)
-{
- register JSAMPROW inptr;
- register JSAMPROW outptr;
- register JDIMENSION col;
- register int ci;
- int nc = cinfo->num_components;
- JDIMENSION num_cols = cinfo->image_width;
-
- while (--num_rows >= 0) {
- /* It seems fastest to make a separate pass for each component. */
- for (ci = 0; ci < nc; ci++) {
- inptr = *input_buf;
- outptr = output_buf[ci][output_row];
- for (col = 0; col < num_cols; col++) {
- outptr[col] = inptr[ci]; /* don't need GETJSAMPLE() here */
- inptr += nc;
- }
- }
- input_buf++;
- output_row++;
- }
-}
-
-
-/*
- * Empty method for start_pass.
- */
-
-METHODDEF(void)
-null_method (j_compress_ptr cinfo)
-{
- /* no work needed */
-}
-
-
-/*
- * Module initialization routine for input colorspace conversion.
- */
-
-GLOBAL(void)
-jinit_color_converter (j_compress_ptr cinfo)
-{
- my_cconvert_ptr cconvert;
-
- cconvert = (my_cconvert_ptr)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- SIZEOF(my_color_converter));
- cinfo->cconvert = (struct jpeg_color_converter *) cconvert;
- /* set start_pass to null method until we find out differently */
- cconvert->pub.start_pass = null_method;
-
- /* Make sure input_components agrees with in_color_space */
- switch (cinfo->in_color_space) {
- case JCS_GRAYSCALE:
- if (cinfo->input_components != 1)
- ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
- break;
-
- case JCS_RGB:
-#if RGB_PIXELSIZE != 3
- if (cinfo->input_components != RGB_PIXELSIZE)
- ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
- break;
-#endif /* else share code with YCbCr */
-
- case JCS_YCbCr:
- if (cinfo->input_components != 3)
- ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
- break;
-
- case JCS_CMYK:
- case JCS_YCCK:
- if (cinfo->input_components != 4)
- ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
- break;
-
- default: /* JCS_UNKNOWN can be anything */
- if (cinfo->input_components < 1)
- ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
- break;
- }
-
- /* Check num_components, set conversion method based on requested space */
- switch (cinfo->jpeg_color_space) {
- case JCS_GRAYSCALE:
- if (cinfo->num_components != 1)
- ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
- if (cinfo->in_color_space == JCS_GRAYSCALE)
- cconvert->pub.color_convert = grayscale_convert;
- else if (cinfo->in_color_space == JCS_RGB) {
- cconvert->pub.start_pass = rgb_ycc_start;
- cconvert->pub.color_convert = rgb_gray_convert;
- } else if (cinfo->in_color_space == JCS_YCbCr)
- cconvert->pub.color_convert = grayscale_convert;
- else
- ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
- break;
-
- case JCS_RGB:
- if (cinfo->num_components != 3)
- ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
- if (cinfo->in_color_space == JCS_RGB && RGB_PIXELSIZE == 3)
- cconvert->pub.color_convert = null_convert;
- else
- ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
- break;
-
- case JCS_YCbCr:
- if (cinfo->num_components != 3)
- ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
- if (cinfo->in_color_space == JCS_RGB) {
- cconvert->pub.start_pass = rgb_ycc_start;
- cconvert->pub.color_convert = rgb_ycc_convert;
- } else if (cinfo->in_color_space == JCS_YCbCr)
- cconvert->pub.color_convert = null_convert;
- else
- ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
- break;
-
- case JCS_CMYK:
- if (cinfo->num_components != 4)
- ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
- if (cinfo->in_color_space == JCS_CMYK)
- cconvert->pub.color_convert = null_convert;
- else
- ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
- break;
-
- case JCS_YCCK:
- if (cinfo->num_components != 4)
- ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
- if (cinfo->in_color_space == JCS_CMYK) {
- cconvert->pub.start_pass = rgb_ycc_start;
- cconvert->pub.color_convert = cmyk_ycck_convert;
- } else if (cinfo->in_color_space == JCS_YCCK)
- cconvert->pub.color_convert = null_convert;
- else
- ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
- break;
-
- default: /* allow null conversion of JCS_UNKNOWN */
- if (cinfo->jpeg_color_space != cinfo->in_color_space ||
- cinfo->num_components != cinfo->input_components)
- ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
- cconvert->pub.color_convert = null_convert;
- break;
- }
-}
-
-#endif //_FX_JPEG_TURBO_
+#if !defined(_FX_JPEG_TURBO_)
+/*
+ * jccolor.c
+ *
+ * Copyright (C) 1991-1996, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains input colorspace conversion routines.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+
+
+/* Private subobject */
+
+typedef struct {
+ struct jpeg_color_converter pub; /* public fields */
+
+ /* Private state for RGB->YCC conversion */
+ INT32 * rgb_ycc_tab; /* => table for RGB to YCbCr conversion */
+} my_color_converter;
+
+typedef my_color_converter * my_cconvert_ptr;
+
+
+/**************** RGB -> YCbCr conversion: most common case **************/
+
+/*
+ * YCbCr is defined per CCIR 601-1, except that Cb and Cr are
+ * normalized to the range 0..MAXJSAMPLE rather than -0.5 .. 0.5.
+ * The conversion equations to be implemented are therefore
+ * Y = 0.29900 * R + 0.58700 * G + 0.11400 * B
+ * Cb = -0.16874 * R - 0.33126 * G + 0.50000 * B + CENTERJSAMPLE
+ * Cr = 0.50000 * R - 0.41869 * G - 0.08131 * B + CENTERJSAMPLE
+ * (These numbers are derived from TIFF 6.0 section 21, dated 3-June-92.)
+ * Note: older versions of the IJG code used a zero offset of MAXJSAMPLE/2,
+ * rather than CENTERJSAMPLE, for Cb and Cr. This gave equal positive and
+ * negative swings for Cb/Cr, but meant that grayscale values (Cb=Cr=0)
+ * were not represented exactly. Now we sacrifice exact representation of
+ * maximum red and maximum blue in order to get exact grayscales.
+ *
+ * To avoid floating-point arithmetic, we represent the fractional constants
+ * as integers scaled up by 2^16 (about 4 digits precision); we have to divide
+ * the products by 2^16, with appropriate rounding, to get the correct answer.
+ *
+ * For even more speed, we avoid doing any multiplications in the inner loop
+ * by precalculating the constants times R,G,B for all possible values.
+ * For 8-bit JSAMPLEs this is very reasonable (only 256 entries per table);
+ * for 12-bit samples it is still acceptable. It's not very reasonable for
+ * 16-bit samples, but if you want lossless storage you shouldn't be changing
+ * colorspace anyway.
+ * The CENTERJSAMPLE offsets and the rounding fudge-factor of 0.5 are included
+ * in the tables to save adding them separately in the inner loop.
+ */
+
+#define SCALEBITS 16 /* speediest right-shift on some machines */
+#define CBCR_OFFSET ((INT32) CENTERJSAMPLE << SCALEBITS)
+#define ONE_HALF ((INT32) 1 << (SCALEBITS-1))
+#define FIX(x) ((INT32) ((x) * (1L<<SCALEBITS) + 0.5))
+
+/* We allocate one big table and divide it up into eight parts, instead of
+ * doing eight alloc_small requests. This lets us use a single table base
+ * address, which can be held in a register in the inner loops on many
+ * machines (more than can hold all eight addresses, anyway).
+ */
+
+#define R_Y_OFF 0 /* offset to R => Y section */
+#define G_Y_OFF (1*(MAXJSAMPLE+1)) /* offset to G => Y section */
+#define B_Y_OFF (2*(MAXJSAMPLE+1)) /* etc. */
+#define R_CB_OFF (3*(MAXJSAMPLE+1))
+#define G_CB_OFF (4*(MAXJSAMPLE+1))
+#define B_CB_OFF (5*(MAXJSAMPLE+1))
+#define R_CR_OFF B_CB_OFF /* B=>Cb, R=>Cr are the same */
+#define G_CR_OFF (6*(MAXJSAMPLE+1))
+#define B_CR_OFF (7*(MAXJSAMPLE+1))
+#define TABLE_SIZE (8*(MAXJSAMPLE+1))
+
+
+/*
+ * Initialize for RGB->YCC colorspace conversion.
+ */
+
+METHODDEF(void)
+rgb_ycc_start (j_compress_ptr cinfo)
+{
+ my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
+ INT32 * rgb_ycc_tab;
+ INT32 i;
+
+ /* Allocate and fill in the conversion tables. */
+ cconvert->rgb_ycc_tab = rgb_ycc_tab = (INT32 *)
+ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ (TABLE_SIZE * SIZEOF(INT32)));
+
+ for (i = 0; i <= MAXJSAMPLE; i++) {
+ rgb_ycc_tab[i+R_Y_OFF] = FIX(0.29900) * i;
+ rgb_ycc_tab[i+G_Y_OFF] = FIX(0.58700) * i;
+ rgb_ycc_tab[i+B_Y_OFF] = FIX(0.11400) * i + ONE_HALF;
+ rgb_ycc_tab[i+R_CB_OFF] = (-FIX(0.16874)) * i;
+ rgb_ycc_tab[i+G_CB_OFF] = (-FIX(0.33126)) * i;
+ /* We use a rounding fudge-factor of 0.5-epsilon for Cb and Cr.
+ * This ensures that the maximum output will round to MAXJSAMPLE
+ * not MAXJSAMPLE+1, and thus that we don't have to range-limit.
+ */
+ rgb_ycc_tab[i+B_CB_OFF] = FIX(0.50000) * i + CBCR_OFFSET + ONE_HALF-1;
+/* B=>Cb and R=>Cr tables are the same
+ rgb_ycc_tab[i+R_CR_OFF] = FIX(0.50000) * i + CBCR_OFFSET + ONE_HALF-1;
+*/
+ rgb_ycc_tab[i+G_CR_OFF] = (-FIX(0.41869)) * i;
+ rgb_ycc_tab[i+B_CR_OFF] = (-FIX(0.08131)) * i;
+ }
+}
+
+
+/*
+ * Convert some rows of samples to the JPEG colorspace.
+ *
+ * Note that we change from the application's interleaved-pixel format
+ * to our internal noninterleaved, one-plane-per-component format.
+ * The input buffer is therefore three times as wide as the output buffer.
+ *
+ * A starting row offset is provided only for the output buffer. The caller
+ * can easily adjust the passed input_buf value to accommodate any row
+ * offset required on that side.
+ */
+
+METHODDEF(void)
+rgb_ycc_convert (j_compress_ptr cinfo,
+ JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
+ JDIMENSION output_row, int num_rows)
+{
+ my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
+ register int r, g, b;
+ register INT32 * ctab = cconvert->rgb_ycc_tab;
+ register JSAMPROW inptr;
+ register JSAMPROW outptr0, outptr1, outptr2;
+ register JDIMENSION col;
+ JDIMENSION num_cols = cinfo->image_width;
+
+ while (--num_rows >= 0) {
+ inptr = *input_buf++;
+ outptr0 = output_buf[0][output_row];
+ outptr1 = output_buf[1][output_row];
+ outptr2 = output_buf[2][output_row];
+ output_row++;
+ for (col = 0; col < num_cols; col++) {
+ r = GETJSAMPLE(inptr[RGB_RED]);
+ g = GETJSAMPLE(inptr[RGB_GREEN]);
+ b = GETJSAMPLE(inptr[RGB_BLUE]);
+ inptr += RGB_PIXELSIZE;
+ /* If the inputs are 0..MAXJSAMPLE, the outputs of these equations
+ * must be too; we do not need an explicit range-limiting operation.
+ * Hence the value being shifted is never negative, and we don't
+ * need the general RIGHT_SHIFT macro.
+ */
+ /* Y */
+ outptr0[col] = (JSAMPLE)
+ ((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])
+ >> SCALEBITS);
+ /* Cb */
+ outptr1[col] = (JSAMPLE)
+ ((ctab[r+R_CB_OFF] + ctab[g+G_CB_OFF] + ctab[b+B_CB_OFF])
+ >> SCALEBITS);
+ /* Cr */
+ outptr2[col] = (JSAMPLE)
+ ((ctab[r+R_CR_OFF] + ctab[g+G_CR_OFF] + ctab[b+B_CR_OFF])
+ >> SCALEBITS);
+ }
+ }
+}
+
+
+/**************** Cases other than RGB -> YCbCr **************/
+
+
+/*
+ * Convert some rows of samples to the JPEG colorspace.
+ * This version handles RGB->grayscale conversion, which is the same
+ * as the RGB->Y portion of RGB->YCbCr.
+ * We assume rgb_ycc_start has been called (we only use the Y tables).
+ */
+
+METHODDEF(void)
+rgb_gray_convert (j_compress_ptr cinfo,
+ JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
+ JDIMENSION output_row, int num_rows)
+{
+ my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
+ register int r, g, b;
+ register INT32 * ctab = cconvert->rgb_ycc_tab;
+ register JSAMPROW inptr;
+ register JSAMPROW outptr;
+ register JDIMENSION col;
+ JDIMENSION num_cols = cinfo->image_width;
+
+ while (--num_rows >= 0) {
+ inptr = *input_buf++;
+ outptr = output_buf[0][output_row];
+ output_row++;
+ for (col = 0; col < num_cols; col++) {
+ r = GETJSAMPLE(inptr[RGB_RED]);
+ g = GETJSAMPLE(inptr[RGB_GREEN]);
+ b = GETJSAMPLE(inptr[RGB_BLUE]);
+ inptr += RGB_PIXELSIZE;
+ /* Y */
+ outptr[col] = (JSAMPLE)
+ ((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])
+ >> SCALEBITS);
+ }
+ }
+}
+
+
+/*
+ * Convert some rows of samples to the JPEG colorspace.
+ * This version handles Adobe-style CMYK->YCCK conversion,
+ * where we convert R=1-C, G=1-M, and B=1-Y to YCbCr using the same
+ * conversion as above, while passing K (black) unchanged.
+ * We assume rgb_ycc_start has been called.
+ */
+
+METHODDEF(void)
+cmyk_ycck_convert (j_compress_ptr cinfo,
+ JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
+ JDIMENSION output_row, int num_rows)
+{
+ my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
+ register int r, g, b;
+ register INT32 * ctab = cconvert->rgb_ycc_tab;
+ register JSAMPROW inptr;
+ register JSAMPROW outptr0, outptr1, outptr2, outptr3;
+ register JDIMENSION col;
+ JDIMENSION num_cols = cinfo->image_width;
+
+ while (--num_rows >= 0) {
+ inptr = *input_buf++;
+ outptr0 = output_buf[0][output_row];
+ outptr1 = output_buf[1][output_row];
+ outptr2 = output_buf[2][output_row];
+ outptr3 = output_buf[3][output_row];
+ output_row++;
+ for (col = 0; col < num_cols; col++) {
+ r = MAXJSAMPLE - GETJSAMPLE(inptr[0]);
+ g = MAXJSAMPLE - GETJSAMPLE(inptr[1]);
+ b = MAXJSAMPLE - GETJSAMPLE(inptr[2]);
+ /* K passes through as-is */
+ outptr3[col] = inptr[3]; /* don't need GETJSAMPLE here */
+ inptr += 4;
+ /* If the inputs are 0..MAXJSAMPLE, the outputs of these equations
+ * must be too; we do not need an explicit range-limiting operation.
+ * Hence the value being shifted is never negative, and we don't
+ * need the general RIGHT_SHIFT macro.
+ */
+ /* Y */
+ outptr0[col] = (JSAMPLE)
+ ((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])
+ >> SCALEBITS);
+ /* Cb */
+ outptr1[col] = (JSAMPLE)
+ ((ctab[r+R_CB_OFF] + ctab[g+G_CB_OFF] + ctab[b+B_CB_OFF])
+ >> SCALEBITS);
+ /* Cr */
+ outptr2[col] = (JSAMPLE)
+ ((ctab[r+R_CR_OFF] + ctab[g+G_CR_OFF] + ctab[b+B_CR_OFF])
+ >> SCALEBITS);
+ }
+ }
+}
+
+
+/*
+ * Convert some rows of samples to the JPEG colorspace.
+ * This version handles grayscale output with no conversion.
+ * The source can be either plain grayscale or YCbCr (since Y == gray).
+ */
+
+METHODDEF(void)
+grayscale_convert (j_compress_ptr cinfo,
+ JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
+ JDIMENSION output_row, int num_rows)
+{
+ register JSAMPROW inptr;
+ register JSAMPROW outptr;
+ register JDIMENSION col;
+ JDIMENSION num_cols = cinfo->image_width;
+ int instride = cinfo->input_components;
+
+ while (--num_rows >= 0) {
+ inptr = *input_buf++;
+ outptr = output_buf[0][output_row];
+ output_row++;
+ for (col = 0; col < num_cols; col++) {
+ outptr[col] = inptr[0]; /* don't need GETJSAMPLE() here */
+ inptr += instride;
+ }
+ }
+}
+
+
+/*
+ * Convert some rows of samples to the JPEG colorspace.
+ * This version handles multi-component colorspaces without conversion.
+ * We assume input_components == num_components.
+ */
+
+METHODDEF(void)
+null_convert (j_compress_ptr cinfo,
+ JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
+ JDIMENSION output_row, int num_rows)
+{
+ register JSAMPROW inptr;
+ register JSAMPROW outptr;
+ register JDIMENSION col;
+ register int ci;
+ int nc = cinfo->num_components;
+ JDIMENSION num_cols = cinfo->image_width;
+
+ while (--num_rows >= 0) {
+ /* It seems fastest to make a separate pass for each component. */
+ for (ci = 0; ci < nc; ci++) {
+ inptr = *input_buf;
+ outptr = output_buf[ci][output_row];
+ for (col = 0; col < num_cols; col++) {
+ outptr[col] = inptr[ci]; /* don't need GETJSAMPLE() here */
+ inptr += nc;
+ }
+ }
+ input_buf++;
+ output_row++;
+ }
+}
+
+
+/*
+ * Empty method for start_pass.
+ */
+
+METHODDEF(void)
+null_method (j_compress_ptr cinfo)
+{
+ /* no work needed */
+}
+
+
+/*
+ * Module initialization routine for input colorspace conversion.
+ */
+
+GLOBAL(void)
+jinit_color_converter (j_compress_ptr cinfo)
+{
+ my_cconvert_ptr cconvert;
+
+ cconvert = (my_cconvert_ptr)
+ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ SIZEOF(my_color_converter));
+ cinfo->cconvert = (struct jpeg_color_converter *) cconvert;
+ /* set start_pass to null method until we find out differently */
+ cconvert->pub.start_pass = null_method;
+
+ /* Make sure input_components agrees with in_color_space */
+ switch (cinfo->in_color_space) {
+ case JCS_GRAYSCALE:
+ if (cinfo->input_components != 1)
+ ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
+ break;
+
+ case JCS_RGB:
+#if RGB_PIXELSIZE != 3
+ if (cinfo->input_components != RGB_PIXELSIZE)
+ ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
+ break;
+#endif /* else share code with YCbCr */
+
+ case JCS_YCbCr:
+ if (cinfo->input_components != 3)
+ ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
+ break;
+
+ case JCS_CMYK:
+ case JCS_YCCK:
+ if (cinfo->input_components != 4)
+ ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
+ break;
+
+ default: /* JCS_UNKNOWN can be anything */
+ if (cinfo->input_components < 1)
+ ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
+ break;
+ }
+
+ /* Check num_components, set conversion method based on requested space */
+ switch (cinfo->jpeg_color_space) {
+ case JCS_GRAYSCALE:
+ if (cinfo->num_components != 1)
+ ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
+ if (cinfo->in_color_space == JCS_GRAYSCALE)
+ cconvert->pub.color_convert = grayscale_convert;
+ else if (cinfo->in_color_space == JCS_RGB) {
+ cconvert->pub.start_pass = rgb_ycc_start;
+ cconvert->pub.color_convert = rgb_gray_convert;
+ } else if (cinfo->in_color_space == JCS_YCbCr)
+ cconvert->pub.color_convert = grayscale_convert;
+ else
+ ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
+ break;
+
+ case JCS_RGB:
+ if (cinfo->num_components != 3)
+ ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
+ if (cinfo->in_color_space == JCS_RGB && RGB_PIXELSIZE == 3)
+ cconvert->pub.color_convert = null_convert;
+ else
+ ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
+ break;
+
+ case JCS_YCbCr:
+ if (cinfo->num_components != 3)
+ ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
+ if (cinfo->in_color_space == JCS_RGB) {
+ cconvert->pub.start_pass = rgb_ycc_start;
+ cconvert->pub.color_convert = rgb_ycc_convert;
+ } else if (cinfo->in_color_space == JCS_YCbCr)
+ cconvert->pub.color_convert = null_convert;
+ else
+ ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
+ break;
+
+ case JCS_CMYK:
+ if (cinfo->num_components != 4)
+ ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
+ if (cinfo->in_color_space == JCS_CMYK)
+ cconvert->pub.color_convert = null_convert;
+ else
+ ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
+ break;
+
+ case JCS_YCCK:
+ if (cinfo->num_components != 4)
+ ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
+ if (cinfo->in_color_space == JCS_CMYK) {
+ cconvert->pub.start_pass = rgb_ycc_start;
+ cconvert->pub.color_convert = cmyk_ycck_convert;
+ } else if (cinfo->in_color_space == JCS_YCCK)
+ cconvert->pub.color_convert = null_convert;
+ else
+ ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
+ break;
+
+ default: /* allow null conversion of JCS_UNKNOWN */
+ if (cinfo->jpeg_color_space != cinfo->in_color_space ||
+ cinfo->num_components != cinfo->input_components)
+ ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
+ cconvert->pub.color_convert = null_convert;
+ break;
+ }
+}
+
+#endif //_FX_JPEG_TURBO_
diff --git a/core/src/fxcodec/libjpeg/fpdfapi_jcdctmgr.c b/core/src/fxcodec/libjpeg/fpdfapi_jcdctmgr.c
index d4082043a5..cbd7d11207 100644
--- a/core/src/fxcodec/libjpeg/fpdfapi_jcdctmgr.c
+++ b/core/src/fxcodec/libjpeg/fpdfapi_jcdctmgr.c
@@ -1,390 +1,390 @@
-#if !defined(_FX_JPEG_TURBO_)
-/*
- * jcdctmgr.c
- *
- * Copyright (C) 1994-1996, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- * For conditions of distribution and use, see the accompanying README file.
- *
- * This file contains the forward-DCT management logic.
- * This code selects a particular DCT implementation to be used,
- * and it performs related housekeeping chores including coefficient
- * quantization.
- */
-
-#define JPEG_INTERNALS
-#include "jinclude.h"
-#include "jpeglib.h"
-#include "jdct.h" /* Private declarations for DCT subsystem */
-
-
-/* Private subobject for this module */
-
-typedef struct {
- struct jpeg_forward_dct pub; /* public fields */
-
- /* Pointer to the DCT routine actually in use */
- forward_DCT_method_ptr do_dct;
-
- /* The actual post-DCT divisors --- not identical to the quant table
- * entries, because of scaling (especially for an unnormalized DCT).
- * Each table is given in normal array order.
- */
- DCTELEM * divisors[NUM_QUANT_TBLS];
-
-#ifdef DCT_FLOAT_SUPPORTED
- /* Same as above for the floating-point case. */
- float_DCT_method_ptr do_float_dct;
- FAST_FLOAT * float_divisors[NUM_QUANT_TBLS];
-#endif
-} my_fdct_controller;
-
-typedef my_fdct_controller * my_fdct_ptr;
-
-
-/*
- * Initialize for a processing pass.
- * Verify that all referenced Q-tables are present, and set up
- * the divisor table for each one.
- * In the current implementation, DCT of all components is done during
- * the first pass, even if only some components will be output in the
- * first scan. Hence all components should be examined here.
- */
-
-METHODDEF(void)
-start_pass_fdctmgr (j_compress_ptr cinfo)
-{
- my_fdct_ptr fdct = (my_fdct_ptr) cinfo->fdct;
- int ci, qtblno, i;
- jpeg_component_info *compptr;
- JQUANT_TBL * qtbl;
- DCTELEM * dtbl;
-
- for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
- ci++, compptr++) {
- qtblno = compptr->quant_tbl_no;
- /* Make sure specified quantization table is present */
- if (qtblno < 0 || qtblno >= NUM_QUANT_TBLS ||
- cinfo->quant_tbl_ptrs[qtblno] == NULL)
- ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, qtblno);
- qtbl = cinfo->quant_tbl_ptrs[qtblno];
- /* Compute divisors for this quant table */
- /* We may do this more than once for same table, but it's not a big deal */
- switch (cinfo->dct_method) {
-#ifdef DCT_ISLOW_SUPPORTED
- case JDCT_ISLOW:
- /* For LL&M IDCT method, divisors are equal to raw quantization
- * coefficients multiplied by 8 (to counteract scaling).
- */
- if (fdct->divisors[qtblno] == NULL) {
- fdct->divisors[qtblno] = (DCTELEM *)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- DCTSIZE2 * SIZEOF(DCTELEM));
- }
- dtbl = fdct->divisors[qtblno];
- for (i = 0; i < DCTSIZE2; i++) {
- dtbl[i] = ((DCTELEM) qtbl->quantval[i]) << 3;
- }
- break;
-#endif
-#ifdef DCT_IFAST_SUPPORTED
- case JDCT_IFAST:
- {
- /* For AA&N IDCT method, divisors are equal to quantization
- * coefficients scaled by scalefactor[row]*scalefactor[col], where
- * scalefactor[0] = 1
- * scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7
- * We apply a further scale factor of 8.
- */
-#define CONST_BITS 14
- static const INT16 aanscales[DCTSIZE2] = {
- /* precomputed values scaled up by 14 bits */
- 16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520,
- 22725, 31521, 29692, 26722, 22725, 17855, 12299, 6270,
- 21407, 29692, 27969, 25172, 21407, 16819, 11585, 5906,
- 19266, 26722, 25172, 22654, 19266, 15137, 10426, 5315,
- 16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520,
- 12873, 17855, 16819, 15137, 12873, 10114, 6967, 3552,
- 8867, 12299, 11585, 10426, 8867, 6967, 4799, 2446,
- 4520, 6270, 5906, 5315, 4520, 3552, 2446, 1247
- };
- SHIFT_TEMPS
-
- if (fdct->divisors[qtblno] == NULL) {
- fdct->divisors[qtblno] = (DCTELEM *)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- DCTSIZE2 * SIZEOF(DCTELEM));
- }
- dtbl = fdct->divisors[qtblno];
- for (i = 0; i < DCTSIZE2; i++) {
- dtbl[i] = (DCTELEM)
- DESCALE(MULTIPLY16V16((INT32) qtbl->quantval[i],
- (INT32) aanscales[i]),
- CONST_BITS-3);
- }
- }
- break;
-#endif
-#ifdef DCT_FLOAT_SUPPORTED
- case JDCT_FLOAT:
- {
- /* For float AA&N IDCT method, divisors are equal to quantization
- * coefficients scaled by scalefactor[row]*scalefactor[col], where
- * scalefactor[0] = 1
- * scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7
- * We apply a further scale factor of 8.
- * What's actually stored is 1/divisor so that the inner loop can
- * use a multiplication rather than a division.
- */
- FAST_FLOAT * fdtbl;
- int row, col;
- static const double aanscalefactor[DCTSIZE] = {
- 1.0, 1.387039845, 1.306562965, 1.175875602,
- 1.0, 0.785694958, 0.541196100, 0.275899379
- };
-
- if (fdct->float_divisors[qtblno] == NULL) {
- fdct->float_divisors[qtblno] = (FAST_FLOAT *)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- DCTSIZE2 * SIZEOF(FAST_FLOAT));
- }
- fdtbl = fdct->float_divisors[qtblno];
- i = 0;
- for (row = 0; row < DCTSIZE; row++) {
- for (col = 0; col < DCTSIZE; col++) {
- fdtbl[i] = (FAST_FLOAT)
- (1.0 / (((double) qtbl->quantval[i] *
- aanscalefactor[row] * aanscalefactor[col] * 8.0)));
- i++;
- }
- }
- }
- break;
-#endif
- default:
- ERREXIT(cinfo, JERR_NOT_COMPILED);
- break;
- }
- }
-}
-
-
-/*
- * Perform forward DCT on one or more blocks of a component.
- *
- * The input samples are taken from the sample_data[] array starting at
- * position start_row/start_col, and moving to the right for any additional
- * blocks. The quantized coefficients are returned in coef_blocks[].
- */
-
-METHODDEF(void)
-forward_DCT (j_compress_ptr cinfo, jpeg_component_info * compptr,
- JSAMPARRAY sample_data, JBLOCKROW coef_blocks,
- JDIMENSION start_row, JDIMENSION start_col,
- JDIMENSION num_blocks)
-/* This version is used for integer DCT implementations. */
-{
- /* This routine is heavily used, so it's worth coding it tightly. */
- my_fdct_ptr fdct = (my_fdct_ptr) cinfo->fdct;
- forward_DCT_method_ptr do_dct = fdct->do_dct;
- DCTELEM * divisors = fdct->divisors[compptr->quant_tbl_no];
- DCTELEM workspace[DCTSIZE2]; /* work area for FDCT subroutine */
- JDIMENSION bi;
-
- sample_data += start_row; /* fold in the vertical offset once */
-
- for (bi = 0; bi < num_blocks; bi++, start_col += DCTSIZE) {
- /* Load data into workspace, applying unsigned->signed conversion */
- { register DCTELEM *workspaceptr;
- register JSAMPROW elemptr;
- register int elemr;
-
- workspaceptr = workspace;
- for (elemr = 0; elemr < DCTSIZE; elemr++) {
- elemptr = sample_data[elemr] + start_col;
-#if DCTSIZE == 8 /* unroll the inner loop */
- *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
- *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
- *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
- *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
- *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
- *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
- *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
- *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
-#else
- { register int elemc;
- for (elemc = DCTSIZE; elemc > 0; elemc--) {
- *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
- }
- }
-#endif
- }
- }
-
- /* Perform the DCT */
- (*do_dct) (workspace);
-
- /* Quantize/descale the coefficients, and store into coef_blocks[] */
- { register DCTELEM temp, qval;
- register int i;
- register JCOEFPTR output_ptr = coef_blocks[bi];
-
- for (i = 0; i < DCTSIZE2; i++) {
- qval = divisors[i];
- temp = workspace[i];
- /* Divide the coefficient value by qval, ensuring proper rounding.
- * Since C does not specify the direction of rounding for negative
- * quotients, we have to force the dividend positive for portability.
- *
- * In most files, at least half of the output values will be zero
- * (at default quantization settings, more like three-quarters...)
- * so we should ensure that this case is fast. On many machines,
- * a comparison is enough cheaper than a divide to make a special test
- * a win. Since both inputs will be nonnegative, we need only test
- * for a < b to discover whether a/b is 0.
- * If your machine's division is fast enough, define FAST_DIVIDE.
- */
-#ifdef FAST_DIVIDE
-#define DIVIDE_BY(a,b) a /= b
-#else
-#define DIVIDE_BY(a,b) if (a >= b) a /= b; else a = 0
-#endif
- if (temp < 0) {
- temp = -temp;
- temp += qval>>1; /* for rounding */
- DIVIDE_BY(temp, qval);
- temp = -temp;
- } else {
- temp += qval>>1; /* for rounding */
- DIVIDE_BY(temp, qval);
- }
- output_ptr[i] = (JCOEF) temp;
- }
- }
- }
-}
-
-
-#ifdef DCT_FLOAT_SUPPORTED
-
-METHODDEF(void)
-forward_DCT_float (j_compress_ptr cinfo, jpeg_component_info * compptr,
- JSAMPARRAY sample_data, JBLOCKROW coef_blocks,
- JDIMENSION start_row, JDIMENSION start_col,
- JDIMENSION num_blocks)
-/* This version is used for floating-point DCT implementations. */
-{
- /* This routine is heavily used, so it's worth coding it tightly. */
- my_fdct_ptr fdct = (my_fdct_ptr) cinfo->fdct;
- float_DCT_method_ptr do_dct = fdct->do_float_dct;
- FAST_FLOAT * divisors = fdct->float_divisors[compptr->quant_tbl_no];
- FAST_FLOAT workspace[DCTSIZE2]; /* work area for FDCT subroutine */
- JDIMENSION bi;
-
- sample_data += start_row; /* fold in the vertical offset once */
-
- for (bi = 0; bi < num_blocks; bi++, start_col += DCTSIZE) {
- /* Load data into workspace, applying unsigned->signed conversion */
- { register FAST_FLOAT *workspaceptr;
- register JSAMPROW elemptr;
- register int elemr;
-
- workspaceptr = workspace;
- for (elemr = 0; elemr < DCTSIZE; elemr++) {
- elemptr = sample_data[elemr] + start_col;
-#if DCTSIZE == 8 /* unroll the inner loop */
- *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
- *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
- *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
- *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
- *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
- *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
- *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
- *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
-#else
- { register int elemc;
- for (elemc = DCTSIZE; elemc > 0; elemc--) {
- *workspaceptr++ = (FAST_FLOAT)
- (GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
- }
- }
-#endif
- }
- }
-
- /* Perform the DCT */
- (*do_dct) (workspace);
-
- /* Quantize/descale the coefficients, and store into coef_blocks[] */
- { register FAST_FLOAT temp;
- register int i;
- register JCOEFPTR output_ptr = coef_blocks[bi];
-
- for (i = 0; i < DCTSIZE2; i++) {
- /* Apply the quantization and scaling factor */
- temp = workspace[i] * divisors[i];
- /* Round to nearest integer.
- * Since C does not specify the direction of rounding for negative
- * quotients, we have to force the dividend positive for portability.
- * The maximum coefficient size is +-16K (for 12-bit data), so this
- * code should work for either 16-bit or 32-bit ints.
- */
- output_ptr[i] = (JCOEF) ((int) (temp + (FAST_FLOAT) 16384.5) - 16384);
- }
- }
- }
-}
-
-#endif /* DCT_FLOAT_SUPPORTED */
-
-
-/*
- * Initialize FDCT manager.
- */
-
-GLOBAL(void)
-jinit_forward_dct (j_compress_ptr cinfo)
-{
- my_fdct_ptr fdct;
- int i;
-
- fdct = (my_fdct_ptr)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- SIZEOF(my_fdct_controller));
- cinfo->fdct = (struct jpeg_forward_dct *) fdct;
- fdct->pub.start_pass = start_pass_fdctmgr;
-
- switch (cinfo->dct_method) {
-#ifdef DCT_ISLOW_SUPPORTED
- case JDCT_ISLOW:
- fdct->pub.forward_DCT = forward_DCT;
- fdct->do_dct = jpeg_fdct_islow;
- break;
-#endif
-#ifdef DCT_IFAST_SUPPORTED
- case JDCT_IFAST:
- fdct->pub.forward_DCT = forward_DCT;
- fdct->do_dct = jpeg_fdct_ifast;
- break;
-#endif
-#ifdef DCT_FLOAT_SUPPORTED
- case JDCT_FLOAT:
- fdct->pub.forward_DCT = forward_DCT_float;
- fdct->do_float_dct = jpeg_fdct_float;
- break;
-#endif
- default:
- ERREXIT(cinfo, JERR_NOT_COMPILED);
- break;
- }
-
- /* Mark divisor tables unallocated */
- for (i = 0; i < NUM_QUANT_TBLS; i++) {
- fdct->divisors[i] = NULL;
-#ifdef DCT_FLOAT_SUPPORTED
- fdct->float_divisors[i] = NULL;
-#endif
- }
-}
-
-#endif //_FX_JPEG_TURBO_
+#if !defined(_FX_JPEG_TURBO_)
+/*
+ * jcdctmgr.c
+ *
+ * Copyright (C) 1994-1996, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains the forward-DCT management logic.
+ * This code selects a particular DCT implementation to be used,
+ * and it performs related housekeeping chores including coefficient
+ * quantization.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+#include "jdct.h" /* Private declarations for DCT subsystem */
+
+
+/* Private subobject for this module */
+
+typedef struct {
+ struct jpeg_forward_dct pub; /* public fields */
+
+ /* Pointer to the DCT routine actually in use */
+ forward_DCT_method_ptr do_dct;
+
+ /* The actual post-DCT divisors --- not identical to the quant table
+ * entries, because of scaling (especially for an unnormalized DCT).
+ * Each table is given in normal array order.
+ */
+ DCTELEM * divisors[NUM_QUANT_TBLS];
+
+#ifdef DCT_FLOAT_SUPPORTED
+ /* Same as above for the floating-point case. */
+ float_DCT_method_ptr do_float_dct;
+ FAST_FLOAT * float_divisors[NUM_QUANT_TBLS];
+#endif
+} my_fdct_controller;
+
+typedef my_fdct_controller * my_fdct_ptr;
+
+
+/*
+ * Initialize for a processing pass.
+ * Verify that all referenced Q-tables are present, and set up
+ * the divisor table for each one.
+ * In the current implementation, DCT of all components is done during
+ * the first pass, even if only some components will be output in the
+ * first scan. Hence all components should be examined here.
+ */
+
+METHODDEF(void)
+start_pass_fdctmgr (j_compress_ptr cinfo)
+{
+ my_fdct_ptr fdct = (my_fdct_ptr) cinfo->fdct;
+ int ci, qtblno, i;
+ jpeg_component_info *compptr;
+ JQUANT_TBL * qtbl;
+ DCTELEM * dtbl;
+
+ for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+ ci++, compptr++) {
+ qtblno = compptr->quant_tbl_no;
+ /* Make sure specified quantization table is present */
+ if (qtblno < 0 || qtblno >= NUM_QUANT_TBLS ||
+ cinfo->quant_tbl_ptrs[qtblno] == NULL)
+ ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, qtblno);
+ qtbl = cinfo->quant_tbl_ptrs[qtblno];
+ /* Compute divisors for this quant table */
+ /* We may do this more than once for same table, but it's not a big deal */
+ switch (cinfo->dct_method) {
+#ifdef DCT_ISLOW_SUPPORTED
+ case JDCT_ISLOW:
+ /* For LL&M IDCT method, divisors are equal to raw quantization
+ * coefficients multiplied by 8 (to counteract scaling).
+ */
+ if (fdct->divisors[qtblno] == NULL) {
+ fdct->divisors[qtblno] = (DCTELEM *)
+ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ DCTSIZE2 * SIZEOF(DCTELEM));
+ }
+ dtbl = fdct->divisors[qtblno];
+ for (i = 0; i < DCTSIZE2; i++) {
+ dtbl[i] = ((DCTELEM) qtbl->quantval[i]) << 3;
+ }
+ break;
+#endif
+#ifdef DCT_IFAST_SUPPORTED
+ case JDCT_IFAST:
+ {
+ /* For AA&N IDCT method, divisors are equal to quantization
+ * coefficients scaled by scalefactor[row]*scalefactor[col], where
+ * scalefactor[0] = 1
+ * scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7
+ * We apply a further scale factor of 8.
+ */
+#define CONST_BITS 14
+ static const INT16 aanscales[DCTSIZE2] = {
+ /* precomputed values scaled up by 14 bits */
+ 16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520,
+ 22725, 31521, 29692, 26722, 22725, 17855, 12299, 6270,
+ 21407, 29692, 27969, 25172, 21407, 16819, 11585, 5906,
+ 19266, 26722, 25172, 22654, 19266, 15137, 10426, 5315,
+ 16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520,
+ 12873, 17855, 16819, 15137, 12873, 10114, 6967, 3552,
+ 8867, 12299, 11585, 10426, 8867, 6967, 4799, 2446,
+ 4520, 6270, 5906, 5315, 4520, 3552, 2446, 1247
+ };
+ SHIFT_TEMPS
+
+ if (fdct->divisors[qtblno] == NULL) {
+ fdct->divisors[qtblno] = (DCTELEM *)
+ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ DCTSIZE2 * SIZEOF(DCTELEM));
+ }
+ dtbl = fdct->divisors[qtblno];
+ for (i = 0; i < DCTSIZE2; i++) {
+ dtbl[i] = (DCTELEM)
+ DESCALE(MULTIPLY16V16((INT32) qtbl->quantval[i],
+ (INT32) aanscales[i]),
+ CONST_BITS-3);
+ }
+ }
+ break;
+#endif
+#ifdef DCT_FLOAT_SUPPORTED
+ case JDCT_FLOAT:
+ {
+ /* For float AA&N IDCT method, divisors are equal to quantization
+ * coefficients scaled by scalefactor[row]*scalefactor[col], where
+ * scalefactor[0] = 1
+ * scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7
+ * We apply a further scale factor of 8.
+ * What's actually stored is 1/divisor so that the inner loop can
+ * use a multiplication rather than a division.
+ */
+ FAST_FLOAT * fdtbl;
+ int row, col;
+ static const double aanscalefactor[DCTSIZE] = {
+ 1.0, 1.387039845, 1.306562965, 1.175875602,
+ 1.0, 0.785694958, 0.541196100, 0.275899379
+ };
+
+ if (fdct->float_divisors[qtblno] == NULL) {
+ fdct->float_divisors[qtblno] = (FAST_FLOAT *)
+ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ DCTSIZE2 * SIZEOF(FAST_FLOAT));
+ }
+ fdtbl = fdct->float_divisors[qtblno];
+ i = 0;
+ for (row = 0; row < DCTSIZE; row++) {
+ for (col = 0; col < DCTSIZE; col++) {
+ fdtbl[i] = (FAST_FLOAT)
+ (1.0 / (((double) qtbl->quantval[i] *
+ aanscalefactor[row] * aanscalefactor[col] * 8.0)));
+ i++;
+ }
+ }
+ }
+ break;
+#endif
+ default:
+ ERREXIT(cinfo, JERR_NOT_COMPILED);
+ break;
+ }
+ }
+}
+
+
+/*
+ * Perform forward DCT on one or more blocks of a component.
+ *
+ * The input samples are taken from the sample_data[] array starting at
+ * position start_row/start_col, and moving to the right for any additional
+ * blocks. The quantized coefficients are returned in coef_blocks[].
+ */
+
+METHODDEF(void)
+forward_DCT (j_compress_ptr cinfo, jpeg_component_info * compptr,
+ JSAMPARRAY sample_data, JBLOCKROW coef_blocks,
+ JDIMENSION start_row, JDIMENSION start_col,
+ JDIMENSION num_blocks)
+/* This version is used for integer DCT implementations. */
+{
+ /* This routine is heavily used, so it's worth coding it tightly. */
+ my_fdct_ptr fdct = (my_fdct_ptr) cinfo->fdct;
+ forward_DCT_method_ptr do_dct = fdct->do_dct;
+ DCTELEM * divisors = fdct->divisors[compptr->quant_tbl_no];
+ DCTELEM workspace[DCTSIZE2]; /* work area for FDCT subroutine */
+ JDIMENSION bi;
+
+ sample_data += start_row; /* fold in the vertical offset once */
+
+ for (bi = 0; bi < num_blocks; bi++, start_col += DCTSIZE) {
+ /* Load data into workspace, applying unsigned->signed conversion */
+ { register DCTELEM *workspaceptr;
+ register JSAMPROW elemptr;
+ register int elemr;
+
+ workspaceptr = workspace;
+ for (elemr = 0; elemr < DCTSIZE; elemr++) {
+ elemptr = sample_data[elemr] + start_col;
+#if DCTSIZE == 8 /* unroll the inner loop */
+ *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
+ *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
+ *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
+ *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
+ *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
+ *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
+ *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
+ *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
+#else
+ { register int elemc;
+ for (elemc = DCTSIZE; elemc > 0; elemc--) {
+ *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
+ }
+ }
+#endif
+ }
+ }
+
+ /* Perform the DCT */
+ (*do_dct) (workspace);
+
+ /* Quantize/descale the coefficients, and store into coef_blocks[] */
+ { register DCTELEM temp, qval;
+ register int i;
+ register JCOEFPTR output_ptr = coef_blocks[bi];
+
+ for (i = 0; i < DCTSIZE2; i++) {
+ qval = divisors[i];
+ temp = workspace[i];
+ /* Divide the coefficient value by qval, ensuring proper rounding.
+ * Since C does not specify the direction of rounding for negative
+ * quotients, we have to force the dividend positive for portability.
+ *
+ * In most files, at least half of the output values will be zero
+ * (at default quantization settings, more like three-quarters...)
+ * so we should ensure that this case is fast. On many machines,
+ * a comparison is enough cheaper than a divide to make a special test
+ * a win. Since both inputs will be nonnegative, we need only test
+ * for a < b to discover whether a/b is 0.
+ * If your machine's division is fast enough, define FAST_DIVIDE.
+ */
+#ifdef FAST_DIVIDE
+#define DIVIDE_BY(a,b) a /= b
+#else
+#define DIVIDE_BY(a,b) if (a >= b) a /= b; else a = 0
+#endif
+ if (temp < 0) {
+ temp = -temp;
+ temp += qval>>1; /* for rounding */
+ DIVIDE_BY(temp, qval);
+ temp = -temp;
+ } else {
+ temp += qval>>1; /* for rounding */
+ DIVIDE_BY(temp, qval);
+ }
+ output_ptr[i] = (JCOEF) temp;
+ }
+ }
+ }
+}
+
+
+#ifdef DCT_FLOAT_SUPPORTED
+
+METHODDEF(void)
+forward_DCT_float (j_compress_ptr cinfo, jpeg_component_info * compptr,
+ JSAMPARRAY sample_data, JBLOCKROW coef_blocks,
+ JDIMENSION start_row, JDIMENSION start_col,
+ JDIMENSION num_blocks)
+/* This version is used for floating-point DCT implementations. */
+{
+ /* This routine is heavily used, so it's worth coding it tightly. */
+ my_fdct_ptr fdct = (my_fdct_ptr) cinfo->fdct;
+ float_DCT_method_ptr do_dct = fdct->do_float_dct;
+ FAST_FLOAT * divisors = fdct->float_divisors[compptr->quant_tbl_no];
+ FAST_FLOAT workspace[DCTSIZE2]; /* work area for FDCT subroutine */
+ JDIMENSION bi;
+
+ sample_data += start_row; /* fold in the vertical offset once */
+
+ for (bi = 0; bi < num_blocks; bi++, start_col += DCTSIZE) {
+ /* Load data into workspace, applying unsigned->signed conversion */
+ { register FAST_FLOAT *workspaceptr;
+ register JSAMPROW elemptr;
+ register int elemr;
+
+ workspaceptr = workspace;
+ for (elemr = 0; elemr < DCTSIZE; elemr++) {
+ elemptr = sample_data[elemr] + start_col;
+#if DCTSIZE == 8 /* unroll the inner loop */
+ *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
+ *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
+ *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
+ *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
+ *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
+ *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
+ *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
+ *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
+#else
+ { register int elemc;
+ for (elemc = DCTSIZE; elemc > 0; elemc--) {
+ *workspaceptr++ = (FAST_FLOAT)
+ (GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
+ }
+ }
+#endif
+ }
+ }
+
+ /* Perform the DCT */
+ (*do_dct) (workspace);
+
+ /* Quantize/descale the coefficients, and store into coef_blocks[] */
+ { register FAST_FLOAT temp;
+ register int i;
+ register JCOEFPTR output_ptr = coef_blocks[bi];
+
+ for (i = 0; i < DCTSIZE2; i++) {
+ /* Apply the quantization and scaling factor */
+ temp = workspace[i] * divisors[i];
+ /* Round to nearest integer.
+ * Since C does not specify the direction of rounding for negative
+ * quotients, we have to force the dividend positive for portability.
+ * The maximum coefficient size is +-16K (for 12-bit data), so this
+ * code should work for either 16-bit or 32-bit ints.
+ */
+ output_ptr[i] = (JCOEF) ((int) (temp + (FAST_FLOAT) 16384.5) - 16384);
+ }
+ }
+ }
+}
+
+#endif /* DCT_FLOAT_SUPPORTED */
+
+
+/*
+ * Initialize FDCT manager.
+ */
+
+GLOBAL(void)
+jinit_forward_dct (j_compress_ptr cinfo)
+{
+ my_fdct_ptr fdct;
+ int i;
+
+ fdct = (my_fdct_ptr)
+ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ SIZEOF(my_fdct_controller));
+ cinfo->fdct = (struct jpeg_forward_dct *) fdct;
+ fdct->pub.start_pass = start_pass_fdctmgr;
+
+ switch (cinfo->dct_method) {
+#ifdef DCT_ISLOW_SUPPORTED
+ case JDCT_ISLOW:
+ fdct->pub.forward_DCT = forward_DCT;
+ fdct->do_dct = jpeg_fdct_islow;
+ break;
+#endif
+#ifdef DCT_IFAST_SUPPORTED
+ case JDCT_IFAST:
+ fdct->pub.forward_DCT = forward_DCT;
+ fdct->do_dct = jpeg_fdct_ifast;
+ break;
+#endif
+#ifdef DCT_FLOAT_SUPPORTED
+ case JDCT_FLOAT:
+ fdct->pub.forward_DCT = forward_DCT_float;
+ fdct->do_float_dct = jpeg_fdct_float;
+ break;
+#endif
+ default:
+ ERREXIT(cinfo, JERR_NOT_COMPILED);
+ break;
+ }
+
+ /* Mark divisor tables unallocated */
+ for (i = 0; i < NUM_QUANT_TBLS; i++) {
+ fdct->divisors[i] = NULL;
+#ifdef DCT_FLOAT_SUPPORTED
+ fdct->float_divisors[i] = NULL;
+#endif
+ }
+}
+
+#endif //_FX_JPEG_TURBO_
diff --git a/core/src/fxcodec/libjpeg/fpdfapi_jchuff.c b/core/src/fxcodec/libjpeg/fpdfapi_jchuff.c
index 9ed1fe6da2..2a65aa253b 100644
--- a/core/src/fxcodec/libjpeg/fpdfapi_jchuff.c
+++ b/core/src/fxcodec/libjpeg/fpdfapi_jchuff.c
@@ -1,915 +1,915 @@
-#if !defined(_FX_JPEG_TURBO_)
-/*
- * jchuff.c
- *
- * Copyright (C) 1991-1997, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- * For conditions of distribution and use, see the accompanying README file.
- *
- * This file contains Huffman entropy encoding routines.
- *
- * Much of the complexity here has to do with supporting output suspension.
- * If the data destination module demands suspension, we want to be able to
- * back up to the start of the current MCU. To do this, we copy state
- * variables into local working storage, and update them back to the
- * permanent JPEG objects only upon successful completion of an MCU.
- */
-
-#define JPEG_INTERNALS
-#include "jinclude.h"
-#include "jpeglib.h"
-#include "jchuff.h" /* Declarations shared with jcphuff.c */
-
-#ifdef _FX_MANAGED_CODE_
-#define savable_state savable_state_c
-#endif
-
-/* Expanded entropy encoder object for Huffman encoding.
- *
- * The savable_state subrecord contains fields that change within an MCU,
- * but must not be updated permanently until we complete the MCU.
- */
-
-typedef struct {
- INT32 put_buffer; /* current bit-accumulation buffer */
- int put_bits; /* # of bits now in it */
- int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */
-} savable_state;
-
-/* This macro is to work around compilers with missing or broken
- * structure assignment. You'll need to fix this code if you have
- * such a compiler and you change MAX_COMPS_IN_SCAN.
- */
-
-#ifndef NO_STRUCT_ASSIGN
-#define ASSIGN_STATE(dest,src) ((dest) = (src))
-#else
-#if MAX_COMPS_IN_SCAN == 4
-#define ASSIGN_STATE(dest,src) \
- ((dest).put_buffer = (src).put_buffer, \
- (dest).put_bits = (src).put_bits, \
- (dest).last_dc_val[0] = (src).last_dc_val[0], \
- (dest).last_dc_val[1] = (src).last_dc_val[1], \
- (dest).last_dc_val[2] = (src).last_dc_val[2], \
- (dest).last_dc_val[3] = (src).last_dc_val[3])
-#endif
-#endif
-
-
-typedef struct {
- struct jpeg_entropy_encoder pub; /* public fields */
-
- savable_state saved; /* Bit buffer & DC state at start of MCU */
-
- /* These fields are NOT loaded into local working state. */
- unsigned int restarts_to_go; /* MCUs left in this restart interval */
- int next_restart_num; /* next restart number to write (0-7) */
-
- /* Pointers to derived tables (these workspaces have image lifespan) */
- c_derived_tbl * dc_derived_tbls[NUM_HUFF_TBLS];
- c_derived_tbl * ac_derived_tbls[NUM_HUFF_TBLS];
-
-#ifdef ENTROPY_OPT_SUPPORTED /* Statistics tables for optimization */
- long * dc_count_ptrs[NUM_HUFF_TBLS];
- long * ac_count_ptrs[NUM_HUFF_TBLS];
-#endif
-} huff_entropy_encoder;
-
-typedef huff_entropy_encoder * huff_entropy_ptr;
-
-/* Working state while writing an MCU.
- * This struct contains all the fields that are needed by subroutines.
- */
-
-typedef struct {
- JOCTET * next_output_byte; /* => next byte to write in buffer */
- size_t free_in_buffer; /* # of byte spaces remaining in buffer */
- savable_state cur; /* Current bit buffer & DC state */
- j_compress_ptr cinfo; /* dump_buffer needs access to this */
-} working_state;
-
-
-/* Forward declarations */
-METHODDEF(boolean) encode_mcu_huff JPP((j_compress_ptr cinfo,
- JBLOCKROW *MCU_data));
-METHODDEF(void) finish_pass_huff JPP((j_compress_ptr cinfo));
-#ifdef ENTROPY_OPT_SUPPORTED
-METHODDEF(boolean) encode_mcu_gather JPP((j_compress_ptr cinfo,
- JBLOCKROW *MCU_data));
-METHODDEF(void) finish_pass_gather JPP((j_compress_ptr cinfo));
-#endif
-
-
-/*
- * Initialize for a Huffman-compressed scan.
- * If gather_statistics is TRUE, we do not output anything during the scan,
- * just count the Huffman symbols used and generate Huffman code tables.
- */
-
-METHODDEF(void)
-start_pass_huff (j_compress_ptr cinfo, boolean gather_statistics)
-{
- huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
- int ci, dctbl, actbl;
- jpeg_component_info * compptr;
-
- if (gather_statistics) {
-#ifdef ENTROPY_OPT_SUPPORTED
- entropy->pub.encode_mcu = encode_mcu_gather;
- entropy->pub.finish_pass = finish_pass_gather;
-#else
- ERREXIT(cinfo, JERR_NOT_COMPILED);
-#endif
- } else {
- entropy->pub.encode_mcu = encode_mcu_huff;
- entropy->pub.finish_pass = finish_pass_huff;
- }
-
- for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
- compptr = cinfo->cur_comp_info[ci];
- dctbl = compptr->dc_tbl_no;
- actbl = compptr->ac_tbl_no;
- if (gather_statistics) {
-#ifdef ENTROPY_OPT_SUPPORTED
- /* Check for invalid table indexes */
- /* (make_c_derived_tbl does this in the other path) */
- if (dctbl < 0 || dctbl >= NUM_HUFF_TBLS)
- ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, dctbl);
- if (actbl < 0 || actbl >= NUM_HUFF_TBLS)
- ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, actbl);
- /* Allocate and zero the statistics tables */
- /* Note that jpeg_gen_optimal_table expects 257 entries in each table! */
- if (entropy->dc_count_ptrs[dctbl] == NULL)
- entropy->dc_count_ptrs[dctbl] = (long *)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- 257 * SIZEOF(long));
- MEMZERO(entropy->dc_count_ptrs[dctbl], 257 * SIZEOF(long));
- if (entropy->ac_count_ptrs[actbl] == NULL)
- entropy->ac_count_ptrs[actbl] = (long *)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- 257 * SIZEOF(long));
- MEMZERO(entropy->ac_count_ptrs[actbl], 257 * SIZEOF(long));
-#endif
- } else {
- /* Compute derived values for Huffman tables */
- /* We may do this more than once for a table, but it's not expensive */
- jpeg_make_c_derived_tbl(cinfo, TRUE, dctbl,
- & entropy->dc_derived_tbls[dctbl]);
- jpeg_make_c_derived_tbl(cinfo, FALSE, actbl,
- & entropy->ac_derived_tbls[actbl]);
- }
- /* Initialize DC predictions to 0 */
- entropy->saved.last_dc_val[ci] = 0;
- }
-
- /* Initialize bit buffer to empty */
- entropy->saved.put_buffer = 0;
- entropy->saved.put_bits = 0;
-
- /* Initialize restart stuff */
- entropy->restarts_to_go = cinfo->restart_interval;
- entropy->next_restart_num = 0;
-}
-
-
-/*
- * Compute the derived values for a Huffman table.
- * This routine also performs some validation checks on the table.
- *
- * Note this is also used by jcphuff.c.
- */
-
-GLOBAL(void)
-jpeg_make_c_derived_tbl (j_compress_ptr cinfo, boolean isDC, int tblno,
- c_derived_tbl ** pdtbl)
-{
- JHUFF_TBL *htbl;
- c_derived_tbl *dtbl;
- int p, i, l, lastp, _si, maxsymbol;
- char huffsize[257];
- unsigned int huffcode[257];
- unsigned int code;
-
- /* Note that huffsize[] and huffcode[] are filled in code-length order,
- * paralleling the order of the symbols themselves in htbl->huffval[].
- */
-
- /* Find the input Huffman table */
- if (tblno < 0 || tblno >= NUM_HUFF_TBLS)
- ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno);
- htbl =
- isDC ? cinfo->dc_huff_tbl_ptrs[tblno] : cinfo->ac_huff_tbl_ptrs[tblno];
- if (htbl == NULL)
- ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno);
-
- /* Allocate a workspace if we haven't already done so. */
- if (*pdtbl == NULL)
- *pdtbl = (c_derived_tbl *)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- SIZEOF(c_derived_tbl));
- dtbl = *pdtbl;
-
- /* Figure C.1: make table of Huffman code length for each symbol */
-
- p = 0;
- for (l = 1; l <= 16; l++) {
- i = (int) htbl->bits[l];
- if (i < 0 || p + i > 256) /* protect against table overrun */
- ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
- while (i--)
- huffsize[p++] = (char) l;
- }
- huffsize[p] = 0;
- lastp = p;
-
- /* Figure C.2: generate the codes themselves */
- /* We also validate that the counts represent a legal Huffman code tree. */
-
- code = 0;
- _si = huffsize[0];
- p = 0;
- while (huffsize[p]) {
- while (((int) huffsize[p]) == _si) {
- huffcode[p++] = code;
- code++;
- }
- /* code is now 1 more than the last code used for codelength si; but
- * it must still fit in si bits, since no code is allowed to be all ones.
- */
- if (((INT32) code) >= (((INT32) 1) << _si))
- ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
- code <<= 1;
- _si++;
- }
-
- /* Figure C.3: generate encoding tables */
- /* These are code and size indexed by symbol value */
-
- /* Set all codeless symbols to have code length 0;
- * this lets us detect duplicate VAL entries here, and later
- * allows emit_bits to detect any attempt to emit such symbols.
- */
- MEMZERO(dtbl->ehufsi, SIZEOF(dtbl->ehufsi));
-
- /* This is also a convenient place to check for out-of-range
- * and duplicated VAL entries. We allow 0..255 for AC symbols
- * but only 0..15 for DC. (We could constrain them further
- * based on data depth and mode, but this seems enough.)
- */
- maxsymbol = isDC ? 15 : 255;
-
- for (p = 0; p < lastp; p++) {
- i = htbl->huffval[p];
- if (i < 0 || i > maxsymbol || dtbl->ehufsi[i])
- ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
- dtbl->ehufco[i] = huffcode[p];
- dtbl->ehufsi[i] = huffsize[p];
- }
-}
-
-
-/* Outputting bytes to the file */
-
-/* Emit a byte, taking 'action' if must suspend. */
-#define emit_byte(state,val,action) \
- { *(state)->next_output_byte++ = (JOCTET) (val); \
- if (--(state)->free_in_buffer == 0) \
- if (! dump_buffer(state)) \
- { action; } }
-
-
-LOCAL(boolean)
-dump_buffer (working_state * state)
-/* Empty the output buffer; return TRUE if successful, FALSE if must suspend */
-{
- struct jpeg_destination_mgr * dest = state->cinfo->dest;
-
- if (! (*dest->empty_output_buffer) (state->cinfo))
- return FALSE;
- /* After a successful buffer dump, must reset buffer pointers */
- state->next_output_byte = dest->next_output_byte;
- state->free_in_buffer = dest->free_in_buffer;
- return TRUE;
-}
-
-
-/* Outputting bits to the file */
-
-/* Only the right 24 bits of put_buffer are used; the valid bits are
- * left-justified in this part. At most 16 bits can be passed to emit_bits
- * in one call, and we never retain more than 7 bits in put_buffer
- * between calls, so 24 bits are sufficient.
- */
-
-INLINE
-LOCAL(boolean)
-emit_bits (working_state * state, unsigned int code, int size)
-/* Emit some bits; return TRUE if successful, FALSE if must suspend */
-{
- /* This routine is heavily used, so it's worth coding tightly. */
- register INT32 put_buffer = (INT32) code;
- register int put_bits = state->cur.put_bits;
-
- /* if size is 0, caller used an invalid Huffman table entry */
- if (size == 0)
- ERREXIT(state->cinfo, JERR_HUFF_MISSING_CODE);
-
- put_buffer &= (((INT32) 1)<<size) - 1; /* mask off any extra bits in code */
-
- put_bits += size; /* new number of bits in buffer */
-
- put_buffer <<= 24 - put_bits; /* align incoming bits */
-
- put_buffer |= state->cur.put_buffer; /* and merge with old buffer contents */
-
- while (put_bits >= 8) {
- int c = (int) ((put_buffer >> 16) & 0xFF);
-
- emit_byte(state, c, return FALSE);
- if (c == 0xFF) { /* need to stuff a zero byte? */
- emit_byte(state, 0, return FALSE);
- }
- put_buffer <<= 8;
- put_bits -= 8;
- }
-
- state->cur.put_buffer = put_buffer; /* update state variables */
- state->cur.put_bits = put_bits;
-
- return TRUE;
-}
-
-
-LOCAL(boolean)
-flush_bits (working_state * state)
-{
- if (! emit_bits(state, 0x7F, 7)) /* fill any partial byte with ones */
- return FALSE;
- state->cur.put_buffer = 0; /* and reset bit-buffer to empty */
- state->cur.put_bits = 0;
- return TRUE;
-}
-
-
-/* Encode a single block's worth of coefficients */
-
-LOCAL(boolean)
-encode_one_block (working_state * state, JCOEFPTR block, int last_dc_val,
- c_derived_tbl *dctbl, c_derived_tbl *actbl)
-{
- register int temp, temp2;
- register int nbits;
- register int k, r, i;
-
- /* Encode the DC coefficient difference per section F.1.2.1 */
-
- temp = temp2 = block[0] - last_dc_val;
-
- if (temp < 0) {
- temp = -temp; /* temp is abs value of input */
- /* For a negative input, want temp2 = bitwise complement of abs(input) */
- /* This code assumes we are on a two's complement machine */
- temp2--;
- }
-
- /* Find the number of bits needed for the magnitude of the coefficient */
- nbits = 0;
- while (temp) {
- nbits++;
- temp >>= 1;
- }
- /* Check for out-of-range coefficient values.
- * Since we're encoding a difference, the range limit is twice as much.
- */
- if (nbits > MAX_COEF_BITS+1)
- ERREXIT(state->cinfo, JERR_BAD_DCT_COEF);
-
- /* Emit the Huffman-coded symbol for the number of bits */
- if (! emit_bits(state, dctbl->ehufco[nbits], dctbl->ehufsi[nbits]))
- return FALSE;
-
- /* Emit that number of bits of the value, if positive, */
- /* or the complement of its magnitude, if negative. */
- if (nbits) /* emit_bits rejects calls with size 0 */
- if (! emit_bits(state, (unsigned int) temp2, nbits))
- return FALSE;
-
- /* Encode the AC coefficients per section F.1.2.2 */
-
- r = 0; /* r = run length of zeros */
-
- for (k = 1; k < DCTSIZE2; k++) {
- if ((temp = block[jpeg_natural_order[k]]) == 0) {
- r++;
- } else {
- /* if run length > 15, must emit special run-length-16 codes (0xF0) */
- while (r > 15) {
- if (! emit_bits(state, actbl->ehufco[0xF0], actbl->ehufsi[0xF0]))
- return FALSE;
- r -= 16;
- }
-
- temp2 = temp;
- if (temp < 0) {
- temp = -temp; /* temp is abs value of input */
- /* This code assumes we are on a two's complement machine */
- temp2--;
- }
-
- /* Find the number of bits needed for the magnitude of the coefficient */
- nbits = 1; /* there must be at least one 1 bit */
- while ((temp >>= 1))
- nbits++;
- /* Check for out-of-range coefficient values */
- if (nbits > MAX_COEF_BITS)
- ERREXIT(state->cinfo, JERR_BAD_DCT_COEF);
-
- /* Emit Huffman symbol for run length / number of bits */
- i = (r << 4) + nbits;
- if (! emit_bits(state, actbl->ehufco[i], actbl->ehufsi[i]))
- return FALSE;
-
- /* Emit that number of bits of the value, if positive, */
- /* or the complement of its magnitude, if negative. */
- if (! emit_bits(state, (unsigned int) temp2, nbits))
- return FALSE;
-
- r = 0;
- }
- }
-
- /* If the last coef(s) were zero, emit an end-of-block code */
- if (r > 0)
- if (! emit_bits(state, actbl->ehufco[0], actbl->ehufsi[0]))
- return FALSE;
-
- return TRUE;
-}
-
-
-/*
- * Emit a restart marker & resynchronize predictions.
- */
-
-LOCAL(boolean)
-emit_restart (working_state * state, int restart_num)
-{
- int ci;
-
- if (! flush_bits(state))
- return FALSE;
-
- emit_byte(state, 0xFF, return FALSE);
- emit_byte(state, JPEG_RST0 + restart_num, return FALSE);
-
- /* Re-initialize DC predictions to 0 */
- for (ci = 0; ci < state->cinfo->comps_in_scan; ci++)
- state->cur.last_dc_val[ci] = 0;
-
- /* The restart counter is not updated until we successfully write the MCU. */
-
- return TRUE;
-}
-
-
-/*
- * Encode and output one MCU's worth of Huffman-compressed coefficients.
- */
-
-METHODDEF(boolean)
-encode_mcu_huff (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
-{
- huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
- working_state state;
- int blkn, ci;
- jpeg_component_info * compptr;
-
- /* Load up working state */
- state.next_output_byte = cinfo->dest->next_output_byte;
- state.free_in_buffer = cinfo->dest->free_in_buffer;
- ASSIGN_STATE(state.cur, entropy->saved);
- state.cinfo = cinfo;
-
- /* Emit restart marker if needed */
- if (cinfo->restart_interval) {
- if (entropy->restarts_to_go == 0)
- if (! emit_restart(&state, entropy->next_restart_num))
- return FALSE;
- }
-
- /* Encode the MCU data blocks */
- for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
- ci = cinfo->MCU_membership[blkn];
- compptr = cinfo->cur_comp_info[ci];
- if (! encode_one_block(&state,
- MCU_data[blkn][0], state.cur.last_dc_val[ci],
- entropy->dc_derived_tbls[compptr->dc_tbl_no],
- entropy->ac_derived_tbls[compptr->ac_tbl_no]))
- return FALSE;
- /* Update last_dc_val */
- state.cur.last_dc_val[ci] = MCU_data[blkn][0][0];
- }
-
- /* Completed MCU, so update state */
- cinfo->dest->next_output_byte = state.next_output_byte;
- cinfo->dest->free_in_buffer = state.free_in_buffer;
- ASSIGN_STATE(entropy->saved, state.cur);
-
- /* Update restart-interval state too */
- if (cinfo->restart_interval) {
- if (entropy->restarts_to_go == 0) {
- entropy->restarts_to_go = cinfo->restart_interval;
- entropy->next_restart_num++;
- entropy->next_restart_num &= 7;
- }
- entropy->restarts_to_go--;
- }
-
- return TRUE;
-}
-
-
-/*
- * Finish up at the end of a Huffman-compressed scan.
- */
-
-METHODDEF(void)
-finish_pass_huff (j_compress_ptr cinfo)
-{
- huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
- working_state state;
-
- /* Load up working state ... flush_bits needs it */
- state.next_output_byte = cinfo->dest->next_output_byte;
- state.free_in_buffer = cinfo->dest->free_in_buffer;
- ASSIGN_STATE(state.cur, entropy->saved);
- state.cinfo = cinfo;
-
- /* Flush out the last data */
- if (! flush_bits(&state))
- ERREXIT(cinfo, JERR_CANT_SUSPEND);
-
- /* Update state */
- cinfo->dest->next_output_byte = state.next_output_byte;
- cinfo->dest->free_in_buffer = state.free_in_buffer;
- ASSIGN_STATE(entropy->saved, state.cur);
-}
-
-
-/*
- * Huffman coding optimization.
- *
- * We first scan the supplied data and count the number of uses of each symbol
- * that is to be Huffman-coded. (This process MUST agree with the code above.)
- * Then we build a Huffman coding tree for the observed counts.
- * Symbols which are not needed at all for the particular image are not
- * assigned any code, which saves space in the DHT marker as well as in
- * the compressed data.
- */
-
-#ifdef ENTROPY_OPT_SUPPORTED
-
-
-/* Process a single block's worth of coefficients */
-
-LOCAL(void)
-htest_one_block (j_compress_ptr cinfo, JCOEFPTR block, int last_dc_val,
- long dc_counts[], long ac_counts[])
-{
- register int temp;
- register int nbits;
- register int k, r;
-
- /* Encode the DC coefficient difference per section F.1.2.1 */
-
- temp = block[0] - last_dc_val;
- if (temp < 0)
- temp = -temp;
-
- /* Find the number of bits needed for the magnitude of the coefficient */
- nbits = 0;
- while (temp) {
- nbits++;
- temp >>= 1;
- }
- /* Check for out-of-range coefficient values.
- * Since we're encoding a difference, the range limit is twice as much.
- */
- if (nbits > MAX_COEF_BITS+1)
- ERREXIT(cinfo, JERR_BAD_DCT_COEF);
-
- /* Count the Huffman symbol for the number of bits */
- dc_counts[nbits]++;
-
- /* Encode the AC coefficients per section F.1.2.2 */
-
- r = 0; /* r = run length of zeros */
-
- for (k = 1; k < DCTSIZE2; k++) {
- if ((temp = block[jpeg_natural_order[k]]) == 0) {
- r++;
- } else {
- /* if run length > 15, must emit special run-length-16 codes (0xF0) */
- while (r > 15) {
- ac_counts[0xF0]++;
- r -= 16;
- }
-
- /* Find the number of bits needed for the magnitude of the coefficient */
- if (temp < 0)
- temp = -temp;
-
- /* Find the number of bits needed for the magnitude of the coefficient */
- nbits = 1; /* there must be at least one 1 bit */
- while ((temp >>= 1))
- nbits++;
- /* Check for out-of-range coefficient values */
- if (nbits > MAX_COEF_BITS)
- ERREXIT(cinfo, JERR_BAD_DCT_COEF);
-
- /* Count Huffman symbol for run length / number of bits */
- ac_counts[(r << 4) + nbits]++;
-
- r = 0;
- }
- }
-
- /* If the last coef(s) were zero, emit an end-of-block code */
- if (r > 0)
- ac_counts[0]++;
-}
-
-
-/*
- * Trial-encode one MCU's worth of Huffman-compressed coefficients.
- * No data is actually output, so no suspension return is possible.
- */
-
-METHODDEF(boolean)
-encode_mcu_gather (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
-{
- huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
- int blkn, ci;
- jpeg_component_info * compptr;
-
- /* Take care of restart intervals if needed */
- if (cinfo->restart_interval) {
- if (entropy->restarts_to_go == 0) {
- /* Re-initialize DC predictions to 0 */
- for (ci = 0; ci < cinfo->comps_in_scan; ci++)
- entropy->saved.last_dc_val[ci] = 0;
- /* Update restart state */
- entropy->restarts_to_go = cinfo->restart_interval;
- }
- entropy->restarts_to_go--;
- }
-
- for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
- ci = cinfo->MCU_membership[blkn];
- compptr = cinfo->cur_comp_info[ci];
- htest_one_block(cinfo, MCU_data[blkn][0], entropy->saved.last_dc_val[ci],
- entropy->dc_count_ptrs[compptr->dc_tbl_no],
- entropy->ac_count_ptrs[compptr->ac_tbl_no]);
- entropy->saved.last_dc_val[ci] = MCU_data[blkn][0][0];
- }
-
- return TRUE;
-}
-
-
-/*
- * Generate the best Huffman code table for the given counts, fill htbl.
- * Note this is also used by jcphuff.c.
- *
- * The JPEG standard requires that no symbol be assigned a codeword of all
- * one bits (so that padding bits added at the end of a compressed segment
- * can't look like a valid code). Because of the canonical ordering of
- * codewords, this just means that there must be an unused slot in the
- * longest codeword length category. Section K.2 of the JPEG spec suggests
- * reserving such a slot by pretending that symbol 256 is a valid symbol
- * with count 1. In theory that's not optimal; giving it count zero but
- * including it in the symbol set anyway should give a better Huffman code.
- * But the theoretically better code actually seems to come out worse in
- * practice, because it produces more all-ones bytes (which incur stuffed
- * zero bytes in the final file). In any case the difference is tiny.
- *
- * The JPEG standard requires Huffman codes to be no more than 16 bits long.
- * If some symbols have a very small but nonzero probability, the Huffman tree
- * must be adjusted to meet the code length restriction. We currently use
- * the adjustment method suggested in JPEG section K.2. This method is *not*
- * optimal; it may not choose the best possible limited-length code. But
- * typically only very-low-frequency symbols will be given less-than-optimal
- * lengths, so the code is almost optimal. Experimental comparisons against
- * an optimal limited-length-code algorithm indicate that the difference is
- * microscopic --- usually less than a hundredth of a percent of total size.
- * So the extra complexity of an optimal algorithm doesn't seem worthwhile.
- */
-
-GLOBAL(void)
-jpeg_gen_optimal_table (j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[])
-{
-#define MAX_CLEN 32 /* assumed maximum initial code length */
- UINT8 bits[MAX_CLEN+1]; /* bits[k] = # of symbols with code length k */
- int codesize[257]; /* codesize[k] = code length of symbol k */
- int others[257]; /* next symbol in current branch of tree */
- int c1, c2;
- int p, i, j;
- long v;
-
- /* This algorithm is explained in section K.2 of the JPEG standard */
-
- MEMZERO(bits, SIZEOF(bits));
- MEMZERO(codesize, SIZEOF(codesize));
- for (i = 0; i < 257; i++)
- others[i] = -1; /* init links to empty */
-
- freq[256] = 1; /* make sure 256 has a nonzero count */
- /* Including the pseudo-symbol 256 in the Huffman procedure guarantees
- * that no real symbol is given code-value of all ones, because 256
- * will be placed last in the largest codeword category.
- */
-
- /* Huffman's basic algorithm to assign optimal code lengths to symbols */
-
- for (;;) {
- /* Find the smallest nonzero frequency, set c1 = its symbol */
- /* In case of ties, take the larger symbol number */
- c1 = -1;
- v = 1000000000L;
- for (i = 0; i <= 256; i++) {
- if (freq[i] && freq[i] <= v) {
- v = freq[i];
- c1 = i;
- }
- }
-
- /* Find the next smallest nonzero frequency, set c2 = its symbol */
- /* In case of ties, take the larger symbol number */
- c2 = -1;
- v = 1000000000L;
- for (i = 0; i <= 256; i++) {
- if (freq[i] && freq[i] <= v && i != c1) {
- v = freq[i];
- c2 = i;
- }
- }
-
- /* Done if we've merged everything into one frequency */
- if (c2 < 0)
- break;
-
- /* Else merge the two counts/trees */
- freq[c1] += freq[c2];
- freq[c2] = 0;
-
- /* Increment the codesize of everything in c1's tree branch */
- codesize[c1]++;
- while (others[c1] >= 0) {
- c1 = others[c1];
- codesize[c1]++;
- }
-
- others[c1] = c2; /* chain c2 onto c1's tree branch */
-
- /* Increment the codesize of everything in c2's tree branch */
- codesize[c2]++;
- while (others[c2] >= 0) {
- c2 = others[c2];
- codesize[c2]++;
- }
- }
-
- /* Now count the number of symbols of each code length */
- for (i = 0; i <= 256; i++) {
- if (codesize[i]) {
- /* The JPEG standard seems to think that this can't happen, */
- /* but I'm paranoid... */
- if (codesize[i] > MAX_CLEN)
- ERREXIT(cinfo, JERR_HUFF_CLEN_OVERFLOW);
-
- bits[codesize[i]]++;
- }
- }
-
- /* JPEG doesn't allow symbols with code lengths over 16 bits, so if the pure
- * Huffman procedure assigned any such lengths, we must adjust the coding.
- * Here is what the JPEG spec says about how this next bit works:
- * Since symbols are paired for the longest Huffman code, the symbols are
- * removed from this length category two at a time. The prefix for the pair
- * (which is one bit shorter) is allocated to one of the pair; then,
- * skipping the BITS entry for that prefix length, a code word from the next
- * shortest nonzero BITS entry is converted into a prefix for two code words
- * one bit longer.
- */
-
- for (i = MAX_CLEN; i > 16; i--) {
- while (bits[i] > 0) {
- j = i - 2; /* find length of new prefix to be used */
- while (bits[j] == 0)
- j--;
-
- bits[i] -= 2; /* remove two symbols */
- bits[i-1]++; /* one goes in this length */
- bits[j+1] += 2; /* two new symbols in this length */
- bits[j]--; /* symbol of this length is now a prefix */
- }
- }
-
- /* Remove the count for the pseudo-symbol 256 from the largest codelength */
- while (bits[i] == 0) /* find largest codelength still in use */
- i--;
- bits[i]--;
-
- /* Return final symbol counts (only for lengths 0..16) */
- MEMCOPY(htbl->bits, bits, SIZEOF(htbl->bits));
-
- /* Return a list of the symbols sorted by code length */
- /* It's not real clear to me why we don't need to consider the codelength
- * changes made above, but the JPEG spec seems to think this works.
- */
- p = 0;
- for (i = 1; i <= MAX_CLEN; i++) {
- for (j = 0; j <= 255; j++) {
- if (codesize[j] == i) {
- htbl->huffval[p] = (UINT8) j;
- p++;
- }
- }
- }
-
- /* Set sent_table FALSE so updated table will be written to JPEG file. */
- htbl->sent_table = FALSE;
-}
-
-
-/*
- * Finish up a statistics-gathering pass and create the new Huffman tables.
- */
-
-METHODDEF(void)
-finish_pass_gather (j_compress_ptr cinfo)
-{
- huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
- int ci, dctbl, actbl;
- jpeg_component_info * compptr;
- JHUFF_TBL **htblptr;
- boolean did_dc[NUM_HUFF_TBLS];
- boolean did_ac[NUM_HUFF_TBLS];
-
- /* It's important not to apply jpeg_gen_optimal_table more than once
- * per table, because it clobbers the input frequency counts!
- */
- MEMZERO(did_dc, SIZEOF(did_dc));
- MEMZERO(did_ac, SIZEOF(did_ac));
-
- for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
- compptr = cinfo->cur_comp_info[ci];
- dctbl = compptr->dc_tbl_no;
- actbl = compptr->ac_tbl_no;
- if (! did_dc[dctbl]) {
- htblptr = & cinfo->dc_huff_tbl_ptrs[dctbl];
- if (*htblptr == NULL)
- *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);
- jpeg_gen_optimal_table(cinfo, *htblptr, entropy->dc_count_ptrs[dctbl]);
- did_dc[dctbl] = TRUE;
- }
- if (! did_ac[actbl]) {
- htblptr = & cinfo->ac_huff_tbl_ptrs[actbl];
- if (*htblptr == NULL)
- *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);
- jpeg_gen_optimal_table(cinfo, *htblptr, entropy->ac_count_ptrs[actbl]);
- did_ac[actbl] = TRUE;
- }
- }
-}
-
-
-#endif /* ENTROPY_OPT_SUPPORTED */
-
-
-/*
- * Module initialization routine for Huffman entropy encoding.
- */
-
-GLOBAL(void)
-jinit_huff_encoder (j_compress_ptr cinfo)
-{
- huff_entropy_ptr entropy;
- int i;
-
- entropy = (huff_entropy_ptr)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- SIZEOF(huff_entropy_encoder));
- cinfo->entropy = (struct jpeg_entropy_encoder *) entropy;
- entropy->pub.start_pass = start_pass_huff;
-
- /* Mark tables unallocated */
- for (i = 0; i < NUM_HUFF_TBLS; i++) {
- entropy->dc_derived_tbls[i] = entropy->ac_derived_tbls[i] = NULL;
-#ifdef ENTROPY_OPT_SUPPORTED
- entropy->dc_count_ptrs[i] = entropy->ac_count_ptrs[i] = NULL;
-#endif
- }
-}
-
-#endif //_FX_JPEG_TURBO_
+#if !defined(_FX_JPEG_TURBO_)
+/*
+ * jchuff.c
+ *
+ * Copyright (C) 1991-1997, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains Huffman entropy encoding routines.
+ *
+ * Much of the complexity here has to do with supporting output suspension.
+ * If the data destination module demands suspension, we want to be able to
+ * back up to the start of the current MCU. To do this, we copy state
+ * variables into local working storage, and update them back to the
+ * permanent JPEG objects only upon successful completion of an MCU.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+#include "jchuff.h" /* Declarations shared with jcphuff.c */
+
+#ifdef _FX_MANAGED_CODE_
+#define savable_state savable_state_c
+#endif
+
+/* Expanded entropy encoder object for Huffman encoding.
+ *
+ * The savable_state subrecord contains fields that change within an MCU,
+ * but must not be updated permanently until we complete the MCU.
+ */
+
+typedef struct {
+ INT32 put_buffer; /* current bit-accumulation buffer */
+ int put_bits; /* # of bits now in it */
+ int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */
+} savable_state;
+
+/* This macro is to work around compilers with missing or broken
+ * structure assignment. You'll need to fix this code if you have
+ * such a compiler and you change MAX_COMPS_IN_SCAN.
+ */
+
+#ifndef NO_STRUCT_ASSIGN
+#define ASSIGN_STATE(dest,src) ((dest) = (src))
+#else
+#if MAX_COMPS_IN_SCAN == 4
+#define ASSIGN_STATE(dest,src) \
+ ((dest).put_buffer = (src).put_buffer, \
+ (dest).put_bits = (src).put_bits, \
+ (dest).last_dc_val[0] = (src).last_dc_val[0], \
+ (dest).last_dc_val[1] = (src).last_dc_val[1], \
+ (dest).last_dc_val[2] = (src).last_dc_val[2], \
+ (dest).last_dc_val[3] = (src).last_dc_val[3])
+#endif
+#endif
+
+
+typedef struct {
+ struct jpeg_entropy_encoder pub; /* public fields */
+
+ savable_state saved; /* Bit buffer & DC state at start of MCU */
+
+ /* These fields are NOT loaded into local working state. */
+ unsigned int restarts_to_go; /* MCUs left in this restart interval */
+ int next_restart_num; /* next restart number to write (0-7) */
+
+ /* Pointers to derived tables (these workspaces have image lifespan) */
+ c_derived_tbl * dc_derived_tbls[NUM_HUFF_TBLS];
+ c_derived_tbl * ac_derived_tbls[NUM_HUFF_TBLS];
+
+#ifdef ENTROPY_OPT_SUPPORTED /* Statistics tables for optimization */
+ long * dc_count_ptrs[NUM_HUFF_TBLS];
+ long * ac_count_ptrs[NUM_HUFF_TBLS];
+#endif
+} huff_entropy_encoder;
+
+typedef huff_entropy_encoder * huff_entropy_ptr;
+
+/* Working state while writing an MCU.
+ * This struct contains all the fields that are needed by subroutines.
+ */
+
+typedef struct {
+ JOCTET * next_output_byte; /* => next byte to write in buffer */
+ size_t free_in_buffer; /* # of byte spaces remaining in buffer */
+ savable_state cur; /* Current bit buffer & DC state */
+ j_compress_ptr cinfo; /* dump_buffer needs access to this */
+} working_state;
+
+
+/* Forward declarations */
+METHODDEF(boolean) encode_mcu_huff JPP((j_compress_ptr cinfo,
+ JBLOCKROW *MCU_data));
+METHODDEF(void) finish_pass_huff JPP((j_compress_ptr cinfo));
+#ifdef ENTROPY_OPT_SUPPORTED
+METHODDEF(boolean) encode_mcu_gather JPP((j_compress_ptr cinfo,
+ JBLOCKROW *MCU_data));
+METHODDEF(void) finish_pass_gather JPP((j_compress_ptr cinfo));
+#endif
+
+
+/*
+ * Initialize for a Huffman-compressed scan.
+ * If gather_statistics is TRUE, we do not output anything during the scan,
+ * just count the Huffman symbols used and generate Huffman code tables.
+ */
+
+METHODDEF(void)
+start_pass_huff (j_compress_ptr cinfo, boolean gather_statistics)
+{
+ huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
+ int ci, dctbl, actbl;
+ jpeg_component_info * compptr;
+
+ if (gather_statistics) {
+#ifdef ENTROPY_OPT_SUPPORTED
+ entropy->pub.encode_mcu = encode_mcu_gather;
+ entropy->pub.finish_pass = finish_pass_gather;
+#else
+ ERREXIT(cinfo, JERR_NOT_COMPILED);
+#endif
+ } else {
+ entropy->pub.encode_mcu = encode_mcu_huff;
+ entropy->pub.finish_pass = finish_pass_huff;
+ }
+
+ for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
+ compptr = cinfo->cur_comp_info[ci];
+ dctbl = compptr->dc_tbl_no;
+ actbl = compptr->ac_tbl_no;
+ if (gather_statistics) {
+#ifdef ENTROPY_OPT_SUPPORTED
+ /* Check for invalid table indexes */
+ /* (make_c_derived_tbl does this in the other path) */
+ if (dctbl < 0 || dctbl >= NUM_HUFF_TBLS)
+ ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, dctbl);
+ if (actbl < 0 || actbl >= NUM_HUFF_TBLS)
+ ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, actbl);
+ /* Allocate and zero the statistics tables */
+ /* Note that jpeg_gen_optimal_table expects 257 entries in each table! */
+ if (entropy->dc_count_ptrs[dctbl] == NULL)
+ entropy->dc_count_ptrs[dctbl] = (long *)
+ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ 257 * SIZEOF(long));
+ MEMZERO(entropy->dc_count_ptrs[dctbl], 257 * SIZEOF(long));
+ if (entropy->ac_count_ptrs[actbl] == NULL)
+ entropy->ac_count_ptrs[actbl] = (long *)
+ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ 257 * SIZEOF(long));
+ MEMZERO(entropy->ac_count_ptrs[actbl], 257 * SIZEOF(long));
+#endif
+ } else {
+ /* Compute derived values for Huffman tables */
+ /* We may do this more than once for a table, but it's not expensive */
+ jpeg_make_c_derived_tbl(cinfo, TRUE, dctbl,
+ & entropy->dc_derived_tbls[dctbl]);
+ jpeg_make_c_derived_tbl(cinfo, FALSE, actbl,
+ & entropy->ac_derived_tbls[actbl]);
+ }
+ /* Initialize DC predictions to 0 */
+ entropy->saved.last_dc_val[ci] = 0;
+ }
+
+ /* Initialize bit buffer to empty */
+ entropy->saved.put_buffer = 0;
+ entropy->saved.put_bits = 0;
+
+ /* Initialize restart stuff */
+ entropy->restarts_to_go = cinfo->restart_interval;
+ entropy->next_restart_num = 0;
+}
+
+
+/*
+ * Compute the derived values for a Huffman table.
+ * This routine also performs some validation checks on the table.
+ *
+ * Note this is also used by jcphuff.c.
+ */
+
+GLOBAL(void)
+jpeg_make_c_derived_tbl (j_compress_ptr cinfo, boolean isDC, int tblno,
+ c_derived_tbl ** pdtbl)
+{
+ JHUFF_TBL *htbl;
+ c_derived_tbl *dtbl;
+ int p, i, l, lastp, _si, maxsymbol;
+ char huffsize[257];
+ unsigned int huffcode[257];
+ unsigned int code;
+
+ /* Note that huffsize[] and huffcode[] are filled in code-length order,
+ * paralleling the order of the symbols themselves in htbl->huffval[].
+ */
+
+ /* Find the input Huffman table */
+ if (tblno < 0 || tblno >= NUM_HUFF_TBLS)
+ ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno);
+ htbl =
+ isDC ? cinfo->dc_huff_tbl_ptrs[tblno] : cinfo->ac_huff_tbl_ptrs[tblno];
+ if (htbl == NULL)
+ ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno);
+
+ /* Allocate a workspace if we haven't already done so. */
+ if (*pdtbl == NULL)
+ *pdtbl = (c_derived_tbl *)
+ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ SIZEOF(c_derived_tbl));
+ dtbl = *pdtbl;
+
+ /* Figure C.1: make table of Huffman code length for each symbol */
+
+ p = 0;
+ for (l = 1; l <= 16; l++) {
+ i = (int) htbl->bits[l];
+ if (i < 0 || p + i > 256) /* protect against table overrun */
+ ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
+ while (i--)
+ huffsize[p++] = (char) l;
+ }
+ huffsize[p] = 0;
+ lastp = p;
+
+ /* Figure C.2: generate the codes themselves */
+ /* We also validate that the counts represent a legal Huffman code tree. */
+
+ code = 0;
+ _si = huffsize[0];
+ p = 0;
+ while (huffsize[p]) {
+ while (((int) huffsize[p]) == _si) {
+ huffcode[p++] = code;
+ code++;
+ }
+ /* code is now 1 more than the last code used for codelength si; but
+ * it must still fit in si bits, since no code is allowed to be all ones.
+ */
+ if (((INT32) code) >= (((INT32) 1) << _si))
+ ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
+ code <<= 1;
+ _si++;
+ }
+
+ /* Figure C.3: generate encoding tables */
+ /* These are code and size indexed by symbol value */
+
+ /* Set all codeless symbols to have code length 0;
+ * this lets us detect duplicate VAL entries here, and later
+ * allows emit_bits to detect any attempt to emit such symbols.
+ */
+ MEMZERO(dtbl->ehufsi, SIZEOF(dtbl->ehufsi));
+
+ /* This is also a convenient place to check for out-of-range
+ * and duplicated VAL entries. We allow 0..255 for AC symbols
+ * but only 0..15 for DC. (We could constrain them further
+ * based on data depth and mode, but this seems enough.)
+ */
+ maxsymbol = isDC ? 15 : 255;
+
+ for (p = 0; p < lastp; p++) {
+ i = htbl->huffval[p];
+ if (i < 0 || i > maxsymbol || dtbl->ehufsi[i])
+ ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
+ dtbl->ehufco[i] = huffcode[p];
+ dtbl->ehufsi[i] = huffsize[p];
+ }
+}
+
+
+/* Outputting bytes to the file */
+
+/* Emit a byte, taking 'action' if must suspend. */
+#define emit_byte(state,val,action) \
+ { *(state)->next_output_byte++ = (JOCTET) (val); \
+ if (--(state)->free_in_buffer == 0) \
+ if (! dump_buffer(state)) \
+ { action; } }
+
+
+LOCAL(boolean)
+dump_buffer (working_state * state)
+/* Empty the output buffer; return TRUE if successful, FALSE if must suspend */
+{
+ struct jpeg_destination_mgr * dest = state->cinfo->dest;
+
+ if (! (*dest->empty_output_buffer) (state->cinfo))
+ return FALSE;
+ /* After a successful buffer dump, must reset buffer pointers */
+ state->next_output_byte = dest->next_output_byte;
+ state->free_in_buffer = dest->free_in_buffer;
+ return TRUE;
+}
+
+
+/* Outputting bits to the file */
+
+/* Only the right 24 bits of put_buffer are used; the valid bits are
+ * left-justified in this part. At most 16 bits can be passed to emit_bits
+ * in one call, and we never retain more than 7 bits in put_buffer
+ * between calls, so 24 bits are sufficient.
+ */
+
+INLINE
+LOCAL(boolean)
+emit_bits (working_state * state, unsigned int code, int size)
+/* Emit some bits; return TRUE if successful, FALSE if must suspend */
+{
+ /* This routine is heavily used, so it's worth coding tightly. */
+ register INT32 put_buffer = (INT32) code;
+ register int put_bits = state->cur.put_bits;
+
+ /* if size is 0, caller used an invalid Huffman table entry */
+ if (size == 0)
+ ERREXIT(state->cinfo, JERR_HUFF_MISSING_CODE);
+
+ put_buffer &= (((INT32) 1)<<size) - 1; /* mask off any extra bits in code */
+
+ put_bits += size; /* new number of bits in buffer */
+
+ put_buffer <<= 24 - put_bits; /* align incoming bits */
+
+ put_buffer |= state->cur.put_buffer; /* and merge with old buffer contents */
+
+ while (put_bits >= 8) {
+ int c = (int) ((put_buffer >> 16) & 0xFF);
+
+ emit_byte(state, c, return FALSE);
+ if (c == 0xFF) { /* need to stuff a zero byte? */
+ emit_byte(state, 0, return FALSE);
+ }
+ put_buffer <<= 8;
+ put_bits -= 8;
+ }
+
+ state->cur.put_buffer = put_buffer; /* update state variables */
+ state->cur.put_bits = put_bits;
+
+ return TRUE;
+}
+
+
+LOCAL(boolean)
+flush_bits (working_state * state)
+{
+ if (! emit_bits(state, 0x7F, 7)) /* fill any partial byte with ones */
+ return FALSE;
+ state->cur.put_buffer = 0; /* and reset bit-buffer to empty */
+ state->cur.put_bits = 0;
+ return TRUE;
+}
+
+
+/* Encode a single block's worth of coefficients */
+
+LOCAL(boolean)
+encode_one_block (working_state * state, JCOEFPTR block, int last_dc_val,
+ c_derived_tbl *dctbl, c_derived_tbl *actbl)
+{
+ register int temp, temp2;
+ register int nbits;
+ register int k, r, i;
+
+ /* Encode the DC coefficient difference per section F.1.2.1 */
+
+ temp = temp2 = block[0] - last_dc_val;
+
+ if (temp < 0) {
+ temp = -temp; /* temp is abs value of input */
+ /* For a negative input, want temp2 = bitwise complement of abs(input) */
+ /* This code assumes we are on a two's complement machine */
+ temp2--;
+ }
+
+ /* Find the number of bits needed for the magnitude of the coefficient */
+ nbits = 0;
+ while (temp) {
+ nbits++;
+ temp >>= 1;
+ }
+ /* Check for out-of-range coefficient values.
+ * Since we're encoding a difference, the range limit is twice as much.
+ */
+ if (nbits > MAX_COEF_BITS+1)
+ ERREXIT(state->cinfo, JERR_BAD_DCT_COEF);
+
+ /* Emit the Huffman-coded symbol for the number of bits */
+ if (! emit_bits(state, dctbl->ehufco[nbits], dctbl->ehufsi[nbits]))
+ return FALSE;
+
+ /* Emit that number of bits of the value, if positive, */
+ /* or the complement of its magnitude, if negative. */
+ if (nbits) /* emit_bits rejects calls with size 0 */
+ if (! emit_bits(state, (unsigned int) temp2, nbits))
+ return FALSE;
+
+ /* Encode the AC coefficients per section F.1.2.2 */
+
+ r = 0; /* r = run length of zeros */
+
+ for (k = 1; k < DCTSIZE2; k++) {
+ if ((temp = block[jpeg_natural_order[k]]) == 0) {
+ r++;
+ } else {
+ /* if run length > 15, must emit special run-length-16 codes (0xF0) */
+ while (r > 15) {
+ if (! emit_bits(state, actbl->ehufco[0xF0], actbl->ehufsi[0xF0]))
+ return FALSE;
+ r -= 16;
+ }
+
+ temp2 = temp;
+ if (temp < 0) {
+ temp = -temp; /* temp is abs value of input */
+ /* This code assumes we are on a two's complement machine */
+ temp2--;
+ }
+
+ /* Find the number of bits needed for the magnitude of the coefficient */
+ nbits = 1; /* there must be at least one 1 bit */
+ while ((temp >>= 1))
+ nbits++;
+ /* Check for out-of-range coefficient values */
+ if (nbits > MAX_COEF_BITS)
+ ERREXIT(state->cinfo, JERR_BAD_DCT_COEF);
+
+ /* Emit Huffman symbol for run length / number of bits */
+ i = (r << 4) + nbits;
+ if (! emit_bits(state, actbl->ehufco[i], actbl->ehufsi[i]))
+ return FALSE;
+
+ /* Emit that number of bits of the value, if positive, */
+ /* or the complement of its magnitude, if negative. */
+ if (! emit_bits(state, (unsigned int) temp2, nbits))
+ return FALSE;
+
+ r = 0;
+ }
+ }
+
+ /* If the last coef(s) were zero, emit an end-of-block code */
+ if (r > 0)
+ if (! emit_bits(state, actbl->ehufco[0], actbl->ehufsi[0]))
+ return FALSE;
+
+ return TRUE;
+}
+
+
+/*
+ * Emit a restart marker & resynchronize predictions.
+ */
+
+LOCAL(boolean)
+emit_restart (working_state * state, int restart_num)
+{
+ int ci;
+
+ if (! flush_bits(state))
+ return FALSE;
+
+ emit_byte(state, 0xFF, return FALSE);
+ emit_byte(state, JPEG_RST0 + restart_num, return FALSE);
+
+ /* Re-initialize DC predictions to 0 */
+ for (ci = 0; ci < state->cinfo->comps_in_scan; ci++)
+ state->cur.last_dc_val[ci] = 0;
+
+ /* The restart counter is not updated until we successfully write the MCU. */
+
+ return TRUE;
+}
+
+
+/*
+ * Encode and output one MCU's worth of Huffman-compressed coefficients.
+ */
+
+METHODDEF(boolean)
+encode_mcu_huff (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
+{
+ huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
+ working_state state;
+ int blkn, ci;
+ jpeg_component_info * compptr;
+
+ /* Load up working state */
+ state.next_output_byte = cinfo->dest->next_output_byte;
+ state.free_in_buffer = cinfo->dest->free_in_buffer;
+ ASSIGN_STATE(state.cur, entropy->saved);
+ state.cinfo = cinfo;
+
+ /* Emit restart marker if needed */
+ if (cinfo->restart_interval) {
+ if (entropy->restarts_to_go == 0)
+ if (! emit_restart(&state, entropy->next_restart_num))
+ return FALSE;
+ }
+
+ /* Encode the MCU data blocks */
+ for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
+ ci = cinfo->MCU_membership[blkn];
+ compptr = cinfo->cur_comp_info[ci];
+ if (! encode_one_block(&state,
+ MCU_data[blkn][0], state.cur.last_dc_val[ci],
+ entropy->dc_derived_tbls[compptr->dc_tbl_no],
+ entropy->ac_derived_tbls[compptr->ac_tbl_no]))
+ return FALSE;
+ /* Update last_dc_val */
+ state.cur.last_dc_val[ci] = MCU_data[blkn][0][0];
+ }
+
+ /* Completed MCU, so update state */
+ cinfo->dest->next_output_byte = state.next_output_byte;
+ cinfo->dest->free_in_buffer = state.free_in_buffer;
+ ASSIGN_STATE(entropy->saved, state.cur);
+
+ /* Update restart-interval state too */
+ if (cinfo->restart_interval) {
+ if (entropy->restarts_to_go == 0) {
+ entropy->restarts_to_go = cinfo->restart_interval;
+ entropy->next_restart_num++;
+ entropy->next_restart_num &= 7;
+ }
+ entropy->restarts_to_go--;
+ }
+
+ return TRUE;
+}
+
+
+/*
+ * Finish up at the end of a Huffman-compressed scan.
+ */
+
+METHODDEF(void)
+finish_pass_huff (j_compress_ptr cinfo)
+{
+ huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
+ working_state state;
+
+ /* Load up working state ... flush_bits needs it */
+ state.next_output_byte = cinfo->dest->next_output_byte;
+ state.free_in_buffer = cinfo->dest->free_in_buffer;
+ ASSIGN_STATE(state.cur, entropy->saved);
+ state.cinfo = cinfo;
+
+ /* Flush out the last data */
+ if (! flush_bits(&state))
+ ERREXIT(cinfo, JERR_CANT_SUSPEND);
+
+ /* Update state */
+ cinfo->dest->next_output_byte = state.next_output_byte;
+ cinfo->dest->free_in_buffer = state.free_in_buffer;
+ ASSIGN_STATE(entropy->saved, state.cur);
+}
+
+
+/*
+ * Huffman coding optimization.
+ *
+ * We first scan the supplied data and count the number of uses of each symbol
+ * that is to be Huffman-coded. (This process MUST agree with the code above.)
+ * Then we build a Huffman coding tree for the observed counts.
+ * Symbols which are not needed at all for the particular image are not
+ * assigned any code, which saves space in the DHT marker as well as in
+ * the compressed data.
+ */
+
+#ifdef ENTROPY_OPT_SUPPORTED
+
+
+/* Process a single block's worth of coefficients */
+
+LOCAL(void)
+htest_one_block (j_compress_ptr cinfo, JCOEFPTR block, int last_dc_val,
+ long dc_counts[], long ac_counts[])
+{
+ register int temp;
+ register int nbits;
+ register int k, r;
+
+ /* Encode the DC coefficient difference per section F.1.2.1 */
+
+ temp = block[0] - last_dc_val;
+ if (temp < 0)
+ temp = -temp;
+
+ /* Find the number of bits needed for the magnitude of the coefficient */
+ nbits = 0;
+ while (temp) {
+ nbits++;
+ temp >>= 1;
+ }
+ /* Check for out-of-range coefficient values.
+ * Since we're encoding a difference, the range limit is twice as much.
+ */
+ if (nbits > MAX_COEF_BITS+1)
+ ERREXIT(cinfo, JERR_BAD_DCT_COEF);
+
+ /* Count the Huffman symbol for the number of bits */
+ dc_counts[nbits]++;
+
+ /* Encode the AC coefficients per section F.1.2.2 */
+
+ r = 0; /* r = run length of zeros */
+
+ for (k = 1; k < DCTSIZE2; k++) {
+ if ((temp = block[jpeg_natural_order[k]]) == 0) {
+ r++;
+ } else {
+ /* if run length > 15, must emit special run-length-16 codes (0xF0) */
+ while (r > 15) {
+ ac_counts[0xF0]++;
+ r -= 16;
+ }
+
+ /* Find the number of bits needed for the magnitude of the coefficient */
+ if (temp < 0)
+ temp = -temp;
+
+ /* Find the number of bits needed for the magnitude of the coefficient */
+ nbits = 1; /* there must be at least one 1 bit */
+ while ((temp >>= 1))
+ nbits++;
+ /* Check for out-of-range coefficient values */
+ if (nbits > MAX_COEF_BITS)
+ ERREXIT(cinfo, JERR_BAD_DCT_COEF);
+
+ /* Count Huffman symbol for run length / number of bits */
+ ac_counts[(r << 4) + nbits]++;
+
+ r = 0;
+ }
+ }
+
+ /* If the last coef(s) were zero, emit an end-of-block code */
+ if (r > 0)
+ ac_counts[0]++;
+}
+
+
+/*
+ * Trial-encode one MCU's worth of Huffman-compressed coefficients.
+ * No data is actually output, so no suspension return is possible.
+ */
+
+METHODDEF(boolean)
+encode_mcu_gather (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
+{
+ huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
+ int blkn, ci;
+ jpeg_component_info * compptr;
+
+ /* Take care of restart intervals if needed */
+ if (cinfo->restart_interval) {
+ if (entropy->restarts_to_go == 0) {
+ /* Re-initialize DC predictions to 0 */
+ for (ci = 0; ci < cinfo->comps_in_scan; ci++)
+ entropy->saved.last_dc_val[ci] = 0;
+ /* Update restart state */
+ entropy->restarts_to_go = cinfo->restart_interval;
+ }
+ entropy->restarts_to_go--;
+ }
+
+ for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
+ ci = cinfo->MCU_membership[blkn];
+ compptr = cinfo->cur_comp_info[ci];
+ htest_one_block(cinfo, MCU_data[blkn][0], entropy->saved.last_dc_val[ci],
+ entropy->dc_count_ptrs[compptr->dc_tbl_no],
+ entropy->ac_count_ptrs[compptr->ac_tbl_no]);
+ entropy->saved.last_dc_val[ci] = MCU_data[blkn][0][0];
+ }
+
+ return TRUE;
+}
+
+
+/*
+ * Generate the best Huffman code table for the given counts, fill htbl.
+ * Note this is also used by jcphuff.c.
+ *
+ * The JPEG standard requires that no symbol be assigned a codeword of all
+ * one bits (so that padding bits added at the end of a compressed segment
+ * can't look like a valid code). Because of the canonical ordering of
+ * codewords, this just means that there must be an unused slot in the
+ * longest codeword length category. Section K.2 of the JPEG spec suggests
+ * reserving such a slot by pretending that symbol 256 is a valid symbol
+ * with count 1. In theory that's not optimal; giving it count zero but
+ * including it in the symbol set anyway should give a better Huffman code.
+ * But the theoretically better code actually seems to come out worse in
+ * practice, because it produces more all-ones bytes (which incur stuffed
+ * zero bytes in the final file). In any case the difference is tiny.
+ *
+ * The JPEG standard requires Huffman codes to be no more than 16 bits long.
+ * If some symbols have a very small but nonzero probability, the Huffman tree
+ * must be adjusted to meet the code length restriction. We currently use
+ * the adjustment method suggested in JPEG section K.2. This method is *not*
+ * optimal; it may not choose the best possible limited-length code. But
+ * typically only very-low-frequency symbols will be given less-than-optimal
+ * lengths, so the code is almost optimal. Experimental comparisons against
+ * an optimal limited-length-code algorithm indicate that the difference is
+ * microscopic --- usually less than a hundredth of a percent of total size.
+ * So the extra complexity of an optimal algorithm doesn't seem worthwhile.
+ */
+
+GLOBAL(void)
+jpeg_gen_optimal_table (j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[])
+{
+#define MAX_CLEN 32 /* assumed maximum initial code length */
+ UINT8 bits[MAX_CLEN+1]; /* bits[k] = # of symbols with code length k */
+ int codesize[257]; /* codesize[k] = code length of symbol k */
+ int others[257]; /* next symbol in current branch of tree */
+ int c1, c2;
+ int p, i, j;
+ long v;
+
+ /* This algorithm is explained in section K.2 of the JPEG standard */
+
+ MEMZERO(bits, SIZEOF(bits));
+ MEMZERO(codesize, SIZEOF(codesize));
+ for (i = 0; i < 257; i++)
+ others[i] = -1; /* init links to empty */
+
+ freq[256] = 1; /* make sure 256 has a nonzero count */
+ /* Including the pseudo-symbol 256 in the Huffman procedure guarantees
+ * that no real symbol is given code-value of all ones, because 256
+ * will be placed last in the largest codeword category.
+ */
+
+ /* Huffman's basic algorithm to assign optimal code lengths to symbols */
+
+ for (;;) {
+ /* Find the smallest nonzero frequency, set c1 = its symbol */
+ /* In case of ties, take the larger symbol number */
+ c1 = -1;
+ v = 1000000000L;
+ for (i = 0; i <= 256; i++) {
+ if (freq[i] && freq[i] <= v) {
+ v = freq[i];
+ c1 = i;
+ }
+ }
+
+ /* Find the next smallest nonzero frequency, set c2 = its symbol */
+ /* In case of ties, take the larger symbol number */
+ c2 = -1;
+ v = 1000000000L;
+ for (i = 0; i <= 256; i++) {
+ if (freq[i] && freq[i] <= v && i != c1) {
+ v = freq[i];
+ c2 = i;
+ }
+ }
+
+ /* Done if we've merged everything into one frequency */
+ if (c2 < 0)
+ break;
+
+ /* Else merge the two counts/trees */
+ freq[c1] += freq[c2];
+ freq[c2] = 0;
+
+ /* Increment the codesize of everything in c1's tree branch */
+ codesize[c1]++;
+ while (others[c1] >= 0) {
+ c1 = others[c1];
+ codesize[c1]++;
+ }
+
+ others[c1] = c2; /* chain c2 onto c1's tree branch */
+
+ /* Increment the codesize of everything in c2's tree branch */
+ codesize[c2]++;
+ while (others[c2] >= 0) {
+ c2 = others[c2];
+ codesize[c2]++;
+ }
+ }
+
+ /* Now count the number of symbols of each code length */
+ for (i = 0; i <= 256; i++) {
+ if (codesize[i]) {
+ /* The JPEG standard seems to think that this can't happen, */
+ /* but I'm paranoid... */
+ if (codesize[i] > MAX_CLEN)
+ ERREXIT(cinfo, JERR_HUFF_CLEN_OVERFLOW);
+
+ bits[codesize[i]]++;
+ }
+ }
+
+ /* JPEG doesn't allow symbols with code lengths over 16 bits, so if the pure
+ * Huffman procedure assigned any such lengths, we must adjust the coding.
+ * Here is what the JPEG spec says about how this next bit works:
+ * Since symbols are paired for the longest Huffman code, the symbols are
+ * removed from this length category two at a time. The prefix for the pair
+ * (which is one bit shorter) is allocated to one of the pair; then,
+ * skipping the BITS entry for that prefix length, a code word from the next
+ * shortest nonzero BITS entry is converted into a prefix for two code words
+ * one bit longer.
+ */
+
+ for (i = MAX_CLEN; i > 16; i--) {
+ while (bits[i] > 0) {
+ j = i - 2; /* find length of new prefix to be used */
+ while (bits[j] == 0)
+ j--;
+
+ bits[i] -= 2; /* remove two symbols */
+ bits[i-1]++; /* one goes in this length */
+ bits[j+1] += 2; /* two new symbols in this length */
+ bits[j]--; /* symbol of this length is now a prefix */
+ }
+ }
+
+ /* Remove the count for the pseudo-symbol 256 from the largest codelength */
+ while (bits[i] == 0) /* find largest codelength still in use */
+ i--;
+ bits[i]--;
+
+ /* Return final symbol counts (only for lengths 0..16) */
+ MEMCOPY(htbl->bits, bits, SIZEOF(htbl->bits));
+
+ /* Return a list of the symbols sorted by code length */
+ /* It's not real clear to me why we don't need to consider the codelength
+ * changes made above, but the JPEG spec seems to think this works.
+ */
+ p = 0;
+ for (i = 1; i <= MAX_CLEN; i++) {
+ for (j = 0; j <= 255; j++) {
+ if (codesize[j] == i) {
+ htbl->huffval[p] = (UINT8) j;
+ p++;
+ }
+ }
+ }
+
+ /* Set sent_table FALSE so updated table will be written to JPEG file. */
+ htbl->sent_table = FALSE;
+}
+
+
+/*
+ * Finish up a statistics-gathering pass and create the new Huffman tables.
+ */
+
+METHODDEF(void)
+finish_pass_gather (j_compress_ptr cinfo)
+{
+ huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
+ int ci, dctbl, actbl;
+ jpeg_component_info * compptr;
+ JHUFF_TBL **htblptr;
+ boolean did_dc[NUM_HUFF_TBLS];
+ boolean did_ac[NUM_HUFF_TBLS];
+
+ /* It's important not to apply jpeg_gen_optimal_table more than once
+ * per table, because it clobbers the input frequency counts!
+ */
+ MEMZERO(did_dc, SIZEOF(did_dc));
+ MEMZERO(did_ac, SIZEOF(did_ac));
+
+ for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
+ compptr = cinfo->cur_comp_info[ci];
+ dctbl = compptr->dc_tbl_no;
+ actbl = compptr->ac_tbl_no;
+ if (! did_dc[dctbl]) {
+ htblptr = & cinfo->dc_huff_tbl_ptrs[dctbl];
+ if (*htblptr == NULL)
+ *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);
+ jpeg_gen_optimal_table(cinfo, *htblptr, entropy->dc_count_ptrs[dctbl]);
+ did_dc[dctbl] = TRUE;
+ }
+ if (! did_ac[actbl]) {
+ htblptr = & cinfo->ac_huff_tbl_ptrs[actbl];
+ if (*htblptr == NULL)
+ *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);
+ jpeg_gen_optimal_table(cinfo, *htblptr, entropy->ac_count_ptrs[actbl]);
+ did_ac[actbl] = TRUE;
+ }
+ }
+}
+
+
+#endif /* ENTROPY_OPT_SUPPORTED */
+
+
+/*
+ * Module initialization routine for Huffman entropy encoding.
+ */
+
+GLOBAL(void)
+jinit_huff_encoder (j_compress_ptr cinfo)
+{
+ huff_entropy_ptr entropy;
+ int i;
+
+ entropy = (huff_entropy_ptr)
+ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ SIZEOF(huff_entropy_encoder));
+ cinfo->entropy = (struct jpeg_entropy_encoder *) entropy;
+ entropy->pub.start_pass = start_pass_huff;
+
+ /* Mark tables unallocated */
+ for (i = 0; i < NUM_HUFF_TBLS; i++) {
+ entropy->dc_derived_tbls[i] = entropy->ac_derived_tbls[i] = NULL;
+#ifdef ENTROPY_OPT_SUPPORTED
+ entropy->dc_count_ptrs[i] = entropy->ac_count_ptrs[i] = NULL;
+#endif
+ }
+}
+
+#endif //_FX_JPEG_TURBO_
diff --git a/core/src/fxcodec/libjpeg/fpdfapi_jcinit.c b/core/src/fxcodec/libjpeg/fpdfapi_jcinit.c
index a0d8f8148f..58e5d18764 100644
--- a/core/src/fxcodec/libjpeg/fpdfapi_jcinit.c
+++ b/core/src/fxcodec/libjpeg/fpdfapi_jcinit.c
@@ -1,75 +1,75 @@
-#if !defined(_FX_JPEG_TURBO_)
-/*
- * jcinit.c
- *
- * Copyright (C) 1991-1997, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- * For conditions of distribution and use, see the accompanying README file.
- *
- * This file contains initialization logic for the JPEG compressor.
- * This routine is in charge of selecting the modules to be executed and
- * making an initialization call to each one.
- *
- * Logically, this code belongs in jcmaster.c. It's split out because
- * linking this routine implies linking the entire compression library.
- * For a transcoding-only application, we want to be able to use jcmaster.c
- * without linking in the whole library.
- */
-
-#define JPEG_INTERNALS
-#include "jinclude.h"
-#include "jpeglib.h"
-
-
-/*
- * Master selection of compression modules.
- * This is done once at the start of processing an image. We determine
- * which modules will be used and give them appropriate initialization calls.
- */
-
-GLOBAL(void)
-jinit_compress_master (j_compress_ptr cinfo)
-{
- /* Initialize master control (includes parameter checking/processing) */
- jinit_c_master_control(cinfo, FALSE /* full compression */);
-
- /* Preprocessing */
- if (! cinfo->raw_data_in) {
- jinit_color_converter(cinfo);
- jinit_downsampler(cinfo);
- jinit_c_prep_controller(cinfo, FALSE /* never need full buffer here */);
- }
- /* Forward DCT */
- jinit_forward_dct(cinfo);
- /* Entropy encoding: either Huffman or arithmetic coding. */
- if (cinfo->arith_code) {
- ERREXIT(cinfo, JERR_ARITH_NOTIMPL);
- } else {
- if (cinfo->progressive_mode) {
-#ifdef C_PROGRESSIVE_SUPPORTED
- jinit_phuff_encoder(cinfo);
-#else
- ERREXIT(cinfo, JERR_NOT_COMPILED);
-#endif
- } else
- jinit_huff_encoder(cinfo);
- }
-
- /* Need a full-image coefficient buffer in any multi-pass mode. */
- jinit_c_coef_controller(cinfo,
- (boolean) (cinfo->num_scans > 1 || cinfo->optimize_coding));
- jinit_c_main_controller(cinfo, FALSE /* never need full buffer here */);
-
- jinit_marker_writer(cinfo);
-
- /* We can now tell the memory manager to allocate virtual arrays. */
- (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo);
-
- /* Write the datastream header (SOI) immediately.
- * Frame and scan headers are postponed till later.
- * This lets application insert special markers after the SOI.
- */
- (*cinfo->marker->write_file_header) (cinfo);
-}
-
-#endif //_FX_JPEG_TURBO_
+#if !defined(_FX_JPEG_TURBO_)
+/*
+ * jcinit.c
+ *
+ * Copyright (C) 1991-1997, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains initialization logic for the JPEG compressor.
+ * This routine is in charge of selecting the modules to be executed and
+ * making an initialization call to each one.
+ *
+ * Logically, this code belongs in jcmaster.c. It's split out because
+ * linking this routine implies linking the entire compression library.
+ * For a transcoding-only application, we want to be able to use jcmaster.c
+ * without linking in the whole library.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+
+
+/*
+ * Master selection of compression modules.
+ * This is done once at the start of processing an image. We determine
+ * which modules will be used and give them appropriate initialization calls.
+ */
+
+GLOBAL(void)
+jinit_compress_master (j_compress_ptr cinfo)
+{
+ /* Initialize master control (includes parameter checking/processing) */
+ jinit_c_master_control(cinfo, FALSE /* full compression */);
+
+ /* Preprocessing */
+ if (! cinfo->raw_data_in) {
+ jinit_color_converter(cinfo);
+ jinit_downsampler(cinfo);
+ jinit_c_prep_controller(cinfo, FALSE /* never need full buffer here */);
+ }
+ /* Forward DCT */
+ jinit_forward_dct(cinfo);
+ /* Entropy encoding: either Huffman or arithmetic coding. */
+ if (cinfo->arith_code) {
+ ERREXIT(cinfo, JERR_ARITH_NOTIMPL);
+ } else {
+ if (cinfo->progressive_mode) {
+#ifdef C_PROGRESSIVE_SUPPORTED
+ jinit_phuff_encoder(cinfo);
+#else
+ ERREXIT(cinfo, JERR_NOT_COMPILED);
+#endif
+ } else
+ jinit_huff_encoder(cinfo);
+ }
+
+ /* Need a full-image coefficient buffer in any multi-pass mode. */
+ jinit_c_coef_controller(cinfo,
+ (boolean) (cinfo->num_scans > 1 || cinfo->optimize_coding));
+ jinit_c_main_controller(cinfo, FALSE /* never need full buffer here */);
+
+ jinit_marker_writer(cinfo);
+
+ /* We can now tell the memory manager to allocate virtual arrays. */
+ (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo);
+
+ /* Write the datastream header (SOI) immediately.
+ * Frame and scan headers are postponed till later.
+ * This lets application insert special markers after the SOI.
+ */
+ (*cinfo->marker->write_file_header) (cinfo);
+}
+
+#endif //_FX_JPEG_TURBO_
diff --git a/core/src/fxcodec/libjpeg/fpdfapi_jcmainct.c b/core/src/fxcodec/libjpeg/fpdfapi_jcmainct.c
index 25d61f2284..4bf2c403ea 100644
--- a/core/src/fxcodec/libjpeg/fpdfapi_jcmainct.c
+++ b/core/src/fxcodec/libjpeg/fpdfapi_jcmainct.c
@@ -1,296 +1,296 @@
-#if !defined(_FX_JPEG_TURBO_)
-/*
- * jcmainct.c
- *
- * Copyright (C) 1994-1996, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- * For conditions of distribution and use, see the accompanying README file.
- *
- * This file contains the main buffer controller for compression.
- * The main buffer lies between the pre-processor and the JPEG
- * compressor proper; it holds downsampled data in the JPEG colorspace.
- */
-
-#define JPEG_INTERNALS
-#include "jinclude.h"
-#include "jpeglib.h"
-
-
-/* Note: currently, there is no operating mode in which a full-image buffer
- * is needed at this step. If there were, that mode could not be used with
- * "raw data" input, since this module is bypassed in that case. However,
- * we've left the code here for possible use in special applications.
- */
-#undef FULL_MAIN_BUFFER_SUPPORTED
-
-
-/* Private buffer controller object */
-
-typedef struct {
- struct jpeg_c_main_controller pub; /* public fields */
-
- JDIMENSION cur_iMCU_row; /* number of current iMCU row */
- JDIMENSION rowgroup_ctr; /* counts row groups received in iMCU row */
- boolean suspended; /* remember if we suspended output */
- J_BUF_MODE pass_mode; /* current operating mode */
-
- /* If using just a strip buffer, this points to the entire set of buffers
- * (we allocate one for each component). In the full-image case, this
- * points to the currently accessible strips of the virtual arrays.
- */
- JSAMPARRAY buffer[MAX_COMPONENTS];
-
-#ifdef FULL_MAIN_BUFFER_SUPPORTED
- /* If using full-image storage, this array holds pointers to virtual-array
- * control blocks for each component. Unused if not full-image storage.
- */
- jvirt_sarray_ptr whole_image[MAX_COMPONENTS];
-#endif
-} my_main_controller;
-
-typedef my_main_controller * my_main_ptr;
-
-
-/* Forward declarations */
-METHODDEF(void) process_data_simple_main
- JPP((j_compress_ptr cinfo, JSAMPARRAY input_buf,
- JDIMENSION *in_row_ctr, JDIMENSION in_rows_avail));
-#ifdef FULL_MAIN_BUFFER_SUPPORTED
-METHODDEF(void) process_data_buffer_main
- JPP((j_compress_ptr cinfo, JSAMPARRAY input_buf,
- JDIMENSION *in_row_ctr, JDIMENSION in_rows_avail));
-#endif
-
-
-/*
- * Initialize for a processing pass.
- */
-
-METHODDEF(void)
-start_pass_main (j_compress_ptr cinfo, J_BUF_MODE pass_mode)
-{
- my_main_ptr main = (my_main_ptr) cinfo->main;
-
- /* Do nothing in raw-data mode. */
- if (cinfo->raw_data_in)
- return;
-
- main->cur_iMCU_row = 0; /* initialize counters */
- main->rowgroup_ctr = 0;
- main->suspended = FALSE;
- main->pass_mode = pass_mode; /* save mode for use by process_data */
-
- switch (pass_mode) {
- case JBUF_PASS_THRU:
-#ifdef FULL_MAIN_BUFFER_SUPPORTED
- if (main->whole_image[0] != NULL)
- ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
-#endif
- main->pub.process_data = process_data_simple_main;
- break;
-#ifdef FULL_MAIN_BUFFER_SUPPORTED
- case JBUF_SAVE_SOURCE:
- case JBUF_CRANK_DEST:
- case JBUF_SAVE_AND_PASS:
- if (main->whole_image[0] == NULL)
- ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
- main->pub.process_data = process_data_buffer_main;
- break;
-#endif
- default:
- ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
- break;
- }
-}
-
-
-/*
- * Process some data.
- * This routine handles the simple pass-through mode,
- * where we have only a strip buffer.
- */
-
-METHODDEF(void)
-process_data_simple_main (j_compress_ptr cinfo,
- JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,
- JDIMENSION in_rows_avail)
-{
- my_main_ptr main = (my_main_ptr) cinfo->main;
-
- while (main->cur_iMCU_row < cinfo->total_iMCU_rows) {
- /* Read input data if we haven't filled the main buffer yet */
- if (main->rowgroup_ctr < DCTSIZE)
- (*cinfo->prep->pre_process_data) (cinfo,
- input_buf, in_row_ctr, in_rows_avail,
- main->buffer, &main->rowgroup_ctr,
- (JDIMENSION) DCTSIZE);
-
- /* If we don't have a full iMCU row buffered, return to application for
- * more data. Note that preprocessor will always pad to fill the iMCU row
- * at the bottom of the image.
- */
- if (main->rowgroup_ctr != DCTSIZE)
- return;
-
- /* Send the completed row to the compressor */
- if (! (*cinfo->coef->compress_data) (cinfo, main->buffer)) {
- /* If compressor did not consume the whole row, then we must need to
- * suspend processing and return to the application. In this situation
- * we pretend we didn't yet consume the last input row; otherwise, if
- * it happened to be the last row of the image, the application would
- * think we were done.
- */
- if (! main->suspended) {
- (*in_row_ctr)--;
- main->suspended = TRUE;
- }
- return;
- }
- /* We did finish the row. Undo our little suspension hack if a previous
- * call suspended; then mark the main buffer empty.
- */
- if (main->suspended) {
- (*in_row_ctr)++;
- main->suspended = FALSE;
- }
- main->rowgroup_ctr = 0;
- main->cur_iMCU_row++;
- }
-}
-
-
-#ifdef FULL_MAIN_BUFFER_SUPPORTED
-
-/*
- * Process some data.
- * This routine handles all of the modes that use a full-size buffer.
- */
-
-METHODDEF(void)
-process_data_buffer_main (j_compress_ptr cinfo,
- JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,
- JDIMENSION in_rows_avail)
-{
- my_main_ptr main = (my_main_ptr) cinfo->main;
- int ci;
- jpeg_component_info *compptr;
- boolean writing = (main->pass_mode != JBUF_CRANK_DEST);
-
- while (main->cur_iMCU_row < cinfo->total_iMCU_rows) {
- /* Realign the virtual buffers if at the start of an iMCU row. */
- if (main->rowgroup_ctr == 0) {
- for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
- ci++, compptr++) {
- main->buffer[ci] = (*cinfo->mem->access_virt_sarray)
- ((j_common_ptr) cinfo, main->whole_image[ci],
- main->cur_iMCU_row * (compptr->v_samp_factor * DCTSIZE),
- (JDIMENSION) (compptr->v_samp_factor * DCTSIZE), writing);
- }
- /* In a read pass, pretend we just read some source data. */
- if (! writing) {
- *in_row_ctr += cinfo->max_v_samp_factor * DCTSIZE;
- main->rowgroup_ctr = DCTSIZE;
- }
- }
-
- /* If a write pass, read input data until the current iMCU row is full. */
- /* Note: preprocessor will pad if necessary to fill the last iMCU row. */
- if (writing) {
- (*cinfo->prep->pre_process_data) (cinfo,
- input_buf, in_row_ctr, in_rows_avail,
- main->buffer, &main->rowgroup_ctr,
- (JDIMENSION) DCTSIZE);
- /* Return to application if we need more data to fill the iMCU row. */
- if (main->rowgroup_ctr < DCTSIZE)
- return;
- }
-
- /* Emit data, unless this is a sink-only pass. */
- if (main->pass_mode != JBUF_SAVE_SOURCE) {
- if (! (*cinfo->coef->compress_data) (cinfo, main->buffer)) {
- /* If compressor did not consume the whole row, then we must need to
- * suspend processing and return to the application. In this situation
- * we pretend we didn't yet consume the last input row; otherwise, if
- * it happened to be the last row of the image, the application would
- * think we were done.
- */
- if (! main->suspended) {
- (*in_row_ctr)--;
- main->suspended = TRUE;
- }
- return;
- }
- /* We did finish the row. Undo our little suspension hack if a previous
- * call suspended; then mark the main buffer empty.
- */
- if (main->suspended) {
- (*in_row_ctr)++;
- main->suspended = FALSE;
- }
- }
-
- /* If get here, we are done with this iMCU row. Mark buffer empty. */
- main->rowgroup_ctr = 0;
- main->cur_iMCU_row++;
- }
-}
-
-#endif /* FULL_MAIN_BUFFER_SUPPORTED */
-
-
-/*
- * Initialize main buffer controller.
- */
-
-GLOBAL(void)
-jinit_c_main_controller (j_compress_ptr cinfo, boolean need_full_buffer)
-{
- my_main_ptr main;
- int ci;
- jpeg_component_info *compptr;
-
- main = (my_main_ptr)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- SIZEOF(my_main_controller));
- cinfo->main = (struct jpeg_c_main_controller *) main;
- main->pub.start_pass = start_pass_main;
-
- /* We don't need to create a buffer in raw-data mode. */
- if (cinfo->raw_data_in)
- return;
-
- /* Create the buffer. It holds downsampled data, so each component
- * may be of a different size.
- */
- if (need_full_buffer) {
-#ifdef FULL_MAIN_BUFFER_SUPPORTED
- /* Allocate a full-image virtual array for each component */
- /* Note we pad the bottom to a multiple of the iMCU height */
- for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
- ci++, compptr++) {
- main->whole_image[ci] = (*cinfo->mem->request_virt_sarray)
- ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,
- compptr->width_in_blocks * DCTSIZE,
- (JDIMENSION) jround_up((long) compptr->height_in_blocks,
- (long) compptr->v_samp_factor) * DCTSIZE,
- (JDIMENSION) (compptr->v_samp_factor * DCTSIZE));
- }
-#else
- ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
-#endif
- } else {
-#ifdef FULL_MAIN_BUFFER_SUPPORTED
- main->whole_image[0] = NULL; /* flag for no virtual arrays */
-#endif
- /* Allocate a strip buffer for each component */
- for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
- ci++, compptr++) {
- main->buffer[ci] = (*cinfo->mem->alloc_sarray)
- ((j_common_ptr) cinfo, JPOOL_IMAGE,
- compptr->width_in_blocks * DCTSIZE,
- (JDIMENSION) (compptr->v_samp_factor * DCTSIZE));
- }
- }
-}
-
-#endif //_FX_JPEG_TURBO_
+#if !defined(_FX_JPEG_TURBO_)
+/*
+ * jcmainct.c
+ *
+ * Copyright (C) 1994-1996, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains the main buffer controller for compression.
+ * The main buffer lies between the pre-processor and the JPEG
+ * compressor proper; it holds downsampled data in the JPEG colorspace.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+
+
+/* Note: currently, there is no operating mode in which a full-image buffer
+ * is needed at this step. If there were, that mode could not be used with
+ * "raw data" input, since this module is bypassed in that case. However,
+ * we've left the code here for possible use in special applications.
+ */
+#undef FULL_MAIN_BUFFER_SUPPORTED
+
+
+/* Private buffer controller object */
+
+typedef struct {
+ struct jpeg_c_main_controller pub; /* public fields */
+
+ JDIMENSION cur_iMCU_row; /* number of current iMCU row */
+ JDIMENSION rowgroup_ctr; /* counts row groups received in iMCU row */
+ boolean suspended; /* remember if we suspended output */
+ J_BUF_MODE pass_mode; /* current operating mode */
+
+ /* If using just a strip buffer, this points to the entire set of buffers
+ * (we allocate one for each component). In the full-image case, this
+ * points to the currently accessible strips of the virtual arrays.
+ */
+ JSAMPARRAY buffer[MAX_COMPONENTS];
+
+#ifdef FULL_MAIN_BUFFER_SUPPORTED
+ /* If using full-image storage, this array holds pointers to virtual-array
+ * control blocks for each component. Unused if not full-image storage.
+ */
+ jvirt_sarray_ptr whole_image[MAX_COMPONENTS];
+#endif
+} my_main_controller;
+
+typedef my_main_controller * my_main_ptr;
+
+
+/* Forward declarations */
+METHODDEF(void) process_data_simple_main
+ JPP((j_compress_ptr cinfo, JSAMPARRAY input_buf,
+ JDIMENSION *in_row_ctr, JDIMENSION in_rows_avail));
+#ifdef FULL_MAIN_BUFFER_SUPPORTED
+METHODDEF(void) process_data_buffer_main
+ JPP((j_compress_ptr cinfo, JSAMPARRAY input_buf,
+ JDIMENSION *in_row_ctr, JDIMENSION in_rows_avail));
+#endif
+
+
+/*
+ * Initialize for a processing pass.
+ */
+
+METHODDEF(void)
+start_pass_main (j_compress_ptr cinfo, J_BUF_MODE pass_mode)
+{
+ my_main_ptr main = (my_main_ptr) cinfo->main;
+
+ /* Do nothing in raw-data mode. */
+ if (cinfo->raw_data_in)
+ return;
+
+ main->cur_iMCU_row = 0; /* initialize counters */
+ main->rowgroup_ctr = 0;
+ main->suspended = FALSE;
+ main->pass_mode = pass_mode; /* save mode for use by process_data */
+
+ switch (pass_mode) {
+ case JBUF_PASS_THRU:
+#ifdef FULL_MAIN_BUFFER_SUPPORTED
+ if (main->whole_image[0] != NULL)
+ ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
+#endif
+ main->pub.process_data = process_data_simple_main;
+ break;
+#ifdef FULL_MAIN_BUFFER_SUPPORTED
+ case JBUF_SAVE_SOURCE:
+ case JBUF_CRANK_DEST:
+ case JBUF_SAVE_AND_PASS:
+ if (main->whole_image[0] == NULL)
+ ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
+ main->pub.process_data = process_data_buffer_main;
+ break;
+#endif
+ default:
+ ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
+ break;
+ }
+}
+
+
+/*
+ * Process some data.
+ * This routine handles the simple pass-through mode,
+ * where we have only a strip buffer.
+ */
+
+METHODDEF(void)
+process_data_simple_main (j_compress_ptr cinfo,
+ JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,
+ JDIMENSION in_rows_avail)
+{
+ my_main_ptr main = (my_main_ptr) cinfo->main;
+
+ while (main->cur_iMCU_row < cinfo->total_iMCU_rows) {
+ /* Read input data if we haven't filled the main buffer yet */
+ if (main->rowgroup_ctr < DCTSIZE)
+ (*cinfo->prep->pre_process_data) (cinfo,
+ input_buf, in_row_ctr, in_rows_avail,
+ main->buffer, &main->rowgroup_ctr,
+ (JDIMENSION) DCTSIZE);
+
+ /* If we don't have a full iMCU row buffered, return to application for
+ * more data. Note that preprocessor will always pad to fill the iMCU row
+ * at the bottom of the image.
+ */
+ if (main->rowgroup_ctr != DCTSIZE)
+ return;
+
+ /* Send the completed row to the compressor */
+ if (! (*cinfo->coef->compress_data) (cinfo, main->buffer)) {
+ /* If compressor did not consume the whole row, then we must need to
+ * suspend processing and return to the application. In this situation
+ * we pretend we didn't yet consume the last input row; otherwise, if
+ * it happened to be the last row of the image, the application would
+ * think we were done.
+ */
+ if (! main->suspended) {
+ (*in_row_ctr)--;
+ main->suspended = TRUE;
+ }
+ return;
+ }
+ /* We did finish the row. Undo our little suspension hack if a previous
+ * call suspended; then mark the main buffer empty.
+ */
+ if (main->suspended) {
+ (*in_row_ctr)++;
+ main->suspended = FALSE;
+ }
+ main->rowgroup_ctr = 0;
+ main->cur_iMCU_row++;
+ }
+}
+
+
+#ifdef FULL_MAIN_BUFFER_SUPPORTED
+
+/*
+ * Process some data.
+ * This routine handles all of the modes that use a full-size buffer.
+ */
+
+METHODDEF(void)
+process_data_buffer_main (j_compress_ptr cinfo,
+ JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,
+ JDIMENSION in_rows_avail)
+{
+ my_main_ptr main = (my_main_ptr) cinfo->main;
+ int ci;
+ jpeg_component_info *compptr;
+ boolean writing = (main->pass_mode != JBUF_CRANK_DEST);
+
+ while (main->cur_iMCU_row < cinfo->total_iMCU_rows) {
+ /* Realign the virtual buffers if at the start of an iMCU row. */
+ if (main->rowgroup_ctr == 0) {
+ for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+ ci++, compptr++) {
+ main->buffer[ci] = (*cinfo->mem->access_virt_sarray)
+ ((j_common_ptr) cinfo, main->whole_image[ci],
+ main->cur_iMCU_row * (compptr->v_samp_factor * DCTSIZE),
+ (JDIMENSION) (compptr->v_samp_factor * DCTSIZE), writing);
+ }
+ /* In a read pass, pretend we just read some source data. */
+ if (! writing) {
+ *in_row_ctr += cinfo->max_v_samp_factor * DCTSIZE;
+ main->rowgroup_ctr = DCTSIZE;
+ }
+ }
+
+ /* If a write pass, read input data until the current iMCU row is full. */
+ /* Note: preprocessor will pad if necessary to fill the last iMCU row. */
+ if (writing) {
+ (*cinfo->prep->pre_process_data) (cinfo,
+ input_buf, in_row_ctr, in_rows_avail,
+ main->buffer, &main->rowgroup_ctr,
+ (JDIMENSION) DCTSIZE);
+ /* Return to application if we need more data to fill the iMCU row. */
+ if (main->rowgroup_ctr < DCTSIZE)
+ return;
+ }
+
+ /* Emit data, unless this is a sink-only pass. */
+ if (main->pass_mode != JBUF_SAVE_SOURCE) {
+ if (! (*cinfo->coef->compress_data) (cinfo, main->buffer)) {
+ /* If compressor did not consume the whole row, then we must need to
+ * suspend processing and return to the application. In this situation
+ * we pretend we didn't yet consume the last input row; otherwise, if
+ * it happened to be the last row of the image, the application would
+ * think we were done.
+ */
+ if (! main->suspended) {
+ (*in_row_ctr)--;
+ main->suspended = TRUE;
+ }
+ return;
+ }
+ /* We did finish the row. Undo our little suspension hack if a previous
+ * call suspended; then mark the main buffer empty.
+ */
+ if (main->suspended) {
+ (*in_row_ctr)++;
+ main->suspended = FALSE;
+ }
+ }
+
+ /* If get here, we are done with this iMCU row. Mark buffer empty. */
+ main->rowgroup_ctr = 0;
+ main->cur_iMCU_row++;
+ }
+}
+
+#endif /* FULL_MAIN_BUFFER_SUPPORTED */
+
+
+/*
+ * Initialize main buffer controller.
+ */
+
+GLOBAL(void)
+jinit_c_main_controller (j_compress_ptr cinfo, boolean need_full_buffer)
+{
+ my_main_ptr main;
+ int ci;
+ jpeg_component_info *compptr;
+
+ main = (my_main_ptr)
+ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ SIZEOF(my_main_controller));
+ cinfo->main = (struct jpeg_c_main_controller *) main;
+ main->pub.start_pass = start_pass_main;
+
+ /* We don't need to create a buffer in raw-data mode. */
+ if (cinfo->raw_data_in)
+ return;
+
+ /* Create the buffer. It holds downsampled data, so each component
+ * may be of a different size.
+ */
+ if (need_full_buffer) {
+#ifdef FULL_MAIN_BUFFER_SUPPORTED
+ /* Allocate a full-image virtual array for each component */
+ /* Note we pad the bottom to a multiple of the iMCU height */
+ for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+ ci++, compptr++) {
+ main->whole_image[ci] = (*cinfo->mem->request_virt_sarray)
+ ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,
+ compptr->width_in_blocks * DCTSIZE,
+ (JDIMENSION) jround_up((long) compptr->height_in_blocks,
+ (long) compptr->v_samp_factor) * DCTSIZE,
+ (JDIMENSION) (compptr->v_samp_factor * DCTSIZE));
+ }
+#else
+ ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
+#endif
+ } else {
+#ifdef FULL_MAIN_BUFFER_SUPPORTED
+ main->whole_image[0] = NULL; /* flag for no virtual arrays */
+#endif
+ /* Allocate a strip buffer for each component */
+ for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+ ci++, compptr++) {
+ main->buffer[ci] = (*cinfo->mem->alloc_sarray)
+ ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ compptr->width_in_blocks * DCTSIZE,
+ (JDIMENSION) (compptr->v_samp_factor * DCTSIZE));
+ }
+ }
+}
+
+#endif //_FX_JPEG_TURBO_
diff --git a/core/src/fxcodec/libjpeg/fpdfapi_jcmarker.c b/core/src/fxcodec/libjpeg/fpdfapi_jcmarker.c
index d0a9e87650..f1c89d92a9 100644
--- a/core/src/fxcodec/libjpeg/fpdfapi_jcmarker.c
+++ b/core/src/fxcodec/libjpeg/fpdfapi_jcmarker.c
@@ -1,667 +1,667 @@
-#if !defined(_FX_JPEG_TURBO_)
-/*
- * jcmarker.c
- *
- * Copyright (C) 1991-1998, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- * For conditions of distribution and use, see the accompanying README file.
- *
- * This file contains routines to write JPEG datastream markers.
- */
-
-#define JPEG_INTERNALS
-#include "jinclude.h"
-#include "jpeglib.h"
-
-
-typedef enum { /* JPEG marker codes */
- M_SOF0 = 0xc0,
- M_SOF1 = 0xc1,
- M_SOF2 = 0xc2,
- M_SOF3 = 0xc3,
-
- M_SOF5 = 0xc5,
- M_SOF6 = 0xc6,
- M_SOF7 = 0xc7,
-
- M_JPG = 0xc8,
- M_SOF9 = 0xc9,
- M_SOF10 = 0xca,
- M_SOF11 = 0xcb,
-
- M_SOF13 = 0xcd,
- M_SOF14 = 0xce,
- M_SOF15 = 0xcf,
-
- M_DHT = 0xc4,
-
- M_DAC = 0xcc,
-
- M_RST0 = 0xd0,
- M_RST1 = 0xd1,
- M_RST2 = 0xd2,
- M_RST3 = 0xd3,
- M_RST4 = 0xd4,
- M_RST5 = 0xd5,
- M_RST6 = 0xd6,
- M_RST7 = 0xd7,
-
- M_SOI = 0xd8,
- M_EOI = 0xd9,
- M_SOS = 0xda,
- M_DQT = 0xdb,
- M_DNL = 0xdc,
- M_DRI = 0xdd,
- M_DHP = 0xde,
- M_EXP = 0xdf,
-
- M_APP0 = 0xe0,
- M_APP1 = 0xe1,
- M_APP2 = 0xe2,
- M_APP3 = 0xe3,
- M_APP4 = 0xe4,
- M_APP5 = 0xe5,
- M_APP6 = 0xe6,
- M_APP7 = 0xe7,
- M_APP8 = 0xe8,
- M_APP9 = 0xe9,
- M_APP10 = 0xea,
- M_APP11 = 0xeb,
- M_APP12 = 0xec,
- M_APP13 = 0xed,
- M_APP14 = 0xee,
- M_APP15 = 0xef,
-
- M_JPG0 = 0xf0,
- M_JPG13 = 0xfd,
- M_COM = 0xfe,
-
- M_TEM = 0x01,
-
- M_ERROR = 0x100
-} JPEG_MARKER;
-
-
-/* Private state */
-
-typedef struct {
- struct jpeg_marker_writer pub; /* public fields */
-
- unsigned int last_restart_interval; /* last DRI value emitted; 0 after SOI */
-} my_marker_writer;
-
-typedef my_marker_writer * my_marker_ptr;
-
-
-/*
- * Basic output routines.
- *
- * Note that we do not support suspension while writing a marker.
- * Therefore, an application using suspension must ensure that there is
- * enough buffer space for the initial markers (typ. 600-700 bytes) before
- * calling jpeg_start_compress, and enough space to write the trailing EOI
- * (a few bytes) before calling jpeg_finish_compress. Multipass compression
- * modes are not supported at all with suspension, so those two are the only
- * points where markers will be written.
- */
-
-LOCAL(void)
-emit_byte (j_compress_ptr cinfo, int val)
-/* Emit a byte */
-{
- struct jpeg_destination_mgr * dest = cinfo->dest;
-
- *(dest->next_output_byte)++ = (JOCTET) val;
- if (--dest->free_in_buffer == 0) {
- if (! (*dest->empty_output_buffer) (cinfo))
- ERREXIT(cinfo, JERR_CANT_SUSPEND);
- }
-}
-
-
-LOCAL(void)
-emit_marker (j_compress_ptr cinfo, JPEG_MARKER mark)
-/* Emit a marker code */
-{
- emit_byte(cinfo, 0xFF);
- emit_byte(cinfo, (int) mark);
-}
-
-
-LOCAL(void)
-emit_2bytes (j_compress_ptr cinfo, int value)
-/* Emit a 2-byte integer; these are always MSB first in JPEG files */
-{
- emit_byte(cinfo, (value >> 8) & 0xFF);
- emit_byte(cinfo, value & 0xFF);
-}
-
-
-/*
- * Routines to write specific marker types.
- */
-
-LOCAL(int)
-emit_dqt (j_compress_ptr cinfo, int index)
-/* Emit a DQT marker */
-/* Returns the precision used (0 = 8bits, 1 = 16bits) for baseline checking */
-{
- JQUANT_TBL * qtbl = cinfo->quant_tbl_ptrs[index];
- int prec;
- int i;
-
- if (qtbl == NULL)
- ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, index);
-
- prec = 0;
- for (i = 0; i < DCTSIZE2; i++) {
- if (qtbl->quantval[i] > 255)
- prec = 1;
- }
-
- if (! qtbl->sent_table) {
- emit_marker(cinfo, M_DQT);
-
- emit_2bytes(cinfo, prec ? DCTSIZE2*2 + 1 + 2 : DCTSIZE2 + 1 + 2);
-
- emit_byte(cinfo, index + (prec<<4));
-
- for (i = 0; i < DCTSIZE2; i++) {
- /* The table entries must be emitted in zigzag order. */
- unsigned int qval = qtbl->quantval[jpeg_natural_order[i]];
- if (prec)
- emit_byte(cinfo, (int) (qval >> 8));
- emit_byte(cinfo, (int) (qval & 0xFF));
- }
-
- qtbl->sent_table = TRUE;
- }
-
- return prec;
-}
-
-
-LOCAL(void)
-emit_dht (j_compress_ptr cinfo, int index, boolean is_ac)
-/* Emit a DHT marker */
-{
- JHUFF_TBL * htbl;
- int length, i;
-
- if (is_ac) {
- htbl = cinfo->ac_huff_tbl_ptrs[index];
- index += 0x10; /* output index has AC bit set */
- } else {
- htbl = cinfo->dc_huff_tbl_ptrs[index];
- }
-
- if (htbl == NULL)
- ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, index);
-
- if (! htbl->sent_table) {
- emit_marker(cinfo, M_DHT);
-
- length = 0;
- for (i = 1; i <= 16; i++)
- length += htbl->bits[i];
-
- emit_2bytes(cinfo, length + 2 + 1 + 16);
- emit_byte(cinfo, index);
-
- for (i = 1; i <= 16; i++)
- emit_byte(cinfo, htbl->bits[i]);
-
- for (i = 0; i < length; i++)
- emit_byte(cinfo, htbl->huffval[i]);
-
- htbl->sent_table = TRUE;
- }
-}
-
-
-LOCAL(void)
-emit_dac (j_compress_ptr cinfo)
-/* Emit a DAC marker */
-/* Since the useful info is so small, we want to emit all the tables in */
-/* one DAC marker. Therefore this routine does its own scan of the table. */
-{
-#ifdef C_ARITH_CODING_SUPPORTED
- char dc_in_use[NUM_ARITH_TBLS];
- char ac_in_use[NUM_ARITH_TBLS];
- int length, i;
- jpeg_component_info *compptr;
-
- for (i = 0; i < NUM_ARITH_TBLS; i++)
- dc_in_use[i] = ac_in_use[i] = 0;
-
- for (i = 0; i < cinfo->comps_in_scan; i++) {
- compptr = cinfo->cur_comp_info[i];
- dc_in_use[compptr->dc_tbl_no] = 1;
- ac_in_use[compptr->ac_tbl_no] = 1;
- }
-
- length = 0;
- for (i = 0; i < NUM_ARITH_TBLS; i++)
- length += dc_in_use[i] + ac_in_use[i];
-
- emit_marker(cinfo, M_DAC);
-
- emit_2bytes(cinfo, length*2 + 2);
-
- for (i = 0; i < NUM_ARITH_TBLS; i++) {
- if (dc_in_use[i]) {
- emit_byte(cinfo, i);
- emit_byte(cinfo, cinfo->arith_dc_L[i] + (cinfo->arith_dc_U[i]<<4));
- }
- if (ac_in_use[i]) {
- emit_byte(cinfo, i + 0x10);
- emit_byte(cinfo, cinfo->arith_ac_K[i]);
- }
- }
-#endif /* C_ARITH_CODING_SUPPORTED */
-}
-
-
-LOCAL(void)
-emit_dri (j_compress_ptr cinfo)
-/* Emit a DRI marker */
-{
- emit_marker(cinfo, M_DRI);
-
- emit_2bytes(cinfo, 4); /* fixed length */
-
- emit_2bytes(cinfo, (int) cinfo->restart_interval);
-}
-
-
-LOCAL(void)
-emit_sof (j_compress_ptr cinfo, JPEG_MARKER code)
-/* Emit a SOF marker */
-{
- int ci;
- jpeg_component_info *compptr;
-
- emit_marker(cinfo, code);
-
- emit_2bytes(cinfo, 3 * cinfo->num_components + 2 + 5 + 1); /* length */
-
- /* Make sure image isn't bigger than SOF field can handle */
- if ((long) cinfo->image_height > 65535L ||
- (long) cinfo->image_width > 65535L)
- ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) 65535);
-
- emit_byte(cinfo, cinfo->data_precision);
- emit_2bytes(cinfo, (int) cinfo->image_height);
- emit_2bytes(cinfo, (int) cinfo->image_width);
-
- emit_byte(cinfo, cinfo->num_components);
-
- for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
- ci++, compptr++) {
- emit_byte(cinfo, compptr->component_id);
- emit_byte(cinfo, (compptr->h_samp_factor << 4) + compptr->v_samp_factor);
- emit_byte(cinfo, compptr->quant_tbl_no);
- }
-}
-
-
-LOCAL(void)
-emit_sos (j_compress_ptr cinfo)
-/* Emit a SOS marker */
-{
- int i, td, ta;
- jpeg_component_info *compptr;
-
- emit_marker(cinfo, M_SOS);
-
- emit_2bytes(cinfo, 2 * cinfo->comps_in_scan + 2 + 1 + 3); /* length */
-
- emit_byte(cinfo, cinfo->comps_in_scan);
-
- for (i = 0; i < cinfo->comps_in_scan; i++) {
- compptr = cinfo->cur_comp_info[i];
- emit_byte(cinfo, compptr->component_id);
- td = compptr->dc_tbl_no;
- ta = compptr->ac_tbl_no;
- if (cinfo->progressive_mode) {
- /* Progressive mode: only DC or only AC tables are used in one scan;
- * furthermore, Huffman coding of DC refinement uses no table at all.
- * We emit 0 for unused field(s); this is recommended by the P&M text
- * but does not seem to be specified in the standard.
- */
- if (cinfo->Ss == 0) {
- ta = 0; /* DC scan */
- if (cinfo->Ah != 0 && !cinfo->arith_code)
- td = 0; /* no DC table either */
- } else {
- td = 0; /* AC scan */
- }
- }
- emit_byte(cinfo, (td << 4) + ta);
- }
-
- emit_byte(cinfo, cinfo->Ss);
- emit_byte(cinfo, cinfo->Se);
- emit_byte(cinfo, (cinfo->Ah << 4) + cinfo->Al);
-}
-
-
-LOCAL(void)
-emit_jfif_app0 (j_compress_ptr cinfo)
-/* Emit a JFIF-compliant APP0 marker */
-{
- /*
- * Length of APP0 block (2 bytes)
- * Block ID (4 bytes - ASCII "JFIF")
- * Zero byte (1 byte to terminate the ID string)
- * Version Major, Minor (2 bytes - major first)
- * Units (1 byte - 0x00 = none, 0x01 = inch, 0x02 = cm)
- * Xdpu (2 bytes - dots per unit horizontal)
- * Ydpu (2 bytes - dots per unit vertical)
- * Thumbnail X size (1 byte)
- * Thumbnail Y size (1 byte)
- */
-
- emit_marker(cinfo, M_APP0);
-
- emit_2bytes(cinfo, 2 + 4 + 1 + 2 + 1 + 2 + 2 + 1 + 1); /* length */
-
- emit_byte(cinfo, 0x4A); /* Identifier: ASCII "JFIF" */
- emit_byte(cinfo, 0x46);
- emit_byte(cinfo, 0x49);
- emit_byte(cinfo, 0x46);
- emit_byte(cinfo, 0);
- emit_byte(cinfo, cinfo->JFIF_major_version); /* Version fields */
- emit_byte(cinfo, cinfo->JFIF_minor_version);
- emit_byte(cinfo, cinfo->density_unit); /* Pixel size information */
- emit_2bytes(cinfo, (int) cinfo->X_density);
- emit_2bytes(cinfo, (int) cinfo->Y_density);
- emit_byte(cinfo, 0); /* No thumbnail image */
- emit_byte(cinfo, 0);
-}
-
-
-LOCAL(void)
-emit_adobe_app14 (j_compress_ptr cinfo)
-/* Emit an Adobe APP14 marker */
-{
- /*
- * Length of APP14 block (2 bytes)
- * Block ID (5 bytes - ASCII "Adobe")
- * Version Number (2 bytes - currently 100)
- * Flags0 (2 bytes - currently 0)
- * Flags1 (2 bytes - currently 0)
- * Color transform (1 byte)
- *
- * Although Adobe TN 5116 mentions Version = 101, all the Adobe files
- * now in circulation seem to use Version = 100, so that's what we write.
- *
- * We write the color transform byte as 1 if the JPEG color space is
- * YCbCr, 2 if it's YCCK, 0 otherwise. Adobe's definition has to do with
- * whether the encoder performed a transformation, which is pretty useless.
- */
-
- emit_marker(cinfo, M_APP14);
-
- emit_2bytes(cinfo, 2 + 5 + 2 + 2 + 2 + 1); /* length */
-
- emit_byte(cinfo, 0x41); /* Identifier: ASCII "Adobe" */
- emit_byte(cinfo, 0x64);
- emit_byte(cinfo, 0x6F);
- emit_byte(cinfo, 0x62);
- emit_byte(cinfo, 0x65);
- emit_2bytes(cinfo, 100); /* Version */
- emit_2bytes(cinfo, 0); /* Flags0 */
- emit_2bytes(cinfo, 0); /* Flags1 */
- switch (cinfo->jpeg_color_space) {
- case JCS_YCbCr:
- emit_byte(cinfo, 1); /* Color transform = 1 */
- break;
- case JCS_YCCK:
- emit_byte(cinfo, 2); /* Color transform = 2 */
- break;
- default:
- emit_byte(cinfo, 0); /* Color transform = 0 */
- break;
- }
-}
-
-
-/*
- * These routines allow writing an arbitrary marker with parameters.
- * The only intended use is to emit COM or APPn markers after calling
- * write_file_header and before calling write_frame_header.
- * Other uses are not guaranteed to produce desirable results.
- * Counting the parameter bytes properly is the caller's responsibility.
- */
-
-METHODDEF(void)
-write_marker_header (j_compress_ptr cinfo, int marker, unsigned int datalen)
-/* Emit an arbitrary marker header */
-{
- if (datalen > (unsigned int) 65533) /* safety check */
- ERREXIT(cinfo, JERR_BAD_LENGTH);
-
- emit_marker(cinfo, (JPEG_MARKER) marker);
-
- emit_2bytes(cinfo, (int) (datalen + 2)); /* total length */
-}
-
-METHODDEF(void)
-write_marker_byte (j_compress_ptr cinfo, int val)
-/* Emit one byte of marker parameters following write_marker_header */
-{
- emit_byte(cinfo, val);
-}
-
-
-/*
- * Write datastream header.
- * This consists of an SOI and optional APPn markers.
- * We recommend use of the JFIF marker, but not the Adobe marker,
- * when using YCbCr or grayscale data. The JFIF marker should NOT
- * be used for any other JPEG colorspace. The Adobe marker is helpful
- * to distinguish RGB, CMYK, and YCCK colorspaces.
- * Note that an application can write additional header markers after
- * jpeg_start_compress returns.
- */
-
-METHODDEF(void)
-write_file_header (j_compress_ptr cinfo)
-{
- my_marker_ptr marker = (my_marker_ptr) cinfo->marker;
-
- emit_marker(cinfo, M_SOI); /* first the SOI */
-
- /* SOI is defined to reset restart interval to 0 */
- marker->last_restart_interval = 0;
-
- if (cinfo->write_JFIF_header) /* next an optional JFIF APP0 */
- emit_jfif_app0(cinfo);
- if (cinfo->write_Adobe_marker) /* next an optional Adobe APP14 */
- emit_adobe_app14(cinfo);
-}
-
-
-/*
- * Write frame header.
- * This consists of DQT and SOFn markers.
- * Note that we do not emit the SOF until we have emitted the DQT(s).
- * This avoids compatibility problems with incorrect implementations that
- * try to error-check the quant table numbers as soon as they see the SOF.
- */
-
-METHODDEF(void)
-write_frame_header (j_compress_ptr cinfo)
-{
- int ci, prec;
- boolean is_baseline;
- jpeg_component_info *compptr;
-
- /* Emit DQT for each quantization table.
- * Note that emit_dqt() suppresses any duplicate tables.
- */
- prec = 0;
- for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
- ci++, compptr++) {
- prec += emit_dqt(cinfo, compptr->quant_tbl_no);
- }
- /* now prec is nonzero iff there are any 16-bit quant tables. */
-
- /* Check for a non-baseline specification.
- * Note we assume that Huffman table numbers won't be changed later.
- */
- if (cinfo->arith_code || cinfo->progressive_mode ||
- cinfo->data_precision != 8) {
- is_baseline = FALSE;
- } else {
- is_baseline = TRUE;
- for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
- ci++, compptr++) {
- if (compptr->dc_tbl_no > 1 || compptr->ac_tbl_no > 1)
- is_baseline = FALSE;
- }
- if (prec && is_baseline) {
- is_baseline = FALSE;
- /* If it's baseline except for quantizer size, warn the user */
- TRACEMS(cinfo, 0, JTRC_16BIT_TABLES);
- }
- }
-
- /* Emit the proper SOF marker */
- if (cinfo->arith_code) {
- emit_sof(cinfo, M_SOF9); /* SOF code for arithmetic coding */
- } else {
- if (cinfo->progressive_mode)
- emit_sof(cinfo, M_SOF2); /* SOF code for progressive Huffman */
- else if (is_baseline)
- emit_sof(cinfo, M_SOF0); /* SOF code for baseline implementation */
- else
- emit_sof(cinfo, M_SOF1); /* SOF code for non-baseline Huffman file */
- }
-}
-
-
-/*
- * Write scan header.
- * This consists of DHT or DAC markers, optional DRI, and SOS.
- * Compressed data will be written following the SOS.
- */
-
-METHODDEF(void)
-write_scan_header (j_compress_ptr cinfo)
-{
- my_marker_ptr marker = (my_marker_ptr) cinfo->marker;
- int i;
- jpeg_component_info *compptr;
-
- if (cinfo->arith_code) {
- /* Emit arith conditioning info. We may have some duplication
- * if the file has multiple scans, but it's so small it's hardly
- * worth worrying about.
- */
- emit_dac(cinfo);
- } else {
- /* Emit Huffman tables.
- * Note that emit_dht() suppresses any duplicate tables.
- */
- for (i = 0; i < cinfo->comps_in_scan; i++) {
- compptr = cinfo->cur_comp_info[i];
- if (cinfo->progressive_mode) {
- /* Progressive mode: only DC or only AC tables are used in one scan */
- if (cinfo->Ss == 0) {
- if (cinfo->Ah == 0) /* DC needs no table for refinement scan */
- emit_dht(cinfo, compptr->dc_tbl_no, FALSE);
- } else {
- emit_dht(cinfo, compptr->ac_tbl_no, TRUE);
- }
- } else {
- /* Sequential mode: need both DC and AC tables */
- emit_dht(cinfo, compptr->dc_tbl_no, FALSE);
- emit_dht(cinfo, compptr->ac_tbl_no, TRUE);
- }
- }
- }
-
- /* Emit DRI if required --- note that DRI value could change for each scan.
- * We avoid wasting space with unnecessary DRIs, however.
- */
- if (cinfo->restart_interval != marker->last_restart_interval) {
- emit_dri(cinfo);
- marker->last_restart_interval = cinfo->restart_interval;
- }
-
- emit_sos(cinfo);
-}
-
-
-/*
- * Write datastream trailer.
- */
-
-METHODDEF(void)
-write_file_trailer (j_compress_ptr cinfo)
-{
- emit_marker(cinfo, M_EOI);
-}
-
-
-/*
- * Write an abbreviated table-specification datastream.
- * This consists of SOI, DQT and DHT tables, and EOI.
- * Any table that is defined and not marked sent_table = TRUE will be
- * emitted. Note that all tables will be marked sent_table = TRUE at exit.
- */
-
-METHODDEF(void)
-write_tables_only (j_compress_ptr cinfo)
-{
- int i;
-
- emit_marker(cinfo, M_SOI);
-
- for (i = 0; i < NUM_QUANT_TBLS; i++) {
- if (cinfo->quant_tbl_ptrs[i] != NULL)
- (void) emit_dqt(cinfo, i);
- }
-
- if (! cinfo->arith_code) {
- for (i = 0; i < NUM_HUFF_TBLS; i++) {
- if (cinfo->dc_huff_tbl_ptrs[i] != NULL)
- emit_dht(cinfo, i, FALSE);
- if (cinfo->ac_huff_tbl_ptrs[i] != NULL)
- emit_dht(cinfo, i, TRUE);
- }
- }
-
- emit_marker(cinfo, M_EOI);
-}
-
-
-/*
- * Initialize the marker writer module.
- */
-
-GLOBAL(void)
-jinit_marker_writer (j_compress_ptr cinfo)
-{
- my_marker_ptr marker;
-
- /* Create the subobject */
- marker = (my_marker_ptr)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- SIZEOF(my_marker_writer));
- cinfo->marker = (struct jpeg_marker_writer *) marker;
- /* Initialize method pointers */
- marker->pub.write_file_header = write_file_header;
- marker->pub.write_frame_header = write_frame_header;
- marker->pub.write_scan_header = write_scan_header;
- marker->pub.write_file_trailer = write_file_trailer;
- marker->pub.write_tables_only = write_tables_only;
- marker->pub.write_marker_header = write_marker_header;
- marker->pub.write_marker_byte = write_marker_byte;
- /* Initialize private state */
- marker->last_restart_interval = 0;
-}
-
-#endif //_FX_JPEG_TURBO_
+#if !defined(_FX_JPEG_TURBO_)
+/*
+ * jcmarker.c
+ *
+ * Copyright (C) 1991-1998, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains routines to write JPEG datastream markers.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+
+
+typedef enum { /* JPEG marker codes */
+ M_SOF0 = 0xc0,
+ M_SOF1 = 0xc1,
+ M_SOF2 = 0xc2,
+ M_SOF3 = 0xc3,
+
+ M_SOF5 = 0xc5,
+ M_SOF6 = 0xc6,
+ M_SOF7 = 0xc7,
+
+ M_JPG = 0xc8,
+ M_SOF9 = 0xc9,
+ M_SOF10 = 0xca,
+ M_SOF11 = 0xcb,
+
+ M_SOF13 = 0xcd,
+ M_SOF14 = 0xce,
+ M_SOF15 = 0xcf,
+
+ M_DHT = 0xc4,
+
+ M_DAC = 0xcc,
+
+ M_RST0 = 0xd0,
+ M_RST1 = 0xd1,
+ M_RST2 = 0xd2,
+ M_RST3 = 0xd3,
+ M_RST4 = 0xd4,
+ M_RST5 = 0xd5,
+ M_RST6 = 0xd6,
+ M_RST7 = 0xd7,
+
+ M_SOI = 0xd8,
+ M_EOI = 0xd9,
+ M_SOS = 0xda,
+ M_DQT = 0xdb,
+ M_DNL = 0xdc,
+ M_DRI = 0xdd,
+ M_DHP = 0xde,
+ M_EXP = 0xdf,
+
+ M_APP0 = 0xe0,
+ M_APP1 = 0xe1,
+ M_APP2 = 0xe2,
+ M_APP3 = 0xe3,
+ M_APP4 = 0xe4,
+ M_APP5 = 0xe5,
+ M_APP6 = 0xe6,
+ M_APP7 = 0xe7,
+ M_APP8 = 0xe8,
+ M_APP9 = 0xe9,
+ M_APP10 = 0xea,
+ M_APP11 = 0xeb,
+ M_APP12 = 0xec,
+ M_APP13 = 0xed,
+ M_APP14 = 0xee,
+ M_APP15 = 0xef,
+
+ M_JPG0 = 0xf0,
+ M_JPG13 = 0xfd,
+ M_COM = 0xfe,
+
+ M_TEM = 0x01,
+
+ M_ERROR = 0x100
+} JPEG_MARKER;
+
+
+/* Private state */
+
+typedef struct {
+ struct jpeg_marker_writer pub; /* public fields */
+
+ unsigned int last_restart_interval; /* last DRI value emitted; 0 after SOI */
+} my_marker_writer;
+
+typedef my_marker_writer * my_marker_ptr;
+
+
+/*
+ * Basic output routines.
+ *
+ * Note that we do not support suspension while writing a marker.
+ * Therefore, an application using suspension must ensure that there is
+ * enough buffer space for the initial markers (typ. 600-700 bytes) before
+ * calling jpeg_start_compress, and enough space to write the trailing EOI
+ * (a few bytes) before calling jpeg_finish_compress. Multipass compression
+ * modes are not supported at all with suspension, so those two are the only
+ * points where markers will be written.
+ */
+
+LOCAL(void)
+emit_byte (j_compress_ptr cinfo, int val)
+/* Emit a byte */
+{
+ struct jpeg_destination_mgr * dest = cinfo->dest;
+
+ *(dest->next_output_byte)++ = (JOCTET) val;
+ if (--dest->free_in_buffer == 0) {
+ if (! (*dest->empty_output_buffer) (cinfo))
+ ERREXIT(cinfo, JERR_CANT_SUSPEND);
+ }
+}
+
+
+LOCAL(void)
+emit_marker (j_compress_ptr cinfo, JPEG_MARKER mark)
+/* Emit a marker code */
+{
+ emit_byte(cinfo, 0xFF);
+ emit_byte(cinfo, (int) mark);
+}
+
+
+LOCAL(void)
+emit_2bytes (j_compress_ptr cinfo, int value)
+/* Emit a 2-byte integer; these are always MSB first in JPEG files */
+{
+ emit_byte(cinfo, (value >> 8) & 0xFF);
+ emit_byte(cinfo, value & 0xFF);
+}
+
+
+/*
+ * Routines to write specific marker types.
+ */
+
+LOCAL(int)
+emit_dqt (j_compress_ptr cinfo, int index)
+/* Emit a DQT marker */
+/* Returns the precision used (0 = 8bits, 1 = 16bits) for baseline checking */
+{
+ JQUANT_TBL * qtbl = cinfo->quant_tbl_ptrs[index];
+ int prec;
+ int i;
+
+ if (qtbl == NULL)
+ ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, index);
+
+ prec = 0;
+ for (i = 0; i < DCTSIZE2; i++) {
+ if (qtbl->quantval[i] > 255)
+ prec = 1;
+ }
+
+ if (! qtbl->sent_table) {
+ emit_marker(cinfo, M_DQT);
+
+ emit_2bytes(cinfo, prec ? DCTSIZE2*2 + 1 + 2 : DCTSIZE2 + 1 + 2);
+
+ emit_byte(cinfo, index + (prec<<4));
+
+ for (i = 0; i < DCTSIZE2; i++) {
+ /* The table entries must be emitted in zigzag order. */
+ unsigned int qval = qtbl->quantval[jpeg_natural_order[i]];
+ if (prec)
+ emit_byte(cinfo, (int) (qval >> 8));
+ emit_byte(cinfo, (int) (qval & 0xFF));
+ }
+
+ qtbl->sent_table = TRUE;
+ }
+
+ return prec;
+}
+
+
+LOCAL(void)
+emit_dht (j_compress_ptr cinfo, int index, boolean is_ac)
+/* Emit a DHT marker */
+{
+ JHUFF_TBL * htbl;
+ int length, i;
+
+ if (is_ac) {
+ htbl = cinfo->ac_huff_tbl_ptrs[index];
+ index += 0x10; /* output index has AC bit set */
+ } else {
+ htbl = cinfo->dc_huff_tbl_ptrs[index];
+ }
+
+ if (htbl == NULL)
+ ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, index);
+
+ if (! htbl->sent_table) {
+ emit_marker(cinfo, M_DHT);
+
+ length = 0;
+ for (i = 1; i <= 16; i++)
+ length += htbl->bits[i];
+
+ emit_2bytes(cinfo, length + 2 + 1 + 16);
+ emit_byte(cinfo, index);
+
+ for (i = 1; i <= 16; i++)
+ emit_byte(cinfo, htbl->bits[i]);
+
+ for (i = 0; i < length; i++)
+ emit_byte(cinfo, htbl->huffval[i]);
+
+ htbl->sent_table = TRUE;
+ }
+}
+
+
+LOCAL(void)
+emit_dac (j_compress_ptr cinfo)
+/* Emit a DAC marker */
+/* Since the useful info is so small, we want to emit all the tables in */
+/* one DAC marker. Therefore this routine does its own scan of the table. */
+{
+#ifdef C_ARITH_CODING_SUPPORTED
+ char dc_in_use[NUM_ARITH_TBLS];
+ char ac_in_use[NUM_ARITH_TBLS];
+ int length, i;
+ jpeg_component_info *compptr;
+
+ for (i = 0; i < NUM_ARITH_TBLS; i++)
+ dc_in_use[i] = ac_in_use[i] = 0;
+
+ for (i = 0; i < cinfo->comps_in_scan; i++) {
+ compptr = cinfo->cur_comp_info[i];
+ dc_in_use[compptr->dc_tbl_no] = 1;
+ ac_in_use[compptr->ac_tbl_no] = 1;
+ }
+
+ length = 0;
+ for (i = 0; i < NUM_ARITH_TBLS; i++)
+ length += dc_in_use[i] + ac_in_use[i];
+
+ emit_marker(cinfo, M_DAC);
+
+ emit_2bytes(cinfo, length*2 + 2);
+
+ for (i = 0; i < NUM_ARITH_TBLS; i++) {
+ if (dc_in_use[i]) {
+ emit_byte(cinfo, i);
+ emit_byte(cinfo, cinfo->arith_dc_L[i] + (cinfo->arith_dc_U[i]<<4));
+ }
+ if (ac_in_use[i]) {
+ emit_byte(cinfo, i + 0x10);
+ emit_byte(cinfo, cinfo->arith_ac_K[i]);
+ }
+ }
+#endif /* C_ARITH_CODING_SUPPORTED */
+}
+
+
+LOCAL(void)
+emit_dri (j_compress_ptr cinfo)
+/* Emit a DRI marker */
+{
+ emit_marker(cinfo, M_DRI);
+
+ emit_2bytes(cinfo, 4); /* fixed length */
+
+ emit_2bytes(cinfo, (int) cinfo->restart_interval);
+}
+
+
+LOCAL(void)
+emit_sof (j_compress_ptr cinfo, JPEG_MARKER code)
+/* Emit a SOF marker */
+{
+ int ci;
+ jpeg_component_info *compptr;
+
+ emit_marker(cinfo, code);
+
+ emit_2bytes(cinfo, 3 * cinfo->num_components + 2 + 5 + 1); /* length */
+
+ /* Make sure image isn't bigger than SOF field can handle */
+ if ((long) cinfo->image_height > 65535L ||
+ (long) cinfo->image_width > 65535L)
+ ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) 65535);
+
+ emit_byte(cinfo, cinfo->data_precision);
+ emit_2bytes(cinfo, (int) cinfo->image_height);
+ emit_2bytes(cinfo, (int) cinfo->image_width);
+
+ emit_byte(cinfo, cinfo->num_components);
+
+ for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+ ci++, compptr++) {
+ emit_byte(cinfo, compptr->component_id);
+ emit_byte(cinfo, (compptr->h_samp_factor << 4) + compptr->v_samp_factor);
+ emit_byte(cinfo, compptr->quant_tbl_no);
+ }
+}
+
+
+LOCAL(void)
+emit_sos (j_compress_ptr cinfo)
+/* Emit a SOS marker */
+{
+ int i, td, ta;
+ jpeg_component_info *compptr;
+
+ emit_marker(cinfo, M_SOS);
+
+ emit_2bytes(cinfo, 2 * cinfo->comps_in_scan + 2 + 1 + 3); /* length */
+
+ emit_byte(cinfo, cinfo->comps_in_scan);
+
+ for (i = 0; i < cinfo->comps_in_scan; i++) {
+ compptr = cinfo->cur_comp_info[i];
+ emit_byte(cinfo, compptr->component_id);
+ td = compptr->dc_tbl_no;
+ ta = compptr->ac_tbl_no;
+ if (cinfo->progressive_mode) {
+ /* Progressive mode: only DC or only AC tables are used in one scan;
+ * furthermore, Huffman coding of DC refinement uses no table at all.
+ * We emit 0 for unused field(s); this is recommended by the P&M text
+ * but does not seem to be specified in the standard.
+ */
+ if (cinfo->Ss == 0) {
+ ta = 0; /* DC scan */
+ if (cinfo->Ah != 0 && !cinfo->arith_code)
+ td = 0; /* no DC table either */
+ } else {
+ td = 0; /* AC scan */
+ }
+ }
+ emit_byte(cinfo, (td << 4) + ta);
+ }
+
+ emit_byte(cinfo, cinfo->Ss);
+ emit_byte(cinfo, cinfo->Se);
+ emit_byte(cinfo, (cinfo->Ah << 4) + cinfo->Al);
+}
+
+
+LOCAL(void)
+emit_jfif_app0 (j_compress_ptr cinfo)
+/* Emit a JFIF-compliant APP0 marker */
+{
+ /*
+ * Length of APP0 block (2 bytes)
+ * Block ID (4 bytes - ASCII "JFIF")
+ * Zero byte (1 byte to terminate the ID string)
+ * Version Major, Minor (2 bytes - major first)
+ * Units (1 byte - 0x00 = none, 0x01 = inch, 0x02 = cm)
+ * Xdpu (2 bytes - dots per unit horizontal)
+ * Ydpu (2 bytes - dots per unit vertical)
+ * Thumbnail X size (1 byte)
+ * Thumbnail Y size (1 byte)
+ */
+
+ emit_marker(cinfo, M_APP0);
+
+ emit_2bytes(cinfo, 2 + 4 + 1 + 2 + 1 + 2 + 2 + 1 + 1); /* length */
+
+ emit_byte(cinfo, 0x4A); /* Identifier: ASCII "JFIF" */
+ emit_byte(cinfo, 0x46);
+ emit_byte(cinfo, 0x49);
+ emit_byte(cinfo, 0x46);
+ emit_byte(cinfo, 0);
+ emit_byte(cinfo, cinfo->JFIF_major_version); /* Version fields */
+ emit_byte(cinfo, cinfo->JFIF_minor_version);
+ emit_byte(cinfo, cinfo->density_unit); /* Pixel size information */
+ emit_2bytes(cinfo, (int) cinfo->X_density);
+ emit_2bytes(cinfo, (int) cinfo->Y_density);
+ emit_byte(cinfo, 0); /* No thumbnail image */
+ emit_byte(cinfo, 0);
+}
+
+
+LOCAL(void)
+emit_adobe_app14 (j_compress_ptr cinfo)
+/* Emit an Adobe APP14 marker */
+{
+ /*
+ * Length of APP14 block (2 bytes)
+ * Block ID (5 bytes - ASCII "Adobe")
+ * Version Number (2 bytes - currently 100)
+ * Flags0 (2 bytes - currently 0)
+ * Flags1 (2 bytes - currently 0)
+ * Color transform (1 byte)
+ *
+ * Although Adobe TN 5116 mentions Version = 101, all the Adobe files
+ * now in circulation seem to use Version = 100, so that's what we write.
+ *
+ * We write the color transform byte as 1 if the JPEG color space is
+ * YCbCr, 2 if it's YCCK, 0 otherwise. Adobe's definition has to do with
+ * whether the encoder performed a transformation, which is pretty useless.
+ */
+
+ emit_marker(cinfo, M_APP14);
+
+ emit_2bytes(cinfo, 2 + 5 + 2 + 2 + 2 + 1); /* length */
+
+ emit_byte(cinfo, 0x41); /* Identifier: ASCII "Adobe" */
+ emit_byte(cinfo, 0x64);
+ emit_byte(cinfo, 0x6F);
+ emit_byte(cinfo, 0x62);
+ emit_byte(cinfo, 0x65);
+ emit_2bytes(cinfo, 100); /* Version */
+ emit_2bytes(cinfo, 0); /* Flags0 */
+ emit_2bytes(cinfo, 0); /* Flags1 */
+ switch (cinfo->jpeg_color_space) {
+ case JCS_YCbCr:
+ emit_byte(cinfo, 1); /* Color transform = 1 */
+ break;
+ case JCS_YCCK:
+ emit_byte(cinfo, 2); /* Color transform = 2 */
+ break;
+ default:
+ emit_byte(cinfo, 0); /* Color transform = 0 */
+ break;
+ }
+}
+
+
+/*
+ * These routines allow writing an arbitrary marker with parameters.
+ * The only intended use is to emit COM or APPn markers after calling
+ * write_file_header and before calling write_frame_header.
+ * Other uses are not guaranteed to produce desirable results.
+ * Counting the parameter bytes properly is the caller's responsibility.
+ */
+
+METHODDEF(void)
+write_marker_header (j_compress_ptr cinfo, int marker, unsigned int datalen)
+/* Emit an arbitrary marker header */
+{
+ if (datalen > (unsigned int) 65533) /* safety check */
+ ERREXIT(cinfo, JERR_BAD_LENGTH);
+
+ emit_marker(cinfo, (JPEG_MARKER) marker);
+
+ emit_2bytes(cinfo, (int) (datalen + 2)); /* total length */
+}
+
+METHODDEF(void)
+write_marker_byte (j_compress_ptr cinfo, int val)
+/* Emit one byte of marker parameters following write_marker_header */
+{
+ emit_byte(cinfo, val);
+}
+
+
+/*
+ * Write datastream header.
+ * This consists of an SOI and optional APPn markers.
+ * We recommend use of the JFIF marker, but not the Adobe marker,
+ * when using YCbCr or grayscale data. The JFIF marker should NOT
+ * be used for any other JPEG colorspace. The Adobe marker is helpful
+ * to distinguish RGB, CMYK, and YCCK colorspaces.
+ * Note that an application can write additional header markers after
+ * jpeg_start_compress returns.
+ */
+
+METHODDEF(void)
+write_file_header (j_compress_ptr cinfo)
+{
+ my_marker_ptr marker = (my_marker_ptr) cinfo->marker;
+
+ emit_marker(cinfo, M_SOI); /* first the SOI */
+
+ /* SOI is defined to reset restart interval to 0 */
+ marker->last_restart_interval = 0;
+
+ if (cinfo->write_JFIF_header) /* next an optional JFIF APP0 */
+ emit_jfif_app0(cinfo);
+ if (cinfo->write_Adobe_marker) /* next an optional Adobe APP14 */
+ emit_adobe_app14(cinfo);
+}
+
+
+/*
+ * Write frame header.
+ * This consists of DQT and SOFn markers.
+ * Note that we do not emit the SOF until we have emitted the DQT(s).
+ * This avoids compatibility problems with incorrect implementations that
+ * try to error-check the quant table numbers as soon as they see the SOF.
+ */
+
+METHODDEF(void)
+write_frame_header (j_compress_ptr cinfo)
+{
+ int ci, prec;
+ boolean is_baseline;
+ jpeg_component_info *compptr;
+
+ /* Emit DQT for each quantization table.
+ * Note that emit_dqt() suppresses any duplicate tables.
+ */
+ prec = 0;
+ for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+ ci++, compptr++) {
+ prec += emit_dqt(cinfo, compptr->quant_tbl_no);
+ }
+ /* now prec is nonzero iff there are any 16-bit quant tables. */
+
+ /* Check for a non-baseline specification.
+ * Note we assume that Huffman table numbers won't be changed later.
+ */
+ if (cinfo->arith_code || cinfo->progressive_mode ||
+ cinfo->data_precision != 8) {
+ is_baseline = FALSE;
+ } else {
+ is_baseline = TRUE;
+ for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+ ci++, compptr++) {
+ if (compptr->dc_tbl_no > 1 || compptr->ac_tbl_no > 1)
+ is_baseline = FALSE;
+ }
+ if (prec && is_baseline) {
+ is_baseline = FALSE;
+ /* If it's baseline except for quantizer size, warn the user */
+ TRACEMS(cinfo, 0, JTRC_16BIT_TABLES);
+ }
+ }
+
+ /* Emit the proper SOF marker */
+ if (cinfo->arith_code) {
+ emit_sof(cinfo, M_SOF9); /* SOF code for arithmetic coding */
+ } else {
+ if (cinfo->progressive_mode)
+ emit_sof(cinfo, M_SOF2); /* SOF code for progressive Huffman */
+ else if (is_baseline)
+ emit_sof(cinfo, M_SOF0); /* SOF code for baseline implementation */
+ else
+ emit_sof(cinfo, M_SOF1); /* SOF code for non-baseline Huffman file */
+ }
+}
+
+
+/*
+ * Write scan header.
+ * This consists of DHT or DAC markers, optional DRI, and SOS.
+ * Compressed data will be written following the SOS.
+ */
+
+METHODDEF(void)
+write_scan_header (j_compress_ptr cinfo)
+{
+ my_marker_ptr marker = (my_marker_ptr) cinfo->marker;
+ int i;
+ jpeg_component_info *compptr;
+
+ if (cinfo->arith_code) {
+ /* Emit arith conditioning info. We may have some duplication
+ * if the file has multiple scans, but it's so small it's hardly
+ * worth worrying about.
+ */
+ emit_dac(cinfo);
+ } else {
+ /* Emit Huffman tables.
+ * Note that emit_dht() suppresses any duplicate tables.
+ */
+ for (i = 0; i < cinfo->comps_in_scan; i++) {
+ compptr = cinfo->cur_comp_info[i];
+ if (cinfo->progressive_mode) {
+ /* Progressive mode: only DC or only AC tables are used in one scan */
+ if (cinfo->Ss == 0) {
+ if (cinfo->Ah == 0) /* DC needs no table for refinement scan */
+ emit_dht(cinfo, compptr->dc_tbl_no, FALSE);
+ } else {
+ emit_dht(cinfo, compptr->ac_tbl_no, TRUE);
+ }
+ } else {
+ /* Sequential mode: need both DC and AC tables */
+ emit_dht(cinfo, compptr->dc_tbl_no, FALSE);
+ emit_dht(cinfo, compptr->ac_tbl_no, TRUE);
+ }
+ }
+ }
+
+ /* Emit DRI if required --- note that DRI value could change for each scan.
+ * We avoid wasting space with unnecessary DRIs, however.
+ */
+ if (cinfo->restart_interval != marker->last_restart_interval) {
+ emit_dri(cinfo);
+ marker->last_restart_interval = cinfo->restart_interval;
+ }
+
+ emit_sos(cinfo);
+}
+
+
+/*
+ * Write datastream trailer.
+ */
+
+METHODDEF(void)
+write_file_trailer (j_compress_ptr cinfo)
+{
+ emit_marker(cinfo, M_EOI);
+}
+
+
+/*
+ * Write an abbreviated table-specification datastream.
+ * This consists of SOI, DQT and DHT tables, and EOI.
+ * Any table that is defined and not marked sent_table = TRUE will be
+ * emitted. Note that all tables will be marked sent_table = TRUE at exit.
+ */
+
+METHODDEF(void)
+write_tables_only (j_compress_ptr cinfo)
+{
+ int i;
+
+ emit_marker(cinfo, M_SOI);
+
+ for (i = 0; i < NUM_QUANT_TBLS; i++) {
+ if (cinfo->quant_tbl_ptrs[i] != NULL)
+ (void) emit_dqt(cinfo, i);
+ }
+
+ if (! cinfo->arith_code) {
+ for (i = 0; i < NUM_HUFF_TBLS; i++) {
+ if (cinfo->dc_huff_tbl_ptrs[i] != NULL)
+ emit_dht(cinfo, i, FALSE);
+ if (cinfo->ac_huff_tbl_ptrs[i] != NULL)
+ emit_dht(cinfo, i, TRUE);
+ }
+ }
+
+ emit_marker(cinfo, M_EOI);
+}
+
+
+/*
+ * Initialize the marker writer module.
+ */
+
+GLOBAL(void)
+jinit_marker_writer (j_compress_ptr cinfo)
+{
+ my_marker_ptr marker;
+
+ /* Create the subobject */
+ marker = (my_marker_ptr)
+ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ SIZEOF(my_marker_writer));
+ cinfo->marker = (struct jpeg_marker_writer *) marker;
+ /* Initialize method pointers */
+ marker->pub.write_file_header = write_file_header;
+ marker->pub.write_frame_header = write_frame_header;
+ marker->pub.write_scan_header = write_scan_header;
+ marker->pub.write_file_trailer = write_file_trailer;
+ marker->pub.write_tables_only = write_tables_only;
+ marker->pub.write_marker_header = write_marker_header;
+ marker->pub.write_marker_byte = write_marker_byte;
+ /* Initialize private state */
+ marker->last_restart_interval = 0;
+}
+
+#endif //_FX_JPEG_TURBO_
diff --git a/core/src/fxcodec/libjpeg/fpdfapi_jcmaster.c b/core/src/fxcodec/libjpeg/fpdfapi_jcmaster.c
index 870f775191..45322a53b3 100644
--- a/core/src/fxcodec/libjpeg/fpdfapi_jcmaster.c
+++ b/core/src/fxcodec/libjpeg/fpdfapi_jcmaster.c
@@ -1,593 +1,593 @@
-#if !defined(_FX_JPEG_TURBO_)
-/*
- * jcmaster.c
- *
- * Copyright (C) 1991-1997, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- * For conditions of distribution and use, see the accompanying README file.
- *
- * This file contains master control logic for the JPEG compressor.
- * These routines are concerned with parameter validation, initial setup,
- * and inter-pass control (determining the number of passes and the work
- * to be done in each pass).
- */
-
-#define JPEG_INTERNALS
-#include "jinclude.h"
-#include "jpeglib.h"
-
-
-/* Private state */
-
-typedef enum {
- main_pass, /* input data, also do first output step */
- huff_opt_pass, /* Huffman code optimization pass */
- output_pass /* data output pass */
-} c_pass_type;
-
-typedef struct {
- struct jpeg_comp_master pub; /* public fields */
-
- c_pass_type pass_type; /* the type of the current pass */
-
- int pass_number; /* # of passes completed */
- int total_passes; /* total # of passes needed */
-
- int scan_number; /* current index in scan_info[] */
-} my_comp_master;
-
-typedef my_comp_master * my_master_ptr;
-
-
-/*
- * Support routines that do various essential calculations.
- */
-
-LOCAL(void)
-initial_setup (j_compress_ptr cinfo)
-/* Do computations that are needed before master selection phase */
-{
- int ci;
- jpeg_component_info *compptr;
- long samplesperrow;
- JDIMENSION jd_samplesperrow;
-
- /* Sanity check on image dimensions */
- if (cinfo->image_height <= 0 || cinfo->image_width <= 0
- || cinfo->num_components <= 0 || cinfo->input_components <= 0)
- ERREXIT(cinfo, JERR_EMPTY_IMAGE);
-
- /* Make sure image isn't bigger than I can handle */
- if ((long) cinfo->image_height > (long) JPEG_MAX_DIMENSION ||
- (long) cinfo->image_width > (long) JPEG_MAX_DIMENSION)
- ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) JPEG_MAX_DIMENSION);
-
- /* Width of an input scanline must be representable as JDIMENSION. */
- samplesperrow = (long) cinfo->image_width * (long) cinfo->input_components;
- jd_samplesperrow = (JDIMENSION) samplesperrow;
- if ((long) jd_samplesperrow != samplesperrow)
- ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);
-
- /* For now, precision must match compiled-in value... */
- if (cinfo->data_precision != BITS_IN_JSAMPLE)
- ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision);
-
- /* Check that number of components won't exceed internal array sizes */
- if (cinfo->num_components > MAX_COMPONENTS)
- ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components,
- MAX_COMPONENTS);
-
- /* Compute maximum sampling factors; check factor validity */
- cinfo->max_h_samp_factor = 1;
- cinfo->max_v_samp_factor = 1;
- for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
- ci++, compptr++) {
- if (compptr->h_samp_factor<=0 || compptr->h_samp_factor>MAX_SAMP_FACTOR ||
- compptr->v_samp_factor<=0 || compptr->v_samp_factor>MAX_SAMP_FACTOR)
- ERREXIT(cinfo, JERR_BAD_SAMPLING);
- cinfo->max_h_samp_factor = MAX(cinfo->max_h_samp_factor,
- compptr->h_samp_factor);
- cinfo->max_v_samp_factor = MAX(cinfo->max_v_samp_factor,
- compptr->v_samp_factor);
- }
-
- /* Compute dimensions of components */
- for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
- ci++, compptr++) {
- /* Fill in the correct component_index value; don't rely on application */
- compptr->component_index = ci;
- /* For compression, we never do DCT scaling. */
- compptr->DCT_scaled_size = DCTSIZE;
- /* Size in DCT blocks */
- compptr->width_in_blocks = (JDIMENSION)
- jdiv_round_up((long) cinfo->image_width * (long) compptr->h_samp_factor,
- (long) (cinfo->max_h_samp_factor * DCTSIZE));
- compptr->height_in_blocks = (JDIMENSION)
- jdiv_round_up((long) cinfo->image_height * (long) compptr->v_samp_factor,
- (long) (cinfo->max_v_samp_factor * DCTSIZE));
- /* Size in samples */
- compptr->downsampled_width = (JDIMENSION)
- jdiv_round_up((long) cinfo->image_width * (long) compptr->h_samp_factor,
- (long) cinfo->max_h_samp_factor);
- compptr->downsampled_height = (JDIMENSION)
- jdiv_round_up((long) cinfo->image_height * (long) compptr->v_samp_factor,
- (long) cinfo->max_v_samp_factor);
- /* Mark component needed (this flag isn't actually used for compression) */
- compptr->component_needed = TRUE;
- }
-
- /* Compute number of fully interleaved MCU rows (number of times that
- * main controller will call coefficient controller).
- */
- cinfo->total_iMCU_rows = (JDIMENSION)
- jdiv_round_up((long) cinfo->image_height,
- (long) (cinfo->max_v_samp_factor*DCTSIZE));
-}
-
-
-#ifdef C_MULTISCAN_FILES_SUPPORTED
-
-LOCAL(void)
-validate_script (j_compress_ptr cinfo)
-/* Verify that the scan script in cinfo->scan_info[] is valid; also
- * determine whether it uses progressive JPEG, and set cinfo->progressive_mode.
- */
-{
- const jpeg_scan_info * scanptr;
- int scanno, ncomps, ci, coefi, thisi;
- int Ss, Se, Ah, Al;
- boolean component_sent[MAX_COMPONENTS];
-#ifdef C_PROGRESSIVE_SUPPORTED
- int * last_bitpos_ptr;
- int last_bitpos[MAX_COMPONENTS][DCTSIZE2];
- /* -1 until that coefficient has been seen; then last Al for it */
-#endif
-
- if (cinfo->num_scans <= 0)
- ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, 0);
-
- /* For sequential JPEG, all scans must have Ss=0, Se=DCTSIZE2-1;
- * for progressive JPEG, no scan can have this.
- */
- scanptr = cinfo->scan_info;
- if (scanptr->Ss != 0 || scanptr->Se != DCTSIZE2-1) {
-#ifdef C_PROGRESSIVE_SUPPORTED
- cinfo->progressive_mode = TRUE;
- last_bitpos_ptr = & last_bitpos[0][0];
- for (ci = 0; ci < cinfo->num_components; ci++)
- for (coefi = 0; coefi < DCTSIZE2; coefi++)
- *last_bitpos_ptr++ = -1;
-#else
- ERREXIT(cinfo, JERR_NOT_COMPILED);
-#endif
- } else {
- cinfo->progressive_mode = FALSE;
- for (ci = 0; ci < cinfo->num_components; ci++)
- component_sent[ci] = FALSE;
- }
-
- for (scanno = 1; scanno <= cinfo->num_scans; scanptr++, scanno++) {
- /* Validate component indexes */
- ncomps = scanptr->comps_in_scan;
- if (ncomps <= 0 || ncomps > MAX_COMPS_IN_SCAN)
- ERREXIT2(cinfo, JERR_COMPONENT_COUNT, ncomps, MAX_COMPS_IN_SCAN);
- for (ci = 0; ci < ncomps; ci++) {
- thisi = scanptr->component_index[ci];
- if (thisi < 0 || thisi >= cinfo->num_components)
- ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno);
- /* Components must appear in SOF order within each scan */
- if (ci > 0 && thisi <= scanptr->component_index[ci-1])
- ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno);
- }
- /* Validate progression parameters */
- Ss = scanptr->Ss;
- Se = scanptr->Se;
- Ah = scanptr->Ah;
- Al = scanptr->Al;
- if (cinfo->progressive_mode) {
-#ifdef C_PROGRESSIVE_SUPPORTED
- /* The JPEG spec simply gives the ranges 0..13 for Ah and Al, but that
- * seems wrong: the upper bound ought to depend on data precision.
- * Perhaps they really meant 0..N+1 for N-bit precision.
- * Here we allow 0..10 for 8-bit data; Al larger than 10 results in
- * out-of-range reconstructed DC values during the first DC scan,
- * which might cause problems for some decoders.
- */
-#if BITS_IN_JSAMPLE == 8
-#define MAX_AH_AL 10
-#else
-#define MAX_AH_AL 13
-#endif
- if (Ss < 0 || Ss >= DCTSIZE2 || Se < Ss || Se >= DCTSIZE2 ||
- Ah < 0 || Ah > MAX_AH_AL || Al < 0 || Al > MAX_AH_AL)
- ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
- if (Ss == 0) {
- if (Se != 0) /* DC and AC together not OK */
- ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
- } else {
- if (ncomps != 1) /* AC scans must be for only one component */
- ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
- }
- for (ci = 0; ci < ncomps; ci++) {
- last_bitpos_ptr = & last_bitpos[scanptr->component_index[ci]][0];
- if (Ss != 0 && last_bitpos_ptr[0] < 0) /* AC without prior DC scan */
- ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
- for (coefi = Ss; coefi <= Se; coefi++) {
- if (last_bitpos_ptr[coefi] < 0) {
- /* first scan of this coefficient */
- if (Ah != 0)
- ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
- } else {
- /* not first scan */
- if (Ah != last_bitpos_ptr[coefi] || Al != Ah-1)
- ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
- }
- last_bitpos_ptr[coefi] = Al;
- }
- }
-#endif
- } else {
- /* For sequential JPEG, all progression parameters must be these: */
- if (Ss != 0 || Se != DCTSIZE2-1 || Ah != 0 || Al != 0)
- ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
- /* Make sure components are not sent twice */
- for (ci = 0; ci < ncomps; ci++) {
- thisi = scanptr->component_index[ci];
- if (component_sent[thisi])
- ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno);
- component_sent[thisi] = TRUE;
- }
- }
- }
-
- /* Now verify that everything got sent. */
- if (cinfo->progressive_mode) {
-#ifdef C_PROGRESSIVE_SUPPORTED
- /* For progressive mode, we only check that at least some DC data
- * got sent for each component; the spec does not require that all bits
- * of all coefficients be transmitted. Would it be wiser to enforce
- * transmission of all coefficient bits??
- */
- for (ci = 0; ci < cinfo->num_components; ci++) {
- if (last_bitpos[ci][0] < 0)
- ERREXIT(cinfo, JERR_MISSING_DATA);
- }
-#endif
- } else {
- for (ci = 0; ci < cinfo->num_components; ci++) {
- if (! component_sent[ci])
- ERREXIT(cinfo, JERR_MISSING_DATA);
- }
- }
-}
-
-#endif /* C_MULTISCAN_FILES_SUPPORTED */
-
-
-LOCAL(void)
-select_scan_parameters (j_compress_ptr cinfo)
-/* Set up the scan parameters for the current scan */
-{
- int ci;
-
-#ifdef C_MULTISCAN_FILES_SUPPORTED
- if (cinfo->scan_info != NULL) {
- /* Prepare for current scan --- the script is already validated */
- my_master_ptr master = (my_master_ptr) cinfo->master;
- const jpeg_scan_info * scanptr = cinfo->scan_info + master->scan_number;
-
- cinfo->comps_in_scan = scanptr->comps_in_scan;
- for (ci = 0; ci < scanptr->comps_in_scan; ci++) {
- cinfo->cur_comp_info[ci] =
- &cinfo->comp_info[scanptr->component_index[ci]];
- }
- cinfo->Ss = scanptr->Ss;
- cinfo->Se = scanptr->Se;
- cinfo->Ah = scanptr->Ah;
- cinfo->Al = scanptr->Al;
- }
- else
-#endif
- {
- /* Prepare for single sequential-JPEG scan containing all components */
- if (cinfo->num_components > MAX_COMPS_IN_SCAN)
- ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components,
- MAX_COMPS_IN_SCAN);
- cinfo->comps_in_scan = cinfo->num_components;
- for (ci = 0; ci < cinfo->num_components; ci++) {
- cinfo->cur_comp_info[ci] = &cinfo->comp_info[ci];
- }
- cinfo->Ss = 0;
- cinfo->Se = DCTSIZE2-1;
- cinfo->Ah = 0;
- cinfo->Al = 0;
- }
-}
-
-
-LOCAL(void)
-per_scan_setup (j_compress_ptr cinfo)
-/* Do computations that are needed before processing a JPEG scan */
-/* cinfo->comps_in_scan and cinfo->cur_comp_info[] are already set */
-{
- int ci, mcublks, tmp;
- jpeg_component_info *compptr;
-
- if (cinfo->comps_in_scan == 1) {
-
- /* Noninterleaved (single-component) scan */
- compptr = cinfo->cur_comp_info[0];
-
- /* Overall image size in MCUs */
- cinfo->MCUs_per_row = compptr->width_in_blocks;
- cinfo->MCU_rows_in_scan = compptr->height_in_blocks;
-
- /* For noninterleaved scan, always one block per MCU */
- compptr->MCU_width = 1;
- compptr->MCU_height = 1;
- compptr->MCU_blocks = 1;
- compptr->MCU_sample_width = DCTSIZE;
- compptr->last_col_width = 1;
- /* For noninterleaved scans, it is convenient to define last_row_height
- * as the number of block rows present in the last iMCU row.
- */
- tmp = (int) (compptr->height_in_blocks % compptr->v_samp_factor);
- if (tmp == 0) tmp = compptr->v_samp_factor;
- compptr->last_row_height = tmp;
-
- /* Prepare array describing MCU composition */
- cinfo->blocks_in_MCU = 1;
- cinfo->MCU_membership[0] = 0;
-
- } else {
-
- /* Interleaved (multi-component) scan */
- if (cinfo->comps_in_scan <= 0 || cinfo->comps_in_scan > MAX_COMPS_IN_SCAN)
- ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->comps_in_scan,
- MAX_COMPS_IN_SCAN);
-
- /* Overall image size in MCUs */
- cinfo->MCUs_per_row = (JDIMENSION)
- jdiv_round_up((long) cinfo->image_width,
- (long) (cinfo->max_h_samp_factor*DCTSIZE));
- cinfo->MCU_rows_in_scan = (JDIMENSION)
- jdiv_round_up((long) cinfo->image_height,
- (long) (cinfo->max_v_samp_factor*DCTSIZE));
-
- cinfo->blocks_in_MCU = 0;
-
- for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
- compptr = cinfo->cur_comp_info[ci];
- /* Sampling factors give # of blocks of component in each MCU */
- compptr->MCU_width = compptr->h_samp_factor;
- compptr->MCU_height = compptr->v_samp_factor;
- compptr->MCU_blocks = compptr->MCU_width * compptr->MCU_height;
- compptr->MCU_sample_width = compptr->MCU_width * DCTSIZE;
- /* Figure number of non-dummy blocks in last MCU column & row */
- tmp = (int) (compptr->width_in_blocks % compptr->MCU_width);
- if (tmp == 0) tmp = compptr->MCU_width;
- compptr->last_col_width = tmp;
- tmp = (int) (compptr->height_in_blocks % compptr->MCU_height);
- if (tmp == 0) tmp = compptr->MCU_height;
- compptr->last_row_height = tmp;
- /* Prepare array describing MCU composition */
- mcublks = compptr->MCU_blocks;
- if (cinfo->blocks_in_MCU + mcublks > C_MAX_BLOCKS_IN_MCU)
- ERREXIT(cinfo, JERR_BAD_MCU_SIZE);
- while (mcublks-- > 0) {
- cinfo->MCU_membership[cinfo->blocks_in_MCU++] = ci;
- }
- }
-
- }
-
- /* Convert restart specified in rows to actual MCU count. */
- /* Note that count must fit in 16 bits, so we provide limiting. */
- if (cinfo->restart_in_rows > 0) {
- long nominal = (long) cinfo->restart_in_rows * (long) cinfo->MCUs_per_row;
- cinfo->restart_interval = (unsigned int) MIN(nominal, 65535L);
- }
-}
-
-
-/*
- * Per-pass setup.
- * This is called at the beginning of each pass. We determine which modules
- * will be active during this pass and give them appropriate start_pass calls.
- * We also set is_last_pass to indicate whether any more passes will be
- * required.
- */
-
-METHODDEF(void)
-prepare_for_pass (j_compress_ptr cinfo)
-{
- my_master_ptr master = (my_master_ptr) cinfo->master;
-
- switch (master->pass_type) {
- case main_pass:
- /* Initial pass: will collect input data, and do either Huffman
- * optimization or data output for the first scan.
- */
- select_scan_parameters(cinfo);
- per_scan_setup(cinfo);
- if (! cinfo->raw_data_in) {
- (*cinfo->cconvert->start_pass) (cinfo);
- (*cinfo->downsample->start_pass) (cinfo);
- (*cinfo->prep->start_pass) (cinfo, JBUF_PASS_THRU);
- }
- (*cinfo->fdct->start_pass) (cinfo);
- (*cinfo->entropy->start_pass) (cinfo, cinfo->optimize_coding);
- (*cinfo->coef->start_pass) (cinfo,
- (master->total_passes > 1 ?
- JBUF_SAVE_AND_PASS : JBUF_PASS_THRU));
- (*cinfo->main->start_pass) (cinfo, JBUF_PASS_THRU);
- if (cinfo->optimize_coding) {
- /* No immediate data output; postpone writing frame/scan headers */
- master->pub.call_pass_startup = FALSE;
- } else {
- /* Will write frame/scan headers at first jpeg_write_scanlines call */
- master->pub.call_pass_startup = TRUE;
- }
- break;
-#ifdef ENTROPY_OPT_SUPPORTED
- case huff_opt_pass:
- /* Do Huffman optimization for a scan after the first one. */
- select_scan_parameters(cinfo);
- per_scan_setup(cinfo);
- if (cinfo->Ss != 0 || cinfo->Ah == 0 || cinfo->arith_code) {
- (*cinfo->entropy->start_pass) (cinfo, TRUE);
- (*cinfo->coef->start_pass) (cinfo, JBUF_CRANK_DEST);
- master->pub.call_pass_startup = FALSE;
- break;
- }
- /* Special case: Huffman DC refinement scans need no Huffman table
- * and therefore we can skip the optimization pass for them.
- */
- master->pass_type = output_pass;
- master->pass_number++;
- /*FALLTHROUGH*/
-#endif
- case output_pass:
- /* Do a data-output pass. */
- /* We need not repeat per-scan setup if prior optimization pass did it. */
- if (! cinfo->optimize_coding) {
- select_scan_parameters(cinfo);
- per_scan_setup(cinfo);
- }
- (*cinfo->entropy->start_pass) (cinfo, FALSE);
- (*cinfo->coef->start_pass) (cinfo, JBUF_CRANK_DEST);
- /* We emit frame/scan headers now */
- if (master->scan_number == 0)
- (*cinfo->marker->write_frame_header) (cinfo);
- (*cinfo->marker->write_scan_header) (cinfo);
- master->pub.call_pass_startup = FALSE;
- break;
- default:
- ERREXIT(cinfo, JERR_NOT_COMPILED);
- }
-
- master->pub.is_last_pass = (master->pass_number == master->total_passes-1);
-
- /* Set up progress monitor's pass info if present */
- if (cinfo->progress != NULL) {
- cinfo->progress->completed_passes = master->pass_number;
- cinfo->progress->total_passes = master->total_passes;
- }
-}
-
-
-/*
- * Special start-of-pass hook.
- * This is called by jpeg_write_scanlines if call_pass_startup is TRUE.
- * In single-pass processing, we need this hook because we don't want to
- * write frame/scan headers during jpeg_start_compress; we want to let the
- * application write COM markers etc. between jpeg_start_compress and the
- * jpeg_write_scanlines loop.
- * In multi-pass processing, this routine is not used.
- */
-
-METHODDEF(void)
-pass_startup (j_compress_ptr cinfo)
-{
- cinfo->master->call_pass_startup = FALSE; /* reset flag so call only once */
-
- (*cinfo->marker->write_frame_header) (cinfo);
- (*cinfo->marker->write_scan_header) (cinfo);
-}
-
-
-/*
- * Finish up at end of pass.
- */
-
-METHODDEF(void)
-finish_pass_master (j_compress_ptr cinfo)
-{
- my_master_ptr master = (my_master_ptr) cinfo->master;
-
- /* The entropy coder always needs an end-of-pass call,
- * either to analyze statistics or to flush its output buffer.
- */
- (*cinfo->entropy->finish_pass) (cinfo);
-
- /* Update state for next pass */
- switch (master->pass_type) {
- case main_pass:
- /* next pass is either output of scan 0 (after optimization)
- * or output of scan 1 (if no optimization).
- */
- master->pass_type = output_pass;
- if (! cinfo->optimize_coding)
- master->scan_number++;
- break;
- case huff_opt_pass:
- /* next pass is always output of current scan */
- master->pass_type = output_pass;
- break;
- case output_pass:
- /* next pass is either optimization or output of next scan */
- if (cinfo->optimize_coding)
- master->pass_type = huff_opt_pass;
- master->scan_number++;
- break;
- }
-
- master->pass_number++;
-}
-
-
-/*
- * Initialize master compression control.
- */
-
-GLOBAL(void)
-jinit_c_master_control (j_compress_ptr cinfo, boolean transcode_only)
-{
- my_master_ptr master;
-
- master = (my_master_ptr)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- SIZEOF(my_comp_master));
- cinfo->master = (struct jpeg_comp_master *) master;
- master->pub.prepare_for_pass = prepare_for_pass;
- master->pub.pass_startup = pass_startup;
- master->pub.finish_pass = finish_pass_master;
- master->pub.is_last_pass = FALSE;
-
- /* Validate parameters, determine derived values */
- initial_setup(cinfo);
-
- if (cinfo->scan_info != NULL) {
-#ifdef C_MULTISCAN_FILES_SUPPORTED
- validate_script(cinfo);
-#else
- ERREXIT(cinfo, JERR_NOT_COMPILED);
-#endif
- } else {
- cinfo->progressive_mode = FALSE;
- cinfo->num_scans = 1;
- }
-
- if (cinfo->progressive_mode) /* TEMPORARY HACK ??? */
- cinfo->optimize_coding = TRUE; /* assume default tables no good for progressive mode */
-
- /* Initialize my private state */
- if (transcode_only) {
- /* no main pass in transcoding */
- if (cinfo->optimize_coding)
- master->pass_type = huff_opt_pass;
- else
- master->pass_type = output_pass;
- } else {
- /* for normal compression, first pass is always this type: */
- master->pass_type = main_pass;
- }
- master->scan_number = 0;
- master->pass_number = 0;
- if (cinfo->optimize_coding)
- master->total_passes = cinfo->num_scans * 2;
- else
- master->total_passes = cinfo->num_scans;
-}
-
-#endif //_FX_JPEG_TURBO_
+#if !defined(_FX_JPEG_TURBO_)
+/*
+ * jcmaster.c
+ *
+ * Copyright (C) 1991-1997, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains master control logic for the JPEG compressor.
+ * These routines are concerned with parameter validation, initial setup,
+ * and inter-pass control (determining the number of passes and the work
+ * to be done in each pass).
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+
+
+/* Private state */
+
+typedef enum {
+ main_pass, /* input data, also do first output step */
+ huff_opt_pass, /* Huffman code optimization pass */
+ output_pass /* data output pass */
+} c_pass_type;
+
+typedef struct {
+ struct jpeg_comp_master pub; /* public fields */
+
+ c_pass_type pass_type; /* the type of the current pass */
+
+ int pass_number; /* # of passes completed */
+ int total_passes; /* total # of passes needed */
+
+ int scan_number; /* current index in scan_info[] */
+} my_comp_master;
+
+typedef my_comp_master * my_master_ptr;
+
+
+/*
+ * Support routines that do various essential calculations.
+ */
+
+LOCAL(void)
+initial_setup (j_compress_ptr cinfo)
+/* Do computations that are needed before master selection phase */
+{
+ int ci;
+ jpeg_component_info *compptr;
+ long samplesperrow;
+ JDIMENSION jd_samplesperrow;
+
+ /* Sanity check on image dimensions */
+ if (cinfo->image_height <= 0 || cinfo->image_width <= 0
+ || cinfo->num_components <= 0 || cinfo->input_components <= 0)
+ ERREXIT(cinfo, JERR_EMPTY_IMAGE);
+
+ /* Make sure image isn't bigger than I can handle */
+ if ((long) cinfo->image_height > (long) JPEG_MAX_DIMENSION ||
+ (long) cinfo->image_width > (long) JPEG_MAX_DIMENSION)
+ ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) JPEG_MAX_DIMENSION);
+
+ /* Width of an input scanline must be representable as JDIMENSION. */
+ samplesperrow = (long) cinfo->image_width * (long) cinfo->input_components;
+ jd_samplesperrow = (JDIMENSION) samplesperrow;
+ if ((long) jd_samplesperrow != samplesperrow)
+ ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);
+
+ /* For now, precision must match compiled-in value... */
+ if (cinfo->data_precision != BITS_IN_JSAMPLE)
+ ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision);
+
+ /* Check that number of components won't exceed internal array sizes */
+ if (cinfo->num_components > MAX_COMPONENTS)
+ ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components,
+ MAX_COMPONENTS);
+
+ /* Compute maximum sampling factors; check factor validity */
+ cinfo->max_h_samp_factor = 1;
+ cinfo->max_v_samp_factor = 1;
+ for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+ ci++, compptr++) {
+ if (compptr->h_samp_factor<=0 || compptr->h_samp_factor>MAX_SAMP_FACTOR ||
+ compptr->v_samp_factor<=0 || compptr->v_samp_factor>MAX_SAMP_FACTOR)
+ ERREXIT(cinfo, JERR_BAD_SAMPLING);
+ cinfo->max_h_samp_factor = MAX(cinfo->max_h_samp_factor,
+ compptr->h_samp_factor);
+ cinfo->max_v_samp_factor = MAX(cinfo->max_v_samp_factor,
+ compptr->v_samp_factor);
+ }
+
+ /* Compute dimensions of components */
+ for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+ ci++, compptr++) {
+ /* Fill in the correct component_index value; don't rely on application */
+ compptr->component_index = ci;
+ /* For compression, we never do DCT scaling. */
+ compptr->DCT_scaled_size = DCTSIZE;
+ /* Size in DCT blocks */
+ compptr->width_in_blocks = (JDIMENSION)
+ jdiv_round_up((long) cinfo->image_width * (long) compptr->h_samp_factor,
+ (long) (cinfo->max_h_samp_factor * DCTSIZE));
+ compptr->height_in_blocks = (JDIMENSION)
+ jdiv_round_up((long) cinfo->image_height * (long) compptr->v_samp_factor,
+ (long) (cinfo->max_v_samp_factor * DCTSIZE));
+ /* Size in samples */
+ compptr->downsampled_width = (JDIMENSION)
+ jdiv_round_up((long) cinfo->image_width * (long) compptr->h_samp_factor,
+ (long) cinfo->max_h_samp_factor);
+ compptr->downsampled_height = (JDIMENSION)
+ jdiv_round_up((long) cinfo->image_height * (long) compptr->v_samp_factor,
+ (long) cinfo->max_v_samp_factor);
+ /* Mark component needed (this flag isn't actually used for compression) */
+ compptr->component_needed = TRUE;
+ }
+
+ /* Compute number of fully interleaved MCU rows (number of times that
+ * main controller will call coefficient controller).
+ */
+ cinfo->total_iMCU_rows = (JDIMENSION)
+ jdiv_round_up((long) cinfo->image_height,
+ (long) (cinfo->max_v_samp_factor*DCTSIZE));
+}
+
+
+#ifdef C_MULTISCAN_FILES_SUPPORTED
+
+LOCAL(void)
+validate_script (j_compress_ptr cinfo)
+/* Verify that the scan script in cinfo->scan_info[] is valid; also
+ * determine whether it uses progressive JPEG, and set cinfo->progressive_mode.
+ */
+{
+ const jpeg_scan_info * scanptr;
+ int scanno, ncomps, ci, coefi, thisi;
+ int Ss, Se, Ah, Al;
+ boolean component_sent[MAX_COMPONENTS];
+#ifdef C_PROGRESSIVE_SUPPORTED
+ int * last_bitpos_ptr;
+ int last_bitpos[MAX_COMPONENTS][DCTSIZE2];
+ /* -1 until that coefficient has been seen; then last Al for it */
+#endif
+
+ if (cinfo->num_scans <= 0)
+ ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, 0);
+
+ /* For sequential JPEG, all scans must have Ss=0, Se=DCTSIZE2-1;
+ * for progressive JPEG, no scan can have this.
+ */
+ scanptr = cinfo->scan_info;
+ if (scanptr->Ss != 0 || scanptr->Se != DCTSIZE2-1) {
+#ifdef C_PROGRESSIVE_SUPPORTED
+ cinfo->progressive_mode = TRUE;
+ last_bitpos_ptr = & last_bitpos[0][0];
+ for (ci = 0; ci < cinfo->num_components; ci++)
+ for (coefi = 0; coefi < DCTSIZE2; coefi++)
+ *last_bitpos_ptr++ = -1;
+#else
+ ERREXIT(cinfo, JERR_NOT_COMPILED);
+#endif
+ } else {
+ cinfo->progressive_mode = FALSE;
+ for (ci = 0; ci < cinfo->num_components; ci++)
+ component_sent[ci] = FALSE;
+ }
+
+ for (scanno = 1; scanno <= cinfo->num_scans; scanptr++, scanno++) {
+ /* Validate component indexes */
+ ncomps = scanptr->comps_in_scan;
+ if (ncomps <= 0 || ncomps > MAX_COMPS_IN_SCAN)
+ ERREXIT2(cinfo, JERR_COMPONENT_COUNT, ncomps, MAX_COMPS_IN_SCAN);
+ for (ci = 0; ci < ncomps; ci++) {
+ thisi = scanptr->component_index[ci];
+ if (thisi < 0 || thisi >= cinfo->num_components)
+ ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno);
+ /* Components must appear in SOF order within each scan */
+ if (ci > 0 && thisi <= scanptr->component_index[ci-1])
+ ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno);
+ }
+ /* Validate progression parameters */
+ Ss = scanptr->Ss;
+ Se = scanptr->Se;
+ Ah = scanptr->Ah;
+ Al = scanptr->Al;
+ if (cinfo->progressive_mode) {
+#ifdef C_PROGRESSIVE_SUPPORTED
+ /* The JPEG spec simply gives the ranges 0..13 for Ah and Al, but that
+ * seems wrong: the upper bound ought to depend on data precision.
+ * Perhaps they really meant 0..N+1 for N-bit precision.
+ * Here we allow 0..10 for 8-bit data; Al larger than 10 results in
+ * out-of-range reconstructed DC values during the first DC scan,
+ * which might cause problems for some decoders.
+ */
+#if BITS_IN_JSAMPLE == 8
+#define MAX_AH_AL 10
+#else
+#define MAX_AH_AL 13
+#endif
+ if (Ss < 0 || Ss >= DCTSIZE2 || Se < Ss || Se >= DCTSIZE2 ||
+ Ah < 0 || Ah > MAX_AH_AL || Al < 0 || Al > MAX_AH_AL)
+ ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
+ if (Ss == 0) {
+ if (Se != 0) /* DC and AC together not OK */
+ ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
+ } else {
+ if (ncomps != 1) /* AC scans must be for only one component */
+ ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
+ }
+ for (ci = 0; ci < ncomps; ci++) {
+ last_bitpos_ptr = & last_bitpos[scanptr->component_index[ci]][0];
+ if (Ss != 0 && last_bitpos_ptr[0] < 0) /* AC without prior DC scan */
+ ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
+ for (coefi = Ss; coefi <= Se; coefi++) {
+ if (last_bitpos_ptr[coefi] < 0) {
+ /* first scan of this coefficient */
+ if (Ah != 0)
+ ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
+ } else {
+ /* not first scan */
+ if (Ah != last_bitpos_ptr[coefi] || Al != Ah-1)
+ ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
+ }
+ last_bitpos_ptr[coefi] = Al;
+ }
+ }
+#endif
+ } else {
+ /* For sequential JPEG, all progression parameters must be these: */
+ if (Ss != 0 || Se != DCTSIZE2-1 || Ah != 0 || Al != 0)
+ ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
+ /* Make sure components are not sent twice */
+ for (ci = 0; ci < ncomps; ci++) {
+ thisi = scanptr->component_index[ci];
+ if (component_sent[thisi])
+ ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno);
+ component_sent[thisi] = TRUE;
+ }
+ }
+ }
+
+ /* Now verify that everything got sent. */
+ if (cinfo->progressive_mode) {
+#ifdef C_PROGRESSIVE_SUPPORTED
+ /* For progressive mode, we only check that at least some DC data
+ * got sent for each component; the spec does not require that all bits
+ * of all coefficients be transmitted. Would it be wiser to enforce
+ * transmission of all coefficient bits??
+ */
+ for (ci = 0; ci < cinfo->num_components; ci++) {
+ if (last_bitpos[ci][0] < 0)
+ ERREXIT(cinfo, JERR_MISSING_DATA);
+ }
+#endif
+ } else {
+ for (ci = 0; ci < cinfo->num_components; ci++) {
+ if (! component_sent[ci])
+ ERREXIT(cinfo, JERR_MISSING_DATA);
+ }
+ }
+}
+
+#endif /* C_MULTISCAN_FILES_SUPPORTED */
+
+
+LOCAL(void)
+select_scan_parameters (j_compress_ptr cinfo)
+/* Set up the scan parameters for the current scan */
+{
+ int ci;
+
+#ifdef C_MULTISCAN_FILES_SUPPORTED
+ if (cinfo->scan_info != NULL) {
+ /* Prepare for current scan --- the script is already validated */
+ my_master_ptr master = (my_master_ptr) cinfo->master;
+ const jpeg_scan_info * scanptr = cinfo->scan_info + master->scan_number;
+
+ cinfo->comps_in_scan = scanptr->comps_in_scan;
+ for (ci = 0; ci < scanptr->comps_in_scan; ci++) {
+ cinfo->cur_comp_info[ci] =
+ &cinfo->comp_info[scanptr->component_index[ci]];
+ }
+ cinfo->Ss = scanptr->Ss;
+ cinfo->Se = scanptr->Se;
+ cinfo->Ah = scanptr->Ah;
+ cinfo->Al = scanptr->Al;
+ }
+ else
+#endif
+ {
+ /* Prepare for single sequential-JPEG scan containing all components */
+ if (cinfo->num_components > MAX_COMPS_IN_SCAN)
+ ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components,
+ MAX_COMPS_IN_SCAN);
+ cinfo->comps_in_scan = cinfo->num_components;
+ for (ci = 0; ci < cinfo->num_components; ci++) {
+ cinfo->cur_comp_info[ci] = &cinfo->comp_info[ci];
+ }
+ cinfo->Ss = 0;
+ cinfo->Se = DCTSIZE2-1;
+ cinfo->Ah = 0;
+ cinfo->Al = 0;
+ }
+}
+
+
+LOCAL(void)
+per_scan_setup (j_compress_ptr cinfo)
+/* Do computations that are needed before processing a JPEG scan */
+/* cinfo->comps_in_scan and cinfo->cur_comp_info[] are already set */
+{
+ int ci, mcublks, tmp;
+ jpeg_component_info *compptr;
+
+ if (cinfo->comps_in_scan == 1) {
+
+ /* Noninterleaved (single-component) scan */
+ compptr = cinfo->cur_comp_info[0];
+
+ /* Overall image size in MCUs */
+ cinfo->MCUs_per_row = compptr->width_in_blocks;
+ cinfo->MCU_rows_in_scan = compptr->height_in_blocks;
+
+ /* For noninterleaved scan, always one block per MCU */
+ compptr->MCU_width = 1;
+ compptr->MCU_height = 1;
+ compptr->MCU_blocks = 1;
+ compptr->MCU_sample_width = DCTSIZE;
+ compptr->last_col_width = 1;
+ /* For noninterleaved scans, it is convenient to define last_row_height
+ * as the number of block rows present in the last iMCU row.
+ */
+ tmp = (int) (compptr->height_in_blocks % compptr->v_samp_factor);
+ if (tmp == 0) tmp = compptr->v_samp_factor;
+ compptr->last_row_height = tmp;
+
+ /* Prepare array describing MCU composition */
+ cinfo->blocks_in_MCU = 1;
+ cinfo->MCU_membership[0] = 0;
+
+ } else {
+
+ /* Interleaved (multi-component) scan */
+ if (cinfo->comps_in_scan <= 0 || cinfo->comps_in_scan > MAX_COMPS_IN_SCAN)
+ ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->comps_in_scan,
+ MAX_COMPS_IN_SCAN);
+
+ /* Overall image size in MCUs */
+ cinfo->MCUs_per_row = (JDIMENSION)
+ jdiv_round_up((long) cinfo->image_width,
+ (long) (cinfo->max_h_samp_factor*DCTSIZE));
+ cinfo->MCU_rows_in_scan = (JDIMENSION)
+ jdiv_round_up((long) cinfo->image_height,
+ (long) (cinfo->max_v_samp_factor*DCTSIZE));
+
+ cinfo->blocks_in_MCU = 0;
+
+ for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
+ compptr = cinfo->cur_comp_info[ci];
+ /* Sampling factors give # of blocks of component in each MCU */
+ compptr->MCU_width = compptr->h_samp_factor;
+ compptr->MCU_height = compptr->v_samp_factor;
+ compptr->MCU_blocks = compptr->MCU_width * compptr->MCU_height;
+ compptr->MCU_sample_width = compptr->MCU_width * DCTSIZE;
+ /* Figure number of non-dummy blocks in last MCU column & row */
+ tmp = (int) (compptr->width_in_blocks % compptr->MCU_width);
+ if (tmp == 0) tmp = compptr->MCU_width;
+ compptr->last_col_width = tmp;
+ tmp = (int) (compptr->height_in_blocks % compptr->MCU_height);
+ if (tmp == 0) tmp = compptr->MCU_height;
+ compptr->last_row_height = tmp;
+ /* Prepare array describing MCU composition */
+ mcublks = compptr->MCU_blocks;
+ if (cinfo->blocks_in_MCU + mcublks > C_MAX_BLOCKS_IN_MCU)
+ ERREXIT(cinfo, JERR_BAD_MCU_SIZE);
+ while (mcublks-- > 0) {
+ cinfo->MCU_membership[cinfo->blocks_in_MCU++] = ci;
+ }
+ }
+
+ }
+
+ /* Convert restart specified in rows to actual MCU count. */
+ /* Note that count must fit in 16 bits, so we provide limiting. */
+ if (cinfo->restart_in_rows > 0) {
+ long nominal = (long) cinfo->restart_in_rows * (long) cinfo->MCUs_per_row;
+ cinfo->restart_interval = (unsigned int) MIN(nominal, 65535L);
+ }
+}
+
+
+/*
+ * Per-pass setup.
+ * This is called at the beginning of each pass. We determine which modules
+ * will be active during this pass and give them appropriate start_pass calls.
+ * We also set is_last_pass to indicate whether any more passes will be
+ * required.
+ */
+
+METHODDEF(void)
+prepare_for_pass (j_compress_ptr cinfo)
+{
+ my_master_ptr master = (my_master_ptr) cinfo->master;
+
+ switch (master->pass_type) {
+ case main_pass:
+ /* Initial pass: will collect input data, and do either Huffman
+ * optimization or data output for the first scan.
+ */
+ select_scan_parameters(cinfo);
+ per_scan_setup(cinfo);
+ if (! cinfo->raw_data_in) {
+ (*cinfo->cconvert->start_pass) (cinfo);
+ (*cinfo->downsample->start_pass) (cinfo);
+ (*cinfo->prep->start_pass) (cinfo, JBUF_PASS_THRU);
+ }
+ (*cinfo->fdct->start_pass) (cinfo);
+ (*cinfo->entropy->start_pass) (cinfo, cinfo->optimize_coding);
+ (*cinfo->coef->start_pass) (cinfo,
+ (master->total_passes > 1 ?
+ JBUF_SAVE_AND_PASS : JBUF_PASS_THRU));
+ (*cinfo->main->start_pass) (cinfo, JBUF_PASS_THRU);
+ if (cinfo->optimize_coding) {
+ /* No immediate data output; postpone writing frame/scan headers */
+ master->pub.call_pass_startup = FALSE;
+ } else {
+ /* Will write frame/scan headers at first jpeg_write_scanlines call */
+ master->pub.call_pass_startup = TRUE;
+ }
+ break;
+#ifdef ENTROPY_OPT_SUPPORTED
+ case huff_opt_pass:
+ /* Do Huffman optimization for a scan after the first one. */
+ select_scan_parameters(cinfo);
+ per_scan_setup(cinfo);
+ if (cinfo->Ss != 0 || cinfo->Ah == 0 || cinfo->arith_code) {
+ (*cinfo->entropy->start_pass) (cinfo, TRUE);
+ (*cinfo->coef->start_pass) (cinfo, JBUF_CRANK_DEST);
+ master->pub.call_pass_startup = FALSE;
+ break;
+ }
+ /* Special case: Huffman DC refinement scans need no Huffman table
+ * and therefore we can skip the optimization pass for them.
+ */
+ master->pass_type = output_pass;
+ master->pass_number++;
+ /*FALLTHROUGH*/
+#endif
+ case output_pass:
+ /* Do a data-output pass. */
+ /* We need not repeat per-scan setup if prior optimization pass did it. */
+ if (! cinfo->optimize_coding) {
+ select_scan_parameters(cinfo);
+ per_scan_setup(cinfo);
+ }
+ (*cinfo->entropy->start_pass) (cinfo, FALSE);
+ (*cinfo->coef->start_pass) (cinfo, JBUF_CRANK_DEST);
+ /* We emit frame/scan headers now */
+ if (master->scan_number == 0)
+ (*cinfo->marker->write_frame_header) (cinfo);
+ (*cinfo->marker->write_scan_header) (cinfo);
+ master->pub.call_pass_startup = FALSE;
+ break;
+ default:
+ ERREXIT(cinfo, JERR_NOT_COMPILED);
+ }
+
+ master->pub.is_last_pass = (master->pass_number == master->total_passes-1);
+
+ /* Set up progress monitor's pass info if present */
+ if (cinfo->progress != NULL) {
+ cinfo->progress->completed_passes = master->pass_number;
+ cinfo->progress->total_passes = master->total_passes;
+ }
+}
+
+
+/*
+ * Special start-of-pass hook.
+ * This is called by jpeg_write_scanlines if call_pass_startup is TRUE.
+ * In single-pass processing, we need this hook because we don't want to
+ * write frame/scan headers during jpeg_start_compress; we want to let the
+ * application write COM markers etc. between jpeg_start_compress and the
+ * jpeg_write_scanlines loop.
+ * In multi-pass processing, this routine is not used.
+ */
+
+METHODDEF(void)
+pass_startup (j_compress_ptr cinfo)
+{
+ cinfo->master->call_pass_startup = FALSE; /* reset flag so call only once */
+
+ (*cinfo->marker->write_frame_header) (cinfo);
+ (*cinfo->marker->write_scan_header) (cinfo);
+}
+
+
+/*
+ * Finish up at end of pass.
+ */
+
+METHODDEF(void)
+finish_pass_master (j_compress_ptr cinfo)
+{
+ my_master_ptr master = (my_master_ptr) cinfo->master;
+
+ /* The entropy coder always needs an end-of-pass call,
+ * either to analyze statistics or to flush its output buffer.
+ */
+ (*cinfo->entropy->finish_pass) (cinfo);
+
+ /* Update state for next pass */
+ switch (master->pass_type) {
+ case main_pass:
+ /* next pass is either output of scan 0 (after optimization)
+ * or output of scan 1 (if no optimization).
+ */
+ master->pass_type = output_pass;
+ if (! cinfo->optimize_coding)
+ master->scan_number++;
+ break;
+ case huff_opt_pass:
+ /* next pass is always output of current scan */
+ master->pass_type = output_pass;
+ break;
+ case output_pass:
+ /* next pass is either optimization or output of next scan */
+ if (cinfo->optimize_coding)
+ master->pass_type = huff_opt_pass;
+ master->scan_number++;
+ break;
+ }
+
+ master->pass_number++;
+}
+
+
+/*
+ * Initialize master compression control.
+ */
+
+GLOBAL(void)
+jinit_c_master_control (j_compress_ptr cinfo, boolean transcode_only)
+{
+ my_master_ptr master;
+
+ master = (my_master_ptr)
+ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ SIZEOF(my_comp_master));
+ cinfo->master = (struct jpeg_comp_master *) master;
+ master->pub.prepare_for_pass = prepare_for_pass;
+ master->pub.pass_startup = pass_startup;
+ master->pub.finish_pass = finish_pass_master;
+ master->pub.is_last_pass = FALSE;
+
+ /* Validate parameters, determine derived values */
+ initial_setup(cinfo);
+
+ if (cinfo->scan_info != NULL) {
+#ifdef C_MULTISCAN_FILES_SUPPORTED
+ validate_script(cinfo);
+#else
+ ERREXIT(cinfo, JERR_NOT_COMPILED);
+#endif
+ } else {
+ cinfo->progressive_mode = FALSE;
+ cinfo->num_scans = 1;
+ }
+
+ if (cinfo->progressive_mode) /* TEMPORARY HACK ??? */
+ cinfo->optimize_coding = TRUE; /* assume default tables no good for progressive mode */
+
+ /* Initialize my private state */
+ if (transcode_only) {
+ /* no main pass in transcoding */
+ if (cinfo->optimize_coding)
+ master->pass_type = huff_opt_pass;
+ else
+ master->pass_type = output_pass;
+ } else {
+ /* for normal compression, first pass is always this type: */
+ master->pass_type = main_pass;
+ }
+ master->scan_number = 0;
+ master->pass_number = 0;
+ if (cinfo->optimize_coding)
+ master->total_passes = cinfo->num_scans * 2;
+ else
+ master->total_passes = cinfo->num_scans;
+}
+
+#endif //_FX_JPEG_TURBO_
diff --git a/core/src/fxcodec/libjpeg/fpdfapi_jcomapi.c b/core/src/fxcodec/libjpeg/fpdfapi_jcomapi.c
index 964909ac4e..aad37d8879 100644
--- a/core/src/fxcodec/libjpeg/fpdfapi_jcomapi.c
+++ b/core/src/fxcodec/libjpeg/fpdfapi_jcomapi.c
@@ -1,109 +1,109 @@
-#if !defined(_FX_JPEG_TURBO_)
-/*
- * jcomapi.c
- *
- * Copyright (C) 1994-1997, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- * For conditions of distribution and use, see the accompanying README file.
- *
- * This file contains application interface routines that are used for both
- * compression and decompression.
- */
-
-#define JPEG_INTERNALS
-#include "jinclude.h"
-#include "jpeglib.h"
-
-
-/*
- * Abort processing of a JPEG compression or decompression operation,
- * but don't destroy the object itself.
- *
- * For this, we merely clean up all the nonpermanent memory pools.
- * Note that temp files (virtual arrays) are not allowed to belong to
- * the permanent pool, so we will be able to close all temp files here.
- * Closing a data source or destination, if necessary, is the application's
- * responsibility.
- */
-
-GLOBAL(void)
-jpeg_abort (j_common_ptr cinfo)
-{
- int pool;
-
- /* Do nothing if called on a not-initialized or destroyed JPEG object. */
- if (cinfo->mem == NULL)
- return;
-
- /* Releasing pools in reverse order might help avoid fragmentation
- * with some (brain-damaged) malloc libraries.
- */
- for (pool = JPOOL_NUMPOOLS-1; pool > JPOOL_PERMANENT; pool--) {
- (*cinfo->mem->free_pool) (cinfo, pool);
- }
-
- /* Reset overall state for possible reuse of object */
- if (cinfo->is_decompressor) {
- cinfo->global_state = DSTATE_START;
- /* Try to keep application from accessing now-deleted marker list.
- * A bit kludgy to do it here, but this is the most central place.
- */
- ((j_decompress_ptr) cinfo)->marker_list = NULL;
- } else {
- cinfo->global_state = CSTATE_START;
- }
-}
-
-
-/*
- * Destruction of a JPEG object.
- *
- * Everything gets deallocated except the master jpeg_compress_struct itself
- * and the error manager struct. Both of these are supplied by the application
- * and must be freed, if necessary, by the application. (Often they are on
- * the stack and so don't need to be freed anyway.)
- * Closing a data source or destination, if necessary, is the application's
- * responsibility.
- */
-
-GLOBAL(void)
-jpeg_destroy (j_common_ptr cinfo)
-{
- /* We need only tell the memory manager to release everything. */
- /* NB: mem pointer is NULL if memory mgr failed to initialize. */
- if (cinfo->mem != NULL)
- (*cinfo->mem->self_destruct) (cinfo);
- cinfo->mem = NULL; /* be safe if jpeg_destroy is called twice */
- cinfo->global_state = 0; /* mark it destroyed */
-}
-
-
-/*
- * Convenience routines for allocating quantization and Huffman tables.
- * (Would jutils.c be a more reasonable place to put these?)
- */
-
-GLOBAL(JQUANT_TBL *)
-jpeg_alloc_quant_table (j_common_ptr cinfo)
-{
- JQUANT_TBL *tbl;
-
- tbl = (JQUANT_TBL *)
- (*cinfo->mem->alloc_small) (cinfo, JPOOL_PERMANENT, SIZEOF(JQUANT_TBL));
- tbl->sent_table = FALSE; /* make sure this is false in any new table */
- return tbl;
-}
-
-
-GLOBAL(JHUFF_TBL *)
-jpeg_alloc_huff_table (j_common_ptr cinfo)
-{
- JHUFF_TBL *tbl;
-
- tbl = (JHUFF_TBL *)
- (*cinfo->mem->alloc_small) (cinfo, JPOOL_PERMANENT, SIZEOF(JHUFF_TBL));
- tbl->sent_table = FALSE; /* make sure this is false in any new table */
- return tbl;
-}
-
-#endif //_FX_JPEG_TURBO_
+#if !defined(_FX_JPEG_TURBO_)
+/*
+ * jcomapi.c
+ *
+ * Copyright (C) 1994-1997, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains application interface routines that are used for both
+ * compression and decompression.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+
+
+/*
+ * Abort processing of a JPEG compression or decompression operation,
+ * but don't destroy the object itself.
+ *
+ * For this, we merely clean up all the nonpermanent memory pools.
+ * Note that temp files (virtual arrays) are not allowed to belong to
+ * the permanent pool, so we will be able to close all temp files here.
+ * Closing a data source or destination, if necessary, is the application's
+ * responsibility.
+ */
+
+GLOBAL(void)
+jpeg_abort (j_common_ptr cinfo)
+{
+ int pool;
+
+ /* Do nothing if called on a not-initialized or destroyed JPEG object. */
+ if (cinfo->mem == NULL)
+ return;
+
+ /* Releasing pools in reverse order might help avoid fragmentation
+ * with some (brain-damaged) malloc libraries.
+ */
+ for (pool = JPOOL_NUMPOOLS-1; pool > JPOOL_PERMANENT; pool--) {
+ (*cinfo->mem->free_pool) (cinfo, pool);
+ }
+
+ /* Reset overall state for possible reuse of object */
+ if (cinfo->is_decompressor) {
+ cinfo->global_state = DSTATE_START;
+ /* Try to keep application from accessing now-deleted marker list.
+ * A bit kludgy to do it here, but this is the most central place.
+ */
+ ((j_decompress_ptr) cinfo)->marker_list = NULL;
+ } else {
+ cinfo->global_state = CSTATE_START;
+ }
+}
+
+
+/*
+ * Destruction of a JPEG object.
+ *
+ * Everything gets deallocated except the master jpeg_compress_struct itself
+ * and the error manager struct. Both of these are supplied by the application
+ * and must be freed, if necessary, by the application. (Often they are on
+ * the stack and so don't need to be freed anyway.)
+ * Closing a data source or destination, if necessary, is the application's
+ * responsibility.
+ */
+
+GLOBAL(void)
+jpeg_destroy (j_common_ptr cinfo)
+{
+ /* We need only tell the memory manager to release everything. */
+ /* NB: mem pointer is NULL if memory mgr failed to initialize. */
+ if (cinfo->mem != NULL)
+ (*cinfo->mem->self_destruct) (cinfo);
+ cinfo->mem = NULL; /* be safe if jpeg_destroy is called twice */
+ cinfo->global_state = 0; /* mark it destroyed */
+}
+
+
+/*
+ * Convenience routines for allocating quantization and Huffman tables.
+ * (Would jutils.c be a more reasonable place to put these?)
+ */
+
+GLOBAL(JQUANT_TBL *)
+jpeg_alloc_quant_table (j_common_ptr cinfo)
+{
+ JQUANT_TBL *tbl;
+
+ tbl = (JQUANT_TBL *)
+ (*cinfo->mem->alloc_small) (cinfo, JPOOL_PERMANENT, SIZEOF(JQUANT_TBL));
+ tbl->sent_table = FALSE; /* make sure this is false in any new table */
+ return tbl;
+}
+
+
+GLOBAL(JHUFF_TBL *)
+jpeg_alloc_huff_table (j_common_ptr cinfo)
+{
+ JHUFF_TBL *tbl;
+
+ tbl = (JHUFF_TBL *)
+ (*cinfo->mem->alloc_small) (cinfo, JPOOL_PERMANENT, SIZEOF(JHUFF_TBL));
+ tbl->sent_table = FALSE; /* make sure this is false in any new table */
+ return tbl;
+}
+
+#endif //_FX_JPEG_TURBO_
diff --git a/core/src/fxcodec/libjpeg/fpdfapi_jcparam.c b/core/src/fxcodec/libjpeg/fpdfapi_jcparam.c
index 8b1b9b9fb6..f3ea109878 100644
--- a/core/src/fxcodec/libjpeg/fpdfapi_jcparam.c
+++ b/core/src/fxcodec/libjpeg/fpdfapi_jcparam.c
@@ -1,613 +1,613 @@
-#if !defined(_FX_JPEG_TURBO_)
-/*
- * jcparam.c
- *
- * Copyright (C) 1991-1998, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- * For conditions of distribution and use, see the accompanying README file.
- *
- * This file contains optional default-setting code for the JPEG compressor.
- * Applications do not have to use this file, but those that don't use it
- * must know a lot more about the innards of the JPEG code.
- */
-
-#define JPEG_INTERNALS
-#include "jinclude.h"
-#include "jpeglib.h"
-
-
-/*
- * Quantization table setup routines
- */
-
-GLOBAL(void)
-jpeg_add_quant_table (j_compress_ptr cinfo, int which_tbl,
- const unsigned int *basic_table,
- int scale_factor, boolean force_baseline)
-/* Define a quantization table equal to the basic_table times
- * a scale factor (given as a percentage).
- * If force_baseline is TRUE, the computed quantization table entries
- * are limited to 1..255 for JPEG baseline compatibility.
- */
-{
- JQUANT_TBL ** qtblptr;
- int i;
- long temp;
-
- /* Safety check to ensure start_compress not called yet. */
- if (cinfo->global_state != CSTATE_START)
- ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
-
- if (which_tbl < 0 || which_tbl >= NUM_QUANT_TBLS)
- ERREXIT1(cinfo, JERR_DQT_INDEX, which_tbl);
-
- qtblptr = & cinfo->quant_tbl_ptrs[which_tbl];
-
- if (*qtblptr == NULL)
- *qtblptr = jpeg_alloc_quant_table((j_common_ptr) cinfo);
-
- for (i = 0; i < DCTSIZE2; i++) {
- temp = ((long) basic_table[i] * scale_factor + 50L) / 100L;
- /* limit the values to the valid range */
- if (temp <= 0L) temp = 1L;
- if (temp > 32767L) temp = 32767L; /* max quantizer needed for 12 bits */
- if (force_baseline && temp > 255L)
- temp = 255L; /* limit to baseline range if requested */
- (*qtblptr)->quantval[i] = (UINT16) temp;
- }
-
- /* Initialize sent_table FALSE so table will be written to JPEG file. */
- (*qtblptr)->sent_table = FALSE;
-}
-
-
-GLOBAL(void)
-jpeg_set_linear_quality (j_compress_ptr cinfo, int scale_factor,
- boolean force_baseline)
-/* Set or change the 'quality' (quantization) setting, using default tables
- * and a straight percentage-scaling quality scale. In most cases it's better
- * to use jpeg_set_quality (below); this entry point is provided for
- * applications that insist on a linear percentage scaling.
- */
-{
- /* These are the sample quantization tables given in JPEG spec section K.1.
- * The spec says that the values given produce "good" quality, and
- * when divided by 2, "very good" quality.
- */
- static const unsigned int std_luminance_quant_tbl[DCTSIZE2] = {
- 16, 11, 10, 16, 24, 40, 51, 61,
- 12, 12, 14, 19, 26, 58, 60, 55,
- 14, 13, 16, 24, 40, 57, 69, 56,
- 14, 17, 22, 29, 51, 87, 80, 62,
- 18, 22, 37, 56, 68, 109, 103, 77,
- 24, 35, 55, 64, 81, 104, 113, 92,
- 49, 64, 78, 87, 103, 121, 120, 101,
- 72, 92, 95, 98, 112, 100, 103, 99
- };
- static const unsigned int std_chrominance_quant_tbl[DCTSIZE2] = {
- 17, 18, 24, 47, 99, 99, 99, 99,
- 18, 21, 26, 66, 99, 99, 99, 99,
- 24, 26, 56, 99, 99, 99, 99, 99,
- 47, 66, 99, 99, 99, 99, 99, 99,
- 99, 99, 99, 99, 99, 99, 99, 99,
- 99, 99, 99, 99, 99, 99, 99, 99,
- 99, 99, 99, 99, 99, 99, 99, 99,
- 99, 99, 99, 99, 99, 99, 99, 99
- };
-
- /* Set up two quantization tables using the specified scaling */
- jpeg_add_quant_table(cinfo, 0, std_luminance_quant_tbl,
- scale_factor, force_baseline);
- jpeg_add_quant_table(cinfo, 1, std_chrominance_quant_tbl,
- scale_factor, force_baseline);
-}
-
-
-GLOBAL(int)
-jpeg_quality_scaling (int quality)
-/* Convert a user-specified quality rating to a percentage scaling factor
- * for an underlying quantization table, using our recommended scaling curve.
- * The input 'quality' factor should be 0 (terrible) to 100 (very good).
- */
-{
- /* Safety limit on quality factor. Convert 0 to 1 to avoid zero divide. */
- if (quality <= 0) quality = 1;
- if (quality > 100) quality = 100;
-
- /* The basic table is used as-is (scaling 100) for a quality of 50.
- * Qualities 50..100 are converted to scaling percentage 200 - 2*Q;
- * note that at Q=100 the scaling is 0, which will cause jpeg_add_quant_table
- * to make all the table entries 1 (hence, minimum quantization loss).
- * Qualities 1..50 are converted to scaling percentage 5000/Q.
- */
- if (quality < 50)
- quality = 5000 / quality;
- else
- quality = 200 - quality*2;
-
- return quality;
-}
-
-
-GLOBAL(void)
-jpeg_set_quality (j_compress_ptr cinfo, int quality, boolean force_baseline)
-/* Set or change the 'quality' (quantization) setting, using default tables.
- * This is the standard quality-adjusting entry point for typical user
- * interfaces; only those who want detailed control over quantization tables
- * would use the preceding three routines directly.
- */
-{
- /* Convert user 0-100 rating to percentage scaling */
- quality = jpeg_quality_scaling(quality);
-
- /* Set up standard quality tables */
- jpeg_set_linear_quality(cinfo, quality, force_baseline);
-}
-
-
-/*
- * Huffman table setup routines
- */
-
-LOCAL(void)
-add_huff_table (j_compress_ptr cinfo,
- JHUFF_TBL **htblptr, const UINT8 *bits, const UINT8 *val)
-/* Define a Huffman table */
-{
- int nsymbols, len;
-
- if (*htblptr == NULL)
- *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);
-
- /* Copy the number-of-symbols-of-each-code-length counts */
- MEMCOPY((*htblptr)->bits, bits, SIZEOF((*htblptr)->bits));
-
- /* Validate the counts. We do this here mainly so we can copy the right
- * number of symbols from the val[] array, without risking marching off
- * the end of memory. jchuff.c will do a more thorough test later.
- */
- nsymbols = 0;
- for (len = 1; len <= 16; len++)
- nsymbols += bits[len];
- if (nsymbols < 1 || nsymbols > 256)
- ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
-
- MEMCOPY((*htblptr)->huffval, val, nsymbols * SIZEOF(UINT8));
-
- /* Initialize sent_table FALSE so table will be written to JPEG file. */
- (*htblptr)->sent_table = FALSE;
-}
-
-
-LOCAL(void)
-std_huff_tables (j_compress_ptr cinfo)
-/* Set up the standard Huffman tables (cf. JPEG standard section K.3) */
-/* IMPORTANT: these are only valid for 8-bit data precision! */
-{
- static const UINT8 bits_dc_luminance[17] =
- { /* 0-base */ 0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 };
- static const UINT8 val_dc_luminance[] =
- { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
-
- static const UINT8 bits_dc_chrominance[17] =
- { /* 0-base */ 0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 };
- static const UINT8 val_dc_chrominance[] =
- { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
-
- static const UINT8 bits_ac_luminance[17] =
- { /* 0-base */ 0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 0x7d };
- static const UINT8 val_ac_luminance[] =
- { 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12,
- 0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07,
- 0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xa1, 0x08,
- 0x23, 0x42, 0xb1, 0xc1, 0x15, 0x52, 0xd1, 0xf0,
- 0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0a, 0x16,
- 0x17, 0x18, 0x19, 0x1a, 0x25, 0x26, 0x27, 0x28,
- 0x29, 0x2a, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,
- 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49,
- 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59,
- 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69,
- 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79,
- 0x7a, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89,
- 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98,
- 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
- 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6,
- 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5,
- 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4,
- 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe1, 0xe2,
- 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea,
- 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
- 0xf9, 0xfa };
-
- static const UINT8 bits_ac_chrominance[17] =
- { /* 0-base */ 0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 0x77 };
- static const UINT8 val_ac_chrominance[] =
- { 0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21,
- 0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71,
- 0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91,
- 0xa1, 0xb1, 0xc1, 0x09, 0x23, 0x33, 0x52, 0xf0,
- 0x15, 0x62, 0x72, 0xd1, 0x0a, 0x16, 0x24, 0x34,
- 0xe1, 0x25, 0xf1, 0x17, 0x18, 0x19, 0x1a, 0x26,
- 0x27, 0x28, 0x29, 0x2a, 0x35, 0x36, 0x37, 0x38,
- 0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48,
- 0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,
- 0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68,
- 0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78,
- 0x79, 0x7a, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
- 0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96,
- 0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5,
- 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4,
- 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3,
- 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2,
- 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda,
- 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9,
- 0xea, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
- 0xf9, 0xfa };
-
- add_huff_table(cinfo, &cinfo->dc_huff_tbl_ptrs[0],
- bits_dc_luminance, val_dc_luminance);
- add_huff_table(cinfo, &cinfo->ac_huff_tbl_ptrs[0],
- bits_ac_luminance, val_ac_luminance);
- add_huff_table(cinfo, &cinfo->dc_huff_tbl_ptrs[1],
- bits_dc_chrominance, val_dc_chrominance);
- add_huff_table(cinfo, &cinfo->ac_huff_tbl_ptrs[1],
- bits_ac_chrominance, val_ac_chrominance);
-}
-
-
-/*
- * Default parameter setup for compression.
- *
- * Applications that don't choose to use this routine must do their
- * own setup of all these parameters. Alternately, you can call this
- * to establish defaults and then alter parameters selectively. This
- * is the recommended approach since, if we add any new parameters,
- * your code will still work (they'll be set to reasonable defaults).
- */
-
-GLOBAL(void)
-jpeg_set_defaults (j_compress_ptr cinfo)
-{
- int i;
-
- /* Safety check to ensure start_compress not called yet. */
- if (cinfo->global_state != CSTATE_START)
- ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
-
- /* Allocate comp_info array large enough for maximum component count.
- * Array is made permanent in case application wants to compress
- * multiple images at same param settings.
- */
- if (cinfo->comp_info == NULL)
- cinfo->comp_info = (jpeg_component_info *)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
- MAX_COMPONENTS * SIZEOF(jpeg_component_info));
-
- /* Initialize everything not dependent on the color space */
-
- cinfo->data_precision = BITS_IN_JSAMPLE;
- /* Set up two quantization tables using default quality of 75 */
- jpeg_set_quality(cinfo, 75, TRUE);
- /* Set up two Huffman tables */
- std_huff_tables(cinfo);
-
- /* Initialize default arithmetic coding conditioning */
- for (i = 0; i < NUM_ARITH_TBLS; i++) {
- cinfo->arith_dc_L[i] = 0;
- cinfo->arith_dc_U[i] = 1;
- cinfo->arith_ac_K[i] = 5;
- }
-
- /* Default is no multiple-scan output */
- cinfo->scan_info = NULL;
- cinfo->num_scans = 0;
-
- /* Expect normal source image, not raw downsampled data */
- cinfo->raw_data_in = FALSE;
-
- /* Use Huffman coding, not arithmetic coding, by default */
- cinfo->arith_code = FALSE;
-
- /* By default, don't do extra passes to optimize entropy coding */
- cinfo->optimize_coding = FALSE;
- /* The standard Huffman tables are only valid for 8-bit data precision.
- * If the precision is higher, force optimization on so that usable
- * tables will be computed. This test can be removed if default tables
- * are supplied that are valid for the desired precision.
- */
- if (cinfo->data_precision > 8)
- cinfo->optimize_coding = TRUE;
-
- /* By default, use the simpler non-cosited sampling alignment */
- cinfo->CCIR601_sampling = FALSE;
-
- /* No input smoothing */
- cinfo->smoothing_factor = 0;
-
- /* DCT algorithm preference */
- cinfo->dct_method = JDCT_DEFAULT;
-
- /* No restart markers */
- cinfo->restart_interval = 0;
- cinfo->restart_in_rows = 0;
-
- /* Fill in default JFIF marker parameters. Note that whether the marker
- * will actually be written is determined by jpeg_set_colorspace.
- *
- * By default, the library emits JFIF version code 1.01.
- * An application that wants to emit JFIF 1.02 extension markers should set
- * JFIF_minor_version to 2. We could probably get away with just defaulting
- * to 1.02, but there may still be some decoders in use that will complain
- * about that; saying 1.01 should minimize compatibility problems.
- */
- cinfo->JFIF_major_version = 1; /* Default JFIF version = 1.01 */
- cinfo->JFIF_minor_version = 1;
- cinfo->density_unit = 0; /* Pixel size is unknown by default */
- cinfo->X_density = 1; /* Pixel aspect ratio is square by default */
- cinfo->Y_density = 1;
-
- /* Choose JPEG colorspace based on input space, set defaults accordingly */
-
- jpeg_default_colorspace(cinfo);
-}
-
-
-/*
- * Select an appropriate JPEG colorspace for in_color_space.
- */
-
-GLOBAL(void)
-jpeg_default_colorspace (j_compress_ptr cinfo)
-{
- switch (cinfo->in_color_space) {
- case JCS_GRAYSCALE:
- jpeg_set_colorspace(cinfo, JCS_GRAYSCALE);
- break;
- case JCS_RGB:
- jpeg_set_colorspace(cinfo, JCS_YCbCr);
- break;
- case JCS_YCbCr:
- jpeg_set_colorspace(cinfo, JCS_YCbCr);
- break;
- case JCS_CMYK:
- jpeg_set_colorspace(cinfo, JCS_CMYK); /* By default, no translation */
- break;
- case JCS_YCCK:
- jpeg_set_colorspace(cinfo, JCS_YCCK);
- break;
- case JCS_UNKNOWN:
- jpeg_set_colorspace(cinfo, JCS_UNKNOWN);
- break;
- default:
- ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
- }
-}
-
-
-/*
- * Set the JPEG colorspace, and choose colorspace-dependent default values.
- */
-
-GLOBAL(void)
-jpeg_set_colorspace (j_compress_ptr cinfo, J_COLOR_SPACE colorspace)
-{
- jpeg_component_info * compptr;
- int ci;
-
-#define SET_COMP(index,id,hsamp,vsamp,quant,dctbl,actbl) \
- (compptr = &cinfo->comp_info[index], \
- compptr->component_id = (id), \
- compptr->h_samp_factor = (hsamp), \
- compptr->v_samp_factor = (vsamp), \
- compptr->quant_tbl_no = (quant), \
- compptr->dc_tbl_no = (dctbl), \
- compptr->ac_tbl_no = (actbl) )
-
- /* Safety check to ensure start_compress not called yet. */
- if (cinfo->global_state != CSTATE_START)
- ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
-
- /* For all colorspaces, we use Q and Huff tables 0 for luminance components,
- * tables 1 for chrominance components.
- */
-
- cinfo->jpeg_color_space = colorspace;
-
- cinfo->write_JFIF_header = FALSE; /* No marker for non-JFIF colorspaces */
- cinfo->write_Adobe_marker = FALSE; /* write no Adobe marker by default */
-
- switch (colorspace) {
- case JCS_GRAYSCALE:
- cinfo->write_JFIF_header = TRUE; /* Write a JFIF marker */
- cinfo->num_components = 1;
- /* JFIF specifies component ID 1 */
- SET_COMP(0, 1, 1,1, 0, 0,0);
- break;
- case JCS_RGB:
- cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag RGB */
- cinfo->num_components = 3;
- SET_COMP(0, 0x52 /* 'R' */, 1,1, 0, 0,0);
- SET_COMP(1, 0x47 /* 'G' */, 1,1, 0, 0,0);
- SET_COMP(2, 0x42 /* 'B' */, 1,1, 0, 0,0);
- break;
- case JCS_YCbCr:
- cinfo->write_JFIF_header = TRUE; /* Write a JFIF marker */
- cinfo->num_components = 3;
- /* JFIF specifies component IDs 1,2,3 */
- /* We default to 2x2 subsamples of chrominance */
- SET_COMP(0, 1, 2,2, 0, 0,0);
- SET_COMP(1, 2, 1,1, 1, 1,1);
- SET_COMP(2, 3, 1,1, 1, 1,1);
- break;
- case JCS_CMYK:
- cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag CMYK */
- cinfo->num_components = 4;
- SET_COMP(0, 0x43 /* 'C' */, 1,1, 0, 0,0);
- SET_COMP(1, 0x4D /* 'M' */, 1,1, 0, 0,0);
- SET_COMP(2, 0x59 /* 'Y' */, 1,1, 0, 0,0);
- SET_COMP(3, 0x4B /* 'K' */, 1,1, 0, 0,0);
- break;
- case JCS_YCCK:
- cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag YCCK */
- cinfo->num_components = 4;
- SET_COMP(0, 1, 2,2, 0, 0,0);
- SET_COMP(1, 2, 1,1, 1, 1,1);
- SET_COMP(2, 3, 1,1, 1, 1,1);
- SET_COMP(3, 4, 2,2, 0, 0,0);
- break;
- case JCS_UNKNOWN:
- cinfo->num_components = cinfo->input_components;
- if (cinfo->num_components < 1 || cinfo->num_components > MAX_COMPONENTS)
- ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components,
- MAX_COMPONENTS);
- for (ci = 0; ci < cinfo->num_components; ci++) {
- SET_COMP(ci, ci, 1,1, 0, 0,0);
- }
- break;
- default:
- ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
- }
-}
-
-
-#ifdef C_PROGRESSIVE_SUPPORTED
-
-LOCAL(jpeg_scan_info *)
-fill_a_scan (jpeg_scan_info * scanptr, int ci,
- int Ss, int Se, int Ah, int Al)
-/* Support routine: generate one scan for specified component */
-{
- scanptr->comps_in_scan = 1;
- scanptr->component_index[0] = ci;
- scanptr->Ss = Ss;
- scanptr->Se = Se;
- scanptr->Ah = Ah;
- scanptr->Al = Al;
- scanptr++;
- return scanptr;
-}
-
-LOCAL(jpeg_scan_info *)
-fill_scans (jpeg_scan_info * scanptr, int ncomps,
- int Ss, int Se, int Ah, int Al)
-/* Support routine: generate one scan for each component */
-{
- int ci;
-
- for (ci = 0; ci < ncomps; ci++) {
- scanptr->comps_in_scan = 1;
- scanptr->component_index[0] = ci;
- scanptr->Ss = Ss;
- scanptr->Se = Se;
- scanptr->Ah = Ah;
- scanptr->Al = Al;
- scanptr++;
- }
- return scanptr;
-}
-
-LOCAL(jpeg_scan_info *)
-fill_dc_scans (jpeg_scan_info * scanptr, int ncomps, int Ah, int Al)
-/* Support routine: generate interleaved DC scan if possible, else N scans */
-{
- int ci;
-
- if (ncomps <= MAX_COMPS_IN_SCAN) {
- /* Single interleaved DC scan */
- scanptr->comps_in_scan = ncomps;
- for (ci = 0; ci < ncomps; ci++)
- scanptr->component_index[ci] = ci;
- scanptr->Ss = scanptr->Se = 0;
- scanptr->Ah = Ah;
- scanptr->Al = Al;
- scanptr++;
- } else {
- /* Noninterleaved DC scan for each component */
- scanptr = fill_scans(scanptr, ncomps, 0, 0, Ah, Al);
- }
- return scanptr;
-}
-
-
-/*
- * Create a recommended progressive-JPEG script.
- * cinfo->num_components and cinfo->jpeg_color_space must be correct.
- */
-
-GLOBAL(void)
-jpeg_simple_progression (j_compress_ptr cinfo)
-{
- int ncomps = cinfo->num_components;
- int nscans;
- jpeg_scan_info * scanptr;
-
- /* Safety check to ensure start_compress not called yet. */
- if (cinfo->global_state != CSTATE_START)
- ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
-
- /* Figure space needed for script. Calculation must match code below! */
- if (ncomps == 3 && cinfo->jpeg_color_space == JCS_YCbCr) {
- /* Custom script for YCbCr color images. */
- nscans = 10;
- } else {
- /* All-purpose script for other color spaces. */
- if (ncomps > MAX_COMPS_IN_SCAN)
- nscans = 6 * ncomps; /* 2 DC + 4 AC scans per component */
- else
- nscans = 2 + 4 * ncomps; /* 2 DC scans; 4 AC scans per component */
- }
-
- /* Allocate space for script.
- * We need to put it in the permanent pool in case the application performs
- * multiple compressions without changing the settings. To avoid a memory
- * leak if jpeg_simple_progression is called repeatedly for the same JPEG
- * object, we try to re-use previously allocated space, and we allocate
- * enough space to handle YCbCr even if initially asked for grayscale.
- */
- if (cinfo->script_space == NULL || cinfo->script_space_size < nscans) {
- cinfo->script_space_size = MAX(nscans, 10);
- cinfo->script_space = (jpeg_scan_info *)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
- cinfo->script_space_size * SIZEOF(jpeg_scan_info));
- }
- scanptr = cinfo->script_space;
- cinfo->scan_info = scanptr;
- cinfo->num_scans = nscans;
-
- if (ncomps == 3 && cinfo->jpeg_color_space == JCS_YCbCr) {
- /* Custom script for YCbCr color images. */
- /* Initial DC scan */
- scanptr = fill_dc_scans(scanptr, ncomps, 0, 1);
- /* Initial AC scan: get some luma data out in a hurry */
- scanptr = fill_a_scan(scanptr, 0, 1, 5, 0, 2);
- /* Chroma data is too small to be worth expending many scans on */
- scanptr = fill_a_scan(scanptr, 2, 1, 63, 0, 1);
- scanptr = fill_a_scan(scanptr, 1, 1, 63, 0, 1);
- /* Complete spectral selection for luma AC */
- scanptr = fill_a_scan(scanptr, 0, 6, 63, 0, 2);
- /* Refine next bit of luma AC */
- scanptr = fill_a_scan(scanptr, 0, 1, 63, 2, 1);
- /* Finish DC successive approximation */
- scanptr = fill_dc_scans(scanptr, ncomps, 1, 0);
- /* Finish AC successive approximation */
- scanptr = fill_a_scan(scanptr, 2, 1, 63, 1, 0);
- scanptr = fill_a_scan(scanptr, 1, 1, 63, 1, 0);
- /* Luma bottom bit comes last since it's usually largest scan */
- scanptr = fill_a_scan(scanptr, 0, 1, 63, 1, 0);
- } else {
- /* All-purpose script for other color spaces. */
- /* Successive approximation first pass */
- scanptr = fill_dc_scans(scanptr, ncomps, 0, 1);
- scanptr = fill_scans(scanptr, ncomps, 1, 5, 0, 2);
- scanptr = fill_scans(scanptr, ncomps, 6, 63, 0, 2);
- /* Successive approximation second pass */
- scanptr = fill_scans(scanptr, ncomps, 1, 63, 2, 1);
- /* Successive approximation final pass */
- scanptr = fill_dc_scans(scanptr, ncomps, 1, 0);
- scanptr = fill_scans(scanptr, ncomps, 1, 63, 1, 0);
- }
-}
-
-#endif /* C_PROGRESSIVE_SUPPORTED */
-
-#endif //_FX_JPEG_TURBO_
+#if !defined(_FX_JPEG_TURBO_)
+/*
+ * jcparam.c
+ *
+ * Copyright (C) 1991-1998, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains optional default-setting code for the JPEG compressor.
+ * Applications do not have to use this file, but those that don't use it
+ * must know a lot more about the innards of the JPEG code.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+
+
+/*
+ * Quantization table setup routines
+ */
+
+GLOBAL(void)
+jpeg_add_quant_table (j_compress_ptr cinfo, int which_tbl,
+ const unsigned int *basic_table,
+ int scale_factor, boolean force_baseline)
+/* Define a quantization table equal to the basic_table times
+ * a scale factor (given as a percentage).
+ * If force_baseline is TRUE, the computed quantization table entries
+ * are limited to 1..255 for JPEG baseline compatibility.
+ */
+{
+ JQUANT_TBL ** qtblptr;
+ int i;
+ long temp;
+
+ /* Safety check to ensure start_compress not called yet. */
+ if (cinfo->global_state != CSTATE_START)
+ ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
+
+ if (which_tbl < 0 || which_tbl >= NUM_QUANT_TBLS)
+ ERREXIT1(cinfo, JERR_DQT_INDEX, which_tbl);
+
+ qtblptr = & cinfo->quant_tbl_ptrs[which_tbl];
+
+ if (*qtblptr == NULL)
+ *qtblptr = jpeg_alloc_quant_table((j_common_ptr) cinfo);
+
+ for (i = 0; i < DCTSIZE2; i++) {
+ temp = ((long) basic_table[i] * scale_factor + 50L) / 100L;
+ /* limit the values to the valid range */
+ if (temp <= 0L) temp = 1L;
+ if (temp > 32767L) temp = 32767L; /* max quantizer needed for 12 bits */
+ if (force_baseline && temp > 255L)
+ temp = 255L; /* limit to baseline range if requested */
+ (*qtblptr)->quantval[i] = (UINT16) temp;
+ }
+
+ /* Initialize sent_table FALSE so table will be written to JPEG file. */
+ (*qtblptr)->sent_table = FALSE;
+}
+
+
+GLOBAL(void)
+jpeg_set_linear_quality (j_compress_ptr cinfo, int scale_factor,
+ boolean force_baseline)
+/* Set or change the 'quality' (quantization) setting, using default tables
+ * and a straight percentage-scaling quality scale. In most cases it's better
+ * to use jpeg_set_quality (below); this entry point is provided for
+ * applications that insist on a linear percentage scaling.
+ */
+{
+ /* These are the sample quantization tables given in JPEG spec section K.1.
+ * The spec says that the values given produce "good" quality, and
+ * when divided by 2, "very good" quality.
+ */
+ static const unsigned int std_luminance_quant_tbl[DCTSIZE2] = {
+ 16, 11, 10, 16, 24, 40, 51, 61,
+ 12, 12, 14, 19, 26, 58, 60, 55,
+ 14, 13, 16, 24, 40, 57, 69, 56,
+ 14, 17, 22, 29, 51, 87, 80, 62,
+ 18, 22, 37, 56, 68, 109, 103, 77,
+ 24, 35, 55, 64, 81, 104, 113, 92,
+ 49, 64, 78, 87, 103, 121, 120, 101,
+ 72, 92, 95, 98, 112, 100, 103, 99
+ };
+ static const unsigned int std_chrominance_quant_tbl[DCTSIZE2] = {
+ 17, 18, 24, 47, 99, 99, 99, 99,
+ 18, 21, 26, 66, 99, 99, 99, 99,
+ 24, 26, 56, 99, 99, 99, 99, 99,
+ 47, 66, 99, 99, 99, 99, 99, 99,
+ 99, 99, 99, 99, 99, 99, 99, 99,
+ 99, 99, 99, 99, 99, 99, 99, 99,
+ 99, 99, 99, 99, 99, 99, 99, 99,
+ 99, 99, 99, 99, 99, 99, 99, 99
+ };
+
+ /* Set up two quantization tables using the specified scaling */
+ jpeg_add_quant_table(cinfo, 0, std_luminance_quant_tbl,
+ scale_factor, force_baseline);
+ jpeg_add_quant_table(cinfo, 1, std_chrominance_quant_tbl,
+ scale_factor, force_baseline);
+}
+
+
+GLOBAL(int)
+jpeg_quality_scaling (int quality)
+/* Convert a user-specified quality rating to a percentage scaling factor
+ * for an underlying quantization table, using our recommended scaling curve.
+ * The input 'quality' factor should be 0 (terrible) to 100 (very good).
+ */
+{
+ /* Safety limit on quality factor. Convert 0 to 1 to avoid zero divide. */
+ if (quality <= 0) quality = 1;
+ if (quality > 100) quality = 100;
+
+ /* The basic table is used as-is (scaling 100) for a quality of 50.
+ * Qualities 50..100 are converted to scaling percentage 200 - 2*Q;
+ * note that at Q=100 the scaling is 0, which will cause jpeg_add_quant_table
+ * to make all the table entries 1 (hence, minimum quantization loss).
+ * Qualities 1..50 are converted to scaling percentage 5000/Q.
+ */
+ if (quality < 50)
+ quality = 5000 / quality;
+ else
+ quality = 200 - quality*2;
+
+ return quality;
+}
+
+
+GLOBAL(void)
+jpeg_set_quality (j_compress_ptr cinfo, int quality, boolean force_baseline)
+/* Set or change the 'quality' (quantization) setting, using default tables.
+ * This is the standard quality-adjusting entry point for typical user
+ * interfaces; only those who want detailed control over quantization tables
+ * would use the preceding three routines directly.
+ */
+{
+ /* Convert user 0-100 rating to percentage scaling */
+ quality = jpeg_quality_scaling(quality);
+
+ /* Set up standard quality tables */
+ jpeg_set_linear_quality(cinfo, quality, force_baseline);
+}
+
+
+/*
+ * Huffman table setup routines
+ */
+
+LOCAL(void)
+add_huff_table (j_compress_ptr cinfo,
+ JHUFF_TBL **htblptr, const UINT8 *bits, const UINT8 *val)
+/* Define a Huffman table */
+{
+ int nsymbols, len;
+
+ if (*htblptr == NULL)
+ *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);
+
+ /* Copy the number-of-symbols-of-each-code-length counts */
+ MEMCOPY((*htblptr)->bits, bits, SIZEOF((*htblptr)->bits));
+
+ /* Validate the counts. We do this here mainly so we can copy the right
+ * number of symbols from the val[] array, without risking marching off
+ * the end of memory. jchuff.c will do a more thorough test later.
+ */
+ nsymbols = 0;
+ for (len = 1; len <= 16; len++)
+ nsymbols += bits[len];
+ if (nsymbols < 1 || nsymbols > 256)
+ ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
+
+ MEMCOPY((*htblptr)->huffval, val, nsymbols * SIZEOF(UINT8));
+
+ /* Initialize sent_table FALSE so table will be written to JPEG file. */
+ (*htblptr)->sent_table = FALSE;
+}
+
+
+LOCAL(void)
+std_huff_tables (j_compress_ptr cinfo)
+/* Set up the standard Huffman tables (cf. JPEG standard section K.3) */
+/* IMPORTANT: these are only valid for 8-bit data precision! */
+{
+ static const UINT8 bits_dc_luminance[17] =
+ { /* 0-base */ 0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 };
+ static const UINT8 val_dc_luminance[] =
+ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
+
+ static const UINT8 bits_dc_chrominance[17] =
+ { /* 0-base */ 0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 };
+ static const UINT8 val_dc_chrominance[] =
+ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
+
+ static const UINT8 bits_ac_luminance[17] =
+ { /* 0-base */ 0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 0x7d };
+ static const UINT8 val_ac_luminance[] =
+ { 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12,
+ 0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07,
+ 0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xa1, 0x08,
+ 0x23, 0x42, 0xb1, 0xc1, 0x15, 0x52, 0xd1, 0xf0,
+ 0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0a, 0x16,
+ 0x17, 0x18, 0x19, 0x1a, 0x25, 0x26, 0x27, 0x28,
+ 0x29, 0x2a, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,
+ 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49,
+ 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59,
+ 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69,
+ 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79,
+ 0x7a, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89,
+ 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98,
+ 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
+ 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6,
+ 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5,
+ 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4,
+ 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe1, 0xe2,
+ 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea,
+ 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
+ 0xf9, 0xfa };
+
+ static const UINT8 bits_ac_chrominance[17] =
+ { /* 0-base */ 0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 0x77 };
+ static const UINT8 val_ac_chrominance[] =
+ { 0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21,
+ 0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71,
+ 0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91,
+ 0xa1, 0xb1, 0xc1, 0x09, 0x23, 0x33, 0x52, 0xf0,
+ 0x15, 0x62, 0x72, 0xd1, 0x0a, 0x16, 0x24, 0x34,
+ 0xe1, 0x25, 0xf1, 0x17, 0x18, 0x19, 0x1a, 0x26,
+ 0x27, 0x28, 0x29, 0x2a, 0x35, 0x36, 0x37, 0x38,
+ 0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48,
+ 0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,
+ 0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68,
+ 0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78,
+ 0x79, 0x7a, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
+ 0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96,
+ 0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5,
+ 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4,
+ 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3,
+ 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2,
+ 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda,
+ 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9,
+ 0xea, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
+ 0xf9, 0xfa };
+
+ add_huff_table(cinfo, &cinfo->dc_huff_tbl_ptrs[0],
+ bits_dc_luminance, val_dc_luminance);
+ add_huff_table(cinfo, &cinfo->ac_huff_tbl_ptrs[0],
+ bits_ac_luminance, val_ac_luminance);
+ add_huff_table(cinfo, &cinfo->dc_huff_tbl_ptrs[1],
+ bits_dc_chrominance, val_dc_chrominance);
+ add_huff_table(cinfo, &cinfo->ac_huff_tbl_ptrs[1],
+ bits_ac_chrominance, val_ac_chrominance);
+}
+
+
+/*
+ * Default parameter setup for compression.
+ *
+ * Applications that don't choose to use this routine must do their
+ * own setup of all these parameters. Alternately, you can call this
+ * to establish defaults and then alter parameters selectively. This
+ * is the recommended approach since, if we add any new parameters,
+ * your code will still work (they'll be set to reasonable defaults).
+ */
+
+GLOBAL(void)
+jpeg_set_defaults (j_compress_ptr cinfo)
+{
+ int i;
+
+ /* Safety check to ensure start_compress not called yet. */
+ if (cinfo->global_state != CSTATE_START)
+ ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
+
+ /* Allocate comp_info array large enough for maximum component count.
+ * Array is made permanent in case application wants to compress
+ * multiple images at same param settings.
+ */
+ if (cinfo->comp_info == NULL)
+ cinfo->comp_info = (jpeg_component_info *)
+ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
+ MAX_COMPONENTS * SIZEOF(jpeg_component_info));
+
+ /* Initialize everything not dependent on the color space */
+
+ cinfo->data_precision = BITS_IN_JSAMPLE;
+ /* Set up two quantization tables using default quality of 75 */
+ jpeg_set_quality(cinfo, 75, TRUE);
+ /* Set up two Huffman tables */
+ std_huff_tables(cinfo);
+
+ /* Initialize default arithmetic coding conditioning */
+ for (i = 0; i < NUM_ARITH_TBLS; i++) {
+ cinfo->arith_dc_L[i] = 0;
+ cinfo->arith_dc_U[i] = 1;
+ cinfo->arith_ac_K[i] = 5;
+ }
+
+ /* Default is no multiple-scan output */
+ cinfo->scan_info = NULL;
+ cinfo->num_scans = 0;
+
+ /* Expect normal source image, not raw downsampled data */
+ cinfo->raw_data_in = FALSE;
+
+ /* Use Huffman coding, not arithmetic coding, by default */
+ cinfo->arith_code = FALSE;
+
+ /* By default, don't do extra passes to optimize entropy coding */
+ cinfo->optimize_coding = FALSE;
+ /* The standard Huffman tables are only valid for 8-bit data precision.
+ * If the precision is higher, force optimization on so that usable
+ * tables will be computed. This test can be removed if default tables
+ * are supplied that are valid for the desired precision.
+ */
+ if (cinfo->data_precision > 8)
+ cinfo->optimize_coding = TRUE;
+
+ /* By default, use the simpler non-cosited sampling alignment */
+ cinfo->CCIR601_sampling = FALSE;
+
+ /* No input smoothing */
+ cinfo->smoothing_factor = 0;
+
+ /* DCT algorithm preference */
+ cinfo->dct_method = JDCT_DEFAULT;
+
+ /* No restart markers */
+ cinfo->restart_interval = 0;
+ cinfo->restart_in_rows = 0;
+
+ /* Fill in default JFIF marker parameters. Note that whether the marker
+ * will actually be written is determined by jpeg_set_colorspace.
+ *
+ * By default, the library emits JFIF version code 1.01.
+ * An application that wants to emit JFIF 1.02 extension markers should set
+ * JFIF_minor_version to 2. We could probably get away with just defaulting
+ * to 1.02, but there may still be some decoders in use that will complain
+ * about that; saying 1.01 should minimize compatibility problems.
+ */
+ cinfo->JFIF_major_version = 1; /* Default JFIF version = 1.01 */
+ cinfo->JFIF_minor_version = 1;
+ cinfo->density_unit = 0; /* Pixel size is unknown by default */
+ cinfo->X_density = 1; /* Pixel aspect ratio is square by default */
+ cinfo->Y_density = 1;
+
+ /* Choose JPEG colorspace based on input space, set defaults accordingly */
+
+ jpeg_default_colorspace(cinfo);
+}
+
+
+/*
+ * Select an appropriate JPEG colorspace for in_color_space.
+ */
+
+GLOBAL(void)
+jpeg_default_colorspace (j_compress_ptr cinfo)
+{
+ switch (cinfo->in_color_space) {
+ case JCS_GRAYSCALE:
+ jpeg_set_colorspace(cinfo, JCS_GRAYSCALE);
+ break;
+ case JCS_RGB:
+ jpeg_set_colorspace(cinfo, JCS_YCbCr);
+ break;
+ case JCS_YCbCr:
+ jpeg_set_colorspace(cinfo, JCS_YCbCr);
+ break;
+ case JCS_CMYK:
+ jpeg_set_colorspace(cinfo, JCS_CMYK); /* By default, no translation */
+ break;
+ case JCS_YCCK:
+ jpeg_set_colorspace(cinfo, JCS_YCCK);
+ break;
+ case JCS_UNKNOWN:
+ jpeg_set_colorspace(cinfo, JCS_UNKNOWN);
+ break;
+ default:
+ ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
+ }
+}
+
+
+/*
+ * Set the JPEG colorspace, and choose colorspace-dependent default values.
+ */
+
+GLOBAL(void)
+jpeg_set_colorspace (j_compress_ptr cinfo, J_COLOR_SPACE colorspace)
+{
+ jpeg_component_info * compptr;
+ int ci;
+
+#define SET_COMP(index,id,hsamp,vsamp,quant,dctbl,actbl) \
+ (compptr = &cinfo->comp_info[index], \
+ compptr->component_id = (id), \
+ compptr->h_samp_factor = (hsamp), \
+ compptr->v_samp_factor = (vsamp), \
+ compptr->quant_tbl_no = (quant), \
+ compptr->dc_tbl_no = (dctbl), \
+ compptr->ac_tbl_no = (actbl) )
+
+ /* Safety check to ensure start_compress not called yet. */
+ if (cinfo->global_state != CSTATE_START)
+ ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
+
+ /* For all colorspaces, we use Q and Huff tables 0 for luminance components,
+ * tables 1 for chrominance components.
+ */
+
+ cinfo->jpeg_color_space = colorspace;
+
+ cinfo->write_JFIF_header = FALSE; /* No marker for non-JFIF colorspaces */
+ cinfo->write_Adobe_marker = FALSE; /* write no Adobe marker by default */
+
+ switch (colorspace) {
+ case JCS_GRAYSCALE:
+ cinfo->write_JFIF_header = TRUE; /* Write a JFIF marker */
+ cinfo->num_components = 1;
+ /* JFIF specifies component ID 1 */
+ SET_COMP(0, 1, 1,1, 0, 0,0);
+ break;
+ case JCS_RGB:
+ cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag RGB */
+ cinfo->num_components = 3;
+ SET_COMP(0, 0x52 /* 'R' */, 1,1, 0, 0,0);
+ SET_COMP(1, 0x47 /* 'G' */, 1,1, 0, 0,0);
+ SET_COMP(2, 0x42 /* 'B' */, 1,1, 0, 0,0);
+ break;
+ case JCS_YCbCr:
+ cinfo->write_JFIF_header = TRUE; /* Write a JFIF marker */
+ cinfo->num_components = 3;
+ /* JFIF specifies component IDs 1,2,3 */
+ /* We default to 2x2 subsamples of chrominance */
+ SET_COMP(0, 1, 2,2, 0, 0,0);
+ SET_COMP(1, 2, 1,1, 1, 1,1);
+ SET_COMP(2, 3, 1,1, 1, 1,1);
+ break;
+ case JCS_CMYK:
+ cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag CMYK */
+ cinfo->num_components = 4;
+ SET_COMP(0, 0x43 /* 'C' */, 1,1, 0, 0,0);
+ SET_COMP(1, 0x4D /* 'M' */, 1,1, 0, 0,0);
+ SET_COMP(2, 0x59 /* 'Y' */, 1,1, 0, 0,0);
+ SET_COMP(3, 0x4B /* 'K' */, 1,1, 0, 0,0);
+ break;
+ case JCS_YCCK:
+ cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag YCCK */
+ cinfo->num_components = 4;
+ SET_COMP(0, 1, 2,2, 0, 0,0);
+ SET_COMP(1, 2, 1,1, 1, 1,1);
+ SET_COMP(2, 3, 1,1, 1, 1,1);
+ SET_COMP(3, 4, 2,2, 0, 0,0);
+ break;
+ case JCS_UNKNOWN:
+ cinfo->num_components = cinfo->input_components;
+ if (cinfo->num_components < 1 || cinfo->num_components > MAX_COMPONENTS)
+ ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components,
+ MAX_COMPONENTS);
+ for (ci = 0; ci < cinfo->num_components; ci++) {
+ SET_COMP(ci, ci, 1,1, 0, 0,0);
+ }
+ break;
+ default:
+ ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
+ }
+}
+
+
+#ifdef C_PROGRESSIVE_SUPPORTED
+
+LOCAL(jpeg_scan_info *)
+fill_a_scan (jpeg_scan_info * scanptr, int ci,
+ int Ss, int Se, int Ah, int Al)
+/* Support routine: generate one scan for specified component */
+{
+ scanptr->comps_in_scan = 1;
+ scanptr->component_index[0] = ci;
+ scanptr->Ss = Ss;
+ scanptr->Se = Se;
+ scanptr->Ah = Ah;
+ scanptr->Al = Al;
+ scanptr++;
+ return scanptr;
+}
+
+LOCAL(jpeg_scan_info *)
+fill_scans (jpeg_scan_info * scanptr, int ncomps,
+ int Ss, int Se, int Ah, int Al)
+/* Support routine: generate one scan for each component */
+{
+ int ci;
+
+ for (ci = 0; ci < ncomps; ci++) {
+ scanptr->comps_in_scan = 1;
+ scanptr->component_index[0] = ci;
+ scanptr->Ss = Ss;
+ scanptr->Se = Se;
+ scanptr->Ah = Ah;
+ scanptr->Al = Al;
+ scanptr++;
+ }
+ return scanptr;
+}
+
+LOCAL(jpeg_scan_info *)
+fill_dc_scans (jpeg_scan_info * scanptr, int ncomps, int Ah, int Al)
+/* Support routine: generate interleaved DC scan if possible, else N scans */
+{
+ int ci;
+
+ if (ncomps <= MAX_COMPS_IN_SCAN) {
+ /* Single interleaved DC scan */
+ scanptr->comps_in_scan = ncomps;
+ for (ci = 0; ci < ncomps; ci++)
+ scanptr->component_index[ci] = ci;
+ scanptr->Ss = scanptr->Se = 0;
+ scanptr->Ah = Ah;
+ scanptr->Al = Al;
+ scanptr++;
+ } else {
+ /* Noninterleaved DC scan for each component */
+ scanptr = fill_scans(scanptr, ncomps, 0, 0, Ah, Al);
+ }
+ return scanptr;
+}
+
+
+/*
+ * Create a recommended progressive-JPEG script.
+ * cinfo->num_components and cinfo->jpeg_color_space must be correct.
+ */
+
+GLOBAL(void)
+jpeg_simple_progression (j_compress_ptr cinfo)
+{
+ int ncomps = cinfo->num_components;
+ int nscans;
+ jpeg_scan_info * scanptr;
+
+ /* Safety check to ensure start_compress not called yet. */
+ if (cinfo->global_state != CSTATE_START)
+ ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
+
+ /* Figure space needed for script. Calculation must match code below! */
+ if (ncomps == 3 && cinfo->jpeg_color_space == JCS_YCbCr) {
+ /* Custom script for YCbCr color images. */
+ nscans = 10;
+ } else {
+ /* All-purpose script for other color spaces. */
+ if (ncomps > MAX_COMPS_IN_SCAN)
+ nscans = 6 * ncomps; /* 2 DC + 4 AC scans per component */
+ else
+ nscans = 2 + 4 * ncomps; /* 2 DC scans; 4 AC scans per component */
+ }
+
+ /* Allocate space for script.
+ * We need to put it in the permanent pool in case the application performs
+ * multiple compressions without changing the settings. To avoid a memory
+ * leak if jpeg_simple_progression is called repeatedly for the same JPEG
+ * object, we try to re-use previously allocated space, and we allocate
+ * enough space to handle YCbCr even if initially asked for grayscale.
+ */
+ if (cinfo->script_space == NULL || cinfo->script_space_size < nscans) {
+ cinfo->script_space_size = MAX(nscans, 10);
+ cinfo->script_space = (jpeg_scan_info *)
+ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
+ cinfo->script_space_size * SIZEOF(jpeg_scan_info));
+ }
+ scanptr = cinfo->script_space;
+ cinfo->scan_info = scanptr;
+ cinfo->num_scans = nscans;
+
+ if (ncomps == 3 && cinfo->jpeg_color_space == JCS_YCbCr) {
+ /* Custom script for YCbCr color images. */
+ /* Initial DC scan */
+ scanptr = fill_dc_scans(scanptr, ncomps, 0, 1);
+ /* Initial AC scan: get some luma data out in a hurry */
+ scanptr = fill_a_scan(scanptr, 0, 1, 5, 0, 2);
+ /* Chroma data is too small to be worth expending many scans on */
+ scanptr = fill_a_scan(scanptr, 2, 1, 63, 0, 1);
+ scanptr = fill_a_scan(scanptr, 1, 1, 63, 0, 1);
+ /* Complete spectral selection for luma AC */
+ scanptr = fill_a_scan(scanptr, 0, 6, 63, 0, 2);
+ /* Refine next bit of luma AC */
+ scanptr = fill_a_scan(scanptr, 0, 1, 63, 2, 1);
+ /* Finish DC successive approximation */
+ scanptr = fill_dc_scans(scanptr, ncomps, 1, 0);
+ /* Finish AC successive approximation */
+ scanptr = fill_a_scan(scanptr, 2, 1, 63, 1, 0);
+ scanptr = fill_a_scan(scanptr, 1, 1, 63, 1, 0);
+ /* Luma bottom bit comes last since it's usually largest scan */
+ scanptr = fill_a_scan(scanptr, 0, 1, 63, 1, 0);
+ } else {
+ /* All-purpose script for other color spaces. */
+ /* Successive approximation first pass */
+ scanptr = fill_dc_scans(scanptr, ncomps, 0, 1);
+ scanptr = fill_scans(scanptr, ncomps, 1, 5, 0, 2);
+ scanptr = fill_scans(scanptr, ncomps, 6, 63, 0, 2);
+ /* Successive approximation second pass */
+ scanptr = fill_scans(scanptr, ncomps, 1, 63, 2, 1);
+ /* Successive approximation final pass */
+ scanptr = fill_dc_scans(scanptr, ncomps, 1, 0);
+ scanptr = fill_scans(scanptr, ncomps, 1, 63, 1, 0);
+ }
+}
+
+#endif /* C_PROGRESSIVE_SUPPORTED */
+
+#endif //_FX_JPEG_TURBO_
diff --git a/core/src/fxcodec/libjpeg/fpdfapi_jcphuff.c b/core/src/fxcodec/libjpeg/fpdfapi_jcphuff.c
index c2655fbb48..6d89b6b2c0 100644
--- a/core/src/fxcodec/libjpeg/fpdfapi_jcphuff.c
+++ b/core/src/fxcodec/libjpeg/fpdfapi_jcphuff.c
@@ -1,836 +1,836 @@
-#if !defined(_FX_JPEG_TURBO_)
-/*
- * jcphuff.c
- *
- * Copyright (C) 1995-1997, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- * For conditions of distribution and use, see the accompanying README file.
- *
- * This file contains Huffman entropy encoding routines for progressive JPEG.
- *
- * We do not support output suspension in this module, since the library
- * currently does not allow multiple-scan files to be written with output
- * suspension.
- */
-
-#define JPEG_INTERNALS
-#include "jinclude.h"
-#include "jpeglib.h"
-#include "jchuff.h" /* Declarations shared with jchuff.c */
-
-#ifdef C_PROGRESSIVE_SUPPORTED
-
-/* Expanded entropy encoder object for progressive Huffman encoding. */
-
-typedef struct {
- struct jpeg_entropy_encoder pub; /* public fields */
-
- /* Mode flag: TRUE for optimization, FALSE for actual data output */
- boolean gather_statistics;
-
- /* Bit-level coding status.
- * next_output_byte/free_in_buffer are local copies of cinfo->dest fields.
- */
- JOCTET * next_output_byte; /* => next byte to write in buffer */
- size_t free_in_buffer; /* # of byte spaces remaining in buffer */
- INT32 put_buffer; /* current bit-accumulation buffer */
- int put_bits; /* # of bits now in it */
- j_compress_ptr cinfo; /* link to cinfo (needed for dump_buffer) */
-
- /* Coding status for DC components */
- int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */
-
- /* Coding status for AC components */
- int ac_tbl_no; /* the table number of the single component */
- unsigned int EOBRUN; /* run length of EOBs */
- unsigned int BE; /* # of buffered correction bits before MCU */
- char * bit_buffer; /* buffer for correction bits (1 per char) */
- /* packing correction bits tightly would save some space but cost time... */
-
- unsigned int restarts_to_go; /* MCUs left in this restart interval */
- int next_restart_num; /* next restart number to write (0-7) */
-
- /* Pointers to derived tables (these workspaces have image lifespan).
- * Since any one scan codes only DC or only AC, we only need one set
- * of tables, not one for DC and one for AC.
- */
- c_derived_tbl * derived_tbls[NUM_HUFF_TBLS];
-
- /* Statistics tables for optimization; again, one set is enough */
- long * count_ptrs[NUM_HUFF_TBLS];
-} phuff_entropy_encoder;
-
-typedef phuff_entropy_encoder * phuff_entropy_ptr;
-
-/* MAX_CORR_BITS is the number of bits the AC refinement correction-bit
- * buffer can hold. Larger sizes may slightly improve compression, but
- * 1000 is already well into the realm of overkill.
- * The minimum safe size is 64 bits.
- */
-
-#define MAX_CORR_BITS 1000 /* Max # of correction bits I can buffer */
-
-/* IRIGHT_SHIFT is like RIGHT_SHIFT, but works on int rather than INT32.
- * We assume that int right shift is unsigned if INT32 right shift is,
- * which should be safe.
- */
-
-#ifdef RIGHT_SHIFT_IS_UNSIGNED
-#define ISHIFT_TEMPS int ishift_temp;
-#define IRIGHT_SHIFT(x,shft) \
- ((ishift_temp = (x)) < 0 ? \
- (ishift_temp >> (shft)) | ((~0) << (16-(shft))) : \
- (ishift_temp >> (shft)))
-#else
-#define ISHIFT_TEMPS
-#define IRIGHT_SHIFT(x,shft) ((x) >> (shft))
-#endif
-
-/* Forward declarations */
-METHODDEF(boolean) encode_mcu_DC_first JPP((j_compress_ptr cinfo,
- JBLOCKROW *MCU_data));
-METHODDEF(boolean) encode_mcu_AC_first JPP((j_compress_ptr cinfo,
- JBLOCKROW *MCU_data));
-METHODDEF(boolean) encode_mcu_DC_refine JPP((j_compress_ptr cinfo,
- JBLOCKROW *MCU_data));
-METHODDEF(boolean) encode_mcu_AC_refine JPP((j_compress_ptr cinfo,
- JBLOCKROW *MCU_data));
-METHODDEF(void) finish_pass_phuff JPP((j_compress_ptr cinfo));
-METHODDEF(void) finish_pass_gather_phuff JPP((j_compress_ptr cinfo));
-
-
-/*
- * Initialize for a Huffman-compressed scan using progressive JPEG.
- */
-
-METHODDEF(void)
-start_pass_phuff (j_compress_ptr cinfo, boolean gather_statistics)
-{
- phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
- boolean is_DC_band;
- int ci, tbl;
- jpeg_component_info * compptr;
-
- entropy->cinfo = cinfo;
- entropy->gather_statistics = gather_statistics;
-
- is_DC_band = (cinfo->Ss == 0);
-
- /* We assume jcmaster.c already validated the scan parameters. */
-
- /* Select execution routines */
- if (cinfo->Ah == 0) {
- if (is_DC_band)
- entropy->pub.encode_mcu = encode_mcu_DC_first;
- else
- entropy->pub.encode_mcu = encode_mcu_AC_first;
- } else {
- if (is_DC_band)
- entropy->pub.encode_mcu = encode_mcu_DC_refine;
- else {
- entropy->pub.encode_mcu = encode_mcu_AC_refine;
- /* AC refinement needs a correction bit buffer */
- if (entropy->bit_buffer == NULL)
- entropy->bit_buffer = (char *)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- MAX_CORR_BITS * SIZEOF(char));
- }
- }
- if (gather_statistics)
- entropy->pub.finish_pass = finish_pass_gather_phuff;
- else
- entropy->pub.finish_pass = finish_pass_phuff;
-
- /* Only DC coefficients may be interleaved, so cinfo->comps_in_scan = 1
- * for AC coefficients.
- */
- for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
- compptr = cinfo->cur_comp_info[ci];
- /* Initialize DC predictions to 0 */
- entropy->last_dc_val[ci] = 0;
- /* Get table index */
- if (is_DC_band) {
- if (cinfo->Ah != 0) /* DC refinement needs no table */
- continue;
- tbl = compptr->dc_tbl_no;
- } else {
- entropy->ac_tbl_no = tbl = compptr->ac_tbl_no;
- }
- if (gather_statistics) {
- /* Check for invalid table index */
- /* (make_c_derived_tbl does this in the other path) */
- if (tbl < 0 || tbl >= NUM_HUFF_TBLS)
- ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tbl);
- /* Allocate and zero the statistics tables */
- /* Note that jpeg_gen_optimal_table expects 257 entries in each table! */
- if (entropy->count_ptrs[tbl] == NULL)
- entropy->count_ptrs[tbl] = (long *)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- 257 * SIZEOF(long));
- MEMZERO(entropy->count_ptrs[tbl], 257 * SIZEOF(long));
- } else {
- /* Compute derived values for Huffman table */
- /* We may do this more than once for a table, but it's not expensive */
- jpeg_make_c_derived_tbl(cinfo, is_DC_band, tbl,
- & entropy->derived_tbls[tbl]);
- }
- }
-
- /* Initialize AC stuff */
- entropy->EOBRUN = 0;
- entropy->BE = 0;
-
- /* Initialize bit buffer to empty */
- entropy->put_buffer = 0;
- entropy->put_bits = 0;
-
- /* Initialize restart stuff */
- entropy->restarts_to_go = cinfo->restart_interval;
- entropy->next_restart_num = 0;
-}
-
-
-/* Outputting bytes to the file.
- * NB: these must be called only when actually outputting,
- * that is, entropy->gather_statistics == FALSE.
- */
-
-/* Emit a byte */
-#define emit_byte(entropy,val) \
- { *(entropy)->next_output_byte++ = (JOCTET) (val); \
- if (--(entropy)->free_in_buffer == 0) \
- dump_buffer(entropy); }
-
-
-LOCAL(void)
-dump_buffer (phuff_entropy_ptr entropy)
-/* Empty the output buffer; we do not support suspension in this module. */
-{
- struct jpeg_destination_mgr * dest = entropy->cinfo->dest;
-
- if (! (*dest->empty_output_buffer) (entropy->cinfo))
- ERREXIT(entropy->cinfo, JERR_CANT_SUSPEND);
- /* After a successful buffer dump, must reset buffer pointers */
- entropy->next_output_byte = dest->next_output_byte;
- entropy->free_in_buffer = dest->free_in_buffer;
-}
-
-
-/* Outputting bits to the file */
-
-/* Only the right 24 bits of put_buffer are used; the valid bits are
- * left-justified in this part. At most 16 bits can be passed to emit_bits
- * in one call, and we never retain more than 7 bits in put_buffer
- * between calls, so 24 bits are sufficient.
- */
-
-INLINE
-LOCAL(void)
-emit_bits (phuff_entropy_ptr entropy, unsigned int code, int size)
-/* Emit some bits, unless we are in gather mode */
-{
- /* This routine is heavily used, so it's worth coding tightly. */
- register INT32 put_buffer = (INT32) code;
- register int put_bits = entropy->put_bits;
-
- /* if size is 0, caller used an invalid Huffman table entry */
- if (size == 0)
- ERREXIT(entropy->cinfo, JERR_HUFF_MISSING_CODE);
-
- if (entropy->gather_statistics)
- return; /* do nothing if we're only getting stats */
-
- put_buffer &= (((INT32) 1)<<size) - 1; /* mask off any extra bits in code */
-
- put_bits += size; /* new number of bits in buffer */
-
- put_buffer <<= 24 - put_bits; /* align incoming bits */
-
- put_buffer |= entropy->put_buffer; /* and merge with old buffer contents */
-
- while (put_bits >= 8) {
- int c = (int) ((put_buffer >> 16) & 0xFF);
-
- emit_byte(entropy, c);
- if (c == 0xFF) { /* need to stuff a zero byte? */
- emit_byte(entropy, 0);
- }
- put_buffer <<= 8;
- put_bits -= 8;
- }
-
- entropy->put_buffer = put_buffer; /* update variables */
- entropy->put_bits = put_bits;
-}
-
-
-LOCAL(void)
-flush_bits (phuff_entropy_ptr entropy)
-{
- emit_bits(entropy, 0x7F, 7); /* fill any partial byte with ones */
- entropy->put_buffer = 0; /* and reset bit-buffer to empty */
- entropy->put_bits = 0;
-}
-
-
-/*
- * Emit (or just count) a Huffman symbol.
- */
-
-INLINE
-LOCAL(void)
-emit_symbol (phuff_entropy_ptr entropy, int tbl_no, int symbol)
-{
- if (entropy->gather_statistics)
- entropy->count_ptrs[tbl_no][symbol]++;
- else {
- c_derived_tbl * tbl = entropy->derived_tbls[tbl_no];
- emit_bits(entropy, tbl->ehufco[symbol], tbl->ehufsi[symbol]);
- }
-}
-
-
-/*
- * Emit bits from a correction bit buffer.
- */
-
-LOCAL(void)
-emit_buffered_bits (phuff_entropy_ptr entropy, char * bufstart,
- unsigned int nbits)
-{
- if (entropy->gather_statistics)
- return; /* no real work */
-
- while (nbits > 0) {
- emit_bits(entropy, (unsigned int) (*bufstart), 1);
- bufstart++;
- nbits--;
- }
-}
-
-
-/*
- * Emit any pending EOBRUN symbol.
- */
-
-LOCAL(void)
-emit_eobrun (phuff_entropy_ptr entropy)
-{
- register int temp, nbits;
-
- if (entropy->EOBRUN > 0) { /* if there is any pending EOBRUN */
- temp = entropy->EOBRUN;
- nbits = 0;
- while ((temp >>= 1))
- nbits++;
- /* safety check: shouldn't happen given limited correction-bit buffer */
- if (nbits > 14)
- ERREXIT(entropy->cinfo, JERR_HUFF_MISSING_CODE);
-
- emit_symbol(entropy, entropy->ac_tbl_no, nbits << 4);
- if (nbits)
- emit_bits(entropy, entropy->EOBRUN, nbits);
-
- entropy->EOBRUN = 0;
-
- /* Emit any buffered correction bits */
- emit_buffered_bits(entropy, entropy->bit_buffer, entropy->BE);
- entropy->BE = 0;
- }
-}
-
-
-/*
- * Emit a restart marker & resynchronize predictions.
- */
-
-LOCAL(void)
-emit_restart (phuff_entropy_ptr entropy, int restart_num)
-{
- int ci;
-
- emit_eobrun(entropy);
-
- if (! entropy->gather_statistics) {
- flush_bits(entropy);
- emit_byte(entropy, 0xFF);
- emit_byte(entropy, JPEG_RST0 + restart_num);
- }
-
- if (entropy->cinfo->Ss == 0) {
- /* Re-initialize DC predictions to 0 */
- for (ci = 0; ci < entropy->cinfo->comps_in_scan; ci++)
- entropy->last_dc_val[ci] = 0;
- } else {
- /* Re-initialize all AC-related fields to 0 */
- entropy->EOBRUN = 0;
- entropy->BE = 0;
- }
-}
-
-
-/*
- * MCU encoding for DC initial scan (either spectral selection,
- * or first pass of successive approximation).
- */
-
-METHODDEF(boolean)
-encode_mcu_DC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
-{
- phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
- register int temp, temp2;
- register int nbits;
- int blkn, ci;
- int Al = cinfo->Al;
- JBLOCKROW block;
- jpeg_component_info * compptr;
- ISHIFT_TEMPS
-
- entropy->next_output_byte = cinfo->dest->next_output_byte;
- entropy->free_in_buffer = cinfo->dest->free_in_buffer;
-
- /* Emit restart marker if needed */
- if (cinfo->restart_interval)
- if (entropy->restarts_to_go == 0)
- emit_restart(entropy, entropy->next_restart_num);
-
- /* Encode the MCU data blocks */
- for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
- block = MCU_data[blkn];
- ci = cinfo->MCU_membership[blkn];
- compptr = cinfo->cur_comp_info[ci];
-
- /* Compute the DC value after the required point transform by Al.
- * This is simply an arithmetic right shift.
- */
- temp2 = IRIGHT_SHIFT((int) ((*block)[0]), Al);
-
- /* DC differences are figured on the point-transformed values. */
- temp = temp2 - entropy->last_dc_val[ci];
- entropy->last_dc_val[ci] = temp2;
-
- /* Encode the DC coefficient difference per section G.1.2.1 */
- temp2 = temp;
- if (temp < 0) {
- temp = -temp; /* temp is abs value of input */
- /* For a negative input, want temp2 = bitwise complement of abs(input) */
- /* This code assumes we are on a two's complement machine */
- temp2--;
- }
-
- /* Find the number of bits needed for the magnitude of the coefficient */
- nbits = 0;
- while (temp) {
- nbits++;
- temp >>= 1;
- }
- /* Check for out-of-range coefficient values.
- * Since we're encoding a difference, the range limit is twice as much.
- */
- if (nbits > MAX_COEF_BITS+1)
- ERREXIT(cinfo, JERR_BAD_DCT_COEF);
-
- /* Count/emit the Huffman-coded symbol for the number of bits */
- emit_symbol(entropy, compptr->dc_tbl_no, nbits);
-
- /* Emit that number of bits of the value, if positive, */
- /* or the complement of its magnitude, if negative. */
- if (nbits) /* emit_bits rejects calls with size 0 */
- emit_bits(entropy, (unsigned int) temp2, nbits);
- }
-
- cinfo->dest->next_output_byte = entropy->next_output_byte;
- cinfo->dest->free_in_buffer = entropy->free_in_buffer;
-
- /* Update restart-interval state too */
- if (cinfo->restart_interval) {
- if (entropy->restarts_to_go == 0) {
- entropy->restarts_to_go = cinfo->restart_interval;
- entropy->next_restart_num++;
- entropy->next_restart_num &= 7;
- }
- entropy->restarts_to_go--;
- }
-
- return TRUE;
-}
-
-
-/*
- * MCU encoding for AC initial scan (either spectral selection,
- * or first pass of successive approximation).
- */
-
-METHODDEF(boolean)
-encode_mcu_AC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
-{
- phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
- register int temp, temp2;
- register int nbits;
- register int r, k;
- int Se = cinfo->Se;
- int Al = cinfo->Al;
- JBLOCKROW block;
-
- entropy->next_output_byte = cinfo->dest->next_output_byte;
- entropy->free_in_buffer = cinfo->dest->free_in_buffer;
-
- /* Emit restart marker if needed */
- if (cinfo->restart_interval)
- if (entropy->restarts_to_go == 0)
- emit_restart(entropy, entropy->next_restart_num);
-
- /* Encode the MCU data block */
- block = MCU_data[0];
-
- /* Encode the AC coefficients per section G.1.2.2, fig. G.3 */
-
- r = 0; /* r = run length of zeros */
-
- for (k = cinfo->Ss; k <= Se; k++) {
- if ((temp = (*block)[jpeg_natural_order[k]]) == 0) {
- r++;
- continue;
- }
- /* We must apply the point transform by Al. For AC coefficients this
- * is an integer division with rounding towards 0. To do this portably
- * in C, we shift after obtaining the absolute value; so the code is
- * interwoven with finding the abs value (temp) and output bits (temp2).
- */
- if (temp < 0) {
- temp = -temp; /* temp is abs value of input */
- temp >>= Al; /* apply the point transform */
- /* For a negative coef, want temp2 = bitwise complement of abs(coef) */
- temp2 = ~temp;
- } else {
- temp >>= Al; /* apply the point transform */
- temp2 = temp;
- }
- /* Watch out for case that nonzero coef is zero after point transform */
- if (temp == 0) {
- r++;
- continue;
- }
-
- /* Emit any pending EOBRUN */
- if (entropy->EOBRUN > 0)
- emit_eobrun(entropy);
- /* if run length > 15, must emit special run-length-16 codes (0xF0) */
- while (r > 15) {
- emit_symbol(entropy, entropy->ac_tbl_no, 0xF0);
- r -= 16;
- }
-
- /* Find the number of bits needed for the magnitude of the coefficient */
- nbits = 1; /* there must be at least one 1 bit */
- while ((temp >>= 1))
- nbits++;
- /* Check for out-of-range coefficient values */
- if (nbits > MAX_COEF_BITS)
- ERREXIT(cinfo, JERR_BAD_DCT_COEF);
-
- /* Count/emit Huffman symbol for run length / number of bits */
- emit_symbol(entropy, entropy->ac_tbl_no, (r << 4) + nbits);
-
- /* Emit that number of bits of the value, if positive, */
- /* or the complement of its magnitude, if negative. */
- emit_bits(entropy, (unsigned int) temp2, nbits);
-
- r = 0; /* reset zero run length */
- }
-
- if (r > 0) { /* If there are trailing zeroes, */
- entropy->EOBRUN++; /* count an EOB */
- if (entropy->EOBRUN == 0x7FFF)
- emit_eobrun(entropy); /* force it out to avoid overflow */
- }
-
- cinfo->dest->next_output_byte = entropy->next_output_byte;
- cinfo->dest->free_in_buffer = entropy->free_in_buffer;
-
- /* Update restart-interval state too */
- if (cinfo->restart_interval) {
- if (entropy->restarts_to_go == 0) {
- entropy->restarts_to_go = cinfo->restart_interval;
- entropy->next_restart_num++;
- entropy->next_restart_num &= 7;
- }
- entropy->restarts_to_go--;
- }
-
- return TRUE;
-}
-
-
-/*
- * MCU encoding for DC successive approximation refinement scan.
- * Note: we assume such scans can be multi-component, although the spec
- * is not very clear on the point.
- */
-
-METHODDEF(boolean)
-encode_mcu_DC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
-{
- phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
- register int temp;
- int blkn;
- int Al = cinfo->Al;
- JBLOCKROW block;
-
- entropy->next_output_byte = cinfo->dest->next_output_byte;
- entropy->free_in_buffer = cinfo->dest->free_in_buffer;
-
- /* Emit restart marker if needed */
- if (cinfo->restart_interval)
- if (entropy->restarts_to_go == 0)
- emit_restart(entropy, entropy->next_restart_num);
-
- /* Encode the MCU data blocks */
- for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
- block = MCU_data[blkn];
-
- /* We simply emit the Al'th bit of the DC coefficient value. */
- temp = (*block)[0];
- emit_bits(entropy, (unsigned int) (temp >> Al), 1);
- }
-
- cinfo->dest->next_output_byte = entropy->next_output_byte;
- cinfo->dest->free_in_buffer = entropy->free_in_buffer;
-
- /* Update restart-interval state too */
- if (cinfo->restart_interval) {
- if (entropy->restarts_to_go == 0) {
- entropy->restarts_to_go = cinfo->restart_interval;
- entropy->next_restart_num++;
- entropy->next_restart_num &= 7;
- }
- entropy->restarts_to_go--;
- }
-
- return TRUE;
-}
-
-
-/*
- * MCU encoding for AC successive approximation refinement scan.
- */
-
-METHODDEF(boolean)
-encode_mcu_AC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
-{
- phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
- register int temp;
- register int r, k;
- int EOB;
- char *BR_buffer;
- unsigned int BR;
- int Se = cinfo->Se;
- int Al = cinfo->Al;
- JBLOCKROW block;
- int absvalues[DCTSIZE2];
-
- entropy->next_output_byte = cinfo->dest->next_output_byte;
- entropy->free_in_buffer = cinfo->dest->free_in_buffer;
-
- /* Emit restart marker if needed */
- if (cinfo->restart_interval)
- if (entropy->restarts_to_go == 0)
- emit_restart(entropy, entropy->next_restart_num);
-
- /* Encode the MCU data block */
- block = MCU_data[0];
-
- /* It is convenient to make a pre-pass to determine the transformed
- * coefficients' absolute values and the EOB position.
- */
- EOB = 0;
- for (k = cinfo->Ss; k <= Se; k++) {
- temp = (*block)[jpeg_natural_order[k]];
- /* We must apply the point transform by Al. For AC coefficients this
- * is an integer division with rounding towards 0. To do this portably
- * in C, we shift after obtaining the absolute value.
- */
- if (temp < 0)
- temp = -temp; /* temp is abs value of input */
- temp >>= Al; /* apply the point transform */
- absvalues[k] = temp; /* save abs value for main pass */
- if (temp == 1)
- EOB = k; /* EOB = index of last newly-nonzero coef */
- }
-
- /* Encode the AC coefficients per section G.1.2.3, fig. G.7 */
-
- r = 0; /* r = run length of zeros */
- BR = 0; /* BR = count of buffered bits added now */
- BR_buffer = entropy->bit_buffer + entropy->BE; /* Append bits to buffer */
-
- for (k = cinfo->Ss; k <= Se; k++) {
- if ((temp = absvalues[k]) == 0) {
- r++;
- continue;
- }
-
- /* Emit any required ZRLs, but not if they can be folded into EOB */
- while (r > 15 && k <= EOB) {
- /* emit any pending EOBRUN and the BE correction bits */
- emit_eobrun(entropy);
- /* Emit ZRL */
- emit_symbol(entropy, entropy->ac_tbl_no, 0xF0);
- r -= 16;
- /* Emit buffered correction bits that must be associated with ZRL */
- emit_buffered_bits(entropy, BR_buffer, BR);
- BR_buffer = entropy->bit_buffer; /* BE bits are gone now */
- BR = 0;
- }
-
- /* If the coef was previously nonzero, it only needs a correction bit.
- * NOTE: a straight translation of the spec's figure G.7 would suggest
- * that we also need to test r > 15. But if r > 15, we can only get here
- * if k > EOB, which implies that this coefficient is not 1.
- */
- if (temp > 1) {
- /* The correction bit is the next bit of the absolute value. */
- BR_buffer[BR++] = (char) (temp & 1);
- continue;
- }
-
- /* Emit any pending EOBRUN and the BE correction bits */
- emit_eobrun(entropy);
-
- /* Count/emit Huffman symbol for run length / number of bits */
- emit_symbol(entropy, entropy->ac_tbl_no, (r << 4) + 1);
-
- /* Emit output bit for newly-nonzero coef */
- temp = ((*block)[jpeg_natural_order[k]] < 0) ? 0 : 1;
- emit_bits(entropy, (unsigned int) temp, 1);
-
- /* Emit buffered correction bits that must be associated with this code */
- emit_buffered_bits(entropy, BR_buffer, BR);
- BR_buffer = entropy->bit_buffer; /* BE bits are gone now */
- BR = 0;
- r = 0; /* reset zero run length */
- }
-
- if (r > 0 || BR > 0) { /* If there are trailing zeroes, */
- entropy->EOBRUN++; /* count an EOB */
- entropy->BE += BR; /* concat my correction bits to older ones */
- /* We force out the EOB if we risk either:
- * 1. overflow of the EOB counter;
- * 2. overflow of the correction bit buffer during the next MCU.
- */
- if (entropy->EOBRUN == 0x7FFF || entropy->BE > (MAX_CORR_BITS-DCTSIZE2+1))
- emit_eobrun(entropy);
- }
-
- cinfo->dest->next_output_byte = entropy->next_output_byte;
- cinfo->dest->free_in_buffer = entropy->free_in_buffer;
-
- /* Update restart-interval state too */
- if (cinfo->restart_interval) {
- if (entropy->restarts_to_go == 0) {
- entropy->restarts_to_go = cinfo->restart_interval;
- entropy->next_restart_num++;
- entropy->next_restart_num &= 7;
- }
- entropy->restarts_to_go--;
- }
-
- return TRUE;
-}
-
-
-/*
- * Finish up at the end of a Huffman-compressed progressive scan.
- */
-
-METHODDEF(void)
-finish_pass_phuff (j_compress_ptr cinfo)
-{
- phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
-
- entropy->next_output_byte = cinfo->dest->next_output_byte;
- entropy->free_in_buffer = cinfo->dest->free_in_buffer;
-
- /* Flush out any buffered data */
- emit_eobrun(entropy);
- flush_bits(entropy);
-
- cinfo->dest->next_output_byte = entropy->next_output_byte;
- cinfo->dest->free_in_buffer = entropy->free_in_buffer;
-}
-
-
-/*
- * Finish up a statistics-gathering pass and create the new Huffman tables.
- */
-
-METHODDEF(void)
-finish_pass_gather_phuff (j_compress_ptr cinfo)
-{
- phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
- boolean is_DC_band;
- int ci, tbl;
- jpeg_component_info * compptr;
- JHUFF_TBL **htblptr;
- boolean did[NUM_HUFF_TBLS];
-
- /* Flush out buffered data (all we care about is counting the EOB symbol) */
- emit_eobrun(entropy);
-
- is_DC_band = (cinfo->Ss == 0);
-
- /* It's important not to apply jpeg_gen_optimal_table more than once
- * per table, because it clobbers the input frequency counts!
- */
- MEMZERO(did, SIZEOF(did));
-
- for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
- compptr = cinfo->cur_comp_info[ci];
- if (is_DC_band) {
- if (cinfo->Ah != 0) /* DC refinement needs no table */
- continue;
- tbl = compptr->dc_tbl_no;
- } else {
- tbl = compptr->ac_tbl_no;
- }
- if (! did[tbl]) {
- if (is_DC_band)
- htblptr = & cinfo->dc_huff_tbl_ptrs[tbl];
- else
- htblptr = & cinfo->ac_huff_tbl_ptrs[tbl];
- if (*htblptr == NULL)
- *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);
- jpeg_gen_optimal_table(cinfo, *htblptr, entropy->count_ptrs[tbl]);
- did[tbl] = TRUE;
- }
- }
-}
-
-
-/*
- * Module initialization routine for progressive Huffman entropy encoding.
- */
-
-GLOBAL(void)
-jinit_phuff_encoder (j_compress_ptr cinfo)
-{
- phuff_entropy_ptr entropy;
- int i;
-
- entropy = (phuff_entropy_ptr)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- SIZEOF(phuff_entropy_encoder));
- cinfo->entropy = (struct jpeg_entropy_encoder *) entropy;
- entropy->pub.start_pass = start_pass_phuff;
-
- /* Mark tables unallocated */
- for (i = 0; i < NUM_HUFF_TBLS; i++) {
- entropy->derived_tbls[i] = NULL;
- entropy->count_ptrs[i] = NULL;
- }
- entropy->bit_buffer = NULL; /* needed only in AC refinement scan */
-}
-
-#endif /* C_PROGRESSIVE_SUPPORTED */
-
-#endif //_FX_JPEG_TURBO_
+#if !defined(_FX_JPEG_TURBO_)
+/*
+ * jcphuff.c
+ *
+ * Copyright (C) 1995-1997, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains Huffman entropy encoding routines for progressive JPEG.
+ *
+ * We do not support output suspension in this module, since the library
+ * currently does not allow multiple-scan files to be written with output
+ * suspension.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+#include "jchuff.h" /* Declarations shared with jchuff.c */
+
+#ifdef C_PROGRESSIVE_SUPPORTED
+
+/* Expanded entropy encoder object for progressive Huffman encoding. */
+
+typedef struct {
+ struct jpeg_entropy_encoder pub; /* public fields */
+
+ /* Mode flag: TRUE for optimization, FALSE for actual data output */
+ boolean gather_statistics;
+
+ /* Bit-level coding status.
+ * next_output_byte/free_in_buffer are local copies of cinfo->dest fields.
+ */
+ JOCTET * next_output_byte; /* => next byte to write in buffer */
+ size_t free_in_buffer; /* # of byte spaces remaining in buffer */
+ INT32 put_buffer; /* current bit-accumulation buffer */
+ int put_bits; /* # of bits now in it */
+ j_compress_ptr cinfo; /* link to cinfo (needed for dump_buffer) */
+
+ /* Coding status for DC components */
+ int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */
+
+ /* Coding status for AC components */
+ int ac_tbl_no; /* the table number of the single component */
+ unsigned int EOBRUN; /* run length of EOBs */
+ unsigned int BE; /* # of buffered correction bits before MCU */
+ char * bit_buffer; /* buffer for correction bits (1 per char) */
+ /* packing correction bits tightly would save some space but cost time... */
+
+ unsigned int restarts_to_go; /* MCUs left in this restart interval */
+ int next_restart_num; /* next restart number to write (0-7) */
+
+ /* Pointers to derived tables (these workspaces have image lifespan).
+ * Since any one scan codes only DC or only AC, we only need one set
+ * of tables, not one for DC and one for AC.
+ */
+ c_derived_tbl * derived_tbls[NUM_HUFF_TBLS];
+
+ /* Statistics tables for optimization; again, one set is enough */
+ long * count_ptrs[NUM_HUFF_TBLS];
+} phuff_entropy_encoder;
+
+typedef phuff_entropy_encoder * phuff_entropy_ptr;
+
+/* MAX_CORR_BITS is the number of bits the AC refinement correction-bit
+ * buffer can hold. Larger sizes may slightly improve compression, but
+ * 1000 is already well into the realm of overkill.
+ * The minimum safe size is 64 bits.
+ */
+
+#define MAX_CORR_BITS 1000 /* Max # of correction bits I can buffer */
+
+/* IRIGHT_SHIFT is like RIGHT_SHIFT, but works on int rather than INT32.
+ * We assume that int right shift is unsigned if INT32 right shift is,
+ * which should be safe.
+ */
+
+#ifdef RIGHT_SHIFT_IS_UNSIGNED
+#define ISHIFT_TEMPS int ishift_temp;
+#define IRIGHT_SHIFT(x,shft) \
+ ((ishift_temp = (x)) < 0 ? \
+ (ishift_temp >> (shft)) | ((~0) << (16-(shft))) : \
+ (ishift_temp >> (shft)))
+#else
+#define ISHIFT_TEMPS
+#define IRIGHT_SHIFT(x,shft) ((x) >> (shft))
+#endif
+
+/* Forward declarations */
+METHODDEF(boolean) encode_mcu_DC_first JPP((j_compress_ptr cinfo,
+ JBLOCKROW *MCU_data));
+METHODDEF(boolean) encode_mcu_AC_first JPP((j_compress_ptr cinfo,
+ JBLOCKROW *MCU_data));
+METHODDEF(boolean) encode_mcu_DC_refine JPP((j_compress_ptr cinfo,
+ JBLOCKROW *MCU_data));
+METHODDEF(boolean) encode_mcu_AC_refine JPP((j_compress_ptr cinfo,
+ JBLOCKROW *MCU_data));
+METHODDEF(void) finish_pass_phuff JPP((j_compress_ptr cinfo));
+METHODDEF(void) finish_pass_gather_phuff JPP((j_compress_ptr cinfo));
+
+
+/*
+ * Initialize for a Huffman-compressed scan using progressive JPEG.
+ */
+
+METHODDEF(void)
+start_pass_phuff (j_compress_ptr cinfo, boolean gather_statistics)
+{
+ phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
+ boolean is_DC_band;
+ int ci, tbl;
+ jpeg_component_info * compptr;
+
+ entropy->cinfo = cinfo;
+ entropy->gather_statistics = gather_statistics;
+
+ is_DC_band = (cinfo->Ss == 0);
+
+ /* We assume jcmaster.c already validated the scan parameters. */
+
+ /* Select execution routines */
+ if (cinfo->Ah == 0) {
+ if (is_DC_band)
+ entropy->pub.encode_mcu = encode_mcu_DC_first;
+ else
+ entropy->pub.encode_mcu = encode_mcu_AC_first;
+ } else {
+ if (is_DC_band)
+ entropy->pub.encode_mcu = encode_mcu_DC_refine;
+ else {
+ entropy->pub.encode_mcu = encode_mcu_AC_refine;
+ /* AC refinement needs a correction bit buffer */
+ if (entropy->bit_buffer == NULL)
+ entropy->bit_buffer = (char *)
+ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ MAX_CORR_BITS * SIZEOF(char));
+ }
+ }
+ if (gather_statistics)
+ entropy->pub.finish_pass = finish_pass_gather_phuff;
+ else
+ entropy->pub.finish_pass = finish_pass_phuff;
+
+ /* Only DC coefficients may be interleaved, so cinfo->comps_in_scan = 1
+ * for AC coefficients.
+ */
+ for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
+ compptr = cinfo->cur_comp_info[ci];
+ /* Initialize DC predictions to 0 */
+ entropy->last_dc_val[ci] = 0;
+ /* Get table index */
+ if (is_DC_band) {
+ if (cinfo->Ah != 0) /* DC refinement needs no table */
+ continue;
+ tbl = compptr->dc_tbl_no;
+ } else {
+ entropy->ac_tbl_no = tbl = compptr->ac_tbl_no;
+ }
+ if (gather_statistics) {
+ /* Check for invalid table index */
+ /* (make_c_derived_tbl does this in the other path) */
+ if (tbl < 0 || tbl >= NUM_HUFF_TBLS)
+ ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tbl);
+ /* Allocate and zero the statistics tables */
+ /* Note that jpeg_gen_optimal_table expects 257 entries in each table! */
+ if (entropy->count_ptrs[tbl] == NULL)
+ entropy->count_ptrs[tbl] = (long *)
+ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ 257 * SIZEOF(long));
+ MEMZERO(entropy->count_ptrs[tbl], 257 * SIZEOF(long));
+ } else {
+ /* Compute derived values for Huffman table */
+ /* We may do this more than once for a table, but it's not expensive */
+ jpeg_make_c_derived_tbl(cinfo, is_DC_band, tbl,
+ & entropy->derived_tbls[tbl]);
+ }
+ }
+
+ /* Initialize AC stuff */
+ entropy->EOBRUN = 0;
+ entropy->BE = 0;
+
+ /* Initialize bit buffer to empty */
+ entropy->put_buffer = 0;
+ entropy->put_bits = 0;
+
+ /* Initialize restart stuff */
+ entropy->restarts_to_go = cinfo->restart_interval;
+ entropy->next_restart_num = 0;
+}
+
+
+/* Outputting bytes to the file.
+ * NB: these must be called only when actually outputting,
+ * that is, entropy->gather_statistics == FALSE.
+ */
+
+/* Emit a byte */
+#define emit_byte(entropy,val) \
+ { *(entropy)->next_output_byte++ = (JOCTET) (val); \
+ if (--(entropy)->free_in_buffer == 0) \
+ dump_buffer(entropy); }
+
+
+LOCAL(void)
+dump_buffer (phuff_entropy_ptr entropy)
+/* Empty the output buffer; we do not support suspension in this module. */
+{
+ struct jpeg_destination_mgr * dest = entropy->cinfo->dest;
+
+ if (! (*dest->empty_output_buffer) (entropy->cinfo))
+ ERREXIT(entropy->cinfo, JERR_CANT_SUSPEND);
+ /* After a successful buffer dump, must reset buffer pointers */
+ entropy->next_output_byte = dest->next_output_byte;
+ entropy->free_in_buffer = dest->free_in_buffer;
+}
+
+
+/* Outputting bits to the file */
+
+/* Only the right 24 bits of put_buffer are used; the valid bits are
+ * left-justified in this part. At most 16 bits can be passed to emit_bits
+ * in one call, and we never retain more than 7 bits in put_buffer
+ * between calls, so 24 bits are sufficient.
+ */
+
+INLINE
+LOCAL(void)
+emit_bits (phuff_entropy_ptr entropy, unsigned int code, int size)
+/* Emit some bits, unless we are in gather mode */
+{
+ /* This routine is heavily used, so it's worth coding tightly. */
+ register INT32 put_buffer = (INT32) code;
+ register int put_bits = entropy->put_bits;
+
+ /* if size is 0, caller used an invalid Huffman table entry */
+ if (size == 0)
+ ERREXIT(entropy->cinfo, JERR_HUFF_MISSING_CODE);
+
+ if (entropy->gather_statistics)
+ return; /* do nothing if we're only getting stats */
+
+ put_buffer &= (((INT32) 1)<<size) - 1; /* mask off any extra bits in code */
+
+ put_bits += size; /* new number of bits in buffer */
+
+ put_buffer <<= 24 - put_bits; /* align incoming bits */
+
+ put_buffer |= entropy->put_buffer; /* and merge with old buffer contents */
+
+ while (put_bits >= 8) {
+ int c = (int) ((put_buffer >> 16) & 0xFF);
+
+ emit_byte(entropy, c);
+ if (c == 0xFF) { /* need to stuff a zero byte? */
+ emit_byte(entropy, 0);
+ }
+ put_buffer <<= 8;
+ put_bits -= 8;
+ }
+
+ entropy->put_buffer = put_buffer; /* update variables */
+ entropy->put_bits = put_bits;
+}
+
+
+LOCAL(void)
+flush_bits (phuff_entropy_ptr entropy)
+{
+ emit_bits(entropy, 0x7F, 7); /* fill any partial byte with ones */
+ entropy->put_buffer = 0; /* and reset bit-buffer to empty */
+ entropy->put_bits = 0;
+}
+
+
+/*
+ * Emit (or just count) a Huffman symbol.
+ */
+
+INLINE
+LOCAL(void)
+emit_symbol (phuff_entropy_ptr entropy, int tbl_no, int symbol)
+{
+ if (entropy->gather_statistics)
+ entropy->count_ptrs[tbl_no][symbol]++;
+ else {
+ c_derived_tbl * tbl = entropy->derived_tbls[tbl_no];
+ emit_bits(entropy, tbl->ehufco[symbol], tbl->ehufsi[symbol]);
+ }
+}
+
+
+/*
+ * Emit bits from a correction bit buffer.
+ */
+
+LOCAL(void)
+emit_buffered_bits (phuff_entropy_ptr entropy, char * bufstart,
+ unsigned int nbits)
+{
+ if (entropy->gather_statistics)
+ return; /* no real work */
+
+ while (nbits > 0) {
+ emit_bits(entropy, (unsigned int) (*bufstart), 1);
+ bufstart++;
+ nbits--;
+ }
+}
+
+
+/*
+ * Emit any pending EOBRUN symbol.
+ */
+
+LOCAL(void)
+emit_eobrun (phuff_entropy_ptr entropy)
+{
+ register int temp, nbits;
+
+ if (entropy->EOBRUN > 0) { /* if there is any pending EOBRUN */
+ temp = entropy->EOBRUN;
+ nbits = 0;
+ while ((temp >>= 1))
+ nbits++;
+ /* safety check: shouldn't happen given limited correction-bit buffer */
+ if (nbits > 14)
+ ERREXIT(entropy->cinfo, JERR_HUFF_MISSING_CODE);
+
+ emit_symbol(entropy, entropy->ac_tbl_no, nbits << 4);
+ if (nbits)
+ emit_bits(entropy, entropy->EOBRUN, nbits);
+
+ entropy->EOBRUN = 0;
+
+ /* Emit any buffered correction bits */
+ emit_buffered_bits(entropy, entropy->bit_buffer, entropy->BE);
+ entropy->BE = 0;
+ }
+}
+
+
+/*
+ * Emit a restart marker & resynchronize predictions.
+ */
+
+LOCAL(void)
+emit_restart (phuff_entropy_ptr entropy, int restart_num)
+{
+ int ci;
+
+ emit_eobrun(entropy);
+
+ if (! entropy->gather_statistics) {
+ flush_bits(entropy);
+ emit_byte(entropy, 0xFF);
+ emit_byte(entropy, JPEG_RST0 + restart_num);
+ }
+
+ if (entropy->cinfo->Ss == 0) {
+ /* Re-initialize DC predictions to 0 */
+ for (ci = 0; ci < entropy->cinfo->comps_in_scan; ci++)
+ entropy->last_dc_val[ci] = 0;
+ } else {
+ /* Re-initialize all AC-related fields to 0 */
+ entropy->EOBRUN = 0;
+ entropy->BE = 0;
+ }
+}
+
+
+/*
+ * MCU encoding for DC initial scan (either spectral selection,
+ * or first pass of successive approximation).
+ */
+
+METHODDEF(boolean)
+encode_mcu_DC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
+{
+ phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
+ register int temp, temp2;
+ register int nbits;
+ int blkn, ci;
+ int Al = cinfo->Al;
+ JBLOCKROW block;
+ jpeg_component_info * compptr;
+ ISHIFT_TEMPS
+
+ entropy->next_output_byte = cinfo->dest->next_output_byte;
+ entropy->free_in_buffer = cinfo->dest->free_in_buffer;
+
+ /* Emit restart marker if needed */
+ if (cinfo->restart_interval)
+ if (entropy->restarts_to_go == 0)
+ emit_restart(entropy, entropy->next_restart_num);
+
+ /* Encode the MCU data blocks */
+ for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
+ block = MCU_data[blkn];
+ ci = cinfo->MCU_membership[blkn];
+ compptr = cinfo->cur_comp_info[ci];
+
+ /* Compute the DC value after the required point transform by Al.
+ * This is simply an arithmetic right shift.
+ */
+ temp2 = IRIGHT_SHIFT((int) ((*block)[0]), Al);
+
+ /* DC differences are figured on the point-transformed values. */
+ temp = temp2 - entropy->last_dc_val[ci];
+ entropy->last_dc_val[ci] = temp2;
+
+ /* Encode the DC coefficient difference per section G.1.2.1 */
+ temp2 = temp;
+ if (temp < 0) {
+ temp = -temp; /* temp is abs value of input */
+ /* For a negative input, want temp2 = bitwise complement of abs(input) */
+ /* This code assumes we are on a two's complement machine */
+ temp2--;
+ }
+
+ /* Find the number of bits needed for the magnitude of the coefficient */
+ nbits = 0;
+ while (temp) {
+ nbits++;
+ temp >>= 1;
+ }
+ /* Check for out-of-range coefficient values.
+ * Since we're encoding a difference, the range limit is twice as much.
+ */
+ if (nbits > MAX_COEF_BITS+1)
+ ERREXIT(cinfo, JERR_BAD_DCT_COEF);
+
+ /* Count/emit the Huffman-coded symbol for the number of bits */
+ emit_symbol(entropy, compptr->dc_tbl_no, nbits);
+
+ /* Emit that number of bits of the value, if positive, */
+ /* or the complement of its magnitude, if negative. */
+ if (nbits) /* emit_bits rejects calls with size 0 */
+ emit_bits(entropy, (unsigned int) temp2, nbits);
+ }
+
+ cinfo->dest->next_output_byte = entropy->next_output_byte;
+ cinfo->dest->free_in_buffer = entropy->free_in_buffer;
+
+ /* Update restart-interval state too */
+ if (cinfo->restart_interval) {
+ if (entropy->restarts_to_go == 0) {
+ entropy->restarts_to_go = cinfo->restart_interval;
+ entropy->next_restart_num++;
+ entropy->next_restart_num &= 7;
+ }
+ entropy->restarts_to_go--;
+ }
+
+ return TRUE;
+}
+
+
+/*
+ * MCU encoding for AC initial scan (either spectral selection,
+ * or first pass of successive approximation).
+ */
+
+METHODDEF(boolean)
+encode_mcu_AC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
+{
+ phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
+ register int temp, temp2;
+ register int nbits;
+ register int r, k;
+ int Se = cinfo->Se;
+ int Al = cinfo->Al;
+ JBLOCKROW block;
+
+ entropy->next_output_byte = cinfo->dest->next_output_byte;
+ entropy->free_in_buffer = cinfo->dest->free_in_buffer;
+
+ /* Emit restart marker if needed */
+ if (cinfo->restart_interval)
+ if (entropy->restarts_to_go == 0)
+ emit_restart(entropy, entropy->next_restart_num);
+
+ /* Encode the MCU data block */
+ block = MCU_data[0];
+
+ /* Encode the AC coefficients per section G.1.2.2, fig. G.3 */
+
+ r = 0; /* r = run length of zeros */
+
+ for (k = cinfo->Ss; k <= Se; k++) {
+ if ((temp = (*block)[jpeg_natural_order[k]]) == 0) {
+ r++;
+ continue;
+ }
+ /* We must apply the point transform by Al. For AC coefficients this
+ * is an integer division with rounding towards 0. To do this portably
+ * in C, we shift after obtaining the absolute value; so the code is
+ * interwoven with finding the abs value (temp) and output bits (temp2).
+ */
+ if (temp < 0) {
+ temp = -temp; /* temp is abs value of input */
+ temp >>= Al; /* apply the point transform */
+ /* For a negative coef, want temp2 = bitwise complement of abs(coef) */
+ temp2 = ~temp;
+ } else {
+ temp >>= Al; /* apply the point transform */
+ temp2 = temp;
+ }
+ /* Watch out for case that nonzero coef is zero after point transform */
+ if (temp == 0) {
+ r++;
+ continue;
+ }
+
+ /* Emit any pending EOBRUN */
+ if (entropy->EOBRUN > 0)
+ emit_eobrun(entropy);
+ /* if run length > 15, must emit special run-length-16 codes (0xF0) */
+ while (r > 15) {
+ emit_symbol(entropy, entropy->ac_tbl_no, 0xF0);
+ r -= 16;
+ }
+
+ /* Find the number of bits needed for the magnitude of the coefficient */
+ nbits = 1; /* there must be at least one 1 bit */
+ while ((temp >>= 1))
+ nbits++;
+ /* Check for out-of-range coefficient values */
+ if (nbits > MAX_COEF_BITS)
+ ERREXIT(cinfo, JERR_BAD_DCT_COEF);
+
+ /* Count/emit Huffman symbol for run length / number of bits */
+ emit_symbol(entropy, entropy->ac_tbl_no, (r << 4) + nbits);
+
+ /* Emit that number of bits of the value, if positive, */
+ /* or the complement of its magnitude, if negative. */
+ emit_bits(entropy, (unsigned int) temp2, nbits);
+
+ r = 0; /* reset zero run length */
+ }
+
+ if (r > 0) { /* If there are trailing zeroes, */
+ entropy->EOBRUN++; /* count an EOB */
+ if (entropy->EOBRUN == 0x7FFF)
+ emit_eobrun(entropy); /* force it out to avoid overflow */
+ }
+
+ cinfo->dest->next_output_byte = entropy->next_output_byte;
+ cinfo->dest->free_in_buffer = entropy->free_in_buffer;
+
+ /* Update restart-interval state too */
+ if (cinfo->restart_interval) {
+ if (entropy->restarts_to_go == 0) {
+ entropy->restarts_to_go = cinfo->restart_interval;
+ entropy->next_restart_num++;
+ entropy->next_restart_num &= 7;
+ }
+ entropy->restarts_to_go--;
+ }
+
+ return TRUE;
+}
+
+
+/*
+ * MCU encoding for DC successive approximation refinement scan.
+ * Note: we assume such scans can be multi-component, although the spec
+ * is not very clear on the point.
+ */
+
+METHODDEF(boolean)
+encode_mcu_DC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
+{
+ phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
+ register int temp;
+ int blkn;
+ int Al = cinfo->Al;
+ JBLOCKROW block;
+
+ entropy->next_output_byte = cinfo->dest->next_output_byte;
+ entropy->free_in_buffer = cinfo->dest->free_in_buffer;
+
+ /* Emit restart marker if needed */
+ if (cinfo->restart_interval)
+ if (entropy->restarts_to_go == 0)
+ emit_restart(entropy, entropy->next_restart_num);
+
+ /* Encode the MCU data blocks */
+ for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
+ block = MCU_data[blkn];
+
+ /* We simply emit the Al'th bit of the DC coefficient value. */
+ temp = (*block)[0];
+ emit_bits(entropy, (unsigned int) (temp >> Al), 1);
+ }
+
+ cinfo->dest->next_output_byte = entropy->next_output_byte;
+ cinfo->dest->free_in_buffer = entropy->free_in_buffer;
+
+ /* Update restart-interval state too */
+ if (cinfo->restart_interval) {
+ if (entropy->restarts_to_go == 0) {
+ entropy->restarts_to_go = cinfo->restart_interval;
+ entropy->next_restart_num++;
+ entropy->next_restart_num &= 7;
+ }
+ entropy->restarts_to_go--;
+ }
+
+ return TRUE;
+}
+
+
+/*
+ * MCU encoding for AC successive approximation refinement scan.
+ */
+
+METHODDEF(boolean)
+encode_mcu_AC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
+{
+ phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
+ register int temp;
+ register int r, k;
+ int EOB;
+ char *BR_buffer;
+ unsigned int BR;
+ int Se = cinfo->Se;
+ int Al = cinfo->Al;
+ JBLOCKROW block;
+ int absvalues[DCTSIZE2];
+
+ entropy->next_output_byte = cinfo->dest->next_output_byte;
+ entropy->free_in_buffer = cinfo->dest->free_in_buffer;
+
+ /* Emit restart marker if needed */
+ if (cinfo->restart_interval)
+ if (entropy->restarts_to_go == 0)
+ emit_restart(entropy, entropy->next_restart_num);
+
+ /* Encode the MCU data block */
+ block = MCU_data[0];
+
+ /* It is convenient to make a pre-pass to determine the transformed
+ * coefficients' absolute values and the EOB position.
+ */
+ EOB = 0;
+ for (k = cinfo->Ss; k <= Se; k++) {
+ temp = (*block)[jpeg_natural_order[k]];
+ /* We must apply the point transform by Al. For AC coefficients this
+ * is an integer division with rounding towards 0. To do this portably
+ * in C, we shift after obtaining the absolute value.
+ */
+ if (temp < 0)
+ temp = -temp; /* temp is abs value of input */
+ temp >>= Al; /* apply the point transform */
+ absvalues[k] = temp; /* save abs value for main pass */
+ if (temp == 1)
+ EOB = k; /* EOB = index of last newly-nonzero coef */
+ }
+
+ /* Encode the AC coefficients per section G.1.2.3, fig. G.7 */
+
+ r = 0; /* r = run length of zeros */
+ BR = 0; /* BR = count of buffered bits added now */
+ BR_buffer = entropy->bit_buffer + entropy->BE; /* Append bits to buffer */
+
+ for (k = cinfo->Ss; k <= Se; k++) {
+ if ((temp = absvalues[k]) == 0) {
+ r++;
+ continue;
+ }
+
+ /* Emit any required ZRLs, but not if they can be folded into EOB */
+ while (r > 15 && k <= EOB) {
+ /* emit any pending EOBRUN and the BE correction bits */
+ emit_eobrun(entropy);
+ /* Emit ZRL */
+ emit_symbol(entropy, entropy->ac_tbl_no, 0xF0);
+ r -= 16;
+ /* Emit buffered correction bits that must be associated with ZRL */
+ emit_buffered_bits(entropy, BR_buffer, BR);
+ BR_buffer = entropy->bit_buffer; /* BE bits are gone now */
+ BR = 0;
+ }
+
+ /* If the coef was previously nonzero, it only needs a correction bit.
+ * NOTE: a straight translation of the spec's figure G.7 would suggest
+ * that we also need to test r > 15. But if r > 15, we can only get here
+ * if k > EOB, which implies that this coefficient is not 1.
+ */
+ if (temp > 1) {
+ /* The correction bit is the next bit of the absolute value. */
+ BR_buffer[BR++] = (char) (temp & 1);
+ continue;
+ }
+
+ /* Emit any pending EOBRUN and the BE correction bits */
+ emit_eobrun(entropy);
+
+ /* Count/emit Huffman symbol for run length / number of bits */
+ emit_symbol(entropy, entropy->ac_tbl_no, (r << 4) + 1);
+
+ /* Emit output bit for newly-nonzero coef */
+ temp = ((*block)[jpeg_natural_order[k]] < 0) ? 0 : 1;
+ emit_bits(entropy, (unsigned int) temp, 1);
+
+ /* Emit buffered correction bits that must be associated with this code */
+ emit_buffered_bits(entropy, BR_buffer, BR);
+ BR_buffer = entropy->bit_buffer; /* BE bits are gone now */
+ BR = 0;
+ r = 0; /* reset zero run length */
+ }
+
+ if (r > 0 || BR > 0) { /* If there are trailing zeroes, */
+ entropy->EOBRUN++; /* count an EOB */
+ entropy->BE += BR; /* concat my correction bits to older ones */
+ /* We force out the EOB if we risk either:
+ * 1. overflow of the EOB counter;
+ * 2. overflow of the correction bit buffer during the next MCU.
+ */
+ if (entropy->EOBRUN == 0x7FFF || entropy->BE > (MAX_CORR_BITS-DCTSIZE2+1))
+ emit_eobrun(entropy);
+ }
+
+ cinfo->dest->next_output_byte = entropy->next_output_byte;
+ cinfo->dest->free_in_buffer = entropy->free_in_buffer;
+
+ /* Update restart-interval state too */
+ if (cinfo->restart_interval) {
+ if (entropy->restarts_to_go == 0) {
+ entropy->restarts_to_go = cinfo->restart_interval;
+ entropy->next_restart_num++;
+ entropy->next_restart_num &= 7;
+ }
+ entropy->restarts_to_go--;
+ }
+
+ return TRUE;
+}
+
+
+/*
+ * Finish up at the end of a Huffman-compressed progressive scan.
+ */
+
+METHODDEF(void)
+finish_pass_phuff (j_compress_ptr cinfo)
+{
+ phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
+
+ entropy->next_output_byte = cinfo->dest->next_output_byte;
+ entropy->free_in_buffer = cinfo->dest->free_in_buffer;
+
+ /* Flush out any buffered data */
+ emit_eobrun(entropy);
+ flush_bits(entropy);
+
+ cinfo->dest->next_output_byte = entropy->next_output_byte;
+ cinfo->dest->free_in_buffer = entropy->free_in_buffer;
+}
+
+
+/*
+ * Finish up a statistics-gathering pass and create the new Huffman tables.
+ */
+
+METHODDEF(void)
+finish_pass_gather_phuff (j_compress_ptr cinfo)
+{
+ phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
+ boolean is_DC_band;
+ int ci, tbl;
+ jpeg_component_info * compptr;
+ JHUFF_TBL **htblptr;
+ boolean did[NUM_HUFF_TBLS];
+
+ /* Flush out buffered data (all we care about is counting the EOB symbol) */
+ emit_eobrun(entropy);
+
+ is_DC_band = (cinfo->Ss == 0);
+
+ /* It's important not to apply jpeg_gen_optimal_table more than once
+ * per table, because it clobbers the input frequency counts!
+ */
+ MEMZERO(did, SIZEOF(did));
+
+ for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
+ compptr = cinfo->cur_comp_info[ci];
+ if (is_DC_band) {
+ if (cinfo->Ah != 0) /* DC refinement needs no table */
+ continue;
+ tbl = compptr->dc_tbl_no;
+ } else {
+ tbl = compptr->ac_tbl_no;
+ }
+ if (! did[tbl]) {
+ if (is_DC_band)
+ htblptr = & cinfo->dc_huff_tbl_ptrs[tbl];
+ else
+ htblptr = & cinfo->ac_huff_tbl_ptrs[tbl];
+ if (*htblptr == NULL)
+ *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);
+ jpeg_gen_optimal_table(cinfo, *htblptr, entropy->count_ptrs[tbl]);
+ did[tbl] = TRUE;
+ }
+ }
+}
+
+
+/*
+ * Module initialization routine for progressive Huffman entropy encoding.
+ */
+
+GLOBAL(void)
+jinit_phuff_encoder (j_compress_ptr cinfo)
+{
+ phuff_entropy_ptr entropy;
+ int i;
+
+ entropy = (phuff_entropy_ptr)
+ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ SIZEOF(phuff_entropy_encoder));
+ cinfo->entropy = (struct jpeg_entropy_encoder *) entropy;
+ entropy->pub.start_pass = start_pass_phuff;
+
+ /* Mark tables unallocated */
+ for (i = 0; i < NUM_HUFF_TBLS; i++) {
+ entropy->derived_tbls[i] = NULL;
+ entropy->count_ptrs[i] = NULL;
+ }
+ entropy->bit_buffer = NULL; /* needed only in AC refinement scan */
+}
+
+#endif /* C_PROGRESSIVE_SUPPORTED */
+
+#endif //_FX_JPEG_TURBO_
diff --git a/core/src/fxcodec/libjpeg/fpdfapi_jcprepct.c b/core/src/fxcodec/libjpeg/fpdfapi_jcprepct.c
index 539d87bbae..57f3fc1108 100644
--- a/core/src/fxcodec/libjpeg/fpdfapi_jcprepct.c
+++ b/core/src/fxcodec/libjpeg/fpdfapi_jcprepct.c
@@ -1,357 +1,357 @@
-#if !defined(_FX_JPEG_TURBO_)
-/*
- * jcprepct.c
- *
- * Copyright (C) 1994-1996, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- * For conditions of distribution and use, see the accompanying README file.
- *
- * This file contains the compression preprocessing controller.
- * This controller manages the color conversion, downsampling,
- * and edge expansion steps.
- *
- * Most of the complexity here is associated with buffering input rows
- * as required by the downsampler. See the comments at the head of
- * jcsample.c for the downsampler's needs.
- */
-
-#define JPEG_INTERNALS
-#include "jinclude.h"
-#include "jpeglib.h"
-
-
-/* At present, jcsample.c can request context rows only for smoothing.
- * In the future, we might also need context rows for CCIR601 sampling
- * or other more-complex downsampling procedures. The code to support
- * context rows should be compiled only if needed.
- */
-#ifdef INPUT_SMOOTHING_SUPPORTED
-#define CONTEXT_ROWS_SUPPORTED
-#endif
-
-
-/*
- * For the simple (no-context-row) case, we just need to buffer one
- * row group's worth of pixels for the downsampling step. At the bottom of
- * the image, we pad to a full row group by replicating the last pixel row.
- * The downsampler's last output row is then replicated if needed to pad
- * out to a full iMCU row.
- *
- * When providing context rows, we must buffer three row groups' worth of
- * pixels. Three row groups are physically allocated, but the row pointer
- * arrays are made five row groups high, with the extra pointers above and
- * below "wrapping around" to point to the last and first real row groups.
- * This allows the downsampler to access the proper context rows.
- * At the top and bottom of the image, we create dummy context rows by
- * copying the first or last real pixel row. This copying could be avoided
- * by pointer hacking as is done in jdmainct.c, but it doesn't seem worth the
- * trouble on the compression side.
- */
-
-
-/* Private buffer controller object */
-
-typedef struct {
- struct jpeg_c_prep_controller pub; /* public fields */
-
- /* Downsampling input buffer. This buffer holds color-converted data
- * until we have enough to do a downsample step.
- */
- JSAMPARRAY color_buf[MAX_COMPONENTS];
-
- JDIMENSION rows_to_go; /* counts rows remaining in source image */
- int next_buf_row; /* index of next row to store in color_buf */
-
-#ifdef CONTEXT_ROWS_SUPPORTED /* only needed for context case */
- int this_row_group; /* starting row index of group to process */
- int next_buf_stop; /* downsample when we reach this index */
-#endif
-} my_prep_controller;
-
-typedef my_prep_controller * my_prep_ptr;
-
-
-/*
- * Initialize for a processing pass.
- */
-
-METHODDEF(void)
-start_pass_prep (j_compress_ptr cinfo, J_BUF_MODE pass_mode)
-{
- my_prep_ptr prep = (my_prep_ptr) cinfo->prep;
-
- if (pass_mode != JBUF_PASS_THRU)
- ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
-
- /* Initialize total-height counter for detecting bottom of image */
- prep->rows_to_go = cinfo->image_height;
- /* Mark the conversion buffer empty */
- prep->next_buf_row = 0;
-#ifdef CONTEXT_ROWS_SUPPORTED
- /* Preset additional state variables for context mode.
- * These aren't used in non-context mode, so we needn't test which mode.
- */
- prep->this_row_group = 0;
- /* Set next_buf_stop to stop after two row groups have been read in. */
- prep->next_buf_stop = 2 * cinfo->max_v_samp_factor;
-#endif
-}
-
-
-/*
- * Expand an image vertically from height input_rows to height output_rows,
- * by duplicating the bottom row.
- */
-
-LOCAL(void)
-expand_bottom_edge (JSAMPARRAY image_data, JDIMENSION num_cols,
- int input_rows, int output_rows)
-{
- register int row;
-
- for (row = input_rows; row < output_rows; row++) {
- jcopy_sample_rows(image_data, input_rows-1, image_data, row,
- 1, num_cols);
- }
-}
-
-
-/*
- * Process some data in the simple no-context case.
- *
- * Preprocessor output data is counted in "row groups". A row group
- * is defined to be v_samp_factor sample rows of each component.
- * Downsampling will produce this much data from each max_v_samp_factor
- * input rows.
- */
-
-METHODDEF(void)
-pre_process_data (j_compress_ptr cinfo,
- JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,
- JDIMENSION in_rows_avail,
- JSAMPIMAGE output_buf, JDIMENSION *out_row_group_ctr,
- JDIMENSION out_row_groups_avail)
-{
- my_prep_ptr prep = (my_prep_ptr) cinfo->prep;
- int numrows, ci;
- JDIMENSION inrows;
- jpeg_component_info * compptr;
-
- while (*in_row_ctr < in_rows_avail &&
- *out_row_group_ctr < out_row_groups_avail) {
- /* Do color conversion to fill the conversion buffer. */
- inrows = in_rows_avail - *in_row_ctr;
- numrows = cinfo->max_v_samp_factor - prep->next_buf_row;
- numrows = (int) MIN((JDIMENSION) numrows, inrows);
- (*cinfo->cconvert->color_convert) (cinfo, input_buf + *in_row_ctr,
- prep->color_buf,
- (JDIMENSION) prep->next_buf_row,
- numrows);
- *in_row_ctr += numrows;
- prep->next_buf_row += numrows;
- prep->rows_to_go -= numrows;
- /* If at bottom of image, pad to fill the conversion buffer. */
- if (prep->rows_to_go == 0 &&
- prep->next_buf_row < cinfo->max_v_samp_factor) {
- for (ci = 0; ci < cinfo->num_components; ci++) {
- expand_bottom_edge(prep->color_buf[ci], cinfo->image_width,
- prep->next_buf_row, cinfo->max_v_samp_factor);
- }
- prep->next_buf_row = cinfo->max_v_samp_factor;
- }
- /* If we've filled the conversion buffer, empty it. */
- if (prep->next_buf_row == cinfo->max_v_samp_factor) {
- (*cinfo->downsample->downsample) (cinfo,
- prep->color_buf, (JDIMENSION) 0,
- output_buf, *out_row_group_ctr);
- prep->next_buf_row = 0;
- (*out_row_group_ctr)++;
- }
- /* If at bottom of image, pad the output to a full iMCU height.
- * Note we assume the caller is providing a one-iMCU-height output buffer!
- */
- if (prep->rows_to_go == 0 &&
- *out_row_group_ctr < out_row_groups_avail) {
- for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
- ci++, compptr++) {
- expand_bottom_edge(output_buf[ci],
- compptr->width_in_blocks * DCTSIZE,
- (int) (*out_row_group_ctr * compptr->v_samp_factor),
- (int) (out_row_groups_avail * compptr->v_samp_factor));
- }
- *out_row_group_ctr = out_row_groups_avail;
- break; /* can exit outer loop without test */
- }
- }
-}
-
-
-#ifdef CONTEXT_ROWS_SUPPORTED
-
-/*
- * Process some data in the context case.
- */
-
-METHODDEF(void)
-pre_process_context (j_compress_ptr cinfo,
- JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,
- JDIMENSION in_rows_avail,
- JSAMPIMAGE output_buf, JDIMENSION *out_row_group_ctr,
- JDIMENSION out_row_groups_avail)
-{
- my_prep_ptr prep = (my_prep_ptr) cinfo->prep;
- int numrows, ci;
- int buf_height = cinfo->max_v_samp_factor * 3;
- JDIMENSION inrows;
-
- while (*out_row_group_ctr < out_row_groups_avail) {
- if (*in_row_ctr < in_rows_avail) {
- /* Do color conversion to fill the conversion buffer. */
- inrows = in_rows_avail - *in_row_ctr;
- numrows = prep->next_buf_stop - prep->next_buf_row;
- numrows = (int) MIN((JDIMENSION) numrows, inrows);
- (*cinfo->cconvert->color_convert) (cinfo, input_buf + *in_row_ctr,
- prep->color_buf,
- (JDIMENSION) prep->next_buf_row,
- numrows);
- /* Pad at top of image, if first time through */
- if (prep->rows_to_go == cinfo->image_height) {
- for (ci = 0; ci < cinfo->num_components; ci++) {
- int row;
- for (row = 1; row <= cinfo->max_v_samp_factor; row++) {
- jcopy_sample_rows(prep->color_buf[ci], 0,
- prep->color_buf[ci], -row,
- 1, cinfo->image_width);
- }
- }
- }
- *in_row_ctr += numrows;
- prep->next_buf_row += numrows;
- prep->rows_to_go -= numrows;
- } else {
- /* Return for more data, unless we are at the bottom of the image. */
- if (prep->rows_to_go != 0)
- break;
- /* When at bottom of image, pad to fill the conversion buffer. */
- if (prep->next_buf_row < prep->next_buf_stop) {
- for (ci = 0; ci < cinfo->num_components; ci++) {
- expand_bottom_edge(prep->color_buf[ci], cinfo->image_width,
- prep->next_buf_row, prep->next_buf_stop);
- }
- prep->next_buf_row = prep->next_buf_stop;
- }
- }
- /* If we've gotten enough data, downsample a row group. */
- if (prep->next_buf_row == prep->next_buf_stop) {
- (*cinfo->downsample->downsample) (cinfo,
- prep->color_buf,
- (JDIMENSION) prep->this_row_group,
- output_buf, *out_row_group_ctr);
- (*out_row_group_ctr)++;
- /* Advance pointers with wraparound as necessary. */
- prep->this_row_group += cinfo->max_v_samp_factor;
- if (prep->this_row_group >= buf_height)
- prep->this_row_group = 0;
- if (prep->next_buf_row >= buf_height)
- prep->next_buf_row = 0;
- prep->next_buf_stop = prep->next_buf_row + cinfo->max_v_samp_factor;
- }
- }
-}
-
-
-/*
- * Create the wrapped-around downsampling input buffer needed for context mode.
- */
-
-LOCAL(void)
-create_context_buffer (j_compress_ptr cinfo)
-{
- my_prep_ptr prep = (my_prep_ptr) cinfo->prep;
- int rgroup_height = cinfo->max_v_samp_factor;
- int ci, i;
- jpeg_component_info * compptr;
- JSAMPARRAY true_buffer, fake_buffer;
-
- /* Grab enough space for fake row pointers for all the components;
- * we need five row groups' worth of pointers for each component.
- */
- fake_buffer = (JSAMPARRAY)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- (cinfo->num_components * 5 * rgroup_height) *
- SIZEOF(JSAMPROW));
-
- for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
- ci++, compptr++) {
- /* Allocate the actual buffer space (3 row groups) for this component.
- * We make the buffer wide enough to allow the downsampler to edge-expand
- * horizontally within the buffer, if it so chooses.
- */
- true_buffer = (*cinfo->mem->alloc_sarray)
- ((j_common_ptr) cinfo, JPOOL_IMAGE,
- (JDIMENSION) (((long) compptr->width_in_blocks * DCTSIZE *
- cinfo->max_h_samp_factor) / compptr->h_samp_factor),
- (JDIMENSION) (3 * rgroup_height));
- /* Copy true buffer row pointers into the middle of the fake row array */
- MEMCOPY(fake_buffer + rgroup_height, true_buffer,
- 3 * rgroup_height * SIZEOF(JSAMPROW));
- /* Fill in the above and below wraparound pointers */
- for (i = 0; i < rgroup_height; i++) {
- fake_buffer[i] = true_buffer[2 * rgroup_height + i];
- fake_buffer[4 * rgroup_height + i] = true_buffer[i];
- }
- prep->color_buf[ci] = fake_buffer + rgroup_height;
- fake_buffer += 5 * rgroup_height; /* point to space for next component */
- }
-}
-
-#endif /* CONTEXT_ROWS_SUPPORTED */
-
-
-/*
- * Initialize preprocessing controller.
- */
-
-GLOBAL(void)
-jinit_c_prep_controller (j_compress_ptr cinfo, boolean need_full_buffer)
-{
- my_prep_ptr prep;
- int ci;
- jpeg_component_info * compptr;
-
- if (need_full_buffer) /* safety check */
- ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
-
- prep = (my_prep_ptr)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- SIZEOF(my_prep_controller));
- cinfo->prep = (struct jpeg_c_prep_controller *) prep;
- prep->pub.start_pass = start_pass_prep;
-
- /* Allocate the color conversion buffer.
- * We make the buffer wide enough to allow the downsampler to edge-expand
- * horizontally within the buffer, if it so chooses.
- */
- if (cinfo->downsample->need_context_rows) {
- /* Set up to provide context rows */
-#ifdef CONTEXT_ROWS_SUPPORTED
- prep->pub.pre_process_data = pre_process_context;
- create_context_buffer(cinfo);
-#else
- ERREXIT(cinfo, JERR_NOT_COMPILED);
-#endif
- } else {
- /* No context, just make it tall enough for one row group */
- prep->pub.pre_process_data = pre_process_data;
- for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
- ci++, compptr++) {
- prep->color_buf[ci] = (*cinfo->mem->alloc_sarray)
- ((j_common_ptr) cinfo, JPOOL_IMAGE,
- (JDIMENSION) (((long) compptr->width_in_blocks * DCTSIZE *
- cinfo->max_h_samp_factor) / compptr->h_samp_factor),
- (JDIMENSION) cinfo->max_v_samp_factor);
- }
- }
-}
-
-#endif //_FX_JPEG_TURBO_
+#if !defined(_FX_JPEG_TURBO_)
+/*
+ * jcprepct.c
+ *
+ * Copyright (C) 1994-1996, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains the compression preprocessing controller.
+ * This controller manages the color conversion, downsampling,
+ * and edge expansion steps.
+ *
+ * Most of the complexity here is associated with buffering input rows
+ * as required by the downsampler. See the comments at the head of
+ * jcsample.c for the downsampler's needs.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+
+
+/* At present, jcsample.c can request context rows only for smoothing.
+ * In the future, we might also need context rows for CCIR601 sampling
+ * or other more-complex downsampling procedures. The code to support
+ * context rows should be compiled only if needed.
+ */
+#ifdef INPUT_SMOOTHING_SUPPORTED
+#define CONTEXT_ROWS_SUPPORTED
+#endif
+
+
+/*
+ * For the simple (no-context-row) case, we just need to buffer one
+ * row group's worth of pixels for the downsampling step. At the bottom of
+ * the image, we pad to a full row group by replicating the last pixel row.
+ * The downsampler's last output row is then replicated if needed to pad
+ * out to a full iMCU row.
+ *
+ * When providing context rows, we must buffer three row groups' worth of
+ * pixels. Three row groups are physically allocated, but the row pointer
+ * arrays are made five row groups high, with the extra pointers above and
+ * below "wrapping around" to point to the last and first real row groups.
+ * This allows the downsampler to access the proper context rows.
+ * At the top and bottom of the image, we create dummy context rows by
+ * copying the first or last real pixel row. This copying could be avoided
+ * by pointer hacking as is done in jdmainct.c, but it doesn't seem worth the
+ * trouble on the compression side.
+ */
+
+
+/* Private buffer controller object */
+
+typedef struct {
+ struct jpeg_c_prep_controller pub; /* public fields */
+
+ /* Downsampling input buffer. This buffer holds color-converted data
+ * until we have enough to do a downsample step.
+ */
+ JSAMPARRAY color_buf[MAX_COMPONENTS];
+
+ JDIMENSION rows_to_go; /* counts rows remaining in source image */
+ int next_buf_row; /* index of next row to store in color_buf */
+
+#ifdef CONTEXT_ROWS_SUPPORTED /* only needed for context case */
+ int this_row_group; /* starting row index of group to process */
+ int next_buf_stop; /* downsample when we reach this index */
+#endif
+} my_prep_controller;
+
+typedef my_prep_controller * my_prep_ptr;
+
+
+/*
+ * Initialize for a processing pass.
+ */
+
+METHODDEF(void)
+start_pass_prep (j_compress_ptr cinfo, J_BUF_MODE pass_mode)
+{
+ my_prep_ptr prep = (my_prep_ptr) cinfo->prep;
+
+ if (pass_mode != JBUF_PASS_THRU)
+ ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
+
+ /* Initialize total-height counter for detecting bottom of image */
+ prep->rows_to_go = cinfo->image_height;
+ /* Mark the conversion buffer empty */
+ prep->next_buf_row = 0;
+#ifdef CONTEXT_ROWS_SUPPORTED
+ /* Preset additional state variables for context mode.
+ * These aren't used in non-context mode, so we needn't test which mode.
+ */
+ prep->this_row_group = 0;
+ /* Set next_buf_stop to stop after two row groups have been read in. */
+ prep->next_buf_stop = 2 * cinfo->max_v_samp_factor;
+#endif
+}
+
+
+/*
+ * Expand an image vertically from height input_rows to height output_rows,
+ * by duplicating the bottom row.
+ */
+
+LOCAL(void)
+expand_bottom_edge (JSAMPARRAY image_data, JDIMENSION num_cols,
+ int input_rows, int output_rows)
+{
+ register int row;
+
+ for (row = input_rows; row < output_rows; row++) {
+ jcopy_sample_rows(image_data, input_rows-1, image_data, row,
+ 1, num_cols);
+ }
+}
+
+
+/*
+ * Process some data in the simple no-context case.
+ *
+ * Preprocessor output data is counted in "row groups". A row group
+ * is defined to be v_samp_factor sample rows of each component.
+ * Downsampling will produce this much data from each max_v_samp_factor
+ * input rows.
+ */
+
+METHODDEF(void)
+pre_process_data (j_compress_ptr cinfo,
+ JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,
+ JDIMENSION in_rows_avail,
+ JSAMPIMAGE output_buf, JDIMENSION *out_row_group_ctr,
+ JDIMENSION out_row_groups_avail)
+{
+ my_prep_ptr prep = (my_prep_ptr) cinfo->prep;
+ int numrows, ci;
+ JDIMENSION inrows;
+ jpeg_component_info * compptr;
+
+ while (*in_row_ctr < in_rows_avail &&
+ *out_row_group_ctr < out_row_groups_avail) {
+ /* Do color conversion to fill the conversion buffer. */
+ inrows = in_rows_avail - *in_row_ctr;
+ numrows = cinfo->max_v_samp_factor - prep->next_buf_row;
+ numrows = (int) MIN((JDIMENSION) numrows, inrows);
+ (*cinfo->cconvert->color_convert) (cinfo, input_buf + *in_row_ctr,
+ prep->color_buf,
+ (JDIMENSION) prep->next_buf_row,
+ numrows);
+ *in_row_ctr += numrows;
+ prep->next_buf_row += numrows;
+ prep->rows_to_go -= numrows;
+ /* If at bottom of image, pad to fill the conversion buffer. */
+ if (prep->rows_to_go == 0 &&
+ prep->next_buf_row < cinfo->max_v_samp_factor) {
+ for (ci = 0; ci < cinfo->num_components; ci++) {
+ expand_bottom_edge(prep->color_buf[ci], cinfo->image_width,
+ prep->next_buf_row, cinfo->max_v_samp_factor);
+ }
+ prep->next_buf_row = cinfo->max_v_samp_factor;
+ }
+ /* If we've filled the conversion buffer, empty it. */
+ if (prep->next_buf_row == cinfo->max_v_samp_factor) {
+ (*cinfo->downsample->downsample) (cinfo,
+ prep->color_buf, (JDIMENSION) 0,
+ output_buf, *out_row_group_ctr);
+ prep->next_buf_row = 0;
+ (*out_row_group_ctr)++;
+ }
+ /* If at bottom of image, pad the output to a full iMCU height.
+ * Note we assume the caller is providing a one-iMCU-height output buffer!
+ */
+ if (prep->rows_to_go == 0 &&
+ *out_row_group_ctr < out_row_groups_avail) {
+ for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+ ci++, compptr++) {
+ expand_bottom_edge(output_buf[ci],
+ compptr->width_in_blocks * DCTSIZE,
+ (int) (*out_row_group_ctr * compptr->v_samp_factor),
+ (int) (out_row_groups_avail * compptr->v_samp_factor));
+ }
+ *out_row_group_ctr = out_row_groups_avail;
+ break; /* can exit outer loop without test */
+ }
+ }
+}
+
+
+#ifdef CONTEXT_ROWS_SUPPORTED
+
+/*
+ * Process some data in the context case.
+ */
+
+METHODDEF(void)
+pre_process_context (j_compress_ptr cinfo,
+ JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,
+ JDIMENSION in_rows_avail,
+ JSAMPIMAGE output_buf, JDIMENSION *out_row_group_ctr,
+ JDIMENSION out_row_groups_avail)
+{
+ my_prep_ptr prep = (my_prep_ptr) cinfo->prep;
+ int numrows, ci;
+ int buf_height = cinfo->max_v_samp_factor * 3;
+ JDIMENSION inrows;
+
+ while (*out_row_group_ctr < out_row_groups_avail) {
+ if (*in_row_ctr < in_rows_avail) {
+ /* Do color conversion to fill the conversion buffer. */
+ inrows = in_rows_avail - *in_row_ctr;
+ numrows = prep->next_buf_stop - prep->next_buf_row;
+ numrows = (int) MIN((JDIMENSION) numrows, inrows);
+ (*cinfo->cconvert->color_convert) (cinfo, input_buf + *in_row_ctr,
+ prep->color_buf,
+ (JDIMENSION) prep->next_buf_row,
+ numrows);
+ /* Pad at top of image, if first time through */
+ if (prep->rows_to_go == cinfo->image_height) {
+ for (ci = 0; ci < cinfo->num_components; ci++) {
+ int row;
+ for (row = 1; row <= cinfo->max_v_samp_factor; row++) {
+ jcopy_sample_rows(prep->color_buf[ci], 0,
+ prep->color_buf[ci], -row,
+ 1, cinfo->image_width);
+ }
+ }
+ }
+ *in_row_ctr += numrows;
+ prep->next_buf_row += numrows;
+ prep->rows_to_go -= numrows;
+ } else {
+ /* Return for more data, unless we are at the bottom of the image. */
+ if (prep->rows_to_go != 0)
+ break;
+ /* When at bottom of image, pad to fill the conversion buffer. */
+ if (prep->next_buf_row < prep->next_buf_stop) {
+ for (ci = 0; ci < cinfo->num_components; ci++) {
+ expand_bottom_edge(prep->color_buf[ci], cinfo->image_width,
+ prep->next_buf_row, prep->next_buf_stop);
+ }
+ prep->next_buf_row = prep->next_buf_stop;
+ }
+ }
+ /* If we've gotten enough data, downsample a row group. */
+ if (prep->next_buf_row == prep->next_buf_stop) {
+ (*cinfo->downsample->downsample) (cinfo,
+ prep->color_buf,
+ (JDIMENSION) prep->this_row_group,
+ output_buf, *out_row_group_ctr);
+ (*out_row_group_ctr)++;
+ /* Advance pointers with wraparound as necessary. */
+ prep->this_row_group += cinfo->max_v_samp_factor;
+ if (prep->this_row_group >= buf_height)
+ prep->this_row_group = 0;
+ if (prep->next_buf_row >= buf_height)
+ prep->next_buf_row = 0;
+ prep->next_buf_stop = prep->next_buf_row + cinfo->max_v_samp_factor;
+ }
+ }
+}
+
+
+/*
+ * Create the wrapped-around downsampling input buffer needed for context mode.
+ */
+
+LOCAL(void)
+create_context_buffer (j_compress_ptr cinfo)
+{
+ my_prep_ptr prep = (my_prep_ptr) cinfo->prep;
+ int rgroup_height = cinfo->max_v_samp_factor;
+ int ci, i;
+ jpeg_component_info * compptr;
+ JSAMPARRAY true_buffer, fake_buffer;
+
+ /* Grab enough space for fake row pointers for all the components;
+ * we need five row groups' worth of pointers for each component.
+ */
+ fake_buffer = (JSAMPARRAY)
+ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ (cinfo->num_components * 5 * rgroup_height) *
+ SIZEOF(JSAMPROW));
+
+ for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+ ci++, compptr++) {
+ /* Allocate the actual buffer space (3 row groups) for this component.
+ * We make the buffer wide enough to allow the downsampler to edge-expand
+ * horizontally within the buffer, if it so chooses.
+ */
+ true_buffer = (*cinfo->mem->alloc_sarray)
+ ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ (JDIMENSION) (((long) compptr->width_in_blocks * DCTSIZE *
+ cinfo->max_h_samp_factor) / compptr->h_samp_factor),
+ (JDIMENSION) (3 * rgroup_height));
+ /* Copy true buffer row pointers into the middle of the fake row array */
+ MEMCOPY(fake_buffer + rgroup_height, true_buffer,
+ 3 * rgroup_height * SIZEOF(JSAMPROW));
+ /* Fill in the above and below wraparound pointers */
+ for (i = 0; i < rgroup_height; i++) {
+ fake_buffer[i] = true_buffer[2 * rgroup_height + i];
+ fake_buffer[4 * rgroup_height + i] = true_buffer[i];
+ }
+ prep->color_buf[ci] = fake_buffer + rgroup_height;
+ fake_buffer += 5 * rgroup_height; /* point to space for next component */
+ }
+}
+
+#endif /* CONTEXT_ROWS_SUPPORTED */
+
+
+/*
+ * Initialize preprocessing controller.
+ */
+
+GLOBAL(void)
+jinit_c_prep_controller (j_compress_ptr cinfo, boolean need_full_buffer)
+{
+ my_prep_ptr prep;
+ int ci;
+ jpeg_component_info * compptr;
+
+ if (need_full_buffer) /* safety check */
+ ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
+
+ prep = (my_prep_ptr)
+ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ SIZEOF(my_prep_controller));
+ cinfo->prep = (struct jpeg_c_prep_controller *) prep;
+ prep->pub.start_pass = start_pass_prep;
+
+ /* Allocate the color conversion buffer.
+ * We make the buffer wide enough to allow the downsampler to edge-expand
+ * horizontally within the buffer, if it so chooses.
+ */
+ if (cinfo->downsample->need_context_rows) {
+ /* Set up to provide context rows */
+#ifdef CONTEXT_ROWS_SUPPORTED
+ prep->pub.pre_process_data = pre_process_context;
+ create_context_buffer(cinfo);
+#else
+ ERREXIT(cinfo, JERR_NOT_COMPILED);
+#endif
+ } else {
+ /* No context, just make it tall enough for one row group */
+ prep->pub.pre_process_data = pre_process_data;
+ for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+ ci++, compptr++) {
+ prep->color_buf[ci] = (*cinfo->mem->alloc_sarray)
+ ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ (JDIMENSION) (((long) compptr->width_in_blocks * DCTSIZE *
+ cinfo->max_h_samp_factor) / compptr->h_samp_factor),
+ (JDIMENSION) cinfo->max_v_samp_factor);
+ }
+ }
+}
+
+#endif //_FX_JPEG_TURBO_
diff --git a/core/src/fxcodec/libjpeg/fpdfapi_jcsample.c b/core/src/fxcodec/libjpeg/fpdfapi_jcsample.c
index 7256bd7356..5e1e828740 100644
--- a/core/src/fxcodec/libjpeg/fpdfapi_jcsample.c
+++ b/core/src/fxcodec/libjpeg/fpdfapi_jcsample.c
@@ -1,522 +1,522 @@
-#if !defined(_FX_JPEG_TURBO_)
-/*
- * jcsample.c
- *
- * Copyright (C) 1991-1996, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- * For conditions of distribution and use, see the accompanying README file.
- *
- * This file contains downsampling routines.
- *
- * Downsampling input data is counted in "row groups". A row group
- * is defined to be max_v_samp_factor pixel rows of each component,
- * from which the downsampler produces v_samp_factor sample rows.
- * A single row group is processed in each call to the downsampler module.
- *
- * The downsampler is responsible for edge-expansion of its output data
- * to fill an integral number of DCT blocks horizontally. The source buffer
- * may be modified if it is helpful for this purpose (the source buffer is
- * allocated wide enough to correspond to the desired output width).
- * The caller (the prep controller) is responsible for vertical padding.
- *
- * The downsampler may request "context rows" by setting need_context_rows
- * during startup. In this case, the input arrays will contain at least
- * one row group's worth of pixels above and below the passed-in data;
- * the caller will create dummy rows at image top and bottom by replicating
- * the first or last real pixel row.
- *
- * An excellent reference for image resampling is
- * Digital Image Warping, George Wolberg, 1990.
- * Pub. by IEEE Computer Society Press, Los Alamitos, CA. ISBN 0-8186-8944-7.
- *
- * The downsampling algorithm used here is a simple average of the source
- * pixels covered by the output pixel. The hi-falutin sampling literature
- * refers to this as a "box filter". In general the characteristics of a box
- * filter are not very good, but for the specific cases we normally use (1:1
- * and 2:1 ratios) the box is equivalent to a "triangle filter" which is not
- * nearly so bad. If you intend to use other sampling ratios, you'd be well
- * advised to improve this code.
- *
- * A simple input-smoothing capability is provided. This is mainly intended
- * for cleaning up color-dithered GIF input files (if you find it inadequate,
- * we suggest using an external filtering program such as pnmconvol). When
- * enabled, each input pixel P is replaced by a weighted sum of itself and its
- * eight neighbors. P's weight is 1-8*SF and each neighbor's weight is SF,
- * where SF = (smoothing_factor / 1024).
- * Currently, smoothing is only supported for 2h2v sampling factors.
- */
-
-#define JPEG_INTERNALS
-#include "jinclude.h"
-#include "jpeglib.h"
-
-
-/* Pointer to routine to downsample a single component */
-typedef JMETHOD(void, downsample1_ptr,
- (j_compress_ptr cinfo, jpeg_component_info * compptr,
- JSAMPARRAY input_data, JSAMPARRAY output_data));
-
-/* Private subobject */
-
-typedef struct {
- struct jpeg_downsampler pub; /* public fields */
-
- /* Downsampling method pointers, one per component */
- downsample1_ptr methods[MAX_COMPONENTS];
-} my_downsampler;
-
-typedef my_downsampler * my_downsample_ptr;
-
-
-/*
- * Initialize for a downsampling pass.
- */
-
-METHODDEF(void)
-start_pass_downsample (j_compress_ptr cinfo)
-{
- /* no work for now */
-}
-
-
-/*
- * Expand a component horizontally from width input_cols to width output_cols,
- * by duplicating the rightmost samples.
- */
-
-LOCAL(void)
-expand_right_edge (JSAMPARRAY image_data, int num_rows,
- JDIMENSION input_cols, JDIMENSION output_cols)
-{
- register JSAMPROW ptr;
- register JSAMPLE pixval;
- register int count;
- int row;
- int numcols = (int) (output_cols - input_cols);
-
- if (numcols > 0) {
- for (row = 0; row < num_rows; row++) {
- ptr = image_data[row] + input_cols;
- pixval = ptr[-1]; /* don't need GETJSAMPLE() here */
- for (count = numcols; count > 0; count--)
- *ptr++ = pixval;
- }
- }
-}
-
-
-/*
- * Do downsampling for a whole row group (all components).
- *
- * In this version we simply downsample each component independently.
- */
-
-METHODDEF(void)
-sep_downsample (j_compress_ptr cinfo,
- JSAMPIMAGE input_buf, JDIMENSION in_row_index,
- JSAMPIMAGE output_buf, JDIMENSION out_row_group_index)
-{
- my_downsample_ptr downsample = (my_downsample_ptr) cinfo->downsample;
- int ci;
- jpeg_component_info * compptr;
- JSAMPARRAY in_ptr, out_ptr;
-
- for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
- ci++, compptr++) {
- in_ptr = input_buf[ci] + in_row_index;
- out_ptr = output_buf[ci] + (out_row_group_index * compptr->v_samp_factor);
- (*downsample->methods[ci]) (cinfo, compptr, in_ptr, out_ptr);
- }
-}
-
-
-/*
- * Downsample pixel values of a single component.
- * One row group is processed per call.
- * This version handles arbitrary integral sampling ratios, without smoothing.
- * Note that this version is not actually used for customary sampling ratios.
- */
-
-METHODDEF(void)
-int_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
- JSAMPARRAY input_data, JSAMPARRAY output_data)
-{
- int inrow, outrow, h_expand, v_expand, numpix, numpix2, h, v;
- JDIMENSION outcol, outcol_h; /* outcol_h == outcol*h_expand */
- JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE;
- JSAMPROW inptr, outptr;
- INT32 outvalue;
-
- h_expand = cinfo->max_h_samp_factor / compptr->h_samp_factor;
- v_expand = cinfo->max_v_samp_factor / compptr->v_samp_factor;
- numpix = h_expand * v_expand;
- numpix2 = numpix/2;
-
- /* Expand input data enough to let all the output samples be generated
- * by the standard loop. Special-casing padded output would be more
- * efficient.
- */
- expand_right_edge(input_data, cinfo->max_v_samp_factor,
- cinfo->image_width, output_cols * h_expand);
-
- inrow = 0;
- for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) {
- outptr = output_data[outrow];
- for (outcol = 0, outcol_h = 0; outcol < output_cols;
- outcol++, outcol_h += h_expand) {
- outvalue = 0;
- for (v = 0; v < v_expand; v++) {
- inptr = input_data[inrow+v] + outcol_h;
- for (h = 0; h < h_expand; h++) {
- outvalue += (INT32) GETJSAMPLE(*inptr++);
- }
- }
- *outptr++ = (JSAMPLE) ((outvalue + numpix2) / numpix);
- }
- inrow += v_expand;
- }
-}
-
-
-/*
- * Downsample pixel values of a single component.
- * This version handles the special case of a full-size component,
- * without smoothing.
- */
-
-METHODDEF(void)
-fullsize_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
- JSAMPARRAY input_data, JSAMPARRAY output_data)
-{
- /* Copy the data */
- jcopy_sample_rows(input_data, 0, output_data, 0,
- cinfo->max_v_samp_factor, cinfo->image_width);
- /* Edge-expand */
- expand_right_edge(output_data, cinfo->max_v_samp_factor,
- cinfo->image_width, compptr->width_in_blocks * DCTSIZE);
-}
-
-
-/*
- * Downsample pixel values of a single component.
- * This version handles the common case of 2:1 horizontal and 1:1 vertical,
- * without smoothing.
- *
- * A note about the "bias" calculations: when rounding fractional values to
- * integer, we do not want to always round 0.5 up to the next integer.
- * If we did that, we'd introduce a noticeable bias towards larger values.
- * Instead, this code is arranged so that 0.5 will be rounded up or down at
- * alternate pixel locations (a simple ordered dither pattern).
- */
-
-METHODDEF(void)
-h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
- JSAMPARRAY input_data, JSAMPARRAY output_data)
-{
- int outrow;
- JDIMENSION outcol;
- JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE;
- register JSAMPROW inptr, outptr;
- register int bias;
-
- /* Expand input data enough to let all the output samples be generated
- * by the standard loop. Special-casing padded output would be more
- * efficient.
- */
- expand_right_edge(input_data, cinfo->max_v_samp_factor,
- cinfo->image_width, output_cols * 2);
-
- for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) {
- outptr = output_data[outrow];
- inptr = input_data[outrow];
- bias = 0; /* bias = 0,1,0,1,... for successive samples */
- for (outcol = 0; outcol < output_cols; outcol++) {
- *outptr++ = (JSAMPLE) ((GETJSAMPLE(*inptr) + GETJSAMPLE(inptr[1])
- + bias) >> 1);
- bias ^= 1; /* 0=>1, 1=>0 */
- inptr += 2;
- }
- }
-}
-
-
-/*
- * Downsample pixel values of a single component.
- * This version handles the standard case of 2:1 horizontal and 2:1 vertical,
- * without smoothing.
- */
-
-METHODDEF(void)
-h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
- JSAMPARRAY input_data, JSAMPARRAY output_data)
-{
- int inrow, outrow;
- JDIMENSION outcol;
- JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE;
- register JSAMPROW inptr0, inptr1, outptr;
- register int bias;
-
- /* Expand input data enough to let all the output samples be generated
- * by the standard loop. Special-casing padded output would be more
- * efficient.
- */
- expand_right_edge(input_data, cinfo->max_v_samp_factor,
- cinfo->image_width, output_cols * 2);
-
- inrow = 0;
- for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) {
- outptr = output_data[outrow];
- inptr0 = input_data[inrow];
- inptr1 = input_data[inrow+1];
- bias = 1; /* bias = 1,2,1,2,... for successive samples */
- for (outcol = 0; outcol < output_cols; outcol++) {
- *outptr++ = (JSAMPLE) ((GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) +
- GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1])
- + bias) >> 2);
- bias ^= 3; /* 1=>2, 2=>1 */
- inptr0 += 2; inptr1 += 2;
- }
- inrow += 2;
- }
-}
-
-
-#ifdef INPUT_SMOOTHING_SUPPORTED
-
-/*
- * Downsample pixel values of a single component.
- * This version handles the standard case of 2:1 horizontal and 2:1 vertical,
- * with smoothing. One row of context is required.
- */
-
-METHODDEF(void)
-h2v2_smooth_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
- JSAMPARRAY input_data, JSAMPARRAY output_data)
-{
- int inrow, outrow;
- JDIMENSION colctr;
- JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE;
- register JSAMPROW inptr0, inptr1, above_ptr, below_ptr, outptr;
- INT32 membersum, neighsum, memberscale, neighscale;
-
- /* Expand input data enough to let all the output samples be generated
- * by the standard loop. Special-casing padded output would be more
- * efficient.
- */
- expand_right_edge(input_data - 1, cinfo->max_v_samp_factor + 2,
- cinfo->image_width, output_cols * 2);
-
- /* We don't bother to form the individual "smoothed" input pixel values;
- * we can directly compute the output which is the average of the four
- * smoothed values. Each of the four member pixels contributes a fraction
- * (1-8*SF) to its own smoothed image and a fraction SF to each of the three
- * other smoothed pixels, therefore a total fraction (1-5*SF)/4 to the final
- * output. The four corner-adjacent neighbor pixels contribute a fraction
- * SF to just one smoothed pixel, or SF/4 to the final output; while the
- * eight edge-adjacent neighbors contribute SF to each of two smoothed
- * pixels, or SF/2 overall. In order to use integer arithmetic, these
- * factors are scaled by 2^16 = 65536.
- * Also recall that SF = smoothing_factor / 1024.
- */
-
- memberscale = 16384 - cinfo->smoothing_factor * 80; /* scaled (1-5*SF)/4 */
- neighscale = cinfo->smoothing_factor * 16; /* scaled SF/4 */
-
- inrow = 0;
- for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) {
- outptr = output_data[outrow];
- inptr0 = input_data[inrow];
- inptr1 = input_data[inrow+1];
- above_ptr = input_data[inrow-1];
- below_ptr = input_data[inrow+2];
-
- /* Special case for first column: pretend column -1 is same as column 0 */
- membersum = GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) +
- GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]);
- neighsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[1]) +
- GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[1]) +
- GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[2]) +
- GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[2]);
- neighsum += neighsum;
- neighsum += GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[2]) +
- GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[2]);
- membersum = membersum * memberscale + neighsum * neighscale;
- *outptr++ = (JSAMPLE) ((membersum + 32768) >> 16);
- inptr0 += 2; inptr1 += 2; above_ptr += 2; below_ptr += 2;
-
- for (colctr = output_cols - 2; colctr > 0; colctr--) {
- /* sum of pixels directly mapped to this output element */
- membersum = GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) +
- GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]);
- /* sum of edge-neighbor pixels */
- neighsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[1]) +
- GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[1]) +
- GETJSAMPLE(inptr0[-1]) + GETJSAMPLE(inptr0[2]) +
- GETJSAMPLE(inptr1[-1]) + GETJSAMPLE(inptr1[2]);
- /* The edge-neighbors count twice as much as corner-neighbors */
- neighsum += neighsum;
- /* Add in the corner-neighbors */
- neighsum += GETJSAMPLE(above_ptr[-1]) + GETJSAMPLE(above_ptr[2]) +
- GETJSAMPLE(below_ptr[-1]) + GETJSAMPLE(below_ptr[2]);
- /* form final output scaled up by 2^16 */
- membersum = membersum * memberscale + neighsum * neighscale;
- /* round, descale and output it */
- *outptr++ = (JSAMPLE) ((membersum + 32768) >> 16);
- inptr0 += 2; inptr1 += 2; above_ptr += 2; below_ptr += 2;
- }
-
- /* Special case for last column */
- membersum = GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) +
- GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]);
- neighsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[1]) +
- GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[1]) +
- GETJSAMPLE(inptr0[-1]) + GETJSAMPLE(inptr0[1]) +
- GETJSAMPLE(inptr1[-1]) + GETJSAMPLE(inptr1[1]);
- neighsum += neighsum;
- neighsum += GETJSAMPLE(above_ptr[-1]) + GETJSAMPLE(above_ptr[1]) +
- GETJSAMPLE(below_ptr[-1]) + GETJSAMPLE(below_ptr[1]);
- membersum = membersum * memberscale + neighsum * neighscale;
- *outptr = (JSAMPLE) ((membersum + 32768) >> 16);
-
- inrow += 2;
- }
-}
-
-
-/*
- * Downsample pixel values of a single component.
- * This version handles the special case of a full-size component,
- * with smoothing. One row of context is required.
- */
-
-METHODDEF(void)
-fullsize_smooth_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr,
- JSAMPARRAY input_data, JSAMPARRAY output_data)
-{
- int outrow;
- JDIMENSION colctr;
- JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE;
- register JSAMPROW inptr, above_ptr, below_ptr, outptr;
- INT32 membersum, neighsum, memberscale, neighscale;
- int colsum, lastcolsum, nextcolsum;
-
- /* Expand input data enough to let all the output samples be generated
- * by the standard loop. Special-casing padded output would be more
- * efficient.
- */
- expand_right_edge(input_data - 1, cinfo->max_v_samp_factor + 2,
- cinfo->image_width, output_cols);
-
- /* Each of the eight neighbor pixels contributes a fraction SF to the
- * smoothed pixel, while the main pixel contributes (1-8*SF). In order
- * to use integer arithmetic, these factors are multiplied by 2^16 = 65536.
- * Also recall that SF = smoothing_factor / 1024.
- */
-
- memberscale = 65536L - cinfo->smoothing_factor * 512L; /* scaled 1-8*SF */
- neighscale = cinfo->smoothing_factor * 64; /* scaled SF */
-
- for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) {
- outptr = output_data[outrow];
- inptr = input_data[outrow];
- above_ptr = input_data[outrow-1];
- below_ptr = input_data[outrow+1];
-
- /* Special case for first column */
- colsum = GETJSAMPLE(*above_ptr++) + GETJSAMPLE(*below_ptr++) +
- GETJSAMPLE(*inptr);
- membersum = GETJSAMPLE(*inptr++);
- nextcolsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(*below_ptr) +
- GETJSAMPLE(*inptr);
- neighsum = colsum + (colsum - membersum) + nextcolsum;
- membersum = membersum * memberscale + neighsum * neighscale;
- *outptr++ = (JSAMPLE) ((membersum + 32768) >> 16);
- lastcolsum = colsum; colsum = nextcolsum;
-
- for (colctr = output_cols - 2; colctr > 0; colctr--) {
- membersum = GETJSAMPLE(*inptr++);
- above_ptr++; below_ptr++;
- nextcolsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(*below_ptr) +
- GETJSAMPLE(*inptr);
- neighsum = lastcolsum + (colsum - membersum) + nextcolsum;
- membersum = membersum * memberscale + neighsum * neighscale;
- *outptr++ = (JSAMPLE) ((membersum + 32768) >> 16);
- lastcolsum = colsum; colsum = nextcolsum;
- }
-
- /* Special case for last column */
- membersum = GETJSAMPLE(*inptr);
- neighsum = lastcolsum + (colsum - membersum) + colsum;
- membersum = membersum * memberscale + neighsum * neighscale;
- *outptr = (JSAMPLE) ((membersum + 32768) >> 16);
-
- }
-}
-
-#endif /* INPUT_SMOOTHING_SUPPORTED */
-
-
-/*
- * Module initialization routine for downsampling.
- * Note that we must select a routine for each component.
- */
-
-GLOBAL(void)
-jinit_downsampler (j_compress_ptr cinfo)
-{
- my_downsample_ptr downsample;
- int ci;
- jpeg_component_info * compptr;
- boolean smoothok = TRUE;
-
- downsample = (my_downsample_ptr)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- SIZEOF(my_downsampler));
- cinfo->downsample = (struct jpeg_downsampler *) downsample;
- downsample->pub.start_pass = start_pass_downsample;
- downsample->pub.downsample = sep_downsample;
- downsample->pub.need_context_rows = FALSE;
-
- if (cinfo->CCIR601_sampling)
- ERREXIT(cinfo, JERR_CCIR601_NOTIMPL);
-
- /* Verify we can handle the sampling factors, and set up method pointers */
- for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
- ci++, compptr++) {
- if (compptr->h_samp_factor == cinfo->max_h_samp_factor &&
- compptr->v_samp_factor == cinfo->max_v_samp_factor) {
-#ifdef INPUT_SMOOTHING_SUPPORTED
- if (cinfo->smoothing_factor) {
- downsample->methods[ci] = fullsize_smooth_downsample;
- downsample->pub.need_context_rows = TRUE;
- } else
-#endif
- downsample->methods[ci] = fullsize_downsample;
- } else if (compptr->h_samp_factor * 2 == cinfo->max_h_samp_factor &&
- compptr->v_samp_factor == cinfo->max_v_samp_factor) {
- smoothok = FALSE;
- downsample->methods[ci] = h2v1_downsample;
- } else if (compptr->h_samp_factor * 2 == cinfo->max_h_samp_factor &&
- compptr->v_samp_factor * 2 == cinfo->max_v_samp_factor) {
-#ifdef INPUT_SMOOTHING_SUPPORTED
- if (cinfo->smoothing_factor) {
- downsample->methods[ci] = h2v2_smooth_downsample;
- downsample->pub.need_context_rows = TRUE;
- } else
-#endif
- downsample->methods[ci] = h2v2_downsample;
- } else if ((cinfo->max_h_samp_factor % compptr->h_samp_factor) == 0 &&
- (cinfo->max_v_samp_factor % compptr->v_samp_factor) == 0) {
- smoothok = FALSE;
- downsample->methods[ci] = int_downsample;
- } else
- ERREXIT(cinfo, JERR_FRACT_SAMPLE_NOTIMPL);
- }
-
-#ifdef INPUT_SMOOTHING_SUPPORTED
- if (cinfo->smoothing_factor && !smoothok)
- TRACEMS(cinfo, 0, JTRC_SMOOTH_NOTIMPL);
-#endif
-}
-
-#endif //_FX_JPEG_TURBO_
+#if !defined(_FX_JPEG_TURBO_)
+/*
+ * jcsample.c
+ *
+ * Copyright (C) 1991-1996, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains downsampling routines.
+ *
+ * Downsampling input data is counted in "row groups". A row group
+ * is defined to be max_v_samp_factor pixel rows of each component,
+ * from which the downsampler produces v_samp_factor sample rows.
+ * A single row group is processed in each call to the downsampler module.
+ *
+ * The downsampler is responsible for edge-expansion of its output data
+ * to fill an integral number of DCT blocks horizontally. The source buffer
+ * may be modified if it is helpful for this purpose (the source buffer is
+ * allocated wide enough to correspond to the desired output width).
+ * The caller (the prep controller) is responsible for vertical padding.
+ *
+ * The downsampler may request "context rows" by setting need_context_rows
+ * during startup. In this case, the input arrays will contain at least
+ * one row group's worth of pixels above and below the passed-in data;
+ * the caller will create dummy rows at image top and bottom by replicating
+ * the first or last real pixel row.
+ *
+ * An excellent reference for image resampling is
+ * Digital Image Warping, George Wolberg, 1990.
+ * Pub. by IEEE Computer Society Press, Los Alamitos, CA. ISBN 0-8186-8944-7.
+ *
+ * The downsampling algorithm used here is a simple average of the source
+ * pixels covered by the output pixel. The hi-falutin sampling literature
+ * refers to this as a "box filter". In general the characteristics of a box
+ * filter are not very good, but for the specific cases we normally use (1:1
+ * and 2:1 ratios) the box is equivalent to a "triangle filter" which is not
+ * nearly so bad. If you intend to use other sampling ratios, you'd be well
+ * advised to improve this code.
+ *
+ * A simple input-smoothing capability is provided. This is mainly intended
+ * for cleaning up color-dithered GIF input files (if you find it inadequate,
+ * we suggest using an external filtering program such as pnmconvol). When
+ * enabled, each input pixel P is replaced by a weighted sum of itself and its
+ * eight neighbors. P's weight is 1-8*SF and each neighbor's weight is SF,
+ * where SF = (smoothing_factor / 1024).
+ * Currently, smoothing is only supported for 2h2v sampling factors.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+
+
+/* Pointer to routine to downsample a single component */
+typedef JMETHOD(void, downsample1_ptr,
+ (j_compress_ptr cinfo, jpeg_component_info * compptr,
+ JSAMPARRAY input_data, JSAMPARRAY output_data));
+
+/* Private subobject */
+
+typedef struct {
+ struct jpeg_downsampler pub; /* public fields */
+
+ /* Downsampling method pointers, one per component */
+ downsample1_ptr methods[MAX_COMPONENTS];
+} my_downsampler;
+
+typedef my_downsampler * my_downsample_ptr;
+
+
+/*
+ * Initialize for a downsampling pass.
+ */
+
+METHODDEF(void)
+start_pass_downsample (j_compress_ptr cinfo)
+{
+ /* no work for now */
+}
+
+
+/*
+ * Expand a component horizontally from width input_cols to width output_cols,
+ * by duplicating the rightmost samples.
+ */
+
+LOCAL(void)
+expand_right_edge (JSAMPARRAY image_data, int num_rows,
+ JDIMENSION input_cols, JDIMENSION output_cols)
+{
+ register JSAMPROW ptr;
+ register JSAMPLE pixval;
+ register int count;
+ int row;
+ int numcols = (int) (output_cols - input_cols);
+
+ if (numcols > 0) {
+ for (row = 0; row < num_rows; row++) {
+ ptr = image_data[row] + input_cols;
+ pixval = ptr[-1]; /* don't need GETJSAMPLE() here */
+ for (count = numcols; count > 0; count--)
+ *ptr++ = pixval;
+ }
+ }
+}
+
+
+/*
+ * Do downsampling for a whole row group (all components).
+ *
+ * In this version we simply downsample each component independently.
+ */
+
+METHODDEF(void)
+sep_downsample (j_compress_ptr cinfo,
+ JSAMPIMAGE input_buf, JDIMENSION in_row_index,
+ JSAMPIMAGE output_buf, JDIMENSION out_row_group_index)
+{
+ my_downsample_ptr downsample = (my_downsample_ptr) cinfo->downsample;
+ int ci;
+ jpeg_component_info * compptr;
+ JSAMPARRAY in_ptr, out_ptr;
+
+ for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+ ci++, compptr++) {
+ in_ptr = input_buf[ci] + in_row_index;
+ out_ptr = output_buf[ci] + (out_row_group_index * compptr->v_samp_factor);
+ (*downsample->methods[ci]) (cinfo, compptr, in_ptr, out_ptr);
+ }
+}
+
+
+/*
+ * Downsample pixel values of a single component.
+ * One row group is processed per call.
+ * This version handles arbitrary integral sampling ratios, without smoothing.
+ * Note that this version is not actually used for customary sampling ratios.
+ */
+
+METHODDEF(void)
+int_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
+ JSAMPARRAY input_data, JSAMPARRAY output_data)
+{
+ int inrow, outrow, h_expand, v_expand, numpix, numpix2, h, v;
+ JDIMENSION outcol, outcol_h; /* outcol_h == outcol*h_expand */
+ JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE;
+ JSAMPROW inptr, outptr;
+ INT32 outvalue;
+
+ h_expand = cinfo->max_h_samp_factor / compptr->h_samp_factor;
+ v_expand = cinfo->max_v_samp_factor / compptr->v_samp_factor;
+ numpix = h_expand * v_expand;
+ numpix2 = numpix/2;
+
+ /* Expand input data enough to let all the output samples be generated
+ * by the standard loop. Special-casing padded output would be more
+ * efficient.
+ */
+ expand_right_edge(input_data, cinfo->max_v_samp_factor,
+ cinfo->image_width, output_cols * h_expand);
+
+ inrow = 0;
+ for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) {
+ outptr = output_data[outrow];
+ for (outcol = 0, outcol_h = 0; outcol < output_cols;
+ outcol++, outcol_h += h_expand) {
+ outvalue = 0;
+ for (v = 0; v < v_expand; v++) {
+ inptr = input_data[inrow+v] + outcol_h;
+ for (h = 0; h < h_expand; h++) {
+ outvalue += (INT32) GETJSAMPLE(*inptr++);
+ }
+ }
+ *outptr++ = (JSAMPLE) ((outvalue + numpix2) / numpix);
+ }
+ inrow += v_expand;
+ }
+}
+
+
+/*
+ * Downsample pixel values of a single component.
+ * This version handles the special case of a full-size component,
+ * without smoothing.
+ */
+
+METHODDEF(void)
+fullsize_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
+ JSAMPARRAY input_data, JSAMPARRAY output_data)
+{
+ /* Copy the data */
+ jcopy_sample_rows(input_data, 0, output_data, 0,
+ cinfo->max_v_samp_factor, cinfo->image_width);
+ /* Edge-expand */
+ expand_right_edge(output_data, cinfo->max_v_samp_factor,
+ cinfo->image_width, compptr->width_in_blocks * DCTSIZE);
+}
+
+
+/*
+ * Downsample pixel values of a single component.
+ * This version handles the common case of 2:1 horizontal and 1:1 vertical,
+ * without smoothing.
+ *
+ * A note about the "bias" calculations: when rounding fractional values to
+ * integer, we do not want to always round 0.5 up to the next integer.
+ * If we did that, we'd introduce a noticeable bias towards larger values.
+ * Instead, this code is arranged so that 0.5 will be rounded up or down at
+ * alternate pixel locations (a simple ordered dither pattern).
+ */
+
+METHODDEF(void)
+h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
+ JSAMPARRAY input_data, JSAMPARRAY output_data)
+{
+ int outrow;
+ JDIMENSION outcol;
+ JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE;
+ register JSAMPROW inptr, outptr;
+ register int bias;
+
+ /* Expand input data enough to let all the output samples be generated
+ * by the standard loop. Special-casing padded output would be more
+ * efficient.
+ */
+ expand_right_edge(input_data, cinfo->max_v_samp_factor,
+ cinfo->image_width, output_cols * 2);
+
+ for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) {
+ outptr = output_data[outrow];
+ inptr = input_data[outrow];
+ bias = 0; /* bias = 0,1,0,1,... for successive samples */
+ for (outcol = 0; outcol < output_cols; outcol++) {
+ *outptr++ = (JSAMPLE) ((GETJSAMPLE(*inptr) + GETJSAMPLE(inptr[1])
+ + bias) >> 1);
+ bias ^= 1; /* 0=>1, 1=>0 */
+ inptr += 2;
+ }
+ }
+}
+
+
+/*
+ * Downsample pixel values of a single component.
+ * This version handles the standard case of 2:1 horizontal and 2:1 vertical,
+ * without smoothing.
+ */
+
+METHODDEF(void)
+h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
+ JSAMPARRAY input_data, JSAMPARRAY output_data)
+{
+ int inrow, outrow;
+ JDIMENSION outcol;
+ JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE;
+ register JSAMPROW inptr0, inptr1, outptr;
+ register int bias;
+
+ /* Expand input data enough to let all the output samples be generated
+ * by the standard loop. Special-casing padded output would be more
+ * efficient.
+ */
+ expand_right_edge(input_data, cinfo->max_v_samp_factor,
+ cinfo->image_width, output_cols * 2);
+
+ inrow = 0;
+ for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) {
+ outptr = output_data[outrow];
+ inptr0 = input_data[inrow];
+ inptr1 = input_data[inrow+1];
+ bias = 1; /* bias = 1,2,1,2,... for successive samples */
+ for (outcol = 0; outcol < output_cols; outcol++) {
+ *outptr++ = (JSAMPLE) ((GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) +
+ GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1])
+ + bias) >> 2);
+ bias ^= 3; /* 1=>2, 2=>1 */
+ inptr0 += 2; inptr1 += 2;
+ }
+ inrow += 2;
+ }
+}
+
+
+#ifdef INPUT_SMOOTHING_SUPPORTED
+
+/*
+ * Downsample pixel values of a single component.
+ * This version handles the standard case of 2:1 horizontal and 2:1 vertical,
+ * with smoothing. One row of context is required.
+ */
+
+METHODDEF(void)
+h2v2_smooth_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
+ JSAMPARRAY input_data, JSAMPARRAY output_data)
+{
+ int inrow, outrow;
+ JDIMENSION colctr;
+ JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE;
+ register JSAMPROW inptr0, inptr1, above_ptr, below_ptr, outptr;
+ INT32 membersum, neighsum, memberscale, neighscale;
+
+ /* Expand input data enough to let all the output samples be generated
+ * by the standard loop. Special-casing padded output would be more
+ * efficient.
+ */
+ expand_right_edge(input_data - 1, cinfo->max_v_samp_factor + 2,
+ cinfo->image_width, output_cols * 2);
+
+ /* We don't bother to form the individual "smoothed" input pixel values;
+ * we can directly compute the output which is the average of the four
+ * smoothed values. Each of the four member pixels contributes a fraction
+ * (1-8*SF) to its own smoothed image and a fraction SF to each of the three
+ * other smoothed pixels, therefore a total fraction (1-5*SF)/4 to the final
+ * output. The four corner-adjacent neighbor pixels contribute a fraction
+ * SF to just one smoothed pixel, or SF/4 to the final output; while the
+ * eight edge-adjacent neighbors contribute SF to each of two smoothed
+ * pixels, or SF/2 overall. In order to use integer arithmetic, these
+ * factors are scaled by 2^16 = 65536.
+ * Also recall that SF = smoothing_factor / 1024.
+ */
+
+ memberscale = 16384 - cinfo->smoothing_factor * 80; /* scaled (1-5*SF)/4 */
+ neighscale = cinfo->smoothing_factor * 16; /* scaled SF/4 */
+
+ inrow = 0;
+ for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) {
+ outptr = output_data[outrow];
+ inptr0 = input_data[inrow];
+ inptr1 = input_data[inrow+1];
+ above_ptr = input_data[inrow-1];
+ below_ptr = input_data[inrow+2];
+
+ /* Special case for first column: pretend column -1 is same as column 0 */
+ membersum = GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) +
+ GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]);
+ neighsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[1]) +
+ GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[1]) +
+ GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[2]) +
+ GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[2]);
+ neighsum += neighsum;
+ neighsum += GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[2]) +
+ GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[2]);
+ membersum = membersum * memberscale + neighsum * neighscale;
+ *outptr++ = (JSAMPLE) ((membersum + 32768) >> 16);
+ inptr0 += 2; inptr1 += 2; above_ptr += 2; below_ptr += 2;
+
+ for (colctr = output_cols - 2; colctr > 0; colctr--) {
+ /* sum of pixels directly mapped to this output element */
+ membersum = GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) +
+ GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]);
+ /* sum of edge-neighbor pixels */
+ neighsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[1]) +
+ GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[1]) +
+ GETJSAMPLE(inptr0[-1]) + GETJSAMPLE(inptr0[2]) +
+ GETJSAMPLE(inptr1[-1]) + GETJSAMPLE(inptr1[2]);
+ /* The edge-neighbors count twice as much as corner-neighbors */
+ neighsum += neighsum;
+ /* Add in the corner-neighbors */
+ neighsum += GETJSAMPLE(above_ptr[-1]) + GETJSAMPLE(above_ptr[2]) +
+ GETJSAMPLE(below_ptr[-1]) + GETJSAMPLE(below_ptr[2]);
+ /* form final output scaled up by 2^16 */
+ membersum = membersum * memberscale + neighsum * neighscale;
+ /* round, descale and output it */
+ *outptr++ = (JSAMPLE) ((membersum + 32768) >> 16);
+ inptr0 += 2; inptr1 += 2; above_ptr += 2; below_ptr += 2;
+ }
+
+ /* Special case for last column */
+ membersum = GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) +
+ GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]);
+ neighsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[1]) +
+ GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[1]) +
+ GETJSAMPLE(inptr0[-1]) + GETJSAMPLE(inptr0[1]) +
+ GETJSAMPLE(inptr1[-1]) + GETJSAMPLE(inptr1[1]);
+ neighsum += neighsum;
+ neighsum += GETJSAMPLE(above_ptr[-1]) + GETJSAMPLE(above_ptr[1]) +
+ GETJSAMPLE(below_ptr[-1]) + GETJSAMPLE(below_ptr[1]);
+ membersum = membersum * memberscale + neighsum * neighscale;
+ *outptr = (JSAMPLE) ((membersum + 32768) >> 16);
+
+ inrow += 2;
+ }
+}
+
+
+/*
+ * Downsample pixel values of a single component.
+ * This version handles the special case of a full-size component,
+ * with smoothing. One row of context is required.
+ */
+
+METHODDEF(void)
+fullsize_smooth_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr,
+ JSAMPARRAY input_data, JSAMPARRAY output_data)
+{
+ int outrow;
+ JDIMENSION colctr;
+ JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE;
+ register JSAMPROW inptr, above_ptr, below_ptr, outptr;
+ INT32 membersum, neighsum, memberscale, neighscale;
+ int colsum, lastcolsum, nextcolsum;
+
+ /* Expand input data enough to let all the output samples be generated
+ * by the standard loop. Special-casing padded output would be more
+ * efficient.
+ */
+ expand_right_edge(input_data - 1, cinfo->max_v_samp_factor + 2,
+ cinfo->image_width, output_cols);
+
+ /* Each of the eight neighbor pixels contributes a fraction SF to the
+ * smoothed pixel, while the main pixel contributes (1-8*SF). In order
+ * to use integer arithmetic, these factors are multiplied by 2^16 = 65536.
+ * Also recall that SF = smoothing_factor / 1024.
+ */
+
+ memberscale = 65536L - cinfo->smoothing_factor * 512L; /* scaled 1-8*SF */
+ neighscale = cinfo->smoothing_factor * 64; /* scaled SF */
+
+ for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) {
+ outptr = output_data[outrow];
+ inptr = input_data[outrow];
+ above_ptr = input_data[outrow-1];
+ below_ptr = input_data[outrow+1];
+
+ /* Special case for first column */
+ colsum = GETJSAMPLE(*above_ptr++) + GETJSAMPLE(*below_ptr++) +
+ GETJSAMPLE(*inptr);
+ membersum = GETJSAMPLE(*inptr++);
+ nextcolsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(*below_ptr) +
+ GETJSAMPLE(*inptr);
+ neighsum = colsum + (colsum - membersum) + nextcolsum;
+ membersum = membersum * memberscale + neighsum * neighscale;
+ *outptr++ = (JSAMPLE) ((membersum + 32768) >> 16);
+ lastcolsum = colsum; colsum = nextcolsum;
+
+ for (colctr = output_cols - 2; colctr > 0; colctr--) {
+ membersum = GETJSAMPLE(*inptr++);
+ above_ptr++; below_ptr++;
+ nextcolsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(*below_ptr) +
+ GETJSAMPLE(*inptr);
+ neighsum = lastcolsum + (colsum - membersum) + nextcolsum;
+ membersum = membersum * memberscale + neighsum * neighscale;
+ *outptr++ = (JSAMPLE) ((membersum + 32768) >> 16);
+ lastcolsum = colsum; colsum = nextcolsum;
+ }
+
+ /* Special case for last column */
+ membersum = GETJSAMPLE(*inptr);
+ neighsum = lastcolsum + (colsum - membersum) + colsum;
+ membersum = membersum * memberscale + neighsum * neighscale;
+ *outptr = (JSAMPLE) ((membersum + 32768) >> 16);
+
+ }
+}
+
+#endif /* INPUT_SMOOTHING_SUPPORTED */
+
+
+/*
+ * Module initialization routine for downsampling.
+ * Note that we must select a routine for each component.
+ */
+
+GLOBAL(void)
+jinit_downsampler (j_compress_ptr cinfo)
+{
+ my_downsample_ptr downsample;
+ int ci;
+ jpeg_component_info * compptr;
+ boolean smoothok = TRUE;
+
+ downsample = (my_downsample_ptr)
+ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ SIZEOF(my_downsampler));
+ cinfo->downsample = (struct jpeg_downsampler *) downsample;
+ downsample->pub.start_pass = start_pass_downsample;
+ downsample->pub.downsample = sep_downsample;
+ downsample->pub.need_context_rows = FALSE;
+
+ if (cinfo->CCIR601_sampling)
+ ERREXIT(cinfo, JERR_CCIR601_NOTIMPL);
+
+ /* Verify we can handle the sampling factors, and set up method pointers */
+ for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+ ci++, compptr++) {
+ if (compptr->h_samp_factor == cinfo->max_h_samp_factor &&
+ compptr->v_samp_factor == cinfo->max_v_samp_factor) {
+#ifdef INPUT_SMOOTHING_SUPPORTED
+ if (cinfo->smoothing_factor) {
+ downsample->methods[ci] = fullsize_smooth_downsample;
+ downsample->pub.need_context_rows = TRUE;
+ } else
+#endif
+ downsample->methods[ci] = fullsize_downsample;
+ } else if (compptr->h_samp_factor * 2 == cinfo->max_h_samp_factor &&
+ compptr->v_samp_factor == cinfo->max_v_samp_factor) {
+ smoothok = FALSE;
+ downsample->methods[ci] = h2v1_downsample;
+ } else if (compptr->h_samp_factor * 2 == cinfo->max_h_samp_factor &&
+ compptr->v_samp_factor * 2 == cinfo->max_v_samp_factor) {
+#ifdef INPUT_SMOOTHING_SUPPORTED
+ if (cinfo->smoothing_factor) {
+ downsample->methods[ci] = h2v2_smooth_downsample;
+ downsample->pub.need_context_rows = TRUE;
+ } else
+#endif
+ downsample->methods[ci] = h2v2_downsample;
+ } else if ((cinfo->max_h_samp_factor % compptr->h_samp_factor) == 0 &&
+ (cinfo->max_v_samp_factor % compptr->v_samp_factor) == 0) {
+ smoothok = FALSE;
+ downsample->methods[ci] = int_downsample;
+ } else
+ ERREXIT(cinfo, JERR_FRACT_SAMPLE_NOTIMPL);
+ }
+
+#ifdef INPUT_SMOOTHING_SUPPORTED
+ if (cinfo->smoothing_factor && !smoothok)
+ TRACEMS(cinfo, 0, JTRC_SMOOTH_NOTIMPL);
+#endif
+}
+
+#endif //_FX_JPEG_TURBO_
diff --git a/core/src/fxcodec/libjpeg/fpdfapi_jctrans.c b/core/src/fxcodec/libjpeg/fpdfapi_jctrans.c
index ed541159f1..40d166736b 100644
--- a/core/src/fxcodec/libjpeg/fpdfapi_jctrans.c
+++ b/core/src/fxcodec/libjpeg/fpdfapi_jctrans.c
@@ -1,391 +1,391 @@
-#if !defined(_FX_JPEG_TURBO_)
-/*
- * jctrans.c
- *
- * Copyright (C) 1995-1998, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- * For conditions of distribution and use, see the accompanying README file.
- *
- * This file contains library routines for transcoding compression,
- * that is, writing raw DCT coefficient arrays to an output JPEG file.
- * The routines in jcapimin.c will also be needed by a transcoder.
- */
-
-#define JPEG_INTERNALS
-#include "jinclude.h"
-#include "jpeglib.h"
-
-
-/* Forward declarations */
-LOCAL(void) transencode_master_selection
- JPP((j_compress_ptr cinfo, jvirt_barray_ptr * coef_arrays));
-LOCAL(void) transencode_coef_controller
- JPP((j_compress_ptr cinfo, jvirt_barray_ptr * coef_arrays));
-
-
-/*
- * Compression initialization for writing raw-coefficient data.
- * Before calling this, all parameters and a data destination must be set up.
- * Call jpeg_finish_compress() to actually write the data.
- *
- * The number of passed virtual arrays must match cinfo->num_components.
- * Note that the virtual arrays need not be filled or even realized at
- * the time write_coefficients is called; indeed, if the virtual arrays
- * were requested from this compression object's memory manager, they
- * typically will be realized during this routine and filled afterwards.
- */
-
-GLOBAL(void)
-jpeg_write_coefficients (j_compress_ptr cinfo, jvirt_barray_ptr * coef_arrays)
-{
- if (cinfo->global_state != CSTATE_START)
- ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
- /* Mark all tables to be written */
- jpeg_suppress_tables(cinfo, FALSE);
- /* (Re)initialize error mgr and destination modules */
- (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo);
- (*cinfo->dest->init_destination) (cinfo);
- /* Perform master selection of active modules */
- transencode_master_selection(cinfo, coef_arrays);
- /* Wait for jpeg_finish_compress() call */
- cinfo->next_scanline = 0; /* so jpeg_write_marker works */
- cinfo->global_state = CSTATE_WRCOEFS;
-}
-
-
-/*
- * Initialize the compression object with default parameters,
- * then copy from the source object all parameters needed for lossless
- * transcoding. Parameters that can be varied without loss (such as
- * scan script and Huffman optimization) are left in their default states.
- */
-
-GLOBAL(void)
-jpeg_copy_critical_parameters (j_decompress_ptr srcinfo,
- j_compress_ptr dstinfo)
-{
- JQUANT_TBL ** qtblptr;
- jpeg_component_info *incomp, *outcomp;
- JQUANT_TBL *c_quant, *slot_quant;
- int tblno, ci, coefi;
-
- /* Safety check to ensure start_compress not called yet. */
- if (dstinfo->global_state != CSTATE_START)
- ERREXIT1(dstinfo, JERR_BAD_STATE, dstinfo->global_state);
- /* Copy fundamental image dimensions */
- dstinfo->image_width = srcinfo->image_width;
- dstinfo->image_height = srcinfo->image_height;
- dstinfo->input_components = srcinfo->num_components;
- dstinfo->in_color_space = srcinfo->jpeg_color_space;
- /* Initialize all parameters to default values */
- jpeg_set_defaults(dstinfo);
- /* jpeg_set_defaults may choose wrong colorspace, eg YCbCr if input is RGB.
- * Fix it to get the right header markers for the image colorspace.
- */
- jpeg_set_colorspace(dstinfo, srcinfo->jpeg_color_space);
- dstinfo->data_precision = srcinfo->data_precision;
- dstinfo->CCIR601_sampling = srcinfo->CCIR601_sampling;
- /* Copy the source's quantization tables. */
- for (tblno = 0; tblno < NUM_QUANT_TBLS; tblno++) {
- if (srcinfo->quant_tbl_ptrs[tblno] != NULL) {
- qtblptr = & dstinfo->quant_tbl_ptrs[tblno];
- if (*qtblptr == NULL)
- *qtblptr = jpeg_alloc_quant_table((j_common_ptr) dstinfo);
- MEMCOPY((*qtblptr)->quantval,
- srcinfo->quant_tbl_ptrs[tblno]->quantval,
- SIZEOF((*qtblptr)->quantval));
- (*qtblptr)->sent_table = FALSE;
- }
- }
- /* Copy the source's per-component info.
- * Note we assume jpeg_set_defaults has allocated the dest comp_info array.
- */
- dstinfo->num_components = srcinfo->num_components;
- if (dstinfo->num_components < 1 || dstinfo->num_components > MAX_COMPONENTS)
- ERREXIT2(dstinfo, JERR_COMPONENT_COUNT, dstinfo->num_components,
- MAX_COMPONENTS);
- for (ci = 0, incomp = srcinfo->comp_info, outcomp = dstinfo->comp_info;
- ci < dstinfo->num_components; ci++, incomp++, outcomp++) {
- outcomp->component_id = incomp->component_id;
- outcomp->h_samp_factor = incomp->h_samp_factor;
- outcomp->v_samp_factor = incomp->v_samp_factor;
- outcomp->quant_tbl_no = incomp->quant_tbl_no;
- /* Make sure saved quantization table for component matches the qtable
- * slot. If not, the input file re-used this qtable slot.
- * IJG encoder currently cannot duplicate this.
- */
- tblno = outcomp->quant_tbl_no;
- if (tblno < 0 || tblno >= NUM_QUANT_TBLS ||
- srcinfo->quant_tbl_ptrs[tblno] == NULL)
- ERREXIT1(dstinfo, JERR_NO_QUANT_TABLE, tblno);
- slot_quant = srcinfo->quant_tbl_ptrs[tblno];
- c_quant = incomp->quant_table;
- if (c_quant != NULL) {
- for (coefi = 0; coefi < DCTSIZE2; coefi++) {
- if (c_quant->quantval[coefi] != slot_quant->quantval[coefi])
- ERREXIT1(dstinfo, JERR_MISMATCHED_QUANT_TABLE, tblno);
- }
- }
- /* Note: we do not copy the source's Huffman table assignments;
- * instead we rely on jpeg_set_colorspace to have made a suitable choice.
- */
- }
- /* Also copy JFIF version and resolution information, if available.
- * Strictly speaking this isn't "critical" info, but it's nearly
- * always appropriate to copy it if available. In particular,
- * if the application chooses to copy JFIF 1.02 extension markers from
- * the source file, we need to copy the version to make sure we don't
- * emit a file that has 1.02 extensions but a claimed version of 1.01.
- * We will *not*, however, copy version info from mislabeled "2.01" files.
- */
- if (srcinfo->saw_JFIF_marker) {
- if (srcinfo->JFIF_major_version == 1) {
- dstinfo->JFIF_major_version = srcinfo->JFIF_major_version;
- dstinfo->JFIF_minor_version = srcinfo->JFIF_minor_version;
- }
- dstinfo->density_unit = srcinfo->density_unit;
- dstinfo->X_density = srcinfo->X_density;
- dstinfo->Y_density = srcinfo->Y_density;
- }
-}
-
-
-/*
- * Master selection of compression modules for transcoding.
- * This substitutes for jcinit.c's initialization of the full compressor.
- */
-
-LOCAL(void)
-transencode_master_selection (j_compress_ptr cinfo,
- jvirt_barray_ptr * coef_arrays)
-{
- /* Although we don't actually use input_components for transcoding,
- * jcmaster.c's initial_setup will complain if input_components is 0.
- */
- cinfo->input_components = 1;
- /* Initialize master control (includes parameter checking/processing) */
- jinit_c_master_control(cinfo, TRUE /* transcode only */);
-
- /* Entropy encoding: either Huffman or arithmetic coding. */
- if (cinfo->arith_code) {
- ERREXIT(cinfo, JERR_ARITH_NOTIMPL);
- } else {
- if (cinfo->progressive_mode) {
-#ifdef C_PROGRESSIVE_SUPPORTED
- jinit_phuff_encoder(cinfo);
-#else
- ERREXIT(cinfo, JERR_NOT_COMPILED);
-#endif
- } else
- jinit_huff_encoder(cinfo);
- }
-
- /* We need a special coefficient buffer controller. */
- transencode_coef_controller(cinfo, coef_arrays);
-
- jinit_marker_writer(cinfo);
-
- /* We can now tell the memory manager to allocate virtual arrays. */
- (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo);
-
- /* Write the datastream header (SOI, JFIF) immediately.
- * Frame and scan headers are postponed till later.
- * This lets application insert special markers after the SOI.
- */
- (*cinfo->marker->write_file_header) (cinfo);
-}
-
-
-/*
- * The rest of this file is a special implementation of the coefficient
- * buffer controller. This is similar to jccoefct.c, but it handles only
- * output from presupplied virtual arrays. Furthermore, we generate any
- * dummy padding blocks on-the-fly rather than expecting them to be present
- * in the arrays.
- */
-
-/* Private buffer controller object */
-
-typedef struct {
- struct jpeg_c_coef_controller pub; /* public fields */
-
- JDIMENSION iMCU_row_num; /* iMCU row # within image */
- JDIMENSION mcu_ctr; /* counts MCUs processed in current row */
- int MCU_vert_offset; /* counts MCU rows within iMCU row */
- int MCU_rows_per_iMCU_row; /* number of such rows needed */
-
- /* Virtual block array for each component. */
- jvirt_barray_ptr * whole_image;
-
- /* Workspace for constructing dummy blocks at right/bottom edges. */
- JBLOCKROW dummy_buffer[C_MAX_BLOCKS_IN_MCU];
-} my_coef_controller;
-
-typedef my_coef_controller * my_coef_ptr;
-
-
-LOCAL(void)
-start_iMCU_row (j_compress_ptr cinfo)
-/* Reset within-iMCU-row counters for a new row */
-{
- my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
-
- /* In an interleaved scan, an MCU row is the same as an iMCU row.
- * In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows.
- * But at the bottom of the image, process only what's left.
- */
- if (cinfo->comps_in_scan > 1) {
- coef->MCU_rows_per_iMCU_row = 1;
- } else {
- if (coef->iMCU_row_num < (cinfo->total_iMCU_rows-1))
- coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->v_samp_factor;
- else
- coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->last_row_height;
- }
-
- coef->mcu_ctr = 0;
- coef->MCU_vert_offset = 0;
-}
-
-
-/*
- * Initialize for a processing pass.
- */
-
-METHODDEF(void)
-start_pass_coef (j_compress_ptr cinfo, J_BUF_MODE pass_mode)
-{
- my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
-
- if (pass_mode != JBUF_CRANK_DEST)
- ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
-
- coef->iMCU_row_num = 0;
- start_iMCU_row(cinfo);
-}
-
-
-/*
- * Process some data.
- * We process the equivalent of one fully interleaved MCU row ("iMCU" row)
- * per call, ie, v_samp_factor block rows for each component in the scan.
- * The data is obtained from the virtual arrays and fed to the entropy coder.
- * Returns TRUE if the iMCU row is completed, FALSE if suspended.
- *
- * NB: input_buf is ignored; it is likely to be a NULL pointer.
- */
-
-METHODDEF(boolean)
-compress_output (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
-{
- my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
- JDIMENSION MCU_col_num; /* index of current MCU within row */
- JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1;
- JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;
- int blkn, ci, xindex, yindex, yoffset, blockcnt;
- JDIMENSION start_col;
- JBLOCKARRAY buffer[MAX_COMPS_IN_SCAN];
- JBLOCKROW MCU_buffer[C_MAX_BLOCKS_IN_MCU];
- JBLOCKROW buffer_ptr;
- jpeg_component_info *compptr;
-
- /* Align the virtual buffers for the components used in this scan. */
- for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
- compptr = cinfo->cur_comp_info[ci];
- buffer[ci] = (*cinfo->mem->access_virt_barray)
- ((j_common_ptr) cinfo, coef->whole_image[compptr->component_index],
- coef->iMCU_row_num * compptr->v_samp_factor,
- (JDIMENSION) compptr->v_samp_factor, FALSE);
- }
-
- /* Loop to process one whole iMCU row */
- for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;
- yoffset++) {
- for (MCU_col_num = coef->mcu_ctr; MCU_col_num < cinfo->MCUs_per_row;
- MCU_col_num++) {
- /* Construct list of pointers to DCT blocks belonging to this MCU */
- blkn = 0; /* index of current DCT block within MCU */
- for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
- compptr = cinfo->cur_comp_info[ci];
- start_col = MCU_col_num * compptr->MCU_width;
- blockcnt = (MCU_col_num < last_MCU_col) ? compptr->MCU_width
- : compptr->last_col_width;
- for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
- if (coef->iMCU_row_num < last_iMCU_row ||
- yindex+yoffset < compptr->last_row_height) {
- /* Fill in pointers to real blocks in this row */
- buffer_ptr = buffer[ci][yindex+yoffset] + start_col;
- for (xindex = 0; xindex < blockcnt; xindex++)
- MCU_buffer[blkn++] = buffer_ptr++;
- } else {
- /* At bottom of image, need a whole row of dummy blocks */
- xindex = 0;
- }
- /* Fill in any dummy blocks needed in this row.
- * Dummy blocks are filled in the same way as in jccoefct.c:
- * all zeroes in the AC entries, DC entries equal to previous
- * block's DC value. The init routine has already zeroed the
- * AC entries, so we need only set the DC entries correctly.
- */
- for (; xindex < compptr->MCU_width; xindex++) {
- MCU_buffer[blkn] = coef->dummy_buffer[blkn];
- MCU_buffer[blkn][0][0] = MCU_buffer[blkn-1][0][0];
- blkn++;
- }
- }
- }
- /* Try to write the MCU. */
- if (! (*cinfo->entropy->encode_mcu) (cinfo, MCU_buffer)) {
- /* Suspension forced; update state counters and exit */
- coef->MCU_vert_offset = yoffset;
- coef->mcu_ctr = MCU_col_num;
- return FALSE;
- }
- }
- /* Completed an MCU row, but perhaps not an iMCU row */
- coef->mcu_ctr = 0;
- }
- /* Completed the iMCU row, advance counters for next one */
- coef->iMCU_row_num++;
- start_iMCU_row(cinfo);
- return TRUE;
-}
-
-
-/*
- * Initialize coefficient buffer controller.
- *
- * Each passed coefficient array must be the right size for that
- * coefficient: width_in_blocks wide and height_in_blocks high,
- * with unitheight at least v_samp_factor.
- */
-
-LOCAL(void)
-transencode_coef_controller (j_compress_ptr cinfo,
- jvirt_barray_ptr * coef_arrays)
-{
- my_coef_ptr coef;
- JBLOCKROW buffer;
- int i;
-
- coef = (my_coef_ptr)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- SIZEOF(my_coef_controller));
- cinfo->coef = (struct jpeg_c_coef_controller *) coef;
- coef->pub.start_pass = start_pass_coef;
- coef->pub.compress_data = compress_output;
-
- /* Save pointer to virtual arrays */
- coef->whole_image = coef_arrays;
-
- /* Allocate and pre-zero space for dummy DCT blocks. */
- buffer = (JBLOCKROW)
- (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- C_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK));
- jzero_far((void FAR *) buffer, C_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK));
- for (i = 0; i < C_MAX_BLOCKS_IN_MCU; i++) {
- coef->dummy_buffer[i] = buffer + i;
- }
-}
-
-#endif //_FX_JPEG_TURBO_
+#if !defined(_FX_JPEG_TURBO_)
+/*
+ * jctrans.c
+ *
+ * Copyright (C) 1995-1998, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains library routines for transcoding compression,
+ * that is, writing raw DCT coefficient arrays to an output JPEG file.
+ * The routines in jcapimin.c will also be needed by a transcoder.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+
+
+/* Forward declarations */
+LOCAL(void) transencode_master_selection
+ JPP((j_compress_ptr cinfo, jvirt_barray_ptr * coef_arrays));
+LOCAL(void) transencode_coef_controller
+ JPP((j_compress_ptr cinfo, jvirt_barray_ptr * coef_arrays));
+
+
+/*
+ * Compression initialization for writing raw-coefficient data.
+ * Before calling this, all parameters and a data destination must be set up.
+ * Call jpeg_finish_compress() to actually write the data.
+ *
+ * The number of passed virtual arrays must match cinfo->num_components.
+ * Note that the virtual arrays need not be filled or even realized at
+ * the time write_coefficients is called; indeed, if the virtual arrays
+ * were requested from this compression object's memory manager, they
+ * typically will be realized during this routine and filled afterwards.
+ */
+
+GLOBAL(void)
+jpeg_write_coefficients (j_compress_ptr cinfo, jvirt_barray_ptr * coef_arrays)
+{
+ if (cinfo->global_state != CSTATE_START)
+ ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
+ /* Mark all tables to be written */
+ jpeg_suppress_tables(cinfo, FALSE);
+ /* (Re)initialize error mgr and destination modules */
+ (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo);
+ (*cinfo->dest->init_destination) (cinfo);
+ /* Perform master selection of active modules */
+ transencode_master_selection(cinfo, coef_arrays);
+ /* Wait for jpeg_finish_compress() call */
+ cinfo->next_scanline = 0; /* so jpeg_write_marker works */
+ cinfo->global_state = CSTATE_WRCOEFS;
+}
+
+
+/*
+ * Initialize the compression object with default parameters,
+ * then copy from the source object all parameters needed for lossless
+ * transcoding. Parameters that can be varied without loss (such as
+ * scan script and Huffman optimization) are left in their default states.
+ */
+
+GLOBAL(void)
+jpeg_copy_critical_parameters (j_decompress_ptr srcinfo,
+ j_compress_ptr dstinfo)
+{
+ JQUANT_TBL ** qtblptr;
+ jpeg_component_info *incomp, *outcomp;
+ JQUANT_TBL *c_quant, *slot_quant;
+ int tblno, ci, coefi;
+
+ /* Safety check to ensure start_compress not called yet. */
+ if (dstinfo->global_state != CSTATE_START)
+ ERREXIT1(dstinfo, JERR_BAD_STATE, dstinfo->global_state);
+ /* Copy fundamental image dimensions */
+ dstinfo->image_width = srcinfo->image_width;
+ dstinfo->image_height = srcinfo->image_height;
+ dstinfo->input_components = srcinfo->num_components;
+ dstinfo->in_color_space = srcinfo->jpeg_color_space;
+ /* Initialize all parameters to default values */
+ jpeg_set_defaults(dstinfo);
+ /* jpeg_set_defaults may choose wrong colorspace, eg YCbCr if input is RGB.
+ * Fix it to get the right header markers for the image colorspace.
+ */
+ jpeg_set_colorspace(dstinfo, srcinfo->jpeg_color_space);
+ dstinfo->data_precision = srcinfo->data_precision;
+ dstinfo->CCIR601_sampling = srcinfo->CCIR601_sampling;
+ /* Copy the source's quantization tables. */
+ for (tblno = 0; tblno < NUM_QUANT_TBLS; tblno++) {
+ if (srcinfo->quant_tbl_ptrs[tblno] != NULL) {
+ qtblptr = & dstinfo->quant_tbl_ptrs[tblno];
+ if (*qtblptr == NULL)
+ *qtblptr = jpeg_alloc_quant_table((j_common_ptr) dstinfo);
+ MEMCOPY((*qtblptr)->quantval,
+ srcinfo->quant_tbl_ptrs[tblno]->quantval,
+ SIZEOF((*qtblptr)->quantval));
+ (*qtblptr)->sent_table = FALSE;
+ }
+ }
+ /* Copy the source's per-component info.
+ * Note we assume jpeg_set_defaults has allocated the dest comp_info array.
+ */
+ dstinfo->num_components = srcinfo->num_components;
+ if (dstinfo->num_components < 1 || dstinfo->num_components > MAX_COMPONENTS)
+ ERREXIT2(dstinfo, JERR_COMPONENT_COUNT, dstinfo->num_components,
+ MAX_COMPONENTS);
+ for (ci = 0, incomp = srcinfo->comp_info, outcomp = dstinfo->comp_info;
+ ci < dstinfo->num_components; ci++, incomp++, outcomp++) {
+ outcomp->component_id = incomp->component_id;
+ outcomp->h_samp_factor = incomp->h_samp_factor;
+ outcomp->v_samp_factor = incomp->v_samp_factor;
+ outcomp->quant_tbl_no = incomp->quant_tbl_no;
+ /* Make sure saved quantization table for component matches the qtable
+ * slot. If not, the input file re-used this qtable slot.
+ * IJG encoder currently cannot duplicate this.
+ */
+ tblno = outcomp->quant_tbl_no;
+ if (tblno < 0 || tblno >= NUM_QUANT_TBLS ||
+ srcinfo->quant_tbl_ptrs[tblno] == NULL)
+ ERREXIT1(dstinfo, JERR_NO_QUANT_TABLE, tblno);
+ slot_quant = srcinfo->quant_tbl_ptrs[tblno];
+ c_quant = incomp->quant_table;
+ if (c_quant != NULL) {
+ for (coefi = 0; coefi < DCTSIZE2; coefi++) {
+ if (c_quant->quantval[coefi] != slot_quant->quantval[coefi])
+ ERREXIT1(dstinfo, JERR_MISMATCHED_QUANT_TABLE, tblno);
+ }
+ }
+ /* Note: we do not copy the source's Huffman table assignments;
+ * instead we rely on jpeg_set_colorspace to have made a suitable choice.
+ */
+ }
+ /* Also copy JFIF version and resolution information, if available.
+ * Strictly speaking this isn't "critical" info, but it's nearly
+ * always appropriate to copy it if available. In particular,
+ * if the application chooses to copy JFIF 1.02 extension markers from
+ * the source file, we need to copy the version to make sure we don't
+ * emit a file that has 1.02 extensions but a claimed version of 1.01.
+ * We will *not*, however, copy version info from mislabeled "2.01" files.
+ */
+ if (srcinfo->saw_JFIF_marker) {
+ if (srcinfo->JFIF_major_version == 1) {
+ dstinfo->JFIF_major_version = srcinfo->JFIF_major_version;
+ dstinfo->JFIF_minor_version = srcinfo->JFIF_minor_version;
+ }
+ dstinfo->density_unit = srcinfo->density_unit;
+ dstinfo->X_density = srcinfo->X_density;
+ dstinfo->Y_density = srcinfo->Y_density;
+ }
+}
+
+
+/*
+ * Master selection of compression modules for transcoding.
+ * This substitutes for jcinit.c's initialization of the full compressor.
+ */
+
+LOCAL(void)
+transencode_master_selection (j_compress_ptr cinfo,
+ jvirt_barray_ptr * coef_arrays)
+{
+ /* Although we don't actually use input_components for transcoding,
+ * jcmaster.c's initial_setup will complain if input_components is 0.
+ */
+ cinfo->input_components = 1;
+ /* Initialize master control (includes parameter checking/processing) */
+ jinit_c_master_control(cinfo, TRUE /* transcode only */);
+
+ /* Entropy encoding: either Huffman or arithmetic coding. */
+ if (cinfo->arith_code) {
+ ERREXIT(cinfo, JERR_ARITH_NOTIMPL);
+ } else {
+ if (cinfo->progressive_mode) {
+#ifdef C_PROGRESSIVE_SUPPORTED
+ jinit_phuff_encoder(cinfo);
+#else
+ ERREXIT(cinfo, JERR_NOT_COMPILED);
+#endif
+ } else
+ jinit_huff_encoder(cinfo);
+ }
+
+ /* We need a special coefficient buffer controller. */
+ transencode_coef_controller(cinfo, coef_arrays);
+
+ jinit_marker_writer(cinfo);
+
+ /* We can now tell the memory manager to allocate virtual arrays. */
+ (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo);
+
+ /* Write the datastream header (SOI, JFIF) immediately.
+ * Frame and scan headers are postponed till later.
+ * This lets application insert special markers after the SOI.
+ */
+ (*cinfo->marker->write_file_header) (cinfo);
+}
+
+
+/*
+ * The rest of this file is a special implementation of the coefficient
+ * buffer controller. This is similar to jccoefct.c, but it handles only
+ * output from presupplied virtual arrays. Furthermore, we generate any
+ * dummy padding blocks on-the-fly rather than expecting them to be present
+ * in the arrays.
+ */
+
+/* Private buffer controller object */
+
+typedef struct {
+ struct jpeg_c_coef_controller pub; /* public fields */
+
+ JDIMENSION iMCU_row_num; /* iMCU row # within image */
+ JDIMENSION mcu_ctr; /* counts MCUs processed in current row */
+ int MCU_vert_offset; /* counts MCU rows within iMCU row */
+ int MCU_rows_per_iMCU_row; /* number of such rows needed */
+
+ /* Virtual block array for each component. */
+ jvirt_barray_ptr * whole_image;
+
+ /* Workspace for constructing dummy blocks at right/bottom edges. */
+ JBLOCKROW dummy_buffer[C_MAX_BLOCKS_IN_MCU];
+} my_coef_controller;
+
+typedef my_coef_controller * my_coef_ptr;
+
+
+LOCAL(void)
+start_iMCU_row (j_compress_ptr cinfo)
+/* Reset within-iMCU-row counters for a new row */
+{
+ my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
+
+ /* In an interleaved scan, an MCU row is the same as an iMCU row.
+ * In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows.
+ * But at the bottom of the image, process only what's left.
+ */
+ if (cinfo->comps_in_scan > 1) {
+ coef->MCU_rows_per_iMCU_row = 1;
+ } else {
+ if (coef->iMCU_row_num < (cinfo->total_iMCU_rows-1))
+ coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->v_samp_factor;
+ else
+ coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->last_row_height;
+ }
+
+ coef->mcu_ctr = 0;
+ coef->MCU_vert_offset = 0;
+}
+
+
+/*
+ * Initialize for a processing pass.
+ */
+
+METHODDEF(void)
+start_pass_coef (j_compress_ptr cinfo, J_BUF_MODE pass_mode)
+{
+ my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
+
+ if (pass_mode != JBUF_CRANK_DEST)
+ ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
+
+ coef->iMCU_row_num = 0;
+ start_iMCU_row(cinfo);
+}
+
+
+/*
+ * Process some data.
+ * We process the equivalent of one fully interleaved MCU row ("iMCU" row)
+ * per call, ie, v_samp_factor block rows for each component in the scan.
+ * The data is obtained from the virtual arrays and fed to the entropy coder.
+ * Returns TRUE if the iMCU row is completed, FALSE if suspended.
+ *
+ * NB: input_buf is ignored; it is likely to be a NULL pointer.
+ */
+
+METHODDEF(boolean)
+compress_output (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
+{
+ my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
+ JDIMENSION MCU_col_num; /* index of current MCU within row */
+ JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1;
+ JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;
+ int blkn, ci, xindex, yindex, yoffset, blockcnt;
+ JDIMENSION start_col;
+ JBLOCKARRAY buffer[MAX_COMPS_IN_SCAN];
+ JBLOCKROW MCU_buffer[C_MAX_BLOCKS_IN_MCU];
+ JBLOCKROW buffer_ptr;
+ jpeg_component_info *compptr;
+
+ /* Align the virtual buffers for the components used in this scan. */
+ for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
+ compptr = cinfo->cur_comp_info[ci];
+ buffer[ci] = (*cinfo->mem->access_virt_barray)
+ ((j_common_ptr) cinfo, coef->whole_image[compptr->component_index],
+ coef->iMCU_row_num * compptr->v_samp_factor,
+ (JDIMENSION) compptr->v_samp_factor, FALSE);
+ }
+
+ /* Loop to process one whole iMCU row */
+ for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;
+ yoffset++) {
+ for (MCU_col_num = coef->mcu_ctr; MCU_col_num < cinfo->MCUs_per_row;
+ MCU_col_num++) {
+ /* Construct list of pointers to DCT blocks belonging to this MCU */
+ blkn = 0; /* index of current DCT block within MCU */
+ for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
+ compptr = cinfo->cur_comp_info[ci];
+ start_col = MCU_col_num * compptr->MCU_width;
+ blockcnt = (MCU_col_num < last_MCU_col) ? compptr->MCU_width
+ : compptr->last_col_width;
+ for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
+ if (coef->iMCU_row_num < last_iMCU_row ||
+ yindex+yoffset < compptr->last_row_height) {
+ /* Fill in pointers to real blocks in this row */
+ buffer_ptr = buffer[ci][yindex+yoffset] + start_col;
+ for (xindex = 0; xindex < blockcnt; xindex++)
+ MCU_buffer[blkn++] = buffer_ptr++;
+ } else {
+ /* At bottom of image, need a whole row of dummy blocks */
+ xindex = 0;
+ }
+ /* Fill in any dummy blocks needed in this row.
+ * Dummy blocks are filled in the same way as in jccoefct.c:
+ * all zeroes in the AC entries, DC entries equal to previous
+ * block's DC value. The init routine has already zeroed the
+ * AC entries, so we need only set the DC entries correctly.
+ */
+ for (; xindex < compptr->MCU_width; xindex++) {
+ MCU_buffer[blkn] = coef->dummy_buffer[blkn];
+ MCU_buffer[blkn][0][0] = MCU_buffer[blkn-1][0][0];
+ blkn++;
+ }
+ }
+ }
+ /* Try to write the MCU. */
+ if (! (*cinfo->entropy->encode_mcu) (cinfo, MCU_buffer)) {
+ /* Suspension forced; update state counters and exit */
+ coef->MCU_vert_offset = yoffset;
+ coef->mcu_ctr = MCU_col_num;
+ return FALSE;
+ }
+ }
+ /* Completed an MCU row, but perhaps not an iMCU row */
+ coef->mcu_ctr = 0;
+ }
+ /* Completed the iMCU row, advance counters for next one */
+ coef->iMCU_row_num++;
+ start_iMCU_row(cinfo);
+ return TRUE;
+}
+
+
+/*
+ * Initialize coefficient buffer controller.
+ *
+ * Each passed coefficient array must be the right size for that
+ * coefficient: width_in_blocks wide and height_in_blocks high,
+ * with unitheight at least v_samp_factor.
+ */
+
+LOCAL(void)
+transencode_coef_controller (j_compress_ptr cinfo,
+ jvirt_barray_ptr * coef_arrays)
+{
+ my_coef_ptr coef;
+ JBLOCKROW buffer;
+ int i;
+
+ coef = (my_coef_ptr)
+ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ SIZEOF(my_coef_controller));
+ cinfo->coef = (struct jpeg_c_coef_controller *) coef;
+ coef->pub.start_pass = start_pass_coef;
+ coef->pub.compress_data = compress_output;
+
+ /* Save pointer to virtual arrays */
+ coef->whole_image = coef_arrays;
+
+ /* Allocate and pre-zero space for dummy DCT blocks. */
+ buffer = (JBLOCKROW)
+ (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ C_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK));
+ jzero_far((void FAR *) buffer, C_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK));
+ for (i = 0; i < C_MAX_BLOCKS_IN_MCU; i++) {
+ coef->dummy_buffer[i] = buffer + i;
+ }
+}
+
+#endif //_FX_JPEG_TURBO_
diff --git a/core/src/fxcodec/libjpeg/fpdfapi_jdapimin.c b/core/src/fxcodec/libjpeg/fpdfapi_jdapimin.c
index 1b24b707b2..80c52cd29f 100644
--- a/core/src/fxcodec/libjpeg/fpdfapi_jdapimin.c
+++ b/core/src/fxcodec/libjpeg/fpdfapi_jdapimin.c
@@ -1,398 +1,398 @@
-#if !defined(_FX_JPEG_TURBO_)
-/*
- * jdapimin.c
- *
- * Copyright (C) 1994-1998, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- * For conditions of distribution and use, see the accompanying README file.
- *
- * This file contains application interface code for the decompression half
- * of the JPEG library. These are the "minimum" API routines that may be
- * needed in either the normal full-decompression case or the
- * transcoding-only case.
- *
- * Most of the routines intended to be called directly by an application
- * are in this file or in jdapistd.c. But also see jcomapi.c for routines
- * shared by compression and decompression, and jdtrans.c for the transcoding
- * case.
- */
-
-#define JPEG_INTERNALS
-#include "jinclude.h"
-#include "jpeglib.h"
-
-
-/*
- * Initialization of a JPEG decompression object.
- * The error manager must already be set up (in case memory manager fails).
- */
-
-GLOBAL(void)
-jpeg_CreateDecompress (j_decompress_ptr cinfo, int version, size_t structsize)
-{
- int i;
-
- /* Guard against version mismatches between library and caller. */
- cinfo->mem = NULL; /* so jpeg_destroy knows mem mgr not called */
- if (version != JPEG_LIB_VERSION)
- ERREXIT2(cinfo, JERR_BAD_LIB_VERSION, JPEG_LIB_VERSION, version);
- if (structsize != SIZEOF(struct jpeg_decompress_struct))
- ERREXIT2(cinfo, JERR_BAD_STRUCT_SIZE,
- (int) SIZEOF(struct jpeg_decompress_struct), (int) structsize);
-
- /* For debugging purposes, we zero the whole master structure.
- * But the application has already set the err pointer, and may have set
- * client_data, so we have to save and restore those fields.
- * Note: if application hasn't set client_data, tools like Purify may
- * complain here.
- */
- {
- struct jpeg_error_mgr * err = cinfo->err;
- void * client_data = cinfo->client_data; /* ignore Purify complaint here */
- MEMZERO(cinfo, SIZEOF(struct jpeg_decompress_struct));
- cinfo->err = err;
- cinfo->client_data = client_data;
- }
- cinfo->is_decompressor = TRUE;
-
- /* Initialize a memory manager instance for this object */
- jinit_memory_mgr((j_common_ptr) cinfo);
-
- /* Zero out pointers to permanent structures. */
- cinfo->progress = NULL;
- cinfo->src = NULL;
-
- for (i = 0; i < NUM_QUANT_TBLS; i++)
- cinfo->quant_tbl_ptrs[i] = NULL;
-
- for (i = 0; i < NUM_HUFF_TBLS; i++) {
- cinfo->dc_huff_tbl_ptrs[i] = NULL;
- cinfo->ac_huff_tbl_ptrs[i] = NULL;
- }
-
- /* Initialize marker processor so application can override methods
- * for COM, APPn markers before calling jpeg_read_header.
- */
- cinfo->marker_list = NULL;
- jinit_marker_reader(cinfo);
-
- /* And initialize the overall input controller. */
- jinit_input_controller(cinfo);
-
- /* OK, I'm ready */
- cinfo->global_state = DSTATE_START;
-}
-
-
-/*
- * Destruction of a JPEG decompression object
- */
-
-GLOBAL(void)
-jpeg_destroy_decompress (j_decompress_ptr cinfo)
-{
- jpeg_destroy((j_common_ptr) cinfo); /* use common routine */
-}
-
-
-/*
- * Abort processing of a JPEG decompression operation,
- * but don't destroy the object itself.
- */
-
-GLOBAL(void)
-jpeg_abort_decompress (j_decompress_ptr cinfo)
-{
- jpeg_abort((j_common_ptr) cinfo); /* use common routine */
-}
-
-
-/*
- * Set default decompression parameters.
- */
-
-LOCAL(void)
-default_decompress_parms (j_decompress_ptr cinfo)
-{
- /* Guess the input colorspace, and set output colorspace accordingly. */
- /* (Wish JPEG committee had provided a real way to specify this...) */
- /* Note application may override our guesses. */
- switch (cinfo->num_components) {
- case 1:
- cinfo->jpeg_color_space = JCS_GRAYSCALE;
- cinfo->out_color_space = JCS_GRAYSCALE;
- break;
-
- case 3:
- if (cinfo->saw_JFIF_marker) {
- cinfo->jpeg_color_space = JCS_YCbCr; /* JFIF implies YCbCr */
- } else if (cinfo->saw_Adobe_marker) {
- switch (cinfo->Adobe_transform) {
- case 0:
- cinfo->jpeg_color_space = JCS_RGB;
- break;
- case 1:
- cinfo->jpeg_color_space = JCS_YCbCr;
- break;
- default:
- WARNMS1(cinfo, JWRN_ADOBE_XFORM, cinfo->Adobe_transform);
- cinfo->jpeg_color_space = JCS_YCbCr; /* assume it's YCbCr */
- break;
- }
- } else {
- /* Saw no special markers, try to guess from the component IDs */
- int cid0 = cinfo->comp_info[0].component_id;
- int cid1 = cinfo->comp_info[1].component_id;
- int cid2 = cinfo->comp_info[2].component_id;
-
- if (cid0 == 1 && cid1 == 2 && cid2 == 3)
- cinfo->jpeg_color_space = JCS_YCbCr; /* assume JFIF w/out marker */
- else if (cid0 == 82 && cid1 == 71 && cid2 == 66)
- cinfo->jpeg_color_space = JCS_RGB; /* ASCII 'R', 'G', 'B' */
- else {
- TRACEMS3(cinfo, 1, JTRC_UNKNOWN_IDS, cid0, cid1, cid2);
- cinfo->jpeg_color_space = JCS_YCbCr; /* assume it's YCbCr */
- }
- }
- /* Always guess RGB is proper output colorspace. */
- cinfo->out_color_space = JCS_RGB;
- break;
-
- case 4:
- if (cinfo->saw_Adobe_marker) {
- switch (cinfo->Adobe_transform) {
- case 0:
- cinfo->jpeg_color_space = JCS_CMYK;
- break;
- case 2:
- cinfo->jpeg_color_space = JCS_YCCK;
- break;
- default:
- WARNMS1(cinfo, JWRN_ADOBE_XFORM, cinfo->Adobe_transform);
- cinfo->jpeg_color_space = JCS_YCCK; /* assume it's YCCK */
- break;
- }
- } else {
- /* No special markers, assume straight CMYK. */
- cinfo->jpeg_color_space = JCS_CMYK;
- }
- cinfo->out_color_space = JCS_CMYK;
- break;
-
- default:
- cinfo->jpeg_color_space = JCS_UNKNOWN;
- cinfo->out_color_space = JCS_UNKNOWN;
- break;
- }
-
- /* Set defaults for other decompression parameters. */
- cinfo->scale_num = 1; /* 1:1 scaling */
- cinfo->scale_denom = 1;
- cinfo->output_gamma = 1.0;
- cinfo->buffered_image = FALSE;
- cinfo->raw_data_out = FALSE;
- cinfo->dct_method = JDCT_DEFAULT;
- cinfo->do_fancy_upsampling = TRUE;
- cinfo->do_block_smoothing = TRUE;
- cinfo->quantize_colors = FALSE;
- /* We set these in case application only sets quantize_colors. */
- cinfo->dither_mode = JDITHER_FS;
-#ifdef QUANT_2PASS_SUPPORTED
- cinfo->two_pass_quantize = TRUE;
-#else
- cinfo->two_pass_quantize = FALSE;
-#endif
- cinfo->desired_number_of_colors = 256;
- cinfo->colormap = NULL;
- /* Initialize for no mode change in buffered-image mode. */
- cinfo->enable_1pass_quant = FALSE;
- cinfo->enable_external_quant = FALSE;
- cinfo->enable_2pass_quant = FALSE;
-}
-
-
-/*
- * Decompression startup: read start of JPEG datastream to see what's there.
- * Need only initialize JPEG object and supply a data source before calling.
- *
- * This routine will read as far as the first SOS marker (ie, actual start of
- * compressed data), and will save all tables and parameters in the JPEG
- * object. It will also initialize the decompression parameters to default
- * values, and finally return JPEG_HEADER_OK. On return, the application may
- * adjust the decompression parameters and then call jpeg_start_decompress.
- * (Or, if the application only wanted to determine the image parameters,
- * the data need not be decompressed. In that case, call jpeg_abort or
- * jpeg_destroy to release any temporary space.)
- * If an abbreviated (tables only) datastream is presented, the routine will
- * return JPEG_HEADER_TABLES_ONLY upon reaching EOI. The application may then
- * re-use the JPEG object to read the abbreviated image datastream(s).
- * It is unnecessary (but OK) to call jpeg_abort in this case.
- * The JPEG_SUSPENDED return code only occurs if the data source module
- * requests suspension of the decompressor. In this case the application
- * should load more source data and then re-call jpeg_read_header to resume
- * processing.
- * If a non-suspending data source is used and require_image is TRUE, then the
- * return code need not be inspected since only JPEG_HEADER_OK is possible.
- *
- * This routine is now just a front end to jpeg_consume_input, with some
- * extra error checking.
- */
-
-GLOBAL(int)
-jpeg_read_header (j_decompress_ptr cinfo, boolean require_image)
-{
- int retcode;
-
- if (cinfo->global_state != DSTATE_START &&
- cinfo->global_state != DSTATE_INHEADER)
- ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
-
- retcode = jpeg_consume_input(cinfo);
-
- switch (retcode) {
- case JPEG_REACHED_SOS:
- retcode = JPEG_HEADER_OK;
- break;
- case JPEG_REACHED_EOI:
- if (require_image) /* Complain if application wanted an image */
- ERREXIT(cinfo, JERR_NO_IMAGE);
- /* Reset to start state; it would be safer to require the application to
- * call jpeg_abort, but we can't change it now for compatibility reasons.
- * A side effect is to free any temporary memory (there shouldn't be any).
- */
- jpeg_abort((j_common_ptr) cinfo); /* sets state = DSTATE_START */
- retcode = JPEG_HEADER_TABLES_ONLY;
- break;
- case JPEG_SUSPENDED:
- /* no work */
- break;
- }
-
- return retcode;
-}
-
-
-/*
- * Consume data in advance of what the decompressor requires.
- * This can be called at any time once the decompressor object has
- * been created and a data source has been set up.
- *
- * This routine is essentially a state machine that handles a couple
- * of critical state-transition actions, namely initial setup and
- * transition from header scanning to ready-for-start_decompress.
- * All the actual input is done via the input controller's consume_input
- * method.
- */
-
-GLOBAL(int)
-jpeg_consume_input (j_decompress_ptr cinfo)
-{
- int retcode = JPEG_SUSPENDED;
-
- /* NB: every possible DSTATE value should be listed in this switch */
- switch (cinfo->global_state) {
- case DSTATE_START:
- /* Start-of-datastream actions: reset appropriate modules */
- (*cinfo->inputctl->reset_input_controller) (cinfo);
- /* Initialize application's data source module */
- (*cinfo->src->init_source) (cinfo);
- cinfo->global_state = DSTATE_INHEADER;
- /*FALLTHROUGH*/
- case DSTATE_INHEADER:
- retcode = (*cinfo->inputctl->consume_input) (cinfo);
- if (retcode == JPEG_REACHED_SOS) { /* Found SOS, prepare to decompress */
- /* Set up default parameters based on header data */
- default_decompress_parms(cinfo);
- /* Set global state: ready for start_decompress */
- cinfo->global_state = DSTATE_READY;
- }
- break;
- case DSTATE_READY:
- /* Can't advance past first SOS until start_decompress is called */
- retcode = JPEG_REACHED_SOS;
- break;
- case DSTATE_PRELOAD:
- case DSTATE_PRESCAN:
- case DSTATE_SCANNING:
- case DSTATE_RAW_OK:
- case DSTATE_BUFIMAGE:
- case DSTATE_BUFPOST:
- case DSTATE_STOPPING:
- retcode = (*cinfo->inputctl->consume_input) (cinfo);
- break;
- default:
- ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
- }
- return retcode;
-}
-
-
-/*
- * Have we finished reading the input file?
- */
-
-GLOBAL(boolean)
-jpeg_input_complete (j_decompress_ptr cinfo)
-{
- /* Check for valid jpeg object */
- if (cinfo->global_state < DSTATE_START ||
- cinfo->global_state > DSTATE_STOPPING)
- ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
- return cinfo->inputctl->eoi_reached;
-}
-
-
-/*
- * Is there more than one scan?
- */
-
-GLOBAL(boolean)
-jpeg_has_multiple_scans (j_decompress_ptr cinfo)
-{
- /* Only valid after jpeg_read_header completes */
- if (cinfo->global_state < DSTATE_READY ||
- cinfo->global_state > DSTATE_STOPPING)
- ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
- return cinfo->inputctl->has_multiple_scans;
-}
-
-
-/*
- * Finish JPEG decompression.
- *
- * This will normally just verify the file trailer and release temp storage.
- *
- * Returns FALSE if suspended. The return value need be inspected only if
- * a suspending data source is used.
- */
-
-GLOBAL(boolean)
-jpeg_finish_decompress (j_decompress_ptr cinfo)
-{
- if ((cinfo->global_state == DSTATE_SCANNING ||
- cinfo->global_state == DSTATE_RAW_OK) && ! cinfo->buffered_image) {
- /* Terminate final pass of non-buffered mode */
- if (cinfo->output_scanline < cinfo->output_height)
- ERREXIT(cinfo, JERR_TOO_LITTLE_DATA);
- (*cinfo->master->finish_output_pass) (cinfo);
- cinfo->global_state = DSTATE_STOPPING;
- } else if (cinfo->global_state == DSTATE_BUFIMAGE) {
- /* Finishing after a buffered-image operation */
- cinfo->global_state = DSTATE_STOPPING;
- } else if (cinfo->global_state != DSTATE_STOPPING) {
- /* STOPPING = repeat call after a suspension, anything else is error */
- ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
- }
- /* Read until EOI */
- while (! cinfo->inputctl->eoi_reached) {
- if ((*cinfo->inputctl->consume_input) (cinfo) == JPEG_SUSPENDED)
- return FALSE; /* Suspend, come back later */
- }
- /* Do final cleanup */
- (*cinfo->src->term_source) (cinfo);
- /* We can use jpeg_abort to release memory and reset global_state */
- jpeg_abort((j_common_ptr) cinfo);
- return TRUE;
-}
-
-#endif //_FX_JPEG_TURBO_
+#if !defined(_FX_JPEG_TURBO_)
+/*
+ * jdapimin.c
+ *
+ * Copyright (C) 1994-1998, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains application interface code for the decompression half
+ * of the JPEG library. These are the "minimum" API routines that may be
+ * needed in either the normal full-decompression case or the
+ * transcoding-only case.
+ *
+ * Most of the routines intended to be called directly by an application
+ * are in this file or in jdapistd.c. But also see jcomapi.c for routines
+ * shared by compression and decompression, and jdtrans.c for the transcoding
+ * case.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+
+
+/*
+ * Initialization of a JPEG decompression object.
+ * The error manager must already be set up (in case memory manager fails).
+ */
+
+GLOBAL(void)
+jpeg_CreateDecompress (j_decompress_ptr cinfo, int version, size_t structsize)
+{
+ int i;
+
+ /* Guard against version mismatches between library and caller. */
+ cinfo->mem = NULL; /* so jpeg_destroy knows mem mgr not called */
+ if (version != JPEG_LIB_VERSION)
+ ERREXIT2(cinfo, JERR_BAD_LIB_VERSION, JPEG_LIB_VERSION, version);
+ if (structsize != SIZEOF(struct jpeg_decompress_struct))
+ ERREXIT2(cinfo, JERR_BAD_STRUCT_SIZE,
+ (int) SIZEOF(struct jpeg_decompress_struct), (int) structsize);
+
+ /* For debugging purposes, we zero the whole master structure.
+ * But the application has already set the err pointer, and may have set
+ * client_data, so we have to save and restore those fields.
+ * Note: if application hasn't set client_data, tools like Purify may
+ * complain here.
+ */
+ {
+ struct jpeg_error_mgr * err = cinfo->err;
+ void * client_data = cinfo->client_data; /* ignore Purify complaint here */
+ MEMZERO(cinfo, SIZEOF(struct jpeg_decompress_struct));
+ cinfo->err = err;
+ cinfo->client_data = client_data;
+ }
+ cinfo->is_decompressor = TRUE;
+
+ /* Initialize a memory manager instance for this object */
+ jinit_memory_mgr((j_common_ptr) cinfo);
+
+ /* Zero out pointers to permanent structures. */
+ cinfo->progress = NULL;
+ cinfo->src = NULL;
+
+ for (i = 0; i < NUM_QUANT_TBLS; i++)
+ cinfo->quant_tbl_ptrs[i] = NULL;
+
+ for (i = 0; i < NUM_HUFF_TBLS; i++) {
+ cinfo->dc_huff_tbl_ptrs[i] = NULL;
+ cinfo->ac_huff_tbl_ptrs[i] = NULL;
+ }
+
+ /* Initialize marker processor so application can override methods
+ * for COM, APPn markers before calling jpeg_read_header.
+ */
+ cinfo->marker_list = NULL;
+ jinit_marker_reader(cinfo);
+
+ /* And initialize the overall input controller. */
+ jinit_input_controller(cinfo);
+
+ /* OK, I'm ready */
+ cinfo->global_state = DSTATE_START;
+}
+
+
+/*
+ * Destruction of a JPEG decompression object
+ */
+
+GLOBAL(void)
+jpeg_destroy_decompress (j_decompress_ptr cinfo)
+{
+ jpeg_destroy((j_common_ptr) cinfo); /* use common routine */
+}
+
+
+/*
+ * Abort processing of a JPEG decompression operation,
+ * but don't destroy the object itself.
+ */
+
+GLOBAL(void)
+jpeg_abort_decompress (j_decompress_ptr cinfo)
+{
+ jpeg_abort((j_common_ptr) cinfo); /* use common routine */
+}
+
+
+/*
+ * Set default decompression parameters.
+ */
+
+LOCAL(void)
+default_decompress_parms (j_decompress_ptr cinfo)
+{
+ /* Guess the input colorspace, and set output colorspace accordingly. */
+ /* (Wish JPEG committee had provided a real way to specify this...) */
+ /* Note application may override our guesses. */
+ switch (cinfo->num_components) {
+ case 1:
+ cinfo->jpeg_color_space = JCS_GRAYSCALE;
+ cinfo->out_color_space = JCS_GRAYSCALE;
+ break;
+
+ case 3:
+ if (cinfo->saw_JFIF_marker) {
+ cinfo->jpeg_color_space = JCS_YCbCr; /* JFIF implies YCbCr */
+ } else if (cinfo->saw_Adobe_marker) {
+ switch (cinfo->Adobe_transform) {
+ case 0:
+ cinfo->jpeg_color_space = JCS_RGB;
+ break;
+ case 1:
+ cinfo->jpeg_color_space = JCS_YCbCr;
+ break;
+ default:
+ WARNMS1(cinfo, JWRN_ADOBE_XFORM, cinfo->Adobe_transform);
+ cinfo->jpeg_color_space = JCS_YCbCr; /* assume it's YCbCr */
+ break;
+ }
+ } else {
+ /* Saw no special markers, try to guess from the component IDs */
+ int cid0 = cinfo->comp_info[0].component_id;
+ int cid1 = cinfo->comp_info[1].component_id;
+ int cid2 = cinfo->comp_info[2].component_id;
+
+ if (cid0 == 1 && cid1 == 2 && cid2 == 3)
+ cinfo->jpeg_color_space = JCS_YCbCr; /* assume JFIF w/out marker */
+ else if (cid0 == 82 && cid1 == 71 && cid2 == 66)
+ cinfo->jpeg_color_space = JCS_RGB; /* ASCII 'R', 'G', 'B' */
+ else {
+ TRACEMS3(cinfo, 1, JTRC_UNKNOWN_IDS, cid0, cid1, cid2);
+ cinfo->jpeg_color_space = JCS_YCbCr; /* assume it's YCbCr */
+ }
+ }
+ /* Always guess RGB is proper output colorspace. */
+ cinfo->out_color_space = JCS_RGB;
+ break;
+
+ case 4:
+ if (cinfo->saw_Adobe_marker) {
+ switch (cinfo->Adobe_transform) {
+ case 0:
+ cinfo->jpeg_color_space = JCS_CMYK;
+ break;
+ case 2:
+ cinfo->jpeg_color_space = JCS_YCCK;
+ break;
+ default:
+ WARNMS1(cinfo, JWRN_ADOBE_XFORM, cinfo->Adobe_transform);
+ cinfo->jpeg_color_space = JCS_YCCK; /* assume it's YCCK */
+ break;
+ }
+ } else {
+ /* No special markers, assume straight CMYK. */
+ cinfo->jpeg_color_space = JCS_CMYK;
+ }
+ cinfo->out_color_space = JCS_CMYK;
+ break;
+
+ default:
+ cinfo->jpeg_color_space = JCS_UNKNOWN;
+ cinfo->out_color_space = JCS_UNKNOWN;
+ break;
+ }
+
+ /* Set defaults for other decompression parameters. */
+ cinfo->scale_num = 1; /* 1:1 scaling */
+ cinfo->scale_denom = 1;
+ cinfo->output_gamma = 1.0;
+ cinfo->buffered_image = FALSE;
+ cinfo->raw_data_out = FALSE;
+ cinfo->dct_method = JDCT_DEFAULT;
+ cinfo->do_fancy_upsampling = TRUE;
+ cinfo->do_block_smoothing = TRUE;
+ cinfo->quantize_colors = FALSE;
+ /* We set these in case application only sets quantize_colors. */
+ cinfo->dither_mode = JDITHER_FS;
+#ifdef QUANT_2PASS_SUPPORTED
+ cinfo->two_pass_quantize = TRUE;
+#else
+ cinfo->two_pass_quantize = FALSE;
+#endif
+ cinfo->desired_number_of_colors = 256;
+ cinfo->colormap = NULL;
+ /* Initialize for no mode change in buffered-image mode. */
+ cinfo->enable_1pass_quant = FALSE;
+ cinfo->enable_external_quant = FALSE;
+ cinfo->enable_2pass_quant = FALSE;
+}
+
+
+/*
+ * Decompression startup: read start of JPEG datastream to see what's there.
+ * Need only initialize JPEG object and supply a data source before calling.
+ *
+ * This routine will read as far as the first SOS marker (ie, actual start of
+ * compressed data), and will save all tables and parameters in the JPEG
+ * object. It will also initialize the decompression parameters to default
+ * values, and finally return JPEG_HEADER_OK. On return, the application may
+ * adjust the decompression parameters and then call jpeg_start_decompress.
+ * (Or, if the application only wanted to determine the image parameters,
+ * the data need not be decompressed. In that case, call jpeg_abort or
+ * jpeg_destroy to release any temporary space.)
+ * If an abbreviated (tables only) datastream is presented, the routine will
+ * return JPEG_HEADER_TABLES_ONLY upon reaching EOI. The application may then
+ * re-use the JPEG object to read the abbreviated image datastream(s).
+ * It is unnecessary (but OK) to call jpeg_abort in this case.
+ * The JPEG_SUSPENDED return code only occurs if the data source module
+ * requests suspension of the decompressor. In this case the application
+ * should load more source data and then re-call jpeg_read_header to resume
+ * processing.
+ * If a non-suspending data source is used and require_image is TRUE, then the
+ * return code need not be inspected since only JPEG_HEADER_OK is possible.
+ *
+ * This routine is now just a front end to jpeg_consume_input, with some
+ * extra error checking.
+ */
+
+GLOBAL(int)
+jpeg_read_header (j_decompress_ptr cinfo, boolean require_image)
+{
+ int retcode;
+
+ if (cinfo->global_state != DSTATE_START &&
+ cinfo->global_state != DSTATE_INHEADER)
+ ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
+
+ retcode = jpeg_consume_input(cinfo);
+
+ switch (retcode) {
+ case JPEG_REACHED_SOS:
+ retcode = JPEG_HEADER_OK;
+ break;
+ case JPEG_REACHED_EOI:
+ if (require_image) /* Complain if application wanted an image */
+ ERREXIT(cinfo, JERR_NO_IMAGE);
+ /* Reset to start state; it would be safer to require the application to
+ * call jpeg_abort, but we can't change it now for compatibility reasons.
+ * A side effect is to free any temporary memory (there shouldn't be any).
+ */
+ jpeg_abort((j_common_ptr) cinfo); /* sets state = DSTATE_START */
+ retcode = JPEG_HEADER_TABLES_ONLY;
+ break;
+ case JPEG_SUSPENDED:
+ /* no work */
+ break;
+ }
+
+ return retcode;
+}
+
+
+/*
+ * Consume data in advance of what the decompressor requires.
+ * This can be called at any time once the decompressor object has
+ * been created and a data source has been set up.
+ *
+ * This routine is essentially a state machine that handles a couple
+ * of critical state-transition actions, namely initial setup and
+ * transition from header scanning to ready-for-start_decompress.
+ * All the actual input is done via the input controller's consume_input
+ * method.
+ */
+
+GLOBAL(int)
+jpeg_consume_input (j_decompress_ptr cinfo)
+{
+ int retcode = JPEG_SUSPENDED;
+
+ /* NB: every possible DSTATE value should be listed in this switch */
+ switch (cinfo->global_state) {
+ case DSTATE_START:
+ /* Start-of-datastream actions: reset appropriate modules */
+ (*cinfo->inputctl->reset_input_controller) (cinfo);
+ /* Initialize application's data source module */
+ (*cinfo->src->init_source) (cinfo);
+ cinfo->global_state = DSTATE_INHEADER;
+ /*FALLTHROUGH*/
+ case DSTATE_INHEADER:
+ retcode = (*cinfo->inputctl->consume_input) (cinfo);
+ if (retcode == JPEG_REACHED_SOS) { /* Found SOS, prepare to decompress */
+ /* Set up default parameters based on header data */
+ default_decompress_parms(cinfo);
+ /* Set global state: ready for start_decompress */
+ cinfo->global_state = DSTATE_READY;
+ }
+ break;
+ case DSTATE_READY:
+ /* Can't advance past first SOS until start_decompress is called */
+ retcode = JPEG_REACHED_SOS;
+ break;
+ case DSTATE_PRELOAD:
+ case DSTATE_PRESCAN:
+ case DSTATE_SCANNING:
+ case DSTATE_RAW_OK:
+ case DSTATE_BUFIMAGE:
+ case DSTATE_BUFPOST:
+ case DSTATE_STOPPING:
+ retcode = (*cinfo->inputctl->consume_input) (cinfo);
+ break;
+ default:
+ ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
+ }
+ return retcode;
+}
+
+
+/*
+ * Have we finished reading the input file?
+ */
+
+GLOBAL(boolean)
+jpeg_input_complete (j_decompress_ptr cinfo)
+{
+ /* Check for valid jpeg object */
+ if (cinfo->global_state < DSTATE_START ||
+ cinfo->global_state > DSTATE_STOPPING)
+ ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
+ return cinfo->inputctl->eoi_reached;
+}
+
+
+/*
+ * Is there more than one scan?
+ */
+
+GLOBAL(boolean)
+jpeg_has_multiple_scans (j_decompress_ptr cinfo)
+{
+ /* Only valid after jpeg_read_header completes */
+ if (cinfo->global_state < DSTATE_READY ||
+ cinfo->global_state > DSTATE_STOPPING)
+ ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
+ return cinfo->inputctl->has_multiple_scans;
+}
+
+
+/*
+ * Finish JPEG decompression.
+ *
+ * This will normally just verify the file trailer and release temp storage.
+ *
+ * Returns FALSE if suspended. The return value need be inspected only if
+ * a suspending data source is used.
+ */
+
+GLOBAL(boolean)
+jpeg_finish_decompress (j_decompress_ptr cinfo)
+{
+ if ((cinfo->global_state == DSTATE_SCANNING ||
+ cinfo->global_state == DSTATE_RAW_OK) && ! cinfo->buffered_image) {
+ /* Terminate final pass of non-buffered mode */
+ if (cinfo->output_scanline < cinfo->output_height)
+ ERREXIT(cinfo, JERR_TOO_LITTLE_DATA);
+ (*cinfo->master->finish_output_pass) (cinfo);
+ cinfo->global_state = DSTATE_STOPPING;
+ } else if (cinfo->global_state == DSTATE_BUFIMAGE) {
+ /* Finishing after a buffered-image operation */
+ cinfo->global_state = DSTATE_STOPPING;
+ } else if (cinfo->global_state != DSTATE_STOPPING) {
+ /* STOPPING = repeat call after a suspension, anything else is error */
+ ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
+ }
+ /* Read until EOI */
+ while (! cinfo->inputctl->eoi_reached) {
+ if ((*cinfo->inputctl->consume_input) (cinfo) == JPEG_SUSPENDED)
+ return FALSE; /* Suspend, come back later */
+ }
+ /* Do final cleanup */
+ (*cinfo->src->term_source) (cinfo);
+ /* We can use jpeg_abort to release memory and reset global_state */
+ jpeg_abort((j_common_ptr) cinfo);
+ return TRUE;
+}
+
+#endif //_FX_JPEG_TURBO_
diff --git a/core/src/fxcodec/libjpeg/fpdfapi_jdapistd.c b/core/src/fxcodec/libjpeg/fpdfapi_jdapistd.c
index 8c969eb309..4c31f7640c 100644
--- a/core/src/fxcodec/libjpeg/fpdfapi_jdapistd.c
+++ b/core/src/fxcodec/libjpeg/fpdfapi_jdapistd.c
@@ -1,279 +1,279 @@
-#if !defined(_FX_JPEG_TURBO_)
-/*
- * jdapistd.c
- *
- * Copyright (C) 1994-1996, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- * For conditions of distribution and use, see the accompanying README file.
- *
- * This file contains application interface code for the decompression half
- * of the JPEG library. These are the "standard" API routines that are
- * used in the normal full-decompression case. They are not used by a
- * transcoding-only application. Note that if an application links in
- * jpeg_start_decompress, it will end up linking in the entire decompressor.
- * We thus must separate this file from jdapimin.c to avoid linking the
- * whole decompression library into a transcoder.
- */
-
-#define JPEG_INTERNALS
-#include "jinclude.h"
-#include "jpeglib.h"
-
-
-/* Forward declarations */
-LOCAL(boolean) output_pass_setup JPP((j_decompress_ptr cinfo));
-
-
-/*
- * Decompression initialization.
- * jpeg_read_header must be completed before calling this.
- *
- * If a multipass operating mode was selected, this will do all but the
- * last pass, and thus may take a great deal of time.
- *
- * Returns FALSE if suspended. The return value need be inspected only if
- * a suspending data source is used.
- */
-
-GLOBAL(boolean)
-jpeg_start_decompress (j_decompress_ptr cinfo)
-{
- if (cinfo->global_state == DSTATE_READY) {
- /* First call: initialize master control, select active modules */
- jinit_master_decompress(cinfo);
- if (cinfo->buffered_image) {
- /* No more work here; expecting jpeg_start_output next */
- cinfo->global_state = DSTATE_BUFIMAGE;
- return TRUE;
- }
- cinfo->global_state = DSTATE_PRELOAD;
- }
- if (cinfo->global_state == DSTATE_PRELOAD) {
- /* If file has multiple scans, absorb them all into the coef buffer */
- if (cinfo->inputctl->has_multiple_scans) {
-#ifdef D_MULTISCAN_FILES_SUPPORTED
- for (;;) {
- int retcode;
- /* Call progress monitor hook if present */
- if (cinfo->progress != NULL)
- (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
- /* Absorb some more input */
- retcode = (*cinfo->inputctl->consume_input) (cinfo);
- if (retcode == JPEG_SUSPENDED)
- return FALSE;
- if (retcode == JPEG_REACHED_EOI)
- break;
- /* Advance progress counter if appropriate */
- if (cinfo->progress != NULL &&
- (retcode == JPEG_ROW_COMPLETED || retcode == JPEG_REACHED_SOS)) {
- if (++cinfo->progress->pass_counter >= cinfo->progress->pass_limit) {
- /* jdmaster underestimated number of scans; ratchet up one scan */
- cinfo->progress->pass_limit += (long) cinfo->total_iMCU_rows;
- }
- }
- }
-#else
- ERREXIT(cinfo, JERR_NOT_COMPILED);
-#endif /* D_MULTISCAN_FILES_SUPPORTED */
- }
- cinfo->output_scan_number = cinfo->input_scan_number;
- } else if (cinfo->global_state != DSTATE_PRESCAN)
- ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
- /* Perform any dummy output passes, and set up for the final pass */
- return output_pass_setup(cinfo);
-}
-
-
-/*
- * Set up for an output pass, and perform any dummy pass(es) needed.
- * Common subroutine for jpeg_start_decompress and jpeg_start_output.
- * Entry: global_state = DSTATE_PRESCAN only if previously suspended.
- * Exit: If done, returns TRUE and sets global_state for proper output mode.
- * If suspended, returns FALSE and sets global_state = DSTATE_PRESCAN.
- */
-
-LOCAL(boolean)
-output_pass_setup (j_decompress_ptr cinfo)
-{
- if (cinfo->global_state != DSTATE_PRESCAN) {
- /* First call: do pass setup */
- (*cinfo->master->prepare_for_output_pass) (cinfo);
- cinfo->output_scanline = 0;
- cinfo->global_state = DSTATE_PRESCAN;
- }
- /* Loop over any required dummy passes */
- while (cinfo->master->is_dummy_pass) {
-#ifdef QUANT_2PASS_SUPPORTED
- /* Crank through the dummy pass */
- while (cinfo->output_scanline < cinfo->output_height) {
- JDIMENSION last_scanline;
- /* Call progress monitor hook if present */
- if (cinfo->progress != NULL) {
- cinfo->progress->pass_counter = (long) cinfo->output_scanline;
- cinfo->progress->pass_limit = (long) cinfo->output_height;
- (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
- }
- /* Process some data */
- last_scanline = cinfo->output_scanline;
- (*cinfo->main->process_data) (cinfo, (JSAMPARRAY) NULL,
- &cinfo->output_scanline, (JDIMENSION) 0);
- if (cinfo->output_scanline == last_scanline)
- return FALSE; /* No progress made, must suspend */
- }
- /* Finish up dummy pass, and set up for another one */
- (*cinfo->master->finish_output_pass) (cinfo);
- (*cinfo->master->prepare_for_output_pass) (cinfo);
- cinfo->output_scanline = 0;
-#else
- ERREXIT(cinfo, JERR_NOT_COMPILED);
-#endif /* QUANT_2PASS_SUPPORTED */
- }
- /* Ready for application to drive output pass through
- * jpeg_read_scanlines or jpeg_read_raw_data.
- */
- cinfo->global_state = cinfo->raw_data_out ? DSTATE_RAW_OK : DSTATE_SCANNING;
- return TRUE;
-}
-
-
-/*
- * Read some scanlines of data from the JPEG decompressor.
- *
- * The return value will be the number of lines actually read.
- * This may be less than the number requested in several cases,
- * including bottom of image, data source suspension, and operating
- * modes that emit multiple scanlines at a time.
- *
- * Note: we warn about excess calls to jpeg_read_scanlines() since
- * this likely signals an application programmer error. However,
- * an oversize buffer (max_lines > scanlines remaining) is not an error.
- */
-
-GLOBAL(JDIMENSION)
-jpeg_read_scanlines (j_decompress_ptr cinfo, JSAMPARRAY scanlines,
- JDIMENSION max_lines)
-{
- JDIMENSION row_ctr;
-
- if (cinfo->global_state != DSTATE_SCANNING)
- return 0; /* XYQ 2010-6-27: don't throw exception here */
-/* ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); */
- if (cinfo->output_scanline >= cinfo->output_height) {
- WARNMS(cinfo, JWRN_TOO_MUCH_DATA);
- return 0;
- }
-
- /* Call progress monitor hook if present */
- if (cinfo->progress != NULL) {
- cinfo->progress->pass_counter = (long) cinfo->output_scanline;
- cinfo->progress->pass_limit = (long) cinfo->output_height;
- (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
- }
-
- /* Process some data */
- row_ctr = 0;
- (*cinfo->main->process_data) (cinfo, scanlines, &row_ctr, max_lines);
- cinfo->output_scanline += row_ctr;
- return row_ctr;
-}
-
-
-/*
- * Alternate entry point to read raw data.
- * Processes exactly one iMCU row per call, unless suspended.
- */
-
-GLOBAL(JDIMENSION)
-jpeg_read_raw_data (j_decompress_ptr cinfo, JSAMPIMAGE data,
- JDIMENSION max_lines)
-{
- JDIMENSION lines_per_iMCU_row;
-
- if (cinfo->global_state != DSTATE_RAW_OK)
- ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
- if (cinfo->output_scanline >= cinfo->output_height) {
- WARNMS(cinfo, JWRN_TOO_MUCH_DATA);
- return 0;
- }
-
- /* Call progress monitor hook if present */
- if (cinfo->progress != NULL) {
- cinfo->progress->pass_counter = (long) cinfo->output_scanline;
- cinfo->progress->pass_limit = (long) cinfo->output_height;
- (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
- }
-
- /* Verify that at least one iMCU row can be returned. */
- lines_per_iMCU_row = cinfo->max_v_samp_factor * cinfo->min_DCT_scaled_size;
- if (max_lines < lines_per_iMCU_row)
- ERREXIT(cinfo, JERR_BUFFER_SIZE);
-
- /* Decompress directly into user's buffer. */
- if (! (*cinfo->coef->decompress_data) (cinfo, data))
- return 0; /* suspension forced, can do nothing more */
-
- /* OK, we processed one iMCU row. */
- cinfo->output_scanline += lines_per_iMCU_row;
- return lines_per_iMCU_row;
-}
-
-
-/* Additional entry points for buffered-image mode. */
-
-#ifdef D_MULTISCAN_FILES_SUPPORTED
-
-/*
- * Initialize for an output pass in buffered-image mode.
- */
-
-GLOBAL(boolean)
-jpeg_start_output (j_decompress_ptr cinfo, int scan_number)
-{
- if (cinfo->global_state != DSTATE_BUFIMAGE &&
- cinfo->global_state != DSTATE_PRESCAN)
- ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
- /* Limit scan number to valid range */
- if (scan_number <= 0)
- scan_number = 1;
- if (cinfo->inputctl->eoi_reached &&
- scan_number > cinfo->input_scan_number)
- scan_number = cinfo->input_scan_number;
- cinfo->output_scan_number = scan_number;
- /* Perform any dummy output passes, and set up for the real pass */
- return output_pass_setup(cinfo);
-}
-
-
-/*
- * Finish up after an output pass in buffered-image mode.
- *
- * Returns FALSE if suspended. The return value need be inspected only if
- * a suspending data source is used.
- */
-
-GLOBAL(boolean)
-jpeg_finish_output (j_decompress_ptr cinfo)
-{
- if ((cinfo->global_state == DSTATE_SCANNING ||
- cinfo->global_state == DSTATE_RAW_OK) && cinfo->buffered_image) {
- /* Terminate this pass. */
- /* We do not require the whole pass to have been completed. */
- (*cinfo->master->finish_output_pass) (cinfo);
- cinfo->global_state = DSTATE_BUFPOST;
- } else if (cinfo->global_state != DSTATE_BUFPOST) {
- /* BUFPOST = repeat call after a suspension, anything else is error */
- ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
- }
- /* Read markers looking for SOS or EOI */
- while (cinfo->input_scan_number <= cinfo->output_scan_number &&
- ! cinfo->inputctl->eoi_reached) {
- if ((*cinfo->inputctl->consume_input) (cinfo) == JPEG_SUSPENDED)
- return FALSE; /* Suspend, come back later */
- }
- cinfo->global_state = DSTATE_BUFIMAGE;
- return TRUE;
-}
-
-#endif /* D_MULTISCAN_FILES_SUPPORTED */
-
-#endif //_FX_JPEG_TURBO_
+#if !defined(_FX_JPEG_TURBO_)
+/*
+ * jdapistd.c
+ *
+ * Copyright (C) 1994-1996, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains application interface code for the decompression half
+ * of the JPEG library. These are the "standard" API routines that are
+ * used in the normal full-decompression case. They are not used by a
+ * transcoding-only application. Note that if an application links in
+ * jpeg_start_decompress, it will end up linking in the entire decompressor.
+ * We thus must separate this file from jdapimin.c to avoid linking the
+ * whole decompression library into a transcoder.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+
+
+/* Forward declarations */
+LOCAL(boolean) output_pass_setup JPP((j_decompress_ptr cinfo));
+
+
+/*
+ * Decompression initialization.
+ * jpeg_read_header must be completed before calling this.
+ *
+ * If a multipass operating mode was selected, this will do all but the
+ * last pass, and thus may take a great deal of time.
+ *
+ * Returns FALSE if suspended. The return value need be inspected only if
+ * a suspending data source is used.
+ */
+
+GLOBAL(boolean)
+jpeg_start_decompress (j_decompress_ptr cinfo)
+{
+ if (cinfo->global_state == DSTATE_READY) {
+ /* First call: initialize master control, select active modules */
+ jinit_master_decompress(cinfo);
+ if (cinfo->buffered_image) {
+ /* No more work here; expecting jpeg_start_output next */
+ cinfo->global_state = DSTATE_BUFIMAGE;
+ return TRUE;
+ }
+ cinfo->global_state = DSTATE_PRELOAD;
+ }
+ if (cinfo->global_state == DSTATE_PRELOAD) {
+ /* If file has multiple scans, absorb them all into the coef buffer */
+ if (cinfo->inputctl->has_multiple_scans) {
+#ifdef D_MULTISCAN_FILES_SUPPORTED
+ for (;;) {
+ int retcode;
+ /* Call progress monitor hook if present */
+ if (cinfo->progress != NULL)
+ (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
+ /* Absorb some more input */
+ retcode = (*cinfo->inputctl->consume_input) (cinfo);
+ if (retcode == JPEG_SUSPENDED)
+ return FALSE;
+ if (retcode == JPEG_REACHED_EOI)
+ break;
+ /* Advance progress counter if appropriate */
+ if (cinfo->progress != NULL &&
+ (retcode == JPEG_ROW_COMPLETED || retcode == JPEG_REACHED_SOS)) {
+ if (++cinfo->progress->pass_counter >= cinfo->progress->pass_limit) {
+ /* jdmaster underestimated number of scans; ratchet up one scan */
+ cinfo->progress->pass_limit += (long) cinfo->total_iMCU_rows;
+ }
+ }
+ }
+#else
+ ERREXIT(cinfo, JERR_NOT_COMPILED);
+#endif /* D_MULTISCAN_FILES_SUPPORTED */
+ }
+ cinfo->output_scan_number = cinfo->input_scan_number;
+ } else if (cinfo->global_state != DSTATE_PRESCAN)
+ ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
+ /* Perform any dummy output passes, and set up for the final pass */
+ return output_pass_setup(cinfo);
+}
+
+
+/*
+ * Set up for an output pass, and perform any dummy pass(es) needed.
+ * Common subroutine for jpeg_start_decompress and jpeg_start_output.
+ * Entry: global_state = DSTATE_PRESCAN only if previously suspended.
+ * Exit: If done, returns TRUE and sets global_state for proper output mode.
+ * If suspended, returns FALSE and sets global_state = DSTATE_PRESCAN.
+ */
+
+LOCAL(boolean)
+output_pass_setup (j_decompress_ptr cinfo)
+{
+ if (cinfo->global_state != DSTATE_PRESCAN) {
+ /* First call: do pass setup */
+ (*cinfo->master->prepare_for_output_pass) (cinfo);
+ cinfo->output_scanline = 0;
+ cinfo->global_state = DSTATE_PRESCAN;
+ }
+ /* Loop over any required dummy passes */
+ while (cinfo->master->is_dummy_pass) {
+#ifdef QUANT_2PASS_SUPPORTED
+ /* Crank through the dummy pass */
+ while (cinfo->output_scanline < cinfo->output_height) {
+ JDIMENSION last_scanline;
+ /* Call progress monitor hook if present */
+ if (cinfo->progress != NULL) {
+ cinfo->progress->pass_counter = (long) cinfo->output_scanline;
+ cinfo->progress->pass_limit = (long) cinfo->output_height;
+ (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
+ }
+ /* Process some data */
+ last_scanline = cinfo->output_scanline;
+ (*cinfo->main->process_data) (cinfo, (JSAMPARRAY) NULL,
+ &cinfo->output_scanline, (JDIMENSION) 0);
+ if (cinfo->output_scanline == last_scanline)
+ return FALSE; /* No progress made, must suspend */
+ }
+ /* Finish up dummy pass, and set up for another one */
+ (*cinfo->master->finish_output_pass) (cinfo);
+ (*cinfo->master->prepare_for_output_pass) (cinfo);
+ cinfo->output_scanline = 0;
+#else
+ ERREXIT(cinfo, JERR_NOT_COMPILED);
+#endif /* QUANT_2PASS_SUPPORTED */
+ }
+ /* Ready for application to drive output pass through
+ * jpeg_read_scanlines or jpeg_read_raw_data.
+ */
+ cinfo->global_state = cinfo->raw_data_out ? DSTATE_RAW_OK : DSTATE_SCANNING;
+ return TRUE;
+}
+
+
+/*
+ * Read some scanlines of data from the JPEG decompressor.
+ *
+ * The return value will be the number of lines actually read.
+ * This may be less than the number requested in several cases,
+ * including bottom of image, data source suspension, and operating
+ * modes that emit multiple scanlines at a time.
+ *
+ * Note: we warn about excess calls to jpeg_read_scanlines() since
+ * this likely signals an application programmer error. However,
+ * an oversize buffer (max_lines > scanlines remaining) is not an error.
+ */
+
+GLOBAL(JDIMENSION)
+jpeg_read_scanlines (j_decompress_ptr cinfo, JSAMPARRAY scanlines,
+ JDIMENSION max_lines)
+{
+ JDIMENSION row_ctr;
+
+ if (cinfo->global_state != DSTATE_SCANNING)
+ return 0; /* XYQ 2010-6-27: don't throw exception here */
+/* ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); */
+ if (cinfo->output_scanline >= cinfo->output_height) {
+ WARNMS(cinfo, JWRN_TOO_MUCH_DATA);
+ return 0;
+ }
+
+ /* Call progress monitor hook if present */
+ if (cinfo->progress != NULL) {
+ cinfo->progress->pass_counter = (long) cinfo->output_scanline;
+ cinfo->progress->pass_limit = (long) cinfo->output_height;
+ (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
+ }
+
+ /* Process some data */
+ row_ctr = 0;
+ (*cinfo->main->process_data) (cinfo, scanlines, &row_ctr, max_lines);
+ cinfo->output_scanline += row_ctr;
+ return row_ctr;
+}
+
+
+/*
+ * Alternate entry point to read raw data.
+ * Processes exactly one iMCU row per call, unless suspended.
+ */
+
+GLOBAL(JDIMENSION)
+jpeg_read_raw_data (j_decompress_ptr cinfo, JSAMPIMAGE data,
+ JDIMENSION max_lines)
+{
+ JDIMENSION lines_per_iMCU_row;
+
+ if (cinfo->global_state != DSTATE_RAW_OK)
+ ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
+ if (cinfo->output_scanline >= cinfo->output_height) {
+ WARNMS(cinfo, JWRN_TOO_MUCH_DATA);
+ return 0;
+ }
+
+ /* Call progress monitor hook if present */
+ if (cinfo->progress != NULL) {
+ cinfo->progress->pass_counter = (long) cinfo->output_scanline;
+ cinfo->progress->pass_limit = (long) cinfo->output_height;
+ (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
+ }
+
+ /* Verify that at least one iMCU row can be returned. */
+ lines_per_iMCU_row = cinfo->max_v_samp_factor * cinfo->min_DCT_scaled_size;
+ if (max_lines < lines_per_iMCU_row)
+ ERREXIT(cinfo, JERR_BUFFER_SIZE);
+
+ /* Decompress directly into user's buffer. */
+ if (! (*cinfo->coef->decompress_data) (cinfo, data))
+ return 0; /* suspension forced, can do nothing more */
+
+ /* OK, we processed one iMCU row. */
+ cinfo->output_scanline += lines_per_iMCU_row;
+ return lines_per_iMCU_row;
+}
+
+
+/* Additional entry points for buffered-image mode. */
+
+#ifdef D_MULTISCAN_FILES_SUPPORTED
+
+/*
+ * Initialize for an output pass in buffered-image mode.
+ */
+
+GLOBAL(boolean)
+jpeg_start_output (j_decompress_ptr cinfo, int scan_number)
+{
+ if (cinfo->global_state != DSTATE_BUFIMAGE &&
+ cinfo->global_state != DSTATE_PRESCAN)
+ ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
+ /* Limit scan number to valid range */
+ if (scan_number <= 0)
+ scan_number = 1;
+ if (cinfo->inputctl->eoi_reached &&
+ scan_number > cinfo->input_scan_number)
+ scan_number = cinfo->input_scan_number;
+ cinfo->output_scan_number = scan_number;
+ /* Perform any dummy output passes, and set up for the real pass */
+ return output_pass_setup(cinfo);
+}
+
+
+/*
+ * Finish up after an output pass in buffered-image mode.
+ *
+ * Returns FALSE if suspended. The return value need be inspected only if
+ * a suspending data source is used.
+ */
+
+GLOBAL(boolean)
+jpeg_finish_output (j_decompress_ptr cinfo)
+{
+ if ((cinfo->global_state == DSTATE_SCANNING ||
+ cinfo->global_state == DSTATE_RAW_OK) && cinfo->buffered_image) {
+ /* Terminate this pass. */
+ /* We do not require the whole pass to have been completed. */
+ (*cinfo->master->finish_output_pass) (cinfo);
+ cinfo->global_state = DSTATE_BUFPOST;
+ } else if (cinfo->global_state != DSTATE_BUFPOST) {
+ /* BUFPOST = repeat call after a suspension, anything else is error */
+ ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
+ }
+ /* Read markers looking for SOS or EOI */
+ while (cinfo->input_scan_number <= cinfo->output_scan_number &&
+ ! cinfo->inputctl->eoi_reached) {
+ if ((*cinfo->inputctl->consume_input) (cinfo) == JPEG_SUSPENDED)
+ return FALSE; /* Suspend, come back later */
+ }
+ cinfo->global_state = DSTATE_BUFIMAGE;
+ return TRUE;
+}
+
+#endif /* D_MULTISCAN_FILES_SUPPORTED */
+
+#endif //_FX_JPEG_TURBO_
diff --git a/core/src/fxcodec/libjpeg/fpdfapi_jdcoefct.c b/core/src/fxcodec/libjpeg/fpdfapi_jdcoefct.c
index 89041f36f4..099833a8d6 100644
--- a/core/src/fxcodec/libjpeg/fpdfapi_jdcoefct.c
+++ b/core/src/fxcodec/libjpeg/fpdfapi_jdcoefct.c
@@ -1,739 +1,739 @@
-#if !defined(_FX_JPEG_TURBO_)
-/*
- * jdcoefct.c
- *
- * Copyright (C) 1994-1997, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- * For conditions of distribution and use, see the accompanying README file.
- *
- * This file contains the coefficient buffer controller for decompression.
- * This controller is the top level of the JPEG decompressor proper.
- * The coefficient buffer lies between entropy decoding and inverse-DCT steps.
- *
- * In buffered-image mode, this controller is the interface between
- * input-oriented processing and output-oriented processing.
- * Also, the input side (only) is used when reading a file for transcoding.
- */
-
-#define JPEG_INTERNALS
-#include "jinclude.h"
-#include "jpeglib.h"
-
-/* Block smoothing is only applicable for progressive JPEG, so: */
-#ifndef D_PROGRESSIVE_SUPPORTED
-#undef BLOCK_SMOOTHING_SUPPORTED
-#endif
-
-/* Private buffer controller object */
-
-typedef struct {
- struct jpeg_d_coef_controller pub; /* public fields */
-
- /* These variables keep track of the current location of the input side. */
- /* cinfo->input_iMCU_row is also used for this. */
- JDIMENSION MCU_ctr; /* counts MCUs processed in current row */
- int MCU_vert_offset; /* counts MCU rows within iMCU row */
- int MCU_rows_per_iMCU_row; /* number of such rows needed */
-
- /* The output side's location is represented by cinfo->output_iMCU_row. */
-
- /* In single-pass modes, it's sufficient to buffer just one MCU.
- * We allocate a workspace of D_MAX_BLOCKS_IN_MCU coefficient blocks,
- * and let the entropy decoder write into that workspace each time.
- * (On 80x86, the workspace is FAR even though it's not really very big;
- * this is to keep the module interfaces unchanged when a large coefficient
- * buffer is necessary.)
- * In multi-pass modes, this array points to the current MCU's blocks
- * within the virtual arrays; it is used only by the input side.
- */
- JBLOCKROW MCU_buffer[D_MAX_BLOCKS_IN_MCU];
-
-#ifdef D_MULTISCAN_FILES_SUPPORTED
- /* In multi-pass modes, we need a virtual block array for each component. */
- jvirt_barray_ptr whole_image[MAX_COMPONENTS];
-#endif
-
-#ifdef BLOCK_SMOOTHING_SUPPORTED
- /* When doing block smoothing, we latch coefficient Al values here */
- int * coef_bits_latch;
-#define SAVED_COEFS 6 /* we save coef_bits[0..5] */
-#endif
-} my_coef_controller;
-
-typedef my_coef_controller * my_coef_ptr;
-
-/* Forward declarations */
-METHODDEF(int) decompress_onepass
- JPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf));
-#ifdef D_MULTISCAN_FILES_SUPPORTED
-METHODDEF(int) decompress_data
- JPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf));
-#endif
-#ifdef BLOCK_SMOOTHING_SUPPORTED
-LOCAL(boolean) smoothing_ok JPP((j_decompress_ptr cinfo));
-METHODDEF(int) decompress_smooth_data
- JPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf));
-#endif
-
-
-LOCAL(void)
-start_iMCU_row (j_decompress_ptr cinfo)
-/* Reset within-iMCU-row counters for a new row (input side) */
-{
- my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
-
- /* In an interleaved scan, an MCU row is the same as an iMCU row.
- * In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows.
- * But at the bottom of the image, process only what's left.
- */
- if (cinfo->comps_in_scan > 1) {
- coef->MCU_rows_per_iMCU_row = 1;
- } else {
- if (cinfo->input_iMCU_row < (cinfo->total_iMCU_rows-1))
- coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->v_samp_factor;
- else
- coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->last_row_height;
- }
-
- coef->MCU_ctr = 0;
- coef->MCU_vert_offset = 0;
-}
-
-
-/*
- * Initialize for an input processing pass.
- */
-
-METHODDEF(void)
-start_input_pass (j_decompress_ptr cinfo)
-{
- cinfo->input_iMCU_row = 0;
- start_iMCU_row(cinfo);
-}
-
-
-/*
- * Initialize for an output processing pass.
- */
-
-METHODDEF(void)
-start_output_pass (j_decompress_ptr cinfo)
-{
-#ifdef BLOCK_SMOOTHING_SUPPORTED
- my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
-
- /* If multipass, check to see whether to use block smoothing on this pass */
- if (coef->pub.coef_arrays != NULL) {
- if (cinfo->do_block_smoothing && smoothing_ok(cinfo))
- coef->pub.decompress_data = decompress_smooth_data;
- else
- coef->pub.decompress_data = decompress_data;
- }
-#endif
- cinfo->output_iMCU_row = 0;
-}
-
-
-/*
- * Decompress and return some data in the single-pass case.
- * Always attempts to emit one fully interleaved MCU row ("iMCU" row).
- * Input and output must run in lockstep since we have only a one-MCU buffer.
- * Return value is JPEG_ROW_COMPLETED, JPEG_SCAN_COMPLETED, or JPEG_SUSPENDED.
- *
- * NB: output_buf contains a plane for each component in image,
- * which we index according to the component's SOF position.
- */
-
-METHODDEF(int)
-decompress_onepass (j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
-{
- my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
- JDIMENSION MCU_col_num; /* index of current MCU within row */
- JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1;
- JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;
- int blkn, ci, xindex, yindex, yoffset, useful_width;
- JSAMPARRAY output_ptr;
- JDIMENSION start_col, output_col;
- jpeg_component_info *compptr;
- inverse_DCT_method_ptr inverse_DCT;
-
- /* Loop to process as much as one whole iMCU row */
- for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;
- yoffset++) {
- for (MCU_col_num = coef->MCU_ctr; MCU_col_num <= last_MCU_col;
- MCU_col_num++) {
- /* Try to fetch an MCU. Entropy decoder expects buffer to be zeroed. */
- jzero_far((void FAR *) coef->MCU_buffer[0],
- (size_t) (cinfo->blocks_in_MCU * SIZEOF(JBLOCK)));
- if (! (*cinfo->entropy->decode_mcu) (cinfo, coef->MCU_buffer)) {
- /* Suspension forced; update state counters and exit */
- coef->MCU_vert_offset = yoffset;
- coef->MCU_ctr = MCU_col_num;
- return JPEG_SUSPENDED;
- }
- /* Determine where data should go in output_buf and do the IDCT thing.
- * We skip dummy blocks at the right and bottom edges (but blkn gets
- * incremented past them!). Note the inner loop relies on having
- * allocated the MCU_buffer[] blocks sequentially.
- */
- blkn = 0; /* index of current DCT block within MCU */
- for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
- compptr = cinfo->cur_comp_info[ci];
- /* Don't bother to IDCT an uninteresting component. */
- if (! compptr->component_needed) {
- blkn += compptr->MCU_blocks;
- continue;
- }
- inverse_DCT = cinfo->idct->inverse_DCT[compptr->component_index];
- useful_width = (MCU_col_num < last_MCU_col) ? compptr->MCU_width
- : compptr->last_col_width;
- output_ptr = output_buf[compptr->component_index] +
- yoffset * compptr->DCT_scaled_size;
- start_col = MCU_col_num * compptr->MCU_sample_width;
- for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
- if (cinfo->input_iMCU_row < last_iMCU_row ||
- yoffset+yindex < compptr->last_row_height) {
- output_col = start_col;
- for (xindex = 0; xindex < useful_width; xindex++) {
- (*inverse_DCT) (cinfo, compptr,
- (JCOEFPTR) coef->MCU_buffer[blkn+xindex],
- output_ptr, output_col);
- output_col += compptr->DCT_scaled_size;
- }
- }
- blkn += compptr->MCU_width;
- output_ptr += compptr->DCT_scaled_size;
- }
- }
- }
- /* Completed an MCU row, but perhaps not an iMCU row */
- coef->MCU_ctr = 0;
- }
- /* Completed the iMCU row, advance counters for next one */
- cinfo->output_iMCU_row++;
- if (++(cinfo->input_iMCU_row) < cinfo->total_iMCU_rows) {
- start_iMCU_row(cinfo);
- return JPEG_ROW_COMPLETED;
- }
- /* Completed the scan */
- (*cinfo->inputctl->finish_input_pass) (cinfo);
- return JPEG_SCAN_COMPLETED;
-}
-
-
-/*
- * Dummy consume-input routine for single-pass operation.
- */
-
-METHODDEF(int)
-dummy_consume_data (j_decompress_ptr cinfo)
-{
- return JPEG_SUSPENDED; /* Always indicate nothing was done */
-}
-
-
-#ifdef D_MULTISCAN_FILES_SUPPORTED
-
-/*
- * Consume input data and store it in the full-image coefficient buffer.
- * We read as much as one fully interleaved MCU row ("iMCU" row) per call,
- * ie, v_samp_factor block rows for each component in the scan.
- * Return value is JPEG_ROW_COMPLETED, JPEG_SCAN_COMPLETED, or JPEG_SUSPENDED.
- */
-
-METHODDEF(int)
-consume_data (j_decompress_ptr cinfo)
-{
- my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
- JDIMENSION MCU_col_num; /* index of current MCU within row */
- int blkn, ci, xindex, yindex, yoffset;
- JDIMENSION start_col;
- JBLOCKARRAY buffer[MAX_COMPS_IN_SCAN];
- JBLOCKROW buffer_ptr;
- jpeg_component_info *compptr;
-
- /* Align the virtual buffers for the components used in this scan. */
- for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
- compptr = cinfo->cur_comp_info[ci];
- buffer[ci] = (*cinfo->mem->access_virt_barray)
- ((j_common_ptr) cinfo, coef->whole_image[compptr->component_index],
- cinfo->input_iMCU_row * compptr->v_samp_factor,
- (JDIMENSION) compptr->v_samp_factor, TRUE);
- /* Note: entropy decoder expects buffer to be zeroed,
- * but this is handled automatically by the memory manager
- * because we requested a pre-zeroed array.
- */
- }
-
- /* Loop to process one whole iMCU row */
- for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;
- yoffset++) {
- for (MCU_col_num = coef->MCU_ctr; MCU_col_num < cinfo->MCUs_per_row;
- MCU_col_num++) {
- /* Construct list of pointers to DCT blocks belonging to this MCU */
- blkn = 0; /* index of current DCT block within MCU */
- for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
- compptr = cinfo->cur_comp_info[ci];
- start_col = MCU_col_num * compptr->MCU_width;
- for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
- buffer_ptr = buffer[ci][yindex+yoffset] + start_col;
- for (xindex = 0; xindex < compptr->MCU_width; xindex++) {
- coef->MCU_buffer[blkn++] = buffer_ptr++;
- }
- }
- }
- /* Try to fetch the MCU. */
- if (! (*cinfo->entropy->decode_mcu) (cinfo, coef->MCU_buffer)) {
- /* Suspension forced; update state counters and exit */
- coef->MCU_vert_offset = yoffset;
- coef->MCU_ctr = MCU_col_num;
- return JPEG_SUSPENDED;
- }
- }
- /* Completed an MCU row, but perhaps not an iMCU row */
- coef->MCU_ctr = 0;
- }
- /* Completed the iMCU row, advance counters for next one */
- if (++(cinfo->input_iMCU_row) < cinfo->total_iMCU_rows) {
- start_iMCU_row(cinfo);
- return JPEG_ROW_COMPLETED;
- }
- /* Completed the scan */
- (*cinfo->inputctl->finish_input_pass) (cinfo);
- return JPEG_SCAN_COMPLETED;
-}
-
-
-/*
- * Decompress and return some data in the multi-pass case.
- * Always attempts to emit one fully interleaved MCU row ("iMCU" row).
- * Return value is JPEG_ROW_COMPLETED, JPEG_SCAN_COMPLETED, or JPEG_SUSPENDED.
- *
- * NB: output_buf contains a plane for each component in image.
- */
-
-METHODDEF(int)
-decompress_data (j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
-{
- my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
- JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;
- JDIMENSION block_num;
- int ci, block_row, block_rows;
- JBLOCKARRAY buffer;
- JBLOCKROW buffer_ptr;
- JSAMPARRAY output_ptr;
- JDIMENSION output_col;
- jpeg_component_info *compptr;
- inverse_DCT_method_ptr inverse_DCT;
-
- /* Force some input to be done if we are getting ahead of the input. */
- while (cinfo->input_scan_number < cinfo->output_scan_number ||
- (cinfo->input_scan_number == cinfo->output_scan_number &&
- cinfo->input_iMCU_row <= cinfo->output_iMCU_row)) {
- if ((*cinfo->inputctl->consume_input)(cinfo) == JPEG_SUSPENDED)
- return JPEG_SUSPENDED;
- }
-
- /* OK, output from the virtual arrays. */
- for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
- ci++, compptr++) {
- /* Don't bother to IDCT an uninteresting component. */
- if (! compptr->component_needed)
- continue;
- /* Align the virtual buffer for this component. */
- buffer = (*cinfo->mem->access_virt_barray)
- ((j_common_ptr) cinfo, coef->whole_image[ci],
- cinfo->output_iMCU_row * compptr->v_samp_factor,
- (JDIMENSION) compptr->v_samp_factor, FALSE);
- /* Count non-dummy DCT block rows in this iMCU row. */
- if (cinfo->output_iMCU_row < last_iMCU_row)
- block_rows = compptr->v_samp_factor;
- else {
- /* NB: can't use last_row_height here; it is input-side-dependent! */
- block_rows = (int) (compptr->height_in_blocks % compptr->v_samp_factor);
- if (block_rows == 0) block_rows = compptr->v_samp_factor;
- }
- inverse_DCT = cinfo->idct->inverse_DCT[ci];
- output_ptr = output_buf[ci];
- /* Loop over all DCT blocks to be processed. */
- for (block_row = 0; block_row < block_rows; block_row++) {
- buffer_ptr = buffer[block_row];
- output_col = 0;
- for (block_num = 0; block_num < compptr->width_in_blocks; block_num++) {
- (*inverse_DCT) (cinfo, compptr, (JCOEFPTR) buffer_ptr,
- output_ptr, output_col);
- buffer_ptr++;
- output_col += compptr->DCT_scaled_size;
- }
- output_ptr += compptr->DCT_scaled_size;
- }
- }
-
- if (++(cinfo->output_iMCU_row) < cinfo->total_iMCU_rows)
- return JPEG_ROW_COMPLETED;
- return JPEG_SCAN_COMPLETED;
-}
-
-#endif /* D_MULTISCAN_FILES_SUPPORTED */
-
-
-#ifdef BLOCK_SMOOTHING_SUPPORTED
-
-/*
- * This code applies interblock smoothing as described by section K.8
- * of the JPEG standard: the first 5 AC coefficients are estimated from
- * the DC values of a DCT block and its 8 neighboring blocks.
- * We apply smoothing only for progressive JPEG decoding, and only if
- * the coefficients it can estimate are not yet known to full precision.
- */
-
-/* Natural-order array positions of the first 5 zigzag-order coefficients */
-#define Q01_POS 1
-#define Q10_POS 8
-#define Q20_POS 16
-#define Q11_POS 9
-#define Q02_POS 2
-
-/*
- * Determine whether block smoothing is applicable and safe.
- * We also latch the current states of the coef_bits[] entries for the
- * AC coefficients; otherwise, if the input side of the decompressor
- * advances into a new scan, we might think the coefficients are known
- * more accurately than they really are.
- */
-
-LOCAL(boolean)
-smoothing_ok (j_decompress_ptr cinfo)
-{
- my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
- boolean smoothing_useful = FALSE;
- int ci, coefi;
- jpeg_component_info *compptr;
- JQUANT_TBL * qtable;
- int * coef_bits;
- int * coef_bits_latch;
-
- if (! cinfo->progressive_mode || cinfo->coef_bits == NULL)
- return FALSE;
-
- /* Allocate latch area if not already done */
- if (coef->coef_bits_latch == NULL)
- coef->coef_bits_latch = (int *)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- cinfo->num_components *
- (SAVED_COEFS * SIZEOF(int)));
- coef_bits_latch = coef->coef_bits_latch;
-
- for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
- ci++, compptr++) {
- /* All components' quantization values must already be latched. */
- if ((qtable = compptr->quant_table) == NULL)
- return FALSE;
- /* Verify DC & first 5 AC quantizers are nonzero to avoid zero-divide. */
- if (qtable->quantval[0] == 0 ||
- qtable->quantval[Q01_POS] == 0 ||
- qtable->quantval[Q10_POS] == 0 ||
- qtable->quantval[Q20_POS] == 0 ||
- qtable->quantval[Q11_POS] == 0 ||
- qtable->quantval[Q02_POS] == 0)
- return FALSE;
- /* DC values must be at least partly known for all components. */
- coef_bits = cinfo->coef_bits[ci];
- if (coef_bits[0] < 0)
- return FALSE;
- /* Block smoothing is helpful if some AC coefficients remain inaccurate. */
- for (coefi = 1; coefi <= 5; coefi++) {
- coef_bits_latch[coefi] = coef_bits[coefi];
- if (coef_bits[coefi] != 0)
- smoothing_useful = TRUE;
- }
- coef_bits_latch += SAVED_COEFS;
- }
-
- return smoothing_useful;
-}
-
-
-/*
- * Variant of decompress_data for use when doing block smoothing.
- */
-
-METHODDEF(int)
-decompress_smooth_data (j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
-{
- my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
- JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;
- JDIMENSION block_num, last_block_column;
- int ci, block_row, block_rows, access_rows;
- JBLOCKARRAY buffer;
- JBLOCKROW buffer_ptr, prev_block_row, next_block_row;
- JSAMPARRAY output_ptr;
- JDIMENSION output_col;
- jpeg_component_info *compptr;
- inverse_DCT_method_ptr inverse_DCT;
- boolean first_row, last_row;
- JBLOCK workspace;
- int *coef_bits;
- JQUANT_TBL *quanttbl;
- INT32 Q00,Q01,Q02,Q10,Q11,Q20, num;
- int DC1,DC2,DC3,DC4,DC5,DC6,DC7,DC8,DC9;
- int Al, pred;
-
- /* Force some input to be done if we are getting ahead of the input. */
- while (cinfo->input_scan_number <= cinfo->output_scan_number &&
- ! cinfo->inputctl->eoi_reached) {
- if (cinfo->input_scan_number == cinfo->output_scan_number) {
- /* If input is working on current scan, we ordinarily want it to
- * have completed the current row. But if input scan is DC,
- * we want it to keep one row ahead so that next block row's DC
- * values are up to date.
- */
- JDIMENSION delta = (cinfo->Ss == 0) ? 1 : 0;
- if (cinfo->input_iMCU_row > cinfo->output_iMCU_row+delta)
- break;
- }
- if ((*cinfo->inputctl->consume_input)(cinfo) == JPEG_SUSPENDED)
- return JPEG_SUSPENDED;
- }
-
- /* OK, output from the virtual arrays. */
- for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
- ci++, compptr++) {
- /* Don't bother to IDCT an uninteresting component. */
- if (! compptr->component_needed)
- continue;
- /* Count non-dummy DCT block rows in this iMCU row. */
- if (cinfo->output_iMCU_row < last_iMCU_row) {
- block_rows = compptr->v_samp_factor;
- access_rows = block_rows * 2; /* this and next iMCU row */
- last_row = FALSE;
- } else {
- /* NB: can't use last_row_height here; it is input-side-dependent! */
- block_rows = (int) (compptr->height_in_blocks % compptr->v_samp_factor);
- if (block_rows == 0) block_rows = compptr->v_samp_factor;
- access_rows = block_rows; /* this iMCU row only */
- last_row = TRUE;
- }
- /* Align the virtual buffer for this component. */
- if (cinfo->output_iMCU_row > 0) {
- access_rows += compptr->v_samp_factor; /* prior iMCU row too */
- buffer = (*cinfo->mem->access_virt_barray)
- ((j_common_ptr) cinfo, coef->whole_image[ci],
- (cinfo->output_iMCU_row - 1) * compptr->v_samp_factor,
- (JDIMENSION) access_rows, FALSE);
- buffer += compptr->v_samp_factor; /* point to current iMCU row */
- first_row = FALSE;
- } else {
- buffer = (*cinfo->mem->access_virt_barray)
- ((j_common_ptr) cinfo, coef->whole_image[ci],
- (JDIMENSION) 0, (JDIMENSION) access_rows, FALSE);
- first_row = TRUE;
- }
- /* Fetch component-dependent info */
- coef_bits = coef->coef_bits_latch + (ci * SAVED_COEFS);
- quanttbl = compptr->quant_table;
- Q00 = quanttbl->quantval[0];
- Q01 = quanttbl->quantval[Q01_POS];
- Q10 = quanttbl->quantval[Q10_POS];
- Q20 = quanttbl->quantval[Q20_POS];
- Q11 = quanttbl->quantval[Q11_POS];
- Q02 = quanttbl->quantval[Q02_POS];
- inverse_DCT = cinfo->idct->inverse_DCT[ci];
- output_ptr = output_buf[ci];
- /* Loop over all DCT blocks to be processed. */
- for (block_row = 0; block_row < block_rows; block_row++) {
- buffer_ptr = buffer[block_row];
- if (first_row && block_row == 0)
- prev_block_row = buffer_ptr;
- else
- prev_block_row = buffer[block_row-1];
- if (last_row && block_row == block_rows-1)
- next_block_row = buffer_ptr;
- else
- next_block_row = buffer[block_row+1];
- /* We fetch the surrounding DC values using a sliding-register approach.
- * Initialize all nine here so as to do the right thing on narrow pics.
- */
- DC1 = DC2 = DC3 = (int) prev_block_row[0][0];
- DC4 = DC5 = DC6 = (int) buffer_ptr[0][0];
- DC7 = DC8 = DC9 = (int) next_block_row[0][0];
- output_col = 0;
- last_block_column = compptr->width_in_blocks - 1;
- for (block_num = 0; block_num <= last_block_column; block_num++) {
- /* Fetch current DCT block into workspace so we can modify it. */
- jcopy_block_row(buffer_ptr, (JBLOCKROW) workspace, (JDIMENSION) 1);
- /* Update DC values */
- if (block_num < last_block_column) {
- DC3 = (int) prev_block_row[1][0];
- DC6 = (int) buffer_ptr[1][0];
- DC9 = (int) next_block_row[1][0];
- }
- /* Compute coefficient estimates per K.8.
- * An estimate is applied only if coefficient is still zero,
- * and is not known to be fully accurate.
- */
- /* AC01 */
- if ((Al=coef_bits[1]) != 0 && workspace[1] == 0) {
- num = 36 * Q00 * (DC4 - DC6);
- if (num >= 0) {
- pred = (int) (((Q01<<7) + num) / (Q01<<8));
- if (Al > 0 && pred >= (1<<Al))
- pred = (1<<Al)-1;
- } else {
- pred = (int) (((Q01<<7) - num) / (Q01<<8));
- if (Al > 0 && pred >= (1<<Al))
- pred = (1<<Al)-1;
- pred = -pred;
- }
- workspace[1] = (JCOEF) pred;
- }
- /* AC10 */
- if ((Al=coef_bits[2]) != 0 && workspace[8] == 0) {
- num = 36 * Q00 * (DC2 - DC8);
- if (num >= 0) {
- pred = (int) (((Q10<<7) + num) / (Q10<<8));
- if (Al > 0 && pred >= (1<<Al))
- pred = (1<<Al)-1;
- } else {
- pred = (int) (((Q10<<7) - num) / (Q10<<8));
- if (Al > 0 && pred >= (1<<Al))
- pred = (1<<Al)-1;
- pred = -pred;
- }
- workspace[8] = (JCOEF) pred;
- }
- /* AC20 */
- if ((Al=coef_bits[3]) != 0 && workspace[16] == 0) {
- num = 9 * Q00 * (DC2 + DC8 - 2*DC5);
- if (num >= 0) {
- pred = (int) (((Q20<<7) + num) / (Q20<<8));
- if (Al > 0 && pred >= (1<<Al))
- pred = (1<<Al)-1;
- } else {
- pred = (int) (((Q20<<7) - num) / (Q20<<8));
- if (Al > 0 && pred >= (1<<Al))
- pred = (1<<Al)-1;
- pred = -pred;
- }
- workspace[16] = (JCOEF) pred;
- }
- /* AC11 */
- if ((Al=coef_bits[4]) != 0 && workspace[9] == 0) {
- num = 5 * Q00 * (DC1 - DC3 - DC7 + DC9);
- if (num >= 0) {
- pred = (int) (((Q11<<7) + num) / (Q11<<8));
- if (Al > 0 && pred >= (1<<Al))
- pred = (1<<Al)-1;
- } else {
- pred = (int) (((Q11<<7) - num) / (Q11<<8));
- if (Al > 0 && pred >= (1<<Al))
- pred = (1<<Al)-1;
- pred = -pred;
- }
- workspace[9] = (JCOEF) pred;
- }
- /* AC02 */
- if ((Al=coef_bits[5]) != 0 && workspace[2] == 0) {
- num = 9 * Q00 * (DC4 + DC6 - 2*DC5);
- if (num >= 0) {
- pred = (int) (((Q02<<7) + num) / (Q02<<8));
- if (Al > 0 && pred >= (1<<Al))
- pred = (1<<Al)-1;
- } else {
- pred = (int) (((Q02<<7) - num) / (Q02<<8));
- if (Al > 0 && pred >= (1<<Al))
- pred = (1<<Al)-1;
- pred = -pred;
- }
- workspace[2] = (JCOEF) pred;
- }
- /* OK, do the IDCT */
- (*inverse_DCT) (cinfo, compptr, (JCOEFPTR) workspace,
- output_ptr, output_col);
- /* Advance for next column */
- DC1 = DC2; DC2 = DC3;
- DC4 = DC5; DC5 = DC6;
- DC7 = DC8; DC8 = DC9;
- buffer_ptr++, prev_block_row++, next_block_row++;
- output_col += compptr->DCT_scaled_size;
- }
- output_ptr += compptr->DCT_scaled_size;
- }
- }
-
- if (++(cinfo->output_iMCU_row) < cinfo->total_iMCU_rows)
- return JPEG_ROW_COMPLETED;
- return JPEG_SCAN_COMPLETED;
-}
-
-#endif /* BLOCK_SMOOTHING_SUPPORTED */
-
-
-/*
- * Initialize coefficient buffer controller.
- */
-
-GLOBAL(void)
-jinit_d_coef_controller (j_decompress_ptr cinfo, boolean need_full_buffer)
-{
- my_coef_ptr coef;
-
- coef = (my_coef_ptr)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- SIZEOF(my_coef_controller));
- cinfo->coef = (struct jpeg_d_coef_controller *) coef;
- coef->pub.start_input_pass = start_input_pass;
- coef->pub.start_output_pass = start_output_pass;
-#ifdef BLOCK_SMOOTHING_SUPPORTED
- coef->coef_bits_latch = NULL;
-#endif
-
- /* Create the coefficient buffer. */
- if (need_full_buffer) {
-#ifdef D_MULTISCAN_FILES_SUPPORTED
- /* Allocate a full-image virtual array for each component, */
- /* padded to a multiple of samp_factor DCT blocks in each direction. */
- /* Note we ask for a pre-zeroed array. */
- int ci, access_rows;
- jpeg_component_info *compptr;
-
- for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
- ci++, compptr++) {
- access_rows = compptr->v_samp_factor;
-#ifdef BLOCK_SMOOTHING_SUPPORTED
- /* If block smoothing could be used, need a bigger window */
- if (cinfo->progressive_mode)
- access_rows *= 3;
-#endif
- coef->whole_image[ci] = (*cinfo->mem->request_virt_barray)
- ((j_common_ptr) cinfo, JPOOL_IMAGE, TRUE,
- (JDIMENSION) jround_up((long) compptr->width_in_blocks,
- (long) compptr->h_samp_factor),
- (JDIMENSION) jround_up((long) compptr->height_in_blocks,
- (long) compptr->v_samp_factor),
- (JDIMENSION) access_rows);
- }
- coef->pub.consume_data = consume_data;
- coef->pub.decompress_data = decompress_data;
- coef->pub.coef_arrays = coef->whole_image; /* link to virtual arrays */
-#else
- ERREXIT(cinfo, JERR_NOT_COMPILED);
-#endif
- } else {
- /* We only need a single-MCU buffer. */
- JBLOCKROW buffer;
- int i;
-
- buffer = (JBLOCKROW)
- (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- D_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK));
- for (i = 0; i < D_MAX_BLOCKS_IN_MCU; i++) {
- coef->MCU_buffer[i] = buffer + i;
- }
- coef->pub.consume_data = dummy_consume_data;
- coef->pub.decompress_data = decompress_onepass;
- coef->pub.coef_arrays = NULL; /* flag for no virtual arrays */
- }
-}
-
-#endif //_FX_JPEG_TURBO_
+#if !defined(_FX_JPEG_TURBO_)
+/*
+ * jdcoefct.c
+ *
+ * Copyright (C) 1994-1997, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains the coefficient buffer controller for decompression.
+ * This controller is the top level of the JPEG decompressor proper.
+ * The coefficient buffer lies between entropy decoding and inverse-DCT steps.
+ *
+ * In buffered-image mode, this controller is the interface between
+ * input-oriented processing and output-oriented processing.
+ * Also, the input side (only) is used when reading a file for transcoding.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+
+/* Block smoothing is only applicable for progressive JPEG, so: */
+#ifndef D_PROGRESSIVE_SUPPORTED
+#undef BLOCK_SMOOTHING_SUPPORTED
+#endif
+
+/* Private buffer controller object */
+
+typedef struct {
+ struct jpeg_d_coef_controller pub; /* public fields */
+
+ /* These variables keep track of the current location of the input side. */
+ /* cinfo->input_iMCU_row is also used for this. */
+ JDIMENSION MCU_ctr; /* counts MCUs processed in current row */
+ int MCU_vert_offset; /* counts MCU rows within iMCU row */
+ int MCU_rows_per_iMCU_row; /* number of such rows needed */
+
+ /* The output side's location is represented by cinfo->output_iMCU_row. */
+
+ /* In single-pass modes, it's sufficient to buffer just one MCU.
+ * We allocate a workspace of D_MAX_BLOCKS_IN_MCU coefficient blocks,
+ * and let the entropy decoder write into that workspace each time.
+ * (On 80x86, the workspace is FAR even though it's not really very big;
+ * this is to keep the module interfaces unchanged when a large coefficient
+ * buffer is necessary.)
+ * In multi-pass modes, this array points to the current MCU's blocks
+ * within the virtual arrays; it is used only by the input side.
+ */
+ JBLOCKROW MCU_buffer[D_MAX_BLOCKS_IN_MCU];
+
+#ifdef D_MULTISCAN_FILES_SUPPORTED
+ /* In multi-pass modes, we need a virtual block array for each component. */
+ jvirt_barray_ptr whole_image[MAX_COMPONENTS];
+#endif
+
+#ifdef BLOCK_SMOOTHING_SUPPORTED
+ /* When doing block smoothing, we latch coefficient Al values here */
+ int * coef_bits_latch;
+#define SAVED_COEFS 6 /* we save coef_bits[0..5] */
+#endif
+} my_coef_controller;
+
+typedef my_coef_controller * my_coef_ptr;
+
+/* Forward declarations */
+METHODDEF(int) decompress_onepass
+ JPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf));
+#ifdef D_MULTISCAN_FILES_SUPPORTED
+METHODDEF(int) decompress_data
+ JPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf));
+#endif
+#ifdef BLOCK_SMOOTHING_SUPPORTED
+LOCAL(boolean) smoothing_ok JPP((j_decompress_ptr cinfo));
+METHODDEF(int) decompress_smooth_data
+ JPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf));
+#endif
+
+
+LOCAL(void)
+start_iMCU_row (j_decompress_ptr cinfo)
+/* Reset within-iMCU-row counters for a new row (input side) */
+{
+ my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
+
+ /* In an interleaved scan, an MCU row is the same as an iMCU row.
+ * In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows.
+ * But at the bottom of the image, process only what's left.
+ */
+ if (cinfo->comps_in_scan > 1) {
+ coef->MCU_rows_per_iMCU_row = 1;
+ } else {
+ if (cinfo->input_iMCU_row < (cinfo->total_iMCU_rows-1))
+ coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->v_samp_factor;
+ else
+ coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->last_row_height;
+ }
+
+ coef->MCU_ctr = 0;
+ coef->MCU_vert_offset = 0;
+}
+
+
+/*
+ * Initialize for an input processing pass.
+ */
+
+METHODDEF(void)
+start_input_pass (j_decompress_ptr cinfo)
+{
+ cinfo->input_iMCU_row = 0;
+ start_iMCU_row(cinfo);
+}
+
+
+/*
+ * Initialize for an output processing pass.
+ */
+
+METHODDEF(void)
+start_output_pass (j_decompress_ptr cinfo)
+{
+#ifdef BLOCK_SMOOTHING_SUPPORTED
+ my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
+
+ /* If multipass, check to see whether to use block smoothing on this pass */
+ if (coef->pub.coef_arrays != NULL) {
+ if (cinfo->do_block_smoothing && smoothing_ok(cinfo))
+ coef->pub.decompress_data = decompress_smooth_data;
+ else
+ coef->pub.decompress_data = decompress_data;
+ }
+#endif
+ cinfo->output_iMCU_row = 0;
+}
+
+
+/*
+ * Decompress and return some data in the single-pass case.
+ * Always attempts to emit one fully interleaved MCU row ("iMCU" row).
+ * Input and output must run in lockstep since we have only a one-MCU buffer.
+ * Return value is JPEG_ROW_COMPLETED, JPEG_SCAN_COMPLETED, or JPEG_SUSPENDED.
+ *
+ * NB: output_buf contains a plane for each component in image,
+ * which we index according to the component's SOF position.
+ */
+
+METHODDEF(int)
+decompress_onepass (j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
+{
+ my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
+ JDIMENSION MCU_col_num; /* index of current MCU within row */
+ JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1;
+ JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;
+ int blkn, ci, xindex, yindex, yoffset, useful_width;
+ JSAMPARRAY output_ptr;
+ JDIMENSION start_col, output_col;
+ jpeg_component_info *compptr;
+ inverse_DCT_method_ptr inverse_DCT;
+
+ /* Loop to process as much as one whole iMCU row */
+ for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;
+ yoffset++) {
+ for (MCU_col_num = coef->MCU_ctr; MCU_col_num <= last_MCU_col;
+ MCU_col_num++) {
+ /* Try to fetch an MCU. Entropy decoder expects buffer to be zeroed. */
+ jzero_far((void FAR *) coef->MCU_buffer[0],
+ (size_t) (cinfo->blocks_in_MCU * SIZEOF(JBLOCK)));
+ if (! (*cinfo->entropy->decode_mcu) (cinfo, coef->MCU_buffer)) {
+ /* Suspension forced; update state counters and exit */
+ coef->MCU_vert_offset = yoffset;
+ coef->MCU_ctr = MCU_col_num;
+ return JPEG_SUSPENDED;
+ }
+ /* Determine where data should go in output_buf and do the IDCT thing.
+ * We skip dummy blocks at the right and bottom edges (but blkn gets
+ * incremented past them!). Note the inner loop relies on having
+ * allocated the MCU_buffer[] blocks sequentially.
+ */
+ blkn = 0; /* index of current DCT block within MCU */
+ for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
+ compptr = cinfo->cur_comp_info[ci];
+ /* Don't bother to IDCT an uninteresting component. */
+ if (! compptr->component_needed) {
+ blkn += compptr->MCU_blocks;
+ continue;
+ }
+ inverse_DCT = cinfo->idct->inverse_DCT[compptr->component_index];
+ useful_width = (MCU_col_num < last_MCU_col) ? compptr->MCU_width
+ : compptr->last_col_width;
+ output_ptr = output_buf[compptr->component_index] +
+ yoffset * compptr->DCT_scaled_size;
+ start_col = MCU_col_num * compptr->MCU_sample_width;
+ for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
+ if (cinfo->input_iMCU_row < last_iMCU_row ||
+ yoffset+yindex < compptr->last_row_height) {
+ output_col = start_col;
+ for (xindex = 0; xindex < useful_width; xindex++) {
+ (*inverse_DCT) (cinfo, compptr,
+ (JCOEFPTR) coef->MCU_buffer[blkn+xindex],
+ output_ptr, output_col);
+ output_col += compptr->DCT_scaled_size;
+ }
+ }
+ blkn += compptr->MCU_width;
+ output_ptr += compptr->DCT_scaled_size;
+ }
+ }
+ }
+ /* Completed an MCU row, but perhaps not an iMCU row */
+ coef->MCU_ctr = 0;
+ }
+ /* Completed the iMCU row, advance counters for next one */
+ cinfo->output_iMCU_row++;
+ if (++(cinfo->input_iMCU_row) < cinfo->total_iMCU_rows) {
+ start_iMCU_row(cinfo);
+ return JPEG_ROW_COMPLETED;
+ }
+ /* Completed the scan */
+ (*cinfo->inputctl->finish_input_pass) (cinfo);
+ return JPEG_SCAN_COMPLETED;
+}
+
+
+/*
+ * Dummy consume-input routine for single-pass operation.
+ */
+
+METHODDEF(int)
+dummy_consume_data (j_decompress_ptr cinfo)
+{
+ return JPEG_SUSPENDED; /* Always indicate nothing was done */
+}
+
+
+#ifdef D_MULTISCAN_FILES_SUPPORTED
+
+/*
+ * Consume input data and store it in the full-image coefficient buffer.
+ * We read as much as one fully interleaved MCU row ("iMCU" row) per call,
+ * ie, v_samp_factor block rows for each component in the scan.
+ * Return value is JPEG_ROW_COMPLETED, JPEG_SCAN_COMPLETED, or JPEG_SUSPENDED.
+ */
+
+METHODDEF(int)
+consume_data (j_decompress_ptr cinfo)
+{
+ my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
+ JDIMENSION MCU_col_num; /* index of current MCU within row */
+ int blkn, ci, xindex, yindex, yoffset;
+ JDIMENSION start_col;
+ JBLOCKARRAY buffer[MAX_COMPS_IN_SCAN];
+ JBLOCKROW buffer_ptr;
+ jpeg_component_info *compptr;
+
+ /* Align the virtual buffers for the components used in this scan. */
+ for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
+ compptr = cinfo->cur_comp_info[ci];
+ buffer[ci] = (*cinfo->mem->access_virt_barray)
+ ((j_common_ptr) cinfo, coef->whole_image[compptr->component_index],
+ cinfo->input_iMCU_row * compptr->v_samp_factor,
+ (JDIMENSION) compptr->v_samp_factor, TRUE);
+ /* Note: entropy decoder expects buffer to be zeroed,
+ * but this is handled automatically by the memory manager
+ * because we requested a pre-zeroed array.
+ */
+ }
+
+ /* Loop to process one whole iMCU row */
+ for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;
+ yoffset++) {
+ for (MCU_col_num = coef->MCU_ctr; MCU_col_num < cinfo->MCUs_per_row;
+ MCU_col_num++) {
+ /* Construct list of pointers to DCT blocks belonging to this MCU */
+ blkn = 0; /* index of current DCT block within MCU */
+ for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
+ compptr = cinfo->cur_comp_info[ci];
+ start_col = MCU_col_num * compptr->MCU_width;
+ for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
+ buffer_ptr = buffer[ci][yindex+yoffset] + start_col;
+ for (xindex = 0; xindex < compptr->MCU_width; xindex++) {
+ coef->MCU_buffer[blkn++] = buffer_ptr++;
+ }
+ }
+ }
+ /* Try to fetch the MCU. */
+ if (! (*cinfo->entropy->decode_mcu) (cinfo, coef->MCU_buffer)) {
+ /* Suspension forced; update state counters and exit */
+ coef->MCU_vert_offset = yoffset;
+ coef->MCU_ctr = MCU_col_num;
+ return JPEG_SUSPENDED;
+ }
+ }
+ /* Completed an MCU row, but perhaps not an iMCU row */
+ coef->MCU_ctr = 0;
+ }
+ /* Completed the iMCU row, advance counters for next one */
+ if (++(cinfo->input_iMCU_row) < cinfo->total_iMCU_rows) {
+ start_iMCU_row(cinfo);
+ return JPEG_ROW_COMPLETED;
+ }
+ /* Completed the scan */
+ (*cinfo->inputctl->finish_input_pass) (cinfo);
+ return JPEG_SCAN_COMPLETED;
+}
+
+
+/*
+ * Decompress and return some data in the multi-pass case.
+ * Always attempts to emit one fully interleaved MCU row ("iMCU" row).
+ * Return value is JPEG_ROW_COMPLETED, JPEG_SCAN_COMPLETED, or JPEG_SUSPENDED.
+ *
+ * NB: output_buf contains a plane for each component in image.
+ */
+
+METHODDEF(int)
+decompress_data (j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
+{
+ my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
+ JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;
+ JDIMENSION block_num;
+ int ci, block_row, block_rows;
+ JBLOCKARRAY buffer;
+ JBLOCKROW buffer_ptr;
+ JSAMPARRAY output_ptr;
+ JDIMENSION output_col;
+ jpeg_component_info *compptr;
+ inverse_DCT_method_ptr inverse_DCT;
+
+ /* Force some input to be done if we are getting ahead of the input. */
+ while (cinfo->input_scan_number < cinfo->output_scan_number ||
+ (cinfo->input_scan_number == cinfo->output_scan_number &&
+ cinfo->input_iMCU_row <= cinfo->output_iMCU_row)) {
+ if ((*cinfo->inputctl->consume_input)(cinfo) == JPEG_SUSPENDED)
+ return JPEG_SUSPENDED;
+ }
+
+ /* OK, output from the virtual arrays. */
+ for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+ ci++, compptr++) {
+ /* Don't bother to IDCT an uninteresting component. */
+ if (! compptr->component_needed)
+ continue;
+ /* Align the virtual buffer for this component. */
+ buffer = (*cinfo->mem->access_virt_barray)
+ ((j_common_ptr) cinfo, coef->whole_image[ci],
+ cinfo->output_iMCU_row * compptr->v_samp_factor,
+ (JDIMENSION) compptr->v_samp_factor, FALSE);
+ /* Count non-dummy DCT block rows in this iMCU row. */
+ if (cinfo->output_iMCU_row < last_iMCU_row)
+ block_rows = compptr->v_samp_factor;
+ else {
+ /* NB: can't use last_row_height here; it is input-side-dependent! */
+ block_rows = (int) (compptr->height_in_blocks % compptr->v_samp_factor);
+ if (block_rows == 0) block_rows = compptr->v_samp_factor;
+ }
+ inverse_DCT = cinfo->idct->inverse_DCT[ci];
+ output_ptr = output_buf[ci];
+ /* Loop over all DCT blocks to be processed. */
+ for (block_row = 0; block_row < block_rows; block_row++) {
+ buffer_ptr = buffer[block_row];
+ output_col = 0;
+ for (block_num = 0; block_num < compptr->width_in_blocks; block_num++) {
+ (*inverse_DCT) (cinfo, compptr, (JCOEFPTR) buffer_ptr,
+ output_ptr, output_col);
+ buffer_ptr++;
+ output_col += compptr->DCT_scaled_size;
+ }
+ output_ptr += compptr->DCT_scaled_size;
+ }
+ }
+
+ if (++(cinfo->output_iMCU_row) < cinfo->total_iMCU_rows)
+ return JPEG_ROW_COMPLETED;
+ return JPEG_SCAN_COMPLETED;
+}
+
+#endif /* D_MULTISCAN_FILES_SUPPORTED */
+
+
+#ifdef BLOCK_SMOOTHING_SUPPORTED
+
+/*
+ * This code applies interblock smoothing as described by section K.8
+ * of the JPEG standard: the first 5 AC coefficients are estimated from
+ * the DC values of a DCT block and its 8 neighboring blocks.
+ * We apply smoothing only for progressive JPEG decoding, and only if
+ * the coefficients it can estimate are not yet known to full precision.
+ */
+
+/* Natural-order array positions of the first 5 zigzag-order coefficients */
+#define Q01_POS 1
+#define Q10_POS 8
+#define Q20_POS 16
+#define Q11_POS 9
+#define Q02_POS 2
+
+/*
+ * Determine whether block smoothing is applicable and safe.
+ * We also latch the current states of the coef_bits[] entries for the
+ * AC coefficients; otherwise, if the input side of the decompressor
+ * advances into a new scan, we might think the coefficients are known
+ * more accurately than they really are.
+ */
+
+LOCAL(boolean)
+smoothing_ok (j_decompress_ptr cinfo)
+{
+ my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
+ boolean smoothing_useful = FALSE;
+ int ci, coefi;
+ jpeg_component_info *compptr;
+ JQUANT_TBL * qtable;
+ int * coef_bits;
+ int * coef_bits_latch;
+
+ if (! cinfo->progressive_mode || cinfo->coef_bits == NULL)
+ return FALSE;
+
+ /* Allocate latch area if not already done */
+ if (coef->coef_bits_latch == NULL)
+ coef->coef_bits_latch = (int *)
+ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ cinfo->num_components *
+ (SAVED_COEFS * SIZEOF(int)));
+ coef_bits_latch = coef->coef_bits_latch;
+
+ for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+ ci++, compptr++) {
+ /* All components' quantization values must already be latched. */
+ if ((qtable = compptr->quant_table) == NULL)
+ return FALSE;
+ /* Verify DC & first 5 AC quantizers are nonzero to avoid zero-divide. */
+ if (qtable->quantval[0] == 0 ||
+ qtable->quantval[Q01_POS] == 0 ||
+ qtable->quantval[Q10_POS] == 0 ||
+ qtable->quantval[Q20_POS] == 0 ||
+ qtable->quantval[Q11_POS] == 0 ||
+ qtable->quantval[Q02_POS] == 0)
+ return FALSE;
+ /* DC values must be at least partly known for all components. */
+ coef_bits = cinfo->coef_bits[ci];
+ if (coef_bits[0] < 0)
+ return FALSE;
+ /* Block smoothing is helpful if some AC coefficients remain inaccurate. */
+ for (coefi = 1; coefi <= 5; coefi++) {
+ coef_bits_latch[coefi] = coef_bits[coefi];
+ if (coef_bits[coefi] != 0)
+ smoothing_useful = TRUE;
+ }
+ coef_bits_latch += SAVED_COEFS;
+ }
+
+ return smoothing_useful;
+}
+
+
+/*
+ * Variant of decompress_data for use when doing block smoothing.
+ */
+
+METHODDEF(int)
+decompress_smooth_data (j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
+{
+ my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
+ JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;
+ JDIMENSION block_num, last_block_column;
+ int ci, block_row, block_rows, access_rows;
+ JBLOCKARRAY buffer;
+ JBLOCKROW buffer_ptr, prev_block_row, next_block_row;
+ JSAMPARRAY output_ptr;
+ JDIMENSION output_col;
+ jpeg_component_info *compptr;
+ inverse_DCT_method_ptr inverse_DCT;
+ boolean first_row, last_row;
+ JBLOCK workspace;
+ int *coef_bits;
+ JQUANT_TBL *quanttbl;
+ INT32 Q00,Q01,Q02,Q10,Q11,Q20, num;
+ int DC1,DC2,DC3,DC4,DC5,DC6,DC7,DC8,DC9;
+ int Al, pred;
+
+ /* Force some input to be done if we are getting ahead of the input. */
+ while (cinfo->input_scan_number <= cinfo->output_scan_number &&
+ ! cinfo->inputctl->eoi_reached) {
+ if (cinfo->input_scan_number == cinfo->output_scan_number) {
+ /* If input is working on current scan, we ordinarily want it to
+ * have completed the current row. But if input scan is DC,
+ * we want it to keep one row ahead so that next block row's DC
+ * values are up to date.
+ */
+ JDIMENSION delta = (cinfo->Ss == 0) ? 1 : 0;
+ if (cinfo->input_iMCU_row > cinfo->output_iMCU_row+delta)
+ break;
+ }
+ if ((*cinfo->inputctl->consume_input)(cinfo) == JPEG_SUSPENDED)
+ return JPEG_SUSPENDED;
+ }
+
+ /* OK, output from the virtual arrays. */
+ for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+ ci++, compptr++) {
+ /* Don't bother to IDCT an uninteresting component. */
+ if (! compptr->component_needed)
+ continue;
+ /* Count non-dummy DCT block rows in this iMCU row. */
+ if (cinfo->output_iMCU_row < last_iMCU_row) {
+ block_rows = compptr->v_samp_factor;
+ access_rows = block_rows * 2; /* this and next iMCU row */
+ last_row = FALSE;
+ } else {
+ /* NB: can't use last_row_height here; it is input-side-dependent! */
+ block_rows = (int) (compptr->height_in_blocks % compptr->v_samp_factor);
+ if (block_rows == 0) block_rows = compptr->v_samp_factor;
+ access_rows = block_rows; /* this iMCU row only */
+ last_row = TRUE;
+ }
+ /* Align the virtual buffer for this component. */
+ if (cinfo->output_iMCU_row > 0) {
+ access_rows += compptr->v_samp_factor; /* prior iMCU row too */
+ buffer = (*cinfo->mem->access_virt_barray)
+ ((j_common_ptr) cinfo, coef->whole_image[ci],
+ (cinfo->output_iMCU_row - 1) * compptr->v_samp_factor,
+ (JDIMENSION) access_rows, FALSE);
+ buffer += compptr->v_samp_factor; /* point to current iMCU row */
+ first_row = FALSE;
+ } else {
+ buffer = (*cinfo->mem->access_virt_barray)
+ ((j_common_ptr) cinfo, coef->whole_image[ci],
+ (JDIMENSION) 0, (JDIMENSION) access_rows, FALSE);
+ first_row = TRUE;
+ }
+ /* Fetch component-dependent info */
+ coef_bits = coef->coef_bits_latch + (ci * SAVED_COEFS);
+ quanttbl = compptr->quant_table;
+ Q00 = quanttbl->quantval[0];
+ Q01 = quanttbl->quantval[Q01_POS];
+ Q10 = quanttbl->quantval[Q10_POS];
+ Q20 = quanttbl->quantval[Q20_POS];
+ Q11 = quanttbl->quantval[Q11_POS];
+ Q02 = quanttbl->quantval[Q02_POS];
+ inverse_DCT = cinfo->idct->inverse_DCT[ci];
+ output_ptr = output_buf[ci];
+ /* Loop over all DCT blocks to be processed. */
+ for (block_row = 0; block_row < block_rows; block_row++) {
+ buffer_ptr = buffer[block_row];
+ if (first_row && block_row == 0)
+ prev_block_row = buffer_ptr;
+ else
+ prev_block_row = buffer[block_row-1];
+ if (last_row && block_row == block_rows-1)
+ next_block_row = buffer_ptr;
+ else
+ next_block_row = buffer[block_row+1];
+ /* We fetch the surrounding DC values using a sliding-register approach.
+ * Initialize all nine here so as to do the right thing on narrow pics.
+ */
+ DC1 = DC2 = DC3 = (int) prev_block_row[0][0];
+ DC4 = DC5 = DC6 = (int) buffer_ptr[0][0];
+ DC7 = DC8 = DC9 = (int) next_block_row[0][0];
+ output_col = 0;
+ last_block_column = compptr->width_in_blocks - 1;
+ for (block_num = 0; block_num <= last_block_column; block_num++) {
+ /* Fetch current DCT block into workspace so we can modify it. */
+ jcopy_block_row(buffer_ptr, (JBLOCKROW) workspace, (JDIMENSION) 1);
+ /* Update DC values */
+ if (block_num < last_block_column) {
+ DC3 = (int) prev_block_row[1][0];
+ DC6 = (int) buffer_ptr[1][0];
+ DC9 = (int) next_block_row[1][0];
+ }
+ /* Compute coefficient estimates per K.8.
+ * An estimate is applied only if coefficient is still zero,
+ * and is not known to be fully accurate.
+ */
+ /* AC01 */
+ if ((Al=coef_bits[1]) != 0 && workspace[1] == 0) {
+ num = 36 * Q00 * (DC4 - DC6);
+ if (num >= 0) {
+ pred = (int) (((Q01<<7) + num) / (Q01<<8));
+ if (Al > 0 && pred >= (1<<Al))
+ pred = (1<<Al)-1;
+ } else {
+ pred = (int) (((Q01<<7) - num) / (Q01<<8));
+ if (Al > 0 && pred >= (1<<Al))
+ pred = (1<<Al)-1;
+ pred = -pred;
+ }
+ workspace[1] = (JCOEF) pred;
+ }
+ /* AC10 */
+ if ((Al=coef_bits[2]) != 0 && workspace[8] == 0) {
+ num = 36 * Q00 * (DC2 - DC8);
+ if (num >= 0) {
+ pred = (int) (((Q10<<7) + num) / (Q10<<8));
+ if (Al > 0 && pred >= (1<<Al))
+ pred = (1<<Al)-1;
+ } else {
+ pred = (int) (((Q10<<7) - num) / (Q10<<8));
+ if (Al > 0 && pred >= (1<<Al))
+ pred = (1<<Al)-1;
+ pred = -pred;
+ }
+ workspace[8] = (JCOEF) pred;
+ }
+ /* AC20 */
+ if ((Al=coef_bits[3]) != 0 && workspace[16] == 0) {
+ num = 9 * Q00 * (DC2 + DC8 - 2*DC5);
+ if (num >= 0) {
+ pred = (int) (((Q20<<7) + num) / (Q20<<8));
+ if (Al > 0 && pred >= (1<<Al))
+ pred = (1<<Al)-1;
+ } else {
+ pred = (int) (((Q20<<7) - num) / (Q20<<8));
+ if (Al > 0 && pred >= (1<<Al))
+ pred = (1<<Al)-1;
+ pred = -pred;
+ }
+ workspace[16] = (JCOEF) pred;
+ }
+ /* AC11 */
+ if ((Al=coef_bits[4]) != 0 && workspace[9] == 0) {
+ num = 5 * Q00 * (DC1 - DC3 - DC7 + DC9);
+ if (num >= 0) {
+ pred = (int) (((Q11<<7) + num) / (Q11<<8));
+ if (Al > 0 && pred >= (1<<Al))
+ pred = (1<<Al)-1;
+ } else {
+ pred = (int) (((Q11<<7) - num) / (Q11<<8));
+ if (Al > 0 && pred >= (1<<Al))
+ pred = (1<<Al)-1;
+ pred = -pred;
+ }
+ workspace[9] = (JCOEF) pred;
+ }
+ /* AC02 */
+ if ((Al=coef_bits[5]) != 0 && workspace[2] == 0) {
+ num = 9 * Q00 * (DC4 + DC6 - 2*DC5);
+ if (num >= 0) {
+ pred = (int) (((Q02<<7) + num) / (Q02<<8));
+ if (Al > 0 && pred >= (1<<Al))
+ pred = (1<<Al)-1;
+ } else {
+ pred = (int) (((Q02<<7) - num) / (Q02<<8));
+ if (Al > 0 && pred >= (1<<Al))
+ pred = (1<<Al)-1;
+ pred = -pred;
+ }
+ workspace[2] = (JCOEF) pred;
+ }
+ /* OK, do the IDCT */
+ (*inverse_DCT) (cinfo, compptr, (JCOEFPTR) workspace,
+ output_ptr, output_col);
+ /* Advance for next column */
+ DC1 = DC2; DC2 = DC3;
+ DC4 = DC5; DC5 = DC6;
+ DC7 = DC8; DC8 = DC9;
+ buffer_ptr++, prev_block_row++, next_block_row++;
+ output_col += compptr->DCT_scaled_size;
+ }
+ output_ptr += compptr->DCT_scaled_size;
+ }
+ }
+
+ if (++(cinfo->output_iMCU_row) < cinfo->total_iMCU_rows)
+ return JPEG_ROW_COMPLETED;
+ return JPEG_SCAN_COMPLETED;
+}
+
+#endif /* BLOCK_SMOOTHING_SUPPORTED */
+
+
+/*
+ * Initialize coefficient buffer controller.
+ */
+
+GLOBAL(void)
+jinit_d_coef_controller (j_decompress_ptr cinfo, boolean need_full_buffer)
+{
+ my_coef_ptr coef;
+
+ coef = (my_coef_ptr)
+ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ SIZEOF(my_coef_controller));
+ cinfo->coef = (struct jpeg_d_coef_controller *) coef;
+ coef->pub.start_input_pass = start_input_pass;
+ coef->pub.start_output_pass = start_output_pass;
+#ifdef BLOCK_SMOOTHING_SUPPORTED
+ coef->coef_bits_latch = NULL;
+#endif
+
+ /* Create the coefficient buffer. */
+ if (need_full_buffer) {
+#ifdef D_MULTISCAN_FILES_SUPPORTED
+ /* Allocate a full-image virtual array for each component, */
+ /* padded to a multiple of samp_factor DCT blocks in each direction. */
+ /* Note we ask for a pre-zeroed array. */
+ int ci, access_rows;
+ jpeg_component_info *compptr;
+
+ for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+ ci++, compptr++) {
+ access_rows = compptr->v_samp_factor;
+#ifdef BLOCK_SMOOTHING_SUPPORTED
+ /* If block smoothing could be used, need a bigger window */
+ if (cinfo->progressive_mode)
+ access_rows *= 3;
+#endif
+ coef->whole_image[ci] = (*cinfo->mem->request_virt_barray)
+ ((j_common_ptr) cinfo, JPOOL_IMAGE, TRUE,
+ (JDIMENSION) jround_up((long) compptr->width_in_blocks,
+ (long) compptr->h_samp_factor),
+ (JDIMENSION) jround_up((long) compptr->height_in_blocks,
+ (long) compptr->v_samp_factor),
+ (JDIMENSION) access_rows);
+ }
+ coef->pub.consume_data = consume_data;
+ coef->pub.decompress_data = decompress_data;
+ coef->pub.coef_arrays = coef->whole_image; /* link to virtual arrays */
+#else
+ ERREXIT(cinfo, JERR_NOT_COMPILED);
+#endif
+ } else {
+ /* We only need a single-MCU buffer. */
+ JBLOCKROW buffer;
+ int i;
+
+ buffer = (JBLOCKROW)
+ (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ D_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK));
+ for (i = 0; i < D_MAX_BLOCKS_IN_MCU; i++) {
+ coef->MCU_buffer[i] = buffer + i;
+ }
+ coef->pub.consume_data = dummy_consume_data;
+ coef->pub.decompress_data = decompress_onepass;
+ coef->pub.coef_arrays = NULL; /* flag for no virtual arrays */
+ }
+}
+
+#endif //_FX_JPEG_TURBO_
diff --git a/core/src/fxcodec/libjpeg/fpdfapi_jdcolor.c b/core/src/fxcodec/libjpeg/fpdfapi_jdcolor.c
index 5cd35f5ec9..c17329b86d 100644
--- a/core/src/fxcodec/libjpeg/fpdfapi_jdcolor.c
+++ b/core/src/fxcodec/libjpeg/fpdfapi_jdcolor.c
@@ -1,399 +1,399 @@
-#if !defined(_FX_JPEG_TURBO_)
-/*
- * jdcolor.c
- *
- * Copyright (C) 1991-1997, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- * For conditions of distribution and use, see the accompanying README file.
- *
- * This file contains output colorspace conversion routines.
- */
-
-#define JPEG_INTERNALS
-#include "jinclude.h"
-#include "jpeglib.h"
-
-
-/* Private subobject */
-
-typedef struct {
- struct jpeg_color_deconverter pub; /* public fields */
-
- /* Private state for YCC->RGB conversion */
- int * Cr_r_tab; /* => table for Cr to R conversion */
- int * Cb_b_tab; /* => table for Cb to B conversion */
- INT32 * Cr_g_tab; /* => table for Cr to G conversion */
- INT32 * Cb_g_tab; /* => table for Cb to G conversion */
-} my_color_deconverter;
-
-typedef my_color_deconverter * my_cconvert_ptr;
-
-
-/**************** YCbCr -> RGB conversion: most common case **************/
-
-/*
- * YCbCr is defined per CCIR 601-1, except that Cb and Cr are
- * normalized to the range 0..MAXJSAMPLE rather than -0.5 .. 0.5.
- * The conversion equations to be implemented are therefore
- * R = Y + 1.40200 * Cr
- * G = Y - 0.34414 * Cb - 0.71414 * Cr
- * B = Y + 1.77200 * Cb
- * where Cb and Cr represent the incoming values less CENTERJSAMPLE.
- * (These numbers are derived from TIFF 6.0 section 21, dated 3-June-92.)
- *
- * To avoid floating-point arithmetic, we represent the fractional constants
- * as integers scaled up by 2^16 (about 4 digits precision); we have to divide
- * the products by 2^16, with appropriate rounding, to get the correct answer.
- * Notice that Y, being an integral input, does not contribute any fraction
- * so it need not participate in the rounding.
- *
- * For even more speed, we avoid doing any multiplications in the inner loop
- * by precalculating the constants times Cb and Cr for all possible values.
- * For 8-bit JSAMPLEs this is very reasonable (only 256 entries per table);
- * for 12-bit samples it is still acceptable. It's not very reasonable for
- * 16-bit samples, but if you want lossless storage you shouldn't be changing
- * colorspace anyway.
- * The Cr=>R and Cb=>B values can be rounded to integers in advance; the
- * values for the G calculation are left scaled up, since we must add them
- * together before rounding.
- */
-
-#define SCALEBITS 16 /* speediest right-shift on some machines */
-#define ONE_HALF ((INT32) 1 << (SCALEBITS-1))
-#define FIX(x) ((INT32) ((x) * (1L<<SCALEBITS) + 0.5))
-
-
-/*
- * Initialize tables for YCC->RGB colorspace conversion.
- */
-
-LOCAL(void)
-build_ycc_rgb_table (j_decompress_ptr cinfo)
-{
- my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
- int i;
- INT32 x;
- SHIFT_TEMPS
-
- cconvert->Cr_r_tab = (int *)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- (MAXJSAMPLE+1) * SIZEOF(int));
- cconvert->Cb_b_tab = (int *)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- (MAXJSAMPLE+1) * SIZEOF(int));
- cconvert->Cr_g_tab = (INT32 *)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- (MAXJSAMPLE+1) * SIZEOF(INT32));
- cconvert->Cb_g_tab = (INT32 *)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- (MAXJSAMPLE+1) * SIZEOF(INT32));
-
- for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) {
- /* i is the actual input pixel value, in the range 0..MAXJSAMPLE */
- /* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */
- /* Cr=>R value is nearest int to 1.40200 * x */
- cconvert->Cr_r_tab[i] = (int)
- RIGHT_SHIFT(FIX(1.40200) * x + ONE_HALF, SCALEBITS);
- /* Cb=>B value is nearest int to 1.77200 * x */
- cconvert->Cb_b_tab[i] = (int)
- RIGHT_SHIFT(FIX(1.77200) * x + ONE_HALF, SCALEBITS);
- /* Cr=>G value is scaled-up -0.71414 * x */
- cconvert->Cr_g_tab[i] = (- FIX(0.71414)) * x;
- /* Cb=>G value is scaled-up -0.34414 * x */
- /* We also add in ONE_HALF so that need not do it in inner loop */
- cconvert->Cb_g_tab[i] = (- FIX(0.34414)) * x + ONE_HALF;
- }
-}
-
-
-/*
- * Convert some rows of samples to the output colorspace.
- *
- * Note that we change from noninterleaved, one-plane-per-component format
- * to interleaved-pixel format. The output buffer is therefore three times
- * as wide as the input buffer.
- * A starting row offset is provided only for the input buffer. The caller
- * can easily adjust the passed output_buf value to accommodate any row
- * offset required on that side.
- */
-
-METHODDEF(void)
-ycc_rgb_convert (j_decompress_ptr cinfo,
- JSAMPIMAGE input_buf, JDIMENSION input_row,
- JSAMPARRAY output_buf, int num_rows)
-{
- my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
- register int y, cb, cr;
- register JSAMPROW outptr;
- register JSAMPROW inptr0, inptr1, inptr2;
- register JDIMENSION col;
- JDIMENSION num_cols = cinfo->output_width;
- /* copy these pointers into registers if possible */
- register JSAMPLE * range_limit = cinfo->sample_range_limit;
- register int * Crrtab = cconvert->Cr_r_tab;
- register int * Cbbtab = cconvert->Cb_b_tab;
- register INT32 * Crgtab = cconvert->Cr_g_tab;
- register INT32 * Cbgtab = cconvert->Cb_g_tab;
- SHIFT_TEMPS
-
- while (--num_rows >= 0) {
- inptr0 = input_buf[0][input_row];
- inptr1 = input_buf[1][input_row];
- inptr2 = input_buf[2][input_row];
- input_row++;
- outptr = *output_buf++;
- for (col = 0; col < num_cols; col++) {
- y = GETJSAMPLE(inptr0[col]);
- cb = GETJSAMPLE(inptr1[col]);
- cr = GETJSAMPLE(inptr2[col]);
- /* Range-limiting is essential due to noise introduced by DCT losses. */
- outptr[RGB_RED] = range_limit[y + Crrtab[cr]];
- outptr[RGB_GREEN] = range_limit[y +
- ((int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
- SCALEBITS))];
- outptr[RGB_BLUE] = range_limit[y + Cbbtab[cb]];
- outptr += RGB_PIXELSIZE;
- }
- }
-}
-
-
-/**************** Cases other than YCbCr -> RGB **************/
-
-
-/*
- * Color conversion for no colorspace change: just copy the data,
- * converting from separate-planes to interleaved representation.
- */
-
-METHODDEF(void)
-null_convert (j_decompress_ptr cinfo,
- JSAMPIMAGE input_buf, JDIMENSION input_row,
- JSAMPARRAY output_buf, int num_rows)
-{
- register JSAMPROW inptr, outptr;
- register JDIMENSION count;
- register int num_components = cinfo->num_components;
- JDIMENSION num_cols = cinfo->output_width;
- int ci;
-
- while (--num_rows >= 0) {
- for (ci = 0; ci < num_components; ci++) {
- inptr = input_buf[ci][input_row];
- outptr = output_buf[0] + ci;
- for (count = num_cols; count > 0; count--) {
- *outptr = *inptr++; /* needn't bother with GETJSAMPLE() here */
- outptr += num_components;
- }
- }
- input_row++;
- output_buf++;
- }
-}
-
-
-/*
- * Color conversion for grayscale: just copy the data.
- * This also works for YCbCr -> grayscale conversion, in which
- * we just copy the Y (luminance) component and ignore chrominance.
- */
-
-METHODDEF(void)
-grayscale_convert (j_decompress_ptr cinfo,
- JSAMPIMAGE input_buf, JDIMENSION input_row,
- JSAMPARRAY output_buf, int num_rows)
-{
- jcopy_sample_rows(input_buf[0], (int) input_row, output_buf, 0,
- num_rows, cinfo->output_width);
-}
-
-
-/*
- * Convert grayscale to RGB: just duplicate the graylevel three times.
- * This is provided to support applications that don't want to cope
- * with grayscale as a separate case.
- */
-
-METHODDEF(void)
-gray_rgb_convert (j_decompress_ptr cinfo,
- JSAMPIMAGE input_buf, JDIMENSION input_row,
- JSAMPARRAY output_buf, int num_rows)
-{
- register JSAMPROW inptr, outptr;
- register JDIMENSION col;
- JDIMENSION num_cols = cinfo->output_width;
-
- while (--num_rows >= 0) {
- inptr = input_buf[0][input_row++];
- outptr = *output_buf++;
- for (col = 0; col < num_cols; col++) {
- /* We can dispense with GETJSAMPLE() here */
- outptr[RGB_RED] = outptr[RGB_GREEN] = outptr[RGB_BLUE] = inptr[col];
- outptr += RGB_PIXELSIZE;
- }
- }
-}
-
-
-/*
- * Adobe-style YCCK->CMYK conversion.
- * We convert YCbCr to R=1-C, G=1-M, and B=1-Y using the same
- * conversion as above, while passing K (black) unchanged.
- * We assume build_ycc_rgb_table has been called.
- */
-
-METHODDEF(void)
-ycck_cmyk_convert (j_decompress_ptr cinfo,
- JSAMPIMAGE input_buf, JDIMENSION input_row,
- JSAMPARRAY output_buf, int num_rows)
-{
- my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
- register int y, cb, cr;
- register JSAMPROW outptr;
- register JSAMPROW inptr0, inptr1, inptr2, inptr3;
- register JDIMENSION col;
- JDIMENSION num_cols = cinfo->output_width;
- /* copy these pointers into registers if possible */
- register JSAMPLE * range_limit = cinfo->sample_range_limit;
- register int * Crrtab = cconvert->Cr_r_tab;
- register int * Cbbtab = cconvert->Cb_b_tab;
- register INT32 * Crgtab = cconvert->Cr_g_tab;
- register INT32 * Cbgtab = cconvert->Cb_g_tab;
- SHIFT_TEMPS
-
- while (--num_rows >= 0) {
- inptr0 = input_buf[0][input_row];
- inptr1 = input_buf[1][input_row];
- inptr2 = input_buf[2][input_row];
- inptr3 = input_buf[3][input_row];
- input_row++;
- outptr = *output_buf++;
- for (col = 0; col < num_cols; col++) {
- y = GETJSAMPLE(inptr0[col]);
- cb = GETJSAMPLE(inptr1[col]);
- cr = GETJSAMPLE(inptr2[col]);
- /* Range-limiting is essential due to noise introduced by DCT losses. */
- outptr[0] = range_limit[MAXJSAMPLE - (y + Crrtab[cr])]; /* red */
- outptr[1] = range_limit[MAXJSAMPLE - (y + /* green */
- ((int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
- SCALEBITS)))];
- outptr[2] = range_limit[MAXJSAMPLE - (y + Cbbtab[cb])]; /* blue */
- /* K passes through unchanged */
- outptr[3] = inptr3[col]; /* don't need GETJSAMPLE here */
- outptr += 4;
- }
- }
-}
-
-
-/*
- * Empty method for start_pass.
- */
-
-METHODDEF(void)
-start_pass_dcolor (j_decompress_ptr cinfo)
-{
- /* no work needed */
-}
-
-
-/*
- * Module initialization routine for output colorspace conversion.
- */
-
-GLOBAL(void)
-jinit_color_deconverter (j_decompress_ptr cinfo)
-{
- my_cconvert_ptr cconvert;
- int ci;
-
- cconvert = (my_cconvert_ptr)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- SIZEOF(my_color_deconverter));
- cinfo->cconvert = (struct jpeg_color_deconverter *) cconvert;
- cconvert->pub.start_pass = start_pass_dcolor;
-
- /* Make sure num_components agrees with jpeg_color_space */
- switch (cinfo->jpeg_color_space) {
- case JCS_GRAYSCALE:
- if (cinfo->num_components != 1)
- ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
- break;
-
- case JCS_RGB:
- case JCS_YCbCr:
- if (cinfo->num_components != 3)
- ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
- break;
-
- case JCS_CMYK:
- case JCS_YCCK:
- if (cinfo->num_components != 4)
- ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
- break;
-
- default: /* JCS_UNKNOWN can be anything */
- if (cinfo->num_components < 1)
- ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
- break;
- }
-
- /* Set out_color_components and conversion method based on requested space.
- * Also clear the component_needed flags for any unused components,
- * so that earlier pipeline stages can avoid useless computation.
- */
-
- switch (cinfo->out_color_space) {
- case JCS_GRAYSCALE:
- cinfo->out_color_components = 1;
- if (cinfo->jpeg_color_space == JCS_GRAYSCALE ||
- cinfo->jpeg_color_space == JCS_YCbCr) {
- cconvert->pub.color_convert = grayscale_convert;
- /* For color->grayscale conversion, only the Y (0) component is needed */
- for (ci = 1; ci < cinfo->num_components; ci++)
- cinfo->comp_info[ci].component_needed = FALSE;
- } else
- ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
- break;
-
- case JCS_RGB:
- cinfo->out_color_components = RGB_PIXELSIZE;
- if (cinfo->jpeg_color_space == JCS_YCbCr) {
- cconvert->pub.color_convert = ycc_rgb_convert;
- build_ycc_rgb_table(cinfo);
- } else if (cinfo->jpeg_color_space == JCS_GRAYSCALE) {
- cconvert->pub.color_convert = gray_rgb_convert;
- } else if (cinfo->jpeg_color_space == JCS_RGB && RGB_PIXELSIZE == 3) {
- cconvert->pub.color_convert = null_convert;
- } else
- ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
- break;
-
- case JCS_CMYK:
- cinfo->out_color_components = 4;
- if (cinfo->jpeg_color_space == JCS_YCCK) {
- cconvert->pub.color_convert = ycck_cmyk_convert;
- build_ycc_rgb_table(cinfo);
- } else if (cinfo->jpeg_color_space == JCS_CMYK) {
- cconvert->pub.color_convert = null_convert;
- } else
- ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
- break;
-
- default:
- /* Permit null conversion to same output space */
- if (cinfo->out_color_space == cinfo->jpeg_color_space) {
- cinfo->out_color_components = cinfo->num_components;
- cconvert->pub.color_convert = null_convert;
- } else /* unsupported non-null conversion */
- ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
- break;
- }
-
- if (cinfo->quantize_colors)
- cinfo->output_components = 1; /* single colormapped output component */
- else
- cinfo->output_components = cinfo->out_color_components;
-}
-
-#endif //_FX_JPEG_TURBO_
+#if !defined(_FX_JPEG_TURBO_)
+/*
+ * jdcolor.c
+ *
+ * Copyright (C) 1991-1997, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains output colorspace conversion routines.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+
+
+/* Private subobject */
+
+typedef struct {
+ struct jpeg_color_deconverter pub; /* public fields */
+
+ /* Private state for YCC->RGB conversion */
+ int * Cr_r_tab; /* => table for Cr to R conversion */
+ int * Cb_b_tab; /* => table for Cb to B conversion */
+ INT32 * Cr_g_tab; /* => table for Cr to G conversion */
+ INT32 * Cb_g_tab; /* => table for Cb to G conversion */
+} my_color_deconverter;
+
+typedef my_color_deconverter * my_cconvert_ptr;
+
+
+/**************** YCbCr -> RGB conversion: most common case **************/
+
+/*
+ * YCbCr is defined per CCIR 601-1, except that Cb and Cr are
+ * normalized to the range 0..MAXJSAMPLE rather than -0.5 .. 0.5.
+ * The conversion equations to be implemented are therefore
+ * R = Y + 1.40200 * Cr
+ * G = Y - 0.34414 * Cb - 0.71414 * Cr
+ * B = Y + 1.77200 * Cb
+ * where Cb and Cr represent the incoming values less CENTERJSAMPLE.
+ * (These numbers are derived from TIFF 6.0 section 21, dated 3-June-92.)
+ *
+ * To avoid floating-point arithmetic, we represent the fractional constants
+ * as integers scaled up by 2^16 (about 4 digits precision); we have to divide
+ * the products by 2^16, with appropriate rounding, to get the correct answer.
+ * Notice that Y, being an integral input, does not contribute any fraction
+ * so it need not participate in the rounding.
+ *
+ * For even more speed, we avoid doing any multiplications in the inner loop
+ * by precalculating the constants times Cb and Cr for all possible values.
+ * For 8-bit JSAMPLEs this is very reasonable (only 256 entries per table);
+ * for 12-bit samples it is still acceptable. It's not very reasonable for
+ * 16-bit samples, but if you want lossless storage you shouldn't be changing
+ * colorspace anyway.
+ * The Cr=>R and Cb=>B values can be rounded to integers in advance; the
+ * values for the G calculation are left scaled up, since we must add them
+ * together before rounding.
+ */
+
+#define SCALEBITS 16 /* speediest right-shift on some machines */
+#define ONE_HALF ((INT32) 1 << (SCALEBITS-1))
+#define FIX(x) ((INT32) ((x) * (1L<<SCALEBITS) + 0.5))
+
+
+/*
+ * Initialize tables for YCC->RGB colorspace conversion.
+ */
+
+LOCAL(void)
+build_ycc_rgb_table (j_decompress_ptr cinfo)
+{
+ my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
+ int i;
+ INT32 x;
+ SHIFT_TEMPS
+
+ cconvert->Cr_r_tab = (int *)
+ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ (MAXJSAMPLE+1) * SIZEOF(int));
+ cconvert->Cb_b_tab = (int *)
+ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ (MAXJSAMPLE+1) * SIZEOF(int));
+ cconvert->Cr_g_tab = (INT32 *)
+ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ (MAXJSAMPLE+1) * SIZEOF(INT32));
+ cconvert->Cb_g_tab = (INT32 *)
+ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ (MAXJSAMPLE+1) * SIZEOF(INT32));
+
+ for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) {
+ /* i is the actual input pixel value, in the range 0..MAXJSAMPLE */
+ /* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */
+ /* Cr=>R value is nearest int to 1.40200 * x */
+ cconvert->Cr_r_tab[i] = (int)
+ RIGHT_SHIFT(FIX(1.40200) * x + ONE_HALF, SCALEBITS);
+ /* Cb=>B value is nearest int to 1.77200 * x */
+ cconvert->Cb_b_tab[i] = (int)
+ RIGHT_SHIFT(FIX(1.77200) * x + ONE_HALF, SCALEBITS);
+ /* Cr=>G value is scaled-up -0.71414 * x */
+ cconvert->Cr_g_tab[i] = (- FIX(0.71414)) * x;
+ /* Cb=>G value is scaled-up -0.34414 * x */
+ /* We also add in ONE_HALF so that need not do it in inner loop */
+ cconvert->Cb_g_tab[i] = (- FIX(0.34414)) * x + ONE_HALF;
+ }
+}
+
+
+/*
+ * Convert some rows of samples to the output colorspace.
+ *
+ * Note that we change from noninterleaved, one-plane-per-component format
+ * to interleaved-pixel format. The output buffer is therefore three times
+ * as wide as the input buffer.
+ * A starting row offset is provided only for the input buffer. The caller
+ * can easily adjust the passed output_buf value to accommodate any row
+ * offset required on that side.
+ */
+
+METHODDEF(void)
+ycc_rgb_convert (j_decompress_ptr cinfo,
+ JSAMPIMAGE input_buf, JDIMENSION input_row,
+ JSAMPARRAY output_buf, int num_rows)
+{
+ my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
+ register int y, cb, cr;
+ register JSAMPROW outptr;
+ register JSAMPROW inptr0, inptr1, inptr2;
+ register JDIMENSION col;
+ JDIMENSION num_cols = cinfo->output_width;
+ /* copy these pointers into registers if possible */
+ register JSAMPLE * range_limit = cinfo->sample_range_limit;
+ register int * Crrtab = cconvert->Cr_r_tab;
+ register int * Cbbtab = cconvert->Cb_b_tab;
+ register INT32 * Crgtab = cconvert->Cr_g_tab;
+ register INT32 * Cbgtab = cconvert->Cb_g_tab;
+ SHIFT_TEMPS
+
+ while (--num_rows >= 0) {
+ inptr0 = input_buf[0][input_row];
+ inptr1 = input_buf[1][input_row];
+ inptr2 = input_buf[2][input_row];
+ input_row++;
+ outptr = *output_buf++;
+ for (col = 0; col < num_cols; col++) {
+ y = GETJSAMPLE(inptr0[col]);
+ cb = GETJSAMPLE(inptr1[col]);
+ cr = GETJSAMPLE(inptr2[col]);
+ /* Range-limiting is essential due to noise introduced by DCT losses. */
+ outptr[RGB_RED] = range_limit[y + Crrtab[cr]];
+ outptr[RGB_GREEN] = range_limit[y +
+ ((int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
+ SCALEBITS))];
+ outptr[RGB_BLUE] = range_limit[y + Cbbtab[cb]];
+ outptr += RGB_PIXELSIZE;
+ }
+ }
+}
+
+
+/**************** Cases other than YCbCr -> RGB **************/
+
+
+/*
+ * Color conversion for no colorspace change: just copy the data,
+ * converting from separate-planes to interleaved representation.
+ */
+
+METHODDEF(void)
+null_convert (j_decompress_ptr cinfo,
+ JSAMPIMAGE input_buf, JDIMENSION input_row,
+ JSAMPARRAY output_buf, int num_rows)
+{
+ register JSAMPROW inptr, outptr;
+ register JDIMENSION count;
+ register int num_components = cinfo->num_components;
+ JDIMENSION num_cols = cinfo->output_width;
+ int ci;
+
+ while (--num_rows >= 0) {
+ for (ci = 0; ci < num_components; ci++) {
+ inptr = input_buf[ci][input_row];
+ outptr = output_buf[0] + ci;
+ for (count = num_cols; count > 0; count--) {
+ *outptr = *inptr++; /* needn't bother with GETJSAMPLE() here */
+ outptr += num_components;
+ }
+ }
+ input_row++;
+ output_buf++;
+ }
+}
+
+
+/*
+ * Color conversion for grayscale: just copy the data.
+ * This also works for YCbCr -> grayscale conversion, in which
+ * we just copy the Y (luminance) component and ignore chrominance.
+ */
+
+METHODDEF(void)
+grayscale_convert (j_decompress_ptr cinfo,
+ JSAMPIMAGE input_buf, JDIMENSION input_row,
+ JSAMPARRAY output_buf, int num_rows)
+{
+ jcopy_sample_rows(input_buf[0], (int) input_row, output_buf, 0,
+ num_rows, cinfo->output_width);
+}
+
+
+/*
+ * Convert grayscale to RGB: just duplicate the graylevel three times.
+ * This is provided to support applications that don't want to cope
+ * with grayscale as a separate case.
+ */
+
+METHODDEF(void)
+gray_rgb_convert (j_decompress_ptr cinfo,
+ JSAMPIMAGE input_buf, JDIMENSION input_row,
+ JSAMPARRAY output_buf, int num_rows)
+{
+ register JSAMPROW inptr, outptr;
+ register JDIMENSION col;
+ JDIMENSION num_cols = cinfo->output_width;
+
+ while (--num_rows >= 0) {
+ inptr = input_buf[0][input_row++];
+ outptr = *output_buf++;
+ for (col = 0; col < num_cols; col++) {
+ /* We can dispense with GETJSAMPLE() here */
+ outptr[RGB_RED] = outptr[RGB_GREEN] = outptr[RGB_BLUE] = inptr[col];
+ outptr += RGB_PIXELSIZE;
+ }
+ }
+}
+
+
+/*
+ * Adobe-style YCCK->CMYK conversion.
+ * We convert YCbCr to R=1-C, G=1-M, and B=1-Y using the same
+ * conversion as above, while passing K (black) unchanged.
+ * We assume build_ycc_rgb_table has been called.
+ */
+
+METHODDEF(void)
+ycck_cmyk_convert (j_decompress_ptr cinfo,
+ JSAMPIMAGE input_buf, JDIMENSION input_row,
+ JSAMPARRAY output_buf, int num_rows)
+{
+ my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
+ register int y, cb, cr;
+ register JSAMPROW outptr;
+ register JSAMPROW inptr0, inptr1, inptr2, inptr3;
+ register JDIMENSION col;
+ JDIMENSION num_cols = cinfo->output_width;
+ /* copy these pointers into registers if possible */
+ register JSAMPLE * range_limit = cinfo->sample_range_limit;
+ register int * Crrtab = cconvert->Cr_r_tab;
+ register int * Cbbtab = cconvert->Cb_b_tab;
+ register INT32 * Crgtab = cconvert->Cr_g_tab;
+ register INT32 * Cbgtab = cconvert->Cb_g_tab;
+ SHIFT_TEMPS
+
+ while (--num_rows >= 0) {
+ inptr0 = input_buf[0][input_row];
+ inptr1 = input_buf[1][input_row];
+ inptr2 = input_buf[2][input_row];
+ inptr3 = input_buf[3][input_row];
+ input_row++;
+ outptr = *output_buf++;
+ for (col = 0; col < num_cols; col++) {
+ y = GETJSAMPLE(inptr0[col]);
+ cb = GETJSAMPLE(inptr1[col]);
+ cr = GETJSAMPLE(inptr2[col]);
+ /* Range-limiting is essential due to noise introduced by DCT losses. */
+ outptr[0] = range_limit[MAXJSAMPLE - (y + Crrtab[cr])]; /* red */
+ outptr[1] = range_limit[MAXJSAMPLE - (y + /* green */
+ ((int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
+ SCALEBITS)))];
+ outptr[2] = range_limit[MAXJSAMPLE - (y + Cbbtab[cb])]; /* blue */
+ /* K passes through unchanged */
+ outptr[3] = inptr3[col]; /* don't need GETJSAMPLE here */
+ outptr += 4;
+ }
+ }
+}
+
+
+/*
+ * Empty method for start_pass.
+ */
+
+METHODDEF(void)
+start_pass_dcolor (j_decompress_ptr cinfo)
+{
+ /* no work needed */
+}
+
+
+/*
+ * Module initialization routine for output colorspace conversion.
+ */
+
+GLOBAL(void)
+jinit_color_deconverter (j_decompress_ptr cinfo)
+{
+ my_cconvert_ptr cconvert;
+ int ci;
+
+ cconvert = (my_cconvert_ptr)
+ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ SIZEOF(my_color_deconverter));
+ cinfo->cconvert = (struct jpeg_color_deconverter *) cconvert;
+ cconvert->pub.start_pass = start_pass_dcolor;
+
+ /* Make sure num_components agrees with jpeg_color_space */
+ switch (cinfo->jpeg_color_space) {
+ case JCS_GRAYSCALE:
+ if (cinfo->num_components != 1)
+ ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
+ break;
+
+ case JCS_RGB:
+ case JCS_YCbCr:
+ if (cinfo->num_components != 3)
+ ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
+ break;
+
+ case JCS_CMYK:
+ case JCS_YCCK:
+ if (cinfo->num_components != 4)
+ ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
+ break;
+
+ default: /* JCS_UNKNOWN can be anything */
+ if (cinfo->num_components < 1)
+ ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
+ break;
+ }
+
+ /* Set out_color_components and conversion method based on requested space.
+ * Also clear the component_needed flags for any unused components,
+ * so that earlier pipeline stages can avoid useless computation.
+ */
+
+ switch (cinfo->out_color_space) {
+ case JCS_GRAYSCALE:
+ cinfo->out_color_components = 1;
+ if (cinfo->jpeg_color_space == JCS_GRAYSCALE ||
+ cinfo->jpeg_color_space == JCS_YCbCr) {
+ cconvert->pub.color_convert = grayscale_convert;
+ /* For color->grayscale conversion, only the Y (0) component is needed */
+ for (ci = 1; ci < cinfo->num_components; ci++)
+ cinfo->comp_info[ci].component_needed = FALSE;
+ } else
+ ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
+ break;
+
+ case JCS_RGB:
+ cinfo->out_color_components = RGB_PIXELSIZE;
+ if (cinfo->jpeg_color_space == JCS_YCbCr) {
+ cconvert->pub.color_convert = ycc_rgb_convert;
+ build_ycc_rgb_table(cinfo);
+ } else if (cinfo->jpeg_color_space == JCS_GRAYSCALE) {
+ cconvert->pub.color_convert = gray_rgb_convert;
+ } else if (cinfo->jpeg_color_space == JCS_RGB && RGB_PIXELSIZE == 3) {
+ cconvert->pub.color_convert = null_convert;
+ } else
+ ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
+ break;
+
+ case JCS_CMYK:
+ cinfo->out_color_components = 4;
+ if (cinfo->jpeg_color_space == JCS_YCCK) {
+ cconvert->pub.color_convert = ycck_cmyk_convert;
+ build_ycc_rgb_table(cinfo);
+ } else if (cinfo->jpeg_color_space == JCS_CMYK) {
+ cconvert->pub.color_convert = null_convert;
+ } else
+ ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
+ break;
+
+ default:
+ /* Permit null conversion to same output space */
+ if (cinfo->out_color_space == cinfo->jpeg_color_space) {
+ cinfo->out_color_components = cinfo->num_components;
+ cconvert->pub.color_convert = null_convert;
+ } else /* unsupported non-null conversion */
+ ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
+ break;
+ }
+
+ if (cinfo->quantize_colors)
+ cinfo->output_components = 1; /* single colormapped output component */
+ else
+ cinfo->output_components = cinfo->out_color_components;
+}
+
+#endif //_FX_JPEG_TURBO_
diff --git a/core/src/fxcodec/libjpeg/fpdfapi_jddctmgr.c b/core/src/fxcodec/libjpeg/fpdfapi_jddctmgr.c
index 811d51d51a..5226456414 100644
--- a/core/src/fxcodec/libjpeg/fpdfapi_jddctmgr.c
+++ b/core/src/fxcodec/libjpeg/fpdfapi_jddctmgr.c
@@ -1,272 +1,272 @@
-#if !defined(_FX_JPEG_TURBO_)
-/*
- * jddctmgr.c
- *
- * Copyright (C) 1994-1996, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- * For conditions of distribution and use, see the accompanying README file.
- *
- * This file contains the inverse-DCT management logic.
- * This code selects a particular IDCT implementation to be used,
- * and it performs related housekeeping chores. No code in this file
- * is executed per IDCT step, only during output pass setup.
- *
- * Note that the IDCT routines are responsible for performing coefficient
- * dequantization as well as the IDCT proper. This module sets up the
- * dequantization multiplier table needed by the IDCT routine.
- */
-
-#define JPEG_INTERNALS
-#include "jinclude.h"
-#include "jpeglib.h"
-#include "jdct.h" /* Private declarations for DCT subsystem */
-
-
-/*
- * The decompressor input side (jdinput.c) saves away the appropriate
- * quantization table for each component at the start of the first scan
- * involving that component. (This is necessary in order to correctly
- * decode files that reuse Q-table slots.)
- * When we are ready to make an output pass, the saved Q-table is converted
- * to a multiplier table that will actually be used by the IDCT routine.
- * The multiplier table contents are IDCT-method-dependent. To support
- * application changes in IDCT method between scans, we can remake the
- * multiplier tables if necessary.
- * In buffered-image mode, the first output pass may occur before any data
- * has been seen for some components, and thus before their Q-tables have
- * been saved away. To handle this case, multiplier tables are preset
- * to zeroes; the result of the IDCT will be a neutral gray level.
- */
-
-
-/* Private subobject for this module */
-
-typedef struct {
- struct jpeg_inverse_dct pub; /* public fields */
-
- /* This array contains the IDCT method code that each multiplier table
- * is currently set up for, or -1 if it's not yet set up.
- * The actual multiplier tables are pointed to by dct_table in the
- * per-component comp_info structures.
- */
- int cur_method[MAX_COMPONENTS];
-} my_idct_controller;
-
-typedef my_idct_controller * my_idct_ptr;
-
-
-/* Allocated multiplier tables: big enough for any supported variant */
-
-typedef union {
- ISLOW_MULT_TYPE islow_array[DCTSIZE2];
-#ifdef DCT_IFAST_SUPPORTED
- IFAST_MULT_TYPE ifast_array[DCTSIZE2];
-#endif
-#ifdef DCT_FLOAT_SUPPORTED
- FLOAT_MULT_TYPE float_array[DCTSIZE2];
-#endif
-} multiplier_table;
-
-
-/* The current scaled-IDCT routines require ISLOW-style multiplier tables,
- * so be sure to compile that code if either ISLOW or SCALING is requested.
- */
-#ifdef DCT_ISLOW_SUPPORTED
-#define PROVIDE_ISLOW_TABLES
-#else
-#ifdef IDCT_SCALING_SUPPORTED
-#define PROVIDE_ISLOW_TABLES
-#endif
-#endif
-
-
-/*
- * Prepare for an output pass.
- * Here we select the proper IDCT routine for each component and build
- * a matching multiplier table.
- */
-
-METHODDEF(void)
-start_pass (j_decompress_ptr cinfo)
-{
- my_idct_ptr idct = (my_idct_ptr) cinfo->idct;
- int ci, i;
- jpeg_component_info *compptr;
- int method = 0;
- inverse_DCT_method_ptr method_ptr = NULL;
- JQUANT_TBL * qtbl;
-
- for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
- ci++, compptr++) {
- /* Select the proper IDCT routine for this component's scaling */
- switch (compptr->DCT_scaled_size) {
-#ifdef IDCT_SCALING_SUPPORTED
- case 1:
- method_ptr = jpeg_idct_1x1;
- method = JDCT_ISLOW; /* jidctred uses islow-style table */
- break;
- case 2:
- method_ptr = jpeg_idct_2x2;
- method = JDCT_ISLOW; /* jidctred uses islow-style table */
- break;
- case 4:
- method_ptr = jpeg_idct_4x4;
- method = JDCT_ISLOW; /* jidctred uses islow-style table */
- break;
-#endif
- case DCTSIZE:
- switch (cinfo->dct_method) {
-#ifdef DCT_ISLOW_SUPPORTED
- case JDCT_ISLOW:
- method_ptr = jpeg_idct_islow;
- method = JDCT_ISLOW;
- break;
-#endif
-#ifdef DCT_IFAST_SUPPORTED
- case JDCT_IFAST:
- method_ptr = jpeg_idct_ifast;
- method = JDCT_IFAST;
- break;
-#endif
-#ifdef DCT_FLOAT_SUPPORTED
- case JDCT_FLOAT:
- method_ptr = jpeg_idct_float;
- method = JDCT_FLOAT;
- break;
-#endif
- default:
- ERREXIT(cinfo, JERR_NOT_COMPILED);
- break;
- }
- break;
- default:
- ERREXIT1(cinfo, JERR_BAD_DCTSIZE, compptr->DCT_scaled_size);
- break;
- }
- idct->pub.inverse_DCT[ci] = method_ptr;
- /* Create multiplier table from quant table.
- * However, we can skip this if the component is uninteresting
- * or if we already built the table. Also, if no quant table
- * has yet been saved for the component, we leave the
- * multiplier table all-zero; we'll be reading zeroes from the
- * coefficient controller's buffer anyway.
- */
- if (! compptr->component_needed || idct->cur_method[ci] == method)
- continue;
- qtbl = compptr->quant_table;
- if (qtbl == NULL) /* happens if no data yet for component */
- continue;
- idct->cur_method[ci] = method;
- switch (method) {
-#ifdef PROVIDE_ISLOW_TABLES
- case JDCT_ISLOW:
- {
- /* For LL&M IDCT method, multipliers are equal to raw quantization
- * coefficients, but are stored as ints to ensure access efficiency.
- */
- ISLOW_MULT_TYPE * ismtbl = (ISLOW_MULT_TYPE *) compptr->dct_table;
- for (i = 0; i < DCTSIZE2; i++) {
- ismtbl[i] = (ISLOW_MULT_TYPE) qtbl->quantval[i];
- }
- }
- break;
-#endif
-#ifdef DCT_IFAST_SUPPORTED
- case JDCT_IFAST:
- {
- /* For AA&N IDCT method, multipliers are equal to quantization
- * coefficients scaled by scalefactor[row]*scalefactor[col], where
- * scalefactor[0] = 1
- * scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7
- * For integer operation, the multiplier table is to be scaled by
- * IFAST_SCALE_BITS.
- */
- IFAST_MULT_TYPE * ifmtbl = (IFAST_MULT_TYPE *) compptr->dct_table;
-#define CONST_BITS 14
- static const INT16 aanscales[DCTSIZE2] = {
- /* precomputed values scaled up by 14 bits */
- 16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520,
- 22725, 31521, 29692, 26722, 22725, 17855, 12299, 6270,
- 21407, 29692, 27969, 25172, 21407, 16819, 11585, 5906,
- 19266, 26722, 25172, 22654, 19266, 15137, 10426, 5315,
- 16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520,
- 12873, 17855, 16819, 15137, 12873, 10114, 6967, 3552,
- 8867, 12299, 11585, 10426, 8867, 6967, 4799, 2446,
- 4520, 6270, 5906, 5315, 4520, 3552, 2446, 1247
- };
- SHIFT_TEMPS
-
- for (i = 0; i < DCTSIZE2; i++) {
- ifmtbl[i] = (IFAST_MULT_TYPE)
- DESCALE(MULTIPLY16V16((INT32) qtbl->quantval[i],
- (INT32) aanscales[i]),
- CONST_BITS-IFAST_SCALE_BITS);
- }
- }
- break;
-#endif
-#ifdef DCT_FLOAT_SUPPORTED
- case JDCT_FLOAT:
- {
- /* For float AA&N IDCT method, multipliers are equal to quantization
- * coefficients scaled by scalefactor[row]*scalefactor[col], where
- * scalefactor[0] = 1
- * scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7
- */
- FLOAT_MULT_TYPE * fmtbl = (FLOAT_MULT_TYPE *) compptr->dct_table;
- int row, col;
- static const double aanscalefactor[DCTSIZE] = {
- 1.0, 1.387039845, 1.306562965, 1.175875602,
- 1.0, 0.785694958, 0.541196100, 0.275899379
- };
-
- i = 0;
- for (row = 0; row < DCTSIZE; row++) {
- for (col = 0; col < DCTSIZE; col++) {
- fmtbl[i] = (FLOAT_MULT_TYPE)
- ((double) qtbl->quantval[i] *
- aanscalefactor[row] * aanscalefactor[col]);
- i++;
- }
- }
- }
- break;
-#endif
- default:
- ERREXIT(cinfo, JERR_NOT_COMPILED);
- break;
- }
- }
-}
-
-
-/*
- * Initialize IDCT manager.
- */
-
-GLOBAL(void)
-jinit_inverse_dct (j_decompress_ptr cinfo)
-{
- my_idct_ptr idct;
- int ci;
- jpeg_component_info *compptr;
-
- idct = (my_idct_ptr)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- SIZEOF(my_idct_controller));
- cinfo->idct = (struct jpeg_inverse_dct *) idct;
- idct->pub.start_pass = start_pass;
-
- for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
- ci++, compptr++) {
- /* Allocate and pre-zero a multiplier table for each component */
- compptr->dct_table =
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- SIZEOF(multiplier_table));
- MEMZERO(compptr->dct_table, SIZEOF(multiplier_table));
- /* Mark multiplier table not yet set up for any method */
- idct->cur_method[ci] = -1;
- }
-}
-
-#endif //_FX_JPEG_TURBO_
+#if !defined(_FX_JPEG_TURBO_)
+/*
+ * jddctmgr.c
+ *
+ * Copyright (C) 1994-1996, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains the inverse-DCT management logic.
+ * This code selects a particular IDCT implementation to be used,
+ * and it performs related housekeeping chores. No code in this file
+ * is executed per IDCT step, only during output pass setup.
+ *
+ * Note that the IDCT routines are responsible for performing coefficient
+ * dequantization as well as the IDCT proper. This module sets up the
+ * dequantization multiplier table needed by the IDCT routine.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+#include "jdct.h" /* Private declarations for DCT subsystem */
+
+
+/*
+ * The decompressor input side (jdinput.c) saves away the appropriate
+ * quantization table for each component at the start of the first scan
+ * involving that component. (This is necessary in order to correctly
+ * decode files that reuse Q-table slots.)
+ * When we are ready to make an output pass, the saved Q-table is converted
+ * to a multiplier table that will actually be used by the IDCT routine.
+ * The multiplier table contents are IDCT-method-dependent. To support
+ * application changes in IDCT method between scans, we can remake the
+ * multiplier tables if necessary.
+ * In buffered-image mode, the first output pass may occur before any data
+ * has been seen for some components, and thus before their Q-tables have
+ * been saved away. To handle this case, multiplier tables are preset
+ * to zeroes; the result of the IDCT will be a neutral gray level.
+ */
+
+
+/* Private subobject for this module */
+
+typedef struct {
+ struct jpeg_inverse_dct pub; /* public fields */
+
+ /* This array contains the IDCT method code that each multiplier table
+ * is currently set up for, or -1 if it's not yet set up.
+ * The actual multiplier tables are pointed to by dct_table in the
+ * per-component comp_info structures.
+ */
+ int cur_method[MAX_COMPONENTS];
+} my_idct_controller;
+
+typedef my_idct_controller * my_idct_ptr;
+
+
+/* Allocated multiplier tables: big enough for any supported variant */
+
+typedef union {
+ ISLOW_MULT_TYPE islow_array[DCTSIZE2];
+#ifdef DCT_IFAST_SUPPORTED
+ IFAST_MULT_TYPE ifast_array[DCTSIZE2];
+#endif
+#ifdef DCT_FLOAT_SUPPORTED
+ FLOAT_MULT_TYPE float_array[DCTSIZE2];
+#endif
+} multiplier_table;
+
+
+/* The current scaled-IDCT routines require ISLOW-style multiplier tables,
+ * so be sure to compile that code if either ISLOW or SCALING is requested.
+ */
+#ifdef DCT_ISLOW_SUPPORTED
+#define PROVIDE_ISLOW_TABLES
+#else
+#ifdef IDCT_SCALING_SUPPORTED
+#define PROVIDE_ISLOW_TABLES
+#endif
+#endif
+
+
+/*
+ * Prepare for an output pass.
+ * Here we select the proper IDCT routine for each component and build
+ * a matching multiplier table.
+ */
+
+METHODDEF(void)
+start_pass (j_decompress_ptr cinfo)
+{
+ my_idct_ptr idct = (my_idct_ptr) cinfo->idct;
+ int ci, i;
+ jpeg_component_info *compptr;
+ int method = 0;
+ inverse_DCT_method_ptr method_ptr = NULL;
+ JQUANT_TBL * qtbl;
+
+ for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+ ci++, compptr++) {
+ /* Select the proper IDCT routine for this component's scaling */
+ switch (compptr->DCT_scaled_size) {
+#ifdef IDCT_SCALING_SUPPORTED
+ case 1:
+ method_ptr = jpeg_idct_1x1;
+ method = JDCT_ISLOW; /* jidctred uses islow-style table */
+ break;
+ case 2:
+ method_ptr = jpeg_idct_2x2;
+ method = JDCT_ISLOW; /* jidctred uses islow-style table */
+ break;
+ case 4:
+ method_ptr = jpeg_idct_4x4;
+ method = JDCT_ISLOW; /* jidctred uses islow-style table */
+ break;
+#endif
+ case DCTSIZE:
+ switch (cinfo->dct_method) {
+#ifdef DCT_ISLOW_SUPPORTED
+ case JDCT_ISLOW:
+ method_ptr = jpeg_idct_islow;
+ method = JDCT_ISLOW;
+ break;
+#endif
+#ifdef DCT_IFAST_SUPPORTED
+ case JDCT_IFAST:
+ method_ptr = jpeg_idct_ifast;
+ method = JDCT_IFAST;
+ break;
+#endif
+#ifdef DCT_FLOAT_SUPPORTED
+ case JDCT_FLOAT:
+ method_ptr = jpeg_idct_float;
+ method = JDCT_FLOAT;
+ break;
+#endif
+ default:
+ ERREXIT(cinfo, JERR_NOT_COMPILED);
+ break;
+ }
+ break;
+ default:
+ ERREXIT1(cinfo, JERR_BAD_DCTSIZE, compptr->DCT_scaled_size);
+ break;
+ }
+ idct->pub.inverse_DCT[ci] = method_ptr;
+ /* Create multiplier table from quant table.
+ * However, we can skip this if the component is uninteresting
+ * or if we already built the table. Also, if no quant table
+ * has yet been saved for the component, we leave the
+ * multiplier table all-zero; we'll be reading zeroes from the
+ * coefficient controller's buffer anyway.
+ */
+ if (! compptr->component_needed || idct->cur_method[ci] == method)
+ continue;
+ qtbl = compptr->quant_table;
+ if (qtbl == NULL) /* happens if no data yet for component */
+ continue;
+ idct->cur_method[ci] = method;
+ switch (method) {
+#ifdef PROVIDE_ISLOW_TABLES
+ case JDCT_ISLOW:
+ {
+ /* For LL&M IDCT method, multipliers are equal to raw quantization
+ * coefficients, but are stored as ints to ensure access efficiency.
+ */
+ ISLOW_MULT_TYPE * ismtbl = (ISLOW_MULT_TYPE *) compptr->dct_table;
+ for (i = 0; i < DCTSIZE2; i++) {
+ ismtbl[i] = (ISLOW_MULT_TYPE) qtbl->quantval[i];
+ }
+ }
+ break;
+#endif
+#ifdef DCT_IFAST_SUPPORTED
+ case JDCT_IFAST:
+ {
+ /* For AA&N IDCT method, multipliers are equal to quantization
+ * coefficients scaled by scalefactor[row]*scalefactor[col], where
+ * scalefactor[0] = 1
+ * scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7
+ * For integer operation, the multiplier table is to be scaled by
+ * IFAST_SCALE_BITS.
+ */
+ IFAST_MULT_TYPE * ifmtbl = (IFAST_MULT_TYPE *) compptr->dct_table;
+#define CONST_BITS 14
+ static const INT16 aanscales[DCTSIZE2] = {
+ /* precomputed values scaled up by 14 bits */
+ 16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520,
+ 22725, 31521, 29692, 26722, 22725, 17855, 12299, 6270,
+ 21407, 29692, 27969, 25172, 21407, 16819, 11585, 5906,
+ 19266, 26722, 25172, 22654, 19266, 15137, 10426, 5315,
+ 16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520,
+ 12873, 17855, 16819, 15137, 12873, 10114, 6967, 3552,
+ 8867, 12299, 11585, 10426, 8867, 6967, 4799, 2446,
+ 4520, 6270, 5906, 5315, 4520, 3552, 2446, 1247
+ };
+ SHIFT_TEMPS
+
+ for (i = 0; i < DCTSIZE2; i++) {
+ ifmtbl[i] = (IFAST_MULT_TYPE)
+ DESCALE(MULTIPLY16V16((INT32) qtbl->quantval[i],
+ (INT32) aanscales[i]),
+ CONST_BITS-IFAST_SCALE_BITS);
+ }
+ }
+ break;
+#endif
+#ifdef DCT_FLOAT_SUPPORTED
+ case JDCT_FLOAT:
+ {
+ /* For float AA&N IDCT method, multipliers are equal to quantization
+ * coefficients scaled by scalefactor[row]*scalefactor[col], where
+ * scalefactor[0] = 1
+ * scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7
+ */
+ FLOAT_MULT_TYPE * fmtbl = (FLOAT_MULT_TYPE *) compptr->dct_table;
+ int row, col;
+ static const double aanscalefactor[DCTSIZE] = {
+ 1.0, 1.387039845, 1.306562965, 1.175875602,
+ 1.0, 0.785694958, 0.541196100, 0.275899379
+ };
+
+ i = 0;
+ for (row = 0; row < DCTSIZE; row++) {
+ for (col = 0; col < DCTSIZE; col++) {
+ fmtbl[i] = (FLOAT_MULT_TYPE)
+ ((double) qtbl->quantval[i] *
+ aanscalefactor[row] * aanscalefactor[col]);
+ i++;
+ }
+ }
+ }
+ break;
+#endif
+ default:
+ ERREXIT(cinfo, JERR_NOT_COMPILED);
+ break;
+ }
+ }
+}
+
+
+/*
+ * Initialize IDCT manager.
+ */
+
+GLOBAL(void)
+jinit_inverse_dct (j_decompress_ptr cinfo)
+{
+ my_idct_ptr idct;
+ int ci;
+ jpeg_component_info *compptr;
+
+ idct = (my_idct_ptr)
+ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ SIZEOF(my_idct_controller));
+ cinfo->idct = (struct jpeg_inverse_dct *) idct;
+ idct->pub.start_pass = start_pass;
+
+ for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+ ci++, compptr++) {
+ /* Allocate and pre-zero a multiplier table for each component */
+ compptr->dct_table =
+ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ SIZEOF(multiplier_table));
+ MEMZERO(compptr->dct_table, SIZEOF(multiplier_table));
+ /* Mark multiplier table not yet set up for any method */
+ idct->cur_method[ci] = -1;
+ }
+}
+
+#endif //_FX_JPEG_TURBO_
diff --git a/core/src/fxcodec/libjpeg/fpdfapi_jdhuff.c b/core/src/fxcodec/libjpeg/fpdfapi_jdhuff.c
index b724d52b95..dc37db58a9 100644
--- a/core/src/fxcodec/libjpeg/fpdfapi_jdhuff.c
+++ b/core/src/fxcodec/libjpeg/fpdfapi_jdhuff.c
@@ -1,657 +1,657 @@
-#if !defined(_FX_JPEG_TURBO_)
-/*
- * jdhuff.c
- *
- * Copyright (C) 1991-1997, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- * For conditions of distribution and use, see the accompanying README file.
- *
- * This file contains Huffman entropy decoding routines.
- *
- * Much of the complexity here has to do with supporting input suspension.
- * If the data source module demands suspension, we want to be able to back
- * up to the start of the current MCU. To do this, we copy state variables
- * into local working storage, and update them back to the permanent
- * storage only upon successful completion of an MCU.
- */
-
-#define JPEG_INTERNALS
-#include "jinclude.h"
-#include "jpeglib.h"
-#include "jdhuff.h" /* Declarations shared with jdphuff.c */
-
-#ifdef _FX_MANAGED_CODE_
-#define savable_state savable_state_d
-#endif
-
-/*
- * Expanded entropy decoder object for Huffman decoding.
- *
- * The savable_state subrecord contains fields that change within an MCU,
- * but must not be updated permanently until we complete the MCU.
- */
-
-typedef struct {
- int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */
-} savable_state;
-
-/* This macro is to work around compilers with missing or broken
- * structure assignment. You'll need to fix this code if you have
- * such a compiler and you change MAX_COMPS_IN_SCAN.
- */
-
-#ifndef NO_STRUCT_ASSIGN
-#define ASSIGN_STATE(dest,src) ((dest) = (src))
-#else
-#if MAX_COMPS_IN_SCAN == 4
-#define ASSIGN_STATE(dest,src) \
- ((dest).last_dc_val[0] = (src).last_dc_val[0], \
- (dest).last_dc_val[1] = (src).last_dc_val[1], \
- (dest).last_dc_val[2] = (src).last_dc_val[2], \
- (dest).last_dc_val[3] = (src).last_dc_val[3])
-#endif
-#endif
-
-
-typedef struct {
- struct jpeg_entropy_decoder pub; /* public fields */
-
- /* These fields are loaded into local variables at start of each MCU.
- * In case of suspension, we exit WITHOUT updating them.
- */
- bitread_perm_state bitstate; /* Bit buffer at start of MCU */
- savable_state saved; /* Other state at start of MCU */
-
- /* These fields are NOT loaded into local working state. */
- unsigned int restarts_to_go; /* MCUs left in this restart interval */
-
- /* Pointers to derived tables (these workspaces have image lifespan) */
- d_derived_tbl * dc_derived_tbls[NUM_HUFF_TBLS];
- d_derived_tbl * ac_derived_tbls[NUM_HUFF_TBLS];
-
- /* Precalculated info set up by start_pass for use in decode_mcu: */
-
- /* Pointers to derived tables to be used for each block within an MCU */
- d_derived_tbl * dc_cur_tbls[D_MAX_BLOCKS_IN_MCU];
- d_derived_tbl * ac_cur_tbls[D_MAX_BLOCKS_IN_MCU];
- /* Whether we care about the DC and AC coefficient values for each block */
- boolean dc_needed[D_MAX_BLOCKS_IN_MCU];
- boolean ac_needed[D_MAX_BLOCKS_IN_MCU];
-} huff_entropy_decoder;
-
-typedef huff_entropy_decoder * huff_entropy_ptr;
-
-
-/*
- * Initialize for a Huffman-compressed scan.
- */
-
-METHODDEF(void)
-start_pass_huff_decoder (j_decompress_ptr cinfo)
-{
- huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
- int ci, blkn, dctbl, actbl;
- jpeg_component_info * compptr;
-
- /* Check that the scan parameters Ss, Se, Ah/Al are OK for sequential JPEG.
- * This ought to be an error condition, but we make it a warning because
- * there are some baseline files out there with all zeroes in these bytes.
- */
- if (cinfo->Ss != 0 || cinfo->Se != DCTSIZE2-1 ||
- cinfo->Ah != 0 || cinfo->Al != 0)
- WARNMS(cinfo, JWRN_NOT_SEQUENTIAL);
-
- for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
- compptr = cinfo->cur_comp_info[ci];
- dctbl = compptr->dc_tbl_no;
- actbl = compptr->ac_tbl_no;
- /* Compute derived values for Huffman tables */
- /* We may do this more than once for a table, but it's not expensive */
- jpeg_make_d_derived_tbl(cinfo, TRUE, dctbl,
- & entropy->dc_derived_tbls[dctbl]);
- jpeg_make_d_derived_tbl(cinfo, FALSE, actbl,
- & entropy->ac_derived_tbls[actbl]);
- /* Initialize DC predictions to 0 */
- entropy->saved.last_dc_val[ci] = 0;
- }
-
- /* Precalculate decoding info for each block in an MCU of this scan */
- for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
- ci = cinfo->MCU_membership[blkn];
- compptr = cinfo->cur_comp_info[ci];
- /* Precalculate which table to use for each block */
- entropy->dc_cur_tbls[blkn] = entropy->dc_derived_tbls[compptr->dc_tbl_no];
- entropy->ac_cur_tbls[blkn] = entropy->ac_derived_tbls[compptr->ac_tbl_no];
- /* Decide whether we really care about the coefficient values */
- if (compptr->component_needed) {
- entropy->dc_needed[blkn] = TRUE;
- /* we don't need the ACs if producing a 1/8th-size image */
- entropy->ac_needed[blkn] = (compptr->DCT_scaled_size > 1);
- } else {
- entropy->dc_needed[blkn] = entropy->ac_needed[blkn] = FALSE;
- }
- }
-
- /* Initialize bitread state variables */
- entropy->bitstate.bits_left = 0;
- entropy->bitstate.get_buffer = 0; /* unnecessary, but keeps Purify quiet */
- entropy->pub.insufficient_data = FALSE;
-
- /* Initialize restart counter */
- entropy->restarts_to_go = cinfo->restart_interval;
-}
-
-
-/*
- * Compute the derived values for a Huffman table.
- * This routine also performs some validation checks on the table.
- *
- * Note this is also used by jdphuff.c.
- */
-
-GLOBAL(void)
-jpeg_make_d_derived_tbl (j_decompress_ptr cinfo, boolean isDC, int tblno,
- d_derived_tbl ** pdtbl)
-{
- JHUFF_TBL *htbl;
- d_derived_tbl *dtbl;
- int p, i, l, _si, numsymbols;
- int lookbits, ctr;
- char huffsize[257];
- unsigned int huffcode[257];
- unsigned int code;
-
- /* Note that huffsize[] and huffcode[] are filled in code-length order,
- * paralleling the order of the symbols themselves in htbl->huffval[].
- */
-
- /* Find the input Huffman table */
- if (tblno < 0 || tblno >= NUM_HUFF_TBLS)
- ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno);
- htbl =
- isDC ? cinfo->dc_huff_tbl_ptrs[tblno] : cinfo->ac_huff_tbl_ptrs[tblno];
- if (htbl == NULL)
- ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno);
-
- /* Allocate a workspace if we haven't already done so. */
- if (*pdtbl == NULL)
- *pdtbl = (d_derived_tbl *)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- SIZEOF(d_derived_tbl));
- dtbl = *pdtbl;
- dtbl->pub = htbl; /* fill in back link */
-
- /* Figure C.1: make table of Huffman code length for each symbol */
-
- p = 0;
- for (l = 1; l <= 16; l++) {
- i = (int) htbl->bits[l];
- if (i < 0 || p + i > 256) /* protect against table overrun */
- ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
- while (i--)
- huffsize[p++] = (char) l;
- }
- huffsize[p] = 0;
- numsymbols = p;
-
- /* Figure C.2: generate the codes themselves */
- /* We also validate that the counts represent a legal Huffman code tree. */
-
- code = 0;
- _si = huffsize[0];
- p = 0;
- while (huffsize[p]) {
- while (((int) huffsize[p]) == _si) {
- huffcode[p++] = code;
- code++;
- }
- /* code is now 1 more than the last code used for codelength si; but
- * it must still fit in si bits, since no code is allowed to be all ones.
- */
- if (((INT32) code) >= (((INT32) 1) << _si))
- ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
- code <<= 1;
- _si++;
- }
-
- /* Figure F.15: generate decoding tables for bit-sequential decoding */
-
- p = 0;
- for (l = 1; l <= 16; l++) {
- if (htbl->bits[l]) {
- /* valoffset[l] = huffval[] index of 1st symbol of code length l,
- * minus the minimum code of length l
- */
- dtbl->valoffset[l] = (INT32) p - (INT32) huffcode[p];
- p += htbl->bits[l];
- dtbl->maxcode[l] = huffcode[p-1]; /* maximum code of length l */
- } else {
- dtbl->maxcode[l] = -1; /* -1 if no codes of this length */
- }
- }
- dtbl->maxcode[17] = 0xFFFFFL; /* ensures jpeg_huff_decode terminates */
-
- /* Compute lookahead tables to speed up decoding.
- * First we set all the table entries to 0, indicating "too long";
- * then we iterate through the Huffman codes that are short enough and
- * fill in all the entries that correspond to bit sequences starting
- * with that code.
- */
-
- MEMZERO(dtbl->look_nbits, SIZEOF(dtbl->look_nbits));
-
- p = 0;
- for (l = 1; l <= HUFF_LOOKAHEAD; l++) {
- for (i = 1; i <= (int) htbl->bits[l]; i++, p++) {
- /* l = current code's length, p = its index in huffcode[] & huffval[]. */
- /* Generate left-justified code followed by all possible bit sequences */
- lookbits = huffcode[p] << (HUFF_LOOKAHEAD-l);
- for (ctr = 1 << (HUFF_LOOKAHEAD-l); ctr > 0; ctr--) {
- dtbl->look_nbits[lookbits] = l;
- dtbl->look_sym[lookbits] = htbl->huffval[p];
- lookbits++;
- }
- }
- }
-
- /* Validate symbols as being reasonable.
- * For AC tables, we make no check, but accept all byte values 0..255.
- * For DC tables, we require the symbols to be in range 0..15.
- * (Tighter bounds could be applied depending on the data depth and mode,
- * but this is sufficient to ensure safe decoding.)
- */
- if (isDC) {
- for (i = 0; i < numsymbols; i++) {
- int sym = htbl->huffval[i];
- if (sym < 0 || sym > 15)
- ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
- }
- }
-}
-
-
-/*
- * Out-of-line code for bit fetching (shared with jdphuff.c).
- * See jdhuff.h for info about usage.
- * Note: current values of get_buffer and bits_left are passed as parameters,
- * but are returned in the corresponding fields of the state struct.
- *
- * On most machines MIN_GET_BITS should be 25 to allow the full 32-bit width
- * of get_buffer to be used. (On machines with wider words, an even larger
- * buffer could be used.) However, on some machines 32-bit shifts are
- * quite slow and take time proportional to the number of places shifted.
- * (This is true with most PC compilers, for instance.) In this case it may
- * be a win to set MIN_GET_BITS to the minimum value of 15. This reduces the
- * average shift distance at the cost of more calls to jpeg_fill_bit_buffer.
- */
-
-#ifdef SLOW_SHIFT_32
-#define MIN_GET_BITS 15 /* minimum allowable value */
-#else
-#define MIN_GET_BITS (BIT_BUF_SIZE-7)
-#endif
-
-
-GLOBAL(boolean)
-jpeg_fill_bit_buffer (bitread_working_state * state,
- register bit_buf_type get_buffer, register int bits_left,
- int nbits)
-/* Load up the bit buffer to a depth of at least nbits */
-{
- /* Copy heavily used state fields into locals (hopefully registers) */
- register const JOCTET * next_input_byte = state->next_input_byte;
- register size_t bytes_in_buffer = state->bytes_in_buffer;
- j_decompress_ptr cinfo = state->cinfo;
-
- /* Attempt to load at least MIN_GET_BITS bits into get_buffer. */
- /* (It is assumed that no request will be for more than that many bits.) */
- /* We fail to do so only if we hit a marker or are forced to suspend. */
-
- if (cinfo->unread_marker == 0) { /* cannot advance past a marker */
- while (bits_left < MIN_GET_BITS) {
- register int c;
-
- /* Attempt to read a byte */
- if (bytes_in_buffer == 0) {
- if (! (*cinfo->src->fill_input_buffer) (cinfo))
- return FALSE;
- next_input_byte = cinfo->src->next_input_byte;
- bytes_in_buffer = cinfo->src->bytes_in_buffer;
- }
- bytes_in_buffer--;
- c = GETJOCTET(*next_input_byte++);
-
- /* If it's 0xFF, check and discard stuffed zero byte */
- if (c == 0xFF) {
- /* Loop here to discard any padding FF's on terminating marker,
- * so that we can save a valid unread_marker value. NOTE: we will
- * accept multiple FF's followed by a 0 as meaning a single FF data
- * byte. This data pattern is not valid according to the standard.
- */
- do {
- if (bytes_in_buffer == 0) {
- if (! (*cinfo->src->fill_input_buffer) (cinfo))
- return FALSE;
- next_input_byte = cinfo->src->next_input_byte;
- bytes_in_buffer = cinfo->src->bytes_in_buffer;
- }
- bytes_in_buffer--;
- c = GETJOCTET(*next_input_byte++);
- } while (c == 0xFF);
-
- if (c == 0) {
- /* Found FF/00, which represents an FF data byte */
- c = 0xFF;
- } else {
- /* Oops, it's actually a marker indicating end of compressed data.
- * Save the marker code for later use.
- * Fine point: it might appear that we should save the marker into
- * bitread working state, not straight into permanent state. But
- * once we have hit a marker, we cannot need to suspend within the
- * current MCU, because we will read no more bytes from the data
- * source. So it is OK to update permanent state right away.
- */
- cinfo->unread_marker = c;
- /* See if we need to insert some fake zero bits. */
- goto no_more_bytes;
- }
- }
-
- /* OK, load c into get_buffer */
- get_buffer = (get_buffer << 8) | c;
- bits_left += 8;
- } /* end while */
- } else {
- no_more_bytes:
- /* We get here if we've read the marker that terminates the compressed
- * data segment. There should be enough bits in the buffer register
- * to satisfy the request; if so, no problem.
- */
- if (nbits > bits_left) {
- /* Uh-oh. Report corrupted data to user and stuff zeroes into
- * the data stream, so that we can produce some kind of image.
- * We use a nonvolatile flag to ensure that only one warning message
- * appears per data segment.
- */
- if (! cinfo->entropy->insufficient_data) {
- WARNMS(cinfo, JWRN_HIT_MARKER);
- cinfo->entropy->insufficient_data = TRUE;
- }
- /* Fill the buffer with zero bits */
- get_buffer <<= MIN_GET_BITS - bits_left;
- bits_left = MIN_GET_BITS;
- }
- }
-
- /* Unload the local registers */
- state->next_input_byte = next_input_byte;
- state->bytes_in_buffer = bytes_in_buffer;
- state->get_buffer = get_buffer;
- state->bits_left = bits_left;
-
- return TRUE;
-}
-
-
-/*
- * Out-of-line code for Huffman code decoding.
- * See jdhuff.h for info about usage.
- */
-
-GLOBAL(int)
-jpeg_huff_decode (bitread_working_state * state,
- register bit_buf_type get_buffer, register int bits_left,
- d_derived_tbl * htbl, int min_bits)
-{
- register int l = min_bits;
- register INT32 code;
-
- /* HUFF_DECODE has determined that the code is at least min_bits */
- /* bits long, so fetch that many bits in one swoop. */
-
- CHECK_BIT_BUFFER(*state, l, return -1);
- code = GET_BITS(l);
-
- /* Collect the rest of the Huffman code one bit at a time. */
- /* This is per Figure F.16 in the JPEG spec. */
-
- while (code > htbl->maxcode[l]) {
- code <<= 1;
- CHECK_BIT_BUFFER(*state, 1, return -1);
- code |= GET_BITS(1);
- l++;
- }
-
- /* Unload the local registers */
- state->get_buffer = get_buffer;
- state->bits_left = bits_left;
-
- /* With garbage input we may reach the sentinel value l = 17. */
-
- if (l > 16) {
- WARNMS(state->cinfo, JWRN_HUFF_BAD_CODE);
- return 0; /* fake a zero as the safest result */
- }
-
- return htbl->pub->huffval[ (int) (code + htbl->valoffset[l]) ];
-}
-
-
-/*
- * Figure F.12: extend sign bit.
- * On some machines, a shift and add will be faster than a table lookup.
- */
-
-#ifdef AVOID_TABLES
-
-#define HUFF_EXTEND(x,s) ((x) < (1<<((s)-1)) ? (x) + (((-1)<<(s)) + 1) : (x))
-
-#else
-
-#define HUFF_EXTEND(x,s) ((x) < extend_test[s] ? (x) + extend_offset[s] : (x))
-
-static const int extend_test[16] = /* entry n is 2**(n-1) */
- { 0, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080,
- 0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000 };
-
-static const int extend_offset[16] = /* entry n is (-1 << n) + 1 */
- { 0, ((-1)<<1) + 1, ((-1)<<2) + 1, ((-1)<<3) + 1, ((-1)<<4) + 1,
- ((-1)<<5) + 1, ((-1)<<6) + 1, ((-1)<<7) + 1, ((-1)<<8) + 1,
- ((-1)<<9) + 1, ((-1)<<10) + 1, ((-1)<<11) + 1, ((-1)<<12) + 1,
- ((-1)<<13) + 1, ((-1)<<14) + 1, ((-1)<<15) + 1 };
-
-#endif /* AVOID_TABLES */
-
-
-/*
- * Check for a restart marker & resynchronize decoder.
- * Returns FALSE if must suspend.
- */
-
-LOCAL(boolean)
-process_restart (j_decompress_ptr cinfo)
-{
- huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
- int ci;
-
- /* Throw away any unused bits remaining in bit buffer; */
- /* include any full bytes in next_marker's count of discarded bytes */
- cinfo->marker->discarded_bytes += entropy->bitstate.bits_left / 8;
- entropy->bitstate.bits_left = 0;
-
- /* Advance past the RSTn marker */
- if (! (*cinfo->marker->read_restart_marker) (cinfo))
- return FALSE;
-
- /* Re-initialize DC predictions to 0 */
- for (ci = 0; ci < cinfo->comps_in_scan; ci++)
- entropy->saved.last_dc_val[ci] = 0;
-
- /* Reset restart counter */
- entropy->restarts_to_go = cinfo->restart_interval;
-
- /* Reset out-of-data flag, unless read_restart_marker left us smack up
- * against a marker. In that case we will end up treating the next data
- * segment as empty, and we can avoid producing bogus output pixels by
- * leaving the flag set.
- */
- if (cinfo->unread_marker == 0)
- entropy->pub.insufficient_data = FALSE;
-
- return TRUE;
-}
-
-
-/*
- * Decode and return one MCU's worth of Huffman-compressed coefficients.
- * The coefficients are reordered from zigzag order into natural array order,
- * but are not dequantized.
- *
- * The i'th block of the MCU is stored into the block pointed to by
- * MCU_data[i]. WE ASSUME THIS AREA HAS BEEN ZEROED BY THE CALLER.
- * (Wholesale zeroing is usually a little faster than retail...)
- *
- * Returns FALSE if data source requested suspension. In that case no
- * changes have been made to permanent state. (Exception: some output
- * coefficients may already have been assigned. This is harmless for
- * this module, since we'll just re-assign them on the next call.)
- */
-
-METHODDEF(boolean)
-decode_mcu (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
-{
- huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
- int blkn;
- BITREAD_STATE_VARS;
- savable_state state;
-
- /* Process restart marker if needed; may have to suspend */
- if (cinfo->restart_interval) {
- if (entropy->restarts_to_go == 0)
- if (! process_restart(cinfo))
- return FALSE;
- }
-
- /* If we've run out of data, just leave the MCU set to zeroes.
- * This way, we return uniform gray for the remainder of the segment.
- */
- if (! entropy->pub.insufficient_data) {
-
- /* Load up working state */
- BITREAD_LOAD_STATE(cinfo,entropy->bitstate);
- ASSIGN_STATE(state, entropy->saved);
-
- /* Outer loop handles each block in the MCU */
-
- for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
- JBLOCKROW block = MCU_data[blkn];
- d_derived_tbl * dctbl = entropy->dc_cur_tbls[blkn];
- d_derived_tbl * actbl = entropy->ac_cur_tbls[blkn];
- register int s, k, r;
-
- /* Decode a single block's worth of coefficients */
-
- /* Section F.2.2.1: decode the DC coefficient difference */
- HUFF_DECODE(s, br_state, dctbl, return FALSE, label1);
- if (s) {
- CHECK_BIT_BUFFER(br_state, s, return FALSE);
- r = GET_BITS(s);
- s = HUFF_EXTEND(r, s);
- }
-
- if (entropy->dc_needed[blkn]) {
- /* Convert DC difference to actual value, update last_dc_val */
- int ci = cinfo->MCU_membership[blkn];
- s += state.last_dc_val[ci];
- state.last_dc_val[ci] = s;
- /* Output the DC coefficient (assumes jpeg_natural_order[0] = 0) */
- (*block)[0] = (JCOEF) s;
- }
-
- if (entropy->ac_needed[blkn]) {
-
- /* Section F.2.2.2: decode the AC coefficients */
- /* Since zeroes are skipped, output area must be cleared beforehand */
- for (k = 1; k < DCTSIZE2; k++) {
- HUFF_DECODE(s, br_state, actbl, return FALSE, label2);
-
- r = s >> 4;
- s &= 15;
-
- if (s) {
- k += r;
- CHECK_BIT_BUFFER(br_state, s, return FALSE);
- r = GET_BITS(s);
- s = HUFF_EXTEND(r, s);
- /* Output coefficient in natural (dezigzagged) order.
- * Note: the extra entries in jpeg_natural_order[] will save us
- * if k >= DCTSIZE2, which could happen if the data is corrupted.
- */
- (*block)[jpeg_natural_order[k]] = (JCOEF) s;
- } else {
- if (r != 15)
- break;
- k += 15;
- }
- }
-
- } else {
-
- /* Section F.2.2.2: decode the AC coefficients */
- /* In this path we just discard the values */
- for (k = 1; k < DCTSIZE2; k++) {
- HUFF_DECODE(s, br_state, actbl, return FALSE, label3);
-
- r = s >> 4;
- s &= 15;
-
- if (s) {
- k += r;
- CHECK_BIT_BUFFER(br_state, s, return FALSE);
- DROP_BITS(s);
- } else {
- if (r != 15)
- break;
- k += 15;
- }
- }
-
- }
- }
-
- /* Completed MCU, so update state */
- BITREAD_SAVE_STATE(cinfo,entropy->bitstate);
- ASSIGN_STATE(entropy->saved, state);
- }
-
- /* Account for restart interval (no-op if not using restarts) */
- entropy->restarts_to_go--;
-
- return TRUE;
-}
-
-
-/*
- * Module initialization routine for Huffman entropy decoding.
- */
-
-GLOBAL(void)
-jinit_huff_decoder (j_decompress_ptr cinfo)
-{
- huff_entropy_ptr entropy;
- int i;
-
- entropy = (huff_entropy_ptr)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- SIZEOF(huff_entropy_decoder));
- cinfo->entropy = (struct jpeg_entropy_decoder *) entropy;
- entropy->pub.start_pass = start_pass_huff_decoder;
- entropy->pub.decode_mcu = decode_mcu;
-
- /* Mark tables unallocated */
- for (i = 0; i < NUM_HUFF_TBLS; i++) {
- entropy->dc_derived_tbls[i] = entropy->ac_derived_tbls[i] = NULL;
- }
-}
-
-#endif //_FX_JPEG_TURBO_
+#if !defined(_FX_JPEG_TURBO_)
+/*
+ * jdhuff.c
+ *
+ * Copyright (C) 1991-1997, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains Huffman entropy decoding routines.
+ *
+ * Much of the complexity here has to do with supporting input suspension.
+ * If the data source module demands suspension, we want to be able to back
+ * up to the start of the current MCU. To do this, we copy state variables
+ * into local working storage, and update them back to the permanent
+ * storage only upon successful completion of an MCU.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+#include "jdhuff.h" /* Declarations shared with jdphuff.c */
+
+#ifdef _FX_MANAGED_CODE_
+#define savable_state savable_state_d
+#endif
+
+/*
+ * Expanded entropy decoder object for Huffman decoding.
+ *
+ * The savable_state subrecord contains fields that change within an MCU,
+ * but must not be updated permanently until we complete the MCU.
+ */
+
+typedef struct {
+ int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */
+} savable_state;
+
+/* This macro is to work around compilers with missing or broken
+ * structure assignment. You'll need to fix this code if you have
+ * such a compiler and you change MAX_COMPS_IN_SCAN.
+ */
+
+#ifndef NO_STRUCT_ASSIGN
+#define ASSIGN_STATE(dest,src) ((dest) = (src))
+#else
+#if MAX_COMPS_IN_SCAN == 4
+#define ASSIGN_STATE(dest,src) \
+ ((dest).last_dc_val[0] = (src).last_dc_val[0], \
+ (dest).last_dc_val[1] = (src).last_dc_val[1], \
+ (dest).last_dc_val[2] = (src).last_dc_val[2], \
+ (dest).last_dc_val[3] = (src).last_dc_val[3])
+#endif
+#endif
+
+
+typedef struct {
+ struct jpeg_entropy_decoder pub; /* public fields */
+
+ /* These fields are loaded into local variables at start of each MCU.
+ * In case of suspension, we exit WITHOUT updating them.
+ */
+ bitread_perm_state bitstate; /* Bit buffer at start of MCU */
+ savable_state saved; /* Other state at start of MCU */
+
+ /* These fields are NOT loaded into local working state. */
+ unsigned int restarts_to_go; /* MCUs left in this restart interval */
+
+ /* Pointers to derived tables (these workspaces have image lifespan) */
+ d_derived_tbl * dc_derived_tbls[NUM_HUFF_TBLS];
+ d_derived_tbl * ac_derived_tbls[NUM_HUFF_TBLS];
+
+ /* Precalculated info set up by start_pass for use in decode_mcu: */
+
+ /* Pointers to derived tables to be used for each block within an MCU */
+ d_derived_tbl * dc_cur_tbls[D_MAX_BLOCKS_IN_MCU];
+ d_derived_tbl * ac_cur_tbls[D_MAX_BLOCKS_IN_MCU];
+ /* Whether we care about the DC and AC coefficient values for each block */
+ boolean dc_needed[D_MAX_BLOCKS_IN_MCU];
+ boolean ac_needed[D_MAX_BLOCKS_IN_MCU];
+} huff_entropy_decoder;
+
+typedef huff_entropy_decoder * huff_entropy_ptr;
+
+
+/*
+ * Initialize for a Huffman-compressed scan.
+ */
+
+METHODDEF(void)
+start_pass_huff_decoder (j_decompress_ptr cinfo)
+{
+ huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
+ int ci, blkn, dctbl, actbl;
+ jpeg_component_info * compptr;
+
+ /* Check that the scan parameters Ss, Se, Ah/Al are OK for sequential JPEG.
+ * This ought to be an error condition, but we make it a warning because
+ * there are some baseline files out there with all zeroes in these bytes.
+ */
+ if (cinfo->Ss != 0 || cinfo->Se != DCTSIZE2-1 ||
+ cinfo->Ah != 0 || cinfo->Al != 0)
+ WARNMS(cinfo, JWRN_NOT_SEQUENTIAL);
+
+ for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
+ compptr = cinfo->cur_comp_info[ci];
+ dctbl = compptr->dc_tbl_no;
+ actbl = compptr->ac_tbl_no;
+ /* Compute derived values for Huffman tables */
+ /* We may do this more than once for a table, but it's not expensive */
+ jpeg_make_d_derived_tbl(cinfo, TRUE, dctbl,
+ & entropy->dc_derived_tbls[dctbl]);
+ jpeg_make_d_derived_tbl(cinfo, FALSE, actbl,
+ & entropy->ac_derived_tbls[actbl]);
+ /* Initialize DC predictions to 0 */
+ entropy->saved.last_dc_val[ci] = 0;
+ }
+
+ /* Precalculate decoding info for each block in an MCU of this scan */
+ for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
+ ci = cinfo->MCU_membership[blkn];
+ compptr = cinfo->cur_comp_info[ci];
+ /* Precalculate which table to use for each block */
+ entropy->dc_cur_tbls[blkn] = entropy->dc_derived_tbls[compptr->dc_tbl_no];
+ entropy->ac_cur_tbls[blkn] = entropy->ac_derived_tbls[compptr->ac_tbl_no];
+ /* Decide whether we really care about the coefficient values */
+ if (compptr->component_needed) {
+ entropy->dc_needed[blkn] = TRUE;
+ /* we don't need the ACs if producing a 1/8th-size image */
+ entropy->ac_needed[blkn] = (compptr->DCT_scaled_size > 1);
+ } else {
+ entropy->dc_needed[blkn] = entropy->ac_needed[blkn] = FALSE;
+ }
+ }
+
+ /* Initialize bitread state variables */
+ entropy->bitstate.bits_left = 0;
+ entropy->bitstate.get_buffer = 0; /* unnecessary, but keeps Purify quiet */
+ entropy->pub.insufficient_data = FALSE;
+
+ /* Initialize restart counter */
+ entropy->restarts_to_go = cinfo->restart_interval;
+}
+
+
+/*
+ * Compute the derived values for a Huffman table.
+ * This routine also performs some validation checks on the table.
+ *
+ * Note this is also used by jdphuff.c.
+ */
+
+GLOBAL(void)
+jpeg_make_d_derived_tbl (j_decompress_ptr cinfo, boolean isDC, int tblno,
+ d_derived_tbl ** pdtbl)
+{
+ JHUFF_TBL *htbl;
+ d_derived_tbl *dtbl;
+ int p, i, l, _si, numsymbols;
+ int lookbits, ctr;
+ char huffsize[257];
+ unsigned int huffcode[257];
+ unsigned int code;
+
+ /* Note that huffsize[] and huffcode[] are filled in code-length order,
+ * paralleling the order of the symbols themselves in htbl->huffval[].
+ */
+
+ /* Find the input Huffman table */
+ if (tblno < 0 || tblno >= NUM_HUFF_TBLS)
+ ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno);
+ htbl =
+ isDC ? cinfo->dc_huff_tbl_ptrs[tblno] : cinfo->ac_huff_tbl_ptrs[tblno];
+ if (htbl == NULL)
+ ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno);
+
+ /* Allocate a workspace if we haven't already done so. */
+ if (*pdtbl == NULL)
+ *pdtbl = (d_derived_tbl *)
+ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ SIZEOF(d_derived_tbl));
+ dtbl = *pdtbl;
+ dtbl->pub = htbl; /* fill in back link */
+
+ /* Figure C.1: make table of Huffman code length for each symbol */
+
+ p = 0;
+ for (l = 1; l <= 16; l++) {
+ i = (int) htbl->bits[l];
+ if (i < 0 || p + i > 256) /* protect against table overrun */
+ ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
+ while (i--)
+ huffsize[p++] = (char) l;
+ }
+ huffsize[p] = 0;
+ numsymbols = p;
+
+ /* Figure C.2: generate the codes themselves */
+ /* We also validate that the counts represent a legal Huffman code tree. */
+
+ code = 0;
+ _si = huffsize[0];
+ p = 0;
+ while (huffsize[p]) {
+ while (((int) huffsize[p]) == _si) {
+ huffcode[p++] = code;
+ code++;
+ }
+ /* code is now 1 more than the last code used for codelength si; but
+ * it must still fit in si bits, since no code is allowed to be all ones.
+ */
+ if (((INT32) code) >= (((INT32) 1) << _si))
+ ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
+ code <<= 1;
+ _si++;
+ }
+
+ /* Figure F.15: generate decoding tables for bit-sequential decoding */
+
+ p = 0;
+ for (l = 1; l <= 16; l++) {
+ if (htbl->bits[l]) {
+ /* valoffset[l] = huffval[] index of 1st symbol of code length l,
+ * minus the minimum code of length l
+ */
+ dtbl->valoffset[l] = (INT32) p - (INT32) huffcode[p];
+ p += htbl->bits[l];
+ dtbl->maxcode[l] = huffcode[p-1]; /* maximum code of length l */
+ } else {
+ dtbl->maxcode[l] = -1; /* -1 if no codes of this length */
+ }
+ }
+ dtbl->maxcode[17] = 0xFFFFFL; /* ensures jpeg_huff_decode terminates */
+
+ /* Compute lookahead tables to speed up decoding.
+ * First we set all the table entries to 0, indicating "too long";
+ * then we iterate through the Huffman codes that are short enough and
+ * fill in all the entries that correspond to bit sequences starting
+ * with that code.
+ */
+
+ MEMZERO(dtbl->look_nbits, SIZEOF(dtbl->look_nbits));
+
+ p = 0;
+ for (l = 1; l <= HUFF_LOOKAHEAD; l++) {
+ for (i = 1; i <= (int) htbl->bits[l]; i++, p++) {
+ /* l = current code's length, p = its index in huffcode[] & huffval[]. */
+ /* Generate left-justified code followed by all possible bit sequences */
+ lookbits = huffcode[p] << (HUFF_LOOKAHEAD-l);
+ for (ctr = 1 << (HUFF_LOOKAHEAD-l); ctr > 0; ctr--) {
+ dtbl->look_nbits[lookbits] = l;
+ dtbl->look_sym[lookbits] = htbl->huffval[p];
+ lookbits++;
+ }
+ }
+ }
+
+ /* Validate symbols as being reasonable.
+ * For AC tables, we make no check, but accept all byte values 0..255.
+ * For DC tables, we require the symbols to be in range 0..15.
+ * (Tighter bounds could be applied depending on the data depth and mode,
+ * but this is sufficient to ensure safe decoding.)
+ */
+ if (isDC) {
+ for (i = 0; i < numsymbols; i++) {
+ int sym = htbl->huffval[i];
+ if (sym < 0 || sym > 15)
+ ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
+ }
+ }
+}
+
+
+/*
+ * Out-of-line code for bit fetching (shared with jdphuff.c).
+ * See jdhuff.h for info about usage.
+ * Note: current values of get_buffer and bits_left are passed as parameters,
+ * but are returned in the corresponding fields of the state struct.
+ *
+ * On most machines MIN_GET_BITS should be 25 to allow the full 32-bit width
+ * of get_buffer to be used. (On machines with wider words, an even larger
+ * buffer could be used.) However, on some machines 32-bit shifts are
+ * quite slow and take time proportional to the number of places shifted.
+ * (This is true with most PC compilers, for instance.) In this case it may
+ * be a win to set MIN_GET_BITS to the minimum value of 15. This reduces the
+ * average shift distance at the cost of more calls to jpeg_fill_bit_buffer.
+ */
+
+#ifdef SLOW_SHIFT_32
+#define MIN_GET_BITS 15 /* minimum allowable value */
+#else
+#define MIN_GET_BITS (BIT_BUF_SIZE-7)
+#endif
+
+
+GLOBAL(boolean)
+jpeg_fill_bit_buffer (bitread_working_state * state,
+ register bit_buf_type get_buffer, register int bits_left,
+ int nbits)
+/* Load up the bit buffer to a depth of at least nbits */
+{
+ /* Copy heavily used state fields into locals (hopefully registers) */
+ register const JOCTET * next_input_byte = state->next_input_byte;
+ register size_t bytes_in_buffer = state->bytes_in_buffer;
+ j_decompress_ptr cinfo = state->cinfo;
+
+ /* Attempt to load at least MIN_GET_BITS bits into get_buffer. */
+ /* (It is assumed that no request will be for more than that many bits.) */
+ /* We fail to do so only if we hit a marker or are forced to suspend. */
+
+ if (cinfo->unread_marker == 0) { /* cannot advance past a marker */
+ while (bits_left < MIN_GET_BITS) {
+ register int c;
+
+ /* Attempt to read a byte */
+ if (bytes_in_buffer == 0) {
+ if (! (*cinfo->src->fill_input_buffer) (cinfo))
+ return FALSE;
+ next_input_byte = cinfo->src->next_input_byte;
+ bytes_in_buffer = cinfo->src->bytes_in_buffer;
+ }
+ bytes_in_buffer--;
+ c = GETJOCTET(*next_input_byte++);
+
+ /* If it's 0xFF, check and discard stuffed zero byte */
+ if (c == 0xFF) {
+ /* Loop here to discard any padding FF's on terminating marker,
+ * so that we can save a valid unread_marker value. NOTE: we will
+ * accept multiple FF's followed by a 0 as meaning a single FF data
+ * byte. This data pattern is not valid according to the standard.
+ */
+ do {
+ if (bytes_in_buffer == 0) {
+ if (! (*cinfo->src->fill_input_buffer) (cinfo))
+ return FALSE;
+ next_input_byte = cinfo->src->next_input_byte;
+ bytes_in_buffer = cinfo->src->bytes_in_buffer;
+ }
+ bytes_in_buffer--;
+ c = GETJOCTET(*next_input_byte++);
+ } while (c == 0xFF);
+
+ if (c == 0) {
+ /* Found FF/00, which represents an FF data byte */
+ c = 0xFF;
+ } else {
+ /* Oops, it's actually a marker indicating end of compressed data.
+ * Save the marker code for later use.
+ * Fine point: it might appear that we should save the marker into
+ * bitread working state, not straight into permanent state. But
+ * once we have hit a marker, we cannot need to suspend within the
+ * current MCU, because we will read no more bytes from the data
+ * source. So it is OK to update permanent state right away.
+ */
+ cinfo->unread_marker = c;
+ /* See if we need to insert some fake zero bits. */
+ goto no_more_bytes;
+ }
+ }
+
+ /* OK, load c into get_buffer */
+ get_buffer = (get_buffer << 8) | c;
+ bits_left += 8;
+ } /* end while */
+ } else {
+ no_more_bytes:
+ /* We get here if we've read the marker that terminates the compressed
+ * data segment. There should be enough bits in the buffer register
+ * to satisfy the request; if so, no problem.
+ */
+ if (nbits > bits_left) {
+ /* Uh-oh. Report corrupted data to user and stuff zeroes into
+ * the data stream, so that we can produce some kind of image.
+ * We use a nonvolatile flag to ensure that only one warning message
+ * appears per data segment.
+ */
+ if (! cinfo->entropy->insufficient_data) {
+ WARNMS(cinfo, JWRN_HIT_MARKER);
+ cinfo->entropy->insufficient_data = TRUE;
+ }
+ /* Fill the buffer with zero bits */
+ get_buffer <<= MIN_GET_BITS - bits_left;
+ bits_left = MIN_GET_BITS;
+ }
+ }
+
+ /* Unload the local registers */
+ state->next_input_byte = next_input_byte;
+ state->bytes_in_buffer = bytes_in_buffer;
+ state->get_buffer = get_buffer;
+ state->bits_left = bits_left;
+
+ return TRUE;
+}
+
+
+/*
+ * Out-of-line code for Huffman code decoding.
+ * See jdhuff.h for info about usage.
+ */
+
+GLOBAL(int)
+jpeg_huff_decode (bitread_working_state * state,
+ register bit_buf_type get_buffer, register int bits_left,
+ d_derived_tbl * htbl, int min_bits)
+{
+ register int l = min_bits;
+ register INT32 code;
+
+ /* HUFF_DECODE has determined that the code is at least min_bits */
+ /* bits long, so fetch that many bits in one swoop. */
+
+ CHECK_BIT_BUFFER(*state, l, return -1);
+ code = GET_BITS(l);
+
+ /* Collect the rest of the Huffman code one bit at a time. */
+ /* This is per Figure F.16 in the JPEG spec. */
+
+ while (code > htbl->maxcode[l]) {
+ code <<= 1;
+ CHECK_BIT_BUFFER(*state, 1, return -1);
+ code |= GET_BITS(1);
+ l++;
+ }
+
+ /* Unload the local registers */
+ state->get_buffer = get_buffer;
+ state->bits_left = bits_left;
+
+ /* With garbage input we may reach the sentinel value l = 17. */
+
+ if (l > 16) {
+ WARNMS(state->cinfo, JWRN_HUFF_BAD_CODE);
+ return 0; /* fake a zero as the safest result */
+ }
+
+ return htbl->pub->huffval[ (int) (code + htbl->valoffset[l]) ];
+}
+
+
+/*
+ * Figure F.12: extend sign bit.
+ * On some machines, a shift and add will be faster than a table lookup.
+ */
+
+#ifdef AVOID_TABLES
+
+#define HUFF_EXTEND(x,s) ((x) < (1<<((s)-1)) ? (x) + (((-1)<<(s)) + 1) : (x))
+
+#else
+
+#define HUFF_EXTEND(x,s) ((x) < extend_test[s] ? (x) + extend_offset[s] : (x))
+
+static const int extend_test[16] = /* entry n is 2**(n-1) */
+ { 0, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080,
+ 0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000 };
+
+static const int extend_offset[16] = /* entry n is (-1 << n) + 1 */
+ { 0, ((-1)<<1) + 1, ((-1)<<2) + 1, ((-1)<<3) + 1, ((-1)<<4) + 1,
+ ((-1)<<5) + 1, ((-1)<<6) + 1, ((-1)<<7) + 1, ((-1)<<8) + 1,
+ ((-1)<<9) + 1, ((-1)<<10) + 1, ((-1)<<11) + 1, ((-1)<<12) + 1,
+ ((-1)<<13) + 1, ((-1)<<14) + 1, ((-1)<<15) + 1 };
+
+#endif /* AVOID_TABLES */
+
+
+/*
+ * Check for a restart marker & resynchronize decoder.
+ * Returns FALSE if must suspend.
+ */
+
+LOCAL(boolean)
+process_restart (j_decompress_ptr cinfo)
+{
+ huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
+ int ci;
+
+ /* Throw away any unused bits remaining in bit buffer; */
+ /* include any full bytes in next_marker's count of discarded bytes */
+ cinfo->marker->discarded_bytes += entropy->bitstate.bits_left / 8;
+ entropy->bitstate.bits_left = 0;
+
+ /* Advance past the RSTn marker */
+ if (! (*cinfo->marker->read_restart_marker) (cinfo))
+ return FALSE;
+
+ /* Re-initialize DC predictions to 0 */
+ for (ci = 0; ci < cinfo->comps_in_scan; ci++)
+ entropy->saved.last_dc_val[ci] = 0;
+
+ /* Reset restart counter */
+ entropy->restarts_to_go = cinfo->restart_interval;
+
+ /* Reset out-of-data flag, unless read_restart_marker left us smack up
+ * against a marker. In that case we will end up treating the next data
+ * segment as empty, and we can avoid producing bogus output pixels by
+ * leaving the flag set.
+ */
+ if (cinfo->unread_marker == 0)
+ entropy->pub.insufficient_data = FALSE;
+
+ return TRUE;
+}
+
+
+/*
+ * Decode and return one MCU's worth of Huffman-compressed coefficients.
+ * The coefficients are reordered from zigzag order into natural array order,
+ * but are not dequantized.
+ *
+ * The i'th block of the MCU is stored into the block pointed to by
+ * MCU_data[i]. WE ASSUME THIS AREA HAS BEEN ZEROED BY THE CALLER.
+ * (Wholesale zeroing is usually a little faster than retail...)
+ *
+ * Returns FALSE if data source requested suspension. In that case no
+ * changes have been made to permanent state. (Exception: some output
+ * coefficients may already have been assigned. This is harmless for
+ * this module, since we'll just re-assign them on the next call.)
+ */
+
+METHODDEF(boolean)
+decode_mcu (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
+{
+ huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
+ int blkn;
+ BITREAD_STATE_VARS;
+ savable_state state;
+
+ /* Process restart marker if needed; may have to suspend */
+ if (cinfo->restart_interval) {
+ if (entropy->restarts_to_go == 0)
+ if (! process_restart(cinfo))
+ return FALSE;
+ }
+
+ /* If we've run out of data, just leave the MCU set to zeroes.
+ * This way, we return uniform gray for the remainder of the segment.
+ */
+ if (! entropy->pub.insufficient_data) {
+
+ /* Load up working state */
+ BITREAD_LOAD_STATE(cinfo,entropy->bitstate);
+ ASSIGN_STATE(state, entropy->saved);
+
+ /* Outer loop handles each block in the MCU */
+
+ for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
+ JBLOCKROW block = MCU_data[blkn];
+ d_derived_tbl * dctbl = entropy->dc_cur_tbls[blkn];
+ d_derived_tbl * actbl = entropy->ac_cur_tbls[blkn];
+ register int s, k, r;
+
+ /* Decode a single block's worth of coefficients */
+
+ /* Section F.2.2.1: decode the DC coefficient difference */
+ HUFF_DECODE(s, br_state, dctbl, return FALSE, label1);
+ if (s) {
+ CHECK_BIT_BUFFER(br_state, s, return FALSE);
+ r = GET_BITS(s);
+ s = HUFF_EXTEND(r, s);
+ }
+
+ if (entropy->dc_needed[blkn]) {
+ /* Convert DC difference to actual value, update last_dc_val */
+ int ci = cinfo->MCU_membership[blkn];
+ s += state.last_dc_val[ci];
+ state.last_dc_val[ci] = s;
+ /* Output the DC coefficient (assumes jpeg_natural_order[0] = 0) */
+ (*block)[0] = (JCOEF) s;
+ }
+
+ if (entropy->ac_needed[blkn]) {
+
+ /* Section F.2.2.2: decode the AC coefficients */
+ /* Since zeroes are skipped, output area must be cleared beforehand */
+ for (k = 1; k < DCTSIZE2; k++) {
+ HUFF_DECODE(s, br_state, actbl, return FALSE, label2);
+
+ r = s >> 4;
+ s &= 15;
+
+ if (s) {
+ k += r;
+ CHECK_BIT_BUFFER(br_state, s, return FALSE);
+ r = GET_BITS(s);
+ s = HUFF_EXTEND(r, s);
+ /* Output coefficient in natural (dezigzagged) order.
+ * Note: the extra entries in jpeg_natural_order[] will save us
+ * if k >= DCTSIZE2, which could happen if the data is corrupted.
+ */
+ (*block)[jpeg_natural_order[k]] = (JCOEF) s;
+ } else {
+ if (r != 15)
+ break;
+ k += 15;
+ }
+ }
+
+ } else {
+
+ /* Section F.2.2.2: decode the AC coefficients */
+ /* In this path we just discard the values */
+ for (k = 1; k < DCTSIZE2; k++) {
+ HUFF_DECODE(s, br_state, actbl, return FALSE, label3);
+
+ r = s >> 4;
+ s &= 15;
+
+ if (s) {
+ k += r;
+ CHECK_BIT_BUFFER(br_state, s, return FALSE);
+ DROP_BITS(s);
+ } else {
+ if (r != 15)
+ break;
+ k += 15;
+ }
+ }
+
+ }
+ }
+
+ /* Completed MCU, so update state */
+ BITREAD_SAVE_STATE(cinfo,entropy->bitstate);
+ ASSIGN_STATE(entropy->saved, state);
+ }
+
+ /* Account for restart interval (no-op if not using restarts) */
+ entropy->restarts_to_go--;
+
+ return TRUE;
+}
+
+
+/*
+ * Module initialization routine for Huffman entropy decoding.
+ */
+
+GLOBAL(void)
+jinit_huff_decoder (j_decompress_ptr cinfo)
+{
+ huff_entropy_ptr entropy;
+ int i;
+
+ entropy = (huff_entropy_ptr)
+ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ SIZEOF(huff_entropy_decoder));
+ cinfo->entropy = (struct jpeg_entropy_decoder *) entropy;
+ entropy->pub.start_pass = start_pass_huff_decoder;
+ entropy->pub.decode_mcu = decode_mcu;
+
+ /* Mark tables unallocated */
+ for (i = 0; i < NUM_HUFF_TBLS; i++) {
+ entropy->dc_derived_tbls[i] = entropy->ac_derived_tbls[i] = NULL;
+ }
+}
+
+#endif //_FX_JPEG_TURBO_
diff --git a/core/src/fxcodec/libjpeg/fpdfapi_jdinput.c b/core/src/fxcodec/libjpeg/fpdfapi_jdinput.c
index 46a7efce2e..6e714e928e 100644
--- a/core/src/fxcodec/libjpeg/fpdfapi_jdinput.c
+++ b/core/src/fxcodec/libjpeg/fpdfapi_jdinput.c
@@ -1,384 +1,384 @@
-#if !defined(_FX_JPEG_TURBO_)
-/*
- * jdinput.c
- *
- * Copyright (C) 1991-1997, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- * For conditions of distribution and use, see the accompanying README file.
- *
- * This file contains input control logic for the JPEG decompressor.
- * These routines are concerned with controlling the decompressor's input
- * processing (marker reading and coefficient decoding). The actual input
- * reading is done in jdmarker.c, jdhuff.c, and jdphuff.c.
- */
-
-#define JPEG_INTERNALS
-#include "jinclude.h"
-#include "jpeglib.h"
-
-
-/* Private state */
-
-typedef struct {
- struct jpeg_input_controller pub; /* public fields */
-
- boolean inheaders; /* TRUE until first SOS is reached */
-} my_input_controller;
-
-typedef my_input_controller * my_inputctl_ptr;
-
-
-/* Forward declarations */
-METHODDEF(int) consume_markers JPP((j_decompress_ptr cinfo));
-
-
-/*
- * Routines to calculate various quantities related to the size of the image.
- */
-
-LOCAL(void)
-initial_setup (j_decompress_ptr cinfo)
-/* Called once, when first SOS marker is reached */
-{
- int ci;
- jpeg_component_info *compptr;
-
- /* Make sure image isn't bigger than I can handle */
- if ((long) cinfo->image_height > (long) JPEG_MAX_DIMENSION ||
- (long) cinfo->image_width > (long) JPEG_MAX_DIMENSION)
- ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) JPEG_MAX_DIMENSION);
-
- /* For now, precision must match compiled-in value... */
- if (cinfo->data_precision != BITS_IN_JSAMPLE)
- ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision);
-
- /* Check that number of components won't exceed internal array sizes */
- if (cinfo->num_components > MAX_COMPONENTS)
- ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components,
- MAX_COMPONENTS);
-
- /* Compute maximum sampling factors; check factor validity */
- cinfo->max_h_samp_factor = 1;
- cinfo->max_v_samp_factor = 1;
- for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
- ci++, compptr++) {
- if (compptr->h_samp_factor<=0 || compptr->h_samp_factor>MAX_SAMP_FACTOR ||
- compptr->v_samp_factor<=0 || compptr->v_samp_factor>MAX_SAMP_FACTOR)
- ERREXIT(cinfo, JERR_BAD_SAMPLING);
- cinfo->max_h_samp_factor = MAX(cinfo->max_h_samp_factor,
- compptr->h_samp_factor);
- cinfo->max_v_samp_factor = MAX(cinfo->max_v_samp_factor,
- compptr->v_samp_factor);
- }
-
- /* We initialize DCT_scaled_size and min_DCT_scaled_size to DCTSIZE.
- * In the full decompressor, this will be overridden by jdmaster.c;
- * but in the transcoder, jdmaster.c is not used, so we must do it here.
- */
- cinfo->min_DCT_scaled_size = DCTSIZE;
-
- /* Compute dimensions of components */
- for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
- ci++, compptr++) {
- compptr->DCT_scaled_size = DCTSIZE;
- /* Size in DCT blocks */
- compptr->width_in_blocks = (JDIMENSION)
- jdiv_round_up((long) cinfo->image_width * (long) compptr->h_samp_factor,
- (long) (cinfo->max_h_samp_factor * DCTSIZE));
- compptr->height_in_blocks = (JDIMENSION)
- jdiv_round_up((long) cinfo->image_height * (long) compptr->v_samp_factor,
- (long) (cinfo->max_v_samp_factor * DCTSIZE));
- /* downsampled_width and downsampled_height will also be overridden by
- * jdmaster.c if we are doing full decompression. The transcoder library
- * doesn't use these values, but the calling application might.
- */
- /* Size in samples */
- compptr->downsampled_width = (JDIMENSION)
- jdiv_round_up((long) cinfo->image_width * (long) compptr->h_samp_factor,
- (long) cinfo->max_h_samp_factor);
- compptr->downsampled_height = (JDIMENSION)
- jdiv_round_up((long) cinfo->image_height * (long) compptr->v_samp_factor,
- (long) cinfo->max_v_samp_factor);
- /* Mark component needed, until color conversion says otherwise */
- compptr->component_needed = TRUE;
- /* Mark no quantization table yet saved for component */
- compptr->quant_table = NULL;
- }
-
- /* Compute number of fully interleaved MCU rows. */
- cinfo->total_iMCU_rows = (JDIMENSION)
- jdiv_round_up((long) cinfo->image_height,
- (long) (cinfo->max_v_samp_factor*DCTSIZE));
-
- /* Decide whether file contains multiple scans */
- if (cinfo->comps_in_scan < cinfo->num_components || cinfo->progressive_mode)
- cinfo->inputctl->has_multiple_scans = TRUE;
- else
- cinfo->inputctl->has_multiple_scans = FALSE;
-}
-
-
-LOCAL(void)
-per_scan_setup (j_decompress_ptr cinfo)
-/* Do computations that are needed before processing a JPEG scan */
-/* cinfo->comps_in_scan and cinfo->cur_comp_info[] were set from SOS marker */
-{
- int ci, mcublks, tmp;
- jpeg_component_info *compptr;
-
- if (cinfo->comps_in_scan == 1) {
-
- /* Noninterleaved (single-component) scan */
- compptr = cinfo->cur_comp_info[0];
-
- /* Overall image size in MCUs */
- cinfo->MCUs_per_row = compptr->width_in_blocks;
- cinfo->MCU_rows_in_scan = compptr->height_in_blocks;
-
- /* For noninterleaved scan, always one block per MCU */
- compptr->MCU_width = 1;
- compptr->MCU_height = 1;
- compptr->MCU_blocks = 1;
- compptr->MCU_sample_width = compptr->DCT_scaled_size;
- compptr->last_col_width = 1;
- /* For noninterleaved scans, it is convenient to define last_row_height
- * as the number of block rows present in the last iMCU row.
- */
- tmp = (int) (compptr->height_in_blocks % compptr->v_samp_factor);
- if (tmp == 0) tmp = compptr->v_samp_factor;
- compptr->last_row_height = tmp;
-
- /* Prepare array describing MCU composition */
- cinfo->blocks_in_MCU = 1;
- cinfo->MCU_membership[0] = 0;
-
- } else {
-
- /* Interleaved (multi-component) scan */
- if (cinfo->comps_in_scan <= 0 || cinfo->comps_in_scan > MAX_COMPS_IN_SCAN)
- ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->comps_in_scan,
- MAX_COMPS_IN_SCAN);
-
- /* Overall image size in MCUs */
- cinfo->MCUs_per_row = (JDIMENSION)
- jdiv_round_up((long) cinfo->image_width,
- (long) (cinfo->max_h_samp_factor*DCTSIZE));
- cinfo->MCU_rows_in_scan = (JDIMENSION)
- jdiv_round_up((long) cinfo->image_height,
- (long) (cinfo->max_v_samp_factor*DCTSIZE));
-
- cinfo->blocks_in_MCU = 0;
-
- for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
- compptr = cinfo->cur_comp_info[ci];
- /* Sampling factors give # of blocks of component in each MCU */
- compptr->MCU_width = compptr->h_samp_factor;
- compptr->MCU_height = compptr->v_samp_factor;
- compptr->MCU_blocks = compptr->MCU_width * compptr->MCU_height;
- compptr->MCU_sample_width = compptr->MCU_width * compptr->DCT_scaled_size;
- /* Figure number of non-dummy blocks in last MCU column & row */
- tmp = (int) (compptr->width_in_blocks % compptr->MCU_width);
- if (tmp == 0) tmp = compptr->MCU_width;
- compptr->last_col_width = tmp;
- tmp = (int) (compptr->height_in_blocks % compptr->MCU_height);
- if (tmp == 0) tmp = compptr->MCU_height;
- compptr->last_row_height = tmp;
- /* Prepare array describing MCU composition */
- mcublks = compptr->MCU_blocks;
- if (cinfo->blocks_in_MCU + mcublks > D_MAX_BLOCKS_IN_MCU)
- ERREXIT(cinfo, JERR_BAD_MCU_SIZE);
- while (mcublks-- > 0) {
- cinfo->MCU_membership[cinfo->blocks_in_MCU++] = ci;
- }
- }
-
- }
-}
-
-
-/*
- * Save away a copy of the Q-table referenced by each component present
- * in the current scan, unless already saved during a prior scan.
- *
- * In a multiple-scan JPEG file, the encoder could assign different components
- * the same Q-table slot number, but change table definitions between scans
- * so that each component uses a different Q-table. (The IJG encoder is not
- * currently capable of doing this, but other encoders might.) Since we want
- * to be able to dequantize all the components at the end of the file, this
- * means that we have to save away the table actually used for each component.
- * We do this by copying the table at the start of the first scan containing
- * the component.
- * The JPEG spec prohibits the encoder from changing the contents of a Q-table
- * slot between scans of a component using that slot. If the encoder does so
- * anyway, this decoder will simply use the Q-table values that were current
- * at the start of the first scan for the component.
- *
- * The decompressor output side looks only at the saved quant tables,
- * not at the current Q-table slots.
- */
-
-LOCAL(void)
-latch_quant_tables (j_decompress_ptr cinfo)
-{
- int ci, qtblno;
- jpeg_component_info *compptr;
- JQUANT_TBL * qtbl;
-
- for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
- compptr = cinfo->cur_comp_info[ci];
- /* No work if we already saved Q-table for this component */
- if (compptr->quant_table != NULL)
- continue;
- /* Make sure specified quantization table is present */
- qtblno = compptr->quant_tbl_no;
- if (qtblno < 0 || qtblno >= NUM_QUANT_TBLS ||
- cinfo->quant_tbl_ptrs[qtblno] == NULL)
- ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, qtblno);
- /* OK, save away the quantization table */
- qtbl = (JQUANT_TBL *)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- SIZEOF(JQUANT_TBL));
- MEMCOPY(qtbl, cinfo->quant_tbl_ptrs[qtblno], SIZEOF(JQUANT_TBL));
- compptr->quant_table = qtbl;
- }
-}
-
-
-/*
- * Initialize the input modules to read a scan of compressed data.
- * The first call to this is done by jdmaster.c after initializing
- * the entire decompressor (during jpeg_start_decompress).
- * Subsequent calls come from consume_markers, below.
- */
-
-METHODDEF(void)
-start_input_pass (j_decompress_ptr cinfo)
-{
- per_scan_setup(cinfo);
- latch_quant_tables(cinfo);
- (*cinfo->entropy->start_pass) (cinfo);
- (*cinfo->coef->start_input_pass) (cinfo);
- cinfo->inputctl->consume_input = cinfo->coef->consume_data;
-}
-
-
-/*
- * Finish up after inputting a compressed-data scan.
- * This is called by the coefficient controller after it's read all
- * the expected data of the scan.
- */
-
-METHODDEF(void)
-finish_input_pass (j_decompress_ptr cinfo)
-{
- cinfo->inputctl->consume_input = consume_markers;
-}
-
-
-/*
- * Read JPEG markers before, between, or after compressed-data scans.
- * Change state as necessary when a new scan is reached.
- * Return value is JPEG_SUSPENDED, JPEG_REACHED_SOS, or JPEG_REACHED_EOI.
- *
- * The consume_input method pointer points either here or to the
- * coefficient controller's consume_data routine, depending on whether
- * we are reading a compressed data segment or inter-segment markers.
- */
-
-METHODDEF(int)
-consume_markers (j_decompress_ptr cinfo)
-{
- my_inputctl_ptr inputctl = (my_inputctl_ptr) cinfo->inputctl;
- int val;
-
- if (inputctl->pub.eoi_reached) /* After hitting EOI, read no further */
- return JPEG_REACHED_EOI;
-
- val = (*cinfo->marker->read_markers) (cinfo);
-
- switch (val) {
- case JPEG_REACHED_SOS: /* Found SOS */
- if (inputctl->inheaders) { /* 1st SOS */
- initial_setup(cinfo);
- inputctl->inheaders = FALSE;
- /* Note: start_input_pass must be called by jdmaster.c
- * before any more input can be consumed. jdapimin.c is
- * responsible for enforcing this sequencing.
- */
- } else { /* 2nd or later SOS marker */
- if (! inputctl->pub.has_multiple_scans)
- ERREXIT(cinfo, JERR_EOI_EXPECTED); /* Oops, I wasn't expecting this! */
- start_input_pass(cinfo);
- }
- break;
- case JPEG_REACHED_EOI: /* Found EOI */
- inputctl->pub.eoi_reached = TRUE;
- if (inputctl->inheaders) { /* Tables-only datastream, apparently */
- if (cinfo->marker->saw_SOF)
- ERREXIT(cinfo, JERR_SOF_NO_SOS);
- } else {
- /* Prevent infinite loop in coef ctlr's decompress_data routine
- * if user set output_scan_number larger than number of scans.
- */
- if (cinfo->output_scan_number > cinfo->input_scan_number)
- cinfo->output_scan_number = cinfo->input_scan_number;
- }
- break;
- case JPEG_SUSPENDED:
- break;
- }
-
- return val;
-}
-
-
-/*
- * Reset state to begin a fresh datastream.
- */
-
-METHODDEF(void)
-reset_input_controller (j_decompress_ptr cinfo)
-{
- my_inputctl_ptr inputctl = (my_inputctl_ptr) cinfo->inputctl;
-
- inputctl->pub.consume_input = consume_markers;
- inputctl->pub.has_multiple_scans = FALSE; /* "unknown" would be better */
- inputctl->pub.eoi_reached = FALSE;
- inputctl->inheaders = TRUE;
- /* Reset other modules */
- (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo);
- (*cinfo->marker->reset_marker_reader) (cinfo);
- /* Reset progression state -- would be cleaner if entropy decoder did this */
- cinfo->coef_bits = NULL;
-}
-
-
-/*
- * Initialize the input controller module.
- * This is called only once, when the decompression object is created.
- */
-
-GLOBAL(void)
-jinit_input_controller (j_decompress_ptr cinfo)
-{
- my_inputctl_ptr inputctl;
-
- /* Create subobject in permanent pool */
- inputctl = (my_inputctl_ptr)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
- SIZEOF(my_input_controller));
- cinfo->inputctl = (struct jpeg_input_controller *) inputctl;
- /* Initialize method pointers */
- inputctl->pub.consume_input = consume_markers;
- inputctl->pub.reset_input_controller = reset_input_controller;
- inputctl->pub.start_input_pass = start_input_pass;
- inputctl->pub.finish_input_pass = finish_input_pass;
- /* Initialize state: can't use reset_input_controller since we don't
- * want to try to reset other modules yet.
- */
- inputctl->pub.has_multiple_scans = FALSE; /* "unknown" would be better */
- inputctl->pub.eoi_reached = FALSE;
- inputctl->inheaders = TRUE;
-}
-
-#endif //_FX_JPEG_TURBO_
+#if !defined(_FX_JPEG_TURBO_)
+/*
+ * jdinput.c
+ *
+ * Copyright (C) 1991-1997, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains input control logic for the JPEG decompressor.
+ * These routines are concerned with controlling the decompressor's input
+ * processing (marker reading and coefficient decoding). The actual input
+ * reading is done in jdmarker.c, jdhuff.c, and jdphuff.c.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+
+
+/* Private state */
+
+typedef struct {
+ struct jpeg_input_controller pub; /* public fields */
+
+ boolean inheaders; /* TRUE until first SOS is reached */
+} my_input_controller;
+
+typedef my_input_controller * my_inputctl_ptr;
+
+
+/* Forward declarations */
+METHODDEF(int) consume_markers JPP((j_decompress_ptr cinfo));
+
+
+/*
+ * Routines to calculate various quantities related to the size of the image.
+ */
+
+LOCAL(void)
+initial_setup (j_decompress_ptr cinfo)
+/* Called once, when first SOS marker is reached */
+{
+ int ci;
+ jpeg_component_info *compptr;
+
+ /* Make sure image isn't bigger than I can handle */
+ if ((long) cinfo->image_height > (long) JPEG_MAX_DIMENSION ||
+ (long) cinfo->image_width > (long) JPEG_MAX_DIMENSION)
+ ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) JPEG_MAX_DIMENSION);
+
+ /* For now, precision must match compiled-in value... */
+ if (cinfo->data_precision != BITS_IN_JSAMPLE)
+ ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision);
+
+ /* Check that number of components won't exceed internal array sizes */
+ if (cinfo->num_components > MAX_COMPONENTS)
+ ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components,
+ MAX_COMPONENTS);
+
+ /* Compute maximum sampling factors; check factor validity */
+ cinfo->max_h_samp_factor = 1;
+ cinfo->max_v_samp_factor = 1;
+ for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+ ci++, compptr++) {
+ if (compptr->h_samp_factor<=0 || compptr->h_samp_factor>MAX_SAMP_FACTOR ||
+ compptr->v_samp_factor<=0 || compptr->v_samp_factor>MAX_SAMP_FACTOR)
+ ERREXIT(cinfo, JERR_BAD_SAMPLING);
+ cinfo->max_h_samp_factor = MAX(cinfo->max_h_samp_factor,
+ compptr->h_samp_factor);
+ cinfo->max_v_samp_factor = MAX(cinfo->max_v_samp_factor,
+ compptr->v_samp_factor);
+ }
+
+ /* We initialize DCT_scaled_size and min_DCT_scaled_size to DCTSIZE.
+ * In the full decompressor, this will be overridden by jdmaster.c;
+ * but in the transcoder, jdmaster.c is not used, so we must do it here.
+ */
+ cinfo->min_DCT_scaled_size = DCTSIZE;
+
+ /* Compute dimensions of components */
+ for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+ ci++, compptr++) {
+ compptr->DCT_scaled_size = DCTSIZE;
+ /* Size in DCT blocks */
+ compptr->width_in_blocks = (JDIMENSION)
+ jdiv_round_up((long) cinfo->image_width * (long) compptr->h_samp_factor,
+ (long) (cinfo->max_h_samp_factor * DCTSIZE));
+ compptr->height_in_blocks = (JDIMENSION)
+ jdiv_round_up((long) cinfo->image_height * (long) compptr->v_samp_factor,
+ (long) (cinfo->max_v_samp_factor * DCTSIZE));
+ /* downsampled_width and downsampled_height will also be overridden by
+ * jdmaster.c if we are doing full decompression. The transcoder library
+ * doesn't use these values, but the calling application might.
+ */
+ /* Size in samples */
+ compptr->downsampled_width = (JDIMENSION)
+ jdiv_round_up((long) cinfo->image_width * (long) compptr->h_samp_factor,
+ (long) cinfo->max_h_samp_factor);
+ compptr->downsampled_height = (JDIMENSION)
+ jdiv_round_up((long) cinfo->image_height * (long) compptr->v_samp_factor,
+ (long) cinfo->max_v_samp_factor);
+ /* Mark component needed, until color conversion says otherwise */
+ compptr->component_needed = TRUE;
+ /* Mark no quantization table yet saved for component */
+ compptr->quant_table = NULL;
+ }
+
+ /* Compute number of fully interleaved MCU rows. */
+ cinfo->total_iMCU_rows = (JDIMENSION)
+ jdiv_round_up((long) cinfo->image_height,
+ (long) (cinfo->max_v_samp_factor*DCTSIZE));
+
+ /* Decide whether file contains multiple scans */
+ if (cinfo->comps_in_scan < cinfo->num_components || cinfo->progressive_mode)
+ cinfo->inputctl->has_multiple_scans = TRUE;
+ else
+ cinfo->inputctl->has_multiple_scans = FALSE;
+}
+
+
+LOCAL(void)
+per_scan_setup (j_decompress_ptr cinfo)
+/* Do computations that are needed before processing a JPEG scan */
+/* cinfo->comps_in_scan and cinfo->cur_comp_info[] were set from SOS marker */
+{
+ int ci, mcublks, tmp;
+ jpeg_component_info *compptr;
+
+ if (cinfo->comps_in_scan == 1) {
+
+ /* Noninterleaved (single-component) scan */
+ compptr = cinfo->cur_comp_info[0];
+
+ /* Overall image size in MCUs */
+ cinfo->MCUs_per_row = compptr->width_in_blocks;
+ cinfo->MCU_rows_in_scan = compptr->height_in_blocks;
+
+ /* For noninterleaved scan, always one block per MCU */
+ compptr->MCU_width = 1;
+ compptr->MCU_height = 1;
+ compptr->MCU_blocks = 1;
+ compptr->MCU_sample_width = compptr->DCT_scaled_size;
+ compptr->last_col_width = 1;
+ /* For noninterleaved scans, it is convenient to define last_row_height
+ * as the number of block rows present in the last iMCU row.
+ */
+ tmp = (int) (compptr->height_in_blocks % compptr->v_samp_factor);
+ if (tmp == 0) tmp = compptr->v_samp_factor;
+ compptr->last_row_height = tmp;
+
+ /* Prepare array describing MCU composition */
+ cinfo->blocks_in_MCU = 1;
+ cinfo->MCU_membership[0] = 0;
+
+ } else {
+
+ /* Interleaved (multi-component) scan */
+ if (cinfo->comps_in_scan <= 0 || cinfo->comps_in_scan > MAX_COMPS_IN_SCAN)
+ ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->comps_in_scan,
+ MAX_COMPS_IN_SCAN);
+
+ /* Overall image size in MCUs */
+ cinfo->MCUs_per_row = (JDIMENSION)
+ jdiv_round_up((long) cinfo->image_width,
+ (long) (cinfo->max_h_samp_factor*DCTSIZE));
+ cinfo->MCU_rows_in_scan = (JDIMENSION)
+ jdiv_round_up((long) cinfo->image_height,
+ (long) (cinfo->max_v_samp_factor*DCTSIZE));
+
+ cinfo->blocks_in_MCU = 0;
+
+ for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
+ compptr = cinfo->cur_comp_info[ci];
+ /* Sampling factors give # of blocks of component in each MCU */
+ compptr->MCU_width = compptr->h_samp_factor;
+ compptr->MCU_height = compptr->v_samp_factor;
+ compptr->MCU_blocks = compptr->MCU_width * compptr->MCU_height;
+ compptr->MCU_sample_width = compptr->MCU_width * compptr->DCT_scaled_size;
+ /* Figure number of non-dummy blocks in last MCU column & row */
+ tmp = (int) (compptr->width_in_blocks % compptr->MCU_width);
+ if (tmp == 0) tmp = compptr->MCU_width;
+ compptr->last_col_width = tmp;
+ tmp = (int) (compptr->height_in_blocks % compptr->MCU_height);
+ if (tmp == 0) tmp = compptr->MCU_height;
+ compptr->last_row_height = tmp;
+ /* Prepare array describing MCU composition */
+ mcublks = compptr->MCU_blocks;
+ if (cinfo->blocks_in_MCU + mcublks > D_MAX_BLOCKS_IN_MCU)
+ ERREXIT(cinfo, JERR_BAD_MCU_SIZE);
+ while (mcublks-- > 0) {
+ cinfo->MCU_membership[cinfo->blocks_in_MCU++] = ci;
+ }
+ }
+
+ }
+}
+
+
+/*
+ * Save away a copy of the Q-table referenced by each component present
+ * in the current scan, unless already saved during a prior scan.
+ *
+ * In a multiple-scan JPEG file, the encoder could assign different components
+ * the same Q-table slot number, but change table definitions between scans
+ * so that each component uses a different Q-table. (The IJG encoder is not
+ * currently capable of doing this, but other encoders might.) Since we want
+ * to be able to dequantize all the components at the end of the file, this
+ * means that we have to save away the table actually used for each component.
+ * We do this by copying the table at the start of the first scan containing
+ * the component.
+ * The JPEG spec prohibits the encoder from changing the contents of a Q-table
+ * slot between scans of a component using that slot. If the encoder does so
+ * anyway, this decoder will simply use the Q-table values that were current
+ * at the start of the first scan for the component.
+ *
+ * The decompressor output side looks only at the saved quant tables,
+ * not at the current Q-table slots.
+ */
+
+LOCAL(void)
+latch_quant_tables (j_decompress_ptr cinfo)
+{
+ int ci, qtblno;
+ jpeg_component_info *compptr;
+ JQUANT_TBL * qtbl;
+
+ for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
+ compptr = cinfo->cur_comp_info[ci];
+ /* No work if we already saved Q-table for this component */
+ if (compptr->quant_table != NULL)
+ continue;
+ /* Make sure specified quantization table is present */
+ qtblno = compptr->quant_tbl_no;
+ if (qtblno < 0 || qtblno >= NUM_QUANT_TBLS ||
+ cinfo->quant_tbl_ptrs[qtblno] == NULL)
+ ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, qtblno);
+ /* OK, save away the quantization table */
+ qtbl = (JQUANT_TBL *)
+ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ SIZEOF(JQUANT_TBL));
+ MEMCOPY(qtbl, cinfo->quant_tbl_ptrs[qtblno], SIZEOF(JQUANT_TBL));
+ compptr->quant_table = qtbl;
+ }
+}
+
+
+/*
+ * Initialize the input modules to read a scan of compressed data.
+ * The first call to this is done by jdmaster.c after initializing
+ * the entire decompressor (during jpeg_start_decompress).
+ * Subsequent calls come from consume_markers, below.
+ */
+
+METHODDEF(void)
+start_input_pass (j_decompress_ptr cinfo)
+{
+ per_scan_setup(cinfo);
+ latch_quant_tables(cinfo);
+ (*cinfo->entropy->start_pass) (cinfo);
+ (*cinfo->coef->start_input_pass) (cinfo);
+ cinfo->inputctl->consume_input = cinfo->coef->consume_data;
+}
+
+
+/*
+ * Finish up after inputting a compressed-data scan.
+ * This is called by the coefficient controller after it's read all
+ * the expected data of the scan.
+ */
+
+METHODDEF(void)
+finish_input_pass (j_decompress_ptr cinfo)
+{
+ cinfo->inputctl->consume_input = consume_markers;
+}
+
+
+/*
+ * Read JPEG markers before, between, or after compressed-data scans.
+ * Change state as necessary when a new scan is reached.
+ * Return value is JPEG_SUSPENDED, JPEG_REACHED_SOS, or JPEG_REACHED_EOI.
+ *
+ * The consume_input method pointer points either here or to the
+ * coefficient controller's consume_data routine, depending on whether
+ * we are reading a compressed data segment or inter-segment markers.
+ */
+
+METHODDEF(int)
+consume_markers (j_decompress_ptr cinfo)
+{
+ my_inputctl_ptr inputctl = (my_inputctl_ptr) cinfo->inputctl;
+ int val;
+
+ if (inputctl->pub.eoi_reached) /* After hitting EOI, read no further */
+ return JPEG_REACHED_EOI;
+
+ val = (*cinfo->marker->read_markers) (cinfo);
+
+ switch (val) {
+ case JPEG_REACHED_SOS: /* Found SOS */
+ if (inputctl->inheaders) { /* 1st SOS */
+ initial_setup(cinfo);
+ inputctl->inheaders = FALSE;
+ /* Note: start_input_pass must be called by jdmaster.c
+ * before any more input can be consumed. jdapimin.c is
+ * responsible for enforcing this sequencing.
+ */
+ } else { /* 2nd or later SOS marker */
+ if (! inputctl->pub.has_multiple_scans)
+ ERREXIT(cinfo, JERR_EOI_EXPECTED); /* Oops, I wasn't expecting this! */
+ start_input_pass(cinfo);
+ }
+ break;
+ case JPEG_REACHED_EOI: /* Found EOI */
+ inputctl->pub.eoi_reached = TRUE;
+ if (inputctl->inheaders) { /* Tables-only datastream, apparently */
+ if (cinfo->marker->saw_SOF)
+ ERREXIT(cinfo, JERR_SOF_NO_SOS);
+ } else {
+ /* Prevent infinite loop in coef ctlr's decompress_data routine
+ * if user set output_scan_number larger than number of scans.
+ */
+ if (cinfo->output_scan_number > cinfo->input_scan_number)
+ cinfo->output_scan_number = cinfo->input_scan_number;
+ }
+ break;
+ case JPEG_SUSPENDED:
+ break;
+ }
+
+ return val;
+}
+
+
+/*
+ * Reset state to begin a fresh datastream.
+ */
+
+METHODDEF(void)
+reset_input_controller (j_decompress_ptr cinfo)
+{
+ my_inputctl_ptr inputctl = (my_inputctl_ptr) cinfo->inputctl;
+
+ inputctl->pub.consume_input = consume_markers;
+ inputctl->pub.has_multiple_scans = FALSE; /* "unknown" would be better */
+ inputctl->pub.eoi_reached = FALSE;
+ inputctl->inheaders = TRUE;
+ /* Reset other modules */
+ (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo);
+ (*cinfo->marker->reset_marker_reader) (cinfo);
+ /* Reset progression state -- would be cleaner if entropy decoder did this */
+ cinfo->coef_bits = NULL;
+}
+
+
+/*
+ * Initialize the input controller module.
+ * This is called only once, when the decompression object is created.
+ */
+
+GLOBAL(void)
+jinit_input_controller (j_decompress_ptr cinfo)
+{
+ my_inputctl_ptr inputctl;
+
+ /* Create subobject in permanent pool */
+ inputctl = (my_inputctl_ptr)
+ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
+ SIZEOF(my_input_controller));
+ cinfo->inputctl = (struct jpeg_input_controller *) inputctl;
+ /* Initialize method pointers */
+ inputctl->pub.consume_input = consume_markers;
+ inputctl->pub.reset_input_controller = reset_input_controller;
+ inputctl->pub.start_input_pass = start_input_pass;
+ inputctl->pub.finish_input_pass = finish_input_pass;
+ /* Initialize state: can't use reset_input_controller since we don't
+ * want to try to reset other modules yet.
+ */
+ inputctl->pub.has_multiple_scans = FALSE; /* "unknown" would be better */
+ inputctl->pub.eoi_reached = FALSE;
+ inputctl->inheaders = TRUE;
+}
+
+#endif //_FX_JPEG_TURBO_
diff --git a/core/src/fxcodec/libjpeg/fpdfapi_jdmainct.c b/core/src/fxcodec/libjpeg/fpdfapi_jdmainct.c
index 0fc77c7c17..1483e6fff0 100644
--- a/core/src/fxcodec/libjpeg/fpdfapi_jdmainct.c
+++ b/core/src/fxcodec/libjpeg/fpdfapi_jdmainct.c
@@ -1,515 +1,515 @@
-#if !defined(_FX_JPEG_TURBO_)
-/*
- * jdmainct.c
- *
- * Copyright (C) 1994-1996, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- * For conditions of distribution and use, see the accompanying README file.
- *
- * This file contains the main buffer controller for decompression.
- * The main buffer lies between the JPEG decompressor proper and the
- * post-processor; it holds downsampled data in the JPEG colorspace.
- *
- * Note that this code is bypassed in raw-data mode, since the application
- * supplies the equivalent of the main buffer in that case.
- */
-
-#define JPEG_INTERNALS
-#include "jinclude.h"
-#include "jpeglib.h"
-
-
-/*
- * In the current system design, the main buffer need never be a full-image
- * buffer; any full-height buffers will be found inside the coefficient or
- * postprocessing controllers. Nonetheless, the main controller is not
- * trivial. Its responsibility is to provide context rows for upsampling/
- * rescaling, and doing this in an efficient fashion is a bit tricky.
- *
- * Postprocessor input data is counted in "row groups". A row group
- * is defined to be (v_samp_factor * DCT_scaled_size / min_DCT_scaled_size)
- * sample rows of each component. (We require DCT_scaled_size values to be
- * chosen such that these numbers are integers. In practice DCT_scaled_size
- * values will likely be powers of two, so we actually have the stronger
- * condition that DCT_scaled_size / min_DCT_scaled_size is an integer.)
- * Upsampling will typically produce max_v_samp_factor pixel rows from each
- * row group (times any additional scale factor that the upsampler is
- * applying).
- *
- * The coefficient controller will deliver data to us one iMCU row at a time;
- * each iMCU row contains v_samp_factor * DCT_scaled_size sample rows, or
- * exactly min_DCT_scaled_size row groups. (This amount of data corresponds
- * to one row of MCUs when the image is fully interleaved.) Note that the
- * number of sample rows varies across components, but the number of row
- * groups does not. Some garbage sample rows may be included in the last iMCU
- * row at the bottom of the image.
- *
- * Depending on the vertical scaling algorithm used, the upsampler may need
- * access to the sample row(s) above and below its current input row group.
- * The upsampler is required to set need_context_rows TRUE at global selection
- * time if so. When need_context_rows is FALSE, this controller can simply
- * obtain one iMCU row at a time from the coefficient controller and dole it
- * out as row groups to the postprocessor.
- *
- * When need_context_rows is TRUE, this controller guarantees that the buffer
- * passed to postprocessing contains at least one row group's worth of samples
- * above and below the row group(s) being processed. Note that the context
- * rows "above" the first passed row group appear at negative row offsets in
- * the passed buffer. At the top and bottom of the image, the required
- * context rows are manufactured by duplicating the first or last real sample
- * row; this avoids having special cases in the upsampling inner loops.
- *
- * The amount of context is fixed at one row group just because that's a
- * convenient number for this controller to work with. The existing
- * upsamplers really only need one sample row of context. An upsampler
- * supporting arbitrary output rescaling might wish for more than one row
- * group of context when shrinking the image; tough, we don't handle that.
- * (This is justified by the assumption that downsizing will be handled mostly
- * by adjusting the DCT_scaled_size values, so that the actual scale factor at
- * the upsample step needn't be much less than one.)
- *
- * To provide the desired context, we have to retain the last two row groups
- * of one iMCU row while reading in the next iMCU row. (The last row group
- * can't be processed until we have another row group for its below-context,
- * and so we have to save the next-to-last group too for its above-context.)
- * We could do this most simply by copying data around in our buffer, but
- * that'd be very slow. We can avoid copying any data by creating a rather
- * strange pointer structure. Here's how it works. We allocate a workspace
- * consisting of M+2 row groups (where M = min_DCT_scaled_size is the number
- * of row groups per iMCU row). We create two sets of redundant pointers to
- * the workspace. Labeling the physical row groups 0 to M+1, the synthesized
- * pointer lists look like this:
- * M+1 M-1
- * master pointer --> 0 master pointer --> 0
- * 1 1
- * ... ...
- * M-3 M-3
- * M-2 M
- * M-1 M+1
- * M M-2
- * M+1 M-1
- * 0 0
- * We read alternate iMCU rows using each master pointer; thus the last two
- * row groups of the previous iMCU row remain un-overwritten in the workspace.
- * The pointer lists are set up so that the required context rows appear to
- * be adjacent to the proper places when we pass the pointer lists to the
- * upsampler.
- *
- * The above pictures describe the normal state of the pointer lists.
- * At top and bottom of the image, we diddle the pointer lists to duplicate
- * the first or last sample row as necessary (this is cheaper than copying
- * sample rows around).
- *
- * This scheme breaks down if M < 2, ie, min_DCT_scaled_size is 1. In that
- * situation each iMCU row provides only one row group so the buffering logic
- * must be different (eg, we must read two iMCU rows before we can emit the
- * first row group). For now, we simply do not support providing context
- * rows when min_DCT_scaled_size is 1. That combination seems unlikely to
- * be worth providing --- if someone wants a 1/8th-size preview, they probably
- * want it quick and dirty, so a context-free upsampler is sufficient.
- */
-
-
-/* Private buffer controller object */
-
-typedef struct {
- struct jpeg_d_main_controller pub; /* public fields */
-
- /* Pointer to allocated workspace (M or M+2 row groups). */
- JSAMPARRAY buffer[MAX_COMPONENTS];
-
- boolean buffer_full; /* Have we gotten an iMCU row from decoder? */
- JDIMENSION rowgroup_ctr; /* counts row groups output to postprocessor */
-
- /* Remaining fields are only used in the context case. */
-
- /* These are the master pointers to the funny-order pointer lists. */
- JSAMPIMAGE xbuffer[2]; /* pointers to weird pointer lists */
-
- int whichptr; /* indicates which pointer set is now in use */
- int context_state; /* process_data state machine status */
- JDIMENSION rowgroups_avail; /* row groups available to postprocessor */
- JDIMENSION iMCU_row_ctr; /* counts iMCU rows to detect image top/bot */
-} my_main_controller;
-
-typedef my_main_controller * my_main_ptr;
-
-/* context_state values: */
-#define CTX_PREPARE_FOR_IMCU 0 /* need to prepare for MCU row */
-#define CTX_PROCESS_IMCU 1 /* feeding iMCU to postprocessor */
-#define CTX_POSTPONED_ROW 2 /* feeding postponed row group */
-
-
-/* Forward declarations */
-METHODDEF(void) process_data_simple_main
- JPP((j_decompress_ptr cinfo, JSAMPARRAY output_buf,
- JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail));
-METHODDEF(void) process_data_context_main
- JPP((j_decompress_ptr cinfo, JSAMPARRAY output_buf,
- JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail));
-#ifdef QUANT_2PASS_SUPPORTED
-METHODDEF(void) process_data_crank_post
- JPP((j_decompress_ptr cinfo, JSAMPARRAY output_buf,
- JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail));
-#endif
-
-
-LOCAL(void)
-alloc_funny_pointers (j_decompress_ptr cinfo)
-/* Allocate space for the funny pointer lists.
- * This is done only once, not once per pass.
- */
-{
- my_main_ptr main = (my_main_ptr) cinfo->main;
- int ci, rgroup;
- int M = cinfo->min_DCT_scaled_size;
- jpeg_component_info *compptr;
- JSAMPARRAY xbuf;
-
- /* Get top-level space for component array pointers.
- * We alloc both arrays with one call to save a few cycles.
- */
- main->xbuffer[0] = (JSAMPIMAGE)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- cinfo->num_components * 2 * SIZEOF(JSAMPARRAY));
- main->xbuffer[1] = main->xbuffer[0] + cinfo->num_components;
-
- for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
- ci++, compptr++) {
- rgroup = (compptr->v_samp_factor * compptr->DCT_scaled_size) /
- cinfo->min_DCT_scaled_size; /* height of a row group of component */
- /* Get space for pointer lists --- M+4 row groups in each list.
- * We alloc both pointer lists with one call to save a few cycles.
- */
- xbuf = (JSAMPARRAY)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- 2 * (rgroup * (M + 4)) * SIZEOF(JSAMPROW));
- xbuf += rgroup; /* want one row group at negative offsets */
- main->xbuffer[0][ci] = xbuf;
- xbuf += rgroup * (M + 4);
- main->xbuffer[1][ci] = xbuf;
- }
-}
-
-
-LOCAL(void)
-make_funny_pointers (j_decompress_ptr cinfo)
-/* Create the funny pointer lists discussed in the comments above.
- * The actual workspace is already allocated (in main->buffer),
- * and the space for the pointer lists is allocated too.
- * This routine just fills in the curiously ordered lists.
- * This will be repeated at the beginning of each pass.
- */
-{
- my_main_ptr main = (my_main_ptr) cinfo->main;
- int ci, i, rgroup;
- int M = cinfo->min_DCT_scaled_size;
- jpeg_component_info *compptr;
- JSAMPARRAY buf, xbuf0, xbuf1;
-
- for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
- ci++, compptr++) {
- rgroup = (compptr->v_samp_factor * compptr->DCT_scaled_size) /
- cinfo->min_DCT_scaled_size; /* height of a row group of component */
- xbuf0 = main->xbuffer[0][ci];
- xbuf1 = main->xbuffer[1][ci];
- /* First copy the workspace pointers as-is */
- buf = main->buffer[ci];
- for (i = 0; i < rgroup * (M + 2); i++) {
- xbuf0[i] = xbuf1[i] = buf[i];
- }
- /* In the second list, put the last four row groups in swapped order */
- for (i = 0; i < rgroup * 2; i++) {
- xbuf1[rgroup*(M-2) + i] = buf[rgroup*M + i];
- xbuf1[rgroup*M + i] = buf[rgroup*(M-2) + i];
- }
- /* The wraparound pointers at top and bottom will be filled later
- * (see set_wraparound_pointers, below). Initially we want the "above"
- * pointers to duplicate the first actual data line. This only needs
- * to happen in xbuffer[0].
- */
- for (i = 0; i < rgroup; i++) {
- xbuf0[i - rgroup] = xbuf0[0];
- }
- }
-}
-
-
-LOCAL(void)
-set_wraparound_pointers (j_decompress_ptr cinfo)
-/* Set up the "wraparound" pointers at top and bottom of the pointer lists.
- * This changes the pointer list state from top-of-image to the normal state.
- */
-{
- my_main_ptr main = (my_main_ptr) cinfo->main;
- int ci, i, rgroup;
- int M = cinfo->min_DCT_scaled_size;
- jpeg_component_info *compptr;
- JSAMPARRAY xbuf0, xbuf1;
-
- for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
- ci++, compptr++) {
- rgroup = (compptr->v_samp_factor * compptr->DCT_scaled_size) /
- cinfo->min_DCT_scaled_size; /* height of a row group of component */
- xbuf0 = main->xbuffer[0][ci];
- xbuf1 = main->xbuffer[1][ci];
- for (i = 0; i < rgroup; i++) {
- xbuf0[i - rgroup] = xbuf0[rgroup*(M+1) + i];
- xbuf1[i - rgroup] = xbuf1[rgroup*(M+1) + i];
- xbuf0[rgroup*(M+2) + i] = xbuf0[i];
- xbuf1[rgroup*(M+2) + i] = xbuf1[i];
- }
- }
-}
-
-
-LOCAL(void)
-set_bottom_pointers (j_decompress_ptr cinfo)
-/* Change the pointer lists to duplicate the last sample row at the bottom
- * of the image. whichptr indicates which xbuffer holds the final iMCU row.
- * Also sets rowgroups_avail to indicate number of nondummy row groups in row.
- */
-{
- my_main_ptr main = (my_main_ptr) cinfo->main;
- int ci, i, rgroup, iMCUheight, rows_left;
- jpeg_component_info *compptr;
- JSAMPARRAY xbuf;
-
- for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
- ci++, compptr++) {
- /* Count sample rows in one iMCU row and in one row group */
- iMCUheight = compptr->v_samp_factor * compptr->DCT_scaled_size;
- rgroup = iMCUheight / cinfo->min_DCT_scaled_size;
- /* Count nondummy sample rows remaining for this component */
- rows_left = (int) (compptr->downsampled_height % (JDIMENSION) iMCUheight);
- if (rows_left == 0) rows_left = iMCUheight;
- /* Count nondummy row groups. Should get same answer for each component,
- * so we need only do it once.
- */
- if (ci == 0) {
- main->rowgroups_avail = (JDIMENSION) ((rows_left-1) / rgroup + 1);
- }
- /* Duplicate the last real sample row rgroup*2 times; this pads out the
- * last partial rowgroup and ensures at least one full rowgroup of context.
- */
- xbuf = main->xbuffer[main->whichptr][ci];
- for (i = 0; i < rgroup * 2; i++) {
- xbuf[rows_left + i] = xbuf[rows_left-1];
- }
- }
-}
-
-
-/*
- * Initialize for a processing pass.
- */
-
-METHODDEF(void)
-start_pass_main (j_decompress_ptr cinfo, J_BUF_MODE pass_mode)
-{
- my_main_ptr main = (my_main_ptr) cinfo->main;
-
- switch (pass_mode) {
- case JBUF_PASS_THRU:
- if (cinfo->upsample->need_context_rows) {
- main->pub.process_data = process_data_context_main;
- make_funny_pointers(cinfo); /* Create the xbuffer[] lists */
- main->whichptr = 0; /* Read first iMCU row into xbuffer[0] */
- main->context_state = CTX_PREPARE_FOR_IMCU;
- main->iMCU_row_ctr = 0;
- } else {
- /* Simple case with no context needed */
- main->pub.process_data = process_data_simple_main;
- }
- main->buffer_full = FALSE; /* Mark buffer empty */
- main->rowgroup_ctr = 0;
- break;
-#ifdef QUANT_2PASS_SUPPORTED
- case JBUF_CRANK_DEST:
- /* For last pass of 2-pass quantization, just crank the postprocessor */
- main->pub.process_data = process_data_crank_post;
- break;
-#endif
- default:
- ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
- break;
- }
-}
-
-
-/*
- * Process some data.
- * This handles the simple case where no context is required.
- */
-
-METHODDEF(void)
-process_data_simple_main (j_decompress_ptr cinfo,
- JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
- JDIMENSION out_rows_avail)
-{
- my_main_ptr main = (my_main_ptr) cinfo->main;
- JDIMENSION rowgroups_avail;
-
- /* Read input data if we haven't filled the main buffer yet */
- if (! main->buffer_full) {
- if (! (*cinfo->coef->decompress_data) (cinfo, main->buffer))
- return; /* suspension forced, can do nothing more */
- main->buffer_full = TRUE; /* OK, we have an iMCU row to work with */
- }
-
- /* There are always min_DCT_scaled_size row groups in an iMCU row. */
- rowgroups_avail = (JDIMENSION) cinfo->min_DCT_scaled_size;
- /* Note: at the bottom of the image, we may pass extra garbage row groups
- * to the postprocessor. The postprocessor has to check for bottom
- * of image anyway (at row resolution), so no point in us doing it too.
- */
-
- /* Feed the postprocessor */
- (*cinfo->post->post_process_data) (cinfo, main->buffer,
- &main->rowgroup_ctr, rowgroups_avail,
- output_buf, out_row_ctr, out_rows_avail);
-
- /* Has postprocessor consumed all the data yet? If so, mark buffer empty */
- if (main->rowgroup_ctr >= rowgroups_avail) {
- main->buffer_full = FALSE;
- main->rowgroup_ctr = 0;
- }
-}
-
-
-/*
- * Process some data.
- * This handles the case where context rows must be provided.
- */
-
-METHODDEF(void)
-process_data_context_main (j_decompress_ptr cinfo,
- JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
- JDIMENSION out_rows_avail)
-{
- my_main_ptr main = (my_main_ptr) cinfo->main;
-
- /* Read input data if we haven't filled the main buffer yet */
- if (! main->buffer_full) {
- if (! (*cinfo->coef->decompress_data) (cinfo,
- main->xbuffer[main->whichptr]))
- return; /* suspension forced, can do nothing more */
- main->buffer_full = TRUE; /* OK, we have an iMCU row to work with */
- main->iMCU_row_ctr++; /* count rows received */
- }
-
- /* Postprocessor typically will not swallow all the input data it is handed
- * in one call (due to filling the output buffer first). Must be prepared
- * to exit and restart. This switch lets us keep track of how far we got.
- * Note that each case falls through to the next on successful completion.
- */
- switch (main->context_state) {
- case CTX_POSTPONED_ROW:
- /* Call postprocessor using previously set pointers for postponed row */
- (*cinfo->post->post_process_data) (cinfo, main->xbuffer[main->whichptr],
- &main->rowgroup_ctr, main->rowgroups_avail,
- output_buf, out_row_ctr, out_rows_avail);
- if (main->rowgroup_ctr < main->rowgroups_avail)
- return; /* Need to suspend */
- main->context_state = CTX_PREPARE_FOR_IMCU;
- if (*out_row_ctr >= out_rows_avail)
- return; /* Postprocessor exactly filled output buf */
- /*FALLTHROUGH*/
- case CTX_PREPARE_FOR_IMCU:
- /* Prepare to process first M-1 row groups of this iMCU row */
- main->rowgroup_ctr = 0;
- main->rowgroups_avail = (JDIMENSION) (cinfo->min_DCT_scaled_size - 1);
- /* Check for bottom of image: if so, tweak pointers to "duplicate"
- * the last sample row, and adjust rowgroups_avail to ignore padding rows.
- */
- if (main->iMCU_row_ctr == cinfo->total_iMCU_rows)
- set_bottom_pointers(cinfo);
- main->context_state = CTX_PROCESS_IMCU;
- /*FALLTHROUGH*/
- case CTX_PROCESS_IMCU:
- /* Call postprocessor using previously set pointers */
- (*cinfo->post->post_process_data) (cinfo, main->xbuffer[main->whichptr],
- &main->rowgroup_ctr, main->rowgroups_avail,
- output_buf, out_row_ctr, out_rows_avail);
- if (main->rowgroup_ctr < main->rowgroups_avail)
- return; /* Need to suspend */
- /* After the first iMCU, change wraparound pointers to normal state */
- if (main->iMCU_row_ctr == 1)
- set_wraparound_pointers(cinfo);
- /* Prepare to load new iMCU row using other xbuffer list */
- main->whichptr ^= 1; /* 0=>1 or 1=>0 */
- main->buffer_full = FALSE;
- /* Still need to process last row group of this iMCU row, */
- /* which is saved at index M+1 of the other xbuffer */
- main->rowgroup_ctr = (JDIMENSION) (cinfo->min_DCT_scaled_size + 1);
- main->rowgroups_avail = (JDIMENSION) (cinfo->min_DCT_scaled_size + 2);
- main->context_state = CTX_POSTPONED_ROW;
- }
-}
-
-
-/*
- * Process some data.
- * Final pass of two-pass quantization: just call the postprocessor.
- * Source data will be the postprocessor controller's internal buffer.
- */
-
-#ifdef QUANT_2PASS_SUPPORTED
-
-METHODDEF(void)
-process_data_crank_post (j_decompress_ptr cinfo,
- JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
- JDIMENSION out_rows_avail)
-{
- (*cinfo->post->post_process_data) (cinfo, (JSAMPIMAGE) NULL,
- (JDIMENSION *) NULL, (JDIMENSION) 0,
- output_buf, out_row_ctr, out_rows_avail);
-}
-
-#endif /* QUANT_2PASS_SUPPORTED */
-
-
-/*
- * Initialize main buffer controller.
- */
-
-GLOBAL(void)
-jinit_d_main_controller (j_decompress_ptr cinfo, boolean need_full_buffer)
-{
- my_main_ptr main;
- int ci, rgroup, ngroups;
- jpeg_component_info *compptr;
-
- main = (my_main_ptr)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- SIZEOF(my_main_controller));
- cinfo->main = (struct jpeg_d_main_controller *) main;
- main->pub.start_pass = start_pass_main;
-
- if (need_full_buffer) /* shouldn't happen */
- ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
-
- /* Allocate the workspace.
- * ngroups is the number of row groups we need.
- */
- if (cinfo->upsample->need_context_rows) {
- if (cinfo->min_DCT_scaled_size < 2) /* unsupported, see comments above */
- ERREXIT(cinfo, JERR_NOTIMPL);
- alloc_funny_pointers(cinfo); /* Alloc space for xbuffer[] lists */
- ngroups = cinfo->min_DCT_scaled_size + 2;
- } else {
- ngroups = cinfo->min_DCT_scaled_size;
- }
-
- for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
- ci++, compptr++) {
- rgroup = (compptr->v_samp_factor * compptr->DCT_scaled_size) /
- cinfo->min_DCT_scaled_size; /* height of a row group of component */
- main->buffer[ci] = (*cinfo->mem->alloc_sarray)
- ((j_common_ptr) cinfo, JPOOL_IMAGE,
- compptr->width_in_blocks * compptr->DCT_scaled_size,
- (JDIMENSION) (rgroup * ngroups));
- }
-}
-
-#endif //_FX_JPEG_TURBO_
+#if !defined(_FX_JPEG_TURBO_)
+/*
+ * jdmainct.c
+ *
+ * Copyright (C) 1994-1996, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains the main buffer controller for decompression.
+ * The main buffer lies between the JPEG decompressor proper and the
+ * post-processor; it holds downsampled data in the JPEG colorspace.
+ *
+ * Note that this code is bypassed in raw-data mode, since the application
+ * supplies the equivalent of the main buffer in that case.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+
+
+/*
+ * In the current system design, the main buffer need never be a full-image
+ * buffer; any full-height buffers will be found inside the coefficient or
+ * postprocessing controllers. Nonetheless, the main controller is not
+ * trivial. Its responsibility is to provide context rows for upsampling/
+ * rescaling, and doing this in an efficient fashion is a bit tricky.
+ *
+ * Postprocessor input data is counted in "row groups". A row group
+ * is defined to be (v_samp_factor * DCT_scaled_size / min_DCT_scaled_size)
+ * sample rows of each component. (We require DCT_scaled_size values to be
+ * chosen such that these numbers are integers. In practice DCT_scaled_size
+ * values will likely be powers of two, so we actually have the stronger
+ * condition that DCT_scaled_size / min_DCT_scaled_size is an integer.)
+ * Upsampling will typically produce max_v_samp_factor pixel rows from each
+ * row group (times any additional scale factor that the upsampler is
+ * applying).
+ *
+ * The coefficient controller will deliver data to us one iMCU row at a time;
+ * each iMCU row contains v_samp_factor * DCT_scaled_size sample rows, or
+ * exactly min_DCT_scaled_size row groups. (This amount of data corresponds
+ * to one row of MCUs when the image is fully interleaved.) Note that the
+ * number of sample rows varies across components, but the number of row
+ * groups does not. Some garbage sample rows may be included in the last iMCU
+ * row at the bottom of the image.
+ *
+ * Depending on the vertical scaling algorithm used, the upsampler may need
+ * access to the sample row(s) above and below its current input row group.
+ * The upsampler is required to set need_context_rows TRUE at global selection
+ * time if so. When need_context_rows is FALSE, this controller can simply
+ * obtain one iMCU row at a time from the coefficient controller and dole it
+ * out as row groups to the postprocessor.
+ *
+ * When need_context_rows is TRUE, this controller guarantees that the buffer
+ * passed to postprocessing contains at least one row group's worth of samples
+ * above and below the row group(s) being processed. Note that the context
+ * rows "above" the first passed row group appear at negative row offsets in
+ * the passed buffer. At the top and bottom of the image, the required
+ * context rows are manufactured by duplicating the first or last real sample
+ * row; this avoids having special cases in the upsampling inner loops.
+ *
+ * The amount of context is fixed at one row group just because that's a
+ * convenient number for this controller to work with. The existing
+ * upsamplers really only need one sample row of context. An upsampler
+ * supporting arbitrary output rescaling might wish for more than one row
+ * group of context when shrinking the image; tough, we don't handle that.
+ * (This is justified by the assumption that downsizing will be handled mostly
+ * by adjusting the DCT_scaled_size values, so that the actual scale factor at
+ * the upsample step needn't be much less than one.)
+ *
+ * To provide the desired context, we have to retain the last two row groups
+ * of one iMCU row while reading in the next iMCU row. (The last row group
+ * can't be processed until we have another row group for its below-context,
+ * and so we have to save the next-to-last group too for its above-context.)
+ * We could do this most simply by copying data around in our buffer, but
+ * that'd be very slow. We can avoid copying any data by creating a rather
+ * strange pointer structure. Here's how it works. We allocate a workspace
+ * consisting of M+2 row groups (where M = min_DCT_scaled_size is the number
+ * of row groups per iMCU row). We create two sets of redundant pointers to
+ * the workspace. Labeling the physical row groups 0 to M+1, the synthesized
+ * pointer lists look like this:
+ * M+1 M-1
+ * master pointer --> 0 master pointer --> 0
+ * 1 1
+ * ... ...
+ * M-3 M-3
+ * M-2 M
+ * M-1 M+1
+ * M M-2
+ * M+1 M-1
+ * 0 0
+ * We read alternate iMCU rows using each master pointer; thus the last two
+ * row groups of the previous iMCU row remain un-overwritten in the workspace.
+ * The pointer lists are set up so that the required context rows appear to
+ * be adjacent to the proper places when we pass the pointer lists to the
+ * upsampler.
+ *
+ * The above pictures describe the normal state of the pointer lists.
+ * At top and bottom of the image, we diddle the pointer lists to duplicate
+ * the first or last sample row as necessary (this is cheaper than copying
+ * sample rows around).
+ *
+ * This scheme breaks down if M < 2, ie, min_DCT_scaled_size is 1. In that
+ * situation each iMCU row provides only one row group so the buffering logic
+ * must be different (eg, we must read two iMCU rows before we can emit the
+ * first row group). For now, we simply do not support providing context
+ * rows when min_DCT_scaled_size is 1. That combination seems unlikely to
+ * be worth providing --- if someone wants a 1/8th-size preview, they probably
+ * want it quick and dirty, so a context-free upsampler is sufficient.
+ */
+
+
+/* Private buffer controller object */
+
+typedef struct {
+ struct jpeg_d_main_controller pub; /* public fields */
+
+ /* Pointer to allocated workspace (M or M+2 row groups). */
+ JSAMPARRAY buffer[MAX_COMPONENTS];
+
+ boolean buffer_full; /* Have we gotten an iMCU row from decoder? */
+ JDIMENSION rowgroup_ctr; /* counts row groups output to postprocessor */
+
+ /* Remaining fields are only used in the context case. */
+
+ /* These are the master pointers to the funny-order pointer lists. */
+ JSAMPIMAGE xbuffer[2]; /* pointers to weird pointer lists */
+
+ int whichptr; /* indicates which pointer set is now in use */
+ int context_state; /* process_data state machine status */
+ JDIMENSION rowgroups_avail; /* row groups available to postprocessor */
+ JDIMENSION iMCU_row_ctr; /* counts iMCU rows to detect image top/bot */
+} my_main_controller;
+
+typedef my_main_controller * my_main_ptr;
+
+/* context_state values: */
+#define CTX_PREPARE_FOR_IMCU 0 /* need to prepare for MCU row */
+#define CTX_PROCESS_IMCU 1 /* feeding iMCU to postprocessor */
+#define CTX_POSTPONED_ROW 2 /* feeding postponed row group */
+
+
+/* Forward declarations */
+METHODDEF(void) process_data_simple_main
+ JPP((j_decompress_ptr cinfo, JSAMPARRAY output_buf,
+ JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail));
+METHODDEF(void) process_data_context_main
+ JPP((j_decompress_ptr cinfo, JSAMPARRAY output_buf,
+ JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail));
+#ifdef QUANT_2PASS_SUPPORTED
+METHODDEF(void) process_data_crank_post
+ JPP((j_decompress_ptr cinfo, JSAMPARRAY output_buf,
+ JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail));
+#endif
+
+
+LOCAL(void)
+alloc_funny_pointers (j_decompress_ptr cinfo)
+/* Allocate space for the funny pointer lists.
+ * This is done only once, not once per pass.
+ */
+{
+ my_main_ptr main = (my_main_ptr) cinfo->main;
+ int ci, rgroup;
+ int M = cinfo->min_DCT_scaled_size;
+ jpeg_component_info *compptr;
+ JSAMPARRAY xbuf;
+
+ /* Get top-level space for component array pointers.
+ * We alloc both arrays with one call to save a few cycles.
+ */
+ main->xbuffer[0] = (JSAMPIMAGE)
+ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ cinfo->num_components * 2 * SIZEOF(JSAMPARRAY));
+ main->xbuffer[1] = main->xbuffer[0] + cinfo->num_components;
+
+ for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+ ci++, compptr++) {
+ rgroup = (compptr->v_samp_factor * compptr->DCT_scaled_size) /
+ cinfo->min_DCT_scaled_size; /* height of a row group of component */
+ /* Get space for pointer lists --- M+4 row groups in each list.
+ * We alloc both pointer lists with one call to save a few cycles.
+ */
+ xbuf = (JSAMPARRAY)
+ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ 2 * (rgroup * (M + 4)) * SIZEOF(JSAMPROW));
+ xbuf += rgroup; /* want one row group at negative offsets */
+ main->xbuffer[0][ci] = xbuf;
+ xbuf += rgroup * (M + 4);
+ main->xbuffer[1][ci] = xbuf;
+ }
+}
+
+
+LOCAL(void)
+make_funny_pointers (j_decompress_ptr cinfo)
+/* Create the funny pointer lists discussed in the comments above.
+ * The actual workspace is already allocated (in main->buffer),
+ * and the space for the pointer lists is allocated too.
+ * This routine just fills in the curiously ordered lists.
+ * This will be repeated at the beginning of each pass.
+ */
+{
+ my_main_ptr main = (my_main_ptr) cinfo->main;
+ int ci, i, rgroup;
+ int M = cinfo->min_DCT_scaled_size;
+ jpeg_component_info *compptr;
+ JSAMPARRAY buf, xbuf0, xbuf1;
+
+ for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+ ci++, compptr++) {
+ rgroup = (compptr->v_samp_factor * compptr->DCT_scaled_size) /
+ cinfo->min_DCT_scaled_size; /* height of a row group of component */
+ xbuf0 = main->xbuffer[0][ci];
+ xbuf1 = main->xbuffer[1][ci];
+ /* First copy the workspace pointers as-is */
+ buf = main->buffer[ci];
+ for (i = 0; i < rgroup * (M + 2); i++) {
+ xbuf0[i] = xbuf1[i] = buf[i];
+ }
+ /* In the second list, put the last four row groups in swapped order */
+ for (i = 0; i < rgroup * 2; i++) {
+ xbuf1[rgroup*(M-2) + i] = buf[rgroup*M + i];
+ xbuf1[rgroup*M + i] = buf[rgroup*(M-2) + i];
+ }
+ /* The wraparound pointers at top and bottom will be filled later
+ * (see set_wraparound_pointers, below). Initially we want the "above"
+ * pointers to duplicate the first actual data line. This only needs
+ * to happen in xbuffer[0].
+ */
+ for (i = 0; i < rgroup; i++) {
+ xbuf0[i - rgroup] = xbuf0[0];
+ }
+ }
+}
+
+
+LOCAL(void)
+set_wraparound_pointers (j_decompress_ptr cinfo)
+/* Set up the "wraparound" pointers at top and bottom of the pointer lists.
+ * This changes the pointer list state from top-of-image to the normal state.
+ */
+{
+ my_main_ptr main = (my_main_ptr) cinfo->main;
+ int ci, i, rgroup;
+ int M = cinfo->min_DCT_scaled_size;
+ jpeg_component_info *compptr;
+ JSAMPARRAY xbuf0, xbuf1;
+
+ for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+ ci++, compptr++) {
+ rgroup = (compptr->v_samp_factor * compptr->DCT_scaled_size) /
+ cinfo->min_DCT_scaled_size; /* height of a row group of component */
+ xbuf0 = main->xbuffer[0][ci];
+ xbuf1 = main->xbuffer[1][ci];
+ for (i = 0; i < rgroup; i++) {
+ xbuf0[i - rgroup] = xbuf0[rgroup*(M+1) + i];
+ xbuf1[i - rgroup] = xbuf1[rgroup*(M+1) + i];
+ xbuf0[rgroup*(M+2) + i] = xbuf0[i];
+ xbuf1[rgroup*(M+2) + i] = xbuf1[i];
+ }
+ }
+}
+
+
+LOCAL(void)
+set_bottom_pointers (j_decompress_ptr cinfo)
+/* Change the pointer lists to duplicate the last sample row at the bottom
+ * of the image. whichptr indicates which xbuffer holds the final iMCU row.
+ * Also sets rowgroups_avail to indicate number of nondummy row groups in row.
+ */
+{
+ my_main_ptr main = (my_main_ptr) cinfo->main;
+ int ci, i, rgroup, iMCUheight, rows_left;
+ jpeg_component_info *compptr;
+ JSAMPARRAY xbuf;
+
+ for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+ ci++, compptr++) {
+ /* Count sample rows in one iMCU row and in one row group */
+ iMCUheight = compptr->v_samp_factor * compptr->DCT_scaled_size;
+ rgroup = iMCUheight / cinfo->min_DCT_scaled_size;
+ /* Count nondummy sample rows remaining for this component */
+ rows_left = (int) (compptr->downsampled_height % (JDIMENSION) iMCUheight);
+ if (rows_left == 0) rows_left = iMCUheight;
+ /* Count nondummy row groups. Should get same answer for each component,
+ * so we need only do it once.
+ */
+ if (ci == 0) {
+ main->rowgroups_avail = (JDIMENSION) ((rows_left-1) / rgroup + 1);
+ }
+ /* Duplicate the last real sample row rgroup*2 times; this pads out the
+ * last partial rowgroup and ensures at least one full rowgroup of context.
+ */
+ xbuf = main->xbuffer[main->whichptr][ci];
+ for (i = 0; i < rgroup * 2; i++) {
+ xbuf[rows_left + i] = xbuf[rows_left-1];
+ }
+ }
+}
+
+
+/*
+ * Initialize for a processing pass.
+ */
+
+METHODDEF(void)
+start_pass_main (j_decompress_ptr cinfo, J_BUF_MODE pass_mode)
+{
+ my_main_ptr main = (my_main_ptr) cinfo->main;
+
+ switch (pass_mode) {
+ case JBUF_PASS_THRU:
+ if (cinfo->upsample->need_context_rows) {
+ main->pub.process_data = process_data_context_main;
+ make_funny_pointers(cinfo); /* Create the xbuffer[] lists */
+ main->whichptr = 0; /* Read first iMCU row into xbuffer[0] */
+ main->context_state = CTX_PREPARE_FOR_IMCU;
+ main->iMCU_row_ctr = 0;
+ } else {
+ /* Simple case with no context needed */
+ main->pub.process_data = process_data_simple_main;
+ }
+ main->buffer_full = FALSE; /* Mark buffer empty */
+ main->rowgroup_ctr = 0;
+ break;
+#ifdef QUANT_2PASS_SUPPORTED
+ case JBUF_CRANK_DEST:
+ /* For last pass of 2-pass quantization, just crank the postprocessor */
+ main->pub.process_data = process_data_crank_post;
+ break;
+#endif
+ default:
+ ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
+ break;
+ }
+}
+
+
+/*
+ * Process some data.
+ * This handles the simple case where no context is required.
+ */
+
+METHODDEF(void)
+process_data_simple_main (j_decompress_ptr cinfo,
+ JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
+ JDIMENSION out_rows_avail)
+{
+ my_main_ptr main = (my_main_ptr) cinfo->main;
+ JDIMENSION rowgroups_avail;
+
+ /* Read input data if we haven't filled the main buffer yet */
+ if (! main->buffer_full) {
+ if (! (*cinfo->coef->decompress_data) (cinfo, main->buffer))
+ return; /* suspension forced, can do nothing more */
+ main->buffer_full = TRUE; /* OK, we have an iMCU row to work with */
+ }
+
+ /* There are always min_DCT_scaled_size row groups in an iMCU row. */
+ rowgroups_avail = (JDIMENSION) cinfo->min_DCT_scaled_size;
+ /* Note: at the bottom of the image, we may pass extra garbage row groups
+ * to the postprocessor. The postprocessor has to check for bottom
+ * of image anyway (at row resolution), so no point in us doing it too.
+ */
+
+ /* Feed the postprocessor */
+ (*cinfo->post->post_process_data) (cinfo, main->buffer,
+ &main->rowgroup_ctr, rowgroups_avail,
+ output_buf, out_row_ctr, out_rows_avail);
+
+ /* Has postprocessor consumed all the data yet? If so, mark buffer empty */
+ if (main->rowgroup_ctr >= rowgroups_avail) {
+ main->buffer_full = FALSE;
+ main->rowgroup_ctr = 0;
+ }
+}
+
+
+/*
+ * Process some data.
+ * This handles the case where context rows must be provided.
+ */
+
+METHODDEF(void)
+process_data_context_main (j_decompress_ptr cinfo,
+ JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
+ JDIMENSION out_rows_avail)
+{
+ my_main_ptr main = (my_main_ptr) cinfo->main;
+
+ /* Read input data if we haven't filled the main buffer yet */
+ if (! main->buffer_full) {
+ if (! (*cinfo->coef->decompress_data) (cinfo,
+ main->xbuffer[main->whichptr]))
+ return; /* suspension forced, can do nothing more */
+ main->buffer_full = TRUE; /* OK, we have an iMCU row to work with */
+ main->iMCU_row_ctr++; /* count rows received */
+ }
+
+ /* Postprocessor typically will not swallow all the input data it is handed
+ * in one call (due to filling the output buffer first). Must be prepared
+ * to exit and restart. This switch lets us keep track of how far we got.
+ * Note that each case falls through to the next on successful completion.
+ */
+ switch (main->context_state) {
+ case CTX_POSTPONED_ROW:
+ /* Call postprocessor using previously set pointers for postponed row */
+ (*cinfo->post->post_process_data) (cinfo, main->xbuffer[main->whichptr],
+ &main->rowgroup_ctr, main->rowgroups_avail,
+ output_buf, out_row_ctr, out_rows_avail);
+ if (main->rowgroup_ctr < main->rowgroups_avail)
+ return; /* Need to suspend */
+ main->context_state = CTX_PREPARE_FOR_IMCU;
+ if (*out_row_ctr >= out_rows_avail)
+ return; /* Postprocessor exactly filled output buf */
+ /*FALLTHROUGH*/
+ case CTX_PREPARE_FOR_IMCU:
+ /* Prepare to process first M-1 row groups of this iMCU row */
+ main->rowgroup_ctr = 0;
+ main->rowgroups_avail = (JDIMENSION) (cinfo->min_DCT_scaled_size - 1);
+ /* Check for bottom of image: if so, tweak pointers to "duplicate"
+ * the last sample row, and adjust rowgroups_avail to ignore padding rows.
+ */
+ if (main->iMCU_row_ctr == cinfo->total_iMCU_rows)
+ set_bottom_pointers(cinfo);
+ main->context_state = CTX_PROCESS_IMCU;
+ /*FALLTHROUGH*/
+ case CTX_PROCESS_IMCU:
+ /* Call postprocessor using previously set pointers */
+ (*cinfo->post->post_process_data) (cinfo, main->xbuffer[main->whichptr],
+ &main->rowgroup_ctr, main->rowgroups_avail,
+ output_buf, out_row_ctr, out_rows_avail);
+ if (main->rowgroup_ctr < main->rowgroups_avail)
+ return; /* Need to suspend */
+ /* After the first iMCU, change wraparound pointers to normal state */
+ if (main->iMCU_row_ctr == 1)
+ set_wraparound_pointers(cinfo);
+ /* Prepare to load new iMCU row using other xbuffer list */
+ main->whichptr ^= 1; /* 0=>1 or 1=>0 */
+ main->buffer_full = FALSE;
+ /* Still need to process last row group of this iMCU row, */
+ /* which is saved at index M+1 of the other xbuffer */
+ main->rowgroup_ctr = (JDIMENSION) (cinfo->min_DCT_scaled_size + 1);
+ main->rowgroups_avail = (JDIMENSION) (cinfo->min_DCT_scaled_size + 2);
+ main->context_state = CTX_POSTPONED_ROW;
+ }
+}
+
+
+/*
+ * Process some data.
+ * Final pass of two-pass quantization: just call the postprocessor.
+ * Source data will be the postprocessor controller's internal buffer.
+ */
+
+#ifdef QUANT_2PASS_SUPPORTED
+
+METHODDEF(void)
+process_data_crank_post (j_decompress_ptr cinfo,
+ JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
+ JDIMENSION out_rows_avail)
+{
+ (*cinfo->post->post_process_data) (cinfo, (JSAMPIMAGE) NULL,
+ (JDIMENSION *) NULL, (JDIMENSION) 0,
+ output_buf, out_row_ctr, out_rows_avail);
+}
+
+#endif /* QUANT_2PASS_SUPPORTED */
+
+
+/*
+ * Initialize main buffer controller.
+ */
+
+GLOBAL(void)
+jinit_d_main_controller (j_decompress_ptr cinfo, boolean need_full_buffer)
+{
+ my_main_ptr main;
+ int ci, rgroup, ngroups;
+ jpeg_component_info *compptr;
+
+ main = (my_main_ptr)
+ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ SIZEOF(my_main_controller));
+ cinfo->main = (struct jpeg_d_main_controller *) main;
+ main->pub.start_pass = start_pass_main;
+
+ if (need_full_buffer) /* shouldn't happen */
+ ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
+
+ /* Allocate the workspace.
+ * ngroups is the number of row groups we need.
+ */
+ if (cinfo->upsample->need_context_rows) {
+ if (cinfo->min_DCT_scaled_size < 2) /* unsupported, see comments above */
+ ERREXIT(cinfo, JERR_NOTIMPL);
+ alloc_funny_pointers(cinfo); /* Alloc space for xbuffer[] lists */
+ ngroups = cinfo->min_DCT_scaled_size + 2;
+ } else {
+ ngroups = cinfo->min_DCT_scaled_size;
+ }
+
+ for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+ ci++, compptr++) {
+ rgroup = (compptr->v_samp_factor * compptr->DCT_scaled_size) /
+ cinfo->min_DCT_scaled_size; /* height of a row group of component */
+ main->buffer[ci] = (*cinfo->mem->alloc_sarray)
+ ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ compptr->width_in_blocks * compptr->DCT_scaled_size,
+ (JDIMENSION) (rgroup * ngroups));
+ }
+}
+
+#endif //_FX_JPEG_TURBO_
diff --git a/core/src/fxcodec/libjpeg/fpdfapi_jdmarker.c b/core/src/fxcodec/libjpeg/fpdfapi_jdmarker.c
index 60f2139f58..bcd017f920 100644
--- a/core/src/fxcodec/libjpeg/fpdfapi_jdmarker.c
+++ b/core/src/fxcodec/libjpeg/fpdfapi_jdmarker.c
@@ -1,1396 +1,1396 @@
-#if !defined(_FX_JPEG_TURBO_)
-/*
- * jdmarker.c
- *
- * Copyright (C) 1991-1998, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- * For conditions of distribution and use, see the accompanying README file.
- *
- * This file contains routines to decode JPEG datastream markers.
- * Most of the complexity arises from our desire to support input
- * suspension: if not all of the data for a marker is available,
- * we must exit back to the application. On resumption, we reprocess
- * the marker.
- */
-
-#define JPEG_INTERNALS
-#include "jinclude.h"
-#include "jpeglib.h"
-
-
-typedef enum { /* JPEG marker codes */
- M_SOF0 = 0xc0,
- M_SOF1 = 0xc1,
- M_SOF2 = 0xc2,
- M_SOF3 = 0xc3,
-
- M_SOF5 = 0xc5,
- M_SOF6 = 0xc6,
- M_SOF7 = 0xc7,
-
- M_JPG = 0xc8,
- M_SOF9 = 0xc9,
- M_SOF10 = 0xca,
- M_SOF11 = 0xcb,
-
- M_SOF13 = 0xcd,
- M_SOF14 = 0xce,
- M_SOF15 = 0xcf,
-
- M_DHT = 0xc4,
-
- M_DAC = 0xcc,
-
- M_RST0 = 0xd0,
- M_RST1 = 0xd1,
- M_RST2 = 0xd2,
- M_RST3 = 0xd3,
- M_RST4 = 0xd4,
- M_RST5 = 0xd5,
- M_RST6 = 0xd6,
- M_RST7 = 0xd7,
-
- M_SOI = 0xd8,
- M_EOI = 0xd9,
- M_SOS = 0xda,
- M_DQT = 0xdb,
- M_DNL = 0xdc,
- M_DRI = 0xdd,
- M_DHP = 0xde,
- M_EXP = 0xdf,
-
- M_APP0 = 0xe0,
- M_APP1 = 0xe1,
- M_APP2 = 0xe2,
- M_APP3 = 0xe3,
- M_APP4 = 0xe4,
- M_APP5 = 0xe5,
- M_APP6 = 0xe6,
- M_APP7 = 0xe7,
- M_APP8 = 0xe8,
- M_APP9 = 0xe9,
- M_APP10 = 0xea,
- M_APP11 = 0xeb,
- M_APP12 = 0xec,
- M_APP13 = 0xed,
- M_APP14 = 0xee,
- M_APP15 = 0xef,
-
- M_JPG0 = 0xf0,
- M_JPG13 = 0xfd,
- M_COM = 0xfe,
-
- M_TEM = 0x01,
-
- M_ERROR = 0x100
-} JPEG_MARKER;
-
-
-/* Private state */
-
-typedef struct {
- struct jpeg_marker_reader pub; /* public fields */
-
- /* Application-overridable marker processing methods */
- jpeg_marker_parser_method process_COM;
- jpeg_marker_parser_method process_APPn[16];
-
- /* Limit on marker data length to save for each marker type */
- unsigned int length_limit_COM;
- unsigned int length_limit_APPn[16];
-
- /* Status of COM/APPn marker saving */
- jpeg_saved_marker_ptr cur_marker; /* NULL if not processing a marker */
- unsigned int bytes_read; /* data bytes read so far in marker */
- /* Note: cur_marker is not linked into marker_list until it's all read. */
-} my_marker_reader;
-
-typedef my_marker_reader * my_marker_ptr;
-
-
-/*
- * Macros for fetching data from the data source module.
- *
- * At all times, cinfo->src->next_input_byte and ->bytes_in_buffer reflect
- * the current restart point; we update them only when we have reached a
- * suitable place to restart if a suspension occurs.
- */
-
-/* Declare and initialize local copies of input pointer/count */
-#define INPUT_VARS(cinfo) \
- struct jpeg_source_mgr * datasrc = (cinfo)->src; \
- const JOCTET * next_input_byte = datasrc->next_input_byte; \
- size_t bytes_in_buffer = datasrc->bytes_in_buffer
-
-/* Unload the local copies --- do this only at a restart boundary */
-#define INPUT_SYNC(cinfo) \
- ( datasrc->next_input_byte = next_input_byte, \
- datasrc->bytes_in_buffer = bytes_in_buffer )
-
-/* Reload the local copies --- used only in MAKE_BYTE_AVAIL */
-#define INPUT_RELOAD(cinfo) \
- ( next_input_byte = datasrc->next_input_byte, \
- bytes_in_buffer = datasrc->bytes_in_buffer )
-
-/* Internal macro for INPUT_BYTE and INPUT_2BYTES: make a byte available.
- * Note we do *not* do INPUT_SYNC before calling fill_input_buffer,
- * but we must reload the local copies after a successful fill.
- */
-#define MAKE_BYTE_AVAIL(cinfo,action) \
- if (bytes_in_buffer == 0) { \
- if (! (*datasrc->fill_input_buffer) (cinfo)) \
- { action; } \
- INPUT_RELOAD(cinfo); \
- }
-
-/* Read a byte into variable V.
- * If must suspend, take the specified action (typically "return FALSE").
- */
-#define INPUT_BYTE(cinfo,V,action) \
- MAKESTMT( MAKE_BYTE_AVAIL(cinfo,action); \
- bytes_in_buffer--; \
- V = GETJOCTET(*next_input_byte++); )
-
-/* As above, but read two bytes interpreted as an unsigned 16-bit integer.
- * V should be declared unsigned int or perhaps INT32.
- */
-#define INPUT_2BYTES(cinfo,V,action) \
- MAKESTMT( MAKE_BYTE_AVAIL(cinfo,action); \
- bytes_in_buffer--; \
- V = ((unsigned int) GETJOCTET(*next_input_byte++)) << 8; \
- MAKE_BYTE_AVAIL(cinfo,action); \
- bytes_in_buffer--; \
- V += GETJOCTET(*next_input_byte++); )
-
-
-/*
- * Routines to process JPEG markers.
- *
- * Entry condition: JPEG marker itself has been read and its code saved
- * in cinfo->unread_marker; input restart point is just after the marker.
- *
- * Exit: if return TRUE, have read and processed any parameters, and have
- * updated the restart point to point after the parameters.
- * If return FALSE, was forced to suspend before reaching end of
- * marker parameters; restart point has not been moved. Same routine
- * will be called again after application supplies more input data.
- *
- * This approach to suspension assumes that all of a marker's parameters
- * can fit into a single input bufferload. This should hold for "normal"
- * markers. Some COM/APPn markers might have large parameter segments
- * that might not fit. If we are simply dropping such a marker, we use
- * skip_input_data to get past it, and thereby put the problem on the
- * source manager's shoulders. If we are saving the marker's contents
- * into memory, we use a slightly different convention: when forced to
- * suspend, the marker processor updates the restart point to the end of
- * what it's consumed (ie, the end of the buffer) before returning FALSE.
- * On resumption, cinfo->unread_marker still contains the marker code,
- * but the data source will point to the next chunk of marker data.
- * The marker processor must retain internal state to deal with this.
- *
- * Note that we don't bother to avoid duplicate trace messages if a
- * suspension occurs within marker parameters. Other side effects
- * require more care.
- */
-
-
-LOCAL(boolean)
-get_soi (j_decompress_ptr cinfo)
-/* Process an SOI marker */
-{
- int i;
-
- TRACEMS(cinfo, 1, JTRC_SOI);
-
- if (cinfo->marker->saw_SOI)
- ERREXIT(cinfo, JERR_SOI_DUPLICATE);
-
- /* Reset all parameters that are defined to be reset by SOI */
-
- for (i = 0; i < NUM_ARITH_TBLS; i++) {
- cinfo->arith_dc_L[i] = 0;
- cinfo->arith_dc_U[i] = 1;
- cinfo->arith_ac_K[i] = 5;
- }
- cinfo->restart_interval = 0;
-
- /* Set initial assumptions for colorspace etc */
-
- cinfo->jpeg_color_space = JCS_UNKNOWN;
- cinfo->CCIR601_sampling = FALSE; /* Assume non-CCIR sampling??? */
-
- cinfo->saw_JFIF_marker = FALSE;
- cinfo->JFIF_major_version = 1; /* set default JFIF APP0 values */
- cinfo->JFIF_minor_version = 1;
- cinfo->density_unit = 0;
- cinfo->X_density = 1;
- cinfo->Y_density = 1;
- cinfo->saw_Adobe_marker = FALSE;
- cinfo->Adobe_transform = 0;
-
- cinfo->marker->saw_SOI = TRUE;
-
- return TRUE;
-}
-
-
-LOCAL(boolean)
-get_sof (j_decompress_ptr cinfo, boolean is_prog, boolean is_arith)
-/* Process a SOFn marker */
-{
- INT32 length;
- int c, ci;
- jpeg_component_info * compptr;
- /* LiuSunliang added 20111209 */
- JDIMENSION image_width, image_height;
- INPUT_VARS(cinfo);
-
- cinfo->progressive_mode = is_prog;
- cinfo->arith_code = is_arith;
-
- INPUT_2BYTES(cinfo, length, return FALSE);
-
- INPUT_BYTE(cinfo, cinfo->data_precision, return FALSE);
- INPUT_2BYTES(cinfo, image_height, return FALSE);
- INPUT_2BYTES(cinfo, image_width, return FALSE);
- INPUT_BYTE(cinfo, cinfo->num_components, return FALSE);
-
- if (image_width <= JPEG_MAX_DIMENSION)
- cinfo->image_width = image_width;
-
- if (image_height <= JPEG_MAX_DIMENSION)
- cinfo->image_height = image_height;
-
- length -= 8;
-
- TRACEMS4(cinfo, 1, JTRC_SOF, cinfo->unread_marker,
- (int) cinfo->image_width, (int) cinfo->image_height,
- cinfo->num_components);
-
- if (cinfo->marker->saw_SOF)
- ERREXIT(cinfo, JERR_SOF_DUPLICATE);
-
- /* We don't support files in which the image height is initially specified */
- /* as 0 and is later redefined by DNL. As long as we have to check that, */
- /* might as well have a general sanity check. */
- if (cinfo->image_height <= 0 || cinfo->image_width <= 0
- || cinfo->num_components <= 0)
- ERREXIT(cinfo, JERR_EMPTY_IMAGE);
-
- if (length != (cinfo->num_components * 3))
- ERREXIT(cinfo, JERR_BAD_LENGTH);
-
- if (cinfo->comp_info == NULL) /* do only once, even if suspend */
- cinfo->comp_info = (jpeg_component_info *) (*cinfo->mem->alloc_small)
- ((j_common_ptr) cinfo, JPOOL_IMAGE,
- cinfo->num_components * SIZEOF(jpeg_component_info));
-
- for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
- ci++, compptr++) {
- compptr->component_index = ci;
- INPUT_BYTE(cinfo, compptr->component_id, return FALSE);
- /* XYQ 2008-03-25: Adobe CMYK JPEG has serious flaw: the K channel has same component id as C channel */
- {
- int i;
- for (i = 0; i < ci; i ++)
- if (compptr->component_id == cinfo->comp_info[i].component_id) break;
- if (i < ci)
- /* Found the error! We replace the id with something unlikely used elsewhere */
- compptr->component_id += 0xf0;
- }
- /* end of modification */
- INPUT_BYTE(cinfo, c, return FALSE);
- compptr->h_samp_factor = (c >> 4) & 15;
- compptr->v_samp_factor = (c ) & 15;
- INPUT_BYTE(cinfo, compptr->quant_tbl_no, return FALSE);
-
- TRACEMS4(cinfo, 1, JTRC_SOF_COMPONENT,
- compptr->component_id, compptr->h_samp_factor,
- compptr->v_samp_factor, compptr->quant_tbl_no);
- }
-
- cinfo->marker->saw_SOF = TRUE;
-
- INPUT_SYNC(cinfo);
- return TRUE;
-}
-
-
-LOCAL(boolean)
-get_sos (j_decompress_ptr cinfo)
-/* Process a SOS marker */
-{
- INT32 length;
- int i, ci, n, c, cc;
- jpeg_component_info * compptr;
- INPUT_VARS(cinfo);
-
- if (! cinfo->marker->saw_SOF)
- ERREXIT(cinfo, JERR_SOS_NO_SOF);
-
- INPUT_2BYTES(cinfo, length, return FALSE);
-
- INPUT_BYTE(cinfo, n, return FALSE); /* Number of components */
-
- TRACEMS1(cinfo, 1, JTRC_SOS, n);
-
- if (length != (n * 2 + 6) || n < 1 || n > MAX_COMPS_IN_SCAN)
- ERREXIT(cinfo, JERR_BAD_LENGTH);
-
- cinfo->comps_in_scan = n;
-
- /* Collect the component-spec parameters */
-
- for (i = 0; i < n; i++) {
- INPUT_BYTE(cinfo, cc, return FALSE);
- INPUT_BYTE(cinfo, c, return FALSE);
-
- /* XYQ 2008-03-25: Adobe CMYK JPEG has serious flaw: the K channel has same component id as C channel */
- {
- int j;
- for (j = 0; j < i; j ++)
- if (cc == cinfo->cur_comp_info[j]->component_id) break;
- if (j < i)
- /* found the error! */
- cc += 0xf0;
- }
- /* end of modification */
- for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
- ci++, compptr++) {
- if (cc == compptr->component_id)
- goto id_found;
- }
-
- ERREXIT1(cinfo, JERR_BAD_COMPONENT_ID, cc);
-
- id_found:
-
- cinfo->cur_comp_info[i] = compptr;
- compptr->dc_tbl_no = (c >> 4) & 15;
- compptr->ac_tbl_no = (c ) & 15;
-
- TRACEMS3(cinfo, 1, JTRC_SOS_COMPONENT, cc,
- compptr->dc_tbl_no, compptr->ac_tbl_no);
- /* This CSi (cc) should differ from the previous CSi */
- for (ci = 0; ci < i; ci++) {
- if (cinfo->cur_comp_info[ci] == compptr)
- ERREXIT1(cinfo, JERR_BAD_COMPONENT_ID, cc);
- }
- }
-
- /* Collect the additional scan parameters Ss, Se, Ah/Al. */
- INPUT_BYTE(cinfo, c, return FALSE);
- cinfo->Ss = c;
- INPUT_BYTE(cinfo, c, return FALSE);
- cinfo->Se = c;
- INPUT_BYTE(cinfo, c, return FALSE);
- cinfo->Ah = (c >> 4) & 15;
- cinfo->Al = (c ) & 15;
-
- TRACEMS4(cinfo, 1, JTRC_SOS_PARAMS, cinfo->Ss, cinfo->Se,
- cinfo->Ah, cinfo->Al);
-
- /* Prepare to scan data & restart markers */
- cinfo->marker->next_restart_num = 0;
-
- /* Count another SOS marker */
- cinfo->input_scan_number++;
-
- INPUT_SYNC(cinfo);
- return TRUE;
-}
-
-
-#ifdef D_ARITH_CODING_SUPPORTED
-
-LOCAL(boolean)
-get_dac (j_decompress_ptr cinfo)
-/* Process a DAC marker */
-{
- INT32 length;
- int index, val;
- INPUT_VARS(cinfo);
-
- INPUT_2BYTES(cinfo, length, return FALSE);
- length -= 2;
-
- while (length > 0) {
- INPUT_BYTE(cinfo, index, return FALSE);
- INPUT_BYTE(cinfo, val, return FALSE);
-
- length -= 2;
-
- TRACEMS2(cinfo, 1, JTRC_DAC, index, val);
-
- if (index < 0 || index >= (2*NUM_ARITH_TBLS))
- ERREXIT1(cinfo, JERR_DAC_INDEX, index);
-
- if (index >= NUM_ARITH_TBLS) { /* define AC table */
- cinfo->arith_ac_K[index-NUM_ARITH_TBLS] = (UINT8) val;
- } else { /* define DC table */
- cinfo->arith_dc_L[index] = (UINT8) (val & 0x0F);
- cinfo->arith_dc_U[index] = (UINT8) (val >> 4);
- if (cinfo->arith_dc_L[index] > cinfo->arith_dc_U[index])
- ERREXIT1(cinfo, JERR_DAC_VALUE, val);
- }
- }
-
- if (length != 0)
- ERREXIT(cinfo, JERR_BAD_LENGTH);
-
- INPUT_SYNC(cinfo);
- return TRUE;
-}
-
-#else /* ! D_ARITH_CODING_SUPPORTED */
-
-#define get_dac(cinfo) skip_variable(cinfo)
-
-#endif /* D_ARITH_CODING_SUPPORTED */
-
-
-LOCAL(boolean)
-get_dht (j_decompress_ptr cinfo)
-/* Process a DHT marker */
-{
- INT32 length;
- UINT8 bits[17];
- UINT8 huffval[256];
- int i, index, count;
- JHUFF_TBL **htblptr;
- INPUT_VARS(cinfo);
-
- INPUT_2BYTES(cinfo, length, return FALSE);
- length -= 2;
-
- while (length > 16) {
- INPUT_BYTE(cinfo, index, return FALSE);
-
- TRACEMS1(cinfo, 1, JTRC_DHT, index);
-
- bits[0] = 0;
- count = 0;
- for (i = 1; i <= 16; i++) {
- INPUT_BYTE(cinfo, bits[i], return FALSE);
- count += bits[i];
- }
-
- length -= 1 + 16;
-
- TRACEMS8(cinfo, 2, JTRC_HUFFBITS,
- bits[1], bits[2], bits[3], bits[4],
- bits[5], bits[6], bits[7], bits[8]);
- TRACEMS8(cinfo, 2, JTRC_HUFFBITS,
- bits[9], bits[10], bits[11], bits[12],
- bits[13], bits[14], bits[15], bits[16]);
-
- /* Here we just do minimal validation of the counts to avoid walking
- * off the end of our table space. jdhuff.c will check more carefully.
- */
- if (count > 256 || ((INT32) count) > length)
- ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
-
- for (i = 0; i < count; i++)
- INPUT_BYTE(cinfo, huffval[i], return FALSE);
-
- length -= count;
-
- if (index & 0x10) { /* AC table definition */
- index -= 0x10;
- htblptr = &cinfo->ac_huff_tbl_ptrs[index];
- } else { /* DC table definition */
- htblptr = &cinfo->dc_huff_tbl_ptrs[index];
- }
-
- if (index < 0 || index >= NUM_HUFF_TBLS)
- ERREXIT1(cinfo, JERR_DHT_INDEX, index);
-
- if (*htblptr == NULL)
- *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);
-
- MEMCOPY((*htblptr)->bits, bits, SIZEOF((*htblptr)->bits));
- MEMCOPY((*htblptr)->huffval, huffval, SIZEOF((*htblptr)->huffval));
- }
-
- if (length != 0)
- ERREXIT(cinfo, JERR_BAD_LENGTH);
-
- INPUT_SYNC(cinfo);
- return TRUE;
-}
-
-
-LOCAL(boolean)
-get_dqt (j_decompress_ptr cinfo)
-/* Process a DQT marker */
-{
- INT32 length;
- int n, i, prec;
- unsigned int tmp;
- JQUANT_TBL *quant_ptr;
- INPUT_VARS(cinfo);
-
- INPUT_2BYTES(cinfo, length, return FALSE);
- length -= 2;
-
- while (length > 0) {
- INPUT_BYTE(cinfo, n, return FALSE);
- prec = n >> 4;
- n &= 0x0F;
-
- TRACEMS2(cinfo, 1, JTRC_DQT, n, prec);
-
- if (n >= NUM_QUANT_TBLS)
- ERREXIT1(cinfo, JERR_DQT_INDEX, n);
-
- if (cinfo->quant_tbl_ptrs[n] == NULL)
- cinfo->quant_tbl_ptrs[n] = jpeg_alloc_quant_table((j_common_ptr) cinfo);
- quant_ptr = cinfo->quant_tbl_ptrs[n];
-
- for (i = 0; i < DCTSIZE2; i++) {
- if (prec)
- INPUT_2BYTES(cinfo, tmp, return FALSE);
- else
- INPUT_BYTE(cinfo, tmp, return FALSE);
- /* We convert the zigzag-order table to natural array order. */
- quant_ptr->quantval[jpeg_natural_order[i]] = (UINT16) tmp;
- }
-
- if (cinfo->err->trace_level >= 2) {
- for (i = 0; i < DCTSIZE2; i += 8) {
- TRACEMS8(cinfo, 2, JTRC_QUANTVALS,
- quant_ptr->quantval[i], quant_ptr->quantval[i+1],
- quant_ptr->quantval[i+2], quant_ptr->quantval[i+3],
- quant_ptr->quantval[i+4], quant_ptr->quantval[i+5],
- quant_ptr->quantval[i+6], quant_ptr->quantval[i+7]);
- }
- }
-
- length -= DCTSIZE2+1;
- if (prec) length -= DCTSIZE2;
- }
-
- if (length != 0)
- ERREXIT(cinfo, JERR_BAD_LENGTH);
-
- INPUT_SYNC(cinfo);
- return TRUE;
-}
-
-
-LOCAL(boolean)
-get_dri (j_decompress_ptr cinfo)
-/* Process a DRI marker */
-{
- INT32 length;
- unsigned int tmp;
- INPUT_VARS(cinfo);
-
- INPUT_2BYTES(cinfo, length, return FALSE);
-
- if (length != 4)
- ERREXIT(cinfo, JERR_BAD_LENGTH);
-
- INPUT_2BYTES(cinfo, tmp, return FALSE);
-
- TRACEMS1(cinfo, 1, JTRC_DRI, tmp);
-
- cinfo->restart_interval = tmp;
-
- INPUT_SYNC(cinfo);
- return TRUE;
-}
-
-
-/*
- * Routines for processing APPn and COM markers.
- * These are either saved in memory or discarded, per application request.
- * APP0 and APP14 are specially checked to see if they are
- * JFIF and Adobe markers, respectively.
- */
-
-#define APP0_DATA_LEN 14 /* Length of interesting data in APP0 */
-#define APP14_DATA_LEN 12 /* Length of interesting data in APP14 */
-#define APPN_DATA_LEN 14 /* Must be the largest of the above!! */
-
-
-LOCAL(void)
-examine_app0 (j_decompress_ptr cinfo, JOCTET FAR * data,
- unsigned int datalen, INT32 remaining)
-/* Examine first few bytes from an APP0.
- * Take appropriate action if it is a JFIF marker.
- * datalen is # of bytes at data[], remaining is length of rest of marker data.
- */
-{
- INT32 totallen = (INT32) datalen + remaining;
-
- if (datalen >= APP0_DATA_LEN &&
- GETJOCTET(data[0]) == 0x4A &&
- GETJOCTET(data[1]) == 0x46 &&
- GETJOCTET(data[2]) == 0x49 &&
- GETJOCTET(data[3]) == 0x46 &&
- GETJOCTET(data[4]) == 0) {
- /* Found JFIF APP0 marker: save info */
- cinfo->saw_JFIF_marker = TRUE;
- cinfo->JFIF_major_version = GETJOCTET(data[5]);
- cinfo->JFIF_minor_version = GETJOCTET(data[6]);
- cinfo->density_unit = GETJOCTET(data[7]);
- cinfo->X_density = (GETJOCTET(data[8]) << 8) + GETJOCTET(data[9]);
- cinfo->Y_density = (GETJOCTET(data[10]) << 8) + GETJOCTET(data[11]);
- /* Check version.
- * Major version must be 1, anything else signals an incompatible change.
- * (We used to treat this as an error, but now it's a nonfatal warning,
- * because some bozo at Hijaak couldn't read the spec.)
- * Minor version should be 0..2, but process anyway if newer.
- */
- if (cinfo->JFIF_major_version != 1)
- WARNMS2(cinfo, JWRN_JFIF_MAJOR,
- cinfo->JFIF_major_version, cinfo->JFIF_minor_version);
- /* Generate trace messages */
- TRACEMS5(cinfo, 1, JTRC_JFIF,
- cinfo->JFIF_major_version, cinfo->JFIF_minor_version,
- cinfo->X_density, cinfo->Y_density, cinfo->density_unit);
- /* Validate thumbnail dimensions and issue appropriate messages */
- if (GETJOCTET(data[12]) | GETJOCTET(data[13]))
- TRACEMS2(cinfo, 1, JTRC_JFIF_THUMBNAIL,
- GETJOCTET(data[12]), GETJOCTET(data[13]));
- totallen -= APP0_DATA_LEN;
- if (totallen !=
- ((INT32)GETJOCTET(data[12]) * (INT32)GETJOCTET(data[13]) * (INT32) 3))
- TRACEMS1(cinfo, 1, JTRC_JFIF_BADTHUMBNAILSIZE, (int) totallen);
- } else if (datalen >= 6 &&
- GETJOCTET(data[0]) == 0x4A &&
- GETJOCTET(data[1]) == 0x46 &&
- GETJOCTET(data[2]) == 0x58 &&
- GETJOCTET(data[3]) == 0x58 &&
- GETJOCTET(data[4]) == 0) {
- /* Found JFIF "JFXX" extension APP0 marker */
- /* The library doesn't actually do anything with these,
- * but we try to produce a helpful trace message.
- */
- switch (GETJOCTET(data[5])) {
- case 0x10:
- TRACEMS1(cinfo, 1, JTRC_THUMB_JPEG, (int) totallen);
- break;
- case 0x11:
- TRACEMS1(cinfo, 1, JTRC_THUMB_PALETTE, (int) totallen);
- break;
- case 0x13:
- TRACEMS1(cinfo, 1, JTRC_THUMB_RGB, (int) totallen);
- break;
- default:
- TRACEMS2(cinfo, 1, JTRC_JFIF_EXTENSION,
- GETJOCTET(data[5]), (int) totallen);
- break;
- }
- } else {
- /* Start of APP0 does not match "JFIF" or "JFXX", or too short */
- TRACEMS1(cinfo, 1, JTRC_APP0, (int) totallen);
- }
-}
-
-
-LOCAL(void)
-examine_app14 (j_decompress_ptr cinfo, JOCTET FAR * data,
- unsigned int datalen, INT32 remaining)
-/* Examine first few bytes from an APP14.
- * Take appropriate action if it is an Adobe marker.
- * datalen is # of bytes at data[], remaining is length of rest of marker data.
- */
-{
- unsigned int version, flags0, flags1, transform;
-
- if (datalen >= APP14_DATA_LEN &&
- GETJOCTET(data[0]) == 0x41 &&
- GETJOCTET(data[1]) == 0x64 &&
- GETJOCTET(data[2]) == 0x6F &&
- GETJOCTET(data[3]) == 0x62 &&
- GETJOCTET(data[4]) == 0x65) {
- /* Found Adobe APP14 marker */
- version = (GETJOCTET(data[5]) << 8) + GETJOCTET(data[6]);
- flags0 = (GETJOCTET(data[7]) << 8) + GETJOCTET(data[8]);
- flags1 = (GETJOCTET(data[9]) << 8) + GETJOCTET(data[10]);
- transform = GETJOCTET(data[11]);
- TRACEMS4(cinfo, 1, JTRC_ADOBE, version, flags0, flags1, transform);
- cinfo->saw_Adobe_marker = TRUE;
- cinfo->Adobe_transform = (UINT8) transform;
- } else {
- /* Start of APP14 does not match "Adobe", or too short */
- TRACEMS1(cinfo, 1, JTRC_APP14, (int) (datalen + remaining));
- }
-}
-
-
-METHODDEF(boolean)
-get_interesting_appn (j_decompress_ptr cinfo)
-/* Process an APP0 or APP14 marker without saving it */
-{
- INT32 length;
- JOCTET b[APPN_DATA_LEN];
- unsigned int i, numtoread;
- INPUT_VARS(cinfo);
-
- INPUT_2BYTES(cinfo, length, return FALSE);
- length -= 2;
-
- /* get the interesting part of the marker data */
- if (length >= APPN_DATA_LEN)
- numtoread = APPN_DATA_LEN;
- else if (length > 0)
- numtoread = (unsigned int) length;
- else
- numtoread = 0;
- for (i = 0; i < numtoread; i++)
- INPUT_BYTE(cinfo, b[i], return FALSE);
- length -= numtoread;
-
- /* process it */
- switch (cinfo->unread_marker) {
- case M_APP0:
- examine_app0(cinfo, (JOCTET FAR *) b, numtoread, length);
- break;
- case M_APP14:
- examine_app14(cinfo, (JOCTET FAR *) b, numtoread, length);
- break;
- default:
- /* can't get here unless jpeg_save_markers chooses wrong processor */
- ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, cinfo->unread_marker);
- break;
- }
-
- /* skip any remaining data -- could be lots */
- INPUT_SYNC(cinfo);
- if (length > 0)
- (*cinfo->src->skip_input_data) (cinfo, (long) length);
-
- return TRUE;
-}
-
-
-#ifdef SAVE_MARKERS_SUPPORTED
-
-METHODDEF(boolean)
-save_marker (j_decompress_ptr cinfo)
-/* Save an APPn or COM marker into the marker list */
-{
- my_marker_ptr marker = (my_marker_ptr) cinfo->marker;
- jpeg_saved_marker_ptr cur_marker = marker->cur_marker;
- unsigned int bytes_read, data_length;
- JOCTET FAR * data;
- INT32 length = 0;
- INPUT_VARS(cinfo);
-
- if (cur_marker == NULL) {
- /* begin reading a marker */
- INPUT_2BYTES(cinfo, length, return FALSE);
- length -= 2;
- if (length >= 0) { /* watch out for bogus length word */
- /* figure out how much we want to save */
- unsigned int limit;
- if (cinfo->unread_marker == (int) M_COM)
- limit = marker->length_limit_COM;
- else
- limit = marker->length_limit_APPn[cinfo->unread_marker - (int) M_APP0];
- if ((unsigned int) length < limit)
- limit = (unsigned int) length;
- /* allocate and initialize the marker item */
- cur_marker = (jpeg_saved_marker_ptr)
- (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- SIZEOF(struct jpeg_marker_struct) + limit);
- cur_marker->next = NULL;
- cur_marker->marker = (UINT8) cinfo->unread_marker;
- cur_marker->original_length = (unsigned int) length;
- cur_marker->data_length = limit;
- /* data area is just beyond the jpeg_marker_struct */
- data = cur_marker->data = (JOCTET FAR *) (cur_marker + 1);
- marker->cur_marker = cur_marker;
- marker->bytes_read = 0;
- bytes_read = 0;
- data_length = limit;
- } else {
- /* deal with bogus length word */
- bytes_read = data_length = 0;
- data = NULL;
- }
- } else {
- /* resume reading a marker */
- bytes_read = marker->bytes_read;
- data_length = cur_marker->data_length;
- data = cur_marker->data + bytes_read;
- }
-
- while (bytes_read < data_length) {
- INPUT_SYNC(cinfo); /* move the restart point to here */
- marker->bytes_read = bytes_read;
- /* If there's not at least one byte in buffer, suspend */
- MAKE_BYTE_AVAIL(cinfo, return FALSE);
- /* Copy bytes with reasonable rapidity */
- while (bytes_read < data_length && bytes_in_buffer > 0) {
- *data++ = *next_input_byte++;
- bytes_in_buffer--;
- bytes_read++;
- }
- }
-
- /* Done reading what we want to read */
- if (cur_marker != NULL) { /* will be NULL if bogus length word */
- /* Add new marker to end of list */
- if (cinfo->marker_list == NULL) {
- cinfo->marker_list = cur_marker;
- } else {
- jpeg_saved_marker_ptr prev = cinfo->marker_list;
- while (prev->next != NULL)
- prev = prev->next;
- prev->next = cur_marker;
- }
- /* Reset pointer & calc remaining data length */
- data = cur_marker->data;
- length = cur_marker->original_length - data_length;
- }
- /* Reset to initial state for next marker */
- marker->cur_marker = NULL;
-
- /* Process the marker if interesting; else just make a generic trace msg */
- switch (cinfo->unread_marker) {
- case M_APP0:
- examine_app0(cinfo, data, data_length, length);
- break;
- case M_APP14:
- examine_app14(cinfo, data, data_length, length);
- break;
- default:
- TRACEMS2(cinfo, 1, JTRC_MISC_MARKER, cinfo->unread_marker,
- (int) (data_length + length));
- break;
- }
-
- /* skip any remaining data -- could be lots */
- INPUT_SYNC(cinfo); /* do before skip_input_data */
- if (length > 0)
- (*cinfo->src->skip_input_data) (cinfo, (long) length);
-
- return TRUE;
-}
-
-#endif /* SAVE_MARKERS_SUPPORTED */
-
-
-METHODDEF(boolean)
-skip_variable (j_decompress_ptr cinfo)
-/* Skip over an unknown or uninteresting variable-length marker */
-{
- INT32 length;
- INPUT_VARS(cinfo);
-
- INPUT_2BYTES(cinfo, length, return FALSE);
- length -= 2;
-
- TRACEMS2(cinfo, 1, JTRC_MISC_MARKER, cinfo->unread_marker, (int) length);
-
- INPUT_SYNC(cinfo); /* do before skip_input_data */
- if (length > 0)
- (*cinfo->src->skip_input_data) (cinfo, (long) length);
-
- return TRUE;
-}
-
-
-/*
- * Find the next JPEG marker, save it in cinfo->unread_marker.
- * Returns FALSE if had to suspend before reaching a marker;
- * in that case cinfo->unread_marker is unchanged.
- *
- * Note that the result might not be a valid marker code,
- * but it will never be 0 or FF.
- */
-
-LOCAL(boolean)
-next_marker (j_decompress_ptr cinfo)
-{
- int c;
- INPUT_VARS(cinfo);
-
- for (;;) {
- INPUT_BYTE(cinfo, c, return FALSE);
- /* Skip any non-FF bytes.
- * This may look a bit inefficient, but it will not occur in a valid file.
- * We sync after each discarded byte so that a suspending data source
- * can discard the byte from its buffer.
- */
- while (c != 0xFF) {
- cinfo->marker->discarded_bytes++;
- INPUT_SYNC(cinfo);
- INPUT_BYTE(cinfo, c, return FALSE);
- }
- /* This loop swallows any duplicate FF bytes. Extra FFs are legal as
- * pad bytes, so don't count them in discarded_bytes. We assume there
- * will not be so many consecutive FF bytes as to overflow a suspending
- * data source's input buffer.
- */
- do {
- INPUT_BYTE(cinfo, c, return FALSE);
- } while (c == 0xFF);
- if (c != 0)
- break; /* found a valid marker, exit loop */
- /* Reach here if we found a stuffed-zero data sequence (FF/00).
- * Discard it and loop back to try again.
- */
- cinfo->marker->discarded_bytes += 2;
- INPUT_SYNC(cinfo);
- }
-
- if (cinfo->marker->discarded_bytes != 0) {
- WARNMS2(cinfo, JWRN_EXTRANEOUS_DATA, cinfo->marker->discarded_bytes, c);
- cinfo->marker->discarded_bytes = 0;
- }
-
- cinfo->unread_marker = c;
-
- INPUT_SYNC(cinfo);
- return TRUE;
-}
-
-
-LOCAL(boolean)
-first_marker (j_decompress_ptr cinfo)
-/* Like next_marker, but used to obtain the initial SOI marker. */
-/* For this marker, we do not allow preceding garbage or fill; otherwise,
- * we might well scan an entire input file before realizing it ain't JPEG.
- * If an application wants to process non-JFIF files, it must seek to the
- * SOI before calling the JPEG library.
- */
-{
- int c, c2;
- INPUT_VARS(cinfo);
-
- INPUT_BYTE(cinfo, c, return FALSE);
- INPUT_BYTE(cinfo, c2, return FALSE);
- if (c != 0xFF || c2 != (int) M_SOI)
- ERREXIT2(cinfo, JERR_NO_SOI, c, c2);
-
- cinfo->unread_marker = c2;
-
- INPUT_SYNC(cinfo);
- return TRUE;
-}
-
-
-/*
- * Read markers until SOS or EOI.
- *
- * Returns same codes as are defined for jpeg_consume_input:
- * JPEG_SUSPENDED, JPEG_REACHED_SOS, or JPEG_REACHED_EOI.
- */
-
-METHODDEF(int)
-read_markers (j_decompress_ptr cinfo)
-{
- /* Outer loop repeats once for each marker. */
- for (;;) {
- /* Collect the marker proper, unless we already did. */
- /* NB: first_marker() enforces the requirement that SOI appear first. */
- if (cinfo->unread_marker == 0) {
- if (! cinfo->marker->saw_SOI) {
- if (! first_marker(cinfo))
- return JPEG_SUSPENDED;
- } else {
- if (! next_marker(cinfo))
- return JPEG_SUSPENDED;
- }
- }
- /* At this point cinfo->unread_marker contains the marker code and the
- * input point is just past the marker proper, but before any parameters.
- * A suspension will cause us to return with this state still true.
- */
- switch (cinfo->unread_marker) {
- case M_SOI:
- if (! get_soi(cinfo))
- return JPEG_SUSPENDED;
- break;
-
- case M_SOF0: /* Baseline */
- case M_SOF1: /* Extended sequential, Huffman */
- if (! get_sof(cinfo, FALSE, FALSE))
- return JPEG_SUSPENDED;
- break;
-
- case M_SOF2: /* Progressive, Huffman */
- if (! get_sof(cinfo, TRUE, FALSE))
- return JPEG_SUSPENDED;
- break;
-
- case M_SOF9: /* Extended sequential, arithmetic */
- if (! get_sof(cinfo, FALSE, TRUE))
- return JPEG_SUSPENDED;
- break;
-
- case M_SOF10: /* Progressive, arithmetic */
- if (! get_sof(cinfo, TRUE, TRUE))
- return JPEG_SUSPENDED;
- break;
-
- /* Currently unsupported SOFn types */
- case M_SOF3: /* Lossless, Huffman */
- case M_SOF5: /* Differential sequential, Huffman */
- case M_SOF6: /* Differential progressive, Huffman */
- case M_SOF7: /* Differential lossless, Huffman */
- case M_JPG: /* Reserved for JPEG extensions */
- case M_SOF11: /* Lossless, arithmetic */
- case M_SOF13: /* Differential sequential, arithmetic */
- case M_SOF14: /* Differential progressive, arithmetic */
- case M_SOF15: /* Differential lossless, arithmetic */
- ERREXIT1(cinfo, JERR_SOF_UNSUPPORTED, cinfo->unread_marker);
- break;
-
- case M_SOS:
- if (! get_sos(cinfo))
- return JPEG_SUSPENDED;
- cinfo->unread_marker = 0; /* processed the marker */
- return JPEG_REACHED_SOS;
-
- case M_EOI:
- TRACEMS(cinfo, 1, JTRC_EOI);
- cinfo->unread_marker = 0; /* processed the marker */
- return JPEG_REACHED_EOI;
-
- case M_DAC:
- if (! get_dac(cinfo))
- return JPEG_SUSPENDED;
- break;
-
- case M_DHT:
- if (! get_dht(cinfo))
- return JPEG_SUSPENDED;
- break;
-
- case M_DQT:
- if (! get_dqt(cinfo))
- return JPEG_SUSPENDED;
- break;
-
- case M_DRI:
- if (! get_dri(cinfo))
- return JPEG_SUSPENDED;
- break;
-
- case M_APP0:
- case M_APP1:
- case M_APP2:
- case M_APP3:
- case M_APP4:
- case M_APP5:
- case M_APP6:
- case M_APP7:
- case M_APP8:
- case M_APP9:
- case M_APP10:
- case M_APP11:
- case M_APP12:
- case M_APP13:
- case M_APP14:
- case M_APP15:
- if (! (*((my_marker_ptr) cinfo->marker)->process_APPn[
- cinfo->unread_marker - (int) M_APP0]) (cinfo))
- return JPEG_SUSPENDED;
- break;
-
- case M_COM:
- if (! (*((my_marker_ptr) cinfo->marker)->process_COM) (cinfo))
- return JPEG_SUSPENDED;
- break;
-
- case M_RST0: /* these are all parameterless */
- case M_RST1:
- case M_RST2:
- case M_RST3:
- case M_RST4:
- case M_RST5:
- case M_RST6:
- case M_RST7:
- case M_TEM:
- TRACEMS1(cinfo, 1, JTRC_PARMLESS_MARKER, cinfo->unread_marker);
- break;
-
- case M_DNL: /* Ignore DNL ... perhaps the wrong thing */
- if (! skip_variable(cinfo))
- return JPEG_SUSPENDED;
- break;
-
- default: /* must be DHP, EXP, JPGn, or RESn */
- /* For now, we treat the reserved markers as fatal errors since they are
- * likely to be used to signal incompatible JPEG Part 3 extensions.
- * Once the JPEG 3 version-number marker is well defined, this code
- * ought to change!
- */
- ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, cinfo->unread_marker);
- break;
- }
- /* Successfully processed marker, so reset state variable */
- cinfo->unread_marker = 0;
- } /* end loop */
-}
-
-
-/*
- * Read a restart marker, which is expected to appear next in the datastream;
- * if the marker is not there, take appropriate recovery action.
- * Returns FALSE if suspension is required.
- *
- * This is called by the entropy decoder after it has read an appropriate
- * number of MCUs. cinfo->unread_marker may be nonzero if the entropy decoder
- * has already read a marker from the data source. Under normal conditions
- * cinfo->unread_marker will be reset to 0 before returning; if not reset,
- * it holds a marker which the decoder will be unable to read past.
- */
-
-METHODDEF(boolean)
-read_restart_marker (j_decompress_ptr cinfo)
-{
- /* Obtain a marker unless we already did. */
- /* Note that next_marker will complain if it skips any data. */
- if (cinfo->unread_marker == 0) {
- if (! next_marker(cinfo))
- return FALSE;
- }
-
- if (cinfo->unread_marker ==
- ((int) M_RST0 + cinfo->marker->next_restart_num)) {
- /* Normal case --- swallow the marker and let entropy decoder continue */
- TRACEMS1(cinfo, 3, JTRC_RST, cinfo->marker->next_restart_num);
- cinfo->unread_marker = 0;
- } else {
- /* Uh-oh, the restart markers have been messed up. */
- /* Let the data source manager determine how to resync. */
- if (! (*cinfo->src->resync_to_restart) (cinfo,
- cinfo->marker->next_restart_num))
- return FALSE;
- }
-
- /* Update next-restart state */
- cinfo->marker->next_restart_num = (cinfo->marker->next_restart_num + 1) & 7;
-
- return TRUE;
-}
-
-
-/*
- * This is the default resync_to_restart method for data source managers
- * to use if they don't have any better approach. Some data source managers
- * may be able to back up, or may have additional knowledge about the data
- * which permits a more intelligent recovery strategy; such managers would
- * presumably supply their own resync method.
- *
- * read_restart_marker calls resync_to_restart if it finds a marker other than
- * the restart marker it was expecting. (This code is *not* used unless
- * a nonzero restart interval has been declared.) cinfo->unread_marker is
- * the marker code actually found (might be anything, except 0 or FF).
- * The desired restart marker number (0..7) is passed as a parameter.
- * This routine is supposed to apply whatever error recovery strategy seems
- * appropriate in order to position the input stream to the next data segment.
- * Note that cinfo->unread_marker is treated as a marker appearing before
- * the current data-source input point; usually it should be reset to zero
- * before returning.
- * Returns FALSE if suspension is required.
- *
- * This implementation is substantially constrained by wanting to treat the
- * input as a data stream; this means we can't back up. Therefore, we have
- * only the following actions to work with:
- * 1. Simply discard the marker and let the entropy decoder resume at next
- * byte of file.
- * 2. Read forward until we find another marker, discarding intervening
- * data. (In theory we could look ahead within the current bufferload,
- * without having to discard data if we don't find the desired marker.
- * This idea is not implemented here, in part because it makes behavior
- * dependent on buffer size and chance buffer-boundary positions.)
- * 3. Leave the marker unread (by failing to zero cinfo->unread_marker).
- * This will cause the entropy decoder to process an empty data segment,
- * inserting dummy zeroes, and then we will reprocess the marker.
- *
- * #2 is appropriate if we think the desired marker lies ahead, while #3 is
- * appropriate if the found marker is a future restart marker (indicating
- * that we have missed the desired restart marker, probably because it got
- * corrupted).
- * We apply #2 or #3 if the found marker is a restart marker no more than
- * two counts behind or ahead of the expected one. We also apply #2 if the
- * found marker is not a legal JPEG marker code (it's certainly bogus data).
- * If the found marker is a restart marker more than 2 counts away, we do #1
- * (too much risk that the marker is erroneous; with luck we will be able to
- * resync at some future point).
- * For any valid non-restart JPEG marker, we apply #3. This keeps us from
- * overrunning the end of a scan. An implementation limited to single-scan
- * files might find it better to apply #2 for markers other than EOI, since
- * any other marker would have to be bogus data in that case.
- */
-
-GLOBAL(boolean)
-jpeg_resync_to_restart (j_decompress_ptr cinfo, int desired)
-{
- int marker = cinfo->unread_marker;
- int action = 1;
-
- /* Always put up a warning. */
- WARNMS2(cinfo, JWRN_MUST_RESYNC, marker, desired);
-
- /* Outer loop handles repeated decision after scanning forward. */
- for (;;) {
- if (marker < (int) M_SOF0)
- action = 2; /* invalid marker */
- else if (marker < (int) M_RST0 || marker > (int) M_RST7)
- action = 3; /* valid non-restart marker */
- else {
- if (marker == ((int) M_RST0 + ((desired+1) & 7)) ||
- marker == ((int) M_RST0 + ((desired+2) & 7)))
- action = 3; /* one of the next two expected restarts */
- else if (marker == ((int) M_RST0 + ((desired-1) & 7)) ||
- marker == ((int) M_RST0 + ((desired-2) & 7)))
- action = 2; /* a prior restart, so advance */
- else
- action = 1; /* desired restart or too far away */
- }
- TRACEMS2(cinfo, 4, JTRC_RECOVERY_ACTION, marker, action);
- switch (action) {
- case 1:
- /* Discard marker and let entropy decoder resume processing. */
- cinfo->unread_marker = 0;
- return TRUE;
- case 2:
- /* Scan to the next marker, and repeat the decision loop. */
- if (! next_marker(cinfo))
- return FALSE;
- marker = cinfo->unread_marker;
- break;
- case 3:
- /* Return without advancing past this marker. */
- /* Entropy decoder will be forced to process an empty segment. */
- return TRUE;
- }
- } /* end loop */
-}
-
-
-/*
- * Reset marker processing state to begin a fresh datastream.
- */
-
-METHODDEF(void)
-reset_marker_reader (j_decompress_ptr cinfo)
-{
- my_marker_ptr marker = (my_marker_ptr) cinfo->marker;
-
- cinfo->comp_info = NULL; /* until allocated by get_sof */
- cinfo->input_scan_number = 0; /* no SOS seen yet */
- cinfo->unread_marker = 0; /* no pending marker */
- marker->pub.saw_SOI = FALSE; /* set internal state too */
- marker->pub.saw_SOF = FALSE;
- marker->pub.discarded_bytes = 0;
- marker->cur_marker = NULL;
-}
-
-
-/*
- * Initialize the marker reader module.
- * This is called only once, when the decompression object is created.
- */
-
-GLOBAL(void)
-jinit_marker_reader (j_decompress_ptr cinfo)
-{
- my_marker_ptr marker;
- int i;
-
- /* Create subobject in permanent pool */
- marker = (my_marker_ptr)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
- SIZEOF(my_marker_reader));
- cinfo->marker = (struct jpeg_marker_reader *) marker;
- /* Initialize public method pointers */
- marker->pub.reset_marker_reader = reset_marker_reader;
- marker->pub.read_markers = read_markers;
- marker->pub.read_restart_marker = read_restart_marker;
- /* Initialize COM/APPn processing.
- * By default, we examine and then discard APP0 and APP14,
- * but simply discard COM and all other APPn.
- */
- marker->process_COM = skip_variable;
- marker->length_limit_COM = 0;
- for (i = 0; i < 16; i++) {
- marker->process_APPn[i] = skip_variable;
- marker->length_limit_APPn[i] = 0;
- }
- marker->process_APPn[0] = get_interesting_appn;
- marker->process_APPn[14] = get_interesting_appn;
- /* Reset marker processing state */
- reset_marker_reader(cinfo);
-}
-
-
-/*
- * Control saving of COM and APPn markers into marker_list.
- */
-
-#ifdef SAVE_MARKERS_SUPPORTED
-
-GLOBAL(void)
-jpeg_save_markers (j_decompress_ptr cinfo, int marker_code,
- unsigned int length_limit)
-{
- my_marker_ptr marker = (my_marker_ptr) cinfo->marker;
- long maxlength;
- jpeg_marker_parser_method processor;
-
- /* Length limit mustn't be larger than what we can allocate
- * (should only be a concern in a 16-bit environment).
- */
- maxlength = cinfo->mem->max_alloc_chunk - SIZEOF(struct jpeg_marker_struct);
- if (((long) length_limit) > maxlength)
- length_limit = (unsigned int) maxlength;
-
- /* Choose processor routine to use.
- * APP0/APP14 have special requirements.
- */
- if (length_limit) {
- processor = save_marker;
- /* If saving APP0/APP14, save at least enough for our internal use. */
- if (marker_code == (int) M_APP0 && length_limit < APP0_DATA_LEN)
- length_limit = APP0_DATA_LEN;
- else if (marker_code == (int) M_APP14 && length_limit < APP14_DATA_LEN)
- length_limit = APP14_DATA_LEN;
- } else {
- processor = skip_variable;
- /* If discarding APP0/APP14, use our regular on-the-fly processor. */
- if (marker_code == (int) M_APP0 || marker_code == (int) M_APP14)
- processor = get_interesting_appn;
- }
-
- if (marker_code == (int) M_COM) {
- marker->process_COM = processor;
- marker->length_limit_COM = length_limit;
- } else if (marker_code >= (int) M_APP0 && marker_code <= (int) M_APP15) {
- marker->process_APPn[marker_code - (int) M_APP0] = processor;
- marker->length_limit_APPn[marker_code - (int) M_APP0] = length_limit;
- } else
- ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, marker_code);
-}
-
-#endif /* SAVE_MARKERS_SUPPORTED */
-
-
-/*
- * Install a special processing method for COM or APPn markers.
- */
-
-GLOBAL(void)
-jpeg_set_marker_processor (j_decompress_ptr cinfo, int marker_code,
- jpeg_marker_parser_method routine)
-{
- my_marker_ptr marker = (my_marker_ptr) cinfo->marker;
-
- if (marker_code == (int) M_COM)
- marker->process_COM = routine;
- else if (marker_code >= (int) M_APP0 && marker_code <= (int) M_APP15)
- marker->process_APPn[marker_code - (int) M_APP0] = routine;
- else
- ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, marker_code);
-}
-
-#endif //_FX_JPEG_TURBO_
+#if !defined(_FX_JPEG_TURBO_)
+/*
+ * jdmarker.c
+ *
+ * Copyright (C) 1991-1998, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains routines to decode JPEG datastream markers.
+ * Most of the complexity arises from our desire to support input
+ * suspension: if not all of the data for a marker is available,
+ * we must exit back to the application. On resumption, we reprocess
+ * the marker.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+
+
+typedef enum { /* JPEG marker codes */
+ M_SOF0 = 0xc0,
+ M_SOF1 = 0xc1,
+ M_SOF2 = 0xc2,
+ M_SOF3 = 0xc3,
+
+ M_SOF5 = 0xc5,
+ M_SOF6 = 0xc6,
+ M_SOF7 = 0xc7,
+
+ M_JPG = 0xc8,
+ M_SOF9 = 0xc9,
+ M_SOF10 = 0xca,
+ M_SOF11 = 0xcb,
+
+ M_SOF13 = 0xcd,
+ M_SOF14 = 0xce,
+ M_SOF15 = 0xcf,
+
+ M_DHT = 0xc4,
+
+ M_DAC = 0xcc,
+
+ M_RST0 = 0xd0,
+ M_RST1 = 0xd1,
+ M_RST2 = 0xd2,
+ M_RST3 = 0xd3,
+ M_RST4 = 0xd4,
+ M_RST5 = 0xd5,
+ M_RST6 = 0xd6,
+ M_RST7 = 0xd7,
+
+ M_SOI = 0xd8,
+ M_EOI = 0xd9,
+ M_SOS = 0xda,
+ M_DQT = 0xdb,
+ M_DNL = 0xdc,
+ M_DRI = 0xdd,
+ M_DHP = 0xde,
+ M_EXP = 0xdf,
+
+ M_APP0 = 0xe0,
+ M_APP1 = 0xe1,
+ M_APP2 = 0xe2,
+ M_APP3 = 0xe3,
+ M_APP4 = 0xe4,
+ M_APP5 = 0xe5,
+ M_APP6 = 0xe6,
+ M_APP7 = 0xe7,
+ M_APP8 = 0xe8,
+ M_APP9 = 0xe9,
+ M_APP10 = 0xea,
+ M_APP11 = 0xeb,
+ M_APP12 = 0xec,
+ M_APP13 = 0xed,
+ M_APP14 = 0xee,
+ M_APP15 = 0xef,
+
+ M_JPG0 = 0xf0,
+ M_JPG13 = 0xfd,
+ M_COM = 0xfe,
+
+ M_TEM = 0x01,
+
+ M_ERROR = 0x100
+} JPEG_MARKER;
+
+
+/* Private state */
+
+typedef struct {
+ struct jpeg_marker_reader pub; /* public fields */
+
+ /* Application-overridable marker processing methods */
+ jpeg_marker_parser_method process_COM;
+ jpeg_marker_parser_method process_APPn[16];
+
+ /* Limit on marker data length to save for each marker type */
+ unsigned int length_limit_COM;
+ unsigned int length_limit_APPn[16];
+
+ /* Status of COM/APPn marker saving */
+ jpeg_saved_marker_ptr cur_marker; /* NULL if not processing a marker */
+ unsigned int bytes_read; /* data bytes read so far in marker */
+ /* Note: cur_marker is not linked into marker_list until it's all read. */
+} my_marker_reader;
+
+typedef my_marker_reader * my_marker_ptr;
+
+
+/*
+ * Macros for fetching data from the data source module.
+ *
+ * At all times, cinfo->src->next_input_byte and ->bytes_in_buffer reflect
+ * the current restart point; we update them only when we have reached a
+ * suitable place to restart if a suspension occurs.
+ */
+
+/* Declare and initialize local copies of input pointer/count */
+#define INPUT_VARS(cinfo) \
+ struct jpeg_source_mgr * datasrc = (cinfo)->src; \
+ const JOCTET * next_input_byte = datasrc->next_input_byte; \
+ size_t bytes_in_buffer = datasrc->bytes_in_buffer
+
+/* Unload the local copies --- do this only at a restart boundary */
+#define INPUT_SYNC(cinfo) \
+ ( datasrc->next_input_byte = next_input_byte, \
+ datasrc->bytes_in_buffer = bytes_in_buffer )
+
+/* Reload the local copies --- used only in MAKE_BYTE_AVAIL */
+#define INPUT_RELOAD(cinfo) \
+ ( next_input_byte = datasrc->next_input_byte, \
+ bytes_in_buffer = datasrc->bytes_in_buffer )
+
+/* Internal macro for INPUT_BYTE and INPUT_2BYTES: make a byte available.
+ * Note we do *not* do INPUT_SYNC before calling fill_input_buffer,
+ * but we must reload the local copies after a successful fill.
+ */
+#define MAKE_BYTE_AVAIL(cinfo,action) \
+ if (bytes_in_buffer == 0) { \
+ if (! (*datasrc->fill_input_buffer) (cinfo)) \
+ { action; } \
+ INPUT_RELOAD(cinfo); \
+ }
+
+/* Read a byte into variable V.
+ * If must suspend, take the specified action (typically "return FALSE").
+ */
+#define INPUT_BYTE(cinfo,V,action) \
+ MAKESTMT( MAKE_BYTE_AVAIL(cinfo,action); \
+ bytes_in_buffer--; \
+ V = GETJOCTET(*next_input_byte++); )
+
+/* As above, but read two bytes interpreted as an unsigned 16-bit integer.
+ * V should be declared unsigned int or perhaps INT32.
+ */
+#define INPUT_2BYTES(cinfo,V,action) \
+ MAKESTMT( MAKE_BYTE_AVAIL(cinfo,action); \
+ bytes_in_buffer--; \
+ V = ((unsigned int) GETJOCTET(*next_input_byte++)) << 8; \
+ MAKE_BYTE_AVAIL(cinfo,action); \
+ bytes_in_buffer--; \
+ V += GETJOCTET(*next_input_byte++); )
+
+
+/*
+ * Routines to process JPEG markers.
+ *
+ * Entry condition: JPEG marker itself has been read and its code saved
+ * in cinfo->unread_marker; input restart point is just after the marker.
+ *
+ * Exit: if return TRUE, have read and processed any parameters, and have
+ * updated the restart point to point after the parameters.
+ * If return FALSE, was forced to suspend before reaching end of
+ * marker parameters; restart point has not been moved. Same routine
+ * will be called again after application supplies more input data.
+ *
+ * This approach to suspension assumes that all of a marker's parameters
+ * can fit into a single input bufferload. This should hold for "normal"
+ * markers. Some COM/APPn markers might have large parameter segments
+ * that might not fit. If we are simply dropping such a marker, we use
+ * skip_input_data to get past it, and thereby put the problem on the
+ * source manager's shoulders. If we are saving the marker's contents
+ * into memory, we use a slightly different convention: when forced to
+ * suspend, the marker processor updates the restart point to the end of
+ * what it's consumed (ie, the end of the buffer) before returning FALSE.
+ * On resumption, cinfo->unread_marker still contains the marker code,
+ * but the data source will point to the next chunk of marker data.
+ * The marker processor must retain internal state to deal with this.
+ *
+ * Note that we don't bother to avoid duplicate trace messages if a
+ * suspension occurs within marker parameters. Other side effects
+ * require more care.
+ */
+
+
+LOCAL(boolean)
+get_soi (j_decompress_ptr cinfo)
+/* Process an SOI marker */
+{
+ int i;
+
+ TRACEMS(cinfo, 1, JTRC_SOI);
+
+ if (cinfo->marker->saw_SOI)
+ ERREXIT(cinfo, JERR_SOI_DUPLICATE);
+
+ /* Reset all parameters that are defined to be reset by SOI */
+
+ for (i = 0; i < NUM_ARITH_TBLS; i++) {
+ cinfo->arith_dc_L[i] = 0;
+ cinfo->arith_dc_U[i] = 1;
+ cinfo->arith_ac_K[i] = 5;
+ }
+ cinfo->restart_interval = 0;
+
+ /* Set initial assumptions for colorspace etc */
+
+ cinfo->jpeg_color_space = JCS_UNKNOWN;
+ cinfo->CCIR601_sampling = FALSE; /* Assume non-CCIR sampling??? */
+
+ cinfo->saw_JFIF_marker = FALSE;
+ cinfo->JFIF_major_version = 1; /* set default JFIF APP0 values */
+ cinfo->JFIF_minor_version = 1;
+ cinfo->density_unit = 0;
+ cinfo->X_density = 1;
+ cinfo->Y_density = 1;
+ cinfo->saw_Adobe_marker = FALSE;
+ cinfo->Adobe_transform = 0;
+
+ cinfo->marker->saw_SOI = TRUE;
+
+ return TRUE;
+}
+
+
+LOCAL(boolean)
+get_sof (j_decompress_ptr cinfo, boolean is_prog, boolean is_arith)
+/* Process a SOFn marker */
+{
+ INT32 length;
+ int c, ci;
+ jpeg_component_info * compptr;
+ /* LiuSunliang added 20111209 */
+ JDIMENSION image_width, image_height;
+ INPUT_VARS(cinfo);
+
+ cinfo->progressive_mode = is_prog;
+ cinfo->arith_code = is_arith;
+
+ INPUT_2BYTES(cinfo, length, return FALSE);
+
+ INPUT_BYTE(cinfo, cinfo->data_precision, return FALSE);
+ INPUT_2BYTES(cinfo, image_height, return FALSE);
+ INPUT_2BYTES(cinfo, image_width, return FALSE);
+ INPUT_BYTE(cinfo, cinfo->num_components, return FALSE);
+
+ if (image_width <= JPEG_MAX_DIMENSION)
+ cinfo->image_width = image_width;
+
+ if (image_height <= JPEG_MAX_DIMENSION)
+ cinfo->image_height = image_height;
+
+ length -= 8;
+
+ TRACEMS4(cinfo, 1, JTRC_SOF, cinfo->unread_marker,
+ (int) cinfo->image_width, (int) cinfo->image_height,
+ cinfo->num_components);
+
+ if (cinfo->marker->saw_SOF)
+ ERREXIT(cinfo, JERR_SOF_DUPLICATE);
+
+ /* We don't support files in which the image height is initially specified */
+ /* as 0 and is later redefined by DNL. As long as we have to check that, */
+ /* might as well have a general sanity check. */
+ if (cinfo->image_height <= 0 || cinfo->image_width <= 0
+ || cinfo->num_components <= 0)
+ ERREXIT(cinfo, JERR_EMPTY_IMAGE);
+
+ if (length != (cinfo->num_components * 3))
+ ERREXIT(cinfo, JERR_BAD_LENGTH);
+
+ if (cinfo->comp_info == NULL) /* do only once, even if suspend */
+ cinfo->comp_info = (jpeg_component_info *) (*cinfo->mem->alloc_small)
+ ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ cinfo->num_components * SIZEOF(jpeg_component_info));
+
+ for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+ ci++, compptr++) {
+ compptr->component_index = ci;
+ INPUT_BYTE(cinfo, compptr->component_id, return FALSE);
+ /* XYQ 2008-03-25: Adobe CMYK JPEG has serious flaw: the K channel has same component id as C channel */
+ {
+ int i;
+ for (i = 0; i < ci; i ++)
+ if (compptr->component_id == cinfo->comp_info[i].component_id) break;
+ if (i < ci)
+ /* Found the error! We replace the id with something unlikely used elsewhere */
+ compptr->component_id += 0xf0;
+ }
+ /* end of modification */
+ INPUT_BYTE(cinfo, c, return FALSE);
+ compptr->h_samp_factor = (c >> 4) & 15;
+ compptr->v_samp_factor = (c ) & 15;
+ INPUT_BYTE(cinfo, compptr->quant_tbl_no, return FALSE);
+
+ TRACEMS4(cinfo, 1, JTRC_SOF_COMPONENT,
+ compptr->component_id, compptr->h_samp_factor,
+ compptr->v_samp_factor, compptr->quant_tbl_no);
+ }
+
+ cinfo->marker->saw_SOF = TRUE;
+
+ INPUT_SYNC(cinfo);
+ return TRUE;
+}
+
+
+LOCAL(boolean)
+get_sos (j_decompress_ptr cinfo)
+/* Process a SOS marker */
+{
+ INT32 length;
+ int i, ci, n, c, cc;
+ jpeg_component_info * compptr;
+ INPUT_VARS(cinfo);
+
+ if (! cinfo->marker->saw_SOF)
+ ERREXIT(cinfo, JERR_SOS_NO_SOF);
+
+ INPUT_2BYTES(cinfo, length, return FALSE);
+
+ INPUT_BYTE(cinfo, n, return FALSE); /* Number of components */
+
+ TRACEMS1(cinfo, 1, JTRC_SOS, n);
+
+ if (length != (n * 2 + 6) || n < 1 || n > MAX_COMPS_IN_SCAN)
+ ERREXIT(cinfo, JERR_BAD_LENGTH);
+
+ cinfo->comps_in_scan = n;
+
+ /* Collect the component-spec parameters */
+
+ for (i = 0; i < n; i++) {
+ INPUT_BYTE(cinfo, cc, return FALSE);
+ INPUT_BYTE(cinfo, c, return FALSE);
+
+ /* XYQ 2008-03-25: Adobe CMYK JPEG has serious flaw: the K channel has same component id as C channel */
+ {
+ int j;
+ for (j = 0; j < i; j ++)
+ if (cc == cinfo->cur_comp_info[j]->component_id) break;
+ if (j < i)
+ /* found the error! */
+ cc += 0xf0;
+ }
+ /* end of modification */
+ for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+ ci++, compptr++) {
+ if (cc == compptr->component_id)
+ goto id_found;
+ }
+
+ ERREXIT1(cinfo, JERR_BAD_COMPONENT_ID, cc);
+
+ id_found:
+
+ cinfo->cur_comp_info[i] = compptr;
+ compptr->dc_tbl_no = (c >> 4) & 15;
+ compptr->ac_tbl_no = (c ) & 15;
+
+ TRACEMS3(cinfo, 1, JTRC_SOS_COMPONENT, cc,
+ compptr->dc_tbl_no, compptr->ac_tbl_no);
+ /* This CSi (cc) should differ from the previous CSi */
+ for (ci = 0; ci < i; ci++) {
+ if (cinfo->cur_comp_info[ci] == compptr)
+ ERREXIT1(cinfo, JERR_BAD_COMPONENT_ID, cc);
+ }
+ }
+
+ /* Collect the additional scan parameters Ss, Se, Ah/Al. */
+ INPUT_BYTE(cinfo, c, return FALSE);
+ cinfo->Ss = c;
+ INPUT_BYTE(cinfo, c, return FALSE);
+ cinfo->Se = c;
+ INPUT_BYTE(cinfo, c, return FALSE);
+ cinfo->Ah = (c >> 4) & 15;
+ cinfo->Al = (c ) & 15;
+
+ TRACEMS4(cinfo, 1, JTRC_SOS_PARAMS, cinfo->Ss, cinfo->Se,
+ cinfo->Ah, cinfo->Al);
+
+ /* Prepare to scan data & restart markers */
+ cinfo->marker->next_restart_num = 0;
+
+ /* Count another SOS marker */
+ cinfo->input_scan_number++;
+
+ INPUT_SYNC(cinfo);
+ return TRUE;
+}
+
+
+#ifdef D_ARITH_CODING_SUPPORTED
+
+LOCAL(boolean)
+get_dac (j_decompress_ptr cinfo)
+/* Process a DAC marker */
+{
+ INT32 length;
+ int index, val;
+ INPUT_VARS(cinfo);
+
+ INPUT_2BYTES(cinfo, length, return FALSE);
+ length -= 2;
+
+ while (length > 0) {
+ INPUT_BYTE(cinfo, index, return FALSE);
+ INPUT_BYTE(cinfo, val, return FALSE);
+
+ length -= 2;
+
+ TRACEMS2(cinfo, 1, JTRC_DAC, index, val);
+
+ if (index < 0 || index >= (2*NUM_ARITH_TBLS))
+ ERREXIT1(cinfo, JERR_DAC_INDEX, index);
+
+ if (index >= NUM_ARITH_TBLS) { /* define AC table */
+ cinfo->arith_ac_K[index-NUM_ARITH_TBLS] = (UINT8) val;
+ } else { /* define DC table */
+ cinfo->arith_dc_L[index] = (UINT8) (val & 0x0F);
+ cinfo->arith_dc_U[index] = (UINT8) (val >> 4);
+ if (cinfo->arith_dc_L[index] > cinfo->arith_dc_U[index])
+ ERREXIT1(cinfo, JERR_DAC_VALUE, val);
+ }
+ }
+
+ if (length != 0)
+ ERREXIT(cinfo, JERR_BAD_LENGTH);
+
+ INPUT_SYNC(cinfo);
+ return TRUE;
+}
+
+#else /* ! D_ARITH_CODING_SUPPORTED */
+
+#define get_dac(cinfo) skip_variable(cinfo)
+
+#endif /* D_ARITH_CODING_SUPPORTED */
+
+
+LOCAL(boolean)
+get_dht (j_decompress_ptr cinfo)
+/* Process a DHT marker */
+{
+ INT32 length;
+ UINT8 bits[17];
+ UINT8 huffval[256];
+ int i, index, count;
+ JHUFF_TBL **htblptr;
+ INPUT_VARS(cinfo);
+
+ INPUT_2BYTES(cinfo, length, return FALSE);
+ length -= 2;
+
+ while (length > 16) {
+ INPUT_BYTE(cinfo, index, return FALSE);
+
+ TRACEMS1(cinfo, 1, JTRC_DHT, index);
+
+ bits[0] = 0;
+ count = 0;
+ for (i = 1; i <= 16; i++) {
+ INPUT_BYTE(cinfo, bits[i], return FALSE);
+ count += bits[i];
+ }
+
+ length -= 1 + 16;
+
+ TRACEMS8(cinfo, 2, JTRC_HUFFBITS,
+ bits[1], bits[2], bits[3], bits[4],
+ bits[5], bits[6], bits[7], bits[8]);
+ TRACEMS8(cinfo, 2, JTRC_HUFFBITS,
+ bits[9], bits[10], bits[11], bits[12],
+ bits[13], bits[14], bits[15], bits[16]);
+
+ /* Here we just do minimal validation of the counts to avoid walking
+ * off the end of our table space. jdhuff.c will check more carefully.
+ */
+ if (count > 256 || ((INT32) count) > length)
+ ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
+
+ for (i = 0; i < count; i++)
+ INPUT_BYTE(cinfo, huffval[i], return FALSE);
+
+ length -= count;
+
+ if (index & 0x10) { /* AC table definition */
+ index -= 0x10;
+ htblptr = &cinfo->ac_huff_tbl_ptrs[index];
+ } else { /* DC table definition */
+ htblptr = &cinfo->dc_huff_tbl_ptrs[index];
+ }
+
+ if (index < 0 || index >= NUM_HUFF_TBLS)
+ ERREXIT1(cinfo, JERR_DHT_INDEX, index);
+
+ if (*htblptr == NULL)
+ *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);
+
+ MEMCOPY((*htblptr)->bits, bits, SIZEOF((*htblptr)->bits));
+ MEMCOPY((*htblptr)->huffval, huffval, SIZEOF((*htblptr)->huffval));
+ }
+
+ if (length != 0)
+ ERREXIT(cinfo, JERR_BAD_LENGTH);
+
+ INPUT_SYNC(cinfo);
+ return TRUE;
+}
+
+
+LOCAL(boolean)
+get_dqt (j_decompress_ptr cinfo)
+/* Process a DQT marker */
+{
+ INT32 length;
+ int n, i, prec;
+ unsigned int tmp;
+ JQUANT_TBL *quant_ptr;
+ INPUT_VARS(cinfo);
+
+ INPUT_2BYTES(cinfo, length, return FALSE);
+ length -= 2;
+
+ while (length > 0) {
+ INPUT_BYTE(cinfo, n, return FALSE);
+ prec = n >> 4;
+ n &= 0x0F;
+
+ TRACEMS2(cinfo, 1, JTRC_DQT, n, prec);
+
+ if (n >= NUM_QUANT_TBLS)
+ ERREXIT1(cinfo, JERR_DQT_INDEX, n);
+
+ if (cinfo->quant_tbl_ptrs[n] == NULL)
+ cinfo->quant_tbl_ptrs[n] = jpeg_alloc_quant_table((j_common_ptr) cinfo);
+ quant_ptr = cinfo->quant_tbl_ptrs[n];
+
+ for (i = 0; i < DCTSIZE2; i++) {
+ if (prec)
+ INPUT_2BYTES(cinfo, tmp, return FALSE);
+ else
+ INPUT_BYTE(cinfo, tmp, return FALSE);
+ /* We convert the zigzag-order table to natural array order. */
+ quant_ptr->quantval[jpeg_natural_order[i]] = (UINT16) tmp;
+ }
+
+ if (cinfo->err->trace_level >= 2) {
+ for (i = 0; i < DCTSIZE2; i += 8) {
+ TRACEMS8(cinfo, 2, JTRC_QUANTVALS,
+ quant_ptr->quantval[i], quant_ptr->quantval[i+1],
+ quant_ptr->quantval[i+2], quant_ptr->quantval[i+3],
+ quant_ptr->quantval[i+4], quant_ptr->quantval[i+5],
+ quant_ptr->quantval[i+6], quant_ptr->quantval[i+7]);
+ }
+ }
+
+ length -= DCTSIZE2+1;
+ if (prec) length -= DCTSIZE2;
+ }
+
+ if (length != 0)
+ ERREXIT(cinfo, JERR_BAD_LENGTH);
+
+ INPUT_SYNC(cinfo);
+ return TRUE;
+}
+
+
+LOCAL(boolean)
+get_dri (j_decompress_ptr cinfo)
+/* Process a DRI marker */
+{
+ INT32 length;
+ unsigned int tmp;
+ INPUT_VARS(cinfo);
+
+ INPUT_2BYTES(cinfo, length, return FALSE);
+
+ if (length != 4)
+ ERREXIT(cinfo, JERR_BAD_LENGTH);
+
+ INPUT_2BYTES(cinfo, tmp, return FALSE);
+
+ TRACEMS1(cinfo, 1, JTRC_DRI, tmp);
+
+ cinfo->restart_interval = tmp;
+
+ INPUT_SYNC(cinfo);
+ return TRUE;
+}
+
+
+/*
+ * Routines for processing APPn and COM markers.
+ * These are either saved in memory or discarded, per application request.
+ * APP0 and APP14 are specially checked to see if they are
+ * JFIF and Adobe markers, respectively.
+ */
+
+#define APP0_DATA_LEN 14 /* Length of interesting data in APP0 */
+#define APP14_DATA_LEN 12 /* Length of interesting data in APP14 */
+#define APPN_DATA_LEN 14 /* Must be the largest of the above!! */
+
+
+LOCAL(void)
+examine_app0 (j_decompress_ptr cinfo, JOCTET FAR * data,
+ unsigned int datalen, INT32 remaining)
+/* Examine first few bytes from an APP0.
+ * Take appropriate action if it is a JFIF marker.
+ * datalen is # of bytes at data[], remaining is length of rest of marker data.
+ */
+{
+ INT32 totallen = (INT32) datalen + remaining;
+
+ if (datalen >= APP0_DATA_LEN &&
+ GETJOCTET(data[0]) == 0x4A &&
+ GETJOCTET(data[1]) == 0x46 &&
+ GETJOCTET(data[2]) == 0x49 &&
+ GETJOCTET(data[3]) == 0x46 &&
+ GETJOCTET(data[4]) == 0) {
+ /* Found JFIF APP0 marker: save info */
+ cinfo->saw_JFIF_marker = TRUE;
+ cinfo->JFIF_major_version = GETJOCTET(data[5]);
+ cinfo->JFIF_minor_version = GETJOCTET(data[6]);
+ cinfo->density_unit = GETJOCTET(data[7]);
+ cinfo->X_density = (GETJOCTET(data[8]) << 8) + GETJOCTET(data[9]);
+ cinfo->Y_density = (GETJOCTET(data[10]) << 8) + GETJOCTET(data[11]);
+ /* Check version.
+ * Major version must be 1, anything else signals an incompatible change.
+ * (We used to treat this as an error, but now it's a nonfatal warning,
+ * because some bozo at Hijaak couldn't read the spec.)
+ * Minor version should be 0..2, but process anyway if newer.
+ */
+ if (cinfo->JFIF_major_version != 1)
+ WARNMS2(cinfo, JWRN_JFIF_MAJOR,
+ cinfo->JFIF_major_version, cinfo->JFIF_minor_version);
+ /* Generate trace messages */
+ TRACEMS5(cinfo, 1, JTRC_JFIF,
+ cinfo->JFIF_major_version, cinfo->JFIF_minor_version,
+ cinfo->X_density, cinfo->Y_density, cinfo->density_unit);
+ /* Validate thumbnail dimensions and issue appropriate messages */
+ if (GETJOCTET(data[12]) | GETJOCTET(data[13]))
+ TRACEMS2(cinfo, 1, JTRC_JFIF_THUMBNAIL,
+ GETJOCTET(data[12]), GETJOCTET(data[13]));
+ totallen -= APP0_DATA_LEN;
+ if (totallen !=
+ ((INT32)GETJOCTET(data[12]) * (INT32)GETJOCTET(data[13]) * (INT32) 3))
+ TRACEMS1(cinfo, 1, JTRC_JFIF_BADTHUMBNAILSIZE, (int) totallen);
+ } else if (datalen >= 6 &&
+ GETJOCTET(data[0]) == 0x4A &&
+ GETJOCTET(data[1]) == 0x46 &&
+ GETJOCTET(data[2]) == 0x58 &&
+ GETJOCTET(data[3]) == 0x58 &&
+ GETJOCTET(data[4]) == 0) {
+ /* Found JFIF "JFXX" extension APP0 marker */
+ /* The library doesn't actually do anything with these,
+ * but we try to produce a helpful trace message.
+ */
+ switch (GETJOCTET(data[5])) {
+ case 0x10:
+ TRACEMS1(cinfo, 1, JTRC_THUMB_JPEG, (int) totallen);
+ break;
+ case 0x11:
+ TRACEMS1(cinfo, 1, JTRC_THUMB_PALETTE, (int) totallen);
+ break;
+ case 0x13:
+ TRACEMS1(cinfo, 1, JTRC_THUMB_RGB, (int) totallen);
+ break;
+ default:
+ TRACEMS2(cinfo, 1, JTRC_JFIF_EXTENSION,
+ GETJOCTET(data[5]), (int) totallen);
+ break;
+ }
+ } else {
+ /* Start of APP0 does not match "JFIF" or "JFXX", or too short */
+ TRACEMS1(cinfo, 1, JTRC_APP0, (int) totallen);
+ }
+}
+
+
+LOCAL(void)
+examine_app14 (j_decompress_ptr cinfo, JOCTET FAR * data,
+ unsigned int datalen, INT32 remaining)
+/* Examine first few bytes from an APP14.
+ * Take appropriate action if it is an Adobe marker.
+ * datalen is # of bytes at data[], remaining is length of rest of marker data.
+ */
+{
+ unsigned int version, flags0, flags1, transform;
+
+ if (datalen >= APP14_DATA_LEN &&
+ GETJOCTET(data[0]) == 0x41 &&
+ GETJOCTET(data[1]) == 0x64 &&
+ GETJOCTET(data[2]) == 0x6F &&
+ GETJOCTET(data[3]) == 0x62 &&
+ GETJOCTET(data[4]) == 0x65) {
+ /* Found Adobe APP14 marker */
+ version = (GETJOCTET(data[5]) << 8) + GETJOCTET(data[6]);
+ flags0 = (GETJOCTET(data[7]) << 8) + GETJOCTET(data[8]);
+ flags1 = (GETJOCTET(data[9]) << 8) + GETJOCTET(data[10]);
+ transform = GETJOCTET(data[11]);
+ TRACEMS4(cinfo, 1, JTRC_ADOBE, version, flags0, flags1, transform);
+ cinfo->saw_Adobe_marker = TRUE;
+ cinfo->Adobe_transform = (UINT8) transform;
+ } else {
+ /* Start of APP14 does not match "Adobe", or too short */
+ TRACEMS1(cinfo, 1, JTRC_APP14, (int) (datalen + remaining));
+ }
+}
+
+
+METHODDEF(boolean)
+get_interesting_appn (j_decompress_ptr cinfo)
+/* Process an APP0 or APP14 marker without saving it */
+{
+ INT32 length;
+ JOCTET b[APPN_DATA_LEN];
+ unsigned int i, numtoread;
+ INPUT_VARS(cinfo);
+
+ INPUT_2BYTES(cinfo, length, return FALSE);
+ length -= 2;
+
+ /* get the interesting part of the marker data */
+ if (length >= APPN_DATA_LEN)
+ numtoread = APPN_DATA_LEN;
+ else if (length > 0)
+ numtoread = (unsigned int) length;
+ else
+ numtoread = 0;
+ for (i = 0; i < numtoread; i++)
+ INPUT_BYTE(cinfo, b[i], return FALSE);
+ length -= numtoread;
+
+ /* process it */
+ switch (cinfo->unread_marker) {
+ case M_APP0:
+ examine_app0(cinfo, (JOCTET FAR *) b, numtoread, length);
+ break;
+ case M_APP14:
+ examine_app14(cinfo, (JOCTET FAR *) b, numtoread, length);
+ break;
+ default:
+ /* can't get here unless jpeg_save_markers chooses wrong processor */
+ ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, cinfo->unread_marker);
+ break;
+ }
+
+ /* skip any remaining data -- could be lots */
+ INPUT_SYNC(cinfo);
+ if (length > 0)
+ (*cinfo->src->skip_input_data) (cinfo, (long) length);
+
+ return TRUE;
+}
+
+
+#ifdef SAVE_MARKERS_SUPPORTED
+
+METHODDEF(boolean)
+save_marker (j_decompress_ptr cinfo)
+/* Save an APPn or COM marker into the marker list */
+{
+ my_marker_ptr marker = (my_marker_ptr) cinfo->marker;
+ jpeg_saved_marker_ptr cur_marker = marker->cur_marker;
+ unsigned int bytes_read, data_length;
+ JOCTET FAR * data;
+ INT32 length = 0;
+ INPUT_VARS(cinfo);
+
+ if (cur_marker == NULL) {
+ /* begin reading a marker */
+ INPUT_2BYTES(cinfo, length, return FALSE);
+ length -= 2;
+ if (length >= 0) { /* watch out for bogus length word */
+ /* figure out how much we want to save */
+ unsigned int limit;
+ if (cinfo->unread_marker == (int) M_COM)
+ limit = marker->length_limit_COM;
+ else
+ limit = marker->length_limit_APPn[cinfo->unread_marker - (int) M_APP0];
+ if ((unsigned int) length < limit)
+ limit = (unsigned int) length;
+ /* allocate and initialize the marker item */
+ cur_marker = (jpeg_saved_marker_ptr)
+ (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ SIZEOF(struct jpeg_marker_struct) + limit);
+ cur_marker->next = NULL;
+ cur_marker->marker = (UINT8) cinfo->unread_marker;
+ cur_marker->original_length = (unsigned int) length;
+ cur_marker->data_length = limit;
+ /* data area is just beyond the jpeg_marker_struct */
+ data = cur_marker->data = (JOCTET FAR *) (cur_marker + 1);
+ marker->cur_marker = cur_marker;
+ marker->bytes_read = 0;
+ bytes_read = 0;
+ data_length = limit;
+ } else {
+ /* deal with bogus length word */
+ bytes_read = data_length = 0;
+ data = NULL;
+ }
+ } else {
+ /* resume reading a marker */
+ bytes_read = marker->bytes_read;
+ data_length = cur_marker->data_length;
+ data = cur_marker->data + bytes_read;
+ }
+
+ while (bytes_read < data_length) {
+ INPUT_SYNC(cinfo); /* move the restart point to here */
+ marker->bytes_read = bytes_read;
+ /* If there's not at least one byte in buffer, suspend */
+ MAKE_BYTE_AVAIL(cinfo, return FALSE);
+ /* Copy bytes with reasonable rapidity */
+ while (bytes_read < data_length && bytes_in_buffer > 0) {
+ *data++ = *next_input_byte++;
+ bytes_in_buffer--;
+ bytes_read++;
+ }
+ }
+
+ /* Done reading what we want to read */
+ if (cur_marker != NULL) { /* will be NULL if bogus length word */
+ /* Add new marker to end of list */
+ if (cinfo->marker_list == NULL) {
+ cinfo->marker_list = cur_marker;
+ } else {
+ jpeg_saved_marker_ptr prev = cinfo->marker_list;
+ while (prev->next != NULL)
+ prev = prev->next;
+ prev->next = cur_marker;
+ }
+ /* Reset pointer & calc remaining data length */
+ data = cur_marker->data;
+ length = cur_marker->original_length - data_length;
+ }
+ /* Reset to initial state for next marker */
+ marker->cur_marker = NULL;
+
+ /* Process the marker if interesting; else just make a generic trace msg */
+ switch (cinfo->unread_marker) {
+ case M_APP0:
+ examine_app0(cinfo, data, data_length, length);
+ break;
+ case M_APP14:
+ examine_app14(cinfo, data, data_length, length);
+ break;
+ default:
+ TRACEMS2(cinfo, 1, JTRC_MISC_MARKER, cinfo->unread_marker,
+ (int) (data_length + length));
+ break;
+ }
+
+ /* skip any remaining data -- could be lots */
+ INPUT_SYNC(cinfo); /* do before skip_input_data */
+ if (length > 0)
+ (*cinfo->src->skip_input_data) (cinfo, (long) length);
+
+ return TRUE;
+}
+
+#endif /* SAVE_MARKERS_SUPPORTED */
+
+
+METHODDEF(boolean)
+skip_variable (j_decompress_ptr cinfo)
+/* Skip over an unknown or uninteresting variable-length marker */
+{
+ INT32 length;
+ INPUT_VARS(cinfo);
+
+ INPUT_2BYTES(cinfo, length, return FALSE);
+ length -= 2;
+
+ TRACEMS2(cinfo, 1, JTRC_MISC_MARKER, cinfo->unread_marker, (int) length);
+
+ INPUT_SYNC(cinfo); /* do before skip_input_data */
+ if (length > 0)
+ (*cinfo->src->skip_input_data) (cinfo, (long) length);
+
+ return TRUE;
+}
+
+
+/*
+ * Find the next JPEG marker, save it in cinfo->unread_marker.
+ * Returns FALSE if had to suspend before reaching a marker;
+ * in that case cinfo->unread_marker is unchanged.
+ *
+ * Note that the result might not be a valid marker code,
+ * but it will never be 0 or FF.
+ */
+
+LOCAL(boolean)
+next_marker (j_decompress_ptr cinfo)
+{
+ int c;
+ INPUT_VARS(cinfo);
+
+ for (;;) {
+ INPUT_BYTE(cinfo, c, return FALSE);
+ /* Skip any non-FF bytes.
+ * This may look a bit inefficient, but it will not occur in a valid file.
+ * We sync after each discarded byte so that a suspending data source
+ * can discard the byte from its buffer.
+ */
+ while (c != 0xFF) {
+ cinfo->marker->discarded_bytes++;
+ INPUT_SYNC(cinfo);
+ INPUT_BYTE(cinfo, c, return FALSE);
+ }
+ /* This loop swallows any duplicate FF bytes. Extra FFs are legal as
+ * pad bytes, so don't count them in discarded_bytes. We assume there
+ * will not be so many consecutive FF bytes as to overflow a suspending
+ * data source's input buffer.
+ */
+ do {
+ INPUT_BYTE(cinfo, c, return FALSE);
+ } while (c == 0xFF);
+ if (c != 0)
+ break; /* found a valid marker, exit loop */
+ /* Reach here if we found a stuffed-zero data sequence (FF/00).
+ * Discard it and loop back to try again.
+ */
+ cinfo->marker->discarded_bytes += 2;
+ INPUT_SYNC(cinfo);
+ }
+
+ if (cinfo->marker->discarded_bytes != 0) {
+ WARNMS2(cinfo, JWRN_EXTRANEOUS_DATA, cinfo->marker->discarded_bytes, c);
+ cinfo->marker->discarded_bytes = 0;
+ }
+
+ cinfo->unread_marker = c;
+
+ INPUT_SYNC(cinfo);
+ return TRUE;
+}
+
+
+LOCAL(boolean)
+first_marker (j_decompress_ptr cinfo)
+/* Like next_marker, but used to obtain the initial SOI marker. */
+/* For this marker, we do not allow preceding garbage or fill; otherwise,
+ * we might well scan an entire input file before realizing it ain't JPEG.
+ * If an application wants to process non-JFIF files, it must seek to the
+ * SOI before calling the JPEG library.
+ */
+{
+ int c, c2;
+ INPUT_VARS(cinfo);
+
+ INPUT_BYTE(cinfo, c, return FALSE);
+ INPUT_BYTE(cinfo, c2, return FALSE);
+ if (c != 0xFF || c2 != (int) M_SOI)
+ ERREXIT2(cinfo, JERR_NO_SOI, c, c2);
+
+ cinfo->unread_marker = c2;
+
+ INPUT_SYNC(cinfo);
+ return TRUE;
+}
+
+
+/*
+ * Read markers until SOS or EOI.
+ *
+ * Returns same codes as are defined for jpeg_consume_input:
+ * JPEG_SUSPENDED, JPEG_REACHED_SOS, or JPEG_REACHED_EOI.
+ */
+
+METHODDEF(int)
+read_markers (j_decompress_ptr cinfo)
+{
+ /* Outer loop repeats once for each marker. */
+ for (;;) {
+ /* Collect the marker proper, unless we already did. */
+ /* NB: first_marker() enforces the requirement that SOI appear first. */
+ if (cinfo->unread_marker == 0) {
+ if (! cinfo->marker->saw_SOI) {
+ if (! first_marker(cinfo))
+ return JPEG_SUSPENDED;
+ } else {
+ if (! next_marker(cinfo))
+ return JPEG_SUSPENDED;
+ }
+ }
+ /* At this point cinfo->unread_marker contains the marker code and the
+ * input point is just past the marker proper, but before any parameters.
+ * A suspension will cause us to return with this state still true.
+ */
+ switch (cinfo->unread_marker) {
+ case M_SOI:
+ if (! get_soi(cinfo))
+ return JPEG_SUSPENDED;
+ break;
+
+ case M_SOF0: /* Baseline */
+ case M_SOF1: /* Extended sequential, Huffman */
+ if (! get_sof(cinfo, FALSE, FALSE))
+ return JPEG_SUSPENDED;
+ break;
+
+ case M_SOF2: /* Progressive, Huffman */
+ if (! get_sof(cinfo, TRUE, FALSE))
+ return JPEG_SUSPENDED;
+ break;
+
+ case M_SOF9: /* Extended sequential, arithmetic */
+ if (! get_sof(cinfo, FALSE, TRUE))
+ return JPEG_SUSPENDED;
+ break;
+
+ case M_SOF10: /* Progressive, arithmetic */
+ if (! get_sof(cinfo, TRUE, TRUE))
+ return JPEG_SUSPENDED;
+ break;
+
+ /* Currently unsupported SOFn types */
+ case M_SOF3: /* Lossless, Huffman */
+ case M_SOF5: /* Differential sequential, Huffman */
+ case M_SOF6: /* Differential progressive, Huffman */
+ case M_SOF7: /* Differential lossless, Huffman */
+ case M_JPG: /* Reserved for JPEG extensions */
+ case M_SOF11: /* Lossless, arithmetic */
+ case M_SOF13: /* Differential sequential, arithmetic */
+ case M_SOF14: /* Differential progressive, arithmetic */
+ case M_SOF15: /* Differential lossless, arithmetic */
+ ERREXIT1(cinfo, JERR_SOF_UNSUPPORTED, cinfo->unread_marker);
+ break;
+
+ case M_SOS:
+ if (! get_sos(cinfo))
+ return JPEG_SUSPENDED;
+ cinfo->unread_marker = 0; /* processed the marker */
+ return JPEG_REACHED_SOS;
+
+ case M_EOI:
+ TRACEMS(cinfo, 1, JTRC_EOI);
+ cinfo->unread_marker = 0; /* processed the marker */
+ return JPEG_REACHED_EOI;
+
+ case M_DAC:
+ if (! get_dac(cinfo))
+ return JPEG_SUSPENDED;
+ break;
+
+ case M_DHT:
+ if (! get_dht(cinfo))
+ return JPEG_SUSPENDED;
+ break;
+
+ case M_DQT:
+ if (! get_dqt(cinfo))
+ return JPEG_SUSPENDED;
+ break;
+
+ case M_DRI:
+ if (! get_dri(cinfo))
+ return JPEG_SUSPENDED;
+ break;
+
+ case M_APP0:
+ case M_APP1:
+ case M_APP2:
+ case M_APP3:
+ case M_APP4:
+ case M_APP5:
+ case M_APP6:
+ case M_APP7:
+ case M_APP8:
+ case M_APP9:
+ case M_APP10:
+ case M_APP11:
+ case M_APP12:
+ case M_APP13:
+ case M_APP14:
+ case M_APP15:
+ if (! (*((my_marker_ptr) cinfo->marker)->process_APPn[
+ cinfo->unread_marker - (int) M_APP0]) (cinfo))
+ return JPEG_SUSPENDED;
+ break;
+
+ case M_COM:
+ if (! (*((my_marker_ptr) cinfo->marker)->process_COM) (cinfo))
+ return JPEG_SUSPENDED;
+ break;
+
+ case M_RST0: /* these are all parameterless */
+ case M_RST1:
+ case M_RST2:
+ case M_RST3:
+ case M_RST4:
+ case M_RST5:
+ case M_RST6:
+ case M_RST7:
+ case M_TEM:
+ TRACEMS1(cinfo, 1, JTRC_PARMLESS_MARKER, cinfo->unread_marker);
+ break;
+
+ case M_DNL: /* Ignore DNL ... perhaps the wrong thing */
+ if (! skip_variable(cinfo))
+ return JPEG_SUSPENDED;
+ break;
+
+ default: /* must be DHP, EXP, JPGn, or RESn */
+ /* For now, we treat the reserved markers as fatal errors since they are
+ * likely to be used to signal incompatible JPEG Part 3 extensions.
+ * Once the JPEG 3 version-number marker is well defined, this code
+ * ought to change!
+ */
+ ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, cinfo->unread_marker);
+ break;
+ }
+ /* Successfully processed marker, so reset state variable */
+ cinfo->unread_marker = 0;
+ } /* end loop */
+}
+
+
+/*
+ * Read a restart marker, which is expected to appear next in the datastream;
+ * if the marker is not there, take appropriate recovery action.
+ * Returns FALSE if suspension is required.
+ *
+ * This is called by the entropy decoder after it has read an appropriate
+ * number of MCUs. cinfo->unread_marker may be nonzero if the entropy decoder
+ * has already read a marker from the data source. Under normal conditions
+ * cinfo->unread_marker will be reset to 0 before returning; if not reset,
+ * it holds a marker which the decoder will be unable to read past.
+ */
+
+METHODDEF(boolean)
+read_restart_marker (j_decompress_ptr cinfo)
+{
+ /* Obtain a marker unless we already did. */
+ /* Note that next_marker will complain if it skips any data. */
+ if (cinfo->unread_marker == 0) {
+ if (! next_marker(cinfo))
+ return FALSE;
+ }
+
+ if (cinfo->unread_marker ==
+ ((int) M_RST0 + cinfo->marker->next_restart_num)) {
+ /* Normal case --- swallow the marker and let entropy decoder continue */
+ TRACEMS1(cinfo, 3, JTRC_RST, cinfo->marker->next_restart_num);
+ cinfo->unread_marker = 0;
+ } else {
+ /* Uh-oh, the restart markers have been messed up. */
+ /* Let the data source manager determine how to resync. */
+ if (! (*cinfo->src->resync_to_restart) (cinfo,
+ cinfo->marker->next_restart_num))
+ return FALSE;
+ }
+
+ /* Update next-restart state */
+ cinfo->marker->next_restart_num = (cinfo->marker->next_restart_num + 1) & 7;
+
+ return TRUE;
+}
+
+
+/*
+ * This is the default resync_to_restart method for data source managers
+ * to use if they don't have any better approach. Some data source managers
+ * may be able to back up, or may have additional knowledge about the data
+ * which permits a more intelligent recovery strategy; such managers would
+ * presumably supply their own resync method.
+ *
+ * read_restart_marker calls resync_to_restart if it finds a marker other than
+ * the restart marker it was expecting. (This code is *not* used unless
+ * a nonzero restart interval has been declared.) cinfo->unread_marker is
+ * the marker code actually found (might be anything, except 0 or FF).
+ * The desired restart marker number (0..7) is passed as a parameter.
+ * This routine is supposed to apply whatever error recovery strategy seems
+ * appropriate in order to position the input stream to the next data segment.
+ * Note that cinfo->unread_marker is treated as a marker appearing before
+ * the current data-source input point; usually it should be reset to zero
+ * before returning.
+ * Returns FALSE if suspension is required.
+ *
+ * This implementation is substantially constrained by wanting to treat the
+ * input as a data stream; this means we can't back up. Therefore, we have
+ * only the following actions to work with:
+ * 1. Simply discard the marker and let the entropy decoder resume at next
+ * byte of file.
+ * 2. Read forward until we find another marker, discarding intervening
+ * data. (In theory we could look ahead within the current bufferload,
+ * without having to discard data if we don't find the desired marker.
+ * This idea is not implemented here, in part because it makes behavior
+ * dependent on buffer size and chance buffer-boundary positions.)
+ * 3. Leave the marker unread (by failing to zero cinfo->unread_marker).
+ * This will cause the entropy decoder to process an empty data segment,
+ * inserting dummy zeroes, and then we will reprocess the marker.
+ *
+ * #2 is appropriate if we think the desired marker lies ahead, while #3 is
+ * appropriate if the found marker is a future restart marker (indicating
+ * that we have missed the desired restart marker, probably because it got
+ * corrupted).
+ * We apply #2 or #3 if the found marker is a restart marker no more than
+ * two counts behind or ahead of the expected one. We also apply #2 if the
+ * found marker is not a legal JPEG marker code (it's certainly bogus data).
+ * If the found marker is a restart marker more than 2 counts away, we do #1
+ * (too much risk that the marker is erroneous; with luck we will be able to
+ * resync at some future point).
+ * For any valid non-restart JPEG marker, we apply #3. This keeps us from
+ * overrunning the end of a scan. An implementation limited to single-scan
+ * files might find it better to apply #2 for markers other than EOI, since
+ * any other marker would have to be bogus data in that case.
+ */
+
+GLOBAL(boolean)
+jpeg_resync_to_restart (j_decompress_ptr cinfo, int desired)
+{
+ int marker = cinfo->unread_marker;
+ int action = 1;
+
+ /* Always put up a warning. */
+ WARNMS2(cinfo, JWRN_MUST_RESYNC, marker, desired);
+
+ /* Outer loop handles repeated decision after scanning forward. */
+ for (;;) {
+ if (marker < (int) M_SOF0)
+ action = 2; /* invalid marker */
+ else if (marker < (int) M_RST0 || marker > (int) M_RST7)
+ action = 3; /* valid non-restart marker */
+ else {
+ if (marker == ((int) M_RST0 + ((desired+1) & 7)) ||
+ marker == ((int) M_RST0 + ((desired+2) & 7)))
+ action = 3; /* one of the next two expected restarts */
+ else if (marker == ((int) M_RST0 + ((desired-1) & 7)) ||
+ marker == ((int) M_RST0 + ((desired-2) & 7)))
+ action = 2; /* a prior restart, so advance */
+ else
+ action = 1; /* desired restart or too far away */
+ }
+ TRACEMS2(cinfo, 4, JTRC_RECOVERY_ACTION, marker, action);
+ switch (action) {
+ case 1:
+ /* Discard marker and let entropy decoder resume processing. */
+ cinfo->unread_marker = 0;
+ return TRUE;
+ case 2:
+ /* Scan to the next marker, and repeat the decision loop. */
+ if (! next_marker(cinfo))
+ return FALSE;
+ marker = cinfo->unread_marker;
+ break;
+ case 3:
+ /* Return without advancing past this marker. */
+ /* Entropy decoder will be forced to process an empty segment. */
+ return TRUE;
+ }
+ } /* end loop */
+}
+
+
+/*
+ * Reset marker processing state to begin a fresh datastream.
+ */
+
+METHODDEF(void)
+reset_marker_reader (j_decompress_ptr cinfo)
+{
+ my_marker_ptr marker = (my_marker_ptr) cinfo->marker;
+
+ cinfo->comp_info = NULL; /* until allocated by get_sof */
+ cinfo->input_scan_number = 0; /* no SOS seen yet */
+ cinfo->unread_marker = 0; /* no pending marker */
+ marker->pub.saw_SOI = FALSE; /* set internal state too */
+ marker->pub.saw_SOF = FALSE;
+ marker->pub.discarded_bytes = 0;
+ marker->cur_marker = NULL;
+}
+
+
+/*
+ * Initialize the marker reader module.
+ * This is called only once, when the decompression object is created.
+ */
+
+GLOBAL(void)
+jinit_marker_reader (j_decompress_ptr cinfo)
+{
+ my_marker_ptr marker;
+ int i;
+
+ /* Create subobject in permanent pool */
+ marker = (my_marker_ptr)
+ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
+ SIZEOF(my_marker_reader));
+ cinfo->marker = (struct jpeg_marker_reader *) marker;
+ /* Initialize public method pointers */
+ marker->pub.reset_marker_reader = reset_marker_reader;
+ marker->pub.read_markers = read_markers;
+ marker->pub.read_restart_marker = read_restart_marker;
+ /* Initialize COM/APPn processing.
+ * By default, we examine and then discard APP0 and APP14,
+ * but simply discard COM and all other APPn.
+ */
+ marker->process_COM = skip_variable;
+ marker->length_limit_COM = 0;
+ for (i = 0; i < 16; i++) {
+ marker->process_APPn[i] = skip_variable;
+ marker->length_limit_APPn[i] = 0;
+ }
+ marker->process_APPn[0] = get_interesting_appn;
+ marker->process_APPn[14] = get_interesting_appn;
+ /* Reset marker processing state */
+ reset_marker_reader(cinfo);
+}
+
+
+/*
+ * Control saving of COM and APPn markers into marker_list.
+ */
+
+#ifdef SAVE_MARKERS_SUPPORTED
+
+GLOBAL(void)
+jpeg_save_markers (j_decompress_ptr cinfo, int marker_code,
+ unsigned int length_limit)
+{
+ my_marker_ptr marker = (my_marker_ptr) cinfo->marker;
+ long maxlength;
+ jpeg_marker_parser_method processor;
+
+ /* Length limit mustn't be larger than what we can allocate
+ * (should only be a concern in a 16-bit environment).
+ */
+ maxlength = cinfo->mem->max_alloc_chunk - SIZEOF(struct jpeg_marker_struct);
+ if (((long) length_limit) > maxlength)
+ length_limit = (unsigned int) maxlength;
+
+ /* Choose processor routine to use.
+ * APP0/APP14 have special requirements.
+ */
+ if (length_limit) {
+ processor = save_marker;
+ /* If saving APP0/APP14, save at least enough for our internal use. */
+ if (marker_code == (int) M_APP0 && length_limit < APP0_DATA_LEN)
+ length_limit = APP0_DATA_LEN;
+ else if (marker_code == (int) M_APP14 && length_limit < APP14_DATA_LEN)
+ length_limit = APP14_DATA_LEN;
+ } else {
+ processor = skip_variable;
+ /* If discarding APP0/APP14, use our regular on-the-fly processor. */
+ if (marker_code == (int) M_APP0 || marker_code == (int) M_APP14)
+ processor = get_interesting_appn;
+ }
+
+ if (marker_code == (int) M_COM) {
+ marker->process_COM = processor;
+ marker->length_limit_COM = length_limit;
+ } else if (marker_code >= (int) M_APP0 && marker_code <= (int) M_APP15) {
+ marker->process_APPn[marker_code - (int) M_APP0] = processor;
+ marker->length_limit_APPn[marker_code - (int) M_APP0] = length_limit;
+ } else
+ ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, marker_code);
+}
+
+#endif /* SAVE_MARKERS_SUPPORTED */
+
+
+/*
+ * Install a special processing method for COM or APPn markers.
+ */
+
+GLOBAL(void)
+jpeg_set_marker_processor (j_decompress_ptr cinfo, int marker_code,
+ jpeg_marker_parser_method routine)
+{
+ my_marker_ptr marker = (my_marker_ptr) cinfo->marker;
+
+ if (marker_code == (int) M_COM)
+ marker->process_COM = routine;
+ else if (marker_code >= (int) M_APP0 && marker_code <= (int) M_APP15)
+ marker->process_APPn[marker_code - (int) M_APP0] = routine;
+ else
+ ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, marker_code);
+}
+
+#endif //_FX_JPEG_TURBO_
diff --git a/core/src/fxcodec/libjpeg/fpdfapi_jdmaster.c b/core/src/fxcodec/libjpeg/fpdfapi_jdmaster.c
index 4adfd82375..dae51e0fd2 100644
--- a/core/src/fxcodec/libjpeg/fpdfapi_jdmaster.c
+++ b/core/src/fxcodec/libjpeg/fpdfapi_jdmaster.c
@@ -1,560 +1,560 @@
-#if !defined(_FX_JPEG_TURBO_)
-/*
- * jdmaster.c
- *
- * Copyright (C) 1991-1997, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- * For conditions of distribution and use, see the accompanying README file.
- *
- * This file contains master control logic for the JPEG decompressor.
- * These routines are concerned with selecting the modules to be executed
- * and with determining the number of passes and the work to be done in each
- * pass.
- */
-
-#define JPEG_INTERNALS
-#include "jinclude.h"
-#include "jpeglib.h"
-
-
-/* Private state */
-
-typedef struct {
- struct jpeg_decomp_master pub; /* public fields */
-
- int pass_number; /* # of passes completed */
-
- boolean using_merged_upsample; /* TRUE if using merged upsample/cconvert */
-
- /* Saved references to initialized quantizer modules,
- * in case we need to switch modes.
- */
- struct jpeg_color_quantizer * quantizer_1pass;
- struct jpeg_color_quantizer * quantizer_2pass;
-} my_decomp_master;
-
-typedef my_decomp_master * my_master_ptr;
-
-
-/*
- * Determine whether merged upsample/color conversion should be used.
- * CRUCIAL: this must match the actual capabilities of jdmerge.c!
- */
-
-LOCAL(boolean)
-use_merged_upsample (j_decompress_ptr cinfo)
-{
-#ifdef UPSAMPLE_MERGING_SUPPORTED
- /* Merging is the equivalent of plain box-filter upsampling */
- if (cinfo->do_fancy_upsampling || cinfo->CCIR601_sampling)
- return FALSE;
- /* jdmerge.c only supports YCC=>RGB color conversion */
- if (cinfo->jpeg_color_space != JCS_YCbCr || cinfo->num_components != 3 ||
- cinfo->out_color_space != JCS_RGB ||
- cinfo->out_color_components != RGB_PIXELSIZE)
- return FALSE;
- /* and it only handles 2h1v or 2h2v sampling ratios */
- if (cinfo->comp_info[0].h_samp_factor != 2 ||
- cinfo->comp_info[1].h_samp_factor != 1 ||
- cinfo->comp_info[2].h_samp_factor != 1 ||
- cinfo->comp_info[0].v_samp_factor > 2 ||
- cinfo->comp_info[1].v_samp_factor != 1 ||
- cinfo->comp_info[2].v_samp_factor != 1)
- return FALSE;
- /* furthermore, it doesn't work if we've scaled the IDCTs differently */
- if (cinfo->comp_info[0].DCT_scaled_size != cinfo->min_DCT_scaled_size ||
- cinfo->comp_info[1].DCT_scaled_size != cinfo->min_DCT_scaled_size ||
- cinfo->comp_info[2].DCT_scaled_size != cinfo->min_DCT_scaled_size)
- return FALSE;
- /* ??? also need to test for upsample-time rescaling, when & if supported */
- return TRUE; /* by golly, it'll work... */
-#else
- return FALSE;
-#endif
-}
-
-
-/*
- * Compute output image dimensions and related values.
- * NOTE: this is exported for possible use by application.
- * Hence it mustn't do anything that can't be done twice.
- * Also note that it may be called before the master module is initialized!
- */
-
-GLOBAL(void)
-jpeg_calc_output_dimensions (j_decompress_ptr cinfo)
-/* Do computations that are needed before master selection phase */
-{
-#ifdef IDCT_SCALING_SUPPORTED
- int ci;
- jpeg_component_info *compptr;
-#endif
-
- /* Prevent application from calling me at wrong times */
- if (cinfo->global_state != DSTATE_READY)
- ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
-
-#ifdef IDCT_SCALING_SUPPORTED
-
- /* Compute actual output image dimensions and DCT scaling choices. */
- if (cinfo->scale_num * 8 <= cinfo->scale_denom) {
- /* Provide 1/8 scaling */
- cinfo->output_width = (JDIMENSION)
- jdiv_round_up((long) cinfo->image_width, 8L);
- cinfo->output_height = (JDIMENSION)
- jdiv_round_up((long) cinfo->image_height, 8L);
- cinfo->min_DCT_scaled_size = 1;
- } else if (cinfo->scale_num * 4 <= cinfo->scale_denom) {
- /* Provide 1/4 scaling */
- cinfo->output_width = (JDIMENSION)
- jdiv_round_up((long) cinfo->image_width, 4L);
- cinfo->output_height = (JDIMENSION)
- jdiv_round_up((long) cinfo->image_height, 4L);
- cinfo->min_DCT_scaled_size = 2;
- } else if (cinfo->scale_num * 2 <= cinfo->scale_denom) {
- /* Provide 1/2 scaling */
- cinfo->output_width = (JDIMENSION)
- jdiv_round_up((long) cinfo->image_width, 2L);
- cinfo->output_height = (JDIMENSION)
- jdiv_round_up((long) cinfo->image_height, 2L);
- cinfo->min_DCT_scaled_size = 4;
- } else {
- /* Provide 1/1 scaling */
- cinfo->output_width = cinfo->image_width;
- cinfo->output_height = cinfo->image_height;
- cinfo->min_DCT_scaled_size = DCTSIZE;
- }
- /* In selecting the actual DCT scaling for each component, we try to
- * scale up the chroma components via IDCT scaling rather than upsampling.
- * This saves time if the upsampler gets to use 1:1 scaling.
- * Note this code assumes that the supported DCT scalings are powers of 2.
- */
- for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
- ci++, compptr++) {
- int ssize = cinfo->min_DCT_scaled_size;
- while (ssize < DCTSIZE &&
- (compptr->h_samp_factor * ssize * 2 <=
- cinfo->max_h_samp_factor * cinfo->min_DCT_scaled_size) &&
- (compptr->v_samp_factor * ssize * 2 <=
- cinfo->max_v_samp_factor * cinfo->min_DCT_scaled_size)) {
- ssize = ssize * 2;
- }
- compptr->DCT_scaled_size = ssize;
- }
-
- /* Recompute downsampled dimensions of components;
- * application needs to know these if using raw downsampled data.
- */
- for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
- ci++, compptr++) {
- /* Size in samples, after IDCT scaling */
- compptr->downsampled_width = (JDIMENSION)
- jdiv_round_up((long) cinfo->image_width *
- (long) (compptr->h_samp_factor * compptr->DCT_scaled_size),
- (long) (cinfo->max_h_samp_factor * DCTSIZE));
- compptr->downsampled_height = (JDIMENSION)
- jdiv_round_up((long) cinfo->image_height *
- (long) (compptr->v_samp_factor * compptr->DCT_scaled_size),
- (long) (cinfo->max_v_samp_factor * DCTSIZE));
- }
-
-#else /* !IDCT_SCALING_SUPPORTED */
-
- /* Hardwire it to "no scaling" */
- cinfo->output_width = cinfo->image_width;
- cinfo->output_height = cinfo->image_height;
- /* jdinput.c has already initialized DCT_scaled_size to DCTSIZE,
- * and has computed unscaled downsampled_width and downsampled_height.
- */
-
-#endif /* IDCT_SCALING_SUPPORTED */
-
- /* Report number of components in selected colorspace. */
- /* Probably this should be in the color conversion module... */
- switch (cinfo->out_color_space) {
- case JCS_GRAYSCALE:
- cinfo->out_color_components = 1;
- break;
- case JCS_RGB:
-#if RGB_PIXELSIZE != 3
- cinfo->out_color_components = RGB_PIXELSIZE;
- break;
-#endif /* else share code with YCbCr */
- case JCS_YCbCr:
- cinfo->out_color_components = 3;
- break;
- case JCS_CMYK:
- case JCS_YCCK:
- cinfo->out_color_components = 4;
- break;
- default: /* else must be same colorspace as in file */
- cinfo->out_color_components = cinfo->num_components;
- break;
- }
- cinfo->output_components = (cinfo->quantize_colors ? 1 :
- cinfo->out_color_components);
-
- /* See if upsampler will want to emit more than one row at a time */
- if (use_merged_upsample(cinfo))
- cinfo->rec_outbuf_height = cinfo->max_v_samp_factor;
- else
- cinfo->rec_outbuf_height = 1;
-}
-
-
-/*
- * Several decompression processes need to range-limit values to the range
- * 0..MAXJSAMPLE; the input value may fall somewhat outside this range
- * due to noise introduced by quantization, roundoff error, etc. These
- * processes are inner loops and need to be as fast as possible. On most
- * machines, particularly CPUs with pipelines or instruction prefetch,
- * a (subscript-check-less) C table lookup
- * x = sample_range_limit[x];
- * is faster than explicit tests
- * if (x < 0) x = 0;
- * else if (x > MAXJSAMPLE) x = MAXJSAMPLE;
- * These processes all use a common table prepared by the routine below.
- *
- * For most steps we can mathematically guarantee that the initial value
- * of x is within MAXJSAMPLE+1 of the legal range, so a table running from
- * -(MAXJSAMPLE+1) to 2*MAXJSAMPLE+1 is sufficient. But for the initial
- * limiting step (just after the IDCT), a wildly out-of-range value is
- * possible if the input data is corrupt. To avoid any chance of indexing
- * off the end of memory and getting a bad-pointer trap, we perform the
- * post-IDCT limiting thus:
- * x = range_limit[x & MASK];
- * where MASK is 2 bits wider than legal sample data, ie 10 bits for 8-bit
- * samples. Under normal circumstances this is more than enough range and
- * a correct output will be generated; with bogus input data the mask will
- * cause wraparound, and we will safely generate a bogus-but-in-range output.
- * For the post-IDCT step, we want to convert the data from signed to unsigned
- * representation by adding CENTERJSAMPLE at the same time that we limit it.
- * So the post-IDCT limiting table ends up looking like this:
- * CENTERJSAMPLE,CENTERJSAMPLE+1,...,MAXJSAMPLE,
- * MAXJSAMPLE (repeat 2*(MAXJSAMPLE+1)-CENTERJSAMPLE times),
- * 0 (repeat 2*(MAXJSAMPLE+1)-CENTERJSAMPLE times),
- * 0,1,...,CENTERJSAMPLE-1
- * Negative inputs select values from the upper half of the table after
- * masking.
- *
- * We can save some space by overlapping the start of the post-IDCT table
- * with the simpler range limiting table. The post-IDCT table begins at
- * sample_range_limit + CENTERJSAMPLE.
- *
- * Note that the table is allocated in near data space on PCs; it's small
- * enough and used often enough to justify this.
- */
-
-LOCAL(void)
-prepare_range_limit_table (j_decompress_ptr cinfo)
-/* Allocate and fill in the sample_range_limit table */
-{
- JSAMPLE * table;
- int i;
-
- table = (JSAMPLE *)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- (5 * (MAXJSAMPLE+1) + CENTERJSAMPLE) * SIZEOF(JSAMPLE));
- table += (MAXJSAMPLE+1); /* allow negative subscripts of simple table */
- cinfo->sample_range_limit = table;
- /* First segment of "simple" table: limit[x] = 0 for x < 0 */
- MEMZERO(table - (MAXJSAMPLE+1), (MAXJSAMPLE+1) * SIZEOF(JSAMPLE));
- /* Main part of "simple" table: limit[x] = x */
- for (i = 0; i <= MAXJSAMPLE; i++)
- table[i] = (JSAMPLE) i;
- table += CENTERJSAMPLE; /* Point to where post-IDCT table starts */
- /* End of simple table, rest of first half of post-IDCT table */
- for (i = CENTERJSAMPLE; i < 2*(MAXJSAMPLE+1); i++)
- table[i] = MAXJSAMPLE;
- /* Second half of post-IDCT table */
- MEMZERO(table + (2 * (MAXJSAMPLE+1)),
- (2 * (MAXJSAMPLE+1) - CENTERJSAMPLE) * SIZEOF(JSAMPLE));
- MEMCOPY(table + (4 * (MAXJSAMPLE+1) - CENTERJSAMPLE),
- cinfo->sample_range_limit, CENTERJSAMPLE * SIZEOF(JSAMPLE));
-}
-
-
-/*
- * Master selection of decompression modules.
- * This is done once at jpeg_start_decompress time. We determine
- * which modules will be used and give them appropriate initialization calls.
- * We also initialize the decompressor input side to begin consuming data.
- *
- * Since jpeg_read_header has finished, we know what is in the SOF
- * and (first) SOS markers. We also have all the application parameter
- * settings.
- */
-
-LOCAL(void)
-master_selection (j_decompress_ptr cinfo)
-{
- my_master_ptr master = (my_master_ptr) cinfo->master;
- boolean use_c_buffer;
- long samplesperrow;
- JDIMENSION jd_samplesperrow;
-
- /* Initialize dimensions and other stuff */
- jpeg_calc_output_dimensions(cinfo);
- prepare_range_limit_table(cinfo);
-
- /* Width of an output scanline must be representable as JDIMENSION. */
- samplesperrow = (long) cinfo->output_width * (long) cinfo->out_color_components;
- jd_samplesperrow = (JDIMENSION) samplesperrow;
- if ((long) jd_samplesperrow != samplesperrow)
- ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);
-
- /* Initialize my private state */
- master->pass_number = 0;
- master->using_merged_upsample = use_merged_upsample(cinfo);
-
- /* Color quantizer selection */
- master->quantizer_1pass = NULL;
- master->quantizer_2pass = NULL;
- /* No mode changes if not using buffered-image mode. */
- if (! cinfo->quantize_colors || ! cinfo->buffered_image) {
- cinfo->enable_1pass_quant = FALSE;
- cinfo->enable_external_quant = FALSE;
- cinfo->enable_2pass_quant = FALSE;
- }
- if (cinfo->quantize_colors) {
- if (cinfo->raw_data_out)
- ERREXIT(cinfo, JERR_NOTIMPL);
- /* 2-pass quantizer only works in 3-component color space. */
- if (cinfo->out_color_components != 3) {
- cinfo->enable_1pass_quant = TRUE;
- cinfo->enable_external_quant = FALSE;
- cinfo->enable_2pass_quant = FALSE;
- cinfo->colormap = NULL;
- } else if (cinfo->colormap != NULL) {
- cinfo->enable_external_quant = TRUE;
- } else if (cinfo->two_pass_quantize) {
- cinfo->enable_2pass_quant = TRUE;
- } else {
- cinfo->enable_1pass_quant = TRUE;
- }
-
- if (cinfo->enable_1pass_quant) {
-#ifdef QUANT_1PASS_SUPPORTED
- jinit_1pass_quantizer(cinfo);
- master->quantizer_1pass = cinfo->cquantize;
-#else
- ERREXIT(cinfo, JERR_NOT_COMPILED);
-#endif
- }
-
- /* We use the 2-pass code to map to external colormaps. */
- if (cinfo->enable_2pass_quant || cinfo->enable_external_quant) {
-#ifdef QUANT_2PASS_SUPPORTED
- jinit_2pass_quantizer(cinfo);
- master->quantizer_2pass = cinfo->cquantize;
-#else
- ERREXIT(cinfo, JERR_NOT_COMPILED);
-#endif
- }
- /* If both quantizers are initialized, the 2-pass one is left active;
- * this is necessary for starting with quantization to an external map.
- */
- }
-
- /* Post-processing: in particular, color conversion first */
- if (! cinfo->raw_data_out) {
- if (master->using_merged_upsample) {
-#ifdef UPSAMPLE_MERGING_SUPPORTED
- jinit_merged_upsampler(cinfo); /* does color conversion too */
-#else
- ERREXIT(cinfo, JERR_NOT_COMPILED);
-#endif
- } else {
- jinit_color_deconverter(cinfo);
- jinit_upsampler(cinfo);
- }
- jinit_d_post_controller(cinfo, cinfo->enable_2pass_quant);
- }
- /* Inverse DCT */
- jinit_inverse_dct(cinfo);
- /* Entropy decoding: either Huffman or arithmetic coding. */
- if (cinfo->arith_code) {
- ERREXIT(cinfo, JERR_ARITH_NOTIMPL);
- } else {
- if (cinfo->progressive_mode) {
-#ifdef D_PROGRESSIVE_SUPPORTED
- jinit_phuff_decoder(cinfo);
-#else
- ERREXIT(cinfo, JERR_NOT_COMPILED);
-#endif
- } else
- jinit_huff_decoder(cinfo);
- }
-
- /* Initialize principal buffer controllers. */
- use_c_buffer = cinfo->inputctl->has_multiple_scans || cinfo->buffered_image;
- jinit_d_coef_controller(cinfo, use_c_buffer);
-
- if (! cinfo->raw_data_out)
- jinit_d_main_controller(cinfo, FALSE /* never need full buffer here */);
-
- /* We can now tell the memory manager to allocate virtual arrays. */
- (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo);
-
- /* Initialize input side of decompressor to consume first scan. */
- (*cinfo->inputctl->start_input_pass) (cinfo);
-
-#ifdef D_MULTISCAN_FILES_SUPPORTED
- /* If jpeg_start_decompress will read the whole file, initialize
- * progress monitoring appropriately. The input step is counted
- * as one pass.
- */
- if (cinfo->progress != NULL && ! cinfo->buffered_image &&
- cinfo->inputctl->has_multiple_scans) {
- int nscans;
- /* Estimate number of scans to set pass_limit. */
- if (cinfo->progressive_mode) {
- /* Arbitrarily estimate 2 interleaved DC scans + 3 AC scans/component. */
- nscans = 2 + 3 * cinfo->num_components;
- } else {
- /* For a nonprogressive multiscan file, estimate 1 scan per component. */
- nscans = cinfo->num_components;
- }
- cinfo->progress->pass_counter = 0L;
- cinfo->progress->pass_limit = (long) cinfo->total_iMCU_rows * nscans;
- cinfo->progress->completed_passes = 0;
- cinfo->progress->total_passes = (cinfo->enable_2pass_quant ? 3 : 2);
- /* Count the input pass as done */
- master->pass_number++;
- }
-#endif /* D_MULTISCAN_FILES_SUPPORTED */
-}
-
-
-/*
- * Per-pass setup.
- * This is called at the beginning of each output pass. We determine which
- * modules will be active during this pass and give them appropriate
- * start_pass calls. We also set is_dummy_pass to indicate whether this
- * is a "real" output pass or a dummy pass for color quantization.
- * (In the latter case, jdapistd.c will crank the pass to completion.)
- */
-
-METHODDEF(void)
-prepare_for_output_pass (j_decompress_ptr cinfo)
-{
- my_master_ptr master = (my_master_ptr) cinfo->master;
-
- if (master->pub.is_dummy_pass) {
-#ifdef QUANT_2PASS_SUPPORTED
- /* Final pass of 2-pass quantization */
- master->pub.is_dummy_pass = FALSE;
- (*cinfo->cquantize->start_pass) (cinfo, FALSE);
- (*cinfo->post->start_pass) (cinfo, JBUF_CRANK_DEST);
- (*cinfo->main->start_pass) (cinfo, JBUF_CRANK_DEST);
-#else
- ERREXIT(cinfo, JERR_NOT_COMPILED);
-#endif /* QUANT_2PASS_SUPPORTED */
- } else {
- if (cinfo->quantize_colors && cinfo->colormap == NULL) {
- /* Select new quantization method */
- if (cinfo->two_pass_quantize && cinfo->enable_2pass_quant) {
- cinfo->cquantize = master->quantizer_2pass;
- master->pub.is_dummy_pass = TRUE;
- } else if (cinfo->enable_1pass_quant) {
- cinfo->cquantize = master->quantizer_1pass;
- } else {
- ERREXIT(cinfo, JERR_MODE_CHANGE);
- }
- }
- (*cinfo->idct->start_pass) (cinfo);
- (*cinfo->coef->start_output_pass) (cinfo);
- if (! cinfo->raw_data_out) {
- if (! master->using_merged_upsample)
- (*cinfo->cconvert->start_pass) (cinfo);
- (*cinfo->upsample->start_pass) (cinfo);
- if (cinfo->quantize_colors)
- (*cinfo->cquantize->start_pass) (cinfo, master->pub.is_dummy_pass);
- (*cinfo->post->start_pass) (cinfo,
- (master->pub.is_dummy_pass ? JBUF_SAVE_AND_PASS : JBUF_PASS_THRU));
- (*cinfo->main->start_pass) (cinfo, JBUF_PASS_THRU);
- }
- }
-
- /* Set up progress monitor's pass info if present */
- if (cinfo->progress != NULL) {
- cinfo->progress->completed_passes = master->pass_number;
- cinfo->progress->total_passes = master->pass_number +
- (master->pub.is_dummy_pass ? 2 : 1);
- /* In buffered-image mode, we assume one more output pass if EOI not
- * yet reached, but no more passes if EOI has been reached.
- */
- if (cinfo->buffered_image && ! cinfo->inputctl->eoi_reached) {
- cinfo->progress->total_passes += (cinfo->enable_2pass_quant ? 2 : 1);
- }
- }
-}
-
-
-/*
- * Finish up at end of an output pass.
- */
-
-METHODDEF(void)
-finish_output_pass (j_decompress_ptr cinfo)
-{
- my_master_ptr master = (my_master_ptr) cinfo->master;
-
- if (cinfo->quantize_colors)
- (*cinfo->cquantize->finish_pass) (cinfo);
- master->pass_number++;
-}
-
-
-#ifdef D_MULTISCAN_FILES_SUPPORTED
-
-/*
- * Switch to a new external colormap between output passes.
- */
-
-GLOBAL(void)
-jpeg_new_colormap (j_decompress_ptr cinfo)
-{
- my_master_ptr master = (my_master_ptr) cinfo->master;
-
- /* Prevent application from calling me at wrong times */
- if (cinfo->global_state != DSTATE_BUFIMAGE)
- ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
-
- if (cinfo->quantize_colors && cinfo->enable_external_quant &&
- cinfo->colormap != NULL) {
- /* Select 2-pass quantizer for external colormap use */
- cinfo->cquantize = master->quantizer_2pass;
- /* Notify quantizer of colormap change */
- (*cinfo->cquantize->new_color_map) (cinfo);
- master->pub.is_dummy_pass = FALSE; /* just in case */
- } else
- ERREXIT(cinfo, JERR_MODE_CHANGE);
-}
-
-#endif /* D_MULTISCAN_FILES_SUPPORTED */
-
-
-/*
- * Initialize master decompression control and select active modules.
- * This is performed at the start of jpeg_start_decompress.
- */
-
-GLOBAL(void)
-jinit_master_decompress (j_decompress_ptr cinfo)
-{
- my_master_ptr master;
-
- master = (my_master_ptr)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- SIZEOF(my_decomp_master));
- cinfo->master = (struct jpeg_decomp_master *) master;
- master->pub.prepare_for_output_pass = prepare_for_output_pass;
- master->pub.finish_output_pass = finish_output_pass;
-
- master->pub.is_dummy_pass = FALSE;
-
- master_selection(cinfo);
-}
-
-#endif //_FX_JPEG_TURBO_
+#if !defined(_FX_JPEG_TURBO_)
+/*
+ * jdmaster.c
+ *
+ * Copyright (C) 1991-1997, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains master control logic for the JPEG decompressor.
+ * These routines are concerned with selecting the modules to be executed
+ * and with determining the number of passes and the work to be done in each
+ * pass.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+
+
+/* Private state */
+
+typedef struct {
+ struct jpeg_decomp_master pub; /* public fields */
+
+ int pass_number; /* # of passes completed */
+
+ boolean using_merged_upsample; /* TRUE if using merged upsample/cconvert */
+
+ /* Saved references to initialized quantizer modules,
+ * in case we need to switch modes.
+ */
+ struct jpeg_color_quantizer * quantizer_1pass;
+ struct jpeg_color_quantizer * quantizer_2pass;
+} my_decomp_master;
+
+typedef my_decomp_master * my_master_ptr;
+
+
+/*
+ * Determine whether merged upsample/color conversion should be used.
+ * CRUCIAL: this must match the actual capabilities of jdmerge.c!
+ */
+
+LOCAL(boolean)
+use_merged_upsample (j_decompress_ptr cinfo)
+{
+#ifdef UPSAMPLE_MERGING_SUPPORTED
+ /* Merging is the equivalent of plain box-filter upsampling */
+ if (cinfo->do_fancy_upsampling || cinfo->CCIR601_sampling)
+ return FALSE;
+ /* jdmerge.c only supports YCC=>RGB color conversion */
+ if (cinfo->jpeg_color_space != JCS_YCbCr || cinfo->num_components != 3 ||
+ cinfo->out_color_space != JCS_RGB ||
+ cinfo->out_color_components != RGB_PIXELSIZE)
+ return FALSE;
+ /* and it only handles 2h1v or 2h2v sampling ratios */
+ if (cinfo->comp_info[0].h_samp_factor != 2 ||
+ cinfo->comp_info[1].h_samp_factor != 1 ||
+ cinfo->comp_info[2].h_samp_factor != 1 ||
+ cinfo->comp_info[0].v_samp_factor > 2 ||
+ cinfo->comp_info[1].v_samp_factor != 1 ||
+ cinfo->comp_info[2].v_samp_factor != 1)
+ return FALSE;
+ /* furthermore, it doesn't work if we've scaled the IDCTs differently */
+ if (cinfo->comp_info[0].DCT_scaled_size != cinfo->min_DCT_scaled_size ||
+ cinfo->comp_info[1].DCT_scaled_size != cinfo->min_DCT_scaled_size ||
+ cinfo->comp_info[2].DCT_scaled_size != cinfo->min_DCT_scaled_size)
+ return FALSE;
+ /* ??? also need to test for upsample-time rescaling, when & if supported */
+ return TRUE; /* by golly, it'll work... */
+#else
+ return FALSE;
+#endif
+}
+
+
+/*
+ * Compute output image dimensions and related values.
+ * NOTE: this is exported for possible use by application.
+ * Hence it mustn't do anything that can't be done twice.
+ * Also note that it may be called before the master module is initialized!
+ */
+
+GLOBAL(void)
+jpeg_calc_output_dimensions (j_decompress_ptr cinfo)
+/* Do computations that are needed before master selection phase */
+{
+#ifdef IDCT_SCALING_SUPPORTED
+ int ci;
+ jpeg_component_info *compptr;
+#endif
+
+ /* Prevent application from calling me at wrong times */
+ if (cinfo->global_state != DSTATE_READY)
+ ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
+
+#ifdef IDCT_SCALING_SUPPORTED
+
+ /* Compute actual output image dimensions and DCT scaling choices. */
+ if (cinfo->scale_num * 8 <= cinfo->scale_denom) {
+ /* Provide 1/8 scaling */
+ cinfo->output_width = (JDIMENSION)
+ jdiv_round_up((long) cinfo->image_width, 8L);
+ cinfo->output_height = (JDIMENSION)
+ jdiv_round_up((long) cinfo->image_height, 8L);
+ cinfo->min_DCT_scaled_size = 1;
+ } else if (cinfo->scale_num * 4 <= cinfo->scale_denom) {
+ /* Provide 1/4 scaling */
+ cinfo->output_width = (JDIMENSION)
+ jdiv_round_up((long) cinfo->image_width, 4L);
+ cinfo->output_height = (JDIMENSION)
+ jdiv_round_up((long) cinfo->image_height, 4L);
+ cinfo->min_DCT_scaled_size = 2;
+ } else if (cinfo->scale_num * 2 <= cinfo->scale_denom) {
+ /* Provide 1/2 scaling */
+ cinfo->output_width = (JDIMENSION)
+ jdiv_round_up((long) cinfo->image_width, 2L);
+ cinfo->output_height = (JDIMENSION)
+ jdiv_round_up((long) cinfo->image_height, 2L);
+ cinfo->min_DCT_scaled_size = 4;
+ } else {
+ /* Provide 1/1 scaling */
+ cinfo->output_width = cinfo->image_width;
+ cinfo->output_height = cinfo->image_height;
+ cinfo->min_DCT_scaled_size = DCTSIZE;
+ }
+ /* In selecting the actual DCT scaling for each component, we try to
+ * scale up the chroma components via IDCT scaling rather than upsampling.
+ * This saves time if the upsampler gets to use 1:1 scaling.
+ * Note this code assumes that the supported DCT scalings are powers of 2.
+ */
+ for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+ ci++, compptr++) {
+ int ssize = cinfo->min_DCT_scaled_size;
+ while (ssize < DCTSIZE &&
+ (compptr->h_samp_factor * ssize * 2 <=
+ cinfo->max_h_samp_factor * cinfo->min_DCT_scaled_size) &&
+ (compptr->v_samp_factor * ssize * 2 <=
+ cinfo->max_v_samp_factor * cinfo->min_DCT_scaled_size)) {
+ ssize = ssize * 2;
+ }
+ compptr->DCT_scaled_size = ssize;
+ }
+
+ /* Recompute downsampled dimensions of components;
+ * application needs to know these if using raw downsampled data.
+ */
+ for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+ ci++, compptr++) {
+ /* Size in samples, after IDCT scaling */
+ compptr->downsampled_width = (JDIMENSION)
+ jdiv_round_up((long) cinfo->image_width *
+ (long) (compptr->h_samp_factor * compptr->DCT_scaled_size),
+ (long) (cinfo->max_h_samp_factor * DCTSIZE));
+ compptr->downsampled_height = (JDIMENSION)
+ jdiv_round_up((long) cinfo->image_height *
+ (long) (compptr->v_samp_factor * compptr->DCT_scaled_size),
+ (long) (cinfo->max_v_samp_factor * DCTSIZE));
+ }
+
+#else /* !IDCT_SCALING_SUPPORTED */
+
+ /* Hardwire it to "no scaling" */
+ cinfo->output_width = cinfo->image_width;
+ cinfo->output_height = cinfo->image_height;
+ /* jdinput.c has already initialized DCT_scaled_size to DCTSIZE,
+ * and has computed unscaled downsampled_width and downsampled_height.
+ */
+
+#endif /* IDCT_SCALING_SUPPORTED */
+
+ /* Report number of components in selected colorspace. */
+ /* Probably this should be in the color conversion module... */
+ switch (cinfo->out_color_space) {
+ case JCS_GRAYSCALE:
+ cinfo->out_color_components = 1;
+ break;
+ case JCS_RGB:
+#if RGB_PIXELSIZE != 3
+ cinfo->out_color_components = RGB_PIXELSIZE;
+ break;
+#endif /* else share code with YCbCr */
+ case JCS_YCbCr:
+ cinfo->out_color_components = 3;
+ break;
+ case JCS_CMYK:
+ case JCS_YCCK:
+ cinfo->out_color_components = 4;
+ break;
+ default: /* else must be same colorspace as in file */
+ cinfo->out_color_components = cinfo->num_components;
+ break;
+ }
+ cinfo->output_components = (cinfo->quantize_colors ? 1 :
+ cinfo->out_color_components);
+
+ /* See if upsampler will want to emit more than one row at a time */
+ if (use_merged_upsample(cinfo))
+ cinfo->rec_outbuf_height = cinfo->max_v_samp_factor;
+ else
+ cinfo->rec_outbuf_height = 1;
+}
+
+
+/*
+ * Several decompression processes need to range-limit values to the range
+ * 0..MAXJSAMPLE; the input value may fall somewhat outside this range
+ * due to noise introduced by quantization, roundoff error, etc. These
+ * processes are inner loops and need to be as fast as possible. On most
+ * machines, particularly CPUs with pipelines or instruction prefetch,
+ * a (subscript-check-less) C table lookup
+ * x = sample_range_limit[x];
+ * is faster than explicit tests
+ * if (x < 0) x = 0;
+ * else if (x > MAXJSAMPLE) x = MAXJSAMPLE;
+ * These processes all use a common table prepared by the routine below.
+ *
+ * For most steps we can mathematically guarantee that the initial value
+ * of x is within MAXJSAMPLE+1 of the legal range, so a table running from
+ * -(MAXJSAMPLE+1) to 2*MAXJSAMPLE+1 is sufficient. But for the initial
+ * limiting step (just after the IDCT), a wildly out-of-range value is
+ * possible if the input data is corrupt. To avoid any chance of indexing
+ * off the end of memory and getting a bad-pointer trap, we perform the
+ * post-IDCT limiting thus:
+ * x = range_limit[x & MASK];
+ * where MASK is 2 bits wider than legal sample data, ie 10 bits for 8-bit
+ * samples. Under normal circumstances this is more than enough range and
+ * a correct output will be generated; with bogus input data the mask will
+ * cause wraparound, and we will safely generate a bogus-but-in-range output.
+ * For the post-IDCT step, we want to convert the data from signed to unsigned
+ * representation by adding CENTERJSAMPLE at the same time that we limit it.
+ * So the post-IDCT limiting table ends up looking like this:
+ * CENTERJSAMPLE,CENTERJSAMPLE+1,...,MAXJSAMPLE,
+ * MAXJSAMPLE (repeat 2*(MAXJSAMPLE+1)-CENTERJSAMPLE times),
+ * 0 (repeat 2*(MAXJSAMPLE+1)-CENTERJSAMPLE times),
+ * 0,1,...,CENTERJSAMPLE-1
+ * Negative inputs select values from the upper half of the table after
+ * masking.
+ *
+ * We can save some space by overlapping the start of the post-IDCT table
+ * with the simpler range limiting table. The post-IDCT table begins at
+ * sample_range_limit + CENTERJSAMPLE.
+ *
+ * Note that the table is allocated in near data space on PCs; it's small
+ * enough and used often enough to justify this.
+ */
+
+LOCAL(void)
+prepare_range_limit_table (j_decompress_ptr cinfo)
+/* Allocate and fill in the sample_range_limit table */
+{
+ JSAMPLE * table;
+ int i;
+
+ table = (JSAMPLE *)
+ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ (5 * (MAXJSAMPLE+1) + CENTERJSAMPLE) * SIZEOF(JSAMPLE));
+ table += (MAXJSAMPLE+1); /* allow negative subscripts of simple table */
+ cinfo->sample_range_limit = table;
+ /* First segment of "simple" table: limit[x] = 0 for x < 0 */
+ MEMZERO(table - (MAXJSAMPLE+1), (MAXJSAMPLE+1) * SIZEOF(JSAMPLE));
+ /* Main part of "simple" table: limit[x] = x */
+ for (i = 0; i <= MAXJSAMPLE; i++)
+ table[i] = (JSAMPLE) i;
+ table += CENTERJSAMPLE; /* Point to where post-IDCT table starts */
+ /* End of simple table, rest of first half of post-IDCT table */
+ for (i = CENTERJSAMPLE; i < 2*(MAXJSAMPLE+1); i++)
+ table[i] = MAXJSAMPLE;
+ /* Second half of post-IDCT table */
+ MEMZERO(table + (2 * (MAXJSAMPLE+1)),
+ (2 * (MAXJSAMPLE+1) - CENTERJSAMPLE) * SIZEOF(JSAMPLE));
+ MEMCOPY(table + (4 * (MAXJSAMPLE+1) - CENTERJSAMPLE),
+ cinfo->sample_range_limit, CENTERJSAMPLE * SIZEOF(JSAMPLE));
+}
+
+
+/*
+ * Master selection of decompression modules.
+ * This is done once at jpeg_start_decompress time. We determine
+ * which modules will be used and give them appropriate initialization calls.
+ * We also initialize the decompressor input side to begin consuming data.
+ *
+ * Since jpeg_read_header has finished, we know what is in the SOF
+ * and (first) SOS markers. We also have all the application parameter
+ * settings.
+ */
+
+LOCAL(void)
+master_selection (j_decompress_ptr cinfo)
+{
+ my_master_ptr master = (my_master_ptr) cinfo->master;
+ boolean use_c_buffer;
+ long samplesperrow;
+ JDIMENSION jd_samplesperrow;
+
+ /* Initialize dimensions and other stuff */
+ jpeg_calc_output_dimensions(cinfo);
+ prepare_range_limit_table(cinfo);
+
+ /* Width of an output scanline must be representable as JDIMENSION. */
+ samplesperrow = (long) cinfo->output_width * (long) cinfo->out_color_components;
+ jd_samplesperrow = (JDIMENSION) samplesperrow;
+ if ((long) jd_samplesperrow != samplesperrow)
+ ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);
+
+ /* Initialize my private state */
+ master->pass_number = 0;
+ master->using_merged_upsample = use_merged_upsample(cinfo);
+
+ /* Color quantizer selection */
+ master->quantizer_1pass = NULL;
+ master->quantizer_2pass = NULL;
+ /* No mode changes if not using buffered-image mode. */
+ if (! cinfo->quantize_colors || ! cinfo->buffered_image) {
+ cinfo->enable_1pass_quant = FALSE;
+ cinfo->enable_external_quant = FALSE;
+ cinfo->enable_2pass_quant = FALSE;
+ }
+ if (cinfo->quantize_colors) {
+ if (cinfo->raw_data_out)
+ ERREXIT(cinfo, JERR_NOTIMPL);
+ /* 2-pass quantizer only works in 3-component color space. */
+ if (cinfo->out_color_components != 3) {
+ cinfo->enable_1pass_quant = TRUE;
+ cinfo->enable_external_quant = FALSE;
+ cinfo->enable_2pass_quant = FALSE;
+ cinfo->colormap = NULL;
+ } else if (cinfo->colormap != NULL) {
+ cinfo->enable_external_quant = TRUE;
+ } else if (cinfo->two_pass_quantize) {
+ cinfo->enable_2pass_quant = TRUE;
+ } else {
+ cinfo->enable_1pass_quant = TRUE;
+ }
+
+ if (cinfo->enable_1pass_quant) {
+#ifdef QUANT_1PASS_SUPPORTED
+ jinit_1pass_quantizer(cinfo);
+ master->quantizer_1pass = cinfo->cquantize;
+#else
+ ERREXIT(cinfo, JERR_NOT_COMPILED);
+#endif
+ }
+
+ /* We use the 2-pass code to map to external colormaps. */
+ if (cinfo->enable_2pass_quant || cinfo->enable_external_quant) {
+#ifdef QUANT_2PASS_SUPPORTED
+ jinit_2pass_quantizer(cinfo);
+ master->quantizer_2pass = cinfo->cquantize;
+#else
+ ERREXIT(cinfo, JERR_NOT_COMPILED);
+#endif
+ }
+ /* If both quantizers are initialized, the 2-pass one is left active;
+ * this is necessary for starting with quantization to an external map.
+ */
+ }
+
+ /* Post-processing: in particular, color conversion first */
+ if (! cinfo->raw_data_out) {
+ if (master->using_merged_upsample) {
+#ifdef UPSAMPLE_MERGING_SUPPORTED
+ jinit_merged_upsampler(cinfo); /* does color conversion too */
+#else
+ ERREXIT(cinfo, JERR_NOT_COMPILED);
+#endif
+ } else {
+ jinit_color_deconverter(cinfo);
+ jinit_upsampler(cinfo);
+ }
+ jinit_d_post_controller(cinfo, cinfo->enable_2pass_quant);
+ }
+ /* Inverse DCT */
+ jinit_inverse_dct(cinfo);
+ /* Entropy decoding: either Huffman or arithmetic coding. */
+ if (cinfo->arith_code) {
+ ERREXIT(cinfo, JERR_ARITH_NOTIMPL);
+ } else {
+ if (cinfo->progressive_mode) {
+#ifdef D_PROGRESSIVE_SUPPORTED
+ jinit_phuff_decoder(cinfo);
+#else
+ ERREXIT(cinfo, JERR_NOT_COMPILED);
+#endif
+ } else
+ jinit_huff_decoder(cinfo);
+ }
+
+ /* Initialize principal buffer controllers. */
+ use_c_buffer = cinfo->inputctl->has_multiple_scans || cinfo->buffered_image;
+ jinit_d_coef_controller(cinfo, use_c_buffer);
+
+ if (! cinfo->raw_data_out)
+ jinit_d_main_controller(cinfo, FALSE /* never need full buffer here */);
+
+ /* We can now tell the memory manager to allocate virtual arrays. */
+ (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo);
+
+ /* Initialize input side of decompressor to consume first scan. */
+ (*cinfo->inputctl->start_input_pass) (cinfo);
+
+#ifdef D_MULTISCAN_FILES_SUPPORTED
+ /* If jpeg_start_decompress will read the whole file, initialize
+ * progress monitoring appropriately. The input step is counted
+ * as one pass.
+ */
+ if (cinfo->progress != NULL && ! cinfo->buffered_image &&
+ cinfo->inputctl->has_multiple_scans) {
+ int nscans;
+ /* Estimate number of scans to set pass_limit. */
+ if (cinfo->progressive_mode) {
+ /* Arbitrarily estimate 2 interleaved DC scans + 3 AC scans/component. */
+ nscans = 2 + 3 * cinfo->num_components;
+ } else {
+ /* For a nonprogressive multiscan file, estimate 1 scan per component. */
+ nscans = cinfo->num_components;
+ }
+ cinfo->progress->pass_counter = 0L;
+ cinfo->progress->pass_limit = (long) cinfo->total_iMCU_rows * nscans;
+ cinfo->progress->completed_passes = 0;
+ cinfo->progress->total_passes = (cinfo->enable_2pass_quant ? 3 : 2);
+ /* Count the input pass as done */
+ master->pass_number++;
+ }
+#endif /* D_MULTISCAN_FILES_SUPPORTED */
+}
+
+
+/*
+ * Per-pass setup.
+ * This is called at the beginning of each output pass. We determine which
+ * modules will be active during this pass and give them appropriate
+ * start_pass calls. We also set is_dummy_pass to indicate whether this
+ * is a "real" output pass or a dummy pass for color quantization.
+ * (In the latter case, jdapistd.c will crank the pass to completion.)
+ */
+
+METHODDEF(void)
+prepare_for_output_pass (j_decompress_ptr cinfo)
+{
+ my_master_ptr master = (my_master_ptr) cinfo->master;
+
+ if (master->pub.is_dummy_pass) {
+#ifdef QUANT_2PASS_SUPPORTED
+ /* Final pass of 2-pass quantization */
+ master->pub.is_dummy_pass = FALSE;
+ (*cinfo->cquantize->start_pass) (cinfo, FALSE);
+ (*cinfo->post->start_pass) (cinfo, JBUF_CRANK_DEST);
+ (*cinfo->main->start_pass) (cinfo, JBUF_CRANK_DEST);
+#else
+ ERREXIT(cinfo, JERR_NOT_COMPILED);
+#endif /* QUANT_2PASS_SUPPORTED */
+ } else {
+ if (cinfo->quantize_colors && cinfo->colormap == NULL) {
+ /* Select new quantization method */
+ if (cinfo->two_pass_quantize && cinfo->enable_2pass_quant) {
+ cinfo->cquantize = master->quantizer_2pass;
+ master->pub.is_dummy_pass = TRUE;
+ } else if (cinfo->enable_1pass_quant) {
+ cinfo->cquantize = master->quantizer_1pass;
+ } else {
+ ERREXIT(cinfo, JERR_MODE_CHANGE);
+ }
+ }
+ (*cinfo->idct->start_pass) (cinfo);
+ (*cinfo->coef->start_output_pass) (cinfo);
+ if (! cinfo->raw_data_out) {
+ if (! master->using_merged_upsample)
+ (*cinfo->cconvert->start_pass) (cinfo);
+ (*cinfo->upsample->start_pass) (cinfo);
+ if (cinfo->quantize_colors)
+ (*cinfo->cquantize->start_pass) (cinfo, master->pub.is_dummy_pass);
+ (*cinfo->post->start_pass) (cinfo,
+ (master->pub.is_dummy_pass ? JBUF_SAVE_AND_PASS : JBUF_PASS_THRU));
+ (*cinfo->main->start_pass) (cinfo, JBUF_PASS_THRU);
+ }
+ }
+
+ /* Set up progress monitor's pass info if present */
+ if (cinfo->progress != NULL) {
+ cinfo->progress->completed_passes = master->pass_number;
+ cinfo->progress->total_passes = master->pass_number +
+ (master->pub.is_dummy_pass ? 2 : 1);
+ /* In buffered-image mode, we assume one more output pass if EOI not
+ * yet reached, but no more passes if EOI has been reached.
+ */
+ if (cinfo->buffered_image && ! cinfo->inputctl->eoi_reached) {
+ cinfo->progress->total_passes += (cinfo->enable_2pass_quant ? 2 : 1);
+ }
+ }
+}
+
+
+/*
+ * Finish up at end of an output pass.
+ */
+
+METHODDEF(void)
+finish_output_pass (j_decompress_ptr cinfo)
+{
+ my_master_ptr master = (my_master_ptr) cinfo->master;
+
+ if (cinfo->quantize_colors)
+ (*cinfo->cquantize->finish_pass) (cinfo);
+ master->pass_number++;
+}
+
+
+#ifdef D_MULTISCAN_FILES_SUPPORTED
+
+/*
+ * Switch to a new external colormap between output passes.
+ */
+
+GLOBAL(void)
+jpeg_new_colormap (j_decompress_ptr cinfo)
+{
+ my_master_ptr master = (my_master_ptr) cinfo->master;
+
+ /* Prevent application from calling me at wrong times */
+ if (cinfo->global_state != DSTATE_BUFIMAGE)
+ ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
+
+ if (cinfo->quantize_colors && cinfo->enable_external_quant &&
+ cinfo->colormap != NULL) {
+ /* Select 2-pass quantizer for external colormap use */
+ cinfo->cquantize = master->quantizer_2pass;
+ /* Notify quantizer of colormap change */
+ (*cinfo->cquantize->new_color_map) (cinfo);
+ master->pub.is_dummy_pass = FALSE; /* just in case */
+ } else
+ ERREXIT(cinfo, JERR_MODE_CHANGE);
+}
+
+#endif /* D_MULTISCAN_FILES_SUPPORTED */
+
+
+/*
+ * Initialize master decompression control and select active modules.
+ * This is performed at the start of jpeg_start_decompress.
+ */
+
+GLOBAL(void)
+jinit_master_decompress (j_decompress_ptr cinfo)
+{
+ my_master_ptr master;
+
+ master = (my_master_ptr)
+ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ SIZEOF(my_decomp_master));
+ cinfo->master = (struct jpeg_decomp_master *) master;
+ master->pub.prepare_for_output_pass = prepare_for_output_pass;
+ master->pub.finish_output_pass = finish_output_pass;
+
+ master->pub.is_dummy_pass = FALSE;
+
+ master_selection(cinfo);
+}
+
+#endif //_FX_JPEG_TURBO_
diff --git a/core/src/fxcodec/libjpeg/fpdfapi_jdmerge.c b/core/src/fxcodec/libjpeg/fpdfapi_jdmerge.c
index 29a996c063..c229f86aa5 100644
--- a/core/src/fxcodec/libjpeg/fpdfapi_jdmerge.c
+++ b/core/src/fxcodec/libjpeg/fpdfapi_jdmerge.c
@@ -1,406 +1,406 @@
-#if !defined(_FX_JPEG_TURBO_)
-/*
- * jdmerge.c
- *
- * Copyright (C) 1994-1996, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- * For conditions of distribution and use, see the accompanying README file.
- *
- * This file contains code for merged upsampling/color conversion.
- *
- * This file combines functions from jdsample.c and jdcolor.c;
- * read those files first to understand what's going on.
- *
- * When the chroma components are to be upsampled by simple replication
- * (ie, box filtering), we can save some work in color conversion by
- * calculating all the output pixels corresponding to a pair of chroma
- * samples at one time. In the conversion equations
- * R = Y + K1 * Cr
- * G = Y + K2 * Cb + K3 * Cr
- * B = Y + K4 * Cb
- * only the Y term varies among the group of pixels corresponding to a pair
- * of chroma samples, so the rest of the terms can be calculated just once.
- * At typical sampling ratios, this eliminates half or three-quarters of the
- * multiplications needed for color conversion.
- *
- * This file currently provides implementations for the following cases:
- * YCbCr => RGB color conversion only.
- * Sampling ratios of 2h1v or 2h2v.
- * No scaling needed at upsample time.
- * Corner-aligned (non-CCIR601) sampling alignment.
- * Other special cases could be added, but in most applications these are
- * the only common cases. (For uncommon cases we fall back on the more
- * general code in jdsample.c and jdcolor.c.)
- */
-
-#define JPEG_INTERNALS
-#include "jinclude.h"
-#include "jpeglib.h"
-
-#ifdef UPSAMPLE_MERGING_SUPPORTED
-
-#ifdef _FX_MANAGED_CODE_
-#define my_upsampler my_upsampler_m
-#endif
-
-/* Private subobject */
-
-typedef struct {
- struct jpeg_upsampler pub; /* public fields */
-
- /* Pointer to routine to do actual upsampling/conversion of one row group */
- JMETHOD(void, upmethod, (j_decompress_ptr cinfo,
- JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr,
- JSAMPARRAY output_buf));
-
- /* Private state for YCC->RGB conversion */
- int * Cr_r_tab; /* => table for Cr to R conversion */
- int * Cb_b_tab; /* => table for Cb to B conversion */
- INT32 * Cr_g_tab; /* => table for Cr to G conversion */
- INT32 * Cb_g_tab; /* => table for Cb to G conversion */
-
- /* For 2:1 vertical sampling, we produce two output rows at a time.
- * We need a "spare" row buffer to hold the second output row if the
- * application provides just a one-row buffer; we also use the spare
- * to discard the dummy last row if the image height is odd.
- */
- JSAMPROW spare_row;
- boolean spare_full; /* T if spare buffer is occupied */
-
- JDIMENSION out_row_width; /* samples per output row */
- JDIMENSION rows_to_go; /* counts rows remaining in image */
-} my_upsampler;
-
-typedef my_upsampler * my_upsample_ptr;
-
-#define SCALEBITS 16 /* speediest right-shift on some machines */
-#define ONE_HALF ((INT32) 1 << (SCALEBITS-1))
-#define FIX(x) ((INT32) ((x) * (1L<<SCALEBITS) + 0.5))
-
-
-/*
- * Initialize tables for YCC->RGB colorspace conversion.
- * This is taken directly from jdcolor.c; see that file for more info.
- */
-
-LOCAL(void)
-build_ycc_rgb_table (j_decompress_ptr cinfo)
-{
- my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
- int i;
- INT32 x;
- SHIFT_TEMPS
-
- upsample->Cr_r_tab = (int *)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- (MAXJSAMPLE+1) * SIZEOF(int));
- upsample->Cb_b_tab = (int *)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- (MAXJSAMPLE+1) * SIZEOF(int));
- upsample->Cr_g_tab = (INT32 *)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- (MAXJSAMPLE+1) * SIZEOF(INT32));
- upsample->Cb_g_tab = (INT32 *)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- (MAXJSAMPLE+1) * SIZEOF(INT32));
-
- for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) {
- /* i is the actual input pixel value, in the range 0..MAXJSAMPLE */
- /* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */
- /* Cr=>R value is nearest int to 1.40200 * x */
- upsample->Cr_r_tab[i] = (int)
- RIGHT_SHIFT(FIX(1.40200) * x + ONE_HALF, SCALEBITS);
- /* Cb=>B value is nearest int to 1.77200 * x */
- upsample->Cb_b_tab[i] = (int)
- RIGHT_SHIFT(FIX(1.77200) * x + ONE_HALF, SCALEBITS);
- /* Cr=>G value is scaled-up -0.71414 * x */
- upsample->Cr_g_tab[i] = (- FIX(0.71414)) * x;
- /* Cb=>G value is scaled-up -0.34414 * x */
- /* We also add in ONE_HALF so that need not do it in inner loop */
- upsample->Cb_g_tab[i] = (- FIX(0.34414)) * x + ONE_HALF;
- }
-}
-
-
-/*
- * Initialize for an upsampling pass.
- */
-
-METHODDEF(void)
-start_pass_merged_upsample (j_decompress_ptr cinfo)
-{
- my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
-
- /* Mark the spare buffer empty */
- upsample->spare_full = FALSE;
- /* Initialize total-height counter for detecting bottom of image */
- upsample->rows_to_go = cinfo->output_height;
-}
-
-
-/*
- * Control routine to do upsampling (and color conversion).
- *
- * The control routine just handles the row buffering considerations.
- */
-
-METHODDEF(void)
-merged_2v_upsample (j_decompress_ptr cinfo,
- JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
- JDIMENSION in_row_groups_avail,
- JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
- JDIMENSION out_rows_avail)
-/* 2:1 vertical sampling case: may need a spare row. */
-{
- my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
- JSAMPROW work_ptrs[2];
- JDIMENSION num_rows; /* number of rows returned to caller */
-
- if (upsample->spare_full) {
- /* If we have a spare row saved from a previous cycle, just return it. */
- jcopy_sample_rows(& upsample->spare_row, 0, output_buf + *out_row_ctr, 0,
- 1, upsample->out_row_width);
- num_rows = 1;
- upsample->spare_full = FALSE;
- } else {
- /* Figure number of rows to return to caller. */
- num_rows = 2;
- /* Not more than the distance to the end of the image. */
- if (num_rows > upsample->rows_to_go)
- num_rows = upsample->rows_to_go;
- /* And not more than what the client can accept: */
- out_rows_avail -= *out_row_ctr;
- if (num_rows > out_rows_avail)
- num_rows = out_rows_avail;
- /* Create output pointer array for upsampler. */
- work_ptrs[0] = output_buf[*out_row_ctr];
- if (num_rows > 1) {
- work_ptrs[1] = output_buf[*out_row_ctr + 1];
- } else {
- work_ptrs[1] = upsample->spare_row;
- upsample->spare_full = TRUE;
- }
- /* Now do the upsampling. */
- (*upsample->upmethod) (cinfo, input_buf, *in_row_group_ctr, work_ptrs);
- }
-
- /* Adjust counts */
- *out_row_ctr += num_rows;
- upsample->rows_to_go -= num_rows;
- /* When the buffer is emptied, declare this input row group consumed */
- if (! upsample->spare_full)
- (*in_row_group_ctr)++;
-}
-
-
-METHODDEF(void)
-merged_1v_upsample (j_decompress_ptr cinfo,
- JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
- JDIMENSION in_row_groups_avail,
- JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
- JDIMENSION out_rows_avail)
-/* 1:1 vertical sampling case: much easier, never need a spare row. */
-{
- my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
-
- /* Just do the upsampling. */
- (*upsample->upmethod) (cinfo, input_buf, *in_row_group_ctr,
- output_buf + *out_row_ctr);
- /* Adjust counts */
- (*out_row_ctr)++;
- (*in_row_group_ctr)++;
-}
-
-
-/*
- * These are the routines invoked by the control routines to do
- * the actual upsampling/conversion. One row group is processed per call.
- *
- * Note: since we may be writing directly into application-supplied buffers,
- * we have to be honest about the output width; we can't assume the buffer
- * has been rounded up to an even width.
- */
-
-
-/*
- * Upsample and color convert for the case of 2:1 horizontal and 1:1 vertical.
- */
-
-METHODDEF(void)
-h2v1_merged_upsample (j_decompress_ptr cinfo,
- JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr,
- JSAMPARRAY output_buf)
-{
- my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
- register int y, cred, cgreen, cblue;
- int cb, cr;
- register JSAMPROW outptr;
- JSAMPROW inptr0, inptr1, inptr2;
- JDIMENSION col;
- /* copy these pointers into registers if possible */
- register JSAMPLE * range_limit = cinfo->sample_range_limit;
- int * Crrtab = upsample->Cr_r_tab;
- int * Cbbtab = upsample->Cb_b_tab;
- INT32 * Crgtab = upsample->Cr_g_tab;
- INT32 * Cbgtab = upsample->Cb_g_tab;
- SHIFT_TEMPS
-
- inptr0 = input_buf[0][in_row_group_ctr];
- inptr1 = input_buf[1][in_row_group_ctr];
- inptr2 = input_buf[2][in_row_group_ctr];
- outptr = output_buf[0];
- /* Loop for each pair of output pixels */
- for (col = cinfo->output_width >> 1; col > 0; col--) {
- /* Do the chroma part of the calculation */
- cb = GETJSAMPLE(*inptr1++);
- cr = GETJSAMPLE(*inptr2++);
- cred = Crrtab[cr];
- cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
- cblue = Cbbtab[cb];
- /* Fetch 2 Y values and emit 2 pixels */
- y = GETJSAMPLE(*inptr0++);
- outptr[RGB_RED] = range_limit[y + cred];
- outptr[RGB_GREEN] = range_limit[y + cgreen];
- outptr[RGB_BLUE] = range_limit[y + cblue];
- outptr += RGB_PIXELSIZE;
- y = GETJSAMPLE(*inptr0++);
- outptr[RGB_RED] = range_limit[y + cred];
- outptr[RGB_GREEN] = range_limit[y + cgreen];
- outptr[RGB_BLUE] = range_limit[y + cblue];
- outptr += RGB_PIXELSIZE;
- }
- /* If image width is odd, do the last output column separately */
- if (cinfo->output_width & 1) {
- cb = GETJSAMPLE(*inptr1);
- cr = GETJSAMPLE(*inptr2);
- cred = Crrtab[cr];
- cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
- cblue = Cbbtab[cb];
- y = GETJSAMPLE(*inptr0);
- outptr[RGB_RED] = range_limit[y + cred];
- outptr[RGB_GREEN] = range_limit[y + cgreen];
- outptr[RGB_BLUE] = range_limit[y + cblue];
- }
-}
-
-
-/*
- * Upsample and color convert for the case of 2:1 horizontal and 2:1 vertical.
- */
-
-METHODDEF(void)
-h2v2_merged_upsample (j_decompress_ptr cinfo,
- JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr,
- JSAMPARRAY output_buf)
-{
- my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
- register int y, cred, cgreen, cblue;
- int cb, cr;
- register JSAMPROW outptr0, outptr1;
- JSAMPROW inptr00, inptr01, inptr1, inptr2;
- JDIMENSION col;
- /* copy these pointers into registers if possible */
- register JSAMPLE * range_limit = cinfo->sample_range_limit;
- int * Crrtab = upsample->Cr_r_tab;
- int * Cbbtab = upsample->Cb_b_tab;
- INT32 * Crgtab = upsample->Cr_g_tab;
- INT32 * Cbgtab = upsample->Cb_g_tab;
- SHIFT_TEMPS
-
- inptr00 = input_buf[0][in_row_group_ctr*2];
- inptr01 = input_buf[0][in_row_group_ctr*2 + 1];
- inptr1 = input_buf[1][in_row_group_ctr];
- inptr2 = input_buf[2][in_row_group_ctr];
- outptr0 = output_buf[0];
- outptr1 = output_buf[1];
- /* Loop for each group of output pixels */
- for (col = cinfo->output_width >> 1; col > 0; col--) {
- /* Do the chroma part of the calculation */
- cb = GETJSAMPLE(*inptr1++);
- cr = GETJSAMPLE(*inptr2++);
- cred = Crrtab[cr];
- cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
- cblue = Cbbtab[cb];
- /* Fetch 4 Y values and emit 4 pixels */
- y = GETJSAMPLE(*inptr00++);
- outptr0[RGB_RED] = range_limit[y + cred];
- outptr0[RGB_GREEN] = range_limit[y + cgreen];
- outptr0[RGB_BLUE] = range_limit[y + cblue];
- outptr0 += RGB_PIXELSIZE;
- y = GETJSAMPLE(*inptr00++);
- outptr0[RGB_RED] = range_limit[y + cred];
- outptr0[RGB_GREEN] = range_limit[y + cgreen];
- outptr0[RGB_BLUE] = range_limit[y + cblue];
- outptr0 += RGB_PIXELSIZE;
- y = GETJSAMPLE(*inptr01++);
- outptr1[RGB_RED] = range_limit[y + cred];
- outptr1[RGB_GREEN] = range_limit[y + cgreen];
- outptr1[RGB_BLUE] = range_limit[y + cblue];
- outptr1 += RGB_PIXELSIZE;
- y = GETJSAMPLE(*inptr01++);
- outptr1[RGB_RED] = range_limit[y + cred];
- outptr1[RGB_GREEN] = range_limit[y + cgreen];
- outptr1[RGB_BLUE] = range_limit[y + cblue];
- outptr1 += RGB_PIXELSIZE;
- }
- /* If image width is odd, do the last output column separately */
- if (cinfo->output_width & 1) {
- cb = GETJSAMPLE(*inptr1);
- cr = GETJSAMPLE(*inptr2);
- cred = Crrtab[cr];
- cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
- cblue = Cbbtab[cb];
- y = GETJSAMPLE(*inptr00);
- outptr0[RGB_RED] = range_limit[y + cred];
- outptr0[RGB_GREEN] = range_limit[y + cgreen];
- outptr0[RGB_BLUE] = range_limit[y + cblue];
- y = GETJSAMPLE(*inptr01);
- outptr1[RGB_RED] = range_limit[y + cred];
- outptr1[RGB_GREEN] = range_limit[y + cgreen];
- outptr1[RGB_BLUE] = range_limit[y + cblue];
- }
-}
-
-
-/*
- * Module initialization routine for merged upsampling/color conversion.
- *
- * NB: this is called under the conditions determined by use_merged_upsample()
- * in jdmaster.c. That routine MUST correspond to the actual capabilities
- * of this module; no safety checks are made here.
- */
-
-GLOBAL(void)
-jinit_merged_upsampler (j_decompress_ptr cinfo)
-{
- my_upsample_ptr upsample;
-
- upsample = (my_upsample_ptr)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- SIZEOF(my_upsampler));
- cinfo->upsample = (struct jpeg_upsampler *) upsample;
- upsample->pub.start_pass = start_pass_merged_upsample;
- upsample->pub.need_context_rows = FALSE;
-
- upsample->out_row_width = cinfo->output_width * cinfo->out_color_components;
-
- if (cinfo->max_v_samp_factor == 2) {
- upsample->pub.upsample = merged_2v_upsample;
- upsample->upmethod = h2v2_merged_upsample;
- /* Allocate a spare row buffer */
- upsample->spare_row = (JSAMPROW)
- (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- (size_t) (upsample->out_row_width * SIZEOF(JSAMPLE)));
- } else {
- upsample->pub.upsample = merged_1v_upsample;
- upsample->upmethod = h2v1_merged_upsample;
- /* No spare row needed */
- upsample->spare_row = NULL;
- }
-
- build_ycc_rgb_table(cinfo);
-}
-
-#endif /* UPSAMPLE_MERGING_SUPPORTED */
-
-#endif //_FX_JPEG_TURBO_
+#if !defined(_FX_JPEG_TURBO_)
+/*
+ * jdmerge.c
+ *
+ * Copyright (C) 1994-1996, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains code for merged upsampling/color conversion.
+ *
+ * This file combines functions from jdsample.c and jdcolor.c;
+ * read those files first to understand what's going on.
+ *
+ * When the chroma components are to be upsampled by simple replication
+ * (ie, box filtering), we can save some work in color conversion by
+ * calculating all the output pixels corresponding to a pair of chroma
+ * samples at one time. In the conversion equations
+ * R = Y + K1 * Cr
+ * G = Y + K2 * Cb + K3 * Cr
+ * B = Y + K4 * Cb
+ * only the Y term varies among the group of pixels corresponding to a pair
+ * of chroma samples, so the rest of the terms can be calculated just once.
+ * At typical sampling ratios, this eliminates half or three-quarters of the
+ * multiplications needed for color conversion.
+ *
+ * This file currently provides implementations for the following cases:
+ * YCbCr => RGB color conversion only.
+ * Sampling ratios of 2h1v or 2h2v.
+ * No scaling needed at upsample time.
+ * Corner-aligned (non-CCIR601) sampling alignment.
+ * Other special cases could be added, but in most applications these are
+ * the only common cases. (For uncommon cases we fall back on the more
+ * general code in jdsample.c and jdcolor.c.)
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+
+#ifdef UPSAMPLE_MERGING_SUPPORTED
+
+#ifdef _FX_MANAGED_CODE_
+#define my_upsampler my_upsampler_m
+#endif
+
+/* Private subobject */
+
+typedef struct {
+ struct jpeg_upsampler pub; /* public fields */
+
+ /* Pointer to routine to do actual upsampling/conversion of one row group */
+ JMETHOD(void, upmethod, (j_decompress_ptr cinfo,
+ JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr,
+ JSAMPARRAY output_buf));
+
+ /* Private state for YCC->RGB conversion */
+ int * Cr_r_tab; /* => table for Cr to R conversion */
+ int * Cb_b_tab; /* => table for Cb to B conversion */
+ INT32 * Cr_g_tab; /* => table for Cr to G conversion */
+ INT32 * Cb_g_tab; /* => table for Cb to G conversion */
+
+ /* For 2:1 vertical sampling, we produce two output rows at a time.
+ * We need a "spare" row buffer to hold the second output row if the
+ * application provides just a one-row buffer; we also use the spare
+ * to discard the dummy last row if the image height is odd.
+ */
+ JSAMPROW spare_row;
+ boolean spare_full; /* T if spare buffer is occupied */
+
+ JDIMENSION out_row_width; /* samples per output row */
+ JDIMENSION rows_to_go; /* counts rows remaining in image */
+} my_upsampler;
+
+typedef my_upsampler * my_upsample_ptr;
+
+#define SCALEBITS 16 /* speediest right-shift on some machines */
+#define ONE_HALF ((INT32) 1 << (SCALEBITS-1))
+#define FIX(x) ((INT32) ((x) * (1L<<SCALEBITS) + 0.5))
+
+
+/*
+ * Initialize tables for YCC->RGB colorspace conversion.
+ * This is taken directly from jdcolor.c; see that file for more info.
+ */
+
+LOCAL(void)
+build_ycc_rgb_table (j_decompress_ptr cinfo)
+{
+ my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
+ int i;
+ INT32 x;
+ SHIFT_TEMPS
+
+ upsample->Cr_r_tab = (int *)
+ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ (MAXJSAMPLE+1) * SIZEOF(int));
+ upsample->Cb_b_tab = (int *)
+ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ (MAXJSAMPLE+1) * SIZEOF(int));
+ upsample->Cr_g_tab = (INT32 *)
+ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ (MAXJSAMPLE+1) * SIZEOF(INT32));
+ upsample->Cb_g_tab = (INT32 *)
+ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ (MAXJSAMPLE+1) * SIZEOF(INT32));
+
+ for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) {
+ /* i is the actual input pixel value, in the range 0..MAXJSAMPLE */
+ /* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */
+ /* Cr=>R value is nearest int to 1.40200 * x */
+ upsample->Cr_r_tab[i] = (int)
+ RIGHT_SHIFT(FIX(1.40200) * x + ONE_HALF, SCALEBITS);
+ /* Cb=>B value is nearest int to 1.77200 * x */
+ upsample->Cb_b_tab[i] = (int)
+ RIGHT_SHIFT(FIX(1.77200) * x + ONE_HALF, SCALEBITS);
+ /* Cr=>G value is scaled-up -0.71414 * x */
+ upsample->Cr_g_tab[i] = (- FIX(0.71414)) * x;
+ /* Cb=>G value is scaled-up -0.34414 * x */
+ /* We also add in ONE_HALF so that need not do it in inner loop */
+ upsample->Cb_g_tab[i] = (- FIX(0.34414)) * x + ONE_HALF;
+ }
+}
+
+
+/*
+ * Initialize for an upsampling pass.
+ */
+
+METHODDEF(void)
+start_pass_merged_upsample (j_decompress_ptr cinfo)
+{
+ my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
+
+ /* Mark the spare buffer empty */
+ upsample->spare_full = FALSE;
+ /* Initialize total-height counter for detecting bottom of image */
+ upsample->rows_to_go = cinfo->output_height;
+}
+
+
+/*
+ * Control routine to do upsampling (and color conversion).
+ *
+ * The control routine just handles the row buffering considerations.
+ */
+
+METHODDEF(void)
+merged_2v_upsample (j_decompress_ptr cinfo,
+ JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
+ JDIMENSION in_row_groups_avail,
+ JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
+ JDIMENSION out_rows_avail)
+/* 2:1 vertical sampling case: may need a spare row. */
+{
+ my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
+ JSAMPROW work_ptrs[2];
+ JDIMENSION num_rows; /* number of rows returned to caller */
+
+ if (upsample->spare_full) {
+ /* If we have a spare row saved from a previous cycle, just return it. */
+ jcopy_sample_rows(& upsample->spare_row, 0, output_buf + *out_row_ctr, 0,
+ 1, upsample->out_row_width);
+ num_rows = 1;
+ upsample->spare_full = FALSE;
+ } else {
+ /* Figure number of rows to return to caller. */
+ num_rows = 2;
+ /* Not more than the distance to the end of the image. */
+ if (num_rows > upsample->rows_to_go)
+ num_rows = upsample->rows_to_go;
+ /* And not more than what the client can accept: */
+ out_rows_avail -= *out_row_ctr;
+ if (num_rows > out_rows_avail)
+ num_rows = out_rows_avail;
+ /* Create output pointer array for upsampler. */
+ work_ptrs[0] = output_buf[*out_row_ctr];
+ if (num_rows > 1) {
+ work_ptrs[1] = output_buf[*out_row_ctr + 1];
+ } else {
+ work_ptrs[1] = upsample->spare_row;
+ upsample->spare_full = TRUE;
+ }
+ /* Now do the upsampling. */
+ (*upsample->upmethod) (cinfo, input_buf, *in_row_group_ctr, work_ptrs);
+ }
+
+ /* Adjust counts */
+ *out_row_ctr += num_rows;
+ upsample->rows_to_go -= num_rows;
+ /* When the buffer is emptied, declare this input row group consumed */
+ if (! upsample->spare_full)
+ (*in_row_group_ctr)++;
+}
+
+
+METHODDEF(void)
+merged_1v_upsample (j_decompress_ptr cinfo,
+ JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
+ JDIMENSION in_row_groups_avail,
+ JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
+ JDIMENSION out_rows_avail)
+/* 1:1 vertical sampling case: much easier, never need a spare row. */
+{
+ my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
+
+ /* Just do the upsampling. */
+ (*upsample->upmethod) (cinfo, input_buf, *in_row_group_ctr,
+ output_buf + *out_row_ctr);
+ /* Adjust counts */
+ (*out_row_ctr)++;
+ (*in_row_group_ctr)++;
+}
+
+
+/*
+ * These are the routines invoked by the control routines to do
+ * the actual upsampling/conversion. One row group is processed per call.
+ *
+ * Note: since we may be writing directly into application-supplied buffers,
+ * we have to be honest about the output width; we can't assume the buffer
+ * has been rounded up to an even width.
+ */
+
+
+/*
+ * Upsample and color convert for the case of 2:1 horizontal and 1:1 vertical.
+ */
+
+METHODDEF(void)
+h2v1_merged_upsample (j_decompress_ptr cinfo,
+ JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr,
+ JSAMPARRAY output_buf)
+{
+ my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
+ register int y, cred, cgreen, cblue;
+ int cb, cr;
+ register JSAMPROW outptr;
+ JSAMPROW inptr0, inptr1, inptr2;
+ JDIMENSION col;
+ /* copy these pointers into registers if possible */
+ register JSAMPLE * range_limit = cinfo->sample_range_limit;
+ int * Crrtab = upsample->Cr_r_tab;
+ int * Cbbtab = upsample->Cb_b_tab;
+ INT32 * Crgtab = upsample->Cr_g_tab;
+ INT32 * Cbgtab = upsample->Cb_g_tab;
+ SHIFT_TEMPS
+
+ inptr0 = input_buf[0][in_row_group_ctr];
+ inptr1 = input_buf[1][in_row_group_ctr];
+ inptr2 = input_buf[2][in_row_group_ctr];
+ outptr = output_buf[0];
+ /* Loop for each pair of output pixels */
+ for (col = cinfo->output_width >> 1; col > 0; col--) {
+ /* Do the chroma part of the calculation */
+ cb = GETJSAMPLE(*inptr1++);
+ cr = GETJSAMPLE(*inptr2++);
+ cred = Crrtab[cr];
+ cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
+ cblue = Cbbtab[cb];
+ /* Fetch 2 Y values and emit 2 pixels */
+ y = GETJSAMPLE(*inptr0++);
+ outptr[RGB_RED] = range_limit[y + cred];
+ outptr[RGB_GREEN] = range_limit[y + cgreen];
+ outptr[RGB_BLUE] = range_limit[y + cblue];
+ outptr += RGB_PIXELSIZE;
+ y = GETJSAMPLE(*inptr0++);
+ outptr[RGB_RED] = range_limit[y + cred];
+ outptr[RGB_GREEN] = range_limit[y + cgreen];
+ outptr[RGB_BLUE] = range_limit[y + cblue];
+ outptr += RGB_PIXELSIZE;
+ }
+ /* If image width is odd, do the last output column separately */
+ if (cinfo->output_width & 1) {
+ cb = GETJSAMPLE(*inptr1);
+ cr = GETJSAMPLE(*inptr2);
+ cred = Crrtab[cr];
+ cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
+ cblue = Cbbtab[cb];
+ y = GETJSAMPLE(*inptr0);
+ outptr[RGB_RED] = range_limit[y + cred];
+ outptr[RGB_GREEN] = range_limit[y + cgreen];
+ outptr[RGB_BLUE] = range_limit[y + cblue];
+ }
+}
+
+
+/*
+ * Upsample and color convert for the case of 2:1 horizontal and 2:1 vertical.
+ */
+
+METHODDEF(void)
+h2v2_merged_upsample (j_decompress_ptr cinfo,
+ JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr,
+ JSAMPARRAY output_buf)
+{
+ my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
+ register int y, cred, cgreen, cblue;
+ int cb, cr;
+ register JSAMPROW outptr0, outptr1;
+ JSAMPROW inptr00, inptr01, inptr1, inptr2;
+ JDIMENSION col;
+ /* copy these pointers into registers if possible */
+ register JSAMPLE * range_limit = cinfo->sample_range_limit;
+ int * Crrtab = upsample->Cr_r_tab;
+ int * Cbbtab = upsample->Cb_b_tab;
+ INT32 * Crgtab = upsample->Cr_g_tab;
+ INT32 * Cbgtab = upsample->Cb_g_tab;
+ SHIFT_TEMPS
+
+ inptr00 = input_buf[0][in_row_group_ctr*2];
+ inptr01 = input_buf[0][in_row_group_ctr*2 + 1];
+ inptr1 = input_buf[1][in_row_group_ctr];
+ inptr2 = input_buf[2][in_row_group_ctr];
+ outptr0 = output_buf[0];
+ outptr1 = output_buf[1];
+ /* Loop for each group of output pixels */
+ for (col = cinfo->output_width >> 1; col > 0; col--) {
+ /* Do the chroma part of the calculation */
+ cb = GETJSAMPLE(*inptr1++);
+ cr = GETJSAMPLE(*inptr2++);
+ cred = Crrtab[cr];
+ cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
+ cblue = Cbbtab[cb];
+ /* Fetch 4 Y values and emit 4 pixels */
+ y = GETJSAMPLE(*inptr00++);
+ outptr0[RGB_RED] = range_limit[y + cred];
+ outptr0[RGB_GREEN] = range_limit[y + cgreen];
+ outptr0[RGB_BLUE] = range_limit[y + cblue];
+ outptr0 += RGB_PIXELSIZE;
+ y = GETJSAMPLE(*inptr00++);
+ outptr0[RGB_RED] = range_limit[y + cred];
+ outptr0[RGB_GREEN] = range_limit[y + cgreen];
+ outptr0[RGB_BLUE] = range_limit[y + cblue];
+ outptr0 += RGB_PIXELSIZE;
+ y = GETJSAMPLE(*inptr01++);
+ outptr1[RGB_RED] = range_limit[y + cred];
+ outptr1[RGB_GREEN] = range_limit[y + cgreen];
+ outptr1[RGB_BLUE] = range_limit[y + cblue];
+ outptr1 += RGB_PIXELSIZE;
+ y = GETJSAMPLE(*inptr01++);
+ outptr1[RGB_RED] = range_limit[y + cred];
+ outptr1[RGB_GREEN] = range_limit[y + cgreen];
+ outptr1[RGB_BLUE] = range_limit[y + cblue];
+ outptr1 += RGB_PIXELSIZE;
+ }
+ /* If image width is odd, do the last output column separately */
+ if (cinfo->output_width & 1) {
+ cb = GETJSAMPLE(*inptr1);
+ cr = GETJSAMPLE(*inptr2);
+ cred = Crrtab[cr];
+ cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
+ cblue = Cbbtab[cb];
+ y = GETJSAMPLE(*inptr00);
+ outptr0[RGB_RED] = range_limit[y + cred];
+ outptr0[RGB_GREEN] = range_limit[y + cgreen];
+ outptr0[RGB_BLUE] = range_limit[y + cblue];
+ y = GETJSAMPLE(*inptr01);
+ outptr1[RGB_RED] = range_limit[y + cred];
+ outptr1[RGB_GREEN] = range_limit[y + cgreen];
+ outptr1[RGB_BLUE] = range_limit[y + cblue];
+ }
+}
+
+
+/*
+ * Module initialization routine for merged upsampling/color conversion.
+ *
+ * NB: this is called under the conditions determined by use_merged_upsample()
+ * in jdmaster.c. That routine MUST correspond to the actual capabilities
+ * of this module; no safety checks are made here.
+ */
+
+GLOBAL(void)
+jinit_merged_upsampler (j_decompress_ptr cinfo)
+{
+ my_upsample_ptr upsample;
+
+ upsample = (my_upsample_ptr)
+ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ SIZEOF(my_upsampler));
+ cinfo->upsample = (struct jpeg_upsampler *) upsample;
+ upsample->pub.start_pass = start_pass_merged_upsample;
+ upsample->pub.need_context_rows = FALSE;
+
+ upsample->out_row_width = cinfo->output_width * cinfo->out_color_components;
+
+ if (cinfo->max_v_samp_factor == 2) {
+ upsample->pub.upsample = merged_2v_upsample;
+ upsample->upmethod = h2v2_merged_upsample;
+ /* Allocate a spare row buffer */
+ upsample->spare_row = (JSAMPROW)
+ (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ (size_t) (upsample->out_row_width * SIZEOF(JSAMPLE)));
+ } else {
+ upsample->pub.upsample = merged_1v_upsample;
+ upsample->upmethod = h2v1_merged_upsample;
+ /* No spare row needed */
+ upsample->spare_row = NULL;
+ }
+
+ build_ycc_rgb_table(cinfo);
+}
+
+#endif /* UPSAMPLE_MERGING_SUPPORTED */
+
+#endif //_FX_JPEG_TURBO_
diff --git a/core/src/fxcodec/libjpeg/fpdfapi_jdphuff.c b/core/src/fxcodec/libjpeg/fpdfapi_jdphuff.c
index 3c19d0ab24..128e412662 100644
--- a/core/src/fxcodec/libjpeg/fpdfapi_jdphuff.c
+++ b/core/src/fxcodec/libjpeg/fpdfapi_jdphuff.c
@@ -1,671 +1,671 @@
-#if !defined(_FX_JPEG_TURBO_)
-/*
- * jdphuff.c
- *
- * Copyright (C) 1995-1997, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- * For conditions of distribution and use, see the accompanying README file.
- *
- * This file contains Huffman entropy decoding routines for progressive JPEG.
- *
- * Much of the complexity here has to do with supporting input suspension.
- * If the data source module demands suspension, we want to be able to back
- * up to the start of the current MCU. To do this, we copy state variables
- * into local working storage, and update them back to the permanent
- * storage only upon successful completion of an MCU.
- */
-
-#define JPEG_INTERNALS
-#include "jinclude.h"
-#include "jpeglib.h"
-#include "jdhuff.h" /* Declarations shared with jdhuff.c */
-
-
-#ifdef D_PROGRESSIVE_SUPPORTED
-
-/*
- * Expanded entropy decoder object for progressive Huffman decoding.
- *
- * The savable_state subrecord contains fields that change within an MCU,
- * but must not be updated permanently until we complete the MCU.
- */
-
-typedef struct {
- unsigned int EOBRUN; /* remaining EOBs in EOBRUN */
- int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */
-} savable_state;
-
-/* This macro is to work around compilers with missing or broken
- * structure assignment. You'll need to fix this code if you have
- * such a compiler and you change MAX_COMPS_IN_SCAN.
- */
-
-#ifndef NO_STRUCT_ASSIGN
-#define ASSIGN_STATE(dest,src) ((dest) = (src))
-#else
-#if MAX_COMPS_IN_SCAN == 4
-#define ASSIGN_STATE(dest,src) \
- ((dest).EOBRUN = (src).EOBRUN, \
- (dest).last_dc_val[0] = (src).last_dc_val[0], \
- (dest).last_dc_val[1] = (src).last_dc_val[1], \
- (dest).last_dc_val[2] = (src).last_dc_val[2], \
- (dest).last_dc_val[3] = (src).last_dc_val[3])
-#endif
-#endif
-
-
-typedef struct {
- struct jpeg_entropy_decoder pub; /* public fields */
-
- /* These fields are loaded into local variables at start of each MCU.
- * In case of suspension, we exit WITHOUT updating them.
- */
- bitread_perm_state bitstate; /* Bit buffer at start of MCU */
- savable_state saved; /* Other state at start of MCU */
-
- /* These fields are NOT loaded into local working state. */
- unsigned int restarts_to_go; /* MCUs left in this restart interval */
-
- /* Pointers to derived tables (these workspaces have image lifespan) */
- d_derived_tbl * derived_tbls[NUM_HUFF_TBLS];
-
- d_derived_tbl * ac_derived_tbl; /* active table during an AC scan */
-} phuff_entropy_decoder;
-
-typedef phuff_entropy_decoder * phuff_entropy_ptr;
-
-/* Forward declarations */
-METHODDEF(boolean) decode_mcu_DC_first JPP((j_decompress_ptr cinfo,
- JBLOCKROW *MCU_data));
-METHODDEF(boolean) decode_mcu_AC_first JPP((j_decompress_ptr cinfo,
- JBLOCKROW *MCU_data));
-METHODDEF(boolean) decode_mcu_DC_refine JPP((j_decompress_ptr cinfo,
- JBLOCKROW *MCU_data));
-METHODDEF(boolean) decode_mcu_AC_refine JPP((j_decompress_ptr cinfo,
- JBLOCKROW *MCU_data));
-
-
-/*
- * Initialize for a Huffman-compressed scan.
- */
-
-METHODDEF(void)
-start_pass_phuff_decoder (j_decompress_ptr cinfo)
-{
- phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
- boolean is_DC_band, bad;
- int ci, coefi, tbl;
- int *coef_bit_ptr;
- jpeg_component_info * compptr;
-
- is_DC_band = (cinfo->Ss == 0);
-
- /* Validate scan parameters */
- bad = FALSE;
- if (is_DC_band) {
- if (cinfo->Se != 0)
- bad = TRUE;
- } else {
- /* need not check Ss/Se < 0 since they came from unsigned bytes */
- if (cinfo->Ss > cinfo->Se || cinfo->Se >= DCTSIZE2)
- bad = TRUE;
- /* AC scans may have only one component */
- if (cinfo->comps_in_scan != 1)
- bad = TRUE;
- }
- if (cinfo->Ah != 0) {
- /* Successive approximation refinement scan: must have Al = Ah-1. */
- if (cinfo->Al != cinfo->Ah-1)
- bad = TRUE;
- }
- if (cinfo->Al > 13) /* need not check for < 0 */
- bad = TRUE;
- /* Arguably the maximum Al value should be less than 13 for 8-bit precision,
- * but the spec doesn't say so, and we try to be liberal about what we
- * accept. Note: large Al values could result in out-of-range DC
- * coefficients during early scans, leading to bizarre displays due to
- * overflows in the IDCT math. But we won't crash.
- */
- if (bad)
- ERREXIT4(cinfo, JERR_BAD_PROGRESSION,
- cinfo->Ss, cinfo->Se, cinfo->Ah, cinfo->Al);
- /* Update progression status, and verify that scan order is legal.
- * Note that inter-scan inconsistencies are treated as warnings
- * not fatal errors ... not clear if this is right way to behave.
- */
- for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
- int cindex = cinfo->cur_comp_info[ci]->component_index;
- coef_bit_ptr = & cinfo->coef_bits[cindex][0];
- if (!is_DC_band && coef_bit_ptr[0] < 0) /* AC without prior DC scan */
- WARNMS2(cinfo, JWRN_BOGUS_PROGRESSION, cindex, 0);
- for (coefi = cinfo->Ss; coefi <= cinfo->Se; coefi++) {
- int expected = (coef_bit_ptr[coefi] < 0) ? 0 : coef_bit_ptr[coefi];
- if (cinfo->Ah != expected)
- WARNMS2(cinfo, JWRN_BOGUS_PROGRESSION, cindex, coefi);
- coef_bit_ptr[coefi] = cinfo->Al;
- }
- }
-
- /* Select MCU decoding routine */
- if (cinfo->Ah == 0) {
- if (is_DC_band)
- entropy->pub.decode_mcu = decode_mcu_DC_first;
- else
- entropy->pub.decode_mcu = decode_mcu_AC_first;
- } else {
- if (is_DC_band)
- entropy->pub.decode_mcu = decode_mcu_DC_refine;
- else
- entropy->pub.decode_mcu = decode_mcu_AC_refine;
- }
-
- for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
- compptr = cinfo->cur_comp_info[ci];
- /* Make sure requested tables are present, and compute derived tables.
- * We may build same derived table more than once, but it's not expensive.
- */
- if (is_DC_band) {
- if (cinfo->Ah == 0) { /* DC refinement needs no table */
- tbl = compptr->dc_tbl_no;
- jpeg_make_d_derived_tbl(cinfo, TRUE, tbl,
- & entropy->derived_tbls[tbl]);
- }
- } else {
- tbl = compptr->ac_tbl_no;
- jpeg_make_d_derived_tbl(cinfo, FALSE, tbl,
- & entropy->derived_tbls[tbl]);
- /* remember the single active table */
- entropy->ac_derived_tbl = entropy->derived_tbls[tbl];
- }
- /* Initialize DC predictions to 0 */
- entropy->saved.last_dc_val[ci] = 0;
- }
-
- /* Initialize bitread state variables */
- entropy->bitstate.bits_left = 0;
- entropy->bitstate.get_buffer = 0; /* unnecessary, but keeps Purify quiet */
- entropy->pub.insufficient_data = FALSE;
-
- /* Initialize private state variables */
- entropy->saved.EOBRUN = 0;
-
- /* Initialize restart counter */
- entropy->restarts_to_go = cinfo->restart_interval;
-}
-
-
-/*
- * Figure F.12: extend sign bit.
- * On some machines, a shift and add will be faster than a table lookup.
- */
-
-#ifdef AVOID_TABLES
-
-#define HUFF_EXTEND(x,s) ((x) < (1<<((s)-1)) ? (x) + (((-1)<<(s)) + 1) : (x))
-
-#else
-
-#define HUFF_EXTEND(x,s) ((x) < extend_test[s] ? (x) + extend_offset[s] : (x))
-
-static const int extend_test[16] = /* entry n is 2**(n-1) */
- { 0, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080,
- 0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000 };
-
-static const int extend_offset[16] = /* entry n is (-1 << n) + 1 */
- { 0, ((-1)<<1) + 1, ((-1)<<2) + 1, ((-1)<<3) + 1, ((-1)<<4) + 1,
- ((-1)<<5) + 1, ((-1)<<6) + 1, ((-1)<<7) + 1, ((-1)<<8) + 1,
- ((-1)<<9) + 1, ((-1)<<10) + 1, ((-1)<<11) + 1, ((-1)<<12) + 1,
- ((-1)<<13) + 1, ((-1)<<14) + 1, ((-1)<<15) + 1 };
-
-#endif /* AVOID_TABLES */
-
-
-/*
- * Check for a restart marker & resynchronize decoder.
- * Returns FALSE if must suspend.
- */
-
-LOCAL(boolean)
-process_restart (j_decompress_ptr cinfo)
-{
- phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
- int ci;
-
- /* Throw away any unused bits remaining in bit buffer; */
- /* include any full bytes in next_marker's count of discarded bytes */
- cinfo->marker->discarded_bytes += entropy->bitstate.bits_left / 8;
- entropy->bitstate.bits_left = 0;
-
- /* Advance past the RSTn marker */
- if (! (*cinfo->marker->read_restart_marker) (cinfo))
- return FALSE;
-
- /* Re-initialize DC predictions to 0 */
- for (ci = 0; ci < cinfo->comps_in_scan; ci++)
- entropy->saved.last_dc_val[ci] = 0;
- /* Re-init EOB run count, too */
- entropy->saved.EOBRUN = 0;
-
- /* Reset restart counter */
- entropy->restarts_to_go = cinfo->restart_interval;
-
- /* Reset out-of-data flag, unless read_restart_marker left us smack up
- * against a marker. In that case we will end up treating the next data
- * segment as empty, and we can avoid producing bogus output pixels by
- * leaving the flag set.
- */
- if (cinfo->unread_marker == 0)
- entropy->pub.insufficient_data = FALSE;
-
- return TRUE;
-}
-
-
-/*
- * Huffman MCU decoding.
- * Each of these routines decodes and returns one MCU's worth of
- * Huffman-compressed coefficients.
- * The coefficients are reordered from zigzag order into natural array order,
- * but are not dequantized.
- *
- * The i'th block of the MCU is stored into the block pointed to by
- * MCU_data[i]. WE ASSUME THIS AREA IS INITIALLY ZEROED BY THE CALLER.
- *
- * We return FALSE if data source requested suspension. In that case no
- * changes have been made to permanent state. (Exception: some output
- * coefficients may already have been assigned. This is harmless for
- * spectral selection, since we'll just re-assign them on the next call.
- * Successive approximation AC refinement has to be more careful, however.)
- */
-
-/*
- * MCU decoding for DC initial scan (either spectral selection,
- * or first pass of successive approximation).
- */
-
-METHODDEF(boolean)
-decode_mcu_DC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
-{
- phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
- int Al = cinfo->Al;
- register int s, r;
- int blkn, ci;
- JBLOCKROW block;
- BITREAD_STATE_VARS;
- savable_state state;
- d_derived_tbl * tbl;
- jpeg_component_info * compptr;
-
- /* Process restart marker if needed; may have to suspend */
- if (cinfo->restart_interval) {
- if (entropy->restarts_to_go == 0)
- if (! process_restart(cinfo))
- return FALSE;
- }
-
- /* If we've run out of data, just leave the MCU set to zeroes.
- * This way, we return uniform gray for the remainder of the segment.
- */
- if (! entropy->pub.insufficient_data) {
-
- /* Load up working state */
- BITREAD_LOAD_STATE(cinfo,entropy->bitstate);
- ASSIGN_STATE(state, entropy->saved);
-
- /* Outer loop handles each block in the MCU */
-
- for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
- block = MCU_data[blkn];
- ci = cinfo->MCU_membership[blkn];
- compptr = cinfo->cur_comp_info[ci];
- tbl = entropy->derived_tbls[compptr->dc_tbl_no];
-
- /* Decode a single block's worth of coefficients */
-
- /* Section F.2.2.1: decode the DC coefficient difference */
- HUFF_DECODE(s, br_state, tbl, return FALSE, label1);
- if (s) {
- CHECK_BIT_BUFFER(br_state, s, return FALSE);
- r = GET_BITS(s);
- s = HUFF_EXTEND(r, s);
- }
-
- /* Convert DC difference to actual value, update last_dc_val */
- s += state.last_dc_val[ci];
- state.last_dc_val[ci] = s;
- /* Scale and output the coefficient (assumes jpeg_natural_order[0]=0) */
- (*block)[0] = (JCOEF) (s << Al);
- }
-
- /* Completed MCU, so update state */
- BITREAD_SAVE_STATE(cinfo,entropy->bitstate);
- ASSIGN_STATE(entropy->saved, state);
- }
-
- /* Account for restart interval (no-op if not using restarts) */
- entropy->restarts_to_go--;
-
- return TRUE;
-}
-
-
-/*
- * MCU decoding for AC initial scan (either spectral selection,
- * or first pass of successive approximation).
- */
-
-METHODDEF(boolean)
-decode_mcu_AC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
-{
- phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
- int Se = cinfo->Se;
- int Al = cinfo->Al;
- register int s, k, r;
- unsigned int EOBRUN;
- JBLOCKROW block;
- BITREAD_STATE_VARS;
- d_derived_tbl * tbl;
-
- /* Process restart marker if needed; may have to suspend */
- if (cinfo->restart_interval) {
- if (entropy->restarts_to_go == 0)
- if (! process_restart(cinfo))
- return FALSE;
- }
-
- /* If we've run out of data, just leave the MCU set to zeroes.
- * This way, we return uniform gray for the remainder of the segment.
- */
- if (! entropy->pub.insufficient_data) {
-
- /* Load up working state.
- * We can avoid loading/saving bitread state if in an EOB run.
- */
- EOBRUN = entropy->saved.EOBRUN; /* only part of saved state we need */
-
- /* There is always only one block per MCU */
-
- if (EOBRUN > 0) /* if it's a band of zeroes... */
- EOBRUN--; /* ...process it now (we do nothing) */
- else {
- BITREAD_LOAD_STATE(cinfo,entropy->bitstate);
- block = MCU_data[0];
- tbl = entropy->ac_derived_tbl;
-
- for (k = cinfo->Ss; k <= Se; k++) {
- HUFF_DECODE(s, br_state, tbl, return FALSE, label2);
- r = s >> 4;
- s &= 15;
- if (s) {
- k += r;
- CHECK_BIT_BUFFER(br_state, s, return FALSE);
- r = GET_BITS(s);
- s = HUFF_EXTEND(r, s);
- /* Scale and output coefficient in natural (dezigzagged) order */
- (*block)[jpeg_natural_order[k]] = (JCOEF) (s << Al);
- } else {
- if (r == 15) { /* ZRL */
- k += 15; /* skip 15 zeroes in band */
- } else { /* EOBr, run length is 2^r + appended bits */
- EOBRUN = 1 << r;
- if (r) { /* EOBr, r > 0 */
- CHECK_BIT_BUFFER(br_state, r, return FALSE);
- r = GET_BITS(r);
- EOBRUN += r;
- }
- EOBRUN--; /* this band is processed at this moment */
- break; /* force end-of-band */
- }
- }
- }
-
- BITREAD_SAVE_STATE(cinfo,entropy->bitstate);
- }
-
- /* Completed MCU, so update state */
- entropy->saved.EOBRUN = EOBRUN; /* only part of saved state we need */
- }
-
- /* Account for restart interval (no-op if not using restarts) */
- entropy->restarts_to_go--;
-
- return TRUE;
-}
-
-
-/*
- * MCU decoding for DC successive approximation refinement scan.
- * Note: we assume such scans can be multi-component, although the spec
- * is not very clear on the point.
- */
-
-METHODDEF(boolean)
-decode_mcu_DC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
-{
- phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
- int p1 = 1 << cinfo->Al; /* 1 in the bit position being coded */
- int blkn;
- JBLOCKROW block;
- BITREAD_STATE_VARS;
-
- /* Process restart marker if needed; may have to suspend */
- if (cinfo->restart_interval) {
- if (entropy->restarts_to_go == 0)
- if (! process_restart(cinfo))
- return FALSE;
- }
-
- /* Not worth the cycles to check insufficient_data here,
- * since we will not change the data anyway if we read zeroes.
- */
-
- /* Load up working state */
- BITREAD_LOAD_STATE(cinfo,entropy->bitstate);
-
- /* Outer loop handles each block in the MCU */
-
- for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
- block = MCU_data[blkn];
-
- /* Encoded data is simply the next bit of the two's-complement DC value */
- CHECK_BIT_BUFFER(br_state, 1, return FALSE);
- if (GET_BITS(1))
- (*block)[0] |= p1;
- /* Note: since we use |=, repeating the assignment later is safe */
- }
-
- /* Completed MCU, so update state */
- BITREAD_SAVE_STATE(cinfo,entropy->bitstate);
-
- /* Account for restart interval (no-op if not using restarts) */
- entropy->restarts_to_go--;
-
- return TRUE;
-}
-
-
-/*
- * MCU decoding for AC successive approximation refinement scan.
- */
-
-METHODDEF(boolean)
-decode_mcu_AC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
-{
- phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
- int Se = cinfo->Se;
- int p1 = 1 << cinfo->Al; /* 1 in the bit position being coded */
- int m1 = (-1) << cinfo->Al; /* -1 in the bit position being coded */
- register int s, k, r;
- unsigned int EOBRUN;
- JBLOCKROW block;
- JCOEFPTR thiscoef;
- BITREAD_STATE_VARS;
- d_derived_tbl * tbl;
- int num_newnz;
- int newnz_pos[DCTSIZE2];
-
- /* Process restart marker if needed; may have to suspend */
- if (cinfo->restart_interval) {
- if (entropy->restarts_to_go == 0)
- if (! process_restart(cinfo))
- return FALSE;
- }
-
- /* If we've run out of data, don't modify the MCU.
- */
- if (! entropy->pub.insufficient_data) {
-
- /* Load up working state */
- BITREAD_LOAD_STATE(cinfo,entropy->bitstate);
- EOBRUN = entropy->saved.EOBRUN; /* only part of saved state we need */
-
- /* There is always only one block per MCU */
- block = MCU_data[0];
- tbl = entropy->ac_derived_tbl;
-
- /* If we are forced to suspend, we must undo the assignments to any newly
- * nonzero coefficients in the block, because otherwise we'd get confused
- * next time about which coefficients were already nonzero.
- * But we need not undo addition of bits to already-nonzero coefficients;
- * instead, we can test the current bit to see if we already did it.
- */
- num_newnz = 0;
-
- /* initialize coefficient loop counter to start of band */
- k = cinfo->Ss;
-
- if (EOBRUN == 0) {
- for (; k <= Se; k++) {
- HUFF_DECODE(s, br_state, tbl, goto undoit, label3);
- r = s >> 4;
- s &= 15;
- if (s) {
- if (s != 1) /* size of new coef should always be 1 */
- WARNMS(cinfo, JWRN_HUFF_BAD_CODE);
- CHECK_BIT_BUFFER(br_state, 1, goto undoit);
- if (GET_BITS(1))
- s = p1; /* newly nonzero coef is positive */
- else
- s = m1; /* newly nonzero coef is negative */
- } else {
- if (r != 15) {
- EOBRUN = 1 << r; /* EOBr, run length is 2^r + appended bits */
- if (r) {
- CHECK_BIT_BUFFER(br_state, r, goto undoit);
- r = GET_BITS(r);
- EOBRUN += r;
- }
- break; /* rest of block is handled by EOB logic */
- }
- /* note s = 0 for processing ZRL */
- }
- /* Advance over already-nonzero coefs and r still-zero coefs,
- * appending correction bits to the nonzeroes. A correction bit is 1
- * if the absolute value of the coefficient must be increased.
- */
- do {
- thiscoef = *block + jpeg_natural_order[k];
- if (*thiscoef != 0) {
- CHECK_BIT_BUFFER(br_state, 1, goto undoit);
- if (GET_BITS(1)) {
- if ((*thiscoef & p1) == 0) { /* do nothing if already set it */
- if (*thiscoef >= 0)
- *thiscoef += p1;
- else
- *thiscoef += m1;
- }
- }
- } else {
- if (--r < 0)
- break; /* reached target zero coefficient */
- }
- k++;
- } while (k <= Se);
- if (s) {
- int pos = jpeg_natural_order[k];
- /* Output newly nonzero coefficient */
- (*block)[pos] = (JCOEF) s;
- /* Remember its position in case we have to suspend */
- newnz_pos[num_newnz++] = pos;
- }
- }
- }
-
- if (EOBRUN > 0) {
- /* Scan any remaining coefficient positions after the end-of-band
- * (the last newly nonzero coefficient, if any). Append a correction
- * bit to each already-nonzero coefficient. A correction bit is 1
- * if the absolute value of the coefficient must be increased.
- */
- for (; k <= Se; k++) {
- thiscoef = *block + jpeg_natural_order[k];
- if (*thiscoef != 0) {
- CHECK_BIT_BUFFER(br_state, 1, goto undoit);
- if (GET_BITS(1)) {
- if ((*thiscoef & p1) == 0) { /* do nothing if already changed it */
- if (*thiscoef >= 0)
- *thiscoef += p1;
- else
- *thiscoef += m1;
- }
- }
- }
- }
- /* Count one block completed in EOB run */
- EOBRUN--;
- }
-
- /* Completed MCU, so update state */
- BITREAD_SAVE_STATE(cinfo,entropy->bitstate);
- entropy->saved.EOBRUN = EOBRUN; /* only part of saved state we need */
- }
-
- /* Account for restart interval (no-op if not using restarts) */
- entropy->restarts_to_go--;
-
- return TRUE;
-
-undoit:
- /* Re-zero any output coefficients that we made newly nonzero */
- while (num_newnz > 0)
- (*block)[newnz_pos[--num_newnz]] = 0;
-
- return FALSE;
-}
-
-
-/*
- * Module initialization routine for progressive Huffman entropy decoding.
- */
-
-GLOBAL(void)
-jinit_phuff_decoder (j_decompress_ptr cinfo)
-{
- phuff_entropy_ptr entropy;
- int *coef_bit_ptr;
- int ci, i;
-
- entropy = (phuff_entropy_ptr)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- SIZEOF(phuff_entropy_decoder));
- cinfo->entropy = (struct jpeg_entropy_decoder *) entropy;
- entropy->pub.start_pass = start_pass_phuff_decoder;
-
- /* Mark derived tables unallocated */
- for (i = 0; i < NUM_HUFF_TBLS; i++) {
- entropy->derived_tbls[i] = NULL;
- }
-
- /* Create progression status table */
- cinfo->coef_bits = (int (*)[DCTSIZE2])
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- cinfo->num_components*DCTSIZE2*SIZEOF(int));
- coef_bit_ptr = & cinfo->coef_bits[0][0];
- for (ci = 0; ci < cinfo->num_components; ci++)
- for (i = 0; i < DCTSIZE2; i++)
- *coef_bit_ptr++ = -1;
-}
-
-#endif /* D_PROGRESSIVE_SUPPORTED */
-
-#endif //_FX_JPEG_TURBO_
+#if !defined(_FX_JPEG_TURBO_)
+/*
+ * jdphuff.c
+ *
+ * Copyright (C) 1995-1997, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains Huffman entropy decoding routines for progressive JPEG.
+ *
+ * Much of the complexity here has to do with supporting input suspension.
+ * If the data source module demands suspension, we want to be able to back
+ * up to the start of the current MCU. To do this, we copy state variables
+ * into local working storage, and update them back to the permanent
+ * storage only upon successful completion of an MCU.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+#include "jdhuff.h" /* Declarations shared with jdhuff.c */
+
+
+#ifdef D_PROGRESSIVE_SUPPORTED
+
+/*
+ * Expanded entropy decoder object for progressive Huffman decoding.
+ *
+ * The savable_state subrecord contains fields that change within an MCU,
+ * but must not be updated permanently until we complete the MCU.
+ */
+
+typedef struct {
+ unsigned int EOBRUN; /* remaining EOBs in EOBRUN */
+ int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */
+} savable_state;
+
+/* This macro is to work around compilers with missing or broken
+ * structure assignment. You'll need to fix this code if you have
+ * such a compiler and you change MAX_COMPS_IN_SCAN.
+ */
+
+#ifndef NO_STRUCT_ASSIGN
+#define ASSIGN_STATE(dest,src) ((dest) = (src))
+#else
+#if MAX_COMPS_IN_SCAN == 4
+#define ASSIGN_STATE(dest,src) \
+ ((dest).EOBRUN = (src).EOBRUN, \
+ (dest).last_dc_val[0] = (src).last_dc_val[0], \
+ (dest).last_dc_val[1] = (src).last_dc_val[1], \
+ (dest).last_dc_val[2] = (src).last_dc_val[2], \
+ (dest).last_dc_val[3] = (src).last_dc_val[3])
+#endif
+#endif
+
+
+typedef struct {
+ struct jpeg_entropy_decoder pub; /* public fields */
+
+ /* These fields are loaded into local variables at start of each MCU.
+ * In case of suspension, we exit WITHOUT updating them.
+ */
+ bitread_perm_state bitstate; /* Bit buffer at start of MCU */
+ savable_state saved; /* Other state at start of MCU */
+
+ /* These fields are NOT loaded into local working state. */
+ unsigned int restarts_to_go; /* MCUs left in this restart interval */
+
+ /* Pointers to derived tables (these workspaces have image lifespan) */
+ d_derived_tbl * derived_tbls[NUM_HUFF_TBLS];
+
+ d_derived_tbl * ac_derived_tbl; /* active table during an AC scan */
+} phuff_entropy_decoder;
+
+typedef phuff_entropy_decoder * phuff_entropy_ptr;
+
+/* Forward declarations */
+METHODDEF(boolean) decode_mcu_DC_first JPP((j_decompress_ptr cinfo,
+ JBLOCKROW *MCU_data));
+METHODDEF(boolean) decode_mcu_AC_first JPP((j_decompress_ptr cinfo,
+ JBLOCKROW *MCU_data));
+METHODDEF(boolean) decode_mcu_DC_refine JPP((j_decompress_ptr cinfo,
+ JBLOCKROW *MCU_data));
+METHODDEF(boolean) decode_mcu_AC_refine JPP((j_decompress_ptr cinfo,
+ JBLOCKROW *MCU_data));
+
+
+/*
+ * Initialize for a Huffman-compressed scan.
+ */
+
+METHODDEF(void)
+start_pass_phuff_decoder (j_decompress_ptr cinfo)
+{
+ phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
+ boolean is_DC_band, bad;
+ int ci, coefi, tbl;
+ int *coef_bit_ptr;
+ jpeg_component_info * compptr;
+
+ is_DC_band = (cinfo->Ss == 0);
+
+ /* Validate scan parameters */
+ bad = FALSE;
+ if (is_DC_band) {
+ if (cinfo->Se != 0)
+ bad = TRUE;
+ } else {
+ /* need not check Ss/Se < 0 since they came from unsigned bytes */
+ if (cinfo->Ss > cinfo->Se || cinfo->Se >= DCTSIZE2)
+ bad = TRUE;
+ /* AC scans may have only one component */
+ if (cinfo->comps_in_scan != 1)
+ bad = TRUE;
+ }
+ if (cinfo->Ah != 0) {
+ /* Successive approximation refinement scan: must have Al = Ah-1. */
+ if (cinfo->Al != cinfo->Ah-1)
+ bad = TRUE;
+ }
+ if (cinfo->Al > 13) /* need not check for < 0 */
+ bad = TRUE;
+ /* Arguably the maximum Al value should be less than 13 for 8-bit precision,
+ * but the spec doesn't say so, and we try to be liberal about what we
+ * accept. Note: large Al values could result in out-of-range DC
+ * coefficients during early scans, leading to bizarre displays due to
+ * overflows in the IDCT math. But we won't crash.
+ */
+ if (bad)
+ ERREXIT4(cinfo, JERR_BAD_PROGRESSION,
+ cinfo->Ss, cinfo->Se, cinfo->Ah, cinfo->Al);
+ /* Update progression status, and verify that scan order is legal.
+ * Note that inter-scan inconsistencies are treated as warnings
+ * not fatal errors ... not clear if this is right way to behave.
+ */
+ for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
+ int cindex = cinfo->cur_comp_info[ci]->component_index;
+ coef_bit_ptr = & cinfo->coef_bits[cindex][0];
+ if (!is_DC_band && coef_bit_ptr[0] < 0) /* AC without prior DC scan */
+ WARNMS2(cinfo, JWRN_BOGUS_PROGRESSION, cindex, 0);
+ for (coefi = cinfo->Ss; coefi <= cinfo->Se; coefi++) {
+ int expected = (coef_bit_ptr[coefi] < 0) ? 0 : coef_bit_ptr[coefi];
+ if (cinfo->Ah != expected)
+ WARNMS2(cinfo, JWRN_BOGUS_PROGRESSION, cindex, coefi);
+ coef_bit_ptr[coefi] = cinfo->Al;
+ }
+ }
+
+ /* Select MCU decoding routine */
+ if (cinfo->Ah == 0) {
+ if (is_DC_band)
+ entropy->pub.decode_mcu = decode_mcu_DC_first;
+ else
+ entropy->pub.decode_mcu = decode_mcu_AC_first;
+ } else {
+ if (is_DC_band)
+ entropy->pub.decode_mcu = decode_mcu_DC_refine;
+ else
+ entropy->pub.decode_mcu = decode_mcu_AC_refine;
+ }
+
+ for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
+ compptr = cinfo->cur_comp_info[ci];
+ /* Make sure requested tables are present, and compute derived tables.
+ * We may build same derived table more than once, but it's not expensive.
+ */
+ if (is_DC_band) {
+ if (cinfo->Ah == 0) { /* DC refinement needs no table */
+ tbl = compptr->dc_tbl_no;
+ jpeg_make_d_derived_tbl(cinfo, TRUE, tbl,
+ & entropy->derived_tbls[tbl]);
+ }
+ } else {
+ tbl = compptr->ac_tbl_no;
+ jpeg_make_d_derived_tbl(cinfo, FALSE, tbl,
+ & entropy->derived_tbls[tbl]);
+ /* remember the single active table */
+ entropy->ac_derived_tbl = entropy->derived_tbls[tbl];
+ }
+ /* Initialize DC predictions to 0 */
+ entropy->saved.last_dc_val[ci] = 0;
+ }
+
+ /* Initialize bitread state variables */
+ entropy->bitstate.bits_left = 0;
+ entropy->bitstate.get_buffer = 0; /* unnecessary, but keeps Purify quiet */
+ entropy->pub.insufficient_data = FALSE;
+
+ /* Initialize private state variables */
+ entropy->saved.EOBRUN = 0;
+
+ /* Initialize restart counter */
+ entropy->restarts_to_go = cinfo->restart_interval;
+}
+
+
+/*
+ * Figure F.12: extend sign bit.
+ * On some machines, a shift and add will be faster than a table lookup.
+ */
+
+#ifdef AVOID_TABLES
+
+#define HUFF_EXTEND(x,s) ((x) < (1<<((s)-1)) ? (x) + (((-1)<<(s)) + 1) : (x))
+
+#else
+
+#define HUFF_EXTEND(x,s) ((x) < extend_test[s] ? (x) + extend_offset[s] : (x))
+
+static const int extend_test[16] = /* entry n is 2**(n-1) */
+ { 0, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080,
+ 0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000 };
+
+static const int extend_offset[16] = /* entry n is (-1 << n) + 1 */
+ { 0, ((-1)<<1) + 1, ((-1)<<2) + 1, ((-1)<<3) + 1, ((-1)<<4) + 1,
+ ((-1)<<5) + 1, ((-1)<<6) + 1, ((-1)<<7) + 1, ((-1)<<8) + 1,
+ ((-1)<<9) + 1, ((-1)<<10) + 1, ((-1)<<11) + 1, ((-1)<<12) + 1,
+ ((-1)<<13) + 1, ((-1)<<14) + 1, ((-1)<<15) + 1 };
+
+#endif /* AVOID_TABLES */
+
+
+/*
+ * Check for a restart marker & resynchronize decoder.
+ * Returns FALSE if must suspend.
+ */
+
+LOCAL(boolean)
+process_restart (j_decompress_ptr cinfo)
+{
+ phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
+ int ci;
+
+ /* Throw away any unused bits remaining in bit buffer; */
+ /* include any full bytes in next_marker's count of discarded bytes */
+ cinfo->marker->discarded_bytes += entropy->bitstate.bits_left / 8;
+ entropy->bitstate.bits_left = 0;
+
+ /* Advance past the RSTn marker */
+ if (! (*cinfo->marker->read_restart_marker) (cinfo))
+ return FALSE;
+
+ /* Re-initialize DC predictions to 0 */
+ for (ci = 0; ci < cinfo->comps_in_scan; ci++)
+ entropy->saved.last_dc_val[ci] = 0;
+ /* Re-init EOB run count, too */
+ entropy->saved.EOBRUN = 0;
+
+ /* Reset restart counter */
+ entropy->restarts_to_go = cinfo->restart_interval;
+
+ /* Reset out-of-data flag, unless read_restart_marker left us smack up
+ * against a marker. In that case we will end up treating the next data
+ * segment as empty, and we can avoid producing bogus output pixels by
+ * leaving the flag set.
+ */
+ if (cinfo->unread_marker == 0)
+ entropy->pub.insufficient_data = FALSE;
+
+ return TRUE;
+}
+
+
+/*
+ * Huffman MCU decoding.
+ * Each of these routines decodes and returns one MCU's worth of
+ * Huffman-compressed coefficients.
+ * The coefficients are reordered from zigzag order into natural array order,
+ * but are not dequantized.
+ *
+ * The i'th block of the MCU is stored into the block pointed to by
+ * MCU_data[i]. WE ASSUME THIS AREA IS INITIALLY ZEROED BY THE CALLER.
+ *
+ * We return FALSE if data source requested suspension. In that case no
+ * changes have been made to permanent state. (Exception: some output
+ * coefficients may already have been assigned. This is harmless for
+ * spectral selection, since we'll just re-assign them on the next call.
+ * Successive approximation AC refinement has to be more careful, however.)
+ */
+
+/*
+ * MCU decoding for DC initial scan (either spectral selection,
+ * or first pass of successive approximation).
+ */
+
+METHODDEF(boolean)
+decode_mcu_DC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
+{
+ phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
+ int Al = cinfo->Al;
+ register int s, r;
+ int blkn, ci;
+ JBLOCKROW block;
+ BITREAD_STATE_VARS;
+ savable_state state;
+ d_derived_tbl * tbl;
+ jpeg_component_info * compptr;
+
+ /* Process restart marker if needed; may have to suspend */
+ if (cinfo->restart_interval) {
+ if (entropy->restarts_to_go == 0)
+ if (! process_restart(cinfo))
+ return FALSE;
+ }
+
+ /* If we've run out of data, just leave the MCU set to zeroes.
+ * This way, we return uniform gray for the remainder of the segment.
+ */
+ if (! entropy->pub.insufficient_data) {
+
+ /* Load up working state */
+ BITREAD_LOAD_STATE(cinfo,entropy->bitstate);
+ ASSIGN_STATE(state, entropy->saved);
+
+ /* Outer loop handles each block in the MCU */
+
+ for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
+ block = MCU_data[blkn];
+ ci = cinfo->MCU_membership[blkn];
+ compptr = cinfo->cur_comp_info[ci];
+ tbl = entropy->derived_tbls[compptr->dc_tbl_no];
+
+ /* Decode a single block's worth of coefficients */
+
+ /* Section F.2.2.1: decode the DC coefficient difference */
+ HUFF_DECODE(s, br_state, tbl, return FALSE, label1);
+ if (s) {
+ CHECK_BIT_BUFFER(br_state, s, return FALSE);
+ r = GET_BITS(s);
+ s = HUFF_EXTEND(r, s);
+ }
+
+ /* Convert DC difference to actual value, update last_dc_val */
+ s += state.last_dc_val[ci];
+ state.last_dc_val[ci] = s;
+ /* Scale and output the coefficient (assumes jpeg_natural_order[0]=0) */
+ (*block)[0] = (JCOEF) (s << Al);
+ }
+
+ /* Completed MCU, so update state */
+ BITREAD_SAVE_STATE(cinfo,entropy->bitstate);
+ ASSIGN_STATE(entropy->saved, state);
+ }
+
+ /* Account for restart interval (no-op if not using restarts) */
+ entropy->restarts_to_go--;
+
+ return TRUE;
+}
+
+
+/*
+ * MCU decoding for AC initial scan (either spectral selection,
+ * or first pass of successive approximation).
+ */
+
+METHODDEF(boolean)
+decode_mcu_AC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
+{
+ phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
+ int Se = cinfo->Se;
+ int Al = cinfo->Al;
+ register int s, k, r;
+ unsigned int EOBRUN;
+ JBLOCKROW block;
+ BITREAD_STATE_VARS;
+ d_derived_tbl * tbl;
+
+ /* Process restart marker if needed; may have to suspend */
+ if (cinfo->restart_interval) {
+ if (entropy->restarts_to_go == 0)
+ if (! process_restart(cinfo))
+ return FALSE;
+ }
+
+ /* If we've run out of data, just leave the MCU set to zeroes.
+ * This way, we return uniform gray for the remainder of the segment.
+ */
+ if (! entropy->pub.insufficient_data) {
+
+ /* Load up working state.
+ * We can avoid loading/saving bitread state if in an EOB run.
+ */
+ EOBRUN = entropy->saved.EOBRUN; /* only part of saved state we need */
+
+ /* There is always only one block per MCU */
+
+ if (EOBRUN > 0) /* if it's a band of zeroes... */
+ EOBRUN--; /* ...process it now (we do nothing) */
+ else {
+ BITREAD_LOAD_STATE(cinfo,entropy->bitstate);
+ block = MCU_data[0];
+ tbl = entropy->ac_derived_tbl;
+
+ for (k = cinfo->Ss; k <= Se; k++) {
+ HUFF_DECODE(s, br_state, tbl, return FALSE, label2);
+ r = s >> 4;
+ s &= 15;
+ if (s) {
+ k += r;
+ CHECK_BIT_BUFFER(br_state, s, return FALSE);
+ r = GET_BITS(s);
+ s = HUFF_EXTEND(r, s);
+ /* Scale and output coefficient in natural (dezigzagged) order */
+ (*block)[jpeg_natural_order[k]] = (JCOEF) (s << Al);
+ } else {
+ if (r == 15) { /* ZRL */
+ k += 15; /* skip 15 zeroes in band */
+ } else { /* EOBr, run length is 2^r + appended bits */
+ EOBRUN = 1 << r;
+ if (r) { /* EOBr, r > 0 */
+ CHECK_BIT_BUFFER(br_state, r, return FALSE);
+ r = GET_BITS(r);
+ EOBRUN += r;
+ }
+ EOBRUN--; /* this band is processed at this moment */
+ break; /* force end-of-band */
+ }
+ }
+ }
+
+ BITREAD_SAVE_STATE(cinfo,entropy->bitstate);
+ }
+
+ /* Completed MCU, so update state */
+ entropy->saved.EOBRUN = EOBRUN; /* only part of saved state we need */
+ }
+
+ /* Account for restart interval (no-op if not using restarts) */
+ entropy->restarts_to_go--;
+
+ return TRUE;
+}
+
+
+/*
+ * MCU decoding for DC successive approximation refinement scan.
+ * Note: we assume such scans can be multi-component, although the spec
+ * is not very clear on the point.
+ */
+
+METHODDEF(boolean)
+decode_mcu_DC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
+{
+ phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
+ int p1 = 1 << cinfo->Al; /* 1 in the bit position being coded */
+ int blkn;
+ JBLOCKROW block;
+ BITREAD_STATE_VARS;
+
+ /* Process restart marker if needed; may have to suspend */
+ if (cinfo->restart_interval) {
+ if (entropy->restarts_to_go == 0)
+ if (! process_restart(cinfo))
+ return FALSE;
+ }
+
+ /* Not worth the cycles to check insufficient_data here,
+ * since we will not change the data anyway if we read zeroes.
+ */
+
+ /* Load up working state */
+ BITREAD_LOAD_STATE(cinfo,entropy->bitstate);
+
+ /* Outer loop handles each block in the MCU */
+
+ for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
+ block = MCU_data[blkn];
+
+ /* Encoded data is simply the next bit of the two's-complement DC value */
+ CHECK_BIT_BUFFER(br_state, 1, return FALSE);
+ if (GET_BITS(1))
+ (*block)[0] |= p1;
+ /* Note: since we use |=, repeating the assignment later is safe */
+ }
+
+ /* Completed MCU, so update state */
+ BITREAD_SAVE_STATE(cinfo,entropy->bitstate);
+
+ /* Account for restart interval (no-op if not using restarts) */
+ entropy->restarts_to_go--;
+
+ return TRUE;
+}
+
+
+/*
+ * MCU decoding for AC successive approximation refinement scan.
+ */
+
+METHODDEF(boolean)
+decode_mcu_AC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
+{
+ phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
+ int Se = cinfo->Se;
+ int p1 = 1 << cinfo->Al; /* 1 in the bit position being coded */
+ int m1 = (-1) << cinfo->Al; /* -1 in the bit position being coded */
+ register int s, k, r;
+ unsigned int EOBRUN;
+ JBLOCKROW block;
+ JCOEFPTR thiscoef;
+ BITREAD_STATE_VARS;
+ d_derived_tbl * tbl;
+ int num_newnz;
+ int newnz_pos[DCTSIZE2];
+
+ /* Process restart marker if needed; may have to suspend */
+ if (cinfo->restart_interval) {
+ if (entropy->restarts_to_go == 0)
+ if (! process_restart(cinfo))
+ return FALSE;
+ }
+
+ /* If we've run out of data, don't modify the MCU.
+ */
+ if (! entropy->pub.insufficient_data) {
+
+ /* Load up working state */
+ BITREAD_LOAD_STATE(cinfo,entropy->bitstate);
+ EOBRUN = entropy->saved.EOBRUN; /* only part of saved state we need */
+
+ /* There is always only one block per MCU */
+ block = MCU_data[0];
+ tbl = entropy->ac_derived_tbl;
+
+ /* If we are forced to suspend, we must undo the assignments to any newly
+ * nonzero coefficients in the block, because otherwise we'd get confused
+ * next time about which coefficients were already nonzero.
+ * But we need not undo addition of bits to already-nonzero coefficients;
+ * instead, we can test the current bit to see if we already did it.
+ */
+ num_newnz = 0;
+
+ /* initialize coefficient loop counter to start of band */
+ k = cinfo->Ss;
+
+ if (EOBRUN == 0) {
+ for (; k <= Se; k++) {
+ HUFF_DECODE(s, br_state, tbl, goto undoit, label3);
+ r = s >> 4;
+ s &= 15;
+ if (s) {
+ if (s != 1) /* size of new coef should always be 1 */
+ WARNMS(cinfo, JWRN_HUFF_BAD_CODE);
+ CHECK_BIT_BUFFER(br_state, 1, goto undoit);
+ if (GET_BITS(1))
+ s = p1; /* newly nonzero coef is positive */
+ else
+ s = m1; /* newly nonzero coef is negative */
+ } else {
+ if (r != 15) {
+ EOBRUN = 1 << r; /* EOBr, run length is 2^r + appended bits */
+ if (r) {
+ CHECK_BIT_BUFFER(br_state, r, goto undoit);
+ r = GET_BITS(r);
+ EOBRUN += r;
+ }
+ break; /* rest of block is handled by EOB logic */
+ }
+ /* note s = 0 for processing ZRL */
+ }
+ /* Advance over already-nonzero coefs and r still-zero coefs,
+ * appending correction bits to the nonzeroes. A correction bit is 1
+ * if the absolute value of the coefficient must be increased.
+ */
+ do {
+ thiscoef = *block + jpeg_natural_order[k];
+ if (*thiscoef != 0) {
+ CHECK_BIT_BUFFER(br_state, 1, goto undoit);
+ if (GET_BITS(1)) {
+ if ((*thiscoef & p1) == 0) { /* do nothing if already set it */
+ if (*thiscoef >= 0)
+ *thiscoef += p1;
+ else
+ *thiscoef += m1;
+ }
+ }
+ } else {
+ if (--r < 0)
+ break; /* reached target zero coefficient */
+ }
+ k++;
+ } while (k <= Se);
+ if (s) {
+ int pos = jpeg_natural_order[k];
+ /* Output newly nonzero coefficient */
+ (*block)[pos] = (JCOEF) s;
+ /* Remember its position in case we have to suspend */
+ newnz_pos[num_newnz++] = pos;
+ }
+ }
+ }
+
+ if (EOBRUN > 0) {
+ /* Scan any remaining coefficient positions after the end-of-band
+ * (the last newly nonzero coefficient, if any). Append a correction
+ * bit to each already-nonzero coefficient. A correction bit is 1
+ * if the absolute value of the coefficient must be increased.
+ */
+ for (; k <= Se; k++) {
+ thiscoef = *block + jpeg_natural_order[k];
+ if (*thiscoef != 0) {
+ CHECK_BIT_BUFFER(br_state, 1, goto undoit);
+ if (GET_BITS(1)) {
+ if ((*thiscoef & p1) == 0) { /* do nothing if already changed it */
+ if (*thiscoef >= 0)
+ *thiscoef += p1;
+ else
+ *thiscoef += m1;
+ }
+ }
+ }
+ }
+ /* Count one block completed in EOB run */
+ EOBRUN--;
+ }
+
+ /* Completed MCU, so update state */
+ BITREAD_SAVE_STATE(cinfo,entropy->bitstate);
+ entropy->saved.EOBRUN = EOBRUN; /* only part of saved state we need */
+ }
+
+ /* Account for restart interval (no-op if not using restarts) */
+ entropy->restarts_to_go--;
+
+ return TRUE;
+
+undoit:
+ /* Re-zero any output coefficients that we made newly nonzero */
+ while (num_newnz > 0)
+ (*block)[newnz_pos[--num_newnz]] = 0;
+
+ return FALSE;
+}
+
+
+/*
+ * Module initialization routine for progressive Huffman entropy decoding.
+ */
+
+GLOBAL(void)
+jinit_phuff_decoder (j_decompress_ptr cinfo)
+{
+ phuff_entropy_ptr entropy;
+ int *coef_bit_ptr;
+ int ci, i;
+
+ entropy = (phuff_entropy_ptr)
+ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ SIZEOF(phuff_entropy_decoder));
+ cinfo->entropy = (struct jpeg_entropy_decoder *) entropy;
+ entropy->pub.start_pass = start_pass_phuff_decoder;
+
+ /* Mark derived tables unallocated */
+ for (i = 0; i < NUM_HUFF_TBLS; i++) {
+ entropy->derived_tbls[i] = NULL;
+ }
+
+ /* Create progression status table */
+ cinfo->coef_bits = (int (*)[DCTSIZE2])
+ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ cinfo->num_components*DCTSIZE2*SIZEOF(int));
+ coef_bit_ptr = & cinfo->coef_bits[0][0];
+ for (ci = 0; ci < cinfo->num_components; ci++)
+ for (i = 0; i < DCTSIZE2; i++)
+ *coef_bit_ptr++ = -1;
+}
+
+#endif /* D_PROGRESSIVE_SUPPORTED */
+
+#endif //_FX_JPEG_TURBO_
diff --git a/core/src/fxcodec/libjpeg/fpdfapi_jdpostct.c b/core/src/fxcodec/libjpeg/fpdfapi_jdpostct.c
index 855be5c8aa..13b1b1bb0c 100644
--- a/core/src/fxcodec/libjpeg/fpdfapi_jdpostct.c
+++ b/core/src/fxcodec/libjpeg/fpdfapi_jdpostct.c
@@ -1,293 +1,293 @@
-#if !defined(_FX_JPEG_TURBO_)
-/*
- * jdpostct.c
- *
- * Copyright (C) 1994-1996, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- * For conditions of distribution and use, see the accompanying README file.
- *
- * This file contains the decompression postprocessing controller.
- * This controller manages the upsampling, color conversion, and color
- * quantization/reduction steps; specifically, it controls the buffering
- * between upsample/color conversion and color quantization/reduction.
- *
- * If no color quantization/reduction is required, then this module has no
- * work to do, and it just hands off to the upsample/color conversion code.
- * An integrated upsample/convert/quantize process would replace this module
- * entirely.
- */
-
-#define JPEG_INTERNALS
-#include "jinclude.h"
-#include "jpeglib.h"
-
-
-/* Private buffer controller object */
-
-typedef struct {
- struct jpeg_d_post_controller pub; /* public fields */
-
- /* Color quantization source buffer: this holds output data from
- * the upsample/color conversion step to be passed to the quantizer.
- * For two-pass color quantization, we need a full-image buffer;
- * for one-pass operation, a strip buffer is sufficient.
- */
- jvirt_sarray_ptr whole_image; /* virtual array, or NULL if one-pass */
- JSAMPARRAY buffer; /* strip buffer, or current strip of virtual */
- JDIMENSION strip_height; /* buffer size in rows */
- /* for two-pass mode only: */
- JDIMENSION starting_row; /* row # of first row in current strip */
- JDIMENSION next_row; /* index of next row to fill/empty in strip */
-} my_post_controller;
-
-typedef my_post_controller * my_post_ptr;
-
-
-/* Forward declarations */
-METHODDEF(void) post_process_1pass
- JPP((j_decompress_ptr cinfo,
- JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
- JDIMENSION in_row_groups_avail,
- JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
- JDIMENSION out_rows_avail));
-#ifdef QUANT_2PASS_SUPPORTED
-METHODDEF(void) post_process_prepass
- JPP((j_decompress_ptr cinfo,
- JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
- JDIMENSION in_row_groups_avail,
- JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
- JDIMENSION out_rows_avail));
-METHODDEF(void) post_process_2pass
- JPP((j_decompress_ptr cinfo,
- JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
- JDIMENSION in_row_groups_avail,
- JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
- JDIMENSION out_rows_avail));
-#endif
-
-
-/*
- * Initialize for a processing pass.
- */
-
-METHODDEF(void)
-start_pass_dpost (j_decompress_ptr cinfo, J_BUF_MODE pass_mode)
-{
- my_post_ptr post = (my_post_ptr) cinfo->post;
-
- switch (pass_mode) {
- case JBUF_PASS_THRU:
- if (cinfo->quantize_colors) {
- /* Single-pass processing with color quantization. */
- post->pub.post_process_data = post_process_1pass;
- /* We could be doing buffered-image output before starting a 2-pass
- * color quantization; in that case, jinit_d_post_controller did not
- * allocate a strip buffer. Use the virtual-array buffer as workspace.
- */
- if (post->buffer == NULL) {
- post->buffer = (*cinfo->mem->access_virt_sarray)
- ((j_common_ptr) cinfo, post->whole_image,
- (JDIMENSION) 0, post->strip_height, TRUE);
- }
- } else {
- /* For single-pass processing without color quantization,
- * I have no work to do; just call the upsampler directly.
- */
- post->pub.post_process_data = cinfo->upsample->upsample;
- }
- break;
-#ifdef QUANT_2PASS_SUPPORTED
- case JBUF_SAVE_AND_PASS:
- /* First pass of 2-pass quantization */
- if (post->whole_image == NULL)
- ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
- post->pub.post_process_data = post_process_prepass;
- break;
- case JBUF_CRANK_DEST:
- /* Second pass of 2-pass quantization */
- if (post->whole_image == NULL)
- ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
- post->pub.post_process_data = post_process_2pass;
- break;
-#endif /* QUANT_2PASS_SUPPORTED */
- default:
- ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
- break;
- }
- post->starting_row = post->next_row = 0;
-}
-
-
-/*
- * Process some data in the one-pass (strip buffer) case.
- * This is used for color precision reduction as well as one-pass quantization.
- */
-
-METHODDEF(void)
-post_process_1pass (j_decompress_ptr cinfo,
- JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
- JDIMENSION in_row_groups_avail,
- JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
- JDIMENSION out_rows_avail)
-{
- my_post_ptr post = (my_post_ptr) cinfo->post;
- JDIMENSION num_rows, max_rows;
-
- /* Fill the buffer, but not more than what we can dump out in one go. */
- /* Note we rely on the upsampler to detect bottom of image. */
- max_rows = out_rows_avail - *out_row_ctr;
- if (max_rows > post->strip_height)
- max_rows = post->strip_height;
- num_rows = 0;
- (*cinfo->upsample->upsample) (cinfo,
- input_buf, in_row_group_ctr, in_row_groups_avail,
- post->buffer, &num_rows, max_rows);
- /* Quantize and emit data. */
- (*cinfo->cquantize->color_quantize) (cinfo,
- post->buffer, output_buf + *out_row_ctr, (int) num_rows);
- *out_row_ctr += num_rows;
-}
-
-
-#ifdef QUANT_2PASS_SUPPORTED
-
-/*
- * Process some data in the first pass of 2-pass quantization.
- */
-
-METHODDEF(void)
-post_process_prepass (j_decompress_ptr cinfo,
- JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
- JDIMENSION in_row_groups_avail,
- JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
- JDIMENSION out_rows_avail)
-{
- my_post_ptr post = (my_post_ptr) cinfo->post;
- JDIMENSION old_next_row, num_rows;
-
- /* Reposition virtual buffer if at start of strip. */
- if (post->next_row == 0) {
- post->buffer = (*cinfo->mem->access_virt_sarray)
- ((j_common_ptr) cinfo, post->whole_image,
- post->starting_row, post->strip_height, TRUE);
- }
-
- /* Upsample some data (up to a strip height's worth). */
- old_next_row = post->next_row;
- (*cinfo->upsample->upsample) (cinfo,
- input_buf, in_row_group_ctr, in_row_groups_avail,
- post->buffer, &post->next_row, post->strip_height);
-
- /* Allow quantizer to scan new data. No data is emitted, */
- /* but we advance out_row_ctr so outer loop can tell when we're done. */
- if (post->next_row > old_next_row) {
- num_rows = post->next_row - old_next_row;
- (*cinfo->cquantize->color_quantize) (cinfo, post->buffer + old_next_row,
- (JSAMPARRAY) NULL, (int) num_rows);
- *out_row_ctr += num_rows;
- }
-
- /* Advance if we filled the strip. */
- if (post->next_row >= post->strip_height) {
- post->starting_row += post->strip_height;
- post->next_row = 0;
- }
-}
-
-
-/*
- * Process some data in the second pass of 2-pass quantization.
- */
-
-METHODDEF(void)
-post_process_2pass (j_decompress_ptr cinfo,
- JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
- JDIMENSION in_row_groups_avail,
- JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
- JDIMENSION out_rows_avail)
-{
- my_post_ptr post = (my_post_ptr) cinfo->post;
- JDIMENSION num_rows, max_rows;
-
- /* Reposition virtual buffer if at start of strip. */
- if (post->next_row == 0) {
- post->buffer = (*cinfo->mem->access_virt_sarray)
- ((j_common_ptr) cinfo, post->whole_image,
- post->starting_row, post->strip_height, FALSE);
- }
-
- /* Determine number of rows to emit. */
- num_rows = post->strip_height - post->next_row; /* available in strip */
- max_rows = out_rows_avail - *out_row_ctr; /* available in output area */
- if (num_rows > max_rows)
- num_rows = max_rows;
- /* We have to check bottom of image here, can't depend on upsampler. */
- max_rows = cinfo->output_height - post->starting_row;
- if (num_rows > max_rows)
- num_rows = max_rows;
-
- /* Quantize and emit data. */
- (*cinfo->cquantize->color_quantize) (cinfo,
- post->buffer + post->next_row, output_buf + *out_row_ctr,
- (int) num_rows);
- *out_row_ctr += num_rows;
-
- /* Advance if we filled the strip. */
- post->next_row += num_rows;
- if (post->next_row >= post->strip_height) {
- post->starting_row += post->strip_height;
- post->next_row = 0;
- }
-}
-
-#endif /* QUANT_2PASS_SUPPORTED */
-
-
-/*
- * Initialize postprocessing controller.
- */
-
-GLOBAL(void)
-jinit_d_post_controller (j_decompress_ptr cinfo, boolean need_full_buffer)
-{
- my_post_ptr post;
-
- post = (my_post_ptr)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- SIZEOF(my_post_controller));
- cinfo->post = (struct jpeg_d_post_controller *) post;
- post->pub.start_pass = start_pass_dpost;
- post->whole_image = NULL; /* flag for no virtual arrays */
- post->buffer = NULL; /* flag for no strip buffer */
-
- /* Create the quantization buffer, if needed */
- if (cinfo->quantize_colors) {
- /* The buffer strip height is max_v_samp_factor, which is typically
- * an efficient number of rows for upsampling to return.
- * (In the presence of output rescaling, we might want to be smarter?)
- */
- post->strip_height = (JDIMENSION) cinfo->max_v_samp_factor;
- if (need_full_buffer) {
- /* Two-pass color quantization: need full-image storage. */
- /* We round up the number of rows to a multiple of the strip height. */
-#ifdef QUANT_2PASS_SUPPORTED
- post->whole_image = (*cinfo->mem->request_virt_sarray)
- ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,
- cinfo->output_width * cinfo->out_color_components,
- (JDIMENSION) jround_up((long) cinfo->output_height,
- (long) post->strip_height),
- post->strip_height);
-#else
- ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
-#endif /* QUANT_2PASS_SUPPORTED */
- } else {
- /* One-pass color quantization: just make a strip buffer. */
- post->buffer = (*cinfo->mem->alloc_sarray)
- ((j_common_ptr) cinfo, JPOOL_IMAGE,
- cinfo->output_width * cinfo->out_color_components,
- post->strip_height);
- }
- }
-}
-
-#endif //_FX_JPEG_TURBO_
+#if !defined(_FX_JPEG_TURBO_)
+/*
+ * jdpostct.c
+ *
+ * Copyright (C) 1994-1996, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains the decompression postprocessing controller.
+ * This controller manages the upsampling, color conversion, and color
+ * quantization/reduction steps; specifically, it controls the buffering
+ * between upsample/color conversion and color quantization/reduction.
+ *
+ * If no color quantization/reduction is required, then this module has no
+ * work to do, and it just hands off to the upsample/color conversion code.
+ * An integrated upsample/convert/quantize process would replace this module
+ * entirely.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+
+
+/* Private buffer controller object */
+
+typedef struct {
+ struct jpeg_d_post_controller pub; /* public fields */
+
+ /* Color quantization source buffer: this holds output data from
+ * the upsample/color conversion step to be passed to the quantizer.
+ * For two-pass color quantization, we need a full-image buffer;
+ * for one-pass operation, a strip buffer is sufficient.
+ */
+ jvirt_sarray_ptr whole_image; /* virtual array, or NULL if one-pass */
+ JSAMPARRAY buffer; /* strip buffer, or current strip of virtual */
+ JDIMENSION strip_height; /* buffer size in rows */
+ /* for two-pass mode only: */
+ JDIMENSION starting_row; /* row # of first row in current strip */
+ JDIMENSION next_row; /* index of next row to fill/empty in strip */
+} my_post_controller;
+
+typedef my_post_controller * my_post_ptr;
+
+
+/* Forward declarations */
+METHODDEF(void) post_process_1pass
+ JPP((j_decompress_ptr cinfo,
+ JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
+ JDIMENSION in_row_groups_avail,
+ JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
+ JDIMENSION out_rows_avail));
+#ifdef QUANT_2PASS_SUPPORTED
+METHODDEF(void) post_process_prepass
+ JPP((j_decompress_ptr cinfo,
+ JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
+ JDIMENSION in_row_groups_avail,
+ JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
+ JDIMENSION out_rows_avail));
+METHODDEF(void) post_process_2pass
+ JPP((j_decompress_ptr cinfo,
+ JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
+ JDIMENSION in_row_groups_avail,
+ JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
+ JDIMENSION out_rows_avail));
+#endif
+
+
+/*
+ * Initialize for a processing pass.
+ */
+
+METHODDEF(void)
+start_pass_dpost (j_decompress_ptr cinfo, J_BUF_MODE pass_mode)
+{
+ my_post_ptr post = (my_post_ptr) cinfo->post;
+
+ switch (pass_mode) {
+ case JBUF_PASS_THRU:
+ if (cinfo->quantize_colors) {
+ /* Single-pass processing with color quantization. */
+ post->pub.post_process_data = post_process_1pass;
+ /* We could be doing buffered-image output before starting a 2-pass
+ * color quantization; in that case, jinit_d_post_controller did not
+ * allocate a strip buffer. Use the virtual-array buffer as workspace.
+ */
+ if (post->buffer == NULL) {
+ post->buffer = (*cinfo->mem->access_virt_sarray)
+ ((j_common_ptr) cinfo, post->whole_image,
+ (JDIMENSION) 0, post->strip_height, TRUE);
+ }
+ } else {
+ /* For single-pass processing without color quantization,
+ * I have no work to do; just call the upsampler directly.
+ */
+ post->pub.post_process_data = cinfo->upsample->upsample;
+ }
+ break;
+#ifdef QUANT_2PASS_SUPPORTED
+ case JBUF_SAVE_AND_PASS:
+ /* First pass of 2-pass quantization */
+ if (post->whole_image == NULL)
+ ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
+ post->pub.post_process_data = post_process_prepass;
+ break;
+ case JBUF_CRANK_DEST:
+ /* Second pass of 2-pass quantization */
+ if (post->whole_image == NULL)
+ ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
+ post->pub.post_process_data = post_process_2pass;
+ break;
+#endif /* QUANT_2PASS_SUPPORTED */
+ default:
+ ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
+ break;
+ }
+ post->starting_row = post->next_row = 0;
+}
+
+
+/*
+ * Process some data in the one-pass (strip buffer) case.
+ * This is used for color precision reduction as well as one-pass quantization.
+ */
+
+METHODDEF(void)
+post_process_1pass (j_decompress_ptr cinfo,
+ JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
+ JDIMENSION in_row_groups_avail,
+ JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
+ JDIMENSION out_rows_avail)
+{
+ my_post_ptr post = (my_post_ptr) cinfo->post;
+ JDIMENSION num_rows, max_rows;
+
+ /* Fill the buffer, but not more than what we can dump out in one go. */
+ /* Note we rely on the upsampler to detect bottom of image. */
+ max_rows = out_rows_avail - *out_row_ctr;
+ if (max_rows > post->strip_height)
+ max_rows = post->strip_height;
+ num_rows = 0;
+ (*cinfo->upsample->upsample) (cinfo,
+ input_buf, in_row_group_ctr, in_row_groups_avail,
+ post->buffer, &num_rows, max_rows);
+ /* Quantize and emit data. */
+ (*cinfo->cquantize->color_quantize) (cinfo,
+ post->buffer, output_buf + *out_row_ctr, (int) num_rows);
+ *out_row_ctr += num_rows;
+}
+
+
+#ifdef QUANT_2PASS_SUPPORTED
+
+/*
+ * Process some data in the first pass of 2-pass quantization.
+ */
+
+METHODDEF(void)
+post_process_prepass (j_decompress_ptr cinfo,
+ JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
+ JDIMENSION in_row_groups_avail,
+ JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
+ JDIMENSION out_rows_avail)
+{
+ my_post_ptr post = (my_post_ptr) cinfo->post;
+ JDIMENSION old_next_row, num_rows;
+
+ /* Reposition virtual buffer if at start of strip. */
+ if (post->next_row == 0) {
+ post->buffer = (*cinfo->mem->access_virt_sarray)
+ ((j_common_ptr) cinfo, post->whole_image,
+ post->starting_row, post->strip_height, TRUE);
+ }
+
+ /* Upsample some data (up to a strip height's worth). */
+ old_next_row = post->next_row;
+ (*cinfo->upsample->upsample) (cinfo,
+ input_buf, in_row_group_ctr, in_row_groups_avail,
+ post->buffer, &post->next_row, post->strip_height);
+
+ /* Allow quantizer to scan new data. No data is emitted, */
+ /* but we advance out_row_ctr so outer loop can tell when we're done. */
+ if (post->next_row > old_next_row) {
+ num_rows = post->next_row - old_next_row;
+ (*cinfo->cquantize->color_quantize) (cinfo, post->buffer + old_next_row,
+ (JSAMPARRAY) NULL, (int) num_rows);
+ *out_row_ctr += num_rows;
+ }
+
+ /* Advance if we filled the strip. */
+ if (post->next_row >= post->strip_height) {
+ post->starting_row += post->strip_height;
+ post->next_row = 0;
+ }
+}
+
+
+/*
+ * Process some data in the second pass of 2-pass quantization.
+ */
+
+METHODDEF(void)
+post_process_2pass (j_decompress_ptr cinfo,
+ JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
+ JDIMENSION in_row_groups_avail,
+ JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
+ JDIMENSION out_rows_avail)
+{
+ my_post_ptr post = (my_post_ptr) cinfo->post;
+ JDIMENSION num_rows, max_rows;
+
+ /* Reposition virtual buffer if at start of strip. */
+ if (post->next_row == 0) {
+ post->buffer = (*cinfo->mem->access_virt_sarray)
+ ((j_common_ptr) cinfo, post->whole_image,
+ post->starting_row, post->strip_height, FALSE);
+ }
+
+ /* Determine number of rows to emit. */
+ num_rows = post->strip_height - post->next_row; /* available in strip */
+ max_rows = out_rows_avail - *out_row_ctr; /* available in output area */
+ if (num_rows > max_rows)
+ num_rows = max_rows;
+ /* We have to check bottom of image here, can't depend on upsampler. */
+ max_rows = cinfo->output_height - post->starting_row;
+ if (num_rows > max_rows)
+ num_rows = max_rows;
+
+ /* Quantize and emit data. */
+ (*cinfo->cquantize->color_quantize) (cinfo,
+ post->buffer + post->next_row, output_buf + *out_row_ctr,
+ (int) num_rows);
+ *out_row_ctr += num_rows;
+
+ /* Advance if we filled the strip. */
+ post->next_row += num_rows;
+ if (post->next_row >= post->strip_height) {
+ post->starting_row += post->strip_height;
+ post->next_row = 0;
+ }
+}
+
+#endif /* QUANT_2PASS_SUPPORTED */
+
+
+/*
+ * Initialize postprocessing controller.
+ */
+
+GLOBAL(void)
+jinit_d_post_controller (j_decompress_ptr cinfo, boolean need_full_buffer)
+{
+ my_post_ptr post;
+
+ post = (my_post_ptr)
+ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ SIZEOF(my_post_controller));
+ cinfo->post = (struct jpeg_d_post_controller *) post;
+ post->pub.start_pass = start_pass_dpost;
+ post->whole_image = NULL; /* flag for no virtual arrays */
+ post->buffer = NULL; /* flag for no strip buffer */
+
+ /* Create the quantization buffer, if needed */
+ if (cinfo->quantize_colors) {
+ /* The buffer strip height is max_v_samp_factor, which is typically
+ * an efficient number of rows for upsampling to return.
+ * (In the presence of output rescaling, we might want to be smarter?)
+ */
+ post->strip_height = (JDIMENSION) cinfo->max_v_samp_factor;
+ if (need_full_buffer) {
+ /* Two-pass color quantization: need full-image storage. */
+ /* We round up the number of rows to a multiple of the strip height. */
+#ifdef QUANT_2PASS_SUPPORTED
+ post->whole_image = (*cinfo->mem->request_virt_sarray)
+ ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,
+ cinfo->output_width * cinfo->out_color_components,
+ (JDIMENSION) jround_up((long) cinfo->output_height,
+ (long) post->strip_height),
+ post->strip_height);
+#else
+ ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
+#endif /* QUANT_2PASS_SUPPORTED */
+ } else {
+ /* One-pass color quantization: just make a strip buffer. */
+ post->buffer = (*cinfo->mem->alloc_sarray)
+ ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ cinfo->output_width * cinfo->out_color_components,
+ post->strip_height);
+ }
+ }
+}
+
+#endif //_FX_JPEG_TURBO_
diff --git a/core/src/fxcodec/libjpeg/fpdfapi_jdsample.c b/core/src/fxcodec/libjpeg/fpdfapi_jdsample.c
index a2eae954b5..da9c38ce38 100644
--- a/core/src/fxcodec/libjpeg/fpdfapi_jdsample.c
+++ b/core/src/fxcodec/libjpeg/fpdfapi_jdsample.c
@@ -1,481 +1,481 @@
-#if !defined(_FX_JPEG_TURBO_)
-/*
- * jdsample.c
- *
- * Copyright (C) 1991-1996, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- * For conditions of distribution and use, see the accompanying README file.
- *
- * This file contains upsampling routines.
- *
- * Upsampling input data is counted in "row groups". A row group
- * is defined to be (v_samp_factor * DCT_scaled_size / min_DCT_scaled_size)
- * sample rows of each component. Upsampling will normally produce
- * max_v_samp_factor pixel rows from each row group (but this could vary
- * if the upsampler is applying a scale factor of its own).
- *
- * An excellent reference for image resampling is
- * Digital Image Warping, George Wolberg, 1990.
- * Pub. by IEEE Computer Society Press, Los Alamitos, CA. ISBN 0-8186-8944-7.
- */
-
-#define JPEG_INTERNALS
-#include "jinclude.h"
-#include "jpeglib.h"
-
-
-/* Pointer to routine to upsample a single component */
-typedef JMETHOD(void, upsample1_ptr,
- (j_decompress_ptr cinfo, jpeg_component_info * compptr,
- JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr));
-
-/* Private subobject */
-
-typedef struct {
- struct jpeg_upsampler pub; /* public fields */
-
- /* Color conversion buffer. When using separate upsampling and color
- * conversion steps, this buffer holds one upsampled row group until it
- * has been color converted and output.
- * Note: we do not allocate any storage for component(s) which are full-size,
- * ie do not need rescaling. The corresponding entry of color_buf[] is
- * simply set to point to the input data array, thereby avoiding copying.
- */
- JSAMPARRAY color_buf[MAX_COMPONENTS];
-
- /* Per-component upsampling method pointers */
- upsample1_ptr methods[MAX_COMPONENTS];
-
- int next_row_out; /* counts rows emitted from color_buf */
- JDIMENSION rows_to_go; /* counts rows remaining in image */
-
- /* Height of an input row group for each component. */
- int rowgroup_height[MAX_COMPONENTS];
-
- /* These arrays save pixel expansion factors so that int_expand need not
- * recompute them each time. They are unused for other upsampling methods.
- */
- UINT8 h_expand[MAX_COMPONENTS];
- UINT8 v_expand[MAX_COMPONENTS];
-} my_upsampler;
-
-typedef my_upsampler * my_upsample_ptr;
-
-
-/*
- * Initialize for an upsampling pass.
- */
-
-METHODDEF(void)
-start_pass_upsample (j_decompress_ptr cinfo)
-{
- my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
-
- /* Mark the conversion buffer empty */
- upsample->next_row_out = cinfo->max_v_samp_factor;
- /* Initialize total-height counter for detecting bottom of image */
- upsample->rows_to_go = cinfo->output_height;
-}
-
-
-/*
- * Control routine to do upsampling (and color conversion).
- *
- * In this version we upsample each component independently.
- * We upsample one row group into the conversion buffer, then apply
- * color conversion a row at a time.
- */
-
-METHODDEF(void)
-sep_upsample (j_decompress_ptr cinfo,
- JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
- JDIMENSION in_row_groups_avail,
- JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
- JDIMENSION out_rows_avail)
-{
- my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
- int ci;
- jpeg_component_info * compptr;
- JDIMENSION num_rows;
-
- /* Fill the conversion buffer, if it's empty */
- if (upsample->next_row_out >= cinfo->max_v_samp_factor) {
- for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
- ci++, compptr++) {
- /* Invoke per-component upsample method. Notice we pass a POINTER
- * to color_buf[ci], so that fullsize_upsample can change it.
- */
- (*upsample->methods[ci]) (cinfo, compptr,
- input_buf[ci] + (*in_row_group_ctr * upsample->rowgroup_height[ci]),
- upsample->color_buf + ci);
- }
- upsample->next_row_out = 0;
- }
-
- /* Color-convert and emit rows */
-
- /* How many we have in the buffer: */
- num_rows = (JDIMENSION) (cinfo->max_v_samp_factor - upsample->next_row_out);
- /* Not more than the distance to the end of the image. Need this test
- * in case the image height is not a multiple of max_v_samp_factor:
- */
- if (num_rows > upsample->rows_to_go)
- num_rows = upsample->rows_to_go;
- /* And not more than what the client can accept: */
- out_rows_avail -= *out_row_ctr;
- if (num_rows > out_rows_avail)
- num_rows = out_rows_avail;
-
- (*cinfo->cconvert->color_convert) (cinfo, upsample->color_buf,
- (JDIMENSION) upsample->next_row_out,
- output_buf + *out_row_ctr,
- (int) num_rows);
-
- /* Adjust counts */
- *out_row_ctr += num_rows;
- upsample->rows_to_go -= num_rows;
- upsample->next_row_out += num_rows;
- /* When the buffer is emptied, declare this input row group consumed */
- if (upsample->next_row_out >= cinfo->max_v_samp_factor)
- (*in_row_group_ctr)++;
-}
-
-
-/*
- * These are the routines invoked by sep_upsample to upsample pixel values
- * of a single component. One row group is processed per call.
- */
-
-
-/*
- * For full-size components, we just make color_buf[ci] point at the
- * input buffer, and thus avoid copying any data. Note that this is
- * safe only because sep_upsample doesn't declare the input row group
- * "consumed" until we are done color converting and emitting it.
- */
-
-METHODDEF(void)
-fullsize_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
- JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)
-{
- *output_data_ptr = input_data;
-}
-
-
-/*
- * This is a no-op version used for "uninteresting" components.
- * These components will not be referenced by color conversion.
- */
-
-METHODDEF(void)
-noop_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
- JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)
-{
- *output_data_ptr = NULL; /* safety check */
-}
-
-
-/*
- * This version handles any integral sampling ratios.
- * This is not used for typical JPEG files, so it need not be fast.
- * Nor, for that matter, is it particularly accurate: the algorithm is
- * simple replication of the input pixel onto the corresponding output
- * pixels. The hi-falutin sampling literature refers to this as a
- * "box filter". A box filter tends to introduce visible artifacts,
- * so if you are actually going to use 3:1 or 4:1 sampling ratios
- * you would be well advised to improve this code.
- */
-
-METHODDEF(void)
-int_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
- JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)
-{
- my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
- JSAMPARRAY output_data = *output_data_ptr;
- register JSAMPROW inptr, outptr;
- register JSAMPLE invalue;
- register int h;
- JSAMPROW outend;
- int h_expand, v_expand;
- int inrow, outrow;
-
- h_expand = upsample->h_expand[compptr->component_index];
- v_expand = upsample->v_expand[compptr->component_index];
-
- inrow = outrow = 0;
- while (outrow < cinfo->max_v_samp_factor) {
- /* Generate one output row with proper horizontal expansion */
- inptr = input_data[inrow];
- outptr = output_data[outrow];
- outend = outptr + cinfo->output_width;
- while (outptr < outend) {
- invalue = *inptr++; /* don't need GETJSAMPLE() here */
- for (h = h_expand; h > 0; h--) {
- *outptr++ = invalue;
- }
- }
- /* Generate any additional output rows by duplicating the first one */
- if (v_expand > 1) {
- jcopy_sample_rows(output_data, outrow, output_data, outrow+1,
- v_expand-1, cinfo->output_width);
- }
- inrow++;
- outrow += v_expand;
- }
-}
-
-
-/*
- * Fast processing for the common case of 2:1 horizontal and 1:1 vertical.
- * It's still a box filter.
- */
-
-METHODDEF(void)
-h2v1_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
- JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)
-{
- JSAMPARRAY output_data = *output_data_ptr;
- register JSAMPROW inptr, outptr;
- register JSAMPLE invalue;
- JSAMPROW outend;
- int inrow;
-
- for (inrow = 0; inrow < cinfo->max_v_samp_factor; inrow++) {
- inptr = input_data[inrow];
- outptr = output_data[inrow];
- outend = outptr + cinfo->output_width;
- while (outptr < outend) {
- invalue = *inptr++; /* don't need GETJSAMPLE() here */
- *outptr++ = invalue;
- *outptr++ = invalue;
- }
- }
-}
-
-
-/*
- * Fast processing for the common case of 2:1 horizontal and 2:1 vertical.
- * It's still a box filter.
- */
-
-METHODDEF(void)
-h2v2_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
- JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)
-{
- JSAMPARRAY output_data = *output_data_ptr;
- register JSAMPROW inptr, outptr;
- register JSAMPLE invalue;
- JSAMPROW outend;
- int inrow, outrow;
-
- inrow = outrow = 0;
- while (outrow < cinfo->max_v_samp_factor) {
- inptr = input_data[inrow];
- outptr = output_data[outrow];
- outend = outptr + cinfo->output_width;
- while (outptr < outend) {
- invalue = *inptr++; /* don't need GETJSAMPLE() here */
- *outptr++ = invalue;
- *outptr++ = invalue;
- }
- jcopy_sample_rows(output_data, outrow, output_data, outrow+1,
- 1, cinfo->output_width);
- inrow++;
- outrow += 2;
- }
-}
-
-
-/*
- * Fancy processing for the common case of 2:1 horizontal and 1:1 vertical.
- *
- * The upsampling algorithm is linear interpolation between pixel centers,
- * also known as a "triangle filter". This is a good compromise between
- * speed and visual quality. The centers of the output pixels are 1/4 and 3/4
- * of the way between input pixel centers.
- *
- * A note about the "bias" calculations: when rounding fractional values to
- * integer, we do not want to always round 0.5 up to the next integer.
- * If we did that, we'd introduce a noticeable bias towards larger values.
- * Instead, this code is arranged so that 0.5 will be rounded up or down at
- * alternate pixel locations (a simple ordered dither pattern).
- */
-
-METHODDEF(void)
-h2v1_fancy_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
- JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)
-{
- JSAMPARRAY output_data = *output_data_ptr;
- register JSAMPROW inptr, outptr;
- register int invalue;
- register JDIMENSION colctr;
- int inrow;
-
- for (inrow = 0; inrow < cinfo->max_v_samp_factor; inrow++) {
- inptr = input_data[inrow];
- outptr = output_data[inrow];
- /* Special case for first column */
- invalue = GETJSAMPLE(*inptr++);
- *outptr++ = (JSAMPLE) invalue;
- *outptr++ = (JSAMPLE) ((invalue * 3 + GETJSAMPLE(*inptr) + 2) >> 2);
-
- for (colctr = compptr->downsampled_width - 2; colctr > 0; colctr--) {
- /* General case: 3/4 * nearer pixel + 1/4 * further pixel */
- invalue = GETJSAMPLE(*inptr++) * 3;
- *outptr++ = (JSAMPLE) ((invalue + GETJSAMPLE(inptr[-2]) + 1) >> 2);
- *outptr++ = (JSAMPLE) ((invalue + GETJSAMPLE(*inptr) + 2) >> 2);
- }
-
- /* Special case for last column */
- invalue = GETJSAMPLE(*inptr);
- *outptr++ = (JSAMPLE) ((invalue * 3 + GETJSAMPLE(inptr[-1]) + 1) >> 2);
- *outptr++ = (JSAMPLE) invalue;
- }
-}
-
-
-/*
- * Fancy processing for the common case of 2:1 horizontal and 2:1 vertical.
- * Again a triangle filter; see comments for h2v1 case, above.
- *
- * It is OK for us to reference the adjacent input rows because we demanded
- * context from the main buffer controller (see initialization code).
- */
-
-METHODDEF(void)
-h2v2_fancy_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
- JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)
-{
- JSAMPARRAY output_data = *output_data_ptr;
- register JSAMPROW inptr0, inptr1, outptr;
-#if BITS_IN_JSAMPLE == 8
- register int thiscolsum, lastcolsum, nextcolsum;
-#else
- register INT32 thiscolsum, lastcolsum, nextcolsum;
-#endif
- register JDIMENSION colctr;
- int inrow, outrow, v;
-
- inrow = outrow = 0;
- while (outrow < cinfo->max_v_samp_factor) {
- for (v = 0; v < 2; v++) {
- /* inptr0 points to nearest input row, inptr1 points to next nearest */
- inptr0 = input_data[inrow];
- if (v == 0) /* next nearest is row above */
- inptr1 = input_data[inrow-1];
- else /* next nearest is row below */
- inptr1 = input_data[inrow+1];
- outptr = output_data[outrow++];
-
- /* Special case for first column */
- thiscolsum = GETJSAMPLE(*inptr0++) * 3 + GETJSAMPLE(*inptr1++);
- nextcolsum = GETJSAMPLE(*inptr0++) * 3 + GETJSAMPLE(*inptr1++);
- *outptr++ = (JSAMPLE) ((thiscolsum * 4 + 8) >> 4);
- *outptr++ = (JSAMPLE) ((thiscolsum * 3 + nextcolsum + 7) >> 4);
- lastcolsum = thiscolsum; thiscolsum = nextcolsum;
-
- for (colctr = compptr->downsampled_width - 2; colctr > 0; colctr--) {
- /* General case: 3/4 * nearer pixel + 1/4 * further pixel in each */
- /* dimension, thus 9/16, 3/16, 3/16, 1/16 overall */
- nextcolsum = GETJSAMPLE(*inptr0++) * 3 + GETJSAMPLE(*inptr1++);
- *outptr++ = (JSAMPLE) ((thiscolsum * 3 + lastcolsum + 8) >> 4);
- *outptr++ = (JSAMPLE) ((thiscolsum * 3 + nextcolsum + 7) >> 4);
- lastcolsum = thiscolsum; thiscolsum = nextcolsum;
- }
-
- /* Special case for last column */
- *outptr++ = (JSAMPLE) ((thiscolsum * 3 + lastcolsum + 8) >> 4);
- *outptr++ = (JSAMPLE) ((thiscolsum * 4 + 7) >> 4);
- }
- inrow++;
- }
-}
-
-
-/*
- * Module initialization routine for upsampling.
- */
-
-GLOBAL(void)
-jinit_upsampler (j_decompress_ptr cinfo)
-{
- my_upsample_ptr upsample;
- int ci;
- jpeg_component_info * compptr;
- boolean need_buffer, do_fancy;
- int h_in_group, v_in_group, h_out_group, v_out_group;
-
- upsample = (my_upsample_ptr)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- SIZEOF(my_upsampler));
- cinfo->upsample = (struct jpeg_upsampler *) upsample;
- upsample->pub.start_pass = start_pass_upsample;
- upsample->pub.upsample = sep_upsample;
- upsample->pub.need_context_rows = FALSE; /* until we find out differently */
-
- if (cinfo->CCIR601_sampling) /* this isn't supported */
- ERREXIT(cinfo, JERR_CCIR601_NOTIMPL);
-
- /* jdmainct.c doesn't support context rows when min_DCT_scaled_size = 1,
- * so don't ask for it.
- */
- do_fancy = cinfo->do_fancy_upsampling && cinfo->min_DCT_scaled_size > 1;
-
- /* Verify we can handle the sampling factors, select per-component methods,
- * and create storage as needed.
- */
- for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
- ci++, compptr++) {
- /* Compute size of an "input group" after IDCT scaling. This many samples
- * are to be converted to max_h_samp_factor * max_v_samp_factor pixels.
- */
- h_in_group = (compptr->h_samp_factor * compptr->DCT_scaled_size) /
- cinfo->min_DCT_scaled_size;
- v_in_group = (compptr->v_samp_factor * compptr->DCT_scaled_size) /
- cinfo->min_DCT_scaled_size;
- h_out_group = cinfo->max_h_samp_factor;
- v_out_group = cinfo->max_v_samp_factor;
- upsample->rowgroup_height[ci] = v_in_group; /* save for use later */
- need_buffer = TRUE;
- if (! compptr->component_needed) {
- /* Don't bother to upsample an uninteresting component. */
- upsample->methods[ci] = noop_upsample;
- need_buffer = FALSE;
- } else if (h_in_group == h_out_group && v_in_group == v_out_group) {
- /* Fullsize components can be processed without any work. */
- upsample->methods[ci] = fullsize_upsample;
- need_buffer = FALSE;
- } else if (h_in_group * 2 == h_out_group &&
- v_in_group == v_out_group) {
- /* Special cases for 2h1v upsampling */
- if (do_fancy && compptr->downsampled_width > 2)
- upsample->methods[ci] = h2v1_fancy_upsample;
- else
- upsample->methods[ci] = h2v1_upsample;
- } else if (h_in_group * 2 == h_out_group &&
- v_in_group * 2 == v_out_group) {
- /* Special cases for 2h2v upsampling */
- if (do_fancy && compptr->downsampled_width > 2) {
- upsample->methods[ci] = h2v2_fancy_upsample;
- upsample->pub.need_context_rows = TRUE;
- } else
- upsample->methods[ci] = h2v2_upsample;
- } else if ((h_out_group % h_in_group) == 0 &&
- (v_out_group % v_in_group) == 0) {
- /* Generic integral-factors upsampling method */
- upsample->methods[ci] = int_upsample;
- upsample->h_expand[ci] = (UINT8) (h_out_group / h_in_group);
- upsample->v_expand[ci] = (UINT8) (v_out_group / v_in_group);
- } else
- ERREXIT(cinfo, JERR_FRACT_SAMPLE_NOTIMPL);
- if (need_buffer) {
- upsample->color_buf[ci] = (*cinfo->mem->alloc_sarray)
- ((j_common_ptr) cinfo, JPOOL_IMAGE,
- (JDIMENSION) jround_up((long) cinfo->output_width,
- (long) cinfo->max_h_samp_factor),
- (JDIMENSION) cinfo->max_v_samp_factor);
- }
- }
-}
-
-#endif //_FX_JPEG_TURBO_
+#if !defined(_FX_JPEG_TURBO_)
+/*
+ * jdsample.c
+ *
+ * Copyright (C) 1991-1996, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains upsampling routines.
+ *
+ * Upsampling input data is counted in "row groups". A row group
+ * is defined to be (v_samp_factor * DCT_scaled_size / min_DCT_scaled_size)
+ * sample rows of each component. Upsampling will normally produce
+ * max_v_samp_factor pixel rows from each row group (but this could vary
+ * if the upsampler is applying a scale factor of its own).
+ *
+ * An excellent reference for image resampling is
+ * Digital Image Warping, George Wolberg, 1990.
+ * Pub. by IEEE Computer Society Press, Los Alamitos, CA. ISBN 0-8186-8944-7.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+
+
+/* Pointer to routine to upsample a single component */
+typedef JMETHOD(void, upsample1_ptr,
+ (j_decompress_ptr cinfo, jpeg_component_info * compptr,
+ JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr));
+
+/* Private subobject */
+
+typedef struct {
+ struct jpeg_upsampler pub; /* public fields */
+
+ /* Color conversion buffer. When using separate upsampling and color
+ * conversion steps, this buffer holds one upsampled row group until it
+ * has been color converted and output.
+ * Note: we do not allocate any storage for component(s) which are full-size,
+ * ie do not need rescaling. The corresponding entry of color_buf[] is
+ * simply set to point to the input data array, thereby avoiding copying.
+ */
+ JSAMPARRAY color_buf[MAX_COMPONENTS];
+
+ /* Per-component upsampling method pointers */
+ upsample1_ptr methods[MAX_COMPONENTS];
+
+ int next_row_out; /* counts rows emitted from color_buf */
+ JDIMENSION rows_to_go; /* counts rows remaining in image */
+
+ /* Height of an input row group for each component. */
+ int rowgroup_height[MAX_COMPONENTS];
+
+ /* These arrays save pixel expansion factors so that int_expand need not
+ * recompute them each time. They are unused for other upsampling methods.
+ */
+ UINT8 h_expand[MAX_COMPONENTS];
+ UINT8 v_expand[MAX_COMPONENTS];
+} my_upsampler;
+
+typedef my_upsampler * my_upsample_ptr;
+
+
+/*
+ * Initialize for an upsampling pass.
+ */
+
+METHODDEF(void)
+start_pass_upsample (j_decompress_ptr cinfo)
+{
+ my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
+
+ /* Mark the conversion buffer empty */
+ upsample->next_row_out = cinfo->max_v_samp_factor;
+ /* Initialize total-height counter for detecting bottom of image */
+ upsample->rows_to_go = cinfo->output_height;
+}
+
+
+/*
+ * Control routine to do upsampling (and color conversion).
+ *
+ * In this version we upsample each component independently.
+ * We upsample one row group into the conversion buffer, then apply
+ * color conversion a row at a time.
+ */
+
+METHODDEF(void)
+sep_upsample (j_decompress_ptr cinfo,
+ JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
+ JDIMENSION in_row_groups_avail,
+ JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
+ JDIMENSION out_rows_avail)
+{
+ my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
+ int ci;
+ jpeg_component_info * compptr;
+ JDIMENSION num_rows;
+
+ /* Fill the conversion buffer, if it's empty */
+ if (upsample->next_row_out >= cinfo->max_v_samp_factor) {
+ for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+ ci++, compptr++) {
+ /* Invoke per-component upsample method. Notice we pass a POINTER
+ * to color_buf[ci], so that fullsize_upsample can change it.
+ */
+ (*upsample->methods[ci]) (cinfo, compptr,
+ input_buf[ci] + (*in_row_group_ctr * upsample->rowgroup_height[ci]),
+ upsample->color_buf + ci);
+ }
+ upsample->next_row_out = 0;
+ }
+
+ /* Color-convert and emit rows */
+
+ /* How many we have in the buffer: */
+ num_rows = (JDIMENSION) (cinfo->max_v_samp_factor - upsample->next_row_out);
+ /* Not more than the distance to the end of the image. Need this test
+ * in case the image height is not a multiple of max_v_samp_factor:
+ */
+ if (num_rows > upsample->rows_to_go)
+ num_rows = upsample->rows_to_go;
+ /* And not more than what the client can accept: */
+ out_rows_avail -= *out_row_ctr;
+ if (num_rows > out_rows_avail)
+ num_rows = out_rows_avail;
+
+ (*cinfo->cconvert->color_convert) (cinfo, upsample->color_buf,
+ (JDIMENSION) upsample->next_row_out,
+ output_buf + *out_row_ctr,
+ (int) num_rows);
+
+ /* Adjust counts */
+ *out_row_ctr += num_rows;
+ upsample->rows_to_go -= num_rows;
+ upsample->next_row_out += num_rows;
+ /* When the buffer is emptied, declare this input row group consumed */
+ if (upsample->next_row_out >= cinfo->max_v_samp_factor)
+ (*in_row_group_ctr)++;
+}
+
+
+/*
+ * These are the routines invoked by sep_upsample to upsample pixel values
+ * of a single component. One row group is processed per call.
+ */
+
+
+/*
+ * For full-size components, we just make color_buf[ci] point at the
+ * input buffer, and thus avoid copying any data. Note that this is
+ * safe only because sep_upsample doesn't declare the input row group
+ * "consumed" until we are done color converting and emitting it.
+ */
+
+METHODDEF(void)
+fullsize_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
+ JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)
+{
+ *output_data_ptr = input_data;
+}
+
+
+/*
+ * This is a no-op version used for "uninteresting" components.
+ * These components will not be referenced by color conversion.
+ */
+
+METHODDEF(void)
+noop_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
+ JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)
+{
+ *output_data_ptr = NULL; /* safety check */
+}
+
+
+/*
+ * This version handles any integral sampling ratios.
+ * This is not used for typical JPEG files, so it need not be fast.
+ * Nor, for that matter, is it particularly accurate: the algorithm is
+ * simple replication of the input pixel onto the corresponding output
+ * pixels. The hi-falutin sampling literature refers to this as a
+ * "box filter". A box filter tends to introduce visible artifacts,
+ * so if you are actually going to use 3:1 or 4:1 sampling ratios
+ * you would be well advised to improve this code.
+ */
+
+METHODDEF(void)
+int_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
+ JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)
+{
+ my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
+ JSAMPARRAY output_data = *output_data_ptr;
+ register JSAMPROW inptr, outptr;
+ register JSAMPLE invalue;
+ register int h;
+ JSAMPROW outend;
+ int h_expand, v_expand;
+ int inrow, outrow;
+
+ h_expand = upsample->h_expand[compptr->component_index];
+ v_expand = upsample->v_expand[compptr->component_index];
+
+ inrow = outrow = 0;
+ while (outrow < cinfo->max_v_samp_factor) {
+ /* Generate one output row with proper horizontal expansion */
+ inptr = input_data[inrow];
+ outptr = output_data[outrow];
+ outend = outptr + cinfo->output_width;
+ while (outptr < outend) {
+ invalue = *inptr++; /* don't need GETJSAMPLE() here */
+ for (h = h_expand; h > 0; h--) {
+ *outptr++ = invalue;
+ }
+ }
+ /* Generate any additional output rows by duplicating the first one */
+ if (v_expand > 1) {
+ jcopy_sample_rows(output_data, outrow, output_data, outrow+1,
+ v_expand-1, cinfo->output_width);
+ }
+ inrow++;
+ outrow += v_expand;
+ }
+}
+
+
+/*
+ * Fast processing for the common case of 2:1 horizontal and 1:1 vertical.
+ * It's still a box filter.
+ */
+
+METHODDEF(void)
+h2v1_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
+ JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)
+{
+ JSAMPARRAY output_data = *output_data_ptr;
+ register JSAMPROW inptr, outptr;
+ register JSAMPLE invalue;
+ JSAMPROW outend;
+ int inrow;
+
+ for (inrow = 0; inrow < cinfo->max_v_samp_factor; inrow++) {
+ inptr = input_data[inrow];
+ outptr = output_data[inrow];
+ outend = outptr + cinfo->output_width;
+ while (outptr < outend) {
+ invalue = *inptr++; /* don't need GETJSAMPLE() here */
+ *outptr++ = invalue;
+ *outptr++ = invalue;
+ }
+ }
+}
+
+
+/*
+ * Fast processing for the common case of 2:1 horizontal and 2:1 vertical.
+ * It's still a box filter.
+ */
+
+METHODDEF(void)
+h2v2_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
+ JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)
+{
+ JSAMPARRAY output_data = *output_data_ptr;
+ register JSAMPROW inptr, outptr;
+ register JSAMPLE invalue;
+ JSAMPROW outend;
+ int inrow, outrow;
+
+ inrow = outrow = 0;
+ while (outrow < cinfo->max_v_samp_factor) {
+ inptr = input_data[inrow];
+ outptr = output_data[outrow];
+ outend = outptr + cinfo->output_width;
+ while (outptr < outend) {
+ invalue = *inptr++; /* don't need GETJSAMPLE() here */
+ *outptr++ = invalue;
+ *outptr++ = invalue;
+ }
+ jcopy_sample_rows(output_data, outrow, output_data, outrow+1,
+ 1, cinfo->output_width);
+ inrow++;
+ outrow += 2;
+ }
+}
+
+
+/*
+ * Fancy processing for the common case of 2:1 horizontal and 1:1 vertical.
+ *
+ * The upsampling algorithm is linear interpolation between pixel centers,
+ * also known as a "triangle filter". This is a good compromise between
+ * speed and visual quality. The centers of the output pixels are 1/4 and 3/4
+ * of the way between input pixel centers.
+ *
+ * A note about the "bias" calculations: when rounding fractional values to
+ * integer, we do not want to always round 0.5 up to the next integer.
+ * If we did that, we'd introduce a noticeable bias towards larger values.
+ * Instead, this code is arranged so that 0.5 will be rounded up or down at
+ * alternate pixel locations (a simple ordered dither pattern).
+ */
+
+METHODDEF(void)
+h2v1_fancy_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
+ JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)
+{
+ JSAMPARRAY output_data = *output_data_ptr;
+ register JSAMPROW inptr, outptr;
+ register int invalue;
+ register JDIMENSION colctr;
+ int inrow;
+
+ for (inrow = 0; inrow < cinfo->max_v_samp_factor; inrow++) {
+ inptr = input_data[inrow];
+ outptr = output_data[inrow];
+ /* Special case for first column */
+ invalue = GETJSAMPLE(*inptr++);
+ *outptr++ = (JSAMPLE) invalue;
+ *outptr++ = (JSAMPLE) ((invalue * 3 + GETJSAMPLE(*inptr) + 2) >> 2);
+
+ for (colctr = compptr->downsampled_width - 2; colctr > 0; colctr--) {
+ /* General case: 3/4 * nearer pixel + 1/4 * further pixel */
+ invalue = GETJSAMPLE(*inptr++) * 3;
+ *outptr++ = (JSAMPLE) ((invalue + GETJSAMPLE(inptr[-2]) + 1) >> 2);
+ *outptr++ = (JSAMPLE) ((invalue + GETJSAMPLE(*inptr) + 2) >> 2);
+ }
+
+ /* Special case for last column */
+ invalue = GETJSAMPLE(*inptr);
+ *outptr++ = (JSAMPLE) ((invalue * 3 + GETJSAMPLE(inptr[-1]) + 1) >> 2);
+ *outptr++ = (JSAMPLE) invalue;
+ }
+}
+
+
+/*
+ * Fancy processing for the common case of 2:1 horizontal and 2:1 vertical.
+ * Again a triangle filter; see comments for h2v1 case, above.
+ *
+ * It is OK for us to reference the adjacent input rows because we demanded
+ * context from the main buffer controller (see initialization code).
+ */
+
+METHODDEF(void)
+h2v2_fancy_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
+ JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)
+{
+ JSAMPARRAY output_data = *output_data_ptr;
+ register JSAMPROW inptr0, inptr1, outptr;
+#if BITS_IN_JSAMPLE == 8
+ register int thiscolsum, lastcolsum, nextcolsum;
+#else
+ register INT32 thiscolsum, lastcolsum, nextcolsum;
+#endif
+ register JDIMENSION colctr;
+ int inrow, outrow, v;
+
+ inrow = outrow = 0;
+ while (outrow < cinfo->max_v_samp_factor) {
+ for (v = 0; v < 2; v++) {
+ /* inptr0 points to nearest input row, inptr1 points to next nearest */
+ inptr0 = input_data[inrow];
+ if (v == 0) /* next nearest is row above */
+ inptr1 = input_data[inrow-1];
+ else /* next nearest is row below */
+ inptr1 = input_data[inrow+1];
+ outptr = output_data[outrow++];
+
+ /* Special case for first column */
+ thiscolsum = GETJSAMPLE(*inptr0++) * 3 + GETJSAMPLE(*inptr1++);
+ nextcolsum = GETJSAMPLE(*inptr0++) * 3 + GETJSAMPLE(*inptr1++);
+ *outptr++ = (JSAMPLE) ((thiscolsum * 4 + 8) >> 4);
+ *outptr++ = (JSAMPLE) ((thiscolsum * 3 + nextcolsum + 7) >> 4);
+ lastcolsum = thiscolsum; thiscolsum = nextcolsum;
+
+ for (colctr = compptr->downsampled_width - 2; colctr > 0; colctr--) {
+ /* General case: 3/4 * nearer pixel + 1/4 * further pixel in each */
+ /* dimension, thus 9/16, 3/16, 3/16, 1/16 overall */
+ nextcolsum = GETJSAMPLE(*inptr0++) * 3 + GETJSAMPLE(*inptr1++);
+ *outptr++ = (JSAMPLE) ((thiscolsum * 3 + lastcolsum + 8) >> 4);
+ *outptr++ = (JSAMPLE) ((thiscolsum * 3 + nextcolsum + 7) >> 4);
+ lastcolsum = thiscolsum; thiscolsum = nextcolsum;
+ }
+
+ /* Special case for last column */
+ *outptr++ = (JSAMPLE) ((thiscolsum * 3 + lastcolsum + 8) >> 4);
+ *outptr++ = (JSAMPLE) ((thiscolsum * 4 + 7) >> 4);
+ }
+ inrow++;
+ }
+}
+
+
+/*
+ * Module initialization routine for upsampling.
+ */
+
+GLOBAL(void)
+jinit_upsampler (j_decompress_ptr cinfo)
+{
+ my_upsample_ptr upsample;
+ int ci;
+ jpeg_component_info * compptr;
+ boolean need_buffer, do_fancy;
+ int h_in_group, v_in_group, h_out_group, v_out_group;
+
+ upsample = (my_upsample_ptr)
+ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ SIZEOF(my_upsampler));
+ cinfo->upsample = (struct jpeg_upsampler *) upsample;
+ upsample->pub.start_pass = start_pass_upsample;
+ upsample->pub.upsample = sep_upsample;
+ upsample->pub.need_context_rows = FALSE; /* until we find out differently */
+
+ if (cinfo->CCIR601_sampling) /* this isn't supported */
+ ERREXIT(cinfo, JERR_CCIR601_NOTIMPL);
+
+ /* jdmainct.c doesn't support context rows when min_DCT_scaled_size = 1,
+ * so don't ask for it.
+ */
+ do_fancy = cinfo->do_fancy_upsampling && cinfo->min_DCT_scaled_size > 1;
+
+ /* Verify we can handle the sampling factors, select per-component methods,
+ * and create storage as needed.
+ */
+ for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+ ci++, compptr++) {
+ /* Compute size of an "input group" after IDCT scaling. This many samples
+ * are to be converted to max_h_samp_factor * max_v_samp_factor pixels.
+ */
+ h_in_group = (compptr->h_samp_factor * compptr->DCT_scaled_size) /
+ cinfo->min_DCT_scaled_size;
+ v_in_group = (compptr->v_samp_factor * compptr->DCT_scaled_size) /
+ cinfo->min_DCT_scaled_size;
+ h_out_group = cinfo->max_h_samp_factor;
+ v_out_group = cinfo->max_v_samp_factor;
+ upsample->rowgroup_height[ci] = v_in_group; /* save for use later */
+ need_buffer = TRUE;
+ if (! compptr->component_needed) {
+ /* Don't bother to upsample an uninteresting component. */
+ upsample->methods[ci] = noop_upsample;
+ need_buffer = FALSE;
+ } else if (h_in_group == h_out_group && v_in_group == v_out_group) {
+ /* Fullsize components can be processed without any work. */
+ upsample->methods[ci] = fullsize_upsample;
+ need_buffer = FALSE;
+ } else if (h_in_group * 2 == h_out_group &&
+ v_in_group == v_out_group) {
+ /* Special cases for 2h1v upsampling */
+ if (do_fancy && compptr->downsampled_width > 2)
+ upsample->methods[ci] = h2v1_fancy_upsample;
+ else
+ upsample->methods[ci] = h2v1_upsample;
+ } else if (h_in_group * 2 == h_out_group &&
+ v_in_group * 2 == v_out_group) {
+ /* Special cases for 2h2v upsampling */
+ if (do_fancy && compptr->downsampled_width > 2) {
+ upsample->methods[ci] = h2v2_fancy_upsample;
+ upsample->pub.need_context_rows = TRUE;
+ } else
+ upsample->methods[ci] = h2v2_upsample;
+ } else if ((h_out_group % h_in_group) == 0 &&
+ (v_out_group % v_in_group) == 0) {
+ /* Generic integral-factors upsampling method */
+ upsample->methods[ci] = int_upsample;
+ upsample->h_expand[ci] = (UINT8) (h_out_group / h_in_group);
+ upsample->v_expand[ci] = (UINT8) (v_out_group / v_in_group);
+ } else
+ ERREXIT(cinfo, JERR_FRACT_SAMPLE_NOTIMPL);
+ if (need_buffer) {
+ upsample->color_buf[ci] = (*cinfo->mem->alloc_sarray)
+ ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ (JDIMENSION) jround_up((long) cinfo->output_width,
+ (long) cinfo->max_h_samp_factor),
+ (JDIMENSION) cinfo->max_v_samp_factor);
+ }
+ }
+}
+
+#endif //_FX_JPEG_TURBO_
diff --git a/core/src/fxcodec/libjpeg/fpdfapi_jdtrans.c b/core/src/fxcodec/libjpeg/fpdfapi_jdtrans.c
index c076a6c2bd..ae44f36043 100644
--- a/core/src/fxcodec/libjpeg/fpdfapi_jdtrans.c
+++ b/core/src/fxcodec/libjpeg/fpdfapi_jdtrans.c
@@ -1,146 +1,146 @@
-#if !defined(_FX_JPEG_TURBO_)
-/*
- * jdtrans.c
- *
- * Copyright (C) 1995-1997, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- * For conditions of distribution and use, see the accompanying README file.
- *
- * This file contains library routines for transcoding decompression,
- * that is, reading raw DCT coefficient arrays from an input JPEG file.
- * The routines in jdapimin.c will also be needed by a transcoder.
- */
-
-#define JPEG_INTERNALS
-#include "jinclude.h"
-#include "jpeglib.h"
-
-
-/* Forward declarations */
-LOCAL(void) transdecode_master_selection JPP((j_decompress_ptr cinfo));
-
-
-/*
- * Read the coefficient arrays from a JPEG file.
- * jpeg_read_header must be completed before calling this.
- *
- * The entire image is read into a set of virtual coefficient-block arrays,
- * one per component. The return value is a pointer to the array of
- * virtual-array descriptors. These can be manipulated directly via the
- * JPEG memory manager, or handed off to jpeg_write_coefficients().
- * To release the memory occupied by the virtual arrays, call
- * jpeg_finish_decompress() when done with the data.
- *
- * An alternative usage is to simply obtain access to the coefficient arrays
- * during a buffered-image-mode decompression operation. This is allowed
- * after any jpeg_finish_output() call. The arrays can be accessed until
- * jpeg_finish_decompress() is called. (Note that any call to the library
- * may reposition the arrays, so don't rely on access_virt_barray() results
- * to stay valid across library calls.)
- *
- * Returns NULL if suspended. This case need be checked only if
- * a suspending data source is used.
- */
-
-GLOBAL(jvirt_barray_ptr *)
-jpeg_read_coefficients (j_decompress_ptr cinfo)
-{
- if (cinfo->global_state == DSTATE_READY) {
- /* First call: initialize active modules */
- transdecode_master_selection(cinfo);
- cinfo->global_state = DSTATE_RDCOEFS;
- }
- if (cinfo->global_state == DSTATE_RDCOEFS) {
- /* Absorb whole file into the coef buffer */
- for (;;) {
- int retcode;
- /* Call progress monitor hook if present */
- if (cinfo->progress != NULL)
- (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
- /* Absorb some more input */
- retcode = (*cinfo->inputctl->consume_input) (cinfo);
- if (retcode == JPEG_SUSPENDED)
- return NULL;
- if (retcode == JPEG_REACHED_EOI)
- break;
- /* Advance progress counter if appropriate */
- if (cinfo->progress != NULL &&
- (retcode == JPEG_ROW_COMPLETED || retcode == JPEG_REACHED_SOS)) {
- if (++cinfo->progress->pass_counter >= cinfo->progress->pass_limit) {
- /* startup underestimated number of scans; ratchet up one scan */
- cinfo->progress->pass_limit += (long) cinfo->total_iMCU_rows;
- }
- }
- }
- /* Set state so that jpeg_finish_decompress does the right thing */
- cinfo->global_state = DSTATE_STOPPING;
- }
- /* At this point we should be in state DSTATE_STOPPING if being used
- * standalone, or in state DSTATE_BUFIMAGE if being invoked to get access
- * to the coefficients during a full buffered-image-mode decompression.
- */
- if ((cinfo->global_state == DSTATE_STOPPING ||
- cinfo->global_state == DSTATE_BUFIMAGE) && cinfo->buffered_image) {
- return cinfo->coef->coef_arrays;
- }
- /* Oops, improper usage */
- ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
- return NULL; /* keep compiler happy */
-}
-
-
-/*
- * Master selection of decompression modules for transcoding.
- * This substitutes for jdmaster.c's initialization of the full decompressor.
- */
-
-LOCAL(void)
-transdecode_master_selection (j_decompress_ptr cinfo)
-{
- /* This is effectively a buffered-image operation. */
- cinfo->buffered_image = TRUE;
-
- /* Entropy decoding: either Huffman or arithmetic coding. */
- if (cinfo->arith_code) {
- ERREXIT(cinfo, JERR_ARITH_NOTIMPL);
- } else {
- if (cinfo->progressive_mode) {
-#ifdef D_PROGRESSIVE_SUPPORTED
- jinit_phuff_decoder(cinfo);
-#else
- ERREXIT(cinfo, JERR_NOT_COMPILED);
-#endif
- } else
- jinit_huff_decoder(cinfo);
- }
-
- /* Always get a full-image coefficient buffer. */
- jinit_d_coef_controller(cinfo, TRUE);
-
- /* We can now tell the memory manager to allocate virtual arrays. */
- (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo);
-
- /* Initialize input side of decompressor to consume first scan. */
- (*cinfo->inputctl->start_input_pass) (cinfo);
-
- /* Initialize progress monitoring. */
- if (cinfo->progress != NULL) {
- int nscans;
- /* Estimate number of scans to set pass_limit. */
- if (cinfo->progressive_mode) {
- /* Arbitrarily estimate 2 interleaved DC scans + 3 AC scans/component. */
- nscans = 2 + 3 * cinfo->num_components;
- } else if (cinfo->inputctl->has_multiple_scans) {
- /* For a nonprogressive multiscan file, estimate 1 scan per component. */
- nscans = cinfo->num_components;
- } else {
- nscans = 1;
- }
- cinfo->progress->pass_counter = 0L;
- cinfo->progress->pass_limit = (long) cinfo->total_iMCU_rows * nscans;
- cinfo->progress->completed_passes = 0;
- cinfo->progress->total_passes = 1;
- }
-}
-
-#endif //_FX_JPEG_TURBO_
+#if !defined(_FX_JPEG_TURBO_)
+/*
+ * jdtrans.c
+ *
+ * Copyright (C) 1995-1997, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains library routines for transcoding decompression,
+ * that is, reading raw DCT coefficient arrays from an input JPEG file.
+ * The routines in jdapimin.c will also be needed by a transcoder.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+
+
+/* Forward declarations */
+LOCAL(void) transdecode_master_selection JPP((j_decompress_ptr cinfo));
+
+
+/*
+ * Read the coefficient arrays from a JPEG file.
+ * jpeg_read_header must be completed before calling this.
+ *
+ * The entire image is read into a set of virtual coefficient-block arrays,
+ * one per component. The return value is a pointer to the array of
+ * virtual-array descriptors. These can be manipulated directly via the
+ * JPEG memory manager, or handed off to jpeg_write_coefficients().
+ * To release the memory occupied by the virtual arrays, call
+ * jpeg_finish_decompress() when done with the data.
+ *
+ * An alternative usage is to simply obtain access to the coefficient arrays
+ * during a buffered-image-mode decompression operation. This is allowed
+ * after any jpeg_finish_output() call. The arrays can be accessed until
+ * jpeg_finish_decompress() is called. (Note that any call to the library
+ * may reposition the arrays, so don't rely on access_virt_barray() results
+ * to stay valid across library calls.)
+ *
+ * Returns NULL if suspended. This case need be checked only if
+ * a suspending data source is used.
+ */
+
+GLOBAL(jvirt_barray_ptr *)
+jpeg_read_coefficients (j_decompress_ptr cinfo)
+{
+ if (cinfo->global_state == DSTATE_READY) {
+ /* First call: initialize active modules */
+ transdecode_master_selection(cinfo);
+ cinfo->global_state = DSTATE_RDCOEFS;
+ }
+ if (cinfo->global_state == DSTATE_RDCOEFS) {
+ /* Absorb whole file into the coef buffer */
+ for (;;) {
+ int retcode;
+ /* Call progress monitor hook if present */
+ if (cinfo->progress != NULL)
+ (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
+ /* Absorb some more input */
+ retcode = (*cinfo->inputctl->consume_input) (cinfo);
+ if (retcode == JPEG_SUSPENDED)
+ return NULL;
+ if (retcode == JPEG_REACHED_EOI)
+ break;
+ /* Advance progress counter if appropriate */
+ if (cinfo->progress != NULL &&
+ (retcode == JPEG_ROW_COMPLETED || retcode == JPEG_REACHED_SOS)) {
+ if (++cinfo->progress->pass_counter >= cinfo->progress->pass_limit) {
+ /* startup underestimated number of scans; ratchet up one scan */
+ cinfo->progress->pass_limit += (long) cinfo->total_iMCU_rows;
+ }
+ }
+ }
+ /* Set state so that jpeg_finish_decompress does the right thing */
+ cinfo->global_state = DSTATE_STOPPING;
+ }
+ /* At this point we should be in state DSTATE_STOPPING if being used
+ * standalone, or in state DSTATE_BUFIMAGE if being invoked to get access
+ * to the coefficients during a full buffered-image-mode decompression.
+ */
+ if ((cinfo->global_state == DSTATE_STOPPING ||
+ cinfo->global_state == DSTATE_BUFIMAGE) && cinfo->buffered_image) {
+ return cinfo->coef->coef_arrays;
+ }
+ /* Oops, improper usage */
+ ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
+ return NULL; /* keep compiler happy */
+}
+
+
+/*
+ * Master selection of decompression modules for transcoding.
+ * This substitutes for jdmaster.c's initialization of the full decompressor.
+ */
+
+LOCAL(void)
+transdecode_master_selection (j_decompress_ptr cinfo)
+{
+ /* This is effectively a buffered-image operation. */
+ cinfo->buffered_image = TRUE;
+
+ /* Entropy decoding: either Huffman or arithmetic coding. */
+ if (cinfo->arith_code) {
+ ERREXIT(cinfo, JERR_ARITH_NOTIMPL);
+ } else {
+ if (cinfo->progressive_mode) {
+#ifdef D_PROGRESSIVE_SUPPORTED
+ jinit_phuff_decoder(cinfo);
+#else
+ ERREXIT(cinfo, JERR_NOT_COMPILED);
+#endif
+ } else
+ jinit_huff_decoder(cinfo);
+ }
+
+ /* Always get a full-image coefficient buffer. */
+ jinit_d_coef_controller(cinfo, TRUE);
+
+ /* We can now tell the memory manager to allocate virtual arrays. */
+ (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo);
+
+ /* Initialize input side of decompressor to consume first scan. */
+ (*cinfo->inputctl->start_input_pass) (cinfo);
+
+ /* Initialize progress monitoring. */
+ if (cinfo->progress != NULL) {
+ int nscans;
+ /* Estimate number of scans to set pass_limit. */
+ if (cinfo->progressive_mode) {
+ /* Arbitrarily estimate 2 interleaved DC scans + 3 AC scans/component. */
+ nscans = 2 + 3 * cinfo->num_components;
+ } else if (cinfo->inputctl->has_multiple_scans) {
+ /* For a nonprogressive multiscan file, estimate 1 scan per component. */
+ nscans = cinfo->num_components;
+ } else {
+ nscans = 1;
+ }
+ cinfo->progress->pass_counter = 0L;
+ cinfo->progress->pass_limit = (long) cinfo->total_iMCU_rows * nscans;
+ cinfo->progress->completed_passes = 0;
+ cinfo->progress->total_passes = 1;
+ }
+}
+
+#endif //_FX_JPEG_TURBO_
diff --git a/core/src/fxcodec/libjpeg/fpdfapi_jerror.c b/core/src/fxcodec/libjpeg/fpdfapi_jerror.c
index 9d673ba845..42e4066757 100644
--- a/core/src/fxcodec/libjpeg/fpdfapi_jerror.c
+++ b/core/src/fxcodec/libjpeg/fpdfapi_jerror.c
@@ -1,255 +1,255 @@
-#if !defined(_FX_JPEG_TURBO_)
-/*
- * jerror.c
- *
- * Copyright (C) 1991-1998, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- * For conditions of distribution and use, see the accompanying README file.
- *
- * This file contains simple error-reporting and trace-message routines.
- * These are suitable for Unix-like systems and others where writing to
- * stderr is the right thing to do. Many applications will want to replace
- * some or all of these routines.
- *
- * If you define USE_WINDOWS_MESSAGEBOX in jconfig.h or in the makefile,
- * you get a Windows-specific hack to display error messages in a dialog box.
- * It ain't much, but it beats dropping error messages into the bit bucket,
- * which is what happens to output to stderr under most Windows C compilers.
- *
- * These routines are used by both the compression and decompression code.
- */
-
-/* this is not a core library module, so it doesn't define JPEG_INTERNALS */
-#include "jinclude.h"
-#include "jpeglib.h"
-#include "jversion.h"
-#include "jerror.h"
-
-#ifndef EXIT_FAILURE /* define exit() codes if not provided */
-#define EXIT_FAILURE 1
-#endif
-
-
-/*
- * Create the message string table.
- * We do this from the master message list in jerror.h by re-reading
- * jerror.h with a suitable definition for macro JMESSAGE.
- * The message table is made an external symbol just in case any applications
- * want to refer to it directly.
- */
-
-#ifdef NEED_SHORT_EXTERNAL_NAMES
-#define jpeg_std_message_table jMsgTable
-#endif
-
-#define JMESSAGE(code,string) string ,
-
-const char * const jpeg_std_message_table[] = {
-#include "jerror.h"
- NULL
-};
-
-
-/*
- * Error exit handler: must not return to caller.
- *
- * Applications may override this if they want to get control back after
- * an error. Typically one would longjmp somewhere instead of exiting.
- * The setjmp buffer can be made a private field within an expanded error
- * handler object. Note that the info needed to generate an error message
- * is stored in the error object, so you can generate the message now or
- * later, at your convenience.
- * You should make sure that the JPEG object is cleaned up (with jpeg_abort
- * or jpeg_destroy) at some point.
- */
-
-METHODDEF(void)
-error_exit (j_common_ptr cinfo)
-{
- /* Always display the message */
- (*cinfo->err->output_message) (cinfo);
-
- /* Let the memory manager delete any temp files before we die */
- jpeg_destroy(cinfo);
-
-// exit(EXIT_FAILURE);
-}
-
-
-/*
- * Actual output of an error or trace message.
- * Applications may override this method to send JPEG messages somewhere
- * other than stderr.
- *
- * On Windows, printing to stderr is generally completely useless,
- * so we provide optional code to produce an error-dialog popup.
- * Most Windows applications will still prefer to override this routine,
- * but if they don't, it'll do something at least marginally useful.
- *
- * NOTE: to use the library in an environment that doesn't support the
- * C stdio library, you may have to delete the call to fprintf() entirely,
- * not just not use this routine.
- */
-
-METHODDEF(void)
-output_message (j_common_ptr cinfo)
-{
- char buffer[JMSG_LENGTH_MAX];
-
- /* Create the message */
- (*cinfo->err->format_message) (cinfo, buffer);
-
-#ifdef USE_WINDOWS_MESSAGEBOX
- /* Display it in a message dialog box */
- MessageBox(GetActiveWindow(), buffer, "JPEG Library Error",
- MB_OK | MB_ICONERROR);
-#else
- /* Send it to stderr, adding a newline */
-#ifndef _FPDFAPI_MINI_
- FXSYS_fprintf(stderr, "%s\n", buffer);
-#endif
-#endif
-}
-
-
-/*
- * Decide whether to emit a trace or warning message.
- * msg_level is one of:
- * -1: recoverable corrupt-data warning, may want to abort.
- * 0: important advisory messages (always display to user).
- * 1: first level of tracing detail.
- * 2,3,...: successively more detailed tracing messages.
- * An application might override this method if it wanted to abort on warnings
- * or change the policy about which messages to display.
- */
-
-METHODDEF(void)
-emit_message (j_common_ptr cinfo, int msg_level)
-{
- struct jpeg_error_mgr * err = cinfo->err;
-
- if (msg_level < 0) {
- /* It's a warning message. Since corrupt files may generate many warnings,
- * the policy implemented here is to show only the first warning,
- * unless trace_level >= 3.
- */
- if (err->num_warnings == 0 || err->trace_level >= 3)
- (*err->output_message) (cinfo);
- /* Always count warnings in num_warnings. */
- err->num_warnings++;
- } else {
- /* It's a trace message. Show it if trace_level >= msg_level. */
- if (err->trace_level >= msg_level)
- (*err->output_message) (cinfo);
- }
-}
-
-
-/*
- * Format a message string for the most recent JPEG error or message.
- * The message is stored into buffer, which should be at least JMSG_LENGTH_MAX
- * characters. Note that no '\n' character is added to the string.
- * Few applications should need to override this method.
- */
-
-METHODDEF(void)
-format_message (j_common_ptr cinfo, char * buffer)
-{
-#if 0 /* XYQ */
- struct jpeg_error_mgr * err = cinfo->err;
- int msg_code = err->msg_code;
- const char * msgtext = NULL;
- const char * msgptr;
- char ch;
- boolean isstring;
-
- /* Look up message string in proper table */
- if (msg_code > 0 && msg_code <= err->last_jpeg_message) {
- msgtext = err->jpeg_message_table[msg_code];
- } else if (err->addon_message_table != NULL &&
- msg_code >= err->first_addon_message &&
- msg_code <= err->last_addon_message) {
- msgtext = err->addon_message_table[msg_code - err->first_addon_message];
- }
-
- /* Defend against bogus message number */
- if (msgtext == NULL) {
- err->msg_parm.i[0] = msg_code;
- msgtext = err->jpeg_message_table[0];
- }
-
- /* Check for string parameter, as indicated by %s in the message text */
- isstring = FALSE;
- msgptr = msgtext;
- while ((ch = *msgptr++) != '\0') {
- if (ch == '%') {
- if (*msgptr == 's') isstring = TRUE;
- break;
- }
- }
-
- /* Format the message into the passed buffer */
- if (isstring)
- FXSYS_sprintf(buffer, msgtext, err->msg_parm.s);
- else
- FXSYS_sprintf(buffer, msgtext,
- err->msg_parm.i[0], err->msg_parm.i[1],
- err->msg_parm.i[2], err->msg_parm.i[3],
- err->msg_parm.i[4], err->msg_parm.i[5],
- err->msg_parm.i[6], err->msg_parm.i[7]);
-#endif
-}
-
-
-/*
- * Reset error state variables at start of a new image.
- * This is called during compression startup to reset trace/error
- * processing to default state, without losing any application-specific
- * method pointers. An application might possibly want to override
- * this method if it has additional error processing state.
- */
-
-METHODDEF(void)
-reset_error_mgr (j_common_ptr cinfo)
-{
- cinfo->err->num_warnings = 0;
- /* trace_level is not reset since it is an application-supplied parameter */
- cinfo->err->msg_code = 0; /* may be useful as a flag for "no error" */
-}
-
-
-/*
- * Fill in the standard error-handling methods in a jpeg_error_mgr object.
- * Typical call is:
- * struct jpeg_compress_struct cinfo;
- * struct jpeg_error_mgr err;
- *
- * cinfo.err = jpeg_std_error(&err);
- * after which the application may override some of the methods.
- */
-
-GLOBAL(struct jpeg_error_mgr *)
-jpeg_std_error (struct jpeg_error_mgr * err)
-{
- err->error_exit = error_exit;
- err->emit_message = emit_message;
- err->output_message = output_message;
- err->format_message = format_message;
- err->reset_error_mgr = reset_error_mgr;
-
- err->trace_level = 0; /* default = no tracing */
- err->num_warnings = 0; /* no warnings emitted yet */
- err->msg_code = 0; /* may be useful as a flag for "no error" */
-
- /* Initialize message table pointers */
- err->jpeg_message_table = jpeg_std_message_table;
- err->last_jpeg_message = (int) JMSG_LASTMSGCODE - 1;
-
- err->addon_message_table = NULL;
- err->first_addon_message = 0; /* for safety */
- err->last_addon_message = 0;
-
- return err;
-}
-
-#endif //_FX_JPEG_TURBO_
+#if !defined(_FX_JPEG_TURBO_)
+/*
+ * jerror.c
+ *
+ * Copyright (C) 1991-1998, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains simple error-reporting and trace-message routines.
+ * These are suitable for Unix-like systems and others where writing to
+ * stderr is the right thing to do. Many applications will want to replace
+ * some or all of these routines.
+ *
+ * If you define USE_WINDOWS_MESSAGEBOX in jconfig.h or in the makefile,
+ * you get a Windows-specific hack to display error messages in a dialog box.
+ * It ain't much, but it beats dropping error messages into the bit bucket,
+ * which is what happens to output to stderr under most Windows C compilers.
+ *
+ * These routines are used by both the compression and decompression code.
+ */
+
+/* this is not a core library module, so it doesn't define JPEG_INTERNALS */
+#include "jinclude.h"
+#include "jpeglib.h"
+#include "jversion.h"
+#include "jerror.h"
+
+#ifndef EXIT_FAILURE /* define exit() codes if not provided */
+#define EXIT_FAILURE 1
+#endif
+
+
+/*
+ * Create the message string table.
+ * We do this from the master message list in jerror.h by re-reading
+ * jerror.h with a suitable definition for macro JMESSAGE.
+ * The message table is made an external symbol just in case any applications
+ * want to refer to it directly.
+ */
+
+#ifdef NEED_SHORT_EXTERNAL_NAMES
+#define jpeg_std_message_table jMsgTable
+#endif
+
+#define JMESSAGE(code,string) string ,
+
+const char * const jpeg_std_message_table[] = {
+#include "jerror.h"
+ NULL
+};
+
+
+/*
+ * Error exit handler: must not return to caller.
+ *
+ * Applications may override this if they want to get control back after
+ * an error. Typically one would longjmp somewhere instead of exiting.
+ * The setjmp buffer can be made a private field within an expanded error
+ * handler object. Note that the info needed to generate an error message
+ * is stored in the error object, so you can generate the message now or
+ * later, at your convenience.
+ * You should make sure that the JPEG object is cleaned up (with jpeg_abort
+ * or jpeg_destroy) at some point.
+ */
+
+METHODDEF(void)
+error_exit (j_common_ptr cinfo)
+{
+ /* Always display the message */
+ (*cinfo->err->output_message) (cinfo);
+
+ /* Let the memory manager delete any temp files before we die */
+ jpeg_destroy(cinfo);
+
+// exit(EXIT_FAILURE);
+}
+
+
+/*
+ * Actual output of an error or trace message.
+ * Applications may override this method to send JPEG messages somewhere
+ * other than stderr.
+ *
+ * On Windows, printing to stderr is generally completely useless,
+ * so we provide optional code to produce an error-dialog popup.
+ * Most Windows applications will still prefer to override this routine,
+ * but if they don't, it'll do something at least marginally useful.
+ *
+ * NOTE: to use the library in an environment that doesn't support the
+ * C stdio library, you may have to delete the call to fprintf() entirely,
+ * not just not use this routine.
+ */
+
+METHODDEF(void)
+output_message (j_common_ptr cinfo)
+{
+ char buffer[JMSG_LENGTH_MAX];
+
+ /* Create the message */
+ (*cinfo->err->format_message) (cinfo, buffer);
+
+#ifdef USE_WINDOWS_MESSAGEBOX
+ /* Display it in a message dialog box */
+ MessageBox(GetActiveWindow(), buffer, "JPEG Library Error",
+ MB_OK | MB_ICONERROR);
+#else
+ /* Send it to stderr, adding a newline */
+#ifndef _FPDFAPI_MINI_
+ FXSYS_fprintf(stderr, "%s\n", buffer);
+#endif
+#endif
+}
+
+
+/*
+ * Decide whether to emit a trace or warning message.
+ * msg_level is one of:
+ * -1: recoverable corrupt-data warning, may want to abort.
+ * 0: important advisory messages (always display to user).
+ * 1: first level of tracing detail.
+ * 2,3,...: successively more detailed tracing messages.
+ * An application might override this method if it wanted to abort on warnings
+ * or change the policy about which messages to display.
+ */
+
+METHODDEF(void)
+emit_message (j_common_ptr cinfo, int msg_level)
+{
+ struct jpeg_error_mgr * err = cinfo->err;
+
+ if (msg_level < 0) {
+ /* It's a warning message. Since corrupt files may generate many warnings,
+ * the policy implemented here is to show only the first warning,
+ * unless trace_level >= 3.
+ */
+ if (err->num_warnings == 0 || err->trace_level >= 3)
+ (*err->output_message) (cinfo);
+ /* Always count warnings in num_warnings. */
+ err->num_warnings++;
+ } else {
+ /* It's a trace message. Show it if trace_level >= msg_level. */
+ if (err->trace_level >= msg_level)
+ (*err->output_message) (cinfo);
+ }
+}
+
+
+/*
+ * Format a message string for the most recent JPEG error or message.
+ * The message is stored into buffer, which should be at least JMSG_LENGTH_MAX
+ * characters. Note that no '\n' character is added to the string.
+ * Few applications should need to override this method.
+ */
+
+METHODDEF(void)
+format_message (j_common_ptr cinfo, char * buffer)
+{
+#if 0 /* XYQ */
+ struct jpeg_error_mgr * err = cinfo->err;
+ int msg_code = err->msg_code;
+ const char * msgtext = NULL;
+ const char * msgptr;
+ char ch;
+ boolean isstring;
+
+ /* Look up message string in proper table */
+ if (msg_code > 0 && msg_code <= err->last_jpeg_message) {
+ msgtext = err->jpeg_message_table[msg_code];
+ } else if (err->addon_message_table != NULL &&
+ msg_code >= err->first_addon_message &&
+ msg_code <= err->last_addon_message) {
+ msgtext = err->addon_message_table[msg_code - err->first_addon_message];
+ }
+
+ /* Defend against bogus message number */
+ if (msgtext == NULL) {
+ err->msg_parm.i[0] = msg_code;
+ msgtext = err->jpeg_message_table[0];
+ }
+
+ /* Check for string parameter, as indicated by %s in the message text */
+ isstring = FALSE;
+ msgptr = msgtext;
+ while ((ch = *msgptr++) != '\0') {
+ if (ch == '%') {
+ if (*msgptr == 's') isstring = TRUE;
+ break;
+ }
+ }
+
+ /* Format the message into the passed buffer */
+ if (isstring)
+ FXSYS_sprintf(buffer, msgtext, err->msg_parm.s);
+ else
+ FXSYS_sprintf(buffer, msgtext,
+ err->msg_parm.i[0], err->msg_parm.i[1],
+ err->msg_parm.i[2], err->msg_parm.i[3],
+ err->msg_parm.i[4], err->msg_parm.i[5],
+ err->msg_parm.i[6], err->msg_parm.i[7]);
+#endif
+}
+
+
+/*
+ * Reset error state variables at start of a new image.
+ * This is called during compression startup to reset trace/error
+ * processing to default state, without losing any application-specific
+ * method pointers. An application might possibly want to override
+ * this method if it has additional error processing state.
+ */
+
+METHODDEF(void)
+reset_error_mgr (j_common_ptr cinfo)
+{
+ cinfo->err->num_warnings = 0;
+ /* trace_level is not reset since it is an application-supplied parameter */
+ cinfo->err->msg_code = 0; /* may be useful as a flag for "no error" */
+}
+
+
+/*
+ * Fill in the standard error-handling methods in a jpeg_error_mgr object.
+ * Typical call is:
+ * struct jpeg_compress_struct cinfo;
+ * struct jpeg_error_mgr err;
+ *
+ * cinfo.err = jpeg_std_error(&err);
+ * after which the application may override some of the methods.
+ */
+
+GLOBAL(struct jpeg_error_mgr *)
+jpeg_std_error (struct jpeg_error_mgr * err)
+{
+ err->error_exit = error_exit;
+ err->emit_message = emit_message;
+ err->output_message = output_message;
+ err->format_message = format_message;
+ err->reset_error_mgr = reset_error_mgr;
+
+ err->trace_level = 0; /* default = no tracing */
+ err->num_warnings = 0; /* no warnings emitted yet */
+ err->msg_code = 0; /* may be useful as a flag for "no error" */
+
+ /* Initialize message table pointers */
+ err->jpeg_message_table = jpeg_std_message_table;
+ err->last_jpeg_message = (int) JMSG_LASTMSGCODE - 1;
+
+ err->addon_message_table = NULL;
+ err->first_addon_message = 0; /* for safety */
+ err->last_addon_message = 0;
+
+ return err;
+}
+
+#endif //_FX_JPEG_TURBO_
diff --git a/core/src/fxcodec/libjpeg/fpdfapi_jfdctfst.c b/core/src/fxcodec/libjpeg/fpdfapi_jfdctfst.c
index 9cd3dd798e..b978b468d7 100644
--- a/core/src/fxcodec/libjpeg/fpdfapi_jfdctfst.c
+++ b/core/src/fxcodec/libjpeg/fpdfapi_jfdctfst.c
@@ -1,227 +1,227 @@
-#if !defined(_FX_JPEG_TURBO_)
-/*
- * jfdctfst.c
- *
- * Copyright (C) 1994-1996, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- * For conditions of distribution and use, see the accompanying README file.
- *
- * This file contains a fast, not so accurate integer implementation of the
- * forward DCT (Discrete Cosine Transform).
- *
- * A 2-D DCT can be done by 1-D DCT on each row followed by 1-D DCT
- * on each column. Direct algorithms are also available, but they are
- * much more complex and seem not to be any faster when reduced to code.
- *
- * This implementation is based on Arai, Agui, and Nakajima's algorithm for
- * scaled DCT. Their original paper (Trans. IEICE E-71(11):1095) is in
- * Japanese, but the algorithm is described in the Pennebaker & Mitchell
- * JPEG textbook (see REFERENCES section in file README). The following code
- * is based directly on figure 4-8 in P&M.
- * While an 8-point DCT cannot be done in less than 11 multiplies, it is
- * possible to arrange the computation so that many of the multiplies are
- * simple scalings of the final outputs. These multiplies can then be
- * folded into the multiplications or divisions by the JPEG quantization
- * table entries. The AA&N method leaves only 5 multiplies and 29 adds
- * to be done in the DCT itself.
- * The primary disadvantage of this method is that with fixed-point math,
- * accuracy is lost due to imprecise representation of the scaled
- * quantization values. The smaller the quantization table entry, the less
- * precise the scaled value, so this implementation does worse with high-
- * quality-setting files than with low-quality ones.
- */
-
-#define JPEG_INTERNALS
-#include "jinclude.h"
-#include "jpeglib.h"
-#include "jdct.h" /* Private declarations for DCT subsystem */
-
-#ifdef DCT_IFAST_SUPPORTED
-
-
-/*
- * This module is specialized to the case DCTSIZE = 8.
- */
-
-#if DCTSIZE != 8
- Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */
-#endif
-
-
-/* Scaling decisions are generally the same as in the LL&M algorithm;
- * see jfdctint.c for more details. However, we choose to descale
- * (right shift) multiplication products as soon as they are formed,
- * rather than carrying additional fractional bits into subsequent additions.
- * This compromises accuracy slightly, but it lets us save a few shifts.
- * More importantly, 16-bit arithmetic is then adequate (for 8-bit samples)
- * everywhere except in the multiplications proper; this saves a good deal
- * of work on 16-bit-int machines.
- *
- * Again to save a few shifts, the intermediate results between pass 1 and
- * pass 2 are not upscaled, but are represented only to integral precision.
- *
- * A final compromise is to represent the multiplicative constants to only
- * 8 fractional bits, rather than 13. This saves some shifting work on some
- * machines, and may also reduce the cost of multiplication (since there
- * are fewer one-bits in the constants).
- */
-
-#define CONST_BITS 8
-
-
-/* Some C compilers fail to reduce "FIX(constant)" at compile time, thus
- * causing a lot of useless floating-point operations at run time.
- * To get around this we use the following pre-calculated constants.
- * If you change CONST_BITS you may want to add appropriate values.
- * (With a reasonable C compiler, you can just rely on the FIX() macro...)
- */
-
-#if CONST_BITS == 8
-#define FIX_0_382683433 ((INT32) 98) /* FIX(0.382683433) */
-#define FIX_0_541196100 ((INT32) 139) /* FIX(0.541196100) */
-#define FIX_0_707106781 ((INT32) 181) /* FIX(0.707106781) */
-#define FIX_1_306562965 ((INT32) 334) /* FIX(1.306562965) */
-#else
-#define FIX_0_382683433 FIX(0.382683433)
-#define FIX_0_541196100 FIX(0.541196100)
-#define FIX_0_707106781 FIX(0.707106781)
-#define FIX_1_306562965 FIX(1.306562965)
-#endif
-
-
-/* We can gain a little more speed, with a further compromise in accuracy,
- * by omitting the addition in a descaling shift. This yields an incorrectly
- * rounded result half the time...
- */
-
-#ifndef USE_ACCURATE_ROUNDING
-#undef DESCALE
-#define DESCALE(x,n) RIGHT_SHIFT(x, n)
-#endif
-
-
-/* Multiply a DCTELEM variable by an INT32 constant, and immediately
- * descale to yield a DCTELEM result.
- */
-
-#define MULTIPLY(var,const) ((DCTELEM) DESCALE((var) * (const), CONST_BITS))
-
-
-/*
- * Perform the forward DCT on one block of samples.
- */
-
-GLOBAL(void)
-jpeg_fdct_ifast (DCTELEM * data)
-{
- DCTELEM tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
- DCTELEM tmp10, tmp11, tmp12, tmp13;
- DCTELEM z1, z2, z3, z4, z5, z11, z13;
- DCTELEM *dataptr;
- int ctr;
- SHIFT_TEMPS
-
- /* Pass 1: process rows. */
-
- dataptr = data;
- for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {
- tmp0 = dataptr[0] + dataptr[7];
- tmp7 = dataptr[0] - dataptr[7];
- tmp1 = dataptr[1] + dataptr[6];
- tmp6 = dataptr[1] - dataptr[6];
- tmp2 = dataptr[2] + dataptr[5];
- tmp5 = dataptr[2] - dataptr[5];
- tmp3 = dataptr[3] + dataptr[4];
- tmp4 = dataptr[3] - dataptr[4];
-
- /* Even part */
-
- tmp10 = tmp0 + tmp3; /* phase 2 */
- tmp13 = tmp0 - tmp3;
- tmp11 = tmp1 + tmp2;
- tmp12 = tmp1 - tmp2;
-
- dataptr[0] = tmp10 + tmp11; /* phase 3 */
- dataptr[4] = tmp10 - tmp11;
-
- z1 = MULTIPLY(tmp12 + tmp13, FIX_0_707106781); /* c4 */
- dataptr[2] = tmp13 + z1; /* phase 5 */
- dataptr[6] = tmp13 - z1;
-
- /* Odd part */
-
- tmp10 = tmp4 + tmp5; /* phase 2 */
- tmp11 = tmp5 + tmp6;
- tmp12 = tmp6 + tmp7;
-
- /* The rotator is modified from fig 4-8 to avoid extra negations. */
- z5 = MULTIPLY(tmp10 - tmp12, FIX_0_382683433); /* c6 */
- z2 = MULTIPLY(tmp10, FIX_0_541196100) + z5; /* c2-c6 */
- z4 = MULTIPLY(tmp12, FIX_1_306562965) + z5; /* c2+c6 */
- z3 = MULTIPLY(tmp11, FIX_0_707106781); /* c4 */
-
- z11 = tmp7 + z3; /* phase 5 */
- z13 = tmp7 - z3;
-
- dataptr[5] = z13 + z2; /* phase 6 */
- dataptr[3] = z13 - z2;
- dataptr[1] = z11 + z4;
- dataptr[7] = z11 - z4;
-
- dataptr += DCTSIZE; /* advance pointer to next row */
- }
-
- /* Pass 2: process columns. */
-
- dataptr = data;
- for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {
- tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7];
- tmp7 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7];
- tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6];
- tmp6 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6];
- tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5];
- tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5];
- tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4];
- tmp4 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4];
-
- /* Even part */
-
- tmp10 = tmp0 + tmp3; /* phase 2 */
- tmp13 = tmp0 - tmp3;
- tmp11 = tmp1 + tmp2;
- tmp12 = tmp1 - tmp2;
-
- dataptr[DCTSIZE*0] = tmp10 + tmp11; /* phase 3 */
- dataptr[DCTSIZE*4] = tmp10 - tmp11;
-
- z1 = MULTIPLY(tmp12 + tmp13, FIX_0_707106781); /* c4 */
- dataptr[DCTSIZE*2] = tmp13 + z1; /* phase 5 */
- dataptr[DCTSIZE*6] = tmp13 - z1;
-
- /* Odd part */
-
- tmp10 = tmp4 + tmp5; /* phase 2 */
- tmp11 = tmp5 + tmp6;
- tmp12 = tmp6 + tmp7;
-
- /* The rotator is modified from fig 4-8 to avoid extra negations. */
- z5 = MULTIPLY(tmp10 - tmp12, FIX_0_382683433); /* c6 */
- z2 = MULTIPLY(tmp10, FIX_0_541196100) + z5; /* c2-c6 */
- z4 = MULTIPLY(tmp12, FIX_1_306562965) + z5; /* c2+c6 */
- z3 = MULTIPLY(tmp11, FIX_0_707106781); /* c4 */
-
- z11 = tmp7 + z3; /* phase 5 */
- z13 = tmp7 - z3;
-
- dataptr[DCTSIZE*5] = z13 + z2; /* phase 6 */
- dataptr[DCTSIZE*3] = z13 - z2;
- dataptr[DCTSIZE*1] = z11 + z4;
- dataptr[DCTSIZE*7] = z11 - z4;
-
- dataptr++; /* advance pointer to next column */
- }
-}
-
-#endif /* DCT_IFAST_SUPPORTED */
-
-#endif //_FX_JPEG_TURBO_
+#if !defined(_FX_JPEG_TURBO_)
+/*
+ * jfdctfst.c
+ *
+ * Copyright (C) 1994-1996, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains a fast, not so accurate integer implementation of the
+ * forward DCT (Discrete Cosine Transform).
+ *
+ * A 2-D DCT can be done by 1-D DCT on each row followed by 1-D DCT
+ * on each column. Direct algorithms are also available, but they are
+ * much more complex and seem not to be any faster when reduced to code.
+ *
+ * This implementation is based on Arai, Agui, and Nakajima's algorithm for
+ * scaled DCT. Their original paper (Trans. IEICE E-71(11):1095) is in
+ * Japanese, but the algorithm is described in the Pennebaker & Mitchell
+ * JPEG textbook (see REFERENCES section in file README). The following code
+ * is based directly on figure 4-8 in P&M.
+ * While an 8-point DCT cannot be done in less than 11 multiplies, it is
+ * possible to arrange the computation so that many of the multiplies are
+ * simple scalings of the final outputs. These multiplies can then be
+ * folded into the multiplications or divisions by the JPEG quantization
+ * table entries. The AA&N method leaves only 5 multiplies and 29 adds
+ * to be done in the DCT itself.
+ * The primary disadvantage of this method is that with fixed-point math,
+ * accuracy is lost due to imprecise representation of the scaled
+ * quantization values. The smaller the quantization table entry, the less
+ * precise the scaled value, so this implementation does worse with high-
+ * quality-setting files than with low-quality ones.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+#include "jdct.h" /* Private declarations for DCT subsystem */
+
+#ifdef DCT_IFAST_SUPPORTED
+
+
+/*
+ * This module is specialized to the case DCTSIZE = 8.
+ */
+
+#if DCTSIZE != 8
+ Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */
+#endif
+
+
+/* Scaling decisions are generally the same as in the LL&M algorithm;
+ * see jfdctint.c for more details. However, we choose to descale
+ * (right shift) multiplication products as soon as they are formed,
+ * rather than carrying additional fractional bits into subsequent additions.
+ * This compromises accuracy slightly, but it lets us save a few shifts.
+ * More importantly, 16-bit arithmetic is then adequate (for 8-bit samples)
+ * everywhere except in the multiplications proper; this saves a good deal
+ * of work on 16-bit-int machines.
+ *
+ * Again to save a few shifts, the intermediate results between pass 1 and
+ * pass 2 are not upscaled, but are represented only to integral precision.
+ *
+ * A final compromise is to represent the multiplicative constants to only
+ * 8 fractional bits, rather than 13. This saves some shifting work on some
+ * machines, and may also reduce the cost of multiplication (since there
+ * are fewer one-bits in the constants).
+ */
+
+#define CONST_BITS 8
+
+
+/* Some C compilers fail to reduce "FIX(constant)" at compile time, thus
+ * causing a lot of useless floating-point operations at run time.
+ * To get around this we use the following pre-calculated constants.
+ * If you change CONST_BITS you may want to add appropriate values.
+ * (With a reasonable C compiler, you can just rely on the FIX() macro...)
+ */
+
+#if CONST_BITS == 8
+#define FIX_0_382683433 ((INT32) 98) /* FIX(0.382683433) */
+#define FIX_0_541196100 ((INT32) 139) /* FIX(0.541196100) */
+#define FIX_0_707106781 ((INT32) 181) /* FIX(0.707106781) */
+#define FIX_1_306562965 ((INT32) 334) /* FIX(1.306562965) */
+#else
+#define FIX_0_382683433 FIX(0.382683433)
+#define FIX_0_541196100 FIX(0.541196100)
+#define FIX_0_707106781 FIX(0.707106781)
+#define FIX_1_306562965 FIX(1.306562965)
+#endif
+
+
+/* We can gain a little more speed, with a further compromise in accuracy,
+ * by omitting the addition in a descaling shift. This yields an incorrectly
+ * rounded result half the time...
+ */
+
+#ifndef USE_ACCURATE_ROUNDING
+#undef DESCALE
+#define DESCALE(x,n) RIGHT_SHIFT(x, n)
+#endif
+
+
+/* Multiply a DCTELEM variable by an INT32 constant, and immediately
+ * descale to yield a DCTELEM result.
+ */
+
+#define MULTIPLY(var,const) ((DCTELEM) DESCALE((var) * (const), CONST_BITS))
+
+
+/*
+ * Perform the forward DCT on one block of samples.
+ */
+
+GLOBAL(void)
+jpeg_fdct_ifast (DCTELEM * data)
+{
+ DCTELEM tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
+ DCTELEM tmp10, tmp11, tmp12, tmp13;
+ DCTELEM z1, z2, z3, z4, z5, z11, z13;
+ DCTELEM *dataptr;
+ int ctr;
+ SHIFT_TEMPS
+
+ /* Pass 1: process rows. */
+
+ dataptr = data;
+ for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {
+ tmp0 = dataptr[0] + dataptr[7];
+ tmp7 = dataptr[0] - dataptr[7];
+ tmp1 = dataptr[1] + dataptr[6];
+ tmp6 = dataptr[1] - dataptr[6];
+ tmp2 = dataptr[2] + dataptr[5];
+ tmp5 = dataptr[2] - dataptr[5];
+ tmp3 = dataptr[3] + dataptr[4];
+ tmp4 = dataptr[3] - dataptr[4];
+
+ /* Even part */
+
+ tmp10 = tmp0 + tmp3; /* phase 2 */
+ tmp13 = tmp0 - tmp3;
+ tmp11 = tmp1 + tmp2;
+ tmp12 = tmp1 - tmp2;
+
+ dataptr[0] = tmp10 + tmp11; /* phase 3 */
+ dataptr[4] = tmp10 - tmp11;
+
+ z1 = MULTIPLY(tmp12 + tmp13, FIX_0_707106781); /* c4 */
+ dataptr[2] = tmp13 + z1; /* phase 5 */
+ dataptr[6] = tmp13 - z1;
+
+ /* Odd part */
+
+ tmp10 = tmp4 + tmp5; /* phase 2 */
+ tmp11 = tmp5 + tmp6;
+ tmp12 = tmp6 + tmp7;
+
+ /* The rotator is modified from fig 4-8 to avoid extra negations. */
+ z5 = MULTIPLY(tmp10 - tmp12, FIX_0_382683433); /* c6 */
+ z2 = MULTIPLY(tmp10, FIX_0_541196100) + z5; /* c2-c6 */
+ z4 = MULTIPLY(tmp12, FIX_1_306562965) + z5; /* c2+c6 */
+ z3 = MULTIPLY(tmp11, FIX_0_707106781); /* c4 */
+
+ z11 = tmp7 + z3; /* phase 5 */
+ z13 = tmp7 - z3;
+
+ dataptr[5] = z13 + z2; /* phase 6 */
+ dataptr[3] = z13 - z2;
+ dataptr[1] = z11 + z4;
+ dataptr[7] = z11 - z4;
+
+ dataptr += DCTSIZE; /* advance pointer to next row */
+ }
+
+ /* Pass 2: process columns. */
+
+ dataptr = data;
+ for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {
+ tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7];
+ tmp7 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7];
+ tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6];
+ tmp6 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6];
+ tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5];
+ tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5];
+ tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4];
+ tmp4 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4];
+
+ /* Even part */
+
+ tmp10 = tmp0 + tmp3; /* phase 2 */
+ tmp13 = tmp0 - tmp3;
+ tmp11 = tmp1 + tmp2;
+ tmp12 = tmp1 - tmp2;
+
+ dataptr[DCTSIZE*0] = tmp10 + tmp11; /* phase 3 */
+ dataptr[DCTSIZE*4] = tmp10 - tmp11;
+
+ z1 = MULTIPLY(tmp12 + tmp13, FIX_0_707106781); /* c4 */
+ dataptr[DCTSIZE*2] = tmp13 + z1; /* phase 5 */
+ dataptr[DCTSIZE*6] = tmp13 - z1;
+
+ /* Odd part */
+
+ tmp10 = tmp4 + tmp5; /* phase 2 */
+ tmp11 = tmp5 + tmp6;
+ tmp12 = tmp6 + tmp7;
+
+ /* The rotator is modified from fig 4-8 to avoid extra negations. */
+ z5 = MULTIPLY(tmp10 - tmp12, FIX_0_382683433); /* c6 */
+ z2 = MULTIPLY(tmp10, FIX_0_541196100) + z5; /* c2-c6 */
+ z4 = MULTIPLY(tmp12, FIX_1_306562965) + z5; /* c2+c6 */
+ z3 = MULTIPLY(tmp11, FIX_0_707106781); /* c4 */
+
+ z11 = tmp7 + z3; /* phase 5 */
+ z13 = tmp7 - z3;
+
+ dataptr[DCTSIZE*5] = z13 + z2; /* phase 6 */
+ dataptr[DCTSIZE*3] = z13 - z2;
+ dataptr[DCTSIZE*1] = z11 + z4;
+ dataptr[DCTSIZE*7] = z11 - z4;
+
+ dataptr++; /* advance pointer to next column */
+ }
+}
+
+#endif /* DCT_IFAST_SUPPORTED */
+
+#endif //_FX_JPEG_TURBO_
diff --git a/core/src/fxcodec/libjpeg/fpdfapi_jfdctint.c b/core/src/fxcodec/libjpeg/fpdfapi_jfdctint.c
index 88810a7d8e..488505b062 100644
--- a/core/src/fxcodec/libjpeg/fpdfapi_jfdctint.c
+++ b/core/src/fxcodec/libjpeg/fpdfapi_jfdctint.c
@@ -1,286 +1,286 @@
-#if !defined(_FX_JPEG_TURBO_)
-/*
- * jfdctint.c
- *
- * Copyright (C) 1991-1996, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- * For conditions of distribution and use, see the accompanying README file.
- *
- * This file contains a slow-but-accurate integer implementation of the
- * forward DCT (Discrete Cosine Transform).
- *
- * A 2-D DCT can be done by 1-D DCT on each row followed by 1-D DCT
- * on each column. Direct algorithms are also available, but they are
- * much more complex and seem not to be any faster when reduced to code.
- *
- * This implementation is based on an algorithm described in
- * C. Loeffler, A. Ligtenberg and G. Moschytz, "Practical Fast 1-D DCT
- * Algorithms with 11 Multiplications", Proc. Int'l. Conf. on Acoustics,
- * Speech, and Signal Processing 1989 (ICASSP '89), pp. 988-991.
- * The primary algorithm described there uses 11 multiplies and 29 adds.
- * We use their alternate method with 12 multiplies and 32 adds.
- * The advantage of this method is that no data path contains more than one
- * multiplication; this allows a very simple and accurate implementation in
- * scaled fixed-point arithmetic, with a minimal number of shifts.
- */
-
-#define JPEG_INTERNALS
-#include "jinclude.h"
-#include "jpeglib.h"
-#include "jdct.h" /* Private declarations for DCT subsystem */
-
-#ifdef DCT_ISLOW_SUPPORTED
-
-
-/*
- * This module is specialized to the case DCTSIZE = 8.
- */
-
-#if DCTSIZE != 8
- Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */
-#endif
-
-
-/*
- * The poop on this scaling stuff is as follows:
- *
- * Each 1-D DCT step produces outputs which are a factor of sqrt(N)
- * larger than the true DCT outputs. The final outputs are therefore
- * a factor of N larger than desired; since N=8 this can be cured by
- * a simple right shift at the end of the algorithm. The advantage of
- * this arrangement is that we save two multiplications per 1-D DCT,
- * because the y0 and y4 outputs need not be divided by sqrt(N).
- * In the IJG code, this factor of 8 is removed by the quantization step
- * (in jcdctmgr.c), NOT in this module.
- *
- * We have to do addition and subtraction of the integer inputs, which
- * is no problem, and multiplication by fractional constants, which is
- * a problem to do in integer arithmetic. We multiply all the constants
- * by CONST_SCALE and convert them to integer constants (thus retaining
- * CONST_BITS bits of precision in the constants). After doing a
- * multiplication we have to divide the product by CONST_SCALE, with proper
- * rounding, to produce the correct output. This division can be done
- * cheaply as a right shift of CONST_BITS bits. We postpone shifting
- * as long as possible so that partial sums can be added together with
- * full fractional precision.
- *
- * The outputs of the first pass are scaled up by PASS1_BITS bits so that
- * they are represented to better-than-integral precision. These outputs
- * require BITS_IN_JSAMPLE + PASS1_BITS + 3 bits; this fits in a 16-bit word
- * with the recommended scaling. (For 12-bit sample data, the intermediate
- * array is INT32 anyway.)
- *
- * To avoid overflow of the 32-bit intermediate results in pass 2, we must
- * have BITS_IN_JSAMPLE + CONST_BITS + PASS1_BITS <= 26. Error analysis
- * shows that the values given below are the most effective.
- */
-
-#if BITS_IN_JSAMPLE == 8
-#define CONST_BITS 13
-#define PASS1_BITS 2
-#else
-#define CONST_BITS 13
-#define PASS1_BITS 1 /* lose a little precision to avoid overflow */
-#endif
-
-/* Some C compilers fail to reduce "FIX(constant)" at compile time, thus
- * causing a lot of useless floating-point operations at run time.
- * To get around this we use the following pre-calculated constants.
- * If you change CONST_BITS you may want to add appropriate values.
- * (With a reasonable C compiler, you can just rely on the FIX() macro...)
- */
-
-#if CONST_BITS == 13
-#define FIX_0_298631336 ((INT32) 2446) /* FIX(0.298631336) */
-#define FIX_0_390180644 ((INT32) 3196) /* FIX(0.390180644) */
-#define FIX_0_541196100 ((INT32) 4433) /* FIX(0.541196100) */
-#define FIX_0_765366865 ((INT32) 6270) /* FIX(0.765366865) */
-#define FIX_0_899976223 ((INT32) 7373) /* FIX(0.899976223) */
-#define FIX_1_175875602 ((INT32) 9633) /* FIX(1.175875602) */
-#define FIX_1_501321110 ((INT32) 12299) /* FIX(1.501321110) */
-#define FIX_1_847759065 ((INT32) 15137) /* FIX(1.847759065) */
-#define FIX_1_961570560 ((INT32) 16069) /* FIX(1.961570560) */
-#define FIX_2_053119869 ((INT32) 16819) /* FIX(2.053119869) */
-#define FIX_2_562915447 ((INT32) 20995) /* FIX(2.562915447) */
-#define FIX_3_072711026 ((INT32) 25172) /* FIX(3.072711026) */
-#else
-#define FIX_0_298631336 FIX(0.298631336)
-#define FIX_0_390180644 FIX(0.390180644)
-#define FIX_0_541196100 FIX(0.541196100)
-#define FIX_0_765366865 FIX(0.765366865)
-#define FIX_0_899976223 FIX(0.899976223)
-#define FIX_1_175875602 FIX(1.175875602)
-#define FIX_1_501321110 FIX(1.501321110)
-#define FIX_1_847759065 FIX(1.847759065)
-#define FIX_1_961570560 FIX(1.961570560)
-#define FIX_2_053119869 FIX(2.053119869)
-#define FIX_2_562915447 FIX(2.562915447)
-#define FIX_3_072711026 FIX(3.072711026)
-#endif
-
-
-/* Multiply an INT32 variable by an INT32 constant to yield an INT32 result.
- * For 8-bit samples with the recommended scaling, all the variable
- * and constant values involved are no more than 16 bits wide, so a
- * 16x16->32 bit multiply can be used instead of a full 32x32 multiply.
- * For 12-bit samples, a full 32-bit multiplication will be needed.
- */
-
-#if BITS_IN_JSAMPLE == 8
-#define MULTIPLY(var,const) MULTIPLY16C16(var,const)
-#else
-#define MULTIPLY(var,const) ((var) * (const))
-#endif
-
-
-/*
- * Perform the forward DCT on one block of samples.
- */
-
-GLOBAL(void)
-jpeg_fdct_islow (DCTELEM * data)
-{
- INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
- INT32 tmp10, tmp11, tmp12, tmp13;
- INT32 z1, z2, z3, z4, z5;
- DCTELEM *dataptr;
- int ctr;
- SHIFT_TEMPS
-
- /* Pass 1: process rows. */
- /* Note results are scaled up by sqrt(8) compared to a true DCT; */
- /* furthermore, we scale the results by 2**PASS1_BITS. */
-
- dataptr = data;
- for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {
- tmp0 = dataptr[0] + dataptr[7];
- tmp7 = dataptr[0] - dataptr[7];
- tmp1 = dataptr[1] + dataptr[6];
- tmp6 = dataptr[1] - dataptr[6];
- tmp2 = dataptr[2] + dataptr[5];
- tmp5 = dataptr[2] - dataptr[5];
- tmp3 = dataptr[3] + dataptr[4];
- tmp4 = dataptr[3] - dataptr[4];
-
- /* Even part per LL&M figure 1 --- note that published figure is faulty;
- * rotator "sqrt(2)*c1" should be "sqrt(2)*c6".
- */
-
- tmp10 = tmp0 + tmp3;
- tmp13 = tmp0 - tmp3;
- tmp11 = tmp1 + tmp2;
- tmp12 = tmp1 - tmp2;
-
- dataptr[0] = (DCTELEM) ((tmp10 + tmp11) << PASS1_BITS);
- dataptr[4] = (DCTELEM) ((tmp10 - tmp11) << PASS1_BITS);
-
- z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100);
- dataptr[2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865),
- CONST_BITS-PASS1_BITS);
- dataptr[6] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, - FIX_1_847759065),
- CONST_BITS-PASS1_BITS);
-
- /* Odd part per figure 8 --- note paper omits factor of sqrt(2).
- * cK represents cos(K*pi/16).
- * i0..i3 in the paper are tmp4..tmp7 here.
- */
-
- z1 = tmp4 + tmp7;
- z2 = tmp5 + tmp6;
- z3 = tmp4 + tmp6;
- z4 = tmp5 + tmp7;
- z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */
-
- tmp4 = MULTIPLY(tmp4, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */
- tmp5 = MULTIPLY(tmp5, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */
- tmp6 = MULTIPLY(tmp6, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */
- tmp7 = MULTIPLY(tmp7, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */
- z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */
- z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */
- z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */
- z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */
-
- z3 += z5;
- z4 += z5;
-
- dataptr[7] = (DCTELEM) DESCALE(tmp4 + z1 + z3, CONST_BITS-PASS1_BITS);
- dataptr[5] = (DCTELEM) DESCALE(tmp5 + z2 + z4, CONST_BITS-PASS1_BITS);
- dataptr[3] = (DCTELEM) DESCALE(tmp6 + z2 + z3, CONST_BITS-PASS1_BITS);
- dataptr[1] = (DCTELEM) DESCALE(tmp7 + z1 + z4, CONST_BITS-PASS1_BITS);
-
- dataptr += DCTSIZE; /* advance pointer to next row */
- }
-
- /* Pass 2: process columns.
- * We remove the PASS1_BITS scaling, but leave the results scaled up
- * by an overall factor of 8.
- */
-
- dataptr = data;
- for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {
- tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7];
- tmp7 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7];
- tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6];
- tmp6 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6];
- tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5];
- tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5];
- tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4];
- tmp4 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4];
-
- /* Even part per LL&M figure 1 --- note that published figure is faulty;
- * rotator "sqrt(2)*c1" should be "sqrt(2)*c6".
- */
-
- tmp10 = tmp0 + tmp3;
- tmp13 = tmp0 - tmp3;
- tmp11 = tmp1 + tmp2;
- tmp12 = tmp1 - tmp2;
-
- dataptr[DCTSIZE*0] = (DCTELEM) DESCALE(tmp10 + tmp11, PASS1_BITS);
- dataptr[DCTSIZE*4] = (DCTELEM) DESCALE(tmp10 - tmp11, PASS1_BITS);
-
- z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100);
- dataptr[DCTSIZE*2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865),
- CONST_BITS+PASS1_BITS);
- dataptr[DCTSIZE*6] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, - FIX_1_847759065),
- CONST_BITS+PASS1_BITS);
-
- /* Odd part per figure 8 --- note paper omits factor of sqrt(2).
- * cK represents cos(K*pi/16).
- * i0..i3 in the paper are tmp4..tmp7 here.
- */
-
- z1 = tmp4 + tmp7;
- z2 = tmp5 + tmp6;
- z3 = tmp4 + tmp6;
- z4 = tmp5 + tmp7;
- z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */
-
- tmp4 = MULTIPLY(tmp4, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */
- tmp5 = MULTIPLY(tmp5, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */
- tmp6 = MULTIPLY(tmp6, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */
- tmp7 = MULTIPLY(tmp7, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */
- z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */
- z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */
- z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */
- z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */
-
- z3 += z5;
- z4 += z5;
-
- dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp4 + z1 + z3,
- CONST_BITS+PASS1_BITS);
- dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp5 + z2 + z4,
- CONST_BITS+PASS1_BITS);
- dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp6 + z2 + z3,
- CONST_BITS+PASS1_BITS);
- dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp7 + z1 + z4,
- CONST_BITS+PASS1_BITS);
-
- dataptr++; /* advance pointer to next column */
- }
-}
-
-#endif /* DCT_ISLOW_SUPPORTED */
-
-#endif //_FX_JPEG_TURBO_
+#if !defined(_FX_JPEG_TURBO_)
+/*
+ * jfdctint.c
+ *
+ * Copyright (C) 1991-1996, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains a slow-but-accurate integer implementation of the
+ * forward DCT (Discrete Cosine Transform).
+ *
+ * A 2-D DCT can be done by 1-D DCT on each row followed by 1-D DCT
+ * on each column. Direct algorithms are also available, but they are
+ * much more complex and seem not to be any faster when reduced to code.
+ *
+ * This implementation is based on an algorithm described in
+ * C. Loeffler, A. Ligtenberg and G. Moschytz, "Practical Fast 1-D DCT
+ * Algorithms with 11 Multiplications", Proc. Int'l. Conf. on Acoustics,
+ * Speech, and Signal Processing 1989 (ICASSP '89), pp. 988-991.
+ * The primary algorithm described there uses 11 multiplies and 29 adds.
+ * We use their alternate method with 12 multiplies and 32 adds.
+ * The advantage of this method is that no data path contains more than one
+ * multiplication; this allows a very simple and accurate implementation in
+ * scaled fixed-point arithmetic, with a minimal number of shifts.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+#include "jdct.h" /* Private declarations for DCT subsystem */
+
+#ifdef DCT_ISLOW_SUPPORTED
+
+
+/*
+ * This module is specialized to the case DCTSIZE = 8.
+ */
+
+#if DCTSIZE != 8
+ Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */
+#endif
+
+
+/*
+ * The poop on this scaling stuff is as follows:
+ *
+ * Each 1-D DCT step produces outputs which are a factor of sqrt(N)
+ * larger than the true DCT outputs. The final outputs are therefore
+ * a factor of N larger than desired; since N=8 this can be cured by
+ * a simple right shift at the end of the algorithm. The advantage of
+ * this arrangement is that we save two multiplications per 1-D DCT,
+ * because the y0 and y4 outputs need not be divided by sqrt(N).
+ * In the IJG code, this factor of 8 is removed by the quantization step
+ * (in jcdctmgr.c), NOT in this module.
+ *
+ * We have to do addition and subtraction of the integer inputs, which
+ * is no problem, and multiplication by fractional constants, which is
+ * a problem to do in integer arithmetic. We multiply all the constants
+ * by CONST_SCALE and convert them to integer constants (thus retaining
+ * CONST_BITS bits of precision in the constants). After doing a
+ * multiplication we have to divide the product by CONST_SCALE, with proper
+ * rounding, to produce the correct output. This division can be done
+ * cheaply as a right shift of CONST_BITS bits. We postpone shifting
+ * as long as possible so that partial sums can be added together with
+ * full fractional precision.
+ *
+ * The outputs of the first pass are scaled up by PASS1_BITS bits so that
+ * they are represented to better-than-integral precision. These outputs
+ * require BITS_IN_JSAMPLE + PASS1_BITS + 3 bits; this fits in a 16-bit word
+ * with the recommended scaling. (For 12-bit sample data, the intermediate
+ * array is INT32 anyway.)
+ *
+ * To avoid overflow of the 32-bit intermediate results in pass 2, we must
+ * have BITS_IN_JSAMPLE + CONST_BITS + PASS1_BITS <= 26. Error analysis
+ * shows that the values given below are the most effective.
+ */
+
+#if BITS_IN_JSAMPLE == 8
+#define CONST_BITS 13
+#define PASS1_BITS 2
+#else
+#define CONST_BITS 13
+#define PASS1_BITS 1 /* lose a little precision to avoid overflow */
+#endif
+
+/* Some C compilers fail to reduce "FIX(constant)" at compile time, thus
+ * causing a lot of useless floating-point operations at run time.
+ * To get around this we use the following pre-calculated constants.
+ * If you change CONST_BITS you may want to add appropriate values.
+ * (With a reasonable C compiler, you can just rely on the FIX() macro...)
+ */
+
+#if CONST_BITS == 13
+#define FIX_0_298631336 ((INT32) 2446) /* FIX(0.298631336) */
+#define FIX_0_390180644 ((INT32) 3196) /* FIX(0.390180644) */
+#define FIX_0_541196100 ((INT32) 4433) /* FIX(0.541196100) */
+#define FIX_0_765366865 ((INT32) 6270) /* FIX(0.765366865) */
+#define FIX_0_899976223 ((INT32) 7373) /* FIX(0.899976223) */
+#define FIX_1_175875602 ((INT32) 9633) /* FIX(1.175875602) */
+#define FIX_1_501321110 ((INT32) 12299) /* FIX(1.501321110) */
+#define FIX_1_847759065 ((INT32) 15137) /* FIX(1.847759065) */
+#define FIX_1_961570560 ((INT32) 16069) /* FIX(1.961570560) */
+#define FIX_2_053119869 ((INT32) 16819) /* FIX(2.053119869) */
+#define FIX_2_562915447 ((INT32) 20995) /* FIX(2.562915447) */
+#define FIX_3_072711026 ((INT32) 25172) /* FIX(3.072711026) */
+#else
+#define FIX_0_298631336 FIX(0.298631336)
+#define FIX_0_390180644 FIX(0.390180644)
+#define FIX_0_541196100 FIX(0.541196100)
+#define FIX_0_765366865 FIX(0.765366865)
+#define FIX_0_899976223 FIX(0.899976223)
+#define FIX_1_175875602 FIX(1.175875602)
+#define FIX_1_501321110 FIX(1.501321110)
+#define FIX_1_847759065 FIX(1.847759065)
+#define FIX_1_961570560 FIX(1.961570560)
+#define FIX_2_053119869 FIX(2.053119869)
+#define FIX_2_562915447 FIX(2.562915447)
+#define FIX_3_072711026 FIX(3.072711026)
+#endif
+
+
+/* Multiply an INT32 variable by an INT32 constant to yield an INT32 result.
+ * For 8-bit samples with the recommended scaling, all the variable
+ * and constant values involved are no more than 16 bits wide, so a
+ * 16x16->32 bit multiply can be used instead of a full 32x32 multiply.
+ * For 12-bit samples, a full 32-bit multiplication will be needed.
+ */
+
+#if BITS_IN_JSAMPLE == 8
+#define MULTIPLY(var,const) MULTIPLY16C16(var,const)
+#else
+#define MULTIPLY(var,const) ((var) * (const))
+#endif
+
+
+/*
+ * Perform the forward DCT on one block of samples.
+ */
+
+GLOBAL(void)
+jpeg_fdct_islow (DCTELEM * data)
+{
+ INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
+ INT32 tmp10, tmp11, tmp12, tmp13;
+ INT32 z1, z2, z3, z4, z5;
+ DCTELEM *dataptr;
+ int ctr;
+ SHIFT_TEMPS
+
+ /* Pass 1: process rows. */
+ /* Note results are scaled up by sqrt(8) compared to a true DCT; */
+ /* furthermore, we scale the results by 2**PASS1_BITS. */
+
+ dataptr = data;
+ for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {
+ tmp0 = dataptr[0] + dataptr[7];
+ tmp7 = dataptr[0] - dataptr[7];
+ tmp1 = dataptr[1] + dataptr[6];
+ tmp6 = dataptr[1] - dataptr[6];
+ tmp2 = dataptr[2] + dataptr[5];
+ tmp5 = dataptr[2] - dataptr[5];
+ tmp3 = dataptr[3] + dataptr[4];
+ tmp4 = dataptr[3] - dataptr[4];
+
+ /* Even part per LL&M figure 1 --- note that published figure is faulty;
+ * rotator "sqrt(2)*c1" should be "sqrt(2)*c6".
+ */
+
+ tmp10 = tmp0 + tmp3;
+ tmp13 = tmp0 - tmp3;
+ tmp11 = tmp1 + tmp2;
+ tmp12 = tmp1 - tmp2;
+
+ dataptr[0] = (DCTELEM) ((tmp10 + tmp11) << PASS1_BITS);
+ dataptr[4] = (DCTELEM) ((tmp10 - tmp11) << PASS1_BITS);
+
+ z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100);
+ dataptr[2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865),
+ CONST_BITS-PASS1_BITS);
+ dataptr[6] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, - FIX_1_847759065),
+ CONST_BITS-PASS1_BITS);
+
+ /* Odd part per figure 8 --- note paper omits factor of sqrt(2).
+ * cK represents cos(K*pi/16).
+ * i0..i3 in the paper are tmp4..tmp7 here.
+ */
+
+ z1 = tmp4 + tmp7;
+ z2 = tmp5 + tmp6;
+ z3 = tmp4 + tmp6;
+ z4 = tmp5 + tmp7;
+ z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */
+
+ tmp4 = MULTIPLY(tmp4, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */
+ tmp5 = MULTIPLY(tmp5, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */
+ tmp6 = MULTIPLY(tmp6, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */
+ tmp7 = MULTIPLY(tmp7, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */
+ z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */
+ z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */
+ z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */
+ z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */
+
+ z3 += z5;
+ z4 += z5;
+
+ dataptr[7] = (DCTELEM) DESCALE(tmp4 + z1 + z3, CONST_BITS-PASS1_BITS);
+ dataptr[5] = (DCTELEM) DESCALE(tmp5 + z2 + z4, CONST_BITS-PASS1_BITS);
+ dataptr[3] = (DCTELEM) DESCALE(tmp6 + z2 + z3, CONST_BITS-PASS1_BITS);
+ dataptr[1] = (DCTELEM) DESCALE(tmp7 + z1 + z4, CONST_BITS-PASS1_BITS);
+
+ dataptr += DCTSIZE; /* advance pointer to next row */
+ }
+
+ /* Pass 2: process columns.
+ * We remove the PASS1_BITS scaling, but leave the results scaled up
+ * by an overall factor of 8.
+ */
+
+ dataptr = data;
+ for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {
+ tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7];
+ tmp7 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7];
+ tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6];
+ tmp6 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6];
+ tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5];
+ tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5];
+ tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4];
+ tmp4 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4];
+
+ /* Even part per LL&M figure 1 --- note that published figure is faulty;
+ * rotator "sqrt(2)*c1" should be "sqrt(2)*c6".
+ */
+
+ tmp10 = tmp0 + tmp3;
+ tmp13 = tmp0 - tmp3;
+ tmp11 = tmp1 + tmp2;
+ tmp12 = tmp1 - tmp2;
+
+ dataptr[DCTSIZE*0] = (DCTELEM) DESCALE(tmp10 + tmp11, PASS1_BITS);
+ dataptr[DCTSIZE*4] = (DCTELEM) DESCALE(tmp10 - tmp11, PASS1_BITS);
+
+ z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100);
+ dataptr[DCTSIZE*2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865),
+ CONST_BITS+PASS1_BITS);
+ dataptr[DCTSIZE*6] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, - FIX_1_847759065),
+ CONST_BITS+PASS1_BITS);
+
+ /* Odd part per figure 8 --- note paper omits factor of sqrt(2).
+ * cK represents cos(K*pi/16).
+ * i0..i3 in the paper are tmp4..tmp7 here.
+ */
+
+ z1 = tmp4 + tmp7;
+ z2 = tmp5 + tmp6;
+ z3 = tmp4 + tmp6;
+ z4 = tmp5 + tmp7;
+ z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */
+
+ tmp4 = MULTIPLY(tmp4, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */
+ tmp5 = MULTIPLY(tmp5, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */
+ tmp6 = MULTIPLY(tmp6, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */
+ tmp7 = MULTIPLY(tmp7, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */
+ z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */
+ z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */
+ z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */
+ z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */
+
+ z3 += z5;
+ z4 += z5;
+
+ dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp4 + z1 + z3,
+ CONST_BITS+PASS1_BITS);
+ dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp5 + z2 + z4,
+ CONST_BITS+PASS1_BITS);
+ dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp6 + z2 + z3,
+ CONST_BITS+PASS1_BITS);
+ dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp7 + z1 + z4,
+ CONST_BITS+PASS1_BITS);
+
+ dataptr++; /* advance pointer to next column */
+ }
+}
+
+#endif /* DCT_ISLOW_SUPPORTED */
+
+#endif //_FX_JPEG_TURBO_
diff --git a/core/src/fxcodec/libjpeg/fpdfapi_jidctfst.c b/core/src/fxcodec/libjpeg/fpdfapi_jidctfst.c
index c0c504c2a6..26a8f68a27 100644
--- a/core/src/fxcodec/libjpeg/fpdfapi_jidctfst.c
+++ b/core/src/fxcodec/libjpeg/fpdfapi_jidctfst.c
@@ -1,371 +1,371 @@
-#if !defined(_FX_JPEG_TURBO_)
-/*
- * jidctfst.c
- *
- * Copyright (C) 1994-1998, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- * For conditions of distribution and use, see the accompanying README file.
- *
- * This file contains a fast, not so accurate integer implementation of the
- * inverse DCT (Discrete Cosine Transform). In the IJG code, this routine
- * must also perform dequantization of the input coefficients.
- *
- * A 2-D IDCT can be done by 1-D IDCT on each column followed by 1-D IDCT
- * on each row (or vice versa, but it's more convenient to emit a row at
- * a time). Direct algorithms are also available, but they are much more
- * complex and seem not to be any faster when reduced to code.
- *
- * This implementation is based on Arai, Agui, and Nakajima's algorithm for
- * scaled DCT. Their original paper (Trans. IEICE E-71(11):1095) is in
- * Japanese, but the algorithm is described in the Pennebaker & Mitchell
- * JPEG textbook (see REFERENCES section in file README). The following code
- * is based directly on figure 4-8 in P&M.
- * While an 8-point DCT cannot be done in less than 11 multiplies, it is
- * possible to arrange the computation so that many of the multiplies are
- * simple scalings of the final outputs. These multiplies can then be
- * folded into the multiplications or divisions by the JPEG quantization
- * table entries. The AA&N method leaves only 5 multiplies and 29 adds
- * to be done in the DCT itself.
- * The primary disadvantage of this method is that with fixed-point math,
- * accuracy is lost due to imprecise representation of the scaled
- * quantization values. The smaller the quantization table entry, the less
- * precise the scaled value, so this implementation does worse with high-
- * quality-setting files than with low-quality ones.
- */
-
-#define JPEG_INTERNALS
-#include "jinclude.h"
-#include "jpeglib.h"
-#include "jdct.h" /* Private declarations for DCT subsystem */
-
-#ifdef DCT_IFAST_SUPPORTED
-
-
-/*
- * This module is specialized to the case DCTSIZE = 8.
- */
-
-#if DCTSIZE != 8
- Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */
-#endif
-
-
-/* Scaling decisions are generally the same as in the LL&M algorithm;
- * see jidctint.c for more details. However, we choose to descale
- * (right shift) multiplication products as soon as they are formed,
- * rather than carrying additional fractional bits into subsequent additions.
- * This compromises accuracy slightly, but it lets us save a few shifts.
- * More importantly, 16-bit arithmetic is then adequate (for 8-bit samples)
- * everywhere except in the multiplications proper; this saves a good deal
- * of work on 16-bit-int machines.
- *
- * The dequantized coefficients are not integers because the AA&N scaling
- * factors have been incorporated. We represent them scaled up by PASS1_BITS,
- * so that the first and second IDCT rounds have the same input scaling.
- * For 8-bit JSAMPLEs, we choose IFAST_SCALE_BITS = PASS1_BITS so as to
- * avoid a descaling shift; this compromises accuracy rather drastically
- * for small quantization table entries, but it saves a lot of shifts.
- * For 12-bit JSAMPLEs, there's no hope of using 16x16 multiplies anyway,
- * so we use a much larger scaling factor to preserve accuracy.
- *
- * A final compromise is to represent the multiplicative constants to only
- * 8 fractional bits, rather than 13. This saves some shifting work on some
- * machines, and may also reduce the cost of multiplication (since there
- * are fewer one-bits in the constants).
- */
-
-#if BITS_IN_JSAMPLE == 8
-#define CONST_BITS 8
-#define PASS1_BITS 2
-#else
-#define CONST_BITS 8
-#define PASS1_BITS 1 /* lose a little precision to avoid overflow */
-#endif
-
-/* Some C compilers fail to reduce "FIX(constant)" at compile time, thus
- * causing a lot of useless floating-point operations at run time.
- * To get around this we use the following pre-calculated constants.
- * If you change CONST_BITS you may want to add appropriate values.
- * (With a reasonable C compiler, you can just rely on the FIX() macro...)
- */
-
-#if CONST_BITS == 8
-#define FIX_1_082392200 ((INT32) 277) /* FIX(1.082392200) */
-#define FIX_1_414213562 ((INT32) 362) /* FIX(1.414213562) */
-#define FIX_1_847759065 ((INT32) 473) /* FIX(1.847759065) */
-#define FIX_2_613125930 ((INT32) 669) /* FIX(2.613125930) */
-#else
-#define FIX_1_082392200 FIX(1.082392200)
-#define FIX_1_414213562 FIX(1.414213562)
-#define FIX_1_847759065 FIX(1.847759065)
-#define FIX_2_613125930 FIX(2.613125930)
-#endif
-
-
-/* We can gain a little more speed, with a further compromise in accuracy,
- * by omitting the addition in a descaling shift. This yields an incorrectly
- * rounded result half the time...
- */
-
-#ifndef USE_ACCURATE_ROUNDING
-#undef DESCALE
-#define DESCALE(x,n) RIGHT_SHIFT(x, n)
-#endif
-
-
-/* Multiply a DCTELEM variable by an INT32 constant, and immediately
- * descale to yield a DCTELEM result.
- */
-
-#define MULTIPLY(var,const) ((DCTELEM) DESCALE((var) * (const), CONST_BITS))
-
-
-/* Dequantize a coefficient by multiplying it by the multiplier-table
- * entry; produce a DCTELEM result. For 8-bit data a 16x16->16
- * multiplication will do. For 12-bit data, the multiplier table is
- * declared INT32, so a 32-bit multiply will be used.
- */
-
-#if BITS_IN_JSAMPLE == 8
-#define DEQUANTIZE(coef,quantval) (((IFAST_MULT_TYPE) (coef)) * (quantval))
-#else
-#define DEQUANTIZE(coef,quantval) \
- DESCALE((coef)*(quantval), IFAST_SCALE_BITS-PASS1_BITS)
-#endif
-
-
-/* Like DESCALE, but applies to a DCTELEM and produces an int.
- * We assume that int right shift is unsigned if INT32 right shift is.
- */
-
-#ifdef RIGHT_SHIFT_IS_UNSIGNED
-#define ISHIFT_TEMPS DCTELEM ishift_temp;
-#if BITS_IN_JSAMPLE == 8
-#define DCTELEMBITS 16 /* DCTELEM may be 16 or 32 bits */
-#else
-#define DCTELEMBITS 32 /* DCTELEM must be 32 bits */
-#endif
-#define IRIGHT_SHIFT(x,shft) \
- ((ishift_temp = (x)) < 0 ? \
- (ishift_temp >> (shft)) | ((~((DCTELEM) 0)) << (DCTELEMBITS-(shft))) : \
- (ishift_temp >> (shft)))
-#else
-#define ISHIFT_TEMPS
-#define IRIGHT_SHIFT(x,shft) ((x) >> (shft))
-#endif
-
-#ifdef USE_ACCURATE_ROUNDING
-#define IDESCALE(x,n) ((int) IRIGHT_SHIFT((x) + (1 << ((n)-1)), n))
-#else
-#define IDESCALE(x,n) ((int) IRIGHT_SHIFT(x, n))
-#endif
-
-
-/*
- * Perform dequantization and inverse DCT on one block of coefficients.
- */
-
-GLOBAL(void)
-jpeg_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr,
- JCOEFPTR coef_block,
- JSAMPARRAY output_buf, JDIMENSION output_col)
-{
- DCTELEM tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
- DCTELEM tmp10, tmp11, tmp12, tmp13;
- DCTELEM z5, z10, z11, z12, z13;
- JCOEFPTR inptr;
- IFAST_MULT_TYPE * quantptr;
- int * wsptr;
- JSAMPROW outptr;
- JSAMPLE *range_limit = IDCT_range_limit(cinfo);
- int ctr;
- int workspace[DCTSIZE2]; /* buffers data between passes */
- SHIFT_TEMPS /* for DESCALE */
- ISHIFT_TEMPS /* for IDESCALE */
-
- /* Pass 1: process columns from input, store into work array. */
-
- inptr = coef_block;
- quantptr = (IFAST_MULT_TYPE *) compptr->dct_table;
- wsptr = workspace;
- for (ctr = DCTSIZE; ctr > 0; ctr--) {
- /* Due to quantization, we will usually find that many of the input
- * coefficients are zero, especially the AC terms. We can exploit this
- * by short-circuiting the IDCT calculation for any column in which all
- * the AC terms are zero. In that case each output is equal to the
- * DC coefficient (with scale factor as needed).
- * With typical images and quantization tables, half or more of the
- * column DCT calculations can be simplified this way.
- */
-
- if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 &&
- inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 &&
- inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 &&
- inptr[DCTSIZE*7] == 0) {
- /* AC terms all zero */
- int dcval = (int) DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
-
- wsptr[DCTSIZE*0] = dcval;
- wsptr[DCTSIZE*1] = dcval;
- wsptr[DCTSIZE*2] = dcval;
- wsptr[DCTSIZE*3] = dcval;
- wsptr[DCTSIZE*4] = dcval;
- wsptr[DCTSIZE*5] = dcval;
- wsptr[DCTSIZE*6] = dcval;
- wsptr[DCTSIZE*7] = dcval;
-
- inptr++; /* advance pointers to next column */
- quantptr++;
- wsptr++;
- continue;
- }
-
- /* Even part */
-
- tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
- tmp1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
- tmp2 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);
- tmp3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);
-
- tmp10 = tmp0 + tmp2; /* phase 3 */
- tmp11 = tmp0 - tmp2;
-
- tmp13 = tmp1 + tmp3; /* phases 5-3 */
- tmp12 = MULTIPLY(tmp1 - tmp3, FIX_1_414213562) - tmp13; /* 2*c4 */
-
- tmp0 = tmp10 + tmp13; /* phase 2 */
- tmp3 = tmp10 - tmp13;
- tmp1 = tmp11 + tmp12;
- tmp2 = tmp11 - tmp12;
-
- /* Odd part */
-
- tmp4 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);
- tmp5 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);
- tmp6 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);
- tmp7 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);
-
- z13 = tmp6 + tmp5; /* phase 6 */
- z10 = tmp6 - tmp5;
- z11 = tmp4 + tmp7;
- z12 = tmp4 - tmp7;
-
- tmp7 = z11 + z13; /* phase 5 */
- tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562); /* 2*c4 */
-
- z5 = MULTIPLY(z10 + z12, FIX_1_847759065); /* 2*c2 */
- tmp10 = MULTIPLY(z12, FIX_1_082392200) - z5; /* 2*(c2-c6) */
- tmp12 = MULTIPLY(z10, - FIX_2_613125930) + z5; /* -2*(c2+c6) */
-
- tmp6 = tmp12 - tmp7; /* phase 2 */
- tmp5 = tmp11 - tmp6;
- tmp4 = tmp10 + tmp5;
-
- wsptr[DCTSIZE*0] = (int) (tmp0 + tmp7);
- wsptr[DCTSIZE*7] = (int) (tmp0 - tmp7);
- wsptr[DCTSIZE*1] = (int) (tmp1 + tmp6);
- wsptr[DCTSIZE*6] = (int) (tmp1 - tmp6);
- wsptr[DCTSIZE*2] = (int) (tmp2 + tmp5);
- wsptr[DCTSIZE*5] = (int) (tmp2 - tmp5);
- wsptr[DCTSIZE*4] = (int) (tmp3 + tmp4);
- wsptr[DCTSIZE*3] = (int) (tmp3 - tmp4);
-
- inptr++; /* advance pointers to next column */
- quantptr++;
- wsptr++;
- }
-
- /* Pass 2: process rows from work array, store into output array. */
- /* Note that we must descale the results by a factor of 8 == 2**3, */
- /* and also undo the PASS1_BITS scaling. */
-
- wsptr = workspace;
- for (ctr = 0; ctr < DCTSIZE; ctr++) {
- outptr = output_buf[ctr] + output_col;
- /* Rows of zeroes can be exploited in the same way as we did with columns.
- * However, the column calculation has created many nonzero AC terms, so
- * the simplification applies less often (typically 5% to 10% of the time).
- * On machines with very fast multiplication, it's possible that the
- * test takes more time than it's worth. In that case this section
- * may be commented out.
- */
-
-#ifndef NO_ZERO_ROW_TEST
- if (wsptr[1] == 0 && wsptr[2] == 0 && wsptr[3] == 0 && wsptr[4] == 0 &&
- wsptr[5] == 0 && wsptr[6] == 0 && wsptr[7] == 0) {
- /* AC terms all zero */
- JSAMPLE dcval = range_limit[IDESCALE(wsptr[0], PASS1_BITS+3)
- & RANGE_MASK];
-
- outptr[0] = dcval;
- outptr[1] = dcval;
- outptr[2] = dcval;
- outptr[3] = dcval;
- outptr[4] = dcval;
- outptr[5] = dcval;
- outptr[6] = dcval;
- outptr[7] = dcval;
-
- wsptr += DCTSIZE; /* advance pointer to next row */
- continue;
- }
-#endif
-
- /* Even part */
-
- tmp10 = ((DCTELEM) wsptr[0] + (DCTELEM) wsptr[4]);
- tmp11 = ((DCTELEM) wsptr[0] - (DCTELEM) wsptr[4]);
-
- tmp13 = ((DCTELEM) wsptr[2] + (DCTELEM) wsptr[6]);
- tmp12 = MULTIPLY((DCTELEM) wsptr[2] - (DCTELEM) wsptr[6], FIX_1_414213562)
- - tmp13;
-
- tmp0 = tmp10 + tmp13;
- tmp3 = tmp10 - tmp13;
- tmp1 = tmp11 + tmp12;
- tmp2 = tmp11 - tmp12;
-
- /* Odd part */
-
- z13 = (DCTELEM) wsptr[5] + (DCTELEM) wsptr[3];
- z10 = (DCTELEM) wsptr[5] - (DCTELEM) wsptr[3];
- z11 = (DCTELEM) wsptr[1] + (DCTELEM) wsptr[7];
- z12 = (DCTELEM) wsptr[1] - (DCTELEM) wsptr[7];
-
- tmp7 = z11 + z13; /* phase 5 */
- tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562); /* 2*c4 */
-
- z5 = MULTIPLY(z10 + z12, FIX_1_847759065); /* 2*c2 */
- tmp10 = MULTIPLY(z12, FIX_1_082392200) - z5; /* 2*(c2-c6) */
- tmp12 = MULTIPLY(z10, - FIX_2_613125930) + z5; /* -2*(c2+c6) */
-
- tmp6 = tmp12 - tmp7; /* phase 2 */
- tmp5 = tmp11 - tmp6;
- tmp4 = tmp10 + tmp5;
-
- /* Final output stage: scale down by a factor of 8 and range-limit */
-
- outptr[0] = range_limit[IDESCALE(tmp0 + tmp7, PASS1_BITS+3)
- & RANGE_MASK];
- outptr[7] = range_limit[IDESCALE(tmp0 - tmp7, PASS1_BITS+3)
- & RANGE_MASK];
- outptr[1] = range_limit[IDESCALE(tmp1 + tmp6, PASS1_BITS+3)
- & RANGE_MASK];
- outptr[6] = range_limit[IDESCALE(tmp1 - tmp6, PASS1_BITS+3)
- & RANGE_MASK];
- outptr[2] = range_limit[IDESCALE(tmp2 + tmp5, PASS1_BITS+3)
- & RANGE_MASK];
- outptr[5] = range_limit[IDESCALE(tmp2 - tmp5, PASS1_BITS+3)
- & RANGE_MASK];
- outptr[4] = range_limit[IDESCALE(tmp3 + tmp4, PASS1_BITS+3)
- & RANGE_MASK];
- outptr[3] = range_limit[IDESCALE(tmp3 - tmp4, PASS1_BITS+3)
- & RANGE_MASK];
-
- wsptr += DCTSIZE; /* advance pointer to next row */
- }
-}
-
-#endif /* DCT_IFAST_SUPPORTED */
-
-#endif //_FX_JPEG_TURBO_
+#if !defined(_FX_JPEG_TURBO_)
+/*
+ * jidctfst.c
+ *
+ * Copyright (C) 1994-1998, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains a fast, not so accurate integer implementation of the
+ * inverse DCT (Discrete Cosine Transform). In the IJG code, this routine
+ * must also perform dequantization of the input coefficients.
+ *
+ * A 2-D IDCT can be done by 1-D IDCT on each column followed by 1-D IDCT
+ * on each row (or vice versa, but it's more convenient to emit a row at
+ * a time). Direct algorithms are also available, but they are much more
+ * complex and seem not to be any faster when reduced to code.
+ *
+ * This implementation is based on Arai, Agui, and Nakajima's algorithm for
+ * scaled DCT. Their original paper (Trans. IEICE E-71(11):1095) is in
+ * Japanese, but the algorithm is described in the Pennebaker & Mitchell
+ * JPEG textbook (see REFERENCES section in file README). The following code
+ * is based directly on figure 4-8 in P&M.
+ * While an 8-point DCT cannot be done in less than 11 multiplies, it is
+ * possible to arrange the computation so that many of the multiplies are
+ * simple scalings of the final outputs. These multiplies can then be
+ * folded into the multiplications or divisions by the JPEG quantization
+ * table entries. The AA&N method leaves only 5 multiplies and 29 adds
+ * to be done in the DCT itself.
+ * The primary disadvantage of this method is that with fixed-point math,
+ * accuracy is lost due to imprecise representation of the scaled
+ * quantization values. The smaller the quantization table entry, the less
+ * precise the scaled value, so this implementation does worse with high-
+ * quality-setting files than with low-quality ones.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+#include "jdct.h" /* Private declarations for DCT subsystem */
+
+#ifdef DCT_IFAST_SUPPORTED
+
+
+/*
+ * This module is specialized to the case DCTSIZE = 8.
+ */
+
+#if DCTSIZE != 8
+ Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */
+#endif
+
+
+/* Scaling decisions are generally the same as in the LL&M algorithm;
+ * see jidctint.c for more details. However, we choose to descale
+ * (right shift) multiplication products as soon as they are formed,
+ * rather than carrying additional fractional bits into subsequent additions.
+ * This compromises accuracy slightly, but it lets us save a few shifts.
+ * More importantly, 16-bit arithmetic is then adequate (for 8-bit samples)
+ * everywhere except in the multiplications proper; this saves a good deal
+ * of work on 16-bit-int machines.
+ *
+ * The dequantized coefficients are not integers because the AA&N scaling
+ * factors have been incorporated. We represent them scaled up by PASS1_BITS,
+ * so that the first and second IDCT rounds have the same input scaling.
+ * For 8-bit JSAMPLEs, we choose IFAST_SCALE_BITS = PASS1_BITS so as to
+ * avoid a descaling shift; this compromises accuracy rather drastically
+ * for small quantization table entries, but it saves a lot of shifts.
+ * For 12-bit JSAMPLEs, there's no hope of using 16x16 multiplies anyway,
+ * so we use a much larger scaling factor to preserve accuracy.
+ *
+ * A final compromise is to represent the multiplicative constants to only
+ * 8 fractional bits, rather than 13. This saves some shifting work on some
+ * machines, and may also reduce the cost of multiplication (since there
+ * are fewer one-bits in the constants).
+ */
+
+#if BITS_IN_JSAMPLE == 8
+#define CONST_BITS 8
+#define PASS1_BITS 2
+#else
+#define CONST_BITS 8
+#define PASS1_BITS 1 /* lose a little precision to avoid overflow */
+#endif
+
+/* Some C compilers fail to reduce "FIX(constant)" at compile time, thus
+ * causing a lot of useless floating-point operations at run time.
+ * To get around this we use the following pre-calculated constants.
+ * If you change CONST_BITS you may want to add appropriate values.
+ * (With a reasonable C compiler, you can just rely on the FIX() macro...)
+ */
+
+#if CONST_BITS == 8
+#define FIX_1_082392200 ((INT32) 277) /* FIX(1.082392200) */
+#define FIX_1_414213562 ((INT32) 362) /* FIX(1.414213562) */
+#define FIX_1_847759065 ((INT32) 473) /* FIX(1.847759065) */
+#define FIX_2_613125930 ((INT32) 669) /* FIX(2.613125930) */
+#else
+#define FIX_1_082392200 FIX(1.082392200)
+#define FIX_1_414213562 FIX(1.414213562)
+#define FIX_1_847759065 FIX(1.847759065)
+#define FIX_2_613125930 FIX(2.613125930)
+#endif
+
+
+/* We can gain a little more speed, with a further compromise in accuracy,
+ * by omitting the addition in a descaling shift. This yields an incorrectly
+ * rounded result half the time...
+ */
+
+#ifndef USE_ACCURATE_ROUNDING
+#undef DESCALE
+#define DESCALE(x,n) RIGHT_SHIFT(x, n)
+#endif
+
+
+/* Multiply a DCTELEM variable by an INT32 constant, and immediately
+ * descale to yield a DCTELEM result.
+ */
+
+#define MULTIPLY(var,const) ((DCTELEM) DESCALE((var) * (const), CONST_BITS))
+
+
+/* Dequantize a coefficient by multiplying it by the multiplier-table
+ * entry; produce a DCTELEM result. For 8-bit data a 16x16->16
+ * multiplication will do. For 12-bit data, the multiplier table is
+ * declared INT32, so a 32-bit multiply will be used.
+ */
+
+#if BITS_IN_JSAMPLE == 8
+#define DEQUANTIZE(coef,quantval) (((IFAST_MULT_TYPE) (coef)) * (quantval))
+#else
+#define DEQUANTIZE(coef,quantval) \
+ DESCALE((coef)*(quantval), IFAST_SCALE_BITS-PASS1_BITS)
+#endif
+
+
+/* Like DESCALE, but applies to a DCTELEM and produces an int.
+ * We assume that int right shift is unsigned if INT32 right shift is.
+ */
+
+#ifdef RIGHT_SHIFT_IS_UNSIGNED
+#define ISHIFT_TEMPS DCTELEM ishift_temp;
+#if BITS_IN_JSAMPLE == 8
+#define DCTELEMBITS 16 /* DCTELEM may be 16 or 32 bits */
+#else
+#define DCTELEMBITS 32 /* DCTELEM must be 32 bits */
+#endif
+#define IRIGHT_SHIFT(x,shft) \
+ ((ishift_temp = (x)) < 0 ? \
+ (ishift_temp >> (shft)) | ((~((DCTELEM) 0)) << (DCTELEMBITS-(shft))) : \
+ (ishift_temp >> (shft)))
+#else
+#define ISHIFT_TEMPS
+#define IRIGHT_SHIFT(x,shft) ((x) >> (shft))
+#endif
+
+#ifdef USE_ACCURATE_ROUNDING
+#define IDESCALE(x,n) ((int) IRIGHT_SHIFT((x) + (1 << ((n)-1)), n))
+#else
+#define IDESCALE(x,n) ((int) IRIGHT_SHIFT(x, n))
+#endif
+
+
+/*
+ * Perform dequantization and inverse DCT on one block of coefficients.
+ */
+
+GLOBAL(void)
+jpeg_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr,
+ JCOEFPTR coef_block,
+ JSAMPARRAY output_buf, JDIMENSION output_col)
+{
+ DCTELEM tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
+ DCTELEM tmp10, tmp11, tmp12, tmp13;
+ DCTELEM z5, z10, z11, z12, z13;
+ JCOEFPTR inptr;
+ IFAST_MULT_TYPE * quantptr;
+ int * wsptr;
+ JSAMPROW outptr;
+ JSAMPLE *range_limit = IDCT_range_limit(cinfo);
+ int ctr;
+ int workspace[DCTSIZE2]; /* buffers data between passes */
+ SHIFT_TEMPS /* for DESCALE */
+ ISHIFT_TEMPS /* for IDESCALE */
+
+ /* Pass 1: process columns from input, store into work array. */
+
+ inptr = coef_block;
+ quantptr = (IFAST_MULT_TYPE *) compptr->dct_table;
+ wsptr = workspace;
+ for (ctr = DCTSIZE; ctr > 0; ctr--) {
+ /* Due to quantization, we will usually find that many of the input
+ * coefficients are zero, especially the AC terms. We can exploit this
+ * by short-circuiting the IDCT calculation for any column in which all
+ * the AC terms are zero. In that case each output is equal to the
+ * DC coefficient (with scale factor as needed).
+ * With typical images and quantization tables, half or more of the
+ * column DCT calculations can be simplified this way.
+ */
+
+ if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 &&
+ inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 &&
+ inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 &&
+ inptr[DCTSIZE*7] == 0) {
+ /* AC terms all zero */
+ int dcval = (int) DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
+
+ wsptr[DCTSIZE*0] = dcval;
+ wsptr[DCTSIZE*1] = dcval;
+ wsptr[DCTSIZE*2] = dcval;
+ wsptr[DCTSIZE*3] = dcval;
+ wsptr[DCTSIZE*4] = dcval;
+ wsptr[DCTSIZE*5] = dcval;
+ wsptr[DCTSIZE*6] = dcval;
+ wsptr[DCTSIZE*7] = dcval;
+
+ inptr++; /* advance pointers to next column */
+ quantptr++;
+ wsptr++;
+ continue;
+ }
+
+ /* Even part */
+
+ tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
+ tmp1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
+ tmp2 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);
+ tmp3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);
+
+ tmp10 = tmp0 + tmp2; /* phase 3 */
+ tmp11 = tmp0 - tmp2;
+
+ tmp13 = tmp1 + tmp3; /* phases 5-3 */
+ tmp12 = MULTIPLY(tmp1 - tmp3, FIX_1_414213562) - tmp13; /* 2*c4 */
+
+ tmp0 = tmp10 + tmp13; /* phase 2 */
+ tmp3 = tmp10 - tmp13;
+ tmp1 = tmp11 + tmp12;
+ tmp2 = tmp11 - tmp12;
+
+ /* Odd part */
+
+ tmp4 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);
+ tmp5 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);
+ tmp6 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);
+ tmp7 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);
+
+ z13 = tmp6 + tmp5; /* phase 6 */
+ z10 = tmp6 - tmp5;
+ z11 = tmp4 + tmp7;
+ z12 = tmp4 - tmp7;
+
+ tmp7 = z11 + z13; /* phase 5 */
+ tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562); /* 2*c4 */
+
+ z5 = MULTIPLY(z10 + z12, FIX_1_847759065); /* 2*c2 */
+ tmp10 = MULTIPLY(z12, FIX_1_082392200) - z5; /* 2*(c2-c6) */
+ tmp12 = MULTIPLY(z10, - FIX_2_613125930) + z5; /* -2*(c2+c6) */
+
+ tmp6 = tmp12 - tmp7; /* phase 2 */
+ tmp5 = tmp11 - tmp6;
+ tmp4 = tmp10 + tmp5;
+
+ wsptr[DCTSIZE*0] = (int) (tmp0 + tmp7);
+ wsptr[DCTSIZE*7] = (int) (tmp0 - tmp7);
+ wsptr[DCTSIZE*1] = (int) (tmp1 + tmp6);
+ wsptr[DCTSIZE*6] = (int) (tmp1 - tmp6);
+ wsptr[DCTSIZE*2] = (int) (tmp2 + tmp5);
+ wsptr[DCTSIZE*5] = (int) (tmp2 - tmp5);
+ wsptr[DCTSIZE*4] = (int) (tmp3 + tmp4);
+ wsptr[DCTSIZE*3] = (int) (tmp3 - tmp4);
+
+ inptr++; /* advance pointers to next column */
+ quantptr++;
+ wsptr++;
+ }
+
+ /* Pass 2: process rows from work array, store into output array. */
+ /* Note that we must descale the results by a factor of 8 == 2**3, */
+ /* and also undo the PASS1_BITS scaling. */
+
+ wsptr = workspace;
+ for (ctr = 0; ctr < DCTSIZE; ctr++) {
+ outptr = output_buf[ctr] + output_col;
+ /* Rows of zeroes can be exploited in the same way as we did with columns.
+ * However, the column calculation has created many nonzero AC terms, so
+ * the simplification applies less often (typically 5% to 10% of the time).
+ * On machines with very fast multiplication, it's possible that the
+ * test takes more time than it's worth. In that case this section
+ * may be commented out.
+ */
+
+#ifndef NO_ZERO_ROW_TEST
+ if (wsptr[1] == 0 && wsptr[2] == 0 && wsptr[3] == 0 && wsptr[4] == 0 &&
+ wsptr[5] == 0 && wsptr[6] == 0 && wsptr[7] == 0) {
+ /* AC terms all zero */
+ JSAMPLE dcval = range_limit[IDESCALE(wsptr[0], PASS1_BITS+3)
+ & RANGE_MASK];
+
+ outptr[0] = dcval;
+ outptr[1] = dcval;
+ outptr[2] = dcval;
+ outptr[3] = dcval;
+ outptr[4] = dcval;
+ outptr[5] = dcval;
+ outptr[6] = dcval;
+ outptr[7] = dcval;
+
+ wsptr += DCTSIZE; /* advance pointer to next row */
+ continue;
+ }
+#endif
+
+ /* Even part */
+
+ tmp10 = ((DCTELEM) wsptr[0] + (DCTELEM) wsptr[4]);
+ tmp11 = ((DCTELEM) wsptr[0] - (DCTELEM) wsptr[4]);
+
+ tmp13 = ((DCTELEM) wsptr[2] + (DCTELEM) wsptr[6]);
+ tmp12 = MULTIPLY((DCTELEM) wsptr[2] - (DCTELEM) wsptr[6], FIX_1_414213562)
+ - tmp13;
+
+ tmp0 = tmp10 + tmp13;
+ tmp3 = tmp10 - tmp13;
+ tmp1 = tmp11 + tmp12;
+ tmp2 = tmp11 - tmp12;
+
+ /* Odd part */
+
+ z13 = (DCTELEM) wsptr[5] + (DCTELEM) wsptr[3];
+ z10 = (DCTELEM) wsptr[5] - (DCTELEM) wsptr[3];
+ z11 = (DCTELEM) wsptr[1] + (DCTELEM) wsptr[7];
+ z12 = (DCTELEM) wsptr[1] - (DCTELEM) wsptr[7];
+
+ tmp7 = z11 + z13; /* phase 5 */
+ tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562); /* 2*c4 */
+
+ z5 = MULTIPLY(z10 + z12, FIX_1_847759065); /* 2*c2 */
+ tmp10 = MULTIPLY(z12, FIX_1_082392200) - z5; /* 2*(c2-c6) */
+ tmp12 = MULTIPLY(z10, - FIX_2_613125930) + z5; /* -2*(c2+c6) */
+
+ tmp6 = tmp12 - tmp7; /* phase 2 */
+ tmp5 = tmp11 - tmp6;
+ tmp4 = tmp10 + tmp5;
+
+ /* Final output stage: scale down by a factor of 8 and range-limit */
+
+ outptr[0] = range_limit[IDESCALE(tmp0 + tmp7, PASS1_BITS+3)
+ & RANGE_MASK];
+ outptr[7] = range_limit[IDESCALE(tmp0 - tmp7, PASS1_BITS+3)
+ & RANGE_MASK];
+ outptr[1] = range_limit[IDESCALE(tmp1 + tmp6, PASS1_BITS+3)
+ & RANGE_MASK];
+ outptr[6] = range_limit[IDESCALE(tmp1 - tmp6, PASS1_BITS+3)
+ & RANGE_MASK];
+ outptr[2] = range_limit[IDESCALE(tmp2 + tmp5, PASS1_BITS+3)
+ & RANGE_MASK];
+ outptr[5] = range_limit[IDESCALE(tmp2 - tmp5, PASS1_BITS+3)
+ & RANGE_MASK];
+ outptr[4] = range_limit[IDESCALE(tmp3 + tmp4, PASS1_BITS+3)
+ & RANGE_MASK];
+ outptr[3] = range_limit[IDESCALE(tmp3 - tmp4, PASS1_BITS+3)
+ & RANGE_MASK];
+
+ wsptr += DCTSIZE; /* advance pointer to next row */
+ }
+}
+
+#endif /* DCT_IFAST_SUPPORTED */
+
+#endif //_FX_JPEG_TURBO_
diff --git a/core/src/fxcodec/libjpeg/fpdfapi_jidctint.c b/core/src/fxcodec/libjpeg/fpdfapi_jidctint.c
index 82f5cc742a..78a8d66552 100644
--- a/core/src/fxcodec/libjpeg/fpdfapi_jidctint.c
+++ b/core/src/fxcodec/libjpeg/fpdfapi_jidctint.c
@@ -1,392 +1,392 @@
-#if !defined(_FX_JPEG_TURBO_)
-/*
- * jidctint.c
- *
- * Copyright (C) 1991-1998, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- * For conditions of distribution and use, see the accompanying README file.
- *
- * This file contains a slow-but-accurate integer implementation of the
- * inverse DCT (Discrete Cosine Transform). In the IJG code, this routine
- * must also perform dequantization of the input coefficients.
- *
- * A 2-D IDCT can be done by 1-D IDCT on each column followed by 1-D IDCT
- * on each row (or vice versa, but it's more convenient to emit a row at
- * a time). Direct algorithms are also available, but they are much more
- * complex and seem not to be any faster when reduced to code.
- *
- * This implementation is based on an algorithm described in
- * C. Loeffler, A. Ligtenberg and G. Moschytz, "Practical Fast 1-D DCT
- * Algorithms with 11 Multiplications", Proc. Int'l. Conf. on Acoustics,
- * Speech, and Signal Processing 1989 (ICASSP '89), pp. 988-991.
- * The primary algorithm described there uses 11 multiplies and 29 adds.
- * We use their alternate method with 12 multiplies and 32 adds.
- * The advantage of this method is that no data path contains more than one
- * multiplication; this allows a very simple and accurate implementation in
- * scaled fixed-point arithmetic, with a minimal number of shifts.
- */
-
-#define JPEG_INTERNALS
-#include "jinclude.h"
-#include "jpeglib.h"
-#include "jdct.h" /* Private declarations for DCT subsystem */
-
-#ifdef DCT_ISLOW_SUPPORTED
-
-
-/*
- * This module is specialized to the case DCTSIZE = 8.
- */
-
-#if DCTSIZE != 8
- Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */
-#endif
-
-
-/*
- * The poop on this scaling stuff is as follows:
- *
- * Each 1-D IDCT step produces outputs which are a factor of sqrt(N)
- * larger than the true IDCT outputs. The final outputs are therefore
- * a factor of N larger than desired; since N=8 this can be cured by
- * a simple right shift at the end of the algorithm. The advantage of
- * this arrangement is that we save two multiplications per 1-D IDCT,
- * because the y0 and y4 inputs need not be divided by sqrt(N).
- *
- * We have to do addition and subtraction of the integer inputs, which
- * is no problem, and multiplication by fractional constants, which is
- * a problem to do in integer arithmetic. We multiply all the constants
- * by CONST_SCALE and convert them to integer constants (thus retaining
- * CONST_BITS bits of precision in the constants). After doing a
- * multiplication we have to divide the product by CONST_SCALE, with proper
- * rounding, to produce the correct output. This division can be done
- * cheaply as a right shift of CONST_BITS bits. We postpone shifting
- * as long as possible so that partial sums can be added together with
- * full fractional precision.
- *
- * The outputs of the first pass are scaled up by PASS1_BITS bits so that
- * they are represented to better-than-integral precision. These outputs
- * require BITS_IN_JSAMPLE + PASS1_BITS + 3 bits; this fits in a 16-bit word
- * with the recommended scaling. (To scale up 12-bit sample data further, an
- * intermediate INT32 array would be needed.)
- *
- * To avoid overflow of the 32-bit intermediate results in pass 2, we must
- * have BITS_IN_JSAMPLE + CONST_BITS + PASS1_BITS <= 26. Error analysis
- * shows that the values given below are the most effective.
- */
-
-#if BITS_IN_JSAMPLE == 8
-#define CONST_BITS 13
-#define PASS1_BITS 2
-#else
-#define CONST_BITS 13
-#define PASS1_BITS 1 /* lose a little precision to avoid overflow */
-#endif
-
-/* Some C compilers fail to reduce "FIX(constant)" at compile time, thus
- * causing a lot of useless floating-point operations at run time.
- * To get around this we use the following pre-calculated constants.
- * If you change CONST_BITS you may want to add appropriate values.
- * (With a reasonable C compiler, you can just rely on the FIX() macro...)
- */
-
-#if CONST_BITS == 13
-#define FIX_0_298631336 ((INT32) 2446) /* FIX(0.298631336) */
-#define FIX_0_390180644 ((INT32) 3196) /* FIX(0.390180644) */
-#define FIX_0_541196100 ((INT32) 4433) /* FIX(0.541196100) */
-#define FIX_0_765366865 ((INT32) 6270) /* FIX(0.765366865) */
-#define FIX_0_899976223 ((INT32) 7373) /* FIX(0.899976223) */
-#define FIX_1_175875602 ((INT32) 9633) /* FIX(1.175875602) */
-#define FIX_1_501321110 ((INT32) 12299) /* FIX(1.501321110) */
-#define FIX_1_847759065 ((INT32) 15137) /* FIX(1.847759065) */
-#define FIX_1_961570560 ((INT32) 16069) /* FIX(1.961570560) */
-#define FIX_2_053119869 ((INT32) 16819) /* FIX(2.053119869) */
-#define FIX_2_562915447 ((INT32) 20995) /* FIX(2.562915447) */
-#define FIX_3_072711026 ((INT32) 25172) /* FIX(3.072711026) */
-#else
-#define FIX_0_298631336 FIX(0.298631336)
-#define FIX_0_390180644 FIX(0.390180644)
-#define FIX_0_541196100 FIX(0.541196100)
-#define FIX_0_765366865 FIX(0.765366865)
-#define FIX_0_899976223 FIX(0.899976223)
-#define FIX_1_175875602 FIX(1.175875602)
-#define FIX_1_501321110 FIX(1.501321110)
-#define FIX_1_847759065 FIX(1.847759065)
-#define FIX_1_961570560 FIX(1.961570560)
-#define FIX_2_053119869 FIX(2.053119869)
-#define FIX_2_562915447 FIX(2.562915447)
-#define FIX_3_072711026 FIX(3.072711026)
-#endif
-
-
-/* Multiply an INT32 variable by an INT32 constant to yield an INT32 result.
- * For 8-bit samples with the recommended scaling, all the variable
- * and constant values involved are no more than 16 bits wide, so a
- * 16x16->32 bit multiply can be used instead of a full 32x32 multiply.
- * For 12-bit samples, a full 32-bit multiplication will be needed.
- */
-
-#if BITS_IN_JSAMPLE == 8
-#define MULTIPLY(var,const) MULTIPLY16C16(var,const)
-#else
-#define MULTIPLY(var,const) ((var) * (const))
-#endif
-
-
-/* Dequantize a coefficient by multiplying it by the multiplier-table
- * entry; produce an int result. In this module, both inputs and result
- * are 16 bits or less, so either int or short multiply will work.
- */
-
-#define DEQUANTIZE(coef,quantval) (((ISLOW_MULT_TYPE) (coef)) * (quantval))
-
-
-/*
- * Perform dequantization and inverse DCT on one block of coefficients.
- */
-
-GLOBAL(void)
-jpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr,
- JCOEFPTR coef_block,
- JSAMPARRAY output_buf, JDIMENSION output_col)
-{
- INT32 tmp0, tmp1, tmp2, tmp3;
- INT32 tmp10, tmp11, tmp12, tmp13;
- INT32 z1, z2, z3, z4, z5;
- JCOEFPTR inptr;
- ISLOW_MULT_TYPE * quantptr;
- int * wsptr;
- JSAMPROW outptr;
- JSAMPLE *range_limit = IDCT_range_limit(cinfo);
- int ctr;
- int workspace[DCTSIZE2]; /* buffers data between passes */
- SHIFT_TEMPS
-
- /* Pass 1: process columns from input, store into work array. */
- /* Note results are scaled up by sqrt(8) compared to a true IDCT; */
- /* furthermore, we scale the results by 2**PASS1_BITS. */
-
- inptr = coef_block;
- quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;
- wsptr = workspace;
- for (ctr = DCTSIZE; ctr > 0; ctr--) {
- /* Due to quantization, we will usually find that many of the input
- * coefficients are zero, especially the AC terms. We can exploit this
- * by short-circuiting the IDCT calculation for any column in which all
- * the AC terms are zero. In that case each output is equal to the
- * DC coefficient (with scale factor as needed).
- * With typical images and quantization tables, half or more of the
- * column DCT calculations can be simplified this way.
- */
-
- if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 &&
- inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 &&
- inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 &&
- inptr[DCTSIZE*7] == 0) {
- /* AC terms all zero */
- int dcval = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) << PASS1_BITS;
-
- wsptr[DCTSIZE*0] = dcval;
- wsptr[DCTSIZE*1] = dcval;
- wsptr[DCTSIZE*2] = dcval;
- wsptr[DCTSIZE*3] = dcval;
- wsptr[DCTSIZE*4] = dcval;
- wsptr[DCTSIZE*5] = dcval;
- wsptr[DCTSIZE*6] = dcval;
- wsptr[DCTSIZE*7] = dcval;
-
- inptr++; /* advance pointers to next column */
- quantptr++;
- wsptr++;
- continue;
- }
-
- /* Even part: reverse the even part of the forward DCT. */
- /* The rotator is sqrt(2)*c(-6). */
-
- z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
- z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);
-
- z1 = MULTIPLY(z2 + z3, FIX_0_541196100);
- tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065);
- tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865);
-
- z2 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
- z3 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);
-
- tmp0 = (z2 + z3) << CONST_BITS;
- tmp1 = (z2 - z3) << CONST_BITS;
-
- tmp10 = tmp0 + tmp3;
- tmp13 = tmp0 - tmp3;
- tmp11 = tmp1 + tmp2;
- tmp12 = tmp1 - tmp2;
-
- /* Odd part per figure 8; the matrix is unitary and hence its
- * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively.
- */
-
- tmp0 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);
- tmp1 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);
- tmp2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);
- tmp3 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);
-
- z1 = tmp0 + tmp3;
- z2 = tmp1 + tmp2;
- z3 = tmp0 + tmp2;
- z4 = tmp1 + tmp3;
- z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */
-
- tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */
- tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */
- tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */
- tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */
- z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */
- z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */
- z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */
- z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */
-
- z3 += z5;
- z4 += z5;
-
- tmp0 += z1 + z3;
- tmp1 += z2 + z4;
- tmp2 += z2 + z3;
- tmp3 += z1 + z4;
-
- /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */
-
- wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp3, CONST_BITS-PASS1_BITS);
- wsptr[DCTSIZE*7] = (int) DESCALE(tmp10 - tmp3, CONST_BITS-PASS1_BITS);
- wsptr[DCTSIZE*1] = (int) DESCALE(tmp11 + tmp2, CONST_BITS-PASS1_BITS);
- wsptr[DCTSIZE*6] = (int) DESCALE(tmp11 - tmp2, CONST_BITS-PASS1_BITS);
- wsptr[DCTSIZE*2] = (int) DESCALE(tmp12 + tmp1, CONST_BITS-PASS1_BITS);
- wsptr[DCTSIZE*5] = (int) DESCALE(tmp12 - tmp1, CONST_BITS-PASS1_BITS);
- wsptr[DCTSIZE*3] = (int) DESCALE(tmp13 + tmp0, CONST_BITS-PASS1_BITS);
- wsptr[DCTSIZE*4] = (int) DESCALE(tmp13 - tmp0, CONST_BITS-PASS1_BITS);
-
- inptr++; /* advance pointers to next column */
- quantptr++;
- wsptr++;
- }
-
- /* Pass 2: process rows from work array, store into output array. */
- /* Note that we must descale the results by a factor of 8 == 2**3, */
- /* and also undo the PASS1_BITS scaling. */
-
- wsptr = workspace;
- for (ctr = 0; ctr < DCTSIZE; ctr++) {
- outptr = output_buf[ctr] + output_col;
- /* Rows of zeroes can be exploited in the same way as we did with columns.
- * However, the column calculation has created many nonzero AC terms, so
- * the simplification applies less often (typically 5% to 10% of the time).
- * On machines with very fast multiplication, it's possible that the
- * test takes more time than it's worth. In that case this section
- * may be commented out.
- */
-
-#ifndef NO_ZERO_ROW_TEST
- if (wsptr[1] == 0 && wsptr[2] == 0 && wsptr[3] == 0 && wsptr[4] == 0 &&
- wsptr[5] == 0 && wsptr[6] == 0 && wsptr[7] == 0) {
- /* AC terms all zero */
- JSAMPLE dcval = range_limit[(int) DESCALE((INT32) wsptr[0], PASS1_BITS+3)
- & RANGE_MASK];
-
- outptr[0] = dcval;
- outptr[1] = dcval;
- outptr[2] = dcval;
- outptr[3] = dcval;
- outptr[4] = dcval;
- outptr[5] = dcval;
- outptr[6] = dcval;
- outptr[7] = dcval;
-
- wsptr += DCTSIZE; /* advance pointer to next row */
- continue;
- }
-#endif
-
- /* Even part: reverse the even part of the forward DCT. */
- /* The rotator is sqrt(2)*c(-6). */
-
- z2 = (INT32) wsptr[2];
- z3 = (INT32) wsptr[6];
-
- z1 = MULTIPLY(z2 + z3, FIX_0_541196100);
- tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065);
- tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865);
-
- tmp0 = ((INT32) wsptr[0] + (INT32) wsptr[4]) << CONST_BITS;
- tmp1 = ((INT32) wsptr[0] - (INT32) wsptr[4]) << CONST_BITS;
-
- tmp10 = tmp0 + tmp3;
- tmp13 = tmp0 - tmp3;
- tmp11 = tmp1 + tmp2;
- tmp12 = tmp1 - tmp2;
-
- /* Odd part per figure 8; the matrix is unitary and hence its
- * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively.
- */
-
- tmp0 = (INT32) wsptr[7];
- tmp1 = (INT32) wsptr[5];
- tmp2 = (INT32) wsptr[3];
- tmp3 = (INT32) wsptr[1];
-
- z1 = tmp0 + tmp3;
- z2 = tmp1 + tmp2;
- z3 = tmp0 + tmp2;
- z4 = tmp1 + tmp3;
- z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */
-
- tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */
- tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */
- tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */
- tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */
- z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */
- z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */
- z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */
- z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */
-
- z3 += z5;
- z4 += z5;
-
- tmp0 += z1 + z3;
- tmp1 += z2 + z4;
- tmp2 += z2 + z3;
- tmp3 += z1 + z4;
-
- /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */
-
- outptr[0] = range_limit[(int) DESCALE(tmp10 + tmp3,
- CONST_BITS+PASS1_BITS+3)
- & RANGE_MASK];
- outptr[7] = range_limit[(int) DESCALE(tmp10 - tmp3,
- CONST_BITS+PASS1_BITS+3)
- & RANGE_MASK];
- outptr[1] = range_limit[(int) DESCALE(tmp11 + tmp2,
- CONST_BITS+PASS1_BITS+3)
- & RANGE_MASK];
- outptr[6] = range_limit[(int) DESCALE(tmp11 - tmp2,
- CONST_BITS+PASS1_BITS+3)
- & RANGE_MASK];
- outptr[2] = range_limit[(int) DESCALE(tmp12 + tmp1,
- CONST_BITS+PASS1_BITS+3)
- & RANGE_MASK];
- outptr[5] = range_limit[(int) DESCALE(tmp12 - tmp1,
- CONST_BITS+PASS1_BITS+3)
- & RANGE_MASK];
- outptr[3] = range_limit[(int) DESCALE(tmp13 + tmp0,
- CONST_BITS+PASS1_BITS+3)
- & RANGE_MASK];
- outptr[4] = range_limit[(int) DESCALE(tmp13 - tmp0,
- CONST_BITS+PASS1_BITS+3)
- & RANGE_MASK];
-
- wsptr += DCTSIZE; /* advance pointer to next row */
- }
-}
-
-#endif /* DCT_ISLOW_SUPPORTED */
-
-#endif //_FX_JPEG_TURBO_
+#if !defined(_FX_JPEG_TURBO_)
+/*
+ * jidctint.c
+ *
+ * Copyright (C) 1991-1998, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains a slow-but-accurate integer implementation of the
+ * inverse DCT (Discrete Cosine Transform). In the IJG code, this routine
+ * must also perform dequantization of the input coefficients.
+ *
+ * A 2-D IDCT can be done by 1-D IDCT on each column followed by 1-D IDCT
+ * on each row (or vice versa, but it's more convenient to emit a row at
+ * a time). Direct algorithms are also available, but they are much more
+ * complex and seem not to be any faster when reduced to code.
+ *
+ * This implementation is based on an algorithm described in
+ * C. Loeffler, A. Ligtenberg and G. Moschytz, "Practical Fast 1-D DCT
+ * Algorithms with 11 Multiplications", Proc. Int'l. Conf. on Acoustics,
+ * Speech, and Signal Processing 1989 (ICASSP '89), pp. 988-991.
+ * The primary algorithm described there uses 11 multiplies and 29 adds.
+ * We use their alternate method with 12 multiplies and 32 adds.
+ * The advantage of this method is that no data path contains more than one
+ * multiplication; this allows a very simple and accurate implementation in
+ * scaled fixed-point arithmetic, with a minimal number of shifts.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+#include "jdct.h" /* Private declarations for DCT subsystem */
+
+#ifdef DCT_ISLOW_SUPPORTED
+
+
+/*
+ * This module is specialized to the case DCTSIZE = 8.
+ */
+
+#if DCTSIZE != 8
+ Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */
+#endif
+
+
+/*
+ * The poop on this scaling stuff is as follows:
+ *
+ * Each 1-D IDCT step produces outputs which are a factor of sqrt(N)
+ * larger than the true IDCT outputs. The final outputs are therefore
+ * a factor of N larger than desired; since N=8 this can be cured by
+ * a simple right shift at the end of the algorithm. The advantage of
+ * this arrangement is that we save two multiplications per 1-D IDCT,
+ * because the y0 and y4 inputs need not be divided by sqrt(N).
+ *
+ * We have to do addition and subtraction of the integer inputs, which
+ * is no problem, and multiplication by fractional constants, which is
+ * a problem to do in integer arithmetic. We multiply all the constants
+ * by CONST_SCALE and convert them to integer constants (thus retaining
+ * CONST_BITS bits of precision in the constants). After doing a
+ * multiplication we have to divide the product by CONST_SCALE, with proper
+ * rounding, to produce the correct output. This division can be done
+ * cheaply as a right shift of CONST_BITS bits. We postpone shifting
+ * as long as possible so that partial sums can be added together with
+ * full fractional precision.
+ *
+ * The outputs of the first pass are scaled up by PASS1_BITS bits so that
+ * they are represented to better-than-integral precision. These outputs
+ * require BITS_IN_JSAMPLE + PASS1_BITS + 3 bits; this fits in a 16-bit word
+ * with the recommended scaling. (To scale up 12-bit sample data further, an
+ * intermediate INT32 array would be needed.)
+ *
+ * To avoid overflow of the 32-bit intermediate results in pass 2, we must
+ * have BITS_IN_JSAMPLE + CONST_BITS + PASS1_BITS <= 26. Error analysis
+ * shows that the values given below are the most effective.
+ */
+
+#if BITS_IN_JSAMPLE == 8
+#define CONST_BITS 13
+#define PASS1_BITS 2
+#else
+#define CONST_BITS 13
+#define PASS1_BITS 1 /* lose a little precision to avoid overflow */
+#endif
+
+/* Some C compilers fail to reduce "FIX(constant)" at compile time, thus
+ * causing a lot of useless floating-point operations at run time.
+ * To get around this we use the following pre-calculated constants.
+ * If you change CONST_BITS you may want to add appropriate values.
+ * (With a reasonable C compiler, you can just rely on the FIX() macro...)
+ */
+
+#if CONST_BITS == 13
+#define FIX_0_298631336 ((INT32) 2446) /* FIX(0.298631336) */
+#define FIX_0_390180644 ((INT32) 3196) /* FIX(0.390180644) */
+#define FIX_0_541196100 ((INT32) 4433) /* FIX(0.541196100) */
+#define FIX_0_765366865 ((INT32) 6270) /* FIX(0.765366865) */
+#define FIX_0_899976223 ((INT32) 7373) /* FIX(0.899976223) */
+#define FIX_1_175875602 ((INT32) 9633) /* FIX(1.175875602) */
+#define FIX_1_501321110 ((INT32) 12299) /* FIX(1.501321110) */
+#define FIX_1_847759065 ((INT32) 15137) /* FIX(1.847759065) */
+#define FIX_1_961570560 ((INT32) 16069) /* FIX(1.961570560) */
+#define FIX_2_053119869 ((INT32) 16819) /* FIX(2.053119869) */
+#define FIX_2_562915447 ((INT32) 20995) /* FIX(2.562915447) */
+#define FIX_3_072711026 ((INT32) 25172) /* FIX(3.072711026) */
+#else
+#define FIX_0_298631336 FIX(0.298631336)
+#define FIX_0_390180644 FIX(0.390180644)
+#define FIX_0_541196100 FIX(0.541196100)
+#define FIX_0_765366865 FIX(0.765366865)
+#define FIX_0_899976223 FIX(0.899976223)
+#define FIX_1_175875602 FIX(1.175875602)
+#define FIX_1_501321110 FIX(1.501321110)
+#define FIX_1_847759065 FIX(1.847759065)
+#define FIX_1_961570560 FIX(1.961570560)
+#define FIX_2_053119869 FIX(2.053119869)
+#define FIX_2_562915447 FIX(2.562915447)
+#define FIX_3_072711026 FIX(3.072711026)
+#endif
+
+
+/* Multiply an INT32 variable by an INT32 constant to yield an INT32 result.
+ * For 8-bit samples with the recommended scaling, all the variable
+ * and constant values involved are no more than 16 bits wide, so a
+ * 16x16->32 bit multiply can be used instead of a full 32x32 multiply.
+ * For 12-bit samples, a full 32-bit multiplication will be needed.
+ */
+
+#if BITS_IN_JSAMPLE == 8
+#define MULTIPLY(var,const) MULTIPLY16C16(var,const)
+#else
+#define MULTIPLY(var,const) ((var) * (const))
+#endif
+
+
+/* Dequantize a coefficient by multiplying it by the multiplier-table
+ * entry; produce an int result. In this module, both inputs and result
+ * are 16 bits or less, so either int or short multiply will work.
+ */
+
+#define DEQUANTIZE(coef,quantval) (((ISLOW_MULT_TYPE) (coef)) * (quantval))
+
+
+/*
+ * Perform dequantization and inverse DCT on one block of coefficients.
+ */
+
+GLOBAL(void)
+jpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr,
+ JCOEFPTR coef_block,
+ JSAMPARRAY output_buf, JDIMENSION output_col)
+{
+ INT32 tmp0, tmp1, tmp2, tmp3;
+ INT32 tmp10, tmp11, tmp12, tmp13;
+ INT32 z1, z2, z3, z4, z5;
+ JCOEFPTR inptr;
+ ISLOW_MULT_TYPE * quantptr;
+ int * wsptr;
+ JSAMPROW outptr;
+ JSAMPLE *range_limit = IDCT_range_limit(cinfo);
+ int ctr;
+ int workspace[DCTSIZE2]; /* buffers data between passes */
+ SHIFT_TEMPS
+
+ /* Pass 1: process columns from input, store into work array. */
+ /* Note results are scaled up by sqrt(8) compared to a true IDCT; */
+ /* furthermore, we scale the results by 2**PASS1_BITS. */
+
+ inptr = coef_block;
+ quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;
+ wsptr = workspace;
+ for (ctr = DCTSIZE; ctr > 0; ctr--) {
+ /* Due to quantization, we will usually find that many of the input
+ * coefficients are zero, especially the AC terms. We can exploit this
+ * by short-circuiting the IDCT calculation for any column in which all
+ * the AC terms are zero. In that case each output is equal to the
+ * DC coefficient (with scale factor as needed).
+ * With typical images and quantization tables, half or more of the
+ * column DCT calculations can be simplified this way.
+ */
+
+ if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 &&
+ inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 &&
+ inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 &&
+ inptr[DCTSIZE*7] == 0) {
+ /* AC terms all zero */
+ int dcval = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) << PASS1_BITS;
+
+ wsptr[DCTSIZE*0] = dcval;
+ wsptr[DCTSIZE*1] = dcval;
+ wsptr[DCTSIZE*2] = dcval;
+ wsptr[DCTSIZE*3] = dcval;
+ wsptr[DCTSIZE*4] = dcval;
+ wsptr[DCTSIZE*5] = dcval;
+ wsptr[DCTSIZE*6] = dcval;
+ wsptr[DCTSIZE*7] = dcval;
+
+ inptr++; /* advance pointers to next column */
+ quantptr++;
+ wsptr++;
+ continue;
+ }
+
+ /* Even part: reverse the even part of the forward DCT. */
+ /* The rotator is sqrt(2)*c(-6). */
+
+ z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
+ z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);
+
+ z1 = MULTIPLY(z2 + z3, FIX_0_541196100);
+ tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065);
+ tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865);
+
+ z2 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
+ z3 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);
+
+ tmp0 = (z2 + z3) << CONST_BITS;
+ tmp1 = (z2 - z3) << CONST_BITS;
+
+ tmp10 = tmp0 + tmp3;
+ tmp13 = tmp0 - tmp3;
+ tmp11 = tmp1 + tmp2;
+ tmp12 = tmp1 - tmp2;
+
+ /* Odd part per figure 8; the matrix is unitary and hence its
+ * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively.
+ */
+
+ tmp0 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);
+ tmp1 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);
+ tmp2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);
+ tmp3 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);
+
+ z1 = tmp0 + tmp3;
+ z2 = tmp1 + tmp2;
+ z3 = tmp0 + tmp2;
+ z4 = tmp1 + tmp3;
+ z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */
+
+ tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */
+ tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */
+ tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */
+ tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */
+ z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */
+ z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */
+ z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */
+ z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */
+
+ z3 += z5;
+ z4 += z5;
+
+ tmp0 += z1 + z3;
+ tmp1 += z2 + z4;
+ tmp2 += z2 + z3;
+ tmp3 += z1 + z4;
+
+ /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */
+
+ wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp3, CONST_BITS-PASS1_BITS);
+ wsptr[DCTSIZE*7] = (int) DESCALE(tmp10 - tmp3, CONST_BITS-PASS1_BITS);
+ wsptr[DCTSIZE*1] = (int) DESCALE(tmp11 + tmp2, CONST_BITS-PASS1_BITS);
+ wsptr[DCTSIZE*6] = (int) DESCALE(tmp11 - tmp2, CONST_BITS-PASS1_BITS);
+ wsptr[DCTSIZE*2] = (int) DESCALE(tmp12 + tmp1, CONST_BITS-PASS1_BITS);
+ wsptr[DCTSIZE*5] = (int) DESCALE(tmp12 - tmp1, CONST_BITS-PASS1_BITS);
+ wsptr[DCTSIZE*3] = (int) DESCALE(tmp13 + tmp0, CONST_BITS-PASS1_BITS);
+ wsptr[DCTSIZE*4] = (int) DESCALE(tmp13 - tmp0, CONST_BITS-PASS1_BITS);
+
+ inptr++; /* advance pointers to next column */
+ quantptr++;
+ wsptr++;
+ }
+
+ /* Pass 2: process rows from work array, store into output array. */
+ /* Note that we must descale the results by a factor of 8 == 2**3, */
+ /* and also undo the PASS1_BITS scaling. */
+
+ wsptr = workspace;
+ for (ctr = 0; ctr < DCTSIZE; ctr++) {
+ outptr = output_buf[ctr] + output_col;
+ /* Rows of zeroes can be exploited in the same way as we did with columns.
+ * However, the column calculation has created many nonzero AC terms, so
+ * the simplification applies less often (typically 5% to 10% of the time).
+ * On machines with very fast multiplication, it's possible that the
+ * test takes more time than it's worth. In that case this section
+ * may be commented out.
+ */
+
+#ifndef NO_ZERO_ROW_TEST
+ if (wsptr[1] == 0 && wsptr[2] == 0 && wsptr[3] == 0 && wsptr[4] == 0 &&
+ wsptr[5] == 0 && wsptr[6] == 0 && wsptr[7] == 0) {
+ /* AC terms all zero */
+ JSAMPLE dcval = range_limit[(int) DESCALE((INT32) wsptr[0], PASS1_BITS+3)
+ & RANGE_MASK];
+
+ outptr[0] = dcval;
+ outptr[1] = dcval;
+ outptr[2] = dcval;
+ outptr[3] = dcval;
+ outptr[4] = dcval;
+ outptr[5] = dcval;
+ outptr[6] = dcval;
+ outptr[7] = dcval;
+
+ wsptr += DCTSIZE; /* advance pointer to next row */
+ continue;
+ }
+#endif
+
+ /* Even part: reverse the even part of the forward DCT. */
+ /* The rotator is sqrt(2)*c(-6). */
+
+ z2 = (INT32) wsptr[2];
+ z3 = (INT32) wsptr[6];
+
+ z1 = MULTIPLY(z2 + z3, FIX_0_541196100);
+ tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065);
+ tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865);
+
+ tmp0 = ((INT32) wsptr[0] + (INT32) wsptr[4]) << CONST_BITS;
+ tmp1 = ((INT32) wsptr[0] - (INT32) wsptr[4]) << CONST_BITS;
+
+ tmp10 = tmp0 + tmp3;
+ tmp13 = tmp0 - tmp3;
+ tmp11 = tmp1 + tmp2;
+ tmp12 = tmp1 - tmp2;
+
+ /* Odd part per figure 8; the matrix is unitary and hence its
+ * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively.
+ */
+
+ tmp0 = (INT32) wsptr[7];
+ tmp1 = (INT32) wsptr[5];
+ tmp2 = (INT32) wsptr[3];
+ tmp3 = (INT32) wsptr[1];
+
+ z1 = tmp0 + tmp3;
+ z2 = tmp1 + tmp2;
+ z3 = tmp0 + tmp2;
+ z4 = tmp1 + tmp3;
+ z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */
+
+ tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */
+ tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */
+ tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */
+ tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */
+ z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */
+ z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */
+ z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */
+ z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */
+
+ z3 += z5;
+ z4 += z5;
+
+ tmp0 += z1 + z3;
+ tmp1 += z2 + z4;
+ tmp2 += z2 + z3;
+ tmp3 += z1 + z4;
+
+ /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */
+
+ outptr[0] = range_limit[(int) DESCALE(tmp10 + tmp3,
+ CONST_BITS+PASS1_BITS+3)
+ & RANGE_MASK];
+ outptr[7] = range_limit[(int) DESCALE(tmp10 - tmp3,
+ CONST_BITS+PASS1_BITS+3)
+ & RANGE_MASK];
+ outptr[1] = range_limit[(int) DESCALE(tmp11 + tmp2,
+ CONST_BITS+PASS1_BITS+3)
+ & RANGE_MASK];
+ outptr[6] = range_limit[(int) DESCALE(tmp11 - tmp2,
+ CONST_BITS+PASS1_BITS+3)
+ & RANGE_MASK];
+ outptr[2] = range_limit[(int) DESCALE(tmp12 + tmp1,
+ CONST_BITS+PASS1_BITS+3)
+ & RANGE_MASK];
+ outptr[5] = range_limit[(int) DESCALE(tmp12 - tmp1,
+ CONST_BITS+PASS1_BITS+3)
+ & RANGE_MASK];
+ outptr[3] = range_limit[(int) DESCALE(tmp13 + tmp0,
+ CONST_BITS+PASS1_BITS+3)
+ & RANGE_MASK];
+ outptr[4] = range_limit[(int) DESCALE(tmp13 - tmp0,
+ CONST_BITS+PASS1_BITS+3)
+ & RANGE_MASK];
+
+ wsptr += DCTSIZE; /* advance pointer to next row */
+ }
+}
+
+#endif /* DCT_ISLOW_SUPPORTED */
+
+#endif //_FX_JPEG_TURBO_
diff --git a/core/src/fxcodec/libjpeg/fpdfapi_jidctred.c b/core/src/fxcodec/libjpeg/fpdfapi_jidctred.c
index 7eb1d74afa..8b4b807192 100644
--- a/core/src/fxcodec/libjpeg/fpdfapi_jidctred.c
+++ b/core/src/fxcodec/libjpeg/fpdfapi_jidctred.c
@@ -1,401 +1,401 @@
-#if !defined(_FX_JPEG_TURBO_)
-/*
- * jidctred.c
- *
- * Copyright (C) 1994-1998, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- * For conditions of distribution and use, see the accompanying README file.
- *
- * This file contains inverse-DCT routines that produce reduced-size output:
- * either 4x4, 2x2, or 1x1 pixels from an 8x8 DCT block.
- *
- * The implementation is based on the Loeffler, Ligtenberg and Moschytz (LL&M)
- * algorithm used in jidctint.c. We simply replace each 8-to-8 1-D IDCT step
- * with an 8-to-4 step that produces the four averages of two adjacent outputs
- * (or an 8-to-2 step producing two averages of four outputs, for 2x2 output).
- * These steps were derived by computing the corresponding values at the end
- * of the normal LL&M code, then simplifying as much as possible.
- *
- * 1x1 is trivial: just take the DC coefficient divided by 8.
- *
- * See jidctint.c for additional comments.
- */
-
-#define JPEG_INTERNALS
-#include "jinclude.h"
-#include "jpeglib.h"
-#include "jdct.h" /* Private declarations for DCT subsystem */
-
-#ifdef IDCT_SCALING_SUPPORTED
-
-
-/*
- * This module is specialized to the case DCTSIZE = 8.
- */
-
-#if DCTSIZE != 8
- Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */
-#endif
-
-
-/* Scaling is the same as in jidctint.c. */
-
-#if BITS_IN_JSAMPLE == 8
-#define CONST_BITS 13
-#define PASS1_BITS 2
-#else
-#define CONST_BITS 13
-#define PASS1_BITS 1 /* lose a little precision to avoid overflow */
-#endif
-
-/* Some C compilers fail to reduce "FIX(constant)" at compile time, thus
- * causing a lot of useless floating-point operations at run time.
- * To get around this we use the following pre-calculated constants.
- * If you change CONST_BITS you may want to add appropriate values.
- * (With a reasonable C compiler, you can just rely on the FIX() macro...)
- */
-
-#if CONST_BITS == 13
-#define FIX_0_211164243 ((INT32) 1730) /* FIX(0.211164243) */
-#define FIX_0_509795579 ((INT32) 4176) /* FIX(0.509795579) */
-#define FIX_0_601344887 ((INT32) 4926) /* FIX(0.601344887) */
-#define FIX_0_720959822 ((INT32) 5906) /* FIX(0.720959822) */
-#define FIX_0_765366865 ((INT32) 6270) /* FIX(0.765366865) */
-#define FIX_0_850430095 ((INT32) 6967) /* FIX(0.850430095) */
-#define FIX_0_899976223 ((INT32) 7373) /* FIX(0.899976223) */
-#define FIX_1_061594337 ((INT32) 8697) /* FIX(1.061594337) */
-#define FIX_1_272758580 ((INT32) 10426) /* FIX(1.272758580) */
-#define FIX_1_451774981 ((INT32) 11893) /* FIX(1.451774981) */
-#define FIX_1_847759065 ((INT32) 15137) /* FIX(1.847759065) */
-#define FIX_2_172734803 ((INT32) 17799) /* FIX(2.172734803) */
-#define FIX_2_562915447 ((INT32) 20995) /* FIX(2.562915447) */
-#define FIX_3_624509785 ((INT32) 29692) /* FIX(3.624509785) */
-#else
-#define FIX_0_211164243 FIX(0.211164243)
-#define FIX_0_509795579 FIX(0.509795579)
-#define FIX_0_601344887 FIX(0.601344887)
-#define FIX_0_720959822 FIX(0.720959822)
-#define FIX_0_765366865 FIX(0.765366865)
-#define FIX_0_850430095 FIX(0.850430095)
-#define FIX_0_899976223 FIX(0.899976223)
-#define FIX_1_061594337 FIX(1.061594337)
-#define FIX_1_272758580 FIX(1.272758580)
-#define FIX_1_451774981 FIX(1.451774981)
-#define FIX_1_847759065 FIX(1.847759065)
-#define FIX_2_172734803 FIX(2.172734803)
-#define FIX_2_562915447 FIX(2.562915447)
-#define FIX_3_624509785 FIX(3.624509785)
-#endif
-
-
-/* Multiply an INT32 variable by an INT32 constant to yield an INT32 result.
- * For 8-bit samples with the recommended scaling, all the variable
- * and constant values involved are no more than 16 bits wide, so a
- * 16x16->32 bit multiply can be used instead of a full 32x32 multiply.
- * For 12-bit samples, a full 32-bit multiplication will be needed.
- */
-
-#if BITS_IN_JSAMPLE == 8
-#define MULTIPLY(var,const) MULTIPLY16C16(var,const)
-#else
-#define MULTIPLY(var,const) ((var) * (const))
-#endif
-
-
-/* Dequantize a coefficient by multiplying it by the multiplier-table
- * entry; produce an int result. In this module, both inputs and result
- * are 16 bits or less, so either int or short multiply will work.
- */
-
-#define DEQUANTIZE(coef,quantval) (((ISLOW_MULT_TYPE) (coef)) * (quantval))
-
-
-/*
- * Perform dequantization and inverse DCT on one block of coefficients,
- * producing a reduced-size 4x4 output block.
- */
-
-GLOBAL(void)
-jpeg_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
- JCOEFPTR coef_block,
- JSAMPARRAY output_buf, JDIMENSION output_col)
-{
- INT32 tmp0, tmp2, tmp10, tmp12;
- INT32 z1, z2, z3, z4;
- JCOEFPTR inptr;
- ISLOW_MULT_TYPE * quantptr;
- int * wsptr;
- JSAMPROW outptr;
- JSAMPLE *range_limit = IDCT_range_limit(cinfo);
- int ctr;
- int workspace[DCTSIZE*4]; /* buffers data between passes */
- SHIFT_TEMPS
-
- /* Pass 1: process columns from input, store into work array. */
-
- inptr = coef_block;
- quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;
- wsptr = workspace;
- for (ctr = DCTSIZE; ctr > 0; inptr++, quantptr++, wsptr++, ctr--) {
- /* Don't bother to process column 4, because second pass won't use it */
- if (ctr == DCTSIZE-4)
- continue;
- if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 &&
- inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*5] == 0 &&
- inptr[DCTSIZE*6] == 0 && inptr[DCTSIZE*7] == 0) {
- /* AC terms all zero; we need not examine term 4 for 4x4 output */
- int dcval = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) << PASS1_BITS;
-
- wsptr[DCTSIZE*0] = dcval;
- wsptr[DCTSIZE*1] = dcval;
- wsptr[DCTSIZE*2] = dcval;
- wsptr[DCTSIZE*3] = dcval;
-
- continue;
- }
-
- /* Even part */
-
- tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
- tmp0 <<= (CONST_BITS+1);
-
- z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
- z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);
-
- tmp2 = MULTIPLY(z2, FIX_1_847759065) + MULTIPLY(z3, - FIX_0_765366865);
-
- tmp10 = tmp0 + tmp2;
- tmp12 = tmp0 - tmp2;
-
- /* Odd part */
-
- z1 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);
- z2 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);
- z3 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);
- z4 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);
-
- tmp0 = MULTIPLY(z1, - FIX_0_211164243) /* sqrt(2) * (c3-c1) */
- + MULTIPLY(z2, FIX_1_451774981) /* sqrt(2) * (c3+c7) */
- + MULTIPLY(z3, - FIX_2_172734803) /* sqrt(2) * (-c1-c5) */
- + MULTIPLY(z4, FIX_1_061594337); /* sqrt(2) * (c5+c7) */
-
- tmp2 = MULTIPLY(z1, - FIX_0_509795579) /* sqrt(2) * (c7-c5) */
- + MULTIPLY(z2, - FIX_0_601344887) /* sqrt(2) * (c5-c1) */
- + MULTIPLY(z3, FIX_0_899976223) /* sqrt(2) * (c3-c7) */
- + MULTIPLY(z4, FIX_2_562915447); /* sqrt(2) * (c1+c3) */
-
- /* Final output stage */
-
- wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp2, CONST_BITS-PASS1_BITS+1);
- wsptr[DCTSIZE*3] = (int) DESCALE(tmp10 - tmp2, CONST_BITS-PASS1_BITS+1);
- wsptr[DCTSIZE*1] = (int) DESCALE(tmp12 + tmp0, CONST_BITS-PASS1_BITS+1);
- wsptr[DCTSIZE*2] = (int) DESCALE(tmp12 - tmp0, CONST_BITS-PASS1_BITS+1);
- }
-
- /* Pass 2: process 4 rows from work array, store into output array. */
-
- wsptr = workspace;
- for (ctr = 0; ctr < 4; ctr++) {
- outptr = output_buf[ctr] + output_col;
- /* It's not clear whether a zero row test is worthwhile here ... */
-
-#ifndef NO_ZERO_ROW_TEST
- if (wsptr[1] == 0 && wsptr[2] == 0 && wsptr[3] == 0 &&
- wsptr[5] == 0 && wsptr[6] == 0 && wsptr[7] == 0) {
- /* AC terms all zero */
- JSAMPLE dcval = range_limit[(int) DESCALE((INT32) wsptr[0], PASS1_BITS+3)
- & RANGE_MASK];
-
- outptr[0] = dcval;
- outptr[1] = dcval;
- outptr[2] = dcval;
- outptr[3] = dcval;
-
- wsptr += DCTSIZE; /* advance pointer to next row */
- continue;
- }
-#endif
-
- /* Even part */
-
- tmp0 = ((INT32) wsptr[0]) << (CONST_BITS+1);
-
- tmp2 = MULTIPLY((INT32) wsptr[2], FIX_1_847759065)
- + MULTIPLY((INT32) wsptr[6], - FIX_0_765366865);
-
- tmp10 = tmp0 + tmp2;
- tmp12 = tmp0 - tmp2;
-
- /* Odd part */
-
- z1 = (INT32) wsptr[7];
- z2 = (INT32) wsptr[5];
- z3 = (INT32) wsptr[3];
- z4 = (INT32) wsptr[1];
-
- tmp0 = MULTIPLY(z1, - FIX_0_211164243) /* sqrt(2) * (c3-c1) */
- + MULTIPLY(z2, FIX_1_451774981) /* sqrt(2) * (c3+c7) */
- + MULTIPLY(z3, - FIX_2_172734803) /* sqrt(2) * (-c1-c5) */
- + MULTIPLY(z4, FIX_1_061594337); /* sqrt(2) * (c5+c7) */
-
- tmp2 = MULTIPLY(z1, - FIX_0_509795579) /* sqrt(2) * (c7-c5) */
- + MULTIPLY(z2, - FIX_0_601344887) /* sqrt(2) * (c5-c1) */
- + MULTIPLY(z3, FIX_0_899976223) /* sqrt(2) * (c3-c7) */
- + MULTIPLY(z4, FIX_2_562915447); /* sqrt(2) * (c1+c3) */
-
- /* Final output stage */
-
- outptr[0] = range_limit[(int) DESCALE(tmp10 + tmp2,
- CONST_BITS+PASS1_BITS+3+1)
- & RANGE_MASK];
- outptr[3] = range_limit[(int) DESCALE(tmp10 - tmp2,
- CONST_BITS+PASS1_BITS+3+1)
- & RANGE_MASK];
- outptr[1] = range_limit[(int) DESCALE(tmp12 + tmp0,
- CONST_BITS+PASS1_BITS+3+1)
- & RANGE_MASK];
- outptr[2] = range_limit[(int) DESCALE(tmp12 - tmp0,
- CONST_BITS+PASS1_BITS+3+1)
- & RANGE_MASK];
-
- wsptr += DCTSIZE; /* advance pointer to next row */
- }
-}
-
-
-/*
- * Perform dequantization and inverse DCT on one block of coefficients,
- * producing a reduced-size 2x2 output block.
- */
-
-GLOBAL(void)
-jpeg_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
- JCOEFPTR coef_block,
- JSAMPARRAY output_buf, JDIMENSION output_col)
-{
- INT32 tmp0, tmp10, z1;
- JCOEFPTR inptr;
- ISLOW_MULT_TYPE * quantptr;
- int * wsptr;
- JSAMPROW outptr;
- JSAMPLE *range_limit = IDCT_range_limit(cinfo);
- int ctr;
- int workspace[DCTSIZE*2]; /* buffers data between passes */
- SHIFT_TEMPS
-
- /* Pass 1: process columns from input, store into work array. */
-
- inptr = coef_block;
- quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;
- wsptr = workspace;
- for (ctr = DCTSIZE; ctr > 0; inptr++, quantptr++, wsptr++, ctr--) {
- /* Don't bother to process columns 2,4,6 */
- if (ctr == DCTSIZE-2 || ctr == DCTSIZE-4 || ctr == DCTSIZE-6)
- continue;
- if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*3] == 0 &&
- inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*7] == 0) {
- /* AC terms all zero; we need not examine terms 2,4,6 for 2x2 output */
- int dcval = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) << PASS1_BITS;
-
- wsptr[DCTSIZE*0] = dcval;
- wsptr[DCTSIZE*1] = dcval;
-
- continue;
- }
-
- /* Even part */
-
- z1 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
- tmp10 = z1 << (CONST_BITS+2);
-
- /* Odd part */
-
- z1 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);
- tmp0 = MULTIPLY(z1, - FIX_0_720959822); /* sqrt(2) * (c7-c5+c3-c1) */
- z1 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);
- tmp0 += MULTIPLY(z1, FIX_0_850430095); /* sqrt(2) * (-c1+c3+c5+c7) */
- z1 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);
- tmp0 += MULTIPLY(z1, - FIX_1_272758580); /* sqrt(2) * (-c1+c3-c5-c7) */
- z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);
- tmp0 += MULTIPLY(z1, FIX_3_624509785); /* sqrt(2) * (c1+c3+c5+c7) */
-
- /* Final output stage */
-
- wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp0, CONST_BITS-PASS1_BITS+2);
- wsptr[DCTSIZE*1] = (int) DESCALE(tmp10 - tmp0, CONST_BITS-PASS1_BITS+2);
- }
-
- /* Pass 2: process 2 rows from work array, store into output array. */
-
- wsptr = workspace;
- for (ctr = 0; ctr < 2; ctr++) {
- outptr = output_buf[ctr] + output_col;
- /* It's not clear whether a zero row test is worthwhile here ... */
-
-#ifndef NO_ZERO_ROW_TEST
- if (wsptr[1] == 0 && wsptr[3] == 0 && wsptr[5] == 0 && wsptr[7] == 0) {
- /* AC terms all zero */
- JSAMPLE dcval = range_limit[(int) DESCALE((INT32) wsptr[0], PASS1_BITS+3)
- & RANGE_MASK];
-
- outptr[0] = dcval;
- outptr[1] = dcval;
-
- wsptr += DCTSIZE; /* advance pointer to next row */
- continue;
- }
-#endif
-
- /* Even part */
-
- tmp10 = ((INT32) wsptr[0]) << (CONST_BITS+2);
-
- /* Odd part */
-
- tmp0 = MULTIPLY((INT32) wsptr[7], - FIX_0_720959822) /* sqrt(2) * (c7-c5+c3-c1) */
- + MULTIPLY((INT32) wsptr[5], FIX_0_850430095) /* sqrt(2) * (-c1+c3+c5+c7) */
- + MULTIPLY((INT32) wsptr[3], - FIX_1_272758580) /* sqrt(2) * (-c1+c3-c5-c7) */
- + MULTIPLY((INT32) wsptr[1], FIX_3_624509785); /* sqrt(2) * (c1+c3+c5+c7) */
-
- /* Final output stage */
-
- outptr[0] = range_limit[(int) DESCALE(tmp10 + tmp0,
- CONST_BITS+PASS1_BITS+3+2)
- & RANGE_MASK];
- outptr[1] = range_limit[(int) DESCALE(tmp10 - tmp0,
- CONST_BITS+PASS1_BITS+3+2)
- & RANGE_MASK];
-
- wsptr += DCTSIZE; /* advance pointer to next row */
- }
-}
-
-
-/*
- * Perform dequantization and inverse DCT on one block of coefficients,
- * producing a reduced-size 1x1 output block.
- */
-
-GLOBAL(void)
-jpeg_idct_1x1 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
- JCOEFPTR coef_block,
- JSAMPARRAY output_buf, JDIMENSION output_col)
-{
- int dcval;
- ISLOW_MULT_TYPE * quantptr;
- JSAMPLE *range_limit = IDCT_range_limit(cinfo);
- SHIFT_TEMPS
-
- /* We hardly need an inverse DCT routine for this: just take the
- * average pixel value, which is one-eighth of the DC coefficient.
- */
- quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;
- dcval = DEQUANTIZE(coef_block[0], quantptr[0]);
- dcval = (int) DESCALE((INT32) dcval, 3);
-
- output_buf[0][output_col] = range_limit[dcval & RANGE_MASK];
-}
-
-#endif /* IDCT_SCALING_SUPPORTED */
-
-#endif //_FX_JPEG_TURBO_
+#if !defined(_FX_JPEG_TURBO_)
+/*
+ * jidctred.c
+ *
+ * Copyright (C) 1994-1998, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains inverse-DCT routines that produce reduced-size output:
+ * either 4x4, 2x2, or 1x1 pixels from an 8x8 DCT block.
+ *
+ * The implementation is based on the Loeffler, Ligtenberg and Moschytz (LL&M)
+ * algorithm used in jidctint.c. We simply replace each 8-to-8 1-D IDCT step
+ * with an 8-to-4 step that produces the four averages of two adjacent outputs
+ * (or an 8-to-2 step producing two averages of four outputs, for 2x2 output).
+ * These steps were derived by computing the corresponding values at the end
+ * of the normal LL&M code, then simplifying as much as possible.
+ *
+ * 1x1 is trivial: just take the DC coefficient divided by 8.
+ *
+ * See jidctint.c for additional comments.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+#include "jdct.h" /* Private declarations for DCT subsystem */
+
+#ifdef IDCT_SCALING_SUPPORTED
+
+
+/*
+ * This module is specialized to the case DCTSIZE = 8.
+ */
+
+#if DCTSIZE != 8
+ Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */
+#endif
+
+
+/* Scaling is the same as in jidctint.c. */
+
+#if BITS_IN_JSAMPLE == 8
+#define CONST_BITS 13
+#define PASS1_BITS 2
+#else
+#define CONST_BITS 13
+#define PASS1_BITS 1 /* lose a little precision to avoid overflow */
+#endif
+
+/* Some C compilers fail to reduce "FIX(constant)" at compile time, thus
+ * causing a lot of useless floating-point operations at run time.
+ * To get around this we use the following pre-calculated constants.
+ * If you change CONST_BITS you may want to add appropriate values.
+ * (With a reasonable C compiler, you can just rely on the FIX() macro...)
+ */
+
+#if CONST_BITS == 13
+#define FIX_0_211164243 ((INT32) 1730) /* FIX(0.211164243) */
+#define FIX_0_509795579 ((INT32) 4176) /* FIX(0.509795579) */
+#define FIX_0_601344887 ((INT32) 4926) /* FIX(0.601344887) */
+#define FIX_0_720959822 ((INT32) 5906) /* FIX(0.720959822) */
+#define FIX_0_765366865 ((INT32) 6270) /* FIX(0.765366865) */
+#define FIX_0_850430095 ((INT32) 6967) /* FIX(0.850430095) */
+#define FIX_0_899976223 ((INT32) 7373) /* FIX(0.899976223) */
+#define FIX_1_061594337 ((INT32) 8697) /* FIX(1.061594337) */
+#define FIX_1_272758580 ((INT32) 10426) /* FIX(1.272758580) */
+#define FIX_1_451774981 ((INT32) 11893) /* FIX(1.451774981) */
+#define FIX_1_847759065 ((INT32) 15137) /* FIX(1.847759065) */
+#define FIX_2_172734803 ((INT32) 17799) /* FIX(2.172734803) */
+#define FIX_2_562915447 ((INT32) 20995) /* FIX(2.562915447) */
+#define FIX_3_624509785 ((INT32) 29692) /* FIX(3.624509785) */
+#else
+#define FIX_0_211164243 FIX(0.211164243)
+#define FIX_0_509795579 FIX(0.509795579)
+#define FIX_0_601344887 FIX(0.601344887)
+#define FIX_0_720959822 FIX(0.720959822)
+#define FIX_0_765366865 FIX(0.765366865)
+#define FIX_0_850430095 FIX(0.850430095)
+#define FIX_0_899976223 FIX(0.899976223)
+#define FIX_1_061594337 FIX(1.061594337)
+#define FIX_1_272758580 FIX(1.272758580)
+#define FIX_1_451774981 FIX(1.451774981)
+#define FIX_1_847759065 FIX(1.847759065)
+#define FIX_2_172734803 FIX(2.172734803)
+#define FIX_2_562915447 FIX(2.562915447)
+#define FIX_3_624509785 FIX(3.624509785)
+#endif
+
+
+/* Multiply an INT32 variable by an INT32 constant to yield an INT32 result.
+ * For 8-bit samples with the recommended scaling, all the variable
+ * and constant values involved are no more than 16 bits wide, so a
+ * 16x16->32 bit multiply can be used instead of a full 32x32 multiply.
+ * For 12-bit samples, a full 32-bit multiplication will be needed.
+ */
+
+#if BITS_IN_JSAMPLE == 8
+#define MULTIPLY(var,const) MULTIPLY16C16(var,const)
+#else
+#define MULTIPLY(var,const) ((var) * (const))
+#endif
+
+
+/* Dequantize a coefficient by multiplying it by the multiplier-table
+ * entry; produce an int result. In this module, both inputs and result
+ * are 16 bits or less, so either int or short multiply will work.
+ */
+
+#define DEQUANTIZE(coef,quantval) (((ISLOW_MULT_TYPE) (coef)) * (quantval))
+
+
+/*
+ * Perform dequantization and inverse DCT on one block of coefficients,
+ * producing a reduced-size 4x4 output block.
+ */
+
+GLOBAL(void)
+jpeg_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
+ JCOEFPTR coef_block,
+ JSAMPARRAY output_buf, JDIMENSION output_col)
+{
+ INT32 tmp0, tmp2, tmp10, tmp12;
+ INT32 z1, z2, z3, z4;
+ JCOEFPTR inptr;
+ ISLOW_MULT_TYPE * quantptr;
+ int * wsptr;
+ JSAMPROW outptr;
+ JSAMPLE *range_limit = IDCT_range_limit(cinfo);
+ int ctr;
+ int workspace[DCTSIZE*4]; /* buffers data between passes */
+ SHIFT_TEMPS
+
+ /* Pass 1: process columns from input, store into work array. */
+
+ inptr = coef_block;
+ quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;
+ wsptr = workspace;
+ for (ctr = DCTSIZE; ctr > 0; inptr++, quantptr++, wsptr++, ctr--) {
+ /* Don't bother to process column 4, because second pass won't use it */
+ if (ctr == DCTSIZE-4)
+ continue;
+ if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 &&
+ inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*5] == 0 &&
+ inptr[DCTSIZE*6] == 0 && inptr[DCTSIZE*7] == 0) {
+ /* AC terms all zero; we need not examine term 4 for 4x4 output */
+ int dcval = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) << PASS1_BITS;
+
+ wsptr[DCTSIZE*0] = dcval;
+ wsptr[DCTSIZE*1] = dcval;
+ wsptr[DCTSIZE*2] = dcval;
+ wsptr[DCTSIZE*3] = dcval;
+
+ continue;
+ }
+
+ /* Even part */
+
+ tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
+ tmp0 <<= (CONST_BITS+1);
+
+ z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
+ z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);
+
+ tmp2 = MULTIPLY(z2, FIX_1_847759065) + MULTIPLY(z3, - FIX_0_765366865);
+
+ tmp10 = tmp0 + tmp2;
+ tmp12 = tmp0 - tmp2;
+
+ /* Odd part */
+
+ z1 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);
+ z2 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);
+ z3 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);
+ z4 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);
+
+ tmp0 = MULTIPLY(z1, - FIX_0_211164243) /* sqrt(2) * (c3-c1) */
+ + MULTIPLY(z2, FIX_1_451774981) /* sqrt(2) * (c3+c7) */
+ + MULTIPLY(z3, - FIX_2_172734803) /* sqrt(2) * (-c1-c5) */
+ + MULTIPLY(z4, FIX_1_061594337); /* sqrt(2) * (c5+c7) */
+
+ tmp2 = MULTIPLY(z1, - FIX_0_509795579) /* sqrt(2) * (c7-c5) */
+ + MULTIPLY(z2, - FIX_0_601344887) /* sqrt(2) * (c5-c1) */
+ + MULTIPLY(z3, FIX_0_899976223) /* sqrt(2) * (c3-c7) */
+ + MULTIPLY(z4, FIX_2_562915447); /* sqrt(2) * (c1+c3) */
+
+ /* Final output stage */
+
+ wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp2, CONST_BITS-PASS1_BITS+1);
+ wsptr[DCTSIZE*3] = (int) DESCALE(tmp10 - tmp2, CONST_BITS-PASS1_BITS+1);
+ wsptr[DCTSIZE*1] = (int) DESCALE(tmp12 + tmp0, CONST_BITS-PASS1_BITS+1);
+ wsptr[DCTSIZE*2] = (int) DESCALE(tmp12 - tmp0, CONST_BITS-PASS1_BITS+1);
+ }
+
+ /* Pass 2: process 4 rows from work array, store into output array. */
+
+ wsptr = workspace;
+ for (ctr = 0; ctr < 4; ctr++) {
+ outptr = output_buf[ctr] + output_col;
+ /* It's not clear whether a zero row test is worthwhile here ... */
+
+#ifndef NO_ZERO_ROW_TEST
+ if (wsptr[1] == 0 && wsptr[2] == 0 && wsptr[3] == 0 &&
+ wsptr[5] == 0 && wsptr[6] == 0 && wsptr[7] == 0) {
+ /* AC terms all zero */
+ JSAMPLE dcval = range_limit[(int) DESCALE((INT32) wsptr[0], PASS1_BITS+3)
+ & RANGE_MASK];
+
+ outptr[0] = dcval;
+ outptr[1] = dcval;
+ outptr[2] = dcval;
+ outptr[3] = dcval;
+
+ wsptr += DCTSIZE; /* advance pointer to next row */
+ continue;
+ }
+#endif
+
+ /* Even part */
+
+ tmp0 = ((INT32) wsptr[0]) << (CONST_BITS+1);
+
+ tmp2 = MULTIPLY((INT32) wsptr[2], FIX_1_847759065)
+ + MULTIPLY((INT32) wsptr[6], - FIX_0_765366865);
+
+ tmp10 = tmp0 + tmp2;
+ tmp12 = tmp0 - tmp2;
+
+ /* Odd part */
+
+ z1 = (INT32) wsptr[7];
+ z2 = (INT32) wsptr[5];
+ z3 = (INT32) wsptr[3];
+ z4 = (INT32) wsptr[1];
+
+ tmp0 = MULTIPLY(z1, - FIX_0_211164243) /* sqrt(2) * (c3-c1) */
+ + MULTIPLY(z2, FIX_1_451774981) /* sqrt(2) * (c3+c7) */
+ + MULTIPLY(z3, - FIX_2_172734803) /* sqrt(2) * (-c1-c5) */
+ + MULTIPLY(z4, FIX_1_061594337); /* sqrt(2) * (c5+c7) */
+
+ tmp2 = MULTIPLY(z1, - FIX_0_509795579) /* sqrt(2) * (c7-c5) */
+ + MULTIPLY(z2, - FIX_0_601344887) /* sqrt(2) * (c5-c1) */
+ + MULTIPLY(z3, FIX_0_899976223) /* sqrt(2) * (c3-c7) */
+ + MULTIPLY(z4, FIX_2_562915447); /* sqrt(2) * (c1+c3) */
+
+ /* Final output stage */
+
+ outptr[0] = range_limit[(int) DESCALE(tmp10 + tmp2,
+ CONST_BITS+PASS1_BITS+3+1)
+ & RANGE_MASK];
+ outptr[3] = range_limit[(int) DESCALE(tmp10 - tmp2,
+ CONST_BITS+PASS1_BITS+3+1)
+ & RANGE_MASK];
+ outptr[1] = range_limit[(int) DESCALE(tmp12 + tmp0,
+ CONST_BITS+PASS1_BITS+3+1)
+ & RANGE_MASK];
+ outptr[2] = range_limit[(int) DESCALE(tmp12 - tmp0,
+ CONST_BITS+PASS1_BITS+3+1)
+ & RANGE_MASK];
+
+ wsptr += DCTSIZE; /* advance pointer to next row */
+ }
+}
+
+
+/*
+ * Perform dequantization and inverse DCT on one block of coefficients,
+ * producing a reduced-size 2x2 output block.
+ */
+
+GLOBAL(void)
+jpeg_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
+ JCOEFPTR coef_block,
+ JSAMPARRAY output_buf, JDIMENSION output_col)
+{
+ INT32 tmp0, tmp10, z1;
+ JCOEFPTR inptr;
+ ISLOW_MULT_TYPE * quantptr;
+ int * wsptr;
+ JSAMPROW outptr;
+ JSAMPLE *range_limit = IDCT_range_limit(cinfo);
+ int ctr;
+ int workspace[DCTSIZE*2]; /* buffers data between passes */
+ SHIFT_TEMPS
+
+ /* Pass 1: process columns from input, store into work array. */
+
+ inptr = coef_block;
+ quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;
+ wsptr = workspace;
+ for (ctr = DCTSIZE; ctr > 0; inptr++, quantptr++, wsptr++, ctr--) {
+ /* Don't bother to process columns 2,4,6 */
+ if (ctr == DCTSIZE-2 || ctr == DCTSIZE-4 || ctr == DCTSIZE-6)
+ continue;
+ if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*3] == 0 &&
+ inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*7] == 0) {
+ /* AC terms all zero; we need not examine terms 2,4,6 for 2x2 output */
+ int dcval = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) << PASS1_BITS;
+
+ wsptr[DCTSIZE*0] = dcval;
+ wsptr[DCTSIZE*1] = dcval;
+
+ continue;
+ }
+
+ /* Even part */
+
+ z1 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
+ tmp10 = z1 << (CONST_BITS+2);
+
+ /* Odd part */
+
+ z1 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);
+ tmp0 = MULTIPLY(z1, - FIX_0_720959822); /* sqrt(2) * (c7-c5+c3-c1) */
+ z1 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);
+ tmp0 += MULTIPLY(z1, FIX_0_850430095); /* sqrt(2) * (-c1+c3+c5+c7) */
+ z1 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);
+ tmp0 += MULTIPLY(z1, - FIX_1_272758580); /* sqrt(2) * (-c1+c3-c5-c7) */
+ z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);
+ tmp0 += MULTIPLY(z1, FIX_3_624509785); /* sqrt(2) * (c1+c3+c5+c7) */
+
+ /* Final output stage */
+
+ wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp0, CONST_BITS-PASS1_BITS+2);
+ wsptr[DCTSIZE*1] = (int) DESCALE(tmp10 - tmp0, CONST_BITS-PASS1_BITS+2);
+ }
+
+ /* Pass 2: process 2 rows from work array, store into output array. */
+
+ wsptr = workspace;
+ for (ctr = 0; ctr < 2; ctr++) {
+ outptr = output_buf[ctr] + output_col;
+ /* It's not clear whether a zero row test is worthwhile here ... */
+
+#ifndef NO_ZERO_ROW_TEST
+ if (wsptr[1] == 0 && wsptr[3] == 0 && wsptr[5] == 0 && wsptr[7] == 0) {
+ /* AC terms all zero */
+ JSAMPLE dcval = range_limit[(int) DESCALE((INT32) wsptr[0], PASS1_BITS+3)
+ & RANGE_MASK];
+
+ outptr[0] = dcval;
+ outptr[1] = dcval;
+
+ wsptr += DCTSIZE; /* advance pointer to next row */
+ continue;
+ }
+#endif
+
+ /* Even part */
+
+ tmp10 = ((INT32) wsptr[0]) << (CONST_BITS+2);
+
+ /* Odd part */
+
+ tmp0 = MULTIPLY((INT32) wsptr[7], - FIX_0_720959822) /* sqrt(2) * (c7-c5+c3-c1) */
+ + MULTIPLY((INT32) wsptr[5], FIX_0_850430095) /* sqrt(2) * (-c1+c3+c5+c7) */
+ + MULTIPLY((INT32) wsptr[3], - FIX_1_272758580) /* sqrt(2) * (-c1+c3-c5-c7) */
+ + MULTIPLY((INT32) wsptr[1], FIX_3_624509785); /* sqrt(2) * (c1+c3+c5+c7) */
+
+ /* Final output stage */
+
+ outptr[0] = range_limit[(int) DESCALE(tmp10 + tmp0,
+ CONST_BITS+PASS1_BITS+3+2)
+ & RANGE_MASK];
+ outptr[1] = range_limit[(int) DESCALE(tmp10 - tmp0,
+ CONST_BITS+PASS1_BITS+3+2)
+ & RANGE_MASK];
+
+ wsptr += DCTSIZE; /* advance pointer to next row */
+ }
+}
+
+
+/*
+ * Perform dequantization and inverse DCT on one block of coefficients,
+ * producing a reduced-size 1x1 output block.
+ */
+
+GLOBAL(void)
+jpeg_idct_1x1 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
+ JCOEFPTR coef_block,
+ JSAMPARRAY output_buf, JDIMENSION output_col)
+{
+ int dcval;
+ ISLOW_MULT_TYPE * quantptr;
+ JSAMPLE *range_limit = IDCT_range_limit(cinfo);
+ SHIFT_TEMPS
+
+ /* We hardly need an inverse DCT routine for this: just take the
+ * average pixel value, which is one-eighth of the DC coefficient.
+ */
+ quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;
+ dcval = DEQUANTIZE(coef_block[0], quantptr[0]);
+ dcval = (int) DESCALE((INT32) dcval, 3);
+
+ output_buf[0][output_col] = range_limit[dcval & RANGE_MASK];
+}
+
+#endif /* IDCT_SCALING_SUPPORTED */
+
+#endif //_FX_JPEG_TURBO_
diff --git a/core/src/fxcodec/libjpeg/fpdfapi_jmemmgr.c b/core/src/fxcodec/libjpeg/fpdfapi_jmemmgr.c
index 19ee66597b..630102fc2e 100644
--- a/core/src/fxcodec/libjpeg/fpdfapi_jmemmgr.c
+++ b/core/src/fxcodec/libjpeg/fpdfapi_jmemmgr.c
@@ -1,1123 +1,1123 @@
-#if !defined(_FX_JPEG_TURBO_)
-/*
- * jmemmgr.c
- *
- * Copyright (C) 1991-1997, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- * For conditions of distribution and use, see the accompanying README file.
- *
- * This file contains the JPEG system-independent memory management
- * routines. This code is usable across a wide variety of machines; most
- * of the system dependencies have been isolated in a separate file.
- * The major functions provided here are:
- * * pool-based allocation and freeing of memory;
- * * policy decisions about how to divide available memory among the
- * virtual arrays;
- * * control logic for swapping virtual arrays between main memory and
- * backing storage.
- * The separate system-dependent file provides the actual backing-storage
- * access code, and it contains the policy decision about how much total
- * main memory to use.
- * This file is system-dependent in the sense that some of its functions
- * are unnecessary in some systems. For example, if there is enough virtual
- * memory so that backing storage will never be used, much of the virtual
- * array control logic could be removed. (Of course, if you have that much
- * memory then you shouldn't care about a little bit of unused code...)
- */
-
-#define JPEG_INTERNALS
-#define AM_MEMORY_MANAGER /* we define jvirt_Xarray_control structs */
-#include "jinclude.h"
-#include "jpeglib.h"
-#include "jmemsys.h" /* import the system-dependent declarations */
-
-#define NO_GETENV /* XYQ: 2007-5-22 Don't use it */
-
-#ifndef NO_GETENV
-#ifndef HAVE_STDLIB_H /* <stdlib.h> should declare getenv() */
-extern char * getenv JPP((const char * name));
-#endif
-#endif
-
-
-/*
- * Some important notes:
- * The allocation routines provided here must never return NULL.
- * They should exit to error_exit if unsuccessful.
- *
- * It's not a good idea to try to merge the sarray and barray routines,
- * even though they are textually almost the same, because samples are
- * usually stored as bytes while coefficients are shorts or ints. Thus,
- * in machines where byte pointers have a different representation from
- * word pointers, the resulting machine code could not be the same.
- */
-
-
-/*
- * Many machines require storage alignment: longs must start on 4-byte
- * boundaries, doubles on 8-byte boundaries, etc. On such machines, malloc()
- * always returns pointers that are multiples of the worst-case alignment
- * requirement, and we had better do so too.
- * There isn't any really portable way to determine the worst-case alignment
- * requirement. This module assumes that the alignment requirement is
- * multiples of sizeof(ALIGN_TYPE).
- * By default, we define ALIGN_TYPE as double. This is necessary on some
- * workstations (where doubles really do need 8-byte alignment) and will work
- * fine on nearly everything. If your machine has lesser alignment needs,
- * you can save a few bytes by making ALIGN_TYPE smaller.
- * The only place I know of where this will NOT work is certain Macintosh
- * 680x0 compilers that define double as a 10-byte IEEE extended float.
- * Doing 10-byte alignment is counterproductive because longwords won't be
- * aligned well. Put "#define ALIGN_TYPE long" in jconfig.h if you have
- * such a compiler.
- */
-
-#ifndef ALIGN_TYPE /* so can override from jconfig.h */
-#define ALIGN_TYPE double
-#endif
-
-
-/*
- * We allocate objects from "pools", where each pool is gotten with a single
- * request to jpeg_get_small() or jpeg_get_large(). There is no per-object
- * overhead within a pool, except for alignment padding. Each pool has a
- * header with a link to the next pool of the same class.
- * Small and large pool headers are identical except that the latter's
- * link pointer must be FAR on 80x86 machines.
- * Notice that the "real" header fields are union'ed with a dummy ALIGN_TYPE
- * field. This forces the compiler to make SIZEOF(small_pool_hdr) a multiple
- * of the alignment requirement of ALIGN_TYPE.
- */
-
-typedef union small_pool_struct * small_pool_ptr;
-
-typedef union small_pool_struct {
- struct {
- small_pool_ptr next; /* next in list of pools */
- size_t bytes_used; /* how many bytes already used within pool */
- size_t bytes_left; /* bytes still available in this pool */
- } hdr;
- ALIGN_TYPE dummy; /* included in union to ensure alignment */
-} small_pool_hdr;
-
-typedef union large_pool_struct FAR * large_pool_ptr;
-
-typedef union large_pool_struct {
- struct {
- large_pool_ptr next; /* next in list of pools */
- size_t bytes_used; /* how many bytes already used within pool */
- size_t bytes_left; /* bytes still available in this pool */
- } hdr;
- ALIGN_TYPE dummy; /* included in union to ensure alignment */
-} large_pool_hdr;
-
-
-/*
- * Here is the full definition of a memory manager object.
- */
-
-typedef struct {
- struct jpeg_memory_mgr pub; /* public fields */
-
- /* Each pool identifier (lifetime class) names a linked list of pools. */
- small_pool_ptr small_list[JPOOL_NUMPOOLS];
- large_pool_ptr large_list[JPOOL_NUMPOOLS];
-
- /* Since we only have one lifetime class of virtual arrays, only one
- * linked list is necessary (for each datatype). Note that the virtual
- * array control blocks being linked together are actually stored somewhere
- * in the small-pool list.
- */
- jvirt_sarray_ptr virt_sarray_list;
- jvirt_barray_ptr virt_barray_list;
-
- /* This counts total space obtained from jpeg_get_small/large */
- long total_space_allocated;
-
- /* alloc_sarray and alloc_barray set this value for use by virtual
- * array routines.
- */
- JDIMENSION last_rowsperchunk; /* from most recent alloc_sarray/barray */
-} my_memory_mgr;
-
-typedef my_memory_mgr * my_mem_ptr;
-
-
-/*
- * The control blocks for virtual arrays.
- * Note that these blocks are allocated in the "small" pool area.
- * System-dependent info for the associated backing store (if any) is hidden
- * inside the backing_store_info struct.
- */
-
-struct jvirt_sarray_control {
- JSAMPARRAY mem_buffer; /* => the in-memory buffer */
- JDIMENSION rows_in_array; /* total virtual array height */
- JDIMENSION samplesperrow; /* width of array (and of memory buffer) */
- JDIMENSION maxaccess; /* max rows accessed by access_virt_sarray */
- JDIMENSION rows_in_mem; /* height of memory buffer */
- JDIMENSION rowsperchunk; /* allocation chunk size in mem_buffer */
- JDIMENSION cur_start_row; /* first logical row # in the buffer */
- JDIMENSION first_undef_row; /* row # of first uninitialized row */
- boolean pre_zero; /* pre-zero mode requested? */
- boolean dirty; /* do current buffer contents need written? */
- boolean b_s_open; /* is backing-store data valid? */
- jvirt_sarray_ptr next; /* link to next virtual sarray control block */
- backing_store_info b_s_info; /* System-dependent control info */
-};
-
-struct jvirt_barray_control {
- JBLOCKARRAY mem_buffer; /* => the in-memory buffer */
- JDIMENSION rows_in_array; /* total virtual array height */
- JDIMENSION blocksperrow; /* width of array (and of memory buffer) */
- JDIMENSION maxaccess; /* max rows accessed by access_virt_barray */
- JDIMENSION rows_in_mem; /* height of memory buffer */
- JDIMENSION rowsperchunk; /* allocation chunk size in mem_buffer */
- JDIMENSION cur_start_row; /* first logical row # in the buffer */
- JDIMENSION first_undef_row; /* row # of first uninitialized row */
- boolean pre_zero; /* pre-zero mode requested? */
- boolean dirty; /* do current buffer contents need written? */
- boolean b_s_open; /* is backing-store data valid? */
- jvirt_barray_ptr next; /* link to next virtual barray control block */
- backing_store_info b_s_info; /* System-dependent control info */
-};
-
-
-#ifdef MEM_STATS /* optional extra stuff for statistics */
-
-LOCAL(void)
-print_mem_stats (j_common_ptr cinfo, int pool_id)
-{
- my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
- small_pool_ptr shdr_ptr;
- large_pool_ptr lhdr_ptr;
-
- /* Since this is only a debugging stub, we can cheat a little by using
- * fprintf directly rather than going through the trace message code.
- * This is helpful because message parm array can't handle longs.
- */
- FXSYS_fprintf(stderr, "Freeing pool %d, total space = %ld\n",
- pool_id, mem->total_space_allocated);
-
- for (lhdr_ptr = mem->large_list[pool_id]; lhdr_ptr != NULL;
- lhdr_ptr = lhdr_ptr->hdr.next) {
- FXSYS_fprintf(stderr, " Large chunk used %ld\n",
- (long) lhdr_ptr->hdr.bytes_used);
- }
-
- for (shdr_ptr = mem->small_list[pool_id]; shdr_ptr != NULL;
- shdr_ptr = shdr_ptr->hdr.next) {
- FXSYS_fprintf(stderr, " Small chunk used %ld free %ld\n",
- (long) shdr_ptr->hdr.bytes_used,
- (long) shdr_ptr->hdr.bytes_left);
- }
-}
-
-#endif /* MEM_STATS */
-
-
-LOCAL(void)
-out_of_memory (j_common_ptr cinfo, int which)
-/* Report an out-of-memory error and stop execution */
-/* If we compiled MEM_STATS support, report alloc requests before dying */
-{
-#ifdef MEM_STATS
- cinfo->err->trace_level = 2; /* force self_destruct to report stats */
-#endif
- ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, which);
-}
-
-
-/*
- * Allocation of "small" objects.
- *
- * For these, we use pooled storage. When a new pool must be created,
- * we try to get enough space for the current request plus a "slop" factor,
- * where the slop will be the amount of leftover space in the new pool.
- * The speed vs. space tradeoff is largely determined by the slop values.
- * A different slop value is provided for each pool class (lifetime),
- * and we also distinguish the first pool of a class from later ones.
- * NOTE: the values given work fairly well on both 16- and 32-bit-int
- * machines, but may be too small if longs are 64 bits or more.
- */
-
-static const size_t first_pool_slop[JPOOL_NUMPOOLS] =
-{
- 1600, /* first PERMANENT pool */
- 16000 /* first IMAGE pool */
-};
-
-static const size_t extra_pool_slop[JPOOL_NUMPOOLS] =
-{
- 0, /* additional PERMANENT pools */
- 5000 /* additional IMAGE pools */
-};
-
-#define MIN_SLOP 50 /* greater than 0 to avoid futile looping */
-
-
-METHODDEF(void *)
-alloc_small (j_common_ptr cinfo, int pool_id, size_t sizeofobject)
-/* Allocate a "small" object */
-{
- my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
- small_pool_ptr hdr_ptr, prev_hdr_ptr;
- char * data_ptr;
- size_t odd_bytes, min_request, slop;
-
- /* Check for unsatisfiable request (do now to ensure no overflow below) */
- if (sizeofobject > (size_t) (MAX_ALLOC_CHUNK-SIZEOF(small_pool_hdr)))
- out_of_memory(cinfo, 1); /* request exceeds malloc's ability */
-
- /* Round up the requested size to a multiple of SIZEOF(ALIGN_TYPE) */
- odd_bytes = sizeofobject % SIZEOF(ALIGN_TYPE);
- if (odd_bytes > 0)
- sizeofobject += SIZEOF(ALIGN_TYPE) - odd_bytes;
-
- /* See if space is available in any existing pool */
- if (pool_id < 0 || pool_id >= JPOOL_NUMPOOLS)
- ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id); /* safety check */
- prev_hdr_ptr = NULL;
- hdr_ptr = mem->small_list[pool_id];
- while (hdr_ptr != NULL) {
- if (hdr_ptr->hdr.bytes_left >= sizeofobject)
- break; /* found pool with enough space */
- prev_hdr_ptr = hdr_ptr;
- hdr_ptr = hdr_ptr->hdr.next;
- }
-
- /* Time to make a new pool? */
- if (hdr_ptr == NULL) {
- /* min_request is what we need now, slop is what will be leftover */
- min_request = sizeofobject + SIZEOF(small_pool_hdr);
- if (prev_hdr_ptr == NULL) /* first pool in class? */
- slop = first_pool_slop[pool_id];
- else
- slop = extra_pool_slop[pool_id];
- /* Don't ask for more than MAX_ALLOC_CHUNK */
- if (slop > (size_t) (MAX_ALLOC_CHUNK-min_request))
- slop = (size_t) (MAX_ALLOC_CHUNK-min_request);
- /* Try to get space, if fail reduce slop and try again */
- for (;;) {
- hdr_ptr = (small_pool_ptr) jpeg_get_small(cinfo, min_request + slop);
- if (hdr_ptr != NULL)
- break;
- slop /= 2;
- if (slop < MIN_SLOP) /* give up when it gets real small */
- out_of_memory(cinfo, 2); /* jpeg_get_small failed */
- }
- mem->total_space_allocated += min_request + slop;
- /* Success, initialize the new pool header and add to end of list */
- hdr_ptr->hdr.next = NULL;
- hdr_ptr->hdr.bytes_used = 0;
- hdr_ptr->hdr.bytes_left = sizeofobject + slop;
- if (prev_hdr_ptr == NULL) /* first pool in class? */
- mem->small_list[pool_id] = hdr_ptr;
- else
- prev_hdr_ptr->hdr.next = hdr_ptr;
- }
-
- /* OK, allocate the object from the current pool */
- data_ptr = (char *) (hdr_ptr + 1); /* point to first data byte in pool */
- data_ptr += hdr_ptr->hdr.bytes_used; /* point to place for object */
- hdr_ptr->hdr.bytes_used += sizeofobject;
- hdr_ptr->hdr.bytes_left -= sizeofobject;
-
- return (void *) data_ptr;
-}
-
-
-/*
- * Allocation of "large" objects.
- *
- * The external semantics of these are the same as "small" objects,
- * except that FAR pointers are used on 80x86. However the pool
- * management heuristics are quite different. We assume that each
- * request is large enough that it may as well be passed directly to
- * jpeg_get_large; the pool management just links everything together
- * so that we can free it all on demand.
- * Note: the major use of "large" objects is in JSAMPARRAY and JBLOCKARRAY
- * structures. The routines that create these structures (see below)
- * deliberately bunch rows together to ensure a large request size.
- */
-
-METHODDEF(void FAR *)
-alloc_large (j_common_ptr cinfo, int pool_id, size_t sizeofobject)
-/* Allocate a "large" object */
-{
- my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
- large_pool_ptr hdr_ptr;
- size_t odd_bytes;
-
- /* Check for unsatisfiable request (do now to ensure no overflow below) */
- if (sizeofobject > (size_t) (MAX_ALLOC_CHUNK-SIZEOF(large_pool_hdr)))
- out_of_memory(cinfo, 3); /* request exceeds malloc's ability */
-
- /* Round up the requested size to a multiple of SIZEOF(ALIGN_TYPE) */
- odd_bytes = sizeofobject % SIZEOF(ALIGN_TYPE);
- if (odd_bytes > 0)
- sizeofobject += SIZEOF(ALIGN_TYPE) - odd_bytes;
-
- /* Always make a new pool */
- if (pool_id < 0 || pool_id >= JPOOL_NUMPOOLS)
- ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id); /* safety check */
-
- hdr_ptr = (large_pool_ptr) jpeg_get_large(cinfo, sizeofobject +
- SIZEOF(large_pool_hdr));
- if (hdr_ptr == NULL)
- out_of_memory(cinfo, 4); /* jpeg_get_large failed */
- mem->total_space_allocated += sizeofobject + SIZEOF(large_pool_hdr);
-
- /* Success, initialize the new pool header and add to list */
- hdr_ptr->hdr.next = mem->large_list[pool_id];
- /* We maintain space counts in each pool header for statistical purposes,
- * even though they are not needed for allocation.
- */
- hdr_ptr->hdr.bytes_used = sizeofobject;
- hdr_ptr->hdr.bytes_left = 0;
- mem->large_list[pool_id] = hdr_ptr;
-
- return (void FAR *) (hdr_ptr + 1); /* point to first data byte in pool */
-}
-
-
-/*
- * Creation of 2-D sample arrays.
- * The pointers are in near heap, the samples themselves in FAR heap.
- *
- * To minimize allocation overhead and to allow I/O of large contiguous
- * blocks, we allocate the sample rows in groups of as many rows as possible
- * without exceeding MAX_ALLOC_CHUNK total bytes per allocation request.
- * NB: the virtual array control routines, later in this file, know about
- * this chunking of rows. The rowsperchunk value is left in the mem manager
- * object so that it can be saved away if this sarray is the workspace for
- * a virtual array.
- */
-
-METHODDEF(JSAMPARRAY)
-alloc_sarray (j_common_ptr cinfo, int pool_id,
- JDIMENSION samplesperrow, JDIMENSION numrows)
-/* Allocate a 2-D sample array */
-{
- my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
- JSAMPARRAY result;
- JSAMPROW workspace;
- JDIMENSION rowsperchunk, currow, i;
- long ltemp;
-
- /* Calculate max # of rows allowed in one allocation chunk */
- ltemp = (MAX_ALLOC_CHUNK-SIZEOF(large_pool_hdr)) /
- ((long) samplesperrow * SIZEOF(JSAMPLE));
- if (ltemp <= 0)
- ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);
- if (ltemp < (long) numrows)
- rowsperchunk = (JDIMENSION) ltemp;
- else
- rowsperchunk = numrows;
- mem->last_rowsperchunk = rowsperchunk;
-
- /* Get space for row pointers (small object) */
- result = (JSAMPARRAY) alloc_small(cinfo, pool_id,
- (size_t) (numrows * SIZEOF(JSAMPROW)));
-
- /* Get the rows themselves (large objects) */
- currow = 0;
- while (currow < numrows) {
- rowsperchunk = MIN(rowsperchunk, numrows - currow);
- workspace = (JSAMPROW) alloc_large(cinfo, pool_id,
- (size_t) ((size_t) rowsperchunk * (size_t) samplesperrow
- * SIZEOF(JSAMPLE)));
- for (i = rowsperchunk; i > 0; i--) {
- result[currow++] = workspace;
- workspace += samplesperrow;
- }
- }
-
- return result;
-}
-
-
-/*
- * Creation of 2-D coefficient-block arrays.
- * This is essentially the same as the code for sample arrays, above.
- */
-
-METHODDEF(JBLOCKARRAY)
-alloc_barray (j_common_ptr cinfo, int pool_id,
- JDIMENSION blocksperrow, JDIMENSION numrows)
-/* Allocate a 2-D coefficient-block array */
-{
- my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
- JBLOCKARRAY result;
- JBLOCKROW workspace;
- JDIMENSION rowsperchunk, currow, i;
- long ltemp;
-
- /* Calculate max # of rows allowed in one allocation chunk */
- ltemp = (MAX_ALLOC_CHUNK-SIZEOF(large_pool_hdr)) /
- ((long) blocksperrow * SIZEOF(JBLOCK));
- if (ltemp <= 0)
- ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);
- if (ltemp < (long) numrows)
- rowsperchunk = (JDIMENSION) ltemp;
- else
- rowsperchunk = numrows;
- mem->last_rowsperchunk = rowsperchunk;
-
- /* Get space for row pointers (small object) */
- result = (JBLOCKARRAY) alloc_small(cinfo, pool_id,
- (size_t) (numrows * SIZEOF(JBLOCKROW)));
-
- /* Get the rows themselves (large objects) */
- currow = 0;
- while (currow < numrows) {
- rowsperchunk = MIN(rowsperchunk, numrows - currow);
- workspace = (JBLOCKROW) alloc_large(cinfo, pool_id,
- (size_t) ((size_t) rowsperchunk * (size_t) blocksperrow
- * SIZEOF(JBLOCK)));
- for (i = rowsperchunk; i > 0; i--) {
- result[currow++] = workspace;
- workspace += blocksperrow;
- }
- }
-
- return result;
-}
-
-
-/*
- * About virtual array management:
- *
- * The above "normal" array routines are only used to allocate strip buffers
- * (as wide as the image, but just a few rows high). Full-image-sized buffers
- * are handled as "virtual" arrays. The array is still accessed a strip at a
- * time, but the memory manager must save the whole array for repeated
- * accesses. The intended implementation is that there is a strip buffer in
- * memory (as high as is possible given the desired memory limit), plus a
- * backing file that holds the rest of the array.
- *
- * The request_virt_array routines are told the total size of the image and
- * the maximum number of rows that will be accessed at once. The in-memory
- * buffer must be at least as large as the maxaccess value.
- *
- * The request routines create control blocks but not the in-memory buffers.
- * That is postponed until realize_virt_arrays is called. At that time the
- * total amount of space needed is known (approximately, anyway), so free
- * memory can be divided up fairly.
- *
- * The access_virt_array routines are responsible for making a specific strip
- * area accessible (after reading or writing the backing file, if necessary).
- * Note that the access routines are told whether the caller intends to modify
- * the accessed strip; during a read-only pass this saves having to rewrite
- * data to disk. The access routines are also responsible for pre-zeroing
- * any newly accessed rows, if pre-zeroing was requested.
- *
- * In current usage, the access requests are usually for nonoverlapping
- * strips; that is, successive access start_row numbers differ by exactly
- * num_rows = maxaccess. This means we can get good performance with simple
- * buffer dump/reload logic, by making the in-memory buffer be a multiple
- * of the access height; then there will never be accesses across bufferload
- * boundaries. The code will still work with overlapping access requests,
- * but it doesn't handle bufferload overlaps very efficiently.
- */
-
-
-METHODDEF(jvirt_sarray_ptr)
-request_virt_sarray (j_common_ptr cinfo, int pool_id, boolean pre_zero,
- JDIMENSION samplesperrow, JDIMENSION numrows,
- JDIMENSION maxaccess)
-/* Request a virtual 2-D sample array */
-{
- my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
- jvirt_sarray_ptr result;
-
- /* Only IMAGE-lifetime virtual arrays are currently supported */
- if (pool_id != JPOOL_IMAGE)
- ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id); /* safety check */
-
- /* get control block */
- result = (jvirt_sarray_ptr) alloc_small(cinfo, pool_id,
- SIZEOF(struct jvirt_sarray_control));
-
- result->mem_buffer = NULL; /* marks array not yet realized */
- result->rows_in_array = numrows;
- result->samplesperrow = samplesperrow;
- result->maxaccess = maxaccess;
- result->pre_zero = pre_zero;
- result->b_s_open = FALSE; /* no associated backing-store object */
- result->next = mem->virt_sarray_list; /* add to list of virtual arrays */
- mem->virt_sarray_list = result;
-
- return result;
-}
-
-
-METHODDEF(jvirt_barray_ptr)
-request_virt_barray (j_common_ptr cinfo, int pool_id, boolean pre_zero,
- JDIMENSION blocksperrow, JDIMENSION numrows,
- JDIMENSION maxaccess)
-/* Request a virtual 2-D coefficient-block array */
-{
- my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
- jvirt_barray_ptr result;
-
- /* Only IMAGE-lifetime virtual arrays are currently supported */
- if (pool_id != JPOOL_IMAGE)
- ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id); /* safety check */
-
- /* get control block */
- result = (jvirt_barray_ptr) alloc_small(cinfo, pool_id,
- SIZEOF(struct jvirt_barray_control));
-
- result->mem_buffer = NULL; /* marks array not yet realized */
- result->rows_in_array = numrows;
- result->blocksperrow = blocksperrow;
- result->maxaccess = maxaccess;
- result->pre_zero = pre_zero;
- result->b_s_open = FALSE; /* no associated backing-store object */
- result->next = mem->virt_barray_list; /* add to list of virtual arrays */
- mem->virt_barray_list = result;
-
- return result;
-}
-
-
-METHODDEF(void)
-realize_virt_arrays (j_common_ptr cinfo)
-/* Allocate the in-memory buffers for any unrealized virtual arrays */
-{
- my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
- long space_per_minheight, maximum_space, avail_mem;
- long minheights, max_minheights;
- jvirt_sarray_ptr sptr;
- jvirt_barray_ptr bptr;
-
- /* Compute the minimum space needed (maxaccess rows in each buffer)
- * and the maximum space needed (full image height in each buffer).
- * These may be of use to the system-dependent jpeg_mem_available routine.
- */
- space_per_minheight = 0;
- maximum_space = 0;
- for (sptr = mem->virt_sarray_list; sptr != NULL; sptr = sptr->next) {
- if (sptr->mem_buffer == NULL) { /* if not realized yet */
- space_per_minheight += (long) sptr->maxaccess *
- (long) sptr->samplesperrow * SIZEOF(JSAMPLE);
- maximum_space += (long) sptr->rows_in_array *
- (long) sptr->samplesperrow * SIZEOF(JSAMPLE);
- }
- }
- for (bptr = mem->virt_barray_list; bptr != NULL; bptr = bptr->next) {
- if (bptr->mem_buffer == NULL) { /* if not realized yet */
- space_per_minheight += (long) bptr->maxaccess *
- (long) bptr->blocksperrow * SIZEOF(JBLOCK);
- maximum_space += (long) bptr->rows_in_array *
- (long) bptr->blocksperrow * SIZEOF(JBLOCK);
- }
- }
-
- if (space_per_minheight <= 0)
- return; /* no unrealized arrays, no work */
-
- /* Determine amount of memory to actually use; this is system-dependent. */
- avail_mem = jpeg_mem_available(cinfo, space_per_minheight, maximum_space,
- mem->total_space_allocated);
-
- /* If the maximum space needed is available, make all the buffers full
- * height; otherwise parcel it out with the same number of minheights
- * in each buffer.
- */
- if (avail_mem >= maximum_space)
- max_minheights = 1000000000L;
- else {
- max_minheights = avail_mem / space_per_minheight;
- /* If there doesn't seem to be enough space, try to get the minimum
- * anyway. This allows a "stub" implementation of jpeg_mem_available().
- */
- if (max_minheights <= 0)
- max_minheights = 1;
- }
-
- /* Allocate the in-memory buffers and initialize backing store as needed. */
-
- for (sptr = mem->virt_sarray_list; sptr != NULL; sptr = sptr->next) {
- if (sptr->mem_buffer == NULL) { /* if not realized yet */
- minheights = ((long) sptr->rows_in_array - 1L) / sptr->maxaccess + 1L;
- if (minheights <= max_minheights) {
- /* This buffer fits in memory */
- sptr->rows_in_mem = sptr->rows_in_array;
- } else {
- /* It doesn't fit in memory, create backing store. */
- sptr->rows_in_mem = (JDIMENSION) (max_minheights * sptr->maxaccess);
- jpeg_open_backing_store(cinfo, & sptr->b_s_info,
- (long) sptr->rows_in_array *
- (long) sptr->samplesperrow *
- (long) SIZEOF(JSAMPLE));
- sptr->b_s_open = TRUE;
- }
- sptr->mem_buffer = alloc_sarray(cinfo, JPOOL_IMAGE,
- sptr->samplesperrow, sptr->rows_in_mem);
- sptr->rowsperchunk = mem->last_rowsperchunk;
- sptr->cur_start_row = 0;
- sptr->first_undef_row = 0;
- sptr->dirty = FALSE;
- }
- }
-
- for (bptr = mem->virt_barray_list; bptr != NULL; bptr = bptr->next) {
- if (bptr->mem_buffer == NULL) { /* if not realized yet */
- minheights = ((long) bptr->rows_in_array - 1L) / bptr->maxaccess + 1L;
- if (minheights <= max_minheights) {
- /* This buffer fits in memory */
- bptr->rows_in_mem = bptr->rows_in_array;
- } else {
- /* It doesn't fit in memory, create backing store. */
- bptr->rows_in_mem = (JDIMENSION) (max_minheights * bptr->maxaccess);
- jpeg_open_backing_store(cinfo, & bptr->b_s_info,
- (long) bptr->rows_in_array *
- (long) bptr->blocksperrow *
- (long) SIZEOF(JBLOCK));
- bptr->b_s_open = TRUE;
- }
- bptr->mem_buffer = alloc_barray(cinfo, JPOOL_IMAGE,
- bptr->blocksperrow, bptr->rows_in_mem);
- bptr->rowsperchunk = mem->last_rowsperchunk;
- bptr->cur_start_row = 0;
- bptr->first_undef_row = 0;
- bptr->dirty = FALSE;
- }
- }
-}
-
-
-LOCAL(void)
-do_sarray_io (j_common_ptr cinfo, jvirt_sarray_ptr ptr, boolean writing)
-/* Do backing store read or write of a virtual sample array */
-{
- long bytesperrow, file_offset, byte_count, rows, thisrow, i;
-
- bytesperrow = (long) ptr->samplesperrow * SIZEOF(JSAMPLE);
- file_offset = ptr->cur_start_row * bytesperrow;
- /* Loop to read or write each allocation chunk in mem_buffer */
- for (i = 0; i < (long) ptr->rows_in_mem; i += ptr->rowsperchunk) {
- /* One chunk, but check for short chunk at end of buffer */
- rows = MIN((long) ptr->rowsperchunk, (long) ptr->rows_in_mem - i);
- /* Transfer no more than is currently defined */
- thisrow = (long) ptr->cur_start_row + i;
- rows = MIN(rows, (long) ptr->first_undef_row - thisrow);
- /* Transfer no more than fits in file */
- rows = MIN(rows, (long) ptr->rows_in_array - thisrow);
- if (rows <= 0) /* this chunk might be past end of file! */
- break;
- byte_count = rows * bytesperrow;
- if (writing)
- (*ptr->b_s_info.write_backing_store) (cinfo, & ptr->b_s_info,
- (void FAR *) ptr->mem_buffer[i],
- file_offset, byte_count);
- else
- (*ptr->b_s_info.read_backing_store) (cinfo, & ptr->b_s_info,
- (void FAR *) ptr->mem_buffer[i],
- file_offset, byte_count);
- file_offset += byte_count;
- }
-}
-
-
-LOCAL(void)
-do_barray_io (j_common_ptr cinfo, jvirt_barray_ptr ptr, boolean writing)
-/* Do backing store read or write of a virtual coefficient-block array */
-{
- long bytesperrow, file_offset, byte_count, rows, thisrow, i;
-
- bytesperrow = (long) ptr->blocksperrow * SIZEOF(JBLOCK);
- file_offset = ptr->cur_start_row * bytesperrow;
- /* Loop to read or write each allocation chunk in mem_buffer */
- for (i = 0; i < (long) ptr->rows_in_mem; i += ptr->rowsperchunk) {
- /* One chunk, but check for short chunk at end of buffer */
- rows = MIN((long) ptr->rowsperchunk, (long) ptr->rows_in_mem - i);
- /* Transfer no more than is currently defined */
- thisrow = (long) ptr->cur_start_row + i;
- rows = MIN(rows, (long) ptr->first_undef_row - thisrow);
- /* Transfer no more than fits in file */
- rows = MIN(rows, (long) ptr->rows_in_array - thisrow);
- if (rows <= 0) /* this chunk might be past end of file! */
- break;
- byte_count = rows * bytesperrow;
- if (writing)
- (*ptr->b_s_info.write_backing_store) (cinfo, & ptr->b_s_info,
- (void FAR *) ptr->mem_buffer[i],
- file_offset, byte_count);
- else
- (*ptr->b_s_info.read_backing_store) (cinfo, & ptr->b_s_info,
- (void FAR *) ptr->mem_buffer[i],
- file_offset, byte_count);
- file_offset += byte_count;
- }
-}
-
-
-METHODDEF(JSAMPARRAY)
-access_virt_sarray (j_common_ptr cinfo, jvirt_sarray_ptr ptr,
- JDIMENSION start_row, JDIMENSION num_rows,
- boolean writable)
-/* Access the part of a virtual sample array starting at start_row */
-/* and extending for num_rows rows. writable is true if */
-/* caller intends to modify the accessed area. */
-{
- JDIMENSION end_row = start_row + num_rows;
- JDIMENSION undef_row;
-
- /* debugging check */
- if (end_row > ptr->rows_in_array || num_rows > ptr->maxaccess ||
- ptr->mem_buffer == NULL)
- ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS);
-
- /* Make the desired part of the virtual array accessible */
- if (start_row < ptr->cur_start_row ||
- end_row > ptr->cur_start_row+ptr->rows_in_mem) {
- if (! ptr->b_s_open)
- ERREXIT(cinfo, JERR_VIRTUAL_BUG);
- /* Flush old buffer contents if necessary */
- if (ptr->dirty) {
- do_sarray_io(cinfo, ptr, TRUE);
- ptr->dirty = FALSE;
- }
- /* Decide what part of virtual array to access.
- * Algorithm: if target address > current window, assume forward scan,
- * load starting at target address. If target address < current window,
- * assume backward scan, load so that target area is top of window.
- * Note that when switching from forward write to forward read, will have
- * start_row = 0, so the limiting case applies and we load from 0 anyway.
- */
- if (start_row > ptr->cur_start_row) {
- ptr->cur_start_row = start_row;
- } else {
- /* use long arithmetic here to avoid overflow & unsigned problems */
- long ltemp;
-
- ltemp = (long) end_row - (long) ptr->rows_in_mem;
- if (ltemp < 0)
- ltemp = 0; /* don't fall off front end of file */
- ptr->cur_start_row = (JDIMENSION) ltemp;
- }
- /* Read in the selected part of the array.
- * During the initial write pass, we will do no actual read
- * because the selected part is all undefined.
- */
- do_sarray_io(cinfo, ptr, FALSE);
- }
- /* Ensure the accessed part of the array is defined; prezero if needed.
- * To improve locality of access, we only prezero the part of the array
- * that the caller is about to access, not the entire in-memory array.
- */
- if (ptr->first_undef_row < end_row) {
- if (ptr->first_undef_row < start_row) {
- if (writable) /* writer skipped over a section of array */
- ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS);
- undef_row = start_row; /* but reader is allowed to read ahead */
- } else {
- undef_row = ptr->first_undef_row;
- }
- if (writable)
- ptr->first_undef_row = end_row;
- if (ptr->pre_zero) {
- size_t bytesperrow = (size_t) ptr->samplesperrow * SIZEOF(JSAMPLE);
- undef_row -= ptr->cur_start_row; /* make indexes relative to buffer */
- end_row -= ptr->cur_start_row;
- while (undef_row < end_row) {
- jzero_far((void FAR *) ptr->mem_buffer[undef_row], bytesperrow);
- undef_row++;
- }
- } else {
- if (! writable) /* reader looking at undefined data */
- ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS);
- }
- }
- /* Flag the buffer dirty if caller will write in it */
- if (writable)
- ptr->dirty = TRUE;
- /* Return address of proper part of the buffer */
- return ptr->mem_buffer + (start_row - ptr->cur_start_row);
-}
-
-
-METHODDEF(JBLOCKARRAY)
-access_virt_barray (j_common_ptr cinfo, jvirt_barray_ptr ptr,
- JDIMENSION start_row, JDIMENSION num_rows,
- boolean writable)
-/* Access the part of a virtual block array starting at start_row */
-/* and extending for num_rows rows. writable is true if */
-/* caller intends to modify the accessed area. */
-{
- JDIMENSION end_row = start_row + num_rows;
- JDIMENSION undef_row;
-
- /* debugging check */
- if (end_row > ptr->rows_in_array || num_rows > ptr->maxaccess ||
- ptr->mem_buffer == NULL)
- ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS);
-
- /* Make the desired part of the virtual array accessible */
- if (start_row < ptr->cur_start_row ||
- end_row > ptr->cur_start_row+ptr->rows_in_mem) {
- if (! ptr->b_s_open)
- ERREXIT(cinfo, JERR_VIRTUAL_BUG);
- /* Flush old buffer contents if necessary */
- if (ptr->dirty) {
- do_barray_io(cinfo, ptr, TRUE);
- ptr->dirty = FALSE;
- }
- /* Decide what part of virtual array to access.
- * Algorithm: if target address > current window, assume forward scan,
- * load starting at target address. If target address < current window,
- * assume backward scan, load so that target area is top of window.
- * Note that when switching from forward write to forward read, will have
- * start_row = 0, so the limiting case applies and we load from 0 anyway.
- */
- if (start_row > ptr->cur_start_row) {
- ptr->cur_start_row = start_row;
- } else {
- /* use long arithmetic here to avoid overflow & unsigned problems */
- long ltemp;
-
- ltemp = (long) end_row - (long) ptr->rows_in_mem;
- if (ltemp < 0)
- ltemp = 0; /* don't fall off front end of file */
- ptr->cur_start_row = (JDIMENSION) ltemp;
- }
- /* Read in the selected part of the array.
- * During the initial write pass, we will do no actual read
- * because the selected part is all undefined.
- */
- do_barray_io(cinfo, ptr, FALSE);
- }
- /* Ensure the accessed part of the array is defined; prezero if needed.
- * To improve locality of access, we only prezero the part of the array
- * that the caller is about to access, not the entire in-memory array.
- */
- if (ptr->first_undef_row < end_row) {
- if (ptr->first_undef_row < start_row) {
- if (writable) /* writer skipped over a section of array */
- ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS);
- undef_row = start_row; /* but reader is allowed to read ahead */
- } else {
- undef_row = ptr->first_undef_row;
- }
- if (writable)
- ptr->first_undef_row = end_row;
- if (ptr->pre_zero) {
- size_t bytesperrow = (size_t) ptr->blocksperrow * SIZEOF(JBLOCK);
- undef_row -= ptr->cur_start_row; /* make indexes relative to buffer */
- end_row -= ptr->cur_start_row;
- while (undef_row < end_row) {
- jzero_far((void FAR *) ptr->mem_buffer[undef_row], bytesperrow);
- undef_row++;
- }
- } else {
- if (! writable) /* reader looking at undefined data */
- ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS);
- }
- }
- /* Flag the buffer dirty if caller will write in it */
- if (writable)
- ptr->dirty = TRUE;
- /* Return address of proper part of the buffer */
- return ptr->mem_buffer + (start_row - ptr->cur_start_row);
-}
-
-
-/*
- * Release all objects belonging to a specified pool.
- */
-
-METHODDEF(void)
-free_pool (j_common_ptr cinfo, int pool_id)
-{
- my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
- small_pool_ptr shdr_ptr;
- large_pool_ptr lhdr_ptr;
- size_t space_freed;
-
- if (pool_id < 0 || pool_id >= JPOOL_NUMPOOLS)
- ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id); /* safety check */
-
-#ifdef MEM_STATS
- if (cinfo->err->trace_level > 1)
- print_mem_stats(cinfo, pool_id); /* print pool's memory usage statistics */
-#endif
-
- /* If freeing IMAGE pool, close any virtual arrays first */
- if (pool_id == JPOOL_IMAGE) {
- jvirt_sarray_ptr sptr;
- jvirt_barray_ptr bptr;
-
- for (sptr = mem->virt_sarray_list; sptr != NULL; sptr = sptr->next) {
- if (sptr->b_s_open) { /* there may be no backing store */
- sptr->b_s_open = FALSE; /* prevent recursive close if error */
- (*sptr->b_s_info.close_backing_store) (cinfo, & sptr->b_s_info);
- }
- }
- mem->virt_sarray_list = NULL;
- for (bptr = mem->virt_barray_list; bptr != NULL; bptr = bptr->next) {
- if (bptr->b_s_open) { /* there may be no backing store */
- bptr->b_s_open = FALSE; /* prevent recursive close if error */
- (*bptr->b_s_info.close_backing_store) (cinfo, & bptr->b_s_info);
- }
- }
- mem->virt_barray_list = NULL;
- }
-
- /* Release large objects */
- lhdr_ptr = mem->large_list[pool_id];
- mem->large_list[pool_id] = NULL;
-
- while (lhdr_ptr != NULL) {
- large_pool_ptr next_lhdr_ptr = lhdr_ptr->hdr.next;
- space_freed = lhdr_ptr->hdr.bytes_used +
- lhdr_ptr->hdr.bytes_left +
- SIZEOF(large_pool_hdr);
- jpeg_free_large(cinfo, (void FAR *) lhdr_ptr, space_freed);
- mem->total_space_allocated -= space_freed;
- lhdr_ptr = next_lhdr_ptr;
- }
-
- /* Release small objects */
- shdr_ptr = mem->small_list[pool_id];
- mem->small_list[pool_id] = NULL;
-
- while (shdr_ptr != NULL) {
- small_pool_ptr next_shdr_ptr = shdr_ptr->hdr.next;
- space_freed = shdr_ptr->hdr.bytes_used +
- shdr_ptr->hdr.bytes_left +
- SIZEOF(small_pool_hdr);
- jpeg_free_small(cinfo, (void *) shdr_ptr, space_freed);
- mem->total_space_allocated -= space_freed;
- shdr_ptr = next_shdr_ptr;
- }
-}
-
-
-/*
- * Close up shop entirely.
- * Note that this cannot be called unless cinfo->mem is non-NULL.
- */
-
-METHODDEF(void)
-self_destruct (j_common_ptr cinfo)
-{
- int pool;
-
- /* Close all backing store, release all memory.
- * Releasing pools in reverse order might help avoid fragmentation
- * with some (brain-damaged) malloc libraries.
- */
- for (pool = JPOOL_NUMPOOLS-1; pool >= JPOOL_PERMANENT; pool--) {
- free_pool(cinfo, pool);
- }
-
- /* Release the memory manager control block too. */
- jpeg_free_small(cinfo, (void *) cinfo->mem, SIZEOF(my_memory_mgr));
- cinfo->mem = NULL; /* ensures I will be called only once */
-
- jpeg_mem_term(cinfo); /* system-dependent cleanup */
-}
-
-
-/*
- * Memory manager initialization.
- * When this is called, only the error manager pointer is valid in cinfo!
- */
-
-GLOBAL(void)
-jinit_memory_mgr (j_common_ptr cinfo)
-{
- my_mem_ptr mem;
- long max_to_use;
- int pool;
- size_t test_mac;
-
- cinfo->mem = NULL; /* for safety if init fails */
-
- /* Check for configuration errors.
- * SIZEOF(ALIGN_TYPE) should be a power of 2; otherwise, it probably
- * doesn't reflect any real hardware alignment requirement.
- * The test is a little tricky: for X>0, X and X-1 have no one-bits
- * in common if and only if X is a power of 2, ie has only one one-bit.
- * Some compilers may give an "unreachable code" warning here; ignore it.
- */
- if ((SIZEOF(ALIGN_TYPE) & (SIZEOF(ALIGN_TYPE)-1)) != 0)
- ERREXIT(cinfo, JERR_BAD_ALIGN_TYPE);
- /* MAX_ALLOC_CHUNK must be representable as type size_t, and must be
- * a multiple of SIZEOF(ALIGN_TYPE).
- * Again, an "unreachable code" warning may be ignored here.
- * But a "constant too large" warning means you need to fix MAX_ALLOC_CHUNK.
- */
- test_mac = (size_t) MAX_ALLOC_CHUNK;
- if ((long) test_mac != MAX_ALLOC_CHUNK ||
- (MAX_ALLOC_CHUNK % SIZEOF(ALIGN_TYPE)) != 0)
- ERREXIT(cinfo, JERR_BAD_ALLOC_CHUNK);
-
- max_to_use = jpeg_mem_init(cinfo); /* system-dependent initialization */
-
- /* Attempt to allocate memory manager's control block */
- mem = (my_mem_ptr) jpeg_get_small(cinfo, SIZEOF(my_memory_mgr));
-
- if (mem == NULL) {
- jpeg_mem_term(cinfo); /* system-dependent cleanup */
- ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, 0);
- }
-
- /* OK, fill in the method pointers */
- mem->pub.alloc_small = alloc_small;
- mem->pub.alloc_large = alloc_large;
- mem->pub.alloc_sarray = alloc_sarray;
- mem->pub.alloc_barray = alloc_barray;
- mem->pub.request_virt_sarray = request_virt_sarray;
- mem->pub.request_virt_barray = request_virt_barray;
- mem->pub.realize_virt_arrays = realize_virt_arrays;
- mem->pub.access_virt_sarray = access_virt_sarray;
- mem->pub.access_virt_barray = access_virt_barray;
- mem->pub.free_pool = free_pool;
- mem->pub.self_destruct = self_destruct;
-
- /* Make MAX_ALLOC_CHUNK accessible to other modules */
- mem->pub.max_alloc_chunk = MAX_ALLOC_CHUNK;
-
- /* Initialize working state */
- mem->pub.max_memory_to_use = max_to_use;
-
- for (pool = JPOOL_NUMPOOLS-1; pool >= JPOOL_PERMANENT; pool--) {
- mem->small_list[pool] = NULL;
- mem->large_list[pool] = NULL;
- }
- mem->virt_sarray_list = NULL;
- mem->virt_barray_list = NULL;
-
- mem->total_space_allocated = SIZEOF(my_memory_mgr);
-
- /* Declare ourselves open for business */
- cinfo->mem = & mem->pub;
-
- /* Check for an environment variable JPEGMEM; if found, override the
- * default max_memory setting from jpeg_mem_init. Note that the
- * surrounding application may again override this value.
- * If your system doesn't support getenv(), define NO_GETENV to disable
- * this feature.
- */
-#ifndef NO_GETENV
- { char * memenv;
-
- if ((memenv = getenv("JPEGMEM")) != NULL) {
- char ch = 'x';
-
- if (sscanf(memenv, "%ld%c", &max_to_use, &ch) > 0) {
- if (ch == 'm' || ch == 'M')
- max_to_use *= 1000L;
- mem->pub.max_memory_to_use = max_to_use * 1000L;
- }
- }
- }
-#endif
-
-}
-
-#endif //_FX_JPEG_TURBO_
+#if !defined(_FX_JPEG_TURBO_)
+/*
+ * jmemmgr.c
+ *
+ * Copyright (C) 1991-1997, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains the JPEG system-independent memory management
+ * routines. This code is usable across a wide variety of machines; most
+ * of the system dependencies have been isolated in a separate file.
+ * The major functions provided here are:
+ * * pool-based allocation and freeing of memory;
+ * * policy decisions about how to divide available memory among the
+ * virtual arrays;
+ * * control logic for swapping virtual arrays between main memory and
+ * backing storage.
+ * The separate system-dependent file provides the actual backing-storage
+ * access code, and it contains the policy decision about how much total
+ * main memory to use.
+ * This file is system-dependent in the sense that some of its functions
+ * are unnecessary in some systems. For example, if there is enough virtual
+ * memory so that backing storage will never be used, much of the virtual
+ * array control logic could be removed. (Of course, if you have that much
+ * memory then you shouldn't care about a little bit of unused code...)
+ */
+
+#define JPEG_INTERNALS
+#define AM_MEMORY_MANAGER /* we define jvirt_Xarray_control structs */
+#include "jinclude.h"
+#include "jpeglib.h"
+#include "jmemsys.h" /* import the system-dependent declarations */
+
+#define NO_GETENV /* XYQ: 2007-5-22 Don't use it */
+
+#ifndef NO_GETENV
+#ifndef HAVE_STDLIB_H /* <stdlib.h> should declare getenv() */
+extern char * getenv JPP((const char * name));
+#endif
+#endif
+
+
+/*
+ * Some important notes:
+ * The allocation routines provided here must never return NULL.
+ * They should exit to error_exit if unsuccessful.
+ *
+ * It's not a good idea to try to merge the sarray and barray routines,
+ * even though they are textually almost the same, because samples are
+ * usually stored as bytes while coefficients are shorts or ints. Thus,
+ * in machines where byte pointers have a different representation from
+ * word pointers, the resulting machine code could not be the same.
+ */
+
+
+/*
+ * Many machines require storage alignment: longs must start on 4-byte
+ * boundaries, doubles on 8-byte boundaries, etc. On such machines, malloc()
+ * always returns pointers that are multiples of the worst-case alignment
+ * requirement, and we had better do so too.
+ * There isn't any really portable way to determine the worst-case alignment
+ * requirement. This module assumes that the alignment requirement is
+ * multiples of sizeof(ALIGN_TYPE).
+ * By default, we define ALIGN_TYPE as double. This is necessary on some
+ * workstations (where doubles really do need 8-byte alignment) and will work
+ * fine on nearly everything. If your machine has lesser alignment needs,
+ * you can save a few bytes by making ALIGN_TYPE smaller.
+ * The only place I know of where this will NOT work is certain Macintosh
+ * 680x0 compilers that define double as a 10-byte IEEE extended float.
+ * Doing 10-byte alignment is counterproductive because longwords won't be
+ * aligned well. Put "#define ALIGN_TYPE long" in jconfig.h if you have
+ * such a compiler.
+ */
+
+#ifndef ALIGN_TYPE /* so can override from jconfig.h */
+#define ALIGN_TYPE double
+#endif
+
+
+/*
+ * We allocate objects from "pools", where each pool is gotten with a single
+ * request to jpeg_get_small() or jpeg_get_large(). There is no per-object
+ * overhead within a pool, except for alignment padding. Each pool has a
+ * header with a link to the next pool of the same class.
+ * Small and large pool headers are identical except that the latter's
+ * link pointer must be FAR on 80x86 machines.
+ * Notice that the "real" header fields are union'ed with a dummy ALIGN_TYPE
+ * field. This forces the compiler to make SIZEOF(small_pool_hdr) a multiple
+ * of the alignment requirement of ALIGN_TYPE.
+ */
+
+typedef union small_pool_struct * small_pool_ptr;
+
+typedef union small_pool_struct {
+ struct {
+ small_pool_ptr next; /* next in list of pools */
+ size_t bytes_used; /* how many bytes already used within pool */
+ size_t bytes_left; /* bytes still available in this pool */
+ } hdr;
+ ALIGN_TYPE dummy; /* included in union to ensure alignment */
+} small_pool_hdr;
+
+typedef union large_pool_struct FAR * large_pool_ptr;
+
+typedef union large_pool_struct {
+ struct {
+ large_pool_ptr next; /* next in list of pools */
+ size_t bytes_used; /* how many bytes already used within pool */
+ size_t bytes_left; /* bytes still available in this pool */
+ } hdr;
+ ALIGN_TYPE dummy; /* included in union to ensure alignment */
+} large_pool_hdr;
+
+
+/*
+ * Here is the full definition of a memory manager object.
+ */
+
+typedef struct {
+ struct jpeg_memory_mgr pub; /* public fields */
+
+ /* Each pool identifier (lifetime class) names a linked list of pools. */
+ small_pool_ptr small_list[JPOOL_NUMPOOLS];
+ large_pool_ptr large_list[JPOOL_NUMPOOLS];
+
+ /* Since we only have one lifetime class of virtual arrays, only one
+ * linked list is necessary (for each datatype). Note that the virtual
+ * array control blocks being linked together are actually stored somewhere
+ * in the small-pool list.
+ */
+ jvirt_sarray_ptr virt_sarray_list;
+ jvirt_barray_ptr virt_barray_list;
+
+ /* This counts total space obtained from jpeg_get_small/large */
+ long total_space_allocated;
+
+ /* alloc_sarray and alloc_barray set this value for use by virtual
+ * array routines.
+ */
+ JDIMENSION last_rowsperchunk; /* from most recent alloc_sarray/barray */
+} my_memory_mgr;
+
+typedef my_memory_mgr * my_mem_ptr;
+
+
+/*
+ * The control blocks for virtual arrays.
+ * Note that these blocks are allocated in the "small" pool area.
+ * System-dependent info for the associated backing store (if any) is hidden
+ * inside the backing_store_info struct.
+ */
+
+struct jvirt_sarray_control {
+ JSAMPARRAY mem_buffer; /* => the in-memory buffer */
+ JDIMENSION rows_in_array; /* total virtual array height */
+ JDIMENSION samplesperrow; /* width of array (and of memory buffer) */
+ JDIMENSION maxaccess; /* max rows accessed by access_virt_sarray */
+ JDIMENSION rows_in_mem; /* height of memory buffer */
+ JDIMENSION rowsperchunk; /* allocation chunk size in mem_buffer */
+ JDIMENSION cur_start_row; /* first logical row # in the buffer */
+ JDIMENSION first_undef_row; /* row # of first uninitialized row */
+ boolean pre_zero; /* pre-zero mode requested? */
+ boolean dirty; /* do current buffer contents need written? */
+ boolean b_s_open; /* is backing-store data valid? */
+ jvirt_sarray_ptr next; /* link to next virtual sarray control block */
+ backing_store_info b_s_info; /* System-dependent control info */
+};
+
+struct jvirt_barray_control {
+ JBLOCKARRAY mem_buffer; /* => the in-memory buffer */
+ JDIMENSION rows_in_array; /* total virtual array height */
+ JDIMENSION blocksperrow; /* width of array (and of memory buffer) */
+ JDIMENSION maxaccess; /* max rows accessed by access_virt_barray */
+ JDIMENSION rows_in_mem; /* height of memory buffer */
+ JDIMENSION rowsperchunk; /* allocation chunk size in mem_buffer */
+ JDIMENSION cur_start_row; /* first logical row # in the buffer */
+ JDIMENSION first_undef_row; /* row # of first uninitialized row */
+ boolean pre_zero; /* pre-zero mode requested? */
+ boolean dirty; /* do current buffer contents need written? */
+ boolean b_s_open; /* is backing-store data valid? */
+ jvirt_barray_ptr next; /* link to next virtual barray control block */
+ backing_store_info b_s_info; /* System-dependent control info */
+};
+
+
+#ifdef MEM_STATS /* optional extra stuff for statistics */
+
+LOCAL(void)
+print_mem_stats (j_common_ptr cinfo, int pool_id)
+{
+ my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
+ small_pool_ptr shdr_ptr;
+ large_pool_ptr lhdr_ptr;
+
+ /* Since this is only a debugging stub, we can cheat a little by using
+ * fprintf directly rather than going through the trace message code.
+ * This is helpful because message parm array can't handle longs.
+ */
+ FXSYS_fprintf(stderr, "Freeing pool %d, total space = %ld\n",
+ pool_id, mem->total_space_allocated);
+
+ for (lhdr_ptr = mem->large_list[pool_id]; lhdr_ptr != NULL;
+ lhdr_ptr = lhdr_ptr->hdr.next) {
+ FXSYS_fprintf(stderr, " Large chunk used %ld\n",
+ (long) lhdr_ptr->hdr.bytes_used);
+ }
+
+ for (shdr_ptr = mem->small_list[pool_id]; shdr_ptr != NULL;
+ shdr_ptr = shdr_ptr->hdr.next) {
+ FXSYS_fprintf(stderr, " Small chunk used %ld free %ld\n",
+ (long) shdr_ptr->hdr.bytes_used,
+ (long) shdr_ptr->hdr.bytes_left);
+ }
+}
+
+#endif /* MEM_STATS */
+
+
+LOCAL(void)
+out_of_memory (j_common_ptr cinfo, int which)
+/* Report an out-of-memory error and stop execution */
+/* If we compiled MEM_STATS support, report alloc requests before dying */
+{
+#ifdef MEM_STATS
+ cinfo->err->trace_level = 2; /* force self_destruct to report stats */
+#endif
+ ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, which);
+}
+
+
+/*
+ * Allocation of "small" objects.
+ *
+ * For these, we use pooled storage. When a new pool must be created,
+ * we try to get enough space for the current request plus a "slop" factor,
+ * where the slop will be the amount of leftover space in the new pool.
+ * The speed vs. space tradeoff is largely determined by the slop values.
+ * A different slop value is provided for each pool class (lifetime),
+ * and we also distinguish the first pool of a class from later ones.
+ * NOTE: the values given work fairly well on both 16- and 32-bit-int
+ * machines, but may be too small if longs are 64 bits or more.
+ */
+
+static const size_t first_pool_slop[JPOOL_NUMPOOLS] =
+{
+ 1600, /* first PERMANENT pool */
+ 16000 /* first IMAGE pool */
+};
+
+static const size_t extra_pool_slop[JPOOL_NUMPOOLS] =
+{
+ 0, /* additional PERMANENT pools */
+ 5000 /* additional IMAGE pools */
+};
+
+#define MIN_SLOP 50 /* greater than 0 to avoid futile looping */
+
+
+METHODDEF(void *)
+alloc_small (j_common_ptr cinfo, int pool_id, size_t sizeofobject)
+/* Allocate a "small" object */
+{
+ my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
+ small_pool_ptr hdr_ptr, prev_hdr_ptr;
+ char * data_ptr;
+ size_t odd_bytes, min_request, slop;
+
+ /* Check for unsatisfiable request (do now to ensure no overflow below) */
+ if (sizeofobject > (size_t) (MAX_ALLOC_CHUNK-SIZEOF(small_pool_hdr)))
+ out_of_memory(cinfo, 1); /* request exceeds malloc's ability */
+
+ /* Round up the requested size to a multiple of SIZEOF(ALIGN_TYPE) */
+ odd_bytes = sizeofobject % SIZEOF(ALIGN_TYPE);
+ if (odd_bytes > 0)
+ sizeofobject += SIZEOF(ALIGN_TYPE) - odd_bytes;
+
+ /* See if space is available in any existing pool */
+ if (pool_id < 0 || pool_id >= JPOOL_NUMPOOLS)
+ ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id); /* safety check */
+ prev_hdr_ptr = NULL;
+ hdr_ptr = mem->small_list[pool_id];
+ while (hdr_ptr != NULL) {
+ if (hdr_ptr->hdr.bytes_left >= sizeofobject)
+ break; /* found pool with enough space */
+ prev_hdr_ptr = hdr_ptr;
+ hdr_ptr = hdr_ptr->hdr.next;
+ }
+
+ /* Time to make a new pool? */
+ if (hdr_ptr == NULL) {
+ /* min_request is what we need now, slop is what will be leftover */
+ min_request = sizeofobject + SIZEOF(small_pool_hdr);
+ if (prev_hdr_ptr == NULL) /* first pool in class? */
+ slop = first_pool_slop[pool_id];
+ else
+ slop = extra_pool_slop[pool_id];
+ /* Don't ask for more than MAX_ALLOC_CHUNK */
+ if (slop > (size_t) (MAX_ALLOC_CHUNK-min_request))
+ slop = (size_t) (MAX_ALLOC_CHUNK-min_request);
+ /* Try to get space, if fail reduce slop and try again */
+ for (;;) {
+ hdr_ptr = (small_pool_ptr) jpeg_get_small(cinfo, min_request + slop);
+ if (hdr_ptr != NULL)
+ break;
+ slop /= 2;
+ if (slop < MIN_SLOP) /* give up when it gets real small */
+ out_of_memory(cinfo, 2); /* jpeg_get_small failed */
+ }
+ mem->total_space_allocated += min_request + slop;
+ /* Success, initialize the new pool header and add to end of list */
+ hdr_ptr->hdr.next = NULL;
+ hdr_ptr->hdr.bytes_used = 0;
+ hdr_ptr->hdr.bytes_left = sizeofobject + slop;
+ if (prev_hdr_ptr == NULL) /* first pool in class? */
+ mem->small_list[pool_id] = hdr_ptr;
+ else
+ prev_hdr_ptr->hdr.next = hdr_ptr;
+ }
+
+ /* OK, allocate the object from the current pool */
+ data_ptr = (char *) (hdr_ptr + 1); /* point to first data byte in pool */
+ data_ptr += hdr_ptr->hdr.bytes_used; /* point to place for object */
+ hdr_ptr->hdr.bytes_used += sizeofobject;
+ hdr_ptr->hdr.bytes_left -= sizeofobject;
+
+ return (void *) data_ptr;
+}
+
+
+/*
+ * Allocation of "large" objects.
+ *
+ * The external semantics of these are the same as "small" objects,
+ * except that FAR pointers are used on 80x86. However the pool
+ * management heuristics are quite different. We assume that each
+ * request is large enough that it may as well be passed directly to
+ * jpeg_get_large; the pool management just links everything together
+ * so that we can free it all on demand.
+ * Note: the major use of "large" objects is in JSAMPARRAY and JBLOCKARRAY
+ * structures. The routines that create these structures (see below)
+ * deliberately bunch rows together to ensure a large request size.
+ */
+
+METHODDEF(void FAR *)
+alloc_large (j_common_ptr cinfo, int pool_id, size_t sizeofobject)
+/* Allocate a "large" object */
+{
+ my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
+ large_pool_ptr hdr_ptr;
+ size_t odd_bytes;
+
+ /* Check for unsatisfiable request (do now to ensure no overflow below) */
+ if (sizeofobject > (size_t) (MAX_ALLOC_CHUNK-SIZEOF(large_pool_hdr)))
+ out_of_memory(cinfo, 3); /* request exceeds malloc's ability */
+
+ /* Round up the requested size to a multiple of SIZEOF(ALIGN_TYPE) */
+ odd_bytes = sizeofobject % SIZEOF(ALIGN_TYPE);
+ if (odd_bytes > 0)
+ sizeofobject += SIZEOF(ALIGN_TYPE) - odd_bytes;
+
+ /* Always make a new pool */
+ if (pool_id < 0 || pool_id >= JPOOL_NUMPOOLS)
+ ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id); /* safety check */
+
+ hdr_ptr = (large_pool_ptr) jpeg_get_large(cinfo, sizeofobject +
+ SIZEOF(large_pool_hdr));
+ if (hdr_ptr == NULL)
+ out_of_memory(cinfo, 4); /* jpeg_get_large failed */
+ mem->total_space_allocated += sizeofobject + SIZEOF(large_pool_hdr);
+
+ /* Success, initialize the new pool header and add to list */
+ hdr_ptr->hdr.next = mem->large_list[pool_id];
+ /* We maintain space counts in each pool header for statistical purposes,
+ * even though they are not needed for allocation.
+ */
+ hdr_ptr->hdr.bytes_used = sizeofobject;
+ hdr_ptr->hdr.bytes_left = 0;
+ mem->large_list[pool_id] = hdr_ptr;
+
+ return (void FAR *) (hdr_ptr + 1); /* point to first data byte in pool */
+}
+
+
+/*
+ * Creation of 2-D sample arrays.
+ * The pointers are in near heap, the samples themselves in FAR heap.
+ *
+ * To minimize allocation overhead and to allow I/O of large contiguous
+ * blocks, we allocate the sample rows in groups of as many rows as possible
+ * without exceeding MAX_ALLOC_CHUNK total bytes per allocation request.
+ * NB: the virtual array control routines, later in this file, know about
+ * this chunking of rows. The rowsperchunk value is left in the mem manager
+ * object so that it can be saved away if this sarray is the workspace for
+ * a virtual array.
+ */
+
+METHODDEF(JSAMPARRAY)
+alloc_sarray (j_common_ptr cinfo, int pool_id,
+ JDIMENSION samplesperrow, JDIMENSION numrows)
+/* Allocate a 2-D sample array */
+{
+ my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
+ JSAMPARRAY result;
+ JSAMPROW workspace;
+ JDIMENSION rowsperchunk, currow, i;
+ long ltemp;
+
+ /* Calculate max # of rows allowed in one allocation chunk */
+ ltemp = (MAX_ALLOC_CHUNK-SIZEOF(large_pool_hdr)) /
+ ((long) samplesperrow * SIZEOF(JSAMPLE));
+ if (ltemp <= 0)
+ ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);
+ if (ltemp < (long) numrows)
+ rowsperchunk = (JDIMENSION) ltemp;
+ else
+ rowsperchunk = numrows;
+ mem->last_rowsperchunk = rowsperchunk;
+
+ /* Get space for row pointers (small object) */
+ result = (JSAMPARRAY) alloc_small(cinfo, pool_id,
+ (size_t) (numrows * SIZEOF(JSAMPROW)));
+
+ /* Get the rows themselves (large objects) */
+ currow = 0;
+ while (currow < numrows) {
+ rowsperchunk = MIN(rowsperchunk, numrows - currow);
+ workspace = (JSAMPROW) alloc_large(cinfo, pool_id,
+ (size_t) ((size_t) rowsperchunk * (size_t) samplesperrow
+ * SIZEOF(JSAMPLE)));
+ for (i = rowsperchunk; i > 0; i--) {
+ result[currow++] = workspace;
+ workspace += samplesperrow;
+ }
+ }
+
+ return result;
+}
+
+
+/*
+ * Creation of 2-D coefficient-block arrays.
+ * This is essentially the same as the code for sample arrays, above.
+ */
+
+METHODDEF(JBLOCKARRAY)
+alloc_barray (j_common_ptr cinfo, int pool_id,
+ JDIMENSION blocksperrow, JDIMENSION numrows)
+/* Allocate a 2-D coefficient-block array */
+{
+ my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
+ JBLOCKARRAY result;
+ JBLOCKROW workspace;
+ JDIMENSION rowsperchunk, currow, i;
+ long ltemp;
+
+ /* Calculate max # of rows allowed in one allocation chunk */
+ ltemp = (MAX_ALLOC_CHUNK-SIZEOF(large_pool_hdr)) /
+ ((long) blocksperrow * SIZEOF(JBLOCK));
+ if (ltemp <= 0)
+ ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);
+ if (ltemp < (long) numrows)
+ rowsperchunk = (JDIMENSION) ltemp;
+ else
+ rowsperchunk = numrows;
+ mem->last_rowsperchunk = rowsperchunk;
+
+ /* Get space for row pointers (small object) */
+ result = (JBLOCKARRAY) alloc_small(cinfo, pool_id,
+ (size_t) (numrows * SIZEOF(JBLOCKROW)));
+
+ /* Get the rows themselves (large objects) */
+ currow = 0;
+ while (currow < numrows) {
+ rowsperchunk = MIN(rowsperchunk, numrows - currow);
+ workspace = (JBLOCKROW) alloc_large(cinfo, pool_id,
+ (size_t) ((size_t) rowsperchunk * (size_t) blocksperrow
+ * SIZEOF(JBLOCK)));
+ for (i = rowsperchunk; i > 0; i--) {
+ result[currow++] = workspace;
+ workspace += blocksperrow;
+ }
+ }
+
+ return result;
+}
+
+
+/*
+ * About virtual array management:
+ *
+ * The above "normal" array routines are only used to allocate strip buffers
+ * (as wide as the image, but just a few rows high). Full-image-sized buffers
+ * are handled as "virtual" arrays. The array is still accessed a strip at a
+ * time, but the memory manager must save the whole array for repeated
+ * accesses. The intended implementation is that there is a strip buffer in
+ * memory (as high as is possible given the desired memory limit), plus a
+ * backing file that holds the rest of the array.
+ *
+ * The request_virt_array routines are told the total size of the image and
+ * the maximum number of rows that will be accessed at once. The in-memory
+ * buffer must be at least as large as the maxaccess value.
+ *
+ * The request routines create control blocks but not the in-memory buffers.
+ * That is postponed until realize_virt_arrays is called. At that time the
+ * total amount of space needed is known (approximately, anyway), so free
+ * memory can be divided up fairly.
+ *
+ * The access_virt_array routines are responsible for making a specific strip
+ * area accessible (after reading or writing the backing file, if necessary).
+ * Note that the access routines are told whether the caller intends to modify
+ * the accessed strip; during a read-only pass this saves having to rewrite
+ * data to disk. The access routines are also responsible for pre-zeroing
+ * any newly accessed rows, if pre-zeroing was requested.
+ *
+ * In current usage, the access requests are usually for nonoverlapping
+ * strips; that is, successive access start_row numbers differ by exactly
+ * num_rows = maxaccess. This means we can get good performance with simple
+ * buffer dump/reload logic, by making the in-memory buffer be a multiple
+ * of the access height; then there will never be accesses across bufferload
+ * boundaries. The code will still work with overlapping access requests,
+ * but it doesn't handle bufferload overlaps very efficiently.
+ */
+
+
+METHODDEF(jvirt_sarray_ptr)
+request_virt_sarray (j_common_ptr cinfo, int pool_id, boolean pre_zero,
+ JDIMENSION samplesperrow, JDIMENSION numrows,
+ JDIMENSION maxaccess)
+/* Request a virtual 2-D sample array */
+{
+ my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
+ jvirt_sarray_ptr result;
+
+ /* Only IMAGE-lifetime virtual arrays are currently supported */
+ if (pool_id != JPOOL_IMAGE)
+ ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id); /* safety check */
+
+ /* get control block */
+ result = (jvirt_sarray_ptr) alloc_small(cinfo, pool_id,
+ SIZEOF(struct jvirt_sarray_control));
+
+ result->mem_buffer = NULL; /* marks array not yet realized */
+ result->rows_in_array = numrows;
+ result->samplesperrow = samplesperrow;
+ result->maxaccess = maxaccess;
+ result->pre_zero = pre_zero;
+ result->b_s_open = FALSE; /* no associated backing-store object */
+ result->next = mem->virt_sarray_list; /* add to list of virtual arrays */
+ mem->virt_sarray_list = result;
+
+ return result;
+}
+
+
+METHODDEF(jvirt_barray_ptr)
+request_virt_barray (j_common_ptr cinfo, int pool_id, boolean pre_zero,
+ JDIMENSION blocksperrow, JDIMENSION numrows,
+ JDIMENSION maxaccess)
+/* Request a virtual 2-D coefficient-block array */
+{
+ my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
+ jvirt_barray_ptr result;
+
+ /* Only IMAGE-lifetime virtual arrays are currently supported */
+ if (pool_id != JPOOL_IMAGE)
+ ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id); /* safety check */
+
+ /* get control block */
+ result = (jvirt_barray_ptr) alloc_small(cinfo, pool_id,
+ SIZEOF(struct jvirt_barray_control));
+
+ result->mem_buffer = NULL; /* marks array not yet realized */
+ result->rows_in_array = numrows;
+ result->blocksperrow = blocksperrow;
+ result->maxaccess = maxaccess;
+ result->pre_zero = pre_zero;
+ result->b_s_open = FALSE; /* no associated backing-store object */
+ result->next = mem->virt_barray_list; /* add to list of virtual arrays */
+ mem->virt_barray_list = result;
+
+ return result;
+}
+
+
+METHODDEF(void)
+realize_virt_arrays (j_common_ptr cinfo)
+/* Allocate the in-memory buffers for any unrealized virtual arrays */
+{
+ my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
+ long space_per_minheight, maximum_space, avail_mem;
+ long minheights, max_minheights;
+ jvirt_sarray_ptr sptr;
+ jvirt_barray_ptr bptr;
+
+ /* Compute the minimum space needed (maxaccess rows in each buffer)
+ * and the maximum space needed (full image height in each buffer).
+ * These may be of use to the system-dependent jpeg_mem_available routine.
+ */
+ space_per_minheight = 0;
+ maximum_space = 0;
+ for (sptr = mem->virt_sarray_list; sptr != NULL; sptr = sptr->next) {
+ if (sptr->mem_buffer == NULL) { /* if not realized yet */
+ space_per_minheight += (long) sptr->maxaccess *
+ (long) sptr->samplesperrow * SIZEOF(JSAMPLE);
+ maximum_space += (long) sptr->rows_in_array *
+ (long) sptr->samplesperrow * SIZEOF(JSAMPLE);
+ }
+ }
+ for (bptr = mem->virt_barray_list; bptr != NULL; bptr = bptr->next) {
+ if (bptr->mem_buffer == NULL) { /* if not realized yet */
+ space_per_minheight += (long) bptr->maxaccess *
+ (long) bptr->blocksperrow * SIZEOF(JBLOCK);
+ maximum_space += (long) bptr->rows_in_array *
+ (long) bptr->blocksperrow * SIZEOF(JBLOCK);
+ }
+ }
+
+ if (space_per_minheight <= 0)
+ return; /* no unrealized arrays, no work */
+
+ /* Determine amount of memory to actually use; this is system-dependent. */
+ avail_mem = jpeg_mem_available(cinfo, space_per_minheight, maximum_space,
+ mem->total_space_allocated);
+
+ /* If the maximum space needed is available, make all the buffers full
+ * height; otherwise parcel it out with the same number of minheights
+ * in each buffer.
+ */
+ if (avail_mem >= maximum_space)
+ max_minheights = 1000000000L;
+ else {
+ max_minheights = avail_mem / space_per_minheight;
+ /* If there doesn't seem to be enough space, try to get the minimum
+ * anyway. This allows a "stub" implementation of jpeg_mem_available().
+ */
+ if (max_minheights <= 0)
+ max_minheights = 1;
+ }
+
+ /* Allocate the in-memory buffers and initialize backing store as needed. */
+
+ for (sptr = mem->virt_sarray_list; sptr != NULL; sptr = sptr->next) {
+ if (sptr->mem_buffer == NULL) { /* if not realized yet */
+ minheights = ((long) sptr->rows_in_array - 1L) / sptr->maxaccess + 1L;
+ if (minheights <= max_minheights) {
+ /* This buffer fits in memory */
+ sptr->rows_in_mem = sptr->rows_in_array;
+ } else {
+ /* It doesn't fit in memory, create backing store. */
+ sptr->rows_in_mem = (JDIMENSION) (max_minheights * sptr->maxaccess);
+ jpeg_open_backing_store(cinfo, & sptr->b_s_info,
+ (long) sptr->rows_in_array *
+ (long) sptr->samplesperrow *
+ (long) SIZEOF(JSAMPLE));
+ sptr->b_s_open = TRUE;
+ }
+ sptr->mem_buffer = alloc_sarray(cinfo, JPOOL_IMAGE,
+ sptr->samplesperrow, sptr->rows_in_mem);
+ sptr->rowsperchunk = mem->last_rowsperchunk;
+ sptr->cur_start_row = 0;
+ sptr->first_undef_row = 0;
+ sptr->dirty = FALSE;
+ }
+ }
+
+ for (bptr = mem->virt_barray_list; bptr != NULL; bptr = bptr->next) {
+ if (bptr->mem_buffer == NULL) { /* if not realized yet */
+ minheights = ((long) bptr->rows_in_array - 1L) / bptr->maxaccess + 1L;
+ if (minheights <= max_minheights) {
+ /* This buffer fits in memory */
+ bptr->rows_in_mem = bptr->rows_in_array;
+ } else {
+ /* It doesn't fit in memory, create backing store. */
+ bptr->rows_in_mem = (JDIMENSION) (max_minheights * bptr->maxaccess);
+ jpeg_open_backing_store(cinfo, & bptr->b_s_info,
+ (long) bptr->rows_in_array *
+ (long) bptr->blocksperrow *
+ (long) SIZEOF(JBLOCK));
+ bptr->b_s_open = TRUE;
+ }
+ bptr->mem_buffer = alloc_barray(cinfo, JPOOL_IMAGE,
+ bptr->blocksperrow, bptr->rows_in_mem);
+ bptr->rowsperchunk = mem->last_rowsperchunk;
+ bptr->cur_start_row = 0;
+ bptr->first_undef_row = 0;
+ bptr->dirty = FALSE;
+ }
+ }
+}
+
+
+LOCAL(void)
+do_sarray_io (j_common_ptr cinfo, jvirt_sarray_ptr ptr, boolean writing)
+/* Do backing store read or write of a virtual sample array */
+{
+ long bytesperrow, file_offset, byte_count, rows, thisrow, i;
+
+ bytesperrow = (long) ptr->samplesperrow * SIZEOF(JSAMPLE);
+ file_offset = ptr->cur_start_row * bytesperrow;
+ /* Loop to read or write each allocation chunk in mem_buffer */
+ for (i = 0; i < (long) ptr->rows_in_mem; i += ptr->rowsperchunk) {
+ /* One chunk, but check for short chunk at end of buffer */
+ rows = MIN((long) ptr->rowsperchunk, (long) ptr->rows_in_mem - i);
+ /* Transfer no more than is currently defined */
+ thisrow = (long) ptr->cur_start_row + i;
+ rows = MIN(rows, (long) ptr->first_undef_row - thisrow);
+ /* Transfer no more than fits in file */
+ rows = MIN(rows, (long) ptr->rows_in_array - thisrow);
+ if (rows <= 0) /* this chunk might be past end of file! */
+ break;
+ byte_count = rows * bytesperrow;
+ if (writing)
+ (*ptr->b_s_info.write_backing_store) (cinfo, & ptr->b_s_info,
+ (void FAR *) ptr->mem_buffer[i],
+ file_offset, byte_count);
+ else
+ (*ptr->b_s_info.read_backing_store) (cinfo, & ptr->b_s_info,
+ (void FAR *) ptr->mem_buffer[i],
+ file_offset, byte_count);
+ file_offset += byte_count;
+ }
+}
+
+
+LOCAL(void)
+do_barray_io (j_common_ptr cinfo, jvirt_barray_ptr ptr, boolean writing)
+/* Do backing store read or write of a virtual coefficient-block array */
+{
+ long bytesperrow, file_offset, byte_count, rows, thisrow, i;
+
+ bytesperrow = (long) ptr->blocksperrow * SIZEOF(JBLOCK);
+ file_offset = ptr->cur_start_row * bytesperrow;
+ /* Loop to read or write each allocation chunk in mem_buffer */
+ for (i = 0; i < (long) ptr->rows_in_mem; i += ptr->rowsperchunk) {
+ /* One chunk, but check for short chunk at end of buffer */
+ rows = MIN((long) ptr->rowsperchunk, (long) ptr->rows_in_mem - i);
+ /* Transfer no more than is currently defined */
+ thisrow = (long) ptr->cur_start_row + i;
+ rows = MIN(rows, (long) ptr->first_undef_row - thisrow);
+ /* Transfer no more than fits in file */
+ rows = MIN(rows, (long) ptr->rows_in_array - thisrow);
+ if (rows <= 0) /* this chunk might be past end of file! */
+ break;
+ byte_count = rows * bytesperrow;
+ if (writing)
+ (*ptr->b_s_info.write_backing_store) (cinfo, & ptr->b_s_info,
+ (void FAR *) ptr->mem_buffer[i],
+ file_offset, byte_count);
+ else
+ (*ptr->b_s_info.read_backing_store) (cinfo, & ptr->b_s_info,
+ (void FAR *) ptr->mem_buffer[i],
+ file_offset, byte_count);
+ file_offset += byte_count;
+ }
+}
+
+
+METHODDEF(JSAMPARRAY)
+access_virt_sarray (j_common_ptr cinfo, jvirt_sarray_ptr ptr,
+ JDIMENSION start_row, JDIMENSION num_rows,
+ boolean writable)
+/* Access the part of a virtual sample array starting at start_row */
+/* and extending for num_rows rows. writable is true if */
+/* caller intends to modify the accessed area. */
+{
+ JDIMENSION end_row = start_row + num_rows;
+ JDIMENSION undef_row;
+
+ /* debugging check */
+ if (end_row > ptr->rows_in_array || num_rows > ptr->maxaccess ||
+ ptr->mem_buffer == NULL)
+ ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS);
+
+ /* Make the desired part of the virtual array accessible */
+ if (start_row < ptr->cur_start_row ||
+ end_row > ptr->cur_start_row+ptr->rows_in_mem) {
+ if (! ptr->b_s_open)
+ ERREXIT(cinfo, JERR_VIRTUAL_BUG);
+ /* Flush old buffer contents if necessary */
+ if (ptr->dirty) {
+ do_sarray_io(cinfo, ptr, TRUE);
+ ptr->dirty = FALSE;
+ }
+ /* Decide what part of virtual array to access.
+ * Algorithm: if target address > current window, assume forward scan,
+ * load starting at target address. If target address < current window,
+ * assume backward scan, load so that target area is top of window.
+ * Note that when switching from forward write to forward read, will have
+ * start_row = 0, so the limiting case applies and we load from 0 anyway.
+ */
+ if (start_row > ptr->cur_start_row) {
+ ptr->cur_start_row = start_row;
+ } else {
+ /* use long arithmetic here to avoid overflow & unsigned problems */
+ long ltemp;
+
+ ltemp = (long) end_row - (long) ptr->rows_in_mem;
+ if (ltemp < 0)
+ ltemp = 0; /* don't fall off front end of file */
+ ptr->cur_start_row = (JDIMENSION) ltemp;
+ }
+ /* Read in the selected part of the array.
+ * During the initial write pass, we will do no actual read
+ * because the selected part is all undefined.
+ */
+ do_sarray_io(cinfo, ptr, FALSE);
+ }
+ /* Ensure the accessed part of the array is defined; prezero if needed.
+ * To improve locality of access, we only prezero the part of the array
+ * that the caller is about to access, not the entire in-memory array.
+ */
+ if (ptr->first_undef_row < end_row) {
+ if (ptr->first_undef_row < start_row) {
+ if (writable) /* writer skipped over a section of array */
+ ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS);
+ undef_row = start_row; /* but reader is allowed to read ahead */
+ } else {
+ undef_row = ptr->first_undef_row;
+ }
+ if (writable)
+ ptr->first_undef_row = end_row;
+ if (ptr->pre_zero) {
+ size_t bytesperrow = (size_t) ptr->samplesperrow * SIZEOF(JSAMPLE);
+ undef_row -= ptr->cur_start_row; /* make indexes relative to buffer */
+ end_row -= ptr->cur_start_row;
+ while (undef_row < end_row) {
+ jzero_far((void FAR *) ptr->mem_buffer[undef_row], bytesperrow);
+ undef_row++;
+ }
+ } else {
+ if (! writable) /* reader looking at undefined data */
+ ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS);
+ }
+ }
+ /* Flag the buffer dirty if caller will write in it */
+ if (writable)
+ ptr->dirty = TRUE;
+ /* Return address of proper part of the buffer */
+ return ptr->mem_buffer + (start_row - ptr->cur_start_row);
+}
+
+
+METHODDEF(JBLOCKARRAY)
+access_virt_barray (j_common_ptr cinfo, jvirt_barray_ptr ptr,
+ JDIMENSION start_row, JDIMENSION num_rows,
+ boolean writable)
+/* Access the part of a virtual block array starting at start_row */
+/* and extending for num_rows rows. writable is true if */
+/* caller intends to modify the accessed area. */
+{
+ JDIMENSION end_row = start_row + num_rows;
+ JDIMENSION undef_row;
+
+ /* debugging check */
+ if (end_row > ptr->rows_in_array || num_rows > ptr->maxaccess ||
+ ptr->mem_buffer == NULL)
+ ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS);
+
+ /* Make the desired part of the virtual array accessible */
+ if (start_row < ptr->cur_start_row ||
+ end_row > ptr->cur_start_row+ptr->rows_in_mem) {
+ if (! ptr->b_s_open)
+ ERREXIT(cinfo, JERR_VIRTUAL_BUG);
+ /* Flush old buffer contents if necessary */
+ if (ptr->dirty) {
+ do_barray_io(cinfo, ptr, TRUE);
+ ptr->dirty = FALSE;
+ }
+ /* Decide what part of virtual array to access.
+ * Algorithm: if target address > current window, assume forward scan,
+ * load starting at target address. If target address < current window,
+ * assume backward scan, load so that target area is top of window.
+ * Note that when switching from forward write to forward read, will have
+ * start_row = 0, so the limiting case applies and we load from 0 anyway.
+ */
+ if (start_row > ptr->cur_start_row) {
+ ptr->cur_start_row = start_row;
+ } else {
+ /* use long arithmetic here to avoid overflow & unsigned problems */
+ long ltemp;
+
+ ltemp = (long) end_row - (long) ptr->rows_in_mem;
+ if (ltemp < 0)
+ ltemp = 0; /* don't fall off front end of file */
+ ptr->cur_start_row = (JDIMENSION) ltemp;
+ }
+ /* Read in the selected part of the array.
+ * During the initial write pass, we will do no actual read
+ * because the selected part is all undefined.
+ */
+ do_barray_io(cinfo, ptr, FALSE);
+ }
+ /* Ensure the accessed part of the array is defined; prezero if needed.
+ * To improve locality of access, we only prezero the part of the array
+ * that the caller is about to access, not the entire in-memory array.
+ */
+ if (ptr->first_undef_row < end_row) {
+ if (ptr->first_undef_row < start_row) {
+ if (writable) /* writer skipped over a section of array */
+ ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS);
+ undef_row = start_row; /* but reader is allowed to read ahead */
+ } else {
+ undef_row = ptr->first_undef_row;
+ }
+ if (writable)
+ ptr->first_undef_row = end_row;
+ if (ptr->pre_zero) {
+ size_t bytesperrow = (size_t) ptr->blocksperrow * SIZEOF(JBLOCK);
+ undef_row -= ptr->cur_start_row; /* make indexes relative to buffer */
+ end_row -= ptr->cur_start_row;
+ while (undef_row < end_row) {
+ jzero_far((void FAR *) ptr->mem_buffer[undef_row], bytesperrow);
+ undef_row++;
+ }
+ } else {
+ if (! writable) /* reader looking at undefined data */
+ ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS);
+ }
+ }
+ /* Flag the buffer dirty if caller will write in it */
+ if (writable)
+ ptr->dirty = TRUE;
+ /* Return address of proper part of the buffer */
+ return ptr->mem_buffer + (start_row - ptr->cur_start_row);
+}
+
+
+/*
+ * Release all objects belonging to a specified pool.
+ */
+
+METHODDEF(void)
+free_pool (j_common_ptr cinfo, int pool_id)
+{
+ my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
+ small_pool_ptr shdr_ptr;
+ large_pool_ptr lhdr_ptr;
+ size_t space_freed;
+
+ if (pool_id < 0 || pool_id >= JPOOL_NUMPOOLS)
+ ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id); /* safety check */
+
+#ifdef MEM_STATS
+ if (cinfo->err->trace_level > 1)
+ print_mem_stats(cinfo, pool_id); /* print pool's memory usage statistics */
+#endif
+
+ /* If freeing IMAGE pool, close any virtual arrays first */
+ if (pool_id == JPOOL_IMAGE) {
+ jvirt_sarray_ptr sptr;
+ jvirt_barray_ptr bptr;
+
+ for (sptr = mem->virt_sarray_list; sptr != NULL; sptr = sptr->next) {
+ if (sptr->b_s_open) { /* there may be no backing store */
+ sptr->b_s_open = FALSE; /* prevent recursive close if error */
+ (*sptr->b_s_info.close_backing_store) (cinfo, & sptr->b_s_info);
+ }
+ }
+ mem->virt_sarray_list = NULL;
+ for (bptr = mem->virt_barray_list; bptr != NULL; bptr = bptr->next) {
+ if (bptr->b_s_open) { /* there may be no backing store */
+ bptr->b_s_open = FALSE; /* prevent recursive close if error */
+ (*bptr->b_s_info.close_backing_store) (cinfo, & bptr->b_s_info);
+ }
+ }
+ mem->virt_barray_list = NULL;
+ }
+
+ /* Release large objects */
+ lhdr_ptr = mem->large_list[pool_id];
+ mem->large_list[pool_id] = NULL;
+
+ while (lhdr_ptr != NULL) {
+ large_pool_ptr next_lhdr_ptr = lhdr_ptr->hdr.next;
+ space_freed = lhdr_ptr->hdr.bytes_used +
+ lhdr_ptr->hdr.bytes_left +
+ SIZEOF(large_pool_hdr);
+ jpeg_free_large(cinfo, (void FAR *) lhdr_ptr, space_freed);
+ mem->total_space_allocated -= space_freed;
+ lhdr_ptr = next_lhdr_ptr;
+ }
+
+ /* Release small objects */
+ shdr_ptr = mem->small_list[pool_id];
+ mem->small_list[pool_id] = NULL;
+
+ while (shdr_ptr != NULL) {
+ small_pool_ptr next_shdr_ptr = shdr_ptr->hdr.next;
+ space_freed = shdr_ptr->hdr.bytes_used +
+ shdr_ptr->hdr.bytes_left +
+ SIZEOF(small_pool_hdr);
+ jpeg_free_small(cinfo, (void *) shdr_ptr, space_freed);
+ mem->total_space_allocated -= space_freed;
+ shdr_ptr = next_shdr_ptr;
+ }
+}
+
+
+/*
+ * Close up shop entirely.
+ * Note that this cannot be called unless cinfo->mem is non-NULL.
+ */
+
+METHODDEF(void)
+self_destruct (j_common_ptr cinfo)
+{
+ int pool;
+
+ /* Close all backing store, release all memory.
+ * Releasing pools in reverse order might help avoid fragmentation
+ * with some (brain-damaged) malloc libraries.
+ */
+ for (pool = JPOOL_NUMPOOLS-1; pool >= JPOOL_PERMANENT; pool--) {
+ free_pool(cinfo, pool);
+ }
+
+ /* Release the memory manager control block too. */
+ jpeg_free_small(cinfo, (void *) cinfo->mem, SIZEOF(my_memory_mgr));
+ cinfo->mem = NULL; /* ensures I will be called only once */
+
+ jpeg_mem_term(cinfo); /* system-dependent cleanup */
+}
+
+
+/*
+ * Memory manager initialization.
+ * When this is called, only the error manager pointer is valid in cinfo!
+ */
+
+GLOBAL(void)
+jinit_memory_mgr (j_common_ptr cinfo)
+{
+ my_mem_ptr mem;
+ long max_to_use;
+ int pool;
+ size_t test_mac;
+
+ cinfo->mem = NULL; /* for safety if init fails */
+
+ /* Check for configuration errors.
+ * SIZEOF(ALIGN_TYPE) should be a power of 2; otherwise, it probably
+ * doesn't reflect any real hardware alignment requirement.
+ * The test is a little tricky: for X>0, X and X-1 have no one-bits
+ * in common if and only if X is a power of 2, ie has only one one-bit.
+ * Some compilers may give an "unreachable code" warning here; ignore it.
+ */
+ if ((SIZEOF(ALIGN_TYPE) & (SIZEOF(ALIGN_TYPE)-1)) != 0)
+ ERREXIT(cinfo, JERR_BAD_ALIGN_TYPE);
+ /* MAX_ALLOC_CHUNK must be representable as type size_t, and must be
+ * a multiple of SIZEOF(ALIGN_TYPE).
+ * Again, an "unreachable code" warning may be ignored here.
+ * But a "constant too large" warning means you need to fix MAX_ALLOC_CHUNK.
+ */
+ test_mac = (size_t) MAX_ALLOC_CHUNK;
+ if ((long) test_mac != MAX_ALLOC_CHUNK ||
+ (MAX_ALLOC_CHUNK % SIZEOF(ALIGN_TYPE)) != 0)
+ ERREXIT(cinfo, JERR_BAD_ALLOC_CHUNK);
+
+ max_to_use = jpeg_mem_init(cinfo); /* system-dependent initialization */
+
+ /* Attempt to allocate memory manager's control block */
+ mem = (my_mem_ptr) jpeg_get_small(cinfo, SIZEOF(my_memory_mgr));
+
+ if (mem == NULL) {
+ jpeg_mem_term(cinfo); /* system-dependent cleanup */
+ ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, 0);
+ }
+
+ /* OK, fill in the method pointers */
+ mem->pub.alloc_small = alloc_small;
+ mem->pub.alloc_large = alloc_large;
+ mem->pub.alloc_sarray = alloc_sarray;
+ mem->pub.alloc_barray = alloc_barray;
+ mem->pub.request_virt_sarray = request_virt_sarray;
+ mem->pub.request_virt_barray = request_virt_barray;
+ mem->pub.realize_virt_arrays = realize_virt_arrays;
+ mem->pub.access_virt_sarray = access_virt_sarray;
+ mem->pub.access_virt_barray = access_virt_barray;
+ mem->pub.free_pool = free_pool;
+ mem->pub.self_destruct = self_destruct;
+
+ /* Make MAX_ALLOC_CHUNK accessible to other modules */
+ mem->pub.max_alloc_chunk = MAX_ALLOC_CHUNK;
+
+ /* Initialize working state */
+ mem->pub.max_memory_to_use = max_to_use;
+
+ for (pool = JPOOL_NUMPOOLS-1; pool >= JPOOL_PERMANENT; pool--) {
+ mem->small_list[pool] = NULL;
+ mem->large_list[pool] = NULL;
+ }
+ mem->virt_sarray_list = NULL;
+ mem->virt_barray_list = NULL;
+
+ mem->total_space_allocated = SIZEOF(my_memory_mgr);
+
+ /* Declare ourselves open for business */
+ cinfo->mem = & mem->pub;
+
+ /* Check for an environment variable JPEGMEM; if found, override the
+ * default max_memory setting from jpeg_mem_init. Note that the
+ * surrounding application may again override this value.
+ * If your system doesn't support getenv(), define NO_GETENV to disable
+ * this feature.
+ */
+#ifndef NO_GETENV
+ { char * memenv;
+
+ if ((memenv = getenv("JPEGMEM")) != NULL) {
+ char ch = 'x';
+
+ if (sscanf(memenv, "%ld%c", &max_to_use, &ch) > 0) {
+ if (ch == 'm' || ch == 'M')
+ max_to_use *= 1000L;
+ mem->pub.max_memory_to_use = max_to_use * 1000L;
+ }
+ }
+ }
+#endif
+
+}
+
+#endif //_FX_JPEG_TURBO_
diff --git a/core/src/fxcodec/libjpeg/fpdfapi_jmemnobs.c b/core/src/fxcodec/libjpeg/fpdfapi_jmemnobs.c
index 98aed723a6..f1f789a1a6 100644
--- a/core/src/fxcodec/libjpeg/fpdfapi_jmemnobs.c
+++ b/core/src/fxcodec/libjpeg/fpdfapi_jmemnobs.c
@@ -1,126 +1,126 @@
-#if !defined(_FX_JPEG_TURBO_)
-/*
- * jmemnobs.c
- *
- * Copyright (C) 1992-1996, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- * For conditions of distribution and use, see the accompanying README file.
- *
- * This file provides a really simple implementation of the system-
- * dependent portion of the JPEG memory manager. This implementation
- * assumes that no backing-store files are needed: all required space
- * can be obtained from malloc().
- * This is very portable in the sense that it'll compile on almost anything,
- * but you'd better have lots of main memory (or virtual memory) if you want
- * to process big images.
- * Note that the max_memory_to_use option is ignored by this implementation.
- */
-
-#define JPEG_INTERNALS
-#include "jinclude.h"
-#include "jpeglib.h"
-#include "jmemsys.h" /* import the system-dependent declarations */
-
-#ifndef HAVE_STDLIB_H /* <stdlib.h> should declare malloc(),free() */
-extern void * malloc JPP((size_t size));
-extern void free JPP((void *ptr));
-#endif
-
-#if defined(_FX_MANAGED_CODE_) && defined(__cplusplus)
-extern "C" {
-#endif
-
-void* FXMEM_DefaultAlloc(int byte_size, int);
-void FXMEM_DefaultFree(void* pointer, int);
-
-#if defined(_FX_MANAGED_CODE_) && defined(__cplusplus)
-}
-#endif
-
-/*
- * Memory allocation and freeing are controlled by the regular library
- * routines malloc() and free().
- */
-
-GLOBAL(void *)
-jpeg_get_small (j_common_ptr cinfo, size_t sizeofobject)
-{
-// return (void *) malloc(sizeofobject);
- return FXMEM_DefaultAlloc(sizeofobject, 0);
-}
-
-GLOBAL(void)
-jpeg_free_small (j_common_ptr cinfo, void * object, size_t sizeofobject)
-{
-// free(object);
- FXMEM_DefaultFree(object, 0);
-}
-
-
-/*
- * "Large" objects are treated the same as "small" ones.
- * NB: although we include FAR keywords in the routine declarations,
- * this file won't actually work in 80x86 small/medium model; at least,
- * you probably won't be able to process useful-size images in only 64KB.
- */
-
-GLOBAL(void FAR *)
-jpeg_get_large (j_common_ptr cinfo, size_t sizeofobject)
-{
-// return (void FAR *) malloc(sizeofobject);
- return FXMEM_DefaultAlloc(sizeofobject, 0);
-}
-
-GLOBAL(void)
-jpeg_free_large (j_common_ptr cinfo, void FAR * object, size_t sizeofobject)
-{
-// free(object);
- FXMEM_DefaultFree(object, 0);
-}
-
-
-/*
- * This routine computes the total memory space available for allocation.
- * Here we always say, "we got all you want bud!"
- */
-
-GLOBAL(long)
-jpeg_mem_available (j_common_ptr cinfo, long min_bytes_needed,
- long max_bytes_needed, long already_allocated)
-{
- return max_bytes_needed;
-}
-
-
-/*
- * Backing store (temporary file) management.
- * Since jpeg_mem_available always promised the moon,
- * this should never be called and we can just error out.
- */
-
-GLOBAL(void)
-jpeg_open_backing_store (j_common_ptr cinfo, backing_store_ptr info,
- long total_bytes_needed)
-{
- ERREXIT(cinfo, JERR_NO_BACKING_STORE);
-}
-
-
-/*
- * These routines take care of any system-dependent initialization and
- * cleanup required. Here, there isn't any.
- */
-
-GLOBAL(long)
-jpeg_mem_init (j_common_ptr cinfo)
-{
- return 0; /* just set max_memory_to_use to 0 */
-}
-
-GLOBAL(void)
-jpeg_mem_term (j_common_ptr cinfo)
-{
- /* no work */
-}
-
-#endif //_FX_JPEG_TURBO_
+#if !defined(_FX_JPEG_TURBO_)
+/*
+ * jmemnobs.c
+ *
+ * Copyright (C) 1992-1996, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file provides a really simple implementation of the system-
+ * dependent portion of the JPEG memory manager. This implementation
+ * assumes that no backing-store files are needed: all required space
+ * can be obtained from malloc().
+ * This is very portable in the sense that it'll compile on almost anything,
+ * but you'd better have lots of main memory (or virtual memory) if you want
+ * to process big images.
+ * Note that the max_memory_to_use option is ignored by this implementation.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+#include "jmemsys.h" /* import the system-dependent declarations */
+
+#ifndef HAVE_STDLIB_H /* <stdlib.h> should declare malloc(),free() */
+extern void * malloc JPP((size_t size));
+extern void free JPP((void *ptr));
+#endif
+
+#if defined(_FX_MANAGED_CODE_) && defined(__cplusplus)
+extern "C" {
+#endif
+
+void* FXMEM_DefaultAlloc(int byte_size, int);
+void FXMEM_DefaultFree(void* pointer, int);
+
+#if defined(_FX_MANAGED_CODE_) && defined(__cplusplus)
+}
+#endif
+
+/*
+ * Memory allocation and freeing are controlled by the regular library
+ * routines malloc() and free().
+ */
+
+GLOBAL(void *)
+jpeg_get_small (j_common_ptr cinfo, size_t sizeofobject)
+{
+// return (void *) malloc(sizeofobject);
+ return FXMEM_DefaultAlloc(sizeofobject, 0);
+}
+
+GLOBAL(void)
+jpeg_free_small (j_common_ptr cinfo, void * object, size_t sizeofobject)
+{
+// free(object);
+ FXMEM_DefaultFree(object, 0);
+}
+
+
+/*
+ * "Large" objects are treated the same as "small" ones.
+ * NB: although we include FAR keywords in the routine declarations,
+ * this file won't actually work in 80x86 small/medium model; at least,
+ * you probably won't be able to process useful-size images in only 64KB.
+ */
+
+GLOBAL(void FAR *)
+jpeg_get_large (j_common_ptr cinfo, size_t sizeofobject)
+{
+// return (void FAR *) malloc(sizeofobject);
+ return FXMEM_DefaultAlloc(sizeofobject, 0);
+}
+
+GLOBAL(void)
+jpeg_free_large (j_common_ptr cinfo, void FAR * object, size_t sizeofobject)
+{
+// free(object);
+ FXMEM_DefaultFree(object, 0);
+}
+
+
+/*
+ * This routine computes the total memory space available for allocation.
+ * Here we always say, "we got all you want bud!"
+ */
+
+GLOBAL(long)
+jpeg_mem_available (j_common_ptr cinfo, long min_bytes_needed,
+ long max_bytes_needed, long already_allocated)
+{
+ return max_bytes_needed;
+}
+
+
+/*
+ * Backing store (temporary file) management.
+ * Since jpeg_mem_available always promised the moon,
+ * this should never be called and we can just error out.
+ */
+
+GLOBAL(void)
+jpeg_open_backing_store (j_common_ptr cinfo, backing_store_ptr info,
+ long total_bytes_needed)
+{
+ ERREXIT(cinfo, JERR_NO_BACKING_STORE);
+}
+
+
+/*
+ * These routines take care of any system-dependent initialization and
+ * cleanup required. Here, there isn't any.
+ */
+
+GLOBAL(long)
+jpeg_mem_init (j_common_ptr cinfo)
+{
+ return 0; /* just set max_memory_to_use to 0 */
+}
+
+GLOBAL(void)
+jpeg_mem_term (j_common_ptr cinfo)
+{
+ /* no work */
+}
+
+#endif //_FX_JPEG_TURBO_
diff --git a/core/src/fxcodec/libjpeg/fpdfapi_jutils.c b/core/src/fxcodec/libjpeg/fpdfapi_jutils.c
index 251fd504e5..c6f7248af8 100644
--- a/core/src/fxcodec/libjpeg/fpdfapi_jutils.c
+++ b/core/src/fxcodec/libjpeg/fpdfapi_jutils.c
@@ -1,182 +1,182 @@
-#if !defined(_FX_JPEG_TURBO_)
-/*
- * jutils.c
- *
- * Copyright (C) 1991-1996, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- * For conditions of distribution and use, see the accompanying README file.
- *
- * This file contains tables and miscellaneous utility routines needed
- * for both compression and decompression.
- * Note we prefix all global names with "j" to minimize conflicts with
- * a surrounding application.
- */
-
-#define JPEG_INTERNALS
-#include "jinclude.h"
-#include "jpeglib.h"
-
-
-/*
- * jpeg_zigzag_order[i] is the zigzag-order position of the i'th element
- * of a DCT block read in natural order (left to right, top to bottom).
- */
-
-#if 0 /* This table is not actually needed in v6a */
-
-const int jpeg_zigzag_order[DCTSIZE2] = {
- 0, 1, 5, 6, 14, 15, 27, 28,
- 2, 4, 7, 13, 16, 26, 29, 42,
- 3, 8, 12, 17, 25, 30, 41, 43,
- 9, 11, 18, 24, 31, 40, 44, 53,
- 10, 19, 23, 32, 39, 45, 52, 54,
- 20, 22, 33, 38, 46, 51, 55, 60,
- 21, 34, 37, 47, 50, 56, 59, 61,
- 35, 36, 48, 49, 57, 58, 62, 63
-};
-
-#endif
-
-/*
- * jpeg_natural_order[i] is the natural-order position of the i'th element
- * of zigzag order.
- *
- * When reading corrupted data, the Huffman decoders could attempt
- * to reference an entry beyond the end of this array (if the decoded
- * zero run length reaches past the end of the block). To prevent
- * wild stores without adding an inner-loop test, we put some extra
- * "63"s after the real entries. This will cause the extra coefficient
- * to be stored in location 63 of the block, not somewhere random.
- * The worst case would be a run-length of 15, which means we need 16
- * fake entries.
- */
-
-const int jpeg_natural_order[DCTSIZE2+16] = {
- 0, 1, 8, 16, 9, 2, 3, 10,
- 17, 24, 32, 25, 18, 11, 4, 5,
- 12, 19, 26, 33, 40, 48, 41, 34,
- 27, 20, 13, 6, 7, 14, 21, 28,
- 35, 42, 49, 56, 57, 50, 43, 36,
- 29, 22, 15, 23, 30, 37, 44, 51,
- 58, 59, 52, 45, 38, 31, 39, 46,
- 53, 60, 61, 54, 47, 55, 62, 63,
- 63, 63, 63, 63, 63, 63, 63, 63, /* extra entries for safety in decoder */
- 63, 63, 63, 63, 63, 63, 63, 63
-};
-
-
-/*
- * Arithmetic utilities
- */
-
-GLOBAL(long)
-jdiv_round_up (long a, long b)
-/* Compute a/b rounded up to next integer, ie, ceil(a/b) */
-/* Assumes a >= 0, b > 0 */
-{
- return (a + b - 1L) / b;
-}
-
-
-GLOBAL(long)
-jround_up (long a, long b)
-/* Compute a rounded up to next multiple of b, ie, ceil(a/b)*b */
-/* Assumes a >= 0, b > 0 */
-{
- a += b - 1L;
- return a - (a % b);
-}
-
-
-/* On normal machines we can apply MEMCOPY() and MEMZERO() to sample arrays
- * and coefficient-block arrays. This won't work on 80x86 because the arrays
- * are FAR and we're assuming a small-pointer memory model. However, some
- * DOS compilers provide far-pointer versions of memcpy() and memset() even
- * in the small-model libraries. These will be used if USE_FMEM is defined.
- * Otherwise, the routines below do it the hard way. (The performance cost
- * is not all that great, because these routines aren't very heavily used.)
- */
-
-#ifndef NEED_FAR_POINTERS /* normal case, same as regular macros */
-#define FMEMCOPY(dest,src,size) MEMCOPY(dest,src,size)
-#define FMEMZERO(target,size) MEMZERO(target,size)
-#else /* 80x86 case, define if we can */
-#ifdef USE_FMEM
-#define FMEMCOPY(dest,src,size) _fmemcpy((void FAR *)(dest), (const void FAR *)(src), (size_t)(size))
-#define FMEMZERO(target,size) _fmemset((void FAR *)(target), 0, (size_t)(size))
-#endif
-#endif
-
-
-GLOBAL(void)
-jcopy_sample_rows (JSAMPARRAY input_array, int source_row,
- JSAMPARRAY output_array, int dest_row,
- int num_rows, JDIMENSION num_cols)
-/* Copy some rows of samples from one place to another.
- * num_rows rows are copied from input_array[source_row++]
- * to output_array[dest_row++]; these areas may overlap for duplication.
- * The source and destination arrays must be at least as wide as num_cols.
- */
-{
- register JSAMPROW inptr, outptr;
-#ifdef FMEMCOPY
- register size_t count = (size_t) (num_cols * SIZEOF(JSAMPLE));
-#else
- register JDIMENSION count;
-#endif
- register int row;
-
- input_array += source_row;
- output_array += dest_row;
-
- for (row = num_rows; row > 0; row--) {
- inptr = *input_array++;
- outptr = *output_array++;
-#ifdef FMEMCOPY
- FMEMCOPY(outptr, inptr, count);
-#else
- for (count = num_cols; count > 0; count--)
- *outptr++ = *inptr++; /* needn't bother with GETJSAMPLE() here */
-#endif
- }
-}
-
-
-GLOBAL(void)
-jcopy_block_row (JBLOCKROW input_row, JBLOCKROW output_row,
- JDIMENSION num_blocks)
-/* Copy a row of coefficient blocks from one place to another. */
-{
-#ifdef FMEMCOPY
- FMEMCOPY(output_row, input_row, num_blocks * (DCTSIZE2 * SIZEOF(JCOEF)));
-#else
- register JCOEFPTR inptr, outptr;
- register long count;
-
- inptr = (JCOEFPTR) input_row;
- outptr = (JCOEFPTR) output_row;
- for (count = (long) num_blocks * DCTSIZE2; count > 0; count--) {
- *outptr++ = *inptr++;
- }
-#endif
-}
-
-
-GLOBAL(void)
-jzero_far (void FAR * target, size_t bytestozero)
-/* Zero out a chunk of FAR memory. */
-/* This might be sample-array data, block-array data, or alloc_large data. */
-{
-#ifdef FMEMZERO
- FMEMZERO(target, bytestozero);
-#else
- register char FAR * ptr = (char FAR *) target;
- register size_t count;
-
- for (count = bytestozero; count > 0; count--) {
- *ptr++ = 0;
- }
-#endif
-}
-
-#endif //_FX_JPEG_TURBO_
+#if !defined(_FX_JPEG_TURBO_)
+/*
+ * jutils.c
+ *
+ * Copyright (C) 1991-1996, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains tables and miscellaneous utility routines needed
+ * for both compression and decompression.
+ * Note we prefix all global names with "j" to minimize conflicts with
+ * a surrounding application.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+
+
+/*
+ * jpeg_zigzag_order[i] is the zigzag-order position of the i'th element
+ * of a DCT block read in natural order (left to right, top to bottom).
+ */
+
+#if 0 /* This table is not actually needed in v6a */
+
+const int jpeg_zigzag_order[DCTSIZE2] = {
+ 0, 1, 5, 6, 14, 15, 27, 28,
+ 2, 4, 7, 13, 16, 26, 29, 42,
+ 3, 8, 12, 17, 25, 30, 41, 43,
+ 9, 11, 18, 24, 31, 40, 44, 53,
+ 10, 19, 23, 32, 39, 45, 52, 54,
+ 20, 22, 33, 38, 46, 51, 55, 60,
+ 21, 34, 37, 47, 50, 56, 59, 61,
+ 35, 36, 48, 49, 57, 58, 62, 63
+};
+
+#endif
+
+/*
+ * jpeg_natural_order[i] is the natural-order position of the i'th element
+ * of zigzag order.
+ *
+ * When reading corrupted data, the Huffman decoders could attempt
+ * to reference an entry beyond the end of this array (if the decoded
+ * zero run length reaches past the end of the block). To prevent
+ * wild stores without adding an inner-loop test, we put some extra
+ * "63"s after the real entries. This will cause the extra coefficient
+ * to be stored in location 63 of the block, not somewhere random.
+ * The worst case would be a run-length of 15, which means we need 16
+ * fake entries.
+ */
+
+const int jpeg_natural_order[DCTSIZE2+16] = {
+ 0, 1, 8, 16, 9, 2, 3, 10,
+ 17, 24, 32, 25, 18, 11, 4, 5,
+ 12, 19, 26, 33, 40, 48, 41, 34,
+ 27, 20, 13, 6, 7, 14, 21, 28,
+ 35, 42, 49, 56, 57, 50, 43, 36,
+ 29, 22, 15, 23, 30, 37, 44, 51,
+ 58, 59, 52, 45, 38, 31, 39, 46,
+ 53, 60, 61, 54, 47, 55, 62, 63,
+ 63, 63, 63, 63, 63, 63, 63, 63, /* extra entries for safety in decoder */
+ 63, 63, 63, 63, 63, 63, 63, 63
+};
+
+
+/*
+ * Arithmetic utilities
+ */
+
+GLOBAL(long)
+jdiv_round_up (long a, long b)
+/* Compute a/b rounded up to next integer, ie, ceil(a/b) */
+/* Assumes a >= 0, b > 0 */
+{
+ return (a + b - 1L) / b;
+}
+
+
+GLOBAL(long)
+jround_up (long a, long b)
+/* Compute a rounded up to next multiple of b, ie, ceil(a/b)*b */
+/* Assumes a >= 0, b > 0 */
+{
+ a += b - 1L;
+ return a - (a % b);
+}
+
+
+/* On normal machines we can apply MEMCOPY() and MEMZERO() to sample arrays
+ * and coefficient-block arrays. This won't work on 80x86 because the arrays
+ * are FAR and we're assuming a small-pointer memory model. However, some
+ * DOS compilers provide far-pointer versions of memcpy() and memset() even
+ * in the small-model libraries. These will be used if USE_FMEM is defined.
+ * Otherwise, the routines below do it the hard way. (The performance cost
+ * is not all that great, because these routines aren't very heavily used.)
+ */
+
+#ifndef NEED_FAR_POINTERS /* normal case, same as regular macros */
+#define FMEMCOPY(dest,src,size) MEMCOPY(dest,src,size)
+#define FMEMZERO(target,size) MEMZERO(target,size)
+#else /* 80x86 case, define if we can */
+#ifdef USE_FMEM
+#define FMEMCOPY(dest,src,size) _fmemcpy((void FAR *)(dest), (const void FAR *)(src), (size_t)(size))
+#define FMEMZERO(target,size) _fmemset((void FAR *)(target), 0, (size_t)(size))
+#endif
+#endif
+
+
+GLOBAL(void)
+jcopy_sample_rows (JSAMPARRAY input_array, int source_row,
+ JSAMPARRAY output_array, int dest_row,
+ int num_rows, JDIMENSION num_cols)
+/* Copy some rows of samples from one place to another.
+ * num_rows rows are copied from input_array[source_row++]
+ * to output_array[dest_row++]; these areas may overlap for duplication.
+ * The source and destination arrays must be at least as wide as num_cols.
+ */
+{
+ register JSAMPROW inptr, outptr;
+#ifdef FMEMCOPY
+ register size_t count = (size_t) (num_cols * SIZEOF(JSAMPLE));
+#else
+ register JDIMENSION count;
+#endif
+ register int row;
+
+ input_array += source_row;
+ output_array += dest_row;
+
+ for (row = num_rows; row > 0; row--) {
+ inptr = *input_array++;
+ outptr = *output_array++;
+#ifdef FMEMCOPY
+ FMEMCOPY(outptr, inptr, count);
+#else
+ for (count = num_cols; count > 0; count--)
+ *outptr++ = *inptr++; /* needn't bother with GETJSAMPLE() here */
+#endif
+ }
+}
+
+
+GLOBAL(void)
+jcopy_block_row (JBLOCKROW input_row, JBLOCKROW output_row,
+ JDIMENSION num_blocks)
+/* Copy a row of coefficient blocks from one place to another. */
+{
+#ifdef FMEMCOPY
+ FMEMCOPY(output_row, input_row, num_blocks * (DCTSIZE2 * SIZEOF(JCOEF)));
+#else
+ register JCOEFPTR inptr, outptr;
+ register long count;
+
+ inptr = (JCOEFPTR) input_row;
+ outptr = (JCOEFPTR) output_row;
+ for (count = (long) num_blocks * DCTSIZE2; count > 0; count--) {
+ *outptr++ = *inptr++;
+ }
+#endif
+}
+
+
+GLOBAL(void)
+jzero_far (void FAR * target, size_t bytestozero)
+/* Zero out a chunk of FAR memory. */
+/* This might be sample-array data, block-array data, or alloc_large data. */
+{
+#ifdef FMEMZERO
+ FMEMZERO(target, bytestozero);
+#else
+ register char FAR * ptr = (char FAR *) target;
+ register size_t count;
+
+ for (count = bytestozero; count > 0; count--) {
+ *ptr++ = 0;
+ }
+#endif
+}
+
+#endif //_FX_JPEG_TURBO_
diff --git a/core/src/fxcodec/libjpeg/jchuff.h b/core/src/fxcodec/libjpeg/jchuff.h
index 8c02c09ad0..a9599fc1e6 100644
--- a/core/src/fxcodec/libjpeg/jchuff.h
+++ b/core/src/fxcodec/libjpeg/jchuff.h
@@ -1,47 +1,47 @@
-/*
- * jchuff.h
- *
- * Copyright (C) 1991-1997, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- * For conditions of distribution and use, see the accompanying README file.
- *
- * This file contains declarations for Huffman entropy encoding routines
- * that are shared between the sequential encoder (jchuff.c) and the
- * progressive encoder (jcphuff.c). No other modules need to see these.
- */
-
-/* The legal range of a DCT coefficient is
- * -1024 .. +1023 for 8-bit data;
- * -16384 .. +16383 for 12-bit data.
- * Hence the magnitude should always fit in 10 or 14 bits respectively.
- */
-
-#if BITS_IN_JSAMPLE == 8
-#define MAX_COEF_BITS 10
-#else
-#define MAX_COEF_BITS 14
-#endif
-
-/* Derived data constructed for each Huffman table */
-
-typedef struct {
- unsigned int ehufco[256]; /* code for each symbol */
- char ehufsi[256]; /* length of code for each symbol */
- /* If no code has been allocated for a symbol S, ehufsi[S] contains 0 */
-} c_derived_tbl;
-
-/* Short forms of external names for systems with brain-damaged linkers. */
-
-#ifdef NEED_SHORT_EXTERNAL_NAMES
-#define jpeg_make_c_derived_tbl jMkCDerived
-#define jpeg_gen_optimal_table jGenOptTbl
-#endif /* NEED_SHORT_EXTERNAL_NAMES */
-
-/* Expand a Huffman table definition into the derived format */
-EXTERN(void) jpeg_make_c_derived_tbl
- JPP((j_compress_ptr cinfo, boolean isDC, int tblno,
- c_derived_tbl ** pdtbl));
-
-/* Generate an optimal table definition given the specified counts */
-EXTERN(void) jpeg_gen_optimal_table
- JPP((j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[]));
+/*
+ * jchuff.h
+ *
+ * Copyright (C) 1991-1997, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains declarations for Huffman entropy encoding routines
+ * that are shared between the sequential encoder (jchuff.c) and the
+ * progressive encoder (jcphuff.c). No other modules need to see these.
+ */
+
+/* The legal range of a DCT coefficient is
+ * -1024 .. +1023 for 8-bit data;
+ * -16384 .. +16383 for 12-bit data.
+ * Hence the magnitude should always fit in 10 or 14 bits respectively.
+ */
+
+#if BITS_IN_JSAMPLE == 8
+#define MAX_COEF_BITS 10
+#else
+#define MAX_COEF_BITS 14
+#endif
+
+/* Derived data constructed for each Huffman table */
+
+typedef struct {
+ unsigned int ehufco[256]; /* code for each symbol */
+ char ehufsi[256]; /* length of code for each symbol */
+ /* If no code has been allocated for a symbol S, ehufsi[S] contains 0 */
+} c_derived_tbl;
+
+/* Short forms of external names for systems with brain-damaged linkers. */
+
+#ifdef NEED_SHORT_EXTERNAL_NAMES
+#define jpeg_make_c_derived_tbl jMkCDerived
+#define jpeg_gen_optimal_table jGenOptTbl
+#endif /* NEED_SHORT_EXTERNAL_NAMES */
+
+/* Expand a Huffman table definition into the derived format */
+EXTERN(void) jpeg_make_c_derived_tbl
+ JPP((j_compress_ptr cinfo, boolean isDC, int tblno,
+ c_derived_tbl ** pdtbl));
+
+/* Generate an optimal table definition given the specified counts */
+EXTERN(void) jpeg_gen_optimal_table
+ JPP((j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[]));
diff --git a/core/src/fxcodec/libjpeg/jconfig.h b/core/src/fxcodec/libjpeg/jconfig.h
index 2f4da14c54..7e291c75bd 100644
--- a/core/src/fxcodec/libjpeg/jconfig.h
+++ b/core/src/fxcodec/libjpeg/jconfig.h
@@ -1,45 +1,45 @@
-/* jconfig.vc --- jconfig.h for Microsoft Visual C++ on Windows 95 or NT. */
-/* see jconfig.doc for explanations */
-
-#define HAVE_PROTOTYPES
-#define HAVE_UNSIGNED_CHAR
-#define HAVE_UNSIGNED_SHORT
-/* #define void char */
-/* #define const */
-#undef CHAR_IS_UNSIGNED
-#define HAVE_STDDEF_H
-#define HAVE_STDLIB_H
-#undef NEED_BSD_STRINGS
-#undef NEED_SYS_TYPES_H
-#undef NEED_FAR_POINTERS /* we presume a 32-bit flat memory model */
-#undef NEED_SHORT_EXTERNAL_NAMES
-#undef INCOMPLETE_TYPES_BROKEN
-
-/* Define "boolean" as unsigned char, not int, per Windows custom */
-#ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */
-typedef unsigned char boolean;
-#endif
-#define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */
-
-
-#ifdef JPEG_INTERNALS
-
-#undef RIGHT_SHIFT_IS_UNSIGNED
-
-#endif /* JPEG_INTERNALS */
-
-#ifdef JPEG_CJPEG_DJPEG
-
-#define BMP_SUPPORTED /* BMP image file format */
-#define GIF_SUPPORTED /* GIF image file format */
-#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */
-#undef RLE_SUPPORTED /* Utah RLE image file format */
-#define TARGA_SUPPORTED /* Targa image file format */
-
-#define TWO_FILE_COMMANDLINE /* optional */
-#define USE_SETMODE /* Microsoft has setmode() */
-#undef NEED_SIGNAL_CATCHER
-#undef DONT_USE_B_MODE
-#undef PROGRESS_REPORT /* optional */
-
-#endif /* JPEG_CJPEG_DJPEG */
+/* jconfig.vc --- jconfig.h for Microsoft Visual C++ on Windows 95 or NT. */
+/* see jconfig.doc for explanations */
+
+#define HAVE_PROTOTYPES
+#define HAVE_UNSIGNED_CHAR
+#define HAVE_UNSIGNED_SHORT
+/* #define void char */
+/* #define const */
+#undef CHAR_IS_UNSIGNED
+#define HAVE_STDDEF_H
+#define HAVE_STDLIB_H
+#undef NEED_BSD_STRINGS
+#undef NEED_SYS_TYPES_H
+#undef NEED_FAR_POINTERS /* we presume a 32-bit flat memory model */
+#undef NEED_SHORT_EXTERNAL_NAMES
+#undef INCOMPLETE_TYPES_BROKEN
+
+/* Define "boolean" as unsigned char, not int, per Windows custom */
+#ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */
+typedef unsigned char boolean;
+#endif
+#define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */
+
+
+#ifdef JPEG_INTERNALS
+
+#undef RIGHT_SHIFT_IS_UNSIGNED
+
+#endif /* JPEG_INTERNALS */
+
+#ifdef JPEG_CJPEG_DJPEG
+
+#define BMP_SUPPORTED /* BMP image file format */
+#define GIF_SUPPORTED /* GIF image file format */
+#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */
+#undef RLE_SUPPORTED /* Utah RLE image file format */
+#define TARGA_SUPPORTED /* Targa image file format */
+
+#define TWO_FILE_COMMANDLINE /* optional */
+#define USE_SETMODE /* Microsoft has setmode() */
+#undef NEED_SIGNAL_CATCHER
+#undef DONT_USE_B_MODE
+#undef PROGRESS_REPORT /* optional */
+
+#endif /* JPEG_CJPEG_DJPEG */
diff --git a/core/src/fxcodec/libjpeg/jdct.h b/core/src/fxcodec/libjpeg/jdct.h
index b664cab0d2..04192a266a 100644
--- a/core/src/fxcodec/libjpeg/jdct.h
+++ b/core/src/fxcodec/libjpeg/jdct.h
@@ -1,176 +1,176 @@
-/*
- * jdct.h
- *
- * Copyright (C) 1994-1996, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- * For conditions of distribution and use, see the accompanying README file.
- *
- * This include file contains common declarations for the forward and
- * inverse DCT modules. These declarations are private to the DCT managers
- * (jcdctmgr.c, jddctmgr.c) and the individual DCT algorithms.
- * The individual DCT algorithms are kept in separate files to ease
- * machine-dependent tuning (e.g., assembly coding).
- */
-
-
-/*
- * A forward DCT routine is given a pointer to a work area of type DCTELEM[];
- * the DCT is to be performed in-place in that buffer. Type DCTELEM is int
- * for 8-bit samples, INT32 for 12-bit samples. (NOTE: Floating-point DCT
- * implementations use an array of type FAST_FLOAT, instead.)
- * The DCT inputs are expected to be signed (range +-CENTERJSAMPLE).
- * The DCT outputs are returned scaled up by a factor of 8; they therefore
- * have a range of +-8K for 8-bit data, +-128K for 12-bit data. This
- * convention improves accuracy in integer implementations and saves some
- * work in floating-point ones.
- * Quantization of the output coefficients is done by jcdctmgr.c.
- */
-
-#if BITS_IN_JSAMPLE == 8
-typedef int DCTELEM; /* 16 or 32 bits is fine */
-#else
-typedef INT32 DCTELEM; /* must have 32 bits */
-#endif
-
-typedef JMETHOD(void, forward_DCT_method_ptr, (DCTELEM * data));
-typedef JMETHOD(void, float_DCT_method_ptr, (FAST_FLOAT * data));
-
-
-/*
- * An inverse DCT routine is given a pointer to the input JBLOCK and a pointer
- * to an output sample array. The routine must dequantize the input data as
- * well as perform the IDCT; for dequantization, it uses the multiplier table
- * pointed to by compptr->dct_table. The output data is to be placed into the
- * sample array starting at a specified column. (Any row offset needed will
- * be applied to the array pointer before it is passed to the IDCT code.)
- * Note that the number of samples emitted by the IDCT routine is
- * DCT_scaled_size * DCT_scaled_size.
- */
-
-/* typedef inverse_DCT_method_ptr is declared in jpegint.h */
-
-/*
- * Each IDCT routine has its own ideas about the best dct_table element type.
- */
-
-typedef MULTIPLIER ISLOW_MULT_TYPE; /* short or int, whichever is faster */
-#if BITS_IN_JSAMPLE == 8
-typedef MULTIPLIER IFAST_MULT_TYPE; /* 16 bits is OK, use short if faster */
-#define IFAST_SCALE_BITS 2 /* fractional bits in scale factors */
-#else
-typedef INT32 IFAST_MULT_TYPE; /* need 32 bits for scaled quantizers */
-#define IFAST_SCALE_BITS 13 /* fractional bits in scale factors */
-#endif
-typedef FAST_FLOAT FLOAT_MULT_TYPE; /* preferred floating type */
-
-
-/*
- * Each IDCT routine is responsible for range-limiting its results and
- * converting them to unsigned form (0..MAXJSAMPLE). The raw outputs could
- * be quite far out of range if the input data is corrupt, so a bulletproof
- * range-limiting step is required. We use a mask-and-table-lookup method
- * to do the combined operations quickly. See the comments with
- * prepare_range_limit_table (in jdmaster.c) for more info.
- */
-
-#define IDCT_range_limit(cinfo) ((cinfo)->sample_range_limit + CENTERJSAMPLE)
-
-#define RANGE_MASK (MAXJSAMPLE * 4 + 3) /* 2 bits wider than legal samples */
-
-
-/* Short forms of external names for systems with brain-damaged linkers. */
-
-#ifdef NEED_SHORT_EXTERNAL_NAMES
-#define jpeg_fdct_islow jFDislow
-#define jpeg_fdct_ifast jFDifast
-#define jpeg_fdct_float jFDfloat
-#define jpeg_idct_islow jRDislow
-#define jpeg_idct_ifast jRDifast
-#define jpeg_idct_float jRDfloat
-#define jpeg_idct_4x4 jRD4x4
-#define jpeg_idct_2x2 jRD2x2
-#define jpeg_idct_1x1 jRD1x1
-#endif /* NEED_SHORT_EXTERNAL_NAMES */
-
-/* Extern declarations for the forward and inverse DCT routines. */
-
-EXTERN(void) jpeg_fdct_islow JPP((DCTELEM * data));
-EXTERN(void) jpeg_fdct_ifast JPP((DCTELEM * data));
-EXTERN(void) jpeg_fdct_float JPP((FAST_FLOAT * data));
-
-EXTERN(void) jpeg_idct_islow
- JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
- JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
-EXTERN(void) jpeg_idct_ifast
- JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
- JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
-EXTERN(void) jpeg_idct_float
- JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
- JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
-EXTERN(void) jpeg_idct_4x4
- JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
- JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
-EXTERN(void) jpeg_idct_2x2
- JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
- JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
-EXTERN(void) jpeg_idct_1x1
- JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
- JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
-
-
-/*
- * Macros for handling fixed-point arithmetic; these are used by many
- * but not all of the DCT/IDCT modules.
- *
- * All values are expected to be of type INT32.
- * Fractional constants are scaled left by CONST_BITS bits.
- * CONST_BITS is defined within each module using these macros,
- * and may differ from one module to the next.
- */
-
-#define ONE ((INT32) 1)
-#define CONST_SCALE (ONE << CONST_BITS)
-
-/* Convert a positive real constant to an integer scaled by CONST_SCALE.
- * Caution: some C compilers fail to reduce "FIX(constant)" at compile time,
- * thus causing a lot of useless floating-point operations at run time.
- */
-
-#define FIX(x) ((INT32) ((x) * CONST_SCALE + 0.5))
-
-/* Descale and correctly round an INT32 value that's scaled by N bits.
- * We assume RIGHT_SHIFT rounds towards minus infinity, so adding
- * the fudge factor is correct for either sign of X.
- */
-
-#define DESCALE(x,n) RIGHT_SHIFT((x) + (ONE << ((n)-1)), n)
-
-/* Multiply an INT32 variable by an INT32 constant to yield an INT32 result.
- * This macro is used only when the two inputs will actually be no more than
- * 16 bits wide, so that a 16x16->32 bit multiply can be used instead of a
- * full 32x32 multiply. This provides a useful speedup on many machines.
- * Unfortunately there is no way to specify a 16x16->32 multiply portably
- * in C, but some C compilers will do the right thing if you provide the
- * correct combination of casts.
- */
-
-#ifdef SHORTxSHORT_32 /* may work if 'int' is 32 bits */
-#define MULTIPLY16C16(var,const) (((INT16) (var)) * ((INT16) (const)))
-#endif
-#ifdef SHORTxLCONST_32 /* known to work with Microsoft C 6.0 */
-#define MULTIPLY16C16(var,const) (((INT16) (var)) * ((INT32) (const)))
-#endif
-
-#ifndef MULTIPLY16C16 /* default definition */
-#define MULTIPLY16C16(var,const) ((var) * (const))
-#endif
-
-/* Same except both inputs are variables. */
-
-#ifdef SHORTxSHORT_32 /* may work if 'int' is 32 bits */
-#define MULTIPLY16V16(var1,var2) (((INT16) (var1)) * ((INT16) (var2)))
-#endif
-
-#ifndef MULTIPLY16V16 /* default definition */
-#define MULTIPLY16V16(var1,var2) ((var1) * (var2))
-#endif
+/*
+ * jdct.h
+ *
+ * Copyright (C) 1994-1996, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This include file contains common declarations for the forward and
+ * inverse DCT modules. These declarations are private to the DCT managers
+ * (jcdctmgr.c, jddctmgr.c) and the individual DCT algorithms.
+ * The individual DCT algorithms are kept in separate files to ease
+ * machine-dependent tuning (e.g., assembly coding).
+ */
+
+
+/*
+ * A forward DCT routine is given a pointer to a work area of type DCTELEM[];
+ * the DCT is to be performed in-place in that buffer. Type DCTELEM is int
+ * for 8-bit samples, INT32 for 12-bit samples. (NOTE: Floating-point DCT
+ * implementations use an array of type FAST_FLOAT, instead.)
+ * The DCT inputs are expected to be signed (range +-CENTERJSAMPLE).
+ * The DCT outputs are returned scaled up by a factor of 8; they therefore
+ * have a range of +-8K for 8-bit data, +-128K for 12-bit data. This
+ * convention improves accuracy in integer implementations and saves some
+ * work in floating-point ones.
+ * Quantization of the output coefficients is done by jcdctmgr.c.
+ */
+
+#if BITS_IN_JSAMPLE == 8
+typedef int DCTELEM; /* 16 or 32 bits is fine */
+#else
+typedef INT32 DCTELEM; /* must have 32 bits */
+#endif
+
+typedef JMETHOD(void, forward_DCT_method_ptr, (DCTELEM * data));
+typedef JMETHOD(void, float_DCT_method_ptr, (FAST_FLOAT * data));
+
+
+/*
+ * An inverse DCT routine is given a pointer to the input JBLOCK and a pointer
+ * to an output sample array. The routine must dequantize the input data as
+ * well as perform the IDCT; for dequantization, it uses the multiplier table
+ * pointed to by compptr->dct_table. The output data is to be placed into the
+ * sample array starting at a specified column. (Any row offset needed will
+ * be applied to the array pointer before it is passed to the IDCT code.)
+ * Note that the number of samples emitted by the IDCT routine is
+ * DCT_scaled_size * DCT_scaled_size.
+ */
+
+/* typedef inverse_DCT_method_ptr is declared in jpegint.h */
+
+/*
+ * Each IDCT routine has its own ideas about the best dct_table element type.
+ */
+
+typedef MULTIPLIER ISLOW_MULT_TYPE; /* short or int, whichever is faster */
+#if BITS_IN_JSAMPLE == 8
+typedef MULTIPLIER IFAST_MULT_TYPE; /* 16 bits is OK, use short if faster */
+#define IFAST_SCALE_BITS 2 /* fractional bits in scale factors */
+#else
+typedef INT32 IFAST_MULT_TYPE; /* need 32 bits for scaled quantizers */
+#define IFAST_SCALE_BITS 13 /* fractional bits in scale factors */
+#endif
+typedef FAST_FLOAT FLOAT_MULT_TYPE; /* preferred floating type */
+
+
+/*
+ * Each IDCT routine is responsible for range-limiting its results and
+ * converting them to unsigned form (0..MAXJSAMPLE). The raw outputs could
+ * be quite far out of range if the input data is corrupt, so a bulletproof
+ * range-limiting step is required. We use a mask-and-table-lookup method
+ * to do the combined operations quickly. See the comments with
+ * prepare_range_limit_table (in jdmaster.c) for more info.
+ */
+
+#define IDCT_range_limit(cinfo) ((cinfo)->sample_range_limit + CENTERJSAMPLE)
+
+#define RANGE_MASK (MAXJSAMPLE * 4 + 3) /* 2 bits wider than legal samples */
+
+
+/* Short forms of external names for systems with brain-damaged linkers. */
+
+#ifdef NEED_SHORT_EXTERNAL_NAMES
+#define jpeg_fdct_islow jFDislow
+#define jpeg_fdct_ifast jFDifast
+#define jpeg_fdct_float jFDfloat
+#define jpeg_idct_islow jRDislow
+#define jpeg_idct_ifast jRDifast
+#define jpeg_idct_float jRDfloat
+#define jpeg_idct_4x4 jRD4x4
+#define jpeg_idct_2x2 jRD2x2
+#define jpeg_idct_1x1 jRD1x1
+#endif /* NEED_SHORT_EXTERNAL_NAMES */
+
+/* Extern declarations for the forward and inverse DCT routines. */
+
+EXTERN(void) jpeg_fdct_islow JPP((DCTELEM * data));
+EXTERN(void) jpeg_fdct_ifast JPP((DCTELEM * data));
+EXTERN(void) jpeg_fdct_float JPP((FAST_FLOAT * data));
+
+EXTERN(void) jpeg_idct_islow
+ JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
+ JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
+EXTERN(void) jpeg_idct_ifast
+ JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
+ JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
+EXTERN(void) jpeg_idct_float
+ JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
+ JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
+EXTERN(void) jpeg_idct_4x4
+ JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
+ JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
+EXTERN(void) jpeg_idct_2x2
+ JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
+ JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
+EXTERN(void) jpeg_idct_1x1
+ JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
+ JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
+
+
+/*
+ * Macros for handling fixed-point arithmetic; these are used by many
+ * but not all of the DCT/IDCT modules.
+ *
+ * All values are expected to be of type INT32.
+ * Fractional constants are scaled left by CONST_BITS bits.
+ * CONST_BITS is defined within each module using these macros,
+ * and may differ from one module to the next.
+ */
+
+#define ONE ((INT32) 1)
+#define CONST_SCALE (ONE << CONST_BITS)
+
+/* Convert a positive real constant to an integer scaled by CONST_SCALE.
+ * Caution: some C compilers fail to reduce "FIX(constant)" at compile time,
+ * thus causing a lot of useless floating-point operations at run time.
+ */
+
+#define FIX(x) ((INT32) ((x) * CONST_SCALE + 0.5))
+
+/* Descale and correctly round an INT32 value that's scaled by N bits.
+ * We assume RIGHT_SHIFT rounds towards minus infinity, so adding
+ * the fudge factor is correct for either sign of X.
+ */
+
+#define DESCALE(x,n) RIGHT_SHIFT((x) + (ONE << ((n)-1)), n)
+
+/* Multiply an INT32 variable by an INT32 constant to yield an INT32 result.
+ * This macro is used only when the two inputs will actually be no more than
+ * 16 bits wide, so that a 16x16->32 bit multiply can be used instead of a
+ * full 32x32 multiply. This provides a useful speedup on many machines.
+ * Unfortunately there is no way to specify a 16x16->32 multiply portably
+ * in C, but some C compilers will do the right thing if you provide the
+ * correct combination of casts.
+ */
+
+#ifdef SHORTxSHORT_32 /* may work if 'int' is 32 bits */
+#define MULTIPLY16C16(var,const) (((INT16) (var)) * ((INT16) (const)))
+#endif
+#ifdef SHORTxLCONST_32 /* known to work with Microsoft C 6.0 */
+#define MULTIPLY16C16(var,const) (((INT16) (var)) * ((INT32) (const)))
+#endif
+
+#ifndef MULTIPLY16C16 /* default definition */
+#define MULTIPLY16C16(var,const) ((var) * (const))
+#endif
+
+/* Same except both inputs are variables. */
+
+#ifdef SHORTxSHORT_32 /* may work if 'int' is 32 bits */
+#define MULTIPLY16V16(var1,var2) (((INT16) (var1)) * ((INT16) (var2)))
+#endif
+
+#ifndef MULTIPLY16V16 /* default definition */
+#define MULTIPLY16V16(var1,var2) ((var1) * (var2))
+#endif
diff --git a/core/src/fxcodec/libjpeg/jdhuff.h b/core/src/fxcodec/libjpeg/jdhuff.h
index 12c0747709..ae19b6cafd 100644
--- a/core/src/fxcodec/libjpeg/jdhuff.h
+++ b/core/src/fxcodec/libjpeg/jdhuff.h
@@ -1,201 +1,201 @@
-/*
- * jdhuff.h
- *
- * Copyright (C) 1991-1997, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- * For conditions of distribution and use, see the accompanying README file.
- *
- * This file contains declarations for Huffman entropy decoding routines
- * that are shared between the sequential decoder (jdhuff.c) and the
- * progressive decoder (jdphuff.c). No other modules need to see these.
- */
-
-/* Short forms of external names for systems with brain-damaged linkers. */
-
-#ifdef NEED_SHORT_EXTERNAL_NAMES
-#define jpeg_make_d_derived_tbl jMkDDerived
-#define jpeg_fill_bit_buffer jFilBitBuf
-#define jpeg_huff_decode jHufDecode
-#endif /* NEED_SHORT_EXTERNAL_NAMES */
-
-
-/* Derived data constructed for each Huffman table */
-
-#define HUFF_LOOKAHEAD 8 /* # of bits of lookahead */
-
-typedef struct {
- /* Basic tables: (element [0] of each array is unused) */
- INT32 maxcode[18]; /* largest code of length k (-1 if none) */
- /* (maxcode[17] is a sentinel to ensure jpeg_huff_decode terminates) */
- INT32 valoffset[17]; /* huffval[] offset for codes of length k */
- /* valoffset[k] = huffval[] index of 1st symbol of code length k, less
- * the smallest code of length k; so given a code of length k, the
- * corresponding symbol is huffval[code + valoffset[k]]
- */
-
- /* Link to public Huffman table (needed only in jpeg_huff_decode) */
- JHUFF_TBL *pub;
-
- /* Lookahead tables: indexed by the next HUFF_LOOKAHEAD bits of
- * the input data stream. If the next Huffman code is no more
- * than HUFF_LOOKAHEAD bits long, we can obtain its length and
- * the corresponding symbol directly from these tables.
- */
- int look_nbits[1<<HUFF_LOOKAHEAD]; /* # bits, or 0 if too long */
- UINT8 look_sym[1<<HUFF_LOOKAHEAD]; /* symbol, or unused */
-} d_derived_tbl;
-
-/* Expand a Huffman table definition into the derived format */
-EXTERN(void) jpeg_make_d_derived_tbl
- JPP((j_decompress_ptr cinfo, boolean isDC, int tblno,
- d_derived_tbl ** pdtbl));
-
-
-/*
- * Fetching the next N bits from the input stream is a time-critical operation
- * for the Huffman decoders. We implement it with a combination of inline
- * macros and out-of-line subroutines. Note that N (the number of bits
- * demanded at one time) never exceeds 15 for JPEG use.
- *
- * We read source bytes into get_buffer and dole out bits as needed.
- * If get_buffer already contains enough bits, they are fetched in-line
- * by the macros CHECK_BIT_BUFFER and GET_BITS. When there aren't enough
- * bits, jpeg_fill_bit_buffer is called; it will attempt to fill get_buffer
- * as full as possible (not just to the number of bits needed; this
- * prefetching reduces the overhead cost of calling jpeg_fill_bit_buffer).
- * Note that jpeg_fill_bit_buffer may return FALSE to indicate suspension.
- * On TRUE return, jpeg_fill_bit_buffer guarantees that get_buffer contains
- * at least the requested number of bits --- dummy zeroes are inserted if
- * necessary.
- */
-
-typedef INT32 bit_buf_type; /* type of bit-extraction buffer */
-#define BIT_BUF_SIZE 32 /* size of buffer in bits */
-
-/* If long is > 32 bits on your machine, and shifting/masking longs is
- * reasonably fast, making bit_buf_type be long and setting BIT_BUF_SIZE
- * appropriately should be a win. Unfortunately we can't define the size
- * with something like #define BIT_BUF_SIZE (sizeof(bit_buf_type)*8)
- * because not all machines measure sizeof in 8-bit bytes.
- */
-
-typedef struct { /* Bitreading state saved across MCUs */
- bit_buf_type get_buffer; /* current bit-extraction buffer */
- int bits_left; /* # of unused bits in it */
-} bitread_perm_state;
-
-typedef struct { /* Bitreading working state within an MCU */
- /* Current data source location */
- /* We need a copy, rather than munging the original, in case of suspension */
- const JOCTET * next_input_byte; /* => next byte to read from source */
- size_t bytes_in_buffer; /* # of bytes remaining in source buffer */
- /* Bit input buffer --- note these values are kept in register variables,
- * not in this struct, inside the inner loops.
- */
- bit_buf_type get_buffer; /* current bit-extraction buffer */
- int bits_left; /* # of unused bits in it */
- /* Pointer needed by jpeg_fill_bit_buffer. */
- j_decompress_ptr cinfo; /* back link to decompress master record */
-} bitread_working_state;
-
-/* Macros to declare and load/save bitread local variables. */
-#define BITREAD_STATE_VARS \
- register bit_buf_type get_buffer; \
- register int bits_left; \
- bitread_working_state br_state
-
-#define BITREAD_LOAD_STATE(cinfop,permstate) \
- br_state.cinfo = cinfop; \
- br_state.next_input_byte = cinfop->src->next_input_byte; \
- br_state.bytes_in_buffer = cinfop->src->bytes_in_buffer; \
- get_buffer = permstate.get_buffer; \
- bits_left = permstate.bits_left;
-
-#define BITREAD_SAVE_STATE(cinfop,permstate) \
- cinfop->src->next_input_byte = br_state.next_input_byte; \
- cinfop->src->bytes_in_buffer = br_state.bytes_in_buffer; \
- permstate.get_buffer = get_buffer; \
- permstate.bits_left = bits_left
-
-/*
- * These macros provide the in-line portion of bit fetching.
- * Use CHECK_BIT_BUFFER to ensure there are N bits in get_buffer
- * before using GET_BITS, PEEK_BITS, or DROP_BITS.
- * The variables get_buffer and bits_left are assumed to be locals,
- * but the state struct might not be (jpeg_huff_decode needs this).
- * CHECK_BIT_BUFFER(state,n,action);
- * Ensure there are N bits in get_buffer; if suspend, take action.
- * val = GET_BITS(n);
- * Fetch next N bits.
- * val = PEEK_BITS(n);
- * Fetch next N bits without removing them from the buffer.
- * DROP_BITS(n);
- * Discard next N bits.
- * The value N should be a simple variable, not an expression, because it
- * is evaluated multiple times.
- */
-
-#define CHECK_BIT_BUFFER(state,nbits,action) \
- { if (bits_left < (nbits)) { \
- if (! jpeg_fill_bit_buffer(&(state),get_buffer,bits_left,nbits)) \
- { action; } \
- get_buffer = (state).get_buffer; bits_left = (state).bits_left; } }
-
-#define GET_BITS(nbits) \
- (((int) (get_buffer >> (bits_left -= (nbits)))) & ((1<<(nbits))-1))
-
-#define PEEK_BITS(nbits) \
- (((int) (get_buffer >> (bits_left - (nbits)))) & ((1<<(nbits))-1))
-
-#define DROP_BITS(nbits) \
- (bits_left -= (nbits))
-
-/* Load up the bit buffer to a depth of at least nbits */
-EXTERN(boolean) jpeg_fill_bit_buffer
- JPP((bitread_working_state * state, register bit_buf_type get_buffer,
- register int bits_left, int nbits));
-
-
-/*
- * Code for extracting next Huffman-coded symbol from input bit stream.
- * Again, this is time-critical and we make the main paths be macros.
- *
- * We use a lookahead table to process codes of up to HUFF_LOOKAHEAD bits
- * without looping. Usually, more than 95% of the Huffman codes will be 8
- * or fewer bits long. The few overlength codes are handled with a loop,
- * which need not be inline code.
- *
- * Notes about the HUFF_DECODE macro:
- * 1. Near the end of the data segment, we may fail to get enough bits
- * for a lookahead. In that case, we do it the hard way.
- * 2. If the lookahead table contains no entry, the next code must be
- * more than HUFF_LOOKAHEAD bits long.
- * 3. jpeg_huff_decode returns -1 if forced to suspend.
- */
-
-#define HUFF_DECODE(result,state,htbl,failaction,slowlabel) \
-{ register int nb, look; \
- if (bits_left < HUFF_LOOKAHEAD) { \
- if (! jpeg_fill_bit_buffer(&state,get_buffer,bits_left, 0)) {failaction;} \
- get_buffer = state.get_buffer; bits_left = state.bits_left; \
- if (bits_left < HUFF_LOOKAHEAD) { \
- nb = 1; goto slowlabel; \
- } \
- } \
- look = PEEK_BITS(HUFF_LOOKAHEAD); \
- if ((nb = htbl->look_nbits[look]) != 0) { \
- DROP_BITS(nb); \
- result = htbl->look_sym[look]; \
- } else { \
- nb = HUFF_LOOKAHEAD+1; \
-slowlabel: \
- if ((result=jpeg_huff_decode(&state,get_buffer,bits_left,htbl,nb)) < 0) \
- { failaction; } \
- get_buffer = state.get_buffer; bits_left = state.bits_left; \
- } \
-}
-
-/* Out-of-line case for Huffman code fetching */
-EXTERN(int) jpeg_huff_decode
- JPP((bitread_working_state * state, register bit_buf_type get_buffer,
- register int bits_left, d_derived_tbl * htbl, int min_bits));
+/*
+ * jdhuff.h
+ *
+ * Copyright (C) 1991-1997, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains declarations for Huffman entropy decoding routines
+ * that are shared between the sequential decoder (jdhuff.c) and the
+ * progressive decoder (jdphuff.c). No other modules need to see these.
+ */
+
+/* Short forms of external names for systems with brain-damaged linkers. */
+
+#ifdef NEED_SHORT_EXTERNAL_NAMES
+#define jpeg_make_d_derived_tbl jMkDDerived
+#define jpeg_fill_bit_buffer jFilBitBuf
+#define jpeg_huff_decode jHufDecode
+#endif /* NEED_SHORT_EXTERNAL_NAMES */
+
+
+/* Derived data constructed for each Huffman table */
+
+#define HUFF_LOOKAHEAD 8 /* # of bits of lookahead */
+
+typedef struct {
+ /* Basic tables: (element [0] of each array is unused) */
+ INT32 maxcode[18]; /* largest code of length k (-1 if none) */
+ /* (maxcode[17] is a sentinel to ensure jpeg_huff_decode terminates) */
+ INT32 valoffset[17]; /* huffval[] offset for codes of length k */
+ /* valoffset[k] = huffval[] index of 1st symbol of code length k, less
+ * the smallest code of length k; so given a code of length k, the
+ * corresponding symbol is huffval[code + valoffset[k]]
+ */
+
+ /* Link to public Huffman table (needed only in jpeg_huff_decode) */
+ JHUFF_TBL *pub;
+
+ /* Lookahead tables: indexed by the next HUFF_LOOKAHEAD bits of
+ * the input data stream. If the next Huffman code is no more
+ * than HUFF_LOOKAHEAD bits long, we can obtain its length and
+ * the corresponding symbol directly from these tables.
+ */
+ int look_nbits[1<<HUFF_LOOKAHEAD]; /* # bits, or 0 if too long */
+ UINT8 look_sym[1<<HUFF_LOOKAHEAD]; /* symbol, or unused */
+} d_derived_tbl;
+
+/* Expand a Huffman table definition into the derived format */
+EXTERN(void) jpeg_make_d_derived_tbl
+ JPP((j_decompress_ptr cinfo, boolean isDC, int tblno,
+ d_derived_tbl ** pdtbl));
+
+
+/*
+ * Fetching the next N bits from the input stream is a time-critical operation
+ * for the Huffman decoders. We implement it with a combination of inline
+ * macros and out-of-line subroutines. Note that N (the number of bits
+ * demanded at one time) never exceeds 15 for JPEG use.
+ *
+ * We read source bytes into get_buffer and dole out bits as needed.
+ * If get_buffer already contains enough bits, they are fetched in-line
+ * by the macros CHECK_BIT_BUFFER and GET_BITS. When there aren't enough
+ * bits, jpeg_fill_bit_buffer is called; it will attempt to fill get_buffer
+ * as full as possible (not just to the number of bits needed; this
+ * prefetching reduces the overhead cost of calling jpeg_fill_bit_buffer).
+ * Note that jpeg_fill_bit_buffer may return FALSE to indicate suspension.
+ * On TRUE return, jpeg_fill_bit_buffer guarantees that get_buffer contains
+ * at least the requested number of bits --- dummy zeroes are inserted if
+ * necessary.
+ */
+
+typedef INT32 bit_buf_type; /* type of bit-extraction buffer */
+#define BIT_BUF_SIZE 32 /* size of buffer in bits */
+
+/* If long is > 32 bits on your machine, and shifting/masking longs is
+ * reasonably fast, making bit_buf_type be long and setting BIT_BUF_SIZE
+ * appropriately should be a win. Unfortunately we can't define the size
+ * with something like #define BIT_BUF_SIZE (sizeof(bit_buf_type)*8)
+ * because not all machines measure sizeof in 8-bit bytes.
+ */
+
+typedef struct { /* Bitreading state saved across MCUs */
+ bit_buf_type get_buffer; /* current bit-extraction buffer */
+ int bits_left; /* # of unused bits in it */
+} bitread_perm_state;
+
+typedef struct { /* Bitreading working state within an MCU */
+ /* Current data source location */
+ /* We need a copy, rather than munging the original, in case of suspension */
+ const JOCTET * next_input_byte; /* => next byte to read from source */
+ size_t bytes_in_buffer; /* # of bytes remaining in source buffer */
+ /* Bit input buffer --- note these values are kept in register variables,
+ * not in this struct, inside the inner loops.
+ */
+ bit_buf_type get_buffer; /* current bit-extraction buffer */
+ int bits_left; /* # of unused bits in it */
+ /* Pointer needed by jpeg_fill_bit_buffer. */
+ j_decompress_ptr cinfo; /* back link to decompress master record */
+} bitread_working_state;
+
+/* Macros to declare and load/save bitread local variables. */
+#define BITREAD_STATE_VARS \
+ register bit_buf_type get_buffer; \
+ register int bits_left; \
+ bitread_working_state br_state
+
+#define BITREAD_LOAD_STATE(cinfop,permstate) \
+ br_state.cinfo = cinfop; \
+ br_state.next_input_byte = cinfop->src->next_input_byte; \
+ br_state.bytes_in_buffer = cinfop->src->bytes_in_buffer; \
+ get_buffer = permstate.get_buffer; \
+ bits_left = permstate.bits_left;
+
+#define BITREAD_SAVE_STATE(cinfop,permstate) \
+ cinfop->src->next_input_byte = br_state.next_input_byte; \
+ cinfop->src->bytes_in_buffer = br_state.bytes_in_buffer; \
+ permstate.get_buffer = get_buffer; \
+ permstate.bits_left = bits_left
+
+/*
+ * These macros provide the in-line portion of bit fetching.
+ * Use CHECK_BIT_BUFFER to ensure there are N bits in get_buffer
+ * before using GET_BITS, PEEK_BITS, or DROP_BITS.
+ * The variables get_buffer and bits_left are assumed to be locals,
+ * but the state struct might not be (jpeg_huff_decode needs this).
+ * CHECK_BIT_BUFFER(state,n,action);
+ * Ensure there are N bits in get_buffer; if suspend, take action.
+ * val = GET_BITS(n);
+ * Fetch next N bits.
+ * val = PEEK_BITS(n);
+ * Fetch next N bits without removing them from the buffer.
+ * DROP_BITS(n);
+ * Discard next N bits.
+ * The value N should be a simple variable, not an expression, because it
+ * is evaluated multiple times.
+ */
+
+#define CHECK_BIT_BUFFER(state,nbits,action) \
+ { if (bits_left < (nbits)) { \
+ if (! jpeg_fill_bit_buffer(&(state),get_buffer,bits_left,nbits)) \
+ { action; } \
+ get_buffer = (state).get_buffer; bits_left = (state).bits_left; } }
+
+#define GET_BITS(nbits) \
+ (((int) (get_buffer >> (bits_left -= (nbits)))) & ((1<<(nbits))-1))
+
+#define PEEK_BITS(nbits) \
+ (((int) (get_buffer >> (bits_left - (nbits)))) & ((1<<(nbits))-1))
+
+#define DROP_BITS(nbits) \
+ (bits_left -= (nbits))
+
+/* Load up the bit buffer to a depth of at least nbits */
+EXTERN(boolean) jpeg_fill_bit_buffer
+ JPP((bitread_working_state * state, register bit_buf_type get_buffer,
+ register int bits_left, int nbits));
+
+
+/*
+ * Code for extracting next Huffman-coded symbol from input bit stream.
+ * Again, this is time-critical and we make the main paths be macros.
+ *
+ * We use a lookahead table to process codes of up to HUFF_LOOKAHEAD bits
+ * without looping. Usually, more than 95% of the Huffman codes will be 8
+ * or fewer bits long. The few overlength codes are handled with a loop,
+ * which need not be inline code.
+ *
+ * Notes about the HUFF_DECODE macro:
+ * 1. Near the end of the data segment, we may fail to get enough bits
+ * for a lookahead. In that case, we do it the hard way.
+ * 2. If the lookahead table contains no entry, the next code must be
+ * more than HUFF_LOOKAHEAD bits long.
+ * 3. jpeg_huff_decode returns -1 if forced to suspend.
+ */
+
+#define HUFF_DECODE(result,state,htbl,failaction,slowlabel) \
+{ register int nb, look; \
+ if (bits_left < HUFF_LOOKAHEAD) { \
+ if (! jpeg_fill_bit_buffer(&state,get_buffer,bits_left, 0)) {failaction;} \
+ get_buffer = state.get_buffer; bits_left = state.bits_left; \
+ if (bits_left < HUFF_LOOKAHEAD) { \
+ nb = 1; goto slowlabel; \
+ } \
+ } \
+ look = PEEK_BITS(HUFF_LOOKAHEAD); \
+ if ((nb = htbl->look_nbits[look]) != 0) { \
+ DROP_BITS(nb); \
+ result = htbl->look_sym[look]; \
+ } else { \
+ nb = HUFF_LOOKAHEAD+1; \
+slowlabel: \
+ if ((result=jpeg_huff_decode(&state,get_buffer,bits_left,htbl,nb)) < 0) \
+ { failaction; } \
+ get_buffer = state.get_buffer; bits_left = state.bits_left; \
+ } \
+}
+
+/* Out-of-line case for Huffman code fetching */
+EXTERN(int) jpeg_huff_decode
+ JPP((bitread_working_state * state, register bit_buf_type get_buffer,
+ register int bits_left, d_derived_tbl * htbl, int min_bits));
diff --git a/core/src/fxcodec/libjpeg/jerror.h b/core/src/fxcodec/libjpeg/jerror.h
index a2b8f96f8f..06d344067a 100644
--- a/core/src/fxcodec/libjpeg/jerror.h
+++ b/core/src/fxcodec/libjpeg/jerror.h
@@ -1,291 +1,291 @@
-/*
- * jerror.h
- *
- * Copyright (C) 1994-1997, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- * For conditions of distribution and use, see the accompanying README file.
- *
- * This file defines the error and message codes for the JPEG library.
- * Edit this file to add new codes, or to translate the message strings to
- * some other language.
- * A set of error-reporting macros are defined too. Some applications using
- * the JPEG library may wish to include this file to get the error codes
- * and/or the macros.
- */
-
-/*
- * To define the enum list of message codes, include this file without
- * defining macro JMESSAGE. To create a message string table, include it
- * again with a suitable JMESSAGE definition (see jerror.c for an example).
- */
-#ifndef JMESSAGE
-#ifndef JERROR_H
-/* First time through, define the enum list */
-#define JMAKE_ENUM_LIST
-#else
-/* Repeated inclusions of this file are no-ops unless JMESSAGE is defined */
-#define JMESSAGE(code,string)
-#endif /* JERROR_H */
-#endif /* JMESSAGE */
-
-#ifdef JMAKE_ENUM_LIST
-
-typedef enum {
-
-#define JMESSAGE(code,string) code ,
-
-#endif /* JMAKE_ENUM_LIST */
-
-JMESSAGE(JMSG_NOMESSAGE, "Bogus message code %d") /* Must be first entry! */
-
-/* For maintenance convenience, list is alphabetical by message code name */
-JMESSAGE(JERR_ARITH_NOTIMPL,
- "Sorry, there are legal restrictions on arithmetic coding")
-JMESSAGE(JERR_BAD_ALIGN_TYPE, "ALIGN_TYPE is wrong, please fix")
-JMESSAGE(JERR_BAD_ALLOC_CHUNK, "MAX_ALLOC_CHUNK is wrong, please fix")
-JMESSAGE(JERR_BAD_BUFFER_MODE, "Bogus buffer control mode")
-JMESSAGE(JERR_BAD_COMPONENT_ID, "Invalid component ID %d in SOS")
-JMESSAGE(JERR_BAD_DCT_COEF, "DCT coefficient out of range")
-JMESSAGE(JERR_BAD_DCTSIZE, "IDCT output block size %d not supported")
-JMESSAGE(JERR_BAD_HUFF_TABLE, "Bogus Huffman table definition")
-JMESSAGE(JERR_BAD_IN_COLORSPACE, "Bogus input colorspace")
-JMESSAGE(JERR_BAD_J_COLORSPACE, "Bogus JPEG colorspace")
-JMESSAGE(JERR_BAD_LENGTH, "Bogus marker length")
-JMESSAGE(JERR_BAD_LIB_VERSION,
- "Wrong JPEG library version: library is %d, caller expects %d")
-JMESSAGE(JERR_BAD_MCU_SIZE, "Sampling factors too large for interleaved scan")
-JMESSAGE(JERR_BAD_POOL_ID, "Invalid memory pool code %d")
-JMESSAGE(JERR_BAD_PRECISION, "Unsupported JPEG data precision %d")
-JMESSAGE(JERR_BAD_PROGRESSION,
- "Invalid progressive parameters Ss=%d Se=%d Ah=%d Al=%d")
-JMESSAGE(JERR_BAD_PROG_SCRIPT,
- "Invalid progressive parameters at scan script entry %d")
-JMESSAGE(JERR_BAD_SAMPLING, "Bogus sampling factors")
-JMESSAGE(JERR_BAD_SCAN_SCRIPT, "Invalid scan script at entry %d")
-JMESSAGE(JERR_BAD_STATE, "Improper call to JPEG library in state %d")
-JMESSAGE(JERR_BAD_STRUCT_SIZE,
- "JPEG parameter struct mismatch: library thinks size is %u, caller expects %u")
-JMESSAGE(JERR_BAD_VIRTUAL_ACCESS, "Bogus virtual array access")
-JMESSAGE(JERR_BUFFER_SIZE, "Buffer passed to JPEG library is too small")
-JMESSAGE(JERR_CANT_SUSPEND, "Suspension not allowed here")
-JMESSAGE(JERR_CCIR601_NOTIMPL, "CCIR601 sampling not implemented yet")
-JMESSAGE(JERR_COMPONENT_COUNT, "Too many color components: %d, max %d")
-JMESSAGE(JERR_CONVERSION_NOTIMPL, "Unsupported color conversion request")
-JMESSAGE(JERR_DAC_INDEX, "Bogus DAC index %d")
-JMESSAGE(JERR_DAC_VALUE, "Bogus DAC value 0x%x")
-JMESSAGE(JERR_DHT_INDEX, "Bogus DHT index %d")
-JMESSAGE(JERR_DQT_INDEX, "Bogus DQT index %d")
-JMESSAGE(JERR_EMPTY_IMAGE, "Empty JPEG image (DNL not supported)")
-JMESSAGE(JERR_EMS_READ, "Read from EMS failed")
-JMESSAGE(JERR_EMS_WRITE, "Write to EMS failed")
-JMESSAGE(JERR_EOI_EXPECTED, "Didn't expect more than one scan")
-JMESSAGE(JERR_FILE_READ, "Input file read error")
-JMESSAGE(JERR_FILE_WRITE, "Output file write error --- out of disk space?")
-JMESSAGE(JERR_FRACT_SAMPLE_NOTIMPL, "Fractional sampling not implemented yet")
-JMESSAGE(JERR_HUFF_CLEN_OVERFLOW, "Huffman code size table overflow")
-JMESSAGE(JERR_HUFF_MISSING_CODE, "Missing Huffman code table entry")
-JMESSAGE(JERR_IMAGE_TOO_BIG, "Maximum supported image dimension is %u pixels")
-JMESSAGE(JERR_INPUT_EMPTY, "Empty input file")
-JMESSAGE(JERR_INPUT_EOF, "Premature end of input file")
-JMESSAGE(JERR_MISMATCHED_QUANT_TABLE,
- "Cannot transcode due to multiple use of quantization table %d")
-JMESSAGE(JERR_MISSING_DATA, "Scan script does not transmit all data")
-JMESSAGE(JERR_MODE_CHANGE, "Invalid color quantization mode change")
-JMESSAGE(JERR_NOTIMPL, "Not implemented yet")
-JMESSAGE(JERR_NOT_COMPILED, "Requested feature was omitted at compile time")
-JMESSAGE(JERR_NO_BACKING_STORE, "Backing store not supported")
-JMESSAGE(JERR_NO_HUFF_TABLE, "Huffman table 0x%02x was not defined")
-JMESSAGE(JERR_NO_IMAGE, "JPEG datastream contains no image")
-JMESSAGE(JERR_NO_QUANT_TABLE, "Quantization table 0x%02x was not defined")
-JMESSAGE(JERR_NO_SOI, "Not a JPEG file: starts with 0x%02x 0x%02x")
-JMESSAGE(JERR_OUT_OF_MEMORY, "Insufficient memory (case %d)")
-JMESSAGE(JERR_QUANT_COMPONENTS,
- "Cannot quantize more than %d color components")
-JMESSAGE(JERR_QUANT_FEW_COLORS, "Cannot quantize to fewer than %d colors")
-JMESSAGE(JERR_QUANT_MANY_COLORS, "Cannot quantize to more than %d colors")
-JMESSAGE(JERR_SOF_DUPLICATE, "Invalid JPEG file structure: two SOF markers")
-JMESSAGE(JERR_SOF_NO_SOS, "Invalid JPEG file structure: missing SOS marker")
-JMESSAGE(JERR_SOF_UNSUPPORTED, "Unsupported JPEG process: SOF type 0x%02x")
-JMESSAGE(JERR_SOI_DUPLICATE, "Invalid JPEG file structure: two SOI markers")
-JMESSAGE(JERR_SOS_NO_SOF, "Invalid JPEG file structure: SOS before SOF")
-JMESSAGE(JERR_TFILE_CREATE, "Failed to create temporary file %s")
-JMESSAGE(JERR_TFILE_READ, "Read failed on temporary file")
-JMESSAGE(JERR_TFILE_SEEK, "Seek failed on temporary file")
-JMESSAGE(JERR_TFILE_WRITE,
- "Write failed on temporary file --- out of disk space?")
-JMESSAGE(JERR_TOO_LITTLE_DATA, "Application transferred too few scanlines")
-JMESSAGE(JERR_UNKNOWN_MARKER, "Unsupported marker type 0x%02x")
-JMESSAGE(JERR_VIRTUAL_BUG, "Virtual array controller messed up")
-JMESSAGE(JERR_WIDTH_OVERFLOW, "Image too wide for this implementation")
-JMESSAGE(JERR_XMS_READ, "Read from XMS failed")
-JMESSAGE(JERR_XMS_WRITE, "Write to XMS failed")
-JMESSAGE(JMSG_COPYRIGHT, JCOPYRIGHT)
-JMESSAGE(JMSG_VERSION, JVERSION)
-JMESSAGE(JTRC_16BIT_TABLES,
- "Caution: quantization tables are too coarse for baseline JPEG")
-JMESSAGE(JTRC_ADOBE,
- "Adobe APP14 marker: version %d, flags 0x%04x 0x%04x, transform %d")
-JMESSAGE(JTRC_APP0, "Unknown APP0 marker (not JFIF), length %u")
-JMESSAGE(JTRC_APP14, "Unknown APP14 marker (not Adobe), length %u")
-JMESSAGE(JTRC_DAC, "Define Arithmetic Table 0x%02x: 0x%02x")
-JMESSAGE(JTRC_DHT, "Define Huffman Table 0x%02x")
-JMESSAGE(JTRC_DQT, "Define Quantization Table %d precision %d")
-JMESSAGE(JTRC_DRI, "Define Restart Interval %u")
-JMESSAGE(JTRC_EMS_CLOSE, "Freed EMS handle %u")
-JMESSAGE(JTRC_EMS_OPEN, "Obtained EMS handle %u")
-JMESSAGE(JTRC_EOI, "End Of Image")
-JMESSAGE(JTRC_HUFFBITS, " %3d %3d %3d %3d %3d %3d %3d %3d")
-JMESSAGE(JTRC_JFIF, "JFIF APP0 marker: version %d.%02d, density %dx%d %d")
-JMESSAGE(JTRC_JFIF_BADTHUMBNAILSIZE,
- "Warning: thumbnail image size does not match data length %u")
-JMESSAGE(JTRC_JFIF_EXTENSION,
- "JFIF extension marker: type 0x%02x, length %u")
-JMESSAGE(JTRC_JFIF_THUMBNAIL, " with %d x %d thumbnail image")
-JMESSAGE(JTRC_MISC_MARKER, "Miscellaneous marker 0x%02x, length %u")
-JMESSAGE(JTRC_PARMLESS_MARKER, "Unexpected marker 0x%02x")
-JMESSAGE(JTRC_QUANTVALS, " %4u %4u %4u %4u %4u %4u %4u %4u")
-JMESSAGE(JTRC_QUANT_3_NCOLORS, "Quantizing to %d = %d*%d*%d colors")
-JMESSAGE(JTRC_QUANT_NCOLORS, "Quantizing to %d colors")
-JMESSAGE(JTRC_QUANT_SELECTED, "Selected %d colors for quantization")
-JMESSAGE(JTRC_RECOVERY_ACTION, "At marker 0x%02x, recovery action %d")
-JMESSAGE(JTRC_RST, "RST%d")
-JMESSAGE(JTRC_SMOOTH_NOTIMPL,
- "Smoothing not supported with nonstandard sampling ratios")
-JMESSAGE(JTRC_SOF, "Start Of Frame 0x%02x: width=%u, height=%u, components=%d")
-JMESSAGE(JTRC_SOF_COMPONENT, " Component %d: %dhx%dv q=%d")
-JMESSAGE(JTRC_SOI, "Start of Image")
-JMESSAGE(JTRC_SOS, "Start Of Scan: %d components")
-JMESSAGE(JTRC_SOS_COMPONENT, " Component %d: dc=%d ac=%d")
-JMESSAGE(JTRC_SOS_PARAMS, " Ss=%d, Se=%d, Ah=%d, Al=%d")
-JMESSAGE(JTRC_TFILE_CLOSE, "Closed temporary file %s")
-JMESSAGE(JTRC_TFILE_OPEN, "Opened temporary file %s")
-JMESSAGE(JTRC_THUMB_JPEG,
- "JFIF extension marker: JPEG-compressed thumbnail image, length %u")
-JMESSAGE(JTRC_THUMB_PALETTE,
- "JFIF extension marker: palette thumbnail image, length %u")
-JMESSAGE(JTRC_THUMB_RGB,
- "JFIF extension marker: RGB thumbnail image, length %u")
-JMESSAGE(JTRC_UNKNOWN_IDS,
- "Unrecognized component IDs %d %d %d, assuming YCbCr")
-JMESSAGE(JTRC_XMS_CLOSE, "Freed XMS handle %u")
-JMESSAGE(JTRC_XMS_OPEN, "Obtained XMS handle %u")
-JMESSAGE(JWRN_ADOBE_XFORM, "Unknown Adobe color transform code %d")
-JMESSAGE(JWRN_BOGUS_PROGRESSION,
- "Inconsistent progression sequence for component %d coefficient %d")
-JMESSAGE(JWRN_EXTRANEOUS_DATA,
- "Corrupt JPEG data: %u extraneous bytes before marker 0x%02x")
-JMESSAGE(JWRN_HIT_MARKER, "Corrupt JPEG data: premature end of data segment")
-JMESSAGE(JWRN_HUFF_BAD_CODE, "Corrupt JPEG data: bad Huffman code")
-JMESSAGE(JWRN_JFIF_MAJOR, "Warning: unknown JFIF revision number %d.%02d")
-JMESSAGE(JWRN_JPEG_EOF, "Premature end of JPEG file")
-JMESSAGE(JWRN_MUST_RESYNC,
- "Corrupt JPEG data: found marker 0x%02x instead of RST%d")
-JMESSAGE(JWRN_NOT_SEQUENTIAL, "Invalid SOS parameters for sequential JPEG")
-JMESSAGE(JWRN_TOO_MUCH_DATA, "Application transferred too many scanlines")
-
-#ifdef JMAKE_ENUM_LIST
-
- JMSG_LASTMSGCODE
-} J_MESSAGE_CODE;
-
-#undef JMAKE_ENUM_LIST
-#endif /* JMAKE_ENUM_LIST */
-
-/* Zap JMESSAGE macro so that future re-inclusions do nothing by default */
-#undef JMESSAGE
-
-
-#ifndef JERROR_H
-#define JERROR_H
-
-/* Macros to simplify using the error and trace message stuff */
-/* The first parameter is either type of cinfo pointer */
-
-/* Fatal errors (print message and exit) */
-#define ERREXIT(cinfo,code) \
- ((cinfo)->err->msg_code = (code), \
- (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
-#define ERREXIT1(cinfo,code,p1) \
- ((cinfo)->err->msg_code = (code), \
- (cinfo)->err->msg_parm.i[0] = (p1), \
- (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
-#define ERREXIT2(cinfo,code,p1,p2) \
- ((cinfo)->err->msg_code = (code), \
- (cinfo)->err->msg_parm.i[0] = (p1), \
- (cinfo)->err->msg_parm.i[1] = (p2), \
- (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
-#define ERREXIT3(cinfo,code,p1,p2,p3) \
- ((cinfo)->err->msg_code = (code), \
- (cinfo)->err->msg_parm.i[0] = (p1), \
- (cinfo)->err->msg_parm.i[1] = (p2), \
- (cinfo)->err->msg_parm.i[2] = (p3), \
- (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
-#define ERREXIT4(cinfo,code,p1,p2,p3,p4) \
- ((cinfo)->err->msg_code = (code), \
- (cinfo)->err->msg_parm.i[0] = (p1), \
- (cinfo)->err->msg_parm.i[1] = (p2), \
- (cinfo)->err->msg_parm.i[2] = (p3), \
- (cinfo)->err->msg_parm.i[3] = (p4), \
- (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
-#define ERREXITS(cinfo,code,str) \
- ((cinfo)->err->msg_code = (code), \
- FXSYS_strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \
- (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
-
-#define MAKESTMT(stuff) do { stuff } while (0)
-
-/* Nonfatal errors (we can keep going, but the data is probably corrupt) */
-#define WARNMS(cinfo,code) \
- ((cinfo)->err->msg_code = (code), \
- (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1))
-#define WARNMS1(cinfo,code,p1) \
- ((cinfo)->err->msg_code = (code), \
- (cinfo)->err->msg_parm.i[0] = (p1), \
- (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1))
-#define WARNMS2(cinfo,code,p1,p2) \
- ((cinfo)->err->msg_code = (code), \
- (cinfo)->err->msg_parm.i[0] = (p1), \
- (cinfo)->err->msg_parm.i[1] = (p2), \
- (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1))
-
-/* Informational/debugging messages */
-#define TRACEMS(cinfo,lvl,code) \
- ((cinfo)->err->msg_code = (code), \
- (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))
-#define TRACEMS1(cinfo,lvl,code,p1) \
- ((cinfo)->err->msg_code = (code), \
- (cinfo)->err->msg_parm.i[0] = (p1), \
- (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))
-#define TRACEMS2(cinfo,lvl,code,p1,p2) \
- ((cinfo)->err->msg_code = (code), \
- (cinfo)->err->msg_parm.i[0] = (p1), \
- (cinfo)->err->msg_parm.i[1] = (p2), \
- (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))
-#define TRACEMS3(cinfo,lvl,code,p1,p2,p3) \
- MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \
- _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); \
- (cinfo)->err->msg_code = (code); \
- (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )
-#define TRACEMS4(cinfo,lvl,code,p1,p2,p3,p4) \
- MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \
- _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \
- (cinfo)->err->msg_code = (code); \
- (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )
-#define TRACEMS5(cinfo,lvl,code,p1,p2,p3,p4,p5) \
- MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \
- _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \
- _mp[4] = (p5); \
- (cinfo)->err->msg_code = (code); \
- (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )
-#define TRACEMS8(cinfo,lvl,code,p1,p2,p3,p4,p5,p6,p7,p8) \
- MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \
- _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \
- _mp[4] = (p5); _mp[5] = (p6); _mp[6] = (p7); _mp[7] = (p8); \
- (cinfo)->err->msg_code = (code); \
- (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )
-#define TRACEMSS(cinfo,lvl,code,str) \
- ((cinfo)->err->msg_code = (code), \
- FXSYS_strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \
- (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))
-
-#endif /* JERROR_H */
+/*
+ * jerror.h
+ *
+ * Copyright (C) 1994-1997, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file defines the error and message codes for the JPEG library.
+ * Edit this file to add new codes, or to translate the message strings to
+ * some other language.
+ * A set of error-reporting macros are defined too. Some applications using
+ * the JPEG library may wish to include this file to get the error codes
+ * and/or the macros.
+ */
+
+/*
+ * To define the enum list of message codes, include this file without
+ * defining macro JMESSAGE. To create a message string table, include it
+ * again with a suitable JMESSAGE definition (see jerror.c for an example).
+ */
+#ifndef JMESSAGE
+#ifndef JERROR_H
+/* First time through, define the enum list */
+#define JMAKE_ENUM_LIST
+#else
+/* Repeated inclusions of this file are no-ops unless JMESSAGE is defined */
+#define JMESSAGE(code,string)
+#endif /* JERROR_H */
+#endif /* JMESSAGE */
+
+#ifdef JMAKE_ENUM_LIST
+
+typedef enum {
+
+#define JMESSAGE(code,string) code ,
+
+#endif /* JMAKE_ENUM_LIST */
+
+JMESSAGE(JMSG_NOMESSAGE, "Bogus message code %d") /* Must be first entry! */
+
+/* For maintenance convenience, list is alphabetical by message code name */
+JMESSAGE(JERR_ARITH_NOTIMPL,
+ "Sorry, there are legal restrictions on arithmetic coding")
+JMESSAGE(JERR_BAD_ALIGN_TYPE, "ALIGN_TYPE is wrong, please fix")
+JMESSAGE(JERR_BAD_ALLOC_CHUNK, "MAX_ALLOC_CHUNK is wrong, please fix")
+JMESSAGE(JERR_BAD_BUFFER_MODE, "Bogus buffer control mode")
+JMESSAGE(JERR_BAD_COMPONENT_ID, "Invalid component ID %d in SOS")
+JMESSAGE(JERR_BAD_DCT_COEF, "DCT coefficient out of range")
+JMESSAGE(JERR_BAD_DCTSIZE, "IDCT output block size %d not supported")
+JMESSAGE(JERR_BAD_HUFF_TABLE, "Bogus Huffman table definition")
+JMESSAGE(JERR_BAD_IN_COLORSPACE, "Bogus input colorspace")
+JMESSAGE(JERR_BAD_J_COLORSPACE, "Bogus JPEG colorspace")
+JMESSAGE(JERR_BAD_LENGTH, "Bogus marker length")
+JMESSAGE(JERR_BAD_LIB_VERSION,
+ "Wrong JPEG library version: library is %d, caller expects %d")
+JMESSAGE(JERR_BAD_MCU_SIZE, "Sampling factors too large for interleaved scan")
+JMESSAGE(JERR_BAD_POOL_ID, "Invalid memory pool code %d")
+JMESSAGE(JERR_BAD_PRECISION, "Unsupported JPEG data precision %d")
+JMESSAGE(JERR_BAD_PROGRESSION,
+ "Invalid progressive parameters Ss=%d Se=%d Ah=%d Al=%d")
+JMESSAGE(JERR_BAD_PROG_SCRIPT,
+ "Invalid progressive parameters at scan script entry %d")
+JMESSAGE(JERR_BAD_SAMPLING, "Bogus sampling factors")
+JMESSAGE(JERR_BAD_SCAN_SCRIPT, "Invalid scan script at entry %d")
+JMESSAGE(JERR_BAD_STATE, "Improper call to JPEG library in state %d")
+JMESSAGE(JERR_BAD_STRUCT_SIZE,
+ "JPEG parameter struct mismatch: library thinks size is %u, caller expects %u")
+JMESSAGE(JERR_BAD_VIRTUAL_ACCESS, "Bogus virtual array access")
+JMESSAGE(JERR_BUFFER_SIZE, "Buffer passed to JPEG library is too small")
+JMESSAGE(JERR_CANT_SUSPEND, "Suspension not allowed here")
+JMESSAGE(JERR_CCIR601_NOTIMPL, "CCIR601 sampling not implemented yet")
+JMESSAGE(JERR_COMPONENT_COUNT, "Too many color components: %d, max %d")
+JMESSAGE(JERR_CONVERSION_NOTIMPL, "Unsupported color conversion request")
+JMESSAGE(JERR_DAC_INDEX, "Bogus DAC index %d")
+JMESSAGE(JERR_DAC_VALUE, "Bogus DAC value 0x%x")
+JMESSAGE(JERR_DHT_INDEX, "Bogus DHT index %d")
+JMESSAGE(JERR_DQT_INDEX, "Bogus DQT index %d")
+JMESSAGE(JERR_EMPTY_IMAGE, "Empty JPEG image (DNL not supported)")
+JMESSAGE(JERR_EMS_READ, "Read from EMS failed")
+JMESSAGE(JERR_EMS_WRITE, "Write to EMS failed")
+JMESSAGE(JERR_EOI_EXPECTED, "Didn't expect more than one scan")
+JMESSAGE(JERR_FILE_READ, "Input file read error")
+JMESSAGE(JERR_FILE_WRITE, "Output file write error --- out of disk space?")
+JMESSAGE(JERR_FRACT_SAMPLE_NOTIMPL, "Fractional sampling not implemented yet")
+JMESSAGE(JERR_HUFF_CLEN_OVERFLOW, "Huffman code size table overflow")
+JMESSAGE(JERR_HUFF_MISSING_CODE, "Missing Huffman code table entry")
+JMESSAGE(JERR_IMAGE_TOO_BIG, "Maximum supported image dimension is %u pixels")
+JMESSAGE(JERR_INPUT_EMPTY, "Empty input file")
+JMESSAGE(JERR_INPUT_EOF, "Premature end of input file")
+JMESSAGE(JERR_MISMATCHED_QUANT_TABLE,
+ "Cannot transcode due to multiple use of quantization table %d")
+JMESSAGE(JERR_MISSING_DATA, "Scan script does not transmit all data")
+JMESSAGE(JERR_MODE_CHANGE, "Invalid color quantization mode change")
+JMESSAGE(JERR_NOTIMPL, "Not implemented yet")
+JMESSAGE(JERR_NOT_COMPILED, "Requested feature was omitted at compile time")
+JMESSAGE(JERR_NO_BACKING_STORE, "Backing store not supported")
+JMESSAGE(JERR_NO_HUFF_TABLE, "Huffman table 0x%02x was not defined")
+JMESSAGE(JERR_NO_IMAGE, "JPEG datastream contains no image")
+JMESSAGE(JERR_NO_QUANT_TABLE, "Quantization table 0x%02x was not defined")
+JMESSAGE(JERR_NO_SOI, "Not a JPEG file: starts with 0x%02x 0x%02x")
+JMESSAGE(JERR_OUT_OF_MEMORY, "Insufficient memory (case %d)")
+JMESSAGE(JERR_QUANT_COMPONENTS,
+ "Cannot quantize more than %d color components")
+JMESSAGE(JERR_QUANT_FEW_COLORS, "Cannot quantize to fewer than %d colors")
+JMESSAGE(JERR_QUANT_MANY_COLORS, "Cannot quantize to more than %d colors")
+JMESSAGE(JERR_SOF_DUPLICATE, "Invalid JPEG file structure: two SOF markers")
+JMESSAGE(JERR_SOF_NO_SOS, "Invalid JPEG file structure: missing SOS marker")
+JMESSAGE(JERR_SOF_UNSUPPORTED, "Unsupported JPEG process: SOF type 0x%02x")
+JMESSAGE(JERR_SOI_DUPLICATE, "Invalid JPEG file structure: two SOI markers")
+JMESSAGE(JERR_SOS_NO_SOF, "Invalid JPEG file structure: SOS before SOF")
+JMESSAGE(JERR_TFILE_CREATE, "Failed to create temporary file %s")
+JMESSAGE(JERR_TFILE_READ, "Read failed on temporary file")
+JMESSAGE(JERR_TFILE_SEEK, "Seek failed on temporary file")
+JMESSAGE(JERR_TFILE_WRITE,
+ "Write failed on temporary file --- out of disk space?")
+JMESSAGE(JERR_TOO_LITTLE_DATA, "Application transferred too few scanlines")
+JMESSAGE(JERR_UNKNOWN_MARKER, "Unsupported marker type 0x%02x")
+JMESSAGE(JERR_VIRTUAL_BUG, "Virtual array controller messed up")
+JMESSAGE(JERR_WIDTH_OVERFLOW, "Image too wide for this implementation")
+JMESSAGE(JERR_XMS_READ, "Read from XMS failed")
+JMESSAGE(JERR_XMS_WRITE, "Write to XMS failed")
+JMESSAGE(JMSG_COPYRIGHT, JCOPYRIGHT)
+JMESSAGE(JMSG_VERSION, JVERSION)
+JMESSAGE(JTRC_16BIT_TABLES,
+ "Caution: quantization tables are too coarse for baseline JPEG")
+JMESSAGE(JTRC_ADOBE,
+ "Adobe APP14 marker: version %d, flags 0x%04x 0x%04x, transform %d")
+JMESSAGE(JTRC_APP0, "Unknown APP0 marker (not JFIF), length %u")
+JMESSAGE(JTRC_APP14, "Unknown APP14 marker (not Adobe), length %u")
+JMESSAGE(JTRC_DAC, "Define Arithmetic Table 0x%02x: 0x%02x")
+JMESSAGE(JTRC_DHT, "Define Huffman Table 0x%02x")
+JMESSAGE(JTRC_DQT, "Define Quantization Table %d precision %d")
+JMESSAGE(JTRC_DRI, "Define Restart Interval %u")
+JMESSAGE(JTRC_EMS_CLOSE, "Freed EMS handle %u")
+JMESSAGE(JTRC_EMS_OPEN, "Obtained EMS handle %u")
+JMESSAGE(JTRC_EOI, "End Of Image")
+JMESSAGE(JTRC_HUFFBITS, " %3d %3d %3d %3d %3d %3d %3d %3d")
+JMESSAGE(JTRC_JFIF, "JFIF APP0 marker: version %d.%02d, density %dx%d %d")
+JMESSAGE(JTRC_JFIF_BADTHUMBNAILSIZE,
+ "Warning: thumbnail image size does not match data length %u")
+JMESSAGE(JTRC_JFIF_EXTENSION,
+ "JFIF extension marker: type 0x%02x, length %u")
+JMESSAGE(JTRC_JFIF_THUMBNAIL, " with %d x %d thumbnail image")
+JMESSAGE(JTRC_MISC_MARKER, "Miscellaneous marker 0x%02x, length %u")
+JMESSAGE(JTRC_PARMLESS_MARKER, "Unexpected marker 0x%02x")
+JMESSAGE(JTRC_QUANTVALS, " %4u %4u %4u %4u %4u %4u %4u %4u")
+JMESSAGE(JTRC_QUANT_3_NCOLORS, "Quantizing to %d = %d*%d*%d colors")
+JMESSAGE(JTRC_QUANT_NCOLORS, "Quantizing to %d colors")
+JMESSAGE(JTRC_QUANT_SELECTED, "Selected %d colors for quantization")
+JMESSAGE(JTRC_RECOVERY_ACTION, "At marker 0x%02x, recovery action %d")
+JMESSAGE(JTRC_RST, "RST%d")
+JMESSAGE(JTRC_SMOOTH_NOTIMPL,
+ "Smoothing not supported with nonstandard sampling ratios")
+JMESSAGE(JTRC_SOF, "Start Of Frame 0x%02x: width=%u, height=%u, components=%d")
+JMESSAGE(JTRC_SOF_COMPONENT, " Component %d: %dhx%dv q=%d")
+JMESSAGE(JTRC_SOI, "Start of Image")
+JMESSAGE(JTRC_SOS, "Start Of Scan: %d components")
+JMESSAGE(JTRC_SOS_COMPONENT, " Component %d: dc=%d ac=%d")
+JMESSAGE(JTRC_SOS_PARAMS, " Ss=%d, Se=%d, Ah=%d, Al=%d")
+JMESSAGE(JTRC_TFILE_CLOSE, "Closed temporary file %s")
+JMESSAGE(JTRC_TFILE_OPEN, "Opened temporary file %s")
+JMESSAGE(JTRC_THUMB_JPEG,
+ "JFIF extension marker: JPEG-compressed thumbnail image, length %u")
+JMESSAGE(JTRC_THUMB_PALETTE,
+ "JFIF extension marker: palette thumbnail image, length %u")
+JMESSAGE(JTRC_THUMB_RGB,
+ "JFIF extension marker: RGB thumbnail image, length %u")
+JMESSAGE(JTRC_UNKNOWN_IDS,
+ "Unrecognized component IDs %d %d %d, assuming YCbCr")
+JMESSAGE(JTRC_XMS_CLOSE, "Freed XMS handle %u")
+JMESSAGE(JTRC_XMS_OPEN, "Obtained XMS handle %u")
+JMESSAGE(JWRN_ADOBE_XFORM, "Unknown Adobe color transform code %d")
+JMESSAGE(JWRN_BOGUS_PROGRESSION,
+ "Inconsistent progression sequence for component %d coefficient %d")
+JMESSAGE(JWRN_EXTRANEOUS_DATA,
+ "Corrupt JPEG data: %u extraneous bytes before marker 0x%02x")
+JMESSAGE(JWRN_HIT_MARKER, "Corrupt JPEG data: premature end of data segment")
+JMESSAGE(JWRN_HUFF_BAD_CODE, "Corrupt JPEG data: bad Huffman code")
+JMESSAGE(JWRN_JFIF_MAJOR, "Warning: unknown JFIF revision number %d.%02d")
+JMESSAGE(JWRN_JPEG_EOF, "Premature end of JPEG file")
+JMESSAGE(JWRN_MUST_RESYNC,
+ "Corrupt JPEG data: found marker 0x%02x instead of RST%d")
+JMESSAGE(JWRN_NOT_SEQUENTIAL, "Invalid SOS parameters for sequential JPEG")
+JMESSAGE(JWRN_TOO_MUCH_DATA, "Application transferred too many scanlines")
+
+#ifdef JMAKE_ENUM_LIST
+
+ JMSG_LASTMSGCODE
+} J_MESSAGE_CODE;
+
+#undef JMAKE_ENUM_LIST
+#endif /* JMAKE_ENUM_LIST */
+
+/* Zap JMESSAGE macro so that future re-inclusions do nothing by default */
+#undef JMESSAGE
+
+
+#ifndef JERROR_H
+#define JERROR_H
+
+/* Macros to simplify using the error and trace message stuff */
+/* The first parameter is either type of cinfo pointer */
+
+/* Fatal errors (print message and exit) */
+#define ERREXIT(cinfo,code) \
+ ((cinfo)->err->msg_code = (code), \
+ (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
+#define ERREXIT1(cinfo,code,p1) \
+ ((cinfo)->err->msg_code = (code), \
+ (cinfo)->err->msg_parm.i[0] = (p1), \
+ (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
+#define ERREXIT2(cinfo,code,p1,p2) \
+ ((cinfo)->err->msg_code = (code), \
+ (cinfo)->err->msg_parm.i[0] = (p1), \
+ (cinfo)->err->msg_parm.i[1] = (p2), \
+ (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
+#define ERREXIT3(cinfo,code,p1,p2,p3) \
+ ((cinfo)->err->msg_code = (code), \
+ (cinfo)->err->msg_parm.i[0] = (p1), \
+ (cinfo)->err->msg_parm.i[1] = (p2), \
+ (cinfo)->err->msg_parm.i[2] = (p3), \
+ (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
+#define ERREXIT4(cinfo,code,p1,p2,p3,p4) \
+ ((cinfo)->err->msg_code = (code), \
+ (cinfo)->err->msg_parm.i[0] = (p1), \
+ (cinfo)->err->msg_parm.i[1] = (p2), \
+ (cinfo)->err->msg_parm.i[2] = (p3), \
+ (cinfo)->err->msg_parm.i[3] = (p4), \
+ (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
+#define ERREXITS(cinfo,code,str) \
+ ((cinfo)->err->msg_code = (code), \
+ FXSYS_strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \
+ (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
+
+#define MAKESTMT(stuff) do { stuff } while (0)
+
+/* Nonfatal errors (we can keep going, but the data is probably corrupt) */
+#define WARNMS(cinfo,code) \
+ ((cinfo)->err->msg_code = (code), \
+ (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1))
+#define WARNMS1(cinfo,code,p1) \
+ ((cinfo)->err->msg_code = (code), \
+ (cinfo)->err->msg_parm.i[0] = (p1), \
+ (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1))
+#define WARNMS2(cinfo,code,p1,p2) \
+ ((cinfo)->err->msg_code = (code), \
+ (cinfo)->err->msg_parm.i[0] = (p1), \
+ (cinfo)->err->msg_parm.i[1] = (p2), \
+ (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1))
+
+/* Informational/debugging messages */
+#define TRACEMS(cinfo,lvl,code) \
+ ((cinfo)->err->msg_code = (code), \
+ (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))
+#define TRACEMS1(cinfo,lvl,code,p1) \
+ ((cinfo)->err->msg_code = (code), \
+ (cinfo)->err->msg_parm.i[0] = (p1), \
+ (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))
+#define TRACEMS2(cinfo,lvl,code,p1,p2) \
+ ((cinfo)->err->msg_code = (code), \
+ (cinfo)->err->msg_parm.i[0] = (p1), \
+ (cinfo)->err->msg_parm.i[1] = (p2), \
+ (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))
+#define TRACEMS3(cinfo,lvl,code,p1,p2,p3) \
+ MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \
+ _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); \
+ (cinfo)->err->msg_code = (code); \
+ (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )
+#define TRACEMS4(cinfo,lvl,code,p1,p2,p3,p4) \
+ MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \
+ _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \
+ (cinfo)->err->msg_code = (code); \
+ (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )
+#define TRACEMS5(cinfo,lvl,code,p1,p2,p3,p4,p5) \
+ MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \
+ _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \
+ _mp[4] = (p5); \
+ (cinfo)->err->msg_code = (code); \
+ (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )
+#define TRACEMS8(cinfo,lvl,code,p1,p2,p3,p4,p5,p6,p7,p8) \
+ MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \
+ _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \
+ _mp[4] = (p5); _mp[5] = (p6); _mp[6] = (p7); _mp[7] = (p8); \
+ (cinfo)->err->msg_code = (code); \
+ (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )
+#define TRACEMSS(cinfo,lvl,code,str) \
+ ((cinfo)->err->msg_code = (code), \
+ FXSYS_strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \
+ (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))
+
+#endif /* JERROR_H */
diff --git a/core/src/fxcodec/libjpeg/jinclude.h b/core/src/fxcodec/libjpeg/jinclude.h
index 070188a9b6..0c7aa68360 100644
--- a/core/src/fxcodec/libjpeg/jinclude.h
+++ b/core/src/fxcodec/libjpeg/jinclude.h
@@ -1,102 +1,102 @@
-/*
- * jinclude.h
- *
- * Copyright (C) 1991-1994, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- * For conditions of distribution and use, see the accompanying README file.
- *
- * This file exists to provide a single place to fix any problems with
- * including the wrong system include files. (Common problems are taken
- * care of by the standard jconfig symbols, but on really weird systems
- * you may have to edit this file.)
- *
- * NOTE: this file is NOT intended to be included by applications using the
- * JPEG library. Most applications need only include jpeglib.h.
- */
-
-
-/* Include auto-config file to find out which system include files we need. */
-
-#include "jconfig.h" /* auto configuration options */
-#define JCONFIG_INCLUDED /* so that jpeglib.h doesn't do it again */
-
-#include "../../../include/fxcrt/fx_system.h"
-/*
- * We need the NULL macro and size_t typedef.
- * On an ANSI-conforming system it is sufficient to include <stddef.h>.
- * Otherwise, we get them from <stdlib.h> or <stdio.h>; we may have to
- * pull in <sys/types.h> as well.
- * Note that the core JPEG library does not require <stdio.h>;
- * only the default error handler and data source/destination modules do.
- * But we must pull it in because of the references to FILE in jpeglib.h.
- * You can remove those references if you want to compile without <stdio.h>.
- */
-
-#ifdef _DEBUG
-#define CRTDBG_MAP_ALLOC
-//#include <stdlib.h>
-//#include <crtdbg.h>
-#endif
-
-#ifdef HAVE_STDDEF_H
-#include <stddef.h>
-#endif
-
-#ifdef HAVE_STDLIB_H
-//#include <stdlib.h>
-#endif
-
-#ifdef NEED_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-
-#ifndef FAR
-#define FAR
-#endif
-
-//#include <stdio.h>
-
-/*
- * We need memory copying and zeroing functions, plus strncpy().
- * ANSI and System V implementations declare these in <string.h>.
- * BSD doesn't have the mem() functions, but it does have bcopy()/bzero().
- * Some systems may declare memset and memcpy in <memory.h>.
- *
- * NOTE: we assume the size parameters to these functions are of type size_t.
- * Change the casts in these macros if not!
- */
-
-#ifdef NEED_BSD_STRINGS
-
-//#include <strings.h>
-#define MEMZERO(target,size) bzero((void *)(target), (size_t)(size))
-#define MEMCOPY(dest,src,size) bcopy((const void *)(src), (void *)(dest), (size_t)(size))
-
-#else /* not BSD, assume ANSI/SysV string lib */
-
-//#include <string.h>
-#define MEMZERO(target,size) FXSYS_memset32((void *)(target), 0, (size_t)(size))
-#define MEMCOPY(dest,src,size) FXSYS_memcpy32((void *)(dest), (const void *)(src), (size_t)(size))
-
-#endif
-
-/*
- * In ANSI C, and indeed any rational implementation, size_t is also the
- * type returned by sizeof(). However, it seems there are some irrational
- * implementations out there, in which sizeof() returns an int even though
- * size_t is defined as long or unsigned long. To ensure consistent results
- * we always use this SIZEOF() macro in place of using sizeof() directly.
- */
-
-#define SIZEOF(object) ((size_t) sizeof(object))
-
-/*
- * The modules that use fread() and fwrite() always invoke them through
- * these macros. On some systems you may need to twiddle the argument casts.
- * CAUTION: argument order is different from underlying functions!
- */
-
-#define JFREAD(file,buf,sizeofbuf) \
- ((size_t) FXSYS_fread((void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file)))
-#define JFWRITE(file,buf,sizeofbuf) \
- ((size_t) FXSYS_fwrite((const void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file)))
+/*
+ * jinclude.h
+ *
+ * Copyright (C) 1991-1994, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file exists to provide a single place to fix any problems with
+ * including the wrong system include files. (Common problems are taken
+ * care of by the standard jconfig symbols, but on really weird systems
+ * you may have to edit this file.)
+ *
+ * NOTE: this file is NOT intended to be included by applications using the
+ * JPEG library. Most applications need only include jpeglib.h.
+ */
+
+
+/* Include auto-config file to find out which system include files we need. */
+
+#include "jconfig.h" /* auto configuration options */
+#define JCONFIG_INCLUDED /* so that jpeglib.h doesn't do it again */
+
+#include "../../../include/fxcrt/fx_system.h"
+/*
+ * We need the NULL macro and size_t typedef.
+ * On an ANSI-conforming system it is sufficient to include <stddef.h>.
+ * Otherwise, we get them from <stdlib.h> or <stdio.h>; we may have to
+ * pull in <sys/types.h> as well.
+ * Note that the core JPEG library does not require <stdio.h>;
+ * only the default error handler and data source/destination modules do.
+ * But we must pull it in because of the references to FILE in jpeglib.h.
+ * You can remove those references if you want to compile without <stdio.h>.
+ */
+
+#ifdef _DEBUG
+#define CRTDBG_MAP_ALLOC
+//#include <stdlib.h>
+//#include <crtdbg.h>
+#endif
+
+#ifdef HAVE_STDDEF_H
+#include <stddef.h>
+#endif
+
+#ifdef HAVE_STDLIB_H
+//#include <stdlib.h>
+#endif
+
+#ifdef NEED_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#ifndef FAR
+#define FAR
+#endif
+
+//#include <stdio.h>
+
+/*
+ * We need memory copying and zeroing functions, plus strncpy().
+ * ANSI and System V implementations declare these in <string.h>.
+ * BSD doesn't have the mem() functions, but it does have bcopy()/bzero().
+ * Some systems may declare memset and memcpy in <memory.h>.
+ *
+ * NOTE: we assume the size parameters to these functions are of type size_t.
+ * Change the casts in these macros if not!
+ */
+
+#ifdef NEED_BSD_STRINGS
+
+//#include <strings.h>
+#define MEMZERO(target,size) bzero((void *)(target), (size_t)(size))
+#define MEMCOPY(dest,src,size) bcopy((const void *)(src), (void *)(dest), (size_t)(size))
+
+#else /* not BSD, assume ANSI/SysV string lib */
+
+//#include <string.h>
+#define MEMZERO(target,size) FXSYS_memset32((void *)(target), 0, (size_t)(size))
+#define MEMCOPY(dest,src,size) FXSYS_memcpy32((void *)(dest), (const void *)(src), (size_t)(size))
+
+#endif
+
+/*
+ * In ANSI C, and indeed any rational implementation, size_t is also the
+ * type returned by sizeof(). However, it seems there are some irrational
+ * implementations out there, in which sizeof() returns an int even though
+ * size_t is defined as long or unsigned long. To ensure consistent results
+ * we always use this SIZEOF() macro in place of using sizeof() directly.
+ */
+
+#define SIZEOF(object) ((size_t) sizeof(object))
+
+/*
+ * The modules that use fread() and fwrite() always invoke them through
+ * these macros. On some systems you may need to twiddle the argument casts.
+ * CAUTION: argument order is different from underlying functions!
+ */
+
+#define JFREAD(file,buf,sizeofbuf) \
+ ((size_t) FXSYS_fread((void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file)))
+#define JFWRITE(file,buf,sizeofbuf) \
+ ((size_t) FXSYS_fwrite((const void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file)))
diff --git a/core/src/fxcodec/libjpeg/jmemsys.h b/core/src/fxcodec/libjpeg/jmemsys.h
index baa7b7f993..ef1481514b 100644
--- a/core/src/fxcodec/libjpeg/jmemsys.h
+++ b/core/src/fxcodec/libjpeg/jmemsys.h
@@ -1,200 +1,200 @@
-/*
- * jmemsys.h
- *
- * Copyright (C) 1992-1997, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- * For conditions of distribution and use, see the accompanying README file.
- *
- * This include file defines the interface between the system-independent
- * and system-dependent portions of the JPEG memory manager. No other
- * modules need include it. (The system-independent portion is jmemmgr.c;
- * there are several different versions of the system-dependent portion.)
- *
- * This file works as-is for the system-dependent memory managers supplied
- * in the IJG distribution. You may need to modify it if you write a
- * custom memory manager. If system-dependent changes are needed in
- * this file, the best method is to #ifdef them based on a configuration
- * symbol supplied in jconfig.h, as we have done with USE_MSDOS_MEMMGR
- * and USE_MAC_MEMMGR.
- */
-
-
-/* Short forms of external names for systems with brain-damaged linkers. */
-
-#ifdef NEED_SHORT_EXTERNAL_NAMES
-#define jpeg_get_small jGetSmall
-#define jpeg_free_small jFreeSmall
-#define jpeg_get_large jGetLarge
-#define jpeg_free_large jFreeLarge
-#define jpeg_mem_available jMemAvail
-#define jpeg_open_backing_store jOpenBackStore
-#define jpeg_mem_init jMemInit
-#define jpeg_mem_term jMemTerm
-#endif /* NEED_SHORT_EXTERNAL_NAMES */
-
-
-/*
- * These two functions are used to allocate and release small chunks of
- * memory. (Typically the total amount requested through jpeg_get_small is
- * no more than 20K or so; this will be requested in chunks of a few K each.)
- * Behavior should be the same as for the standard library functions malloc
- * and free; in particular, jpeg_get_small must return NULL on failure.
- * On most systems, these ARE malloc and free. jpeg_free_small is passed the
- * size of the object being freed, just in case it's needed.
- * On an 80x86 machine using small-data memory model, these manage near heap.
- */
-
-EXTERN(void *) jpeg_get_small JPP((j_common_ptr cinfo, size_t sizeofobject));
-EXTERN(void) jpeg_free_small JPP((j_common_ptr cinfo, void * object,
- size_t sizeofobject));
-
-/*
- * These two functions are used to allocate and release large chunks of
- * memory (up to the total free space designated by jpeg_mem_available).
- * The interface is the same as above, except that on an 80x86 machine,
- * far pointers are used. On most other machines these are identical to
- * the jpeg_get/free_small routines; but we keep them separate anyway,
- * in case a different allocation strategy is desirable for large chunks.
- */
-
-EXTERN(void FAR *) jpeg_get_large JPP((j_common_ptr cinfo,
- size_t sizeofobject));
-EXTERN(void) jpeg_free_large JPP((j_common_ptr cinfo, void FAR * object,
- size_t sizeofobject));
-
-/*
- * The macro MAX_ALLOC_CHUNK designates the maximum number of bytes that may
- * be requested in a single call to jpeg_get_large (and jpeg_get_small for that
- * matter, but that case should never come into play). This macro is needed
- * to model the 64Kb-segment-size limit of far addressing on 80x86 machines.
- * On those machines, we expect that jconfig.h will provide a proper value.
- * On machines with 32-bit flat address spaces, any large constant may be used.
- *
- * NB: jmemmgr.c expects that MAX_ALLOC_CHUNK will be representable as type
- * size_t and will be a multiple of sizeof(align_type).
- */
-
-#ifndef MAX_ALLOC_CHUNK /* may be overridden in jconfig.h */
-#define MAX_ALLOC_CHUNK 1000000000L
-#endif
-
-/*
- * This routine computes the total space still available for allocation by
- * jpeg_get_large. If more space than this is needed, backing store will be
- * used. NOTE: any memory already allocated must not be counted.
- *
- * There is a minimum space requirement, corresponding to the minimum
- * feasible buffer sizes; jmemmgr.c will request that much space even if
- * jpeg_mem_available returns zero. The maximum space needed, enough to hold
- * all working storage in memory, is also passed in case it is useful.
- * Finally, the total space already allocated is passed. If no better
- * method is available, cinfo->mem->max_memory_to_use - already_allocated
- * is often a suitable calculation.
- *
- * It is OK for jpeg_mem_available to underestimate the space available
- * (that'll just lead to more backing-store access than is really necessary).
- * However, an overestimate will lead to failure. Hence it's wise to subtract
- * a slop factor from the true available space. 5% should be enough.
- *
- * On machines with lots of virtual memory, any large constant may be returned.
- * Conversely, zero may be returned to always use the minimum amount of memory.
- */
-
-EXTERN(long) jpeg_mem_available JPP((j_common_ptr cinfo,
- long min_bytes_needed,
- long max_bytes_needed,
- long already_allocated));
-
-
-/*
- * This structure holds whatever state is needed to access a single
- * backing-store object. The read/write/close method pointers are called
- * by jmemmgr.c to manipulate the backing-store object; all other fields
- * are private to the system-dependent backing store routines.
- */
-
-#define TEMP_NAME_LENGTH 64 /* max length of a temporary file's name */
-
-
-#ifdef USE_MSDOS_MEMMGR /* DOS-specific junk */
-
-typedef unsigned short XMSH; /* type of extended-memory handles */
-typedef unsigned short EMSH; /* type of expanded-memory handles */
-
-typedef union {
- short file_handle; /* DOS file handle if it's a temp file */
- XMSH xms_handle; /* handle if it's a chunk of XMS */
- EMSH ems_handle; /* handle if it's a chunk of EMS */
-} handle_union;
-
-#endif /* USE_MSDOS_MEMMGR */
-
-#ifdef USE_MAC_MEMMGR /* Mac-specific junk */
-#include <Files.h>
-#endif /* USE_MAC_MEMMGR */
-
-
-typedef struct backing_store_struct * backing_store_ptr;
-
-typedef struct backing_store_struct {
- /* Methods for reading/writing/closing this backing-store object */
- JMETHOD(void, read_backing_store, (j_common_ptr cinfo,
- backing_store_ptr info,
- void FAR * buffer_address,
- long file_offset, long byte_count));
- JMETHOD(void, write_backing_store, (j_common_ptr cinfo,
- backing_store_ptr info,
- void FAR * buffer_address,
- long file_offset, long byte_count));
- JMETHOD(void, close_backing_store, (j_common_ptr cinfo,
- backing_store_ptr info));
-
- /* Private fields for system-dependent backing-store management */
-#ifdef USE_MSDOS_MEMMGR
- /* For the MS-DOS manager (jmemdos.c), we need: */
- handle_union handle; /* reference to backing-store storage object */
- char temp_name[TEMP_NAME_LENGTH]; /* name if it's a file */
-#else
-#ifdef USE_MAC_MEMMGR
- /* For the Mac manager (jmemmac.c), we need: */
- short temp_file; /* file reference number to temp file */
- FSSpec tempSpec; /* the FSSpec for the temp file */
- char temp_name[TEMP_NAME_LENGTH]; /* name if it's a file */
-#else
- /* For a typical implementation with temp files, we need: */
-#ifndef _FPDFAPI_MINI_
- FXSYS_FILE * temp_file; /* stdio reference to temp file */
- char temp_name[TEMP_NAME_LENGTH]; /* name of temp file */
-#endif
-#endif
-#endif
-} backing_store_info;
-
-
-/*
- * Initial opening of a backing-store object. This must fill in the
- * read/write/close pointers in the object. The read/write routines
- * may take an error exit if the specified maximum file size is exceeded.
- * (If jpeg_mem_available always returns a large value, this routine can
- * just take an error exit.)
- */
-
-EXTERN(void) jpeg_open_backing_store JPP((j_common_ptr cinfo,
- backing_store_ptr info,
- long total_bytes_needed));
-
-
-/*
- * These routines take care of any system-dependent initialization and
- * cleanup required. jpeg_mem_init will be called before anything is
- * allocated (and, therefore, nothing in cinfo is of use except the error
- * manager pointer). It should return a suitable default value for
- * max_memory_to_use; this may subsequently be overridden by the surrounding
- * application. (Note that max_memory_to_use is only important if
- * jpeg_mem_available chooses to consult it ... no one else will.)
- * jpeg_mem_term may assume that all requested memory has been freed and that
- * all opened backing-store objects have been closed.
- */
-
-EXTERN(long) jpeg_mem_init JPP((j_common_ptr cinfo));
-EXTERN(void) jpeg_mem_term JPP((j_common_ptr cinfo));
+/*
+ * jmemsys.h
+ *
+ * Copyright (C) 1992-1997, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This include file defines the interface between the system-independent
+ * and system-dependent portions of the JPEG memory manager. No other
+ * modules need include it. (The system-independent portion is jmemmgr.c;
+ * there are several different versions of the system-dependent portion.)
+ *
+ * This file works as-is for the system-dependent memory managers supplied
+ * in the IJG distribution. You may need to modify it if you write a
+ * custom memory manager. If system-dependent changes are needed in
+ * this file, the best method is to #ifdef them based on a configuration
+ * symbol supplied in jconfig.h, as we have done with USE_MSDOS_MEMMGR
+ * and USE_MAC_MEMMGR.
+ */
+
+
+/* Short forms of external names for systems with brain-damaged linkers. */
+
+#ifdef NEED_SHORT_EXTERNAL_NAMES
+#define jpeg_get_small jGetSmall
+#define jpeg_free_small jFreeSmall
+#define jpeg_get_large jGetLarge
+#define jpeg_free_large jFreeLarge
+#define jpeg_mem_available jMemAvail
+#define jpeg_open_backing_store jOpenBackStore
+#define jpeg_mem_init jMemInit
+#define jpeg_mem_term jMemTerm
+#endif /* NEED_SHORT_EXTERNAL_NAMES */
+
+
+/*
+ * These two functions are used to allocate and release small chunks of
+ * memory. (Typically the total amount requested through jpeg_get_small is
+ * no more than 20K or so; this will be requested in chunks of a few K each.)
+ * Behavior should be the same as for the standard library functions malloc
+ * and free; in particular, jpeg_get_small must return NULL on failure.
+ * On most systems, these ARE malloc and free. jpeg_free_small is passed the
+ * size of the object being freed, just in case it's needed.
+ * On an 80x86 machine using small-data memory model, these manage near heap.
+ */
+
+EXTERN(void *) jpeg_get_small JPP((j_common_ptr cinfo, size_t sizeofobject));
+EXTERN(void) jpeg_free_small JPP((j_common_ptr cinfo, void * object,
+ size_t sizeofobject));
+
+/*
+ * These two functions are used to allocate and release large chunks of
+ * memory (up to the total free space designated by jpeg_mem_available).
+ * The interface is the same as above, except that on an 80x86 machine,
+ * far pointers are used. On most other machines these are identical to
+ * the jpeg_get/free_small routines; but we keep them separate anyway,
+ * in case a different allocation strategy is desirable for large chunks.
+ */
+
+EXTERN(void FAR *) jpeg_get_large JPP((j_common_ptr cinfo,
+ size_t sizeofobject));
+EXTERN(void) jpeg_free_large JPP((j_common_ptr cinfo, void FAR * object,
+ size_t sizeofobject));
+
+/*
+ * The macro MAX_ALLOC_CHUNK designates the maximum number of bytes that may
+ * be requested in a single call to jpeg_get_large (and jpeg_get_small for that
+ * matter, but that case should never come into play). This macro is needed
+ * to model the 64Kb-segment-size limit of far addressing on 80x86 machines.
+ * On those machines, we expect that jconfig.h will provide a proper value.
+ * On machines with 32-bit flat address spaces, any large constant may be used.
+ *
+ * NB: jmemmgr.c expects that MAX_ALLOC_CHUNK will be representable as type
+ * size_t and will be a multiple of sizeof(align_type).
+ */
+
+#ifndef MAX_ALLOC_CHUNK /* may be overridden in jconfig.h */
+#define MAX_ALLOC_CHUNK 1000000000L
+#endif
+
+/*
+ * This routine computes the total space still available for allocation by
+ * jpeg_get_large. If more space than this is needed, backing store will be
+ * used. NOTE: any memory already allocated must not be counted.
+ *
+ * There is a minimum space requirement, corresponding to the minimum
+ * feasible buffer sizes; jmemmgr.c will request that much space even if
+ * jpeg_mem_available returns zero. The maximum space needed, enough to hold
+ * all working storage in memory, is also passed in case it is useful.
+ * Finally, the total space already allocated is passed. If no better
+ * method is available, cinfo->mem->max_memory_to_use - already_allocated
+ * is often a suitable calculation.
+ *
+ * It is OK for jpeg_mem_available to underestimate the space available
+ * (that'll just lead to more backing-store access than is really necessary).
+ * However, an overestimate will lead to failure. Hence it's wise to subtract
+ * a slop factor from the true available space. 5% should be enough.
+ *
+ * On machines with lots of virtual memory, any large constant may be returned.
+ * Conversely, zero may be returned to always use the minimum amount of memory.
+ */
+
+EXTERN(long) jpeg_mem_available JPP((j_common_ptr cinfo,
+ long min_bytes_needed,
+ long max_bytes_needed,
+ long already_allocated));
+
+
+/*
+ * This structure holds whatever state is needed to access a single
+ * backing-store object. The read/write/close method pointers are called
+ * by jmemmgr.c to manipulate the backing-store object; all other fields
+ * are private to the system-dependent backing store routines.
+ */
+
+#define TEMP_NAME_LENGTH 64 /* max length of a temporary file's name */
+
+
+#ifdef USE_MSDOS_MEMMGR /* DOS-specific junk */
+
+typedef unsigned short XMSH; /* type of extended-memory handles */
+typedef unsigned short EMSH; /* type of expanded-memory handles */
+
+typedef union {
+ short file_handle; /* DOS file handle if it's a temp file */
+ XMSH xms_handle; /* handle if it's a chunk of XMS */
+ EMSH ems_handle; /* handle if it's a chunk of EMS */
+} handle_union;
+
+#endif /* USE_MSDOS_MEMMGR */
+
+#ifdef USE_MAC_MEMMGR /* Mac-specific junk */
+#include <Files.h>
+#endif /* USE_MAC_MEMMGR */
+
+
+typedef struct backing_store_struct * backing_store_ptr;
+
+typedef struct backing_store_struct {
+ /* Methods for reading/writing/closing this backing-store object */
+ JMETHOD(void, read_backing_store, (j_common_ptr cinfo,
+ backing_store_ptr info,
+ void FAR * buffer_address,
+ long file_offset, long byte_count));
+ JMETHOD(void, write_backing_store, (j_common_ptr cinfo,
+ backing_store_ptr info,
+ void FAR * buffer_address,
+ long file_offset, long byte_count));
+ JMETHOD(void, close_backing_store, (j_common_ptr cinfo,
+ backing_store_ptr info));
+
+ /* Private fields for system-dependent backing-store management */
+#ifdef USE_MSDOS_MEMMGR
+ /* For the MS-DOS manager (jmemdos.c), we need: */
+ handle_union handle; /* reference to backing-store storage object */
+ char temp_name[TEMP_NAME_LENGTH]; /* name if it's a file */
+#else
+#ifdef USE_MAC_MEMMGR
+ /* For the Mac manager (jmemmac.c), we need: */
+ short temp_file; /* file reference number to temp file */
+ FSSpec tempSpec; /* the FSSpec for the temp file */
+ char temp_name[TEMP_NAME_LENGTH]; /* name if it's a file */
+#else
+ /* For a typical implementation with temp files, we need: */
+#ifndef _FPDFAPI_MINI_
+ FXSYS_FILE * temp_file; /* stdio reference to temp file */
+ char temp_name[TEMP_NAME_LENGTH]; /* name of temp file */
+#endif
+#endif
+#endif
+} backing_store_info;
+
+
+/*
+ * Initial opening of a backing-store object. This must fill in the
+ * read/write/close pointers in the object. The read/write routines
+ * may take an error exit if the specified maximum file size is exceeded.
+ * (If jpeg_mem_available always returns a large value, this routine can
+ * just take an error exit.)
+ */
+
+EXTERN(void) jpeg_open_backing_store JPP((j_common_ptr cinfo,
+ backing_store_ptr info,
+ long total_bytes_needed));
+
+
+/*
+ * These routines take care of any system-dependent initialization and
+ * cleanup required. jpeg_mem_init will be called before anything is
+ * allocated (and, therefore, nothing in cinfo is of use except the error
+ * manager pointer). It should return a suitable default value for
+ * max_memory_to_use; this may subsequently be overridden by the surrounding
+ * application. (Note that max_memory_to_use is only important if
+ * jpeg_mem_available chooses to consult it ... no one else will.)
+ * jpeg_mem_term may assume that all requested memory has been freed and that
+ * all opened backing-store objects have been closed.
+ */
+
+EXTERN(long) jpeg_mem_init JPP((j_common_ptr cinfo));
+EXTERN(void) jpeg_mem_term JPP((j_common_ptr cinfo));
diff --git a/core/src/fxcodec/libjpeg/jmorecfg.h b/core/src/fxcodec/libjpeg/jmorecfg.h
index 3602114a5c..88d210954c 100644
--- a/core/src/fxcodec/libjpeg/jmorecfg.h
+++ b/core/src/fxcodec/libjpeg/jmorecfg.h
@@ -1,376 +1,376 @@
-/*
- * jmorecfg.h
- *
- * Copyright (C) 1991-1997, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- * For conditions of distribution and use, see the accompanying README file.
- *
- * This file contains additional configuration options that customize the
- * JPEG software for special applications or support machine-dependent
- * optimizations. Most users will not need to touch this file.
- */
-
-#ifdef _MSC_VER
-#pragma warning (disable : 4142)
-#endif
-
-/*
- * Define BITS_IN_JSAMPLE as either
- * 8 for 8-bit sample values (the usual setting)
- * 12 for 12-bit sample values
- * Only 8 and 12 are legal data precisions for lossy JPEG according to the
- * JPEG standard, and the IJG code does not support anything else!
- * We do not support run-time selection of data precision, sorry.
- */
-
-#define BITS_IN_JSAMPLE 8 /* use 8 or 12 */
-
-
-/*
- * Maximum number of components (color channels) allowed in JPEG image.
- * To meet the letter of the JPEG spec, set this to 255. However, darn
- * few applications need more than 4 channels (maybe 5 for CMYK + alpha
- * mask). We recommend 10 as a reasonable compromise; use 4 if you are
- * really short on memory. (Each allowed component costs a hundred or so
- * bytes of storage, whether actually used in an image or not.)
- */
-
-#define MAX_COMPONENTS 10 /* maximum number of image components */
-
-
-/*
- * Basic data types.
- * You may need to change these if you have a machine with unusual data
- * type sizes; for example, "char" not 8 bits, "short" not 16 bits,
- * or "long" not 32 bits. We don't care whether "int" is 16 or 32 bits,
- * but it had better be at least 16.
- */
-
-/* Representation of a single sample (pixel element value).
- * We frequently allocate large arrays of these, so it's important to keep
- * them small. But if you have memory to burn and access to char or short
- * arrays is very slow on your hardware, you might want to change these.
- */
-
-#if BITS_IN_JSAMPLE == 8
-/* JSAMPLE should be the smallest type that will hold the values 0..255.
- * You can use a signed char by having GETJSAMPLE mask it with 0xFF.
- */
-
-#ifdef HAVE_UNSIGNED_CHAR
-
-typedef unsigned char JSAMPLE;
-#define GETJSAMPLE(value) ((int) (value))
-
-#else /* not HAVE_UNSIGNED_CHAR */
-
-typedef char JSAMPLE;
-#ifdef CHAR_IS_UNSIGNED
-#define GETJSAMPLE(value) ((int) (value))
-#else
-#define GETJSAMPLE(value) ((int) (value) & 0xFF)
-#endif /* CHAR_IS_UNSIGNED */
-
-#endif /* HAVE_UNSIGNED_CHAR */
-
-#define MAXJSAMPLE 255
-#define CENTERJSAMPLE 128
-
-#endif /* BITS_IN_JSAMPLE == 8 */
-
-
-#if BITS_IN_JSAMPLE == 12
-/* JSAMPLE should be the smallest type that will hold the values 0..4095.
- * On nearly all machines "short" will do nicely.
- */
-
-typedef short JSAMPLE;
-#define GETJSAMPLE(value) ((int) (value))
-
-#define MAXJSAMPLE 4095
-#define CENTERJSAMPLE 2048
-
-#endif /* BITS_IN_JSAMPLE == 12 */
-
-
-/* Representation of a DCT frequency coefficient.
- * This should be a signed value of at least 16 bits; "short" is usually OK.
- * Again, we allocate large arrays of these, but you can change to int
- * if you have memory to burn and "short" is really slow.
- */
-
-typedef short JCOEF;
-
-
-/* Compressed datastreams are represented as arrays of JOCTET.
- * These must be EXACTLY 8 bits wide, at least once they are written to
- * external storage. Note that when using the stdio data source/destination
- * managers, this is also the data type passed to fread/fwrite.
- */
-
-#ifdef HAVE_UNSIGNED_CHAR
-
-typedef unsigned char JOCTET;
-#define GETJOCTET(value) (value)
-
-#else /* not HAVE_UNSIGNED_CHAR */
-
-typedef char JOCTET;
-#ifdef CHAR_IS_UNSIGNED
-#define GETJOCTET(value) (value)
-#else
-#define GETJOCTET(value) ((value) & 0xFF)
-#endif /* CHAR_IS_UNSIGNED */
-
-#endif /* HAVE_UNSIGNED_CHAR */
-
-
-/* These typedefs are used for various table entries and so forth.
- * They must be at least as wide as specified; but making them too big
- * won't cost a huge amount of memory, so we don't provide special
- * extraction code like we did for JSAMPLE. (In other words, these
- * typedefs live at a different point on the speed/space tradeoff curve.)
- */
-
-#if _FX_OS_ != _FX_VXWORKS_
-
-/* UINT8 must hold at least the values 0..255. */
-
-#ifdef HAVE_UNSIGNED_CHAR
-typedef unsigned char UINT8;
-#else /* not HAVE_UNSIGNED_CHAR */
-#ifdef CHAR_IS_UNSIGNED
-typedef char UINT8;
-#else /* not CHAR_IS_UNSIGNED */
-typedef short UINT8;
-#endif /* CHAR_IS_UNSIGNED */
-#endif /* HAVE_UNSIGNED_CHAR */
-
-
-/* UINT16 must hold at least the values 0..65535. */
-
-#ifdef HAVE_UNSIGNED_SHORT
-typedef unsigned short UINT16;
-#else /* not HAVE_UNSIGNED_SHORT */
-typedef unsigned int UINT16;
-#endif /* HAVE_UNSIGNED_SHORT */
-
-/* INT16 must hold at least the values -32768..32767. */
-
-#ifndef XMD_H /* X11/xmd.h correctly defines INT16 */
-typedef short INT16;
-#endif
-
-/* INT32 must hold at least signed 32-bit values. */
-
-#ifndef XMD_H /* X11/xmd.h correctly defines INT32 */
-typedef int INT32;
-#endif
-
-#endif
-
-/* Datatype used for image dimensions. The JPEG standard only supports
- * images up to 64K*64K due to 16-bit fields in SOF markers. Therefore
- * "unsigned int" is sufficient on all machines. However, if you need to
- * handle larger images and you don't mind deviating from the spec, you
- * can change this datatype.
- */
-
-typedef unsigned int JDIMENSION;
-
-#define JPEG_MAX_DIMENSION 65500L /* a tad under 64K to prevent overflows */
-
-
-/* These macros are used in all function definitions and extern declarations.
- * You could modify them if you need to change function linkage conventions;
- * in particular, you'll need to do that to make the library a Windows DLL.
- * Another application is to make all functions global for use with debuggers
- * or code profilers that require it.
- */
-
-/* a function called through method pointers: */
-#define METHODDEF(type) static type
-/* a function used only in its module: */
-#define LOCAL(type) static type
-/* a function referenced thru EXTERNs: */
-#define GLOBAL(type) type
-
-#ifdef _FX_MANAGED_CODE_
-#define EXTERN(type) extern "C" type
-#else
-/* a reference to a GLOBAL function: */
-#define EXTERN(type) extern type
-#endif
-
-
-/* This macro is used to declare a "method", that is, a function pointer.
- * We want to supply prototype parameters if the compiler can cope.
- * Note that the arglist parameter must be parenthesized!
- * Again, you can customize this if you need special linkage keywords.
- */
-
-#ifdef HAVE_PROTOTYPES
-#define JMETHOD(type,methodname,arglist) type (*methodname) arglist
-#else
-#define JMETHOD(type,methodname,arglist) type (*methodname) ()
-#endif
-
-
-/* Here is the pseudo-keyword for declaring pointers that must be "far"
- * on 80x86 machines. Most of the specialized coding for 80x86 is handled
- * by just saying "FAR *" where such a pointer is needed. In a few places
- * explicit coding is needed; see uses of the NEED_FAR_POINTERS symbol.
- */
-
-#ifdef NEED_FAR_POINTERS
-#define FAR far
-#else
-//#define FAR
-#endif
-
-
-/*
- * On a few systems, type boolean and/or its values FALSE, TRUE may appear
- * in standard header files. Or you may have conflicts with application-
- * specific header files that you want to include together with these files.
- * Defining HAVE_BOOLEAN before including jpeglib.h should make it work.
- */
-
-#ifndef HAVE_BOOLEAN
-typedef int boolean;
-#endif
-#ifndef FALSE /* in case these macros already exist */
-#define FALSE 0 /* values of boolean */
-#endif
-#ifndef TRUE
-#define TRUE 1
-#endif
-
-
-/*
- * The remaining options affect code selection within the JPEG library,
- * but they don't need to be visible to most applications using the library.
- * To minimize application namespace pollution, the symbols won't be
- * defined unless JPEG_INTERNALS or JPEG_INTERNAL_OPTIONS has been defined.
- */
-
-#ifdef JPEG_INTERNALS
-#define JPEG_INTERNAL_OPTIONS
-#endif
-
-#ifdef JPEG_INTERNAL_OPTIONS
-
-
-/*
- * These defines indicate whether to include various optional functions.
- * Undefining some of these symbols will produce a smaller but less capable
- * library. Note that you can leave certain source files out of the
- * compilation/linking process if you've #undef'd the corresponding symbols.
- * (You may HAVE to do that if your compiler doesn't like null source files.)
- */
-
-/* Arithmetic coding is unsupported for legal reasons. Complaints to IBM. */
-
-/* Capability options common to encoder and decoder: */
-
-#define DCT_ISLOW_SUPPORTED /* slow but accurate integer algorithm */
-#define DCT_IFAST_SUPPORTED /* faster, less accurate integer method */
-#undef DCT_FLOAT_SUPPORTED /* floating-point: accurate, fast on fast HW */
-
-/* Encoder capability options: */
-
-#undef C_ARITH_CODING_SUPPORTED /* Arithmetic coding back end? */
-#define C_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */
-#define C_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/
-#define ENTROPY_OPT_SUPPORTED /* Optimization of entropy coding parms? */
-/* Note: if you selected 12-bit data precision, it is dangerous to turn off
- * ENTROPY_OPT_SUPPORTED. The standard Huffman tables are only good for 8-bit
- * precision, so jchuff.c normally uses entropy optimization to compute
- * usable tables for higher precision. If you don't want to do optimization,
- * you'll have to supply different default Huffman tables.
- * The exact same statements apply for progressive JPEG: the default tables
- * don't work for progressive mode. (This may get fixed, however.)
- */
-#define INPUT_SMOOTHING_SUPPORTED /* Input image smoothing option? */
-
-/* Decoder capability options: */
-
-#undef D_ARITH_CODING_SUPPORTED /* Arithmetic coding back end? */
-#define D_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */
-#define D_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/
-#define SAVE_MARKERS_SUPPORTED /* jpeg_save_markers() needed? */
-#define BLOCK_SMOOTHING_SUPPORTED /* Block smoothing? (Progressive only) */
-#define IDCT_SCALING_SUPPORTED /* Output rescaling via IDCT? */
-#undef UPSAMPLE_SCALING_SUPPORTED /* Output rescaling at upsample stage? */
-#define UPSAMPLE_MERGING_SUPPORTED /* Fast path for sloppy upsampling? */
-#undef QUANT_1PASS_SUPPORTED /* 1-pass color quantization? */
-#undef QUANT_2PASS_SUPPORTED /* 2-pass color quantization? */
-
-/* more capability options later, no doubt */
-
-
-/*
- * Ordering of RGB data in scanlines passed to or from the application.
- * If your application wants to deal with data in the order B,G,R, just
- * change these macros. You can also deal with formats such as R,G,B,X
- * (one extra byte per pixel) by changing RGB_PIXELSIZE. Note that changing
- * the offsets will also change the order in which colormap data is organized.
- * RESTRICTIONS:
- * 1. The sample applications cjpeg,djpeg do NOT support modified RGB formats.
- * 2. These macros only affect RGB<=>YCbCr color conversion, so they are not
- * useful if you are using JPEG color spaces other than YCbCr or grayscale.
- * 3. The color quantizer modules will not behave desirably if RGB_PIXELSIZE
- * is not 3 (they don't understand about dummy color components!). So you
- * can't use color quantization if you change that value.
- */
-
-#define RGB_RED 0 /* Offset of Red in an RGB scanline element */
-#define RGB_GREEN 1 /* Offset of Green */
-#define RGB_BLUE 2 /* Offset of Blue */
-#define RGB_PIXELSIZE 3 /* JSAMPLEs per RGB scanline element */
-
-
-/* Definitions for speed-related optimizations. */
-
-
-/* If your compiler supports inline functions, define INLINE
- * as the inline keyword; otherwise define it as empty.
- */
-
-#ifndef INLINE
-#ifdef __GNUC__ /* for instance, GNU C knows about inline */
-#define INLINE __inline__
-#endif
-#ifndef INLINE
-#define INLINE /* default is to define it as empty */
-#endif
-#endif
-
-
-/* On some machines (notably 68000 series) "int" is 32 bits, but multiplying
- * two 16-bit shorts is faster than multiplying two ints. Define MULTIPLIER
- * as short on such a machine. MULTIPLIER must be at least 16 bits wide.
- */
-
-#ifndef MULTIPLIER
-#define MULTIPLIER int /* type for fastest integer multiply */
-#endif
-
-
-/* FAST_FLOAT should be either float or double, whichever is done faster
- * by your compiler. (Note that this type is only used in the floating point
- * DCT routines, so it only matters if you've defined DCT_FLOAT_SUPPORTED.)
- * Typically, float is faster in ANSI C compilers, while double is faster in
- * pre-ANSI compilers (because they insist on converting to double anyway).
- * The code below therefore chooses float if we have ANSI-style prototypes.
- */
-
-#ifndef FAST_FLOAT
-#ifdef HAVE_PROTOTYPES
-#define FAST_FLOAT float
-#else
-#define FAST_FLOAT double
-#endif
-#endif
-
-#endif /* JPEG_INTERNAL_OPTIONS */
+/*
+ * jmorecfg.h
+ *
+ * Copyright (C) 1991-1997, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains additional configuration options that customize the
+ * JPEG software for special applications or support machine-dependent
+ * optimizations. Most users will not need to touch this file.
+ */
+
+#ifdef _MSC_VER
+#pragma warning (disable : 4142)
+#endif
+
+/*
+ * Define BITS_IN_JSAMPLE as either
+ * 8 for 8-bit sample values (the usual setting)
+ * 12 for 12-bit sample values
+ * Only 8 and 12 are legal data precisions for lossy JPEG according to the
+ * JPEG standard, and the IJG code does not support anything else!
+ * We do not support run-time selection of data precision, sorry.
+ */
+
+#define BITS_IN_JSAMPLE 8 /* use 8 or 12 */
+
+
+/*
+ * Maximum number of components (color channels) allowed in JPEG image.
+ * To meet the letter of the JPEG spec, set this to 255. However, darn
+ * few applications need more than 4 channels (maybe 5 for CMYK + alpha
+ * mask). We recommend 10 as a reasonable compromise; use 4 if you are
+ * really short on memory. (Each allowed component costs a hundred or so
+ * bytes of storage, whether actually used in an image or not.)
+ */
+
+#define MAX_COMPONENTS 10 /* maximum number of image components */
+
+
+/*
+ * Basic data types.
+ * You may need to change these if you have a machine with unusual data
+ * type sizes; for example, "char" not 8 bits, "short" not 16 bits,
+ * or "long" not 32 bits. We don't care whether "int" is 16 or 32 bits,
+ * but it had better be at least 16.
+ */
+
+/* Representation of a single sample (pixel element value).
+ * We frequently allocate large arrays of these, so it's important to keep
+ * them small. But if you have memory to burn and access to char or short
+ * arrays is very slow on your hardware, you might want to change these.
+ */
+
+#if BITS_IN_JSAMPLE == 8
+/* JSAMPLE should be the smallest type that will hold the values 0..255.
+ * You can use a signed char by having GETJSAMPLE mask it with 0xFF.
+ */
+
+#ifdef HAVE_UNSIGNED_CHAR
+
+typedef unsigned char JSAMPLE;
+#define GETJSAMPLE(value) ((int) (value))
+
+#else /* not HAVE_UNSIGNED_CHAR */
+
+typedef char JSAMPLE;
+#ifdef CHAR_IS_UNSIGNED
+#define GETJSAMPLE(value) ((int) (value))
+#else
+#define GETJSAMPLE(value) ((int) (value) & 0xFF)
+#endif /* CHAR_IS_UNSIGNED */
+
+#endif /* HAVE_UNSIGNED_CHAR */
+
+#define MAXJSAMPLE 255
+#define CENTERJSAMPLE 128
+
+#endif /* BITS_IN_JSAMPLE == 8 */
+
+
+#if BITS_IN_JSAMPLE == 12
+/* JSAMPLE should be the smallest type that will hold the values 0..4095.
+ * On nearly all machines "short" will do nicely.
+ */
+
+typedef short JSAMPLE;
+#define GETJSAMPLE(value) ((int) (value))
+
+#define MAXJSAMPLE 4095
+#define CENTERJSAMPLE 2048
+
+#endif /* BITS_IN_JSAMPLE == 12 */
+
+
+/* Representation of a DCT frequency coefficient.
+ * This should be a signed value of at least 16 bits; "short" is usually OK.
+ * Again, we allocate large arrays of these, but you can change to int
+ * if you have memory to burn and "short" is really slow.
+ */
+
+typedef short JCOEF;
+
+
+/* Compressed datastreams are represented as arrays of JOCTET.
+ * These must be EXACTLY 8 bits wide, at least once they are written to
+ * external storage. Note that when using the stdio data source/destination
+ * managers, this is also the data type passed to fread/fwrite.
+ */
+
+#ifdef HAVE_UNSIGNED_CHAR
+
+typedef unsigned char JOCTET;
+#define GETJOCTET(value) (value)
+
+#else /* not HAVE_UNSIGNED_CHAR */
+
+typedef char JOCTET;
+#ifdef CHAR_IS_UNSIGNED
+#define GETJOCTET(value) (value)
+#else
+#define GETJOCTET(value) ((value) & 0xFF)
+#endif /* CHAR_IS_UNSIGNED */
+
+#endif /* HAVE_UNSIGNED_CHAR */
+
+
+/* These typedefs are used for various table entries and so forth.
+ * They must be at least as wide as specified; but making them too big
+ * won't cost a huge amount of memory, so we don't provide special
+ * extraction code like we did for JSAMPLE. (In other words, these
+ * typedefs live at a different point on the speed/space tradeoff curve.)
+ */
+
+#if _FX_OS_ != _FX_VXWORKS_
+
+/* UINT8 must hold at least the values 0..255. */
+
+#ifdef HAVE_UNSIGNED_CHAR
+typedef unsigned char UINT8;
+#else /* not HAVE_UNSIGNED_CHAR */
+#ifdef CHAR_IS_UNSIGNED
+typedef char UINT8;
+#else /* not CHAR_IS_UNSIGNED */
+typedef short UINT8;
+#endif /* CHAR_IS_UNSIGNED */
+#endif /* HAVE_UNSIGNED_CHAR */
+
+
+/* UINT16 must hold at least the values 0..65535. */
+
+#ifdef HAVE_UNSIGNED_SHORT
+typedef unsigned short UINT16;
+#else /* not HAVE_UNSIGNED_SHORT */
+typedef unsigned int UINT16;
+#endif /* HAVE_UNSIGNED_SHORT */
+
+/* INT16 must hold at least the values -32768..32767. */
+
+#ifndef XMD_H /* X11/xmd.h correctly defines INT16 */
+typedef short INT16;
+#endif
+
+/* INT32 must hold at least signed 32-bit values. */
+
+#ifndef XMD_H /* X11/xmd.h correctly defines INT32 */
+typedef int INT32;
+#endif
+
+#endif
+
+/* Datatype used for image dimensions. The JPEG standard only supports
+ * images up to 64K*64K due to 16-bit fields in SOF markers. Therefore
+ * "unsigned int" is sufficient on all machines. However, if you need to
+ * handle larger images and you don't mind deviating from the spec, you
+ * can change this datatype.
+ */
+
+typedef unsigned int JDIMENSION;
+
+#define JPEG_MAX_DIMENSION 65500L /* a tad under 64K to prevent overflows */
+
+
+/* These macros are used in all function definitions and extern declarations.
+ * You could modify them if you need to change function linkage conventions;
+ * in particular, you'll need to do that to make the library a Windows DLL.
+ * Another application is to make all functions global for use with debuggers
+ * or code profilers that require it.
+ */
+
+/* a function called through method pointers: */
+#define METHODDEF(type) static type
+/* a function used only in its module: */
+#define LOCAL(type) static type
+/* a function referenced thru EXTERNs: */
+#define GLOBAL(type) type
+
+#ifdef _FX_MANAGED_CODE_
+#define EXTERN(type) extern "C" type
+#else
+/* a reference to a GLOBAL function: */
+#define EXTERN(type) extern type
+#endif
+
+
+/* This macro is used to declare a "method", that is, a function pointer.
+ * We want to supply prototype parameters if the compiler can cope.
+ * Note that the arglist parameter must be parenthesized!
+ * Again, you can customize this if you need special linkage keywords.
+ */
+
+#ifdef HAVE_PROTOTYPES
+#define JMETHOD(type,methodname,arglist) type (*methodname) arglist
+#else
+#define JMETHOD(type,methodname,arglist) type (*methodname) ()
+#endif
+
+
+/* Here is the pseudo-keyword for declaring pointers that must be "far"
+ * on 80x86 machines. Most of the specialized coding for 80x86 is handled
+ * by just saying "FAR *" where such a pointer is needed. In a few places
+ * explicit coding is needed; see uses of the NEED_FAR_POINTERS symbol.
+ */
+
+#ifdef NEED_FAR_POINTERS
+#define FAR far
+#else
+//#define FAR
+#endif
+
+
+/*
+ * On a few systems, type boolean and/or its values FALSE, TRUE may appear
+ * in standard header files. Or you may have conflicts with application-
+ * specific header files that you want to include together with these files.
+ * Defining HAVE_BOOLEAN before including jpeglib.h should make it work.
+ */
+
+#ifndef HAVE_BOOLEAN
+typedef int boolean;
+#endif
+#ifndef FALSE /* in case these macros already exist */
+#define FALSE 0 /* values of boolean */
+#endif
+#ifndef TRUE
+#define TRUE 1
+#endif
+
+
+/*
+ * The remaining options affect code selection within the JPEG library,
+ * but they don't need to be visible to most applications using the library.
+ * To minimize application namespace pollution, the symbols won't be
+ * defined unless JPEG_INTERNALS or JPEG_INTERNAL_OPTIONS has been defined.
+ */
+
+#ifdef JPEG_INTERNALS
+#define JPEG_INTERNAL_OPTIONS
+#endif
+
+#ifdef JPEG_INTERNAL_OPTIONS
+
+
+/*
+ * These defines indicate whether to include various optional functions.
+ * Undefining some of these symbols will produce a smaller but less capable
+ * library. Note that you can leave certain source files out of the
+ * compilation/linking process if you've #undef'd the corresponding symbols.
+ * (You may HAVE to do that if your compiler doesn't like null source files.)
+ */
+
+/* Arithmetic coding is unsupported for legal reasons. Complaints to IBM. */
+
+/* Capability options common to encoder and decoder: */
+
+#define DCT_ISLOW_SUPPORTED /* slow but accurate integer algorithm */
+#define DCT_IFAST_SUPPORTED /* faster, less accurate integer method */
+#undef DCT_FLOAT_SUPPORTED /* floating-point: accurate, fast on fast HW */
+
+/* Encoder capability options: */
+
+#undef C_ARITH_CODING_SUPPORTED /* Arithmetic coding back end? */
+#define C_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */
+#define C_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/
+#define ENTROPY_OPT_SUPPORTED /* Optimization of entropy coding parms? */
+/* Note: if you selected 12-bit data precision, it is dangerous to turn off
+ * ENTROPY_OPT_SUPPORTED. The standard Huffman tables are only good for 8-bit
+ * precision, so jchuff.c normally uses entropy optimization to compute
+ * usable tables for higher precision. If you don't want to do optimization,
+ * you'll have to supply different default Huffman tables.
+ * The exact same statements apply for progressive JPEG: the default tables
+ * don't work for progressive mode. (This may get fixed, however.)
+ */
+#define INPUT_SMOOTHING_SUPPORTED /* Input image smoothing option? */
+
+/* Decoder capability options: */
+
+#undef D_ARITH_CODING_SUPPORTED /* Arithmetic coding back end? */
+#define D_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */
+#define D_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/
+#define SAVE_MARKERS_SUPPORTED /* jpeg_save_markers() needed? */
+#define BLOCK_SMOOTHING_SUPPORTED /* Block smoothing? (Progressive only) */
+#define IDCT_SCALING_SUPPORTED /* Output rescaling via IDCT? */
+#undef UPSAMPLE_SCALING_SUPPORTED /* Output rescaling at upsample stage? */
+#define UPSAMPLE_MERGING_SUPPORTED /* Fast path for sloppy upsampling? */
+#undef QUANT_1PASS_SUPPORTED /* 1-pass color quantization? */
+#undef QUANT_2PASS_SUPPORTED /* 2-pass color quantization? */
+
+/* more capability options later, no doubt */
+
+
+/*
+ * Ordering of RGB data in scanlines passed to or from the application.
+ * If your application wants to deal with data in the order B,G,R, just
+ * change these macros. You can also deal with formats such as R,G,B,X
+ * (one extra byte per pixel) by changing RGB_PIXELSIZE. Note that changing
+ * the offsets will also change the order in which colormap data is organized.
+ * RESTRICTIONS:
+ * 1. The sample applications cjpeg,djpeg do NOT support modified RGB formats.
+ * 2. These macros only affect RGB<=>YCbCr color conversion, so they are not
+ * useful if you are using JPEG color spaces other than YCbCr or grayscale.
+ * 3. The color quantizer modules will not behave desirably if RGB_PIXELSIZE
+ * is not 3 (they don't understand about dummy color components!). So you
+ * can't use color quantization if you change that value.
+ */
+
+#define RGB_RED 0 /* Offset of Red in an RGB scanline element */
+#define RGB_GREEN 1 /* Offset of Green */
+#define RGB_BLUE 2 /* Offset of Blue */
+#define RGB_PIXELSIZE 3 /* JSAMPLEs per RGB scanline element */
+
+
+/* Definitions for speed-related optimizations. */
+
+
+/* If your compiler supports inline functions, define INLINE
+ * as the inline keyword; otherwise define it as empty.
+ */
+
+#ifndef INLINE
+#ifdef __GNUC__ /* for instance, GNU C knows about inline */
+#define INLINE __inline__
+#endif
+#ifndef INLINE
+#define INLINE /* default is to define it as empty */
+#endif
+#endif
+
+
+/* On some machines (notably 68000 series) "int" is 32 bits, but multiplying
+ * two 16-bit shorts is faster than multiplying two ints. Define MULTIPLIER
+ * as short on such a machine. MULTIPLIER must be at least 16 bits wide.
+ */
+
+#ifndef MULTIPLIER
+#define MULTIPLIER int /* type for fastest integer multiply */
+#endif
+
+
+/* FAST_FLOAT should be either float or double, whichever is done faster
+ * by your compiler. (Note that this type is only used in the floating point
+ * DCT routines, so it only matters if you've defined DCT_FLOAT_SUPPORTED.)
+ * Typically, float is faster in ANSI C compilers, while double is faster in
+ * pre-ANSI compilers (because they insist on converting to double anyway).
+ * The code below therefore chooses float if we have ANSI-style prototypes.
+ */
+
+#ifndef FAST_FLOAT
+#ifdef HAVE_PROTOTYPES
+#define FAST_FLOAT float
+#else
+#define FAST_FLOAT double
+#endif
+#endif
+
+#endif /* JPEG_INTERNAL_OPTIONS */
diff --git a/core/src/fxcodec/libjpeg/jpegint.h b/core/src/fxcodec/libjpeg/jpegint.h
index 685a3610b2..95b00d405c 100644
--- a/core/src/fxcodec/libjpeg/jpegint.h
+++ b/core/src/fxcodec/libjpeg/jpegint.h
@@ -1,392 +1,392 @@
-/*
- * jpegint.h
- *
- * Copyright (C) 1991-1997, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- * For conditions of distribution and use, see the accompanying README file.
- *
- * This file provides common declarations for the various JPEG modules.
- * These declarations are considered internal to the JPEG library; most
- * applications using the library shouldn't need to include this file.
- */
-
-
-/* Declarations for both compression & decompression */
-
-typedef enum { /* Operating modes for buffer controllers */
- JBUF_PASS_THRU, /* Plain stripwise operation */
- /* Remaining modes require a full-image buffer to have been created */
- JBUF_SAVE_SOURCE, /* Run source subobject only, save output */
- JBUF_CRANK_DEST, /* Run dest subobject only, using saved data */
- JBUF_SAVE_AND_PASS /* Run both subobjects, save output */
-} J_BUF_MODE;
-
-/* Values of global_state field (jdapi.c has some dependencies on ordering!) */
-#define CSTATE_START 100 /* after create_compress */
-#define CSTATE_SCANNING 101 /* start_compress done, write_scanlines OK */
-#define CSTATE_RAW_OK 102 /* start_compress done, write_raw_data OK */
-#define CSTATE_WRCOEFS 103 /* jpeg_write_coefficients done */
-#define DSTATE_START 200 /* after create_decompress */
-#define DSTATE_INHEADER 201 /* reading header markers, no SOS yet */
-#define DSTATE_READY 202 /* found SOS, ready for start_decompress */
-#define DSTATE_PRELOAD 203 /* reading multiscan file in start_decompress*/
-#define DSTATE_PRESCAN 204 /* performing dummy pass for 2-pass quant */
-#define DSTATE_SCANNING 205 /* start_decompress done, read_scanlines OK */
-#define DSTATE_RAW_OK 206 /* start_decompress done, read_raw_data OK */
-#define DSTATE_BUFIMAGE 207 /* expecting jpeg_start_output */
-#define DSTATE_BUFPOST 208 /* looking for SOS/EOI in jpeg_finish_output */
-#define DSTATE_RDCOEFS 209 /* reading file in jpeg_read_coefficients */
-#define DSTATE_STOPPING 210 /* looking for EOI in jpeg_finish_decompress */
-
-
-/* Declarations for compression modules */
-
-/* Master control module */
-struct jpeg_comp_master {
- JMETHOD(void, prepare_for_pass, (j_compress_ptr cinfo));
- JMETHOD(void, pass_startup, (j_compress_ptr cinfo));
- JMETHOD(void, finish_pass, (j_compress_ptr cinfo));
-
- /* State variables made visible to other modules */
- boolean call_pass_startup; /* True if pass_startup must be called */
- boolean is_last_pass; /* True during last pass */
-};
-
-/* Main buffer control (downsampled-data buffer) */
-struct jpeg_c_main_controller {
- JMETHOD(void, start_pass, (j_compress_ptr cinfo, J_BUF_MODE pass_mode));
- JMETHOD(void, process_data, (j_compress_ptr cinfo,
- JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,
- JDIMENSION in_rows_avail));
-};
-
-/* Compression preprocessing (downsampling input buffer control) */
-struct jpeg_c_prep_controller {
- JMETHOD(void, start_pass, (j_compress_ptr cinfo, J_BUF_MODE pass_mode));
- JMETHOD(void, pre_process_data, (j_compress_ptr cinfo,
- JSAMPARRAY input_buf,
- JDIMENSION *in_row_ctr,
- JDIMENSION in_rows_avail,
- JSAMPIMAGE output_buf,
- JDIMENSION *out_row_group_ctr,
- JDIMENSION out_row_groups_avail));
-};
-
-/* Coefficient buffer control */
-struct jpeg_c_coef_controller {
- JMETHOD(void, start_pass, (j_compress_ptr cinfo, J_BUF_MODE pass_mode));
- JMETHOD(boolean, compress_data, (j_compress_ptr cinfo,
- JSAMPIMAGE input_buf));
-};
-
-/* Colorspace conversion */
-struct jpeg_color_converter {
- JMETHOD(void, start_pass, (j_compress_ptr cinfo));
- JMETHOD(void, color_convert, (j_compress_ptr cinfo,
- JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
- JDIMENSION output_row, int num_rows));
-};
-
-/* Downsampling */
-struct jpeg_downsampler {
- JMETHOD(void, start_pass, (j_compress_ptr cinfo));
- JMETHOD(void, downsample, (j_compress_ptr cinfo,
- JSAMPIMAGE input_buf, JDIMENSION in_row_index,
- JSAMPIMAGE output_buf,
- JDIMENSION out_row_group_index));
-
- boolean need_context_rows; /* TRUE if need rows above & below */
-};
-
-/* Forward DCT (also controls coefficient quantization) */
-struct jpeg_forward_dct {
- JMETHOD(void, start_pass, (j_compress_ptr cinfo));
- /* perhaps this should be an array??? */
- JMETHOD(void, forward_DCT, (j_compress_ptr cinfo,
- jpeg_component_info * compptr,
- JSAMPARRAY sample_data, JBLOCKROW coef_blocks,
- JDIMENSION start_row, JDIMENSION start_col,
- JDIMENSION num_blocks));
-};
-
-/* Entropy encoding */
-struct jpeg_entropy_encoder {
- JMETHOD(void, start_pass, (j_compress_ptr cinfo, boolean gather_statistics));
- JMETHOD(boolean, encode_mcu, (j_compress_ptr cinfo, JBLOCKROW *MCU_data));
- JMETHOD(void, finish_pass, (j_compress_ptr cinfo));
-};
-
-/* Marker writing */
-struct jpeg_marker_writer {
- JMETHOD(void, write_file_header, (j_compress_ptr cinfo));
- JMETHOD(void, write_frame_header, (j_compress_ptr cinfo));
- JMETHOD(void, write_scan_header, (j_compress_ptr cinfo));
- JMETHOD(void, write_file_trailer, (j_compress_ptr cinfo));
- JMETHOD(void, write_tables_only, (j_compress_ptr cinfo));
- /* These routines are exported to allow insertion of extra markers */
- /* Probably only COM and APPn markers should be written this way */
- JMETHOD(void, write_marker_header, (j_compress_ptr cinfo, int marker,
- unsigned int datalen));
- JMETHOD(void, write_marker_byte, (j_compress_ptr cinfo, int val));
-};
-
-
-/* Declarations for decompression modules */
-
-/* Master control module */
-struct jpeg_decomp_master {
- JMETHOD(void, prepare_for_output_pass, (j_decompress_ptr cinfo));
- JMETHOD(void, finish_output_pass, (j_decompress_ptr cinfo));
-
- /* State variables made visible to other modules */
- boolean is_dummy_pass; /* True during 1st pass for 2-pass quant */
-};
-
-/* Input control module */
-struct jpeg_input_controller {
- JMETHOD(int, consume_input, (j_decompress_ptr cinfo));
- JMETHOD(void, reset_input_controller, (j_decompress_ptr cinfo));
- JMETHOD(void, start_input_pass, (j_decompress_ptr cinfo));
- JMETHOD(void, finish_input_pass, (j_decompress_ptr cinfo));
-
- /* State variables made visible to other modules */
- boolean has_multiple_scans; /* True if file has multiple scans */
- boolean eoi_reached; /* True when EOI has been consumed */
-};
-
-/* Main buffer control (downsampled-data buffer) */
-struct jpeg_d_main_controller {
- JMETHOD(void, start_pass, (j_decompress_ptr cinfo, J_BUF_MODE pass_mode));
- JMETHOD(void, process_data, (j_decompress_ptr cinfo,
- JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
- JDIMENSION out_rows_avail));
-};
-
-/* Coefficient buffer control */
-struct jpeg_d_coef_controller {
- JMETHOD(void, start_input_pass, (j_decompress_ptr cinfo));
- JMETHOD(int, consume_data, (j_decompress_ptr cinfo));
- JMETHOD(void, start_output_pass, (j_decompress_ptr cinfo));
- JMETHOD(int, decompress_data, (j_decompress_ptr cinfo,
- JSAMPIMAGE output_buf));
- /* Pointer to array of coefficient virtual arrays, or NULL if none */
- jvirt_barray_ptr *coef_arrays;
-};
-
-/* Decompression postprocessing (color quantization buffer control) */
-struct jpeg_d_post_controller {
- JMETHOD(void, start_pass, (j_decompress_ptr cinfo, J_BUF_MODE pass_mode));
- JMETHOD(void, post_process_data, (j_decompress_ptr cinfo,
- JSAMPIMAGE input_buf,
- JDIMENSION *in_row_group_ctr,
- JDIMENSION in_row_groups_avail,
- JSAMPARRAY output_buf,
- JDIMENSION *out_row_ctr,
- JDIMENSION out_rows_avail));
-};
-
-/* Marker reading & parsing */
-struct jpeg_marker_reader {
- JMETHOD(void, reset_marker_reader, (j_decompress_ptr cinfo));
- /* Read markers until SOS or EOI.
- * Returns same codes as are defined for jpeg_consume_input:
- * JPEG_SUSPENDED, JPEG_REACHED_SOS, or JPEG_REACHED_EOI.
- */
- JMETHOD(int, read_markers, (j_decompress_ptr cinfo));
- /* Read a restart marker --- exported for use by entropy decoder only */
- jpeg_marker_parser_method read_restart_marker;
-
- /* State of marker reader --- nominally internal, but applications
- * supplying COM or APPn handlers might like to know the state.
- */
- boolean saw_SOI; /* found SOI? */
- boolean saw_SOF; /* found SOF? */
- int next_restart_num; /* next restart number expected (0-7) */
- unsigned int discarded_bytes; /* # of bytes skipped looking for a marker */
-};
-
-/* Entropy decoding */
-struct jpeg_entropy_decoder {
- JMETHOD(void, start_pass, (j_decompress_ptr cinfo));
- JMETHOD(boolean, decode_mcu, (j_decompress_ptr cinfo,
- JBLOCKROW *MCU_data));
-
- /* This is here to share code between baseline and progressive decoders; */
- /* other modules probably should not use it */
- boolean insufficient_data; /* set TRUE after emitting warning */
-};
-
-/* Inverse DCT (also performs dequantization) */
-typedef JMETHOD(void, inverse_DCT_method_ptr,
- (j_decompress_ptr cinfo, jpeg_component_info * compptr,
- JCOEFPTR coef_block,
- JSAMPARRAY output_buf, JDIMENSION output_col));
-
-struct jpeg_inverse_dct {
- JMETHOD(void, start_pass, (j_decompress_ptr cinfo));
- /* It is useful to allow each component to have a separate IDCT method. */
- inverse_DCT_method_ptr inverse_DCT[MAX_COMPONENTS];
-};
-
-/* Upsampling (note that upsampler must also call color converter) */
-struct jpeg_upsampler {
- JMETHOD(void, start_pass, (j_decompress_ptr cinfo));
- JMETHOD(void, upsample, (j_decompress_ptr cinfo,
- JSAMPIMAGE input_buf,
- JDIMENSION *in_row_group_ctr,
- JDIMENSION in_row_groups_avail,
- JSAMPARRAY output_buf,
- JDIMENSION *out_row_ctr,
- JDIMENSION out_rows_avail));
-
- boolean need_context_rows; /* TRUE if need rows above & below */
-};
-
-/* Colorspace conversion */
-struct jpeg_color_deconverter {
- JMETHOD(void, start_pass, (j_decompress_ptr cinfo));
- JMETHOD(void, color_convert, (j_decompress_ptr cinfo,
- JSAMPIMAGE input_buf, JDIMENSION input_row,
- JSAMPARRAY output_buf, int num_rows));
-};
-
-/* Color quantization or color precision reduction */
-struct jpeg_color_quantizer {
- JMETHOD(void, start_pass, (j_decompress_ptr cinfo, boolean is_pre_scan));
- JMETHOD(void, color_quantize, (j_decompress_ptr cinfo,
- JSAMPARRAY input_buf, JSAMPARRAY output_buf,
- int num_rows));
- JMETHOD(void, finish_pass, (j_decompress_ptr cinfo));
- JMETHOD(void, new_color_map, (j_decompress_ptr cinfo));
-};
-
-
-/* Miscellaneous useful macros */
-
-#undef MAX
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-#undef MIN
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-
-
-/* We assume that right shift corresponds to signed division by 2 with
- * rounding towards minus infinity. This is correct for typical "arithmetic
- * shift" instructions that shift in copies of the sign bit. But some
- * C compilers implement >> with an unsigned shift. For these machines you
- * must define RIGHT_SHIFT_IS_UNSIGNED.
- * RIGHT_SHIFT provides a proper signed right shift of an INT32 quantity.
- * It is only applied with constant shift counts. SHIFT_TEMPS must be
- * included in the variables of any routine using RIGHT_SHIFT.
- */
-
-#ifdef RIGHT_SHIFT_IS_UNSIGNED
-#define SHIFT_TEMPS INT32 shift_temp;
-#define RIGHT_SHIFT(x,shft) \
- ((shift_temp = (x)) < 0 ? \
- (shift_temp >> (shft)) | ((~((INT32) 0)) << (32-(shft))) : \
- (shift_temp >> (shft)))
-#else
-#define SHIFT_TEMPS
-#define RIGHT_SHIFT(x,shft) ((x) >> (shft))
-#endif
-
-
-/* Short forms of external names for systems with brain-damaged linkers. */
-
-#ifdef NEED_SHORT_EXTERNAL_NAMES
-#define jinit_compress_master jICompress
-#define jinit_c_master_control jICMaster
-#define jinit_c_main_controller jICMainC
-#define jinit_c_prep_controller jICPrepC
-#define jinit_c_coef_controller jICCoefC
-#define jinit_color_converter jICColor
-#define jinit_downsampler jIDownsampler
-#define jinit_forward_dct jIFDCT
-#define jinit_huff_encoder jIHEncoder
-#define jinit_phuff_encoder jIPHEncoder
-#define jinit_marker_writer jIMWriter
-#define jinit_master_decompress jIDMaster
-#define jinit_d_main_controller jIDMainC
-#define jinit_d_coef_controller jIDCoefC
-#define jinit_d_post_controller jIDPostC
-#define jinit_input_controller jIInCtlr
-#define jinit_marker_reader jIMReader
-#define jinit_huff_decoder jIHDecoder
-#define jinit_phuff_decoder jIPHDecoder
-#define jinit_inverse_dct jIIDCT
-#define jinit_upsampler jIUpsampler
-#define jinit_color_deconverter jIDColor
-#define jinit_1pass_quantizer jI1Quant
-#define jinit_2pass_quantizer jI2Quant
-#define jinit_merged_upsampler jIMUpsampler
-#define jinit_memory_mgr jIMemMgr
-#define jdiv_round_up jDivRound
-#define jround_up jRound
-#define jcopy_sample_rows jCopySamples
-#define jcopy_block_row jCopyBlocks
-#define jzero_far jZeroFar
-#define jpeg_zigzag_order jZIGTable
-#define jpeg_natural_order jZAGTable
-#endif /* NEED_SHORT_EXTERNAL_NAMES */
-
-
-/* Compression module initialization routines */
-EXTERN(void) jinit_compress_master JPP((j_compress_ptr cinfo));
-EXTERN(void) jinit_c_master_control JPP((j_compress_ptr cinfo,
- boolean transcode_only));
-EXTERN(void) jinit_c_main_controller JPP((j_compress_ptr cinfo,
- boolean need_full_buffer));
-EXTERN(void) jinit_c_prep_controller JPP((j_compress_ptr cinfo,
- boolean need_full_buffer));
-EXTERN(void) jinit_c_coef_controller JPP((j_compress_ptr cinfo,
- boolean need_full_buffer));
-EXTERN(void) jinit_color_converter JPP((j_compress_ptr cinfo));
-EXTERN(void) jinit_downsampler JPP((j_compress_ptr cinfo));
-EXTERN(void) jinit_forward_dct JPP((j_compress_ptr cinfo));
-EXTERN(void) jinit_huff_encoder JPP((j_compress_ptr cinfo));
-EXTERN(void) jinit_phuff_encoder JPP((j_compress_ptr cinfo));
-EXTERN(void) jinit_marker_writer JPP((j_compress_ptr cinfo));
-/* Decompression module initialization routines */
-EXTERN(void) jinit_master_decompress JPP((j_decompress_ptr cinfo));
-EXTERN(void) jinit_d_main_controller JPP((j_decompress_ptr cinfo,
- boolean need_full_buffer));
-EXTERN(void) jinit_d_coef_controller JPP((j_decompress_ptr cinfo,
- boolean need_full_buffer));
-EXTERN(void) jinit_d_post_controller JPP((j_decompress_ptr cinfo,
- boolean need_full_buffer));
-EXTERN(void) jinit_input_controller JPP((j_decompress_ptr cinfo));
-EXTERN(void) jinit_marker_reader JPP((j_decompress_ptr cinfo));
-EXTERN(void) jinit_huff_decoder JPP((j_decompress_ptr cinfo));
-EXTERN(void) jinit_phuff_decoder JPP((j_decompress_ptr cinfo));
-EXTERN(void) jinit_inverse_dct JPP((j_decompress_ptr cinfo));
-EXTERN(void) jinit_upsampler JPP((j_decompress_ptr cinfo));
-EXTERN(void) jinit_color_deconverter JPP((j_decompress_ptr cinfo));
-EXTERN(void) jinit_1pass_quantizer JPP((j_decompress_ptr cinfo));
-EXTERN(void) jinit_2pass_quantizer JPP((j_decompress_ptr cinfo));
-EXTERN(void) jinit_merged_upsampler JPP((j_decompress_ptr cinfo));
-/* Memory manager initialization */
-EXTERN(void) jinit_memory_mgr JPP((j_common_ptr cinfo));
-
-/* Utility routines in jutils.c */
-EXTERN(long) jdiv_round_up JPP((long a, long b));
-EXTERN(long) jround_up JPP((long a, long b));
-EXTERN(void) jcopy_sample_rows JPP((JSAMPARRAY input_array, int source_row,
- JSAMPARRAY output_array, int dest_row,
- int num_rows, JDIMENSION num_cols));
-EXTERN(void) jcopy_block_row JPP((JBLOCKROW input_row, JBLOCKROW output_row,
- JDIMENSION num_blocks));
-EXTERN(void) jzero_far JPP((void FAR * target, size_t bytestozero));
-/* Constant tables in jutils.c */
-#if 0 /* This table is not actually needed in v6a */
-extern const int jpeg_zigzag_order[]; /* natural coef order to zigzag order */
-#endif
-extern const int jpeg_natural_order[]; /* zigzag coef order to natural order */
-
-/* Suppress undefined-structure complaints if necessary. */
-
-#ifdef INCOMPLETE_TYPES_BROKEN
-#ifndef AM_MEMORY_MANAGER /* only jmemmgr.c defines these */
-struct jvirt_sarray_control { long dummy; };
-struct jvirt_barray_control { long dummy; };
-#endif
-#endif /* INCOMPLETE_TYPES_BROKEN */
+/*
+ * jpegint.h
+ *
+ * Copyright (C) 1991-1997, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file provides common declarations for the various JPEG modules.
+ * These declarations are considered internal to the JPEG library; most
+ * applications using the library shouldn't need to include this file.
+ */
+
+
+/* Declarations for both compression & decompression */
+
+typedef enum { /* Operating modes for buffer controllers */
+ JBUF_PASS_THRU, /* Plain stripwise operation */
+ /* Remaining modes require a full-image buffer to have been created */
+ JBUF_SAVE_SOURCE, /* Run source subobject only, save output */
+ JBUF_CRANK_DEST, /* Run dest subobject only, using saved data */
+ JBUF_SAVE_AND_PASS /* Run both subobjects, save output */
+} J_BUF_MODE;
+
+/* Values of global_state field (jdapi.c has some dependencies on ordering!) */
+#define CSTATE_START 100 /* after create_compress */
+#define CSTATE_SCANNING 101 /* start_compress done, write_scanlines OK */
+#define CSTATE_RAW_OK 102 /* start_compress done, write_raw_data OK */
+#define CSTATE_WRCOEFS 103 /* jpeg_write_coefficients done */
+#define DSTATE_START 200 /* after create_decompress */
+#define DSTATE_INHEADER 201 /* reading header markers, no SOS yet */
+#define DSTATE_READY 202 /* found SOS, ready for start_decompress */
+#define DSTATE_PRELOAD 203 /* reading multiscan file in start_decompress*/
+#define DSTATE_PRESCAN 204 /* performing dummy pass for 2-pass quant */
+#define DSTATE_SCANNING 205 /* start_decompress done, read_scanlines OK */
+#define DSTATE_RAW_OK 206 /* start_decompress done, read_raw_data OK */
+#define DSTATE_BUFIMAGE 207 /* expecting jpeg_start_output */
+#define DSTATE_BUFPOST 208 /* looking for SOS/EOI in jpeg_finish_output */
+#define DSTATE_RDCOEFS 209 /* reading file in jpeg_read_coefficients */
+#define DSTATE_STOPPING 210 /* looking for EOI in jpeg_finish_decompress */
+
+
+/* Declarations for compression modules */
+
+/* Master control module */
+struct jpeg_comp_master {
+ JMETHOD(void, prepare_for_pass, (j_compress_ptr cinfo));
+ JMETHOD(void, pass_startup, (j_compress_ptr cinfo));
+ JMETHOD(void, finish_pass, (j_compress_ptr cinfo));
+
+ /* State variables made visible to other modules */
+ boolean call_pass_startup; /* True if pass_startup must be called */
+ boolean is_last_pass; /* True during last pass */
+};
+
+/* Main buffer control (downsampled-data buffer) */
+struct jpeg_c_main_controller {
+ JMETHOD(void, start_pass, (j_compress_ptr cinfo, J_BUF_MODE pass_mode));
+ JMETHOD(void, process_data, (j_compress_ptr cinfo,
+ JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,
+ JDIMENSION in_rows_avail));
+};
+
+/* Compression preprocessing (downsampling input buffer control) */
+struct jpeg_c_prep_controller {
+ JMETHOD(void, start_pass, (j_compress_ptr cinfo, J_BUF_MODE pass_mode));
+ JMETHOD(void, pre_process_data, (j_compress_ptr cinfo,
+ JSAMPARRAY input_buf,
+ JDIMENSION *in_row_ctr,
+ JDIMENSION in_rows_avail,
+ JSAMPIMAGE output_buf,
+ JDIMENSION *out_row_group_ctr,
+ JDIMENSION out_row_groups_avail));
+};
+
+/* Coefficient buffer control */
+struct jpeg_c_coef_controller {
+ JMETHOD(void, start_pass, (j_compress_ptr cinfo, J_BUF_MODE pass_mode));
+ JMETHOD(boolean, compress_data, (j_compress_ptr cinfo,
+ JSAMPIMAGE input_buf));
+};
+
+/* Colorspace conversion */
+struct jpeg_color_converter {
+ JMETHOD(void, start_pass, (j_compress_ptr cinfo));
+ JMETHOD(void, color_convert, (j_compress_ptr cinfo,
+ JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
+ JDIMENSION output_row, int num_rows));
+};
+
+/* Downsampling */
+struct jpeg_downsampler {
+ JMETHOD(void, start_pass, (j_compress_ptr cinfo));
+ JMETHOD(void, downsample, (j_compress_ptr cinfo,
+ JSAMPIMAGE input_buf, JDIMENSION in_row_index,
+ JSAMPIMAGE output_buf,
+ JDIMENSION out_row_group_index));
+
+ boolean need_context_rows; /* TRUE if need rows above & below */
+};
+
+/* Forward DCT (also controls coefficient quantization) */
+struct jpeg_forward_dct {
+ JMETHOD(void, start_pass, (j_compress_ptr cinfo));
+ /* perhaps this should be an array??? */
+ JMETHOD(void, forward_DCT, (j_compress_ptr cinfo,
+ jpeg_component_info * compptr,
+ JSAMPARRAY sample_data, JBLOCKROW coef_blocks,
+ JDIMENSION start_row, JDIMENSION start_col,
+ JDIMENSION num_blocks));
+};
+
+/* Entropy encoding */
+struct jpeg_entropy_encoder {
+ JMETHOD(void, start_pass, (j_compress_ptr cinfo, boolean gather_statistics));
+ JMETHOD(boolean, encode_mcu, (j_compress_ptr cinfo, JBLOCKROW *MCU_data));
+ JMETHOD(void, finish_pass, (j_compress_ptr cinfo));
+};
+
+/* Marker writing */
+struct jpeg_marker_writer {
+ JMETHOD(void, write_file_header, (j_compress_ptr cinfo));
+ JMETHOD(void, write_frame_header, (j_compress_ptr cinfo));
+ JMETHOD(void, write_scan_header, (j_compress_ptr cinfo));
+ JMETHOD(void, write_file_trailer, (j_compress_ptr cinfo));
+ JMETHOD(void, write_tables_only, (j_compress_ptr cinfo));
+ /* These routines are exported to allow insertion of extra markers */
+ /* Probably only COM and APPn markers should be written this way */
+ JMETHOD(void, write_marker_header, (j_compress_ptr cinfo, int marker,
+ unsigned int datalen));
+ JMETHOD(void, write_marker_byte, (j_compress_ptr cinfo, int val));
+};
+
+
+/* Declarations for decompression modules */
+
+/* Master control module */
+struct jpeg_decomp_master {
+ JMETHOD(void, prepare_for_output_pass, (j_decompress_ptr cinfo));
+ JMETHOD(void, finish_output_pass, (j_decompress_ptr cinfo));
+
+ /* State variables made visible to other modules */
+ boolean is_dummy_pass; /* True during 1st pass for 2-pass quant */
+};
+
+/* Input control module */
+struct jpeg_input_controller {
+ JMETHOD(int, consume_input, (j_decompress_ptr cinfo));
+ JMETHOD(void, reset_input_controller, (j_decompress_ptr cinfo));
+ JMETHOD(void, start_input_pass, (j_decompress_ptr cinfo));
+ JMETHOD(void, finish_input_pass, (j_decompress_ptr cinfo));
+
+ /* State variables made visible to other modules */
+ boolean has_multiple_scans; /* True if file has multiple scans */
+ boolean eoi_reached; /* True when EOI has been consumed */
+};
+
+/* Main buffer control (downsampled-data buffer) */
+struct jpeg_d_main_controller {
+ JMETHOD(void, start_pass, (j_decompress_ptr cinfo, J_BUF_MODE pass_mode));
+ JMETHOD(void, process_data, (j_decompress_ptr cinfo,
+ JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
+ JDIMENSION out_rows_avail));
+};
+
+/* Coefficient buffer control */
+struct jpeg_d_coef_controller {
+ JMETHOD(void, start_input_pass, (j_decompress_ptr cinfo));
+ JMETHOD(int, consume_data, (j_decompress_ptr cinfo));
+ JMETHOD(void, start_output_pass, (j_decompress_ptr cinfo));
+ JMETHOD(int, decompress_data, (j_decompress_ptr cinfo,
+ JSAMPIMAGE output_buf));
+ /* Pointer to array of coefficient virtual arrays, or NULL if none */
+ jvirt_barray_ptr *coef_arrays;
+};
+
+/* Decompression postprocessing (color quantization buffer control) */
+struct jpeg_d_post_controller {
+ JMETHOD(void, start_pass, (j_decompress_ptr cinfo, J_BUF_MODE pass_mode));
+ JMETHOD(void, post_process_data, (j_decompress_ptr cinfo,
+ JSAMPIMAGE input_buf,
+ JDIMENSION *in_row_group_ctr,
+ JDIMENSION in_row_groups_avail,
+ JSAMPARRAY output_buf,
+ JDIMENSION *out_row_ctr,
+ JDIMENSION out_rows_avail));
+};
+
+/* Marker reading & parsing */
+struct jpeg_marker_reader {
+ JMETHOD(void, reset_marker_reader, (j_decompress_ptr cinfo));
+ /* Read markers until SOS or EOI.
+ * Returns same codes as are defined for jpeg_consume_input:
+ * JPEG_SUSPENDED, JPEG_REACHED_SOS, or JPEG_REACHED_EOI.
+ */
+ JMETHOD(int, read_markers, (j_decompress_ptr cinfo));
+ /* Read a restart marker --- exported for use by entropy decoder only */
+ jpeg_marker_parser_method read_restart_marker;
+
+ /* State of marker reader --- nominally internal, but applications
+ * supplying COM or APPn handlers might like to know the state.
+ */
+ boolean saw_SOI; /* found SOI? */
+ boolean saw_SOF; /* found SOF? */
+ int next_restart_num; /* next restart number expected (0-7) */
+ unsigned int discarded_bytes; /* # of bytes skipped looking for a marker */
+};
+
+/* Entropy decoding */
+struct jpeg_entropy_decoder {
+ JMETHOD(void, start_pass, (j_decompress_ptr cinfo));
+ JMETHOD(boolean, decode_mcu, (j_decompress_ptr cinfo,
+ JBLOCKROW *MCU_data));
+
+ /* This is here to share code between baseline and progressive decoders; */
+ /* other modules probably should not use it */
+ boolean insufficient_data; /* set TRUE after emitting warning */
+};
+
+/* Inverse DCT (also performs dequantization) */
+typedef JMETHOD(void, inverse_DCT_method_ptr,
+ (j_decompress_ptr cinfo, jpeg_component_info * compptr,
+ JCOEFPTR coef_block,
+ JSAMPARRAY output_buf, JDIMENSION output_col));
+
+struct jpeg_inverse_dct {
+ JMETHOD(void, start_pass, (j_decompress_ptr cinfo));
+ /* It is useful to allow each component to have a separate IDCT method. */
+ inverse_DCT_method_ptr inverse_DCT[MAX_COMPONENTS];
+};
+
+/* Upsampling (note that upsampler must also call color converter) */
+struct jpeg_upsampler {
+ JMETHOD(void, start_pass, (j_decompress_ptr cinfo));
+ JMETHOD(void, upsample, (j_decompress_ptr cinfo,
+ JSAMPIMAGE input_buf,
+ JDIMENSION *in_row_group_ctr,
+ JDIMENSION in_row_groups_avail,
+ JSAMPARRAY output_buf,
+ JDIMENSION *out_row_ctr,
+ JDIMENSION out_rows_avail));
+
+ boolean need_context_rows; /* TRUE if need rows above & below */
+};
+
+/* Colorspace conversion */
+struct jpeg_color_deconverter {
+ JMETHOD(void, start_pass, (j_decompress_ptr cinfo));
+ JMETHOD(void, color_convert, (j_decompress_ptr cinfo,
+ JSAMPIMAGE input_buf, JDIMENSION input_row,
+ JSAMPARRAY output_buf, int num_rows));
+};
+
+/* Color quantization or color precision reduction */
+struct jpeg_color_quantizer {
+ JMETHOD(void, start_pass, (j_decompress_ptr cinfo, boolean is_pre_scan));
+ JMETHOD(void, color_quantize, (j_decompress_ptr cinfo,
+ JSAMPARRAY input_buf, JSAMPARRAY output_buf,
+ int num_rows));
+ JMETHOD(void, finish_pass, (j_decompress_ptr cinfo));
+ JMETHOD(void, new_color_map, (j_decompress_ptr cinfo));
+};
+
+
+/* Miscellaneous useful macros */
+
+#undef MAX
+#define MAX(a,b) ((a) > (b) ? (a) : (b))
+#undef MIN
+#define MIN(a,b) ((a) < (b) ? (a) : (b))
+
+
+/* We assume that right shift corresponds to signed division by 2 with
+ * rounding towards minus infinity. This is correct for typical "arithmetic
+ * shift" instructions that shift in copies of the sign bit. But some
+ * C compilers implement >> with an unsigned shift. For these machines you
+ * must define RIGHT_SHIFT_IS_UNSIGNED.
+ * RIGHT_SHIFT provides a proper signed right shift of an INT32 quantity.
+ * It is only applied with constant shift counts. SHIFT_TEMPS must be
+ * included in the variables of any routine using RIGHT_SHIFT.
+ */
+
+#ifdef RIGHT_SHIFT_IS_UNSIGNED
+#define SHIFT_TEMPS INT32 shift_temp;
+#define RIGHT_SHIFT(x,shft) \
+ ((shift_temp = (x)) < 0 ? \
+ (shift_temp >> (shft)) | ((~((INT32) 0)) << (32-(shft))) : \
+ (shift_temp >> (shft)))
+#else
+#define SHIFT_TEMPS
+#define RIGHT_SHIFT(x,shft) ((x) >> (shft))
+#endif
+
+
+/* Short forms of external names for systems with brain-damaged linkers. */
+
+#ifdef NEED_SHORT_EXTERNAL_NAMES
+#define jinit_compress_master jICompress
+#define jinit_c_master_control jICMaster
+#define jinit_c_main_controller jICMainC
+#define jinit_c_prep_controller jICPrepC
+#define jinit_c_coef_controller jICCoefC
+#define jinit_color_converter jICColor
+#define jinit_downsampler jIDownsampler
+#define jinit_forward_dct jIFDCT
+#define jinit_huff_encoder jIHEncoder
+#define jinit_phuff_encoder jIPHEncoder
+#define jinit_marker_writer jIMWriter
+#define jinit_master_decompress jIDMaster
+#define jinit_d_main_controller jIDMainC
+#define jinit_d_coef_controller jIDCoefC
+#define jinit_d_post_controller jIDPostC
+#define jinit_input_controller jIInCtlr
+#define jinit_marker_reader jIMReader
+#define jinit_huff_decoder jIHDecoder
+#define jinit_phuff_decoder jIPHDecoder
+#define jinit_inverse_dct jIIDCT
+#define jinit_upsampler jIUpsampler
+#define jinit_color_deconverter jIDColor
+#define jinit_1pass_quantizer jI1Quant
+#define jinit_2pass_quantizer jI2Quant
+#define jinit_merged_upsampler jIMUpsampler
+#define jinit_memory_mgr jIMemMgr
+#define jdiv_round_up jDivRound
+#define jround_up jRound
+#define jcopy_sample_rows jCopySamples
+#define jcopy_block_row jCopyBlocks
+#define jzero_far jZeroFar
+#define jpeg_zigzag_order jZIGTable
+#define jpeg_natural_order jZAGTable
+#endif /* NEED_SHORT_EXTERNAL_NAMES */
+
+
+/* Compression module initialization routines */
+EXTERN(void) jinit_compress_master JPP((j_compress_ptr cinfo));
+EXTERN(void) jinit_c_master_control JPP((j_compress_ptr cinfo,
+ boolean transcode_only));
+EXTERN(void) jinit_c_main_controller JPP((j_compress_ptr cinfo,
+ boolean need_full_buffer));
+EXTERN(void) jinit_c_prep_controller JPP((j_compress_ptr cinfo,
+ boolean need_full_buffer));
+EXTERN(void) jinit_c_coef_controller JPP((j_compress_ptr cinfo,
+ boolean need_full_buffer));
+EXTERN(void) jinit_color_converter JPP((j_compress_ptr cinfo));
+EXTERN(void) jinit_downsampler JPP((j_compress_ptr cinfo));
+EXTERN(void) jinit_forward_dct JPP((j_compress_ptr cinfo));
+EXTERN(void) jinit_huff_encoder JPP((j_compress_ptr cinfo));
+EXTERN(void) jinit_phuff_encoder JPP((j_compress_ptr cinfo));
+EXTERN(void) jinit_marker_writer JPP((j_compress_ptr cinfo));
+/* Decompression module initialization routines */
+EXTERN(void) jinit_master_decompress JPP((j_decompress_ptr cinfo));
+EXTERN(void) jinit_d_main_controller JPP((j_decompress_ptr cinfo,
+ boolean need_full_buffer));
+EXTERN(void) jinit_d_coef_controller JPP((j_decompress_ptr cinfo,
+ boolean need_full_buffer));
+EXTERN(void) jinit_d_post_controller JPP((j_decompress_ptr cinfo,
+ boolean need_full_buffer));
+EXTERN(void) jinit_input_controller JPP((j_decompress_ptr cinfo));
+EXTERN(void) jinit_marker_reader JPP((j_decompress_ptr cinfo));
+EXTERN(void) jinit_huff_decoder JPP((j_decompress_ptr cinfo));
+EXTERN(void) jinit_phuff_decoder JPP((j_decompress_ptr cinfo));
+EXTERN(void) jinit_inverse_dct JPP((j_decompress_ptr cinfo));
+EXTERN(void) jinit_upsampler JPP((j_decompress_ptr cinfo));
+EXTERN(void) jinit_color_deconverter JPP((j_decompress_ptr cinfo));
+EXTERN(void) jinit_1pass_quantizer JPP((j_decompress_ptr cinfo));
+EXTERN(void) jinit_2pass_quantizer JPP((j_decompress_ptr cinfo));
+EXTERN(void) jinit_merged_upsampler JPP((j_decompress_ptr cinfo));
+/* Memory manager initialization */
+EXTERN(void) jinit_memory_mgr JPP((j_common_ptr cinfo));
+
+/* Utility routines in jutils.c */
+EXTERN(long) jdiv_round_up JPP((long a, long b));
+EXTERN(long) jround_up JPP((long a, long b));
+EXTERN(void) jcopy_sample_rows JPP((JSAMPARRAY input_array, int source_row,
+ JSAMPARRAY output_array, int dest_row,
+ int num_rows, JDIMENSION num_cols));
+EXTERN(void) jcopy_block_row JPP((JBLOCKROW input_row, JBLOCKROW output_row,
+ JDIMENSION num_blocks));
+EXTERN(void) jzero_far JPP((void FAR * target, size_t bytestozero));
+/* Constant tables in jutils.c */
+#if 0 /* This table is not actually needed in v6a */
+extern const int jpeg_zigzag_order[]; /* natural coef order to zigzag order */
+#endif
+extern const int jpeg_natural_order[]; /* zigzag coef order to natural order */
+
+/* Suppress undefined-structure complaints if necessary. */
+
+#ifdef INCOMPLETE_TYPES_BROKEN
+#ifndef AM_MEMORY_MANAGER /* only jmemmgr.c defines these */
+struct jvirt_sarray_control { long dummy; };
+struct jvirt_barray_control { long dummy; };
+#endif
+#endif /* INCOMPLETE_TYPES_BROKEN */
diff --git a/core/src/fxcodec/libjpeg/jpeglib.h b/core/src/fxcodec/libjpeg/jpeglib.h
index ac2aff90fd..7de5ab726e 100644
--- a/core/src/fxcodec/libjpeg/jpeglib.h
+++ b/core/src/fxcodec/libjpeg/jpeglib.h
@@ -1,1165 +1,1165 @@
-/*
- * jpeglib.h
- *
- * Copyright (C) 1991-1998, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- * For conditions of distribution and use, see the accompanying README file.
- *
- * This file defines the application interface for the JPEG library.
- * Most applications using the library need only include this file,
- * and perhaps jerror.h if they want to know the exact error codes.
- */
-
-#ifndef JPEGLIB_H
-#define JPEGLIB_H
-
-#define FOXIT_PREFIX(origName) FPDFAPIJPEG_##origName
-
-#define jcopy_block_row FOXIT_PREFIX(jcopy_block_row)
-#define jcopy_sample_rows FOXIT_PREFIX(jcopy_sample_rows)
-#define jdiv_round_up FOXIT_PREFIX(jdiv_round_up)
-#define jinit_1pass_quantizer FOXIT_PREFIX(jinit_1pass_quantizer)
-#define jinit_2pass_quantizer FOXIT_PREFIX(jinit_2pass_quantizer)
-#define jinit_color_deconverter FOXIT_PREFIX(jinit_color_deconverter)
-#define jinit_d_coef_controller FOXIT_PREFIX(jinit_d_coef_controller)
-#define jinit_d_main_controller FOXIT_PREFIX(jinit_d_main_controller)
-#define jinit_d_post_controller FOXIT_PREFIX(jinit_d_post_controller)
-#define jinit_huff_decoder FOXIT_PREFIX(jinit_huff_decoder)
-#define jinit_input_controller FOXIT_PREFIX(jinit_input_controller)
-#define jinit_inverse_dct FOXIT_PREFIX(jinit_inverse_dct)
-#define jinit_marker_reader FOXIT_PREFIX(jinit_marker_reader)
-#define jinit_master_decompress FOXIT_PREFIX(jinit_master_decompress)
-#define jinit_memory_mgr FOXIT_PREFIX(jinit_memory_mgr)
-#define jinit_merged_upsampler FOXIT_PREFIX(jinit_merged_upsampler)
-#define jinit_phuff_decoder FOXIT_PREFIX(jinit_phuff_decoder)
-#define jinit_upsampler FOXIT_PREFIX(jinit_upsampler)
-#define jpeg_CreateDecompress FOXIT_PREFIX(jpeg_CreateDecompress)
-#define jpeg_abort FOXIT_PREFIX(jpeg_abort)
-#define jpeg_abort_decompress FOXIT_PREFIX(jpeg_abort_decompress)
-#define jpeg_alloc_huff_table FOXIT_PREFIX(jpeg_alloc_huff_table)
-#define jpeg_alloc_quant_table FOXIT_PREFIX(jpeg_alloc_quant_table)
-#define jpeg_calc_output_dimensions FOXIT_PREFIX(jpeg_calc_output_dimensions)
-#define jpeg_consume_input FOXIT_PREFIX(jpeg_consume_input)
-#define jpeg_destroy FOXIT_PREFIX(jpeg_destroy)
-#define jpeg_destroy_decompress FOXIT_PREFIX(jpeg_destroy_decompress)
-#define jpeg_fill_bit_buffer FOXIT_PREFIX(jpeg_fill_bit_buffer)
-#define jpeg_finish_decompress FOXIT_PREFIX(jpeg_finish_decompress)
-#define jpeg_finish_output FOXIT_PREFIX(jpeg_finish_output)
-#define jpeg_free_large FOXIT_PREFIX(jpeg_free_large)
-#define jpeg_free_small FOXIT_PREFIX(jpeg_free_small)
-#define jpeg_get_large FOXIT_PREFIX(jpeg_get_large)
-#define jpeg_get_small FOXIT_PREFIX(jpeg_get_small)
-#define jpeg_has_multiple_scans FOXIT_PREFIX(jpeg_has_multiple_scans)
-#define jpeg_huff_decode FOXIT_PREFIX(jpeg_huff_decode)
-#define jpeg_idct_1x1 FOXIT_PREFIX(jpeg_idct_1x1)
-#define jpeg_idct_2x2 FOXIT_PREFIX(jpeg_idct_2x2)
-#define jpeg_idct_4x4 FOXIT_PREFIX(jpeg_idct_4x4)
-#define jpeg_idct_float FOXIT_PREFIX(jpeg_idct_float)
-#define jpeg_idct_ifast FOXIT_PREFIX(jpeg_idct_ifast)
-#define jpeg_idct_islow FOXIT_PREFIX(jpeg_idct_islow)
-#define jpeg_input_complete FOXIT_PREFIX(jpeg_input_complete)
-#define jpeg_make_d_derived_tbl FOXIT_PREFIX(jpeg_make_d_derived_tbl)
-#define jpeg_mem_available FOXIT_PREFIX(jpeg_mem_available)
-#define jpeg_mem_init FOXIT_PREFIX(jpeg_mem_init)
-#define jpeg_mem_term FOXIT_PREFIX(jpeg_mem_term)
-#define jpeg_natural_order FOXIT_PREFIX(jpeg_natural_order)
-#define jpeg_new_colormap FOXIT_PREFIX(jpeg_new_colormap)
-#define jpeg_open_backing_store FOXIT_PREFIX(jpeg_open_backing_store)
-#define jpeg_read_coefficients FOXIT_PREFIX(jpeg_read_coefficients)
-#define jpeg_read_header FOXIT_PREFIX(jpeg_read_header)
-#define jpeg_read_raw_data FOXIT_PREFIX(jpeg_read_raw_data)
-#define jpeg_read_scanlines FOXIT_PREFIX(jpeg_read_scanlines)
-#define jpeg_resync_to_restart FOXIT_PREFIX(jpeg_resync_to_restart)
-#define jpeg_save_markers FOXIT_PREFIX(jpeg_save_markers)
-#define jpeg_set_marker_processor FOXIT_PREFIX(jpeg_set_marker_processor)
-#define jpeg_start_decompress FOXIT_PREFIX(jpeg_start_decompress)
-#define jpeg_start_output FOXIT_PREFIX(jpeg_start_output)
-#define jpeg_std_error FOXIT_PREFIX(jpeg_std_error)
-#define jpeg_std_message_table FOXIT_PREFIX(jpeg_std_message_table)
-#define jpeg_stdio_src FOXIT_PREFIX(jpeg_stdio_src)
-#define jround_up FOXIT_PREFIX(jround_up)
-#define jzero_far FOXIT_PREFIX(jzero_far)
-
- /*
- * First we include the configuration files that record how this
- * installation of the JPEG library is set up. jconfig.h can be
- * generated automatically for many systems. jmorecfg.h contains
- * manual configuration options that most people need not worry about.
- */
-
-#ifndef JCONFIG_INCLUDED /* in case jinclude.h already did */
-#include "jconfig.h" /* widely used configuration options */
-#endif
-#include "jmorecfg.h" /* seldom changed options */
-
-
-/* Version ID for the JPEG library.
- * Might be useful for tests like "#if JPEG_LIB_VERSION >= 60".
- */
-
-#define JPEG_LIB_VERSION 62 /* Version 6b */
-
-
-/* Various constants determining the sizes of things.
- * All of these are specified by the JPEG standard, so don't change them
- * if you want to be compatible.
- */
-
-#define DCTSIZE 8 /* The basic DCT block is 8x8 samples */
-#define DCTSIZE2 64 /* DCTSIZE squared; # of elements in a block */
-#define NUM_QUANT_TBLS 4 /* Quantization tables are numbered 0..3 */
-#define NUM_HUFF_TBLS 4 /* Huffman tables are numbered 0..3 */
-#define NUM_ARITH_TBLS 16 /* Arith-coding tables are numbered 0..15 */
-#define MAX_COMPS_IN_SCAN 4 /* JPEG limit on # of components in one scan */
-#define MAX_SAMP_FACTOR 4 /* JPEG limit on sampling factors */
-/* Unfortunately, some bozo at Adobe saw no reason to be bound by the standard;
- * the PostScript DCT filter can emit files with many more than 10 blocks/MCU.
- * If you happen to run across such a file, you can up D_MAX_BLOCKS_IN_MCU
- * to handle it. We even let you do this from the jconfig.h file. However,
- * we strongly discourage changing C_MAX_BLOCKS_IN_MCU; just because Adobe
- * sometimes emits noncompliant files doesn't mean you should too.
- */
-#define C_MAX_BLOCKS_IN_MCU 10 /* compressor's limit on blocks per MCU */
-#ifndef D_MAX_BLOCKS_IN_MCU
-#define D_MAX_BLOCKS_IN_MCU 10 /* decompressor's limit on blocks per MCU */
-#endif
-
-
-/* Data structures for images (arrays of samples and of DCT coefficients).
- * On 80x86 machines, the image arrays are too big for near pointers,
- * but the pointer arrays can fit in near memory.
- */
-
-typedef JSAMPLE *JSAMPROW; /* ptr to one image row of pixel samples. */
-typedef JSAMPROW *JSAMPARRAY; /* ptr to some rows (a 2-D sample array) */
-typedef JSAMPARRAY *JSAMPIMAGE; /* a 3-D sample array: top index is color */
-
-typedef JCOEF JBLOCK[DCTSIZE2]; /* one block of coefficients */
-typedef JBLOCK *JBLOCKROW; /* pointer to one row of coefficient blocks */
-typedef JBLOCKROW *JBLOCKARRAY; /* a 2-D array of coefficient blocks */
-typedef JBLOCKARRAY *JBLOCKIMAGE; /* a 3-D array of coefficient blocks */
-
-typedef JCOEF *JCOEFPTR; /* useful in a couple of places */
-
-
-/* Types for JPEG compression parameters and working tables. */
-
-
-/* DCT coefficient quantization tables. */
-
-typedef struct {
- /* This array gives the coefficient quantizers in natural array order
- * (not the zigzag order in which they are stored in a JPEG DQT marker).
- * CAUTION: IJG versions prior to v6a kept this array in zigzag order.
- */
- UINT16 quantval[DCTSIZE2]; /* quantization step for each coefficient */
- /* This field is used only during compression. It's initialized FALSE when
- * the table is created, and set TRUE when it's been output to the file.
- * You could suppress output of a table by setting this to TRUE.
- * (See jpeg_suppress_tables for an example.)
- */
- boolean sent_table; /* TRUE when table has been output */
-} JQUANT_TBL;
-
-
-/* Huffman coding tables. */
-
-typedef struct {
- /* These two fields directly represent the contents of a JPEG DHT marker */
- UINT8 bits[17]; /* bits[k] = # of symbols with codes of */
- /* length k bits; bits[0] is unused */
- UINT8 huffval[256]; /* The symbols, in order of incr code length */
- /* This field is used only during compression. It's initialized FALSE when
- * the table is created, and set TRUE when it's been output to the file.
- * You could suppress output of a table by setting this to TRUE.
- * (See jpeg_suppress_tables for an example.)
- */
- boolean sent_table; /* TRUE when table has been output */
-} JHUFF_TBL;
-
-
-/* Basic info about one component (color channel). */
-
-typedef struct {
- /* These values are fixed over the whole image. */
- /* For compression, they must be supplied by parameter setup; */
- /* for decompression, they are read from the SOF marker. */
- int component_id; /* identifier for this component (0..255) */
- int component_index; /* its index in SOF or cinfo->comp_info[] */
- int h_samp_factor; /* horizontal sampling factor (1..4) */
- int v_samp_factor; /* vertical sampling factor (1..4) */
- int quant_tbl_no; /* quantization table selector (0..3) */
- /* These values may vary between scans. */
- /* For compression, they must be supplied by parameter setup; */
- /* for decompression, they are read from the SOS marker. */
- /* The decompressor output side may not use these variables. */
- int dc_tbl_no; /* DC entropy table selector (0..3) */
- int ac_tbl_no; /* AC entropy table selector (0..3) */
-
- /* Remaining fields should be treated as private by applications. */
-
- /* These values are computed during compression or decompression startup: */
- /* Component's size in DCT blocks.
- * Any dummy blocks added to complete an MCU are not counted; therefore
- * these values do not depend on whether a scan is interleaved or not.
- */
- JDIMENSION width_in_blocks;
- JDIMENSION height_in_blocks;
- /* Size of a DCT block in samples. Always DCTSIZE for compression.
- * For decompression this is the size of the output from one DCT block,
- * reflecting any scaling we choose to apply during the IDCT step.
- * Values of 1,2,4,8 are likely to be supported. Note that different
- * components may receive different IDCT scalings.
- */
- int DCT_scaled_size;
- /* The downsampled dimensions are the component's actual, unpadded number
- * of samples at the main buffer (preprocessing/compression interface), thus
- * downsampled_width = ceil(image_width * Hi/Hmax)
- * and similarly for height. For decompression, IDCT scaling is included, so
- * downsampled_width = ceil(image_width * Hi/Hmax * DCT_scaled_size/DCTSIZE)
- */
- JDIMENSION downsampled_width; /* actual width in samples */
- JDIMENSION downsampled_height; /* actual height in samples */
- /* This flag is used only for decompression. In cases where some of the
- * components will be ignored (eg grayscale output from YCbCr image),
- * we can skip most computations for the unused components.
- */
- boolean component_needed; /* do we need the value of this component? */
-
- /* These values are computed before starting a scan of the component. */
- /* The decompressor output side may not use these variables. */
- int MCU_width; /* number of blocks per MCU, horizontally */
- int MCU_height; /* number of blocks per MCU, vertically */
- int MCU_blocks; /* MCU_width * MCU_height */
- int MCU_sample_width; /* MCU width in samples, MCU_width*DCT_scaled_size */
- int last_col_width; /* # of non-dummy blocks across in last MCU */
- int last_row_height; /* # of non-dummy blocks down in last MCU */
-
- /* Saved quantization table for component; NULL if none yet saved.
- * See jdinput.c comments about the need for this information.
- * This field is currently used only for decompression.
- */
- JQUANT_TBL * quant_table;
-
- /* Private per-component storage for DCT or IDCT subsystem. */
- void * dct_table;
-} jpeg_component_info;
-
-
-/* The script for encoding a multiple-scan file is an array of these: */
-
-typedef struct {
- int comps_in_scan; /* number of components encoded in this scan */
- int component_index[MAX_COMPS_IN_SCAN]; /* their SOF/comp_info[] indexes */
- int Ss, Se; /* progressive JPEG spectral selection parms */
- int Ah, Al; /* progressive JPEG successive approx. parms */
-} jpeg_scan_info;
-
-/* The decompressor can save APPn and COM markers in a list of these: */
-
-typedef struct jpeg_marker_struct * jpeg_saved_marker_ptr;
-
-struct jpeg_marker_struct {
- jpeg_saved_marker_ptr next; /* next in list, or NULL */
- UINT8 marker; /* marker code: JPEG_COM, or JPEG_APP0+n */
- unsigned int original_length; /* # bytes of data in the file */
- unsigned int data_length; /* # bytes of data saved at data[] */
- JOCTET * data; /* the data contained in the marker */
- /* the marker length word is not counted in data_length or original_length */
-};
-
-/* Known color spaces. */
-
-typedef enum {
- JCS_UNKNOWN, /* error/unspecified */
- JCS_GRAYSCALE, /* monochrome */
- JCS_RGB, /* red/green/blue */
- JCS_YCbCr, /* Y/Cb/Cr (also known as YUV) */
- JCS_CMYK, /* C/M/Y/K */
- JCS_YCCK /* Y/Cb/Cr/K */
-} J_COLOR_SPACE;
-
-/* DCT/IDCT algorithm options. */
-
-typedef enum {
- JDCT_ISLOW, /* slow but accurate integer algorithm */
- JDCT_IFAST, /* faster, less accurate integer method */
- JDCT_FLOAT /* floating-point: accurate, fast on fast HW */
-} J_DCT_METHOD;
-
-#ifndef JDCT_DEFAULT /* may be overridden in jconfig.h */
-#define JDCT_DEFAULT JDCT_ISLOW
-#endif
-#ifndef JDCT_FASTEST /* may be overridden in jconfig.h */
-#define JDCT_FASTEST JDCT_IFAST
-#endif
-
-/* Dithering options for decompression. */
-
-typedef enum {
- JDITHER_NONE, /* no dithering */
- JDITHER_ORDERED, /* simple ordered dither */
- JDITHER_FS /* Floyd-Steinberg error diffusion dither */
-} J_DITHER_MODE;
-
-
-/* Common fields between JPEG compression and decompression master structs. */
-
-#define jpeg_common_fields \
- struct jpeg_error_mgr * err; /* Error handler module */\
- struct jpeg_memory_mgr * mem; /* Memory manager module */\
- struct jpeg_progress_mgr * progress; /* Progress monitor, or NULL if none */\
- void * client_data; /* Available for use by application */\
- boolean is_decompressor; /* So common code can tell which is which */\
- int global_state /* For checking call sequence validity */
-
-/* Routines that are to be used by both halves of the library are declared
- * to receive a pointer to this structure. There are no actual instances of
- * jpeg_common_struct, only of jpeg_compress_struct and jpeg_decompress_struct.
- */
-struct jpeg_common_struct {
- jpeg_common_fields; /* Fields common to both master struct types */
- /* Additional fields follow in an actual jpeg_compress_struct or
- * jpeg_decompress_struct. All three structs must agree on these
- * initial fields! (This would be a lot cleaner in C++.)
- */
-};
-
-typedef struct jpeg_common_struct * j_common_ptr;
-typedef struct jpeg_compress_struct * j_compress_ptr;
-typedef struct jpeg_decompress_struct * j_decompress_ptr;
-
-
-/* Master record for a compression instance */
-
-struct jpeg_compress_struct {
- jpeg_common_fields; /* Fields shared with jpeg_decompress_struct */
-
- /* Destination for compressed data */
- struct jpeg_destination_mgr * dest;
-
- /* Description of source image --- these fields must be filled in by
- * outer application before starting compression. in_color_space must
- * be correct before you can even call jpeg_set_defaults().
- */
-
- JDIMENSION image_width; /* input image width */
- JDIMENSION image_height; /* input image height */
- int input_components; /* # of color components in input image */
- J_COLOR_SPACE in_color_space; /* colorspace of input image */
-
- double input_gamma; /* image gamma of input image */
-
- /* Compression parameters --- these fields must be set before calling
- * jpeg_start_compress(). We recommend calling jpeg_set_defaults() to
- * initialize everything to reasonable defaults, then changing anything
- * the application specifically wants to change. That way you won't get
- * burnt when new parameters are added. Also note that there are several
- * helper routines to simplify changing parameters.
- */
-
- int data_precision; /* bits of precision in image data */
-
- int num_components; /* # of color components in JPEG image */
- J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */
-
- jpeg_component_info * comp_info;
- /* comp_info[i] describes component that appears i'th in SOF */
-
- JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS];
- /* ptrs to coefficient quantization tables, or NULL if not defined */
-
- JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS];
- JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS];
- /* ptrs to Huffman coding tables, or NULL if not defined */
-
- UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */
- UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */
- UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */
-
- int num_scans; /* # of entries in scan_info array */
- const jpeg_scan_info * scan_info; /* script for multi-scan file, or NULL */
- /* The default value of scan_info is NULL, which causes a single-scan
- * sequential JPEG file to be emitted. To create a multi-scan file,
- * set num_scans and scan_info to point to an array of scan definitions.
- */
-
- boolean raw_data_in; /* TRUE=caller supplies downsampled data */
- boolean arith_code; /* TRUE=arithmetic coding, FALSE=Huffman */
- boolean optimize_coding; /* TRUE=optimize entropy encoding parms */
- boolean CCIR601_sampling; /* TRUE=first samples are cosited */
- int smoothing_factor; /* 1..100, or 0 for no input smoothing */
- J_DCT_METHOD dct_method; /* DCT algorithm selector */
-
- /* The restart interval can be specified in absolute MCUs by setting
- * restart_interval, or in MCU rows by setting restart_in_rows
- * (in which case the correct restart_interval will be figured
- * for each scan).
- */
- unsigned int restart_interval; /* MCUs per restart, or 0 for no restart */
- int restart_in_rows; /* if > 0, MCU rows per restart interval */
-
- /* Parameters controlling emission of special markers. */
-
- boolean write_JFIF_header; /* should a JFIF marker be written? */
- UINT8 JFIF_major_version; /* What to write for the JFIF version number */
- UINT8 JFIF_minor_version;
- /* These three values are not used by the JPEG code, merely copied */
- /* into the JFIF APP0 marker. density_unit can be 0 for unknown, */
- /* 1 for dots/inch, or 2 for dots/cm. Note that the pixel aspect */
- /* ratio is defined by X_density/Y_density even when density_unit=0. */
- UINT8 density_unit; /* JFIF code for pixel size units */
- UINT16 X_density; /* Horizontal pixel density */
- UINT16 Y_density; /* Vertical pixel density */
- boolean write_Adobe_marker; /* should an Adobe marker be written? */
-
- /* State variable: index of next scanline to be written to
- * jpeg_write_scanlines(). Application may use this to control its
- * processing loop, e.g., "while (next_scanline < image_height)".
- */
-
- JDIMENSION next_scanline; /* 0 .. image_height-1 */
-
- /* Remaining fields are known throughout compressor, but generally
- * should not be touched by a surrounding application.
- */
-
- /*
- * These fields are computed during compression startup
- */
- boolean progressive_mode; /* TRUE if scan script uses progressive mode */
- int max_h_samp_factor; /* largest h_samp_factor */
- int max_v_samp_factor; /* largest v_samp_factor */
-
- JDIMENSION total_iMCU_rows; /* # of iMCU rows to be input to coef ctlr */
- /* The coefficient controller receives data in units of MCU rows as defined
- * for fully interleaved scans (whether the JPEG file is interleaved or not).
- * There are v_samp_factor * DCTSIZE sample rows of each component in an
- * "iMCU" (interleaved MCU) row.
- */
-
- /*
- * These fields are valid during any one scan.
- * They describe the components and MCUs actually appearing in the scan.
- */
- int comps_in_scan; /* # of JPEG components in this scan */
- jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN];
- /* *cur_comp_info[i] describes component that appears i'th in SOS */
-
- JDIMENSION MCUs_per_row; /* # of MCUs across the image */
- JDIMENSION MCU_rows_in_scan; /* # of MCU rows in the image */
-
- int blocks_in_MCU; /* # of DCT blocks per MCU */
- int MCU_membership[C_MAX_BLOCKS_IN_MCU];
- /* MCU_membership[i] is index in cur_comp_info of component owning */
- /* i'th block in an MCU */
-
- int Ss, Se, Ah, Al; /* progressive JPEG parameters for scan */
-
- /*
- * Links to compression subobjects (methods and private variables of modules)
- */
- struct jpeg_comp_master * master;
- struct jpeg_c_main_controller * main;
- struct jpeg_c_prep_controller * prep;
- struct jpeg_c_coef_controller * coef;
- struct jpeg_marker_writer * marker;
- struct jpeg_color_converter * cconvert;
- struct jpeg_downsampler * downsample;
- struct jpeg_forward_dct * fdct;
- struct jpeg_entropy_encoder * entropy;
- jpeg_scan_info * script_space; /* workspace for jpeg_simple_progression */
- int script_space_size;
-};
-
-
-/* Master record for a decompression instance */
-
-struct jpeg_decompress_struct {
- jpeg_common_fields; /* Fields shared with jpeg_compress_struct */
-
- /* Source of compressed data */
- struct jpeg_source_mgr * src;
-
- /* Basic description of image --- filled in by jpeg_read_header(). */
- /* Application may inspect these values to decide how to process image. */
-
- JDIMENSION image_width; /* nominal image width (from SOF marker) */
- JDIMENSION image_height; /* nominal image height */
- int num_components; /* # of color components in JPEG image */
- J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */
-
- /* Decompression processing parameters --- these fields must be set before
- * calling jpeg_start_decompress(). Note that jpeg_read_header() initializes
- * them to default values.
- */
-
- J_COLOR_SPACE out_color_space; /* colorspace for output */
-
- unsigned int scale_num, scale_denom; /* fraction by which to scale image */
-
- double output_gamma; /* image gamma wanted in output */
-
- boolean buffered_image; /* TRUE=multiple output passes */
- boolean raw_data_out; /* TRUE=downsampled data wanted */
-
- J_DCT_METHOD dct_method; /* IDCT algorithm selector */
- boolean do_fancy_upsampling; /* TRUE=apply fancy upsampling */
- boolean do_block_smoothing; /* TRUE=apply interblock smoothing */
-
- boolean quantize_colors; /* TRUE=colormapped output wanted */
- /* the following are ignored if not quantize_colors: */
- J_DITHER_MODE dither_mode; /* type of color dithering to use */
- boolean two_pass_quantize; /* TRUE=use two-pass color quantization */
- int desired_number_of_colors; /* max # colors to use in created colormap */
- /* these are significant only in buffered-image mode: */
- boolean enable_1pass_quant; /* enable future use of 1-pass quantizer */
- boolean enable_external_quant;/* enable future use of external colormap */
- boolean enable_2pass_quant; /* enable future use of 2-pass quantizer */
-
- /* Description of actual output image that will be returned to application.
- * These fields are computed by jpeg_start_decompress().
- * You can also use jpeg_calc_output_dimensions() to determine these values
- * in advance of calling jpeg_start_decompress().
- */
-
- JDIMENSION output_width; /* scaled image width */
- JDIMENSION output_height; /* scaled image height */
- int out_color_components; /* # of color components in out_color_space */
- int output_components; /* # of color components returned */
- /* output_components is 1 (a colormap index) when quantizing colors;
- * otherwise it equals out_color_components.
- */
- int rec_outbuf_height; /* min recommended height of scanline buffer */
- /* If the buffer passed to jpeg_read_scanlines() is less than this many rows
- * high, space and time will be wasted due to unnecessary data copying.
- * Usually rec_outbuf_height will be 1 or 2, at most 4.
- */
-
- /* When quantizing colors, the output colormap is described by these fields.
- * The application can supply a colormap by setting colormap non-NULL before
- * calling jpeg_start_decompress; otherwise a colormap is created during
- * jpeg_start_decompress or jpeg_start_output.
- * The map has out_color_components rows and actual_number_of_colors columns.
- */
- int actual_number_of_colors; /* number of entries in use */
- JSAMPARRAY colormap; /* The color map as a 2-D pixel array */
-
- /* State variables: these variables indicate the progress of decompression.
- * The application may examine these but must not modify them.
- */
-
- /* Row index of next scanline to be read from jpeg_read_scanlines().
- * Application may use this to control its processing loop, e.g.,
- * "while (output_scanline < output_height)".
- */
- JDIMENSION output_scanline; /* 0 .. output_height-1 */
-
- /* Current input scan number and number of iMCU rows completed in scan.
- * These indicate the progress of the decompressor input side.
- */
- int input_scan_number; /* Number of SOS markers seen so far */
- JDIMENSION input_iMCU_row; /* Number of iMCU rows completed */
-
- /* The "output scan number" is the notional scan being displayed by the
- * output side. The decompressor will not allow output scan/row number
- * to get ahead of input scan/row, but it can fall arbitrarily far behind.
- */
- int output_scan_number; /* Nominal scan number being displayed */
- JDIMENSION output_iMCU_row; /* Number of iMCU rows read */
-
- /* Current progression status. coef_bits[c][i] indicates the precision
- * with which component c's DCT coefficient i (in zigzag order) is known.
- * It is -1 when no data has yet been received, otherwise it is the point
- * transform (shift) value for the most recent scan of the coefficient
- * (thus, 0 at completion of the progression).
- * This pointer is NULL when reading a non-progressive file.
- */
- int (*coef_bits)[DCTSIZE2]; /* -1 or current Al value for each coef */
-
- /* Internal JPEG parameters --- the application usually need not look at
- * these fields. Note that the decompressor output side may not use
- * any parameters that can change between scans.
- */
-
- /* Quantization and Huffman tables are carried forward across input
- * datastreams when processing abbreviated JPEG datastreams.
- */
-
- JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS];
- /* ptrs to coefficient quantization tables, or NULL if not defined */
-
- JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS];
- JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS];
- /* ptrs to Huffman coding tables, or NULL if not defined */
-
- /* These parameters are never carried across datastreams, since they
- * are given in SOF/SOS markers or defined to be reset by SOI.
- */
-
- int data_precision; /* bits of precision in image data */
-
- jpeg_component_info * comp_info;
- /* comp_info[i] describes component that appears i'th in SOF */
-
- boolean progressive_mode; /* TRUE if SOFn specifies progressive mode */
- boolean arith_code; /* TRUE=arithmetic coding, FALSE=Huffman */
-
- UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */
- UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */
- UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */
-
- unsigned int restart_interval; /* MCUs per restart interval, or 0 for no restart */
-
- /* These fields record data obtained from optional markers recognized by
- * the JPEG library.
- */
- boolean saw_JFIF_marker; /* TRUE iff a JFIF APP0 marker was found */
- /* Data copied from JFIF marker; only valid if saw_JFIF_marker is TRUE: */
- UINT8 JFIF_major_version; /* JFIF version number */
- UINT8 JFIF_minor_version;
- UINT8 density_unit; /* JFIF code for pixel size units */
- UINT16 X_density; /* Horizontal pixel density */
- UINT16 Y_density; /* Vertical pixel density */
- boolean saw_Adobe_marker; /* TRUE iff an Adobe APP14 marker was found */
- UINT8 Adobe_transform; /* Color transform code from Adobe marker */
-
- boolean CCIR601_sampling; /* TRUE=first samples are cosited */
-
- /* Aside from the specific data retained from APPn markers known to the
- * library, the uninterpreted contents of any or all APPn and COM markers
- * can be saved in a list for examination by the application.
- */
- jpeg_saved_marker_ptr marker_list; /* Head of list of saved markers */
-
- /* Remaining fields are known throughout decompressor, but generally
- * should not be touched by a surrounding application.
- */
-
- /*
- * These fields are computed during decompression startup
- */
- int max_h_samp_factor; /* largest h_samp_factor */
- int max_v_samp_factor; /* largest v_samp_factor */
-
- int min_DCT_scaled_size; /* smallest DCT_scaled_size of any component */
-
- JDIMENSION total_iMCU_rows; /* # of iMCU rows in image */
- /* The coefficient controller's input and output progress is measured in
- * units of "iMCU" (interleaved MCU) rows. These are the same as MCU rows
- * in fully interleaved JPEG scans, but are used whether the scan is
- * interleaved or not. We define an iMCU row as v_samp_factor DCT block
- * rows of each component. Therefore, the IDCT output contains
- * v_samp_factor*DCT_scaled_size sample rows of a component per iMCU row.
- */
-
- JSAMPLE * sample_range_limit; /* table for fast range-limiting */
-
- /*
- * These fields are valid during any one scan.
- * They describe the components and MCUs actually appearing in the scan.
- * Note that the decompressor output side must not use these fields.
- */
- int comps_in_scan; /* # of JPEG components in this scan */
- jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN];
- /* *cur_comp_info[i] describes component that appears i'th in SOS */
-
- JDIMENSION MCUs_per_row; /* # of MCUs across the image */
- JDIMENSION MCU_rows_in_scan; /* # of MCU rows in the image */
-
- int blocks_in_MCU; /* # of DCT blocks per MCU */
- int MCU_membership[D_MAX_BLOCKS_IN_MCU];
- /* MCU_membership[i] is index in cur_comp_info of component owning */
- /* i'th block in an MCU */
-
- int Ss, Se, Ah, Al; /* progressive JPEG parameters for scan */
-
- /* This field is shared between entropy decoder and marker parser.
- * It is either zero or the code of a JPEG marker that has been
- * read from the data source, but has not yet been processed.
- */
- int unread_marker;
-
- /*
- * Links to decompression subobjects (methods, private variables of modules)
- */
- struct jpeg_decomp_master * master;
- struct jpeg_d_main_controller * main;
- struct jpeg_d_coef_controller * coef;
- struct jpeg_d_post_controller * post;
- struct jpeg_input_controller * inputctl;
- struct jpeg_marker_reader * marker;
- struct jpeg_entropy_decoder * entropy;
- struct jpeg_inverse_dct * idct;
- struct jpeg_upsampler * upsample;
- struct jpeg_color_deconverter * cconvert;
- struct jpeg_color_quantizer * cquantize;
-};
-
-
-/* "Object" declarations for JPEG modules that may be supplied or called
- * directly by the surrounding application.
- * As with all objects in the JPEG library, these structs only define the
- * publicly visible methods and state variables of a module. Additional
- * private fields may exist after the public ones.
- */
-
-
-/* Error handler object */
-
-struct jpeg_error_mgr {
- /* Error exit handler: does not return to caller */
- JMETHOD(void, error_exit, (j_common_ptr cinfo));
- /* Conditionally emit a trace or warning message */
- JMETHOD(void, emit_message, (j_common_ptr cinfo, int msg_level));
- /* Routine that actually outputs a trace or error message */
- JMETHOD(void, output_message, (j_common_ptr cinfo));
- /* Format a message string for the most recent JPEG error or message */
- JMETHOD(void, format_message, (j_common_ptr cinfo, char * buffer));
-#define JMSG_LENGTH_MAX 200 /* recommended size of format_message buffer */
- /* Reset error state variables at start of a new image */
- JMETHOD(void, reset_error_mgr, (j_common_ptr cinfo));
-
- /* The message ID code and any parameters are saved here.
- * A message can have one string parameter or up to 8 int parameters.
- */
- int msg_code;
-#define JMSG_STR_PARM_MAX 80
- union {
- int i[8];
- char s[JMSG_STR_PARM_MAX];
- } msg_parm;
-
- /* Standard state variables for error facility */
-
- int trace_level; /* max msg_level that will be displayed */
-
- /* For recoverable corrupt-data errors, we emit a warning message,
- * but keep going unless emit_message chooses to abort. emit_message
- * should count warnings in num_warnings. The surrounding application
- * can check for bad data by seeing if num_warnings is nonzero at the
- * end of processing.
- */
- long num_warnings; /* number of corrupt-data warnings */
-
- /* These fields point to the table(s) of error message strings.
- * An application can change the table pointer to switch to a different
- * message list (typically, to change the language in which errors are
- * reported). Some applications may wish to add additional error codes
- * that will be handled by the JPEG library error mechanism; the second
- * table pointer is used for this purpose.
- *
- * First table includes all errors generated by JPEG library itself.
- * Error code 0 is reserved for a "no such error string" message.
- */
- const char * const * jpeg_message_table; /* Library errors */
- int last_jpeg_message; /* Table contains strings 0..last_jpeg_message */
- /* Second table can be added by application (see cjpeg/djpeg for example).
- * It contains strings numbered first_addon_message..last_addon_message.
- */
- const char * const * addon_message_table; /* Non-library errors */
- int first_addon_message; /* code for first string in addon table */
- int last_addon_message; /* code for last string in addon table */
-};
-
-
-/* Progress monitor object */
-
-struct jpeg_progress_mgr {
- JMETHOD(void, progress_monitor, (j_common_ptr cinfo));
-
- long pass_counter; /* work units completed in this pass */
- long pass_limit; /* total number of work units in this pass */
- int completed_passes; /* passes completed so far */
- int total_passes; /* total number of passes expected */
-};
-
-
-/* Data destination object for compression */
-
-struct jpeg_destination_mgr {
- JOCTET * next_output_byte; /* => next byte to write in buffer */
- size_t free_in_buffer; /* # of byte spaces remaining in buffer */
-
- JMETHOD(void, init_destination, (j_compress_ptr cinfo));
- JMETHOD(boolean, empty_output_buffer, (j_compress_ptr cinfo));
- JMETHOD(void, term_destination, (j_compress_ptr cinfo));
-};
-
-
-/* Data source object for decompression */
-
-struct jpeg_source_mgr {
- const JOCTET * next_input_byte; /* => next byte to read from buffer */
- size_t bytes_in_buffer; /* # of bytes remaining in buffer */
-
- JMETHOD(void, init_source, (j_decompress_ptr cinfo));
- JMETHOD(boolean, fill_input_buffer, (j_decompress_ptr cinfo));
- JMETHOD(void, skip_input_data, (j_decompress_ptr cinfo, long num_bytes));
- JMETHOD(boolean, resync_to_restart, (j_decompress_ptr cinfo, int desired));
- JMETHOD(void, term_source, (j_decompress_ptr cinfo));
-};
-
-
-/* Memory manager object.
- * Allocates "small" objects (a few K total), "large" objects (tens of K),
- * and "really big" objects (virtual arrays with backing store if needed).
- * The memory manager does not allow individual objects to be freed; rather,
- * each created object is assigned to a pool, and whole pools can be freed
- * at once. This is faster and more convenient than remembering exactly what
- * to free, especially where malloc()/free() are not too speedy.
- * NB: alloc routines never return NULL. They exit to error_exit if not
- * successful.
- */
-
-#define JPOOL_PERMANENT 0 /* lasts until master record is destroyed */
-#define JPOOL_IMAGE 1 /* lasts until done with image/datastream */
-#define JPOOL_NUMPOOLS 2
-
-typedef struct jvirt_sarray_control * jvirt_sarray_ptr;
-typedef struct jvirt_barray_control * jvirt_barray_ptr;
-
-
-struct jpeg_memory_mgr {
- /* Method pointers */
- JMETHOD(void *, alloc_small, (j_common_ptr cinfo, int pool_id,
- size_t sizeofobject));
- JMETHOD(void *, alloc_large, (j_common_ptr cinfo, int pool_id,
- size_t sizeofobject));
- JMETHOD(JSAMPARRAY, alloc_sarray, (j_common_ptr cinfo, int pool_id,
- JDIMENSION samplesperrow,
- JDIMENSION numrows));
- JMETHOD(JBLOCKARRAY, alloc_barray, (j_common_ptr cinfo, int pool_id,
- JDIMENSION blocksperrow,
- JDIMENSION numrows));
- JMETHOD(jvirt_sarray_ptr, request_virt_sarray, (j_common_ptr cinfo,
- int pool_id,
- boolean pre_zero,
- JDIMENSION samplesperrow,
- JDIMENSION numrows,
- JDIMENSION maxaccess));
- JMETHOD(jvirt_barray_ptr, request_virt_barray, (j_common_ptr cinfo,
- int pool_id,
- boolean pre_zero,
- JDIMENSION blocksperrow,
- JDIMENSION numrows,
- JDIMENSION maxaccess));
- JMETHOD(void, realize_virt_arrays, (j_common_ptr cinfo));
- JMETHOD(JSAMPARRAY, access_virt_sarray, (j_common_ptr cinfo,
- jvirt_sarray_ptr ptr,
- JDIMENSION start_row,
- JDIMENSION num_rows,
- boolean writable));
- JMETHOD(JBLOCKARRAY, access_virt_barray, (j_common_ptr cinfo,
- jvirt_barray_ptr ptr,
- JDIMENSION start_row,
- JDIMENSION num_rows,
- boolean writable));
- JMETHOD(void, free_pool, (j_common_ptr cinfo, int pool_id));
- JMETHOD(void, self_destruct, (j_common_ptr cinfo));
-
- /* Limit on memory allocation for this JPEG object. (Note that this is
- * merely advisory, not a guaranteed maximum; it only affects the space
- * used for virtual-array buffers.) May be changed by outer application
- * after creating the JPEG object.
- */
- long max_memory_to_use;
-
- /* Maximum allocation request accepted by alloc_large. */
- long max_alloc_chunk;
-};
-
-
-/* Routine signature for application-supplied marker processing methods.
- * Need not pass marker code since it is stored in cinfo->unread_marker.
- */
-typedef JMETHOD(boolean, jpeg_marker_parser_method, (j_decompress_ptr cinfo));
-
-
-/* Declarations for routines called by application.
- * The JPP macro hides prototype parameters from compilers that can't cope.
- * Note JPP requires double parentheses.
- */
-
-#ifdef HAVE_PROTOTYPES
-#define JPP(arglist) arglist
-#else
-#define JPP(arglist) ()
-#endif
-
-
-/* Short forms of external names for systems with brain-damaged linkers.
- * We shorten external names to be unique in the first six letters, which
- * is good enough for all known systems.
- * (If your compiler itself needs names to be unique in less than 15
- * characters, you are out of luck. Get a better compiler.)
- */
-
-#ifdef NEED_SHORT_EXTERNAL_NAMES
-#define jpeg_std_error jStdError
-#define jpeg_CreateCompress jCreaCompress
-#define jpeg_CreateDecompress jCreaDecompress
-#define jpeg_destroy_compress jDestCompress
-#define jpeg_destroy_decompress jDestDecompress
-#define jpeg_stdio_dest jStdDest
-#define jpeg_stdio_src jStdSrc
-#define jpeg_set_defaults jSetDefaults
-#define jpeg_set_colorspace jSetColorspace
-#define jpeg_default_colorspace jDefColorspace
-#define jpeg_set_quality jSetQuality
-#define jpeg_set_linear_quality jSetLQuality
-#define jpeg_add_quant_table jAddQuantTable
-#define jpeg_quality_scaling jQualityScaling
-#define jpeg_simple_progression jSimProgress
-#define jpeg_suppress_tables jSuppressTables
-#define jpeg_alloc_quant_table jAlcQTable
-#define jpeg_alloc_huff_table jAlcHTable
-#define jpeg_start_compress jStrtCompress
-#define jpeg_write_scanlines jWrtScanlines
-#define jpeg_finish_compress jFinCompress
-#define jpeg_write_raw_data jWrtRawData
-#define jpeg_write_marker jWrtMarker
-#define jpeg_write_m_header jWrtMHeader
-#define jpeg_write_m_byte jWrtMByte
-#define jpeg_write_tables jWrtTables
-#define jpeg_read_header jReadHeader
-#define jpeg_start_decompress jStrtDecompress
-#define jpeg_read_scanlines jReadScanlines
-#define jpeg_finish_decompress jFinDecompress
-#define jpeg_read_raw_data jReadRawData
-#define jpeg_has_multiple_scans jHasMultScn
-#define jpeg_start_output jStrtOutput
-#define jpeg_finish_output jFinOutput
-#define jpeg_input_complete jInComplete
-#define jpeg_new_colormap jNewCMap
-#define jpeg_consume_input jConsumeInput
-#define jpeg_calc_output_dimensions jCalcDimensions
-#define jpeg_save_markers jSaveMarkers
-#define jpeg_set_marker_processor jSetMarker
-#define jpeg_read_coefficients jReadCoefs
-#define jpeg_write_coefficients jWrtCoefs
-#define jpeg_copy_critical_parameters jCopyCrit
-#define jpeg_abort_compress jAbrtCompress
-#define jpeg_abort_decompress jAbrtDecompress
-#define jpeg_abort jAbort
-#define jpeg_destroy jDestroy
-#define jpeg_resync_to_restart jResyncRestart
-#endif /* NEED_SHORT_EXTERNAL_NAMES */
-
-
-/* Default error-management setup */
-EXTERN(struct jpeg_error_mgr *) jpeg_std_error
- JPP((struct jpeg_error_mgr * err));
-
-/* Initialization of JPEG compression objects.
- * jpeg_create_compress() and jpeg_create_decompress() are the exported
- * names that applications should call. These expand to calls on
- * jpeg_CreateCompress and jpeg_CreateDecompress with additional information
- * passed for version mismatch checking.
- * NB: you must set up the error-manager BEFORE calling jpeg_create_xxx.
- */
-#define jpeg_create_compress(cinfo) \
- jpeg_CreateCompress((cinfo), JPEG_LIB_VERSION, \
- (size_t) sizeof(struct jpeg_compress_struct))
-#define jpeg_create_decompress(cinfo) \
- jpeg_CreateDecompress((cinfo), JPEG_LIB_VERSION, \
- (size_t) sizeof(struct jpeg_decompress_struct))
-EXTERN(void) jpeg_CreateCompress JPP((j_compress_ptr cinfo,
- int version, size_t structsize));
-EXTERN(void) jpeg_CreateDecompress JPP((j_decompress_ptr cinfo,
- int version, size_t structsize));
-/* Destruction of JPEG compression objects */
-EXTERN(void) jpeg_destroy_compress JPP((j_compress_ptr cinfo));
-EXTERN(void) jpeg_destroy_decompress JPP((j_decompress_ptr cinfo));
-
-#if 0
-/* Standard data source and destination managers: stdio streams. */
-/* Caller is responsible for opening the file before and closing after. */
-EXTERN(void) jpeg_stdio_dest JPP((j_compress_ptr cinfo, FXSYS_FILE * outfile));
-EXTERN(void) jpeg_stdio_src JPP((j_decompress_ptr cinfo, FXSYS_FILE * infile));
-#endif
-
-/* Default parameter setup for compression */
-EXTERN(void) jpeg_set_defaults JPP((j_compress_ptr cinfo));
-/* Compression parameter setup aids */
-EXTERN(void) jpeg_set_colorspace JPP((j_compress_ptr cinfo,
- J_COLOR_SPACE colorspace));
-EXTERN(void) jpeg_default_colorspace JPP((j_compress_ptr cinfo));
-EXTERN(void) jpeg_set_quality JPP((j_compress_ptr cinfo, int quality,
- boolean force_baseline));
-EXTERN(void) jpeg_set_linear_quality JPP((j_compress_ptr cinfo,
- int scale_factor,
- boolean force_baseline));
-EXTERN(void) jpeg_add_quant_table JPP((j_compress_ptr cinfo, int which_tbl,
- const unsigned int *basic_table,
- int scale_factor,
- boolean force_baseline));
-EXTERN(int) jpeg_quality_scaling JPP((int quality));
-EXTERN(void) jpeg_simple_progression JPP((j_compress_ptr cinfo));
-EXTERN(void) jpeg_suppress_tables JPP((j_compress_ptr cinfo,
- boolean suppress));
-EXTERN(JQUANT_TBL *) jpeg_alloc_quant_table JPP((j_common_ptr cinfo));
-EXTERN(JHUFF_TBL *) jpeg_alloc_huff_table JPP((j_common_ptr cinfo));
-
-/* Main entry points for compression */
-EXTERN(void) jpeg_start_compress JPP((j_compress_ptr cinfo,
- boolean write_all_tables));
-EXTERN(JDIMENSION) jpeg_write_scanlines JPP((j_compress_ptr cinfo,
- JSAMPARRAY scanlines,
- JDIMENSION num_lines));
-EXTERN(void) jpeg_finish_compress JPP((j_compress_ptr cinfo));
-
-/* Replaces jpeg_write_scanlines when writing raw downsampled data. */
-EXTERN(JDIMENSION) jpeg_write_raw_data JPP((j_compress_ptr cinfo,
- JSAMPIMAGE data,
- JDIMENSION num_lines));
-
-/* Write a special marker. See libjpeg.doc concerning safe usage. */
-EXTERN(void) jpeg_write_marker
- JPP((j_compress_ptr cinfo, int marker,
- const JOCTET * dataptr, unsigned int datalen));
-/* Same, but piecemeal. */
-EXTERN(void) jpeg_write_m_header
- JPP((j_compress_ptr cinfo, int marker, unsigned int datalen));
-EXTERN(void) jpeg_write_m_byte
- JPP((j_compress_ptr cinfo, int val));
-
-/* Alternate compression function: just write an abbreviated table file */
-EXTERN(void) jpeg_write_tables JPP((j_compress_ptr cinfo));
-
-/* Decompression startup: read start of JPEG datastream to see what's there */
-EXTERN(int) jpeg_read_header JPP((j_decompress_ptr cinfo,
- boolean require_image));
-/* Return value is one of: */
-#define JPEG_SUSPENDED 0 /* Suspended due to lack of input data */
-#define JPEG_HEADER_OK 1 /* Found valid image datastream */
-#define JPEG_HEADER_TABLES_ONLY 2 /* Found valid table-specs-only datastream */
-/* If you pass require_image = TRUE (normal case), you need not check for
- * a TABLES_ONLY return code; an abbreviated file will cause an error exit.
- * JPEG_SUSPENDED is only possible if you use a data source module that can
- * give a suspension return (the stdio source module doesn't).
- */
-
-/* Main entry points for decompression */
-EXTERN(boolean) jpeg_start_decompress JPP((j_decompress_ptr cinfo));
-EXTERN(JDIMENSION) jpeg_read_scanlines JPP((j_decompress_ptr cinfo,
- JSAMPARRAY scanlines,
- JDIMENSION max_lines));
-EXTERN(boolean) jpeg_finish_decompress JPP((j_decompress_ptr cinfo));
-
-/* Replaces jpeg_read_scanlines when reading raw downsampled data. */
-EXTERN(JDIMENSION) jpeg_read_raw_data JPP((j_decompress_ptr cinfo,
- JSAMPIMAGE data,
- JDIMENSION max_lines));
-
-/* Additional entry points for buffered-image mode. */
-EXTERN(boolean) jpeg_has_multiple_scans JPP((j_decompress_ptr cinfo));
-EXTERN(boolean) jpeg_start_output JPP((j_decompress_ptr cinfo,
- int scan_number));
-EXTERN(boolean) jpeg_finish_output JPP((j_decompress_ptr cinfo));
-EXTERN(boolean) jpeg_input_complete JPP((j_decompress_ptr cinfo));
-EXTERN(void) jpeg_new_colormap JPP((j_decompress_ptr cinfo));
-EXTERN(int) jpeg_consume_input JPP((j_decompress_ptr cinfo));
-/* Return value is one of: */
-/* #define JPEG_SUSPENDED 0 Suspended due to lack of input data */
-#define JPEG_REACHED_SOS 1 /* Reached start of new scan */
-#define JPEG_REACHED_EOI 2 /* Reached end of image */
-#define JPEG_ROW_COMPLETED 3 /* Completed one iMCU row */
-#define JPEG_SCAN_COMPLETED 4 /* Completed last iMCU row of a scan */
-
-/* Precalculate output dimensions for current decompression parameters. */
-EXTERN(void) jpeg_calc_output_dimensions JPP((j_decompress_ptr cinfo));
-
-/* Control saving of COM and APPn markers into marker_list. */
-EXTERN(void) jpeg_save_markers
- JPP((j_decompress_ptr cinfo, int marker_code,
- unsigned int length_limit));
-
-/* Install a special processing method for COM or APPn markers. */
-EXTERN(void) jpeg_set_marker_processor
- JPP((j_decompress_ptr cinfo, int marker_code,
- jpeg_marker_parser_method routine));
-
-/* Read or write raw DCT coefficients --- useful for lossless transcoding. */
-EXTERN(jvirt_barray_ptr *) jpeg_read_coefficients JPP((j_decompress_ptr cinfo));
-EXTERN(void) jpeg_write_coefficients JPP((j_compress_ptr cinfo,
- jvirt_barray_ptr * coef_arrays));
-EXTERN(void) jpeg_copy_critical_parameters JPP((j_decompress_ptr srcinfo,
- j_compress_ptr dstinfo));
-
-/* If you choose to abort compression or decompression before completing
- * jpeg_finish_(de)compress, then you need to clean up to release memory,
- * temporary files, etc. You can just call jpeg_destroy_(de)compress
- * if you're done with the JPEG object, but if you want to clean it up and
- * reuse it, call this:
- */
-EXTERN(void) jpeg_abort_compress JPP((j_compress_ptr cinfo));
-EXTERN(void) jpeg_abort_decompress JPP((j_decompress_ptr cinfo));
-
-/* Generic versions of jpeg_abort and jpeg_destroy that work on either
- * flavor of JPEG object. These may be more convenient in some places.
- */
-EXTERN(void) jpeg_abort JPP((j_common_ptr cinfo));
-EXTERN(void) jpeg_destroy JPP((j_common_ptr cinfo));
-
-/* Default restart-marker-resync procedure for use by data source modules */
-EXTERN(boolean) jpeg_resync_to_restart JPP((j_decompress_ptr cinfo,
- int desired));
-
-
-/* These marker codes are exported since applications and data source modules
- * are likely to want to use them.
- */
-
-#define JPEG_RST0 0xD0 /* RST0 marker code */
-#define JPEG_EOI 0xD9 /* EOI marker code */
-#define JPEG_APP0 0xE0 /* APP0 marker code */
-#define JPEG_COM 0xFE /* COM marker code */
-
-
-/* If we have a brain-damaged compiler that emits warnings (or worse, errors)
- * for structure definitions that are never filled in, keep it quiet by
- * supplying dummy definitions for the various substructures.
- */
-
-#ifdef INCOMPLETE_TYPES_BROKEN
-#ifndef JPEG_INTERNALS /* will be defined in jpegint.h */
-struct jvirt_sarray_control { long dummy; };
-struct jvirt_barray_control { long dummy; };
-struct jpeg_comp_master { long dummy; };
-struct jpeg_c_main_controller { long dummy; };
-struct jpeg_c_prep_controller { long dummy; };
-struct jpeg_c_coef_controller { long dummy; };
-struct jpeg_marker_writer { long dummy; };
-struct jpeg_color_converter { long dummy; };
-struct jpeg_downsampler { long dummy; };
-struct jpeg_forward_dct { long dummy; };
-struct jpeg_entropy_encoder { long dummy; };
-struct jpeg_decomp_master { long dummy; };
-struct jpeg_d_main_controller { long dummy; };
-struct jpeg_d_coef_controller { long dummy; };
-struct jpeg_d_post_controller { long dummy; };
-struct jpeg_input_controller { long dummy; };
-struct jpeg_marker_reader { long dummy; };
-struct jpeg_entropy_decoder { long dummy; };
-struct jpeg_inverse_dct { long dummy; };
-struct jpeg_upsampler { long dummy; };
-struct jpeg_color_deconverter { long dummy; };
-struct jpeg_color_quantizer { long dummy; };
-#endif /* JPEG_INTERNALS */
-#endif /* INCOMPLETE_TYPES_BROKEN */
-
-
-/*
- * The JPEG library modules define JPEG_INTERNALS before including this file.
- * The internal structure declarations are read only when that is true.
- * Applications using the library should not include jpegint.h, but may wish
- * to include jerror.h.
- */
-
-#ifdef JPEG_INTERNALS
-#include "jpegint.h" /* fetch private declarations */
-#include "jerror.h" /* fetch error codes too */
-#endif
-
-#endif /* JPEGLIB_H */
+/*
+ * jpeglib.h
+ *
+ * Copyright (C) 1991-1998, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file defines the application interface for the JPEG library.
+ * Most applications using the library need only include this file,
+ * and perhaps jerror.h if they want to know the exact error codes.
+ */
+
+#ifndef JPEGLIB_H
+#define JPEGLIB_H
+
+#define FOXIT_PREFIX(origName) FPDFAPIJPEG_##origName
+
+#define jcopy_block_row FOXIT_PREFIX(jcopy_block_row)
+#define jcopy_sample_rows FOXIT_PREFIX(jcopy_sample_rows)
+#define jdiv_round_up FOXIT_PREFIX(jdiv_round_up)
+#define jinit_1pass_quantizer FOXIT_PREFIX(jinit_1pass_quantizer)
+#define jinit_2pass_quantizer FOXIT_PREFIX(jinit_2pass_quantizer)
+#define jinit_color_deconverter FOXIT_PREFIX(jinit_color_deconverter)
+#define jinit_d_coef_controller FOXIT_PREFIX(jinit_d_coef_controller)
+#define jinit_d_main_controller FOXIT_PREFIX(jinit_d_main_controller)
+#define jinit_d_post_controller FOXIT_PREFIX(jinit_d_post_controller)
+#define jinit_huff_decoder FOXIT_PREFIX(jinit_huff_decoder)
+#define jinit_input_controller FOXIT_PREFIX(jinit_input_controller)
+#define jinit_inverse_dct FOXIT_PREFIX(jinit_inverse_dct)
+#define jinit_marker_reader FOXIT_PREFIX(jinit_marker_reader)
+#define jinit_master_decompress FOXIT_PREFIX(jinit_master_decompress)
+#define jinit_memory_mgr FOXIT_PREFIX(jinit_memory_mgr)
+#define jinit_merged_upsampler FOXIT_PREFIX(jinit_merged_upsampler)
+#define jinit_phuff_decoder FOXIT_PREFIX(jinit_phuff_decoder)
+#define jinit_upsampler FOXIT_PREFIX(jinit_upsampler)
+#define jpeg_CreateDecompress FOXIT_PREFIX(jpeg_CreateDecompress)
+#define jpeg_abort FOXIT_PREFIX(jpeg_abort)
+#define jpeg_abort_decompress FOXIT_PREFIX(jpeg_abort_decompress)
+#define jpeg_alloc_huff_table FOXIT_PREFIX(jpeg_alloc_huff_table)
+#define jpeg_alloc_quant_table FOXIT_PREFIX(jpeg_alloc_quant_table)
+#define jpeg_calc_output_dimensions FOXIT_PREFIX(jpeg_calc_output_dimensions)
+#define jpeg_consume_input FOXIT_PREFIX(jpeg_consume_input)
+#define jpeg_destroy FOXIT_PREFIX(jpeg_destroy)
+#define jpeg_destroy_decompress FOXIT_PREFIX(jpeg_destroy_decompress)
+#define jpeg_fill_bit_buffer FOXIT_PREFIX(jpeg_fill_bit_buffer)
+#define jpeg_finish_decompress FOXIT_PREFIX(jpeg_finish_decompress)
+#define jpeg_finish_output FOXIT_PREFIX(jpeg_finish_output)
+#define jpeg_free_large FOXIT_PREFIX(jpeg_free_large)
+#define jpeg_free_small FOXIT_PREFIX(jpeg_free_small)
+#define jpeg_get_large FOXIT_PREFIX(jpeg_get_large)
+#define jpeg_get_small FOXIT_PREFIX(jpeg_get_small)
+#define jpeg_has_multiple_scans FOXIT_PREFIX(jpeg_has_multiple_scans)
+#define jpeg_huff_decode FOXIT_PREFIX(jpeg_huff_decode)
+#define jpeg_idct_1x1 FOXIT_PREFIX(jpeg_idct_1x1)
+#define jpeg_idct_2x2 FOXIT_PREFIX(jpeg_idct_2x2)
+#define jpeg_idct_4x4 FOXIT_PREFIX(jpeg_idct_4x4)
+#define jpeg_idct_float FOXIT_PREFIX(jpeg_idct_float)
+#define jpeg_idct_ifast FOXIT_PREFIX(jpeg_idct_ifast)
+#define jpeg_idct_islow FOXIT_PREFIX(jpeg_idct_islow)
+#define jpeg_input_complete FOXIT_PREFIX(jpeg_input_complete)
+#define jpeg_make_d_derived_tbl FOXIT_PREFIX(jpeg_make_d_derived_tbl)
+#define jpeg_mem_available FOXIT_PREFIX(jpeg_mem_available)
+#define jpeg_mem_init FOXIT_PREFIX(jpeg_mem_init)
+#define jpeg_mem_term FOXIT_PREFIX(jpeg_mem_term)
+#define jpeg_natural_order FOXIT_PREFIX(jpeg_natural_order)
+#define jpeg_new_colormap FOXIT_PREFIX(jpeg_new_colormap)
+#define jpeg_open_backing_store FOXIT_PREFIX(jpeg_open_backing_store)
+#define jpeg_read_coefficients FOXIT_PREFIX(jpeg_read_coefficients)
+#define jpeg_read_header FOXIT_PREFIX(jpeg_read_header)
+#define jpeg_read_raw_data FOXIT_PREFIX(jpeg_read_raw_data)
+#define jpeg_read_scanlines FOXIT_PREFIX(jpeg_read_scanlines)
+#define jpeg_resync_to_restart FOXIT_PREFIX(jpeg_resync_to_restart)
+#define jpeg_save_markers FOXIT_PREFIX(jpeg_save_markers)
+#define jpeg_set_marker_processor FOXIT_PREFIX(jpeg_set_marker_processor)
+#define jpeg_start_decompress FOXIT_PREFIX(jpeg_start_decompress)
+#define jpeg_start_output FOXIT_PREFIX(jpeg_start_output)
+#define jpeg_std_error FOXIT_PREFIX(jpeg_std_error)
+#define jpeg_std_message_table FOXIT_PREFIX(jpeg_std_message_table)
+#define jpeg_stdio_src FOXIT_PREFIX(jpeg_stdio_src)
+#define jround_up FOXIT_PREFIX(jround_up)
+#define jzero_far FOXIT_PREFIX(jzero_far)
+
+ /*
+ * First we include the configuration files that record how this
+ * installation of the JPEG library is set up. jconfig.h can be
+ * generated automatically for many systems. jmorecfg.h contains
+ * manual configuration options that most people need not worry about.
+ */
+
+#ifndef JCONFIG_INCLUDED /* in case jinclude.h already did */
+#include "jconfig.h" /* widely used configuration options */
+#endif
+#include "jmorecfg.h" /* seldom changed options */
+
+
+/* Version ID for the JPEG library.
+ * Might be useful for tests like "#if JPEG_LIB_VERSION >= 60".
+ */
+
+#define JPEG_LIB_VERSION 62 /* Version 6b */
+
+
+/* Various constants determining the sizes of things.
+ * All of these are specified by the JPEG standard, so don't change them
+ * if you want to be compatible.
+ */
+
+#define DCTSIZE 8 /* The basic DCT block is 8x8 samples */
+#define DCTSIZE2 64 /* DCTSIZE squared; # of elements in a block */
+#define NUM_QUANT_TBLS 4 /* Quantization tables are numbered 0..3 */
+#define NUM_HUFF_TBLS 4 /* Huffman tables are numbered 0..3 */
+#define NUM_ARITH_TBLS 16 /* Arith-coding tables are numbered 0..15 */
+#define MAX_COMPS_IN_SCAN 4 /* JPEG limit on # of components in one scan */
+#define MAX_SAMP_FACTOR 4 /* JPEG limit on sampling factors */
+/* Unfortunately, some bozo at Adobe saw no reason to be bound by the standard;
+ * the PostScript DCT filter can emit files with many more than 10 blocks/MCU.
+ * If you happen to run across such a file, you can up D_MAX_BLOCKS_IN_MCU
+ * to handle it. We even let you do this from the jconfig.h file. However,
+ * we strongly discourage changing C_MAX_BLOCKS_IN_MCU; just because Adobe
+ * sometimes emits noncompliant files doesn't mean you should too.
+ */
+#define C_MAX_BLOCKS_IN_MCU 10 /* compressor's limit on blocks per MCU */
+#ifndef D_MAX_BLOCKS_IN_MCU
+#define D_MAX_BLOCKS_IN_MCU 10 /* decompressor's limit on blocks per MCU */
+#endif
+
+
+/* Data structures for images (arrays of samples and of DCT coefficients).
+ * On 80x86 machines, the image arrays are too big for near pointers,
+ * but the pointer arrays can fit in near memory.
+ */
+
+typedef JSAMPLE *JSAMPROW; /* ptr to one image row of pixel samples. */
+typedef JSAMPROW *JSAMPARRAY; /* ptr to some rows (a 2-D sample array) */
+typedef JSAMPARRAY *JSAMPIMAGE; /* a 3-D sample array: top index is color */
+
+typedef JCOEF JBLOCK[DCTSIZE2]; /* one block of coefficients */
+typedef JBLOCK *JBLOCKROW; /* pointer to one row of coefficient blocks */
+typedef JBLOCKROW *JBLOCKARRAY; /* a 2-D array of coefficient blocks */
+typedef JBLOCKARRAY *JBLOCKIMAGE; /* a 3-D array of coefficient blocks */
+
+typedef JCOEF *JCOEFPTR; /* useful in a couple of places */
+
+
+/* Types for JPEG compression parameters and working tables. */
+
+
+/* DCT coefficient quantization tables. */
+
+typedef struct {
+ /* This array gives the coefficient quantizers in natural array order
+ * (not the zigzag order in which they are stored in a JPEG DQT marker).
+ * CAUTION: IJG versions prior to v6a kept this array in zigzag order.
+ */
+ UINT16 quantval[DCTSIZE2]; /* quantization step for each coefficient */
+ /* This field is used only during compression. It's initialized FALSE when
+ * the table is created, and set TRUE when it's been output to the file.
+ * You could suppress output of a table by setting this to TRUE.
+ * (See jpeg_suppress_tables for an example.)
+ */
+ boolean sent_table; /* TRUE when table has been output */
+} JQUANT_TBL;
+
+
+/* Huffman coding tables. */
+
+typedef struct {
+ /* These two fields directly represent the contents of a JPEG DHT marker */
+ UINT8 bits[17]; /* bits[k] = # of symbols with codes of */
+ /* length k bits; bits[0] is unused */
+ UINT8 huffval[256]; /* The symbols, in order of incr code length */
+ /* This field is used only during compression. It's initialized FALSE when
+ * the table is created, and set TRUE when it's been output to the file.
+ * You could suppress output of a table by setting this to TRUE.
+ * (See jpeg_suppress_tables for an example.)
+ */
+ boolean sent_table; /* TRUE when table has been output */
+} JHUFF_TBL;
+
+
+/* Basic info about one component (color channel). */
+
+typedef struct {
+ /* These values are fixed over the whole image. */
+ /* For compression, they must be supplied by parameter setup; */
+ /* for decompression, they are read from the SOF marker. */
+ int component_id; /* identifier for this component (0..255) */
+ int component_index; /* its index in SOF or cinfo->comp_info[] */
+ int h_samp_factor; /* horizontal sampling factor (1..4) */
+ int v_samp_factor; /* vertical sampling factor (1..4) */
+ int quant_tbl_no; /* quantization table selector (0..3) */
+ /* These values may vary between scans. */
+ /* For compression, they must be supplied by parameter setup; */
+ /* for decompression, they are read from the SOS marker. */
+ /* The decompressor output side may not use these variables. */
+ int dc_tbl_no; /* DC entropy table selector (0..3) */
+ int ac_tbl_no; /* AC entropy table selector (0..3) */
+
+ /* Remaining fields should be treated as private by applications. */
+
+ /* These values are computed during compression or decompression startup: */
+ /* Component's size in DCT blocks.
+ * Any dummy blocks added to complete an MCU are not counted; therefore
+ * these values do not depend on whether a scan is interleaved or not.
+ */
+ JDIMENSION width_in_blocks;
+ JDIMENSION height_in_blocks;
+ /* Size of a DCT block in samples. Always DCTSIZE for compression.
+ * For decompression this is the size of the output from one DCT block,
+ * reflecting any scaling we choose to apply during the IDCT step.
+ * Values of 1,2,4,8 are likely to be supported. Note that different
+ * components may receive different IDCT scalings.
+ */
+ int DCT_scaled_size;
+ /* The downsampled dimensions are the component's actual, unpadded number
+ * of samples at the main buffer (preprocessing/compression interface), thus
+ * downsampled_width = ceil(image_width * Hi/Hmax)
+ * and similarly for height. For decompression, IDCT scaling is included, so
+ * downsampled_width = ceil(image_width * Hi/Hmax * DCT_scaled_size/DCTSIZE)
+ */
+ JDIMENSION downsampled_width; /* actual width in samples */
+ JDIMENSION downsampled_height; /* actual height in samples */
+ /* This flag is used only for decompression. In cases where some of the
+ * components will be ignored (eg grayscale output from YCbCr image),
+ * we can skip most computations for the unused components.
+ */
+ boolean component_needed; /* do we need the value of this component? */
+
+ /* These values are computed before starting a scan of the component. */
+ /* The decompressor output side may not use these variables. */
+ int MCU_width; /* number of blocks per MCU, horizontally */
+ int MCU_height; /* number of blocks per MCU, vertically */
+ int MCU_blocks; /* MCU_width * MCU_height */
+ int MCU_sample_width; /* MCU width in samples, MCU_width*DCT_scaled_size */
+ int last_col_width; /* # of non-dummy blocks across in last MCU */
+ int last_row_height; /* # of non-dummy blocks down in last MCU */
+
+ /* Saved quantization table for component; NULL if none yet saved.
+ * See jdinput.c comments about the need for this information.
+ * This field is currently used only for decompression.
+ */
+ JQUANT_TBL * quant_table;
+
+ /* Private per-component storage for DCT or IDCT subsystem. */
+ void * dct_table;
+} jpeg_component_info;
+
+
+/* The script for encoding a multiple-scan file is an array of these: */
+
+typedef struct {
+ int comps_in_scan; /* number of components encoded in this scan */
+ int component_index[MAX_COMPS_IN_SCAN]; /* their SOF/comp_info[] indexes */
+ int Ss, Se; /* progressive JPEG spectral selection parms */
+ int Ah, Al; /* progressive JPEG successive approx. parms */
+} jpeg_scan_info;
+
+/* The decompressor can save APPn and COM markers in a list of these: */
+
+typedef struct jpeg_marker_struct * jpeg_saved_marker_ptr;
+
+struct jpeg_marker_struct {
+ jpeg_saved_marker_ptr next; /* next in list, or NULL */
+ UINT8 marker; /* marker code: JPEG_COM, or JPEG_APP0+n */
+ unsigned int original_length; /* # bytes of data in the file */
+ unsigned int data_length; /* # bytes of data saved at data[] */
+ JOCTET * data; /* the data contained in the marker */
+ /* the marker length word is not counted in data_length or original_length */
+};
+
+/* Known color spaces. */
+
+typedef enum {
+ JCS_UNKNOWN, /* error/unspecified */
+ JCS_GRAYSCALE, /* monochrome */
+ JCS_RGB, /* red/green/blue */
+ JCS_YCbCr, /* Y/Cb/Cr (also known as YUV) */
+ JCS_CMYK, /* C/M/Y/K */
+ JCS_YCCK /* Y/Cb/Cr/K */
+} J_COLOR_SPACE;
+
+/* DCT/IDCT algorithm options. */
+
+typedef enum {
+ JDCT_ISLOW, /* slow but accurate integer algorithm */
+ JDCT_IFAST, /* faster, less accurate integer method */
+ JDCT_FLOAT /* floating-point: accurate, fast on fast HW */
+} J_DCT_METHOD;
+
+#ifndef JDCT_DEFAULT /* may be overridden in jconfig.h */
+#define JDCT_DEFAULT JDCT_ISLOW
+#endif
+#ifndef JDCT_FASTEST /* may be overridden in jconfig.h */
+#define JDCT_FASTEST JDCT_IFAST
+#endif
+
+/* Dithering options for decompression. */
+
+typedef enum {
+ JDITHER_NONE, /* no dithering */
+ JDITHER_ORDERED, /* simple ordered dither */
+ JDITHER_FS /* Floyd-Steinberg error diffusion dither */
+} J_DITHER_MODE;
+
+
+/* Common fields between JPEG compression and decompression master structs. */
+
+#define jpeg_common_fields \
+ struct jpeg_error_mgr * err; /* Error handler module */\
+ struct jpeg_memory_mgr * mem; /* Memory manager module */\
+ struct jpeg_progress_mgr * progress; /* Progress monitor, or NULL if none */\
+ void * client_data; /* Available for use by application */\
+ boolean is_decompressor; /* So common code can tell which is which */\
+ int global_state /* For checking call sequence validity */
+
+/* Routines that are to be used by both halves of the library are declared
+ * to receive a pointer to this structure. There are no actual instances of
+ * jpeg_common_struct, only of jpeg_compress_struct and jpeg_decompress_struct.
+ */
+struct jpeg_common_struct {
+ jpeg_common_fields; /* Fields common to both master struct types */
+ /* Additional fields follow in an actual jpeg_compress_struct or
+ * jpeg_decompress_struct. All three structs must agree on these
+ * initial fields! (This would be a lot cleaner in C++.)
+ */
+};
+
+typedef struct jpeg_common_struct * j_common_ptr;
+typedef struct jpeg_compress_struct * j_compress_ptr;
+typedef struct jpeg_decompress_struct * j_decompress_ptr;
+
+
+/* Master record for a compression instance */
+
+struct jpeg_compress_struct {
+ jpeg_common_fields; /* Fields shared with jpeg_decompress_struct */
+
+ /* Destination for compressed data */
+ struct jpeg_destination_mgr * dest;
+
+ /* Description of source image --- these fields must be filled in by
+ * outer application before starting compression. in_color_space must
+ * be correct before you can even call jpeg_set_defaults().
+ */
+
+ JDIMENSION image_width; /* input image width */
+ JDIMENSION image_height; /* input image height */
+ int input_components; /* # of color components in input image */
+ J_COLOR_SPACE in_color_space; /* colorspace of input image */
+
+ double input_gamma; /* image gamma of input image */
+
+ /* Compression parameters --- these fields must be set before calling
+ * jpeg_start_compress(). We recommend calling jpeg_set_defaults() to
+ * initialize everything to reasonable defaults, then changing anything
+ * the application specifically wants to change. That way you won't get
+ * burnt when new parameters are added. Also note that there are several
+ * helper routines to simplify changing parameters.
+ */
+
+ int data_precision; /* bits of precision in image data */
+
+ int num_components; /* # of color components in JPEG image */
+ J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */
+
+ jpeg_component_info * comp_info;
+ /* comp_info[i] describes component that appears i'th in SOF */
+
+ JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS];
+ /* ptrs to coefficient quantization tables, or NULL if not defined */
+
+ JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS];
+ JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS];
+ /* ptrs to Huffman coding tables, or NULL if not defined */
+
+ UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */
+ UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */
+ UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */
+
+ int num_scans; /* # of entries in scan_info array */
+ const jpeg_scan_info * scan_info; /* script for multi-scan file, or NULL */
+ /* The default value of scan_info is NULL, which causes a single-scan
+ * sequential JPEG file to be emitted. To create a multi-scan file,
+ * set num_scans and scan_info to point to an array of scan definitions.
+ */
+
+ boolean raw_data_in; /* TRUE=caller supplies downsampled data */
+ boolean arith_code; /* TRUE=arithmetic coding, FALSE=Huffman */
+ boolean optimize_coding; /* TRUE=optimize entropy encoding parms */
+ boolean CCIR601_sampling; /* TRUE=first samples are cosited */
+ int smoothing_factor; /* 1..100, or 0 for no input smoothing */
+ J_DCT_METHOD dct_method; /* DCT algorithm selector */
+
+ /* The restart interval can be specified in absolute MCUs by setting
+ * restart_interval, or in MCU rows by setting restart_in_rows
+ * (in which case the correct restart_interval will be figured
+ * for each scan).
+ */
+ unsigned int restart_interval; /* MCUs per restart, or 0 for no restart */
+ int restart_in_rows; /* if > 0, MCU rows per restart interval */
+
+ /* Parameters controlling emission of special markers. */
+
+ boolean write_JFIF_header; /* should a JFIF marker be written? */
+ UINT8 JFIF_major_version; /* What to write for the JFIF version number */
+ UINT8 JFIF_minor_version;
+ /* These three values are not used by the JPEG code, merely copied */
+ /* into the JFIF APP0 marker. density_unit can be 0 for unknown, */
+ /* 1 for dots/inch, or 2 for dots/cm. Note that the pixel aspect */
+ /* ratio is defined by X_density/Y_density even when density_unit=0. */
+ UINT8 density_unit; /* JFIF code for pixel size units */
+ UINT16 X_density; /* Horizontal pixel density */
+ UINT16 Y_density; /* Vertical pixel density */
+ boolean write_Adobe_marker; /* should an Adobe marker be written? */
+
+ /* State variable: index of next scanline to be written to
+ * jpeg_write_scanlines(). Application may use this to control its
+ * processing loop, e.g., "while (next_scanline < image_height)".
+ */
+
+ JDIMENSION next_scanline; /* 0 .. image_height-1 */
+
+ /* Remaining fields are known throughout compressor, but generally
+ * should not be touched by a surrounding application.
+ */
+
+ /*
+ * These fields are computed during compression startup
+ */
+ boolean progressive_mode; /* TRUE if scan script uses progressive mode */
+ int max_h_samp_factor; /* largest h_samp_factor */
+ int max_v_samp_factor; /* largest v_samp_factor */
+
+ JDIMENSION total_iMCU_rows; /* # of iMCU rows to be input to coef ctlr */
+ /* The coefficient controller receives data in units of MCU rows as defined
+ * for fully interleaved scans (whether the JPEG file is interleaved or not).
+ * There are v_samp_factor * DCTSIZE sample rows of each component in an
+ * "iMCU" (interleaved MCU) row.
+ */
+
+ /*
+ * These fields are valid during any one scan.
+ * They describe the components and MCUs actually appearing in the scan.
+ */
+ int comps_in_scan; /* # of JPEG components in this scan */
+ jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN];
+ /* *cur_comp_info[i] describes component that appears i'th in SOS */
+
+ JDIMENSION MCUs_per_row; /* # of MCUs across the image */
+ JDIMENSION MCU_rows_in_scan; /* # of MCU rows in the image */
+
+ int blocks_in_MCU; /* # of DCT blocks per MCU */
+ int MCU_membership[C_MAX_BLOCKS_IN_MCU];
+ /* MCU_membership[i] is index in cur_comp_info of component owning */
+ /* i'th block in an MCU */
+
+ int Ss, Se, Ah, Al; /* progressive JPEG parameters for scan */
+
+ /*
+ * Links to compression subobjects (methods and private variables of modules)
+ */
+ struct jpeg_comp_master * master;
+ struct jpeg_c_main_controller * main;
+ struct jpeg_c_prep_controller * prep;
+ struct jpeg_c_coef_controller * coef;
+ struct jpeg_marker_writer * marker;
+ struct jpeg_color_converter * cconvert;
+ struct jpeg_downsampler * downsample;
+ struct jpeg_forward_dct * fdct;
+ struct jpeg_entropy_encoder * entropy;
+ jpeg_scan_info * script_space; /* workspace for jpeg_simple_progression */
+ int script_space_size;
+};
+
+
+/* Master record for a decompression instance */
+
+struct jpeg_decompress_struct {
+ jpeg_common_fields; /* Fields shared with jpeg_compress_struct */
+
+ /* Source of compressed data */
+ struct jpeg_source_mgr * src;
+
+ /* Basic description of image --- filled in by jpeg_read_header(). */
+ /* Application may inspect these values to decide how to process image. */
+
+ JDIMENSION image_width; /* nominal image width (from SOF marker) */
+ JDIMENSION image_height; /* nominal image height */
+ int num_components; /* # of color components in JPEG image */
+ J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */
+
+ /* Decompression processing parameters --- these fields must be set before
+ * calling jpeg_start_decompress(). Note that jpeg_read_header() initializes
+ * them to default values.
+ */
+
+ J_COLOR_SPACE out_color_space; /* colorspace for output */
+
+ unsigned int scale_num, scale_denom; /* fraction by which to scale image */
+
+ double output_gamma; /* image gamma wanted in output */
+
+ boolean buffered_image; /* TRUE=multiple output passes */
+ boolean raw_data_out; /* TRUE=downsampled data wanted */
+
+ J_DCT_METHOD dct_method; /* IDCT algorithm selector */
+ boolean do_fancy_upsampling; /* TRUE=apply fancy upsampling */
+ boolean do_block_smoothing; /* TRUE=apply interblock smoothing */
+
+ boolean quantize_colors; /* TRUE=colormapped output wanted */
+ /* the following are ignored if not quantize_colors: */
+ J_DITHER_MODE dither_mode; /* type of color dithering to use */
+ boolean two_pass_quantize; /* TRUE=use two-pass color quantization */
+ int desired_number_of_colors; /* max # colors to use in created colormap */
+ /* these are significant only in buffered-image mode: */
+ boolean enable_1pass_quant; /* enable future use of 1-pass quantizer */
+ boolean enable_external_quant;/* enable future use of external colormap */
+ boolean enable_2pass_quant; /* enable future use of 2-pass quantizer */
+
+ /* Description of actual output image that will be returned to application.
+ * These fields are computed by jpeg_start_decompress().
+ * You can also use jpeg_calc_output_dimensions() to determine these values
+ * in advance of calling jpeg_start_decompress().
+ */
+
+ JDIMENSION output_width; /* scaled image width */
+ JDIMENSION output_height; /* scaled image height */
+ int out_color_components; /* # of color components in out_color_space */
+ int output_components; /* # of color components returned */
+ /* output_components is 1 (a colormap index) when quantizing colors;
+ * otherwise it equals out_color_components.
+ */
+ int rec_outbuf_height; /* min recommended height of scanline buffer */
+ /* If the buffer passed to jpeg_read_scanlines() is less than this many rows
+ * high, space and time will be wasted due to unnecessary data copying.
+ * Usually rec_outbuf_height will be 1 or 2, at most 4.
+ */
+
+ /* When quantizing colors, the output colormap is described by these fields.
+ * The application can supply a colormap by setting colormap non-NULL before
+ * calling jpeg_start_decompress; otherwise a colormap is created during
+ * jpeg_start_decompress or jpeg_start_output.
+ * The map has out_color_components rows and actual_number_of_colors columns.
+ */
+ int actual_number_of_colors; /* number of entries in use */
+ JSAMPARRAY colormap; /* The color map as a 2-D pixel array */
+
+ /* State variables: these variables indicate the progress of decompression.
+ * The application may examine these but must not modify them.
+ */
+
+ /* Row index of next scanline to be read from jpeg_read_scanlines().
+ * Application may use this to control its processing loop, e.g.,
+ * "while (output_scanline < output_height)".
+ */
+ JDIMENSION output_scanline; /* 0 .. output_height-1 */
+
+ /* Current input scan number and number of iMCU rows completed in scan.
+ * These indicate the progress of the decompressor input side.
+ */
+ int input_scan_number; /* Number of SOS markers seen so far */
+ JDIMENSION input_iMCU_row; /* Number of iMCU rows completed */
+
+ /* The "output scan number" is the notional scan being displayed by the
+ * output side. The decompressor will not allow output scan/row number
+ * to get ahead of input scan/row, but it can fall arbitrarily far behind.
+ */
+ int output_scan_number; /* Nominal scan number being displayed */
+ JDIMENSION output_iMCU_row; /* Number of iMCU rows read */
+
+ /* Current progression status. coef_bits[c][i] indicates the precision
+ * with which component c's DCT coefficient i (in zigzag order) is known.
+ * It is -1 when no data has yet been received, otherwise it is the point
+ * transform (shift) value for the most recent scan of the coefficient
+ * (thus, 0 at completion of the progression).
+ * This pointer is NULL when reading a non-progressive file.
+ */
+ int (*coef_bits)[DCTSIZE2]; /* -1 or current Al value for each coef */
+
+ /* Internal JPEG parameters --- the application usually need not look at
+ * these fields. Note that the decompressor output side may not use
+ * any parameters that can change between scans.
+ */
+
+ /* Quantization and Huffman tables are carried forward across input
+ * datastreams when processing abbreviated JPEG datastreams.
+ */
+
+ JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS];
+ /* ptrs to coefficient quantization tables, or NULL if not defined */
+
+ JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS];
+ JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS];
+ /* ptrs to Huffman coding tables, or NULL if not defined */
+
+ /* These parameters are never carried across datastreams, since they
+ * are given in SOF/SOS markers or defined to be reset by SOI.
+ */
+
+ int data_precision; /* bits of precision in image data */
+
+ jpeg_component_info * comp_info;
+ /* comp_info[i] describes component that appears i'th in SOF */
+
+ boolean progressive_mode; /* TRUE if SOFn specifies progressive mode */
+ boolean arith_code; /* TRUE=arithmetic coding, FALSE=Huffman */
+
+ UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */
+ UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */
+ UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */
+
+ unsigned int restart_interval; /* MCUs per restart interval, or 0 for no restart */
+
+ /* These fields record data obtained from optional markers recognized by
+ * the JPEG library.
+ */
+ boolean saw_JFIF_marker; /* TRUE iff a JFIF APP0 marker was found */
+ /* Data copied from JFIF marker; only valid if saw_JFIF_marker is TRUE: */
+ UINT8 JFIF_major_version; /* JFIF version number */
+ UINT8 JFIF_minor_version;
+ UINT8 density_unit; /* JFIF code for pixel size units */
+ UINT16 X_density; /* Horizontal pixel density */
+ UINT16 Y_density; /* Vertical pixel density */
+ boolean saw_Adobe_marker; /* TRUE iff an Adobe APP14 marker was found */
+ UINT8 Adobe_transform; /* Color transform code from Adobe marker */
+
+ boolean CCIR601_sampling; /* TRUE=first samples are cosited */
+
+ /* Aside from the specific data retained from APPn markers known to the
+ * library, the uninterpreted contents of any or all APPn and COM markers
+ * can be saved in a list for examination by the application.
+ */
+ jpeg_saved_marker_ptr marker_list; /* Head of list of saved markers */
+
+ /* Remaining fields are known throughout decompressor, but generally
+ * should not be touched by a surrounding application.
+ */
+
+ /*
+ * These fields are computed during decompression startup
+ */
+ int max_h_samp_factor; /* largest h_samp_factor */
+ int max_v_samp_factor; /* largest v_samp_factor */
+
+ int min_DCT_scaled_size; /* smallest DCT_scaled_size of any component */
+
+ JDIMENSION total_iMCU_rows; /* # of iMCU rows in image */
+ /* The coefficient controller's input and output progress is measured in
+ * units of "iMCU" (interleaved MCU) rows. These are the same as MCU rows
+ * in fully interleaved JPEG scans, but are used whether the scan is
+ * interleaved or not. We define an iMCU row as v_samp_factor DCT block
+ * rows of each component. Therefore, the IDCT output contains
+ * v_samp_factor*DCT_scaled_size sample rows of a component per iMCU row.
+ */
+
+ JSAMPLE * sample_range_limit; /* table for fast range-limiting */
+
+ /*
+ * These fields are valid during any one scan.
+ * They describe the components and MCUs actually appearing in the scan.
+ * Note that the decompressor output side must not use these fields.
+ */
+ int comps_in_scan; /* # of JPEG components in this scan */
+ jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN];
+ /* *cur_comp_info[i] describes component that appears i'th in SOS */
+
+ JDIMENSION MCUs_per_row; /* # of MCUs across the image */
+ JDIMENSION MCU_rows_in_scan; /* # of MCU rows in the image */
+
+ int blocks_in_MCU; /* # of DCT blocks per MCU */
+ int MCU_membership[D_MAX_BLOCKS_IN_MCU];
+ /* MCU_membership[i] is index in cur_comp_info of component owning */
+ /* i'th block in an MCU */
+
+ int Ss, Se, Ah, Al; /* progressive JPEG parameters for scan */
+
+ /* This field is shared between entropy decoder and marker parser.
+ * It is either zero or the code of a JPEG marker that has been
+ * read from the data source, but has not yet been processed.
+ */
+ int unread_marker;
+
+ /*
+ * Links to decompression subobjects (methods, private variables of modules)
+ */
+ struct jpeg_decomp_master * master;
+ struct jpeg_d_main_controller * main;
+ struct jpeg_d_coef_controller * coef;
+ struct jpeg_d_post_controller * post;
+ struct jpeg_input_controller * inputctl;
+ struct jpeg_marker_reader * marker;
+ struct jpeg_entropy_decoder * entropy;
+ struct jpeg_inverse_dct * idct;
+ struct jpeg_upsampler * upsample;
+ struct jpeg_color_deconverter * cconvert;
+ struct jpeg_color_quantizer * cquantize;
+};
+
+
+/* "Object" declarations for JPEG modules that may be supplied or called
+ * directly by the surrounding application.
+ * As with all objects in the JPEG library, these structs only define the
+ * publicly visible methods and state variables of a module. Additional
+ * private fields may exist after the public ones.
+ */
+
+
+/* Error handler object */
+
+struct jpeg_error_mgr {
+ /* Error exit handler: does not return to caller */
+ JMETHOD(void, error_exit, (j_common_ptr cinfo));
+ /* Conditionally emit a trace or warning message */
+ JMETHOD(void, emit_message, (j_common_ptr cinfo, int msg_level));
+ /* Routine that actually outputs a trace or error message */
+ JMETHOD(void, output_message, (j_common_ptr cinfo));
+ /* Format a message string for the most recent JPEG error or message */
+ JMETHOD(void, format_message, (j_common_ptr cinfo, char * buffer));
+#define JMSG_LENGTH_MAX 200 /* recommended size of format_message buffer */
+ /* Reset error state variables at start of a new image */
+ JMETHOD(void, reset_error_mgr, (j_common_ptr cinfo));
+
+ /* The message ID code and any parameters are saved here.
+ * A message can have one string parameter or up to 8 int parameters.
+ */
+ int msg_code;
+#define JMSG_STR_PARM_MAX 80
+ union {
+ int i[8];
+ char s[JMSG_STR_PARM_MAX];
+ } msg_parm;
+
+ /* Standard state variables for error facility */
+
+ int trace_level; /* max msg_level that will be displayed */
+
+ /* For recoverable corrupt-data errors, we emit a warning message,
+ * but keep going unless emit_message chooses to abort. emit_message
+ * should count warnings in num_warnings. The surrounding application
+ * can check for bad data by seeing if num_warnings is nonzero at the
+ * end of processing.
+ */
+ long num_warnings; /* number of corrupt-data warnings */
+
+ /* These fields point to the table(s) of error message strings.
+ * An application can change the table pointer to switch to a different
+ * message list (typically, to change the language in which errors are
+ * reported). Some applications may wish to add additional error codes
+ * that will be handled by the JPEG library error mechanism; the second
+ * table pointer is used for this purpose.
+ *
+ * First table includes all errors generated by JPEG library itself.
+ * Error code 0 is reserved for a "no such error string" message.
+ */
+ const char * const * jpeg_message_table; /* Library errors */
+ int last_jpeg_message; /* Table contains strings 0..last_jpeg_message */
+ /* Second table can be added by application (see cjpeg/djpeg for example).
+ * It contains strings numbered first_addon_message..last_addon_message.
+ */
+ const char * const * addon_message_table; /* Non-library errors */
+ int first_addon_message; /* code for first string in addon table */
+ int last_addon_message; /* code for last string in addon table */
+};
+
+
+/* Progress monitor object */
+
+struct jpeg_progress_mgr {
+ JMETHOD(void, progress_monitor, (j_common_ptr cinfo));
+
+ long pass_counter; /* work units completed in this pass */
+ long pass_limit; /* total number of work units in this pass */
+ int completed_passes; /* passes completed so far */
+ int total_passes; /* total number of passes expected */
+};
+
+
+/* Data destination object for compression */
+
+struct jpeg_destination_mgr {
+ JOCTET * next_output_byte; /* => next byte to write in buffer */
+ size_t free_in_buffer; /* # of byte spaces remaining in buffer */
+
+ JMETHOD(void, init_destination, (j_compress_ptr cinfo));
+ JMETHOD(boolean, empty_output_buffer, (j_compress_ptr cinfo));
+ JMETHOD(void, term_destination, (j_compress_ptr cinfo));
+};
+
+
+/* Data source object for decompression */
+
+struct jpeg_source_mgr {
+ const JOCTET * next_input_byte; /* => next byte to read from buffer */
+ size_t bytes_in_buffer; /* # of bytes remaining in buffer */
+
+ JMETHOD(void, init_source, (j_decompress_ptr cinfo));
+ JMETHOD(boolean, fill_input_buffer, (j_decompress_ptr cinfo));
+ JMETHOD(void, skip_input_data, (j_decompress_ptr cinfo, long num_bytes));
+ JMETHOD(boolean, resync_to_restart, (j_decompress_ptr cinfo, int desired));
+ JMETHOD(void, term_source, (j_decompress_ptr cinfo));
+};
+
+
+/* Memory manager object.
+ * Allocates "small" objects (a few K total), "large" objects (tens of K),
+ * and "really big" objects (virtual arrays with backing store if needed).
+ * The memory manager does not allow individual objects to be freed; rather,
+ * each created object is assigned to a pool, and whole pools can be freed
+ * at once. This is faster and more convenient than remembering exactly what
+ * to free, especially where malloc()/free() are not too speedy.
+ * NB: alloc routines never return NULL. They exit to error_exit if not
+ * successful.
+ */
+
+#define JPOOL_PERMANENT 0 /* lasts until master record is destroyed */
+#define JPOOL_IMAGE 1 /* lasts until done with image/datastream */
+#define JPOOL_NUMPOOLS 2
+
+typedef struct jvirt_sarray_control * jvirt_sarray_ptr;
+typedef struct jvirt_barray_control * jvirt_barray_ptr;
+
+
+struct jpeg_memory_mgr {
+ /* Method pointers */
+ JMETHOD(void *, alloc_small, (j_common_ptr cinfo, int pool_id,
+ size_t sizeofobject));
+ JMETHOD(void *, alloc_large, (j_common_ptr cinfo, int pool_id,
+ size_t sizeofobject));
+ JMETHOD(JSAMPARRAY, alloc_sarray, (j_common_ptr cinfo, int pool_id,
+ JDIMENSION samplesperrow,
+ JDIMENSION numrows));
+ JMETHOD(JBLOCKARRAY, alloc_barray, (j_common_ptr cinfo, int pool_id,
+ JDIMENSION blocksperrow,
+ JDIMENSION numrows));
+ JMETHOD(jvirt_sarray_ptr, request_virt_sarray, (j_common_ptr cinfo,
+ int pool_id,
+ boolean pre_zero,
+ JDIMENSION samplesperrow,
+ JDIMENSION numrows,
+ JDIMENSION maxaccess));
+ JMETHOD(jvirt_barray_ptr, request_virt_barray, (j_common_ptr cinfo,
+ int pool_id,
+ boolean pre_zero,
+ JDIMENSION blocksperrow,
+ JDIMENSION numrows,
+ JDIMENSION maxaccess));
+ JMETHOD(void, realize_virt_arrays, (j_common_ptr cinfo));
+ JMETHOD(JSAMPARRAY, access_virt_sarray, (j_common_ptr cinfo,
+ jvirt_sarray_ptr ptr,
+ JDIMENSION start_row,
+ JDIMENSION num_rows,
+ boolean writable));
+ JMETHOD(JBLOCKARRAY, access_virt_barray, (j_common_ptr cinfo,
+ jvirt_barray_ptr ptr,
+ JDIMENSION start_row,
+ JDIMENSION num_rows,
+ boolean writable));
+ JMETHOD(void, free_pool, (j_common_ptr cinfo, int pool_id));
+ JMETHOD(void, self_destruct, (j_common_ptr cinfo));
+
+ /* Limit on memory allocation for this JPEG object. (Note that this is
+ * merely advisory, not a guaranteed maximum; it only affects the space
+ * used for virtual-array buffers.) May be changed by outer application
+ * after creating the JPEG object.
+ */
+ long max_memory_to_use;
+
+ /* Maximum allocation request accepted by alloc_large. */
+ long max_alloc_chunk;
+};
+
+
+/* Routine signature for application-supplied marker processing methods.
+ * Need not pass marker code since it is stored in cinfo->unread_marker.
+ */
+typedef JMETHOD(boolean, jpeg_marker_parser_method, (j_decompress_ptr cinfo));
+
+
+/* Declarations for routines called by application.
+ * The JPP macro hides prototype parameters from compilers that can't cope.
+ * Note JPP requires double parentheses.
+ */
+
+#ifdef HAVE_PROTOTYPES
+#define JPP(arglist) arglist
+#else
+#define JPP(arglist) ()
+#endif
+
+
+/* Short forms of external names for systems with brain-damaged linkers.
+ * We shorten external names to be unique in the first six letters, which
+ * is good enough for all known systems.
+ * (If your compiler itself needs names to be unique in less than 15
+ * characters, you are out of luck. Get a better compiler.)
+ */
+
+#ifdef NEED_SHORT_EXTERNAL_NAMES
+#define jpeg_std_error jStdError
+#define jpeg_CreateCompress jCreaCompress
+#define jpeg_CreateDecompress jCreaDecompress
+#define jpeg_destroy_compress jDestCompress
+#define jpeg_destroy_decompress jDestDecompress
+#define jpeg_stdio_dest jStdDest
+#define jpeg_stdio_src jStdSrc
+#define jpeg_set_defaults jSetDefaults
+#define jpeg_set_colorspace jSetColorspace
+#define jpeg_default_colorspace jDefColorspace
+#define jpeg_set_quality jSetQuality
+#define jpeg_set_linear_quality jSetLQuality
+#define jpeg_add_quant_table jAddQuantTable
+#define jpeg_quality_scaling jQualityScaling
+#define jpeg_simple_progression jSimProgress
+#define jpeg_suppress_tables jSuppressTables
+#define jpeg_alloc_quant_table jAlcQTable
+#define jpeg_alloc_huff_table jAlcHTable
+#define jpeg_start_compress jStrtCompress
+#define jpeg_write_scanlines jWrtScanlines
+#define jpeg_finish_compress jFinCompress
+#define jpeg_write_raw_data jWrtRawData
+#define jpeg_write_marker jWrtMarker
+#define jpeg_write_m_header jWrtMHeader
+#define jpeg_write_m_byte jWrtMByte
+#define jpeg_write_tables jWrtTables
+#define jpeg_read_header jReadHeader
+#define jpeg_start_decompress jStrtDecompress
+#define jpeg_read_scanlines jReadScanlines
+#define jpeg_finish_decompress jFinDecompress
+#define jpeg_read_raw_data jReadRawData
+#define jpeg_has_multiple_scans jHasMultScn
+#define jpeg_start_output jStrtOutput
+#define jpeg_finish_output jFinOutput
+#define jpeg_input_complete jInComplete
+#define jpeg_new_colormap jNewCMap
+#define jpeg_consume_input jConsumeInput
+#define jpeg_calc_output_dimensions jCalcDimensions
+#define jpeg_save_markers jSaveMarkers
+#define jpeg_set_marker_processor jSetMarker
+#define jpeg_read_coefficients jReadCoefs
+#define jpeg_write_coefficients jWrtCoefs
+#define jpeg_copy_critical_parameters jCopyCrit
+#define jpeg_abort_compress jAbrtCompress
+#define jpeg_abort_decompress jAbrtDecompress
+#define jpeg_abort jAbort
+#define jpeg_destroy jDestroy
+#define jpeg_resync_to_restart jResyncRestart
+#endif /* NEED_SHORT_EXTERNAL_NAMES */
+
+
+/* Default error-management setup */
+EXTERN(struct jpeg_error_mgr *) jpeg_std_error
+ JPP((struct jpeg_error_mgr * err));
+
+/* Initialization of JPEG compression objects.
+ * jpeg_create_compress() and jpeg_create_decompress() are the exported
+ * names that applications should call. These expand to calls on
+ * jpeg_CreateCompress and jpeg_CreateDecompress with additional information
+ * passed for version mismatch checking.
+ * NB: you must set up the error-manager BEFORE calling jpeg_create_xxx.
+ */
+#define jpeg_create_compress(cinfo) \
+ jpeg_CreateCompress((cinfo), JPEG_LIB_VERSION, \
+ (size_t) sizeof(struct jpeg_compress_struct))
+#define jpeg_create_decompress(cinfo) \
+ jpeg_CreateDecompress((cinfo), JPEG_LIB_VERSION, \
+ (size_t) sizeof(struct jpeg_decompress_struct))
+EXTERN(void) jpeg_CreateCompress JPP((j_compress_ptr cinfo,
+ int version, size_t structsize));
+EXTERN(void) jpeg_CreateDecompress JPP((j_decompress_ptr cinfo,
+ int version, size_t structsize));
+/* Destruction of JPEG compression objects */
+EXTERN(void) jpeg_destroy_compress JPP((j_compress_ptr cinfo));
+EXTERN(void) jpeg_destroy_decompress JPP((j_decompress_ptr cinfo));
+
+#if 0
+/* Standard data source and destination managers: stdio streams. */
+/* Caller is responsible for opening the file before and closing after. */
+EXTERN(void) jpeg_stdio_dest JPP((j_compress_ptr cinfo, FXSYS_FILE * outfile));
+EXTERN(void) jpeg_stdio_src JPP((j_decompress_ptr cinfo, FXSYS_FILE * infile));
+#endif
+
+/* Default parameter setup for compression */
+EXTERN(void) jpeg_set_defaults JPP((j_compress_ptr cinfo));
+/* Compression parameter setup aids */
+EXTERN(void) jpeg_set_colorspace JPP((j_compress_ptr cinfo,
+ J_COLOR_SPACE colorspace));
+EXTERN(void) jpeg_default_colorspace JPP((j_compress_ptr cinfo));
+EXTERN(void) jpeg_set_quality JPP((j_compress_ptr cinfo, int quality,
+ boolean force_baseline));
+EXTERN(void) jpeg_set_linear_quality JPP((j_compress_ptr cinfo,
+ int scale_factor,
+ boolean force_baseline));
+EXTERN(void) jpeg_add_quant_table JPP((j_compress_ptr cinfo, int which_tbl,
+ const unsigned int *basic_table,
+ int scale_factor,
+ boolean force_baseline));
+EXTERN(int) jpeg_quality_scaling JPP((int quality));
+EXTERN(void) jpeg_simple_progression JPP((j_compress_ptr cinfo));
+EXTERN(void) jpeg_suppress_tables JPP((j_compress_ptr cinfo,
+ boolean suppress));
+EXTERN(JQUANT_TBL *) jpeg_alloc_quant_table JPP((j_common_ptr cinfo));
+EXTERN(JHUFF_TBL *) jpeg_alloc_huff_table JPP((j_common_ptr cinfo));
+
+/* Main entry points for compression */
+EXTERN(void) jpeg_start_compress JPP((j_compress_ptr cinfo,
+ boolean write_all_tables));
+EXTERN(JDIMENSION) jpeg_write_scanlines JPP((j_compress_ptr cinfo,
+ JSAMPARRAY scanlines,
+ JDIMENSION num_lines));
+EXTERN(void) jpeg_finish_compress JPP((j_compress_ptr cinfo));
+
+/* Replaces jpeg_write_scanlines when writing raw downsampled data. */
+EXTERN(JDIMENSION) jpeg_write_raw_data JPP((j_compress_ptr cinfo,
+ JSAMPIMAGE data,
+ JDIMENSION num_lines));
+
+/* Write a special marker. See libjpeg.doc concerning safe usage. */
+EXTERN(void) jpeg_write_marker
+ JPP((j_compress_ptr cinfo, int marker,
+ const JOCTET * dataptr, unsigned int datalen));
+/* Same, but piecemeal. */
+EXTERN(void) jpeg_write_m_header
+ JPP((j_compress_ptr cinfo, int marker, unsigned int datalen));
+EXTERN(void) jpeg_write_m_byte
+ JPP((j_compress_ptr cinfo, int val));
+
+/* Alternate compression function: just write an abbreviated table file */
+EXTERN(void) jpeg_write_tables JPP((j_compress_ptr cinfo));
+
+/* Decompression startup: read start of JPEG datastream to see what's there */
+EXTERN(int) jpeg_read_header JPP((j_decompress_ptr cinfo,
+ boolean require_image));
+/* Return value is one of: */
+#define JPEG_SUSPENDED 0 /* Suspended due to lack of input data */
+#define JPEG_HEADER_OK 1 /* Found valid image datastream */
+#define JPEG_HEADER_TABLES_ONLY 2 /* Found valid table-specs-only datastream */
+/* If you pass require_image = TRUE (normal case), you need not check for
+ * a TABLES_ONLY return code; an abbreviated file will cause an error exit.
+ * JPEG_SUSPENDED is only possible if you use a data source module that can
+ * give a suspension return (the stdio source module doesn't).
+ */
+
+/* Main entry points for decompression */
+EXTERN(boolean) jpeg_start_decompress JPP((j_decompress_ptr cinfo));
+EXTERN(JDIMENSION) jpeg_read_scanlines JPP((j_decompress_ptr cinfo,
+ JSAMPARRAY scanlines,
+ JDIMENSION max_lines));
+EXTERN(boolean) jpeg_finish_decompress JPP((j_decompress_ptr cinfo));
+
+/* Replaces jpeg_read_scanlines when reading raw downsampled data. */
+EXTERN(JDIMENSION) jpeg_read_raw_data JPP((j_decompress_ptr cinfo,
+ JSAMPIMAGE data,
+ JDIMENSION max_lines));
+
+/* Additional entry points for buffered-image mode. */
+EXTERN(boolean) jpeg_has_multiple_scans JPP((j_decompress_ptr cinfo));
+EXTERN(boolean) jpeg_start_output JPP((j_decompress_ptr cinfo,
+ int scan_number));
+EXTERN(boolean) jpeg_finish_output JPP((j_decompress_ptr cinfo));
+EXTERN(boolean) jpeg_input_complete JPP((j_decompress_ptr cinfo));
+EXTERN(void) jpeg_new_colormap JPP((j_decompress_ptr cinfo));
+EXTERN(int) jpeg_consume_input JPP((j_decompress_ptr cinfo));
+/* Return value is one of: */
+/* #define JPEG_SUSPENDED 0 Suspended due to lack of input data */
+#define JPEG_REACHED_SOS 1 /* Reached start of new scan */
+#define JPEG_REACHED_EOI 2 /* Reached end of image */
+#define JPEG_ROW_COMPLETED 3 /* Completed one iMCU row */
+#define JPEG_SCAN_COMPLETED 4 /* Completed last iMCU row of a scan */
+
+/* Precalculate output dimensions for current decompression parameters. */
+EXTERN(void) jpeg_calc_output_dimensions JPP((j_decompress_ptr cinfo));
+
+/* Control saving of COM and APPn markers into marker_list. */
+EXTERN(void) jpeg_save_markers
+ JPP((j_decompress_ptr cinfo, int marker_code,
+ unsigned int length_limit));
+
+/* Install a special processing method for COM or APPn markers. */
+EXTERN(void) jpeg_set_marker_processor
+ JPP((j_decompress_ptr cinfo, int marker_code,
+ jpeg_marker_parser_method routine));
+
+/* Read or write raw DCT coefficients --- useful for lossless transcoding. */
+EXTERN(jvirt_barray_ptr *) jpeg_read_coefficients JPP((j_decompress_ptr cinfo));
+EXTERN(void) jpeg_write_coefficients JPP((j_compress_ptr cinfo,
+ jvirt_barray_ptr * coef_arrays));
+EXTERN(void) jpeg_copy_critical_parameters JPP((j_decompress_ptr srcinfo,
+ j_compress_ptr dstinfo));
+
+/* If you choose to abort compression or decompression before completing
+ * jpeg_finish_(de)compress, then you need to clean up to release memory,
+ * temporary files, etc. You can just call jpeg_destroy_(de)compress
+ * if you're done with the JPEG object, but if you want to clean it up and
+ * reuse it, call this:
+ */
+EXTERN(void) jpeg_abort_compress JPP((j_compress_ptr cinfo));
+EXTERN(void) jpeg_abort_decompress JPP((j_decompress_ptr cinfo));
+
+/* Generic versions of jpeg_abort and jpeg_destroy that work on either
+ * flavor of JPEG object. These may be more convenient in some places.
+ */
+EXTERN(void) jpeg_abort JPP((j_common_ptr cinfo));
+EXTERN(void) jpeg_destroy JPP((j_common_ptr cinfo));
+
+/* Default restart-marker-resync procedure for use by data source modules */
+EXTERN(boolean) jpeg_resync_to_restart JPP((j_decompress_ptr cinfo,
+ int desired));
+
+
+/* These marker codes are exported since applications and data source modules
+ * are likely to want to use them.
+ */
+
+#define JPEG_RST0 0xD0 /* RST0 marker code */
+#define JPEG_EOI 0xD9 /* EOI marker code */
+#define JPEG_APP0 0xE0 /* APP0 marker code */
+#define JPEG_COM 0xFE /* COM marker code */
+
+
+/* If we have a brain-damaged compiler that emits warnings (or worse, errors)
+ * for structure definitions that are never filled in, keep it quiet by
+ * supplying dummy definitions for the various substructures.
+ */
+
+#ifdef INCOMPLETE_TYPES_BROKEN
+#ifndef JPEG_INTERNALS /* will be defined in jpegint.h */
+struct jvirt_sarray_control { long dummy; };
+struct jvirt_barray_control { long dummy; };
+struct jpeg_comp_master { long dummy; };
+struct jpeg_c_main_controller { long dummy; };
+struct jpeg_c_prep_controller { long dummy; };
+struct jpeg_c_coef_controller { long dummy; };
+struct jpeg_marker_writer { long dummy; };
+struct jpeg_color_converter { long dummy; };
+struct jpeg_downsampler { long dummy; };
+struct jpeg_forward_dct { long dummy; };
+struct jpeg_entropy_encoder { long dummy; };
+struct jpeg_decomp_master { long dummy; };
+struct jpeg_d_main_controller { long dummy; };
+struct jpeg_d_coef_controller { long dummy; };
+struct jpeg_d_post_controller { long dummy; };
+struct jpeg_input_controller { long dummy; };
+struct jpeg_marker_reader { long dummy; };
+struct jpeg_entropy_decoder { long dummy; };
+struct jpeg_inverse_dct { long dummy; };
+struct jpeg_upsampler { long dummy; };
+struct jpeg_color_deconverter { long dummy; };
+struct jpeg_color_quantizer { long dummy; };
+#endif /* JPEG_INTERNALS */
+#endif /* INCOMPLETE_TYPES_BROKEN */
+
+
+/*
+ * The JPEG library modules define JPEG_INTERNALS before including this file.
+ * The internal structure declarations are read only when that is true.
+ * Applications using the library should not include jpegint.h, but may wish
+ * to include jerror.h.
+ */
+
+#ifdef JPEG_INTERNALS
+#include "jpegint.h" /* fetch private declarations */
+#include "jerror.h" /* fetch error codes too */
+#endif
+
+#endif /* JPEGLIB_H */
diff --git a/core/src/fxcodec/libjpeg/jversion.h b/core/src/fxcodec/libjpeg/jversion.h
index dadd453a41..6472c58d35 100644
--- a/core/src/fxcodec/libjpeg/jversion.h
+++ b/core/src/fxcodec/libjpeg/jversion.h
@@ -1,14 +1,14 @@
-/*
- * jversion.h
- *
- * Copyright (C) 1991-1998, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- * For conditions of distribution and use, see the accompanying README file.
- *
- * This file contains software version identification.
- */
-
-
-#define JVERSION "6b 27-Mar-1998"
-
-#define JCOPYRIGHT "Copyright (C) 1998, Thomas G. Lane"
+/*
+ * jversion.h
+ *
+ * Copyright (C) 1991-1998, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains software version identification.
+ */
+
+
+#define JVERSION "6b 27-Mar-1998"
+
+#define JCOPYRIGHT "Copyright (C) 1998, Thomas G. Lane"
diff --git a/core/src/fxcodec/libjpeg/transupp.h b/core/src/fxcodec/libjpeg/transupp.h
index eb0b05566a..5c2d32aff5 100644
--- a/core/src/fxcodec/libjpeg/transupp.h
+++ b/core/src/fxcodec/libjpeg/transupp.h
@@ -1,135 +1,135 @@
-/*
- * transupp.h
- *
- * Copyright (C) 1997, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- * For conditions of distribution and use, see the accompanying README file.
- *
- * This file contains declarations for image transformation routines and
- * other utility code used by the jpegtran sample application. These are
- * NOT part of the core JPEG library. But we keep these routines separate
- * from jpegtran.c to ease the task of maintaining jpegtran-like programs
- * that have other user interfaces.
- *
- * NOTE: all the routines declared here have very specific requirements
- * about when they are to be executed during the reading and writing of the
- * source and destination files. See the comments in transupp.c, or see
- * jpegtran.c for an example of correct usage.
- */
-
-/* If you happen not to want the image transform support, disable it here */
-#ifndef TRANSFORMS_SUPPORTED
-#define TRANSFORMS_SUPPORTED 1 /* 0 disables transform code */
-#endif
-
-/* Short forms of external names for systems with brain-damaged linkers. */
-
-#ifdef NEED_SHORT_EXTERNAL_NAMES
-#define jtransform_request_workspace jTrRequest
-#define jtransform_adjust_parameters jTrAdjust
-#define jtransform_execute_transformation jTrExec
-#define jcopy_markers_setup jCMrkSetup
-#define jcopy_markers_execute jCMrkExec
-#endif /* NEED_SHORT_EXTERNAL_NAMES */
-
-
-/*
- * Codes for supported types of image transformations.
- */
-
-typedef enum {
- JXFORM_NONE, /* no transformation */
- JXFORM_FLIP_H, /* horizontal flip */
- JXFORM_FLIP_V, /* vertical flip */
- JXFORM_TRANSPOSE, /* transpose across UL-to-LR axis */
- JXFORM_TRANSVERSE, /* transpose across UR-to-LL axis */
- JXFORM_ROT_90, /* 90-degree clockwise rotation */
- JXFORM_ROT_180, /* 180-degree rotation */
- JXFORM_ROT_270 /* 270-degree clockwise (or 90 ccw) */
-} JXFORM_CODE;
-
-/*
- * Although rotating and flipping data expressed as DCT coefficients is not
- * hard, there is an asymmetry in the JPEG format specification for images
- * whose dimensions aren't multiples of the iMCU size. The right and bottom
- * image edges are padded out to the next iMCU boundary with junk data; but
- * no padding is possible at the top and left edges. If we were to flip
- * the whole image including the pad data, then pad garbage would become
- * visible at the top and/or left, and real pixels would disappear into the
- * pad margins --- perhaps permanently, since encoders & decoders may not
- * bother to preserve DCT blocks that appear to be completely outside the
- * nominal image area. So, we have to exclude any partial iMCUs from the
- * basic transformation.
- *
- * Transpose is the only transformation that can handle partial iMCUs at the
- * right and bottom edges completely cleanly. flip_h can flip partial iMCUs
- * at the bottom, but leaves any partial iMCUs at the right edge untouched.
- * Similarly flip_v leaves any partial iMCUs at the bottom edge untouched.
- * The other transforms are defined as combinations of these basic transforms
- * and process edge blocks in a way that preserves the equivalence.
- *
- * The "trim" option causes untransformable partial iMCUs to be dropped;
- * this is not strictly lossless, but it usually gives the best-looking
- * result for odd-size images. Note that when this option is active,
- * the expected mathematical equivalences between the transforms may not hold.
- * (For example, -rot 270 -trim trims only the bottom edge, but -rot 90 -trim
- * followed by -rot 180 -trim trims both edges.)
- *
- * We also offer a "force to grayscale" option, which simply discards the
- * chrominance channels of a YCbCr image. This is lossless in the sense that
- * the luminance channel is preserved exactly. It's not the same kind of
- * thing as the rotate/flip transformations, but it's convenient to handle it
- * as part of this package, mainly because the transformation routines have to
- * be aware of the option to know how many components to work on.
- */
-
-typedef struct {
- /* Options: set by caller */
- JXFORM_CODE transform; /* image transform operator */
- boolean trim; /* if TRUE, trim partial MCUs as needed */
- boolean force_grayscale; /* if TRUE, convert color image to grayscale */
-
- /* Internal workspace: caller should not touch these */
- int num_components; /* # of components in workspace */
- jvirt_barray_ptr * workspace_coef_arrays; /* workspace for transformations */
-} jpeg_transform_info;
-
-
-#if TRANSFORMS_SUPPORTED
-
-/* Request any required workspace */
-EXTERN(void) jtransform_request_workspace
- JPP((j_decompress_ptr srcinfo, jpeg_transform_info *info));
-/* Adjust output image parameters */
-EXTERN(jvirt_barray_ptr *) jtransform_adjust_parameters
- JPP((j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
- jvirt_barray_ptr *src_coef_arrays,
- jpeg_transform_info *info));
-/* Execute the actual transformation, if any */
-EXTERN(void) jtransform_execute_transformation
- JPP((j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
- jvirt_barray_ptr *src_coef_arrays,
- jpeg_transform_info *info));
-
-#endif /* TRANSFORMS_SUPPORTED */
-
-
-/*
- * Support for copying optional markers from source to destination file.
- */
-
-typedef enum {
- JCOPYOPT_NONE, /* copy no optional markers */
- JCOPYOPT_COMMENTS, /* copy only comment (COM) markers */
- JCOPYOPT_ALL /* copy all optional markers */
-} JCOPY_OPTION;
-
-#define JCOPYOPT_DEFAULT JCOPYOPT_COMMENTS /* recommended default */
-
-/* Setup decompression object to save desired markers in memory */
-EXTERN(void) jcopy_markers_setup
- JPP((j_decompress_ptr srcinfo, JCOPY_OPTION option));
-/* Copy markers saved in the given source object to the destination object */
-EXTERN(void) jcopy_markers_execute
- JPP((j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
- JCOPY_OPTION option));
+/*
+ * transupp.h
+ *
+ * Copyright (C) 1997, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains declarations for image transformation routines and
+ * other utility code used by the jpegtran sample application. These are
+ * NOT part of the core JPEG library. But we keep these routines separate
+ * from jpegtran.c to ease the task of maintaining jpegtran-like programs
+ * that have other user interfaces.
+ *
+ * NOTE: all the routines declared here have very specific requirements
+ * about when they are to be executed during the reading and writing of the
+ * source and destination files. See the comments in transupp.c, or see
+ * jpegtran.c for an example of correct usage.
+ */
+
+/* If you happen not to want the image transform support, disable it here */
+#ifndef TRANSFORMS_SUPPORTED
+#define TRANSFORMS_SUPPORTED 1 /* 0 disables transform code */
+#endif
+
+/* Short forms of external names for systems with brain-damaged linkers. */
+
+#ifdef NEED_SHORT_EXTERNAL_NAMES
+#define jtransform_request_workspace jTrRequest
+#define jtransform_adjust_parameters jTrAdjust
+#define jtransform_execute_transformation jTrExec
+#define jcopy_markers_setup jCMrkSetup
+#define jcopy_markers_execute jCMrkExec
+#endif /* NEED_SHORT_EXTERNAL_NAMES */
+
+
+/*
+ * Codes for supported types of image transformations.
+ */
+
+typedef enum {
+ JXFORM_NONE, /* no transformation */
+ JXFORM_FLIP_H, /* horizontal flip */
+ JXFORM_FLIP_V, /* vertical flip */
+ JXFORM_TRANSPOSE, /* transpose across UL-to-LR axis */
+ JXFORM_TRANSVERSE, /* transpose across UR-to-LL axis */
+ JXFORM_ROT_90, /* 90-degree clockwise rotation */
+ JXFORM_ROT_180, /* 180-degree rotation */
+ JXFORM_ROT_270 /* 270-degree clockwise (or 90 ccw) */
+} JXFORM_CODE;
+
+/*
+ * Although rotating and flipping data expressed as DCT coefficients is not
+ * hard, there is an asymmetry in the JPEG format specification for images
+ * whose dimensions aren't multiples of the iMCU size. The right and bottom
+ * image edges are padded out to the next iMCU boundary with junk data; but
+ * no padding is possible at the top and left edges. If we were to flip
+ * the whole image including the pad data, then pad garbage would become
+ * visible at the top and/or left, and real pixels would disappear into the
+ * pad margins --- perhaps permanently, since encoders & decoders may not
+ * bother to preserve DCT blocks that appear to be completely outside the
+ * nominal image area. So, we have to exclude any partial iMCUs from the
+ * basic transformation.
+ *
+ * Transpose is the only transformation that can handle partial iMCUs at the
+ * right and bottom edges completely cleanly. flip_h can flip partial iMCUs
+ * at the bottom, but leaves any partial iMCUs at the right edge untouched.
+ * Similarly flip_v leaves any partial iMCUs at the bottom edge untouched.
+ * The other transforms are defined as combinations of these basic transforms
+ * and process edge blocks in a way that preserves the equivalence.
+ *
+ * The "trim" option causes untransformable partial iMCUs to be dropped;
+ * this is not strictly lossless, but it usually gives the best-looking
+ * result for odd-size images. Note that when this option is active,
+ * the expected mathematical equivalences between the transforms may not hold.
+ * (For example, -rot 270 -trim trims only the bottom edge, but -rot 90 -trim
+ * followed by -rot 180 -trim trims both edges.)
+ *
+ * We also offer a "force to grayscale" option, which simply discards the
+ * chrominance channels of a YCbCr image. This is lossless in the sense that
+ * the luminance channel is preserved exactly. It's not the same kind of
+ * thing as the rotate/flip transformations, but it's convenient to handle it
+ * as part of this package, mainly because the transformation routines have to
+ * be aware of the option to know how many components to work on.
+ */
+
+typedef struct {
+ /* Options: set by caller */
+ JXFORM_CODE transform; /* image transform operator */
+ boolean trim; /* if TRUE, trim partial MCUs as needed */
+ boolean force_grayscale; /* if TRUE, convert color image to grayscale */
+
+ /* Internal workspace: caller should not touch these */
+ int num_components; /* # of components in workspace */
+ jvirt_barray_ptr * workspace_coef_arrays; /* workspace for transformations */
+} jpeg_transform_info;
+
+
+#if TRANSFORMS_SUPPORTED
+
+/* Request any required workspace */
+EXTERN(void) jtransform_request_workspace
+ JPP((j_decompress_ptr srcinfo, jpeg_transform_info *info));
+/* Adjust output image parameters */
+EXTERN(jvirt_barray_ptr *) jtransform_adjust_parameters
+ JPP((j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
+ jvirt_barray_ptr *src_coef_arrays,
+ jpeg_transform_info *info));
+/* Execute the actual transformation, if any */
+EXTERN(void) jtransform_execute_transformation
+ JPP((j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
+ jvirt_barray_ptr *src_coef_arrays,
+ jpeg_transform_info *info));
+
+#endif /* TRANSFORMS_SUPPORTED */
+
+
+/*
+ * Support for copying optional markers from source to destination file.
+ */
+
+typedef enum {
+ JCOPYOPT_NONE, /* copy no optional markers */
+ JCOPYOPT_COMMENTS, /* copy only comment (COM) markers */
+ JCOPYOPT_ALL /* copy all optional markers */
+} JCOPY_OPTION;
+
+#define JCOPYOPT_DEFAULT JCOPYOPT_COMMENTS /* recommended default */
+
+/* Setup decompression object to save desired markers in memory */
+EXTERN(void) jcopy_markers_setup
+ JPP((j_decompress_ptr srcinfo, JCOPY_OPTION option));
+/* Copy markers saved in the given source object to the destination object */
+EXTERN(void) jcopy_markers_execute
+ JPP((j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
+ JCOPY_OPTION option));
diff --git a/core/src/fxcrt/extension.h b/core/src/fxcrt/extension.h
index bf5c5ec6ad..8d9597bfd1 100644
--- a/core/src/fxcrt/extension.h
+++ b/core/src/fxcrt/extension.h
@@ -1,413 +1,413 @@
-// 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 _FXCRT_EXTENSION_IMP_
-#define _FXCRT_EXTENSION_IMP_
-class IFXCRT_FileAccess
-{
-public:
- virtual ~IFXCRT_FileAccess() {}
- virtual FX_BOOL Open(FX_BSTR fileName, FX_DWORD dwMode) = 0;
- virtual FX_BOOL Open(FX_WSTR fileName, FX_DWORD dwMode) = 0;
- virtual void Close() = 0;
- virtual void Release(IFX_Allocator* pAllocator = NULL) = 0;
- virtual FX_FILESIZE GetSize() const = 0;
- virtual FX_FILESIZE GetPosition() const = 0;
- virtual FX_FILESIZE SetPosition(FX_FILESIZE pos) = 0;
- virtual size_t Read(void* pBuffer, size_t szBuffer) = 0;
- virtual size_t Write(const void* pBuffer, size_t szBuffer) = 0;
- virtual size_t ReadPos(void* pBuffer, size_t szBuffer, FX_FILESIZE pos) = 0;
- virtual size_t WritePos(const void* pBuffer, size_t szBuffer, FX_FILESIZE pos) = 0;
- virtual FX_BOOL Flush() = 0;
- virtual FX_BOOL Truncate(FX_FILESIZE szFile) = 0;
-};
-IFXCRT_FileAccess* FXCRT_FileAccess_Create(IFX_Allocator* pAllocator = NULL);
-class CFX_CRTFileStream : public IFX_FileStream, public CFX_Object
-{
-public:
- CFX_CRTFileStream(IFXCRT_FileAccess* pFA, IFX_Allocator* pAllocator) : m_pAllocator(pAllocator), m_pFile(pFA), m_dwCount(1), m_bUseRange(FALSE), m_nOffset(0), m_nSize(0) {}
- ~CFX_CRTFileStream()
- {
- if (m_pFile) {
- m_pFile->Release(m_pAllocator);
- }
- }
- virtual IFX_FileStream* Retain()
- {
- m_dwCount ++;
- return this;
- }
- virtual void Release()
- {
- FX_DWORD nCount = -- m_dwCount;
- if (!nCount) {
- if (m_pAllocator) {
- FX_DeleteAtAllocator(this, m_pAllocator, CFX_CRTFileStream);
- } else {
- delete this;
- }
- }
- }
- virtual FX_FILESIZE GetSize()
- {
- return m_bUseRange ? m_nSize : m_pFile->GetSize();
- }
- virtual FX_BOOL IsEOF()
- {
- return GetPosition() >= GetSize();
- }
- virtual FX_FILESIZE GetPosition()
- {
- FX_FILESIZE pos = m_pFile->GetPosition();
- if (m_bUseRange) {
- pos -= m_nOffset;
- }
- return pos;
- }
- virtual FX_BOOL SetRange(FX_FILESIZE offset, FX_FILESIZE size)
- {
- if (offset < 0 || offset + size > m_pFile->GetSize()) {
- return FALSE;
- }
- m_nOffset = offset, m_nSize = size;
- m_bUseRange = TRUE;
- m_pFile->SetPosition(m_nOffset);
- return TRUE;
- }
- virtual void ClearRange()
- {
- m_bUseRange = FALSE;
- }
- virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size)
- {
- if (m_bUseRange) {
- if (offset + size > (size_t)GetSize()) {
- return FALSE;
- }
- offset += m_nOffset;
- }
- return (FX_BOOL)m_pFile->ReadPos(buffer, size, offset);
- }
- virtual size_t ReadBlock(void* buffer, size_t size)
- {
- if (m_bUseRange) {
- FX_FILESIZE availSize = m_nOffset + m_nSize - m_pFile->GetPosition();
- if ((size_t)availSize < size) {
- size -= size - (size_t)availSize;
- }
- }
- return m_pFile->Read(buffer, size);
- }
- virtual FX_BOOL WriteBlock(const void* buffer, FX_FILESIZE offset, size_t size)
- {
- if (m_bUseRange) {
- offset += m_nOffset;
- }
- return (FX_BOOL)m_pFile->WritePos(buffer, size, offset);
- }
- virtual FX_BOOL Flush()
- {
- return m_pFile->Flush();
- }
- IFX_Allocator* m_pAllocator;
- IFXCRT_FileAccess* m_pFile;
- FX_DWORD m_dwCount;
- FX_BOOL m_bUseRange;
- FX_FILESIZE m_nOffset;
- FX_FILESIZE m_nSize;
-};
-#define FX_MEMSTREAM_BlockSize (64 * 1024)
-#define FX_MEMSTREAM_Consecutive 0x01
-#define FX_MEMSTREAM_TakeOver 0x02
-class CFX_MemoryStream : public IFX_MemoryStream, public CFX_Object
-{
-public:
- CFX_MemoryStream(FX_BOOL bConsecutive, IFX_Allocator* pAllocator)
- : m_Blocks(pAllocator)
- , m_dwCount(1)
- , m_nTotalSize(0)
- , m_nCurSize(0)
- , m_nCurPos(0)
- , m_nGrowSize(FX_MEMSTREAM_BlockSize)
- , m_bUseRange(FALSE)
- {
- m_dwFlags = FX_MEMSTREAM_TakeOver | (bConsecutive ? FX_MEMSTREAM_Consecutive : 0);
- }
- CFX_MemoryStream(FX_LPBYTE pBuffer, size_t nSize, FX_BOOL bTakeOver, IFX_Allocator* pAllocator)
- : m_Blocks(pAllocator)
- , m_dwCount(1)
- , m_nTotalSize(nSize)
- , m_nCurSize(nSize)
- , m_nCurPos(0)
- , m_nGrowSize(FX_MEMSTREAM_BlockSize)
- , m_bUseRange(FALSE)
- {
- m_Blocks.Add(pBuffer);
- m_dwFlags = FX_MEMSTREAM_Consecutive | (bTakeOver ? FX_MEMSTREAM_TakeOver : 0);
- }
- ~CFX_MemoryStream()
- {
- IFX_Allocator* pAllocator = m_Blocks.m_pAllocator;
- if (m_dwFlags & FX_MEMSTREAM_TakeOver) {
- for (FX_INT32 i = 0; i < m_Blocks.GetSize(); i ++) {
- FX_Allocator_Free(pAllocator, (FX_LPBYTE)m_Blocks[i]);
- }
- }
- m_Blocks.RemoveAll();
- }
- virtual IFX_FileStream* Retain()
- {
- m_dwCount ++;
- return this;
- }
- virtual void Release()
- {
- FX_DWORD nCount = -- m_dwCount;
- if (nCount) {
- return;
- }
- IFX_Allocator* pAllocator = m_Blocks.m_pAllocator;
- if (pAllocator) {
- FX_DeleteAtAllocator(this, pAllocator, CFX_MemoryStream);
- } else {
- delete this;
- }
- }
- virtual FX_FILESIZE GetSize()
- {
- return m_bUseRange ? (FX_FILESIZE) m_nSize : (FX_FILESIZE)m_nCurSize;
- }
- virtual FX_BOOL IsEOF()
- {
- return m_nCurPos >= (size_t)GetSize();
- }
- virtual FX_FILESIZE GetPosition()
- {
- FX_FILESIZE pos = (FX_FILESIZE)m_nCurPos;
- if (m_bUseRange) {
- pos -= (FX_FILESIZE)m_nOffset;
- }
- return pos;
- }
- virtual FX_BOOL SetRange(FX_FILESIZE offset, FX_FILESIZE size)
- {
- if (offset < 0 || (size_t)(offset + size) > m_nCurSize) {
- return FALSE;
- }
- m_nOffset = (size_t)offset, m_nSize = (size_t)size;
- m_bUseRange = TRUE;
- m_nCurPos = m_nOffset;
- return TRUE;
- }
- virtual void ClearRange()
- {
- m_bUseRange = FALSE;
- }
- virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size)
- {
- if (!buffer || !size) {
- return FALSE;
- }
- if (m_bUseRange) {
- offset += (FX_FILESIZE)m_nOffset;
- }
- if ((size_t)offset + size > m_nCurSize) {
- return FALSE;
- }
- m_nCurPos = (size_t)offset + size;
- if (m_dwFlags & FX_MEMSTREAM_Consecutive) {
- FXSYS_memcpy32(buffer, (FX_LPBYTE)m_Blocks[0] + (size_t)offset, size);
- return TRUE;
- }
- size_t nStartBlock = (size_t)offset / m_nGrowSize;
- offset -= (FX_FILESIZE)(nStartBlock * m_nGrowSize);
- while (size) {
- size_t nRead = m_nGrowSize - (size_t)offset;
- if (nRead > size) {
- nRead = size;
- }
- FXSYS_memcpy32(buffer, (FX_LPBYTE)m_Blocks[(int)nStartBlock] + (size_t)offset, nRead);
- buffer = ((FX_LPBYTE)buffer) + nRead;
- size -= nRead;
- nStartBlock ++;
- offset = 0;
- }
- return TRUE;
- }
- virtual size_t ReadBlock(void* buffer, size_t size)
- {
- if (m_nCurPos >= m_nCurSize) {
- return 0;
- }
- if (m_bUseRange) {
- size_t availSize = m_nOffset + m_nSize - m_nCurPos;
- if (availSize < size) {
- size -= size - (size_t)availSize;
- }
- }
- size_t nRead = FX_MIN(size, m_nCurSize - m_nCurPos);
- if (!ReadBlock(buffer, (FX_INT32)m_nCurPos, nRead)) {
- return 0;
- }
- return nRead;
- }
- virtual FX_BOOL WriteBlock(const void* buffer, FX_FILESIZE offset, size_t size)
- {
- if (!buffer || !size) {
- return FALSE;
- }
- if (m_bUseRange) {
- offset += (FX_FILESIZE)m_nOffset;
- }
- if (m_dwFlags & FX_MEMSTREAM_Consecutive) {
- m_nCurPos = (size_t)offset + size;
- if (m_nCurPos > m_nTotalSize) {
- IFX_Allocator* pAllocator = m_Blocks.m_pAllocator;
- m_nTotalSize = (m_nCurPos + m_nGrowSize - 1) / m_nGrowSize * m_nGrowSize;
- if (m_Blocks.GetSize() < 1) {
- void* block = FX_Allocator_Alloc(pAllocator, FX_BYTE, m_nTotalSize);
- m_Blocks.Add(block);
- } else {
- m_Blocks[0] = FX_Allocator_Realloc(pAllocator, FX_BYTE, m_Blocks[0], m_nTotalSize);
- }
- if (!m_Blocks[0]) {
- m_Blocks.RemoveAll();
- return FALSE;
- }
- }
- FXSYS_memcpy32((FX_LPBYTE)m_Blocks[0] + (size_t)offset, buffer, size);
- if (m_nCurSize < m_nCurPos) {
- m_nCurSize = m_nCurPos;
- }
- return TRUE;
- }
- if (!ExpandBlocks((size_t)offset + size)) {
- return FALSE;
- }
- m_nCurPos = (size_t)offset + size;
- size_t nStartBlock = (size_t)offset / m_nGrowSize;
- offset -= (FX_FILESIZE)(nStartBlock * m_nGrowSize);
- while (size) {
- size_t nWrite = m_nGrowSize - (size_t)offset;
- if (nWrite > size) {
- nWrite = size;
- }
- FXSYS_memcpy32((FX_LPBYTE)m_Blocks[(int)nStartBlock] + (size_t)offset, buffer, nWrite);
- buffer = ((FX_LPBYTE)buffer) + nWrite;
- size -= nWrite;
- nStartBlock ++;
- offset = 0;
- }
- return TRUE;
- }
- virtual FX_BOOL Flush()
- {
- return TRUE;
- }
- virtual FX_BOOL IsConsecutive() const
- {
- return m_dwFlags & FX_MEMSTREAM_Consecutive;
- }
- virtual void EstimateSize(size_t nInitSize, size_t nGrowSize)
- {
- if (m_dwFlags & FX_MEMSTREAM_Consecutive) {
- if (m_Blocks.GetSize() < 1) {
- FX_LPBYTE pBlock = FX_Allocator_Alloc(m_Blocks.m_pAllocator, FX_BYTE, FX_MAX(nInitSize, 4096));
- if (pBlock) {
- m_Blocks.Add(pBlock);
- }
- }
- m_nGrowSize = FX_MAX(nGrowSize, 4096);
- } else if (m_Blocks.GetSize() < 1) {
- m_nGrowSize = FX_MAX(nGrowSize, 4096);
- }
- }
- virtual FX_LPBYTE GetBuffer() const
- {
- return m_Blocks.GetSize() ? (FX_LPBYTE)m_Blocks[0] : NULL;
- }
- virtual void AttachBuffer(FX_LPBYTE pBuffer, size_t nSize, FX_BOOL bTakeOver = FALSE)
- {
- if (!(m_dwFlags & FX_MEMSTREAM_Consecutive)) {
- return;
- }
- m_Blocks.RemoveAll();
- m_Blocks.Add(pBuffer);
- m_nTotalSize = m_nCurSize = nSize;
- m_nCurPos = 0;
- m_dwFlags = FX_MEMSTREAM_Consecutive | (bTakeOver ? FX_MEMSTREAM_TakeOver : 0);
- ClearRange();
- }
- virtual void DetachBuffer()
- {
- if (!(m_dwFlags & FX_MEMSTREAM_Consecutive)) {
- return;
- }
- m_Blocks.RemoveAll();
- m_nTotalSize = m_nCurSize = m_nCurPos = 0;
- m_dwFlags = FX_MEMSTREAM_TakeOver;
- ClearRange();
- }
-protected:
- CFX_PtrArray m_Blocks;
- FX_DWORD m_dwCount;
- size_t m_nTotalSize;
- size_t m_nCurSize;
- size_t m_nCurPos;
- size_t m_nGrowSize;
- FX_DWORD m_dwFlags;
- FX_BOOL m_bUseRange;
- size_t m_nOffset;
- size_t m_nSize;
- FX_BOOL ExpandBlocks(size_t size)
- {
- if (m_nCurSize < size) {
- m_nCurSize = size;
- }
- if (size <= m_nTotalSize) {
- return TRUE;
- }
- FX_INT32 iCount = m_Blocks.GetSize();
- size = (size - m_nTotalSize + m_nGrowSize - 1) / m_nGrowSize;
- m_Blocks.SetSize(m_Blocks.GetSize() + (FX_INT32)size, -1);
- IFX_Allocator* pAllocator = m_Blocks.m_pAllocator;
- while (size --) {
- FX_LPBYTE pBlock = FX_Allocator_Alloc(pAllocator, FX_BYTE, m_nGrowSize);
- if (!pBlock) {
- return FALSE;
- }
- m_Blocks.SetAt(iCount ++, pBlock);
- m_nTotalSize += m_nGrowSize;
- }
- return TRUE;
- }
-};
-#ifdef __cplusplus
-extern "C" {
-#endif
-#define MT_N 848
-#define MT_M 456
-#define MT_Matrix_A 0x9908b0df
-#define MT_Upper_Mask 0x80000000
-#define MT_Lower_Mask 0x7fffffff
-typedef struct _FX_MTRANDOMCONTEXT {
- _FX_MTRANDOMCONTEXT()
- {
- mti = MT_N + 1;
- bHaveSeed = FALSE;
- }
- FX_DWORD mti;
- FX_BOOL bHaveSeed;
- FX_DWORD mt[MT_N];
-} FX_MTRANDOMCONTEXT, * FX_LPMTRANDOMCONTEXT;
-typedef FX_MTRANDOMCONTEXT const * FX_LPCMTRANDOMCONTEXT;
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
-FX_BOOL FX_GenerateCryptoRandom(FX_LPDWORD pBuffer, FX_INT32 iCount);
-#endif
-#ifdef __cplusplus
-}
-#endif
-#endif
+// 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 _FXCRT_EXTENSION_IMP_
+#define _FXCRT_EXTENSION_IMP_
+class IFXCRT_FileAccess
+{
+public:
+ virtual ~IFXCRT_FileAccess() {}
+ virtual FX_BOOL Open(FX_BSTR fileName, FX_DWORD dwMode) = 0;
+ virtual FX_BOOL Open(FX_WSTR fileName, FX_DWORD dwMode) = 0;
+ virtual void Close() = 0;
+ virtual void Release(IFX_Allocator* pAllocator = NULL) = 0;
+ virtual FX_FILESIZE GetSize() const = 0;
+ virtual FX_FILESIZE GetPosition() const = 0;
+ virtual FX_FILESIZE SetPosition(FX_FILESIZE pos) = 0;
+ virtual size_t Read(void* pBuffer, size_t szBuffer) = 0;
+ virtual size_t Write(const void* pBuffer, size_t szBuffer) = 0;
+ virtual size_t ReadPos(void* pBuffer, size_t szBuffer, FX_FILESIZE pos) = 0;
+ virtual size_t WritePos(const void* pBuffer, size_t szBuffer, FX_FILESIZE pos) = 0;
+ virtual FX_BOOL Flush() = 0;
+ virtual FX_BOOL Truncate(FX_FILESIZE szFile) = 0;
+};
+IFXCRT_FileAccess* FXCRT_FileAccess_Create(IFX_Allocator* pAllocator = NULL);
+class CFX_CRTFileStream : public IFX_FileStream, public CFX_Object
+{
+public:
+ CFX_CRTFileStream(IFXCRT_FileAccess* pFA, IFX_Allocator* pAllocator) : m_pAllocator(pAllocator), m_pFile(pFA), m_dwCount(1), m_bUseRange(FALSE), m_nOffset(0), m_nSize(0) {}
+ ~CFX_CRTFileStream()
+ {
+ if (m_pFile) {
+ m_pFile->Release(m_pAllocator);
+ }
+ }
+ virtual IFX_FileStream* Retain()
+ {
+ m_dwCount ++;
+ return this;
+ }
+ virtual void Release()
+ {
+ FX_DWORD nCount = -- m_dwCount;
+ if (!nCount) {
+ if (m_pAllocator) {
+ FX_DeleteAtAllocator(this, m_pAllocator, CFX_CRTFileStream);
+ } else {
+ delete this;
+ }
+ }
+ }
+ virtual FX_FILESIZE GetSize()
+ {
+ return m_bUseRange ? m_nSize : m_pFile->GetSize();
+ }
+ virtual FX_BOOL IsEOF()
+ {
+ return GetPosition() >= GetSize();
+ }
+ virtual FX_FILESIZE GetPosition()
+ {
+ FX_FILESIZE pos = m_pFile->GetPosition();
+ if (m_bUseRange) {
+ pos -= m_nOffset;
+ }
+ return pos;
+ }
+ virtual FX_BOOL SetRange(FX_FILESIZE offset, FX_FILESIZE size)
+ {
+ if (offset < 0 || offset + size > m_pFile->GetSize()) {
+ return FALSE;
+ }
+ m_nOffset = offset, m_nSize = size;
+ m_bUseRange = TRUE;
+ m_pFile->SetPosition(m_nOffset);
+ return TRUE;
+ }
+ virtual void ClearRange()
+ {
+ m_bUseRange = FALSE;
+ }
+ virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size)
+ {
+ if (m_bUseRange) {
+ if (offset + size > (size_t)GetSize()) {
+ return FALSE;
+ }
+ offset += m_nOffset;
+ }
+ return (FX_BOOL)m_pFile->ReadPos(buffer, size, offset);
+ }
+ virtual size_t ReadBlock(void* buffer, size_t size)
+ {
+ if (m_bUseRange) {
+ FX_FILESIZE availSize = m_nOffset + m_nSize - m_pFile->GetPosition();
+ if ((size_t)availSize < size) {
+ size -= size - (size_t)availSize;
+ }
+ }
+ return m_pFile->Read(buffer, size);
+ }
+ virtual FX_BOOL WriteBlock(const void* buffer, FX_FILESIZE offset, size_t size)
+ {
+ if (m_bUseRange) {
+ offset += m_nOffset;
+ }
+ return (FX_BOOL)m_pFile->WritePos(buffer, size, offset);
+ }
+ virtual FX_BOOL Flush()
+ {
+ return m_pFile->Flush();
+ }
+ IFX_Allocator* m_pAllocator;
+ IFXCRT_FileAccess* m_pFile;
+ FX_DWORD m_dwCount;
+ FX_BOOL m_bUseRange;
+ FX_FILESIZE m_nOffset;
+ FX_FILESIZE m_nSize;
+};
+#define FX_MEMSTREAM_BlockSize (64 * 1024)
+#define FX_MEMSTREAM_Consecutive 0x01
+#define FX_MEMSTREAM_TakeOver 0x02
+class CFX_MemoryStream : public IFX_MemoryStream, public CFX_Object
+{
+public:
+ CFX_MemoryStream(FX_BOOL bConsecutive, IFX_Allocator* pAllocator)
+ : m_Blocks(pAllocator)
+ , m_dwCount(1)
+ , m_nTotalSize(0)
+ , m_nCurSize(0)
+ , m_nCurPos(0)
+ , m_nGrowSize(FX_MEMSTREAM_BlockSize)
+ , m_bUseRange(FALSE)
+ {
+ m_dwFlags = FX_MEMSTREAM_TakeOver | (bConsecutive ? FX_MEMSTREAM_Consecutive : 0);
+ }
+ CFX_MemoryStream(FX_LPBYTE pBuffer, size_t nSize, FX_BOOL bTakeOver, IFX_Allocator* pAllocator)
+ : m_Blocks(pAllocator)
+ , m_dwCount(1)
+ , m_nTotalSize(nSize)
+ , m_nCurSize(nSize)
+ , m_nCurPos(0)
+ , m_nGrowSize(FX_MEMSTREAM_BlockSize)
+ , m_bUseRange(FALSE)
+ {
+ m_Blocks.Add(pBuffer);
+ m_dwFlags = FX_MEMSTREAM_Consecutive | (bTakeOver ? FX_MEMSTREAM_TakeOver : 0);
+ }
+ ~CFX_MemoryStream()
+ {
+ IFX_Allocator* pAllocator = m_Blocks.m_pAllocator;
+ if (m_dwFlags & FX_MEMSTREAM_TakeOver) {
+ for (FX_INT32 i = 0; i < m_Blocks.GetSize(); i ++) {
+ FX_Allocator_Free(pAllocator, (FX_LPBYTE)m_Blocks[i]);
+ }
+ }
+ m_Blocks.RemoveAll();
+ }
+ virtual IFX_FileStream* Retain()
+ {
+ m_dwCount ++;
+ return this;
+ }
+ virtual void Release()
+ {
+ FX_DWORD nCount = -- m_dwCount;
+ if (nCount) {
+ return;
+ }
+ IFX_Allocator* pAllocator = m_Blocks.m_pAllocator;
+ if (pAllocator) {
+ FX_DeleteAtAllocator(this, pAllocator, CFX_MemoryStream);
+ } else {
+ delete this;
+ }
+ }
+ virtual FX_FILESIZE GetSize()
+ {
+ return m_bUseRange ? (FX_FILESIZE) m_nSize : (FX_FILESIZE)m_nCurSize;
+ }
+ virtual FX_BOOL IsEOF()
+ {
+ return m_nCurPos >= (size_t)GetSize();
+ }
+ virtual FX_FILESIZE GetPosition()
+ {
+ FX_FILESIZE pos = (FX_FILESIZE)m_nCurPos;
+ if (m_bUseRange) {
+ pos -= (FX_FILESIZE)m_nOffset;
+ }
+ return pos;
+ }
+ virtual FX_BOOL SetRange(FX_FILESIZE offset, FX_FILESIZE size)
+ {
+ if (offset < 0 || (size_t)(offset + size) > m_nCurSize) {
+ return FALSE;
+ }
+ m_nOffset = (size_t)offset, m_nSize = (size_t)size;
+ m_bUseRange = TRUE;
+ m_nCurPos = m_nOffset;
+ return TRUE;
+ }
+ virtual void ClearRange()
+ {
+ m_bUseRange = FALSE;
+ }
+ virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size)
+ {
+ if (!buffer || !size) {
+ return FALSE;
+ }
+ if (m_bUseRange) {
+ offset += (FX_FILESIZE)m_nOffset;
+ }
+ if ((size_t)offset + size > m_nCurSize) {
+ return FALSE;
+ }
+ m_nCurPos = (size_t)offset + size;
+ if (m_dwFlags & FX_MEMSTREAM_Consecutive) {
+ FXSYS_memcpy32(buffer, (FX_LPBYTE)m_Blocks[0] + (size_t)offset, size);
+ return TRUE;
+ }
+ size_t nStartBlock = (size_t)offset / m_nGrowSize;
+ offset -= (FX_FILESIZE)(nStartBlock * m_nGrowSize);
+ while (size) {
+ size_t nRead = m_nGrowSize - (size_t)offset;
+ if (nRead > size) {
+ nRead = size;
+ }
+ FXSYS_memcpy32(buffer, (FX_LPBYTE)m_Blocks[(int)nStartBlock] + (size_t)offset, nRead);
+ buffer = ((FX_LPBYTE)buffer) + nRead;
+ size -= nRead;
+ nStartBlock ++;
+ offset = 0;
+ }
+ return TRUE;
+ }
+ virtual size_t ReadBlock(void* buffer, size_t size)
+ {
+ if (m_nCurPos >= m_nCurSize) {
+ return 0;
+ }
+ if (m_bUseRange) {
+ size_t availSize = m_nOffset + m_nSize - m_nCurPos;
+ if (availSize < size) {
+ size -= size - (size_t)availSize;
+ }
+ }
+ size_t nRead = FX_MIN(size, m_nCurSize - m_nCurPos);
+ if (!ReadBlock(buffer, (FX_INT32)m_nCurPos, nRead)) {
+ return 0;
+ }
+ return nRead;
+ }
+ virtual FX_BOOL WriteBlock(const void* buffer, FX_FILESIZE offset, size_t size)
+ {
+ if (!buffer || !size) {
+ return FALSE;
+ }
+ if (m_bUseRange) {
+ offset += (FX_FILESIZE)m_nOffset;
+ }
+ if (m_dwFlags & FX_MEMSTREAM_Consecutive) {
+ m_nCurPos = (size_t)offset + size;
+ if (m_nCurPos > m_nTotalSize) {
+ IFX_Allocator* pAllocator = m_Blocks.m_pAllocator;
+ m_nTotalSize = (m_nCurPos + m_nGrowSize - 1) / m_nGrowSize * m_nGrowSize;
+ if (m_Blocks.GetSize() < 1) {
+ void* block = FX_Allocator_Alloc(pAllocator, FX_BYTE, m_nTotalSize);
+ m_Blocks.Add(block);
+ } else {
+ m_Blocks[0] = FX_Allocator_Realloc(pAllocator, FX_BYTE, m_Blocks[0], m_nTotalSize);
+ }
+ if (!m_Blocks[0]) {
+ m_Blocks.RemoveAll();
+ return FALSE;
+ }
+ }
+ FXSYS_memcpy32((FX_LPBYTE)m_Blocks[0] + (size_t)offset, buffer, size);
+ if (m_nCurSize < m_nCurPos) {
+ m_nCurSize = m_nCurPos;
+ }
+ return TRUE;
+ }
+ if (!ExpandBlocks((size_t)offset + size)) {
+ return FALSE;
+ }
+ m_nCurPos = (size_t)offset + size;
+ size_t nStartBlock = (size_t)offset / m_nGrowSize;
+ offset -= (FX_FILESIZE)(nStartBlock * m_nGrowSize);
+ while (size) {
+ size_t nWrite = m_nGrowSize - (size_t)offset;
+ if (nWrite > size) {
+ nWrite = size;
+ }
+ FXSYS_memcpy32((FX_LPBYTE)m_Blocks[(int)nStartBlock] + (size_t)offset, buffer, nWrite);
+ buffer = ((FX_LPBYTE)buffer) + nWrite;
+ size -= nWrite;
+ nStartBlock ++;
+ offset = 0;
+ }
+ return TRUE;
+ }
+ virtual FX_BOOL Flush()
+ {
+ return TRUE;
+ }
+ virtual FX_BOOL IsConsecutive() const
+ {
+ return m_dwFlags & FX_MEMSTREAM_Consecutive;
+ }
+ virtual void EstimateSize(size_t nInitSize, size_t nGrowSize)
+ {
+ if (m_dwFlags & FX_MEMSTREAM_Consecutive) {
+ if (m_Blocks.GetSize() < 1) {
+ FX_LPBYTE pBlock = FX_Allocator_Alloc(m_Blocks.m_pAllocator, FX_BYTE, FX_MAX(nInitSize, 4096));
+ if (pBlock) {
+ m_Blocks.Add(pBlock);
+ }
+ }
+ m_nGrowSize = FX_MAX(nGrowSize, 4096);
+ } else if (m_Blocks.GetSize() < 1) {
+ m_nGrowSize = FX_MAX(nGrowSize, 4096);
+ }
+ }
+ virtual FX_LPBYTE GetBuffer() const
+ {
+ return m_Blocks.GetSize() ? (FX_LPBYTE)m_Blocks[0] : NULL;
+ }
+ virtual void AttachBuffer(FX_LPBYTE pBuffer, size_t nSize, FX_BOOL bTakeOver = FALSE)
+ {
+ if (!(m_dwFlags & FX_MEMSTREAM_Consecutive)) {
+ return;
+ }
+ m_Blocks.RemoveAll();
+ m_Blocks.Add(pBuffer);
+ m_nTotalSize = m_nCurSize = nSize;
+ m_nCurPos = 0;
+ m_dwFlags = FX_MEMSTREAM_Consecutive | (bTakeOver ? FX_MEMSTREAM_TakeOver : 0);
+ ClearRange();
+ }
+ virtual void DetachBuffer()
+ {
+ if (!(m_dwFlags & FX_MEMSTREAM_Consecutive)) {
+ return;
+ }
+ m_Blocks.RemoveAll();
+ m_nTotalSize = m_nCurSize = m_nCurPos = 0;
+ m_dwFlags = FX_MEMSTREAM_TakeOver;
+ ClearRange();
+ }
+protected:
+ CFX_PtrArray m_Blocks;
+ FX_DWORD m_dwCount;
+ size_t m_nTotalSize;
+ size_t m_nCurSize;
+ size_t m_nCurPos;
+ size_t m_nGrowSize;
+ FX_DWORD m_dwFlags;
+ FX_BOOL m_bUseRange;
+ size_t m_nOffset;
+ size_t m_nSize;
+ FX_BOOL ExpandBlocks(size_t size)
+ {
+ if (m_nCurSize < size) {
+ m_nCurSize = size;
+ }
+ if (size <= m_nTotalSize) {
+ return TRUE;
+ }
+ FX_INT32 iCount = m_Blocks.GetSize();
+ size = (size - m_nTotalSize + m_nGrowSize - 1) / m_nGrowSize;
+ m_Blocks.SetSize(m_Blocks.GetSize() + (FX_INT32)size, -1);
+ IFX_Allocator* pAllocator = m_Blocks.m_pAllocator;
+ while (size --) {
+ FX_LPBYTE pBlock = FX_Allocator_Alloc(pAllocator, FX_BYTE, m_nGrowSize);
+ if (!pBlock) {
+ return FALSE;
+ }
+ m_Blocks.SetAt(iCount ++, pBlock);
+ m_nTotalSize += m_nGrowSize;
+ }
+ return TRUE;
+ }
+};
+#ifdef __cplusplus
+extern "C" {
+#endif
+#define MT_N 848
+#define MT_M 456
+#define MT_Matrix_A 0x9908b0df
+#define MT_Upper_Mask 0x80000000
+#define MT_Lower_Mask 0x7fffffff
+typedef struct _FX_MTRANDOMCONTEXT {
+ _FX_MTRANDOMCONTEXT()
+ {
+ mti = MT_N + 1;
+ bHaveSeed = FALSE;
+ }
+ FX_DWORD mti;
+ FX_BOOL bHaveSeed;
+ FX_DWORD mt[MT_N];
+} FX_MTRANDOMCONTEXT, * FX_LPMTRANDOMCONTEXT;
+typedef FX_MTRANDOMCONTEXT const * FX_LPCMTRANDOMCONTEXT;
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
+FX_BOOL FX_GenerateCryptoRandom(FX_LPDWORD pBuffer, FX_INT32 iCount);
+#endif
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/core/src/fxcrt/fx_basic_array.cpp b/core/src/fxcrt/fx_basic_array.cpp
index 36857ce336..93f2b2fec5 100644
--- a/core/src/fxcrt/fx_basic_array.cpp
+++ b/core/src/fxcrt/fx_basic_array.cpp
@@ -1,365 +1,365 @@
-// 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
-
-#include "../../include/fxcrt/fx_basic.h"
-CFX_BasicArray::CFX_BasicArray(int unit_size, IFX_Allocator* pAllocator)
- : m_pAllocator(pAllocator)
- , m_pData(NULL)
- , m_nSize(0)
- , m_nMaxSize(0)
- , m_nGrowBy(0)
-{
- if (unit_size < 0 || unit_size > (1 << 28)) {
- m_nUnitSize = 4;
- } else {
- m_nUnitSize = unit_size;
- }
-}
-CFX_BasicArray::~CFX_BasicArray()
-{
- FX_Allocator_Free(m_pAllocator, m_pData);
-}
-FX_BOOL CFX_BasicArray::SetSize(int nNewSize, int nGrowBy)
-{
- if (nNewSize < 0 || nNewSize > (1 << 28) / m_nUnitSize) {
- m_pData = NULL;
- m_nSize = m_nMaxSize = 0;
- return FALSE;
- }
- if (nGrowBy >= 0) {
- m_nGrowBy = nGrowBy;
- }
- if (nNewSize == 0) {
- if (m_pData != NULL) {
- FX_Allocator_Free(m_pAllocator, m_pData);
- m_pData = NULL;
- }
- m_nSize = m_nMaxSize = 0;
- } else if (m_pData == NULL) {
- m_pData = FX_Allocator_Alloc(m_pAllocator, FX_BYTE, nNewSize * m_nUnitSize);
- if (!m_pData) {
- m_nSize = m_nMaxSize = 0;
- return FALSE;
- }
- FXSYS_memset32(m_pData, 0, nNewSize * m_nUnitSize);
- m_nSize = m_nMaxSize = nNewSize;
- } else if (nNewSize <= m_nMaxSize) {
- if (nNewSize > m_nSize) {
- FXSYS_memset32(m_pData + m_nSize * m_nUnitSize, 0, (nNewSize - m_nSize) * m_nUnitSize);
- }
- m_nSize = nNewSize;
- } else {
- int nGrowBy = m_nGrowBy;
- if (nGrowBy == 0) {
- nGrowBy = m_nSize / 8;
- nGrowBy = (nGrowBy < 4) ? 4 : ((nGrowBy > 1024) ? 1024 : nGrowBy);
- }
- int nNewMax;
- if (nNewSize < m_nMaxSize + nGrowBy) {
- nNewMax = m_nMaxSize + nGrowBy;
- } else {
- nNewMax = nNewSize;
- }
- FX_LPBYTE pNewData = FX_Allocator_Realloc(m_pAllocator, FX_BYTE, m_pData, nNewMax * m_nUnitSize);
- if (pNewData == NULL) {
- return FALSE;
- }
- FXSYS_memset32(pNewData + m_nSize * m_nUnitSize, 0, (nNewMax - m_nSize) * m_nUnitSize);
- m_pData = pNewData;
- m_nSize = nNewSize;
- m_nMaxSize = nNewMax;
- }
- return TRUE;
-}
-FX_BOOL CFX_BasicArray::Append(const CFX_BasicArray& src)
-{
- int nOldSize = m_nSize;
- if (!SetSize(m_nSize + src.m_nSize, -1)) {
- return FALSE;
- }
- FXSYS_memcpy32(m_pData + nOldSize * m_nUnitSize, src.m_pData, src.m_nSize * m_nUnitSize);
- return TRUE;
-}
-FX_BOOL CFX_BasicArray::Copy(const CFX_BasicArray& src)
-{
- if (!SetSize(src.m_nSize, -1)) {
- return FALSE;
- }
- FXSYS_memcpy32(m_pData, src.m_pData, src.m_nSize * m_nUnitSize);
- return TRUE;
-}
-FX_LPBYTE CFX_BasicArray::InsertSpaceAt(int nIndex, int nCount)
-{
- if (nIndex < 0 || nCount <= 0) {
- return NULL;
- }
- if (nIndex >= m_nSize) {
- if (!SetSize(nIndex + nCount, -1)) {
- return NULL;
- }
- } else {
- int nOldSize = m_nSize;
- if (!SetSize(m_nSize + nCount, -1)) {
- return NULL;
- }
- FXSYS_memmove32(m_pData + (nIndex + nCount)*m_nUnitSize, m_pData + nIndex * m_nUnitSize,
- (nOldSize - nIndex) * m_nUnitSize);
- FXSYS_memset32(m_pData + nIndex * m_nUnitSize, 0, nCount * m_nUnitSize);
- }
- return m_pData + nIndex * m_nUnitSize;
-}
-FX_BOOL CFX_BasicArray::RemoveAt(int nIndex, int nCount)
-{
- if (nIndex < 0 || nCount <= 0 || m_nSize < nIndex + nCount) {
- return FALSE;
- }
- int nMoveCount = m_nSize - (nIndex + nCount);
- if (nMoveCount) {
- FXSYS_memmove32(m_pData + nIndex * m_nUnitSize, m_pData + (nIndex + nCount) * m_nUnitSize, nMoveCount * m_nUnitSize);
- }
- m_nSize -= nCount;
- return TRUE;
-}
-FX_BOOL CFX_BasicArray::InsertAt(int nStartIndex, const CFX_BasicArray* pNewArray)
-{
- if (pNewArray == NULL) {
- return FALSE;
- }
- if (pNewArray->m_nSize == 0) {
- return TRUE;
- }
- if (!InsertSpaceAt(nStartIndex, pNewArray->m_nSize)) {
- return FALSE;
- }
- FXSYS_memcpy32(m_pData + nStartIndex * m_nUnitSize, pNewArray->m_pData, pNewArray->m_nSize * m_nUnitSize);
- return TRUE;
-}
-const void* CFX_BasicArray::GetDataPtr(int index) const
-{
- if (index < 0 || index >= m_nSize || m_pData == NULL) {
- return NULL;
- }
- return m_pData + index * m_nUnitSize;
-}
-CFX_BaseSegmentedArray::CFX_BaseSegmentedArray(int unit_size, int segment_units, int index_size, IFX_Allocator* pAllocator)
- : m_pAllocator(pAllocator)
- , m_UnitSize(unit_size)
- , m_SegmentSize(segment_units)
- , m_IndexSize(index_size)
- , m_IndexDepth(0)
- , m_DataSize(0)
- , m_pIndex(NULL)
-{
-}
-void CFX_BaseSegmentedArray::SetUnitSize(int unit_size, int segment_units, int index_size)
-{
- ASSERT(m_DataSize == 0);
- m_UnitSize = unit_size;
- m_SegmentSize = segment_units;
- m_IndexSize = index_size;
-}
-CFX_BaseSegmentedArray::~CFX_BaseSegmentedArray()
-{
- RemoveAll();
-}
-static void _ClearIndex(IFX_Allocator* pAllcator, int level, int size, void** pIndex)
-{
- if (level == 0) {
- FX_Allocator_Free(pAllcator, pIndex);
- return;
- }
- for (int i = 0; i < size; i ++) {
- if (pIndex[i] == NULL) {
- continue;
- }
- _ClearIndex(pAllcator, level - 1, size, (void**)pIndex[i]);
- }
- FX_Allocator_Free(pAllcator, pIndex);
-}
-void CFX_BaseSegmentedArray::RemoveAll()
-{
- if (m_pIndex == NULL) {
- return;
- }
- _ClearIndex(m_pAllocator, m_IndexDepth, m_IndexSize, (void**)m_pIndex);
- m_pIndex = NULL;
- m_IndexDepth = 0;
- m_DataSize = 0;
-}
-void* CFX_BaseSegmentedArray::Add()
-{
- if (m_DataSize % m_SegmentSize) {
- return GetAt(m_DataSize ++);
- }
- void* pSegment = FX_Allocator_Alloc(m_pAllocator, FX_BYTE, m_UnitSize * m_SegmentSize);
- if (!pSegment) {
- return NULL;
- }
- if (m_pIndex == NULL) {
- m_pIndex = pSegment;
- m_DataSize ++;
- return pSegment;
- }
- if (m_IndexDepth == 0) {
- void** pIndex = (void**)FX_Allocator_Alloc(m_pAllocator, void*, m_IndexSize);
- if (pIndex == NULL) {
- FX_Allocator_Free(m_pAllocator, pSegment);
- return NULL;
- }
- FXSYS_memset32(pIndex, 0, sizeof(void*) * m_IndexSize);
- pIndex[0] = m_pIndex;
- pIndex[1] = pSegment;
- m_pIndex = pIndex;
- m_DataSize ++;
- m_IndexDepth ++;
- return pSegment;
- }
- int seg_index = m_DataSize / m_SegmentSize;
- if (seg_index % m_IndexSize) {
- void** pIndex = GetIndex(seg_index);
- pIndex[seg_index % m_IndexSize] = pSegment;
- m_DataSize ++;
- return pSegment;
- }
- int tree_size = 1;
- int i;
- for (i = 0; i < m_IndexDepth; i ++) {
- tree_size *= m_IndexSize;
- }
- if (m_DataSize == tree_size * m_SegmentSize) {
- void** pIndex = (void**)FX_Allocator_Alloc(m_pAllocator, void*, m_IndexSize);
- if (pIndex == NULL) {
- FX_Allocator_Free(m_pAllocator, pSegment);
- return NULL;
- }
- FXSYS_memset32(pIndex, 0, sizeof(void*) * m_IndexSize);
- pIndex[0] = m_pIndex;
- m_pIndex = pIndex;
- m_IndexDepth ++;
- } else {
- tree_size /= m_IndexSize;
- }
- void** pSpot = (void**)m_pIndex;
- for (i = 1; i < m_IndexDepth; i ++) {
- if (pSpot[seg_index / tree_size] == NULL) {
- pSpot[seg_index / tree_size] = (void*)FX_Allocator_Alloc(m_pAllocator, void*, m_IndexSize);
- if (pSpot[seg_index / tree_size] == NULL) {
- break;
- }
- FXSYS_memset32(pSpot[seg_index / tree_size], 0, sizeof(void*) * m_IndexSize);
- }
- pSpot = (void**)pSpot[seg_index / tree_size];
- seg_index = seg_index % tree_size;
- tree_size /= m_IndexSize;
- }
- if (i < m_IndexDepth) {
- FX_Allocator_Free(m_pAllocator, pSegment);
- RemoveAll();
- return NULL;
- }
- pSpot[seg_index % m_IndexSize] = pSegment;
- m_DataSize ++;
- return pSegment;
-}
-void** CFX_BaseSegmentedArray::GetIndex(int seg_index) const
-{
- ASSERT(m_IndexDepth != 0);
- if (m_IndexDepth == 1) {
- return (void**)m_pIndex;
- } else if (m_IndexDepth == 2) {
- return (void**)((void**)m_pIndex)[seg_index / m_IndexSize];
- }
- int tree_size = 1;
- int i;
- for (i = 1; i < m_IndexDepth; i ++) {
- tree_size *= m_IndexSize;
- }
- void** pSpot = (void**)m_pIndex;
- for (i = 1; i < m_IndexDepth; i ++) {
- pSpot = (void**)pSpot[seg_index / tree_size];
- seg_index = seg_index % tree_size;
- tree_size /= m_IndexSize;
- }
- return pSpot;
-}
-void* CFX_BaseSegmentedArray::IterateSegment(FX_LPCBYTE pSegment, int count, FX_BOOL (*callback)(void* param, void* pData), void* param) const
-{
- for (int i = 0; i < count; i ++) {
- if (!callback(param, (void*)(pSegment + i * m_UnitSize))) {
- return (void*)(pSegment + i * m_UnitSize);
- }
- }
- return NULL;
-}
-void* CFX_BaseSegmentedArray::IterateIndex(int level, int& start, void** pIndex, FX_BOOL (*callback)(void* param, void* pData), void* param) const
-{
- if (level == 0) {
- int count = m_DataSize - start;
- if (count > m_SegmentSize) {
- count = m_SegmentSize;
- }
- start += count;
- return IterateSegment((FX_LPCBYTE)pIndex, count, callback, param);
- }
- for (int i = 0; i < m_IndexSize; i ++) {
- if (pIndex[i] == NULL) {
- continue;
- }
- void* p = IterateIndex(level - 1, start, (void**)pIndex[i], callback, param);
- if (p) {
- return p;
- }
- }
- return NULL;
-}
-void* CFX_BaseSegmentedArray::Iterate(FX_BOOL (*callback)(void* param, void* pData), void* param) const
-{
- if (m_pIndex == NULL) {
- return NULL;
- }
- int start = 0;
- return IterateIndex(m_IndexDepth, start, (void**)m_pIndex, callback, param);
-}
-void* CFX_BaseSegmentedArray::GetAt(int index) const
-{
- if (index < 0 || index >= m_DataSize) {
- return NULL;
- }
- if (m_IndexDepth == 0) {
- return (FX_LPBYTE)m_pIndex + m_UnitSize * index;
- }
- int seg_index = index / m_SegmentSize;
- return (FX_LPBYTE)GetIndex(seg_index)[seg_index % m_IndexSize] + (index % m_SegmentSize) * m_UnitSize;
-}
-void CFX_BaseSegmentedArray::Delete(int index, int count)
-{
- if(index < 0 || count < 1 || index + count > m_DataSize) {
- return;
- }
- int i;
- for (i = index; i < m_DataSize - count; i ++) {
- FX_BYTE* pSrc = (FX_BYTE*)GetAt(i + count);
- FX_BYTE* pDest = (FX_BYTE*)GetAt(i);
- for (int j = 0; j < m_UnitSize; j ++) {
- pDest[j] = pSrc[j];
- }
- }
- int new_segs = (m_DataSize - count + m_SegmentSize - 1) / m_SegmentSize;
- int old_segs = (m_DataSize + m_SegmentSize - 1) / m_SegmentSize;
- if (new_segs < old_segs) {
- if(m_IndexDepth) {
- for (i = new_segs; i < old_segs; i ++) {
- void** pIndex = GetIndex(i);
- FX_Allocator_Free(m_pAllocator, pIndex[i % m_IndexSize]);
- pIndex[i % m_IndexSize] = NULL;
- }
- } else {
- FX_Allocator_Free(m_pAllocator, m_pIndex);
- m_pIndex = NULL;
- }
- }
- m_DataSize -= count;
-}
+// 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
+
+#include "../../include/fxcrt/fx_basic.h"
+CFX_BasicArray::CFX_BasicArray(int unit_size, IFX_Allocator* pAllocator)
+ : m_pAllocator(pAllocator)
+ , m_pData(NULL)
+ , m_nSize(0)
+ , m_nMaxSize(0)
+ , m_nGrowBy(0)
+{
+ if (unit_size < 0 || unit_size > (1 << 28)) {
+ m_nUnitSize = 4;
+ } else {
+ m_nUnitSize = unit_size;
+ }
+}
+CFX_BasicArray::~CFX_BasicArray()
+{
+ FX_Allocator_Free(m_pAllocator, m_pData);
+}
+FX_BOOL CFX_BasicArray::SetSize(int nNewSize, int nGrowBy)
+{
+ if (nNewSize < 0 || nNewSize > (1 << 28) / m_nUnitSize) {
+ m_pData = NULL;
+ m_nSize = m_nMaxSize = 0;
+ return FALSE;
+ }
+ if (nGrowBy >= 0) {
+ m_nGrowBy = nGrowBy;
+ }
+ if (nNewSize == 0) {
+ if (m_pData != NULL) {
+ FX_Allocator_Free(m_pAllocator, m_pData);
+ m_pData = NULL;
+ }
+ m_nSize = m_nMaxSize = 0;
+ } else if (m_pData == NULL) {
+ m_pData = FX_Allocator_Alloc(m_pAllocator, FX_BYTE, nNewSize * m_nUnitSize);
+ if (!m_pData) {
+ m_nSize = m_nMaxSize = 0;
+ return FALSE;
+ }
+ FXSYS_memset32(m_pData, 0, nNewSize * m_nUnitSize);
+ m_nSize = m_nMaxSize = nNewSize;
+ } else if (nNewSize <= m_nMaxSize) {
+ if (nNewSize > m_nSize) {
+ FXSYS_memset32(m_pData + m_nSize * m_nUnitSize, 0, (nNewSize - m_nSize) * m_nUnitSize);
+ }
+ m_nSize = nNewSize;
+ } else {
+ int nGrowBy = m_nGrowBy;
+ if (nGrowBy == 0) {
+ nGrowBy = m_nSize / 8;
+ nGrowBy = (nGrowBy < 4) ? 4 : ((nGrowBy > 1024) ? 1024 : nGrowBy);
+ }
+ int nNewMax;
+ if (nNewSize < m_nMaxSize + nGrowBy) {
+ nNewMax = m_nMaxSize + nGrowBy;
+ } else {
+ nNewMax = nNewSize;
+ }
+ FX_LPBYTE pNewData = FX_Allocator_Realloc(m_pAllocator, FX_BYTE, m_pData, nNewMax * m_nUnitSize);
+ if (pNewData == NULL) {
+ return FALSE;
+ }
+ FXSYS_memset32(pNewData + m_nSize * m_nUnitSize, 0, (nNewMax - m_nSize) * m_nUnitSize);
+ m_pData = pNewData;
+ m_nSize = nNewSize;
+ m_nMaxSize = nNewMax;
+ }
+ return TRUE;
+}
+FX_BOOL CFX_BasicArray::Append(const CFX_BasicArray& src)
+{
+ int nOldSize = m_nSize;
+ if (!SetSize(m_nSize + src.m_nSize, -1)) {
+ return FALSE;
+ }
+ FXSYS_memcpy32(m_pData + nOldSize * m_nUnitSize, src.m_pData, src.m_nSize * m_nUnitSize);
+ return TRUE;
+}
+FX_BOOL CFX_BasicArray::Copy(const CFX_BasicArray& src)
+{
+ if (!SetSize(src.m_nSize, -1)) {
+ return FALSE;
+ }
+ FXSYS_memcpy32(m_pData, src.m_pData, src.m_nSize * m_nUnitSize);
+ return TRUE;
+}
+FX_LPBYTE CFX_BasicArray::InsertSpaceAt(int nIndex, int nCount)
+{
+ if (nIndex < 0 || nCount <= 0) {
+ return NULL;
+ }
+ if (nIndex >= m_nSize) {
+ if (!SetSize(nIndex + nCount, -1)) {
+ return NULL;
+ }
+ } else {
+ int nOldSize = m_nSize;
+ if (!SetSize(m_nSize + nCount, -1)) {
+ return NULL;
+ }
+ FXSYS_memmove32(m_pData + (nIndex + nCount)*m_nUnitSize, m_pData + nIndex * m_nUnitSize,
+ (nOldSize - nIndex) * m_nUnitSize);
+ FXSYS_memset32(m_pData + nIndex * m_nUnitSize, 0, nCount * m_nUnitSize);
+ }
+ return m_pData + nIndex * m_nUnitSize;
+}
+FX_BOOL CFX_BasicArray::RemoveAt(int nIndex, int nCount)
+{
+ if (nIndex < 0 || nCount <= 0 || m_nSize < nIndex + nCount) {
+ return FALSE;
+ }
+ int nMoveCount = m_nSize - (nIndex + nCount);
+ if (nMoveCount) {
+ FXSYS_memmove32(m_pData + nIndex * m_nUnitSize, m_pData + (nIndex + nCount) * m_nUnitSize, nMoveCount * m_nUnitSize);
+ }
+ m_nSize -= nCount;
+ return TRUE;
+}
+FX_BOOL CFX_BasicArray::InsertAt(int nStartIndex, const CFX_BasicArray* pNewArray)
+{
+ if (pNewArray == NULL) {
+ return FALSE;
+ }
+ if (pNewArray->m_nSize == 0) {
+ return TRUE;
+ }
+ if (!InsertSpaceAt(nStartIndex, pNewArray->m_nSize)) {
+ return FALSE;
+ }
+ FXSYS_memcpy32(m_pData + nStartIndex * m_nUnitSize, pNewArray->m_pData, pNewArray->m_nSize * m_nUnitSize);
+ return TRUE;
+}
+const void* CFX_BasicArray::GetDataPtr(int index) const
+{
+ if (index < 0 || index >= m_nSize || m_pData == NULL) {
+ return NULL;
+ }
+ return m_pData + index * m_nUnitSize;
+}
+CFX_BaseSegmentedArray::CFX_BaseSegmentedArray(int unit_size, int segment_units, int index_size, IFX_Allocator* pAllocator)
+ : m_pAllocator(pAllocator)
+ , m_UnitSize(unit_size)
+ , m_SegmentSize(segment_units)
+ , m_IndexSize(index_size)
+ , m_IndexDepth(0)
+ , m_DataSize(0)
+ , m_pIndex(NULL)
+{
+}
+void CFX_BaseSegmentedArray::SetUnitSize(int unit_size, int segment_units, int index_size)
+{
+ ASSERT(m_DataSize == 0);
+ m_UnitSize = unit_size;
+ m_SegmentSize = segment_units;
+ m_IndexSize = index_size;
+}
+CFX_BaseSegmentedArray::~CFX_BaseSegmentedArray()
+{
+ RemoveAll();
+}
+static void _ClearIndex(IFX_Allocator* pAllcator, int level, int size, void** pIndex)
+{
+ if (level == 0) {
+ FX_Allocator_Free(pAllcator, pIndex);
+ return;
+ }
+ for (int i = 0; i < size; i ++) {
+ if (pIndex[i] == NULL) {
+ continue;
+ }
+ _ClearIndex(pAllcator, level - 1, size, (void**)pIndex[i]);
+ }
+ FX_Allocator_Free(pAllcator, pIndex);
+}
+void CFX_BaseSegmentedArray::RemoveAll()
+{
+ if (m_pIndex == NULL) {
+ return;
+ }
+ _ClearIndex(m_pAllocator, m_IndexDepth, m_IndexSize, (void**)m_pIndex);
+ m_pIndex = NULL;
+ m_IndexDepth = 0;
+ m_DataSize = 0;
+}
+void* CFX_BaseSegmentedArray::Add()
+{
+ if (m_DataSize % m_SegmentSize) {
+ return GetAt(m_DataSize ++);
+ }
+ void* pSegment = FX_Allocator_Alloc(m_pAllocator, FX_BYTE, m_UnitSize * m_SegmentSize);
+ if (!pSegment) {
+ return NULL;
+ }
+ if (m_pIndex == NULL) {
+ m_pIndex = pSegment;
+ m_DataSize ++;
+ return pSegment;
+ }
+ if (m_IndexDepth == 0) {
+ void** pIndex = (void**)FX_Allocator_Alloc(m_pAllocator, void*, m_IndexSize);
+ if (pIndex == NULL) {
+ FX_Allocator_Free(m_pAllocator, pSegment);
+ return NULL;
+ }
+ FXSYS_memset32(pIndex, 0, sizeof(void*) * m_IndexSize);
+ pIndex[0] = m_pIndex;
+ pIndex[1] = pSegment;
+ m_pIndex = pIndex;
+ m_DataSize ++;
+ m_IndexDepth ++;
+ return pSegment;
+ }
+ int seg_index = m_DataSize / m_SegmentSize;
+ if (seg_index % m_IndexSize) {
+ void** pIndex = GetIndex(seg_index);
+ pIndex[seg_index % m_IndexSize] = pSegment;
+ m_DataSize ++;
+ return pSegment;
+ }
+ int tree_size = 1;
+ int i;
+ for (i = 0; i < m_IndexDepth; i ++) {
+ tree_size *= m_IndexSize;
+ }
+ if (m_DataSize == tree_size * m_SegmentSize) {
+ void** pIndex = (void**)FX_Allocator_Alloc(m_pAllocator, void*, m_IndexSize);
+ if (pIndex == NULL) {
+ FX_Allocator_Free(m_pAllocator, pSegment);
+ return NULL;
+ }
+ FXSYS_memset32(pIndex, 0, sizeof(void*) * m_IndexSize);
+ pIndex[0] = m_pIndex;
+ m_pIndex = pIndex;
+ m_IndexDepth ++;
+ } else {
+ tree_size /= m_IndexSize;
+ }
+ void** pSpot = (void**)m_pIndex;
+ for (i = 1; i < m_IndexDepth; i ++) {
+ if (pSpot[seg_index / tree_size] == NULL) {
+ pSpot[seg_index / tree_size] = (void*)FX_Allocator_Alloc(m_pAllocator, void*, m_IndexSize);
+ if (pSpot[seg_index / tree_size] == NULL) {
+ break;
+ }
+ FXSYS_memset32(pSpot[seg_index / tree_size], 0, sizeof(void*) * m_IndexSize);
+ }
+ pSpot = (void**)pSpot[seg_index / tree_size];
+ seg_index = seg_index % tree_size;
+ tree_size /= m_IndexSize;
+ }
+ if (i < m_IndexDepth) {
+ FX_Allocator_Free(m_pAllocator, pSegment);
+ RemoveAll();
+ return NULL;
+ }
+ pSpot[seg_index % m_IndexSize] = pSegment;
+ m_DataSize ++;
+ return pSegment;
+}
+void** CFX_BaseSegmentedArray::GetIndex(int seg_index) const
+{
+ ASSERT(m_IndexDepth != 0);
+ if (m_IndexDepth == 1) {
+ return (void**)m_pIndex;
+ } else if (m_IndexDepth == 2) {
+ return (void**)((void**)m_pIndex)[seg_index / m_IndexSize];
+ }
+ int tree_size = 1;
+ int i;
+ for (i = 1; i < m_IndexDepth; i ++) {
+ tree_size *= m_IndexSize;
+ }
+ void** pSpot = (void**)m_pIndex;
+ for (i = 1; i < m_IndexDepth; i ++) {
+ pSpot = (void**)pSpot[seg_index / tree_size];
+ seg_index = seg_index % tree_size;
+ tree_size /= m_IndexSize;
+ }
+ return pSpot;
+}
+void* CFX_BaseSegmentedArray::IterateSegment(FX_LPCBYTE pSegment, int count, FX_BOOL (*callback)(void* param, void* pData), void* param) const
+{
+ for (int i = 0; i < count; i ++) {
+ if (!callback(param, (void*)(pSegment + i * m_UnitSize))) {
+ return (void*)(pSegment + i * m_UnitSize);
+ }
+ }
+ return NULL;
+}
+void* CFX_BaseSegmentedArray::IterateIndex(int level, int& start, void** pIndex, FX_BOOL (*callback)(void* param, void* pData), void* param) const
+{
+ if (level == 0) {
+ int count = m_DataSize - start;
+ if (count > m_SegmentSize) {
+ count = m_SegmentSize;
+ }
+ start += count;
+ return IterateSegment((FX_LPCBYTE)pIndex, count, callback, param);
+ }
+ for (int i = 0; i < m_IndexSize; i ++) {
+ if (pIndex[i] == NULL) {
+ continue;
+ }
+ void* p = IterateIndex(level - 1, start, (void**)pIndex[i], callback, param);
+ if (p) {
+ return p;
+ }
+ }
+ return NULL;
+}
+void* CFX_BaseSegmentedArray::Iterate(FX_BOOL (*callback)(void* param, void* pData), void* param) const
+{
+ if (m_pIndex == NULL) {
+ return NULL;
+ }
+ int start = 0;
+ return IterateIndex(m_IndexDepth, start, (void**)m_pIndex, callback, param);
+}
+void* CFX_BaseSegmentedArray::GetAt(int index) const
+{
+ if (index < 0 || index >= m_DataSize) {
+ return NULL;
+ }
+ if (m_IndexDepth == 0) {
+ return (FX_LPBYTE)m_pIndex + m_UnitSize * index;
+ }
+ int seg_index = index / m_SegmentSize;
+ return (FX_LPBYTE)GetIndex(seg_index)[seg_index % m_IndexSize] + (index % m_SegmentSize) * m_UnitSize;
+}
+void CFX_BaseSegmentedArray::Delete(int index, int count)
+{
+ if(index < 0 || count < 1 || index + count > m_DataSize) {
+ return;
+ }
+ int i;
+ for (i = index; i < m_DataSize - count; i ++) {
+ FX_BYTE* pSrc = (FX_BYTE*)GetAt(i + count);
+ FX_BYTE* pDest = (FX_BYTE*)GetAt(i);
+ for (int j = 0; j < m_UnitSize; j ++) {
+ pDest[j] = pSrc[j];
+ }
+ }
+ int new_segs = (m_DataSize - count + m_SegmentSize - 1) / m_SegmentSize;
+ int old_segs = (m_DataSize + m_SegmentSize - 1) / m_SegmentSize;
+ if (new_segs < old_segs) {
+ if(m_IndexDepth) {
+ for (i = new_segs; i < old_segs; i ++) {
+ void** pIndex = GetIndex(i);
+ FX_Allocator_Free(m_pAllocator, pIndex[i % m_IndexSize]);
+ pIndex[i % m_IndexSize] = NULL;
+ }
+ } else {
+ FX_Allocator_Free(m_pAllocator, m_pIndex);
+ m_pIndex = NULL;
+ }
+ }
+ m_DataSize -= count;
+}
diff --git a/core/src/fxcrt/fx_basic_bstring.cpp b/core/src/fxcrt/fx_basic_bstring.cpp
index f28b069efc..ef52447771 100644
--- a/core/src/fxcrt/fx_basic_bstring.cpp
+++ b/core/src/fxcrt/fx_basic_bstring.cpp
@@ -1,1204 +1,1204 @@
-// 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
-
-#include "../../include/fxcrt/fx_basic.h"
-static int _Buffer_itoa(char* buf, int i, FX_DWORD flags)
-{
- if (i == 0) {
- buf[0] = '0';
- return 1;
- }
- char buf1[32];
- int buf_pos = 31;
- FX_DWORD u = i;
- if ((flags & FXFORMAT_SIGNED) && i < 0) {
- u = -i;
- }
- int base = 10;
- FX_LPCSTR string = "0123456789abcdef";
- if (flags & FXFORMAT_HEX) {
- base = 16;
- if (flags & FXFORMAT_CAPITAL) {
- string = "0123456789ABCDEF";
- }
- }
- while (u != 0) {
- buf1[buf_pos--] = string[u % base];
- u = u / base;
- }
- if ((flags & FXFORMAT_SIGNED) && i < 0) {
- buf1[buf_pos--] = '-';
- }
- int len = 31 - buf_pos;
- for (int ii = 0; ii < len; ii ++) {
- buf[ii] = buf1[ii + buf_pos + 1];
- }
- return len;
-}
-CFX_ByteString CFX_ByteString::FormatInteger(int i, FX_DWORD flags)
-{
- char buf[32];
- return CFX_ByteStringC(buf, _Buffer_itoa(buf, i, flags));
-}
-static CFX_StringData* FX_AllocString(int nLen)
-{
- if (nLen == 0) {
- return NULL;
- }
- CFX_StringData* pData = (CFX_StringData*)FX_Alloc(FX_BYTE, sizeof(long) * 3 + (nLen + 1) * sizeof(char));
- if (!pData) {
- return NULL;
- }
- pData->m_nAllocLength = nLen;
- pData->m_nDataLength = nLen;
- pData->m_nRefs = 1;
- pData->m_String[nLen] = 0;
- return pData;
-}
-static void FX_ReleaseString(CFX_StringData* pData)
-{
- if (pData == NULL) {
- return;
- }
- pData->m_nRefs --;
- if (pData->m_nRefs <= 0) {
- FX_Free(pData);
- }
-}
-CFX_ByteString::~CFX_ByteString()
-{
- if (m_pData == NULL) {
- return;
- }
- m_pData->m_nRefs --;
- if (m_pData->m_nRefs < 1) {
- FX_Free(m_pData);
- }
-}
-CFX_ByteString::CFX_ByteString(FX_LPCSTR lpsz, FX_STRSIZE nLen)
-{
- if (nLen < 0) {
- nLen = lpsz ? (FX_STRSIZE)FXSYS_strlen(lpsz) : 0;
- }
- if (nLen) {
- m_pData = FX_AllocString(nLen);
- if (m_pData) {
- FXSYS_memcpy32(m_pData->m_String, lpsz, nLen * sizeof(char));
- }
- } else {
- m_pData = NULL;
- }
-}
-CFX_ByteString::CFX_ByteString(FX_LPCBYTE lpsz, FX_STRSIZE nLen)
-{
- if (nLen > 0) {
- m_pData = FX_AllocString(nLen);
- if (m_pData) {
- FXSYS_memcpy32(m_pData->m_String, lpsz, nLen * sizeof(char));
- }
- } else {
- m_pData = NULL;
- }
-}
-CFX_ByteString::CFX_ByteString(char ch)
-{
- m_pData = FX_AllocString(1);
- if (m_pData) {
- m_pData->m_String[0] = ch;
- }
-}
-CFX_ByteString::CFX_ByteString(const CFX_ByteString& stringSrc)
-{
- if (stringSrc.m_pData == NULL) {
- m_pData = NULL;
- return;
- }
- if (stringSrc.m_pData->m_nRefs >= 0) {
- m_pData = stringSrc.m_pData;
- m_pData->m_nRefs ++;
- } else {
- m_pData = NULL;
- *this = stringSrc;
- }
-}
-CFX_ByteString::CFX_ByteString(FX_BSTR stringSrc)
-{
- if (stringSrc.IsEmpty()) {
- m_pData = NULL;
- return;
- } else {
- m_pData = NULL;
- *this = stringSrc;
- }
-}
-CFX_ByteString::CFX_ByteString(FX_BSTR str1, FX_BSTR str2)
-{
- m_pData = NULL;
- int nNewLen = str1.GetLength() + str2.GetLength();
- if (nNewLen == 0) {
- return;
- }
- m_pData = FX_AllocString(nNewLen);
- if (m_pData) {
- FXSYS_memcpy32(m_pData->m_String, str1.GetCStr(), str1.GetLength());
- FXSYS_memcpy32(m_pData->m_String + str1.GetLength(), str2.GetCStr(), str2.GetLength());
- }
-}
-const CFX_ByteString& CFX_ByteString::operator=(FX_LPCSTR lpsz)
-{
- if (lpsz == NULL || lpsz[0] == 0) {
- Empty();
- } else {
- AssignCopy((FX_STRSIZE)FXSYS_strlen(lpsz), lpsz);
- }
- return *this;
-}
-const CFX_ByteString& CFX_ByteString::operator=(FX_BSTR str)
-{
- if (str.IsEmpty()) {
- Empty();
- } else {
- AssignCopy(str.GetLength(), str.GetCStr());
- }
- return *this;
-}
-const CFX_ByteString& CFX_ByteString::operator=(const CFX_ByteString& stringSrc)
-{
- if (m_pData == stringSrc.m_pData) {
- return *this;
- }
- if (stringSrc.IsEmpty()) {
- Empty();
- } else if ((m_pData && m_pData->m_nRefs < 0) ||
- (stringSrc.m_pData && stringSrc.m_pData->m_nRefs < 0)) {
- AssignCopy(stringSrc.m_pData->m_nDataLength, stringSrc.m_pData->m_String);
- } else {
- Empty();
- m_pData = stringSrc.m_pData;
- if (m_pData) {
- m_pData->m_nRefs ++;
- }
- }
- return *this;
-}
-const CFX_ByteString& CFX_ByteString::operator=(const CFX_BinaryBuf& buf)
-{
- Load(buf.GetBuffer(), buf.GetSize());
- return *this;
-}
-void CFX_ByteString::Load(FX_LPCBYTE buf, FX_STRSIZE len)
-{
- Empty();
- if (len) {
- m_pData = FX_AllocString(len);
- if (m_pData) {
- FXSYS_memcpy32(m_pData->m_String, buf, len * sizeof(char));
- }
- } else {
- m_pData = NULL;
- }
-}
-const CFX_ByteString& CFX_ByteString::operator+=(FX_LPCSTR lpsz)
-{
- if (lpsz) {
- ConcatInPlace((FX_STRSIZE)FXSYS_strlen(lpsz), lpsz);
- }
- return *this;
-}
-const CFX_ByteString& CFX_ByteString::operator+=(char ch)
-{
- ConcatInPlace(1, &ch);
- return *this;
-}
-const CFX_ByteString& CFX_ByteString::operator+=(const CFX_ByteString& string)
-{
- if (string.m_pData == NULL) {
- return *this;
- }
- ConcatInPlace(string.m_pData->m_nDataLength, string.m_pData->m_String);
- return *this;
-}
-const CFX_ByteString& CFX_ByteString::operator+=(FX_BSTR string)
-{
- if (string.IsEmpty()) {
- return *this;
- }
- ConcatInPlace(string.GetLength(), string.GetCStr());
- return *this;
-}
-bool CFX_ByteString::Equal(FX_BSTR str) const
-{
- if (m_pData == NULL) {
- return str.IsEmpty();
- }
- return m_pData->m_nDataLength == str.GetLength() &&
- FXSYS_memcmp32(m_pData->m_String, str.GetCStr(), str.GetLength()) == 0;
-}
-bool CFX_ByteString::operator ==(const CFX_ByteString& s2) const
-{
- if (m_pData == NULL) {
- return s2.IsEmpty();
- }
- if (s2.m_pData == NULL) {
- return false;
- }
- return m_pData->m_nDataLength == s2.m_pData->m_nDataLength &&
- FXSYS_memcmp32(m_pData->m_String, s2.m_pData->m_String, m_pData->m_nDataLength) == 0;
-}
-void CFX_ByteString::Empty()
-{
- if (m_pData == NULL) {
- return;
- }
- if (m_pData->m_nRefs > 1) {
- m_pData->m_nRefs --;
- } else {
- FX_Free(m_pData);
- }
- m_pData = NULL;
-}
-bool CFX_ByteString::EqualNoCase(FX_BSTR str) const
-{
- if (m_pData == NULL) {
- return str.IsEmpty();
- }
- FX_STRSIZE len = str.GetLength();
- if (m_pData->m_nDataLength != len) {
- return false;
- }
- FX_LPCBYTE pThis = (FX_LPCBYTE)m_pData->m_String;
- FX_LPCBYTE pThat = (FX_LPCBYTE)str;
- for (FX_STRSIZE i = 0; i < len; i ++) {
- if ((*pThis) != (*pThat)) {
- FX_BYTE bThis = *pThis;
- if (bThis >= 'A' && bThis <= 'Z') {
- bThis += 'a' - 'A';
- }
- FX_BYTE bThat = *pThat;
- if (bThat >= 'A' && bThat <= 'Z') {
- bThat += 'a' - 'A';
- }
- if (bThis != bThat) {
- return false;
- }
- }
- pThis ++;
- pThat ++;
- }
- return true;
-}
-void CFX_ByteString::AssignCopy(FX_STRSIZE nSrcLen, FX_LPCSTR lpszSrcData)
-{
- AllocBeforeWrite(nSrcLen);
- FXSYS_memcpy32(m_pData->m_String, lpszSrcData, nSrcLen * sizeof(char));
- m_pData->m_nDataLength = nSrcLen;
- m_pData->m_String[nSrcLen] = 0;
-}
-void CFX_ByteString::CopyBeforeWrite()
-{
- if (m_pData == NULL || m_pData->m_nRefs <= 1) {
- return;
- }
- CFX_StringData* pData = m_pData;
- m_pData->m_nRefs --;
- FX_STRSIZE nDataLength = pData->m_nDataLength;
- m_pData = FX_AllocString(nDataLength);
- if (m_pData != NULL) {
- FXSYS_memcpy32(m_pData->m_String, pData->m_String, (nDataLength + 1) * sizeof(char));
- }
-}
-void CFX_ByteString::AllocBeforeWrite(FX_STRSIZE nLen)
-{
- if (m_pData && m_pData->m_nRefs <= 1 && m_pData->m_nAllocLength >= nLen) {
- return;
- }
- Empty();
- m_pData = FX_AllocString(nLen);
-}
-void CFX_ByteString::ReleaseBuffer(FX_STRSIZE nNewLength)
-{
- if (m_pData == NULL) {
- return;
- }
- CopyBeforeWrite();
- if (nNewLength == -1) {
- nNewLength = (FX_STRSIZE)FXSYS_strlen((FX_LPCSTR)m_pData->m_String);
- }
- if (nNewLength == 0) {
- Empty();
- return;
- }
- FXSYS_assert(nNewLength <= m_pData->m_nAllocLength);
- m_pData->m_nDataLength = nNewLength;
- m_pData->m_String[nNewLength] = 0;
-}
-FX_LPSTR CFX_ByteString::LockBuffer()
-{
- if (m_pData == NULL) {
- return NULL;
- }
- FX_LPSTR lpsz = GetBuffer(0);
- m_pData->m_nRefs = -1;
- return lpsz;
-}
-void CFX_ByteString::Reserve(FX_STRSIZE len)
-{
- GetBuffer(len);
- ReleaseBuffer(GetLength());
-}
-FX_LPSTR CFX_ByteString::GetBuffer(FX_STRSIZE nMinBufLength)
-{
- if (m_pData == NULL && nMinBufLength == 0) {
- return NULL;
- }
- if (m_pData && m_pData->m_nRefs <= 1 && m_pData->m_nAllocLength >= nMinBufLength) {
- return m_pData->m_String;
- }
- if (m_pData == NULL) {
- m_pData = FX_AllocString(nMinBufLength);
- if (!m_pData) {
- return NULL;
- }
- m_pData->m_nDataLength = 0;
- m_pData->m_String[0] = 0;
- return m_pData->m_String;
- }
- CFX_StringData* pOldData = m_pData;
- FX_STRSIZE nOldLen = pOldData->m_nDataLength;
- if (nMinBufLength < nOldLen) {
- nMinBufLength = nOldLen;
- }
- m_pData = FX_AllocString(nMinBufLength);
- if (!m_pData) {
- return NULL;
- }
- FXSYS_memcpy32(m_pData->m_String, pOldData->m_String, (nOldLen + 1)*sizeof(char));
- m_pData->m_nDataLength = nOldLen;
- pOldData->m_nRefs --;
- if (pOldData->m_nRefs <= 0) {
- FX_Free(pOldData);
- }
- return m_pData->m_String;
-}
-FX_STRSIZE CFX_ByteString::Delete(FX_STRSIZE nIndex, FX_STRSIZE nCount)
-{
- if (m_pData == NULL) {
- return 0;
- }
- if (nIndex < 0) {
- nIndex = 0;
- }
- FX_STRSIZE nOldLength = m_pData->m_nDataLength;
- if (nCount > 0 && nIndex < nOldLength) {
- FX_STRSIZE mLength = nIndex + nCount;
- if (mLength >= nOldLength) {
- m_pData->m_nDataLength = nIndex;
- return m_pData->m_nDataLength;
- }
- CopyBeforeWrite();
- int nBytesToCopy = nOldLength - mLength + 1;
- FXSYS_memmove32(m_pData->m_String + nIndex,
- m_pData->m_String + mLength, nBytesToCopy * sizeof(char));
- m_pData->m_nDataLength = nOldLength - nCount;
- }
- return m_pData->m_nDataLength;
-}
-void CFX_ByteString::ConcatInPlace(FX_STRSIZE nSrcLen, FX_LPCSTR lpszSrcData)
-{
- if (nSrcLen == 0 || lpszSrcData == NULL) {
- return;
- }
- if (m_pData == NULL) {
- m_pData = FX_AllocString(nSrcLen);
- if (!m_pData) {
- return;
- }
- FXSYS_memcpy32(m_pData->m_String, lpszSrcData, nSrcLen * sizeof(char));
- return;
- }
- if (m_pData->m_nRefs > 1 || m_pData->m_nDataLength + nSrcLen > m_pData->m_nAllocLength) {
- CFX_StringData* pOldData = m_pData;
- ConcatCopy(m_pData->m_nDataLength, m_pData->m_String, nSrcLen, lpszSrcData);
- FX_ReleaseString(pOldData);
- } else {
- FXSYS_memcpy32(m_pData->m_String + m_pData->m_nDataLength, lpszSrcData, nSrcLen * sizeof(char));
- m_pData->m_nDataLength += nSrcLen;
- m_pData->m_String[m_pData->m_nDataLength] = 0;
- }
-}
-void CFX_ByteString::ConcatCopy(FX_STRSIZE nSrc1Len, FX_LPCSTR lpszSrc1Data,
- FX_STRSIZE nSrc2Len, FX_LPCSTR lpszSrc2Data)
-{
- int nNewLen = nSrc1Len + nSrc2Len;
- if (nNewLen == 0) {
- return;
- }
- m_pData = FX_AllocString(nNewLen);
- if (m_pData) {
- FXSYS_memcpy32(m_pData->m_String, lpszSrc1Data, nSrc1Len * sizeof(char));
- FXSYS_memcpy32(m_pData->m_String + nSrc1Len, lpszSrc2Data, nSrc2Len * sizeof(char));
- }
-}
-CFX_ByteString CFX_ByteString::Mid(FX_STRSIZE nFirst) const
-{
- if (m_pData == NULL) {
- return CFX_ByteString();
- }
- return Mid(nFirst, m_pData->m_nDataLength - nFirst);
-}
-CFX_ByteString CFX_ByteString::Mid(FX_STRSIZE nFirst, FX_STRSIZE nCount) const
-{
- if (nFirst < 0) {
- nFirst = 0;
- }
- if (nCount < 0) {
- nCount = 0;
- }
- if (nFirst + nCount > m_pData->m_nDataLength) {
- nCount = m_pData->m_nDataLength - nFirst;
- }
- if (nFirst > m_pData->m_nDataLength) {
- nCount = 0;
- }
- if (nFirst == 0 && nFirst + nCount == m_pData->m_nDataLength) {
- return *this;
- }
- CFX_ByteString dest;
- AllocCopy(dest, nCount, nFirst, 0);
- return dest;
-}
-void CFX_ByteString::AllocCopy(CFX_ByteString& dest, FX_STRSIZE nCopyLen, FX_STRSIZE nCopyIndex,
- FX_STRSIZE nExtraLen) const
-{
- FX_STRSIZE nNewLen = nCopyLen + nExtraLen;
- if (nNewLen == 0) {
- return;
- }
- ASSERT(dest.m_pData == NULL);
- dest.m_pData = FX_AllocString(nNewLen);
- if (dest.m_pData) {
- FXSYS_memcpy32(dest.m_pData->m_String, m_pData->m_String + nCopyIndex, nCopyLen * sizeof(char));
- }
-}
-#define FORCE_ANSI 0x10000
-#define FORCE_UNICODE 0x20000
-#define FORCE_INT64 0x40000
-void CFX_ByteString::FormatV(FX_LPCSTR lpszFormat, va_list argList)
-{
- va_list argListSave;
-#if defined(__ARMCC_VERSION) || (!defined(_MSC_VER) && (_FX_CPU_ == _FX_X64_ || _FX_CPU_ == _FX_IA64_ || _FX_CPU_ == _FX_ARM64_)) || defined(__native_client__)
- va_copy(argListSave, argList);
-#else
- argListSave = argList;
-#endif
- int nMaxLen = 0;
- for (FX_LPCSTR lpsz = lpszFormat; *lpsz != 0; lpsz ++) {
- if (*lpsz != '%' || *(lpsz = lpsz + 1) == '%') {
- nMaxLen += (FX_STRSIZE)FXSYS_strlen(lpsz);
- continue;
- }
- int nItemLen = 0;
- int nWidth = 0;
- for (; *lpsz != 0; lpsz ++) {
- if (*lpsz == '#') {
- nMaxLen += 2;
- } else if (*lpsz == '*') {
- nWidth = va_arg(argList, int);
- } else if (*lpsz == '-' || *lpsz == '+' || *lpsz == '0' ||
- *lpsz == ' ')
- ;
- else {
- break;
- }
- }
- if (nWidth == 0) {
- nWidth = FXSYS_atoi(lpsz);
- for (; (*lpsz) >= '0' && (*lpsz) <= '9'; lpsz ++)
- ;
- }
- if (nWidth < 0 || nWidth > 128 * 1024) {
- lpszFormat = "Bad width";
- nMaxLen = 10;
- break;
- }
- int nPrecision = 0;
- if (*lpsz == '.') {
- lpsz ++;
- if (*lpsz == '*') {
- nPrecision = va_arg(argList, int);
- lpsz ++;
- } else {
- nPrecision = FXSYS_atoi(lpsz);
- for (; (*lpsz) >= '0' && (*lpsz) <= '9'; lpsz ++)
- ;
- }
- }
- if (nPrecision < 0 || nPrecision > 128 * 1024) {
- lpszFormat = "Bad precision";
- nMaxLen = 14;
- break;
- }
- int nModifier = 0;
- if (FXSYS_strncmp(lpsz, "I64", 3) == 0) {
- lpsz += 3;
- nModifier = FORCE_INT64;
- } else {
- switch (*lpsz) {
- case 'h':
- nModifier = FORCE_ANSI;
- lpsz ++;
- break;
- case 'l':
- nModifier = FORCE_UNICODE;
- lpsz ++;
- break;
- case 'F':
- case 'N':
- case 'L':
- lpsz ++;
- break;
- }
- }
- switch (*lpsz | nModifier) {
- case 'c':
- case 'C':
- nItemLen = 2;
- va_arg(argList, int);
- break;
- case 'c'|FORCE_ANSI:
- case 'C'|FORCE_ANSI:
- nItemLen = 2;
- va_arg(argList, int);
- break;
- case 'c'|FORCE_UNICODE:
- case 'C'|FORCE_UNICODE:
- nItemLen = 2;
- va_arg(argList, int);
- break;
- case 's': {
- FX_LPCSTR pstrNextArg = va_arg(argList, FX_LPCSTR);
- if (pstrNextArg == NULL) {
- nItemLen = 6;
- } else {
- nItemLen = (FX_STRSIZE)FXSYS_strlen(pstrNextArg);
- if (nItemLen < 1) {
- nItemLen = 1;
- }
- }
- }
- break;
- case 'S': {
- FX_LPWSTR pstrNextArg = va_arg(argList, FX_LPWSTR);
- if (pstrNextArg == NULL) {
- nItemLen = 6;
- } else {
- nItemLen = (FX_STRSIZE)FXSYS_wcslen(pstrNextArg);
- if (nItemLen < 1) {
- nItemLen = 1;
- }
- }
- }
- break;
- case 's'|FORCE_ANSI:
- case 'S'|FORCE_ANSI: {
- FX_LPCSTR pstrNextArg = va_arg(argList, FX_LPCSTR);
- if (pstrNextArg == NULL) {
- nItemLen = 6;
- } else {
- nItemLen = (FX_STRSIZE)FXSYS_strlen(pstrNextArg);
- if (nItemLen < 1) {
- nItemLen = 1;
- }
- }
- }
- break;
- case 's'|FORCE_UNICODE:
- case 'S'|FORCE_UNICODE: {
- FX_LPWSTR pstrNextArg = va_arg(argList, FX_LPWSTR);
- if (pstrNextArg == NULL) {
- nItemLen = 6;
- } else {
- nItemLen = (FX_STRSIZE)FXSYS_wcslen(pstrNextArg);
- if (nItemLen < 1) {
- nItemLen = 1;
- }
- }
- }
- break;
- }
- if (nItemLen != 0) {
- if (nPrecision != 0 && nItemLen > nPrecision) {
- nItemLen = nPrecision;
- }
- if (nItemLen < nWidth) {
- nItemLen = nWidth;
- }
- } else {
- switch (*lpsz) {
- case 'd':
- case 'i':
- case 'u':
- case 'x':
- case 'X':
- case 'o':
- if (nModifier & FORCE_INT64) {
- va_arg(argList, FX_INT64);
- } else {
- va_arg(argList, int);
- }
- nItemLen = 32;
- if (nItemLen < nWidth + nPrecision) {
- nItemLen = nWidth + nPrecision;
- }
- break;
- case 'a':
- case 'A':
- case 'e':
- case 'E':
- case 'g':
- case 'G':
- va_arg(argList, double);
- nItemLen = 128;
- if (nItemLen < nWidth + nPrecision) {
- nItemLen = nWidth + nPrecision;
- }
- break;
- case 'f':
- if (nWidth + nPrecision > 100) {
- nItemLen = nPrecision + nWidth + 128;
- } else {
- double f;
- char pszTemp[256];
- f = va_arg(argList, double);
- FXSYS_sprintf(pszTemp, "%*.*f", nWidth, nPrecision + 6, f );
- nItemLen = (FX_STRSIZE)FXSYS_strlen(pszTemp);
- }
- break;
- case 'p':
- va_arg(argList, void*);
- nItemLen = 32;
- if (nItemLen < nWidth + nPrecision) {
- nItemLen = nWidth + nPrecision;
- }
- break;
- case 'n':
- va_arg(argList, int*);
- break;
- }
- }
- nMaxLen += nItemLen;
- }
- GetBuffer(nMaxLen);
- if (m_pData) {
- FXSYS_vsprintf(m_pData->m_String, lpszFormat, argListSave);
- ReleaseBuffer();
- }
- va_end(argListSave);
-}
-void CFX_ByteString::Format(FX_LPCSTR lpszFormat, ...)
-{
- va_list argList;
- va_start(argList, lpszFormat);
- FormatV(lpszFormat, argList);
- va_end(argList);
-}
-FX_STRSIZE CFX_ByteString::Insert(FX_STRSIZE nIndex, FX_CHAR ch)
-{
- CopyBeforeWrite();
- if (nIndex < 0) {
- nIndex = 0;
- }
- FX_STRSIZE nNewLength = m_pData ? m_pData->m_nDataLength : 0;
- if (nIndex > nNewLength) {
- nIndex = nNewLength;
- }
- nNewLength++;
- if (m_pData == NULL || m_pData->m_nAllocLength < nNewLength) {
- CFX_StringData* pOldData = m_pData;
- FX_LPCSTR pstr = m_pData->m_String;
- m_pData = FX_AllocString(nNewLength);
- if (!m_pData) {
- return 0;
- }
- if(pOldData != NULL) {
- FXSYS_memmove32(m_pData->m_String, pstr, (pOldData->m_nDataLength + 1)*sizeof(char));
- FX_ReleaseString(pOldData);
- } else {
- m_pData->m_String[0] = 0;
- }
- }
- FXSYS_memmove32(m_pData->m_String + nIndex + 1,
- m_pData->m_String + nIndex, (nNewLength - nIndex)*sizeof(char));
- m_pData->m_String[nIndex] = ch;
- m_pData->m_nDataLength = nNewLength;
- return nNewLength;
-}
-CFX_ByteString CFX_ByteString::Right(FX_STRSIZE nCount) const
-{
- if (m_pData == NULL) {
- return CFX_ByteString();
- }
- if (nCount < 0) {
- nCount = 0;
- }
- if (nCount >= m_pData->m_nDataLength) {
- return *this;
- }
- CFX_ByteString dest;
- AllocCopy(dest, nCount, m_pData->m_nDataLength - nCount, 0);
- return dest;
-}
-CFX_ByteString CFX_ByteString::Left(FX_STRSIZE nCount) const
-{
- if (m_pData == NULL) {
- return CFX_ByteString();
- }
- if (nCount < 0) {
- nCount = 0;
- }
- if (nCount >= m_pData->m_nDataLength) {
- return *this;
- }
- CFX_ByteString dest;
- AllocCopy(dest, nCount, 0, 0);
- return dest;
-}
-FX_STRSIZE CFX_ByteString::Find(FX_CHAR ch, FX_STRSIZE nStart) const
-{
- if (m_pData == NULL) {
- return -1;
- }
- FX_STRSIZE nLength = m_pData->m_nDataLength;
- if (nStart >= nLength) {
- return -1;
- }
- FX_LPCSTR lpsz = FXSYS_strchr(m_pData->m_String + nStart, ch);
- return (lpsz == NULL) ? -1 : (int)(lpsz - m_pData->m_String);
-}
-FX_STRSIZE CFX_ByteString::ReverseFind(FX_CHAR ch) const
-{
- if (m_pData == NULL) {
- return -1;
- }
- FX_STRSIZE nLength = m_pData->m_nDataLength;
- while (nLength) {
- if (m_pData->m_String[nLength - 1] == ch) {
- return nLength - 1;
- }
- nLength --;
- }
- return -1;
-}
-FX_LPCSTR FX_strstr(FX_LPCSTR str1, int len1, FX_LPCSTR str2, int len2)
-{
- if (len2 > len1 || len2 == 0) {
- return NULL;
- }
- FX_LPCSTR end_ptr = str1 + len1 - len2;
- while (str1 <= end_ptr) {
- int i = 0;
- while (1) {
- if (str1[i] != str2[i]) {
- break;
- }
- i ++;
- if (i == len2) {
- return str1;
- }
- }
- str1 ++;
- }
- return NULL;
-}
-FX_STRSIZE CFX_ByteString::Find(FX_BSTR lpszSub, FX_STRSIZE nStart) const
-{
- if (m_pData == NULL) {
- return -1;
- }
- FX_STRSIZE nLength = m_pData->m_nDataLength;
- if (nStart > nLength) {
- return -1;
- }
- FX_LPCSTR lpsz = FX_strstr(m_pData->m_String + nStart, m_pData->m_nDataLength - nStart,
- lpszSub.GetCStr(), lpszSub.GetLength());
- return (lpsz == NULL) ? -1 : (int)(lpsz - m_pData->m_String);
-}
-void CFX_ByteString::MakeLower()
-{
- if (m_pData == NULL) {
- return;
- }
- CopyBeforeWrite();
- if (GetLength() < 1) {
- return;
- }
- FXSYS_strlwr(m_pData->m_String);
-}
-void CFX_ByteString::MakeUpper()
-{
- if (m_pData == NULL) {
- return;
- }
- CopyBeforeWrite();
- if (GetLength() < 1) {
- return;
- }
- FXSYS_strupr(m_pData->m_String);
-}
-FX_STRSIZE CFX_ByteString::Remove(FX_CHAR chRemove)
-{
- if (m_pData == NULL) {
- return 0;
- }
- CopyBeforeWrite();
- if (GetLength() < 1) {
- return 0;
- }
- FX_LPSTR pstrSource = m_pData->m_String;
- FX_LPSTR pstrDest = m_pData->m_String;
- FX_LPSTR pstrEnd = m_pData->m_String + m_pData->m_nDataLength;
- while (pstrSource < pstrEnd) {
- if (*pstrSource != chRemove) {
- *pstrDest = *pstrSource;
- pstrDest ++;
- }
- pstrSource ++;
- }
- *pstrDest = 0;
- FX_STRSIZE nCount = (FX_STRSIZE)(pstrSource - pstrDest);
- m_pData->m_nDataLength -= nCount;
- return nCount;
-}
-FX_STRSIZE CFX_ByteString::Replace(FX_BSTR lpszOld, FX_BSTR lpszNew)
-{
- if (m_pData == NULL) {
- return 0;
- }
- if (lpszOld.IsEmpty()) {
- return 0;
- }
- FX_STRSIZE nSourceLen = lpszOld.GetLength();
- FX_STRSIZE nReplacementLen = lpszNew.GetLength();
- FX_STRSIZE nCount = 0;
- FX_LPCSTR pStart = m_pData->m_String;
- FX_LPSTR pEnd = m_pData->m_String + m_pData->m_nDataLength;
- while (1) {
- FX_LPCSTR pTarget = FX_strstr(pStart, (FX_STRSIZE)(pEnd - pStart), lpszOld.GetCStr(), nSourceLen);
- if (pTarget == NULL) {
- break;
- }
- nCount++;
- pStart = pTarget + nSourceLen;
- }
- if (nCount == 0) {
- return 0;
- }
- FX_STRSIZE nNewLength = m_pData->m_nDataLength + (nReplacementLen - nSourceLen) * nCount;
- if (nNewLength == 0) {
- Empty();
- return nCount;
- }
- CFX_StringData* pNewData = FX_AllocString(nNewLength);
- if (!pNewData) {
- return 0;
- }
- pStart = m_pData->m_String;
- FX_LPSTR pDest = pNewData->m_String;
- for (FX_STRSIZE i = 0; i < nCount; i ++) {
- FX_LPCSTR pTarget = FX_strstr(pStart, (FX_STRSIZE)(pEnd - pStart), lpszOld.GetCStr(), nSourceLen);
- FXSYS_memcpy32(pDest, pStart, pTarget - pStart);
- pDest += pTarget - pStart;
- FXSYS_memcpy32(pDest, lpszNew.GetCStr(), lpszNew.GetLength());
- pDest += lpszNew.GetLength();
- pStart = pTarget + nSourceLen;
- }
- FXSYS_memcpy32(pDest, pStart, pEnd - pStart);
- FX_ReleaseString(m_pData);
- m_pData = pNewData;
- return nCount;
-}
-void CFX_ByteString::SetAt(FX_STRSIZE nIndex, FX_CHAR ch)
-{
- if (m_pData == NULL) {
- return;
- }
- FXSYS_assert(nIndex >= 0);
- FXSYS_assert(nIndex < m_pData->m_nDataLength);
- CopyBeforeWrite();
- m_pData->m_String[nIndex] = ch;
-}
-CFX_ByteString CFX_ByteString::LoadFromFile(FX_BSTR filename)
-{
- FXSYS_FILE* file = FXSYS_fopen(CFX_ByteString(filename), "rb");
- if (file == NULL) {
- return CFX_ByteString();
- }
- FXSYS_fseek(file, 0, FXSYS_SEEK_END);
- int len = FXSYS_ftell(file);
- FXSYS_fseek(file, 0, FXSYS_SEEK_SET);
- CFX_ByteString str;
- FX_LPSTR buf = str.GetBuffer(len);
- size_t readCnt = FXSYS_fread(buf, 1, len, file);
- str.ReleaseBuffer(len);
- FXSYS_fclose(file);
- return str;
-}
-CFX_WideString CFX_ByteString::UTF8Decode() const
-{
- CFX_UTF8Decoder decoder;
- for (FX_STRSIZE i = 0; i < GetLength(); i ++) {
- decoder.Input((FX_BYTE)m_pData->m_String[i]);
- }
- return decoder.GetResult();
-}
-CFX_ByteString CFX_ByteString::FromUnicode(FX_LPCWSTR str, FX_STRSIZE len)
-{
- if (len < 0) {
- len = (FX_STRSIZE)FXSYS_wcslen(str);
- }
- CFX_ByteString bstr;
- bstr.ConvertFrom(CFX_WideString(str, len));
- return bstr;
-}
-CFX_ByteString CFX_ByteString::FromUnicode(const CFX_WideString& str)
-{
- return FromUnicode((FX_LPCWSTR)str, str.GetLength());
-}
-void CFX_ByteString::ConvertFrom(const CFX_WideString& str, CFX_CharMap* pCharMap)
-{
- if (pCharMap == NULL) {
- pCharMap = CFX_CharMap::GetDefaultMapper();
- }
- *this = (*pCharMap->m_GetByteString)(pCharMap, str);
-}
-int CFX_ByteString::Compare(FX_BSTR str) const
-{
- if (m_pData == NULL) {
- return str.IsEmpty() ? 0 : -1;
- }
- int this_len = m_pData->m_nDataLength;
- int that_len = str.GetLength();
- int min_len = this_len < that_len ? this_len : that_len;
- for (int i = 0; i < min_len; i ++) {
- if ((FX_BYTE)m_pData->m_String[i] < str.GetAt(i)) {
- return -1;
- } else if ((FX_BYTE)m_pData->m_String[i] > str.GetAt(i)) {
- return 1;
- }
- }
- if (this_len < that_len) {
- return -1;
- } else if (this_len > that_len) {
- return 1;
- }
- return 0;
-}
-void CFX_ByteString::TrimRight(FX_BSTR lpszTargets)
-{
- if (m_pData == NULL || lpszTargets.IsEmpty()) {
- return;
- }
- CopyBeforeWrite();
- FX_STRSIZE pos = GetLength();
- if (pos < 1) {
- return;
- }
- while (pos) {
- FX_STRSIZE i = 0;
- while (i < lpszTargets.GetLength() && lpszTargets[i] != m_pData->m_String[pos - 1]) {
- i ++;
- }
- if (i == lpszTargets.GetLength()) {
- break;
- }
- pos --;
- }
- if (pos < m_pData->m_nDataLength) {
- m_pData->m_String[pos] = 0;
- m_pData->m_nDataLength = pos;
- }
-}
-void CFX_ByteString::TrimRight(FX_CHAR chTarget)
-{
- TrimRight(CFX_ByteStringC(chTarget));
-}
-void CFX_ByteString::TrimRight()
-{
- TrimRight(FX_BSTRC("\x09\x0a\x0b\x0c\x0d\x20"));
-}
-void CFX_ByteString::TrimLeft(FX_BSTR lpszTargets)
-{
- if (m_pData == NULL) {
- return;
- }
- if (lpszTargets.IsEmpty()) {
- return;
- }
- CopyBeforeWrite();
- FX_STRSIZE len = GetLength();
- if (len < 1) {
- return;
- }
- FX_STRSIZE pos = 0;
- while (pos < len) {
- FX_STRSIZE i = 0;
- while (i < lpszTargets.GetLength() && lpszTargets[i] != m_pData->m_String[pos]) {
- i ++;
- }
- if (i == lpszTargets.GetLength()) {
- break;
- }
- pos ++;
- }
- if (pos) {
- FX_STRSIZE nDataLength = len - pos;
- FXSYS_memmove32(m_pData->m_String, m_pData->m_String + pos, (nDataLength + 1)*sizeof(FX_CHAR));
- m_pData->m_nDataLength = nDataLength;
- }
-}
-void CFX_ByteString::TrimLeft(FX_CHAR chTarget)
-{
- TrimLeft(CFX_ByteStringC(chTarget));
-}
-void CFX_ByteString::TrimLeft()
-{
- TrimLeft(FX_BSTRC("\x09\x0a\x0b\x0c\x0d\x20"));
-}
-FX_DWORD CFX_ByteString::GetID(FX_STRSIZE start_pos) const
-{
- return CFX_ByteStringC(*this).GetID(start_pos);
-}
-FX_DWORD CFX_ByteStringC::GetID(FX_STRSIZE start_pos) const
-{
- if (m_Length == 0) {
- return 0;
- }
- if (start_pos >= m_Length) {
- return 0;
- }
- FX_DWORD strid = 0;
- if (start_pos + 4 > m_Length) {
- for (FX_STRSIZE i = 0; i < m_Length - start_pos; i ++) {
- strid = strid * 256 + m_Ptr[start_pos + i];
- }
- strid = strid << ((4 - m_Length + start_pos) * 8);
- } else {
- for (int i = 0; i < 4; i ++) {
- strid = strid * 256 + m_Ptr[start_pos + i];
- }
- }
- return strid;
-}
-FX_STRSIZE FX_ftoa(FX_FLOAT d, FX_LPSTR buf)
-{
- buf[0] = '0';
- buf[1] = '\0';
- if (d == 0.0f) {
- return 1;
- }
- FX_BOOL bNegative = FALSE;
- if (d < 0) {
- bNegative = TRUE;
- d = -d;
- }
- int scale = 1;
- int scaled = FXSYS_round(d);
- while (scaled < 100000) {
- if (scale == 1000000) {
- break;
- }
- scale *= 10;
- scaled = FXSYS_round(d * scale);
- }
- if (scaled == 0) {
- return 1;
- }
- char buf2[32];
- int buf_size = 0;
- if (bNegative) {
- buf[buf_size++] = '-';
- }
- int i = scaled / scale;
- FXSYS_itoa(i, buf2, 10);
- FX_STRSIZE len = (FX_STRSIZE)FXSYS_strlen(buf2);
- FXSYS_memcpy32(buf + buf_size, buf2, len);
- buf_size += len;
- int fraction = scaled % scale;
- if (fraction == 0) {
- return buf_size;
- }
- buf[buf_size++] = '.';
- scale /= 10;
- while (fraction) {
- buf[buf_size++] = '0' + fraction / scale;
- fraction %= scale;
- scale /= 10;
- }
- return buf_size;
-}
-CFX_ByteString CFX_ByteString::FormatFloat(FX_FLOAT d, int precision)
-{
- FX_CHAR buf[32];
- FX_STRSIZE len = FX_ftoa(d, buf);
- return CFX_ByteString(buf, len);
-}
-void CFX_StringBufBase::Copy(FX_BSTR str)
-{
- m_Size = str.GetLength();
- if (m_Size > m_Limit) {
- m_Size = m_Limit;
- }
- FX_CHAR* pBuffer = (FX_CHAR*)(this + 1);
- FXSYS_memcpy32(pBuffer, str.GetPtr(), m_Size);
-}
-void CFX_StringBufBase::Append(FX_BSTR str)
-{
- int len = str.GetLength();
- if (len > m_Limit - m_Size) {
- len = m_Limit - m_Size;
- }
- FX_CHAR* pBuffer = (FX_CHAR*)(this + 1);
- FXSYS_memcpy32(pBuffer + m_Size, str.GetPtr(), len);
- m_Size += len;
-}
-void CFX_StringBufBase::Append(int i, FX_DWORD flags)
-{
- char buf[32];
- int len = _Buffer_itoa(buf, i, flags);
- Append(CFX_ByteStringC(buf, len));
-}
-void CFX_ByteStringL::Empty(IFX_Allocator* pAllocator)
-{
- if (m_Ptr) {
- FX_Allocator_Free(pAllocator, (FX_LPVOID)m_Ptr);
- }
- m_Ptr = NULL, m_Length = 0;
-}
-FX_LPSTR CFX_ByteStringL::AllocBuffer(FX_STRSIZE length, IFX_Allocator* pAllocator)
-{
- Empty(pAllocator);
- FX_LPSTR str = FX_Allocator_Alloc(pAllocator, FX_CHAR, length + 1);
- if (!str) {
- return NULL;
- }
- *(FX_LPSTR*)(&m_Ptr) = str;
- m_Length = length;
- return str;
-}
-void CFX_ByteStringL::Set(FX_BSTR src, IFX_Allocator* pAllocator)
-{
- Empty(pAllocator);
- if (src.GetCStr() != NULL && src.GetLength() > 0) {
- FX_LPSTR str = FX_Allocator_Alloc(pAllocator, FX_CHAR, src.GetLength() + 1);
- if (!str) {
- return;
- }
- FXSYS_memcpy32(str, src, src.GetLength());
- str[src.GetLength()] = '\0';
- *(FX_LPSTR*)(&m_Ptr) = str;
- m_Length = src.GetLength();
- }
-}
+// 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
+
+#include "../../include/fxcrt/fx_basic.h"
+static int _Buffer_itoa(char* buf, int i, FX_DWORD flags)
+{
+ if (i == 0) {
+ buf[0] = '0';
+ return 1;
+ }
+ char buf1[32];
+ int buf_pos = 31;
+ FX_DWORD u = i;
+ if ((flags & FXFORMAT_SIGNED) && i < 0) {
+ u = -i;
+ }
+ int base = 10;
+ FX_LPCSTR string = "0123456789abcdef";
+ if (flags & FXFORMAT_HEX) {
+ base = 16;
+ if (flags & FXFORMAT_CAPITAL) {
+ string = "0123456789ABCDEF";
+ }
+ }
+ while (u != 0) {
+ buf1[buf_pos--] = string[u % base];
+ u = u / base;
+ }
+ if ((flags & FXFORMAT_SIGNED) && i < 0) {
+ buf1[buf_pos--] = '-';
+ }
+ int len = 31 - buf_pos;
+ for (int ii = 0; ii < len; ii ++) {
+ buf[ii] = buf1[ii + buf_pos + 1];
+ }
+ return len;
+}
+CFX_ByteString CFX_ByteString::FormatInteger(int i, FX_DWORD flags)
+{
+ char buf[32];
+ return CFX_ByteStringC(buf, _Buffer_itoa(buf, i, flags));
+}
+static CFX_StringData* FX_AllocString(int nLen)
+{
+ if (nLen == 0) {
+ return NULL;
+ }
+ CFX_StringData* pData = (CFX_StringData*)FX_Alloc(FX_BYTE, sizeof(long) * 3 + (nLen + 1) * sizeof(char));
+ if (!pData) {
+ return NULL;
+ }
+ pData->m_nAllocLength = nLen;
+ pData->m_nDataLength = nLen;
+ pData->m_nRefs = 1;
+ pData->m_String[nLen] = 0;
+ return pData;
+}
+static void FX_ReleaseString(CFX_StringData* pData)
+{
+ if (pData == NULL) {
+ return;
+ }
+ pData->m_nRefs --;
+ if (pData->m_nRefs <= 0) {
+ FX_Free(pData);
+ }
+}
+CFX_ByteString::~CFX_ByteString()
+{
+ if (m_pData == NULL) {
+ return;
+ }
+ m_pData->m_nRefs --;
+ if (m_pData->m_nRefs < 1) {
+ FX_Free(m_pData);
+ }
+}
+CFX_ByteString::CFX_ByteString(FX_LPCSTR lpsz, FX_STRSIZE nLen)
+{
+ if (nLen < 0) {
+ nLen = lpsz ? (FX_STRSIZE)FXSYS_strlen(lpsz) : 0;
+ }
+ if (nLen) {
+ m_pData = FX_AllocString(nLen);
+ if (m_pData) {
+ FXSYS_memcpy32(m_pData->m_String, lpsz, nLen * sizeof(char));
+ }
+ } else {
+ m_pData = NULL;
+ }
+}
+CFX_ByteString::CFX_ByteString(FX_LPCBYTE lpsz, FX_STRSIZE nLen)
+{
+ if (nLen > 0) {
+ m_pData = FX_AllocString(nLen);
+ if (m_pData) {
+ FXSYS_memcpy32(m_pData->m_String, lpsz, nLen * sizeof(char));
+ }
+ } else {
+ m_pData = NULL;
+ }
+}
+CFX_ByteString::CFX_ByteString(char ch)
+{
+ m_pData = FX_AllocString(1);
+ if (m_pData) {
+ m_pData->m_String[0] = ch;
+ }
+}
+CFX_ByteString::CFX_ByteString(const CFX_ByteString& stringSrc)
+{
+ if (stringSrc.m_pData == NULL) {
+ m_pData = NULL;
+ return;
+ }
+ if (stringSrc.m_pData->m_nRefs >= 0) {
+ m_pData = stringSrc.m_pData;
+ m_pData->m_nRefs ++;
+ } else {
+ m_pData = NULL;
+ *this = stringSrc;
+ }
+}
+CFX_ByteString::CFX_ByteString(FX_BSTR stringSrc)
+{
+ if (stringSrc.IsEmpty()) {
+ m_pData = NULL;
+ return;
+ } else {
+ m_pData = NULL;
+ *this = stringSrc;
+ }
+}
+CFX_ByteString::CFX_ByteString(FX_BSTR str1, FX_BSTR str2)
+{
+ m_pData = NULL;
+ int nNewLen = str1.GetLength() + str2.GetLength();
+ if (nNewLen == 0) {
+ return;
+ }
+ m_pData = FX_AllocString(nNewLen);
+ if (m_pData) {
+ FXSYS_memcpy32(m_pData->m_String, str1.GetCStr(), str1.GetLength());
+ FXSYS_memcpy32(m_pData->m_String + str1.GetLength(), str2.GetCStr(), str2.GetLength());
+ }
+}
+const CFX_ByteString& CFX_ByteString::operator=(FX_LPCSTR lpsz)
+{
+ if (lpsz == NULL || lpsz[0] == 0) {
+ Empty();
+ } else {
+ AssignCopy((FX_STRSIZE)FXSYS_strlen(lpsz), lpsz);
+ }
+ return *this;
+}
+const CFX_ByteString& CFX_ByteString::operator=(FX_BSTR str)
+{
+ if (str.IsEmpty()) {
+ Empty();
+ } else {
+ AssignCopy(str.GetLength(), str.GetCStr());
+ }
+ return *this;
+}
+const CFX_ByteString& CFX_ByteString::operator=(const CFX_ByteString& stringSrc)
+{
+ if (m_pData == stringSrc.m_pData) {
+ return *this;
+ }
+ if (stringSrc.IsEmpty()) {
+ Empty();
+ } else if ((m_pData && m_pData->m_nRefs < 0) ||
+ (stringSrc.m_pData && stringSrc.m_pData->m_nRefs < 0)) {
+ AssignCopy(stringSrc.m_pData->m_nDataLength, stringSrc.m_pData->m_String);
+ } else {
+ Empty();
+ m_pData = stringSrc.m_pData;
+ if (m_pData) {
+ m_pData->m_nRefs ++;
+ }
+ }
+ return *this;
+}
+const CFX_ByteString& CFX_ByteString::operator=(const CFX_BinaryBuf& buf)
+{
+ Load(buf.GetBuffer(), buf.GetSize());
+ return *this;
+}
+void CFX_ByteString::Load(FX_LPCBYTE buf, FX_STRSIZE len)
+{
+ Empty();
+ if (len) {
+ m_pData = FX_AllocString(len);
+ if (m_pData) {
+ FXSYS_memcpy32(m_pData->m_String, buf, len * sizeof(char));
+ }
+ } else {
+ m_pData = NULL;
+ }
+}
+const CFX_ByteString& CFX_ByteString::operator+=(FX_LPCSTR lpsz)
+{
+ if (lpsz) {
+ ConcatInPlace((FX_STRSIZE)FXSYS_strlen(lpsz), lpsz);
+ }
+ return *this;
+}
+const CFX_ByteString& CFX_ByteString::operator+=(char ch)
+{
+ ConcatInPlace(1, &ch);
+ return *this;
+}
+const CFX_ByteString& CFX_ByteString::operator+=(const CFX_ByteString& string)
+{
+ if (string.m_pData == NULL) {
+ return *this;
+ }
+ ConcatInPlace(string.m_pData->m_nDataLength, string.m_pData->m_String);
+ return *this;
+}
+const CFX_ByteString& CFX_ByteString::operator+=(FX_BSTR string)
+{
+ if (string.IsEmpty()) {
+ return *this;
+ }
+ ConcatInPlace(string.GetLength(), string.GetCStr());
+ return *this;
+}
+bool CFX_ByteString::Equal(FX_BSTR str) const
+{
+ if (m_pData == NULL) {
+ return str.IsEmpty();
+ }
+ return m_pData->m_nDataLength == str.GetLength() &&
+ FXSYS_memcmp32(m_pData->m_String, str.GetCStr(), str.GetLength()) == 0;
+}
+bool CFX_ByteString::operator ==(const CFX_ByteString& s2) const
+{
+ if (m_pData == NULL) {
+ return s2.IsEmpty();
+ }
+ if (s2.m_pData == NULL) {
+ return false;
+ }
+ return m_pData->m_nDataLength == s2.m_pData->m_nDataLength &&
+ FXSYS_memcmp32(m_pData->m_String, s2.m_pData->m_String, m_pData->m_nDataLength) == 0;
+}
+void CFX_ByteString::Empty()
+{
+ if (m_pData == NULL) {
+ return;
+ }
+ if (m_pData->m_nRefs > 1) {
+ m_pData->m_nRefs --;
+ } else {
+ FX_Free(m_pData);
+ }
+ m_pData = NULL;
+}
+bool CFX_ByteString::EqualNoCase(FX_BSTR str) const
+{
+ if (m_pData == NULL) {
+ return str.IsEmpty();
+ }
+ FX_STRSIZE len = str.GetLength();
+ if (m_pData->m_nDataLength != len) {
+ return false;
+ }
+ FX_LPCBYTE pThis = (FX_LPCBYTE)m_pData->m_String;
+ FX_LPCBYTE pThat = (FX_LPCBYTE)str;
+ for (FX_STRSIZE i = 0; i < len; i ++) {
+ if ((*pThis) != (*pThat)) {
+ FX_BYTE bThis = *pThis;
+ if (bThis >= 'A' && bThis <= 'Z') {
+ bThis += 'a' - 'A';
+ }
+ FX_BYTE bThat = *pThat;
+ if (bThat >= 'A' && bThat <= 'Z') {
+ bThat += 'a' - 'A';
+ }
+ if (bThis != bThat) {
+ return false;
+ }
+ }
+ pThis ++;
+ pThat ++;
+ }
+ return true;
+}
+void CFX_ByteString::AssignCopy(FX_STRSIZE nSrcLen, FX_LPCSTR lpszSrcData)
+{
+ AllocBeforeWrite(nSrcLen);
+ FXSYS_memcpy32(m_pData->m_String, lpszSrcData, nSrcLen * sizeof(char));
+ m_pData->m_nDataLength = nSrcLen;
+ m_pData->m_String[nSrcLen] = 0;
+}
+void CFX_ByteString::CopyBeforeWrite()
+{
+ if (m_pData == NULL || m_pData->m_nRefs <= 1) {
+ return;
+ }
+ CFX_StringData* pData = m_pData;
+ m_pData->m_nRefs --;
+ FX_STRSIZE nDataLength = pData->m_nDataLength;
+ m_pData = FX_AllocString(nDataLength);
+ if (m_pData != NULL) {
+ FXSYS_memcpy32(m_pData->m_String, pData->m_String, (nDataLength + 1) * sizeof(char));
+ }
+}
+void CFX_ByteString::AllocBeforeWrite(FX_STRSIZE nLen)
+{
+ if (m_pData && m_pData->m_nRefs <= 1 && m_pData->m_nAllocLength >= nLen) {
+ return;
+ }
+ Empty();
+ m_pData = FX_AllocString(nLen);
+}
+void CFX_ByteString::ReleaseBuffer(FX_STRSIZE nNewLength)
+{
+ if (m_pData == NULL) {
+ return;
+ }
+ CopyBeforeWrite();
+ if (nNewLength == -1) {
+ nNewLength = (FX_STRSIZE)FXSYS_strlen((FX_LPCSTR)m_pData->m_String);
+ }
+ if (nNewLength == 0) {
+ Empty();
+ return;
+ }
+ FXSYS_assert(nNewLength <= m_pData->m_nAllocLength);
+ m_pData->m_nDataLength = nNewLength;
+ m_pData->m_String[nNewLength] = 0;
+}
+FX_LPSTR CFX_ByteString::LockBuffer()
+{
+ if (m_pData == NULL) {
+ return NULL;
+ }
+ FX_LPSTR lpsz = GetBuffer(0);
+ m_pData->m_nRefs = -1;
+ return lpsz;
+}
+void CFX_ByteString::Reserve(FX_STRSIZE len)
+{
+ GetBuffer(len);
+ ReleaseBuffer(GetLength());
+}
+FX_LPSTR CFX_ByteString::GetBuffer(FX_STRSIZE nMinBufLength)
+{
+ if (m_pData == NULL && nMinBufLength == 0) {
+ return NULL;
+ }
+ if (m_pData && m_pData->m_nRefs <= 1 && m_pData->m_nAllocLength >= nMinBufLength) {
+ return m_pData->m_String;
+ }
+ if (m_pData == NULL) {
+ m_pData = FX_AllocString(nMinBufLength);
+ if (!m_pData) {
+ return NULL;
+ }
+ m_pData->m_nDataLength = 0;
+ m_pData->m_String[0] = 0;
+ return m_pData->m_String;
+ }
+ CFX_StringData* pOldData = m_pData;
+ FX_STRSIZE nOldLen = pOldData->m_nDataLength;
+ if (nMinBufLength < nOldLen) {
+ nMinBufLength = nOldLen;
+ }
+ m_pData = FX_AllocString(nMinBufLength);
+ if (!m_pData) {
+ return NULL;
+ }
+ FXSYS_memcpy32(m_pData->m_String, pOldData->m_String, (nOldLen + 1)*sizeof(char));
+ m_pData->m_nDataLength = nOldLen;
+ pOldData->m_nRefs --;
+ if (pOldData->m_nRefs <= 0) {
+ FX_Free(pOldData);
+ }
+ return m_pData->m_String;
+}
+FX_STRSIZE CFX_ByteString::Delete(FX_STRSIZE nIndex, FX_STRSIZE nCount)
+{
+ if (m_pData == NULL) {
+ return 0;
+ }
+ if (nIndex < 0) {
+ nIndex = 0;
+ }
+ FX_STRSIZE nOldLength = m_pData->m_nDataLength;
+ if (nCount > 0 && nIndex < nOldLength) {
+ FX_STRSIZE mLength = nIndex + nCount;
+ if (mLength >= nOldLength) {
+ m_pData->m_nDataLength = nIndex;
+ return m_pData->m_nDataLength;
+ }
+ CopyBeforeWrite();
+ int nBytesToCopy = nOldLength - mLength + 1;
+ FXSYS_memmove32(m_pData->m_String + nIndex,
+ m_pData->m_String + mLength, nBytesToCopy * sizeof(char));
+ m_pData->m_nDataLength = nOldLength - nCount;
+ }
+ return m_pData->m_nDataLength;
+}
+void CFX_ByteString::ConcatInPlace(FX_STRSIZE nSrcLen, FX_LPCSTR lpszSrcData)
+{
+ if (nSrcLen == 0 || lpszSrcData == NULL) {
+ return;
+ }
+ if (m_pData == NULL) {
+ m_pData = FX_AllocString(nSrcLen);
+ if (!m_pData) {
+ return;
+ }
+ FXSYS_memcpy32(m_pData->m_String, lpszSrcData, nSrcLen * sizeof(char));
+ return;
+ }
+ if (m_pData->m_nRefs > 1 || m_pData->m_nDataLength + nSrcLen > m_pData->m_nAllocLength) {
+ CFX_StringData* pOldData = m_pData;
+ ConcatCopy(m_pData->m_nDataLength, m_pData->m_String, nSrcLen, lpszSrcData);
+ FX_ReleaseString(pOldData);
+ } else {
+ FXSYS_memcpy32(m_pData->m_String + m_pData->m_nDataLength, lpszSrcData, nSrcLen * sizeof(char));
+ m_pData->m_nDataLength += nSrcLen;
+ m_pData->m_String[m_pData->m_nDataLength] = 0;
+ }
+}
+void CFX_ByteString::ConcatCopy(FX_STRSIZE nSrc1Len, FX_LPCSTR lpszSrc1Data,
+ FX_STRSIZE nSrc2Len, FX_LPCSTR lpszSrc2Data)
+{
+ int nNewLen = nSrc1Len + nSrc2Len;
+ if (nNewLen == 0) {
+ return;
+ }
+ m_pData = FX_AllocString(nNewLen);
+ if (m_pData) {
+ FXSYS_memcpy32(m_pData->m_String, lpszSrc1Data, nSrc1Len * sizeof(char));
+ FXSYS_memcpy32(m_pData->m_String + nSrc1Len, lpszSrc2Data, nSrc2Len * sizeof(char));
+ }
+}
+CFX_ByteString CFX_ByteString::Mid(FX_STRSIZE nFirst) const
+{
+ if (m_pData == NULL) {
+ return CFX_ByteString();
+ }
+ return Mid(nFirst, m_pData->m_nDataLength - nFirst);
+}
+CFX_ByteString CFX_ByteString::Mid(FX_STRSIZE nFirst, FX_STRSIZE nCount) const
+{
+ if (nFirst < 0) {
+ nFirst = 0;
+ }
+ if (nCount < 0) {
+ nCount = 0;
+ }
+ if (nFirst + nCount > m_pData->m_nDataLength) {
+ nCount = m_pData->m_nDataLength - nFirst;
+ }
+ if (nFirst > m_pData->m_nDataLength) {
+ nCount = 0;
+ }
+ if (nFirst == 0 && nFirst + nCount == m_pData->m_nDataLength) {
+ return *this;
+ }
+ CFX_ByteString dest;
+ AllocCopy(dest, nCount, nFirst, 0);
+ return dest;
+}
+void CFX_ByteString::AllocCopy(CFX_ByteString& dest, FX_STRSIZE nCopyLen, FX_STRSIZE nCopyIndex,
+ FX_STRSIZE nExtraLen) const
+{
+ FX_STRSIZE nNewLen = nCopyLen + nExtraLen;
+ if (nNewLen == 0) {
+ return;
+ }
+ ASSERT(dest.m_pData == NULL);
+ dest.m_pData = FX_AllocString(nNewLen);
+ if (dest.m_pData) {
+ FXSYS_memcpy32(dest.m_pData->m_String, m_pData->m_String + nCopyIndex, nCopyLen * sizeof(char));
+ }
+}
+#define FORCE_ANSI 0x10000
+#define FORCE_UNICODE 0x20000
+#define FORCE_INT64 0x40000
+void CFX_ByteString::FormatV(FX_LPCSTR lpszFormat, va_list argList)
+{
+ va_list argListSave;
+#if defined(__ARMCC_VERSION) || (!defined(_MSC_VER) && (_FX_CPU_ == _FX_X64_ || _FX_CPU_ == _FX_IA64_ || _FX_CPU_ == _FX_ARM64_)) || defined(__native_client__)
+ va_copy(argListSave, argList);
+#else
+ argListSave = argList;
+#endif
+ int nMaxLen = 0;
+ for (FX_LPCSTR lpsz = lpszFormat; *lpsz != 0; lpsz ++) {
+ if (*lpsz != '%' || *(lpsz = lpsz + 1) == '%') {
+ nMaxLen += (FX_STRSIZE)FXSYS_strlen(lpsz);
+ continue;
+ }
+ int nItemLen = 0;
+ int nWidth = 0;
+ for (; *lpsz != 0; lpsz ++) {
+ if (*lpsz == '#') {
+ nMaxLen += 2;
+ } else if (*lpsz == '*') {
+ nWidth = va_arg(argList, int);
+ } else if (*lpsz == '-' || *lpsz == '+' || *lpsz == '0' ||
+ *lpsz == ' ')
+ ;
+ else {
+ break;
+ }
+ }
+ if (nWidth == 0) {
+ nWidth = FXSYS_atoi(lpsz);
+ for (; (*lpsz) >= '0' && (*lpsz) <= '9'; lpsz ++)
+ ;
+ }
+ if (nWidth < 0 || nWidth > 128 * 1024) {
+ lpszFormat = "Bad width";
+ nMaxLen = 10;
+ break;
+ }
+ int nPrecision = 0;
+ if (*lpsz == '.') {
+ lpsz ++;
+ if (*lpsz == '*') {
+ nPrecision = va_arg(argList, int);
+ lpsz ++;
+ } else {
+ nPrecision = FXSYS_atoi(lpsz);
+ for (; (*lpsz) >= '0' && (*lpsz) <= '9'; lpsz ++)
+ ;
+ }
+ }
+ if (nPrecision < 0 || nPrecision > 128 * 1024) {
+ lpszFormat = "Bad precision";
+ nMaxLen = 14;
+ break;
+ }
+ int nModifier = 0;
+ if (FXSYS_strncmp(lpsz, "I64", 3) == 0) {
+ lpsz += 3;
+ nModifier = FORCE_INT64;
+ } else {
+ switch (*lpsz) {
+ case 'h':
+ nModifier = FORCE_ANSI;
+ lpsz ++;
+ break;
+ case 'l':
+ nModifier = FORCE_UNICODE;
+ lpsz ++;
+ break;
+ case 'F':
+ case 'N':
+ case 'L':
+ lpsz ++;
+ break;
+ }
+ }
+ switch (*lpsz | nModifier) {
+ case 'c':
+ case 'C':
+ nItemLen = 2;
+ va_arg(argList, int);
+ break;
+ case 'c'|FORCE_ANSI:
+ case 'C'|FORCE_ANSI:
+ nItemLen = 2;
+ va_arg(argList, int);
+ break;
+ case 'c'|FORCE_UNICODE:
+ case 'C'|FORCE_UNICODE:
+ nItemLen = 2;
+ va_arg(argList, int);
+ break;
+ case 's': {
+ FX_LPCSTR pstrNextArg = va_arg(argList, FX_LPCSTR);
+ if (pstrNextArg == NULL) {
+ nItemLen = 6;
+ } else {
+ nItemLen = (FX_STRSIZE)FXSYS_strlen(pstrNextArg);
+ if (nItemLen < 1) {
+ nItemLen = 1;
+ }
+ }
+ }
+ break;
+ case 'S': {
+ FX_LPWSTR pstrNextArg = va_arg(argList, FX_LPWSTR);
+ if (pstrNextArg == NULL) {
+ nItemLen = 6;
+ } else {
+ nItemLen = (FX_STRSIZE)FXSYS_wcslen(pstrNextArg);
+ if (nItemLen < 1) {
+ nItemLen = 1;
+ }
+ }
+ }
+ break;
+ case 's'|FORCE_ANSI:
+ case 'S'|FORCE_ANSI: {
+ FX_LPCSTR pstrNextArg = va_arg(argList, FX_LPCSTR);
+ if (pstrNextArg == NULL) {
+ nItemLen = 6;
+ } else {
+ nItemLen = (FX_STRSIZE)FXSYS_strlen(pstrNextArg);
+ if (nItemLen < 1) {
+ nItemLen = 1;
+ }
+ }
+ }
+ break;
+ case 's'|FORCE_UNICODE:
+ case 'S'|FORCE_UNICODE: {
+ FX_LPWSTR pstrNextArg = va_arg(argList, FX_LPWSTR);
+ if (pstrNextArg == NULL) {
+ nItemLen = 6;
+ } else {
+ nItemLen = (FX_STRSIZE)FXSYS_wcslen(pstrNextArg);
+ if (nItemLen < 1) {
+ nItemLen = 1;
+ }
+ }
+ }
+ break;
+ }
+ if (nItemLen != 0) {
+ if (nPrecision != 0 && nItemLen > nPrecision) {
+ nItemLen = nPrecision;
+ }
+ if (nItemLen < nWidth) {
+ nItemLen = nWidth;
+ }
+ } else {
+ switch (*lpsz) {
+ case 'd':
+ case 'i':
+ case 'u':
+ case 'x':
+ case 'X':
+ case 'o':
+ if (nModifier & FORCE_INT64) {
+ va_arg(argList, FX_INT64);
+ } else {
+ va_arg(argList, int);
+ }
+ nItemLen = 32;
+ if (nItemLen < nWidth + nPrecision) {
+ nItemLen = nWidth + nPrecision;
+ }
+ break;
+ case 'a':
+ case 'A':
+ case 'e':
+ case 'E':
+ case 'g':
+ case 'G':
+ va_arg(argList, double);
+ nItemLen = 128;
+ if (nItemLen < nWidth + nPrecision) {
+ nItemLen = nWidth + nPrecision;
+ }
+ break;
+ case 'f':
+ if (nWidth + nPrecision > 100) {
+ nItemLen = nPrecision + nWidth + 128;
+ } else {
+ double f;
+ char pszTemp[256];
+ f = va_arg(argList, double);
+ FXSYS_sprintf(pszTemp, "%*.*f", nWidth, nPrecision + 6, f );
+ nItemLen = (FX_STRSIZE)FXSYS_strlen(pszTemp);
+ }
+ break;
+ case 'p':
+ va_arg(argList, void*);
+ nItemLen = 32;
+ if (nItemLen < nWidth + nPrecision) {
+ nItemLen = nWidth + nPrecision;
+ }
+ break;
+ case 'n':
+ va_arg(argList, int*);
+ break;
+ }
+ }
+ nMaxLen += nItemLen;
+ }
+ GetBuffer(nMaxLen);
+ if (m_pData) {
+ FXSYS_vsprintf(m_pData->m_String, lpszFormat, argListSave);
+ ReleaseBuffer();
+ }
+ va_end(argListSave);
+}
+void CFX_ByteString::Format(FX_LPCSTR lpszFormat, ...)
+{
+ va_list argList;
+ va_start(argList, lpszFormat);
+ FormatV(lpszFormat, argList);
+ va_end(argList);
+}
+FX_STRSIZE CFX_ByteString::Insert(FX_STRSIZE nIndex, FX_CHAR ch)
+{
+ CopyBeforeWrite();
+ if (nIndex < 0) {
+ nIndex = 0;
+ }
+ FX_STRSIZE nNewLength = m_pData ? m_pData->m_nDataLength : 0;
+ if (nIndex > nNewLength) {
+ nIndex = nNewLength;
+ }
+ nNewLength++;
+ if (m_pData == NULL || m_pData->m_nAllocLength < nNewLength) {
+ CFX_StringData* pOldData = m_pData;
+ FX_LPCSTR pstr = m_pData->m_String;
+ m_pData = FX_AllocString(nNewLength);
+ if (!m_pData) {
+ return 0;
+ }
+ if(pOldData != NULL) {
+ FXSYS_memmove32(m_pData->m_String, pstr, (pOldData->m_nDataLength + 1)*sizeof(char));
+ FX_ReleaseString(pOldData);
+ } else {
+ m_pData->m_String[0] = 0;
+ }
+ }
+ FXSYS_memmove32(m_pData->m_String + nIndex + 1,
+ m_pData->m_String + nIndex, (nNewLength - nIndex)*sizeof(char));
+ m_pData->m_String[nIndex] = ch;
+ m_pData->m_nDataLength = nNewLength;
+ return nNewLength;
+}
+CFX_ByteString CFX_ByteString::Right(FX_STRSIZE nCount) const
+{
+ if (m_pData == NULL) {
+ return CFX_ByteString();
+ }
+ if (nCount < 0) {
+ nCount = 0;
+ }
+ if (nCount >= m_pData->m_nDataLength) {
+ return *this;
+ }
+ CFX_ByteString dest;
+ AllocCopy(dest, nCount, m_pData->m_nDataLength - nCount, 0);
+ return dest;
+}
+CFX_ByteString CFX_ByteString::Left(FX_STRSIZE nCount) const
+{
+ if (m_pData == NULL) {
+ return CFX_ByteString();
+ }
+ if (nCount < 0) {
+ nCount = 0;
+ }
+ if (nCount >= m_pData->m_nDataLength) {
+ return *this;
+ }
+ CFX_ByteString dest;
+ AllocCopy(dest, nCount, 0, 0);
+ return dest;
+}
+FX_STRSIZE CFX_ByteString::Find(FX_CHAR ch, FX_STRSIZE nStart) const
+{
+ if (m_pData == NULL) {
+ return -1;
+ }
+ FX_STRSIZE nLength = m_pData->m_nDataLength;
+ if (nStart >= nLength) {
+ return -1;
+ }
+ FX_LPCSTR lpsz = FXSYS_strchr(m_pData->m_String + nStart, ch);
+ return (lpsz == NULL) ? -1 : (int)(lpsz - m_pData->m_String);
+}
+FX_STRSIZE CFX_ByteString::ReverseFind(FX_CHAR ch) const
+{
+ if (m_pData == NULL) {
+ return -1;
+ }
+ FX_STRSIZE nLength = m_pData->m_nDataLength;
+ while (nLength) {
+ if (m_pData->m_String[nLength - 1] == ch) {
+ return nLength - 1;
+ }
+ nLength --;
+ }
+ return -1;
+}
+FX_LPCSTR FX_strstr(FX_LPCSTR str1, int len1, FX_LPCSTR str2, int len2)
+{
+ if (len2 > len1 || len2 == 0) {
+ return NULL;
+ }
+ FX_LPCSTR end_ptr = str1 + len1 - len2;
+ while (str1 <= end_ptr) {
+ int i = 0;
+ while (1) {
+ if (str1[i] != str2[i]) {
+ break;
+ }
+ i ++;
+ if (i == len2) {
+ return str1;
+ }
+ }
+ str1 ++;
+ }
+ return NULL;
+}
+FX_STRSIZE CFX_ByteString::Find(FX_BSTR lpszSub, FX_STRSIZE nStart) const
+{
+ if (m_pData == NULL) {
+ return -1;
+ }
+ FX_STRSIZE nLength = m_pData->m_nDataLength;
+ if (nStart > nLength) {
+ return -1;
+ }
+ FX_LPCSTR lpsz = FX_strstr(m_pData->m_String + nStart, m_pData->m_nDataLength - nStart,
+ lpszSub.GetCStr(), lpszSub.GetLength());
+ return (lpsz == NULL) ? -1 : (int)(lpsz - m_pData->m_String);
+}
+void CFX_ByteString::MakeLower()
+{
+ if (m_pData == NULL) {
+ return;
+ }
+ CopyBeforeWrite();
+ if (GetLength() < 1) {
+ return;
+ }
+ FXSYS_strlwr(m_pData->m_String);
+}
+void CFX_ByteString::MakeUpper()
+{
+ if (m_pData == NULL) {
+ return;
+ }
+ CopyBeforeWrite();
+ if (GetLength() < 1) {
+ return;
+ }
+ FXSYS_strupr(m_pData->m_String);
+}
+FX_STRSIZE CFX_ByteString::Remove(FX_CHAR chRemove)
+{
+ if (m_pData == NULL) {
+ return 0;
+ }
+ CopyBeforeWrite();
+ if (GetLength() < 1) {
+ return 0;
+ }
+ FX_LPSTR pstrSource = m_pData->m_String;
+ FX_LPSTR pstrDest = m_pData->m_String;
+ FX_LPSTR pstrEnd = m_pData->m_String + m_pData->m_nDataLength;
+ while (pstrSource < pstrEnd) {
+ if (*pstrSource != chRemove) {
+ *pstrDest = *pstrSource;
+ pstrDest ++;
+ }
+ pstrSource ++;
+ }
+ *pstrDest = 0;
+ FX_STRSIZE nCount = (FX_STRSIZE)(pstrSource - pstrDest);
+ m_pData->m_nDataLength -= nCount;
+ return nCount;
+}
+FX_STRSIZE CFX_ByteString::Replace(FX_BSTR lpszOld, FX_BSTR lpszNew)
+{
+ if (m_pData == NULL) {
+ return 0;
+ }
+ if (lpszOld.IsEmpty()) {
+ return 0;
+ }
+ FX_STRSIZE nSourceLen = lpszOld.GetLength();
+ FX_STRSIZE nReplacementLen = lpszNew.GetLength();
+ FX_STRSIZE nCount = 0;
+ FX_LPCSTR pStart = m_pData->m_String;
+ FX_LPSTR pEnd = m_pData->m_String + m_pData->m_nDataLength;
+ while (1) {
+ FX_LPCSTR pTarget = FX_strstr(pStart, (FX_STRSIZE)(pEnd - pStart), lpszOld.GetCStr(), nSourceLen);
+ if (pTarget == NULL) {
+ break;
+ }
+ nCount++;
+ pStart = pTarget + nSourceLen;
+ }
+ if (nCount == 0) {
+ return 0;
+ }
+ FX_STRSIZE nNewLength = m_pData->m_nDataLength + (nReplacementLen - nSourceLen) * nCount;
+ if (nNewLength == 0) {
+ Empty();
+ return nCount;
+ }
+ CFX_StringData* pNewData = FX_AllocString(nNewLength);
+ if (!pNewData) {
+ return 0;
+ }
+ pStart = m_pData->m_String;
+ FX_LPSTR pDest = pNewData->m_String;
+ for (FX_STRSIZE i = 0; i < nCount; i ++) {
+ FX_LPCSTR pTarget = FX_strstr(pStart, (FX_STRSIZE)(pEnd - pStart), lpszOld.GetCStr(), nSourceLen);
+ FXSYS_memcpy32(pDest, pStart, pTarget - pStart);
+ pDest += pTarget - pStart;
+ FXSYS_memcpy32(pDest, lpszNew.GetCStr(), lpszNew.GetLength());
+ pDest += lpszNew.GetLength();
+ pStart = pTarget + nSourceLen;
+ }
+ FXSYS_memcpy32(pDest, pStart, pEnd - pStart);
+ FX_ReleaseString(m_pData);
+ m_pData = pNewData;
+ return nCount;
+}
+void CFX_ByteString::SetAt(FX_STRSIZE nIndex, FX_CHAR ch)
+{
+ if (m_pData == NULL) {
+ return;
+ }
+ FXSYS_assert(nIndex >= 0);
+ FXSYS_assert(nIndex < m_pData->m_nDataLength);
+ CopyBeforeWrite();
+ m_pData->m_String[nIndex] = ch;
+}
+CFX_ByteString CFX_ByteString::LoadFromFile(FX_BSTR filename)
+{
+ FXSYS_FILE* file = FXSYS_fopen(CFX_ByteString(filename), "rb");
+ if (file == NULL) {
+ return CFX_ByteString();
+ }
+ FXSYS_fseek(file, 0, FXSYS_SEEK_END);
+ int len = FXSYS_ftell(file);
+ FXSYS_fseek(file, 0, FXSYS_SEEK_SET);
+ CFX_ByteString str;
+ FX_LPSTR buf = str.GetBuffer(len);
+ size_t readCnt = FXSYS_fread(buf, 1, len, file);
+ str.ReleaseBuffer(len);
+ FXSYS_fclose(file);
+ return str;
+}
+CFX_WideString CFX_ByteString::UTF8Decode() const
+{
+ CFX_UTF8Decoder decoder;
+ for (FX_STRSIZE i = 0; i < GetLength(); i ++) {
+ decoder.Input((FX_BYTE)m_pData->m_String[i]);
+ }
+ return decoder.GetResult();
+}
+CFX_ByteString CFX_ByteString::FromUnicode(FX_LPCWSTR str, FX_STRSIZE len)
+{
+ if (len < 0) {
+ len = (FX_STRSIZE)FXSYS_wcslen(str);
+ }
+ CFX_ByteString bstr;
+ bstr.ConvertFrom(CFX_WideString(str, len));
+ return bstr;
+}
+CFX_ByteString CFX_ByteString::FromUnicode(const CFX_WideString& str)
+{
+ return FromUnicode((FX_LPCWSTR)str, str.GetLength());
+}
+void CFX_ByteString::ConvertFrom(const CFX_WideString& str, CFX_CharMap* pCharMap)
+{
+ if (pCharMap == NULL) {
+ pCharMap = CFX_CharMap::GetDefaultMapper();
+ }
+ *this = (*pCharMap->m_GetByteString)(pCharMap, str);
+}
+int CFX_ByteString::Compare(FX_BSTR str) const
+{
+ if (m_pData == NULL) {
+ return str.IsEmpty() ? 0 : -1;
+ }
+ int this_len = m_pData->m_nDataLength;
+ int that_len = str.GetLength();
+ int min_len = this_len < that_len ? this_len : that_len;
+ for (int i = 0; i < min_len; i ++) {
+ if ((FX_BYTE)m_pData->m_String[i] < str.GetAt(i)) {
+ return -1;
+ } else if ((FX_BYTE)m_pData->m_String[i] > str.GetAt(i)) {
+ return 1;
+ }
+ }
+ if (this_len < that_len) {
+ return -1;
+ } else if (this_len > that_len) {
+ return 1;
+ }
+ return 0;
+}
+void CFX_ByteString::TrimRight(FX_BSTR lpszTargets)
+{
+ if (m_pData == NULL || lpszTargets.IsEmpty()) {
+ return;
+ }
+ CopyBeforeWrite();
+ FX_STRSIZE pos = GetLength();
+ if (pos < 1) {
+ return;
+ }
+ while (pos) {
+ FX_STRSIZE i = 0;
+ while (i < lpszTargets.GetLength() && lpszTargets[i] != m_pData->m_String[pos - 1]) {
+ i ++;
+ }
+ if (i == lpszTargets.GetLength()) {
+ break;
+ }
+ pos --;
+ }
+ if (pos < m_pData->m_nDataLength) {
+ m_pData->m_String[pos] = 0;
+ m_pData->m_nDataLength = pos;
+ }
+}
+void CFX_ByteString::TrimRight(FX_CHAR chTarget)
+{
+ TrimRight(CFX_ByteStringC(chTarget));
+}
+void CFX_ByteString::TrimRight()
+{
+ TrimRight(FX_BSTRC("\x09\x0a\x0b\x0c\x0d\x20"));
+}
+void CFX_ByteString::TrimLeft(FX_BSTR lpszTargets)
+{
+ if (m_pData == NULL) {
+ return;
+ }
+ if (lpszTargets.IsEmpty()) {
+ return;
+ }
+ CopyBeforeWrite();
+ FX_STRSIZE len = GetLength();
+ if (len < 1) {
+ return;
+ }
+ FX_STRSIZE pos = 0;
+ while (pos < len) {
+ FX_STRSIZE i = 0;
+ while (i < lpszTargets.GetLength() && lpszTargets[i] != m_pData->m_String[pos]) {
+ i ++;
+ }
+ if (i == lpszTargets.GetLength()) {
+ break;
+ }
+ pos ++;
+ }
+ if (pos) {
+ FX_STRSIZE nDataLength = len - pos;
+ FXSYS_memmove32(m_pData->m_String, m_pData->m_String + pos, (nDataLength + 1)*sizeof(FX_CHAR));
+ m_pData->m_nDataLength = nDataLength;
+ }
+}
+void CFX_ByteString::TrimLeft(FX_CHAR chTarget)
+{
+ TrimLeft(CFX_ByteStringC(chTarget));
+}
+void CFX_ByteString::TrimLeft()
+{
+ TrimLeft(FX_BSTRC("\x09\x0a\x0b\x0c\x0d\x20"));
+}
+FX_DWORD CFX_ByteString::GetID(FX_STRSIZE start_pos) const
+{
+ return CFX_ByteStringC(*this).GetID(start_pos);
+}
+FX_DWORD CFX_ByteStringC::GetID(FX_STRSIZE start_pos) const
+{
+ if (m_Length == 0) {
+ return 0;
+ }
+ if (start_pos >= m_Length) {
+ return 0;
+ }
+ FX_DWORD strid = 0;
+ if (start_pos + 4 > m_Length) {
+ for (FX_STRSIZE i = 0; i < m_Length - start_pos; i ++) {
+ strid = strid * 256 + m_Ptr[start_pos + i];
+ }
+ strid = strid << ((4 - m_Length + start_pos) * 8);
+ } else {
+ for (int i = 0; i < 4; i ++) {
+ strid = strid * 256 + m_Ptr[start_pos + i];
+ }
+ }
+ return strid;
+}
+FX_STRSIZE FX_ftoa(FX_FLOAT d, FX_LPSTR buf)
+{
+ buf[0] = '0';
+ buf[1] = '\0';
+ if (d == 0.0f) {
+ return 1;
+ }
+ FX_BOOL bNegative = FALSE;
+ if (d < 0) {
+ bNegative = TRUE;
+ d = -d;
+ }
+ int scale = 1;
+ int scaled = FXSYS_round(d);
+ while (scaled < 100000) {
+ if (scale == 1000000) {
+ break;
+ }
+ scale *= 10;
+ scaled = FXSYS_round(d * scale);
+ }
+ if (scaled == 0) {
+ return 1;
+ }
+ char buf2[32];
+ int buf_size = 0;
+ if (bNegative) {
+ buf[buf_size++] = '-';
+ }
+ int i = scaled / scale;
+ FXSYS_itoa(i, buf2, 10);
+ FX_STRSIZE len = (FX_STRSIZE)FXSYS_strlen(buf2);
+ FXSYS_memcpy32(buf + buf_size, buf2, len);
+ buf_size += len;
+ int fraction = scaled % scale;
+ if (fraction == 0) {
+ return buf_size;
+ }
+ buf[buf_size++] = '.';
+ scale /= 10;
+ while (fraction) {
+ buf[buf_size++] = '0' + fraction / scale;
+ fraction %= scale;
+ scale /= 10;
+ }
+ return buf_size;
+}
+CFX_ByteString CFX_ByteString::FormatFloat(FX_FLOAT d, int precision)
+{
+ FX_CHAR buf[32];
+ FX_STRSIZE len = FX_ftoa(d, buf);
+ return CFX_ByteString(buf, len);
+}
+void CFX_StringBufBase::Copy(FX_BSTR str)
+{
+ m_Size = str.GetLength();
+ if (m_Size > m_Limit) {
+ m_Size = m_Limit;
+ }
+ FX_CHAR* pBuffer = (FX_CHAR*)(this + 1);
+ FXSYS_memcpy32(pBuffer, str.GetPtr(), m_Size);
+}
+void CFX_StringBufBase::Append(FX_BSTR str)
+{
+ int len = str.GetLength();
+ if (len > m_Limit - m_Size) {
+ len = m_Limit - m_Size;
+ }
+ FX_CHAR* pBuffer = (FX_CHAR*)(this + 1);
+ FXSYS_memcpy32(pBuffer + m_Size, str.GetPtr(), len);
+ m_Size += len;
+}
+void CFX_StringBufBase::Append(int i, FX_DWORD flags)
+{
+ char buf[32];
+ int len = _Buffer_itoa(buf, i, flags);
+ Append(CFX_ByteStringC(buf, len));
+}
+void CFX_ByteStringL::Empty(IFX_Allocator* pAllocator)
+{
+ if (m_Ptr) {
+ FX_Allocator_Free(pAllocator, (FX_LPVOID)m_Ptr);
+ }
+ m_Ptr = NULL, m_Length = 0;
+}
+FX_LPSTR CFX_ByteStringL::AllocBuffer(FX_STRSIZE length, IFX_Allocator* pAllocator)
+{
+ Empty(pAllocator);
+ FX_LPSTR str = FX_Allocator_Alloc(pAllocator, FX_CHAR, length + 1);
+ if (!str) {
+ return NULL;
+ }
+ *(FX_LPSTR*)(&m_Ptr) = str;
+ m_Length = length;
+ return str;
+}
+void CFX_ByteStringL::Set(FX_BSTR src, IFX_Allocator* pAllocator)
+{
+ Empty(pAllocator);
+ if (src.GetCStr() != NULL && src.GetLength() > 0) {
+ FX_LPSTR str = FX_Allocator_Alloc(pAllocator, FX_CHAR, src.GetLength() + 1);
+ if (!str) {
+ return;
+ }
+ FXSYS_memcpy32(str, src, src.GetLength());
+ str[src.GetLength()] = '\0';
+ *(FX_LPSTR*)(&m_Ptr) = str;
+ m_Length = src.GetLength();
+ }
+}
diff --git a/core/src/fxcrt/fx_basic_buffer.cpp b/core/src/fxcrt/fx_basic_buffer.cpp
index ef3cd21350..4427857b27 100644
--- a/core/src/fxcrt/fx_basic_buffer.cpp
+++ b/core/src/fxcrt/fx_basic_buffer.cpp
@@ -1,574 +1,574 @@
-// 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
-
-#include "../../include/fxcrt/fx_basic.h"
-FX_STRSIZE FX_ftoa(FX_FLOAT f, FX_LPSTR buf);
-CFX_BinaryBuf::CFX_BinaryBuf(IFX_Allocator* pAllocator)
- : m_pAllocator(pAllocator)
- , m_AllocStep(0)
- , m_pBuffer(NULL)
- , m_DataSize(0)
- , m_AllocSize(0)
-{
-}
-CFX_BinaryBuf::CFX_BinaryBuf(FX_STRSIZE size, IFX_Allocator* pAllocator)
- : m_pAllocator(pAllocator)
- , m_AllocStep(0)
- , m_DataSize(size)
- , m_AllocSize(size)
-{
- m_pBuffer = FX_Allocator_Alloc(m_pAllocator, FX_BYTE, size);
-}
-CFX_BinaryBuf::~CFX_BinaryBuf()
-{
- if (m_pBuffer) {
- FX_Allocator_Free(m_pAllocator, m_pBuffer);
- }
-}
-void CFX_BinaryBuf::Delete(int start_index, int count)
-{
- if (!m_pBuffer || start_index < 0 || start_index + count > m_DataSize) {
- return;
- }
- FXSYS_memmove32(m_pBuffer + start_index, m_pBuffer + start_index + count, m_DataSize - start_index - count);
- m_DataSize -= count;
-}
-void CFX_BinaryBuf::Clear()
-{
- m_DataSize = 0;
-}
-void CFX_BinaryBuf::DetachBuffer()
-{
- m_DataSize = 0;
- m_pBuffer = NULL;
- m_AllocSize = 0;
-}
-void CFX_BinaryBuf::AttachData(void* buffer, FX_STRSIZE size)
-{
- if (m_pBuffer) {
- FX_Allocator_Free(m_pAllocator, m_pBuffer);
- }
- m_DataSize = size;
- m_pBuffer = (FX_LPBYTE)buffer;
- m_AllocSize = size;
-}
-void CFX_BinaryBuf::TakeOver(CFX_BinaryBuf& other)
-{
- AttachData(other.GetBuffer(), other.GetSize());
- other.DetachBuffer();
-}
-void CFX_BinaryBuf::EstimateSize(FX_STRSIZE size, FX_STRSIZE step)
-{
- m_AllocStep = step;
- if (m_AllocSize >= size) {
- return;
- }
- ExpandBuf(size - m_DataSize);
-}
-void CFX_BinaryBuf::ExpandBuf(FX_STRSIZE add_size)
-{
- FX_STRSIZE new_size = add_size + m_DataSize;
- if (m_AllocSize >= new_size) {
- return;
- }
- int alloc_step;
- if (m_AllocStep == 0) {
- alloc_step = m_AllocSize / 4;
- if (alloc_step < 128 ) {
- alloc_step = 128;
- }
- } else {
- alloc_step = m_AllocStep;
- }
- new_size = (new_size + alloc_step - 1) / alloc_step * alloc_step;
- FX_LPBYTE pNewBuffer = m_pBuffer;
- if (pNewBuffer) {
- pNewBuffer = FX_Allocator_Realloc(m_pAllocator, FX_BYTE, m_pBuffer, new_size);
- } else {
- pNewBuffer = FX_Allocator_Alloc(m_pAllocator, FX_BYTE, new_size);
- }
- if (pNewBuffer) {
- m_pBuffer = pNewBuffer;
- m_AllocSize = new_size;
- }
-}
-void CFX_BinaryBuf::CopyData(const void* pStr, FX_STRSIZE size)
-{
- if (size == 0) {
- m_DataSize = 0;
- return;
- }
- if (m_AllocSize < size) {
- ExpandBuf(size - m_DataSize);
- }
- if (!m_pBuffer) {
- return;
- }
- FXSYS_memcpy32(m_pBuffer, pStr, size);
- m_DataSize = size;
-}
-void CFX_BinaryBuf::AppendBlock(const void* pBuf, FX_STRSIZE size)
-{
- ExpandBuf(size);
- if (pBuf && m_pBuffer) {
- FXSYS_memcpy32(m_pBuffer + m_DataSize, pBuf, size);
- }
- m_DataSize += size;
-}
-void CFX_BinaryBuf::InsertBlock(FX_STRSIZE pos, const void* pBuf, FX_STRSIZE size)
-{
- ExpandBuf(size);
- if (!m_pBuffer) {
- return;
- }
- FXSYS_memmove32(m_pBuffer + pos + size, m_pBuffer + pos, m_DataSize - pos);
- if (pBuf) {
- FXSYS_memcpy32(m_pBuffer + pos, pBuf, size);
- }
- m_DataSize += size;
-}
-void CFX_BinaryBuf::AppendFill(FX_BYTE byte, FX_STRSIZE count)
-{
- ExpandBuf(count);
- if (!m_pBuffer) {
- return;
- }
- FXSYS_memset8(m_pBuffer + m_DataSize, byte, count);
- m_DataSize += count;
-}
-CFX_ByteStringC CFX_BinaryBuf::GetByteString() const
-{
- return CFX_ByteStringC(m_pBuffer, m_DataSize);
-}
-void CFX_BinaryBuf::GetByteStringL(CFX_ByteStringL &str) const
-{
- str.Set(CFX_ByteStringC(m_pBuffer, m_DataSize), m_pAllocator);
-}
-CFX_ByteTextBuf& CFX_ByteTextBuf::operator << (FX_BSTR lpsz)
-{
- AppendBlock((FX_LPCBYTE)lpsz, lpsz.GetLength());
- return *this;
-}
-CFX_ByteTextBuf& CFX_ByteTextBuf::operator << (int i)
-{
- char buf[32];
- FXSYS_itoa(i, buf, 10);
- AppendBlock(buf, (FX_STRSIZE)FXSYS_strlen(buf));
- return *this;
-}
-CFX_ByteTextBuf& CFX_ByteTextBuf::operator << (FX_DWORD i)
-{
- char buf[32];
- FXSYS_itoa(i, buf, 10);
- AppendBlock(buf, (FX_STRSIZE)FXSYS_strlen(buf));
- return *this;
-}
-CFX_ByteTextBuf& CFX_ByteTextBuf::operator << (double f)
-{
- char buf[32];
- FX_STRSIZE len = FX_ftoa((FX_FLOAT)f, buf);
- AppendBlock(buf, len);
- return *this;
-}
-CFX_ByteTextBuf& CFX_ByteTextBuf::operator << (const CFX_ByteTextBuf& buf)
-{
- AppendBlock(buf.m_pBuffer, buf.m_DataSize);
- return *this;
-}
-void CFX_ByteTextBuf::operator =(const CFX_ByteStringC& str)
-{
- CopyData((FX_LPCBYTE)str, str.GetLength());
-}
-void CFX_WideTextBuf::AppendChar(FX_WCHAR ch)
-{
- if (m_AllocSize < m_DataSize + (FX_STRSIZE)sizeof(FX_WCHAR)) {
- ExpandBuf(sizeof(FX_WCHAR));
- }
- ASSERT(m_pBuffer != NULL);
- *(FX_WCHAR*)(m_pBuffer + m_DataSize) = ch;
- m_DataSize += sizeof(FX_WCHAR);
-}
-CFX_WideTextBuf& CFX_WideTextBuf::operator << (FX_WSTR str)
-{
- AppendBlock(str.GetPtr(), str.GetLength() * sizeof(FX_WCHAR));
- return *this;
-}
-CFX_WideTextBuf& CFX_WideTextBuf::operator << (const CFX_WideString &str)
-{
- AppendBlock((FX_LPCWSTR)str, str.GetLength() * sizeof(FX_WCHAR));
- return *this;
-}
-CFX_WideTextBuf& CFX_WideTextBuf::operator << (int i)
-{
- char buf[32];
- FXSYS_itoa(i, buf, 10);
- FX_STRSIZE len = (FX_STRSIZE)FXSYS_strlen(buf);
- if (m_AllocSize < m_DataSize + (FX_STRSIZE)(len * sizeof(FX_WCHAR))) {
- ExpandBuf(len * sizeof(FX_WCHAR));
- }
- ASSERT(m_pBuffer != NULL);
- FX_LPWSTR str = (FX_WCHAR*)(m_pBuffer + m_DataSize);
- for (FX_STRSIZE j = 0; j < len; j ++) {
- *str ++ = buf[j];
- }
- m_DataSize += len * sizeof(FX_WCHAR);
- return *this;
-}
-CFX_WideTextBuf& CFX_WideTextBuf::operator << (double f)
-{
- char buf[32];
- FX_STRSIZE len = FX_ftoa((FX_FLOAT)f, buf);
- if (m_AllocSize < m_DataSize + (FX_STRSIZE)(len * sizeof(FX_WCHAR))) {
- ExpandBuf(len * sizeof(FX_WCHAR));
- }
- ASSERT(m_pBuffer != NULL);
- FX_LPWSTR str = (FX_WCHAR*)(m_pBuffer + m_DataSize);
- for (FX_STRSIZE i = 0; i < len; i ++) {
- *str ++ = buf[i];
- }
- m_DataSize += len * sizeof(FX_WCHAR);
- return *this;
-}
-CFX_WideTextBuf& CFX_WideTextBuf::operator << (FX_LPCWSTR lpsz)
-{
- AppendBlock(lpsz, (FX_STRSIZE)FXSYS_wcslen(lpsz)*sizeof(FX_WCHAR));
- return *this;
-}
-CFX_WideTextBuf& CFX_WideTextBuf::operator << (const CFX_WideTextBuf& buf)
-{
- AppendBlock(buf.m_pBuffer, buf.m_DataSize);
- return *this;
-}
-void CFX_WideTextBuf::operator =(FX_WSTR str)
-{
- CopyData(str.GetPtr(), str.GetLength() * sizeof(FX_WCHAR));
-}
-CFX_WideStringC CFX_WideTextBuf::GetWideString() const
-{
- return CFX_WideStringC((FX_LPCWSTR)m_pBuffer, m_DataSize / sizeof(FX_WCHAR));
-}
-void CFX_WideTextBuf::GetWideStringL(CFX_WideStringL& wideText) const
-{
- wideText.Set(CFX_WideStringC((FX_LPCWSTR)m_pBuffer, m_DataSize / sizeof(FX_WCHAR)), m_pAllocator);
-}
-CFX_ArchiveSaver& CFX_ArchiveSaver::operator << (FX_BYTE i)
-{
- if (m_pStream) {
- m_pStream->WriteBlock(&i, 1);
- } else {
- m_SavingBuf.AppendByte(i);
- }
- return *this;
-}
-CFX_ArchiveSaver& CFX_ArchiveSaver::operator << (int i)
-{
- if (m_pStream) {
- m_pStream->WriteBlock(&i, sizeof(int));
- } else {
- m_SavingBuf.AppendBlock(&i, sizeof(int));
- }
- return *this;
-}
-CFX_ArchiveSaver& CFX_ArchiveSaver::operator << (FX_DWORD i)
-{
- if (m_pStream) {
- m_pStream->WriteBlock(&i, sizeof(FX_DWORD));
- } else {
- m_SavingBuf.AppendBlock(&i, sizeof(FX_DWORD));
- }
- return *this;
-}
-CFX_ArchiveSaver& CFX_ArchiveSaver::operator << (FX_FLOAT f)
-{
- if (m_pStream) {
- m_pStream->WriteBlock(&f, sizeof(FX_FLOAT));
- } else {
- m_SavingBuf.AppendBlock(&f, sizeof(FX_FLOAT));
- }
- return *this;
-}
-CFX_ArchiveSaver& CFX_ArchiveSaver::operator << (FX_BSTR bstr)
-{
- int len = bstr.GetLength();
- if (m_pStream) {
- m_pStream->WriteBlock(&len, sizeof(int));
- m_pStream->WriteBlock(bstr, len);
- } else {
- m_SavingBuf.AppendBlock(&len, sizeof(int));
- m_SavingBuf.AppendBlock(bstr, len);
- }
- return *this;
-}
-CFX_ArchiveSaver& CFX_ArchiveSaver::operator << (FX_LPCWSTR wstr)
-{
- FX_STRSIZE len = (FX_STRSIZE)FXSYS_wcslen(wstr);
- if (m_pStream) {
- m_pStream->WriteBlock(&len, sizeof(int));
- m_pStream->WriteBlock(wstr, len);
- } else {
- m_SavingBuf.AppendBlock(&len, sizeof(int));
- m_SavingBuf.AppendBlock(wstr, len);
- }
- return *this;
-}
-CFX_ArchiveSaver& CFX_ArchiveSaver::operator << (const CFX_WideString& wstr)
-{
- CFX_ByteString encoded = wstr.UTF16LE_Encode();
- return operator << (encoded);
-}
-void CFX_ArchiveSaver::Write(const void* pData, FX_STRSIZE dwSize)
-{
- if (m_pStream) {
- m_pStream->WriteBlock(pData, dwSize);
- } else {
- m_SavingBuf.AppendBlock(pData, dwSize);
- }
-}
-CFX_ArchiveLoader::CFX_ArchiveLoader(FX_LPCBYTE pData, FX_DWORD dwSize)
-{
- m_pLoadingBuf = pData;
- m_LoadingPos = 0;
- m_LoadingSize = dwSize;
-}
-FX_BOOL CFX_ArchiveLoader::IsEOF()
-{
- return m_LoadingPos >= m_LoadingSize;
-}
-CFX_ArchiveLoader& CFX_ArchiveLoader::operator >> (FX_BYTE& i)
-{
- if (m_LoadingPos >= m_LoadingSize) {
- return *this;
- }
- i = m_pLoadingBuf[m_LoadingPos++];
- return *this;
-}
-CFX_ArchiveLoader& CFX_ArchiveLoader::operator >> (int& i)
-{
- Read(&i, sizeof(int));
- return *this;
-}
-CFX_ArchiveLoader& CFX_ArchiveLoader::operator >> (FX_DWORD& i)
-{
- Read(&i, sizeof(FX_DWORD));
- return *this;
-}
-CFX_ArchiveLoader& CFX_ArchiveLoader::operator >> (FX_FLOAT& i)
-{
- Read(&i, sizeof(FX_FLOAT));
- return *this;
-}
-CFX_ArchiveLoader& CFX_ArchiveLoader::operator >> (CFX_ByteString& str)
-{
- if (m_LoadingPos + 4 > m_LoadingSize) {
- return *this;
- }
- int len;
- operator >> (len);
- str.Empty();
- if (len <= 0 || m_LoadingPos + len > m_LoadingSize) {
- return *this;
- }
- FX_LPSTR buffer = str.GetBuffer(len);
- FXSYS_memcpy32(buffer, m_pLoadingBuf + m_LoadingPos, len);
- str.ReleaseBuffer(len);
- m_LoadingPos += len;
- return *this;
-}
-CFX_ArchiveLoader& CFX_ArchiveLoader::operator >> (CFX_WideString& str)
-{
- CFX_ByteString encoded;
- operator >> (encoded);
- str = CFX_WideString::FromUTF16LE((const unsigned short*)(FX_LPCSTR)encoded, encoded.GetLength());
- return *this;
-}
-FX_BOOL CFX_ArchiveLoader::Read(void* pBuf, FX_DWORD dwSize)
-{
- if (m_LoadingPos + dwSize > m_LoadingSize) {
- return FALSE;
- }
- FXSYS_memcpy32(pBuf, m_pLoadingBuf + m_LoadingPos, dwSize);
- m_LoadingPos += dwSize;
- return TRUE;
-}
-void CFX_BitStream::Init(FX_LPCBYTE pData, FX_DWORD dwSize)
-{
- m_pData = pData;
- m_BitSize = dwSize * 8;
- m_BitPos = 0;
-}
-void CFX_BitStream::ByteAlign()
-{
- int mod = m_BitPos % 8;
- if (mod == 0) {
- return;
- }
- m_BitPos += 8 - mod;
-}
-FX_DWORD CFX_BitStream::GetBits(FX_DWORD nBits)
-{
- if (nBits > m_BitSize || m_BitPos + nBits > m_BitSize) {
- return 0;
- }
- if (nBits == 1) {
- int bit = (m_pData[m_BitPos / 8] & (1 << (7 - m_BitPos % 8))) ? 1 : 0;
- m_BitPos ++;
- return bit;
- }
- FX_DWORD byte_pos = m_BitPos / 8;
- FX_DWORD bit_pos = m_BitPos % 8, bit_left = nBits;
- FX_DWORD result = 0;
- if (bit_pos) {
- if (8 - bit_pos >= bit_left) {
- result = (m_pData[byte_pos] & (0xff >> bit_pos)) >> (8 - bit_pos - bit_left);
- m_BitPos += bit_left;
- return result;
- }
- bit_left -= 8 - bit_pos;
- result = (m_pData[byte_pos++] & ((1 << (8 - bit_pos)) - 1)) << bit_left;
- }
- while (bit_left >= 8) {
- bit_left -= 8;
- result |= m_pData[byte_pos++] << bit_left;
- }
- if (bit_left) {
- result |= m_pData[byte_pos] >> (8 - bit_left);
- }
- m_BitPos += nBits;
- return result;
-}
-IFX_BufferArchive::IFX_BufferArchive(FX_STRSIZE size, IFX_Allocator* pAllocator)
- : m_pAllocator(pAllocator)
- , m_BufSize(size)
- , m_pBuffer(NULL)
- , m_Length(0)
-{
-}
-void IFX_BufferArchive::Clear()
-{
- m_Length = 0;
- if (m_pBuffer) {
- FX_Allocator_Free(m_pAllocator, m_pBuffer);
- m_pBuffer = NULL;
- }
-}
-FX_BOOL IFX_BufferArchive::Flush()
-{
- FX_BOOL bRet = DoWork(m_pBuffer, m_Length);
- m_Length = 0;
- return bRet;
-}
-FX_INT32 IFX_BufferArchive::AppendBlock(const void* pBuf, size_t size)
-{
- if (!pBuf || size < 1) {
- return 0;
- }
- if (!m_pBuffer) {
- m_pBuffer = FX_Allocator_Alloc(m_pAllocator, FX_BYTE, m_BufSize);
- if (!m_pBuffer) {
- return -1;
- }
- }
- FX_LPBYTE buffer = (FX_LPBYTE)pBuf;
- FX_STRSIZE temp_size = (FX_STRSIZE)size;
- while (temp_size > 0) {
- FX_STRSIZE buf_size = FX_MIN(m_BufSize - m_Length, (FX_STRSIZE)temp_size);
- FXSYS_memcpy32(m_pBuffer + m_Length, buffer, buf_size);
- m_Length += buf_size;
- if (m_Length == m_BufSize) {
- if (!Flush()) {
- return -1;
- }
- }
- temp_size -= buf_size;
- buffer += buf_size;
- }
- return (FX_INT32)size;
-}
-FX_INT32 IFX_BufferArchive::AppendByte(FX_BYTE byte)
-{
- return AppendBlock(&byte, 1);
-}
-FX_INT32 IFX_BufferArchive::AppendDWord(FX_DWORD i)
-{
- char buf[32];
- FXSYS_itoa(i, buf, 10);
- return AppendBlock(buf, (size_t)FXSYS_strlen(buf));
-}
-FX_INT32 IFX_BufferArchive::AppendString(FX_BSTR lpsz)
-{
- return AppendBlock((FX_LPCBYTE)lpsz, lpsz.GetLength());
-}
-CFX_FileBufferArchive::CFX_FileBufferArchive(FX_STRSIZE size, IFX_Allocator* pAllocator)
- : IFX_BufferArchive(size, pAllocator)
- , m_pFile(NULL)
- , m_bTakeover(FALSE)
-{
-}
-CFX_FileBufferArchive::~CFX_FileBufferArchive()
-{
- Clear();
-}
-void CFX_FileBufferArchive::Clear()
-{
- if (m_pFile && m_bTakeover) {
- m_pFile->Release();
- }
- m_pFile = NULL;
- m_bTakeover = FALSE;
- IFX_BufferArchive::Clear();
-}
-FX_BOOL CFX_FileBufferArchive::AttachFile(IFX_StreamWrite *pFile, FX_BOOL bTakeover )
-{
- if (!pFile) {
- return FALSE;
- }
- if (m_pFile && m_bTakeover) {
- m_pFile->Release();
- }
- m_pFile = pFile;
- m_bTakeover = bTakeover;
- return TRUE;
-}
-FX_BOOL CFX_FileBufferArchive::AttachFile(FX_LPCWSTR filename)
-{
- if (!filename) {
- return FALSE;
- }
- if (m_pFile && m_bTakeover) {
- m_pFile->Release();
- }
- m_pFile = FX_CreateFileWrite(filename);
- if (!m_pFile) {
- return FALSE;
- }
- m_bTakeover = TRUE;
- return TRUE;
-}
-FX_BOOL CFX_FileBufferArchive::AttachFile(FX_LPCSTR filename)
-{
- if (!filename) {
- return FALSE;
- }
- if (m_pFile && m_bTakeover) {
- m_pFile->Release();
- }
- m_pFile = FX_CreateFileWrite(filename);
- if (!m_pFile) {
- return FALSE;
- }
- m_bTakeover = TRUE;
- return TRUE;
-}
-FX_BOOL CFX_FileBufferArchive::DoWork(const void* pBuf, size_t size)
-{
- if (!m_pFile) {
- return FALSE;
- }
- if (!pBuf || size < 1) {
- return TRUE;
- }
- return m_pFile->WriteBlock(pBuf, size);
-}
+// 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
+
+#include "../../include/fxcrt/fx_basic.h"
+FX_STRSIZE FX_ftoa(FX_FLOAT f, FX_LPSTR buf);
+CFX_BinaryBuf::CFX_BinaryBuf(IFX_Allocator* pAllocator)
+ : m_pAllocator(pAllocator)
+ , m_AllocStep(0)
+ , m_pBuffer(NULL)
+ , m_DataSize(0)
+ , m_AllocSize(0)
+{
+}
+CFX_BinaryBuf::CFX_BinaryBuf(FX_STRSIZE size, IFX_Allocator* pAllocator)
+ : m_pAllocator(pAllocator)
+ , m_AllocStep(0)
+ , m_DataSize(size)
+ , m_AllocSize(size)
+{
+ m_pBuffer = FX_Allocator_Alloc(m_pAllocator, FX_BYTE, size);
+}
+CFX_BinaryBuf::~CFX_BinaryBuf()
+{
+ if (m_pBuffer) {
+ FX_Allocator_Free(m_pAllocator, m_pBuffer);
+ }
+}
+void CFX_BinaryBuf::Delete(int start_index, int count)
+{
+ if (!m_pBuffer || start_index < 0 || start_index + count > m_DataSize) {
+ return;
+ }
+ FXSYS_memmove32(m_pBuffer + start_index, m_pBuffer + start_index + count, m_DataSize - start_index - count);
+ m_DataSize -= count;
+}
+void CFX_BinaryBuf::Clear()
+{
+ m_DataSize = 0;
+}
+void CFX_BinaryBuf::DetachBuffer()
+{
+ m_DataSize = 0;
+ m_pBuffer = NULL;
+ m_AllocSize = 0;
+}
+void CFX_BinaryBuf::AttachData(void* buffer, FX_STRSIZE size)
+{
+ if (m_pBuffer) {
+ FX_Allocator_Free(m_pAllocator, m_pBuffer);
+ }
+ m_DataSize = size;
+ m_pBuffer = (FX_LPBYTE)buffer;
+ m_AllocSize = size;
+}
+void CFX_BinaryBuf::TakeOver(CFX_BinaryBuf& other)
+{
+ AttachData(other.GetBuffer(), other.GetSize());
+ other.DetachBuffer();
+}
+void CFX_BinaryBuf::EstimateSize(FX_STRSIZE size, FX_STRSIZE step)
+{
+ m_AllocStep = step;
+ if (m_AllocSize >= size) {
+ return;
+ }
+ ExpandBuf(size - m_DataSize);
+}
+void CFX_BinaryBuf::ExpandBuf(FX_STRSIZE add_size)
+{
+ FX_STRSIZE new_size = add_size + m_DataSize;
+ if (m_AllocSize >= new_size) {
+ return;
+ }
+ int alloc_step;
+ if (m_AllocStep == 0) {
+ alloc_step = m_AllocSize / 4;
+ if (alloc_step < 128 ) {
+ alloc_step = 128;
+ }
+ } else {
+ alloc_step = m_AllocStep;
+ }
+ new_size = (new_size + alloc_step - 1) / alloc_step * alloc_step;
+ FX_LPBYTE pNewBuffer = m_pBuffer;
+ if (pNewBuffer) {
+ pNewBuffer = FX_Allocator_Realloc(m_pAllocator, FX_BYTE, m_pBuffer, new_size);
+ } else {
+ pNewBuffer = FX_Allocator_Alloc(m_pAllocator, FX_BYTE, new_size);
+ }
+ if (pNewBuffer) {
+ m_pBuffer = pNewBuffer;
+ m_AllocSize = new_size;
+ }
+}
+void CFX_BinaryBuf::CopyData(const void* pStr, FX_STRSIZE size)
+{
+ if (size == 0) {
+ m_DataSize = 0;
+ return;
+ }
+ if (m_AllocSize < size) {
+ ExpandBuf(size - m_DataSize);
+ }
+ if (!m_pBuffer) {
+ return;
+ }
+ FXSYS_memcpy32(m_pBuffer, pStr, size);
+ m_DataSize = size;
+}
+void CFX_BinaryBuf::AppendBlock(const void* pBuf, FX_STRSIZE size)
+{
+ ExpandBuf(size);
+ if (pBuf && m_pBuffer) {
+ FXSYS_memcpy32(m_pBuffer + m_DataSize, pBuf, size);
+ }
+ m_DataSize += size;
+}
+void CFX_BinaryBuf::InsertBlock(FX_STRSIZE pos, const void* pBuf, FX_STRSIZE size)
+{
+ ExpandBuf(size);
+ if (!m_pBuffer) {
+ return;
+ }
+ FXSYS_memmove32(m_pBuffer + pos + size, m_pBuffer + pos, m_DataSize - pos);
+ if (pBuf) {
+ FXSYS_memcpy32(m_pBuffer + pos, pBuf, size);
+ }
+ m_DataSize += size;
+}
+void CFX_BinaryBuf::AppendFill(FX_BYTE byte, FX_STRSIZE count)
+{
+ ExpandBuf(count);
+ if (!m_pBuffer) {
+ return;
+ }
+ FXSYS_memset8(m_pBuffer + m_DataSize, byte, count);
+ m_DataSize += count;
+}
+CFX_ByteStringC CFX_BinaryBuf::GetByteString() const
+{
+ return CFX_ByteStringC(m_pBuffer, m_DataSize);
+}
+void CFX_BinaryBuf::GetByteStringL(CFX_ByteStringL &str) const
+{
+ str.Set(CFX_ByteStringC(m_pBuffer, m_DataSize), m_pAllocator);
+}
+CFX_ByteTextBuf& CFX_ByteTextBuf::operator << (FX_BSTR lpsz)
+{
+ AppendBlock((FX_LPCBYTE)lpsz, lpsz.GetLength());
+ return *this;
+}
+CFX_ByteTextBuf& CFX_ByteTextBuf::operator << (int i)
+{
+ char buf[32];
+ FXSYS_itoa(i, buf, 10);
+ AppendBlock(buf, (FX_STRSIZE)FXSYS_strlen(buf));
+ return *this;
+}
+CFX_ByteTextBuf& CFX_ByteTextBuf::operator << (FX_DWORD i)
+{
+ char buf[32];
+ FXSYS_itoa(i, buf, 10);
+ AppendBlock(buf, (FX_STRSIZE)FXSYS_strlen(buf));
+ return *this;
+}
+CFX_ByteTextBuf& CFX_ByteTextBuf::operator << (double f)
+{
+ char buf[32];
+ FX_STRSIZE len = FX_ftoa((FX_FLOAT)f, buf);
+ AppendBlock(buf, len);
+ return *this;
+}
+CFX_ByteTextBuf& CFX_ByteTextBuf::operator << (const CFX_ByteTextBuf& buf)
+{
+ AppendBlock(buf.m_pBuffer, buf.m_DataSize);
+ return *this;
+}
+void CFX_ByteTextBuf::operator =(const CFX_ByteStringC& str)
+{
+ CopyData((FX_LPCBYTE)str, str.GetLength());
+}
+void CFX_WideTextBuf::AppendChar(FX_WCHAR ch)
+{
+ if (m_AllocSize < m_DataSize + (FX_STRSIZE)sizeof(FX_WCHAR)) {
+ ExpandBuf(sizeof(FX_WCHAR));
+ }
+ ASSERT(m_pBuffer != NULL);
+ *(FX_WCHAR*)(m_pBuffer + m_DataSize) = ch;
+ m_DataSize += sizeof(FX_WCHAR);
+}
+CFX_WideTextBuf& CFX_WideTextBuf::operator << (FX_WSTR str)
+{
+ AppendBlock(str.GetPtr(), str.GetLength() * sizeof(FX_WCHAR));
+ return *this;
+}
+CFX_WideTextBuf& CFX_WideTextBuf::operator << (const CFX_WideString &str)
+{
+ AppendBlock((FX_LPCWSTR)str, str.GetLength() * sizeof(FX_WCHAR));
+ return *this;
+}
+CFX_WideTextBuf& CFX_WideTextBuf::operator << (int i)
+{
+ char buf[32];
+ FXSYS_itoa(i, buf, 10);
+ FX_STRSIZE len = (FX_STRSIZE)FXSYS_strlen(buf);
+ if (m_AllocSize < m_DataSize + (FX_STRSIZE)(len * sizeof(FX_WCHAR))) {
+ ExpandBuf(len * sizeof(FX_WCHAR));
+ }
+ ASSERT(m_pBuffer != NULL);
+ FX_LPWSTR str = (FX_WCHAR*)(m_pBuffer + m_DataSize);
+ for (FX_STRSIZE j = 0; j < len; j ++) {
+ *str ++ = buf[j];
+ }
+ m_DataSize += len * sizeof(FX_WCHAR);
+ return *this;
+}
+CFX_WideTextBuf& CFX_WideTextBuf::operator << (double f)
+{
+ char buf[32];
+ FX_STRSIZE len = FX_ftoa((FX_FLOAT)f, buf);
+ if (m_AllocSize < m_DataSize + (FX_STRSIZE)(len * sizeof(FX_WCHAR))) {
+ ExpandBuf(len * sizeof(FX_WCHAR));
+ }
+ ASSERT(m_pBuffer != NULL);
+ FX_LPWSTR str = (FX_WCHAR*)(m_pBuffer + m_DataSize);
+ for (FX_STRSIZE i = 0; i < len; i ++) {
+ *str ++ = buf[i];
+ }
+ m_DataSize += len * sizeof(FX_WCHAR);
+ return *this;
+}
+CFX_WideTextBuf& CFX_WideTextBuf::operator << (FX_LPCWSTR lpsz)
+{
+ AppendBlock(lpsz, (FX_STRSIZE)FXSYS_wcslen(lpsz)*sizeof(FX_WCHAR));
+ return *this;
+}
+CFX_WideTextBuf& CFX_WideTextBuf::operator << (const CFX_WideTextBuf& buf)
+{
+ AppendBlock(buf.m_pBuffer, buf.m_DataSize);
+ return *this;
+}
+void CFX_WideTextBuf::operator =(FX_WSTR str)
+{
+ CopyData(str.GetPtr(), str.GetLength() * sizeof(FX_WCHAR));
+}
+CFX_WideStringC CFX_WideTextBuf::GetWideString() const
+{
+ return CFX_WideStringC((FX_LPCWSTR)m_pBuffer, m_DataSize / sizeof(FX_WCHAR));
+}
+void CFX_WideTextBuf::GetWideStringL(CFX_WideStringL& wideText) const
+{
+ wideText.Set(CFX_WideStringC((FX_LPCWSTR)m_pBuffer, m_DataSize / sizeof(FX_WCHAR)), m_pAllocator);
+}
+CFX_ArchiveSaver& CFX_ArchiveSaver::operator << (FX_BYTE i)
+{
+ if (m_pStream) {
+ m_pStream->WriteBlock(&i, 1);
+ } else {
+ m_SavingBuf.AppendByte(i);
+ }
+ return *this;
+}
+CFX_ArchiveSaver& CFX_ArchiveSaver::operator << (int i)
+{
+ if (m_pStream) {
+ m_pStream->WriteBlock(&i, sizeof(int));
+ } else {
+ m_SavingBuf.AppendBlock(&i, sizeof(int));
+ }
+ return *this;
+}
+CFX_ArchiveSaver& CFX_ArchiveSaver::operator << (FX_DWORD i)
+{
+ if (m_pStream) {
+ m_pStream->WriteBlock(&i, sizeof(FX_DWORD));
+ } else {
+ m_SavingBuf.AppendBlock(&i, sizeof(FX_DWORD));
+ }
+ return *this;
+}
+CFX_ArchiveSaver& CFX_ArchiveSaver::operator << (FX_FLOAT f)
+{
+ if (m_pStream) {
+ m_pStream->WriteBlock(&f, sizeof(FX_FLOAT));
+ } else {
+ m_SavingBuf.AppendBlock(&f, sizeof(FX_FLOAT));
+ }
+ return *this;
+}
+CFX_ArchiveSaver& CFX_ArchiveSaver::operator << (FX_BSTR bstr)
+{
+ int len = bstr.GetLength();
+ if (m_pStream) {
+ m_pStream->WriteBlock(&len, sizeof(int));
+ m_pStream->WriteBlock(bstr, len);
+ } else {
+ m_SavingBuf.AppendBlock(&len, sizeof(int));
+ m_SavingBuf.AppendBlock(bstr, len);
+ }
+ return *this;
+}
+CFX_ArchiveSaver& CFX_ArchiveSaver::operator << (FX_LPCWSTR wstr)
+{
+ FX_STRSIZE len = (FX_STRSIZE)FXSYS_wcslen(wstr);
+ if (m_pStream) {
+ m_pStream->WriteBlock(&len, sizeof(int));
+ m_pStream->WriteBlock(wstr, len);
+ } else {
+ m_SavingBuf.AppendBlock(&len, sizeof(int));
+ m_SavingBuf.AppendBlock(wstr, len);
+ }
+ return *this;
+}
+CFX_ArchiveSaver& CFX_ArchiveSaver::operator << (const CFX_WideString& wstr)
+{
+ CFX_ByteString encoded = wstr.UTF16LE_Encode();
+ return operator << (encoded);
+}
+void CFX_ArchiveSaver::Write(const void* pData, FX_STRSIZE dwSize)
+{
+ if (m_pStream) {
+ m_pStream->WriteBlock(pData, dwSize);
+ } else {
+ m_SavingBuf.AppendBlock(pData, dwSize);
+ }
+}
+CFX_ArchiveLoader::CFX_ArchiveLoader(FX_LPCBYTE pData, FX_DWORD dwSize)
+{
+ m_pLoadingBuf = pData;
+ m_LoadingPos = 0;
+ m_LoadingSize = dwSize;
+}
+FX_BOOL CFX_ArchiveLoader::IsEOF()
+{
+ return m_LoadingPos >= m_LoadingSize;
+}
+CFX_ArchiveLoader& CFX_ArchiveLoader::operator >> (FX_BYTE& i)
+{
+ if (m_LoadingPos >= m_LoadingSize) {
+ return *this;
+ }
+ i = m_pLoadingBuf[m_LoadingPos++];
+ return *this;
+}
+CFX_ArchiveLoader& CFX_ArchiveLoader::operator >> (int& i)
+{
+ Read(&i, sizeof(int));
+ return *this;
+}
+CFX_ArchiveLoader& CFX_ArchiveLoader::operator >> (FX_DWORD& i)
+{
+ Read(&i, sizeof(FX_DWORD));
+ return *this;
+}
+CFX_ArchiveLoader& CFX_ArchiveLoader::operator >> (FX_FLOAT& i)
+{
+ Read(&i, sizeof(FX_FLOAT));
+ return *this;
+}
+CFX_ArchiveLoader& CFX_ArchiveLoader::operator >> (CFX_ByteString& str)
+{
+ if (m_LoadingPos + 4 > m_LoadingSize) {
+ return *this;
+ }
+ int len;
+ operator >> (len);
+ str.Empty();
+ if (len <= 0 || m_LoadingPos + len > m_LoadingSize) {
+ return *this;
+ }
+ FX_LPSTR buffer = str.GetBuffer(len);
+ FXSYS_memcpy32(buffer, m_pLoadingBuf + m_LoadingPos, len);
+ str.ReleaseBuffer(len);
+ m_LoadingPos += len;
+ return *this;
+}
+CFX_ArchiveLoader& CFX_ArchiveLoader::operator >> (CFX_WideString& str)
+{
+ CFX_ByteString encoded;
+ operator >> (encoded);
+ str = CFX_WideString::FromUTF16LE((const unsigned short*)(FX_LPCSTR)encoded, encoded.GetLength());
+ return *this;
+}
+FX_BOOL CFX_ArchiveLoader::Read(void* pBuf, FX_DWORD dwSize)
+{
+ if (m_LoadingPos + dwSize > m_LoadingSize) {
+ return FALSE;
+ }
+ FXSYS_memcpy32(pBuf, m_pLoadingBuf + m_LoadingPos, dwSize);
+ m_LoadingPos += dwSize;
+ return TRUE;
+}
+void CFX_BitStream::Init(FX_LPCBYTE pData, FX_DWORD dwSize)
+{
+ m_pData = pData;
+ m_BitSize = dwSize * 8;
+ m_BitPos = 0;
+}
+void CFX_BitStream::ByteAlign()
+{
+ int mod = m_BitPos % 8;
+ if (mod == 0) {
+ return;
+ }
+ m_BitPos += 8 - mod;
+}
+FX_DWORD CFX_BitStream::GetBits(FX_DWORD nBits)
+{
+ if (nBits > m_BitSize || m_BitPos + nBits > m_BitSize) {
+ return 0;
+ }
+ if (nBits == 1) {
+ int bit = (m_pData[m_BitPos / 8] & (1 << (7 - m_BitPos % 8))) ? 1 : 0;
+ m_BitPos ++;
+ return bit;
+ }
+ FX_DWORD byte_pos = m_BitPos / 8;
+ FX_DWORD bit_pos = m_BitPos % 8, bit_left = nBits;
+ FX_DWORD result = 0;
+ if (bit_pos) {
+ if (8 - bit_pos >= bit_left) {
+ result = (m_pData[byte_pos] & (0xff >> bit_pos)) >> (8 - bit_pos - bit_left);
+ m_BitPos += bit_left;
+ return result;
+ }
+ bit_left -= 8 - bit_pos;
+ result = (m_pData[byte_pos++] & ((1 << (8 - bit_pos)) - 1)) << bit_left;
+ }
+ while (bit_left >= 8) {
+ bit_left -= 8;
+ result |= m_pData[byte_pos++] << bit_left;
+ }
+ if (bit_left) {
+ result |= m_pData[byte_pos] >> (8 - bit_left);
+ }
+ m_BitPos += nBits;
+ return result;
+}
+IFX_BufferArchive::IFX_BufferArchive(FX_STRSIZE size, IFX_Allocator* pAllocator)
+ : m_pAllocator(pAllocator)
+ , m_BufSize(size)
+ , m_pBuffer(NULL)
+ , m_Length(0)
+{
+}
+void IFX_BufferArchive::Clear()
+{
+ m_Length = 0;
+ if (m_pBuffer) {
+ FX_Allocator_Free(m_pAllocator, m_pBuffer);
+ m_pBuffer = NULL;
+ }
+}
+FX_BOOL IFX_BufferArchive::Flush()
+{
+ FX_BOOL bRet = DoWork(m_pBuffer, m_Length);
+ m_Length = 0;
+ return bRet;
+}
+FX_INT32 IFX_BufferArchive::AppendBlock(const void* pBuf, size_t size)
+{
+ if (!pBuf || size < 1) {
+ return 0;
+ }
+ if (!m_pBuffer) {
+ m_pBuffer = FX_Allocator_Alloc(m_pAllocator, FX_BYTE, m_BufSize);
+ if (!m_pBuffer) {
+ return -1;
+ }
+ }
+ FX_LPBYTE buffer = (FX_LPBYTE)pBuf;
+ FX_STRSIZE temp_size = (FX_STRSIZE)size;
+ while (temp_size > 0) {
+ FX_STRSIZE buf_size = FX_MIN(m_BufSize - m_Length, (FX_STRSIZE)temp_size);
+ FXSYS_memcpy32(m_pBuffer + m_Length, buffer, buf_size);
+ m_Length += buf_size;
+ if (m_Length == m_BufSize) {
+ if (!Flush()) {
+ return -1;
+ }
+ }
+ temp_size -= buf_size;
+ buffer += buf_size;
+ }
+ return (FX_INT32)size;
+}
+FX_INT32 IFX_BufferArchive::AppendByte(FX_BYTE byte)
+{
+ return AppendBlock(&byte, 1);
+}
+FX_INT32 IFX_BufferArchive::AppendDWord(FX_DWORD i)
+{
+ char buf[32];
+ FXSYS_itoa(i, buf, 10);
+ return AppendBlock(buf, (size_t)FXSYS_strlen(buf));
+}
+FX_INT32 IFX_BufferArchive::AppendString(FX_BSTR lpsz)
+{
+ return AppendBlock((FX_LPCBYTE)lpsz, lpsz.GetLength());
+}
+CFX_FileBufferArchive::CFX_FileBufferArchive(FX_STRSIZE size, IFX_Allocator* pAllocator)
+ : IFX_BufferArchive(size, pAllocator)
+ , m_pFile(NULL)
+ , m_bTakeover(FALSE)
+{
+}
+CFX_FileBufferArchive::~CFX_FileBufferArchive()
+{
+ Clear();
+}
+void CFX_FileBufferArchive::Clear()
+{
+ if (m_pFile && m_bTakeover) {
+ m_pFile->Release();
+ }
+ m_pFile = NULL;
+ m_bTakeover = FALSE;
+ IFX_BufferArchive::Clear();
+}
+FX_BOOL CFX_FileBufferArchive::AttachFile(IFX_StreamWrite *pFile, FX_BOOL bTakeover )
+{
+ if (!pFile) {
+ return FALSE;
+ }
+ if (m_pFile && m_bTakeover) {
+ m_pFile->Release();
+ }
+ m_pFile = pFile;
+ m_bTakeover = bTakeover;
+ return TRUE;
+}
+FX_BOOL CFX_FileBufferArchive::AttachFile(FX_LPCWSTR filename)
+{
+ if (!filename) {
+ return FALSE;
+ }
+ if (m_pFile && m_bTakeover) {
+ m_pFile->Release();
+ }
+ m_pFile = FX_CreateFileWrite(filename);
+ if (!m_pFile) {
+ return FALSE;
+ }
+ m_bTakeover = TRUE;
+ return TRUE;
+}
+FX_BOOL CFX_FileBufferArchive::AttachFile(FX_LPCSTR filename)
+{
+ if (!filename) {
+ return FALSE;
+ }
+ if (m_pFile && m_bTakeover) {
+ m_pFile->Release();
+ }
+ m_pFile = FX_CreateFileWrite(filename);
+ if (!m_pFile) {
+ return FALSE;
+ }
+ m_bTakeover = TRUE;
+ return TRUE;
+}
+FX_BOOL CFX_FileBufferArchive::DoWork(const void* pBuf, size_t size)
+{
+ if (!m_pFile) {
+ return FALSE;
+ }
+ if (!pBuf || size < 1) {
+ return TRUE;
+ }
+ return m_pFile->WriteBlock(pBuf, size);
+}
diff --git a/core/src/fxcrt/fx_basic_coords.cpp b/core/src/fxcrt/fx_basic_coords.cpp
index 47204e0aa3..f55c267da5 100644
--- a/core/src/fxcrt/fx_basic_coords.cpp
+++ b/core/src/fxcrt/fx_basic_coords.cpp
@@ -1,556 +1,556 @@
-// 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
-
-#include "../../include/fxcrt/fx_ext.h"
-void FX_RECT::Normalize()
-{
- if (left > right) {
- int temp = left;
- left = right;
- right = temp;
- }
- if (top > bottom) {
- int temp = top;
- top = bottom;
- bottom = temp;
- }
-}
-void FX_RECT::Intersect(const FX_RECT& src)
-{
- FX_RECT src_n = src;
- src_n.Normalize();
- Normalize();
- left = left > src_n.left ? left : src_n.left;
- top = top > src_n.top ? top : src_n.top;
- right = right < src_n.right ? right : src_n.right;
- bottom = bottom < src_n.bottom ? bottom : src_n.bottom;
- if (left > right || top > bottom) {
- left = top = right = bottom = 0;
- }
-}
-void FX_RECT::Union(const FX_RECT& other_rect)
-{
- Normalize();
- FX_RECT other = other_rect;
- other.Normalize();
- left = left < other.left ? left : other.left;
- right = right > other.right ? right : other.right;
- bottom = bottom > other.bottom ? bottom : other.bottom;
- top = top < other.top ? top : other.top;
-}
-FX_BOOL GetIntersection(FX_FLOAT low1, FX_FLOAT high1, FX_FLOAT low2, FX_FLOAT high2,
- FX_FLOAT& interlow, FX_FLOAT& interhigh)
-{
- if (low1 >= high2 || low2 >= high1) {
- return FALSE;
- }
- interlow = low1 > low2 ? low1 : low2;
- interhigh = high1 > high2 ? high2 : high1;
- return TRUE;
-}
-extern "C" int FXSYS_round(FX_FLOAT d)
-{
- int iRet = 0;
- if (d >= 0.0f) {
- iRet = (int)(d + 0.5f);
- if (iRet >= 0) {
- return iRet;
- }
- return -iRet;
- }
- return (int)(d - 0.5f);
-}
-CFX_FloatRect::CFX_FloatRect(const FX_RECT& rect)
-{
- left = (FX_FLOAT)(rect.left);
- right = (FX_FLOAT)(rect.right);
- bottom = (FX_FLOAT)(rect.top);
- top = (FX_FLOAT)(rect.bottom);
-}
-void CFX_FloatRect::Normalize()
-{
- FX_FLOAT temp;
- if (left > right) {
- temp = left;
- left = right;
- right = temp;
- }
- if (bottom > top) {
- temp = top;
- top = bottom;
- bottom = temp;
- }
-}
-void CFX_FloatRect::Intersect(const CFX_FloatRect& other_rect)
-{
- Normalize();
- CFX_FloatRect other = other_rect;
- other.Normalize();
- left = left > other.left ? left : other.left;
- right = right < other.right ? right : other.right;
- bottom = bottom > other.bottom ? bottom : other.bottom;
- top = top < other.top ? top : other.top;
- if (left > right || bottom > top) {
- left = right = bottom = top = 0;
- }
-}
-void CFX_FloatRect::Union(const CFX_FloatRect& other_rect)
-{
- Normalize();
- CFX_FloatRect other = other_rect;
- other.Normalize();
- left = left < other.left ? left : other.left;
- right = right > other.right ? right : other.right;
- bottom = bottom < other.bottom ? bottom : other.bottom;
- top = top > other.top ? top : other.top;
-}
-void CFX_FloatRect::Transform(const CFX_Matrix* pMatrix)
-{
- pMatrix->TransformRect(left, right, top, bottom);
-}
-int CFX_FloatRect::Substract4(CFX_FloatRect& s, CFX_FloatRect* pRects)
-{
- Normalize();
- s.Normalize();
- int nRects = 0;
- CFX_FloatRect rects[4];
- if (left < s.left) {
- rects[nRects].left = left;
- rects[nRects].right = s.left;
- rects[nRects].bottom = bottom;
- rects[nRects].top = top;
- nRects ++;
- }
- if (s.left < right && s.top < top) {
- rects[nRects].left = s.left;
- rects[nRects].right = right;
- rects[nRects].bottom = s.top;
- rects[nRects].top = top;
- nRects ++;
- }
- if (s.top > bottom && s.right < right) {
- rects[nRects].left = s.right;
- rects[nRects].right = right;
- rects[nRects].bottom = bottom;
- rects[nRects].top = s.top;
- nRects ++;
- }
- if (s.bottom > bottom) {
- rects[nRects].left = s.left;
- rects[nRects].right = s.right;
- rects[nRects].bottom = bottom;
- rects[nRects].top = s.bottom;
- nRects ++;
- }
- if (nRects == 0) {
- return 0;
- }
- for (int i = 0; i < nRects; i ++) {
- pRects[i] = rects[i];
- pRects[i].Intersect(*this);
- }
- return nRects;
-}
-FX_RECT CFX_FloatRect::GetOutterRect() const
-{
- CFX_FloatRect rect1 = *this;
- FX_RECT rect;
- rect.left = (int)FXSYS_floor(rect1.left);
- rect.right = (int)FXSYS_ceil(rect1.right);
- rect.top = (int)FXSYS_floor(rect1.bottom);
- rect.bottom = (int)FXSYS_ceil(rect1.top);
- rect.Normalize();
- return rect;
-}
-FX_RECT CFX_FloatRect::GetInnerRect() const
-{
- CFX_FloatRect rect1 = *this;
- FX_RECT rect;
- rect.left = (int)FXSYS_ceil(rect1.left);
- rect.right = (int)FXSYS_floor(rect1.right);
- rect.top = (int)FXSYS_ceil(rect1.bottom);
- rect.bottom = (int)FXSYS_floor(rect1.top);
- rect.Normalize();
- return rect;
-}
-static void _MatchFloatRange(FX_FLOAT f1, FX_FLOAT f2, int& i1, int& i2)
-{
- int length = (int)FXSYS_ceil(f2 - f1);
- int i1_1 = (int)FXSYS_floor(f1);
- int i1_2 = (int)FXSYS_ceil(f1);
- FX_FLOAT error1 = f1 - i1_1 + (FX_FLOAT)FXSYS_fabs(f2 - i1_1 - length);
- FX_FLOAT error2 = i1_2 - f1 + (FX_FLOAT)FXSYS_fabs(f2 - i1_2 - length);
- i1 = (error1 > error2) ? i1_2 : i1_1;
- i2 = i1 + length;
-}
-FX_RECT CFX_FloatRect::GetClosestRect() const
-{
- CFX_FloatRect rect1 = *this;
- FX_RECT rect;
- _MatchFloatRange(rect1.left, rect1.right, rect.left, rect.right);
- _MatchFloatRange(rect1.bottom, rect1.top, rect.top, rect.bottom);
- rect.Normalize();
- return rect;
-}
-FX_BOOL CFX_FloatRect::Contains(const CFX_FloatRect& other_rect) const
-{
- CFX_FloatRect n1 = *this;
- n1.Normalize();
- CFX_FloatRect n2 = other_rect;
- n2.Normalize();
- if (n2.left >= n1.left && n2.right <= n1.right && n2.bottom >= n1.bottom && n2.top <= n1.top) {
- return TRUE;
- }
- return FALSE;
-}
-FX_BOOL CFX_FloatRect::Contains(FX_FLOAT x, FX_FLOAT y) const
-{
- CFX_FloatRect n1 = *this;
- n1.Normalize();
- return x <= n1.right && x >= n1.left && y <= n1.top && y >= n1.bottom;
-}
-void CFX_FloatRect::UpdateRect(FX_FLOAT x, FX_FLOAT y)
-{
- if (left > x) {
- left = x;
- }
- if (right < x) {
- right = x;
- }
- if (bottom > y) {
- bottom = y;
- }
- if (top < y) {
- top = y;
- }
-}
-CFX_FloatRect CFX_FloatRect::GetBBox(const CFX_FloatPoint* pPoints, int nPoints)
-{
- if (nPoints == 0) {
- return CFX_FloatRect();
- }
- FX_FLOAT min_x = pPoints->x, max_x = pPoints->x, min_y = pPoints->y, max_y = pPoints->y;
- for (int i = 1; i < nPoints; i ++) {
- if (min_x > pPoints[i].x) {
- min_x = pPoints[i].x;
- }
- if (max_x < pPoints[i].x) {
- max_x = pPoints[i].x;
- }
- if (min_y > pPoints[i].y) {
- min_y = pPoints[i].y;
- }
- if (max_y < pPoints[i].y) {
- max_y = pPoints[i].y;
- }
- }
- return CFX_FloatRect(min_x, min_y, max_x, max_y);
-}
-void CFX_Matrix::Set(FX_FLOAT a, FX_FLOAT b, FX_FLOAT c, FX_FLOAT d, FX_FLOAT e, FX_FLOAT f)
-{
- this->a = a;
- this->b = b;
- this->c = c;
- this->d = d;
- this->e = e;
- this->f = f;
-}
-void CFX_Matrix::Set(const FX_FLOAT n[6])
-{
- FXSYS_memcpy32((void*)this, &n, sizeof(CFX_Matrix));
-}
-void CFX_Matrix::SetReverse(const CFX_Matrix &m)
-{
- FX_FLOAT i = m.a * m.d - m.b * m.c;
- if (FXSYS_fabs(i) == 0) {
- return;
- }
- FX_FLOAT j = -i;
- a = m.d / i;
- b = m.b / j;
- c = m.c / j;
- d = m.a / i;
- e = (m.c * m.f - m.d * m.e) / i;
- f = (m.a * m.f - m.b * m.e) / j;
-}
-static void FXCRT_Matrix_Concat(CFX_Matrix &m, const CFX_Matrix &m1, const CFX_Matrix &m2)
-{
- FX_FLOAT aa = m1.a * m2.a + m1.b * m2.c;
- FX_FLOAT bb = m1.a * m2.b + m1.b * m2.d;
- FX_FLOAT cc = m1.c * m2.a + m1.d * m2.c;
- FX_FLOAT dd = m1.c * m2.b + m1.d * m2.d;
- FX_FLOAT ee = m1.e * m2.a + m1.f * m2.c + m2.e;
- FX_FLOAT ff = m1.e * m2.b + m1.f * m2.d + m2.f;
- m.a = aa, m.b = bb, m.c = cc, m.d = dd, m.e = ee, m.f = ff;
-}
-void CFX_Matrix::Concat(FX_FLOAT a, FX_FLOAT b, FX_FLOAT c, FX_FLOAT d, FX_FLOAT e, FX_FLOAT f, FX_BOOL bPrepended)
-{
- CFX_Matrix m;
- m.Set(a, b, c, d, e, f);
- Concat(m, bPrepended);
-}
-void CFX_Matrix::Concat(const CFX_Matrix &m, FX_BOOL bPrepended)
-{
- if (bPrepended) {
- FXCRT_Matrix_Concat(*this, m, *this);
- } else {
- FXCRT_Matrix_Concat(*this, *this, m);
- }
-}
-void CFX_Matrix::ConcatInverse(const CFX_Matrix& src, FX_BOOL bPrepended)
-{
- CFX_Matrix m;
- m.SetReverse(src);
- Concat(m, bPrepended);
-}
-FX_BOOL CFX_Matrix::IsInvertible() const
-{
- return FXSYS_fabs(a * d - b * c) >= 0.0001f;
-}
-FX_BOOL CFX_Matrix::Is90Rotated() const
-{
- return FXSYS_fabs(a * 1000) < FXSYS_fabs(b) && FXSYS_fabs(d * 1000) < FXSYS_fabs(c);
-}
-FX_BOOL CFX_Matrix::IsScaled() const
-{
- return FXSYS_fabs(b * 1000) < FXSYS_fabs(a) && FXSYS_fabs(c * 1000) < FXSYS_fabs(d);
-}
-void CFX_Matrix::Translate(FX_FLOAT x, FX_FLOAT y, FX_BOOL bPrepended)
-{
- if (bPrepended) {
- e += x * a + y * c;
- f += y * d + x * b;
- } else {
- e += x, f += y;
- }
-}
-void CFX_Matrix::Scale(FX_FLOAT sx, FX_FLOAT sy, FX_BOOL bPrepended)
-{
- a *= sx, d *= sy;
- if (bPrepended) {
- b *= sx;
- c *= sy;
- } else {
- b *= sy;
- c *= sx;
- e *= sx;
- f *= sy;
- }
-}
-void CFX_Matrix::Rotate(FX_FLOAT fRadian, FX_BOOL bPrepended)
-{
- FX_FLOAT cosValue = FXSYS_cos(fRadian);
- FX_FLOAT sinValue = FXSYS_sin(fRadian);
- CFX_Matrix m;
- m.Set(cosValue, sinValue, -sinValue, cosValue, 0, 0);
- if (bPrepended) {
- FXCRT_Matrix_Concat(*this, m, *this);
- } else {
- FXCRT_Matrix_Concat(*this, *this, m);
- }
-}
-void CFX_Matrix::RotateAt(FX_FLOAT fRadian, FX_FLOAT dx, FX_FLOAT dy, FX_BOOL bPrepended)
-{
- Translate(dx, dy, bPrepended);
- Rotate(fRadian, bPrepended);
- Translate(-dx, -dy, bPrepended);
-}
-void CFX_Matrix::Shear(FX_FLOAT fAlphaRadian, FX_FLOAT fBetaRadian, FX_BOOL bPrepended)
-{
- CFX_Matrix m;
- m.Set(1, FXSYS_tan(fAlphaRadian), FXSYS_tan(fBetaRadian), 1, 0, 0);
- if (bPrepended) {
- FXCRT_Matrix_Concat(*this, m, *this);
- } else {
- FXCRT_Matrix_Concat(*this, *this, m);
- }
-}
-void CFX_Matrix::MatchRect(const CFX_FloatRect& dest, const CFX_FloatRect& src)
-{
- FX_FLOAT fDiff = src.left - src.right;
- a = FXSYS_fabs(fDiff) < 0.001f ? 1 : (dest.left - dest.right) / fDiff;
- fDiff = src.bottom - src.top;
- d = FXSYS_fabs(fDiff) < 0.001f ? 1 : (dest.bottom - dest.top) / fDiff;
- e = dest.left - src.left * a;
- f = dest.bottom - src.bottom * d;
- b = 0;
- c = 0;
-}
-FX_FLOAT CFX_Matrix::GetXUnit() const
-{
- if (b == 0) {
- return (a > 0 ? a : -a);
- }
- if (a == 0) {
- return (b > 0 ? b : -b);
- }
- return FXSYS_sqrt(a * a + b * b);
-}
-FX_FLOAT CFX_Matrix::GetYUnit() const
-{
- if (c == 0) {
- return (d > 0 ? d : -d);
- }
- if (d == 0) {
- return (c > 0 ? c : -c);
- }
- return FXSYS_sqrt(c * c + d * d);
-}
-void CFX_Matrix::GetUnitRect(CFX_RectF &rect) const
-{
- rect.left = rect.top = 0;
- rect.width = rect.height = 1;
- TransformRect(rect);
-}
-CFX_FloatRect CFX_Matrix::GetUnitRect() const
-{
- CFX_FloatRect rect(0, 0, 1, 1);
- rect.Transform((const CFX_Matrix*)this);
- return rect;
-}
-FX_FLOAT CFX_Matrix::GetUnitArea() const
-{
- FX_FLOAT A = FXSYS_sqrt(a * a + b * b);
- FX_FLOAT B = FXSYS_sqrt(c * c + d * d);
- FX_FLOAT ac = a + c, bd = b + d;
- FX_FLOAT C = FXSYS_sqrt(ac * ac + bd * bd);
- FX_FLOAT P = (A + B + C ) / 2;
- return FXSYS_sqrt(P * (P - A) * (P - B) * (P - C)) * 2;
-}
-FX_FLOAT CFX_Matrix::TransformXDistance(FX_FLOAT dx) const
-{
- FX_FLOAT fx = a * dx, fy = b * dx;
- return FXSYS_sqrt(fx * fx + fy * fy);
-}
-FX_INT32 CFX_Matrix::TransformXDistance(FX_INT32 dx) const
-{
- FX_FLOAT fx = a * dx, fy = b * dx;
- return FXSYS_round(FXSYS_sqrt(fx * fx + fy * fy));
-}
-FX_FLOAT CFX_Matrix::TransformYDistance(FX_FLOAT dy) const
-{
- FX_FLOAT fx = c * dy, fy = d * dy;
- return FXSYS_sqrt(fx * fx + fy * fy);
-}
-FX_INT32 CFX_Matrix::TransformYDistance(FX_INT32 dy) const
-{
- FX_FLOAT fx = c * dy, fy = d * dy;
- return FXSYS_round(FXSYS_sqrt(fx * fx + fy * fy));
-}
-FX_FLOAT CFX_Matrix::TransformDistance(FX_FLOAT dx, FX_FLOAT dy) const
-{
- FX_FLOAT fx = a * dx + c * dy, fy = b * dx + d * dy;
- return FXSYS_sqrt(fx * fx + fy * fy);
-}
-FX_INT32 CFX_Matrix::TransformDistance(FX_INT32 dx, FX_INT32 dy) const
-{
- FX_FLOAT fx = a * dx + c * dy, fy = b * dx + d * dy;
- return FXSYS_round(FXSYS_sqrt(fx * fx + fy * fy));
-}
-FX_FLOAT CFX_Matrix::TransformDistance(FX_FLOAT distance) const
-{
- return distance * (GetXUnit() + GetYUnit()) / 2;
-}
-void CFX_Matrix::TransformVector(CFX_VectorF &v) const
-{
- FX_FLOAT fx = a * v.x + c * v.y;
- FX_FLOAT fy = b * v.x + d * v.y;
- v.x = fx, v.y = fy;
-}
-void CFX_Matrix::TransformVector(CFX_Vector &v) const
-{
- FX_FLOAT fx = a * v.x + c * v.y;
- FX_FLOAT fy = b * v.x + d * v.y;
- v.x = FXSYS_round(fx);
- v.y = FXSYS_round(fy);
-}
-void CFX_Matrix::TransformPoints(CFX_Point *points, FX_INT32 iCount) const
-{
- FXSYS_assert(iCount > 0);
- FX_FLOAT fx, fy;
- for (FX_INT32 i = 0; i < iCount; i ++) {
- fx = a * points->x + c * points->y + e;
- fy = b * points->x + d * points->y + f;
- points->x = FXSYS_round(fx);
- points->y = FXSYS_round(fy);
- points ++;
- }
-}
-void CFX_Matrix::TransformPoints(CFX_PointF *points, FX_INT32 iCount) const
-{
- FXSYS_assert(iCount > 0);
- FX_FLOAT fx, fy;
- for (FX_INT32 i = 0; i < iCount; i ++) {
- fx = a * points->x + c * points->y + e;
- fy = b * points->x + d * points->y + f;
- points->x = fx, points->y = fy;
- points ++;
- }
-}
-void CFX_Matrix::TransformPoint(FX_FLOAT &x, FX_FLOAT &y) const
-{
- FX_FLOAT fx = a * x + c * y + e;
- FX_FLOAT fy = b * x + d * y + f;
- x = fx, y = fy;
-}
-void CFX_Matrix::TransformPoint(FX_INT32 &x, FX_INT32 &y) const
-{
- FX_FLOAT fx = a * x + c * y + e;
- FX_FLOAT fy = b * x + d * y + f;
- x = FXSYS_round(fx);
- y = FXSYS_round(fy);
-}
-void CFX_Matrix::TransformRect(CFX_RectF &rect) const
-{
- FX_FLOAT right = rect.right(), bottom = rect.bottom();
- TransformRect(rect.left, right, bottom, rect.top);
- rect.width = right - rect.left;
- rect.height = bottom - rect.top;
-}
-void CFX_Matrix::TransformRect(CFX_Rect &rect) const
-{
- FX_FLOAT left = (FX_FLOAT)rect.left;
- FX_FLOAT top = (FX_FLOAT)rect.bottom();
- FX_FLOAT right = (FX_FLOAT)rect.right();
- FX_FLOAT bottom = (FX_FLOAT)rect.top;
- TransformRect(left, right, top, bottom);
- rect.left = FXSYS_round(left);
- rect.top = FXSYS_round(bottom);
- rect.width = FXSYS_round(right - left);
- rect.height = FXSYS_round(top - bottom);
-}
-void CFX_Matrix::TransformRect(FX_FLOAT& left, FX_FLOAT& right, FX_FLOAT& top, FX_FLOAT& bottom) const
-{
- FX_FLOAT x[4], y[4];
- x[0] = left;
- y[0] = top;
- x[1] = left;
- y[1] = bottom;
- x[2] = right;
- y[2] = top;
- x[3] = right;
- y[3] = bottom;
- int i;
- for (i = 0; i < 4; i ++) {
- Transform(x[i], y[i], x[i], y[i]);
- }
- right = left = x[0];
- top = bottom = y[0];
- for (i = 1; i < 4; i ++) {
- if (right < x[i]) {
- right = x[i];
- }
- if (left > x[i]) {
- left = x[i];
- }
- if (top < y[i]) {
- top = y[i];
- }
- if (bottom > y[i]) {
- bottom = y[i];
- }
- }
-}
+// 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
+
+#include "../../include/fxcrt/fx_ext.h"
+void FX_RECT::Normalize()
+{
+ if (left > right) {
+ int temp = left;
+ left = right;
+ right = temp;
+ }
+ if (top > bottom) {
+ int temp = top;
+ top = bottom;
+ bottom = temp;
+ }
+}
+void FX_RECT::Intersect(const FX_RECT& src)
+{
+ FX_RECT src_n = src;
+ src_n.Normalize();
+ Normalize();
+ left = left > src_n.left ? left : src_n.left;
+ top = top > src_n.top ? top : src_n.top;
+ right = right < src_n.right ? right : src_n.right;
+ bottom = bottom < src_n.bottom ? bottom : src_n.bottom;
+ if (left > right || top > bottom) {
+ left = top = right = bottom = 0;
+ }
+}
+void FX_RECT::Union(const FX_RECT& other_rect)
+{
+ Normalize();
+ FX_RECT other = other_rect;
+ other.Normalize();
+ left = left < other.left ? left : other.left;
+ right = right > other.right ? right : other.right;
+ bottom = bottom > other.bottom ? bottom : other.bottom;
+ top = top < other.top ? top : other.top;
+}
+FX_BOOL GetIntersection(FX_FLOAT low1, FX_FLOAT high1, FX_FLOAT low2, FX_FLOAT high2,
+ FX_FLOAT& interlow, FX_FLOAT& interhigh)
+{
+ if (low1 >= high2 || low2 >= high1) {
+ return FALSE;
+ }
+ interlow = low1 > low2 ? low1 : low2;
+ interhigh = high1 > high2 ? high2 : high1;
+ return TRUE;
+}
+extern "C" int FXSYS_round(FX_FLOAT d)
+{
+ int iRet = 0;
+ if (d >= 0.0f) {
+ iRet = (int)(d + 0.5f);
+ if (iRet >= 0) {
+ return iRet;
+ }
+ return -iRet;
+ }
+ return (int)(d - 0.5f);
+}
+CFX_FloatRect::CFX_FloatRect(const FX_RECT& rect)
+{
+ left = (FX_FLOAT)(rect.left);
+ right = (FX_FLOAT)(rect.right);
+ bottom = (FX_FLOAT)(rect.top);
+ top = (FX_FLOAT)(rect.bottom);
+}
+void CFX_FloatRect::Normalize()
+{
+ FX_FLOAT temp;
+ if (left > right) {
+ temp = left;
+ left = right;
+ right = temp;
+ }
+ if (bottom > top) {
+ temp = top;
+ top = bottom;
+ bottom = temp;
+ }
+}
+void CFX_FloatRect::Intersect(const CFX_FloatRect& other_rect)
+{
+ Normalize();
+ CFX_FloatRect other = other_rect;
+ other.Normalize();
+ left = left > other.left ? left : other.left;
+ right = right < other.right ? right : other.right;
+ bottom = bottom > other.bottom ? bottom : other.bottom;
+ top = top < other.top ? top : other.top;
+ if (left > right || bottom > top) {
+ left = right = bottom = top = 0;
+ }
+}
+void CFX_FloatRect::Union(const CFX_FloatRect& other_rect)
+{
+ Normalize();
+ CFX_FloatRect other = other_rect;
+ other.Normalize();
+ left = left < other.left ? left : other.left;
+ right = right > other.right ? right : other.right;
+ bottom = bottom < other.bottom ? bottom : other.bottom;
+ top = top > other.top ? top : other.top;
+}
+void CFX_FloatRect::Transform(const CFX_Matrix* pMatrix)
+{
+ pMatrix->TransformRect(left, right, top, bottom);
+}
+int CFX_FloatRect::Substract4(CFX_FloatRect& s, CFX_FloatRect* pRects)
+{
+ Normalize();
+ s.Normalize();
+ int nRects = 0;
+ CFX_FloatRect rects[4];
+ if (left < s.left) {
+ rects[nRects].left = left;
+ rects[nRects].right = s.left;
+ rects[nRects].bottom = bottom;
+ rects[nRects].top = top;
+ nRects ++;
+ }
+ if (s.left < right && s.top < top) {
+ rects[nRects].left = s.left;
+ rects[nRects].right = right;
+ rects[nRects].bottom = s.top;
+ rects[nRects].top = top;
+ nRects ++;
+ }
+ if (s.top > bottom && s.right < right) {
+ rects[nRects].left = s.right;
+ rects[nRects].right = right;
+ rects[nRects].bottom = bottom;
+ rects[nRects].top = s.top;
+ nRects ++;
+ }
+ if (s.bottom > bottom) {
+ rects[nRects].left = s.left;
+ rects[nRects].right = s.right;
+ rects[nRects].bottom = bottom;
+ rects[nRects].top = s.bottom;
+ nRects ++;
+ }
+ if (nRects == 0) {
+ return 0;
+ }
+ for (int i = 0; i < nRects; i ++) {
+ pRects[i] = rects[i];
+ pRects[i].Intersect(*this);
+ }
+ return nRects;
+}
+FX_RECT CFX_FloatRect::GetOutterRect() const
+{
+ CFX_FloatRect rect1 = *this;
+ FX_RECT rect;
+ rect.left = (int)FXSYS_floor(rect1.left);
+ rect.right = (int)FXSYS_ceil(rect1.right);
+ rect.top = (int)FXSYS_floor(rect1.bottom);
+ rect.bottom = (int)FXSYS_ceil(rect1.top);
+ rect.Normalize();
+ return rect;
+}
+FX_RECT CFX_FloatRect::GetInnerRect() const
+{
+ CFX_FloatRect rect1 = *this;
+ FX_RECT rect;
+ rect.left = (int)FXSYS_ceil(rect1.left);
+ rect.right = (int)FXSYS_floor(rect1.right);
+ rect.top = (int)FXSYS_ceil(rect1.bottom);
+ rect.bottom = (int)FXSYS_floor(rect1.top);
+ rect.Normalize();
+ return rect;
+}
+static void _MatchFloatRange(FX_FLOAT f1, FX_FLOAT f2, int& i1, int& i2)
+{
+ int length = (int)FXSYS_ceil(f2 - f1);
+ int i1_1 = (int)FXSYS_floor(f1);
+ int i1_2 = (int)FXSYS_ceil(f1);
+ FX_FLOAT error1 = f1 - i1_1 + (FX_FLOAT)FXSYS_fabs(f2 - i1_1 - length);
+ FX_FLOAT error2 = i1_2 - f1 + (FX_FLOAT)FXSYS_fabs(f2 - i1_2 - length);
+ i1 = (error1 > error2) ? i1_2 : i1_1;
+ i2 = i1 + length;
+}
+FX_RECT CFX_FloatRect::GetClosestRect() const
+{
+ CFX_FloatRect rect1 = *this;
+ FX_RECT rect;
+ _MatchFloatRange(rect1.left, rect1.right, rect.left, rect.right);
+ _MatchFloatRange(rect1.bottom, rect1.top, rect.top, rect.bottom);
+ rect.Normalize();
+ return rect;
+}
+FX_BOOL CFX_FloatRect::Contains(const CFX_FloatRect& other_rect) const
+{
+ CFX_FloatRect n1 = *this;
+ n1.Normalize();
+ CFX_FloatRect n2 = other_rect;
+ n2.Normalize();
+ if (n2.left >= n1.left && n2.right <= n1.right && n2.bottom >= n1.bottom && n2.top <= n1.top) {
+ return TRUE;
+ }
+ return FALSE;
+}
+FX_BOOL CFX_FloatRect::Contains(FX_FLOAT x, FX_FLOAT y) const
+{
+ CFX_FloatRect n1 = *this;
+ n1.Normalize();
+ return x <= n1.right && x >= n1.left && y <= n1.top && y >= n1.bottom;
+}
+void CFX_FloatRect::UpdateRect(FX_FLOAT x, FX_FLOAT y)
+{
+ if (left > x) {
+ left = x;
+ }
+ if (right < x) {
+ right = x;
+ }
+ if (bottom > y) {
+ bottom = y;
+ }
+ if (top < y) {
+ top = y;
+ }
+}
+CFX_FloatRect CFX_FloatRect::GetBBox(const CFX_FloatPoint* pPoints, int nPoints)
+{
+ if (nPoints == 0) {
+ return CFX_FloatRect();
+ }
+ FX_FLOAT min_x = pPoints->x, max_x = pPoints->x, min_y = pPoints->y, max_y = pPoints->y;
+ for (int i = 1; i < nPoints; i ++) {
+ if (min_x > pPoints[i].x) {
+ min_x = pPoints[i].x;
+ }
+ if (max_x < pPoints[i].x) {
+ max_x = pPoints[i].x;
+ }
+ if (min_y > pPoints[i].y) {
+ min_y = pPoints[i].y;
+ }
+ if (max_y < pPoints[i].y) {
+ max_y = pPoints[i].y;
+ }
+ }
+ return CFX_FloatRect(min_x, min_y, max_x, max_y);
+}
+void CFX_Matrix::Set(FX_FLOAT a, FX_FLOAT b, FX_FLOAT c, FX_FLOAT d, FX_FLOAT e, FX_FLOAT f)
+{
+ this->a = a;
+ this->b = b;
+ this->c = c;
+ this->d = d;
+ this->e = e;
+ this->f = f;
+}
+void CFX_Matrix::Set(const FX_FLOAT n[6])
+{
+ FXSYS_memcpy32((void*)this, &n, sizeof(CFX_Matrix));
+}
+void CFX_Matrix::SetReverse(const CFX_Matrix &m)
+{
+ FX_FLOAT i = m.a * m.d - m.b * m.c;
+ if (FXSYS_fabs(i) == 0) {
+ return;
+ }
+ FX_FLOAT j = -i;
+ a = m.d / i;
+ b = m.b / j;
+ c = m.c / j;
+ d = m.a / i;
+ e = (m.c * m.f - m.d * m.e) / i;
+ f = (m.a * m.f - m.b * m.e) / j;
+}
+static void FXCRT_Matrix_Concat(CFX_Matrix &m, const CFX_Matrix &m1, const CFX_Matrix &m2)
+{
+ FX_FLOAT aa = m1.a * m2.a + m1.b * m2.c;
+ FX_FLOAT bb = m1.a * m2.b + m1.b * m2.d;
+ FX_FLOAT cc = m1.c * m2.a + m1.d * m2.c;
+ FX_FLOAT dd = m1.c * m2.b + m1.d * m2.d;
+ FX_FLOAT ee = m1.e * m2.a + m1.f * m2.c + m2.e;
+ FX_FLOAT ff = m1.e * m2.b + m1.f * m2.d + m2.f;
+ m.a = aa, m.b = bb, m.c = cc, m.d = dd, m.e = ee, m.f = ff;
+}
+void CFX_Matrix::Concat(FX_FLOAT a, FX_FLOAT b, FX_FLOAT c, FX_FLOAT d, FX_FLOAT e, FX_FLOAT f, FX_BOOL bPrepended)
+{
+ CFX_Matrix m;
+ m.Set(a, b, c, d, e, f);
+ Concat(m, bPrepended);
+}
+void CFX_Matrix::Concat(const CFX_Matrix &m, FX_BOOL bPrepended)
+{
+ if (bPrepended) {
+ FXCRT_Matrix_Concat(*this, m, *this);
+ } else {
+ FXCRT_Matrix_Concat(*this, *this, m);
+ }
+}
+void CFX_Matrix::ConcatInverse(const CFX_Matrix& src, FX_BOOL bPrepended)
+{
+ CFX_Matrix m;
+ m.SetReverse(src);
+ Concat(m, bPrepended);
+}
+FX_BOOL CFX_Matrix::IsInvertible() const
+{
+ return FXSYS_fabs(a * d - b * c) >= 0.0001f;
+}
+FX_BOOL CFX_Matrix::Is90Rotated() const
+{
+ return FXSYS_fabs(a * 1000) < FXSYS_fabs(b) && FXSYS_fabs(d * 1000) < FXSYS_fabs(c);
+}
+FX_BOOL CFX_Matrix::IsScaled() const
+{
+ return FXSYS_fabs(b * 1000) < FXSYS_fabs(a) && FXSYS_fabs(c * 1000) < FXSYS_fabs(d);
+}
+void CFX_Matrix::Translate(FX_FLOAT x, FX_FLOAT y, FX_BOOL bPrepended)
+{
+ if (bPrepended) {
+ e += x * a + y * c;
+ f += y * d + x * b;
+ } else {
+ e += x, f += y;
+ }
+}
+void CFX_Matrix::Scale(FX_FLOAT sx, FX_FLOAT sy, FX_BOOL bPrepended)
+{
+ a *= sx, d *= sy;
+ if (bPrepended) {
+ b *= sx;
+ c *= sy;
+ } else {
+ b *= sy;
+ c *= sx;
+ e *= sx;
+ f *= sy;
+ }
+}
+void CFX_Matrix::Rotate(FX_FLOAT fRadian, FX_BOOL bPrepended)
+{
+ FX_FLOAT cosValue = FXSYS_cos(fRadian);
+ FX_FLOAT sinValue = FXSYS_sin(fRadian);
+ CFX_Matrix m;
+ m.Set(cosValue, sinValue, -sinValue, cosValue, 0, 0);
+ if (bPrepended) {
+ FXCRT_Matrix_Concat(*this, m, *this);
+ } else {
+ FXCRT_Matrix_Concat(*this, *this, m);
+ }
+}
+void CFX_Matrix::RotateAt(FX_FLOAT fRadian, FX_FLOAT dx, FX_FLOAT dy, FX_BOOL bPrepended)
+{
+ Translate(dx, dy, bPrepended);
+ Rotate(fRadian, bPrepended);
+ Translate(-dx, -dy, bPrepended);
+}
+void CFX_Matrix::Shear(FX_FLOAT fAlphaRadian, FX_FLOAT fBetaRadian, FX_BOOL bPrepended)
+{
+ CFX_Matrix m;
+ m.Set(1, FXSYS_tan(fAlphaRadian), FXSYS_tan(fBetaRadian), 1, 0, 0);
+ if (bPrepended) {
+ FXCRT_Matrix_Concat(*this, m, *this);
+ } else {
+ FXCRT_Matrix_Concat(*this, *this, m);
+ }
+}
+void CFX_Matrix::MatchRect(const CFX_FloatRect& dest, const CFX_FloatRect& src)
+{
+ FX_FLOAT fDiff = src.left - src.right;
+ a = FXSYS_fabs(fDiff) < 0.001f ? 1 : (dest.left - dest.right) / fDiff;
+ fDiff = src.bottom - src.top;
+ d = FXSYS_fabs(fDiff) < 0.001f ? 1 : (dest.bottom - dest.top) / fDiff;
+ e = dest.left - src.left * a;
+ f = dest.bottom - src.bottom * d;
+ b = 0;
+ c = 0;
+}
+FX_FLOAT CFX_Matrix::GetXUnit() const
+{
+ if (b == 0) {
+ return (a > 0 ? a : -a);
+ }
+ if (a == 0) {
+ return (b > 0 ? b : -b);
+ }
+ return FXSYS_sqrt(a * a + b * b);
+}
+FX_FLOAT CFX_Matrix::GetYUnit() const
+{
+ if (c == 0) {
+ return (d > 0 ? d : -d);
+ }
+ if (d == 0) {
+ return (c > 0 ? c : -c);
+ }
+ return FXSYS_sqrt(c * c + d * d);
+}
+void CFX_Matrix::GetUnitRect(CFX_RectF &rect) const
+{
+ rect.left = rect.top = 0;
+ rect.width = rect.height = 1;
+ TransformRect(rect);
+}
+CFX_FloatRect CFX_Matrix::GetUnitRect() const
+{
+ CFX_FloatRect rect(0, 0, 1, 1);
+ rect.Transform((const CFX_Matrix*)this);
+ return rect;
+}
+FX_FLOAT CFX_Matrix::GetUnitArea() const
+{
+ FX_FLOAT A = FXSYS_sqrt(a * a + b * b);
+ FX_FLOAT B = FXSYS_sqrt(c * c + d * d);
+ FX_FLOAT ac = a + c, bd = b + d;
+ FX_FLOAT C = FXSYS_sqrt(ac * ac + bd * bd);
+ FX_FLOAT P = (A + B + C ) / 2;
+ return FXSYS_sqrt(P * (P - A) * (P - B) * (P - C)) * 2;
+}
+FX_FLOAT CFX_Matrix::TransformXDistance(FX_FLOAT dx) const
+{
+ FX_FLOAT fx = a * dx, fy = b * dx;
+ return FXSYS_sqrt(fx * fx + fy * fy);
+}
+FX_INT32 CFX_Matrix::TransformXDistance(FX_INT32 dx) const
+{
+ FX_FLOAT fx = a * dx, fy = b * dx;
+ return FXSYS_round(FXSYS_sqrt(fx * fx + fy * fy));
+}
+FX_FLOAT CFX_Matrix::TransformYDistance(FX_FLOAT dy) const
+{
+ FX_FLOAT fx = c * dy, fy = d * dy;
+ return FXSYS_sqrt(fx * fx + fy * fy);
+}
+FX_INT32 CFX_Matrix::TransformYDistance(FX_INT32 dy) const
+{
+ FX_FLOAT fx = c * dy, fy = d * dy;
+ return FXSYS_round(FXSYS_sqrt(fx * fx + fy * fy));
+}
+FX_FLOAT CFX_Matrix::TransformDistance(FX_FLOAT dx, FX_FLOAT dy) const
+{
+ FX_FLOAT fx = a * dx + c * dy, fy = b * dx + d * dy;
+ return FXSYS_sqrt(fx * fx + fy * fy);
+}
+FX_INT32 CFX_Matrix::TransformDistance(FX_INT32 dx, FX_INT32 dy) const
+{
+ FX_FLOAT fx = a * dx + c * dy, fy = b * dx + d * dy;
+ return FXSYS_round(FXSYS_sqrt(fx * fx + fy * fy));
+}
+FX_FLOAT CFX_Matrix::TransformDistance(FX_FLOAT distance) const
+{
+ return distance * (GetXUnit() + GetYUnit()) / 2;
+}
+void CFX_Matrix::TransformVector(CFX_VectorF &v) const
+{
+ FX_FLOAT fx = a * v.x + c * v.y;
+ FX_FLOAT fy = b * v.x + d * v.y;
+ v.x = fx, v.y = fy;
+}
+void CFX_Matrix::TransformVector(CFX_Vector &v) const
+{
+ FX_FLOAT fx = a * v.x + c * v.y;
+ FX_FLOAT fy = b * v.x + d * v.y;
+ v.x = FXSYS_round(fx);
+ v.y = FXSYS_round(fy);
+}
+void CFX_Matrix::TransformPoints(CFX_Point *points, FX_INT32 iCount) const
+{
+ FXSYS_assert(iCount > 0);
+ FX_FLOAT fx, fy;
+ for (FX_INT32 i = 0; i < iCount; i ++) {
+ fx = a * points->x + c * points->y + e;
+ fy = b * points->x + d * points->y + f;
+ points->x = FXSYS_round(fx);
+ points->y = FXSYS_round(fy);
+ points ++;
+ }
+}
+void CFX_Matrix::TransformPoints(CFX_PointF *points, FX_INT32 iCount) const
+{
+ FXSYS_assert(iCount > 0);
+ FX_FLOAT fx, fy;
+ for (FX_INT32 i = 0; i < iCount; i ++) {
+ fx = a * points->x + c * points->y + e;
+ fy = b * points->x + d * points->y + f;
+ points->x = fx, points->y = fy;
+ points ++;
+ }
+}
+void CFX_Matrix::TransformPoint(FX_FLOAT &x, FX_FLOAT &y) const
+{
+ FX_FLOAT fx = a * x + c * y + e;
+ FX_FLOAT fy = b * x + d * y + f;
+ x = fx, y = fy;
+}
+void CFX_Matrix::TransformPoint(FX_INT32 &x, FX_INT32 &y) const
+{
+ FX_FLOAT fx = a * x + c * y + e;
+ FX_FLOAT fy = b * x + d * y + f;
+ x = FXSYS_round(fx);
+ y = FXSYS_round(fy);
+}
+void CFX_Matrix::TransformRect(CFX_RectF &rect) const
+{
+ FX_FLOAT right = rect.right(), bottom = rect.bottom();
+ TransformRect(rect.left, right, bottom, rect.top);
+ rect.width = right - rect.left;
+ rect.height = bottom - rect.top;
+}
+void CFX_Matrix::TransformRect(CFX_Rect &rect) const
+{
+ FX_FLOAT left = (FX_FLOAT)rect.left;
+ FX_FLOAT top = (FX_FLOAT)rect.bottom();
+ FX_FLOAT right = (FX_FLOAT)rect.right();
+ FX_FLOAT bottom = (FX_FLOAT)rect.top;
+ TransformRect(left, right, top, bottom);
+ rect.left = FXSYS_round(left);
+ rect.top = FXSYS_round(bottom);
+ rect.width = FXSYS_round(right - left);
+ rect.height = FXSYS_round(top - bottom);
+}
+void CFX_Matrix::TransformRect(FX_FLOAT& left, FX_FLOAT& right, FX_FLOAT& top, FX_FLOAT& bottom) const
+{
+ FX_FLOAT x[4], y[4];
+ x[0] = left;
+ y[0] = top;
+ x[1] = left;
+ y[1] = bottom;
+ x[2] = right;
+ y[2] = top;
+ x[3] = right;
+ y[3] = bottom;
+ int i;
+ for (i = 0; i < 4; i ++) {
+ Transform(x[i], y[i], x[i], y[i]);
+ }
+ right = left = x[0];
+ top = bottom = y[0];
+ for (i = 1; i < 4; i ++) {
+ if (right < x[i]) {
+ right = x[i];
+ }
+ if (left > x[i]) {
+ left = x[i];
+ }
+ if (top < y[i]) {
+ top = y[i];
+ }
+ if (bottom > y[i]) {
+ bottom = y[i];
+ }
+ }
+}
diff --git a/core/src/fxcrt/fx_basic_gcc.cpp b/core/src/fxcrt/fx_basic_gcc.cpp
index 20a1e58925..7f5bbade66 100644
--- a/core/src/fxcrt/fx_basic_gcc.cpp
+++ b/core/src/fxcrt/fx_basic_gcc.cpp
@@ -1,232 +1,232 @@
-// 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
-
-#include "../../include/fxcrt/fx_ext.h"
-template <class T, class STR_T>
-T FXSYS_StrToInt(STR_T str)
-{
- FX_BOOL neg = FALSE;
- if (str == NULL) {
- return 0;
- }
- if (*str == '-') {
- neg = TRUE;
- str ++;
- }
- T num = 0;
- while (*str) {
- if ((*str) < '0' || (*str) > '9') {
- break;
- }
- num = num * 10 + (*str) - '0';
- str ++;
- }
- return neg ? -num : num;
-}
-template <typename T, typename STR_T>
-STR_T FXSYS_IntToStr(T value, STR_T string, int radix)
-{
- int i = 0;
- if (value < 0) {
- string[i++] = '-';
- value = -value;
- } else if (value == 0) {
- string[0] = '0';
- string[1] = 0;
- return string;
- }
- int digits = 1;
- T order = value / 10;
- while(order > 0) {
- digits++;
- order = order / 10;
- }
- for (int d = digits - 1; d > -1; d--) {
- string[d + i] = "0123456789abcdef"[value % 10];
- value /= 10;
- }
- string[digits + i] = 0;
- return string;
-}
-#ifdef __cplusplus
-extern "C" {
-#endif
-FX_INT32 FXSYS_atoi(FX_LPCSTR str)
-{
- return FXSYS_StrToInt<FX_INT32, FX_LPCSTR>(str);
-}
-FX_INT32 FXSYS_wtoi(FX_LPCWSTR str)
-{
- return FXSYS_StrToInt<FX_INT32, FX_LPCWSTR>(str);
-}
-FX_INT64 FXSYS_atoi64(FX_LPCSTR str)
-{
- return FXSYS_StrToInt<FX_INT64, FX_LPCSTR>(str);
-}
-FX_INT64 FXSYS_wtoi64(FX_LPCWSTR str)
-{
- return FXSYS_StrToInt<FX_INT64, FX_LPCWSTR>(str);
-}
-FX_LPCSTR FXSYS_i64toa(FX_INT64 value, FX_LPSTR str, int radix)
-{
- return FXSYS_IntToStr<FX_INT64, FX_LPSTR>(value, str, radix);
-}
-FX_LPCWSTR FXSYS_i64tow(FX_INT64 value, FX_LPWSTR str, int radix)
-{
- return FXSYS_IntToStr<FX_INT64, FX_LPWSTR>(value, str, radix);
-}
-#ifdef __cplusplus
-}
-#endif
-#if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_
-#ifdef __cplusplus
-extern "C" {
-#endif
-int FXSYS_GetACP()
-{
- return 0;
-}
-FX_DWORD FXSYS_GetFullPathName(FX_LPCSTR filename, FX_DWORD buflen, FX_LPSTR buf, FX_LPSTR* filepart)
-{
- int srclen = FXSYS_strlen(filename);
- if (buf == NULL || (int)buflen < srclen + 1) {
- return srclen + 1;
- }
- FXSYS_strcpy(buf, filename);
- return srclen;
-}
-FX_DWORD FXSYS_GetModuleFileName(FX_LPVOID hModule, char* buf, FX_DWORD bufsize)
-{
- return (FX_DWORD) - 1;
-}
-#ifdef __cplusplus
-}
-#endif
-#endif
-#if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_
-#ifdef __cplusplus
-extern "C" {
-#endif
-FXSYS_FILE* FXSYS_wfopen(FX_LPCWSTR filename, FX_LPCWSTR mode)
-{
- return FXSYS_fopen(CFX_ByteString::FromUnicode(filename), CFX_ByteString::FromUnicode(mode));
-}
-char* FXSYS_strlwr(char* str)
-{
- if (str == NULL) {
- return NULL;
- }
- char* s = str;
- while (*str) {
- *str = FXSYS_tolower(*str);
- str ++;
- }
- return s;
-}
-char* FXSYS_strupr(char* str)
-{
- if (str == NULL) {
- return NULL;
- }
- char* s = str;
- while (*str) {
- *str = FXSYS_toupper(*str);
- str ++;
- }
- return s;
-}
-FX_WCHAR* FXSYS_wcslwr(FX_WCHAR* str)
-{
- if (str == NULL) {
- return NULL;
- }
- FX_WCHAR* s = str;
- while (*str) {
- *str = FXSYS_tolower(*str);
- str ++;
- }
- return s;
-}
-FX_WCHAR* FXSYS_wcsupr(FX_WCHAR* str)
-{
- if (str == NULL) {
- return NULL;
- }
- FX_WCHAR* s = str;
- while (*str) {
- *str = FXSYS_toupper(*str);
- str ++;
- }
- return s;
-}
-int FXSYS_stricmp(const char*dst, const char*src)
-{
- int f, l;
- do {
- if ( ((f = (unsigned char)(*(dst++))) >= 'A') && (f <= 'Z') ) {
- f -= ('A' - 'a');
- }
- if ( ((l = (unsigned char)(*(src++))) >= 'A') && (l <= 'Z') ) {
- l -= ('A' - 'a');
- }
- } while ( f && (f == l) );
- return(f - l);
-}
-int FXSYS_wcsicmp(const FX_WCHAR *dst, const FX_WCHAR *src)
-{
- FX_WCHAR f, l;
- do {
- if ( ((f = (FX_WCHAR)(*(dst++))) >= 'A') && (f <= 'Z') ) {
- f -= ('A' - 'a');
- }
- if ( ((l = (FX_WCHAR)(*(src++))) >= 'A') && (l <= 'Z') ) {
- l -= ('A' - 'a');
- }
- } while ( f && (f == l) );
- return(f - l);
-}
-char* FXSYS_itoa(int value, char* string, int radix)
-{
- return FXSYS_IntToStr<FX_INT32, FX_LPSTR>(value, string, radix);
-}
-#ifdef __cplusplus
-}
-#endif
-#endif
-#if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_
-#ifdef __cplusplus
-extern "C" {
-#endif
-int FXSYS_WideCharToMultiByte(FX_DWORD codepage, FX_DWORD dwFlags, FX_LPCWSTR wstr, int wlen,
- FX_LPSTR buf, int buflen, FX_LPCSTR default_str, FX_BOOL* pUseDefault)
-{
- int len = 0;
- for (int i = 0; i < wlen; i ++) {
- if (wstr[i] < 0x100) {
- if (buf && len < buflen) {
- buf[len] = (FX_CHAR)wstr[i];
- }
- len ++;
- }
- }
- return len;
-}
-int FXSYS_MultiByteToWideChar(FX_DWORD codepage, FX_DWORD dwFlags, FX_LPCSTR bstr, int blen,
- FX_LPWSTR buf, int buflen)
-{
- int wlen = 0;
- for (int i = 0; i < blen; i ++) {
- if (buf && wlen < buflen) {
- buf[wlen] = bstr[i];
- }
- wlen ++;
- }
- return wlen;
-}
-#ifdef __cplusplus
-}
-#endif
-#endif
+// 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
+
+#include "../../include/fxcrt/fx_ext.h"
+template <class T, class STR_T>
+T FXSYS_StrToInt(STR_T str)
+{
+ FX_BOOL neg = FALSE;
+ if (str == NULL) {
+ return 0;
+ }
+ if (*str == '-') {
+ neg = TRUE;
+ str ++;
+ }
+ T num = 0;
+ while (*str) {
+ if ((*str) < '0' || (*str) > '9') {
+ break;
+ }
+ num = num * 10 + (*str) - '0';
+ str ++;
+ }
+ return neg ? -num : num;
+}
+template <typename T, typename STR_T>
+STR_T FXSYS_IntToStr(T value, STR_T string, int radix)
+{
+ int i = 0;
+ if (value < 0) {
+ string[i++] = '-';
+ value = -value;
+ } else if (value == 0) {
+ string[0] = '0';
+ string[1] = 0;
+ return string;
+ }
+ int digits = 1;
+ T order = value / 10;
+ while(order > 0) {
+ digits++;
+ order = order / 10;
+ }
+ for (int d = digits - 1; d > -1; d--) {
+ string[d + i] = "0123456789abcdef"[value % 10];
+ value /= 10;
+ }
+ string[digits + i] = 0;
+ return string;
+}
+#ifdef __cplusplus
+extern "C" {
+#endif
+FX_INT32 FXSYS_atoi(FX_LPCSTR str)
+{
+ return FXSYS_StrToInt<FX_INT32, FX_LPCSTR>(str);
+}
+FX_INT32 FXSYS_wtoi(FX_LPCWSTR str)
+{
+ return FXSYS_StrToInt<FX_INT32, FX_LPCWSTR>(str);
+}
+FX_INT64 FXSYS_atoi64(FX_LPCSTR str)
+{
+ return FXSYS_StrToInt<FX_INT64, FX_LPCSTR>(str);
+}
+FX_INT64 FXSYS_wtoi64(FX_LPCWSTR str)
+{
+ return FXSYS_StrToInt<FX_INT64, FX_LPCWSTR>(str);
+}
+FX_LPCSTR FXSYS_i64toa(FX_INT64 value, FX_LPSTR str, int radix)
+{
+ return FXSYS_IntToStr<FX_INT64, FX_LPSTR>(value, str, radix);
+}
+FX_LPCWSTR FXSYS_i64tow(FX_INT64 value, FX_LPWSTR str, int radix)
+{
+ return FXSYS_IntToStr<FX_INT64, FX_LPWSTR>(value, str, radix);
+}
+#ifdef __cplusplus
+}
+#endif
+#if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_
+#ifdef __cplusplus
+extern "C" {
+#endif
+int FXSYS_GetACP()
+{
+ return 0;
+}
+FX_DWORD FXSYS_GetFullPathName(FX_LPCSTR filename, FX_DWORD buflen, FX_LPSTR buf, FX_LPSTR* filepart)
+{
+ int srclen = FXSYS_strlen(filename);
+ if (buf == NULL || (int)buflen < srclen + 1) {
+ return srclen + 1;
+ }
+ FXSYS_strcpy(buf, filename);
+ return srclen;
+}
+FX_DWORD FXSYS_GetModuleFileName(FX_LPVOID hModule, char* buf, FX_DWORD bufsize)
+{
+ return (FX_DWORD) - 1;
+}
+#ifdef __cplusplus
+}
+#endif
+#endif
+#if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_
+#ifdef __cplusplus
+extern "C" {
+#endif
+FXSYS_FILE* FXSYS_wfopen(FX_LPCWSTR filename, FX_LPCWSTR mode)
+{
+ return FXSYS_fopen(CFX_ByteString::FromUnicode(filename), CFX_ByteString::FromUnicode(mode));
+}
+char* FXSYS_strlwr(char* str)
+{
+ if (str == NULL) {
+ return NULL;
+ }
+ char* s = str;
+ while (*str) {
+ *str = FXSYS_tolower(*str);
+ str ++;
+ }
+ return s;
+}
+char* FXSYS_strupr(char* str)
+{
+ if (str == NULL) {
+ return NULL;
+ }
+ char* s = str;
+ while (*str) {
+ *str = FXSYS_toupper(*str);
+ str ++;
+ }
+ return s;
+}
+FX_WCHAR* FXSYS_wcslwr(FX_WCHAR* str)
+{
+ if (str == NULL) {
+ return NULL;
+ }
+ FX_WCHAR* s = str;
+ while (*str) {
+ *str = FXSYS_tolower(*str);
+ str ++;
+ }
+ return s;
+}
+FX_WCHAR* FXSYS_wcsupr(FX_WCHAR* str)
+{
+ if (str == NULL) {
+ return NULL;
+ }
+ FX_WCHAR* s = str;
+ while (*str) {
+ *str = FXSYS_toupper(*str);
+ str ++;
+ }
+ return s;
+}
+int FXSYS_stricmp(const char*dst, const char*src)
+{
+ int f, l;
+ do {
+ if ( ((f = (unsigned char)(*(dst++))) >= 'A') && (f <= 'Z') ) {
+ f -= ('A' - 'a');
+ }
+ if ( ((l = (unsigned char)(*(src++))) >= 'A') && (l <= 'Z') ) {
+ l -= ('A' - 'a');
+ }
+ } while ( f && (f == l) );
+ return(f - l);
+}
+int FXSYS_wcsicmp(const FX_WCHAR *dst, const FX_WCHAR *src)
+{
+ FX_WCHAR f, l;
+ do {
+ if ( ((f = (FX_WCHAR)(*(dst++))) >= 'A') && (f <= 'Z') ) {
+ f -= ('A' - 'a');
+ }
+ if ( ((l = (FX_WCHAR)(*(src++))) >= 'A') && (l <= 'Z') ) {
+ l -= ('A' - 'a');
+ }
+ } while ( f && (f == l) );
+ return(f - l);
+}
+char* FXSYS_itoa(int value, char* string, int radix)
+{
+ return FXSYS_IntToStr<FX_INT32, FX_LPSTR>(value, string, radix);
+}
+#ifdef __cplusplus
+}
+#endif
+#endif
+#if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_
+#ifdef __cplusplus
+extern "C" {
+#endif
+int FXSYS_WideCharToMultiByte(FX_DWORD codepage, FX_DWORD dwFlags, FX_LPCWSTR wstr, int wlen,
+ FX_LPSTR buf, int buflen, FX_LPCSTR default_str, FX_BOOL* pUseDefault)
+{
+ int len = 0;
+ for (int i = 0; i < wlen; i ++) {
+ if (wstr[i] < 0x100) {
+ if (buf && len < buflen) {
+ buf[len] = (FX_CHAR)wstr[i];
+ }
+ len ++;
+ }
+ }
+ return len;
+}
+int FXSYS_MultiByteToWideChar(FX_DWORD codepage, FX_DWORD dwFlags, FX_LPCSTR bstr, int blen,
+ FX_LPWSTR buf, int buflen)
+{
+ int wlen = 0;
+ for (int i = 0; i < blen; i ++) {
+ if (buf && wlen < buflen) {
+ buf[wlen] = bstr[i];
+ }
+ wlen ++;
+ }
+ return wlen;
+}
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/core/src/fxcrt/fx_basic_list.cpp b/core/src/fxcrt/fx_basic_list.cpp
index 92b3d2c0c4..bf7091268b 100644
--- a/core/src/fxcrt/fx_basic_list.cpp
+++ b/core/src/fxcrt/fx_basic_list.cpp
@@ -1,141 +1,141 @@
-// 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
-
-#include "../../include/fxcrt/fx_basic.h"
-#include "plex.h"
-CFX_PtrList::CFX_PtrList(int nBlockSize, IFX_Allocator* pAllocator)
- : m_pAllocator(pAllocator)
- , m_pNodeHead(NULL)
- , m_pNodeTail(NULL)
- , m_nCount(0)
- , m_pNodeFree(NULL)
- , m_pBlocks(NULL)
- , m_nBlockSize(nBlockSize)
-{
-}
-FX_POSITION CFX_PtrList::AddTail(void* newElement)
-{
- CNode* pNewNode = NewNode(m_pNodeTail, NULL);
- pNewNode->data = newElement;
- if (m_pNodeTail != NULL) {
- m_pNodeTail->pNext = pNewNode;
- } else {
- m_pNodeHead = pNewNode;
- }
- m_pNodeTail = pNewNode;
- return (FX_POSITION) pNewNode;
-}
-FX_POSITION CFX_PtrList::AddHead(void* newElement)
-{
- CNode* pNewNode = NewNode(NULL, m_pNodeHead);
- pNewNode->data = newElement;
- if (m_pNodeHead != NULL) {
- m_pNodeHead->pPrev = pNewNode;
- } else {
- m_pNodeTail = pNewNode;
- }
- m_pNodeHead = pNewNode;
- return (FX_POSITION) pNewNode;
-}
-FX_POSITION CFX_PtrList::InsertAfter(FX_POSITION position, void* newElement)
-{
- if (position == NULL) {
- return AddTail(newElement);
- }
- CNode* pOldNode = (CNode*) position;
- CNode* pNewNode = NewNode(pOldNode, pOldNode->pNext);
- pNewNode->data = newElement;
- if (pOldNode->pNext != NULL) {
- pOldNode->pNext->pPrev = pNewNode;
- } else {
- m_pNodeTail = pNewNode;
- }
- pOldNode->pNext = pNewNode;
- return (FX_POSITION) pNewNode;
-}
-void CFX_PtrList::RemoveAt(FX_POSITION position)
-{
- CNode* pOldNode = (CNode*) position;
- if (pOldNode == m_pNodeHead) {
- m_pNodeHead = pOldNode->pNext;
- } else {
- pOldNode->pPrev->pNext = pOldNode->pNext;
- }
- if (pOldNode == m_pNodeTail) {
- m_pNodeTail = pOldNode->pPrev;
- } else {
- pOldNode->pNext->pPrev = pOldNode->pPrev;
- }
- FreeNode(pOldNode);
-}
-void CFX_PtrList::FreeNode(CFX_PtrList::CNode* pNode)
-{
- pNode->pNext = m_pNodeFree;
- m_pNodeFree = pNode;
- m_nCount--;
- if (m_nCount == 0) {
- RemoveAll();
- }
-}
-void CFX_PtrList::RemoveAll()
-{
- m_nCount = 0;
- m_pNodeHead = m_pNodeTail = m_pNodeFree = NULL;
- m_pBlocks->FreeDataChain(m_pAllocator);
- m_pBlocks = NULL;
-}
-CFX_PtrList::CNode*
-CFX_PtrList::NewNode(CFX_PtrList::CNode* pPrev, CFX_PtrList::CNode* pNext)
-{
- if (m_pNodeFree == NULL) {
- CFX_Plex* pNewBlock = CFX_Plex::Create(m_pAllocator, m_pBlocks, m_nBlockSize, sizeof(CNode));
- CNode* pNode = (CNode*)pNewBlock->data();
- pNode += m_nBlockSize - 1;
- for (int i = m_nBlockSize - 1; i >= 0; i--, pNode--) {
- pNode->pNext = m_pNodeFree;
- m_pNodeFree = pNode;
- }
- }
- ASSERT(m_pNodeFree != NULL);
- CFX_PtrList::CNode* pNode = m_pNodeFree;
- m_pNodeFree = m_pNodeFree->pNext;
- pNode->pPrev = pPrev;
- pNode->pNext = pNext;
- m_nCount++;
- ASSERT(m_nCount > 0);
- pNode->data = 0;
- return pNode;
-}
-CFX_PtrList::~CFX_PtrList()
-{
- RemoveAll();
- ASSERT(m_nCount == 0);
-}
-FX_POSITION CFX_PtrList::FindIndex(int nIndex) const
-{
- if (nIndex >= m_nCount || nIndex < 0) {
- return NULL;
- }
- CNode* pNode = m_pNodeHead;
- while (nIndex--) {
- pNode = pNode->pNext;
- }
- return (FX_POSITION) pNode;
-}
-FX_POSITION CFX_PtrList::Find(void* searchValue, FX_POSITION startAfter) const
-{
- CNode* pNode = (CNode*) startAfter;
- if (pNode == NULL) {
- pNode = m_pNodeHead;
- } else {
- pNode = pNode->pNext;
- }
- for (; pNode != NULL; pNode = pNode->pNext)
- if (pNode->data == searchValue) {
- return (FX_POSITION) pNode;
- }
- return NULL;
-}
+// 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
+
+#include "../../include/fxcrt/fx_basic.h"
+#include "plex.h"
+CFX_PtrList::CFX_PtrList(int nBlockSize, IFX_Allocator* pAllocator)
+ : m_pAllocator(pAllocator)
+ , m_pNodeHead(NULL)
+ , m_pNodeTail(NULL)
+ , m_nCount(0)
+ , m_pNodeFree(NULL)
+ , m_pBlocks(NULL)
+ , m_nBlockSize(nBlockSize)
+{
+}
+FX_POSITION CFX_PtrList::AddTail(void* newElement)
+{
+ CNode* pNewNode = NewNode(m_pNodeTail, NULL);
+ pNewNode->data = newElement;
+ if (m_pNodeTail != NULL) {
+ m_pNodeTail->pNext = pNewNode;
+ } else {
+ m_pNodeHead = pNewNode;
+ }
+ m_pNodeTail = pNewNode;
+ return (FX_POSITION) pNewNode;
+}
+FX_POSITION CFX_PtrList::AddHead(void* newElement)
+{
+ CNode* pNewNode = NewNode(NULL, m_pNodeHead);
+ pNewNode->data = newElement;
+ if (m_pNodeHead != NULL) {
+ m_pNodeHead->pPrev = pNewNode;
+ } else {
+ m_pNodeTail = pNewNode;
+ }
+ m_pNodeHead = pNewNode;
+ return (FX_POSITION) pNewNode;
+}
+FX_POSITION CFX_PtrList::InsertAfter(FX_POSITION position, void* newElement)
+{
+ if (position == NULL) {
+ return AddTail(newElement);
+ }
+ CNode* pOldNode = (CNode*) position;
+ CNode* pNewNode = NewNode(pOldNode, pOldNode->pNext);
+ pNewNode->data = newElement;
+ if (pOldNode->pNext != NULL) {
+ pOldNode->pNext->pPrev = pNewNode;
+ } else {
+ m_pNodeTail = pNewNode;
+ }
+ pOldNode->pNext = pNewNode;
+ return (FX_POSITION) pNewNode;
+}
+void CFX_PtrList::RemoveAt(FX_POSITION position)
+{
+ CNode* pOldNode = (CNode*) position;
+ if (pOldNode == m_pNodeHead) {
+ m_pNodeHead = pOldNode->pNext;
+ } else {
+ pOldNode->pPrev->pNext = pOldNode->pNext;
+ }
+ if (pOldNode == m_pNodeTail) {
+ m_pNodeTail = pOldNode->pPrev;
+ } else {
+ pOldNode->pNext->pPrev = pOldNode->pPrev;
+ }
+ FreeNode(pOldNode);
+}
+void CFX_PtrList::FreeNode(CFX_PtrList::CNode* pNode)
+{
+ pNode->pNext = m_pNodeFree;
+ m_pNodeFree = pNode;
+ m_nCount--;
+ if (m_nCount == 0) {
+ RemoveAll();
+ }
+}
+void CFX_PtrList::RemoveAll()
+{
+ m_nCount = 0;
+ m_pNodeHead = m_pNodeTail = m_pNodeFree = NULL;
+ m_pBlocks->FreeDataChain(m_pAllocator);
+ m_pBlocks = NULL;
+}
+CFX_PtrList::CNode*
+CFX_PtrList::NewNode(CFX_PtrList::CNode* pPrev, CFX_PtrList::CNode* pNext)
+{
+ if (m_pNodeFree == NULL) {
+ CFX_Plex* pNewBlock = CFX_Plex::Create(m_pAllocator, m_pBlocks, m_nBlockSize, sizeof(CNode));
+ CNode* pNode = (CNode*)pNewBlock->data();
+ pNode += m_nBlockSize - 1;
+ for (int i = m_nBlockSize - 1; i >= 0; i--, pNode--) {
+ pNode->pNext = m_pNodeFree;
+ m_pNodeFree = pNode;
+ }
+ }
+ ASSERT(m_pNodeFree != NULL);
+ CFX_PtrList::CNode* pNode = m_pNodeFree;
+ m_pNodeFree = m_pNodeFree->pNext;
+ pNode->pPrev = pPrev;
+ pNode->pNext = pNext;
+ m_nCount++;
+ ASSERT(m_nCount > 0);
+ pNode->data = 0;
+ return pNode;
+}
+CFX_PtrList::~CFX_PtrList()
+{
+ RemoveAll();
+ ASSERT(m_nCount == 0);
+}
+FX_POSITION CFX_PtrList::FindIndex(int nIndex) const
+{
+ if (nIndex >= m_nCount || nIndex < 0) {
+ return NULL;
+ }
+ CNode* pNode = m_pNodeHead;
+ while (nIndex--) {
+ pNode = pNode->pNext;
+ }
+ return (FX_POSITION) pNode;
+}
+FX_POSITION CFX_PtrList::Find(void* searchValue, FX_POSITION startAfter) const
+{
+ CNode* pNode = (CNode*) startAfter;
+ if (pNode == NULL) {
+ pNode = m_pNodeHead;
+ } else {
+ pNode = pNode->pNext;
+ }
+ for (; pNode != NULL; pNode = pNode->pNext)
+ if (pNode->data == searchValue) {
+ return (FX_POSITION) pNode;
+ }
+ return NULL;
+}
diff --git a/core/src/fxcrt/fx_basic_maps.cpp b/core/src/fxcrt/fx_basic_maps.cpp
index cb397ee8bd..a0b1788a82 100644
--- a/core/src/fxcrt/fx_basic_maps.cpp
+++ b/core/src/fxcrt/fx_basic_maps.cpp
@@ -1,654 +1,654 @@
-// 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
-
-#include "../../include/fxcrt/fx_ext.h"
-#include "plex.h"
-static void ConstructElement(CFX_ByteString* pNewData)
-{
- new (pNewData) CFX_ByteString();
-}
-static void DestructElement(CFX_ByteString* pOldData)
-{
- pOldData->~CFX_ByteString();
-}
-CFX_MapPtrToPtr::CFX_MapPtrToPtr(int nBlockSize, IFX_Allocator* pAllocator)
- : m_pAllocator(pAllocator)
- , m_pHashTable(NULL)
- , m_nHashTableSize(17)
- , m_nCount(0)
- , m_pFreeList(NULL)
- , m_pBlocks(NULL)
- , m_nBlockSize(nBlockSize)
-{
- ASSERT(m_nBlockSize > 0);
-}
-void CFX_MapPtrToPtr::RemoveAll()
-{
- if (m_pHashTable) {
- FX_Allocator_Free(m_pAllocator, m_pHashTable);
- m_pHashTable = NULL;
- }
- m_nCount = 0;
- m_pFreeList = NULL;
- m_pBlocks->FreeDataChain(m_pAllocator);
- m_pBlocks = NULL;
-}
-CFX_MapPtrToPtr::~CFX_MapPtrToPtr()
-{
- RemoveAll();
- ASSERT(m_nCount == 0);
-}
-FX_DWORD CFX_MapPtrToPtr::HashKey(void* key) const
-{
- return ((FX_DWORD)(FX_UINTPTR)key) >> 4;
-}
-void CFX_MapPtrToPtr::GetNextAssoc(FX_POSITION& rNextPosition, void*& rKey, void*& rValue) const
-{
- ASSERT(m_pHashTable != NULL);
- CAssoc* pAssocRet = (CAssoc*)rNextPosition;
- ASSERT(pAssocRet != NULL);
- if (pAssocRet == (CAssoc*) - 1) {
- for (FX_DWORD nBucket = 0; nBucket < m_nHashTableSize; nBucket++)
- if ((pAssocRet = m_pHashTable[nBucket]) != NULL) {
- break;
- }
- ASSERT(pAssocRet != NULL);
- }
- CAssoc* pAssocNext;
- if ((pAssocNext = pAssocRet->pNext) == NULL) {
- for (FX_DWORD nBucket = (HashKey(pAssocRet->key) % m_nHashTableSize) + 1; nBucket < m_nHashTableSize; nBucket ++) {
- if ((pAssocNext = m_pHashTable[nBucket]) != NULL) {
- break;
- }
- }
- }
- rNextPosition = (FX_POSITION) pAssocNext;
- rKey = pAssocRet->key;
- rValue = pAssocRet->value;
-}
-FX_BOOL CFX_MapPtrToPtr::Lookup(void* key, void*& rValue) const
-{
- FX_DWORD nHash;
- CAssoc* pAssoc = GetAssocAt(key, nHash);
- if (pAssoc == NULL) {
- return FALSE;
- }
- rValue = pAssoc->value;
- return TRUE;
-}
-void* CFX_MapPtrToPtr::GetValueAt(void* key) const
-{
- FX_DWORD nHash;
- CAssoc* pAssoc = GetAssocAt(key, nHash);
- if (pAssoc == NULL) {
- return NULL;
- }
- return pAssoc->value;
-}
-void*& CFX_MapPtrToPtr::operator[](void* key)
-{
- FX_DWORD nHash;
- CAssoc* pAssoc;
- if ((pAssoc = GetAssocAt(key, nHash)) == NULL) {
- if (m_pHashTable == NULL) {
- InitHashTable(m_nHashTableSize);
- }
- pAssoc = NewAssoc();
- pAssoc->key = key;
- pAssoc->pNext = m_pHashTable[nHash];
- m_pHashTable[nHash] = pAssoc;
- }
- return pAssoc->value;
-}
-CFX_MapPtrToPtr::CAssoc*
-CFX_MapPtrToPtr::GetAssocAt(void* key, FX_DWORD& nHash) const
-{
- nHash = HashKey(key) % m_nHashTableSize;
- if (m_pHashTable == NULL) {
- return NULL;
- }
- CAssoc* pAssoc;
- for (pAssoc = m_pHashTable[nHash]; pAssoc != NULL; pAssoc = pAssoc->pNext) {
- if (pAssoc->key == key) {
- return pAssoc;
- }
- }
- return NULL;
-}
-CFX_MapPtrToPtr::CAssoc*
-CFX_MapPtrToPtr::NewAssoc()
-{
- if (m_pFreeList == NULL) {
- CFX_Plex* newBlock = CFX_Plex::Create(m_pAllocator, m_pBlocks, m_nBlockSize, sizeof(CFX_MapPtrToPtr::CAssoc));
- CFX_MapPtrToPtr::CAssoc* pAssoc = (CFX_MapPtrToPtr::CAssoc*)newBlock->data();
- pAssoc += m_nBlockSize - 1;
- for (int i = m_nBlockSize - 1; i >= 0; i--, pAssoc--) {
- pAssoc->pNext = m_pFreeList;
- m_pFreeList = pAssoc;
- }
- }
- ASSERT(m_pFreeList != NULL);
- CFX_MapPtrToPtr::CAssoc* pAssoc = m_pFreeList;
- m_pFreeList = m_pFreeList->pNext;
- m_nCount++;
- ASSERT(m_nCount > 0);
- pAssoc->key = 0;
- pAssoc->value = 0;
- return pAssoc;
-}
-void CFX_MapPtrToPtr::InitHashTable(
- FX_DWORD nHashSize, FX_BOOL bAllocNow)
-{
- ASSERT(m_nCount == 0);
- ASSERT(nHashSize > 0);
- if (m_pHashTable != NULL) {
- FX_Allocator_Free(m_pAllocator, m_pHashTable);
- m_pHashTable = NULL;
- }
- if (bAllocNow) {
- m_pHashTable = FX_Allocator_Alloc(m_pAllocator, CAssoc*, nHashSize);
- if (m_pHashTable) {
- FXSYS_memset32(m_pHashTable, 0, sizeof(CAssoc*) * nHashSize);
- }
- }
- m_nHashTableSize = nHashSize;
-}
-FX_BOOL CFX_MapPtrToPtr::RemoveKey(void* key)
-{
- if (m_pHashTable == NULL) {
- return FALSE;
- }
- CAssoc** ppAssocPrev;
- ppAssocPrev = &m_pHashTable[HashKey(key) % m_nHashTableSize];
- CAssoc* pAssoc;
- for (pAssoc = *ppAssocPrev; pAssoc != NULL; pAssoc = pAssoc->pNext) {
- if (pAssoc->key == key) {
- *ppAssocPrev = pAssoc->pNext;
- FreeAssoc(pAssoc);
- return TRUE;
- }
- ppAssocPrev = &pAssoc->pNext;
- }
- return FALSE;
-}
-void CFX_MapPtrToPtr::FreeAssoc(CFX_MapPtrToPtr::CAssoc* pAssoc)
-{
- pAssoc->pNext = m_pFreeList;
- m_pFreeList = pAssoc;
- m_nCount--;
- ASSERT(m_nCount >= 0);
- if (m_nCount == 0) {
- RemoveAll();
- }
-}
-CFX_MapByteStringToPtr::CFX_MapByteStringToPtr(int nBlockSize, IFX_Allocator* pAllocator)
- : m_pAllocator(pAllocator)
- , m_pHashTable(NULL)
- , m_nHashTableSize(17)
- , m_nCount(0)
- , m_pFreeList(NULL)
- , m_pBlocks(NULL)
- , m_nBlockSize(nBlockSize)
-{
- ASSERT(m_nBlockSize > 0);
-}
-void CFX_MapByteStringToPtr::RemoveAll()
-{
- if (m_pHashTable != NULL) {
- for (FX_DWORD nHash = 0; nHash < m_nHashTableSize; nHash++) {
- CAssoc* pAssoc;
- for (pAssoc = m_pHashTable[nHash]; pAssoc != NULL;
- pAssoc = pAssoc->pNext) {
- DestructElement(&pAssoc->key);
- }
- }
- FX_Allocator_Free(m_pAllocator, m_pHashTable);
- m_pHashTable = NULL;
- }
- m_nCount = 0;
- m_pFreeList = NULL;
- m_pBlocks->FreeDataChain(m_pAllocator);
- m_pBlocks = NULL;
-}
-CFX_MapByteStringToPtr::~CFX_MapByteStringToPtr()
-{
- RemoveAll();
- ASSERT(m_nCount == 0);
-}
-void CFX_MapByteStringToPtr::GetNextAssoc(FX_POSITION& rNextPosition,
- CFX_ByteString& rKey, void*& rValue) const
-{
- ASSERT(m_pHashTable != NULL);
- CAssoc* pAssocRet = (CAssoc*)rNextPosition;
- ASSERT(pAssocRet != NULL);
- if (pAssocRet == (CAssoc*) - 1) {
- for (FX_DWORD nBucket = 0; nBucket < m_nHashTableSize; nBucket++)
- if ((pAssocRet = m_pHashTable[nBucket]) != NULL) {
- break;
- }
- ASSERT(pAssocRet != NULL);
- }
- CAssoc* pAssocNext;
- if ((pAssocNext = pAssocRet->pNext) == NULL) {
- for (FX_DWORD nBucket = pAssocRet->nHashValue + 1;
- nBucket < m_nHashTableSize; nBucket++)
- if ((pAssocNext = m_pHashTable[nBucket]) != NULL) {
- break;
- }
- }
- rNextPosition = (FX_POSITION) pAssocNext;
- rKey = pAssocRet->key;
- rValue = pAssocRet->value;
-}
-FX_LPVOID CFX_MapByteStringToPtr::GetNextValue(FX_POSITION& rNextPosition) const
-{
- ASSERT(m_pHashTable != NULL);
- CAssoc* pAssocRet = (CAssoc*)rNextPosition;
- ASSERT(pAssocRet != NULL);
- if (pAssocRet == (CAssoc*) - 1) {
- for (FX_DWORD nBucket = 0; nBucket < m_nHashTableSize; nBucket++)
- if ((pAssocRet = m_pHashTable[nBucket]) != NULL) {
- break;
- }
- ASSERT(pAssocRet != NULL);
- }
- CAssoc* pAssocNext;
- if ((pAssocNext = pAssocRet->pNext) == NULL) {
- for (FX_DWORD nBucket = pAssocRet->nHashValue + 1;
- nBucket < m_nHashTableSize; nBucket++)
- if ((pAssocNext = m_pHashTable[nBucket]) != NULL) {
- break;
- }
- }
- rNextPosition = (FX_POSITION) pAssocNext;
- return pAssocRet->value;
-}
-void*& CFX_MapByteStringToPtr::operator[](FX_BSTR key)
-{
- FX_DWORD nHash;
- CAssoc* pAssoc;
- if ((pAssoc = GetAssocAt(key, nHash)) == NULL) {
- if (m_pHashTable == NULL) {
- InitHashTable(m_nHashTableSize);
- }
- pAssoc = NewAssoc();
- pAssoc->nHashValue = nHash;
- pAssoc->key = key;
- pAssoc->pNext = m_pHashTable[nHash];
- m_pHashTable[nHash] = pAssoc;
- }
- return pAssoc->value;
-}
-CFX_MapByteStringToPtr::CAssoc*
-CFX_MapByteStringToPtr::NewAssoc()
-{
- if (m_pFreeList == NULL) {
- CFX_Plex* newBlock = CFX_Plex::Create(m_pAllocator, m_pBlocks, m_nBlockSize, sizeof(CFX_MapByteStringToPtr::CAssoc));
- CFX_MapByteStringToPtr::CAssoc* pAssoc = (CFX_MapByteStringToPtr::CAssoc*)newBlock->data();
- pAssoc += m_nBlockSize - 1;
- for (int i = m_nBlockSize - 1; i >= 0; i--, pAssoc--) {
- pAssoc->pNext = m_pFreeList;
- m_pFreeList = pAssoc;
- }
- }
- ASSERT(m_pFreeList != NULL);
- CFX_MapByteStringToPtr::CAssoc* pAssoc = m_pFreeList;
- m_pFreeList = m_pFreeList->pNext;
- m_nCount++;
- ASSERT(m_nCount > 0);
- ConstructElement(&pAssoc->key);
- pAssoc->value = 0;
- return pAssoc;
-}
-void CFX_MapByteStringToPtr::FreeAssoc(CFX_MapByteStringToPtr::CAssoc* pAssoc)
-{
- DestructElement(&pAssoc->key);
- pAssoc->pNext = m_pFreeList;
- m_pFreeList = pAssoc;
- m_nCount--;
- ASSERT(m_nCount >= 0);
- if (m_nCount == 0) {
- RemoveAll();
- }
-}
-CFX_MapByteStringToPtr::CAssoc*
-CFX_MapByteStringToPtr::GetAssocAt(FX_BSTR key, FX_DWORD& nHash) const
-{
- nHash = HashKey(key) % m_nHashTableSize;
- if (m_pHashTable == NULL) {
- return NULL;
- }
- CAssoc* pAssoc;
- for (pAssoc = m_pHashTable[nHash]; pAssoc != NULL; pAssoc = pAssoc->pNext) {
- if (pAssoc->key == key) {
- return pAssoc;
- }
- }
- return NULL;
-}
-FX_BOOL CFX_MapByteStringToPtr::Lookup(FX_BSTR key, void*& rValue) const
-{
- FX_DWORD nHash;
- CAssoc* pAssoc = GetAssocAt(key, nHash);
- if (pAssoc == NULL) {
- return FALSE;
- }
- rValue = pAssoc->value;
- return TRUE;
-}
-void CFX_MapByteStringToPtr::InitHashTable(
- FX_DWORD nHashSize, FX_BOOL bAllocNow)
-{
- ASSERT(m_nCount == 0);
- ASSERT(nHashSize > 0);
- if (m_pHashTable != NULL) {
- FX_Allocator_Free(m_pAllocator, m_pHashTable);
- m_pHashTable = NULL;
- }
- if (bAllocNow) {
- m_pHashTable = FX_Allocator_Alloc(m_pAllocator, CAssoc*, nHashSize);
- if (m_pHashTable) {
- FXSYS_memset32(m_pHashTable, 0, sizeof(CAssoc*) * nHashSize);
- }
- }
- m_nHashTableSize = nHashSize;
-}
-inline FX_DWORD CFX_MapByteStringToPtr::HashKey(FX_BSTR key) const
-{
- FX_DWORD nHash = 0;
- int len = key.GetLength();
- FX_LPCBYTE buf = key;
- for (int i = 0; i < len; i ++) {
- nHash = (nHash << 5) + nHash + buf[i];
- }
- return nHash;
-}
-FX_BOOL CFX_MapByteStringToPtr::RemoveKey(FX_BSTR key)
-{
- if (m_pHashTable == NULL) {
- return FALSE;
- }
- CAssoc** ppAssocPrev;
- ppAssocPrev = &m_pHashTable[HashKey(key) % m_nHashTableSize];
- CAssoc* pAssoc;
- for (pAssoc = *ppAssocPrev; pAssoc != NULL; pAssoc = pAssoc->pNext) {
- if (pAssoc->key == key) {
- *ppAssocPrev = pAssoc->pNext;
- FreeAssoc(pAssoc);
- return TRUE;
- }
- ppAssocPrev = &pAssoc->pNext;
- }
- return FALSE;
-}
-struct _CompactString {
- FX_BYTE m_CompactLen;
- FX_BYTE m_LenHigh;
- FX_BYTE m_LenLow;
- FX_BYTE m_Unused;
- FX_LPBYTE m_pBuffer;
-};
-static void _CompactStringRelease(IFX_Allocator* pAllocator, _CompactString* pCompact)
-{
- if (pCompact->m_CompactLen == 0xff) {
- FX_Allocator_Free(pAllocator, pCompact->m_pBuffer);
- }
-}
-static FX_BOOL _CompactStringSame(_CompactString* pCompact, FX_LPCBYTE pStr, int len)
-{
- if (len < sizeof(_CompactString)) {
- if (pCompact->m_CompactLen != len) {
- return FALSE;
- }
- return FXSYS_memcmp32(&pCompact->m_LenHigh, pStr, len) == 0;
- }
- if (pCompact->m_CompactLen != 0xff || pCompact->m_LenHigh * 256 + pCompact->m_LenLow != len) {
- return FALSE;
- }
- return FXSYS_memcmp32(pCompact->m_pBuffer, pStr, len) == 0;
-}
-static void _CompactStringStore(IFX_Allocator* pAllocator, _CompactString* pCompact, FX_LPCBYTE pStr, int len)
-{
- if (len < (int)sizeof(_CompactString)) {
- pCompact->m_CompactLen = (FX_BYTE)len;
- FXSYS_memcpy32(&pCompact->m_LenHigh, pStr, len);
- return;
- }
- pCompact->m_CompactLen = 0xff;
- pCompact->m_LenHigh = len / 256;
- pCompact->m_LenLow = len % 256;
- pCompact->m_pBuffer = FX_Allocator_Alloc(pAllocator, FX_BYTE, len);
- if (pCompact->m_pBuffer) {
- FXSYS_memcpy32(pCompact->m_pBuffer, pStr, len);
- }
-}
-static CFX_ByteStringC _CompactStringGet(_CompactString* pCompact)
-{
- if (pCompact->m_CompactLen == 0xff) {
- return CFX_ByteStringC(pCompact->m_pBuffer, pCompact->m_LenHigh * 256 + pCompact->m_LenLow);
- }
- if (pCompact->m_CompactLen == 0xfe) {
- return CFX_ByteStringC();
- }
- return CFX_ByteStringC(&pCompact->m_LenHigh, pCompact->m_CompactLen);
-}
-#define CMAP_ALLOC_STEP 8
-#define CMAP_INDEX_SIZE 8
-CFX_CMapByteStringToPtr::CFX_CMapByteStringToPtr(IFX_Allocator* pAllocator)
- : m_Buffer(sizeof(_CompactString) + sizeof(void*), CMAP_ALLOC_STEP, CMAP_INDEX_SIZE, pAllocator)
-{
-}
-CFX_CMapByteStringToPtr::~CFX_CMapByteStringToPtr()
-{
- RemoveAll();
-}
-void CFX_CMapByteStringToPtr::RemoveAll()
-{
- IFX_Allocator* pAllocator = m_Buffer.m_pAllocator;
- int size = m_Buffer.GetSize();
- for (int i = 0; i < size; i ++) {
- _CompactStringRelease(pAllocator, (_CompactString*)m_Buffer.GetAt(i));
- }
- m_Buffer.RemoveAll();
-}
-FX_POSITION CFX_CMapByteStringToPtr::GetStartPosition() const
-{
- int size = m_Buffer.GetSize();
- for (int i = 0; i < size; i ++) {
- _CompactString* pKey = (_CompactString*)m_Buffer.GetAt(i);
- if (pKey->m_CompactLen != 0xfe) {
- return (FX_POSITION)(FX_UINTPTR)(i + 1);
- }
- }
- return NULL;
-}
-void CFX_CMapByteStringToPtr::GetNextAssoc(FX_POSITION& rNextPosition, CFX_ByteString& rKey, void*& rValue) const
-{
- if (rNextPosition == NULL) {
- return;
- }
- int index = (int)(FX_UINTPTR)rNextPosition - 1;
- _CompactString* pKey = (_CompactString*)m_Buffer.GetAt(index);
- rKey = _CompactStringGet(pKey);
- rValue = *(void**)(pKey + 1);
- index ++;
- int size = m_Buffer.GetSize();
- while (index < size) {
- pKey = (_CompactString*)m_Buffer.GetAt(index);
- if (pKey->m_CompactLen != 0xfe) {
- rNextPosition = (FX_POSITION)(FX_UINTPTR)(index + 1);
- return;
- }
- index ++;
- }
- rNextPosition = NULL;
-}
-FX_LPVOID CFX_CMapByteStringToPtr::GetNextValue(FX_POSITION& rNextPosition) const
-{
- if (rNextPosition == NULL) {
- return NULL;
- }
- int index = (int)(FX_UINTPTR)rNextPosition - 1;
- _CompactString* pKey = (_CompactString*)m_Buffer.GetAt(index);
- FX_LPVOID rValue = *(void**)(pKey + 1);
- index ++;
- int size = m_Buffer.GetSize();
- while (index < size) {
- pKey = (_CompactString*)m_Buffer.GetAt(index);
- if (pKey->m_CompactLen != 0xfe) {
- rNextPosition = (FX_POSITION)(FX_UINTPTR)(index + 1);
- return rValue;
- }
- index ++;
- }
- rNextPosition = NULL;
- return rValue;
-}
-FX_BOOL _CMapLookupCallback(void* param, void* pData)
-{
- return !_CompactStringSame((_CompactString*)pData, ((CFX_ByteStringC*)param)->GetPtr(), ((CFX_ByteStringC*)param)->GetLength());
-}
-FX_BOOL CFX_CMapByteStringToPtr::Lookup(FX_BSTR key, void*& rValue) const
-{
- void* p = m_Buffer.Iterate(_CMapLookupCallback, (void*)&key);
- if (!p) {
- return FALSE;
- }
- rValue = *(void**)((_CompactString*)p + 1);
- return TRUE;
-}
-void CFX_CMapByteStringToPtr::SetAt(FX_BSTR key, void* value)
-{
- ASSERT(value != NULL);
- int index, key_len = key.GetLength();
- int size = m_Buffer.GetSize();
- for (index = 0; index < size; index ++) {
- _CompactString* pKey = (_CompactString*)m_Buffer.GetAt(index);
- if (!_CompactStringSame(pKey, (FX_LPCBYTE)key, key_len)) {
- continue;
- }
- *(void**)(pKey + 1) = value;
- return;
- }
- IFX_Allocator* pAllocator = m_Buffer.m_pAllocator;
- for (index = 0; index < size; index ++) {
- _CompactString* pKey = (_CompactString*)m_Buffer.GetAt(index);
- if (pKey->m_CompactLen) {
- continue;
- }
- _CompactStringStore(pAllocator, pKey, (FX_LPCBYTE)key, key_len);
- *(void**)(pKey + 1) = value;
- return;
- }
- _CompactString* pKey = (_CompactString*)m_Buffer.Add();
- _CompactStringStore(pAllocator, pKey, (FX_LPCBYTE)key, key_len);
- *(void**)(pKey + 1) = value;
-}
-void CFX_CMapByteStringToPtr::AddValue(FX_BSTR key, void* value)
-{
- ASSERT(value != NULL);
- _CompactString* pKey = (_CompactString*)m_Buffer.Add();
- _CompactStringStore(m_Buffer.m_pAllocator, pKey, (FX_LPCBYTE)key, key.GetLength());
- *(void**)(pKey + 1) = value;
-}
-void CFX_CMapByteStringToPtr::RemoveKey(FX_BSTR key)
-{
- int key_len = key.GetLength();
- IFX_Allocator* pAllocator = m_Buffer.m_pAllocator;
- int size = m_Buffer.GetSize();
- for (int index = 0; index < size; index ++) {
- _CompactString* pKey = (_CompactString*)m_Buffer.GetAt(index);
- if (!_CompactStringSame(pKey, (FX_LPCBYTE)key, key_len)) {
- continue;
- }
- _CompactStringRelease(pAllocator, pKey);
- pKey->m_CompactLen = 0xfe;
- return;
- }
-}
-int CFX_CMapByteStringToPtr::GetCount() const
-{
- int count = 0;
- int size = m_Buffer.GetSize();
- for (int i = 0; i < size; i ++) {
- _CompactString* pKey = (_CompactString*)m_Buffer.GetAt(i);
- if (pKey->m_CompactLen != 0xfe) {
- count ++;
- }
- }
- return count;
-}
-extern "C" {
- static int _CompareDWord(const void* p1, const void* p2)
- {
- return (*(FX_DWORD*)p1) - (*(FX_DWORD*)p2);
- }
-};
-struct _DWordPair {
- FX_DWORD key;
- FX_DWORD value;
-};
-FX_BOOL CFX_CMapDWordToDWord::Lookup(FX_DWORD key, FX_DWORD& value) const
-{
- FX_LPVOID pResult = FXSYS_bsearch(&key, m_Buffer.GetBuffer(), m_Buffer.GetSize() / sizeof(_DWordPair),
- sizeof(_DWordPair), _CompareDWord);
- if (pResult == NULL) {
- return FALSE;
- }
- value = ((FX_DWORD*)pResult)[1];
- return TRUE;
-}
-FX_POSITION CFX_CMapDWordToDWord::GetStartPosition() const
-{
- FX_DWORD count = m_Buffer.GetSize() / sizeof(_DWordPair);
- if (count == 0) {
- return NULL;
- }
- return (FX_POSITION)1;
-}
-void CFX_CMapDWordToDWord::GetNextAssoc(FX_POSITION& pos, FX_DWORD& key, FX_DWORD& value) const
-{
- if (pos == 0) {
- return;
- }
- FX_DWORD index = ((FX_DWORD)(FX_UINTPTR)pos) - 1;
- FX_DWORD count = m_Buffer.GetSize() / sizeof(_DWordPair);
- _DWordPair* buf = (_DWordPair*)m_Buffer.GetBuffer();
- key = buf[index].key;
- value = buf[index].value;
- if (index == count - 1) {
- pos = 0;
- } else {
- pos = (FX_POSITION)((FX_UINTPTR)pos + 1);
- }
-}
-void CFX_CMapDWordToDWord::SetAt(FX_DWORD key, FX_DWORD value)
-{
- FX_DWORD count = m_Buffer.GetSize() / sizeof(_DWordPair);
- _DWordPair* buf = (_DWordPair*)m_Buffer.GetBuffer();
- _DWordPair pair = {key, value};
- if (count == 0 || key > buf[count - 1].key) {
- m_Buffer.AppendBlock(&pair, sizeof(_DWordPair));
- return;
- }
- int low = 0, high = count - 1;
- while (low <= high) {
- int mid = (low + high) / 2;
- if (buf[mid].key < key) {
- low = mid + 1;
- } else if (buf[mid].key > key) {
- high = mid - 1;
- } else {
- buf[mid].value = value;
- return;
- }
- }
- m_Buffer.InsertBlock(low * sizeof(_DWordPair), &pair, sizeof(_DWordPair));
-}
-void CFX_CMapDWordToDWord::EstimateSize(FX_DWORD size, FX_DWORD grow_by)
-{
- m_Buffer.EstimateSize(size, grow_by);
-}
+// 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
+
+#include "../../include/fxcrt/fx_ext.h"
+#include "plex.h"
+static void ConstructElement(CFX_ByteString* pNewData)
+{
+ new (pNewData) CFX_ByteString();
+}
+static void DestructElement(CFX_ByteString* pOldData)
+{
+ pOldData->~CFX_ByteString();
+}
+CFX_MapPtrToPtr::CFX_MapPtrToPtr(int nBlockSize, IFX_Allocator* pAllocator)
+ : m_pAllocator(pAllocator)
+ , m_pHashTable(NULL)
+ , m_nHashTableSize(17)
+ , m_nCount(0)
+ , m_pFreeList(NULL)
+ , m_pBlocks(NULL)
+ , m_nBlockSize(nBlockSize)
+{
+ ASSERT(m_nBlockSize > 0);
+}
+void CFX_MapPtrToPtr::RemoveAll()
+{
+ if (m_pHashTable) {
+ FX_Allocator_Free(m_pAllocator, m_pHashTable);
+ m_pHashTable = NULL;
+ }
+ m_nCount = 0;
+ m_pFreeList = NULL;
+ m_pBlocks->FreeDataChain(m_pAllocator);
+ m_pBlocks = NULL;
+}
+CFX_MapPtrToPtr::~CFX_MapPtrToPtr()
+{
+ RemoveAll();
+ ASSERT(m_nCount == 0);
+}
+FX_DWORD CFX_MapPtrToPtr::HashKey(void* key) const
+{
+ return ((FX_DWORD)(FX_UINTPTR)key) >> 4;
+}
+void CFX_MapPtrToPtr::GetNextAssoc(FX_POSITION& rNextPosition, void*& rKey, void*& rValue) const
+{
+ ASSERT(m_pHashTable != NULL);
+ CAssoc* pAssocRet = (CAssoc*)rNextPosition;
+ ASSERT(pAssocRet != NULL);
+ if (pAssocRet == (CAssoc*) - 1) {
+ for (FX_DWORD nBucket = 0; nBucket < m_nHashTableSize; nBucket++)
+ if ((pAssocRet = m_pHashTable[nBucket]) != NULL) {
+ break;
+ }
+ ASSERT(pAssocRet != NULL);
+ }
+ CAssoc* pAssocNext;
+ if ((pAssocNext = pAssocRet->pNext) == NULL) {
+ for (FX_DWORD nBucket = (HashKey(pAssocRet->key) % m_nHashTableSize) + 1; nBucket < m_nHashTableSize; nBucket ++) {
+ if ((pAssocNext = m_pHashTable[nBucket]) != NULL) {
+ break;
+ }
+ }
+ }
+ rNextPosition = (FX_POSITION) pAssocNext;
+ rKey = pAssocRet->key;
+ rValue = pAssocRet->value;
+}
+FX_BOOL CFX_MapPtrToPtr::Lookup(void* key, void*& rValue) const
+{
+ FX_DWORD nHash;
+ CAssoc* pAssoc = GetAssocAt(key, nHash);
+ if (pAssoc == NULL) {
+ return FALSE;
+ }
+ rValue = pAssoc->value;
+ return TRUE;
+}
+void* CFX_MapPtrToPtr::GetValueAt(void* key) const
+{
+ FX_DWORD nHash;
+ CAssoc* pAssoc = GetAssocAt(key, nHash);
+ if (pAssoc == NULL) {
+ return NULL;
+ }
+ return pAssoc->value;
+}
+void*& CFX_MapPtrToPtr::operator[](void* key)
+{
+ FX_DWORD nHash;
+ CAssoc* pAssoc;
+ if ((pAssoc = GetAssocAt(key, nHash)) == NULL) {
+ if (m_pHashTable == NULL) {
+ InitHashTable(m_nHashTableSize);
+ }
+ pAssoc = NewAssoc();
+ pAssoc->key = key;
+ pAssoc->pNext = m_pHashTable[nHash];
+ m_pHashTable[nHash] = pAssoc;
+ }
+ return pAssoc->value;
+}
+CFX_MapPtrToPtr::CAssoc*
+CFX_MapPtrToPtr::GetAssocAt(void* key, FX_DWORD& nHash) const
+{
+ nHash = HashKey(key) % m_nHashTableSize;
+ if (m_pHashTable == NULL) {
+ return NULL;
+ }
+ CAssoc* pAssoc;
+ for (pAssoc = m_pHashTable[nHash]; pAssoc != NULL; pAssoc = pAssoc->pNext) {
+ if (pAssoc->key == key) {
+ return pAssoc;
+ }
+ }
+ return NULL;
+}
+CFX_MapPtrToPtr::CAssoc*
+CFX_MapPtrToPtr::NewAssoc()
+{
+ if (m_pFreeList == NULL) {
+ CFX_Plex* newBlock = CFX_Plex::Create(m_pAllocator, m_pBlocks, m_nBlockSize, sizeof(CFX_MapPtrToPtr::CAssoc));
+ CFX_MapPtrToPtr::CAssoc* pAssoc = (CFX_MapPtrToPtr::CAssoc*)newBlock->data();
+ pAssoc += m_nBlockSize - 1;
+ for (int i = m_nBlockSize - 1; i >= 0; i--, pAssoc--) {
+ pAssoc->pNext = m_pFreeList;
+ m_pFreeList = pAssoc;
+ }
+ }
+ ASSERT(m_pFreeList != NULL);
+ CFX_MapPtrToPtr::CAssoc* pAssoc = m_pFreeList;
+ m_pFreeList = m_pFreeList->pNext;
+ m_nCount++;
+ ASSERT(m_nCount > 0);
+ pAssoc->key = 0;
+ pAssoc->value = 0;
+ return pAssoc;
+}
+void CFX_MapPtrToPtr::InitHashTable(
+ FX_DWORD nHashSize, FX_BOOL bAllocNow)
+{
+ ASSERT(m_nCount == 0);
+ ASSERT(nHashSize > 0);
+ if (m_pHashTable != NULL) {
+ FX_Allocator_Free(m_pAllocator, m_pHashTable);
+ m_pHashTable = NULL;
+ }
+ if (bAllocNow) {
+ m_pHashTable = FX_Allocator_Alloc(m_pAllocator, CAssoc*, nHashSize);
+ if (m_pHashTable) {
+ FXSYS_memset32(m_pHashTable, 0, sizeof(CAssoc*) * nHashSize);
+ }
+ }
+ m_nHashTableSize = nHashSize;
+}
+FX_BOOL CFX_MapPtrToPtr::RemoveKey(void* key)
+{
+ if (m_pHashTable == NULL) {
+ return FALSE;
+ }
+ CAssoc** ppAssocPrev;
+ ppAssocPrev = &m_pHashTable[HashKey(key) % m_nHashTableSize];
+ CAssoc* pAssoc;
+ for (pAssoc = *ppAssocPrev; pAssoc != NULL; pAssoc = pAssoc->pNext) {
+ if (pAssoc->key == key) {
+ *ppAssocPrev = pAssoc->pNext;
+ FreeAssoc(pAssoc);
+ return TRUE;
+ }
+ ppAssocPrev = &pAssoc->pNext;
+ }
+ return FALSE;
+}
+void CFX_MapPtrToPtr::FreeAssoc(CFX_MapPtrToPtr::CAssoc* pAssoc)
+{
+ pAssoc->pNext = m_pFreeList;
+ m_pFreeList = pAssoc;
+ m_nCount--;
+ ASSERT(m_nCount >= 0);
+ if (m_nCount == 0) {
+ RemoveAll();
+ }
+}
+CFX_MapByteStringToPtr::CFX_MapByteStringToPtr(int nBlockSize, IFX_Allocator* pAllocator)
+ : m_pAllocator(pAllocator)
+ , m_pHashTable(NULL)
+ , m_nHashTableSize(17)
+ , m_nCount(0)
+ , m_pFreeList(NULL)
+ , m_pBlocks(NULL)
+ , m_nBlockSize(nBlockSize)
+{
+ ASSERT(m_nBlockSize > 0);
+}
+void CFX_MapByteStringToPtr::RemoveAll()
+{
+ if (m_pHashTable != NULL) {
+ for (FX_DWORD nHash = 0; nHash < m_nHashTableSize; nHash++) {
+ CAssoc* pAssoc;
+ for (pAssoc = m_pHashTable[nHash]; pAssoc != NULL;
+ pAssoc = pAssoc->pNext) {
+ DestructElement(&pAssoc->key);
+ }
+ }
+ FX_Allocator_Free(m_pAllocator, m_pHashTable);
+ m_pHashTable = NULL;
+ }
+ m_nCount = 0;
+ m_pFreeList = NULL;
+ m_pBlocks->FreeDataChain(m_pAllocator);
+ m_pBlocks = NULL;
+}
+CFX_MapByteStringToPtr::~CFX_MapByteStringToPtr()
+{
+ RemoveAll();
+ ASSERT(m_nCount == 0);
+}
+void CFX_MapByteStringToPtr::GetNextAssoc(FX_POSITION& rNextPosition,
+ CFX_ByteString& rKey, void*& rValue) const
+{
+ ASSERT(m_pHashTable != NULL);
+ CAssoc* pAssocRet = (CAssoc*)rNextPosition;
+ ASSERT(pAssocRet != NULL);
+ if (pAssocRet == (CAssoc*) - 1) {
+ for (FX_DWORD nBucket = 0; nBucket < m_nHashTableSize; nBucket++)
+ if ((pAssocRet = m_pHashTable[nBucket]) != NULL) {
+ break;
+ }
+ ASSERT(pAssocRet != NULL);
+ }
+ CAssoc* pAssocNext;
+ if ((pAssocNext = pAssocRet->pNext) == NULL) {
+ for (FX_DWORD nBucket = pAssocRet->nHashValue + 1;
+ nBucket < m_nHashTableSize; nBucket++)
+ if ((pAssocNext = m_pHashTable[nBucket]) != NULL) {
+ break;
+ }
+ }
+ rNextPosition = (FX_POSITION) pAssocNext;
+ rKey = pAssocRet->key;
+ rValue = pAssocRet->value;
+}
+FX_LPVOID CFX_MapByteStringToPtr::GetNextValue(FX_POSITION& rNextPosition) const
+{
+ ASSERT(m_pHashTable != NULL);
+ CAssoc* pAssocRet = (CAssoc*)rNextPosition;
+ ASSERT(pAssocRet != NULL);
+ if (pAssocRet == (CAssoc*) - 1) {
+ for (FX_DWORD nBucket = 0; nBucket < m_nHashTableSize; nBucket++)
+ if ((pAssocRet = m_pHashTable[nBucket]) != NULL) {
+ break;
+ }
+ ASSERT(pAssocRet != NULL);
+ }
+ CAssoc* pAssocNext;
+ if ((pAssocNext = pAssocRet->pNext) == NULL) {
+ for (FX_DWORD nBucket = pAssocRet->nHashValue + 1;
+ nBucket < m_nHashTableSize; nBucket++)
+ if ((pAssocNext = m_pHashTable[nBucket]) != NULL) {
+ break;
+ }
+ }
+ rNextPosition = (FX_POSITION) pAssocNext;
+ return pAssocRet->value;
+}
+void*& CFX_MapByteStringToPtr::operator[](FX_BSTR key)
+{
+ FX_DWORD nHash;
+ CAssoc* pAssoc;
+ if ((pAssoc = GetAssocAt(key, nHash)) == NULL) {
+ if (m_pHashTable == NULL) {
+ InitHashTable(m_nHashTableSize);
+ }
+ pAssoc = NewAssoc();
+ pAssoc->nHashValue = nHash;
+ pAssoc->key = key;
+ pAssoc->pNext = m_pHashTable[nHash];
+ m_pHashTable[nHash] = pAssoc;
+ }
+ return pAssoc->value;
+}
+CFX_MapByteStringToPtr::CAssoc*
+CFX_MapByteStringToPtr::NewAssoc()
+{
+ if (m_pFreeList == NULL) {
+ CFX_Plex* newBlock = CFX_Plex::Create(m_pAllocator, m_pBlocks, m_nBlockSize, sizeof(CFX_MapByteStringToPtr::CAssoc));
+ CFX_MapByteStringToPtr::CAssoc* pAssoc = (CFX_MapByteStringToPtr::CAssoc*)newBlock->data();
+ pAssoc += m_nBlockSize - 1;
+ for (int i = m_nBlockSize - 1; i >= 0; i--, pAssoc--) {
+ pAssoc->pNext = m_pFreeList;
+ m_pFreeList = pAssoc;
+ }
+ }
+ ASSERT(m_pFreeList != NULL);
+ CFX_MapByteStringToPtr::CAssoc* pAssoc = m_pFreeList;
+ m_pFreeList = m_pFreeList->pNext;
+ m_nCount++;
+ ASSERT(m_nCount > 0);
+ ConstructElement(&pAssoc->key);
+ pAssoc->value = 0;
+ return pAssoc;
+}
+void CFX_MapByteStringToPtr::FreeAssoc(CFX_MapByteStringToPtr::CAssoc* pAssoc)
+{
+ DestructElement(&pAssoc->key);
+ pAssoc->pNext = m_pFreeList;
+ m_pFreeList = pAssoc;
+ m_nCount--;
+ ASSERT(m_nCount >= 0);
+ if (m_nCount == 0) {
+ RemoveAll();
+ }
+}
+CFX_MapByteStringToPtr::CAssoc*
+CFX_MapByteStringToPtr::GetAssocAt(FX_BSTR key, FX_DWORD& nHash) const
+{
+ nHash = HashKey(key) % m_nHashTableSize;
+ if (m_pHashTable == NULL) {
+ return NULL;
+ }
+ CAssoc* pAssoc;
+ for (pAssoc = m_pHashTable[nHash]; pAssoc != NULL; pAssoc = pAssoc->pNext) {
+ if (pAssoc->key == key) {
+ return pAssoc;
+ }
+ }
+ return NULL;
+}
+FX_BOOL CFX_MapByteStringToPtr::Lookup(FX_BSTR key, void*& rValue) const
+{
+ FX_DWORD nHash;
+ CAssoc* pAssoc = GetAssocAt(key, nHash);
+ if (pAssoc == NULL) {
+ return FALSE;
+ }
+ rValue = pAssoc->value;
+ return TRUE;
+}
+void CFX_MapByteStringToPtr::InitHashTable(
+ FX_DWORD nHashSize, FX_BOOL bAllocNow)
+{
+ ASSERT(m_nCount == 0);
+ ASSERT(nHashSize > 0);
+ if (m_pHashTable != NULL) {
+ FX_Allocator_Free(m_pAllocator, m_pHashTable);
+ m_pHashTable = NULL;
+ }
+ if (bAllocNow) {
+ m_pHashTable = FX_Allocator_Alloc(m_pAllocator, CAssoc*, nHashSize);
+ if (m_pHashTable) {
+ FXSYS_memset32(m_pHashTable, 0, sizeof(CAssoc*) * nHashSize);
+ }
+ }
+ m_nHashTableSize = nHashSize;
+}
+inline FX_DWORD CFX_MapByteStringToPtr::HashKey(FX_BSTR key) const
+{
+ FX_DWORD nHash = 0;
+ int len = key.GetLength();
+ FX_LPCBYTE buf = key;
+ for (int i = 0; i < len; i ++) {
+ nHash = (nHash << 5) + nHash + buf[i];
+ }
+ return nHash;
+}
+FX_BOOL CFX_MapByteStringToPtr::RemoveKey(FX_BSTR key)
+{
+ if (m_pHashTable == NULL) {
+ return FALSE;
+ }
+ CAssoc** ppAssocPrev;
+ ppAssocPrev = &m_pHashTable[HashKey(key) % m_nHashTableSize];
+ CAssoc* pAssoc;
+ for (pAssoc = *ppAssocPrev; pAssoc != NULL; pAssoc = pAssoc->pNext) {
+ if (pAssoc->key == key) {
+ *ppAssocPrev = pAssoc->pNext;
+ FreeAssoc(pAssoc);
+ return TRUE;
+ }
+ ppAssocPrev = &pAssoc->pNext;
+ }
+ return FALSE;
+}
+struct _CompactString {
+ FX_BYTE m_CompactLen;
+ FX_BYTE m_LenHigh;
+ FX_BYTE m_LenLow;
+ FX_BYTE m_Unused;
+ FX_LPBYTE m_pBuffer;
+};
+static void _CompactStringRelease(IFX_Allocator* pAllocator, _CompactString* pCompact)
+{
+ if (pCompact->m_CompactLen == 0xff) {
+ FX_Allocator_Free(pAllocator, pCompact->m_pBuffer);
+ }
+}
+static FX_BOOL _CompactStringSame(_CompactString* pCompact, FX_LPCBYTE pStr, int len)
+{
+ if (len < sizeof(_CompactString)) {
+ if (pCompact->m_CompactLen != len) {
+ return FALSE;
+ }
+ return FXSYS_memcmp32(&pCompact->m_LenHigh, pStr, len) == 0;
+ }
+ if (pCompact->m_CompactLen != 0xff || pCompact->m_LenHigh * 256 + pCompact->m_LenLow != len) {
+ return FALSE;
+ }
+ return FXSYS_memcmp32(pCompact->m_pBuffer, pStr, len) == 0;
+}
+static void _CompactStringStore(IFX_Allocator* pAllocator, _CompactString* pCompact, FX_LPCBYTE pStr, int len)
+{
+ if (len < (int)sizeof(_CompactString)) {
+ pCompact->m_CompactLen = (FX_BYTE)len;
+ FXSYS_memcpy32(&pCompact->m_LenHigh, pStr, len);
+ return;
+ }
+ pCompact->m_CompactLen = 0xff;
+ pCompact->m_LenHigh = len / 256;
+ pCompact->m_LenLow = len % 256;
+ pCompact->m_pBuffer = FX_Allocator_Alloc(pAllocator, FX_BYTE, len);
+ if (pCompact->m_pBuffer) {
+ FXSYS_memcpy32(pCompact->m_pBuffer, pStr, len);
+ }
+}
+static CFX_ByteStringC _CompactStringGet(_CompactString* pCompact)
+{
+ if (pCompact->m_CompactLen == 0xff) {
+ return CFX_ByteStringC(pCompact->m_pBuffer, pCompact->m_LenHigh * 256 + pCompact->m_LenLow);
+ }
+ if (pCompact->m_CompactLen == 0xfe) {
+ return CFX_ByteStringC();
+ }
+ return CFX_ByteStringC(&pCompact->m_LenHigh, pCompact->m_CompactLen);
+}
+#define CMAP_ALLOC_STEP 8
+#define CMAP_INDEX_SIZE 8
+CFX_CMapByteStringToPtr::CFX_CMapByteStringToPtr(IFX_Allocator* pAllocator)
+ : m_Buffer(sizeof(_CompactString) + sizeof(void*), CMAP_ALLOC_STEP, CMAP_INDEX_SIZE, pAllocator)
+{
+}
+CFX_CMapByteStringToPtr::~CFX_CMapByteStringToPtr()
+{
+ RemoveAll();
+}
+void CFX_CMapByteStringToPtr::RemoveAll()
+{
+ IFX_Allocator* pAllocator = m_Buffer.m_pAllocator;
+ int size = m_Buffer.GetSize();
+ for (int i = 0; i < size; i ++) {
+ _CompactStringRelease(pAllocator, (_CompactString*)m_Buffer.GetAt(i));
+ }
+ m_Buffer.RemoveAll();
+}
+FX_POSITION CFX_CMapByteStringToPtr::GetStartPosition() const
+{
+ int size = m_Buffer.GetSize();
+ for (int i = 0; i < size; i ++) {
+ _CompactString* pKey = (_CompactString*)m_Buffer.GetAt(i);
+ if (pKey->m_CompactLen != 0xfe) {
+ return (FX_POSITION)(FX_UINTPTR)(i + 1);
+ }
+ }
+ return NULL;
+}
+void CFX_CMapByteStringToPtr::GetNextAssoc(FX_POSITION& rNextPosition, CFX_ByteString& rKey, void*& rValue) const
+{
+ if (rNextPosition == NULL) {
+ return;
+ }
+ int index = (int)(FX_UINTPTR)rNextPosition - 1;
+ _CompactString* pKey = (_CompactString*)m_Buffer.GetAt(index);
+ rKey = _CompactStringGet(pKey);
+ rValue = *(void**)(pKey + 1);
+ index ++;
+ int size = m_Buffer.GetSize();
+ while (index < size) {
+ pKey = (_CompactString*)m_Buffer.GetAt(index);
+ if (pKey->m_CompactLen != 0xfe) {
+ rNextPosition = (FX_POSITION)(FX_UINTPTR)(index + 1);
+ return;
+ }
+ index ++;
+ }
+ rNextPosition = NULL;
+}
+FX_LPVOID CFX_CMapByteStringToPtr::GetNextValue(FX_POSITION& rNextPosition) const
+{
+ if (rNextPosition == NULL) {
+ return NULL;
+ }
+ int index = (int)(FX_UINTPTR)rNextPosition - 1;
+ _CompactString* pKey = (_CompactString*)m_Buffer.GetAt(index);
+ FX_LPVOID rValue = *(void**)(pKey + 1);
+ index ++;
+ int size = m_Buffer.GetSize();
+ while (index < size) {
+ pKey = (_CompactString*)m_Buffer.GetAt(index);
+ if (pKey->m_CompactLen != 0xfe) {
+ rNextPosition = (FX_POSITION)(FX_UINTPTR)(index + 1);
+ return rValue;
+ }
+ index ++;
+ }
+ rNextPosition = NULL;
+ return rValue;
+}
+FX_BOOL _CMapLookupCallback(void* param, void* pData)
+{
+ return !_CompactStringSame((_CompactString*)pData, ((CFX_ByteStringC*)param)->GetPtr(), ((CFX_ByteStringC*)param)->GetLength());
+}
+FX_BOOL CFX_CMapByteStringToPtr::Lookup(FX_BSTR key, void*& rValue) const
+{
+ void* p = m_Buffer.Iterate(_CMapLookupCallback, (void*)&key);
+ if (!p) {
+ return FALSE;
+ }
+ rValue = *(void**)((_CompactString*)p + 1);
+ return TRUE;
+}
+void CFX_CMapByteStringToPtr::SetAt(FX_BSTR key, void* value)
+{
+ ASSERT(value != NULL);
+ int index, key_len = key.GetLength();
+ int size = m_Buffer.GetSize();
+ for (index = 0; index < size; index ++) {
+ _CompactString* pKey = (_CompactString*)m_Buffer.GetAt(index);
+ if (!_CompactStringSame(pKey, (FX_LPCBYTE)key, key_len)) {
+ continue;
+ }
+ *(void**)(pKey + 1) = value;
+ return;
+ }
+ IFX_Allocator* pAllocator = m_Buffer.m_pAllocator;
+ for (index = 0; index < size; index ++) {
+ _CompactString* pKey = (_CompactString*)m_Buffer.GetAt(index);
+ if (pKey->m_CompactLen) {
+ continue;
+ }
+ _CompactStringStore(pAllocator, pKey, (FX_LPCBYTE)key, key_len);
+ *(void**)(pKey + 1) = value;
+ return;
+ }
+ _CompactString* pKey = (_CompactString*)m_Buffer.Add();
+ _CompactStringStore(pAllocator, pKey, (FX_LPCBYTE)key, key_len);
+ *(void**)(pKey + 1) = value;
+}
+void CFX_CMapByteStringToPtr::AddValue(FX_BSTR key, void* value)
+{
+ ASSERT(value != NULL);
+ _CompactString* pKey = (_CompactString*)m_Buffer.Add();
+ _CompactStringStore(m_Buffer.m_pAllocator, pKey, (FX_LPCBYTE)key, key.GetLength());
+ *(void**)(pKey + 1) = value;
+}
+void CFX_CMapByteStringToPtr::RemoveKey(FX_BSTR key)
+{
+ int key_len = key.GetLength();
+ IFX_Allocator* pAllocator = m_Buffer.m_pAllocator;
+ int size = m_Buffer.GetSize();
+ for (int index = 0; index < size; index ++) {
+ _CompactString* pKey = (_CompactString*)m_Buffer.GetAt(index);
+ if (!_CompactStringSame(pKey, (FX_LPCBYTE)key, key_len)) {
+ continue;
+ }
+ _CompactStringRelease(pAllocator, pKey);
+ pKey->m_CompactLen = 0xfe;
+ return;
+ }
+}
+int CFX_CMapByteStringToPtr::GetCount() const
+{
+ int count = 0;
+ int size = m_Buffer.GetSize();
+ for (int i = 0; i < size; i ++) {
+ _CompactString* pKey = (_CompactString*)m_Buffer.GetAt(i);
+ if (pKey->m_CompactLen != 0xfe) {
+ count ++;
+ }
+ }
+ return count;
+}
+extern "C" {
+ static int _CompareDWord(const void* p1, const void* p2)
+ {
+ return (*(FX_DWORD*)p1) - (*(FX_DWORD*)p2);
+ }
+};
+struct _DWordPair {
+ FX_DWORD key;
+ FX_DWORD value;
+};
+FX_BOOL CFX_CMapDWordToDWord::Lookup(FX_DWORD key, FX_DWORD& value) const
+{
+ FX_LPVOID pResult = FXSYS_bsearch(&key, m_Buffer.GetBuffer(), m_Buffer.GetSize() / sizeof(_DWordPair),
+ sizeof(_DWordPair), _CompareDWord);
+ if (pResult == NULL) {
+ return FALSE;
+ }
+ value = ((FX_DWORD*)pResult)[1];
+ return TRUE;
+}
+FX_POSITION CFX_CMapDWordToDWord::GetStartPosition() const
+{
+ FX_DWORD count = m_Buffer.GetSize() / sizeof(_DWordPair);
+ if (count == 0) {
+ return NULL;
+ }
+ return (FX_POSITION)1;
+}
+void CFX_CMapDWordToDWord::GetNextAssoc(FX_POSITION& pos, FX_DWORD& key, FX_DWORD& value) const
+{
+ if (pos == 0) {
+ return;
+ }
+ FX_DWORD index = ((FX_DWORD)(FX_UINTPTR)pos) - 1;
+ FX_DWORD count = m_Buffer.GetSize() / sizeof(_DWordPair);
+ _DWordPair* buf = (_DWordPair*)m_Buffer.GetBuffer();
+ key = buf[index].key;
+ value = buf[index].value;
+ if (index == count - 1) {
+ pos = 0;
+ } else {
+ pos = (FX_POSITION)((FX_UINTPTR)pos + 1);
+ }
+}
+void CFX_CMapDWordToDWord::SetAt(FX_DWORD key, FX_DWORD value)
+{
+ FX_DWORD count = m_Buffer.GetSize() / sizeof(_DWordPair);
+ _DWordPair* buf = (_DWordPair*)m_Buffer.GetBuffer();
+ _DWordPair pair = {key, value};
+ if (count == 0 || key > buf[count - 1].key) {
+ m_Buffer.AppendBlock(&pair, sizeof(_DWordPair));
+ return;
+ }
+ int low = 0, high = count - 1;
+ while (low <= high) {
+ int mid = (low + high) / 2;
+ if (buf[mid].key < key) {
+ low = mid + 1;
+ } else if (buf[mid].key > key) {
+ high = mid - 1;
+ } else {
+ buf[mid].value = value;
+ return;
+ }
+ }
+ m_Buffer.InsertBlock(low * sizeof(_DWordPair), &pair, sizeof(_DWordPair));
+}
+void CFX_CMapDWordToDWord::EstimateSize(FX_DWORD size, FX_DWORD grow_by)
+{
+ m_Buffer.EstimateSize(size, grow_by);
+}
diff --git a/core/src/fxcrt/fx_basic_memmgr.cpp b/core/src/fxcrt/fx_basic_memmgr.cpp
index 34df829060..5c862a2db5 100644
--- a/core/src/fxcrt/fx_basic_memmgr.cpp
+++ b/core/src/fxcrt/fx_basic_memmgr.cpp
@@ -1,306 +1,306 @@
-// 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
-
-#include "../../include/fxcrt/fx_basic.h"
-#include "mem_int.h"
-void FXMEM_DestroyFoxitMgr(FXMEM_FoxitMgr* pFoxitMgr)
-{
- if (pFoxitMgr == NULL) {
- return;
- }
- CFX_MemoryMgr* p = (CFX_MemoryMgr*)pFoxitMgr;
- if (p->m_pSystemMgr->CollectAll) {
- p->m_pSystemMgr->CollectAll(p->m_pSystemMgr);
- }
- if (p->m_bReleaseMgr) {
- p->m_pSystemMgr->Free(p->m_pSystemMgr, p, 0);
- }
- if (p->m_pExternalMemory) {
- free(p->m_pExternalMemory);
- }
-}
-#ifdef __cplusplus
-extern "C" {
-#endif
-static void* _DefAllocDebug(IFX_Allocator* pAllocator, size_t size, FX_LPCSTR filename, int line)
-{
- return ((FX_DefAllocator*)pAllocator)->m_pFoxitMgr->AllocDebug(size, 0, filename, line);
-}
-static void* _DefAlloc(IFX_Allocator* pAllocator, size_t size)
-{
- return ((FX_DefAllocator*)pAllocator)->m_pFoxitMgr->Alloc(size, 0);
-}
-static void* _DefReallocDebug(IFX_Allocator* pAllocator, void* p, size_t size, FX_LPCSTR filename, int line)
-{
- return ((FX_DefAllocator*)pAllocator)->m_pFoxitMgr->ReallocDebug(p, size, 0, filename, line);
-}
-static void* _DefRealloc(IFX_Allocator* pAllocator, void* p, size_t size)
-{
- return ((FX_DefAllocator*)pAllocator)->m_pFoxitMgr->Realloc(p, size, 0);
-}
-static void _DefFree(IFX_Allocator* pAllocator, void* p)
-{
- ((FX_DefAllocator*)pAllocator)->m_pFoxitMgr->Free(p, 0);
-}
-#ifdef __cplusplus
-}
-#endif
-void CFX_MemoryMgr::Init(FXMEM_SystemMgr* pSystemMgr)
-{
- m_pSystemMgr = pSystemMgr;
- IFX_Allocator &ac = m_DefAllocator.m_Allocator;
- ac.m_Alloc = _DefAlloc;
- ac.m_AllocDebug = _DefAllocDebug;
- ac.m_Realloc = _DefRealloc;
- ac.m_ReallocDebug = _DefReallocDebug;
- ac.m_Free = _DefFree;
- m_DefAllocator.m_pFoxitMgr = this;
- m_pExternalMemory = NULL;
- m_bReleaseMgr = TRUE;
-}
-void CFX_MemoryMgr::PurgeMgr()
-{
- if (m_pSystemMgr->Purge) {
- m_pSystemMgr->Purge(m_pSystemMgr);
- }
-}
-void* CFX_MemoryMgr::Alloc(size_t size, int flags)
-{
- void* p = m_pSystemMgr->Alloc(m_pSystemMgr, size, flags);
- if (p == NULL) {
- return NULL;
- }
- return p;
-}
-void* CFX_MemoryMgr::AllocDebug(size_t size, int flags, FX_LPCSTR file, int line)
-{
- void* p = m_pSystemMgr->AllocDebug(m_pSystemMgr, size, flags, file, line);
- if (p == NULL) {
- return NULL;
- }
- return p;
-}
-void* CFX_MemoryMgr::Realloc(void* p, size_t size, int flags)
-{
- void* p1 = m_pSystemMgr->Realloc(m_pSystemMgr, p, size, flags);
- if (p1 == NULL) {
- return NULL;
- }
- return p1;
-}
-void* CFX_MemoryMgr::ReallocDebug(void* p, size_t size, int flags, FX_LPCSTR file, int line)
-{
- void* p1 = m_pSystemMgr->ReallocDebug(m_pSystemMgr, p, size, flags, file, line);
- if (p1 == NULL) {
- return NULL;
- }
- return p1;
-}
-void CFX_MemoryMgr::Free(void* p, int flags)
-{
- if (p == NULL) {
- return;
- }
- m_pSystemMgr->Free(m_pSystemMgr, p, flags);
-}
-CFX_MemoryMgr* g_pDefFoxitMgr = NULL;
-void* FXMEM_DefaultAlloc(size_t size, int flags)
-{
- return g_pDefFoxitMgr->Alloc(size, flags);
-}
-void* FXMEM_DefaultAlloc2(size_t size, size_t unit, int flags)
-{
- return g_pDefFoxitMgr->Alloc(size * unit, flags);
-}
-void* FXMEM_DefaultRealloc(void* p, size_t size, int flags)
-{
- if (p == NULL) {
- return FXMEM_DefaultAlloc(size, flags);
- }
- return g_pDefFoxitMgr->Realloc(p, size, flags);
-}
-void* FXMEM_DefaultRealloc2(void* p, size_t size, size_t unit, int flags)
-{
- if (p == NULL) {
- return FXMEM_DefaultAlloc2(size, unit, flags);
- }
- return g_pDefFoxitMgr->Realloc(p, size * unit, flags);
-}
-void* FXMEM_DefaultAllocDebug(size_t size, int flags, FX_LPCSTR file, int line)
-{
- return g_pDefFoxitMgr->AllocDebug(size, flags, file, line);
-}
-void* FXMEM_DefaultAllocDebug2(size_t size, size_t unit, int flags, FX_LPCSTR file, int line)
-{
- return g_pDefFoxitMgr->AllocDebug(size * unit, flags, file, line);
-}
-void* FXMEM_DefaultReallocDebug(void* p, size_t size, int flags, FX_LPCSTR file, int line)
-{
- if (p == NULL) {
- return FXMEM_DefaultAllocDebug(size, flags, file, line);
- }
- return g_pDefFoxitMgr->ReallocDebug(p, size, flags, file, line);
-}
-void* FXMEM_DefaultReallocDebug2(void* p, size_t size, size_t unit, int flags, FX_LPCSTR file, int line)
-{
- if (p == NULL) {
- return FXMEM_DefaultAllocDebug2(size, unit, flags, file, line);
- }
- return g_pDefFoxitMgr->ReallocDebug(p, size * unit, flags, file, line);
-}
-void FXMEM_DefaultFree(void* p, int flags)
-{
- g_pDefFoxitMgr->Free(p, flags);
-}
-IFX_Allocator* FXMEM_GetDefAllocator()
-{
- return &g_pDefFoxitMgr->m_DefAllocator.m_Allocator;
-}
-void* CFX_Object::operator new(size_t size)
-{
- return g_pDefFoxitMgr->Alloc(size, 0);
-}
-void* CFX_Object::operator new[](size_t size)
-{
- return g_pDefFoxitMgr->Alloc(size, 0);
-}
-void* CFX_Object::operator new[](size_t size, FX_LPCSTR file, int line)
-{
- return g_pDefFoxitMgr->AllocDebug(size, 0, file, line);
-}
-void* CFX_Object::operator new(size_t size, FX_LPCSTR file, int line)
-{
- return g_pDefFoxitMgr->AllocDebug(size, 0, file, line);
-}
-void CFX_Object::operator delete(void* p)
-{
- g_pDefFoxitMgr->Free(p, 0);
-}
-void CFX_Object::operator delete[](void* p)
-{
- g_pDefFoxitMgr->Free(p, 0);
-}
-void CFX_Object::operator delete(void* p, FX_LPCSTR file, int line)
-{
- g_pDefFoxitMgr->Free(p, 0);
-}
-void CFX_Object::operator delete[](void* p, FX_LPCSTR file, int line)
-{
- g_pDefFoxitMgr->Free(p, 0);
-}
-void* CFX_AllocObject::operator new(size_t size, IFX_Allocator* pAllocator, FX_LPCSTR filename, int line)
-{
- void* p = pAllocator ? pAllocator->m_AllocDebug(pAllocator, size, filename, line) :
- g_pDefFoxitMgr->AllocDebug(size, 0, filename, line);
- ((CFX_AllocObject*)p)->m_pAllocator = pAllocator;
- return p;
-}
-void CFX_AllocObject::operator delete (void* p, IFX_Allocator* pAllocator, FX_LPCSTR filename, int line)
-{
- if (pAllocator) {
- pAllocator->m_Free(pAllocator, p);
- } else {
- g_pDefFoxitMgr->Free(p, 0);
- }
-}
-void* CFX_AllocObject::operator new(size_t size, IFX_Allocator* pAllocator)
-{
- void* p = pAllocator ? pAllocator->m_Alloc(pAllocator, size) : g_pDefFoxitMgr->Alloc(size, 0);
- ((CFX_AllocObject*)p)->m_pAllocator = pAllocator;
- return p;
-}
-void CFX_AllocObject::operator delete(void* p)
-{
- if (((CFX_AllocObject*)p)->m_pAllocator) {
- (((CFX_AllocObject*)p)->m_pAllocator)->m_Free(((CFX_AllocObject*)p)->m_pAllocator, p);
- } else {
- g_pDefFoxitMgr->Free(p, 0);
- }
-}
-void CFX_AllocObject::operator delete(void* p, IFX_Allocator* pAllocator)
-{
- if (pAllocator) {
- pAllocator->m_Free(pAllocator, p);
- } else {
- g_pDefFoxitMgr->Free(p, 0);
- }
-}
-extern "C" {
- static void* _GOPAllocDebug(IFX_Allocator* pAllocator, size_t size, FX_LPCSTR file, int line)
- {
- return ((CFX_GrowOnlyPool*)pAllocator)->Alloc(size);
- }
- static void* _GOPAlloc(IFX_Allocator* pAllocator, size_t size)
- {
- return ((CFX_GrowOnlyPool*)pAllocator)->Alloc(size);
- }
- static void* _GOPReallocDebug(IFX_Allocator* pAllocator, void* p, size_t new_size, FX_LPCSTR file, int line)
- {
- return ((CFX_GrowOnlyPool*)pAllocator)->Realloc(p, new_size);
- }
- static void* _GOPRealloc(IFX_Allocator* pAllocator, void* p, size_t new_size)
- {
- return ((CFX_GrowOnlyPool*)pAllocator)->Realloc(p, new_size);
- }
- static void _GOPFree(IFX_Allocator* pAllocator, void* p)
- {
- }
-};
-CFX_GrowOnlyPool::CFX_GrowOnlyPool(IFX_Allocator* pAllocator, size_t trunk_size)
-{
- m_TrunkSize = trunk_size;
- m_pFirstTrunk = NULL;
- m_pAllocator = pAllocator ? pAllocator : &g_pDefFoxitMgr->m_DefAllocator.m_Allocator;
- m_AllocDebug = _GOPAllocDebug;
- m_Alloc = _GOPAlloc;
- m_ReallocDebug = _GOPReallocDebug;
- m_Realloc = _GOPRealloc;
- m_Free = _GOPFree;
-}
-CFX_GrowOnlyPool::~CFX_GrowOnlyPool()
-{
- FreeAll();
-}
-void CFX_GrowOnlyPool::SetAllocator(IFX_Allocator* pAllocator)
-{
- ASSERT(m_pFirstTrunk == NULL);
- m_pAllocator = pAllocator ? pAllocator : &g_pDefFoxitMgr->m_DefAllocator.m_Allocator;
-}
-struct _FX_GrowOnlyTrunk {
- size_t m_Size;
- size_t m_Allocated;
- _FX_GrowOnlyTrunk* m_pNext;
-};
-void CFX_GrowOnlyPool::FreeAll()
-{
- _FX_GrowOnlyTrunk* pTrunk = (_FX_GrowOnlyTrunk*)m_pFirstTrunk;
- while (pTrunk) {
- _FX_GrowOnlyTrunk* pNext = pTrunk->m_pNext;
- m_pAllocator->m_Free(m_pAllocator, pTrunk);
- pTrunk = pNext;
- }
- m_pFirstTrunk = NULL;
-}
-void* CFX_GrowOnlyPool::Alloc(size_t size)
-{
- size = (size + 3) / 4 * 4;
- _FX_GrowOnlyTrunk* pTrunk = (_FX_GrowOnlyTrunk*)m_pFirstTrunk;
- while (pTrunk) {
- if (pTrunk->m_Size - pTrunk->m_Allocated >= size) {
- void* p = (FX_LPBYTE)(pTrunk + 1) + pTrunk->m_Allocated;
- pTrunk->m_Allocated += size;
- return p;
- }
- pTrunk = pTrunk->m_pNext;
- }
- size_t alloc_size = size > m_TrunkSize ? size : m_TrunkSize;
- pTrunk = (_FX_GrowOnlyTrunk*)m_pAllocator->m_Alloc(m_pAllocator, sizeof(_FX_GrowOnlyTrunk) + alloc_size);
- pTrunk->m_Size = alloc_size;
- pTrunk->m_Allocated = size;
- pTrunk->m_pNext = (_FX_GrowOnlyTrunk*)m_pFirstTrunk;
- m_pFirstTrunk = pTrunk;
- return pTrunk + 1;
-}
+// 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
+
+#include "../../include/fxcrt/fx_basic.h"
+#include "mem_int.h"
+void FXMEM_DestroyFoxitMgr(FXMEM_FoxitMgr* pFoxitMgr)
+{
+ if (pFoxitMgr == NULL) {
+ return;
+ }
+ CFX_MemoryMgr* p = (CFX_MemoryMgr*)pFoxitMgr;
+ if (p->m_pSystemMgr->CollectAll) {
+ p->m_pSystemMgr->CollectAll(p->m_pSystemMgr);
+ }
+ if (p->m_bReleaseMgr) {
+ p->m_pSystemMgr->Free(p->m_pSystemMgr, p, 0);
+ }
+ if (p->m_pExternalMemory) {
+ free(p->m_pExternalMemory);
+ }
+}
+#ifdef __cplusplus
+extern "C" {
+#endif
+static void* _DefAllocDebug(IFX_Allocator* pAllocator, size_t size, FX_LPCSTR filename, int line)
+{
+ return ((FX_DefAllocator*)pAllocator)->m_pFoxitMgr->AllocDebug(size, 0, filename, line);
+}
+static void* _DefAlloc(IFX_Allocator* pAllocator, size_t size)
+{
+ return ((FX_DefAllocator*)pAllocator)->m_pFoxitMgr->Alloc(size, 0);
+}
+static void* _DefReallocDebug(IFX_Allocator* pAllocator, void* p, size_t size, FX_LPCSTR filename, int line)
+{
+ return ((FX_DefAllocator*)pAllocator)->m_pFoxitMgr->ReallocDebug(p, size, 0, filename, line);
+}
+static void* _DefRealloc(IFX_Allocator* pAllocator, void* p, size_t size)
+{
+ return ((FX_DefAllocator*)pAllocator)->m_pFoxitMgr->Realloc(p, size, 0);
+}
+static void _DefFree(IFX_Allocator* pAllocator, void* p)
+{
+ ((FX_DefAllocator*)pAllocator)->m_pFoxitMgr->Free(p, 0);
+}
+#ifdef __cplusplus
+}
+#endif
+void CFX_MemoryMgr::Init(FXMEM_SystemMgr* pSystemMgr)
+{
+ m_pSystemMgr = pSystemMgr;
+ IFX_Allocator &ac = m_DefAllocator.m_Allocator;
+ ac.m_Alloc = _DefAlloc;
+ ac.m_AllocDebug = _DefAllocDebug;
+ ac.m_Realloc = _DefRealloc;
+ ac.m_ReallocDebug = _DefReallocDebug;
+ ac.m_Free = _DefFree;
+ m_DefAllocator.m_pFoxitMgr = this;
+ m_pExternalMemory = NULL;
+ m_bReleaseMgr = TRUE;
+}
+void CFX_MemoryMgr::PurgeMgr()
+{
+ if (m_pSystemMgr->Purge) {
+ m_pSystemMgr->Purge(m_pSystemMgr);
+ }
+}
+void* CFX_MemoryMgr::Alloc(size_t size, int flags)
+{
+ void* p = m_pSystemMgr->Alloc(m_pSystemMgr, size, flags);
+ if (p == NULL) {
+ return NULL;
+ }
+ return p;
+}
+void* CFX_MemoryMgr::AllocDebug(size_t size, int flags, FX_LPCSTR file, int line)
+{
+ void* p = m_pSystemMgr->AllocDebug(m_pSystemMgr, size, flags, file, line);
+ if (p == NULL) {
+ return NULL;
+ }
+ return p;
+}
+void* CFX_MemoryMgr::Realloc(void* p, size_t size, int flags)
+{
+ void* p1 = m_pSystemMgr->Realloc(m_pSystemMgr, p, size, flags);
+ if (p1 == NULL) {
+ return NULL;
+ }
+ return p1;
+}
+void* CFX_MemoryMgr::ReallocDebug(void* p, size_t size, int flags, FX_LPCSTR file, int line)
+{
+ void* p1 = m_pSystemMgr->ReallocDebug(m_pSystemMgr, p, size, flags, file, line);
+ if (p1 == NULL) {
+ return NULL;
+ }
+ return p1;
+}
+void CFX_MemoryMgr::Free(void* p, int flags)
+{
+ if (p == NULL) {
+ return;
+ }
+ m_pSystemMgr->Free(m_pSystemMgr, p, flags);
+}
+CFX_MemoryMgr* g_pDefFoxitMgr = NULL;
+void* FXMEM_DefaultAlloc(size_t size, int flags)
+{
+ return g_pDefFoxitMgr->Alloc(size, flags);
+}
+void* FXMEM_DefaultAlloc2(size_t size, size_t unit, int flags)
+{
+ return g_pDefFoxitMgr->Alloc(size * unit, flags);
+}
+void* FXMEM_DefaultRealloc(void* p, size_t size, int flags)
+{
+ if (p == NULL) {
+ return FXMEM_DefaultAlloc(size, flags);
+ }
+ return g_pDefFoxitMgr->Realloc(p, size, flags);
+}
+void* FXMEM_DefaultRealloc2(void* p, size_t size, size_t unit, int flags)
+{
+ if (p == NULL) {
+ return FXMEM_DefaultAlloc2(size, unit, flags);
+ }
+ return g_pDefFoxitMgr->Realloc(p, size * unit, flags);
+}
+void* FXMEM_DefaultAllocDebug(size_t size, int flags, FX_LPCSTR file, int line)
+{
+ return g_pDefFoxitMgr->AllocDebug(size, flags, file, line);
+}
+void* FXMEM_DefaultAllocDebug2(size_t size, size_t unit, int flags, FX_LPCSTR file, int line)
+{
+ return g_pDefFoxitMgr->AllocDebug(size * unit, flags, file, line);
+}
+void* FXMEM_DefaultReallocDebug(void* p, size_t size, int flags, FX_LPCSTR file, int line)
+{
+ if (p == NULL) {
+ return FXMEM_DefaultAllocDebug(size, flags, file, line);
+ }
+ return g_pDefFoxitMgr->ReallocDebug(p, size, flags, file, line);
+}
+void* FXMEM_DefaultReallocDebug2(void* p, size_t size, size_t unit, int flags, FX_LPCSTR file, int line)
+{
+ if (p == NULL) {
+ return FXMEM_DefaultAllocDebug2(size, unit, flags, file, line);
+ }
+ return g_pDefFoxitMgr->ReallocDebug(p, size * unit, flags, file, line);
+}
+void FXMEM_DefaultFree(void* p, int flags)
+{
+ g_pDefFoxitMgr->Free(p, flags);
+}
+IFX_Allocator* FXMEM_GetDefAllocator()
+{
+ return &g_pDefFoxitMgr->m_DefAllocator.m_Allocator;
+}
+void* CFX_Object::operator new(size_t size)
+{
+ return g_pDefFoxitMgr->Alloc(size, 0);
+}
+void* CFX_Object::operator new[](size_t size)
+{
+ return g_pDefFoxitMgr->Alloc(size, 0);
+}
+void* CFX_Object::operator new[](size_t size, FX_LPCSTR file, int line)
+{
+ return g_pDefFoxitMgr->AllocDebug(size, 0, file, line);
+}
+void* CFX_Object::operator new(size_t size, FX_LPCSTR file, int line)
+{
+ return g_pDefFoxitMgr->AllocDebug(size, 0, file, line);
+}
+void CFX_Object::operator delete(void* p)
+{
+ g_pDefFoxitMgr->Free(p, 0);
+}
+void CFX_Object::operator delete[](void* p)
+{
+ g_pDefFoxitMgr->Free(p, 0);
+}
+void CFX_Object::operator delete(void* p, FX_LPCSTR file, int line)
+{
+ g_pDefFoxitMgr->Free(p, 0);
+}
+void CFX_Object::operator delete[](void* p, FX_LPCSTR file, int line)
+{
+ g_pDefFoxitMgr->Free(p, 0);
+}
+void* CFX_AllocObject::operator new(size_t size, IFX_Allocator* pAllocator, FX_LPCSTR filename, int line)
+{
+ void* p = pAllocator ? pAllocator->m_AllocDebug(pAllocator, size, filename, line) :
+ g_pDefFoxitMgr->AllocDebug(size, 0, filename, line);
+ ((CFX_AllocObject*)p)->m_pAllocator = pAllocator;
+ return p;
+}
+void CFX_AllocObject::operator delete (void* p, IFX_Allocator* pAllocator, FX_LPCSTR filename, int line)
+{
+ if (pAllocator) {
+ pAllocator->m_Free(pAllocator, p);
+ } else {
+ g_pDefFoxitMgr->Free(p, 0);
+ }
+}
+void* CFX_AllocObject::operator new(size_t size, IFX_Allocator* pAllocator)
+{
+ void* p = pAllocator ? pAllocator->m_Alloc(pAllocator, size) : g_pDefFoxitMgr->Alloc(size, 0);
+ ((CFX_AllocObject*)p)->m_pAllocator = pAllocator;
+ return p;
+}
+void CFX_AllocObject::operator delete(void* p)
+{
+ if (((CFX_AllocObject*)p)->m_pAllocator) {
+ (((CFX_AllocObject*)p)->m_pAllocator)->m_Free(((CFX_AllocObject*)p)->m_pAllocator, p);
+ } else {
+ g_pDefFoxitMgr->Free(p, 0);
+ }
+}
+void CFX_AllocObject::operator delete(void* p, IFX_Allocator* pAllocator)
+{
+ if (pAllocator) {
+ pAllocator->m_Free(pAllocator, p);
+ } else {
+ g_pDefFoxitMgr->Free(p, 0);
+ }
+}
+extern "C" {
+ static void* _GOPAllocDebug(IFX_Allocator* pAllocator, size_t size, FX_LPCSTR file, int line)
+ {
+ return ((CFX_GrowOnlyPool*)pAllocator)->Alloc(size);
+ }
+ static void* _GOPAlloc(IFX_Allocator* pAllocator, size_t size)
+ {
+ return ((CFX_GrowOnlyPool*)pAllocator)->Alloc(size);
+ }
+ static void* _GOPReallocDebug(IFX_Allocator* pAllocator, void* p, size_t new_size, FX_LPCSTR file, int line)
+ {
+ return ((CFX_GrowOnlyPool*)pAllocator)->Realloc(p, new_size);
+ }
+ static void* _GOPRealloc(IFX_Allocator* pAllocator, void* p, size_t new_size)
+ {
+ return ((CFX_GrowOnlyPool*)pAllocator)->Realloc(p, new_size);
+ }
+ static void _GOPFree(IFX_Allocator* pAllocator, void* p)
+ {
+ }
+};
+CFX_GrowOnlyPool::CFX_GrowOnlyPool(IFX_Allocator* pAllocator, size_t trunk_size)
+{
+ m_TrunkSize = trunk_size;
+ m_pFirstTrunk = NULL;
+ m_pAllocator = pAllocator ? pAllocator : &g_pDefFoxitMgr->m_DefAllocator.m_Allocator;
+ m_AllocDebug = _GOPAllocDebug;
+ m_Alloc = _GOPAlloc;
+ m_ReallocDebug = _GOPReallocDebug;
+ m_Realloc = _GOPRealloc;
+ m_Free = _GOPFree;
+}
+CFX_GrowOnlyPool::~CFX_GrowOnlyPool()
+{
+ FreeAll();
+}
+void CFX_GrowOnlyPool::SetAllocator(IFX_Allocator* pAllocator)
+{
+ ASSERT(m_pFirstTrunk == NULL);
+ m_pAllocator = pAllocator ? pAllocator : &g_pDefFoxitMgr->m_DefAllocator.m_Allocator;
+}
+struct _FX_GrowOnlyTrunk {
+ size_t m_Size;
+ size_t m_Allocated;
+ _FX_GrowOnlyTrunk* m_pNext;
+};
+void CFX_GrowOnlyPool::FreeAll()
+{
+ _FX_GrowOnlyTrunk* pTrunk = (_FX_GrowOnlyTrunk*)m_pFirstTrunk;
+ while (pTrunk) {
+ _FX_GrowOnlyTrunk* pNext = pTrunk->m_pNext;
+ m_pAllocator->m_Free(m_pAllocator, pTrunk);
+ pTrunk = pNext;
+ }
+ m_pFirstTrunk = NULL;
+}
+void* CFX_GrowOnlyPool::Alloc(size_t size)
+{
+ size = (size + 3) / 4 * 4;
+ _FX_GrowOnlyTrunk* pTrunk = (_FX_GrowOnlyTrunk*)m_pFirstTrunk;
+ while (pTrunk) {
+ if (pTrunk->m_Size - pTrunk->m_Allocated >= size) {
+ void* p = (FX_LPBYTE)(pTrunk + 1) + pTrunk->m_Allocated;
+ pTrunk->m_Allocated += size;
+ return p;
+ }
+ pTrunk = pTrunk->m_pNext;
+ }
+ size_t alloc_size = size > m_TrunkSize ? size : m_TrunkSize;
+ pTrunk = (_FX_GrowOnlyTrunk*)m_pAllocator->m_Alloc(m_pAllocator, sizeof(_FX_GrowOnlyTrunk) + alloc_size);
+ pTrunk->m_Size = alloc_size;
+ pTrunk->m_Allocated = size;
+ pTrunk->m_pNext = (_FX_GrowOnlyTrunk*)m_pFirstTrunk;
+ m_pFirstTrunk = pTrunk;
+ return pTrunk + 1;
+}
diff --git a/core/src/fxcrt/fx_basic_memmgr_mini.cpp b/core/src/fxcrt/fx_basic_memmgr_mini.cpp
index f8385e20d2..8d48bab935 100644
--- a/core/src/fxcrt/fx_basic_memmgr_mini.cpp
+++ b/core/src/fxcrt/fx_basic_memmgr_mini.cpp
@@ -1,822 +1,822 @@
-// 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
-
-#include "../../include/fxcrt/fx_ext.h"
-#include "mem_int.h"
-#ifdef _FPDFAPI_MINI_
-static FX_MEMCONFIG g_MemConfig = {
- 1,
- 5,
- 8,
- 4,
- 12,
- 8,
- 2,
- 4,
- 32,
- 64,
-};
-#else
-static FX_MEMCONFIG g_MemConfig = {
- 1,
- 8,
- 24,
- 8,
- 32,
- 16,
- 4,
- 8,
- 128,
- 64,
-};
-#endif
-void FXMEM_SetConfig(const FX_MEMCONFIG* memConfig)
-{
- g_MemConfig = *memConfig;
-}
-#ifdef __cplusplus
-extern "C" {
-#endif
-static void* FixedAlloc(FXMEM_SystemMgr* pMgr, size_t size, int flags)
-{
- return ((CFXMEM_FixedMgr*)pMgr->user)->Alloc(size);
-}
-static void* FixedAllocDebug(FXMEM_SystemMgr* pMgr, size_t size, int flags, FX_LPCSTR file, int line)
-{
- return ((CFXMEM_FixedMgr*)pMgr->user)->Alloc(size);
-}
-static void* FixedRealloc(FXMEM_SystemMgr* pMgr, void* pointer, size_t size, int flags)
-{
- return ((CFXMEM_FixedMgr*)pMgr->user)->Realloc(pointer, size);
-}
-static void* FixedReallocDebug(FXMEM_SystemMgr* pMgr, void* pointer, size_t size, int flags, FX_LPCSTR file, int line)
-{
- return ((CFXMEM_FixedMgr*)pMgr->user)->Realloc(pointer, size);
-}
-static void FixedFree(FXMEM_SystemMgr* pMgr, void* pointer, int flags)
-{
- ((CFXMEM_FixedMgr*)pMgr->user)->Free(pointer);
-}
-static void FixedPurge(FXMEM_SystemMgr* pMgr)
-{
- ((CFXMEM_FixedMgr*)pMgr->user)->Purge();
-}
-static void FixedCollectAll(FXMEM_SystemMgr* pMgr)
-{
- ((CFXMEM_FixedMgr*)pMgr->user)->FreeAll();
-}
-#define FIXEDMEM_MINIMUMSIZE (1024 * 1024 * 8)
-FXMEM_FoxitMgr* FXMEM_CreateMemoryMgr(size_t size, FX_BOOL extensible)
-{
- if (size < FIXEDMEM_MINIMUMSIZE) {
- size = FIXEDMEM_MINIMUMSIZE;
- }
- FX_LPVOID pMemory = malloc(size);
- if (!pMemory) {
- return NULL;
- }
- CFixedMgr_Proxy* pProxy = (CFixedMgr_Proxy*)pMemory;
- size_t offsetSize = (sizeof(CFixedMgr_Proxy) + 15) / 16 * 16;
- FXMEM_FoxitMgr* pFoxitMgr = pProxy->Initialize((FX_LPBYTE)pProxy + offsetSize, size - offsetSize, extensible);
- if (!pFoxitMgr) {
- free(pMemory);
- return NULL;
- }
- g_pDefFoxitMgr = (CFX_MemoryMgr*)pFoxitMgr;
- g_pDefFoxitMgr->m_pExternalMemory = pMemory;
- return pFoxitMgr;
-}
-FXMEM_FoxitMgr* FXMEM_CreateFixedMgr(void* pMemory, size_t size, FXMEM_SystemMgr2* pSystemMgr)
-{
- if (pMemory == NULL || size < FX_FIXEDMEM_PAGESIZE) {
- return NULL;
- }
- if (!pSystemMgr && size >= FIXEDMEM_PROXYSIZE_1) {
- CFixedMgr_Proxy* pProxy = (CFixedMgr_Proxy*)pMemory;
- size_t offsetSize = (sizeof(CFixedMgr_Proxy) + 15) / 16 * 16;
- return pProxy->Initialize((FX_LPBYTE)pProxy + offsetSize, size - offsetSize, FALSE);
- }
- CFXMEM_FixedMgr* pHeader = (CFXMEM_FixedMgr*)pMemory;
- pHeader->Initialize(size);
- pHeader->m_pExtender = pSystemMgr;
- CFX_MemoryMgr* p = (CFX_MemoryMgr*)pHeader->Alloc(sizeof(CFX_MemoryMgr));
- if (p == NULL) {
- return NULL;
- }
- p->Init(&pHeader->m_SystemMgr);
- return (FXMEM_FoxitMgr*)p;
-}
-size_t FXMEM_GetBlockSizeInFixedMgr(FXMEM_FoxitMgr* pFoxitMgr, void* ptr)
-{
- return pFoxitMgr ? ((CFXMEM_FixedMgr*)((CFX_MemoryMgr*)pFoxitMgr)->m_pSystemMgr->user)->GetSize(ptr) : 0;
-}
-#ifdef __cplusplus
-}
-#endif
-const FX_MEMCONFIG g_ProxyMgr_MemConfigs[6] = {
- {1, 2, 4, 0, 2, 2, 2, 0, 0, 0},
- {1, 4, 8, 0, 2, 2, 2, 0, 0, 0},
- {1, 4, 16, 4, 8, 8, 2, 1, 16, 16},
- {1, 8, 24, 4, 12, 12, 4, 2, 32, 16},
- {1, 8, 24, 8, 16, 16, 4, 2, 64, 32},
- {1, 8, 24, 8, 24, 32, 4, 2, 128, 64},
-};
-const FX_MEMCONFIG* FixedMgr_GetConfig(size_t nSize)
-{
- int index = 5;
- if (nSize <= FIXEDMEM_PROXYSIZE_0) {
- index = 0;
- } else if (nSize <= FIXEDMEM_PROXYSIZE_1) {
- index = 1;
- } else if (nSize <= FIXEDMEM_PROXYSIZE_2) {
- index = 2;
- } else if (nSize <= FIXEDMEM_PROXYSIZE_3) {
- index = 3;
- } else if (nSize <= FIXEDMEM_PROXYSIZE_4) {
- index = 4;
- }
- return &g_ProxyMgr_MemConfigs[index];
-}
-FXMEM_FoxitMgr* CFixedMgr_Proxy::Initialize(FX_LPVOID pBuffer, size_t nSize, FX_BOOL bExtensible)
-{
- FXSYS_assert(pBuffer != NULL && nSize >= FIXEDMEM_PROXYSIZE_1 - sizeof(CFixedMgr_Proxy));
- FXMEM_SetConfig(FixedMgr_GetConfig(nSize));
- m_SystemMgr.More = &CFixedMgr_Proxy::Common_More;
- m_SystemMgr.Free = &CFixedMgr_Proxy::Common_Free;
- m_pFixedPage = (CFXMEM_Page*)((FX_LPBYTE)pBuffer + FIXEDMEM_PROXYSIZE_0);
- m_pFixedPage->Initialize(nSize - FIXEDMEM_PROXYSIZE_0);
- m_pBuffer = pBuffer;
- m_nSize = nSize;
- m_bExtensible = bExtensible;
- return FXMEM_CreateFixedMgr(pBuffer, FIXEDMEM_PROXYSIZE_0, &m_SystemMgr);
-}
-FX_BOOL CFixedMgr_Proxy::Common_More(FXMEM_SystemMgr2* pMgr, size_t alloc_size, void** new_memory, size_t* new_size)
-{
- CFixedMgr_Proxy* pProxyMgr = (CFixedMgr_Proxy*)pMgr;
- FXSYS_assert(pProxyMgr != NULL && pProxyMgr->m_pFixedPage != NULL);
- *new_size = alloc_size;
- *new_memory = pProxyMgr->m_pFixedPage->Alloc(alloc_size);
- if (*new_memory == NULL && pProxyMgr->m_bExtensible) {
- *new_memory = malloc(alloc_size);
- }
- return *new_memory != NULL;
-}
-void CFixedMgr_Proxy::Common_Free(FXMEM_SystemMgr2* pMgr, void* memory)
-{
- CFixedMgr_Proxy* pProxyMgr = (CFixedMgr_Proxy*)pMgr;
- FXSYS_assert(pProxyMgr != NULL && pProxyMgr->m_pFixedPage != NULL);
- if (memory > pProxyMgr->m_pBuffer && memory < (FX_LPBYTE)pProxyMgr->m_pBuffer + pProxyMgr->m_nSize) {
- pProxyMgr->m_pFixedPage->Free(memory);
- } else if (pProxyMgr->m_bExtensible) {
- free(memory);
- }
-}
-void CFXMEM_Page::Initialize(size_t size)
-{
- CFXMEM_Block *pFirstBlock = (CFXMEM_Block*)(this + 1);
- m_nAvailSize = size - sizeof(CFXMEM_Page) - sizeof(CFXMEM_Block);
- pFirstBlock->m_nBlockSize = m_nAvailSize;
- pFirstBlock->m_pNextBlock = NULL;
- m_AvailHead.m_nBlockSize = m_nAvailSize;
- m_AvailHead.m_pNextBlock = pFirstBlock;
- m_pLimitPos = (CFXMEM_Block*)((FX_LPBYTE)this + size);
-}
-FX_LPVOID CFXMEM_Page::Alloc(CFXMEM_Block* pPrevBlock, CFXMEM_Block* pNextBlock, size_t size, size_t oldsize)
-{
- size_t gap = pNextBlock->m_nBlockSize - size;
- if (gap <= 64 + sizeof(CFXMEM_Block)) {
- pPrevBlock->m_pNextBlock = pNextBlock->m_pNextBlock;
- m_nAvailSize -= pNextBlock->m_nBlockSize;
- } else {
- m_nAvailSize -= size + sizeof(CFXMEM_Block);
- pNextBlock->m_nBlockSize = size;
- CFXMEM_Block *pNewBlock = (CFXMEM_Block*)((FX_LPBYTE)(pNextBlock + 1) + size);
- pNewBlock->m_nBlockSize = gap - sizeof(CFXMEM_Block);
- pNewBlock->m_pNextBlock = pNextBlock->m_pNextBlock;
- pPrevBlock->m_pNextBlock = pNewBlock;
- }
- return (FX_LPVOID)(pNextBlock + 1);
-}
-FX_LPVOID CFXMEM_Page::Alloc(size_t size)
-{
- size_t oldsize = size;
-#if _FX_WORDSIZE_ == _FX_W64_
- size = (size + 31) / 32 * 32;
-#else
- size = (size + 7) / 8 * 8;
-#endif
- if (m_nAvailSize < size) {
- return NULL;
- }
- CFXMEM_Block *pNextBlock;
- CFXMEM_Block *pPrevBlock = &m_AvailHead;
- while (TRUE) {
- pNextBlock = pPrevBlock->m_pNextBlock;
- if (!pNextBlock) {
- return NULL;
- }
- if (pNextBlock->m_nBlockSize >= size) {
- break;
- }
- pPrevBlock = pNextBlock;
- }
- return Alloc(pPrevBlock, pNextBlock, size, oldsize);
-}
-FX_LPVOID CFXMEM_Page::Realloc(FX_LPVOID p, size_t oldSize, size_t newSize)
-{
- FXSYS_assert(p > (FX_LPVOID)this && p < (FX_LPVOID)m_pLimitPos);
- size_t oldnewSize = newSize;
-#if _FX_WORDSIZE_ == _FX_W64_
- newSize = (newSize + 31) / 32 * 32;
-#else
- newSize = (newSize + 7) / 8 * 8;
-#endif
- CFXMEM_Block *pPrevBlock = &m_AvailHead;
- CFXMEM_Block *pNextBlock, *pPrevPrev;
- CFXMEM_Block *pBlock = (CFXMEM_Block*)p - 1;
- pPrevPrev = NULL;
- while (TRUE) {
- pNextBlock = pPrevBlock->m_pNextBlock;
- if (pNextBlock == NULL || pNextBlock > pBlock) {
- break;
- }
- if (pPrevBlock != &m_AvailHead && (FX_LPBYTE)pNextBlock == (FX_LPBYTE)(pPrevBlock + 1) + pPrevBlock->m_nBlockSize) {
- m_nAvailSize += sizeof(CFXMEM_Block);
- pPrevBlock->m_nBlockSize += pNextBlock->m_nBlockSize + sizeof(CFXMEM_Block);
- pPrevBlock->m_pNextBlock = pNextBlock->m_pNextBlock;
- } else {
- pPrevPrev = pPrevBlock;
- pPrevBlock = pNextBlock;
- }
- }
- if (pNextBlock) {
- CFXMEM_Block* pCurBlock = pNextBlock->m_pNextBlock;
- while ((FX_LPBYTE)pCurBlock == (FX_LPBYTE)(pNextBlock + 1) + pNextBlock->m_nBlockSize) {
- m_nAvailSize += sizeof(CFXMEM_Block);
- pNextBlock->m_nBlockSize += pCurBlock->m_nBlockSize + sizeof(CFXMEM_Block);
- pCurBlock = pCurBlock->m_pNextBlock;
- pNextBlock->m_pNextBlock = pCurBlock;
- }
- }
- size_t size = 0;
- FX_DWORD dwFlags = 0;
- if (pPrevBlock != &m_AvailHead && (FX_LPBYTE)pBlock == (FX_LPBYTE)(pPrevBlock + 1) + pPrevBlock->m_nBlockSize) {
- size += pPrevBlock->m_nBlockSize + oldSize + sizeof(CFXMEM_Block);
- dwFlags |= 0x10;
- }
- if (pNextBlock && (FX_LPBYTE)pNextBlock == (FX_LPBYTE)p + oldSize) {
- size += pNextBlock->m_nBlockSize + sizeof(CFXMEM_Block);
- dwFlags |= 0x01;
- }
- if (size >= newSize) {
- m_nAvailSize += pBlock->m_nBlockSize;
- CFXMEM_Block* pCurBlock = pBlock;
- if (dwFlags & 0x10) {
- pCurBlock = pPrevBlock;
- m_nAvailSize += sizeof(CFXMEM_Block);
- pCurBlock->m_nBlockSize += pBlock->m_nBlockSize + sizeof(CFXMEM_Block);
- pPrevBlock = pPrevPrev;
- }
- if (dwFlags & 0x01) {
- m_nAvailSize += sizeof(CFXMEM_Block);
- pCurBlock->m_nBlockSize += pNextBlock->m_nBlockSize + sizeof(CFXMEM_Block);
- pCurBlock->m_pNextBlock = pNextBlock->m_pNextBlock;
- }
- if (pCurBlock != pBlock) {
- FXSYS_memmove32((FX_LPVOID)(pCurBlock + 1), p, oldSize);
- }
- return Alloc(pPrevBlock, pCurBlock, newSize, oldnewSize);
- }
- return NULL;
-}
-void CFXMEM_Page::Free(FX_LPVOID p)
-{
- FXSYS_assert(p > (FX_LPVOID)this && p < (FX_LPVOID)m_pLimitPos);
- CFXMEM_Block *pPrevBlock = &m_AvailHead;
- CFXMEM_Block *pNextBlock;
- CFXMEM_Block *pBlock = (CFXMEM_Block*)p - 1;
- m_nAvailSize += pBlock->m_nBlockSize;
- while (TRUE) {
- pNextBlock = pPrevBlock->m_pNextBlock;
- if (pNextBlock == NULL || pNextBlock > pBlock) {
- break;
- }
- if (pPrevBlock != &m_AvailHead && (FX_LPBYTE)pNextBlock == (FX_LPBYTE)(pPrevBlock + 1) + pPrevBlock->m_nBlockSize) {
- m_nAvailSize += sizeof(CFXMEM_Block);
- pPrevBlock->m_nBlockSize += pNextBlock->m_nBlockSize + sizeof(CFXMEM_Block);
- pPrevBlock->m_pNextBlock = pNextBlock->m_pNextBlock;
- } else {
- pPrevBlock = pNextBlock;
- }
- }
- while ((FX_LPBYTE)pNextBlock == (FX_LPBYTE)(pBlock + 1) + pBlock->m_nBlockSize) {
- m_nAvailSize += sizeof(CFXMEM_Block);
- pBlock->m_nBlockSize += pNextBlock->m_nBlockSize + sizeof(CFXMEM_Block);
- pNextBlock = pNextBlock->m_pNextBlock;
- }
- pBlock->m_pNextBlock = pNextBlock;
- if (pPrevBlock != &m_AvailHead && (FX_LPBYTE)pBlock == (FX_LPBYTE)(pPrevBlock + 1) + pPrevBlock->m_nBlockSize) {
- m_nAvailSize += sizeof(CFXMEM_Block);
- pPrevBlock->m_nBlockSize += pBlock->m_nBlockSize + sizeof(CFXMEM_Block);
- pPrevBlock->m_pNextBlock = pBlock->m_pNextBlock;
- } else {
- FXSYS_assert(pPrevBlock != pBlock);
- pPrevBlock->m_pNextBlock = pBlock;
- }
-}
-void CFXMEM_Pages::Initialize(FX_LPBYTE pStart, size_t pageSize, size_t pages)
-{
- m_pStartPage = m_pCurPage = (CFXMEM_Page*)pStart;
- m_nPageSize = pageSize;
- for (size_t n = 0; n < pages; n++) {
- ((CFXMEM_Page*)pStart)->Initialize(pageSize);
- pStart += pageSize;
- }
- m_pLimitPos = (CFXMEM_Page*)pStart;
-}
-FX_BOOL CFXMEM_Pages::IsEmpty() const
-{
- if (m_pStartPage >= m_pLimitPos) {
- return TRUE;
- }
- FX_LPBYTE pPage = (FX_LPBYTE)m_pStartPage;
- while (pPage < (FX_LPBYTE)m_pLimitPos) {
- if (!((CFXMEM_Page*)pPage)->IsEmpty()) {
- return FALSE;
- }
- pPage += m_nPageSize;
- }
- return TRUE;
-}
-FX_LPVOID CFXMEM_Pages::Alloc(size_t size)
-{
- CFXMEM_Page *pCurPage = m_pCurPage;
- do {
- FX_LPVOID p = m_pCurPage->Alloc(size);
- if (p) {
- return p;
- }
- m_pCurPage = (CFXMEM_Page*)((FX_LPBYTE)m_pCurPage + m_nPageSize);
- if (m_pCurPage == m_pLimitPos) {
- m_pCurPage = m_pStartPage;
- }
- } while (m_pCurPage != pCurPage);
- return NULL;
-}
-FX_LPVOID CFXMEM_Pages::Realloc(FX_LPVOID p, size_t oldSize, size_t newSize)
-{
- FXSYS_assert (p > (FX_LPVOID)m_pStartPage && p < (FX_LPVOID)m_pLimitPos);
- CFXMEM_Page* pPage = (CFXMEM_Page*)((FX_LPBYTE)m_pStartPage + ((FX_LPBYTE)p - (FX_LPBYTE)m_pStartPage) / m_nPageSize * m_nPageSize);
- return pPage->Realloc(p, oldSize, newSize);
-}
-void CFXMEM_Pages::Free(FX_LPVOID p)
-{
- FXSYS_assert (p > (FX_LPVOID)m_pStartPage && p < (FX_LPVOID)m_pLimitPos);
- CFXMEM_Page* pPage = (CFXMEM_Page*)((FX_LPBYTE)m_pStartPage + ((FX_LPBYTE)p - (FX_LPBYTE)m_pStartPage) / m_nPageSize * m_nPageSize);
- pPage->Free(p);
-}
-void CFXMEM_Pool::Initialize(const FX_MEMCONFIG* pMemConfig, size_t size, size_t pageNum8Bytes, size_t pageNum16Bytes, size_t pageNum32Bytes, size_t pageNumMid)
-{
- m_pPrevPool = NULL;
- m_pNextPool = NULL;
- m_bAlone = FALSE;
- FX_LPBYTE pPage = (FX_LPBYTE)this + sizeof(CFXMEM_Pool);
- size -= sizeof(CFXMEM_Pool);
- m_8BytesPages.Initialize(pPage, pageNum8Bytes);
- pPage += pageNum8Bytes * FX_FIXEDMEM_PAGESIZE;
- size -= pageNum8Bytes * FX_FIXEDMEM_PAGESIZE;
- m_16BytesPages.Initialize(pPage, pageNum16Bytes);
- pPage += pageNum16Bytes * FX_FIXEDMEM_PAGESIZE;
- size -= pageNum16Bytes * FX_FIXEDMEM_PAGESIZE;
- m_32BytesPages.Initialize(pPage, pageNum32Bytes);
- pPage += pageNum32Bytes * FX_FIXEDMEM_PAGESIZE;
- size -= pageNum32Bytes * FX_FIXEDMEM_PAGESIZE;
- m_MidPages.Initialize(pPage, pMemConfig->nPageSize_Mid * FX_FIXEDMEM_PAGESIZE, pageNumMid);
- pPage += pageNumMid * pMemConfig->nPageSize_Mid * FX_FIXEDMEM_PAGESIZE;
- size -= pageNumMid * pMemConfig->nPageSize_Mid * FX_FIXEDMEM_PAGESIZE;
- if (size < FX_FIXEDMEM_MIDBLOCKSIZE) {
- m_pLargePage = NULL;
- } else {
- m_pLargePage = (CFXMEM_Page*)pPage;
- m_pLargePage->Initialize(size);
- }
- m_pLimitPos = pPage + size;
-}
-FX_BOOL CFXMEM_Pool::IsEmpty() const
-{
- if (!m_8BytesPages.IsEmpty()) {
- return FALSE;
- }
- if (!m_16BytesPages.IsEmpty()) {
- return FALSE;
- }
- if (!m_32BytesPages.IsEmpty()) {
- return FALSE;
- }
- if (!m_MidPages.IsEmpty()) {
- return FALSE;
- }
- return !m_pLargePage || m_pLargePage->IsEmpty();
-}
-size_t CFXMEM_Pool::GetSize(FX_LPVOID p) const
-{
- FXSYS_assert(p > (FX_LPVOID)this && p < (FX_LPVOID)m_pLimitPos);
- if (p < (FX_LPVOID)m_8BytesPages.m_pLimitPos) {
- return 8;
- }
- if (p < (FX_LPVOID)m_16BytesPages.m_pLimitPos) {
- return 16;
- }
- if (p < (FX_LPVOID)m_32BytesPages.m_pLimitPos) {
- return 32;
- }
- return ((CFXMEM_Block*)p - 1)->m_nBlockSize;
-}
-FX_LPVOID CFXMEM_Pool::Realloc(FX_LPVOID p, size_t oldSize, size_t newSize)
-{
- FXSYS_assert(p > (FX_LPVOID)this && p < (FX_LPVOID)m_pLimitPos);
- if (p > (FX_LPVOID)m_32BytesPages.m_pLimitPos) {
- if (p < (FX_LPVOID)m_MidPages.m_pLimitPos) {
- return m_MidPages.Realloc(p, oldSize, newSize);
- } else if (m_pLargePage) {
- return m_pLargePage->Realloc(p, oldSize, newSize);
- }
- }
- return NULL;
-}
-void CFXMEM_Pool::Free(FX_LPVOID p)
-{
- FXSYS_assert(p > (FX_LPVOID)this && p < (FX_LPVOID)m_pLimitPos);
- if (p < (FX_LPVOID)m_32BytesPages.m_pLimitPos) {
- if (p < (FX_LPVOID)m_8BytesPages.m_pLimitPos) {
- m_8BytesPages.Free(p);
- } else if (p < (FX_LPVOID)m_16BytesPages.m_pLimitPos) {
- m_16BytesPages.Free(p);
- } else {
- m_32BytesPages.Free(p);
- }
- return;
- } else if (p < (FX_LPVOID)m_MidPages.m_pLimitPos) {
- m_MidPages.Free(p);
- } else {
- m_pLargePage->Free(p);
- }
-}
-void CFXMEM_FixedMgr::Initialize(size_t size)
-{
- m_MemConfig = g_MemConfig;
- FXSYS_memset32(&m_SystemMgr, 0, sizeof m_SystemMgr);
- m_SystemMgr.Alloc = FixedAlloc;
- m_SystemMgr.AllocDebug = FixedAllocDebug;
- m_SystemMgr.Free = FixedFree;
- m_SystemMgr.Realloc = FixedRealloc;
- m_SystemMgr.ReallocDebug = FixedReallocDebug;
- m_SystemMgr.CollectAll = FixedCollectAll;
- m_SystemMgr.Purge = FixedPurge;
- m_SystemMgr.user = this;
- size -= sizeof(CFXMEM_FixedMgr);
- size_t nMidPages = 0;
- if (m_MemConfig.nPageSize_Mid) {
- nMidPages = (size - (m_MemConfig.nPageNum_Init8 + m_MemConfig.nPageNum_Init16 + m_MemConfig.nPageNum_Init32) * FX_FIXEDMEM_PAGESIZE) / (m_MemConfig.nPageSize_Mid * FX_FIXEDMEM_PAGESIZE);
- if (nMidPages > m_MemConfig.nPageNum_InitMid) {
- nMidPages = m_MemConfig.nPageNum_InitMid;
- }
- }
- m_FirstPool.Initialize(&m_MemConfig, size, m_MemConfig.nPageNum_Init8, m_MemConfig.nPageNum_Init16, m_MemConfig.nPageNum_Init32, nMidPages);
-}
-FX_LPVOID CFXMEM_FixedMgr::Alloc16(CFXMEM_Pool **pp32Pool, size_t size)
-{
- CFXMEM_Pool *pPool = &m_FirstPool;
- do {
- CFXMEM_16BytesPages &pages = pPool->m_16BytesPages;
- if (pages.HasFreeBlock()) {
- return pages.Alloc(size);
- }
- if (pp32Pool && pPool->m_32BytesPages.HasFreeBlock()) {
- *pp32Pool = pPool;
- }
- pPool = pPool->m_pNextPool;
- } while(pPool);
- return NULL;
-}
-FX_LPVOID CFXMEM_FixedMgr::Alloc32(size_t size)
-{
- if (size <= 8) {
- CFXMEM_8BytesPages &pages = m_FirstPool.m_8BytesPages;
- if (pages.HasFreeBlock()) {
- return pages.Alloc(size);
- }
- }
- CFXMEM_Pool *p32BytesPool;
- if (size <= 16) {
- p32BytesPool = NULL;
- FX_LPVOID p = Alloc16(&p32BytesPool, size);
- if (p) {
- return p;
- }
- } else {
- p32BytesPool = &m_FirstPool;
- }
- while (p32BytesPool) {
- CFXMEM_32BytesPages &pages = p32BytesPool->m_32BytesPages;
- if (pages.HasFreeBlock()) {
- return pages.Alloc(size);
- }
- p32BytesPool = p32BytesPool->m_pNextPool;
- }
- return NULL;
-}
-FX_LPVOID CFXMEM_FixedMgr::AllocSmall(size_t size)
-{
- FX_LPVOID p = Alloc32(size);
- if (p) {
- return p;
- }
- if (!m_pExtender) {
- return NULL;
- }
- size_t requiredSize = (m_MemConfig.nPageNum_More16 + m_MemConfig.nPageNum_More32) * FX_FIXEDMEM_PAGESIZE;
- if (!requiredSize) {
- return NULL;
- }
- CFXMEM_Pool *pNewPool = NULL;
- requiredSize += sizeof(CFXMEM_Pool);
- size_t newSize = requiredSize;
- if (!m_pExtender->More(m_pExtender, newSize, (void**)&pNewPool, &newSize)) {
- return NULL;
- }
- size_t nMidPages = 0;
- if (m_MemConfig.nPageSize_Mid) {
- nMidPages = (newSize - requiredSize) / (m_MemConfig.nPageSize_Mid * FX_FIXEDMEM_PAGESIZE);
- if (nMidPages > m_MemConfig.nPageNum_MoreMid) {
- nMidPages = m_MemConfig.nPageNum_MoreMid;
- }
- }
- pNewPool->Initialize(&m_MemConfig, newSize, 0, m_MemConfig.nPageNum_More16, m_MemConfig.nPageNum_More32, nMidPages);
- pNewPool->m_pPrevPool = &m_FirstPool;
- CFXMEM_Pool *pPool = m_FirstPool.m_pNextPool;
- pNewPool->m_pNextPool = pPool;
- if (pPool) {
- pPool->m_pPrevPool = pNewPool;
- }
- m_FirstPool.m_pNextPool = pNewPool;
- return Alloc32(size);
-}
-FX_LPVOID CFXMEM_FixedMgr::AllocMid(size_t size)
-{
- CFXMEM_Pool *pPool = &m_FirstPool;
- do {
- CFXMEM_Pages &pages = pPool->m_MidPages;
- if (pages.m_pLimitPos > pages.m_pStartPage) {
- FX_LPVOID p = pages.Alloc(size);
- if (p) {
- return p;
- }
- }
- pPool = pPool->m_pNextPool;
- } while(pPool);
- if (!m_pExtender) {
- return NULL;
- }
- size_t newSize = m_MemConfig.nPageSize_Mid * FX_FIXEDMEM_PAGESIZE * m_MemConfig.nPageNum_MoreMid;
- if (!newSize) {
- return NULL;
- }
- CFXMEM_Pool *pNewPool = NULL;
- newSize += sizeof(CFXMEM_Pool);
- if (!m_pExtender->More(m_pExtender, newSize, (void**)&pNewPool, &newSize)) {
- return NULL;
- }
- size_t nMidPages = (newSize - sizeof(CFXMEM_Pool)) / (m_MemConfig.nPageSize_Mid * FX_FIXEDMEM_PAGESIZE);
- if (nMidPages > m_MemConfig.nPageNum_MoreMid) {
- nMidPages = m_MemConfig.nPageNum_MoreMid;
- }
- pNewPool->Initialize(&m_MemConfig, newSize, 0, 0, 0, nMidPages);
- pNewPool->m_pPrevPool = &m_FirstPool;
- pPool = m_FirstPool.m_pNextPool;
- pNewPool->m_pNextPool = pPool;
- if (pPool) {
- pPool->m_pPrevPool = pNewPool;
- }
- m_FirstPool.m_pNextPool = pNewPool;
- return pNewPool->m_MidPages.Alloc(size);
-}
-FX_LPVOID CFXMEM_FixedMgr::AllocLarge(size_t size)
-{
- CFXMEM_Pool *pPool = &m_FirstPool;
- do {
- if (!pPool->m_bAlone && pPool->m_pLargePage) {
- FX_LPVOID p = pPool->m_pLargePage->Alloc(size);
- if (p) {
- return p;
- }
- }
- pPool = pPool->m_pNextPool;
- } while(pPool);
- if (!m_pExtender || !m_MemConfig.nPageSize_Large) {
- return NULL;
- }
- CFXMEM_Pool *pNewPool = NULL;
-#if _FX_WORDSIZE_ == _FX_W64_
- size_t newSize = ((size + 31) / 32 * 32 + sizeof(CFXMEM_Pool) + sizeof(CFXMEM_Page) + sizeof(CFXMEM_Block) + 4095) / 4096 * 4096;
-#else
- size_t newSize = (size + 7) / 8 * 8 + sizeof(CFXMEM_Pool) + sizeof(CFXMEM_Page) + sizeof(CFXMEM_Block);
-#endif
- if (newSize < m_MemConfig.nPageSize_Large * FX_FIXEDMEM_PAGESIZE) {
- newSize = m_MemConfig.nPageSize_Large * FX_FIXEDMEM_PAGESIZE;
- }
- if (!m_pExtender->More(m_pExtender, newSize, (void**)&pNewPool, &newSize)) {
- return NULL;
- }
- pNewPool->Initialize(&m_MemConfig, newSize, 0, 0, 0, 0);
- pNewPool->m_bAlone = size >= m_MemConfig.nPageSize_Alone * FX_FIXEDMEM_PAGESIZE;
- pNewPool->m_pPrevPool = &m_FirstPool;
- pPool = m_FirstPool.m_pNextPool;
- pNewPool->m_pNextPool = pPool;
- if (pPool) {
- pPool->m_pPrevPool = pNewPool;
- }
- m_FirstPool.m_pNextPool = pNewPool;
- return pNewPool->m_pLargePage->Alloc(size);
-}
-size_t CFXMEM_FixedMgr::GetSize(FX_LPVOID p) const
-{
- const CFXMEM_Pool *pFind = &m_FirstPool;
- do {
- if (p > (FX_LPVOID)pFind && p < pFind->m_pLimitPos) {
- return pFind->GetSize(p);
- }
- pFind = pFind->m_pNextPool;
- } while (pFind);
- return 0;
-}
-FX_LPVOID CFXMEM_FixedMgr::Alloc(size_t size)
-{
- FX_LPVOID p;
- if (size <= 32) {
- p = AllocSmall(size);
- if (p) {
- return p;
- }
- }
- if (size <= FX_FIXEDMEM_MIDBLOCKSIZE) {
- p = AllocMid(size);
- if (p) {
- return p;
- }
- }
- p = AllocLarge(size);
- return p;
-}
-FX_LPVOID CFXMEM_FixedMgr::ReallocSmall(CFXMEM_Pool* pPool, FX_LPVOID p, size_t oldSize, size_t newSize)
-{
- FX_LPVOID np = AllocSmall(newSize);
- if (!np) {
- return NULL;
- }
- FXSYS_memcpy32(np, p, oldSize);
- pPool->Free(p);
- return np;
-}
-FX_LPVOID CFXMEM_FixedMgr::Realloc(FX_LPVOID p, size_t newSize)
-{
- if (!p) {
- return Alloc(newSize);
- }
- size_t oldSize = 0;
- CFXMEM_Pool *pFind = &m_FirstPool;
- do {
- if (p > (FX_LPVOID)pFind && p < pFind->m_pLimitPos) {
- oldSize = pFind->GetSize(p);
- if (oldSize >= newSize) {
- return p;
- }
- break;
- }
- pFind = pFind->m_pNextPool;
- } while (pFind);
- if (!oldSize || !pFind) {
- return Alloc(newSize);
- }
- FX_LPVOID np = NULL;
- if (newSize <= 32) {
- np = ReallocSmall(pFind, p, oldSize, newSize);
- if (np) {
- return np;
- }
- }
- if (newSize <= FX_FIXEDMEM_MIDBLOCKSIZE) {
- np = pFind->Realloc(p, oldSize, newSize);
- if (np) {
- return np;
- }
- }
- np = Alloc(newSize);
- if (np) {
- FXSYS_memcpy32(np, p, oldSize);
- pFind->Free(p);
- }
- if (pFind->m_bAlone && pFind->IsEmpty()) {
- FreePool(pFind);
- }
- return np;
-}
-void CFXMEM_FixedMgr::Free(FX_LPVOID p)
-{
- CFXMEM_Pool *pFind = &m_FirstPool;
- do {
- if (p > (FX_LPVOID)pFind && p < pFind->m_pLimitPos) {
- pFind->Free(p);
- if (pFind->m_bAlone && pFind->IsEmpty()) {
- FreePool(pFind);
- }
- return;
- }
- pFind = pFind->m_pNextPool;
- } while (pFind);
-}
-void CFXMEM_FixedMgr::FreePool(CFXMEM_Pool* pPool)
-{
- FXSYS_assert(pPool->m_bAlone && pPool->IsEmpty());
- FXSYS_assert(m_pExtender != NULL);
- CFXMEM_Pool* pPrevPool = pPool->m_pPrevPool;
- CFXMEM_Pool* pNextPool = pPool->m_pNextPool;
- if (pPrevPool) {
- pPrevPool->m_pNextPool = pNextPool;
- }
- if (pNextPool) {
- pNextPool->m_pPrevPool = pPrevPool;
- }
- m_pExtender->Free(m_pExtender, pPool);
-}
-void CFXMEM_FixedMgr::FreeAll()
-{
- if (!m_pExtender) {
- return;
- }
- CFXMEM_Pool* pPool = m_FirstPool.m_pNextPool;
- while (pPool) {
- CFXMEM_Pool* pPrevPool = pPool;
- pPool = pPool->m_pNextPool;
- m_pExtender->Free(m_pExtender, pPrevPool);
- }
- m_FirstPool.m_pNextPool = NULL;
-}
-void CFXMEM_FixedMgr::Purge()
-{
- if (!m_pExtender) {
- return;
- }
- CFXMEM_Pool* pPool = m_FirstPool.m_pNextPool;
- while (pPool) {
- CFXMEM_Pool* pNextPool = pPool->m_pNextPool;
- if (pPool->IsEmpty()) {
- CFXMEM_Pool* pPrevPool = pPool->m_pPrevPool;
- pPrevPool->m_pNextPool = pNextPool;
- if (pNextPool) {
- pNextPool->m_pPrevPool = pPrevPool;
- }
- m_pExtender->Free(m_pExtender, pPool);
- }
- pPool = pNextPool;
- }
-}
-extern const FX_BYTE OneLeadPos[256] = {
- 8, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-};
-extern const FX_BYTE ZeroLeadPos[256] = {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 7, 8,
-};
+// 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
+
+#include "../../include/fxcrt/fx_ext.h"
+#include "mem_int.h"
+#ifdef _FPDFAPI_MINI_
+static FX_MEMCONFIG g_MemConfig = {
+ 1,
+ 5,
+ 8,
+ 4,
+ 12,
+ 8,
+ 2,
+ 4,
+ 32,
+ 64,
+};
+#else
+static FX_MEMCONFIG g_MemConfig = {
+ 1,
+ 8,
+ 24,
+ 8,
+ 32,
+ 16,
+ 4,
+ 8,
+ 128,
+ 64,
+};
+#endif
+void FXMEM_SetConfig(const FX_MEMCONFIG* memConfig)
+{
+ g_MemConfig = *memConfig;
+}
+#ifdef __cplusplus
+extern "C" {
+#endif
+static void* FixedAlloc(FXMEM_SystemMgr* pMgr, size_t size, int flags)
+{
+ return ((CFXMEM_FixedMgr*)pMgr->user)->Alloc(size);
+}
+static void* FixedAllocDebug(FXMEM_SystemMgr* pMgr, size_t size, int flags, FX_LPCSTR file, int line)
+{
+ return ((CFXMEM_FixedMgr*)pMgr->user)->Alloc(size);
+}
+static void* FixedRealloc(FXMEM_SystemMgr* pMgr, void* pointer, size_t size, int flags)
+{
+ return ((CFXMEM_FixedMgr*)pMgr->user)->Realloc(pointer, size);
+}
+static void* FixedReallocDebug(FXMEM_SystemMgr* pMgr, void* pointer, size_t size, int flags, FX_LPCSTR file, int line)
+{
+ return ((CFXMEM_FixedMgr*)pMgr->user)->Realloc(pointer, size);
+}
+static void FixedFree(FXMEM_SystemMgr* pMgr, void* pointer, int flags)
+{
+ ((CFXMEM_FixedMgr*)pMgr->user)->Free(pointer);
+}
+static void FixedPurge(FXMEM_SystemMgr* pMgr)
+{
+ ((CFXMEM_FixedMgr*)pMgr->user)->Purge();
+}
+static void FixedCollectAll(FXMEM_SystemMgr* pMgr)
+{
+ ((CFXMEM_FixedMgr*)pMgr->user)->FreeAll();
+}
+#define FIXEDMEM_MINIMUMSIZE (1024 * 1024 * 8)
+FXMEM_FoxitMgr* FXMEM_CreateMemoryMgr(size_t size, FX_BOOL extensible)
+{
+ if (size < FIXEDMEM_MINIMUMSIZE) {
+ size = FIXEDMEM_MINIMUMSIZE;
+ }
+ FX_LPVOID pMemory = malloc(size);
+ if (!pMemory) {
+ return NULL;
+ }
+ CFixedMgr_Proxy* pProxy = (CFixedMgr_Proxy*)pMemory;
+ size_t offsetSize = (sizeof(CFixedMgr_Proxy) + 15) / 16 * 16;
+ FXMEM_FoxitMgr* pFoxitMgr = pProxy->Initialize((FX_LPBYTE)pProxy + offsetSize, size - offsetSize, extensible);
+ if (!pFoxitMgr) {
+ free(pMemory);
+ return NULL;
+ }
+ g_pDefFoxitMgr = (CFX_MemoryMgr*)pFoxitMgr;
+ g_pDefFoxitMgr->m_pExternalMemory = pMemory;
+ return pFoxitMgr;
+}
+FXMEM_FoxitMgr* FXMEM_CreateFixedMgr(void* pMemory, size_t size, FXMEM_SystemMgr2* pSystemMgr)
+{
+ if (pMemory == NULL || size < FX_FIXEDMEM_PAGESIZE) {
+ return NULL;
+ }
+ if (!pSystemMgr && size >= FIXEDMEM_PROXYSIZE_1) {
+ CFixedMgr_Proxy* pProxy = (CFixedMgr_Proxy*)pMemory;
+ size_t offsetSize = (sizeof(CFixedMgr_Proxy) + 15) / 16 * 16;
+ return pProxy->Initialize((FX_LPBYTE)pProxy + offsetSize, size - offsetSize, FALSE);
+ }
+ CFXMEM_FixedMgr* pHeader = (CFXMEM_FixedMgr*)pMemory;
+ pHeader->Initialize(size);
+ pHeader->m_pExtender = pSystemMgr;
+ CFX_MemoryMgr* p = (CFX_MemoryMgr*)pHeader->Alloc(sizeof(CFX_MemoryMgr));
+ if (p == NULL) {
+ return NULL;
+ }
+ p->Init(&pHeader->m_SystemMgr);
+ return (FXMEM_FoxitMgr*)p;
+}
+size_t FXMEM_GetBlockSizeInFixedMgr(FXMEM_FoxitMgr* pFoxitMgr, void* ptr)
+{
+ return pFoxitMgr ? ((CFXMEM_FixedMgr*)((CFX_MemoryMgr*)pFoxitMgr)->m_pSystemMgr->user)->GetSize(ptr) : 0;
+}
+#ifdef __cplusplus
+}
+#endif
+const FX_MEMCONFIG g_ProxyMgr_MemConfigs[6] = {
+ {1, 2, 4, 0, 2, 2, 2, 0, 0, 0},
+ {1, 4, 8, 0, 2, 2, 2, 0, 0, 0},
+ {1, 4, 16, 4, 8, 8, 2, 1, 16, 16},
+ {1, 8, 24, 4, 12, 12, 4, 2, 32, 16},
+ {1, 8, 24, 8, 16, 16, 4, 2, 64, 32},
+ {1, 8, 24, 8, 24, 32, 4, 2, 128, 64},
+};
+const FX_MEMCONFIG* FixedMgr_GetConfig(size_t nSize)
+{
+ int index = 5;
+ if (nSize <= FIXEDMEM_PROXYSIZE_0) {
+ index = 0;
+ } else if (nSize <= FIXEDMEM_PROXYSIZE_1) {
+ index = 1;
+ } else if (nSize <= FIXEDMEM_PROXYSIZE_2) {
+ index = 2;
+ } else if (nSize <= FIXEDMEM_PROXYSIZE_3) {
+ index = 3;
+ } else if (nSize <= FIXEDMEM_PROXYSIZE_4) {
+ index = 4;
+ }
+ return &g_ProxyMgr_MemConfigs[index];
+}
+FXMEM_FoxitMgr* CFixedMgr_Proxy::Initialize(FX_LPVOID pBuffer, size_t nSize, FX_BOOL bExtensible)
+{
+ FXSYS_assert(pBuffer != NULL && nSize >= FIXEDMEM_PROXYSIZE_1 - sizeof(CFixedMgr_Proxy));
+ FXMEM_SetConfig(FixedMgr_GetConfig(nSize));
+ m_SystemMgr.More = &CFixedMgr_Proxy::Common_More;
+ m_SystemMgr.Free = &CFixedMgr_Proxy::Common_Free;
+ m_pFixedPage = (CFXMEM_Page*)((FX_LPBYTE)pBuffer + FIXEDMEM_PROXYSIZE_0);
+ m_pFixedPage->Initialize(nSize - FIXEDMEM_PROXYSIZE_0);
+ m_pBuffer = pBuffer;
+ m_nSize = nSize;
+ m_bExtensible = bExtensible;
+ return FXMEM_CreateFixedMgr(pBuffer, FIXEDMEM_PROXYSIZE_0, &m_SystemMgr);
+}
+FX_BOOL CFixedMgr_Proxy::Common_More(FXMEM_SystemMgr2* pMgr, size_t alloc_size, void** new_memory, size_t* new_size)
+{
+ CFixedMgr_Proxy* pProxyMgr = (CFixedMgr_Proxy*)pMgr;
+ FXSYS_assert(pProxyMgr != NULL && pProxyMgr->m_pFixedPage != NULL);
+ *new_size = alloc_size;
+ *new_memory = pProxyMgr->m_pFixedPage->Alloc(alloc_size);
+ if (*new_memory == NULL && pProxyMgr->m_bExtensible) {
+ *new_memory = malloc(alloc_size);
+ }
+ return *new_memory != NULL;
+}
+void CFixedMgr_Proxy::Common_Free(FXMEM_SystemMgr2* pMgr, void* memory)
+{
+ CFixedMgr_Proxy* pProxyMgr = (CFixedMgr_Proxy*)pMgr;
+ FXSYS_assert(pProxyMgr != NULL && pProxyMgr->m_pFixedPage != NULL);
+ if (memory > pProxyMgr->m_pBuffer && memory < (FX_LPBYTE)pProxyMgr->m_pBuffer + pProxyMgr->m_nSize) {
+ pProxyMgr->m_pFixedPage->Free(memory);
+ } else if (pProxyMgr->m_bExtensible) {
+ free(memory);
+ }
+}
+void CFXMEM_Page::Initialize(size_t size)
+{
+ CFXMEM_Block *pFirstBlock = (CFXMEM_Block*)(this + 1);
+ m_nAvailSize = size - sizeof(CFXMEM_Page) - sizeof(CFXMEM_Block);
+ pFirstBlock->m_nBlockSize = m_nAvailSize;
+ pFirstBlock->m_pNextBlock = NULL;
+ m_AvailHead.m_nBlockSize = m_nAvailSize;
+ m_AvailHead.m_pNextBlock = pFirstBlock;
+ m_pLimitPos = (CFXMEM_Block*)((FX_LPBYTE)this + size);
+}
+FX_LPVOID CFXMEM_Page::Alloc(CFXMEM_Block* pPrevBlock, CFXMEM_Block* pNextBlock, size_t size, size_t oldsize)
+{
+ size_t gap = pNextBlock->m_nBlockSize - size;
+ if (gap <= 64 + sizeof(CFXMEM_Block)) {
+ pPrevBlock->m_pNextBlock = pNextBlock->m_pNextBlock;
+ m_nAvailSize -= pNextBlock->m_nBlockSize;
+ } else {
+ m_nAvailSize -= size + sizeof(CFXMEM_Block);
+ pNextBlock->m_nBlockSize = size;
+ CFXMEM_Block *pNewBlock = (CFXMEM_Block*)((FX_LPBYTE)(pNextBlock + 1) + size);
+ pNewBlock->m_nBlockSize = gap - sizeof(CFXMEM_Block);
+ pNewBlock->m_pNextBlock = pNextBlock->m_pNextBlock;
+ pPrevBlock->m_pNextBlock = pNewBlock;
+ }
+ return (FX_LPVOID)(pNextBlock + 1);
+}
+FX_LPVOID CFXMEM_Page::Alloc(size_t size)
+{
+ size_t oldsize = size;
+#if _FX_WORDSIZE_ == _FX_W64_
+ size = (size + 31) / 32 * 32;
+#else
+ size = (size + 7) / 8 * 8;
+#endif
+ if (m_nAvailSize < size) {
+ return NULL;
+ }
+ CFXMEM_Block *pNextBlock;
+ CFXMEM_Block *pPrevBlock = &m_AvailHead;
+ while (TRUE) {
+ pNextBlock = pPrevBlock->m_pNextBlock;
+ if (!pNextBlock) {
+ return NULL;
+ }
+ if (pNextBlock->m_nBlockSize >= size) {
+ break;
+ }
+ pPrevBlock = pNextBlock;
+ }
+ return Alloc(pPrevBlock, pNextBlock, size, oldsize);
+}
+FX_LPVOID CFXMEM_Page::Realloc(FX_LPVOID p, size_t oldSize, size_t newSize)
+{
+ FXSYS_assert(p > (FX_LPVOID)this && p < (FX_LPVOID)m_pLimitPos);
+ size_t oldnewSize = newSize;
+#if _FX_WORDSIZE_ == _FX_W64_
+ newSize = (newSize + 31) / 32 * 32;
+#else
+ newSize = (newSize + 7) / 8 * 8;
+#endif
+ CFXMEM_Block *pPrevBlock = &m_AvailHead;
+ CFXMEM_Block *pNextBlock, *pPrevPrev;
+ CFXMEM_Block *pBlock = (CFXMEM_Block*)p - 1;
+ pPrevPrev = NULL;
+ while (TRUE) {
+ pNextBlock = pPrevBlock->m_pNextBlock;
+ if (pNextBlock == NULL || pNextBlock > pBlock) {
+ break;
+ }
+ if (pPrevBlock != &m_AvailHead && (FX_LPBYTE)pNextBlock == (FX_LPBYTE)(pPrevBlock + 1) + pPrevBlock->m_nBlockSize) {
+ m_nAvailSize += sizeof(CFXMEM_Block);
+ pPrevBlock->m_nBlockSize += pNextBlock->m_nBlockSize + sizeof(CFXMEM_Block);
+ pPrevBlock->m_pNextBlock = pNextBlock->m_pNextBlock;
+ } else {
+ pPrevPrev = pPrevBlock;
+ pPrevBlock = pNextBlock;
+ }
+ }
+ if (pNextBlock) {
+ CFXMEM_Block* pCurBlock = pNextBlock->m_pNextBlock;
+ while ((FX_LPBYTE)pCurBlock == (FX_LPBYTE)(pNextBlock + 1) + pNextBlock->m_nBlockSize) {
+ m_nAvailSize += sizeof(CFXMEM_Block);
+ pNextBlock->m_nBlockSize += pCurBlock->m_nBlockSize + sizeof(CFXMEM_Block);
+ pCurBlock = pCurBlock->m_pNextBlock;
+ pNextBlock->m_pNextBlock = pCurBlock;
+ }
+ }
+ size_t size = 0;
+ FX_DWORD dwFlags = 0;
+ if (pPrevBlock != &m_AvailHead && (FX_LPBYTE)pBlock == (FX_LPBYTE)(pPrevBlock + 1) + pPrevBlock->m_nBlockSize) {
+ size += pPrevBlock->m_nBlockSize + oldSize + sizeof(CFXMEM_Block);
+ dwFlags |= 0x10;
+ }
+ if (pNextBlock && (FX_LPBYTE)pNextBlock == (FX_LPBYTE)p + oldSize) {
+ size += pNextBlock->m_nBlockSize + sizeof(CFXMEM_Block);
+ dwFlags |= 0x01;
+ }
+ if (size >= newSize) {
+ m_nAvailSize += pBlock->m_nBlockSize;
+ CFXMEM_Block* pCurBlock = pBlock;
+ if (dwFlags & 0x10) {
+ pCurBlock = pPrevBlock;
+ m_nAvailSize += sizeof(CFXMEM_Block);
+ pCurBlock->m_nBlockSize += pBlock->m_nBlockSize + sizeof(CFXMEM_Block);
+ pPrevBlock = pPrevPrev;
+ }
+ if (dwFlags & 0x01) {
+ m_nAvailSize += sizeof(CFXMEM_Block);
+ pCurBlock->m_nBlockSize += pNextBlock->m_nBlockSize + sizeof(CFXMEM_Block);
+ pCurBlock->m_pNextBlock = pNextBlock->m_pNextBlock;
+ }
+ if (pCurBlock != pBlock) {
+ FXSYS_memmove32((FX_LPVOID)(pCurBlock + 1), p, oldSize);
+ }
+ return Alloc(pPrevBlock, pCurBlock, newSize, oldnewSize);
+ }
+ return NULL;
+}
+void CFXMEM_Page::Free(FX_LPVOID p)
+{
+ FXSYS_assert(p > (FX_LPVOID)this && p < (FX_LPVOID)m_pLimitPos);
+ CFXMEM_Block *pPrevBlock = &m_AvailHead;
+ CFXMEM_Block *pNextBlock;
+ CFXMEM_Block *pBlock = (CFXMEM_Block*)p - 1;
+ m_nAvailSize += pBlock->m_nBlockSize;
+ while (TRUE) {
+ pNextBlock = pPrevBlock->m_pNextBlock;
+ if (pNextBlock == NULL || pNextBlock > pBlock) {
+ break;
+ }
+ if (pPrevBlock != &m_AvailHead && (FX_LPBYTE)pNextBlock == (FX_LPBYTE)(pPrevBlock + 1) + pPrevBlock->m_nBlockSize) {
+ m_nAvailSize += sizeof(CFXMEM_Block);
+ pPrevBlock->m_nBlockSize += pNextBlock->m_nBlockSize + sizeof(CFXMEM_Block);
+ pPrevBlock->m_pNextBlock = pNextBlock->m_pNextBlock;
+ } else {
+ pPrevBlock = pNextBlock;
+ }
+ }
+ while ((FX_LPBYTE)pNextBlock == (FX_LPBYTE)(pBlock + 1) + pBlock->m_nBlockSize) {
+ m_nAvailSize += sizeof(CFXMEM_Block);
+ pBlock->m_nBlockSize += pNextBlock->m_nBlockSize + sizeof(CFXMEM_Block);
+ pNextBlock = pNextBlock->m_pNextBlock;
+ }
+ pBlock->m_pNextBlock = pNextBlock;
+ if (pPrevBlock != &m_AvailHead && (FX_LPBYTE)pBlock == (FX_LPBYTE)(pPrevBlock + 1) + pPrevBlock->m_nBlockSize) {
+ m_nAvailSize += sizeof(CFXMEM_Block);
+ pPrevBlock->m_nBlockSize += pBlock->m_nBlockSize + sizeof(CFXMEM_Block);
+ pPrevBlock->m_pNextBlock = pBlock->m_pNextBlock;
+ } else {
+ FXSYS_assert(pPrevBlock != pBlock);
+ pPrevBlock->m_pNextBlock = pBlock;
+ }
+}
+void CFXMEM_Pages::Initialize(FX_LPBYTE pStart, size_t pageSize, size_t pages)
+{
+ m_pStartPage = m_pCurPage = (CFXMEM_Page*)pStart;
+ m_nPageSize = pageSize;
+ for (size_t n = 0; n < pages; n++) {
+ ((CFXMEM_Page*)pStart)->Initialize(pageSize);
+ pStart += pageSize;
+ }
+ m_pLimitPos = (CFXMEM_Page*)pStart;
+}
+FX_BOOL CFXMEM_Pages::IsEmpty() const
+{
+ if (m_pStartPage >= m_pLimitPos) {
+ return TRUE;
+ }
+ FX_LPBYTE pPage = (FX_LPBYTE)m_pStartPage;
+ while (pPage < (FX_LPBYTE)m_pLimitPos) {
+ if (!((CFXMEM_Page*)pPage)->IsEmpty()) {
+ return FALSE;
+ }
+ pPage += m_nPageSize;
+ }
+ return TRUE;
+}
+FX_LPVOID CFXMEM_Pages::Alloc(size_t size)
+{
+ CFXMEM_Page *pCurPage = m_pCurPage;
+ do {
+ FX_LPVOID p = m_pCurPage->Alloc(size);
+ if (p) {
+ return p;
+ }
+ m_pCurPage = (CFXMEM_Page*)((FX_LPBYTE)m_pCurPage + m_nPageSize);
+ if (m_pCurPage == m_pLimitPos) {
+ m_pCurPage = m_pStartPage;
+ }
+ } while (m_pCurPage != pCurPage);
+ return NULL;
+}
+FX_LPVOID CFXMEM_Pages::Realloc(FX_LPVOID p, size_t oldSize, size_t newSize)
+{
+ FXSYS_assert (p > (FX_LPVOID)m_pStartPage && p < (FX_LPVOID)m_pLimitPos);
+ CFXMEM_Page* pPage = (CFXMEM_Page*)((FX_LPBYTE)m_pStartPage + ((FX_LPBYTE)p - (FX_LPBYTE)m_pStartPage) / m_nPageSize * m_nPageSize);
+ return pPage->Realloc(p, oldSize, newSize);
+}
+void CFXMEM_Pages::Free(FX_LPVOID p)
+{
+ FXSYS_assert (p > (FX_LPVOID)m_pStartPage && p < (FX_LPVOID)m_pLimitPos);
+ CFXMEM_Page* pPage = (CFXMEM_Page*)((FX_LPBYTE)m_pStartPage + ((FX_LPBYTE)p - (FX_LPBYTE)m_pStartPage) / m_nPageSize * m_nPageSize);
+ pPage->Free(p);
+}
+void CFXMEM_Pool::Initialize(const FX_MEMCONFIG* pMemConfig, size_t size, size_t pageNum8Bytes, size_t pageNum16Bytes, size_t pageNum32Bytes, size_t pageNumMid)
+{
+ m_pPrevPool = NULL;
+ m_pNextPool = NULL;
+ m_bAlone = FALSE;
+ FX_LPBYTE pPage = (FX_LPBYTE)this + sizeof(CFXMEM_Pool);
+ size -= sizeof(CFXMEM_Pool);
+ m_8BytesPages.Initialize(pPage, pageNum8Bytes);
+ pPage += pageNum8Bytes * FX_FIXEDMEM_PAGESIZE;
+ size -= pageNum8Bytes * FX_FIXEDMEM_PAGESIZE;
+ m_16BytesPages.Initialize(pPage, pageNum16Bytes);
+ pPage += pageNum16Bytes * FX_FIXEDMEM_PAGESIZE;
+ size -= pageNum16Bytes * FX_FIXEDMEM_PAGESIZE;
+ m_32BytesPages.Initialize(pPage, pageNum32Bytes);
+ pPage += pageNum32Bytes * FX_FIXEDMEM_PAGESIZE;
+ size -= pageNum32Bytes * FX_FIXEDMEM_PAGESIZE;
+ m_MidPages.Initialize(pPage, pMemConfig->nPageSize_Mid * FX_FIXEDMEM_PAGESIZE, pageNumMid);
+ pPage += pageNumMid * pMemConfig->nPageSize_Mid * FX_FIXEDMEM_PAGESIZE;
+ size -= pageNumMid * pMemConfig->nPageSize_Mid * FX_FIXEDMEM_PAGESIZE;
+ if (size < FX_FIXEDMEM_MIDBLOCKSIZE) {
+ m_pLargePage = NULL;
+ } else {
+ m_pLargePage = (CFXMEM_Page*)pPage;
+ m_pLargePage->Initialize(size);
+ }
+ m_pLimitPos = pPage + size;
+}
+FX_BOOL CFXMEM_Pool::IsEmpty() const
+{
+ if (!m_8BytesPages.IsEmpty()) {
+ return FALSE;
+ }
+ if (!m_16BytesPages.IsEmpty()) {
+ return FALSE;
+ }
+ if (!m_32BytesPages.IsEmpty()) {
+ return FALSE;
+ }
+ if (!m_MidPages.IsEmpty()) {
+ return FALSE;
+ }
+ return !m_pLargePage || m_pLargePage->IsEmpty();
+}
+size_t CFXMEM_Pool::GetSize(FX_LPVOID p) const
+{
+ FXSYS_assert(p > (FX_LPVOID)this && p < (FX_LPVOID)m_pLimitPos);
+ if (p < (FX_LPVOID)m_8BytesPages.m_pLimitPos) {
+ return 8;
+ }
+ if (p < (FX_LPVOID)m_16BytesPages.m_pLimitPos) {
+ return 16;
+ }
+ if (p < (FX_LPVOID)m_32BytesPages.m_pLimitPos) {
+ return 32;
+ }
+ return ((CFXMEM_Block*)p - 1)->m_nBlockSize;
+}
+FX_LPVOID CFXMEM_Pool::Realloc(FX_LPVOID p, size_t oldSize, size_t newSize)
+{
+ FXSYS_assert(p > (FX_LPVOID)this && p < (FX_LPVOID)m_pLimitPos);
+ if (p > (FX_LPVOID)m_32BytesPages.m_pLimitPos) {
+ if (p < (FX_LPVOID)m_MidPages.m_pLimitPos) {
+ return m_MidPages.Realloc(p, oldSize, newSize);
+ } else if (m_pLargePage) {
+ return m_pLargePage->Realloc(p, oldSize, newSize);
+ }
+ }
+ return NULL;
+}
+void CFXMEM_Pool::Free(FX_LPVOID p)
+{
+ FXSYS_assert(p > (FX_LPVOID)this && p < (FX_LPVOID)m_pLimitPos);
+ if (p < (FX_LPVOID)m_32BytesPages.m_pLimitPos) {
+ if (p < (FX_LPVOID)m_8BytesPages.m_pLimitPos) {
+ m_8BytesPages.Free(p);
+ } else if (p < (FX_LPVOID)m_16BytesPages.m_pLimitPos) {
+ m_16BytesPages.Free(p);
+ } else {
+ m_32BytesPages.Free(p);
+ }
+ return;
+ } else if (p < (FX_LPVOID)m_MidPages.m_pLimitPos) {
+ m_MidPages.Free(p);
+ } else {
+ m_pLargePage->Free(p);
+ }
+}
+void CFXMEM_FixedMgr::Initialize(size_t size)
+{
+ m_MemConfig = g_MemConfig;
+ FXSYS_memset32(&m_SystemMgr, 0, sizeof m_SystemMgr);
+ m_SystemMgr.Alloc = FixedAlloc;
+ m_SystemMgr.AllocDebug = FixedAllocDebug;
+ m_SystemMgr.Free = FixedFree;
+ m_SystemMgr.Realloc = FixedRealloc;
+ m_SystemMgr.ReallocDebug = FixedReallocDebug;
+ m_SystemMgr.CollectAll = FixedCollectAll;
+ m_SystemMgr.Purge = FixedPurge;
+ m_SystemMgr.user = this;
+ size -= sizeof(CFXMEM_FixedMgr);
+ size_t nMidPages = 0;
+ if (m_MemConfig.nPageSize_Mid) {
+ nMidPages = (size - (m_MemConfig.nPageNum_Init8 + m_MemConfig.nPageNum_Init16 + m_MemConfig.nPageNum_Init32) * FX_FIXEDMEM_PAGESIZE) / (m_MemConfig.nPageSize_Mid * FX_FIXEDMEM_PAGESIZE);
+ if (nMidPages > m_MemConfig.nPageNum_InitMid) {
+ nMidPages = m_MemConfig.nPageNum_InitMid;
+ }
+ }
+ m_FirstPool.Initialize(&m_MemConfig, size, m_MemConfig.nPageNum_Init8, m_MemConfig.nPageNum_Init16, m_MemConfig.nPageNum_Init32, nMidPages);
+}
+FX_LPVOID CFXMEM_FixedMgr::Alloc16(CFXMEM_Pool **pp32Pool, size_t size)
+{
+ CFXMEM_Pool *pPool = &m_FirstPool;
+ do {
+ CFXMEM_16BytesPages &pages = pPool->m_16BytesPages;
+ if (pages.HasFreeBlock()) {
+ return pages.Alloc(size);
+ }
+ if (pp32Pool && pPool->m_32BytesPages.HasFreeBlock()) {
+ *pp32Pool = pPool;
+ }
+ pPool = pPool->m_pNextPool;
+ } while(pPool);
+ return NULL;
+}
+FX_LPVOID CFXMEM_FixedMgr::Alloc32(size_t size)
+{
+ if (size <= 8) {
+ CFXMEM_8BytesPages &pages = m_FirstPool.m_8BytesPages;
+ if (pages.HasFreeBlock()) {
+ return pages.Alloc(size);
+ }
+ }
+ CFXMEM_Pool *p32BytesPool;
+ if (size <= 16) {
+ p32BytesPool = NULL;
+ FX_LPVOID p = Alloc16(&p32BytesPool, size);
+ if (p) {
+ return p;
+ }
+ } else {
+ p32BytesPool = &m_FirstPool;
+ }
+ while (p32BytesPool) {
+ CFXMEM_32BytesPages &pages = p32BytesPool->m_32BytesPages;
+ if (pages.HasFreeBlock()) {
+ return pages.Alloc(size);
+ }
+ p32BytesPool = p32BytesPool->m_pNextPool;
+ }
+ return NULL;
+}
+FX_LPVOID CFXMEM_FixedMgr::AllocSmall(size_t size)
+{
+ FX_LPVOID p = Alloc32(size);
+ if (p) {
+ return p;
+ }
+ if (!m_pExtender) {
+ return NULL;
+ }
+ size_t requiredSize = (m_MemConfig.nPageNum_More16 + m_MemConfig.nPageNum_More32) * FX_FIXEDMEM_PAGESIZE;
+ if (!requiredSize) {
+ return NULL;
+ }
+ CFXMEM_Pool *pNewPool = NULL;
+ requiredSize += sizeof(CFXMEM_Pool);
+ size_t newSize = requiredSize;
+ if (!m_pExtender->More(m_pExtender, newSize, (void**)&pNewPool, &newSize)) {
+ return NULL;
+ }
+ size_t nMidPages = 0;
+ if (m_MemConfig.nPageSize_Mid) {
+ nMidPages = (newSize - requiredSize) / (m_MemConfig.nPageSize_Mid * FX_FIXEDMEM_PAGESIZE);
+ if (nMidPages > m_MemConfig.nPageNum_MoreMid) {
+ nMidPages = m_MemConfig.nPageNum_MoreMid;
+ }
+ }
+ pNewPool->Initialize(&m_MemConfig, newSize, 0, m_MemConfig.nPageNum_More16, m_MemConfig.nPageNum_More32, nMidPages);
+ pNewPool->m_pPrevPool = &m_FirstPool;
+ CFXMEM_Pool *pPool = m_FirstPool.m_pNextPool;
+ pNewPool->m_pNextPool = pPool;
+ if (pPool) {
+ pPool->m_pPrevPool = pNewPool;
+ }
+ m_FirstPool.m_pNextPool = pNewPool;
+ return Alloc32(size);
+}
+FX_LPVOID CFXMEM_FixedMgr::AllocMid(size_t size)
+{
+ CFXMEM_Pool *pPool = &m_FirstPool;
+ do {
+ CFXMEM_Pages &pages = pPool->m_MidPages;
+ if (pages.m_pLimitPos > pages.m_pStartPage) {
+ FX_LPVOID p = pages.Alloc(size);
+ if (p) {
+ return p;
+ }
+ }
+ pPool = pPool->m_pNextPool;
+ } while(pPool);
+ if (!m_pExtender) {
+ return NULL;
+ }
+ size_t newSize = m_MemConfig.nPageSize_Mid * FX_FIXEDMEM_PAGESIZE * m_MemConfig.nPageNum_MoreMid;
+ if (!newSize) {
+ return NULL;
+ }
+ CFXMEM_Pool *pNewPool = NULL;
+ newSize += sizeof(CFXMEM_Pool);
+ if (!m_pExtender->More(m_pExtender, newSize, (void**)&pNewPool, &newSize)) {
+ return NULL;
+ }
+ size_t nMidPages = (newSize - sizeof(CFXMEM_Pool)) / (m_MemConfig.nPageSize_Mid * FX_FIXEDMEM_PAGESIZE);
+ if (nMidPages > m_MemConfig.nPageNum_MoreMid) {
+ nMidPages = m_MemConfig.nPageNum_MoreMid;
+ }
+ pNewPool->Initialize(&m_MemConfig, newSize, 0, 0, 0, nMidPages);
+ pNewPool->m_pPrevPool = &m_FirstPool;
+ pPool = m_FirstPool.m_pNextPool;
+ pNewPool->m_pNextPool = pPool;
+ if (pPool) {
+ pPool->m_pPrevPool = pNewPool;
+ }
+ m_FirstPool.m_pNextPool = pNewPool;
+ return pNewPool->m_MidPages.Alloc(size);
+}
+FX_LPVOID CFXMEM_FixedMgr::AllocLarge(size_t size)
+{
+ CFXMEM_Pool *pPool = &m_FirstPool;
+ do {
+ if (!pPool->m_bAlone && pPool->m_pLargePage) {
+ FX_LPVOID p = pPool->m_pLargePage->Alloc(size);
+ if (p) {
+ return p;
+ }
+ }
+ pPool = pPool->m_pNextPool;
+ } while(pPool);
+ if (!m_pExtender || !m_MemConfig.nPageSize_Large) {
+ return NULL;
+ }
+ CFXMEM_Pool *pNewPool = NULL;
+#if _FX_WORDSIZE_ == _FX_W64_
+ size_t newSize = ((size + 31) / 32 * 32 + sizeof(CFXMEM_Pool) + sizeof(CFXMEM_Page) + sizeof(CFXMEM_Block) + 4095) / 4096 * 4096;
+#else
+ size_t newSize = (size + 7) / 8 * 8 + sizeof(CFXMEM_Pool) + sizeof(CFXMEM_Page) + sizeof(CFXMEM_Block);
+#endif
+ if (newSize < m_MemConfig.nPageSize_Large * FX_FIXEDMEM_PAGESIZE) {
+ newSize = m_MemConfig.nPageSize_Large * FX_FIXEDMEM_PAGESIZE;
+ }
+ if (!m_pExtender->More(m_pExtender, newSize, (void**)&pNewPool, &newSize)) {
+ return NULL;
+ }
+ pNewPool->Initialize(&m_MemConfig, newSize, 0, 0, 0, 0);
+ pNewPool->m_bAlone = size >= m_MemConfig.nPageSize_Alone * FX_FIXEDMEM_PAGESIZE;
+ pNewPool->m_pPrevPool = &m_FirstPool;
+ pPool = m_FirstPool.m_pNextPool;
+ pNewPool->m_pNextPool = pPool;
+ if (pPool) {
+ pPool->m_pPrevPool = pNewPool;
+ }
+ m_FirstPool.m_pNextPool = pNewPool;
+ return pNewPool->m_pLargePage->Alloc(size);
+}
+size_t CFXMEM_FixedMgr::GetSize(FX_LPVOID p) const
+{
+ const CFXMEM_Pool *pFind = &m_FirstPool;
+ do {
+ if (p > (FX_LPVOID)pFind && p < pFind->m_pLimitPos) {
+ return pFind->GetSize(p);
+ }
+ pFind = pFind->m_pNextPool;
+ } while (pFind);
+ return 0;
+}
+FX_LPVOID CFXMEM_FixedMgr::Alloc(size_t size)
+{
+ FX_LPVOID p;
+ if (size <= 32) {
+ p = AllocSmall(size);
+ if (p) {
+ return p;
+ }
+ }
+ if (size <= FX_FIXEDMEM_MIDBLOCKSIZE) {
+ p = AllocMid(size);
+ if (p) {
+ return p;
+ }
+ }
+ p = AllocLarge(size);
+ return p;
+}
+FX_LPVOID CFXMEM_FixedMgr::ReallocSmall(CFXMEM_Pool* pPool, FX_LPVOID p, size_t oldSize, size_t newSize)
+{
+ FX_LPVOID np = AllocSmall(newSize);
+ if (!np) {
+ return NULL;
+ }
+ FXSYS_memcpy32(np, p, oldSize);
+ pPool->Free(p);
+ return np;
+}
+FX_LPVOID CFXMEM_FixedMgr::Realloc(FX_LPVOID p, size_t newSize)
+{
+ if (!p) {
+ return Alloc(newSize);
+ }
+ size_t oldSize = 0;
+ CFXMEM_Pool *pFind = &m_FirstPool;
+ do {
+ if (p > (FX_LPVOID)pFind && p < pFind->m_pLimitPos) {
+ oldSize = pFind->GetSize(p);
+ if (oldSize >= newSize) {
+ return p;
+ }
+ break;
+ }
+ pFind = pFind->m_pNextPool;
+ } while (pFind);
+ if (!oldSize || !pFind) {
+ return Alloc(newSize);
+ }
+ FX_LPVOID np = NULL;
+ if (newSize <= 32) {
+ np = ReallocSmall(pFind, p, oldSize, newSize);
+ if (np) {
+ return np;
+ }
+ }
+ if (newSize <= FX_FIXEDMEM_MIDBLOCKSIZE) {
+ np = pFind->Realloc(p, oldSize, newSize);
+ if (np) {
+ return np;
+ }
+ }
+ np = Alloc(newSize);
+ if (np) {
+ FXSYS_memcpy32(np, p, oldSize);
+ pFind->Free(p);
+ }
+ if (pFind->m_bAlone && pFind->IsEmpty()) {
+ FreePool(pFind);
+ }
+ return np;
+}
+void CFXMEM_FixedMgr::Free(FX_LPVOID p)
+{
+ CFXMEM_Pool *pFind = &m_FirstPool;
+ do {
+ if (p > (FX_LPVOID)pFind && p < pFind->m_pLimitPos) {
+ pFind->Free(p);
+ if (pFind->m_bAlone && pFind->IsEmpty()) {
+ FreePool(pFind);
+ }
+ return;
+ }
+ pFind = pFind->m_pNextPool;
+ } while (pFind);
+}
+void CFXMEM_FixedMgr::FreePool(CFXMEM_Pool* pPool)
+{
+ FXSYS_assert(pPool->m_bAlone && pPool->IsEmpty());
+ FXSYS_assert(m_pExtender != NULL);
+ CFXMEM_Pool* pPrevPool = pPool->m_pPrevPool;
+ CFXMEM_Pool* pNextPool = pPool->m_pNextPool;
+ if (pPrevPool) {
+ pPrevPool->m_pNextPool = pNextPool;
+ }
+ if (pNextPool) {
+ pNextPool->m_pPrevPool = pPrevPool;
+ }
+ m_pExtender->Free(m_pExtender, pPool);
+}
+void CFXMEM_FixedMgr::FreeAll()
+{
+ if (!m_pExtender) {
+ return;
+ }
+ CFXMEM_Pool* pPool = m_FirstPool.m_pNextPool;
+ while (pPool) {
+ CFXMEM_Pool* pPrevPool = pPool;
+ pPool = pPool->m_pNextPool;
+ m_pExtender->Free(m_pExtender, pPrevPool);
+ }
+ m_FirstPool.m_pNextPool = NULL;
+}
+void CFXMEM_FixedMgr::Purge()
+{
+ if (!m_pExtender) {
+ return;
+ }
+ CFXMEM_Pool* pPool = m_FirstPool.m_pNextPool;
+ while (pPool) {
+ CFXMEM_Pool* pNextPool = pPool->m_pNextPool;
+ if (pPool->IsEmpty()) {
+ CFXMEM_Pool* pPrevPool = pPool->m_pPrevPool;
+ pPrevPool->m_pNextPool = pNextPool;
+ if (pNextPool) {
+ pNextPool->m_pPrevPool = pPrevPool;
+ }
+ m_pExtender->Free(m_pExtender, pPool);
+ }
+ pPool = pNextPool;
+ }
+}
+extern const FX_BYTE OneLeadPos[256] = {
+ 8, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+};
+extern const FX_BYTE ZeroLeadPos[256] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 7, 8,
+};
diff --git a/core/src/fxcrt/fx_basic_plex.cpp b/core/src/fxcrt/fx_basic_plex.cpp
index dd3a8ba054..80c014a2b3 100644
--- a/core/src/fxcrt/fx_basic_plex.cpp
+++ b/core/src/fxcrt/fx_basic_plex.cpp
@@ -1,28 +1,28 @@
-// 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
-
-#include "../../include/fxcrt/fx_basic.h"
-#include "plex.h"
-CFX_Plex* CFX_Plex::Create(IFX_Allocator* pAllocator, CFX_Plex*& pHead, FX_DWORD nMax, FX_DWORD cbElement)
-{
- CFX_Plex* p = (CFX_Plex*)FX_Allocator_Alloc(pAllocator, FX_BYTE, sizeof(CFX_Plex) + nMax * cbElement);
- if (!p) {
- return NULL;
- }
- p->pNext = pHead;
- pHead = p;
- return p;
-}
-void CFX_Plex::FreeDataChain(IFX_Allocator* pAllocator)
-{
- CFX_Plex* p = this;
- while (p != NULL) {
- FX_BYTE* bytes = (FX_BYTE*) p;
- CFX_Plex* pNext = p->pNext;
- FX_Allocator_Free(pAllocator, bytes);
- p = pNext;
- }
-}
+// 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
+
+#include "../../include/fxcrt/fx_basic.h"
+#include "plex.h"
+CFX_Plex* CFX_Plex::Create(IFX_Allocator* pAllocator, CFX_Plex*& pHead, FX_DWORD nMax, FX_DWORD cbElement)
+{
+ CFX_Plex* p = (CFX_Plex*)FX_Allocator_Alloc(pAllocator, FX_BYTE, sizeof(CFX_Plex) + nMax * cbElement);
+ if (!p) {
+ return NULL;
+ }
+ p->pNext = pHead;
+ pHead = p;
+ return p;
+}
+void CFX_Plex::FreeDataChain(IFX_Allocator* pAllocator)
+{
+ CFX_Plex* p = this;
+ while (p != NULL) {
+ FX_BYTE* bytes = (FX_BYTE*) p;
+ CFX_Plex* pNext = p->pNext;
+ FX_Allocator_Free(pAllocator, bytes);
+ p = pNext;
+ }
+}
diff --git a/core/src/fxcrt/fx_basic_utf.cpp b/core/src/fxcrt/fx_basic_utf.cpp
index b94e08df1d..c5aa360e6c 100644
--- a/core/src/fxcrt/fx_basic_utf.cpp
+++ b/core/src/fxcrt/fx_basic_utf.cpp
@@ -1,102 +1,102 @@
-// 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
-
-#include "../../include/fxcrt/fx_basic.h"
-void CFX_UTF8Decoder::Clear()
-{
- m_Buffer.Clear();
- m_PendingBytes = 0;
-}
-void CFX_UTF8Decoder::AppendChar(FX_DWORD ch)
-{
- m_Buffer.AppendChar((FX_WCHAR)ch);
-}
-void CFX_UTF8Decoder::Input(FX_BYTE byte)
-{
- if (byte < 0x80) {
- m_PendingBytes = 0;
- m_Buffer.AppendChar(byte);
- } else if (byte < 0xc0) {
- if (m_PendingBytes == 0) {
- return;
- }
- m_PendingBytes --;
- m_PendingChar |= (byte & 0x3f) << (m_PendingBytes * 6);
- if (m_PendingBytes == 0) {
- AppendChar(m_PendingChar);
- }
- } else if (byte < 0xe0) {
- m_PendingBytes = 1;
- m_PendingChar = (byte & 0x1f) << 6;
- } else if (byte < 0xf0) {
- m_PendingBytes = 2;
- m_PendingChar = (byte & 0x0f) << 12;
- } else if (byte < 0xf8) {
- m_PendingBytes = 3;
- m_PendingChar = (byte & 0x07) << 18;
- } else if (byte < 0xfc) {
- m_PendingBytes = 4;
- m_PendingChar = (byte & 0x03) << 24;
- } else if (byte < 0xfe) {
- m_PendingBytes = 5;
- m_PendingChar = (byte & 0x01) << 30;
- }
-}
-void CFX_UTF8Encoder::Input(FX_WCHAR unicode)
-{
- if ((FX_DWORD)unicode < 0x80) {
- m_Buffer.AppendChar(unicode);
- } else {
- if ((FX_DWORD)unicode >= 0x80000000) {
- return;
- }
- int nbytes = 0;
- if ((FX_DWORD)unicode < 0x800) {
- nbytes = 2;
- } else if ((FX_DWORD)unicode < 0x10000) {
- nbytes = 3;
- } else if ((FX_DWORD)unicode < 0x200000) {
- nbytes = 4;
- } else if ((FX_DWORD)unicode < 0x4000000) {
- nbytes = 5;
- } else {
- nbytes = 6;
- }
- static FX_BYTE prefix[] = {0xc0, 0xe0, 0xf0, 0xf8, 0xfc};
- int order = 1 << ((nbytes - 1) * 6);
- int code = unicode;
- m_Buffer.AppendChar(prefix[nbytes - 2] | (code / order));
- for (int i = 0; i < nbytes - 1; i ++) {
- code = code % order;
- order >>= 6;
- m_Buffer.AppendChar(0x80 | (code / order));
- }
- }
-}
-CFX_ByteString FX_UTF8Encode(FX_LPCWSTR pwsStr, FX_STRSIZE len)
-{
- FXSYS_assert(pwsStr != NULL);
- if (len < 0) {
- len = (FX_STRSIZE)FXSYS_wcslen(pwsStr);
- }
- CFX_UTF8Encoder encoder;
- while (len -- > 0) {
- encoder.Input(*pwsStr ++);
- }
- return encoder.GetResult();
-}
-void FX_UTF8Encode(FX_LPCWSTR pwsStr, FX_STRSIZE len, CFX_ByteStringL &utf8Str, IFX_Allocator* pAllocator)
-{
- FXSYS_assert(pwsStr != NULL);
- if (len < 0) {
- len = (FX_STRSIZE)FXSYS_wcslen(pwsStr);
- }
- CFX_UTF8Encoder encoder(pAllocator);
- while (len -- > 0) {
- encoder.Input(*pwsStr ++);
- }
- encoder.GetResult(utf8Str);
-}
+// 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
+
+#include "../../include/fxcrt/fx_basic.h"
+void CFX_UTF8Decoder::Clear()
+{
+ m_Buffer.Clear();
+ m_PendingBytes = 0;
+}
+void CFX_UTF8Decoder::AppendChar(FX_DWORD ch)
+{
+ m_Buffer.AppendChar((FX_WCHAR)ch);
+}
+void CFX_UTF8Decoder::Input(FX_BYTE byte)
+{
+ if (byte < 0x80) {
+ m_PendingBytes = 0;
+ m_Buffer.AppendChar(byte);
+ } else if (byte < 0xc0) {
+ if (m_PendingBytes == 0) {
+ return;
+ }
+ m_PendingBytes --;
+ m_PendingChar |= (byte & 0x3f) << (m_PendingBytes * 6);
+ if (m_PendingBytes == 0) {
+ AppendChar(m_PendingChar);
+ }
+ } else if (byte < 0xe0) {
+ m_PendingBytes = 1;
+ m_PendingChar = (byte & 0x1f) << 6;
+ } else if (byte < 0xf0) {
+ m_PendingBytes = 2;
+ m_PendingChar = (byte & 0x0f) << 12;
+ } else if (byte < 0xf8) {
+ m_PendingBytes = 3;
+ m_PendingChar = (byte & 0x07) << 18;
+ } else if (byte < 0xfc) {
+ m_PendingBytes = 4;
+ m_PendingChar = (byte & 0x03) << 24;
+ } else if (byte < 0xfe) {
+ m_PendingBytes = 5;
+ m_PendingChar = (byte & 0x01) << 30;
+ }
+}
+void CFX_UTF8Encoder::Input(FX_WCHAR unicode)
+{
+ if ((FX_DWORD)unicode < 0x80) {
+ m_Buffer.AppendChar(unicode);
+ } else {
+ if ((FX_DWORD)unicode >= 0x80000000) {
+ return;
+ }
+ int nbytes = 0;
+ if ((FX_DWORD)unicode < 0x800) {
+ nbytes = 2;
+ } else if ((FX_DWORD)unicode < 0x10000) {
+ nbytes = 3;
+ } else if ((FX_DWORD)unicode < 0x200000) {
+ nbytes = 4;
+ } else if ((FX_DWORD)unicode < 0x4000000) {
+ nbytes = 5;
+ } else {
+ nbytes = 6;
+ }
+ static FX_BYTE prefix[] = {0xc0, 0xe0, 0xf0, 0xf8, 0xfc};
+ int order = 1 << ((nbytes - 1) * 6);
+ int code = unicode;
+ m_Buffer.AppendChar(prefix[nbytes - 2] | (code / order));
+ for (int i = 0; i < nbytes - 1; i ++) {
+ code = code % order;
+ order >>= 6;
+ m_Buffer.AppendChar(0x80 | (code / order));
+ }
+ }
+}
+CFX_ByteString FX_UTF8Encode(FX_LPCWSTR pwsStr, FX_STRSIZE len)
+{
+ FXSYS_assert(pwsStr != NULL);
+ if (len < 0) {
+ len = (FX_STRSIZE)FXSYS_wcslen(pwsStr);
+ }
+ CFX_UTF8Encoder encoder;
+ while (len -- > 0) {
+ encoder.Input(*pwsStr ++);
+ }
+ return encoder.GetResult();
+}
+void FX_UTF8Encode(FX_LPCWSTR pwsStr, FX_STRSIZE len, CFX_ByteStringL &utf8Str, IFX_Allocator* pAllocator)
+{
+ FXSYS_assert(pwsStr != NULL);
+ if (len < 0) {
+ len = (FX_STRSIZE)FXSYS_wcslen(pwsStr);
+ }
+ CFX_UTF8Encoder encoder(pAllocator);
+ while (len -- > 0) {
+ encoder.Input(*pwsStr ++);
+ }
+ encoder.GetResult(utf8Str);
+}
diff --git a/core/src/fxcrt/fx_basic_util.cpp b/core/src/fxcrt/fx_basic_util.cpp
index af4d42c0ae..1d947d3fed 100644
--- a/core/src/fxcrt/fx_basic_util.cpp
+++ b/core/src/fxcrt/fx_basic_util.cpp
@@ -1,444 +1,444 @@
-// 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
-
-#include "../../include/fxcrt/fx_basic.h"
-#if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_
-#include <sys/types.h>
-#include <dirent.h>
-#else
-#include <direct.h>
-#endif
-CFX_PrivateData::~CFX_PrivateData()
-{
- ClearAll();
-}
-void FX_PRIVATEDATA::FreeData()
-{
- if (m_pData == NULL) {
- return;
- }
- if (m_bSelfDestruct) {
- delete (CFX_DestructObject*)m_pData;
- } else if (m_pCallback) {
- m_pCallback(m_pData);
- }
-}
-void CFX_PrivateData::AddData(FX_LPVOID pModuleId, FX_LPVOID pData, PD_CALLBACK_FREEDATA callback, FX_BOOL bSelfDestruct)
-{
- if (pModuleId == NULL) {
- return;
- }
- FX_PRIVATEDATA* pList = m_DataList.GetData();
- int count = m_DataList.GetSize();
- for (int i = 0; i < count; i ++) {
- if (pList[i].m_pModuleId == pModuleId) {
- pList[i].FreeData();
- pList[i].m_pData = pData;
- pList[i].m_pCallback = callback;
- return;
- }
- }
- FX_PRIVATEDATA data = {pModuleId, pData, callback, bSelfDestruct};
- m_DataList.Add(data);
-}
-void CFX_PrivateData::SetPrivateData(FX_LPVOID pModuleId, FX_LPVOID pData, PD_CALLBACK_FREEDATA callback)
-{
- AddData(pModuleId, pData, callback, FALSE);
-}
-void CFX_PrivateData::SetPrivateObj(FX_LPVOID pModuleId, CFX_DestructObject* pObj)
-{
- AddData(pModuleId, pObj, NULL, TRUE);
-}
-FX_BOOL CFX_PrivateData::RemovePrivateData(FX_LPVOID pModuleId)
-{
- if (pModuleId == NULL) {
- return FALSE;
- }
- FX_PRIVATEDATA* pList = m_DataList.GetData();
- int count = m_DataList.GetSize();
- for (int i = 0; i < count; i ++) {
- if (pList[i].m_pModuleId == pModuleId) {
- m_DataList.RemoveAt(i);
- return TRUE;
- }
- }
- return FALSE;
-}
-FX_LPVOID CFX_PrivateData::GetPrivateData(FX_LPVOID pModuleId)
-{
- if (pModuleId == NULL) {
- return NULL;
- }
- FX_PRIVATEDATA* pList = m_DataList.GetData();
- int count = m_DataList.GetSize();
- for (int i = 0; i < count; i ++) {
- if (pList[i].m_pModuleId == pModuleId) {
- return pList[i].m_pData;
- }
- }
- return NULL;
-}
-void CFX_PrivateData::ClearAll()
-{
- FX_PRIVATEDATA* pList = m_DataList.GetData();
- int count = m_DataList.GetSize();
- for (int i = 0; i < count; i ++) {
- pList[i].FreeData();
- }
- m_DataList.RemoveAll();
-}
-void FX_atonum(FX_BSTR strc, FX_BOOL& bInteger, void* pData)
-{
- if (FXSYS_memchr(strc.GetPtr(), '.', strc.GetLength()) == NULL) {
- bInteger = TRUE;
- int cc = 0, integer = 0;
- FX_LPCSTR str = strc.GetCStr();
- int len = strc.GetLength();
- FX_BOOL bNegative = FALSE;
- if (str[0] == '+') {
- cc++;
- } else if (str[0] == '-') {
- bNegative = TRUE;
- cc++;
- }
- while (cc < len) {
- if (str[cc] < '0' || str[cc] > '9') {
- break;
- }
- integer = integer * 10 + str[cc] - '0';
- if (integer < 0) {
- break;
- }
- cc ++;
- }
- if (bNegative) {
- integer = -integer;
- }
- *(int*)pData = integer;
- } else {
- bInteger = FALSE;
- *(FX_FLOAT*)pData = FX_atof(strc);
- }
-}
-FX_FLOAT FX_atof(FX_BSTR strc)
-{
- if (strc.GetLength() == 0) {
- return 0.0;
- }
- int cc = 0;
- FX_BOOL bNegative = FALSE;
- FX_LPCSTR str = strc.GetCStr();
- int len = strc.GetLength();
- if (str[0] == '+') {
- cc++;
- } else if (str[0] == '-') {
- bNegative = TRUE;
- cc++;
- }
- while (cc < len) {
- if (str[cc] != '+' && str[cc] != '-') {
- break;
- }
- cc ++;
- }
- FX_FLOAT value = 0;
- while (cc < len) {
- if (str[cc] == '.') {
- break;
- }
- value = value * 10 + str[cc] - '0';
- cc ++;
- }
- static const FX_FLOAT fraction_scales[] = {0.1f, 0.01f, 0.001f, 0.0001f, 0.00001f, 0.000001f,
- 0.0000001f, 0.00000001f, 0.000000001f, 0.0000000001f, 0.00000000001f
- };
- int scale = 0;
- if (cc < len && str[cc] == '.') {
- cc ++;
- while (cc < len) {
- value += fraction_scales[scale] * (str[cc] - '0');
- scale ++;
- if (scale == sizeof fraction_scales / sizeof(FX_FLOAT)) {
- break;
- }
- cc ++;
- }
- }
- return bNegative ? -value : value;
-}
-static FX_BOOL FX_IsDigit(FX_BYTE ch)
-{
- return (ch >= '0' && ch <= '9') ? TRUE : FALSE;
-}
-static FX_BOOL FX_IsXDigit(FX_BYTE ch)
-{
- return (FX_IsDigit(ch) || (ch >= 'A' && ch <= 'F') || (ch >= 'a' && ch <= 'f')) ? TRUE : FALSE;
-}
-static FX_BYTE FX_MakeUpper(FX_BYTE ch)
-{
- if (ch < 'a' || ch > 'z') {
- return ch;
- }
- return ch - 32;
-}
-static int FX_HexToI(FX_BYTE ch)
-{
- ch = FX_MakeUpper(ch);
- return FX_IsDigit(ch) ? (ch - '0') : (ch - 55);
-}
-static const unsigned char url_encodeTable[128] = {
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 0, 1, 1, 0, 1, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1, 0, 1, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 1, 1, 1, 1, 0,
- 1, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 1, 1, 1, 1, 1,
-};
-CFX_ByteString FX_UrlEncode(const CFX_WideString& wsUrl)
-{
- const char arDigits[] = "0123456789ABCDEF";
- CFX_ByteString rUrl;
- int nLength = wsUrl.GetLength();
- for (int i = 0; i < nLength; i++) {
- FX_DWORD word = wsUrl.GetAt(i);
- if (word > 0x7F || url_encodeTable[word] == 1) {
- CFX_ByteString bsUri = CFX_ByteString::FromUnicode((FX_WORD)word);
- int nByte = bsUri.GetLength();
- for (int j = 0; j < nByte; j++) {
- rUrl += '%';
- FX_BYTE code = bsUri.GetAt(j);
- rUrl += arDigits[code >> 4];
- rUrl += arDigits[code & 0x0F];
- }
- } else {
- rUrl += CFX_ByteString::FromUnicode((FX_WORD)word);
- }
- }
- return rUrl;
-}
-CFX_WideString FX_UrlDecode(const CFX_ByteString& bsUrl)
-{
- CFX_ByteString rUrl;
- int nLength = bsUrl.GetLength();
- for (int i = 0; i < nLength; i++) {
- if (i < nLength - 2 && bsUrl[i] == '%' && FX_IsXDigit(bsUrl[i + 1]) && FX_IsXDigit(bsUrl[i + 2])) {
- rUrl += (FX_HexToI(bsUrl[i + 1]) << 4 | FX_HexToI(bsUrl[i + 2]));
- i += 2;
- } else {
- rUrl += bsUrl[i];
- }
- }
- return CFX_WideString::FromLocal(rUrl);
-}
-CFX_ByteString FX_EncodeURI(const CFX_WideString& wsURI)
-{
- const char arDigits[] = "0123456789ABCDEF";
- CFX_ByteString rURI;
- CFX_ByteString bsUri = wsURI.UTF8Encode();
- int nLength = bsUri.GetLength();
- for (int i = 0; i < nLength; i++) {
- FX_BYTE code = bsUri.GetAt(i);
- if (code > 0x7F || url_encodeTable[code] == 1) {
- rURI += '%';
- rURI += arDigits[code >> 4];
- rURI += arDigits[code & 0x0F];
- } else {
- rURI += code;
- }
- }
- return rURI;
-}
-CFX_WideString FX_DecodeURI(const CFX_ByteString& bsURI)
-{
- CFX_ByteString rURI;
- int nLength = bsURI.GetLength();
- for (int i = 0; i < nLength; i++) {
- if (i < nLength - 2 && bsURI[i] == '%' && FX_IsXDigit(bsURI[i + 1]) && FX_IsXDigit(bsURI[i + 2])) {
- rURI += (FX_HexToI(bsURI[i + 1]) << 4 | FX_HexToI(bsURI[i + 2]));
- i += 2;
- } else {
- rURI += bsURI[i];
- }
- }
- return CFX_WideString::FromUTF8(rURI);
-}
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
-class CFindFileData : public CFX_Object
-{
-public:
- virtual ~CFindFileData() {}
- HANDLE m_Handle;
- FX_BOOL m_bEnd;
-};
-class CFindFileDataA : public CFindFileData
-{
-public:
- virtual ~CFindFileDataA() {}
- WIN32_FIND_DATAA m_FindData;
-};
-class CFindFileDataW : public CFindFileData
-{
-public:
- virtual ~CFindFileDataW() {}
- WIN32_FIND_DATAW m_FindData;
-};
-#endif
-void* FX_OpenFolder(FX_LPCSTR path)
-{
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
-#ifndef _WIN32_WCE
- CFindFileDataA* pData = FX_NEW CFindFileDataA;
- if (!pData) {
- return NULL;
- }
-#ifdef _FX_WINAPI_PARTITION_DESKTOP_
- pData->m_Handle = FindFirstFileA(CFX_ByteString(path) + "/*.*", &pData->m_FindData);
-#else
- pData->m_Handle = FindFirstFileExA(CFX_ByteString(path) + "/*.*", FindExInfoStandard, &pData->m_FindData, FindExSearchNameMatch, NULL, 0);
-#endif
-#else
- CFindFileDataW* pData = FX_NEW CFindFileDataW;
- if (!pData) {
- return NULL;
- }
- pData->m_Handle = FindFirstFileW(CFX_WideString::FromLocal(path) + L"/*.*", &pData->m_FindData);
-#endif
- if (pData->m_Handle == INVALID_HANDLE_VALUE) {
- delete pData;
- return NULL;
- }
- pData->m_bEnd = FALSE;
- return pData;
-#else
- DIR* dir = opendir(path);
- return dir;
-#endif
-}
-void* FX_OpenFolder(FX_LPCWSTR path)
-{
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
- CFindFileDataW* pData = FX_NEW CFindFileDataW;
- if (!pData) {
- return NULL;
- }
-#ifdef _FX_WINAPI_PARTITION_DESKTOP_
- pData->m_Handle = FindFirstFileW(CFX_WideString(path) + L"/*.*", &pData->m_FindData);
-#else
- pData->m_Handle = FindFirstFileExW(CFX_WideString(path) + L"/*.*", FindExInfoStandard, &pData->m_FindData, FindExSearchNameMatch, NULL, 0);
-#endif
- if (pData->m_Handle == INVALID_HANDLE_VALUE) {
- delete pData;
- return NULL;
- }
- pData->m_bEnd = FALSE;
- return pData;
-#else
- DIR* dir = opendir(CFX_ByteString::FromUnicode(path));
- return dir;
-#endif
-}
-FX_BOOL FX_GetNextFile(void* handle, CFX_ByteString& filename, FX_BOOL& bFolder)
-{
- if (handle == NULL) {
- return FALSE;
- }
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
-#ifndef _WIN32_WCE
- CFindFileDataA* pData = (CFindFileDataA*)handle;
- if (pData->m_bEnd) {
- return FALSE;
- }
- filename = pData->m_FindData.cFileName;
- bFolder = pData->m_FindData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY;
- if (!FindNextFileA(pData->m_Handle, &pData->m_FindData)) {
- pData->m_bEnd = TRUE;
- }
- return TRUE;
-#else
- CFindFileDataW* pData = (CFindFileDataW*)handle;
- if (pData->m_bEnd) {
- return FALSE;
- }
- filename = CFX_ByteString::FromUnicode(pData->m_FindData.cFileName);
- bFolder = pData->m_FindData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY;
- if (!FindNextFileW(pData->m_Handle, &pData->m_FindData)) {
- pData->m_bEnd = TRUE;
- }
- return TRUE;
-#endif
-#elif defined(__native_client__)
- abort();
- return FALSE;
-#else
- struct dirent *de = readdir((DIR*)handle);
- if (de == NULL) {
- return FALSE;
- }
- filename = de->d_name;
- bFolder = de->d_type == DT_DIR;
- return TRUE;
-#endif
-}
-FX_BOOL FX_GetNextFile(void* handle, CFX_WideString& filename, FX_BOOL& bFolder)
-{
- if (handle == NULL) {
- return FALSE;
- }
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
- CFindFileDataW* pData = (CFindFileDataW*)handle;
- if (pData->m_bEnd) {
- return FALSE;
- }
- filename = pData->m_FindData.cFileName;
- bFolder = pData->m_FindData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY;
- if (!FindNextFileW(pData->m_Handle, &pData->m_FindData)) {
- pData->m_bEnd = TRUE;
- }
- return TRUE;
-#elif defined(__native_client__)
- abort();
- return FALSE;
-#else
- struct dirent *de = readdir((DIR*)handle);
- if (de == NULL) {
- return FALSE;
- }
- filename = CFX_WideString::FromLocal(de->d_name);
- bFolder = de->d_type == DT_DIR;
- return TRUE;
-#endif
-}
-void FX_CloseFolder(void* handle)
-{
- if (handle == NULL) {
- return;
- }
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
- CFindFileData* pData = (CFindFileData*)handle;
- FindClose(pData->m_Handle);
- delete pData;
-#else
- closedir((DIR*)handle);
-#endif
-}
-FX_WCHAR FX_GetFolderSeparator()
-{
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
- return '\\';
-#else
- return '/';
-#endif
-}
+// 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
+
+#include "../../include/fxcrt/fx_basic.h"
+#if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_
+#include <sys/types.h>
+#include <dirent.h>
+#else
+#include <direct.h>
+#endif
+CFX_PrivateData::~CFX_PrivateData()
+{
+ ClearAll();
+}
+void FX_PRIVATEDATA::FreeData()
+{
+ if (m_pData == NULL) {
+ return;
+ }
+ if (m_bSelfDestruct) {
+ delete (CFX_DestructObject*)m_pData;
+ } else if (m_pCallback) {
+ m_pCallback(m_pData);
+ }
+}
+void CFX_PrivateData::AddData(FX_LPVOID pModuleId, FX_LPVOID pData, PD_CALLBACK_FREEDATA callback, FX_BOOL bSelfDestruct)
+{
+ if (pModuleId == NULL) {
+ return;
+ }
+ FX_PRIVATEDATA* pList = m_DataList.GetData();
+ int count = m_DataList.GetSize();
+ for (int i = 0; i < count; i ++) {
+ if (pList[i].m_pModuleId == pModuleId) {
+ pList[i].FreeData();
+ pList[i].m_pData = pData;
+ pList[i].m_pCallback = callback;
+ return;
+ }
+ }
+ FX_PRIVATEDATA data = {pModuleId, pData, callback, bSelfDestruct};
+ m_DataList.Add(data);
+}
+void CFX_PrivateData::SetPrivateData(FX_LPVOID pModuleId, FX_LPVOID pData, PD_CALLBACK_FREEDATA callback)
+{
+ AddData(pModuleId, pData, callback, FALSE);
+}
+void CFX_PrivateData::SetPrivateObj(FX_LPVOID pModuleId, CFX_DestructObject* pObj)
+{
+ AddData(pModuleId, pObj, NULL, TRUE);
+}
+FX_BOOL CFX_PrivateData::RemovePrivateData(FX_LPVOID pModuleId)
+{
+ if (pModuleId == NULL) {
+ return FALSE;
+ }
+ FX_PRIVATEDATA* pList = m_DataList.GetData();
+ int count = m_DataList.GetSize();
+ for (int i = 0; i < count; i ++) {
+ if (pList[i].m_pModuleId == pModuleId) {
+ m_DataList.RemoveAt(i);
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+FX_LPVOID CFX_PrivateData::GetPrivateData(FX_LPVOID pModuleId)
+{
+ if (pModuleId == NULL) {
+ return NULL;
+ }
+ FX_PRIVATEDATA* pList = m_DataList.GetData();
+ int count = m_DataList.GetSize();
+ for (int i = 0; i < count; i ++) {
+ if (pList[i].m_pModuleId == pModuleId) {
+ return pList[i].m_pData;
+ }
+ }
+ return NULL;
+}
+void CFX_PrivateData::ClearAll()
+{
+ FX_PRIVATEDATA* pList = m_DataList.GetData();
+ int count = m_DataList.GetSize();
+ for (int i = 0; i < count; i ++) {
+ pList[i].FreeData();
+ }
+ m_DataList.RemoveAll();
+}
+void FX_atonum(FX_BSTR strc, FX_BOOL& bInteger, void* pData)
+{
+ if (FXSYS_memchr(strc.GetPtr(), '.', strc.GetLength()) == NULL) {
+ bInteger = TRUE;
+ int cc = 0, integer = 0;
+ FX_LPCSTR str = strc.GetCStr();
+ int len = strc.GetLength();
+ FX_BOOL bNegative = FALSE;
+ if (str[0] == '+') {
+ cc++;
+ } else if (str[0] == '-') {
+ bNegative = TRUE;
+ cc++;
+ }
+ while (cc < len) {
+ if (str[cc] < '0' || str[cc] > '9') {
+ break;
+ }
+ integer = integer * 10 + str[cc] - '0';
+ if (integer < 0) {
+ break;
+ }
+ cc ++;
+ }
+ if (bNegative) {
+ integer = -integer;
+ }
+ *(int*)pData = integer;
+ } else {
+ bInteger = FALSE;
+ *(FX_FLOAT*)pData = FX_atof(strc);
+ }
+}
+FX_FLOAT FX_atof(FX_BSTR strc)
+{
+ if (strc.GetLength() == 0) {
+ return 0.0;
+ }
+ int cc = 0;
+ FX_BOOL bNegative = FALSE;
+ FX_LPCSTR str = strc.GetCStr();
+ int len = strc.GetLength();
+ if (str[0] == '+') {
+ cc++;
+ } else if (str[0] == '-') {
+ bNegative = TRUE;
+ cc++;
+ }
+ while (cc < len) {
+ if (str[cc] != '+' && str[cc] != '-') {
+ break;
+ }
+ cc ++;
+ }
+ FX_FLOAT value = 0;
+ while (cc < len) {
+ if (str[cc] == '.') {
+ break;
+ }
+ value = value * 10 + str[cc] - '0';
+ cc ++;
+ }
+ static const FX_FLOAT fraction_scales[] = {0.1f, 0.01f, 0.001f, 0.0001f, 0.00001f, 0.000001f,
+ 0.0000001f, 0.00000001f, 0.000000001f, 0.0000000001f, 0.00000000001f
+ };
+ int scale = 0;
+ if (cc < len && str[cc] == '.') {
+ cc ++;
+ while (cc < len) {
+ value += fraction_scales[scale] * (str[cc] - '0');
+ scale ++;
+ if (scale == sizeof fraction_scales / sizeof(FX_FLOAT)) {
+ break;
+ }
+ cc ++;
+ }
+ }
+ return bNegative ? -value : value;
+}
+static FX_BOOL FX_IsDigit(FX_BYTE ch)
+{
+ return (ch >= '0' && ch <= '9') ? TRUE : FALSE;
+}
+static FX_BOOL FX_IsXDigit(FX_BYTE ch)
+{
+ return (FX_IsDigit(ch) || (ch >= 'A' && ch <= 'F') || (ch >= 'a' && ch <= 'f')) ? TRUE : FALSE;
+}
+static FX_BYTE FX_MakeUpper(FX_BYTE ch)
+{
+ if (ch < 'a' || ch > 'z') {
+ return ch;
+ }
+ return ch - 32;
+}
+static int FX_HexToI(FX_BYTE ch)
+{
+ ch = FX_MakeUpper(ch);
+ return FX_IsDigit(ch) ? (ch - '0') : (ch - 55);
+}
+static const unsigned char url_encodeTable[128] = {
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 0, 1, 1, 0, 1, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 0, 1, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 1, 1, 1, 1, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 1, 1, 1, 1, 1,
+};
+CFX_ByteString FX_UrlEncode(const CFX_WideString& wsUrl)
+{
+ const char arDigits[] = "0123456789ABCDEF";
+ CFX_ByteString rUrl;
+ int nLength = wsUrl.GetLength();
+ for (int i = 0; i < nLength; i++) {
+ FX_DWORD word = wsUrl.GetAt(i);
+ if (word > 0x7F || url_encodeTable[word] == 1) {
+ CFX_ByteString bsUri = CFX_ByteString::FromUnicode((FX_WORD)word);
+ int nByte = bsUri.GetLength();
+ for (int j = 0; j < nByte; j++) {
+ rUrl += '%';
+ FX_BYTE code = bsUri.GetAt(j);
+ rUrl += arDigits[code >> 4];
+ rUrl += arDigits[code & 0x0F];
+ }
+ } else {
+ rUrl += CFX_ByteString::FromUnicode((FX_WORD)word);
+ }
+ }
+ return rUrl;
+}
+CFX_WideString FX_UrlDecode(const CFX_ByteString& bsUrl)
+{
+ CFX_ByteString rUrl;
+ int nLength = bsUrl.GetLength();
+ for (int i = 0; i < nLength; i++) {
+ if (i < nLength - 2 && bsUrl[i] == '%' && FX_IsXDigit(bsUrl[i + 1]) && FX_IsXDigit(bsUrl[i + 2])) {
+ rUrl += (FX_HexToI(bsUrl[i + 1]) << 4 | FX_HexToI(bsUrl[i + 2]));
+ i += 2;
+ } else {
+ rUrl += bsUrl[i];
+ }
+ }
+ return CFX_WideString::FromLocal(rUrl);
+}
+CFX_ByteString FX_EncodeURI(const CFX_WideString& wsURI)
+{
+ const char arDigits[] = "0123456789ABCDEF";
+ CFX_ByteString rURI;
+ CFX_ByteString bsUri = wsURI.UTF8Encode();
+ int nLength = bsUri.GetLength();
+ for (int i = 0; i < nLength; i++) {
+ FX_BYTE code = bsUri.GetAt(i);
+ if (code > 0x7F || url_encodeTable[code] == 1) {
+ rURI += '%';
+ rURI += arDigits[code >> 4];
+ rURI += arDigits[code & 0x0F];
+ } else {
+ rURI += code;
+ }
+ }
+ return rURI;
+}
+CFX_WideString FX_DecodeURI(const CFX_ByteString& bsURI)
+{
+ CFX_ByteString rURI;
+ int nLength = bsURI.GetLength();
+ for (int i = 0; i < nLength; i++) {
+ if (i < nLength - 2 && bsURI[i] == '%' && FX_IsXDigit(bsURI[i + 1]) && FX_IsXDigit(bsURI[i + 2])) {
+ rURI += (FX_HexToI(bsURI[i + 1]) << 4 | FX_HexToI(bsURI[i + 2]));
+ i += 2;
+ } else {
+ rURI += bsURI[i];
+ }
+ }
+ return CFX_WideString::FromUTF8(rURI);
+}
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
+class CFindFileData : public CFX_Object
+{
+public:
+ virtual ~CFindFileData() {}
+ HANDLE m_Handle;
+ FX_BOOL m_bEnd;
+};
+class CFindFileDataA : public CFindFileData
+{
+public:
+ virtual ~CFindFileDataA() {}
+ WIN32_FIND_DATAA m_FindData;
+};
+class CFindFileDataW : public CFindFileData
+{
+public:
+ virtual ~CFindFileDataW() {}
+ WIN32_FIND_DATAW m_FindData;
+};
+#endif
+void* FX_OpenFolder(FX_LPCSTR path)
+{
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
+#ifndef _WIN32_WCE
+ CFindFileDataA* pData = FX_NEW CFindFileDataA;
+ if (!pData) {
+ return NULL;
+ }
+#ifdef _FX_WINAPI_PARTITION_DESKTOP_
+ pData->m_Handle = FindFirstFileA(CFX_ByteString(path) + "/*.*", &pData->m_FindData);
+#else
+ pData->m_Handle = FindFirstFileExA(CFX_ByteString(path) + "/*.*", FindExInfoStandard, &pData->m_FindData, FindExSearchNameMatch, NULL, 0);
+#endif
+#else
+ CFindFileDataW* pData = FX_NEW CFindFileDataW;
+ if (!pData) {
+ return NULL;
+ }
+ pData->m_Handle = FindFirstFileW(CFX_WideString::FromLocal(path) + L"/*.*", &pData->m_FindData);
+#endif
+ if (pData->m_Handle == INVALID_HANDLE_VALUE) {
+ delete pData;
+ return NULL;
+ }
+ pData->m_bEnd = FALSE;
+ return pData;
+#else
+ DIR* dir = opendir(path);
+ return dir;
+#endif
+}
+void* FX_OpenFolder(FX_LPCWSTR path)
+{
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
+ CFindFileDataW* pData = FX_NEW CFindFileDataW;
+ if (!pData) {
+ return NULL;
+ }
+#ifdef _FX_WINAPI_PARTITION_DESKTOP_
+ pData->m_Handle = FindFirstFileW(CFX_WideString(path) + L"/*.*", &pData->m_FindData);
+#else
+ pData->m_Handle = FindFirstFileExW(CFX_WideString(path) + L"/*.*", FindExInfoStandard, &pData->m_FindData, FindExSearchNameMatch, NULL, 0);
+#endif
+ if (pData->m_Handle == INVALID_HANDLE_VALUE) {
+ delete pData;
+ return NULL;
+ }
+ pData->m_bEnd = FALSE;
+ return pData;
+#else
+ DIR* dir = opendir(CFX_ByteString::FromUnicode(path));
+ return dir;
+#endif
+}
+FX_BOOL FX_GetNextFile(void* handle, CFX_ByteString& filename, FX_BOOL& bFolder)
+{
+ if (handle == NULL) {
+ return FALSE;
+ }
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
+#ifndef _WIN32_WCE
+ CFindFileDataA* pData = (CFindFileDataA*)handle;
+ if (pData->m_bEnd) {
+ return FALSE;
+ }
+ filename = pData->m_FindData.cFileName;
+ bFolder = pData->m_FindData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY;
+ if (!FindNextFileA(pData->m_Handle, &pData->m_FindData)) {
+ pData->m_bEnd = TRUE;
+ }
+ return TRUE;
+#else
+ CFindFileDataW* pData = (CFindFileDataW*)handle;
+ if (pData->m_bEnd) {
+ return FALSE;
+ }
+ filename = CFX_ByteString::FromUnicode(pData->m_FindData.cFileName);
+ bFolder = pData->m_FindData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY;
+ if (!FindNextFileW(pData->m_Handle, &pData->m_FindData)) {
+ pData->m_bEnd = TRUE;
+ }
+ return TRUE;
+#endif
+#elif defined(__native_client__)
+ abort();
+ return FALSE;
+#else
+ struct dirent *de = readdir((DIR*)handle);
+ if (de == NULL) {
+ return FALSE;
+ }
+ filename = de->d_name;
+ bFolder = de->d_type == DT_DIR;
+ return TRUE;
+#endif
+}
+FX_BOOL FX_GetNextFile(void* handle, CFX_WideString& filename, FX_BOOL& bFolder)
+{
+ if (handle == NULL) {
+ return FALSE;
+ }
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
+ CFindFileDataW* pData = (CFindFileDataW*)handle;
+ if (pData->m_bEnd) {
+ return FALSE;
+ }
+ filename = pData->m_FindData.cFileName;
+ bFolder = pData->m_FindData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY;
+ if (!FindNextFileW(pData->m_Handle, &pData->m_FindData)) {
+ pData->m_bEnd = TRUE;
+ }
+ return TRUE;
+#elif defined(__native_client__)
+ abort();
+ return FALSE;
+#else
+ struct dirent *de = readdir((DIR*)handle);
+ if (de == NULL) {
+ return FALSE;
+ }
+ filename = CFX_WideString::FromLocal(de->d_name);
+ bFolder = de->d_type == DT_DIR;
+ return TRUE;
+#endif
+}
+void FX_CloseFolder(void* handle)
+{
+ if (handle == NULL) {
+ return;
+ }
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
+ CFindFileData* pData = (CFindFileData*)handle;
+ FindClose(pData->m_Handle);
+ delete pData;
+#else
+ closedir((DIR*)handle);
+#endif
+}
+FX_WCHAR FX_GetFolderSeparator()
+{
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
+ return '\\';
+#else
+ return '/';
+#endif
+}
diff --git a/core/src/fxcrt/fx_basic_wstring.cpp b/core/src/fxcrt/fx_basic_wstring.cpp
index 900f05846a..7af3303ca2 100644
--- a/core/src/fxcrt/fx_basic_wstring.cpp
+++ b/core/src/fxcrt/fx_basic_wstring.cpp
@@ -1,1168 +1,1168 @@
-// 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
-
-#include "../../include/fxcrt/fx_basic.h"
-static CFX_StringDataW* FX_AllocStringW(int nLen)
-{
- if (nLen == 0) {
- return NULL;
- }
- CFX_StringDataW* pData = (CFX_StringDataW*)FX_Alloc(FX_BYTE, sizeof(long) * 3 + (nLen + 1) * sizeof(FX_WCHAR));
- if (!pData) {
- return NULL;
- }
- pData->m_nAllocLength = nLen;
- pData->m_nDataLength = nLen;
- pData->m_nRefs = 1;
- pData->m_String[nLen] = 0;
- return pData;
-}
-static void FX_ReleaseStringW(CFX_StringDataW* pData)
-{
- if (pData == NULL) {
- return;
- }
- pData->m_nRefs --;
- if (pData->m_nRefs <= 0) {
- FX_Free(pData);
- }
-}
-CFX_WideString::~CFX_WideString()
-{
- if (m_pData == NULL) {
- return;
- }
- m_pData->m_nRefs --;
- if (m_pData->m_nRefs < 1) {
- FX_Free(m_pData);
- }
-}
-void CFX_WideString::InitStr(FX_LPCWSTR lpsz, FX_STRSIZE nLen)
-{
- if (nLen < 0) {
- nLen = lpsz ? (FX_STRSIZE)FXSYS_wcslen(lpsz) : 0;
- }
- if (nLen) {
- m_pData = FX_AllocStringW(nLen);
- if (!m_pData) {
- return;
- }
- FXSYS_memcpy32(m_pData->m_String, lpsz, nLen * sizeof(FX_WCHAR));
- } else {
- m_pData = NULL;
- }
-}
-CFX_WideString::CFX_WideString(const CFX_WideString& stringSrc)
-{
- if (stringSrc.m_pData == NULL) {
- m_pData = NULL;
- return;
- }
- if (stringSrc.m_pData->m_nRefs >= 0) {
- m_pData = stringSrc.m_pData;
- m_pData->m_nRefs ++;
- } else {
- m_pData = NULL;
- *this = stringSrc;
- }
-}
-CFX_WideString::CFX_WideString(FX_WCHAR ch)
-{
- m_pData = FX_AllocStringW(1);
- if (m_pData) {
- m_pData->m_String[0] = ch;
- }
-}
-CFX_WideString::CFX_WideString(const CFX_WideStringC& str)
-{
- if (str.IsEmpty()) {
- m_pData = NULL;
- return;
- }
- m_pData = FX_AllocStringW(str.GetLength());
- if (m_pData) {
- FXSYS_memcpy32(m_pData->m_String, str.GetPtr(), str.GetLength()*sizeof(FX_WCHAR));
- }
-}
-CFX_WideString::CFX_WideString(const CFX_WideStringC& str1, const CFX_WideStringC& str2)
-{
- m_pData = NULL;
- int nNewLen = str1.GetLength() + str2.GetLength();
- if (nNewLen == 0) {
- return;
- }
- m_pData = FX_AllocStringW(nNewLen);
- if (m_pData) {
- FXSYS_memcpy32(m_pData->m_String, str1.GetPtr(), str1.GetLength()*sizeof(FX_WCHAR));
- FXSYS_memcpy32(m_pData->m_String + str1.GetLength(), str2.GetPtr(), str2.GetLength()*sizeof(FX_WCHAR));
- }
-}
-void CFX_WideString::ReleaseBuffer(FX_STRSIZE nNewLength)
-{
- if (m_pData == NULL) {
- return;
- }
- CopyBeforeWrite();
- if (nNewLength == -1) {
- nNewLength = m_pData ? (FX_STRSIZE)FXSYS_wcslen(m_pData->m_String) : 0;
- }
- if (nNewLength == 0) {
- Empty();
- return;
- }
- FXSYS_assert(nNewLength <= m_pData->m_nAllocLength);
- m_pData->m_nDataLength = nNewLength;
- m_pData->m_String[nNewLength] = 0;
-}
-const CFX_WideString& CFX_WideString::operator=(FX_LPCWSTR lpsz)
-{
- if (lpsz == NULL || lpsz[0] == 0) {
- Empty();
- } else {
- AssignCopy((FX_STRSIZE)FXSYS_wcslen(lpsz), lpsz);
- }
- return *this;
-}
-const CFX_WideString& CFX_WideString::operator=(const CFX_WideStringC& stringSrc)
-{
- if (stringSrc.IsEmpty()) {
- Empty();
- } else {
- AssignCopy(stringSrc.GetLength(), stringSrc.GetPtr());
- }
- return *this;
-}
-const CFX_WideString& CFX_WideString::operator=(const CFX_WideString& stringSrc)
-{
- if (m_pData == stringSrc.m_pData) {
- return *this;
- }
- if (stringSrc.IsEmpty()) {
- Empty();
- } else if ((m_pData && m_pData->m_nRefs < 0) ||
- (stringSrc.m_pData && stringSrc.m_pData->m_nRefs < 0)) {
- AssignCopy(stringSrc.m_pData->m_nDataLength, stringSrc.m_pData->m_String);
- } else {
- Empty();
- m_pData = stringSrc.m_pData;
- if (m_pData) {
- m_pData->m_nRefs ++;
- }
- }
- return *this;
-}
-const CFX_WideString& CFX_WideString::operator+=(FX_WCHAR ch)
-{
- ConcatInPlace(1, &ch);
- return *this;
-}
-const CFX_WideString& CFX_WideString::operator+=(FX_LPCWSTR lpsz)
-{
- if (lpsz) {
- ConcatInPlace((FX_STRSIZE)FXSYS_wcslen(lpsz), lpsz);
- }
- return *this;
-}
-const CFX_WideString& CFX_WideString::operator+=(const CFX_WideString& string)
-{
- if (string.m_pData == NULL) {
- return *this;
- }
- ConcatInPlace(string.m_pData->m_nDataLength, string.m_pData->m_String);
- return *this;
-}
-const CFX_WideString& CFX_WideString::operator+=(const CFX_WideStringC& string)
-{
- if (string.IsEmpty()) {
- return *this;
- }
- ConcatInPlace(string.GetLength(), string.GetPtr());
- return *this;
-}
-bool operator==(const CFX_WideString& s1, FX_LPCWSTR s2)
-{
- return s1.Equal(s2);
-}
-bool operator==(FX_LPCWSTR s1, const CFX_WideString& s2)
-{
- return s2.Equal(s1);
-}
-bool operator==(const CFX_WideString& s1, const CFX_WideString& s2)
-{
- return s1.Equal(s2);
-}
-bool operator==(const CFX_WideString& s1, const CFX_WideStringC& s2)
-{
- return s1.Equal(s2);
-}
-bool operator==(const CFX_WideStringC& s1, const CFX_WideString& s2)
-{
- return s2.Equal(s1);
-}
-bool operator != (const CFX_WideString& s1, FX_LPCWSTR s2)
-{
- return !s1.Equal(s2);
-}
-bool operator!=(const CFX_WideString& s1, const CFX_WideString& s2)
-{
- return !s1.Equal(s2);
-}
-bool operator!=(const CFX_WideString& s1, const CFX_WideStringC& s2)
-{
- return !s1.Equal(s2);
-}
-bool operator!=(const CFX_WideStringC& s1, const CFX_WideString& s2)
-{
- return !s2.Equal(s1);
-}
-bool CFX_WideString::Equal(const CFX_WideStringC& str) const
-{
- if (m_pData == NULL) {
- return str.IsEmpty();
- }
- return str.GetLength() == m_pData->m_nDataLength &&
- FXSYS_memcmp32(str.GetPtr(), m_pData->m_String, m_pData->m_nDataLength * sizeof(FX_WCHAR)) == 0;
-}
-void CFX_WideString::Empty()
-{
- if (m_pData == NULL) {
- return;
- }
- if (m_pData->m_nRefs > 1) {
- m_pData->m_nRefs --;
- } else {
- FX_Free(m_pData);
- }
- m_pData = NULL;
-}
-void CFX_WideString::ConcatInPlace(FX_STRSIZE nSrcLen, FX_LPCWSTR lpszSrcData)
-{
- if (nSrcLen == 0 || lpszSrcData == NULL) {
- return;
- }
- if (m_pData == NULL) {
- m_pData = FX_AllocStringW(nSrcLen);
- if (m_pData) {
- FXSYS_memcpy32(m_pData->m_String, lpszSrcData, nSrcLen * sizeof(FX_WCHAR));
- }
- return;
- }
- if (m_pData->m_nRefs > 1 || m_pData->m_nDataLength + nSrcLen > m_pData->m_nAllocLength) {
- CFX_StringDataW* pOldData = m_pData;
- ConcatCopy(m_pData->m_nDataLength, m_pData->m_String, nSrcLen, lpszSrcData);
- FX_ReleaseStringW(pOldData);
- } else {
- FXSYS_memcpy32(m_pData->m_String + m_pData->m_nDataLength, lpszSrcData, nSrcLen * sizeof(FX_WCHAR));
- m_pData->m_nDataLength += nSrcLen;
- m_pData->m_String[m_pData->m_nDataLength] = 0;
- }
-}
-void CFX_WideString::ConcatCopy(FX_STRSIZE nSrc1Len, FX_LPCWSTR lpszSrc1Data,
- FX_STRSIZE nSrc2Len, FX_LPCWSTR lpszSrc2Data)
-{
- FX_STRSIZE nNewLen = nSrc1Len + nSrc2Len;
- if (nNewLen == 0) {
- return;
- }
- m_pData = FX_AllocStringW(nNewLen);
- if (m_pData) {
- FXSYS_memcpy32(m_pData->m_String, lpszSrc1Data, nSrc1Len * sizeof(FX_WCHAR));
- FXSYS_memcpy32(m_pData->m_String + nSrc1Len, lpszSrc2Data, nSrc2Len * sizeof(FX_WCHAR));
- }
-}
-void CFX_WideString::CopyBeforeWrite()
-{
- if (m_pData == NULL || m_pData->m_nRefs <= 1) {
- return;
- }
- CFX_StringDataW* pData = m_pData;
- m_pData->m_nRefs --;
- FX_STRSIZE nDataLength = pData->m_nDataLength;
- m_pData = FX_AllocStringW(nDataLength);
- if (m_pData != NULL) {
- FXSYS_memcpy32(m_pData->m_String, pData->m_String, (nDataLength + 1) * sizeof(FX_WCHAR));
- }
-}
-void CFX_WideString::AllocBeforeWrite(FX_STRSIZE nLen)
-{
- if (m_pData && m_pData->m_nRefs <= 1 && m_pData->m_nAllocLength >= nLen) {
- return;
- }
- Empty();
- m_pData = FX_AllocStringW(nLen);
-}
-void CFX_WideString::AssignCopy(FX_STRSIZE nSrcLen, FX_LPCWSTR lpszSrcData)
-{
- AllocBeforeWrite(nSrcLen);
- FXSYS_memcpy32(m_pData->m_String, lpszSrcData, nSrcLen * sizeof(FX_WCHAR));
- m_pData->m_nDataLength = nSrcLen;
- m_pData->m_String[nSrcLen] = 0;
-}
-int CFX_WideString::Compare(FX_LPCWSTR lpsz) const
-{
- if (m_pData == NULL) {
- return (lpsz == NULL || lpsz[0] == 0) ? 0 : -1;
- }
- return FXSYS_wcscmp(m_pData->m_String, lpsz);
-}
-CFX_ByteString CFX_WideString::UTF8Encode() const
-{
- return FX_UTF8Encode(*this);
-}
-CFX_ByteString CFX_WideString::UTF16LE_Encode(FX_BOOL bTerminate) const
-{
- if (m_pData == NULL) {
- return bTerminate ? CFX_ByteString(FX_BSTRC("\0\0")) : CFX_ByteString();
- }
- int len = m_pData->m_nDataLength;
- CFX_ByteString result;
- FX_LPSTR buffer = result.GetBuffer(len * 2 + (bTerminate ? 2 : 0));
- for (int i = 0; i < len; i ++) {
- buffer[i * 2] = m_pData->m_String[i] & 0xff;
- buffer[i * 2 + 1] = m_pData->m_String[i] >> 8;
- }
- if (bTerminate) {
- buffer[len * 2] = 0;
- buffer[len * 2 + 1] = 0;
- result.ReleaseBuffer(len * 2 + 2);
- } else {
- result.ReleaseBuffer(len * 2);
- }
- return result;
-}
-void CFX_WideString::ConvertFrom(const CFX_ByteString& str, CFX_CharMap* pCharMap)
-{
- if (pCharMap == NULL) {
- pCharMap = CFX_CharMap::GetDefaultMapper();
- }
- *this = pCharMap->m_GetWideString(pCharMap, str);
-}
-void CFX_WideString::Reserve(FX_STRSIZE len)
-{
- GetBuffer(len);
- ReleaseBuffer(GetLength());
-}
-FX_LPWSTR CFX_WideString::GetBuffer(FX_STRSIZE nMinBufLength)
-{
- if (m_pData == NULL && nMinBufLength == 0) {
- return NULL;
- }
- if (m_pData && m_pData->m_nRefs <= 1 && m_pData->m_nAllocLength >= nMinBufLength) {
- return m_pData->m_String;
- }
- if (m_pData == NULL) {
- m_pData = FX_AllocStringW(nMinBufLength);
- if (!m_pData) {
- return NULL;
- }
- m_pData->m_nDataLength = 0;
- m_pData->m_String[0] = 0;
- return m_pData->m_String;
- }
- CFX_StringDataW* pOldData = m_pData;
- FX_STRSIZE nOldLen = pOldData->m_nDataLength;
- if (nMinBufLength < nOldLen) {
- nMinBufLength = nOldLen;
- }
- m_pData = FX_AllocStringW(nMinBufLength);
- if (!m_pData) {
- return NULL;
- }
- FXSYS_memcpy32(m_pData->m_String, pOldData->m_String, (nOldLen + 1)*sizeof(FX_WCHAR));
- m_pData->m_nDataLength = nOldLen;
- pOldData->m_nRefs --;
- if (pOldData->m_nRefs <= 0) {
- FX_Free(pOldData);
- }
- return m_pData->m_String;
-}
-CFX_WideString CFX_WideString::FromLocal(const char* str, FX_STRSIZE len)
-{
- CFX_WideString result;
- result.ConvertFrom(CFX_ByteString(str, len));
- return result;
-}
-CFX_WideString CFX_WideString::FromUTF8(const char* str, FX_STRSIZE len)
-{
- if (!str) {
- return CFX_WideString();
- }
- if (len < 0) {
- len = 0;
- while (str[len]) {
- len ++;
- }
- }
- CFX_UTF8Decoder decoder;
- for (FX_STRSIZE i = 0; i < len; i ++) {
- decoder.Input(str[i]);
- }
- return decoder.GetResult();
-}
-CFX_WideString CFX_WideString::FromUTF16LE(const unsigned short* wstr, FX_STRSIZE wlen)
-{
- if (!wstr || !wlen) {
- return CFX_WideString();
- }
- if (wlen < 0) {
- wlen = 0;
- while (wstr[wlen]) {
- wlen ++;
- }
- }
- CFX_WideString result;
- FX_WCHAR* buf = result.GetBuffer(wlen);
- for (int i = 0; i < wlen; i ++) {
- buf[i] = wstr[i];
- }
- result.ReleaseBuffer(wlen);
- return result;
-}
-void CFX_WideString::AllocCopy(CFX_WideString& dest, FX_STRSIZE nCopyLen, FX_STRSIZE nCopyIndex,
- FX_STRSIZE nExtraLen) const
-{
- FX_STRSIZE nNewLen = nCopyLen + nExtraLen;
- if (nNewLen == 0) {
- return;
- }
- ASSERT(dest.m_pData == NULL);
- dest.m_pData = FX_AllocStringW(nNewLen);
- if (dest.m_pData) {
- FXSYS_memcpy32(dest.m_pData->m_String, m_pData->m_String + nCopyIndex, nCopyLen * sizeof(FX_WCHAR));
- }
-}
-CFX_WideString CFX_WideString::Left(FX_STRSIZE nCount) const
-{
- if (m_pData == NULL) {
- return CFX_WideString();
- }
- if (nCount < 0) {
- nCount = 0;
- }
- if (nCount >= m_pData->m_nDataLength) {
- return *this;
- }
- CFX_WideString dest;
- AllocCopy(dest, nCount, 0, 0);
- return dest;
-}
-CFX_WideString CFX_WideString::Mid(FX_STRSIZE nFirst) const
-{
- return Mid(nFirst, m_pData->m_nDataLength - nFirst);
-}
-CFX_WideString CFX_WideString::Mid(FX_STRSIZE nFirst, FX_STRSIZE nCount) const
-{
- if (m_pData == NULL) {
- return CFX_WideString();
- }
- if (nFirst < 0) {
- nFirst = 0;
- }
- if (nCount < 0) {
- nCount = 0;
- }
- if (nFirst + nCount > m_pData->m_nDataLength) {
- nCount = m_pData->m_nDataLength - nFirst;
- }
- if (nFirst > m_pData->m_nDataLength) {
- nCount = 0;
- }
- if (nFirst == 0 && nFirst + nCount == m_pData->m_nDataLength) {
- return *this;
- }
- CFX_WideString dest;
- AllocCopy(dest, nCount, nFirst, 0);
- return dest;
-}
-CFX_WideString CFX_WideString::Right(FX_STRSIZE nCount) const
-{
- if (m_pData == NULL) {
- return CFX_WideString();
- }
- if (nCount < 0) {
- nCount = 0;
- }
- if (nCount >= m_pData->m_nDataLength) {
- return *this;
- }
- CFX_WideString dest;
- AllocCopy(dest, nCount, m_pData->m_nDataLength - nCount, 0);
- return dest;
-}
-int CFX_WideString::CompareNoCase(FX_LPCWSTR lpsz) const
-{
- if (m_pData == NULL) {
- return (lpsz == NULL || lpsz[0] == 0) ? 0 : -1;
- }
- return FXSYS_wcsicmp(m_pData->m_String, lpsz);
-}
-int CFX_WideString::Compare(const CFX_WideString& str) const
-{
- if (m_pData == NULL) {
- if (str.m_pData == NULL) {
- return 0;
- }
- return -1;
- } else if (str.m_pData == NULL) {
- return 1;
- }
- int this_len = m_pData->m_nDataLength;
- int that_len = str.m_pData->m_nDataLength;
- int min_len = this_len < that_len ? this_len : that_len;
- for (int i = 0; i < min_len; i ++) {
- if (m_pData->m_String[i] < str.m_pData->m_String[i]) {
- return -1;
- } else if (m_pData->m_String[i] > str.m_pData->m_String[i]) {
- return 1;
- }
- }
- if (this_len < that_len) {
- return -1;
- } else if (this_len > that_len) {
- return 1;
- }
- return 0;
-}
-FX_LPWSTR CFX_WideString::LockBuffer()
-{
- if (m_pData == NULL) {
- return NULL;
- }
- FX_LPWSTR lpsz = GetBuffer(0);
- m_pData->m_nRefs = -1;
- return lpsz;
-}
-void CFX_WideString::SetAt(FX_STRSIZE nIndex, FX_WCHAR ch)
-{
- if (m_pData == NULL) {
- return;
- }
- ASSERT(nIndex >= 0);
- ASSERT(nIndex < m_pData->m_nDataLength);
- CopyBeforeWrite();
- m_pData->m_String[nIndex] = ch;
-}
-void CFX_WideString::MakeLower()
-{
- if (m_pData == NULL) {
- return;
- }
- CopyBeforeWrite();
- if (GetLength() < 1) {
- return;
- }
- FXSYS_wcslwr(m_pData->m_String);
-}
-void CFX_WideString::MakeUpper()
-{
- if (m_pData == NULL) {
- return;
- }
- CopyBeforeWrite();
- if (GetLength() < 1) {
- return;
- }
- FXSYS_wcsupr(m_pData->m_String);
-}
-FX_STRSIZE CFX_WideString::Find(FX_LPCWSTR lpszSub, FX_STRSIZE nStart) const
-{
- FX_STRSIZE nLength = GetLength();
- if (nLength < 1 || nStart > nLength) {
- return -1;
- }
- FX_LPCWSTR lpsz = (FX_LPCWSTR)FXSYS_wcsstr(m_pData->m_String + nStart, lpszSub);
- return (lpsz == NULL) ? -1 : (int)(lpsz - m_pData->m_String);
-}
-FX_STRSIZE CFX_WideString::Find(FX_WCHAR ch, FX_STRSIZE nStart) const
-{
- if (m_pData == NULL) {
- return -1;
- }
- FX_STRSIZE nLength = m_pData->m_nDataLength;
- if (nStart >= nLength) {
- return -1;
- }
- FX_LPCWSTR lpsz = (FX_LPCWSTR)FXSYS_wcschr(m_pData->m_String + nStart, ch);
- return (lpsz == NULL) ? -1 : (int)(lpsz - m_pData->m_String);
-}
-void CFX_WideString::TrimRight(FX_LPCWSTR lpszTargetList)
-{
- FXSYS_assert(lpszTargetList != NULL);
- if (m_pData == NULL || *lpszTargetList == 0) {
- return;
- }
- CopyBeforeWrite();
- FX_STRSIZE len = GetLength();
- if (len < 1) {
- return;
- }
- FX_STRSIZE pos = len;
- while (pos) {
- if (FXSYS_wcschr(lpszTargetList, m_pData->m_String[pos - 1]) == NULL) {
- break;
- }
- pos --;
- }
- if (pos < len) {
- m_pData->m_String[pos] = 0;
- m_pData->m_nDataLength = pos;
- }
-}
-void CFX_WideString::TrimRight(FX_WCHAR chTarget)
-{
- FX_WCHAR str[2] = {chTarget, 0};
- TrimRight(str);
-}
-void CFX_WideString::TrimRight()
-{
- TrimRight(L"\x09\x0a\x0b\x0c\x0d\x20");
-}
-void CFX_WideString::TrimLeft(FX_LPCWSTR lpszTargets)
-{
- FXSYS_assert(lpszTargets != NULL);
- if (m_pData == NULL || *lpszTargets == 0) {
- return;
- }
- CopyBeforeWrite();
- if (GetLength() < 1) {
- return;
- }
- FX_LPCWSTR lpsz = m_pData->m_String;
- while (*lpsz != 0) {
- if (FXSYS_wcschr(lpszTargets, *lpsz) == NULL) {
- break;
- }
- lpsz ++;
- }
- if (lpsz != m_pData->m_String) {
- int nDataLength = m_pData->m_nDataLength - (FX_STRSIZE)(lpsz - m_pData->m_String);
- FXSYS_memmove32(m_pData->m_String, lpsz, (nDataLength + 1)*sizeof(FX_WCHAR));
- m_pData->m_nDataLength = nDataLength;
- }
-}
-void CFX_WideString::TrimLeft(FX_WCHAR chTarget)
-{
- FX_WCHAR str[2] = {chTarget, 0};
- TrimLeft(str);
-}
-void CFX_WideString::TrimLeft()
-{
- TrimLeft(L"\x09\x0a\x0b\x0c\x0d\x20");
-}
-FX_STRSIZE CFX_WideString::Replace(FX_LPCWSTR lpszOld, FX_LPCWSTR lpszNew)
-{
- if (GetLength() < 1) {
- return 0;
- }
- if (lpszOld == NULL) {
- return 0;
- }
- FX_STRSIZE nSourceLen = (FX_STRSIZE)FXSYS_wcslen(lpszOld);
- if (nSourceLen == 0) {
- return 0;
- }
- FX_STRSIZE nReplacementLen = lpszNew ? (FX_STRSIZE)FXSYS_wcslen(lpszNew) : 0;
- FX_STRSIZE nCount = 0;
- FX_LPWSTR lpszStart = m_pData->m_String;
- FX_LPWSTR lpszEnd = m_pData->m_String + m_pData->m_nDataLength;
- FX_LPWSTR lpszTarget;
- {
- while ((lpszTarget = (FX_LPWSTR)FXSYS_wcsstr(lpszStart, lpszOld)) != NULL && lpszStart < lpszEnd) {
- nCount++;
- lpszStart = lpszTarget + nSourceLen;
- }
- }
- if (nCount > 0) {
- CopyBeforeWrite();
- FX_STRSIZE nOldLength = m_pData->m_nDataLength;
- FX_STRSIZE nNewLength = nOldLength + (nReplacementLen - nSourceLen) * nCount;
- if (m_pData->m_nAllocLength < nNewLength || m_pData->m_nRefs > 1) {
- CFX_StringDataW* pOldData = m_pData;
- FX_LPCWSTR pstr = m_pData->m_String;
- m_pData = FX_AllocStringW(nNewLength);
- if (!m_pData) {
- return 0;
- }
- FXSYS_memcpy32(m_pData->m_String, pstr, pOldData->m_nDataLength * sizeof(FX_WCHAR));
- FX_ReleaseStringW(pOldData);
- }
- lpszStart = m_pData->m_String;
- lpszEnd = m_pData->m_String + FX_MAX(m_pData->m_nDataLength, nNewLength);
- {
- while ((lpszTarget = (FX_LPWSTR)FXSYS_wcsstr(lpszStart, lpszOld)) != NULL && lpszStart < lpszEnd) {
- FX_STRSIZE nBalance = nOldLength - (FX_STRSIZE)(lpszTarget - m_pData->m_String + nSourceLen);
- FXSYS_memmove32(lpszTarget + nReplacementLen, lpszTarget + nSourceLen, nBalance * sizeof(FX_WCHAR));
- FXSYS_memcpy32(lpszTarget, lpszNew, nReplacementLen * sizeof(FX_WCHAR));
- lpszStart = lpszTarget + nReplacementLen;
- lpszStart[nBalance] = 0;
- nOldLength += (nReplacementLen - nSourceLen);
- }
- }
- ASSERT(m_pData->m_String[nNewLength] == 0);
- m_pData->m_nDataLength = nNewLength;
- }
- return nCount;
-}
-FX_STRSIZE CFX_WideString::Insert(FX_STRSIZE nIndex, FX_WCHAR ch)
-{
- CopyBeforeWrite();
- if (nIndex < 0) {
- nIndex = 0;
- }
- FX_STRSIZE nNewLength = GetLength();
- if (nIndex > nNewLength) {
- nIndex = nNewLength;
- }
- nNewLength++;
- if (m_pData == NULL || m_pData->m_nAllocLength < nNewLength) {
- CFX_StringDataW* pOldData = m_pData;
- FX_LPCWSTR pstr = m_pData->m_String;
- m_pData = FX_AllocStringW(nNewLength);
- if (!m_pData) {
- return 0;
- }
- if(pOldData != NULL) {
- FXSYS_memmove32(m_pData->m_String, pstr, (pOldData->m_nDataLength + 1)*sizeof(FX_WCHAR));
- FX_ReleaseStringW(pOldData);
- } else {
- m_pData->m_String[0] = 0;
- }
- }
- FXSYS_memmove32(m_pData->m_String + nIndex + 1,
- m_pData->m_String + nIndex, (nNewLength - nIndex)*sizeof(FX_WCHAR));
- m_pData->m_String[nIndex] = ch;
- m_pData->m_nDataLength = nNewLength;
- return nNewLength;
-}
-FX_STRSIZE CFX_WideString::Delete(FX_STRSIZE nIndex, FX_STRSIZE nCount)
-{
- if (GetLength() < 1) {
- return 0;
- }
- if (nIndex < 0) {
- nIndex = 0;
- }
- FX_STRSIZE nOldLength = m_pData->m_nDataLength;
- if (nCount > 0 && nIndex < nOldLength) {
- CopyBeforeWrite();
- int nBytesToCopy = nOldLength - (nIndex + nCount) + 1;
- FXSYS_memmove32(m_pData->m_String + nIndex,
- m_pData->m_String + nIndex + nCount, nBytesToCopy * sizeof(FX_WCHAR));
- m_pData->m_nDataLength = nOldLength - nCount;
- }
- return m_pData->m_nDataLength;
-}
-FX_STRSIZE CFX_WideString::Remove(FX_WCHAR chRemove)
-{
- if (m_pData == NULL) {
- return 0;
- }
- CopyBeforeWrite();
- if (GetLength() < 1) {
- return 0;
- }
- FX_LPWSTR pstrSource = m_pData->m_String;
- FX_LPWSTR pstrDest = m_pData->m_String;
- FX_LPWSTR pstrEnd = m_pData->m_String + m_pData->m_nDataLength;
- while (pstrSource < pstrEnd) {
- if (*pstrSource != chRemove) {
- *pstrDest = *pstrSource;
- pstrDest ++;
- }
- pstrSource ++;
- }
- *pstrDest = 0;
- FX_STRSIZE nCount = (FX_STRSIZE)(pstrSource - pstrDest);
- m_pData->m_nDataLength -= nCount;
- return nCount;
-}
-#define FORCE_ANSI 0x10000
-#define FORCE_UNICODE 0x20000
-#define FORCE_INT64 0x40000
-void CFX_WideString::FormatV(FX_LPCWSTR lpszFormat, va_list argList)
-{
- va_list argListSave;
-#if defined(__ARMCC_VERSION) || (!defined(_MSC_VER) && (_FX_CPU_ == _FX_X64_ || _FX_CPU_ == _FX_IA64_ || _FX_CPU_ == _FX_ARM64_)) || defined(__native_client__)
- va_copy(argListSave, argList);
-#else
- argListSave = argList;
-#endif
- int nMaxLen = 0;
- for (FX_LPCWSTR lpsz = lpszFormat; *lpsz != 0; lpsz ++) {
- if (*lpsz != '%' || *(lpsz = lpsz + 1) == '%') {
- nMaxLen += (FX_STRSIZE)FXSYS_wcslen(lpsz);
- continue;
- }
- int nItemLen = 0;
- int nWidth = 0;
- for (; *lpsz != 0; lpsz ++) {
- if (*lpsz == '#') {
- nMaxLen += 2;
- } else if (*lpsz == '*') {
- nWidth = va_arg(argList, int);
- } else if (*lpsz == '-' || *lpsz == '+' || *lpsz == '0' ||
- *lpsz == ' ')
- ;
- else {
- break;
- }
- }
- if (nWidth == 0) {
- nWidth = FXSYS_wtoi(lpsz);
- for (; *lpsz != 0 && (*lpsz) <= '9' && (*lpsz) >= '0'; lpsz ++)
- ;
- }
- if (nWidth < 0 || nWidth > 128 * 1024) {
- lpszFormat = (FX_LPCWSTR)L"Bad width";
- nMaxLen = 10;
- break;
- }
- int nPrecision = 0;
- if (*lpsz == '.') {
- lpsz ++;
- if (*lpsz == '*') {
- nPrecision = va_arg(argList, int);
- lpsz ++;
- } else {
- nPrecision = FXSYS_wtoi(lpsz);
- for (; *lpsz != 0 && (*lpsz) >= '0' && (*lpsz) <= '9'; lpsz ++)
- ;
- }
- }
- if (nPrecision < 0 || nPrecision > 128 * 1024) {
- lpszFormat = (FX_LPCWSTR)L"Bad precision";
- nMaxLen = 14;
- break;
- }
- int nModifier = 0;
- if (*lpsz == L'I' && *(lpsz + 1) == L'6' && *(lpsz + 2) == L'4') {
- lpsz += 3;
- nModifier = FORCE_INT64;
- } else {
- switch (*lpsz) {
- case 'h':
- nModifier = FORCE_ANSI;
- lpsz ++;
- break;
- case 'l':
- nModifier = FORCE_UNICODE;
- lpsz ++;
- break;
- case 'F':
- case 'N':
- case 'L':
- lpsz ++;
- break;
- }
- }
- switch (*lpsz | nModifier) {
- case 'c':
- case 'C':
- nItemLen = 2;
- va_arg(argList, int);
- break;
- case 'c'|FORCE_ANSI:
- case 'C'|FORCE_ANSI:
- nItemLen = 2;
- va_arg(argList, int);
- break;
- case 'c'|FORCE_UNICODE:
- case 'C'|FORCE_UNICODE:
- nItemLen = 2;
- va_arg(argList, int);
- break;
- case 's': {
- FX_LPCWSTR pstrNextArg = va_arg(argList, FX_LPCWSTR);
- if (pstrNextArg == NULL) {
- nItemLen = 6;
- } else {
- nItemLen = (FX_STRSIZE)FXSYS_wcslen(pstrNextArg);
- if (nItemLen < 1) {
- nItemLen = 1;
- }
- }
- }
- break;
- case 'S': {
- FX_LPCSTR pstrNextArg = va_arg(argList, FX_LPCSTR);
- if (pstrNextArg == NULL) {
- nItemLen = 6;
- } else {
- nItemLen = (FX_STRSIZE)FXSYS_strlen(pstrNextArg);
- if (nItemLen < 1) {
- nItemLen = 1;
- }
- }
- }
- break;
- case 's'|FORCE_ANSI:
- case 'S'|FORCE_ANSI: {
- FX_LPCSTR pstrNextArg = va_arg(argList, FX_LPCSTR);
- if (pstrNextArg == NULL) {
- nItemLen = 6;
- } else {
- nItemLen = (FX_STRSIZE)FXSYS_strlen(pstrNextArg);
- if (nItemLen < 1) {
- nItemLen = 1;
- }
- }
- }
- break;
- case 's'|FORCE_UNICODE:
- case 'S'|FORCE_UNICODE: {
- FX_LPWSTR pstrNextArg = va_arg(argList, FX_LPWSTR);
- if (pstrNextArg == NULL) {
- nItemLen = 6;
- } else {
- nItemLen = (FX_STRSIZE)FXSYS_wcslen(pstrNextArg);
- if (nItemLen < 1) {
- nItemLen = 1;
- }
- }
- }
- break;
- }
- if (nItemLen != 0) {
- if (nPrecision != 0 && nItemLen > nPrecision) {
- nItemLen = nPrecision;
- }
- if (nItemLen < nWidth) {
- nItemLen = nWidth;
- }
- } else {
- switch (*lpsz) {
- case 'd':
- case 'i':
- case 'u':
- case 'x':
- case 'X':
- case 'o':
- if (nModifier & FORCE_INT64) {
- va_arg(argList, FX_INT64);
- } else {
- va_arg(argList, int);
- }
- nItemLen = 32;
- if (nItemLen < nWidth + nPrecision) {
- nItemLen = nWidth + nPrecision;
- }
- break;
- case 'a':
- case 'A':
- case 'e':
- case 'E':
- case 'g':
- case 'G':
- va_arg(argList, double);
- nItemLen = 128;
- if (nItemLen < nWidth + nPrecision) {
- nItemLen = nWidth + nPrecision;
- }
- break;
- case 'f':
- if (nWidth + nPrecision > 100) {
- nItemLen = nPrecision + nWidth + 128;
- } else {
- double f;
- char pszTemp[256];
- f = va_arg(argList, double);
- FXSYS_snprintf(pszTemp, sizeof(pszTemp), "%*.*f", nWidth, nPrecision + 6, f );
- nItemLen = (FX_STRSIZE)FXSYS_strlen(pszTemp);
- }
- break;
- case 'p':
- va_arg(argList, void*);
- nItemLen = 32;
- if (nItemLen < nWidth + nPrecision) {
- nItemLen = nWidth + nPrecision;
- }
- break;
- case 'n':
- va_arg(argList, int*);
- break;
- }
- }
- nMaxLen += nItemLen;
- }
- GetBuffer(nMaxLen);
- if (m_pData) {
- FXSYS_vswprintf((wchar_t*)m_pData->m_String, nMaxLen + 1, (const wchar_t*)lpszFormat, argListSave);
- ReleaseBuffer();
- }
- va_end(argListSave);
-}
-void CFX_WideString::Format(FX_LPCWSTR lpszFormat, ...)
-{
- va_list argList;
- va_start(argList, lpszFormat);
- FormatV(lpszFormat, argList);
- va_end(argList);
-}
-FX_FLOAT FX_wtof(FX_LPCWSTR str, int len)
-{
- if (len == 0) {
- return 0.0;
- }
- int cc = 0;
- FX_BOOL bNegative = FALSE;
- if (str[0] == '+') {
- cc++;
- } else if (str[0] == '-') {
- bNegative = TRUE;
- cc++;
- }
- int integer = 0;
- while (cc < len) {
- if (str[cc] == '.') {
- break;
- }
- integer = integer * 10 + str[cc] - '0';
- cc ++;
- }
- FX_FLOAT fraction = 0;
- if (str[cc] == '.') {
- cc ++;
- FX_FLOAT scale = 0.1f;
- while (cc < len) {
- fraction += scale * (str[cc] - '0');
- scale *= 0.1f;
- cc ++;
- }
- }
- fraction += (FX_FLOAT)integer;
- return bNegative ? -fraction : fraction;
-}
-int CFX_WideString::GetInteger() const
-{
- if (m_pData == NULL) {
- return 0;
- }
- return FXSYS_wtoi(m_pData->m_String);
-}
-FX_FLOAT CFX_WideString::GetFloat() const
-{
- if (m_pData == NULL) {
- return 0.0;
- }
- return FX_wtof(m_pData->m_String, m_pData->m_nDataLength);
-}
-void CFX_WideStringL::Empty(IFX_Allocator* pAllocator)
-{
- if (m_Ptr) {
- FX_Allocator_Free(pAllocator, (FX_LPVOID)m_Ptr);
- }
- m_Ptr = NULL, m_Length = 0;
-}
-void CFX_WideStringL::Set(FX_WSTR src, IFX_Allocator* pAllocator)
-{
- Empty(pAllocator);
- if (src.GetPtr() != NULL && src.GetLength() > 0) {
- FX_LPWSTR str = FX_Allocator_Alloc(pAllocator, FX_WCHAR, src.GetLength() + 1);
- if (!str) {
- return;
- }
- FXSYS_memcpy32(str, src.GetPtr(), src.GetLength()*sizeof(FX_WCHAR));
- str[src.GetLength()] = '\0';
- *(FX_LPWSTR*)(&m_Ptr) = str;
- m_Length = src.GetLength();
- }
-}
-int CFX_WideStringL::GetInteger() const
-{
- if (!m_Ptr) {
- return 0;
- }
- return FXSYS_wtoi(m_Ptr);
-}
-FX_FLOAT CFX_WideStringL::GetFloat() const
-{
- if (!m_Ptr) {
- return 0.0f;
- }
- return FX_wtof(m_Ptr, m_Length);
-}
-void CFX_WideStringL::TrimRight(FX_LPCWSTR lpszTargets)
-{
- if (!lpszTargets || *lpszTargets == 0 || !m_Ptr || m_Length < 1) {
- return;
- }
- FX_STRSIZE pos = m_Length;
- while (pos) {
- if (FXSYS_wcschr(lpszTargets, m_Ptr[pos - 1]) == NULL) {
- break;
- }
- pos --;
- }
- if (pos < m_Length) {
- (*(FX_LPWSTR*)(&m_Ptr))[pos] = 0;
- m_Length = pos;
- }
-}
-static CFX_ByteString _DefMap_GetByteString(CFX_CharMap* pCharMap, const CFX_WideString& widestr)
-{
- int src_len = widestr.GetLength();
- int codepage = pCharMap->m_GetCodePage ? pCharMap->m_GetCodePage() : 0;
- int dest_len = FXSYS_WideCharToMultiByte(codepage, 0, widestr, src_len, NULL, 0, NULL, NULL);
- if (dest_len == 0) {
- return CFX_ByteString();
- }
- CFX_ByteString bytestr;
- FX_LPSTR dest_buf = bytestr.GetBuffer(dest_len);
- FXSYS_WideCharToMultiByte(codepage, 0, widestr, src_len, dest_buf, dest_len, NULL, NULL);
- bytestr.ReleaseBuffer(dest_len);
- return bytestr;
-}
-static CFX_WideString _DefMap_GetWideString(CFX_CharMap* pCharMap, const CFX_ByteString& bytestr)
-{
- int src_len = bytestr.GetLength();
- int codepage = pCharMap->m_GetCodePage ? pCharMap->m_GetCodePage() : 0;
- int dest_len = FXSYS_MultiByteToWideChar(codepage, 0, bytestr, src_len, NULL, 0);
- if (dest_len == 0) {
- return CFX_WideString();
- }
- CFX_WideString widestr;
- FX_LPWSTR dest_buf = widestr.GetBuffer(dest_len);
- FXSYS_MultiByteToWideChar(codepage, 0, bytestr, src_len, dest_buf, dest_len);
- widestr.ReleaseBuffer(dest_len);
- return widestr;
-}
-static int _DefMap_GetGBKCodePage()
-{
- return 936;
-}
-static int _DefMap_GetUHCCodePage()
-{
- return 949;
-}
-static int _DefMap_GetJISCodePage()
-{
- return 932;
-}
-static int _DefMap_GetBig5CodePage()
-{
- return 950;
-}
-static const CFX_CharMap g_DefaultMapper = {&_DefMap_GetWideString, &_DefMap_GetByteString, NULL};
-static const CFX_CharMap g_DefaultGBKMapper = {&_DefMap_GetWideString, &_DefMap_GetByteString, &_DefMap_GetGBKCodePage};
-static const CFX_CharMap g_DefaultJISMapper = {&_DefMap_GetWideString, &_DefMap_GetByteString, &_DefMap_GetJISCodePage};
-static const CFX_CharMap g_DefaultUHCMapper = {&_DefMap_GetWideString, &_DefMap_GetByteString, &_DefMap_GetUHCCodePage};
-static const CFX_CharMap g_DefaultBig5Mapper = {&_DefMap_GetWideString, &_DefMap_GetByteString, &_DefMap_GetBig5CodePage};
-CFX_CharMap* CFX_CharMap::GetDefaultMapper(FX_INT32 codepage)
-{
- switch (codepage) {
- case 0:
- return (CFX_CharMap*)&g_DefaultMapper;
- case 932:
- return (CFX_CharMap*)&g_DefaultJISMapper;
- case 936:
- return (CFX_CharMap*)&g_DefaultGBKMapper;
- case 949:
- return (CFX_CharMap*)&g_DefaultUHCMapper;
- case 950:
- return (CFX_CharMap*)&g_DefaultBig5Mapper;
- }
- return NULL;
-}
+// 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
+
+#include "../../include/fxcrt/fx_basic.h"
+static CFX_StringDataW* FX_AllocStringW(int nLen)
+{
+ if (nLen == 0) {
+ return NULL;
+ }
+ CFX_StringDataW* pData = (CFX_StringDataW*)FX_Alloc(FX_BYTE, sizeof(long) * 3 + (nLen + 1) * sizeof(FX_WCHAR));
+ if (!pData) {
+ return NULL;
+ }
+ pData->m_nAllocLength = nLen;
+ pData->m_nDataLength = nLen;
+ pData->m_nRefs = 1;
+ pData->m_String[nLen] = 0;
+ return pData;
+}
+static void FX_ReleaseStringW(CFX_StringDataW* pData)
+{
+ if (pData == NULL) {
+ return;
+ }
+ pData->m_nRefs --;
+ if (pData->m_nRefs <= 0) {
+ FX_Free(pData);
+ }
+}
+CFX_WideString::~CFX_WideString()
+{
+ if (m_pData == NULL) {
+ return;
+ }
+ m_pData->m_nRefs --;
+ if (m_pData->m_nRefs < 1) {
+ FX_Free(m_pData);
+ }
+}
+void CFX_WideString::InitStr(FX_LPCWSTR lpsz, FX_STRSIZE nLen)
+{
+ if (nLen < 0) {
+ nLen = lpsz ? (FX_STRSIZE)FXSYS_wcslen(lpsz) : 0;
+ }
+ if (nLen) {
+ m_pData = FX_AllocStringW(nLen);
+ if (!m_pData) {
+ return;
+ }
+ FXSYS_memcpy32(m_pData->m_String, lpsz, nLen * sizeof(FX_WCHAR));
+ } else {
+ m_pData = NULL;
+ }
+}
+CFX_WideString::CFX_WideString(const CFX_WideString& stringSrc)
+{
+ if (stringSrc.m_pData == NULL) {
+ m_pData = NULL;
+ return;
+ }
+ if (stringSrc.m_pData->m_nRefs >= 0) {
+ m_pData = stringSrc.m_pData;
+ m_pData->m_nRefs ++;
+ } else {
+ m_pData = NULL;
+ *this = stringSrc;
+ }
+}
+CFX_WideString::CFX_WideString(FX_WCHAR ch)
+{
+ m_pData = FX_AllocStringW(1);
+ if (m_pData) {
+ m_pData->m_String[0] = ch;
+ }
+}
+CFX_WideString::CFX_WideString(const CFX_WideStringC& str)
+{
+ if (str.IsEmpty()) {
+ m_pData = NULL;
+ return;
+ }
+ m_pData = FX_AllocStringW(str.GetLength());
+ if (m_pData) {
+ FXSYS_memcpy32(m_pData->m_String, str.GetPtr(), str.GetLength()*sizeof(FX_WCHAR));
+ }
+}
+CFX_WideString::CFX_WideString(const CFX_WideStringC& str1, const CFX_WideStringC& str2)
+{
+ m_pData = NULL;
+ int nNewLen = str1.GetLength() + str2.GetLength();
+ if (nNewLen == 0) {
+ return;
+ }
+ m_pData = FX_AllocStringW(nNewLen);
+ if (m_pData) {
+ FXSYS_memcpy32(m_pData->m_String, str1.GetPtr(), str1.GetLength()*sizeof(FX_WCHAR));
+ FXSYS_memcpy32(m_pData->m_String + str1.GetLength(), str2.GetPtr(), str2.GetLength()*sizeof(FX_WCHAR));
+ }
+}
+void CFX_WideString::ReleaseBuffer(FX_STRSIZE nNewLength)
+{
+ if (m_pData == NULL) {
+ return;
+ }
+ CopyBeforeWrite();
+ if (nNewLength == -1) {
+ nNewLength = m_pData ? (FX_STRSIZE)FXSYS_wcslen(m_pData->m_String) : 0;
+ }
+ if (nNewLength == 0) {
+ Empty();
+ return;
+ }
+ FXSYS_assert(nNewLength <= m_pData->m_nAllocLength);
+ m_pData->m_nDataLength = nNewLength;
+ m_pData->m_String[nNewLength] = 0;
+}
+const CFX_WideString& CFX_WideString::operator=(FX_LPCWSTR lpsz)
+{
+ if (lpsz == NULL || lpsz[0] == 0) {
+ Empty();
+ } else {
+ AssignCopy((FX_STRSIZE)FXSYS_wcslen(lpsz), lpsz);
+ }
+ return *this;
+}
+const CFX_WideString& CFX_WideString::operator=(const CFX_WideStringC& stringSrc)
+{
+ if (stringSrc.IsEmpty()) {
+ Empty();
+ } else {
+ AssignCopy(stringSrc.GetLength(), stringSrc.GetPtr());
+ }
+ return *this;
+}
+const CFX_WideString& CFX_WideString::operator=(const CFX_WideString& stringSrc)
+{
+ if (m_pData == stringSrc.m_pData) {
+ return *this;
+ }
+ if (stringSrc.IsEmpty()) {
+ Empty();
+ } else if ((m_pData && m_pData->m_nRefs < 0) ||
+ (stringSrc.m_pData && stringSrc.m_pData->m_nRefs < 0)) {
+ AssignCopy(stringSrc.m_pData->m_nDataLength, stringSrc.m_pData->m_String);
+ } else {
+ Empty();
+ m_pData = stringSrc.m_pData;
+ if (m_pData) {
+ m_pData->m_nRefs ++;
+ }
+ }
+ return *this;
+}
+const CFX_WideString& CFX_WideString::operator+=(FX_WCHAR ch)
+{
+ ConcatInPlace(1, &ch);
+ return *this;
+}
+const CFX_WideString& CFX_WideString::operator+=(FX_LPCWSTR lpsz)
+{
+ if (lpsz) {
+ ConcatInPlace((FX_STRSIZE)FXSYS_wcslen(lpsz), lpsz);
+ }
+ return *this;
+}
+const CFX_WideString& CFX_WideString::operator+=(const CFX_WideString& string)
+{
+ if (string.m_pData == NULL) {
+ return *this;
+ }
+ ConcatInPlace(string.m_pData->m_nDataLength, string.m_pData->m_String);
+ return *this;
+}
+const CFX_WideString& CFX_WideString::operator+=(const CFX_WideStringC& string)
+{
+ if (string.IsEmpty()) {
+ return *this;
+ }
+ ConcatInPlace(string.GetLength(), string.GetPtr());
+ return *this;
+}
+bool operator==(const CFX_WideString& s1, FX_LPCWSTR s2)
+{
+ return s1.Equal(s2);
+}
+bool operator==(FX_LPCWSTR s1, const CFX_WideString& s2)
+{
+ return s2.Equal(s1);
+}
+bool operator==(const CFX_WideString& s1, const CFX_WideString& s2)
+{
+ return s1.Equal(s2);
+}
+bool operator==(const CFX_WideString& s1, const CFX_WideStringC& s2)
+{
+ return s1.Equal(s2);
+}
+bool operator==(const CFX_WideStringC& s1, const CFX_WideString& s2)
+{
+ return s2.Equal(s1);
+}
+bool operator != (const CFX_WideString& s1, FX_LPCWSTR s2)
+{
+ return !s1.Equal(s2);
+}
+bool operator!=(const CFX_WideString& s1, const CFX_WideString& s2)
+{
+ return !s1.Equal(s2);
+}
+bool operator!=(const CFX_WideString& s1, const CFX_WideStringC& s2)
+{
+ return !s1.Equal(s2);
+}
+bool operator!=(const CFX_WideStringC& s1, const CFX_WideString& s2)
+{
+ return !s2.Equal(s1);
+}
+bool CFX_WideString::Equal(const CFX_WideStringC& str) const
+{
+ if (m_pData == NULL) {
+ return str.IsEmpty();
+ }
+ return str.GetLength() == m_pData->m_nDataLength &&
+ FXSYS_memcmp32(str.GetPtr(), m_pData->m_String, m_pData->m_nDataLength * sizeof(FX_WCHAR)) == 0;
+}
+void CFX_WideString::Empty()
+{
+ if (m_pData == NULL) {
+ return;
+ }
+ if (m_pData->m_nRefs > 1) {
+ m_pData->m_nRefs --;
+ } else {
+ FX_Free(m_pData);
+ }
+ m_pData = NULL;
+}
+void CFX_WideString::ConcatInPlace(FX_STRSIZE nSrcLen, FX_LPCWSTR lpszSrcData)
+{
+ if (nSrcLen == 0 || lpszSrcData == NULL) {
+ return;
+ }
+ if (m_pData == NULL) {
+ m_pData = FX_AllocStringW(nSrcLen);
+ if (m_pData) {
+ FXSYS_memcpy32(m_pData->m_String, lpszSrcData, nSrcLen * sizeof(FX_WCHAR));
+ }
+ return;
+ }
+ if (m_pData->m_nRefs > 1 || m_pData->m_nDataLength + nSrcLen > m_pData->m_nAllocLength) {
+ CFX_StringDataW* pOldData = m_pData;
+ ConcatCopy(m_pData->m_nDataLength, m_pData->m_String, nSrcLen, lpszSrcData);
+ FX_ReleaseStringW(pOldData);
+ } else {
+ FXSYS_memcpy32(m_pData->m_String + m_pData->m_nDataLength, lpszSrcData, nSrcLen * sizeof(FX_WCHAR));
+ m_pData->m_nDataLength += nSrcLen;
+ m_pData->m_String[m_pData->m_nDataLength] = 0;
+ }
+}
+void CFX_WideString::ConcatCopy(FX_STRSIZE nSrc1Len, FX_LPCWSTR lpszSrc1Data,
+ FX_STRSIZE nSrc2Len, FX_LPCWSTR lpszSrc2Data)
+{
+ FX_STRSIZE nNewLen = nSrc1Len + nSrc2Len;
+ if (nNewLen == 0) {
+ return;
+ }
+ m_pData = FX_AllocStringW(nNewLen);
+ if (m_pData) {
+ FXSYS_memcpy32(m_pData->m_String, lpszSrc1Data, nSrc1Len * sizeof(FX_WCHAR));
+ FXSYS_memcpy32(m_pData->m_String + nSrc1Len, lpszSrc2Data, nSrc2Len * sizeof(FX_WCHAR));
+ }
+}
+void CFX_WideString::CopyBeforeWrite()
+{
+ if (m_pData == NULL || m_pData->m_nRefs <= 1) {
+ return;
+ }
+ CFX_StringDataW* pData = m_pData;
+ m_pData->m_nRefs --;
+ FX_STRSIZE nDataLength = pData->m_nDataLength;
+ m_pData = FX_AllocStringW(nDataLength);
+ if (m_pData != NULL) {
+ FXSYS_memcpy32(m_pData->m_String, pData->m_String, (nDataLength + 1) * sizeof(FX_WCHAR));
+ }
+}
+void CFX_WideString::AllocBeforeWrite(FX_STRSIZE nLen)
+{
+ if (m_pData && m_pData->m_nRefs <= 1 && m_pData->m_nAllocLength >= nLen) {
+ return;
+ }
+ Empty();
+ m_pData = FX_AllocStringW(nLen);
+}
+void CFX_WideString::AssignCopy(FX_STRSIZE nSrcLen, FX_LPCWSTR lpszSrcData)
+{
+ AllocBeforeWrite(nSrcLen);
+ FXSYS_memcpy32(m_pData->m_String, lpszSrcData, nSrcLen * sizeof(FX_WCHAR));
+ m_pData->m_nDataLength = nSrcLen;
+ m_pData->m_String[nSrcLen] = 0;
+}
+int CFX_WideString::Compare(FX_LPCWSTR lpsz) const
+{
+ if (m_pData == NULL) {
+ return (lpsz == NULL || lpsz[0] == 0) ? 0 : -1;
+ }
+ return FXSYS_wcscmp(m_pData->m_String, lpsz);
+}
+CFX_ByteString CFX_WideString::UTF8Encode() const
+{
+ return FX_UTF8Encode(*this);
+}
+CFX_ByteString CFX_WideString::UTF16LE_Encode(FX_BOOL bTerminate) const
+{
+ if (m_pData == NULL) {
+ return bTerminate ? CFX_ByteString(FX_BSTRC("\0\0")) : CFX_ByteString();
+ }
+ int len = m_pData->m_nDataLength;
+ CFX_ByteString result;
+ FX_LPSTR buffer = result.GetBuffer(len * 2 + (bTerminate ? 2 : 0));
+ for (int i = 0; i < len; i ++) {
+ buffer[i * 2] = m_pData->m_String[i] & 0xff;
+ buffer[i * 2 + 1] = m_pData->m_String[i] >> 8;
+ }
+ if (bTerminate) {
+ buffer[len * 2] = 0;
+ buffer[len * 2 + 1] = 0;
+ result.ReleaseBuffer(len * 2 + 2);
+ } else {
+ result.ReleaseBuffer(len * 2);
+ }
+ return result;
+}
+void CFX_WideString::ConvertFrom(const CFX_ByteString& str, CFX_CharMap* pCharMap)
+{
+ if (pCharMap == NULL) {
+ pCharMap = CFX_CharMap::GetDefaultMapper();
+ }
+ *this = pCharMap->m_GetWideString(pCharMap, str);
+}
+void CFX_WideString::Reserve(FX_STRSIZE len)
+{
+ GetBuffer(len);
+ ReleaseBuffer(GetLength());
+}
+FX_LPWSTR CFX_WideString::GetBuffer(FX_STRSIZE nMinBufLength)
+{
+ if (m_pData == NULL && nMinBufLength == 0) {
+ return NULL;
+ }
+ if (m_pData && m_pData->m_nRefs <= 1 && m_pData->m_nAllocLength >= nMinBufLength) {
+ return m_pData->m_String;
+ }
+ if (m_pData == NULL) {
+ m_pData = FX_AllocStringW(nMinBufLength);
+ if (!m_pData) {
+ return NULL;
+ }
+ m_pData->m_nDataLength = 0;
+ m_pData->m_String[0] = 0;
+ return m_pData->m_String;
+ }
+ CFX_StringDataW* pOldData = m_pData;
+ FX_STRSIZE nOldLen = pOldData->m_nDataLength;
+ if (nMinBufLength < nOldLen) {
+ nMinBufLength = nOldLen;
+ }
+ m_pData = FX_AllocStringW(nMinBufLength);
+ if (!m_pData) {
+ return NULL;
+ }
+ FXSYS_memcpy32(m_pData->m_String, pOldData->m_String, (nOldLen + 1)*sizeof(FX_WCHAR));
+ m_pData->m_nDataLength = nOldLen;
+ pOldData->m_nRefs --;
+ if (pOldData->m_nRefs <= 0) {
+ FX_Free(pOldData);
+ }
+ return m_pData->m_String;
+}
+CFX_WideString CFX_WideString::FromLocal(const char* str, FX_STRSIZE len)
+{
+ CFX_WideString result;
+ result.ConvertFrom(CFX_ByteString(str, len));
+ return result;
+}
+CFX_WideString CFX_WideString::FromUTF8(const char* str, FX_STRSIZE len)
+{
+ if (!str) {
+ return CFX_WideString();
+ }
+ if (len < 0) {
+ len = 0;
+ while (str[len]) {
+ len ++;
+ }
+ }
+ CFX_UTF8Decoder decoder;
+ for (FX_STRSIZE i = 0; i < len; i ++) {
+ decoder.Input(str[i]);
+ }
+ return decoder.GetResult();
+}
+CFX_WideString CFX_WideString::FromUTF16LE(const unsigned short* wstr, FX_STRSIZE wlen)
+{
+ if (!wstr || !wlen) {
+ return CFX_WideString();
+ }
+ if (wlen < 0) {
+ wlen = 0;
+ while (wstr[wlen]) {
+ wlen ++;
+ }
+ }
+ CFX_WideString result;
+ FX_WCHAR* buf = result.GetBuffer(wlen);
+ for (int i = 0; i < wlen; i ++) {
+ buf[i] = wstr[i];
+ }
+ result.ReleaseBuffer(wlen);
+ return result;
+}
+void CFX_WideString::AllocCopy(CFX_WideString& dest, FX_STRSIZE nCopyLen, FX_STRSIZE nCopyIndex,
+ FX_STRSIZE nExtraLen) const
+{
+ FX_STRSIZE nNewLen = nCopyLen + nExtraLen;
+ if (nNewLen == 0) {
+ return;
+ }
+ ASSERT(dest.m_pData == NULL);
+ dest.m_pData = FX_AllocStringW(nNewLen);
+ if (dest.m_pData) {
+ FXSYS_memcpy32(dest.m_pData->m_String, m_pData->m_String + nCopyIndex, nCopyLen * sizeof(FX_WCHAR));
+ }
+}
+CFX_WideString CFX_WideString::Left(FX_STRSIZE nCount) const
+{
+ if (m_pData == NULL) {
+ return CFX_WideString();
+ }
+ if (nCount < 0) {
+ nCount = 0;
+ }
+ if (nCount >= m_pData->m_nDataLength) {
+ return *this;
+ }
+ CFX_WideString dest;
+ AllocCopy(dest, nCount, 0, 0);
+ return dest;
+}
+CFX_WideString CFX_WideString::Mid(FX_STRSIZE nFirst) const
+{
+ return Mid(nFirst, m_pData->m_nDataLength - nFirst);
+}
+CFX_WideString CFX_WideString::Mid(FX_STRSIZE nFirst, FX_STRSIZE nCount) const
+{
+ if (m_pData == NULL) {
+ return CFX_WideString();
+ }
+ if (nFirst < 0) {
+ nFirst = 0;
+ }
+ if (nCount < 0) {
+ nCount = 0;
+ }
+ if (nFirst + nCount > m_pData->m_nDataLength) {
+ nCount = m_pData->m_nDataLength - nFirst;
+ }
+ if (nFirst > m_pData->m_nDataLength) {
+ nCount = 0;
+ }
+ if (nFirst == 0 && nFirst + nCount == m_pData->m_nDataLength) {
+ return *this;
+ }
+ CFX_WideString dest;
+ AllocCopy(dest, nCount, nFirst, 0);
+ return dest;
+}
+CFX_WideString CFX_WideString::Right(FX_STRSIZE nCount) const
+{
+ if (m_pData == NULL) {
+ return CFX_WideString();
+ }
+ if (nCount < 0) {
+ nCount = 0;
+ }
+ if (nCount >= m_pData->m_nDataLength) {
+ return *this;
+ }
+ CFX_WideString dest;
+ AllocCopy(dest, nCount, m_pData->m_nDataLength - nCount, 0);
+ return dest;
+}
+int CFX_WideString::CompareNoCase(FX_LPCWSTR lpsz) const
+{
+ if (m_pData == NULL) {
+ return (lpsz == NULL || lpsz[0] == 0) ? 0 : -1;
+ }
+ return FXSYS_wcsicmp(m_pData->m_String, lpsz);
+}
+int CFX_WideString::Compare(const CFX_WideString& str) const
+{
+ if (m_pData == NULL) {
+ if (str.m_pData == NULL) {
+ return 0;
+ }
+ return -1;
+ } else if (str.m_pData == NULL) {
+ return 1;
+ }
+ int this_len = m_pData->m_nDataLength;
+ int that_len = str.m_pData->m_nDataLength;
+ int min_len = this_len < that_len ? this_len : that_len;
+ for (int i = 0; i < min_len; i ++) {
+ if (m_pData->m_String[i] < str.m_pData->m_String[i]) {
+ return -1;
+ } else if (m_pData->m_String[i] > str.m_pData->m_String[i]) {
+ return 1;
+ }
+ }
+ if (this_len < that_len) {
+ return -1;
+ } else if (this_len > that_len) {
+ return 1;
+ }
+ return 0;
+}
+FX_LPWSTR CFX_WideString::LockBuffer()
+{
+ if (m_pData == NULL) {
+ return NULL;
+ }
+ FX_LPWSTR lpsz = GetBuffer(0);
+ m_pData->m_nRefs = -1;
+ return lpsz;
+}
+void CFX_WideString::SetAt(FX_STRSIZE nIndex, FX_WCHAR ch)
+{
+ if (m_pData == NULL) {
+ return;
+ }
+ ASSERT(nIndex >= 0);
+ ASSERT(nIndex < m_pData->m_nDataLength);
+ CopyBeforeWrite();
+ m_pData->m_String[nIndex] = ch;
+}
+void CFX_WideString::MakeLower()
+{
+ if (m_pData == NULL) {
+ return;
+ }
+ CopyBeforeWrite();
+ if (GetLength() < 1) {
+ return;
+ }
+ FXSYS_wcslwr(m_pData->m_String);
+}
+void CFX_WideString::MakeUpper()
+{
+ if (m_pData == NULL) {
+ return;
+ }
+ CopyBeforeWrite();
+ if (GetLength() < 1) {
+ return;
+ }
+ FXSYS_wcsupr(m_pData->m_String);
+}
+FX_STRSIZE CFX_WideString::Find(FX_LPCWSTR lpszSub, FX_STRSIZE nStart) const
+{
+ FX_STRSIZE nLength = GetLength();
+ if (nLength < 1 || nStart > nLength) {
+ return -1;
+ }
+ FX_LPCWSTR lpsz = (FX_LPCWSTR)FXSYS_wcsstr(m_pData->m_String + nStart, lpszSub);
+ return (lpsz == NULL) ? -1 : (int)(lpsz - m_pData->m_String);
+}
+FX_STRSIZE CFX_WideString::Find(FX_WCHAR ch, FX_STRSIZE nStart) const
+{
+ if (m_pData == NULL) {
+ return -1;
+ }
+ FX_STRSIZE nLength = m_pData->m_nDataLength;
+ if (nStart >= nLength) {
+ return -1;
+ }
+ FX_LPCWSTR lpsz = (FX_LPCWSTR)FXSYS_wcschr(m_pData->m_String + nStart, ch);
+ return (lpsz == NULL) ? -1 : (int)(lpsz - m_pData->m_String);
+}
+void CFX_WideString::TrimRight(FX_LPCWSTR lpszTargetList)
+{
+ FXSYS_assert(lpszTargetList != NULL);
+ if (m_pData == NULL || *lpszTargetList == 0) {
+ return;
+ }
+ CopyBeforeWrite();
+ FX_STRSIZE len = GetLength();
+ if (len < 1) {
+ return;
+ }
+ FX_STRSIZE pos = len;
+ while (pos) {
+ if (FXSYS_wcschr(lpszTargetList, m_pData->m_String[pos - 1]) == NULL) {
+ break;
+ }
+ pos --;
+ }
+ if (pos < len) {
+ m_pData->m_String[pos] = 0;
+ m_pData->m_nDataLength = pos;
+ }
+}
+void CFX_WideString::TrimRight(FX_WCHAR chTarget)
+{
+ FX_WCHAR str[2] = {chTarget, 0};
+ TrimRight(str);
+}
+void CFX_WideString::TrimRight()
+{
+ TrimRight(L"\x09\x0a\x0b\x0c\x0d\x20");
+}
+void CFX_WideString::TrimLeft(FX_LPCWSTR lpszTargets)
+{
+ FXSYS_assert(lpszTargets != NULL);
+ if (m_pData == NULL || *lpszTargets == 0) {
+ return;
+ }
+ CopyBeforeWrite();
+ if (GetLength() < 1) {
+ return;
+ }
+ FX_LPCWSTR lpsz = m_pData->m_String;
+ while (*lpsz != 0) {
+ if (FXSYS_wcschr(lpszTargets, *lpsz) == NULL) {
+ break;
+ }
+ lpsz ++;
+ }
+ if (lpsz != m_pData->m_String) {
+ int nDataLength = m_pData->m_nDataLength - (FX_STRSIZE)(lpsz - m_pData->m_String);
+ FXSYS_memmove32(m_pData->m_String, lpsz, (nDataLength + 1)*sizeof(FX_WCHAR));
+ m_pData->m_nDataLength = nDataLength;
+ }
+}
+void CFX_WideString::TrimLeft(FX_WCHAR chTarget)
+{
+ FX_WCHAR str[2] = {chTarget, 0};
+ TrimLeft(str);
+}
+void CFX_WideString::TrimLeft()
+{
+ TrimLeft(L"\x09\x0a\x0b\x0c\x0d\x20");
+}
+FX_STRSIZE CFX_WideString::Replace(FX_LPCWSTR lpszOld, FX_LPCWSTR lpszNew)
+{
+ if (GetLength() < 1) {
+ return 0;
+ }
+ if (lpszOld == NULL) {
+ return 0;
+ }
+ FX_STRSIZE nSourceLen = (FX_STRSIZE)FXSYS_wcslen(lpszOld);
+ if (nSourceLen == 0) {
+ return 0;
+ }
+ FX_STRSIZE nReplacementLen = lpszNew ? (FX_STRSIZE)FXSYS_wcslen(lpszNew) : 0;
+ FX_STRSIZE nCount = 0;
+ FX_LPWSTR lpszStart = m_pData->m_String;
+ FX_LPWSTR lpszEnd = m_pData->m_String + m_pData->m_nDataLength;
+ FX_LPWSTR lpszTarget;
+ {
+ while ((lpszTarget = (FX_LPWSTR)FXSYS_wcsstr(lpszStart, lpszOld)) != NULL && lpszStart < lpszEnd) {
+ nCount++;
+ lpszStart = lpszTarget + nSourceLen;
+ }
+ }
+ if (nCount > 0) {
+ CopyBeforeWrite();
+ FX_STRSIZE nOldLength = m_pData->m_nDataLength;
+ FX_STRSIZE nNewLength = nOldLength + (nReplacementLen - nSourceLen) * nCount;
+ if (m_pData->m_nAllocLength < nNewLength || m_pData->m_nRefs > 1) {
+ CFX_StringDataW* pOldData = m_pData;
+ FX_LPCWSTR pstr = m_pData->m_String;
+ m_pData = FX_AllocStringW(nNewLength);
+ if (!m_pData) {
+ return 0;
+ }
+ FXSYS_memcpy32(m_pData->m_String, pstr, pOldData->m_nDataLength * sizeof(FX_WCHAR));
+ FX_ReleaseStringW(pOldData);
+ }
+ lpszStart = m_pData->m_String;
+ lpszEnd = m_pData->m_String + FX_MAX(m_pData->m_nDataLength, nNewLength);
+ {
+ while ((lpszTarget = (FX_LPWSTR)FXSYS_wcsstr(lpszStart, lpszOld)) != NULL && lpszStart < lpszEnd) {
+ FX_STRSIZE nBalance = nOldLength - (FX_STRSIZE)(lpszTarget - m_pData->m_String + nSourceLen);
+ FXSYS_memmove32(lpszTarget + nReplacementLen, lpszTarget + nSourceLen, nBalance * sizeof(FX_WCHAR));
+ FXSYS_memcpy32(lpszTarget, lpszNew, nReplacementLen * sizeof(FX_WCHAR));
+ lpszStart = lpszTarget + nReplacementLen;
+ lpszStart[nBalance] = 0;
+ nOldLength += (nReplacementLen - nSourceLen);
+ }
+ }
+ ASSERT(m_pData->m_String[nNewLength] == 0);
+ m_pData->m_nDataLength = nNewLength;
+ }
+ return nCount;
+}
+FX_STRSIZE CFX_WideString::Insert(FX_STRSIZE nIndex, FX_WCHAR ch)
+{
+ CopyBeforeWrite();
+ if (nIndex < 0) {
+ nIndex = 0;
+ }
+ FX_STRSIZE nNewLength = GetLength();
+ if (nIndex > nNewLength) {
+ nIndex = nNewLength;
+ }
+ nNewLength++;
+ if (m_pData == NULL || m_pData->m_nAllocLength < nNewLength) {
+ CFX_StringDataW* pOldData = m_pData;
+ FX_LPCWSTR pstr = m_pData->m_String;
+ m_pData = FX_AllocStringW(nNewLength);
+ if (!m_pData) {
+ return 0;
+ }
+ if(pOldData != NULL) {
+ FXSYS_memmove32(m_pData->m_String, pstr, (pOldData->m_nDataLength + 1)*sizeof(FX_WCHAR));
+ FX_ReleaseStringW(pOldData);
+ } else {
+ m_pData->m_String[0] = 0;
+ }
+ }
+ FXSYS_memmove32(m_pData->m_String + nIndex + 1,
+ m_pData->m_String + nIndex, (nNewLength - nIndex)*sizeof(FX_WCHAR));
+ m_pData->m_String[nIndex] = ch;
+ m_pData->m_nDataLength = nNewLength;
+ return nNewLength;
+}
+FX_STRSIZE CFX_WideString::Delete(FX_STRSIZE nIndex, FX_STRSIZE nCount)
+{
+ if (GetLength() < 1) {
+ return 0;
+ }
+ if (nIndex < 0) {
+ nIndex = 0;
+ }
+ FX_STRSIZE nOldLength = m_pData->m_nDataLength;
+ if (nCount > 0 && nIndex < nOldLength) {
+ CopyBeforeWrite();
+ int nBytesToCopy = nOldLength - (nIndex + nCount) + 1;
+ FXSYS_memmove32(m_pData->m_String + nIndex,
+ m_pData->m_String + nIndex + nCount, nBytesToCopy * sizeof(FX_WCHAR));
+ m_pData->m_nDataLength = nOldLength - nCount;
+ }
+ return m_pData->m_nDataLength;
+}
+FX_STRSIZE CFX_WideString::Remove(FX_WCHAR chRemove)
+{
+ if (m_pData == NULL) {
+ return 0;
+ }
+ CopyBeforeWrite();
+ if (GetLength() < 1) {
+ return 0;
+ }
+ FX_LPWSTR pstrSource = m_pData->m_String;
+ FX_LPWSTR pstrDest = m_pData->m_String;
+ FX_LPWSTR pstrEnd = m_pData->m_String + m_pData->m_nDataLength;
+ while (pstrSource < pstrEnd) {
+ if (*pstrSource != chRemove) {
+ *pstrDest = *pstrSource;
+ pstrDest ++;
+ }
+ pstrSource ++;
+ }
+ *pstrDest = 0;
+ FX_STRSIZE nCount = (FX_STRSIZE)(pstrSource - pstrDest);
+ m_pData->m_nDataLength -= nCount;
+ return nCount;
+}
+#define FORCE_ANSI 0x10000
+#define FORCE_UNICODE 0x20000
+#define FORCE_INT64 0x40000
+void CFX_WideString::FormatV(FX_LPCWSTR lpszFormat, va_list argList)
+{
+ va_list argListSave;
+#if defined(__ARMCC_VERSION) || (!defined(_MSC_VER) && (_FX_CPU_ == _FX_X64_ || _FX_CPU_ == _FX_IA64_ || _FX_CPU_ == _FX_ARM64_)) || defined(__native_client__)
+ va_copy(argListSave, argList);
+#else
+ argListSave = argList;
+#endif
+ int nMaxLen = 0;
+ for (FX_LPCWSTR lpsz = lpszFormat; *lpsz != 0; lpsz ++) {
+ if (*lpsz != '%' || *(lpsz = lpsz + 1) == '%') {
+ nMaxLen += (FX_STRSIZE)FXSYS_wcslen(lpsz);
+ continue;
+ }
+ int nItemLen = 0;
+ int nWidth = 0;
+ for (; *lpsz != 0; lpsz ++) {
+ if (*lpsz == '#') {
+ nMaxLen += 2;
+ } else if (*lpsz == '*') {
+ nWidth = va_arg(argList, int);
+ } else if (*lpsz == '-' || *lpsz == '+' || *lpsz == '0' ||
+ *lpsz == ' ')
+ ;
+ else {
+ break;
+ }
+ }
+ if (nWidth == 0) {
+ nWidth = FXSYS_wtoi(lpsz);
+ for (; *lpsz != 0 && (*lpsz) <= '9' && (*lpsz) >= '0'; lpsz ++)
+ ;
+ }
+ if (nWidth < 0 || nWidth > 128 * 1024) {
+ lpszFormat = (FX_LPCWSTR)L"Bad width";
+ nMaxLen = 10;
+ break;
+ }
+ int nPrecision = 0;
+ if (*lpsz == '.') {
+ lpsz ++;
+ if (*lpsz == '*') {
+ nPrecision = va_arg(argList, int);
+ lpsz ++;
+ } else {
+ nPrecision = FXSYS_wtoi(lpsz);
+ for (; *lpsz != 0 && (*lpsz) >= '0' && (*lpsz) <= '9'; lpsz ++)
+ ;
+ }
+ }
+ if (nPrecision < 0 || nPrecision > 128 * 1024) {
+ lpszFormat = (FX_LPCWSTR)L"Bad precision";
+ nMaxLen = 14;
+ break;
+ }
+ int nModifier = 0;
+ if (*lpsz == L'I' && *(lpsz + 1) == L'6' && *(lpsz + 2) == L'4') {
+ lpsz += 3;
+ nModifier = FORCE_INT64;
+ } else {
+ switch (*lpsz) {
+ case 'h':
+ nModifier = FORCE_ANSI;
+ lpsz ++;
+ break;
+ case 'l':
+ nModifier = FORCE_UNICODE;
+ lpsz ++;
+ break;
+ case 'F':
+ case 'N':
+ case 'L':
+ lpsz ++;
+ break;
+ }
+ }
+ switch (*lpsz | nModifier) {
+ case 'c':
+ case 'C':
+ nItemLen = 2;
+ va_arg(argList, int);
+ break;
+ case 'c'|FORCE_ANSI:
+ case 'C'|FORCE_ANSI:
+ nItemLen = 2;
+ va_arg(argList, int);
+ break;
+ case 'c'|FORCE_UNICODE:
+ case 'C'|FORCE_UNICODE:
+ nItemLen = 2;
+ va_arg(argList, int);
+ break;
+ case 's': {
+ FX_LPCWSTR pstrNextArg = va_arg(argList, FX_LPCWSTR);
+ if (pstrNextArg == NULL) {
+ nItemLen = 6;
+ } else {
+ nItemLen = (FX_STRSIZE)FXSYS_wcslen(pstrNextArg);
+ if (nItemLen < 1) {
+ nItemLen = 1;
+ }
+ }
+ }
+ break;
+ case 'S': {
+ FX_LPCSTR pstrNextArg = va_arg(argList, FX_LPCSTR);
+ if (pstrNextArg == NULL) {
+ nItemLen = 6;
+ } else {
+ nItemLen = (FX_STRSIZE)FXSYS_strlen(pstrNextArg);
+ if (nItemLen < 1) {
+ nItemLen = 1;
+ }
+ }
+ }
+ break;
+ case 's'|FORCE_ANSI:
+ case 'S'|FORCE_ANSI: {
+ FX_LPCSTR pstrNextArg = va_arg(argList, FX_LPCSTR);
+ if (pstrNextArg == NULL) {
+ nItemLen = 6;
+ } else {
+ nItemLen = (FX_STRSIZE)FXSYS_strlen(pstrNextArg);
+ if (nItemLen < 1) {
+ nItemLen = 1;
+ }
+ }
+ }
+ break;
+ case 's'|FORCE_UNICODE:
+ case 'S'|FORCE_UNICODE: {
+ FX_LPWSTR pstrNextArg = va_arg(argList, FX_LPWSTR);
+ if (pstrNextArg == NULL) {
+ nItemLen = 6;
+ } else {
+ nItemLen = (FX_STRSIZE)FXSYS_wcslen(pstrNextArg);
+ if (nItemLen < 1) {
+ nItemLen = 1;
+ }
+ }
+ }
+ break;
+ }
+ if (nItemLen != 0) {
+ if (nPrecision != 0 && nItemLen > nPrecision) {
+ nItemLen = nPrecision;
+ }
+ if (nItemLen < nWidth) {
+ nItemLen = nWidth;
+ }
+ } else {
+ switch (*lpsz) {
+ case 'd':
+ case 'i':
+ case 'u':
+ case 'x':
+ case 'X':
+ case 'o':
+ if (nModifier & FORCE_INT64) {
+ va_arg(argList, FX_INT64);
+ } else {
+ va_arg(argList, int);
+ }
+ nItemLen = 32;
+ if (nItemLen < nWidth + nPrecision) {
+ nItemLen = nWidth + nPrecision;
+ }
+ break;
+ case 'a':
+ case 'A':
+ case 'e':
+ case 'E':
+ case 'g':
+ case 'G':
+ va_arg(argList, double);
+ nItemLen = 128;
+ if (nItemLen < nWidth + nPrecision) {
+ nItemLen = nWidth + nPrecision;
+ }
+ break;
+ case 'f':
+ if (nWidth + nPrecision > 100) {
+ nItemLen = nPrecision + nWidth + 128;
+ } else {
+ double f;
+ char pszTemp[256];
+ f = va_arg(argList, double);
+ FXSYS_snprintf(pszTemp, sizeof(pszTemp), "%*.*f", nWidth, nPrecision + 6, f );
+ nItemLen = (FX_STRSIZE)FXSYS_strlen(pszTemp);
+ }
+ break;
+ case 'p':
+ va_arg(argList, void*);
+ nItemLen = 32;
+ if (nItemLen < nWidth + nPrecision) {
+ nItemLen = nWidth + nPrecision;
+ }
+ break;
+ case 'n':
+ va_arg(argList, int*);
+ break;
+ }
+ }
+ nMaxLen += nItemLen;
+ }
+ GetBuffer(nMaxLen);
+ if (m_pData) {
+ FXSYS_vswprintf((wchar_t*)m_pData->m_String, nMaxLen + 1, (const wchar_t*)lpszFormat, argListSave);
+ ReleaseBuffer();
+ }
+ va_end(argListSave);
+}
+void CFX_WideString::Format(FX_LPCWSTR lpszFormat, ...)
+{
+ va_list argList;
+ va_start(argList, lpszFormat);
+ FormatV(lpszFormat, argList);
+ va_end(argList);
+}
+FX_FLOAT FX_wtof(FX_LPCWSTR str, int len)
+{
+ if (len == 0) {
+ return 0.0;
+ }
+ int cc = 0;
+ FX_BOOL bNegative = FALSE;
+ if (str[0] == '+') {
+ cc++;
+ } else if (str[0] == '-') {
+ bNegative = TRUE;
+ cc++;
+ }
+ int integer = 0;
+ while (cc < len) {
+ if (str[cc] == '.') {
+ break;
+ }
+ integer = integer * 10 + str[cc] - '0';
+ cc ++;
+ }
+ FX_FLOAT fraction = 0;
+ if (str[cc] == '.') {
+ cc ++;
+ FX_FLOAT scale = 0.1f;
+ while (cc < len) {
+ fraction += scale * (str[cc] - '0');
+ scale *= 0.1f;
+ cc ++;
+ }
+ }
+ fraction += (FX_FLOAT)integer;
+ return bNegative ? -fraction : fraction;
+}
+int CFX_WideString::GetInteger() const
+{
+ if (m_pData == NULL) {
+ return 0;
+ }
+ return FXSYS_wtoi(m_pData->m_String);
+}
+FX_FLOAT CFX_WideString::GetFloat() const
+{
+ if (m_pData == NULL) {
+ return 0.0;
+ }
+ return FX_wtof(m_pData->m_String, m_pData->m_nDataLength);
+}
+void CFX_WideStringL::Empty(IFX_Allocator* pAllocator)
+{
+ if (m_Ptr) {
+ FX_Allocator_Free(pAllocator, (FX_LPVOID)m_Ptr);
+ }
+ m_Ptr = NULL, m_Length = 0;
+}
+void CFX_WideStringL::Set(FX_WSTR src, IFX_Allocator* pAllocator)
+{
+ Empty(pAllocator);
+ if (src.GetPtr() != NULL && src.GetLength() > 0) {
+ FX_LPWSTR str = FX_Allocator_Alloc(pAllocator, FX_WCHAR, src.GetLength() + 1);
+ if (!str) {
+ return;
+ }
+ FXSYS_memcpy32(str, src.GetPtr(), src.GetLength()*sizeof(FX_WCHAR));
+ str[src.GetLength()] = '\0';
+ *(FX_LPWSTR*)(&m_Ptr) = str;
+ m_Length = src.GetLength();
+ }
+}
+int CFX_WideStringL::GetInteger() const
+{
+ if (!m_Ptr) {
+ return 0;
+ }
+ return FXSYS_wtoi(m_Ptr);
+}
+FX_FLOAT CFX_WideStringL::GetFloat() const
+{
+ if (!m_Ptr) {
+ return 0.0f;
+ }
+ return FX_wtof(m_Ptr, m_Length);
+}
+void CFX_WideStringL::TrimRight(FX_LPCWSTR lpszTargets)
+{
+ if (!lpszTargets || *lpszTargets == 0 || !m_Ptr || m_Length < 1) {
+ return;
+ }
+ FX_STRSIZE pos = m_Length;
+ while (pos) {
+ if (FXSYS_wcschr(lpszTargets, m_Ptr[pos - 1]) == NULL) {
+ break;
+ }
+ pos --;
+ }
+ if (pos < m_Length) {
+ (*(FX_LPWSTR*)(&m_Ptr))[pos] = 0;
+ m_Length = pos;
+ }
+}
+static CFX_ByteString _DefMap_GetByteString(CFX_CharMap* pCharMap, const CFX_WideString& widestr)
+{
+ int src_len = widestr.GetLength();
+ int codepage = pCharMap->m_GetCodePage ? pCharMap->m_GetCodePage() : 0;
+ int dest_len = FXSYS_WideCharToMultiByte(codepage, 0, widestr, src_len, NULL, 0, NULL, NULL);
+ if (dest_len == 0) {
+ return CFX_ByteString();
+ }
+ CFX_ByteString bytestr;
+ FX_LPSTR dest_buf = bytestr.GetBuffer(dest_len);
+ FXSYS_WideCharToMultiByte(codepage, 0, widestr, src_len, dest_buf, dest_len, NULL, NULL);
+ bytestr.ReleaseBuffer(dest_len);
+ return bytestr;
+}
+static CFX_WideString _DefMap_GetWideString(CFX_CharMap* pCharMap, const CFX_ByteString& bytestr)
+{
+ int src_len = bytestr.GetLength();
+ int codepage = pCharMap->m_GetCodePage ? pCharMap->m_GetCodePage() : 0;
+ int dest_len = FXSYS_MultiByteToWideChar(codepage, 0, bytestr, src_len, NULL, 0);
+ if (dest_len == 0) {
+ return CFX_WideString();
+ }
+ CFX_WideString widestr;
+ FX_LPWSTR dest_buf = widestr.GetBuffer(dest_len);
+ FXSYS_MultiByteToWideChar(codepage, 0, bytestr, src_len, dest_buf, dest_len);
+ widestr.ReleaseBuffer(dest_len);
+ return widestr;
+}
+static int _DefMap_GetGBKCodePage()
+{
+ return 936;
+}
+static int _DefMap_GetUHCCodePage()
+{
+ return 949;
+}
+static int _DefMap_GetJISCodePage()
+{
+ return 932;
+}
+static int _DefMap_GetBig5CodePage()
+{
+ return 950;
+}
+static const CFX_CharMap g_DefaultMapper = {&_DefMap_GetWideString, &_DefMap_GetByteString, NULL};
+static const CFX_CharMap g_DefaultGBKMapper = {&_DefMap_GetWideString, &_DefMap_GetByteString, &_DefMap_GetGBKCodePage};
+static const CFX_CharMap g_DefaultJISMapper = {&_DefMap_GetWideString, &_DefMap_GetByteString, &_DefMap_GetJISCodePage};
+static const CFX_CharMap g_DefaultUHCMapper = {&_DefMap_GetWideString, &_DefMap_GetByteString, &_DefMap_GetUHCCodePage};
+static const CFX_CharMap g_DefaultBig5Mapper = {&_DefMap_GetWideString, &_DefMap_GetByteString, &_DefMap_GetBig5CodePage};
+CFX_CharMap* CFX_CharMap::GetDefaultMapper(FX_INT32 codepage)
+{
+ switch (codepage) {
+ case 0:
+ return (CFX_CharMap*)&g_DefaultMapper;
+ case 932:
+ return (CFX_CharMap*)&g_DefaultJISMapper;
+ case 936:
+ return (CFX_CharMap*)&g_DefaultGBKMapper;
+ case 949:
+ return (CFX_CharMap*)&g_DefaultUHCMapper;
+ case 950:
+ return (CFX_CharMap*)&g_DefaultBig5Mapper;
+ }
+ return NULL;
+}
diff --git a/core/src/fxcrt/fx_extension.cpp b/core/src/fxcrt/fx_extension.cpp
index 79d300668f..e7272cff0b 100644
--- a/core/src/fxcrt/fx_extension.cpp
+++ b/core/src/fxcrt/fx_extension.cpp
@@ -1,401 +1,401 @@
-// 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
-
-#include "../../include/fxcrt/fx_ext.h"
-#include "extension.h"
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
-#include <wincrypt.h>
-#else
-#include <ctime>
-#endif
-FX_HFILE FX_File_Open(FX_BSTR fileName, FX_DWORD dwMode, IFX_Allocator* pAllocator)
-{
- IFXCRT_FileAccess* pFA = FXCRT_FileAccess_Create(pAllocator);
- if (pFA && !pFA->Open(fileName, dwMode)) {
- pFA->Release(pAllocator);
- return NULL;
- }
- return (FX_HFILE)pFA;
-}
-FX_HFILE FX_File_Open(FX_WSTR fileName, FX_DWORD dwMode, IFX_Allocator* pAllocator)
-{
- IFXCRT_FileAccess* pFA = FXCRT_FileAccess_Create(pAllocator);
- if (pFA && !pFA->Open(fileName, dwMode)) {
- pFA->Release(pAllocator);
- return NULL;
- }
- return (FX_HFILE)pFA;
-}
-void FX_File_Close(FX_HFILE hFile, IFX_Allocator* pAllocator)
-{
- FXSYS_assert(hFile != NULL);
- ((IFXCRT_FileAccess*)hFile)->Close();
- ((IFXCRT_FileAccess*)hFile)->Release(pAllocator);
-}
-FX_FILESIZE FX_File_GetSize(FX_HFILE hFile)
-{
- FXSYS_assert(hFile != NULL);
- return ((IFXCRT_FileAccess*)hFile)->GetSize();
-}
-FX_FILESIZE FX_File_GetPosition(FX_HFILE hFile)
-{
- FXSYS_assert(hFile != NULL);
- return ((IFXCRT_FileAccess*)hFile)->GetPosition();
-}
-FX_FILESIZE FX_File_SetPosition(FX_HFILE hFile, FX_FILESIZE pos)
-{
- FXSYS_assert(hFile != NULL);
- return ((IFXCRT_FileAccess*)hFile)->SetPosition(pos);
-}
-size_t FX_File_Read(FX_HFILE hFile, void* pBuffer, size_t szBuffer)
-{
- FXSYS_assert(hFile != NULL);
- return ((IFXCRT_FileAccess*)hFile)->Read(pBuffer, szBuffer);
-}
-size_t FX_File_ReadPos(FX_HFILE hFile, void* pBuffer, size_t szBuffer, FX_FILESIZE pos)
-{
- FXSYS_assert(hFile != NULL);
- return ((IFXCRT_FileAccess*)hFile)->ReadPos(pBuffer, szBuffer, pos);
-}
-size_t FX_File_Write(FX_HFILE hFile, const void* pBuffer, size_t szBuffer)
-{
- FXSYS_assert(hFile != NULL);
- return ((IFXCRT_FileAccess*)hFile)->Write(pBuffer, szBuffer);
-}
-size_t FX_File_WritePos(FX_HFILE hFile, const void* pBuffer, size_t szBuffer, FX_FILESIZE pos)
-{
- FXSYS_assert(hFile != NULL);
- return ((IFXCRT_FileAccess*)hFile)->WritePos(pBuffer, szBuffer, pos);
-}
-FX_BOOL FX_File_Flush(FX_HFILE hFile)
-{
- FXSYS_assert(hFile != NULL);
- return ((IFXCRT_FileAccess*)hFile)->Flush();
-}
-FX_BOOL FX_File_Truncate(FX_HFILE hFile, FX_FILESIZE szFile)
-{
- FXSYS_assert(hFile != NULL);
- return ((IFXCRT_FileAccess*)hFile)->Truncate(szFile);
-}
-IFX_FileStream* FX_CreateFileStream(FX_LPCSTR filename, FX_DWORD dwModes, IFX_Allocator* pAllocator)
-{
- IFXCRT_FileAccess* pFA = FXCRT_FileAccess_Create(pAllocator);
- if (!pFA) {
- return NULL;
- }
- if (!pFA->Open(filename, dwModes)) {
- pFA->Release(pAllocator);
- return NULL;
- }
- if (pAllocator) {
- return FX_NewAtAllocator(pAllocator) CFX_CRTFileStream(pFA, pAllocator);
- } else {
- return FX_NEW CFX_CRTFileStream(pFA, pAllocator);
- }
-}
-IFX_FileStream* FX_CreateFileStream(FX_LPCWSTR filename, FX_DWORD dwModes, IFX_Allocator* pAllocator)
-{
- IFXCRT_FileAccess* pFA = FXCRT_FileAccess_Create(pAllocator);
- if (!pFA) {
- return NULL;
- }
- if (!pFA->Open(filename, dwModes)) {
- pFA->Release(pAllocator);
- return NULL;
- }
- if (pAllocator) {
- return FX_NewAtAllocator(pAllocator) CFX_CRTFileStream(pFA, pAllocator);
- } else {
- return FX_NEW CFX_CRTFileStream(pFA, pAllocator);
- }
-}
-IFX_FileWrite* FX_CreateFileWrite(FX_LPCSTR filename, IFX_Allocator* pAllocator)
-{
- return FX_CreateFileStream(filename, FX_FILEMODE_Truncate, pAllocator);
-}
-IFX_FileWrite* FX_CreateFileWrite(FX_LPCWSTR filename, IFX_Allocator* pAllocator)
-{
- return FX_CreateFileStream(filename, FX_FILEMODE_Truncate, pAllocator);
-}
-IFX_FileRead* FX_CreateFileRead(FX_LPCSTR filename, IFX_Allocator* pAllocator)
-{
- return FX_CreateFileStream(filename, FX_FILEMODE_ReadOnly, pAllocator);
-}
-IFX_FileRead* FX_CreateFileRead(FX_LPCWSTR filename, IFX_Allocator* pAllocator)
-{
- return FX_CreateFileStream(filename, FX_FILEMODE_ReadOnly, pAllocator);
-}
-IFX_MemoryStream* FX_CreateMemoryStream(FX_LPBYTE pBuffer, size_t dwSize, FX_BOOL bTakeOver, IFX_Allocator* pAllocator)
-{
- if (pAllocator) {
- return FX_NewAtAllocator(pAllocator)CFX_MemoryStream(pBuffer, dwSize, bTakeOver, pAllocator);
- } else {
- return FX_NEW CFX_MemoryStream(pBuffer, dwSize, bTakeOver, NULL);
- }
-}
-IFX_MemoryStream* FX_CreateMemoryStream(FX_BOOL bConsecutive, IFX_Allocator* pAllocator)
-{
- if (pAllocator) {
- return FX_NewAtAllocator(pAllocator)CFX_MemoryStream(bConsecutive, pAllocator);
- } else {
- return FX_NEW CFX_MemoryStream(bConsecutive, NULL);
- }
-}
-#ifdef __cplusplus
-extern "C" {
-#endif
-FX_FLOAT FXSYS_tan(FX_FLOAT a)
-{
- return (FX_FLOAT)tan(a);
-}
-FX_FLOAT FXSYS_logb(FX_FLOAT b, FX_FLOAT x)
-{
- return FXSYS_log(x) / FXSYS_log(b);
-}
-FX_FLOAT FXSYS_strtof(FX_LPCSTR pcsStr, FX_INT32 iLength, FX_INT32 *pUsedLen)
-{
- FXSYS_assert(pcsStr != NULL);
- if (iLength < 0) {
- iLength = (FX_INT32)FXSYS_strlen(pcsStr);
- }
- CFX_WideString ws = CFX_WideString::FromLocal(pcsStr, iLength);
- return FXSYS_wcstof((FX_LPCWSTR)ws, iLength, pUsedLen);
-}
-FX_FLOAT FXSYS_wcstof(FX_LPCWSTR pwsStr, FX_INT32 iLength, FX_INT32 *pUsedLen)
-{
- FXSYS_assert(pwsStr != NULL);
- if (iLength < 0) {
- iLength = (FX_INT32)FXSYS_wcslen(pwsStr);
- }
- if (iLength == 0) {
- return 0.0f;
- }
- FX_INT32 iUsedLen = 0;
- FX_BOOL bNegtive = FALSE;
- switch (pwsStr[iUsedLen]) {
- case '-':
- bNegtive = TRUE;
- case '+':
- iUsedLen++;
- break;
- }
- FX_FLOAT fValue = 0.0f;
- while (iUsedLen < iLength) {
- FX_WCHAR wch = pwsStr[iUsedLen];
- if (wch >= L'0' && wch <= L'9') {
- fValue = fValue * 10.0f + (wch - L'0');
- } else {
- break;
- }
- iUsedLen++;
- }
- if (iUsedLen < iLength && pwsStr[iUsedLen] == L'.') {
- FX_FLOAT fPrecise = 0.1f;
- while (++iUsedLen < iLength) {
- FX_WCHAR wch = pwsStr[iUsedLen];
- if (wch >= L'0' && wch <= L'9') {
- fValue += (wch - L'0') * fPrecise;
- fPrecise *= 0.1f;
- } else {
- break;
- }
- }
- }
- if (pUsedLen) {
- *pUsedLen = iUsedLen;
- }
- return bNegtive ? -fValue : fValue;
-}
-FX_LPWSTR FXSYS_wcsncpy(FX_LPWSTR dstStr, FX_LPCWSTR srcStr, size_t count)
-{
- FXSYS_assert(dstStr != NULL && srcStr != NULL && count > 0);
- for (size_t i = 0; i < count; ++i)
- if ((dstStr[i] = srcStr[i]) == L'\0') {
- break;
- }
- return dstStr;
-}
-FX_INT32 FXSYS_wcsnicmp(FX_LPCWSTR s1, FX_LPCWSTR s2, size_t count)
-{
- FXSYS_assert(s1 != NULL && s2 != NULL && count > 0);
- FX_WCHAR wch1 = 0, wch2 = 0;
- while (count-- > 0) {
- wch1 = (FX_WCHAR)FXSYS_tolower(*s1++);
- wch2 = (FX_WCHAR)FXSYS_tolower(*s2++);
- if (wch1 != wch2) {
- break;
- }
- }
- return wch1 - wch2;
-}
-FX_INT32 FXSYS_strnicmp(FX_LPCSTR s1, FX_LPCSTR s2, size_t count)
-{
- FXSYS_assert(s1 != NULL && s2 != NULL && count > 0);
- FX_CHAR ch1 = 0, ch2 = 0;
- while (count-- > 0) {
- ch1 = (FX_CHAR)FXSYS_tolower(*s1++);
- ch2 = (FX_CHAR)FXSYS_tolower(*s2++);
- if (ch1 != ch2) {
- break;
- }
- }
- return ch1 - ch2;
-}
-FX_DWORD FX_HashCode_String_GetA(FX_LPCSTR pStr, FX_INT32 iLength, FX_BOOL bIgnoreCase)
-{
- FXSYS_assert(pStr != NULL);
- if (iLength < 0) {
- iLength = (FX_INT32)FXSYS_strlen(pStr);
- }
- FX_LPCSTR pStrEnd = pStr + iLength;
- FX_DWORD dwHashCode = 0;
- if (bIgnoreCase) {
- while (pStr < pStrEnd) {
- dwHashCode = 31 * dwHashCode + FXSYS_tolower(*pStr++);
- }
- } else {
- while (pStr < pStrEnd) {
- dwHashCode = 31 * dwHashCode + *pStr ++;
- }
- }
- return dwHashCode;
-}
-FX_DWORD FX_HashCode_String_GetW(FX_LPCWSTR pStr, FX_INT32 iLength, FX_BOOL bIgnoreCase)
-{
- FXSYS_assert(pStr != NULL);
- if (iLength < 0) {
- iLength = (FX_INT32)FXSYS_wcslen(pStr);
- }
- FX_LPCWSTR pStrEnd = pStr + iLength;
- FX_DWORD dwHashCode = 0;
- if (bIgnoreCase) {
- while (pStr < pStrEnd) {
- dwHashCode = 1313 * dwHashCode + FXSYS_tolower(*pStr++);
- }
- } else {
- while (pStr < pStrEnd) {
- dwHashCode = 1313 * dwHashCode + *pStr ++;
- }
- }
- return dwHashCode;
-}
-#ifdef __cplusplus
-}
-#endif
-#ifdef __cplusplus
-extern "C" {
-#endif
-FX_LPVOID FX_Random_MT_Start(FX_DWORD dwSeed)
-{
- FX_LPMTRANDOMCONTEXT pContext = FX_Alloc(FX_MTRANDOMCONTEXT, 1);
- if (!pContext) {
- return NULL;
- }
- pContext->mt[0] = dwSeed;
- FX_DWORD &i = pContext->mti;
- FX_LPDWORD pBuf = pContext->mt;
- for (i = 1; i < MT_N; i ++) {
- pBuf[i] = (1812433253UL * (pBuf[i - 1] ^ (pBuf[i - 1] >> 30)) + i);
- }
- pContext->bHaveSeed = TRUE;
- return pContext;
-}
-FX_DWORD FX_Random_MT_Generate(FX_LPVOID pContext)
-{
- FXSYS_assert(pContext != NULL);
- FX_LPMTRANDOMCONTEXT pMTC = (FX_LPMTRANDOMCONTEXT)pContext;
- FX_DWORD v;
- static FX_DWORD mag[2] = {0, MT_Matrix_A};
- FX_DWORD &mti = pMTC->mti;
- FX_LPDWORD pBuf = pMTC->mt;
- if ((int)mti < 0 || mti >= MT_N) {
- if (mti > MT_N && !pMTC->bHaveSeed) {
- return 0;
- }
- FX_DWORD kk;
- for (kk = 0; kk < MT_N - MT_M; kk ++) {
- v = (pBuf[kk] & MT_Upper_Mask) | (pBuf[kk + 1] & MT_Lower_Mask);
- pBuf[kk] = pBuf[kk + MT_M] ^ (v >> 1) ^ mag[v & 1];
- }
- for (; kk < MT_N - 1; kk ++) {
- v = (pBuf[kk] & MT_Upper_Mask) | (pBuf[kk + 1] & MT_Lower_Mask);
- pBuf[kk] = pBuf[kk + (MT_M - MT_N)] ^ (v >> 1) ^ mag[v & 1];
- }
- v = (pBuf[MT_N - 1] & MT_Upper_Mask) | (pBuf[0] & MT_Lower_Mask);
- pBuf[MT_N - 1] = pBuf[MT_M - 1] ^ (v >> 1) ^ mag[v & 1];
- mti = 0;
- }
- v = pBuf[mti ++];
- v ^= (v >> 11);
- v ^= (v << 7) & 0x9d2c5680UL;
- v ^= (v << 15) & 0xefc60000UL;
- v ^= (v >> 18);
- return v;
-}
-void FX_Random_MT_Close(FX_LPVOID pContext)
-{
- FXSYS_assert(pContext != NULL);
- FX_Free(pContext);
-}
-void FX_Random_GenerateMT(FX_LPDWORD pBuffer, FX_INT32 iCount)
-{
- FX_DWORD dwSeed;
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
- if (!FX_GenerateCryptoRandom(&dwSeed, 1)) {
- FX_Random_GenerateBase(&dwSeed, 1);
- }
-#else
- FX_Random_GenerateBase(&dwSeed, 1);
-#endif
- FX_LPVOID pContext = FX_Random_MT_Start(dwSeed);
- while (iCount -- > 0) {
- *pBuffer ++ = FX_Random_MT_Generate(pContext);
- }
- FX_Random_MT_Close(pContext);
-}
-void FX_Random_GenerateBase(FX_LPDWORD pBuffer, FX_INT32 iCount)
-{
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
- SYSTEMTIME st1, st2;
- ::GetSystemTime(&st1);
- do {
- ::GetSystemTime(&st2);
- } while (FXSYS_memcmp32(&st1, &st2, sizeof(SYSTEMTIME)) == 0);
- FX_DWORD dwHash1 = FX_HashCode_String_GetA((FX_LPCSTR)&st1, sizeof(st1), TRUE);
- FX_DWORD dwHash2 = FX_HashCode_String_GetA((FX_LPCSTR)&st2, sizeof(st2), TRUE);
- ::srand((dwHash1 << 16) | (FX_DWORD)dwHash2);
-#else
- time_t tmLast = time(NULL), tmCur;
- while ((tmCur = time(NULL)) == tmLast);
- ::srand((tmCur << 16) | (tmLast & 0xFFFF));
-#endif
- while (iCount -- > 0) {
- *pBuffer ++ = (FX_DWORD)((::rand() << 16) | (::rand() & 0xFFFF));
- }
-}
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
-FX_BOOL FX_GenerateCryptoRandom(FX_LPDWORD pBuffer, FX_INT32 iCount)
-{
- HCRYPTPROV hCP = NULL;
- if (!::CryptAcquireContext(&hCP, NULL, NULL, PROV_RSA_FULL, 0) || hCP == NULL) {
- return FALSE;
- }
- ::CryptGenRandom(hCP, iCount * sizeof(FX_DWORD), (FX_LPBYTE)pBuffer);
- ::CryptReleaseContext(hCP, 0);
- return TRUE;
-}
-#endif
-void FX_Random_GenerateCrypto(FX_LPDWORD pBuffer, FX_INT32 iCount)
-{
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
- FX_GenerateCryptoRandom(pBuffer, iCount);
-#else
- FX_Random_GenerateBase(pBuffer, iCount);
-#endif
-}
-#ifdef __cplusplus
-}
-#endif
+// 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
+
+#include "../../include/fxcrt/fx_ext.h"
+#include "extension.h"
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
+#include <wincrypt.h>
+#else
+#include <ctime>
+#endif
+FX_HFILE FX_File_Open(FX_BSTR fileName, FX_DWORD dwMode, IFX_Allocator* pAllocator)
+{
+ IFXCRT_FileAccess* pFA = FXCRT_FileAccess_Create(pAllocator);
+ if (pFA && !pFA->Open(fileName, dwMode)) {
+ pFA->Release(pAllocator);
+ return NULL;
+ }
+ return (FX_HFILE)pFA;
+}
+FX_HFILE FX_File_Open(FX_WSTR fileName, FX_DWORD dwMode, IFX_Allocator* pAllocator)
+{
+ IFXCRT_FileAccess* pFA = FXCRT_FileAccess_Create(pAllocator);
+ if (pFA && !pFA->Open(fileName, dwMode)) {
+ pFA->Release(pAllocator);
+ return NULL;
+ }
+ return (FX_HFILE)pFA;
+}
+void FX_File_Close(FX_HFILE hFile, IFX_Allocator* pAllocator)
+{
+ FXSYS_assert(hFile != NULL);
+ ((IFXCRT_FileAccess*)hFile)->Close();
+ ((IFXCRT_FileAccess*)hFile)->Release(pAllocator);
+}
+FX_FILESIZE FX_File_GetSize(FX_HFILE hFile)
+{
+ FXSYS_assert(hFile != NULL);
+ return ((IFXCRT_FileAccess*)hFile)->GetSize();
+}
+FX_FILESIZE FX_File_GetPosition(FX_HFILE hFile)
+{
+ FXSYS_assert(hFile != NULL);
+ return ((IFXCRT_FileAccess*)hFile)->GetPosition();
+}
+FX_FILESIZE FX_File_SetPosition(FX_HFILE hFile, FX_FILESIZE pos)
+{
+ FXSYS_assert(hFile != NULL);
+ return ((IFXCRT_FileAccess*)hFile)->SetPosition(pos);
+}
+size_t FX_File_Read(FX_HFILE hFile, void* pBuffer, size_t szBuffer)
+{
+ FXSYS_assert(hFile != NULL);
+ return ((IFXCRT_FileAccess*)hFile)->Read(pBuffer, szBuffer);
+}
+size_t FX_File_ReadPos(FX_HFILE hFile, void* pBuffer, size_t szBuffer, FX_FILESIZE pos)
+{
+ FXSYS_assert(hFile != NULL);
+ return ((IFXCRT_FileAccess*)hFile)->ReadPos(pBuffer, szBuffer, pos);
+}
+size_t FX_File_Write(FX_HFILE hFile, const void* pBuffer, size_t szBuffer)
+{
+ FXSYS_assert(hFile != NULL);
+ return ((IFXCRT_FileAccess*)hFile)->Write(pBuffer, szBuffer);
+}
+size_t FX_File_WritePos(FX_HFILE hFile, const void* pBuffer, size_t szBuffer, FX_FILESIZE pos)
+{
+ FXSYS_assert(hFile != NULL);
+ return ((IFXCRT_FileAccess*)hFile)->WritePos(pBuffer, szBuffer, pos);
+}
+FX_BOOL FX_File_Flush(FX_HFILE hFile)
+{
+ FXSYS_assert(hFile != NULL);
+ return ((IFXCRT_FileAccess*)hFile)->Flush();
+}
+FX_BOOL FX_File_Truncate(FX_HFILE hFile, FX_FILESIZE szFile)
+{
+ FXSYS_assert(hFile != NULL);
+ return ((IFXCRT_FileAccess*)hFile)->Truncate(szFile);
+}
+IFX_FileStream* FX_CreateFileStream(FX_LPCSTR filename, FX_DWORD dwModes, IFX_Allocator* pAllocator)
+{
+ IFXCRT_FileAccess* pFA = FXCRT_FileAccess_Create(pAllocator);
+ if (!pFA) {
+ return NULL;
+ }
+ if (!pFA->Open(filename, dwModes)) {
+ pFA->Release(pAllocator);
+ return NULL;
+ }
+ if (pAllocator) {
+ return FX_NewAtAllocator(pAllocator) CFX_CRTFileStream(pFA, pAllocator);
+ } else {
+ return FX_NEW CFX_CRTFileStream(pFA, pAllocator);
+ }
+}
+IFX_FileStream* FX_CreateFileStream(FX_LPCWSTR filename, FX_DWORD dwModes, IFX_Allocator* pAllocator)
+{
+ IFXCRT_FileAccess* pFA = FXCRT_FileAccess_Create(pAllocator);
+ if (!pFA) {
+ return NULL;
+ }
+ if (!pFA->Open(filename, dwModes)) {
+ pFA->Release(pAllocator);
+ return NULL;
+ }
+ if (pAllocator) {
+ return FX_NewAtAllocator(pAllocator) CFX_CRTFileStream(pFA, pAllocator);
+ } else {
+ return FX_NEW CFX_CRTFileStream(pFA, pAllocator);
+ }
+}
+IFX_FileWrite* FX_CreateFileWrite(FX_LPCSTR filename, IFX_Allocator* pAllocator)
+{
+ return FX_CreateFileStream(filename, FX_FILEMODE_Truncate, pAllocator);
+}
+IFX_FileWrite* FX_CreateFileWrite(FX_LPCWSTR filename, IFX_Allocator* pAllocator)
+{
+ return FX_CreateFileStream(filename, FX_FILEMODE_Truncate, pAllocator);
+}
+IFX_FileRead* FX_CreateFileRead(FX_LPCSTR filename, IFX_Allocator* pAllocator)
+{
+ return FX_CreateFileStream(filename, FX_FILEMODE_ReadOnly, pAllocator);
+}
+IFX_FileRead* FX_CreateFileRead(FX_LPCWSTR filename, IFX_Allocator* pAllocator)
+{
+ return FX_CreateFileStream(filename, FX_FILEMODE_ReadOnly, pAllocator);
+}
+IFX_MemoryStream* FX_CreateMemoryStream(FX_LPBYTE pBuffer, size_t dwSize, FX_BOOL bTakeOver, IFX_Allocator* pAllocator)
+{
+ if (pAllocator) {
+ return FX_NewAtAllocator(pAllocator)CFX_MemoryStream(pBuffer, dwSize, bTakeOver, pAllocator);
+ } else {
+ return FX_NEW CFX_MemoryStream(pBuffer, dwSize, bTakeOver, NULL);
+ }
+}
+IFX_MemoryStream* FX_CreateMemoryStream(FX_BOOL bConsecutive, IFX_Allocator* pAllocator)
+{
+ if (pAllocator) {
+ return FX_NewAtAllocator(pAllocator)CFX_MemoryStream(bConsecutive, pAllocator);
+ } else {
+ return FX_NEW CFX_MemoryStream(bConsecutive, NULL);
+ }
+}
+#ifdef __cplusplus
+extern "C" {
+#endif
+FX_FLOAT FXSYS_tan(FX_FLOAT a)
+{
+ return (FX_FLOAT)tan(a);
+}
+FX_FLOAT FXSYS_logb(FX_FLOAT b, FX_FLOAT x)
+{
+ return FXSYS_log(x) / FXSYS_log(b);
+}
+FX_FLOAT FXSYS_strtof(FX_LPCSTR pcsStr, FX_INT32 iLength, FX_INT32 *pUsedLen)
+{
+ FXSYS_assert(pcsStr != NULL);
+ if (iLength < 0) {
+ iLength = (FX_INT32)FXSYS_strlen(pcsStr);
+ }
+ CFX_WideString ws = CFX_WideString::FromLocal(pcsStr, iLength);
+ return FXSYS_wcstof((FX_LPCWSTR)ws, iLength, pUsedLen);
+}
+FX_FLOAT FXSYS_wcstof(FX_LPCWSTR pwsStr, FX_INT32 iLength, FX_INT32 *pUsedLen)
+{
+ FXSYS_assert(pwsStr != NULL);
+ if (iLength < 0) {
+ iLength = (FX_INT32)FXSYS_wcslen(pwsStr);
+ }
+ if (iLength == 0) {
+ return 0.0f;
+ }
+ FX_INT32 iUsedLen = 0;
+ FX_BOOL bNegtive = FALSE;
+ switch (pwsStr[iUsedLen]) {
+ case '-':
+ bNegtive = TRUE;
+ case '+':
+ iUsedLen++;
+ break;
+ }
+ FX_FLOAT fValue = 0.0f;
+ while (iUsedLen < iLength) {
+ FX_WCHAR wch = pwsStr[iUsedLen];
+ if (wch >= L'0' && wch <= L'9') {
+ fValue = fValue * 10.0f + (wch - L'0');
+ } else {
+ break;
+ }
+ iUsedLen++;
+ }
+ if (iUsedLen < iLength && pwsStr[iUsedLen] == L'.') {
+ FX_FLOAT fPrecise = 0.1f;
+ while (++iUsedLen < iLength) {
+ FX_WCHAR wch = pwsStr[iUsedLen];
+ if (wch >= L'0' && wch <= L'9') {
+ fValue += (wch - L'0') * fPrecise;
+ fPrecise *= 0.1f;
+ } else {
+ break;
+ }
+ }
+ }
+ if (pUsedLen) {
+ *pUsedLen = iUsedLen;
+ }
+ return bNegtive ? -fValue : fValue;
+}
+FX_LPWSTR FXSYS_wcsncpy(FX_LPWSTR dstStr, FX_LPCWSTR srcStr, size_t count)
+{
+ FXSYS_assert(dstStr != NULL && srcStr != NULL && count > 0);
+ for (size_t i = 0; i < count; ++i)
+ if ((dstStr[i] = srcStr[i]) == L'\0') {
+ break;
+ }
+ return dstStr;
+}
+FX_INT32 FXSYS_wcsnicmp(FX_LPCWSTR s1, FX_LPCWSTR s2, size_t count)
+{
+ FXSYS_assert(s1 != NULL && s2 != NULL && count > 0);
+ FX_WCHAR wch1 = 0, wch2 = 0;
+ while (count-- > 0) {
+ wch1 = (FX_WCHAR)FXSYS_tolower(*s1++);
+ wch2 = (FX_WCHAR)FXSYS_tolower(*s2++);
+ if (wch1 != wch2) {
+ break;
+ }
+ }
+ return wch1 - wch2;
+}
+FX_INT32 FXSYS_strnicmp(FX_LPCSTR s1, FX_LPCSTR s2, size_t count)
+{
+ FXSYS_assert(s1 != NULL && s2 != NULL && count > 0);
+ FX_CHAR ch1 = 0, ch2 = 0;
+ while (count-- > 0) {
+ ch1 = (FX_CHAR)FXSYS_tolower(*s1++);
+ ch2 = (FX_CHAR)FXSYS_tolower(*s2++);
+ if (ch1 != ch2) {
+ break;
+ }
+ }
+ return ch1 - ch2;
+}
+FX_DWORD FX_HashCode_String_GetA(FX_LPCSTR pStr, FX_INT32 iLength, FX_BOOL bIgnoreCase)
+{
+ FXSYS_assert(pStr != NULL);
+ if (iLength < 0) {
+ iLength = (FX_INT32)FXSYS_strlen(pStr);
+ }
+ FX_LPCSTR pStrEnd = pStr + iLength;
+ FX_DWORD dwHashCode = 0;
+ if (bIgnoreCase) {
+ while (pStr < pStrEnd) {
+ dwHashCode = 31 * dwHashCode + FXSYS_tolower(*pStr++);
+ }
+ } else {
+ while (pStr < pStrEnd) {
+ dwHashCode = 31 * dwHashCode + *pStr ++;
+ }
+ }
+ return dwHashCode;
+}
+FX_DWORD FX_HashCode_String_GetW(FX_LPCWSTR pStr, FX_INT32 iLength, FX_BOOL bIgnoreCase)
+{
+ FXSYS_assert(pStr != NULL);
+ if (iLength < 0) {
+ iLength = (FX_INT32)FXSYS_wcslen(pStr);
+ }
+ FX_LPCWSTR pStrEnd = pStr + iLength;
+ FX_DWORD dwHashCode = 0;
+ if (bIgnoreCase) {
+ while (pStr < pStrEnd) {
+ dwHashCode = 1313 * dwHashCode + FXSYS_tolower(*pStr++);
+ }
+ } else {
+ while (pStr < pStrEnd) {
+ dwHashCode = 1313 * dwHashCode + *pStr ++;
+ }
+ }
+ return dwHashCode;
+}
+#ifdef __cplusplus
+}
+#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+FX_LPVOID FX_Random_MT_Start(FX_DWORD dwSeed)
+{
+ FX_LPMTRANDOMCONTEXT pContext = FX_Alloc(FX_MTRANDOMCONTEXT, 1);
+ if (!pContext) {
+ return NULL;
+ }
+ pContext->mt[0] = dwSeed;
+ FX_DWORD &i = pContext->mti;
+ FX_LPDWORD pBuf = pContext->mt;
+ for (i = 1; i < MT_N; i ++) {
+ pBuf[i] = (1812433253UL * (pBuf[i - 1] ^ (pBuf[i - 1] >> 30)) + i);
+ }
+ pContext->bHaveSeed = TRUE;
+ return pContext;
+}
+FX_DWORD FX_Random_MT_Generate(FX_LPVOID pContext)
+{
+ FXSYS_assert(pContext != NULL);
+ FX_LPMTRANDOMCONTEXT pMTC = (FX_LPMTRANDOMCONTEXT)pContext;
+ FX_DWORD v;
+ static FX_DWORD mag[2] = {0, MT_Matrix_A};
+ FX_DWORD &mti = pMTC->mti;
+ FX_LPDWORD pBuf = pMTC->mt;
+ if ((int)mti < 0 || mti >= MT_N) {
+ if (mti > MT_N && !pMTC->bHaveSeed) {
+ return 0;
+ }
+ FX_DWORD kk;
+ for (kk = 0; kk < MT_N - MT_M; kk ++) {
+ v = (pBuf[kk] & MT_Upper_Mask) | (pBuf[kk + 1] & MT_Lower_Mask);
+ pBuf[kk] = pBuf[kk + MT_M] ^ (v >> 1) ^ mag[v & 1];
+ }
+ for (; kk < MT_N - 1; kk ++) {
+ v = (pBuf[kk] & MT_Upper_Mask) | (pBuf[kk + 1] & MT_Lower_Mask);
+ pBuf[kk] = pBuf[kk + (MT_M - MT_N)] ^ (v >> 1) ^ mag[v & 1];
+ }
+ v = (pBuf[MT_N - 1] & MT_Upper_Mask) | (pBuf[0] & MT_Lower_Mask);
+ pBuf[MT_N - 1] = pBuf[MT_M - 1] ^ (v >> 1) ^ mag[v & 1];
+ mti = 0;
+ }
+ v = pBuf[mti ++];
+ v ^= (v >> 11);
+ v ^= (v << 7) & 0x9d2c5680UL;
+ v ^= (v << 15) & 0xefc60000UL;
+ v ^= (v >> 18);
+ return v;
+}
+void FX_Random_MT_Close(FX_LPVOID pContext)
+{
+ FXSYS_assert(pContext != NULL);
+ FX_Free(pContext);
+}
+void FX_Random_GenerateMT(FX_LPDWORD pBuffer, FX_INT32 iCount)
+{
+ FX_DWORD dwSeed;
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
+ if (!FX_GenerateCryptoRandom(&dwSeed, 1)) {
+ FX_Random_GenerateBase(&dwSeed, 1);
+ }
+#else
+ FX_Random_GenerateBase(&dwSeed, 1);
+#endif
+ FX_LPVOID pContext = FX_Random_MT_Start(dwSeed);
+ while (iCount -- > 0) {
+ *pBuffer ++ = FX_Random_MT_Generate(pContext);
+ }
+ FX_Random_MT_Close(pContext);
+}
+void FX_Random_GenerateBase(FX_LPDWORD pBuffer, FX_INT32 iCount)
+{
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
+ SYSTEMTIME st1, st2;
+ ::GetSystemTime(&st1);
+ do {
+ ::GetSystemTime(&st2);
+ } while (FXSYS_memcmp32(&st1, &st2, sizeof(SYSTEMTIME)) == 0);
+ FX_DWORD dwHash1 = FX_HashCode_String_GetA((FX_LPCSTR)&st1, sizeof(st1), TRUE);
+ FX_DWORD dwHash2 = FX_HashCode_String_GetA((FX_LPCSTR)&st2, sizeof(st2), TRUE);
+ ::srand((dwHash1 << 16) | (FX_DWORD)dwHash2);
+#else
+ time_t tmLast = time(NULL), tmCur;
+ while ((tmCur = time(NULL)) == tmLast);
+ ::srand((tmCur << 16) | (tmLast & 0xFFFF));
+#endif
+ while (iCount -- > 0) {
+ *pBuffer ++ = (FX_DWORD)((::rand() << 16) | (::rand() & 0xFFFF));
+ }
+}
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
+FX_BOOL FX_GenerateCryptoRandom(FX_LPDWORD pBuffer, FX_INT32 iCount)
+{
+ HCRYPTPROV hCP = NULL;
+ if (!::CryptAcquireContext(&hCP, NULL, NULL, PROV_RSA_FULL, 0) || hCP == NULL) {
+ return FALSE;
+ }
+ ::CryptGenRandom(hCP, iCount * sizeof(FX_DWORD), (FX_LPBYTE)pBuffer);
+ ::CryptReleaseContext(hCP, 0);
+ return TRUE;
+}
+#endif
+void FX_Random_GenerateCrypto(FX_LPDWORD pBuffer, FX_INT32 iCount)
+{
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
+ FX_GenerateCryptoRandom(pBuffer, iCount);
+#else
+ FX_Random_GenerateBase(pBuffer, iCount);
+#endif
+}
+#ifdef __cplusplus
+}
+#endif
diff --git a/core/src/fxcrt/fx_xml_composer.cpp b/core/src/fxcrt/fx_xml_composer.cpp
index d68dd1ff27..1fce9009db 100644
--- a/core/src/fxcrt/fx_xml_composer.cpp
+++ b/core/src/fxcrt/fx_xml_composer.cpp
@@ -1,42 +1,42 @@
-// 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
-
-#include "../../include/fxcrt/fx_xml.h"
-#include "xml_int.h"
-void FX_XML_SplitQualifiedName(FX_BSTR bsFullName, CFX_ByteStringC &bsSpace, CFX_ByteStringC &bsName)
-{
- if (bsFullName.IsEmpty()) {
- return;
- }
- FX_INT32 iStart = 0;
- for (; iStart < bsFullName.GetLength(); iStart ++) {
- if (bsFullName.GetAt(iStart) == ':') {
- break;
- }
- }
- if (iStart >= bsFullName.GetLength()) {
- bsName = bsFullName;
- } else {
- bsSpace = CFX_ByteStringC(bsFullName.GetCStr(), iStart);
- iStart ++;
- bsName = CFX_ByteStringC(bsFullName.GetCStr() + iStart, bsFullName.GetLength() - iStart);
- }
-}
-void CXML_Element::SetTag(FX_BSTR qSpace, FX_BSTR tagname)
-{
- IFX_Allocator* pAllocator = m_Children.m_pAllocator;
- m_QSpaceName.Set(qSpace, pAllocator);
- m_TagName.Set(tagname, pAllocator);
-}
-void CXML_Element::SetTag(FX_BSTR qTagName)
-{
- ASSERT(!qTagName.IsEmpty());
- IFX_Allocator* pAllocator = m_Children.m_pAllocator;
- CFX_ByteStringC bsSpace, bsName;
- FX_XML_SplitQualifiedName(qTagName, bsSpace, bsName);
- m_QSpaceName.Set(bsSpace, pAllocator);
- m_TagName.Set(bsName, pAllocator);
-}
+// 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
+
+#include "../../include/fxcrt/fx_xml.h"
+#include "xml_int.h"
+void FX_XML_SplitQualifiedName(FX_BSTR bsFullName, CFX_ByteStringC &bsSpace, CFX_ByteStringC &bsName)
+{
+ if (bsFullName.IsEmpty()) {
+ return;
+ }
+ FX_INT32 iStart = 0;
+ for (; iStart < bsFullName.GetLength(); iStart ++) {
+ if (bsFullName.GetAt(iStart) == ':') {
+ break;
+ }
+ }
+ if (iStart >= bsFullName.GetLength()) {
+ bsName = bsFullName;
+ } else {
+ bsSpace = CFX_ByteStringC(bsFullName.GetCStr(), iStart);
+ iStart ++;
+ bsName = CFX_ByteStringC(bsFullName.GetCStr() + iStart, bsFullName.GetLength() - iStart);
+ }
+}
+void CXML_Element::SetTag(FX_BSTR qSpace, FX_BSTR tagname)
+{
+ IFX_Allocator* pAllocator = m_Children.m_pAllocator;
+ m_QSpaceName.Set(qSpace, pAllocator);
+ m_TagName.Set(tagname, pAllocator);
+}
+void CXML_Element::SetTag(FX_BSTR qTagName)
+{
+ ASSERT(!qTagName.IsEmpty());
+ IFX_Allocator* pAllocator = m_Children.m_pAllocator;
+ CFX_ByteStringC bsSpace, bsName;
+ FX_XML_SplitQualifiedName(qTagName, bsSpace, bsName);
+ m_QSpaceName.Set(bsSpace, pAllocator);
+ m_TagName.Set(bsName, pAllocator);
+}
diff --git a/core/src/fxcrt/fx_xml_parser.cpp b/core/src/fxcrt/fx_xml_parser.cpp
index 85e9544342..c3d4b9c506 100644
--- a/core/src/fxcrt/fx_xml_parser.cpp
+++ b/core/src/fxcrt/fx_xml_parser.cpp
@@ -1,1017 +1,1017 @@
-// 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
-
-#include "../../include/fxcrt/fx_xml.h"
-#include "xml_int.h"
-CXML_Parser::~CXML_Parser()
-{
- if (m_bOwnedStream) {
- m_pDataAcc->Release();
- }
-}
-FX_BOOL CXML_Parser::Init(FX_LPBYTE pBuffer, size_t size)
-{
- if (m_pAllocator) {
- m_pDataAcc = FX_NewAtAllocator(m_pAllocator)CXML_DataBufAcc(pBuffer, size, m_pAllocator);
- } else {
- m_pDataAcc = FX_NEW CXML_DataBufAcc(pBuffer, size, NULL);
- }
- if (!m_pDataAcc) {
- return FALSE;
- }
- return Init(TRUE);
-}
-FX_BOOL CXML_Parser::Init(IFX_FileRead *pFileRead)
-{
- if (m_pAllocator) {
- m_pDataAcc = FX_NewAtAllocator(m_pAllocator)CXML_DataStmAcc(pFileRead, m_pAllocator);
- } else {
- m_pDataAcc = FX_NEW CXML_DataStmAcc(pFileRead, NULL);
- }
- if (!m_pDataAcc) {
- return FALSE;
- }
- return Init(TRUE);
-}
-FX_BOOL CXML_Parser::Init(IFX_BufferRead *pBuffer)
-{
- if (!pBuffer) {
- return FALSE;
- }
- m_pDataAcc = pBuffer;
- return Init(FALSE);
-}
-FX_BOOL CXML_Parser::Init(FX_BOOL bOwndedStream)
-{
- m_bOwnedStream = bOwndedStream;
- m_nOffset = 0;
- return ReadNextBlock();
-}
-FX_BOOL CXML_Parser::ReadNextBlock()
-{
- if (!m_pDataAcc->ReadNextBlock()) {
- return FALSE;
- }
- m_pBuffer = m_pDataAcc->GetBlockBuffer();
- m_dwBufferSize = m_pDataAcc->GetBlockSize();
- m_nBufferOffset = m_pDataAcc->GetBlockOffset();
- m_dwIndex = 0;
- return m_dwBufferSize > 0;
-}
-FX_BOOL CXML_Parser::IsEOF()
-{
- if (!m_pDataAcc->IsEOF()) {
- return FALSE;
- }
- return m_dwIndex >= m_dwBufferSize;
-}
-#define FXCRTM_XML_CHARTYPE_Normal 0x00
-#define FXCRTM_XML_CHARTYPE_SpaceChar 0x01
-#define FXCRTM_XML_CHARTYPE_Letter 0x02
-#define FXCRTM_XML_CHARTYPE_Digital 0x04
-#define FXCRTM_XML_CHARTYPE_NameIntro 0x08
-#define FXCRTM_XML_CHARTYPE_NameChar 0x10
-#define FXCRTM_XML_CHARTYPE_HexDigital 0x20
-#define FXCRTM_XML_CHARTYPE_HexLowerLetter 0x40
-#define FXCRTM_XML_CHARTYPE_HexUpperLetter 0x60
-#define FXCRTM_XML_CHARTYPE_HexChar 0x60
-FX_BYTE g_FXCRT_XML_ByteTypes[256] = {
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x00,
- 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x7A, 0x7A, 0x7A, 0x7A, 0x7A, 0x7A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A,
- 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x00, 0x00, 0x00, 0x00, 0x18,
- 0x00, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A,
- 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A,
- 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A,
- 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A,
- 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A,
- 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A,
- 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A,
- 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A,
- 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x01, 0x01,
-};
-FX_BOOL g_FXCRT_XML_IsWhiteSpace(FX_BYTE ch)
-{
- return (g_FXCRT_XML_ByteTypes[ch] & FXCRTM_XML_CHARTYPE_SpaceChar) != 0;
-}
-FX_BOOL g_FXCRT_XML_IsLetter(FX_BYTE ch)
-{
- return (g_FXCRT_XML_ByteTypes[ch] & FXCRTM_XML_CHARTYPE_Letter) != 0;
-}
-FX_BOOL g_FXCRT_XML_IsDigital(FX_BYTE ch)
-{
- return (g_FXCRT_XML_ByteTypes[ch] & FXCRTM_XML_CHARTYPE_Digital) != 0;
-}
-FX_BOOL g_FXCRT_XML_IsNameIntro(FX_BYTE ch)
-{
- return (g_FXCRT_XML_ByteTypes[ch] & FXCRTM_XML_CHARTYPE_NameIntro) != 0;
-}
-FX_BOOL g_FXCRT_XML_IsNameChar(FX_BYTE ch)
-{
- return (g_FXCRT_XML_ByteTypes[ch] & FXCRTM_XML_CHARTYPE_NameChar) != 0;
-}
-FX_BOOL g_FXCRT_XML_IsHexChar(FX_BYTE ch)
-{
- return (g_FXCRT_XML_ByteTypes[ch] & FXCRTM_XML_CHARTYPE_HexChar) != 0;
-}
-void CXML_Parser::SkipWhiteSpaces()
-{
- m_nOffset = m_nBufferOffset + (FX_FILESIZE)m_dwIndex;
- if (IsEOF()) {
- return;
- }
- do {
- while (m_dwIndex < m_dwBufferSize && g_FXCRT_XML_IsWhiteSpace(m_pBuffer[m_dwIndex])) {
- m_dwIndex ++;
- }
- m_nOffset = m_nBufferOffset + (FX_FILESIZE)m_dwIndex;
- if (m_dwIndex < m_dwBufferSize || IsEOF()) {
- break;
- }
- } while (ReadNextBlock());
-}
-void CXML_Parser::GetName(CFX_ByteStringL &space, CFX_ByteStringL &name)
-{
- m_nOffset = m_nBufferOffset + (FX_FILESIZE)m_dwIndex;
- if (IsEOF()) {
- return;
- }
- CFX_ByteTextBuf buf(m_pAllocator);
- FX_BYTE ch;
- do {
- while (m_dwIndex < m_dwBufferSize) {
- ch = m_pBuffer[m_dwIndex];
- if (ch == ':') {
- buf.GetByteStringL(space);
- buf.Clear();
- } else if (g_FXCRT_XML_IsNameChar(ch)) {
- buf.AppendChar(ch);
- } else {
- break;
- }
- m_dwIndex ++;
- }
- m_nOffset = m_nBufferOffset + (FX_FILESIZE)m_dwIndex;
- if (m_dwIndex < m_dwBufferSize || IsEOF()) {
- break;
- }
- } while (ReadNextBlock());
- buf.GetByteStringL(name);
-}
-void CXML_Parser::SkipLiterals(FX_BSTR str)
-{
- m_nOffset = m_nBufferOffset + (FX_FILESIZE)m_dwIndex;
- if (IsEOF()) {
- return;
- }
- FX_INT32 i = 0, iLen = str.GetLength();
- do {
- while (m_dwIndex < m_dwBufferSize) {
- if (str.GetAt(i) != m_pBuffer[m_dwIndex ++]) {
- i = 0;
- } else {
- i ++;
- if (i == iLen) {
- break;
- }
- }
- }
- m_nOffset = m_nBufferOffset + (FX_FILESIZE)m_dwIndex;
- if (i == iLen) {
- return;
- }
- if (m_dwIndex < m_dwBufferSize || IsEOF()) {
- break;
- }
- } while (ReadNextBlock());
- while (!m_pDataAcc->IsEOF()) {
- ReadNextBlock();
- m_nOffset = m_nBufferOffset + (FX_FILESIZE)m_dwBufferSize;
- }
- m_dwIndex = m_dwBufferSize;
-}
-FX_DWORD CXML_Parser::GetCharRef()
-{
- m_nOffset = m_nBufferOffset + (FX_FILESIZE)m_dwIndex;
- if (IsEOF()) {
- return 0;
- }
- FX_BYTE ch;
- FX_INT32 iState = 0;
- CFX_ByteTextBuf buf(m_pAllocator);
- FX_DWORD code = 0;
- do {
- while (m_dwIndex < m_dwBufferSize) {
- ch = m_pBuffer[m_dwIndex];
- switch (iState) {
- case 0:
- if (ch == '#') {
- m_dwIndex ++;
- iState = 2;
- break;
- }
- iState = 1;
- case 1:
- m_dwIndex ++;
- if (ch == ';') {
- CFX_ByteStringC ref = buf.GetByteString();
- if (ref == FX_BSTRC("gt")) {
- code = '>';
- } else if (ref == FX_BSTRC("lt")) {
- code = '<';
- } else if (ref == FX_BSTRC("amp")) {
- code = '&';
- } else if (ref == FX_BSTRC("apos")) {
- code = '\'';
- } else if (ref == FX_BSTRC("quot")) {
- code = '"';
- }
- iState = 10;
- break;
- }
- buf.AppendByte(ch);
- break;
- case 2:
- if (ch == 'x') {
- m_dwIndex ++;
- iState = 4;
- break;
- }
- iState = 3;
- case 3:
- m_dwIndex ++;
- if (ch == ';') {
- iState = 10;
- break;
- }
- if (g_FXCRT_XML_IsDigital(ch)) {
- code = code * 10 + ch - '0';
- }
- break;
- case 4:
- m_dwIndex ++;
- if (ch == ';') {
- iState = 10;
- break;
- }
- FX_BYTE nHex = g_FXCRT_XML_ByteTypes[ch] & FXCRTM_XML_CHARTYPE_HexChar;
- if (nHex) {
- if (nHex == FXCRTM_XML_CHARTYPE_HexDigital) {
- code = (code << 4) + ch - '0';
- } else if (nHex == FXCRTM_XML_CHARTYPE_HexLowerLetter) {
- code = (code << 4) + ch - 87;
- } else {
- code = (code << 4) + ch - 55;
- }
- }
- break;
- }
- if (iState == 10) {
- break;
- }
- }
- m_nOffset = m_nBufferOffset + (FX_FILESIZE)m_dwIndex;
- if (iState == 10 || m_dwIndex < m_dwBufferSize || IsEOF()) {
- break;
- }
- } while (ReadNextBlock());
- return code;
-}
-void CXML_Parser::GetAttrValue(CFX_WideStringL &value)
-{
- m_nOffset = m_nBufferOffset + (FX_FILESIZE)m_dwIndex;
- if (IsEOF()) {
- return;
- }
- CFX_UTF8Decoder decoder(m_pAllocator);
- FX_BYTE mark = 0, ch;
- do {
- while (m_dwIndex < m_dwBufferSize) {
- ch = m_pBuffer[m_dwIndex];
- if (mark == 0) {
- if (ch != '\'' && ch != '"') {
- return;
- }
- mark = ch;
- m_dwIndex ++;
- ch = 0;
- continue;
- }
- m_dwIndex ++;
- if (ch == mark) {
- break;
- }
- if (ch == '&') {
- decoder.AppendChar(GetCharRef());
- if (IsEOF()) {
- decoder.GetResult(value);
- return;
- }
- } else {
- decoder.Input(ch);
- }
- }
- m_nOffset = m_nBufferOffset + (FX_FILESIZE)m_dwIndex;
- if (ch == mark || m_dwIndex < m_dwBufferSize || IsEOF()) {
- break;
- }
- } while (ReadNextBlock());
- decoder.GetResult(value);
-}
-void CXML_Parser::GetTagName(CFX_ByteStringL &space, CFX_ByteStringL &name, FX_BOOL &bEndTag, FX_BOOL bStartTag)
-{
- m_nOffset = m_nBufferOffset + (FX_FILESIZE)m_dwIndex;
- if (IsEOF()) {
- return;
- }
- bEndTag = FALSE;
- FX_BYTE ch;
- FX_INT32 iState = bStartTag ? 1 : 0;
- do {
- while (m_dwIndex < m_dwBufferSize) {
- ch = m_pBuffer[m_dwIndex];
- switch (iState) {
- case 0:
- m_dwIndex ++;
- if (ch != '<') {
- break;
- }
- iState = 1;
- break;
- case 1:
- if (ch == '?') {
- m_dwIndex ++;
- SkipLiterals(FX_BSTRC("?>"));
- iState = 0;
- break;
- } else if (ch == '!') {
- m_dwIndex ++;
- SkipLiterals(FX_BSTRC("-->"));
- iState = 0;
- break;
- }
- if (ch == '/') {
- m_dwIndex ++;
- GetName(space, name);
- bEndTag = TRUE;
- } else {
- GetName(space, name);
- bEndTag = FALSE;
- }
- return;
- }
- }
- m_nOffset = m_nBufferOffset + (FX_FILESIZE)m_dwIndex;
- if (m_dwIndex < m_dwBufferSize || IsEOF()) {
- break;
- }
- } while (ReadNextBlock());
-}
-CXML_Element* CXML_Parser::ParseElement(CXML_Element* pParent, FX_BOOL bStartTag)
-{
- m_nOffset = m_nBufferOffset + (FX_FILESIZE)m_dwIndex;
- if (IsEOF()) {
- return NULL;
- }
- CFX_ByteStringL tag_name, tag_space;
- FX_BOOL bEndTag;
- GetTagName(tag_space, tag_name, bEndTag, bStartTag);
- if (tag_name.IsEmpty() || bEndTag) {
- tag_space.Empty(m_pAllocator);
- return NULL;
- }
- CXML_Element* pElement;
- if (m_pAllocator) {
- pElement = FX_NewAtAllocator(m_pAllocator)CXML_Element(m_pAllocator);
- } else {
- pElement = FX_NEW CXML_Element;
- }
- if (pElement) {
- pElement->m_pParent = pParent;
- pElement->SetTag(tag_space, tag_name);
- }
- tag_space.Empty(m_pAllocator);
- tag_name.Empty(m_pAllocator);
- if (!pElement) {
- return NULL;
- }
- do {
- CFX_ByteStringL attr_space, attr_name;
- while (m_dwIndex < m_dwBufferSize) {
- SkipWhiteSpaces();
- if (IsEOF()) {
- break;
- }
- if (!g_FXCRT_XML_IsNameIntro(m_pBuffer[m_dwIndex])) {
- break;
- }
- attr_space.Empty(m_pAllocator);
- attr_name.Empty(m_pAllocator);
- GetName(attr_space, attr_name);
- SkipWhiteSpaces();
- if (IsEOF()) {
- break;
- }
- if (m_pBuffer[m_dwIndex] != '=') {
- break;
- }
- m_dwIndex ++;
- SkipWhiteSpaces();
- if (IsEOF()) {
- break;
- }
- CFX_WideStringL attr_value;
- GetAttrValue(attr_value);
- pElement->m_AttrMap.SetAt(attr_space, attr_name, attr_value, m_pAllocator);
- attr_value.Empty(m_pAllocator);
- }
- attr_space.Empty(m_pAllocator);
- attr_name.Empty(m_pAllocator);
- m_nOffset = m_nBufferOffset + (FX_FILESIZE)m_dwIndex;
- if (m_dwIndex < m_dwBufferSize || IsEOF()) {
- break;
- }
- } while (ReadNextBlock());
- SkipWhiteSpaces();
- if (IsEOF()) {
- return pElement;
- }
- FX_BYTE ch = m_pBuffer[m_dwIndex ++];
- if (ch == '/') {
- m_dwIndex ++;
- m_nOffset = m_nBufferOffset + (FX_FILESIZE)m_dwIndex;
- return pElement;
- }
- if (ch != '>') {
- m_nOffset = m_nBufferOffset + (FX_FILESIZE)m_dwIndex;
- if (m_pAllocator) {
- FX_DeleteAtAllocator(pElement, m_pAllocator, CXML_Element);
- } else {
- delete pElement;
- }
- return NULL;
- }
- SkipWhiteSpaces();
- if (IsEOF()) {
- return pElement;
- }
- CFX_UTF8Decoder decoder(m_pAllocator);
- CFX_WideTextBuf content(m_pAllocator);
- FX_BOOL bCDATA = FALSE;
- FX_INT32 iState = 0;
- do {
- while (m_dwIndex < m_dwBufferSize) {
- ch = m_pBuffer[m_dwIndex ++];
- switch (iState) {
- case 0:
- if (ch == '<') {
- iState = 1;
- } else if (ch == '&') {
- decoder.ClearStatus();
- decoder.AppendChar(GetCharRef());
- } else {
- decoder.Input(ch);
- }
- break;
- case 1:
- if (ch == '!') {
- iState = 2;
- } else if (ch == '?') {
- SkipLiterals(FX_BSTRC("?>"));
- SkipWhiteSpaces();
- iState = 0;
- } else if (ch == '/') {
- CFX_ByteStringL space, name;
- GetName(space, name);
- space.Empty(m_pAllocator);
- name.Empty(m_pAllocator);
- SkipWhiteSpaces();
- m_dwIndex ++;
- iState = 10;
- } else {
- content << decoder.GetResult();
- CFX_WideStringL dataStr;
- content.GetWideStringL(dataStr);
- if (!bCDATA && !m_bSaveSpaceChars) {
- dataStr.TrimRight((FX_LPCWSTR)L" \t\r\n");
- }
- InsertContentSegment(bCDATA, dataStr, pElement);
- dataStr.Empty(m_pAllocator);
- content.Clear();
- decoder.Clear();
- bCDATA = FALSE;
- iState = 0;
- m_dwIndex --;
- CXML_Element* pSubElement = ParseElement(pElement, TRUE);
- if (pSubElement == NULL) {
- break;
- }
- pSubElement->m_pParent = pElement;
- pElement->m_Children.Add((FX_LPVOID)CXML_Element::Element);
- pElement->m_Children.Add(pSubElement);
- SkipWhiteSpaces();
- }
- break;
- case 2:
- if (ch == '[') {
- SkipLiterals(FX_BSTRC("]]>"));
- } else if (ch == '-') {
- m_dwIndex ++;
- SkipLiterals(FX_BSTRC("-->"));
- } else {
- SkipLiterals(FX_BSTRC(">"));
- }
- decoder.Clear();
- SkipWhiteSpaces();
- iState = 0;
- break;
- }
- if (iState == 10) {
- break;
- }
- }
- m_nOffset = m_nBufferOffset + (FX_FILESIZE)m_dwIndex;
- if (iState == 10 || m_dwIndex < m_dwBufferSize || IsEOF()) {
- break;
- }
- } while (ReadNextBlock());
- content << decoder.GetResult();
- CFX_WideStringL dataStr;
- content.GetWideStringL(dataStr);
- if (!m_bSaveSpaceChars) {
- dataStr.TrimRight((FX_LPCWSTR)L" \t\r\n");
- }
- InsertContentSegment(bCDATA, dataStr, pElement);
- dataStr.Empty(m_pAllocator);
- content.Clear();
- decoder.Clear();
- bCDATA = FALSE;
- return pElement;
-}
-void CXML_Parser::InsertContentSegment(FX_BOOL bCDATA, FX_WSTR content, CXML_Element* pElement)
-{
- if (content.IsEmpty()) {
- return;
- }
- CXML_Content* pContent;
- if (m_pAllocator) {
- pContent = FX_NewAtAllocator(m_pAllocator)CXML_Content;
- } else {
- pContent = FX_NEW CXML_Content;
- }
- if (!pContent) {
- return;
- }
- pContent->Set(bCDATA, content, m_pAllocator);
- pElement->m_Children.Add((FX_LPVOID)CXML_Element::Content);
- pElement->m_Children.Add(pContent);
-}
-static CXML_Element* XML_ContinueParse(CXML_Parser &parser, FX_BOOL bSaveSpaceChars, FX_FILESIZE* pParsedSize)
-{
- parser.m_bSaveSpaceChars = bSaveSpaceChars;
- CXML_Element* pElement = parser.ParseElement(NULL, FALSE);
- if (pParsedSize) {
- *pParsedSize = parser.m_nOffset;
- }
- return pElement;
-}
-CXML_Element* CXML_Element::Parse(const void* pBuffer, size_t size, FX_BOOL bSaveSpaceChars, FX_FILESIZE* pParsedSize, IFX_Allocator* pAllocator)
-{
- CXML_Parser parser(pAllocator);
- if (!parser.Init((FX_LPBYTE)pBuffer, size)) {
- return NULL;
- }
- return XML_ContinueParse(parser, bSaveSpaceChars, pParsedSize);
-}
-CXML_Element* CXML_Element::Parse(IFX_FileRead *pFile, FX_BOOL bSaveSpaceChars, FX_FILESIZE* pParsedSize, IFX_Allocator* pAllocator)
-{
- CXML_Parser parser(pAllocator);
- if (!parser.Init(pFile)) {
- return NULL;
- }
- return XML_ContinueParse(parser, bSaveSpaceChars, pParsedSize);
-}
-CXML_Element* CXML_Element::Parse(IFX_BufferRead *pBuffer, FX_BOOL bSaveSpaceChars, FX_FILESIZE* pParsedSize, IFX_Allocator* pAllocator)
-{
- CXML_Parser parser(pAllocator);
- if (!parser.Init(pBuffer)) {
- return NULL;
- }
- return XML_ContinueParse(parser, bSaveSpaceChars, pParsedSize);
-}
-CXML_Element::CXML_Element(IFX_Allocator* pAllocator)
- : m_pParent(NULL)
- , m_QSpaceName()
- , m_TagName()
- , m_AttrMap()
- , m_Children(pAllocator)
-{
-}
-CXML_Element::CXML_Element(FX_BSTR qSpace, FX_BSTR tagName, IFX_Allocator* pAllocator)
- : m_pParent(NULL)
- , m_QSpaceName()
- , m_TagName()
- , m_AttrMap()
- , m_Children(pAllocator)
-{
- m_QSpaceName.Set(qSpace, pAllocator);
- m_TagName.Set(tagName, pAllocator);
-}
-CXML_Element::CXML_Element(FX_BSTR qTagName, IFX_Allocator* pAllocator)
- : m_pParent(NULL)
- , m_QSpaceName()
- , m_TagName()
- , m_AttrMap()
- , m_Children(pAllocator)
-{
- SetTag(qTagName);
-}
-CXML_Element::~CXML_Element()
-{
- Empty();
-}
-void CXML_Element::Empty()
-{
- IFX_Allocator* pAllocator = m_Children.m_pAllocator;
- m_QSpaceName.Empty(pAllocator);
- m_TagName.Empty(pAllocator);
- m_AttrMap.RemoveAll(pAllocator);
- RemoveChildren();
-}
-void CXML_Element::RemoveChildren()
-{
- IFX_Allocator* pAllocator = m_Children.m_pAllocator;
- for (int i = 0; i < m_Children.GetSize(); i += 2) {
- ChildType type = (ChildType)(FX_UINTPTR)m_Children.GetAt(i);
- if (type == Content) {
- CXML_Content* content = (CXML_Content*)m_Children.GetAt(i + 1);
- if (pAllocator) {
- FX_DeleteAtAllocator(content, pAllocator, CXML_Content);
- } else {
- delete content;
- }
- } else if (type == Element) {
- CXML_Element* child = (CXML_Element*)m_Children.GetAt(i + 1);
- child->RemoveChildren();
- if (pAllocator) {
- FX_DeleteAtAllocator(child, pAllocator, CXML_Element);
- } else {
- delete child;
- }
- }
- }
- m_Children.RemoveAll();
-}
-CFX_ByteString CXML_Element::GetTagName(FX_BOOL bQualified) const
-{
- if (!bQualified || m_QSpaceName.IsEmpty()) {
- return m_TagName;
- }
- CFX_ByteString bsTag = m_QSpaceName;
- bsTag += ":";
- bsTag += m_TagName;
- return bsTag;
-}
-void CXML_Element::GetTagName(CFX_ByteStringL &tagName, FX_BOOL bQualified) const
-{
- IFX_Allocator* pAllocator = m_Children.m_pAllocator;
- if (!bQualified || m_QSpaceName.IsEmpty()) {
- tagName.Set(m_TagName, pAllocator);
- return;
- }
- FX_LPSTR str = tagName.AllocBuffer(m_QSpaceName.GetLength() + m_TagName.GetLength() + 2, pAllocator);
- if (!str) {
- return;
- }
- FXSYS_memcpy32(str, m_QSpaceName.GetCStr(), m_QSpaceName.GetLength());
- str += m_QSpaceName.GetLength();
- *str = ':';
- str ++;
- FXSYS_memcpy32(str, m_TagName.GetCStr(), m_TagName.GetLength());
- str += m_TagName.GetLength();
- *str = '\0';
-}
-CFX_ByteString CXML_Element::GetNamespace(FX_BOOL bQualified) const
-{
- if (bQualified) {
- return m_QSpaceName;
- }
- return GetNamespaceURI(m_QSpaceName);
-}
-void CXML_Element::GetNamespace(CFX_ByteStringL &nameSpace, FX_BOOL bQualified) const
-{
- IFX_Allocator* pAllocator = m_Children.m_pAllocator;
- if (bQualified) {
- nameSpace.Set(m_QSpaceName, pAllocator);
- return;
- }
- GetNamespaceURI(m_QSpaceName, nameSpace);
-}
-CFX_ByteString CXML_Element::GetNamespaceURI(FX_BSTR qName) const
-{
- const CFX_WideStringL* pwsSpace;
- const CXML_Element *pElement = this;
- do {
- if (qName.IsEmpty()) {
- pwsSpace = pElement->m_AttrMap.Lookup(FX_BSTRC(""), FX_BSTRC("xmlns"));
- } else {
- pwsSpace = pElement->m_AttrMap.Lookup(FX_BSTRC("xmlns"), qName);
- }
- if (pwsSpace) {
- break;
- }
- pElement = pElement->GetParent();
- } while(pElement);
- return pwsSpace ? FX_UTF8Encode(*pwsSpace) : CFX_ByteString();
-}
-void CXML_Element::GetNamespaceURI(FX_BSTR qName, CFX_ByteStringL &uri) const
-{
- IFX_Allocator* pAllocator = m_Children.m_pAllocator;
- const CFX_WideStringL* pwsSpace;
- const CXML_Element *pElement = this;
- do {
- if (qName.IsEmpty()) {
- pwsSpace = pElement->m_AttrMap.Lookup(FX_BSTRC(""), FX_BSTRC("xmlns"));
- } else {
- pwsSpace = pElement->m_AttrMap.Lookup(FX_BSTRC("xmlns"), qName);
- }
- if (pwsSpace) {
- break;
- }
- pElement = pElement->GetParent();
- } while(pElement);
- if (pwsSpace) {
- FX_UTF8Encode(pwsSpace->GetPtr(), pwsSpace->GetLength(), uri, pAllocator);
- }
-}
-void CXML_Element::GetAttrByIndex(int index, CFX_ByteString& space, CFX_ByteString& name, CFX_WideString& value) const
-{
- if (index < 0 || index >= m_AttrMap.GetSize()) {
- return;
- }
- CXML_AttrItem& item = m_AttrMap.GetAt(index);
- space = item.m_QSpaceName;
- name = item.m_AttrName;
- value = item.m_Value;
-}
-void CXML_Element::GetAttrByIndex(int index, CFX_ByteStringL &space, CFX_ByteStringL &name, CFX_WideStringL &value) const
-{
- if (index < 0 || index >= m_AttrMap.GetSize()) {
- return;
- }
- IFX_Allocator* pAllocator = m_Children.m_pAllocator;
- CXML_AttrItem& item = m_AttrMap.GetAt(index);
- space.Set(item.m_QSpaceName, pAllocator);
- name.Set(item.m_AttrName, pAllocator);
- value.Set(item.m_Value, pAllocator);
-}
-FX_BOOL CXML_Element::HasAttr(FX_BSTR name) const
-{
- CFX_ByteStringC bsSpace, bsName;
- FX_XML_SplitQualifiedName(name, bsSpace, bsName);
- return m_AttrMap.Lookup(bsSpace, bsName) != NULL;
-}
-FX_BOOL CXML_Element::GetAttrValue(FX_BSTR name, CFX_WideString& attribute) const
-{
- CFX_ByteStringC bsSpace, bsName;
- FX_XML_SplitQualifiedName(name, bsSpace, bsName);
- const CFX_WideStringL* pValue = m_AttrMap.Lookup(bsSpace, bsName);
- if (pValue) {
- attribute = CFX_WideString(pValue->GetPtr(), pValue->GetLength());
- return TRUE;
- }
- return FALSE;
-}
-const CFX_WideStringL* CXML_Element::GetAttrValuePtr(FX_BSTR name) const
-{
- CFX_ByteStringC bsSpace, bsName;
- FX_XML_SplitQualifiedName(name, bsSpace, bsName);
- return m_AttrMap.Lookup(bsSpace, bsName);
-}
-FX_BOOL CXML_Element::GetAttrValue(FX_BSTR space, FX_BSTR name, CFX_WideString& attribute) const
-{
- const CFX_WideStringL* pValue = m_AttrMap.Lookup(space, name);
- if (pValue) {
- attribute = CFX_WideString(pValue->GetPtr(), pValue->GetLength());
- return TRUE;
- }
- return FALSE;
-}
-const CFX_WideStringL* CXML_Element::GetAttrValuePtr(FX_BSTR space, FX_BSTR name) const
-{
- return m_AttrMap.Lookup(space, name);
-}
-FX_BOOL CXML_Element::GetAttrInteger(FX_BSTR name, int& attribute) const
-{
- CFX_ByteStringC bsSpace, bsName;
- FX_XML_SplitQualifiedName(name, bsSpace, bsName);
- const CFX_WideStringL* pwsValue = m_AttrMap.Lookup(bsSpace, bsName);
- if (pwsValue) {
- attribute = pwsValue->GetInteger();
- return TRUE;
- }
- return FALSE;
-}
-FX_BOOL CXML_Element::GetAttrInteger(FX_BSTR space, FX_BSTR name, int& attribute) const
-{
- const CFX_WideStringL* pwsValue = m_AttrMap.Lookup(space, name);
- if (pwsValue) {
- attribute = pwsValue->GetInteger();
- return TRUE;
- }
- return FALSE;
-}
-FX_BOOL CXML_Element::GetAttrFloat(FX_BSTR name, FX_FLOAT& attribute) const
-{
- CFX_ByteStringC bsSpace, bsName;
- FX_XML_SplitQualifiedName(name, bsSpace, bsName);
- return GetAttrFloat(bsSpace, bsName, attribute);
-}
-FX_BOOL CXML_Element::GetAttrFloat(FX_BSTR space, FX_BSTR name, FX_FLOAT& attribute) const
-{
- CFX_WideString value;
- const CFX_WideStringL* pValue = m_AttrMap.Lookup(space, name);
- if (pValue) {
- attribute = pValue->GetFloat();
- return TRUE;
- }
- return FALSE;
-}
-FX_DWORD CXML_Element::CountChildren() const
-{
- return m_Children.GetSize() / 2;
-}
-CXML_Element::ChildType CXML_Element::GetChildType(FX_DWORD index) const
-{
- index <<= 1;
- if (index >= (FX_DWORD)m_Children.GetSize()) {
- return Invalid;
- }
- return (ChildType)(FX_UINTPTR)m_Children.GetAt(index);
-}
-CFX_WideString CXML_Element::GetContent(FX_DWORD index) const
-{
- index <<= 1;
- if (index >= (FX_DWORD)m_Children.GetSize() ||
- (ChildType)(FX_UINTPTR)m_Children.GetAt(index) != Content) {
- return CFX_WideString();
- }
- CXML_Content* pContent = (CXML_Content*)m_Children.GetAt(index + 1);
- if (pContent) {
- return pContent->m_Content;
- }
- return CFX_WideString();
-}
-const CFX_WideStringL* CXML_Element::GetContentPtr(FX_DWORD index) const
-{
- index <<= 1;
- if (index >= (FX_DWORD)m_Children.GetSize() ||
- (ChildType)(FX_UINTPTR)m_Children.GetAt(index) != Content) {
- return NULL;
- }
- CXML_Content* pContent = (CXML_Content*)m_Children.GetAt(index + 1);
- if (pContent) {
- return &pContent->m_Content;
- }
- return NULL;
-}
-CXML_Element* CXML_Element::GetElement(FX_DWORD index) const
-{
- index <<= 1;
- if (index >= (FX_DWORD)m_Children.GetSize() ||
- (ChildType)(FX_UINTPTR)m_Children.GetAt(index) != Element) {
- return NULL;
- }
- return (CXML_Element*)m_Children.GetAt(index + 1);
-}
-FX_DWORD CXML_Element::CountElements(FX_BSTR space, FX_BSTR tag) const
-{
- int count = 0;
- for (int i = 0; i < m_Children.GetSize(); i += 2) {
- ChildType type = (ChildType)(FX_UINTPTR)m_Children.GetAt(i);
- if (type != Element) {
- continue;
- }
- CXML_Element* pKid = (CXML_Element*)m_Children.GetAt(i + 1);
- if ((space.IsEmpty() || pKid->m_QSpaceName == space) && pKid->m_TagName == tag) {
- count ++;
- }
- }
- return count;
-}
-CXML_Element* CXML_Element::GetElement(FX_BSTR space, FX_BSTR tag, int index) const
-{
- if (index < 0) {
- return NULL;
- }
- for (int i = 0; i < m_Children.GetSize(); i += 2) {
- ChildType type = (ChildType)(FX_UINTPTR)m_Children.GetAt(i);
- if (type != Element) {
- continue;
- }
- CXML_Element* pKid = (CXML_Element*)m_Children.GetAt(i + 1);
- if ((!space.IsEmpty() && pKid->m_QSpaceName != space) || pKid->m_TagName != tag) {
- continue;
- }
- if (index -- == 0) {
- return pKid;
- }
- }
- return NULL;
-}
-FX_DWORD CXML_Element::FindElement(CXML_Element *pChild) const
-{
- for (int i = 0; i < m_Children.GetSize(); i += 2) {
- if ((ChildType)(FX_UINTPTR)m_Children.GetAt(i) == Element &&
- (CXML_Element*)m_Children.GetAt(i + 1) == pChild) {
- return (FX_DWORD)(i >> 1);
- }
- }
- return (FX_DWORD) - 1;
-}
-const CFX_WideStringL* CXML_AttrMap::Lookup(FX_BSTR space, FX_BSTR name) const
-{
- if (m_pMap == NULL) {
- return NULL;
- }
- for (int i = 0; i < m_pMap->GetSize(); i ++) {
- CXML_AttrItem& item = GetAt(i);
- if ((space.IsEmpty() || item.m_QSpaceName == space) && item.m_AttrName == name) {
- return &item.m_Value;
- }
- }
- return NULL;
-}
-void CXML_AttrMap::SetAt(FX_BSTR space, FX_BSTR name, FX_WSTR value, IFX_Allocator* pAllocator)
-{
- for (int i = 0; i < GetSize(); i ++) {
- CXML_AttrItem& item = GetAt(i);
- if ((space.IsEmpty() || item.m_QSpaceName == space) && item.m_AttrName == name) {
- item.m_Value.Set(value, pAllocator);
- return;
- }
- }
- if (!m_pMap) {
- if (pAllocator) {
- m_pMap = FX_NewAtAllocator(pAllocator)CFX_ObjectArray<CXML_AttrItem>(pAllocator);
- } else {
- m_pMap = FX_NEW CFX_ObjectArray<CXML_AttrItem>;
- }
- }
- if (!m_pMap) {
- return;
- }
- CXML_AttrItem* pItem = (CXML_AttrItem*)m_pMap->AddSpace();
- if (!pItem) {
- return;
- }
- pItem->m_QSpaceName.Set(space, pAllocator);
- pItem->m_AttrName.Set(name, pAllocator);
- pItem->m_Value.Set(value, pAllocator);
-}
-void CXML_AttrMap::RemoveAt(FX_BSTR space, FX_BSTR name, IFX_Allocator* pAllocator)
-{
- if (m_pMap == NULL) {
- return;
- }
- for (int i = 0; i < m_pMap->GetSize(); i ++) {
- CXML_AttrItem& item = GetAt(i);
- if ((space.IsEmpty() || item.m_QSpaceName == space) && item.m_AttrName == name) {
- item.Empty(pAllocator);
- m_pMap->RemoveAt(i);
- return;
- }
- }
-}
-int CXML_AttrMap::GetSize() const
-{
- return m_pMap == NULL ? 0 : m_pMap->GetSize();
-}
-CXML_AttrItem& CXML_AttrMap::GetAt(int index) const
-{
- ASSERT(m_pMap != NULL);
- return (*m_pMap)[index];
-}
-void CXML_AttrMap::RemoveAll(IFX_Allocator* pAllocator)
-{
- if (!m_pMap) {
- return;
- }
- for (int i = 0; i < m_pMap->GetSize(); i ++) {
- CXML_AttrItem& item = (*m_pMap)[i];
- item.Empty(pAllocator);
- }
- m_pMap->RemoveAll();
- if (pAllocator) {
- FX_DeleteAtAllocator(m_pMap, pAllocator, CFX_ObjectArray<CXML_AttrItem>);
- } else {
- delete m_pMap;
- }
- m_pMap = NULL;
-}
+// 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
+
+#include "../../include/fxcrt/fx_xml.h"
+#include "xml_int.h"
+CXML_Parser::~CXML_Parser()
+{
+ if (m_bOwnedStream) {
+ m_pDataAcc->Release();
+ }
+}
+FX_BOOL CXML_Parser::Init(FX_LPBYTE pBuffer, size_t size)
+{
+ if (m_pAllocator) {
+ m_pDataAcc = FX_NewAtAllocator(m_pAllocator)CXML_DataBufAcc(pBuffer, size, m_pAllocator);
+ } else {
+ m_pDataAcc = FX_NEW CXML_DataBufAcc(pBuffer, size, NULL);
+ }
+ if (!m_pDataAcc) {
+ return FALSE;
+ }
+ return Init(TRUE);
+}
+FX_BOOL CXML_Parser::Init(IFX_FileRead *pFileRead)
+{
+ if (m_pAllocator) {
+ m_pDataAcc = FX_NewAtAllocator(m_pAllocator)CXML_DataStmAcc(pFileRead, m_pAllocator);
+ } else {
+ m_pDataAcc = FX_NEW CXML_DataStmAcc(pFileRead, NULL);
+ }
+ if (!m_pDataAcc) {
+ return FALSE;
+ }
+ return Init(TRUE);
+}
+FX_BOOL CXML_Parser::Init(IFX_BufferRead *pBuffer)
+{
+ if (!pBuffer) {
+ return FALSE;
+ }
+ m_pDataAcc = pBuffer;
+ return Init(FALSE);
+}
+FX_BOOL CXML_Parser::Init(FX_BOOL bOwndedStream)
+{
+ m_bOwnedStream = bOwndedStream;
+ m_nOffset = 0;
+ return ReadNextBlock();
+}
+FX_BOOL CXML_Parser::ReadNextBlock()
+{
+ if (!m_pDataAcc->ReadNextBlock()) {
+ return FALSE;
+ }
+ m_pBuffer = m_pDataAcc->GetBlockBuffer();
+ m_dwBufferSize = m_pDataAcc->GetBlockSize();
+ m_nBufferOffset = m_pDataAcc->GetBlockOffset();
+ m_dwIndex = 0;
+ return m_dwBufferSize > 0;
+}
+FX_BOOL CXML_Parser::IsEOF()
+{
+ if (!m_pDataAcc->IsEOF()) {
+ return FALSE;
+ }
+ return m_dwIndex >= m_dwBufferSize;
+}
+#define FXCRTM_XML_CHARTYPE_Normal 0x00
+#define FXCRTM_XML_CHARTYPE_SpaceChar 0x01
+#define FXCRTM_XML_CHARTYPE_Letter 0x02
+#define FXCRTM_XML_CHARTYPE_Digital 0x04
+#define FXCRTM_XML_CHARTYPE_NameIntro 0x08
+#define FXCRTM_XML_CHARTYPE_NameChar 0x10
+#define FXCRTM_XML_CHARTYPE_HexDigital 0x20
+#define FXCRTM_XML_CHARTYPE_HexLowerLetter 0x40
+#define FXCRTM_XML_CHARTYPE_HexUpperLetter 0x60
+#define FXCRTM_XML_CHARTYPE_HexChar 0x60
+FX_BYTE g_FXCRT_XML_ByteTypes[256] = {
+ 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+ 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x00,
+ 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x7A, 0x7A, 0x7A, 0x7A, 0x7A, 0x7A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A,
+ 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x00, 0x00, 0x00, 0x00, 0x18,
+ 0x00, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A,
+ 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A,
+ 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A,
+ 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A,
+ 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A,
+ 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A,
+ 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A,
+ 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A,
+ 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x01, 0x01,
+};
+FX_BOOL g_FXCRT_XML_IsWhiteSpace(FX_BYTE ch)
+{
+ return (g_FXCRT_XML_ByteTypes[ch] & FXCRTM_XML_CHARTYPE_SpaceChar) != 0;
+}
+FX_BOOL g_FXCRT_XML_IsLetter(FX_BYTE ch)
+{
+ return (g_FXCRT_XML_ByteTypes[ch] & FXCRTM_XML_CHARTYPE_Letter) != 0;
+}
+FX_BOOL g_FXCRT_XML_IsDigital(FX_BYTE ch)
+{
+ return (g_FXCRT_XML_ByteTypes[ch] & FXCRTM_XML_CHARTYPE_Digital) != 0;
+}
+FX_BOOL g_FXCRT_XML_IsNameIntro(FX_BYTE ch)
+{
+ return (g_FXCRT_XML_ByteTypes[ch] & FXCRTM_XML_CHARTYPE_NameIntro) != 0;
+}
+FX_BOOL g_FXCRT_XML_IsNameChar(FX_BYTE ch)
+{
+ return (g_FXCRT_XML_ByteTypes[ch] & FXCRTM_XML_CHARTYPE_NameChar) != 0;
+}
+FX_BOOL g_FXCRT_XML_IsHexChar(FX_BYTE ch)
+{
+ return (g_FXCRT_XML_ByteTypes[ch] & FXCRTM_XML_CHARTYPE_HexChar) != 0;
+}
+void CXML_Parser::SkipWhiteSpaces()
+{
+ m_nOffset = m_nBufferOffset + (FX_FILESIZE)m_dwIndex;
+ if (IsEOF()) {
+ return;
+ }
+ do {
+ while (m_dwIndex < m_dwBufferSize && g_FXCRT_XML_IsWhiteSpace(m_pBuffer[m_dwIndex])) {
+ m_dwIndex ++;
+ }
+ m_nOffset = m_nBufferOffset + (FX_FILESIZE)m_dwIndex;
+ if (m_dwIndex < m_dwBufferSize || IsEOF()) {
+ break;
+ }
+ } while (ReadNextBlock());
+}
+void CXML_Parser::GetName(CFX_ByteStringL &space, CFX_ByteStringL &name)
+{
+ m_nOffset = m_nBufferOffset + (FX_FILESIZE)m_dwIndex;
+ if (IsEOF()) {
+ return;
+ }
+ CFX_ByteTextBuf buf(m_pAllocator);
+ FX_BYTE ch;
+ do {
+ while (m_dwIndex < m_dwBufferSize) {
+ ch = m_pBuffer[m_dwIndex];
+ if (ch == ':') {
+ buf.GetByteStringL(space);
+ buf.Clear();
+ } else if (g_FXCRT_XML_IsNameChar(ch)) {
+ buf.AppendChar(ch);
+ } else {
+ break;
+ }
+ m_dwIndex ++;
+ }
+ m_nOffset = m_nBufferOffset + (FX_FILESIZE)m_dwIndex;
+ if (m_dwIndex < m_dwBufferSize || IsEOF()) {
+ break;
+ }
+ } while (ReadNextBlock());
+ buf.GetByteStringL(name);
+}
+void CXML_Parser::SkipLiterals(FX_BSTR str)
+{
+ m_nOffset = m_nBufferOffset + (FX_FILESIZE)m_dwIndex;
+ if (IsEOF()) {
+ return;
+ }
+ FX_INT32 i = 0, iLen = str.GetLength();
+ do {
+ while (m_dwIndex < m_dwBufferSize) {
+ if (str.GetAt(i) != m_pBuffer[m_dwIndex ++]) {
+ i = 0;
+ } else {
+ i ++;
+ if (i == iLen) {
+ break;
+ }
+ }
+ }
+ m_nOffset = m_nBufferOffset + (FX_FILESIZE)m_dwIndex;
+ if (i == iLen) {
+ return;
+ }
+ if (m_dwIndex < m_dwBufferSize || IsEOF()) {
+ break;
+ }
+ } while (ReadNextBlock());
+ while (!m_pDataAcc->IsEOF()) {
+ ReadNextBlock();
+ m_nOffset = m_nBufferOffset + (FX_FILESIZE)m_dwBufferSize;
+ }
+ m_dwIndex = m_dwBufferSize;
+}
+FX_DWORD CXML_Parser::GetCharRef()
+{
+ m_nOffset = m_nBufferOffset + (FX_FILESIZE)m_dwIndex;
+ if (IsEOF()) {
+ return 0;
+ }
+ FX_BYTE ch;
+ FX_INT32 iState = 0;
+ CFX_ByteTextBuf buf(m_pAllocator);
+ FX_DWORD code = 0;
+ do {
+ while (m_dwIndex < m_dwBufferSize) {
+ ch = m_pBuffer[m_dwIndex];
+ switch (iState) {
+ case 0:
+ if (ch == '#') {
+ m_dwIndex ++;
+ iState = 2;
+ break;
+ }
+ iState = 1;
+ case 1:
+ m_dwIndex ++;
+ if (ch == ';') {
+ CFX_ByteStringC ref = buf.GetByteString();
+ if (ref == FX_BSTRC("gt")) {
+ code = '>';
+ } else if (ref == FX_BSTRC("lt")) {
+ code = '<';
+ } else if (ref == FX_BSTRC("amp")) {
+ code = '&';
+ } else if (ref == FX_BSTRC("apos")) {
+ code = '\'';
+ } else if (ref == FX_BSTRC("quot")) {
+ code = '"';
+ }
+ iState = 10;
+ break;
+ }
+ buf.AppendByte(ch);
+ break;
+ case 2:
+ if (ch == 'x') {
+ m_dwIndex ++;
+ iState = 4;
+ break;
+ }
+ iState = 3;
+ case 3:
+ m_dwIndex ++;
+ if (ch == ';') {
+ iState = 10;
+ break;
+ }
+ if (g_FXCRT_XML_IsDigital(ch)) {
+ code = code * 10 + ch - '0';
+ }
+ break;
+ case 4:
+ m_dwIndex ++;
+ if (ch == ';') {
+ iState = 10;
+ break;
+ }
+ FX_BYTE nHex = g_FXCRT_XML_ByteTypes[ch] & FXCRTM_XML_CHARTYPE_HexChar;
+ if (nHex) {
+ if (nHex == FXCRTM_XML_CHARTYPE_HexDigital) {
+ code = (code << 4) + ch - '0';
+ } else if (nHex == FXCRTM_XML_CHARTYPE_HexLowerLetter) {
+ code = (code << 4) + ch - 87;
+ } else {
+ code = (code << 4) + ch - 55;
+ }
+ }
+ break;
+ }
+ if (iState == 10) {
+ break;
+ }
+ }
+ m_nOffset = m_nBufferOffset + (FX_FILESIZE)m_dwIndex;
+ if (iState == 10 || m_dwIndex < m_dwBufferSize || IsEOF()) {
+ break;
+ }
+ } while (ReadNextBlock());
+ return code;
+}
+void CXML_Parser::GetAttrValue(CFX_WideStringL &value)
+{
+ m_nOffset = m_nBufferOffset + (FX_FILESIZE)m_dwIndex;
+ if (IsEOF()) {
+ return;
+ }
+ CFX_UTF8Decoder decoder(m_pAllocator);
+ FX_BYTE mark = 0, ch;
+ do {
+ while (m_dwIndex < m_dwBufferSize) {
+ ch = m_pBuffer[m_dwIndex];
+ if (mark == 0) {
+ if (ch != '\'' && ch != '"') {
+ return;
+ }
+ mark = ch;
+ m_dwIndex ++;
+ ch = 0;
+ continue;
+ }
+ m_dwIndex ++;
+ if (ch == mark) {
+ break;
+ }
+ if (ch == '&') {
+ decoder.AppendChar(GetCharRef());
+ if (IsEOF()) {
+ decoder.GetResult(value);
+ return;
+ }
+ } else {
+ decoder.Input(ch);
+ }
+ }
+ m_nOffset = m_nBufferOffset + (FX_FILESIZE)m_dwIndex;
+ if (ch == mark || m_dwIndex < m_dwBufferSize || IsEOF()) {
+ break;
+ }
+ } while (ReadNextBlock());
+ decoder.GetResult(value);
+}
+void CXML_Parser::GetTagName(CFX_ByteStringL &space, CFX_ByteStringL &name, FX_BOOL &bEndTag, FX_BOOL bStartTag)
+{
+ m_nOffset = m_nBufferOffset + (FX_FILESIZE)m_dwIndex;
+ if (IsEOF()) {
+ return;
+ }
+ bEndTag = FALSE;
+ FX_BYTE ch;
+ FX_INT32 iState = bStartTag ? 1 : 0;
+ do {
+ while (m_dwIndex < m_dwBufferSize) {
+ ch = m_pBuffer[m_dwIndex];
+ switch (iState) {
+ case 0:
+ m_dwIndex ++;
+ if (ch != '<') {
+ break;
+ }
+ iState = 1;
+ break;
+ case 1:
+ if (ch == '?') {
+ m_dwIndex ++;
+ SkipLiterals(FX_BSTRC("?>"));
+ iState = 0;
+ break;
+ } else if (ch == '!') {
+ m_dwIndex ++;
+ SkipLiterals(FX_BSTRC("-->"));
+ iState = 0;
+ break;
+ }
+ if (ch == '/') {
+ m_dwIndex ++;
+ GetName(space, name);
+ bEndTag = TRUE;
+ } else {
+ GetName(space, name);
+ bEndTag = FALSE;
+ }
+ return;
+ }
+ }
+ m_nOffset = m_nBufferOffset + (FX_FILESIZE)m_dwIndex;
+ if (m_dwIndex < m_dwBufferSize || IsEOF()) {
+ break;
+ }
+ } while (ReadNextBlock());
+}
+CXML_Element* CXML_Parser::ParseElement(CXML_Element* pParent, FX_BOOL bStartTag)
+{
+ m_nOffset = m_nBufferOffset + (FX_FILESIZE)m_dwIndex;
+ if (IsEOF()) {
+ return NULL;
+ }
+ CFX_ByteStringL tag_name, tag_space;
+ FX_BOOL bEndTag;
+ GetTagName(tag_space, tag_name, bEndTag, bStartTag);
+ if (tag_name.IsEmpty() || bEndTag) {
+ tag_space.Empty(m_pAllocator);
+ return NULL;
+ }
+ CXML_Element* pElement;
+ if (m_pAllocator) {
+ pElement = FX_NewAtAllocator(m_pAllocator)CXML_Element(m_pAllocator);
+ } else {
+ pElement = FX_NEW CXML_Element;
+ }
+ if (pElement) {
+ pElement->m_pParent = pParent;
+ pElement->SetTag(tag_space, tag_name);
+ }
+ tag_space.Empty(m_pAllocator);
+ tag_name.Empty(m_pAllocator);
+ if (!pElement) {
+ return NULL;
+ }
+ do {
+ CFX_ByteStringL attr_space, attr_name;
+ while (m_dwIndex < m_dwBufferSize) {
+ SkipWhiteSpaces();
+ if (IsEOF()) {
+ break;
+ }
+ if (!g_FXCRT_XML_IsNameIntro(m_pBuffer[m_dwIndex])) {
+ break;
+ }
+ attr_space.Empty(m_pAllocator);
+ attr_name.Empty(m_pAllocator);
+ GetName(attr_space, attr_name);
+ SkipWhiteSpaces();
+ if (IsEOF()) {
+ break;
+ }
+ if (m_pBuffer[m_dwIndex] != '=') {
+ break;
+ }
+ m_dwIndex ++;
+ SkipWhiteSpaces();
+ if (IsEOF()) {
+ break;
+ }
+ CFX_WideStringL attr_value;
+ GetAttrValue(attr_value);
+ pElement->m_AttrMap.SetAt(attr_space, attr_name, attr_value, m_pAllocator);
+ attr_value.Empty(m_pAllocator);
+ }
+ attr_space.Empty(m_pAllocator);
+ attr_name.Empty(m_pAllocator);
+ m_nOffset = m_nBufferOffset + (FX_FILESIZE)m_dwIndex;
+ if (m_dwIndex < m_dwBufferSize || IsEOF()) {
+ break;
+ }
+ } while (ReadNextBlock());
+ SkipWhiteSpaces();
+ if (IsEOF()) {
+ return pElement;
+ }
+ FX_BYTE ch = m_pBuffer[m_dwIndex ++];
+ if (ch == '/') {
+ m_dwIndex ++;
+ m_nOffset = m_nBufferOffset + (FX_FILESIZE)m_dwIndex;
+ return pElement;
+ }
+ if (ch != '>') {
+ m_nOffset = m_nBufferOffset + (FX_FILESIZE)m_dwIndex;
+ if (m_pAllocator) {
+ FX_DeleteAtAllocator(pElement, m_pAllocator, CXML_Element);
+ } else {
+ delete pElement;
+ }
+ return NULL;
+ }
+ SkipWhiteSpaces();
+ if (IsEOF()) {
+ return pElement;
+ }
+ CFX_UTF8Decoder decoder(m_pAllocator);
+ CFX_WideTextBuf content(m_pAllocator);
+ FX_BOOL bCDATA = FALSE;
+ FX_INT32 iState = 0;
+ do {
+ while (m_dwIndex < m_dwBufferSize) {
+ ch = m_pBuffer[m_dwIndex ++];
+ switch (iState) {
+ case 0:
+ if (ch == '<') {
+ iState = 1;
+ } else if (ch == '&') {
+ decoder.ClearStatus();
+ decoder.AppendChar(GetCharRef());
+ } else {
+ decoder.Input(ch);
+ }
+ break;
+ case 1:
+ if (ch == '!') {
+ iState = 2;
+ } else if (ch == '?') {
+ SkipLiterals(FX_BSTRC("?>"));
+ SkipWhiteSpaces();
+ iState = 0;
+ } else if (ch == '/') {
+ CFX_ByteStringL space, name;
+ GetName(space, name);
+ space.Empty(m_pAllocator);
+ name.Empty(m_pAllocator);
+ SkipWhiteSpaces();
+ m_dwIndex ++;
+ iState = 10;
+ } else {
+ content << decoder.GetResult();
+ CFX_WideStringL dataStr;
+ content.GetWideStringL(dataStr);
+ if (!bCDATA && !m_bSaveSpaceChars) {
+ dataStr.TrimRight((FX_LPCWSTR)L" \t\r\n");
+ }
+ InsertContentSegment(bCDATA, dataStr, pElement);
+ dataStr.Empty(m_pAllocator);
+ content.Clear();
+ decoder.Clear();
+ bCDATA = FALSE;
+ iState = 0;
+ m_dwIndex --;
+ CXML_Element* pSubElement = ParseElement(pElement, TRUE);
+ if (pSubElement == NULL) {
+ break;
+ }
+ pSubElement->m_pParent = pElement;
+ pElement->m_Children.Add((FX_LPVOID)CXML_Element::Element);
+ pElement->m_Children.Add(pSubElement);
+ SkipWhiteSpaces();
+ }
+ break;
+ case 2:
+ if (ch == '[') {
+ SkipLiterals(FX_BSTRC("]]>"));
+ } else if (ch == '-') {
+ m_dwIndex ++;
+ SkipLiterals(FX_BSTRC("-->"));
+ } else {
+ SkipLiterals(FX_BSTRC(">"));
+ }
+ decoder.Clear();
+ SkipWhiteSpaces();
+ iState = 0;
+ break;
+ }
+ if (iState == 10) {
+ break;
+ }
+ }
+ m_nOffset = m_nBufferOffset + (FX_FILESIZE)m_dwIndex;
+ if (iState == 10 || m_dwIndex < m_dwBufferSize || IsEOF()) {
+ break;
+ }
+ } while (ReadNextBlock());
+ content << decoder.GetResult();
+ CFX_WideStringL dataStr;
+ content.GetWideStringL(dataStr);
+ if (!m_bSaveSpaceChars) {
+ dataStr.TrimRight((FX_LPCWSTR)L" \t\r\n");
+ }
+ InsertContentSegment(bCDATA, dataStr, pElement);
+ dataStr.Empty(m_pAllocator);
+ content.Clear();
+ decoder.Clear();
+ bCDATA = FALSE;
+ return pElement;
+}
+void CXML_Parser::InsertContentSegment(FX_BOOL bCDATA, FX_WSTR content, CXML_Element* pElement)
+{
+ if (content.IsEmpty()) {
+ return;
+ }
+ CXML_Content* pContent;
+ if (m_pAllocator) {
+ pContent = FX_NewAtAllocator(m_pAllocator)CXML_Content;
+ } else {
+ pContent = FX_NEW CXML_Content;
+ }
+ if (!pContent) {
+ return;
+ }
+ pContent->Set(bCDATA, content, m_pAllocator);
+ pElement->m_Children.Add((FX_LPVOID)CXML_Element::Content);
+ pElement->m_Children.Add(pContent);
+}
+static CXML_Element* XML_ContinueParse(CXML_Parser &parser, FX_BOOL bSaveSpaceChars, FX_FILESIZE* pParsedSize)
+{
+ parser.m_bSaveSpaceChars = bSaveSpaceChars;
+ CXML_Element* pElement = parser.ParseElement(NULL, FALSE);
+ if (pParsedSize) {
+ *pParsedSize = parser.m_nOffset;
+ }
+ return pElement;
+}
+CXML_Element* CXML_Element::Parse(const void* pBuffer, size_t size, FX_BOOL bSaveSpaceChars, FX_FILESIZE* pParsedSize, IFX_Allocator* pAllocator)
+{
+ CXML_Parser parser(pAllocator);
+ if (!parser.Init((FX_LPBYTE)pBuffer, size)) {
+ return NULL;
+ }
+ return XML_ContinueParse(parser, bSaveSpaceChars, pParsedSize);
+}
+CXML_Element* CXML_Element::Parse(IFX_FileRead *pFile, FX_BOOL bSaveSpaceChars, FX_FILESIZE* pParsedSize, IFX_Allocator* pAllocator)
+{
+ CXML_Parser parser(pAllocator);
+ if (!parser.Init(pFile)) {
+ return NULL;
+ }
+ return XML_ContinueParse(parser, bSaveSpaceChars, pParsedSize);
+}
+CXML_Element* CXML_Element::Parse(IFX_BufferRead *pBuffer, FX_BOOL bSaveSpaceChars, FX_FILESIZE* pParsedSize, IFX_Allocator* pAllocator)
+{
+ CXML_Parser parser(pAllocator);
+ if (!parser.Init(pBuffer)) {
+ return NULL;
+ }
+ return XML_ContinueParse(parser, bSaveSpaceChars, pParsedSize);
+}
+CXML_Element::CXML_Element(IFX_Allocator* pAllocator)
+ : m_pParent(NULL)
+ , m_QSpaceName()
+ , m_TagName()
+ , m_AttrMap()
+ , m_Children(pAllocator)
+{
+}
+CXML_Element::CXML_Element(FX_BSTR qSpace, FX_BSTR tagName, IFX_Allocator* pAllocator)
+ : m_pParent(NULL)
+ , m_QSpaceName()
+ , m_TagName()
+ , m_AttrMap()
+ , m_Children(pAllocator)
+{
+ m_QSpaceName.Set(qSpace, pAllocator);
+ m_TagName.Set(tagName, pAllocator);
+}
+CXML_Element::CXML_Element(FX_BSTR qTagName, IFX_Allocator* pAllocator)
+ : m_pParent(NULL)
+ , m_QSpaceName()
+ , m_TagName()
+ , m_AttrMap()
+ , m_Children(pAllocator)
+{
+ SetTag(qTagName);
+}
+CXML_Element::~CXML_Element()
+{
+ Empty();
+}
+void CXML_Element::Empty()
+{
+ IFX_Allocator* pAllocator = m_Children.m_pAllocator;
+ m_QSpaceName.Empty(pAllocator);
+ m_TagName.Empty(pAllocator);
+ m_AttrMap.RemoveAll(pAllocator);
+ RemoveChildren();
+}
+void CXML_Element::RemoveChildren()
+{
+ IFX_Allocator* pAllocator = m_Children.m_pAllocator;
+ for (int i = 0; i < m_Children.GetSize(); i += 2) {
+ ChildType type = (ChildType)(FX_UINTPTR)m_Children.GetAt(i);
+ if (type == Content) {
+ CXML_Content* content = (CXML_Content*)m_Children.GetAt(i + 1);
+ if (pAllocator) {
+ FX_DeleteAtAllocator(content, pAllocator, CXML_Content);
+ } else {
+ delete content;
+ }
+ } else if (type == Element) {
+ CXML_Element* child = (CXML_Element*)m_Children.GetAt(i + 1);
+ child->RemoveChildren();
+ if (pAllocator) {
+ FX_DeleteAtAllocator(child, pAllocator, CXML_Element);
+ } else {
+ delete child;
+ }
+ }
+ }
+ m_Children.RemoveAll();
+}
+CFX_ByteString CXML_Element::GetTagName(FX_BOOL bQualified) const
+{
+ if (!bQualified || m_QSpaceName.IsEmpty()) {
+ return m_TagName;
+ }
+ CFX_ByteString bsTag = m_QSpaceName;
+ bsTag += ":";
+ bsTag += m_TagName;
+ return bsTag;
+}
+void CXML_Element::GetTagName(CFX_ByteStringL &tagName, FX_BOOL bQualified) const
+{
+ IFX_Allocator* pAllocator = m_Children.m_pAllocator;
+ if (!bQualified || m_QSpaceName.IsEmpty()) {
+ tagName.Set(m_TagName, pAllocator);
+ return;
+ }
+ FX_LPSTR str = tagName.AllocBuffer(m_QSpaceName.GetLength() + m_TagName.GetLength() + 2, pAllocator);
+ if (!str) {
+ return;
+ }
+ FXSYS_memcpy32(str, m_QSpaceName.GetCStr(), m_QSpaceName.GetLength());
+ str += m_QSpaceName.GetLength();
+ *str = ':';
+ str ++;
+ FXSYS_memcpy32(str, m_TagName.GetCStr(), m_TagName.GetLength());
+ str += m_TagName.GetLength();
+ *str = '\0';
+}
+CFX_ByteString CXML_Element::GetNamespace(FX_BOOL bQualified) const
+{
+ if (bQualified) {
+ return m_QSpaceName;
+ }
+ return GetNamespaceURI(m_QSpaceName);
+}
+void CXML_Element::GetNamespace(CFX_ByteStringL &nameSpace, FX_BOOL bQualified) const
+{
+ IFX_Allocator* pAllocator = m_Children.m_pAllocator;
+ if (bQualified) {
+ nameSpace.Set(m_QSpaceName, pAllocator);
+ return;
+ }
+ GetNamespaceURI(m_QSpaceName, nameSpace);
+}
+CFX_ByteString CXML_Element::GetNamespaceURI(FX_BSTR qName) const
+{
+ const CFX_WideStringL* pwsSpace;
+ const CXML_Element *pElement = this;
+ do {
+ if (qName.IsEmpty()) {
+ pwsSpace = pElement->m_AttrMap.Lookup(FX_BSTRC(""), FX_BSTRC("xmlns"));
+ } else {
+ pwsSpace = pElement->m_AttrMap.Lookup(FX_BSTRC("xmlns"), qName);
+ }
+ if (pwsSpace) {
+ break;
+ }
+ pElement = pElement->GetParent();
+ } while(pElement);
+ return pwsSpace ? FX_UTF8Encode(*pwsSpace) : CFX_ByteString();
+}
+void CXML_Element::GetNamespaceURI(FX_BSTR qName, CFX_ByteStringL &uri) const
+{
+ IFX_Allocator* pAllocator = m_Children.m_pAllocator;
+ const CFX_WideStringL* pwsSpace;
+ const CXML_Element *pElement = this;
+ do {
+ if (qName.IsEmpty()) {
+ pwsSpace = pElement->m_AttrMap.Lookup(FX_BSTRC(""), FX_BSTRC("xmlns"));
+ } else {
+ pwsSpace = pElement->m_AttrMap.Lookup(FX_BSTRC("xmlns"), qName);
+ }
+ if (pwsSpace) {
+ break;
+ }
+ pElement = pElement->GetParent();
+ } while(pElement);
+ if (pwsSpace) {
+ FX_UTF8Encode(pwsSpace->GetPtr(), pwsSpace->GetLength(), uri, pAllocator);
+ }
+}
+void CXML_Element::GetAttrByIndex(int index, CFX_ByteString& space, CFX_ByteString& name, CFX_WideString& value) const
+{
+ if (index < 0 || index >= m_AttrMap.GetSize()) {
+ return;
+ }
+ CXML_AttrItem& item = m_AttrMap.GetAt(index);
+ space = item.m_QSpaceName;
+ name = item.m_AttrName;
+ value = item.m_Value;
+}
+void CXML_Element::GetAttrByIndex(int index, CFX_ByteStringL &space, CFX_ByteStringL &name, CFX_WideStringL &value) const
+{
+ if (index < 0 || index >= m_AttrMap.GetSize()) {
+ return;
+ }
+ IFX_Allocator* pAllocator = m_Children.m_pAllocator;
+ CXML_AttrItem& item = m_AttrMap.GetAt(index);
+ space.Set(item.m_QSpaceName, pAllocator);
+ name.Set(item.m_AttrName, pAllocator);
+ value.Set(item.m_Value, pAllocator);
+}
+FX_BOOL CXML_Element::HasAttr(FX_BSTR name) const
+{
+ CFX_ByteStringC bsSpace, bsName;
+ FX_XML_SplitQualifiedName(name, bsSpace, bsName);
+ return m_AttrMap.Lookup(bsSpace, bsName) != NULL;
+}
+FX_BOOL CXML_Element::GetAttrValue(FX_BSTR name, CFX_WideString& attribute) const
+{
+ CFX_ByteStringC bsSpace, bsName;
+ FX_XML_SplitQualifiedName(name, bsSpace, bsName);
+ const CFX_WideStringL* pValue = m_AttrMap.Lookup(bsSpace, bsName);
+ if (pValue) {
+ attribute = CFX_WideString(pValue->GetPtr(), pValue->GetLength());
+ return TRUE;
+ }
+ return FALSE;
+}
+const CFX_WideStringL* CXML_Element::GetAttrValuePtr(FX_BSTR name) const
+{
+ CFX_ByteStringC bsSpace, bsName;
+ FX_XML_SplitQualifiedName(name, bsSpace, bsName);
+ return m_AttrMap.Lookup(bsSpace, bsName);
+}
+FX_BOOL CXML_Element::GetAttrValue(FX_BSTR space, FX_BSTR name, CFX_WideString& attribute) const
+{
+ const CFX_WideStringL* pValue = m_AttrMap.Lookup(space, name);
+ if (pValue) {
+ attribute = CFX_WideString(pValue->GetPtr(), pValue->GetLength());
+ return TRUE;
+ }
+ return FALSE;
+}
+const CFX_WideStringL* CXML_Element::GetAttrValuePtr(FX_BSTR space, FX_BSTR name) const
+{
+ return m_AttrMap.Lookup(space, name);
+}
+FX_BOOL CXML_Element::GetAttrInteger(FX_BSTR name, int& attribute) const
+{
+ CFX_ByteStringC bsSpace, bsName;
+ FX_XML_SplitQualifiedName(name, bsSpace, bsName);
+ const CFX_WideStringL* pwsValue = m_AttrMap.Lookup(bsSpace, bsName);
+ if (pwsValue) {
+ attribute = pwsValue->GetInteger();
+ return TRUE;
+ }
+ return FALSE;
+}
+FX_BOOL CXML_Element::GetAttrInteger(FX_BSTR space, FX_BSTR name, int& attribute) const
+{
+ const CFX_WideStringL* pwsValue = m_AttrMap.Lookup(space, name);
+ if (pwsValue) {
+ attribute = pwsValue->GetInteger();
+ return TRUE;
+ }
+ return FALSE;
+}
+FX_BOOL CXML_Element::GetAttrFloat(FX_BSTR name, FX_FLOAT& attribute) const
+{
+ CFX_ByteStringC bsSpace, bsName;
+ FX_XML_SplitQualifiedName(name, bsSpace, bsName);
+ return GetAttrFloat(bsSpace, bsName, attribute);
+}
+FX_BOOL CXML_Element::GetAttrFloat(FX_BSTR space, FX_BSTR name, FX_FLOAT& attribute) const
+{
+ CFX_WideString value;
+ const CFX_WideStringL* pValue = m_AttrMap.Lookup(space, name);
+ if (pValue) {
+ attribute = pValue->GetFloat();
+ return TRUE;
+ }
+ return FALSE;
+}
+FX_DWORD CXML_Element::CountChildren() const
+{
+ return m_Children.GetSize() / 2;
+}
+CXML_Element::ChildType CXML_Element::GetChildType(FX_DWORD index) const
+{
+ index <<= 1;
+ if (index >= (FX_DWORD)m_Children.GetSize()) {
+ return Invalid;
+ }
+ return (ChildType)(FX_UINTPTR)m_Children.GetAt(index);
+}
+CFX_WideString CXML_Element::GetContent(FX_DWORD index) const
+{
+ index <<= 1;
+ if (index >= (FX_DWORD)m_Children.GetSize() ||
+ (ChildType)(FX_UINTPTR)m_Children.GetAt(index) != Content) {
+ return CFX_WideString();
+ }
+ CXML_Content* pContent = (CXML_Content*)m_Children.GetAt(index + 1);
+ if (pContent) {
+ return pContent->m_Content;
+ }
+ return CFX_WideString();
+}
+const CFX_WideStringL* CXML_Element::GetContentPtr(FX_DWORD index) const
+{
+ index <<= 1;
+ if (index >= (FX_DWORD)m_Children.GetSize() ||
+ (ChildType)(FX_UINTPTR)m_Children.GetAt(index) != Content) {
+ return NULL;
+ }
+ CXML_Content* pContent = (CXML_Content*)m_Children.GetAt(index + 1);
+ if (pContent) {
+ return &pContent->m_Content;
+ }
+ return NULL;
+}
+CXML_Element* CXML_Element::GetElement(FX_DWORD index) const
+{
+ index <<= 1;
+ if (index >= (FX_DWORD)m_Children.GetSize() ||
+ (ChildType)(FX_UINTPTR)m_Children.GetAt(index) != Element) {
+ return NULL;
+ }
+ return (CXML_Element*)m_Children.GetAt(index + 1);
+}
+FX_DWORD CXML_Element::CountElements(FX_BSTR space, FX_BSTR tag) const
+{
+ int count = 0;
+ for (int i = 0; i < m_Children.GetSize(); i += 2) {
+ ChildType type = (ChildType)(FX_UINTPTR)m_Children.GetAt(i);
+ if (type != Element) {
+ continue;
+ }
+ CXML_Element* pKid = (CXML_Element*)m_Children.GetAt(i + 1);
+ if ((space.IsEmpty() || pKid->m_QSpaceName == space) && pKid->m_TagName == tag) {
+ count ++;
+ }
+ }
+ return count;
+}
+CXML_Element* CXML_Element::GetElement(FX_BSTR space, FX_BSTR tag, int index) const
+{
+ if (index < 0) {
+ return NULL;
+ }
+ for (int i = 0; i < m_Children.GetSize(); i += 2) {
+ ChildType type = (ChildType)(FX_UINTPTR)m_Children.GetAt(i);
+ if (type != Element) {
+ continue;
+ }
+ CXML_Element* pKid = (CXML_Element*)m_Children.GetAt(i + 1);
+ if ((!space.IsEmpty() && pKid->m_QSpaceName != space) || pKid->m_TagName != tag) {
+ continue;
+ }
+ if (index -- == 0) {
+ return pKid;
+ }
+ }
+ return NULL;
+}
+FX_DWORD CXML_Element::FindElement(CXML_Element *pChild) const
+{
+ for (int i = 0; i < m_Children.GetSize(); i += 2) {
+ if ((ChildType)(FX_UINTPTR)m_Children.GetAt(i) == Element &&
+ (CXML_Element*)m_Children.GetAt(i + 1) == pChild) {
+ return (FX_DWORD)(i >> 1);
+ }
+ }
+ return (FX_DWORD) - 1;
+}
+const CFX_WideStringL* CXML_AttrMap::Lookup(FX_BSTR space, FX_BSTR name) const
+{
+ if (m_pMap == NULL) {
+ return NULL;
+ }
+ for (int i = 0; i < m_pMap->GetSize(); i ++) {
+ CXML_AttrItem& item = GetAt(i);
+ if ((space.IsEmpty() || item.m_QSpaceName == space) && item.m_AttrName == name) {
+ return &item.m_Value;
+ }
+ }
+ return NULL;
+}
+void CXML_AttrMap::SetAt(FX_BSTR space, FX_BSTR name, FX_WSTR value, IFX_Allocator* pAllocator)
+{
+ for (int i = 0; i < GetSize(); i ++) {
+ CXML_AttrItem& item = GetAt(i);
+ if ((space.IsEmpty() || item.m_QSpaceName == space) && item.m_AttrName == name) {
+ item.m_Value.Set(value, pAllocator);
+ return;
+ }
+ }
+ if (!m_pMap) {
+ if (pAllocator) {
+ m_pMap = FX_NewAtAllocator(pAllocator)CFX_ObjectArray<CXML_AttrItem>(pAllocator);
+ } else {
+ m_pMap = FX_NEW CFX_ObjectArray<CXML_AttrItem>;
+ }
+ }
+ if (!m_pMap) {
+ return;
+ }
+ CXML_AttrItem* pItem = (CXML_AttrItem*)m_pMap->AddSpace();
+ if (!pItem) {
+ return;
+ }
+ pItem->m_QSpaceName.Set(space, pAllocator);
+ pItem->m_AttrName.Set(name, pAllocator);
+ pItem->m_Value.Set(value, pAllocator);
+}
+void CXML_AttrMap::RemoveAt(FX_BSTR space, FX_BSTR name, IFX_Allocator* pAllocator)
+{
+ if (m_pMap == NULL) {
+ return;
+ }
+ for (int i = 0; i < m_pMap->GetSize(); i ++) {
+ CXML_AttrItem& item = GetAt(i);
+ if ((space.IsEmpty() || item.m_QSpaceName == space) && item.m_AttrName == name) {
+ item.Empty(pAllocator);
+ m_pMap->RemoveAt(i);
+ return;
+ }
+ }
+}
+int CXML_AttrMap::GetSize() const
+{
+ return m_pMap == NULL ? 0 : m_pMap->GetSize();
+}
+CXML_AttrItem& CXML_AttrMap::GetAt(int index) const
+{
+ ASSERT(m_pMap != NULL);
+ return (*m_pMap)[index];
+}
+void CXML_AttrMap::RemoveAll(IFX_Allocator* pAllocator)
+{
+ if (!m_pMap) {
+ return;
+ }
+ for (int i = 0; i < m_pMap->GetSize(); i ++) {
+ CXML_AttrItem& item = (*m_pMap)[i];
+ item.Empty(pAllocator);
+ }
+ m_pMap->RemoveAll();
+ if (pAllocator) {
+ FX_DeleteAtAllocator(m_pMap, pAllocator, CFX_ObjectArray<CXML_AttrItem>);
+ } else {
+ delete m_pMap;
+ }
+ m_pMap = NULL;
+}
diff --git a/core/src/fxcrt/fxcrt_platforms.cpp b/core/src/fxcrt/fxcrt_platforms.cpp
index 1479b7bcf0..7fb3adae40 100644
--- a/core/src/fxcrt/fxcrt_platforms.cpp
+++ b/core/src/fxcrt/fxcrt_platforms.cpp
@@ -1,203 +1,203 @@
-// 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
-
-#include "../../include/fxcrt/fx_ext.h"
-#include "fxcrt_platforms.h"
-#if (_FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ && _FXM_PLATFORM_ != _FXM_PLATFORM_LINUX_ && _FXM_PLATFORM_ != _FXM_PLATFORM_APPLE_ && _FXM_PLATFORM_ != _FXM_PLATFORM_ANDROID_)
-IFXCRT_FileAccess* FXCRT_FileAccess_Create(IFX_Allocator* pAllocator)
-{
- if (pAllocator) {
- return FX_NewAtAllocator(pAllocator) CFXCRT_FileAccess_CRT;
- } else {
- return FX_NEW CFXCRT_FileAccess_CRT;
- }
-}
-void FXCRT_GetFileModeString(FX_DWORD dwModes, CFX_ByteString &bsMode)
-{
- if (dwModes & FX_FILEMODE_ReadOnly) {
- bsMode = FX_BSTRC("rb");
- } else if (dwModes & FX_FILEMODE_Truncate) {
- bsMode = FX_BSTRC("w+b");
- } else {
- bsMode = FX_BSTRC("a+b");
- }
-}
-void FXCRT_GetFileModeString(FX_DWORD dwModes, CFX_WideString &wsMode)
-{
- if (dwModes & FX_FILEMODE_ReadOnly) {
- wsMode = FX_WSTRC(L"rb");
- } else if (dwModes & FX_FILEMODE_Truncate) {
- wsMode = FX_WSTRC(L"w+b");
- } else {
- wsMode = FX_WSTRC(L"a+b");
- }
-}
-CFXCRT_FileAccess_CRT::CFXCRT_FileAccess_CRT()
- : m_hFile(NULL)
-{
-}
-CFXCRT_FileAccess_CRT::~CFXCRT_FileAccess_CRT()
-{
- Close();
-}
-FX_BOOL CFXCRT_FileAccess_CRT::Open(FX_BSTR fileName, FX_DWORD dwMode)
-{
- if (m_hFile) {
- return FALSE;
- }
- CFX_ByteString strMode;
- FXCRT_GetFileModeString(dwMode, strMode);
- m_hFile = FXSYS_fopen(fileName.GetCStr(), (FX_LPCSTR)strMode);
- return m_hFile != NULL;
-}
-FX_BOOL CFXCRT_FileAccess_CRT::Open(FX_WSTR fileName, FX_DWORD dwMode)
-{
- if (m_hFile) {
- return FALSE;
- }
- CFX_WideString strMode;
- FXCRT_GetFileModeString(dwMode, strMode);
- m_hFile = FXSYS_wfopen(fileName.GetPtr(), (FX_LPCWSTR)strMode);
- return m_hFile != NULL;
-}
-void CFXCRT_FileAccess_CRT::Close()
-{
- if (!m_hFile) {
- return;
- }
- FXSYS_fclose(m_hFile);
- m_hFile = NULL;
-}
-void CFXCRT_FileAccess_CRT::Release(IFX_Allocator* pAllocator)
-{
- if (pAllocator) {
- FX_DeleteAtAllocator(this, pAllocator, CFXCRT_FileAccess_CRT);
- } else {
- delete this;
- }
-}
-FX_FILESIZE CFXCRT_FileAccess_CRT::GetSize() const
-{
- if (!m_hFile) {
- return 0;
- }
- FX_FILESIZE pos = (FX_FILESIZE)FXSYS_ftell(m_hFile);
- FXSYS_fseek(m_hFile, 0, FXSYS_SEEK_END);
- FX_FILESIZE size = (FX_FILESIZE)FXSYS_ftell(m_hFile);
- FXSYS_fseek(m_hFile, pos, FXSYS_SEEK_SET);
- return size;
-}
-FX_FILESIZE CFXCRT_FileAccess_CRT::GetPosition() const
-{
- if (!m_hFile) {
- return (FX_FILESIZE) - 1;
- }
- return (FX_FILESIZE)FXSYS_ftell(m_hFile);
-}
-FX_FILESIZE CFXCRT_FileAccess_CRT::SetPosition(FX_FILESIZE pos)
-{
- if (!m_hFile) {
- return (FX_FILESIZE) - 1;
- }
- FXSYS_fseek(m_hFile, pos, FXSYS_SEEK_SET);
- return (FX_FILESIZE)FXSYS_ftell(m_hFile);
-}
-size_t CFXCRT_FileAccess_CRT::Read(void* pBuffer, size_t szBuffer)
-{
- if (!m_hFile) {
- return 0;
- }
- return FXSYS_fread(pBuffer, 1, szBuffer, m_hFile);
-}
-size_t CFXCRT_FileAccess_CRT::Write(const void* pBuffer, size_t szBuffer)
-{
- if (!m_hFile) {
- return 0;
- }
- return FXSYS_fwrite(pBuffer, 1, szBuffer, m_hFile);
-}
-size_t CFXCRT_FileAccess_CRT::ReadPos(void* pBuffer, size_t szBuffer, FX_FILESIZE pos)
-{
- if (!m_hFile) {
- return (FX_FILESIZE) - 1;
- }
- FXSYS_fseek(m_hFile, pos, FXSYS_SEEK_SET);
- return FXSYS_fread(pBuffer, 1, szBuffer, m_hFile);
-}
-size_t CFXCRT_FileAccess_CRT::WritePos(const void* pBuffer, size_t szBuffer, FX_FILESIZE pos)
-{
- if (!m_hFile) {
- return (FX_FILESIZE) - 1;
- }
- FXSYS_fseek(m_hFile, pos, FXSYS_SEEK_SET);
- return FXSYS_fwrite(pBuffer, 1, szBuffer, m_hFile);
-}
-FX_BOOL CFXCRT_FileAccess_CRT::Flush()
-{
- if (!m_hFile) {
- return FALSE;
- }
- return !FXSYS_fflush(m_hFile);
-}
-FX_BOOL CFXCRT_FileAccess_CRT::Truncate(FX_FILESIZE szFile)
-{
- return FALSE;
-}
-FX_BOOL FX_File_Exist(FX_BSTR fileName)
-{
- return access(fileName.GetCStr(), F_OK) > -1;
-}
-FX_BOOL FX_File_Exist(FX_WSTR fileName)
-{
- return FX_File_Exist(FX_UTF8Encode(fileName));
-}
-FX_BOOL FX_File_Delete(FX_BSTR fileName)
-{
- return remove(fileName.GetCStr()) > -1;
-}
-FX_BOOL FX_File_Delete(FX_WSTR fileName)
-{
- return FX_File_Delete(FX_UTF8Encode(fileName));
-}
-FX_BOOL FX_File_Copy(FX_BSTR fileNameSrc, FX_BSTR fileNameDst)
-{
- CFXCRT_FileAccess_CRT src, dst;
- if (!src.Open(fileNameSrc, FX_FILEMODE_ReadOnly)) {
- return FALSE;
- }
- FX_FILESIZE size = src.GetSize();
- if (!size) {
- return FALSE;
- }
- if (!dst.Open(fileNameDst, FX_FILEMODE_Truncate)) {
- return FALSE;
- }
- FX_FILESIZE num = 0;
- FX_LPBYTE pBuffer = FX_Alloc(FX_BYTE, 32768);
- if (!pBuffer) {
- return FALSE;
- }
- while (num = src.Read(pBuffer, 32768)) {
- if (dst.Write(pBuffer, num) != num) {
- break;
- }
- }
- FX_Free(pBuffer);
- return TRUE;
-}
-FX_BOOL FX_File_Copy(FX_WSTR fileNameSrc, FX_WSTR fileNameDst)
-{
- return FX_File_Copy(FX_UTF8Encode(fileNameSrc), FX_UTF8Encode(fileNameDst));
-}
-FX_BOOL FX_File_Move(FX_BSTR fileNameSrc, FX_BSTR fileNameDst)
-{
- return rename(fileNameSrc.GetCStr(), fileNameDst.GetCStr());
-}
-FX_BOOL FX_File_Move(FX_WSTR fileNameSrc, FX_WSTR fileNameDst)
-{
- return FX_File_Move(FX_UTF8Encode(fileNameSrc), FX_UTF8Encode(fileNameDst));
-}
-#endif
+// 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
+
+#include "../../include/fxcrt/fx_ext.h"
+#include "fxcrt_platforms.h"
+#if (_FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ && _FXM_PLATFORM_ != _FXM_PLATFORM_LINUX_ && _FXM_PLATFORM_ != _FXM_PLATFORM_APPLE_ && _FXM_PLATFORM_ != _FXM_PLATFORM_ANDROID_)
+IFXCRT_FileAccess* FXCRT_FileAccess_Create(IFX_Allocator* pAllocator)
+{
+ if (pAllocator) {
+ return FX_NewAtAllocator(pAllocator) CFXCRT_FileAccess_CRT;
+ } else {
+ return FX_NEW CFXCRT_FileAccess_CRT;
+ }
+}
+void FXCRT_GetFileModeString(FX_DWORD dwModes, CFX_ByteString &bsMode)
+{
+ if (dwModes & FX_FILEMODE_ReadOnly) {
+ bsMode = FX_BSTRC("rb");
+ } else if (dwModes & FX_FILEMODE_Truncate) {
+ bsMode = FX_BSTRC("w+b");
+ } else {
+ bsMode = FX_BSTRC("a+b");
+ }
+}
+void FXCRT_GetFileModeString(FX_DWORD dwModes, CFX_WideString &wsMode)
+{
+ if (dwModes & FX_FILEMODE_ReadOnly) {
+ wsMode = FX_WSTRC(L"rb");
+ } else if (dwModes & FX_FILEMODE_Truncate) {
+ wsMode = FX_WSTRC(L"w+b");
+ } else {
+ wsMode = FX_WSTRC(L"a+b");
+ }
+}
+CFXCRT_FileAccess_CRT::CFXCRT_FileAccess_CRT()
+ : m_hFile(NULL)
+{
+}
+CFXCRT_FileAccess_CRT::~CFXCRT_FileAccess_CRT()
+{
+ Close();
+}
+FX_BOOL CFXCRT_FileAccess_CRT::Open(FX_BSTR fileName, FX_DWORD dwMode)
+{
+ if (m_hFile) {
+ return FALSE;
+ }
+ CFX_ByteString strMode;
+ FXCRT_GetFileModeString(dwMode, strMode);
+ m_hFile = FXSYS_fopen(fileName.GetCStr(), (FX_LPCSTR)strMode);
+ return m_hFile != NULL;
+}
+FX_BOOL CFXCRT_FileAccess_CRT::Open(FX_WSTR fileName, FX_DWORD dwMode)
+{
+ if (m_hFile) {
+ return FALSE;
+ }
+ CFX_WideString strMode;
+ FXCRT_GetFileModeString(dwMode, strMode);
+ m_hFile = FXSYS_wfopen(fileName.GetPtr(), (FX_LPCWSTR)strMode);
+ return m_hFile != NULL;
+}
+void CFXCRT_FileAccess_CRT::Close()
+{
+ if (!m_hFile) {
+ return;
+ }
+ FXSYS_fclose(m_hFile);
+ m_hFile = NULL;
+}
+void CFXCRT_FileAccess_CRT::Release(IFX_Allocator* pAllocator)
+{
+ if (pAllocator) {
+ FX_DeleteAtAllocator(this, pAllocator, CFXCRT_FileAccess_CRT);
+ } else {
+ delete this;
+ }
+}
+FX_FILESIZE CFXCRT_FileAccess_CRT::GetSize() const
+{
+ if (!m_hFile) {
+ return 0;
+ }
+ FX_FILESIZE pos = (FX_FILESIZE)FXSYS_ftell(m_hFile);
+ FXSYS_fseek(m_hFile, 0, FXSYS_SEEK_END);
+ FX_FILESIZE size = (FX_FILESIZE)FXSYS_ftell(m_hFile);
+ FXSYS_fseek(m_hFile, pos, FXSYS_SEEK_SET);
+ return size;
+}
+FX_FILESIZE CFXCRT_FileAccess_CRT::GetPosition() const
+{
+ if (!m_hFile) {
+ return (FX_FILESIZE) - 1;
+ }
+ return (FX_FILESIZE)FXSYS_ftell(m_hFile);
+}
+FX_FILESIZE CFXCRT_FileAccess_CRT::SetPosition(FX_FILESIZE pos)
+{
+ if (!m_hFile) {
+ return (FX_FILESIZE) - 1;
+ }
+ FXSYS_fseek(m_hFile, pos, FXSYS_SEEK_SET);
+ return (FX_FILESIZE)FXSYS_ftell(m_hFile);
+}
+size_t CFXCRT_FileAccess_CRT::Read(void* pBuffer, size_t szBuffer)
+{
+ if (!m_hFile) {
+ return 0;
+ }
+ return FXSYS_fread(pBuffer, 1, szBuffer, m_hFile);
+}
+size_t CFXCRT_FileAccess_CRT::Write(const void* pBuffer, size_t szBuffer)
+{
+ if (!m_hFile) {
+ return 0;
+ }
+ return FXSYS_fwrite(pBuffer, 1, szBuffer, m_hFile);
+}
+size_t CFXCRT_FileAccess_CRT::ReadPos(void* pBuffer, size_t szBuffer, FX_FILESIZE pos)
+{
+ if (!m_hFile) {
+ return (FX_FILESIZE) - 1;
+ }
+ FXSYS_fseek(m_hFile, pos, FXSYS_SEEK_SET);
+ return FXSYS_fread(pBuffer, 1, szBuffer, m_hFile);
+}
+size_t CFXCRT_FileAccess_CRT::WritePos(const void* pBuffer, size_t szBuffer, FX_FILESIZE pos)
+{
+ if (!m_hFile) {
+ return (FX_FILESIZE) - 1;
+ }
+ FXSYS_fseek(m_hFile, pos, FXSYS_SEEK_SET);
+ return FXSYS_fwrite(pBuffer, 1, szBuffer, m_hFile);
+}
+FX_BOOL CFXCRT_FileAccess_CRT::Flush()
+{
+ if (!m_hFile) {
+ return FALSE;
+ }
+ return !FXSYS_fflush(m_hFile);
+}
+FX_BOOL CFXCRT_FileAccess_CRT::Truncate(FX_FILESIZE szFile)
+{
+ return FALSE;
+}
+FX_BOOL FX_File_Exist(FX_BSTR fileName)
+{
+ return access(fileName.GetCStr(), F_OK) > -1;
+}
+FX_BOOL FX_File_Exist(FX_WSTR fileName)
+{
+ return FX_File_Exist(FX_UTF8Encode(fileName));
+}
+FX_BOOL FX_File_Delete(FX_BSTR fileName)
+{
+ return remove(fileName.GetCStr()) > -1;
+}
+FX_BOOL FX_File_Delete(FX_WSTR fileName)
+{
+ return FX_File_Delete(FX_UTF8Encode(fileName));
+}
+FX_BOOL FX_File_Copy(FX_BSTR fileNameSrc, FX_BSTR fileNameDst)
+{
+ CFXCRT_FileAccess_CRT src, dst;
+ if (!src.Open(fileNameSrc, FX_FILEMODE_ReadOnly)) {
+ return FALSE;
+ }
+ FX_FILESIZE size = src.GetSize();
+ if (!size) {
+ return FALSE;
+ }
+ if (!dst.Open(fileNameDst, FX_FILEMODE_Truncate)) {
+ return FALSE;
+ }
+ FX_FILESIZE num = 0;
+ FX_LPBYTE pBuffer = FX_Alloc(FX_BYTE, 32768);
+ if (!pBuffer) {
+ return FALSE;
+ }
+ while (num = src.Read(pBuffer, 32768)) {
+ if (dst.Write(pBuffer, num) != num) {
+ break;
+ }
+ }
+ FX_Free(pBuffer);
+ return TRUE;
+}
+FX_BOOL FX_File_Copy(FX_WSTR fileNameSrc, FX_WSTR fileNameDst)
+{
+ return FX_File_Copy(FX_UTF8Encode(fileNameSrc), FX_UTF8Encode(fileNameDst));
+}
+FX_BOOL FX_File_Move(FX_BSTR fileNameSrc, FX_BSTR fileNameDst)
+{
+ return rename(fileNameSrc.GetCStr(), fileNameDst.GetCStr());
+}
+FX_BOOL FX_File_Move(FX_WSTR fileNameSrc, FX_WSTR fileNameDst)
+{
+ return FX_File_Move(FX_UTF8Encode(fileNameSrc), FX_UTF8Encode(fileNameDst));
+}
+#endif
diff --git a/core/src/fxcrt/fxcrt_platforms.h b/core/src/fxcrt/fxcrt_platforms.h
index 633b888fe7..4cb839961d 100644
--- a/core/src/fxcrt/fxcrt_platforms.h
+++ b/core/src/fxcrt/fxcrt_platforms.h
@@ -1,35 +1,35 @@
-// 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 _FXCRT_PLATFORMS_
-#define _FXCRT_PLATFORMS_
-#include "extension.h"
-#if _FX_OS_ == _FX_ANDROID_
-void FXCRT_GetFileModeString(FX_DWORD dwModes, CFX_ByteString &bsMode);
-void FXCRT_GetFileModeString(FX_DWORD dwModes, CFX_WideString &wsMode);
-class CFXCRT_FileAccess_CRT : public IFXCRT_FileAccess, public CFX_Object
-{
-public:
- CFXCRT_FileAccess_CRT();
- virtual ~CFXCRT_FileAccess_CRT();
- virtual FX_BOOL Open(FX_BSTR fileName, FX_DWORD dwMode);
- virtual FX_BOOL Open(FX_WSTR fileName, FX_DWORD dwMode);
- virtual void Close();
- virtual void Release(IFX_Allocator* pAllocator = NULL);
- virtual FX_FILESIZE GetSize() const;
- virtual FX_FILESIZE GetPosition() const;
- virtual FX_FILESIZE SetPosition(FX_FILESIZE pos);
- virtual size_t Read(void* pBuffer, size_t szBuffer);
- virtual size_t Write(const void* pBuffer, size_t szBuffer);
- virtual size_t ReadPos(void* pBuffer, size_t szBuffer, FX_FILESIZE pos);
- virtual size_t WritePos(const void* pBuffer, size_t szBuffer, FX_FILESIZE pos);
- virtual FX_BOOL Flush();
- virtual FX_BOOL Truncate(FX_FILESIZE szFile);
-protected:
- FXSYS_FILE* m_hFile;
-};
-#endif
-#endif
+// 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 _FXCRT_PLATFORMS_
+#define _FXCRT_PLATFORMS_
+#include "extension.h"
+#if _FX_OS_ == _FX_ANDROID_
+void FXCRT_GetFileModeString(FX_DWORD dwModes, CFX_ByteString &bsMode);
+void FXCRT_GetFileModeString(FX_DWORD dwModes, CFX_WideString &wsMode);
+class CFXCRT_FileAccess_CRT : public IFXCRT_FileAccess, public CFX_Object
+{
+public:
+ CFXCRT_FileAccess_CRT();
+ virtual ~CFXCRT_FileAccess_CRT();
+ virtual FX_BOOL Open(FX_BSTR fileName, FX_DWORD dwMode);
+ virtual FX_BOOL Open(FX_WSTR fileName, FX_DWORD dwMode);
+ virtual void Close();
+ virtual void Release(IFX_Allocator* pAllocator = NULL);
+ virtual FX_FILESIZE GetSize() const;
+ virtual FX_FILESIZE GetPosition() const;
+ virtual FX_FILESIZE SetPosition(FX_FILESIZE pos);
+ virtual size_t Read(void* pBuffer, size_t szBuffer);
+ virtual size_t Write(const void* pBuffer, size_t szBuffer);
+ virtual size_t ReadPos(void* pBuffer, size_t szBuffer, FX_FILESIZE pos);
+ virtual size_t WritePos(const void* pBuffer, size_t szBuffer, FX_FILESIZE pos);
+ virtual FX_BOOL Flush();
+ virtual FX_BOOL Truncate(FX_FILESIZE szFile);
+protected:
+ FXSYS_FILE* m_hFile;
+};
+#endif
+#endif
diff --git a/core/src/fxcrt/fxcrt_posix.cpp b/core/src/fxcrt/fxcrt_posix.cpp
index 6752e0a117..558f33466b 100644
--- a/core/src/fxcrt/fxcrt_posix.cpp
+++ b/core/src/fxcrt/fxcrt_posix.cpp
@@ -1,201 +1,201 @@
-// 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
-
-#include "../../include/fxcrt/fx_ext.h"
-#include "fxcrt_posix.h"
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_LINUX_ || _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ || _FXM_PLATFORM_ == _FXM_PLATFORM_ANDROID_
-IFXCRT_FileAccess* FXCRT_FileAccess_Create(IFX_Allocator* pAllocator)
-{
- if (pAllocator) {
- return FX_NewAtAllocator(pAllocator) CFXCRT_FileAccess_Posix();
- } else {
- return FX_NEW CFXCRT_FileAccess_Posix;
- }
-}
-void FXCRT_Posix_GetFileMode(FX_DWORD dwModes, FX_INT32 &nFlags, FX_INT32 &nMasks)
-{
- nFlags = O_BINARY | O_LARGEFILE;
- if (dwModes & FX_FILEMODE_ReadOnly) {
- nFlags |= O_RDONLY;
- nMasks = 0;
- } else {
- nFlags |= O_RDWR | O_CREAT;
- if (dwModes & FX_FILEMODE_Truncate) {
- nFlags |= O_TRUNC;
- }
- nMasks = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH;
- }
-}
-CFXCRT_FileAccess_Posix::CFXCRT_FileAccess_Posix()
- : m_nFD(-1)
-{
-}
-CFXCRT_FileAccess_Posix::~CFXCRT_FileAccess_Posix()
-{
- Close();
-}
-FX_BOOL CFXCRT_FileAccess_Posix::Open(FX_BSTR fileName, FX_DWORD dwMode)
-{
- if (m_nFD > -1) {
- return FALSE;
- }
- FX_INT32 nFlags, nMasks;
- FXCRT_Posix_GetFileMode(dwMode, nFlags, nMasks);
- m_nFD = open(fileName.GetCStr(), nFlags, nMasks);
- return m_nFD > -1;
-}
-FX_BOOL CFXCRT_FileAccess_Posix::Open(FX_WSTR fileName, FX_DWORD dwMode)
-{
- return Open(FX_UTF8Encode(fileName), dwMode);
-}
-void CFXCRT_FileAccess_Posix::Close()
-{
- if (m_nFD < 0) {
- return;
- }
- close(m_nFD);
- m_nFD = -1;
-}
-void CFXCRT_FileAccess_Posix::Release(IFX_Allocator* pAllocator)
-{
- if (pAllocator) {
- FX_DeleteAtAllocator(this, pAllocator, CFXCRT_FileAccess_Posix);
- } else {
- delete this;
- }
-}
-FX_FILESIZE CFXCRT_FileAccess_Posix::GetSize() const
-{
- if (m_nFD < 0) {
- return 0;
- }
- struct stat s;
- FXSYS_memset32(&s, 0, sizeof(s));
- fstat(m_nFD, &s);
- return s.st_size;
-}
-FX_FILESIZE CFXCRT_FileAccess_Posix::GetPosition() const
-{
- if (m_nFD < 0) {
- return (FX_FILESIZE) - 1;
- }
- return lseek(m_nFD, 0, SEEK_CUR);
-}
-FX_FILESIZE CFXCRT_FileAccess_Posix::SetPosition(FX_FILESIZE pos)
-{
- if (m_nFD < 0) {
- return (FX_FILESIZE) - 1;
- }
- return lseek(m_nFD, pos, SEEK_SET);
-}
-size_t CFXCRT_FileAccess_Posix::Read(void* pBuffer, size_t szBuffer)
-{
- if (m_nFD < 0) {
- return 0;
- }
- return read(m_nFD, pBuffer, szBuffer);
-}
-size_t CFXCRT_FileAccess_Posix::Write(const void* pBuffer, size_t szBuffer)
-{
- if (m_nFD < 0) {
- return 0;
- }
- return write(m_nFD, pBuffer, szBuffer);
-}
-size_t CFXCRT_FileAccess_Posix::ReadPos(void* pBuffer, size_t szBuffer, FX_FILESIZE pos)
-{
- if (m_nFD < 0) {
- return 0;
- }
- if (pos >= GetSize()) {
- return 0;
- }
- if (SetPosition(pos) == (FX_FILESIZE) - 1) {
- return 0;
- }
- return Read(pBuffer, szBuffer);
-}
-size_t CFXCRT_FileAccess_Posix::WritePos(const void* pBuffer, size_t szBuffer, FX_FILESIZE pos)
-{
- if (m_nFD < 0) {
- return 0;
- }
- if (SetPosition(pos) == (FX_FILESIZE) - 1) {
- return 0;
- }
- return Write(pBuffer, szBuffer);
-}
-FX_BOOL CFXCRT_FileAccess_Posix::Flush()
-{
- if (m_nFD < 0) {
- return FALSE;
- }
- return fsync(m_nFD) > -1;
-}
-FX_BOOL CFXCRT_FileAccess_Posix::Truncate(FX_FILESIZE szFile)
-{
- if (m_nFD < 0) {
- return FALSE;
- }
- return !ftruncate(m_nFD, szFile);
-}
-FX_BOOL FX_File_Exist(FX_BSTR fileName)
-{
- return access(fileName.GetCStr(), F_OK) > -1;
-}
-FX_BOOL FX_File_Exist(FX_WSTR fileName)
-{
- return FX_File_Exist(FX_UTF8Encode(fileName));
-}
-FX_BOOL FX_File_Delete(FX_BSTR fileName)
-{
- return remove(fileName.GetCStr()) > -1;
-}
-FX_BOOL FX_File_Delete(FX_WSTR fileName)
-{
- return FX_File_Delete(FX_UTF8Encode(fileName));
-}
-FX_BOOL FX_File_Copy(FX_BSTR fileNameSrc, FX_BSTR fileNameDst)
-{
- CFXCRT_FileAccess_Posix src, dst;
- if (!src.Open(fileNameSrc, FX_FILEMODE_ReadOnly)) {
- return FALSE;
- }
- FX_FILESIZE size = src.GetSize();
- if (!size) {
- return FALSE;
- }
- if (!dst.Open(fileNameDst, FX_FILEMODE_Truncate)) {
- return FALSE;
- }
- size_t num = 0;
- FX_LPBYTE pBuffer = FX_Alloc(FX_BYTE, 32768);
- if (!pBuffer) {
- return FALSE;
- }
- num = src.Read(pBuffer, 32768);
- while (num) {
- if (dst.Write(pBuffer, num) != num) {
- break;
- }
- num = src.Read(pBuffer, 32768);
- }
- FX_Free(pBuffer);
- return TRUE;
-}
-FX_BOOL FX_File_Copy(FX_WSTR fileNameSrc, FX_WSTR fileNameDst)
-{
- return FX_File_Copy(FX_UTF8Encode(fileNameSrc), FX_UTF8Encode(fileNameDst));
-}
-FX_BOOL FX_File_Move(FX_BSTR fileNameSrc, FX_BSTR fileNameDst)
-{
- return rename(fileNameSrc.GetCStr(), fileNameDst.GetCStr());
-}
-FX_BOOL FX_File_Move(FX_WSTR fileNameSrc, FX_WSTR fileNameDst)
-{
- return FX_File_Move(FX_UTF8Encode(fileNameSrc), FX_UTF8Encode(fileNameDst));
-}
-#endif
+// 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
+
+#include "../../include/fxcrt/fx_ext.h"
+#include "fxcrt_posix.h"
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_LINUX_ || _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ || _FXM_PLATFORM_ == _FXM_PLATFORM_ANDROID_
+IFXCRT_FileAccess* FXCRT_FileAccess_Create(IFX_Allocator* pAllocator)
+{
+ if (pAllocator) {
+ return FX_NewAtAllocator(pAllocator) CFXCRT_FileAccess_Posix();
+ } else {
+ return FX_NEW CFXCRT_FileAccess_Posix;
+ }
+}
+void FXCRT_Posix_GetFileMode(FX_DWORD dwModes, FX_INT32 &nFlags, FX_INT32 &nMasks)
+{
+ nFlags = O_BINARY | O_LARGEFILE;
+ if (dwModes & FX_FILEMODE_ReadOnly) {
+ nFlags |= O_RDONLY;
+ nMasks = 0;
+ } else {
+ nFlags |= O_RDWR | O_CREAT;
+ if (dwModes & FX_FILEMODE_Truncate) {
+ nFlags |= O_TRUNC;
+ }
+ nMasks = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH;
+ }
+}
+CFXCRT_FileAccess_Posix::CFXCRT_FileAccess_Posix()
+ : m_nFD(-1)
+{
+}
+CFXCRT_FileAccess_Posix::~CFXCRT_FileAccess_Posix()
+{
+ Close();
+}
+FX_BOOL CFXCRT_FileAccess_Posix::Open(FX_BSTR fileName, FX_DWORD dwMode)
+{
+ if (m_nFD > -1) {
+ return FALSE;
+ }
+ FX_INT32 nFlags, nMasks;
+ FXCRT_Posix_GetFileMode(dwMode, nFlags, nMasks);
+ m_nFD = open(fileName.GetCStr(), nFlags, nMasks);
+ return m_nFD > -1;
+}
+FX_BOOL CFXCRT_FileAccess_Posix::Open(FX_WSTR fileName, FX_DWORD dwMode)
+{
+ return Open(FX_UTF8Encode(fileName), dwMode);
+}
+void CFXCRT_FileAccess_Posix::Close()
+{
+ if (m_nFD < 0) {
+ return;
+ }
+ close(m_nFD);
+ m_nFD = -1;
+}
+void CFXCRT_FileAccess_Posix::Release(IFX_Allocator* pAllocator)
+{
+ if (pAllocator) {
+ FX_DeleteAtAllocator(this, pAllocator, CFXCRT_FileAccess_Posix);
+ } else {
+ delete this;
+ }
+}
+FX_FILESIZE CFXCRT_FileAccess_Posix::GetSize() const
+{
+ if (m_nFD < 0) {
+ return 0;
+ }
+ struct stat s;
+ FXSYS_memset32(&s, 0, sizeof(s));
+ fstat(m_nFD, &s);
+ return s.st_size;
+}
+FX_FILESIZE CFXCRT_FileAccess_Posix::GetPosition() const
+{
+ if (m_nFD < 0) {
+ return (FX_FILESIZE) - 1;
+ }
+ return lseek(m_nFD, 0, SEEK_CUR);
+}
+FX_FILESIZE CFXCRT_FileAccess_Posix::SetPosition(FX_FILESIZE pos)
+{
+ if (m_nFD < 0) {
+ return (FX_FILESIZE) - 1;
+ }
+ return lseek(m_nFD, pos, SEEK_SET);
+}
+size_t CFXCRT_FileAccess_Posix::Read(void* pBuffer, size_t szBuffer)
+{
+ if (m_nFD < 0) {
+ return 0;
+ }
+ return read(m_nFD, pBuffer, szBuffer);
+}
+size_t CFXCRT_FileAccess_Posix::Write(const void* pBuffer, size_t szBuffer)
+{
+ if (m_nFD < 0) {
+ return 0;
+ }
+ return write(m_nFD, pBuffer, szBuffer);
+}
+size_t CFXCRT_FileAccess_Posix::ReadPos(void* pBuffer, size_t szBuffer, FX_FILESIZE pos)
+{
+ if (m_nFD < 0) {
+ return 0;
+ }
+ if (pos >= GetSize()) {
+ return 0;
+ }
+ if (SetPosition(pos) == (FX_FILESIZE) - 1) {
+ return 0;
+ }
+ return Read(pBuffer, szBuffer);
+}
+size_t CFXCRT_FileAccess_Posix::WritePos(const void* pBuffer, size_t szBuffer, FX_FILESIZE pos)
+{
+ if (m_nFD < 0) {
+ return 0;
+ }
+ if (SetPosition(pos) == (FX_FILESIZE) - 1) {
+ return 0;
+ }
+ return Write(pBuffer, szBuffer);
+}
+FX_BOOL CFXCRT_FileAccess_Posix::Flush()
+{
+ if (m_nFD < 0) {
+ return FALSE;
+ }
+ return fsync(m_nFD) > -1;
+}
+FX_BOOL CFXCRT_FileAccess_Posix::Truncate(FX_FILESIZE szFile)
+{
+ if (m_nFD < 0) {
+ return FALSE;
+ }
+ return !ftruncate(m_nFD, szFile);
+}
+FX_BOOL FX_File_Exist(FX_BSTR fileName)
+{
+ return access(fileName.GetCStr(), F_OK) > -1;
+}
+FX_BOOL FX_File_Exist(FX_WSTR fileName)
+{
+ return FX_File_Exist(FX_UTF8Encode(fileName));
+}
+FX_BOOL FX_File_Delete(FX_BSTR fileName)
+{
+ return remove(fileName.GetCStr()) > -1;
+}
+FX_BOOL FX_File_Delete(FX_WSTR fileName)
+{
+ return FX_File_Delete(FX_UTF8Encode(fileName));
+}
+FX_BOOL FX_File_Copy(FX_BSTR fileNameSrc, FX_BSTR fileNameDst)
+{
+ CFXCRT_FileAccess_Posix src, dst;
+ if (!src.Open(fileNameSrc, FX_FILEMODE_ReadOnly)) {
+ return FALSE;
+ }
+ FX_FILESIZE size = src.GetSize();
+ if (!size) {
+ return FALSE;
+ }
+ if (!dst.Open(fileNameDst, FX_FILEMODE_Truncate)) {
+ return FALSE;
+ }
+ size_t num = 0;
+ FX_LPBYTE pBuffer = FX_Alloc(FX_BYTE, 32768);
+ if (!pBuffer) {
+ return FALSE;
+ }
+ num = src.Read(pBuffer, 32768);
+ while (num) {
+ if (dst.Write(pBuffer, num) != num) {
+ break;
+ }
+ num = src.Read(pBuffer, 32768);
+ }
+ FX_Free(pBuffer);
+ return TRUE;
+}
+FX_BOOL FX_File_Copy(FX_WSTR fileNameSrc, FX_WSTR fileNameDst)
+{
+ return FX_File_Copy(FX_UTF8Encode(fileNameSrc), FX_UTF8Encode(fileNameDst));
+}
+FX_BOOL FX_File_Move(FX_BSTR fileNameSrc, FX_BSTR fileNameDst)
+{
+ return rename(fileNameSrc.GetCStr(), fileNameDst.GetCStr());
+}
+FX_BOOL FX_File_Move(FX_WSTR fileNameSrc, FX_WSTR fileNameDst)
+{
+ return FX_File_Move(FX_UTF8Encode(fileNameSrc), FX_UTF8Encode(fileNameDst));
+}
+#endif
diff --git a/core/src/fxcrt/fxcrt_posix.h b/core/src/fxcrt/fxcrt_posix.h
index 29c84adb1f..f76e35cdd1 100644
--- a/core/src/fxcrt/fxcrt_posix.h
+++ b/core/src/fxcrt/fxcrt_posix.h
@@ -1,33 +1,33 @@
-// 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 _FXCRT_LINUX_
-#define _FXCRT_LINUX_
-#include "extension.h"
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_LINUX_ || _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ || _FXM_PLATFORM_ == _FXM_PLATFORM_ANDROID_
-class CFXCRT_FileAccess_Posix : public IFXCRT_FileAccess, public CFX_Object
-{
-public:
- CFXCRT_FileAccess_Posix();
- virtual ~CFXCRT_FileAccess_Posix();
- virtual FX_BOOL Open(FX_BSTR fileName, FX_DWORD dwMode);
- virtual FX_BOOL Open(FX_WSTR fileName, FX_DWORD dwMode);
- virtual void Close();
- virtual void Release(IFX_Allocator* pAllocator = NULL);
- virtual FX_FILESIZE GetSize() const;
- virtual FX_FILESIZE GetPosition() const;
- virtual FX_FILESIZE SetPosition(FX_FILESIZE pos);
- virtual size_t Read(void* pBuffer, size_t szBuffer);
- virtual size_t Write(const void* pBuffer, size_t szBuffer);
- virtual size_t ReadPos(void* pBuffer, size_t szBuffer, FX_FILESIZE pos);
- virtual size_t WritePos(const void* pBuffer, size_t szBuffer, FX_FILESIZE pos);
- virtual FX_BOOL Flush();
- virtual FX_BOOL Truncate(FX_FILESIZE szFile);
-protected:
- FX_INT32 m_nFD;
-};
-#endif
-#endif
+// 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 _FXCRT_LINUX_
+#define _FXCRT_LINUX_
+#include "extension.h"
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_LINUX_ || _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ || _FXM_PLATFORM_ == _FXM_PLATFORM_ANDROID_
+class CFXCRT_FileAccess_Posix : public IFXCRT_FileAccess, public CFX_Object
+{
+public:
+ CFXCRT_FileAccess_Posix();
+ virtual ~CFXCRT_FileAccess_Posix();
+ virtual FX_BOOL Open(FX_BSTR fileName, FX_DWORD dwMode);
+ virtual FX_BOOL Open(FX_WSTR fileName, FX_DWORD dwMode);
+ virtual void Close();
+ virtual void Release(IFX_Allocator* pAllocator = NULL);
+ virtual FX_FILESIZE GetSize() const;
+ virtual FX_FILESIZE GetPosition() const;
+ virtual FX_FILESIZE SetPosition(FX_FILESIZE pos);
+ virtual size_t Read(void* pBuffer, size_t szBuffer);
+ virtual size_t Write(const void* pBuffer, size_t szBuffer);
+ virtual size_t ReadPos(void* pBuffer, size_t szBuffer, FX_FILESIZE pos);
+ virtual size_t WritePos(const void* pBuffer, size_t szBuffer, FX_FILESIZE pos);
+ virtual FX_BOOL Flush();
+ virtual FX_BOOL Truncate(FX_FILESIZE szFile);
+protected:
+ FX_INT32 m_nFD;
+};
+#endif
+#endif
diff --git a/core/src/fxcrt/fxcrt_windows.cpp b/core/src/fxcrt/fxcrt_windows.cpp
index e03bfda354..9b77b33ca2 100644
--- a/core/src/fxcrt/fxcrt_windows.cpp
+++ b/core/src/fxcrt/fxcrt_windows.cpp
@@ -1,222 +1,222 @@
-// 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
-
-#include "../../include/fxcrt/fx_ext.h"
-#include "fxcrt_windows.h"
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
-FX_BOOL FX_File_Exist(FX_BSTR fileName)
-{
- FX_DWORD dwAttri = ::GetFileAttributesA(fileName.GetCStr());
- if (dwAttri == -1) {
- return FALSE;
- }
- return (dwAttri & FILE_ATTRIBUTE_DIRECTORY) == 0;
-}
-FX_BOOL FX_File_Exist(FX_WSTR fileName)
-{
- FX_DWORD dwAttri = ::GetFileAttributesW((LPCWSTR)fileName.GetPtr());
- if (dwAttri == -1) {
- return FALSE;
- }
- return (dwAttri & FILE_ATTRIBUTE_DIRECTORY) == 0;
-}
-IFXCRT_FileAccess* FXCRT_FileAccess_Create(IFX_Allocator* pAllocator)
-{
- if (pAllocator) {
- return FX_NewAtAllocator(pAllocator) CFXCRT_FileAccess_Win64;
- } else {
- return FX_NEW CFXCRT_FileAccess_Win64;
- }
-}
-void FXCRT_Windows_GetFileMode(FX_DWORD dwMode, FX_DWORD &dwAccess, FX_DWORD &dwShare, FX_DWORD &dwCreation)
-{
- dwAccess = GENERIC_READ;
- dwShare = FILE_SHARE_READ | FILE_SHARE_WRITE;
- if (!(dwMode & FX_FILEMODE_ReadOnly)) {
- dwAccess |= GENERIC_WRITE;
- dwCreation = (dwMode & FX_FILEMODE_Truncate) ? CREATE_ALWAYS : OPEN_ALWAYS;
- } else {
- dwCreation = OPEN_EXISTING;
- }
-}
-#ifdef __cplusplus
-extern "C" {
-#endif
-WINBASEAPI BOOL WINAPI GetFileSizeEx(HANDLE hFile, PLARGE_INTEGER lpFileSize);
-WINBASEAPI BOOL WINAPI SetFilePointerEx(HANDLE hFile, LARGE_INTEGER liDistanceToMove, PLARGE_INTEGER lpNewFilePointer, DWORD dwMoveMethod);
-#ifdef __cplusplus
-}
-#endif
-CFXCRT_FileAccess_Win64::CFXCRT_FileAccess_Win64()
- : m_hFile(NULL)
-{
-}
-CFXCRT_FileAccess_Win64::~CFXCRT_FileAccess_Win64()
-{
- Close();
-}
-FX_BOOL CFXCRT_FileAccess_Win64::Open(FX_BSTR fileName, FX_DWORD dwMode)
-{
- if (m_hFile) {
- return FALSE;
- }
- FX_DWORD dwAccess, dwShare, dwCreation;
- FXCRT_Windows_GetFileMode(dwMode, dwAccess, dwShare, dwCreation);
- m_hFile = ::CreateFileA(fileName.GetCStr(), dwAccess, dwShare, NULL, dwCreation, FILE_ATTRIBUTE_NORMAL, NULL);
- if (m_hFile == INVALID_HANDLE_VALUE) {
- m_hFile = NULL;
- }
- return m_hFile != NULL;
-}
-FX_BOOL CFXCRT_FileAccess_Win64::Open(FX_WSTR fileName, FX_DWORD dwMode)
-{
- if (m_hFile) {
- return FALSE;
- }
- FX_DWORD dwAccess, dwShare, dwCreation;
- FXCRT_Windows_GetFileMode(dwMode, dwAccess, dwShare, dwCreation);
- m_hFile = ::CreateFileW((LPCWSTR)fileName.GetPtr(), dwAccess, dwShare, NULL, dwCreation, FILE_ATTRIBUTE_NORMAL, NULL);
- if (m_hFile == INVALID_HANDLE_VALUE) {
- m_hFile = NULL;
- }
- return m_hFile != NULL;
-}
-void CFXCRT_FileAccess_Win64::Close()
-{
- if (!m_hFile) {
- return;
- }
- ::CloseHandle(m_hFile);
- m_hFile = NULL;
-}
-void CFXCRT_FileAccess_Win64::Release(IFX_Allocator* pAllocator)
-{
- if (pAllocator) {
- FX_DeleteAtAllocator(this, pAllocator, CFXCRT_FileAccess_Win64);
- } else {
- delete this;
- }
-}
-FX_FILESIZE CFXCRT_FileAccess_Win64::GetSize() const
-{
- if (!m_hFile) {
- return 0;
- }
- LARGE_INTEGER size = {0, 0};
- if (!::GetFileSizeEx(m_hFile, &size)) {
- return 0;
- }
- return (FX_FILESIZE)size.QuadPart;
-}
-FX_FILESIZE CFXCRT_FileAccess_Win64::GetPosition() const
-{
- if (!m_hFile) {
- return (FX_FILESIZE) - 1;
- }
- LARGE_INTEGER dist = {0, 0};
- LARGE_INTEGER newPos = {0, 0};
- if (!::SetFilePointerEx(m_hFile, dist, &newPos, FILE_CURRENT)) {
- return (FX_FILESIZE) - 1;
- }
- return (FX_FILESIZE)newPos.QuadPart;
-}
-FX_FILESIZE CFXCRT_FileAccess_Win64::SetPosition(FX_FILESIZE pos)
-{
- if (!m_hFile) {
- return (FX_FILESIZE) - 1;
- }
- LARGE_INTEGER dist;
- dist.QuadPart = pos;
- LARGE_INTEGER newPos = {0, 0};
- if (!::SetFilePointerEx(m_hFile, dist, &newPos, FILE_BEGIN)) {
- return (FX_FILESIZE) - 1;
- }
- return (FX_FILESIZE)newPos.QuadPart;
-}
-size_t CFXCRT_FileAccess_Win64::Read(void* pBuffer, size_t szBuffer)
-{
- if (!m_hFile) {
- return 0;
- }
- size_t szRead = 0;
- if (!::ReadFile(m_hFile, pBuffer, (DWORD)szBuffer, (LPDWORD)&szRead, NULL)) {
- return 0;
- }
- return szRead;
-}
-size_t CFXCRT_FileAccess_Win64::Write(const void* pBuffer, size_t szBuffer)
-{
- if (!m_hFile) {
- return 0;
- }
- size_t szWrite = 0;
- if (!::WriteFile(m_hFile, pBuffer, (DWORD)szBuffer, (LPDWORD)&szWrite, NULL)) {
- return 0;
- }
- return szWrite;
-}
-size_t CFXCRT_FileAccess_Win64::ReadPos(void* pBuffer, size_t szBuffer, FX_FILESIZE pos)
-{
- if (!m_hFile) {
- return 0;
- }
- if (pos >= GetSize()) {
- return 0;
- }
- if (SetPosition(pos) == (FX_FILESIZE) - 1) {
- return 0;
- }
- return Read(pBuffer, szBuffer);
-}
-size_t CFXCRT_FileAccess_Win64::WritePos(const void* pBuffer, size_t szBuffer, FX_FILESIZE pos)
-{
- if (!m_hFile) {
- return 0;
- }
- if (SetPosition(pos) == (FX_FILESIZE) - 1) {
- return 0;
- }
- return Write(pBuffer, szBuffer);
-}
-FX_BOOL CFXCRT_FileAccess_Win64::Flush()
-{
- if (!m_hFile) {
- return FALSE;
- }
- return ::FlushFileBuffers(m_hFile);
-}
-FX_BOOL CFXCRT_FileAccess_Win64::Truncate(FX_FILESIZE szFile)
-{
- if (SetPosition(szFile) == (FX_FILESIZE) - 1) {
- return FALSE;
- }
- return ::SetEndOfFile(m_hFile);
-}
-FX_BOOL FX_File_Delete(FX_BSTR fileName)
-{
- return ::DeleteFileA(fileName.GetCStr());
-}
-FX_BOOL FX_File_Delete(FX_WSTR fileName)
-{
- return ::DeleteFileW((LPCWSTR)fileName.GetPtr());
-}
-FX_BOOL FX_File_Copy(FX_BSTR fileNameSrc, FX_BSTR fileNameDst)
-{
- return ::CopyFileA(fileNameSrc.GetCStr(), fileNameDst.GetCStr(), FALSE);
-}
-FX_BOOL FX_File_Copy(FX_WSTR fileNameSrc, FX_WSTR fileNameDst)
-{
- return ::CopyFileW((LPCWSTR)fileNameSrc.GetPtr(), (LPCWSTR)fileNameDst.GetPtr(), FALSE);
-}
-FX_BOOL FX_File_Move(FX_BSTR fileNameSrc, FX_BSTR fileNameDst)
-{
- return ::MoveFileA(fileNameSrc.GetCStr(), fileNameDst.GetCStr());
-}
-FX_BOOL FX_File_Move(FX_WSTR fileNameSrc, FX_WSTR fileNameDst)
-{
- return ::MoveFileW((LPCWSTR)fileNameSrc.GetPtr(), (LPCWSTR)fileNameDst.GetPtr());
-}
-#endif
+// 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
+
+#include "../../include/fxcrt/fx_ext.h"
+#include "fxcrt_windows.h"
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
+FX_BOOL FX_File_Exist(FX_BSTR fileName)
+{
+ FX_DWORD dwAttri = ::GetFileAttributesA(fileName.GetCStr());
+ if (dwAttri == -1) {
+ return FALSE;
+ }
+ return (dwAttri & FILE_ATTRIBUTE_DIRECTORY) == 0;
+}
+FX_BOOL FX_File_Exist(FX_WSTR fileName)
+{
+ FX_DWORD dwAttri = ::GetFileAttributesW((LPCWSTR)fileName.GetPtr());
+ if (dwAttri == -1) {
+ return FALSE;
+ }
+ return (dwAttri & FILE_ATTRIBUTE_DIRECTORY) == 0;
+}
+IFXCRT_FileAccess* FXCRT_FileAccess_Create(IFX_Allocator* pAllocator)
+{
+ if (pAllocator) {
+ return FX_NewAtAllocator(pAllocator) CFXCRT_FileAccess_Win64;
+ } else {
+ return FX_NEW CFXCRT_FileAccess_Win64;
+ }
+}
+void FXCRT_Windows_GetFileMode(FX_DWORD dwMode, FX_DWORD &dwAccess, FX_DWORD &dwShare, FX_DWORD &dwCreation)
+{
+ dwAccess = GENERIC_READ;
+ dwShare = FILE_SHARE_READ | FILE_SHARE_WRITE;
+ if (!(dwMode & FX_FILEMODE_ReadOnly)) {
+ dwAccess |= GENERIC_WRITE;
+ dwCreation = (dwMode & FX_FILEMODE_Truncate) ? CREATE_ALWAYS : OPEN_ALWAYS;
+ } else {
+ dwCreation = OPEN_EXISTING;
+ }
+}
+#ifdef __cplusplus
+extern "C" {
+#endif
+WINBASEAPI BOOL WINAPI GetFileSizeEx(HANDLE hFile, PLARGE_INTEGER lpFileSize);
+WINBASEAPI BOOL WINAPI SetFilePointerEx(HANDLE hFile, LARGE_INTEGER liDistanceToMove, PLARGE_INTEGER lpNewFilePointer, DWORD dwMoveMethod);
+#ifdef __cplusplus
+}
+#endif
+CFXCRT_FileAccess_Win64::CFXCRT_FileAccess_Win64()
+ : m_hFile(NULL)
+{
+}
+CFXCRT_FileAccess_Win64::~CFXCRT_FileAccess_Win64()
+{
+ Close();
+}
+FX_BOOL CFXCRT_FileAccess_Win64::Open(FX_BSTR fileName, FX_DWORD dwMode)
+{
+ if (m_hFile) {
+ return FALSE;
+ }
+ FX_DWORD dwAccess, dwShare, dwCreation;
+ FXCRT_Windows_GetFileMode(dwMode, dwAccess, dwShare, dwCreation);
+ m_hFile = ::CreateFileA(fileName.GetCStr(), dwAccess, dwShare, NULL, dwCreation, FILE_ATTRIBUTE_NORMAL, NULL);
+ if (m_hFile == INVALID_HANDLE_VALUE) {
+ m_hFile = NULL;
+ }
+ return m_hFile != NULL;
+}
+FX_BOOL CFXCRT_FileAccess_Win64::Open(FX_WSTR fileName, FX_DWORD dwMode)
+{
+ if (m_hFile) {
+ return FALSE;
+ }
+ FX_DWORD dwAccess, dwShare, dwCreation;
+ FXCRT_Windows_GetFileMode(dwMode, dwAccess, dwShare, dwCreation);
+ m_hFile = ::CreateFileW((LPCWSTR)fileName.GetPtr(), dwAccess, dwShare, NULL, dwCreation, FILE_ATTRIBUTE_NORMAL, NULL);
+ if (m_hFile == INVALID_HANDLE_VALUE) {
+ m_hFile = NULL;
+ }
+ return m_hFile != NULL;
+}
+void CFXCRT_FileAccess_Win64::Close()
+{
+ if (!m_hFile) {
+ return;
+ }
+ ::CloseHandle(m_hFile);
+ m_hFile = NULL;
+}
+void CFXCRT_FileAccess_Win64::Release(IFX_Allocator* pAllocator)
+{
+ if (pAllocator) {
+ FX_DeleteAtAllocator(this, pAllocator, CFXCRT_FileAccess_Win64);
+ } else {
+ delete this;
+ }
+}
+FX_FILESIZE CFXCRT_FileAccess_Win64::GetSize() const
+{
+ if (!m_hFile) {
+ return 0;
+ }
+ LARGE_INTEGER size = {0, 0};
+ if (!::GetFileSizeEx(m_hFile, &size)) {
+ return 0;
+ }
+ return (FX_FILESIZE)size.QuadPart;
+}
+FX_FILESIZE CFXCRT_FileAccess_Win64::GetPosition() const
+{
+ if (!m_hFile) {
+ return (FX_FILESIZE) - 1;
+ }
+ LARGE_INTEGER dist = {0, 0};
+ LARGE_INTEGER newPos = {0, 0};
+ if (!::SetFilePointerEx(m_hFile, dist, &newPos, FILE_CURRENT)) {
+ return (FX_FILESIZE) - 1;
+ }
+ return (FX_FILESIZE)newPos.QuadPart;
+}
+FX_FILESIZE CFXCRT_FileAccess_Win64::SetPosition(FX_FILESIZE pos)
+{
+ if (!m_hFile) {
+ return (FX_FILESIZE) - 1;
+ }
+ LARGE_INTEGER dist;
+ dist.QuadPart = pos;
+ LARGE_INTEGER newPos = {0, 0};
+ if (!::SetFilePointerEx(m_hFile, dist, &newPos, FILE_BEGIN)) {
+ return (FX_FILESIZE) - 1;
+ }
+ return (FX_FILESIZE)newPos.QuadPart;
+}
+size_t CFXCRT_FileAccess_Win64::Read(void* pBuffer, size_t szBuffer)
+{
+ if (!m_hFile) {
+ return 0;
+ }
+ size_t szRead = 0;
+ if (!::ReadFile(m_hFile, pBuffer, (DWORD)szBuffer, (LPDWORD)&szRead, NULL)) {
+ return 0;
+ }
+ return szRead;
+}
+size_t CFXCRT_FileAccess_Win64::Write(const void* pBuffer, size_t szBuffer)
+{
+ if (!m_hFile) {
+ return 0;
+ }
+ size_t szWrite = 0;
+ if (!::WriteFile(m_hFile, pBuffer, (DWORD)szBuffer, (LPDWORD)&szWrite, NULL)) {
+ return 0;
+ }
+ return szWrite;
+}
+size_t CFXCRT_FileAccess_Win64::ReadPos(void* pBuffer, size_t szBuffer, FX_FILESIZE pos)
+{
+ if (!m_hFile) {
+ return 0;
+ }
+ if (pos >= GetSize()) {
+ return 0;
+ }
+ if (SetPosition(pos) == (FX_FILESIZE) - 1) {
+ return 0;
+ }
+ return Read(pBuffer, szBuffer);
+}
+size_t CFXCRT_FileAccess_Win64::WritePos(const void* pBuffer, size_t szBuffer, FX_FILESIZE pos)
+{
+ if (!m_hFile) {
+ return 0;
+ }
+ if (SetPosition(pos) == (FX_FILESIZE) - 1) {
+ return 0;
+ }
+ return Write(pBuffer, szBuffer);
+}
+FX_BOOL CFXCRT_FileAccess_Win64::Flush()
+{
+ if (!m_hFile) {
+ return FALSE;
+ }
+ return ::FlushFileBuffers(m_hFile);
+}
+FX_BOOL CFXCRT_FileAccess_Win64::Truncate(FX_FILESIZE szFile)
+{
+ if (SetPosition(szFile) == (FX_FILESIZE) - 1) {
+ return FALSE;
+ }
+ return ::SetEndOfFile(m_hFile);
+}
+FX_BOOL FX_File_Delete(FX_BSTR fileName)
+{
+ return ::DeleteFileA(fileName.GetCStr());
+}
+FX_BOOL FX_File_Delete(FX_WSTR fileName)
+{
+ return ::DeleteFileW((LPCWSTR)fileName.GetPtr());
+}
+FX_BOOL FX_File_Copy(FX_BSTR fileNameSrc, FX_BSTR fileNameDst)
+{
+ return ::CopyFileA(fileNameSrc.GetCStr(), fileNameDst.GetCStr(), FALSE);
+}
+FX_BOOL FX_File_Copy(FX_WSTR fileNameSrc, FX_WSTR fileNameDst)
+{
+ return ::CopyFileW((LPCWSTR)fileNameSrc.GetPtr(), (LPCWSTR)fileNameDst.GetPtr(), FALSE);
+}
+FX_BOOL FX_File_Move(FX_BSTR fileNameSrc, FX_BSTR fileNameDst)
+{
+ return ::MoveFileA(fileNameSrc.GetCStr(), fileNameDst.GetCStr());
+}
+FX_BOOL FX_File_Move(FX_WSTR fileNameSrc, FX_WSTR fileNameDst)
+{
+ return ::MoveFileW((LPCWSTR)fileNameSrc.GetPtr(), (LPCWSTR)fileNameDst.GetPtr());
+}
+#endif
diff --git a/core/src/fxcrt/fxcrt_windows.h b/core/src/fxcrt/fxcrt_windows.h
index beb684d067..9c2e428782 100644
--- a/core/src/fxcrt/fxcrt_windows.h
+++ b/core/src/fxcrt/fxcrt_windows.h
@@ -1,33 +1,33 @@
-// 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 _FXCRT_WINDOWS_
-#define _FXCRT_WINDOWS_
-#include "extension.h"
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
-class CFXCRT_FileAccess_Win64 : public IFXCRT_FileAccess, public CFX_Object
-{
-public:
- CFXCRT_FileAccess_Win64();
- virtual ~CFXCRT_FileAccess_Win64();
- virtual FX_BOOL Open(FX_BSTR fileName, FX_DWORD dwMode);
- virtual FX_BOOL Open(FX_WSTR fileName, FX_DWORD dwMode);
- virtual void Close();
- virtual void Release(IFX_Allocator* pAllocator = NULL);
- virtual FX_FILESIZE GetSize() const;
- virtual FX_FILESIZE GetPosition() const;
- virtual FX_FILESIZE SetPosition(FX_FILESIZE pos);
- virtual size_t Read(void* pBuffer, size_t szBuffer);
- virtual size_t Write(const void* pBuffer, size_t szBuffer);
- virtual size_t ReadPos(void* pBuffer, size_t szBuffer, FX_FILESIZE pos);
- virtual size_t WritePos(const void* pBuffer, size_t szBuffer, FX_FILESIZE pos);
- virtual FX_BOOL Flush();
- virtual FX_BOOL Truncate(FX_FILESIZE szFile);
-protected:
- FX_LPVOID m_hFile;
-};
-#endif
-#endif
+// 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 _FXCRT_WINDOWS_
+#define _FXCRT_WINDOWS_
+#include "extension.h"
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
+class CFXCRT_FileAccess_Win64 : public IFXCRT_FileAccess, public CFX_Object
+{
+public:
+ CFXCRT_FileAccess_Win64();
+ virtual ~CFXCRT_FileAccess_Win64();
+ virtual FX_BOOL Open(FX_BSTR fileName, FX_DWORD dwMode);
+ virtual FX_BOOL Open(FX_WSTR fileName, FX_DWORD dwMode);
+ virtual void Close();
+ virtual void Release(IFX_Allocator* pAllocator = NULL);
+ virtual FX_FILESIZE GetSize() const;
+ virtual FX_FILESIZE GetPosition() const;
+ virtual FX_FILESIZE SetPosition(FX_FILESIZE pos);
+ virtual size_t Read(void* pBuffer, size_t szBuffer);
+ virtual size_t Write(const void* pBuffer, size_t szBuffer);
+ virtual size_t ReadPos(void* pBuffer, size_t szBuffer, FX_FILESIZE pos);
+ virtual size_t WritePos(const void* pBuffer, size_t szBuffer, FX_FILESIZE pos);
+ virtual FX_BOOL Flush();
+ virtual FX_BOOL Truncate(FX_FILESIZE szFile);
+protected:
+ FX_LPVOID m_hFile;
+};
+#endif
+#endif
diff --git a/core/src/fxcrt/mem_int.h b/core/src/fxcrt/mem_int.h
index da43023bb5..3e3d25a7ec 100644
--- a/core/src/fxcrt/mem_int.h
+++ b/core/src/fxcrt/mem_int.h
@@ -1,232 +1,232 @@
-// 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 _FXM_MEM_INT_H_
-#define _FXM_MEM_INT_H_
-struct FX_DefAllocator {
- IFX_Allocator m_Allocator;
- struct CFX_MemoryMgr* m_pFoxitMgr;
-};
-struct CFX_MemoryMgr {
-public:
- FXMEM_SystemMgr* m_pSystemMgr;
- FX_DefAllocator m_DefAllocator;
- FX_LPVOID m_pExternalMemory;
- FX_BOOL m_bReleaseMgr;
- void Init(FXMEM_SystemMgr* pSystemMgr);
- void* Alloc(size_t size, int flags);
- void* AllocDebug(size_t size, int flags, FX_LPCSTR file, int line);
- void* Realloc(void* p, size_t size, int flags);
- void* ReallocDebug(void* p, size_t size, int flags, FX_LPCSTR file, int line);
- void Free(void* p, int flags);
- void PurgeMgr();
-};
-extern CFX_MemoryMgr* g_pDefFoxitMgr;
-#define FIXEDMEM_PAGE_EXTRASPACE sizeof(size_t)
-#define FIXEDMEM_BLOCKNUM(bs) (8 * (FX_FIXEDMEM_PAGESIZE - FIXEDMEM_PAGE_EXTRASPACE) / (8 * bs + 1))
-#define FIXEDMEM_8BYTES_BLOCKNUM FIXEDMEM_BLOCKNUM(8)
-#define FIXEDMEM_16BYTES_BLOCKNUM FIXEDMEM_BLOCKNUM(16)
-#define FIXEDMEM_32BYTES_BLOCKNUM FIXEDMEM_BLOCKNUM(32)
-extern const FX_BYTE ZeroLeadPos[256];
-extern const FX_BYTE OneLeadPos[256];
-template <size_t blockNum, size_t blockSize>
-class CFXMEM_FixedPage
-{
-public:
- void Initialize()
- {
- m_nAvailCount = blockNum;
- FXSYS_memset32(m_BusyMap, 0, (blockNum + 7) / 8);
- }
- FX_BOOL HasFreeBlock() const
- {
- return (FX_BOOL)m_nAvailCount;
- }
- FX_LPVOID Alloc(size_t size)
- {
- FXSYS_assert(m_nAvailCount);
- FX_LPDWORD pFind = (FX_LPDWORD)m_BusyMap;
- size_t i = 0;
- while (i < (blockNum + 7) / 8 / 4 && pFind[i] == 0xFFFFFFFF) {
- i ++;
- }
- i *= 4;
- while (m_BusyMap[i] == 0xFF) {
- i ++;
- }
- size_t pos = ZeroLeadPos[m_BusyMap[i]];
- m_BusyMap[i] |= 1 << (7 - pos);
- m_nAvailCount --;
- return (FX_LPBYTE)(this + 1) + (i * 8 + pos) * blockSize;
- }
- void Free(FX_LPVOID p)
- {
- FXSYS_assert(p > (FX_LPVOID)this && p < (FX_LPVOID)((FX_LPBYTE)this + FX_FIXEDMEM_PAGESIZE));
- size_t pos = ((FX_LPBYTE)p - (FX_LPBYTE)(this + 1)) / blockSize;
- m_BusyMap[pos / 8] &= ~(1 << (7 - (pos % 8)));
- m_nAvailCount ++;
- }
- volatile size_t m_nAvailCount;
- FX_BYTE m_BusyMap[(blockNum + 7) / 8];
-};
-typedef CFXMEM_FixedPage<FIXEDMEM_8BYTES_BLOCKNUM, 8> CFXMEM_8BytesPage;
-typedef CFXMEM_FixedPage<FIXEDMEM_16BYTES_BLOCKNUM, 16> CFXMEM_16BytesPage;
-typedef CFXMEM_FixedPage<FIXEDMEM_32BYTES_BLOCKNUM, 32> CFXMEM_32BytesPage;
-template <size_t blockNum, size_t blockSize>
-class CFXMEM_FixedPages
-{
-public:
- typedef CFXMEM_FixedPage<blockNum, blockSize> T;
- FX_LPBYTE m_pStartPage;
- FX_LPBYTE m_pLimitPos;
- FX_LPBYTE m_pCurPage;
- volatile size_t m_nAvailBlocks;
- void Initialize(FX_LPBYTE pStart, size_t pages)
- {
- m_pStartPage = m_pCurPage = pStart;
- m_nAvailBlocks = pages * blockNum;
- for (size_t n = 0; n < pages; n ++) {
- ((T*)pStart)->Initialize();
- pStart += FX_FIXEDMEM_PAGESIZE;
- }
- m_pLimitPos = pStart;
- }
- FX_BOOL IsEmpty() const
- {
- return m_nAvailBlocks == (m_pLimitPos - m_pStartPage) / FX_FIXEDMEM_PAGESIZE * blockNum;
- }
- FX_BOOL HasFreeBlock() const
- {
- return (FX_BOOL)m_nAvailBlocks;
- }
- FX_LPVOID Alloc(size_t size)
- {
- FXSYS_assert(m_nAvailBlocks);
- do {
- if (((T*)m_pCurPage)->HasFreeBlock()) {
- m_nAvailBlocks --;
- return ((T*)m_pCurPage)->Alloc(size);
- }
- m_pCurPage += FX_FIXEDMEM_PAGESIZE;
- if (m_pCurPage == m_pLimitPos) {
- m_pCurPage = m_pStartPage;
- }
- } while (TRUE);
- return NULL;
- }
- void Free(FX_LPVOID p)
- {
- FXSYS_assert(p > (FX_LPVOID)m_pStartPage && p < (FX_LPVOID)m_pLimitPos);
- ((T*)(m_pStartPage + ((FX_LPBYTE)p - m_pStartPage) / FX_FIXEDMEM_PAGESIZE * FX_FIXEDMEM_PAGESIZE))->Free(p);
- m_nAvailBlocks ++;
- }
-};
-typedef CFXMEM_FixedPages<FIXEDMEM_8BYTES_BLOCKNUM, 8> CFXMEM_8BytesPages;
-typedef CFXMEM_FixedPages<FIXEDMEM_16BYTES_BLOCKNUM, 16> CFXMEM_16BytesPages;
-typedef CFXMEM_FixedPages<FIXEDMEM_32BYTES_BLOCKNUM, 32> CFXMEM_32BytesPages;
-class CFXMEM_Block
-{
-public:
- size_t m_nBlockSize;
- CFXMEM_Block* m_pNextBlock;
-};
-class CFXMEM_Page
-{
-public:
- size_t m_nAvailSize;
- CFXMEM_Block* m_pLimitPos;
- CFXMEM_Block m_AvailHead;
- void Initialize(size_t size);
- FX_BOOL IsEmpty() const
- {
- return m_AvailHead.m_pNextBlock && m_AvailHead.m_nBlockSize == m_AvailHead.m_pNextBlock->m_nBlockSize;
- }
- FX_LPVOID Alloc(size_t size);
- FX_LPVOID Realloc(FX_LPVOID p, size_t oldSize, size_t newSize);
- void Free(FX_LPVOID p);
-protected:
- FX_LPVOID Alloc(CFXMEM_Block* pPrevBlock, CFXMEM_Block* pNextBlock, size_t size, size_t oldsize);
-};
-class CFXMEM_Pages
-{
-public:
- CFXMEM_Page* m_pStartPage;
- CFXMEM_Page* m_pLimitPos;
- CFXMEM_Page* m_pCurPage;
- size_t m_nPageSize;
- void Initialize(FX_LPBYTE pStart, size_t pageSize, size_t pages);
- FX_BOOL IsEmpty() const;
- FX_LPVOID Alloc(size_t size);
- FX_LPVOID Realloc(FX_LPVOID p, size_t oldSize, size_t newSize);
- void Free(FX_LPVOID p);
-};
-class CFXMEM_Pool
-{
-public:
- CFXMEM_Pool* m_pPrevPool;
- CFXMEM_Pool* m_pNextPool;
- CFXMEM_8BytesPages m_8BytesPages;
- CFXMEM_16BytesPages m_16BytesPages;
- CFXMEM_32BytesPages m_32BytesPages;
- CFXMEM_Pages m_MidPages;
- FX_BOOL m_bAlone;
- FX_DWORD m_dwReserved[3];
- FX_LPVOID m_pLimitPos;
- CFXMEM_Page* m_pLargePage;
- void Initialize(const FX_MEMCONFIG* pMemConfig, size_t size, size_t pageNum8Bytes, size_t pageNum16Bytes, size_t pageNum32Bytes, size_t pageNumMid);
- FX_BOOL IsEmpty() const;
- size_t GetSize(FX_LPVOID p) const;
- FX_LPVOID Realloc(FX_LPVOID p, size_t oldSize, size_t newSize);
- void Free(FX_LPVOID p);
-};
-class CFXMEM_FixedMgr
-{
-public:
- void Initialize(size_t size);
- FX_LPVOID Alloc(size_t size);
- FX_LPVOID Realloc(FX_LPVOID p, size_t newSize);
- void Free(FX_LPVOID p);
- void FreeAll();
- void Purge();
- CFXMEM_Pool* GetFirstPool()
- {
- return &m_FirstPool;
- }
- size_t GetSize(FX_LPVOID p) const;
- FXMEM_SystemMgr m_SystemMgr;
- FXMEM_SystemMgr2* m_pExtender;
- FX_LPVOID m_pReserved;
- FX_MEMCONFIG m_MemConfig;
-protected:
- FX_LPVOID Alloc16(CFXMEM_Pool **pp32Pool = NULL, size_t size = 0);
- FX_LPVOID Alloc32(size_t size);
- FX_LPVOID AllocSmall(size_t size);
- FX_LPVOID AllocMid(size_t size);
- FX_LPVOID AllocLarge(size_t size);
- FX_LPVOID ReallocSmall(CFXMEM_Pool* pPool, FX_LPVOID p, size_t oldSize, size_t newSize);
- void FreePool(CFXMEM_Pool* pPool);
- CFXMEM_Pool m_FirstPool;
-};
-#define FIXEDMEM_PROXYSIZE_0 (1024 * 1024 * 8)
-#define FIXEDMEM_PROXYSIZE_1 (1024 * 1024 * 16)
-#define FIXEDMEM_PROXYSIZE_2 (1024 * 1024 * 32)
-#define FIXEDMEM_PROXYSIZE_3 (1024 * 1024 * 64)
-#define FIXEDMEM_PROXYSIZE_4 (1024 * 1024 * 128)
-#define FIXEDMEM_PROXYSIZE_5 (1024 * 1024 * 256)
-const FX_MEMCONFIG* FixedMgr_GetConfig(size_t nSize);
-class CFixedMgr_Proxy
-{
-public:
- FXMEM_FoxitMgr* Initialize(FX_LPVOID pBuffer, size_t nSize, FX_BOOL bExtensible);
- static FX_BOOL Common_More(FXMEM_SystemMgr2* pMgr, size_t alloc_size, void** new_memory, size_t* new_size);
- static void Common_Free(FXMEM_SystemMgr2* pMgr, void* memory);
- FXMEM_SystemMgr2 m_SystemMgr;
- CFXMEM_Page* m_pFixedPage;
- FX_LPVOID m_pBuffer;
- size_t m_nSize;
- FX_BOOL m_bExtensible;
-};
-#endif
+// 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 _FXM_MEM_INT_H_
+#define _FXM_MEM_INT_H_
+struct FX_DefAllocator {
+ IFX_Allocator m_Allocator;
+ struct CFX_MemoryMgr* m_pFoxitMgr;
+};
+struct CFX_MemoryMgr {
+public:
+ FXMEM_SystemMgr* m_pSystemMgr;
+ FX_DefAllocator m_DefAllocator;
+ FX_LPVOID m_pExternalMemory;
+ FX_BOOL m_bReleaseMgr;
+ void Init(FXMEM_SystemMgr* pSystemMgr);
+ void* Alloc(size_t size, int flags);
+ void* AllocDebug(size_t size, int flags, FX_LPCSTR file, int line);
+ void* Realloc(void* p, size_t size, int flags);
+ void* ReallocDebug(void* p, size_t size, int flags, FX_LPCSTR file, int line);
+ void Free(void* p, int flags);
+ void PurgeMgr();
+};
+extern CFX_MemoryMgr* g_pDefFoxitMgr;
+#define FIXEDMEM_PAGE_EXTRASPACE sizeof(size_t)
+#define FIXEDMEM_BLOCKNUM(bs) (8 * (FX_FIXEDMEM_PAGESIZE - FIXEDMEM_PAGE_EXTRASPACE) / (8 * bs + 1))
+#define FIXEDMEM_8BYTES_BLOCKNUM FIXEDMEM_BLOCKNUM(8)
+#define FIXEDMEM_16BYTES_BLOCKNUM FIXEDMEM_BLOCKNUM(16)
+#define FIXEDMEM_32BYTES_BLOCKNUM FIXEDMEM_BLOCKNUM(32)
+extern const FX_BYTE ZeroLeadPos[256];
+extern const FX_BYTE OneLeadPos[256];
+template <size_t blockNum, size_t blockSize>
+class CFXMEM_FixedPage
+{
+public:
+ void Initialize()
+ {
+ m_nAvailCount = blockNum;
+ FXSYS_memset32(m_BusyMap, 0, (blockNum + 7) / 8);
+ }
+ FX_BOOL HasFreeBlock() const
+ {
+ return (FX_BOOL)m_nAvailCount;
+ }
+ FX_LPVOID Alloc(size_t size)
+ {
+ FXSYS_assert(m_nAvailCount);
+ FX_LPDWORD pFind = (FX_LPDWORD)m_BusyMap;
+ size_t i = 0;
+ while (i < (blockNum + 7) / 8 / 4 && pFind[i] == 0xFFFFFFFF) {
+ i ++;
+ }
+ i *= 4;
+ while (m_BusyMap[i] == 0xFF) {
+ i ++;
+ }
+ size_t pos = ZeroLeadPos[m_BusyMap[i]];
+ m_BusyMap[i] |= 1 << (7 - pos);
+ m_nAvailCount --;
+ return (FX_LPBYTE)(this + 1) + (i * 8 + pos) * blockSize;
+ }
+ void Free(FX_LPVOID p)
+ {
+ FXSYS_assert(p > (FX_LPVOID)this && p < (FX_LPVOID)((FX_LPBYTE)this + FX_FIXEDMEM_PAGESIZE));
+ size_t pos = ((FX_LPBYTE)p - (FX_LPBYTE)(this + 1)) / blockSize;
+ m_BusyMap[pos / 8] &= ~(1 << (7 - (pos % 8)));
+ m_nAvailCount ++;
+ }
+ volatile size_t m_nAvailCount;
+ FX_BYTE m_BusyMap[(blockNum + 7) / 8];
+};
+typedef CFXMEM_FixedPage<FIXEDMEM_8BYTES_BLOCKNUM, 8> CFXMEM_8BytesPage;
+typedef CFXMEM_FixedPage<FIXEDMEM_16BYTES_BLOCKNUM, 16> CFXMEM_16BytesPage;
+typedef CFXMEM_FixedPage<FIXEDMEM_32BYTES_BLOCKNUM, 32> CFXMEM_32BytesPage;
+template <size_t blockNum, size_t blockSize>
+class CFXMEM_FixedPages
+{
+public:
+ typedef CFXMEM_FixedPage<blockNum, blockSize> T;
+ FX_LPBYTE m_pStartPage;
+ FX_LPBYTE m_pLimitPos;
+ FX_LPBYTE m_pCurPage;
+ volatile size_t m_nAvailBlocks;
+ void Initialize(FX_LPBYTE pStart, size_t pages)
+ {
+ m_pStartPage = m_pCurPage = pStart;
+ m_nAvailBlocks = pages * blockNum;
+ for (size_t n = 0; n < pages; n ++) {
+ ((T*)pStart)->Initialize();
+ pStart += FX_FIXEDMEM_PAGESIZE;
+ }
+ m_pLimitPos = pStart;
+ }
+ FX_BOOL IsEmpty() const
+ {
+ return m_nAvailBlocks == (m_pLimitPos - m_pStartPage) / FX_FIXEDMEM_PAGESIZE * blockNum;
+ }
+ FX_BOOL HasFreeBlock() const
+ {
+ return (FX_BOOL)m_nAvailBlocks;
+ }
+ FX_LPVOID Alloc(size_t size)
+ {
+ FXSYS_assert(m_nAvailBlocks);
+ do {
+ if (((T*)m_pCurPage)->HasFreeBlock()) {
+ m_nAvailBlocks --;
+ return ((T*)m_pCurPage)->Alloc(size);
+ }
+ m_pCurPage += FX_FIXEDMEM_PAGESIZE;
+ if (m_pCurPage == m_pLimitPos) {
+ m_pCurPage = m_pStartPage;
+ }
+ } while (TRUE);
+ return NULL;
+ }
+ void Free(FX_LPVOID p)
+ {
+ FXSYS_assert(p > (FX_LPVOID)m_pStartPage && p < (FX_LPVOID)m_pLimitPos);
+ ((T*)(m_pStartPage + ((FX_LPBYTE)p - m_pStartPage) / FX_FIXEDMEM_PAGESIZE * FX_FIXEDMEM_PAGESIZE))->Free(p);
+ m_nAvailBlocks ++;
+ }
+};
+typedef CFXMEM_FixedPages<FIXEDMEM_8BYTES_BLOCKNUM, 8> CFXMEM_8BytesPages;
+typedef CFXMEM_FixedPages<FIXEDMEM_16BYTES_BLOCKNUM, 16> CFXMEM_16BytesPages;
+typedef CFXMEM_FixedPages<FIXEDMEM_32BYTES_BLOCKNUM, 32> CFXMEM_32BytesPages;
+class CFXMEM_Block
+{
+public:
+ size_t m_nBlockSize;
+ CFXMEM_Block* m_pNextBlock;
+};
+class CFXMEM_Page
+{
+public:
+ size_t m_nAvailSize;
+ CFXMEM_Block* m_pLimitPos;
+ CFXMEM_Block m_AvailHead;
+ void Initialize(size_t size);
+ FX_BOOL IsEmpty() const
+ {
+ return m_AvailHead.m_pNextBlock && m_AvailHead.m_nBlockSize == m_AvailHead.m_pNextBlock->m_nBlockSize;
+ }
+ FX_LPVOID Alloc(size_t size);
+ FX_LPVOID Realloc(FX_LPVOID p, size_t oldSize, size_t newSize);
+ void Free(FX_LPVOID p);
+protected:
+ FX_LPVOID Alloc(CFXMEM_Block* pPrevBlock, CFXMEM_Block* pNextBlock, size_t size, size_t oldsize);
+};
+class CFXMEM_Pages
+{
+public:
+ CFXMEM_Page* m_pStartPage;
+ CFXMEM_Page* m_pLimitPos;
+ CFXMEM_Page* m_pCurPage;
+ size_t m_nPageSize;
+ void Initialize(FX_LPBYTE pStart, size_t pageSize, size_t pages);
+ FX_BOOL IsEmpty() const;
+ FX_LPVOID Alloc(size_t size);
+ FX_LPVOID Realloc(FX_LPVOID p, size_t oldSize, size_t newSize);
+ void Free(FX_LPVOID p);
+};
+class CFXMEM_Pool
+{
+public:
+ CFXMEM_Pool* m_pPrevPool;
+ CFXMEM_Pool* m_pNextPool;
+ CFXMEM_8BytesPages m_8BytesPages;
+ CFXMEM_16BytesPages m_16BytesPages;
+ CFXMEM_32BytesPages m_32BytesPages;
+ CFXMEM_Pages m_MidPages;
+ FX_BOOL m_bAlone;
+ FX_DWORD m_dwReserved[3];
+ FX_LPVOID m_pLimitPos;
+ CFXMEM_Page* m_pLargePage;
+ void Initialize(const FX_MEMCONFIG* pMemConfig, size_t size, size_t pageNum8Bytes, size_t pageNum16Bytes, size_t pageNum32Bytes, size_t pageNumMid);
+ FX_BOOL IsEmpty() const;
+ size_t GetSize(FX_LPVOID p) const;
+ FX_LPVOID Realloc(FX_LPVOID p, size_t oldSize, size_t newSize);
+ void Free(FX_LPVOID p);
+};
+class CFXMEM_FixedMgr
+{
+public:
+ void Initialize(size_t size);
+ FX_LPVOID Alloc(size_t size);
+ FX_LPVOID Realloc(FX_LPVOID p, size_t newSize);
+ void Free(FX_LPVOID p);
+ void FreeAll();
+ void Purge();
+ CFXMEM_Pool* GetFirstPool()
+ {
+ return &m_FirstPool;
+ }
+ size_t GetSize(FX_LPVOID p) const;
+ FXMEM_SystemMgr m_SystemMgr;
+ FXMEM_SystemMgr2* m_pExtender;
+ FX_LPVOID m_pReserved;
+ FX_MEMCONFIG m_MemConfig;
+protected:
+ FX_LPVOID Alloc16(CFXMEM_Pool **pp32Pool = NULL, size_t size = 0);
+ FX_LPVOID Alloc32(size_t size);
+ FX_LPVOID AllocSmall(size_t size);
+ FX_LPVOID AllocMid(size_t size);
+ FX_LPVOID AllocLarge(size_t size);
+ FX_LPVOID ReallocSmall(CFXMEM_Pool* pPool, FX_LPVOID p, size_t oldSize, size_t newSize);
+ void FreePool(CFXMEM_Pool* pPool);
+ CFXMEM_Pool m_FirstPool;
+};
+#define FIXEDMEM_PROXYSIZE_0 (1024 * 1024 * 8)
+#define FIXEDMEM_PROXYSIZE_1 (1024 * 1024 * 16)
+#define FIXEDMEM_PROXYSIZE_2 (1024 * 1024 * 32)
+#define FIXEDMEM_PROXYSIZE_3 (1024 * 1024 * 64)
+#define FIXEDMEM_PROXYSIZE_4 (1024 * 1024 * 128)
+#define FIXEDMEM_PROXYSIZE_5 (1024 * 1024 * 256)
+const FX_MEMCONFIG* FixedMgr_GetConfig(size_t nSize);
+class CFixedMgr_Proxy
+{
+public:
+ FXMEM_FoxitMgr* Initialize(FX_LPVOID pBuffer, size_t nSize, FX_BOOL bExtensible);
+ static FX_BOOL Common_More(FXMEM_SystemMgr2* pMgr, size_t alloc_size, void** new_memory, size_t* new_size);
+ static void Common_Free(FXMEM_SystemMgr2* pMgr, void* memory);
+ FXMEM_SystemMgr2 m_SystemMgr;
+ CFXMEM_Page* m_pFixedPage;
+ FX_LPVOID m_pBuffer;
+ size_t m_nSize;
+ FX_BOOL m_bExtensible;
+};
+#endif
diff --git a/core/src/fxcrt/plex.h b/core/src/fxcrt/plex.h
index 32a27cbf1d..e982fd67a4 100644
--- a/core/src/fxcrt/plex.h
+++ b/core/src/fxcrt/plex.h
@@ -1,15 +1,15 @@
-// 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
-
-struct CFX_Plex {
- CFX_Plex* pNext;
- void* data()
- {
- return this + 1;
- }
- static CFX_Plex* Create(IFX_Allocator* pAllocator, CFX_Plex*& head, FX_DWORD nMax, FX_DWORD cbElement);
- void FreeDataChain(IFX_Allocator* pAllocator);
-};
+// 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
+
+struct CFX_Plex {
+ CFX_Plex* pNext;
+ void* data()
+ {
+ return this + 1;
+ }
+ static CFX_Plex* Create(IFX_Allocator* pAllocator, CFX_Plex*& head, FX_DWORD nMax, FX_DWORD cbElement);
+ void FreeDataChain(IFX_Allocator* pAllocator);
+};
diff --git a/core/src/fxcrt/xml_int.h b/core/src/fxcrt/xml_int.h
index 8ad8ef4b88..09737893af 100644
--- a/core/src/fxcrt/xml_int.h
+++ b/core/src/fxcrt/xml_int.h
@@ -1,178 +1,178 @@
-// 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 _FXCRT_XML_INT_
-#define _FXCRT_XML_INT_
-class CXML_DataBufAcc : public IFX_BufferRead, public CFX_Object
-{
-public:
- CXML_DataBufAcc(FX_LPCBYTE pBuffer, size_t size, IFX_Allocator* pAllocator = NULL)
- : m_pAllocator(pAllocator)
- , m_pBuffer(pBuffer)
- , m_dwSize(size)
- , m_dwCurPos(0)
- {
- }
- virtual ~CXML_DataBufAcc() {}
- virtual void Release()
- {
- if (m_pAllocator) {
- FX_DeleteAtAllocator(this, m_pAllocator, CXML_DataBufAcc);
- } else {
- delete this;
- }
- }
- virtual FX_BOOL IsEOF()
- {
- return m_dwCurPos >= m_dwSize;
- }
- virtual FX_FILESIZE GetPosition()
- {
- return (FX_FILESIZE)m_dwCurPos;
- }
- virtual size_t ReadBlock(void* buffer, size_t size)
- {
- return 0;
- }
- virtual FX_BOOL ReadNextBlock(FX_BOOL bRestart = FALSE)
- {
- if (bRestart) {
- m_dwCurPos = 0;
- }
- if (m_dwCurPos < m_dwSize) {
- m_dwCurPos = m_dwSize;
- return TRUE;
- }
- return FALSE;
- }
- virtual FX_LPCBYTE GetBlockBuffer()
- {
- return m_pBuffer;
- }
- virtual size_t GetBlockSize()
- {
- return m_dwSize;
- }
- virtual FX_FILESIZE GetBlockOffset()
- {
- return 0;
- }
-protected:
- IFX_Allocator* m_pAllocator;
- FX_LPCBYTE m_pBuffer;
- size_t m_dwSize;
- size_t m_dwCurPos;
-};
-#define FX_XMLDATASTREAM_BufferSize (32 * 1024)
-class CXML_DataStmAcc : public IFX_BufferRead, public CFX_Object
-{
-public:
- CXML_DataStmAcc(IFX_FileRead *pFileRead, IFX_Allocator* pAllocator = NULL)
- : m_pAllocator(pAllocator)
- , m_pFileRead(pFileRead)
- , m_pBuffer(NULL)
- , m_nStart(0)
- , m_dwSize(0)
- {
- FXSYS_assert(m_pFileRead != NULL);
- }
- virtual ~CXML_DataStmAcc()
- {
- if (m_pBuffer) {
- FX_Allocator_Free(m_pAllocator, m_pBuffer);
- }
- }
- virtual void Release()
- {
- if (m_pAllocator) {
- FX_DeleteAtAllocator(this, m_pAllocator, CXML_DataStmAcc);
- } else {
- delete this;
- }
- }
- virtual FX_BOOL IsEOF()
- {
- return m_nStart + (FX_FILESIZE)m_dwSize >= m_pFileRead->GetSize();
- }
- virtual FX_FILESIZE GetPosition()
- {
- return m_nStart + (FX_FILESIZE)m_dwSize;
- }
- virtual size_t ReadBlock(void* buffer, size_t size)
- {
- return 0;
- }
- virtual FX_BOOL ReadNextBlock(FX_BOOL bRestart = FALSE)
- {
- if (bRestart) {
- m_nStart = 0;
- }
- FX_FILESIZE nLength = m_pFileRead->GetSize();
- m_nStart += (FX_FILESIZE)m_dwSize;
- if (m_nStart >= nLength) {
- return FALSE;
- }
- m_dwSize = (size_t)FX_MIN(FX_XMLDATASTREAM_BufferSize, nLength - m_nStart);
- if (!m_pBuffer) {
- m_pBuffer = FX_Allocator_Alloc(m_pAllocator, FX_BYTE, m_dwSize);
- if (!m_pBuffer) {
- return FALSE;
- }
- }
- return m_pFileRead->ReadBlock(m_pBuffer, m_nStart, m_dwSize);
- }
- virtual FX_LPCBYTE GetBlockBuffer()
- {
- return (FX_LPCBYTE)m_pBuffer;
- }
- virtual size_t GetBlockSize()
- {
- return m_dwSize;
- }
- virtual FX_FILESIZE GetBlockOffset()
- {
- return m_nStart;
- }
-protected:
- IFX_Allocator* m_pAllocator;
- IFX_FileRead *m_pFileRead;
- FX_LPBYTE m_pBuffer;
- FX_FILESIZE m_nStart;
- size_t m_dwSize;
-};
-class CXML_Parser
-{
-public:
- CXML_Parser(IFX_Allocator* pAllocator = NULL) : m_pAllocator(pAllocator) {}
- ~CXML_Parser();
- IFX_Allocator* m_pAllocator;
- IFX_BufferRead* m_pDataAcc;
- FX_BOOL m_bOwnedStream;
- FX_FILESIZE m_nOffset;
- FX_BOOL m_bSaveSpaceChars;
- FX_LPCBYTE m_pBuffer;
- size_t m_dwBufferSize;
- FX_FILESIZE m_nBufferOffset;
- size_t m_dwIndex;
- FX_BOOL Init(FX_LPBYTE pBuffer, size_t size);
- FX_BOOL Init(IFX_FileRead *pFileRead);
- FX_BOOL Init(IFX_BufferRead *pBuffer);
- FX_BOOL Init(FX_BOOL bOwndedStream);
- FX_BOOL ReadNextBlock();
- FX_BOOL IsEOF();
- FX_BOOL HaveAvailData();
- void SkipWhiteSpaces();
- void GetName(CFX_ByteStringL &space, CFX_ByteStringL &name);
- void GetAttrValue(CFX_WideStringL &value);
- FX_DWORD GetCharRef();
- void GetTagName(CFX_ByteStringL &space, CFX_ByteStringL &name, FX_BOOL &bEndTag, FX_BOOL bStartTag = FALSE);
- void SkipLiterals(FX_BSTR str);
- CXML_Element* ParseElement(CXML_Element* pParent, FX_BOOL bStartTag = FALSE);
- void InsertContentSegment(FX_BOOL bCDATA, FX_WSTR content, CXML_Element* pElement);
- void InsertCDATASegment(CFX_UTF8Decoder& decoder, CXML_Element* pElement);
-};
-void FX_XML_SplitQualifiedName(FX_BSTR bsFullName, CFX_ByteStringC &bsSpace, CFX_ByteStringC &bsName);
-#endif
+// 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 _FXCRT_XML_INT_
+#define _FXCRT_XML_INT_
+class CXML_DataBufAcc : public IFX_BufferRead, public CFX_Object
+{
+public:
+ CXML_DataBufAcc(FX_LPCBYTE pBuffer, size_t size, IFX_Allocator* pAllocator = NULL)
+ : m_pAllocator(pAllocator)
+ , m_pBuffer(pBuffer)
+ , m_dwSize(size)
+ , m_dwCurPos(0)
+ {
+ }
+ virtual ~CXML_DataBufAcc() {}
+ virtual void Release()
+ {
+ if (m_pAllocator) {
+ FX_DeleteAtAllocator(this, m_pAllocator, CXML_DataBufAcc);
+ } else {
+ delete this;
+ }
+ }
+ virtual FX_BOOL IsEOF()
+ {
+ return m_dwCurPos >= m_dwSize;
+ }
+ virtual FX_FILESIZE GetPosition()
+ {
+ return (FX_FILESIZE)m_dwCurPos;
+ }
+ virtual size_t ReadBlock(void* buffer, size_t size)
+ {
+ return 0;
+ }
+ virtual FX_BOOL ReadNextBlock(FX_BOOL bRestart = FALSE)
+ {
+ if (bRestart) {
+ m_dwCurPos = 0;
+ }
+ if (m_dwCurPos < m_dwSize) {
+ m_dwCurPos = m_dwSize;
+ return TRUE;
+ }
+ return FALSE;
+ }
+ virtual FX_LPCBYTE GetBlockBuffer()
+ {
+ return m_pBuffer;
+ }
+ virtual size_t GetBlockSize()
+ {
+ return m_dwSize;
+ }
+ virtual FX_FILESIZE GetBlockOffset()
+ {
+ return 0;
+ }
+protected:
+ IFX_Allocator* m_pAllocator;
+ FX_LPCBYTE m_pBuffer;
+ size_t m_dwSize;
+ size_t m_dwCurPos;
+};
+#define FX_XMLDATASTREAM_BufferSize (32 * 1024)
+class CXML_DataStmAcc : public IFX_BufferRead, public CFX_Object
+{
+public:
+ CXML_DataStmAcc(IFX_FileRead *pFileRead, IFX_Allocator* pAllocator = NULL)
+ : m_pAllocator(pAllocator)
+ , m_pFileRead(pFileRead)
+ , m_pBuffer(NULL)
+ , m_nStart(0)
+ , m_dwSize(0)
+ {
+ FXSYS_assert(m_pFileRead != NULL);
+ }
+ virtual ~CXML_DataStmAcc()
+ {
+ if (m_pBuffer) {
+ FX_Allocator_Free(m_pAllocator, m_pBuffer);
+ }
+ }
+ virtual void Release()
+ {
+ if (m_pAllocator) {
+ FX_DeleteAtAllocator(this, m_pAllocator, CXML_DataStmAcc);
+ } else {
+ delete this;
+ }
+ }
+ virtual FX_BOOL IsEOF()
+ {
+ return m_nStart + (FX_FILESIZE)m_dwSize >= m_pFileRead->GetSize();
+ }
+ virtual FX_FILESIZE GetPosition()
+ {
+ return m_nStart + (FX_FILESIZE)m_dwSize;
+ }
+ virtual size_t ReadBlock(void* buffer, size_t size)
+ {
+ return 0;
+ }
+ virtual FX_BOOL ReadNextBlock(FX_BOOL bRestart = FALSE)
+ {
+ if (bRestart) {
+ m_nStart = 0;
+ }
+ FX_FILESIZE nLength = m_pFileRead->GetSize();
+ m_nStart += (FX_FILESIZE)m_dwSize;
+ if (m_nStart >= nLength) {
+ return FALSE;
+ }
+ m_dwSize = (size_t)FX_MIN(FX_XMLDATASTREAM_BufferSize, nLength - m_nStart);
+ if (!m_pBuffer) {
+ m_pBuffer = FX_Allocator_Alloc(m_pAllocator, FX_BYTE, m_dwSize);
+ if (!m_pBuffer) {
+ return FALSE;
+ }
+ }
+ return m_pFileRead->ReadBlock(m_pBuffer, m_nStart, m_dwSize);
+ }
+ virtual FX_LPCBYTE GetBlockBuffer()
+ {
+ return (FX_LPCBYTE)m_pBuffer;
+ }
+ virtual size_t GetBlockSize()
+ {
+ return m_dwSize;
+ }
+ virtual FX_FILESIZE GetBlockOffset()
+ {
+ return m_nStart;
+ }
+protected:
+ IFX_Allocator* m_pAllocator;
+ IFX_FileRead *m_pFileRead;
+ FX_LPBYTE m_pBuffer;
+ FX_FILESIZE m_nStart;
+ size_t m_dwSize;
+};
+class CXML_Parser
+{
+public:
+ CXML_Parser(IFX_Allocator* pAllocator = NULL) : m_pAllocator(pAllocator) {}
+ ~CXML_Parser();
+ IFX_Allocator* m_pAllocator;
+ IFX_BufferRead* m_pDataAcc;
+ FX_BOOL m_bOwnedStream;
+ FX_FILESIZE m_nOffset;
+ FX_BOOL m_bSaveSpaceChars;
+ FX_LPCBYTE m_pBuffer;
+ size_t m_dwBufferSize;
+ FX_FILESIZE m_nBufferOffset;
+ size_t m_dwIndex;
+ FX_BOOL Init(FX_LPBYTE pBuffer, size_t size);
+ FX_BOOL Init(IFX_FileRead *pFileRead);
+ FX_BOOL Init(IFX_BufferRead *pBuffer);
+ FX_BOOL Init(FX_BOOL bOwndedStream);
+ FX_BOOL ReadNextBlock();
+ FX_BOOL IsEOF();
+ FX_BOOL HaveAvailData();
+ void SkipWhiteSpaces();
+ void GetName(CFX_ByteStringL &space, CFX_ByteStringL &name);
+ void GetAttrValue(CFX_WideStringL &value);
+ FX_DWORD GetCharRef();
+ void GetTagName(CFX_ByteStringL &space, CFX_ByteStringL &name, FX_BOOL &bEndTag, FX_BOOL bStartTag = FALSE);
+ void SkipLiterals(FX_BSTR str);
+ CXML_Element* ParseElement(CXML_Element* pParent, FX_BOOL bStartTag = FALSE);
+ void InsertContentSegment(FX_BOOL bCDATA, FX_WSTR content, CXML_Element* pElement);
+ void InsertCDATASegment(CFX_UTF8Decoder& decoder, CXML_Element* pElement);
+};
+void FX_XML_SplitQualifiedName(FX_BSTR bsFullName, CFX_ByteStringC &bsSpace, CFX_ByteStringC &bsName);
+#endif
diff --git a/core/src/fxge/Microsoft SDK/include/DWrite.h b/core/src/fxge/Microsoft SDK/include/DWrite.h
index 70f998a437..0374694f74 100644
--- a/core/src/fxge/Microsoft SDK/include/DWrite.h
+++ b/core/src/fxge/Microsoft SDK/include/DWrite.h
@@ -1,5006 +1,5006 @@
-//+--------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// Abstract:
-// DirectX Typography Services public API definitions.
-//
-//----------------------------------------------------------------------------
-
-#ifndef DWRITE_H_INCLUDED
-#define DWRITE_H_INCLUDED
-
-#if _MSC_VER > 1000
-#pragma once
-#endif
-
-#ifndef DWRITE_NO_WINDOWS_H
-
-#include "specstrings.h"
-#include "unknwn.h"
-
-#endif // DWRITE_NO_WINDOWS_H
-
-#include "dcommon.h"
-
-#if _FX_COMPILER_ == _FX_VC6_
-typedef signed char INT8, *PINT8;
-typedef signed short INT16, *PINT16;
-typedef signed int INT32, *PINT32;
-typedef signed __int64 INT64, *PINT64;
-typedef unsigned char UINT8, *PUINT8;
-typedef unsigned short UINT16, *PUINT16;
-typedef unsigned int UINT32, *PUINT32;
-typedef unsigned __int64 UINT64, *PUINT64;
-#endif
-
-#ifndef DWRITE_DECLARE_INTERFACE
-#define DWRITE_DECLARE_INTERFACE(iid) DECLSPEC_UUID(iid) DECLSPEC_NOVTABLE
-#endif
-
-#ifndef DWRITE_EXPORT
-#define DWRITE_EXPORT __declspec(dllimport) WINAPI
-#endif
-
-/// <summary>
-/// The type of a font represented by a single font file.
-/// Font formats that consist of multiple files, e.g. Type 1 .PFM and .PFB, have
-/// separate enum values for each of the file type.
-/// </summary>
-enum DWRITE_FONT_FILE_TYPE
-{
- /// <summary>
- /// Font type is not recognized by the DirectWrite font system.
- /// </summary>
- DWRITE_FONT_FILE_TYPE_UNKNOWN,
-
- /// <summary>
- /// OpenType font with CFF outlines.
- /// </summary>
- DWRITE_FONT_FILE_TYPE_CFF,
-
- /// <summary>
- /// OpenType font with TrueType outlines.
- /// </summary>
- DWRITE_FONT_FILE_TYPE_TRUETYPE,
-
- /// <summary>
- /// OpenType font that contains a TrueType collection.
- /// </summary>
- DWRITE_FONT_FILE_TYPE_TRUETYPE_COLLECTION,
-
- /// <summary>
- /// Type 1 PFM font.
- /// </summary>
- DWRITE_FONT_FILE_TYPE_TYPE1_PFM,
-
- /// <summary>
- /// Type 1 PFB font.
- /// </summary>
- DWRITE_FONT_FILE_TYPE_TYPE1_PFB,
-
- /// <summary>
- /// Vector .FON font.
- /// </summary>
- DWRITE_FONT_FILE_TYPE_VECTOR,
-
- /// <summary>
- /// Bitmap .FON font.
- /// </summary>
- DWRITE_FONT_FILE_TYPE_BITMAP
-};
-
-/// <summary>
-/// The file format of a complete font face.
-/// Font formats that consist of multiple files, e.g. Type 1 .PFM and .PFB, have
-/// a single enum entry.
-/// </summary>
-enum DWRITE_FONT_FACE_TYPE
-{
- /// <summary>
- /// OpenType font face with CFF outlines.
- /// </summary>
- DWRITE_FONT_FACE_TYPE_CFF,
-
- /// <summary>
- /// OpenType font face with TrueType outlines.
- /// </summary>
- DWRITE_FONT_FACE_TYPE_TRUETYPE,
-
- /// <summary>
- /// OpenType font face that is a part of a TrueType collection.
- /// </summary>
- DWRITE_FONT_FACE_TYPE_TRUETYPE_COLLECTION,
-
- /// <summary>
- /// A Type 1 font face.
- /// </summary>
- DWRITE_FONT_FACE_TYPE_TYPE1,
-
- /// <summary>
- /// A vector .FON format font face.
- /// </summary>
- DWRITE_FONT_FACE_TYPE_VECTOR,
-
- /// <summary>
- /// A bitmap .FON format font face.
- /// </summary>
- DWRITE_FONT_FACE_TYPE_BITMAP,
-
- /// <summary>
- /// Font face type is not recognized by the DirectWrite font system.
- /// </summary>
- DWRITE_FONT_FACE_TYPE_UNKNOWN
-};
-
-/// <summary>
-/// Specifies algorithmic style simulations to be applied to the font face.
-/// Bold and oblique simulations can be combined via bitwise OR operation.
-/// </summary>
-enum DWRITE_FONT_SIMULATIONS
-{
- /// <summary>
- /// No simulations are performed.
- /// </summary>
- DWRITE_FONT_SIMULATIONS_NONE = 0x0000,
-
- /// <summary>
- /// Algorithmic emboldening is performed.
- /// </summary>
- DWRITE_FONT_SIMULATIONS_BOLD = 0x0001,
-
- /// <summary>
- /// Algorithmic italicization is performed.
- /// </summary>
- DWRITE_FONT_SIMULATIONS_OBLIQUE = 0x0002
-};
-
-#ifdef DEFINE_ENUM_FLAG_OPERATORS
-DEFINE_ENUM_FLAG_OPERATORS(DWRITE_FONT_SIMULATIONS);
-#endif
-
-/// <summary>
-/// The font weight enumeration describes common values for degree of blackness or thickness of strokes of characters in a font.
-/// Font weight values less than 1 or greater than 999 are considered to be invalid, and they are rejected by font API functions.
-/// </summary>
-enum DWRITE_FONT_WEIGHT
-{
- /// <summary>
- /// Predefined font weight : Thin (100).
- /// </summary>
- DWRITE_FONT_WEIGHT_THIN = 100,
-
- /// <summary>
- /// Predefined font weight : Extra-light (200).
- /// </summary>
- DWRITE_FONT_WEIGHT_EXTRA_LIGHT = 200,
-
- /// <summary>
- /// Predefined font weight : Ultra-light (200).
- /// </summary>
- DWRITE_FONT_WEIGHT_ULTRA_LIGHT = 200,
-
- /// <summary>
- /// Predefined font weight : Light (300).
- /// </summary>
- DWRITE_FONT_WEIGHT_LIGHT = 300,
-
- /// <summary>
- /// Predefined font weight : Normal (400).
- /// </summary>
- DWRITE_FONT_WEIGHT_NORMAL = 400,
-
- /// <summary>
- /// Predefined font weight : Regular (400).
- /// </summary>
- DWRITE_FONT_WEIGHT_REGULAR = 400,
-
- /// <summary>
- /// Predefined font weight : Medium (500).
- /// </summary>
- DWRITE_FONT_WEIGHT_MEDIUM = 500,
-
- /// <summary>
- /// Predefined font weight : Demi-bold (600).
- /// </summary>
- DWRITE_FONT_WEIGHT_DEMI_BOLD = 600,
-
- /// <summary>
- /// Predefined font weight : Semi-bold (600).
- /// </summary>
- DWRITE_FONT_WEIGHT_SEMI_BOLD = 600,
-
- /// <summary>
- /// Predefined font weight : Bold (700).
- /// </summary>
- DWRITE_FONT_WEIGHT_BOLD = 700,
-
- /// <summary>
- /// Predefined font weight : Extra-bold (800).
- /// </summary>
- DWRITE_FONT_WEIGHT_EXTRA_BOLD = 800,
-
- /// <summary>
- /// Predefined font weight : Ultra-bold (800).
- /// </summary>
- DWRITE_FONT_WEIGHT_ULTRA_BOLD = 800,
-
- /// <summary>
- /// Predefined font weight : Black (900).
- /// </summary>
- DWRITE_FONT_WEIGHT_BLACK = 900,
-
- /// <summary>
- /// Predefined font weight : Heavy (900).
- /// </summary>
- DWRITE_FONT_WEIGHT_HEAVY = 900,
-
- /// <summary>
- /// Predefined font weight : Extra-black (950).
- /// </summary>
- DWRITE_FONT_WEIGHT_EXTRA_BLACK = 950,
-
- /// <summary>
- /// Predefined font weight : Ultra-black (950).
- /// </summary>
- DWRITE_FONT_WEIGHT_ULTRA_BLACK = 950
-};
-
-/// <summary>
-/// The font stretch enumeration describes relative change from the normal aspect ratio
-/// as specified by a font designer for the glyphs in a font.
-/// Values less than 1 or greater than 9 are considered to be invalid, and they are rejected by font API functions.
-/// </summary>
-enum DWRITE_FONT_STRETCH
-{
- /// <summary>
- /// Predefined font stretch : Not known (0).
- /// </summary>
- DWRITE_FONT_STRETCH_UNDEFINED = 0,
-
- /// <summary>
- /// Predefined font stretch : Ultra-condensed (1).
- /// </summary>
- DWRITE_FONT_STRETCH_ULTRA_CONDENSED = 1,
-
- /// <summary>
- /// Predefined font stretch : Extra-condensed (2).
- /// </summary>
- DWRITE_FONT_STRETCH_EXTRA_CONDENSED = 2,
-
- /// <summary>
- /// Predefined font stretch : Condensed (3).
- /// </summary>
- DWRITE_FONT_STRETCH_CONDENSED = 3,
-
- /// <summary>
- /// Predefined font stretch : Semi-condensed (4).
- /// </summary>
- DWRITE_FONT_STRETCH_SEMI_CONDENSED = 4,
-
- /// <summary>
- /// Predefined font stretch : Normal (5).
- /// </summary>
- DWRITE_FONT_STRETCH_NORMAL = 5,
-
- /// <summary>
- /// Predefined font stretch : Medium (5).
- /// </summary>
- DWRITE_FONT_STRETCH_MEDIUM = 5,
-
- /// <summary>
- /// Predefined font stretch : Semi-expanded (6).
- /// </summary>
- DWRITE_FONT_STRETCH_SEMI_EXPANDED = 6,
-
- /// <summary>
- /// Predefined font stretch : Expanded (7).
- /// </summary>
- DWRITE_FONT_STRETCH_EXPANDED = 7,
-
- /// <summary>
- /// Predefined font stretch : Extra-expanded (8).
- /// </summary>
- DWRITE_FONT_STRETCH_EXTRA_EXPANDED = 8,
-
- /// <summary>
- /// Predefined font stretch : Ultra-expanded (9).
- /// </summary>
- DWRITE_FONT_STRETCH_ULTRA_EXPANDED = 9
-};
-
-/// <summary>
-/// The font style enumeration describes the slope style of a font face, such as Normal, Italic or Oblique.
-/// Values other than the ones defined in the enumeration are considered to be invalid, and they are rejected by font API functions.
-/// </summary>
-enum DWRITE_FONT_STYLE
-{
- /// <summary>
- /// Font slope style : Normal.
- /// </summary>
- DWRITE_FONT_STYLE_NORMAL,
-
- /// <summary>
- /// Font slope style : Oblique.
- /// </summary>
- DWRITE_FONT_STYLE_OBLIQUE,
-
- /// <summary>
- /// Font slope style : Italic.
- /// </summary>
- DWRITE_FONT_STYLE_ITALIC
-
-};
-
-/// <summary>
-/// The informational string enumeration identifies a string in a font.
-/// </summary>
-enum DWRITE_INFORMATIONAL_STRING_ID
-{
- /// <summary>
- /// Unspecified name ID.
- /// </summary>
- DWRITE_INFORMATIONAL_STRING_NONE,
-
- /// <summary>
- /// Copyright notice provided by the font.
- /// </summary>
- DWRITE_INFORMATIONAL_STRING_COPYRIGHT_NOTICE,
-
- /// <summary>
- /// String containing a version number.
- /// </summary>
- DWRITE_INFORMATIONAL_STRING_VERSION_STRINGS,
-
- /// <summary>
- /// Trademark information provided by the font.
- /// </summary>
- DWRITE_INFORMATIONAL_STRING_TRADEMARK,
-
- /// <summary>
- /// Name of the font manufacturer.
- /// </summary>
- DWRITE_INFORMATIONAL_STRING_MANUFACTURER,
-
- /// <summary>
- /// Name of the font designer.
- /// </summary>
- DWRITE_INFORMATIONAL_STRING_DESIGNER,
-
- /// <summary>
- /// URL of font designer (with protocol, e.g., http://, ftp://).
- /// </summary>
- DWRITE_INFORMATIONAL_STRING_DESIGNER_URL,
-
- /// <summary>
- /// Description of the font. Can contain revision information, usage recommendations, history, features, etc.
- /// </summary>
- DWRITE_INFORMATIONAL_STRING_DESCRIPTION,
-
- /// <summary>
- /// URL of font vendor (with protocol, e.g., http://, ftp://). If a unique serial number is embedded in the URL, it can be used to register the font.
- /// </summary>
- DWRITE_INFORMATIONAL_STRING_FONT_VENDOR_URL,
-
- /// <summary>
- /// Description of how the font may be legally used, or different example scenarios for licensed use. This field should be written in plain language, not legalese.
- /// </summary>
- DWRITE_INFORMATIONAL_STRING_LICENSE_DESCRIPTION,
-
- /// <summary>
- /// URL where additional licensing information can be found.
- /// </summary>
- DWRITE_INFORMATIONAL_STRING_LICENSE_INFO_URL,
-
- /// <summary>
- /// GDI-compatible family name. Because GDI allows a maximum of four fonts per family, fonts in the same family may have different GDI-compatible family names
- /// (e.g., "Arial", "Arial Narrow", "Arial Black").
- /// </summary>
- DWRITE_INFORMATIONAL_STRING_WIN32_FAMILY_NAMES,
-
- /// <summary>
- /// GDI-compatible subfamily name.
- /// </summary>
- DWRITE_INFORMATIONAL_STRING_WIN32_SUBFAMILY_NAMES,
-
- /// <summary>
- /// Family name preferred by the designer. This enables font designers to group more than four fonts in a single family without losing compatibility with
- /// GDI. This name is typically only present if it differs from the GDI-compatible family name.
- /// </summary>
- DWRITE_INFORMATIONAL_STRING_PREFERRED_FAMILY_NAMES,
-
- /// <summary>
- /// Subfamily name preferred by the designer. This name is typically only present if it differs from the GDI-compatible subfamily name.
- /// </summary>
- DWRITE_INFORMATIONAL_STRING_PREFERRED_SUBFAMILY_NAMES,
-
- /// <summary>
- /// Sample text. This can be the font name or any other text that the designer thinks is the best example to display the font in.
- /// </summary>
- DWRITE_INFORMATIONAL_STRING_SAMPLE_TEXT
-};
-
-
-/// <summary>
-/// The DWRITE_FONT_METRICS structure specifies the metrics of a font face that
-/// are applicable to all glyphs within the font face.
-/// </summary>
-struct DWRITE_FONT_METRICS
-{
- /// <summary>
- /// The number of font design units per em unit.
- /// Font files use their own coordinate system of font design units.
- /// A font design unit is the smallest measurable unit in the em square,
- /// an imaginary square that is used to size and align glyphs.
- /// The concept of em square is used as a reference scale factor when defining font size and device transformation semantics.
- /// The size of one em square is also commonly used to compute the paragraph identation value.
- /// </summary>
- UINT16 designUnitsPerEm;
-
- /// <summary>
- /// Ascent value of the font face in font design units.
- /// Ascent is the distance from the top of font character alignment box to English baseline.
- /// </summary>
- UINT16 ascent;
-
- /// <summary>
- /// Descent value of the font face in font design units.
- /// Descent is the distance from the bottom of font character alignment box to English baseline.
- /// </summary>
- UINT16 descent;
-
- /// <summary>
- /// Line gap in font design units.
- /// Recommended additional white space to add between lines to improve legibility. The recommended line spacing
- /// (baseline-to-baseline distance) is thus the sum of ascent, descent, and lineGap. The line gap is usually
- /// positive or zero but can be negative, in which case the recommended line spacing is less than the height
- /// of the character alignment box.
- /// </summary>
- INT16 lineGap;
-
- /// <summary>
- /// Cap height value of the font face in font design units.
- /// Cap height is the distance from English baseline to the top of a typical English capital.
- /// Capital "H" is often used as a reference character for the purpose of calculating the cap height value.
- /// </summary>
- UINT16 capHeight;
-
- /// <summary>
- /// x-height value of the font face in font design units.
- /// x-height is the distance from English baseline to the top of lowercase letter "x", or a similar lowercase character.
- /// </summary>
- UINT16 xHeight;
-
- /// <summary>
- /// The underline position value of the font face in font design units.
- /// Underline position is the position of underline relative to the English baseline.
- /// The value is usually made negative in order to place the underline below the baseline.
- /// </summary>
- INT16 underlinePosition;
-
- /// <summary>
- /// The suggested underline thickness value of the font face in font design units.
- /// </summary>
- UINT16 underlineThickness;
-
- /// <summary>
- /// The strikethrough position value of the font face in font design units.
- /// Strikethrough position is the position of strikethrough relative to the English baseline.
- /// The value is usually made positive in order to place the strikethrough above the baseline.
- /// </summary>
- INT16 strikethroughPosition;
-
- /// <summary>
- /// The suggested strikethrough thickness value of the font face in font design units.
- /// </summary>
- UINT16 strikethroughThickness;
-};
-
-/// <summary>
-/// The DWRITE_GLYPH_METRICS structure specifies the metrics of an individual glyph.
-/// The units depend on how the metrics are obtained.
-/// </summary>
-struct DWRITE_GLYPH_METRICS
-{
- /// <summary>
- /// Specifies the X offset from the glyph origin to the left edge of the black box.
- /// The glyph origin is the current horizontal writing position.
- /// A negative value means the black box extends to the left of the origin (often true for lowercase italic 'f').
- /// </summary>
- INT32 leftSideBearing;
-
- /// <summary>
- /// Specifies the X offset from the origin of the current glyph to the origin of the next glyph when writing horizontally.
- /// </summary>
- UINT32 advanceWidth;
-
- /// <summary>
- /// Specifies the X offset from the right edge of the black box to the origin of the next glyph when writing horizontally.
- /// The value is negative when the right edge of the black box overhangs the layout box.
- /// </summary>
- INT32 rightSideBearing;
-
- /// <summary>
- /// Specifies the vertical offset from the vertical origin to the top of the black box.
- /// Thus, a positive value adds whitespace whereas a negative value means the glyph overhangs the top of the layout box.
- /// </summary>
- INT32 topSideBearing;
-
- /// <summary>
- /// Specifies the Y offset from the vertical origin of the current glyph to the vertical origin of the next glyph when writing vertically.
- /// (Note that the term "origin" by itself denotes the horizontal origin. The vertical origin is different.
- /// Its Y coordinate is specified by verticalOriginY value,
- /// and its X coordinate is half the advanceWidth to the right of the horizontal origin).
- /// </summary>
- UINT32 advanceHeight;
-
- /// <summary>
- /// Specifies the vertical distance from the black box's bottom edge to the advance height.
- /// Positive when the bottom edge of the black box is within the layout box.
- /// Negative when the bottom edge of black box overhangs the layout box.
- /// </summary>
- INT32 bottomSideBearing;
-
- /// <summary>
- /// Specifies the Y coordinate of a glyph's vertical origin, in the font's design coordinate system.
- /// The y coordinate of a glyph's vertical origin is the sum of the glyph's top side bearing
- /// and the top (i.e. yMax) of the glyph's bounding box.
- /// </summary>
- INT32 verticalOriginY;
-};
-
-/// <summary>
-/// Optional adjustment to a glyph's position. An glyph offset changes the position of a glyph without affecting
-/// the pen position. Offsets are in logical, pre-transform units.
-/// </summary>
-struct DWRITE_GLYPH_OFFSET
-{
- /// <summary>
- /// Offset in the advance direction of the run. A positive advance offset moves the glyph to the right
- /// (in pre-transform coordinates) if the run is left-to-right or to the left if the run is right-to-left.
- /// </summary>
- FLOAT advanceOffset;
-
- /// <summary>
- /// Offset in the ascent direction, i.e., the direction ascenders point. A positive ascender offset moves
- /// the glyph up (in pre-transform coordinates).
- /// </summary>
- FLOAT ascenderOffset;
-};
-
-/// <summary>
-/// Specifies the type of DirectWrite factory object.
-/// DirectWrite factory contains internal state such as font loader registration and cached font data.
-/// In most cases it is recommended to use the shared factory object, because it allows multiple components
-/// that use DirectWrite to share internal DirectWrite state and reduce memory usage.
-/// However, there are cases when it is desirable to reduce the impact of a component,
-/// such as a plug-in from an untrusted source, on the rest of the process by sandboxing and isolating it
-/// from the rest of the process components. In such cases, it is recommended to use an isolated factory for the sandboxed
-/// component.
-/// </summary>
-enum DWRITE_FACTORY_TYPE
-{
- /// <summary>
- /// Shared factory allow for re-use of cached font data across multiple in process components.
- /// Such factories also take advantage of cross process font caching components for better performance.
- /// </summary>
- DWRITE_FACTORY_TYPE_SHARED,
-
- /// <summary>
- /// Objects created from the isolated factory do not interact with internal DirectWrite state from other components.
- /// </summary>
- DWRITE_FACTORY_TYPE_ISOLATED
-};
-
-// Creates an OpenType tag as a 32bit integer such that
-// the first character in the tag is the lowest byte,
-// (least significant on little endian architectures)
-// which can be used to compare with tags in the font file.
-// This macro is compatible with DWRITE_FONT_FEATURE_TAG.
-//
-// Example: DWRITE_MAKE_OPENTYPE_TAG('c','c','m','p')
-// Dword: 0x706D6363
-//
-#define DWRITE_MAKE_OPENTYPE_TAG(a,b,c,d) ( \
- (static_cast<UINT32>(static_cast<UINT8>(d)) << 24) | \
- (static_cast<UINT32>(static_cast<UINT8>(c)) << 16) | \
- (static_cast<UINT32>(static_cast<UINT8>(b)) << 8) | \
- static_cast<UINT32>(static_cast<UINT8>(a)))
-
-interface IDWriteFontFileStream;
-
-/// <summary>
-/// Font file loader interface handles loading font file resources of a particular type from a key.
-/// The font file loader interface is recommended to be implemented by a singleton object.
-/// IMPORTANT: font file loader implementations must not register themselves with DirectWrite factory
-/// inside their constructors and must not unregister themselves in their destructors, because
-/// registration and unregistraton operations increment and decrement the object reference count respectively.
-/// Instead, registration and unregistration of font file loaders with DirectWrite factory should be performed
-/// outside of the font file loader implementation as a separate step.
-/// </summary>
-interface DWRITE_DECLARE_INTERFACE("727cad4e-d6af-4c9e-8a08-d695b11caa49") IDWriteFontFileLoader : public IUnknown
-{
- /// <summary>
- /// Creates a font file stream object that encapsulates an open file resource.
- /// The resource is closed when the last reference to fontFileStream is released.
- /// </summary>
- /// <param name="fontFileReferenceKey">Font file reference key that uniquely identifies the font file resource
- /// within the scope of the font loader being used.</param>
- /// <param name="fontFileReferenceKeySize">Size of font file reference key in bytes.</param>
- /// <param name="fontFileStream">Pointer to the newly created font file stream.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(CreateStreamFromKey)(
- __in_bcount(fontFileReferenceKeySize) void const* fontFileReferenceKey,
- UINT32 fontFileReferenceKeySize,
- __out IDWriteFontFileStream** fontFileStream
- ) PURE;
-};
-
-/// <summary>
-/// A built-in implementation of IDWriteFontFileLoader interface that operates on local font files
-/// and exposes local font file information from the font file reference key.
-/// Font file references created using CreateFontFileReference use this font file loader.
-/// </summary>
-interface DWRITE_DECLARE_INTERFACE("b2d9f3ec-c9fe-4a11-a2ec-d86208f7c0a2") IDWriteLocalFontFileLoader : public IDWriteFontFileLoader
-{
- /// <summary>
- /// Obtains the length of the absolute file path from the font file reference key.
- /// </summary>
- /// <param name="fontFileReferenceKey">Font file reference key that uniquely identifies the local font file
- /// within the scope of the font loader being used.</param>
- /// <param name="fontFileReferenceKeySize">Size of font file reference key in bytes.</param>
- /// <param name="filePathLength">Length of the file path string not including the terminated NULL character.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetFilePathLengthFromKey)(
- __in_bcount(fontFileReferenceKeySize) void const* fontFileReferenceKey,
- UINT32 fontFileReferenceKeySize,
- __out UINT32* filePathLength
- ) PURE;
-
- /// <summary>
- /// Obtains the absolute font file path from the font file reference key.
- /// </summary>
- /// <param name="fontFileReferenceKey">Font file reference key that uniquely identifies the local font file
- /// within the scope of the font loader being used.</param>
- /// <param name="fontFileReferenceKeySize">Size of font file reference key in bytes.</param>
- /// <param name="filePath">Character array that receives the local file path.</param>
- /// <param name="filePathSize">Size of the filePath array in character count including the terminated NULL character.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetFilePathFromKey)(
- __in_bcount(fontFileReferenceKeySize) void const* fontFileReferenceKey,
- UINT32 fontFileReferenceKeySize,
- __out_ecount_z(filePathSize) WCHAR* filePath,
- UINT32 filePathSize
- ) PURE;
-
- /// <summary>
- /// Obtains the last write time of the file from the font file reference key.
- /// </summary>
- /// <param name="fontFileReferenceKey">Font file reference key that uniquely identifies the local font file
- /// within the scope of the font loader being used.</param>
- /// <param name="fontFileReferenceKeySize">Size of font file reference key in bytes.</param>
- /// <param name="lastWriteTime">Last modified time of the font file.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetLastWriteTimeFromKey)(
- __in_bcount(fontFileReferenceKeySize) void const* fontFileReferenceKey,
- UINT32 fontFileReferenceKeySize,
- __out FILETIME* lastWriteTime
- ) PURE;
-};
-
-/// <summary>
-/// The interface for loading font file data.
-/// </summary>
-interface DWRITE_DECLARE_INTERFACE("6d4865fe-0ab8-4d91-8f62-5dd6be34a3e0") IDWriteFontFileStream : public IUnknown
-{
- /// <summary>
- /// Reads a fragment from a file.
- /// </summary>
- /// <param name="fragmentStart">Receives the pointer to the start of the font file fragment.</param>
- /// <param name="fileOffset">Offset of the fragment from the beginning of the font file.</param>
- /// <param name="fragmentSize">Size of the fragment in bytes.</param>
- /// <param name="fragmentContext">The client defined context to be passed to the ReleaseFileFragment.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- /// <remarks>
- /// IMPORTANT: ReadFileFragment() implementations must check whether the requested file fragment
- /// is within the file bounds. Otherwise, an error should be returned from ReadFileFragment.
- /// </remarks>
- STDMETHOD(ReadFileFragment)(
- __deref_out_bcount(fragmentSize) void const** fragmentStart,
- UINT64 fileOffset,
- UINT64 fragmentSize,
- __out void** fragmentContext
- ) PURE;
-
- /// <summary>
- /// Releases a fragment from a file.
- /// </summary>
- /// <param name="fragmentContext">The client defined context of a font fragment returned from ReadFileFragment.</param>
- STDMETHOD_(void, ReleaseFileFragment)(
- void* fragmentContext
- ) PURE;
-
- /// <summary>
- /// Obtains the total size of a file.
- /// </summary>
- /// <param name="fileSize">Receives the total size of the file.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- /// <remarks>
- /// Implementing GetFileSize() for asynchronously loaded font files may require
- /// downloading the complete file contents, therefore this method should only be used for operations that
- /// either require complete font file to be loaded (e.g., copying a font file) or need to make
- /// decisions based on the value of the file size (e.g., validation against a persisted file size).
- /// </remarks>
- STDMETHOD(GetFileSize)(
- __out UINT64* fileSize
- ) PURE;
-
- /// <summary>
- /// Obtains the last modified time of the file. The last modified time is used by DirectWrite font selection algorithms
- /// to determine whether one font resource is more up to date than another one.
- /// </summary>
- /// <param name="lastWriteTime">Receives the last modifed time of the file in the format that represents
- /// the number of 100-nanosecond intervals since January 1, 1601 (UTC).</param>
- /// <returns>
- /// Standard HRESULT error code. For resources that don't have a concept of the last modified time, the implementation of
- /// GetLastWriteTime should return E_NOTIMPL.
- /// </returns>
- STDMETHOD(GetLastWriteTime)(
- __out UINT64* lastWriteTime
- ) PURE;
-};
-
-/// <summary>
-/// The interface that represents a reference to a font file.
-/// </summary>
-interface DWRITE_DECLARE_INTERFACE("739d886a-cef5-47dc-8769-1a8b41bebbb0") IDWriteFontFile : public IUnknown
-{
- /// <summary>
- /// This method obtains the pointer to the reference key of a font file. The pointer is only valid until the object that refers to it is released.
- /// </summary>
- /// <param name="fontFileReferenceKey">Pointer to the font file reference key.
- /// IMPORTANT: The pointer value is valid until the font file reference object it is obtained from is released.</param>
- /// <param name="fontFileReferenceKeySize">Size of font file reference key in bytes.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetReferenceKey)(
- __deref_out_bcount(*fontFileReferenceKeySize) void const** fontFileReferenceKey,
- __out UINT32* fontFileReferenceKeySize
- ) PURE;
-
- /// <summary>
- /// Obtains the file loader associated with a font file object.
- /// </summary>
- /// <param name="fontFileLoader">The font file loader associated with the font file object.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetLoader)(
- __out IDWriteFontFileLoader** fontFileLoader
- ) PURE;
-
- /// <summary>
- /// Analyzes a file and returns whether it represents a font, and whether the font type is supported by the font system.
- /// </summary>
- /// <param name="isSupportedFontType">TRUE if the font type is supported by the font system, FALSE otherwise.</param>
- /// <param name="fontFileType">The type of the font file. Note that even if isSupportedFontType is FALSE,
- /// the fontFileType value may be different from DWRITE_FONT_FILE_TYPE_UNKNOWN.</param>
- /// <param name="fontFaceType">The type of the font face that can be constructed from the font file.
- /// Note that even if isSupportedFontType is FALSE, the fontFaceType value may be different from
- /// DWRITE_FONT_FACE_TYPE_UNKNOWN.</param>
- /// <param name="numberOfFaces">Number of font faces contained in the font file.</param>
- /// <returns>
- /// Standard HRESULT error code if there was a processing error during analysis.
- /// </returns>
- /// <remarks>
- /// IMPORTANT: certain font file types are recognized, but not supported by the font system.
- /// For example, the font system will recognize a file as a Type 1 font file,
- /// but will not be able to construct a font face object from it. In such situations, Analyze will set
- /// isSupportedFontType output parameter to FALSE.
- /// </remarks>
- STDMETHOD(Analyze)(
- __out BOOL* isSupportedFontType,
- __out DWRITE_FONT_FILE_TYPE* fontFileType,
- __out_opt DWRITE_FONT_FACE_TYPE* fontFaceType,
- __out UINT32* numberOfFaces
- ) PURE;
-};
-
-/// <summary>
-/// Represents the internal structure of a device pixel (i.e., the physical arrangement of red,
-/// green, and blue color components) that is assumed for purposes of rendering text.
-/// </summary>
-#ifndef DWRITE_PIXEL_GEOMETRY_DEFINED
-enum DWRITE_PIXEL_GEOMETRY
-{
- /// <summary>
- /// The red, green, and blue color components of each pixel are assumed to occupy the same point.
- /// </summary>
- DWRITE_PIXEL_GEOMETRY_FLAT,
-
- /// <summary>
- /// Each pixel comprises three vertical stripes, with red on the left, green in the center, and
- /// blue on the right. This is the most common pixel geometry for LCD monitors.
- /// </summary>
- DWRITE_PIXEL_GEOMETRY_RGB,
-
- /// <summary>
- /// Each pixel comprises three vertical stripes, with blue on the left, green in the center, and
- /// red on the right.
- /// </summary>
- DWRITE_PIXEL_GEOMETRY_BGR
-};
-#define DWRITE_PIXEL_GEOMETRY_DEFINED
-#endif
-
-/// <summary>
-/// Represents a method of rendering glyphs.
-/// </summary>
-enum DWRITE_RENDERING_MODE
-{
- /// <summary>
- /// Specifies that the rendering mode is determined automatically based on the font and size.
- /// </summary>
- DWRITE_RENDERING_MODE_DEFAULT,
-
- /// <summary>
- /// Specifies that no anti-aliasing is performed. Each pixel is either set to the foreground
- /// color of the text or retains the color of the background.
- /// </summary>
- DWRITE_RENDERING_MODE_ALIASED,
-
- /// <summary>
- /// Specifies ClearType rendering with the same metrics as aliased text. Glyphs can only
- /// be positioned on whole-pixel boundaries.
- /// </summary>
- DWRITE_RENDERING_MODE_CLEARTYPE_GDI_CLASSIC,
-
- /// <summary>
- /// Specifies ClearType rendering with the same metrics as text rendering using GDI using a font
- /// created with CLEARTYPE_NATURAL_QUALITY. Glyph metrics are closer to their ideal values than
- /// with aliased text, but glyphs are still positioned on whole-pixel boundaries.
- /// </summary>
- DWRITE_RENDERING_MODE_CLEARTYPE_GDI_NATURAL,
-
- /// <summary>
- /// Specifies ClearType rendering with anti-aliasing in the horizontal dimension only. This is
- /// typically used with small to medium font sizes (up to 16 ppem).
- /// </summary>
- DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL,
-
- /// <summary>
- /// Specifies ClearType rendering with anti-aliasing in both horizontal and vertical dimensions.
- /// This is typically used at larger sizes to makes curves and diagonal lines look smoother, at
- /// the expense of some softness.
- /// </summary>
- DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL_SYMMETRIC,
-
- /// <summary>
- /// Specifies that rendering should bypass the rasterizer and use the outlines directly. This is
- /// typically used at very large sizes.
- /// </summary>
- DWRITE_RENDERING_MODE_OUTLINE
-};
-
-/// <summary>
-/// The DWRITE_MATRIX structure specifies the graphics transform to be applied
-/// to rendered glyphs.
-/// </summary>
-struct DWRITE_MATRIX
-{
- /// <summary>
- /// Horizontal scaling / cosine of rotation
- /// </summary>
- FLOAT m11;
-
- /// <summary>
- /// Vertical shear / sine of rotation
- /// </summary>
- FLOAT m12;
-
- /// <summary>
- /// Horizontal shear / negative sine of rotation
- /// </summary>
- FLOAT m21;
-
- /// <summary>
- /// Vertical scaling / cosine of rotation
- /// </summary>
- FLOAT m22;
-
- /// <summary>
- /// Horizontal shift (always orthogonal regardless of rotation)
- /// </summary>
- FLOAT dx;
-
- /// <summary>
- /// Vertical shift (always orthogonal regardless of rotation)
- /// </summary>
- FLOAT dy;
-};
-
-/// <summary>
-/// The interface that represents text rendering settings for glyph rasterization and filtering.
-/// </summary>
-interface DWRITE_DECLARE_INTERFACE("2f0da53a-2add-47cd-82ee-d9ec34688e75") IDWriteRenderingParams : public IUnknown
-{
- /// <summary>
- /// Gets the gamma value used for gamma correction. Valid values must be
- /// greater than zero and cannot exceed 256.
- /// </summary>
- STDMETHOD_(FLOAT, GetGamma)() PURE;
-
- /// <summary>
- /// Gets the amount of contrast enhancement. Valid values are greater than
- /// or equal to zero.
- /// </summary>
- STDMETHOD_(FLOAT, GetEnhancedContrast)() PURE;
-
- /// <summary>
- /// Gets the ClearType level. Valid values range from 0.0f (no ClearType)
- /// to 1.0f (full ClearType).
- /// </summary>
- STDMETHOD_(FLOAT, GetClearTypeLevel)() PURE;
-
- /// <summary>
- /// Gets the pixel geometry.
- /// </summary>
- STDMETHOD_(DWRITE_PIXEL_GEOMETRY, GetPixelGeometry)() PURE;
-
- /// <summary>
- /// Gets the rendering mode.
- /// </summary>
- STDMETHOD_(DWRITE_RENDERING_MODE, GetRenderingMode)() PURE;
-};
-
-// Forward declarations of D2D types
-interface ID2D1SimplifiedGeometrySink;
-
-typedef ID2D1SimplifiedGeometrySink IDWriteGeometrySink;
-
-/// <summary>
-/// The interface that represents an absolute reference to a font face.
-/// It contains font face type, appropriate file references and face identification data.
-/// Various font data such as metrics, names and glyph outlines is obtained from IDWriteFontFace.
-/// </summary>
-interface DWRITE_DECLARE_INTERFACE("5f49804d-7024-4d43-bfa9-d25984f53849") IDWriteFontFace : public IUnknown
-{
- /// <summary>
- /// Obtains the file format type of a font face.
- /// </summary>
- STDMETHOD_(DWRITE_FONT_FACE_TYPE, GetType)() PURE;
-
- /// <summary>
- /// Obtains the font files representing a font face.
- /// </summary>
- /// <param name="numberOfFiles">The number of files representing the font face.</param>
- /// <param name="fontFiles">User provided array that stores pointers to font files representing the font face.
- /// This parameter can be NULL if the user is only interested in the number of files representing the font face.
- /// This API increments reference count of the font file pointers returned according to COM conventions, and the client
- /// should release them when finished.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetFiles)(
- __inout UINT32* numberOfFiles,
- __out_ecount_opt(*numberOfFiles) IDWriteFontFile** fontFiles
- ) PURE;
-
- /// <summary>
- /// Obtains the zero-based index of the font face in its font file or files. If the font files contain a single face,
- /// the return value is zero.
- /// </summary>
- STDMETHOD_(UINT32, GetIndex)() PURE;
-
- /// <summary>
- /// Obtains the algorithmic style simulation flags of a font face.
- /// </summary>
- STDMETHOD_(DWRITE_FONT_SIMULATIONS, GetSimulations)() PURE;
-
- /// <summary>
- /// Determines whether the font is a symbol font.
- /// </summary>
- STDMETHOD_(BOOL, IsSymbolFont)() PURE;
-
- /// <summary>
- /// Obtains design units and common metrics for the font face.
- /// These metrics are applicable to all the glyphs within a fontface and are used by applications for layout calculations.
- /// </summary>
- /// <param name="fontFaceMetrics">Points to a DWRITE_FONT_METRICS structure to fill in.
- /// The metrics returned by this function are in font design units.</param>
- STDMETHOD_(void, GetMetrics)(
- __out DWRITE_FONT_METRICS* fontFaceMetrics
- ) PURE;
-
- /// <summary>
- /// Obtains the number of glyphs in the font face.
- /// </summary>
- STDMETHOD_(UINT16, GetGlyphCount)() PURE;
-
- /// <summary>
- /// Obtains ideal glyph metrics in font design units. Design glyphs metrics are used for glyph positioning.
- /// </summary>
- /// <param name="glyphIndices">An array of glyph indices to compute the metrics for.</param>
- /// <param name="glyphCount">The number of elements in the glyphIndices array.</param>
- /// <param name="glyphMetrics">Array of DWRITE_GLYPH_METRICS structures filled by this function.
- /// The metrics returned by this function are in font design units.</param>
- /// <param name="isSideways">Indicates whether the font is being used in a sideways run.
- /// This can affect the glyph metrics if the font has oblique simulation
- /// because sideways oblique simulation differs from non-sideways oblique simulation.</param>
- /// <returns>
- /// Standard HRESULT error code. If any of the input glyph indices are outside of the valid glyph index range
- /// for the current font face, E_INVALIDARG will be returned.
- /// </returns>
- STDMETHOD(GetDesignGlyphMetrics)(
- __in_ecount(glyphCount) UINT16 const* glyphIndices,
- UINT32 glyphCount,
- __out_ecount(glyphCount) DWRITE_GLYPH_METRICS* glyphMetrics,
- BOOL isSideways = FALSE
- ) PURE;
-
- /// <summary>
- /// Returns the nominal mapping of UCS4 Unicode code points to glyph indices as defined by the font 'CMAP' table.
- /// Note that this mapping is primarily provided for line layout engines built on top of the physical font API.
- /// Because of OpenType glyph substitution and line layout character substitution, the nominal conversion does not always correspond
- /// to how a Unicode string will map to glyph indices when rendering using a particular font face.
- /// Also, note that Unicode Variant Selectors provide for alternate mappings for character to glyph.
- /// This call will always return the default variant.
- /// </summary>
- /// <param name="codePoints">An array of USC4 code points to obtain nominal glyph indices from.</param>
- /// <param name="codePointCount">The number of elements in the codePoints array.</param>
- /// <param name="glyphIndices">Array of nominal glyph indices filled by this function.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetGlyphIndices)(
- __in_ecount(codePointCount) UINT32 const* codePoints,
- UINT32 codePointCount,
- __out_ecount(codePointCount) UINT16* glyphIndices
- ) PURE;
-
- /// <summary>
- /// Finds the specified OpenType font table if it exists and returns a pointer to it.
- /// The function accesses the underling font data via the IDWriteFontStream interface
- /// implemented by the font file loader.
- /// </summary>
- /// <param name="openTypeTableTag">Four character tag of table to find.
- /// Use the DWRITE_MAKE_OPENTYPE_TAG() macro to create it.
- /// Unlike GDI, it does not support the special TTCF and null tags to access the whole font.</param>
- /// <param name="tableData">
- /// Pointer to base of table in memory.
- /// The pointer is only valid so long as the FontFace used to get the font table still exists
- /// (not any other FontFace, even if it actually refers to the same physical font).
- /// </param>
- /// <param name="tableSize">Byte size of table.</param>
- /// <param name="tableContext">
- /// Opaque context which must be freed by calling ReleaseFontTable.
- /// The context actually comes from the lower level IDWriteFontFileStream,
- /// which may be implemented by the application or DWrite itself.
- /// It is possible for a NULL tableContext to be returned, especially if
- /// the implementation directly memory maps the whole file.
- /// Nevertheless, always release it later, and do not use it as a test for function success.
- /// The same table can be queried multiple times,
- /// but each returned context can be different, so release each separately.
- /// </param>
- /// <param name="exists">True if table exists.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// If a table can not be found, the function will not return an error, but the size will be 0, table NULL, and exists = FALSE.
- /// The context does not need to be freed if the table was not found.
- /// </returns>
- /// <remarks>
- /// The context for the same tag may be different for each call,
- /// so each one must be held and released separately.
- /// </remarks>
- STDMETHOD(TryGetFontTable)(
- __in UINT32 openTypeTableTag,
- __deref_out_bcount(*tableSize) const void** tableData,
- __out UINT32* tableSize,
- __out void** tableContext,
- __out BOOL* exists
- ) PURE;
-
- /// <summary>
- /// Releases the table obtained earlier from TryGetFontTable.
- /// </summary>
- /// <param name="tableContext">Opaque context from TryGetFontTable.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD_(void, ReleaseFontTable)(
- __in void* tableContext
- ) PURE;
-
- /// <summary>
- /// Computes the outline of a run of glyphs by calling back to the outline sink interface.
- /// </summary>
- /// <param name="emSize">Logical size of the font in DIP units. A DIP ("device-independent pixel") equals 1/96 inch.</param>
- /// <param name="glyphIndices">Array of glyph indices.</param>
- /// <param name="glyphAdvances">Optional array of glyph advances in DIPs.</param>
- /// <param name="glyphOffsets">Optional array of glyph offsets.</param>
- /// <param name="glyphCount">Number of glyphs.</param>
- /// <param name="isSideways">If true, specifies that glyphs are rotated 90 degrees to the left and vertical metrics are used.
- /// A client can render a vertical run by specifying isSideways = true and rotating the resulting geometry 90 degrees to the
- /// right using a transform. The isSideways and isRightToLeft parameters cannot both be true.</param>
- /// <param name="isRightToLeft">If true, specifies that the advance direction is right to left. By default, the advance direction
- /// is left to right.</param>
- /// <param name="geometrySink">Interface the function calls back to draw each element of the geometry.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetGlyphRunOutline)(
- FLOAT emSize,
- __in_ecount(glyphCount) UINT16 const* glyphIndices,
- __in_ecount_opt(glyphCount) FLOAT const* glyphAdvances,
- __in_ecount_opt(glyphCount) DWRITE_GLYPH_OFFSET const* glyphOffsets,
- UINT32 glyphCount,
- BOOL isSideways,
- BOOL isRightToLeft,
- IDWriteGeometrySink* geometrySink
- ) PURE;
-
- /// <summary>
- /// Determines the recommended rendering mode for the font given the specified size and rendering parameters.
- /// </summary>
- /// <param name="emSize">Logical size of the font in DIP units. A DIP ("device-independent pixel") equals 1/96 inch.</param>
- /// <param name="pixelsPerDip">Number of physical pixels per DIP. For example, if the DPI of the rendering surface is 96 this
- /// value is 1.0f. If the DPI is 120, this value is 120.0f/96.</param>
- /// <param name="measuringMode">Specifies measuring method that will be used for glyphs in the font.
- /// Renderer implementations may choose different rendering modes for given measuring methods, but
- /// best results are seen when the corresponding modes match:
- /// DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL for DWRITE_MEASURING_MODE_NATURAL
- /// DWRITE_RENDERING_MODE_CLEARTYPE_GDI_CLASSIC for DWRITE_MEASURING_MODE_GDI_CLASSIC
- /// DWRITE_RENDERING_MODE_CLEARTYPE_GDI_NATURAL for DWRITE_MEASURING_MODE_GDI_NATURAL
- /// </param>
- /// <param name="renderingParams">Rendering parameters object. This parameter is necessary in case the rendering parameters
- /// object overrides the rendering mode.</param>
- /// <param name="renderingMode">Receives the recommended rendering mode to use.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetRecommendedRenderingMode)(
- FLOAT emSize,
- FLOAT pixelsPerDip,
- DWRITE_MEASURING_MODE measuringMode,
- IDWriteRenderingParams* renderingParams,
- __out DWRITE_RENDERING_MODE* renderingMode
- ) PURE;
-
- /// <summary>
- /// Obtains design units and common metrics for the font face.
- /// These metrics are applicable to all the glyphs within a fontface and are used by applications for layout calculations.
- /// </summary>
- /// <param name="emSize">Logical size of the font in DIP units. A DIP ("device-independent pixel") equals 1/96 inch.</param>
- /// <param name="pixelsPerDip">Number of physical pixels per DIP. For example, if the DPI of the rendering surface is 96 this
- /// value is 1.0f. If the DPI is 120, this value is 120.0f/96.</param>
- /// <param name="transform">Optional transform applied to the glyphs and their positions. This transform is applied after the
- /// scaling specified by the font size and pixelsPerDip.</param>
- /// <param name="fontFaceMetrics">Points to a DWRITE_FONT_METRICS structure to fill in.
- /// The metrics returned by this function are in font design units.</param>
- STDMETHOD(GetGdiCompatibleMetrics)(
- FLOAT emSize,
- FLOAT pixelsPerDip,
- __in_opt DWRITE_MATRIX const* transform,
- __out DWRITE_FONT_METRICS* fontFaceMetrics
- ) PURE;
-
-
- /// <summary>
- /// Obtains glyph metrics in font design units with the return values compatible with what GDI would produce.
- /// Glyphs metrics are used for positioning of individual glyphs.
- /// </summary>
- /// <param name="emSize">Logical size of the font in DIP units. A DIP ("device-independent pixel") equals 1/96 inch.</param>
- /// <param name="pixelsPerDip">Number of physical pixels per DIP. For example, if the DPI of the rendering surface is 96 this
- /// value is 1.0f. If the DPI is 120, this value is 120.0f/96.</param>
- /// <param name="transform">Optional transform applied to the glyphs and their positions. This transform is applied after the
- /// scaling specified by the font size and pixelsPerDip.</param>
- /// <param name="useGdiNatural">
- /// When set to FALSE, the metrics are the same as the metrics of GDI aliased text.
- /// When set to TRUE, the metrics are the same as the metrics of text measured by GDI using a font
- /// created with CLEARTYPE_NATURAL_QUALITY.
- /// </param>
- /// <param name="glyphIndices">An array of glyph indices to compute the metrics for.</param>
- /// <param name="glyphCount">The number of elements in the glyphIndices array.</param>
- /// <param name="glyphMetrics">Array of DWRITE_GLYPH_METRICS structures filled by this function.
- /// The metrics returned by this function are in font design units.</param>
- /// <param name="isSideways">Indicates whether the font is being used in a sideways run.
- /// This can affect the glyph metrics if the font has oblique simulation
- /// because sideways oblique simulation differs from non-sideways oblique simulation.</param>
- /// <returns>
- /// Standard HRESULT error code. If any of the input glyph indices are outside of the valid glyph index range
- /// for the current font face, E_INVALIDARG will be returned.
- /// </returns>
- STDMETHOD(GetGdiCompatibleGlyphMetrics)(
- FLOAT emSize,
- FLOAT pixelsPerDip,
- __in_opt DWRITE_MATRIX const* transform,
- BOOL useGdiNatural,
- __in_ecount(glyphCount) UINT16 const* glyphIndices,
- UINT32 glyphCount,
- __out_ecount(glyphCount) DWRITE_GLYPH_METRICS* glyphMetrics,
- BOOL isSideways = FALSE
- ) PURE;
-};
-
-interface IDWriteFactory;
-interface IDWriteFontFileEnumerator;
-
-/// <summary>
-/// The font collection loader interface is used to construct a collection of fonts given a particular type of key.
-/// The font collection loader interface is recommended to be implemented by a singleton object.
-/// IMPORTANT: font collection loader implementations must not register themselves with a DirectWrite factory
-/// inside their constructors and must not unregister themselves in their destructors, because
-/// registration and unregistraton operations increment and decrement the object reference count respectively.
-/// Instead, registration and unregistration of font file loaders with DirectWrite factory should be performed
-/// outside of the font file loader implementation as a separate step.
-/// </summary>
-interface DWRITE_DECLARE_INTERFACE("cca920e4-52f0-492b-bfa8-29c72ee0a468") IDWriteFontCollectionLoader : public IUnknown
-{
- /// <summary>
- /// Creates a font file enumerator object that encapsulates a collection of font files.
- /// The font system calls back to this interface to create a font collection.
- /// </summary>
- /// <param name="factory">Factory associated with the loader.</param>
- /// <param name="collectionKey">Font collection key that uniquely identifies the collection of font files within
- /// the scope of the font collection loader being used.</param>
- /// <param name="collectionKeySize">Size of the font collection key in bytes.</param>
- /// <param name="fontFileEnumerator">Pointer to the newly created font file enumerator.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(CreateEnumeratorFromKey)(
- IDWriteFactory* factory,
- __in_bcount(collectionKeySize) void const* collectionKey,
- UINT32 collectionKeySize,
- __out IDWriteFontFileEnumerator** fontFileEnumerator
- ) PURE;
-};
-
-/// <summary>
-/// The font file enumerator interface encapsulates a collection of font files. The font system uses this interface
-/// to enumerate font files when building a font collection.
-/// </summary>
-interface DWRITE_DECLARE_INTERFACE("72755049-5ff7-435d-8348-4be97cfa6c7c") IDWriteFontFileEnumerator : public IUnknown
-{
- /// <summary>
- /// Advances to the next font file in the collection. When it is first created, the enumerator is positioned
- /// before the first element of the collection and the first call to MoveNext advances to the first file.
- /// </summary>
- /// <param name="hasCurrentFile">Receives the value TRUE if the enumerator advances to a file, or FALSE if
- /// the enumerator advanced past the last file in the collection.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(MoveNext)(
- __out BOOL* hasCurrentFile
- ) PURE;
-
- /// <summary>
- /// Gets a reference to the current font file.
- /// </summary>
- /// <param name="fontFile">Pointer to the newly created font file object.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetCurrentFontFile)(
- __out IDWriteFontFile** fontFile
- ) PURE;
-};
-
-/// <summary>
-/// Represents a collection of strings indexed by locale name.
-/// </summary>
-interface DWRITE_DECLARE_INTERFACE("08256209-099a-4b34-b86d-c22b110e7771") IDWriteLocalizedStrings : public IUnknown
-{
- /// <summary>
- /// Gets the number of language/string pairs.
- /// </summary>
- STDMETHOD_(UINT32, GetCount)() PURE;
-
- /// <summary>
- /// Gets the index of the item with the specified locale name.
- /// </summary>
- /// <param name="localeName">Locale name to look for.</param>
- /// <param name="index">Receives the zero-based index of the locale name/string pair.</param>
- /// <param name="exists">Receives TRUE if the locale name exists or FALSE if not.</param>
- /// <returns>
- /// Standard HRESULT error code. If the specified locale name does not exist, the return value is S_OK,
- /// but *index is UINT_MAX and *exists is FALSE.
- /// </returns>
- STDMETHOD(FindLocaleName)(
- __in_z WCHAR const* localeName,
- __out UINT32* index,
- __out BOOL* exists
- ) PURE;
-
- /// <summary>
- /// Gets the length in characters (not including the null terminator) of the locale name with the specified index.
- /// </summary>
- /// <param name="index">Zero-based index of the locale name.</param>
- /// <param name="length">Receives the length in characters, not including the null terminator.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetLocaleNameLength)(
- UINT32 index,
- __out UINT32* length
- ) PURE;
-
- /// <summary>
- /// Copies the locale name with the specified index to the specified array.
- /// </summary>
- /// <param name="index">Zero-based index of the locale name.</param>
- /// <param name="localeName">Character array that receives the locale name.</param>
- /// <param name="size">Size of the array in characters. The size must include space for the terminating
- /// null character.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetLocaleName)(
- UINT32 index,
- __out_ecount_z(size) WCHAR* localeName,
- UINT32 size
- ) PURE;
-
- /// <summary>
- /// Gets the length in characters (not including the null terminator) of the string with the specified index.
- /// </summary>
- /// <param name="index">Zero-based index of the string.</param>
- /// <param name="length">Receives the length in characters, not including the null terminator.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetStringLength)(
- UINT32 index,
- __out UINT32* length
- ) PURE;
-
- /// <summary>
- /// Copies the string with the specified index to the specified array.
- /// </summary>
- /// <param name="index">Zero-based index of the string.</param>
- /// <param name="stringBuffer">Character array that receives the string.</param>
- /// <param name="size">Size of the array in characters. The size must include space for the terminating
- /// null character.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetString)(
- UINT32 index,
- __out_ecount_z(size) WCHAR* stringBuffer,
- UINT32 size
- ) PURE;
-};
-
-interface IDWriteFontFamily;
-interface IDWriteFont;
-
-/// <summary>
-/// The IDWriteFontCollection encapsulates a collection of fonts.
-/// </summary>
-interface DWRITE_DECLARE_INTERFACE("a84cee02-3eea-4eee-a827-87c1a02a0fcc") IDWriteFontCollection : public IUnknown
-{
- /// <summary>
- /// Gets the number of font families in the collection.
- /// </summary>
- STDMETHOD_(UINT32, GetFontFamilyCount)() PURE;
-
- /// <summary>
- /// Creates a font family object given a zero-based font family index.
- /// </summary>
- /// <param name="index">Zero-based index of the font family.</param>
- /// <param name="fontFamily">Receives a pointer the newly created font family object.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetFontFamily)(
- UINT32 index,
- __out IDWriteFontFamily** fontFamily
- ) PURE;
-
- /// <summary>
- /// Finds the font family with the specified family name.
- /// </summary>
- /// <param name="familyName">Name of the font family. The name is not case-sensitive but must otherwise exactly match a family name in the collection.</param>
- /// <param name="index">Receives the zero-based index of the matching font family if the family name was found or UINT_MAX otherwise.</param>
- /// <param name="exists">Receives TRUE if the family name exists or FALSE otherwise.</param>
- /// <returns>
- /// Standard HRESULT error code. If the specified family name does not exist, the return value is S_OK, but *index is UINT_MAX and *exists is FALSE.
- /// </returns>
- STDMETHOD(FindFamilyName)(
- __in_z WCHAR const* familyName,
- __out UINT32* index,
- __out BOOL* exists
- ) PURE;
-
- /// <summary>
- /// Gets the font object that corresponds to the same physical font as the specified font face object. The specified physical font must belong
- /// to the font collection.
- /// </summary>
- /// <param name="fontFace">Font face object that specifies the physical font.</param>
- /// <param name="font">Receives a pointer to the newly created font object if successful or NULL otherwise.</param>
- /// <returns>
- /// Standard HRESULT error code. If the specified physical font is not part of the font collection the return value is DWRITE_E_NOFONT.
- /// </returns>
- STDMETHOD(GetFontFromFontFace)(
- IDWriteFontFace* fontFace,
- __out IDWriteFont** font
- ) PURE;
-};
-
-/// <summary>
-/// The IDWriteFontList interface represents a list of fonts.
-/// </summary>
-interface DWRITE_DECLARE_INTERFACE("1a0d8438-1d97-4ec1-aef9-a2fb86ed6acb") IDWriteFontList : public IUnknown
-{
- /// <summary>
- /// Gets the font collection that contains the fonts.
- /// </summary>
- /// <param name="fontCollection">Receives a pointer to the font collection object.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetFontCollection)(
- __out IDWriteFontCollection** fontCollection
- ) PURE;
-
- /// <summary>
- /// Gets the number of fonts in the font list.
- /// </summary>
- STDMETHOD_(UINT32, GetFontCount)() PURE;
-
- /// <summary>
- /// Gets a font given its zero-based index.
- /// </summary>
- /// <param name="index">Zero-based index of the font in the font list.</param>
- /// <param name="font">Receives a pointer to the newly created font object.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetFont)(
- UINT32 index,
- __out IDWriteFont** font
- ) PURE;
-};
-
-/// <summary>
-/// The IDWriteFontFamily interface represents a set of fonts that share the same design but are differentiated
-/// by weight, stretch, and style.
-/// </summary>
-interface DWRITE_DECLARE_INTERFACE("da20d8ef-812a-4c43-9802-62ec4abd7add") IDWriteFontFamily : public IDWriteFontList
-{
- /// <summary>
- /// Creates an localized strings object that contains the family names for the font family, indexed by locale name.
- /// </summary>
- /// <param name="names">Receives a pointer to the newly created localized strings object.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetFamilyNames)(
- __out IDWriteLocalizedStrings** names
- ) PURE;
-
- /// <summary>
- /// Gets the font that best matches the specified properties.
- /// </summary>
- /// <param name="weight">Requested font weight.</param>
- /// <param name="stretch">Requested font stretch.</param>
- /// <param name="style">Requested font style.</param>
- /// <param name="matchingFont">Receives a pointer to the newly created font object.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetFirstMatchingFont)(
- DWRITE_FONT_WEIGHT weight,
- DWRITE_FONT_STRETCH stretch,
- DWRITE_FONT_STYLE style,
- __out IDWriteFont** matchingFont
- ) PURE;
-
- /// <summary>
- /// Gets a list of fonts in the font family ranked in order of how well they match the specified properties.
- /// </summary>
- /// <param name="weight">Requested font weight.</param>
- /// <param name="stretch">Requested font stretch.</param>
- /// <param name="style">Requested font style.</param>
- /// <param name="matchingFonts">Receives a pointer to the newly created font list object.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetMatchingFonts)(
- DWRITE_FONT_WEIGHT weight,
- DWRITE_FONT_STRETCH stretch,
- DWRITE_FONT_STYLE style,
- __out IDWriteFontList** matchingFonts
- ) PURE;
-};
-
-/// <summary>
-/// The IDWriteFont interface represents a physical font in a font collection.
-/// </summary>
-interface DWRITE_DECLARE_INTERFACE("acd16696-8c14-4f5d-877e-fe3fc1d32737") IDWriteFont : public IUnknown
-{
- /// <summary>
- /// Gets the font family to which the specified font belongs.
- /// </summary>
- /// <param name="fontFamily">Receives a pointer to the font family object.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetFontFamily)(
- __out IDWriteFontFamily** fontFamily
- ) PURE;
-
- /// <summary>
- /// Gets the weight of the specified font.
- /// </summary>
- STDMETHOD_(DWRITE_FONT_WEIGHT, GetWeight)() PURE;
-
- /// <summary>
- /// Gets the stretch (aka. width) of the specified font.
- /// </summary>
- STDMETHOD_(DWRITE_FONT_STRETCH, GetStretch)() PURE;
-
- /// <summary>
- /// Gets the style (aka. slope) of the specified font.
- /// </summary>
- STDMETHOD_(DWRITE_FONT_STYLE, GetStyle)() PURE;
-
- /// <summary>
- /// Returns TRUE if the font is a symbol font or FALSE if not.
- /// </summary>
- STDMETHOD_(BOOL, IsSymbolFont)() PURE;
-
- /// <summary>
- /// Gets a localized strings collection containing the face names for the font (e.g., Regular or Bold), indexed by locale name.
- /// </summary>
- /// <param name="names">Receives a pointer to the newly created localized strings object.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetFaceNames)(
- __out IDWriteLocalizedStrings** names
- ) PURE;
-
- /// <summary>
- /// Gets a localized strings collection containing the specified informational strings, indexed by locale name.
- /// </summary>
- /// <param name="informationalStringID">Identifies the string to get.</param>
- /// <param name="informationalStrings">Receives a pointer to the newly created localized strings object.</param>
- /// <param name="exists">Receives the value TRUE if the font contains the specified string ID or FALSE if not.</param>
- /// <returns>
- /// Standard HRESULT error code. If the font does not contain the specified string, the return value is S_OK but
- /// informationalStrings receives a NULL pointer and exists receives the value FALSE.
- /// </returns>
- STDMETHOD(GetInformationalStrings)(
- DWRITE_INFORMATIONAL_STRING_ID informationalStringID,
- __out IDWriteLocalizedStrings** informationalStrings,
- __out BOOL* exists
- ) PURE;
-
- /// <summary>
- /// Gets a value that indicates what simulation are applied to the specified font.
- /// </summary>
- STDMETHOD_(DWRITE_FONT_SIMULATIONS, GetSimulations)() PURE;
-
- /// <summary>
- /// Gets the metrics for the font.
- /// </summary>
- /// <param name="fontMetrics">Receives the font metrics.</param>
- STDMETHOD_(void, GetMetrics)(
- __out DWRITE_FONT_METRICS* fontMetrics
- ) PURE;
-
- /// <summary>
- /// Determines whether the font supports the specified character.
- /// </summary>
- /// <param name="unicodeValue">Unicode (UCS-4) character value.</param>
- /// <param name="exists">Receives the value TRUE if the font supports the specified character or FALSE if not.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(HasCharacter)(
- UINT32 unicodeValue,
- __out BOOL* exists
- ) PURE;
-
- /// <summary>
- /// Creates a font face object for the font.
- /// </summary>
- /// <param name="fontFace">Receives a pointer to the newly created font face object.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(CreateFontFace)(
- __out IDWriteFontFace** fontFace
- ) PURE;
-};
-
-/// <summary>
-/// Direction for how reading progresses.
-/// </summary>
-enum DWRITE_READING_DIRECTION
-{
- /// <summary>
- /// Reading progresses from left to right.
- /// </summary>
- DWRITE_READING_DIRECTION_LEFT_TO_RIGHT,
-
- /// <summary>
- /// Reading progresses from right to left.
- /// </summary>
- DWRITE_READING_DIRECTION_RIGHT_TO_LEFT
-};
-
-/// <summary>
-/// Direction for how lines of text are placed relative to one another.
-/// </summary>
-enum DWRITE_FLOW_DIRECTION
-{
- /// <summary>
- /// Text lines are placed from top to bottom.
- /// </summary>
- DWRITE_FLOW_DIRECTION_TOP_TO_BOTTOM
-};
-
-/// <summary>
-/// Alignment of paragraph text along the reading direction axis relative to
-/// the leading and trailing edge of the layout box.
-/// </summary>
-enum DWRITE_TEXT_ALIGNMENT
-{
- /// <summary>
- /// The leading edge of the paragraph text is aligned to the layout box's leading edge.
- /// </summary>
- DWRITE_TEXT_ALIGNMENT_LEADING,
-
- /// <summary>
- /// The trailing edge of the paragraph text is aligned to the layout box's trailing edge.
- /// </summary>
- DWRITE_TEXT_ALIGNMENT_TRAILING,
-
- /// <summary>
- /// The center of the paragraph text is aligned to the center of the layout box.
- /// </summary>
- DWRITE_TEXT_ALIGNMENT_CENTER
-};
-
-/// <summary>
-/// Alignment of paragraph text along the flow direction axis relative to the
-/// flow's beginning and ending edge of the layout box.
-/// </summary>
-enum DWRITE_PARAGRAPH_ALIGNMENT
-{
- /// <summary>
- /// The first line of paragraph is aligned to the flow's beginning edge of the layout box.
- /// </summary>
- DWRITE_PARAGRAPH_ALIGNMENT_NEAR,
-
- /// <summary>
- /// The last line of paragraph is aligned to the flow's ending edge of the layout box.
- /// </summary>
- DWRITE_PARAGRAPH_ALIGNMENT_FAR,
-
- /// <summary>
- /// The center of the paragraph is aligned to the center of the flow of the layout box.
- /// </summary>
- DWRITE_PARAGRAPH_ALIGNMENT_CENTER
-};
-
-/// <summary>
-/// Word wrapping in multiline paragraph.
-/// </summary>
-enum DWRITE_WORD_WRAPPING
-{
- /// <summary>
- /// Words are broken across lines to avoid text overflowing the layout box.
- /// </summary>
- DWRITE_WORD_WRAPPING_WRAP,
-
- /// <summary>
- /// Words are kept within the same line even when it overflows the layout box.
- /// This option is often used with scrolling to reveal overflow text.
- /// </summary>
- DWRITE_WORD_WRAPPING_NO_WRAP
-};
-
-/// <summary>
-/// The method used for line spacing in layout.
-/// </summary>
-enum DWRITE_LINE_SPACING_METHOD
-{
- /// <summary>
- /// Line spacing depends solely on the content, growing to accomodate the size of fonts and inline objects.
- /// </summary>
- DWRITE_LINE_SPACING_METHOD_DEFAULT,
-
- /// <summary>
- /// Lines are explicitly set to uniform spacing, regardless of contained font sizes.
- /// This can be useful to avoid the uneven appearance that can occur from font fallback.
- /// </summary>
- DWRITE_LINE_SPACING_METHOD_UNIFORM
-};
-
-/// <summary>
-/// Text granularity used to trim text overflowing the layout box.
-/// </summary>
-enum DWRITE_TRIMMING_GRANULARITY
-{
- /// <summary>
- /// No trimming occurs. Text flows beyond the layout width.
- /// </summary>
- DWRITE_TRIMMING_GRANULARITY_NONE,
-
- /// <summary>
- /// Trimming occurs at character cluster boundary.
- /// </summary>
- DWRITE_TRIMMING_GRANULARITY_CHARACTER,
-
- /// <summary>
- /// Trimming occurs at word boundary.
- /// </summary>
- DWRITE_TRIMMING_GRANULARITY_WORD
-};
-
-/// <summary>
-/// Typographic feature of text supplied by the font.
-/// </summary>
-enum DWRITE_FONT_FEATURE_TAG
-{
- DWRITE_FONT_FEATURE_TAG_ALTERNATIVE_FRACTIONS = 0x63726661, // 'afrc'
- DWRITE_FONT_FEATURE_TAG_PETITE_CAPITALS_FROM_CAPITALS = 0x63703263, // 'c2pc'
- DWRITE_FONT_FEATURE_TAG_SMALL_CAPITALS_FROM_CAPITALS = 0x63733263, // 'c2sc'
- DWRITE_FONT_FEATURE_TAG_CONTEXTUAL_ALTERNATES = 0x746c6163, // 'calt'
- DWRITE_FONT_FEATURE_TAG_CASE_SENSITIVE_FORMS = 0x65736163, // 'case'
- DWRITE_FONT_FEATURE_TAG_GLYPH_COMPOSITION_DECOMPOSITION = 0x706d6363, // 'ccmp'
- DWRITE_FONT_FEATURE_TAG_CONTEXTUAL_LIGATURES = 0x67696c63, // 'clig'
- DWRITE_FONT_FEATURE_TAG_CAPITAL_SPACING = 0x70737063, // 'cpsp'
- DWRITE_FONT_FEATURE_TAG_CONTEXTUAL_SWASH = 0x68777363, // 'cswh'
- DWRITE_FONT_FEATURE_TAG_CURSIVE_POSITIONING = 0x73727563, // 'curs'
- DWRITE_FONT_FEATURE_TAG_DEFAULT = 0x746c6664, // 'dflt'
- DWRITE_FONT_FEATURE_TAG_DISCRETIONARY_LIGATURES = 0x67696c64, // 'dlig'
- DWRITE_FONT_FEATURE_TAG_EXPERT_FORMS = 0x74707865, // 'expt'
- DWRITE_FONT_FEATURE_TAG_FRACTIONS = 0x63617266, // 'frac'
- DWRITE_FONT_FEATURE_TAG_FULL_WIDTH = 0x64697766, // 'fwid'
- DWRITE_FONT_FEATURE_TAG_HALF_FORMS = 0x666c6168, // 'half'
- DWRITE_FONT_FEATURE_TAG_HALANT_FORMS = 0x6e6c6168, // 'haln'
- DWRITE_FONT_FEATURE_TAG_ALTERNATE_HALF_WIDTH = 0x746c6168, // 'halt'
- DWRITE_FONT_FEATURE_TAG_HISTORICAL_FORMS = 0x74736968, // 'hist'
- DWRITE_FONT_FEATURE_TAG_HORIZONTAL_KANA_ALTERNATES = 0x616e6b68, // 'hkna'
- DWRITE_FONT_FEATURE_TAG_HISTORICAL_LIGATURES = 0x67696c68, // 'hlig'
- DWRITE_FONT_FEATURE_TAG_HALF_WIDTH = 0x64697768, // 'hwid'
- DWRITE_FONT_FEATURE_TAG_HOJO_KANJI_FORMS = 0x6f6a6f68, // 'hojo'
- DWRITE_FONT_FEATURE_TAG_JIS04_FORMS = 0x3430706a, // 'jp04'
- DWRITE_FONT_FEATURE_TAG_JIS78_FORMS = 0x3837706a, // 'jp78'
- DWRITE_FONT_FEATURE_TAG_JIS83_FORMS = 0x3338706a, // 'jp83'
- DWRITE_FONT_FEATURE_TAG_JIS90_FORMS = 0x3039706a, // 'jp90'
- DWRITE_FONT_FEATURE_TAG_KERNING = 0x6e72656b, // 'kern'
- DWRITE_FONT_FEATURE_TAG_STANDARD_LIGATURES = 0x6167696c, // 'liga'
- DWRITE_FONT_FEATURE_TAG_LINING_FIGURES = 0x6d756e6c, // 'lnum'
- DWRITE_FONT_FEATURE_TAG_LOCALIZED_FORMS = 0x6c636f6c, // 'locl'
- DWRITE_FONT_FEATURE_TAG_MARK_POSITIONING = 0x6b72616d, // 'mark'
- DWRITE_FONT_FEATURE_TAG_MATHEMATICAL_GREEK = 0x6b72676d, // 'mgrk'
- DWRITE_FONT_FEATURE_TAG_MARK_TO_MARK_POSITIONING = 0x6b6d6b6d, // 'mkmk'
- DWRITE_FONT_FEATURE_TAG_ALTERNATE_ANNOTATION_FORMS = 0x746c616e, // 'nalt'
- DWRITE_FONT_FEATURE_TAG_NLC_KANJI_FORMS = 0x6b636c6e, // 'nlck'
- DWRITE_FONT_FEATURE_TAG_OLD_STYLE_FIGURES = 0x6d756e6f, // 'onum'
- DWRITE_FONT_FEATURE_TAG_ORDINALS = 0x6e64726f, // 'ordn'
- DWRITE_FONT_FEATURE_TAG_PROPORTIONAL_ALTERNATE_WIDTH = 0x746c6170, // 'palt'
- DWRITE_FONT_FEATURE_TAG_PETITE_CAPITALS = 0x70616370, // 'pcap'
- DWRITE_FONT_FEATURE_TAG_PROPORTIONAL_FIGURES = 0x6d756e70, // 'pnum'
- DWRITE_FONT_FEATURE_TAG_PROPORTIONAL_WIDTHS = 0x64697770, // 'pwid'
- DWRITE_FONT_FEATURE_TAG_QUARTER_WIDTHS = 0x64697771, // 'qwid'
- DWRITE_FONT_FEATURE_TAG_REQUIRED_LIGATURES = 0x67696c72, // 'rlig'
- DWRITE_FONT_FEATURE_TAG_RUBY_NOTATION_FORMS = 0x79627572, // 'ruby'
- DWRITE_FONT_FEATURE_TAG_STYLISTIC_ALTERNATES = 0x746c6173, // 'salt'
- DWRITE_FONT_FEATURE_TAG_SCIENTIFIC_INFERIORS = 0x666e6973, // 'sinf'
- DWRITE_FONT_FEATURE_TAG_SMALL_CAPITALS = 0x70636d73, // 'smcp'
- DWRITE_FONT_FEATURE_TAG_SIMPLIFIED_FORMS = 0x6c706d73, // 'smpl'
- DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_1 = 0x31307373, // 'ss01'
- DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_2 = 0x32307373, // 'ss02'
- DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_3 = 0x33307373, // 'ss03'
- DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_4 = 0x34307373, // 'ss04'
- DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_5 = 0x35307373, // 'ss05'
- DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_6 = 0x36307373, // 'ss06'
- DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_7 = 0x37307373, // 'ss07'
- DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_8 = 0x38307373, // 'ss08'
- DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_9 = 0x39307373, // 'ss09'
- DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_10 = 0x30317373, // 'ss10'
- DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_11 = 0x31317373, // 'ss11'
- DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_12 = 0x32317373, // 'ss12'
- DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_13 = 0x33317373, // 'ss13'
- DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_14 = 0x34317373, // 'ss14'
- DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_15 = 0x35317373, // 'ss15'
- DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_16 = 0x36317373, // 'ss16'
- DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_17 = 0x37317373, // 'ss17'
- DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_18 = 0x38317373, // 'ss18'
- DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_19 = 0x39317373, // 'ss19'
- DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_20 = 0x30327373, // 'ss20'
- DWRITE_FONT_FEATURE_TAG_SUBSCRIPT = 0x73627573, // 'subs'
- DWRITE_FONT_FEATURE_TAG_SUPERSCRIPT = 0x73707573, // 'sups'
- DWRITE_FONT_FEATURE_TAG_SWASH = 0x68737773, // 'swsh'
- DWRITE_FONT_FEATURE_TAG_TITLING = 0x6c746974, // 'titl'
- DWRITE_FONT_FEATURE_TAG_TRADITIONAL_NAME_FORMS = 0x6d616e74, // 'tnam'
- DWRITE_FONT_FEATURE_TAG_TABULAR_FIGURES = 0x6d756e74, // 'tnum'
- DWRITE_FONT_FEATURE_TAG_TRADITIONAL_FORMS = 0x64617274, // 'trad'
- DWRITE_FONT_FEATURE_TAG_THIRD_WIDTHS = 0x64697774, // 'twid'
- DWRITE_FONT_FEATURE_TAG_UNICASE = 0x63696e75, // 'unic'
- DWRITE_FONT_FEATURE_TAG_SLASHED_ZERO = 0x6f72657a, // 'zero'
-};
-
-/// <summary>
-/// The DWRITE_TEXT_RANGE structure specifies a range of text positions where format is applied.
-/// </summary>
-struct DWRITE_TEXT_RANGE
-{
- /// <summary>
- /// The start text position of the range.
- /// </summary>
- UINT32 startPosition;
-
- /// <summary>
- /// The number of text positions in the range.
- /// </summary>
- UINT32 length;
-};
-
-/// <summary>
-/// The DWRITE_FONT_FEATURE structure specifies properties used to identify and execute typographic feature in the font.
-/// </summary>
-struct DWRITE_FONT_FEATURE
-{
- /// <summary>
- /// The feature OpenType name identifier.
- /// </summary>
- DWRITE_FONT_FEATURE_TAG nameTag;
-
- /// <summary>
- /// Execution parameter of the feature.
- /// </summary>
- /// <remarks>
- /// The parameter should be non-zero to enable the feature. Once enabled, a feature can't be disabled again within
- /// the same range. Features requiring a selector use this value to indicate the selector index.
- /// </remarks>
- UINT32 parameter;
-};
-
-/// <summary>
-/// Defines a set of typographic features to be applied during shaping.
-/// Notice the character range which this feature list spans is specified
-/// as a separate parameter to GetGlyphs.
-/// </summary>
-struct DWRITE_TYPOGRAPHIC_FEATURES
-{
- /// <summary>
- /// Array of font features.
- /// </summary>
- __field_ecount(featureCount) DWRITE_FONT_FEATURE* features;
-
- /// <summary>
- /// The number of features.
- /// </summary>
- UINT32 featureCount;
-};
-
-/// <summary>
-/// The DWRITE_TRIMMING structure specifies the trimming option for text overflowing the layout box.
-/// </summary>
-struct DWRITE_TRIMMING
-{
- /// <summary>
- /// Text granularity of which trimming applies.
- /// </summary>
- DWRITE_TRIMMING_GRANULARITY granularity;
-
- /// <summary>
- /// Character code used as the delimiter signaling the beginning of the portion of text to be preserved,
- /// most useful for path ellipsis, where the delimeter would be a slash.
- /// </summary>
- UINT32 delimiter;
-
- /// <summary>
- /// How many occurences of the delimiter to step back.
- /// </summary>
- UINT32 delimiterCount;
-};
-
-
-interface IDWriteTypography;
-interface IDWriteInlineObject;
-
-/// <summary>
-/// The format of text used for text layout purpose.
-/// </summary>
-/// <remarks>
-/// This object may not be thread-safe and it may carry the state of text format change.
-/// </remarks>
-interface DWRITE_DECLARE_INTERFACE("9c906818-31d7-4fd3-a151-7c5e225db55a") IDWriteTextFormat : public IUnknown
-{
- /// <summary>
- /// Set alignment option of text relative to layout box's leading and trailing edge.
- /// </summary>
- /// <param name="textAlignment">Text alignment option</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(SetTextAlignment)(
- DWRITE_TEXT_ALIGNMENT textAlignment
- ) PURE;
-
- /// <summary>
- /// Set alignment option of paragraph relative to layout box's top and bottom edge.
- /// </summary>
- /// <param name="paragraphAlignment">Paragraph alignment option</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(SetParagraphAlignment)(
- DWRITE_PARAGRAPH_ALIGNMENT paragraphAlignment
- ) PURE;
-
- /// <summary>
- /// Set word wrapping option.
- /// </summary>
- /// <param name="wordWrapping">Word wrapping option</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(SetWordWrapping)(
- DWRITE_WORD_WRAPPING wordWrapping
- ) PURE;
-
- /// <summary>
- /// Set paragraph reading direction.
- /// </summary>
- /// <param name="readingDirection">Text reading direction</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(SetReadingDirection)(
- DWRITE_READING_DIRECTION readingDirection
- ) PURE;
-
- /// <summary>
- /// Set paragraph flow direction.
- /// </summary>
- /// <param name="flowDirection">Paragraph flow direction</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(SetFlowDirection)(
- DWRITE_FLOW_DIRECTION flowDirection
- ) PURE;
-
- /// <summary>
- /// Set incremental tab stop position.
- /// </summary>
- /// <param name="incrementalTabStop">The incremental tab stop value</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(SetIncrementalTabStop)(
- FLOAT incrementalTabStop
- ) PURE;
-
- /// <summary>
- /// Set trimming options for any trailing text exceeding the layout width
- /// or for any far text exceeding the layout height.
- /// </summary>
- /// <param name="trimmingOptions">Text trimming options.</param>
- /// <param name="trimmingSign">Application-defined omission sign. This parameter may be NULL if no trimming sign is desired.</param>
- /// <remarks>
- /// Any inline object can be used for the trimming sign, but CreateEllipsisTrimmingSign
- /// provides a typical ellipsis symbol. Trimming is also useful vertically for hiding
- /// partial lines.
- /// </remarks>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(SetTrimming)(
- __in DWRITE_TRIMMING const* trimmingOptions,
- IDWriteInlineObject* trimmingSign
- ) PURE;
-
- /// <summary>
- /// Set line spacing.
- /// </summary>
- /// <param name="lineSpacingMethod">How to determine line height.</param>
- /// <param name="lineSpacing">The line height, or rather distance between one baseline to another.</param>
- /// <param name="baseline">Distance from top of line to baseline. A reasonable ratio to lineSpacing is 80%.</param>
- /// <remarks>
- /// For the default method, spacing depends solely on the content.
- /// For uniform spacing, the given line height will override the content.
- /// </remarks>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(SetLineSpacing)(
- DWRITE_LINE_SPACING_METHOD lineSpacingMethod,
- FLOAT lineSpacing,
- FLOAT baseline
- ) PURE;
-
- /// <summary>
- /// Get alignment option of text relative to layout box's leading and trailing edge.
- /// </summary>
- STDMETHOD_(DWRITE_TEXT_ALIGNMENT, GetTextAlignment)() PURE;
-
- /// <summary>
- /// Get alignment option of paragraph relative to layout box's top and bottom edge.
- /// </summary>
- STDMETHOD_(DWRITE_PARAGRAPH_ALIGNMENT, GetParagraphAlignment)() PURE;
-
- /// <summary>
- /// Get word wrapping option.
- /// </summary>
- STDMETHOD_(DWRITE_WORD_WRAPPING, GetWordWrapping)() PURE;
-
- /// <summary>
- /// Get paragraph reading direction.
- /// </summary>
- STDMETHOD_(DWRITE_READING_DIRECTION, GetReadingDirection)() PURE;
-
- /// <summary>
- /// Get paragraph flow direction.
- /// </summary>
- STDMETHOD_(DWRITE_FLOW_DIRECTION, GetFlowDirection)() PURE;
-
- /// <summary>
- /// Get incremental tab stop position.
- /// </summary>
- STDMETHOD_(FLOAT, GetIncrementalTabStop)() PURE;
-
- /// <summary>
- /// Get trimming options for text overflowing the layout width.
- /// </summary>
- /// <param name="trimmingOptions">Text trimming options.</param>
- /// <param name="trimmingSign">Trimming omission sign. This parameter may be NULL.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetTrimming)(
- __out DWRITE_TRIMMING* trimmingOptions,
- __out IDWriteInlineObject** trimmingSign
- ) PURE;
-
- /// <summary>
- /// Get line spacing.
- /// </summary>
- /// <param name="lineSpacingMethod">How line height is determined.</param>
- /// <param name="lineSpacing">The line height, or rather distance between one baseline to another.</param>
- /// <param name="baseline">Distance from top of line to baseline.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetLineSpacing)(
- __out DWRITE_LINE_SPACING_METHOD* lineSpacingMethod,
- __out FLOAT* lineSpacing,
- __out FLOAT* baseline
- ) PURE;
-
- /// <summary>
- /// Get the font collection.
- /// </summary>
- /// <param name="fontCollection">The current font collection.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetFontCollection)(
- __out IDWriteFontCollection** fontCollection
- ) PURE;
-
- /// <summary>
- /// Get the length of the font family name, in characters, not including the terminating NULL character.
- /// </summary>
- STDMETHOD_(UINT32, GetFontFamilyNameLength)() PURE;
-
- /// <summary>
- /// Get a copy of the font family name.
- /// </summary>
- /// <param name="fontFamilyName">Character array that receives the current font family name</param>
- /// <param name="nameSize">Size of the character array in character count including the terminated NULL character.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetFontFamilyName)(
- __out_ecount_z(nameSize) WCHAR* fontFamilyName,
- UINT32 nameSize
- ) PURE;
-
- /// <summary>
- /// Get the font weight.
- /// </summary>
- STDMETHOD_(DWRITE_FONT_WEIGHT, GetFontWeight)() PURE;
-
- /// <summary>
- /// Get the font style.
- /// </summary>
- STDMETHOD_(DWRITE_FONT_STYLE, GetFontStyle)() PURE;
-
- /// <summary>
- /// Get the font stretch.
- /// </summary>
- STDMETHOD_(DWRITE_FONT_STRETCH, GetFontStretch)() PURE;
-
- /// <summary>
- /// Get the font em height.
- /// </summary>
- STDMETHOD_(FLOAT, GetFontSize)() PURE;
-
- /// <summary>
- /// Get the length of the locale name, in characters, not including the terminating NULL character.
- /// </summary>
- STDMETHOD_(UINT32, GetLocaleNameLength)() PURE;
-
- /// <summary>
- /// Get a copy of the locale name.
- /// </summary>
- /// <param name="localeName">Character array that receives the current locale name</param>
- /// <param name="nameSize">Size of the character array in character count including the terminated NULL character.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetLocaleName)(
- __out_ecount_z(nameSize) WCHAR* localeName,
- UINT32 nameSize
- ) PURE;
-};
-
-
-/// <summary>
-/// Font typography setting.
-/// </summary>
-interface DWRITE_DECLARE_INTERFACE("55f1112b-1dc2-4b3c-9541-f46894ed85b6") IDWriteTypography : public IUnknown
-{
- /// <summary>
- /// Add font feature.
- /// </summary>
- /// <param name="fontFeature">The font feature to add.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(AddFontFeature)(
- DWRITE_FONT_FEATURE fontFeature
- ) PURE;
-
- /// <summary>
- /// Get the number of font features.
- /// </summary>
- STDMETHOD_(UINT32, GetFontFeatureCount)() PURE;
-
- /// <summary>
- /// Get the font feature at the specified index.
- /// </summary>
- /// <param name="fontFeatureIndex">The zero-based index of the font feature to get.</param>
- /// <param name="fontFeature">The font feature.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetFontFeature)(
- UINT32 fontFeatureIndex,
- __out DWRITE_FONT_FEATURE* fontFeature
- ) PURE;
-};
-
-enum DWRITE_SCRIPT_SHAPES
-{
- /// <summary>
- /// No additional shaping requirement. Text is shaped with the writing system default behavior.
- /// </summary>
- DWRITE_SCRIPT_SHAPES_DEFAULT = 0,
-
- /// <summary>
- /// Text should leave no visual on display i.e. control or format control characters.
- /// </summary>
- DWRITE_SCRIPT_SHAPES_NO_VISUAL = 1
-};
-
-#ifdef DEFINE_ENUM_FLAG_OPERATORS
-DEFINE_ENUM_FLAG_OPERATORS(DWRITE_SCRIPT_SHAPES);
-#endif
-
-/// <summary>
-/// Association of text and its writing system script as well as some display attributes.
-/// </summary>
-struct DWRITE_SCRIPT_ANALYSIS
-{
- /// <summary>
- /// Zero-based index representation of writing system script.
- /// </summary>
- UINT16 script;
-
- /// <summary>
- /// Additional shaping requirement of text.
- /// </summary>
- DWRITE_SCRIPT_SHAPES shapes;
-};
-
-/// <summary>
-/// Condition at the edges of inline object or text used to determine
-/// line-breaking behavior.
-/// </summary>
-enum DWRITE_BREAK_CONDITION
-{
- /// <summary>
- /// Whether a break is allowed is determined by the condition of the
- /// neighboring text span or inline object.
- /// </summary>
- DWRITE_BREAK_CONDITION_NEUTRAL,
-
- /// <summary>
- /// A break is allowed, unless overruled by the condition of the
- /// neighboring text span or inline object, either prohibited by a
- /// May Not or forced by a Must.
- /// </summary>
- DWRITE_BREAK_CONDITION_CAN_BREAK,
-
- /// <summary>
- /// There should be no break, unless overruled by a Must condition from
- /// the neighboring text span or inline object.
- /// </summary>
- DWRITE_BREAK_CONDITION_MAY_NOT_BREAK,
-
- /// <summary>
- /// The break must happen, regardless of the condition of the adjacent
- /// text span or inline object.
- /// </summary>
- DWRITE_BREAK_CONDITION_MUST_BREAK
-};
-
-/// <summary>
-/// Line breakpoint characteristics of a character.
-/// </summary>
-struct DWRITE_LINE_BREAKPOINT
-{
- /// <summary>
- /// Breaking condition before the character.
- /// </summary>
- UINT8 breakConditionBefore : 2;
-
- /// <summary>
- /// Breaking condition after the character.
- /// </summary>
- UINT8 breakConditionAfter : 2;
-
- /// <summary>
- /// The character is some form of whitespace, which may be meaningful
- /// for justification.
- /// </summary>
- UINT8 isWhitespace : 1;
-
- /// <summary>
- /// The character is a soft hyphen, often used to indicate hyphenation
- /// points inside words.
- /// </summary>
- UINT8 isSoftHyphen : 1;
-
- UINT8 padding : 2;
-};
-
-/// <summary>
-/// How to apply number substitution on digits and related punctuation.
-/// </summary>
-enum DWRITE_NUMBER_SUBSTITUTION_METHOD
-{
- /// <summary>
- /// Specifies that the substitution method should be determined based
- /// on LOCALE_IDIGITSUBSTITUTION value of the specified text culture.
- /// </summary>
- DWRITE_NUMBER_SUBSTITUTION_METHOD_FROM_CULTURE,
-
- /// <summary>
- /// If the culture is Arabic or Farsi, specifies that the number shape
- /// depend on the context. Either traditional or nominal number shape
- /// are used depending on the nearest preceding strong character or (if
- /// there is none) the reading direction of the paragraph.
- /// </summary>
- DWRITE_NUMBER_SUBSTITUTION_METHOD_CONTEXTUAL,
-
- /// <summary>
- /// Specifies that code points 0x30-0x39 are always rendered as nominal numeral
- /// shapes (ones of the European number), i.e., no substitution is performed.
- /// </summary>
- DWRITE_NUMBER_SUBSTITUTION_METHOD_NONE,
-
- /// <summary>
- /// Specifies that number are rendered using the national number shape
- /// as specified by the LOCALE_SNATIVEDIGITS value of the specified text culture.
- /// </summary>
- DWRITE_NUMBER_SUBSTITUTION_METHOD_NATIONAL,
-
- /// <summary>
- /// Specifies that number are rendered using the traditional shape
- /// for the specified culture. For most cultures, this is the same as
- /// NativeNational. However, NativeNational results in Latin number
- /// for some Arabic cultures, whereas this value results in Arabic
- /// number for all Arabic cultures.
- /// </summary>
- DWRITE_NUMBER_SUBSTITUTION_METHOD_TRADITIONAL
-};
-
-/// <summary>
-/// Holds the appropriate digits and numeric punctuation for a given locale.
-/// </summary>
-interface DECLSPEC_UUID("14885CC9-BAB0-4f90-B6ED-5C366A2CD03D") DECLSPEC_NOVTABLE IDWriteNumberSubstitution : public IUnknown
-{
-};
-
-/// <summary>
-/// Shaping output properties per input character.
-/// </summary>
-struct DWRITE_SHAPING_TEXT_PROPERTIES
-{
- /// <summary>
- /// This character can be shaped independently from the others
- /// (usually set for the space character).
- /// </summary>
- UINT16 isShapedAlone : 1;
-
- /// <summary>
- /// Reserved for use by shaping engine.
- /// </summary>
- UINT16 reserved : 15;
-};
-
-/// <summary>
-/// Shaping output properties per output glyph.
-/// </summary>
-struct DWRITE_SHAPING_GLYPH_PROPERTIES
-{
- /// <summary>
- /// Justification class, whether to use spacing, kashidas, or
- /// another method. This exists for backwards compatibility
- /// with Uniscribe's SCRIPT_JUSTIFY enum.
- /// </summary>
- UINT16 justification : 4;
-
- /// <summary>
- /// Indicates glyph is the first of a cluster.
- /// </summary>
- UINT16 isClusterStart : 1;
-
- /// <summary>
- /// Glyph is a diacritic.
- /// </summary>
- UINT16 isDiacritic : 1;
-
- /// <summary>
- /// Glyph has no width, blank, ZWJ, ZWNJ etc.
- /// </summary>
- UINT16 isZeroWidthSpace : 1;
-
- /// <summary>
- /// Reserved for use by shaping engine.
- /// </summary>
- UINT16 reserved : 9;
-};
-
-/// <summary>
-/// The interface implemented by the text analyzer's client to provide text to
-/// the analyzer. It allows the separation between the logical view of text as
-/// a continuous stream of characters identifiable by unique text positions,
-/// and the actual memory layout of potentially discrete blocks of text in the
-/// client's backing store.
-///
-/// If any of these callbacks returns an error, the analysis functions will
-/// stop prematurely and return a callback error. Rather than return E_NOTIMPL,
-/// an application should stub the method and return a constant/null and S_OK.
-/// </summary>
-interface DECLSPEC_UUID("688e1a58-5094-47c8-adc8-fbcea60ae92b") DECLSPEC_NOVTABLE IDWriteTextAnalysisSource : public IUnknown
-{
- /// <summary>
- /// Get a block of text starting at the specified text position.
- /// Returning NULL indicates the end of text - the position is after
- /// the last character. This function is called iteratively for
- /// each consecutive block, tying together several fragmented blocks
- /// in the backing store into a virtual contiguous string.
- /// </summary>
- /// <param name="textPosition">First position of the piece to obtain. All
- /// positions are in UTF16 code-units, not whole characters, which
- /// matters when supplementary characters are used.</param>
- /// <param name="textString">Address that receives a pointer to the text block
- /// at the specified position.</param>
- /// <param name="textLength">Number of UTF16 units of the retrieved chunk.
- /// The returned length is not the length of the block, but the length
- /// remaining in the block, from the given position until its end.
- /// So querying for a position that is 75 positions into a 100
- /// postition block would return 25.</param>
- /// <returns>Pointer to the first character at the given text position.
- /// NULL indicates no chunk available at the specified position, either
- /// because textPosition >= the entire text content length or because the
- /// queried position is not mapped into the app's backing store.</returns>
- /// <remarks>
- /// Although apps can implement sparse textual content that only maps part of
- /// the backing store, the app must map any text that is in the range passed
- /// to any analysis functions.
- /// </remarks>
- STDMETHOD(GetTextAtPosition)(
- UINT32 textPosition,
- __out WCHAR const** textString,
- __out UINT32* textLength
- ) PURE;
-
- /// <summary>
- /// Get a block of text immediately preceding the specified position.
- /// </summary>
- /// <param name="textPosition">Position immediately after the last position of the chunk to obtain.</param>
- /// <param name="textString">Address that receives a pointer to the text block
- /// at the specified position.</param>
- /// <param name="textLength">Number of UTF16 units of the retrieved block.
- /// The length returned is from the given position to the front of
- /// the block.</param>
- /// <returns>Pointer to the first character at (textPosition - textLength).
- /// NULL indicates no chunk available at the specified position, either
- /// because textPosition == 0,the textPosition > the entire text content
- /// length, or the queried position is not mapped into the app's backing
- /// store.</returns>
- /// <remarks>
- /// Although apps can implement sparse textual content that only maps part of
- /// the backing store, the app must map any text that is in the range passed
- /// to any analysis functions.
- /// </remarks>
- STDMETHOD(GetTextBeforePosition)(
- UINT32 textPosition,
- __out WCHAR const** textString,
- __out UINT32* textLength
- ) PURE;
-
- /// <summary>
- /// Get paragraph reading direction.
- /// </summary>
- STDMETHOD_(DWRITE_READING_DIRECTION, GetParagraphReadingDirection)() PURE;
-
- /// <summary>
- /// Get locale name on the range affected by it.
- /// </summary>
- /// <param name="textPosition">Position to get the locale name of.</param>
- /// <param name="textLength">Receives the length from the given position up to the
- /// next differing locale.</param>
- /// <param name="localeName">Address that receives a pointer to the locale
- /// at the specified position.</param>
- /// <remarks>
- /// The localeName pointer must remain valid until the next call or until
- /// the analysis returns.
- /// </remarks>
- STDMETHOD(GetLocaleName)(
- UINT32 textPosition,
- __out UINT32* textLength,
- __out_z WCHAR const** localeName
- ) PURE;
-
- /// <summary>
- /// Get number substitution on the range affected by it.
- /// </summary>
- /// <param name="textPosition">Position to get the number substitution of.</param>
- /// <param name="textLength">Receives the length from the given position up to the
- /// next differing number substitution.</param>
- /// <param name="numberSubstitution">Address that receives a pointer to the number substitution
- /// at the specified position.</param>
- /// <remarks>
- /// Any implementation should return the number substitution with an
- /// incremented ref count, and the analysis will release when finished
- /// with it (either before the next call or before it returns). However,
- /// the sink callback may hold onto it after that.
- /// </remarks>
- STDMETHOD(GetNumberSubstitution)(
- UINT32 textPosition,
- __out UINT32* textLength,
- __out IDWriteNumberSubstitution** numberSubstitution
- ) PURE;
-};
-
-/// <summary>
-/// The interface implemented by the text analyzer's client to receive the
-/// output of a given text analysis. The Text analyzer disregards any current
-/// state of the analysis sink, therefore a Set method call on a range
-/// overwrites the previously set analysis result of the same range.
-/// </summary>
-interface DECLSPEC_UUID("5810cd44-0ca0-4701-b3fa-bec5182ae4f6") DECLSPEC_NOVTABLE IDWriteTextAnalysisSink : public IUnknown
-{
- /// <summary>
- /// Report script analysis for the text range.
- /// </summary>
- /// <param name="textPosition">Starting position to report from.</param>
- /// <param name="textLength">Number of UTF16 units of the reported range.</param>
- /// <param name="scriptAnalysis">Script analysis of characters in range.</param>
- /// <returns>
- /// A successful code or error code to abort analysis.
- /// </returns>
- STDMETHOD(SetScriptAnalysis)(
- UINT32 textPosition,
- UINT32 textLength,
- __in DWRITE_SCRIPT_ANALYSIS const* scriptAnalysis
- ) PURE;
-
- /// <summary>
- /// Repport line-break opportunities for each character, starting from
- /// the specified position.
- /// </summary>
- /// <param name="textPosition">Starting position to report from.</param>
- /// <param name="textLength">Number of UTF16 units of the reported range.</param>
- /// <param name="lineBreakpoints">Breaking conditions for each character.</param>
- /// <returns>
- /// A successful code or error code to abort analysis.
- /// </returns>
- STDMETHOD(SetLineBreakpoints)(
- UINT32 textPosition,
- UINT32 textLength,
- __in_ecount(textLength) DWRITE_LINE_BREAKPOINT const* lineBreakpoints
- ) PURE;
-
- /// <summary>
- /// Set bidirectional level on the range, called once per each
- /// level run change (either explicit or resolved implicit).
- /// </summary>
- /// <param name="textPosition">Starting position to report from.</param>
- /// <param name="textLength">Number of UTF16 units of the reported range.</param>
- /// <param name="explicitLevel">Explicit level from embedded control codes
- /// RLE/RLO/LRE/LRO/PDF, determined before any additional rules.</param>
- /// <param name="resolvedLevel">Final implicit level considering the
- /// explicit level and characters' natural directionality, after all
- /// Bidi rules have been applied.</param>
- /// <returns>
- /// A successful code or error code to abort analysis.
- /// </returns>
- STDMETHOD(SetBidiLevel)(
- UINT32 textPosition,
- UINT32 textLength,
- UINT8 explicitLevel,
- UINT8 resolvedLevel
- ) PURE;
-
- /// <summary>
- /// Set number substitution on the range.
- /// </summary>
- /// <param name="textPosition">Starting position to report from.</param>
- /// <param name="textLength">Number of UTF16 units of the reported range.</param>
- /// <param name="numberSubstitution">The number substitution applicable to
- /// the returned range of text. The sink callback may hold onto it by
- /// incrementing its ref count.</param>
- /// <returns>
- /// A successful code or error code to abort analysis.
- /// </returns>
- /// <remark>
- /// Unlike script and bidi analysis, where every character passed to the
- /// analyzer has a result, this will only be called for those ranges where
- /// substitution is applicable. For any other range, you will simply not
- /// be called.
- /// </remark>
- STDMETHOD(SetNumberSubstitution)(
- UINT32 textPosition,
- UINT32 textLength,
- __notnull IDWriteNumberSubstitution* numberSubstitution
- ) PURE;
-};
-
-/// <summary>
-/// Analyzes various text properties for complex script processing.
-/// </summary>
-interface DWRITE_DECLARE_INTERFACE("b7e6163e-7f46-43b4-84b3-e4e6249c365d") IDWriteTextAnalyzer : public IUnknown
-{
- /// <summary>
- /// Analyzes a text range for script boundaries, reading text attributes
- /// from the source and reporting the Unicode script ID to the sink
- /// callback SetScript.
- /// </summary>
- /// <param name="analysisSource">Source object to analyze.</param>
- /// <param name="textPosition">Starting position within the source object.</param>
- /// <param name="textLength">Length to analyze.</param>
- /// <param name="analysisSink">Callback object.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(AnalyzeScript)(
- IDWriteTextAnalysisSource* analysisSource,
- UINT32 textPosition,
- UINT32 textLength,
- IDWriteTextAnalysisSink* analysisSink
- ) PURE;
-
- /// <summary>
- /// Analyzes a text range for script directionality, reading attributes
- /// from the source and reporting levels to the sink callback SetBidiLevel.
- /// </summary>
- /// <param name="analysisSource">Source object to analyze.</param>
- /// <param name="textPosition">Starting position within the source object.</param>
- /// <param name="textLength">Length to analyze.</param>
- /// <param name="analysisSink">Callback object.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- /// <remarks>
- /// While the function can handle multiple paragraphs, the text range
- /// should not arbitrarily split the middle of paragraphs. Otherwise the
- /// returned levels may be wrong, since the Bidi algorithm is meant to
- /// apply to the paragraph as a whole.
- /// </remarks>
- /// <remarks>
- /// Embedded control codes (LRE/LRO/RLE/RLO/PDF) are taken into account.
- /// </remarks>
- STDMETHOD(AnalyzeBidi)(
- IDWriteTextAnalysisSource* analysisSource,
- UINT32 textPosition,
- UINT32 textLength,
- IDWriteTextAnalysisSink* analysisSink
- ) PURE;
-
- /// <summary>
- /// Analyzes a text range for spans where number substitution is applicable,
- /// reading attributes from the source and reporting substitutable ranges
- /// to the sink callback SetNumberSubstitution.
- /// </summary>
- /// <param name="analysisSource">Source object to analyze.</param>
- /// <param name="textPosition">Starting position within the source object.</param>
- /// <param name="textLength">Length to analyze.</param>
- /// <param name="analysisSink">Callback object.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- /// <remarks>
- /// While the function can handle multiple ranges of differing number
- /// substitutions, the text ranges should not arbitrarily split the
- /// middle of numbers. Otherwise it will treat the numbers separately
- /// and will not translate any intervening punctuation.
- /// </remarks>
- /// <remarks>
- /// Embedded control codes (LRE/LRO/RLE/RLO/PDF) are taken into account.
- /// </remarks>
- STDMETHOD(AnalyzeNumberSubstitution)(
- IDWriteTextAnalysisSource* analysisSource,
- UINT32 textPosition,
- UINT32 textLength,
- IDWriteTextAnalysisSink* analysisSink
- ) PURE;
-
- /// <summary>
- /// Analyzes a text range for potential breakpoint opportunities, reading
- /// attributes from the source and reporting breakpoint opportunities to
- /// the sink callback SetLineBreakpoints.
- /// </summary>
- /// <param name="analysisSource">Source object to analyze.</param>
- /// <param name="textPosition">Starting position within the source object.</param>
- /// <param name="textLength">Length to analyze.</param>
- /// <param name="analysisSink">Callback object.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- /// <remarks>
- /// While the function can handle multiple paragraphs, the text range
- /// should not arbitrarily split the middle of paragraphs, unless the
- /// given text span is considered a whole unit. Otherwise the
- /// returned properties for the first and last characters will
- /// inappropriately allow breaks.
- /// </remarks>
- /// <remarks>
- /// Special cases include the first, last, and surrogate characters. Any
- /// text span is treated as if adjacent to inline objects on either side.
- /// So the rules with contingent-break opportunities are used, where the
- /// edge between text and inline objects is always treated as a potential
- /// break opportunity, dependent on any overriding rules of the adjacent
- /// objects to prohibit or force the break (see Unicode TR #14).
- /// Surrogate pairs never break between.
- /// </remarks>
- STDMETHOD(AnalyzeLineBreakpoints)(
- IDWriteTextAnalysisSource* analysisSource,
- UINT32 textPosition,
- UINT32 textLength,
- IDWriteTextAnalysisSink* analysisSink
- ) PURE;
-
- /// <summary>
- /// Parses the input text string and maps it to the set of glyphs and associated glyph data
- /// according to the font and the writing system's rendering rules.
- /// </summary>
- /// <param name="textString">The string to convert to glyphs.</param>
- /// <param name="textLength">The length of textString.</param>
- /// <param name="fontFace">The font face to get glyphs from.</param>
- /// <param name="isSideways">Set to true if the text is intended to be
- /// drawn vertically.</param>
- /// <param name="isRightToLeft">Set to TRUE for right-to-left text.</param>
- /// <param name="scriptAnalysis">Script analysis result from AnalyzeScript.</param>
- /// <param name="localeName">The locale to use when selecting glyphs.
- /// e.g. the same character may map to different glyphs for ja-jp vs zh-chs.
- /// If this is NULL then the default mapping based on the script is used.</param>
- /// <param name="numberSubstitution">Optional number substitution which
- /// selects the appropriate glyphs for digits and related numeric characters,
- /// depending on the results obtained from AnalyzeNumberSubstitution. Passing
- /// null indicates that no substitution is needed and that the digits should
- /// receive nominal glyphs.</param>
- /// <param name="features">An array of pointers to the sets of typographic
- /// features to use in each feature range.</param>
- /// <param name="featureRangeLengths">The length of each feature range, in characters.
- /// The sum of all lengths should be equal to textLength.</param>
- /// <param name="featureRanges">The number of feature ranges.</param>
- /// <param name="maxGlyphCount">The maximum number of glyphs that can be
- /// returned.</param>
- /// <param name="clusterMap">The mapping from character ranges to glyph
- /// ranges.</param>
- /// <param name="textProps">Per-character output properties.</param>
- /// <param name="glyphIndices">Output glyph indices.</param>
- /// <param name="glyphProps">Per-glyph output properties.</param>
- /// <param name="actualGlyphCount">The actual number of glyphs returned if
- /// the call succeeds.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- /// <remarks>
- /// Note that the mapping from characters to glyphs is, in general, many-
- /// to-many. The recommended estimate for the per-glyph output buffers is
- /// (3 * textLength / 2 + 16). This is not guaranteed to be sufficient.
- ///
- /// The value of the actualGlyphCount parameter is only valid if the call
- /// succeeds. In the event that maxGlyphCount is not big enough
- /// E_NOT_SUFFICIENT_BUFFER, which is equivalent to HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER),
- /// will be returned. The application should allocate a larger buffer and try again.
- /// </remarks>
- STDMETHOD(GetGlyphs)(
- __in_ecount(textLength) WCHAR const* textString,
- UINT32 textLength,
- IDWriteFontFace* fontFace,
- BOOL isSideways,
- BOOL isRightToLeft,
- __in DWRITE_SCRIPT_ANALYSIS const* scriptAnalysis,
- __in_z_opt WCHAR const* localeName,
- __maybenull IDWriteNumberSubstitution* numberSubstitution,
- __in_ecount_opt(featureRanges) DWRITE_TYPOGRAPHIC_FEATURES const** features,
- __in_ecount_opt(featureRanges) UINT32 const* featureRangeLengths,
- UINT32 featureRanges,
- UINT32 maxGlyphCount,
- __out_ecount(textLength) UINT16* clusterMap,
- __out_ecount(textLength) DWRITE_SHAPING_TEXT_PROPERTIES* textProps,
- __out_ecount(maxGlyphCount) UINT16* glyphIndices,
- __out_ecount(maxGlyphCount) DWRITE_SHAPING_GLYPH_PROPERTIES* glyphProps,
- __out UINT32* actualGlyphCount
- ) PURE;
-
- /// <summary>
- /// Place glyphs output from the GetGlyphs method according to the font
- /// and the writing system's rendering rules.
- /// </summary>
- /// <param name="textString">The original string the glyphs came from.</param>
- /// <param name="clusterMap">The mapping from character ranges to glyph
- /// ranges. Returned by GetGlyphs.</param>
- /// <param name="textProps">Per-character properties. Returned by
- /// GetGlyphs.</param>
- /// <param name="textLength">The length of textString.</param>
- /// <param name="glyphIndices">Glyph indices. See GetGlyphs</param>
- /// <param name="glyphProps">Per-glyph properties. See GetGlyphs</param>
- /// <param name="glyphCount">The number of glyphs.</param>
- /// <param name="fontFace">The font face the glyphs came from.</param>
- /// <param name="fontEmSize">Logical font size in DIP's.</param>
- /// <param name="isSideways">Set to true if the text is intended to be
- /// drawn vertically.</param>
- /// <param name="isRightToLeft">Set to TRUE for right-to-left text.</param>
- /// <param name="scriptAnalysis">Script analysis result from AnalyzeScript.</param>
- /// <param name="localeName">The locale to use when selecting glyphs.
- /// e.g. the same character may map to different glyphs for ja-jp vs zh-chs.
- /// If this is NULL then the default mapping based on the script is used.</param>
- /// <param name="features">An array of pointers to the sets of typographic
- /// features to use in each feature range.</param>
- /// <param name="featureRangeLengths">The length of each feature range, in characters.
- /// The sum of all lengths should be equal to textLength.</param>
- /// <param name="featureRanges">The number of feature ranges.</param>
- /// <param name="glyphAdvances">The advance width of each glyph.</param>
- /// <param name="glyphOffsets">The offset of the origin of each glyph.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetGlyphPlacements)(
- __in_ecount(textLength) WCHAR const* textString,
- __in_ecount(textLength) UINT16 const* clusterMap,
- __in_ecount(textLength) DWRITE_SHAPING_TEXT_PROPERTIES* textProps,
- UINT32 textLength,
- __in_ecount(glyphCount) UINT16 const* glyphIndices,
- __in_ecount(glyphCount) DWRITE_SHAPING_GLYPH_PROPERTIES const* glyphProps,
- UINT32 glyphCount,
- IDWriteFontFace * fontFace,
- FLOAT fontEmSize,
- BOOL isSideways,
- BOOL isRightToLeft,
- __in DWRITE_SCRIPT_ANALYSIS const* scriptAnalysis,
- __in_z_opt WCHAR const* localeName,
- __in_ecount_opt(featureRanges) DWRITE_TYPOGRAPHIC_FEATURES const** features,
- __in_ecount_opt(featureRanges) UINT32 const* featureRangeLengths,
- UINT32 featureRanges,
- __out_ecount(glyphCount) FLOAT* glyphAdvances,
- __out_ecount(glyphCount) DWRITE_GLYPH_OFFSET* glyphOffsets
- ) PURE;
-
- /// <summary>
- /// Place glyphs output from the GetGlyphs method according to the font
- /// and the writing system's rendering rules.
- /// </summary>
- /// <param name="textString">The original string the glyphs came from.</param>
- /// <param name="clusterMap">The mapping from character ranges to glyph
- /// ranges. Returned by GetGlyphs.</param>
- /// <param name="textProps">Per-character properties. Returned by
- /// GetGlyphs.</param>
- /// <param name="textLength">The length of textString.</param>
- /// <param name="glyphIndices">Glyph indices. See GetGlyphs</param>
- /// <param name="glyphProps">Per-glyph properties. See GetGlyphs</param>
- /// <param name="glyphCount">The number of glyphs.</param>
- /// <param name="fontFace">The font face the glyphs came from.</param>
- /// <param name="fontEmSize">Logical font size in DIP's.</param>
- /// <param name="pixelsPerDip">Number of physical pixels per DIP. For example, if the DPI of the rendering surface is 96 this
- /// value is 1.0f. If the DPI is 120, this value is 120.0f/96.</param>
- /// <param name="transform">Optional transform applied to the glyphs and their positions. This transform is applied after the
- /// scaling specified by the font size and pixelsPerDip.</param>
- /// <param name="useGdiNatural">
- /// When set to FALSE, the metrics are the same as the metrics of GDI aliased text.
- /// When set to TRUE, the metrics are the same as the metrics of text measured by GDI using a font
- /// created with CLEARTYPE_NATURAL_QUALITY.
- /// </param>
- /// <param name="isSideways">Set to true if the text is intended to be
- /// drawn vertically.</param>
- /// <param name="isRightToLeft">Set to TRUE for right-to-left text.</param>
- /// <param name="scriptAnalysis">Script analysis result from AnalyzeScript.</param>
- /// <param name="localeName">The locale to use when selecting glyphs.
- /// e.g. the same character may map to different glyphs for ja-jp vs zh-chs.
- /// If this is NULL then the default mapping based on the script is used.</param>
- /// <param name="features">An array of pointers to the sets of typographic
- /// features to use in each feature range.</param>
- /// <param name="featureRangeLengths">The length of each feature range, in characters.
- /// The sum of all lengths should be equal to textLength.</param>
- /// <param name="featureRanges">The number of feature ranges.</param>
- /// <param name="glyphAdvances">The advance width of each glyph.</param>
- /// <param name="glyphOffsets">The offset of the origin of each glyph.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetGdiCompatibleGlyphPlacements)(
- __in_ecount(textLength) WCHAR const* textString,
- __in_ecount(textLength) UINT16 const* clusterMap,
- __in_ecount(textLength) DWRITE_SHAPING_TEXT_PROPERTIES* textProps,
- UINT32 textLength,
- __in_ecount(glyphCount) UINT16 const* glyphIndices,
- __in_ecount(glyphCount) DWRITE_SHAPING_GLYPH_PROPERTIES const* glyphProps,
- UINT32 glyphCount,
- IDWriteFontFace * fontFace,
- FLOAT fontEmSize,
- FLOAT pixelsPerDip,
- __in_opt DWRITE_MATRIX const* transform,
- BOOL useGdiNatural,
- BOOL isSideways,
- BOOL isRightToLeft,
- __in DWRITE_SCRIPT_ANALYSIS const* scriptAnalysis,
- __in_z_opt WCHAR const* localeName,
- __in_ecount_opt(featureRanges) DWRITE_TYPOGRAPHIC_FEATURES const** features,
- __in_ecount_opt(featureRanges) UINT32 const* featureRangeLengths,
- UINT32 featureRanges,
- __out_ecount(glyphCount) FLOAT* glyphAdvances,
- __out_ecount(glyphCount) DWRITE_GLYPH_OFFSET* glyphOffsets
- ) PURE;
-};
-
-/// <summary>
-/// The DWRITE_GLYPH_RUN structure contains the information needed by renderers
-/// to draw glyph runs. All coordinates are in device independent pixels (DIPs).
-/// </summary>
-struct DWRITE_GLYPH_RUN
-{
- /// <summary>
- /// The physical font face to draw with.
- /// </summary>
- __notnull IDWriteFontFace* fontFace;
-
- /// <summary>
- /// Logical size of the font in DIPs, not points (equals 1/96 inch).
- /// </summary>
- FLOAT fontEmSize;
-
- /// <summary>
- /// The number of glyphs.
- /// </summary>
- UINT32 glyphCount;
-
- /// <summary>
- /// The indices to render.
- /// </summary>
- __field_ecount(glyphCount) UINT16 const* glyphIndices;
-
- /// <summary>
- /// Glyph advance widths.
- /// </summary>
- __field_ecount_opt(glyphCount) FLOAT const* glyphAdvances;
-
- /// <summary>
- /// Glyph offsets.
- /// </summary>
- __field_ecount_opt(glyphCount) DWRITE_GLYPH_OFFSET const* glyphOffsets;
-
- /// <summary>
- /// If true, specifies that glyphs are rotated 90 degrees to the left and
- /// vertical metrics are used. Vertical writing is achieved by specifying
- /// isSideways = true and rotating the entire run 90 degrees to the right
- /// via a rotate transform.
- /// </summary>
- BOOL isSideways;
-
- /// <summary>
- /// The implicit resolved bidi level of the run. Odd levels indicate
- /// right-to-left languages like Hebrew and Arabic, while even levels
- /// indicate left-to-right languages like English and Japanese (when
- /// written horizontally). For right-to-left languages, the text origin
- /// is on the right, and text should be drawn to the left.
- /// </summary>
- UINT32 bidiLevel;
-};
-
-/// <summary>
-/// The DWRITE_GLYPH_RUN_DESCRIPTION structure contains additional properties
-/// related to those in DWRITE_GLYPH_RUN.
-/// </summary>
-struct DWRITE_GLYPH_RUN_DESCRIPTION
-{
- /// <summary>
- /// The locale name associated with this run.
- /// </summary>
- __nullterminated WCHAR const* localeName;
-
- /// <summary>
- /// The text associated with the glyphs.
- /// </summary>
- __field_ecount(stringLength) WCHAR const* string;
-
- /// <summary>
- /// The number of characters (UTF16 code-units).
- /// Note that this may be different than the number of glyphs.
- /// </summary>
- UINT32 stringLength;
-
- /// <summary>
- /// An array of indices to the glyph indices array, of the first glyphs of
- /// all the glyph clusters of the glyphs to render.
- /// </summary>
- __field_ecount(stringLength) UINT16 const* clusterMap;
-
- /// <summary>
- /// Corresponding text position in the original string
- /// this glyph run came from.
- /// </summary>
- UINT32 textPosition;
-};
-
-/// <summary>
-/// The DWRITE_UNDERLINE structure contains about the size and placement of
-/// underlines. All coordinates are in device independent pixels (DIPs).
-/// </summary>
-struct DWRITE_UNDERLINE
-{
- /// <summary>
- /// Width of the underline, measured parallel to the baseline.
- /// </summary>
- FLOAT width;
-
- /// <summary>
- /// Thickness of the underline, measured perpendicular to the
- /// baseline.
- /// </summary>
- FLOAT thickness;
-
- /// <summary>
- /// Offset of the underline from the baseline.
- /// A positive offset represents a position below the baseline and
- /// a negative offset is above.
- /// </summary>
- FLOAT offset;
-
- /// <summary>
- /// Height of the tallest run where the underline applies.
- /// </summary>
- FLOAT runHeight;
-
- /// <summary>
- /// Reading direction of the text associated with the underline. This
- /// value is used to interpret whether the width value runs horizontally
- /// or vertically.
- /// </summary>
- DWRITE_READING_DIRECTION readingDirection;
-
- /// <summary>
- /// Flow direction of the text associated with the underline. This value
- /// is used to interpret whether the thickness value advances top to
- /// bottom, left to right, or right to left.
- /// </summary>
- DWRITE_FLOW_DIRECTION flowDirection;
-
- /// <summary>
- /// Locale of the text the underline is being drawn under. Can be
- /// pertinent where the locale affects how the underline is drawn.
- /// For example, in vertical text, the underline belongs on the
- /// left for Chinese but on the right for Japanese.
- /// This choice is completely left up to higher levels.
- /// </summary>
- __nullterminated WCHAR const* localeName;
-
- /// <summary>
- /// The measuring mode can be useful to the renderer to determine how
- /// underlines are rendered, e.g. rounding the thickness to a whole pixel
- /// in GDI-compatible modes.
- /// </summary>
- DWRITE_MEASURING_MODE measuringMode;
-};
-
-/// <summary>
-/// The DWRITE_STRIKETHROUGH structure contains about the size and placement of
-/// strickthroughs. All coordinates are in device independent pixels (DIPs).
-/// </summary>
-struct DWRITE_STRIKETHROUGH
-{
- /// <summary>
- /// Width of the strikethrough, measured parallel to the baseline.
- /// </summary>
- FLOAT width;
-
- /// <summary>
- /// Thickness of the strikethrough, measured perpendicular to the
- /// baseline.
- /// </summary>
- FLOAT thickness;
-
- /// <summary>
- /// Offset of the stikethrough from the baseline.
- /// A positive offset represents a position below the baseline and
- /// a negative offset is above.
- /// </summary>
- FLOAT offset;
-
- /// <summary>
- /// Reading direction of the text associated with the strikethrough. This
- /// value is used to interpret whether the width value runs horizontally
- /// or vertically.
- /// </summary>
- DWRITE_READING_DIRECTION readingDirection;
-
- /// <summary>
- /// Flow direction of the text associated with the strikethrough. This
- /// value is used to interpret whether the thickness value advances top to
- /// bottom, left to right, or right to left.
- /// </summary>
- DWRITE_FLOW_DIRECTION flowDirection;
-
- /// <summary>
- /// Locale of the range. Can be pertinent where the locale affects the style.
- /// </summary>
- __nullterminated WCHAR const* localeName;
-
- /// <summary>
- /// The measuring mode can be useful to the renderer to determine how
- /// underlines are rendered, e.g. rounding the thickness to a whole pixel
- /// in GDI-compatible modes.
- /// </summary>
- DWRITE_MEASURING_MODE measuringMode;
-};
-
-/// <summary>
-/// The DWRITE_LINE_METRICS structure contains information about a formatted
-/// line of text.
-/// </summary>
-struct DWRITE_LINE_METRICS
-{
- /// <summary>
- /// The number of total text positions in the line.
- /// This includes any trailing whitespace and newline characters.
- /// </summary>
- UINT32 length;
-
- /// <summary>
- /// The number of whitespace positions at the end of the line. Newline
- /// sequences are considered whitespace.
- /// </summary>
- UINT32 trailingWhitespaceLength;
-
- /// <summary>
- /// The number of characters in the newline sequence at the end of the line.
- /// If the count is zero, then the line was either wrapped or it is the
- /// end of the text.
- /// </summary>
- UINT32 newlineLength;
-
- /// <summary>
- /// Height of the line as measured from top to bottom.
- /// </summary>
- FLOAT height;
-
- /// <summary>
- /// Distance from the top of the line to its baseline.
- /// </summary>
- FLOAT baseline;
-
- /// <summary>
- /// The line is trimmed.
- /// </summary>
- BOOL isTrimmed;
-};
-
-
-/// <summary>
-/// The DWRITE_CLUSTER_METRICS structure contains information about a glyph cluster.
-/// </summary>
-struct DWRITE_CLUSTER_METRICS
-{
- /// <summary>
- /// The total advance width of all glyphs in the cluster.
- /// </summary>
- FLOAT width;
-
- /// <summary>
- /// The number of text positions in the cluster.
- /// </summary>
- UINT16 length;
-
- /// <summary>
- /// Indicate whether line can be broken right after the cluster.
- /// </summary>
- UINT16 canWrapLineAfter : 1;
-
- /// <summary>
- /// Indicate whether the cluster corresponds to whitespace character.
- /// </summary>
- UINT16 isWhitespace : 1;
-
- /// <summary>
- /// Indicate whether the cluster corresponds to a newline character.
- /// </summary>
- UINT16 isNewline : 1;
-
- /// <summary>
- /// Indicate whether the cluster corresponds to soft hyphen character.
- /// </summary>
- UINT16 isSoftHyphen : 1;
-
- /// <summary>
- /// Indicate whether the cluster is read from right to left.
- /// </summary>
- UINT16 isRightToLeft : 1;
-
- UINT16 padding : 11;
-};
-
-
-/// <summary>
-/// Overall metrics associated with text after layout.
-/// All coordinates are in device independent pixels (DIPs).
-/// </summary>
-struct DWRITE_TEXT_METRICS
-{
- /// <summary>
- /// Left-most point of formatted text relative to layout box
- /// (excluding any glyph overhang).
- /// </summary>
- FLOAT left;
-
- /// <summary>
- /// Top-most point of formatted text relative to layout box
- /// (excluding any glyph overhang).
- /// </summary>
- FLOAT top;
-
- /// <summary>
- /// The width of the formatted text ignoring trailing whitespace
- /// at the end of each line.
- /// </summary>
- FLOAT width;
-
- /// <summary>
- /// The width of the formatted text taking into account the
- /// trailing whitespace at the end of each line.
- /// </summary>
- FLOAT widthIncludingTrailingWhitespace;
-
- /// <summary>
- /// The height of the formatted text. The height of an empty string
- /// is determined by the size of the default font's line height.
- /// </summary>
- FLOAT height;
-
- /// <summary>
- /// Initial width given to the layout. Depending on whether the text
- /// was wrapped or not, it can be either larger or smaller than the
- /// text content width.
- /// </summary>
- FLOAT layoutWidth;
-
- /// <summary>
- /// Initial height given to the layout. Depending on the length of the
- /// text, it may be larger or smaller than the text content height.
- /// </summary>
- FLOAT layoutHeight;
-
- /// <summary>
- /// The maximum reordering count of any line of text, used
- /// to calculate the most number of hit-testing boxes needed.
- /// If the layout has no bidirectional text or no text at all,
- /// the minimum level is 1.
- /// </summary>
- UINT32 maxBidiReorderingDepth;
-
- /// <summary>
- /// Total number of lines.
- /// </summary>
- UINT32 lineCount;
-};
-
-
-/// <summary>
-/// Properties describing the geometric measurement of an
-/// application-defined inline object.
-/// </summary>
-struct DWRITE_INLINE_OBJECT_METRICS
-{
- /// <summary>
- /// Width of the inline object.
- /// </summary>
- FLOAT width;
-
- /// <summary>
- /// Height of the inline object as measured from top to bottom.
- /// </summary>
- FLOAT height;
-
- /// <summary>
- /// Distance from the top of the object to the baseline where it is lined up with the adjacent text.
- /// If the baseline is at the bottom, baseline simply equals height.
- /// </summary>
- FLOAT baseline;
-
- /// <summary>
- /// Flag indicating whether the object is to be placed upright or alongside the text baseline
- /// for vertical text.
- /// </summary>
- BOOL supportsSideways;
-};
-
-
-/// <summary>
-/// The DWRITE_OVERHANG_METRICS structure holds how much any visible pixels
-/// (in DIPs) overshoot each side of the layout or inline objects.
-/// </summary>
-/// <remarks>
-/// Positive overhangs indicate that the visible area extends outside the layout
-/// box or inline object, while negative values mean there is whitespace inside.
-/// The returned values are unaffected by rendering transforms or pixel snapping.
-/// Additionally, they may not exactly match final target's pixel bounds after
-/// applying grid fitting and hinting.
-/// </remarks>
-struct DWRITE_OVERHANG_METRICS
-{
- /// <summary>
- /// The distance from the left-most visible DIP to its left alignment edge.
- /// </summary>
- FLOAT left;
-
- /// <summary>
- /// The distance from the top-most visible DIP to its top alignment edge.
- /// </summary>
- FLOAT top;
-
- /// <summary>
- /// The distance from the right-most visible DIP to its right alignment edge.
- /// </summary>
- FLOAT right;
-
- /// <summary>
- /// The distance from the bottom-most visible DIP to its bottom alignment edge.
- /// </summary>
- FLOAT bottom;
-};
-
-
-/// <summary>
-/// Geometry enclosing of text positions.
-/// </summary>
-struct DWRITE_HIT_TEST_METRICS
-{
- /// <summary>
- /// First text position within the geometry.
- /// </summary>
- UINT32 textPosition;
-
- /// <summary>
- /// Number of text positions within the geometry.
- /// </summary>
- UINT32 length;
-
- /// <summary>
- /// Left position of the top-left coordinate of the geometry.
- /// </summary>
- FLOAT left;
-
- /// <summary>
- /// Top position of the top-left coordinate of the geometry.
- /// </summary>
- FLOAT top;
-
- /// <summary>
- /// Geometry's width.
- /// </summary>
- FLOAT width;
-
- /// <summary>
- /// Geometry's height.
- /// </summary>
- FLOAT height;
-
- /// <summary>
- /// Bidi level of text positions enclosed within the geometry.
- /// </summary>
- UINT32 bidiLevel;
-
- /// <summary>
- /// Geometry encloses text?
- /// </summary>
- BOOL isText;
-
- /// <summary>
- /// Range is trimmed.
- /// </summary>
- BOOL isTrimmed;
-};
-
-
-interface IDWriteTextRenderer;
-
-
-/// <summary>
-/// The IDWriteInlineObject interface wraps an application defined inline graphic,
-/// allowing DWrite to query metrics as if it was a glyph inline with the text.
-/// </summary>
-interface DWRITE_DECLARE_INTERFACE("8339FDE3-106F-47ab-8373-1C6295EB10B3") IDWriteInlineObject : public IUnknown
-{
- /// <summary>
- /// The application implemented rendering callback (IDWriteTextRenderer::DrawInlineObject)
- /// can use this to draw the inline object without needing to cast or query the object
- /// type. The text layout does not call this method directly.
- /// </summary>
- /// <param name="clientDrawingContext">The context passed to IDWriteTextLayout::Draw.</param>
- /// <param name="renderer">The renderer passed to IDWriteTextLayout::Draw as the object's containing parent.</param>
- /// <param name="originX">X-coordinate at the top-left corner of the inline object.</param>
- /// <param name="originY">Y-coordinate at the top-left corner of the inline object.</param>
- /// <param name="isSideways">The object should be drawn on its side.</param>
- /// <param name="isRightToLeft">The object is in an right-to-left context and should be drawn flipped.</param>
- /// <param name="clientDrawingEffect">The drawing effect set in IDWriteTextLayout::SetDrawingEffect.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(Draw)(
- __maybenull void* clientDrawingContext,
- IDWriteTextRenderer* renderer,
- FLOAT originX,
- FLOAT originY,
- BOOL isSideways,
- BOOL isRightToLeft,
- __maybenull IUnknown* clientDrawingEffect
- ) PURE;
-
- /// <summary>
- /// TextLayout calls this callback function to get the measurement of the inline object.
- /// </summary>
- /// <param name="metrics">Returned metrics</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetMetrics)(
- __out DWRITE_INLINE_OBJECT_METRICS* metrics
- ) PURE;
-
- /// <summary>
- /// TextLayout calls this callback function to get the visible extents (in DIPs) of the inline object.
- /// In the case of a simple bitmap, with no padding and no overhang, all the overhangs will
- /// simply be zeroes.
- /// </summary>
- /// <param name="overhangs">Overshoot of visible extents (in DIPs) outside the object.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- /// <remarks>
- /// The overhangs should be returned relative to the reported size of the object
- /// (DWRITE_INLINE_OBJECT_METRICS::width/height), and should not be baseline
- /// adjusted. If you have an image that is actually 100x100 DIPs, but you want it
- /// slightly inset (perhaps it has a glow) by 20 DIPs on each side, you would
- /// return a width/height of 60x60 and four overhangs of 20 DIPs.
- /// </remarks>
- STDMETHOD(GetOverhangMetrics)(
- __out DWRITE_OVERHANG_METRICS* overhangs
- ) PURE;
-
- /// <summary>
- /// Layout uses this to determine the line breaking behavior of the inline object
- /// amidst the text.
- /// </summary>
- /// <param name="breakConditionBefore">Line-breaking condition between the object and the content immediately preceding it.</param>
- /// <param name="breakConditionAfter" >Line-breaking condition between the object and the content immediately following it.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetBreakConditions)(
- __out DWRITE_BREAK_CONDITION* breakConditionBefore,
- __out DWRITE_BREAK_CONDITION* breakConditionAfter
- ) PURE;
-};
-
-/// <summary>
-/// The IDWritePixelSnapping interface defines the pixel snapping properties of a text renderer.
-/// </summary>
-interface DWRITE_DECLARE_INTERFACE("eaf3a2da-ecf4-4d24-b644-b34f6842024b") IDWritePixelSnapping : public IUnknown
-{
- /// <summary>
- /// Determines whether pixel snapping is disabled. The recommended default is FALSE,
- /// unless doing animation that requires subpixel vertical placement.
- /// </summary>
- /// <param name="clientDrawingContext">The context passed to IDWriteTextLayout::Draw.</param>
- /// <param name="isDisabled">Receives TRUE if pixel snapping is disabled or FALSE if it not.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(IsPixelSnappingDisabled)(
- __maybenull void* clientDrawingContext,
- __out BOOL* isDisabled
- ) PURE;
-
- /// <summary>
- /// Gets the current transform that maps abstract coordinates to DIPs,
- /// which may disable pixel snapping upon any rotation or shear.
- /// </summary>
- /// <param name="clientDrawingContext">The context passed to IDWriteTextLayout::Draw.</param>
- /// <param name="transform">Receives the transform.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetCurrentTransform)(
- __maybenull void* clientDrawingContext,
- __out DWRITE_MATRIX* transform
- ) PURE;
-
- /// <summary>
- /// Gets the number of physical pixels per DIP. A DIP (device-independent pixel) is 1/96 inch,
- /// so the pixelsPerDip value is the number of logical pixels per inch divided by 96 (yielding
- /// a value of 1 for 96 DPI and 1.25 for 120).
- /// </summary>
- /// <param name="clientDrawingContext">The context passed to IDWriteTextLayout::Draw.</param>
- /// <param name="pixelsPerDip">Receives the number of physical pixels per DIP.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetPixelsPerDip)(
- __maybenull void* clientDrawingContext,
- __out FLOAT* pixelsPerDip
- ) PURE;
-};
-
-/// <summary>
-/// The IDWriteTextLayout interface represents a set of application-defined
-/// callbacks that perform rendering of text, inline objects, and decorations
-/// such as underlines.
-/// </summary>
-interface DWRITE_DECLARE_INTERFACE("ef8a8135-5cc6-45fe-8825-c5a0724eb819") IDWriteTextRenderer : public IDWritePixelSnapping
-{
- /// <summary>
- /// IDWriteTextLayout::Draw calls this function to instruct the client to
- /// render a run of glyphs.
- /// </summary>
- /// <param name="clientDrawingContext">The context passed to
- /// IDWriteTextLayout::Draw.</param>
- /// <param name="baselineOriginX">X-coordinate of the baseline.</param>
- /// <param name="baselineOriginY">Y-coordinate of the baseline.</param>
- /// <param name="measuringMode">Specifies measuring method for glyphs in the run.
- /// Renderer implementations may choose different rendering modes for given measuring methods,
- /// but best results are seen when the rendering mode matches the corresponding measuring mode:
- /// DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL for DWRITE_MEASURING_MODE_NATURAL
- /// DWRITE_RENDERING_MODE_CLEARTYPE_GDI_CLASSIC for DWRITE_MEASURING_MODE_GDI_CLASSIC
- /// DWRITE_RENDERING_MODE_CLEARTYPE_GDI_NATURAL for DWRITE_MEASURING_MODE_GDI_NATURAL
- /// </param>
- /// <param name="glyphRun">The glyph run to draw.</param>
- /// <param name="glyphRunDescription">Properties of the characters
- /// associated with this run.</param>
- /// <param name="clientDrawingEffect">The drawing effect set in
- /// IDWriteTextLayout::SetDrawingEffect.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(DrawGlyphRun)(
- __maybenull void* clientDrawingContext,
- FLOAT baselineOriginX,
- FLOAT baselineOriginY,
- DWRITE_MEASURING_MODE measuringMode,
- __in DWRITE_GLYPH_RUN const* glyphRun,
- __in DWRITE_GLYPH_RUN_DESCRIPTION const* glyphRunDescription,
- __maybenull IUnknown* clientDrawingEffect
- ) PURE;
-
- /// <summary>
- /// IDWriteTextLayout::Draw calls this function to instruct the client to draw
- /// an underline.
- /// </summary>
- /// <param name="clientDrawingContext">The context passed to
- /// IDWriteTextLayout::Draw.</param>
- /// <param name="baselineOriginX">X-coordinate of the baseline.</param>
- /// <param name="baselineOriginY">Y-coordinate of the baseline.</param>
- /// <param name="underline">Underline logical information.</param>
- /// <param name="clientDrawingEffect">The drawing effect set in
- /// IDWriteTextLayout::SetDrawingEffect.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- /// <remarks>
- /// A single underline can be broken into multiple calls, depending on
- /// how the formatting changes attributes. If font sizes/styles change
- /// within an underline, the thickness and offset will be averaged
- /// weighted according to characters.
- /// To get the correct top coordinate of the underline rect, add underline::offset
- /// to the baseline's Y. Otherwise the underline will be immediately under the text.
- /// The x coordinate will always be passed as the left side, regardless
- /// of text directionality. This simplifies drawing and reduces the
- /// problem of round-off that could potentially cause gaps or a double
- /// stamped alpha blend. To avoid alpha overlap, round the end points
- /// to the nearest device pixel.
- /// </remarks>
- STDMETHOD(DrawUnderline)(
- __maybenull void* clientDrawingContext,
- FLOAT baselineOriginX,
- FLOAT baselineOriginY,
- __in DWRITE_UNDERLINE const* underline,
- __maybenull IUnknown* clientDrawingEffect
- ) PURE;
-
- /// <summary>
- /// IDWriteTextLayout::Draw calls this function to instruct the client to draw
- /// a strikethrough.
- /// </summary>
- /// <param name="clientDrawingContext">The context passed to
- /// IDWriteTextLayout::Draw.</param>
- /// <param name="baselineOriginX">X-coordinate of the baseline.</param>
- /// <param name="baselineOriginY">Y-coordinate of the baseline.</param>
- /// <param name="strikethrough">Strikethrough logical information.</param>
- /// <param name="clientDrawingEffect">The drawing effect set in
- /// IDWriteTextLayout::SetDrawingEffect.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- /// <remarks>
- /// A single strikethrough can be broken into multiple calls, depending on
- /// how the formatting changes attributes. Strikethrough is not averaged
- /// across font sizes/styles changes.
- /// To get the correct top coordinate of the strikethrough rect,
- /// add strikethrough::offset to the baseline's Y.
- /// Like underlines, the x coordinate will always be passed as the left side,
- /// regardless of text directionality.
- /// </remarks>
- STDMETHOD(DrawStrikethrough)(
- __maybenull void* clientDrawingContext,
- FLOAT baselineOriginX,
- FLOAT baselineOriginY,
- __in DWRITE_STRIKETHROUGH const* strikethrough,
- __maybenull IUnknown* clientDrawingEffect
- ) PURE;
-
- /// <summary>
- /// IDWriteTextLayout::Draw calls this application callback when it needs to
- /// draw an inline object.
- /// </summary>
- /// <param name="clientDrawingContext">The context passed to IDWriteTextLayout::Draw.</param>
- /// <param name="originX">X-coordinate at the top-left corner of the inline object.</param>
- /// <param name="originY">Y-coordinate at the top-left corner of the inline object.</param>
- /// <param name="inlineObject">The object set using IDWriteTextLayout::SetInlineObject.</param>
- /// <param name="isSideways">The object should be drawn on its side.</param>
- /// <param name="isRightToLeft">The object is in an right-to-left context and should be drawn flipped.</param>
- /// <param name="clientDrawingEffect">The drawing effect set in
- /// IDWriteTextLayout::SetDrawingEffect.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- /// <remarks>
- /// The right-to-left flag is a hint for those cases where it would look
- /// strange for the image to be shown normally (like an arrow pointing to
- /// right to indicate a submenu).
- /// </remarks>
- STDMETHOD(DrawInlineObject)(
- __maybenull void* clientDrawingContext,
- FLOAT originX,
- FLOAT originY,
- IDWriteInlineObject* inlineObject,
- BOOL isSideways,
- BOOL isRightToLeft,
- __maybenull IUnknown* clientDrawingEffect
- ) PURE;
-};
-
-/// <summary>
-/// The IDWriteTextLayout interface represents a block of text after it has
-/// been fully analyzed and formatted.
-///
-/// All coordinates are in device independent pixels (DIPs).
-/// </summary>
-interface DWRITE_DECLARE_INTERFACE("53737037-6d14-410b-9bfe-0b182bb70961") IDWriteTextLayout : public IDWriteTextFormat
-{
- /// <summary>
- /// Set layout maximum width
- /// </summary>
- /// <param name="maxWidth">Layout maximum width</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(SetMaxWidth)(
- FLOAT maxWidth
- ) PURE;
-
- /// <summary>
- /// Set layout maximum height
- /// </summary>
- /// <param name="maxHeight">Layout maximum height</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(SetMaxHeight)(
- FLOAT maxHeight
- ) PURE;
-
- /// <summary>
- /// Set the font collection.
- /// </summary>
- /// <param name="fontCollection">The font collection to set</param>
- /// <param name="textRange">Text range to which this change applies.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(SetFontCollection)(
- IDWriteFontCollection* fontCollection,
- DWRITE_TEXT_RANGE textRange
- ) PURE;
-
- /// <summary>
- /// Set null-terminated font family name.
- /// </summary>
- /// <param name="fontFamilyName">Font family name</param>
- /// <param name="textRange">Text range to which this change applies.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(SetFontFamilyName)(
- __in_z WCHAR const* fontFamilyName,
- DWRITE_TEXT_RANGE textRange
- ) PURE;
-
- /// <summary>
- /// Set font weight.
- /// </summary>
- /// <param name="fontWeight">Font weight</param>
- /// <param name="textRange">Text range to which this change applies.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(SetFontWeight)(
- DWRITE_FONT_WEIGHT fontWeight,
- DWRITE_TEXT_RANGE textRange
- ) PURE;
-
- /// <summary>
- /// Set font style.
- /// </summary>
- /// <param name="fontStyle">Font style</param>
- /// <param name="textRange">Text range to which this change applies.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(SetFontStyle)(
- DWRITE_FONT_STYLE fontStyle,
- DWRITE_TEXT_RANGE textRange
- ) PURE;
-
- /// <summary>
- /// Set font stretch.
- /// </summary>
- /// <param name="fontStretch">font stretch</param>
- /// <param name="textRange">Text range to which this change applies.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(SetFontStretch)(
- DWRITE_FONT_STRETCH fontStretch,
- DWRITE_TEXT_RANGE textRange
- ) PURE;
-
- /// <summary>
- /// Set font em height.
- /// </summary>
- /// <param name="fontSize">Font em height</param>
- /// <param name="textRange">Text range to which this change applies.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(SetFontSize)(
- FLOAT fontSize,
- DWRITE_TEXT_RANGE textRange
- ) PURE;
-
- /// <summary>
- /// Set underline.
- /// </summary>
- /// <param name="hasUnderline">The Boolean flag indicates whether underline takes place</param>
- /// <param name="textRange">Text range to which this change applies.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(SetUnderline)(
- BOOL hasUnderline,
- DWRITE_TEXT_RANGE textRange
- ) PURE;
-
- /// <summary>
- /// Set strikethrough.
- /// </summary>
- /// <param name="hasStrikethrough">The Boolean flag indicates whether strikethrough takes place</param>
- /// <param name="textRange">Text range to which this change applies.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(SetStrikethrough)(
- BOOL hasStrikethrough,
- DWRITE_TEXT_RANGE textRange
- ) PURE;
-
- /// <summary>
- /// Set application-defined drawing effect.
- /// </summary>
- /// <param name="drawingEffect">Pointer to an application-defined drawing effect.</param>
- /// <param name="textRange">Text range to which this change applies.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- /// <remarks>
- /// This drawing effect is associated with the specified range and will be passed back
- /// to the application via the callback when the range is drawn at drawing time.
- /// </remarks>
- STDMETHOD(SetDrawingEffect)(
- IUnknown* drawingEffect,
- DWRITE_TEXT_RANGE textRange
- ) PURE;
-
- /// <summary>
- /// Set inline object.
- /// </summary>
- /// <param name="inlineObject">Pointer to an application-implemented inline object.</param>
- /// <param name="textRange">Text range to which this change applies.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- /// <remarks>
- /// This inline object applies to the specified range and will be passed back
- /// to the application via the DrawInlineObject callback when the range is drawn.
- /// Any text in that range will be suppressed.
- /// </remarks>
- STDMETHOD(SetInlineObject)(
- IDWriteInlineObject* inlineObject,
- DWRITE_TEXT_RANGE textRange
- ) PURE;
-
- /// <summary>
- /// Set font typography features.
- /// </summary>
- /// <param name="typography">Pointer to font typography setting.</param>
- /// <param name="textRange">Text range to which this change applies.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(SetTypography)(
- IDWriteTypography* typography,
- DWRITE_TEXT_RANGE textRange
- ) PURE;
-
- /// <summary>
- /// Set locale name.
- /// </summary>
- /// <param name="localeName">Locale name</param>
- /// <param name="textRange">Text range to which this change applies.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(SetLocaleName)(
- __in_z WCHAR const* localeName,
- DWRITE_TEXT_RANGE textRange
- ) PURE;
-
- /// <summary>
- /// Get layout maximum width
- /// </summary>
- STDMETHOD_(FLOAT, GetMaxWidth)() PURE;
-
- /// <summary>
- /// Get layout maximum height
- /// </summary>
- STDMETHOD_(FLOAT, GetMaxHeight)() PURE;
-
- /// <summary>
- /// Get the font collection where the current position is at.
- /// </summary>
- /// <param name="currentPosition">The current text position.</param>
- /// <param name="fontCollection">The current font collection</param>
- /// <param name="textRange">Text range to which this change applies.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetFontCollection)(
- UINT32 currentPosition,
- __out IDWriteFontCollection** fontCollection,
- __out_opt DWRITE_TEXT_RANGE* textRange = NULL
- ) PURE;
-
- /// <summary>
- /// Get the length of the font family name where the current position is at.
- /// </summary>
- /// <param name="currentPosition">The current text position.</param>
- /// <param name="nameLength">Size of the character array in character count not including the terminated NULL character.</param>
- /// <param name="textRange">The position range of the current format.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetFontFamilyNameLength)(
- UINT32 currentPosition,
- __out UINT32* nameLength,
- __out_opt DWRITE_TEXT_RANGE* textRange = NULL
- ) PURE;
-
- /// <summary>
- /// Copy the font family name where the current position is at.
- /// </summary>
- /// <param name="currentPosition">The current text position.</param>
- /// <param name="fontFamilyName">Character array that receives the current font family name</param>
- /// <param name="nameSize">Size of the character array in character count including the terminated NULL character.</param>
- /// <param name="textRange">The position range of the current format.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetFontFamilyName)(
- UINT32 currentPosition,
- __out_ecount_z(nameSize) WCHAR* fontFamilyName,
- UINT32 nameSize,
- __out_opt DWRITE_TEXT_RANGE* textRange = NULL
- ) PURE;
-
- /// <summary>
- /// Get the font weight where the current position is at.
- /// </summary>
- /// <param name="currentPosition">The current text position.</param>
- /// <param name="fontWeight">The current font weight</param>
- /// <param name="textRange">The position range of the current format.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetFontWeight)(
- UINT32 currentPosition,
- __out DWRITE_FONT_WEIGHT* fontWeight,
- __out_opt DWRITE_TEXT_RANGE* textRange = NULL
- ) PURE;
-
- /// <summary>
- /// Get the font style where the current position is at.
- /// </summary>
- /// <param name="currentPosition">The current text position.</param>
- /// <param name="fontStyle">The current font style</param>
- /// <param name="textRange">The position range of the current format.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetFontStyle)(
- UINT32 currentPosition,
- __out DWRITE_FONT_STYLE* fontStyle,
- __out_opt DWRITE_TEXT_RANGE* textRange = NULL
- ) PURE;
-
- /// <summary>
- /// Get the font stretch where the current position is at.
- /// </summary>
- /// <param name="currentPosition">The current text position.</param>
- /// <param name="fontStretch">The current font stretch</param>
- /// <param name="textRange">The position range of the current format.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetFontStretch)(
- UINT32 currentPosition,
- __out DWRITE_FONT_STRETCH* fontStretch,
- __out_opt DWRITE_TEXT_RANGE* textRange = NULL
- ) PURE;
-
- /// <summary>
- /// Get the font em height where the current position is at.
- /// </summary>
- /// <param name="currentPosition">The current text position.</param>
- /// <param name="fontSize">The current font em height</param>
- /// <param name="textRange">The position range of the current format.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetFontSize)(
- UINT32 currentPosition,
- __out FLOAT* fontSize,
- __out_opt DWRITE_TEXT_RANGE* textRange = NULL
- ) PURE;
-
- /// <summary>
- /// Get the underline presence where the current position is at.
- /// </summary>
- /// <param name="currentPosition">The current text position.</param>
- /// <param name="hasUnderline">The Boolean flag indicates whether text is underlined.</param>
- /// <param name="textRange">The position range of the current format.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetUnderline)(
- UINT32 currentPosition,
- __out BOOL* hasUnderline,
- __out_opt DWRITE_TEXT_RANGE* textRange = NULL
- ) PURE;
-
- /// <summary>
- /// Get the strikethrough presence where the current position is at.
- /// </summary>
- /// <param name="currentPosition">The current text position.</param>
- /// <param name="hasStrikethrough">The Boolean flag indicates whether text has strikethrough.</param>
- /// <param name="textRange">The position range of the current format.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetStrikethrough)(
- UINT32 currentPosition,
- __out BOOL* hasStrikethrough,
- __out_opt DWRITE_TEXT_RANGE* textRange = NULL
- ) PURE;
-
- /// <summary>
- /// Get the application-defined drawing effect where the current position is at.
- /// </summary>
- /// <param name="currentPosition">The current text position.</param>
- /// <param name="drawingEffect">The current application-defined drawing effect.</param>
- /// <param name="textRange">The position range of the current format.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetDrawingEffect)(
- UINT32 currentPosition,
- __out IUnknown** drawingEffect,
- __out_opt DWRITE_TEXT_RANGE* textRange = NULL
- ) PURE;
-
- /// <summary>
- /// Get the inline object at the given position.
- /// </summary>
- /// <param name="currentPosition">The given text position.</param>
- /// <param name="inlineObject">The inline object.</param>
- /// <param name="textRange">The position range of the current format.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetInlineObject)(
- UINT32 currentPosition,
- __out IDWriteInlineObject** inlineObject,
- __out_opt DWRITE_TEXT_RANGE* textRange = NULL
- ) PURE;
-
- /// <summary>
- /// Get the typography setting where the current position is at.
- /// </summary>
- /// <param name="currentPosition">The current text position.</param>
- /// <param name="typography">The current typography setting.</param>
- /// <param name="textRange">The position range of the current format.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetTypography)(
- UINT32 currentPosition,
- __out IDWriteTypography** typography,
- __out_opt DWRITE_TEXT_RANGE* textRange = NULL
- ) PURE;
-
- /// <summary>
- /// Get the length of the locale name where the current position is at.
- /// </summary>
- /// <param name="currentPosition">The current text position.</param>
- /// <param name="nameLength">Size of the character array in character count not including the terminated NULL character.</param>
- /// <param name="textRange">The position range of the current format.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetLocaleNameLength)(
- UINT32 currentPosition,
- __out UINT32* nameLength,
- __out_opt DWRITE_TEXT_RANGE* textRange = NULL
- ) PURE;
-
- /// <summary>
- /// Get the locale name where the current position is at.
- /// </summary>
- /// <param name="currentPosition">The current text position.</param>
- /// <param name="localeName">Character array that receives the current locale name</param>
- /// <param name="nameSize">Size of the character array in character count including the terminated NULL character.</param>
- /// <param name="textRange">The position range of the current format.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetLocaleName)(
- UINT32 currentPosition,
- __out_ecount_z(nameSize) WCHAR* localeName,
- UINT32 nameSize,
- __out_opt DWRITE_TEXT_RANGE* textRange = NULL
- ) PURE;
-
- /// <summary>
- /// Initiate drawing of the text.
- /// </summary>
- /// <param name="clientDrawingContext">An application defined value
- /// included in rendering callbacks.</param>
- /// <param name="renderer">The set of application-defined callbacks that do
- /// the actual rendering.</param>
- /// <param name="originX">X-coordinate of the layout's left side.</param>
- /// <param name="originY">Y-coordinate of the layout's top side.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(Draw)(
- __maybenull void* clientDrawingContext,
- IDWriteTextRenderer* renderer,
- FLOAT originX,
- FLOAT originY
- ) PURE;
-
- /// <summary>
- /// GetLineMetrics returns properties of each line.
- /// </summary>
- /// <param name="lineMetrics">The array to fill with line information.</param>
- /// <param name="maxLineCount">The maximum size of the lineMetrics array.</param>
- /// <param name="actualLineCount">The actual size of the lineMetrics
- /// array that is needed.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- /// <remarks>
- /// If maxLineCount is not large enough E_NOT_SUFFICIENT_BUFFER,
- /// which is equivalent to HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER),
- /// is returned and *actualLineCount is set to the number of lines
- /// needed.
- /// </remarks>
- STDMETHOD(GetLineMetrics)(
- __out_ecount_opt(maxLineCount) DWRITE_LINE_METRICS* lineMetrics,
- UINT32 maxLineCount,
- __out UINT32* actualLineCount
- ) PURE;
-
- /// <summary>
- /// GetMetrics retrieves overall metrics for the formatted string.
- /// </summary>
- /// <param name="textMetrics">The returned metrics.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- /// <remarks>
- /// Drawing effects like underline and strikethrough do not contribute
- /// to the text size, which is essentially the sum of advance widths and
- /// line heights. Additionally, visible swashes and other graphic
- /// adornments may extend outside the returned width and height.
- /// </remarks>
- STDMETHOD(GetMetrics)(
- __out DWRITE_TEXT_METRICS* textMetrics
- ) PURE;
-
- /// <summary>
- /// GetOverhangMetrics returns the overhangs (in DIPs) of the layout and all
- /// objects contained in it, including text glyphs and inline objects.
- /// </summary>
- /// <param name="overhangs">Overshoots of visible extents (in DIPs) outside the layout.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- /// <remarks>
- /// Any underline and strikethrough do not contribute to the black box
- /// determination, since these are actually drawn by the renderer, which
- /// is allowed to draw them in any variety of styles.
- /// </remarks>
- STDMETHOD(GetOverhangMetrics)(
- __out DWRITE_OVERHANG_METRICS* overhangs
- ) PURE;
-
- /// <summary>
- /// Retrieve logical properties and measurement of each cluster.
- /// </summary>
- /// <param name="clusterMetrics">The array to fill with cluster information.</param>
- /// <param name="maxClusterCount">The maximum size of the clusterMetrics array.</param>
- /// <param name="actualClusterCount">The actual size of the clusterMetrics array that is needed.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- /// <remarks>
- /// If maxClusterCount is not large enough E_NOT_SUFFICIENT_BUFFER,
- /// which is equivalent to HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER),
- /// is returned and *actualClusterCount is set to the number of clusters
- /// needed.
- /// </remarks>
- STDMETHOD(GetClusterMetrics)(
- __out_ecount_opt(maxClusterCount) DWRITE_CLUSTER_METRICS* clusterMetrics,
- UINT32 maxClusterCount,
- __out UINT32* actualClusterCount
- ) PURE;
-
- /// <summary>
- /// Determines the minimum possible width the layout can be set to without
- /// emergency breaking between the characters of whole words.
- /// </summary>
- /// <param name="minWidth">Minimum width.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(DetermineMinWidth)(
- __out FLOAT* minWidth
- ) PURE;
-
- /// <summary>
- /// Given a coordinate (in DIPs) relative to the top-left of the layout box,
- /// this returns the corresponding hit-test metrics of the text string where
- /// the hit-test has occurred. This is useful for mapping mouse clicks to caret
- /// positions. When the given coordinate is outside the text string, the function
- /// sets the output value *isInside to false but returns the nearest character
- /// position.
- /// </summary>
- /// <param name="pointX">X coordinate to hit-test, relative to the top-left location of the layout box.</param>
- /// <param name="pointY">Y coordinate to hit-test, relative to the top-left location of the layout box.</param>
- /// <param name="isTrailingHit">Output flag indicating whether the hit-test location is at the leading or the trailing
- /// side of the character. When the output *isInside value is set to false, this value is set according to the output
- /// *position value to represent the edge closest to the hit-test location. </param>
- /// <param name="isInside">Output flag indicating whether the hit-test location is inside the text string.
- /// When false, the position nearest the text's edge is returned.</param>
- /// <param name="hitTestMetrics">Output geometry fully enclosing the hit-test location. When the output *isInside value
- /// is set to false, this structure represents the geometry enclosing the edge closest to the hit-test location.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(HitTestPoint)(
- FLOAT pointX,
- FLOAT pointY,
- __out BOOL* isTrailingHit,
- __out BOOL* isInside,
- __out DWRITE_HIT_TEST_METRICS* hitTestMetrics
- ) PURE;
-
- /// <summary>
- /// Given a text position and whether the caret is on the leading or trailing
- /// edge of that position, this returns the corresponding coordinate (in DIPs)
- /// relative to the top-left of the layout box. This is most useful for drawing
- /// the caret's current position, but it could also be used to anchor an IME to the
- /// typed text or attach a floating menu near the point of interest. It may also be
- /// used to programmatically obtain the geometry of a particular text position
- /// for UI automation.
- /// </summary>
- /// <param name="textPosition">Text position to get the coordinate of.</param>
- /// <param name="isTrailingHit">Flag indicating whether the location is of the leading or the trailing side of the specified text position. </param>
- /// <param name="pointX">Output caret X, relative to the top-left of the layout box.</param>
- /// <param name="pointY">Output caret Y, relative to the top-left of the layout box.</param>
- /// <param name="hitTestMetrics">Output geometry fully enclosing the specified text position.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- /// <remarks>
- /// When drawing a caret at the returned X,Y, it should should be centered on X
- /// and drawn from the Y coordinate down. The height will be the size of the
- /// hit-tested text (which can vary in size within a line).
- /// Reading direction also affects which side of the character the caret is drawn.
- /// However, the returned X coordinate will be correct for either case.
- /// You can get a text length back that is larger than a single character.
- /// This happens for complex scripts when multiple characters form a single cluster,
- /// when diacritics join their base character, or when you test a surrogate pair.
- /// </remarks>
- STDMETHOD(HitTestTextPosition)(
- UINT32 textPosition,
- BOOL isTrailingHit,
- __out FLOAT* pointX,
- __out FLOAT* pointY,
- __out DWRITE_HIT_TEST_METRICS* hitTestMetrics
- ) PURE;
-
- /// <summary>
- /// The application calls this function to get a set of hit-test metrics
- /// corresponding to a range of text positions. The main usage for this
- /// is to draw highlighted selection of the text string.
- ///
- /// The function returns E_NOT_SUFFICIENT_BUFFER, which is equivalent to
- /// HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), when the buffer size of
- /// hitTestMetrics is too small to hold all the regions calculated by the
- /// function. In such situation, the function sets the output value
- /// *actualHitTestMetricsCount to the number of geometries calculated.
- /// The application is responsible to allocate a new buffer of greater
- /// size and call the function again.
- ///
- /// A good value to use as an initial value for maxHitTestMetricsCount may
- /// be calculated from the following equation:
- /// maxHitTestMetricsCount = lineCount * maxBidiReorderingDepth
- ///
- /// where lineCount is obtained from the value of the output argument
- /// *actualLineCount from the function IDWriteTextLayout::GetLineMetrics,
- /// and the maxBidiReorderingDepth value from the DWRITE_TEXT_METRICS
- /// structure of the output argument *textMetrics from the function
- /// IDWriteFactory::CreateTextLayout.
- /// </summary>
- /// <param name="textPosition">First text position of the specified range.</param>
- /// <param name="textLength">Number of positions of the specified range.</param>
- /// <param name="originX">Offset of the X origin (left of the layout box) which is added to each of the hit-test metrics returned.</param>
- /// <param name="originY">Offset of the Y origin (top of the layout box) which is added to each of the hit-test metrics returned.</param>
- /// <param name="hitTestMetrics">Pointer to a buffer of the output geometry fully enclosing the specified position range.</param>
- /// <param name="maxHitTestMetricsCount">Maximum number of distinct metrics it could hold in its buffer memory.</param>
- /// <param name="actualHitTestMetricsCount">Actual number of metrics returned or needed.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- /// <remarks>
- /// There are no gaps in the returned metrics. While there could be visual gaps,
- /// depending on bidi ordering, each range is contiguous and reports all the text,
- /// including any hidden characters and trimmed text.
- /// The height of each returned range will be the same within each line, regardless
- /// of how the font sizes vary.
- /// </remarks>
- STDMETHOD(HitTestTextRange)(
- UINT32 textPosition,
- UINT32 textLength,
- FLOAT originX,
- FLOAT originY,
- __out_ecount_opt(maxHitTestMetricsCount) DWRITE_HIT_TEST_METRICS* hitTestMetrics,
- UINT32 maxHitTestMetricsCount,
- __out UINT32* actualHitTestMetricsCount
- ) PURE;
-};
-
-/// <summary>
-/// Encapsulates a 32-bit device independent bitmap and device context, which can be used for rendering glyphs.
-/// </summary>
-interface DWRITE_DECLARE_INTERFACE("5e5a32a3-8dff-4773-9ff6-0696eab77267") IDWriteBitmapRenderTarget : public IUnknown
-{
- /// <summary>
- /// Draws a run of glyphs to the bitmap.
- /// </summary>
- /// <param name="baselineOriginX">Horizontal position of the baseline origin, in DIPs, relative to the upper-left corner of the DIB.</param>
- /// <param name="baselineOriginY">Vertical position of the baseline origin, in DIPs, relative to the upper-left corner of the DIB.</param>
- /// <param name="measuringMode">Specifies measuring method for glyphs in the run.
- /// Renderer implementations may choose different rendering modes for different measuring methods, for example
- /// DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL for DWRITE_MEASURING_MODE_NATURAL,
- /// DWRITE_RENDERING_MODE_CLEARTYPE_GDI_CLASSIC for DWRITE_MEASURING_MODE_GDI_CLASSIC, and
- /// DWRITE_RENDERING_MODE_CLEARTYPE_GDI_NATURAL for DWRITE_MEASURING_MODE_GDI_NATURAL.
- /// </param>
- /// <param name="glyphRun">Structure containing the properties of the glyph run.</param>
- /// <param name="renderingParams">Object that controls rendering behavior.</param>
- /// <param name="textColor">Specifies the foreground color of the text.</param>
- /// <param name="blackBoxRect">Optional rectangle that receives the bounding box (in pixels not DIPs) of all the pixels affected by
- /// drawing the glyph run. The black box rectangle may extend beyond the dimensions of the bitmap.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(DrawGlyphRun)(
- FLOAT baselineOriginX,
- FLOAT baselineOriginY,
- DWRITE_MEASURING_MODE measuringMode,
- __in DWRITE_GLYPH_RUN const* glyphRun,
- IDWriteRenderingParams* renderingParams,
- COLORREF textColor,
- __out_opt RECT* blackBoxRect = NULL
- ) PURE;
-
- /// <summary>
- /// Gets a handle to the memory device context.
- /// </summary>
- /// <returns>
- /// Returns the device context handle.
- /// </returns>
- /// <remarks>
- /// An application can use the device context to draw using GDI functions. An application can obtain the bitmap handle
- /// (HBITMAP) by calling GetCurrentObject. An application that wants information about the underlying bitmap, including
- /// a pointer to the pixel data, can call GetObject to fill in a DIBSECTION structure. The bitmap is always a 32-bit
- /// top-down DIB.
- /// </remarks>
- STDMETHOD_(HDC, GetMemoryDC)() PURE;
-
- /// <summary>
- /// Gets the number of bitmap pixels per DIP. A DIP (device-independent pixel) is 1/96 inch so this value is the number
- /// if pixels per inch divided by 96.
- /// </summary>
- /// <returns>
- /// Returns the number of bitmap pixels per DIP.
- /// </returns>
- STDMETHOD_(FLOAT, GetPixelsPerDip)() PURE;
-
- /// <summary>
- /// Sets the number of bitmap pixels per DIP. A DIP (device-independent pixel) is 1/96 inch so this value is the number
- /// if pixels per inch divided by 96.
- /// </summary>
- /// <param name="pixelsPerDip">Specifies the number of pixels per DIP.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(SetPixelsPerDip)(
- FLOAT pixelsPerDip
- ) PURE;
-
- /// <summary>
- /// Gets the transform that maps abstract coordinate to DIPs. By default this is the identity
- /// transform. Note that this is unrelated to the world transform of the underlying device
- /// context.
- /// </summary>
- /// <param name="transform">Receives the transform.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetCurrentTransform)(
- __out DWRITE_MATRIX* transform
- ) PURE;
-
- /// <summary>
- /// Sets the transform that maps abstract coordinate to DIPs. This does not affect the world
- /// transform of the underlying device context.
- /// </summary>
- /// <param name="transform">Specifies the new transform. This parameter can be NULL, in which
- /// case the identity transform is implied.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(SetCurrentTransform)(
- __in_opt DWRITE_MATRIX const* transform
- ) PURE;
-
- /// <summary>
- /// Gets the dimensions of the bitmap.
- /// </summary>
- /// <param name="size">Receives the size of the bitmap in pixels.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetSize)(
- __out SIZE* size
- ) PURE;
-
- /// <summary>
- /// Resizes the bitmap.
- /// </summary>
- /// <param name="width">New bitmap width, in pixels.</param>
- /// <param name="height">New bitmap height, in pixels.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(Resize)(
- UINT32 width,
- UINT32 height
- ) PURE;
-};
-
-/// <summary>
-/// The GDI interop interface provides interoperability with GDI.
-/// </summary>
-interface DWRITE_DECLARE_INTERFACE("1edd9491-9853-4299-898f-6432983b6f3a") IDWriteGdiInterop : public IUnknown
-{
- /// <summary>
- /// Creates a font object that matches the properties specified by the LOGFONT structure.
- /// </summary>
- /// <param name="logFont">Structure containing a GDI-compatible font description.</param>
- /// <param name="font">Receives a newly created font object if successful, or NULL in case of error.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(CreateFontFromLOGFONT)(
- __in LOGFONTW const* logFont,
- __out IDWriteFont** font
- ) PURE;
-
- /// <summary>
- /// Initializes a LOGFONT structure based on the GDI-compatible properties of the specified font.
- /// </summary>
- /// <param name="font">Specifies a font in the system font collection.</param>
- /// <param name="logFont">Structure that receives a GDI-compatible font description.</param>
- /// <param name="isSystemFont">Contains TRUE if the specified font object is part of the system font collection
- /// or FALSE otherwise.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(ConvertFontToLOGFONT)(
- IDWriteFont* font,
- __out LOGFONTW* logFont,
- __out BOOL* isSystemFont
- ) PURE;
-
- /// <summary>
- /// Initializes a LOGFONT structure based on the GDI-compatible properties of the specified font.
- /// </summary>
- /// <param name="font">Specifies a font face.</param>
- /// <param name="logFont">Structure that receives a GDI-compatible font description.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(ConvertFontFaceToLOGFONT)(
- IDWriteFontFace* font,
- __out LOGFONTW* logFont
- ) PURE;
-
- /// <summary>
- /// Creates a font face object that corresponds to the currently selected HFONT.
- /// </summary>
- /// <param name="hdc">Handle to a device context into which a font has been selected. It is assumed that the client
- /// has already performed font mapping and that the font selected into the DC is the actual font that would be used
- /// for rendering glyphs.</param>
- /// <param name="fontFace">Contains the newly created font face object, or NULL in case of failure.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(CreateFontFaceFromHdc)(
- HDC hdc,
- __out IDWriteFontFace** fontFace
- ) PURE;
-
- /// <summary>
- /// Creates an object that encapsulates a bitmap and memory DC which can be used for rendering glyphs.
- /// </summary>
- /// <param name="hdc">Optional device context used to create a compatible memory DC.</param>
- /// <param name="width">Width of the bitmap.</param>
- /// <param name="height">Height of the bitmap.</param>
- /// <param name="renderTarget">Receives a pointer to the newly created render target.</param>
- STDMETHOD(CreateBitmapRenderTarget)(
- __in_opt HDC hdc,
- UINT32 width,
- UINT32 height,
- __out IDWriteBitmapRenderTarget** renderTarget
- ) PURE;
-};
-
-/// <summary>
-/// The DWRITE_TEXTURE_TYPE enumeration identifies a type of alpha texture. An alpha texture is a bitmap of alpha values, each
-/// representing the darkness (i.e., opacity) of a pixel or subpixel.
-/// </summary>
-enum DWRITE_TEXTURE_TYPE
-{
- /// <summary>
- /// Specifies an alpha texture for aliased text rendering (i.e., bi-level, where each pixel is either fully opaque or fully transparent),
- /// with one byte per pixel.
- /// </summary>
- DWRITE_TEXTURE_ALIASED_1x1,
-
- /// <summary>
- /// Specifies an alpha texture for ClearType text rendering, with three bytes per pixel in the horizontal dimension and
- /// one byte per pixel in the vertical dimension.
- /// </summary>
- DWRITE_TEXTURE_CLEARTYPE_3x1
-};
-
-/// <summary>
-/// Maximum alpha value in a texture returned by IDWriteGlyphRunAnalysis::CreateAlphaTexture.
-/// </summary>
-#define DWRITE_ALPHA_MAX 255
-
-/// <summary>
-/// Interface that encapsulates information used to render a glyph run.
-/// </summary>
-interface DWRITE_DECLARE_INTERFACE("7d97dbf7-e085-42d4-81e3-6a883bded118") IDWriteGlyphRunAnalysis : public IUnknown
-{
- /// <summary>
- /// Gets the bounding rectangle of the physical pixels affected by the glyph run.
- /// </summary>
- /// <param name="textureType">Specifies the type of texture requested. If a bi-level texture is requested, the
- /// bounding rectangle includes only bi-level glyphs. Otherwise, the bounding rectangle includes only anti-aliased
- /// glyphs.</param>
- /// <param name="textureBounds">Receives the bounding rectangle, or an empty rectangle if there are no glyphs
- /// if the specified type.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetAlphaTextureBounds)(
- DWRITE_TEXTURE_TYPE textureType,
- __out RECT* textureBounds
- ) PURE;
-
- /// <summary>
- /// Creates an alpha texture of the specified type.
- /// </summary>
- /// <param name="textureType">Specifies the type of texture requested. If a bi-level texture is requested, the
- /// texture contains only bi-level glyphs. Otherwise, the texture contains only anti-aliased glyphs.</param>
- /// <param name="textureBounds">Specifies the bounding rectangle of the texture, which can be different than
- /// the bounding rectangle returned by GetAlphaTextureBounds.</param>
- /// <param name="alphaValues">Receives the array of alpha values.</param>
- /// <param name="bufferSize">Size of the alphaValues array. The minimum size depends on the dimensions of the
- /// rectangle and the type of texture requested.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(CreateAlphaTexture)(
- DWRITE_TEXTURE_TYPE textureType,
- __in RECT const* textureBounds,
- __out_bcount(bufferSize) BYTE* alphaValues,
- UINT32 bufferSize
- ) PURE;
-
- /// <summary>
- /// Gets properties required for ClearType blending.
- /// </summary>
- /// <param name="renderingParams">Rendering parameters object. In most cases, the values returned in the output
- /// parameters are based on the properties of this object. The exception is if a GDI-compatible rendering mode
- /// is specified.</param>
- /// <param name="blendGamma">Receives the gamma value to use for gamma correction.</param>
- /// <param name="blendEnhancedContrast">Receives the enhanced contrast value.</param>
- /// <param name="blendClearTypeLevel">Receives the ClearType level.</param>
- STDMETHOD(GetAlphaBlendParams)(
- IDWriteRenderingParams* renderingParams,
- __out FLOAT* blendGamma,
- __out FLOAT* blendEnhancedContrast,
- __out FLOAT* blendClearTypeLevel
- ) PURE;
-};
-
-/// <summary>
-/// The root factory interface for all DWrite objects.
-/// </summary>
-interface DWRITE_DECLARE_INTERFACE("b859ee5a-d838-4b5b-a2e8-1adc7d93db48") IDWriteFactory : public IUnknown
-{
- /// <summary>
- /// Gets a font collection representing the set of installed fonts.
- /// </summary>
- /// <param name="fontCollection">Receives a pointer to the system font collection object, or NULL in case of failure.</param>
- /// <param name="checkForUpdates">If this parameter is nonzero, the function performs an immediate check for changes to the set of
- /// installed fonts. If this parameter is FALSE, the function will still detect changes if the font cache service is running, but
- /// there may be some latency. For example, an application might specify TRUE if it has itself just installed a font and wants to
- /// be sure the font collection contains that font.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetSystemFontCollection)(
- __out IDWriteFontCollection** fontCollection,
- BOOL checkForUpdates = FALSE
- ) PURE;
-
- /// <summary>
- /// Creates a font collection using a custom font collection loader.
- /// </summary>
- /// <param name="collectionLoader">Application-defined font collection loader, which must have been previously
- /// registered using RegisterFontCollectionLoader.</param>
- /// <param name="collectionKey">Key used by the loader to identify a collection of font files.</param>
- /// <param name="collectionKeySize">Size in bytes of the collection key.</param>
- /// <param name="fontCollection">Receives a pointer to the system font collection object, or NULL in case of failure.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(CreateCustomFontCollection)(
- IDWriteFontCollectionLoader* collectionLoader,
- __in_bcount(collectionKeySize) void const* collectionKey,
- UINT32 collectionKeySize,
- __out IDWriteFontCollection** fontCollection
- ) PURE;
-
- /// <summary>
- /// Registers a custom font collection loader with the factory object.
- /// </summary>
- /// <param name="fontCollectionLoader">Application-defined font collection loader.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(RegisterFontCollectionLoader)(
- IDWriteFontCollectionLoader* fontCollectionLoader
- ) PURE;
-
- /// <summary>
- /// Unregisters a custom font collection loader that was previously registered using RegisterFontCollectionLoader.
- /// </summary>
- /// <param name="fontCollectionLoader">Application-defined font collection loader.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(UnregisterFontCollectionLoader)(
- IDWriteFontCollectionLoader* fontCollectionLoader
- ) PURE;
-
- /// <summary>
- /// CreateFontFileReference creates a font file reference object from a local font file.
- /// </summary>
- /// <param name="filePath">Absolute file path. Subsequent operations on the constructed object may fail
- /// if the user provided filePath doesn't correspond to a valid file on the disk.</param>
- /// <param name="lastWriteTime">Last modified time of the input file path. If the parameter is omitted,
- /// the function will access the font file to obtain its last write time, so the clients are encouraged to specify this value
- /// to avoid extra disk access. Subsequent operations on the constructed object may fail
- /// if the user provided lastWriteTime doesn't match the file on the disk.</param>
- /// <param name="fontFile">Contains newly created font file reference object, or NULL in case of failure.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(CreateFontFileReference)(
- __in_z WCHAR const* filePath,
- __in_opt FILETIME const* lastWriteTime,
- __out IDWriteFontFile** fontFile
- ) PURE;
-
- /// <summary>
- /// CreateCustomFontFileReference creates a reference to an application specific font file resource.
- /// This function enables an application or a document to use a font without having to install it on the system.
- /// The fontFileReferenceKey has to be unique only in the scope of the fontFileLoader used in this call.
- /// </summary>
- /// <param name="fontFileReferenceKey">Font file reference key that uniquely identifies the font file resource
- /// during the lifetime of fontFileLoader.</param>
- /// <param name="fontFileReferenceKeySize">Size of font file reference key in bytes.</param>
- /// <param name="fontFileLoader">Font file loader that will be used by the font system to load data from the file identified by
- /// fontFileReferenceKey.</param>
- /// <param name="fontFile">Contains the newly created font file object, or NULL in case of failure.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- /// <remarks>
- /// This function is provided for cases when an application or a document needs to use a font
- /// without having to install it on the system. fontFileReferenceKey has to be unique only in the scope
- /// of the fontFileLoader used in this call.
- /// </remarks>
- STDMETHOD(CreateCustomFontFileReference)(
- __in_bcount(fontFileReferenceKeySize) void const* fontFileReferenceKey,
- UINT32 fontFileReferenceKeySize,
- IDWriteFontFileLoader* fontFileLoader,
- __out IDWriteFontFile** fontFile
- ) PURE;
-
- /// <summary>
- /// Creates a font face object.
- /// </summary>
- /// <param name="fontFaceType">The file format of the font face.</param>
- /// <param name="numberOfFiles">The number of font files require to represent the font face.</param>
- /// <param name="fontFiles">Font files representing the font face. Since IDWriteFontFace maintains its own references
- /// to the input font file objects, it's OK to release them after this call.</param>
- /// <param name="faceIndex">The zero based index of a font face in cases when the font files contain a collection of font faces.
- /// If the font files contain a single face, this value should be zero.</param>
- /// <param name="fontFaceSimulationFlags">Font face simulation flags for algorithmic emboldening and italicization.</param>
- /// <param name="fontFace">Contains the newly created font face object, or NULL in case of failure.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(CreateFontFace)(
- DWRITE_FONT_FACE_TYPE fontFaceType,
- UINT32 numberOfFiles,
- __in_ecount(numberOfFiles) IDWriteFontFile* const* fontFiles,
- UINT32 faceIndex,
- DWRITE_FONT_SIMULATIONS fontFaceSimulationFlags,
- __out IDWriteFontFace** fontFace
- ) PURE;
-
- /// <summary>
- /// Creates a rendering parameters object with default settings for the primary monitor.
- /// </summary>
- /// <param name="renderingParams">Holds the newly created rendering parameters object, or NULL in case of failure.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(CreateRenderingParams)(
- __out IDWriteRenderingParams** renderingParams
- ) PURE;
-
- /// <summary>
- /// Creates a rendering parameters object with default settings for the specified monitor.
- /// </summary>
- /// <param name="monitor">The monitor to read the default values from.</param>
- /// <param name="renderingParams">Holds the newly created rendering parameters object, or NULL in case of failure.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(CreateMonitorRenderingParams)(
- HMONITOR monitor,
- __out IDWriteRenderingParams** renderingParams
- ) PURE;
-
- /// <summary>
- /// Creates a rendering parameters object with the specified properties.
- /// </summary>
- /// <param name="gamma">The gamma value used for gamma correction, which must be greater than zero and cannot exceed 256.</param>
- /// <param name="enhancedContrast">The amount of contrast enhancement, zero or greater.</param>
- /// <param name="clearTypeLevel">The degree of ClearType level, from 0.0f (no ClearType) to 1.0f (full ClearType).</param>
- /// <param name="pixelGeometry">The geometry of a device pixel.</param>
- /// <param name="renderingMode">Method of rendering glyphs. In most cases, this should be DWRITE_RENDERING_MODE_DEFAULT to automatically use an appropriate mode.</param>
- /// <param name="renderingParams">Holds the newly created rendering parameters object, or NULL in case of failure.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(CreateCustomRenderingParams)(
- FLOAT gamma,
- FLOAT enhancedContrast,
- FLOAT clearTypeLevel,
- DWRITE_PIXEL_GEOMETRY pixelGeometry,
- DWRITE_RENDERING_MODE renderingMode,
- __out IDWriteRenderingParams** renderingParams
- ) PURE;
-
- /// <summary>
- /// Registers a font file loader with DirectWrite.
- /// </summary>
- /// <param name="fontFileLoader">Pointer to the implementation of the IDWriteFontFileLoader for a particular file resource type.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- /// <remarks>
- /// This function registers a font file loader with DirectWrite.
- /// Font file loader interface handles loading font file resources of a particular type from a key.
- /// The font file loader interface is recommended to be implemented by a singleton object.
- /// A given instance can only be registered once.
- /// Succeeding attempts will return an error that it has already been registered.
- /// IMPORTANT: font file loader implementations must not register themselves with DirectWrite
- /// inside their constructors and must not unregister themselves in their destructors, because
- /// registration and unregistraton operations increment and decrement the object reference count respectively.
- /// Instead, registration and unregistration of font file loaders with DirectWrite should be performed
- /// outside of the font file loader implementation as a separate step.
- /// </remarks>
- STDMETHOD(RegisterFontFileLoader)(
- IDWriteFontFileLoader* fontFileLoader
- ) PURE;
-
- /// <summary>
- /// Unregisters a font file loader that was previously registered with the DirectWrite font system using RegisterFontFileLoader.
- /// </summary>
- /// <param name="fontFileLoader">Pointer to the file loader that was previously registered with the DirectWrite font system using RegisterFontFileLoader.</param>
- /// <returns>
- /// This function will succeed if the user loader is requested to be removed.
- /// It will fail if the pointer to the file loader identifies a standard DirectWrite loader,
- /// or a loader that is never registered or has already been unregistered.
- /// </returns>
- /// <remarks>
- /// This function unregisters font file loader callbacks with the DirectWrite font system.
- /// The font file loader interface is recommended to be implemented by a singleton object.
- /// IMPORTANT: font file loader implementations must not register themselves with DirectWrite
- /// inside their constructors and must not unregister themselves in their destructors, because
- /// registration and unregistraton operations increment and decrement the object reference count respectively.
- /// Instead, registration and unregistration of font file loaders with DirectWrite should be performed
- /// outside of the font file loader implementation as a separate step.
- /// </remarks>
- STDMETHOD(UnregisterFontFileLoader)(
- IDWriteFontFileLoader* fontFileLoader
- ) PURE;
-
- /// <summary>
- /// Create a text format object used for text layout.
- /// </summary>
- /// <param name="fontFamilyName">Name of the font family</param>
- /// <param name="fontCollection">Font collection. NULL indicates the system font collection.</param>
- /// <param name="fontWeight">Font weight</param>
- /// <param name="fontStyle">Font style</param>
- /// <param name="fontStretch">Font stretch</param>
- /// <param name="fontSize">Logical size of the font in DIP units. A DIP ("device-independent pixel") equals 1/96 inch.</param>
- /// <param name="localeName">Locale name</param>
- /// <param name="textFormat">Contains newly created text format object, or NULL in case of failure.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(CreateTextFormat)(
- __in_z WCHAR const* fontFamilyName,
- __maybenull IDWriteFontCollection* fontCollection,
- DWRITE_FONT_WEIGHT fontWeight,
- DWRITE_FONT_STYLE fontStyle,
- DWRITE_FONT_STRETCH fontStretch,
- FLOAT fontSize,
- __in_z WCHAR const* localeName,
- __out IDWriteTextFormat** textFormat
- ) PURE;
-
- /// <summary>
- /// Create a typography object used in conjunction with text format for text layout.
- /// </summary>
- /// <param name="typography">Contains newly created typography object, or NULL in case of failure.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(CreateTypography)(
- __out IDWriteTypography** typography
- ) PURE;
-
- /// <summary>
- /// Create an object used for interoperability with GDI.
- /// </summary>
- /// <param name="gdiInterop">Receives the GDI interop object if successful, or NULL in case of failure.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(GetGdiInterop)(
- __out IDWriteGdiInterop** gdiInterop
- ) PURE;
-
- /// <summary>
- /// CreateTextLayout takes a string, format, and associated constraints
- /// and produces and object representing the fully analyzed
- /// and formatted result.
- /// </summary>
- /// <param name="string">The string to layout.</param>
- /// <param name="stringLength">The length of the string.</param>
- /// <param name="textFormat">The format to apply to the string.</param>
- /// <param name="maxWidth">Width of the layout box.</param>
- /// <param name="maxHeight">Height of the layout box.</param>
- /// <param name="textLayout">The resultant object.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(CreateTextLayout)(
- __in_ecount(stringLength) WCHAR const* string,
- UINT32 stringLength,
- IDWriteTextFormat* textFormat,
- FLOAT maxWidth,
- FLOAT maxHeight,
- __out IDWriteTextLayout** textLayout
- ) PURE;
-
- /// <summary>
- /// CreateGdiCompatibleTextLayout takes a string, format, and associated constraints
- /// and produces and object representing the result formatted for a particular display resolution
- /// and measuring method. The resulting text layout should only be used for the intended resolution,
- /// and for cases where text scalability is desired, CreateTextLayout should be used instead.
- /// </summary>
- /// <param name="string">The string to layout.</param>
- /// <param name="stringLength">The length of the string.</param>
- /// <param name="textFormat">The format to apply to the string.</param>
- /// <param name="layoutWidth">Width of the layout box.</param>
- /// <param name="layoutHeight">Height of the layout box.</param>
- /// <param name="pixelsPerDip">Number of physical pixels per DIP. For example, if rendering onto a 96 DPI device then pixelsPerDip
- /// is 1. If rendering onto a 120 DPI device then pixelsPerDip is 120/96.</param>
- /// <param name="transform">Optional transform applied to the glyphs and their positions. This transform is applied after the
- /// scaling specified the font size and pixelsPerDip.</param>
- /// <param name="useGdiNatural">
- /// When set to FALSE, instructs the text layout to use the same metrics as GDI aliased text.
- /// When set to TRUE, instructs the text layout to use the same metrics as text measured by GDI using a font
- /// created with CLEARTYPE_NATURAL_QUALITY.
- /// </param>
- /// <param name="textLayout">The resultant object.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(CreateGdiCompatibleTextLayout)(
- __in_ecount(stringLength) WCHAR const* string,
- UINT32 stringLength,
- IDWriteTextFormat* textFormat,
- FLOAT layoutWidth,
- FLOAT layoutHeight,
- FLOAT pixelsPerDip,
- __in_opt DWRITE_MATRIX const* transform,
- BOOL useGdiNatural,
- __out IDWriteTextLayout** textLayout
- ) PURE;
-
- /// <summary>
- /// The application may call this function to create an inline object for trimming, using an ellipsis as the omission sign.
- /// The ellipsis will be created using the current settings of the format, including base font, style, and any effects.
- /// Alternate omission signs can be created by the application by implementing IDWriteInlineObject.
- /// </summary>
- /// <param name="textFormat">Text format used as a template for the omission sign.</param>
- /// <param name="trimmingSign">Created omission sign.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(CreateEllipsisTrimmingSign)(
- IDWriteTextFormat* textFormat,
- __out IDWriteInlineObject** trimmingSign
- ) PURE;
-
- /// <summary>
- /// Return an interface to perform text analysis with.
- /// </summary>
- /// <param name="textAnalyzer">The resultant object.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(CreateTextAnalyzer)(
- __out IDWriteTextAnalyzer** textAnalyzer
- ) PURE;
-
- /// <summary>
- /// Creates a number substitution object using a locale name,
- /// substitution method, and whether to ignore user overrides (uses NLS
- /// defaults for the given culture instead).
- /// </summary>
- /// <param name="substitutionMethod">Method of number substitution to use.</param>
- /// <param name="localeName">Which locale to obtain the digits from.</param>
- /// <param name="ignoreUserOverride">Ignore the user's settings and use the locale defaults</param>
- /// <param name="numberSubstitution">Receives a pointer to the newly created object.</param>
- STDMETHOD(CreateNumberSubstitution)(
- __in DWRITE_NUMBER_SUBSTITUTION_METHOD substitutionMethod,
- __in_z WCHAR const* localeName,
- __in BOOL ignoreUserOverride,
- __out IDWriteNumberSubstitution** numberSubstitution
- ) PURE;
-
- /// <summary>
- /// Creates a glyph run analysis object, which encapsulates information
- /// used to render a glyph run.
- /// </summary>
- /// <param name="glyphRun">Structure specifying the properties of the glyph run.</param>
- /// <param name="pixelsPerDip">Number of physical pixels per DIP. For example, if rendering onto a 96 DPI bitmap then pixelsPerDip
- /// is 1. If rendering onto a 120 DPI bitmap then pixelsPerDip is 120/96.</param>
- /// <param name="transform">Optional transform applied to the glyphs and their positions. This transform is applied after the
- /// scaling specified the emSize and pixelsPerDip.</param>
- /// <param name="renderingMode">Specifies the rendering mode, which must be one of the raster rendering modes (i.e., not default
- /// and not outline).</param>
- /// <param name="measuringMode">Specifies the method to measure glyphs.</param>
- /// <param name="baselineOriginX">Horizontal position of the baseline origin, in DIPs.</param>
- /// <param name="baselineOriginY">Vertical position of the baseline origin, in DIPs.</param>
- /// <param name="glyphRunAnalysis">Receives a pointer to the newly created object.</param>
- /// <returns>
- /// Standard HRESULT error code.
- /// </returns>
- STDMETHOD(CreateGlyphRunAnalysis)(
- __in DWRITE_GLYPH_RUN const* glyphRun,
- FLOAT pixelsPerDip,
- __in_opt DWRITE_MATRIX const* transform,
- DWRITE_RENDERING_MODE renderingMode,
- DWRITE_MEASURING_MODE measuringMode,
- FLOAT baselineOriginX,
- FLOAT baselineOriginY,
- __out IDWriteGlyphRunAnalysis** glyphRunAnalysis
- ) PURE;
-
-}; // interface IDWriteFactory
-
-/// <summary>
-/// Creates a DirectWrite factory object that is used for subsequent creation of individual DirectWrite objects.
-/// </summary>
-/// <param name="factoryType">Identifies whether the factory object will be shared or isolated.</param>
-/// <param name="iid">Identifies the DirectWrite factory interface, such as __uuidof(IDWriteFactory).</param>
-/// <param name="factory">Receives the DirectWrite factory object.</param>
-/// <returns>
-/// Standard HRESULT error code.
-/// </returns>
-/// <remarks>
-/// Obtains DirectWrite factory object that is used for subsequent creation of individual DirectWrite classes.
-/// DirectWrite factory contains internal state such as font loader registration and cached font data.
-/// In most cases it is recommended to use the shared factory object, because it allows multiple components
-/// that use DirectWrite to share internal DirectWrite state and reduce memory usage.
-/// However, there are cases when it is desirable to reduce the impact of a component,
-/// such as a plug-in from an untrusted source, on the rest of the process by sandboxing and isolating it
-/// from the rest of the process components. In such cases, it is recommended to use an isolated factory for the sandboxed
-/// component.
-/// </remarks>
-EXTERN_C HRESULT DWRITE_EXPORT DWriteCreateFactory(
- __in DWRITE_FACTORY_TYPE factoryType,
- __in REFIID iid,
- __out IUnknown **factory
- );
-
-// Macros used to define DirectWrite error codes.
-#define FACILITY_DWRITE 0x898
-#define DWRITE_ERR_BASE 0x5000
-#define MAKE_DWRITE_HR(severity, code) MAKE_HRESULT(severity, FACILITY_DWRITE, (DWRITE_ERR_BASE + code))
-#define MAKE_DWRITE_HR_ERR(code) MAKE_DWRITE_HR(SEVERITY_ERROR, code)
-
-/// <summary>
-/// Indicates an error in an input file such as a font file.
-/// </summary>
-#define DWRITE_E_FILEFORMAT MAKE_DWRITE_HR_ERR(0x000)
-
-/// <summary>
-/// Indicates an error originating in DirectWrite code, which is not expected to occur but is safe to recover from.
-/// </summary>
-#define DWRITE_E_UNEXPECTED MAKE_DWRITE_HR_ERR(0x001)
-
-/// <summary>
-/// Indicates the specified font does not exist.
-/// </summary>
-#define DWRITE_E_NOFONT MAKE_DWRITE_HR_ERR(0x002)
-
-/// <summary>
-/// A font file could not be opened because the file, directory, network location, drive, or other storage
-/// location does not exist or is unavailable.
-/// </summary>
-#define DWRITE_E_FILENOTFOUND MAKE_DWRITE_HR_ERR(0x003)
-
-/// <summary>
-/// A font file exists but could not be opened due to access denied, sharing violation, or similar error.
-/// </summary>
-#define DWRITE_E_FILEACCESS MAKE_DWRITE_HR_ERR(0x004)
-
-/// <summary>
-/// A font collection is obsolete due to changes in the system.
-/// </summary>
-#define DWRITE_E_FONTCOLLECTIONOBSOLETE MAKE_DWRITE_HR_ERR(0x005)
-
-/// <summary>
-/// The given interface is already registered.
-/// </summary>
-#define DWRITE_E_ALREADYREGISTERED MAKE_DWRITE_HR_ERR(0x006)
-
-#endif /* DWRITE_H_INCLUDED */
+//+--------------------------------------------------------------------------
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+//
+// Abstract:
+// DirectX Typography Services public API definitions.
+//
+//----------------------------------------------------------------------------
+
+#ifndef DWRITE_H_INCLUDED
+#define DWRITE_H_INCLUDED
+
+#if _MSC_VER > 1000
+#pragma once
+#endif
+
+#ifndef DWRITE_NO_WINDOWS_H
+
+#include "specstrings.h"
+#include "unknwn.h"
+
+#endif // DWRITE_NO_WINDOWS_H
+
+#include "dcommon.h"
+
+#if _FX_COMPILER_ == _FX_VC6_
+typedef signed char INT8, *PINT8;
+typedef signed short INT16, *PINT16;
+typedef signed int INT32, *PINT32;
+typedef signed __int64 INT64, *PINT64;
+typedef unsigned char UINT8, *PUINT8;
+typedef unsigned short UINT16, *PUINT16;
+typedef unsigned int UINT32, *PUINT32;
+typedef unsigned __int64 UINT64, *PUINT64;
+#endif
+
+#ifndef DWRITE_DECLARE_INTERFACE
+#define DWRITE_DECLARE_INTERFACE(iid) DECLSPEC_UUID(iid) DECLSPEC_NOVTABLE
+#endif
+
+#ifndef DWRITE_EXPORT
+#define DWRITE_EXPORT __declspec(dllimport) WINAPI
+#endif
+
+/// <summary>
+/// The type of a font represented by a single font file.
+/// Font formats that consist of multiple files, e.g. Type 1 .PFM and .PFB, have
+/// separate enum values for each of the file type.
+/// </summary>
+enum DWRITE_FONT_FILE_TYPE
+{
+ /// <summary>
+ /// Font type is not recognized by the DirectWrite font system.
+ /// </summary>
+ DWRITE_FONT_FILE_TYPE_UNKNOWN,
+
+ /// <summary>
+ /// OpenType font with CFF outlines.
+ /// </summary>
+ DWRITE_FONT_FILE_TYPE_CFF,
+
+ /// <summary>
+ /// OpenType font with TrueType outlines.
+ /// </summary>
+ DWRITE_FONT_FILE_TYPE_TRUETYPE,
+
+ /// <summary>
+ /// OpenType font that contains a TrueType collection.
+ /// </summary>
+ DWRITE_FONT_FILE_TYPE_TRUETYPE_COLLECTION,
+
+ /// <summary>
+ /// Type 1 PFM font.
+ /// </summary>
+ DWRITE_FONT_FILE_TYPE_TYPE1_PFM,
+
+ /// <summary>
+ /// Type 1 PFB font.
+ /// </summary>
+ DWRITE_FONT_FILE_TYPE_TYPE1_PFB,
+
+ /// <summary>
+ /// Vector .FON font.
+ /// </summary>
+ DWRITE_FONT_FILE_TYPE_VECTOR,
+
+ /// <summary>
+ /// Bitmap .FON font.
+ /// </summary>
+ DWRITE_FONT_FILE_TYPE_BITMAP
+};
+
+/// <summary>
+/// The file format of a complete font face.
+/// Font formats that consist of multiple files, e.g. Type 1 .PFM and .PFB, have
+/// a single enum entry.
+/// </summary>
+enum DWRITE_FONT_FACE_TYPE
+{
+ /// <summary>
+ /// OpenType font face with CFF outlines.
+ /// </summary>
+ DWRITE_FONT_FACE_TYPE_CFF,
+
+ /// <summary>
+ /// OpenType font face with TrueType outlines.
+ /// </summary>
+ DWRITE_FONT_FACE_TYPE_TRUETYPE,
+
+ /// <summary>
+ /// OpenType font face that is a part of a TrueType collection.
+ /// </summary>
+ DWRITE_FONT_FACE_TYPE_TRUETYPE_COLLECTION,
+
+ /// <summary>
+ /// A Type 1 font face.
+ /// </summary>
+ DWRITE_FONT_FACE_TYPE_TYPE1,
+
+ /// <summary>
+ /// A vector .FON format font face.
+ /// </summary>
+ DWRITE_FONT_FACE_TYPE_VECTOR,
+
+ /// <summary>
+ /// A bitmap .FON format font face.
+ /// </summary>
+ DWRITE_FONT_FACE_TYPE_BITMAP,
+
+ /// <summary>
+ /// Font face type is not recognized by the DirectWrite font system.
+ /// </summary>
+ DWRITE_FONT_FACE_TYPE_UNKNOWN
+};
+
+/// <summary>
+/// Specifies algorithmic style simulations to be applied to the font face.
+/// Bold and oblique simulations can be combined via bitwise OR operation.
+/// </summary>
+enum DWRITE_FONT_SIMULATIONS
+{
+ /// <summary>
+ /// No simulations are performed.
+ /// </summary>
+ DWRITE_FONT_SIMULATIONS_NONE = 0x0000,
+
+ /// <summary>
+ /// Algorithmic emboldening is performed.
+ /// </summary>
+ DWRITE_FONT_SIMULATIONS_BOLD = 0x0001,
+
+ /// <summary>
+ /// Algorithmic italicization is performed.
+ /// </summary>
+ DWRITE_FONT_SIMULATIONS_OBLIQUE = 0x0002
+};
+
+#ifdef DEFINE_ENUM_FLAG_OPERATORS
+DEFINE_ENUM_FLAG_OPERATORS(DWRITE_FONT_SIMULATIONS);
+#endif
+
+/// <summary>
+/// The font weight enumeration describes common values for degree of blackness or thickness of strokes of characters in a font.
+/// Font weight values less than 1 or greater than 999 are considered to be invalid, and they are rejected by font API functions.
+/// </summary>
+enum DWRITE_FONT_WEIGHT
+{
+ /// <summary>
+ /// Predefined font weight : Thin (100).
+ /// </summary>
+ DWRITE_FONT_WEIGHT_THIN = 100,
+
+ /// <summary>
+ /// Predefined font weight : Extra-light (200).
+ /// </summary>
+ DWRITE_FONT_WEIGHT_EXTRA_LIGHT = 200,
+
+ /// <summary>
+ /// Predefined font weight : Ultra-light (200).
+ /// </summary>
+ DWRITE_FONT_WEIGHT_ULTRA_LIGHT = 200,
+
+ /// <summary>
+ /// Predefined font weight : Light (300).
+ /// </summary>
+ DWRITE_FONT_WEIGHT_LIGHT = 300,
+
+ /// <summary>
+ /// Predefined font weight : Normal (400).
+ /// </summary>
+ DWRITE_FONT_WEIGHT_NORMAL = 400,
+
+ /// <summary>
+ /// Predefined font weight : Regular (400).
+ /// </summary>
+ DWRITE_FONT_WEIGHT_REGULAR = 400,
+
+ /// <summary>
+ /// Predefined font weight : Medium (500).
+ /// </summary>
+ DWRITE_FONT_WEIGHT_MEDIUM = 500,
+
+ /// <summary>
+ /// Predefined font weight : Demi-bold (600).
+ /// </summary>
+ DWRITE_FONT_WEIGHT_DEMI_BOLD = 600,
+
+ /// <summary>
+ /// Predefined font weight : Semi-bold (600).
+ /// </summary>
+ DWRITE_FONT_WEIGHT_SEMI_BOLD = 600,
+
+ /// <summary>
+ /// Predefined font weight : Bold (700).
+ /// </summary>
+ DWRITE_FONT_WEIGHT_BOLD = 700,
+
+ /// <summary>
+ /// Predefined font weight : Extra-bold (800).
+ /// </summary>
+ DWRITE_FONT_WEIGHT_EXTRA_BOLD = 800,
+
+ /// <summary>
+ /// Predefined font weight : Ultra-bold (800).
+ /// </summary>
+ DWRITE_FONT_WEIGHT_ULTRA_BOLD = 800,
+
+ /// <summary>
+ /// Predefined font weight : Black (900).
+ /// </summary>
+ DWRITE_FONT_WEIGHT_BLACK = 900,
+
+ /// <summary>
+ /// Predefined font weight : Heavy (900).
+ /// </summary>
+ DWRITE_FONT_WEIGHT_HEAVY = 900,
+
+ /// <summary>
+ /// Predefined font weight : Extra-black (950).
+ /// </summary>
+ DWRITE_FONT_WEIGHT_EXTRA_BLACK = 950,
+
+ /// <summary>
+ /// Predefined font weight : Ultra-black (950).
+ /// </summary>
+ DWRITE_FONT_WEIGHT_ULTRA_BLACK = 950
+};
+
+/// <summary>
+/// The font stretch enumeration describes relative change from the normal aspect ratio
+/// as specified by a font designer for the glyphs in a font.
+/// Values less than 1 or greater than 9 are considered to be invalid, and they are rejected by font API functions.
+/// </summary>
+enum DWRITE_FONT_STRETCH
+{
+ /// <summary>
+ /// Predefined font stretch : Not known (0).
+ /// </summary>
+ DWRITE_FONT_STRETCH_UNDEFINED = 0,
+
+ /// <summary>
+ /// Predefined font stretch : Ultra-condensed (1).
+ /// </summary>
+ DWRITE_FONT_STRETCH_ULTRA_CONDENSED = 1,
+
+ /// <summary>
+ /// Predefined font stretch : Extra-condensed (2).
+ /// </summary>
+ DWRITE_FONT_STRETCH_EXTRA_CONDENSED = 2,
+
+ /// <summary>
+ /// Predefined font stretch : Condensed (3).
+ /// </summary>
+ DWRITE_FONT_STRETCH_CONDENSED = 3,
+
+ /// <summary>
+ /// Predefined font stretch : Semi-condensed (4).
+ /// </summary>
+ DWRITE_FONT_STRETCH_SEMI_CONDENSED = 4,
+
+ /// <summary>
+ /// Predefined font stretch : Normal (5).
+ /// </summary>
+ DWRITE_FONT_STRETCH_NORMAL = 5,
+
+ /// <summary>
+ /// Predefined font stretch : Medium (5).
+ /// </summary>
+ DWRITE_FONT_STRETCH_MEDIUM = 5,
+
+ /// <summary>
+ /// Predefined font stretch : Semi-expanded (6).
+ /// </summary>
+ DWRITE_FONT_STRETCH_SEMI_EXPANDED = 6,
+
+ /// <summary>
+ /// Predefined font stretch : Expanded (7).
+ /// </summary>
+ DWRITE_FONT_STRETCH_EXPANDED = 7,
+
+ /// <summary>
+ /// Predefined font stretch : Extra-expanded (8).
+ /// </summary>
+ DWRITE_FONT_STRETCH_EXTRA_EXPANDED = 8,
+
+ /// <summary>
+ /// Predefined font stretch : Ultra-expanded (9).
+ /// </summary>
+ DWRITE_FONT_STRETCH_ULTRA_EXPANDED = 9
+};
+
+/// <summary>
+/// The font style enumeration describes the slope style of a font face, such as Normal, Italic or Oblique.
+/// Values other than the ones defined in the enumeration are considered to be invalid, and they are rejected by font API functions.
+/// </summary>
+enum DWRITE_FONT_STYLE
+{
+ /// <summary>
+ /// Font slope style : Normal.
+ /// </summary>
+ DWRITE_FONT_STYLE_NORMAL,
+
+ /// <summary>
+ /// Font slope style : Oblique.
+ /// </summary>
+ DWRITE_FONT_STYLE_OBLIQUE,
+
+ /// <summary>
+ /// Font slope style : Italic.
+ /// </summary>
+ DWRITE_FONT_STYLE_ITALIC
+
+};
+
+/// <summary>
+/// The informational string enumeration identifies a string in a font.
+/// </summary>
+enum DWRITE_INFORMATIONAL_STRING_ID
+{
+ /// <summary>
+ /// Unspecified name ID.
+ /// </summary>
+ DWRITE_INFORMATIONAL_STRING_NONE,
+
+ /// <summary>
+ /// Copyright notice provided by the font.
+ /// </summary>
+ DWRITE_INFORMATIONAL_STRING_COPYRIGHT_NOTICE,
+
+ /// <summary>
+ /// String containing a version number.
+ /// </summary>
+ DWRITE_INFORMATIONAL_STRING_VERSION_STRINGS,
+
+ /// <summary>
+ /// Trademark information provided by the font.
+ /// </summary>
+ DWRITE_INFORMATIONAL_STRING_TRADEMARK,
+
+ /// <summary>
+ /// Name of the font manufacturer.
+ /// </summary>
+ DWRITE_INFORMATIONAL_STRING_MANUFACTURER,
+
+ /// <summary>
+ /// Name of the font designer.
+ /// </summary>
+ DWRITE_INFORMATIONAL_STRING_DESIGNER,
+
+ /// <summary>
+ /// URL of font designer (with protocol, e.g., http://, ftp://).
+ /// </summary>
+ DWRITE_INFORMATIONAL_STRING_DESIGNER_URL,
+
+ /// <summary>
+ /// Description of the font. Can contain revision information, usage recommendations, history, features, etc.
+ /// </summary>
+ DWRITE_INFORMATIONAL_STRING_DESCRIPTION,
+
+ /// <summary>
+ /// URL of font vendor (with protocol, e.g., http://, ftp://). If a unique serial number is embedded in the URL, it can be used to register the font.
+ /// </summary>
+ DWRITE_INFORMATIONAL_STRING_FONT_VENDOR_URL,
+
+ /// <summary>
+ /// Description of how the font may be legally used, or different example scenarios for licensed use. This field should be written in plain language, not legalese.
+ /// </summary>
+ DWRITE_INFORMATIONAL_STRING_LICENSE_DESCRIPTION,
+
+ /// <summary>
+ /// URL where additional licensing information can be found.
+ /// </summary>
+ DWRITE_INFORMATIONAL_STRING_LICENSE_INFO_URL,
+
+ /// <summary>
+ /// GDI-compatible family name. Because GDI allows a maximum of four fonts per family, fonts in the same family may have different GDI-compatible family names
+ /// (e.g., "Arial", "Arial Narrow", "Arial Black").
+ /// </summary>
+ DWRITE_INFORMATIONAL_STRING_WIN32_FAMILY_NAMES,
+
+ /// <summary>
+ /// GDI-compatible subfamily name.
+ /// </summary>
+ DWRITE_INFORMATIONAL_STRING_WIN32_SUBFAMILY_NAMES,
+
+ /// <summary>
+ /// Family name preferred by the designer. This enables font designers to group more than four fonts in a single family without losing compatibility with
+ /// GDI. This name is typically only present if it differs from the GDI-compatible family name.
+ /// </summary>
+ DWRITE_INFORMATIONAL_STRING_PREFERRED_FAMILY_NAMES,
+
+ /// <summary>
+ /// Subfamily name preferred by the designer. This name is typically only present if it differs from the GDI-compatible subfamily name.
+ /// </summary>
+ DWRITE_INFORMATIONAL_STRING_PREFERRED_SUBFAMILY_NAMES,
+
+ /// <summary>
+ /// Sample text. This can be the font name or any other text that the designer thinks is the best example to display the font in.
+ /// </summary>
+ DWRITE_INFORMATIONAL_STRING_SAMPLE_TEXT
+};
+
+
+/// <summary>
+/// The DWRITE_FONT_METRICS structure specifies the metrics of a font face that
+/// are applicable to all glyphs within the font face.
+/// </summary>
+struct DWRITE_FONT_METRICS
+{
+ /// <summary>
+ /// The number of font design units per em unit.
+ /// Font files use their own coordinate system of font design units.
+ /// A font design unit is the smallest measurable unit in the em square,
+ /// an imaginary square that is used to size and align glyphs.
+ /// The concept of em square is used as a reference scale factor when defining font size and device transformation semantics.
+ /// The size of one em square is also commonly used to compute the paragraph identation value.
+ /// </summary>
+ UINT16 designUnitsPerEm;
+
+ /// <summary>
+ /// Ascent value of the font face in font design units.
+ /// Ascent is the distance from the top of font character alignment box to English baseline.
+ /// </summary>
+ UINT16 ascent;
+
+ /// <summary>
+ /// Descent value of the font face in font design units.
+ /// Descent is the distance from the bottom of font character alignment box to English baseline.
+ /// </summary>
+ UINT16 descent;
+
+ /// <summary>
+ /// Line gap in font design units.
+ /// Recommended additional white space to add between lines to improve legibility. The recommended line spacing
+ /// (baseline-to-baseline distance) is thus the sum of ascent, descent, and lineGap. The line gap is usually
+ /// positive or zero but can be negative, in which case the recommended line spacing is less than the height
+ /// of the character alignment box.
+ /// </summary>
+ INT16 lineGap;
+
+ /// <summary>
+ /// Cap height value of the font face in font design units.
+ /// Cap height is the distance from English baseline to the top of a typical English capital.
+ /// Capital "H" is often used as a reference character for the purpose of calculating the cap height value.
+ /// </summary>
+ UINT16 capHeight;
+
+ /// <summary>
+ /// x-height value of the font face in font design units.
+ /// x-height is the distance from English baseline to the top of lowercase letter "x", or a similar lowercase character.
+ /// </summary>
+ UINT16 xHeight;
+
+ /// <summary>
+ /// The underline position value of the font face in font design units.
+ /// Underline position is the position of underline relative to the English baseline.
+ /// The value is usually made negative in order to place the underline below the baseline.
+ /// </summary>
+ INT16 underlinePosition;
+
+ /// <summary>
+ /// The suggested underline thickness value of the font face in font design units.
+ /// </summary>
+ UINT16 underlineThickness;
+
+ /// <summary>
+ /// The strikethrough position value of the font face in font design units.
+ /// Strikethrough position is the position of strikethrough relative to the English baseline.
+ /// The value is usually made positive in order to place the strikethrough above the baseline.
+ /// </summary>
+ INT16 strikethroughPosition;
+
+ /// <summary>
+ /// The suggested strikethrough thickness value of the font face in font design units.
+ /// </summary>
+ UINT16 strikethroughThickness;
+};
+
+/// <summary>
+/// The DWRITE_GLYPH_METRICS structure specifies the metrics of an individual glyph.
+/// The units depend on how the metrics are obtained.
+/// </summary>
+struct DWRITE_GLYPH_METRICS
+{
+ /// <summary>
+ /// Specifies the X offset from the glyph origin to the left edge of the black box.
+ /// The glyph origin is the current horizontal writing position.
+ /// A negative value means the black box extends to the left of the origin (often true for lowercase italic 'f').
+ /// </summary>
+ INT32 leftSideBearing;
+
+ /// <summary>
+ /// Specifies the X offset from the origin of the current glyph to the origin of the next glyph when writing horizontally.
+ /// </summary>
+ UINT32 advanceWidth;
+
+ /// <summary>
+ /// Specifies the X offset from the right edge of the black box to the origin of the next glyph when writing horizontally.
+ /// The value is negative when the right edge of the black box overhangs the layout box.
+ /// </summary>
+ INT32 rightSideBearing;
+
+ /// <summary>
+ /// Specifies the vertical offset from the vertical origin to the top of the black box.
+ /// Thus, a positive value adds whitespace whereas a negative value means the glyph overhangs the top of the layout box.
+ /// </summary>
+ INT32 topSideBearing;
+
+ /// <summary>
+ /// Specifies the Y offset from the vertical origin of the current glyph to the vertical origin of the next glyph when writing vertically.
+ /// (Note that the term "origin" by itself denotes the horizontal origin. The vertical origin is different.
+ /// Its Y coordinate is specified by verticalOriginY value,
+ /// and its X coordinate is half the advanceWidth to the right of the horizontal origin).
+ /// </summary>
+ UINT32 advanceHeight;
+
+ /// <summary>
+ /// Specifies the vertical distance from the black box's bottom edge to the advance height.
+ /// Positive when the bottom edge of the black box is within the layout box.
+ /// Negative when the bottom edge of black box overhangs the layout box.
+ /// </summary>
+ INT32 bottomSideBearing;
+
+ /// <summary>
+ /// Specifies the Y coordinate of a glyph's vertical origin, in the font's design coordinate system.
+ /// The y coordinate of a glyph's vertical origin is the sum of the glyph's top side bearing
+ /// and the top (i.e. yMax) of the glyph's bounding box.
+ /// </summary>
+ INT32 verticalOriginY;
+};
+
+/// <summary>
+/// Optional adjustment to a glyph's position. An glyph offset changes the position of a glyph without affecting
+/// the pen position. Offsets are in logical, pre-transform units.
+/// </summary>
+struct DWRITE_GLYPH_OFFSET
+{
+ /// <summary>
+ /// Offset in the advance direction of the run. A positive advance offset moves the glyph to the right
+ /// (in pre-transform coordinates) if the run is left-to-right or to the left if the run is right-to-left.
+ /// </summary>
+ FLOAT advanceOffset;
+
+ /// <summary>
+ /// Offset in the ascent direction, i.e., the direction ascenders point. A positive ascender offset moves
+ /// the glyph up (in pre-transform coordinates).
+ /// </summary>
+ FLOAT ascenderOffset;
+};
+
+/// <summary>
+/// Specifies the type of DirectWrite factory object.
+/// DirectWrite factory contains internal state such as font loader registration and cached font data.
+/// In most cases it is recommended to use the shared factory object, because it allows multiple components
+/// that use DirectWrite to share internal DirectWrite state and reduce memory usage.
+/// However, there are cases when it is desirable to reduce the impact of a component,
+/// such as a plug-in from an untrusted source, on the rest of the process by sandboxing and isolating it
+/// from the rest of the process components. In such cases, it is recommended to use an isolated factory for the sandboxed
+/// component.
+/// </summary>
+enum DWRITE_FACTORY_TYPE
+{
+ /// <summary>
+ /// Shared factory allow for re-use of cached font data across multiple in process components.
+ /// Such factories also take advantage of cross process font caching components for better performance.
+ /// </summary>
+ DWRITE_FACTORY_TYPE_SHARED,
+
+ /// <summary>
+ /// Objects created from the isolated factory do not interact with internal DirectWrite state from other components.
+ /// </summary>
+ DWRITE_FACTORY_TYPE_ISOLATED
+};
+
+// Creates an OpenType tag as a 32bit integer such that
+// the first character in the tag is the lowest byte,
+// (least significant on little endian architectures)
+// which can be used to compare with tags in the font file.
+// This macro is compatible with DWRITE_FONT_FEATURE_TAG.
+//
+// Example: DWRITE_MAKE_OPENTYPE_TAG('c','c','m','p')
+// Dword: 0x706D6363
+//
+#define DWRITE_MAKE_OPENTYPE_TAG(a,b,c,d) ( \
+ (static_cast<UINT32>(static_cast<UINT8>(d)) << 24) | \
+ (static_cast<UINT32>(static_cast<UINT8>(c)) << 16) | \
+ (static_cast<UINT32>(static_cast<UINT8>(b)) << 8) | \
+ static_cast<UINT32>(static_cast<UINT8>(a)))
+
+interface IDWriteFontFileStream;
+
+/// <summary>
+/// Font file loader interface handles loading font file resources of a particular type from a key.
+/// The font file loader interface is recommended to be implemented by a singleton object.
+/// IMPORTANT: font file loader implementations must not register themselves with DirectWrite factory
+/// inside their constructors and must not unregister themselves in their destructors, because
+/// registration and unregistraton operations increment and decrement the object reference count respectively.
+/// Instead, registration and unregistration of font file loaders with DirectWrite factory should be performed
+/// outside of the font file loader implementation as a separate step.
+/// </summary>
+interface DWRITE_DECLARE_INTERFACE("727cad4e-d6af-4c9e-8a08-d695b11caa49") IDWriteFontFileLoader : public IUnknown
+{
+ /// <summary>
+ /// Creates a font file stream object that encapsulates an open file resource.
+ /// The resource is closed when the last reference to fontFileStream is released.
+ /// </summary>
+ /// <param name="fontFileReferenceKey">Font file reference key that uniquely identifies the font file resource
+ /// within the scope of the font loader being used.</param>
+ /// <param name="fontFileReferenceKeySize">Size of font file reference key in bytes.</param>
+ /// <param name="fontFileStream">Pointer to the newly created font file stream.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(CreateStreamFromKey)(
+ __in_bcount(fontFileReferenceKeySize) void const* fontFileReferenceKey,
+ UINT32 fontFileReferenceKeySize,
+ __out IDWriteFontFileStream** fontFileStream
+ ) PURE;
+};
+
+/// <summary>
+/// A built-in implementation of IDWriteFontFileLoader interface that operates on local font files
+/// and exposes local font file information from the font file reference key.
+/// Font file references created using CreateFontFileReference use this font file loader.
+/// </summary>
+interface DWRITE_DECLARE_INTERFACE("b2d9f3ec-c9fe-4a11-a2ec-d86208f7c0a2") IDWriteLocalFontFileLoader : public IDWriteFontFileLoader
+{
+ /// <summary>
+ /// Obtains the length of the absolute file path from the font file reference key.
+ /// </summary>
+ /// <param name="fontFileReferenceKey">Font file reference key that uniquely identifies the local font file
+ /// within the scope of the font loader being used.</param>
+ /// <param name="fontFileReferenceKeySize">Size of font file reference key in bytes.</param>
+ /// <param name="filePathLength">Length of the file path string not including the terminated NULL character.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(GetFilePathLengthFromKey)(
+ __in_bcount(fontFileReferenceKeySize) void const* fontFileReferenceKey,
+ UINT32 fontFileReferenceKeySize,
+ __out UINT32* filePathLength
+ ) PURE;
+
+ /// <summary>
+ /// Obtains the absolute font file path from the font file reference key.
+ /// </summary>
+ /// <param name="fontFileReferenceKey">Font file reference key that uniquely identifies the local font file
+ /// within the scope of the font loader being used.</param>
+ /// <param name="fontFileReferenceKeySize">Size of font file reference key in bytes.</param>
+ /// <param name="filePath">Character array that receives the local file path.</param>
+ /// <param name="filePathSize">Size of the filePath array in character count including the terminated NULL character.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(GetFilePathFromKey)(
+ __in_bcount(fontFileReferenceKeySize) void const* fontFileReferenceKey,
+ UINT32 fontFileReferenceKeySize,
+ __out_ecount_z(filePathSize) WCHAR* filePath,
+ UINT32 filePathSize
+ ) PURE;
+
+ /// <summary>
+ /// Obtains the last write time of the file from the font file reference key.
+ /// </summary>
+ /// <param name="fontFileReferenceKey">Font file reference key that uniquely identifies the local font file
+ /// within the scope of the font loader being used.</param>
+ /// <param name="fontFileReferenceKeySize">Size of font file reference key in bytes.</param>
+ /// <param name="lastWriteTime">Last modified time of the font file.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(GetLastWriteTimeFromKey)(
+ __in_bcount(fontFileReferenceKeySize) void const* fontFileReferenceKey,
+ UINT32 fontFileReferenceKeySize,
+ __out FILETIME* lastWriteTime
+ ) PURE;
+};
+
+/// <summary>
+/// The interface for loading font file data.
+/// </summary>
+interface DWRITE_DECLARE_INTERFACE("6d4865fe-0ab8-4d91-8f62-5dd6be34a3e0") IDWriteFontFileStream : public IUnknown
+{
+ /// <summary>
+ /// Reads a fragment from a file.
+ /// </summary>
+ /// <param name="fragmentStart">Receives the pointer to the start of the font file fragment.</param>
+ /// <param name="fileOffset">Offset of the fragment from the beginning of the font file.</param>
+ /// <param name="fragmentSize">Size of the fragment in bytes.</param>
+ /// <param name="fragmentContext">The client defined context to be passed to the ReleaseFileFragment.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ /// <remarks>
+ /// IMPORTANT: ReadFileFragment() implementations must check whether the requested file fragment
+ /// is within the file bounds. Otherwise, an error should be returned from ReadFileFragment.
+ /// </remarks>
+ STDMETHOD(ReadFileFragment)(
+ __deref_out_bcount(fragmentSize) void const** fragmentStart,
+ UINT64 fileOffset,
+ UINT64 fragmentSize,
+ __out void** fragmentContext
+ ) PURE;
+
+ /// <summary>
+ /// Releases a fragment from a file.
+ /// </summary>
+ /// <param name="fragmentContext">The client defined context of a font fragment returned from ReadFileFragment.</param>
+ STDMETHOD_(void, ReleaseFileFragment)(
+ void* fragmentContext
+ ) PURE;
+
+ /// <summary>
+ /// Obtains the total size of a file.
+ /// </summary>
+ /// <param name="fileSize">Receives the total size of the file.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ /// <remarks>
+ /// Implementing GetFileSize() for asynchronously loaded font files may require
+ /// downloading the complete file contents, therefore this method should only be used for operations that
+ /// either require complete font file to be loaded (e.g., copying a font file) or need to make
+ /// decisions based on the value of the file size (e.g., validation against a persisted file size).
+ /// </remarks>
+ STDMETHOD(GetFileSize)(
+ __out UINT64* fileSize
+ ) PURE;
+
+ /// <summary>
+ /// Obtains the last modified time of the file. The last modified time is used by DirectWrite font selection algorithms
+ /// to determine whether one font resource is more up to date than another one.
+ /// </summary>
+ /// <param name="lastWriteTime">Receives the last modifed time of the file in the format that represents
+ /// the number of 100-nanosecond intervals since January 1, 1601 (UTC).</param>
+ /// <returns>
+ /// Standard HRESULT error code. For resources that don't have a concept of the last modified time, the implementation of
+ /// GetLastWriteTime should return E_NOTIMPL.
+ /// </returns>
+ STDMETHOD(GetLastWriteTime)(
+ __out UINT64* lastWriteTime
+ ) PURE;
+};
+
+/// <summary>
+/// The interface that represents a reference to a font file.
+/// </summary>
+interface DWRITE_DECLARE_INTERFACE("739d886a-cef5-47dc-8769-1a8b41bebbb0") IDWriteFontFile : public IUnknown
+{
+ /// <summary>
+ /// This method obtains the pointer to the reference key of a font file. The pointer is only valid until the object that refers to it is released.
+ /// </summary>
+ /// <param name="fontFileReferenceKey">Pointer to the font file reference key.
+ /// IMPORTANT: The pointer value is valid until the font file reference object it is obtained from is released.</param>
+ /// <param name="fontFileReferenceKeySize">Size of font file reference key in bytes.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(GetReferenceKey)(
+ __deref_out_bcount(*fontFileReferenceKeySize) void const** fontFileReferenceKey,
+ __out UINT32* fontFileReferenceKeySize
+ ) PURE;
+
+ /// <summary>
+ /// Obtains the file loader associated with a font file object.
+ /// </summary>
+ /// <param name="fontFileLoader">The font file loader associated with the font file object.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(GetLoader)(
+ __out IDWriteFontFileLoader** fontFileLoader
+ ) PURE;
+
+ /// <summary>
+ /// Analyzes a file and returns whether it represents a font, and whether the font type is supported by the font system.
+ /// </summary>
+ /// <param name="isSupportedFontType">TRUE if the font type is supported by the font system, FALSE otherwise.</param>
+ /// <param name="fontFileType">The type of the font file. Note that even if isSupportedFontType is FALSE,
+ /// the fontFileType value may be different from DWRITE_FONT_FILE_TYPE_UNKNOWN.</param>
+ /// <param name="fontFaceType">The type of the font face that can be constructed from the font file.
+ /// Note that even if isSupportedFontType is FALSE, the fontFaceType value may be different from
+ /// DWRITE_FONT_FACE_TYPE_UNKNOWN.</param>
+ /// <param name="numberOfFaces">Number of font faces contained in the font file.</param>
+ /// <returns>
+ /// Standard HRESULT error code if there was a processing error during analysis.
+ /// </returns>
+ /// <remarks>
+ /// IMPORTANT: certain font file types are recognized, but not supported by the font system.
+ /// For example, the font system will recognize a file as a Type 1 font file,
+ /// but will not be able to construct a font face object from it. In such situations, Analyze will set
+ /// isSupportedFontType output parameter to FALSE.
+ /// </remarks>
+ STDMETHOD(Analyze)(
+ __out BOOL* isSupportedFontType,
+ __out DWRITE_FONT_FILE_TYPE* fontFileType,
+ __out_opt DWRITE_FONT_FACE_TYPE* fontFaceType,
+ __out UINT32* numberOfFaces
+ ) PURE;
+};
+
+/// <summary>
+/// Represents the internal structure of a device pixel (i.e., the physical arrangement of red,
+/// green, and blue color components) that is assumed for purposes of rendering text.
+/// </summary>
+#ifndef DWRITE_PIXEL_GEOMETRY_DEFINED
+enum DWRITE_PIXEL_GEOMETRY
+{
+ /// <summary>
+ /// The red, green, and blue color components of each pixel are assumed to occupy the same point.
+ /// </summary>
+ DWRITE_PIXEL_GEOMETRY_FLAT,
+
+ /// <summary>
+ /// Each pixel comprises three vertical stripes, with red on the left, green in the center, and
+ /// blue on the right. This is the most common pixel geometry for LCD monitors.
+ /// </summary>
+ DWRITE_PIXEL_GEOMETRY_RGB,
+
+ /// <summary>
+ /// Each pixel comprises three vertical stripes, with blue on the left, green in the center, and
+ /// red on the right.
+ /// </summary>
+ DWRITE_PIXEL_GEOMETRY_BGR
+};
+#define DWRITE_PIXEL_GEOMETRY_DEFINED
+#endif
+
+/// <summary>
+/// Represents a method of rendering glyphs.
+/// </summary>
+enum DWRITE_RENDERING_MODE
+{
+ /// <summary>
+ /// Specifies that the rendering mode is determined automatically based on the font and size.
+ /// </summary>
+ DWRITE_RENDERING_MODE_DEFAULT,
+
+ /// <summary>
+ /// Specifies that no anti-aliasing is performed. Each pixel is either set to the foreground
+ /// color of the text or retains the color of the background.
+ /// </summary>
+ DWRITE_RENDERING_MODE_ALIASED,
+
+ /// <summary>
+ /// Specifies ClearType rendering with the same metrics as aliased text. Glyphs can only
+ /// be positioned on whole-pixel boundaries.
+ /// </summary>
+ DWRITE_RENDERING_MODE_CLEARTYPE_GDI_CLASSIC,
+
+ /// <summary>
+ /// Specifies ClearType rendering with the same metrics as text rendering using GDI using a font
+ /// created with CLEARTYPE_NATURAL_QUALITY. Glyph metrics are closer to their ideal values than
+ /// with aliased text, but glyphs are still positioned on whole-pixel boundaries.
+ /// </summary>
+ DWRITE_RENDERING_MODE_CLEARTYPE_GDI_NATURAL,
+
+ /// <summary>
+ /// Specifies ClearType rendering with anti-aliasing in the horizontal dimension only. This is
+ /// typically used with small to medium font sizes (up to 16 ppem).
+ /// </summary>
+ DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL,
+
+ /// <summary>
+ /// Specifies ClearType rendering with anti-aliasing in both horizontal and vertical dimensions.
+ /// This is typically used at larger sizes to makes curves and diagonal lines look smoother, at
+ /// the expense of some softness.
+ /// </summary>
+ DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL_SYMMETRIC,
+
+ /// <summary>
+ /// Specifies that rendering should bypass the rasterizer and use the outlines directly. This is
+ /// typically used at very large sizes.
+ /// </summary>
+ DWRITE_RENDERING_MODE_OUTLINE
+};
+
+/// <summary>
+/// The DWRITE_MATRIX structure specifies the graphics transform to be applied
+/// to rendered glyphs.
+/// </summary>
+struct DWRITE_MATRIX
+{
+ /// <summary>
+ /// Horizontal scaling / cosine of rotation
+ /// </summary>
+ FLOAT m11;
+
+ /// <summary>
+ /// Vertical shear / sine of rotation
+ /// </summary>
+ FLOAT m12;
+
+ /// <summary>
+ /// Horizontal shear / negative sine of rotation
+ /// </summary>
+ FLOAT m21;
+
+ /// <summary>
+ /// Vertical scaling / cosine of rotation
+ /// </summary>
+ FLOAT m22;
+
+ /// <summary>
+ /// Horizontal shift (always orthogonal regardless of rotation)
+ /// </summary>
+ FLOAT dx;
+
+ /// <summary>
+ /// Vertical shift (always orthogonal regardless of rotation)
+ /// </summary>
+ FLOAT dy;
+};
+
+/// <summary>
+/// The interface that represents text rendering settings for glyph rasterization and filtering.
+/// </summary>
+interface DWRITE_DECLARE_INTERFACE("2f0da53a-2add-47cd-82ee-d9ec34688e75") IDWriteRenderingParams : public IUnknown
+{
+ /// <summary>
+ /// Gets the gamma value used for gamma correction. Valid values must be
+ /// greater than zero and cannot exceed 256.
+ /// </summary>
+ STDMETHOD_(FLOAT, GetGamma)() PURE;
+
+ /// <summary>
+ /// Gets the amount of contrast enhancement. Valid values are greater than
+ /// or equal to zero.
+ /// </summary>
+ STDMETHOD_(FLOAT, GetEnhancedContrast)() PURE;
+
+ /// <summary>
+ /// Gets the ClearType level. Valid values range from 0.0f (no ClearType)
+ /// to 1.0f (full ClearType).
+ /// </summary>
+ STDMETHOD_(FLOAT, GetClearTypeLevel)() PURE;
+
+ /// <summary>
+ /// Gets the pixel geometry.
+ /// </summary>
+ STDMETHOD_(DWRITE_PIXEL_GEOMETRY, GetPixelGeometry)() PURE;
+
+ /// <summary>
+ /// Gets the rendering mode.
+ /// </summary>
+ STDMETHOD_(DWRITE_RENDERING_MODE, GetRenderingMode)() PURE;
+};
+
+// Forward declarations of D2D types
+interface ID2D1SimplifiedGeometrySink;
+
+typedef ID2D1SimplifiedGeometrySink IDWriteGeometrySink;
+
+/// <summary>
+/// The interface that represents an absolute reference to a font face.
+/// It contains font face type, appropriate file references and face identification data.
+/// Various font data such as metrics, names and glyph outlines is obtained from IDWriteFontFace.
+/// </summary>
+interface DWRITE_DECLARE_INTERFACE("5f49804d-7024-4d43-bfa9-d25984f53849") IDWriteFontFace : public IUnknown
+{
+ /// <summary>
+ /// Obtains the file format type of a font face.
+ /// </summary>
+ STDMETHOD_(DWRITE_FONT_FACE_TYPE, GetType)() PURE;
+
+ /// <summary>
+ /// Obtains the font files representing a font face.
+ /// </summary>
+ /// <param name="numberOfFiles">The number of files representing the font face.</param>
+ /// <param name="fontFiles">User provided array that stores pointers to font files representing the font face.
+ /// This parameter can be NULL if the user is only interested in the number of files representing the font face.
+ /// This API increments reference count of the font file pointers returned according to COM conventions, and the client
+ /// should release them when finished.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(GetFiles)(
+ __inout UINT32* numberOfFiles,
+ __out_ecount_opt(*numberOfFiles) IDWriteFontFile** fontFiles
+ ) PURE;
+
+ /// <summary>
+ /// Obtains the zero-based index of the font face in its font file or files. If the font files contain a single face,
+ /// the return value is zero.
+ /// </summary>
+ STDMETHOD_(UINT32, GetIndex)() PURE;
+
+ /// <summary>
+ /// Obtains the algorithmic style simulation flags of a font face.
+ /// </summary>
+ STDMETHOD_(DWRITE_FONT_SIMULATIONS, GetSimulations)() PURE;
+
+ /// <summary>
+ /// Determines whether the font is a symbol font.
+ /// </summary>
+ STDMETHOD_(BOOL, IsSymbolFont)() PURE;
+
+ /// <summary>
+ /// Obtains design units and common metrics for the font face.
+ /// These metrics are applicable to all the glyphs within a fontface and are used by applications for layout calculations.
+ /// </summary>
+ /// <param name="fontFaceMetrics">Points to a DWRITE_FONT_METRICS structure to fill in.
+ /// The metrics returned by this function are in font design units.</param>
+ STDMETHOD_(void, GetMetrics)(
+ __out DWRITE_FONT_METRICS* fontFaceMetrics
+ ) PURE;
+
+ /// <summary>
+ /// Obtains the number of glyphs in the font face.
+ /// </summary>
+ STDMETHOD_(UINT16, GetGlyphCount)() PURE;
+
+ /// <summary>
+ /// Obtains ideal glyph metrics in font design units. Design glyphs metrics are used for glyph positioning.
+ /// </summary>
+ /// <param name="glyphIndices">An array of glyph indices to compute the metrics for.</param>
+ /// <param name="glyphCount">The number of elements in the glyphIndices array.</param>
+ /// <param name="glyphMetrics">Array of DWRITE_GLYPH_METRICS structures filled by this function.
+ /// The metrics returned by this function are in font design units.</param>
+ /// <param name="isSideways">Indicates whether the font is being used in a sideways run.
+ /// This can affect the glyph metrics if the font has oblique simulation
+ /// because sideways oblique simulation differs from non-sideways oblique simulation.</param>
+ /// <returns>
+ /// Standard HRESULT error code. If any of the input glyph indices are outside of the valid glyph index range
+ /// for the current font face, E_INVALIDARG will be returned.
+ /// </returns>
+ STDMETHOD(GetDesignGlyphMetrics)(
+ __in_ecount(glyphCount) UINT16 const* glyphIndices,
+ UINT32 glyphCount,
+ __out_ecount(glyphCount) DWRITE_GLYPH_METRICS* glyphMetrics,
+ BOOL isSideways = FALSE
+ ) PURE;
+
+ /// <summary>
+ /// Returns the nominal mapping of UCS4 Unicode code points to glyph indices as defined by the font 'CMAP' table.
+ /// Note that this mapping is primarily provided for line layout engines built on top of the physical font API.
+ /// Because of OpenType glyph substitution and line layout character substitution, the nominal conversion does not always correspond
+ /// to how a Unicode string will map to glyph indices when rendering using a particular font face.
+ /// Also, note that Unicode Variant Selectors provide for alternate mappings for character to glyph.
+ /// This call will always return the default variant.
+ /// </summary>
+ /// <param name="codePoints">An array of USC4 code points to obtain nominal glyph indices from.</param>
+ /// <param name="codePointCount">The number of elements in the codePoints array.</param>
+ /// <param name="glyphIndices">Array of nominal glyph indices filled by this function.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(GetGlyphIndices)(
+ __in_ecount(codePointCount) UINT32 const* codePoints,
+ UINT32 codePointCount,
+ __out_ecount(codePointCount) UINT16* glyphIndices
+ ) PURE;
+
+ /// <summary>
+ /// Finds the specified OpenType font table if it exists and returns a pointer to it.
+ /// The function accesses the underling font data via the IDWriteFontStream interface
+ /// implemented by the font file loader.
+ /// </summary>
+ /// <param name="openTypeTableTag">Four character tag of table to find.
+ /// Use the DWRITE_MAKE_OPENTYPE_TAG() macro to create it.
+ /// Unlike GDI, it does not support the special TTCF and null tags to access the whole font.</param>
+ /// <param name="tableData">
+ /// Pointer to base of table in memory.
+ /// The pointer is only valid so long as the FontFace used to get the font table still exists
+ /// (not any other FontFace, even if it actually refers to the same physical font).
+ /// </param>
+ /// <param name="tableSize">Byte size of table.</param>
+ /// <param name="tableContext">
+ /// Opaque context which must be freed by calling ReleaseFontTable.
+ /// The context actually comes from the lower level IDWriteFontFileStream,
+ /// which may be implemented by the application or DWrite itself.
+ /// It is possible for a NULL tableContext to be returned, especially if
+ /// the implementation directly memory maps the whole file.
+ /// Nevertheless, always release it later, and do not use it as a test for function success.
+ /// The same table can be queried multiple times,
+ /// but each returned context can be different, so release each separately.
+ /// </param>
+ /// <param name="exists">True if table exists.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// If a table can not be found, the function will not return an error, but the size will be 0, table NULL, and exists = FALSE.
+ /// The context does not need to be freed if the table was not found.
+ /// </returns>
+ /// <remarks>
+ /// The context for the same tag may be different for each call,
+ /// so each one must be held and released separately.
+ /// </remarks>
+ STDMETHOD(TryGetFontTable)(
+ __in UINT32 openTypeTableTag,
+ __deref_out_bcount(*tableSize) const void** tableData,
+ __out UINT32* tableSize,
+ __out void** tableContext,
+ __out BOOL* exists
+ ) PURE;
+
+ /// <summary>
+ /// Releases the table obtained earlier from TryGetFontTable.
+ /// </summary>
+ /// <param name="tableContext">Opaque context from TryGetFontTable.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD_(void, ReleaseFontTable)(
+ __in void* tableContext
+ ) PURE;
+
+ /// <summary>
+ /// Computes the outline of a run of glyphs by calling back to the outline sink interface.
+ /// </summary>
+ /// <param name="emSize">Logical size of the font in DIP units. A DIP ("device-independent pixel") equals 1/96 inch.</param>
+ /// <param name="glyphIndices">Array of glyph indices.</param>
+ /// <param name="glyphAdvances">Optional array of glyph advances in DIPs.</param>
+ /// <param name="glyphOffsets">Optional array of glyph offsets.</param>
+ /// <param name="glyphCount">Number of glyphs.</param>
+ /// <param name="isSideways">If true, specifies that glyphs are rotated 90 degrees to the left and vertical metrics are used.
+ /// A client can render a vertical run by specifying isSideways = true and rotating the resulting geometry 90 degrees to the
+ /// right using a transform. The isSideways and isRightToLeft parameters cannot both be true.</param>
+ /// <param name="isRightToLeft">If true, specifies that the advance direction is right to left. By default, the advance direction
+ /// is left to right.</param>
+ /// <param name="geometrySink">Interface the function calls back to draw each element of the geometry.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(GetGlyphRunOutline)(
+ FLOAT emSize,
+ __in_ecount(glyphCount) UINT16 const* glyphIndices,
+ __in_ecount_opt(glyphCount) FLOAT const* glyphAdvances,
+ __in_ecount_opt(glyphCount) DWRITE_GLYPH_OFFSET const* glyphOffsets,
+ UINT32 glyphCount,
+ BOOL isSideways,
+ BOOL isRightToLeft,
+ IDWriteGeometrySink* geometrySink
+ ) PURE;
+
+ /// <summary>
+ /// Determines the recommended rendering mode for the font given the specified size and rendering parameters.
+ /// </summary>
+ /// <param name="emSize">Logical size of the font in DIP units. A DIP ("device-independent pixel") equals 1/96 inch.</param>
+ /// <param name="pixelsPerDip">Number of physical pixels per DIP. For example, if the DPI of the rendering surface is 96 this
+ /// value is 1.0f. If the DPI is 120, this value is 120.0f/96.</param>
+ /// <param name="measuringMode">Specifies measuring method that will be used for glyphs in the font.
+ /// Renderer implementations may choose different rendering modes for given measuring methods, but
+ /// best results are seen when the corresponding modes match:
+ /// DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL for DWRITE_MEASURING_MODE_NATURAL
+ /// DWRITE_RENDERING_MODE_CLEARTYPE_GDI_CLASSIC for DWRITE_MEASURING_MODE_GDI_CLASSIC
+ /// DWRITE_RENDERING_MODE_CLEARTYPE_GDI_NATURAL for DWRITE_MEASURING_MODE_GDI_NATURAL
+ /// </param>
+ /// <param name="renderingParams">Rendering parameters object. This parameter is necessary in case the rendering parameters
+ /// object overrides the rendering mode.</param>
+ /// <param name="renderingMode">Receives the recommended rendering mode to use.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(GetRecommendedRenderingMode)(
+ FLOAT emSize,
+ FLOAT pixelsPerDip,
+ DWRITE_MEASURING_MODE measuringMode,
+ IDWriteRenderingParams* renderingParams,
+ __out DWRITE_RENDERING_MODE* renderingMode
+ ) PURE;
+
+ /// <summary>
+ /// Obtains design units and common metrics for the font face.
+ /// These metrics are applicable to all the glyphs within a fontface and are used by applications for layout calculations.
+ /// </summary>
+ /// <param name="emSize">Logical size of the font in DIP units. A DIP ("device-independent pixel") equals 1/96 inch.</param>
+ /// <param name="pixelsPerDip">Number of physical pixels per DIP. For example, if the DPI of the rendering surface is 96 this
+ /// value is 1.0f. If the DPI is 120, this value is 120.0f/96.</param>
+ /// <param name="transform">Optional transform applied to the glyphs and their positions. This transform is applied after the
+ /// scaling specified by the font size and pixelsPerDip.</param>
+ /// <param name="fontFaceMetrics">Points to a DWRITE_FONT_METRICS structure to fill in.
+ /// The metrics returned by this function are in font design units.</param>
+ STDMETHOD(GetGdiCompatibleMetrics)(
+ FLOAT emSize,
+ FLOAT pixelsPerDip,
+ __in_opt DWRITE_MATRIX const* transform,
+ __out DWRITE_FONT_METRICS* fontFaceMetrics
+ ) PURE;
+
+
+ /// <summary>
+ /// Obtains glyph metrics in font design units with the return values compatible with what GDI would produce.
+ /// Glyphs metrics are used for positioning of individual glyphs.
+ /// </summary>
+ /// <param name="emSize">Logical size of the font in DIP units. A DIP ("device-independent pixel") equals 1/96 inch.</param>
+ /// <param name="pixelsPerDip">Number of physical pixels per DIP. For example, if the DPI of the rendering surface is 96 this
+ /// value is 1.0f. If the DPI is 120, this value is 120.0f/96.</param>
+ /// <param name="transform">Optional transform applied to the glyphs and their positions. This transform is applied after the
+ /// scaling specified by the font size and pixelsPerDip.</param>
+ /// <param name="useGdiNatural">
+ /// When set to FALSE, the metrics are the same as the metrics of GDI aliased text.
+ /// When set to TRUE, the metrics are the same as the metrics of text measured by GDI using a font
+ /// created with CLEARTYPE_NATURAL_QUALITY.
+ /// </param>
+ /// <param name="glyphIndices">An array of glyph indices to compute the metrics for.</param>
+ /// <param name="glyphCount">The number of elements in the glyphIndices array.</param>
+ /// <param name="glyphMetrics">Array of DWRITE_GLYPH_METRICS structures filled by this function.
+ /// The metrics returned by this function are in font design units.</param>
+ /// <param name="isSideways">Indicates whether the font is being used in a sideways run.
+ /// This can affect the glyph metrics if the font has oblique simulation
+ /// because sideways oblique simulation differs from non-sideways oblique simulation.</param>
+ /// <returns>
+ /// Standard HRESULT error code. If any of the input glyph indices are outside of the valid glyph index range
+ /// for the current font face, E_INVALIDARG will be returned.
+ /// </returns>
+ STDMETHOD(GetGdiCompatibleGlyphMetrics)(
+ FLOAT emSize,
+ FLOAT pixelsPerDip,
+ __in_opt DWRITE_MATRIX const* transform,
+ BOOL useGdiNatural,
+ __in_ecount(glyphCount) UINT16 const* glyphIndices,
+ UINT32 glyphCount,
+ __out_ecount(glyphCount) DWRITE_GLYPH_METRICS* glyphMetrics,
+ BOOL isSideways = FALSE
+ ) PURE;
+};
+
+interface IDWriteFactory;
+interface IDWriteFontFileEnumerator;
+
+/// <summary>
+/// The font collection loader interface is used to construct a collection of fonts given a particular type of key.
+/// The font collection loader interface is recommended to be implemented by a singleton object.
+/// IMPORTANT: font collection loader implementations must not register themselves with a DirectWrite factory
+/// inside their constructors and must not unregister themselves in their destructors, because
+/// registration and unregistraton operations increment and decrement the object reference count respectively.
+/// Instead, registration and unregistration of font file loaders with DirectWrite factory should be performed
+/// outside of the font file loader implementation as a separate step.
+/// </summary>
+interface DWRITE_DECLARE_INTERFACE("cca920e4-52f0-492b-bfa8-29c72ee0a468") IDWriteFontCollectionLoader : public IUnknown
+{
+ /// <summary>
+ /// Creates a font file enumerator object that encapsulates a collection of font files.
+ /// The font system calls back to this interface to create a font collection.
+ /// </summary>
+ /// <param name="factory">Factory associated with the loader.</param>
+ /// <param name="collectionKey">Font collection key that uniquely identifies the collection of font files within
+ /// the scope of the font collection loader being used.</param>
+ /// <param name="collectionKeySize">Size of the font collection key in bytes.</param>
+ /// <param name="fontFileEnumerator">Pointer to the newly created font file enumerator.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(CreateEnumeratorFromKey)(
+ IDWriteFactory* factory,
+ __in_bcount(collectionKeySize) void const* collectionKey,
+ UINT32 collectionKeySize,
+ __out IDWriteFontFileEnumerator** fontFileEnumerator
+ ) PURE;
+};
+
+/// <summary>
+/// The font file enumerator interface encapsulates a collection of font files. The font system uses this interface
+/// to enumerate font files when building a font collection.
+/// </summary>
+interface DWRITE_DECLARE_INTERFACE("72755049-5ff7-435d-8348-4be97cfa6c7c") IDWriteFontFileEnumerator : public IUnknown
+{
+ /// <summary>
+ /// Advances to the next font file in the collection. When it is first created, the enumerator is positioned
+ /// before the first element of the collection and the first call to MoveNext advances to the first file.
+ /// </summary>
+ /// <param name="hasCurrentFile">Receives the value TRUE if the enumerator advances to a file, or FALSE if
+ /// the enumerator advanced past the last file in the collection.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(MoveNext)(
+ __out BOOL* hasCurrentFile
+ ) PURE;
+
+ /// <summary>
+ /// Gets a reference to the current font file.
+ /// </summary>
+ /// <param name="fontFile">Pointer to the newly created font file object.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(GetCurrentFontFile)(
+ __out IDWriteFontFile** fontFile
+ ) PURE;
+};
+
+/// <summary>
+/// Represents a collection of strings indexed by locale name.
+/// </summary>
+interface DWRITE_DECLARE_INTERFACE("08256209-099a-4b34-b86d-c22b110e7771") IDWriteLocalizedStrings : public IUnknown
+{
+ /// <summary>
+ /// Gets the number of language/string pairs.
+ /// </summary>
+ STDMETHOD_(UINT32, GetCount)() PURE;
+
+ /// <summary>
+ /// Gets the index of the item with the specified locale name.
+ /// </summary>
+ /// <param name="localeName">Locale name to look for.</param>
+ /// <param name="index">Receives the zero-based index of the locale name/string pair.</param>
+ /// <param name="exists">Receives TRUE if the locale name exists or FALSE if not.</param>
+ /// <returns>
+ /// Standard HRESULT error code. If the specified locale name does not exist, the return value is S_OK,
+ /// but *index is UINT_MAX and *exists is FALSE.
+ /// </returns>
+ STDMETHOD(FindLocaleName)(
+ __in_z WCHAR const* localeName,
+ __out UINT32* index,
+ __out BOOL* exists
+ ) PURE;
+
+ /// <summary>
+ /// Gets the length in characters (not including the null terminator) of the locale name with the specified index.
+ /// </summary>
+ /// <param name="index">Zero-based index of the locale name.</param>
+ /// <param name="length">Receives the length in characters, not including the null terminator.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(GetLocaleNameLength)(
+ UINT32 index,
+ __out UINT32* length
+ ) PURE;
+
+ /// <summary>
+ /// Copies the locale name with the specified index to the specified array.
+ /// </summary>
+ /// <param name="index">Zero-based index of the locale name.</param>
+ /// <param name="localeName">Character array that receives the locale name.</param>
+ /// <param name="size">Size of the array in characters. The size must include space for the terminating
+ /// null character.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(GetLocaleName)(
+ UINT32 index,
+ __out_ecount_z(size) WCHAR* localeName,
+ UINT32 size
+ ) PURE;
+
+ /// <summary>
+ /// Gets the length in characters (not including the null terminator) of the string with the specified index.
+ /// </summary>
+ /// <param name="index">Zero-based index of the string.</param>
+ /// <param name="length">Receives the length in characters, not including the null terminator.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(GetStringLength)(
+ UINT32 index,
+ __out UINT32* length
+ ) PURE;
+
+ /// <summary>
+ /// Copies the string with the specified index to the specified array.
+ /// </summary>
+ /// <param name="index">Zero-based index of the string.</param>
+ /// <param name="stringBuffer">Character array that receives the string.</param>
+ /// <param name="size">Size of the array in characters. The size must include space for the terminating
+ /// null character.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(GetString)(
+ UINT32 index,
+ __out_ecount_z(size) WCHAR* stringBuffer,
+ UINT32 size
+ ) PURE;
+};
+
+interface IDWriteFontFamily;
+interface IDWriteFont;
+
+/// <summary>
+/// The IDWriteFontCollection encapsulates a collection of fonts.
+/// </summary>
+interface DWRITE_DECLARE_INTERFACE("a84cee02-3eea-4eee-a827-87c1a02a0fcc") IDWriteFontCollection : public IUnknown
+{
+ /// <summary>
+ /// Gets the number of font families in the collection.
+ /// </summary>
+ STDMETHOD_(UINT32, GetFontFamilyCount)() PURE;
+
+ /// <summary>
+ /// Creates a font family object given a zero-based font family index.
+ /// </summary>
+ /// <param name="index">Zero-based index of the font family.</param>
+ /// <param name="fontFamily">Receives a pointer the newly created font family object.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(GetFontFamily)(
+ UINT32 index,
+ __out IDWriteFontFamily** fontFamily
+ ) PURE;
+
+ /// <summary>
+ /// Finds the font family with the specified family name.
+ /// </summary>
+ /// <param name="familyName">Name of the font family. The name is not case-sensitive but must otherwise exactly match a family name in the collection.</param>
+ /// <param name="index">Receives the zero-based index of the matching font family if the family name was found or UINT_MAX otherwise.</param>
+ /// <param name="exists">Receives TRUE if the family name exists or FALSE otherwise.</param>
+ /// <returns>
+ /// Standard HRESULT error code. If the specified family name does not exist, the return value is S_OK, but *index is UINT_MAX and *exists is FALSE.
+ /// </returns>
+ STDMETHOD(FindFamilyName)(
+ __in_z WCHAR const* familyName,
+ __out UINT32* index,
+ __out BOOL* exists
+ ) PURE;
+
+ /// <summary>
+ /// Gets the font object that corresponds to the same physical font as the specified font face object. The specified physical font must belong
+ /// to the font collection.
+ /// </summary>
+ /// <param name="fontFace">Font face object that specifies the physical font.</param>
+ /// <param name="font">Receives a pointer to the newly created font object if successful or NULL otherwise.</param>
+ /// <returns>
+ /// Standard HRESULT error code. If the specified physical font is not part of the font collection the return value is DWRITE_E_NOFONT.
+ /// </returns>
+ STDMETHOD(GetFontFromFontFace)(
+ IDWriteFontFace* fontFace,
+ __out IDWriteFont** font
+ ) PURE;
+};
+
+/// <summary>
+/// The IDWriteFontList interface represents a list of fonts.
+/// </summary>
+interface DWRITE_DECLARE_INTERFACE("1a0d8438-1d97-4ec1-aef9-a2fb86ed6acb") IDWriteFontList : public IUnknown
+{
+ /// <summary>
+ /// Gets the font collection that contains the fonts.
+ /// </summary>
+ /// <param name="fontCollection">Receives a pointer to the font collection object.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(GetFontCollection)(
+ __out IDWriteFontCollection** fontCollection
+ ) PURE;
+
+ /// <summary>
+ /// Gets the number of fonts in the font list.
+ /// </summary>
+ STDMETHOD_(UINT32, GetFontCount)() PURE;
+
+ /// <summary>
+ /// Gets a font given its zero-based index.
+ /// </summary>
+ /// <param name="index">Zero-based index of the font in the font list.</param>
+ /// <param name="font">Receives a pointer to the newly created font object.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(GetFont)(
+ UINT32 index,
+ __out IDWriteFont** font
+ ) PURE;
+};
+
+/// <summary>
+/// The IDWriteFontFamily interface represents a set of fonts that share the same design but are differentiated
+/// by weight, stretch, and style.
+/// </summary>
+interface DWRITE_DECLARE_INTERFACE("da20d8ef-812a-4c43-9802-62ec4abd7add") IDWriteFontFamily : public IDWriteFontList
+{
+ /// <summary>
+ /// Creates an localized strings object that contains the family names for the font family, indexed by locale name.
+ /// </summary>
+ /// <param name="names">Receives a pointer to the newly created localized strings object.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(GetFamilyNames)(
+ __out IDWriteLocalizedStrings** names
+ ) PURE;
+
+ /// <summary>
+ /// Gets the font that best matches the specified properties.
+ /// </summary>
+ /// <param name="weight">Requested font weight.</param>
+ /// <param name="stretch">Requested font stretch.</param>
+ /// <param name="style">Requested font style.</param>
+ /// <param name="matchingFont">Receives a pointer to the newly created font object.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(GetFirstMatchingFont)(
+ DWRITE_FONT_WEIGHT weight,
+ DWRITE_FONT_STRETCH stretch,
+ DWRITE_FONT_STYLE style,
+ __out IDWriteFont** matchingFont
+ ) PURE;
+
+ /// <summary>
+ /// Gets a list of fonts in the font family ranked in order of how well they match the specified properties.
+ /// </summary>
+ /// <param name="weight">Requested font weight.</param>
+ /// <param name="stretch">Requested font stretch.</param>
+ /// <param name="style">Requested font style.</param>
+ /// <param name="matchingFonts">Receives a pointer to the newly created font list object.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(GetMatchingFonts)(
+ DWRITE_FONT_WEIGHT weight,
+ DWRITE_FONT_STRETCH stretch,
+ DWRITE_FONT_STYLE style,
+ __out IDWriteFontList** matchingFonts
+ ) PURE;
+};
+
+/// <summary>
+/// The IDWriteFont interface represents a physical font in a font collection.
+/// </summary>
+interface DWRITE_DECLARE_INTERFACE("acd16696-8c14-4f5d-877e-fe3fc1d32737") IDWriteFont : public IUnknown
+{
+ /// <summary>
+ /// Gets the font family to which the specified font belongs.
+ /// </summary>
+ /// <param name="fontFamily">Receives a pointer to the font family object.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(GetFontFamily)(
+ __out IDWriteFontFamily** fontFamily
+ ) PURE;
+
+ /// <summary>
+ /// Gets the weight of the specified font.
+ /// </summary>
+ STDMETHOD_(DWRITE_FONT_WEIGHT, GetWeight)() PURE;
+
+ /// <summary>
+ /// Gets the stretch (aka. width) of the specified font.
+ /// </summary>
+ STDMETHOD_(DWRITE_FONT_STRETCH, GetStretch)() PURE;
+
+ /// <summary>
+ /// Gets the style (aka. slope) of the specified font.
+ /// </summary>
+ STDMETHOD_(DWRITE_FONT_STYLE, GetStyle)() PURE;
+
+ /// <summary>
+ /// Returns TRUE if the font is a symbol font or FALSE if not.
+ /// </summary>
+ STDMETHOD_(BOOL, IsSymbolFont)() PURE;
+
+ /// <summary>
+ /// Gets a localized strings collection containing the face names for the font (e.g., Regular or Bold), indexed by locale name.
+ /// </summary>
+ /// <param name="names">Receives a pointer to the newly created localized strings object.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(GetFaceNames)(
+ __out IDWriteLocalizedStrings** names
+ ) PURE;
+
+ /// <summary>
+ /// Gets a localized strings collection containing the specified informational strings, indexed by locale name.
+ /// </summary>
+ /// <param name="informationalStringID">Identifies the string to get.</param>
+ /// <param name="informationalStrings">Receives a pointer to the newly created localized strings object.</param>
+ /// <param name="exists">Receives the value TRUE if the font contains the specified string ID or FALSE if not.</param>
+ /// <returns>
+ /// Standard HRESULT error code. If the font does not contain the specified string, the return value is S_OK but
+ /// informationalStrings receives a NULL pointer and exists receives the value FALSE.
+ /// </returns>
+ STDMETHOD(GetInformationalStrings)(
+ DWRITE_INFORMATIONAL_STRING_ID informationalStringID,
+ __out IDWriteLocalizedStrings** informationalStrings,
+ __out BOOL* exists
+ ) PURE;
+
+ /// <summary>
+ /// Gets a value that indicates what simulation are applied to the specified font.
+ /// </summary>
+ STDMETHOD_(DWRITE_FONT_SIMULATIONS, GetSimulations)() PURE;
+
+ /// <summary>
+ /// Gets the metrics for the font.
+ /// </summary>
+ /// <param name="fontMetrics">Receives the font metrics.</param>
+ STDMETHOD_(void, GetMetrics)(
+ __out DWRITE_FONT_METRICS* fontMetrics
+ ) PURE;
+
+ /// <summary>
+ /// Determines whether the font supports the specified character.
+ /// </summary>
+ /// <param name="unicodeValue">Unicode (UCS-4) character value.</param>
+ /// <param name="exists">Receives the value TRUE if the font supports the specified character or FALSE if not.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(HasCharacter)(
+ UINT32 unicodeValue,
+ __out BOOL* exists
+ ) PURE;
+
+ /// <summary>
+ /// Creates a font face object for the font.
+ /// </summary>
+ /// <param name="fontFace">Receives a pointer to the newly created font face object.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(CreateFontFace)(
+ __out IDWriteFontFace** fontFace
+ ) PURE;
+};
+
+/// <summary>
+/// Direction for how reading progresses.
+/// </summary>
+enum DWRITE_READING_DIRECTION
+{
+ /// <summary>
+ /// Reading progresses from left to right.
+ /// </summary>
+ DWRITE_READING_DIRECTION_LEFT_TO_RIGHT,
+
+ /// <summary>
+ /// Reading progresses from right to left.
+ /// </summary>
+ DWRITE_READING_DIRECTION_RIGHT_TO_LEFT
+};
+
+/// <summary>
+/// Direction for how lines of text are placed relative to one another.
+/// </summary>
+enum DWRITE_FLOW_DIRECTION
+{
+ /// <summary>
+ /// Text lines are placed from top to bottom.
+ /// </summary>
+ DWRITE_FLOW_DIRECTION_TOP_TO_BOTTOM
+};
+
+/// <summary>
+/// Alignment of paragraph text along the reading direction axis relative to
+/// the leading and trailing edge of the layout box.
+/// </summary>
+enum DWRITE_TEXT_ALIGNMENT
+{
+ /// <summary>
+ /// The leading edge of the paragraph text is aligned to the layout box's leading edge.
+ /// </summary>
+ DWRITE_TEXT_ALIGNMENT_LEADING,
+
+ /// <summary>
+ /// The trailing edge of the paragraph text is aligned to the layout box's trailing edge.
+ /// </summary>
+ DWRITE_TEXT_ALIGNMENT_TRAILING,
+
+ /// <summary>
+ /// The center of the paragraph text is aligned to the center of the layout box.
+ /// </summary>
+ DWRITE_TEXT_ALIGNMENT_CENTER
+};
+
+/// <summary>
+/// Alignment of paragraph text along the flow direction axis relative to the
+/// flow's beginning and ending edge of the layout box.
+/// </summary>
+enum DWRITE_PARAGRAPH_ALIGNMENT
+{
+ /// <summary>
+ /// The first line of paragraph is aligned to the flow's beginning edge of the layout box.
+ /// </summary>
+ DWRITE_PARAGRAPH_ALIGNMENT_NEAR,
+
+ /// <summary>
+ /// The last line of paragraph is aligned to the flow's ending edge of the layout box.
+ /// </summary>
+ DWRITE_PARAGRAPH_ALIGNMENT_FAR,
+
+ /// <summary>
+ /// The center of the paragraph is aligned to the center of the flow of the layout box.
+ /// </summary>
+ DWRITE_PARAGRAPH_ALIGNMENT_CENTER
+};
+
+/// <summary>
+/// Word wrapping in multiline paragraph.
+/// </summary>
+enum DWRITE_WORD_WRAPPING
+{
+ /// <summary>
+ /// Words are broken across lines to avoid text overflowing the layout box.
+ /// </summary>
+ DWRITE_WORD_WRAPPING_WRAP,
+
+ /// <summary>
+ /// Words are kept within the same line even when it overflows the layout box.
+ /// This option is often used with scrolling to reveal overflow text.
+ /// </summary>
+ DWRITE_WORD_WRAPPING_NO_WRAP
+};
+
+/// <summary>
+/// The method used for line spacing in layout.
+/// </summary>
+enum DWRITE_LINE_SPACING_METHOD
+{
+ /// <summary>
+ /// Line spacing depends solely on the content, growing to accomodate the size of fonts and inline objects.
+ /// </summary>
+ DWRITE_LINE_SPACING_METHOD_DEFAULT,
+
+ /// <summary>
+ /// Lines are explicitly set to uniform spacing, regardless of contained font sizes.
+ /// This can be useful to avoid the uneven appearance that can occur from font fallback.
+ /// </summary>
+ DWRITE_LINE_SPACING_METHOD_UNIFORM
+};
+
+/// <summary>
+/// Text granularity used to trim text overflowing the layout box.
+/// </summary>
+enum DWRITE_TRIMMING_GRANULARITY
+{
+ /// <summary>
+ /// No trimming occurs. Text flows beyond the layout width.
+ /// </summary>
+ DWRITE_TRIMMING_GRANULARITY_NONE,
+
+ /// <summary>
+ /// Trimming occurs at character cluster boundary.
+ /// </summary>
+ DWRITE_TRIMMING_GRANULARITY_CHARACTER,
+
+ /// <summary>
+ /// Trimming occurs at word boundary.
+ /// </summary>
+ DWRITE_TRIMMING_GRANULARITY_WORD
+};
+
+/// <summary>
+/// Typographic feature of text supplied by the font.
+/// </summary>
+enum DWRITE_FONT_FEATURE_TAG
+{
+ DWRITE_FONT_FEATURE_TAG_ALTERNATIVE_FRACTIONS = 0x63726661, // 'afrc'
+ DWRITE_FONT_FEATURE_TAG_PETITE_CAPITALS_FROM_CAPITALS = 0x63703263, // 'c2pc'
+ DWRITE_FONT_FEATURE_TAG_SMALL_CAPITALS_FROM_CAPITALS = 0x63733263, // 'c2sc'
+ DWRITE_FONT_FEATURE_TAG_CONTEXTUAL_ALTERNATES = 0x746c6163, // 'calt'
+ DWRITE_FONT_FEATURE_TAG_CASE_SENSITIVE_FORMS = 0x65736163, // 'case'
+ DWRITE_FONT_FEATURE_TAG_GLYPH_COMPOSITION_DECOMPOSITION = 0x706d6363, // 'ccmp'
+ DWRITE_FONT_FEATURE_TAG_CONTEXTUAL_LIGATURES = 0x67696c63, // 'clig'
+ DWRITE_FONT_FEATURE_TAG_CAPITAL_SPACING = 0x70737063, // 'cpsp'
+ DWRITE_FONT_FEATURE_TAG_CONTEXTUAL_SWASH = 0x68777363, // 'cswh'
+ DWRITE_FONT_FEATURE_TAG_CURSIVE_POSITIONING = 0x73727563, // 'curs'
+ DWRITE_FONT_FEATURE_TAG_DEFAULT = 0x746c6664, // 'dflt'
+ DWRITE_FONT_FEATURE_TAG_DISCRETIONARY_LIGATURES = 0x67696c64, // 'dlig'
+ DWRITE_FONT_FEATURE_TAG_EXPERT_FORMS = 0x74707865, // 'expt'
+ DWRITE_FONT_FEATURE_TAG_FRACTIONS = 0x63617266, // 'frac'
+ DWRITE_FONT_FEATURE_TAG_FULL_WIDTH = 0x64697766, // 'fwid'
+ DWRITE_FONT_FEATURE_TAG_HALF_FORMS = 0x666c6168, // 'half'
+ DWRITE_FONT_FEATURE_TAG_HALANT_FORMS = 0x6e6c6168, // 'haln'
+ DWRITE_FONT_FEATURE_TAG_ALTERNATE_HALF_WIDTH = 0x746c6168, // 'halt'
+ DWRITE_FONT_FEATURE_TAG_HISTORICAL_FORMS = 0x74736968, // 'hist'
+ DWRITE_FONT_FEATURE_TAG_HORIZONTAL_KANA_ALTERNATES = 0x616e6b68, // 'hkna'
+ DWRITE_FONT_FEATURE_TAG_HISTORICAL_LIGATURES = 0x67696c68, // 'hlig'
+ DWRITE_FONT_FEATURE_TAG_HALF_WIDTH = 0x64697768, // 'hwid'
+ DWRITE_FONT_FEATURE_TAG_HOJO_KANJI_FORMS = 0x6f6a6f68, // 'hojo'
+ DWRITE_FONT_FEATURE_TAG_JIS04_FORMS = 0x3430706a, // 'jp04'
+ DWRITE_FONT_FEATURE_TAG_JIS78_FORMS = 0x3837706a, // 'jp78'
+ DWRITE_FONT_FEATURE_TAG_JIS83_FORMS = 0x3338706a, // 'jp83'
+ DWRITE_FONT_FEATURE_TAG_JIS90_FORMS = 0x3039706a, // 'jp90'
+ DWRITE_FONT_FEATURE_TAG_KERNING = 0x6e72656b, // 'kern'
+ DWRITE_FONT_FEATURE_TAG_STANDARD_LIGATURES = 0x6167696c, // 'liga'
+ DWRITE_FONT_FEATURE_TAG_LINING_FIGURES = 0x6d756e6c, // 'lnum'
+ DWRITE_FONT_FEATURE_TAG_LOCALIZED_FORMS = 0x6c636f6c, // 'locl'
+ DWRITE_FONT_FEATURE_TAG_MARK_POSITIONING = 0x6b72616d, // 'mark'
+ DWRITE_FONT_FEATURE_TAG_MATHEMATICAL_GREEK = 0x6b72676d, // 'mgrk'
+ DWRITE_FONT_FEATURE_TAG_MARK_TO_MARK_POSITIONING = 0x6b6d6b6d, // 'mkmk'
+ DWRITE_FONT_FEATURE_TAG_ALTERNATE_ANNOTATION_FORMS = 0x746c616e, // 'nalt'
+ DWRITE_FONT_FEATURE_TAG_NLC_KANJI_FORMS = 0x6b636c6e, // 'nlck'
+ DWRITE_FONT_FEATURE_TAG_OLD_STYLE_FIGURES = 0x6d756e6f, // 'onum'
+ DWRITE_FONT_FEATURE_TAG_ORDINALS = 0x6e64726f, // 'ordn'
+ DWRITE_FONT_FEATURE_TAG_PROPORTIONAL_ALTERNATE_WIDTH = 0x746c6170, // 'palt'
+ DWRITE_FONT_FEATURE_TAG_PETITE_CAPITALS = 0x70616370, // 'pcap'
+ DWRITE_FONT_FEATURE_TAG_PROPORTIONAL_FIGURES = 0x6d756e70, // 'pnum'
+ DWRITE_FONT_FEATURE_TAG_PROPORTIONAL_WIDTHS = 0x64697770, // 'pwid'
+ DWRITE_FONT_FEATURE_TAG_QUARTER_WIDTHS = 0x64697771, // 'qwid'
+ DWRITE_FONT_FEATURE_TAG_REQUIRED_LIGATURES = 0x67696c72, // 'rlig'
+ DWRITE_FONT_FEATURE_TAG_RUBY_NOTATION_FORMS = 0x79627572, // 'ruby'
+ DWRITE_FONT_FEATURE_TAG_STYLISTIC_ALTERNATES = 0x746c6173, // 'salt'
+ DWRITE_FONT_FEATURE_TAG_SCIENTIFIC_INFERIORS = 0x666e6973, // 'sinf'
+ DWRITE_FONT_FEATURE_TAG_SMALL_CAPITALS = 0x70636d73, // 'smcp'
+ DWRITE_FONT_FEATURE_TAG_SIMPLIFIED_FORMS = 0x6c706d73, // 'smpl'
+ DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_1 = 0x31307373, // 'ss01'
+ DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_2 = 0x32307373, // 'ss02'
+ DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_3 = 0x33307373, // 'ss03'
+ DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_4 = 0x34307373, // 'ss04'
+ DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_5 = 0x35307373, // 'ss05'
+ DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_6 = 0x36307373, // 'ss06'
+ DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_7 = 0x37307373, // 'ss07'
+ DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_8 = 0x38307373, // 'ss08'
+ DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_9 = 0x39307373, // 'ss09'
+ DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_10 = 0x30317373, // 'ss10'
+ DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_11 = 0x31317373, // 'ss11'
+ DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_12 = 0x32317373, // 'ss12'
+ DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_13 = 0x33317373, // 'ss13'
+ DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_14 = 0x34317373, // 'ss14'
+ DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_15 = 0x35317373, // 'ss15'
+ DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_16 = 0x36317373, // 'ss16'
+ DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_17 = 0x37317373, // 'ss17'
+ DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_18 = 0x38317373, // 'ss18'
+ DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_19 = 0x39317373, // 'ss19'
+ DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_20 = 0x30327373, // 'ss20'
+ DWRITE_FONT_FEATURE_TAG_SUBSCRIPT = 0x73627573, // 'subs'
+ DWRITE_FONT_FEATURE_TAG_SUPERSCRIPT = 0x73707573, // 'sups'
+ DWRITE_FONT_FEATURE_TAG_SWASH = 0x68737773, // 'swsh'
+ DWRITE_FONT_FEATURE_TAG_TITLING = 0x6c746974, // 'titl'
+ DWRITE_FONT_FEATURE_TAG_TRADITIONAL_NAME_FORMS = 0x6d616e74, // 'tnam'
+ DWRITE_FONT_FEATURE_TAG_TABULAR_FIGURES = 0x6d756e74, // 'tnum'
+ DWRITE_FONT_FEATURE_TAG_TRADITIONAL_FORMS = 0x64617274, // 'trad'
+ DWRITE_FONT_FEATURE_TAG_THIRD_WIDTHS = 0x64697774, // 'twid'
+ DWRITE_FONT_FEATURE_TAG_UNICASE = 0x63696e75, // 'unic'
+ DWRITE_FONT_FEATURE_TAG_SLASHED_ZERO = 0x6f72657a, // 'zero'
+};
+
+/// <summary>
+/// The DWRITE_TEXT_RANGE structure specifies a range of text positions where format is applied.
+/// </summary>
+struct DWRITE_TEXT_RANGE
+{
+ /// <summary>
+ /// The start text position of the range.
+ /// </summary>
+ UINT32 startPosition;
+
+ /// <summary>
+ /// The number of text positions in the range.
+ /// </summary>
+ UINT32 length;
+};
+
+/// <summary>
+/// The DWRITE_FONT_FEATURE structure specifies properties used to identify and execute typographic feature in the font.
+/// </summary>
+struct DWRITE_FONT_FEATURE
+{
+ /// <summary>
+ /// The feature OpenType name identifier.
+ /// </summary>
+ DWRITE_FONT_FEATURE_TAG nameTag;
+
+ /// <summary>
+ /// Execution parameter of the feature.
+ /// </summary>
+ /// <remarks>
+ /// The parameter should be non-zero to enable the feature. Once enabled, a feature can't be disabled again within
+ /// the same range. Features requiring a selector use this value to indicate the selector index.
+ /// </remarks>
+ UINT32 parameter;
+};
+
+/// <summary>
+/// Defines a set of typographic features to be applied during shaping.
+/// Notice the character range which this feature list spans is specified
+/// as a separate parameter to GetGlyphs.
+/// </summary>
+struct DWRITE_TYPOGRAPHIC_FEATURES
+{
+ /// <summary>
+ /// Array of font features.
+ /// </summary>
+ __field_ecount(featureCount) DWRITE_FONT_FEATURE* features;
+
+ /// <summary>
+ /// The number of features.
+ /// </summary>
+ UINT32 featureCount;
+};
+
+/// <summary>
+/// The DWRITE_TRIMMING structure specifies the trimming option for text overflowing the layout box.
+/// </summary>
+struct DWRITE_TRIMMING
+{
+ /// <summary>
+ /// Text granularity of which trimming applies.
+ /// </summary>
+ DWRITE_TRIMMING_GRANULARITY granularity;
+
+ /// <summary>
+ /// Character code used as the delimiter signaling the beginning of the portion of text to be preserved,
+ /// most useful for path ellipsis, where the delimeter would be a slash.
+ /// </summary>
+ UINT32 delimiter;
+
+ /// <summary>
+ /// How many occurences of the delimiter to step back.
+ /// </summary>
+ UINT32 delimiterCount;
+};
+
+
+interface IDWriteTypography;
+interface IDWriteInlineObject;
+
+/// <summary>
+/// The format of text used for text layout purpose.
+/// </summary>
+/// <remarks>
+/// This object may not be thread-safe and it may carry the state of text format change.
+/// </remarks>
+interface DWRITE_DECLARE_INTERFACE("9c906818-31d7-4fd3-a151-7c5e225db55a") IDWriteTextFormat : public IUnknown
+{
+ /// <summary>
+ /// Set alignment option of text relative to layout box's leading and trailing edge.
+ /// </summary>
+ /// <param name="textAlignment">Text alignment option</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(SetTextAlignment)(
+ DWRITE_TEXT_ALIGNMENT textAlignment
+ ) PURE;
+
+ /// <summary>
+ /// Set alignment option of paragraph relative to layout box's top and bottom edge.
+ /// </summary>
+ /// <param name="paragraphAlignment">Paragraph alignment option</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(SetParagraphAlignment)(
+ DWRITE_PARAGRAPH_ALIGNMENT paragraphAlignment
+ ) PURE;
+
+ /// <summary>
+ /// Set word wrapping option.
+ /// </summary>
+ /// <param name="wordWrapping">Word wrapping option</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(SetWordWrapping)(
+ DWRITE_WORD_WRAPPING wordWrapping
+ ) PURE;
+
+ /// <summary>
+ /// Set paragraph reading direction.
+ /// </summary>
+ /// <param name="readingDirection">Text reading direction</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(SetReadingDirection)(
+ DWRITE_READING_DIRECTION readingDirection
+ ) PURE;
+
+ /// <summary>
+ /// Set paragraph flow direction.
+ /// </summary>
+ /// <param name="flowDirection">Paragraph flow direction</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(SetFlowDirection)(
+ DWRITE_FLOW_DIRECTION flowDirection
+ ) PURE;
+
+ /// <summary>
+ /// Set incremental tab stop position.
+ /// </summary>
+ /// <param name="incrementalTabStop">The incremental tab stop value</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(SetIncrementalTabStop)(
+ FLOAT incrementalTabStop
+ ) PURE;
+
+ /// <summary>
+ /// Set trimming options for any trailing text exceeding the layout width
+ /// or for any far text exceeding the layout height.
+ /// </summary>
+ /// <param name="trimmingOptions">Text trimming options.</param>
+ /// <param name="trimmingSign">Application-defined omission sign. This parameter may be NULL if no trimming sign is desired.</param>
+ /// <remarks>
+ /// Any inline object can be used for the trimming sign, but CreateEllipsisTrimmingSign
+ /// provides a typical ellipsis symbol. Trimming is also useful vertically for hiding
+ /// partial lines.
+ /// </remarks>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(SetTrimming)(
+ __in DWRITE_TRIMMING const* trimmingOptions,
+ IDWriteInlineObject* trimmingSign
+ ) PURE;
+
+ /// <summary>
+ /// Set line spacing.
+ /// </summary>
+ /// <param name="lineSpacingMethod">How to determine line height.</param>
+ /// <param name="lineSpacing">The line height, or rather distance between one baseline to another.</param>
+ /// <param name="baseline">Distance from top of line to baseline. A reasonable ratio to lineSpacing is 80%.</param>
+ /// <remarks>
+ /// For the default method, spacing depends solely on the content.
+ /// For uniform spacing, the given line height will override the content.
+ /// </remarks>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(SetLineSpacing)(
+ DWRITE_LINE_SPACING_METHOD lineSpacingMethod,
+ FLOAT lineSpacing,
+ FLOAT baseline
+ ) PURE;
+
+ /// <summary>
+ /// Get alignment option of text relative to layout box's leading and trailing edge.
+ /// </summary>
+ STDMETHOD_(DWRITE_TEXT_ALIGNMENT, GetTextAlignment)() PURE;
+
+ /// <summary>
+ /// Get alignment option of paragraph relative to layout box's top and bottom edge.
+ /// </summary>
+ STDMETHOD_(DWRITE_PARAGRAPH_ALIGNMENT, GetParagraphAlignment)() PURE;
+
+ /// <summary>
+ /// Get word wrapping option.
+ /// </summary>
+ STDMETHOD_(DWRITE_WORD_WRAPPING, GetWordWrapping)() PURE;
+
+ /// <summary>
+ /// Get paragraph reading direction.
+ /// </summary>
+ STDMETHOD_(DWRITE_READING_DIRECTION, GetReadingDirection)() PURE;
+
+ /// <summary>
+ /// Get paragraph flow direction.
+ /// </summary>
+ STDMETHOD_(DWRITE_FLOW_DIRECTION, GetFlowDirection)() PURE;
+
+ /// <summary>
+ /// Get incremental tab stop position.
+ /// </summary>
+ STDMETHOD_(FLOAT, GetIncrementalTabStop)() PURE;
+
+ /// <summary>
+ /// Get trimming options for text overflowing the layout width.
+ /// </summary>
+ /// <param name="trimmingOptions">Text trimming options.</param>
+ /// <param name="trimmingSign">Trimming omission sign. This parameter may be NULL.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(GetTrimming)(
+ __out DWRITE_TRIMMING* trimmingOptions,
+ __out IDWriteInlineObject** trimmingSign
+ ) PURE;
+
+ /// <summary>
+ /// Get line spacing.
+ /// </summary>
+ /// <param name="lineSpacingMethod">How line height is determined.</param>
+ /// <param name="lineSpacing">The line height, or rather distance between one baseline to another.</param>
+ /// <param name="baseline">Distance from top of line to baseline.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(GetLineSpacing)(
+ __out DWRITE_LINE_SPACING_METHOD* lineSpacingMethod,
+ __out FLOAT* lineSpacing,
+ __out FLOAT* baseline
+ ) PURE;
+
+ /// <summary>
+ /// Get the font collection.
+ /// </summary>
+ /// <param name="fontCollection">The current font collection.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(GetFontCollection)(
+ __out IDWriteFontCollection** fontCollection
+ ) PURE;
+
+ /// <summary>
+ /// Get the length of the font family name, in characters, not including the terminating NULL character.
+ /// </summary>
+ STDMETHOD_(UINT32, GetFontFamilyNameLength)() PURE;
+
+ /// <summary>
+ /// Get a copy of the font family name.
+ /// </summary>
+ /// <param name="fontFamilyName">Character array that receives the current font family name</param>
+ /// <param name="nameSize">Size of the character array in character count including the terminated NULL character.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(GetFontFamilyName)(
+ __out_ecount_z(nameSize) WCHAR* fontFamilyName,
+ UINT32 nameSize
+ ) PURE;
+
+ /// <summary>
+ /// Get the font weight.
+ /// </summary>
+ STDMETHOD_(DWRITE_FONT_WEIGHT, GetFontWeight)() PURE;
+
+ /// <summary>
+ /// Get the font style.
+ /// </summary>
+ STDMETHOD_(DWRITE_FONT_STYLE, GetFontStyle)() PURE;
+
+ /// <summary>
+ /// Get the font stretch.
+ /// </summary>
+ STDMETHOD_(DWRITE_FONT_STRETCH, GetFontStretch)() PURE;
+
+ /// <summary>
+ /// Get the font em height.
+ /// </summary>
+ STDMETHOD_(FLOAT, GetFontSize)() PURE;
+
+ /// <summary>
+ /// Get the length of the locale name, in characters, not including the terminating NULL character.
+ /// </summary>
+ STDMETHOD_(UINT32, GetLocaleNameLength)() PURE;
+
+ /// <summary>
+ /// Get a copy of the locale name.
+ /// </summary>
+ /// <param name="localeName">Character array that receives the current locale name</param>
+ /// <param name="nameSize">Size of the character array in character count including the terminated NULL character.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(GetLocaleName)(
+ __out_ecount_z(nameSize) WCHAR* localeName,
+ UINT32 nameSize
+ ) PURE;
+};
+
+
+/// <summary>
+/// Font typography setting.
+/// </summary>
+interface DWRITE_DECLARE_INTERFACE("55f1112b-1dc2-4b3c-9541-f46894ed85b6") IDWriteTypography : public IUnknown
+{
+ /// <summary>
+ /// Add font feature.
+ /// </summary>
+ /// <param name="fontFeature">The font feature to add.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(AddFontFeature)(
+ DWRITE_FONT_FEATURE fontFeature
+ ) PURE;
+
+ /// <summary>
+ /// Get the number of font features.
+ /// </summary>
+ STDMETHOD_(UINT32, GetFontFeatureCount)() PURE;
+
+ /// <summary>
+ /// Get the font feature at the specified index.
+ /// </summary>
+ /// <param name="fontFeatureIndex">The zero-based index of the font feature to get.</param>
+ /// <param name="fontFeature">The font feature.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(GetFontFeature)(
+ UINT32 fontFeatureIndex,
+ __out DWRITE_FONT_FEATURE* fontFeature
+ ) PURE;
+};
+
+enum DWRITE_SCRIPT_SHAPES
+{
+ /// <summary>
+ /// No additional shaping requirement. Text is shaped with the writing system default behavior.
+ /// </summary>
+ DWRITE_SCRIPT_SHAPES_DEFAULT = 0,
+
+ /// <summary>
+ /// Text should leave no visual on display i.e. control or format control characters.
+ /// </summary>
+ DWRITE_SCRIPT_SHAPES_NO_VISUAL = 1
+};
+
+#ifdef DEFINE_ENUM_FLAG_OPERATORS
+DEFINE_ENUM_FLAG_OPERATORS(DWRITE_SCRIPT_SHAPES);
+#endif
+
+/// <summary>
+/// Association of text and its writing system script as well as some display attributes.
+/// </summary>
+struct DWRITE_SCRIPT_ANALYSIS
+{
+ /// <summary>
+ /// Zero-based index representation of writing system script.
+ /// </summary>
+ UINT16 script;
+
+ /// <summary>
+ /// Additional shaping requirement of text.
+ /// </summary>
+ DWRITE_SCRIPT_SHAPES shapes;
+};
+
+/// <summary>
+/// Condition at the edges of inline object or text used to determine
+/// line-breaking behavior.
+/// </summary>
+enum DWRITE_BREAK_CONDITION
+{
+ /// <summary>
+ /// Whether a break is allowed is determined by the condition of the
+ /// neighboring text span or inline object.
+ /// </summary>
+ DWRITE_BREAK_CONDITION_NEUTRAL,
+
+ /// <summary>
+ /// A break is allowed, unless overruled by the condition of the
+ /// neighboring text span or inline object, either prohibited by a
+ /// May Not or forced by a Must.
+ /// </summary>
+ DWRITE_BREAK_CONDITION_CAN_BREAK,
+
+ /// <summary>
+ /// There should be no break, unless overruled by a Must condition from
+ /// the neighboring text span or inline object.
+ /// </summary>
+ DWRITE_BREAK_CONDITION_MAY_NOT_BREAK,
+
+ /// <summary>
+ /// The break must happen, regardless of the condition of the adjacent
+ /// text span or inline object.
+ /// </summary>
+ DWRITE_BREAK_CONDITION_MUST_BREAK
+};
+
+/// <summary>
+/// Line breakpoint characteristics of a character.
+/// </summary>
+struct DWRITE_LINE_BREAKPOINT
+{
+ /// <summary>
+ /// Breaking condition before the character.
+ /// </summary>
+ UINT8 breakConditionBefore : 2;
+
+ /// <summary>
+ /// Breaking condition after the character.
+ /// </summary>
+ UINT8 breakConditionAfter : 2;
+
+ /// <summary>
+ /// The character is some form of whitespace, which may be meaningful
+ /// for justification.
+ /// </summary>
+ UINT8 isWhitespace : 1;
+
+ /// <summary>
+ /// The character is a soft hyphen, often used to indicate hyphenation
+ /// points inside words.
+ /// </summary>
+ UINT8 isSoftHyphen : 1;
+
+ UINT8 padding : 2;
+};
+
+/// <summary>
+/// How to apply number substitution on digits and related punctuation.
+/// </summary>
+enum DWRITE_NUMBER_SUBSTITUTION_METHOD
+{
+ /// <summary>
+ /// Specifies that the substitution method should be determined based
+ /// on LOCALE_IDIGITSUBSTITUTION value of the specified text culture.
+ /// </summary>
+ DWRITE_NUMBER_SUBSTITUTION_METHOD_FROM_CULTURE,
+
+ /// <summary>
+ /// If the culture is Arabic or Farsi, specifies that the number shape
+ /// depend on the context. Either traditional or nominal number shape
+ /// are used depending on the nearest preceding strong character or (if
+ /// there is none) the reading direction of the paragraph.
+ /// </summary>
+ DWRITE_NUMBER_SUBSTITUTION_METHOD_CONTEXTUAL,
+
+ /// <summary>
+ /// Specifies that code points 0x30-0x39 are always rendered as nominal numeral
+ /// shapes (ones of the European number), i.e., no substitution is performed.
+ /// </summary>
+ DWRITE_NUMBER_SUBSTITUTION_METHOD_NONE,
+
+ /// <summary>
+ /// Specifies that number are rendered using the national number shape
+ /// as specified by the LOCALE_SNATIVEDIGITS value of the specified text culture.
+ /// </summary>
+ DWRITE_NUMBER_SUBSTITUTION_METHOD_NATIONAL,
+
+ /// <summary>
+ /// Specifies that number are rendered using the traditional shape
+ /// for the specified culture. For most cultures, this is the same as
+ /// NativeNational. However, NativeNational results in Latin number
+ /// for some Arabic cultures, whereas this value results in Arabic
+ /// number for all Arabic cultures.
+ /// </summary>
+ DWRITE_NUMBER_SUBSTITUTION_METHOD_TRADITIONAL
+};
+
+/// <summary>
+/// Holds the appropriate digits and numeric punctuation for a given locale.
+/// </summary>
+interface DECLSPEC_UUID("14885CC9-BAB0-4f90-B6ED-5C366A2CD03D") DECLSPEC_NOVTABLE IDWriteNumberSubstitution : public IUnknown
+{
+};
+
+/// <summary>
+/// Shaping output properties per input character.
+/// </summary>
+struct DWRITE_SHAPING_TEXT_PROPERTIES
+{
+ /// <summary>
+ /// This character can be shaped independently from the others
+ /// (usually set for the space character).
+ /// </summary>
+ UINT16 isShapedAlone : 1;
+
+ /// <summary>
+ /// Reserved for use by shaping engine.
+ /// </summary>
+ UINT16 reserved : 15;
+};
+
+/// <summary>
+/// Shaping output properties per output glyph.
+/// </summary>
+struct DWRITE_SHAPING_GLYPH_PROPERTIES
+{
+ /// <summary>
+ /// Justification class, whether to use spacing, kashidas, or
+ /// another method. This exists for backwards compatibility
+ /// with Uniscribe's SCRIPT_JUSTIFY enum.
+ /// </summary>
+ UINT16 justification : 4;
+
+ /// <summary>
+ /// Indicates glyph is the first of a cluster.
+ /// </summary>
+ UINT16 isClusterStart : 1;
+
+ /// <summary>
+ /// Glyph is a diacritic.
+ /// </summary>
+ UINT16 isDiacritic : 1;
+
+ /// <summary>
+ /// Glyph has no width, blank, ZWJ, ZWNJ etc.
+ /// </summary>
+ UINT16 isZeroWidthSpace : 1;
+
+ /// <summary>
+ /// Reserved for use by shaping engine.
+ /// </summary>
+ UINT16 reserved : 9;
+};
+
+/// <summary>
+/// The interface implemented by the text analyzer's client to provide text to
+/// the analyzer. It allows the separation between the logical view of text as
+/// a continuous stream of characters identifiable by unique text positions,
+/// and the actual memory layout of potentially discrete blocks of text in the
+/// client's backing store.
+///
+/// If any of these callbacks returns an error, the analysis functions will
+/// stop prematurely and return a callback error. Rather than return E_NOTIMPL,
+/// an application should stub the method and return a constant/null and S_OK.
+/// </summary>
+interface DECLSPEC_UUID("688e1a58-5094-47c8-adc8-fbcea60ae92b") DECLSPEC_NOVTABLE IDWriteTextAnalysisSource : public IUnknown
+{
+ /// <summary>
+ /// Get a block of text starting at the specified text position.
+ /// Returning NULL indicates the end of text - the position is after
+ /// the last character. This function is called iteratively for
+ /// each consecutive block, tying together several fragmented blocks
+ /// in the backing store into a virtual contiguous string.
+ /// </summary>
+ /// <param name="textPosition">First position of the piece to obtain. All
+ /// positions are in UTF16 code-units, not whole characters, which
+ /// matters when supplementary characters are used.</param>
+ /// <param name="textString">Address that receives a pointer to the text block
+ /// at the specified position.</param>
+ /// <param name="textLength">Number of UTF16 units of the retrieved chunk.
+ /// The returned length is not the length of the block, but the length
+ /// remaining in the block, from the given position until its end.
+ /// So querying for a position that is 75 positions into a 100
+ /// postition block would return 25.</param>
+ /// <returns>Pointer to the first character at the given text position.
+ /// NULL indicates no chunk available at the specified position, either
+ /// because textPosition >= the entire text content length or because the
+ /// queried position is not mapped into the app's backing store.</returns>
+ /// <remarks>
+ /// Although apps can implement sparse textual content that only maps part of
+ /// the backing store, the app must map any text that is in the range passed
+ /// to any analysis functions.
+ /// </remarks>
+ STDMETHOD(GetTextAtPosition)(
+ UINT32 textPosition,
+ __out WCHAR const** textString,
+ __out UINT32* textLength
+ ) PURE;
+
+ /// <summary>
+ /// Get a block of text immediately preceding the specified position.
+ /// </summary>
+ /// <param name="textPosition">Position immediately after the last position of the chunk to obtain.</param>
+ /// <param name="textString">Address that receives a pointer to the text block
+ /// at the specified position.</param>
+ /// <param name="textLength">Number of UTF16 units of the retrieved block.
+ /// The length returned is from the given position to the front of
+ /// the block.</param>
+ /// <returns>Pointer to the first character at (textPosition - textLength).
+ /// NULL indicates no chunk available at the specified position, either
+ /// because textPosition == 0,the textPosition > the entire text content
+ /// length, or the queried position is not mapped into the app's backing
+ /// store.</returns>
+ /// <remarks>
+ /// Although apps can implement sparse textual content that only maps part of
+ /// the backing store, the app must map any text that is in the range passed
+ /// to any analysis functions.
+ /// </remarks>
+ STDMETHOD(GetTextBeforePosition)(
+ UINT32 textPosition,
+ __out WCHAR const** textString,
+ __out UINT32* textLength
+ ) PURE;
+
+ /// <summary>
+ /// Get paragraph reading direction.
+ /// </summary>
+ STDMETHOD_(DWRITE_READING_DIRECTION, GetParagraphReadingDirection)() PURE;
+
+ /// <summary>
+ /// Get locale name on the range affected by it.
+ /// </summary>
+ /// <param name="textPosition">Position to get the locale name of.</param>
+ /// <param name="textLength">Receives the length from the given position up to the
+ /// next differing locale.</param>
+ /// <param name="localeName">Address that receives a pointer to the locale
+ /// at the specified position.</param>
+ /// <remarks>
+ /// The localeName pointer must remain valid until the next call or until
+ /// the analysis returns.
+ /// </remarks>
+ STDMETHOD(GetLocaleName)(
+ UINT32 textPosition,
+ __out UINT32* textLength,
+ __out_z WCHAR const** localeName
+ ) PURE;
+
+ /// <summary>
+ /// Get number substitution on the range affected by it.
+ /// </summary>
+ /// <param name="textPosition">Position to get the number substitution of.</param>
+ /// <param name="textLength">Receives the length from the given position up to the
+ /// next differing number substitution.</param>
+ /// <param name="numberSubstitution">Address that receives a pointer to the number substitution
+ /// at the specified position.</param>
+ /// <remarks>
+ /// Any implementation should return the number substitution with an
+ /// incremented ref count, and the analysis will release when finished
+ /// with it (either before the next call or before it returns). However,
+ /// the sink callback may hold onto it after that.
+ /// </remarks>
+ STDMETHOD(GetNumberSubstitution)(
+ UINT32 textPosition,
+ __out UINT32* textLength,
+ __out IDWriteNumberSubstitution** numberSubstitution
+ ) PURE;
+};
+
+/// <summary>
+/// The interface implemented by the text analyzer's client to receive the
+/// output of a given text analysis. The Text analyzer disregards any current
+/// state of the analysis sink, therefore a Set method call on a range
+/// overwrites the previously set analysis result of the same range.
+/// </summary>
+interface DECLSPEC_UUID("5810cd44-0ca0-4701-b3fa-bec5182ae4f6") DECLSPEC_NOVTABLE IDWriteTextAnalysisSink : public IUnknown
+{
+ /// <summary>
+ /// Report script analysis for the text range.
+ /// </summary>
+ /// <param name="textPosition">Starting position to report from.</param>
+ /// <param name="textLength">Number of UTF16 units of the reported range.</param>
+ /// <param name="scriptAnalysis">Script analysis of characters in range.</param>
+ /// <returns>
+ /// A successful code or error code to abort analysis.
+ /// </returns>
+ STDMETHOD(SetScriptAnalysis)(
+ UINT32 textPosition,
+ UINT32 textLength,
+ __in DWRITE_SCRIPT_ANALYSIS const* scriptAnalysis
+ ) PURE;
+
+ /// <summary>
+ /// Repport line-break opportunities for each character, starting from
+ /// the specified position.
+ /// </summary>
+ /// <param name="textPosition">Starting position to report from.</param>
+ /// <param name="textLength">Number of UTF16 units of the reported range.</param>
+ /// <param name="lineBreakpoints">Breaking conditions for each character.</param>
+ /// <returns>
+ /// A successful code or error code to abort analysis.
+ /// </returns>
+ STDMETHOD(SetLineBreakpoints)(
+ UINT32 textPosition,
+ UINT32 textLength,
+ __in_ecount(textLength) DWRITE_LINE_BREAKPOINT const* lineBreakpoints
+ ) PURE;
+
+ /// <summary>
+ /// Set bidirectional level on the range, called once per each
+ /// level run change (either explicit or resolved implicit).
+ /// </summary>
+ /// <param name="textPosition">Starting position to report from.</param>
+ /// <param name="textLength">Number of UTF16 units of the reported range.</param>
+ /// <param name="explicitLevel">Explicit level from embedded control codes
+ /// RLE/RLO/LRE/LRO/PDF, determined before any additional rules.</param>
+ /// <param name="resolvedLevel">Final implicit level considering the
+ /// explicit level and characters' natural directionality, after all
+ /// Bidi rules have been applied.</param>
+ /// <returns>
+ /// A successful code or error code to abort analysis.
+ /// </returns>
+ STDMETHOD(SetBidiLevel)(
+ UINT32 textPosition,
+ UINT32 textLength,
+ UINT8 explicitLevel,
+ UINT8 resolvedLevel
+ ) PURE;
+
+ /// <summary>
+ /// Set number substitution on the range.
+ /// </summary>
+ /// <param name="textPosition">Starting position to report from.</param>
+ /// <param name="textLength">Number of UTF16 units of the reported range.</param>
+ /// <param name="numberSubstitution">The number substitution applicable to
+ /// the returned range of text. The sink callback may hold onto it by
+ /// incrementing its ref count.</param>
+ /// <returns>
+ /// A successful code or error code to abort analysis.
+ /// </returns>
+ /// <remark>
+ /// Unlike script and bidi analysis, where every character passed to the
+ /// analyzer has a result, this will only be called for those ranges where
+ /// substitution is applicable. For any other range, you will simply not
+ /// be called.
+ /// </remark>
+ STDMETHOD(SetNumberSubstitution)(
+ UINT32 textPosition,
+ UINT32 textLength,
+ __notnull IDWriteNumberSubstitution* numberSubstitution
+ ) PURE;
+};
+
+/// <summary>
+/// Analyzes various text properties for complex script processing.
+/// </summary>
+interface DWRITE_DECLARE_INTERFACE("b7e6163e-7f46-43b4-84b3-e4e6249c365d") IDWriteTextAnalyzer : public IUnknown
+{
+ /// <summary>
+ /// Analyzes a text range for script boundaries, reading text attributes
+ /// from the source and reporting the Unicode script ID to the sink
+ /// callback SetScript.
+ /// </summary>
+ /// <param name="analysisSource">Source object to analyze.</param>
+ /// <param name="textPosition">Starting position within the source object.</param>
+ /// <param name="textLength">Length to analyze.</param>
+ /// <param name="analysisSink">Callback object.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(AnalyzeScript)(
+ IDWriteTextAnalysisSource* analysisSource,
+ UINT32 textPosition,
+ UINT32 textLength,
+ IDWriteTextAnalysisSink* analysisSink
+ ) PURE;
+
+ /// <summary>
+ /// Analyzes a text range for script directionality, reading attributes
+ /// from the source and reporting levels to the sink callback SetBidiLevel.
+ /// </summary>
+ /// <param name="analysisSource">Source object to analyze.</param>
+ /// <param name="textPosition">Starting position within the source object.</param>
+ /// <param name="textLength">Length to analyze.</param>
+ /// <param name="analysisSink">Callback object.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ /// <remarks>
+ /// While the function can handle multiple paragraphs, the text range
+ /// should not arbitrarily split the middle of paragraphs. Otherwise the
+ /// returned levels may be wrong, since the Bidi algorithm is meant to
+ /// apply to the paragraph as a whole.
+ /// </remarks>
+ /// <remarks>
+ /// Embedded control codes (LRE/LRO/RLE/RLO/PDF) are taken into account.
+ /// </remarks>
+ STDMETHOD(AnalyzeBidi)(
+ IDWriteTextAnalysisSource* analysisSource,
+ UINT32 textPosition,
+ UINT32 textLength,
+ IDWriteTextAnalysisSink* analysisSink
+ ) PURE;
+
+ /// <summary>
+ /// Analyzes a text range for spans where number substitution is applicable,
+ /// reading attributes from the source and reporting substitutable ranges
+ /// to the sink callback SetNumberSubstitution.
+ /// </summary>
+ /// <param name="analysisSource">Source object to analyze.</param>
+ /// <param name="textPosition">Starting position within the source object.</param>
+ /// <param name="textLength">Length to analyze.</param>
+ /// <param name="analysisSink">Callback object.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ /// <remarks>
+ /// While the function can handle multiple ranges of differing number
+ /// substitutions, the text ranges should not arbitrarily split the
+ /// middle of numbers. Otherwise it will treat the numbers separately
+ /// and will not translate any intervening punctuation.
+ /// </remarks>
+ /// <remarks>
+ /// Embedded control codes (LRE/LRO/RLE/RLO/PDF) are taken into account.
+ /// </remarks>
+ STDMETHOD(AnalyzeNumberSubstitution)(
+ IDWriteTextAnalysisSource* analysisSource,
+ UINT32 textPosition,
+ UINT32 textLength,
+ IDWriteTextAnalysisSink* analysisSink
+ ) PURE;
+
+ /// <summary>
+ /// Analyzes a text range for potential breakpoint opportunities, reading
+ /// attributes from the source and reporting breakpoint opportunities to
+ /// the sink callback SetLineBreakpoints.
+ /// </summary>
+ /// <param name="analysisSource">Source object to analyze.</param>
+ /// <param name="textPosition">Starting position within the source object.</param>
+ /// <param name="textLength">Length to analyze.</param>
+ /// <param name="analysisSink">Callback object.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ /// <remarks>
+ /// While the function can handle multiple paragraphs, the text range
+ /// should not arbitrarily split the middle of paragraphs, unless the
+ /// given text span is considered a whole unit. Otherwise the
+ /// returned properties for the first and last characters will
+ /// inappropriately allow breaks.
+ /// </remarks>
+ /// <remarks>
+ /// Special cases include the first, last, and surrogate characters. Any
+ /// text span is treated as if adjacent to inline objects on either side.
+ /// So the rules with contingent-break opportunities are used, where the
+ /// edge between text and inline objects is always treated as a potential
+ /// break opportunity, dependent on any overriding rules of the adjacent
+ /// objects to prohibit or force the break (see Unicode TR #14).
+ /// Surrogate pairs never break between.
+ /// </remarks>
+ STDMETHOD(AnalyzeLineBreakpoints)(
+ IDWriteTextAnalysisSource* analysisSource,
+ UINT32 textPosition,
+ UINT32 textLength,
+ IDWriteTextAnalysisSink* analysisSink
+ ) PURE;
+
+ /// <summary>
+ /// Parses the input text string and maps it to the set of glyphs and associated glyph data
+ /// according to the font and the writing system's rendering rules.
+ /// </summary>
+ /// <param name="textString">The string to convert to glyphs.</param>
+ /// <param name="textLength">The length of textString.</param>
+ /// <param name="fontFace">The font face to get glyphs from.</param>
+ /// <param name="isSideways">Set to true if the text is intended to be
+ /// drawn vertically.</param>
+ /// <param name="isRightToLeft">Set to TRUE for right-to-left text.</param>
+ /// <param name="scriptAnalysis">Script analysis result from AnalyzeScript.</param>
+ /// <param name="localeName">The locale to use when selecting glyphs.
+ /// e.g. the same character may map to different glyphs for ja-jp vs zh-chs.
+ /// If this is NULL then the default mapping based on the script is used.</param>
+ /// <param name="numberSubstitution">Optional number substitution which
+ /// selects the appropriate glyphs for digits and related numeric characters,
+ /// depending on the results obtained from AnalyzeNumberSubstitution. Passing
+ /// null indicates that no substitution is needed and that the digits should
+ /// receive nominal glyphs.</param>
+ /// <param name="features">An array of pointers to the sets of typographic
+ /// features to use in each feature range.</param>
+ /// <param name="featureRangeLengths">The length of each feature range, in characters.
+ /// The sum of all lengths should be equal to textLength.</param>
+ /// <param name="featureRanges">The number of feature ranges.</param>
+ /// <param name="maxGlyphCount">The maximum number of glyphs that can be
+ /// returned.</param>
+ /// <param name="clusterMap">The mapping from character ranges to glyph
+ /// ranges.</param>
+ /// <param name="textProps">Per-character output properties.</param>
+ /// <param name="glyphIndices">Output glyph indices.</param>
+ /// <param name="glyphProps">Per-glyph output properties.</param>
+ /// <param name="actualGlyphCount">The actual number of glyphs returned if
+ /// the call succeeds.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ /// <remarks>
+ /// Note that the mapping from characters to glyphs is, in general, many-
+ /// to-many. The recommended estimate for the per-glyph output buffers is
+ /// (3 * textLength / 2 + 16). This is not guaranteed to be sufficient.
+ ///
+ /// The value of the actualGlyphCount parameter is only valid if the call
+ /// succeeds. In the event that maxGlyphCount is not big enough
+ /// E_NOT_SUFFICIENT_BUFFER, which is equivalent to HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER),
+ /// will be returned. The application should allocate a larger buffer and try again.
+ /// </remarks>
+ STDMETHOD(GetGlyphs)(
+ __in_ecount(textLength) WCHAR const* textString,
+ UINT32 textLength,
+ IDWriteFontFace* fontFace,
+ BOOL isSideways,
+ BOOL isRightToLeft,
+ __in DWRITE_SCRIPT_ANALYSIS const* scriptAnalysis,
+ __in_z_opt WCHAR const* localeName,
+ __maybenull IDWriteNumberSubstitution* numberSubstitution,
+ __in_ecount_opt(featureRanges) DWRITE_TYPOGRAPHIC_FEATURES const** features,
+ __in_ecount_opt(featureRanges) UINT32 const* featureRangeLengths,
+ UINT32 featureRanges,
+ UINT32 maxGlyphCount,
+ __out_ecount(textLength) UINT16* clusterMap,
+ __out_ecount(textLength) DWRITE_SHAPING_TEXT_PROPERTIES* textProps,
+ __out_ecount(maxGlyphCount) UINT16* glyphIndices,
+ __out_ecount(maxGlyphCount) DWRITE_SHAPING_GLYPH_PROPERTIES* glyphProps,
+ __out UINT32* actualGlyphCount
+ ) PURE;
+
+ /// <summary>
+ /// Place glyphs output from the GetGlyphs method according to the font
+ /// and the writing system's rendering rules.
+ /// </summary>
+ /// <param name="textString">The original string the glyphs came from.</param>
+ /// <param name="clusterMap">The mapping from character ranges to glyph
+ /// ranges. Returned by GetGlyphs.</param>
+ /// <param name="textProps">Per-character properties. Returned by
+ /// GetGlyphs.</param>
+ /// <param name="textLength">The length of textString.</param>
+ /// <param name="glyphIndices">Glyph indices. See GetGlyphs</param>
+ /// <param name="glyphProps">Per-glyph properties. See GetGlyphs</param>
+ /// <param name="glyphCount">The number of glyphs.</param>
+ /// <param name="fontFace">The font face the glyphs came from.</param>
+ /// <param name="fontEmSize">Logical font size in DIP's.</param>
+ /// <param name="isSideways">Set to true if the text is intended to be
+ /// drawn vertically.</param>
+ /// <param name="isRightToLeft">Set to TRUE for right-to-left text.</param>
+ /// <param name="scriptAnalysis">Script analysis result from AnalyzeScript.</param>
+ /// <param name="localeName">The locale to use when selecting glyphs.
+ /// e.g. the same character may map to different glyphs for ja-jp vs zh-chs.
+ /// If this is NULL then the default mapping based on the script is used.</param>
+ /// <param name="features">An array of pointers to the sets of typographic
+ /// features to use in each feature range.</param>
+ /// <param name="featureRangeLengths">The length of each feature range, in characters.
+ /// The sum of all lengths should be equal to textLength.</param>
+ /// <param name="featureRanges">The number of feature ranges.</param>
+ /// <param name="glyphAdvances">The advance width of each glyph.</param>
+ /// <param name="glyphOffsets">The offset of the origin of each glyph.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(GetGlyphPlacements)(
+ __in_ecount(textLength) WCHAR const* textString,
+ __in_ecount(textLength) UINT16 const* clusterMap,
+ __in_ecount(textLength) DWRITE_SHAPING_TEXT_PROPERTIES* textProps,
+ UINT32 textLength,
+ __in_ecount(glyphCount) UINT16 const* glyphIndices,
+ __in_ecount(glyphCount) DWRITE_SHAPING_GLYPH_PROPERTIES const* glyphProps,
+ UINT32 glyphCount,
+ IDWriteFontFace * fontFace,
+ FLOAT fontEmSize,
+ BOOL isSideways,
+ BOOL isRightToLeft,
+ __in DWRITE_SCRIPT_ANALYSIS const* scriptAnalysis,
+ __in_z_opt WCHAR const* localeName,
+ __in_ecount_opt(featureRanges) DWRITE_TYPOGRAPHIC_FEATURES const** features,
+ __in_ecount_opt(featureRanges) UINT32 const* featureRangeLengths,
+ UINT32 featureRanges,
+ __out_ecount(glyphCount) FLOAT* glyphAdvances,
+ __out_ecount(glyphCount) DWRITE_GLYPH_OFFSET* glyphOffsets
+ ) PURE;
+
+ /// <summary>
+ /// Place glyphs output from the GetGlyphs method according to the font
+ /// and the writing system's rendering rules.
+ /// </summary>
+ /// <param name="textString">The original string the glyphs came from.</param>
+ /// <param name="clusterMap">The mapping from character ranges to glyph
+ /// ranges. Returned by GetGlyphs.</param>
+ /// <param name="textProps">Per-character properties. Returned by
+ /// GetGlyphs.</param>
+ /// <param name="textLength">The length of textString.</param>
+ /// <param name="glyphIndices">Glyph indices. See GetGlyphs</param>
+ /// <param name="glyphProps">Per-glyph properties. See GetGlyphs</param>
+ /// <param name="glyphCount">The number of glyphs.</param>
+ /// <param name="fontFace">The font face the glyphs came from.</param>
+ /// <param name="fontEmSize">Logical font size in DIP's.</param>
+ /// <param name="pixelsPerDip">Number of physical pixels per DIP. For example, if the DPI of the rendering surface is 96 this
+ /// value is 1.0f. If the DPI is 120, this value is 120.0f/96.</param>
+ /// <param name="transform">Optional transform applied to the glyphs and their positions. This transform is applied after the
+ /// scaling specified by the font size and pixelsPerDip.</param>
+ /// <param name="useGdiNatural">
+ /// When set to FALSE, the metrics are the same as the metrics of GDI aliased text.
+ /// When set to TRUE, the metrics are the same as the metrics of text measured by GDI using a font
+ /// created with CLEARTYPE_NATURAL_QUALITY.
+ /// </param>
+ /// <param name="isSideways">Set to true if the text is intended to be
+ /// drawn vertically.</param>
+ /// <param name="isRightToLeft">Set to TRUE for right-to-left text.</param>
+ /// <param name="scriptAnalysis">Script analysis result from AnalyzeScript.</param>
+ /// <param name="localeName">The locale to use when selecting glyphs.
+ /// e.g. the same character may map to different glyphs for ja-jp vs zh-chs.
+ /// If this is NULL then the default mapping based on the script is used.</param>
+ /// <param name="features">An array of pointers to the sets of typographic
+ /// features to use in each feature range.</param>
+ /// <param name="featureRangeLengths">The length of each feature range, in characters.
+ /// The sum of all lengths should be equal to textLength.</param>
+ /// <param name="featureRanges">The number of feature ranges.</param>
+ /// <param name="glyphAdvances">The advance width of each glyph.</param>
+ /// <param name="glyphOffsets">The offset of the origin of each glyph.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(GetGdiCompatibleGlyphPlacements)(
+ __in_ecount(textLength) WCHAR const* textString,
+ __in_ecount(textLength) UINT16 const* clusterMap,
+ __in_ecount(textLength) DWRITE_SHAPING_TEXT_PROPERTIES* textProps,
+ UINT32 textLength,
+ __in_ecount(glyphCount) UINT16 const* glyphIndices,
+ __in_ecount(glyphCount) DWRITE_SHAPING_GLYPH_PROPERTIES const* glyphProps,
+ UINT32 glyphCount,
+ IDWriteFontFace * fontFace,
+ FLOAT fontEmSize,
+ FLOAT pixelsPerDip,
+ __in_opt DWRITE_MATRIX const* transform,
+ BOOL useGdiNatural,
+ BOOL isSideways,
+ BOOL isRightToLeft,
+ __in DWRITE_SCRIPT_ANALYSIS const* scriptAnalysis,
+ __in_z_opt WCHAR const* localeName,
+ __in_ecount_opt(featureRanges) DWRITE_TYPOGRAPHIC_FEATURES const** features,
+ __in_ecount_opt(featureRanges) UINT32 const* featureRangeLengths,
+ UINT32 featureRanges,
+ __out_ecount(glyphCount) FLOAT* glyphAdvances,
+ __out_ecount(glyphCount) DWRITE_GLYPH_OFFSET* glyphOffsets
+ ) PURE;
+};
+
+/// <summary>
+/// The DWRITE_GLYPH_RUN structure contains the information needed by renderers
+/// to draw glyph runs. All coordinates are in device independent pixels (DIPs).
+/// </summary>
+struct DWRITE_GLYPH_RUN
+{
+ /// <summary>
+ /// The physical font face to draw with.
+ /// </summary>
+ __notnull IDWriteFontFace* fontFace;
+
+ /// <summary>
+ /// Logical size of the font in DIPs, not points (equals 1/96 inch).
+ /// </summary>
+ FLOAT fontEmSize;
+
+ /// <summary>
+ /// The number of glyphs.
+ /// </summary>
+ UINT32 glyphCount;
+
+ /// <summary>
+ /// The indices to render.
+ /// </summary>
+ __field_ecount(glyphCount) UINT16 const* glyphIndices;
+
+ /// <summary>
+ /// Glyph advance widths.
+ /// </summary>
+ __field_ecount_opt(glyphCount) FLOAT const* glyphAdvances;
+
+ /// <summary>
+ /// Glyph offsets.
+ /// </summary>
+ __field_ecount_opt(glyphCount) DWRITE_GLYPH_OFFSET const* glyphOffsets;
+
+ /// <summary>
+ /// If true, specifies that glyphs are rotated 90 degrees to the left and
+ /// vertical metrics are used. Vertical writing is achieved by specifying
+ /// isSideways = true and rotating the entire run 90 degrees to the right
+ /// via a rotate transform.
+ /// </summary>
+ BOOL isSideways;
+
+ /// <summary>
+ /// The implicit resolved bidi level of the run. Odd levels indicate
+ /// right-to-left languages like Hebrew and Arabic, while even levels
+ /// indicate left-to-right languages like English and Japanese (when
+ /// written horizontally). For right-to-left languages, the text origin
+ /// is on the right, and text should be drawn to the left.
+ /// </summary>
+ UINT32 bidiLevel;
+};
+
+/// <summary>
+/// The DWRITE_GLYPH_RUN_DESCRIPTION structure contains additional properties
+/// related to those in DWRITE_GLYPH_RUN.
+/// </summary>
+struct DWRITE_GLYPH_RUN_DESCRIPTION
+{
+ /// <summary>
+ /// The locale name associated with this run.
+ /// </summary>
+ __nullterminated WCHAR const* localeName;
+
+ /// <summary>
+ /// The text associated with the glyphs.
+ /// </summary>
+ __field_ecount(stringLength) WCHAR const* string;
+
+ /// <summary>
+ /// The number of characters (UTF16 code-units).
+ /// Note that this may be different than the number of glyphs.
+ /// </summary>
+ UINT32 stringLength;
+
+ /// <summary>
+ /// An array of indices to the glyph indices array, of the first glyphs of
+ /// all the glyph clusters of the glyphs to render.
+ /// </summary>
+ __field_ecount(stringLength) UINT16 const* clusterMap;
+
+ /// <summary>
+ /// Corresponding text position in the original string
+ /// this glyph run came from.
+ /// </summary>
+ UINT32 textPosition;
+};
+
+/// <summary>
+/// The DWRITE_UNDERLINE structure contains about the size and placement of
+/// underlines. All coordinates are in device independent pixels (DIPs).
+/// </summary>
+struct DWRITE_UNDERLINE
+{
+ /// <summary>
+ /// Width of the underline, measured parallel to the baseline.
+ /// </summary>
+ FLOAT width;
+
+ /// <summary>
+ /// Thickness of the underline, measured perpendicular to the
+ /// baseline.
+ /// </summary>
+ FLOAT thickness;
+
+ /// <summary>
+ /// Offset of the underline from the baseline.
+ /// A positive offset represents a position below the baseline and
+ /// a negative offset is above.
+ /// </summary>
+ FLOAT offset;
+
+ /// <summary>
+ /// Height of the tallest run where the underline applies.
+ /// </summary>
+ FLOAT runHeight;
+
+ /// <summary>
+ /// Reading direction of the text associated with the underline. This
+ /// value is used to interpret whether the width value runs horizontally
+ /// or vertically.
+ /// </summary>
+ DWRITE_READING_DIRECTION readingDirection;
+
+ /// <summary>
+ /// Flow direction of the text associated with the underline. This value
+ /// is used to interpret whether the thickness value advances top to
+ /// bottom, left to right, or right to left.
+ /// </summary>
+ DWRITE_FLOW_DIRECTION flowDirection;
+
+ /// <summary>
+ /// Locale of the text the underline is being drawn under. Can be
+ /// pertinent where the locale affects how the underline is drawn.
+ /// For example, in vertical text, the underline belongs on the
+ /// left for Chinese but on the right for Japanese.
+ /// This choice is completely left up to higher levels.
+ /// </summary>
+ __nullterminated WCHAR const* localeName;
+
+ /// <summary>
+ /// The measuring mode can be useful to the renderer to determine how
+ /// underlines are rendered, e.g. rounding the thickness to a whole pixel
+ /// in GDI-compatible modes.
+ /// </summary>
+ DWRITE_MEASURING_MODE measuringMode;
+};
+
+/// <summary>
+/// The DWRITE_STRIKETHROUGH structure contains about the size and placement of
+/// strickthroughs. All coordinates are in device independent pixels (DIPs).
+/// </summary>
+struct DWRITE_STRIKETHROUGH
+{
+ /// <summary>
+ /// Width of the strikethrough, measured parallel to the baseline.
+ /// </summary>
+ FLOAT width;
+
+ /// <summary>
+ /// Thickness of the strikethrough, measured perpendicular to the
+ /// baseline.
+ /// </summary>
+ FLOAT thickness;
+
+ /// <summary>
+ /// Offset of the stikethrough from the baseline.
+ /// A positive offset represents a position below the baseline and
+ /// a negative offset is above.
+ /// </summary>
+ FLOAT offset;
+
+ /// <summary>
+ /// Reading direction of the text associated with the strikethrough. This
+ /// value is used to interpret whether the width value runs horizontally
+ /// or vertically.
+ /// </summary>
+ DWRITE_READING_DIRECTION readingDirection;
+
+ /// <summary>
+ /// Flow direction of the text associated with the strikethrough. This
+ /// value is used to interpret whether the thickness value advances top to
+ /// bottom, left to right, or right to left.
+ /// </summary>
+ DWRITE_FLOW_DIRECTION flowDirection;
+
+ /// <summary>
+ /// Locale of the range. Can be pertinent where the locale affects the style.
+ /// </summary>
+ __nullterminated WCHAR const* localeName;
+
+ /// <summary>
+ /// The measuring mode can be useful to the renderer to determine how
+ /// underlines are rendered, e.g. rounding the thickness to a whole pixel
+ /// in GDI-compatible modes.
+ /// </summary>
+ DWRITE_MEASURING_MODE measuringMode;
+};
+
+/// <summary>
+/// The DWRITE_LINE_METRICS structure contains information about a formatted
+/// line of text.
+/// </summary>
+struct DWRITE_LINE_METRICS
+{
+ /// <summary>
+ /// The number of total text positions in the line.
+ /// This includes any trailing whitespace and newline characters.
+ /// </summary>
+ UINT32 length;
+
+ /// <summary>
+ /// The number of whitespace positions at the end of the line. Newline
+ /// sequences are considered whitespace.
+ /// </summary>
+ UINT32 trailingWhitespaceLength;
+
+ /// <summary>
+ /// The number of characters in the newline sequence at the end of the line.
+ /// If the count is zero, then the line was either wrapped or it is the
+ /// end of the text.
+ /// </summary>
+ UINT32 newlineLength;
+
+ /// <summary>
+ /// Height of the line as measured from top to bottom.
+ /// </summary>
+ FLOAT height;
+
+ /// <summary>
+ /// Distance from the top of the line to its baseline.
+ /// </summary>
+ FLOAT baseline;
+
+ /// <summary>
+ /// The line is trimmed.
+ /// </summary>
+ BOOL isTrimmed;
+};
+
+
+/// <summary>
+/// The DWRITE_CLUSTER_METRICS structure contains information about a glyph cluster.
+/// </summary>
+struct DWRITE_CLUSTER_METRICS
+{
+ /// <summary>
+ /// The total advance width of all glyphs in the cluster.
+ /// </summary>
+ FLOAT width;
+
+ /// <summary>
+ /// The number of text positions in the cluster.
+ /// </summary>
+ UINT16 length;
+
+ /// <summary>
+ /// Indicate whether line can be broken right after the cluster.
+ /// </summary>
+ UINT16 canWrapLineAfter : 1;
+
+ /// <summary>
+ /// Indicate whether the cluster corresponds to whitespace character.
+ /// </summary>
+ UINT16 isWhitespace : 1;
+
+ /// <summary>
+ /// Indicate whether the cluster corresponds to a newline character.
+ /// </summary>
+ UINT16 isNewline : 1;
+
+ /// <summary>
+ /// Indicate whether the cluster corresponds to soft hyphen character.
+ /// </summary>
+ UINT16 isSoftHyphen : 1;
+
+ /// <summary>
+ /// Indicate whether the cluster is read from right to left.
+ /// </summary>
+ UINT16 isRightToLeft : 1;
+
+ UINT16 padding : 11;
+};
+
+
+/// <summary>
+/// Overall metrics associated with text after layout.
+/// All coordinates are in device independent pixels (DIPs).
+/// </summary>
+struct DWRITE_TEXT_METRICS
+{
+ /// <summary>
+ /// Left-most point of formatted text relative to layout box
+ /// (excluding any glyph overhang).
+ /// </summary>
+ FLOAT left;
+
+ /// <summary>
+ /// Top-most point of formatted text relative to layout box
+ /// (excluding any glyph overhang).
+ /// </summary>
+ FLOAT top;
+
+ /// <summary>
+ /// The width of the formatted text ignoring trailing whitespace
+ /// at the end of each line.
+ /// </summary>
+ FLOAT width;
+
+ /// <summary>
+ /// The width of the formatted text taking into account the
+ /// trailing whitespace at the end of each line.
+ /// </summary>
+ FLOAT widthIncludingTrailingWhitespace;
+
+ /// <summary>
+ /// The height of the formatted text. The height of an empty string
+ /// is determined by the size of the default font's line height.
+ /// </summary>
+ FLOAT height;
+
+ /// <summary>
+ /// Initial width given to the layout. Depending on whether the text
+ /// was wrapped or not, it can be either larger or smaller than the
+ /// text content width.
+ /// </summary>
+ FLOAT layoutWidth;
+
+ /// <summary>
+ /// Initial height given to the layout. Depending on the length of the
+ /// text, it may be larger or smaller than the text content height.
+ /// </summary>
+ FLOAT layoutHeight;
+
+ /// <summary>
+ /// The maximum reordering count of any line of text, used
+ /// to calculate the most number of hit-testing boxes needed.
+ /// If the layout has no bidirectional text or no text at all,
+ /// the minimum level is 1.
+ /// </summary>
+ UINT32 maxBidiReorderingDepth;
+
+ /// <summary>
+ /// Total number of lines.
+ /// </summary>
+ UINT32 lineCount;
+};
+
+
+/// <summary>
+/// Properties describing the geometric measurement of an
+/// application-defined inline object.
+/// </summary>
+struct DWRITE_INLINE_OBJECT_METRICS
+{
+ /// <summary>
+ /// Width of the inline object.
+ /// </summary>
+ FLOAT width;
+
+ /// <summary>
+ /// Height of the inline object as measured from top to bottom.
+ /// </summary>
+ FLOAT height;
+
+ /// <summary>
+ /// Distance from the top of the object to the baseline where it is lined up with the adjacent text.
+ /// If the baseline is at the bottom, baseline simply equals height.
+ /// </summary>
+ FLOAT baseline;
+
+ /// <summary>
+ /// Flag indicating whether the object is to be placed upright or alongside the text baseline
+ /// for vertical text.
+ /// </summary>
+ BOOL supportsSideways;
+};
+
+
+/// <summary>
+/// The DWRITE_OVERHANG_METRICS structure holds how much any visible pixels
+/// (in DIPs) overshoot each side of the layout or inline objects.
+/// </summary>
+/// <remarks>
+/// Positive overhangs indicate that the visible area extends outside the layout
+/// box or inline object, while negative values mean there is whitespace inside.
+/// The returned values are unaffected by rendering transforms or pixel snapping.
+/// Additionally, they may not exactly match final target's pixel bounds after
+/// applying grid fitting and hinting.
+/// </remarks>
+struct DWRITE_OVERHANG_METRICS
+{
+ /// <summary>
+ /// The distance from the left-most visible DIP to its left alignment edge.
+ /// </summary>
+ FLOAT left;
+
+ /// <summary>
+ /// The distance from the top-most visible DIP to its top alignment edge.
+ /// </summary>
+ FLOAT top;
+
+ /// <summary>
+ /// The distance from the right-most visible DIP to its right alignment edge.
+ /// </summary>
+ FLOAT right;
+
+ /// <summary>
+ /// The distance from the bottom-most visible DIP to its bottom alignment edge.
+ /// </summary>
+ FLOAT bottom;
+};
+
+
+/// <summary>
+/// Geometry enclosing of text positions.
+/// </summary>
+struct DWRITE_HIT_TEST_METRICS
+{
+ /// <summary>
+ /// First text position within the geometry.
+ /// </summary>
+ UINT32 textPosition;
+
+ /// <summary>
+ /// Number of text positions within the geometry.
+ /// </summary>
+ UINT32 length;
+
+ /// <summary>
+ /// Left position of the top-left coordinate of the geometry.
+ /// </summary>
+ FLOAT left;
+
+ /// <summary>
+ /// Top position of the top-left coordinate of the geometry.
+ /// </summary>
+ FLOAT top;
+
+ /// <summary>
+ /// Geometry's width.
+ /// </summary>
+ FLOAT width;
+
+ /// <summary>
+ /// Geometry's height.
+ /// </summary>
+ FLOAT height;
+
+ /// <summary>
+ /// Bidi level of text positions enclosed within the geometry.
+ /// </summary>
+ UINT32 bidiLevel;
+
+ /// <summary>
+ /// Geometry encloses text?
+ /// </summary>
+ BOOL isText;
+
+ /// <summary>
+ /// Range is trimmed.
+ /// </summary>
+ BOOL isTrimmed;
+};
+
+
+interface IDWriteTextRenderer;
+
+
+/// <summary>
+/// The IDWriteInlineObject interface wraps an application defined inline graphic,
+/// allowing DWrite to query metrics as if it was a glyph inline with the text.
+/// </summary>
+interface DWRITE_DECLARE_INTERFACE("8339FDE3-106F-47ab-8373-1C6295EB10B3") IDWriteInlineObject : public IUnknown
+{
+ /// <summary>
+ /// The application implemented rendering callback (IDWriteTextRenderer::DrawInlineObject)
+ /// can use this to draw the inline object without needing to cast or query the object
+ /// type. The text layout does not call this method directly.
+ /// </summary>
+ /// <param name="clientDrawingContext">The context passed to IDWriteTextLayout::Draw.</param>
+ /// <param name="renderer">The renderer passed to IDWriteTextLayout::Draw as the object's containing parent.</param>
+ /// <param name="originX">X-coordinate at the top-left corner of the inline object.</param>
+ /// <param name="originY">Y-coordinate at the top-left corner of the inline object.</param>
+ /// <param name="isSideways">The object should be drawn on its side.</param>
+ /// <param name="isRightToLeft">The object is in an right-to-left context and should be drawn flipped.</param>
+ /// <param name="clientDrawingEffect">The drawing effect set in IDWriteTextLayout::SetDrawingEffect.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(Draw)(
+ __maybenull void* clientDrawingContext,
+ IDWriteTextRenderer* renderer,
+ FLOAT originX,
+ FLOAT originY,
+ BOOL isSideways,
+ BOOL isRightToLeft,
+ __maybenull IUnknown* clientDrawingEffect
+ ) PURE;
+
+ /// <summary>
+ /// TextLayout calls this callback function to get the measurement of the inline object.
+ /// </summary>
+ /// <param name="metrics">Returned metrics</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(GetMetrics)(
+ __out DWRITE_INLINE_OBJECT_METRICS* metrics
+ ) PURE;
+
+ /// <summary>
+ /// TextLayout calls this callback function to get the visible extents (in DIPs) of the inline object.
+ /// In the case of a simple bitmap, with no padding and no overhang, all the overhangs will
+ /// simply be zeroes.
+ /// </summary>
+ /// <param name="overhangs">Overshoot of visible extents (in DIPs) outside the object.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ /// <remarks>
+ /// The overhangs should be returned relative to the reported size of the object
+ /// (DWRITE_INLINE_OBJECT_METRICS::width/height), and should not be baseline
+ /// adjusted. If you have an image that is actually 100x100 DIPs, but you want it
+ /// slightly inset (perhaps it has a glow) by 20 DIPs on each side, you would
+ /// return a width/height of 60x60 and four overhangs of 20 DIPs.
+ /// </remarks>
+ STDMETHOD(GetOverhangMetrics)(
+ __out DWRITE_OVERHANG_METRICS* overhangs
+ ) PURE;
+
+ /// <summary>
+ /// Layout uses this to determine the line breaking behavior of the inline object
+ /// amidst the text.
+ /// </summary>
+ /// <param name="breakConditionBefore">Line-breaking condition between the object and the content immediately preceding it.</param>
+ /// <param name="breakConditionAfter" >Line-breaking condition between the object and the content immediately following it.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(GetBreakConditions)(
+ __out DWRITE_BREAK_CONDITION* breakConditionBefore,
+ __out DWRITE_BREAK_CONDITION* breakConditionAfter
+ ) PURE;
+};
+
+/// <summary>
+/// The IDWritePixelSnapping interface defines the pixel snapping properties of a text renderer.
+/// </summary>
+interface DWRITE_DECLARE_INTERFACE("eaf3a2da-ecf4-4d24-b644-b34f6842024b") IDWritePixelSnapping : public IUnknown
+{
+ /// <summary>
+ /// Determines whether pixel snapping is disabled. The recommended default is FALSE,
+ /// unless doing animation that requires subpixel vertical placement.
+ /// </summary>
+ /// <param name="clientDrawingContext">The context passed to IDWriteTextLayout::Draw.</param>
+ /// <param name="isDisabled">Receives TRUE if pixel snapping is disabled or FALSE if it not.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(IsPixelSnappingDisabled)(
+ __maybenull void* clientDrawingContext,
+ __out BOOL* isDisabled
+ ) PURE;
+
+ /// <summary>
+ /// Gets the current transform that maps abstract coordinates to DIPs,
+ /// which may disable pixel snapping upon any rotation or shear.
+ /// </summary>
+ /// <param name="clientDrawingContext">The context passed to IDWriteTextLayout::Draw.</param>
+ /// <param name="transform">Receives the transform.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(GetCurrentTransform)(
+ __maybenull void* clientDrawingContext,
+ __out DWRITE_MATRIX* transform
+ ) PURE;
+
+ /// <summary>
+ /// Gets the number of physical pixels per DIP. A DIP (device-independent pixel) is 1/96 inch,
+ /// so the pixelsPerDip value is the number of logical pixels per inch divided by 96 (yielding
+ /// a value of 1 for 96 DPI and 1.25 for 120).
+ /// </summary>
+ /// <param name="clientDrawingContext">The context passed to IDWriteTextLayout::Draw.</param>
+ /// <param name="pixelsPerDip">Receives the number of physical pixels per DIP.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(GetPixelsPerDip)(
+ __maybenull void* clientDrawingContext,
+ __out FLOAT* pixelsPerDip
+ ) PURE;
+};
+
+/// <summary>
+/// The IDWriteTextLayout interface represents a set of application-defined
+/// callbacks that perform rendering of text, inline objects, and decorations
+/// such as underlines.
+/// </summary>
+interface DWRITE_DECLARE_INTERFACE("ef8a8135-5cc6-45fe-8825-c5a0724eb819") IDWriteTextRenderer : public IDWritePixelSnapping
+{
+ /// <summary>
+ /// IDWriteTextLayout::Draw calls this function to instruct the client to
+ /// render a run of glyphs.
+ /// </summary>
+ /// <param name="clientDrawingContext">The context passed to
+ /// IDWriteTextLayout::Draw.</param>
+ /// <param name="baselineOriginX">X-coordinate of the baseline.</param>
+ /// <param name="baselineOriginY">Y-coordinate of the baseline.</param>
+ /// <param name="measuringMode">Specifies measuring method for glyphs in the run.
+ /// Renderer implementations may choose different rendering modes for given measuring methods,
+ /// but best results are seen when the rendering mode matches the corresponding measuring mode:
+ /// DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL for DWRITE_MEASURING_MODE_NATURAL
+ /// DWRITE_RENDERING_MODE_CLEARTYPE_GDI_CLASSIC for DWRITE_MEASURING_MODE_GDI_CLASSIC
+ /// DWRITE_RENDERING_MODE_CLEARTYPE_GDI_NATURAL for DWRITE_MEASURING_MODE_GDI_NATURAL
+ /// </param>
+ /// <param name="glyphRun">The glyph run to draw.</param>
+ /// <param name="glyphRunDescription">Properties of the characters
+ /// associated with this run.</param>
+ /// <param name="clientDrawingEffect">The drawing effect set in
+ /// IDWriteTextLayout::SetDrawingEffect.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(DrawGlyphRun)(
+ __maybenull void* clientDrawingContext,
+ FLOAT baselineOriginX,
+ FLOAT baselineOriginY,
+ DWRITE_MEASURING_MODE measuringMode,
+ __in DWRITE_GLYPH_RUN const* glyphRun,
+ __in DWRITE_GLYPH_RUN_DESCRIPTION const* glyphRunDescription,
+ __maybenull IUnknown* clientDrawingEffect
+ ) PURE;
+
+ /// <summary>
+ /// IDWriteTextLayout::Draw calls this function to instruct the client to draw
+ /// an underline.
+ /// </summary>
+ /// <param name="clientDrawingContext">The context passed to
+ /// IDWriteTextLayout::Draw.</param>
+ /// <param name="baselineOriginX">X-coordinate of the baseline.</param>
+ /// <param name="baselineOriginY">Y-coordinate of the baseline.</param>
+ /// <param name="underline">Underline logical information.</param>
+ /// <param name="clientDrawingEffect">The drawing effect set in
+ /// IDWriteTextLayout::SetDrawingEffect.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ /// <remarks>
+ /// A single underline can be broken into multiple calls, depending on
+ /// how the formatting changes attributes. If font sizes/styles change
+ /// within an underline, the thickness and offset will be averaged
+ /// weighted according to characters.
+ /// To get the correct top coordinate of the underline rect, add underline::offset
+ /// to the baseline's Y. Otherwise the underline will be immediately under the text.
+ /// The x coordinate will always be passed as the left side, regardless
+ /// of text directionality. This simplifies drawing and reduces the
+ /// problem of round-off that could potentially cause gaps or a double
+ /// stamped alpha blend. To avoid alpha overlap, round the end points
+ /// to the nearest device pixel.
+ /// </remarks>
+ STDMETHOD(DrawUnderline)(
+ __maybenull void* clientDrawingContext,
+ FLOAT baselineOriginX,
+ FLOAT baselineOriginY,
+ __in DWRITE_UNDERLINE const* underline,
+ __maybenull IUnknown* clientDrawingEffect
+ ) PURE;
+
+ /// <summary>
+ /// IDWriteTextLayout::Draw calls this function to instruct the client to draw
+ /// a strikethrough.
+ /// </summary>
+ /// <param name="clientDrawingContext">The context passed to
+ /// IDWriteTextLayout::Draw.</param>
+ /// <param name="baselineOriginX">X-coordinate of the baseline.</param>
+ /// <param name="baselineOriginY">Y-coordinate of the baseline.</param>
+ /// <param name="strikethrough">Strikethrough logical information.</param>
+ /// <param name="clientDrawingEffect">The drawing effect set in
+ /// IDWriteTextLayout::SetDrawingEffect.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ /// <remarks>
+ /// A single strikethrough can be broken into multiple calls, depending on
+ /// how the formatting changes attributes. Strikethrough is not averaged
+ /// across font sizes/styles changes.
+ /// To get the correct top coordinate of the strikethrough rect,
+ /// add strikethrough::offset to the baseline's Y.
+ /// Like underlines, the x coordinate will always be passed as the left side,
+ /// regardless of text directionality.
+ /// </remarks>
+ STDMETHOD(DrawStrikethrough)(
+ __maybenull void* clientDrawingContext,
+ FLOAT baselineOriginX,
+ FLOAT baselineOriginY,
+ __in DWRITE_STRIKETHROUGH const* strikethrough,
+ __maybenull IUnknown* clientDrawingEffect
+ ) PURE;
+
+ /// <summary>
+ /// IDWriteTextLayout::Draw calls this application callback when it needs to
+ /// draw an inline object.
+ /// </summary>
+ /// <param name="clientDrawingContext">The context passed to IDWriteTextLayout::Draw.</param>
+ /// <param name="originX">X-coordinate at the top-left corner of the inline object.</param>
+ /// <param name="originY">Y-coordinate at the top-left corner of the inline object.</param>
+ /// <param name="inlineObject">The object set using IDWriteTextLayout::SetInlineObject.</param>
+ /// <param name="isSideways">The object should be drawn on its side.</param>
+ /// <param name="isRightToLeft">The object is in an right-to-left context and should be drawn flipped.</param>
+ /// <param name="clientDrawingEffect">The drawing effect set in
+ /// IDWriteTextLayout::SetDrawingEffect.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ /// <remarks>
+ /// The right-to-left flag is a hint for those cases where it would look
+ /// strange for the image to be shown normally (like an arrow pointing to
+ /// right to indicate a submenu).
+ /// </remarks>
+ STDMETHOD(DrawInlineObject)(
+ __maybenull void* clientDrawingContext,
+ FLOAT originX,
+ FLOAT originY,
+ IDWriteInlineObject* inlineObject,
+ BOOL isSideways,
+ BOOL isRightToLeft,
+ __maybenull IUnknown* clientDrawingEffect
+ ) PURE;
+};
+
+/// <summary>
+/// The IDWriteTextLayout interface represents a block of text after it has
+/// been fully analyzed and formatted.
+///
+/// All coordinates are in device independent pixels (DIPs).
+/// </summary>
+interface DWRITE_DECLARE_INTERFACE("53737037-6d14-410b-9bfe-0b182bb70961") IDWriteTextLayout : public IDWriteTextFormat
+{
+ /// <summary>
+ /// Set layout maximum width
+ /// </summary>
+ /// <param name="maxWidth">Layout maximum width</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(SetMaxWidth)(
+ FLOAT maxWidth
+ ) PURE;
+
+ /// <summary>
+ /// Set layout maximum height
+ /// </summary>
+ /// <param name="maxHeight">Layout maximum height</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(SetMaxHeight)(
+ FLOAT maxHeight
+ ) PURE;
+
+ /// <summary>
+ /// Set the font collection.
+ /// </summary>
+ /// <param name="fontCollection">The font collection to set</param>
+ /// <param name="textRange">Text range to which this change applies.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(SetFontCollection)(
+ IDWriteFontCollection* fontCollection,
+ DWRITE_TEXT_RANGE textRange
+ ) PURE;
+
+ /// <summary>
+ /// Set null-terminated font family name.
+ /// </summary>
+ /// <param name="fontFamilyName">Font family name</param>
+ /// <param name="textRange">Text range to which this change applies.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(SetFontFamilyName)(
+ __in_z WCHAR const* fontFamilyName,
+ DWRITE_TEXT_RANGE textRange
+ ) PURE;
+
+ /// <summary>
+ /// Set font weight.
+ /// </summary>
+ /// <param name="fontWeight">Font weight</param>
+ /// <param name="textRange">Text range to which this change applies.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(SetFontWeight)(
+ DWRITE_FONT_WEIGHT fontWeight,
+ DWRITE_TEXT_RANGE textRange
+ ) PURE;
+
+ /// <summary>
+ /// Set font style.
+ /// </summary>
+ /// <param name="fontStyle">Font style</param>
+ /// <param name="textRange">Text range to which this change applies.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(SetFontStyle)(
+ DWRITE_FONT_STYLE fontStyle,
+ DWRITE_TEXT_RANGE textRange
+ ) PURE;
+
+ /// <summary>
+ /// Set font stretch.
+ /// </summary>
+ /// <param name="fontStretch">font stretch</param>
+ /// <param name="textRange">Text range to which this change applies.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(SetFontStretch)(
+ DWRITE_FONT_STRETCH fontStretch,
+ DWRITE_TEXT_RANGE textRange
+ ) PURE;
+
+ /// <summary>
+ /// Set font em height.
+ /// </summary>
+ /// <param name="fontSize">Font em height</param>
+ /// <param name="textRange">Text range to which this change applies.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(SetFontSize)(
+ FLOAT fontSize,
+ DWRITE_TEXT_RANGE textRange
+ ) PURE;
+
+ /// <summary>
+ /// Set underline.
+ /// </summary>
+ /// <param name="hasUnderline">The Boolean flag indicates whether underline takes place</param>
+ /// <param name="textRange">Text range to which this change applies.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(SetUnderline)(
+ BOOL hasUnderline,
+ DWRITE_TEXT_RANGE textRange
+ ) PURE;
+
+ /// <summary>
+ /// Set strikethrough.
+ /// </summary>
+ /// <param name="hasStrikethrough">The Boolean flag indicates whether strikethrough takes place</param>
+ /// <param name="textRange">Text range to which this change applies.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(SetStrikethrough)(
+ BOOL hasStrikethrough,
+ DWRITE_TEXT_RANGE textRange
+ ) PURE;
+
+ /// <summary>
+ /// Set application-defined drawing effect.
+ /// </summary>
+ /// <param name="drawingEffect">Pointer to an application-defined drawing effect.</param>
+ /// <param name="textRange">Text range to which this change applies.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ /// <remarks>
+ /// This drawing effect is associated with the specified range and will be passed back
+ /// to the application via the callback when the range is drawn at drawing time.
+ /// </remarks>
+ STDMETHOD(SetDrawingEffect)(
+ IUnknown* drawingEffect,
+ DWRITE_TEXT_RANGE textRange
+ ) PURE;
+
+ /// <summary>
+ /// Set inline object.
+ /// </summary>
+ /// <param name="inlineObject">Pointer to an application-implemented inline object.</param>
+ /// <param name="textRange">Text range to which this change applies.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ /// <remarks>
+ /// This inline object applies to the specified range and will be passed back
+ /// to the application via the DrawInlineObject callback when the range is drawn.
+ /// Any text in that range will be suppressed.
+ /// </remarks>
+ STDMETHOD(SetInlineObject)(
+ IDWriteInlineObject* inlineObject,
+ DWRITE_TEXT_RANGE textRange
+ ) PURE;
+
+ /// <summary>
+ /// Set font typography features.
+ /// </summary>
+ /// <param name="typography">Pointer to font typography setting.</param>
+ /// <param name="textRange">Text range to which this change applies.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(SetTypography)(
+ IDWriteTypography* typography,
+ DWRITE_TEXT_RANGE textRange
+ ) PURE;
+
+ /// <summary>
+ /// Set locale name.
+ /// </summary>
+ /// <param name="localeName">Locale name</param>
+ /// <param name="textRange">Text range to which this change applies.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(SetLocaleName)(
+ __in_z WCHAR const* localeName,
+ DWRITE_TEXT_RANGE textRange
+ ) PURE;
+
+ /// <summary>
+ /// Get layout maximum width
+ /// </summary>
+ STDMETHOD_(FLOAT, GetMaxWidth)() PURE;
+
+ /// <summary>
+ /// Get layout maximum height
+ /// </summary>
+ STDMETHOD_(FLOAT, GetMaxHeight)() PURE;
+
+ /// <summary>
+ /// Get the font collection where the current position is at.
+ /// </summary>
+ /// <param name="currentPosition">The current text position.</param>
+ /// <param name="fontCollection">The current font collection</param>
+ /// <param name="textRange">Text range to which this change applies.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(GetFontCollection)(
+ UINT32 currentPosition,
+ __out IDWriteFontCollection** fontCollection,
+ __out_opt DWRITE_TEXT_RANGE* textRange = NULL
+ ) PURE;
+
+ /// <summary>
+ /// Get the length of the font family name where the current position is at.
+ /// </summary>
+ /// <param name="currentPosition">The current text position.</param>
+ /// <param name="nameLength">Size of the character array in character count not including the terminated NULL character.</param>
+ /// <param name="textRange">The position range of the current format.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(GetFontFamilyNameLength)(
+ UINT32 currentPosition,
+ __out UINT32* nameLength,
+ __out_opt DWRITE_TEXT_RANGE* textRange = NULL
+ ) PURE;
+
+ /// <summary>
+ /// Copy the font family name where the current position is at.
+ /// </summary>
+ /// <param name="currentPosition">The current text position.</param>
+ /// <param name="fontFamilyName">Character array that receives the current font family name</param>
+ /// <param name="nameSize">Size of the character array in character count including the terminated NULL character.</param>
+ /// <param name="textRange">The position range of the current format.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(GetFontFamilyName)(
+ UINT32 currentPosition,
+ __out_ecount_z(nameSize) WCHAR* fontFamilyName,
+ UINT32 nameSize,
+ __out_opt DWRITE_TEXT_RANGE* textRange = NULL
+ ) PURE;
+
+ /// <summary>
+ /// Get the font weight where the current position is at.
+ /// </summary>
+ /// <param name="currentPosition">The current text position.</param>
+ /// <param name="fontWeight">The current font weight</param>
+ /// <param name="textRange">The position range of the current format.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(GetFontWeight)(
+ UINT32 currentPosition,
+ __out DWRITE_FONT_WEIGHT* fontWeight,
+ __out_opt DWRITE_TEXT_RANGE* textRange = NULL
+ ) PURE;
+
+ /// <summary>
+ /// Get the font style where the current position is at.
+ /// </summary>
+ /// <param name="currentPosition">The current text position.</param>
+ /// <param name="fontStyle">The current font style</param>
+ /// <param name="textRange">The position range of the current format.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(GetFontStyle)(
+ UINT32 currentPosition,
+ __out DWRITE_FONT_STYLE* fontStyle,
+ __out_opt DWRITE_TEXT_RANGE* textRange = NULL
+ ) PURE;
+
+ /// <summary>
+ /// Get the font stretch where the current position is at.
+ /// </summary>
+ /// <param name="currentPosition">The current text position.</param>
+ /// <param name="fontStretch">The current font stretch</param>
+ /// <param name="textRange">The position range of the current format.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(GetFontStretch)(
+ UINT32 currentPosition,
+ __out DWRITE_FONT_STRETCH* fontStretch,
+ __out_opt DWRITE_TEXT_RANGE* textRange = NULL
+ ) PURE;
+
+ /// <summary>
+ /// Get the font em height where the current position is at.
+ /// </summary>
+ /// <param name="currentPosition">The current text position.</param>
+ /// <param name="fontSize">The current font em height</param>
+ /// <param name="textRange">The position range of the current format.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(GetFontSize)(
+ UINT32 currentPosition,
+ __out FLOAT* fontSize,
+ __out_opt DWRITE_TEXT_RANGE* textRange = NULL
+ ) PURE;
+
+ /// <summary>
+ /// Get the underline presence where the current position is at.
+ /// </summary>
+ /// <param name="currentPosition">The current text position.</param>
+ /// <param name="hasUnderline">The Boolean flag indicates whether text is underlined.</param>
+ /// <param name="textRange">The position range of the current format.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(GetUnderline)(
+ UINT32 currentPosition,
+ __out BOOL* hasUnderline,
+ __out_opt DWRITE_TEXT_RANGE* textRange = NULL
+ ) PURE;
+
+ /// <summary>
+ /// Get the strikethrough presence where the current position is at.
+ /// </summary>
+ /// <param name="currentPosition">The current text position.</param>
+ /// <param name="hasStrikethrough">The Boolean flag indicates whether text has strikethrough.</param>
+ /// <param name="textRange">The position range of the current format.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(GetStrikethrough)(
+ UINT32 currentPosition,
+ __out BOOL* hasStrikethrough,
+ __out_opt DWRITE_TEXT_RANGE* textRange = NULL
+ ) PURE;
+
+ /// <summary>
+ /// Get the application-defined drawing effect where the current position is at.
+ /// </summary>
+ /// <param name="currentPosition">The current text position.</param>
+ /// <param name="drawingEffect">The current application-defined drawing effect.</param>
+ /// <param name="textRange">The position range of the current format.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(GetDrawingEffect)(
+ UINT32 currentPosition,
+ __out IUnknown** drawingEffect,
+ __out_opt DWRITE_TEXT_RANGE* textRange = NULL
+ ) PURE;
+
+ /// <summary>
+ /// Get the inline object at the given position.
+ /// </summary>
+ /// <param name="currentPosition">The given text position.</param>
+ /// <param name="inlineObject">The inline object.</param>
+ /// <param name="textRange">The position range of the current format.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(GetInlineObject)(
+ UINT32 currentPosition,
+ __out IDWriteInlineObject** inlineObject,
+ __out_opt DWRITE_TEXT_RANGE* textRange = NULL
+ ) PURE;
+
+ /// <summary>
+ /// Get the typography setting where the current position is at.
+ /// </summary>
+ /// <param name="currentPosition">The current text position.</param>
+ /// <param name="typography">The current typography setting.</param>
+ /// <param name="textRange">The position range of the current format.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(GetTypography)(
+ UINT32 currentPosition,
+ __out IDWriteTypography** typography,
+ __out_opt DWRITE_TEXT_RANGE* textRange = NULL
+ ) PURE;
+
+ /// <summary>
+ /// Get the length of the locale name where the current position is at.
+ /// </summary>
+ /// <param name="currentPosition">The current text position.</param>
+ /// <param name="nameLength">Size of the character array in character count not including the terminated NULL character.</param>
+ /// <param name="textRange">The position range of the current format.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(GetLocaleNameLength)(
+ UINT32 currentPosition,
+ __out UINT32* nameLength,
+ __out_opt DWRITE_TEXT_RANGE* textRange = NULL
+ ) PURE;
+
+ /// <summary>
+ /// Get the locale name where the current position is at.
+ /// </summary>
+ /// <param name="currentPosition">The current text position.</param>
+ /// <param name="localeName">Character array that receives the current locale name</param>
+ /// <param name="nameSize">Size of the character array in character count including the terminated NULL character.</param>
+ /// <param name="textRange">The position range of the current format.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(GetLocaleName)(
+ UINT32 currentPosition,
+ __out_ecount_z(nameSize) WCHAR* localeName,
+ UINT32 nameSize,
+ __out_opt DWRITE_TEXT_RANGE* textRange = NULL
+ ) PURE;
+
+ /// <summary>
+ /// Initiate drawing of the text.
+ /// </summary>
+ /// <param name="clientDrawingContext">An application defined value
+ /// included in rendering callbacks.</param>
+ /// <param name="renderer">The set of application-defined callbacks that do
+ /// the actual rendering.</param>
+ /// <param name="originX">X-coordinate of the layout's left side.</param>
+ /// <param name="originY">Y-coordinate of the layout's top side.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(Draw)(
+ __maybenull void* clientDrawingContext,
+ IDWriteTextRenderer* renderer,
+ FLOAT originX,
+ FLOAT originY
+ ) PURE;
+
+ /// <summary>
+ /// GetLineMetrics returns properties of each line.
+ /// </summary>
+ /// <param name="lineMetrics">The array to fill with line information.</param>
+ /// <param name="maxLineCount">The maximum size of the lineMetrics array.</param>
+ /// <param name="actualLineCount">The actual size of the lineMetrics
+ /// array that is needed.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ /// <remarks>
+ /// If maxLineCount is not large enough E_NOT_SUFFICIENT_BUFFER,
+ /// which is equivalent to HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER),
+ /// is returned and *actualLineCount is set to the number of lines
+ /// needed.
+ /// </remarks>
+ STDMETHOD(GetLineMetrics)(
+ __out_ecount_opt(maxLineCount) DWRITE_LINE_METRICS* lineMetrics,
+ UINT32 maxLineCount,
+ __out UINT32* actualLineCount
+ ) PURE;
+
+ /// <summary>
+ /// GetMetrics retrieves overall metrics for the formatted string.
+ /// </summary>
+ /// <param name="textMetrics">The returned metrics.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ /// <remarks>
+ /// Drawing effects like underline and strikethrough do not contribute
+ /// to the text size, which is essentially the sum of advance widths and
+ /// line heights. Additionally, visible swashes and other graphic
+ /// adornments may extend outside the returned width and height.
+ /// </remarks>
+ STDMETHOD(GetMetrics)(
+ __out DWRITE_TEXT_METRICS* textMetrics
+ ) PURE;
+
+ /// <summary>
+ /// GetOverhangMetrics returns the overhangs (in DIPs) of the layout and all
+ /// objects contained in it, including text glyphs and inline objects.
+ /// </summary>
+ /// <param name="overhangs">Overshoots of visible extents (in DIPs) outside the layout.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ /// <remarks>
+ /// Any underline and strikethrough do not contribute to the black box
+ /// determination, since these are actually drawn by the renderer, which
+ /// is allowed to draw them in any variety of styles.
+ /// </remarks>
+ STDMETHOD(GetOverhangMetrics)(
+ __out DWRITE_OVERHANG_METRICS* overhangs
+ ) PURE;
+
+ /// <summary>
+ /// Retrieve logical properties and measurement of each cluster.
+ /// </summary>
+ /// <param name="clusterMetrics">The array to fill with cluster information.</param>
+ /// <param name="maxClusterCount">The maximum size of the clusterMetrics array.</param>
+ /// <param name="actualClusterCount">The actual size of the clusterMetrics array that is needed.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ /// <remarks>
+ /// If maxClusterCount is not large enough E_NOT_SUFFICIENT_BUFFER,
+ /// which is equivalent to HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER),
+ /// is returned and *actualClusterCount is set to the number of clusters
+ /// needed.
+ /// </remarks>
+ STDMETHOD(GetClusterMetrics)(
+ __out_ecount_opt(maxClusterCount) DWRITE_CLUSTER_METRICS* clusterMetrics,
+ UINT32 maxClusterCount,
+ __out UINT32* actualClusterCount
+ ) PURE;
+
+ /// <summary>
+ /// Determines the minimum possible width the layout can be set to without
+ /// emergency breaking between the characters of whole words.
+ /// </summary>
+ /// <param name="minWidth">Minimum width.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(DetermineMinWidth)(
+ __out FLOAT* minWidth
+ ) PURE;
+
+ /// <summary>
+ /// Given a coordinate (in DIPs) relative to the top-left of the layout box,
+ /// this returns the corresponding hit-test metrics of the text string where
+ /// the hit-test has occurred. This is useful for mapping mouse clicks to caret
+ /// positions. When the given coordinate is outside the text string, the function
+ /// sets the output value *isInside to false but returns the nearest character
+ /// position.
+ /// </summary>
+ /// <param name="pointX">X coordinate to hit-test, relative to the top-left location of the layout box.</param>
+ /// <param name="pointY">Y coordinate to hit-test, relative to the top-left location of the layout box.</param>
+ /// <param name="isTrailingHit">Output flag indicating whether the hit-test location is at the leading or the trailing
+ /// side of the character. When the output *isInside value is set to false, this value is set according to the output
+ /// *position value to represent the edge closest to the hit-test location. </param>
+ /// <param name="isInside">Output flag indicating whether the hit-test location is inside the text string.
+ /// When false, the position nearest the text's edge is returned.</param>
+ /// <param name="hitTestMetrics">Output geometry fully enclosing the hit-test location. When the output *isInside value
+ /// is set to false, this structure represents the geometry enclosing the edge closest to the hit-test location.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(HitTestPoint)(
+ FLOAT pointX,
+ FLOAT pointY,
+ __out BOOL* isTrailingHit,
+ __out BOOL* isInside,
+ __out DWRITE_HIT_TEST_METRICS* hitTestMetrics
+ ) PURE;
+
+ /// <summary>
+ /// Given a text position and whether the caret is on the leading or trailing
+ /// edge of that position, this returns the corresponding coordinate (in DIPs)
+ /// relative to the top-left of the layout box. This is most useful for drawing
+ /// the caret's current position, but it could also be used to anchor an IME to the
+ /// typed text or attach a floating menu near the point of interest. It may also be
+ /// used to programmatically obtain the geometry of a particular text position
+ /// for UI automation.
+ /// </summary>
+ /// <param name="textPosition">Text position to get the coordinate of.</param>
+ /// <param name="isTrailingHit">Flag indicating whether the location is of the leading or the trailing side of the specified text position. </param>
+ /// <param name="pointX">Output caret X, relative to the top-left of the layout box.</param>
+ /// <param name="pointY">Output caret Y, relative to the top-left of the layout box.</param>
+ /// <param name="hitTestMetrics">Output geometry fully enclosing the specified text position.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ /// <remarks>
+ /// When drawing a caret at the returned X,Y, it should should be centered on X
+ /// and drawn from the Y coordinate down. The height will be the size of the
+ /// hit-tested text (which can vary in size within a line).
+ /// Reading direction also affects which side of the character the caret is drawn.
+ /// However, the returned X coordinate will be correct for either case.
+ /// You can get a text length back that is larger than a single character.
+ /// This happens for complex scripts when multiple characters form a single cluster,
+ /// when diacritics join their base character, or when you test a surrogate pair.
+ /// </remarks>
+ STDMETHOD(HitTestTextPosition)(
+ UINT32 textPosition,
+ BOOL isTrailingHit,
+ __out FLOAT* pointX,
+ __out FLOAT* pointY,
+ __out DWRITE_HIT_TEST_METRICS* hitTestMetrics
+ ) PURE;
+
+ /// <summary>
+ /// The application calls this function to get a set of hit-test metrics
+ /// corresponding to a range of text positions. The main usage for this
+ /// is to draw highlighted selection of the text string.
+ ///
+ /// The function returns E_NOT_SUFFICIENT_BUFFER, which is equivalent to
+ /// HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), when the buffer size of
+ /// hitTestMetrics is too small to hold all the regions calculated by the
+ /// function. In such situation, the function sets the output value
+ /// *actualHitTestMetricsCount to the number of geometries calculated.
+ /// The application is responsible to allocate a new buffer of greater
+ /// size and call the function again.
+ ///
+ /// A good value to use as an initial value for maxHitTestMetricsCount may
+ /// be calculated from the following equation:
+ /// maxHitTestMetricsCount = lineCount * maxBidiReorderingDepth
+ ///
+ /// where lineCount is obtained from the value of the output argument
+ /// *actualLineCount from the function IDWriteTextLayout::GetLineMetrics,
+ /// and the maxBidiReorderingDepth value from the DWRITE_TEXT_METRICS
+ /// structure of the output argument *textMetrics from the function
+ /// IDWriteFactory::CreateTextLayout.
+ /// </summary>
+ /// <param name="textPosition">First text position of the specified range.</param>
+ /// <param name="textLength">Number of positions of the specified range.</param>
+ /// <param name="originX">Offset of the X origin (left of the layout box) which is added to each of the hit-test metrics returned.</param>
+ /// <param name="originY">Offset of the Y origin (top of the layout box) which is added to each of the hit-test metrics returned.</param>
+ /// <param name="hitTestMetrics">Pointer to a buffer of the output geometry fully enclosing the specified position range.</param>
+ /// <param name="maxHitTestMetricsCount">Maximum number of distinct metrics it could hold in its buffer memory.</param>
+ /// <param name="actualHitTestMetricsCount">Actual number of metrics returned or needed.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ /// <remarks>
+ /// There are no gaps in the returned metrics. While there could be visual gaps,
+ /// depending on bidi ordering, each range is contiguous and reports all the text,
+ /// including any hidden characters and trimmed text.
+ /// The height of each returned range will be the same within each line, regardless
+ /// of how the font sizes vary.
+ /// </remarks>
+ STDMETHOD(HitTestTextRange)(
+ UINT32 textPosition,
+ UINT32 textLength,
+ FLOAT originX,
+ FLOAT originY,
+ __out_ecount_opt(maxHitTestMetricsCount) DWRITE_HIT_TEST_METRICS* hitTestMetrics,
+ UINT32 maxHitTestMetricsCount,
+ __out UINT32* actualHitTestMetricsCount
+ ) PURE;
+};
+
+/// <summary>
+/// Encapsulates a 32-bit device independent bitmap and device context, which can be used for rendering glyphs.
+/// </summary>
+interface DWRITE_DECLARE_INTERFACE("5e5a32a3-8dff-4773-9ff6-0696eab77267") IDWriteBitmapRenderTarget : public IUnknown
+{
+ /// <summary>
+ /// Draws a run of glyphs to the bitmap.
+ /// </summary>
+ /// <param name="baselineOriginX">Horizontal position of the baseline origin, in DIPs, relative to the upper-left corner of the DIB.</param>
+ /// <param name="baselineOriginY">Vertical position of the baseline origin, in DIPs, relative to the upper-left corner of the DIB.</param>
+ /// <param name="measuringMode">Specifies measuring method for glyphs in the run.
+ /// Renderer implementations may choose different rendering modes for different measuring methods, for example
+ /// DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL for DWRITE_MEASURING_MODE_NATURAL,
+ /// DWRITE_RENDERING_MODE_CLEARTYPE_GDI_CLASSIC for DWRITE_MEASURING_MODE_GDI_CLASSIC, and
+ /// DWRITE_RENDERING_MODE_CLEARTYPE_GDI_NATURAL for DWRITE_MEASURING_MODE_GDI_NATURAL.
+ /// </param>
+ /// <param name="glyphRun">Structure containing the properties of the glyph run.</param>
+ /// <param name="renderingParams">Object that controls rendering behavior.</param>
+ /// <param name="textColor">Specifies the foreground color of the text.</param>
+ /// <param name="blackBoxRect">Optional rectangle that receives the bounding box (in pixels not DIPs) of all the pixels affected by
+ /// drawing the glyph run. The black box rectangle may extend beyond the dimensions of the bitmap.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(DrawGlyphRun)(
+ FLOAT baselineOriginX,
+ FLOAT baselineOriginY,
+ DWRITE_MEASURING_MODE measuringMode,
+ __in DWRITE_GLYPH_RUN const* glyphRun,
+ IDWriteRenderingParams* renderingParams,
+ COLORREF textColor,
+ __out_opt RECT* blackBoxRect = NULL
+ ) PURE;
+
+ /// <summary>
+ /// Gets a handle to the memory device context.
+ /// </summary>
+ /// <returns>
+ /// Returns the device context handle.
+ /// </returns>
+ /// <remarks>
+ /// An application can use the device context to draw using GDI functions. An application can obtain the bitmap handle
+ /// (HBITMAP) by calling GetCurrentObject. An application that wants information about the underlying bitmap, including
+ /// a pointer to the pixel data, can call GetObject to fill in a DIBSECTION structure. The bitmap is always a 32-bit
+ /// top-down DIB.
+ /// </remarks>
+ STDMETHOD_(HDC, GetMemoryDC)() PURE;
+
+ /// <summary>
+ /// Gets the number of bitmap pixels per DIP. A DIP (device-independent pixel) is 1/96 inch so this value is the number
+ /// if pixels per inch divided by 96.
+ /// </summary>
+ /// <returns>
+ /// Returns the number of bitmap pixels per DIP.
+ /// </returns>
+ STDMETHOD_(FLOAT, GetPixelsPerDip)() PURE;
+
+ /// <summary>
+ /// Sets the number of bitmap pixels per DIP. A DIP (device-independent pixel) is 1/96 inch so this value is the number
+ /// if pixels per inch divided by 96.
+ /// </summary>
+ /// <param name="pixelsPerDip">Specifies the number of pixels per DIP.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(SetPixelsPerDip)(
+ FLOAT pixelsPerDip
+ ) PURE;
+
+ /// <summary>
+ /// Gets the transform that maps abstract coordinate to DIPs. By default this is the identity
+ /// transform. Note that this is unrelated to the world transform of the underlying device
+ /// context.
+ /// </summary>
+ /// <param name="transform">Receives the transform.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(GetCurrentTransform)(
+ __out DWRITE_MATRIX* transform
+ ) PURE;
+
+ /// <summary>
+ /// Sets the transform that maps abstract coordinate to DIPs. This does not affect the world
+ /// transform of the underlying device context.
+ /// </summary>
+ /// <param name="transform">Specifies the new transform. This parameter can be NULL, in which
+ /// case the identity transform is implied.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(SetCurrentTransform)(
+ __in_opt DWRITE_MATRIX const* transform
+ ) PURE;
+
+ /// <summary>
+ /// Gets the dimensions of the bitmap.
+ /// </summary>
+ /// <param name="size">Receives the size of the bitmap in pixels.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(GetSize)(
+ __out SIZE* size
+ ) PURE;
+
+ /// <summary>
+ /// Resizes the bitmap.
+ /// </summary>
+ /// <param name="width">New bitmap width, in pixels.</param>
+ /// <param name="height">New bitmap height, in pixels.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(Resize)(
+ UINT32 width,
+ UINT32 height
+ ) PURE;
+};
+
+/// <summary>
+/// The GDI interop interface provides interoperability with GDI.
+/// </summary>
+interface DWRITE_DECLARE_INTERFACE("1edd9491-9853-4299-898f-6432983b6f3a") IDWriteGdiInterop : public IUnknown
+{
+ /// <summary>
+ /// Creates a font object that matches the properties specified by the LOGFONT structure.
+ /// </summary>
+ /// <param name="logFont">Structure containing a GDI-compatible font description.</param>
+ /// <param name="font">Receives a newly created font object if successful, or NULL in case of error.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(CreateFontFromLOGFONT)(
+ __in LOGFONTW const* logFont,
+ __out IDWriteFont** font
+ ) PURE;
+
+ /// <summary>
+ /// Initializes a LOGFONT structure based on the GDI-compatible properties of the specified font.
+ /// </summary>
+ /// <param name="font">Specifies a font in the system font collection.</param>
+ /// <param name="logFont">Structure that receives a GDI-compatible font description.</param>
+ /// <param name="isSystemFont">Contains TRUE if the specified font object is part of the system font collection
+ /// or FALSE otherwise.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(ConvertFontToLOGFONT)(
+ IDWriteFont* font,
+ __out LOGFONTW* logFont,
+ __out BOOL* isSystemFont
+ ) PURE;
+
+ /// <summary>
+ /// Initializes a LOGFONT structure based on the GDI-compatible properties of the specified font.
+ /// </summary>
+ /// <param name="font">Specifies a font face.</param>
+ /// <param name="logFont">Structure that receives a GDI-compatible font description.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(ConvertFontFaceToLOGFONT)(
+ IDWriteFontFace* font,
+ __out LOGFONTW* logFont
+ ) PURE;
+
+ /// <summary>
+ /// Creates a font face object that corresponds to the currently selected HFONT.
+ /// </summary>
+ /// <param name="hdc">Handle to a device context into which a font has been selected. It is assumed that the client
+ /// has already performed font mapping and that the font selected into the DC is the actual font that would be used
+ /// for rendering glyphs.</param>
+ /// <param name="fontFace">Contains the newly created font face object, or NULL in case of failure.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(CreateFontFaceFromHdc)(
+ HDC hdc,
+ __out IDWriteFontFace** fontFace
+ ) PURE;
+
+ /// <summary>
+ /// Creates an object that encapsulates a bitmap and memory DC which can be used for rendering glyphs.
+ /// </summary>
+ /// <param name="hdc">Optional device context used to create a compatible memory DC.</param>
+ /// <param name="width">Width of the bitmap.</param>
+ /// <param name="height">Height of the bitmap.</param>
+ /// <param name="renderTarget">Receives a pointer to the newly created render target.</param>
+ STDMETHOD(CreateBitmapRenderTarget)(
+ __in_opt HDC hdc,
+ UINT32 width,
+ UINT32 height,
+ __out IDWriteBitmapRenderTarget** renderTarget
+ ) PURE;
+};
+
+/// <summary>
+/// The DWRITE_TEXTURE_TYPE enumeration identifies a type of alpha texture. An alpha texture is a bitmap of alpha values, each
+/// representing the darkness (i.e., opacity) of a pixel or subpixel.
+/// </summary>
+enum DWRITE_TEXTURE_TYPE
+{
+ /// <summary>
+ /// Specifies an alpha texture for aliased text rendering (i.e., bi-level, where each pixel is either fully opaque or fully transparent),
+ /// with one byte per pixel.
+ /// </summary>
+ DWRITE_TEXTURE_ALIASED_1x1,
+
+ /// <summary>
+ /// Specifies an alpha texture for ClearType text rendering, with three bytes per pixel in the horizontal dimension and
+ /// one byte per pixel in the vertical dimension.
+ /// </summary>
+ DWRITE_TEXTURE_CLEARTYPE_3x1
+};
+
+/// <summary>
+/// Maximum alpha value in a texture returned by IDWriteGlyphRunAnalysis::CreateAlphaTexture.
+/// </summary>
+#define DWRITE_ALPHA_MAX 255
+
+/// <summary>
+/// Interface that encapsulates information used to render a glyph run.
+/// </summary>
+interface DWRITE_DECLARE_INTERFACE("7d97dbf7-e085-42d4-81e3-6a883bded118") IDWriteGlyphRunAnalysis : public IUnknown
+{
+ /// <summary>
+ /// Gets the bounding rectangle of the physical pixels affected by the glyph run.
+ /// </summary>
+ /// <param name="textureType">Specifies the type of texture requested. If a bi-level texture is requested, the
+ /// bounding rectangle includes only bi-level glyphs. Otherwise, the bounding rectangle includes only anti-aliased
+ /// glyphs.</param>
+ /// <param name="textureBounds">Receives the bounding rectangle, or an empty rectangle if there are no glyphs
+ /// if the specified type.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(GetAlphaTextureBounds)(
+ DWRITE_TEXTURE_TYPE textureType,
+ __out RECT* textureBounds
+ ) PURE;
+
+ /// <summary>
+ /// Creates an alpha texture of the specified type.
+ /// </summary>
+ /// <param name="textureType">Specifies the type of texture requested. If a bi-level texture is requested, the
+ /// texture contains only bi-level glyphs. Otherwise, the texture contains only anti-aliased glyphs.</param>
+ /// <param name="textureBounds">Specifies the bounding rectangle of the texture, which can be different than
+ /// the bounding rectangle returned by GetAlphaTextureBounds.</param>
+ /// <param name="alphaValues">Receives the array of alpha values.</param>
+ /// <param name="bufferSize">Size of the alphaValues array. The minimum size depends on the dimensions of the
+ /// rectangle and the type of texture requested.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(CreateAlphaTexture)(
+ DWRITE_TEXTURE_TYPE textureType,
+ __in RECT const* textureBounds,
+ __out_bcount(bufferSize) BYTE* alphaValues,
+ UINT32 bufferSize
+ ) PURE;
+
+ /// <summary>
+ /// Gets properties required for ClearType blending.
+ /// </summary>
+ /// <param name="renderingParams">Rendering parameters object. In most cases, the values returned in the output
+ /// parameters are based on the properties of this object. The exception is if a GDI-compatible rendering mode
+ /// is specified.</param>
+ /// <param name="blendGamma">Receives the gamma value to use for gamma correction.</param>
+ /// <param name="blendEnhancedContrast">Receives the enhanced contrast value.</param>
+ /// <param name="blendClearTypeLevel">Receives the ClearType level.</param>
+ STDMETHOD(GetAlphaBlendParams)(
+ IDWriteRenderingParams* renderingParams,
+ __out FLOAT* blendGamma,
+ __out FLOAT* blendEnhancedContrast,
+ __out FLOAT* blendClearTypeLevel
+ ) PURE;
+};
+
+/// <summary>
+/// The root factory interface for all DWrite objects.
+/// </summary>
+interface DWRITE_DECLARE_INTERFACE("b859ee5a-d838-4b5b-a2e8-1adc7d93db48") IDWriteFactory : public IUnknown
+{
+ /// <summary>
+ /// Gets a font collection representing the set of installed fonts.
+ /// </summary>
+ /// <param name="fontCollection">Receives a pointer to the system font collection object, or NULL in case of failure.</param>
+ /// <param name="checkForUpdates">If this parameter is nonzero, the function performs an immediate check for changes to the set of
+ /// installed fonts. If this parameter is FALSE, the function will still detect changes if the font cache service is running, but
+ /// there may be some latency. For example, an application might specify TRUE if it has itself just installed a font and wants to
+ /// be sure the font collection contains that font.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(GetSystemFontCollection)(
+ __out IDWriteFontCollection** fontCollection,
+ BOOL checkForUpdates = FALSE
+ ) PURE;
+
+ /// <summary>
+ /// Creates a font collection using a custom font collection loader.
+ /// </summary>
+ /// <param name="collectionLoader">Application-defined font collection loader, which must have been previously
+ /// registered using RegisterFontCollectionLoader.</param>
+ /// <param name="collectionKey">Key used by the loader to identify a collection of font files.</param>
+ /// <param name="collectionKeySize">Size in bytes of the collection key.</param>
+ /// <param name="fontCollection">Receives a pointer to the system font collection object, or NULL in case of failure.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(CreateCustomFontCollection)(
+ IDWriteFontCollectionLoader* collectionLoader,
+ __in_bcount(collectionKeySize) void const* collectionKey,
+ UINT32 collectionKeySize,
+ __out IDWriteFontCollection** fontCollection
+ ) PURE;
+
+ /// <summary>
+ /// Registers a custom font collection loader with the factory object.
+ /// </summary>
+ /// <param name="fontCollectionLoader">Application-defined font collection loader.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(RegisterFontCollectionLoader)(
+ IDWriteFontCollectionLoader* fontCollectionLoader
+ ) PURE;
+
+ /// <summary>
+ /// Unregisters a custom font collection loader that was previously registered using RegisterFontCollectionLoader.
+ /// </summary>
+ /// <param name="fontCollectionLoader">Application-defined font collection loader.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(UnregisterFontCollectionLoader)(
+ IDWriteFontCollectionLoader* fontCollectionLoader
+ ) PURE;
+
+ /// <summary>
+ /// CreateFontFileReference creates a font file reference object from a local font file.
+ /// </summary>
+ /// <param name="filePath">Absolute file path. Subsequent operations on the constructed object may fail
+ /// if the user provided filePath doesn't correspond to a valid file on the disk.</param>
+ /// <param name="lastWriteTime">Last modified time of the input file path. If the parameter is omitted,
+ /// the function will access the font file to obtain its last write time, so the clients are encouraged to specify this value
+ /// to avoid extra disk access. Subsequent operations on the constructed object may fail
+ /// if the user provided lastWriteTime doesn't match the file on the disk.</param>
+ /// <param name="fontFile">Contains newly created font file reference object, or NULL in case of failure.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(CreateFontFileReference)(
+ __in_z WCHAR const* filePath,
+ __in_opt FILETIME const* lastWriteTime,
+ __out IDWriteFontFile** fontFile
+ ) PURE;
+
+ /// <summary>
+ /// CreateCustomFontFileReference creates a reference to an application specific font file resource.
+ /// This function enables an application or a document to use a font without having to install it on the system.
+ /// The fontFileReferenceKey has to be unique only in the scope of the fontFileLoader used in this call.
+ /// </summary>
+ /// <param name="fontFileReferenceKey">Font file reference key that uniquely identifies the font file resource
+ /// during the lifetime of fontFileLoader.</param>
+ /// <param name="fontFileReferenceKeySize">Size of font file reference key in bytes.</param>
+ /// <param name="fontFileLoader">Font file loader that will be used by the font system to load data from the file identified by
+ /// fontFileReferenceKey.</param>
+ /// <param name="fontFile">Contains the newly created font file object, or NULL in case of failure.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ /// <remarks>
+ /// This function is provided for cases when an application or a document needs to use a font
+ /// without having to install it on the system. fontFileReferenceKey has to be unique only in the scope
+ /// of the fontFileLoader used in this call.
+ /// </remarks>
+ STDMETHOD(CreateCustomFontFileReference)(
+ __in_bcount(fontFileReferenceKeySize) void const* fontFileReferenceKey,
+ UINT32 fontFileReferenceKeySize,
+ IDWriteFontFileLoader* fontFileLoader,
+ __out IDWriteFontFile** fontFile
+ ) PURE;
+
+ /// <summary>
+ /// Creates a font face object.
+ /// </summary>
+ /// <param name="fontFaceType">The file format of the font face.</param>
+ /// <param name="numberOfFiles">The number of font files require to represent the font face.</param>
+ /// <param name="fontFiles">Font files representing the font face. Since IDWriteFontFace maintains its own references
+ /// to the input font file objects, it's OK to release them after this call.</param>
+ /// <param name="faceIndex">The zero based index of a font face in cases when the font files contain a collection of font faces.
+ /// If the font files contain a single face, this value should be zero.</param>
+ /// <param name="fontFaceSimulationFlags">Font face simulation flags for algorithmic emboldening and italicization.</param>
+ /// <param name="fontFace">Contains the newly created font face object, or NULL in case of failure.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(CreateFontFace)(
+ DWRITE_FONT_FACE_TYPE fontFaceType,
+ UINT32 numberOfFiles,
+ __in_ecount(numberOfFiles) IDWriteFontFile* const* fontFiles,
+ UINT32 faceIndex,
+ DWRITE_FONT_SIMULATIONS fontFaceSimulationFlags,
+ __out IDWriteFontFace** fontFace
+ ) PURE;
+
+ /// <summary>
+ /// Creates a rendering parameters object with default settings for the primary monitor.
+ /// </summary>
+ /// <param name="renderingParams">Holds the newly created rendering parameters object, or NULL in case of failure.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(CreateRenderingParams)(
+ __out IDWriteRenderingParams** renderingParams
+ ) PURE;
+
+ /// <summary>
+ /// Creates a rendering parameters object with default settings for the specified monitor.
+ /// </summary>
+ /// <param name="monitor">The monitor to read the default values from.</param>
+ /// <param name="renderingParams">Holds the newly created rendering parameters object, or NULL in case of failure.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(CreateMonitorRenderingParams)(
+ HMONITOR monitor,
+ __out IDWriteRenderingParams** renderingParams
+ ) PURE;
+
+ /// <summary>
+ /// Creates a rendering parameters object with the specified properties.
+ /// </summary>
+ /// <param name="gamma">The gamma value used for gamma correction, which must be greater than zero and cannot exceed 256.</param>
+ /// <param name="enhancedContrast">The amount of contrast enhancement, zero or greater.</param>
+ /// <param name="clearTypeLevel">The degree of ClearType level, from 0.0f (no ClearType) to 1.0f (full ClearType).</param>
+ /// <param name="pixelGeometry">The geometry of a device pixel.</param>
+ /// <param name="renderingMode">Method of rendering glyphs. In most cases, this should be DWRITE_RENDERING_MODE_DEFAULT to automatically use an appropriate mode.</param>
+ /// <param name="renderingParams">Holds the newly created rendering parameters object, or NULL in case of failure.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(CreateCustomRenderingParams)(
+ FLOAT gamma,
+ FLOAT enhancedContrast,
+ FLOAT clearTypeLevel,
+ DWRITE_PIXEL_GEOMETRY pixelGeometry,
+ DWRITE_RENDERING_MODE renderingMode,
+ __out IDWriteRenderingParams** renderingParams
+ ) PURE;
+
+ /// <summary>
+ /// Registers a font file loader with DirectWrite.
+ /// </summary>
+ /// <param name="fontFileLoader">Pointer to the implementation of the IDWriteFontFileLoader for a particular file resource type.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ /// <remarks>
+ /// This function registers a font file loader with DirectWrite.
+ /// Font file loader interface handles loading font file resources of a particular type from a key.
+ /// The font file loader interface is recommended to be implemented by a singleton object.
+ /// A given instance can only be registered once.
+ /// Succeeding attempts will return an error that it has already been registered.
+ /// IMPORTANT: font file loader implementations must not register themselves with DirectWrite
+ /// inside their constructors and must not unregister themselves in their destructors, because
+ /// registration and unregistraton operations increment and decrement the object reference count respectively.
+ /// Instead, registration and unregistration of font file loaders with DirectWrite should be performed
+ /// outside of the font file loader implementation as a separate step.
+ /// </remarks>
+ STDMETHOD(RegisterFontFileLoader)(
+ IDWriteFontFileLoader* fontFileLoader
+ ) PURE;
+
+ /// <summary>
+ /// Unregisters a font file loader that was previously registered with the DirectWrite font system using RegisterFontFileLoader.
+ /// </summary>
+ /// <param name="fontFileLoader">Pointer to the file loader that was previously registered with the DirectWrite font system using RegisterFontFileLoader.</param>
+ /// <returns>
+ /// This function will succeed if the user loader is requested to be removed.
+ /// It will fail if the pointer to the file loader identifies a standard DirectWrite loader,
+ /// or a loader that is never registered or has already been unregistered.
+ /// </returns>
+ /// <remarks>
+ /// This function unregisters font file loader callbacks with the DirectWrite font system.
+ /// The font file loader interface is recommended to be implemented by a singleton object.
+ /// IMPORTANT: font file loader implementations must not register themselves with DirectWrite
+ /// inside their constructors and must not unregister themselves in their destructors, because
+ /// registration and unregistraton operations increment and decrement the object reference count respectively.
+ /// Instead, registration and unregistration of font file loaders with DirectWrite should be performed
+ /// outside of the font file loader implementation as a separate step.
+ /// </remarks>
+ STDMETHOD(UnregisterFontFileLoader)(
+ IDWriteFontFileLoader* fontFileLoader
+ ) PURE;
+
+ /// <summary>
+ /// Create a text format object used for text layout.
+ /// </summary>
+ /// <param name="fontFamilyName">Name of the font family</param>
+ /// <param name="fontCollection">Font collection. NULL indicates the system font collection.</param>
+ /// <param name="fontWeight">Font weight</param>
+ /// <param name="fontStyle">Font style</param>
+ /// <param name="fontStretch">Font stretch</param>
+ /// <param name="fontSize">Logical size of the font in DIP units. A DIP ("device-independent pixel") equals 1/96 inch.</param>
+ /// <param name="localeName">Locale name</param>
+ /// <param name="textFormat">Contains newly created text format object, or NULL in case of failure.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(CreateTextFormat)(
+ __in_z WCHAR const* fontFamilyName,
+ __maybenull IDWriteFontCollection* fontCollection,
+ DWRITE_FONT_WEIGHT fontWeight,
+ DWRITE_FONT_STYLE fontStyle,
+ DWRITE_FONT_STRETCH fontStretch,
+ FLOAT fontSize,
+ __in_z WCHAR const* localeName,
+ __out IDWriteTextFormat** textFormat
+ ) PURE;
+
+ /// <summary>
+ /// Create a typography object used in conjunction with text format for text layout.
+ /// </summary>
+ /// <param name="typography">Contains newly created typography object, or NULL in case of failure.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(CreateTypography)(
+ __out IDWriteTypography** typography
+ ) PURE;
+
+ /// <summary>
+ /// Create an object used for interoperability with GDI.
+ /// </summary>
+ /// <param name="gdiInterop">Receives the GDI interop object if successful, or NULL in case of failure.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(GetGdiInterop)(
+ __out IDWriteGdiInterop** gdiInterop
+ ) PURE;
+
+ /// <summary>
+ /// CreateTextLayout takes a string, format, and associated constraints
+ /// and produces and object representing the fully analyzed
+ /// and formatted result.
+ /// </summary>
+ /// <param name="string">The string to layout.</param>
+ /// <param name="stringLength">The length of the string.</param>
+ /// <param name="textFormat">The format to apply to the string.</param>
+ /// <param name="maxWidth">Width of the layout box.</param>
+ /// <param name="maxHeight">Height of the layout box.</param>
+ /// <param name="textLayout">The resultant object.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(CreateTextLayout)(
+ __in_ecount(stringLength) WCHAR const* string,
+ UINT32 stringLength,
+ IDWriteTextFormat* textFormat,
+ FLOAT maxWidth,
+ FLOAT maxHeight,
+ __out IDWriteTextLayout** textLayout
+ ) PURE;
+
+ /// <summary>
+ /// CreateGdiCompatibleTextLayout takes a string, format, and associated constraints
+ /// and produces and object representing the result formatted for a particular display resolution
+ /// and measuring method. The resulting text layout should only be used for the intended resolution,
+ /// and for cases where text scalability is desired, CreateTextLayout should be used instead.
+ /// </summary>
+ /// <param name="string">The string to layout.</param>
+ /// <param name="stringLength">The length of the string.</param>
+ /// <param name="textFormat">The format to apply to the string.</param>
+ /// <param name="layoutWidth">Width of the layout box.</param>
+ /// <param name="layoutHeight">Height of the layout box.</param>
+ /// <param name="pixelsPerDip">Number of physical pixels per DIP. For example, if rendering onto a 96 DPI device then pixelsPerDip
+ /// is 1. If rendering onto a 120 DPI device then pixelsPerDip is 120/96.</param>
+ /// <param name="transform">Optional transform applied to the glyphs and their positions. This transform is applied after the
+ /// scaling specified the font size and pixelsPerDip.</param>
+ /// <param name="useGdiNatural">
+ /// When set to FALSE, instructs the text layout to use the same metrics as GDI aliased text.
+ /// When set to TRUE, instructs the text layout to use the same metrics as text measured by GDI using a font
+ /// created with CLEARTYPE_NATURAL_QUALITY.
+ /// </param>
+ /// <param name="textLayout">The resultant object.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(CreateGdiCompatibleTextLayout)(
+ __in_ecount(stringLength) WCHAR const* string,
+ UINT32 stringLength,
+ IDWriteTextFormat* textFormat,
+ FLOAT layoutWidth,
+ FLOAT layoutHeight,
+ FLOAT pixelsPerDip,
+ __in_opt DWRITE_MATRIX const* transform,
+ BOOL useGdiNatural,
+ __out IDWriteTextLayout** textLayout
+ ) PURE;
+
+ /// <summary>
+ /// The application may call this function to create an inline object for trimming, using an ellipsis as the omission sign.
+ /// The ellipsis will be created using the current settings of the format, including base font, style, and any effects.
+ /// Alternate omission signs can be created by the application by implementing IDWriteInlineObject.
+ /// </summary>
+ /// <param name="textFormat">Text format used as a template for the omission sign.</param>
+ /// <param name="trimmingSign">Created omission sign.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(CreateEllipsisTrimmingSign)(
+ IDWriteTextFormat* textFormat,
+ __out IDWriteInlineObject** trimmingSign
+ ) PURE;
+
+ /// <summary>
+ /// Return an interface to perform text analysis with.
+ /// </summary>
+ /// <param name="textAnalyzer">The resultant object.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(CreateTextAnalyzer)(
+ __out IDWriteTextAnalyzer** textAnalyzer
+ ) PURE;
+
+ /// <summary>
+ /// Creates a number substitution object using a locale name,
+ /// substitution method, and whether to ignore user overrides (uses NLS
+ /// defaults for the given culture instead).
+ /// </summary>
+ /// <param name="substitutionMethod">Method of number substitution to use.</param>
+ /// <param name="localeName">Which locale to obtain the digits from.</param>
+ /// <param name="ignoreUserOverride">Ignore the user's settings and use the locale defaults</param>
+ /// <param name="numberSubstitution">Receives a pointer to the newly created object.</param>
+ STDMETHOD(CreateNumberSubstitution)(
+ __in DWRITE_NUMBER_SUBSTITUTION_METHOD substitutionMethod,
+ __in_z WCHAR const* localeName,
+ __in BOOL ignoreUserOverride,
+ __out IDWriteNumberSubstitution** numberSubstitution
+ ) PURE;
+
+ /// <summary>
+ /// Creates a glyph run analysis object, which encapsulates information
+ /// used to render a glyph run.
+ /// </summary>
+ /// <param name="glyphRun">Structure specifying the properties of the glyph run.</param>
+ /// <param name="pixelsPerDip">Number of physical pixels per DIP. For example, if rendering onto a 96 DPI bitmap then pixelsPerDip
+ /// is 1. If rendering onto a 120 DPI bitmap then pixelsPerDip is 120/96.</param>
+ /// <param name="transform">Optional transform applied to the glyphs and their positions. This transform is applied after the
+ /// scaling specified the emSize and pixelsPerDip.</param>
+ /// <param name="renderingMode">Specifies the rendering mode, which must be one of the raster rendering modes (i.e., not default
+ /// and not outline).</param>
+ /// <param name="measuringMode">Specifies the method to measure glyphs.</param>
+ /// <param name="baselineOriginX">Horizontal position of the baseline origin, in DIPs.</param>
+ /// <param name="baselineOriginY">Vertical position of the baseline origin, in DIPs.</param>
+ /// <param name="glyphRunAnalysis">Receives a pointer to the newly created object.</param>
+ /// <returns>
+ /// Standard HRESULT error code.
+ /// </returns>
+ STDMETHOD(CreateGlyphRunAnalysis)(
+ __in DWRITE_GLYPH_RUN const* glyphRun,
+ FLOAT pixelsPerDip,
+ __in_opt DWRITE_MATRIX const* transform,
+ DWRITE_RENDERING_MODE renderingMode,
+ DWRITE_MEASURING_MODE measuringMode,
+ FLOAT baselineOriginX,
+ FLOAT baselineOriginY,
+ __out IDWriteGlyphRunAnalysis** glyphRunAnalysis
+ ) PURE;
+
+}; // interface IDWriteFactory
+
+/// <summary>
+/// Creates a DirectWrite factory object that is used for subsequent creation of individual DirectWrite objects.
+/// </summary>
+/// <param name="factoryType">Identifies whether the factory object will be shared or isolated.</param>
+/// <param name="iid">Identifies the DirectWrite factory interface, such as __uuidof(IDWriteFactory).</param>
+/// <param name="factory">Receives the DirectWrite factory object.</param>
+/// <returns>
+/// Standard HRESULT error code.
+/// </returns>
+/// <remarks>
+/// Obtains DirectWrite factory object that is used for subsequent creation of individual DirectWrite classes.
+/// DirectWrite factory contains internal state such as font loader registration and cached font data.
+/// In most cases it is recommended to use the shared factory object, because it allows multiple components
+/// that use DirectWrite to share internal DirectWrite state and reduce memory usage.
+/// However, there are cases when it is desirable to reduce the impact of a component,
+/// such as a plug-in from an untrusted source, on the rest of the process by sandboxing and isolating it
+/// from the rest of the process components. In such cases, it is recommended to use an isolated factory for the sandboxed
+/// component.
+/// </remarks>
+EXTERN_C HRESULT DWRITE_EXPORT DWriteCreateFactory(
+ __in DWRITE_FACTORY_TYPE factoryType,
+ __in REFIID iid,
+ __out IUnknown **factory
+ );
+
+// Macros used to define DirectWrite error codes.
+#define FACILITY_DWRITE 0x898
+#define DWRITE_ERR_BASE 0x5000
+#define MAKE_DWRITE_HR(severity, code) MAKE_HRESULT(severity, FACILITY_DWRITE, (DWRITE_ERR_BASE + code))
+#define MAKE_DWRITE_HR_ERR(code) MAKE_DWRITE_HR(SEVERITY_ERROR, code)
+
+/// <summary>
+/// Indicates an error in an input file such as a font file.
+/// </summary>
+#define DWRITE_E_FILEFORMAT MAKE_DWRITE_HR_ERR(0x000)
+
+/// <summary>
+/// Indicates an error originating in DirectWrite code, which is not expected to occur but is safe to recover from.
+/// </summary>
+#define DWRITE_E_UNEXPECTED MAKE_DWRITE_HR_ERR(0x001)
+
+/// <summary>
+/// Indicates the specified font does not exist.
+/// </summary>
+#define DWRITE_E_NOFONT MAKE_DWRITE_HR_ERR(0x002)
+
+/// <summary>
+/// A font file could not be opened because the file, directory, network location, drive, or other storage
+/// location does not exist or is unavailable.
+/// </summary>
+#define DWRITE_E_FILENOTFOUND MAKE_DWRITE_HR_ERR(0x003)
+
+/// <summary>
+/// A font file exists but could not be opened due to access denied, sharing violation, or similar error.
+/// </summary>
+#define DWRITE_E_FILEACCESS MAKE_DWRITE_HR_ERR(0x004)
+
+/// <summary>
+/// A font collection is obsolete due to changes in the system.
+/// </summary>
+#define DWRITE_E_FONTCOLLECTIONOBSOLETE MAKE_DWRITE_HR_ERR(0x005)
+
+/// <summary>
+/// The given interface is already registered.
+/// </summary>
+#define DWRITE_E_ALREADYREGISTERED MAKE_DWRITE_HR_ERR(0x006)
+
+#endif /* DWRITE_H_INCLUDED */
diff --git a/core/src/fxge/Microsoft SDK/include/Dcommon.h b/core/src/fxge/Microsoft SDK/include/Dcommon.h
index a6c901aeac..4ecc5c174b 100644
--- a/core/src/fxge/Microsoft SDK/include/Dcommon.h
+++ b/core/src/fxge/Microsoft SDK/include/Dcommon.h
@@ -1,65 +1,65 @@
-//+--------------------------------------------------------------------------
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//
-// Abstract:
-// Public API definitions for DWrite and D2D
-//
-//----------------------------------------------------------------------------
-
-#ifndef DCOMMON_H_INCLUDED
-#define DCOMMON_H_INCLUDED
-
-//
-//These macros are defined in the Windows 7 SDK, however to enable development using the technical preview,
-//they are included here temporarily.
-//
-#ifndef DEFINE_ENUM_FLAG_OPERATORS
-#define DEFINE_ENUM_FLAG_OPERATORS(ENUMTYPE) \
-extern "C++" { \
-inline ENUMTYPE operator | (ENUMTYPE a, ENUMTYPE b) { return ENUMTYPE(((int)a) | ((int)b)); } \
-inline ENUMTYPE &operator |= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((int &)a) |= ((int)b)); } \
-inline ENUMTYPE operator & (ENUMTYPE a, ENUMTYPE b) { return ENUMTYPE(((int)a) & ((int)b)); } \
-inline ENUMTYPE &operator &= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((int &)a) &= ((int)b)); } \
-inline ENUMTYPE operator ~ (ENUMTYPE a) { return ENUMTYPE(~((int)a)); } \
-inline ENUMTYPE operator ^ (ENUMTYPE a, ENUMTYPE b) { return ENUMTYPE(((int)a) ^ ((int)b)); } \
-inline ENUMTYPE &operator ^= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((int &)a) ^= ((int)b)); } \
-}
-#endif
-
-#ifndef __field_ecount_opt
-#define __field_ecount_opt(x)
-#endif
-
-#ifndef __range
-#define __range(x,y)
-#endif
-
-#ifndef __field_ecount
-#define __field_ecount(x)
-#endif
-
-/// <summary>
-/// The measuring method used for text layout.
-/// </summary>
-typedef enum DWRITE_MEASURING_MODE
-{
- /// <summary>
- /// Text is measured using glyph ideal metrics whose values are independent to the current display resolution.
- /// </summary>
- DWRITE_MEASURING_MODE_NATURAL,
-
- /// <summary>
- /// Text is measured using glyph display compatible metrics whose values tuned for the current display resolution.
- /// </summary>
- DWRITE_MEASURING_MODE_GDI_CLASSIC,
-
- /// <summary>
- /// Text is measured using the same glyph display metrics as text measured by GDI using a font
- /// created with CLEARTYPE_NATURAL_QUALITY.
- /// </summary>
- DWRITE_MEASURING_MODE_GDI_NATURAL
-
-} DWRITE_MEASURING_MODE;
-
-#endif /* DCOMMON_H_INCLUDED */
+//+--------------------------------------------------------------------------
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+//
+// Abstract:
+// Public API definitions for DWrite and D2D
+//
+//----------------------------------------------------------------------------
+
+#ifndef DCOMMON_H_INCLUDED
+#define DCOMMON_H_INCLUDED
+
+//
+//These macros are defined in the Windows 7 SDK, however to enable development using the technical preview,
+//they are included here temporarily.
+//
+#ifndef DEFINE_ENUM_FLAG_OPERATORS
+#define DEFINE_ENUM_FLAG_OPERATORS(ENUMTYPE) \
+extern "C++" { \
+inline ENUMTYPE operator | (ENUMTYPE a, ENUMTYPE b) { return ENUMTYPE(((int)a) | ((int)b)); } \
+inline ENUMTYPE &operator |= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((int &)a) |= ((int)b)); } \
+inline ENUMTYPE operator & (ENUMTYPE a, ENUMTYPE b) { return ENUMTYPE(((int)a) & ((int)b)); } \
+inline ENUMTYPE &operator &= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((int &)a) &= ((int)b)); } \
+inline ENUMTYPE operator ~ (ENUMTYPE a) { return ENUMTYPE(~((int)a)); } \
+inline ENUMTYPE operator ^ (ENUMTYPE a, ENUMTYPE b) { return ENUMTYPE(((int)a) ^ ((int)b)); } \
+inline ENUMTYPE &operator ^= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((int &)a) ^= ((int)b)); } \
+}
+#endif
+
+#ifndef __field_ecount_opt
+#define __field_ecount_opt(x)
+#endif
+
+#ifndef __range
+#define __range(x,y)
+#endif
+
+#ifndef __field_ecount
+#define __field_ecount(x)
+#endif
+
+/// <summary>
+/// The measuring method used for text layout.
+/// </summary>
+typedef enum DWRITE_MEASURING_MODE
+{
+ /// <summary>
+ /// Text is measured using glyph ideal metrics whose values are independent to the current display resolution.
+ /// </summary>
+ DWRITE_MEASURING_MODE_NATURAL,
+
+ /// <summary>
+ /// Text is measured using glyph display compatible metrics whose values tuned for the current display resolution.
+ /// </summary>
+ DWRITE_MEASURING_MODE_GDI_CLASSIC,
+
+ /// <summary>
+ /// Text is measured using the same glyph display metrics as text measured by GDI using a font
+ /// created with CLEARTYPE_NATURAL_QUALITY.
+ /// </summary>
+ DWRITE_MEASURING_MODE_GDI_NATURAL
+
+} DWRITE_MEASURING_MODE;
+
+#endif /* DCOMMON_H_INCLUDED */
diff --git a/core/src/fxge/Microsoft SDK/include/GdiPlus.h b/core/src/fxge/Microsoft SDK/include/GdiPlus.h
index 82393e7050..75eb509469 100644
--- a/core/src/fxge/Microsoft SDK/include/GdiPlus.h
+++ b/core/src/fxge/Microsoft SDK/include/GdiPlus.h
@@ -1,156 +1,156 @@
-/**************************************************************************\
-*
-* Copyright (c) 1998-2000, Microsoft Corp. All Rights Reserved.
-*
-* Module Name:
-*
-* Gdiplus.h
-*
-* Abstract:
-*
-* GDI+ Native C++ public header file
-*
-\**************************************************************************/
-
-#ifndef _GDIPLUS_H
-#define _GDIPLUS_H
-
-struct IDirectDrawSurface7;
-
-typedef signed short INT16;
-typedef unsigned short UINT16;
-
-#ifndef DCR_REMOVE_INTERNAL
-
-#ifndef DCR_USE_NEW_105760
- #define DCR_USE_NEW_105760
-#endif
-#ifndef DCR_USE_NEW_127084
- #define DCR_USE_NEW_127084
-#endif
-#ifndef DCR_USE_NEW_135429
- #define DCR_USE_NEW_135429
-#endif
-#ifndef DCR_USE_NEW_140782
- #define DCR_USE_NEW_140782
-#endif
-#ifndef DCR_USE_NEW_140855
- #define DCR_USE_NEW_140855
-#endif
-#ifndef DCR_USE_NEW_140857
- #define DCR_USE_NEW_140857
-#endif
-#ifndef DCR_USE_NEW_140861
- #define DCR_USE_NEW_140861
-#endif
-#ifndef DCR_USE_NEW_145135
- #define DCR_USE_NEW_145135
-#endif
-#ifndef DCR_USE_NEW_145138
- #define DCR_USE_NEW_145138
-#endif
-#ifndef DCR_USE_NEW_145139
- #define DCR_USE_NEW_145139
-#endif
-#ifndef DCR_USE_NEW_145804
- #define DCR_USE_NEW_145804
-#endif
-#ifndef DCR_USE_NEW_146933
- #define DCR_USE_NEW_146933
-#endif
-#ifndef DCR_USE_NEW_152154
- #define DCR_USE_NEW_152154
-#endif
-#ifndef DCR_USE_NEW_175866
- #define DCR_USE_NEW_175866
-#endif
-
-#ifndef DCR_USE_NEW_188922
- #define DCR_USE_NEW_188922
-#endif
-#ifndef DCR_USE_NEW_137252
- #define DCR_USE_NEW_137252
-#endif
-#ifndef DCR_USE_NEW_202903
- #define DCR_USE_NEW_202903
-#endif
-#ifndef DCR_USE_NEW_197819
- #define DCR_USE_NEW_197819
-#endif
-#ifndef DCR_USE_NEW_186091
- #define DCR_USE_NEW_186091
-#endif
-#ifndef DCR_USE_NEW_125467
- #define DCR_USE_NEW_125467
-#endif
-#ifndef DCR_USE_NEW_168772
- #define DCR_USE_NEW_168772
-#endif
-#ifndef DCR_USE_NEW_186764
- #define DCR_USE_NEW_186764
-#endif
-#ifndef DCR_USE_NEW_174340
- #define DCR_USE_NEW_174340
-#endif
-#ifndef DCR_USE_NEW_186151
- #define DCR_USE_NEW_186151
-#endif
-
-#ifndef DCR_USE_NEW_235072
- #define DCR_USE_NEW_235072
-#endif
-
-#endif // DCR_REMOVE_INTERNAL
-
-namespace Gdiplus
-{
- namespace DllExports
- {
- #include "GdiplusMem.h"
- };
-
- #include "GdiplusBase.h"
-
- // The following headers are used internally as well
- #include "GdiplusEnums.h"
- #include "GdiplusTypes.h"
- #include "GdiplusInit.h"
- #include "GdiplusPixelFormats.h"
- #include "GdiplusColor.h"
- #include "GdiplusMetaHeader.h"
- #include "GdiplusImaging.h"
- #include "GdiplusColorMatrix.h"
-
- // The rest of these are used only by the application
-
- #include "GdiplusGpStubs.h"
- #include "GdiplusHeaders.h"
-
- namespace DllExports
- {
- #include "GdiplusFlat.h"
- };
-
-
- #include "GdiplusImageAttributes.h"
- #include "GdiplusMatrix.h"
- #include "GdiplusBrush.h"
- #include "GdiplusPen.h"
- #include "GdiplusStringFormat.h"
- #include "GdiplusPath.h"
- #include "GdiplusLineCaps.h"
- #include "GdiplusMetafile.h"
- #include "GdiplusGraphics.h"
- #include "GdiplusCachedBitmap.h"
- #include "GdiplusRegion.h"
- #include "GdiplusFontCollection.h"
- #include "GdiplusFontFamily.h"
- #include "GdiplusFont.h"
- #include "GdiplusBitmap.h"
- #include "GdiplusImageCodec.h"
-
-}; // namespace Gdiplus
-
-
-
-#endif // !_GDIPLUS_HPP
+/**************************************************************************\
+*
+* Copyright (c) 1998-2000, Microsoft Corp. All Rights Reserved.
+*
+* Module Name:
+*
+* Gdiplus.h
+*
+* Abstract:
+*
+* GDI+ Native C++ public header file
+*
+\**************************************************************************/
+
+#ifndef _GDIPLUS_H
+#define _GDIPLUS_H
+
+struct IDirectDrawSurface7;
+
+typedef signed short INT16;
+typedef unsigned short UINT16;
+
+#ifndef DCR_REMOVE_INTERNAL
+
+#ifndef DCR_USE_NEW_105760
+ #define DCR_USE_NEW_105760
+#endif
+#ifndef DCR_USE_NEW_127084
+ #define DCR_USE_NEW_127084
+#endif
+#ifndef DCR_USE_NEW_135429
+ #define DCR_USE_NEW_135429
+#endif
+#ifndef DCR_USE_NEW_140782
+ #define DCR_USE_NEW_140782
+#endif
+#ifndef DCR_USE_NEW_140855
+ #define DCR_USE_NEW_140855
+#endif
+#ifndef DCR_USE_NEW_140857
+ #define DCR_USE_NEW_140857
+#endif
+#ifndef DCR_USE_NEW_140861
+ #define DCR_USE_NEW_140861
+#endif
+#ifndef DCR_USE_NEW_145135
+ #define DCR_USE_NEW_145135
+#endif
+#ifndef DCR_USE_NEW_145138
+ #define DCR_USE_NEW_145138
+#endif
+#ifndef DCR_USE_NEW_145139
+ #define DCR_USE_NEW_145139
+#endif
+#ifndef DCR_USE_NEW_145804
+ #define DCR_USE_NEW_145804
+#endif
+#ifndef DCR_USE_NEW_146933
+ #define DCR_USE_NEW_146933
+#endif
+#ifndef DCR_USE_NEW_152154
+ #define DCR_USE_NEW_152154
+#endif
+#ifndef DCR_USE_NEW_175866
+ #define DCR_USE_NEW_175866
+#endif
+
+#ifndef DCR_USE_NEW_188922
+ #define DCR_USE_NEW_188922
+#endif
+#ifndef DCR_USE_NEW_137252
+ #define DCR_USE_NEW_137252
+#endif
+#ifndef DCR_USE_NEW_202903
+ #define DCR_USE_NEW_202903
+#endif
+#ifndef DCR_USE_NEW_197819
+ #define DCR_USE_NEW_197819
+#endif
+#ifndef DCR_USE_NEW_186091
+ #define DCR_USE_NEW_186091
+#endif
+#ifndef DCR_USE_NEW_125467
+ #define DCR_USE_NEW_125467
+#endif
+#ifndef DCR_USE_NEW_168772
+ #define DCR_USE_NEW_168772
+#endif
+#ifndef DCR_USE_NEW_186764
+ #define DCR_USE_NEW_186764
+#endif
+#ifndef DCR_USE_NEW_174340
+ #define DCR_USE_NEW_174340
+#endif
+#ifndef DCR_USE_NEW_186151
+ #define DCR_USE_NEW_186151
+#endif
+
+#ifndef DCR_USE_NEW_235072
+ #define DCR_USE_NEW_235072
+#endif
+
+#endif // DCR_REMOVE_INTERNAL
+
+namespace Gdiplus
+{
+ namespace DllExports
+ {
+ #include "GdiplusMem.h"
+ };
+
+ #include "GdiplusBase.h"
+
+ // The following headers are used internally as well
+ #include "GdiplusEnums.h"
+ #include "GdiplusTypes.h"
+ #include "GdiplusInit.h"
+ #include "GdiplusPixelFormats.h"
+ #include "GdiplusColor.h"
+ #include "GdiplusMetaHeader.h"
+ #include "GdiplusImaging.h"
+ #include "GdiplusColorMatrix.h"
+
+ // The rest of these are used only by the application
+
+ #include "GdiplusGpStubs.h"
+ #include "GdiplusHeaders.h"
+
+ namespace DllExports
+ {
+ #include "GdiplusFlat.h"
+ };
+
+
+ #include "GdiplusImageAttributes.h"
+ #include "GdiplusMatrix.h"
+ #include "GdiplusBrush.h"
+ #include "GdiplusPen.h"
+ #include "GdiplusStringFormat.h"
+ #include "GdiplusPath.h"
+ #include "GdiplusLineCaps.h"
+ #include "GdiplusMetafile.h"
+ #include "GdiplusGraphics.h"
+ #include "GdiplusCachedBitmap.h"
+ #include "GdiplusRegion.h"
+ #include "GdiplusFontCollection.h"
+ #include "GdiplusFontFamily.h"
+ #include "GdiplusFont.h"
+ #include "GdiplusBitmap.h"
+ #include "GdiplusImageCodec.h"
+
+}; // namespace Gdiplus
+
+
+
+#endif // !_GDIPLUS_HPP
diff --git a/core/src/fxge/Microsoft SDK/include/GdiPlusBase.h b/core/src/fxge/Microsoft SDK/include/GdiPlusBase.h
index 40a977d1b1..59f7cc2fee 100644
--- a/core/src/fxge/Microsoft SDK/include/GdiPlusBase.h
+++ b/core/src/fxge/Microsoft SDK/include/GdiPlusBase.h
@@ -1,40 +1,40 @@
-/**************************************************************************\
-*
-* Copyright (c) 1998-2000, Microsoft Corp. All Rights Reserved.
-*
-* Module Name:
-*
-* GdiplusBase.h
-*
-* Abstract:
-*
-* Represents the base class for GDIPlus memory allocation.
-*
-\**************************************************************************/
-
-#ifndef _GDIPLUSBASE_H
-#define _GDIPLUSBASE_H
-
-class GdiplusBase
-{
-public:
- void (operator delete)(void* in_pVoid)
- {
- DllExports::GdipFree(in_pVoid);
- }
- void* (operator new)(size_t in_size)
- {
- return DllExports::GdipAlloc(in_size);
- }
- void (operator delete[])(void* in_pVoid)
- {
- DllExports::GdipFree(in_pVoid);
- }
- void* (operator new[])(size_t in_size)
- {
- return DllExports::GdipAlloc(in_size);
- }
-};
-
-#endif
-
+/**************************************************************************\
+*
+* Copyright (c) 1998-2000, Microsoft Corp. All Rights Reserved.
+*
+* Module Name:
+*
+* GdiplusBase.h
+*
+* Abstract:
+*
+* Represents the base class for GDIPlus memory allocation.
+*
+\**************************************************************************/
+
+#ifndef _GDIPLUSBASE_H
+#define _GDIPLUSBASE_H
+
+class GdiplusBase
+{
+public:
+ void (operator delete)(void* in_pVoid)
+ {
+ DllExports::GdipFree(in_pVoid);
+ }
+ void* (operator new)(size_t in_size)
+ {
+ return DllExports::GdipAlloc(in_size);
+ }
+ void (operator delete[])(void* in_pVoid)
+ {
+ DllExports::GdipFree(in_pVoid);
+ }
+ void* (operator new[])(size_t in_size)
+ {
+ return DllExports::GdipAlloc(in_size);
+ }
+};
+
+#endif
+
diff --git a/core/src/fxge/Microsoft SDK/include/GdiPlusBitmap.h b/core/src/fxge/Microsoft SDK/include/GdiPlusBitmap.h
index fbe0061d41..16d66bdaeb 100644
--- a/core/src/fxge/Microsoft SDK/include/GdiPlusBitmap.h
+++ b/core/src/fxge/Microsoft SDK/include/GdiPlusBitmap.h
@@ -1,1004 +1,1004 @@
-/**************************************************************************\
-*
-* Copyright (c) 1998-2000, Microsoft Corp. All Rights Reserved.
-*
-* Module Name:
-*
-* GdiplusBitmap.h
-*
-* Abstract:
-*
-* Bitmap related declarations
-*
-\**************************************************************************/
-
-#ifndef _GDIPLUSBITMAP_H
-#define _GDIPLUSBITMAP_H
-
-// NOTE:
-// Our current choice for the public API is to use constructors
-// instead of static load functions to create image objects.
-//
-// I've kept the static load functions here for now so that
-// existing test programs are not broken. But they should
-// eventually be taken out.
-
-#ifndef DCR_USE_NEW_140782
-
-inline
-Image::Image(
- IN const WCHAR* filename
- )
-{
- nativeImage = NULL;
- lastResult = DllExports::GdipLoadImageFromFile(filename, &nativeImage);
-}
-
-inline
-Image::Image(
- IN IStream* stream
- )
-{
- nativeImage = NULL;
- lastResult = DllExports::GdipLoadImageFromStream(stream, &nativeImage);
-}
-
-inline Image*
-Image::FromFile(
- IN const WCHAR* filename
- )
-{
- return new Image(filename);
-}
-
-inline Image*
-Image::FromStream(
- IN IStream* stream
- )
-{
- return new Image(stream);
-}
-
-#else
-
-inline
-Image::Image(
- IN const WCHAR* filename,
- IN BOOL useEmbeddedColorManagement
- )
-{
- nativeImage = NULL;
- if(useEmbeddedColorManagement)
- {
- lastResult = DllExports::GdipLoadImageFromFileICM(
- filename,
- &nativeImage
- );
- }
- else
- {
- lastResult = DllExports::GdipLoadImageFromFile(
- filename,
- &nativeImage
- );
- }
-}
-
-inline
-Image::Image(
- IN IStream* stream,
- IN BOOL useEmbeddedColorManagement
- )
-{
- nativeImage = NULL;
- if(useEmbeddedColorManagement)
- {
- lastResult = DllExports::GdipLoadImageFromStreamICM(
- stream,
- &nativeImage
- );
- }
- else
- {
- lastResult = DllExports::GdipLoadImageFromStream(
- stream,
- &nativeImage
- );
- }
-}
-
-inline Image*
-Image::FromFile(
- IN const WCHAR* filename,
- IN BOOL useEmbeddedColorManagement
- )
-{
- return new Image(
- filename,
- useEmbeddedColorManagement
- );
-}
-
-inline Image*
-Image::FromStream(
- IN IStream* stream,
- IN BOOL useEmbeddedColorManagement
- )
-{
- return new Image(
- stream,
- useEmbeddedColorManagement
- );
-}
-
-#endif
-
-inline
-Image::~Image()
-{
- DllExports::GdipDisposeImage(nativeImage);
-}
-
-inline Image*
-Image::Clone()
-{
- GpImage *cloneimage = NULL;
-
- SetStatus(DllExports::GdipCloneImage(nativeImage, &cloneimage));
-
- return new Image(cloneimage, lastResult);
-}
-
-// Encorder Parameter
-
-inline UINT
-Image::GetEncoderParameterListSize(
- IN const CLSID* clsidEncoder
- )
-{
- UINT size = 0;
-
- SetStatus(DllExports::GdipGetEncoderParameterListSize(nativeImage,
- clsidEncoder,
- &size));
- return size;
-}
-
-inline Status
-Image::GetEncoderParameterList(
- IN const CLSID* clsidEncoder,
- IN UINT size,
- OUT EncoderParameters* buffer
- )
-{
- return SetStatus(DllExports::GdipGetEncoderParameterList(nativeImage,
- clsidEncoder,
- size,
- buffer));
-}
-
-// Save images
-
-inline Status
-Image::Save(
- IN const WCHAR* filename,
- IN const CLSID* clsidEncoder,
- IN const EncoderParameters *encoderParams
- )
-{
- return SetStatus(DllExports::GdipSaveImageToFile(nativeImage,
- filename,
- clsidEncoder,
- encoderParams));
-}
-
-inline Status
-Image::Save(
- IN IStream* stream,
- IN const CLSID* clsidEncoder,
- IN const EncoderParameters *encoderParams
- )
-{
- return SetStatus(DllExports::GdipSaveImageToStream(nativeImage,
- stream,
- clsidEncoder,
- encoderParams));
-}
-
-inline Status
-Image::SaveAdd(
- IN const EncoderParameters *encoderParams
- )
-{
- return SetStatus(DllExports::GdipSaveAdd(nativeImage,
- encoderParams));
-}
-
-inline Status
-Image::SaveAdd(
- IN Image* newImage,
- IN const EncoderParameters *encoderParams
- )
-{
- if ( newImage == NULL )
- {
- return SetStatus(InvalidParameter);
- }
-
- return SetStatus(DllExports::GdipSaveAddImage(nativeImage,
- newImage->nativeImage,
- encoderParams));
-}
-
-// Get size and type information
-inline ImageType
-Image::GetType() const
-{
- ImageType type = ImageTypeUnknown;
-
- SetStatus(DllExports::GdipGetImageType(nativeImage, &type));
-
- return type;
-}
-
-inline Status
-Image::GetPhysicalDimension(
- OUT SizeF* size
- )
-{
- if (size == NULL)
- {
- return SetStatus(InvalidParameter);
- }
-
- REAL width, height;
- Status status;
-
- status = SetStatus(DllExports::GdipGetImageDimension(nativeImage,
- &width, &height));
-
- size->Width = width;
- size->Height = height;
-
- return status;
-}
-
-inline Status
-Image::GetBounds(
- OUT RectF *srcRect,
- OUT Unit *srcUnit
- )
-{
- return SetStatus(DllExports::GdipGetImageBounds(nativeImage,
- srcRect, srcUnit));
-}
-
-inline UINT
-Image::GetWidth()
-{
- UINT width = 0;
-
- SetStatus(DllExports::GdipGetImageWidth(nativeImage, &width));
-
- return width;
-}
-
-inline UINT
-Image::GetHeight()
-{
- UINT height = 0;
-
- SetStatus(DllExports::GdipGetImageHeight(nativeImage, &height));
-
- return height;
-}
-
-inline REAL
-Image::GetHorizontalResolution()
-{
- REAL resolution = 0.0f;
-
- SetStatus(DllExports::GdipGetImageHorizontalResolution(nativeImage, &resolution));
-
- return resolution;
-}
-
-inline REAL
-Image::GetVerticalResolution()
-{
- REAL resolution = 0.0f;
-
- SetStatus(DllExports::GdipGetImageVerticalResolution(nativeImage, &resolution));
-
- return resolution;
-}
-
-inline UINT
-Image::GetFlags()
-{
- UINT flags = 0;
-
- SetStatus(DllExports::GdipGetImageFlags(nativeImage, &flags));
-
- return flags;
-}
-
-inline Status
-Image::GetRawFormat(OUT GUID *format)
-{
- return SetStatus(DllExports::GdipGetImageRawFormat(nativeImage, format));
-}
-
-inline PixelFormat
-Image::GetPixelFormat()
-{
- PixelFormat format;
-
- SetStatus(DllExports::GdipGetImagePixelFormat(nativeImage, &format));
-
- return format;
-}
-
-inline INT
-Image::GetPaletteSize()
-{
- INT size = 0;
-
- SetStatus(DllExports::GdipGetImagePaletteSize(nativeImage, &size));
-
- return size;
-}
-
-inline Status
-Image::GetPalette(
- OUT ColorPalette *palette,
- IN INT size
-)
-{
- return SetStatus(DllExports::GdipGetImagePalette(nativeImage, palette, size));
-}
-
-inline Status
-Image::SetPalette(
- IN const ColorPalette *palette
- )
-{
- return SetStatus(DllExports::GdipSetImagePalette(nativeImage, palette));
-}
-
-// Thumbnail support
-
-inline Image*
-Image::GetThumbnailImage(
- IN UINT thumbWidth,
- IN UINT thumbHeight,
- IN GetThumbnailImageAbort callback,
- IN VOID* callbackData
- )
-{
- GpImage *thumbimage = NULL;
-
- SetStatus(DllExports::GdipGetImageThumbnail(nativeImage,
- thumbWidth, thumbHeight,
- &thumbimage,
- callback, callbackData));
-
- Image *newImage = new Image(thumbimage, lastResult);
-
- if (newImage == NULL)
- {
- DllExports::GdipDisposeImage(thumbimage);
- }
-
- return newImage;
-}
-
-// Multi-frame support
-inline UINT
-Image::GetFrameDimensionsCount()
-{
- UINT count = 0;
-
- SetStatus(DllExports::GdipImageGetFrameDimensionsCount(nativeImage,
- &count));
-
- return count;
-}
-
-inline Status
-Image::GetFrameDimensionsList(
- OUT GUID* dimensionIDs,
- IN UINT count
- )
-{
- return SetStatus(DllExports::GdipImageGetFrameDimensionsList(nativeImage,
- dimensionIDs,
- count));
-}
-
-inline UINT
-Image::GetFrameCount(
- IN const GUID* dimensionID
- )
-{
- UINT count = 0;
-
- SetStatus(DllExports::GdipImageGetFrameCount(nativeImage,
- dimensionID,
- &count));
- return count;
-}
-
-inline Status
-Image::SelectActiveFrame(
- IN const GUID *dimensionID,
- IN UINT frameIndex
- )
-{
- return SetStatus(DllExports::GdipImageSelectActiveFrame(nativeImage,
- dimensionID,
- frameIndex));
-}
-
-inline Status
-Image::RotateFlip(
- IN RotateFlipType rotateFlipType
- )
-{
- return SetStatus(DllExports::GdipImageRotateFlip(nativeImage,
- rotateFlipType));
-}
-
-// Image property related functions
-
-inline UINT
-Image::GetPropertyCount()
-{
- UINT numProperty = 0;
-
- SetStatus(DllExports::GdipGetPropertyCount(nativeImage,
- &numProperty));
-
- return numProperty;
-}
-
-inline Status
-Image::GetPropertyIdList(
- IN UINT numOfProperty,
- OUT PROPID* list
- )
-{
- return SetStatus(DllExports::GdipGetPropertyIdList(nativeImage,
- numOfProperty, list));
-}
-
-inline UINT
-Image::GetPropertyItemSize(
- IN PROPID propId
- )
-{
- UINT size = 0;
-
- SetStatus(DllExports::GdipGetPropertyItemSize(nativeImage,
- propId,
- &size));
-
- return size;
-}
-
-inline Status
-Image::GetPropertyItem(
- IN PROPID propId,
- IN UINT propSize,
- OUT PropertyItem* buffer
- )
-{
- return SetStatus(DllExports::GdipGetPropertyItem(nativeImage,
- propId, propSize, buffer));
-}
-
-inline Status
-Image::GetPropertySize(
- OUT UINT* totalBufferSize,
- OUT UINT* numProperties
- )
-{
- return SetStatus(DllExports::GdipGetPropertySize(nativeImage,
- totalBufferSize,
- numProperties));
-}
-
-inline Status
-Image::GetAllPropertyItems(
- IN UINT totalBufferSize,
- IN UINT numProperties,
- OUT PropertyItem* allItems
- )
-{
- if (allItems == NULL)
- {
- return SetStatus(InvalidParameter);
- }
- return SetStatus(DllExports::GdipGetAllPropertyItems(nativeImage,
- totalBufferSize,
- numProperties,
- allItems));
-}
-
-inline Status
-Image::RemovePropertyItem(
- IN PROPID propId
- )
-{
- return SetStatus(DllExports::GdipRemovePropertyItem(nativeImage, propId));
-}
-
-inline Status
-Image::SetPropertyItem(
- IN const PropertyItem* item
- )
-{
- return SetStatus(DllExports::GdipSetPropertyItem(nativeImage, item));
-}
-
-// Get/SetLayout
-// Support for Middle East localization (right-to-left mirroring)
-
-inline ImageLayout
-Image::GetLayout() const
-{
- ImageLayout layout;
-
- SetStatus(DllExports::GdipGetImageLayout(nativeImage, &layout));
-
- return layout;
-}
-
-inline Status
-Image::SetLayout(IN const ImageLayout layout)
-{
- return SetStatus(
- DllExports::GdipSetImageLayout(nativeImage, layout)
- );
-}
-
-inline Status
-Image::GetLastStatus() const
-{
- Status lastStatus = lastResult;
- lastResult = Ok;
-
- return lastStatus;
-}
-
-inline
-Image::Image(GpImage *nativeImage, Status status)
-{
- SetNativeImage(nativeImage);
- lastResult = status;
-}
-
-inline VOID
-Image::SetNativeImage(GpImage *nativeImage)
-{
- this->nativeImage = nativeImage;
-}
-
-inline
-Bitmap::Bitmap(
- IN const WCHAR *filename,
- IN BOOL useEmbeddedColorManagement
- )
-{
- GpBitmap *bitmap = NULL;
-
- if(useEmbeddedColorManagement)
- {
- lastResult = DllExports::GdipCreateBitmapFromFileICM(filename, &bitmap);
- }
- else
- {
- lastResult = DllExports::GdipCreateBitmapFromFile(filename, &bitmap);
- }
-
- SetNativeImage(bitmap);
-}
-
-inline
-Bitmap::Bitmap(
- IN IStream *stream,
- IN BOOL useEmbeddedColorManagement
- )
-{
- GpBitmap *bitmap = NULL;
-
- if(useEmbeddedColorManagement)
- {
- lastResult = DllExports::GdipCreateBitmapFromStreamICM(stream, &bitmap);
- }
- else
- {
- lastResult = DllExports::GdipCreateBitmapFromStream(stream, &bitmap);
- }
-
- SetNativeImage(bitmap);
-}
-
-inline
-Bitmap::Bitmap(
- IN INT width,
- IN INT height,
- IN INT stride,
- IN PixelFormat format,
- IN BYTE *scan0
- )
-{
- GpBitmap *bitmap = NULL;
-
- lastResult = DllExports::GdipCreateBitmapFromScan0(width,
- height,
- stride,
- format,
- scan0,
- &bitmap);
-
- SetNativeImage(bitmap);
-}
-
-inline
-Bitmap::Bitmap(
- IN INT width,
- IN INT height,
- IN PixelFormat format
- )
-{
- GpBitmap *bitmap = NULL;
-
- lastResult = DllExports::GdipCreateBitmapFromScan0(width,
- height,
- 0,
- format,
- NULL,
- &bitmap);
-
- SetNativeImage(bitmap);
-}
-
-inline
-Bitmap::Bitmap(
- IN INT width,
- IN INT height,
- IN Graphics* target)
-{
- GpBitmap *bitmap = NULL;
-
- lastResult = DllExports::GdipCreateBitmapFromGraphics(width,
- height,
- target->nativeGraphics,
- &bitmap);
-
- SetNativeImage(bitmap);
-}
-
-inline
-Bitmap::Bitmap(
- IN IDirectDrawSurface7 * surface
- )
-{
- GpBitmap *bitmap = NULL;
-
- lastResult = DllExports::GdipCreateBitmapFromDirectDrawSurface(surface,
- &bitmap);
-
- SetNativeImage(bitmap);
-}
-
-inline
-Bitmap::Bitmap(
- IN const BITMAPINFO* gdiBitmapInfo,
- IN VOID* gdiBitmapData
- )
-{
- GpBitmap *bitmap = NULL;
-
- lastResult = DllExports::GdipCreateBitmapFromGdiDib(gdiBitmapInfo,
- gdiBitmapData,
- &bitmap);
-
- SetNativeImage(bitmap);
-}
-
-inline
-Bitmap::Bitmap(
- IN HBITMAP hbm,
- IN HPALETTE hpal
- )
-{
- GpBitmap *bitmap = NULL;
-
- lastResult = DllExports::GdipCreateBitmapFromHBITMAP(hbm, hpal, &bitmap);
-
- SetNativeImage(bitmap);
-}
-
-inline
-Bitmap::Bitmap(
- IN HICON hicon
- )
-{
- GpBitmap *bitmap = NULL;
-
- lastResult = DllExports::GdipCreateBitmapFromHICON(hicon, &bitmap);
-
- SetNativeImage(bitmap);
-}
-
-inline
-Bitmap::Bitmap(
- IN HINSTANCE hInstance,
- IN const WCHAR *bitmapName
- )
-{
- GpBitmap *bitmap = NULL;
-
- lastResult = DllExports::GdipCreateBitmapFromResource(hInstance,
- bitmapName,
- &bitmap);
-
- SetNativeImage(bitmap);
-}
-
-
-inline Bitmap*
-Bitmap::FromFile(
- IN const WCHAR *filename,
- IN BOOL useEmbeddedColorManagement
- )
-{
- return new Bitmap(
- filename,
- useEmbeddedColorManagement
- );
-}
-
-inline Bitmap*
-Bitmap::FromStream(
- IN IStream *stream,
- IN BOOL useEmbeddedColorManagement
- )
-{
- return new Bitmap(
- stream,
- useEmbeddedColorManagement
- );
-}
-
-inline Bitmap*
-Bitmap::FromDirectDrawSurface7(
- IN IDirectDrawSurface7* surface
- )
-{
- return new Bitmap(surface);
-}
-
-inline Bitmap*
-Bitmap::FromBITMAPINFO(
- IN const BITMAPINFO* gdiBitmapInfo,
- IN VOID* gdiBitmapData)
-{
- return new Bitmap(gdiBitmapInfo, gdiBitmapData);
-}
-
-inline Bitmap*
-Bitmap::FromHBITMAP(
- IN HBITMAP hbm,
- IN HPALETTE hpal
- )
-{
- return new Bitmap(hbm, hpal);
-}
-
-inline Bitmap*
-Bitmap::FromHICON(
- IN HICON hicon
- )
-{
- return new Bitmap(hicon);
-}
-
-inline Bitmap*
-Bitmap::FromResource(
- IN HINSTANCE hInstance,
- IN const WCHAR *bitmapName)
-{
- return new Bitmap(hInstance, bitmapName);
-}
-
-inline Status
-Bitmap::GetHBITMAP(
- IN const Color& colorBackground,
- OUT HBITMAP* hbmReturn
- )
-{
- return SetStatus(DllExports::GdipCreateHBITMAPFromBitmap(
- static_cast<GpBitmap*>(nativeImage),
- hbmReturn,
- colorBackground.GetValue()));
-}
-
-inline Status
-Bitmap::GetHICON(
- OUT HICON* hiconReturn
- )
-{
- return SetStatus(DllExports::GdipCreateHICONFromBitmap(
- static_cast<GpBitmap*>(nativeImage),
- hiconReturn));
-}
-
-inline Bitmap*
-Bitmap::Clone(
- IN const Rect& rect,
- IN PixelFormat format
- )
-{
- return Clone(rect.X, rect.Y, rect.Width, rect.Height, format);
-}
-
-inline Bitmap*
-Bitmap::Clone(
- IN INT x,
- IN INT y,
- IN INT width,
- IN INT height,
- IN PixelFormat format
- )
-{
- GpBitmap* gpdstBitmap = NULL;
- Bitmap* bitmap;
-
- lastResult = DllExports::GdipCloneBitmapAreaI(
- x,
- y,
- width,
- height,
- format,
- (GpBitmap *)nativeImage,
- &gpdstBitmap);
-
- if (lastResult == Ok)
- {
- bitmap = new Bitmap(gpdstBitmap);
-
- if (bitmap == NULL)
- {
- DllExports::GdipDisposeImage(gpdstBitmap);
- }
-
- return bitmap;
- }
- else
- return NULL;
-}
-
-inline Bitmap*
-Bitmap::Clone(
- IN const RectF& rect,
- IN PixelFormat format
- )
-{
- return Clone(rect.X, rect.Y, rect.Width, rect.Height, format);
-}
-
-inline Bitmap*
-Bitmap::Clone(
- IN REAL x,
- IN REAL y,
- IN REAL width,
- IN REAL height,
- IN PixelFormat format
- )
-{
- GpBitmap* gpdstBitmap = NULL;
- Bitmap* bitmap;
-
- SetStatus(DllExports::GdipCloneBitmapArea(
- x,
- y,
- width,
- height,
- format,
- (GpBitmap *)nativeImage,
- &gpdstBitmap));
-
- if (lastResult == Ok)
- {
- bitmap = new Bitmap(gpdstBitmap);
-
- if (bitmap == NULL)
- {
- DllExports::GdipDisposeImage(gpdstBitmap);
- }
-
- return bitmap;
- }
- else
- return NULL;
-}
-
-inline Bitmap::Bitmap(GpBitmap *nativeBitmap)
-{
- lastResult = Ok;
-
- SetNativeImage(nativeBitmap);
-}
-
-inline Status
-Bitmap::LockBits(
- IN const Rect& rect,
- IN UINT flags,
- IN PixelFormat format,
- OUT BitmapData* lockedBitmapData
-)
-{
- return SetStatus(DllExports::GdipBitmapLockBits(
- static_cast<GpBitmap*>(nativeImage),
- &rect,
- flags,
- format,
- lockedBitmapData));
-}
-
-inline Status
-Bitmap::UnlockBits(
- IN BitmapData* lockedBitmapData
- )
-{
- return SetStatus(DllExports::GdipBitmapUnlockBits(
- static_cast<GpBitmap*>(nativeImage),
- lockedBitmapData));
-}
-
-inline Status
-Bitmap::GetPixel(
- IN INT x,
- IN INT y,
- OUT Color *color)
-{
- ARGB argb;
-
- Status status = SetStatus(DllExports::GdipBitmapGetPixel(
- static_cast<GpBitmap *>(nativeImage),
- x, y,
- &argb));
-
- if (status == Ok)
- {
- color->SetValue(argb);
- }
-
- return status;
-}
-
-inline Status
-Bitmap::SetPixel(
- IN INT x,
- IN INT y,
- IN const Color& color)
-{
- return SetStatus(DllExports::GdipBitmapSetPixel(
- static_cast<GpBitmap *>(nativeImage),
- x, y,
- color.GetValue()));
-}
-
-inline Status
-Bitmap::SetResolution(
- IN REAL xdpi,
- IN REAL ydpi)
-{
- return SetStatus(DllExports::GdipBitmapSetResolution(
- static_cast<GpBitmap *>(nativeImage),
- xdpi, ydpi));
-}
-#endif
+/**************************************************************************\
+*
+* Copyright (c) 1998-2000, Microsoft Corp. All Rights Reserved.
+*
+* Module Name:
+*
+* GdiplusBitmap.h
+*
+* Abstract:
+*
+* Bitmap related declarations
+*
+\**************************************************************************/
+
+#ifndef _GDIPLUSBITMAP_H
+#define _GDIPLUSBITMAP_H
+
+// NOTE:
+// Our current choice for the public API is to use constructors
+// instead of static load functions to create image objects.
+//
+// I've kept the static load functions here for now so that
+// existing test programs are not broken. But they should
+// eventually be taken out.
+
+#ifndef DCR_USE_NEW_140782
+
+inline
+Image::Image(
+ IN const WCHAR* filename
+ )
+{
+ nativeImage = NULL;
+ lastResult = DllExports::GdipLoadImageFromFile(filename, &nativeImage);
+}
+
+inline
+Image::Image(
+ IN IStream* stream
+ )
+{
+ nativeImage = NULL;
+ lastResult = DllExports::GdipLoadImageFromStream(stream, &nativeImage);
+}
+
+inline Image*
+Image::FromFile(
+ IN const WCHAR* filename
+ )
+{
+ return new Image(filename);
+}
+
+inline Image*
+Image::FromStream(
+ IN IStream* stream
+ )
+{
+ return new Image(stream);
+}
+
+#else
+
+inline
+Image::Image(
+ IN const WCHAR* filename,
+ IN BOOL useEmbeddedColorManagement
+ )
+{
+ nativeImage = NULL;
+ if(useEmbeddedColorManagement)
+ {
+ lastResult = DllExports::GdipLoadImageFromFileICM(
+ filename,
+ &nativeImage
+ );
+ }
+ else
+ {
+ lastResult = DllExports::GdipLoadImageFromFile(
+ filename,
+ &nativeImage
+ );
+ }
+}
+
+inline
+Image::Image(
+ IN IStream* stream,
+ IN BOOL useEmbeddedColorManagement
+ )
+{
+ nativeImage = NULL;
+ if(useEmbeddedColorManagement)
+ {
+ lastResult = DllExports::GdipLoadImageFromStreamICM(
+ stream,
+ &nativeImage
+ );
+ }
+ else
+ {
+ lastResult = DllExports::GdipLoadImageFromStream(
+ stream,
+ &nativeImage
+ );
+ }
+}
+
+inline Image*
+Image::FromFile(
+ IN const WCHAR* filename,
+ IN BOOL useEmbeddedColorManagement
+ )
+{
+ return new Image(
+ filename,
+ useEmbeddedColorManagement
+ );
+}
+
+inline Image*
+Image::FromStream(
+ IN IStream* stream,
+ IN BOOL useEmbeddedColorManagement
+ )
+{
+ return new Image(
+ stream,
+ useEmbeddedColorManagement
+ );
+}
+
+#endif
+
+inline
+Image::~Image()
+{
+ DllExports::GdipDisposeImage(nativeImage);
+}
+
+inline Image*
+Image::Clone()
+{
+ GpImage *cloneimage = NULL;
+
+ SetStatus(DllExports::GdipCloneImage(nativeImage, &cloneimage));
+
+ return new Image(cloneimage, lastResult);
+}
+
+// Encorder Parameter
+
+inline UINT
+Image::GetEncoderParameterListSize(
+ IN const CLSID* clsidEncoder
+ )
+{
+ UINT size = 0;
+
+ SetStatus(DllExports::GdipGetEncoderParameterListSize(nativeImage,
+ clsidEncoder,
+ &size));
+ return size;
+}
+
+inline Status
+Image::GetEncoderParameterList(
+ IN const CLSID* clsidEncoder,
+ IN UINT size,
+ OUT EncoderParameters* buffer
+ )
+{
+ return SetStatus(DllExports::GdipGetEncoderParameterList(nativeImage,
+ clsidEncoder,
+ size,
+ buffer));
+}
+
+// Save images
+
+inline Status
+Image::Save(
+ IN const WCHAR* filename,
+ IN const CLSID* clsidEncoder,
+ IN const EncoderParameters *encoderParams
+ )
+{
+ return SetStatus(DllExports::GdipSaveImageToFile(nativeImage,
+ filename,
+ clsidEncoder,
+ encoderParams));
+}
+
+inline Status
+Image::Save(
+ IN IStream* stream,
+ IN const CLSID* clsidEncoder,
+ IN const EncoderParameters *encoderParams
+ )
+{
+ return SetStatus(DllExports::GdipSaveImageToStream(nativeImage,
+ stream,
+ clsidEncoder,
+ encoderParams));
+}
+
+inline Status
+Image::SaveAdd(
+ IN const EncoderParameters *encoderParams
+ )
+{
+ return SetStatus(DllExports::GdipSaveAdd(nativeImage,
+ encoderParams));
+}
+
+inline Status
+Image::SaveAdd(
+ IN Image* newImage,
+ IN const EncoderParameters *encoderParams
+ )
+{
+ if ( newImage == NULL )
+ {
+ return SetStatus(InvalidParameter);
+ }
+
+ return SetStatus(DllExports::GdipSaveAddImage(nativeImage,
+ newImage->nativeImage,
+ encoderParams));
+}
+
+// Get size and type information
+inline ImageType
+Image::GetType() const
+{
+ ImageType type = ImageTypeUnknown;
+
+ SetStatus(DllExports::GdipGetImageType(nativeImage, &type));
+
+ return type;
+}
+
+inline Status
+Image::GetPhysicalDimension(
+ OUT SizeF* size
+ )
+{
+ if (size == NULL)
+ {
+ return SetStatus(InvalidParameter);
+ }
+
+ REAL width, height;
+ Status status;
+
+ status = SetStatus(DllExports::GdipGetImageDimension(nativeImage,
+ &width, &height));
+
+ size->Width = width;
+ size->Height = height;
+
+ return status;
+}
+
+inline Status
+Image::GetBounds(
+ OUT RectF *srcRect,
+ OUT Unit *srcUnit
+ )
+{
+ return SetStatus(DllExports::GdipGetImageBounds(nativeImage,
+ srcRect, srcUnit));
+}
+
+inline UINT
+Image::GetWidth()
+{
+ UINT width = 0;
+
+ SetStatus(DllExports::GdipGetImageWidth(nativeImage, &width));
+
+ return width;
+}
+
+inline UINT
+Image::GetHeight()
+{
+ UINT height = 0;
+
+ SetStatus(DllExports::GdipGetImageHeight(nativeImage, &height));
+
+ return height;
+}
+
+inline REAL
+Image::GetHorizontalResolution()
+{
+ REAL resolution = 0.0f;
+
+ SetStatus(DllExports::GdipGetImageHorizontalResolution(nativeImage, &resolution));
+
+ return resolution;
+}
+
+inline REAL
+Image::GetVerticalResolution()
+{
+ REAL resolution = 0.0f;
+
+ SetStatus(DllExports::GdipGetImageVerticalResolution(nativeImage, &resolution));
+
+ return resolution;
+}
+
+inline UINT
+Image::GetFlags()
+{
+ UINT flags = 0;
+
+ SetStatus(DllExports::GdipGetImageFlags(nativeImage, &flags));
+
+ return flags;
+}
+
+inline Status
+Image::GetRawFormat(OUT GUID *format)
+{
+ return SetStatus(DllExports::GdipGetImageRawFormat(nativeImage, format));
+}
+
+inline PixelFormat
+Image::GetPixelFormat()
+{
+ PixelFormat format;
+
+ SetStatus(DllExports::GdipGetImagePixelFormat(nativeImage, &format));
+
+ return format;
+}
+
+inline INT
+Image::GetPaletteSize()
+{
+ INT size = 0;
+
+ SetStatus(DllExports::GdipGetImagePaletteSize(nativeImage, &size));
+
+ return size;
+}
+
+inline Status
+Image::GetPalette(
+ OUT ColorPalette *palette,
+ IN INT size
+)
+{
+ return SetStatus(DllExports::GdipGetImagePalette(nativeImage, palette, size));
+}
+
+inline Status
+Image::SetPalette(
+ IN const ColorPalette *palette
+ )
+{
+ return SetStatus(DllExports::GdipSetImagePalette(nativeImage, palette));
+}
+
+// Thumbnail support
+
+inline Image*
+Image::GetThumbnailImage(
+ IN UINT thumbWidth,
+ IN UINT thumbHeight,
+ IN GetThumbnailImageAbort callback,
+ IN VOID* callbackData
+ )
+{
+ GpImage *thumbimage = NULL;
+
+ SetStatus(DllExports::GdipGetImageThumbnail(nativeImage,
+ thumbWidth, thumbHeight,
+ &thumbimage,
+ callback, callbackData));
+
+ Image *newImage = new Image(thumbimage, lastResult);
+
+ if (newImage == NULL)
+ {
+ DllExports::GdipDisposeImage(thumbimage);
+ }
+
+ return newImage;
+}
+
+// Multi-frame support
+inline UINT
+Image::GetFrameDimensionsCount()
+{
+ UINT count = 0;
+
+ SetStatus(DllExports::GdipImageGetFrameDimensionsCount(nativeImage,
+ &count));
+
+ return count;
+}
+
+inline Status
+Image::GetFrameDimensionsList(
+ OUT GUID* dimensionIDs,
+ IN UINT count
+ )
+{
+ return SetStatus(DllExports::GdipImageGetFrameDimensionsList(nativeImage,
+ dimensionIDs,
+ count));
+}
+
+inline UINT
+Image::GetFrameCount(
+ IN const GUID* dimensionID
+ )
+{
+ UINT count = 0;
+
+ SetStatus(DllExports::GdipImageGetFrameCount(nativeImage,
+ dimensionID,
+ &count));
+ return count;
+}
+
+inline Status
+Image::SelectActiveFrame(
+ IN const GUID *dimensionID,
+ IN UINT frameIndex
+ )
+{
+ return SetStatus(DllExports::GdipImageSelectActiveFrame(nativeImage,
+ dimensionID,
+ frameIndex));
+}
+
+inline Status
+Image::RotateFlip(
+ IN RotateFlipType rotateFlipType
+ )
+{
+ return SetStatus(DllExports::GdipImageRotateFlip(nativeImage,
+ rotateFlipType));
+}
+
+// Image property related functions
+
+inline UINT
+Image::GetPropertyCount()
+{
+ UINT numProperty = 0;
+
+ SetStatus(DllExports::GdipGetPropertyCount(nativeImage,
+ &numProperty));
+
+ return numProperty;
+}
+
+inline Status
+Image::GetPropertyIdList(
+ IN UINT numOfProperty,
+ OUT PROPID* list
+ )
+{
+ return SetStatus(DllExports::GdipGetPropertyIdList(nativeImage,
+ numOfProperty, list));
+}
+
+inline UINT
+Image::GetPropertyItemSize(
+ IN PROPID propId
+ )
+{
+ UINT size = 0;
+
+ SetStatus(DllExports::GdipGetPropertyItemSize(nativeImage,
+ propId,
+ &size));
+
+ return size;
+}
+
+inline Status
+Image::GetPropertyItem(
+ IN PROPID propId,
+ IN UINT propSize,
+ OUT PropertyItem* buffer
+ )
+{
+ return SetStatus(DllExports::GdipGetPropertyItem(nativeImage,
+ propId, propSize, buffer));
+}
+
+inline Status
+Image::GetPropertySize(
+ OUT UINT* totalBufferSize,
+ OUT UINT* numProperties
+ )
+{
+ return SetStatus(DllExports::GdipGetPropertySize(nativeImage,
+ totalBufferSize,
+ numProperties));
+}
+
+inline Status
+Image::GetAllPropertyItems(
+ IN UINT totalBufferSize,
+ IN UINT numProperties,
+ OUT PropertyItem* allItems
+ )
+{
+ if (allItems == NULL)
+ {
+ return SetStatus(InvalidParameter);
+ }
+ return SetStatus(DllExports::GdipGetAllPropertyItems(nativeImage,
+ totalBufferSize,
+ numProperties,
+ allItems));
+}
+
+inline Status
+Image::RemovePropertyItem(
+ IN PROPID propId
+ )
+{
+ return SetStatus(DllExports::GdipRemovePropertyItem(nativeImage, propId));
+}
+
+inline Status
+Image::SetPropertyItem(
+ IN const PropertyItem* item
+ )
+{
+ return SetStatus(DllExports::GdipSetPropertyItem(nativeImage, item));
+}
+
+// Get/SetLayout
+// Support for Middle East localization (right-to-left mirroring)
+
+inline ImageLayout
+Image::GetLayout() const
+{
+ ImageLayout layout;
+
+ SetStatus(DllExports::GdipGetImageLayout(nativeImage, &layout));
+
+ return layout;
+}
+
+inline Status
+Image::SetLayout(IN const ImageLayout layout)
+{
+ return SetStatus(
+ DllExports::GdipSetImageLayout(nativeImage, layout)
+ );
+}
+
+inline Status
+Image::GetLastStatus() const
+{
+ Status lastStatus = lastResult;
+ lastResult = Ok;
+
+ return lastStatus;
+}
+
+inline
+Image::Image(GpImage *nativeImage, Status status)
+{
+ SetNativeImage(nativeImage);
+ lastResult = status;
+}
+
+inline VOID
+Image::SetNativeImage(GpImage *nativeImage)
+{
+ this->nativeImage = nativeImage;
+}
+
+inline
+Bitmap::Bitmap(
+ IN const WCHAR *filename,
+ IN BOOL useEmbeddedColorManagement
+ )
+{
+ GpBitmap *bitmap = NULL;
+
+ if(useEmbeddedColorManagement)
+ {
+ lastResult = DllExports::GdipCreateBitmapFromFileICM(filename, &bitmap);
+ }
+ else
+ {
+ lastResult = DllExports::GdipCreateBitmapFromFile(filename, &bitmap);
+ }
+
+ SetNativeImage(bitmap);
+}
+
+inline
+Bitmap::Bitmap(
+ IN IStream *stream,
+ IN BOOL useEmbeddedColorManagement
+ )
+{
+ GpBitmap *bitmap = NULL;
+
+ if(useEmbeddedColorManagement)
+ {
+ lastResult = DllExports::GdipCreateBitmapFromStreamICM(stream, &bitmap);
+ }
+ else
+ {
+ lastResult = DllExports::GdipCreateBitmapFromStream(stream, &bitmap);
+ }
+
+ SetNativeImage(bitmap);
+}
+
+inline
+Bitmap::Bitmap(
+ IN INT width,
+ IN INT height,
+ IN INT stride,
+ IN PixelFormat format,
+ IN BYTE *scan0
+ )
+{
+ GpBitmap *bitmap = NULL;
+
+ lastResult = DllExports::GdipCreateBitmapFromScan0(width,
+ height,
+ stride,
+ format,
+ scan0,
+ &bitmap);
+
+ SetNativeImage(bitmap);
+}
+
+inline
+Bitmap::Bitmap(
+ IN INT width,
+ IN INT height,
+ IN PixelFormat format
+ )
+{
+ GpBitmap *bitmap = NULL;
+
+ lastResult = DllExports::GdipCreateBitmapFromScan0(width,
+ height,
+ 0,
+ format,
+ NULL,
+ &bitmap);
+
+ SetNativeImage(bitmap);
+}
+
+inline
+Bitmap::Bitmap(
+ IN INT width,
+ IN INT height,
+ IN Graphics* target)
+{
+ GpBitmap *bitmap = NULL;
+
+ lastResult = DllExports::GdipCreateBitmapFromGraphics(width,
+ height,
+ target->nativeGraphics,
+ &bitmap);
+
+ SetNativeImage(bitmap);
+}
+
+inline
+Bitmap::Bitmap(
+ IN IDirectDrawSurface7 * surface
+ )
+{
+ GpBitmap *bitmap = NULL;
+
+ lastResult = DllExports::GdipCreateBitmapFromDirectDrawSurface(surface,
+ &bitmap);
+
+ SetNativeImage(bitmap);
+}
+
+inline
+Bitmap::Bitmap(
+ IN const BITMAPINFO* gdiBitmapInfo,
+ IN VOID* gdiBitmapData
+ )
+{
+ GpBitmap *bitmap = NULL;
+
+ lastResult = DllExports::GdipCreateBitmapFromGdiDib(gdiBitmapInfo,
+ gdiBitmapData,
+ &bitmap);
+
+ SetNativeImage(bitmap);
+}
+
+inline
+Bitmap::Bitmap(
+ IN HBITMAP hbm,
+ IN HPALETTE hpal
+ )
+{
+ GpBitmap *bitmap = NULL;
+
+ lastResult = DllExports::GdipCreateBitmapFromHBITMAP(hbm, hpal, &bitmap);
+
+ SetNativeImage(bitmap);
+}
+
+inline
+Bitmap::Bitmap(
+ IN HICON hicon
+ )
+{
+ GpBitmap *bitmap = NULL;
+
+ lastResult = DllExports::GdipCreateBitmapFromHICON(hicon, &bitmap);
+
+ SetNativeImage(bitmap);
+}
+
+inline
+Bitmap::Bitmap(
+ IN HINSTANCE hInstance,
+ IN const WCHAR *bitmapName
+ )
+{
+ GpBitmap *bitmap = NULL;
+
+ lastResult = DllExports::GdipCreateBitmapFromResource(hInstance,
+ bitmapName,
+ &bitmap);
+
+ SetNativeImage(bitmap);
+}
+
+
+inline Bitmap*
+Bitmap::FromFile(
+ IN const WCHAR *filename,
+ IN BOOL useEmbeddedColorManagement
+ )
+{
+ return new Bitmap(
+ filename,
+ useEmbeddedColorManagement
+ );
+}
+
+inline Bitmap*
+Bitmap::FromStream(
+ IN IStream *stream,
+ IN BOOL useEmbeddedColorManagement
+ )
+{
+ return new Bitmap(
+ stream,
+ useEmbeddedColorManagement
+ );
+}
+
+inline Bitmap*
+Bitmap::FromDirectDrawSurface7(
+ IN IDirectDrawSurface7* surface
+ )
+{
+ return new Bitmap(surface);
+}
+
+inline Bitmap*
+Bitmap::FromBITMAPINFO(
+ IN const BITMAPINFO* gdiBitmapInfo,
+ IN VOID* gdiBitmapData)
+{
+ return new Bitmap(gdiBitmapInfo, gdiBitmapData);
+}
+
+inline Bitmap*
+Bitmap::FromHBITMAP(
+ IN HBITMAP hbm,
+ IN HPALETTE hpal
+ )
+{
+ return new Bitmap(hbm, hpal);
+}
+
+inline Bitmap*
+Bitmap::FromHICON(
+ IN HICON hicon
+ )
+{
+ return new Bitmap(hicon);
+}
+
+inline Bitmap*
+Bitmap::FromResource(
+ IN HINSTANCE hInstance,
+ IN const WCHAR *bitmapName)
+{
+ return new Bitmap(hInstance, bitmapName);
+}
+
+inline Status
+Bitmap::GetHBITMAP(
+ IN const Color& colorBackground,
+ OUT HBITMAP* hbmReturn
+ )
+{
+ return SetStatus(DllExports::GdipCreateHBITMAPFromBitmap(
+ static_cast<GpBitmap*>(nativeImage),
+ hbmReturn,
+ colorBackground.GetValue()));
+}
+
+inline Status
+Bitmap::GetHICON(
+ OUT HICON* hiconReturn
+ )
+{
+ return SetStatus(DllExports::GdipCreateHICONFromBitmap(
+ static_cast<GpBitmap*>(nativeImage),
+ hiconReturn));
+}
+
+inline Bitmap*
+Bitmap::Clone(
+ IN const Rect& rect,
+ IN PixelFormat format
+ )
+{
+ return Clone(rect.X, rect.Y, rect.Width, rect.Height, format);
+}
+
+inline Bitmap*
+Bitmap::Clone(
+ IN INT x,
+ IN INT y,
+ IN INT width,
+ IN INT height,
+ IN PixelFormat format
+ )
+{
+ GpBitmap* gpdstBitmap = NULL;
+ Bitmap* bitmap;
+
+ lastResult = DllExports::GdipCloneBitmapAreaI(
+ x,
+ y,
+ width,
+ height,
+ format,
+ (GpBitmap *)nativeImage,
+ &gpdstBitmap);
+
+ if (lastResult == Ok)
+ {
+ bitmap = new Bitmap(gpdstBitmap);
+
+ if (bitmap == NULL)
+ {
+ DllExports::GdipDisposeImage(gpdstBitmap);
+ }
+
+ return bitmap;
+ }
+ else
+ return NULL;
+}
+
+inline Bitmap*
+Bitmap::Clone(
+ IN const RectF& rect,
+ IN PixelFormat format
+ )
+{
+ return Clone(rect.X, rect.Y, rect.Width, rect.Height, format);
+}
+
+inline Bitmap*
+Bitmap::Clone(
+ IN REAL x,
+ IN REAL y,
+ IN REAL width,
+ IN REAL height,
+ IN PixelFormat format
+ )
+{
+ GpBitmap* gpdstBitmap = NULL;
+ Bitmap* bitmap;
+
+ SetStatus(DllExports::GdipCloneBitmapArea(
+ x,
+ y,
+ width,
+ height,
+ format,
+ (GpBitmap *)nativeImage,
+ &gpdstBitmap));
+
+ if (lastResult == Ok)
+ {
+ bitmap = new Bitmap(gpdstBitmap);
+
+ if (bitmap == NULL)
+ {
+ DllExports::GdipDisposeImage(gpdstBitmap);
+ }
+
+ return bitmap;
+ }
+ else
+ return NULL;
+}
+
+inline Bitmap::Bitmap(GpBitmap *nativeBitmap)
+{
+ lastResult = Ok;
+
+ SetNativeImage(nativeBitmap);
+}
+
+inline Status
+Bitmap::LockBits(
+ IN const Rect& rect,
+ IN UINT flags,
+ IN PixelFormat format,
+ OUT BitmapData* lockedBitmapData
+)
+{
+ return SetStatus(DllExports::GdipBitmapLockBits(
+ static_cast<GpBitmap*>(nativeImage),
+ &rect,
+ flags,
+ format,
+ lockedBitmapData));
+}
+
+inline Status
+Bitmap::UnlockBits(
+ IN BitmapData* lockedBitmapData
+ )
+{
+ return SetStatus(DllExports::GdipBitmapUnlockBits(
+ static_cast<GpBitmap*>(nativeImage),
+ lockedBitmapData));
+}
+
+inline Status
+Bitmap::GetPixel(
+ IN INT x,
+ IN INT y,
+ OUT Color *color)
+{
+ ARGB argb;
+
+ Status status = SetStatus(DllExports::GdipBitmapGetPixel(
+ static_cast<GpBitmap *>(nativeImage),
+ x, y,
+ &argb));
+
+ if (status == Ok)
+ {
+ color->SetValue(argb);
+ }
+
+ return status;
+}
+
+inline Status
+Bitmap::SetPixel(
+ IN INT x,
+ IN INT y,
+ IN const Color& color)
+{
+ return SetStatus(DllExports::GdipBitmapSetPixel(
+ static_cast<GpBitmap *>(nativeImage),
+ x, y,
+ color.GetValue()));
+}
+
+inline Status
+Bitmap::SetResolution(
+ IN REAL xdpi,
+ IN REAL ydpi)
+{
+ return SetStatus(DllExports::GdipBitmapSetResolution(
+ static_cast<GpBitmap *>(nativeImage),
+ xdpi, ydpi));
+}
+#endif
diff --git a/core/src/fxge/Microsoft SDK/include/GdiPlusBrush.h b/core/src/fxge/Microsoft SDK/include/GdiPlusBrush.h
index a506f87982..c25e34ae01 100644
--- a/core/src/fxge/Microsoft SDK/include/GdiPlusBrush.h
+++ b/core/src/fxge/Microsoft SDK/include/GdiPlusBrush.h
@@ -1,951 +1,951 @@
-/**************************************************************************\
-*
-* Copyright (c) 1998-2000, Microsoft Corp. All Rights Reserved.
-*
-* Module Name:
-*
-* GdiplusBrush.h
-*
-* Abstract:
-*
-* Brush API related declarations
-*
-\**************************************************************************/
-
-#ifndef _GDIPLUSBRUSH_H
-#define _GDIPLUSBRUSH_H
-
-//--------------------------------------------------------------------------
-// Abstract base class for various brush types
-//--------------------------------------------------------------------------
-
-class GraphicsPath;
-
-class Brush : public GdiplusBase
-{
-public:
- friend class Pen;
- friend class Graphics;
-
- virtual ~Brush()
- {
- DllExports::GdipDeleteBrush(nativeBrush);
- }
-
- virtual Brush* Clone() const
- {
- GpBrush *brush = NULL;
-
- SetStatus(DllExports::GdipCloneBrush(nativeBrush, &brush));
-
- Brush *newBrush = new Brush(brush, lastResult);
-
- if (newBrush == NULL)
- {
- DllExports::GdipDeleteBrush(brush);
- }
-
- return newBrush;
- }
-
- BrushType GetType() const
- {
- BrushType type = static_cast<BrushType>(-1);
-
- SetStatus(DllExports::GdipGetBrushType(nativeBrush, &type));
-
- return type;
- }
-
- Status GetLastStatus() const
- {
- Status lastStatus = lastResult;
- lastResult = Ok;
-
- return lastStatus;
- }
-
-protected:
-
- Brush()
- {
- SetStatus(NotImplemented);
- }
-
-#ifdef DCR_USE_NEW_250932
-
-private:
- Brush(const Brush& brush);
- Brush& operator=(const Brush& brush);
-protected:
-
-#else
-
- Brush(const Brush& brush)
- {
- brush;
- SetStatus(NotImplemented);
- }
-
- Brush& operator=(const Brush& brush)
- {
- brush;
- SetStatus(NotImplemented);
- return *this;
- }
-
-#endif
-
- Brush(GpBrush* nativeBrush, Status status)
- {
- lastResult = status;
- SetNativeBrush(nativeBrush);
- }
-
- VOID SetNativeBrush(GpBrush* nativeBrush)
- {
- this->nativeBrush = nativeBrush;
- }
-
- Status SetStatus(Status status) const
- {
- if (status != Ok)
- return (lastResult = status);
- else
- return status;
- }
-
- GpBrush* nativeBrush;
- mutable Status lastResult;
-};
-
-//--------------------------------------------------------------------------
-// Represent solid fill brush object
-//--------------------------------------------------------------------------
-
-class SolidBrush : public Brush
-{
-public:
- friend class Pen;
-
- SolidBrush(IN const Color& color)
- {
- GpSolidFill *brush = NULL;
-
- lastResult = DllExports::GdipCreateSolidFill(color.GetValue(), &brush);
-
- SetNativeBrush(brush);
- }
-
- Status GetColor(OUT Color* color) const
- {
- ARGB argb;
-
- if (color == NULL)
- {
- return SetStatus(InvalidParameter);
- }
-
- SetStatus(DllExports::GdipGetSolidFillColor((GpSolidFill*)nativeBrush,
- &argb));
-
- *color = Color(argb);
-
- return lastResult;
- }
-
- Status SetColor(IN const Color& color)
- {
- return SetStatus(DllExports::GdipSetSolidFillColor((GpSolidFill*)nativeBrush,
- color.GetValue()));
- }
-
-#ifdef DCR_USE_NEW_250932
-
-private:
- SolidBrush(const SolidBrush &);
- SolidBrush& operator=(const SolidBrush &);
-
-#endif
-
-protected:
-
- SolidBrush()
- {
- }
-};
-
-class TextureBrush : public Brush
-{
-public:
- friend class Pen;
-
- TextureBrush(IN Image* image,
- IN WrapMode wrapMode = WrapModeTile)
- {
- GpTexture *texture = NULL;
-
- lastResult = DllExports::GdipCreateTexture(
- image->nativeImage,
- wrapMode, &texture);
-
- SetNativeBrush(texture);
- }
-
- // When creating a texture brush from a metafile image, the dstRect
- // is used to specify the size that the metafile image should be
- // rendered at in the device units of the destination graphics.
- // It is NOT used to crop the metafile image, so only the width
- // and height values matter for metafiles.
- TextureBrush(IN Image* image,
- IN WrapMode wrapMode,
- IN const RectF &dstRect)
- {
- GpTexture *texture = NULL;
-
- lastResult = DllExports::GdipCreateTexture2(
- image->nativeImage,
- wrapMode,
- dstRect.X,
- dstRect.Y,
- dstRect.Width,
- dstRect.Height,
- &texture);
-
- SetNativeBrush(texture);
- }
-
- // When creating a texture brush from a metafile image, the dstRect
- // is used to specify the size that the metafile image should be
- // rendered at in the device units of the destination graphics.
- // It is NOT used to crop the metafile image, so only the width
- // and height values matter for metafiles.
-
- TextureBrush(IN Image *image,
- IN const RectF &dstRect,
- IN const ImageAttributes *imageAttributes = NULL)
- {
- GpTexture *texture = NULL;
-
- lastResult = DllExports::GdipCreateTextureIA(
- image->nativeImage,
- (imageAttributes)?imageAttributes->nativeImageAttr:NULL,
- dstRect.X,
- dstRect.Y,
- dstRect.Width,
- dstRect.Height,
- &texture
- );
-
- SetNativeBrush(texture);
- }
-
- #ifdef DCR_USE_NEW_145138
- TextureBrush(IN Image *image,
- IN const Rect &dstRect,
- IN const ImageAttributes *imageAttributes = NULL)
- {
- GpTexture *texture = NULL;
-
- lastResult = DllExports::GdipCreateTextureIAI(
- image->nativeImage,
- (imageAttributes)?imageAttributes->nativeImageAttr:NULL,
- dstRect.X,
- dstRect.Y,
- dstRect.Width,
- dstRect.Height,
- &texture
- );
-
- SetNativeBrush(texture);
- }
- #endif
-
- // When creating a texture brush from a metafile image, the dstRect
- // is used to specify the size that the metafile image should be
- // rendered at in the device units of the destination graphics.
- // It is NOT used to crop the metafile image, so only the width
- // and height values matter for metafiles.
-
- TextureBrush(
- IN Image* image,
- IN WrapMode wrapMode,
-
- #ifdef DCR_USE_NEW_145138
- const IN Rect &dstRect
- #else
- IN Rect &dstRect
- #endif
- )
- {
- GpTexture *texture = NULL;
-
- lastResult = DllExports::GdipCreateTexture2I(
- image->nativeImage,
- wrapMode,
- dstRect.X,
- dstRect.Y,
- dstRect.Width,
- dstRect.Height,
- &texture);
-
- SetNativeBrush(texture);
- }
-
- // When creating a texture brush from a metafile image, the dstRect
- // is used to specify the size that the metafile image should be
- // rendered at in the device units of the destination graphics.
- // It is NOT used to crop the metafile image, so only the width
- // and height values matter for metafiles.
- TextureBrush(IN Image* image,
- IN WrapMode wrapMode,
- IN REAL dstX,
- IN REAL dstY,
- IN REAL dstWidth,
- IN REAL dstHeight)
- {
- GpTexture *texture = NULL;
-
- lastResult = DllExports::GdipCreateTexture2(
- image->nativeImage,
- wrapMode,
- dstX,
- dstY,
- dstWidth,
- dstHeight,
- &texture);
-
- SetNativeBrush(texture);
- }
-
- // When creating a texture brush from a metafile image, the dstRect
- // is used to specify the size that the metafile image should be
- // rendered at in the device units of the destination graphics.
- // It is NOT used to crop the metafile image, so only the width
- // and height values matter for metafiles.
- TextureBrush(IN Image* image,
- IN WrapMode wrapMode,
- IN INT dstX,
- IN INT dstY,
- IN INT dstWidth,
- IN INT dstHeight)
- {
- GpTexture *texture = NULL;
-
- lastResult = DllExports::GdipCreateTexture2I(
- image->nativeImage,
- wrapMode,
- dstX,
- dstY,
- dstWidth,
- dstHeight,
- &texture);
-
- SetNativeBrush(texture);
- }
-
- /**
- * Set/get brush transform
- */
- Status SetTransform(IN const Matrix* matrix)
- {
- return SetStatus(DllExports::GdipSetTextureTransform((GpTexture*)nativeBrush,
- matrix->nativeMatrix));
- }
-
- Status GetTransform(OUT Matrix* matrix) const
- {
- return SetStatus(DllExports::GdipGetTextureTransform((GpTexture*)nativeBrush,
- matrix->nativeMatrix));
- }
-
- Status ResetTransform()
- {
- return SetStatus(DllExports::GdipResetTextureTransform((GpTexture*)nativeBrush));
- }
-
- Status MultiplyTransform(IN const Matrix* matrix,
- IN MatrixOrder order = MatrixOrderPrepend)
- {
- return SetStatus(DllExports::GdipMultiplyTextureTransform((GpTexture*)nativeBrush,
- matrix->nativeMatrix,
- order));
- }
-
- Status TranslateTransform(IN REAL dx,
- IN REAL dy,
- IN MatrixOrder order = MatrixOrderPrepend)
- {
- return SetStatus(DllExports::GdipTranslateTextureTransform((GpTexture*)nativeBrush,
- dx, dy, order));
- }
-
- Status ScaleTransform(IN REAL sx,
- IN REAL sy,
- IN MatrixOrder order = MatrixOrderPrepend)
- {
- return SetStatus(DllExports::GdipScaleTextureTransform((GpTexture*)nativeBrush,
- sx, sy, order));
- }
-
- Status RotateTransform(IN REAL angle,
- IN MatrixOrder order = MatrixOrderPrepend)
- {
- return SetStatus(DllExports::GdipRotateTextureTransform((GpTexture*)nativeBrush,
- angle, order));
- }
-
- /**
- * Set/get brush wrapping mode
- */
- Status SetWrapMode(IN WrapMode wrapMode)
- {
- return SetStatus(DllExports::GdipSetTextureWrapMode((GpTexture*)nativeBrush,
- wrapMode));
- }
-
- WrapMode GetWrapMode() const
- {
- WrapMode wrapMode;
-
- SetStatus(DllExports::GdipGetTextureWrapMode((GpTexture*)nativeBrush,
- &wrapMode));
- return wrapMode;
- }
-
- // Get texture brush attributes
-
- Image *GetImage() const
- {
- GpImage *image;
-
- SetStatus(DllExports::GdipGetTextureImage((GpTexture *)nativeBrush,
- &image));
-
- Image *retimage = new Image(image, lastResult);
-
- if (retimage == NULL)
- {
- DllExports::GdipDisposeImage(image);
- }
-
- return retimage;
- }
-
-#ifdef DCR_USE_NEW_250932
-
-private:
- TextureBrush(const TextureBrush &);
- TextureBrush& operator=(const TextureBrush &);
-
-#endif
-
-protected:
-
- TextureBrush()
- {
- }
-};
-
-//--------------------------------------------------------------------------
-// Represent line gradient brush object
-//--------------------------------------------------------------------------
-
-class LinearGradientBrush : public Brush
-{
-public:
- friend class Pen;
-
- LinearGradientBrush(IN const PointF& point1,
- IN const PointF& point2,
- IN const Color& color1,
- IN const Color& color2)
- {
- GpLineGradient *brush = NULL;
-
- lastResult = DllExports::GdipCreateLineBrush(&point1,
- &point2,
- color1.GetValue(),
- color2.GetValue(),
- WrapModeTile,
- &brush);
-
- SetNativeBrush(brush);
- }
-
- LinearGradientBrush(IN const Point& point1,
- IN const Point& point2,
- IN const Color& color1,
- IN const Color& color2)
- {
- GpLineGradient *brush = NULL;
-
- lastResult = DllExports::GdipCreateLineBrushI(&point1,
- &point2,
- color1.GetValue(),
- color2.GetValue(),
- WrapModeTile,
- &brush);
-
- SetNativeBrush(brush);
- }
-
- LinearGradientBrush(IN const RectF& rect,
- IN const Color& color1,
- IN const Color& color2,
- IN LinearGradientMode mode)
- {
- GpLineGradient *brush = NULL;
-
- lastResult = DllExports::GdipCreateLineBrushFromRect(&rect,
- color1.GetValue(),
- color2.GetValue(),
- mode,
- WrapModeTile,
- &brush);
-
- SetNativeBrush(brush);
- }
-
- LinearGradientBrush(IN const Rect& rect,
- IN const Color& color1,
- IN const Color& color2,
- IN LinearGradientMode mode)
- {
- GpLineGradient *brush = NULL;
-
- lastResult = DllExports::GdipCreateLineBrushFromRectI(&rect,
- color1.GetValue(),
- color2.GetValue(),
- mode,
- WrapModeTile,
- &brush);
-
- SetNativeBrush(brush);
- }
-
- LinearGradientBrush(IN const RectF& rect,
- IN const Color& color1,
- IN const Color& color2,
- IN REAL angle,
- IN BOOL isAngleScalable = FALSE)
- {
- GpLineGradient *brush = NULL;
-
- lastResult = DllExports::GdipCreateLineBrushFromRectWithAngle(&rect,
- color1.GetValue(),
- color2.GetValue(),
- angle,
- isAngleScalable,
- WrapModeTile,
- &brush);
-
- SetNativeBrush(brush);
- }
-
- LinearGradientBrush(IN const Rect& rect,
- IN const Color& color1,
- IN const Color& color2,
- IN REAL angle,
- IN BOOL isAngleScalable = FALSE)
- {
- GpLineGradient *brush = NULL;
-
- lastResult = DllExports::GdipCreateLineBrushFromRectWithAngleI(&rect,
- color1.GetValue(),
- color2.GetValue(),
- angle,
- isAngleScalable,
- WrapModeTile,
- &brush);
-
- SetNativeBrush(brush);
- }
-
- // Get/set point attributes
-
- Status SetLinearPoints(IN const PointF& point1,
- IN const PointF& point2)
- {
- return SetStatus(DllExports::GdipSetLinePoints((GpLineGradient*)nativeBrush,
- &point1, &point2));
- }
-
- Status GetLinearPoints(OUT PointF* points) const
- {
- return SetStatus(DllExports::GdipGetLinePoints((GpLineGradient*) nativeBrush,
- points));
- }
-
- Status SetLinearPoints(IN const Point& point1,
- IN const Point& point2)
- {
- return SetStatus(DllExports::GdipSetLinePointsI((GpLineGradient*)nativeBrush,
- &point1, &point2));
- }
-
- Status GetLinearPoints(OUT Point* points) const
- {
- return SetStatus(DllExports::GdipGetLinePointsI((GpLineGradient*) nativeBrush,
- points));
- }
- // Get/set color attributes
-
- Status SetLinearColors(IN const Color& color1,
- IN const Color& color2)
- {
- return SetStatus(DllExports::GdipSetLineColors((GpLineGradient*)nativeBrush,
- color1.GetValue(),
- color2.GetValue()));
- }
-
- Status GetLinearColors(OUT Color* colors) const
- {
- ARGB argb[2];
-
- if (colors == NULL)
- {
- return SetStatus(InvalidParameter);
- }
-
- SetStatus(DllExports::GdipGetLineColors((GpLineGradient*) nativeBrush, argb));
-
- if (lastResult == Ok)
- {
- // use bitwise copy operator for Color copy
- colors[0] = Color(argb[0]);
- colors[1] = Color(argb[1]);
- }
-
- return lastResult;
- }
-
- Status GetRectangle(OUT RectF* rect) const
- {
- return SetStatus(DllExports::GdipGetLineRect((GpLineGradient*)nativeBrush, rect));
- }
-
- // integer version
- Status GetRectangle(OUT Rect* rect) const
- {
- return SetStatus(DllExports::GdipGetLineRectI((GpLineGradient*)nativeBrush, rect));
- }
-
- // Gamma correction in interporlation.
-
- Status SetGammaCorrection(IN BOOL useGammaCorrection)
- {
- return SetStatus(DllExports::GdipSetLineGammaCorrection((GpLineGradient*)nativeBrush,
- useGammaCorrection));
- }
-
- BOOL GetGammaCorrection() const
- {
- BOOL useGammaCorrection;
-
- SetStatus(DllExports::GdipGetLineGammaCorrection((GpLineGradient*)nativeBrush,
- &useGammaCorrection));
-
- return useGammaCorrection;
- }
-
- INT GetBlendCount() const
- {
- INT count = 0;
-
- SetStatus(DllExports::GdipGetLineBlendCount((GpLineGradient*)
- nativeBrush,
- &count));
-
- return count;
- }
-
- Status SetBlend(IN const REAL* blendFactors,
- IN const REAL* blendPositions,
- IN INT count)
- {
- return SetStatus(DllExports::GdipSetLineBlend((GpLineGradient*)
- nativeBrush,
- blendFactors,
- blendPositions,
- count));
- }
-
- Status GetBlend(OUT REAL* blendFactors,
- OUT REAL* blendPositions,
- IN INT count) const
- {
- return SetStatus(DllExports::GdipGetLineBlend((GpLineGradient*)nativeBrush,
- blendFactors,
- blendPositions,
- count));
- }
-
- INT GetInterpolationColorCount() const
- {
- INT count = 0;
-
- SetStatus(DllExports::GdipGetLinePresetBlendCount((GpLineGradient*)
- nativeBrush,
- &count));
-
- return count;
- }
-
- Status SetInterpolationColors(IN const Color* presetColors,
- IN const REAL* blendPositions,
- IN INT count)
- {
- if ((count <= 0) || !presetColors)
- return SetStatus(InvalidParameter);
-
- ARGB *argbs = (ARGB*) new BYTE[count*sizeof(ARGB)];
-
- if (argbs)
- {
- for (INT i = 0; i < count; i++)
- {
- argbs[i] = presetColors[i].GetValue();
- }
-
- Status status = SetStatus(DllExports::GdipSetLinePresetBlend(
- (GpLineGradient*) nativeBrush,
- argbs,
- blendPositions,
- count));
- delete [] argbs;
- return status;
- }
- else
- {
- return SetStatus(OutOfMemory);
- }
- }
-
- Status GetInterpolationColors(OUT Color* presetColors,
- OUT REAL* blendPositions,
- IN INT count) const
- {
- if ((count <= 0) || !presetColors)
- return SetStatus(InvalidParameter);
-
- ARGB* argbs = (ARGB*) new BYTE[count*sizeof(ARGB)];
-
- if (!argbs)
- {
- return SetStatus(OutOfMemory);
- }
-
- Status status = SetStatus(DllExports::GdipGetLinePresetBlend((GpLineGradient*)nativeBrush,
- argbs,
- blendPositions,
- count));
- if (status == Ok)
- {
- for (INT i = 0; i < count; i++)
- {
- presetColors[i] = Color(argbs[i]);
- }
- }
-
- delete [] argbs;
-
- return status;
- }
-
- Status SetBlendBellShape(IN REAL focus,
- IN REAL scale = 1.0)
- {
- return SetStatus(DllExports::GdipSetLineSigmaBlend((GpLineGradient*)nativeBrush, focus, scale));
- }
-
- #ifdef DCR_USE_NEW_145135
- Status SetBlendTriangularShape(
- IN REAL focus,
- IN REAL scale = 1.0
- )
- #else
- Status SetBlendTrianglarShape(IN REAL focus,
- IN REAL scale = 1.0)
- #endif
- {
- return SetStatus(DllExports::GdipSetLineLinearBlend((GpLineGradient*)nativeBrush, focus, scale));
- }
-
- /**
- * Set/get brush transform
- */
- Status SetTransform(IN const Matrix* matrix)
- {
- return SetStatus(DllExports::GdipSetLineTransform((GpLineGradient*)nativeBrush,
- matrix->nativeMatrix));
- }
-
- Status GetTransform(OUT Matrix *matrix) const
- {
- return SetStatus(DllExports::GdipGetLineTransform((GpLineGradient*)nativeBrush,
- matrix->nativeMatrix));
- }
-
- Status ResetTransform()
- {
- return SetStatus(DllExports::GdipResetLineTransform((GpLineGradient*)nativeBrush));
- }
-
- Status MultiplyTransform(IN const Matrix* matrix,
- IN MatrixOrder order = MatrixOrderPrepend)
- {
- return SetStatus(DllExports::GdipMultiplyLineTransform((GpLineGradient*)nativeBrush,
- matrix->nativeMatrix,
- order));
- }
-
- Status TranslateTransform(IN REAL dx,
- IN REAL dy,
- IN MatrixOrder order = MatrixOrderPrepend)
- {
- return SetStatus(DllExports::GdipTranslateLineTransform((GpLineGradient*)nativeBrush,
- dx, dy, order));
- }
-
- Status ScaleTransform(IN REAL sx,
- IN REAL sy,
- IN MatrixOrder order = MatrixOrderPrepend)
- {
- return SetStatus(DllExports::GdipScaleLineTransform((GpLineGradient*)nativeBrush,
- sx, sy, order));
- }
-
- Status RotateTransform(IN REAL angle,
- IN MatrixOrder order = MatrixOrderPrepend)
- {
- return SetStatus(DllExports::GdipRotateLineTransform((GpLineGradient*)nativeBrush,
- angle, order));
- }
-
- /**
- * Set/get brush wrapping mode
- */
- Status SetWrapMode(IN WrapMode wrapMode)
- {
- return SetStatus(DllExports::GdipSetLineWrapMode((GpLineGradient*)nativeBrush,
- wrapMode));
- }
-
- WrapMode GetWrapMode() const
- {
- WrapMode wrapMode;
-
- SetStatus(DllExports::GdipGetLineWrapMode((GpLineGradient*)
- nativeBrush,
- &wrapMode));
-
- return wrapMode;
- }
-
-#ifdef DCR_USE_NEW_250932
-
-private:
- LinearGradientBrush(const LinearGradientBrush &);
- LinearGradientBrush& operator=(const LinearGradientBrush &);
-
-#endif
-
-protected:
-
- LinearGradientBrush()
- {
- }
-};
-
-//--------------------------------------------------------------------------
-// PathGradientBrush object is defined
-// in gdipluspath.h.
-//--------------------------------------------------------------------------
-
-//--------------------------------------------------------------------------
-// Represent hatch brush object
-//--------------------------------------------------------------------------
-
-class HatchBrush : public Brush
-{
-public:
- friend class Pen;
-
- // Constructors
-
- HatchBrush(IN HatchStyle hatchStyle,
- IN const Color& foreColor,
- IN const Color& backColor = Color())
- {
- GpHatch *brush = NULL;
-
- lastResult = DllExports::GdipCreateHatchBrush(hatchStyle,
- foreColor.GetValue(),
- backColor.GetValue(),
- &brush);
- SetNativeBrush(brush);
- }
-
- HatchStyle GetHatchStyle() const
- {
- HatchStyle hatchStyle;
-
- SetStatus(DllExports::GdipGetHatchStyle((GpHatch*)nativeBrush,
- &hatchStyle));
-
- return hatchStyle;
- }
-
- Status GetForegroundColor(OUT Color* color) const
- {
- ARGB argb;
-
- if (color == NULL)
- {
- return SetStatus(InvalidParameter);
- }
-
- Status status = SetStatus(DllExports::GdipGetHatchForegroundColor(
- (GpHatch*)nativeBrush,
- &argb));
-
- color->SetValue(argb);
-
- return status;
- }
-
- Status GetBackgroundColor(OUT Color *color) const
- {
- ARGB argb;
-
- if (color == NULL)
- {
- return SetStatus(InvalidParameter);
- }
-
- Status status = SetStatus(DllExports::GdipGetHatchBackgroundColor(
- (GpHatch*)nativeBrush,
- &argb));
-
- color->SetValue(argb);
-
- return status;
- }
-
-#ifdef DCR_USE_NEW_250932
-
-private:
- HatchBrush(const HatchBrush &);
- HatchBrush& operator=(const HatchBrush &);
-
-#endif
-
-protected:
-
- HatchBrush()
- {
- }
-};
-
-#endif
+/**************************************************************************\
+*
+* Copyright (c) 1998-2000, Microsoft Corp. All Rights Reserved.
+*
+* Module Name:
+*
+* GdiplusBrush.h
+*
+* Abstract:
+*
+* Brush API related declarations
+*
+\**************************************************************************/
+
+#ifndef _GDIPLUSBRUSH_H
+#define _GDIPLUSBRUSH_H
+
+//--------------------------------------------------------------------------
+// Abstract base class for various brush types
+//--------------------------------------------------------------------------
+
+class GraphicsPath;
+
+class Brush : public GdiplusBase
+{
+public:
+ friend class Pen;
+ friend class Graphics;
+
+ virtual ~Brush()
+ {
+ DllExports::GdipDeleteBrush(nativeBrush);
+ }
+
+ virtual Brush* Clone() const
+ {
+ GpBrush *brush = NULL;
+
+ SetStatus(DllExports::GdipCloneBrush(nativeBrush, &brush));
+
+ Brush *newBrush = new Brush(brush, lastResult);
+
+ if (newBrush == NULL)
+ {
+ DllExports::GdipDeleteBrush(brush);
+ }
+
+ return newBrush;
+ }
+
+ BrushType GetType() const
+ {
+ BrushType type = static_cast<BrushType>(-1);
+
+ SetStatus(DllExports::GdipGetBrushType(nativeBrush, &type));
+
+ return type;
+ }
+
+ Status GetLastStatus() const
+ {
+ Status lastStatus = lastResult;
+ lastResult = Ok;
+
+ return lastStatus;
+ }
+
+protected:
+
+ Brush()
+ {
+ SetStatus(NotImplemented);
+ }
+
+#ifdef DCR_USE_NEW_250932
+
+private:
+ Brush(const Brush& brush);
+ Brush& operator=(const Brush& brush);
+protected:
+
+#else
+
+ Brush(const Brush& brush)
+ {
+ brush;
+ SetStatus(NotImplemented);
+ }
+
+ Brush& operator=(const Brush& brush)
+ {
+ brush;
+ SetStatus(NotImplemented);
+ return *this;
+ }
+
+#endif
+
+ Brush(GpBrush* nativeBrush, Status status)
+ {
+ lastResult = status;
+ SetNativeBrush(nativeBrush);
+ }
+
+ VOID SetNativeBrush(GpBrush* nativeBrush)
+ {
+ this->nativeBrush = nativeBrush;
+ }
+
+ Status SetStatus(Status status) const
+ {
+ if (status != Ok)
+ return (lastResult = status);
+ else
+ return status;
+ }
+
+ GpBrush* nativeBrush;
+ mutable Status lastResult;
+};
+
+//--------------------------------------------------------------------------
+// Represent solid fill brush object
+//--------------------------------------------------------------------------
+
+class SolidBrush : public Brush
+{
+public:
+ friend class Pen;
+
+ SolidBrush(IN const Color& color)
+ {
+ GpSolidFill *brush = NULL;
+
+ lastResult = DllExports::GdipCreateSolidFill(color.GetValue(), &brush);
+
+ SetNativeBrush(brush);
+ }
+
+ Status GetColor(OUT Color* color) const
+ {
+ ARGB argb;
+
+ if (color == NULL)
+ {
+ return SetStatus(InvalidParameter);
+ }
+
+ SetStatus(DllExports::GdipGetSolidFillColor((GpSolidFill*)nativeBrush,
+ &argb));
+
+ *color = Color(argb);
+
+ return lastResult;
+ }
+
+ Status SetColor(IN const Color& color)
+ {
+ return SetStatus(DllExports::GdipSetSolidFillColor((GpSolidFill*)nativeBrush,
+ color.GetValue()));
+ }
+
+#ifdef DCR_USE_NEW_250932
+
+private:
+ SolidBrush(const SolidBrush &);
+ SolidBrush& operator=(const SolidBrush &);
+
+#endif
+
+protected:
+
+ SolidBrush()
+ {
+ }
+};
+
+class TextureBrush : public Brush
+{
+public:
+ friend class Pen;
+
+ TextureBrush(IN Image* image,
+ IN WrapMode wrapMode = WrapModeTile)
+ {
+ GpTexture *texture = NULL;
+
+ lastResult = DllExports::GdipCreateTexture(
+ image->nativeImage,
+ wrapMode, &texture);
+
+ SetNativeBrush(texture);
+ }
+
+ // When creating a texture brush from a metafile image, the dstRect
+ // is used to specify the size that the metafile image should be
+ // rendered at in the device units of the destination graphics.
+ // It is NOT used to crop the metafile image, so only the width
+ // and height values matter for metafiles.
+ TextureBrush(IN Image* image,
+ IN WrapMode wrapMode,
+ IN const RectF &dstRect)
+ {
+ GpTexture *texture = NULL;
+
+ lastResult = DllExports::GdipCreateTexture2(
+ image->nativeImage,
+ wrapMode,
+ dstRect.X,
+ dstRect.Y,
+ dstRect.Width,
+ dstRect.Height,
+ &texture);
+
+ SetNativeBrush(texture);
+ }
+
+ // When creating a texture brush from a metafile image, the dstRect
+ // is used to specify the size that the metafile image should be
+ // rendered at in the device units of the destination graphics.
+ // It is NOT used to crop the metafile image, so only the width
+ // and height values matter for metafiles.
+
+ TextureBrush(IN Image *image,
+ IN const RectF &dstRect,
+ IN const ImageAttributes *imageAttributes = NULL)
+ {
+ GpTexture *texture = NULL;
+
+ lastResult = DllExports::GdipCreateTextureIA(
+ image->nativeImage,
+ (imageAttributes)?imageAttributes->nativeImageAttr:NULL,
+ dstRect.X,
+ dstRect.Y,
+ dstRect.Width,
+ dstRect.Height,
+ &texture
+ );
+
+ SetNativeBrush(texture);
+ }
+
+ #ifdef DCR_USE_NEW_145138
+ TextureBrush(IN Image *image,
+ IN const Rect &dstRect,
+ IN const ImageAttributes *imageAttributes = NULL)
+ {
+ GpTexture *texture = NULL;
+
+ lastResult = DllExports::GdipCreateTextureIAI(
+ image->nativeImage,
+ (imageAttributes)?imageAttributes->nativeImageAttr:NULL,
+ dstRect.X,
+ dstRect.Y,
+ dstRect.Width,
+ dstRect.Height,
+ &texture
+ );
+
+ SetNativeBrush(texture);
+ }
+ #endif
+
+ // When creating a texture brush from a metafile image, the dstRect
+ // is used to specify the size that the metafile image should be
+ // rendered at in the device units of the destination graphics.
+ // It is NOT used to crop the metafile image, so only the width
+ // and height values matter for metafiles.
+
+ TextureBrush(
+ IN Image* image,
+ IN WrapMode wrapMode,
+
+ #ifdef DCR_USE_NEW_145138
+ const IN Rect &dstRect
+ #else
+ IN Rect &dstRect
+ #endif
+ )
+ {
+ GpTexture *texture = NULL;
+
+ lastResult = DllExports::GdipCreateTexture2I(
+ image->nativeImage,
+ wrapMode,
+ dstRect.X,
+ dstRect.Y,
+ dstRect.Width,
+ dstRect.Height,
+ &texture);
+
+ SetNativeBrush(texture);
+ }
+
+ // When creating a texture brush from a metafile image, the dstRect
+ // is used to specify the size that the metafile image should be
+ // rendered at in the device units of the destination graphics.
+ // It is NOT used to crop the metafile image, so only the width
+ // and height values matter for metafiles.
+ TextureBrush(IN Image* image,
+ IN WrapMode wrapMode,
+ IN REAL dstX,
+ IN REAL dstY,
+ IN REAL dstWidth,
+ IN REAL dstHeight)
+ {
+ GpTexture *texture = NULL;
+
+ lastResult = DllExports::GdipCreateTexture2(
+ image->nativeImage,
+ wrapMode,
+ dstX,
+ dstY,
+ dstWidth,
+ dstHeight,
+ &texture);
+
+ SetNativeBrush(texture);
+ }
+
+ // When creating a texture brush from a metafile image, the dstRect
+ // is used to specify the size that the metafile image should be
+ // rendered at in the device units of the destination graphics.
+ // It is NOT used to crop the metafile image, so only the width
+ // and height values matter for metafiles.
+ TextureBrush(IN Image* image,
+ IN WrapMode wrapMode,
+ IN INT dstX,
+ IN INT dstY,
+ IN INT dstWidth,
+ IN INT dstHeight)
+ {
+ GpTexture *texture = NULL;
+
+ lastResult = DllExports::GdipCreateTexture2I(
+ image->nativeImage,
+ wrapMode,
+ dstX,
+ dstY,
+ dstWidth,
+ dstHeight,
+ &texture);
+
+ SetNativeBrush(texture);
+ }
+
+ /**
+ * Set/get brush transform
+ */
+ Status SetTransform(IN const Matrix* matrix)
+ {
+ return SetStatus(DllExports::GdipSetTextureTransform((GpTexture*)nativeBrush,
+ matrix->nativeMatrix));
+ }
+
+ Status GetTransform(OUT Matrix* matrix) const
+ {
+ return SetStatus(DllExports::GdipGetTextureTransform((GpTexture*)nativeBrush,
+ matrix->nativeMatrix));
+ }
+
+ Status ResetTransform()
+ {
+ return SetStatus(DllExports::GdipResetTextureTransform((GpTexture*)nativeBrush));
+ }
+
+ Status MultiplyTransform(IN const Matrix* matrix,
+ IN MatrixOrder order = MatrixOrderPrepend)
+ {
+ return SetStatus(DllExports::GdipMultiplyTextureTransform((GpTexture*)nativeBrush,
+ matrix->nativeMatrix,
+ order));
+ }
+
+ Status TranslateTransform(IN REAL dx,
+ IN REAL dy,
+ IN MatrixOrder order = MatrixOrderPrepend)
+ {
+ return SetStatus(DllExports::GdipTranslateTextureTransform((GpTexture*)nativeBrush,
+ dx, dy, order));
+ }
+
+ Status ScaleTransform(IN REAL sx,
+ IN REAL sy,
+ IN MatrixOrder order = MatrixOrderPrepend)
+ {
+ return SetStatus(DllExports::GdipScaleTextureTransform((GpTexture*)nativeBrush,
+ sx, sy, order));
+ }
+
+ Status RotateTransform(IN REAL angle,
+ IN MatrixOrder order = MatrixOrderPrepend)
+ {
+ return SetStatus(DllExports::GdipRotateTextureTransform((GpTexture*)nativeBrush,
+ angle, order));
+ }
+
+ /**
+ * Set/get brush wrapping mode
+ */
+ Status SetWrapMode(IN WrapMode wrapMode)
+ {
+ return SetStatus(DllExports::GdipSetTextureWrapMode((GpTexture*)nativeBrush,
+ wrapMode));
+ }
+
+ WrapMode GetWrapMode() const
+ {
+ WrapMode wrapMode;
+
+ SetStatus(DllExports::GdipGetTextureWrapMode((GpTexture*)nativeBrush,
+ &wrapMode));
+ return wrapMode;
+ }
+
+ // Get texture brush attributes
+
+ Image *GetImage() const
+ {
+ GpImage *image;
+
+ SetStatus(DllExports::GdipGetTextureImage((GpTexture *)nativeBrush,
+ &image));
+
+ Image *retimage = new Image(image, lastResult);
+
+ if (retimage == NULL)
+ {
+ DllExports::GdipDisposeImage(image);
+ }
+
+ return retimage;
+ }
+
+#ifdef DCR_USE_NEW_250932
+
+private:
+ TextureBrush(const TextureBrush &);
+ TextureBrush& operator=(const TextureBrush &);
+
+#endif
+
+protected:
+
+ TextureBrush()
+ {
+ }
+};
+
+//--------------------------------------------------------------------------
+// Represent line gradient brush object
+//--------------------------------------------------------------------------
+
+class LinearGradientBrush : public Brush
+{
+public:
+ friend class Pen;
+
+ LinearGradientBrush(IN const PointF& point1,
+ IN const PointF& point2,
+ IN const Color& color1,
+ IN const Color& color2)
+ {
+ GpLineGradient *brush = NULL;
+
+ lastResult = DllExports::GdipCreateLineBrush(&point1,
+ &point2,
+ color1.GetValue(),
+ color2.GetValue(),
+ WrapModeTile,
+ &brush);
+
+ SetNativeBrush(brush);
+ }
+
+ LinearGradientBrush(IN const Point& point1,
+ IN const Point& point2,
+ IN const Color& color1,
+ IN const Color& color2)
+ {
+ GpLineGradient *brush = NULL;
+
+ lastResult = DllExports::GdipCreateLineBrushI(&point1,
+ &point2,
+ color1.GetValue(),
+ color2.GetValue(),
+ WrapModeTile,
+ &brush);
+
+ SetNativeBrush(brush);
+ }
+
+ LinearGradientBrush(IN const RectF& rect,
+ IN const Color& color1,
+ IN const Color& color2,
+ IN LinearGradientMode mode)
+ {
+ GpLineGradient *brush = NULL;
+
+ lastResult = DllExports::GdipCreateLineBrushFromRect(&rect,
+ color1.GetValue(),
+ color2.GetValue(),
+ mode,
+ WrapModeTile,
+ &brush);
+
+ SetNativeBrush(brush);
+ }
+
+ LinearGradientBrush(IN const Rect& rect,
+ IN const Color& color1,
+ IN const Color& color2,
+ IN LinearGradientMode mode)
+ {
+ GpLineGradient *brush = NULL;
+
+ lastResult = DllExports::GdipCreateLineBrushFromRectI(&rect,
+ color1.GetValue(),
+ color2.GetValue(),
+ mode,
+ WrapModeTile,
+ &brush);
+
+ SetNativeBrush(brush);
+ }
+
+ LinearGradientBrush(IN const RectF& rect,
+ IN const Color& color1,
+ IN const Color& color2,
+ IN REAL angle,
+ IN BOOL isAngleScalable = FALSE)
+ {
+ GpLineGradient *brush = NULL;
+
+ lastResult = DllExports::GdipCreateLineBrushFromRectWithAngle(&rect,
+ color1.GetValue(),
+ color2.GetValue(),
+ angle,
+ isAngleScalable,
+ WrapModeTile,
+ &brush);
+
+ SetNativeBrush(brush);
+ }
+
+ LinearGradientBrush(IN const Rect& rect,
+ IN const Color& color1,
+ IN const Color& color2,
+ IN REAL angle,
+ IN BOOL isAngleScalable = FALSE)
+ {
+ GpLineGradient *brush = NULL;
+
+ lastResult = DllExports::GdipCreateLineBrushFromRectWithAngleI(&rect,
+ color1.GetValue(),
+ color2.GetValue(),
+ angle,
+ isAngleScalable,
+ WrapModeTile,
+ &brush);
+
+ SetNativeBrush(brush);
+ }
+
+ // Get/set point attributes
+
+ Status SetLinearPoints(IN const PointF& point1,
+ IN const PointF& point2)
+ {
+ return SetStatus(DllExports::GdipSetLinePoints((GpLineGradient*)nativeBrush,
+ &point1, &point2));
+ }
+
+ Status GetLinearPoints(OUT PointF* points) const
+ {
+ return SetStatus(DllExports::GdipGetLinePoints((GpLineGradient*) nativeBrush,
+ points));
+ }
+
+ Status SetLinearPoints(IN const Point& point1,
+ IN const Point& point2)
+ {
+ return SetStatus(DllExports::GdipSetLinePointsI((GpLineGradient*)nativeBrush,
+ &point1, &point2));
+ }
+
+ Status GetLinearPoints(OUT Point* points) const
+ {
+ return SetStatus(DllExports::GdipGetLinePointsI((GpLineGradient*) nativeBrush,
+ points));
+ }
+ // Get/set color attributes
+
+ Status SetLinearColors(IN const Color& color1,
+ IN const Color& color2)
+ {
+ return SetStatus(DllExports::GdipSetLineColors((GpLineGradient*)nativeBrush,
+ color1.GetValue(),
+ color2.GetValue()));
+ }
+
+ Status GetLinearColors(OUT Color* colors) const
+ {
+ ARGB argb[2];
+
+ if (colors == NULL)
+ {
+ return SetStatus(InvalidParameter);
+ }
+
+ SetStatus(DllExports::GdipGetLineColors((GpLineGradient*) nativeBrush, argb));
+
+ if (lastResult == Ok)
+ {
+ // use bitwise copy operator for Color copy
+ colors[0] = Color(argb[0]);
+ colors[1] = Color(argb[1]);
+ }
+
+ return lastResult;
+ }
+
+ Status GetRectangle(OUT RectF* rect) const
+ {
+ return SetStatus(DllExports::GdipGetLineRect((GpLineGradient*)nativeBrush, rect));
+ }
+
+ // integer version
+ Status GetRectangle(OUT Rect* rect) const
+ {
+ return SetStatus(DllExports::GdipGetLineRectI((GpLineGradient*)nativeBrush, rect));
+ }
+
+ // Gamma correction in interporlation.
+
+ Status SetGammaCorrection(IN BOOL useGammaCorrection)
+ {
+ return SetStatus(DllExports::GdipSetLineGammaCorrection((GpLineGradient*)nativeBrush,
+ useGammaCorrection));
+ }
+
+ BOOL GetGammaCorrection() const
+ {
+ BOOL useGammaCorrection;
+
+ SetStatus(DllExports::GdipGetLineGammaCorrection((GpLineGradient*)nativeBrush,
+ &useGammaCorrection));
+
+ return useGammaCorrection;
+ }
+
+ INT GetBlendCount() const
+ {
+ INT count = 0;
+
+ SetStatus(DllExports::GdipGetLineBlendCount((GpLineGradient*)
+ nativeBrush,
+ &count));
+
+ return count;
+ }
+
+ Status SetBlend(IN const REAL* blendFactors,
+ IN const REAL* blendPositions,
+ IN INT count)
+ {
+ return SetStatus(DllExports::GdipSetLineBlend((GpLineGradient*)
+ nativeBrush,
+ blendFactors,
+ blendPositions,
+ count));
+ }
+
+ Status GetBlend(OUT REAL* blendFactors,
+ OUT REAL* blendPositions,
+ IN INT count) const
+ {
+ return SetStatus(DllExports::GdipGetLineBlend((GpLineGradient*)nativeBrush,
+ blendFactors,
+ blendPositions,
+ count));
+ }
+
+ INT GetInterpolationColorCount() const
+ {
+ INT count = 0;
+
+ SetStatus(DllExports::GdipGetLinePresetBlendCount((GpLineGradient*)
+ nativeBrush,
+ &count));
+
+ return count;
+ }
+
+ Status SetInterpolationColors(IN const Color* presetColors,
+ IN const REAL* blendPositions,
+ IN INT count)
+ {
+ if ((count <= 0) || !presetColors)
+ return SetStatus(InvalidParameter);
+
+ ARGB *argbs = (ARGB*) new BYTE[count*sizeof(ARGB)];
+
+ if (argbs)
+ {
+ for (INT i = 0; i < count; i++)
+ {
+ argbs[i] = presetColors[i].GetValue();
+ }
+
+ Status status = SetStatus(DllExports::GdipSetLinePresetBlend(
+ (GpLineGradient*) nativeBrush,
+ argbs,
+ blendPositions,
+ count));
+ delete [] argbs;
+ return status;
+ }
+ else
+ {
+ return SetStatus(OutOfMemory);
+ }
+ }
+
+ Status GetInterpolationColors(OUT Color* presetColors,
+ OUT REAL* blendPositions,
+ IN INT count) const
+ {
+ if ((count <= 0) || !presetColors)
+ return SetStatus(InvalidParameter);
+
+ ARGB* argbs = (ARGB*) new BYTE[count*sizeof(ARGB)];
+
+ if (!argbs)
+ {
+ return SetStatus(OutOfMemory);
+ }
+
+ Status status = SetStatus(DllExports::GdipGetLinePresetBlend((GpLineGradient*)nativeBrush,
+ argbs,
+ blendPositions,
+ count));
+ if (status == Ok)
+ {
+ for (INT i = 0; i < count; i++)
+ {
+ presetColors[i] = Color(argbs[i]);
+ }
+ }
+
+ delete [] argbs;
+
+ return status;
+ }
+
+ Status SetBlendBellShape(IN REAL focus,
+ IN REAL scale = 1.0)
+ {
+ return SetStatus(DllExports::GdipSetLineSigmaBlend((GpLineGradient*)nativeBrush, focus, scale));
+ }
+
+ #ifdef DCR_USE_NEW_145135
+ Status SetBlendTriangularShape(
+ IN REAL focus,
+ IN REAL scale = 1.0
+ )
+ #else
+ Status SetBlendTrianglarShape(IN REAL focus,
+ IN REAL scale = 1.0)
+ #endif
+ {
+ return SetStatus(DllExports::GdipSetLineLinearBlend((GpLineGradient*)nativeBrush, focus, scale));
+ }
+
+ /**
+ * Set/get brush transform
+ */
+ Status SetTransform(IN const Matrix* matrix)
+ {
+ return SetStatus(DllExports::GdipSetLineTransform((GpLineGradient*)nativeBrush,
+ matrix->nativeMatrix));
+ }
+
+ Status GetTransform(OUT Matrix *matrix) const
+ {
+ return SetStatus(DllExports::GdipGetLineTransform((GpLineGradient*)nativeBrush,
+ matrix->nativeMatrix));
+ }
+
+ Status ResetTransform()
+ {
+ return SetStatus(DllExports::GdipResetLineTransform((GpLineGradient*)nativeBrush));
+ }
+
+ Status MultiplyTransform(IN const Matrix* matrix,
+ IN MatrixOrder order = MatrixOrderPrepend)
+ {
+ return SetStatus(DllExports::GdipMultiplyLineTransform((GpLineGradient*)nativeBrush,
+ matrix->nativeMatrix,
+ order));
+ }
+
+ Status TranslateTransform(IN REAL dx,
+ IN REAL dy,
+ IN MatrixOrder order = MatrixOrderPrepend)
+ {
+ return SetStatus(DllExports::GdipTranslateLineTransform((GpLineGradient*)nativeBrush,
+ dx, dy, order));
+ }
+
+ Status ScaleTransform(IN REAL sx,
+ IN REAL sy,
+ IN MatrixOrder order = MatrixOrderPrepend)
+ {
+ return SetStatus(DllExports::GdipScaleLineTransform((GpLineGradient*)nativeBrush,
+ sx, sy, order));
+ }
+
+ Status RotateTransform(IN REAL angle,
+ IN MatrixOrder order = MatrixOrderPrepend)
+ {
+ return SetStatus(DllExports::GdipRotateLineTransform((GpLineGradient*)nativeBrush,
+ angle, order));
+ }
+
+ /**
+ * Set/get brush wrapping mode
+ */
+ Status SetWrapMode(IN WrapMode wrapMode)
+ {
+ return SetStatus(DllExports::GdipSetLineWrapMode((GpLineGradient*)nativeBrush,
+ wrapMode));
+ }
+
+ WrapMode GetWrapMode() const
+ {
+ WrapMode wrapMode;
+
+ SetStatus(DllExports::GdipGetLineWrapMode((GpLineGradient*)
+ nativeBrush,
+ &wrapMode));
+
+ return wrapMode;
+ }
+
+#ifdef DCR_USE_NEW_250932
+
+private:
+ LinearGradientBrush(const LinearGradientBrush &);
+ LinearGradientBrush& operator=(const LinearGradientBrush &);
+
+#endif
+
+protected:
+
+ LinearGradientBrush()
+ {
+ }
+};
+
+//--------------------------------------------------------------------------
+// PathGradientBrush object is defined
+// in gdipluspath.h.
+//--------------------------------------------------------------------------
+
+//--------------------------------------------------------------------------
+// Represent hatch brush object
+//--------------------------------------------------------------------------
+
+class HatchBrush : public Brush
+{
+public:
+ friend class Pen;
+
+ // Constructors
+
+ HatchBrush(IN HatchStyle hatchStyle,
+ IN const Color& foreColor,
+ IN const Color& backColor = Color())
+ {
+ GpHatch *brush = NULL;
+
+ lastResult = DllExports::GdipCreateHatchBrush(hatchStyle,
+ foreColor.GetValue(),
+ backColor.GetValue(),
+ &brush);
+ SetNativeBrush(brush);
+ }
+
+ HatchStyle GetHatchStyle() const
+ {
+ HatchStyle hatchStyle;
+
+ SetStatus(DllExports::GdipGetHatchStyle((GpHatch*)nativeBrush,
+ &hatchStyle));
+
+ return hatchStyle;
+ }
+
+ Status GetForegroundColor(OUT Color* color) const
+ {
+ ARGB argb;
+
+ if (color == NULL)
+ {
+ return SetStatus(InvalidParameter);
+ }
+
+ Status status = SetStatus(DllExports::GdipGetHatchForegroundColor(
+ (GpHatch*)nativeBrush,
+ &argb));
+
+ color->SetValue(argb);
+
+ return status;
+ }
+
+ Status GetBackgroundColor(OUT Color *color) const
+ {
+ ARGB argb;
+
+ if (color == NULL)
+ {
+ return SetStatus(InvalidParameter);
+ }
+
+ Status status = SetStatus(DllExports::GdipGetHatchBackgroundColor(
+ (GpHatch*)nativeBrush,
+ &argb));
+
+ color->SetValue(argb);
+
+ return status;
+ }
+
+#ifdef DCR_USE_NEW_250932
+
+private:
+ HatchBrush(const HatchBrush &);
+ HatchBrush& operator=(const HatchBrush &);
+
+#endif
+
+protected:
+
+ HatchBrush()
+ {
+ }
+};
+
+#endif
diff --git a/core/src/fxge/Microsoft SDK/include/GdiPlusCachedBitmap.h b/core/src/fxge/Microsoft SDK/include/GdiPlusCachedBitmap.h
index 28fd8caea6..3bafebeb40 100644
--- a/core/src/fxge/Microsoft SDK/include/GdiPlusCachedBitmap.h
+++ b/core/src/fxge/Microsoft SDK/include/GdiPlusCachedBitmap.h
@@ -1,71 +1,71 @@
-/**************************************************************************
-*
-* Copyright (c) 2000 Microsoft Corporation
-*
-* Module Name:
-*
-* CachedBitmap class definition
-*
-* Abstract:
-*
-* CachedBitmap is a representation of an accelerated drawing
-* that has restrictions on what operations are allowed in order
-* to accelerate the drawing to the destination.
-*
-**************************************************************************/
-
-#ifndef _GDIPLUSCACHEDBITMAP_H
-#define _GDIPLUSCACHEDBITMAP_H
-
-/**************************************************************************
-*
-* Class Name:
-*
-* CachedBitmap
-*
-* Abstract:
-*
-* An object to store a bitmap prepared for rendering on a particular
-* Graphics object. The memory storage for the CachedBitmap is opaque
-* to the other Engine code, so the only operations supported are
-* initializing the data (with a bitmap) and using the graphics to
-* draw it on the screen with an integer offset.
-*
-* Look for the class definition in GdiplusHeaders.h
-*
-* Created:
-*
-* 04/23/2000 asecchia
-* Created it.
-*
-**************************************************************************/
-inline
-CachedBitmap::CachedBitmap(
- IN Bitmap *bitmap,
- IN Graphics *graphics)
-{
- nativeCachedBitmap = NULL;
-
- lastResult = DllExports::GdipCreateCachedBitmap(
- (GpBitmap *)bitmap->nativeImage,
- graphics->nativeGraphics,
- &nativeCachedBitmap
- );
-}
-
-inline
-CachedBitmap::~CachedBitmap()
-{
- DllExports::GdipDeleteCachedBitmap(nativeCachedBitmap);
-}
-
-inline Status
-CachedBitmap::GetLastStatus() const
-{
- Status lastStatus = lastResult;
- lastResult = Ok;
- return (lastStatus);
-}
-
-#endif
-
+/**************************************************************************
+*
+* Copyright (c) 2000 Microsoft Corporation
+*
+* Module Name:
+*
+* CachedBitmap class definition
+*
+* Abstract:
+*
+* CachedBitmap is a representation of an accelerated drawing
+* that has restrictions on what operations are allowed in order
+* to accelerate the drawing to the destination.
+*
+**************************************************************************/
+
+#ifndef _GDIPLUSCACHEDBITMAP_H
+#define _GDIPLUSCACHEDBITMAP_H
+
+/**************************************************************************
+*
+* Class Name:
+*
+* CachedBitmap
+*
+* Abstract:
+*
+* An object to store a bitmap prepared for rendering on a particular
+* Graphics object. The memory storage for the CachedBitmap is opaque
+* to the other Engine code, so the only operations supported are
+* initializing the data (with a bitmap) and using the graphics to
+* draw it on the screen with an integer offset.
+*
+* Look for the class definition in GdiplusHeaders.h
+*
+* Created:
+*
+* 04/23/2000 asecchia
+* Created it.
+*
+**************************************************************************/
+inline
+CachedBitmap::CachedBitmap(
+ IN Bitmap *bitmap,
+ IN Graphics *graphics)
+{
+ nativeCachedBitmap = NULL;
+
+ lastResult = DllExports::GdipCreateCachedBitmap(
+ (GpBitmap *)bitmap->nativeImage,
+ graphics->nativeGraphics,
+ &nativeCachedBitmap
+ );
+}
+
+inline
+CachedBitmap::~CachedBitmap()
+{
+ DllExports::GdipDeleteCachedBitmap(nativeCachedBitmap);
+}
+
+inline Status
+CachedBitmap::GetLastStatus() const
+{
+ Status lastStatus = lastResult;
+ lastResult = Ok;
+ return (lastStatus);
+}
+
+#endif
+
diff --git a/core/src/fxge/Microsoft SDK/include/GdiPlusColor.h b/core/src/fxge/Microsoft SDK/include/GdiPlusColor.h
index 72c21c295f..7ec10f8434 100644
--- a/core/src/fxge/Microsoft SDK/include/GdiPlusColor.h
+++ b/core/src/fxge/Microsoft SDK/include/GdiPlusColor.h
@@ -1,209 +1,209 @@
-/**************************************************************************\
-*
-* Copyright (c) 1998-2000, Microsoft Corp. All Rights Reserved.
-*
-* Module Name:
-*
-* GdiplusColor.h
-*
-* Abstract:
-*
-* Represents a GDI+ color.
-*
-\**************************************************************************/
-
-#ifndef _GDIPLUSCOLOR_H
-#define _GDIPLUSCOLOR_H
-
-//----------------------------------------------------------------------------
-// Color mode
-//----------------------------------------------------------------------------
-
-enum ColorMode
-{
- ColorModeARGB32 = 0,
- ColorModeARGB64 = 1
-};
-
-//----------------------------------------------------------------------------
-// Color Channel flags
-//----------------------------------------------------------------------------
-
-enum ColorChannelFlags
-{
- ColorChannelFlagsC = 0,
- ColorChannelFlagsM,
- ColorChannelFlagsY,
- ColorChannelFlagsK,
- ColorChannelFlagsLast
-};
-
-//----------------------------------------------------------------------------
-// Color
-//----------------------------------------------------------------------------
-
-class Color
-{
-public:
-
- Color()
- {
- Argb = (ARGB)Color::Black;
- }
-
- // Construct an opaque Color object with
- // the specified R, G, B values.
-
- Color(IN BYTE r,
- IN BYTE g,
- IN BYTE b)
- {
- Argb = MakeARGB(255, r, g, b);
- }
-
- // Construct a Color object with
- // the specified A, R, G, B values.
- //
- // NOTE: R, G, B color values are not premultiplied.
-
- Color(IN BYTE a,
- IN BYTE r,
- IN BYTE g,
- IN BYTE b)
- {
- Argb = MakeARGB(a, r, g, b);
- }
-
- // Construct a Color object with
- // the specified ARGB values.
- //
- // NOTE: R, G, B color components are not premultiplied.
-
- Color(IN ARGB argb)
- {
- Argb = argb;
- }
-
- // Extract A, R, G, B components
-
- BYTE GetAlpha() const
- {
- return (BYTE) (Argb >> AlphaShift);
- }
-
- BYTE GetA() const
- {
- return GetAlpha();
- }
-
- BYTE GetRed() const
- {
- return (BYTE) (Argb >> RedShift);
- }
-
- BYTE GetR() const
- {
- return GetRed();
- }
-
- BYTE GetGreen() const
- {
- return (BYTE) (Argb >> GreenShift);
- }
-
- BYTE GetG() const
- {
- return GetGreen();
- }
-
- BYTE GetBlue() const
- {
- return (BYTE) (Argb >> BlueShift);
- }
-
- BYTE GetB() const
- {
- return GetBlue();
- }
-
- // Retrieve ARGB values
-
- ARGB GetValue() const
- {
- return Argb;
- }
-
- VOID SetValue(IN ARGB argb)
- {
- Argb = argb;
- }
-
- VOID SetFromCOLORREF(IN COLORREF rgb)
- {
- Argb = MakeARGB(255, GetRValue(rgb), GetGValue(rgb), GetBValue(rgb));
- }
-
- COLORREF ToCOLORREF() const
- {
- return RGB(GetRed(), GetGreen(), GetBlue());
- }
-
-public:
-
- // Standard color constants
- enum
- {
- Black = 0xff000000,
- Silver = 0xffc0c0c0,
- Gray = 0xff808080,
- White = 0xffffffff,
- Maroon = 0xff800000,
- Red = 0xffff0000,
- Purple = 0xff800080,
- Fuchsia = 0xffff00ff,
- Green = 0xff008000,
- Lime = 0xff00ff00,
- Olive = 0xff808000,
- Yellow = 0xffffff00,
- Navy = 0xff000080,
- Blue = 0xff0000ff,
- Teal = 0xff008080,
- Aqua = 0xff00ffff
- };
-
- // Shift count and bit mask for A, R, G, B components
- enum
- {
- AlphaShift = 24,
- RedShift = 16,
- GreenShift = 8,
- BlueShift = 0
- };
-
- enum
- {
- AlphaMask = 0xff000000,
- RedMask = 0x00ff0000,
- GreenMask = 0x0000ff00,
- BlueMask = 0x000000ff
- };
-
- // Assemble A, R, G, B values into a 32-bit integer
- static ARGB MakeARGB(IN BYTE a,
- IN BYTE r,
- IN BYTE g,
- IN BYTE b)
- {
- return (((ARGB) (b) << BlueShift) |
- ((ARGB) (g) << GreenShift) |
- ((ARGB) (r) << RedShift) |
- ((ARGB) (a) << AlphaShift));
- }
-
-protected:
-
- ARGB Argb;
-};
-
-#endif
-
+/**************************************************************************\
+*
+* Copyright (c) 1998-2000, Microsoft Corp. All Rights Reserved.
+*
+* Module Name:
+*
+* GdiplusColor.h
+*
+* Abstract:
+*
+* Represents a GDI+ color.
+*
+\**************************************************************************/
+
+#ifndef _GDIPLUSCOLOR_H
+#define _GDIPLUSCOLOR_H
+
+//----------------------------------------------------------------------------
+// Color mode
+//----------------------------------------------------------------------------
+
+enum ColorMode
+{
+ ColorModeARGB32 = 0,
+ ColorModeARGB64 = 1
+};
+
+//----------------------------------------------------------------------------
+// Color Channel flags
+//----------------------------------------------------------------------------
+
+enum ColorChannelFlags
+{
+ ColorChannelFlagsC = 0,
+ ColorChannelFlagsM,
+ ColorChannelFlagsY,
+ ColorChannelFlagsK,
+ ColorChannelFlagsLast
+};
+
+//----------------------------------------------------------------------------
+// Color
+//----------------------------------------------------------------------------
+
+class Color
+{
+public:
+
+ Color()
+ {
+ Argb = (ARGB)Color::Black;
+ }
+
+ // Construct an opaque Color object with
+ // the specified R, G, B values.
+
+ Color(IN BYTE r,
+ IN BYTE g,
+ IN BYTE b)
+ {
+ Argb = MakeARGB(255, r, g, b);
+ }
+
+ // Construct a Color object with
+ // the specified A, R, G, B values.
+ //
+ // NOTE: R, G, B color values are not premultiplied.
+
+ Color(IN BYTE a,
+ IN BYTE r,
+ IN BYTE g,
+ IN BYTE b)
+ {
+ Argb = MakeARGB(a, r, g, b);
+ }
+
+ // Construct a Color object with
+ // the specified ARGB values.
+ //
+ // NOTE: R, G, B color components are not premultiplied.
+
+ Color(IN ARGB argb)
+ {
+ Argb = argb;
+ }
+
+ // Extract A, R, G, B components
+
+ BYTE GetAlpha() const
+ {
+ return (BYTE) (Argb >> AlphaShift);
+ }
+
+ BYTE GetA() const
+ {
+ return GetAlpha();
+ }
+
+ BYTE GetRed() const
+ {
+ return (BYTE) (Argb >> RedShift);
+ }
+
+ BYTE GetR() const
+ {
+ return GetRed();
+ }
+
+ BYTE GetGreen() const
+ {
+ return (BYTE) (Argb >> GreenShift);
+ }
+
+ BYTE GetG() const
+ {
+ return GetGreen();
+ }
+
+ BYTE GetBlue() const
+ {
+ return (BYTE) (Argb >> BlueShift);
+ }
+
+ BYTE GetB() const
+ {
+ return GetBlue();
+ }
+
+ // Retrieve ARGB values
+
+ ARGB GetValue() const
+ {
+ return Argb;
+ }
+
+ VOID SetValue(IN ARGB argb)
+ {
+ Argb = argb;
+ }
+
+ VOID SetFromCOLORREF(IN COLORREF rgb)
+ {
+ Argb = MakeARGB(255, GetRValue(rgb), GetGValue(rgb), GetBValue(rgb));
+ }
+
+ COLORREF ToCOLORREF() const
+ {
+ return RGB(GetRed(), GetGreen(), GetBlue());
+ }
+
+public:
+
+ // Standard color constants
+ enum
+ {
+ Black = 0xff000000,
+ Silver = 0xffc0c0c0,
+ Gray = 0xff808080,
+ White = 0xffffffff,
+ Maroon = 0xff800000,
+ Red = 0xffff0000,
+ Purple = 0xff800080,
+ Fuchsia = 0xffff00ff,
+ Green = 0xff008000,
+ Lime = 0xff00ff00,
+ Olive = 0xff808000,
+ Yellow = 0xffffff00,
+ Navy = 0xff000080,
+ Blue = 0xff0000ff,
+ Teal = 0xff008080,
+ Aqua = 0xff00ffff
+ };
+
+ // Shift count and bit mask for A, R, G, B components
+ enum
+ {
+ AlphaShift = 24,
+ RedShift = 16,
+ GreenShift = 8,
+ BlueShift = 0
+ };
+
+ enum
+ {
+ AlphaMask = 0xff000000,
+ RedMask = 0x00ff0000,
+ GreenMask = 0x0000ff00,
+ BlueMask = 0x000000ff
+ };
+
+ // Assemble A, R, G, B values into a 32-bit integer
+ static ARGB MakeARGB(IN BYTE a,
+ IN BYTE r,
+ IN BYTE g,
+ IN BYTE b)
+ {
+ return (((ARGB) (b) << BlueShift) |
+ ((ARGB) (g) << GreenShift) |
+ ((ARGB) (r) << RedShift) |
+ ((ARGB) (a) << AlphaShift));
+ }
+
+protected:
+
+ ARGB Argb;
+};
+
+#endif
+
diff --git a/core/src/fxge/Microsoft SDK/include/GdiPlusColorMatrix.h b/core/src/fxge/Microsoft SDK/include/GdiPlusColorMatrix.h
index d1d9ebc534..ec4d14b191 100644
--- a/core/src/fxge/Microsoft SDK/include/GdiPlusColorMatrix.h
+++ b/core/src/fxge/Microsoft SDK/include/GdiPlusColorMatrix.h
@@ -1,63 +1,63 @@
-/**************************************************************************\
-*
-* Copyright (c) 1998-2000, Microsoft Corp. All Rights Reserved.
-*
-* Module Name:
-*
-* GdiplusColorMatrix.h
-*
-* Abstract:
-*
-* Class for color adjustment object passed to Graphics.DrawImage
-*
-\**************************************************************************/
-
-#ifndef _GDIPLUSCOLORMATRIX_H
-#define _GDIPLUSCOLORMATRIX_H
-
-//----------------------------------------------------------------------------
-// Color matrix
-//----------------------------------------------------------------------------
-
-struct ColorMatrix
-{
- REAL m[5][5];
-};
-
-//----------------------------------------------------------------------------
-// Color Matrix flags
-//----------------------------------------------------------------------------
-
-enum ColorMatrixFlags
-{
- ColorMatrixFlagsDefault = 0,
- ColorMatrixFlagsSkipGrays = 1,
- ColorMatrixFlagsAltGray = 2
-};
-
-//----------------------------------------------------------------------------
-// Color Adjust Type
-//----------------------------------------------------------------------------
-
-enum ColorAdjustType
-{
- ColorAdjustTypeDefault,
- ColorAdjustTypeBitmap,
- ColorAdjustTypeBrush,
- ColorAdjustTypePen,
- ColorAdjustTypeText,
- ColorAdjustTypeCount, // must be immediately after all the individual ones
- ColorAdjustTypeAny // internal use: for querying if any type has recoloring
-};
-
-//----------------------------------------------------------------------------
-// Color Map
-//----------------------------------------------------------------------------
-
-struct ColorMap
-{
- Color oldColor;
- Color newColor;
-};
-
-#endif
+/**************************************************************************\
+*
+* Copyright (c) 1998-2000, Microsoft Corp. All Rights Reserved.
+*
+* Module Name:
+*
+* GdiplusColorMatrix.h
+*
+* Abstract:
+*
+* Class for color adjustment object passed to Graphics.DrawImage
+*
+\**************************************************************************/
+
+#ifndef _GDIPLUSCOLORMATRIX_H
+#define _GDIPLUSCOLORMATRIX_H
+
+//----------------------------------------------------------------------------
+// Color matrix
+//----------------------------------------------------------------------------
+
+struct ColorMatrix
+{
+ REAL m[5][5];
+};
+
+//----------------------------------------------------------------------------
+// Color Matrix flags
+//----------------------------------------------------------------------------
+
+enum ColorMatrixFlags
+{
+ ColorMatrixFlagsDefault = 0,
+ ColorMatrixFlagsSkipGrays = 1,
+ ColorMatrixFlagsAltGray = 2
+};
+
+//----------------------------------------------------------------------------
+// Color Adjust Type
+//----------------------------------------------------------------------------
+
+enum ColorAdjustType
+{
+ ColorAdjustTypeDefault,
+ ColorAdjustTypeBitmap,
+ ColorAdjustTypeBrush,
+ ColorAdjustTypePen,
+ ColorAdjustTypeText,
+ ColorAdjustTypeCount, // must be immediately after all the individual ones
+ ColorAdjustTypeAny // internal use: for querying if any type has recoloring
+};
+
+//----------------------------------------------------------------------------
+// Color Map
+//----------------------------------------------------------------------------
+
+struct ColorMap
+{
+ Color oldColor;
+ Color newColor;
+};
+
+#endif
diff --git a/core/src/fxge/Microsoft SDK/include/GdiPlusEnums.h b/core/src/fxge/Microsoft SDK/include/GdiPlusEnums.h
index 92a29c7463..9962ff586a 100644
--- a/core/src/fxge/Microsoft SDK/include/GdiPlusEnums.h
+++ b/core/src/fxge/Microsoft SDK/include/GdiPlusEnums.h
@@ -1,1252 +1,1252 @@
-/**************************************************************************\
-*
-* Copyright (c) 1998-2000, Microsoft Corp. All Rights Reserved.
-*
-* Module Name:
-*
-* GdiplusEnums.h
-*
-* Abstract:
-*
-* Various enumeration types
-*
-\**************************************************************************/
-
-#ifndef _GDIPLUSENUMS_H
-#define _GDIPLUSENUMS_H
-
-
-//--------------------------------------------------------------------------
-// Default bezier flattening tolerance in device pixels.
-//--------------------------------------------------------------------------
-
-const float FlatnessDefault = 1.0f/4.0f;
-
-//--------------------------------------------------------------------------
-// Graphics and Container State cookies
-//--------------------------------------------------------------------------
-
-typedef UINT GraphicsState;
-typedef UINT GraphicsContainer;
-
-//--------------------------------------------------------------------------
-// Fill mode constants
-//--------------------------------------------------------------------------
-
-enum FillMode
-{
- FillModeAlternate, // 0
- FillModeWinding // 1
-};
-
-//--------------------------------------------------------------------------
-// Quality mode constants
-//--------------------------------------------------------------------------
-
-enum QualityMode
-{
- QualityModeInvalid = -1,
- QualityModeDefault = 0,
- QualityModeLow = 1, // for apps that need the best performance
- QualityModeHigh = 2 // for apps that need the best rendering quality
-};
-
-//--------------------------------------------------------------------------
-// Alpha compositing mode constants
-//--------------------------------------------------------------------------
-
-enum CompositingMode
-{
- CompositingModeSourceOver, // 0
- CompositingModeSourceCopy // 1
-};
-
-//--------------------------------------------------------------------------
-// Alpha compositing quality constants
-//--------------------------------------------------------------------------
-
-enum CompositingQuality
-{
- CompositingQualityInvalid = QualityModeInvalid,
- CompositingQualityDefault = QualityModeDefault,
- CompositingQualityHighSpeed = QualityModeLow,
- CompositingQualityHighQuality = QualityModeHigh,
- CompositingQualityGammaCorrected,
- CompositingQualityAssumeLinear
-};
-
-//--------------------------------------------------------------------------
-// Unit constants
-//--------------------------------------------------------------------------
-
-enum Unit
-{
- UnitWorld, // 0 -- World coordinate (non-physical unit)
- UnitDisplay, // 1 -- Variable -- for PageTransform only
- UnitPixel, // 2 -- Each unit is one device pixel.
- UnitPoint, // 3 -- Each unit is a printer's point, or 1/72 inch.
- UnitInch, // 4 -- Each unit is 1 inch.
- UnitDocument, // 5 -- Each unit is 1/300 inch.
- UnitMillimeter // 6 -- Each unit is 1 millimeter.
-};
-
-//--------------------------------------------------------------------------
-// MetafileFrameUnit
-//
-// The frameRect for creating a metafile can be specified in any of these
-// units. There is an extra frame unit value (MetafileFrameUnitGdi) so
-// that units can be supplied in the same units that GDI expects for
-// frame rects -- these units are in .01 (1/100ths) millimeter units
-// as defined by GDI.
-//--------------------------------------------------------------------------
-enum MetafileFrameUnit
-{
- MetafileFrameUnitPixel = UnitPixel,
- MetafileFrameUnitPoint = UnitPoint,
- MetafileFrameUnitInch = UnitInch,
- MetafileFrameUnitDocument = UnitDocument,
- MetafileFrameUnitMillimeter = UnitMillimeter,
- MetafileFrameUnitGdi // GDI compatible .01 MM units
-};
-
-//--------------------------------------------------------------------------
-// Coordinate space identifiers
-//--------------------------------------------------------------------------
-
-enum CoordinateSpace
-{
- CoordinateSpaceWorld, // 0
- CoordinateSpacePage, // 1
- CoordinateSpaceDevice // 2
-};
-
-//--------------------------------------------------------------------------
-// Various wrap modes for brushes
-//--------------------------------------------------------------------------
-
-enum WrapMode
-{
- WrapModeTile, // 0
- WrapModeTileFlipX, // 1
- WrapModeTileFlipY, // 2
- WrapModeTileFlipXY, // 3
- WrapModeClamp // 4
-};
-
-//--------------------------------------------------------------------------
-// Various hatch styles
-//--------------------------------------------------------------------------
-
-enum HatchStyle
-{
- HatchStyleHorizontal, // 0
- HatchStyleVertical, // 1
- HatchStyleForwardDiagonal, // 2
- HatchStyleBackwardDiagonal, // 3
- HatchStyleCross, // 4
- HatchStyleDiagonalCross, // 5
- HatchStyle05Percent, // 6
- HatchStyle10Percent, // 7
- HatchStyle20Percent, // 8
- HatchStyle25Percent, // 9
- HatchStyle30Percent, // 10
- HatchStyle40Percent, // 11
- HatchStyle50Percent, // 12
- HatchStyle60Percent, // 13
- HatchStyle70Percent, // 14
- HatchStyle75Percent, // 15
- HatchStyle80Percent, // 16
- HatchStyle90Percent, // 17
- HatchStyleLightDownwardDiagonal, // 18
- HatchStyleLightUpwardDiagonal, // 19
- HatchStyleDarkDownwardDiagonal, // 20
- HatchStyleDarkUpwardDiagonal, // 21
- HatchStyleWideDownwardDiagonal, // 22
- HatchStyleWideUpwardDiagonal, // 23
- HatchStyleLightVertical, // 24
- HatchStyleLightHorizontal, // 25
- HatchStyleNarrowVertical, // 26
- HatchStyleNarrowHorizontal, // 27
- HatchStyleDarkVertical, // 28
- HatchStyleDarkHorizontal, // 29
- HatchStyleDashedDownwardDiagonal, // 30
- HatchStyleDashedUpwardDiagonal, // 31
- HatchStyleDashedHorizontal, // 32
- HatchStyleDashedVertical, // 33
- HatchStyleSmallConfetti, // 34
- HatchStyleLargeConfetti, // 35
- HatchStyleZigZag, // 36
- HatchStyleWave, // 37
- HatchStyleDiagonalBrick, // 38
- HatchStyleHorizontalBrick, // 39
- HatchStyleWeave, // 40
- HatchStylePlaid, // 41
- HatchStyleDivot, // 42
- HatchStyleDottedGrid, // 43
- HatchStyleDottedDiamond, // 44
- HatchStyleShingle, // 45
- HatchStyleTrellis, // 46
- HatchStyleSphere, // 47
- HatchStyleSmallGrid, // 48
- HatchStyleSmallCheckerBoard, // 49
- HatchStyleLargeCheckerBoard, // 50
- HatchStyleOutlinedDiamond, // 51
- HatchStyleSolidDiamond, // 52
-
- HatchStyleTotal, // must be after all unique hatch styles
-
- HatchStyleLargeGrid = HatchStyleCross, // 4 an alias for the cross style
-
- HatchStyleMin = HatchStyleHorizontal,
- HatchStyleMax = HatchStyleTotal - 1,
-};
-
-//--------------------------------------------------------------------------
-// Dash style constants
-//--------------------------------------------------------------------------
-
-enum DashStyle
-{
- DashStyleSolid, // 0
- DashStyleDash, // 1
- DashStyleDot, // 2
- DashStyleDashDot, // 3
- DashStyleDashDotDot, // 4
- DashStyleCustom // 5
-};
-
-//--------------------------------------------------------------------------
-// Dash cap constants
-//--------------------------------------------------------------------------
-
-enum DashCap
-{
- DashCapFlat = 0,
- DashCapRound = 2,
- DashCapTriangle = 3
-};
-
-//--------------------------------------------------------------------------
-// Line cap constants (only the lowest 8 bits are used).
-//--------------------------------------------------------------------------
-
-enum LineCap
-{
- LineCapFlat = 0,
- LineCapSquare = 1,
- LineCapRound = 2,
- LineCapTriangle = 3,
-
- LineCapNoAnchor = 0x10, // corresponds to flat cap
- LineCapSquareAnchor = 0x11, // corresponds to square cap
- LineCapRoundAnchor = 0x12, // corresponds to round cap
- LineCapDiamondAnchor = 0x13, // corresponds to triangle cap
- LineCapArrowAnchor = 0x14, // no correspondence
-
- LineCapCustom = 0xff, // custom cap
-
- LineCapAnchorMask = 0xf0 // mask to check for anchor or not.
-};
-
-//--------------------------------------------------------------------------
-// Custom Line cap type constants
-//--------------------------------------------------------------------------
-
-enum CustomLineCapType
-{
- CustomLineCapTypeDefault = 0,
- CustomLineCapTypeAdjustableArrow = 1
-};
-
-//--------------------------------------------------------------------------
-// Line join constants
-//--------------------------------------------------------------------------
-
-enum LineJoin
-{
- LineJoinMiter = 0,
- LineJoinBevel = 1,
- LineJoinRound = 2,
- LineJoinMiterClipped = 3
-};
-
-//--------------------------------------------------------------------------
-// Path point types (only the lowest 8 bits are used.)
-// The lowest 3 bits are interpreted as point type
-// The higher 5 bits are reserved for flags.
-//--------------------------------------------------------------------------
-
-enum PathPointType
-{
- PathPointTypeStart = 0, // move
- PathPointTypeLine = 1, // line
- PathPointTypeBezier = 3, // default Beizer (= cubic Bezier)
- PathPointTypePathTypeMask = 0x07, // type mask (lowest 3 bits).
- PathPointTypeDashMode = 0x10, // currently in dash mode.
- PathPointTypePathMarker = 0x20, // a marker for the path.
- PathPointTypeCloseSubpath = 0x80, // closed flag
-
- // Path types used for advanced path.
-
- PathPointTypeBezier2 = 2, // quadratic Beizer
- PathPointTypeBezier3 = 3, // cubic Bezier
- PathPointTypeBezier4 = 4, // quartic (4th order) Beizer
- PathPointTypeBezier5 = 5, // quintic (5th order) Bezier
- PathPointTypeBezier6 = 6 // hexaic (6th order) Bezier
-};
-
-
-//--------------------------------------------------------------------------
-// WarpMode constants
-//--------------------------------------------------------------------------
-
-enum WarpMode
-{
- WarpModePerspective, // 0
- WarpModeBilinear // 1
-};
-
-//--------------------------------------------------------------------------
-// LineGradient Mode
-//--------------------------------------------------------------------------
-
-enum LinearGradientMode
-{
- LinearGradientModeHorizontal, // 0
- LinearGradientModeVertical, // 1
- LinearGradientModeForwardDiagonal, // 2
- LinearGradientModeBackwardDiagonal // 3
-};
-
-//--------------------------------------------------------------------------
-// Region Comine Modes
-//--------------------------------------------------------------------------
-
-enum CombineMode
-{
- CombineModeReplace, // 0
- CombineModeIntersect, // 1
- CombineModeUnion, // 2
- CombineModeXor, // 3
- CombineModeExclude, // 4
- CombineModeComplement // 5 (does exclude from)
-};
-
-//--------------------------------------------------------------------------
- // Image types
-//--------------------------------------------------------------------------
-
-enum ImageType
-{
- ImageTypeUnknown, // 0
- ImageTypeBitmap, // 1
- ImageTypeMetafile // 2
-};
-
-//--------------------------------------------------------------------------
-// Interpolation modes
-//--------------------------------------------------------------------------
-
-enum InterpolationMode
-{
- InterpolationModeInvalid = QualityModeInvalid,
- InterpolationModeDefault = QualityModeDefault,
- InterpolationModeLowQuality = QualityModeLow,
- InterpolationModeHighQuality = QualityModeHigh,
- InterpolationModeBilinear,
- InterpolationModeBicubic,
- InterpolationModeNearestNeighbor,
- InterpolationModeHighQualityBilinear,
- InterpolationModeHighQualityBicubic
-};
-
-//--------------------------------------------------------------------------
-// Pen types
-//--------------------------------------------------------------------------
-enum PenAlignment
-{
- PenAlignmentCenter = 0,
- PenAlignmentInset = 1,
- PenAlignmentOutset = 2,
- PenAlignmentLeft = 3,
- PenAlignmentRight = 4
-};
-
-//--------------------------------------------------------------------------
-// Brush types
-//--------------------------------------------------------------------------
-
-enum BrushType
-{
- BrushTypeSolidColor = 0,
- BrushTypeHatchFill = 1,
- BrushTypeTextureFill = 2,
- BrushTypePathGradient = 3,
- BrushTypeLinearGradient = 4
-};
-
-//--------------------------------------------------------------------------
-// Pen's Fill types
-//--------------------------------------------------------------------------
-
-enum PenType
-{
- PenTypeSolidColor = BrushTypeSolidColor,
- PenTypeHatchFill = BrushTypeHatchFill,
- PenTypeTextureFill = BrushTypeTextureFill,
- PenTypePathGradient = BrushTypePathGradient,
- PenTypeLinearGradient = BrushTypeLinearGradient,
- PenTypeUnknown = -1
-};
-
-//--------------------------------------------------------------------------
-// Matrix Order
-//--------------------------------------------------------------------------
-
-enum MatrixOrder
-{
- MatrixOrderPrepend = 0,
- MatrixOrderAppend = 1
-};
-
-//--------------------------------------------------------------------------
-// Generic font families
-//--------------------------------------------------------------------------
-
-enum GenericFontFamily
-{
- GenericFontFamilySerif,
- GenericFontFamilySansSerif,
- GenericFontFamilyMonospace
-
-};
-
-//--------------------------------------------------------------------------
-// FontStyle: face types and common styles
-//--------------------------------------------------------------------------
-
-// These should probably be flags
-
-// Must have:
-// Regular = 0
-// Bold = 1
-// Italic = 2
-// BoldItalic = 3
-
-enum FontStyle
-{
- FontStyleRegular = 0,
- FontStyleBold = 1,
- FontStyleItalic = 2,
- FontStyleBoldItalic = 3,
- FontStyleUnderline = 4,
- FontStyleStrikeout = 8
-};
-
-//---------------------------------------------------------------------------
-// Smoothing Mode
-//---------------------------------------------------------------------------
-
-enum SmoothingMode
-{
- SmoothingModeInvalid = QualityModeInvalid,
- SmoothingModeDefault = QualityModeDefault,
- SmoothingModeHighSpeed = QualityModeLow,
- SmoothingModeHighQuality = QualityModeHigh,
- SmoothingModeNone,
- SmoothingModeAntiAlias
-};
-
-//---------------------------------------------------------------------------
-// Pixel Format Mode
-//---------------------------------------------------------------------------
-
-enum PixelOffsetMode
-{
- PixelOffsetModeInvalid = QualityModeInvalid,
- PixelOffsetModeDefault = QualityModeDefault,
- PixelOffsetModeHighSpeed = QualityModeLow,
- PixelOffsetModeHighQuality = QualityModeHigh,
- PixelOffsetModeNone, // no pixel offset
- PixelOffsetModeHalf // offset by -0.5, -0.5 for fast anti-alias perf
-};
-
-//---------------------------------------------------------------------------
-// Text Rendering Hint
-//---------------------------------------------------------------------------
-
-enum TextRenderingHint
-{
-#ifdef DCR_USE_NEW_186764
- TextRenderingHintSystemDefault = 0, // Glyph with system default rendering hint
- TextRenderingHintSingleBitPerPixelGridFit, // Glyph bitmap with hinting
-#else
- TextRenderingHintSingleBitPerPixelGridFit = 0, // Glyph bitmap with hinting
-#endif // DCR_USE_NEW_186764
- TextRenderingHintSingleBitPerPixel, // Glyph bitmap without hinting
- TextRenderingHintAntiAliasGridFit, // Glyph anti-alias bitmap with hinting
- TextRenderingHintAntiAlias, // Glyph anti-alias bitmap without hinting
- TextRenderingHintClearTypeGridFit // Glyph CT bitmap with hinting
-};
-
-//---------------------------------------------------------------------------
-// Metafile Types
-//---------------------------------------------------------------------------
-enum MetafileType
-{
- MetafileTypeInvalid, // Invalid metafile
- MetafileTypeWmf, // Standard WMF
- MetafileTypeWmfAldus, // Aldus Placeable Metafile format
- MetafileTypeEmf, // EMF (not EMF+)
- MetafileTypeEmfPlusOnly, // EMF+ without dual, down-level records
- MetafileTypeEmfPlusDual // EMF+ with dual, down-level records
-};
-
-// Specifies the type of EMF to record
-enum EmfType
-{
- EmfTypeEmfOnly = MetafileTypeEmf, // no EMF+, only EMF
- EmfTypeEmfPlusOnly = MetafileTypeEmfPlusOnly, // no EMF, only EMF+
- EmfTypeEmfPlusDual = MetafileTypeEmfPlusDual // both EMF+ and EMF
-};
-
-// All persistent objects must have a type listed here
-enum ObjectType
-{
- ObjectTypeInvalid,
- ObjectTypeBrush,
- ObjectTypePen,
- ObjectTypePath,
- ObjectTypeRegion,
- ObjectTypeImage,
- ObjectTypeFont,
- ObjectTypeStringFormat,
- ObjectTypeImageAttributes,
- ObjectTypeCustomLineCap,
-
- ObjectTypeMax = ObjectTypeCustomLineCap,
- ObjectTypeMin = ObjectTypeBrush
-};
-
-inline BOOL
-ObjectTypeIsValid(
- ObjectType type
- )
-{
- return ((type >= ObjectTypeMin) && (type <= ObjectTypeMax));
-}
-
-//---------------------------------------------------------------------------
-// EMF+ Records
-//---------------------------------------------------------------------------
-
-// We have to change the WMF record numbers so that they don't conflict with
-// the EMF and EMF+ record numbers.
-enum EmfPlusRecordType;
-#define GDIP_EMFPLUS_RECORD_BASE 0x00004000
-#define GDIP_WMF_RECORD_BASE 0x00010000
-#define GDIP_WMF_RECORD_TO_EMFPLUS(n) ((EmfPlusRecordType)((n) | GDIP_WMF_RECORD_BASE))
-#define GDIP_EMFPLUS_RECORD_TO_WMF(n) ((n) & (~GDIP_WMF_RECORD_BASE))
-#define GDIP_IS_WMF_RECORDTYPE(n) (((n) & GDIP_WMF_RECORD_BASE) != 0)
-
-enum EmfPlusRecordType
-{
- // Since we have to enumerate GDI records right along with GDI+ records,
- // we list all the GDI records here so that they can be part of the
- // same enumeration type which is used in the enumeration callback.
-
- WmfRecordTypeSetBkColor = GDIP_WMF_RECORD_TO_EMFPLUS(META_SETBKCOLOR),
- WmfRecordTypeSetBkMode = GDIP_WMF_RECORD_TO_EMFPLUS(META_SETBKMODE),
- WmfRecordTypeSetMapMode = GDIP_WMF_RECORD_TO_EMFPLUS(META_SETMAPMODE),
- WmfRecordTypeSetROP2 = GDIP_WMF_RECORD_TO_EMFPLUS(META_SETROP2),
- WmfRecordTypeSetRelAbs = GDIP_WMF_RECORD_TO_EMFPLUS(META_SETRELABS),
- WmfRecordTypeSetPolyFillMode = GDIP_WMF_RECORD_TO_EMFPLUS(META_SETPOLYFILLMODE),
- WmfRecordTypeSetStretchBltMode = GDIP_WMF_RECORD_TO_EMFPLUS(META_SETSTRETCHBLTMODE),
- WmfRecordTypeSetTextCharExtra = GDIP_WMF_RECORD_TO_EMFPLUS(META_SETTEXTCHAREXTRA),
- WmfRecordTypeSetTextColor = GDIP_WMF_RECORD_TO_EMFPLUS(META_SETTEXTCOLOR),
- WmfRecordTypeSetTextJustification = GDIP_WMF_RECORD_TO_EMFPLUS(META_SETTEXTJUSTIFICATION),
- WmfRecordTypeSetWindowOrg = GDIP_WMF_RECORD_TO_EMFPLUS(META_SETWINDOWORG),
- WmfRecordTypeSetWindowExt = GDIP_WMF_RECORD_TO_EMFPLUS(META_SETWINDOWEXT),
- WmfRecordTypeSetViewportOrg = GDIP_WMF_RECORD_TO_EMFPLUS(META_SETVIEWPORTORG),
- WmfRecordTypeSetViewportExt = GDIP_WMF_RECORD_TO_EMFPLUS(META_SETVIEWPORTEXT),
- WmfRecordTypeOffsetWindowOrg = GDIP_WMF_RECORD_TO_EMFPLUS(META_OFFSETWINDOWORG),
- WmfRecordTypeScaleWindowExt = GDIP_WMF_RECORD_TO_EMFPLUS(META_SCALEWINDOWEXT),
- WmfRecordTypeOffsetViewportOrg = GDIP_WMF_RECORD_TO_EMFPLUS(META_OFFSETVIEWPORTORG),
- WmfRecordTypeScaleViewportExt = GDIP_WMF_RECORD_TO_EMFPLUS(META_SCALEVIEWPORTEXT),
- WmfRecordTypeLineTo = GDIP_WMF_RECORD_TO_EMFPLUS(META_LINETO),
- WmfRecordTypeMoveTo = GDIP_WMF_RECORD_TO_EMFPLUS(META_MOVETO),
- WmfRecordTypeExcludeClipRect = GDIP_WMF_RECORD_TO_EMFPLUS(META_EXCLUDECLIPRECT),
- WmfRecordTypeIntersectClipRect = GDIP_WMF_RECORD_TO_EMFPLUS(META_INTERSECTCLIPRECT),
- WmfRecordTypeArc = GDIP_WMF_RECORD_TO_EMFPLUS(META_ARC),
- WmfRecordTypeEllipse = GDIP_WMF_RECORD_TO_EMFPLUS(META_ELLIPSE),
- WmfRecordTypeFloodFill = GDIP_WMF_RECORD_TO_EMFPLUS(META_FLOODFILL),
- WmfRecordTypePie = GDIP_WMF_RECORD_TO_EMFPLUS(META_PIE),
- WmfRecordTypeRectangle = GDIP_WMF_RECORD_TO_EMFPLUS(META_RECTANGLE),
- WmfRecordTypeRoundRect = GDIP_WMF_RECORD_TO_EMFPLUS(META_ROUNDRECT),
- WmfRecordTypePatBlt = GDIP_WMF_RECORD_TO_EMFPLUS(META_PATBLT),
- WmfRecordTypeSaveDC = GDIP_WMF_RECORD_TO_EMFPLUS(META_SAVEDC),
- WmfRecordTypeSetPixel = GDIP_WMF_RECORD_TO_EMFPLUS(META_SETPIXEL),
- WmfRecordTypeOffsetClipRgn = GDIP_WMF_RECORD_TO_EMFPLUS(META_OFFSETCLIPRGN),
- WmfRecordTypeTextOut = GDIP_WMF_RECORD_TO_EMFPLUS(META_TEXTOUT),
- WmfRecordTypeBitBlt = GDIP_WMF_RECORD_TO_EMFPLUS(META_BITBLT),
- WmfRecordTypeStretchBlt = GDIP_WMF_RECORD_TO_EMFPLUS(META_STRETCHBLT),
- WmfRecordTypePolygon = GDIP_WMF_RECORD_TO_EMFPLUS(META_POLYGON),
- WmfRecordTypePolyline = GDIP_WMF_RECORD_TO_EMFPLUS(META_POLYLINE),
- WmfRecordTypeEscape = GDIP_WMF_RECORD_TO_EMFPLUS(META_ESCAPE),
- WmfRecordTypeRestoreDC = GDIP_WMF_RECORD_TO_EMFPLUS(META_RESTOREDC),
- WmfRecordTypeFillRegion = GDIP_WMF_RECORD_TO_EMFPLUS(META_FILLREGION),
- WmfRecordTypeFrameRegion = GDIP_WMF_RECORD_TO_EMFPLUS(META_FRAMEREGION),
- WmfRecordTypeInvertRegion = GDIP_WMF_RECORD_TO_EMFPLUS(META_INVERTREGION),
- WmfRecordTypePaintRegion = GDIP_WMF_RECORD_TO_EMFPLUS(META_PAINTREGION),
- WmfRecordTypeSelectClipRegion = GDIP_WMF_RECORD_TO_EMFPLUS(META_SELECTCLIPREGION),
- WmfRecordTypeSelectObject = GDIP_WMF_RECORD_TO_EMFPLUS(META_SELECTOBJECT),
- WmfRecordTypeSetTextAlign = GDIP_WMF_RECORD_TO_EMFPLUS(META_SETTEXTALIGN),
- WmfRecordTypeDrawText = GDIP_WMF_RECORD_TO_EMFPLUS(0x062F), // META_DRAWTEXT
- WmfRecordTypeChord = GDIP_WMF_RECORD_TO_EMFPLUS(META_CHORD),
- WmfRecordTypeSetMapperFlags = GDIP_WMF_RECORD_TO_EMFPLUS(META_SETMAPPERFLAGS),
- WmfRecordTypeExtTextOut = GDIP_WMF_RECORD_TO_EMFPLUS(META_EXTTEXTOUT),
- WmfRecordTypeSetDIBToDev = GDIP_WMF_RECORD_TO_EMFPLUS(META_SETDIBTODEV),
- WmfRecordTypeSelectPalette = GDIP_WMF_RECORD_TO_EMFPLUS(META_SELECTPALETTE),
- WmfRecordTypeRealizePalette = GDIP_WMF_RECORD_TO_EMFPLUS(META_REALIZEPALETTE),
- WmfRecordTypeAnimatePalette = GDIP_WMF_RECORD_TO_EMFPLUS(META_ANIMATEPALETTE),
- WmfRecordTypeSetPalEntries = GDIP_WMF_RECORD_TO_EMFPLUS(META_SETPALENTRIES),
- WmfRecordTypePolyPolygon = GDIP_WMF_RECORD_TO_EMFPLUS(META_POLYPOLYGON),
- WmfRecordTypeResizePalette = GDIP_WMF_RECORD_TO_EMFPLUS(META_RESIZEPALETTE),
- WmfRecordTypeDIBBitBlt = GDIP_WMF_RECORD_TO_EMFPLUS(META_DIBBITBLT),
- WmfRecordTypeDIBStretchBlt = GDIP_WMF_RECORD_TO_EMFPLUS(META_DIBSTRETCHBLT),
- WmfRecordTypeDIBCreatePatternBrush = GDIP_WMF_RECORD_TO_EMFPLUS(META_DIBCREATEPATTERNBRUSH),
- WmfRecordTypeStretchDIB = GDIP_WMF_RECORD_TO_EMFPLUS(META_STRETCHDIB),
- WmfRecordTypeExtFloodFill = GDIP_WMF_RECORD_TO_EMFPLUS(META_EXTFLOODFILL),
- WmfRecordTypeSetLayout = GDIP_WMF_RECORD_TO_EMFPLUS(0x0149), // META_SETLAYOUT
- WmfRecordTypeResetDC = GDIP_WMF_RECORD_TO_EMFPLUS(0x014C), // META_RESETDC
- WmfRecordTypeStartDoc = GDIP_WMF_RECORD_TO_EMFPLUS(0x014D), // META_STARTDOC
- WmfRecordTypeStartPage = GDIP_WMF_RECORD_TO_EMFPLUS(0x004F), // META_STARTPAGE
- WmfRecordTypeEndPage = GDIP_WMF_RECORD_TO_EMFPLUS(0x0050), // META_ENDPAGE
- WmfRecordTypeAbortDoc = GDIP_WMF_RECORD_TO_EMFPLUS(0x0052), // META_ABORTDOC
- WmfRecordTypeEndDoc = GDIP_WMF_RECORD_TO_EMFPLUS(0x005E), // META_ENDDOC
- WmfRecordTypeDeleteObject = GDIP_WMF_RECORD_TO_EMFPLUS(META_DELETEOBJECT),
- WmfRecordTypeCreatePalette = GDIP_WMF_RECORD_TO_EMFPLUS(META_CREATEPALETTE),
- WmfRecordTypeCreateBrush = GDIP_WMF_RECORD_TO_EMFPLUS(0x00F8), // META_CREATEBRUSH
- WmfRecordTypeCreatePatternBrush = GDIP_WMF_RECORD_TO_EMFPLUS(META_CREATEPATTERNBRUSH),
- WmfRecordTypeCreatePenIndirect = GDIP_WMF_RECORD_TO_EMFPLUS(META_CREATEPENINDIRECT),
- WmfRecordTypeCreateFontIndirect = GDIP_WMF_RECORD_TO_EMFPLUS(META_CREATEFONTINDIRECT),
- WmfRecordTypeCreateBrushIndirect = GDIP_WMF_RECORD_TO_EMFPLUS(META_CREATEBRUSHINDIRECT),
- WmfRecordTypeCreateBitmapIndirect = GDIP_WMF_RECORD_TO_EMFPLUS(0x02FD), // META_CREATEBITMAPINDIRECT
- WmfRecordTypeCreateBitmap = GDIP_WMF_RECORD_TO_EMFPLUS(0x06FE), // META_CREATEBITMAP
- WmfRecordTypeCreateRegion = GDIP_WMF_RECORD_TO_EMFPLUS(META_CREATEREGION),
-
- EmfRecordTypeHeader = EMR_HEADER,
- EmfRecordTypePolyBezier = EMR_POLYBEZIER,
- EmfRecordTypePolygon = EMR_POLYGON,
- EmfRecordTypePolyline = EMR_POLYLINE,
- EmfRecordTypePolyBezierTo = EMR_POLYBEZIERTO,
- EmfRecordTypePolyLineTo = EMR_POLYLINETO,
- EmfRecordTypePolyPolyline = EMR_POLYPOLYLINE,
- EmfRecordTypePolyPolygon = EMR_POLYPOLYGON,
- EmfRecordTypeSetWindowExtEx = EMR_SETWINDOWEXTEX,
- EmfRecordTypeSetWindowOrgEx = EMR_SETWINDOWORGEX,
- EmfRecordTypeSetViewportExtEx = EMR_SETVIEWPORTEXTEX,
- EmfRecordTypeSetViewportOrgEx = EMR_SETVIEWPORTORGEX,
- EmfRecordTypeSetBrushOrgEx = EMR_SETBRUSHORGEX,
- EmfRecordTypeEOF = EMR_EOF,
- EmfRecordTypeSetPixelV = EMR_SETPIXELV,
- EmfRecordTypeSetMapperFlags = EMR_SETMAPPERFLAGS,
- EmfRecordTypeSetMapMode = EMR_SETMAPMODE,
- EmfRecordTypeSetBkMode = EMR_SETBKMODE,
- EmfRecordTypeSetPolyFillMode = EMR_SETPOLYFILLMODE,
- EmfRecordTypeSetROP2 = EMR_SETROP2,
- EmfRecordTypeSetStretchBltMode = EMR_SETSTRETCHBLTMODE,
- EmfRecordTypeSetTextAlign = EMR_SETTEXTALIGN,
- EmfRecordTypeSetColorAdjustment = EMR_SETCOLORADJUSTMENT,
- EmfRecordTypeSetTextColor = EMR_SETTEXTCOLOR,
- EmfRecordTypeSetBkColor = EMR_SETBKCOLOR,
- EmfRecordTypeOffsetClipRgn = EMR_OFFSETCLIPRGN,
- EmfRecordTypeMoveToEx = EMR_MOVETOEX,
- EmfRecordTypeSetMetaRgn = EMR_SETMETARGN,
- EmfRecordTypeExcludeClipRect = EMR_EXCLUDECLIPRECT,
- EmfRecordTypeIntersectClipRect = EMR_INTERSECTCLIPRECT,
- EmfRecordTypeScaleViewportExtEx = EMR_SCALEVIEWPORTEXTEX,
- EmfRecordTypeScaleWindowExtEx = EMR_SCALEWINDOWEXTEX,
- EmfRecordTypeSaveDC = EMR_SAVEDC,
- EmfRecordTypeRestoreDC = EMR_RESTOREDC,
- EmfRecordTypeSetWorldTransform = EMR_SETWORLDTRANSFORM,
- EmfRecordTypeModifyWorldTransform = EMR_MODIFYWORLDTRANSFORM,
- EmfRecordTypeSelectObject = EMR_SELECTOBJECT,
- EmfRecordTypeCreatePen = EMR_CREATEPEN,
- EmfRecordTypeCreateBrushIndirect = EMR_CREATEBRUSHINDIRECT,
- EmfRecordTypeDeleteObject = EMR_DELETEOBJECT,
- EmfRecordTypeAngleArc = EMR_ANGLEARC,
- EmfRecordTypeEllipse = EMR_ELLIPSE,
- EmfRecordTypeRectangle = EMR_RECTANGLE,
- EmfRecordTypeRoundRect = EMR_ROUNDRECT,
- EmfRecordTypeArc = EMR_ARC,
- EmfRecordTypeChord = EMR_CHORD,
- EmfRecordTypePie = EMR_PIE,
- EmfRecordTypeSelectPalette = EMR_SELECTPALETTE,
- EmfRecordTypeCreatePalette = EMR_CREATEPALETTE,
- EmfRecordTypeSetPaletteEntries = EMR_SETPALETTEENTRIES,
- EmfRecordTypeResizePalette = EMR_RESIZEPALETTE,
- EmfRecordTypeRealizePalette = EMR_REALIZEPALETTE,
- EmfRecordTypeExtFloodFill = EMR_EXTFLOODFILL,
- EmfRecordTypeLineTo = EMR_LINETO,
- EmfRecordTypeArcTo = EMR_ARCTO,
- EmfRecordTypePolyDraw = EMR_POLYDRAW,
- EmfRecordTypeSetArcDirection = EMR_SETARCDIRECTION,
- EmfRecordTypeSetMiterLimit = EMR_SETMITERLIMIT,
- EmfRecordTypeBeginPath = EMR_BEGINPATH,
- EmfRecordTypeEndPath = EMR_ENDPATH,
- EmfRecordTypeCloseFigure = EMR_CLOSEFIGURE,
- EmfRecordTypeFillPath = EMR_FILLPATH,
- EmfRecordTypeStrokeAndFillPath = EMR_STROKEANDFILLPATH,
- EmfRecordTypeStrokePath = EMR_STROKEPATH,
- EmfRecordTypeFlattenPath = EMR_FLATTENPATH,
- EmfRecordTypeWidenPath = EMR_WIDENPATH,
- EmfRecordTypeSelectClipPath = EMR_SELECTCLIPPATH,
- EmfRecordTypeAbortPath = EMR_ABORTPATH,
- EmfRecordTypeReserved_069 = 69, // Not Used
- EmfRecordTypeGdiComment = EMR_GDICOMMENT,
- EmfRecordTypeFillRgn = EMR_FILLRGN,
- EmfRecordTypeFrameRgn = EMR_FRAMERGN,
- EmfRecordTypeInvertRgn = EMR_INVERTRGN,
- EmfRecordTypePaintRgn = EMR_PAINTRGN,
- EmfRecordTypeExtSelectClipRgn = EMR_EXTSELECTCLIPRGN,
- EmfRecordTypeBitBlt = EMR_BITBLT,
- EmfRecordTypeStretchBlt = EMR_STRETCHBLT,
- EmfRecordTypeMaskBlt = EMR_MASKBLT,
- EmfRecordTypePlgBlt = EMR_PLGBLT,
- EmfRecordTypeSetDIBitsToDevice = EMR_SETDIBITSTODEVICE,
- EmfRecordTypeStretchDIBits = EMR_STRETCHDIBITS,
- EmfRecordTypeExtCreateFontIndirect = EMR_EXTCREATEFONTINDIRECTW,
- EmfRecordTypeExtTextOutA = EMR_EXTTEXTOUTA,
- EmfRecordTypeExtTextOutW = EMR_EXTTEXTOUTW,
- EmfRecordTypePolyBezier16 = EMR_POLYBEZIER16,
- EmfRecordTypePolygon16 = EMR_POLYGON16,
- EmfRecordTypePolyline16 = EMR_POLYLINE16,
- EmfRecordTypePolyBezierTo16 = EMR_POLYBEZIERTO16,
- EmfRecordTypePolylineTo16 = EMR_POLYLINETO16,
- EmfRecordTypePolyPolyline16 = EMR_POLYPOLYLINE16,
- EmfRecordTypePolyPolygon16 = EMR_POLYPOLYGON16,
- EmfRecordTypePolyDraw16 = EMR_POLYDRAW16,
- EmfRecordTypeCreateMonoBrush = EMR_CREATEMONOBRUSH,
- EmfRecordTypeCreateDIBPatternBrushPt = EMR_CREATEDIBPATTERNBRUSHPT,
- EmfRecordTypeExtCreatePen = EMR_EXTCREATEPEN,
- EmfRecordTypePolyTextOutA = EMR_POLYTEXTOUTA,
- EmfRecordTypePolyTextOutW = EMR_POLYTEXTOUTW,
- EmfRecordTypeSetICMMode = 98, // EMR_SETICMMODE,
- EmfRecordTypeCreateColorSpace = 99, // EMR_CREATECOLORSPACE,
- EmfRecordTypeSetColorSpace = 100, // EMR_SETCOLORSPACE,
- EmfRecordTypeDeleteColorSpace = 101, // EMR_DELETECOLORSPACE,
- EmfRecordTypeGLSRecord = 102, // EMR_GLSRECORD,
- EmfRecordTypeGLSBoundedRecord = 103, // EMR_GLSBOUNDEDRECORD,
- EmfRecordTypePixelFormat = 104, // EMR_PIXELFORMAT,
- EmfRecordTypeDrawEscape = 105, // EMR_RESERVED_105,
- EmfRecordTypeExtEscape = 106, // EMR_RESERVED_106,
- EmfRecordTypeStartDoc = 107, // EMR_RESERVED_107,
- EmfRecordTypeSmallTextOut = 108, // EMR_RESERVED_108,
- EmfRecordTypeForceUFIMapping = 109, // EMR_RESERVED_109,
- EmfRecordTypeNamedEscape = 110, // EMR_RESERVED_110,
- EmfRecordTypeColorCorrectPalette = 111, // EMR_COLORCORRECTPALETTE,
- EmfRecordTypeSetICMProfileA = 112, // EMR_SETICMPROFILEA,
- EmfRecordTypeSetICMProfileW = 113, // EMR_SETICMPROFILEW,
- EmfRecordTypeAlphaBlend = 114, // EMR_ALPHABLEND,
- EmfRecordTypeSetLayout = 115, // EMR_SETLAYOUT,
- EmfRecordTypeTransparentBlt = 116, // EMR_TRANSPARENTBLT,
- EmfRecordTypeReserved_117 = 117, // Not Used
- EmfRecordTypeGradientFill = 118, // EMR_GRADIENTFILL,
- EmfRecordTypeSetLinkedUFIs = 119, // EMR_RESERVED_119,
- EmfRecordTypeSetTextJustification = 120, // EMR_RESERVED_120,
- EmfRecordTypeColorMatchToTargetW = 121, // EMR_COLORMATCHTOTARGETW,
- EmfRecordTypeCreateColorSpaceW = 122, // EMR_CREATECOLORSPACEW,
- EmfRecordTypeMax = 122,
- EmfRecordTypeMin = 1,
-
- // That is the END of the GDI EMF records.
-
- // Now we start the list of EMF+ records. We leave quite
- // a bit of room here for the addition of any new GDI
- // records that may be added later.
-
- EmfPlusRecordTypeInvalid = GDIP_EMFPLUS_RECORD_BASE,
- EmfPlusRecordTypeHeader,
- EmfPlusRecordTypeEndOfFile,
-
- EmfPlusRecordTypeComment,
-
- EmfPlusRecordTypeGetDC, // the application grabbed the metafile dc
-
- EmfPlusRecordTypeMultiFormatStart,
- EmfPlusRecordTypeMultiFormatSection,
- EmfPlusRecordTypeMultiFormatEnd,
-
- // For all persistent objects
- EmfPlusRecordTypeObject, // brush,pen,path,region,image,font,string-format
-
- // Drawing Records
- EmfPlusRecordTypeClear,
- EmfPlusRecordTypeFillRects,
- EmfPlusRecordTypeDrawRects,
- EmfPlusRecordTypeFillPolygon,
- EmfPlusRecordTypeDrawLines,
- EmfPlusRecordTypeFillEllipse,
- EmfPlusRecordTypeDrawEllipse,
- EmfPlusRecordTypeFillPie,
- EmfPlusRecordTypeDrawPie,
- EmfPlusRecordTypeDrawArc,
- EmfPlusRecordTypeFillRegion,
- EmfPlusRecordTypeFillPath,
- EmfPlusRecordTypeDrawPath,
- EmfPlusRecordTypeFillClosedCurve,
- EmfPlusRecordTypeDrawClosedCurve,
- EmfPlusRecordTypeDrawCurve,
- EmfPlusRecordTypeDrawBeziers,
- EmfPlusRecordTypeDrawImage,
- EmfPlusRecordTypeDrawImagePoints,
- EmfPlusRecordTypeDrawString,
-
- // Graphics State Records
- EmfPlusRecordTypeSetRenderingOrigin,
- EmfPlusRecordTypeSetAntiAliasMode,
- EmfPlusRecordTypeSetTextRenderingHint,
-#ifdef DCR_USE_NEW_188922
- EmfPlusRecordTypeSetTextContrast,
-#else
- EmfPlusRecordTypeSetGammaValue,
-#endif // DCR_USE_NEW_188922
- EmfPlusRecordTypeSetInterpolationMode,
- EmfPlusRecordTypeSetPixelOffsetMode,
- EmfPlusRecordTypeSetCompositingMode,
- EmfPlusRecordTypeSetCompositingQuality,
- EmfPlusRecordTypeSave,
- EmfPlusRecordTypeRestore,
- EmfPlusRecordTypeBeginContainer,
- EmfPlusRecordTypeBeginContainerNoParams,
- EmfPlusRecordTypeEndContainer,
- EmfPlusRecordTypeSetWorldTransform,
- EmfPlusRecordTypeResetWorldTransform,
- EmfPlusRecordTypeMultiplyWorldTransform,
- EmfPlusRecordTypeTranslateWorldTransform,
- EmfPlusRecordTypeScaleWorldTransform,
- EmfPlusRecordTypeRotateWorldTransform,
- EmfPlusRecordTypeSetPageTransform,
- EmfPlusRecordTypeResetClip,
- EmfPlusRecordTypeSetClipRect,
- EmfPlusRecordTypeSetClipPath,
- EmfPlusRecordTypeSetClipRegion,
- EmfPlusRecordTypeOffsetClip,
-
- // New record types must be added here (at the end) -- do not add above,
- // since that will invalidate previous metafiles!
- EmfPlusRecordTypeDrawDriverString,
-
- // Have this here so you don't need to keep changing the value of
- // EmfPlusRecordTypeMax every time you add a new record.
-
- EmfPlusRecordTotal,
-
- EmfPlusRecordTypeMax = EmfPlusRecordTotal-1,
- EmfPlusRecordTypeMin = EmfPlusRecordTypeHeader,
-};
-
-//---------------------------------------------------------------------------
-// StringFormatFlags
-//---------------------------------------------------------------------------
-
-//---------------------------------------------------------------------------
-// String format flags
-//
-// DirectionRightToLeft - For horizontal text, the reading order is
-// right to left. This value is called
-// the base embedding level by the Unicode
-// bidirectional engine.
-// For vertical text, columns are read from
-// right to left.
-// By default, horizontal or vertical text is
-// read from left to right.
-//
-// DirectionVertical - Individual lines of text are vertical. In
-// each line, characters progress from top to
-// bottom.
-// By default, lines of text are horizontal,
-// each new line below the previous line.
-//
-// NoFitBlackBox - Allows parts of glyphs to overhang the
-// bounding rectangle.
-// By default glyphs are first aligned
-// inside the margines, then any glyphs which
-// still overhang the bounding box are
-// repositioned to avoid any overhang.
-// For example when an italic
-// lower case letter f in a font such as
-// Garamond is aligned at the far left of a
-// rectangle, the lower part of the f will
-// reach slightly further left than the left
-// edge of the rectangle. Setting this flag
-// will ensure the character aligns visually
-// with the lines above and below, but may
-// cause some pixels outside the formatting
-// rectangle to be clipped or painted.
-//
-#ifndef DCR_USE_NEW_137252
-// NumberContextArabic - Causes any initial numeric in the string to
-// be analysed for bidirection layout as if
-// it was preceeded by Arabic text.
-//
-// DisableKashidaJustification - Arabic text will not be justified by the
-// insertion of kashidas (i.e. extending the
-// joining line between characters). Instead
-// Arabic script will be justified by the
-// widening of the whitespace between words.
-//
-#endif
-// DisplayFormatControl - Causes control characters such as the
-// left-to-right mark to be shown in the
-// output with a representative glyph.
-//
-#ifndef DCR_USE_NEW_137252
-// DisableKerning - Disables Truetype and OpenType kerning.
-//
-// DisableLigatures - Disables Truetype and OpenType ligatures.
-//
-// LayoutLegacyBidi - Causes the bidirection algorithm to use
-// slightly different classifications for
-// '+', '-' and '/' that make their layout
-// much closer to that expected by files
-// generated in Windows or by Windows
-// applications.
-//
-// NoChanges - A text imager created with this flag set
-// does not support those APIs that change
-// it's contents or formatting, but for most
-// simple text will be significantly faster in
-// performing measurement and drawing
-// functions.
-//
-#endif
-// NoFontFallback - Disables fallback to alternate fonts for
-// characters not supported in the requested
-// font. Any missing characters will be
-// be displayed with the fonts missing glyph,
-// usually an open square.
-//
-// NoWrap - Disables wrapping of text between lines
-// when formatting within a rectangle.
-// NoWrap is implied when a point is passed
-// instead of a rectangle, or when the
-// specified rectangle has a zero line length.
-//
-// NoClip - By default text is clipped to the
-// formatting rectangle. Setting NoClip
-// allows overhanging pixels to affect the
-// device outside the formatting rectangle.
-// Pixels at the end of the line may be
-// affected if the glyphs overhang their
-// cells, and either the NoFitBlackBox flag
-// has been set, or the glyph extends to far
-// to be fitted.
-// Pixels above/before the first line or
-// below/after the last line may be affected
-// if the glyphs extend beyond their cell
-// ascent / descent. This can occur rarely
-// with unusual diacritic mark combinations.
-
-//---------------------------------------------------------------------------
-
-enum StringFormatFlags
-{
- StringFormatFlagsDirectionRightToLeft = 0x00000001,
- StringFormatFlagsDirectionVertical = 0x00000002,
- StringFormatFlagsNoFitBlackBox = 0x00000004,
-#ifndef DCR_USE_NEW_137252
- StringFormatFlagsNumberContextArabic = 0x00000008,
- StringFormatFlagsDisableKashidaJustification = 0x00000010,
-#endif
- StringFormatFlagsDisplayFormatControl = 0x00000020,
-#ifndef DCR_USE_NEW_137252
- StringFormatFlagsDisableKerning = 0x00000040,
- StringFormatFlagsDisableLigatures = 0x00000080,
- StringFormatFlagsLayoutLegacyBidi = 0x00000100,
- StringFormatFlagsNoChanges = 0x00000200,
-#endif
- StringFormatFlagsNoFontFallback = 0x00000400,
- StringFormatFlagsMeasureTrailingSpaces = 0x00000800,
- StringFormatFlagsNoWrap = 0x00001000,
- StringFormatFlagsLineLimit = 0x00002000,
-
- StringFormatFlagsNoClip = 0x00004000
-};
-
-//---------------------------------------------------------------------------
-// StringTrimming
-//---------------------------------------------------------------------------
-
-enum StringTrimming {
- StringTrimmingNone = 0,
- StringTrimmingCharacter = 1,
- StringTrimmingWord = 2,
- StringTrimmingEllipsisCharacter = 3,
- StringTrimmingEllipsisWord = 4,
- StringTrimmingEllipsisPath = 5
-};
-
-#ifndef DCR_USE_NEW_137252
-//---------------------------------------------------------------------------
-// String units
-//
-// String units are like length units in CSS, they may be absolute, or
-// they may be relative to a font size.
-//
-//---------------------------------------------------------------------------
-
-enum StringUnit {
- StringUnitWorld = UnitWorld,
- StringUnitDisplay = UnitDisplay,
- StringUnitPixel = UnitPixel,
- StringUnitPoint = UnitPoint,
- StringUnitInch = UnitInch,
- StringUnitDocument = UnitDocument,
- StringUnitMillimeter = UnitMillimeter,
- StringUnitEm = 32
-};
-#endif
-
-#ifndef DCR_USE_NEW_152154
-//---------------------------------------------------------------------------
-// Line spacing flags
-//---------------------------------------------------------------------------
-
-enum LineSpacing {
- LineSpacingWorld = UnitWorld,
- LineSpacingDisplay = UnitDisplay,
- LineSpacingPixel = UnitPixel,
- LineSpacingPoint = UnitPoint,
- LineSpacingInch = UnitInch,
- LineSpacingDocument = UnitDocument,
- LineSpacingMillimeter = UnitMillimeter,
-
- LineSpacingRecommended = 32,
- LineSpacingAtLeast = 33,
- LineSpacingAtLeastMultiple = 34,
- LineSpacingCell = 35,
- LineSpacingCellAtLeast = 36,
- LineSpacingCellAtLeastMultiple = 37
-};
-
-/// The following methods of linespacing are relative to the font size
-//
-// =========== Method =========== =============== Relative to ===============
-//
-// LineSpacingRecommended recommended line spacing specified by font
-// LineSpacingAtLeast max(recommended, tallest glyph cell)
-// LineSpacingAtLeastMultiple smallest multiple of recommended big enough
-// for all glyph cells on the line
-// LineSpacingCell cell height
-// LineSpacingCellAtLeast max(font cell height, tallest glyph cell)
-// LineSpacingCellAtLeastMultiple smallest multiple of cell height big enough
-// for all glyph cells on the line
-#endif
-
-
-//---------------------------------------------------------------------------
-// National language digit substitution
-//---------------------------------------------------------------------------
-
-enum StringDigitSubstitute
-{
- StringDigitSubstituteUser = 0, // As NLS setting
- StringDigitSubstituteNone = 1,
- StringDigitSubstituteNational = 2,
- StringDigitSubstituteTraditional = 3
-};
-
-//---------------------------------------------------------------------------
-// Hotkey prefix interpretation
-//---------------------------------------------------------------------------
-
-enum HotkeyPrefix
-{
- HotkeyPrefixNone = 0,
- HotkeyPrefixShow = 1,
- HotkeyPrefixHide = 2
-};
-
-//---------------------------------------------------------------------------
-// Text alignment flags
-//---------------------------------------------------------------------------
-
-enum StringAlignment
-{
- // Left edge for left-to-right text,
- // right for right-to-left text,
- // and top for vertical
- StringAlignmentNear = 0,
- StringAlignmentCenter = 1,
- StringAlignmentFar = 2
-};
-
-//---------------------------------------------------------------------------
-// DriverStringOptions
-//---------------------------------------------------------------------------
-
-enum DriverStringOptions
-{
- DriverStringOptionsCmapLookup = 1,
- DriverStringOptionsVertical = 2,
- DriverStringOptionsRealizedAdvance = 4,
-#ifndef DCR_USE_NEW_137252
- DriverStringOptionsCompensateResolution = 8
-#endif
-};
-
-//---------------------------------------------------------------------------
-// Flush Intention flags
-//---------------------------------------------------------------------------
-
-enum FlushIntention
-{
- FlushIntentionFlush = 0, // Flush all batched rendering operations
- FlushIntentionSync = 1 // Flush all batched rendering operations
- // and wait for them to complete
-};
-
-#ifndef DCR_USE_NEW_175866
-
-//---------------------------------------------------------------------------
-// Window Change Notification types
-//---------------------------------------------------------------------------
-
-enum WindowNotifyEnum
-{
- WindowNotifyEnumEnable = 0,
- WindowNotifyEnumDisable,
- WindowNotifyEnumPalette,
- WindowNotifyEnumDisplay,
- WindowNotifyEnumSysColor
-};
-
-#endif
-
-//---------------------------------------------------------------------------
-// Image encoder parameter related types
-//---------------------------------------------------------------------------
-
-#ifdef DCR_USE_NEW_145804
-enum EncoderParameterValueType
-{
- EncoderParameterValueTypeByte = 1, // 8-bit unsigned int
- EncoderParameterValueTypeASCII = 2, // 8-bit byte containing one 7-bit ASCII
- // code. NULL terminated.
- EncoderParameterValueTypeShort = 3, // 16-bit unsigned int
- EncoderParameterValueTypeLong = 4, // 32-bit unsigned int
- EncoderParameterValueTypeRational = 5, // Two Longs. The first Long is the
- // numerator, the second Long expresses the
- // denomintor.
- EncoderParameterValueTypeLongRange = 6, // Two longs which specify a range of
- // integer values. The first Long specifies
- // the lower end and the second one
- // specifies the higher end. All values
- // are inclusive at both ends
- EncoderParameterValueTypeUndefined = 7, // 8-bit byte that can take any value
- // depending on field definition
- EncoderParameterValueTypeRationalRange = 8 // Two Rationals. The first Rational
- // specifies the lower end and the second
- // specifies the higher end. All values
- // are inclusive at both ends
-};
-#else
-enum ValueType
-{
- ValueTypeByte = 1, // 8-bit unsigned int
- ValueTypeASCII = 2, // 8-bit byte containing one 7-bit ASCII
- // code. NULL terminated.
- ValueTypeShort = 3, // 16-bit unsigned int
- ValueTypeLong = 4, // 32-bit unsigned int
- ValueTypeRational = 5, // Two Longs. The first Long is the
- // numerator, the second Long expresses the
- // denomintor.
- ValueTypeLongRange = 6, // Two longs which specify a range of
- // integer values. The first Long specifies
- // the lower end and the second one
- // specifies the higher end. All values
- // are inclusive at both ends
- ValueTypeUndefined = 7, // 8-bit byte that can take any value
- // depending on field definition
- ValueTypeRationalRange = 8 // Two Rationals. The first Rational
- // specifies the lower end and the second
- // specifies the higher end. All values
- // are inclusive at both ends
-};
-#endif
-
-//---------------------------------------------------------------------------
-// Image encoder value types
-//---------------------------------------------------------------------------
-
-enum EncoderValue
-{
- EncoderValueColorTypeCMYK,
- EncoderValueColorTypeYCCK,
- EncoderValueCompressionLZW,
- EncoderValueCompressionCCITT3,
- EncoderValueCompressionCCITT4,
- EncoderValueCompressionRle,
- EncoderValueCompressionNone,
- EncoderValueScanMethodInterlaced,
- EncoderValueScanMethodNonInterlaced,
- EncoderValueVersionGif87,
- EncoderValueVersionGif89,
- EncoderValueRenderProgressive,
- EncoderValueRenderNonProgressive,
- EncoderValueTransformRotate90,
- EncoderValueTransformRotate180,
- EncoderValueTransformRotate270,
- EncoderValueTransformFlipHorizontal,
- EncoderValueTransformFlipVertical,
- #ifdef DCR_USE_NEW_140861
- EncoderValueMultiFrame,
- #else
- EncodeValueMultiFrame,
- #endif
- EncoderValueLastFrame,
- EncoderValueFlush,
- #ifdef DCR_USE_NEW_140861
- EncoderValueFrameDimensionTime,
- EncoderValueFrameDimensionResolution,
- EncoderValueFrameDimensionPage
- #else
- EncodeValueFrameDimensionTime,
- EncodeValueFrameDimensionResolution,
- EncodeValueFrameDimensionPage
- #endif
-};
-
-//---------------------------------------------------------------------------
-// Graphics layout values (support for Middle East localization)
-//---------------------------------------------------------------------------
-
-enum GraphicsLayout
-{
- GraphicsLayoutNormal,
- GraphicsLayoutMirrored,
- GraphicsLayoutMirroredIgnoreImages,
- GraphicsLayoutMirroredForceImages
-};
-
-//---------------------------------------------------------------------------
-// Image layout values (support for Middle East localization)
-//---------------------------------------------------------------------------
-
-enum ImageLayout
-{
- ImageLayoutNormal,
- ImageLayoutIgnoreMirrored
-};
-
-enum EmfToWmfBitsFlags
-{
- EmfToWmfBitsFlagsDefault = 0x00000000,
- EmfToWmfBitsFlagsEmbedEmf = 0x00000001,
- EmfToWmfBitsFlagsIncludeAPM = 0x00000002,
- EmfToWmfBitsFlagsNoXORClip = 0x00000004
-};
-
-#endif // !_GDIPLUSENUMS_H
+/**************************************************************************\
+*
+* Copyright (c) 1998-2000, Microsoft Corp. All Rights Reserved.
+*
+* Module Name:
+*
+* GdiplusEnums.h
+*
+* Abstract:
+*
+* Various enumeration types
+*
+\**************************************************************************/
+
+#ifndef _GDIPLUSENUMS_H
+#define _GDIPLUSENUMS_H
+
+
+//--------------------------------------------------------------------------
+// Default bezier flattening tolerance in device pixels.
+//--------------------------------------------------------------------------
+
+const float FlatnessDefault = 1.0f/4.0f;
+
+//--------------------------------------------------------------------------
+// Graphics and Container State cookies
+//--------------------------------------------------------------------------
+
+typedef UINT GraphicsState;
+typedef UINT GraphicsContainer;
+
+//--------------------------------------------------------------------------
+// Fill mode constants
+//--------------------------------------------------------------------------
+
+enum FillMode
+{
+ FillModeAlternate, // 0
+ FillModeWinding // 1
+};
+
+//--------------------------------------------------------------------------
+// Quality mode constants
+//--------------------------------------------------------------------------
+
+enum QualityMode
+{
+ QualityModeInvalid = -1,
+ QualityModeDefault = 0,
+ QualityModeLow = 1, // for apps that need the best performance
+ QualityModeHigh = 2 // for apps that need the best rendering quality
+};
+
+//--------------------------------------------------------------------------
+// Alpha compositing mode constants
+//--------------------------------------------------------------------------
+
+enum CompositingMode
+{
+ CompositingModeSourceOver, // 0
+ CompositingModeSourceCopy // 1
+};
+
+//--------------------------------------------------------------------------
+// Alpha compositing quality constants
+//--------------------------------------------------------------------------
+
+enum CompositingQuality
+{
+ CompositingQualityInvalid = QualityModeInvalid,
+ CompositingQualityDefault = QualityModeDefault,
+ CompositingQualityHighSpeed = QualityModeLow,
+ CompositingQualityHighQuality = QualityModeHigh,
+ CompositingQualityGammaCorrected,
+ CompositingQualityAssumeLinear
+};
+
+//--------------------------------------------------------------------------
+// Unit constants
+//--------------------------------------------------------------------------
+
+enum Unit
+{
+ UnitWorld, // 0 -- World coordinate (non-physical unit)
+ UnitDisplay, // 1 -- Variable -- for PageTransform only
+ UnitPixel, // 2 -- Each unit is one device pixel.
+ UnitPoint, // 3 -- Each unit is a printer's point, or 1/72 inch.
+ UnitInch, // 4 -- Each unit is 1 inch.
+ UnitDocument, // 5 -- Each unit is 1/300 inch.
+ UnitMillimeter // 6 -- Each unit is 1 millimeter.
+};
+
+//--------------------------------------------------------------------------
+// MetafileFrameUnit
+//
+// The frameRect for creating a metafile can be specified in any of these
+// units. There is an extra frame unit value (MetafileFrameUnitGdi) so
+// that units can be supplied in the same units that GDI expects for
+// frame rects -- these units are in .01 (1/100ths) millimeter units
+// as defined by GDI.
+//--------------------------------------------------------------------------
+enum MetafileFrameUnit
+{
+ MetafileFrameUnitPixel = UnitPixel,
+ MetafileFrameUnitPoint = UnitPoint,
+ MetafileFrameUnitInch = UnitInch,
+ MetafileFrameUnitDocument = UnitDocument,
+ MetafileFrameUnitMillimeter = UnitMillimeter,
+ MetafileFrameUnitGdi // GDI compatible .01 MM units
+};
+
+//--------------------------------------------------------------------------
+// Coordinate space identifiers
+//--------------------------------------------------------------------------
+
+enum CoordinateSpace
+{
+ CoordinateSpaceWorld, // 0
+ CoordinateSpacePage, // 1
+ CoordinateSpaceDevice // 2
+};
+
+//--------------------------------------------------------------------------
+// Various wrap modes for brushes
+//--------------------------------------------------------------------------
+
+enum WrapMode
+{
+ WrapModeTile, // 0
+ WrapModeTileFlipX, // 1
+ WrapModeTileFlipY, // 2
+ WrapModeTileFlipXY, // 3
+ WrapModeClamp // 4
+};
+
+//--------------------------------------------------------------------------
+// Various hatch styles
+//--------------------------------------------------------------------------
+
+enum HatchStyle
+{
+ HatchStyleHorizontal, // 0
+ HatchStyleVertical, // 1
+ HatchStyleForwardDiagonal, // 2
+ HatchStyleBackwardDiagonal, // 3
+ HatchStyleCross, // 4
+ HatchStyleDiagonalCross, // 5
+ HatchStyle05Percent, // 6
+ HatchStyle10Percent, // 7
+ HatchStyle20Percent, // 8
+ HatchStyle25Percent, // 9
+ HatchStyle30Percent, // 10
+ HatchStyle40Percent, // 11
+ HatchStyle50Percent, // 12
+ HatchStyle60Percent, // 13
+ HatchStyle70Percent, // 14
+ HatchStyle75Percent, // 15
+ HatchStyle80Percent, // 16
+ HatchStyle90Percent, // 17
+ HatchStyleLightDownwardDiagonal, // 18
+ HatchStyleLightUpwardDiagonal, // 19
+ HatchStyleDarkDownwardDiagonal, // 20
+ HatchStyleDarkUpwardDiagonal, // 21
+ HatchStyleWideDownwardDiagonal, // 22
+ HatchStyleWideUpwardDiagonal, // 23
+ HatchStyleLightVertical, // 24
+ HatchStyleLightHorizontal, // 25
+ HatchStyleNarrowVertical, // 26
+ HatchStyleNarrowHorizontal, // 27
+ HatchStyleDarkVertical, // 28
+ HatchStyleDarkHorizontal, // 29
+ HatchStyleDashedDownwardDiagonal, // 30
+ HatchStyleDashedUpwardDiagonal, // 31
+ HatchStyleDashedHorizontal, // 32
+ HatchStyleDashedVertical, // 33
+ HatchStyleSmallConfetti, // 34
+ HatchStyleLargeConfetti, // 35
+ HatchStyleZigZag, // 36
+ HatchStyleWave, // 37
+ HatchStyleDiagonalBrick, // 38
+ HatchStyleHorizontalBrick, // 39
+ HatchStyleWeave, // 40
+ HatchStylePlaid, // 41
+ HatchStyleDivot, // 42
+ HatchStyleDottedGrid, // 43
+ HatchStyleDottedDiamond, // 44
+ HatchStyleShingle, // 45
+ HatchStyleTrellis, // 46
+ HatchStyleSphere, // 47
+ HatchStyleSmallGrid, // 48
+ HatchStyleSmallCheckerBoard, // 49
+ HatchStyleLargeCheckerBoard, // 50
+ HatchStyleOutlinedDiamond, // 51
+ HatchStyleSolidDiamond, // 52
+
+ HatchStyleTotal, // must be after all unique hatch styles
+
+ HatchStyleLargeGrid = HatchStyleCross, // 4 an alias for the cross style
+
+ HatchStyleMin = HatchStyleHorizontal,
+ HatchStyleMax = HatchStyleTotal - 1,
+};
+
+//--------------------------------------------------------------------------
+// Dash style constants
+//--------------------------------------------------------------------------
+
+enum DashStyle
+{
+ DashStyleSolid, // 0
+ DashStyleDash, // 1
+ DashStyleDot, // 2
+ DashStyleDashDot, // 3
+ DashStyleDashDotDot, // 4
+ DashStyleCustom // 5
+};
+
+//--------------------------------------------------------------------------
+// Dash cap constants
+//--------------------------------------------------------------------------
+
+enum DashCap
+{
+ DashCapFlat = 0,
+ DashCapRound = 2,
+ DashCapTriangle = 3
+};
+
+//--------------------------------------------------------------------------
+// Line cap constants (only the lowest 8 bits are used).
+//--------------------------------------------------------------------------
+
+enum LineCap
+{
+ LineCapFlat = 0,
+ LineCapSquare = 1,
+ LineCapRound = 2,
+ LineCapTriangle = 3,
+
+ LineCapNoAnchor = 0x10, // corresponds to flat cap
+ LineCapSquareAnchor = 0x11, // corresponds to square cap
+ LineCapRoundAnchor = 0x12, // corresponds to round cap
+ LineCapDiamondAnchor = 0x13, // corresponds to triangle cap
+ LineCapArrowAnchor = 0x14, // no correspondence
+
+ LineCapCustom = 0xff, // custom cap
+
+ LineCapAnchorMask = 0xf0 // mask to check for anchor or not.
+};
+
+//--------------------------------------------------------------------------
+// Custom Line cap type constants
+//--------------------------------------------------------------------------
+
+enum CustomLineCapType
+{
+ CustomLineCapTypeDefault = 0,
+ CustomLineCapTypeAdjustableArrow = 1
+};
+
+//--------------------------------------------------------------------------
+// Line join constants
+//--------------------------------------------------------------------------
+
+enum LineJoin
+{
+ LineJoinMiter = 0,
+ LineJoinBevel = 1,
+ LineJoinRound = 2,
+ LineJoinMiterClipped = 3
+};
+
+//--------------------------------------------------------------------------
+// Path point types (only the lowest 8 bits are used.)
+// The lowest 3 bits are interpreted as point type
+// The higher 5 bits are reserved for flags.
+//--------------------------------------------------------------------------
+
+enum PathPointType
+{
+ PathPointTypeStart = 0, // move
+ PathPointTypeLine = 1, // line
+ PathPointTypeBezier = 3, // default Beizer (= cubic Bezier)
+ PathPointTypePathTypeMask = 0x07, // type mask (lowest 3 bits).
+ PathPointTypeDashMode = 0x10, // currently in dash mode.
+ PathPointTypePathMarker = 0x20, // a marker for the path.
+ PathPointTypeCloseSubpath = 0x80, // closed flag
+
+ // Path types used for advanced path.
+
+ PathPointTypeBezier2 = 2, // quadratic Beizer
+ PathPointTypeBezier3 = 3, // cubic Bezier
+ PathPointTypeBezier4 = 4, // quartic (4th order) Beizer
+ PathPointTypeBezier5 = 5, // quintic (5th order) Bezier
+ PathPointTypeBezier6 = 6 // hexaic (6th order) Bezier
+};
+
+
+//--------------------------------------------------------------------------
+// WarpMode constants
+//--------------------------------------------------------------------------
+
+enum WarpMode
+{
+ WarpModePerspective, // 0
+ WarpModeBilinear // 1
+};
+
+//--------------------------------------------------------------------------
+// LineGradient Mode
+//--------------------------------------------------------------------------
+
+enum LinearGradientMode
+{
+ LinearGradientModeHorizontal, // 0
+ LinearGradientModeVertical, // 1
+ LinearGradientModeForwardDiagonal, // 2
+ LinearGradientModeBackwardDiagonal // 3
+};
+
+//--------------------------------------------------------------------------
+// Region Comine Modes
+//--------------------------------------------------------------------------
+
+enum CombineMode
+{
+ CombineModeReplace, // 0
+ CombineModeIntersect, // 1
+ CombineModeUnion, // 2
+ CombineModeXor, // 3
+ CombineModeExclude, // 4
+ CombineModeComplement // 5 (does exclude from)
+};
+
+//--------------------------------------------------------------------------
+ // Image types
+//--------------------------------------------------------------------------
+
+enum ImageType
+{
+ ImageTypeUnknown, // 0
+ ImageTypeBitmap, // 1
+ ImageTypeMetafile // 2
+};
+
+//--------------------------------------------------------------------------
+// Interpolation modes
+//--------------------------------------------------------------------------
+
+enum InterpolationMode
+{
+ InterpolationModeInvalid = QualityModeInvalid,
+ InterpolationModeDefault = QualityModeDefault,
+ InterpolationModeLowQuality = QualityModeLow,
+ InterpolationModeHighQuality = QualityModeHigh,
+ InterpolationModeBilinear,
+ InterpolationModeBicubic,
+ InterpolationModeNearestNeighbor,
+ InterpolationModeHighQualityBilinear,
+ InterpolationModeHighQualityBicubic
+};
+
+//--------------------------------------------------------------------------
+// Pen types
+//--------------------------------------------------------------------------
+enum PenAlignment
+{
+ PenAlignmentCenter = 0,
+ PenAlignmentInset = 1,
+ PenAlignmentOutset = 2,
+ PenAlignmentLeft = 3,
+ PenAlignmentRight = 4
+};
+
+//--------------------------------------------------------------------------
+// Brush types
+//--------------------------------------------------------------------------
+
+enum BrushType
+{
+ BrushTypeSolidColor = 0,
+ BrushTypeHatchFill = 1,
+ BrushTypeTextureFill = 2,
+ BrushTypePathGradient = 3,
+ BrushTypeLinearGradient = 4
+};
+
+//--------------------------------------------------------------------------
+// Pen's Fill types
+//--------------------------------------------------------------------------
+
+enum PenType
+{
+ PenTypeSolidColor = BrushTypeSolidColor,
+ PenTypeHatchFill = BrushTypeHatchFill,
+ PenTypeTextureFill = BrushTypeTextureFill,
+ PenTypePathGradient = BrushTypePathGradient,
+ PenTypeLinearGradient = BrushTypeLinearGradient,
+ PenTypeUnknown = -1
+};
+
+//--------------------------------------------------------------------------
+// Matrix Order
+//--------------------------------------------------------------------------
+
+enum MatrixOrder
+{
+ MatrixOrderPrepend = 0,
+ MatrixOrderAppend = 1
+};
+
+//--------------------------------------------------------------------------
+// Generic font families
+//--------------------------------------------------------------------------
+
+enum GenericFontFamily
+{
+ GenericFontFamilySerif,
+ GenericFontFamilySansSerif,
+ GenericFontFamilyMonospace
+
+};
+
+//--------------------------------------------------------------------------
+// FontStyle: face types and common styles
+//--------------------------------------------------------------------------
+
+// These should probably be flags
+
+// Must have:
+// Regular = 0
+// Bold = 1
+// Italic = 2
+// BoldItalic = 3
+
+enum FontStyle
+{
+ FontStyleRegular = 0,
+ FontStyleBold = 1,
+ FontStyleItalic = 2,
+ FontStyleBoldItalic = 3,
+ FontStyleUnderline = 4,
+ FontStyleStrikeout = 8
+};
+
+//---------------------------------------------------------------------------
+// Smoothing Mode
+//---------------------------------------------------------------------------
+
+enum SmoothingMode
+{
+ SmoothingModeInvalid = QualityModeInvalid,
+ SmoothingModeDefault = QualityModeDefault,
+ SmoothingModeHighSpeed = QualityModeLow,
+ SmoothingModeHighQuality = QualityModeHigh,
+ SmoothingModeNone,
+ SmoothingModeAntiAlias
+};
+
+//---------------------------------------------------------------------------
+// Pixel Format Mode
+//---------------------------------------------------------------------------
+
+enum PixelOffsetMode
+{
+ PixelOffsetModeInvalid = QualityModeInvalid,
+ PixelOffsetModeDefault = QualityModeDefault,
+ PixelOffsetModeHighSpeed = QualityModeLow,
+ PixelOffsetModeHighQuality = QualityModeHigh,
+ PixelOffsetModeNone, // no pixel offset
+ PixelOffsetModeHalf // offset by -0.5, -0.5 for fast anti-alias perf
+};
+
+//---------------------------------------------------------------------------
+// Text Rendering Hint
+//---------------------------------------------------------------------------
+
+enum TextRenderingHint
+{
+#ifdef DCR_USE_NEW_186764
+ TextRenderingHintSystemDefault = 0, // Glyph with system default rendering hint
+ TextRenderingHintSingleBitPerPixelGridFit, // Glyph bitmap with hinting
+#else
+ TextRenderingHintSingleBitPerPixelGridFit = 0, // Glyph bitmap with hinting
+#endif // DCR_USE_NEW_186764
+ TextRenderingHintSingleBitPerPixel, // Glyph bitmap without hinting
+ TextRenderingHintAntiAliasGridFit, // Glyph anti-alias bitmap with hinting
+ TextRenderingHintAntiAlias, // Glyph anti-alias bitmap without hinting
+ TextRenderingHintClearTypeGridFit // Glyph CT bitmap with hinting
+};
+
+//---------------------------------------------------------------------------
+// Metafile Types
+//---------------------------------------------------------------------------
+enum MetafileType
+{
+ MetafileTypeInvalid, // Invalid metafile
+ MetafileTypeWmf, // Standard WMF
+ MetafileTypeWmfAldus, // Aldus Placeable Metafile format
+ MetafileTypeEmf, // EMF (not EMF+)
+ MetafileTypeEmfPlusOnly, // EMF+ without dual, down-level records
+ MetafileTypeEmfPlusDual // EMF+ with dual, down-level records
+};
+
+// Specifies the type of EMF to record
+enum EmfType
+{
+ EmfTypeEmfOnly = MetafileTypeEmf, // no EMF+, only EMF
+ EmfTypeEmfPlusOnly = MetafileTypeEmfPlusOnly, // no EMF, only EMF+
+ EmfTypeEmfPlusDual = MetafileTypeEmfPlusDual // both EMF+ and EMF
+};
+
+// All persistent objects must have a type listed here
+enum ObjectType
+{
+ ObjectTypeInvalid,
+ ObjectTypeBrush,
+ ObjectTypePen,
+ ObjectTypePath,
+ ObjectTypeRegion,
+ ObjectTypeImage,
+ ObjectTypeFont,
+ ObjectTypeStringFormat,
+ ObjectTypeImageAttributes,
+ ObjectTypeCustomLineCap,
+
+ ObjectTypeMax = ObjectTypeCustomLineCap,
+ ObjectTypeMin = ObjectTypeBrush
+};
+
+inline BOOL
+ObjectTypeIsValid(
+ ObjectType type
+ )
+{
+ return ((type >= ObjectTypeMin) && (type <= ObjectTypeMax));
+}
+
+//---------------------------------------------------------------------------
+// EMF+ Records
+//---------------------------------------------------------------------------
+
+// We have to change the WMF record numbers so that they don't conflict with
+// the EMF and EMF+ record numbers.
+enum EmfPlusRecordType;
+#define GDIP_EMFPLUS_RECORD_BASE 0x00004000
+#define GDIP_WMF_RECORD_BASE 0x00010000
+#define GDIP_WMF_RECORD_TO_EMFPLUS(n) ((EmfPlusRecordType)((n) | GDIP_WMF_RECORD_BASE))
+#define GDIP_EMFPLUS_RECORD_TO_WMF(n) ((n) & (~GDIP_WMF_RECORD_BASE))
+#define GDIP_IS_WMF_RECORDTYPE(n) (((n) & GDIP_WMF_RECORD_BASE) != 0)
+
+enum EmfPlusRecordType
+{
+ // Since we have to enumerate GDI records right along with GDI+ records,
+ // we list all the GDI records here so that they can be part of the
+ // same enumeration type which is used in the enumeration callback.
+
+ WmfRecordTypeSetBkColor = GDIP_WMF_RECORD_TO_EMFPLUS(META_SETBKCOLOR),
+ WmfRecordTypeSetBkMode = GDIP_WMF_RECORD_TO_EMFPLUS(META_SETBKMODE),
+ WmfRecordTypeSetMapMode = GDIP_WMF_RECORD_TO_EMFPLUS(META_SETMAPMODE),
+ WmfRecordTypeSetROP2 = GDIP_WMF_RECORD_TO_EMFPLUS(META_SETROP2),
+ WmfRecordTypeSetRelAbs = GDIP_WMF_RECORD_TO_EMFPLUS(META_SETRELABS),
+ WmfRecordTypeSetPolyFillMode = GDIP_WMF_RECORD_TO_EMFPLUS(META_SETPOLYFILLMODE),
+ WmfRecordTypeSetStretchBltMode = GDIP_WMF_RECORD_TO_EMFPLUS(META_SETSTRETCHBLTMODE),
+ WmfRecordTypeSetTextCharExtra = GDIP_WMF_RECORD_TO_EMFPLUS(META_SETTEXTCHAREXTRA),
+ WmfRecordTypeSetTextColor = GDIP_WMF_RECORD_TO_EMFPLUS(META_SETTEXTCOLOR),
+ WmfRecordTypeSetTextJustification = GDIP_WMF_RECORD_TO_EMFPLUS(META_SETTEXTJUSTIFICATION),
+ WmfRecordTypeSetWindowOrg = GDIP_WMF_RECORD_TO_EMFPLUS(META_SETWINDOWORG),
+ WmfRecordTypeSetWindowExt = GDIP_WMF_RECORD_TO_EMFPLUS(META_SETWINDOWEXT),
+ WmfRecordTypeSetViewportOrg = GDIP_WMF_RECORD_TO_EMFPLUS(META_SETVIEWPORTORG),
+ WmfRecordTypeSetViewportExt = GDIP_WMF_RECORD_TO_EMFPLUS(META_SETVIEWPORTEXT),
+ WmfRecordTypeOffsetWindowOrg = GDIP_WMF_RECORD_TO_EMFPLUS(META_OFFSETWINDOWORG),
+ WmfRecordTypeScaleWindowExt = GDIP_WMF_RECORD_TO_EMFPLUS(META_SCALEWINDOWEXT),
+ WmfRecordTypeOffsetViewportOrg = GDIP_WMF_RECORD_TO_EMFPLUS(META_OFFSETVIEWPORTORG),
+ WmfRecordTypeScaleViewportExt = GDIP_WMF_RECORD_TO_EMFPLUS(META_SCALEVIEWPORTEXT),
+ WmfRecordTypeLineTo = GDIP_WMF_RECORD_TO_EMFPLUS(META_LINETO),
+ WmfRecordTypeMoveTo = GDIP_WMF_RECORD_TO_EMFPLUS(META_MOVETO),
+ WmfRecordTypeExcludeClipRect = GDIP_WMF_RECORD_TO_EMFPLUS(META_EXCLUDECLIPRECT),
+ WmfRecordTypeIntersectClipRect = GDIP_WMF_RECORD_TO_EMFPLUS(META_INTERSECTCLIPRECT),
+ WmfRecordTypeArc = GDIP_WMF_RECORD_TO_EMFPLUS(META_ARC),
+ WmfRecordTypeEllipse = GDIP_WMF_RECORD_TO_EMFPLUS(META_ELLIPSE),
+ WmfRecordTypeFloodFill = GDIP_WMF_RECORD_TO_EMFPLUS(META_FLOODFILL),
+ WmfRecordTypePie = GDIP_WMF_RECORD_TO_EMFPLUS(META_PIE),
+ WmfRecordTypeRectangle = GDIP_WMF_RECORD_TO_EMFPLUS(META_RECTANGLE),
+ WmfRecordTypeRoundRect = GDIP_WMF_RECORD_TO_EMFPLUS(META_ROUNDRECT),
+ WmfRecordTypePatBlt = GDIP_WMF_RECORD_TO_EMFPLUS(META_PATBLT),
+ WmfRecordTypeSaveDC = GDIP_WMF_RECORD_TO_EMFPLUS(META_SAVEDC),
+ WmfRecordTypeSetPixel = GDIP_WMF_RECORD_TO_EMFPLUS(META_SETPIXEL),
+ WmfRecordTypeOffsetClipRgn = GDIP_WMF_RECORD_TO_EMFPLUS(META_OFFSETCLIPRGN),
+ WmfRecordTypeTextOut = GDIP_WMF_RECORD_TO_EMFPLUS(META_TEXTOUT),
+ WmfRecordTypeBitBlt = GDIP_WMF_RECORD_TO_EMFPLUS(META_BITBLT),
+ WmfRecordTypeStretchBlt = GDIP_WMF_RECORD_TO_EMFPLUS(META_STRETCHBLT),
+ WmfRecordTypePolygon = GDIP_WMF_RECORD_TO_EMFPLUS(META_POLYGON),
+ WmfRecordTypePolyline = GDIP_WMF_RECORD_TO_EMFPLUS(META_POLYLINE),
+ WmfRecordTypeEscape = GDIP_WMF_RECORD_TO_EMFPLUS(META_ESCAPE),
+ WmfRecordTypeRestoreDC = GDIP_WMF_RECORD_TO_EMFPLUS(META_RESTOREDC),
+ WmfRecordTypeFillRegion = GDIP_WMF_RECORD_TO_EMFPLUS(META_FILLREGION),
+ WmfRecordTypeFrameRegion = GDIP_WMF_RECORD_TO_EMFPLUS(META_FRAMEREGION),
+ WmfRecordTypeInvertRegion = GDIP_WMF_RECORD_TO_EMFPLUS(META_INVERTREGION),
+ WmfRecordTypePaintRegion = GDIP_WMF_RECORD_TO_EMFPLUS(META_PAINTREGION),
+ WmfRecordTypeSelectClipRegion = GDIP_WMF_RECORD_TO_EMFPLUS(META_SELECTCLIPREGION),
+ WmfRecordTypeSelectObject = GDIP_WMF_RECORD_TO_EMFPLUS(META_SELECTOBJECT),
+ WmfRecordTypeSetTextAlign = GDIP_WMF_RECORD_TO_EMFPLUS(META_SETTEXTALIGN),
+ WmfRecordTypeDrawText = GDIP_WMF_RECORD_TO_EMFPLUS(0x062F), // META_DRAWTEXT
+ WmfRecordTypeChord = GDIP_WMF_RECORD_TO_EMFPLUS(META_CHORD),
+ WmfRecordTypeSetMapperFlags = GDIP_WMF_RECORD_TO_EMFPLUS(META_SETMAPPERFLAGS),
+ WmfRecordTypeExtTextOut = GDIP_WMF_RECORD_TO_EMFPLUS(META_EXTTEXTOUT),
+ WmfRecordTypeSetDIBToDev = GDIP_WMF_RECORD_TO_EMFPLUS(META_SETDIBTODEV),
+ WmfRecordTypeSelectPalette = GDIP_WMF_RECORD_TO_EMFPLUS(META_SELECTPALETTE),
+ WmfRecordTypeRealizePalette = GDIP_WMF_RECORD_TO_EMFPLUS(META_REALIZEPALETTE),
+ WmfRecordTypeAnimatePalette = GDIP_WMF_RECORD_TO_EMFPLUS(META_ANIMATEPALETTE),
+ WmfRecordTypeSetPalEntries = GDIP_WMF_RECORD_TO_EMFPLUS(META_SETPALENTRIES),
+ WmfRecordTypePolyPolygon = GDIP_WMF_RECORD_TO_EMFPLUS(META_POLYPOLYGON),
+ WmfRecordTypeResizePalette = GDIP_WMF_RECORD_TO_EMFPLUS(META_RESIZEPALETTE),
+ WmfRecordTypeDIBBitBlt = GDIP_WMF_RECORD_TO_EMFPLUS(META_DIBBITBLT),
+ WmfRecordTypeDIBStretchBlt = GDIP_WMF_RECORD_TO_EMFPLUS(META_DIBSTRETCHBLT),
+ WmfRecordTypeDIBCreatePatternBrush = GDIP_WMF_RECORD_TO_EMFPLUS(META_DIBCREATEPATTERNBRUSH),
+ WmfRecordTypeStretchDIB = GDIP_WMF_RECORD_TO_EMFPLUS(META_STRETCHDIB),
+ WmfRecordTypeExtFloodFill = GDIP_WMF_RECORD_TO_EMFPLUS(META_EXTFLOODFILL),
+ WmfRecordTypeSetLayout = GDIP_WMF_RECORD_TO_EMFPLUS(0x0149), // META_SETLAYOUT
+ WmfRecordTypeResetDC = GDIP_WMF_RECORD_TO_EMFPLUS(0x014C), // META_RESETDC
+ WmfRecordTypeStartDoc = GDIP_WMF_RECORD_TO_EMFPLUS(0x014D), // META_STARTDOC
+ WmfRecordTypeStartPage = GDIP_WMF_RECORD_TO_EMFPLUS(0x004F), // META_STARTPAGE
+ WmfRecordTypeEndPage = GDIP_WMF_RECORD_TO_EMFPLUS(0x0050), // META_ENDPAGE
+ WmfRecordTypeAbortDoc = GDIP_WMF_RECORD_TO_EMFPLUS(0x0052), // META_ABORTDOC
+ WmfRecordTypeEndDoc = GDIP_WMF_RECORD_TO_EMFPLUS(0x005E), // META_ENDDOC
+ WmfRecordTypeDeleteObject = GDIP_WMF_RECORD_TO_EMFPLUS(META_DELETEOBJECT),
+ WmfRecordTypeCreatePalette = GDIP_WMF_RECORD_TO_EMFPLUS(META_CREATEPALETTE),
+ WmfRecordTypeCreateBrush = GDIP_WMF_RECORD_TO_EMFPLUS(0x00F8), // META_CREATEBRUSH
+ WmfRecordTypeCreatePatternBrush = GDIP_WMF_RECORD_TO_EMFPLUS(META_CREATEPATTERNBRUSH),
+ WmfRecordTypeCreatePenIndirect = GDIP_WMF_RECORD_TO_EMFPLUS(META_CREATEPENINDIRECT),
+ WmfRecordTypeCreateFontIndirect = GDIP_WMF_RECORD_TO_EMFPLUS(META_CREATEFONTINDIRECT),
+ WmfRecordTypeCreateBrushIndirect = GDIP_WMF_RECORD_TO_EMFPLUS(META_CREATEBRUSHINDIRECT),
+ WmfRecordTypeCreateBitmapIndirect = GDIP_WMF_RECORD_TO_EMFPLUS(0x02FD), // META_CREATEBITMAPINDIRECT
+ WmfRecordTypeCreateBitmap = GDIP_WMF_RECORD_TO_EMFPLUS(0x06FE), // META_CREATEBITMAP
+ WmfRecordTypeCreateRegion = GDIP_WMF_RECORD_TO_EMFPLUS(META_CREATEREGION),
+
+ EmfRecordTypeHeader = EMR_HEADER,
+ EmfRecordTypePolyBezier = EMR_POLYBEZIER,
+ EmfRecordTypePolygon = EMR_POLYGON,
+ EmfRecordTypePolyline = EMR_POLYLINE,
+ EmfRecordTypePolyBezierTo = EMR_POLYBEZIERTO,
+ EmfRecordTypePolyLineTo = EMR_POLYLINETO,
+ EmfRecordTypePolyPolyline = EMR_POLYPOLYLINE,
+ EmfRecordTypePolyPolygon = EMR_POLYPOLYGON,
+ EmfRecordTypeSetWindowExtEx = EMR_SETWINDOWEXTEX,
+ EmfRecordTypeSetWindowOrgEx = EMR_SETWINDOWORGEX,
+ EmfRecordTypeSetViewportExtEx = EMR_SETVIEWPORTEXTEX,
+ EmfRecordTypeSetViewportOrgEx = EMR_SETVIEWPORTORGEX,
+ EmfRecordTypeSetBrushOrgEx = EMR_SETBRUSHORGEX,
+ EmfRecordTypeEOF = EMR_EOF,
+ EmfRecordTypeSetPixelV = EMR_SETPIXELV,
+ EmfRecordTypeSetMapperFlags = EMR_SETMAPPERFLAGS,
+ EmfRecordTypeSetMapMode = EMR_SETMAPMODE,
+ EmfRecordTypeSetBkMode = EMR_SETBKMODE,
+ EmfRecordTypeSetPolyFillMode = EMR_SETPOLYFILLMODE,
+ EmfRecordTypeSetROP2 = EMR_SETROP2,
+ EmfRecordTypeSetStretchBltMode = EMR_SETSTRETCHBLTMODE,
+ EmfRecordTypeSetTextAlign = EMR_SETTEXTALIGN,
+ EmfRecordTypeSetColorAdjustment = EMR_SETCOLORADJUSTMENT,
+ EmfRecordTypeSetTextColor = EMR_SETTEXTCOLOR,
+ EmfRecordTypeSetBkColor = EMR_SETBKCOLOR,
+ EmfRecordTypeOffsetClipRgn = EMR_OFFSETCLIPRGN,
+ EmfRecordTypeMoveToEx = EMR_MOVETOEX,
+ EmfRecordTypeSetMetaRgn = EMR_SETMETARGN,
+ EmfRecordTypeExcludeClipRect = EMR_EXCLUDECLIPRECT,
+ EmfRecordTypeIntersectClipRect = EMR_INTERSECTCLIPRECT,
+ EmfRecordTypeScaleViewportExtEx = EMR_SCALEVIEWPORTEXTEX,
+ EmfRecordTypeScaleWindowExtEx = EMR_SCALEWINDOWEXTEX,
+ EmfRecordTypeSaveDC = EMR_SAVEDC,
+ EmfRecordTypeRestoreDC = EMR_RESTOREDC,
+ EmfRecordTypeSetWorldTransform = EMR_SETWORLDTRANSFORM,
+ EmfRecordTypeModifyWorldTransform = EMR_MODIFYWORLDTRANSFORM,
+ EmfRecordTypeSelectObject = EMR_SELECTOBJECT,
+ EmfRecordTypeCreatePen = EMR_CREATEPEN,
+ EmfRecordTypeCreateBrushIndirect = EMR_CREATEBRUSHINDIRECT,
+ EmfRecordTypeDeleteObject = EMR_DELETEOBJECT,
+ EmfRecordTypeAngleArc = EMR_ANGLEARC,
+ EmfRecordTypeEllipse = EMR_ELLIPSE,
+ EmfRecordTypeRectangle = EMR_RECTANGLE,
+ EmfRecordTypeRoundRect = EMR_ROUNDRECT,
+ EmfRecordTypeArc = EMR_ARC,
+ EmfRecordTypeChord = EMR_CHORD,
+ EmfRecordTypePie = EMR_PIE,
+ EmfRecordTypeSelectPalette = EMR_SELECTPALETTE,
+ EmfRecordTypeCreatePalette = EMR_CREATEPALETTE,
+ EmfRecordTypeSetPaletteEntries = EMR_SETPALETTEENTRIES,
+ EmfRecordTypeResizePalette = EMR_RESIZEPALETTE,
+ EmfRecordTypeRealizePalette = EMR_REALIZEPALETTE,
+ EmfRecordTypeExtFloodFill = EMR_EXTFLOODFILL,
+ EmfRecordTypeLineTo = EMR_LINETO,
+ EmfRecordTypeArcTo = EMR_ARCTO,
+ EmfRecordTypePolyDraw = EMR_POLYDRAW,
+ EmfRecordTypeSetArcDirection = EMR_SETARCDIRECTION,
+ EmfRecordTypeSetMiterLimit = EMR_SETMITERLIMIT,
+ EmfRecordTypeBeginPath = EMR_BEGINPATH,
+ EmfRecordTypeEndPath = EMR_ENDPATH,
+ EmfRecordTypeCloseFigure = EMR_CLOSEFIGURE,
+ EmfRecordTypeFillPath = EMR_FILLPATH,
+ EmfRecordTypeStrokeAndFillPath = EMR_STROKEANDFILLPATH,
+ EmfRecordTypeStrokePath = EMR_STROKEPATH,
+ EmfRecordTypeFlattenPath = EMR_FLATTENPATH,
+ EmfRecordTypeWidenPath = EMR_WIDENPATH,
+ EmfRecordTypeSelectClipPath = EMR_SELECTCLIPPATH,
+ EmfRecordTypeAbortPath = EMR_ABORTPATH,
+ EmfRecordTypeReserved_069 = 69, // Not Used
+ EmfRecordTypeGdiComment = EMR_GDICOMMENT,
+ EmfRecordTypeFillRgn = EMR_FILLRGN,
+ EmfRecordTypeFrameRgn = EMR_FRAMERGN,
+ EmfRecordTypeInvertRgn = EMR_INVERTRGN,
+ EmfRecordTypePaintRgn = EMR_PAINTRGN,
+ EmfRecordTypeExtSelectClipRgn = EMR_EXTSELECTCLIPRGN,
+ EmfRecordTypeBitBlt = EMR_BITBLT,
+ EmfRecordTypeStretchBlt = EMR_STRETCHBLT,
+ EmfRecordTypeMaskBlt = EMR_MASKBLT,
+ EmfRecordTypePlgBlt = EMR_PLGBLT,
+ EmfRecordTypeSetDIBitsToDevice = EMR_SETDIBITSTODEVICE,
+ EmfRecordTypeStretchDIBits = EMR_STRETCHDIBITS,
+ EmfRecordTypeExtCreateFontIndirect = EMR_EXTCREATEFONTINDIRECTW,
+ EmfRecordTypeExtTextOutA = EMR_EXTTEXTOUTA,
+ EmfRecordTypeExtTextOutW = EMR_EXTTEXTOUTW,
+ EmfRecordTypePolyBezier16 = EMR_POLYBEZIER16,
+ EmfRecordTypePolygon16 = EMR_POLYGON16,
+ EmfRecordTypePolyline16 = EMR_POLYLINE16,
+ EmfRecordTypePolyBezierTo16 = EMR_POLYBEZIERTO16,
+ EmfRecordTypePolylineTo16 = EMR_POLYLINETO16,
+ EmfRecordTypePolyPolyline16 = EMR_POLYPOLYLINE16,
+ EmfRecordTypePolyPolygon16 = EMR_POLYPOLYGON16,
+ EmfRecordTypePolyDraw16 = EMR_POLYDRAW16,
+ EmfRecordTypeCreateMonoBrush = EMR_CREATEMONOBRUSH,
+ EmfRecordTypeCreateDIBPatternBrushPt = EMR_CREATEDIBPATTERNBRUSHPT,
+ EmfRecordTypeExtCreatePen = EMR_EXTCREATEPEN,
+ EmfRecordTypePolyTextOutA = EMR_POLYTEXTOUTA,
+ EmfRecordTypePolyTextOutW = EMR_POLYTEXTOUTW,
+ EmfRecordTypeSetICMMode = 98, // EMR_SETICMMODE,
+ EmfRecordTypeCreateColorSpace = 99, // EMR_CREATECOLORSPACE,
+ EmfRecordTypeSetColorSpace = 100, // EMR_SETCOLORSPACE,
+ EmfRecordTypeDeleteColorSpace = 101, // EMR_DELETECOLORSPACE,
+ EmfRecordTypeGLSRecord = 102, // EMR_GLSRECORD,
+ EmfRecordTypeGLSBoundedRecord = 103, // EMR_GLSBOUNDEDRECORD,
+ EmfRecordTypePixelFormat = 104, // EMR_PIXELFORMAT,
+ EmfRecordTypeDrawEscape = 105, // EMR_RESERVED_105,
+ EmfRecordTypeExtEscape = 106, // EMR_RESERVED_106,
+ EmfRecordTypeStartDoc = 107, // EMR_RESERVED_107,
+ EmfRecordTypeSmallTextOut = 108, // EMR_RESERVED_108,
+ EmfRecordTypeForceUFIMapping = 109, // EMR_RESERVED_109,
+ EmfRecordTypeNamedEscape = 110, // EMR_RESERVED_110,
+ EmfRecordTypeColorCorrectPalette = 111, // EMR_COLORCORRECTPALETTE,
+ EmfRecordTypeSetICMProfileA = 112, // EMR_SETICMPROFILEA,
+ EmfRecordTypeSetICMProfileW = 113, // EMR_SETICMPROFILEW,
+ EmfRecordTypeAlphaBlend = 114, // EMR_ALPHABLEND,
+ EmfRecordTypeSetLayout = 115, // EMR_SETLAYOUT,
+ EmfRecordTypeTransparentBlt = 116, // EMR_TRANSPARENTBLT,
+ EmfRecordTypeReserved_117 = 117, // Not Used
+ EmfRecordTypeGradientFill = 118, // EMR_GRADIENTFILL,
+ EmfRecordTypeSetLinkedUFIs = 119, // EMR_RESERVED_119,
+ EmfRecordTypeSetTextJustification = 120, // EMR_RESERVED_120,
+ EmfRecordTypeColorMatchToTargetW = 121, // EMR_COLORMATCHTOTARGETW,
+ EmfRecordTypeCreateColorSpaceW = 122, // EMR_CREATECOLORSPACEW,
+ EmfRecordTypeMax = 122,
+ EmfRecordTypeMin = 1,
+
+ // That is the END of the GDI EMF records.
+
+ // Now we start the list of EMF+ records. We leave quite
+ // a bit of room here for the addition of any new GDI
+ // records that may be added later.
+
+ EmfPlusRecordTypeInvalid = GDIP_EMFPLUS_RECORD_BASE,
+ EmfPlusRecordTypeHeader,
+ EmfPlusRecordTypeEndOfFile,
+
+ EmfPlusRecordTypeComment,
+
+ EmfPlusRecordTypeGetDC, // the application grabbed the metafile dc
+
+ EmfPlusRecordTypeMultiFormatStart,
+ EmfPlusRecordTypeMultiFormatSection,
+ EmfPlusRecordTypeMultiFormatEnd,
+
+ // For all persistent objects
+ EmfPlusRecordTypeObject, // brush,pen,path,region,image,font,string-format
+
+ // Drawing Records
+ EmfPlusRecordTypeClear,
+ EmfPlusRecordTypeFillRects,
+ EmfPlusRecordTypeDrawRects,
+ EmfPlusRecordTypeFillPolygon,
+ EmfPlusRecordTypeDrawLines,
+ EmfPlusRecordTypeFillEllipse,
+ EmfPlusRecordTypeDrawEllipse,
+ EmfPlusRecordTypeFillPie,
+ EmfPlusRecordTypeDrawPie,
+ EmfPlusRecordTypeDrawArc,
+ EmfPlusRecordTypeFillRegion,
+ EmfPlusRecordTypeFillPath,
+ EmfPlusRecordTypeDrawPath,
+ EmfPlusRecordTypeFillClosedCurve,
+ EmfPlusRecordTypeDrawClosedCurve,
+ EmfPlusRecordTypeDrawCurve,
+ EmfPlusRecordTypeDrawBeziers,
+ EmfPlusRecordTypeDrawImage,
+ EmfPlusRecordTypeDrawImagePoints,
+ EmfPlusRecordTypeDrawString,
+
+ // Graphics State Records
+ EmfPlusRecordTypeSetRenderingOrigin,
+ EmfPlusRecordTypeSetAntiAliasMode,
+ EmfPlusRecordTypeSetTextRenderingHint,
+#ifdef DCR_USE_NEW_188922
+ EmfPlusRecordTypeSetTextContrast,
+#else
+ EmfPlusRecordTypeSetGammaValue,
+#endif // DCR_USE_NEW_188922
+ EmfPlusRecordTypeSetInterpolationMode,
+ EmfPlusRecordTypeSetPixelOffsetMode,
+ EmfPlusRecordTypeSetCompositingMode,
+ EmfPlusRecordTypeSetCompositingQuality,
+ EmfPlusRecordTypeSave,
+ EmfPlusRecordTypeRestore,
+ EmfPlusRecordTypeBeginContainer,
+ EmfPlusRecordTypeBeginContainerNoParams,
+ EmfPlusRecordTypeEndContainer,
+ EmfPlusRecordTypeSetWorldTransform,
+ EmfPlusRecordTypeResetWorldTransform,
+ EmfPlusRecordTypeMultiplyWorldTransform,
+ EmfPlusRecordTypeTranslateWorldTransform,
+ EmfPlusRecordTypeScaleWorldTransform,
+ EmfPlusRecordTypeRotateWorldTransform,
+ EmfPlusRecordTypeSetPageTransform,
+ EmfPlusRecordTypeResetClip,
+ EmfPlusRecordTypeSetClipRect,
+ EmfPlusRecordTypeSetClipPath,
+ EmfPlusRecordTypeSetClipRegion,
+ EmfPlusRecordTypeOffsetClip,
+
+ // New record types must be added here (at the end) -- do not add above,
+ // since that will invalidate previous metafiles!
+ EmfPlusRecordTypeDrawDriverString,
+
+ // Have this here so you don't need to keep changing the value of
+ // EmfPlusRecordTypeMax every time you add a new record.
+
+ EmfPlusRecordTotal,
+
+ EmfPlusRecordTypeMax = EmfPlusRecordTotal-1,
+ EmfPlusRecordTypeMin = EmfPlusRecordTypeHeader,
+};
+
+//---------------------------------------------------------------------------
+// StringFormatFlags
+//---------------------------------------------------------------------------
+
+//---------------------------------------------------------------------------
+// String format flags
+//
+// DirectionRightToLeft - For horizontal text, the reading order is
+// right to left. This value is called
+// the base embedding level by the Unicode
+// bidirectional engine.
+// For vertical text, columns are read from
+// right to left.
+// By default, horizontal or vertical text is
+// read from left to right.
+//
+// DirectionVertical - Individual lines of text are vertical. In
+// each line, characters progress from top to
+// bottom.
+// By default, lines of text are horizontal,
+// each new line below the previous line.
+//
+// NoFitBlackBox - Allows parts of glyphs to overhang the
+// bounding rectangle.
+// By default glyphs are first aligned
+// inside the margines, then any glyphs which
+// still overhang the bounding box are
+// repositioned to avoid any overhang.
+// For example when an italic
+// lower case letter f in a font such as
+// Garamond is aligned at the far left of a
+// rectangle, the lower part of the f will
+// reach slightly further left than the left
+// edge of the rectangle. Setting this flag
+// will ensure the character aligns visually
+// with the lines above and below, but may
+// cause some pixels outside the formatting
+// rectangle to be clipped or painted.
+//
+#ifndef DCR_USE_NEW_137252
+// NumberContextArabic - Causes any initial numeric in the string to
+// be analysed for bidirection layout as if
+// it was preceeded by Arabic text.
+//
+// DisableKashidaJustification - Arabic text will not be justified by the
+// insertion of kashidas (i.e. extending the
+// joining line between characters). Instead
+// Arabic script will be justified by the
+// widening of the whitespace between words.
+//
+#endif
+// DisplayFormatControl - Causes control characters such as the
+// left-to-right mark to be shown in the
+// output with a representative glyph.
+//
+#ifndef DCR_USE_NEW_137252
+// DisableKerning - Disables Truetype and OpenType kerning.
+//
+// DisableLigatures - Disables Truetype and OpenType ligatures.
+//
+// LayoutLegacyBidi - Causes the bidirection algorithm to use
+// slightly different classifications for
+// '+', '-' and '/' that make their layout
+// much closer to that expected by files
+// generated in Windows or by Windows
+// applications.
+//
+// NoChanges - A text imager created with this flag set
+// does not support those APIs that change
+// it's contents or formatting, but for most
+// simple text will be significantly faster in
+// performing measurement and drawing
+// functions.
+//
+#endif
+// NoFontFallback - Disables fallback to alternate fonts for
+// characters not supported in the requested
+// font. Any missing characters will be
+// be displayed with the fonts missing glyph,
+// usually an open square.
+//
+// NoWrap - Disables wrapping of text between lines
+// when formatting within a rectangle.
+// NoWrap is implied when a point is passed
+// instead of a rectangle, or when the
+// specified rectangle has a zero line length.
+//
+// NoClip - By default text is clipped to the
+// formatting rectangle. Setting NoClip
+// allows overhanging pixels to affect the
+// device outside the formatting rectangle.
+// Pixels at the end of the line may be
+// affected if the glyphs overhang their
+// cells, and either the NoFitBlackBox flag
+// has been set, or the glyph extends to far
+// to be fitted.
+// Pixels above/before the first line or
+// below/after the last line may be affected
+// if the glyphs extend beyond their cell
+// ascent / descent. This can occur rarely
+// with unusual diacritic mark combinations.
+
+//---------------------------------------------------------------------------
+
+enum StringFormatFlags
+{
+ StringFormatFlagsDirectionRightToLeft = 0x00000001,
+ StringFormatFlagsDirectionVertical = 0x00000002,
+ StringFormatFlagsNoFitBlackBox = 0x00000004,
+#ifndef DCR_USE_NEW_137252
+ StringFormatFlagsNumberContextArabic = 0x00000008,
+ StringFormatFlagsDisableKashidaJustification = 0x00000010,
+#endif
+ StringFormatFlagsDisplayFormatControl = 0x00000020,
+#ifndef DCR_USE_NEW_137252
+ StringFormatFlagsDisableKerning = 0x00000040,
+ StringFormatFlagsDisableLigatures = 0x00000080,
+ StringFormatFlagsLayoutLegacyBidi = 0x00000100,
+ StringFormatFlagsNoChanges = 0x00000200,
+#endif
+ StringFormatFlagsNoFontFallback = 0x00000400,
+ StringFormatFlagsMeasureTrailingSpaces = 0x00000800,
+ StringFormatFlagsNoWrap = 0x00001000,
+ StringFormatFlagsLineLimit = 0x00002000,
+
+ StringFormatFlagsNoClip = 0x00004000
+};
+
+//---------------------------------------------------------------------------
+// StringTrimming
+//---------------------------------------------------------------------------
+
+enum StringTrimming {
+ StringTrimmingNone = 0,
+ StringTrimmingCharacter = 1,
+ StringTrimmingWord = 2,
+ StringTrimmingEllipsisCharacter = 3,
+ StringTrimmingEllipsisWord = 4,
+ StringTrimmingEllipsisPath = 5
+};
+
+#ifndef DCR_USE_NEW_137252
+//---------------------------------------------------------------------------
+// String units
+//
+// String units are like length units in CSS, they may be absolute, or
+// they may be relative to a font size.
+//
+//---------------------------------------------------------------------------
+
+enum StringUnit {
+ StringUnitWorld = UnitWorld,
+ StringUnitDisplay = UnitDisplay,
+ StringUnitPixel = UnitPixel,
+ StringUnitPoint = UnitPoint,
+ StringUnitInch = UnitInch,
+ StringUnitDocument = UnitDocument,
+ StringUnitMillimeter = UnitMillimeter,
+ StringUnitEm = 32
+};
+#endif
+
+#ifndef DCR_USE_NEW_152154
+//---------------------------------------------------------------------------
+// Line spacing flags
+//---------------------------------------------------------------------------
+
+enum LineSpacing {
+ LineSpacingWorld = UnitWorld,
+ LineSpacingDisplay = UnitDisplay,
+ LineSpacingPixel = UnitPixel,
+ LineSpacingPoint = UnitPoint,
+ LineSpacingInch = UnitInch,
+ LineSpacingDocument = UnitDocument,
+ LineSpacingMillimeter = UnitMillimeter,
+
+ LineSpacingRecommended = 32,
+ LineSpacingAtLeast = 33,
+ LineSpacingAtLeastMultiple = 34,
+ LineSpacingCell = 35,
+ LineSpacingCellAtLeast = 36,
+ LineSpacingCellAtLeastMultiple = 37
+};
+
+/// The following methods of linespacing are relative to the font size
+//
+// =========== Method =========== =============== Relative to ===============
+//
+// LineSpacingRecommended recommended line spacing specified by font
+// LineSpacingAtLeast max(recommended, tallest glyph cell)
+// LineSpacingAtLeastMultiple smallest multiple of recommended big enough
+// for all glyph cells on the line
+// LineSpacingCell cell height
+// LineSpacingCellAtLeast max(font cell height, tallest glyph cell)
+// LineSpacingCellAtLeastMultiple smallest multiple of cell height big enough
+// for all glyph cells on the line
+#endif
+
+
+//---------------------------------------------------------------------------
+// National language digit substitution
+//---------------------------------------------------------------------------
+
+enum StringDigitSubstitute
+{
+ StringDigitSubstituteUser = 0, // As NLS setting
+ StringDigitSubstituteNone = 1,
+ StringDigitSubstituteNational = 2,
+ StringDigitSubstituteTraditional = 3
+};
+
+//---------------------------------------------------------------------------
+// Hotkey prefix interpretation
+//---------------------------------------------------------------------------
+
+enum HotkeyPrefix
+{
+ HotkeyPrefixNone = 0,
+ HotkeyPrefixShow = 1,
+ HotkeyPrefixHide = 2
+};
+
+//---------------------------------------------------------------------------
+// Text alignment flags
+//---------------------------------------------------------------------------
+
+enum StringAlignment
+{
+ // Left edge for left-to-right text,
+ // right for right-to-left text,
+ // and top for vertical
+ StringAlignmentNear = 0,
+ StringAlignmentCenter = 1,
+ StringAlignmentFar = 2
+};
+
+//---------------------------------------------------------------------------
+// DriverStringOptions
+//---------------------------------------------------------------------------
+
+enum DriverStringOptions
+{
+ DriverStringOptionsCmapLookup = 1,
+ DriverStringOptionsVertical = 2,
+ DriverStringOptionsRealizedAdvance = 4,
+#ifndef DCR_USE_NEW_137252
+ DriverStringOptionsCompensateResolution = 8
+#endif
+};
+
+//---------------------------------------------------------------------------
+// Flush Intention flags
+//---------------------------------------------------------------------------
+
+enum FlushIntention
+{
+ FlushIntentionFlush = 0, // Flush all batched rendering operations
+ FlushIntentionSync = 1 // Flush all batched rendering operations
+ // and wait for them to complete
+};
+
+#ifndef DCR_USE_NEW_175866
+
+//---------------------------------------------------------------------------
+// Window Change Notification types
+//---------------------------------------------------------------------------
+
+enum WindowNotifyEnum
+{
+ WindowNotifyEnumEnable = 0,
+ WindowNotifyEnumDisable,
+ WindowNotifyEnumPalette,
+ WindowNotifyEnumDisplay,
+ WindowNotifyEnumSysColor
+};
+
+#endif
+
+//---------------------------------------------------------------------------
+// Image encoder parameter related types
+//---------------------------------------------------------------------------
+
+#ifdef DCR_USE_NEW_145804
+enum EncoderParameterValueType
+{
+ EncoderParameterValueTypeByte = 1, // 8-bit unsigned int
+ EncoderParameterValueTypeASCII = 2, // 8-bit byte containing one 7-bit ASCII
+ // code. NULL terminated.
+ EncoderParameterValueTypeShort = 3, // 16-bit unsigned int
+ EncoderParameterValueTypeLong = 4, // 32-bit unsigned int
+ EncoderParameterValueTypeRational = 5, // Two Longs. The first Long is the
+ // numerator, the second Long expresses the
+ // denomintor.
+ EncoderParameterValueTypeLongRange = 6, // Two longs which specify a range of
+ // integer values. The first Long specifies
+ // the lower end and the second one
+ // specifies the higher end. All values
+ // are inclusive at both ends
+ EncoderParameterValueTypeUndefined = 7, // 8-bit byte that can take any value
+ // depending on field definition
+ EncoderParameterValueTypeRationalRange = 8 // Two Rationals. The first Rational
+ // specifies the lower end and the second
+ // specifies the higher end. All values
+ // are inclusive at both ends
+};
+#else
+enum ValueType
+{
+ ValueTypeByte = 1, // 8-bit unsigned int
+ ValueTypeASCII = 2, // 8-bit byte containing one 7-bit ASCII
+ // code. NULL terminated.
+ ValueTypeShort = 3, // 16-bit unsigned int
+ ValueTypeLong = 4, // 32-bit unsigned int
+ ValueTypeRational = 5, // Two Longs. The first Long is the
+ // numerator, the second Long expresses the
+ // denomintor.
+ ValueTypeLongRange = 6, // Two longs which specify a range of
+ // integer values. The first Long specifies
+ // the lower end and the second one
+ // specifies the higher end. All values
+ // are inclusive at both ends
+ ValueTypeUndefined = 7, // 8-bit byte that can take any value
+ // depending on field definition
+ ValueTypeRationalRange = 8 // Two Rationals. The first Rational
+ // specifies the lower end and the second
+ // specifies the higher end. All values
+ // are inclusive at both ends
+};
+#endif
+
+//---------------------------------------------------------------------------
+// Image encoder value types
+//---------------------------------------------------------------------------
+
+enum EncoderValue
+{
+ EncoderValueColorTypeCMYK,
+ EncoderValueColorTypeYCCK,
+ EncoderValueCompressionLZW,
+ EncoderValueCompressionCCITT3,
+ EncoderValueCompressionCCITT4,
+ EncoderValueCompressionRle,
+ EncoderValueCompressionNone,
+ EncoderValueScanMethodInterlaced,
+ EncoderValueScanMethodNonInterlaced,
+ EncoderValueVersionGif87,
+ EncoderValueVersionGif89,
+ EncoderValueRenderProgressive,
+ EncoderValueRenderNonProgressive,
+ EncoderValueTransformRotate90,
+ EncoderValueTransformRotate180,
+ EncoderValueTransformRotate270,
+ EncoderValueTransformFlipHorizontal,
+ EncoderValueTransformFlipVertical,
+ #ifdef DCR_USE_NEW_140861
+ EncoderValueMultiFrame,
+ #else
+ EncodeValueMultiFrame,
+ #endif
+ EncoderValueLastFrame,
+ EncoderValueFlush,
+ #ifdef DCR_USE_NEW_140861
+ EncoderValueFrameDimensionTime,
+ EncoderValueFrameDimensionResolution,
+ EncoderValueFrameDimensionPage
+ #else
+ EncodeValueFrameDimensionTime,
+ EncodeValueFrameDimensionResolution,
+ EncodeValueFrameDimensionPage
+ #endif
+};
+
+//---------------------------------------------------------------------------
+// Graphics layout values (support for Middle East localization)
+//---------------------------------------------------------------------------
+
+enum GraphicsLayout
+{
+ GraphicsLayoutNormal,
+ GraphicsLayoutMirrored,
+ GraphicsLayoutMirroredIgnoreImages,
+ GraphicsLayoutMirroredForceImages
+};
+
+//---------------------------------------------------------------------------
+// Image layout values (support for Middle East localization)
+//---------------------------------------------------------------------------
+
+enum ImageLayout
+{
+ ImageLayoutNormal,
+ ImageLayoutIgnoreMirrored
+};
+
+enum EmfToWmfBitsFlags
+{
+ EmfToWmfBitsFlagsDefault = 0x00000000,
+ EmfToWmfBitsFlagsEmbedEmf = 0x00000001,
+ EmfToWmfBitsFlagsIncludeAPM = 0x00000002,
+ EmfToWmfBitsFlagsNoXORClip = 0x00000004
+};
+
+#endif // !_GDIPLUSENUMS_H
diff --git a/core/src/fxge/Microsoft SDK/include/GdiPlusFlat.h b/core/src/fxge/Microsoft SDK/include/GdiPlusFlat.h
index 8b5369e793..1dd8d466e9 100644
--- a/core/src/fxge/Microsoft SDK/include/GdiPlusFlat.h
+++ b/core/src/fxge/Microsoft SDK/include/GdiPlusFlat.h
@@ -1,2740 +1,2740 @@
-/**************************************************************************\
-*
-* Copyright (c) 1998-2000, Microsoft Corp. All Rights Reserved.
-*
-* Module Name:
-*
-* GdiplusFlat.h
-*
-* Abstract:
-*
-* Flat GDI+ API wrappers - header file
-*
-\**************************************************************************/
-
-// TODO: this file style needs to be made internally consistent with the way
-// it handles breaking the long argument lists across multiple lines
-
-#ifndef _FLATAPI_H
-#define _FLATAPI_H
-
-#define WINGDIPAPI __stdcall
-
-// currently, only C++ wrapper API's force const.
-
-#define GDIPCONST const
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef DCR_USE_NEW_175866
-
-VOID
-WINGDIPAPI
-GdipDisplayPaletteWindowNotify(WindowNotifyEnum notify);
-
-#endif
-
-//----------------------------------------------------------------------------
-// GraphicsPath methods
-//----------------------------------------------------------------------------
-
-GpStatus WINGDIPAPI
-GdipCreatePath(GpFillMode brushMode, GpPath **path);
-
-GpStatus WINGDIPAPI
-GdipCreatePath2(GDIPCONST GpPointF*, GDIPCONST BYTE*, INT, GpFillMode,
- GpPath **path);
-
-GpStatus WINGDIPAPI
-GdipCreatePath2I(GDIPCONST GpPoint*, GDIPCONST BYTE*, INT, GpFillMode,
- GpPath **path);
-
-GpStatus WINGDIPAPI
-GdipClonePath(GpPath* path, GpPath **clonePath);
-
-GpStatus WINGDIPAPI
-GdipDeletePath(GpPath* path);
-
-GpStatus WINGDIPAPI
-GdipResetPath(GpPath* path);
-
-GpStatus WINGDIPAPI
-GdipGetPointCount(GpPath* path, INT* count);
-
-GpStatus WINGDIPAPI
-GdipGetPathTypes(GpPath* path, BYTE* types, INT count);
-
-GpStatus WINGDIPAPI
-GdipGetPathPoints(GpPath*, GpPointF* points, INT count);
-
-GpStatus WINGDIPAPI
-GdipGetPathPointsI(GpPath*, GpPoint* points, INT count);
-
-GpStatus WINGDIPAPI
-GdipGetPathFillMode(GpPath *path, GpFillMode *fillmode);
-
-GpStatus WINGDIPAPI
-GdipSetPathFillMode(GpPath *path, GpFillMode fillmode);
-
-GpStatus WINGDIPAPI
-GdipGetPathData(GpPath *path, GpPathData* pathData);
-
-GpStatus WINGDIPAPI
-GdipStartPathFigure(GpPath *path);
-
-GpStatus WINGDIPAPI
-GdipClosePathFigure(GpPath *path);
-
-GpStatus WINGDIPAPI
-GdipClosePathFigures(GpPath *path);
-
-GpStatus WINGDIPAPI
-GdipSetPathMarker(GpPath* path);
-
-GpStatus WINGDIPAPI
-GdipClearPathMarkers(GpPath* path);
-
-GpStatus WINGDIPAPI
-GdipReversePath(GpPath* path);
-
-GpStatus WINGDIPAPI
-GdipGetPathLastPoint(GpPath* path, GpPointF* lastPoint);
-
-GpStatus WINGDIPAPI
-GdipAddPathLine(GpPath *path, REAL x1, REAL y1, REAL x2, REAL y2);
-
-GpStatus WINGDIPAPI
-GdipAddPathLine2(GpPath *path, GDIPCONST GpPointF *points, INT count);
-
-GpStatus WINGDIPAPI
-GdipAddPathArc(GpPath *path, REAL x, REAL y, REAL width, REAL height,
- REAL startAngle, REAL sweepAngle);
-
-GpStatus WINGDIPAPI
-GdipAddPathBezier(GpPath *path, REAL x1, REAL y1, REAL x2, REAL y2,
- REAL x3, REAL y3, REAL x4, REAL y4);
-
-GpStatus WINGDIPAPI
-GdipAddPathBeziers(GpPath *path, GDIPCONST GpPointF *points, INT count);
-
-GpStatus WINGDIPAPI
-GdipAddPathCurve(GpPath *path, GDIPCONST GpPointF *points, INT count);
-
-GpStatus WINGDIPAPI
-GdipAddPathCurve2(GpPath *path, GDIPCONST GpPointF *points, INT count,
- REAL tension);
-
-GpStatus WINGDIPAPI
-GdipAddPathCurve3(GpPath *path, GDIPCONST GpPointF *points, INT count,
- INT offset, INT numberOfSegments, REAL tension);
-
-GpStatus WINGDIPAPI
-GdipAddPathClosedCurve(GpPath *path, GDIPCONST GpPointF *points, INT count);
-
-GpStatus WINGDIPAPI
-GdipAddPathClosedCurve2(GpPath *path, GDIPCONST GpPointF *points, INT count,
- REAL tension);
-
-GpStatus WINGDIPAPI
-GdipAddPathRectangle(GpPath *path, REAL x, REAL y, REAL width, REAL height);
-
-GpStatus WINGDIPAPI
-GdipAddPathRectangles(GpPath *path, GDIPCONST GpRectF *rects, INT count);
-
-GpStatus WINGDIPAPI
-GdipAddPathEllipse(GpPath *path, REAL x, REAL y, REAL width,
- REAL height);
-
-GpStatus WINGDIPAPI
-GdipAddPathPie(GpPath *path, REAL x, REAL y, REAL width, REAL height,
- REAL startAngle, REAL sweepAngle);
-
-GpStatus WINGDIPAPI
-GdipAddPathPolygon(GpPath *path, GDIPCONST GpPointF *points, INT count);
-
-GpStatus WINGDIPAPI
-GdipAddPathPath(GpPath *path, GDIPCONST GpPath* addingPath, BOOL connect);
-
-GpStatus WINGDIPAPI
-GdipAddPathString(GpPath *path, GDIPCONST WCHAR *string,
- INT length, GDIPCONST GpFontFamily *family, INT style,
- REAL emSize, GDIPCONST RectF *layoutRect,
- GDIPCONST GpStringFormat *format);
-
-GpStatus WINGDIPAPI
-GdipAddPathStringI(GpPath *path, GDIPCONST WCHAR *string,
- INT length, GDIPCONST GpFontFamily *family, INT style,
- REAL emSize, GDIPCONST Rect *layoutRect,
- GDIPCONST GpStringFormat *format);
-
-GpStatus WINGDIPAPI
-GdipAddPathLineI(GpPath *path, INT x1, INT y1, INT x2, INT y2);
-
-GpStatus WINGDIPAPI
-GdipAddPathLine2I(GpPath *path, GDIPCONST GpPoint *points, INT count);
-
-GpStatus WINGDIPAPI
-GdipAddPathArcI(GpPath *path, INT x, INT y, INT width, INT height,
- REAL startAngle, REAL sweepAngle);
-
-GpStatus WINGDIPAPI
-GdipAddPathBezierI(GpPath *path, INT x1, INT y1, INT x2, INT y2,
- INT x3, INT y3, INT x4, INT y4);
-
-GpStatus WINGDIPAPI
-GdipAddPathBeziersI(GpPath *path, GDIPCONST GpPoint *points, INT count);
-
-GpStatus WINGDIPAPI
-GdipAddPathCurveI(GpPath *path, GDIPCONST GpPoint *points, INT count);
-
-GpStatus WINGDIPAPI
-GdipAddPathCurve2I(GpPath *path, GDIPCONST GpPoint *points, INT count,
- REAL tension);
-
-GpStatus WINGDIPAPI
-GdipAddPathCurve3I(GpPath *path, GDIPCONST GpPoint *points, INT count,
- INT offset, INT numberOfSegments, REAL tension);
-
-GpStatus WINGDIPAPI
-GdipAddPathClosedCurveI(GpPath *path, GDIPCONST GpPoint *points, INT count);
-
-GpStatus WINGDIPAPI
-GdipAddPathClosedCurve2I(GpPath *path, GDIPCONST GpPoint *points, INT count,
- REAL tension);
-
-GpStatus WINGDIPAPI
-GdipAddPathRectangleI(GpPath *path, INT x, INT y, INT width, INT height);
-
-GpStatus WINGDIPAPI
-GdipAddPathRectanglesI(GpPath *path, GDIPCONST GpRect *rects, INT count);
-
-GpStatus WINGDIPAPI
-GdipAddPathEllipseI(GpPath *path, INT x, INT y, INT width, INT height);
-
-GpStatus WINGDIPAPI
-GdipAddPathPieI(GpPath *path, INT x, INT y, INT width, INT height,
- REAL startAngle, REAL sweepAngle);
-
-GpStatus WINGDIPAPI
-GdipAddPathPolygonI(GpPath *path, GDIPCONST GpPoint *points, INT count);
-
-GpStatus WINGDIPAPI
-GdipFlattenPath(GpPath *path, GpMatrix* matrix, REAL flatness);
-
-GpStatus WINGDIPAPI
-GdipWindingModeOutline(
- GpPath *path,
- GpMatrix *matrix,
- REAL flatness
-);
-
-
-#ifdef DCR_USE_NEW_202903
-
-GpStatus WINGDIPAPI
-GdipWidenPath(
- GpPath *nativePath,
- GpPen *pen,
- GpMatrix *matrix,
- REAL flatness
-);
-
-#else
-
-GpStatus WINGDIPAPI
-GdipWidenPathWithMinimumResolutions(GpPath *path, GpPen *pen, REAL minXres,
- REAL minYres, GpMatrix *matrix, BOOL removeSelftIntersects);
-
-#endif
-
-GpStatus WINGDIPAPI
-GdipWarpPath(GpPath *path, GpMatrix* matrix,
- GDIPCONST GpPointF *points, INT count,
- REAL srcx, REAL srcy, REAL srcwidth, REAL srcheight,
- WarpMode warpMode, REAL flatness);
-
-GpStatus WINGDIPAPI
-GdipTransformPath(GpPath* path, GpMatrix* matrix);
-
-GpStatus WINGDIPAPI
-GdipGetPathWorldBounds(GpPath* path, GpRectF* bounds, GDIPCONST GpMatrix *matrix,
- GDIPCONST GpPen *pen);
-
-GpStatus WINGDIPAPI
-GdipGetPathWorldBoundsI(GpPath* path, GpRect* bounds, GDIPCONST GpMatrix *matrix,
- GDIPCONST GpPen *pen);
-
-GpStatus WINGDIPAPI
-GdipIsVisiblePathPoint(GpPath* path, REAL x, REAL y,
- GpGraphics *graphics, BOOL *result);
-
-GpStatus WINGDIPAPI
-GdipIsVisiblePathPointI(GpPath* path, INT x, INT y,
- GpGraphics *graphics, BOOL *result);
-
-GpStatus WINGDIPAPI
-GdipIsOutlineVisiblePathPoint(GpPath* path, REAL x, REAL y, GpPen *pen,
- GpGraphics *graphics, BOOL *result);
-
-GpStatus WINGDIPAPI
-GdipIsOutlineVisiblePathPointI(GpPath* path, INT x, INT y, GpPen *pen,
- GpGraphics *graphics, BOOL *result);
-
-
-//----------------------------------------------------------------------------
-// Path Enumeration methods
-//----------------------------------------------------------------------------
-
-GpStatus WINGDIPAPI
-GdipCreatePathIter(GpPathIterator **iterator, GpPath* path);
-
-GpStatus WINGDIPAPI
-GdipDeletePathIter(GpPathIterator *iterator);
-
-GpStatus WINGDIPAPI
-GdipPathIterNextSubpath(GpPathIterator* iterator, INT *resultCount,
- INT* startIndex, INT* endIndex, BOOL* isClosed);
-
-GpStatus WINGDIPAPI
-GdipPathIterNextSubpathPath(GpPathIterator* iterator, INT* resultCount,
- GpPath* path, BOOL* isClosed);
-
-GpStatus WINGDIPAPI
-GdipPathIterNextPathType(GpPathIterator* iterator, INT* resultCount,
- BYTE* pathType, INT* startIndex, INT* endIndex);
-
-GpStatus WINGDIPAPI
-GdipPathIterNextMarker(GpPathIterator* iterator, INT *resultCount,
- INT* startIndex, INT* endIndex);
-
-GpStatus WINGDIPAPI
-GdipPathIterNextMarkerPath(GpPathIterator* iterator, INT* resultCount,
- GpPath* path);
-
-GpStatus WINGDIPAPI
-GdipPathIterGetCount(GpPathIterator* iterator, INT* count);
-
-GpStatus WINGDIPAPI
-GdipPathIterGetSubpathCount(GpPathIterator* iterator, INT* count);
-
-GpStatus WINGDIPAPI
-GdipPathIterIsValid(GpPathIterator* iterator, BOOL* valid);
-
-GpStatus WINGDIPAPI
-GdipPathIterHasCurve(GpPathIterator* iterator, BOOL* hasCurve);
-
-GpStatus WINGDIPAPI
-GdipPathIterRewind(GpPathIterator* iterator);
-
-GpStatus WINGDIPAPI
-GdipPathIterEnumerate(GpPathIterator* iterator, INT* resultCount,
- GpPointF *points, BYTE *types, INT count);
-
-GpStatus WINGDIPAPI
-GdipPathIterCopyData(GpPathIterator* iterator, INT* resultCount,
- GpPointF* points, BYTE* types, INT startIndex, INT endIndex);
-
-//----------------------------------------------------------------------------
-// Matrix methods
-//----------------------------------------------------------------------------
-
-GpStatus WINGDIPAPI
-GdipCreateMatrix(GpMatrix **matrix);
-
-GpStatus WINGDIPAPI
-GdipCreateMatrix2(REAL m11, REAL m12, REAL m21, REAL m22, REAL dx,
- REAL dy, GpMatrix **matrix);
-
-GpStatus WINGDIPAPI
-GdipCreateMatrix3(GDIPCONST GpRectF *rect, GDIPCONST GpPointF *dstplg,
- GpMatrix **matrix);
-
-GpStatus WINGDIPAPI
-GdipCreateMatrix3I(GDIPCONST GpRect *rect, GDIPCONST GpPoint *dstplg,
- GpMatrix **matrix);
-
-GpStatus WINGDIPAPI
-GdipCloneMatrix(GpMatrix *matrix, GpMatrix **cloneMatrix);
-
-GpStatus WINGDIPAPI
-GdipDeleteMatrix(GpMatrix *matrix);
-
-GpStatus WINGDIPAPI
-GdipSetMatrixElements(GpMatrix *matrix, REAL m11, REAL m12, REAL m21, REAL m22,
- REAL dx, REAL dy);
-
-GpStatus WINGDIPAPI
-GdipMultiplyMatrix(GpMatrix *matrix, GpMatrix* matrix2,
- GpMatrixOrder order);
-
-GpStatus WINGDIPAPI
-GdipTranslateMatrix(GpMatrix *matrix, REAL offsetX, REAL offsetY,
- GpMatrixOrder order);
-
-GpStatus WINGDIPAPI
-GdipScaleMatrix(GpMatrix *matrix, REAL scaleX, REAL scaleY,
- GpMatrixOrder order);
-
-GpStatus WINGDIPAPI
-GdipRotateMatrix(GpMatrix *matrix, REAL angle, GpMatrixOrder order);
-
-GpStatus WINGDIPAPI
-GdipShearMatrix(GpMatrix *matrix, REAL shearX, REAL shearY,
- GpMatrixOrder order);
-
-GpStatus WINGDIPAPI
-GdipInvertMatrix(GpMatrix *matrix);
-
-GpStatus WINGDIPAPI
-GdipTransformMatrixPoints(GpMatrix *matrix, GpPointF *pts, INT count);
-
-GpStatus WINGDIPAPI
-GdipTransformMatrixPointsI(GpMatrix *matrix, GpPoint *pts, INT count);
-
-GpStatus WINGDIPAPI
-GdipVectorTransformMatrixPoints(GpMatrix *matrix, GpPointF *pts,
- INT count);
-
-GpStatus WINGDIPAPI
-GdipVectorTransformMatrixPointsI(GpMatrix *matrix, GpPoint *pts,
- INT count);
-
-GpStatus WINGDIPAPI
-GdipGetMatrixElements(GDIPCONST GpMatrix *matrix, REAL *matrixOut);
-
-GpStatus WINGDIPAPI
-GdipIsMatrixInvertible(GDIPCONST GpMatrix *matrix, BOOL *result);
-
-GpStatus WINGDIPAPI
-GdipIsMatrixIdentity(GDIPCONST GpMatrix *matrix, BOOL *result);
-
-GpStatus WINGDIPAPI
-GdipIsMatrixEqual(GDIPCONST GpMatrix *matrix, GDIPCONST GpMatrix *matrix2, BOOL *result);
-
-//----------------------------------------------------------------------------
-// Region methods
-//----------------------------------------------------------------------------
-
-GpStatus WINGDIPAPI
-GdipCreateRegion(GpRegion **region);
-
-GpStatus WINGDIPAPI
-GdipCreateRegionRect(GDIPCONST GpRectF *rect, GpRegion **region);
-
-GpStatus WINGDIPAPI
-GdipCreateRegionRectI(GDIPCONST GpRect *rect, GpRegion **region);
-
-GpStatus WINGDIPAPI
-GdipCreateRegionPath(GpPath *path, GpRegion **region);
-
-GpStatus WINGDIPAPI
-GdipCreateRegionRgnData(GDIPCONST BYTE *regionData, INT size, GpRegion **region);
-
-GpStatus WINGDIPAPI
-GdipCreateRegionHrgn(HRGN hRgn, GpRegion **region);
-
-GpStatus WINGDIPAPI
-GdipCloneRegion(GpRegion *region, GpRegion **cloneRegion);
-
-GpStatus WINGDIPAPI
-GdipDeleteRegion(GpRegion *region);
-
-GpStatus WINGDIPAPI
-GdipSetInfinite(GpRegion *region);
-
-GpStatus WINGDIPAPI
-GdipSetEmpty(GpRegion *region);
-
-GpStatus WINGDIPAPI
-GdipCombineRegionRect(GpRegion *region, GDIPCONST GpRectF *rect,
- CombineMode combineMode);
-
-GpStatus WINGDIPAPI
-GdipCombineRegionRectI(GpRegion *region, GDIPCONST GpRect *rect,
- CombineMode combineMode);
-
-GpStatus WINGDIPAPI
-GdipCombineRegionPath(GpRegion *region, GpPath *path, CombineMode combineMode);
-
-GpStatus WINGDIPAPI
-GdipCombineRegionRegion(GpRegion *region, GpRegion *region2,
- CombineMode combineMode);
-
-GpStatus WINGDIPAPI
-GdipTranslateRegion(GpRegion *region, REAL dx, REAL dy);
-
-GpStatus WINGDIPAPI
-GdipTranslateRegionI(GpRegion *region, INT dx, INT dy);
-
-GpStatus WINGDIPAPI
-GdipTransformRegion(GpRegion *region, GpMatrix *matrix);
-
-GpStatus WINGDIPAPI
-GdipGetRegionBounds(GpRegion *region, GpGraphics *graphics,
- GpRectF *rect);
-
-GpStatus WINGDIPAPI
-GdipGetRegionBoundsI(GpRegion *region, GpGraphics *graphics,
- GpRect *rect);
-
-GpStatus WINGDIPAPI
-GdipGetRegionHRgn(GpRegion *region, GpGraphics *graphics, HRGN *hRgn);
-
-GpStatus WINGDIPAPI
-GdipIsEmptyRegion(GpRegion *region, GpGraphics *graphics,
- BOOL *result);
-
-GpStatus WINGDIPAPI
-GdipIsInfiniteRegion(GpRegion *region, GpGraphics *graphics,
- BOOL *result);
-
-GpStatus WINGDIPAPI
-GdipIsEqualRegion(GpRegion *region, GpRegion *region2,
- GpGraphics *graphics, BOOL *result);
-
-GpStatus WINGDIPAPI
-GdipGetRegionDataSize(GpRegion *region, UINT * bufferSize);
-
-GpStatus WINGDIPAPI
-GdipGetRegionData(GpRegion *region, BYTE * buffer, UINT bufferSize, UINT * sizeFilled);
-
-GpStatus WINGDIPAPI
-GdipIsVisibleRegionPoint(GpRegion *region, REAL x, REAL y,
- GpGraphics *graphics, BOOL *result);
-
-GpStatus WINGDIPAPI
-GdipIsVisibleRegionPointI(GpRegion *region, INT x, INT y,
- GpGraphics *graphics, BOOL *result);
-
-GpStatus WINGDIPAPI
-GdipIsVisibleRegionRect(GpRegion *region, REAL x, REAL y, REAL width,
- REAL height, GpGraphics *graphics, BOOL *result);
-
-GpStatus WINGDIPAPI
-GdipIsVisibleRegionRectI(GpRegion *region, INT x, INT y, INT width,
- INT height, GpGraphics *graphics, BOOL *result);
-
-GpStatus WINGDIPAPI
-GdipGetRegionScansCount(GpRegion *region, UINT* count, GpMatrix* matrix);
-
-GpStatus WINGDIPAPI
-GdipGetRegionScans(GpRegion *region, GpRectF* rects, INT* count, GpMatrix* matrix);
-
-GpStatus WINGDIPAPI
-GdipGetRegionScansI(GpRegion *region, GpRect* rects, INT* count, GpMatrix* matrix);
-
-//----------------------------------------------------------------------------
-// Brush methods
-//----------------------------------------------------------------------------
-
-GpStatus WINGDIPAPI
-GdipCloneBrush(GpBrush *brush, GpBrush **cloneBrush);
-
-GpStatus WINGDIPAPI
-GdipDeleteBrush(GpBrush *brush);
-
-GpStatus WINGDIPAPI
-GdipGetBrushType(GpBrush *brush, GpBrushType *type);
-
-//----------------------------------------------------------------------------
-// Hatch Brush methods
-//----------------------------------------------------------------------------
-
-GpStatus WINGDIPAPI
-GdipCreateHatchBrush(GpHatchStyle hatchstyle, ARGB forecol,
- ARGB backcol, GpHatch **brush);
-
-GpStatus WINGDIPAPI
-GdipGetHatchStyle(GpHatch *brush, GpHatchStyle *hatchstyle);
-
-GpStatus WINGDIPAPI
-GdipGetHatchForegroundColor(GpHatch *brush, ARGB* forecol);
-
-GpStatus WINGDIPAPI
-GdipGetHatchBackgroundColor(GpHatch *brush, ARGB* backcol);
-
-//----------------------------------------------------------------------------
-// Texture Brush methods
-//----------------------------------------------------------------------------
-
-GpStatus WINGDIPAPI
-GdipCreateTexture(GpImage *image, GpWrapMode wrapmode,
- GpTexture **texture);
-
-GpStatus WINGDIPAPI
-GdipCreateTexture2(GpImage *image, GpWrapMode wrapmode, REAL x,
- REAL y, REAL width, REAL height, GpTexture **texture);
-
-GpStatus WINGDIPAPI
-GdipCreateTextureIA(GpImage *image, GDIPCONST GpImageAttributes *imageAttributes,
- REAL x, REAL y, REAL width, REAL height,
- GpTexture **texture);
-
-GpStatus WINGDIPAPI
-GdipCreateTexture2I(GpImage *image, GpWrapMode wrapmode, INT x,
- INT y, INT width, INT height, GpTexture **texture);
-
-GpStatus WINGDIPAPI
-GdipCreateTextureIAI(GpImage *image, GDIPCONST GpImageAttributes *imageAttributes,
- INT x, INT y, INT width, INT height,
- GpTexture **texture);
-
-
-GpStatus WINGDIPAPI
-GdipGetTextureTransform(GpTexture *brush, GpMatrix *matrix);
-
-GpStatus WINGDIPAPI
-GdipSetTextureTransform(GpTexture *brush, GDIPCONST GpMatrix *matrix);
-
-GpStatus WINGDIPAPI
-GdipResetTextureTransform(GpTexture* brush);
-
-GpStatus WINGDIPAPI
-GdipMultiplyTextureTransform(GpTexture* brush, GDIPCONST GpMatrix *matrix,
- GpMatrixOrder order);
-
-GpStatus WINGDIPAPI
-GdipTranslateTextureTransform(GpTexture* brush, REAL dx, REAL dy,
- GpMatrixOrder order);
-
-GpStatus WINGDIPAPI
-GdipScaleTextureTransform(GpTexture* brush, REAL sx, REAL sy,
- GpMatrixOrder order);
-
-GpStatus WINGDIPAPI
-GdipRotateTextureTransform(GpTexture* brush, REAL angle, GpMatrixOrder order);
-
-GpStatus WINGDIPAPI
-GdipSetTextureWrapMode(GpTexture *brush, GpWrapMode wrapmode);
-
-GpStatus WINGDIPAPI
-GdipGetTextureWrapMode(GpTexture *brush, GpWrapMode *wrapmode);
-
-GpStatus WINGDIPAPI
-GdipGetTextureImage(GpTexture *brush, GpImage **image);
-
-//----------------------------------------------------------------------------
-// Solid Brush methods
-//----------------------------------------------------------------------------
-
-GpStatus WINGDIPAPI
-GdipCreateSolidFill(ARGB color, GpSolidFill **brush);
-
-GpStatus WINGDIPAPI
-GdipSetSolidFillColor(GpSolidFill *brush, ARGB color);
-
-GpStatus WINGDIPAPI
-GdipGetSolidFillColor(GpSolidFill *brush, ARGB *color);
-
-//----------------------------------------------------------------------------
-// LineBrush methods
-//----------------------------------------------------------------------------
-
-GpStatus WINGDIPAPI
-GdipCreateLineBrush(GDIPCONST GpPointF* point1,
- GDIPCONST GpPointF* point2,
- ARGB color1, ARGB color2,
- GpWrapMode wrapMode,
- GpLineGradient **lineGradient);
-
-GpStatus WINGDIPAPI
-GdipCreateLineBrushI(GDIPCONST GpPoint* point1,
- GDIPCONST GpPoint* point2,
- ARGB color1, ARGB color2,
- GpWrapMode wrapMode,
- GpLineGradient **lineGradient);
-
-GpStatus WINGDIPAPI
-GdipCreateLineBrushFromRect(GDIPCONST GpRectF* rect,
- ARGB color1, ARGB color2,
- LinearGradientMode mode,
- GpWrapMode wrapMode,
- GpLineGradient **lineGradient);
-
-GpStatus WINGDIPAPI
-GdipCreateLineBrushFromRectI(GDIPCONST GpRect* rect,
- ARGB color1, ARGB color2,
- LinearGradientMode mode,
- GpWrapMode wrapMode,
- GpLineGradient **lineGradient);
-
-GpStatus WINGDIPAPI
-GdipCreateLineBrushFromRectWithAngle(GDIPCONST GpRectF* rect,
- ARGB color1, ARGB color2,
- REAL angle,
- BOOL isAngleScalable,
- GpWrapMode wrapMode,
- GpLineGradient **lineGradient);
-
-GpStatus WINGDIPAPI
-GdipCreateLineBrushFromRectWithAngleI(GDIPCONST GpRect* rect,
- ARGB color1, ARGB color2,
- REAL angle,
- BOOL isAngleScalable,
- GpWrapMode wrapMode,
- GpLineGradient **lineGradient);
-
-GpStatus WINGDIPAPI
-GdipSetLinePoints(GpLineGradient *brush,
- GDIPCONST GpPointF* point1,
- GDIPCONST GpPointF* point2);
-
-GpStatus WINGDIPAPI
-GdipSetLinePointsI(GpLineGradient *brush,
- GDIPCONST GpPoint* point1,
- GDIPCONST GpPoint* point2);
-
-GpStatus WINGDIPAPI
-GdipGetLinePoints(GpLineGradient *brush, GpPointF* points);
-
-GpStatus WINGDIPAPI
-GdipGetLinePointsI(GpLineGradient *brush, GpPoint* points);
-
-GpStatus WINGDIPAPI
-GdipSetLineColors(GpLineGradient *brush, ARGB color1, ARGB color2);
-
-GpStatus WINGDIPAPI
-GdipGetLineColors(GpLineGradient *brush, ARGB* colors);
-
-GpStatus WINGDIPAPI
-GdipGetLineRect(GpLineGradient *brush, GpRectF *rect);
-
-GpStatus WINGDIPAPI
-GdipGetLineRectI(GpLineGradient *brush, GpRect *rect);
-
-GpStatus WINGDIPAPI
-GdipSetLineGammaCorrection(GpLineGradient *brush, BOOL useGammaCorrection);
-
-GpStatus WINGDIPAPI
-GdipGetLineGammaCorrection(GpLineGradient *brush, BOOL *useGammaCorrection);
-
-GpStatus WINGDIPAPI
-GdipGetLineBlendCount(GpLineGradient *brush, INT *count);
-
-GpStatus WINGDIPAPI
-GdipGetLineBlend(GpLineGradient *brush, REAL *blend, REAL* positions,
- INT count);
-
-GpStatus WINGDIPAPI
-GdipSetLineBlend(GpLineGradient *brush, GDIPCONST REAL *blend,
- GDIPCONST REAL* positions, INT count);
-
-GpStatus WINGDIPAPI
-GdipGetLinePresetBlendCount(GpLineGradient *brush, INT *count);
-
-GpStatus WINGDIPAPI
-GdipGetLinePresetBlend(GpLineGradient *brush, ARGB *blend,
- REAL* positions, INT count);
-
-GpStatus WINGDIPAPI
-GdipSetLinePresetBlend(GpLineGradient *brush, GDIPCONST ARGB *blend,
- GDIPCONST REAL* positions, INT count);
-
-GpStatus WINGDIPAPI
-GdipSetLineSigmaBlend(GpLineGradient *brush, REAL focus, REAL scale);
-
-GpStatus WINGDIPAPI
-GdipSetLineLinearBlend(GpLineGradient *brush, REAL focus, REAL scale);
-
-GpStatus WINGDIPAPI
-GdipSetLineWrapMode(GpLineGradient *brush, GpWrapMode wrapmode);
-
-GpStatus WINGDIPAPI
-GdipGetLineWrapMode(GpLineGradient *brush, GpWrapMode *wrapmode);
-
-GpStatus WINGDIPAPI
-GdipGetLineTransform(GpLineGradient *brush, GpMatrix *matrix);
-
-GpStatus WINGDIPAPI
-GdipSetLineTransform(GpLineGradient *brush, GDIPCONST GpMatrix *matrix);
-
-GpStatus WINGDIPAPI
-GdipResetLineTransform(GpLineGradient* brush);
-
-GpStatus WINGDIPAPI
-GdipMultiplyLineTransform(GpLineGradient* brush, GDIPCONST GpMatrix *matrix,
- GpMatrixOrder order);
-
-GpStatus WINGDIPAPI
-GdipTranslateLineTransform(GpLineGradient* brush, REAL dx, REAL dy,
- GpMatrixOrder order);
-
-GpStatus WINGDIPAPI
-GdipScaleLineTransform(GpLineGradient* brush, REAL sx, REAL sy,
- GpMatrixOrder order);
-
-GpStatus WINGDIPAPI
-GdipRotateLineTransform(GpLineGradient* brush, REAL angle, GpMatrixOrder order);
-
-//----------------------------------------------------------------------------
-// PathGradient Brush
-//----------------------------------------------------------------------------
-
-GpStatus WINGDIPAPI
-GdipCreatePathGradient(GDIPCONST GpPointF* points,
- INT count,
- GpWrapMode wrapMode,
- GpPathGradient **polyGradient);
-
-GpStatus WINGDIPAPI
-GdipCreatePathGradientI(GDIPCONST GpPoint* points,
- INT count,
- GpWrapMode wrapMode,
- GpPathGradient **polyGradient);
-
-GpStatus WINGDIPAPI
-GdipCreatePathGradientFromPath(GDIPCONST GpPath* path,
- GpPathGradient **polyGradient);
-
-GpStatus WINGDIPAPI
-GdipGetPathGradientCenterColor(
- GpPathGradient *brush, ARGB* colors);
-
-GpStatus WINGDIPAPI
-GdipSetPathGradientCenterColor(
- GpPathGradient *brush, ARGB colors);
-
-GpStatus WINGDIPAPI
-GdipGetPathGradientSurroundColorsWithCount(
- GpPathGradient *brush, ARGB* color, INT* count);
-
-GpStatus WINGDIPAPI
-GdipSetPathGradientSurroundColorsWithCount(
- GpPathGradient *brush,
- GDIPCONST ARGB* color, INT* count);
-
-GpStatus WINGDIPAPI
-GdipGetPathGradientPath(GpPathGradient *brush, GpPath *path);
-
-GpStatus WINGDIPAPI
-GdipSetPathGradientPath(GpPathGradient *brush, GDIPCONST GpPath *path);
-
-GpStatus WINGDIPAPI
-GdipGetPathGradientCenterPoint(
- GpPathGradient *brush, GpPointF* points);
-
-GpStatus WINGDIPAPI
-GdipGetPathGradientCenterPointI(
- GpPathGradient *brush, GpPoint* points);
-
-GpStatus WINGDIPAPI
-GdipSetPathGradientCenterPoint(
- GpPathGradient *brush, GDIPCONST GpPointF* points);
-
-GpStatus WINGDIPAPI
-GdipSetPathGradientCenterPointI(
- GpPathGradient *brush, GDIPCONST GpPoint* points);
-
-GpStatus WINGDIPAPI
-GdipGetPathGradientRect(GpPathGradient *brush, GpRectF *rect);
-
-GpStatus WINGDIPAPI
-GdipGetPathGradientRectI(GpPathGradient *brush, GpRect *rect);
-
-GpStatus WINGDIPAPI
-GdipGetPathGradientPointCount(GpPathGradient *brush, INT* count);
-
-GpStatus WINGDIPAPI
-GdipGetPathGradientSurroundColorCount(GpPathGradient *brush, INT* count);
-
-GpStatus WINGDIPAPI
-GdipSetPathGradientGammaCorrection(GpPathGradient *brush, BOOL useGammaCorrection);
-
-GpStatus WINGDIPAPI
-GdipGetPathGradientGammaCorrection(GpPathGradient *brush, BOOL *useGammaCorrection);
-
-GpStatus WINGDIPAPI
-GdipGetPathGradientBlendCount(GpPathGradient *brush,
- INT *count);
-
-GpStatus WINGDIPAPI
-GdipGetPathGradientBlend(GpPathGradient *brush,
- REAL *blend, REAL *positions, INT count);
-
-GpStatus WINGDIPAPI
-GdipSetPathGradientBlend(GpPathGradient *brush,
- GDIPCONST REAL *blend, GDIPCONST REAL *positions, INT count);
-
-GpStatus WINGDIPAPI
-GdipGetPathGradientPresetBlendCount(GpPathGradient *brush, INT *count);
-
-GpStatus WINGDIPAPI
-GdipGetPathGradientPresetBlend(GpPathGradient *brush, ARGB *blend,
- REAL* positions, INT count);
-
-GpStatus WINGDIPAPI
-GdipSetPathGradientPresetBlend(GpPathGradient *brush, GDIPCONST ARGB *blend,
- GDIPCONST REAL* positions, INT count);
-
-GpStatus WINGDIPAPI
-GdipSetPathGradientSigmaBlend(GpPathGradient *brush, REAL focus, REAL scale);
-
-GpStatus WINGDIPAPI
-GdipSetPathGradientLinearBlend(GpPathGradient *brush, REAL focus, REAL scale);
-
-GpStatus WINGDIPAPI
-GdipGetPathGradientWrapMode(GpPathGradient *brush,
- GpWrapMode *wrapmode);
-
-GpStatus WINGDIPAPI
-GdipSetPathGradientWrapMode(GpPathGradient *brush,
- GpWrapMode wrapmode);
-
-GpStatus WINGDIPAPI
-GdipGetPathGradientTransform(GpPathGradient *brush,
- GpMatrix *matrix);
-
-GpStatus WINGDIPAPI
-GdipSetPathGradientTransform(GpPathGradient *brush,
- GpMatrix *matrix);
-
-GpStatus WINGDIPAPI
-GdipResetPathGradientTransform(GpPathGradient* brush);
-
-GpStatus WINGDIPAPI
-GdipMultiplyPathGradientTransform(GpPathGradient* brush, GDIPCONST GpMatrix *matrix,
- GpMatrixOrder order);
-
-GpStatus WINGDIPAPI
-GdipTranslatePathGradientTransform(GpPathGradient* brush, REAL dx, REAL dy,
- GpMatrixOrder order);
-
-GpStatus WINGDIPAPI
-GdipScalePathGradientTransform(GpPathGradient* brush, REAL sx, REAL sy,
- GpMatrixOrder order);
-
-GpStatus WINGDIPAPI
-GdipRotatePathGradientTransform(GpPathGradient* brush, REAL angle,
- GpMatrixOrder order);
-
-GpStatus WINGDIPAPI
-GdipGetPathGradientFocusScales(GpPathGradient *brush, REAL* xScale, REAL* yScale);
-
-GpStatus WINGDIPAPI
-GdipSetPathGradientFocusScales(GpPathGradient *brush, REAL xScale, REAL yScale);
-
-//----------------------------------------------------------------------------
-// Pen methods
-//----------------------------------------------------------------------------
-
-GpStatus WINGDIPAPI
-GdipCreatePen1(ARGB color, REAL width, GpUnit unit, GpPen **pen);
-
-GpStatus WINGDIPAPI
-GdipCreatePen2(GpBrush *brush, REAL width, GpUnit unit,
- GpPen **pen);
-
-GpStatus WINGDIPAPI
-GdipClonePen(GpPen *pen, GpPen **clonepen);
-
-GpStatus WINGDIPAPI
-GdipDeletePen(GpPen *pen);
-
-GpStatus WINGDIPAPI
-GdipSetPenWidth(GpPen *pen, REAL width);
-
-GpStatus WINGDIPAPI
-GdipGetPenWidth(GpPen *pen, REAL *width);
-
-GpStatus WINGDIPAPI
-GdipSetPenUnit(GpPen *pen, GpUnit unit);
-
-GpStatus WINGDIPAPI
-GdipGetPenUnit(GpPen *pen, GpUnit *unit);
-
-#ifdef DCR_USE_NEW_197819
-GpStatus WINGDIPAPI
-GdipSetPenLineCap197819(GpPen *pen, GpLineCap startCap, GpLineCap endCap,
- GpDashCap dashCap);
-#else
-GpStatus WINGDIPAPI
-GdipSetPenLineCap(GpPen *pen, GpLineCap startCap, GpLineCap endCap,
- GpLineCap dashCap);
-#endif // DCR_USE_NEW_197819
-
-
-GpStatus WINGDIPAPI
-GdipSetPenStartCap(GpPen *pen, GpLineCap startCap);
-
-GpStatus WINGDIPAPI
-GdipSetPenEndCap(GpPen *pen, GpLineCap endCap);
-
-#ifdef DCR_USE_NEW_197819
-GpStatus WINGDIPAPI
-GdipSetPenDashCap197819(GpPen *pen, GpDashCap dashCap);
-#else
-GpStatus WINGDIPAPI
-GdipSetPenDashCap(GpPen *pen, GpLineCap dashCap);
-#endif // DCR_USE_NEW_197819
-
-GpStatus WINGDIPAPI
-GdipGetPenStartCap(GpPen *pen, GpLineCap *startCap);
-
-GpStatus WINGDIPAPI
-GdipGetPenEndCap(GpPen *pen, GpLineCap *endCap);
-
-#ifdef DCR_USE_NEW_197819
-GpStatus WINGDIPAPI
-GdipGetPenDashCap197819(GpPen *pen, GpDashCap *dashCap);
-#else
-GpStatus WINGDIPAPI
-GdipGetPenDashCap(GpPen *pen, GpLineCap *dashCap);
-#endif // DCR_USE_NEW_197819
-
-GpStatus WINGDIPAPI
-GdipSetPenLineJoin(GpPen *pen, GpLineJoin lineJoin);
-
-GpStatus WINGDIPAPI
-GdipGetPenLineJoin(GpPen *pen, GpLineJoin *lineJoin);
-
-GpStatus WINGDIPAPI
-GdipSetPenCustomStartCap(GpPen *pen, GpCustomLineCap* customCap);
-
-GpStatus WINGDIPAPI
-GdipGetPenCustomStartCap(GpPen *pen, GpCustomLineCap** customCap);
-
-GpStatus WINGDIPAPI
-GdipSetPenCustomEndCap(GpPen *pen, GpCustomLineCap* customCap);
-
-GpStatus WINGDIPAPI
-GdipGetPenCustomEndCap(GpPen *pen, GpCustomLineCap** customCap);
-
-GpStatus WINGDIPAPI
-GdipSetPenMiterLimit(GpPen *pen, REAL miterLimit);
-
-GpStatus WINGDIPAPI
-GdipGetPenMiterLimit(GpPen *pen, REAL *miterLimit);
-
-GpStatus WINGDIPAPI
-GdipSetPenMode(GpPen *pen, GpPenAlignment penMode);
-
-GpStatus WINGDIPAPI
-GdipGetPenMode(GpPen *pen, GpPenAlignment *penMode);
-
-GpStatus WINGDIPAPI
-GdipSetPenTransform(GpPen *pen, GpMatrix *matrix);
-
-GpStatus WINGDIPAPI
-GdipGetPenTransform(GpPen *pen, GpMatrix *matrix);
-
-GpStatus WINGDIPAPI
-GdipResetPenTransform(GpPen *pen);
-
-GpStatus WINGDIPAPI
-GdipMultiplyPenTransform(GpPen *pen, GDIPCONST GpMatrix *matrix,
- GpMatrixOrder order);
-
-GpStatus WINGDIPAPI
-GdipTranslatePenTransform(GpPen *pen, REAL dx, REAL dy,
- GpMatrixOrder order);
-
-GpStatus WINGDIPAPI
-GdipScalePenTransform(GpPen *pen, REAL sx, REAL sy,
- GpMatrixOrder order);
-
-GpStatus WINGDIPAPI
-GdipRotatePenTransform(GpPen *pen, REAL angle, GpMatrixOrder order);
-
-GpStatus WINGDIPAPI
-GdipSetPenColor(GpPen *pen, ARGB argb);
-
-GpStatus WINGDIPAPI
-GdipGetPenColor(GpPen *pen, ARGB *argb);
-
-GpStatus WINGDIPAPI
-GdipSetPenBrushFill(GpPen *pen, GpBrush *brush);
-
-GpStatus WINGDIPAPI
-GdipGetPenBrushFill(GpPen *pen, GpBrush **brush);
-
-GpStatus WINGDIPAPI
-GdipGetPenFillType(GpPen *pen, GpPenType* type);
-
-GpStatus WINGDIPAPI
-GdipGetPenDashStyle(GpPen *pen, GpDashStyle *dashstyle);
-
-GpStatus WINGDIPAPI
-GdipSetPenDashStyle(GpPen *pen, GpDashStyle dashstyle);
-
-GpStatus WINGDIPAPI
-GdipGetPenDashOffset(GpPen *pen, REAL *offset);
-
-GpStatus WINGDIPAPI
-GdipSetPenDashOffset(GpPen *pen, REAL offset);
-
-GpStatus WINGDIPAPI
-GdipGetPenDashCount(GpPen *pen, INT *count);
-
-GpStatus WINGDIPAPI
-GdipSetPenDashArray(GpPen *pen, GDIPCONST REAL *dash, INT count);
-
-GpStatus WINGDIPAPI
-GdipGetPenDashArray(GpPen *pen, REAL *dash, INT count);
-
-GpStatus WINGDIPAPI
-GdipGetPenCompoundCount(GpPen *pen, INT *count);
-
-GpStatus WINGDIPAPI
-GdipSetPenCompoundArray(GpPen *pen, GDIPCONST REAL *dash, INT count);
-
-GpStatus WINGDIPAPI
-GdipGetPenCompoundArray(GpPen *pen, REAL *dash, INT count);
-
-//----------------------------------------------------------------------------
-// CustomLineCap methods
-//----------------------------------------------------------------------------
-
-GpStatus WINGDIPAPI
-GdipCreateCustomLineCap(GpPath* fillPath, GpPath* strokePath,
- GpLineCap baseCap, REAL baseInset, GpCustomLineCap **customCap);
-
-GpStatus WINGDIPAPI
-GdipDeleteCustomLineCap(GpCustomLineCap* customCap);
-
-GpStatus WINGDIPAPI
-GdipCloneCustomLineCap(GpCustomLineCap* customCap,
- GpCustomLineCap** clonedCap);
-
-GpStatus WINGDIPAPI
-GdipGetCustomLineCapType(GpCustomLineCap* customCap,
- CustomLineCapType* capType);
-
-GpStatus WINGDIPAPI
-GdipSetCustomLineCapStrokeCaps(GpCustomLineCap* customCap,
- GpLineCap startCap, GpLineCap endCap);
-
-GpStatus WINGDIPAPI
-GdipGetCustomLineCapStrokeCaps(GpCustomLineCap* customCap,
- GpLineCap* startCap, GpLineCap* endCap);
-
-GpStatus WINGDIPAPI
-GdipSetCustomLineCapStrokeJoin(GpCustomLineCap* customCap, GpLineJoin lineJoin);
-
-GpStatus WINGDIPAPI
-GdipGetCustomLineCapStrokeJoin(GpCustomLineCap* customCap, GpLineJoin* lineJoin);
-
-GpStatus WINGDIPAPI
-GdipSetCustomLineCapBaseCap(GpCustomLineCap* customCap, GpLineCap baseCap);
-
-GpStatus WINGDIPAPI
-GdipGetCustomLineCapBaseCap(GpCustomLineCap* customCap, GpLineCap* baseCap);
-
-GpStatus WINGDIPAPI
-GdipSetCustomLineCapBaseInset(GpCustomLineCap* customCap, REAL inset);
-
-GpStatus WINGDIPAPI
-GdipGetCustomLineCapBaseInset(GpCustomLineCap* customCap, REAL* inset);
-
-GpStatus WINGDIPAPI
-GdipSetCustomLineCapWidthScale(GpCustomLineCap* customCap, REAL widthScale);
-
-GpStatus WINGDIPAPI
-GdipGetCustomLineCapWidthScale(GpCustomLineCap* customCap, REAL* widthScale);
-
-//----------------------------------------------------------------------------
-// AdjustableArrowCap methods
-//----------------------------------------------------------------------------
-
-GpStatus WINGDIPAPI
-GdipCreateAdjustableArrowCap(REAL height, REAL width, BOOL isFilled,
- GpAdjustableArrowCap **cap);
-
-GpStatus WINGDIPAPI
-GdipSetAdjustableArrowCapHeight(GpAdjustableArrowCap* cap, REAL height);
-
-GpStatus WINGDIPAPI
-GdipGetAdjustableArrowCapHeight(GpAdjustableArrowCap* cap, REAL* height);
-
-GpStatus WINGDIPAPI
-GdipSetAdjustableArrowCapWidth(GpAdjustableArrowCap* cap, REAL width);
-
-GpStatus WINGDIPAPI
-GdipGetAdjustableArrowCapWidth(GpAdjustableArrowCap* cap, REAL* width);
-
-GpStatus WINGDIPAPI
-GdipSetAdjustableArrowCapMiddleInset(GpAdjustableArrowCap* cap, REAL middleInset);
-
-GpStatus WINGDIPAPI
-GdipGetAdjustableArrowCapMiddleInset(GpAdjustableArrowCap* cap, REAL* middleInset);
-
-GpStatus WINGDIPAPI
-GdipSetAdjustableArrowCapFillState(GpAdjustableArrowCap* cap, BOOL fillState);
-
-GpStatus WINGDIPAPI
-GdipGetAdjustableArrowCapFillState(GpAdjustableArrowCap* cap, BOOL* fillState);
-
-//----------------------------------------------------------------------------
-// Image methods
-//----------------------------------------------------------------------------
-
-GpStatus WINGDIPAPI
-GdipLoadImageFromStream(IStream* stream, GpImage **image);
-
-GpStatus WINGDIPAPI
-GdipLoadImageFromFile(GDIPCONST WCHAR* filename, GpImage **image);
-
-GpStatus WINGDIPAPI
-GdipLoadImageFromStreamICM(IStream* stream, GpImage **image);
-
-GpStatus WINGDIPAPI
-GdipLoadImageFromFileICM(GDIPCONST WCHAR* filename, GpImage **image);
-
-GpStatus WINGDIPAPI
-GdipCloneImage(GpImage *image, GpImage **cloneImage);
-
-GpStatus WINGDIPAPI
-GdipDisposeImage(GpImage *image);
-
-GpStatus WINGDIPAPI
-GdipSaveImageToFile(GpImage *image, GDIPCONST WCHAR* filename,
- GDIPCONST CLSID* clsidEncoder, GDIPCONST EncoderParameters* encoderParams);
-
-GpStatus WINGDIPAPI
-GdipSaveImageToStream(GpImage *image, IStream* stream,
- GDIPCONST CLSID* clsidEncoder, GDIPCONST EncoderParameters* encoderParams);
-
-GpStatus WINGDIPAPI
-GdipSaveAdd(GpImage *image, GDIPCONST EncoderParameters* encoderParams);
-
-GpStatus WINGDIPAPI
-GdipSaveAddImage(GpImage *image, GpImage* newImage,
- GDIPCONST EncoderParameters* encoderParams);
-
-GpStatus WINGDIPAPI
-GdipGetImageGraphicsContext(GpImage *image, GpGraphics **graphics);
-
-GpStatus WINGDIPAPI
-GdipGetImageBounds(GpImage *image, GpRectF *srcRect, GpUnit *srcUnit);
-
-GpStatus WINGDIPAPI
-GdipGetImageDimension(GpImage *image, REAL *width, REAL *height);
-
-GpStatus WINGDIPAPI
-GdipGetImageType(GpImage *image, ImageType *type);
-
-GpStatus WINGDIPAPI
-GdipGetImageWidth(GpImage *image, UINT *width);
-
-GpStatus WINGDIPAPI
-GdipGetImageHeight(GpImage *image, UINT *height);
-
-GpStatus WINGDIPAPI
-GdipGetImageHorizontalResolution(GpImage *image, REAL *resolution);
-
-GpStatus WINGDIPAPI
-GdipGetImageVerticalResolution(GpImage *image, REAL *resolution);
-
-GpStatus WINGDIPAPI
-GdipGetImageFlags(GpImage *image, UINT *flags);
-
-GpStatus WINGDIPAPI
-GdipGetImageRawFormat(GpImage *image, GUID *format);
-
-GpStatus WINGDIPAPI
-GdipGetImagePixelFormat(GpImage *image, PixelFormat *format);
-
-GpStatus WINGDIPAPI
-GdipGetImageThumbnail(GpImage *image, UINT thumbWidth, UINT thumbHeight,
- GpImage **thumbImage,
- GetThumbnailImageAbort callback, VOID * callbackData);
-
-GpStatus WINGDIPAPI
-GdipGetEncoderParameterListSize(GpImage *image, GDIPCONST CLSID* clsidEncoder,
- UINT* size);
-
-GpStatus WINGDIPAPI
-GdipGetEncoderParameterList(GpImage *image, GDIPCONST CLSID* clsidEncoder,
- UINT size, EncoderParameters* buffer);
-
-GpStatus WINGDIPAPI
-GdipImageGetFrameDimensionsCount(GpImage* image, UINT* count);
-
-GpStatus WINGDIPAPI
-GdipImageGetFrameDimensionsList(GpImage* image, GUID* dimensionIDs, UINT count);
-
-GpStatus WINGDIPAPI
-GdipImageGetFrameCount(GpImage *image, GDIPCONST GUID* dimensionID, UINT* count);
-
-GpStatus WINGDIPAPI
-GdipImageSelectActiveFrame(GpImage *image, GDIPCONST GUID* dimensionID,
- UINT frameIndex);
-
-GpStatus WINGDIPAPI
-GdipImageRotateFlip(GpImage *image, RotateFlipType rfType);
-
-GpStatus WINGDIPAPI
-GdipGetImagePalette(GpImage *image, ColorPalette *palette, INT size);
-
-GpStatus WINGDIPAPI
-GdipSetImagePalette(GpImage *image, GDIPCONST ColorPalette *palette);
-
-GpStatus WINGDIPAPI
-GdipGetImagePaletteSize(GpImage *image, INT *size);
-
-GpStatus WINGDIPAPI
-GdipGetPropertyCount(GpImage *image, UINT* numOfProperty);
-
-GpStatus WINGDIPAPI
-GdipGetPropertyIdList(GpImage *image, UINT numOfProperty, PROPID* list);
-
-GpStatus WINGDIPAPI
-GdipGetPropertyItemSize(GpImage *image, PROPID propId, UINT* size);
-
-GpStatus WINGDIPAPI
-GdipGetPropertyItem(GpImage *image, PROPID propId,UINT propSize,
- PropertyItem* buffer);
-
-GpStatus WINGDIPAPI
-GdipGetPropertySize(GpImage *image, UINT* totalBufferSize, UINT* numProperties);
-
-GpStatus WINGDIPAPI
-GdipGetAllPropertyItems(GpImage *image, UINT totalBufferSize,
- UINT numProperties, PropertyItem* allItems);
-
-GpStatus WINGDIPAPI
-GdipRemovePropertyItem(GpImage *image, PROPID propId);
-
-GpStatus WINGDIPAPI
-GdipSetPropertyItem(GpImage *image, GDIPCONST PropertyItem* item);
-
-GpStatus WINGDIPAPI
-GdipImageForceValidation(GpImage *image);
-
-GpStatus WINGDIPAPI
-GdipGetImageLayout(GpImage *image, ImageLayout* layout);
-
-GpStatus WINGDIPAPI
-GdipSetImageLayout(GpImage *image, GDIPCONST ImageLayout layout);
-
-//----------------------------------------------------------------------------
-// Bitmap methods
-//----------------------------------------------------------------------------
-
-GpStatus WINGDIPAPI
-GdipCreateBitmapFromStream(IStream* stream, GpBitmap **bitmap);
-
-GpStatus WINGDIPAPI
-GdipCreateBitmapFromFile(GDIPCONST WCHAR* filename, GpBitmap **bitmap);
-
-GpStatus WINGDIPAPI
-GdipCreateBitmapFromStreamICM(IStream* stream, GpBitmap **bitmap);
-
-GpStatus WINGDIPAPI
-GdipCreateBitmapFromFileICM(GDIPCONST WCHAR* filename, GpBitmap **bitmap);
-
-GpStatus WINGDIPAPI
-GdipCreateBitmapFromScan0(INT width,
- INT height,
- INT stride,
- PixelFormat format,
- BYTE* scan0,
- GpBitmap** bitmap);
-
-GpStatus WINGDIPAPI
-GdipCreateBitmapFromGraphics(INT width,
- INT height,
- GpGraphics* target,
- GpBitmap** bitmap);
-
-GpStatus WINGDIPAPI
-GdipCreateBitmapFromDirectDrawSurface(IDirectDrawSurface7* surface,
- GpBitmap** bitmap);
-
-GpStatus WINGDIPAPI
-GdipCreateBitmapFromGdiDib(GDIPCONST BITMAPINFO* gdiBitmapInfo,
- VOID* gdiBitmapData,
- GpBitmap** bitmap);
-
-GpStatus WINGDIPAPI
-GdipCreateBitmapFromHBITMAP(HBITMAP hbm,
- HPALETTE hpal,
- GpBitmap** bitmap);
-
-GpStatus WINGDIPAPI
-GdipCreateHBITMAPFromBitmap(GpBitmap* bitmap,
- HBITMAP* hbmReturn,
- ARGB background);
-
-GpStatus WINGDIPAPI
-GdipCreateBitmapFromHICON(HICON hicon,
- GpBitmap** bitmap);
-
-GpStatus WINGDIPAPI
-GdipCreateHICONFromBitmap(GpBitmap* bitmap,
- HICON* hbmReturn);
-
-GpStatus WINGDIPAPI
-GdipCreateBitmapFromResource(HINSTANCE hInstance,
- GDIPCONST WCHAR* lpBitmapName,
- GpBitmap** bitmap);
-
-GpStatus WINGDIPAPI
-GdipCloneBitmapArea(REAL x, REAL y, REAL width, REAL height,
- PixelFormat format,
- GpBitmap *srcBitmap,
- GpBitmap **dstBitmap);
-
-GpStatus WINGDIPAPI
-GdipCloneBitmapAreaI(INT x,
- INT y,
- INT width,
- INT height,
- PixelFormat format,
- GpBitmap *srcBitmap,
- GpBitmap **dstBitmap);
-
-GpStatus WINGDIPAPI
-GdipBitmapLockBits(GpBitmap* bitmap,
- GDIPCONST GpRect* rect,
- UINT flags,
- PixelFormat format,
- BitmapData* lockedBitmapData);
-
-GpStatus WINGDIPAPI
-GdipBitmapUnlockBits(GpBitmap* bitmap,
- BitmapData* lockedBitmapData);
-
-GpStatus WINGDIPAPI
-GdipBitmapGetPixel(GpBitmap* bitmap, INT x, INT y, ARGB *color);
-
-GpStatus WINGDIPAPI
-GdipBitmapSetPixel(GpBitmap* bitmap, INT x, INT y, ARGB color);
-
-GpStatus WINGDIPAPI
-GdipBitmapSetResolution(GpBitmap* bitmap, REAL xdpi, REAL ydpi);
-
-//----------------------------------------------------------------------------
-// ImageAttributes methods
-//----------------------------------------------------------------------------
-
-GpStatus WINGDIPAPI
-GdipCreateImageAttributes(GpImageAttributes **imageattr);
-
-GpStatus WINGDIPAPI
-GdipCloneImageAttributes(GDIPCONST GpImageAttributes *imageattr,
- GpImageAttributes **cloneImageattr);
-
-GpStatus WINGDIPAPI
-GdipDisposeImageAttributes(GpImageAttributes *imageattr);
-
-GpStatus WINGDIPAPI
-GdipSetImageAttributesToIdentity(GpImageAttributes *imageattr,
- ColorAdjustType type);
-GpStatus WINGDIPAPI
-GdipResetImageAttributes(GpImageAttributes *imageattr,
- ColorAdjustType type);
-
-GpStatus WINGDIPAPI
-GdipSetImageAttributesColorMatrix(GpImageAttributes *imageattr,
- ColorAdjustType type,
- BOOL enableFlag,
- GDIPCONST ColorMatrix* colorMatrix,
- GDIPCONST ColorMatrix* grayMatrix,
- ColorMatrixFlags flags);
-
-GpStatus WINGDIPAPI
-GdipSetImageAttributesThreshold(GpImageAttributes *imageattr,
- ColorAdjustType type,
- BOOL enableFlag,
- REAL threshold);
-
-GpStatus WINGDIPAPI
-GdipSetImageAttributesGamma(GpImageAttributes *imageattr,
- ColorAdjustType type,
- BOOL enableFlag,
- REAL gamma);
-
-GpStatus WINGDIPAPI
-GdipSetImageAttributesNoOp(GpImageAttributes *imageattr,
- ColorAdjustType type,
- BOOL enableFlag);
-
-GpStatus WINGDIPAPI
-GdipSetImageAttributesColorKeys(GpImageAttributes *imageattr,
- ColorAdjustType type,
- BOOL enableFlag,
- ARGB colorLow,
- ARGB colorHigh);
-
-GpStatus WINGDIPAPI
-GdipSetImageAttributesOutputChannel(GpImageAttributes *imageattr,
- ColorAdjustType type,
- BOOL enableFlag,
- ColorChannelFlags channelFlags);
-
-GpStatus WINGDIPAPI
-GdipSetImageAttributesOutputChannelColorProfile(GpImageAttributes *imageattr,
- ColorAdjustType type,
- BOOL enableFlag,
- GDIPCONST WCHAR *colorProfileFilename);
-
-GpStatus WINGDIPAPI
-GdipSetImageAttributesRemapTable(GpImageAttributes *imageattr,
- ColorAdjustType type,
- BOOL enableFlag,
- UINT mapSize,
- GDIPCONST ColorMap *map);
-GpStatus WINGDIPAPI
-GdipSetImageAttributesWrapMode(
- GpImageAttributes *imageAttr,
- WrapMode wrap,
- ARGB argb,
- BOOL clamp
-);
-
-GpStatus WINGDIPAPI
-GdipSetImageAttributesICMMode(
- GpImageAttributes *imageAttr,
- BOOL on
-);
-
-GpStatus WINGDIPAPI
-GdipGetImageAttributesAdjustedPalette(
- GpImageAttributes *imageAttr,
- ColorPalette * colorPalette,
- ColorAdjustType colorAdjustType
-);
-
-//----------------------------------------------------------------------------
-// Graphics methods
-//----------------------------------------------------------------------------
-
-GpStatus WINGDIPAPI
-GdipFlush(GpGraphics *graphics, GpFlushIntention intention);
-
-GpStatus WINGDIPAPI
-GdipCreateFromHDC(HDC hdc, GpGraphics **graphics);
-
-GpStatus WINGDIPAPI
-GdipCreateFromHDC2(HDC hdc, HANDLE hDevice, GpGraphics **graphics);
-
-GpStatus WINGDIPAPI
-GdipCreateFromHWND(HWND hwnd, GpGraphics **graphics);
-
-GpStatus WINGDIPAPI
-GdipCreateFromHWNDICM(HWND hwnd, GpGraphics **graphics);
-
-GpStatus WINGDIPAPI
-GdipDeleteGraphics(GpGraphics *graphics);
-
-GpStatus WINGDIPAPI
-GdipGetDC(GpGraphics* graphics, HDC * hdc);
-
-GpStatus WINGDIPAPI
-GdipReleaseDC(GpGraphics* graphics, HDC hdc);
-
-GpStatus WINGDIPAPI
-GdipSetCompositingMode(GpGraphics *graphics, CompositingMode compositingMode);
-
-GpStatus WINGDIPAPI
-GdipGetCompositingMode(GpGraphics *graphics, CompositingMode *compositingMode);
-
-GpStatus WINGDIPAPI
-GdipSetRenderingOrigin(GpGraphics *graphics, INT x, INT y);
-
-GpStatus WINGDIPAPI
-GdipGetRenderingOrigin(GpGraphics *graphics, INT *x, INT *y);
-
-GpStatus WINGDIPAPI
-GdipSetCompositingQuality(GpGraphics *graphics, CompositingQuality compositingQuality);
-
-GpStatus WINGDIPAPI
-GdipGetCompositingQuality(GpGraphics *graphics, CompositingQuality *compositingQuality);
-
-GpStatus WINGDIPAPI
-GdipSetSmoothingMode(GpGraphics *graphics, SmoothingMode smoothingMode);
-
-GpStatus WINGDIPAPI
-GdipGetSmoothingMode(GpGraphics *graphics, SmoothingMode *smoothingMode);
-
-GpStatus WINGDIPAPI
-GdipSetPixelOffsetMode(GpGraphics* graphics, PixelOffsetMode pixelOffsetMode);
-
-GpStatus WINGDIPAPI
-GdipGetPixelOffsetMode(GpGraphics *graphics, PixelOffsetMode *pixelOffsetMode);
-
-GpStatus WINGDIPAPI
-GdipSetTextRenderingHint(GpGraphics *graphics, TextRenderingHint mode);
-
-GpStatus WINGDIPAPI
-GdipGetTextRenderingHint(GpGraphics *graphics, TextRenderingHint *mode);
-
-#ifdef DCR_USE_NEW_188922
-GpStatus WINGDIPAPI
-GdipSetTextContrast(GpGraphics *graphics, UINT contrast);
-
-GpStatus WINGDIPAPI
-GdipGetTextContrast(GpGraphics *graphics, UINT * contrast);
-#else
-GpStatus WINGDIPAPI
-GdipSetTextGammaValue(GpGraphics *graphics, UINT gammaValue);
-
-GpStatus WINGDIPAPI
-GdipGetTextGammaValue(GpGraphics *graphics, UINT * gammaValue);
-#endif // DCR_USE_NEW_188922
-
-
-GpStatus WINGDIPAPI
-GdipSetInterpolationMode(GpGraphics *graphics, InterpolationMode interpolationMode);
-
-GpStatus WINGDIPAPI
-GdipGetInterpolationMode(GpGraphics *graphics, InterpolationMode *interpolationMode);
-
-GpStatus WINGDIPAPI
-GdipSetWorldTransform(GpGraphics *graphics, GpMatrix *matrix);
-
-GpStatus WINGDIPAPI
-GdipResetWorldTransform(GpGraphics *graphics);
-
-GpStatus WINGDIPAPI
-GdipMultiplyWorldTransform(GpGraphics *graphics, GDIPCONST GpMatrix *matrix,
- GpMatrixOrder order);
-
-GpStatus WINGDIPAPI
-GdipTranslateWorldTransform(GpGraphics *graphics, REAL dx, REAL dy,
- GpMatrixOrder order);
-
-GpStatus WINGDIPAPI
-GdipScaleWorldTransform(GpGraphics *graphics, REAL sx, REAL sy,
- GpMatrixOrder order);
-
-GpStatus WINGDIPAPI
-GdipRotateWorldTransform(GpGraphics *graphics, REAL angle, GpMatrixOrder order);
-
-GpStatus WINGDIPAPI
-GdipGetWorldTransform(GpGraphics *graphics, GpMatrix *matrix);
-
-GpStatus WINGDIPAPI
-GdipResetPageTransform(GpGraphics *graphics);
-
-GpStatus WINGDIPAPI
-GdipGetPageUnit(GpGraphics *graphics, GpUnit *unit);
-
-GpStatus WINGDIPAPI
-GdipGetPageScale(GpGraphics *graphics, REAL *scale);
-
-GpStatus WINGDIPAPI
-GdipSetPageUnit(GpGraphics *graphics, GpUnit unit);
-
-GpStatus WINGDIPAPI
-GdipSetPageScale(GpGraphics *graphics, REAL scale);
-
-GpStatus WINGDIPAPI
-GdipGetDpiX(GpGraphics *graphics, REAL* dpi);
-
-GpStatus WINGDIPAPI
-GdipGetDpiY(GpGraphics *graphics, REAL* dpi);
-
-GpStatus WINGDIPAPI
-GdipTransformPoints(GpGraphics *graphics, GpCoordinateSpace destSpace,
- GpCoordinateSpace srcSpace, GpPointF *points,
- INT count);
-
-GpStatus WINGDIPAPI
-GdipTransformPointsI(GpGraphics *graphics, GpCoordinateSpace destSpace,
- GpCoordinateSpace srcSpace, GpPoint *points,
- INT count);
-
-GpStatus WINGDIPAPI
-GdipGetNearestColor(GpGraphics *graphics, ARGB* argb);
-
-// Create the Win9x Halftone Palette (even on NT) with correct Desktop colors
-HPALETTE WINGDIPAPI
-GdipCreateHalftonePalette();
-
-GpStatus WINGDIPAPI
-GdipDrawLine(GpGraphics *graphics, GpPen *pen, REAL x1, REAL y1,
- REAL x2, REAL y2);
-
-GpStatus WINGDIPAPI
-GdipDrawLineI(GpGraphics *graphics, GpPen *pen, INT x1, INT y1,
- INT x2, INT y2);
-
-GpStatus WINGDIPAPI
-GdipDrawLines(GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *points,
- INT count);
-
-GpStatus WINGDIPAPI
-GdipDrawLinesI(GpGraphics *graphics, GpPen *pen, GDIPCONST GpPoint *points,
- INT count);
-
-GpStatus WINGDIPAPI
-GdipDrawArc(GpGraphics *graphics, GpPen *pen, REAL x, REAL y,
- REAL width, REAL height, REAL startAngle, REAL sweepAngle);
-
-GpStatus WINGDIPAPI
-GdipDrawArcI(GpGraphics *graphics, GpPen *pen, INT x, INT y,
- INT width, INT height, REAL startAngle, REAL sweepAngle);
-
-GpStatus WINGDIPAPI
-GdipDrawBezier(GpGraphics *graphics, GpPen *pen, REAL x1, REAL y1,
- REAL x2, REAL y2, REAL x3, REAL y3, REAL x4, REAL y4);
-
-GpStatus WINGDIPAPI
-GdipDrawBezierI(GpGraphics *graphics, GpPen *pen, INT x1, INT y1,
- INT x2, INT y2, INT x3, INT y3, INT x4, INT y4);
-
-GpStatus WINGDIPAPI
-GdipDrawBeziers(GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *points,
- INT count);
-
-GpStatus WINGDIPAPI
-GdipDrawBeziersI(GpGraphics *graphics, GpPen *pen, GDIPCONST GpPoint *points,
- INT count);
-
-GpStatus WINGDIPAPI
-GdipDrawRectangle(GpGraphics *graphics, GpPen *pen, REAL x, REAL y,
- REAL width, REAL height);
-
-GpStatus WINGDIPAPI
-GdipDrawRectangleI(GpGraphics *graphics, GpPen *pen, INT x, INT y,
- INT width, INT height);
-
-GpStatus WINGDIPAPI
-GdipDrawRectangles(GpGraphics *graphics, GpPen *pen, GDIPCONST GpRectF *rects,
- INT count);
-
-GpStatus WINGDIPAPI
-GdipDrawRectanglesI(GpGraphics *graphics, GpPen *pen, GDIPCONST GpRect *rects,
- INT count);
-
-GpStatus WINGDIPAPI
-GdipDrawEllipse(GpGraphics *graphics, GpPen *pen, REAL x, REAL y,
- REAL width, REAL height);
-
-GpStatus WINGDIPAPI
-GdipDrawEllipseI(GpGraphics *graphics, GpPen *pen, INT x, INT y,
- INT width, INT height);
-
-GpStatus WINGDIPAPI
-GdipDrawPie(GpGraphics *graphics, GpPen *pen, REAL x, REAL y,
- REAL width, REAL height, REAL startAngle, REAL sweepAngle);
-
-GpStatus WINGDIPAPI
-GdipDrawPieI(GpGraphics *graphics, GpPen *pen, INT x, INT y,
- INT width, INT height, REAL startAngle, REAL sweepAngle);
-
-GpStatus WINGDIPAPI
-GdipDrawPolygon(GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *points,
- INT count);
-
-GpStatus WINGDIPAPI
-GdipDrawPolygonI(GpGraphics *graphics, GpPen *pen, GDIPCONST GpPoint *points,
- INT count);
-
-GpStatus WINGDIPAPI
-GdipDrawPath(GpGraphics *graphics, GpPen *pen, GpPath *path);
-
-GpStatus WINGDIPAPI
-GdipDrawCurve(GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *points,
- INT count);
-
-GpStatus WINGDIPAPI
-GdipDrawCurveI(GpGraphics *graphics, GpPen *pen, GDIPCONST GpPoint *points,
- INT count);
-
-GpStatus WINGDIPAPI
-GdipDrawCurve2(GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *points,
- INT count, REAL tension);
-
-GpStatus WINGDIPAPI
-GdipDrawCurve2I(GpGraphics *graphics, GpPen *pen, GDIPCONST GpPoint *points,
- INT count, REAL tension);
-
-GpStatus WINGDIPAPI
-GdipDrawCurve3(GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *points,
- INT count, INT offset, INT numberOfSegments, REAL tension);
-
-GpStatus WINGDIPAPI
-GdipDrawCurve3I(GpGraphics *graphics, GpPen *pen, GDIPCONST GpPoint *points,
- INT count, INT offset, INT numberOfSegments, REAL tension);
-
-GpStatus WINGDIPAPI
-GdipDrawClosedCurve(GpGraphics *graphics, GpPen *pen,
- GDIPCONST GpPointF *points, INT count);
-
-GpStatus WINGDIPAPI
-GdipDrawClosedCurveI(GpGraphics *graphics, GpPen *pen,
- GDIPCONST GpPoint *points, INT count);
-
-GpStatus WINGDIPAPI
-GdipDrawClosedCurve2(GpGraphics *graphics, GpPen *pen,
- GDIPCONST GpPointF *points, INT count, REAL tension);
-
-GpStatus WINGDIPAPI
-GdipDrawClosedCurve2I(GpGraphics *graphics, GpPen *pen,
- GDIPCONST GpPoint *points, INT count, REAL tension);
-
-GpStatus WINGDIPAPI
-GdipGraphicsClear(GpGraphics *graphics, ARGB color);
-
-GpStatus WINGDIPAPI
-GdipFillRectangle(GpGraphics *graphics, GpBrush *brush, REAL x, REAL y,
- REAL width, REAL height);
-
-GpStatus WINGDIPAPI
-GdipFillRectangleI(GpGraphics *graphics, GpBrush *brush, INT x, INT y,
- INT width, INT height);
-
-GpStatus WINGDIPAPI
-GdipFillRectangles(GpGraphics *graphics, GpBrush *brush,
- GDIPCONST GpRectF *rects, INT count);
-
-GpStatus WINGDIPAPI
-GdipFillRectanglesI(GpGraphics *graphics, GpBrush *brush,
- GDIPCONST GpRect *rects, INT count);
-
-GpStatus WINGDIPAPI
-GdipFillPolygon(GpGraphics *graphics, GpBrush *brush,
- GDIPCONST GpPointF *points, INT count, GpFillMode fillMode);
-
-GpStatus WINGDIPAPI
-GdipFillPolygonI(GpGraphics *graphics, GpBrush *brush,
- GDIPCONST GpPoint *points, INT count, GpFillMode fillMode);
-
-GpStatus WINGDIPAPI
-GdipFillPolygon2(GpGraphics *graphics, GpBrush *brush,
- GDIPCONST GpPointF *points, INT count);
-
-GpStatus WINGDIPAPI
-GdipFillPolygon2I(GpGraphics *graphics, GpBrush *brush,
- GDIPCONST GpPoint *points, INT count);
-
-GpStatus WINGDIPAPI
-GdipFillEllipse(GpGraphics *graphics, GpBrush *brush, REAL x, REAL y,
- REAL width, REAL height);
-
-GpStatus WINGDIPAPI
-GdipFillEllipseI(GpGraphics *graphics, GpBrush *brush, INT x, INT y,
- INT width, INT height);
-
-GpStatus WINGDIPAPI
-GdipFillPie(GpGraphics *graphics, GpBrush *brush, REAL x, REAL y,
- REAL width, REAL height, REAL startAngle, REAL sweepAngle);
-
-GpStatus WINGDIPAPI
-GdipFillPieI(GpGraphics *graphics, GpBrush *brush, INT x, INT y,
- INT width, INT height, REAL startAngle, REAL sweepAngle);
-
-GpStatus WINGDIPAPI
-GdipFillPath(GpGraphics *graphics, GpBrush *brush, GpPath *path);
-
-GpStatus WINGDIPAPI
-GdipFillClosedCurve(GpGraphics *graphics, GpBrush *brush,
- GDIPCONST GpPointF *points, INT count);
-
-GpStatus WINGDIPAPI
-GdipFillClosedCurveI(GpGraphics *graphics, GpBrush *brush,
- GDIPCONST GpPoint *points, INT count);
-
-GpStatus WINGDIPAPI
-GdipFillClosedCurve2(GpGraphics *graphics, GpBrush *brush,
- GDIPCONST GpPointF *points, INT count,
- REAL tension, GpFillMode fillMode);
-
-GpStatus WINGDIPAPI
-GdipFillClosedCurve2I(GpGraphics *graphics, GpBrush *brush,
- GDIPCONST GpPoint *points, INT count,
- REAL tension, GpFillMode fillMode);
-
-GpStatus WINGDIPAPI
-GdipFillRegion(GpGraphics *graphics, GpBrush *brush,
- GpRegion *region);
-
-GpStatus WINGDIPAPI
-GdipDrawImage(GpGraphics *graphics, GpImage *image, REAL x, REAL y);
-
-GpStatus WINGDIPAPI
-GdipDrawImageI(GpGraphics *graphics, GpImage *image, INT x, INT y);
-
-GpStatus WINGDIPAPI
-GdipDrawImageRect(GpGraphics *graphics, GpImage *image, REAL x, REAL y,
- REAL width, REAL height);
-
-GpStatus WINGDIPAPI
-GdipDrawImageRectI(GpGraphics *graphics, GpImage *image, INT x, INT y,
- INT width, INT height);
-
-GpStatus WINGDIPAPI
-GdipDrawImagePoints(GpGraphics *graphics, GpImage *image,
- GDIPCONST GpPointF *dstpoints, INT count);
-
-GpStatus WINGDIPAPI
-GdipDrawImagePointsI(GpGraphics *graphics, GpImage *image,
- GDIPCONST GpPoint *dstpoints, INT count);
-
-GpStatus WINGDIPAPI
-GdipDrawImagePointRect(GpGraphics *graphics, GpImage *image, REAL x,
- REAL y, REAL srcx, REAL srcy, REAL srcwidth,
- REAL srcheight, GpUnit srcUnit);
-
-GpStatus WINGDIPAPI
-GdipDrawImagePointRectI(GpGraphics *graphics, GpImage *image, INT x,
- INT y, INT srcx, INT srcy, INT srcwidth,
- INT srcheight, GpUnit srcUnit);
-
-GpStatus WINGDIPAPI
-GdipDrawImageRectRect(GpGraphics *graphics, GpImage *image, REAL dstx,
- REAL dsty, REAL dstwidth, REAL dstheight,
- REAL srcx, REAL srcy, REAL srcwidth, REAL srcheight,
- GpUnit srcUnit,
- GDIPCONST GpImageAttributes* imageAttributes,
- DrawImageAbort callback, VOID * callbackData);
-
-GpStatus WINGDIPAPI
-GdipDrawImageRectRectI(GpGraphics *graphics, GpImage *image, INT dstx,
- INT dsty, INT dstwidth, INT dstheight,
- INT srcx, INT srcy, INT srcwidth, INT srcheight,
- GpUnit srcUnit,
- GDIPCONST GpImageAttributes* imageAttributes,
- DrawImageAbort callback, VOID * callbackData);
-
-GpStatus WINGDIPAPI
-GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image,
- GDIPCONST GpPointF *points, INT count, REAL srcx,
- REAL srcy, REAL srcwidth, REAL srcheight,
- GpUnit srcUnit,
- GDIPCONST GpImageAttributes* imageAttributes,
- DrawImageAbort callback, VOID * callbackData);
-
-GpStatus WINGDIPAPI
-GdipDrawImagePointsRectI(GpGraphics *graphics, GpImage *image,
- GDIPCONST GpPoint *points, INT count, INT srcx,
- INT srcy, INT srcwidth, INT srcheight,
- GpUnit srcUnit,
- GDIPCONST GpImageAttributes* imageAttributes,
- DrawImageAbort callback, VOID * callbackData);
-
-GpStatus WINGDIPAPI
-GdipEnumerateMetafileDestPoint(
- GpGraphics * graphics,
- GDIPCONST GpMetafile * metafile,
- GDIPCONST PointF & destPoint,
- EnumerateMetafileProc callback,
- VOID * callbackData,
- GDIPCONST GpImageAttributes * imageAttributes
- );
-
-GpStatus WINGDIPAPI
-GdipEnumerateMetafileDestPointI(
- GpGraphics * graphics,
- GDIPCONST GpMetafile * metafile,
- GDIPCONST Point & destPoint,
- EnumerateMetafileProc callback,
- VOID * callbackData,
- GDIPCONST GpImageAttributes * imageAttributes
- );
-
-GpStatus WINGDIPAPI
-GdipEnumerateMetafileDestRect(
- GpGraphics * graphics,
- GDIPCONST GpMetafile * metafile,
- GDIPCONST RectF & destRect,
- EnumerateMetafileProc callback,
- VOID * callbackData,
- GDIPCONST GpImageAttributes * imageAttributes
- );
-
-GpStatus WINGDIPAPI
-GdipEnumerateMetafileDestRectI(
- GpGraphics * graphics,
- GDIPCONST GpMetafile * metafile,
- GDIPCONST Rect & destRect,
- EnumerateMetafileProc callback,
- VOID * callbackData,
- GDIPCONST GpImageAttributes * imageAttributes
- );
-
-GpStatus WINGDIPAPI
-GdipEnumerateMetafileDestPoints(
- GpGraphics * graphics,
- GDIPCONST GpMetafile * metafile,
- GDIPCONST PointF * destPoints,
- INT count,
- EnumerateMetafileProc callback,
- VOID * callbackData,
- GDIPCONST GpImageAttributes * imageAttributes
- );
-
-GpStatus WINGDIPAPI
-GdipEnumerateMetafileDestPointsI(
- GpGraphics * graphics,
- GDIPCONST GpMetafile * metafile,
- GDIPCONST Point * destPoints,
- INT count,
- EnumerateMetafileProc callback,
- VOID * callbackData,
- GDIPCONST GpImageAttributes * imageAttributes
- );
-
-GpStatus WINGDIPAPI
-GdipEnumerateMetafileSrcRectDestPoint(
- GpGraphics * graphics,
- GDIPCONST GpMetafile * metafile,
- GDIPCONST PointF & destPoint,
- GDIPCONST RectF & srcRect,
- Unit srcUnit,
- EnumerateMetafileProc callback,
- VOID * callbackData,
- GDIPCONST GpImageAttributes * imageAttributes
- );
-
-GpStatus WINGDIPAPI
-GdipEnumerateMetafileSrcRectDestPointI(
- GpGraphics * graphics,
- GDIPCONST GpMetafile * metafile,
- GDIPCONST Point & destPoint,
- GDIPCONST Rect & srcRect,
- Unit srcUnit,
- EnumerateMetafileProc callback,
- VOID * callbackData,
- GDIPCONST GpImageAttributes * imageAttributes
- );
-
-GpStatus WINGDIPAPI
-GdipEnumerateMetafileSrcRectDestRect(
- GpGraphics * graphics,
- GDIPCONST GpMetafile * metafile,
- GDIPCONST RectF & destRect,
- GDIPCONST RectF & srcRect,
- Unit srcUnit,
- EnumerateMetafileProc callback,
- VOID * callbackData,
- GDIPCONST GpImageAttributes * imageAttributes
- );
-
-GpStatus WINGDIPAPI
-GdipEnumerateMetafileSrcRectDestRectI(
- GpGraphics * graphics,
- GDIPCONST GpMetafile * metafile,
- GDIPCONST Rect & destRect,
- GDIPCONST Rect & srcRect,
- Unit srcUnit,
- EnumerateMetafileProc callback,
- VOID * callbackData,
- GDIPCONST GpImageAttributes * imageAttributes
- );
-
-GpStatus WINGDIPAPI
-GdipEnumerateMetafileSrcRectDestPoints(
- GpGraphics * graphics,
- GDIPCONST GpMetafile * metafile,
- GDIPCONST PointF * destPoints,
- INT count,
- GDIPCONST RectF & srcRect,
- Unit srcUnit,
- EnumerateMetafileProc callback,
- VOID * callbackData,
- GDIPCONST GpImageAttributes * imageAttributes
- );
-
-GpStatus WINGDIPAPI
-GdipEnumerateMetafileSrcRectDestPointsI(
- GpGraphics * graphics,
- GDIPCONST GpMetafile * metafile,
- GDIPCONST Point * destPoints,
- INT count,
- GDIPCONST Rect & srcRect,
- Unit srcUnit,
- EnumerateMetafileProc callback,
- VOID * callbackData,
- GDIPCONST GpImageAttributes * imageAttributes
- );
-
-GpStatus WINGDIPAPI
-GdipPlayMetafileRecord(
- GDIPCONST GpMetafile * metafile,
- EmfPlusRecordType recordType,
- UINT flags,
- UINT dataSize,
- GDIPCONST BYTE * data
- );
-
-GpStatus WINGDIPAPI
-GdipSetClipGraphics(GpGraphics *graphics, GpGraphics *srcgraphics,
- CombineMode combineMode);
-
-GpStatus WINGDIPAPI
-GdipSetClipRect(GpGraphics *graphics, REAL x, REAL y,
- REAL width, REAL height, CombineMode combineMode);
-
-GpStatus WINGDIPAPI
-GdipSetClipRectI(GpGraphics *graphics, INT x, INT y,
- INT width, INT height, CombineMode combineMode);
-
-GpStatus WINGDIPAPI
-GdipSetClipPath(GpGraphics *graphics, GpPath *path, CombineMode combineMode);
-
-GpStatus WINGDIPAPI
-GdipSetClipRegion(GpGraphics *graphics, GpRegion *region,
- CombineMode combineMode);
-
-GpStatus WINGDIPAPI
-GdipSetClipHrgn(GpGraphics *graphics, HRGN hRgn, CombineMode combineMode);
-
-GpStatus WINGDIPAPI
-GdipResetClip(GpGraphics *graphics);
-
-GpStatus WINGDIPAPI
-GdipTranslateClip(GpGraphics *graphics, REAL dx, REAL dy);
-
-GpStatus WINGDIPAPI
-GdipTranslateClipI(GpGraphics *graphics, INT dx, INT dy);
-
-GpStatus WINGDIPAPI
-GdipGetClip(GpGraphics *graphics, GpRegion *region);
-
-GpStatus WINGDIPAPI
-GdipGetClipBounds(GpGraphics *graphics, GpRectF *rect);
-
-GpStatus WINGDIPAPI
-GdipGetClipBoundsI(GpGraphics *graphics, GpRect *rect);
-
-GpStatus WINGDIPAPI
-GdipIsClipEmpty(GpGraphics *graphics, BOOL *result);
-
-GpStatus WINGDIPAPI
-GdipGetVisibleClipBounds(GpGraphics *graphics, GpRectF *rect);
-
-GpStatus WINGDIPAPI
-GdipGetVisibleClipBoundsI(GpGraphics *graphics, GpRect *rect);
-
-GpStatus WINGDIPAPI
-GdipIsVisibleClipEmpty(GpGraphics *graphics, BOOL *result);
-
-GpStatus WINGDIPAPI
-GdipIsVisiblePoint(GpGraphics *graphics, REAL x, REAL y,
- BOOL *result);
-
-GpStatus WINGDIPAPI
-GdipIsVisiblePointI(GpGraphics *graphics, INT x, INT y,
- BOOL *result);
-
-GpStatus WINGDIPAPI
-GdipIsVisibleRect(GpGraphics *graphics, REAL x, REAL y,
- REAL width, REAL height, BOOL *result);
-
-GpStatus WINGDIPAPI
-GdipIsVisibleRectI(GpGraphics *graphics, INT x, INT y,
- INT width, INT height, BOOL *result);
-
-GpStatus WINGDIPAPI
-GdipSaveGraphics(GpGraphics *graphics, GraphicsState *state);
-
-GpStatus WINGDIPAPI
-GdipRestoreGraphics(GpGraphics *graphics, GraphicsState state);
-
-GpStatus WINGDIPAPI
-GdipBeginContainer(GpGraphics *graphics, GDIPCONST GpRectF* dstrect,
- GDIPCONST GpRectF *srcrect, GpUnit unit, GraphicsContainer *state);
-
-GpStatus WINGDIPAPI
-GdipBeginContainerI(GpGraphics *graphics, GDIPCONST GpRect* dstrect,
- GDIPCONST GpRect *srcrect, GpUnit unit, GraphicsContainer *state);
-
-GpStatus WINGDIPAPI
-GdipBeginContainer2(GpGraphics *graphics, GraphicsContainer* state);
-
-GpStatus WINGDIPAPI
-GdipEndContainer(GpGraphics *graphics, GraphicsContainer state);
-
-GpStatus
-GdipGetMetafileHeaderFromWmf(
- HMETAFILE hWmf,
- GDIPCONST APMFileHeader * apmFileHeader,
- MetafileHeader * header
- );
-
-GpStatus
-WINGDIPAPI
-GdipGetMetafileHeaderFromEmf(
- HENHMETAFILE hEmf,
- MetafileHeader * header
- );
-
-GpStatus
-WINGDIPAPI
-GdipGetMetafileHeaderFromFile(
- GDIPCONST WCHAR* filename,
- MetafileHeader * header
- );
-
-GpStatus
-WINGDIPAPI
-GdipGetMetafileHeaderFromStream(
- IStream * stream,
- MetafileHeader * header
- );
-
-GpStatus
-WINGDIPAPI
-GdipGetMetafileHeaderFromMetafile(
- GpMetafile * metafile,
- MetafileHeader * header
- );
-
-GpStatus
-WINGDIPAPI
-GdipGetHemfFromMetafile(
- GpMetafile * metafile,
- HENHMETAFILE * hEmf
- );
-
-GpStatus WINGDIPAPI
-GdipCreateStreamOnFile(GDIPCONST WCHAR * filename, UINT access, IStream **stream);
-
-GpStatus WINGDIPAPI
-GdipCreateMetafileFromWmf(HMETAFILE hWmf, BOOL deleteWmf,
- GDIPCONST APMFileHeader * apmFileHeader, GpMetafile **metafile);
-
-GpStatus WINGDIPAPI
-GdipCreateMetafileFromEmf(HENHMETAFILE hEmf, BOOL deleteEmf,
- GpMetafile **metafile);
-
-GpStatus WINGDIPAPI
-GdipCreateMetafileFromFile(GDIPCONST WCHAR* file, GpMetafile **metafile);
-
-GpStatus WINGDIPAPI
-GdipCreateMetafileFromWmfFile(GDIPCONST WCHAR* file, GDIPCONST APMFileHeader * apmFileHeader, GpMetafile **metafile);
-
-GpStatus WINGDIPAPI
-GdipCreateMetafileFromStream(IStream * stream, GpMetafile **metafile);
-
-GpStatus WINGDIPAPI
-GdipRecordMetafile(
- HDC referenceHdc,
- EmfType type,
- GDIPCONST GpRectF * frameRect,
- MetafileFrameUnit frameUnit,
- GDIPCONST WCHAR * description,
- GpMetafile ** metafile
- );
-
-GpStatus WINGDIPAPI
-GdipRecordMetafileI(
- HDC referenceHdc,
- EmfType type,
- GDIPCONST GpRect * frameRect,
- MetafileFrameUnit frameUnit,
- GDIPCONST WCHAR * description,
- GpMetafile ** metafile
- );
-
-GpStatus WINGDIPAPI
-GdipRecordMetafileFileName(
- GDIPCONST WCHAR* fileName,
- HDC referenceHdc,
- EmfType type,
- GDIPCONST GpRectF * frameRect,
- MetafileFrameUnit frameUnit,
- GDIPCONST WCHAR * description,
- GpMetafile ** metafile
- );
-
-GpStatus WINGDIPAPI
-GdipRecordMetafileFileNameI(
- GDIPCONST WCHAR* fileName,
- HDC referenceHdc,
- EmfType type,
- GDIPCONST GpRect * frameRect,
- MetafileFrameUnit frameUnit,
- GDIPCONST WCHAR * description,
- GpMetafile ** metafile
- );
-
-GpStatus WINGDIPAPI
-GdipRecordMetafileStream(
- IStream * stream,
- HDC referenceHdc,
- EmfType type,
- GDIPCONST GpRectF * frameRect,
- MetafileFrameUnit frameUnit,
- GDIPCONST WCHAR * description,
- GpMetafile ** metafile
- );
-
-GpStatus WINGDIPAPI
-GdipRecordMetafileStreamI(
- IStream * stream,
- HDC referenceHdc,
- EmfType type,
- GDIPCONST GpRect * frameRect,
- MetafileFrameUnit frameUnit,
- GDIPCONST WCHAR * description,
- GpMetafile ** metafile
- );
-
-GpStatus WINGDIPAPI
-GdipSetMetafileDownLevelRasterizationLimit(
- GpMetafile * metafile,
- UINT metafileRasterizationLimitDpi
- );
-
-GpStatus WINGDIPAPI
-GdipGetMetafileDownLevelRasterizationLimit(
- GDIPCONST GpMetafile * metafile,
- UINT * metafileRasterizationLimitDpi
- );
-
-GpStatus WINGDIPAPI
-GdipGetImageDecodersSize(UINT *numDecoders, UINT *size);
-
-GpStatus WINGDIPAPI
-GdipGetImageDecoders(UINT numDecoders,
- UINT size,
- ImageCodecInfo *decoders);
-
-GpStatus WINGDIPAPI
-GdipGetImageEncodersSize(UINT *numEncoders, UINT *size);
-
-GpStatus WINGDIPAPI
-GdipGetImageEncoders(UINT numEncoders,
- UINT size,
- ImageCodecInfo *encoders);
-
-GpStatus WINGDIPAPI
-GdipAddImageCodec(GDIPCONST ImageCodecInfo *codec);
-
-GpStatus WINGDIPAPI
-GdipRemoveImageCodec(GDIPCONST ImageCodecInfo *codec);
-
-#ifndef DCR_USE_NEW_186091
-GpStatus WINGDIPAPI
-GdipGetGraphicsPixel(GpGraphics* graphics, REAL x, REAL y, ARGB* argb);
-#endif
-
-GpStatus WINGDIPAPI
-GdipComment(GpGraphics* graphics, UINT sizeData, GDIPCONST BYTE * data);
-
-GpStatus WINGDIPAPI
-GdipGetGraphicsLayout(GpGraphics* graphics, GraphicsLayout* layout);
-
-GpStatus WINGDIPAPI
-GdipSetGraphicsLayout(GpGraphics* graphics, GDIPCONST GraphicsLayout layout);
-
-//----------------------------------------------------------------------------
-// FontFamily
-//----------------------------------------------------------------------------
-
-GpStatus WINGDIPAPI
-GdipCreateFontFamilyFromName(GDIPCONST WCHAR *name,
- GpFontCollection *fontCollection,
- GpFontFamily **FontFamily);
-
-GpStatus WINGDIPAPI
-GdipDeleteFontFamily(GpFontFamily *FontFamily);
-
-GpStatus WINGDIPAPI
-GdipCloneFontFamily(GpFontFamily *FontFamily, GpFontFamily **clonedFontFamily);
-
-GpStatus WINGDIPAPI
-GdipGetGenericFontFamilySansSerif(GpFontFamily **nativeFamily);
-
-GpStatus WINGDIPAPI
-GdipGetGenericFontFamilySerif(GpFontFamily **nativeFamily);
-
-GpStatus WINGDIPAPI
-GdipGetGenericFontFamilyMonospace(GpFontFamily **nativeFamily);
-
-
-GpStatus WINGDIPAPI
-GdipGetFamilyName(
- GDIPCONST GpFontFamily *family,
- WCHAR name[LF_FACESIZE],
- LANGID language
-);
-
-GpStatus WINGDIPAPI
-GdipIsStyleAvailable(GDIPCONST GpFontFamily *family, INT style, BOOL * IsStyleAvailable);
-
-GpStatus WINGDIPAPI
-GdipFontCollectionEnumerable(
- GpFontCollection* fontCollection,
- GpGraphics* graphics,
- INT * numFound
-);
-
-GpStatus WINGDIPAPI GdipFontCollectionEnumerate(
- GpFontCollection* fontCollection,
- INT numSought,
- GpFontFamily* gpfamilies[],
- INT* numFound,
- GpGraphics* graphics
-);
-
-//-----------------------------------
-// New API
-//-----------------------------------
-
-GpStatus WINGDIPAPI
-GdipGetEmHeight(GDIPCONST GpFontFamily *family, INT style, UINT16 * EmHeight);
-
-GpStatus WINGDIPAPI
-GdipGetCellAscent(GDIPCONST GpFontFamily *family, INT style, UINT16 * CellAscent);
-
-GpStatus WINGDIPAPI
-GdipGetCellDescent(GDIPCONST GpFontFamily *family, INT style, UINT16 * CellDescent);
-
-GpStatus WINGDIPAPI
-GdipGetLineSpacing(GDIPCONST GpFontFamily *family, INT style, UINT16 * LineSpacing);
-
-
-//----------------------------------------------------------------------------
-// Font
-//----------------------------------------------------------------------------
-
-GpStatus WINGDIPAPI
-GdipCreateFontFromDC(
- HDC hdc,
- GpFont **font
-);
-
-GpStatus WINGDIPAPI
-GdipCreateFontFromLogfontA(
- HDC hdc,
- GDIPCONST LOGFONTA *logfont,
- GpFont **font
-);
-
-GpStatus WINGDIPAPI
-GdipCreateFontFromLogfontW(
- HDC hdc,
- GDIPCONST LOGFONTW *logfont,
- GpFont **font
-);
-
-GpStatus WINGDIPAPI
-GdipCreateFont(
- GDIPCONST GpFontFamily *fontFamily,
- REAL emSize,
- INT style,
- Unit unit,
- GpFont **font
-);
-
-GpStatus WINGDIPAPI
-GdipCloneFont(GpFont* font, GpFont** cloneFont);
-
-GpStatus WINGDIPAPI
-GdipDeleteFont(GpFont* font);
-
-GpStatus WINGDIPAPI
-GdipGetFamily(GpFont *font, GpFontFamily **family);
-
-GpStatus WINGDIPAPI
-GdipGetFontStyle(GpFont *font, INT *style);
-
-GpStatus WINGDIPAPI
-GdipGetFontSize(GpFont *font, REAL *size);
-
-GpStatus WINGDIPAPI
-GdipGetFontUnit(GpFont *font, Unit *unit);
-
-GpStatus WINGDIPAPI
-GdipGetFontHeight(GDIPCONST GpFont *font, GDIPCONST GpGraphics *graphics, REAL *height);
-
-#ifdef DCR_USE_NEW_125467
-GpStatus WINGDIPAPI
-GdipGetFontHeightGivenDPI(GDIPCONST GpFont *font, REAL dpi, REAL *height);
-#endif
-
-GpStatus WINGDIPAPI
-GdipGetLogFontA(GpFont * font, GpGraphics *graphics, LOGFONTA * logfontA);
-
-GpStatus WINGDIPAPI
-GdipGetLogFontW(GpFont * font, GpGraphics *graphics, LOGFONTW * logfontW);
-
-// FontCollection
-
-GpStatus WINGDIPAPI
-GdipNewInstalledFontCollection(GpFontCollection** fontCollection);
-
-GpStatus WINGDIPAPI
-GdipNewPrivateFontCollection(GpFontCollection** fontCollection);
-
-GpStatus WINGDIPAPI
-GdipDeletePrivateFontCollection(GpFontCollection** fontCollection);
-
-GpStatus WINGDIPAPI
-GdipGetFontCollectionFamilyCount(
- GpFontCollection* fontCollection,
- INT * numFound
-);
-
-GpStatus WINGDIPAPI
-GdipGetFontCollectionFamilyList(
- GpFontCollection* fontCollection,
- INT numSought,
- GpFontFamily* gpfamilies[],
- INT* numFound
-);
-
-#ifndef DCR_USE_NEW_235072
-GpStatus WINGDIPAPI
-GdipInstallFontFile(
- GpFontCollection* fontCollection,
- GDIPCONST WCHAR* filename
-);
-
-GpStatus WINGDIPAPI
-GdipUninstallFontFile(
- GpFontCollection* fontCollection,
- GDIPCONST WCHAR* filename
-);
-#endif
-
-GpStatus WINGDIPAPI
-GdipPrivateAddFontFile(
- GpFontCollection* fontCollection,
- GDIPCONST WCHAR* filename
-);
-
-GpStatus WINGDIPAPI
-GdipPrivateAddMemoryFont(
- GpFontCollection* fontCollection,
- GDIPCONST void* memory,
- INT length
-);
-
-//----------------------------------------------------------------------------
-// Text
-//----------------------------------------------------------------------------
-
-GpStatus WINGDIPAPI
-GdipDrawString(
- GpGraphics *graphics,
- GDIPCONST WCHAR *string,
- INT length,
- GDIPCONST GpFont *font,
- GDIPCONST RectF *layoutRect,
- GDIPCONST GpStringFormat *stringFormat,
- GDIPCONST GpBrush *brush
-);
-
-GpStatus WINGDIPAPI
-GdipMeasureString(
- GpGraphics *graphics,
- GDIPCONST WCHAR *string,
- INT length,
- GDIPCONST GpFont *font,
- GDIPCONST RectF *layoutRect,
- GDIPCONST GpStringFormat *stringFormat,
- RectF *boundingBox,
- INT *codepointsFitted,
- INT *linesFilled
-);
-
-#ifndef DCR_USE_NEW_174340
-GpStatus WINGDIPAPI
-GdipMeasureStringRegion(
- GpGraphics *graphics,
- GDIPCONST WCHAR *string,
- INT length,
- GDIPCONST GpFont *font,
- GDIPCONST RectF &layoutRect,
- GDIPCONST GpStringFormat *stringFormat,
- INT firstCharacterIndex,
- INT characterCount,
- GpRegion *region
-);
-#endif
-
-#ifdef DCR_USE_NEW_174340
-GpStatus
-WINGDIPAPI
-GdipMeasureCharacterRanges(
- GpGraphics *graphics,
- GDIPCONST WCHAR *string,
- INT length,
- GDIPCONST GpFont *font,
- GDIPCONST RectF &layoutRect,
- GDIPCONST GpStringFormat *stringFormat,
- INT regionCount,
- GpRegion **regions
-);
-#endif
-
-GpStatus WINGDIPAPI
-GdipDrawDriverString(
- GpGraphics *graphics,
- GDIPCONST UINT16 *text,
- INT length,
- GDIPCONST GpFont *font,
- GDIPCONST GpBrush *brush,
- GDIPCONST PointF *positions,
- INT flags,
- GDIPCONST GpMatrix *matrix
-);
-
-GpStatus WINGDIPAPI
-GdipMeasureDriverString(
- GpGraphics *graphics,
- GDIPCONST UINT16 *text,
- INT length,
- GDIPCONST GpFont *font,
- GDIPCONST PointF *positions,
- INT flags,
- GDIPCONST GpMatrix *matrix,
- RectF *boundingBox
-);
-
-#ifndef DCR_USE_NEW_168772
-GpStatus WINGDIPAPI
-GdipDriverStringPointToCodepoint(
- GpGraphics *graphics,
- GDIPCONST UINT16 *text,
- INT length,
- GDIPCONST GpFont *font,
- GDIPCONST PointF *positions,
- INT flags,
- GpMatrix *matrix,
- GDIPCONST PointF *hit,
- INT *index,
- BOOL *rightEdge,
- REAL *distance
-);
-#endif
-
-//----------------------------------------------------------------------------
-// String format APIs
-//----------------------------------------------------------------------------
-
-GpStatus WINGDIPAPI
-GdipCreateStringFormat(
- INT formatAttributes,
- LANGID language,
- GpStringFormat **format
-);
-
-GpStatus WINGDIPAPI
-GdipStringFormatGetGenericDefault(GpStringFormat **format);
-
-GpStatus WINGDIPAPI
-GdipStringFormatGetGenericTypographic(GpStringFormat **format);
-
-GpStatus WINGDIPAPI
-GdipDeleteStringFormat(GpStringFormat *format);
-
-GpStatus WINGDIPAPI
-GdipCloneStringFormat(GDIPCONST GpStringFormat *format, GpStringFormat **newFormat);
-
-GpStatus WINGDIPAPI
-GdipSetStringFormatFlags(GpStringFormat *format, INT flags);
-
-GpStatus WINGDIPAPI GdipGetStringFormatFlags(GDIPCONST GpStringFormat *format, INT *flags);
-
-#ifndef DCR_USE_NEW_152154
-GpStatus WINGDIPAPI
-GdipSetStringFormatLineSpacing(GpStringFormat *format, REAL amount,
- LineSpacing method);
-
-GpStatus WINGDIPAPI
-GdipGetStringFormatLineSpacingAmount(GDIPCONST GpStringFormat *format, REAL *amount);
-GpStatus WINGDIPAPI
-GdipGetStringFormatLineSpacingMethod(GDIPCONST GpStringFormat *format, LineSpacing *method);
-#endif
-
-GpStatus WINGDIPAPI
-GdipSetStringFormatAlign(GpStringFormat *format, StringAlignment align);
-
-GpStatus WINGDIPAPI
-GdipGetStringFormatAlign(GDIPCONST GpStringFormat *format, StringAlignment *align);
-
-GpStatus WINGDIPAPI
-GdipSetStringFormatLineAlign(GpStringFormat *format,
- StringAlignment align);
-
-GpStatus WINGDIPAPI
-GdipGetStringFormatLineAlign(GDIPCONST GpStringFormat *format,
- StringAlignment *align);
-
-GpStatus WINGDIPAPI
-GdipSetStringFormatTrimming(
- GpStringFormat *format,
- StringTrimming trimming
-);
-
-GpStatus WINGDIPAPI
-GdipGetStringFormatTrimming(
- GDIPCONST GpStringFormat *format,
- StringTrimming *trimming
-);
-
-GpStatus WINGDIPAPI
-GdipSetStringFormatHotkeyPrefix(GpStringFormat *format, INT hotkeyPrefix);
-
-GpStatus WINGDIPAPI
-GdipGetStringFormatHotkeyPrefix(GDIPCONST GpStringFormat *format, INT *hotkeyPrefix);
-
-GpStatus WINGDIPAPI
-GdipSetStringFormatTabStops(GpStringFormat *format, REAL firstTabOffset, INT count, GDIPCONST REAL *tabStops);
-
-GpStatus WINGDIPAPI
-GdipGetStringFormatTabStops(GDIPCONST GpStringFormat *format, INT count, REAL *firstTabOffset, REAL *tabStops);
-
-GpStatus WINGDIPAPI
-GdipGetStringFormatTabStopCount(GDIPCONST GpStringFormat *format, INT * count);
-
-#ifdef DCR_USE_NEW_146933
-GpStatus WINGDIPAPI
-GdipSetStringFormatDigitSubstitution(GpStringFormat *format, LANGID language,
- StringDigitSubstitute substitute);
-
-GpStatus WINGDIPAPI
-GdipGetStringFormatDigitSubstitution(GDIPCONST GpStringFormat *format, LANGID *language,
- StringDigitSubstitute *substitute);
-#endif // DCR_USE_NEW_146933
-
-#ifdef DCR_USE_NEW_174340
-GpStatus WINGDIPAPI
-GdipGetStringFormatMeasurableCharacterRangeCount(
- GDIPCONST GpStringFormat *format,
- INT *count
-);
-
-GpStatus WINGDIPAPI
-GdipSetStringFormatMeasurableCharacterRanges(
- GpStringFormat *format,
- INT rangeCount,
- GDIPCONST CharacterRange *ranges
-);
-#endif
-
-//----------------------------------------------------------------------------
-// Cached Bitmap APIs
-//----------------------------------------------------------------------------
-
-GpStatus WINGDIPAPI
-GdipCreateCachedBitmap(
- GpBitmap *bitmap,
- GpGraphics *graphics,
- GpCachedBitmap **cachedBitmap
-);
-
-GpStatus WINGDIPAPI
-GdipDeleteCachedBitmap(GpCachedBitmap *cachedBitmap);
-
-GpStatus WINGDIPAPI
-GdipDrawCachedBitmap(
- GpGraphics *graphics,
- GpCachedBitmap *cachedBitmap,
- INT x,
- INT y
-);
-
-UINT WINGDIPAPI
-GdipEmfToWmfBits(
- HENHMETAFILE hemf,
- UINT cbData16,
- LPBYTE pData16,
- INT iMapMode,
- INT eFlags
-);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // !_FLATAPI_H
+/**************************************************************************\
+*
+* Copyright (c) 1998-2000, Microsoft Corp. All Rights Reserved.
+*
+* Module Name:
+*
+* GdiplusFlat.h
+*
+* Abstract:
+*
+* Flat GDI+ API wrappers - header file
+*
+\**************************************************************************/
+
+// TODO: this file style needs to be made internally consistent with the way
+// it handles breaking the long argument lists across multiple lines
+
+#ifndef _FLATAPI_H
+#define _FLATAPI_H
+
+#define WINGDIPAPI __stdcall
+
+// currently, only C++ wrapper API's force const.
+
+#define GDIPCONST const
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef DCR_USE_NEW_175866
+
+VOID
+WINGDIPAPI
+GdipDisplayPaletteWindowNotify(WindowNotifyEnum notify);
+
+#endif
+
+//----------------------------------------------------------------------------
+// GraphicsPath methods
+//----------------------------------------------------------------------------
+
+GpStatus WINGDIPAPI
+GdipCreatePath(GpFillMode brushMode, GpPath **path);
+
+GpStatus WINGDIPAPI
+GdipCreatePath2(GDIPCONST GpPointF*, GDIPCONST BYTE*, INT, GpFillMode,
+ GpPath **path);
+
+GpStatus WINGDIPAPI
+GdipCreatePath2I(GDIPCONST GpPoint*, GDIPCONST BYTE*, INT, GpFillMode,
+ GpPath **path);
+
+GpStatus WINGDIPAPI
+GdipClonePath(GpPath* path, GpPath **clonePath);
+
+GpStatus WINGDIPAPI
+GdipDeletePath(GpPath* path);
+
+GpStatus WINGDIPAPI
+GdipResetPath(GpPath* path);
+
+GpStatus WINGDIPAPI
+GdipGetPointCount(GpPath* path, INT* count);
+
+GpStatus WINGDIPAPI
+GdipGetPathTypes(GpPath* path, BYTE* types, INT count);
+
+GpStatus WINGDIPAPI
+GdipGetPathPoints(GpPath*, GpPointF* points, INT count);
+
+GpStatus WINGDIPAPI
+GdipGetPathPointsI(GpPath*, GpPoint* points, INT count);
+
+GpStatus WINGDIPAPI
+GdipGetPathFillMode(GpPath *path, GpFillMode *fillmode);
+
+GpStatus WINGDIPAPI
+GdipSetPathFillMode(GpPath *path, GpFillMode fillmode);
+
+GpStatus WINGDIPAPI
+GdipGetPathData(GpPath *path, GpPathData* pathData);
+
+GpStatus WINGDIPAPI
+GdipStartPathFigure(GpPath *path);
+
+GpStatus WINGDIPAPI
+GdipClosePathFigure(GpPath *path);
+
+GpStatus WINGDIPAPI
+GdipClosePathFigures(GpPath *path);
+
+GpStatus WINGDIPAPI
+GdipSetPathMarker(GpPath* path);
+
+GpStatus WINGDIPAPI
+GdipClearPathMarkers(GpPath* path);
+
+GpStatus WINGDIPAPI
+GdipReversePath(GpPath* path);
+
+GpStatus WINGDIPAPI
+GdipGetPathLastPoint(GpPath* path, GpPointF* lastPoint);
+
+GpStatus WINGDIPAPI
+GdipAddPathLine(GpPath *path, REAL x1, REAL y1, REAL x2, REAL y2);
+
+GpStatus WINGDIPAPI
+GdipAddPathLine2(GpPath *path, GDIPCONST GpPointF *points, INT count);
+
+GpStatus WINGDIPAPI
+GdipAddPathArc(GpPath *path, REAL x, REAL y, REAL width, REAL height,
+ REAL startAngle, REAL sweepAngle);
+
+GpStatus WINGDIPAPI
+GdipAddPathBezier(GpPath *path, REAL x1, REAL y1, REAL x2, REAL y2,
+ REAL x3, REAL y3, REAL x4, REAL y4);
+
+GpStatus WINGDIPAPI
+GdipAddPathBeziers(GpPath *path, GDIPCONST GpPointF *points, INT count);
+
+GpStatus WINGDIPAPI
+GdipAddPathCurve(GpPath *path, GDIPCONST GpPointF *points, INT count);
+
+GpStatus WINGDIPAPI
+GdipAddPathCurve2(GpPath *path, GDIPCONST GpPointF *points, INT count,
+ REAL tension);
+
+GpStatus WINGDIPAPI
+GdipAddPathCurve3(GpPath *path, GDIPCONST GpPointF *points, INT count,
+ INT offset, INT numberOfSegments, REAL tension);
+
+GpStatus WINGDIPAPI
+GdipAddPathClosedCurve(GpPath *path, GDIPCONST GpPointF *points, INT count);
+
+GpStatus WINGDIPAPI
+GdipAddPathClosedCurve2(GpPath *path, GDIPCONST GpPointF *points, INT count,
+ REAL tension);
+
+GpStatus WINGDIPAPI
+GdipAddPathRectangle(GpPath *path, REAL x, REAL y, REAL width, REAL height);
+
+GpStatus WINGDIPAPI
+GdipAddPathRectangles(GpPath *path, GDIPCONST GpRectF *rects, INT count);
+
+GpStatus WINGDIPAPI
+GdipAddPathEllipse(GpPath *path, REAL x, REAL y, REAL width,
+ REAL height);
+
+GpStatus WINGDIPAPI
+GdipAddPathPie(GpPath *path, REAL x, REAL y, REAL width, REAL height,
+ REAL startAngle, REAL sweepAngle);
+
+GpStatus WINGDIPAPI
+GdipAddPathPolygon(GpPath *path, GDIPCONST GpPointF *points, INT count);
+
+GpStatus WINGDIPAPI
+GdipAddPathPath(GpPath *path, GDIPCONST GpPath* addingPath, BOOL connect);
+
+GpStatus WINGDIPAPI
+GdipAddPathString(GpPath *path, GDIPCONST WCHAR *string,
+ INT length, GDIPCONST GpFontFamily *family, INT style,
+ REAL emSize, GDIPCONST RectF *layoutRect,
+ GDIPCONST GpStringFormat *format);
+
+GpStatus WINGDIPAPI
+GdipAddPathStringI(GpPath *path, GDIPCONST WCHAR *string,
+ INT length, GDIPCONST GpFontFamily *family, INT style,
+ REAL emSize, GDIPCONST Rect *layoutRect,
+ GDIPCONST GpStringFormat *format);
+
+GpStatus WINGDIPAPI
+GdipAddPathLineI(GpPath *path, INT x1, INT y1, INT x2, INT y2);
+
+GpStatus WINGDIPAPI
+GdipAddPathLine2I(GpPath *path, GDIPCONST GpPoint *points, INT count);
+
+GpStatus WINGDIPAPI
+GdipAddPathArcI(GpPath *path, INT x, INT y, INT width, INT height,
+ REAL startAngle, REAL sweepAngle);
+
+GpStatus WINGDIPAPI
+GdipAddPathBezierI(GpPath *path, INT x1, INT y1, INT x2, INT y2,
+ INT x3, INT y3, INT x4, INT y4);
+
+GpStatus WINGDIPAPI
+GdipAddPathBeziersI(GpPath *path, GDIPCONST GpPoint *points, INT count);
+
+GpStatus WINGDIPAPI
+GdipAddPathCurveI(GpPath *path, GDIPCONST GpPoint *points, INT count);
+
+GpStatus WINGDIPAPI
+GdipAddPathCurve2I(GpPath *path, GDIPCONST GpPoint *points, INT count,
+ REAL tension);
+
+GpStatus WINGDIPAPI
+GdipAddPathCurve3I(GpPath *path, GDIPCONST GpPoint *points, INT count,
+ INT offset, INT numberOfSegments, REAL tension);
+
+GpStatus WINGDIPAPI
+GdipAddPathClosedCurveI(GpPath *path, GDIPCONST GpPoint *points, INT count);
+
+GpStatus WINGDIPAPI
+GdipAddPathClosedCurve2I(GpPath *path, GDIPCONST GpPoint *points, INT count,
+ REAL tension);
+
+GpStatus WINGDIPAPI
+GdipAddPathRectangleI(GpPath *path, INT x, INT y, INT width, INT height);
+
+GpStatus WINGDIPAPI
+GdipAddPathRectanglesI(GpPath *path, GDIPCONST GpRect *rects, INT count);
+
+GpStatus WINGDIPAPI
+GdipAddPathEllipseI(GpPath *path, INT x, INT y, INT width, INT height);
+
+GpStatus WINGDIPAPI
+GdipAddPathPieI(GpPath *path, INT x, INT y, INT width, INT height,
+ REAL startAngle, REAL sweepAngle);
+
+GpStatus WINGDIPAPI
+GdipAddPathPolygonI(GpPath *path, GDIPCONST GpPoint *points, INT count);
+
+GpStatus WINGDIPAPI
+GdipFlattenPath(GpPath *path, GpMatrix* matrix, REAL flatness);
+
+GpStatus WINGDIPAPI
+GdipWindingModeOutline(
+ GpPath *path,
+ GpMatrix *matrix,
+ REAL flatness
+);
+
+
+#ifdef DCR_USE_NEW_202903
+
+GpStatus WINGDIPAPI
+GdipWidenPath(
+ GpPath *nativePath,
+ GpPen *pen,
+ GpMatrix *matrix,
+ REAL flatness
+);
+
+#else
+
+GpStatus WINGDIPAPI
+GdipWidenPathWithMinimumResolutions(GpPath *path, GpPen *pen, REAL minXres,
+ REAL minYres, GpMatrix *matrix, BOOL removeSelftIntersects);
+
+#endif
+
+GpStatus WINGDIPAPI
+GdipWarpPath(GpPath *path, GpMatrix* matrix,
+ GDIPCONST GpPointF *points, INT count,
+ REAL srcx, REAL srcy, REAL srcwidth, REAL srcheight,
+ WarpMode warpMode, REAL flatness);
+
+GpStatus WINGDIPAPI
+GdipTransformPath(GpPath* path, GpMatrix* matrix);
+
+GpStatus WINGDIPAPI
+GdipGetPathWorldBounds(GpPath* path, GpRectF* bounds, GDIPCONST GpMatrix *matrix,
+ GDIPCONST GpPen *pen);
+
+GpStatus WINGDIPAPI
+GdipGetPathWorldBoundsI(GpPath* path, GpRect* bounds, GDIPCONST GpMatrix *matrix,
+ GDIPCONST GpPen *pen);
+
+GpStatus WINGDIPAPI
+GdipIsVisiblePathPoint(GpPath* path, REAL x, REAL y,
+ GpGraphics *graphics, BOOL *result);
+
+GpStatus WINGDIPAPI
+GdipIsVisiblePathPointI(GpPath* path, INT x, INT y,
+ GpGraphics *graphics, BOOL *result);
+
+GpStatus WINGDIPAPI
+GdipIsOutlineVisiblePathPoint(GpPath* path, REAL x, REAL y, GpPen *pen,
+ GpGraphics *graphics, BOOL *result);
+
+GpStatus WINGDIPAPI
+GdipIsOutlineVisiblePathPointI(GpPath* path, INT x, INT y, GpPen *pen,
+ GpGraphics *graphics, BOOL *result);
+
+
+//----------------------------------------------------------------------------
+// Path Enumeration methods
+//----------------------------------------------------------------------------
+
+GpStatus WINGDIPAPI
+GdipCreatePathIter(GpPathIterator **iterator, GpPath* path);
+
+GpStatus WINGDIPAPI
+GdipDeletePathIter(GpPathIterator *iterator);
+
+GpStatus WINGDIPAPI
+GdipPathIterNextSubpath(GpPathIterator* iterator, INT *resultCount,
+ INT* startIndex, INT* endIndex, BOOL* isClosed);
+
+GpStatus WINGDIPAPI
+GdipPathIterNextSubpathPath(GpPathIterator* iterator, INT* resultCount,
+ GpPath* path, BOOL* isClosed);
+
+GpStatus WINGDIPAPI
+GdipPathIterNextPathType(GpPathIterator* iterator, INT* resultCount,
+ BYTE* pathType, INT* startIndex, INT* endIndex);
+
+GpStatus WINGDIPAPI
+GdipPathIterNextMarker(GpPathIterator* iterator, INT *resultCount,
+ INT* startIndex, INT* endIndex);
+
+GpStatus WINGDIPAPI
+GdipPathIterNextMarkerPath(GpPathIterator* iterator, INT* resultCount,
+ GpPath* path);
+
+GpStatus WINGDIPAPI
+GdipPathIterGetCount(GpPathIterator* iterator, INT* count);
+
+GpStatus WINGDIPAPI
+GdipPathIterGetSubpathCount(GpPathIterator* iterator, INT* count);
+
+GpStatus WINGDIPAPI
+GdipPathIterIsValid(GpPathIterator* iterator, BOOL* valid);
+
+GpStatus WINGDIPAPI
+GdipPathIterHasCurve(GpPathIterator* iterator, BOOL* hasCurve);
+
+GpStatus WINGDIPAPI
+GdipPathIterRewind(GpPathIterator* iterator);
+
+GpStatus WINGDIPAPI
+GdipPathIterEnumerate(GpPathIterator* iterator, INT* resultCount,
+ GpPointF *points, BYTE *types, INT count);
+
+GpStatus WINGDIPAPI
+GdipPathIterCopyData(GpPathIterator* iterator, INT* resultCount,
+ GpPointF* points, BYTE* types, INT startIndex, INT endIndex);
+
+//----------------------------------------------------------------------------
+// Matrix methods
+//----------------------------------------------------------------------------
+
+GpStatus WINGDIPAPI
+GdipCreateMatrix(GpMatrix **matrix);
+
+GpStatus WINGDIPAPI
+GdipCreateMatrix2(REAL m11, REAL m12, REAL m21, REAL m22, REAL dx,
+ REAL dy, GpMatrix **matrix);
+
+GpStatus WINGDIPAPI
+GdipCreateMatrix3(GDIPCONST GpRectF *rect, GDIPCONST GpPointF *dstplg,
+ GpMatrix **matrix);
+
+GpStatus WINGDIPAPI
+GdipCreateMatrix3I(GDIPCONST GpRect *rect, GDIPCONST GpPoint *dstplg,
+ GpMatrix **matrix);
+
+GpStatus WINGDIPAPI
+GdipCloneMatrix(GpMatrix *matrix, GpMatrix **cloneMatrix);
+
+GpStatus WINGDIPAPI
+GdipDeleteMatrix(GpMatrix *matrix);
+
+GpStatus WINGDIPAPI
+GdipSetMatrixElements(GpMatrix *matrix, REAL m11, REAL m12, REAL m21, REAL m22,
+ REAL dx, REAL dy);
+
+GpStatus WINGDIPAPI
+GdipMultiplyMatrix(GpMatrix *matrix, GpMatrix* matrix2,
+ GpMatrixOrder order);
+
+GpStatus WINGDIPAPI
+GdipTranslateMatrix(GpMatrix *matrix, REAL offsetX, REAL offsetY,
+ GpMatrixOrder order);
+
+GpStatus WINGDIPAPI
+GdipScaleMatrix(GpMatrix *matrix, REAL scaleX, REAL scaleY,
+ GpMatrixOrder order);
+
+GpStatus WINGDIPAPI
+GdipRotateMatrix(GpMatrix *matrix, REAL angle, GpMatrixOrder order);
+
+GpStatus WINGDIPAPI
+GdipShearMatrix(GpMatrix *matrix, REAL shearX, REAL shearY,
+ GpMatrixOrder order);
+
+GpStatus WINGDIPAPI
+GdipInvertMatrix(GpMatrix *matrix);
+
+GpStatus WINGDIPAPI
+GdipTransformMatrixPoints(GpMatrix *matrix, GpPointF *pts, INT count);
+
+GpStatus WINGDIPAPI
+GdipTransformMatrixPointsI(GpMatrix *matrix, GpPoint *pts, INT count);
+
+GpStatus WINGDIPAPI
+GdipVectorTransformMatrixPoints(GpMatrix *matrix, GpPointF *pts,
+ INT count);
+
+GpStatus WINGDIPAPI
+GdipVectorTransformMatrixPointsI(GpMatrix *matrix, GpPoint *pts,
+ INT count);
+
+GpStatus WINGDIPAPI
+GdipGetMatrixElements(GDIPCONST GpMatrix *matrix, REAL *matrixOut);
+
+GpStatus WINGDIPAPI
+GdipIsMatrixInvertible(GDIPCONST GpMatrix *matrix, BOOL *result);
+
+GpStatus WINGDIPAPI
+GdipIsMatrixIdentity(GDIPCONST GpMatrix *matrix, BOOL *result);
+
+GpStatus WINGDIPAPI
+GdipIsMatrixEqual(GDIPCONST GpMatrix *matrix, GDIPCONST GpMatrix *matrix2, BOOL *result);
+
+//----------------------------------------------------------------------------
+// Region methods
+//----------------------------------------------------------------------------
+
+GpStatus WINGDIPAPI
+GdipCreateRegion(GpRegion **region);
+
+GpStatus WINGDIPAPI
+GdipCreateRegionRect(GDIPCONST GpRectF *rect, GpRegion **region);
+
+GpStatus WINGDIPAPI
+GdipCreateRegionRectI(GDIPCONST GpRect *rect, GpRegion **region);
+
+GpStatus WINGDIPAPI
+GdipCreateRegionPath(GpPath *path, GpRegion **region);
+
+GpStatus WINGDIPAPI
+GdipCreateRegionRgnData(GDIPCONST BYTE *regionData, INT size, GpRegion **region);
+
+GpStatus WINGDIPAPI
+GdipCreateRegionHrgn(HRGN hRgn, GpRegion **region);
+
+GpStatus WINGDIPAPI
+GdipCloneRegion(GpRegion *region, GpRegion **cloneRegion);
+
+GpStatus WINGDIPAPI
+GdipDeleteRegion(GpRegion *region);
+
+GpStatus WINGDIPAPI
+GdipSetInfinite(GpRegion *region);
+
+GpStatus WINGDIPAPI
+GdipSetEmpty(GpRegion *region);
+
+GpStatus WINGDIPAPI
+GdipCombineRegionRect(GpRegion *region, GDIPCONST GpRectF *rect,
+ CombineMode combineMode);
+
+GpStatus WINGDIPAPI
+GdipCombineRegionRectI(GpRegion *region, GDIPCONST GpRect *rect,
+ CombineMode combineMode);
+
+GpStatus WINGDIPAPI
+GdipCombineRegionPath(GpRegion *region, GpPath *path, CombineMode combineMode);
+
+GpStatus WINGDIPAPI
+GdipCombineRegionRegion(GpRegion *region, GpRegion *region2,
+ CombineMode combineMode);
+
+GpStatus WINGDIPAPI
+GdipTranslateRegion(GpRegion *region, REAL dx, REAL dy);
+
+GpStatus WINGDIPAPI
+GdipTranslateRegionI(GpRegion *region, INT dx, INT dy);
+
+GpStatus WINGDIPAPI
+GdipTransformRegion(GpRegion *region, GpMatrix *matrix);
+
+GpStatus WINGDIPAPI
+GdipGetRegionBounds(GpRegion *region, GpGraphics *graphics,
+ GpRectF *rect);
+
+GpStatus WINGDIPAPI
+GdipGetRegionBoundsI(GpRegion *region, GpGraphics *graphics,
+ GpRect *rect);
+
+GpStatus WINGDIPAPI
+GdipGetRegionHRgn(GpRegion *region, GpGraphics *graphics, HRGN *hRgn);
+
+GpStatus WINGDIPAPI
+GdipIsEmptyRegion(GpRegion *region, GpGraphics *graphics,
+ BOOL *result);
+
+GpStatus WINGDIPAPI
+GdipIsInfiniteRegion(GpRegion *region, GpGraphics *graphics,
+ BOOL *result);
+
+GpStatus WINGDIPAPI
+GdipIsEqualRegion(GpRegion *region, GpRegion *region2,
+ GpGraphics *graphics, BOOL *result);
+
+GpStatus WINGDIPAPI
+GdipGetRegionDataSize(GpRegion *region, UINT * bufferSize);
+
+GpStatus WINGDIPAPI
+GdipGetRegionData(GpRegion *region, BYTE * buffer, UINT bufferSize, UINT * sizeFilled);
+
+GpStatus WINGDIPAPI
+GdipIsVisibleRegionPoint(GpRegion *region, REAL x, REAL y,
+ GpGraphics *graphics, BOOL *result);
+
+GpStatus WINGDIPAPI
+GdipIsVisibleRegionPointI(GpRegion *region, INT x, INT y,
+ GpGraphics *graphics, BOOL *result);
+
+GpStatus WINGDIPAPI
+GdipIsVisibleRegionRect(GpRegion *region, REAL x, REAL y, REAL width,
+ REAL height, GpGraphics *graphics, BOOL *result);
+
+GpStatus WINGDIPAPI
+GdipIsVisibleRegionRectI(GpRegion *region, INT x, INT y, INT width,
+ INT height, GpGraphics *graphics, BOOL *result);
+
+GpStatus WINGDIPAPI
+GdipGetRegionScansCount(GpRegion *region, UINT* count, GpMatrix* matrix);
+
+GpStatus WINGDIPAPI
+GdipGetRegionScans(GpRegion *region, GpRectF* rects, INT* count, GpMatrix* matrix);
+
+GpStatus WINGDIPAPI
+GdipGetRegionScansI(GpRegion *region, GpRect* rects, INT* count, GpMatrix* matrix);
+
+//----------------------------------------------------------------------------
+// Brush methods
+//----------------------------------------------------------------------------
+
+GpStatus WINGDIPAPI
+GdipCloneBrush(GpBrush *brush, GpBrush **cloneBrush);
+
+GpStatus WINGDIPAPI
+GdipDeleteBrush(GpBrush *brush);
+
+GpStatus WINGDIPAPI
+GdipGetBrushType(GpBrush *brush, GpBrushType *type);
+
+//----------------------------------------------------------------------------
+// Hatch Brush methods
+//----------------------------------------------------------------------------
+
+GpStatus WINGDIPAPI
+GdipCreateHatchBrush(GpHatchStyle hatchstyle, ARGB forecol,
+ ARGB backcol, GpHatch **brush);
+
+GpStatus WINGDIPAPI
+GdipGetHatchStyle(GpHatch *brush, GpHatchStyle *hatchstyle);
+
+GpStatus WINGDIPAPI
+GdipGetHatchForegroundColor(GpHatch *brush, ARGB* forecol);
+
+GpStatus WINGDIPAPI
+GdipGetHatchBackgroundColor(GpHatch *brush, ARGB* backcol);
+
+//----------------------------------------------------------------------------
+// Texture Brush methods
+//----------------------------------------------------------------------------
+
+GpStatus WINGDIPAPI
+GdipCreateTexture(GpImage *image, GpWrapMode wrapmode,
+ GpTexture **texture);
+
+GpStatus WINGDIPAPI
+GdipCreateTexture2(GpImage *image, GpWrapMode wrapmode, REAL x,
+ REAL y, REAL width, REAL height, GpTexture **texture);
+
+GpStatus WINGDIPAPI
+GdipCreateTextureIA(GpImage *image, GDIPCONST GpImageAttributes *imageAttributes,
+ REAL x, REAL y, REAL width, REAL height,
+ GpTexture **texture);
+
+GpStatus WINGDIPAPI
+GdipCreateTexture2I(GpImage *image, GpWrapMode wrapmode, INT x,
+ INT y, INT width, INT height, GpTexture **texture);
+
+GpStatus WINGDIPAPI
+GdipCreateTextureIAI(GpImage *image, GDIPCONST GpImageAttributes *imageAttributes,
+ INT x, INT y, INT width, INT height,
+ GpTexture **texture);
+
+
+GpStatus WINGDIPAPI
+GdipGetTextureTransform(GpTexture *brush, GpMatrix *matrix);
+
+GpStatus WINGDIPAPI
+GdipSetTextureTransform(GpTexture *brush, GDIPCONST GpMatrix *matrix);
+
+GpStatus WINGDIPAPI
+GdipResetTextureTransform(GpTexture* brush);
+
+GpStatus WINGDIPAPI
+GdipMultiplyTextureTransform(GpTexture* brush, GDIPCONST GpMatrix *matrix,
+ GpMatrixOrder order);
+
+GpStatus WINGDIPAPI
+GdipTranslateTextureTransform(GpTexture* brush, REAL dx, REAL dy,
+ GpMatrixOrder order);
+
+GpStatus WINGDIPAPI
+GdipScaleTextureTransform(GpTexture* brush, REAL sx, REAL sy,
+ GpMatrixOrder order);
+
+GpStatus WINGDIPAPI
+GdipRotateTextureTransform(GpTexture* brush, REAL angle, GpMatrixOrder order);
+
+GpStatus WINGDIPAPI
+GdipSetTextureWrapMode(GpTexture *brush, GpWrapMode wrapmode);
+
+GpStatus WINGDIPAPI
+GdipGetTextureWrapMode(GpTexture *brush, GpWrapMode *wrapmode);
+
+GpStatus WINGDIPAPI
+GdipGetTextureImage(GpTexture *brush, GpImage **image);
+
+//----------------------------------------------------------------------------
+// Solid Brush methods
+//----------------------------------------------------------------------------
+
+GpStatus WINGDIPAPI
+GdipCreateSolidFill(ARGB color, GpSolidFill **brush);
+
+GpStatus WINGDIPAPI
+GdipSetSolidFillColor(GpSolidFill *brush, ARGB color);
+
+GpStatus WINGDIPAPI
+GdipGetSolidFillColor(GpSolidFill *brush, ARGB *color);
+
+//----------------------------------------------------------------------------
+// LineBrush methods
+//----------------------------------------------------------------------------
+
+GpStatus WINGDIPAPI
+GdipCreateLineBrush(GDIPCONST GpPointF* point1,
+ GDIPCONST GpPointF* point2,
+ ARGB color1, ARGB color2,
+ GpWrapMode wrapMode,
+ GpLineGradient **lineGradient);
+
+GpStatus WINGDIPAPI
+GdipCreateLineBrushI(GDIPCONST GpPoint* point1,
+ GDIPCONST GpPoint* point2,
+ ARGB color1, ARGB color2,
+ GpWrapMode wrapMode,
+ GpLineGradient **lineGradient);
+
+GpStatus WINGDIPAPI
+GdipCreateLineBrushFromRect(GDIPCONST GpRectF* rect,
+ ARGB color1, ARGB color2,
+ LinearGradientMode mode,
+ GpWrapMode wrapMode,
+ GpLineGradient **lineGradient);
+
+GpStatus WINGDIPAPI
+GdipCreateLineBrushFromRectI(GDIPCONST GpRect* rect,
+ ARGB color1, ARGB color2,
+ LinearGradientMode mode,
+ GpWrapMode wrapMode,
+ GpLineGradient **lineGradient);
+
+GpStatus WINGDIPAPI
+GdipCreateLineBrushFromRectWithAngle(GDIPCONST GpRectF* rect,
+ ARGB color1, ARGB color2,
+ REAL angle,
+ BOOL isAngleScalable,
+ GpWrapMode wrapMode,
+ GpLineGradient **lineGradient);
+
+GpStatus WINGDIPAPI
+GdipCreateLineBrushFromRectWithAngleI(GDIPCONST GpRect* rect,
+ ARGB color1, ARGB color2,
+ REAL angle,
+ BOOL isAngleScalable,
+ GpWrapMode wrapMode,
+ GpLineGradient **lineGradient);
+
+GpStatus WINGDIPAPI
+GdipSetLinePoints(GpLineGradient *brush,
+ GDIPCONST GpPointF* point1,
+ GDIPCONST GpPointF* point2);
+
+GpStatus WINGDIPAPI
+GdipSetLinePointsI(GpLineGradient *brush,
+ GDIPCONST GpPoint* point1,
+ GDIPCONST GpPoint* point2);
+
+GpStatus WINGDIPAPI
+GdipGetLinePoints(GpLineGradient *brush, GpPointF* points);
+
+GpStatus WINGDIPAPI
+GdipGetLinePointsI(GpLineGradient *brush, GpPoint* points);
+
+GpStatus WINGDIPAPI
+GdipSetLineColors(GpLineGradient *brush, ARGB color1, ARGB color2);
+
+GpStatus WINGDIPAPI
+GdipGetLineColors(GpLineGradient *brush, ARGB* colors);
+
+GpStatus WINGDIPAPI
+GdipGetLineRect(GpLineGradient *brush, GpRectF *rect);
+
+GpStatus WINGDIPAPI
+GdipGetLineRectI(GpLineGradient *brush, GpRect *rect);
+
+GpStatus WINGDIPAPI
+GdipSetLineGammaCorrection(GpLineGradient *brush, BOOL useGammaCorrection);
+
+GpStatus WINGDIPAPI
+GdipGetLineGammaCorrection(GpLineGradient *brush, BOOL *useGammaCorrection);
+
+GpStatus WINGDIPAPI
+GdipGetLineBlendCount(GpLineGradient *brush, INT *count);
+
+GpStatus WINGDIPAPI
+GdipGetLineBlend(GpLineGradient *brush, REAL *blend, REAL* positions,
+ INT count);
+
+GpStatus WINGDIPAPI
+GdipSetLineBlend(GpLineGradient *brush, GDIPCONST REAL *blend,
+ GDIPCONST REAL* positions, INT count);
+
+GpStatus WINGDIPAPI
+GdipGetLinePresetBlendCount(GpLineGradient *brush, INT *count);
+
+GpStatus WINGDIPAPI
+GdipGetLinePresetBlend(GpLineGradient *brush, ARGB *blend,
+ REAL* positions, INT count);
+
+GpStatus WINGDIPAPI
+GdipSetLinePresetBlend(GpLineGradient *brush, GDIPCONST ARGB *blend,
+ GDIPCONST REAL* positions, INT count);
+
+GpStatus WINGDIPAPI
+GdipSetLineSigmaBlend(GpLineGradient *brush, REAL focus, REAL scale);
+
+GpStatus WINGDIPAPI
+GdipSetLineLinearBlend(GpLineGradient *brush, REAL focus, REAL scale);
+
+GpStatus WINGDIPAPI
+GdipSetLineWrapMode(GpLineGradient *brush, GpWrapMode wrapmode);
+
+GpStatus WINGDIPAPI
+GdipGetLineWrapMode(GpLineGradient *brush, GpWrapMode *wrapmode);
+
+GpStatus WINGDIPAPI
+GdipGetLineTransform(GpLineGradient *brush, GpMatrix *matrix);
+
+GpStatus WINGDIPAPI
+GdipSetLineTransform(GpLineGradient *brush, GDIPCONST GpMatrix *matrix);
+
+GpStatus WINGDIPAPI
+GdipResetLineTransform(GpLineGradient* brush);
+
+GpStatus WINGDIPAPI
+GdipMultiplyLineTransform(GpLineGradient* brush, GDIPCONST GpMatrix *matrix,
+ GpMatrixOrder order);
+
+GpStatus WINGDIPAPI
+GdipTranslateLineTransform(GpLineGradient* brush, REAL dx, REAL dy,
+ GpMatrixOrder order);
+
+GpStatus WINGDIPAPI
+GdipScaleLineTransform(GpLineGradient* brush, REAL sx, REAL sy,
+ GpMatrixOrder order);
+
+GpStatus WINGDIPAPI
+GdipRotateLineTransform(GpLineGradient* brush, REAL angle, GpMatrixOrder order);
+
+//----------------------------------------------------------------------------
+// PathGradient Brush
+//----------------------------------------------------------------------------
+
+GpStatus WINGDIPAPI
+GdipCreatePathGradient(GDIPCONST GpPointF* points,
+ INT count,
+ GpWrapMode wrapMode,
+ GpPathGradient **polyGradient);
+
+GpStatus WINGDIPAPI
+GdipCreatePathGradientI(GDIPCONST GpPoint* points,
+ INT count,
+ GpWrapMode wrapMode,
+ GpPathGradient **polyGradient);
+
+GpStatus WINGDIPAPI
+GdipCreatePathGradientFromPath(GDIPCONST GpPath* path,
+ GpPathGradient **polyGradient);
+
+GpStatus WINGDIPAPI
+GdipGetPathGradientCenterColor(
+ GpPathGradient *brush, ARGB* colors);
+
+GpStatus WINGDIPAPI
+GdipSetPathGradientCenterColor(
+ GpPathGradient *brush, ARGB colors);
+
+GpStatus WINGDIPAPI
+GdipGetPathGradientSurroundColorsWithCount(
+ GpPathGradient *brush, ARGB* color, INT* count);
+
+GpStatus WINGDIPAPI
+GdipSetPathGradientSurroundColorsWithCount(
+ GpPathGradient *brush,
+ GDIPCONST ARGB* color, INT* count);
+
+GpStatus WINGDIPAPI
+GdipGetPathGradientPath(GpPathGradient *brush, GpPath *path);
+
+GpStatus WINGDIPAPI
+GdipSetPathGradientPath(GpPathGradient *brush, GDIPCONST GpPath *path);
+
+GpStatus WINGDIPAPI
+GdipGetPathGradientCenterPoint(
+ GpPathGradient *brush, GpPointF* points);
+
+GpStatus WINGDIPAPI
+GdipGetPathGradientCenterPointI(
+ GpPathGradient *brush, GpPoint* points);
+
+GpStatus WINGDIPAPI
+GdipSetPathGradientCenterPoint(
+ GpPathGradient *brush, GDIPCONST GpPointF* points);
+
+GpStatus WINGDIPAPI
+GdipSetPathGradientCenterPointI(
+ GpPathGradient *brush, GDIPCONST GpPoint* points);
+
+GpStatus WINGDIPAPI
+GdipGetPathGradientRect(GpPathGradient *brush, GpRectF *rect);
+
+GpStatus WINGDIPAPI
+GdipGetPathGradientRectI(GpPathGradient *brush, GpRect *rect);
+
+GpStatus WINGDIPAPI
+GdipGetPathGradientPointCount(GpPathGradient *brush, INT* count);
+
+GpStatus WINGDIPAPI
+GdipGetPathGradientSurroundColorCount(GpPathGradient *brush, INT* count);
+
+GpStatus WINGDIPAPI
+GdipSetPathGradientGammaCorrection(GpPathGradient *brush, BOOL useGammaCorrection);
+
+GpStatus WINGDIPAPI
+GdipGetPathGradientGammaCorrection(GpPathGradient *brush, BOOL *useGammaCorrection);
+
+GpStatus WINGDIPAPI
+GdipGetPathGradientBlendCount(GpPathGradient *brush,
+ INT *count);
+
+GpStatus WINGDIPAPI
+GdipGetPathGradientBlend(GpPathGradient *brush,
+ REAL *blend, REAL *positions, INT count);
+
+GpStatus WINGDIPAPI
+GdipSetPathGradientBlend(GpPathGradient *brush,
+ GDIPCONST REAL *blend, GDIPCONST REAL *positions, INT count);
+
+GpStatus WINGDIPAPI
+GdipGetPathGradientPresetBlendCount(GpPathGradient *brush, INT *count);
+
+GpStatus WINGDIPAPI
+GdipGetPathGradientPresetBlend(GpPathGradient *brush, ARGB *blend,
+ REAL* positions, INT count);
+
+GpStatus WINGDIPAPI
+GdipSetPathGradientPresetBlend(GpPathGradient *brush, GDIPCONST ARGB *blend,
+ GDIPCONST REAL* positions, INT count);
+
+GpStatus WINGDIPAPI
+GdipSetPathGradientSigmaBlend(GpPathGradient *brush, REAL focus, REAL scale);
+
+GpStatus WINGDIPAPI
+GdipSetPathGradientLinearBlend(GpPathGradient *brush, REAL focus, REAL scale);
+
+GpStatus WINGDIPAPI
+GdipGetPathGradientWrapMode(GpPathGradient *brush,
+ GpWrapMode *wrapmode);
+
+GpStatus WINGDIPAPI
+GdipSetPathGradientWrapMode(GpPathGradient *brush,
+ GpWrapMode wrapmode);
+
+GpStatus WINGDIPAPI
+GdipGetPathGradientTransform(GpPathGradient *brush,
+ GpMatrix *matrix);
+
+GpStatus WINGDIPAPI
+GdipSetPathGradientTransform(GpPathGradient *brush,
+ GpMatrix *matrix);
+
+GpStatus WINGDIPAPI
+GdipResetPathGradientTransform(GpPathGradient* brush);
+
+GpStatus WINGDIPAPI
+GdipMultiplyPathGradientTransform(GpPathGradient* brush, GDIPCONST GpMatrix *matrix,
+ GpMatrixOrder order);
+
+GpStatus WINGDIPAPI
+GdipTranslatePathGradientTransform(GpPathGradient* brush, REAL dx, REAL dy,
+ GpMatrixOrder order);
+
+GpStatus WINGDIPAPI
+GdipScalePathGradientTransform(GpPathGradient* brush, REAL sx, REAL sy,
+ GpMatrixOrder order);
+
+GpStatus WINGDIPAPI
+GdipRotatePathGradientTransform(GpPathGradient* brush, REAL angle,
+ GpMatrixOrder order);
+
+GpStatus WINGDIPAPI
+GdipGetPathGradientFocusScales(GpPathGradient *brush, REAL* xScale, REAL* yScale);
+
+GpStatus WINGDIPAPI
+GdipSetPathGradientFocusScales(GpPathGradient *brush, REAL xScale, REAL yScale);
+
+//----------------------------------------------------------------------------
+// Pen methods
+//----------------------------------------------------------------------------
+
+GpStatus WINGDIPAPI
+GdipCreatePen1(ARGB color, REAL width, GpUnit unit, GpPen **pen);
+
+GpStatus WINGDIPAPI
+GdipCreatePen2(GpBrush *brush, REAL width, GpUnit unit,
+ GpPen **pen);
+
+GpStatus WINGDIPAPI
+GdipClonePen(GpPen *pen, GpPen **clonepen);
+
+GpStatus WINGDIPAPI
+GdipDeletePen(GpPen *pen);
+
+GpStatus WINGDIPAPI
+GdipSetPenWidth(GpPen *pen, REAL width);
+
+GpStatus WINGDIPAPI
+GdipGetPenWidth(GpPen *pen, REAL *width);
+
+GpStatus WINGDIPAPI
+GdipSetPenUnit(GpPen *pen, GpUnit unit);
+
+GpStatus WINGDIPAPI
+GdipGetPenUnit(GpPen *pen, GpUnit *unit);
+
+#ifdef DCR_USE_NEW_197819
+GpStatus WINGDIPAPI
+GdipSetPenLineCap197819(GpPen *pen, GpLineCap startCap, GpLineCap endCap,
+ GpDashCap dashCap);
+#else
+GpStatus WINGDIPAPI
+GdipSetPenLineCap(GpPen *pen, GpLineCap startCap, GpLineCap endCap,
+ GpLineCap dashCap);
+#endif // DCR_USE_NEW_197819
+
+
+GpStatus WINGDIPAPI
+GdipSetPenStartCap(GpPen *pen, GpLineCap startCap);
+
+GpStatus WINGDIPAPI
+GdipSetPenEndCap(GpPen *pen, GpLineCap endCap);
+
+#ifdef DCR_USE_NEW_197819
+GpStatus WINGDIPAPI
+GdipSetPenDashCap197819(GpPen *pen, GpDashCap dashCap);
+#else
+GpStatus WINGDIPAPI
+GdipSetPenDashCap(GpPen *pen, GpLineCap dashCap);
+#endif // DCR_USE_NEW_197819
+
+GpStatus WINGDIPAPI
+GdipGetPenStartCap(GpPen *pen, GpLineCap *startCap);
+
+GpStatus WINGDIPAPI
+GdipGetPenEndCap(GpPen *pen, GpLineCap *endCap);
+
+#ifdef DCR_USE_NEW_197819
+GpStatus WINGDIPAPI
+GdipGetPenDashCap197819(GpPen *pen, GpDashCap *dashCap);
+#else
+GpStatus WINGDIPAPI
+GdipGetPenDashCap(GpPen *pen, GpLineCap *dashCap);
+#endif // DCR_USE_NEW_197819
+
+GpStatus WINGDIPAPI
+GdipSetPenLineJoin(GpPen *pen, GpLineJoin lineJoin);
+
+GpStatus WINGDIPAPI
+GdipGetPenLineJoin(GpPen *pen, GpLineJoin *lineJoin);
+
+GpStatus WINGDIPAPI
+GdipSetPenCustomStartCap(GpPen *pen, GpCustomLineCap* customCap);
+
+GpStatus WINGDIPAPI
+GdipGetPenCustomStartCap(GpPen *pen, GpCustomLineCap** customCap);
+
+GpStatus WINGDIPAPI
+GdipSetPenCustomEndCap(GpPen *pen, GpCustomLineCap* customCap);
+
+GpStatus WINGDIPAPI
+GdipGetPenCustomEndCap(GpPen *pen, GpCustomLineCap** customCap);
+
+GpStatus WINGDIPAPI
+GdipSetPenMiterLimit(GpPen *pen, REAL miterLimit);
+
+GpStatus WINGDIPAPI
+GdipGetPenMiterLimit(GpPen *pen, REAL *miterLimit);
+
+GpStatus WINGDIPAPI
+GdipSetPenMode(GpPen *pen, GpPenAlignment penMode);
+
+GpStatus WINGDIPAPI
+GdipGetPenMode(GpPen *pen, GpPenAlignment *penMode);
+
+GpStatus WINGDIPAPI
+GdipSetPenTransform(GpPen *pen, GpMatrix *matrix);
+
+GpStatus WINGDIPAPI
+GdipGetPenTransform(GpPen *pen, GpMatrix *matrix);
+
+GpStatus WINGDIPAPI
+GdipResetPenTransform(GpPen *pen);
+
+GpStatus WINGDIPAPI
+GdipMultiplyPenTransform(GpPen *pen, GDIPCONST GpMatrix *matrix,
+ GpMatrixOrder order);
+
+GpStatus WINGDIPAPI
+GdipTranslatePenTransform(GpPen *pen, REAL dx, REAL dy,
+ GpMatrixOrder order);
+
+GpStatus WINGDIPAPI
+GdipScalePenTransform(GpPen *pen, REAL sx, REAL sy,
+ GpMatrixOrder order);
+
+GpStatus WINGDIPAPI
+GdipRotatePenTransform(GpPen *pen, REAL angle, GpMatrixOrder order);
+
+GpStatus WINGDIPAPI
+GdipSetPenColor(GpPen *pen, ARGB argb);
+
+GpStatus WINGDIPAPI
+GdipGetPenColor(GpPen *pen, ARGB *argb);
+
+GpStatus WINGDIPAPI
+GdipSetPenBrushFill(GpPen *pen, GpBrush *brush);
+
+GpStatus WINGDIPAPI
+GdipGetPenBrushFill(GpPen *pen, GpBrush **brush);
+
+GpStatus WINGDIPAPI
+GdipGetPenFillType(GpPen *pen, GpPenType* type);
+
+GpStatus WINGDIPAPI
+GdipGetPenDashStyle(GpPen *pen, GpDashStyle *dashstyle);
+
+GpStatus WINGDIPAPI
+GdipSetPenDashStyle(GpPen *pen, GpDashStyle dashstyle);
+
+GpStatus WINGDIPAPI
+GdipGetPenDashOffset(GpPen *pen, REAL *offset);
+
+GpStatus WINGDIPAPI
+GdipSetPenDashOffset(GpPen *pen, REAL offset);
+
+GpStatus WINGDIPAPI
+GdipGetPenDashCount(GpPen *pen, INT *count);
+
+GpStatus WINGDIPAPI
+GdipSetPenDashArray(GpPen *pen, GDIPCONST REAL *dash, INT count);
+
+GpStatus WINGDIPAPI
+GdipGetPenDashArray(GpPen *pen, REAL *dash, INT count);
+
+GpStatus WINGDIPAPI
+GdipGetPenCompoundCount(GpPen *pen, INT *count);
+
+GpStatus WINGDIPAPI
+GdipSetPenCompoundArray(GpPen *pen, GDIPCONST REAL *dash, INT count);
+
+GpStatus WINGDIPAPI
+GdipGetPenCompoundArray(GpPen *pen, REAL *dash, INT count);
+
+//----------------------------------------------------------------------------
+// CustomLineCap methods
+//----------------------------------------------------------------------------
+
+GpStatus WINGDIPAPI
+GdipCreateCustomLineCap(GpPath* fillPath, GpPath* strokePath,
+ GpLineCap baseCap, REAL baseInset, GpCustomLineCap **customCap);
+
+GpStatus WINGDIPAPI
+GdipDeleteCustomLineCap(GpCustomLineCap* customCap);
+
+GpStatus WINGDIPAPI
+GdipCloneCustomLineCap(GpCustomLineCap* customCap,
+ GpCustomLineCap** clonedCap);
+
+GpStatus WINGDIPAPI
+GdipGetCustomLineCapType(GpCustomLineCap* customCap,
+ CustomLineCapType* capType);
+
+GpStatus WINGDIPAPI
+GdipSetCustomLineCapStrokeCaps(GpCustomLineCap* customCap,
+ GpLineCap startCap, GpLineCap endCap);
+
+GpStatus WINGDIPAPI
+GdipGetCustomLineCapStrokeCaps(GpCustomLineCap* customCap,
+ GpLineCap* startCap, GpLineCap* endCap);
+
+GpStatus WINGDIPAPI
+GdipSetCustomLineCapStrokeJoin(GpCustomLineCap* customCap, GpLineJoin lineJoin);
+
+GpStatus WINGDIPAPI
+GdipGetCustomLineCapStrokeJoin(GpCustomLineCap* customCap, GpLineJoin* lineJoin);
+
+GpStatus WINGDIPAPI
+GdipSetCustomLineCapBaseCap(GpCustomLineCap* customCap, GpLineCap baseCap);
+
+GpStatus WINGDIPAPI
+GdipGetCustomLineCapBaseCap(GpCustomLineCap* customCap, GpLineCap* baseCap);
+
+GpStatus WINGDIPAPI
+GdipSetCustomLineCapBaseInset(GpCustomLineCap* customCap, REAL inset);
+
+GpStatus WINGDIPAPI
+GdipGetCustomLineCapBaseInset(GpCustomLineCap* customCap, REAL* inset);
+
+GpStatus WINGDIPAPI
+GdipSetCustomLineCapWidthScale(GpCustomLineCap* customCap, REAL widthScale);
+
+GpStatus WINGDIPAPI
+GdipGetCustomLineCapWidthScale(GpCustomLineCap* customCap, REAL* widthScale);
+
+//----------------------------------------------------------------------------
+// AdjustableArrowCap methods
+//----------------------------------------------------------------------------
+
+GpStatus WINGDIPAPI
+GdipCreateAdjustableArrowCap(REAL height, REAL width, BOOL isFilled,
+ GpAdjustableArrowCap **cap);
+
+GpStatus WINGDIPAPI
+GdipSetAdjustableArrowCapHeight(GpAdjustableArrowCap* cap, REAL height);
+
+GpStatus WINGDIPAPI
+GdipGetAdjustableArrowCapHeight(GpAdjustableArrowCap* cap, REAL* height);
+
+GpStatus WINGDIPAPI
+GdipSetAdjustableArrowCapWidth(GpAdjustableArrowCap* cap, REAL width);
+
+GpStatus WINGDIPAPI
+GdipGetAdjustableArrowCapWidth(GpAdjustableArrowCap* cap, REAL* width);
+
+GpStatus WINGDIPAPI
+GdipSetAdjustableArrowCapMiddleInset(GpAdjustableArrowCap* cap, REAL middleInset);
+
+GpStatus WINGDIPAPI
+GdipGetAdjustableArrowCapMiddleInset(GpAdjustableArrowCap* cap, REAL* middleInset);
+
+GpStatus WINGDIPAPI
+GdipSetAdjustableArrowCapFillState(GpAdjustableArrowCap* cap, BOOL fillState);
+
+GpStatus WINGDIPAPI
+GdipGetAdjustableArrowCapFillState(GpAdjustableArrowCap* cap, BOOL* fillState);
+
+//----------------------------------------------------------------------------
+// Image methods
+//----------------------------------------------------------------------------
+
+GpStatus WINGDIPAPI
+GdipLoadImageFromStream(IStream* stream, GpImage **image);
+
+GpStatus WINGDIPAPI
+GdipLoadImageFromFile(GDIPCONST WCHAR* filename, GpImage **image);
+
+GpStatus WINGDIPAPI
+GdipLoadImageFromStreamICM(IStream* stream, GpImage **image);
+
+GpStatus WINGDIPAPI
+GdipLoadImageFromFileICM(GDIPCONST WCHAR* filename, GpImage **image);
+
+GpStatus WINGDIPAPI
+GdipCloneImage(GpImage *image, GpImage **cloneImage);
+
+GpStatus WINGDIPAPI
+GdipDisposeImage(GpImage *image);
+
+GpStatus WINGDIPAPI
+GdipSaveImageToFile(GpImage *image, GDIPCONST WCHAR* filename,
+ GDIPCONST CLSID* clsidEncoder, GDIPCONST EncoderParameters* encoderParams);
+
+GpStatus WINGDIPAPI
+GdipSaveImageToStream(GpImage *image, IStream* stream,
+ GDIPCONST CLSID* clsidEncoder, GDIPCONST EncoderParameters* encoderParams);
+
+GpStatus WINGDIPAPI
+GdipSaveAdd(GpImage *image, GDIPCONST EncoderParameters* encoderParams);
+
+GpStatus WINGDIPAPI
+GdipSaveAddImage(GpImage *image, GpImage* newImage,
+ GDIPCONST EncoderParameters* encoderParams);
+
+GpStatus WINGDIPAPI
+GdipGetImageGraphicsContext(GpImage *image, GpGraphics **graphics);
+
+GpStatus WINGDIPAPI
+GdipGetImageBounds(GpImage *image, GpRectF *srcRect, GpUnit *srcUnit);
+
+GpStatus WINGDIPAPI
+GdipGetImageDimension(GpImage *image, REAL *width, REAL *height);
+
+GpStatus WINGDIPAPI
+GdipGetImageType(GpImage *image, ImageType *type);
+
+GpStatus WINGDIPAPI
+GdipGetImageWidth(GpImage *image, UINT *width);
+
+GpStatus WINGDIPAPI
+GdipGetImageHeight(GpImage *image, UINT *height);
+
+GpStatus WINGDIPAPI
+GdipGetImageHorizontalResolution(GpImage *image, REAL *resolution);
+
+GpStatus WINGDIPAPI
+GdipGetImageVerticalResolution(GpImage *image, REAL *resolution);
+
+GpStatus WINGDIPAPI
+GdipGetImageFlags(GpImage *image, UINT *flags);
+
+GpStatus WINGDIPAPI
+GdipGetImageRawFormat(GpImage *image, GUID *format);
+
+GpStatus WINGDIPAPI
+GdipGetImagePixelFormat(GpImage *image, PixelFormat *format);
+
+GpStatus WINGDIPAPI
+GdipGetImageThumbnail(GpImage *image, UINT thumbWidth, UINT thumbHeight,
+ GpImage **thumbImage,
+ GetThumbnailImageAbort callback, VOID * callbackData);
+
+GpStatus WINGDIPAPI
+GdipGetEncoderParameterListSize(GpImage *image, GDIPCONST CLSID* clsidEncoder,
+ UINT* size);
+
+GpStatus WINGDIPAPI
+GdipGetEncoderParameterList(GpImage *image, GDIPCONST CLSID* clsidEncoder,
+ UINT size, EncoderParameters* buffer);
+
+GpStatus WINGDIPAPI
+GdipImageGetFrameDimensionsCount(GpImage* image, UINT* count);
+
+GpStatus WINGDIPAPI
+GdipImageGetFrameDimensionsList(GpImage* image, GUID* dimensionIDs, UINT count);
+
+GpStatus WINGDIPAPI
+GdipImageGetFrameCount(GpImage *image, GDIPCONST GUID* dimensionID, UINT* count);
+
+GpStatus WINGDIPAPI
+GdipImageSelectActiveFrame(GpImage *image, GDIPCONST GUID* dimensionID,
+ UINT frameIndex);
+
+GpStatus WINGDIPAPI
+GdipImageRotateFlip(GpImage *image, RotateFlipType rfType);
+
+GpStatus WINGDIPAPI
+GdipGetImagePalette(GpImage *image, ColorPalette *palette, INT size);
+
+GpStatus WINGDIPAPI
+GdipSetImagePalette(GpImage *image, GDIPCONST ColorPalette *palette);
+
+GpStatus WINGDIPAPI
+GdipGetImagePaletteSize(GpImage *image, INT *size);
+
+GpStatus WINGDIPAPI
+GdipGetPropertyCount(GpImage *image, UINT* numOfProperty);
+
+GpStatus WINGDIPAPI
+GdipGetPropertyIdList(GpImage *image, UINT numOfProperty, PROPID* list);
+
+GpStatus WINGDIPAPI
+GdipGetPropertyItemSize(GpImage *image, PROPID propId, UINT* size);
+
+GpStatus WINGDIPAPI
+GdipGetPropertyItem(GpImage *image, PROPID propId,UINT propSize,
+ PropertyItem* buffer);
+
+GpStatus WINGDIPAPI
+GdipGetPropertySize(GpImage *image, UINT* totalBufferSize, UINT* numProperties);
+
+GpStatus WINGDIPAPI
+GdipGetAllPropertyItems(GpImage *image, UINT totalBufferSize,
+ UINT numProperties, PropertyItem* allItems);
+
+GpStatus WINGDIPAPI
+GdipRemovePropertyItem(GpImage *image, PROPID propId);
+
+GpStatus WINGDIPAPI
+GdipSetPropertyItem(GpImage *image, GDIPCONST PropertyItem* item);
+
+GpStatus WINGDIPAPI
+GdipImageForceValidation(GpImage *image);
+
+GpStatus WINGDIPAPI
+GdipGetImageLayout(GpImage *image, ImageLayout* layout);
+
+GpStatus WINGDIPAPI
+GdipSetImageLayout(GpImage *image, GDIPCONST ImageLayout layout);
+
+//----------------------------------------------------------------------------
+// Bitmap methods
+//----------------------------------------------------------------------------
+
+GpStatus WINGDIPAPI
+GdipCreateBitmapFromStream(IStream* stream, GpBitmap **bitmap);
+
+GpStatus WINGDIPAPI
+GdipCreateBitmapFromFile(GDIPCONST WCHAR* filename, GpBitmap **bitmap);
+
+GpStatus WINGDIPAPI
+GdipCreateBitmapFromStreamICM(IStream* stream, GpBitmap **bitmap);
+
+GpStatus WINGDIPAPI
+GdipCreateBitmapFromFileICM(GDIPCONST WCHAR* filename, GpBitmap **bitmap);
+
+GpStatus WINGDIPAPI
+GdipCreateBitmapFromScan0(INT width,
+ INT height,
+ INT stride,
+ PixelFormat format,
+ BYTE* scan0,
+ GpBitmap** bitmap);
+
+GpStatus WINGDIPAPI
+GdipCreateBitmapFromGraphics(INT width,
+ INT height,
+ GpGraphics* target,
+ GpBitmap** bitmap);
+
+GpStatus WINGDIPAPI
+GdipCreateBitmapFromDirectDrawSurface(IDirectDrawSurface7* surface,
+ GpBitmap** bitmap);
+
+GpStatus WINGDIPAPI
+GdipCreateBitmapFromGdiDib(GDIPCONST BITMAPINFO* gdiBitmapInfo,
+ VOID* gdiBitmapData,
+ GpBitmap** bitmap);
+
+GpStatus WINGDIPAPI
+GdipCreateBitmapFromHBITMAP(HBITMAP hbm,
+ HPALETTE hpal,
+ GpBitmap** bitmap);
+
+GpStatus WINGDIPAPI
+GdipCreateHBITMAPFromBitmap(GpBitmap* bitmap,
+ HBITMAP* hbmReturn,
+ ARGB background);
+
+GpStatus WINGDIPAPI
+GdipCreateBitmapFromHICON(HICON hicon,
+ GpBitmap** bitmap);
+
+GpStatus WINGDIPAPI
+GdipCreateHICONFromBitmap(GpBitmap* bitmap,
+ HICON* hbmReturn);
+
+GpStatus WINGDIPAPI
+GdipCreateBitmapFromResource(HINSTANCE hInstance,
+ GDIPCONST WCHAR* lpBitmapName,
+ GpBitmap** bitmap);
+
+GpStatus WINGDIPAPI
+GdipCloneBitmapArea(REAL x, REAL y, REAL width, REAL height,
+ PixelFormat format,
+ GpBitmap *srcBitmap,
+ GpBitmap **dstBitmap);
+
+GpStatus WINGDIPAPI
+GdipCloneBitmapAreaI(INT x,
+ INT y,
+ INT width,
+ INT height,
+ PixelFormat format,
+ GpBitmap *srcBitmap,
+ GpBitmap **dstBitmap);
+
+GpStatus WINGDIPAPI
+GdipBitmapLockBits(GpBitmap* bitmap,
+ GDIPCONST GpRect* rect,
+ UINT flags,
+ PixelFormat format,
+ BitmapData* lockedBitmapData);
+
+GpStatus WINGDIPAPI
+GdipBitmapUnlockBits(GpBitmap* bitmap,
+ BitmapData* lockedBitmapData);
+
+GpStatus WINGDIPAPI
+GdipBitmapGetPixel(GpBitmap* bitmap, INT x, INT y, ARGB *color);
+
+GpStatus WINGDIPAPI
+GdipBitmapSetPixel(GpBitmap* bitmap, INT x, INT y, ARGB color);
+
+GpStatus WINGDIPAPI
+GdipBitmapSetResolution(GpBitmap* bitmap, REAL xdpi, REAL ydpi);
+
+//----------------------------------------------------------------------------
+// ImageAttributes methods
+//----------------------------------------------------------------------------
+
+GpStatus WINGDIPAPI
+GdipCreateImageAttributes(GpImageAttributes **imageattr);
+
+GpStatus WINGDIPAPI
+GdipCloneImageAttributes(GDIPCONST GpImageAttributes *imageattr,
+ GpImageAttributes **cloneImageattr);
+
+GpStatus WINGDIPAPI
+GdipDisposeImageAttributes(GpImageAttributes *imageattr);
+
+GpStatus WINGDIPAPI
+GdipSetImageAttributesToIdentity(GpImageAttributes *imageattr,
+ ColorAdjustType type);
+GpStatus WINGDIPAPI
+GdipResetImageAttributes(GpImageAttributes *imageattr,
+ ColorAdjustType type);
+
+GpStatus WINGDIPAPI
+GdipSetImageAttributesColorMatrix(GpImageAttributes *imageattr,
+ ColorAdjustType type,
+ BOOL enableFlag,
+ GDIPCONST ColorMatrix* colorMatrix,
+ GDIPCONST ColorMatrix* grayMatrix,
+ ColorMatrixFlags flags);
+
+GpStatus WINGDIPAPI
+GdipSetImageAttributesThreshold(GpImageAttributes *imageattr,
+ ColorAdjustType type,
+ BOOL enableFlag,
+ REAL threshold);
+
+GpStatus WINGDIPAPI
+GdipSetImageAttributesGamma(GpImageAttributes *imageattr,
+ ColorAdjustType type,
+ BOOL enableFlag,
+ REAL gamma);
+
+GpStatus WINGDIPAPI
+GdipSetImageAttributesNoOp(GpImageAttributes *imageattr,
+ ColorAdjustType type,
+ BOOL enableFlag);
+
+GpStatus WINGDIPAPI
+GdipSetImageAttributesColorKeys(GpImageAttributes *imageattr,
+ ColorAdjustType type,
+ BOOL enableFlag,
+ ARGB colorLow,
+ ARGB colorHigh);
+
+GpStatus WINGDIPAPI
+GdipSetImageAttributesOutputChannel(GpImageAttributes *imageattr,
+ ColorAdjustType type,
+ BOOL enableFlag,
+ ColorChannelFlags channelFlags);
+
+GpStatus WINGDIPAPI
+GdipSetImageAttributesOutputChannelColorProfile(GpImageAttributes *imageattr,
+ ColorAdjustType type,
+ BOOL enableFlag,
+ GDIPCONST WCHAR *colorProfileFilename);
+
+GpStatus WINGDIPAPI
+GdipSetImageAttributesRemapTable(GpImageAttributes *imageattr,
+ ColorAdjustType type,
+ BOOL enableFlag,
+ UINT mapSize,
+ GDIPCONST ColorMap *map);
+GpStatus WINGDIPAPI
+GdipSetImageAttributesWrapMode(
+ GpImageAttributes *imageAttr,
+ WrapMode wrap,
+ ARGB argb,
+ BOOL clamp
+);
+
+GpStatus WINGDIPAPI
+GdipSetImageAttributesICMMode(
+ GpImageAttributes *imageAttr,
+ BOOL on
+);
+
+GpStatus WINGDIPAPI
+GdipGetImageAttributesAdjustedPalette(
+ GpImageAttributes *imageAttr,
+ ColorPalette * colorPalette,
+ ColorAdjustType colorAdjustType
+);
+
+//----------------------------------------------------------------------------
+// Graphics methods
+//----------------------------------------------------------------------------
+
+GpStatus WINGDIPAPI
+GdipFlush(GpGraphics *graphics, GpFlushIntention intention);
+
+GpStatus WINGDIPAPI
+GdipCreateFromHDC(HDC hdc, GpGraphics **graphics);
+
+GpStatus WINGDIPAPI
+GdipCreateFromHDC2(HDC hdc, HANDLE hDevice, GpGraphics **graphics);
+
+GpStatus WINGDIPAPI
+GdipCreateFromHWND(HWND hwnd, GpGraphics **graphics);
+
+GpStatus WINGDIPAPI
+GdipCreateFromHWNDICM(HWND hwnd, GpGraphics **graphics);
+
+GpStatus WINGDIPAPI
+GdipDeleteGraphics(GpGraphics *graphics);
+
+GpStatus WINGDIPAPI
+GdipGetDC(GpGraphics* graphics, HDC * hdc);
+
+GpStatus WINGDIPAPI
+GdipReleaseDC(GpGraphics* graphics, HDC hdc);
+
+GpStatus WINGDIPAPI
+GdipSetCompositingMode(GpGraphics *graphics, CompositingMode compositingMode);
+
+GpStatus WINGDIPAPI
+GdipGetCompositingMode(GpGraphics *graphics, CompositingMode *compositingMode);
+
+GpStatus WINGDIPAPI
+GdipSetRenderingOrigin(GpGraphics *graphics, INT x, INT y);
+
+GpStatus WINGDIPAPI
+GdipGetRenderingOrigin(GpGraphics *graphics, INT *x, INT *y);
+
+GpStatus WINGDIPAPI
+GdipSetCompositingQuality(GpGraphics *graphics, CompositingQuality compositingQuality);
+
+GpStatus WINGDIPAPI
+GdipGetCompositingQuality(GpGraphics *graphics, CompositingQuality *compositingQuality);
+
+GpStatus WINGDIPAPI
+GdipSetSmoothingMode(GpGraphics *graphics, SmoothingMode smoothingMode);
+
+GpStatus WINGDIPAPI
+GdipGetSmoothingMode(GpGraphics *graphics, SmoothingMode *smoothingMode);
+
+GpStatus WINGDIPAPI
+GdipSetPixelOffsetMode(GpGraphics* graphics, PixelOffsetMode pixelOffsetMode);
+
+GpStatus WINGDIPAPI
+GdipGetPixelOffsetMode(GpGraphics *graphics, PixelOffsetMode *pixelOffsetMode);
+
+GpStatus WINGDIPAPI
+GdipSetTextRenderingHint(GpGraphics *graphics, TextRenderingHint mode);
+
+GpStatus WINGDIPAPI
+GdipGetTextRenderingHint(GpGraphics *graphics, TextRenderingHint *mode);
+
+#ifdef DCR_USE_NEW_188922
+GpStatus WINGDIPAPI
+GdipSetTextContrast(GpGraphics *graphics, UINT contrast);
+
+GpStatus WINGDIPAPI
+GdipGetTextContrast(GpGraphics *graphics, UINT * contrast);
+#else
+GpStatus WINGDIPAPI
+GdipSetTextGammaValue(GpGraphics *graphics, UINT gammaValue);
+
+GpStatus WINGDIPAPI
+GdipGetTextGammaValue(GpGraphics *graphics, UINT * gammaValue);
+#endif // DCR_USE_NEW_188922
+
+
+GpStatus WINGDIPAPI
+GdipSetInterpolationMode(GpGraphics *graphics, InterpolationMode interpolationMode);
+
+GpStatus WINGDIPAPI
+GdipGetInterpolationMode(GpGraphics *graphics, InterpolationMode *interpolationMode);
+
+GpStatus WINGDIPAPI
+GdipSetWorldTransform(GpGraphics *graphics, GpMatrix *matrix);
+
+GpStatus WINGDIPAPI
+GdipResetWorldTransform(GpGraphics *graphics);
+
+GpStatus WINGDIPAPI
+GdipMultiplyWorldTransform(GpGraphics *graphics, GDIPCONST GpMatrix *matrix,
+ GpMatrixOrder order);
+
+GpStatus WINGDIPAPI
+GdipTranslateWorldTransform(GpGraphics *graphics, REAL dx, REAL dy,
+ GpMatrixOrder order);
+
+GpStatus WINGDIPAPI
+GdipScaleWorldTransform(GpGraphics *graphics, REAL sx, REAL sy,
+ GpMatrixOrder order);
+
+GpStatus WINGDIPAPI
+GdipRotateWorldTransform(GpGraphics *graphics, REAL angle, GpMatrixOrder order);
+
+GpStatus WINGDIPAPI
+GdipGetWorldTransform(GpGraphics *graphics, GpMatrix *matrix);
+
+GpStatus WINGDIPAPI
+GdipResetPageTransform(GpGraphics *graphics);
+
+GpStatus WINGDIPAPI
+GdipGetPageUnit(GpGraphics *graphics, GpUnit *unit);
+
+GpStatus WINGDIPAPI
+GdipGetPageScale(GpGraphics *graphics, REAL *scale);
+
+GpStatus WINGDIPAPI
+GdipSetPageUnit(GpGraphics *graphics, GpUnit unit);
+
+GpStatus WINGDIPAPI
+GdipSetPageScale(GpGraphics *graphics, REAL scale);
+
+GpStatus WINGDIPAPI
+GdipGetDpiX(GpGraphics *graphics, REAL* dpi);
+
+GpStatus WINGDIPAPI
+GdipGetDpiY(GpGraphics *graphics, REAL* dpi);
+
+GpStatus WINGDIPAPI
+GdipTransformPoints(GpGraphics *graphics, GpCoordinateSpace destSpace,
+ GpCoordinateSpace srcSpace, GpPointF *points,
+ INT count);
+
+GpStatus WINGDIPAPI
+GdipTransformPointsI(GpGraphics *graphics, GpCoordinateSpace destSpace,
+ GpCoordinateSpace srcSpace, GpPoint *points,
+ INT count);
+
+GpStatus WINGDIPAPI
+GdipGetNearestColor(GpGraphics *graphics, ARGB* argb);
+
+// Create the Win9x Halftone Palette (even on NT) with correct Desktop colors
+HPALETTE WINGDIPAPI
+GdipCreateHalftonePalette();
+
+GpStatus WINGDIPAPI
+GdipDrawLine(GpGraphics *graphics, GpPen *pen, REAL x1, REAL y1,
+ REAL x2, REAL y2);
+
+GpStatus WINGDIPAPI
+GdipDrawLineI(GpGraphics *graphics, GpPen *pen, INT x1, INT y1,
+ INT x2, INT y2);
+
+GpStatus WINGDIPAPI
+GdipDrawLines(GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *points,
+ INT count);
+
+GpStatus WINGDIPAPI
+GdipDrawLinesI(GpGraphics *graphics, GpPen *pen, GDIPCONST GpPoint *points,
+ INT count);
+
+GpStatus WINGDIPAPI
+GdipDrawArc(GpGraphics *graphics, GpPen *pen, REAL x, REAL y,
+ REAL width, REAL height, REAL startAngle, REAL sweepAngle);
+
+GpStatus WINGDIPAPI
+GdipDrawArcI(GpGraphics *graphics, GpPen *pen, INT x, INT y,
+ INT width, INT height, REAL startAngle, REAL sweepAngle);
+
+GpStatus WINGDIPAPI
+GdipDrawBezier(GpGraphics *graphics, GpPen *pen, REAL x1, REAL y1,
+ REAL x2, REAL y2, REAL x3, REAL y3, REAL x4, REAL y4);
+
+GpStatus WINGDIPAPI
+GdipDrawBezierI(GpGraphics *graphics, GpPen *pen, INT x1, INT y1,
+ INT x2, INT y2, INT x3, INT y3, INT x4, INT y4);
+
+GpStatus WINGDIPAPI
+GdipDrawBeziers(GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *points,
+ INT count);
+
+GpStatus WINGDIPAPI
+GdipDrawBeziersI(GpGraphics *graphics, GpPen *pen, GDIPCONST GpPoint *points,
+ INT count);
+
+GpStatus WINGDIPAPI
+GdipDrawRectangle(GpGraphics *graphics, GpPen *pen, REAL x, REAL y,
+ REAL width, REAL height);
+
+GpStatus WINGDIPAPI
+GdipDrawRectangleI(GpGraphics *graphics, GpPen *pen, INT x, INT y,
+ INT width, INT height);
+
+GpStatus WINGDIPAPI
+GdipDrawRectangles(GpGraphics *graphics, GpPen *pen, GDIPCONST GpRectF *rects,
+ INT count);
+
+GpStatus WINGDIPAPI
+GdipDrawRectanglesI(GpGraphics *graphics, GpPen *pen, GDIPCONST GpRect *rects,
+ INT count);
+
+GpStatus WINGDIPAPI
+GdipDrawEllipse(GpGraphics *graphics, GpPen *pen, REAL x, REAL y,
+ REAL width, REAL height);
+
+GpStatus WINGDIPAPI
+GdipDrawEllipseI(GpGraphics *graphics, GpPen *pen, INT x, INT y,
+ INT width, INT height);
+
+GpStatus WINGDIPAPI
+GdipDrawPie(GpGraphics *graphics, GpPen *pen, REAL x, REAL y,
+ REAL width, REAL height, REAL startAngle, REAL sweepAngle);
+
+GpStatus WINGDIPAPI
+GdipDrawPieI(GpGraphics *graphics, GpPen *pen, INT x, INT y,
+ INT width, INT height, REAL startAngle, REAL sweepAngle);
+
+GpStatus WINGDIPAPI
+GdipDrawPolygon(GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *points,
+ INT count);
+
+GpStatus WINGDIPAPI
+GdipDrawPolygonI(GpGraphics *graphics, GpPen *pen, GDIPCONST GpPoint *points,
+ INT count);
+
+GpStatus WINGDIPAPI
+GdipDrawPath(GpGraphics *graphics, GpPen *pen, GpPath *path);
+
+GpStatus WINGDIPAPI
+GdipDrawCurve(GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *points,
+ INT count);
+
+GpStatus WINGDIPAPI
+GdipDrawCurveI(GpGraphics *graphics, GpPen *pen, GDIPCONST GpPoint *points,
+ INT count);
+
+GpStatus WINGDIPAPI
+GdipDrawCurve2(GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *points,
+ INT count, REAL tension);
+
+GpStatus WINGDIPAPI
+GdipDrawCurve2I(GpGraphics *graphics, GpPen *pen, GDIPCONST GpPoint *points,
+ INT count, REAL tension);
+
+GpStatus WINGDIPAPI
+GdipDrawCurve3(GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *points,
+ INT count, INT offset, INT numberOfSegments, REAL tension);
+
+GpStatus WINGDIPAPI
+GdipDrawCurve3I(GpGraphics *graphics, GpPen *pen, GDIPCONST GpPoint *points,
+ INT count, INT offset, INT numberOfSegments, REAL tension);
+
+GpStatus WINGDIPAPI
+GdipDrawClosedCurve(GpGraphics *graphics, GpPen *pen,
+ GDIPCONST GpPointF *points, INT count);
+
+GpStatus WINGDIPAPI
+GdipDrawClosedCurveI(GpGraphics *graphics, GpPen *pen,
+ GDIPCONST GpPoint *points, INT count);
+
+GpStatus WINGDIPAPI
+GdipDrawClosedCurve2(GpGraphics *graphics, GpPen *pen,
+ GDIPCONST GpPointF *points, INT count, REAL tension);
+
+GpStatus WINGDIPAPI
+GdipDrawClosedCurve2I(GpGraphics *graphics, GpPen *pen,
+ GDIPCONST GpPoint *points, INT count, REAL tension);
+
+GpStatus WINGDIPAPI
+GdipGraphicsClear(GpGraphics *graphics, ARGB color);
+
+GpStatus WINGDIPAPI
+GdipFillRectangle(GpGraphics *graphics, GpBrush *brush, REAL x, REAL y,
+ REAL width, REAL height);
+
+GpStatus WINGDIPAPI
+GdipFillRectangleI(GpGraphics *graphics, GpBrush *brush, INT x, INT y,
+ INT width, INT height);
+
+GpStatus WINGDIPAPI
+GdipFillRectangles(GpGraphics *graphics, GpBrush *brush,
+ GDIPCONST GpRectF *rects, INT count);
+
+GpStatus WINGDIPAPI
+GdipFillRectanglesI(GpGraphics *graphics, GpBrush *brush,
+ GDIPCONST GpRect *rects, INT count);
+
+GpStatus WINGDIPAPI
+GdipFillPolygon(GpGraphics *graphics, GpBrush *brush,
+ GDIPCONST GpPointF *points, INT count, GpFillMode fillMode);
+
+GpStatus WINGDIPAPI
+GdipFillPolygonI(GpGraphics *graphics, GpBrush *brush,
+ GDIPCONST GpPoint *points, INT count, GpFillMode fillMode);
+
+GpStatus WINGDIPAPI
+GdipFillPolygon2(GpGraphics *graphics, GpBrush *brush,
+ GDIPCONST GpPointF *points, INT count);
+
+GpStatus WINGDIPAPI
+GdipFillPolygon2I(GpGraphics *graphics, GpBrush *brush,
+ GDIPCONST GpPoint *points, INT count);
+
+GpStatus WINGDIPAPI
+GdipFillEllipse(GpGraphics *graphics, GpBrush *brush, REAL x, REAL y,
+ REAL width, REAL height);
+
+GpStatus WINGDIPAPI
+GdipFillEllipseI(GpGraphics *graphics, GpBrush *brush, INT x, INT y,
+ INT width, INT height);
+
+GpStatus WINGDIPAPI
+GdipFillPie(GpGraphics *graphics, GpBrush *brush, REAL x, REAL y,
+ REAL width, REAL height, REAL startAngle, REAL sweepAngle);
+
+GpStatus WINGDIPAPI
+GdipFillPieI(GpGraphics *graphics, GpBrush *brush, INT x, INT y,
+ INT width, INT height, REAL startAngle, REAL sweepAngle);
+
+GpStatus WINGDIPAPI
+GdipFillPath(GpGraphics *graphics, GpBrush *brush, GpPath *path);
+
+GpStatus WINGDIPAPI
+GdipFillClosedCurve(GpGraphics *graphics, GpBrush *brush,
+ GDIPCONST GpPointF *points, INT count);
+
+GpStatus WINGDIPAPI
+GdipFillClosedCurveI(GpGraphics *graphics, GpBrush *brush,
+ GDIPCONST GpPoint *points, INT count);
+
+GpStatus WINGDIPAPI
+GdipFillClosedCurve2(GpGraphics *graphics, GpBrush *brush,
+ GDIPCONST GpPointF *points, INT count,
+ REAL tension, GpFillMode fillMode);
+
+GpStatus WINGDIPAPI
+GdipFillClosedCurve2I(GpGraphics *graphics, GpBrush *brush,
+ GDIPCONST GpPoint *points, INT count,
+ REAL tension, GpFillMode fillMode);
+
+GpStatus WINGDIPAPI
+GdipFillRegion(GpGraphics *graphics, GpBrush *brush,
+ GpRegion *region);
+
+GpStatus WINGDIPAPI
+GdipDrawImage(GpGraphics *graphics, GpImage *image, REAL x, REAL y);
+
+GpStatus WINGDIPAPI
+GdipDrawImageI(GpGraphics *graphics, GpImage *image, INT x, INT y);
+
+GpStatus WINGDIPAPI
+GdipDrawImageRect(GpGraphics *graphics, GpImage *image, REAL x, REAL y,
+ REAL width, REAL height);
+
+GpStatus WINGDIPAPI
+GdipDrawImageRectI(GpGraphics *graphics, GpImage *image, INT x, INT y,
+ INT width, INT height);
+
+GpStatus WINGDIPAPI
+GdipDrawImagePoints(GpGraphics *graphics, GpImage *image,
+ GDIPCONST GpPointF *dstpoints, INT count);
+
+GpStatus WINGDIPAPI
+GdipDrawImagePointsI(GpGraphics *graphics, GpImage *image,
+ GDIPCONST GpPoint *dstpoints, INT count);
+
+GpStatus WINGDIPAPI
+GdipDrawImagePointRect(GpGraphics *graphics, GpImage *image, REAL x,
+ REAL y, REAL srcx, REAL srcy, REAL srcwidth,
+ REAL srcheight, GpUnit srcUnit);
+
+GpStatus WINGDIPAPI
+GdipDrawImagePointRectI(GpGraphics *graphics, GpImage *image, INT x,
+ INT y, INT srcx, INT srcy, INT srcwidth,
+ INT srcheight, GpUnit srcUnit);
+
+GpStatus WINGDIPAPI
+GdipDrawImageRectRect(GpGraphics *graphics, GpImage *image, REAL dstx,
+ REAL dsty, REAL dstwidth, REAL dstheight,
+ REAL srcx, REAL srcy, REAL srcwidth, REAL srcheight,
+ GpUnit srcUnit,
+ GDIPCONST GpImageAttributes* imageAttributes,
+ DrawImageAbort callback, VOID * callbackData);
+
+GpStatus WINGDIPAPI
+GdipDrawImageRectRectI(GpGraphics *graphics, GpImage *image, INT dstx,
+ INT dsty, INT dstwidth, INT dstheight,
+ INT srcx, INT srcy, INT srcwidth, INT srcheight,
+ GpUnit srcUnit,
+ GDIPCONST GpImageAttributes* imageAttributes,
+ DrawImageAbort callback, VOID * callbackData);
+
+GpStatus WINGDIPAPI
+GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image,
+ GDIPCONST GpPointF *points, INT count, REAL srcx,
+ REAL srcy, REAL srcwidth, REAL srcheight,
+ GpUnit srcUnit,
+ GDIPCONST GpImageAttributes* imageAttributes,
+ DrawImageAbort callback, VOID * callbackData);
+
+GpStatus WINGDIPAPI
+GdipDrawImagePointsRectI(GpGraphics *graphics, GpImage *image,
+ GDIPCONST GpPoint *points, INT count, INT srcx,
+ INT srcy, INT srcwidth, INT srcheight,
+ GpUnit srcUnit,
+ GDIPCONST GpImageAttributes* imageAttributes,
+ DrawImageAbort callback, VOID * callbackData);
+
+GpStatus WINGDIPAPI
+GdipEnumerateMetafileDestPoint(
+ GpGraphics * graphics,
+ GDIPCONST GpMetafile * metafile,
+ GDIPCONST PointF & destPoint,
+ EnumerateMetafileProc callback,
+ VOID * callbackData,
+ GDIPCONST GpImageAttributes * imageAttributes
+ );
+
+GpStatus WINGDIPAPI
+GdipEnumerateMetafileDestPointI(
+ GpGraphics * graphics,
+ GDIPCONST GpMetafile * metafile,
+ GDIPCONST Point & destPoint,
+ EnumerateMetafileProc callback,
+ VOID * callbackData,
+ GDIPCONST GpImageAttributes * imageAttributes
+ );
+
+GpStatus WINGDIPAPI
+GdipEnumerateMetafileDestRect(
+ GpGraphics * graphics,
+ GDIPCONST GpMetafile * metafile,
+ GDIPCONST RectF & destRect,
+ EnumerateMetafileProc callback,
+ VOID * callbackData,
+ GDIPCONST GpImageAttributes * imageAttributes
+ );
+
+GpStatus WINGDIPAPI
+GdipEnumerateMetafileDestRectI(
+ GpGraphics * graphics,
+ GDIPCONST GpMetafile * metafile,
+ GDIPCONST Rect & destRect,
+ EnumerateMetafileProc callback,
+ VOID * callbackData,
+ GDIPCONST GpImageAttributes * imageAttributes
+ );
+
+GpStatus WINGDIPAPI
+GdipEnumerateMetafileDestPoints(
+ GpGraphics * graphics,
+ GDIPCONST GpMetafile * metafile,
+ GDIPCONST PointF * destPoints,
+ INT count,
+ EnumerateMetafileProc callback,
+ VOID * callbackData,
+ GDIPCONST GpImageAttributes * imageAttributes
+ );
+
+GpStatus WINGDIPAPI
+GdipEnumerateMetafileDestPointsI(
+ GpGraphics * graphics,
+ GDIPCONST GpMetafile * metafile,
+ GDIPCONST Point * destPoints,
+ INT count,
+ EnumerateMetafileProc callback,
+ VOID * callbackData,
+ GDIPCONST GpImageAttributes * imageAttributes
+ );
+
+GpStatus WINGDIPAPI
+GdipEnumerateMetafileSrcRectDestPoint(
+ GpGraphics * graphics,
+ GDIPCONST GpMetafile * metafile,
+ GDIPCONST PointF & destPoint,
+ GDIPCONST RectF & srcRect,
+ Unit srcUnit,
+ EnumerateMetafileProc callback,
+ VOID * callbackData,
+ GDIPCONST GpImageAttributes * imageAttributes
+ );
+
+GpStatus WINGDIPAPI
+GdipEnumerateMetafileSrcRectDestPointI(
+ GpGraphics * graphics,
+ GDIPCONST GpMetafile * metafile,
+ GDIPCONST Point & destPoint,
+ GDIPCONST Rect & srcRect,
+ Unit srcUnit,
+ EnumerateMetafileProc callback,
+ VOID * callbackData,
+ GDIPCONST GpImageAttributes * imageAttributes
+ );
+
+GpStatus WINGDIPAPI
+GdipEnumerateMetafileSrcRectDestRect(
+ GpGraphics * graphics,
+ GDIPCONST GpMetafile * metafile,
+ GDIPCONST RectF & destRect,
+ GDIPCONST RectF & srcRect,
+ Unit srcUnit,
+ EnumerateMetafileProc callback,
+ VOID * callbackData,
+ GDIPCONST GpImageAttributes * imageAttributes
+ );
+
+GpStatus WINGDIPAPI
+GdipEnumerateMetafileSrcRectDestRectI(
+ GpGraphics * graphics,
+ GDIPCONST GpMetafile * metafile,
+ GDIPCONST Rect & destRect,
+ GDIPCONST Rect & srcRect,
+ Unit srcUnit,
+ EnumerateMetafileProc callback,
+ VOID * callbackData,
+ GDIPCONST GpImageAttributes * imageAttributes
+ );
+
+GpStatus WINGDIPAPI
+GdipEnumerateMetafileSrcRectDestPoints(
+ GpGraphics * graphics,
+ GDIPCONST GpMetafile * metafile,
+ GDIPCONST PointF * destPoints,
+ INT count,
+ GDIPCONST RectF & srcRect,
+ Unit srcUnit,
+ EnumerateMetafileProc callback,
+ VOID * callbackData,
+ GDIPCONST GpImageAttributes * imageAttributes
+ );
+
+GpStatus WINGDIPAPI
+GdipEnumerateMetafileSrcRectDestPointsI(
+ GpGraphics * graphics,
+ GDIPCONST GpMetafile * metafile,
+ GDIPCONST Point * destPoints,
+ INT count,
+ GDIPCONST Rect & srcRect,
+ Unit srcUnit,
+ EnumerateMetafileProc callback,
+ VOID * callbackData,
+ GDIPCONST GpImageAttributes * imageAttributes
+ );
+
+GpStatus WINGDIPAPI
+GdipPlayMetafileRecord(
+ GDIPCONST GpMetafile * metafile,
+ EmfPlusRecordType recordType,
+ UINT flags,
+ UINT dataSize,
+ GDIPCONST BYTE * data
+ );
+
+GpStatus WINGDIPAPI
+GdipSetClipGraphics(GpGraphics *graphics, GpGraphics *srcgraphics,
+ CombineMode combineMode);
+
+GpStatus WINGDIPAPI
+GdipSetClipRect(GpGraphics *graphics, REAL x, REAL y,
+ REAL width, REAL height, CombineMode combineMode);
+
+GpStatus WINGDIPAPI
+GdipSetClipRectI(GpGraphics *graphics, INT x, INT y,
+ INT width, INT height, CombineMode combineMode);
+
+GpStatus WINGDIPAPI
+GdipSetClipPath(GpGraphics *graphics, GpPath *path, CombineMode combineMode);
+
+GpStatus WINGDIPAPI
+GdipSetClipRegion(GpGraphics *graphics, GpRegion *region,
+ CombineMode combineMode);
+
+GpStatus WINGDIPAPI
+GdipSetClipHrgn(GpGraphics *graphics, HRGN hRgn, CombineMode combineMode);
+
+GpStatus WINGDIPAPI
+GdipResetClip(GpGraphics *graphics);
+
+GpStatus WINGDIPAPI
+GdipTranslateClip(GpGraphics *graphics, REAL dx, REAL dy);
+
+GpStatus WINGDIPAPI
+GdipTranslateClipI(GpGraphics *graphics, INT dx, INT dy);
+
+GpStatus WINGDIPAPI
+GdipGetClip(GpGraphics *graphics, GpRegion *region);
+
+GpStatus WINGDIPAPI
+GdipGetClipBounds(GpGraphics *graphics, GpRectF *rect);
+
+GpStatus WINGDIPAPI
+GdipGetClipBoundsI(GpGraphics *graphics, GpRect *rect);
+
+GpStatus WINGDIPAPI
+GdipIsClipEmpty(GpGraphics *graphics, BOOL *result);
+
+GpStatus WINGDIPAPI
+GdipGetVisibleClipBounds(GpGraphics *graphics, GpRectF *rect);
+
+GpStatus WINGDIPAPI
+GdipGetVisibleClipBoundsI(GpGraphics *graphics, GpRect *rect);
+
+GpStatus WINGDIPAPI
+GdipIsVisibleClipEmpty(GpGraphics *graphics, BOOL *result);
+
+GpStatus WINGDIPAPI
+GdipIsVisiblePoint(GpGraphics *graphics, REAL x, REAL y,
+ BOOL *result);
+
+GpStatus WINGDIPAPI
+GdipIsVisiblePointI(GpGraphics *graphics, INT x, INT y,
+ BOOL *result);
+
+GpStatus WINGDIPAPI
+GdipIsVisibleRect(GpGraphics *graphics, REAL x, REAL y,
+ REAL width, REAL height, BOOL *result);
+
+GpStatus WINGDIPAPI
+GdipIsVisibleRectI(GpGraphics *graphics, INT x, INT y,
+ INT width, INT height, BOOL *result);
+
+GpStatus WINGDIPAPI
+GdipSaveGraphics(GpGraphics *graphics, GraphicsState *state);
+
+GpStatus WINGDIPAPI
+GdipRestoreGraphics(GpGraphics *graphics, GraphicsState state);
+
+GpStatus WINGDIPAPI
+GdipBeginContainer(GpGraphics *graphics, GDIPCONST GpRectF* dstrect,
+ GDIPCONST GpRectF *srcrect, GpUnit unit, GraphicsContainer *state);
+
+GpStatus WINGDIPAPI
+GdipBeginContainerI(GpGraphics *graphics, GDIPCONST GpRect* dstrect,
+ GDIPCONST GpRect *srcrect, GpUnit unit, GraphicsContainer *state);
+
+GpStatus WINGDIPAPI
+GdipBeginContainer2(GpGraphics *graphics, GraphicsContainer* state);
+
+GpStatus WINGDIPAPI
+GdipEndContainer(GpGraphics *graphics, GraphicsContainer state);
+
+GpStatus
+GdipGetMetafileHeaderFromWmf(
+ HMETAFILE hWmf,
+ GDIPCONST APMFileHeader * apmFileHeader,
+ MetafileHeader * header
+ );
+
+GpStatus
+WINGDIPAPI
+GdipGetMetafileHeaderFromEmf(
+ HENHMETAFILE hEmf,
+ MetafileHeader * header
+ );
+
+GpStatus
+WINGDIPAPI
+GdipGetMetafileHeaderFromFile(
+ GDIPCONST WCHAR* filename,
+ MetafileHeader * header
+ );
+
+GpStatus
+WINGDIPAPI
+GdipGetMetafileHeaderFromStream(
+ IStream * stream,
+ MetafileHeader * header
+ );
+
+GpStatus
+WINGDIPAPI
+GdipGetMetafileHeaderFromMetafile(
+ GpMetafile * metafile,
+ MetafileHeader * header
+ );
+
+GpStatus
+WINGDIPAPI
+GdipGetHemfFromMetafile(
+ GpMetafile * metafile,
+ HENHMETAFILE * hEmf
+ );
+
+GpStatus WINGDIPAPI
+GdipCreateStreamOnFile(GDIPCONST WCHAR * filename, UINT access, IStream **stream);
+
+GpStatus WINGDIPAPI
+GdipCreateMetafileFromWmf(HMETAFILE hWmf, BOOL deleteWmf,
+ GDIPCONST APMFileHeader * apmFileHeader, GpMetafile **metafile);
+
+GpStatus WINGDIPAPI
+GdipCreateMetafileFromEmf(HENHMETAFILE hEmf, BOOL deleteEmf,
+ GpMetafile **metafile);
+
+GpStatus WINGDIPAPI
+GdipCreateMetafileFromFile(GDIPCONST WCHAR* file, GpMetafile **metafile);
+
+GpStatus WINGDIPAPI
+GdipCreateMetafileFromWmfFile(GDIPCONST WCHAR* file, GDIPCONST APMFileHeader * apmFileHeader, GpMetafile **metafile);
+
+GpStatus WINGDIPAPI
+GdipCreateMetafileFromStream(IStream * stream, GpMetafile **metafile);
+
+GpStatus WINGDIPAPI
+GdipRecordMetafile(
+ HDC referenceHdc,
+ EmfType type,
+ GDIPCONST GpRectF * frameRect,
+ MetafileFrameUnit frameUnit,
+ GDIPCONST WCHAR * description,
+ GpMetafile ** metafile
+ );
+
+GpStatus WINGDIPAPI
+GdipRecordMetafileI(
+ HDC referenceHdc,
+ EmfType type,
+ GDIPCONST GpRect * frameRect,
+ MetafileFrameUnit frameUnit,
+ GDIPCONST WCHAR * description,
+ GpMetafile ** metafile
+ );
+
+GpStatus WINGDIPAPI
+GdipRecordMetafileFileName(
+ GDIPCONST WCHAR* fileName,
+ HDC referenceHdc,
+ EmfType type,
+ GDIPCONST GpRectF * frameRect,
+ MetafileFrameUnit frameUnit,
+ GDIPCONST WCHAR * description,
+ GpMetafile ** metafile
+ );
+
+GpStatus WINGDIPAPI
+GdipRecordMetafileFileNameI(
+ GDIPCONST WCHAR* fileName,
+ HDC referenceHdc,
+ EmfType type,
+ GDIPCONST GpRect * frameRect,
+ MetafileFrameUnit frameUnit,
+ GDIPCONST WCHAR * description,
+ GpMetafile ** metafile
+ );
+
+GpStatus WINGDIPAPI
+GdipRecordMetafileStream(
+ IStream * stream,
+ HDC referenceHdc,
+ EmfType type,
+ GDIPCONST GpRectF * frameRect,
+ MetafileFrameUnit frameUnit,
+ GDIPCONST WCHAR * description,
+ GpMetafile ** metafile
+ );
+
+GpStatus WINGDIPAPI
+GdipRecordMetafileStreamI(
+ IStream * stream,
+ HDC referenceHdc,
+ EmfType type,
+ GDIPCONST GpRect * frameRect,
+ MetafileFrameUnit frameUnit,
+ GDIPCONST WCHAR * description,
+ GpMetafile ** metafile
+ );
+
+GpStatus WINGDIPAPI
+GdipSetMetafileDownLevelRasterizationLimit(
+ GpMetafile * metafile,
+ UINT metafileRasterizationLimitDpi
+ );
+
+GpStatus WINGDIPAPI
+GdipGetMetafileDownLevelRasterizationLimit(
+ GDIPCONST GpMetafile * metafile,
+ UINT * metafileRasterizationLimitDpi
+ );
+
+GpStatus WINGDIPAPI
+GdipGetImageDecodersSize(UINT *numDecoders, UINT *size);
+
+GpStatus WINGDIPAPI
+GdipGetImageDecoders(UINT numDecoders,
+ UINT size,
+ ImageCodecInfo *decoders);
+
+GpStatus WINGDIPAPI
+GdipGetImageEncodersSize(UINT *numEncoders, UINT *size);
+
+GpStatus WINGDIPAPI
+GdipGetImageEncoders(UINT numEncoders,
+ UINT size,
+ ImageCodecInfo *encoders);
+
+GpStatus WINGDIPAPI
+GdipAddImageCodec(GDIPCONST ImageCodecInfo *codec);
+
+GpStatus WINGDIPAPI
+GdipRemoveImageCodec(GDIPCONST ImageCodecInfo *codec);
+
+#ifndef DCR_USE_NEW_186091
+GpStatus WINGDIPAPI
+GdipGetGraphicsPixel(GpGraphics* graphics, REAL x, REAL y, ARGB* argb);
+#endif
+
+GpStatus WINGDIPAPI
+GdipComment(GpGraphics* graphics, UINT sizeData, GDIPCONST BYTE * data);
+
+GpStatus WINGDIPAPI
+GdipGetGraphicsLayout(GpGraphics* graphics, GraphicsLayout* layout);
+
+GpStatus WINGDIPAPI
+GdipSetGraphicsLayout(GpGraphics* graphics, GDIPCONST GraphicsLayout layout);
+
+//----------------------------------------------------------------------------
+// FontFamily
+//----------------------------------------------------------------------------
+
+GpStatus WINGDIPAPI
+GdipCreateFontFamilyFromName(GDIPCONST WCHAR *name,
+ GpFontCollection *fontCollection,
+ GpFontFamily **FontFamily);
+
+GpStatus WINGDIPAPI
+GdipDeleteFontFamily(GpFontFamily *FontFamily);
+
+GpStatus WINGDIPAPI
+GdipCloneFontFamily(GpFontFamily *FontFamily, GpFontFamily **clonedFontFamily);
+
+GpStatus WINGDIPAPI
+GdipGetGenericFontFamilySansSerif(GpFontFamily **nativeFamily);
+
+GpStatus WINGDIPAPI
+GdipGetGenericFontFamilySerif(GpFontFamily **nativeFamily);
+
+GpStatus WINGDIPAPI
+GdipGetGenericFontFamilyMonospace(GpFontFamily **nativeFamily);
+
+
+GpStatus WINGDIPAPI
+GdipGetFamilyName(
+ GDIPCONST GpFontFamily *family,
+ WCHAR name[LF_FACESIZE],
+ LANGID language
+);
+
+GpStatus WINGDIPAPI
+GdipIsStyleAvailable(GDIPCONST GpFontFamily *family, INT style, BOOL * IsStyleAvailable);
+
+GpStatus WINGDIPAPI
+GdipFontCollectionEnumerable(
+ GpFontCollection* fontCollection,
+ GpGraphics* graphics,
+ INT * numFound
+);
+
+GpStatus WINGDIPAPI GdipFontCollectionEnumerate(
+ GpFontCollection* fontCollection,
+ INT numSought,
+ GpFontFamily* gpfamilies[],
+ INT* numFound,
+ GpGraphics* graphics
+);
+
+//-----------------------------------
+// New API
+//-----------------------------------
+
+GpStatus WINGDIPAPI
+GdipGetEmHeight(GDIPCONST GpFontFamily *family, INT style, UINT16 * EmHeight);
+
+GpStatus WINGDIPAPI
+GdipGetCellAscent(GDIPCONST GpFontFamily *family, INT style, UINT16 * CellAscent);
+
+GpStatus WINGDIPAPI
+GdipGetCellDescent(GDIPCONST GpFontFamily *family, INT style, UINT16 * CellDescent);
+
+GpStatus WINGDIPAPI
+GdipGetLineSpacing(GDIPCONST GpFontFamily *family, INT style, UINT16 * LineSpacing);
+
+
+//----------------------------------------------------------------------------
+// Font
+//----------------------------------------------------------------------------
+
+GpStatus WINGDIPAPI
+GdipCreateFontFromDC(
+ HDC hdc,
+ GpFont **font
+);
+
+GpStatus WINGDIPAPI
+GdipCreateFontFromLogfontA(
+ HDC hdc,
+ GDIPCONST LOGFONTA *logfont,
+ GpFont **font
+);
+
+GpStatus WINGDIPAPI
+GdipCreateFontFromLogfontW(
+ HDC hdc,
+ GDIPCONST LOGFONTW *logfont,
+ GpFont **font
+);
+
+GpStatus WINGDIPAPI
+GdipCreateFont(
+ GDIPCONST GpFontFamily *fontFamily,
+ REAL emSize,
+ INT style,
+ Unit unit,
+ GpFont **font
+);
+
+GpStatus WINGDIPAPI
+GdipCloneFont(GpFont* font, GpFont** cloneFont);
+
+GpStatus WINGDIPAPI
+GdipDeleteFont(GpFont* font);
+
+GpStatus WINGDIPAPI
+GdipGetFamily(GpFont *font, GpFontFamily **family);
+
+GpStatus WINGDIPAPI
+GdipGetFontStyle(GpFont *font, INT *style);
+
+GpStatus WINGDIPAPI
+GdipGetFontSize(GpFont *font, REAL *size);
+
+GpStatus WINGDIPAPI
+GdipGetFontUnit(GpFont *font, Unit *unit);
+
+GpStatus WINGDIPAPI
+GdipGetFontHeight(GDIPCONST GpFont *font, GDIPCONST GpGraphics *graphics, REAL *height);
+
+#ifdef DCR_USE_NEW_125467
+GpStatus WINGDIPAPI
+GdipGetFontHeightGivenDPI(GDIPCONST GpFont *font, REAL dpi, REAL *height);
+#endif
+
+GpStatus WINGDIPAPI
+GdipGetLogFontA(GpFont * font, GpGraphics *graphics, LOGFONTA * logfontA);
+
+GpStatus WINGDIPAPI
+GdipGetLogFontW(GpFont * font, GpGraphics *graphics, LOGFONTW * logfontW);
+
+// FontCollection
+
+GpStatus WINGDIPAPI
+GdipNewInstalledFontCollection(GpFontCollection** fontCollection);
+
+GpStatus WINGDIPAPI
+GdipNewPrivateFontCollection(GpFontCollection** fontCollection);
+
+GpStatus WINGDIPAPI
+GdipDeletePrivateFontCollection(GpFontCollection** fontCollection);
+
+GpStatus WINGDIPAPI
+GdipGetFontCollectionFamilyCount(
+ GpFontCollection* fontCollection,
+ INT * numFound
+);
+
+GpStatus WINGDIPAPI
+GdipGetFontCollectionFamilyList(
+ GpFontCollection* fontCollection,
+ INT numSought,
+ GpFontFamily* gpfamilies[],
+ INT* numFound
+);
+
+#ifndef DCR_USE_NEW_235072
+GpStatus WINGDIPAPI
+GdipInstallFontFile(
+ GpFontCollection* fontCollection,
+ GDIPCONST WCHAR* filename
+);
+
+GpStatus WINGDIPAPI
+GdipUninstallFontFile(
+ GpFontCollection* fontCollection,
+ GDIPCONST WCHAR* filename
+);
+#endif
+
+GpStatus WINGDIPAPI
+GdipPrivateAddFontFile(
+ GpFontCollection* fontCollection,
+ GDIPCONST WCHAR* filename
+);
+
+GpStatus WINGDIPAPI
+GdipPrivateAddMemoryFont(
+ GpFontCollection* fontCollection,
+ GDIPCONST void* memory,
+ INT length
+);
+
+//----------------------------------------------------------------------------
+// Text
+//----------------------------------------------------------------------------
+
+GpStatus WINGDIPAPI
+GdipDrawString(
+ GpGraphics *graphics,
+ GDIPCONST WCHAR *string,
+ INT length,
+ GDIPCONST GpFont *font,
+ GDIPCONST RectF *layoutRect,
+ GDIPCONST GpStringFormat *stringFormat,
+ GDIPCONST GpBrush *brush
+);
+
+GpStatus WINGDIPAPI
+GdipMeasureString(
+ GpGraphics *graphics,
+ GDIPCONST WCHAR *string,
+ INT length,
+ GDIPCONST GpFont *font,
+ GDIPCONST RectF *layoutRect,
+ GDIPCONST GpStringFormat *stringFormat,
+ RectF *boundingBox,
+ INT *codepointsFitted,
+ INT *linesFilled
+);
+
+#ifndef DCR_USE_NEW_174340
+GpStatus WINGDIPAPI
+GdipMeasureStringRegion(
+ GpGraphics *graphics,
+ GDIPCONST WCHAR *string,
+ INT length,
+ GDIPCONST GpFont *font,
+ GDIPCONST RectF &layoutRect,
+ GDIPCONST GpStringFormat *stringFormat,
+ INT firstCharacterIndex,
+ INT characterCount,
+ GpRegion *region
+);
+#endif
+
+#ifdef DCR_USE_NEW_174340
+GpStatus
+WINGDIPAPI
+GdipMeasureCharacterRanges(
+ GpGraphics *graphics,
+ GDIPCONST WCHAR *string,
+ INT length,
+ GDIPCONST GpFont *font,
+ GDIPCONST RectF &layoutRect,
+ GDIPCONST GpStringFormat *stringFormat,
+ INT regionCount,
+ GpRegion **regions
+);
+#endif
+
+GpStatus WINGDIPAPI
+GdipDrawDriverString(
+ GpGraphics *graphics,
+ GDIPCONST UINT16 *text,
+ INT length,
+ GDIPCONST GpFont *font,
+ GDIPCONST GpBrush *brush,
+ GDIPCONST PointF *positions,
+ INT flags,
+ GDIPCONST GpMatrix *matrix
+);
+
+GpStatus WINGDIPAPI
+GdipMeasureDriverString(
+ GpGraphics *graphics,
+ GDIPCONST UINT16 *text,
+ INT length,
+ GDIPCONST GpFont *font,
+ GDIPCONST PointF *positions,
+ INT flags,
+ GDIPCONST GpMatrix *matrix,
+ RectF *boundingBox
+);
+
+#ifndef DCR_USE_NEW_168772
+GpStatus WINGDIPAPI
+GdipDriverStringPointToCodepoint(
+ GpGraphics *graphics,
+ GDIPCONST UINT16 *text,
+ INT length,
+ GDIPCONST GpFont *font,
+ GDIPCONST PointF *positions,
+ INT flags,
+ GpMatrix *matrix,
+ GDIPCONST PointF *hit,
+ INT *index,
+ BOOL *rightEdge,
+ REAL *distance
+);
+#endif
+
+//----------------------------------------------------------------------------
+// String format APIs
+//----------------------------------------------------------------------------
+
+GpStatus WINGDIPAPI
+GdipCreateStringFormat(
+ INT formatAttributes,
+ LANGID language,
+ GpStringFormat **format
+);
+
+GpStatus WINGDIPAPI
+GdipStringFormatGetGenericDefault(GpStringFormat **format);
+
+GpStatus WINGDIPAPI
+GdipStringFormatGetGenericTypographic(GpStringFormat **format);
+
+GpStatus WINGDIPAPI
+GdipDeleteStringFormat(GpStringFormat *format);
+
+GpStatus WINGDIPAPI
+GdipCloneStringFormat(GDIPCONST GpStringFormat *format, GpStringFormat **newFormat);
+
+GpStatus WINGDIPAPI
+GdipSetStringFormatFlags(GpStringFormat *format, INT flags);
+
+GpStatus WINGDIPAPI GdipGetStringFormatFlags(GDIPCONST GpStringFormat *format, INT *flags);
+
+#ifndef DCR_USE_NEW_152154
+GpStatus WINGDIPAPI
+GdipSetStringFormatLineSpacing(GpStringFormat *format, REAL amount,
+ LineSpacing method);
+
+GpStatus WINGDIPAPI
+GdipGetStringFormatLineSpacingAmount(GDIPCONST GpStringFormat *format, REAL *amount);
+GpStatus WINGDIPAPI
+GdipGetStringFormatLineSpacingMethod(GDIPCONST GpStringFormat *format, LineSpacing *method);
+#endif
+
+GpStatus WINGDIPAPI
+GdipSetStringFormatAlign(GpStringFormat *format, StringAlignment align);
+
+GpStatus WINGDIPAPI
+GdipGetStringFormatAlign(GDIPCONST GpStringFormat *format, StringAlignment *align);
+
+GpStatus WINGDIPAPI
+GdipSetStringFormatLineAlign(GpStringFormat *format,
+ StringAlignment align);
+
+GpStatus WINGDIPAPI
+GdipGetStringFormatLineAlign(GDIPCONST GpStringFormat *format,
+ StringAlignment *align);
+
+GpStatus WINGDIPAPI
+GdipSetStringFormatTrimming(
+ GpStringFormat *format,
+ StringTrimming trimming
+);
+
+GpStatus WINGDIPAPI
+GdipGetStringFormatTrimming(
+ GDIPCONST GpStringFormat *format,
+ StringTrimming *trimming
+);
+
+GpStatus WINGDIPAPI
+GdipSetStringFormatHotkeyPrefix(GpStringFormat *format, INT hotkeyPrefix);
+
+GpStatus WINGDIPAPI
+GdipGetStringFormatHotkeyPrefix(GDIPCONST GpStringFormat *format, INT *hotkeyPrefix);
+
+GpStatus WINGDIPAPI
+GdipSetStringFormatTabStops(GpStringFormat *format, REAL firstTabOffset, INT count, GDIPCONST REAL *tabStops);
+
+GpStatus WINGDIPAPI
+GdipGetStringFormatTabStops(GDIPCONST GpStringFormat *format, INT count, REAL *firstTabOffset, REAL *tabStops);
+
+GpStatus WINGDIPAPI
+GdipGetStringFormatTabStopCount(GDIPCONST GpStringFormat *format, INT * count);
+
+#ifdef DCR_USE_NEW_146933
+GpStatus WINGDIPAPI
+GdipSetStringFormatDigitSubstitution(GpStringFormat *format, LANGID language,
+ StringDigitSubstitute substitute);
+
+GpStatus WINGDIPAPI
+GdipGetStringFormatDigitSubstitution(GDIPCONST GpStringFormat *format, LANGID *language,
+ StringDigitSubstitute *substitute);
+#endif // DCR_USE_NEW_146933
+
+#ifdef DCR_USE_NEW_174340
+GpStatus WINGDIPAPI
+GdipGetStringFormatMeasurableCharacterRangeCount(
+ GDIPCONST GpStringFormat *format,
+ INT *count
+);
+
+GpStatus WINGDIPAPI
+GdipSetStringFormatMeasurableCharacterRanges(
+ GpStringFormat *format,
+ INT rangeCount,
+ GDIPCONST CharacterRange *ranges
+);
+#endif
+
+//----------------------------------------------------------------------------
+// Cached Bitmap APIs
+//----------------------------------------------------------------------------
+
+GpStatus WINGDIPAPI
+GdipCreateCachedBitmap(
+ GpBitmap *bitmap,
+ GpGraphics *graphics,
+ GpCachedBitmap **cachedBitmap
+);
+
+GpStatus WINGDIPAPI
+GdipDeleteCachedBitmap(GpCachedBitmap *cachedBitmap);
+
+GpStatus WINGDIPAPI
+GdipDrawCachedBitmap(
+ GpGraphics *graphics,
+ GpCachedBitmap *cachedBitmap,
+ INT x,
+ INT y
+);
+
+UINT WINGDIPAPI
+GdipEmfToWmfBits(
+ HENHMETAFILE hemf,
+ UINT cbData16,
+ LPBYTE pData16,
+ INT iMapMode,
+ INT eFlags
+);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // !_FLATAPI_H
diff --git a/core/src/fxge/Microsoft SDK/include/GdiPlusFont.h b/core/src/fxge/Microsoft SDK/include/GdiPlusFont.h
index c9ff050561..4c9e01f589 100644
--- a/core/src/fxge/Microsoft SDK/include/GdiPlusFont.h
+++ b/core/src/fxge/Microsoft SDK/include/GdiPlusFont.h
@@ -1,299 +1,299 @@
-/**************************************************************************\
-*
-* Copyright (c) 1998-2000, Microsoft Corp. All Rights Reserved.
-*
-* Module Name:
-*
-* GdiplusFont.h
-*
-* Abstract:
-*
-* Font related declarations
-*
-\**************************************************************************/
-
-#ifndef _GDIPLUSFONT_H
-#define _GDIPLUSFONT_H
-
-inline
-Font::Font(IN HDC hdc)
-{
- GpFont *font = NULL;
- lastResult = DllExports::GdipCreateFontFromDC(hdc, &font);
-
-#ifndef DCR_USE_NEW_135429
- if ((INT) lastResult >= 10)
- lastResult = NotFound;
-#endif
-
- SetNativeFont(font);
-}
-
-#ifdef DCR_USE_NEW_127084
-inline
-Font::Font(IN HDC hdc,
- IN const HFONT hfont)
-{
- GpFont *font = NULL;
-
- if (hfont)
- {
- LOGFONTA lf;
-
- if(GetObjectA(hfont, sizeof(LOGFONTA), &lf))
- lastResult = DllExports::GdipCreateFontFromLogfontA(hdc, &lf, &font);
- else
- lastResult = DllExports::GdipCreateFontFromDC(hdc, &font);
- }
- else
- {
- lastResult = DllExports::GdipCreateFontFromDC(hdc, &font);
- }
-
-#ifndef DCR_USE_NEW_135429
- if ((INT) lastResult >= 10)
- lastResult = NotFound;
-#endif
-
- SetNativeFont(font);
-}
-#endif
-
-inline
-Font::Font(IN HDC hdc,
- IN const LOGFONTW* logfont)
-{
- GpFont *font = NULL;
- if (logfont)
- {
- lastResult = DllExports::GdipCreateFontFromLogfontW(hdc, logfont, &font);
- }
- else
- {
- lastResult = DllExports::GdipCreateFontFromDC(hdc, &font);
- }
-
-#ifndef DCR_USE_NEW_135429
- if ((INT) lastResult >= 10)
- lastResult = NotFound;
-#endif
-
- SetNativeFont(font);
-}
-
-inline
-Font::Font(IN HDC hdc,
- IN const LOGFONTA* logfont)
-{
- GpFont *font = NULL;
-
- if (logfont)
- {
- lastResult = DllExports::GdipCreateFontFromLogfontA(hdc, logfont, &font);
- }
- else
- {
- lastResult = DllExports::GdipCreateFontFromDC(hdc, &font);
- }
-
-#ifndef DCR_USE_NEW_135429
- if ((INT) lastResult >= 10)
- lastResult = NotFound;
-#endif
-
- SetNativeFont(font);
-}
-
-inline
-Font::Font(
- IN const FontFamily * family,
- IN REAL emSize,
- IN INT style,
- IN Unit unit
-)
-{
- GpFont *font = NULL;
-
- lastResult = DllExports::GdipCreateFont(family ? family->nativeFamily : NULL,
- emSize,
- style,
- unit,
- &font);
-
-#ifndef DCR_USE_NEW_135429
- if ((INT) lastResult >= 10)
- lastResult = NotFound;
-#endif
-
- SetNativeFont(font);
-}
-
-inline
-Font::Font(
- IN const WCHAR * familyName,
- IN REAL emSize,
- IN INT style,
- IN Unit unit,
- IN const FontCollection * fontCollection
-)
-{
- FontFamily family(familyName, fontCollection);
-
- GpFont * font = NULL;
-
- lastResult = family.GetLastStatus();
-
- if (lastResult == Ok)
- {
- lastResult = DllExports::GdipCreateFont(family.nativeFamily,
- emSize,
- style,
- unit,
- &font);
- }
-
-#ifndef DCR_USE_NEW_135429
- if ((INT) lastResult >= 10)
- lastResult = NotFound;
-#endif
-
- SetNativeFont(font);
-}
-
-inline Status
-Font::GetLogFontA(IN const Graphics *g,
- OUT LOGFONTA *logfontA) const
-{
- return SetStatus(DllExports::GdipGetLogFontA(nativeFont, g ? g->nativeGraphics : NULL, logfontA));
-
-}
-
-inline Status
-Font::GetLogFontW(IN const Graphics *g,
- OUT LOGFONTW *logfontW) const
-{
- return SetStatus(DllExports::GdipGetLogFontW(nativeFont, g ? g->nativeGraphics : NULL, logfontW));
-}
-
-
-inline Font*
-Font::Clone() const
-{
- GpFont *cloneFont = NULL;
-
- SetStatus(DllExports::GdipCloneFont(nativeFont, &cloneFont));
-
- return new Font(cloneFont, lastResult);
-}
-
-inline
-Font::~Font()
-{
- DllExports::GdipDeleteFont(nativeFont);
-}
-
-// Operations
-
-inline BOOL
-Font::IsAvailable() const
-{
- return (nativeFont ? TRUE : FALSE);
-}
-
-inline Status
-Font::GetFamily(OUT FontFamily *family) const
-{
- if (family == NULL)
- {
- return SetStatus(InvalidParameter);
- }
-
- Status status = DllExports::GdipGetFamily(nativeFont, &(family->nativeFamily));
- family->SetStatus(status);
-
- return SetStatus(status);
-}
-
-inline INT
-Font::GetStyle() const
-{
- INT style;
-
- SetStatus(DllExports::GdipGetFontStyle(nativeFont, &style));
-
- return style;
-}
-
-inline REAL
-Font::GetSize() const
-{
- REAL size;
- SetStatus(DllExports::GdipGetFontSize(nativeFont, &size));
- return size;
-}
-
-inline Unit
-Font::GetUnit() const
-{
- Unit unit;
- SetStatus(DllExports::GdipGetFontUnit(nativeFont, &unit));
- return unit;
-}
-
-inline REAL
-Font::GetHeight(IN const Graphics *graphics) const
-{
- REAL height;
- SetStatus(DllExports::GdipGetFontHeight(
- nativeFont,
- graphics ? graphics->nativeGraphics : NULL,
- &height
- ));
- return height;
-}
-
-
-#ifdef DCR_USE_NEW_125467
-inline REAL
-Font::GetHeight(IN REAL dpi = 0) const
-{
- REAL height;
- SetStatus(DllExports::GdipGetFontHeightGivenDPI(nativeFont, dpi, &height));
- return height;
-}
-#endif
-
-
-// protected method
-inline
-Font::Font(IN GpFont* font,
- IN Status status)
-{
- lastResult = status;
- SetNativeFont(font);
-}
-
-// protected method
-inline VOID
-Font::SetNativeFont(GpFont *Font)
-{
- nativeFont = Font;
-}
-
-inline Status
-Font::GetLastStatus(void) const
-{
- return lastResult;
-}
-
-// protected method
-inline Status
-Font::SetStatus(IN Status status) const
-{
- if (status != Ok)
- return (lastResult = status);
- else
- return status;
-}
-
-#endif
+/**************************************************************************\
+*
+* Copyright (c) 1998-2000, Microsoft Corp. All Rights Reserved.
+*
+* Module Name:
+*
+* GdiplusFont.h
+*
+* Abstract:
+*
+* Font related declarations
+*
+\**************************************************************************/
+
+#ifndef _GDIPLUSFONT_H
+#define _GDIPLUSFONT_H
+
+inline
+Font::Font(IN HDC hdc)
+{
+ GpFont *font = NULL;
+ lastResult = DllExports::GdipCreateFontFromDC(hdc, &font);
+
+#ifndef DCR_USE_NEW_135429
+ if ((INT) lastResult >= 10)
+ lastResult = NotFound;
+#endif
+
+ SetNativeFont(font);
+}
+
+#ifdef DCR_USE_NEW_127084
+inline
+Font::Font(IN HDC hdc,
+ IN const HFONT hfont)
+{
+ GpFont *font = NULL;
+
+ if (hfont)
+ {
+ LOGFONTA lf;
+
+ if(GetObjectA(hfont, sizeof(LOGFONTA), &lf))
+ lastResult = DllExports::GdipCreateFontFromLogfontA(hdc, &lf, &font);
+ else
+ lastResult = DllExports::GdipCreateFontFromDC(hdc, &font);
+ }
+ else
+ {
+ lastResult = DllExports::GdipCreateFontFromDC(hdc, &font);
+ }
+
+#ifndef DCR_USE_NEW_135429
+ if ((INT) lastResult >= 10)
+ lastResult = NotFound;
+#endif
+
+ SetNativeFont(font);
+}
+#endif
+
+inline
+Font::Font(IN HDC hdc,
+ IN const LOGFONTW* logfont)
+{
+ GpFont *font = NULL;
+ if (logfont)
+ {
+ lastResult = DllExports::GdipCreateFontFromLogfontW(hdc, logfont, &font);
+ }
+ else
+ {
+ lastResult = DllExports::GdipCreateFontFromDC(hdc, &font);
+ }
+
+#ifndef DCR_USE_NEW_135429
+ if ((INT) lastResult >= 10)
+ lastResult = NotFound;
+#endif
+
+ SetNativeFont(font);
+}
+
+inline
+Font::Font(IN HDC hdc,
+ IN const LOGFONTA* logfont)
+{
+ GpFont *font = NULL;
+
+ if (logfont)
+ {
+ lastResult = DllExports::GdipCreateFontFromLogfontA(hdc, logfont, &font);
+ }
+ else
+ {
+ lastResult = DllExports::GdipCreateFontFromDC(hdc, &font);
+ }
+
+#ifndef DCR_USE_NEW_135429
+ if ((INT) lastResult >= 10)
+ lastResult = NotFound;
+#endif
+
+ SetNativeFont(font);
+}
+
+inline
+Font::Font(
+ IN const FontFamily * family,
+ IN REAL emSize,
+ IN INT style,
+ IN Unit unit
+)
+{
+ GpFont *font = NULL;
+
+ lastResult = DllExports::GdipCreateFont(family ? family->nativeFamily : NULL,
+ emSize,
+ style,
+ unit,
+ &font);
+
+#ifndef DCR_USE_NEW_135429
+ if ((INT) lastResult >= 10)
+ lastResult = NotFound;
+#endif
+
+ SetNativeFont(font);
+}
+
+inline
+Font::Font(
+ IN const WCHAR * familyName,
+ IN REAL emSize,
+ IN INT style,
+ IN Unit unit,
+ IN const FontCollection * fontCollection
+)
+{
+ FontFamily family(familyName, fontCollection);
+
+ GpFont * font = NULL;
+
+ lastResult = family.GetLastStatus();
+
+ if (lastResult == Ok)
+ {
+ lastResult = DllExports::GdipCreateFont(family.nativeFamily,
+ emSize,
+ style,
+ unit,
+ &font);
+ }
+
+#ifndef DCR_USE_NEW_135429
+ if ((INT) lastResult >= 10)
+ lastResult = NotFound;
+#endif
+
+ SetNativeFont(font);
+}
+
+inline Status
+Font::GetLogFontA(IN const Graphics *g,
+ OUT LOGFONTA *logfontA) const
+{
+ return SetStatus(DllExports::GdipGetLogFontA(nativeFont, g ? g->nativeGraphics : NULL, logfontA));
+
+}
+
+inline Status
+Font::GetLogFontW(IN const Graphics *g,
+ OUT LOGFONTW *logfontW) const
+{
+ return SetStatus(DllExports::GdipGetLogFontW(nativeFont, g ? g->nativeGraphics : NULL, logfontW));
+}
+
+
+inline Font*
+Font::Clone() const
+{
+ GpFont *cloneFont = NULL;
+
+ SetStatus(DllExports::GdipCloneFont(nativeFont, &cloneFont));
+
+ return new Font(cloneFont, lastResult);
+}
+
+inline
+Font::~Font()
+{
+ DllExports::GdipDeleteFont(nativeFont);
+}
+
+// Operations
+
+inline BOOL
+Font::IsAvailable() const
+{
+ return (nativeFont ? TRUE : FALSE);
+}
+
+inline Status
+Font::GetFamily(OUT FontFamily *family) const
+{
+ if (family == NULL)
+ {
+ return SetStatus(InvalidParameter);
+ }
+
+ Status status = DllExports::GdipGetFamily(nativeFont, &(family->nativeFamily));
+ family->SetStatus(status);
+
+ return SetStatus(status);
+}
+
+inline INT
+Font::GetStyle() const
+{
+ INT style;
+
+ SetStatus(DllExports::GdipGetFontStyle(nativeFont, &style));
+
+ return style;
+}
+
+inline REAL
+Font::GetSize() const
+{
+ REAL size;
+ SetStatus(DllExports::GdipGetFontSize(nativeFont, &size));
+ return size;
+}
+
+inline Unit
+Font::GetUnit() const
+{
+ Unit unit;
+ SetStatus(DllExports::GdipGetFontUnit(nativeFont, &unit));
+ return unit;
+}
+
+inline REAL
+Font::GetHeight(IN const Graphics *graphics) const
+{
+ REAL height;
+ SetStatus(DllExports::GdipGetFontHeight(
+ nativeFont,
+ graphics ? graphics->nativeGraphics : NULL,
+ &height
+ ));
+ return height;
+}
+
+
+#ifdef DCR_USE_NEW_125467
+inline REAL
+Font::GetHeight(IN REAL dpi = 0) const
+{
+ REAL height;
+ SetStatus(DllExports::GdipGetFontHeightGivenDPI(nativeFont, dpi, &height));
+ return height;
+}
+#endif
+
+
+// protected method
+inline
+Font::Font(IN GpFont* font,
+ IN Status status)
+{
+ lastResult = status;
+ SetNativeFont(font);
+}
+
+// protected method
+inline VOID
+Font::SetNativeFont(GpFont *Font)
+{
+ nativeFont = Font;
+}
+
+inline Status
+Font::GetLastStatus(void) const
+{
+ return lastResult;
+}
+
+// protected method
+inline Status
+Font::SetStatus(IN Status status) const
+{
+ if (status != Ok)
+ return (lastResult = status);
+ else
+ return status;
+}
+
+#endif
diff --git a/core/src/fxge/Microsoft SDK/include/GdiPlusFontCollection.h b/core/src/fxge/Microsoft SDK/include/GdiPlusFontCollection.h
index d2257ba456..2f3351c95b 100644
--- a/core/src/fxge/Microsoft SDK/include/GdiPlusFontCollection.h
+++ b/core/src/fxge/Microsoft SDK/include/GdiPlusFontCollection.h
@@ -1,149 +1,149 @@
-/**************************************************************************\
-*
-* Copyright (c) 2000, Microsoft Corp. All Rights Reserved.
-*
-* Module Name:
-*
-* GdiplusFontCollection.h
-*
-* Abstract:
-*
-* Font collections (Installed and Private)
-*
-\**************************************************************************/
-
-#ifndef _GDIPLUSFONTCOLL_H
-#define _GDIPLUSFONTCOLL_H
-
-inline
-FontCollection::FontCollection()
-{
- nativeFontCollection = NULL;
-}
-
-inline
-FontCollection::~FontCollection()
-{
-}
-
-inline INT
-FontCollection::GetFamilyCount() const
-{
- INT numFound = 0;
-
- lastResult = DllExports::GdipGetFontCollectionFamilyCount(
- nativeFontCollection, &numFound);
-
-
-
- return numFound;
-}
-
-inline Status
-FontCollection::GetFamilies(
- IN INT numSought,
- OUT FontFamily * gpfamilies,
- OUT INT * numFound
-) const
-{
- if (numSought <= 0 || gpfamilies == NULL || numFound == NULL)
- {
- return SetStatus(InvalidParameter);
- }
- *numFound = 0;
- GpFontFamily **nativeFamilyList = new GpFontFamily*[numSought];
-
- if (nativeFamilyList == NULL)
- {
- return SetStatus(OutOfMemory);
- }
-
- Status status = SetStatus(DllExports::GdipGetFontCollectionFamilyList(
- nativeFontCollection,
- numSought,
- nativeFamilyList,
- numFound
- ));
- if (status == Ok)
- {
- for (INT i = 0; i < *numFound; i++)
- {
- DllExports::GdipCloneFontFamily(nativeFamilyList[i],
- &gpfamilies[i].nativeFamily);
- }
- }
-
- delete [] nativeFamilyList;
-
- return status;
-}
-
-inline Status FontCollection::GetLastStatus () const
-{
- return lastResult;
-}
-
-// protected method
-inline Status
-FontCollection::SetStatus(IN Status status) const
-{
- lastResult = status;
- return lastResult;
-}
-
-inline
-InstalledFontCollection::InstalledFontCollection()
-{
- nativeFontCollection = NULL;
- lastResult = DllExports::GdipNewInstalledFontCollection(&nativeFontCollection);
-}
-
-inline
-InstalledFontCollection::~InstalledFontCollection()
-{
-}
-
-#ifndef DCR_USE_NEW_235072
-inline Status
-InstalledFontCollection::InstallFontFile(IN const WCHAR* filename)
-{
- return SetStatus(DllExports::GdipInstallFontFile(nativeFontCollection, filename));
-}
-
-inline Status
-InstalledFontCollection::UninstallFontFile(IN const WCHAR* filename)
-{
- return SetStatus(DllExports::GdipUninstallFontFile(nativeFontCollection, filename));
-}
-#endif
-
-inline
-PrivateFontCollection::PrivateFontCollection()
-{
- nativeFontCollection = NULL;
- lastResult = DllExports::GdipNewPrivateFontCollection(&nativeFontCollection);
-}
-
-inline
-PrivateFontCollection::~PrivateFontCollection()
-{
- DllExports::GdipDeletePrivateFontCollection(&nativeFontCollection);
-}
-
-inline Status
-PrivateFontCollection::AddFontFile(IN const WCHAR* filename)
-{
- return SetStatus(DllExports::GdipPrivateAddFontFile(nativeFontCollection, filename));
-}
-
-inline Status
-PrivateFontCollection::AddMemoryFont(IN const void* memory,
- IN INT length)
-{
- return SetStatus(DllExports::GdipPrivateAddMemoryFont(
- nativeFontCollection,
- memory,
- length));
-}
-
-#endif // _GDIPLUSFONTCOLL_H
+/**************************************************************************\
+*
+* Copyright (c) 2000, Microsoft Corp. All Rights Reserved.
+*
+* Module Name:
+*
+* GdiplusFontCollection.h
+*
+* Abstract:
+*
+* Font collections (Installed and Private)
+*
+\**************************************************************************/
+
+#ifndef _GDIPLUSFONTCOLL_H
+#define _GDIPLUSFONTCOLL_H
+
+inline
+FontCollection::FontCollection()
+{
+ nativeFontCollection = NULL;
+}
+
+inline
+FontCollection::~FontCollection()
+{
+}
+
+inline INT
+FontCollection::GetFamilyCount() const
+{
+ INT numFound = 0;
+
+ lastResult = DllExports::GdipGetFontCollectionFamilyCount(
+ nativeFontCollection, &numFound);
+
+
+
+ return numFound;
+}
+
+inline Status
+FontCollection::GetFamilies(
+ IN INT numSought,
+ OUT FontFamily * gpfamilies,
+ OUT INT * numFound
+) const
+{
+ if (numSought <= 0 || gpfamilies == NULL || numFound == NULL)
+ {
+ return SetStatus(InvalidParameter);
+ }
+ *numFound = 0;
+ GpFontFamily **nativeFamilyList = new GpFontFamily*[numSought];
+
+ if (nativeFamilyList == NULL)
+ {
+ return SetStatus(OutOfMemory);
+ }
+
+ Status status = SetStatus(DllExports::GdipGetFontCollectionFamilyList(
+ nativeFontCollection,
+ numSought,
+ nativeFamilyList,
+ numFound
+ ));
+ if (status == Ok)
+ {
+ for (INT i = 0; i < *numFound; i++)
+ {
+ DllExports::GdipCloneFontFamily(nativeFamilyList[i],
+ &gpfamilies[i].nativeFamily);
+ }
+ }
+
+ delete [] nativeFamilyList;
+
+ return status;
+}
+
+inline Status FontCollection::GetLastStatus () const
+{
+ return lastResult;
+}
+
+// protected method
+inline Status
+FontCollection::SetStatus(IN Status status) const
+{
+ lastResult = status;
+ return lastResult;
+}
+
+inline
+InstalledFontCollection::InstalledFontCollection()
+{
+ nativeFontCollection = NULL;
+ lastResult = DllExports::GdipNewInstalledFontCollection(&nativeFontCollection);
+}
+
+inline
+InstalledFontCollection::~InstalledFontCollection()
+{
+}
+
+#ifndef DCR_USE_NEW_235072
+inline Status
+InstalledFontCollection::InstallFontFile(IN const WCHAR* filename)
+{
+ return SetStatus(DllExports::GdipInstallFontFile(nativeFontCollection, filename));
+}
+
+inline Status
+InstalledFontCollection::UninstallFontFile(IN const WCHAR* filename)
+{
+ return SetStatus(DllExports::GdipUninstallFontFile(nativeFontCollection, filename));
+}
+#endif
+
+inline
+PrivateFontCollection::PrivateFontCollection()
+{
+ nativeFontCollection = NULL;
+ lastResult = DllExports::GdipNewPrivateFontCollection(&nativeFontCollection);
+}
+
+inline
+PrivateFontCollection::~PrivateFontCollection()
+{
+ DllExports::GdipDeletePrivateFontCollection(&nativeFontCollection);
+}
+
+inline Status
+PrivateFontCollection::AddFontFile(IN const WCHAR* filename)
+{
+ return SetStatus(DllExports::GdipPrivateAddFontFile(nativeFontCollection, filename));
+}
+
+inline Status
+PrivateFontCollection::AddMemoryFont(IN const void* memory,
+ IN INT length)
+{
+ return SetStatus(DllExports::GdipPrivateAddMemoryFont(
+ nativeFontCollection,
+ memory,
+ length));
+}
+
+#endif // _GDIPLUSFONTCOLL_H
diff --git a/core/src/fxge/Microsoft SDK/include/GdiPlusFontFamily.h b/core/src/fxge/Microsoft SDK/include/GdiPlusFontFamily.h
index ef2f3dde9b..076e1572ac 100644
--- a/core/src/fxge/Microsoft SDK/include/GdiPlusFontFamily.h
+++ b/core/src/fxge/Microsoft SDK/include/GdiPlusFontFamily.h
@@ -1,271 +1,271 @@
-/**************************************************************************\
-*
-* Copyright (c) 1998-2000, Microsoft Corp. All Rights Reserved.
-*
-* Module Name:
-*
-* GdiplusFontFamily.h
-*
-* Abstract:
-*
-* Font family API related declarations
-*
-\**************************************************************************/
-
-#ifndef _GDIPLUS_FONT_FAMILY_H
-#define _GDIPLUS_FONT_FAMILY_H
-
-inline
-FontFamily::FontFamily() :
- nativeFamily (NULL),
- lastResult (Ok)
-{
-}
-
-inline
-FontFamily::FontFamily(
- IN const WCHAR* name,
- IN const FontCollection* fontCollection
-)
-{
- nativeFamily = NULL;
- lastResult = DllExports::GdipCreateFontFamilyFromName(
- name,
- fontCollection ? fontCollection->nativeFontCollection : NULL,
- &nativeFamily
- );
-
-#ifndef DCR_USE_NEW_135429
- if ((INT) lastResult >= 10)
- lastResult = NotFound;
-#endif
-}
-
-// private method
-inline
-FontFamily::FontFamily(
- IN GpFontFamily *nativeOrig,
- IN Status status
-)
-{
- lastResult = status;
- nativeFamily = nativeOrig;
-}
-
-// Generic font family access
-
-inline const FontFamily *
-FontFamily::GenericSansSerif()
-{
- if (GenericSansSerifFontFamily != NULL)
- {
- return GenericSansSerifFontFamily;
- }
-
- GenericSansSerifFontFamily =
- (FontFamily*) GenericSansSerifFontFamilyBuffer;
-
- GenericSansSerifFontFamily->lastResult =
- DllExports::GdipGetGenericFontFamilySansSerif(
- &(GenericSansSerifFontFamily->nativeFamily)
- );
-
-#ifndef DCR_USE_NEW_135429
- if ((INT) GenericSansSerifFontFamily->lastResult >= 10)
- GenericSansSerifFontFamily->lastResult = NotFound;
-#endif
-
- return GenericSansSerifFontFamily;
-}
-
-inline const FontFamily *
-FontFamily::GenericSerif()
-{
- if (GenericSerifFontFamily != NULL)
- {
- return GenericSerifFontFamily;
- }
-
- GenericSerifFontFamily =
- (FontFamily*) GenericSerifFontFamilyBuffer;
-
- GenericSerifFontFamily->lastResult =
- DllExports::GdipGetGenericFontFamilySerif(
- &(GenericSerifFontFamily->nativeFamily)
- );
-
-#ifndef DCR_USE_NEW_135429
- if ((INT) GenericSerifFontFamily->lastResult >= 10)
- GenericSerifFontFamily->lastResult = NotFound;
-#endif
-
- return GenericSerifFontFamily;
-}
-
-inline const FontFamily *
-FontFamily::GenericMonospace()
-{
- if (GenericMonospaceFontFamily != NULL)
- {
- return GenericMonospaceFontFamily;
- }
-
- GenericMonospaceFontFamily =
- (FontFamily*) GenericMonospaceFontFamilyBuffer;
-
- GenericMonospaceFontFamily->lastResult =
- DllExports::GdipGetGenericFontFamilyMonospace(
- &(GenericMonospaceFontFamily->nativeFamily)
- );
-
-#ifndef DCR_USE_NEW_135429
- if ((INT) GenericMonospaceFontFamily->lastResult >= 10)
- GenericMonospaceFontFamily->lastResult = NotFound;
-#endif
-
- return GenericMonospaceFontFamily;
-}
-
-inline FontFamily::~FontFamily()
-{
- DllExports::GdipDeleteFontFamily (nativeFamily);
-}
-
-inline FontFamily *
-FontFamily::Clone() const
-{
- GpFontFamily * clonedFamily = NULL;
-
- SetStatus(DllExports::GdipCloneFontFamily (nativeFamily, &clonedFamily));
-
- return new FontFamily(clonedFamily, lastResult);
-}
-
-inline Status
-FontFamily::GetFamilyName(
- IN WCHAR name[LF_FACESIZE],
- IN LANGID language
-) const
-{
- return SetStatus(DllExports::GdipGetFamilyName(nativeFamily,
- name,
- language));
-}
-
-inline BOOL
-FontFamily::IsStyleAvailable(IN INT style) const
-{
- BOOL StyleAvailable;
- Status status;
-
- status = SetStatus(DllExports::GdipIsStyleAvailable(nativeFamily, style, &StyleAvailable));
-
- if (status != Ok)
- StyleAvailable = FALSE;
-
- return StyleAvailable;
-}
-
-
-inline UINT16
-FontFamily::GetEmHeight(IN INT style) const
-{
- UINT16 EmHeight;
-
- SetStatus(DllExports::GdipGetEmHeight(nativeFamily, style, &EmHeight));
-
- return EmHeight;
-}
-
-inline UINT16
-FontFamily::GetCellAscent(IN INT style) const
-{
- UINT16 CellAscent;
-
- SetStatus(DllExports::GdipGetCellAscent(nativeFamily, style, &CellAscent));
-
- return CellAscent;
-}
-
-inline UINT16
-FontFamily::GetCellDescent(IN INT style) const
-{
- UINT16 CellDescent;
-
- SetStatus(DllExports::GdipGetCellDescent(nativeFamily, style, &CellDescent));
-
- return CellDescent;
-}
-
-
-inline UINT16
-FontFamily::GetLineSpacing(IN INT style) const
-{
- UINT16 LineSpacing;
-
- SetStatus(DllExports::GdipGetLineSpacing(nativeFamily, style, &LineSpacing));
-
- return LineSpacing;
-
-}
-
-#ifdef TEXTV2
-
-// The following APIs return data from the font OS/2 table
-
-inline INT16
-FontFamily::GetTypographicAscent(IN INT style) const
-{
- INT16 TypographicAscent;
-
- SetStatus(DllExports::GdipGetTypographicAscent(nativeFamily, style, &TypographicAscent));
-
- return TypographicAscent;
-}
-
-inline INT16
-FontFamily::GetTypographicDescent(IN INT style) const
-{
- INT16 TypographicDescent;
-
- SetStatus(DllExports::GdipGetTypographicDescent(nativeFamily, style, &TypographicDescent));
-
- return TypographicDescent;
-}
-
-inline INT16
-FontFamily::GetTypographicLineGap(IN INT style) const
-{
- INT16 TypographicLineGap;
-
- SetStatus(DllExports::GdipGetTypographicLineGap(nativeFamily, style, &TypographicLineGap));
-
- return TypographicLineGap;
-}
-
-#endif
-
-///////////////////////////////////////////////////////////
-
-// GetLastStatus - return last error code and clear error code
-
-inline Status
-FontFamily::GetLastStatus() const
-{
- Status lastStatus = lastResult;
- lastResult = Ok;
-
- return lastStatus;
-}
-
-// protected method
-inline Status
-FontFamily::SetStatus(Status status) const
-{
- if (status != Ok)
- return (lastResult = status);
- else
- return status;
-}
-
-#endif
+/**************************************************************************\
+*
+* Copyright (c) 1998-2000, Microsoft Corp. All Rights Reserved.
+*
+* Module Name:
+*
+* GdiplusFontFamily.h
+*
+* Abstract:
+*
+* Font family API related declarations
+*
+\**************************************************************************/
+
+#ifndef _GDIPLUS_FONT_FAMILY_H
+#define _GDIPLUS_FONT_FAMILY_H
+
+inline
+FontFamily::FontFamily() :
+ nativeFamily (NULL),
+ lastResult (Ok)
+{
+}
+
+inline
+FontFamily::FontFamily(
+ IN const WCHAR* name,
+ IN const FontCollection* fontCollection
+)
+{
+ nativeFamily = NULL;
+ lastResult = DllExports::GdipCreateFontFamilyFromName(
+ name,
+ fontCollection ? fontCollection->nativeFontCollection : NULL,
+ &nativeFamily
+ );
+
+#ifndef DCR_USE_NEW_135429
+ if ((INT) lastResult >= 10)
+ lastResult = NotFound;
+#endif
+}
+
+// private method
+inline
+FontFamily::FontFamily(
+ IN GpFontFamily *nativeOrig,
+ IN Status status
+)
+{
+ lastResult = status;
+ nativeFamily = nativeOrig;
+}
+
+// Generic font family access
+
+inline const FontFamily *
+FontFamily::GenericSansSerif()
+{
+ if (GenericSansSerifFontFamily != NULL)
+ {
+ return GenericSansSerifFontFamily;
+ }
+
+ GenericSansSerifFontFamily =
+ (FontFamily*) GenericSansSerifFontFamilyBuffer;
+
+ GenericSansSerifFontFamily->lastResult =
+ DllExports::GdipGetGenericFontFamilySansSerif(
+ &(GenericSansSerifFontFamily->nativeFamily)
+ );
+
+#ifndef DCR_USE_NEW_135429
+ if ((INT) GenericSansSerifFontFamily->lastResult >= 10)
+ GenericSansSerifFontFamily->lastResult = NotFound;
+#endif
+
+ return GenericSansSerifFontFamily;
+}
+
+inline const FontFamily *
+FontFamily::GenericSerif()
+{
+ if (GenericSerifFontFamily != NULL)
+ {
+ return GenericSerifFontFamily;
+ }
+
+ GenericSerifFontFamily =
+ (FontFamily*) GenericSerifFontFamilyBuffer;
+
+ GenericSerifFontFamily->lastResult =
+ DllExports::GdipGetGenericFontFamilySerif(
+ &(GenericSerifFontFamily->nativeFamily)
+ );
+
+#ifndef DCR_USE_NEW_135429
+ if ((INT) GenericSerifFontFamily->lastResult >= 10)
+ GenericSerifFontFamily->lastResult = NotFound;
+#endif
+
+ return GenericSerifFontFamily;
+}
+
+inline const FontFamily *
+FontFamily::GenericMonospace()
+{
+ if (GenericMonospaceFontFamily != NULL)
+ {
+ return GenericMonospaceFontFamily;
+ }
+
+ GenericMonospaceFontFamily =
+ (FontFamily*) GenericMonospaceFontFamilyBuffer;
+
+ GenericMonospaceFontFamily->lastResult =
+ DllExports::GdipGetGenericFontFamilyMonospace(
+ &(GenericMonospaceFontFamily->nativeFamily)
+ );
+
+#ifndef DCR_USE_NEW_135429
+ if ((INT) GenericMonospaceFontFamily->lastResult >= 10)
+ GenericMonospaceFontFamily->lastResult = NotFound;
+#endif
+
+ return GenericMonospaceFontFamily;
+}
+
+inline FontFamily::~FontFamily()
+{
+ DllExports::GdipDeleteFontFamily (nativeFamily);
+}
+
+inline FontFamily *
+FontFamily::Clone() const
+{
+ GpFontFamily * clonedFamily = NULL;
+
+ SetStatus(DllExports::GdipCloneFontFamily (nativeFamily, &clonedFamily));
+
+ return new FontFamily(clonedFamily, lastResult);
+}
+
+inline Status
+FontFamily::GetFamilyName(
+ IN WCHAR name[LF_FACESIZE],
+ IN LANGID language
+) const
+{
+ return SetStatus(DllExports::GdipGetFamilyName(nativeFamily,
+ name,
+ language));
+}
+
+inline BOOL
+FontFamily::IsStyleAvailable(IN INT style) const
+{
+ BOOL StyleAvailable;
+ Status status;
+
+ status = SetStatus(DllExports::GdipIsStyleAvailable(nativeFamily, style, &StyleAvailable));
+
+ if (status != Ok)
+ StyleAvailable = FALSE;
+
+ return StyleAvailable;
+}
+
+
+inline UINT16
+FontFamily::GetEmHeight(IN INT style) const
+{
+ UINT16 EmHeight;
+
+ SetStatus(DllExports::GdipGetEmHeight(nativeFamily, style, &EmHeight));
+
+ return EmHeight;
+}
+
+inline UINT16
+FontFamily::GetCellAscent(IN INT style) const
+{
+ UINT16 CellAscent;
+
+ SetStatus(DllExports::GdipGetCellAscent(nativeFamily, style, &CellAscent));
+
+ return CellAscent;
+}
+
+inline UINT16
+FontFamily::GetCellDescent(IN INT style) const
+{
+ UINT16 CellDescent;
+
+ SetStatus(DllExports::GdipGetCellDescent(nativeFamily, style, &CellDescent));
+
+ return CellDescent;
+}
+
+
+inline UINT16
+FontFamily::GetLineSpacing(IN INT style) const
+{
+ UINT16 LineSpacing;
+
+ SetStatus(DllExports::GdipGetLineSpacing(nativeFamily, style, &LineSpacing));
+
+ return LineSpacing;
+
+}
+
+#ifdef TEXTV2
+
+// The following APIs return data from the font OS/2 table
+
+inline INT16
+FontFamily::GetTypographicAscent(IN INT style) const
+{
+ INT16 TypographicAscent;
+
+ SetStatus(DllExports::GdipGetTypographicAscent(nativeFamily, style, &TypographicAscent));
+
+ return TypographicAscent;
+}
+
+inline INT16
+FontFamily::GetTypographicDescent(IN INT style) const
+{
+ INT16 TypographicDescent;
+
+ SetStatus(DllExports::GdipGetTypographicDescent(nativeFamily, style, &TypographicDescent));
+
+ return TypographicDescent;
+}
+
+inline INT16
+FontFamily::GetTypographicLineGap(IN INT style) const
+{
+ INT16 TypographicLineGap;
+
+ SetStatus(DllExports::GdipGetTypographicLineGap(nativeFamily, style, &TypographicLineGap));
+
+ return TypographicLineGap;
+}
+
+#endif
+
+///////////////////////////////////////////////////////////
+
+// GetLastStatus - return last error code and clear error code
+
+inline Status
+FontFamily::GetLastStatus() const
+{
+ Status lastStatus = lastResult;
+ lastResult = Ok;
+
+ return lastStatus;
+}
+
+// protected method
+inline Status
+FontFamily::SetStatus(Status status) const
+{
+ if (status != Ok)
+ return (lastResult = status);
+ else
+ return status;
+}
+
+#endif
diff --git a/core/src/fxge/Microsoft SDK/include/GdiPlusGpStubs.h b/core/src/fxge/Microsoft SDK/include/GdiPlusGpStubs.h
index 121288de57..4f6066ccef 100644
--- a/core/src/fxge/Microsoft SDK/include/GdiPlusGpStubs.h
+++ b/core/src/fxge/Microsoft SDK/include/GdiPlusGpStubs.h
@@ -1,107 +1,107 @@
-/**************************************************************************\
-*
-* Copyright (c) 1998-2000, Microsoft Corp. All Rights Reserved.
-*
-* Module Name:
-*
-* GdiplusGpStubs.h
-*
-* Abstract:
-*
-* GDI+ Native C++ public header file
-*
-\**************************************************************************/
-
-#ifndef _GDIPLUSGPSTUBS_H
-#define _GDIPLUSGPSTUBS_H
-
-//---------------------------------------------------------------------------
-// GDI+ classes for forward reference
-//---------------------------------------------------------------------------
-
-class Graphics;
-class Pen;
-class Brush;
-class Matrix;
-class Bitmap;
-class Metafile;
-class GraphicsPath;
-class PathIterator;
-class Region;
-class Image;
-class TextureBrush;
-class HatchBrush;
-class SolidBrush;
-class LinearGradientBrush;
-class PathGradientBrush;
-class Font;
-class FontFamily;
-class FontCollection;
-class InstalledFontCollection;
-class PrivateFontCollection;
-class ImageAttributes;
-class CachedBitmap;
-
-//---------------------------------------------------------------------------
-// Internal GDI+ classes for internal type checking
-//---------------------------------------------------------------------------
-class GpGraphics {};
-
-class GpBrush {};
-class GpTexture : public GpBrush {};
-class GpSolidFill : public GpBrush {};
-class GpLineGradient : public GpBrush {};
-class GpPathGradient : public GpBrush {};
-class GpHatch : public GpBrush {};
-
-class GpPen {};
-class GpCustomLineCap {};
-class GpAdjustableArrowCap : public GpCustomLineCap {};
-
-class GpImage {};
-class GpBitmap : public GpImage {};
-class GpMetafile : public GpImage {};
-class GpImageAttributes {};
-
-class GpPath {};
-class GpRegion {};
-class GpPathIterator {};
-
-class GpFontFamily {};
-class GpFont {};
-class GpStringFormat {};
-class GpFontCollection {};
-class GpInstalledFontCollection : public GpFontCollection {};
-class GpPrivateFontCollection : public GpFontCollection {};
-
-class GpCachedBitmap;
-
-typedef Status GpStatus;
-typedef FillMode GpFillMode;
-typedef WrapMode GpWrapMode;
-typedef Unit GpUnit;
-typedef CoordinateSpace GpCoordinateSpace;
-typedef PointF GpPointF;
-typedef Point GpPoint;
-typedef RectF GpRectF;
-typedef Rect GpRect;
-typedef SizeF GpSizeF;
-typedef HatchStyle GpHatchStyle;
-typedef DashStyle GpDashStyle;
-typedef LineCap GpLineCap;
-typedef DashCap GpDashCap;
-
-
-typedef PenAlignment GpPenAlignment;
-
-typedef LineJoin GpLineJoin;
-typedef PenType GpPenType;
-
-typedef Matrix GpMatrix;
-typedef BrushType GpBrushType;
-typedef MatrixOrder GpMatrixOrder;
-typedef FlushIntention GpFlushIntention;
-typedef PathData GpPathData;
-
-#endif // !_GDIPLUSGPSTUBS.HPP
-
+/**************************************************************************\
+*
+* Copyright (c) 1998-2000, Microsoft Corp. All Rights Reserved.
+*
+* Module Name:
+*
+* GdiplusGpStubs.h
+*
+* Abstract:
+*
+* GDI+ Native C++ public header file
+*
+\**************************************************************************/
+
+#ifndef _GDIPLUSGPSTUBS_H
+#define _GDIPLUSGPSTUBS_H
+
+//---------------------------------------------------------------------------
+// GDI+ classes for forward reference
+//---------------------------------------------------------------------------
+
+class Graphics;
+class Pen;
+class Brush;
+class Matrix;
+class Bitmap;
+class Metafile;
+class GraphicsPath;
+class PathIterator;
+class Region;
+class Image;
+class TextureBrush;
+class HatchBrush;
+class SolidBrush;
+class LinearGradientBrush;
+class PathGradientBrush;
+class Font;
+class FontFamily;
+class FontCollection;
+class InstalledFontCollection;
+class PrivateFontCollection;
+class ImageAttributes;
+class CachedBitmap;
+
+//---------------------------------------------------------------------------
+// Internal GDI+ classes for internal type checking
+//---------------------------------------------------------------------------
+class GpGraphics {};
+
+class GpBrush {};
+class GpTexture : public GpBrush {};
+class GpSolidFill : public GpBrush {};
+class GpLineGradient : public GpBrush {};
+class GpPathGradient : public GpBrush {};
+class GpHatch : public GpBrush {};
+
+class GpPen {};
+class GpCustomLineCap {};
+class GpAdjustableArrowCap : public GpCustomLineCap {};
+
+class GpImage {};
+class GpBitmap : public GpImage {};
+class GpMetafile : public GpImage {};
+class GpImageAttributes {};
+
+class GpPath {};
+class GpRegion {};
+class GpPathIterator {};
+
+class GpFontFamily {};
+class GpFont {};
+class GpStringFormat {};
+class GpFontCollection {};
+class GpInstalledFontCollection : public GpFontCollection {};
+class GpPrivateFontCollection : public GpFontCollection {};
+
+class GpCachedBitmap;
+
+typedef Status GpStatus;
+typedef FillMode GpFillMode;
+typedef WrapMode GpWrapMode;
+typedef Unit GpUnit;
+typedef CoordinateSpace GpCoordinateSpace;
+typedef PointF GpPointF;
+typedef Point GpPoint;
+typedef RectF GpRectF;
+typedef Rect GpRect;
+typedef SizeF GpSizeF;
+typedef HatchStyle GpHatchStyle;
+typedef DashStyle GpDashStyle;
+typedef LineCap GpLineCap;
+typedef DashCap GpDashCap;
+
+
+typedef PenAlignment GpPenAlignment;
+
+typedef LineJoin GpLineJoin;
+typedef PenType GpPenType;
+
+typedef Matrix GpMatrix;
+typedef BrushType GpBrushType;
+typedef MatrixOrder GpMatrixOrder;
+typedef FlushIntention GpFlushIntention;
+typedef PathData GpPathData;
+
+#endif // !_GDIPLUSGPSTUBS.HPP
+
diff --git a/core/src/fxge/Microsoft SDK/include/GdiPlusGraphics.h b/core/src/fxge/Microsoft SDK/include/GdiPlusGraphics.h
index 7b39a6ea71..4e4e3dae12 100644
--- a/core/src/fxge/Microsoft SDK/include/GdiPlusGraphics.h
+++ b/core/src/fxge/Microsoft SDK/include/GdiPlusGraphics.h
@@ -1,2726 +1,2726 @@
-/**************************************************************************\
-*
-* Copyright (c) 1998-2000, Microsoft Corp. All Rights Reserved.
-*
-* Module Name:
-*
-* GdiplusGraphics.h
-*
-* Abstract:
-*
-* Declarations for Graphics class
-*
-\**************************************************************************/
-
-#ifndef _GDIPLUSGRAPHICS_H
-#define _GDIPLUSGRAPHICS_H
-
-/**
- * Represent a graphics context
- */
-class Graphics : public GdiplusBase
-{
-public:
- friend class Region;
- friend class GraphicsPath;
- friend class Image;
- friend class Bitmap;
- friend class Metafile;
- friend class Font;
- friend class FontFamily;
- friend class FontCollection;
- friend class CachedBitmap;
-
- // Get a graphics context from an existing Win32 HDC or HWND
- static Graphics* FromHDC(IN HDC hdc)
- {
- return new Graphics(hdc);
- }
-
- static Graphics* FromHDC(IN HDC hdc,
- IN HANDLE hdevice)
- {
- return new Graphics(hdc, hdevice);
- }
-
- static Graphics* FromHWND(IN HWND hwnd,
- IN BOOL icm = FALSE)
- {
- return new Graphics(hwnd, icm);
- }
-
- static Graphics* FromImage(IN Image *image)
- {
- return new Graphics(image);
- }
-
- Graphics(IN HDC hdc)
- {
- GpGraphics *graphics = NULL;
-
- lastResult = DllExports::GdipCreateFromHDC(hdc, &graphics);
-
- SetNativeGraphics(graphics);
- }
-
- Graphics(IN HDC hdc,
- IN HANDLE hdevice)
- {
- GpGraphics *graphics = NULL;
-
- lastResult = DllExports::GdipCreateFromHDC2(hdc, hdevice, &graphics);
-
- SetNativeGraphics(graphics);
- }
-
- Graphics(IN HWND hwnd,
- IN BOOL icm = FALSE)
- {
- GpGraphics *graphics = NULL;
-
- if (icm)
- {
- lastResult = DllExports::GdipCreateFromHWNDICM(hwnd, &graphics);
- }
- else
- {
- lastResult = DllExports::GdipCreateFromHWND(hwnd, &graphics);
- }
-
- SetNativeGraphics(graphics);
- }
-
- Graphics(IN Image* image)
- {
- GpGraphics *graphics = NULL;
-
- if (image != NULL)
- {
- lastResult = DllExports::GdipGetImageGraphicsContext(
- image->nativeImage, &graphics);
- }
- SetNativeGraphics(graphics);
- }
-
- ~Graphics()
- {
- DllExports::GdipDeleteGraphics(nativeGraphics);
- }
-
- VOID Flush(IN FlushIntention intention = FlushIntentionFlush)
- {
- DllExports::GdipFlush(nativeGraphics, intention);
- }
-
- //------------------------------------------------------------------------
- // Interop methods
- //------------------------------------------------------------------------
-
- // Locks the graphics until ReleaseDC is called
- HDC GetHDC()
- {
- HDC hdc = NULL;
-
- SetStatus(DllExports::GdipGetDC(nativeGraphics, &hdc));
-
- return hdc;
- }
-
- VOID ReleaseHDC(IN HDC hdc)
- {
- SetStatus(DllExports::GdipReleaseDC(nativeGraphics, hdc));
- }
-
- //------------------------------------------------------------------------
- // Rendering modes
- //------------------------------------------------------------------------
-
- Status SetRenderingOrigin(IN INT x, IN INT y)
- {
- return SetStatus(
- DllExports::GdipSetRenderingOrigin(
- nativeGraphics, x, y
- )
- );
- }
-
- Status GetRenderingOrigin(OUT INT *x, OUT INT *y) const
- {
- return SetStatus(
- DllExports::GdipGetRenderingOrigin(
- nativeGraphics, x, y
- )
- );
- }
-
- Status SetCompositingMode(IN CompositingMode compositingMode)
- {
- return SetStatus(DllExports::GdipSetCompositingMode(nativeGraphics,
- compositingMode));
- }
-
- CompositingMode GetCompositingMode() const
- {
- CompositingMode mode;
-
- SetStatus(DllExports::GdipGetCompositingMode(nativeGraphics,
- &mode));
-
- return mode;
- }
-
- Status SetCompositingQuality(IN CompositingQuality compositingQuality)
- {
- return SetStatus(DllExports::GdipSetCompositingQuality(
- nativeGraphics,
- compositingQuality));
- }
-
- CompositingQuality GetCompositingQuality() const
- {
- CompositingQuality quality;
-
- SetStatus(DllExports::GdipGetCompositingQuality(
- nativeGraphics,
- &quality));
-
- return quality;
- }
-
- Status SetTextRenderingHint(IN TextRenderingHint newMode)
- {
-#ifndef DCR_USE_NEW_186764
- /* temporarly set the high bit to warn that we are using the new definition for the flag */
- newMode = (TextRenderingHint) (newMode | 0x0f000);
-#endif // DCR_USE_NEW_186764
- return SetStatus(DllExports::GdipSetTextRenderingHint(nativeGraphics,
- newMode));
- }
-
- TextRenderingHint GetTextRenderingHint() const
- {
- TextRenderingHint hint;
-
- SetStatus(DllExports::GdipGetTextRenderingHint(nativeGraphics,
- &hint));
-
- return hint;
- }
-
-#ifdef DCR_USE_NEW_188922
- Status SetTextContrast(IN UINT contrast)
- {
- return SetStatus(DllExports::GdipSetTextContrast(nativeGraphics,
- contrast));
- }
-
- UINT GetTextContrast() const
- {
- UINT contrast;
-
- SetStatus(DllExports::GdipGetTextContrast(nativeGraphics,
- &contrast));
-
- return contrast;
- }
-#else
- Status SetTextGammaValue(IN UINT gammaValue)
- {
- return SetStatus(DllExports::GdipSetTextGammaValue(nativeGraphics,
- gammaValue));
- }
-
- UINT GetTextGammaValue() const
- {
- UINT gammaValue;
-
- SetStatus(DllExports::GdipGetTextGammaValue(nativeGraphics,
- &gammaValue));
-
- return gammaValue;
- }
-
-#endif // DCR_USE_NEW_188922
-
-
- InterpolationMode GetInterpolationMode() const
- {
- InterpolationMode mode = InterpolationModeInvalid;
-
- SetStatus(DllExports::GdipGetInterpolationMode(nativeGraphics,
- &mode));
-
- return mode;
- }
-
- Status SetInterpolationMode(IN InterpolationMode interpolationMode)
- {
- return SetStatus(DllExports::GdipSetInterpolationMode(nativeGraphics,
- interpolationMode));
- }
-
- SmoothingMode GetSmoothingMode() const
- {
- SmoothingMode smoothingMode = SmoothingModeInvalid;
-
- SetStatus(DllExports::GdipGetSmoothingMode(nativeGraphics,
- &smoothingMode));
-
- return smoothingMode;
- }
-
- Status SetSmoothingMode(IN SmoothingMode smoothingMode)
- {
- return SetStatus(DllExports::GdipSetSmoothingMode(nativeGraphics,
- smoothingMode));
- }
-
- PixelOffsetMode GetPixelOffsetMode() const
- {
- PixelOffsetMode pixelOffsetMode = PixelOffsetModeInvalid;
-
- SetStatus(DllExports::GdipGetPixelOffsetMode(nativeGraphics,
- &pixelOffsetMode));
-
- return pixelOffsetMode;
- }
-
- Status SetPixelOffsetMode(IN PixelOffsetMode pixelOffsetMode)
- {
- return SetStatus(DllExports::GdipSetPixelOffsetMode(nativeGraphics,
- pixelOffsetMode));
- }
-
- //------------------------------------------------------------------------
- // Manipulate the current world transform
- //------------------------------------------------------------------------
-
- Status SetTransform(IN const Matrix* matrix)
- {
- return SetStatus(DllExports::GdipSetWorldTransform(nativeGraphics,
- matrix->nativeMatrix));
- }
- Status ResetTransform()
- {
- return SetStatus(DllExports::GdipResetWorldTransform(nativeGraphics));
- }
-
- Status MultiplyTransform(IN const Matrix* matrix,
- IN MatrixOrder order = MatrixOrderPrepend)
- {
- return SetStatus(DllExports::GdipMultiplyWorldTransform(nativeGraphics,
- matrix->nativeMatrix,
- order));
- }
-
- Status TranslateTransform(IN REAL dx,
- IN REAL dy,
- IN MatrixOrder order = MatrixOrderPrepend)
- {
- return SetStatus(DllExports::GdipTranslateWorldTransform(nativeGraphics,
- dx, dy, order));
- }
-
- Status ScaleTransform(IN REAL sx,
- IN REAL sy,
- IN MatrixOrder order = MatrixOrderPrepend)
- {
- return SetStatus(DllExports::GdipScaleWorldTransform(nativeGraphics,
- sx, sy, order));
- }
-
- Status RotateTransform(IN REAL angle,
- IN MatrixOrder order = MatrixOrderPrepend)
- {
- return SetStatus(DllExports::GdipRotateWorldTransform(nativeGraphics,
- angle, order));
- }
-
- /**
- * Return the current world transform
- */
-
- Status GetTransform(OUT Matrix* matrix) const
- {
- return SetStatus(DllExports::GdipGetWorldTransform(nativeGraphics,
- matrix->nativeMatrix));
- }
-
- /**
- * Manipulate the current page transform
- */
-
- Status SetPageUnit(IN Unit unit)
- {
- return SetStatus(DllExports::GdipSetPageUnit(nativeGraphics,
- unit));
- }
-
- Status SetPageScale(IN REAL scale)
- {
- return SetStatus(DllExports::GdipSetPageScale(nativeGraphics,
- scale));
- }
-
- /**
- * Retrieve the current page transform information
- * notes @ these are atomic
- */
- Unit GetPageUnit() const
- {
- Unit unit;
-
- SetStatus(DllExports::GdipGetPageUnit(nativeGraphics, &unit));
-
- return unit;
- }
-
- REAL GetPageScale() const
- {
- REAL scale;
-
- SetStatus(DllExports::GdipGetPageScale(nativeGraphics, &scale));
-
- return scale;
- }
-
- REAL GetDpiX() const
- {
- REAL dpi;
-
- SetStatus(DllExports::GdipGetDpiX(nativeGraphics, &dpi));
-
- return dpi;
- }
-
- REAL GetDpiY() const
- {
- REAL dpi;
-
- SetStatus(DllExports::GdipGetDpiY(nativeGraphics, &dpi));
-
- return dpi;
- }
-
- /**
- * Transform points in the current graphics context
- */
- // float version
- Status TransformPoints(IN CoordinateSpace destSpace,
- IN CoordinateSpace srcSpace,
- IN OUT PointF* pts,
- IN INT count) const
- {
- return SetStatus(DllExports::GdipTransformPoints(nativeGraphics,
- destSpace,
- srcSpace,
- pts,
- count));
- }
-
- // integer version
- Status TransformPoints(IN CoordinateSpace destSpace,
- IN CoordinateSpace srcSpace,
- IN OUT Point* pts,
- IN INT count) const
- {
-
- return SetStatus(DllExports::GdipTransformPointsI(nativeGraphics,
- destSpace,
- srcSpace,
- pts,
- count));
- }
-
- //------------------------------------------------------------------------
- // GetNearestColor (for <= 8bpp surfaces)
- // Note: alpha is ignored
- //------------------------------------------------------------------------
- Status GetNearestColor(IN OUT Color* color) const
- {
- if (color == NULL)
- {
- return SetStatus(InvalidParameter);
- }
-
- ARGB argb = color->GetValue();
-
- Status status = SetStatus(DllExports::GdipGetNearestColor(nativeGraphics, &argb));
-
- color->SetValue(argb);
-
- return status;
- }
-
- /**
- * Vector drawing methods
- *
- * @notes Do we need a set of methods that take
- * integer coordinate parameters?
- */
-
- // float version
- Status DrawLine(IN const Pen* pen,
- IN REAL x1,
- IN REAL y1,
- IN REAL x2,
- IN REAL y2)
- {
- return SetStatus(DllExports::GdipDrawLine(nativeGraphics,
- pen->nativePen, x1, y1, x2,
- y2));
- }
-
- Status DrawLine(IN const Pen* pen,
- IN const PointF& pt1,
- IN const PointF& pt2)
- {
- return DrawLine(pen, pt1.X, pt1.Y, pt2.X, pt2.Y);
- }
-
- Status DrawLines(IN const Pen* pen,
- IN const PointF* points,
- IN INT count)
- {
- return SetStatus(DllExports::GdipDrawLines(nativeGraphics,
- pen->nativePen,
- points, count));
- }
-
- // int version
- Status DrawLine(IN const Pen* pen,
- IN INT x1,
- IN INT y1,
- IN INT x2,
- IN INT y2)
- {
- return SetStatus(DllExports::GdipDrawLineI(nativeGraphics,
- pen->nativePen,
- x1,
- y1,
- x2,
- y2));
- }
-
- Status DrawLine(IN const Pen* pen,
- IN const Point& pt1,
- IN const Point& pt2)
- {
- return DrawLine(pen,
- pt1.X,
- pt1.Y,
- pt2.X,
- pt2.Y);
- }
-
- Status DrawLines(IN const Pen* pen,
- IN const Point* points,
- IN INT count)
- {
- return SetStatus(DllExports::GdipDrawLinesI(nativeGraphics,
- pen->nativePen,
- points,
- count));
- }
-
- // float version
- Status DrawArc(IN const Pen* pen,
- IN REAL x,
- IN REAL y,
- IN REAL width,
- IN REAL height,
- IN REAL startAngle,
- IN REAL sweepAngle)
- {
- return SetStatus(DllExports::GdipDrawArc(nativeGraphics,
- pen->nativePen,
- x,
- y,
- width,
- height,
- startAngle,
- sweepAngle));
- }
-
- Status DrawArc(IN const Pen* pen,
- IN const RectF& rect,
- IN REAL startAngle,
- IN REAL sweepAngle)
- {
- return DrawArc(pen, rect.X, rect.Y, rect.Width, rect.Height,
- startAngle, sweepAngle);
- }
-
- // int version
- Status DrawArc(IN const Pen* pen,
- IN INT x,
- IN INT y,
- IN INT width,
- IN INT height,
- IN REAL startAngle,
- IN REAL sweepAngle)
- {
- return SetStatus(DllExports::GdipDrawArcI(nativeGraphics,
- pen->nativePen,
- x,
- y,
- width,
- height,
- startAngle,
- sweepAngle));
- }
-
-
- Status DrawArc(IN const Pen* pen,
- IN const Rect& rect,
- IN REAL startAngle,
- IN REAL sweepAngle)
- {
- return DrawArc(pen,
- rect.X,
- rect.Y,
- rect.Width,
- rect.Height,
- startAngle,
- sweepAngle);
- }
-
- // float version
- Status DrawBezier(IN const Pen* pen,
- IN REAL x1,
- IN REAL y1,
- IN REAL x2,
- IN REAL y2,
- IN REAL x3,
- IN REAL y3,
- IN REAL x4,
- IN REAL y4)
- {
- return SetStatus(DllExports::GdipDrawBezier(nativeGraphics,
- pen->nativePen, x1, y1,
- x2, y2, x3, y3, x4, y4));
- }
-
- Status DrawBezier(IN const Pen* pen,
- IN const PointF& pt1,
- IN const PointF& pt2,
- IN const PointF& pt3,
- IN const PointF& pt4)
- {
- return DrawBezier(pen,
- pt1.X,
- pt1.Y,
- pt2.X,
- pt2.Y,
- pt3.X,
- pt3.Y,
- pt4.X,
- pt4.Y);
- }
-
- Status DrawBeziers(IN const Pen* pen,
- IN const PointF* points,
- IN INT count)
- {
- return SetStatus(DllExports::GdipDrawBeziers(nativeGraphics,
- pen->nativePen,
- points,
- count));
- }
-
- // int version
- Status DrawBezier(IN const Pen* pen,
- IN INT x1,
- IN INT y1,
- IN INT x2,
- IN INT y2,
- IN INT x3,
- IN INT y3,
- IN INT x4,
- IN INT y4)
- {
- return SetStatus(DllExports::GdipDrawBezierI(nativeGraphics,
- pen->nativePen,
- x1,
- y1,
- x2,
- y2,
- x3,
- y3,
- x4,
- y4));
- }
-
- Status DrawBezier(IN const Pen* pen,
- IN const Point& pt1,
- IN const Point& pt2,
- IN const Point& pt3,
- IN const Point& pt4)
- {
- return DrawBezier(pen,
- pt1.X,
- pt1.Y,
- pt2.X,
- pt2.Y,
- pt3.X,
- pt3.Y,
- pt4.X,
- pt4.Y);
- }
-
- Status DrawBeziers(IN const Pen* pen,
- IN const Point* points,
- IN INT count)
- {
- return SetStatus(DllExports::GdipDrawBeziersI(nativeGraphics,
- pen->nativePen,
- points,
- count));
- }
-
- // float version
- Status DrawRectangle(IN const Pen* pen,
- IN const RectF& rect)
- {
- return DrawRectangle(pen, rect.X, rect.Y, rect.Width, rect.Height);
- }
-
- Status DrawRectangle(IN const Pen* pen,
- IN REAL x,
- IN REAL y,
- IN REAL width,
- IN REAL height)
- {
- return SetStatus(DllExports::GdipDrawRectangle(nativeGraphics,
- pen->nativePen, x, y,
- width, height));
- }
-
- Status DrawRectangles(IN const Pen* pen,
- IN const RectF* rects,
- IN INT count)
- {
- return SetStatus(DllExports::GdipDrawRectangles(nativeGraphics,
- pen->nativePen,
- rects, count));
- }
-
- // integer version
- Status DrawRectangle(IN const Pen* pen,
- IN const Rect& rect)
- {
- return DrawRectangle(pen,
- rect.X,
- rect.Y,
- rect.Width,
- rect.Height);
- }
-
- Status DrawRectangle(IN const Pen* pen,
- IN INT x,
- IN INT y,
- IN INT width,
- IN INT height)
- {
- return SetStatus(DllExports::GdipDrawRectangleI(nativeGraphics,
- pen->nativePen,
- x,
- y,
- width,
- height));
- }
-
- Status DrawRectangles(IN const Pen* pen,
- IN const Rect* rects,
- IN INT count)
- {
- return SetStatus(DllExports::GdipDrawRectanglesI(nativeGraphics,
- pen->nativePen,
- rects,
- count));
- }
-
- // float version
- Status DrawEllipse(IN const Pen* pen,
- IN const RectF& rect)
- {
- return DrawEllipse(pen, rect.X, rect.Y, rect.Width, rect.Height);
- }
-
- Status DrawEllipse(IN const Pen* pen,
- IN REAL x,
- IN REAL y,
- IN REAL width,
- IN REAL height)
- {
- return SetStatus(DllExports::GdipDrawEllipse(nativeGraphics,
- pen->nativePen,
- x,
- y,
- width,
- height));
- }
-
- // integer version
- Status DrawEllipse(IN const Pen* pen,
- IN const Rect& rect)
- {
- return DrawEllipse(pen,
- rect.X,
- rect.Y,
- rect.Width,
- rect.Height);
- }
-
- Status DrawEllipse(IN const Pen* pen,
- IN INT x,
- IN INT y,
- IN INT width,
- IN INT height)
- {
- return SetStatus(DllExports::GdipDrawEllipseI(nativeGraphics,
- pen->nativePen,
- x,
- y,
- width,
- height));
- }
-
- // floating point version
- Status DrawPie(IN const Pen* pen,
- IN const RectF& rect,
- IN REAL startAngle,
- IN REAL sweepAngle)
- {
- return DrawPie(pen,
- rect.X,
- rect.Y,
- rect.Width,
- rect.Height,
- startAngle,
- sweepAngle);
- }
-
- Status DrawPie(IN const Pen* pen,
- IN REAL x,
- IN REAL y,
- IN REAL width,
- IN REAL height,
- IN REAL startAngle,
- IN REAL sweepAngle)
- {
- return SetStatus(DllExports::GdipDrawPie(nativeGraphics,
- pen->nativePen,
- x,
- y,
- width,
- height,
- startAngle,
- sweepAngle));
- }
-
- // integer point version
- Status DrawPie(IN const Pen* pen,
- IN const Rect& rect,
- IN REAL startAngle,
- IN REAL sweepAngle)
- {
- return DrawPie(pen,
- rect.X,
- rect.Y,
- rect.Width,
- rect.Height,
- startAngle,
- sweepAngle);
- }
-
- Status DrawPie(IN const Pen* pen,
- IN INT x,
- IN INT y,
- IN INT width,
- IN INT height,
- IN REAL startAngle,
- IN REAL sweepAngle)
- {
- return SetStatus(DllExports::GdipDrawPieI(nativeGraphics,
- pen->nativePen,
- x,
- y,
- width,
- height,
- startAngle,
- sweepAngle));
- }
-
- // float version
- Status DrawPolygon(IN const Pen* pen,
- IN const PointF* points,
- IN INT count)
- {
- return SetStatus(DllExports::GdipDrawPolygon(nativeGraphics,
- pen->nativePen,
- points,
- count));
- }
-
- // integer version
- Status DrawPolygon(IN const Pen* pen,
- IN const Point* points,
- IN INT count)
- {
- return SetStatus(DllExports::GdipDrawPolygonI(nativeGraphics,
- pen->nativePen,
- points,
- count));
- }
-
- // float version
- Status DrawPath(IN const Pen* pen,
- IN const GraphicsPath* path)
- {
- return SetStatus(DllExports::GdipDrawPath(nativeGraphics,
- pen ? pen->nativePen : NULL,
- path ? path->nativePath : NULL));
- }
-
- // float version
- Status DrawCurve(IN const Pen* pen,
- IN const PointF* points,
- IN INT count)
- {
- return SetStatus(DllExports::GdipDrawCurve(nativeGraphics,
- pen->nativePen, points,
- count));
- }
-
- Status DrawCurve(IN const Pen* pen,
- IN const PointF* points,
- IN INT count,
- IN REAL tension)
- {
- return SetStatus(DllExports::GdipDrawCurve2(nativeGraphics,
- pen->nativePen, points,
- count, tension));
- }
-
- Status DrawCurve(IN const Pen* pen,
- IN const PointF* points,
- IN INT count,
- IN INT offset,
- IN INT numberOfSegments,
- IN REAL tension = 0.5f)
- {
- return SetStatus(DllExports::GdipDrawCurve3(nativeGraphics,
- pen->nativePen, points,
- count, offset,
- numberOfSegments, tension));
- }
-
- // integer version
- Status DrawCurve(IN const Pen* pen,
- IN const Point* points,
- IN INT count)
- {
- return SetStatus(DllExports::GdipDrawCurveI(nativeGraphics,
- pen->nativePen,
- points,
- count));
- }
-
- Status DrawCurve(IN const Pen* pen,
- IN const Point* points,
- IN INT count,
- IN REAL tension)
- {
- return SetStatus(DllExports::GdipDrawCurve2I(nativeGraphics,
- pen->nativePen,
- points,
- count,
- tension));
- }
-
- Status DrawCurve(IN const Pen* pen,
- IN const Point* points,
- IN INT count,
- IN INT offset,
- IN INT numberOfSegments,
- IN REAL tension = 0.5f)
- {
- return SetStatus(DllExports::GdipDrawCurve3I(nativeGraphics,
- pen->nativePen,
- points,
- count,
- offset,
- numberOfSegments,
- tension));
- }
-
- // float version
- Status DrawClosedCurve(IN const Pen* pen,
- IN const PointF* points,
- IN INT count)
- {
- return SetStatus(DllExports::GdipDrawClosedCurve(nativeGraphics,
- pen->nativePen,
- points, count));
- }
-
- Status DrawClosedCurve(IN const Pen *pen,
- IN const PointF* points,
- IN INT count,
- IN REAL tension)
- {
- return SetStatus(DllExports::GdipDrawClosedCurve2(nativeGraphics,
- pen->nativePen,
- points, count,
- tension));
- }
-
- // integer version
- Status DrawClosedCurve(IN const Pen* pen,
- IN const Point* points,
- IN INT count)
- {
- return SetStatus(DllExports::GdipDrawClosedCurveI(nativeGraphics,
- pen->nativePen,
- points,
- count));
- }
-
- Status DrawClosedCurve(IN const Pen *pen,
- IN const Point* points,
- IN INT count,
- IN REAL tension)
- {
- return SetStatus(DllExports::GdipDrawClosedCurve2I(nativeGraphics,
- pen->nativePen,
- points,
- count,
- tension));
- }
-
- Status Clear(IN const Color &color)
- {
- return SetStatus(DllExports::GdipGraphicsClear(
- nativeGraphics,
- color.GetValue()));
- }
-
- // float version
- Status FillRectangle(IN const Brush* brush,
- IN const RectF& rect)
- {
- return FillRectangle(brush, rect.X, rect.Y, rect.Width, rect.Height);
- }
-
- Status FillRectangle(IN const Brush* brush,
- IN REAL x,
- IN REAL y,
- IN REAL width,
- IN REAL height)
- {
- return SetStatus(DllExports::GdipFillRectangle(nativeGraphics,
- brush->nativeBrush, x, y,
- width, height));
- }
-
- Status FillRectangles(IN const Brush* brush,
- IN const RectF* rects,
- IN INT count)
- {
- return SetStatus(DllExports::GdipFillRectangles(nativeGraphics,
- brush->nativeBrush,
- rects, count));
- }
-
- // integer version
- Status FillRectangle(IN const Brush* brush,
- IN const Rect& rect)
- {
- return FillRectangle(brush,
- rect.X,
- rect.Y,
- rect.Width,
- rect.Height);
- }
-
- Status FillRectangle(IN const Brush* brush,
- IN INT x,
- IN INT y,
- IN INT width,
- IN INT height)
- {
- return SetStatus(DllExports::GdipFillRectangleI(nativeGraphics,
- brush->nativeBrush,
- x,
- y,
- width,
- height));
- }
-
- Status FillRectangles(IN const Brush* brush,
- IN const Rect* rects,
- IN INT count)
- {
- return SetStatus(DllExports::GdipFillRectanglesI(nativeGraphics,
- brush->nativeBrush,
- rects,
- count));
- }
-
- // float version
- Status FillPolygon(IN const Brush* brush,
- IN const PointF* points,
- IN INT count)
- {
- return FillPolygon(brush, points, count, FillModeAlternate);
- }
-
- Status FillPolygon(IN const Brush* brush,
- IN const PointF* points,
- IN INT count,
- IN FillMode fillMode)
- {
- return SetStatus(DllExports::GdipFillPolygon(nativeGraphics,
- brush->nativeBrush,
- points, count, fillMode));
- }
-
- // integer version
- Status FillPolygon(IN const Brush* brush,
- IN const Point* points,
- IN INT count)
- {
- return FillPolygon(brush, points, count, FillModeAlternate);
- }
-
- Status FillPolygon(IN const Brush* brush,
- IN const Point* points,
- IN INT count,
- IN FillMode fillMode)
- {
- return SetStatus(DllExports::GdipFillPolygonI(nativeGraphics,
- brush->nativeBrush,
- points, count,
- fillMode));
- }
-
- // float version
- Status FillEllipse(IN const Brush* brush,
- IN const RectF& rect)
- {
- return FillEllipse(brush, rect.X, rect.Y, rect.Width, rect.Height);
- }
-
- Status FillEllipse(IN const Brush* brush,
- IN REAL x,
- IN REAL y,
- IN REAL width,
- IN REAL height)
- {
- return SetStatus(DllExports::GdipFillEllipse(nativeGraphics,
- brush->nativeBrush, x, y,
- width, height));
- }
-
- // integer version
- Status FillEllipse(IN const Brush* brush,
- IN const Rect& rect)
- {
- return FillEllipse(brush, rect.X, rect.Y, rect.Width, rect.Height);
- }
-
- Status FillEllipse(IN const Brush* brush,
- IN INT x,
- IN INT y,
- IN INT width,
- IN INT height)
- {
- return SetStatus(DllExports::GdipFillEllipseI(nativeGraphics,
- brush->nativeBrush,
- x,
- y,
- width,
- height));
- }
-
- // float version
- Status FillPie(IN const Brush* brush,
- IN const RectF& rect,
- IN REAL startAngle,
- IN REAL sweepAngle)
- {
- return FillPie(brush, rect.X, rect.Y, rect.Width, rect.Height,
- startAngle, sweepAngle);
- }
-
- Status FillPie(IN const Brush* brush,
- IN REAL x,
- IN REAL y,
- IN REAL width,
- IN REAL height,
- IN REAL startAngle,
- IN REAL sweepAngle)
- {
- return SetStatus(DllExports::GdipFillPie(nativeGraphics,
- brush->nativeBrush, x, y,
- width, height, startAngle,
- sweepAngle));
- }
-
- // integer version
- Status FillPie(IN const Brush* brush,
- IN const Rect& rect,
- IN REAL startAngle,
- IN REAL sweepAngle)
- {
- return FillPie(brush, rect.X, rect.Y, rect.Width, rect.Height,
- startAngle, sweepAngle);
- }
-
- Status FillPie(IN const Brush* brush,
- IN INT x,
- IN INT y,
- IN INT width,
- IN INT height,
- IN REAL startAngle,
- IN REAL sweepAngle)
- {
- return SetStatus(DllExports::GdipFillPieI(nativeGraphics,
- brush->nativeBrush,
- x,
- y,
- width,
- height,
- startAngle,
- sweepAngle));
- }
-
- Status FillPath(IN const Brush* brush,
- IN const GraphicsPath* path)
- {
- return SetStatus(DllExports::GdipFillPath(nativeGraphics,
- brush->nativeBrush,
- path->nativePath));
- }
-
- // float version
- Status FillClosedCurve(IN const Brush* brush,
- IN const PointF* points,
- IN INT count)
- {
- return SetStatus(DllExports::GdipFillClosedCurve(nativeGraphics,
- brush->nativeBrush,
- points, count));
-
- }
-
- Status FillClosedCurve(IN const Brush* brush,
- IN const PointF* points,
- IN INT count,
- IN FillMode fillMode,
- IN REAL tension = 0.5f)
- {
- return SetStatus(DllExports::GdipFillClosedCurve2(nativeGraphics,
- brush->nativeBrush,
- points, count,
- tension, fillMode));
- }
-
- // integer version
- Status FillClosedCurve(IN const Brush* brush,
- IN const Point* points,
- IN INT count)
- {
- return SetStatus(DllExports::GdipFillClosedCurveI(nativeGraphics,
- brush->nativeBrush,
- points,
- count));
- }
-
- Status FillClosedCurve(IN const Brush* brush,
- IN const Point* points,
- IN INT count,
- IN FillMode fillMode,
- IN REAL tension = 0.5f)
- {
- return SetStatus(DllExports::GdipFillClosedCurve2I(nativeGraphics,
- brush->nativeBrush,
- points, count,
- tension, fillMode));
- }
-
- // float version
- Status FillRegion(IN const Brush* brush,
- IN const Region* region)
- {
- return SetStatus(DllExports::GdipFillRegion(nativeGraphics,
- brush->nativeBrush,
- region->nativeRegion));
- }
-
- // DrawString and MeasureString
- Status
- DrawString(
- IN const WCHAR *string,
- IN INT length,
- IN const Font *font,
- IN const RectF &layoutRect,
- IN const StringFormat *stringFormat,
- IN const Brush *brush
- )
- {
- return SetStatus(DllExports::GdipDrawString(
- nativeGraphics,
- string,
- length,
- font ? font->nativeFont : NULL,
- &layoutRect,
- stringFormat ? stringFormat->nativeFormat : NULL,
- brush ? brush->nativeBrush : NULL
- ));
- }
-
- Status
- DrawString(
- const WCHAR *string,
- INT length,
- const Font *font,
- const PointF &origin,
- const Brush *brush
- )
- {
- RectF rect(origin.X, origin.Y, 0.0f, 0.0f);
-
- return SetStatus(DllExports::GdipDrawString(
- nativeGraphics,
- string,
- length,
- font ? font->nativeFont : NULL,
- &rect,
- NULL,
- brush ? brush->nativeBrush : NULL
- ));
- }
-
- Status
- DrawString(
- const WCHAR *string,
- INT length,
- const Font *font,
- const PointF &origin,
- const StringFormat *stringFormat,
- const Brush *brush
- )
- {
- RectF rect(origin.X, origin.Y, 0.0f, 0.0f);
-
- return SetStatus(DllExports::GdipDrawString(
- nativeGraphics,
- string,
- length,
- font ? font->nativeFont : NULL,
- &rect,
- stringFormat ? stringFormat->nativeFormat : NULL,
- brush ? brush->nativeBrush : NULL
- ));
- }
-
- Status
- MeasureString(
- IN const WCHAR *string,
- IN INT length,
- IN const Font *font,
- IN const RectF &layoutRect,
- IN const StringFormat *stringFormat,
- OUT RectF *boundingBox,
- OUT INT *codepointsFitted = 0,
- OUT INT *linesFilled = 0
- ) const
- {
- return SetStatus(DllExports::GdipMeasureString(
- nativeGraphics,
- string,
- length,
- font ? font->nativeFont : NULL,
- &layoutRect,
- stringFormat ? stringFormat->nativeFormat : NULL,
- boundingBox,
- codepointsFitted,
- linesFilled
- ));
- }
-
- Status
- MeasureString(
- IN const WCHAR *string,
- IN INT length,
- IN const Font *font,
- IN const SizeF &layoutRectSize,
- IN const StringFormat *stringFormat,
- OUT SizeF *size,
- OUT INT *codepointsFitted = 0,
- OUT INT *linesFilled = 0
- ) const
- {
- RectF layoutRect(0, 0, layoutRectSize.Width, layoutRectSize.Height);
- RectF boundingBox;
- Status status;
-
- if (size == NULL)
- {
- return SetStatus(InvalidParameter);
- }
-
- status = SetStatus(DllExports::GdipMeasureString(
- nativeGraphics,
- string,
- length,
- font ? font->nativeFont : NULL,
- &layoutRect,
- stringFormat ? stringFormat->nativeFormat : NULL,
- size ? &boundingBox : NULL,
- codepointsFitted,
- linesFilled
- ));
-
- if (size && status == Ok)
- {
- size->Width = boundingBox.Width;
- size->Height = boundingBox.Height;
- }
-
- return status;
- }
-
- Status
- MeasureString(
- IN const WCHAR *string,
- IN INT length,
- IN const Font *font,
- IN const PointF &origin,
- IN const StringFormat *stringFormat,
- OUT RectF *boundingBox
- ) const
- {
- RectF rect(origin.X, origin.Y, 0.0f, 0.0f);
-
- return SetStatus(DllExports::GdipMeasureString(
- nativeGraphics,
- string,
- length,
- font ? font->nativeFont : NULL,
- &rect,
- stringFormat ? stringFormat->nativeFormat : NULL,
- boundingBox,
- NULL,
- NULL
- ));
- }
-
-
- Status
- MeasureString(
- IN const WCHAR *string,
- IN INT length,
- IN const Font *font,
- IN const RectF &layoutRect,
- OUT RectF *boundingBox
- ) const
- {
- return SetStatus(DllExports::GdipMeasureString(
- nativeGraphics,
- string,
- length,
- font ? font->nativeFont : NULL,
- &layoutRect,
- NULL,
- boundingBox,
- NULL,
- NULL
- ));
- }
-
- Status
- MeasureString(
- IN const WCHAR *string,
- IN INT length,
- IN const Font *font,
- IN const PointF &origin,
- OUT RectF *boundingBox
- ) const
- {
- RectF rect(origin.X, origin.Y, 0.0f, 0.0f);
-
- return SetStatus(DllExports::GdipMeasureString(
- nativeGraphics,
- string,
- length,
- font ? font->nativeFont : NULL,
- &rect,
- NULL,
- boundingBox,
- NULL,
- NULL
- ));
- }
-
-
-#ifdef DCR_USE_NEW_174340
- Status
- MeasureCharacterRanges(
- IN const WCHAR *string,
- IN INT length,
- IN const Font *font,
- IN const RectF &layoutRect,
- IN const StringFormat *stringFormat,
- IN INT regionCount,
- OUT Region *regions
- ) const
- {
- if (!regions || regionCount <= 0)
- {
- return InvalidParameter;
- }
-
- GpRegion **nativeRegions = new GpRegion* [regionCount];
-
- if (!nativeRegions)
- {
- return OutOfMemory;
- }
-
- for (INT i = 0; i < regionCount; i++)
- {
- nativeRegions[i] = regions[i].nativeRegion;
- }
-
- Status status = SetStatus(DllExports::GdipMeasureCharacterRanges(
- nativeGraphics,
- string,
- length,
- font ? font->nativeFont : NULL,
- layoutRect,
- stringFormat ? stringFormat->nativeFormat : NULL,
- regionCount,
- nativeRegions
- ));
-
- delete [] nativeRegions;
-
- return status;
- }
-#endif
-
-
-#ifndef DCR_USE_NEW_174340
- Status
- MeasureStringRegion(
- IN const WCHAR *string,
- IN INT length,
- IN const Font *font,
- IN const RectF &layoutRect,
- IN const StringFormat *stringFormat,
- IN INT firstCharacterIndex,
- IN INT characterCount,
- OUT Region *region
- ) const
- {
- if (region == NULL)
- {
- return SetStatus(InvalidParameter);
- }
-
- return (SetStatus(DllExports::GdipMeasureStringRegion(
- nativeGraphics,
- string,
- length,
- font ? font->nativeFont : NULL,
- layoutRect,
- stringFormat ? stringFormat->nativeFormat : NULL,
- firstCharacterIndex,
- characterCount,
- region->nativeRegion)));
- }
-#endif
-
- Status DrawDriverString(
- IN const UINT16 *text,
- IN INT length,
- IN const Font *font,
- IN const Brush *brush,
- IN const PointF *positions,
- IN INT flags,
- IN const Matrix *matrix
- )
- {
- return SetStatus(DllExports::GdipDrawDriverString(
- nativeGraphics,
- text,
- length,
- font ? font->nativeFont : NULL,
- brush ? brush->nativeBrush : NULL,
- positions,
- flags,
- matrix ? matrix->nativeMatrix : NULL
- ));
- }
-
- Status MeasureDriverString(
- IN const UINT16 *text,
- IN INT length,
- IN const Font *font,
- IN const PointF *positions,
- IN INT flags,
- IN const Matrix *matrix,
- OUT RectF *boundingBox
- ) const
- {
- return SetStatus(DllExports::GdipMeasureDriverString(
- nativeGraphics,
- text,
- length,
- font ? font->nativeFont : NULL,
- positions,
- flags,
- matrix ? matrix->nativeMatrix : NULL,
- boundingBox
- ));
- }
-
-#ifndef DCR_USE_NEW_168772
- Status DriverStringPointToCodepoint(
- IN const UINT16 *text,
- IN INT length,
- IN const Font *font,
- IN const PointF *positions,
- IN INT flags,
- IN const Matrix *matrix,
- IN const PointF &hit,
- OUT INT *index,
- OUT BOOL *rightEdge,
- OUT REAL *distance
- )
- {
- return SetStatus(DllExports::GdipDriverStringPointToCodepoint(
- nativeGraphics,
- text,
- length,
- font ? font->nativeFont : NULL,
- positions,
- flags,
- matrix ? matrix->nativeMatrix : NULL,
- &hit,
- index,
- rightEdge,
- distance
- ));
- }
-#endif
-
- // Draw a cached bitmap on this graphics destination offset by
- // x, y. Note this will fail with WrongState if the CachedBitmap
- // native format differs from this Graphics.
-
- Status DrawCachedBitmap(IN CachedBitmap *cb,
- IN INT x,
- IN INT y)
- {
- return SetStatus(DllExports::GdipDrawCachedBitmap(
- nativeGraphics,
- cb->nativeCachedBitmap,
- x, y
- ));
- }
-
- /**
- * Draw images (both bitmap and vector)
- */
- // float version
- Status DrawImage(IN Image* image,
- IN const PointF& point)
- {
- return DrawImage(image, point.X, point.Y);
- }
-
- Status DrawImage(IN Image* image,
- IN REAL x,
- IN REAL y)
- {
- return SetStatus(DllExports::GdipDrawImage(nativeGraphics,
- image ? image->nativeImage
- : NULL,
- x,
- y));
- }
-
- Status DrawImage(IN Image* image,
- IN const RectF& rect)
- {
- return DrawImage(image, rect.X, rect.Y, rect.Width, rect.Height);
- }
-
- Status DrawImage(IN Image* image,
- IN REAL x,
- IN REAL y,
- IN REAL width,
- IN REAL height)
- {
- return SetStatus(DllExports::GdipDrawImageRect(nativeGraphics,
- image ? image->nativeImage
- : NULL,
- x,
- y,
- width,
- height));
- }
-
- // integer version
- Status DrawImage(IN Image* image,
- IN const Point& point)
- {
- return DrawImage(image, point.X, point.Y);
- }
-
- Status DrawImage(IN Image* image,
- IN INT x,
- IN INT y)
- {
- return SetStatus(DllExports::GdipDrawImageI(nativeGraphics,
- image ? image->nativeImage
- : NULL,
- x,
- y));
- }
-
- Status DrawImage(IN Image* image,
- IN const Rect& rect)
- {
- return DrawImage(image,
- rect.X,
- rect.Y,
- rect.Width,
- rect.Height);
- }
-
- Status DrawImage(IN Image* image,
- IN INT x,
- IN INT y,
- IN INT width,
- IN INT height) {
- return SetStatus(DllExports::GdipDrawImageRectI(nativeGraphics,
- image ? image->nativeImage
- : NULL,
- x,
- y,
- width,
- height));
- }
-
- /**
- * Affine or perspective blt
- * destPoints.length = 3: rect => parallelogram
- * destPoints[0] <=> top-left corner of the source rectangle
- * destPoints[1] <=> top-right corner
- * destPoints[2] <=> bottom-left corner
- * destPoints.length = 4: rect => quad
- * destPoints[3] <=> bottom-right corner
- *
- * @notes Perspective blt only works for bitmap images.
- */
- Status DrawImage(IN Image* image,
- IN const PointF* destPoints,
- IN INT count)
- {
- if (count != 3 && count != 4)
- return SetStatus(InvalidParameter);
-
- return SetStatus(DllExports::GdipDrawImagePoints(nativeGraphics,
- image ? image->nativeImage
- : NULL,
- destPoints, count));
- }
-
- Status DrawImage(IN Image* image,
- IN const Point* destPoints,
- IN INT count)
- {
- if (count != 3 && count != 4)
- return SetStatus(InvalidParameter);
-
- return SetStatus(DllExports::GdipDrawImagePointsI(nativeGraphics,
- image ? image->nativeImage
- : NULL,
- destPoints,
- count));
- }
-
- /**
- * We need another set of methods similar to the ones above
- * that take an additional Rect parameter to specify the
- * portion of the source image to be drawn.
- */
- // float version
- Status DrawImage(IN Image* image,
- IN REAL x,
- IN REAL y,
- IN REAL srcx,
- IN REAL srcy,
- IN REAL srcwidth,
- IN REAL srcheight,
- IN Unit srcUnit)
- {
- return SetStatus(DllExports::GdipDrawImagePointRect(nativeGraphics,
- image ? image->nativeImage
- : NULL,
- x, y,
- srcx, srcy,
- srcwidth, srcheight, srcUnit));
- }
-
- Status DrawImage(IN Image* image,
- IN const RectF& destRect,
- IN REAL srcx,
- IN REAL srcy,
- IN REAL srcwidth,
- IN REAL srcheight,
- IN Unit srcUnit,
- IN const ImageAttributes* imageAttributes = NULL,
- IN DrawImageAbort callback = NULL,
- IN VOID* callbackData = NULL)
- {
- return SetStatus(DllExports::GdipDrawImageRectRect(nativeGraphics,
- image ? image->nativeImage
- : NULL,
- destRect.X,
- destRect.Y,
- destRect.Width,
- destRect.Height,
- srcx, srcy,
- srcwidth, srcheight,
- srcUnit,
- imageAttributes
- ? imageAttributes->nativeImageAttr
- : NULL,
- callback,
- callbackData));
- }
-
- Status DrawImage(IN Image* image,
- IN const PointF* destPoints,
- IN INT count,
- IN REAL srcx,
- IN REAL srcy,
- IN REAL srcwidth,
- IN REAL srcheight,
- IN Unit srcUnit,
- IN const ImageAttributes* imageAttributes = NULL,
- IN DrawImageAbort callback = NULL,
- IN VOID* callbackData = NULL)
- {
- return SetStatus(DllExports::GdipDrawImagePointsRect(nativeGraphics,
- image ? image->nativeImage
- : NULL,
- destPoints, count,
- srcx, srcy,
- srcwidth,
- srcheight,
- srcUnit,
- imageAttributes
- ? imageAttributes->nativeImageAttr
- : NULL,
- callback,
- callbackData));
- }
-
- // integer version
- Status DrawImage(IN Image* image,
- IN INT x,
- IN INT y,
- IN INT srcx,
- IN INT srcy,
- IN INT srcwidth,
- IN INT srcheight,
- IN Unit srcUnit)
- {
- return SetStatus(DllExports::GdipDrawImagePointRectI(nativeGraphics,
- image ? image->nativeImage
- : NULL,
- x,
- y,
- srcx,
- srcy,
- srcwidth,
- srcheight,
- srcUnit));
- }
-
- Status DrawImage(IN Image* image,
- IN const Rect& destRect,
- IN INT srcx,
- IN INT srcy,
- IN INT srcwidth,
- IN INT srcheight,
- IN Unit srcUnit,
- IN const ImageAttributes* imageAttributes = NULL,
- IN DrawImageAbort callback = NULL,
- IN VOID* callbackData = NULL)
- {
- return SetStatus(DllExports::GdipDrawImageRectRectI(nativeGraphics,
- image ? image->nativeImage
- : NULL,
- destRect.X,
- destRect.Y,
- destRect.Width,
- destRect.Height,
- srcx,
- srcy,
- srcwidth,
- srcheight,
- srcUnit,
- imageAttributes
- ? imageAttributes->nativeImageAttr
- : NULL,
- callback,
- callbackData));
- }
-
- Status DrawImage(IN Image* image,
- IN const Point* destPoints,
- IN INT count,
- IN INT srcx,
- IN INT srcy,
- IN INT srcwidth,
- IN INT srcheight,
- IN Unit srcUnit,
- IN const ImageAttributes* imageAttributes = NULL,
- IN DrawImageAbort callback = NULL,
- IN VOID* callbackData = NULL)
- {
- return SetStatus(DllExports::GdipDrawImagePointsRectI(nativeGraphics,
- image ? image->nativeImage
- : NULL,
- destPoints,
- count,
- srcx,
- srcy,
- srcwidth,
- srcheight,
- srcUnit,
- imageAttributes
- ? imageAttributes->nativeImageAttr
- : NULL,
- callback,
- callbackData));
- }
-
- // The following methods are for playing an EMF+ to a graphics
- // via the enumeration interface. Each record of the EMF+ is
- // sent to the callback (along with the callbackData). Then
- // the callback can invoke the Metafile::PlayRecord method
- // to play the particular record.
-
- Status
- EnumerateMetafile(
- IN const Metafile * metafile,
- IN const PointF & destPoint,
- IN EnumerateMetafileProc callback,
- IN VOID * callbackData = NULL,
- IN const ImageAttributes * imageAttributes = NULL
- )
- {
- return SetStatus(DllExports::GdipEnumerateMetafileDestPoint(
- nativeGraphics,
- (const GpMetafile *)(metafile ? metafile->nativeImage:NULL),
- destPoint,
- callback,
- callbackData,
- imageAttributes ? imageAttributes->nativeImageAttr : NULL));
- }
-
- Status
- EnumerateMetafile(
- IN const Metafile * metafile,
- IN const Point & destPoint,
- IN EnumerateMetafileProc callback,
- IN VOID * callbackData = NULL,
- IN const ImageAttributes * imageAttributes = NULL
- )
- {
- return SetStatus(DllExports::GdipEnumerateMetafileDestPointI(
- nativeGraphics,
- (const GpMetafile *)(metafile ? metafile->nativeImage:NULL),
- destPoint,
- callback,
- callbackData,
- imageAttributes ? imageAttributes->nativeImageAttr : NULL));
- }
-
- Status
- EnumerateMetafile(
- IN const Metafile * metafile,
- IN const RectF & destRect,
- IN EnumerateMetafileProc callback,
- IN VOID * callbackData = NULL,
- IN const ImageAttributes * imageAttributes = NULL
- )
- {
- return SetStatus(DllExports::GdipEnumerateMetafileDestRect(
- nativeGraphics,
- (const GpMetafile *)(metafile ? metafile->nativeImage:NULL),
- destRect,
- callback,
- callbackData,
- imageAttributes ? imageAttributes->nativeImageAttr : NULL));
- }
-
- Status
- EnumerateMetafile(
- IN const Metafile * metafile,
- IN const Rect & destRect,
- IN EnumerateMetafileProc callback,
- IN VOID * callbackData = NULL,
- IN const ImageAttributes * imageAttributes = NULL
- )
- {
- return SetStatus(DllExports::GdipEnumerateMetafileDestRectI(
- nativeGraphics,
- (const GpMetafile *)(metafile ? metafile->nativeImage:NULL),
- destRect,
- callback,
- callbackData,
- imageAttributes ? imageAttributes->nativeImageAttr : NULL));
- }
-
- Status
- EnumerateMetafile(
- IN const Metafile * metafile,
- IN const PointF * destPoints,
- IN INT count,
- IN EnumerateMetafileProc callback,
- IN VOID * callbackData = NULL,
- IN const ImageAttributes * imageAttributes = NULL
- )
- {
- return SetStatus(DllExports::GdipEnumerateMetafileDestPoints(
- nativeGraphics,
- (const GpMetafile *)(metafile ? metafile->nativeImage:NULL),
- destPoints,
- count,
- callback,
- callbackData,
- imageAttributes ? imageAttributes->nativeImageAttr : NULL));
- }
-
- Status
- EnumerateMetafile(
- IN const Metafile * metafile,
- IN const Point * destPoints,
- IN INT count,
- IN EnumerateMetafileProc callback,
- IN VOID * callbackData = NULL,
- IN const ImageAttributes * imageAttributes = NULL
- )
- {
- return SetStatus(DllExports::GdipEnumerateMetafileDestPointsI(
- nativeGraphics,
- (const GpMetafile *)(metafile ? metafile->nativeImage:NULL),
- destPoints,
- count,
- callback,
- callbackData,
- imageAttributes ? imageAttributes->nativeImageAttr : NULL));
- }
-
- Status
- EnumerateMetafile(
- IN const Metafile * metafile,
- IN const PointF & destPoint,
- IN const RectF & srcRect,
- IN Unit srcUnit,
- IN EnumerateMetafileProc callback,
- IN VOID * callbackData = NULL,
- IN const ImageAttributes * imageAttributes = NULL
- )
- {
- return SetStatus(DllExports::GdipEnumerateMetafileSrcRectDestPoint(
- nativeGraphics,
- (const GpMetafile *)(metafile ? metafile->nativeImage:NULL),
- destPoint,
- srcRect,
- srcUnit,
- callback,
- callbackData,
- imageAttributes ? imageAttributes->nativeImageAttr : NULL));
- }
-
- Status
- EnumerateMetafile(
- IN const Metafile * metafile,
- IN const Point & destPoint,
- IN const Rect & srcRect,
- IN Unit srcUnit,
- IN EnumerateMetafileProc callback,
- IN VOID * callbackData = NULL,
- IN const ImageAttributes * imageAttributes = NULL
- )
- {
- return SetStatus(DllExports::GdipEnumerateMetafileSrcRectDestPointI(
- nativeGraphics,
- (const GpMetafile *)(metafile ? metafile->nativeImage:NULL),
- destPoint,
- srcRect,
- srcUnit,
- callback,
- callbackData,
- imageAttributes ? imageAttributes->nativeImageAttr : NULL));
- }
-
- Status
- EnumerateMetafile(
- IN const Metafile * metafile,
- IN const RectF & destRect,
- IN const RectF & srcRect,
- IN Unit srcUnit,
- IN EnumerateMetafileProc callback,
- IN VOID * callbackData = NULL,
- IN const ImageAttributes * imageAttributes = NULL
- )
- {
- return SetStatus(DllExports::GdipEnumerateMetafileSrcRectDestRect(
- nativeGraphics,
- (const GpMetafile *)(metafile ? metafile->nativeImage:NULL),
- destRect,
- srcRect,
- srcUnit,
- callback,
- callbackData,
- imageAttributes ? imageAttributes->nativeImageAttr : NULL));
- }
-
- Status
- EnumerateMetafile(
- IN const Metafile * metafile,
- IN const Rect & destRect,
- IN const Rect & srcRect,
- IN Unit srcUnit,
- IN EnumerateMetafileProc callback,
- IN VOID * callbackData = NULL,
- IN const ImageAttributes * imageAttributes = NULL
- )
- {
- return SetStatus(DllExports::GdipEnumerateMetafileSrcRectDestRectI(
- nativeGraphics,
- (const GpMetafile *)(metafile ? metafile->nativeImage:NULL),
- destRect,
- srcRect,
- srcUnit,
- callback,
- callbackData,
- imageAttributes ? imageAttributes->nativeImageAttr : NULL));
- }
-
- Status
- EnumerateMetafile(
- IN const Metafile * metafile,
- IN const PointF * destPoints,
- IN INT count,
- IN const RectF & srcRect,
- IN Unit srcUnit,
- IN EnumerateMetafileProc callback,
- IN VOID * callbackData = NULL,
- IN const ImageAttributes * imageAttributes = NULL
- )
- {
- return SetStatus(DllExports::GdipEnumerateMetafileSrcRectDestPoints(
- nativeGraphics,
- (const GpMetafile *)(metafile ? metafile->nativeImage:NULL),
- destPoints,
- count,
- srcRect,
- srcUnit,
- callback,
- callbackData,
- imageAttributes ? imageAttributes->nativeImageAttr : NULL));
- }
-
- Status
- EnumerateMetafile(
- IN const Metafile * metafile,
- IN const Point * destPoints,
- IN INT count,
- IN const Rect & srcRect,
- IN Unit srcUnit,
- IN EnumerateMetafileProc callback,
- IN VOID * callbackData = NULL,
- IN const ImageAttributes * imageAttributes = NULL
- )
- {
- return SetStatus(DllExports::GdipEnumerateMetafileSrcRectDestPointsI(
- nativeGraphics,
- (const GpMetafile *)(metafile ? metafile->nativeImage:NULL),
- destPoints,
- count,
- srcRect,
- srcUnit,
- callback,
- callbackData,
- imageAttributes ? imageAttributes->nativeImageAttr : NULL));
- }
-
- /**
- * Clipping region operations
- *
- * @notes Simply incredible redundancy here.
- */
- Status SetClip(IN const Graphics* g,
- IN CombineMode combineMode = CombineModeReplace)
- {
- return SetStatus(DllExports::GdipSetClipGraphics(nativeGraphics,
- g->nativeGraphics,
- combineMode));
- }
-
- Status SetClip(IN const RectF& rect,
- IN CombineMode combineMode = CombineModeReplace)
- {
- return SetStatus(DllExports::GdipSetClipRect(nativeGraphics,
- rect.X, rect.Y,
- rect.Width, rect.Height,
- combineMode));
- }
-
- Status SetClip(IN const Rect& rect,
- IN CombineMode combineMode = CombineModeReplace)
- {
- return SetStatus(DllExports::GdipSetClipRectI(nativeGraphics,
- rect.X, rect.Y,
- rect.Width, rect.Height,
- combineMode));
- }
-
- Status SetClip(IN const GraphicsPath* path,
- IN CombineMode combineMode = CombineModeReplace)
- {
- return SetStatus(DllExports::GdipSetClipPath(nativeGraphics,
- path->nativePath,
- combineMode));
- }
-
- Status SetClip(IN const Region* region,
- IN CombineMode combineMode = CombineModeReplace)
- {
- return SetStatus(DllExports::GdipSetClipRegion(nativeGraphics,
- region->nativeRegion,
- combineMode));
- }
-
- // This is different than the other SetClip methods because it assumes
- // that the HRGN is already in device units, so it doesn't transform
- // the coordinates in the HRGN.
- Status SetClip(IN HRGN hRgn,
- IN CombineMode combineMode = CombineModeReplace)
- {
- return SetStatus(DllExports::GdipSetClipHrgn(nativeGraphics, hRgn,
- combineMode));
- }
-
- Status IntersectClip(IN const RectF& rect)
- {
- return SetStatus(DllExports::GdipSetClipRect(nativeGraphics,
- rect.X, rect.Y,
- rect.Width, rect.Height,
- CombineModeIntersect));
- }
-
- Status IntersectClip(IN const Rect& rect)
- {
- return SetStatus(DllExports::GdipSetClipRectI(nativeGraphics,
- rect.X, rect.Y,
- rect.Width, rect.Height,
- CombineModeIntersect));
- }
-
- Status IntersectClip(IN const Region* region)
- {
- return SetStatus(DllExports::GdipSetClipRegion(nativeGraphics,
- region->nativeRegion,
- CombineModeIntersect));
- }
-
- Status ExcludeClip(IN const RectF& rect)
- {
- return SetStatus(DllExports::GdipSetClipRect(nativeGraphics,
- rect.X, rect.Y,
- rect.Width, rect.Height,
- CombineModeExclude));
- }
-
- Status ExcludeClip(IN const Rect& rect)
- {
- return SetStatus(DllExports::GdipSetClipRectI(nativeGraphics,
- rect.X, rect.Y,
- rect.Width, rect.Height,
- CombineModeExclude));
- }
-
- Status ExcludeClip(IN const Region* region)
- {
- return SetStatus(DllExports::GdipSetClipRegion(nativeGraphics,
- region->nativeRegion,
- CombineModeExclude));
- }
-
- Status ResetClip()
- {
- return SetStatus(DllExports::GdipResetClip(nativeGraphics));
- }
-
- Status TranslateClip(IN REAL dx,
- IN REAL dy)
- {
- return SetStatus(DllExports::GdipTranslateClip(nativeGraphics, dx, dy));
- }
-
- Status TranslateClip(IN INT dx,
- IN INT dy)
- {
- return SetStatus(DllExports::GdipTranslateClipI(nativeGraphics,
- dx, dy));
- }
-
- /**
- * GetClip region from graphics context
- */
- Status GetClip(OUT Region* region) const
- {
- return SetStatus(DllExports::GdipGetClip(nativeGraphics,
- region->nativeRegion));
- }
-
- /**
- * Hit testing operations
- */
- Status GetClipBounds(OUT RectF* rect) const
- {
- return SetStatus(DllExports::GdipGetClipBounds(nativeGraphics, rect));
- }
-
- Status GetClipBounds(OUT Rect* rect) const
- {
- return SetStatus(DllExports::GdipGetClipBoundsI(nativeGraphics, rect));
- }
-
- BOOL IsClipEmpty() const
- {
- BOOL booln = FALSE;
-
- SetStatus(DllExports::GdipIsClipEmpty(nativeGraphics, &booln));
-
- return booln;
- }
-
- Status GetVisibleClipBounds(OUT RectF *rect) const
- {
-
- return SetStatus(DllExports::GdipGetVisibleClipBounds(nativeGraphics,
- rect));
- }
-
- Status GetVisibleClipBounds(OUT Rect *rect) const
- {
- return SetStatus(DllExports::GdipGetVisibleClipBoundsI(nativeGraphics,
- rect));
- }
-
- BOOL IsVisibleClipEmpty() const
- {
- BOOL booln = FALSE;
-
- SetStatus(DllExports::GdipIsVisibleClipEmpty(nativeGraphics, &booln));
-
- return booln;
- }
-
- BOOL IsVisible(IN INT x,
- IN INT y) const
- {
- return IsVisible(Point(x,y));
- }
-
- BOOL IsVisible(IN const Point& point) const
- {
- BOOL booln = FALSE;
-
- SetStatus(DllExports::GdipIsVisiblePointI(nativeGraphics,
- point.X,
- point.Y,
- &booln));
-
- return booln;
- }
-
- BOOL IsVisible(IN INT x,
- IN INT y,
- IN INT width,
- IN INT height) const
- {
- return IsVisible(Rect(x, y, width, height));
- }
-
- BOOL IsVisible(IN const Rect& rect) const
- {
-
- BOOL booln = TRUE;
-
- SetStatus(DllExports::GdipIsVisibleRectI(nativeGraphics,
- rect.X,
- rect.Y,
- rect.Width,
- rect.Height,
- &booln));
- return booln;
- }
-
- BOOL IsVisible(IN REAL x,
- IN REAL y) const
- {
- return IsVisible(PointF(x, y));
- }
-
- BOOL IsVisible(IN const PointF& point) const
- {
- BOOL booln = FALSE;
-
- SetStatus(DllExports::GdipIsVisiblePoint(nativeGraphics,
- point.X,
- point.Y,
- &booln));
-
- return booln;
- }
-
- BOOL IsVisible(IN REAL x,
- IN REAL y,
- IN REAL width,
- IN REAL height) const
- {
- return IsVisible(RectF(x, y, width, height));
- }
-
- BOOL IsVisible(IN const RectF& rect) const
- {
- BOOL booln = TRUE;
-
- SetStatus(DllExports::GdipIsVisibleRect(nativeGraphics,
- rect.X,
- rect.Y,
- rect.Width,
- rect.Height,
- &booln));
- return booln;
- }
-
- /**
- * Save/restore graphics state
- */
- GraphicsState Save() const
- {
- GraphicsState gstate;
-
- SetStatus(DllExports::GdipSaveGraphics(nativeGraphics, &gstate));
-
- return gstate;
- }
-
- Status Restore(IN GraphicsState gstate)
- {
- return SetStatus(DllExports::GdipRestoreGraphics(nativeGraphics,
- gstate));
- }
-
- /**
- * Begin and end container drawing
- */
- GraphicsContainer BeginContainer(IN const RectF &dstrect,
- IN const RectF &srcrect,
- IN Unit unit)
- {
- GraphicsContainer state;
-
- SetStatus(DllExports::GdipBeginContainer(nativeGraphics, &dstrect,
- &srcrect, unit, &state));
-
- return state;
- }
-
- /**
- * Begin and end container drawing
- */
- GraphicsContainer BeginContainer(IN const Rect &dstrect,
- IN const Rect &srcrect,
- IN Unit unit)
- {
- GraphicsContainer state;
-
- SetStatus(DllExports::GdipBeginContainerI(nativeGraphics, &dstrect,
- &srcrect, unit, &state));
-
- return state;
- }
-
- GraphicsContainer BeginContainer()
- {
- GraphicsContainer state;
-
- SetStatus(DllExports::GdipBeginContainer2(nativeGraphics, &state));
-
- return state;
- }
-
- Status EndContainer(IN GraphicsContainer state)
- {
- return SetStatus(DllExports::GdipEndContainer(nativeGraphics, state));
- }
-
- // only valid when recording metafiles
- Status AddMetafileComment(IN const BYTE * data,
- IN UINT sizeData)
- {
- return SetStatus(DllExports::GdipComment(nativeGraphics, sizeData, data));
- }
-
- /**
- * Get/SetLayout
- * Support for Middle East localization (right-to-left mirroring)
- */
- GraphicsLayout GetLayout() const
- {
- GraphicsLayout layout;
-
- SetStatus(DllExports::GdipGetGraphicsLayout(nativeGraphics, &layout));
-
- return layout;
- }
-
- Status SetLayout(IN const GraphicsLayout layout)
- {
- return SetStatus(
- DllExports::GdipSetGraphicsLayout(nativeGraphics, layout)
- );
- }
-
- static HPALETTE GetHalftonePalette()
- {
- return DllExports::GdipCreateHalftonePalette();
- }
-
- Status GetLastStatus() const
- {
- Status lastStatus = lastResult;
- lastResult = Ok;
-
- return lastStatus;
- }
-
-protected:
-
-#ifdef DCR_USE_NEW_250932
-
-private:
- Graphics(const Graphics &);
- Graphics& operator=(const Graphics &);
-protected:
-
-#else
-
- Graphics(const Graphics& graphics)
- {
- graphics;
- SetStatus(NotImplemented);
- }
-
- Graphics& operator=(const Graphics& graphics)
- {
- graphics;
- SetStatus(NotImplemented);
- return *this;
- }
-
-#endif
-
- Graphics(GpGraphics* graphics)
- {
- lastResult = Ok;
- SetNativeGraphics(graphics);
- }
-
- VOID SetNativeGraphics(GpGraphics *graphics)
- {
- this->nativeGraphics = graphics;
- }
-
- Status SetStatus(Status status) const
- {
- if (status != Ok)
- return (lastResult = status);
- else
- return status;
- }
-
- // Methods necessary to subclass Graphics for extension test.
-
- GpGraphics* GetNativeGraphics() const
- {
- return this->nativeGraphics;
- }
-
- GpPen* GetNativePen(const Pen* pen)
- {
- return pen->nativePen;
- }
-
-protected:
- GpGraphics* nativeGraphics;
- mutable Status lastResult;
-
-};
-
-//----------------------------------------------------------------------------
-// Extra implementation of GraphicsPath methods that use Graphics
-//----------------------------------------------------------------------------
-
-/**
- * Get the bounds of the path object with the given transform.
- * This is not always the tightest bounds.
- */
-
-inline Status
-GraphicsPath::GetBounds(
- OUT RectF* bounds,
- IN const Matrix* matrix,
- IN const Pen* pen) const
-{
- GpMatrix* nativeMatrix = NULL;
- GpPen* nativePen = NULL;
-
- if (matrix)
- nativeMatrix = matrix->nativeMatrix;
-
- if (pen)
- nativePen = pen->nativePen;
-
- return SetStatus(DllExports::GdipGetPathWorldBounds(nativePath, bounds,
- nativeMatrix, nativePen));
-}
-
-// integer version
-inline Status
-GraphicsPath::GetBounds(
- OUT Rect* bounds,
- IN const Matrix* matrix,
- IN const Pen* pen
-) const
-{
- GpMatrix* nativeMatrix = NULL;
- GpPen* nativePen = NULL;
-
- if (matrix)
- nativeMatrix = matrix->nativeMatrix;
-
- if (pen)
- nativePen = pen->nativePen;
-
- return SetStatus(DllExports::GdipGetPathWorldBoundsI(nativePath, bounds,
- nativeMatrix, nativePen));
-}
-
-//----------------------------------------------------------------------------
-// Hit testing operations
-//----------------------------------------------------------------------------
-
-inline BOOL
-GraphicsPath::IsVisible(
- IN REAL x,
- IN REAL y,
- IN const Graphics* g) const
-{
- BOOL booln = FALSE;
-
- GpGraphics* nativeGraphics = NULL;
-
- if (g)
- nativeGraphics = g->nativeGraphics;
-
- SetStatus(DllExports::GdipIsVisiblePathPoint(nativePath,
- x, y, nativeGraphics,
- &booln));
- return booln;
-}
-
-inline BOOL
-GraphicsPath::IsVisible(
- IN INT x,
- IN INT y,
- IN const Graphics* g) const
-{
- BOOL booln = FALSE;
-
- GpGraphics* nativeGraphics = NULL;
-
- if (g)
- nativeGraphics = g->nativeGraphics;
-
- SetStatus(DllExports::GdipIsVisiblePathPointI(nativePath,
- x, y, nativeGraphics,
- &booln));
- return booln;
-}
-
-inline BOOL
-GraphicsPath::IsOutlineVisible(
- IN REAL x,
- IN REAL y,
- IN const Pen* pen,
- IN const Graphics* g) const
-{
- BOOL booln = FALSE;
-
- GpGraphics* nativeGraphics = NULL;
- GpPen* nativePen = NULL;
-
- if(g)
- nativeGraphics = g->nativeGraphics;
- if(pen)
- nativePen = pen->nativePen;
-
- SetStatus(DllExports::GdipIsOutlineVisiblePathPoint(nativePath,
- x, y, nativePen, nativeGraphics,
- &booln));
- return booln;
-}
-
-inline BOOL
-GraphicsPath::IsOutlineVisible(
- IN INT x,
- IN INT y,
- IN const Pen* pen,
- IN const Graphics* g) const
-{
- BOOL booln = FALSE;
-
- GpGraphics* nativeGraphics = NULL;
- GpPen* nativePen = NULL;
-
- if(g)
- nativeGraphics = g->nativeGraphics;
- if(pen)
- nativePen = pen->nativePen;
-
- SetStatus(DllExports::GdipIsOutlineVisiblePathPointI(nativePath,
- x, y, nativePen, nativeGraphics,
- &booln));
- return booln;
-}
-
-#endif
+/**************************************************************************\
+*
+* Copyright (c) 1998-2000, Microsoft Corp. All Rights Reserved.
+*
+* Module Name:
+*
+* GdiplusGraphics.h
+*
+* Abstract:
+*
+* Declarations for Graphics class
+*
+\**************************************************************************/
+
+#ifndef _GDIPLUSGRAPHICS_H
+#define _GDIPLUSGRAPHICS_H
+
+/**
+ * Represent a graphics context
+ */
+class Graphics : public GdiplusBase
+{
+public:
+ friend class Region;
+ friend class GraphicsPath;
+ friend class Image;
+ friend class Bitmap;
+ friend class Metafile;
+ friend class Font;
+ friend class FontFamily;
+ friend class FontCollection;
+ friend class CachedBitmap;
+
+ // Get a graphics context from an existing Win32 HDC or HWND
+ static Graphics* FromHDC(IN HDC hdc)
+ {
+ return new Graphics(hdc);
+ }
+
+ static Graphics* FromHDC(IN HDC hdc,
+ IN HANDLE hdevice)
+ {
+ return new Graphics(hdc, hdevice);
+ }
+
+ static Graphics* FromHWND(IN HWND hwnd,
+ IN BOOL icm = FALSE)
+ {
+ return new Graphics(hwnd, icm);
+ }
+
+ static Graphics* FromImage(IN Image *image)
+ {
+ return new Graphics(image);
+ }
+
+ Graphics(IN HDC hdc)
+ {
+ GpGraphics *graphics = NULL;
+
+ lastResult = DllExports::GdipCreateFromHDC(hdc, &graphics);
+
+ SetNativeGraphics(graphics);
+ }
+
+ Graphics(IN HDC hdc,
+ IN HANDLE hdevice)
+ {
+ GpGraphics *graphics = NULL;
+
+ lastResult = DllExports::GdipCreateFromHDC2(hdc, hdevice, &graphics);
+
+ SetNativeGraphics(graphics);
+ }
+
+ Graphics(IN HWND hwnd,
+ IN BOOL icm = FALSE)
+ {
+ GpGraphics *graphics = NULL;
+
+ if (icm)
+ {
+ lastResult = DllExports::GdipCreateFromHWNDICM(hwnd, &graphics);
+ }
+ else
+ {
+ lastResult = DllExports::GdipCreateFromHWND(hwnd, &graphics);
+ }
+
+ SetNativeGraphics(graphics);
+ }
+
+ Graphics(IN Image* image)
+ {
+ GpGraphics *graphics = NULL;
+
+ if (image != NULL)
+ {
+ lastResult = DllExports::GdipGetImageGraphicsContext(
+ image->nativeImage, &graphics);
+ }
+ SetNativeGraphics(graphics);
+ }
+
+ ~Graphics()
+ {
+ DllExports::GdipDeleteGraphics(nativeGraphics);
+ }
+
+ VOID Flush(IN FlushIntention intention = FlushIntentionFlush)
+ {
+ DllExports::GdipFlush(nativeGraphics, intention);
+ }
+
+ //------------------------------------------------------------------------
+ // Interop methods
+ //------------------------------------------------------------------------
+
+ // Locks the graphics until ReleaseDC is called
+ HDC GetHDC()
+ {
+ HDC hdc = NULL;
+
+ SetStatus(DllExports::GdipGetDC(nativeGraphics, &hdc));
+
+ return hdc;
+ }
+
+ VOID ReleaseHDC(IN HDC hdc)
+ {
+ SetStatus(DllExports::GdipReleaseDC(nativeGraphics, hdc));
+ }
+
+ //------------------------------------------------------------------------
+ // Rendering modes
+ //------------------------------------------------------------------------
+
+ Status SetRenderingOrigin(IN INT x, IN INT y)
+ {
+ return SetStatus(
+ DllExports::GdipSetRenderingOrigin(
+ nativeGraphics, x, y
+ )
+ );
+ }
+
+ Status GetRenderingOrigin(OUT INT *x, OUT INT *y) const
+ {
+ return SetStatus(
+ DllExports::GdipGetRenderingOrigin(
+ nativeGraphics, x, y
+ )
+ );
+ }
+
+ Status SetCompositingMode(IN CompositingMode compositingMode)
+ {
+ return SetStatus(DllExports::GdipSetCompositingMode(nativeGraphics,
+ compositingMode));
+ }
+
+ CompositingMode GetCompositingMode() const
+ {
+ CompositingMode mode;
+
+ SetStatus(DllExports::GdipGetCompositingMode(nativeGraphics,
+ &mode));
+
+ return mode;
+ }
+
+ Status SetCompositingQuality(IN CompositingQuality compositingQuality)
+ {
+ return SetStatus(DllExports::GdipSetCompositingQuality(
+ nativeGraphics,
+ compositingQuality));
+ }
+
+ CompositingQuality GetCompositingQuality() const
+ {
+ CompositingQuality quality;
+
+ SetStatus(DllExports::GdipGetCompositingQuality(
+ nativeGraphics,
+ &quality));
+
+ return quality;
+ }
+
+ Status SetTextRenderingHint(IN TextRenderingHint newMode)
+ {
+#ifndef DCR_USE_NEW_186764
+ /* temporarly set the high bit to warn that we are using the new definition for the flag */
+ newMode = (TextRenderingHint) (newMode | 0x0f000);
+#endif // DCR_USE_NEW_186764
+ return SetStatus(DllExports::GdipSetTextRenderingHint(nativeGraphics,
+ newMode));
+ }
+
+ TextRenderingHint GetTextRenderingHint() const
+ {
+ TextRenderingHint hint;
+
+ SetStatus(DllExports::GdipGetTextRenderingHint(nativeGraphics,
+ &hint));
+
+ return hint;
+ }
+
+#ifdef DCR_USE_NEW_188922
+ Status SetTextContrast(IN UINT contrast)
+ {
+ return SetStatus(DllExports::GdipSetTextContrast(nativeGraphics,
+ contrast));
+ }
+
+ UINT GetTextContrast() const
+ {
+ UINT contrast;
+
+ SetStatus(DllExports::GdipGetTextContrast(nativeGraphics,
+ &contrast));
+
+ return contrast;
+ }
+#else
+ Status SetTextGammaValue(IN UINT gammaValue)
+ {
+ return SetStatus(DllExports::GdipSetTextGammaValue(nativeGraphics,
+ gammaValue));
+ }
+
+ UINT GetTextGammaValue() const
+ {
+ UINT gammaValue;
+
+ SetStatus(DllExports::GdipGetTextGammaValue(nativeGraphics,
+ &gammaValue));
+
+ return gammaValue;
+ }
+
+#endif // DCR_USE_NEW_188922
+
+
+ InterpolationMode GetInterpolationMode() const
+ {
+ InterpolationMode mode = InterpolationModeInvalid;
+
+ SetStatus(DllExports::GdipGetInterpolationMode(nativeGraphics,
+ &mode));
+
+ return mode;
+ }
+
+ Status SetInterpolationMode(IN InterpolationMode interpolationMode)
+ {
+ return SetStatus(DllExports::GdipSetInterpolationMode(nativeGraphics,
+ interpolationMode));
+ }
+
+ SmoothingMode GetSmoothingMode() const
+ {
+ SmoothingMode smoothingMode = SmoothingModeInvalid;
+
+ SetStatus(DllExports::GdipGetSmoothingMode(nativeGraphics,
+ &smoothingMode));
+
+ return smoothingMode;
+ }
+
+ Status SetSmoothingMode(IN SmoothingMode smoothingMode)
+ {
+ return SetStatus(DllExports::GdipSetSmoothingMode(nativeGraphics,
+ smoothingMode));
+ }
+
+ PixelOffsetMode GetPixelOffsetMode() const
+ {
+ PixelOffsetMode pixelOffsetMode = PixelOffsetModeInvalid;
+
+ SetStatus(DllExports::GdipGetPixelOffsetMode(nativeGraphics,
+ &pixelOffsetMode));
+
+ return pixelOffsetMode;
+ }
+
+ Status SetPixelOffsetMode(IN PixelOffsetMode pixelOffsetMode)
+ {
+ return SetStatus(DllExports::GdipSetPixelOffsetMode(nativeGraphics,
+ pixelOffsetMode));
+ }
+
+ //------------------------------------------------------------------------
+ // Manipulate the current world transform
+ //------------------------------------------------------------------------
+
+ Status SetTransform(IN const Matrix* matrix)
+ {
+ return SetStatus(DllExports::GdipSetWorldTransform(nativeGraphics,
+ matrix->nativeMatrix));
+ }
+ Status ResetTransform()
+ {
+ return SetStatus(DllExports::GdipResetWorldTransform(nativeGraphics));
+ }
+
+ Status MultiplyTransform(IN const Matrix* matrix,
+ IN MatrixOrder order = MatrixOrderPrepend)
+ {
+ return SetStatus(DllExports::GdipMultiplyWorldTransform(nativeGraphics,
+ matrix->nativeMatrix,
+ order));
+ }
+
+ Status TranslateTransform(IN REAL dx,
+ IN REAL dy,
+ IN MatrixOrder order = MatrixOrderPrepend)
+ {
+ return SetStatus(DllExports::GdipTranslateWorldTransform(nativeGraphics,
+ dx, dy, order));
+ }
+
+ Status ScaleTransform(IN REAL sx,
+ IN REAL sy,
+ IN MatrixOrder order = MatrixOrderPrepend)
+ {
+ return SetStatus(DllExports::GdipScaleWorldTransform(nativeGraphics,
+ sx, sy, order));
+ }
+
+ Status RotateTransform(IN REAL angle,
+ IN MatrixOrder order = MatrixOrderPrepend)
+ {
+ return SetStatus(DllExports::GdipRotateWorldTransform(nativeGraphics,
+ angle, order));
+ }
+
+ /**
+ * Return the current world transform
+ */
+
+ Status GetTransform(OUT Matrix* matrix) const
+ {
+ return SetStatus(DllExports::GdipGetWorldTransform(nativeGraphics,
+ matrix->nativeMatrix));
+ }
+
+ /**
+ * Manipulate the current page transform
+ */
+
+ Status SetPageUnit(IN Unit unit)
+ {
+ return SetStatus(DllExports::GdipSetPageUnit(nativeGraphics,
+ unit));
+ }
+
+ Status SetPageScale(IN REAL scale)
+ {
+ return SetStatus(DllExports::GdipSetPageScale(nativeGraphics,
+ scale));
+ }
+
+ /**
+ * Retrieve the current page transform information
+ * notes @ these are atomic
+ */
+ Unit GetPageUnit() const
+ {
+ Unit unit;
+
+ SetStatus(DllExports::GdipGetPageUnit(nativeGraphics, &unit));
+
+ return unit;
+ }
+
+ REAL GetPageScale() const
+ {
+ REAL scale;
+
+ SetStatus(DllExports::GdipGetPageScale(nativeGraphics, &scale));
+
+ return scale;
+ }
+
+ REAL GetDpiX() const
+ {
+ REAL dpi;
+
+ SetStatus(DllExports::GdipGetDpiX(nativeGraphics, &dpi));
+
+ return dpi;
+ }
+
+ REAL GetDpiY() const
+ {
+ REAL dpi;
+
+ SetStatus(DllExports::GdipGetDpiY(nativeGraphics, &dpi));
+
+ return dpi;
+ }
+
+ /**
+ * Transform points in the current graphics context
+ */
+ // float version
+ Status TransformPoints(IN CoordinateSpace destSpace,
+ IN CoordinateSpace srcSpace,
+ IN OUT PointF* pts,
+ IN INT count) const
+ {
+ return SetStatus(DllExports::GdipTransformPoints(nativeGraphics,
+ destSpace,
+ srcSpace,
+ pts,
+ count));
+ }
+
+ // integer version
+ Status TransformPoints(IN CoordinateSpace destSpace,
+ IN CoordinateSpace srcSpace,
+ IN OUT Point* pts,
+ IN INT count) const
+ {
+
+ return SetStatus(DllExports::GdipTransformPointsI(nativeGraphics,
+ destSpace,
+ srcSpace,
+ pts,
+ count));
+ }
+
+ //------------------------------------------------------------------------
+ // GetNearestColor (for <= 8bpp surfaces)
+ // Note: alpha is ignored
+ //------------------------------------------------------------------------
+ Status GetNearestColor(IN OUT Color* color) const
+ {
+ if (color == NULL)
+ {
+ return SetStatus(InvalidParameter);
+ }
+
+ ARGB argb = color->GetValue();
+
+ Status status = SetStatus(DllExports::GdipGetNearestColor(nativeGraphics, &argb));
+
+ color->SetValue(argb);
+
+ return status;
+ }
+
+ /**
+ * Vector drawing methods
+ *
+ * @notes Do we need a set of methods that take
+ * integer coordinate parameters?
+ */
+
+ // float version
+ Status DrawLine(IN const Pen* pen,
+ IN REAL x1,
+ IN REAL y1,
+ IN REAL x2,
+ IN REAL y2)
+ {
+ return SetStatus(DllExports::GdipDrawLine(nativeGraphics,
+ pen->nativePen, x1, y1, x2,
+ y2));
+ }
+
+ Status DrawLine(IN const Pen* pen,
+ IN const PointF& pt1,
+ IN const PointF& pt2)
+ {
+ return DrawLine(pen, pt1.X, pt1.Y, pt2.X, pt2.Y);
+ }
+
+ Status DrawLines(IN const Pen* pen,
+ IN const PointF* points,
+ IN INT count)
+ {
+ return SetStatus(DllExports::GdipDrawLines(nativeGraphics,
+ pen->nativePen,
+ points, count));
+ }
+
+ // int version
+ Status DrawLine(IN const Pen* pen,
+ IN INT x1,
+ IN INT y1,
+ IN INT x2,
+ IN INT y2)
+ {
+ return SetStatus(DllExports::GdipDrawLineI(nativeGraphics,
+ pen->nativePen,
+ x1,
+ y1,
+ x2,
+ y2));
+ }
+
+ Status DrawLine(IN const Pen* pen,
+ IN const Point& pt1,
+ IN const Point& pt2)
+ {
+ return DrawLine(pen,
+ pt1.X,
+ pt1.Y,
+ pt2.X,
+ pt2.Y);
+ }
+
+ Status DrawLines(IN const Pen* pen,
+ IN const Point* points,
+ IN INT count)
+ {
+ return SetStatus(DllExports::GdipDrawLinesI(nativeGraphics,
+ pen->nativePen,
+ points,
+ count));
+ }
+
+ // float version
+ Status DrawArc(IN const Pen* pen,
+ IN REAL x,
+ IN REAL y,
+ IN REAL width,
+ IN REAL height,
+ IN REAL startAngle,
+ IN REAL sweepAngle)
+ {
+ return SetStatus(DllExports::GdipDrawArc(nativeGraphics,
+ pen->nativePen,
+ x,
+ y,
+ width,
+ height,
+ startAngle,
+ sweepAngle));
+ }
+
+ Status DrawArc(IN const Pen* pen,
+ IN const RectF& rect,
+ IN REAL startAngle,
+ IN REAL sweepAngle)
+ {
+ return DrawArc(pen, rect.X, rect.Y, rect.Width, rect.Height,
+ startAngle, sweepAngle);
+ }
+
+ // int version
+ Status DrawArc(IN const Pen* pen,
+ IN INT x,
+ IN INT y,
+ IN INT width,
+ IN INT height,
+ IN REAL startAngle,
+ IN REAL sweepAngle)
+ {
+ return SetStatus(DllExports::GdipDrawArcI(nativeGraphics,
+ pen->nativePen,
+ x,
+ y,
+ width,
+ height,
+ startAngle,
+ sweepAngle));
+ }
+
+
+ Status DrawArc(IN const Pen* pen,
+ IN const Rect& rect,
+ IN REAL startAngle,
+ IN REAL sweepAngle)
+ {
+ return DrawArc(pen,
+ rect.X,
+ rect.Y,
+ rect.Width,
+ rect.Height,
+ startAngle,
+ sweepAngle);
+ }
+
+ // float version
+ Status DrawBezier(IN const Pen* pen,
+ IN REAL x1,
+ IN REAL y1,
+ IN REAL x2,
+ IN REAL y2,
+ IN REAL x3,
+ IN REAL y3,
+ IN REAL x4,
+ IN REAL y4)
+ {
+ return SetStatus(DllExports::GdipDrawBezier(nativeGraphics,
+ pen->nativePen, x1, y1,
+ x2, y2, x3, y3, x4, y4));
+ }
+
+ Status DrawBezier(IN const Pen* pen,
+ IN const PointF& pt1,
+ IN const PointF& pt2,
+ IN const PointF& pt3,
+ IN const PointF& pt4)
+ {
+ return DrawBezier(pen,
+ pt1.X,
+ pt1.Y,
+ pt2.X,
+ pt2.Y,
+ pt3.X,
+ pt3.Y,
+ pt4.X,
+ pt4.Y);
+ }
+
+ Status DrawBeziers(IN const Pen* pen,
+ IN const PointF* points,
+ IN INT count)
+ {
+ return SetStatus(DllExports::GdipDrawBeziers(nativeGraphics,
+ pen->nativePen,
+ points,
+ count));
+ }
+
+ // int version
+ Status DrawBezier(IN const Pen* pen,
+ IN INT x1,
+ IN INT y1,
+ IN INT x2,
+ IN INT y2,
+ IN INT x3,
+ IN INT y3,
+ IN INT x4,
+ IN INT y4)
+ {
+ return SetStatus(DllExports::GdipDrawBezierI(nativeGraphics,
+ pen->nativePen,
+ x1,
+ y1,
+ x2,
+ y2,
+ x3,
+ y3,
+ x4,
+ y4));
+ }
+
+ Status DrawBezier(IN const Pen* pen,
+ IN const Point& pt1,
+ IN const Point& pt2,
+ IN const Point& pt3,
+ IN const Point& pt4)
+ {
+ return DrawBezier(pen,
+ pt1.X,
+ pt1.Y,
+ pt2.X,
+ pt2.Y,
+ pt3.X,
+ pt3.Y,
+ pt4.X,
+ pt4.Y);
+ }
+
+ Status DrawBeziers(IN const Pen* pen,
+ IN const Point* points,
+ IN INT count)
+ {
+ return SetStatus(DllExports::GdipDrawBeziersI(nativeGraphics,
+ pen->nativePen,
+ points,
+ count));
+ }
+
+ // float version
+ Status DrawRectangle(IN const Pen* pen,
+ IN const RectF& rect)
+ {
+ return DrawRectangle(pen, rect.X, rect.Y, rect.Width, rect.Height);
+ }
+
+ Status DrawRectangle(IN const Pen* pen,
+ IN REAL x,
+ IN REAL y,
+ IN REAL width,
+ IN REAL height)
+ {
+ return SetStatus(DllExports::GdipDrawRectangle(nativeGraphics,
+ pen->nativePen, x, y,
+ width, height));
+ }
+
+ Status DrawRectangles(IN const Pen* pen,
+ IN const RectF* rects,
+ IN INT count)
+ {
+ return SetStatus(DllExports::GdipDrawRectangles(nativeGraphics,
+ pen->nativePen,
+ rects, count));
+ }
+
+ // integer version
+ Status DrawRectangle(IN const Pen* pen,
+ IN const Rect& rect)
+ {
+ return DrawRectangle(pen,
+ rect.X,
+ rect.Y,
+ rect.Width,
+ rect.Height);
+ }
+
+ Status DrawRectangle(IN const Pen* pen,
+ IN INT x,
+ IN INT y,
+ IN INT width,
+ IN INT height)
+ {
+ return SetStatus(DllExports::GdipDrawRectangleI(nativeGraphics,
+ pen->nativePen,
+ x,
+ y,
+ width,
+ height));
+ }
+
+ Status DrawRectangles(IN const Pen* pen,
+ IN const Rect* rects,
+ IN INT count)
+ {
+ return SetStatus(DllExports::GdipDrawRectanglesI(nativeGraphics,
+ pen->nativePen,
+ rects,
+ count));
+ }
+
+ // float version
+ Status DrawEllipse(IN const Pen* pen,
+ IN const RectF& rect)
+ {
+ return DrawEllipse(pen, rect.X, rect.Y, rect.Width, rect.Height);
+ }
+
+ Status DrawEllipse(IN const Pen* pen,
+ IN REAL x,
+ IN REAL y,
+ IN REAL width,
+ IN REAL height)
+ {
+ return SetStatus(DllExports::GdipDrawEllipse(nativeGraphics,
+ pen->nativePen,
+ x,
+ y,
+ width,
+ height));
+ }
+
+ // integer version
+ Status DrawEllipse(IN const Pen* pen,
+ IN const Rect& rect)
+ {
+ return DrawEllipse(pen,
+ rect.X,
+ rect.Y,
+ rect.Width,
+ rect.Height);
+ }
+
+ Status DrawEllipse(IN const Pen* pen,
+ IN INT x,
+ IN INT y,
+ IN INT width,
+ IN INT height)
+ {
+ return SetStatus(DllExports::GdipDrawEllipseI(nativeGraphics,
+ pen->nativePen,
+ x,
+ y,
+ width,
+ height));
+ }
+
+ // floating point version
+ Status DrawPie(IN const Pen* pen,
+ IN const RectF& rect,
+ IN REAL startAngle,
+ IN REAL sweepAngle)
+ {
+ return DrawPie(pen,
+ rect.X,
+ rect.Y,
+ rect.Width,
+ rect.Height,
+ startAngle,
+ sweepAngle);
+ }
+
+ Status DrawPie(IN const Pen* pen,
+ IN REAL x,
+ IN REAL y,
+ IN REAL width,
+ IN REAL height,
+ IN REAL startAngle,
+ IN REAL sweepAngle)
+ {
+ return SetStatus(DllExports::GdipDrawPie(nativeGraphics,
+ pen->nativePen,
+ x,
+ y,
+ width,
+ height,
+ startAngle,
+ sweepAngle));
+ }
+
+ // integer point version
+ Status DrawPie(IN const Pen* pen,
+ IN const Rect& rect,
+ IN REAL startAngle,
+ IN REAL sweepAngle)
+ {
+ return DrawPie(pen,
+ rect.X,
+ rect.Y,
+ rect.Width,
+ rect.Height,
+ startAngle,
+ sweepAngle);
+ }
+
+ Status DrawPie(IN const Pen* pen,
+ IN INT x,
+ IN INT y,
+ IN INT width,
+ IN INT height,
+ IN REAL startAngle,
+ IN REAL sweepAngle)
+ {
+ return SetStatus(DllExports::GdipDrawPieI(nativeGraphics,
+ pen->nativePen,
+ x,
+ y,
+ width,
+ height,
+ startAngle,
+ sweepAngle));
+ }
+
+ // float version
+ Status DrawPolygon(IN const Pen* pen,
+ IN const PointF* points,
+ IN INT count)
+ {
+ return SetStatus(DllExports::GdipDrawPolygon(nativeGraphics,
+ pen->nativePen,
+ points,
+ count));
+ }
+
+ // integer version
+ Status DrawPolygon(IN const Pen* pen,
+ IN const Point* points,
+ IN INT count)
+ {
+ return SetStatus(DllExports::GdipDrawPolygonI(nativeGraphics,
+ pen->nativePen,
+ points,
+ count));
+ }
+
+ // float version
+ Status DrawPath(IN const Pen* pen,
+ IN const GraphicsPath* path)
+ {
+ return SetStatus(DllExports::GdipDrawPath(nativeGraphics,
+ pen ? pen->nativePen : NULL,
+ path ? path->nativePath : NULL));
+ }
+
+ // float version
+ Status DrawCurve(IN const Pen* pen,
+ IN const PointF* points,
+ IN INT count)
+ {
+ return SetStatus(DllExports::GdipDrawCurve(nativeGraphics,
+ pen->nativePen, points,
+ count));
+ }
+
+ Status DrawCurve(IN const Pen* pen,
+ IN const PointF* points,
+ IN INT count,
+ IN REAL tension)
+ {
+ return SetStatus(DllExports::GdipDrawCurve2(nativeGraphics,
+ pen->nativePen, points,
+ count, tension));
+ }
+
+ Status DrawCurve(IN const Pen* pen,
+ IN const PointF* points,
+ IN INT count,
+ IN INT offset,
+ IN INT numberOfSegments,
+ IN REAL tension = 0.5f)
+ {
+ return SetStatus(DllExports::GdipDrawCurve3(nativeGraphics,
+ pen->nativePen, points,
+ count, offset,
+ numberOfSegments, tension));
+ }
+
+ // integer version
+ Status DrawCurve(IN const Pen* pen,
+ IN const Point* points,
+ IN INT count)
+ {
+ return SetStatus(DllExports::GdipDrawCurveI(nativeGraphics,
+ pen->nativePen,
+ points,
+ count));
+ }
+
+ Status DrawCurve(IN const Pen* pen,
+ IN const Point* points,
+ IN INT count,
+ IN REAL tension)
+ {
+ return SetStatus(DllExports::GdipDrawCurve2I(nativeGraphics,
+ pen->nativePen,
+ points,
+ count,
+ tension));
+ }
+
+ Status DrawCurve(IN const Pen* pen,
+ IN const Point* points,
+ IN INT count,
+ IN INT offset,
+ IN INT numberOfSegments,
+ IN REAL tension = 0.5f)
+ {
+ return SetStatus(DllExports::GdipDrawCurve3I(nativeGraphics,
+ pen->nativePen,
+ points,
+ count,
+ offset,
+ numberOfSegments,
+ tension));
+ }
+
+ // float version
+ Status DrawClosedCurve(IN const Pen* pen,
+ IN const PointF* points,
+ IN INT count)
+ {
+ return SetStatus(DllExports::GdipDrawClosedCurve(nativeGraphics,
+ pen->nativePen,
+ points, count));
+ }
+
+ Status DrawClosedCurve(IN const Pen *pen,
+ IN const PointF* points,
+ IN INT count,
+ IN REAL tension)
+ {
+ return SetStatus(DllExports::GdipDrawClosedCurve2(nativeGraphics,
+ pen->nativePen,
+ points, count,
+ tension));
+ }
+
+ // integer version
+ Status DrawClosedCurve(IN const Pen* pen,
+ IN const Point* points,
+ IN INT count)
+ {
+ return SetStatus(DllExports::GdipDrawClosedCurveI(nativeGraphics,
+ pen->nativePen,
+ points,
+ count));
+ }
+
+ Status DrawClosedCurve(IN const Pen *pen,
+ IN const Point* points,
+ IN INT count,
+ IN REAL tension)
+ {
+ return SetStatus(DllExports::GdipDrawClosedCurve2I(nativeGraphics,
+ pen->nativePen,
+ points,
+ count,
+ tension));
+ }
+
+ Status Clear(IN const Color &color)
+ {
+ return SetStatus(DllExports::GdipGraphicsClear(
+ nativeGraphics,
+ color.GetValue()));
+ }
+
+ // float version
+ Status FillRectangle(IN const Brush* brush,
+ IN const RectF& rect)
+ {
+ return FillRectangle(brush, rect.X, rect.Y, rect.Width, rect.Height);
+ }
+
+ Status FillRectangle(IN const Brush* brush,
+ IN REAL x,
+ IN REAL y,
+ IN REAL width,
+ IN REAL height)
+ {
+ return SetStatus(DllExports::GdipFillRectangle(nativeGraphics,
+ brush->nativeBrush, x, y,
+ width, height));
+ }
+
+ Status FillRectangles(IN const Brush* brush,
+ IN const RectF* rects,
+ IN INT count)
+ {
+ return SetStatus(DllExports::GdipFillRectangles(nativeGraphics,
+ brush->nativeBrush,
+ rects, count));
+ }
+
+ // integer version
+ Status FillRectangle(IN const Brush* brush,
+ IN const Rect& rect)
+ {
+ return FillRectangle(brush,
+ rect.X,
+ rect.Y,
+ rect.Width,
+ rect.Height);
+ }
+
+ Status FillRectangle(IN const Brush* brush,
+ IN INT x,
+ IN INT y,
+ IN INT width,
+ IN INT height)
+ {
+ return SetStatus(DllExports::GdipFillRectangleI(nativeGraphics,
+ brush->nativeBrush,
+ x,
+ y,
+ width,
+ height));
+ }
+
+ Status FillRectangles(IN const Brush* brush,
+ IN const Rect* rects,
+ IN INT count)
+ {
+ return SetStatus(DllExports::GdipFillRectanglesI(nativeGraphics,
+ brush->nativeBrush,
+ rects,
+ count));
+ }
+
+ // float version
+ Status FillPolygon(IN const Brush* brush,
+ IN const PointF* points,
+ IN INT count)
+ {
+ return FillPolygon(brush, points, count, FillModeAlternate);
+ }
+
+ Status FillPolygon(IN const Brush* brush,
+ IN const PointF* points,
+ IN INT count,
+ IN FillMode fillMode)
+ {
+ return SetStatus(DllExports::GdipFillPolygon(nativeGraphics,
+ brush->nativeBrush,
+ points, count, fillMode));
+ }
+
+ // integer version
+ Status FillPolygon(IN const Brush* brush,
+ IN const Point* points,
+ IN INT count)
+ {
+ return FillPolygon(brush, points, count, FillModeAlternate);
+ }
+
+ Status FillPolygon(IN const Brush* brush,
+ IN const Point* points,
+ IN INT count,
+ IN FillMode fillMode)
+ {
+ return SetStatus(DllExports::GdipFillPolygonI(nativeGraphics,
+ brush->nativeBrush,
+ points, count,
+ fillMode));
+ }
+
+ // float version
+ Status FillEllipse(IN const Brush* brush,
+ IN const RectF& rect)
+ {
+ return FillEllipse(brush, rect.X, rect.Y, rect.Width, rect.Height);
+ }
+
+ Status FillEllipse(IN const Brush* brush,
+ IN REAL x,
+ IN REAL y,
+ IN REAL width,
+ IN REAL height)
+ {
+ return SetStatus(DllExports::GdipFillEllipse(nativeGraphics,
+ brush->nativeBrush, x, y,
+ width, height));
+ }
+
+ // integer version
+ Status FillEllipse(IN const Brush* brush,
+ IN const Rect& rect)
+ {
+ return FillEllipse(brush, rect.X, rect.Y, rect.Width, rect.Height);
+ }
+
+ Status FillEllipse(IN const Brush* brush,
+ IN INT x,
+ IN INT y,
+ IN INT width,
+ IN INT height)
+ {
+ return SetStatus(DllExports::GdipFillEllipseI(nativeGraphics,
+ brush->nativeBrush,
+ x,
+ y,
+ width,
+ height));
+ }
+
+ // float version
+ Status FillPie(IN const Brush* brush,
+ IN const RectF& rect,
+ IN REAL startAngle,
+ IN REAL sweepAngle)
+ {
+ return FillPie(brush, rect.X, rect.Y, rect.Width, rect.Height,
+ startAngle, sweepAngle);
+ }
+
+ Status FillPie(IN const Brush* brush,
+ IN REAL x,
+ IN REAL y,
+ IN REAL width,
+ IN REAL height,
+ IN REAL startAngle,
+ IN REAL sweepAngle)
+ {
+ return SetStatus(DllExports::GdipFillPie(nativeGraphics,
+ brush->nativeBrush, x, y,
+ width, height, startAngle,
+ sweepAngle));
+ }
+
+ // integer version
+ Status FillPie(IN const Brush* brush,
+ IN const Rect& rect,
+ IN REAL startAngle,
+ IN REAL sweepAngle)
+ {
+ return FillPie(brush, rect.X, rect.Y, rect.Width, rect.Height,
+ startAngle, sweepAngle);
+ }
+
+ Status FillPie(IN const Brush* brush,
+ IN INT x,
+ IN INT y,
+ IN INT width,
+ IN INT height,
+ IN REAL startAngle,
+ IN REAL sweepAngle)
+ {
+ return SetStatus(DllExports::GdipFillPieI(nativeGraphics,
+ brush->nativeBrush,
+ x,
+ y,
+ width,
+ height,
+ startAngle,
+ sweepAngle));
+ }
+
+ Status FillPath(IN const Brush* brush,
+ IN const GraphicsPath* path)
+ {
+ return SetStatus(DllExports::GdipFillPath(nativeGraphics,
+ brush->nativeBrush,
+ path->nativePath));
+ }
+
+ // float version
+ Status FillClosedCurve(IN const Brush* brush,
+ IN const PointF* points,
+ IN INT count)
+ {
+ return SetStatus(DllExports::GdipFillClosedCurve(nativeGraphics,
+ brush->nativeBrush,
+ points, count));
+
+ }
+
+ Status FillClosedCurve(IN const Brush* brush,
+ IN const PointF* points,
+ IN INT count,
+ IN FillMode fillMode,
+ IN REAL tension = 0.5f)
+ {
+ return SetStatus(DllExports::GdipFillClosedCurve2(nativeGraphics,
+ brush->nativeBrush,
+ points, count,
+ tension, fillMode));
+ }
+
+ // integer version
+ Status FillClosedCurve(IN const Brush* brush,
+ IN const Point* points,
+ IN INT count)
+ {
+ return SetStatus(DllExports::GdipFillClosedCurveI(nativeGraphics,
+ brush->nativeBrush,
+ points,
+ count));
+ }
+
+ Status FillClosedCurve(IN const Brush* brush,
+ IN const Point* points,
+ IN INT count,
+ IN FillMode fillMode,
+ IN REAL tension = 0.5f)
+ {
+ return SetStatus(DllExports::GdipFillClosedCurve2I(nativeGraphics,
+ brush->nativeBrush,
+ points, count,
+ tension, fillMode));
+ }
+
+ // float version
+ Status FillRegion(IN const Brush* brush,
+ IN const Region* region)
+ {
+ return SetStatus(DllExports::GdipFillRegion(nativeGraphics,
+ brush->nativeBrush,
+ region->nativeRegion));
+ }
+
+ // DrawString and MeasureString
+ Status
+ DrawString(
+ IN const WCHAR *string,
+ IN INT length,
+ IN const Font *font,
+ IN const RectF &layoutRect,
+ IN const StringFormat *stringFormat,
+ IN const Brush *brush
+ )
+ {
+ return SetStatus(DllExports::GdipDrawString(
+ nativeGraphics,
+ string,
+ length,
+ font ? font->nativeFont : NULL,
+ &layoutRect,
+ stringFormat ? stringFormat->nativeFormat : NULL,
+ brush ? brush->nativeBrush : NULL
+ ));
+ }
+
+ Status
+ DrawString(
+ const WCHAR *string,
+ INT length,
+ const Font *font,
+ const PointF &origin,
+ const Brush *brush
+ )
+ {
+ RectF rect(origin.X, origin.Y, 0.0f, 0.0f);
+
+ return SetStatus(DllExports::GdipDrawString(
+ nativeGraphics,
+ string,
+ length,
+ font ? font->nativeFont : NULL,
+ &rect,
+ NULL,
+ brush ? brush->nativeBrush : NULL
+ ));
+ }
+
+ Status
+ DrawString(
+ const WCHAR *string,
+ INT length,
+ const Font *font,
+ const PointF &origin,
+ const StringFormat *stringFormat,
+ const Brush *brush
+ )
+ {
+ RectF rect(origin.X, origin.Y, 0.0f, 0.0f);
+
+ return SetStatus(DllExports::GdipDrawString(
+ nativeGraphics,
+ string,
+ length,
+ font ? font->nativeFont : NULL,
+ &rect,
+ stringFormat ? stringFormat->nativeFormat : NULL,
+ brush ? brush->nativeBrush : NULL
+ ));
+ }
+
+ Status
+ MeasureString(
+ IN const WCHAR *string,
+ IN INT length,
+ IN const Font *font,
+ IN const RectF &layoutRect,
+ IN const StringFormat *stringFormat,
+ OUT RectF *boundingBox,
+ OUT INT *codepointsFitted = 0,
+ OUT INT *linesFilled = 0
+ ) const
+ {
+ return SetStatus(DllExports::GdipMeasureString(
+ nativeGraphics,
+ string,
+ length,
+ font ? font->nativeFont : NULL,
+ &layoutRect,
+ stringFormat ? stringFormat->nativeFormat : NULL,
+ boundingBox,
+ codepointsFitted,
+ linesFilled
+ ));
+ }
+
+ Status
+ MeasureString(
+ IN const WCHAR *string,
+ IN INT length,
+ IN const Font *font,
+ IN const SizeF &layoutRectSize,
+ IN const StringFormat *stringFormat,
+ OUT SizeF *size,
+ OUT INT *codepointsFitted = 0,
+ OUT INT *linesFilled = 0
+ ) const
+ {
+ RectF layoutRect(0, 0, layoutRectSize.Width, layoutRectSize.Height);
+ RectF boundingBox;
+ Status status;
+
+ if (size == NULL)
+ {
+ return SetStatus(InvalidParameter);
+ }
+
+ status = SetStatus(DllExports::GdipMeasureString(
+ nativeGraphics,
+ string,
+ length,
+ font ? font->nativeFont : NULL,
+ &layoutRect,
+ stringFormat ? stringFormat->nativeFormat : NULL,
+ size ? &boundingBox : NULL,
+ codepointsFitted,
+ linesFilled
+ ));
+
+ if (size && status == Ok)
+ {
+ size->Width = boundingBox.Width;
+ size->Height = boundingBox.Height;
+ }
+
+ return status;
+ }
+
+ Status
+ MeasureString(
+ IN const WCHAR *string,
+ IN INT length,
+ IN const Font *font,
+ IN const PointF &origin,
+ IN const StringFormat *stringFormat,
+ OUT RectF *boundingBox
+ ) const
+ {
+ RectF rect(origin.X, origin.Y, 0.0f, 0.0f);
+
+ return SetStatus(DllExports::GdipMeasureString(
+ nativeGraphics,
+ string,
+ length,
+ font ? font->nativeFont : NULL,
+ &rect,
+ stringFormat ? stringFormat->nativeFormat : NULL,
+ boundingBox,
+ NULL,
+ NULL
+ ));
+ }
+
+
+ Status
+ MeasureString(
+ IN const WCHAR *string,
+ IN INT length,
+ IN const Font *font,
+ IN const RectF &layoutRect,
+ OUT RectF *boundingBox
+ ) const
+ {
+ return SetStatus(DllExports::GdipMeasureString(
+ nativeGraphics,
+ string,
+ length,
+ font ? font->nativeFont : NULL,
+ &layoutRect,
+ NULL,
+ boundingBox,
+ NULL,
+ NULL
+ ));
+ }
+
+ Status
+ MeasureString(
+ IN const WCHAR *string,
+ IN INT length,
+ IN const Font *font,
+ IN const PointF &origin,
+ OUT RectF *boundingBox
+ ) const
+ {
+ RectF rect(origin.X, origin.Y, 0.0f, 0.0f);
+
+ return SetStatus(DllExports::GdipMeasureString(
+ nativeGraphics,
+ string,
+ length,
+ font ? font->nativeFont : NULL,
+ &rect,
+ NULL,
+ boundingBox,
+ NULL,
+ NULL
+ ));
+ }
+
+
+#ifdef DCR_USE_NEW_174340
+ Status
+ MeasureCharacterRanges(
+ IN const WCHAR *string,
+ IN INT length,
+ IN const Font *font,
+ IN const RectF &layoutRect,
+ IN const StringFormat *stringFormat,
+ IN INT regionCount,
+ OUT Region *regions
+ ) const
+ {
+ if (!regions || regionCount <= 0)
+ {
+ return InvalidParameter;
+ }
+
+ GpRegion **nativeRegions = new GpRegion* [regionCount];
+
+ if (!nativeRegions)
+ {
+ return OutOfMemory;
+ }
+
+ for (INT i = 0; i < regionCount; i++)
+ {
+ nativeRegions[i] = regions[i].nativeRegion;
+ }
+
+ Status status = SetStatus(DllExports::GdipMeasureCharacterRanges(
+ nativeGraphics,
+ string,
+ length,
+ font ? font->nativeFont : NULL,
+ layoutRect,
+ stringFormat ? stringFormat->nativeFormat : NULL,
+ regionCount,
+ nativeRegions
+ ));
+
+ delete [] nativeRegions;
+
+ return status;
+ }
+#endif
+
+
+#ifndef DCR_USE_NEW_174340
+ Status
+ MeasureStringRegion(
+ IN const WCHAR *string,
+ IN INT length,
+ IN const Font *font,
+ IN const RectF &layoutRect,
+ IN const StringFormat *stringFormat,
+ IN INT firstCharacterIndex,
+ IN INT characterCount,
+ OUT Region *region
+ ) const
+ {
+ if (region == NULL)
+ {
+ return SetStatus(InvalidParameter);
+ }
+
+ return (SetStatus(DllExports::GdipMeasureStringRegion(
+ nativeGraphics,
+ string,
+ length,
+ font ? font->nativeFont : NULL,
+ layoutRect,
+ stringFormat ? stringFormat->nativeFormat : NULL,
+ firstCharacterIndex,
+ characterCount,
+ region->nativeRegion)));
+ }
+#endif
+
+ Status DrawDriverString(
+ IN const UINT16 *text,
+ IN INT length,
+ IN const Font *font,
+ IN const Brush *brush,
+ IN const PointF *positions,
+ IN INT flags,
+ IN const Matrix *matrix
+ )
+ {
+ return SetStatus(DllExports::GdipDrawDriverString(
+ nativeGraphics,
+ text,
+ length,
+ font ? font->nativeFont : NULL,
+ brush ? brush->nativeBrush : NULL,
+ positions,
+ flags,
+ matrix ? matrix->nativeMatrix : NULL
+ ));
+ }
+
+ Status MeasureDriverString(
+ IN const UINT16 *text,
+ IN INT length,
+ IN const Font *font,
+ IN const PointF *positions,
+ IN INT flags,
+ IN const Matrix *matrix,
+ OUT RectF *boundingBox
+ ) const
+ {
+ return SetStatus(DllExports::GdipMeasureDriverString(
+ nativeGraphics,
+ text,
+ length,
+ font ? font->nativeFont : NULL,
+ positions,
+ flags,
+ matrix ? matrix->nativeMatrix : NULL,
+ boundingBox
+ ));
+ }
+
+#ifndef DCR_USE_NEW_168772
+ Status DriverStringPointToCodepoint(
+ IN const UINT16 *text,
+ IN INT length,
+ IN const Font *font,
+ IN const PointF *positions,
+ IN INT flags,
+ IN const Matrix *matrix,
+ IN const PointF &hit,
+ OUT INT *index,
+ OUT BOOL *rightEdge,
+ OUT REAL *distance
+ )
+ {
+ return SetStatus(DllExports::GdipDriverStringPointToCodepoint(
+ nativeGraphics,
+ text,
+ length,
+ font ? font->nativeFont : NULL,
+ positions,
+ flags,
+ matrix ? matrix->nativeMatrix : NULL,
+ &hit,
+ index,
+ rightEdge,
+ distance
+ ));
+ }
+#endif
+
+ // Draw a cached bitmap on this graphics destination offset by
+ // x, y. Note this will fail with WrongState if the CachedBitmap
+ // native format differs from this Graphics.
+
+ Status DrawCachedBitmap(IN CachedBitmap *cb,
+ IN INT x,
+ IN INT y)
+ {
+ return SetStatus(DllExports::GdipDrawCachedBitmap(
+ nativeGraphics,
+ cb->nativeCachedBitmap,
+ x, y
+ ));
+ }
+
+ /**
+ * Draw images (both bitmap and vector)
+ */
+ // float version
+ Status DrawImage(IN Image* image,
+ IN const PointF& point)
+ {
+ return DrawImage(image, point.X, point.Y);
+ }
+
+ Status DrawImage(IN Image* image,
+ IN REAL x,
+ IN REAL y)
+ {
+ return SetStatus(DllExports::GdipDrawImage(nativeGraphics,
+ image ? image->nativeImage
+ : NULL,
+ x,
+ y));
+ }
+
+ Status DrawImage(IN Image* image,
+ IN const RectF& rect)
+ {
+ return DrawImage(image, rect.X, rect.Y, rect.Width, rect.Height);
+ }
+
+ Status DrawImage(IN Image* image,
+ IN REAL x,
+ IN REAL y,
+ IN REAL width,
+ IN REAL height)
+ {
+ return SetStatus(DllExports::GdipDrawImageRect(nativeGraphics,
+ image ? image->nativeImage
+ : NULL,
+ x,
+ y,
+ width,
+ height));
+ }
+
+ // integer version
+ Status DrawImage(IN Image* image,
+ IN const Point& point)
+ {
+ return DrawImage(image, point.X, point.Y);
+ }
+
+ Status DrawImage(IN Image* image,
+ IN INT x,
+ IN INT y)
+ {
+ return SetStatus(DllExports::GdipDrawImageI(nativeGraphics,
+ image ? image->nativeImage
+ : NULL,
+ x,
+ y));
+ }
+
+ Status DrawImage(IN Image* image,
+ IN const Rect& rect)
+ {
+ return DrawImage(image,
+ rect.X,
+ rect.Y,
+ rect.Width,
+ rect.Height);
+ }
+
+ Status DrawImage(IN Image* image,
+ IN INT x,
+ IN INT y,
+ IN INT width,
+ IN INT height) {
+ return SetStatus(DllExports::GdipDrawImageRectI(nativeGraphics,
+ image ? image->nativeImage
+ : NULL,
+ x,
+ y,
+ width,
+ height));
+ }
+
+ /**
+ * Affine or perspective blt
+ * destPoints.length = 3: rect => parallelogram
+ * destPoints[0] <=> top-left corner of the source rectangle
+ * destPoints[1] <=> top-right corner
+ * destPoints[2] <=> bottom-left corner
+ * destPoints.length = 4: rect => quad
+ * destPoints[3] <=> bottom-right corner
+ *
+ * @notes Perspective blt only works for bitmap images.
+ */
+ Status DrawImage(IN Image* image,
+ IN const PointF* destPoints,
+ IN INT count)
+ {
+ if (count != 3 && count != 4)
+ return SetStatus(InvalidParameter);
+
+ return SetStatus(DllExports::GdipDrawImagePoints(nativeGraphics,
+ image ? image->nativeImage
+ : NULL,
+ destPoints, count));
+ }
+
+ Status DrawImage(IN Image* image,
+ IN const Point* destPoints,
+ IN INT count)
+ {
+ if (count != 3 && count != 4)
+ return SetStatus(InvalidParameter);
+
+ return SetStatus(DllExports::GdipDrawImagePointsI(nativeGraphics,
+ image ? image->nativeImage
+ : NULL,
+ destPoints,
+ count));
+ }
+
+ /**
+ * We need another set of methods similar to the ones above
+ * that take an additional Rect parameter to specify the
+ * portion of the source image to be drawn.
+ */
+ // float version
+ Status DrawImage(IN Image* image,
+ IN REAL x,
+ IN REAL y,
+ IN REAL srcx,
+ IN REAL srcy,
+ IN REAL srcwidth,
+ IN REAL srcheight,
+ IN Unit srcUnit)
+ {
+ return SetStatus(DllExports::GdipDrawImagePointRect(nativeGraphics,
+ image ? image->nativeImage
+ : NULL,
+ x, y,
+ srcx, srcy,
+ srcwidth, srcheight, srcUnit));
+ }
+
+ Status DrawImage(IN Image* image,
+ IN const RectF& destRect,
+ IN REAL srcx,
+ IN REAL srcy,
+ IN REAL srcwidth,
+ IN REAL srcheight,
+ IN Unit srcUnit,
+ IN const ImageAttributes* imageAttributes = NULL,
+ IN DrawImageAbort callback = NULL,
+ IN VOID* callbackData = NULL)
+ {
+ return SetStatus(DllExports::GdipDrawImageRectRect(nativeGraphics,
+ image ? image->nativeImage
+ : NULL,
+ destRect.X,
+ destRect.Y,
+ destRect.Width,
+ destRect.Height,
+ srcx, srcy,
+ srcwidth, srcheight,
+ srcUnit,
+ imageAttributes
+ ? imageAttributes->nativeImageAttr
+ : NULL,
+ callback,
+ callbackData));
+ }
+
+ Status DrawImage(IN Image* image,
+ IN const PointF* destPoints,
+ IN INT count,
+ IN REAL srcx,
+ IN REAL srcy,
+ IN REAL srcwidth,
+ IN REAL srcheight,
+ IN Unit srcUnit,
+ IN const ImageAttributes* imageAttributes = NULL,
+ IN DrawImageAbort callback = NULL,
+ IN VOID* callbackData = NULL)
+ {
+ return SetStatus(DllExports::GdipDrawImagePointsRect(nativeGraphics,
+ image ? image->nativeImage
+ : NULL,
+ destPoints, count,
+ srcx, srcy,
+ srcwidth,
+ srcheight,
+ srcUnit,
+ imageAttributes
+ ? imageAttributes->nativeImageAttr
+ : NULL,
+ callback,
+ callbackData));
+ }
+
+ // integer version
+ Status DrawImage(IN Image* image,
+ IN INT x,
+ IN INT y,
+ IN INT srcx,
+ IN INT srcy,
+ IN INT srcwidth,
+ IN INT srcheight,
+ IN Unit srcUnit)
+ {
+ return SetStatus(DllExports::GdipDrawImagePointRectI(nativeGraphics,
+ image ? image->nativeImage
+ : NULL,
+ x,
+ y,
+ srcx,
+ srcy,
+ srcwidth,
+ srcheight,
+ srcUnit));
+ }
+
+ Status DrawImage(IN Image* image,
+ IN const Rect& destRect,
+ IN INT srcx,
+ IN INT srcy,
+ IN INT srcwidth,
+ IN INT srcheight,
+ IN Unit srcUnit,
+ IN const ImageAttributes* imageAttributes = NULL,
+ IN DrawImageAbort callback = NULL,
+ IN VOID* callbackData = NULL)
+ {
+ return SetStatus(DllExports::GdipDrawImageRectRectI(nativeGraphics,
+ image ? image->nativeImage
+ : NULL,
+ destRect.X,
+ destRect.Y,
+ destRect.Width,
+ destRect.Height,
+ srcx,
+ srcy,
+ srcwidth,
+ srcheight,
+ srcUnit,
+ imageAttributes
+ ? imageAttributes->nativeImageAttr
+ : NULL,
+ callback,
+ callbackData));
+ }
+
+ Status DrawImage(IN Image* image,
+ IN const Point* destPoints,
+ IN INT count,
+ IN INT srcx,
+ IN INT srcy,
+ IN INT srcwidth,
+ IN INT srcheight,
+ IN Unit srcUnit,
+ IN const ImageAttributes* imageAttributes = NULL,
+ IN DrawImageAbort callback = NULL,
+ IN VOID* callbackData = NULL)
+ {
+ return SetStatus(DllExports::GdipDrawImagePointsRectI(nativeGraphics,
+ image ? image->nativeImage
+ : NULL,
+ destPoints,
+ count,
+ srcx,
+ srcy,
+ srcwidth,
+ srcheight,
+ srcUnit,
+ imageAttributes
+ ? imageAttributes->nativeImageAttr
+ : NULL,
+ callback,
+ callbackData));
+ }
+
+ // The following methods are for playing an EMF+ to a graphics
+ // via the enumeration interface. Each record of the EMF+ is
+ // sent to the callback (along with the callbackData). Then
+ // the callback can invoke the Metafile::PlayRecord method
+ // to play the particular record.
+
+ Status
+ EnumerateMetafile(
+ IN const Metafile * metafile,
+ IN const PointF & destPoint,
+ IN EnumerateMetafileProc callback,
+ IN VOID * callbackData = NULL,
+ IN const ImageAttributes * imageAttributes = NULL
+ )
+ {
+ return SetStatus(DllExports::GdipEnumerateMetafileDestPoint(
+ nativeGraphics,
+ (const GpMetafile *)(metafile ? metafile->nativeImage:NULL),
+ destPoint,
+ callback,
+ callbackData,
+ imageAttributes ? imageAttributes->nativeImageAttr : NULL));
+ }
+
+ Status
+ EnumerateMetafile(
+ IN const Metafile * metafile,
+ IN const Point & destPoint,
+ IN EnumerateMetafileProc callback,
+ IN VOID * callbackData = NULL,
+ IN const ImageAttributes * imageAttributes = NULL
+ )
+ {
+ return SetStatus(DllExports::GdipEnumerateMetafileDestPointI(
+ nativeGraphics,
+ (const GpMetafile *)(metafile ? metafile->nativeImage:NULL),
+ destPoint,
+ callback,
+ callbackData,
+ imageAttributes ? imageAttributes->nativeImageAttr : NULL));
+ }
+
+ Status
+ EnumerateMetafile(
+ IN const Metafile * metafile,
+ IN const RectF & destRect,
+ IN EnumerateMetafileProc callback,
+ IN VOID * callbackData = NULL,
+ IN const ImageAttributes * imageAttributes = NULL
+ )
+ {
+ return SetStatus(DllExports::GdipEnumerateMetafileDestRect(
+ nativeGraphics,
+ (const GpMetafile *)(metafile ? metafile->nativeImage:NULL),
+ destRect,
+ callback,
+ callbackData,
+ imageAttributes ? imageAttributes->nativeImageAttr : NULL));
+ }
+
+ Status
+ EnumerateMetafile(
+ IN const Metafile * metafile,
+ IN const Rect & destRect,
+ IN EnumerateMetafileProc callback,
+ IN VOID * callbackData = NULL,
+ IN const ImageAttributes * imageAttributes = NULL
+ )
+ {
+ return SetStatus(DllExports::GdipEnumerateMetafileDestRectI(
+ nativeGraphics,
+ (const GpMetafile *)(metafile ? metafile->nativeImage:NULL),
+ destRect,
+ callback,
+ callbackData,
+ imageAttributes ? imageAttributes->nativeImageAttr : NULL));
+ }
+
+ Status
+ EnumerateMetafile(
+ IN const Metafile * metafile,
+ IN const PointF * destPoints,
+ IN INT count,
+ IN EnumerateMetafileProc callback,
+ IN VOID * callbackData = NULL,
+ IN const ImageAttributes * imageAttributes = NULL
+ )
+ {
+ return SetStatus(DllExports::GdipEnumerateMetafileDestPoints(
+ nativeGraphics,
+ (const GpMetafile *)(metafile ? metafile->nativeImage:NULL),
+ destPoints,
+ count,
+ callback,
+ callbackData,
+ imageAttributes ? imageAttributes->nativeImageAttr : NULL));
+ }
+
+ Status
+ EnumerateMetafile(
+ IN const Metafile * metafile,
+ IN const Point * destPoints,
+ IN INT count,
+ IN EnumerateMetafileProc callback,
+ IN VOID * callbackData = NULL,
+ IN const ImageAttributes * imageAttributes = NULL
+ )
+ {
+ return SetStatus(DllExports::GdipEnumerateMetafileDestPointsI(
+ nativeGraphics,
+ (const GpMetafile *)(metafile ? metafile->nativeImage:NULL),
+ destPoints,
+ count,
+ callback,
+ callbackData,
+ imageAttributes ? imageAttributes->nativeImageAttr : NULL));
+ }
+
+ Status
+ EnumerateMetafile(
+ IN const Metafile * metafile,
+ IN const PointF & destPoint,
+ IN const RectF & srcRect,
+ IN Unit srcUnit,
+ IN EnumerateMetafileProc callback,
+ IN VOID * callbackData = NULL,
+ IN const ImageAttributes * imageAttributes = NULL
+ )
+ {
+ return SetStatus(DllExports::GdipEnumerateMetafileSrcRectDestPoint(
+ nativeGraphics,
+ (const GpMetafile *)(metafile ? metafile->nativeImage:NULL),
+ destPoint,
+ srcRect,
+ srcUnit,
+ callback,
+ callbackData,
+ imageAttributes ? imageAttributes->nativeImageAttr : NULL));
+ }
+
+ Status
+ EnumerateMetafile(
+ IN const Metafile * metafile,
+ IN const Point & destPoint,
+ IN const Rect & srcRect,
+ IN Unit srcUnit,
+ IN EnumerateMetafileProc callback,
+ IN VOID * callbackData = NULL,
+ IN const ImageAttributes * imageAttributes = NULL
+ )
+ {
+ return SetStatus(DllExports::GdipEnumerateMetafileSrcRectDestPointI(
+ nativeGraphics,
+ (const GpMetafile *)(metafile ? metafile->nativeImage:NULL),
+ destPoint,
+ srcRect,
+ srcUnit,
+ callback,
+ callbackData,
+ imageAttributes ? imageAttributes->nativeImageAttr : NULL));
+ }
+
+ Status
+ EnumerateMetafile(
+ IN const Metafile * metafile,
+ IN const RectF & destRect,
+ IN const RectF & srcRect,
+ IN Unit srcUnit,
+ IN EnumerateMetafileProc callback,
+ IN VOID * callbackData = NULL,
+ IN const ImageAttributes * imageAttributes = NULL
+ )
+ {
+ return SetStatus(DllExports::GdipEnumerateMetafileSrcRectDestRect(
+ nativeGraphics,
+ (const GpMetafile *)(metafile ? metafile->nativeImage:NULL),
+ destRect,
+ srcRect,
+ srcUnit,
+ callback,
+ callbackData,
+ imageAttributes ? imageAttributes->nativeImageAttr : NULL));
+ }
+
+ Status
+ EnumerateMetafile(
+ IN const Metafile * metafile,
+ IN const Rect & destRect,
+ IN const Rect & srcRect,
+ IN Unit srcUnit,
+ IN EnumerateMetafileProc callback,
+ IN VOID * callbackData = NULL,
+ IN const ImageAttributes * imageAttributes = NULL
+ )
+ {
+ return SetStatus(DllExports::GdipEnumerateMetafileSrcRectDestRectI(
+ nativeGraphics,
+ (const GpMetafile *)(metafile ? metafile->nativeImage:NULL),
+ destRect,
+ srcRect,
+ srcUnit,
+ callback,
+ callbackData,
+ imageAttributes ? imageAttributes->nativeImageAttr : NULL));
+ }
+
+ Status
+ EnumerateMetafile(
+ IN const Metafile * metafile,
+ IN const PointF * destPoints,
+ IN INT count,
+ IN const RectF & srcRect,
+ IN Unit srcUnit,
+ IN EnumerateMetafileProc callback,
+ IN VOID * callbackData = NULL,
+ IN const ImageAttributes * imageAttributes = NULL
+ )
+ {
+ return SetStatus(DllExports::GdipEnumerateMetafileSrcRectDestPoints(
+ nativeGraphics,
+ (const GpMetafile *)(metafile ? metafile->nativeImage:NULL),
+ destPoints,
+ count,
+ srcRect,
+ srcUnit,
+ callback,
+ callbackData,
+ imageAttributes ? imageAttributes->nativeImageAttr : NULL));
+ }
+
+ Status
+ EnumerateMetafile(
+ IN const Metafile * metafile,
+ IN const Point * destPoints,
+ IN INT count,
+ IN const Rect & srcRect,
+ IN Unit srcUnit,
+ IN EnumerateMetafileProc callback,
+ IN VOID * callbackData = NULL,
+ IN const ImageAttributes * imageAttributes = NULL
+ )
+ {
+ return SetStatus(DllExports::GdipEnumerateMetafileSrcRectDestPointsI(
+ nativeGraphics,
+ (const GpMetafile *)(metafile ? metafile->nativeImage:NULL),
+ destPoints,
+ count,
+ srcRect,
+ srcUnit,
+ callback,
+ callbackData,
+ imageAttributes ? imageAttributes->nativeImageAttr : NULL));
+ }
+
+ /**
+ * Clipping region operations
+ *
+ * @notes Simply incredible redundancy here.
+ */
+ Status SetClip(IN const Graphics* g,
+ IN CombineMode combineMode = CombineModeReplace)
+ {
+ return SetStatus(DllExports::GdipSetClipGraphics(nativeGraphics,
+ g->nativeGraphics,
+ combineMode));
+ }
+
+ Status SetClip(IN const RectF& rect,
+ IN CombineMode combineMode = CombineModeReplace)
+ {
+ return SetStatus(DllExports::GdipSetClipRect(nativeGraphics,
+ rect.X, rect.Y,
+ rect.Width, rect.Height,
+ combineMode));
+ }
+
+ Status SetClip(IN const Rect& rect,
+ IN CombineMode combineMode = CombineModeReplace)
+ {
+ return SetStatus(DllExports::GdipSetClipRectI(nativeGraphics,
+ rect.X, rect.Y,
+ rect.Width, rect.Height,
+ combineMode));
+ }
+
+ Status SetClip(IN const GraphicsPath* path,
+ IN CombineMode combineMode = CombineModeReplace)
+ {
+ return SetStatus(DllExports::GdipSetClipPath(nativeGraphics,
+ path->nativePath,
+ combineMode));
+ }
+
+ Status SetClip(IN const Region* region,
+ IN CombineMode combineMode = CombineModeReplace)
+ {
+ return SetStatus(DllExports::GdipSetClipRegion(nativeGraphics,
+ region->nativeRegion,
+ combineMode));
+ }
+
+ // This is different than the other SetClip methods because it assumes
+ // that the HRGN is already in device units, so it doesn't transform
+ // the coordinates in the HRGN.
+ Status SetClip(IN HRGN hRgn,
+ IN CombineMode combineMode = CombineModeReplace)
+ {
+ return SetStatus(DllExports::GdipSetClipHrgn(nativeGraphics, hRgn,
+ combineMode));
+ }
+
+ Status IntersectClip(IN const RectF& rect)
+ {
+ return SetStatus(DllExports::GdipSetClipRect(nativeGraphics,
+ rect.X, rect.Y,
+ rect.Width, rect.Height,
+ CombineModeIntersect));
+ }
+
+ Status IntersectClip(IN const Rect& rect)
+ {
+ return SetStatus(DllExports::GdipSetClipRectI(nativeGraphics,
+ rect.X, rect.Y,
+ rect.Width, rect.Height,
+ CombineModeIntersect));
+ }
+
+ Status IntersectClip(IN const Region* region)
+ {
+ return SetStatus(DllExports::GdipSetClipRegion(nativeGraphics,
+ region->nativeRegion,
+ CombineModeIntersect));
+ }
+
+ Status ExcludeClip(IN const RectF& rect)
+ {
+ return SetStatus(DllExports::GdipSetClipRect(nativeGraphics,
+ rect.X, rect.Y,
+ rect.Width, rect.Height,
+ CombineModeExclude));
+ }
+
+ Status ExcludeClip(IN const Rect& rect)
+ {
+ return SetStatus(DllExports::GdipSetClipRectI(nativeGraphics,
+ rect.X, rect.Y,
+ rect.Width, rect.Height,
+ CombineModeExclude));
+ }
+
+ Status ExcludeClip(IN const Region* region)
+ {
+ return SetStatus(DllExports::GdipSetClipRegion(nativeGraphics,
+ region->nativeRegion,
+ CombineModeExclude));
+ }
+
+ Status ResetClip()
+ {
+ return SetStatus(DllExports::GdipResetClip(nativeGraphics));
+ }
+
+ Status TranslateClip(IN REAL dx,
+ IN REAL dy)
+ {
+ return SetStatus(DllExports::GdipTranslateClip(nativeGraphics, dx, dy));
+ }
+
+ Status TranslateClip(IN INT dx,
+ IN INT dy)
+ {
+ return SetStatus(DllExports::GdipTranslateClipI(nativeGraphics,
+ dx, dy));
+ }
+
+ /**
+ * GetClip region from graphics context
+ */
+ Status GetClip(OUT Region* region) const
+ {
+ return SetStatus(DllExports::GdipGetClip(nativeGraphics,
+ region->nativeRegion));
+ }
+
+ /**
+ * Hit testing operations
+ */
+ Status GetClipBounds(OUT RectF* rect) const
+ {
+ return SetStatus(DllExports::GdipGetClipBounds(nativeGraphics, rect));
+ }
+
+ Status GetClipBounds(OUT Rect* rect) const
+ {
+ return SetStatus(DllExports::GdipGetClipBoundsI(nativeGraphics, rect));
+ }
+
+ BOOL IsClipEmpty() const
+ {
+ BOOL booln = FALSE;
+
+ SetStatus(DllExports::GdipIsClipEmpty(nativeGraphics, &booln));
+
+ return booln;
+ }
+
+ Status GetVisibleClipBounds(OUT RectF *rect) const
+ {
+
+ return SetStatus(DllExports::GdipGetVisibleClipBounds(nativeGraphics,
+ rect));
+ }
+
+ Status GetVisibleClipBounds(OUT Rect *rect) const
+ {
+ return SetStatus(DllExports::GdipGetVisibleClipBoundsI(nativeGraphics,
+ rect));
+ }
+
+ BOOL IsVisibleClipEmpty() const
+ {
+ BOOL booln = FALSE;
+
+ SetStatus(DllExports::GdipIsVisibleClipEmpty(nativeGraphics, &booln));
+
+ return booln;
+ }
+
+ BOOL IsVisible(IN INT x,
+ IN INT y) const
+ {
+ return IsVisible(Point(x,y));
+ }
+
+ BOOL IsVisible(IN const Point& point) const
+ {
+ BOOL booln = FALSE;
+
+ SetStatus(DllExports::GdipIsVisiblePointI(nativeGraphics,
+ point.X,
+ point.Y,
+ &booln));
+
+ return booln;
+ }
+
+ BOOL IsVisible(IN INT x,
+ IN INT y,
+ IN INT width,
+ IN INT height) const
+ {
+ return IsVisible(Rect(x, y, width, height));
+ }
+
+ BOOL IsVisible(IN const Rect& rect) const
+ {
+
+ BOOL booln = TRUE;
+
+ SetStatus(DllExports::GdipIsVisibleRectI(nativeGraphics,
+ rect.X,
+ rect.Y,
+ rect.Width,
+ rect.Height,
+ &booln));
+ return booln;
+ }
+
+ BOOL IsVisible(IN REAL x,
+ IN REAL y) const
+ {
+ return IsVisible(PointF(x, y));
+ }
+
+ BOOL IsVisible(IN const PointF& point) const
+ {
+ BOOL booln = FALSE;
+
+ SetStatus(DllExports::GdipIsVisiblePoint(nativeGraphics,
+ point.X,
+ point.Y,
+ &booln));
+
+ return booln;
+ }
+
+ BOOL IsVisible(IN REAL x,
+ IN REAL y,
+ IN REAL width,
+ IN REAL height) const
+ {
+ return IsVisible(RectF(x, y, width, height));
+ }
+
+ BOOL IsVisible(IN const RectF& rect) const
+ {
+ BOOL booln = TRUE;
+
+ SetStatus(DllExports::GdipIsVisibleRect(nativeGraphics,
+ rect.X,
+ rect.Y,
+ rect.Width,
+ rect.Height,
+ &booln));
+ return booln;
+ }
+
+ /**
+ * Save/restore graphics state
+ */
+ GraphicsState Save() const
+ {
+ GraphicsState gstate;
+
+ SetStatus(DllExports::GdipSaveGraphics(nativeGraphics, &gstate));
+
+ return gstate;
+ }
+
+ Status Restore(IN GraphicsState gstate)
+ {
+ return SetStatus(DllExports::GdipRestoreGraphics(nativeGraphics,
+ gstate));
+ }
+
+ /**
+ * Begin and end container drawing
+ */
+ GraphicsContainer BeginContainer(IN const RectF &dstrect,
+ IN const RectF &srcrect,
+ IN Unit unit)
+ {
+ GraphicsContainer state;
+
+ SetStatus(DllExports::GdipBeginContainer(nativeGraphics, &dstrect,
+ &srcrect, unit, &state));
+
+ return state;
+ }
+
+ /**
+ * Begin and end container drawing
+ */
+ GraphicsContainer BeginContainer(IN const Rect &dstrect,
+ IN const Rect &srcrect,
+ IN Unit unit)
+ {
+ GraphicsContainer state;
+
+ SetStatus(DllExports::GdipBeginContainerI(nativeGraphics, &dstrect,
+ &srcrect, unit, &state));
+
+ return state;
+ }
+
+ GraphicsContainer BeginContainer()
+ {
+ GraphicsContainer state;
+
+ SetStatus(DllExports::GdipBeginContainer2(nativeGraphics, &state));
+
+ return state;
+ }
+
+ Status EndContainer(IN GraphicsContainer state)
+ {
+ return SetStatus(DllExports::GdipEndContainer(nativeGraphics, state));
+ }
+
+ // only valid when recording metafiles
+ Status AddMetafileComment(IN const BYTE * data,
+ IN UINT sizeData)
+ {
+ return SetStatus(DllExports::GdipComment(nativeGraphics, sizeData, data));
+ }
+
+ /**
+ * Get/SetLayout
+ * Support for Middle East localization (right-to-left mirroring)
+ */
+ GraphicsLayout GetLayout() const
+ {
+ GraphicsLayout layout;
+
+ SetStatus(DllExports::GdipGetGraphicsLayout(nativeGraphics, &layout));
+
+ return layout;
+ }
+
+ Status SetLayout(IN const GraphicsLayout layout)
+ {
+ return SetStatus(
+ DllExports::GdipSetGraphicsLayout(nativeGraphics, layout)
+ );
+ }
+
+ static HPALETTE GetHalftonePalette()
+ {
+ return DllExports::GdipCreateHalftonePalette();
+ }
+
+ Status GetLastStatus() const
+ {
+ Status lastStatus = lastResult;
+ lastResult = Ok;
+
+ return lastStatus;
+ }
+
+protected:
+
+#ifdef DCR_USE_NEW_250932
+
+private:
+ Graphics(const Graphics &);
+ Graphics& operator=(const Graphics &);
+protected:
+
+#else
+
+ Graphics(const Graphics& graphics)
+ {
+ graphics;
+ SetStatus(NotImplemented);
+ }
+
+ Graphics& operator=(const Graphics& graphics)
+ {
+ graphics;
+ SetStatus(NotImplemented);
+ return *this;
+ }
+
+#endif
+
+ Graphics(GpGraphics* graphics)
+ {
+ lastResult = Ok;
+ SetNativeGraphics(graphics);
+ }
+
+ VOID SetNativeGraphics(GpGraphics *graphics)
+ {
+ this->nativeGraphics = graphics;
+ }
+
+ Status SetStatus(Status status) const
+ {
+ if (status != Ok)
+ return (lastResult = status);
+ else
+ return status;
+ }
+
+ // Methods necessary to subclass Graphics for extension test.
+
+ GpGraphics* GetNativeGraphics() const
+ {
+ return this->nativeGraphics;
+ }
+
+ GpPen* GetNativePen(const Pen* pen)
+ {
+ return pen->nativePen;
+ }
+
+protected:
+ GpGraphics* nativeGraphics;
+ mutable Status lastResult;
+
+};
+
+//----------------------------------------------------------------------------
+// Extra implementation of GraphicsPath methods that use Graphics
+//----------------------------------------------------------------------------
+
+/**
+ * Get the bounds of the path object with the given transform.
+ * This is not always the tightest bounds.
+ */
+
+inline Status
+GraphicsPath::GetBounds(
+ OUT RectF* bounds,
+ IN const Matrix* matrix,
+ IN const Pen* pen) const
+{
+ GpMatrix* nativeMatrix = NULL;
+ GpPen* nativePen = NULL;
+
+ if (matrix)
+ nativeMatrix = matrix->nativeMatrix;
+
+ if (pen)
+ nativePen = pen->nativePen;
+
+ return SetStatus(DllExports::GdipGetPathWorldBounds(nativePath, bounds,
+ nativeMatrix, nativePen));
+}
+
+// integer version
+inline Status
+GraphicsPath::GetBounds(
+ OUT Rect* bounds,
+ IN const Matrix* matrix,
+ IN const Pen* pen
+) const
+{
+ GpMatrix* nativeMatrix = NULL;
+ GpPen* nativePen = NULL;
+
+ if (matrix)
+ nativeMatrix = matrix->nativeMatrix;
+
+ if (pen)
+ nativePen = pen->nativePen;
+
+ return SetStatus(DllExports::GdipGetPathWorldBoundsI(nativePath, bounds,
+ nativeMatrix, nativePen));
+}
+
+//----------------------------------------------------------------------------
+// Hit testing operations
+//----------------------------------------------------------------------------
+
+inline BOOL
+GraphicsPath::IsVisible(
+ IN REAL x,
+ IN REAL y,
+ IN const Graphics* g) const
+{
+ BOOL booln = FALSE;
+
+ GpGraphics* nativeGraphics = NULL;
+
+ if (g)
+ nativeGraphics = g->nativeGraphics;
+
+ SetStatus(DllExports::GdipIsVisiblePathPoint(nativePath,
+ x, y, nativeGraphics,
+ &booln));
+ return booln;
+}
+
+inline BOOL
+GraphicsPath::IsVisible(
+ IN INT x,
+ IN INT y,
+ IN const Graphics* g) const
+{
+ BOOL booln = FALSE;
+
+ GpGraphics* nativeGraphics = NULL;
+
+ if (g)
+ nativeGraphics = g->nativeGraphics;
+
+ SetStatus(DllExports::GdipIsVisiblePathPointI(nativePath,
+ x, y, nativeGraphics,
+ &booln));
+ return booln;
+}
+
+inline BOOL
+GraphicsPath::IsOutlineVisible(
+ IN REAL x,
+ IN REAL y,
+ IN const Pen* pen,
+ IN const Graphics* g) const
+{
+ BOOL booln = FALSE;
+
+ GpGraphics* nativeGraphics = NULL;
+ GpPen* nativePen = NULL;
+
+ if(g)
+ nativeGraphics = g->nativeGraphics;
+ if(pen)
+ nativePen = pen->nativePen;
+
+ SetStatus(DllExports::GdipIsOutlineVisiblePathPoint(nativePath,
+ x, y, nativePen, nativeGraphics,
+ &booln));
+ return booln;
+}
+
+inline BOOL
+GraphicsPath::IsOutlineVisible(
+ IN INT x,
+ IN INT y,
+ IN const Pen* pen,
+ IN const Graphics* g) const
+{
+ BOOL booln = FALSE;
+
+ GpGraphics* nativeGraphics = NULL;
+ GpPen* nativePen = NULL;
+
+ if(g)
+ nativeGraphics = g->nativeGraphics;
+ if(pen)
+ nativePen = pen->nativePen;
+
+ SetStatus(DllExports::GdipIsOutlineVisiblePathPointI(nativePath,
+ x, y, nativePen, nativeGraphics,
+ &booln));
+ return booln;
+}
+
+#endif
diff --git a/core/src/fxge/Microsoft SDK/include/GdiPlusHeaders.h b/core/src/fxge/Microsoft SDK/include/GdiPlusHeaders.h
index 215c4d09ea..9efcd89da2 100644
--- a/core/src/fxge/Microsoft SDK/include/GdiPlusHeaders.h
+++ b/core/src/fxge/Microsoft SDK/include/GdiPlusHeaders.h
@@ -1,793 +1,793 @@
-/**************************************************************************\
-*
-* Copyright (c) 1998-2000, Microsoft Corp. All Rights Reserved.
-*
-* Module Name:
-*
-* GdiplusHeaders.h
-*
-* Abstract:
-*
-* GDI+ Native C++ public header file
-*
-\**************************************************************************/
-
-#ifndef _GDIPLUSHEADERS_H
-#define _GDIPLUSHEADERS_H
-
-//--------------------------------------------------------------------------
-// Abstract base class for regions
-//--------------------------------------------------------------------------
-
-// Include the class declarations here and have inline class implementation
-// in separate file to avoid circular references.
-
-class Region : public GdiplusBase
-{
-public:
- friend class Graphics;
-
- Region();
- Region(IN const RectF& rect);
- Region(IN const Rect& rect);
- Region(IN const GraphicsPath* path);
- Region(IN const BYTE* regionData, IN INT size);
- Region(IN HRGN hRgn);
- static Region* FromHRGN(IN HRGN hRgn);
-
- ~Region();
- Region* Clone() const;
-
- Status MakeInfinite();
- Status MakeEmpty();
-
- // Get the size of the buffer needed for the GetData method
- UINT GetDataSize() const;
-
- // buffer - where to put the data
- // bufferSize - how big the buffer is (should be at least as big as GetDataSize())
- // sizeFilled - if not NULL, this is an OUT param that says how many bytes
- // of data were written to the buffer.
- Status GetData(OUT BYTE* buffer,
- IN UINT bufferSize,
- OUT UINT* sizeFilled = NULL) const;
-
- Status Intersect(IN const Rect& rect);
- Status Intersect(IN const RectF& rect);
- Status Intersect(IN const GraphicsPath* path);
- Status Intersect(IN const Region* region);
- Status Union(IN const Rect& rect);
- Status Union(IN const RectF& rect);
- Status Union(IN const GraphicsPath* path);
- Status Union(IN const Region* region);
- Status Xor(IN const Rect& rect);
- Status Xor(IN const RectF& rect);
- Status Xor(IN const GraphicsPath* path);
- Status Xor(IN const Region* region);
- Status Exclude(IN const Rect& rect);
- Status Exclude(IN const RectF& rect);
- Status Exclude(IN const GraphicsPath* path);
- Status Exclude(IN const Region* region);
- Status Complement(IN const Rect& rect);
- Status Complement(IN const RectF& rect);
- Status Complement(IN const GraphicsPath* path);
- Status Complement(IN const Region* region);
- Status Translate(IN REAL dx,
- IN REAL dy);
- Status Translate(IN INT dx,
- IN INT dy);
- Status Transform(IN const Matrix* matrix);
-
- Status GetBounds(OUT Rect* rect,
- IN const Graphics* g) const;
-
- Status GetBounds(OUT RectF* rect,
- IN const Graphics* g) const;
-
- HRGN GetHRGN (IN const Graphics * g) const;
-
- BOOL IsEmpty(IN const Graphics *g) const;
- BOOL IsInfinite(IN const Graphics *g) const;
-
- BOOL IsVisible(IN INT x,
- IN INT y,
- IN const Graphics* g = NULL) const
- {
- return IsVisible(Point(x, y), g);
- }
-
- BOOL IsVisible(IN const Point& point,
- IN const Graphics* g = NULL) const;
-
- BOOL IsVisible(IN REAL x,
- IN REAL y,
- IN const Graphics* g = NULL) const
- {
- return IsVisible(PointF(x, y), g);
- }
-
- BOOL IsVisible(IN const PointF& point,
- IN const Graphics* g = NULL) const;
-
- BOOL IsVisible(IN INT x,
- IN INT y,
- IN INT width,
- IN INT height,
- IN const Graphics* g) const
- {
- return IsVisible(Rect(x, y, width, height), g);
- }
-
- BOOL IsVisible(IN const Rect& rect,
- IN const Graphics* g = NULL) const;
-
- BOOL IsVisible(IN REAL x,
- IN REAL y,
- IN REAL width,
- IN REAL height,
- IN const Graphics* g = NULL) const
- {
- return IsVisible(RectF(x, y, width, height), g);
- }
-
- BOOL IsVisible(IN const RectF& rect,
- IN const Graphics* g = NULL) const;
-
- BOOL Equals(IN const Region* region,
- IN const Graphics* g) const;
-
- UINT GetRegionScansCount(IN const Matrix* matrix) const;
- Status GetRegionScans(IN const Matrix* matrix,
- OUT RectF* rects,
- OUT INT* count) const;
- Status GetRegionScans(IN const Matrix* matrix,
- OUT Rect* rects,
- OUT INT* count) const;
- Status GetLastStatus() const;
-
-protected:
-
-#ifdef DCR_USE_NEW_250932
-
-private:
- Region(const Region &region);
- Region& operator=(const Region &region);
-protected:
-
-#else
- Region(const Region &region)
- {
- region; // reference parameter
- SetStatus(NotImplemented);
- }
-
- Region& operator=(const Region &region)
- {
- region; // reference parameter
- SetStatus(NotImplemented);
- return *this;
- }
-#endif
-
- Status SetStatus(Status status) const
- {
- if (status != Ok)
- return (lastResult = status);
- else
- return status;
- }
-
- Region(GpRegion* nativeRegion);
-
- VOID SetNativeRegion(GpRegion* nativeRegion);
-
-protected:
- GpRegion* nativeRegion;
- mutable Status lastResult;
-};
-
-
-//--------------------------------------------------------------------------
-// Abstract base class for FontFamily
-//--------------------------------------------------------------------------
-
-class FontFamily : public GdiplusBase
-{
-public:
- friend class Font;
- friend class Graphics;
- friend class GraphicsPath;
- friend class FontCollection;
-
- FontFamily();
-
- FontFamily(
- IN const WCHAR *name,
- IN const FontCollection *fontCollection = NULL
- );
-
- ~FontFamily();
-
- static const FontFamily *GenericSansSerif();
- static const FontFamily *GenericSerif();
- static const FontFamily *GenericMonospace();
-
- Status GetFamilyName(
- OUT WCHAR name[LF_FACESIZE],
- IN LANGID language = 0
- ) const;
-
-// Copy operator
- FontFamily * Clone() const;
-
- BOOL IsAvailable() const
- {
- return (nativeFamily != NULL);
- };
-
- BOOL IsStyleAvailable(IN INT style) const;
-
- UINT16 GetEmHeight (IN INT style) const;
- UINT16 GetCellAscent (IN INT style) const;
- UINT16 GetCellDescent (IN INT style) const;
- UINT16 GetLineSpacing (IN INT style) const;
-
- ///////////////////////////////////////////////////////////
-
- Status GetLastStatus() const;
-
-#ifdef DCR_USE_NEW_250932
-
-private:
- FontFamily(const FontFamily &);
- FontFamily& operator=(const FontFamily &);
-
-#endif
-
-protected:
- Status SetStatus(Status status) const;
-
- // private constructor for copy
- FontFamily(GpFontFamily * nativeFamily, Status status);
-
-///////////////////////////////////////
-// Data members
-protected:
-
- GpFontFamily *nativeFamily;
- mutable Status lastResult;
-};
-
-static FontFamily *GenericSansSerifFontFamily = NULL;
-static FontFamily *GenericSerifFontFamily = NULL;
-static FontFamily *GenericMonospaceFontFamily = NULL;
-
-static BYTE GenericSansSerifFontFamilyBuffer[sizeof(FontFamily)] = {0};
-static BYTE GenericSerifFontFamilyBuffer [sizeof(FontFamily)] = {0};
-static BYTE GenericMonospaceFontFamilyBuffer[sizeof(FontFamily)] = {0};
-
-
-//--------------------------------------------------------------------------
-// Abstract base class for fonts
-//--------------------------------------------------------------------------
-
-class Font : public GdiplusBase
-{
-public:
- friend class Graphics;
-
- Font(IN HDC hdc);
- Font(IN HDC hdc,
- IN const LOGFONTA* logfont);
- Font(IN HDC hdc,
- IN const LOGFONTW* logfont);
-#ifdef DCR_USE_NEW_127084
- Font(IN HDC hdc,
- IN const HFONT hfont);
-#endif
- Font(
- IN const FontFamily * family,
- IN REAL emSize,
- IN INT style = FontStyleRegular,
- IN Unit unit = UnitPoint
- );
-
- Font(
- IN const WCHAR * familyName,
- IN REAL emSize,
- IN INT style = FontStyleRegular,
- IN Unit unit = UnitPoint,
- IN const FontCollection * fontCollection = NULL
- );
-
- Status GetLogFontA(IN const Graphics* g,
- OUT LOGFONTA * logfontA) const;
- Status GetLogFontW(IN const Graphics* g,
- OUT LOGFONTW * logfontW) const;
-
- Font* Clone() const;
- ~Font();
- BOOL IsAvailable() const;
- INT GetStyle() const;
- REAL GetSize() const;
- Unit GetUnit() const;
- Status GetLastStatus() const;
- REAL GetHeight(IN const Graphics *graphics = NULL) const;
-#ifdef DCR_USE_NEW_125467
- REAL GetHeight(IN REAL dpi) const;
-#endif
-
- Status GetFamily(OUT FontFamily *family) const;
-
-#ifdef DCR_USE_NEW_250932
-
-private:
- Font(const Font &);
- Font& operator=(const Font &);
-
-#endif
-
-protected:
- Font(GpFont* font, Status status);
- VOID SetNativeFont(GpFont *Font);
- Status SetStatus(Status status) const;
-
-protected:
- /*
- * handle to native line texture object
- */
-
- GpFont* nativeFont;
- mutable Status lastResult;
-};
-
-//--------------------------------------------------------------------------
-// Abstract base classes for font collections
-//--------------------------------------------------------------------------
-
-class FontCollection : public GdiplusBase
-{
-public:
- friend class FontFamily;
-
- FontCollection();
- virtual ~FontCollection();
-
- INT GetFamilyCount() const; // number of enumerable families in the collection
-
- Status GetFamilies( // enumerate the fonts in a collection
- IN INT numSought,
- OUT FontFamily * gpfamilies,
- OUT INT * numFound
- ) const;
-
- Status GetLastStatus() const;
-
-#ifdef DCR_USE_NEW_250932
-
-private:
- FontCollection(const FontCollection &);
- FontCollection& operator=(const FontCollection &);
-
-#endif
-
-protected:
- Status SetStatus(Status status) const ;
-
- GpFontCollection *nativeFontCollection;
- mutable Status lastResult;
-};
-
-
-class InstalledFontCollection : public FontCollection
-{
-public:
- InstalledFontCollection();
- ~InstalledFontCollection();
-
-#ifdef DCR_USE_NEW_250932
-
-private:
- InstalledFontCollection(const InstalledFontCollection &);
- InstalledFontCollection& operator=(const InstalledFontCollection &);
-
-#endif
-
-protected:
-#ifndef DCR_USE_NEW_235072
- Status InstallFontFile(IN const WCHAR* filename);
- Status UninstallFontFile(IN const WCHAR* filename);
-#endif
- Status SetStatus(Status status) const ;
-};
-
-
-class PrivateFontCollection : public FontCollection
-{
-public:
- PrivateFontCollection();
- ~PrivateFontCollection();
-
- Status AddFontFile(IN const WCHAR* filename);
- Status AddMemoryFont(IN const VOID* memory,
- IN INT length);
-
-#ifdef DCR_USE_NEW_250932
-
-private:
- PrivateFontCollection(const PrivateFontCollection &);
- PrivateFontCollection& operator=(const PrivateFontCollection &);
-
-#endif
-};
-
-
-//--------------------------------------------------------------------------
-// Abstract base class for bitmap image and metafile
-//--------------------------------------------------------------------------
-
-// !!! Note:
-// Include the class declarations here and have the inline class
-// implementation in a separate file. This is done to resolve a
-// circular dependency since one of the Bitmap methods needs to
-// access the private member nativeGraphics of the Graphics object.
-
-class Image : public GdiplusBase
-{
-public:
- friend class Brush;
- friend class TextureBrush;
- friend class Graphics;
-
-#ifndef DCR_USE_NEW_140782
- Image(
- IN const WCHAR* filename
- );
-
- Image(
- IN IStream* stream
- );
-
- static Image* FromFile(
- IN const WCHAR* filename
- );
-
- static Image* FromStream(
- IN IStream* stream
- );
-#else
- Image(
- IN const WCHAR* filename,
- IN BOOL useEmbeddedColorManagement = FALSE
- );
-
- Image(
- IN IStream* stream,
- IN BOOL useEmbeddedColorManagement = FALSE
- );
-
- static Image* FromFile(
- IN const WCHAR* filename,
- IN BOOL useEmbeddedColorManagement = FALSE
- );
-
- static Image* FromStream(
- IN IStream* stream,
- IN BOOL useEmbeddedColorManagement = FALSE
- );
-#endif
-
- virtual ~Image();
- virtual Image* Clone();
-
- Status Save(IN const WCHAR* filename,
- IN const CLSID* clsidEncoder,
- IN const EncoderParameters *encoderParams = NULL);
- Status Save(IN IStream* stream,
- IN const CLSID* clsidEncoder,
- IN const EncoderParameters *encoderParams = NULL);
- Status SaveAdd(IN const EncoderParameters* encoderParams);
- Status SaveAdd(IN Image* newImage,
- IN const EncoderParameters* encoderParams);
-
- ImageType GetType() const;
- Status GetPhysicalDimension(OUT SizeF* size);
- Status GetBounds(OUT RectF* srcRect,
- OUT Unit* srcUnit);
-
- UINT GetWidth();
- UINT GetHeight();
- REAL GetHorizontalResolution();
- REAL GetVerticalResolution();
- UINT GetFlags();
- Status GetRawFormat(OUT GUID *format);
- PixelFormat GetPixelFormat();
-
- INT GetPaletteSize();
- Status GetPalette(OUT ColorPalette* palette,
- IN INT size);
- Status SetPalette(IN const ColorPalette* palette);
-
- Image* GetThumbnailImage(IN UINT thumbWidth,
- IN UINT thumbHeight,
- IN GetThumbnailImageAbort callback = NULL,
- IN VOID* callbackData = NULL);
- UINT GetFrameDimensionsCount();
- Status GetFrameDimensionsList(OUT GUID* dimensionIDs,
- IN UINT count);
- UINT GetFrameCount(IN const GUID* dimensionID);
- Status SelectActiveFrame(IN const GUID* dimensionID,
- IN UINT frameIndex);
- Status RotateFlip(IN RotateFlipType rotateFlipType);
- UINT GetPropertyCount();
- Status GetPropertyIdList(IN UINT numOfProperty,
- OUT PROPID* list);
- UINT GetPropertyItemSize(IN PROPID propId);
- Status GetPropertyItem(IN PROPID propId,
- IN UINT propSize,
- OUT PropertyItem* buffer);
- Status GetPropertySize(OUT UINT* totalBufferSize,
- OUT UINT* numProperties);
- Status GetAllPropertyItems(IN UINT totalBufferSize,
- IN UINT numProperties,
- OUT PropertyItem* allItems);
- Status RemovePropertyItem(IN PROPID propId);
- Status SetPropertyItem(IN const PropertyItem* item);
-
- UINT GetEncoderParameterListSize(IN const CLSID* clsidEncoder);
- Status GetEncoderParameterList(IN const CLSID* clsidEncoder,
- IN UINT size,
- OUT EncoderParameters* buffer);
-
- // Support for Middle East localization (right-to-left mirroring)
- ImageLayout GetLayout() const;
- Status SetLayout(IN const ImageLayout layout);
-
- Status GetLastStatus() const;
-
-protected:
-
- Image() {}
-
- Image(GpImage *nativeImage, Status status);
-
- VOID SetNativeImage(GpImage* nativeImage);
-
- Status SetStatus(Status status) const
- {
- if (status != Ok)
- return (lastResult = status);
- else
- return status;
- }
-
- GpImage* nativeImage;
- mutable Status lastResult;
- mutable Status loadStatus;
-
-#ifdef DCR_USE_NEW_250932
-
-private:
-
-#else
-
-protected:
-
-#endif
-
- // Disable copy constructor and assignment operator
-
- Image(IN const Image& C);
- Image& operator=(IN const Image& C);
-};
-
-class Bitmap : public Image
-{
-public:
- friend class Image;
- friend class CachedBitmap;
-
- Bitmap(
- IN const WCHAR *filename,
- IN BOOL useEmbeddedColorManagement = FALSE
- );
-
- Bitmap(
- IN IStream *stream,
- IN BOOL useEmbeddedColorManagement = FALSE
- );
-
- static Bitmap* FromFile(
- IN const WCHAR *filename,
- IN BOOL useEmbeddedColorManagement = FALSE
- );
-
- static Bitmap* FromStream(
- IN IStream *stream,
- IN BOOL useEmbeddedColorManagement = FALSE
- );
-
- Bitmap(IN INT width,
- IN INT height,
- IN INT stride, PixelFormat format,
- IN BYTE* scan0);
- Bitmap(IN INT width,
- IN INT height,
- IN PixelFormat format = PixelFormat32bppARGB);
- Bitmap(IN INT width,
- IN INT height,
- IN Graphics* target);
-
- Bitmap* Clone(IN const Rect& rect,
- IN PixelFormat format);
- Bitmap* Clone(IN INT x,
- IN INT y,
- IN INT width,
- IN INT height,
- IN PixelFormat format);
- Bitmap* Clone(IN const RectF& rect,
- IN PixelFormat format);
- Bitmap* Clone(IN REAL x,
- IN REAL y,
- IN REAL width,
- IN REAL height,
- IN PixelFormat format);
-
- Status LockBits(IN const Rect& rect,
- IN UINT flags,
- IN PixelFormat format,
- OUT BitmapData* lockedBitmapData);
- Status UnlockBits(IN BitmapData* lockedBitmapData);
- Status GetPixel(IN INT x,
- IN INT y,
- OUT Color *color);
- Status SetPixel(IN INT x,
- IN INT y,
- IN const Color &color);
- Status SetResolution(IN REAL xdpi,
- IN REAL ydpi);
-
- // GDI interop:
-
- Bitmap(IN IDirectDrawSurface7* surface);
- Bitmap(IN const BITMAPINFO* gdiBitmapInfo,
- IN VOID* gdiBitmapData);
- Bitmap(IN HBITMAP hbm,
- IN HPALETTE hpal);
- Bitmap(IN HICON hicon);
- Bitmap(IN HINSTANCE hInstance,
- IN const WCHAR * bitmapName);
- static Bitmap* FromDirectDrawSurface7(IN IDirectDrawSurface7* surface);
- static Bitmap* FromBITMAPINFO(IN const BITMAPINFO* gdiBitmapInfo,
- IN VOID* gdiBitmapData);
- static Bitmap* FromHBITMAP(IN HBITMAP hbm,
- IN HPALETTE hpal);
- static Bitmap* FromHICON(IN HICON hicon);
- static Bitmap* FromResource(IN HINSTANCE hInstance,
- IN const WCHAR * bitmapName);
-
- Status GetHBITMAP(IN const Color& colorBackground,
- OUT HBITMAP *hbmReturn);
- Status GetHICON(HICON *hicon);
-
-#ifdef DCR_USE_NEW_250932
-private:
- Bitmap(const Bitmap &);
- Bitmap& operator=(const Bitmap &);
-#endif
-
-protected:
- Bitmap(GpBitmap *nativeBitmap);
-};
-
-class CustomLineCap : public GdiplusBase
-{
-public:
- friend class Pen;
-
- CustomLineCap(
- IN const GraphicsPath* fillPath,
- IN const GraphicsPath* strokePath,
- IN LineCap baseCap = LineCapFlat,
- IN REAL baseInset = 0
- );
- virtual ~CustomLineCap();
-
- CustomLineCap* Clone() const;
-
- Status SetStrokeCap(IN LineCap strokeCap)
- {
- // This changes both start and and caps.
-
- return SetStrokeCaps(strokeCap, strokeCap);
- }
-
- Status SetStrokeCaps(IN LineCap startCap,
- IN LineCap endCap);
- Status GetStrokeCaps(OUT LineCap* startCap,
- OUT LineCap* endCap) const;
- Status SetStrokeJoin(IN LineJoin lineJoin);
- LineJoin GetStrokeJoin() const;
- Status SetBaseCap(IN LineCap baseCap);
- LineCap GetBaseCap() const;
- Status SetBaseInset(IN REAL inset);
- REAL GetBaseInset() const;
- Status SetWidthScale(IN REAL widthScale);
- REAL GetWidthScale() const;
-
-protected:
- CustomLineCap();
-
-#ifdef DCR_USE_NEW_250932
-
-private:
- CustomLineCap(const CustomLineCap &);
- CustomLineCap& operator=(const CustomLineCap &);
-protected:
-
-#else
-
- CustomLineCap(const CustomLineCap& customLineCap)
- {
- customLineCap;
- SetStatus(NotImplemented);
- }
-
- CustomLineCap& operator=(const CustomLineCap& customLineCap)
- {
- customLineCap;
- SetStatus(NotImplemented);
- return *this;
- }
-
-#endif
-
- CustomLineCap(GpCustomLineCap* nativeCap, Status status)
- {
- lastResult = status;
- SetNativeCap(nativeCap);
- }
-
- VOID SetNativeCap(GpCustomLineCap* nativeCap)
- {
- this->nativeCap = nativeCap;
- }
-
- Status SetStatus(Status status) const
- {
- if (status != Ok)
- return (lastResult = status);
- else
- return status;
- }
-
-protected:
- GpCustomLineCap* nativeCap;
- mutable Status lastResult;
-};
-
-class CachedBitmap : public GdiplusBase
-{
- friend Graphics;
-
-public:
- CachedBitmap(IN Bitmap *bitmap,
- IN Graphics *graphics);
- virtual ~CachedBitmap();
-
- Status GetLastStatus() const;
-
-#ifdef DCR_USE_NEW_250932
-
-private:
- CachedBitmap(const CachedBitmap &);
- CachedBitmap& operator=(const CachedBitmap &);
-
-#endif
-
-protected:
- GpCachedBitmap *nativeCachedBitmap;
- mutable Status lastResult;
-};
-
-#endif // !_GDIPLUSHEADERS.HPP
+/**************************************************************************\
+*
+* Copyright (c) 1998-2000, Microsoft Corp. All Rights Reserved.
+*
+* Module Name:
+*
+* GdiplusHeaders.h
+*
+* Abstract:
+*
+* GDI+ Native C++ public header file
+*
+\**************************************************************************/
+
+#ifndef _GDIPLUSHEADERS_H
+#define _GDIPLUSHEADERS_H
+
+//--------------------------------------------------------------------------
+// Abstract base class for regions
+//--------------------------------------------------------------------------
+
+// Include the class declarations here and have inline class implementation
+// in separate file to avoid circular references.
+
+class Region : public GdiplusBase
+{
+public:
+ friend class Graphics;
+
+ Region();
+ Region(IN const RectF& rect);
+ Region(IN const Rect& rect);
+ Region(IN const GraphicsPath* path);
+ Region(IN const BYTE* regionData, IN INT size);
+ Region(IN HRGN hRgn);
+ static Region* FromHRGN(IN HRGN hRgn);
+
+ ~Region();
+ Region* Clone() const;
+
+ Status MakeInfinite();
+ Status MakeEmpty();
+
+ // Get the size of the buffer needed for the GetData method
+ UINT GetDataSize() const;
+
+ // buffer - where to put the data
+ // bufferSize - how big the buffer is (should be at least as big as GetDataSize())
+ // sizeFilled - if not NULL, this is an OUT param that says how many bytes
+ // of data were written to the buffer.
+ Status GetData(OUT BYTE* buffer,
+ IN UINT bufferSize,
+ OUT UINT* sizeFilled = NULL) const;
+
+ Status Intersect(IN const Rect& rect);
+ Status Intersect(IN const RectF& rect);
+ Status Intersect(IN const GraphicsPath* path);
+ Status Intersect(IN const Region* region);
+ Status Union(IN const Rect& rect);
+ Status Union(IN const RectF& rect);
+ Status Union(IN const GraphicsPath* path);
+ Status Union(IN const Region* region);
+ Status Xor(IN const Rect& rect);
+ Status Xor(IN const RectF& rect);
+ Status Xor(IN const GraphicsPath* path);
+ Status Xor(IN const Region* region);
+ Status Exclude(IN const Rect& rect);
+ Status Exclude(IN const RectF& rect);
+ Status Exclude(IN const GraphicsPath* path);
+ Status Exclude(IN const Region* region);
+ Status Complement(IN const Rect& rect);
+ Status Complement(IN const RectF& rect);
+ Status Complement(IN const GraphicsPath* path);
+ Status Complement(IN const Region* region);
+ Status Translate(IN REAL dx,
+ IN REAL dy);
+ Status Translate(IN INT dx,
+ IN INT dy);
+ Status Transform(IN const Matrix* matrix);
+
+ Status GetBounds(OUT Rect* rect,
+ IN const Graphics* g) const;
+
+ Status GetBounds(OUT RectF* rect,
+ IN const Graphics* g) const;
+
+ HRGN GetHRGN (IN const Graphics * g) const;
+
+ BOOL IsEmpty(IN const Graphics *g) const;
+ BOOL IsInfinite(IN const Graphics *g) const;
+
+ BOOL IsVisible(IN INT x,
+ IN INT y,
+ IN const Graphics* g = NULL) const
+ {
+ return IsVisible(Point(x, y), g);
+ }
+
+ BOOL IsVisible(IN const Point& point,
+ IN const Graphics* g = NULL) const;
+
+ BOOL IsVisible(IN REAL x,
+ IN REAL y,
+ IN const Graphics* g = NULL) const
+ {
+ return IsVisible(PointF(x, y), g);
+ }
+
+ BOOL IsVisible(IN const PointF& point,
+ IN const Graphics* g = NULL) const;
+
+ BOOL IsVisible(IN INT x,
+ IN INT y,
+ IN INT width,
+ IN INT height,
+ IN const Graphics* g) const
+ {
+ return IsVisible(Rect(x, y, width, height), g);
+ }
+
+ BOOL IsVisible(IN const Rect& rect,
+ IN const Graphics* g = NULL) const;
+
+ BOOL IsVisible(IN REAL x,
+ IN REAL y,
+ IN REAL width,
+ IN REAL height,
+ IN const Graphics* g = NULL) const
+ {
+ return IsVisible(RectF(x, y, width, height), g);
+ }
+
+ BOOL IsVisible(IN const RectF& rect,
+ IN const Graphics* g = NULL) const;
+
+ BOOL Equals(IN const Region* region,
+ IN const Graphics* g) const;
+
+ UINT GetRegionScansCount(IN const Matrix* matrix) const;
+ Status GetRegionScans(IN const Matrix* matrix,
+ OUT RectF* rects,
+ OUT INT* count) const;
+ Status GetRegionScans(IN const Matrix* matrix,
+ OUT Rect* rects,
+ OUT INT* count) const;
+ Status GetLastStatus() const;
+
+protected:
+
+#ifdef DCR_USE_NEW_250932
+
+private:
+ Region(const Region &region);
+ Region& operator=(const Region &region);
+protected:
+
+#else
+ Region(const Region &region)
+ {
+ region; // reference parameter
+ SetStatus(NotImplemented);
+ }
+
+ Region& operator=(const Region &region)
+ {
+ region; // reference parameter
+ SetStatus(NotImplemented);
+ return *this;
+ }
+#endif
+
+ Status SetStatus(Status status) const
+ {
+ if (status != Ok)
+ return (lastResult = status);
+ else
+ return status;
+ }
+
+ Region(GpRegion* nativeRegion);
+
+ VOID SetNativeRegion(GpRegion* nativeRegion);
+
+protected:
+ GpRegion* nativeRegion;
+ mutable Status lastResult;
+};
+
+
+//--------------------------------------------------------------------------
+// Abstract base class for FontFamily
+//--------------------------------------------------------------------------
+
+class FontFamily : public GdiplusBase
+{
+public:
+ friend class Font;
+ friend class Graphics;
+ friend class GraphicsPath;
+ friend class FontCollection;
+
+ FontFamily();
+
+ FontFamily(
+ IN const WCHAR *name,
+ IN const FontCollection *fontCollection = NULL
+ );
+
+ ~FontFamily();
+
+ static const FontFamily *GenericSansSerif();
+ static const FontFamily *GenericSerif();
+ static const FontFamily *GenericMonospace();
+
+ Status GetFamilyName(
+ OUT WCHAR name[LF_FACESIZE],
+ IN LANGID language = 0
+ ) const;
+
+// Copy operator
+ FontFamily * Clone() const;
+
+ BOOL IsAvailable() const
+ {
+ return (nativeFamily != NULL);
+ };
+
+ BOOL IsStyleAvailable(IN INT style) const;
+
+ UINT16 GetEmHeight (IN INT style) const;
+ UINT16 GetCellAscent (IN INT style) const;
+ UINT16 GetCellDescent (IN INT style) const;
+ UINT16 GetLineSpacing (IN INT style) const;
+
+ ///////////////////////////////////////////////////////////
+
+ Status GetLastStatus() const;
+
+#ifdef DCR_USE_NEW_250932
+
+private:
+ FontFamily(const FontFamily &);
+ FontFamily& operator=(const FontFamily &);
+
+#endif
+
+protected:
+ Status SetStatus(Status status) const;
+
+ // private constructor for copy
+ FontFamily(GpFontFamily * nativeFamily, Status status);
+
+///////////////////////////////////////
+// Data members
+protected:
+
+ GpFontFamily *nativeFamily;
+ mutable Status lastResult;
+};
+
+static FontFamily *GenericSansSerifFontFamily = NULL;
+static FontFamily *GenericSerifFontFamily = NULL;
+static FontFamily *GenericMonospaceFontFamily = NULL;
+
+static BYTE GenericSansSerifFontFamilyBuffer[sizeof(FontFamily)] = {0};
+static BYTE GenericSerifFontFamilyBuffer [sizeof(FontFamily)] = {0};
+static BYTE GenericMonospaceFontFamilyBuffer[sizeof(FontFamily)] = {0};
+
+
+//--------------------------------------------------------------------------
+// Abstract base class for fonts
+//--------------------------------------------------------------------------
+
+class Font : public GdiplusBase
+{
+public:
+ friend class Graphics;
+
+ Font(IN HDC hdc);
+ Font(IN HDC hdc,
+ IN const LOGFONTA* logfont);
+ Font(IN HDC hdc,
+ IN const LOGFONTW* logfont);
+#ifdef DCR_USE_NEW_127084
+ Font(IN HDC hdc,
+ IN const HFONT hfont);
+#endif
+ Font(
+ IN const FontFamily * family,
+ IN REAL emSize,
+ IN INT style = FontStyleRegular,
+ IN Unit unit = UnitPoint
+ );
+
+ Font(
+ IN const WCHAR * familyName,
+ IN REAL emSize,
+ IN INT style = FontStyleRegular,
+ IN Unit unit = UnitPoint,
+ IN const FontCollection * fontCollection = NULL
+ );
+
+ Status GetLogFontA(IN const Graphics* g,
+ OUT LOGFONTA * logfontA) const;
+ Status GetLogFontW(IN const Graphics* g,
+ OUT LOGFONTW * logfontW) const;
+
+ Font* Clone() const;
+ ~Font();
+ BOOL IsAvailable() const;
+ INT GetStyle() const;
+ REAL GetSize() const;
+ Unit GetUnit() const;
+ Status GetLastStatus() const;
+ REAL GetHeight(IN const Graphics *graphics = NULL) const;
+#ifdef DCR_USE_NEW_125467
+ REAL GetHeight(IN REAL dpi) const;
+#endif
+
+ Status GetFamily(OUT FontFamily *family) const;
+
+#ifdef DCR_USE_NEW_250932
+
+private:
+ Font(const Font &);
+ Font& operator=(const Font &);
+
+#endif
+
+protected:
+ Font(GpFont* font, Status status);
+ VOID SetNativeFont(GpFont *Font);
+ Status SetStatus(Status status) const;
+
+protected:
+ /*
+ * handle to native line texture object
+ */
+
+ GpFont* nativeFont;
+ mutable Status lastResult;
+};
+
+//--------------------------------------------------------------------------
+// Abstract base classes for font collections
+//--------------------------------------------------------------------------
+
+class FontCollection : public GdiplusBase
+{
+public:
+ friend class FontFamily;
+
+ FontCollection();
+ virtual ~FontCollection();
+
+ INT GetFamilyCount() const; // number of enumerable families in the collection
+
+ Status GetFamilies( // enumerate the fonts in a collection
+ IN INT numSought,
+ OUT FontFamily * gpfamilies,
+ OUT INT * numFound
+ ) const;
+
+ Status GetLastStatus() const;
+
+#ifdef DCR_USE_NEW_250932
+
+private:
+ FontCollection(const FontCollection &);
+ FontCollection& operator=(const FontCollection &);
+
+#endif
+
+protected:
+ Status SetStatus(Status status) const ;
+
+ GpFontCollection *nativeFontCollection;
+ mutable Status lastResult;
+};
+
+
+class InstalledFontCollection : public FontCollection
+{
+public:
+ InstalledFontCollection();
+ ~InstalledFontCollection();
+
+#ifdef DCR_USE_NEW_250932
+
+private:
+ InstalledFontCollection(const InstalledFontCollection &);
+ InstalledFontCollection& operator=(const InstalledFontCollection &);
+
+#endif
+
+protected:
+#ifndef DCR_USE_NEW_235072
+ Status InstallFontFile(IN const WCHAR* filename);
+ Status UninstallFontFile(IN const WCHAR* filename);
+#endif
+ Status SetStatus(Status status) const ;
+};
+
+
+class PrivateFontCollection : public FontCollection
+{
+public:
+ PrivateFontCollection();
+ ~PrivateFontCollection();
+
+ Status AddFontFile(IN const WCHAR* filename);
+ Status AddMemoryFont(IN const VOID* memory,
+ IN INT length);
+
+#ifdef DCR_USE_NEW_250932
+
+private:
+ PrivateFontCollection(const PrivateFontCollection &);
+ PrivateFontCollection& operator=(const PrivateFontCollection &);
+
+#endif
+};
+
+
+//--------------------------------------------------------------------------
+// Abstract base class for bitmap image and metafile
+//--------------------------------------------------------------------------
+
+// !!! Note:
+// Include the class declarations here and have the inline class
+// implementation in a separate file. This is done to resolve a
+// circular dependency since one of the Bitmap methods needs to
+// access the private member nativeGraphics of the Graphics object.
+
+class Image : public GdiplusBase
+{
+public:
+ friend class Brush;
+ friend class TextureBrush;
+ friend class Graphics;
+
+#ifndef DCR_USE_NEW_140782
+ Image(
+ IN const WCHAR* filename
+ );
+
+ Image(
+ IN IStream* stream
+ );
+
+ static Image* FromFile(
+ IN const WCHAR* filename
+ );
+
+ static Image* FromStream(
+ IN IStream* stream
+ );
+#else
+ Image(
+ IN const WCHAR* filename,
+ IN BOOL useEmbeddedColorManagement = FALSE
+ );
+
+ Image(
+ IN IStream* stream,
+ IN BOOL useEmbeddedColorManagement = FALSE
+ );
+
+ static Image* FromFile(
+ IN const WCHAR* filename,
+ IN BOOL useEmbeddedColorManagement = FALSE
+ );
+
+ static Image* FromStream(
+ IN IStream* stream,
+ IN BOOL useEmbeddedColorManagement = FALSE
+ );
+#endif
+
+ virtual ~Image();
+ virtual Image* Clone();
+
+ Status Save(IN const WCHAR* filename,
+ IN const CLSID* clsidEncoder,
+ IN const EncoderParameters *encoderParams = NULL);
+ Status Save(IN IStream* stream,
+ IN const CLSID* clsidEncoder,
+ IN const EncoderParameters *encoderParams = NULL);
+ Status SaveAdd(IN const EncoderParameters* encoderParams);
+ Status SaveAdd(IN Image* newImage,
+ IN const EncoderParameters* encoderParams);
+
+ ImageType GetType() const;
+ Status GetPhysicalDimension(OUT SizeF* size);
+ Status GetBounds(OUT RectF* srcRect,
+ OUT Unit* srcUnit);
+
+ UINT GetWidth();
+ UINT GetHeight();
+ REAL GetHorizontalResolution();
+ REAL GetVerticalResolution();
+ UINT GetFlags();
+ Status GetRawFormat(OUT GUID *format);
+ PixelFormat GetPixelFormat();
+
+ INT GetPaletteSize();
+ Status GetPalette(OUT ColorPalette* palette,
+ IN INT size);
+ Status SetPalette(IN const ColorPalette* palette);
+
+ Image* GetThumbnailImage(IN UINT thumbWidth,
+ IN UINT thumbHeight,
+ IN GetThumbnailImageAbort callback = NULL,
+ IN VOID* callbackData = NULL);
+ UINT GetFrameDimensionsCount();
+ Status GetFrameDimensionsList(OUT GUID* dimensionIDs,
+ IN UINT count);
+ UINT GetFrameCount(IN const GUID* dimensionID);
+ Status SelectActiveFrame(IN const GUID* dimensionID,
+ IN UINT frameIndex);
+ Status RotateFlip(IN RotateFlipType rotateFlipType);
+ UINT GetPropertyCount();
+ Status GetPropertyIdList(IN UINT numOfProperty,
+ OUT PROPID* list);
+ UINT GetPropertyItemSize(IN PROPID propId);
+ Status GetPropertyItem(IN PROPID propId,
+ IN UINT propSize,
+ OUT PropertyItem* buffer);
+ Status GetPropertySize(OUT UINT* totalBufferSize,
+ OUT UINT* numProperties);
+ Status GetAllPropertyItems(IN UINT totalBufferSize,
+ IN UINT numProperties,
+ OUT PropertyItem* allItems);
+ Status RemovePropertyItem(IN PROPID propId);
+ Status SetPropertyItem(IN const PropertyItem* item);
+
+ UINT GetEncoderParameterListSize(IN const CLSID* clsidEncoder);
+ Status GetEncoderParameterList(IN const CLSID* clsidEncoder,
+ IN UINT size,
+ OUT EncoderParameters* buffer);
+
+ // Support for Middle East localization (right-to-left mirroring)
+ ImageLayout GetLayout() const;
+ Status SetLayout(IN const ImageLayout layout);
+
+ Status GetLastStatus() const;
+
+protected:
+
+ Image() {}
+
+ Image(GpImage *nativeImage, Status status);
+
+ VOID SetNativeImage(GpImage* nativeImage);
+
+ Status SetStatus(Status status) const
+ {
+ if (status != Ok)
+ return (lastResult = status);
+ else
+ return status;
+ }
+
+ GpImage* nativeImage;
+ mutable Status lastResult;
+ mutable Status loadStatus;
+
+#ifdef DCR_USE_NEW_250932
+
+private:
+
+#else
+
+protected:
+
+#endif
+
+ // Disable copy constructor and assignment operator
+
+ Image(IN const Image& C);
+ Image& operator=(IN const Image& C);
+};
+
+class Bitmap : public Image
+{
+public:
+ friend class Image;
+ friend class CachedBitmap;
+
+ Bitmap(
+ IN const WCHAR *filename,
+ IN BOOL useEmbeddedColorManagement = FALSE
+ );
+
+ Bitmap(
+ IN IStream *stream,
+ IN BOOL useEmbeddedColorManagement = FALSE
+ );
+
+ static Bitmap* FromFile(
+ IN const WCHAR *filename,
+ IN BOOL useEmbeddedColorManagement = FALSE
+ );
+
+ static Bitmap* FromStream(
+ IN IStream *stream,
+ IN BOOL useEmbeddedColorManagement = FALSE
+ );
+
+ Bitmap(IN INT width,
+ IN INT height,
+ IN INT stride, PixelFormat format,
+ IN BYTE* scan0);
+ Bitmap(IN INT width,
+ IN INT height,
+ IN PixelFormat format = PixelFormat32bppARGB);
+ Bitmap(IN INT width,
+ IN INT height,
+ IN Graphics* target);
+
+ Bitmap* Clone(IN const Rect& rect,
+ IN PixelFormat format);
+ Bitmap* Clone(IN INT x,
+ IN INT y,
+ IN INT width,
+ IN INT height,
+ IN PixelFormat format);
+ Bitmap* Clone(IN const RectF& rect,
+ IN PixelFormat format);
+ Bitmap* Clone(IN REAL x,
+ IN REAL y,
+ IN REAL width,
+ IN REAL height,
+ IN PixelFormat format);
+
+ Status LockBits(IN const Rect& rect,
+ IN UINT flags,
+ IN PixelFormat format,
+ OUT BitmapData* lockedBitmapData);
+ Status UnlockBits(IN BitmapData* lockedBitmapData);
+ Status GetPixel(IN INT x,
+ IN INT y,
+ OUT Color *color);
+ Status SetPixel(IN INT x,
+ IN INT y,
+ IN const Color &color);
+ Status SetResolution(IN REAL xdpi,
+ IN REAL ydpi);
+
+ // GDI interop:
+
+ Bitmap(IN IDirectDrawSurface7* surface);
+ Bitmap(IN const BITMAPINFO* gdiBitmapInfo,
+ IN VOID* gdiBitmapData);
+ Bitmap(IN HBITMAP hbm,
+ IN HPALETTE hpal);
+ Bitmap(IN HICON hicon);
+ Bitmap(IN HINSTANCE hInstance,
+ IN const WCHAR * bitmapName);
+ static Bitmap* FromDirectDrawSurface7(IN IDirectDrawSurface7* surface);
+ static Bitmap* FromBITMAPINFO(IN const BITMAPINFO* gdiBitmapInfo,
+ IN VOID* gdiBitmapData);
+ static Bitmap* FromHBITMAP(IN HBITMAP hbm,
+ IN HPALETTE hpal);
+ static Bitmap* FromHICON(IN HICON hicon);
+ static Bitmap* FromResource(IN HINSTANCE hInstance,
+ IN const WCHAR * bitmapName);
+
+ Status GetHBITMAP(IN const Color& colorBackground,
+ OUT HBITMAP *hbmReturn);
+ Status GetHICON(HICON *hicon);
+
+#ifdef DCR_USE_NEW_250932
+private:
+ Bitmap(const Bitmap &);
+ Bitmap& operator=(const Bitmap &);
+#endif
+
+protected:
+ Bitmap(GpBitmap *nativeBitmap);
+};
+
+class CustomLineCap : public GdiplusBase
+{
+public:
+ friend class Pen;
+
+ CustomLineCap(
+ IN const GraphicsPath* fillPath,
+ IN const GraphicsPath* strokePath,
+ IN LineCap baseCap = LineCapFlat,
+ IN REAL baseInset = 0
+ );
+ virtual ~CustomLineCap();
+
+ CustomLineCap* Clone() const;
+
+ Status SetStrokeCap(IN LineCap strokeCap)
+ {
+ // This changes both start and and caps.
+
+ return SetStrokeCaps(strokeCap, strokeCap);
+ }
+
+ Status SetStrokeCaps(IN LineCap startCap,
+ IN LineCap endCap);
+ Status GetStrokeCaps(OUT LineCap* startCap,
+ OUT LineCap* endCap) const;
+ Status SetStrokeJoin(IN LineJoin lineJoin);
+ LineJoin GetStrokeJoin() const;
+ Status SetBaseCap(IN LineCap baseCap);
+ LineCap GetBaseCap() const;
+ Status SetBaseInset(IN REAL inset);
+ REAL GetBaseInset() const;
+ Status SetWidthScale(IN REAL widthScale);
+ REAL GetWidthScale() const;
+
+protected:
+ CustomLineCap();
+
+#ifdef DCR_USE_NEW_250932
+
+private:
+ CustomLineCap(const CustomLineCap &);
+ CustomLineCap& operator=(const CustomLineCap &);
+protected:
+
+#else
+
+ CustomLineCap(const CustomLineCap& customLineCap)
+ {
+ customLineCap;
+ SetStatus(NotImplemented);
+ }
+
+ CustomLineCap& operator=(const CustomLineCap& customLineCap)
+ {
+ customLineCap;
+ SetStatus(NotImplemented);
+ return *this;
+ }
+
+#endif
+
+ CustomLineCap(GpCustomLineCap* nativeCap, Status status)
+ {
+ lastResult = status;
+ SetNativeCap(nativeCap);
+ }
+
+ VOID SetNativeCap(GpCustomLineCap* nativeCap)
+ {
+ this->nativeCap = nativeCap;
+ }
+
+ Status SetStatus(Status status) const
+ {
+ if (status != Ok)
+ return (lastResult = status);
+ else
+ return status;
+ }
+
+protected:
+ GpCustomLineCap* nativeCap;
+ mutable Status lastResult;
+};
+
+class CachedBitmap : public GdiplusBase
+{
+ friend Graphics;
+
+public:
+ CachedBitmap(IN Bitmap *bitmap,
+ IN Graphics *graphics);
+ virtual ~CachedBitmap();
+
+ Status GetLastStatus() const;
+
+#ifdef DCR_USE_NEW_250932
+
+private:
+ CachedBitmap(const CachedBitmap &);
+ CachedBitmap& operator=(const CachedBitmap &);
+
+#endif
+
+protected:
+ GpCachedBitmap *nativeCachedBitmap;
+ mutable Status lastResult;
+};
+
+#endif // !_GDIPLUSHEADERS.HPP
diff --git a/core/src/fxge/Microsoft SDK/include/GdiPlusImageCodec.h b/core/src/fxge/Microsoft SDK/include/GdiPlusImageCodec.h
index e9c02deb7e..d9ea0386b2 100644
--- a/core/src/fxge/Microsoft SDK/include/GdiPlusImageCodec.h
+++ b/core/src/fxge/Microsoft SDK/include/GdiPlusImageCodec.h
@@ -1,73 +1,73 @@
-/**************************************************************************\
-*
-* Copyright (c) 2000, Microsoft Corp. All Rights Reserved.
-*
-* Module Name:
-*
-* GdiplusImageCodec.h
-*
-* Abstract:
-*
-* APIs for imaging codecs.
-*
-\**************************************************************************/
-
-#ifndef _GDIPLUSIMAGECODEC_H
-#define _GDIPLUSIMAGECODEC_H
-
-//--------------------------------------------------------------------------
-// Codec Management APIs
-//--------------------------------------------------------------------------
-
-inline Status
-GetImageDecodersSize(
- OUT UINT *numDecoders,
- OUT UINT *size)
-{
- return DllExports::GdipGetImageDecodersSize(numDecoders, size);
-}
-
-
-inline Status
-GetImageDecoders(
- IN UINT numDecoders,
- IN UINT size,
- OUT ImageCodecInfo *decoders)
-{
- return DllExports::GdipGetImageDecoders(numDecoders, size, decoders);
-}
-
-
-inline Status
-GetImageEncodersSize(
- OUT UINT *numEncoders,
- OUT UINT *size)
-{
- return DllExports::GdipGetImageEncodersSize(numEncoders, size);
-}
-
-
-inline Status
-GetImageEncoders(
- IN UINT numEncoders,
- IN UINT size,
- OUT ImageCodecInfo *encoders)
-{
- return DllExports::GdipGetImageEncoders(numEncoders, size, encoders);
-}
-
-inline Status
-AddImageCodec(
- IN const ImageCodecInfo* codec)
-{
- return DllExports::GdipAddImageCodec(codec);
-}
-
-inline Status
-RemoveImageCodec(
- IN const ImageCodecInfo* codec)
-{
- return DllExports::GdipRemoveImageCodec(codec);
-}
-
-#endif // _GDIPLUSIMAGECODEC_H
+/**************************************************************************\
+*
+* Copyright (c) 2000, Microsoft Corp. All Rights Reserved.
+*
+* Module Name:
+*
+* GdiplusImageCodec.h
+*
+* Abstract:
+*
+* APIs for imaging codecs.
+*
+\**************************************************************************/
+
+#ifndef _GDIPLUSIMAGECODEC_H
+#define _GDIPLUSIMAGECODEC_H
+
+//--------------------------------------------------------------------------
+// Codec Management APIs
+//--------------------------------------------------------------------------
+
+inline Status
+GetImageDecodersSize(
+ OUT UINT *numDecoders,
+ OUT UINT *size)
+{
+ return DllExports::GdipGetImageDecodersSize(numDecoders, size);
+}
+
+
+inline Status
+GetImageDecoders(
+ IN UINT numDecoders,
+ IN UINT size,
+ OUT ImageCodecInfo *decoders)
+{
+ return DllExports::GdipGetImageDecoders(numDecoders, size, decoders);
+}
+
+
+inline Status
+GetImageEncodersSize(
+ OUT UINT *numEncoders,
+ OUT UINT *size)
+{
+ return DllExports::GdipGetImageEncodersSize(numEncoders, size);
+}
+
+
+inline Status
+GetImageEncoders(
+ IN UINT numEncoders,
+ IN UINT size,
+ OUT ImageCodecInfo *encoders)
+{
+ return DllExports::GdipGetImageEncoders(numEncoders, size, encoders);
+}
+
+inline Status
+AddImageCodec(
+ IN const ImageCodecInfo* codec)
+{
+ return DllExports::GdipAddImageCodec(codec);
+}
+
+inline Status
+RemoveImageCodec(
+ IN const ImageCodecInfo* codec)
+{
+ return DllExports::GdipRemoveImageCodec(codec);
+}
+
+#endif // _GDIPLUSIMAGECODEC_H
diff --git a/core/src/fxge/Microsoft SDK/include/GdiPlusImaging.h b/core/src/fxge/Microsoft SDK/include/GdiPlusImaging.h
index 35dd4d0634..d6bd4f0d18 100644
--- a/core/src/fxge/Microsoft SDK/include/GdiPlusImaging.h
+++ b/core/src/fxge/Microsoft SDK/include/GdiPlusImaging.h
@@ -1,540 +1,540 @@
-/**************************************************************************\
-*
-* Copyright (c) 1999-2000 Microsoft Corporation
-*
-* Module Name:
-*
-* GdiplusImaging.h
-*
-* Abstract:
-*
-* GUIDs defined and used by the imaging library
-*
-\**************************************************************************/
-#ifndef _GDIPLUSIMAGING_H
-#define _GDIPLUSIMAGING_H
-
-//---------------------------------------------------------------------------
-// Image file format identifiers
-//---------------------------------------------------------------------------
-
-DEFINE_GUID(ImageFormatUndefined, 0xb96b3ca9,0x0728,0x11d3,0x9d,0x7b,0x00,0x00,0xf8,0x1e,0xf3,0x2e);
-DEFINE_GUID(ImageFormatMemoryBMP, 0xb96b3caa,0x0728,0x11d3,0x9d,0x7b,0x00,0x00,0xf8,0x1e,0xf3,0x2e);
-DEFINE_GUID(ImageFormatBMP, 0xb96b3cab,0x0728,0x11d3,0x9d,0x7b,0x00,0x00,0xf8,0x1e,0xf3,0x2e);
-DEFINE_GUID(ImageFormatEMF, 0xb96b3cac,0x0728,0x11d3,0x9d,0x7b,0x00,0x00,0xf8,0x1e,0xf3,0x2e);
-DEFINE_GUID(ImageFormatWMF, 0xb96b3cad,0x0728,0x11d3,0x9d,0x7b,0x00,0x00,0xf8,0x1e,0xf3,0x2e);
-DEFINE_GUID(ImageFormatJPEG, 0xb96b3cae,0x0728,0x11d3,0x9d,0x7b,0x00,0x00,0xf8,0x1e,0xf3,0x2e);
-DEFINE_GUID(ImageFormatPNG, 0xb96b3caf,0x0728,0x11d3,0x9d,0x7b,0x00,0x00,0xf8,0x1e,0xf3,0x2e);
-DEFINE_GUID(ImageFormatGIF, 0xb96b3cb0,0x0728,0x11d3,0x9d,0x7b,0x00,0x00,0xf8,0x1e,0xf3,0x2e);
-DEFINE_GUID(ImageFormatTIFF, 0xb96b3cb1,0x0728,0x11d3,0x9d,0x7b,0x00,0x00,0xf8,0x1e,0xf3,0x2e);
-DEFINE_GUID(ImageFormatEXIF, 0xb96b3cb2,0x0728,0x11d3,0x9d,0x7b,0x00,0x00,0xf8,0x1e,0xf3,0x2e);
-#ifndef DCR_USE_NEW_140855
-DEFINE_GUID(ImageFormatPhotoCD, 0xb96b3cb3,0x0728,0x11d3,0x9d,0x7b,0x00,0x00,0xf8,0x1e,0xf3,0x2e);
-DEFINE_GUID(ImageFormatFlashPIX, 0xb96b3cb4,0x0728,0x11d3,0x9d,0x7b,0x00,0x00,0xf8,0x1e,0xf3,0x2e);
-#endif
-DEFINE_GUID(ImageFormatIcon, 0xb96b3cb5,0x0728,0x11d3,0x9d,0x7b,0x00,0x00,0xf8,0x1e,0xf3,0x2e);
-
-//---------------------------------------------------------------------------
-// Predefined multi-frame dimension IDs
-//---------------------------------------------------------------------------
-
-DEFINE_GUID(FrameDimensionTime, 0x6aedbd6d,0x3fb5,0x418a,0x83,0xa6,0x7f,0x45,0x22,0x9d,0xc8,0x72);
-DEFINE_GUID(FrameDimensionResolution, 0x84236f7b,0x3bd3,0x428f,0x8d,0xab,0x4e,0xa1,0x43,0x9c,0xa3,0x15);
-DEFINE_GUID(FrameDimensionPage, 0x7462dc86,0x6180,0x4c7e,0x8e,0x3f,0xee,0x73,0x33,0xa7,0xa4,0x83);
-
-//---------------------------------------------------------------------------
-// Property sets
-//---------------------------------------------------------------------------
-
-DEFINE_GUID(FormatIDImageInformation, 0xe5836cbe,0x5eef,0x4f1d,0xac,0xde,0xae,0x4c,0x43,0xb6,0x08,0xce);
-DEFINE_GUID(FormatIDJpegAppHeaders, 0x1c4afdcd,0x6177,0x43cf,0xab,0xc7,0x5f,0x51,0xaf,0x39,0xee,0x85);
-
-#ifndef DCR_USE_NEW_140855
-//---------------------------------------------------------------------------
-// Decoder parameter sets
-//---------------------------------------------------------------------------
-DEFINE_GUID(DecoderTransColor, 0xb7a98c8f,0xdce7,0x457d,0xbf,0xa5,0xce,0xa7,0x1b,0xd1,0x4d,0xd6);
-DEFINE_GUID(DecoderTransRange, 0xabeed189,0xd988,0x4d03,0xb4,0x25,0x57,0x10,0x55,0xc7,0x6a,0xd1);
-DEFINE_GUID(DecoderOutputChannel, 0x2ff8f51e,0x724d,0x45fe,0x86,0xce,0x17,0x77,0xa0,0x56,0xda,0x60);
-DEFINE_GUID(DecoderIconRes, 0x5c656eec,0xe94f,0x45ba,0xa6,0xf6,0x10,0x62,0xe8,0x5f,0x4a,0x7f);
-#endif
-
-//---------------------------------------------------------------------------
-// Encoder parameter sets
-//---------------------------------------------------------------------------
-
-DEFINE_GUID(EncoderCompression, 0xe09d739d,0xccd4,0x44ee,0x8e,0xba,0x3f,0xbf,0x8b,0xe4,0xfc,0x58);
-DEFINE_GUID(EncoderColorDepth, 0x66087055,0xad66,0x4c7c,0x9a,0x18,0x38,0xa2,0x31,0x0b,0x83,0x37);
-DEFINE_GUID(EncoderScanMethod, 0x3a4e2661,0x3109,0x4e56,0x85,0x36,0x42,0xc1,0x56,0xe7,0xdc,0xfa);
-DEFINE_GUID(EncoderVersion, 0x24d18c76,0x814a,0x41a4,0xbf,0x53,0x1c,0x21,0x9c,0xcc,0xf7,0x97);
-DEFINE_GUID(EncoderRenderMethod, 0x6d42c53a,0x229a,0x4825,0x8b,0xb7,0x5c,0x99,0xe2,0xb9,0xa8,0xb8);
-DEFINE_GUID(EncoderQuality, 0x1d5be4b5,0xfa4a,0x452d,0x9c,0xdd,0x5d,0xb3,0x51,0x05,0xe7,0xeb);
-DEFINE_GUID(EncoderTransformation,0x8d0eb2d1,0xa58e,0x4ea8,0xaa,0x14,0x10,0x80,0x74,0xb7,0xb6,0xf9);
-DEFINE_GUID(EncoderLuminanceTable,0xedb33bce,0x0266,0x4a77,0xb9,0x04,0x27,0x21,0x60,0x99,0xe7,0x17);
-DEFINE_GUID(EncoderChrominanceTable,0xf2e455dc,0x09b3,0x4316,0x82,0x60,0x67,0x6a,0xda,0x32,0x48,0x1c);
-DEFINE_GUID(EncoderSaveFlag,0x292266fc,0xac40,0x47bf,0x8c, 0xfc, 0xa8, 0x5b, 0x89, 0xa6, 0x55, 0xde);
-
-DEFINE_GUID(CodecIImageBytes,0x025d1823,0x6c7d,0x447b,0xbb, 0xdb, 0xa3, 0xcb, 0xc3, 0xdf, 0xa2, 0xfc);
-
-MIDL_INTERFACE("025D1823-6C7D-447B-BBDB-A3CBC3DFA2FC")
-IImageBytes : public IUnknown
-{
-public:
- // Return total number of bytes in the IStream
-
- STDMETHOD(CountBytes)(
- OUT UINT *pcb
- ) = 0;
-
- // Locks "cb" bytes, starting from "ulOffset" in the stream, and returns the
- // pointer to the beginning of the locked memory chunk in "ppvBytes"
-
- STDMETHOD(LockBytes)(
- IN UINT cb,
- IN ULONG ulOffset,
- OUT const VOID ** ppvBytes
- ) = 0;
-
- // Unlocks "cb" bytes, pointed by "pvBytes", starting from "ulOffset" in the
- // stream
-
- STDMETHOD(UnlockBytes)(
- IN const VOID *pvBytes,
- IN UINT cb,
- IN ULONG ulOffset
- ) = 0;
-};
-
-//--------------------------------------------------------------------------
-// ImageCodecInfo structure
-//--------------------------------------------------------------------------
-
-class ImageCodecInfo
-{
-public:
- CLSID Clsid;
- GUID FormatID;
- const WCHAR* CodecName;
- const WCHAR* DllName;
- const WCHAR* FormatDescription;
- const WCHAR* FilenameExtension;
- const WCHAR* MimeType;
- DWORD Flags;
- DWORD Version;
- DWORD SigCount;
- DWORD SigSize;
- const BYTE* SigPattern;
- const BYTE* SigMask;
-};
-
-//--------------------------------------------------------------------------
-// Information flags about image codecs
-//--------------------------------------------------------------------------
-
-enum ImageCodecFlags
-{
- ImageCodecFlagsEncoder = 0x00000001,
- ImageCodecFlagsDecoder = 0x00000002,
- ImageCodecFlagsSupportBitmap = 0x00000004,
- ImageCodecFlagsSupportVector = 0x00000008,
- ImageCodecFlagsSeekableEncode = 0x00000010,
- ImageCodecFlagsBlockingDecode = 0x00000020,
-
- ImageCodecFlagsBuiltin = 0x00010000,
- ImageCodecFlagsSystem = 0x00020000,
- ImageCodecFlagsUser = 0x00040000
-};
-
-//---------------------------------------------------------------------------
-// Access modes used when calling Image::LockBits
-//---------------------------------------------------------------------------
-
-enum ImageLockMode
-{
- ImageLockModeRead = 0x0001,
- ImageLockModeWrite = 0x0002,
- ImageLockModeUserInputBuf= 0x0004
-};
-
-//---------------------------------------------------------------------------
-// Information about image pixel data
-//---------------------------------------------------------------------------
-
-class BitmapData
-{
-public:
- UINT Width;
- UINT Height;
- INT Stride;
- PixelFormat PixelFormat;
- VOID* Scan0;
- UINT_PTR Reserved;
-};
-
-//---------------------------------------------------------------------------
-// Image flags
-//---------------------------------------------------------------------------
-
-enum ImageFlags
-{
- ImageFlagsNone = 0,
-
- // Low-word: shared with SINKFLAG_x
-
- ImageFlagsScalable = 0x0001,
- ImageFlagsHasAlpha = 0x0002,
- ImageFlagsHasTranslucent = 0x0004,
- ImageFlagsPartiallyScalable = 0x0008,
-
- // Low-word: color space definition
-
- ImageFlagsColorSpaceRGB = 0x0010,
- ImageFlagsColorSpaceCMYK = 0x0020,
- ImageFlagsColorSpaceGRAY = 0x0040,
- ImageFlagsColorSpaceYCBCR = 0x0080,
- ImageFlagsColorSpaceYCCK = 0x0100,
-
- // Low-word: image size info
-
- ImageFlagsHasRealDPI = 0x1000,
- ImageFlagsHasRealPixelSize = 0x2000,
-
- // High-word
-
- ImageFlagsReadOnly = 0x00010000,
- ImageFlagsCaching = 0x00020000
-};
-
-enum RotateFlipType
-{
- RotateNoneFlipNone = 0,
- Rotate90FlipNone = 1,
- Rotate180FlipNone = 2,
- Rotate270FlipNone = 3,
-
- RotateNoneFlipX = 4,
- Rotate90FlipX = 5,
- Rotate180FlipX = 6,
- Rotate270FlipX = 7,
-
- RotateNoneFlipY = Rotate180FlipX,
- Rotate90FlipY = Rotate270FlipX,
- Rotate180FlipY = RotateNoneFlipX,
- Rotate270FlipY = Rotate90FlipX,
-
- RotateNoneFlipXY = Rotate180FlipNone,
- Rotate90FlipXY = Rotate270FlipNone,
- Rotate180FlipXY = RotateNoneFlipNone,
- Rotate270FlipXY = Rotate90FlipNone
-};
-
-//---------------------------------------------------------------------------
-// Encoder Parameter structure
-//---------------------------------------------------------------------------
-class EncoderParameter
-{
-public:
- GUID Guid; // GUID of the parameter
- ULONG NumberOfValues; // Number of the parameter values
- ULONG Type; // Value type, like ValueTypeLONG etc.
- VOID* Value; // A pointer to the parameter values
-};
-
-//---------------------------------------------------------------------------
-// Encoder Parameters structure
-//---------------------------------------------------------------------------
-class EncoderParameters
-{
-public:
- UINT Count; // Number of parameters in this structure
- EncoderParameter Parameter[1]; // Parameter values
-};
-
-//---------------------------------------------------------------------------
-// Property Item
-//---------------------------------------------------------------------------
-class PropertyItem
-{
-public:
- PROPID id; // ID of this property
- ULONG length; // Length of the property value, in bytes
- WORD type; // Type of the value, as one of TAG_TYPE_XXX
- // defined above
- VOID* value; // property value
-};
-
-#ifdef DCR_USE_NEW_140857
-//---------------------------------------------------------------------------
-// Image property types
-//---------------------------------------------------------------------------
-#define PropertyTagTypeByte 1
-#define PropertyTagTypeASCII 2
-#define PropertyTagTypeShort 3
-#define PropertyTagTypeLong 4
-#define PropertyTagTypeRational 5
-#define PropertyTagTypeUndefined 7
-#define PropertyTagTypeSLONG 9
-#define PropertyTagTypeSRational 10
-#endif
-
-//---------------------------------------------------------------------------
-// Image property ID tags
-//---------------------------------------------------------------------------
-
-#define PropertyTagExifIFD 0x8769
-#define PropertyTagGpsIFD 0x8825
-
-#define PropertyTagNewSubfileType 0x00FE
-#define PropertyTagSubfileType 0x00FF
-#define PropertyTagImageWidth 0x0100
-#define PropertyTagImageHeight 0x0101
-#define PropertyTagBitsPerSample 0x0102
-#define PropertyTagCompression 0x0103
-#define PropertyTagPhotometricInterp 0x0106
-#define PropertyTagThreshHolding 0x0107
-#define PropertyTagCellWidth 0x0108
-#define PropertyTagCellHeight 0x0109
-#define PropertyTagFillOrder 0x010A
-#define PropertyTagDocumentName 0x010D
-#define PropertyTagImageDescription 0x010E
-#define PropertyTagEquipMake 0x010F
-#define PropertyTagEquipModel 0x0110
-#define PropertyTagStripOffsets 0x0111
-#define PropertyTagOrientation 0x0112
-#define PropertyTagSamplesPerPixel 0x0115
-#define PropertyTagRowsPerStrip 0x0116
-#define PropertyTagStripBytesCount 0x0117
-#define PropertyTagMinSampleValue 0x0118
-#define PropertyTagMaxSampleValue 0x0119
-#define PropertyTagXResolution 0x011A // Image resolution in width direction
-#define PropertyTagYResolution 0x011B // Image resolution in height direction
-#define PropertyTagPlanarConfig 0x011C // Image data arrangement
-#define PropertyTagPageName 0x011D
-#define PropertyTagXPosition 0x011E
-#define PropertyTagYPosition 0x011F
-#define PropertyTagFreeOffset 0x0120
-#define PropertyTagFreeByteCounts 0x0121
-#define PropertyTagGrayResponseUnit 0x0122
-#define PropertyTagGrayResponseCurve 0x0123
-#define PropertyTagT4Option 0x0124
-#define PropertyTagT6Option 0x0125
-#define PropertyTagResolutionUnit 0x0128 // Unit of X and Y resolution
-#define PropertyTagPageNumber 0x0129
-#define PropertyTagTransferFuncition 0x012D
-#define PropertyTagSoftwareUsed 0x0131
-#define PropertyTagDateTime 0x0132
-#define PropertyTagArtist 0x013B
-#define PropertyTagHostComputer 0x013C
-#define PropertyTagPredictor 0x013D
-#define PropertyTagWhitePoint 0x013E
-#define PropertyTagPrimaryChromaticities 0x013F
-#define PropertyTagColorMap 0x0140
-#define PropertyTagHalftoneHints 0x0141
-#define PropertyTagTileWidth 0x0142
-#define PropertyTagTileLength 0x0143
-#define PropertyTagTileOffset 0x0144
-#define PropertyTagTileByteCounts 0x0145
-#define PropertyTagInkSet 0x014C
-#define PropertyTagInkNames 0x014D
-#define PropertyTagNumberOfInks 0x014E
-#define PropertyTagDotRange 0x0150
-#define PropertyTagTargetPrinter 0x0151
-#define PropertyTagExtraSamples 0x0152
-#define PropertyTagSampleFormat 0x0153
-#define PropertyTagSMinSampleValue 0x0154
-#define PropertyTagSMaxSampleValue 0x0155
-#define PropertyTagTransferRange 0x0156
-
-#define PropertyTagJPEGProc 0x0200
-#define PropertyTagJPEGInterFormat 0x0201
-#define PropertyTagJPEGInterLength 0x0202
-#define PropertyTagJPEGRestartInterval 0x0203
-#define PropertyTagJPEGLosslessPredictors 0x0205
-#define PropertyTagJPEGPointTransforms 0x0206
-#define PropertyTagJPEGQTables 0x0207
-#define PropertyTagJPEGDCTables 0x0208
-#define PropertyTagJPEGACTables 0x0209
-
-#define PropertyTagYCbCrCoefficients 0x0211
-#define PropertyTagYCbCrSubsampling 0x0212
-#define PropertyTagYCbCrPositioning 0x0213
-#define PropertyTagREFBlackWhite 0x0214
-
-#define PropertyTagICCProfile 0x8773 // This TAG is defined by ICC
- // for embedded ICC in TIFF
-#define PropertyTagGamma 0x0301
-#define PropertyTagICCProfileDescriptor 0x0302
-#define PropertyTagSRGBRenderingIntent 0x0303
-
-#define PropertyTagImageTitle 0x0320
-#define PropertyTagCopyright 0x8298
-
-// Extra TAGs (Like Adobe Image Information tags etc.)
-
-#define PropertyTagResolutionXUnit 0x5001
-#define PropertyTagResolutionYUnit 0x5002
-#define PropertyTagResolutionXLengthUnit 0x5003
-#define PropertyTagResolutionYLengthUnit 0x5004
-#define PropertyTagPrintFlags 0x5005
-#define PropertyTagPrintFlagsVersion 0x5006
-#define PropertyTagPrintFlagsCrop 0x5007
-#define PropertyTagPrintFlagsBleedWidth 0x5008
-#define PropertyTagPrintFlagsBleedWidthScale 0x5009
-#define PropertyTagHalftoneLPI 0x500A
-#define PropertyTagHalftoneLPIUnit 0x500B
-#define PropertyTagHalftoneDegree 0x500C
-#define PropertyTagHalftoneShape 0x500D
-#define PropertyTagHalftoneMisc 0x500E
-#define PropertyTagHalftoneScreen 0x500F
-#define PropertyTagJPEGQuality 0x5010
-#define PropertyTagGridSize 0x5011
-#define PropertyTagThumbnailFormat 0x5012 // 1 = JPEG, 0 = RAW RGB
-#define PropertyTagThumbnailWidth 0x5013
-#define PropertyTagThumbnailHeight 0x5014
-#define PropertyTagThumbnailColorDepth 0x5015
-#define PropertyTagThumbnailPlanes 0x5016
-#define PropertyTagThumbnailRawBytes 0x5017
-#define PropertyTagThumbnailSize 0x5018
-#define PropertyTagThumbnailCompressedSize 0x5019
-#define PropertyTagColorTransferFunction 0x501A
-#define PropertyTagThumbnailData 0x501B// RAW thumbnail bits in
- // JPEG format or RGB format
- // depends on
- // PropertyTagThumbnailFormat
-
-// Thumbnail related TAGs
-
-#define PropertyTagThumbnailImageWidth 0x5020 // Thumbnail width
-#define PropertyTagThumbnailImageHeight 0x5021 // Thumbnail height
-#define PropertyTagThumbnailBitsPerSample 0x5022 // Number of bits per
- // component
-#define PropertyTagThumbnailCompression 0x5023 // Compression Scheme
-#define PropertyTagThumbnailPhotometricInterp 0x5024 // Pixel composition
-#define PropertyTagThumbnailImageDescription 0x5025 // Image Tile
-#define PropertyTagThumbnailEquipMake 0x5026 // Manufacturer of Image
- // Input equipment
-#define PropertyTagThumbnailEquipModel 0x5027 // Model of Image input
- // equipment
-#define PropertyTagThumbnailStripOffsets 0x5028 // Image data location
-#define PropertyTagThumbnailOrientation 0x5029 // Orientation of image
-#define PropertyTagThumbnailSamplesPerPixel 0x502A // Number of components
-#define PropertyTagThumbnailRowsPerStrip 0x502B // Number of rows per strip
-#define PropertyTagThumbnailStripBytesCount 0x502C // Bytes per compressed
- // strip
-#define PropertyTagThumbnailResolutionX 0x502D // Resolution in width
- // direction
-#define PropertyTagThumbnailResolutionY 0x502E // Resolution in height
- // direction
-#define PropertyTagThumbnailPlanarConfig 0x502F // Image data arrangement
-#define PropertyTagThumbnailResolutionUnit 0x5030 // Unit of X and Y
- // Resolution
-#define PropertyTagThumbnailTransferFunction 0x5031 // Transfer function
-#define PropertyTagThumbnailSoftwareUsed 0x5032 // Software used
-#define PropertyTagThumbnailDateTime 0x5033 // File change date and
- // time
-#define PropertyTagThumbnailArtist 0x5034 // Person who created the
- // image
-#define PropertyTagThumbnailWhitePoint 0x5035 // White point chromaticity
-#define PropertyTagThumbnailPrimaryChromaticities 0x5036
- // Chromaticities of
- // primaries
-#define PropertyTagThumbnailYCbCrCoefficients 0x5037 // Color space transforma-
- // tion coefficients
-#define PropertyTagThumbnailYCbCrSubsampling 0x5038 // Subsampling ratio of Y
- // to C
-#define PropertyTagThumbnailYCbCrPositioning 0x5039 // Y and C position
-#define PropertyTagThumbnailRefBlackWhite 0x503A // Pair of black and white
- // reference values
-#define PropertyTagThumbnailCopyRight 0x503B // CopyRight holder
-
-#define PropertyTagLuminanceTable 0x5090
-#define PropertyTagChrominanceTable 0x5091
-
-#define PropertyTagFrameDelay 0x5100
-#define PropertyTagLoopCount 0x5101
-
-#define PropertyTagPixelUnit 0x5110 // Unit specifier for pixel/unit
-#define PropertyTagPixelPerUnitX 0x5111 // Pixels per unit in X
-#define PropertyTagPixelPerUnitY 0x5112 // Pixels per unit in Y
-#define PropertyTagPaletteHistogram 0x5113 // Palette histogram
-
-// EXIF specific tag
-
-#define PropertyTagExifExposureTime 0x829A
-#define PropertyTagExifFNumber 0x829D
-
-#define PropertyTagExifExposureProg 0x8822
-#define PropertyTagExifSpectralSense 0x8824
-#define PropertyTagExifISOSpeed 0x8827
-#define PropertyTagExifOECF 0x8828
-
-#define PropertyTagExifVer 0x9000
-#define PropertyTagExifDTOrig 0x9003 // Date & time of original
-#define PropertyTagExifDTDigitized 0x9004 // Date & time of digital data generation
-
-#define PropertyTagExifCompConfig 0x9101
-#define PropertyTagExifCompBPP 0x9102
-
-#define PropertyTagExifShutterSpeed 0x9201
-#define PropertyTagExifAperture 0x9202
-#define PropertyTagExifBrightness 0x9203
-#define PropertyTagExifExposureBias 0x9204
-#define PropertyTagExifMaxAperture 0x9205
-#define PropertyTagExifSubjectDist 0x9206
-#define PropertyTagExifMeteringMode 0x9207
-#define PropertyTagExifLightSource 0x9208
-#define PropertyTagExifFlash 0x9209
-#define PropertyTagExifFocalLength 0x920A
-#define PropertyTagExifMakerNote 0x927C
-#define PropertyTagExifUserComment 0x9286
-#define PropertyTagExifDTSubsec 0x9290 // Date & Time subseconds
-#define PropertyTagExifDTOrigSS 0x9291 // Date & Time original subseconds
-#define PropertyTagExifDTDigSS 0x9292 // Date & TIme digitized subseconds
-
-#define PropertyTagExifFPXVer 0xA000
-#define PropertyTagExifColorSpace 0xA001
-#define PropertyTagExifPixXDim 0xA002
-#define PropertyTagExifPixYDim 0xA003
-#define PropertyTagExifRelatedWav 0xA004 // related sound file
-#define PropertyTagExifInterop 0xA005
-#define PropertyTagExifFlashEnergy 0xA20B
-#define PropertyTagExifSpatialFR 0xA20C // Spatial Frequency Response
-#define PropertyTagExifFocalXRes 0xA20E // Focal Plane X Resolution
-#define PropertyTagExifFocalYRes 0xA20F // Focal Plane Y Resolution
-#define PropertyTagExifFocalResUnit 0xA210 // Focal Plane Resolution Unit
-#define PropertyTagExifSubjectLoc 0xA214
-#define PropertyTagExifExposureIndex 0xA215
-#define PropertyTagExifSensingMethod 0xA217
-#define PropertyTagExifFileSource 0xA300
-#define PropertyTagExifSceneType 0xA301
-#define PropertyTagExifCfaPattern 0xA302
-
-#define PropertyTagGpsVer 0x0000
-#define PropertyTagGpsLatitudeRef 0x0001
-#define PropertyTagGpsLatitude 0x0002
-#define PropertyTagGpsLongitudeRef 0x0003
-#define PropertyTagGpsLongitude 0x0004
-#define PropertyTagGpsAltitudeRef 0x0005
-#define PropertyTagGpsAltitude 0x0006
-#define PropertyTagGpsGpsTime 0x0007
-#define PropertyTagGpsGpsSatellites 0x0008
-#define PropertyTagGpsGpsStatus 0x0009
-#define PropertyTagGpsGpsMeasureMode 0x00A
-#define PropertyTagGpsGpsDop 0x000B // Measurement precision
-#define PropertyTagGpsSpeedRef 0x000C
-#define PropertyTagGpsSpeed 0x000D
-#define PropertyTagGpsTrackRef 0x000E
-#define PropertyTagGpsTrack 0x000F
-#define PropertyTagGpsImgDirRef 0x0010
-#define PropertyTagGpsImgDir 0x0011
-#define PropertyTagGpsMapDatum 0x0012
-#define PropertyTagGpsDestLatRef 0x0013
-#define PropertyTagGpsDestLat 0x0014
-#define PropertyTagGpsDestLongRef 0x0015
-#define PropertyTagGpsDestLong 0x0016
-#define PropertyTagGpsDestBearRef 0x0017
-#define PropertyTagGpsDestBear 0x0018
-#define PropertyTagGpsDestDistRef 0x0019
-#define PropertyTagGpsDestDist 0x001A
-
-#endif
+/**************************************************************************\
+*
+* Copyright (c) 1999-2000 Microsoft Corporation
+*
+* Module Name:
+*
+* GdiplusImaging.h
+*
+* Abstract:
+*
+* GUIDs defined and used by the imaging library
+*
+\**************************************************************************/
+#ifndef _GDIPLUSIMAGING_H
+#define _GDIPLUSIMAGING_H
+
+//---------------------------------------------------------------------------
+// Image file format identifiers
+//---------------------------------------------------------------------------
+
+DEFINE_GUID(ImageFormatUndefined, 0xb96b3ca9,0x0728,0x11d3,0x9d,0x7b,0x00,0x00,0xf8,0x1e,0xf3,0x2e);
+DEFINE_GUID(ImageFormatMemoryBMP, 0xb96b3caa,0x0728,0x11d3,0x9d,0x7b,0x00,0x00,0xf8,0x1e,0xf3,0x2e);
+DEFINE_GUID(ImageFormatBMP, 0xb96b3cab,0x0728,0x11d3,0x9d,0x7b,0x00,0x00,0xf8,0x1e,0xf3,0x2e);
+DEFINE_GUID(ImageFormatEMF, 0xb96b3cac,0x0728,0x11d3,0x9d,0x7b,0x00,0x00,0xf8,0x1e,0xf3,0x2e);
+DEFINE_GUID(ImageFormatWMF, 0xb96b3cad,0x0728,0x11d3,0x9d,0x7b,0x00,0x00,0xf8,0x1e,0xf3,0x2e);
+DEFINE_GUID(ImageFormatJPEG, 0xb96b3cae,0x0728,0x11d3,0x9d,0x7b,0x00,0x00,0xf8,0x1e,0xf3,0x2e);
+DEFINE_GUID(ImageFormatPNG, 0xb96b3caf,0x0728,0x11d3,0x9d,0x7b,0x00,0x00,0xf8,0x1e,0xf3,0x2e);
+DEFINE_GUID(ImageFormatGIF, 0xb96b3cb0,0x0728,0x11d3,0x9d,0x7b,0x00,0x00,0xf8,0x1e,0xf3,0x2e);
+DEFINE_GUID(ImageFormatTIFF, 0xb96b3cb1,0x0728,0x11d3,0x9d,0x7b,0x00,0x00,0xf8,0x1e,0xf3,0x2e);
+DEFINE_GUID(ImageFormatEXIF, 0xb96b3cb2,0x0728,0x11d3,0x9d,0x7b,0x00,0x00,0xf8,0x1e,0xf3,0x2e);
+#ifndef DCR_USE_NEW_140855
+DEFINE_GUID(ImageFormatPhotoCD, 0xb96b3cb3,0x0728,0x11d3,0x9d,0x7b,0x00,0x00,0xf8,0x1e,0xf3,0x2e);
+DEFINE_GUID(ImageFormatFlashPIX, 0xb96b3cb4,0x0728,0x11d3,0x9d,0x7b,0x00,0x00,0xf8,0x1e,0xf3,0x2e);
+#endif
+DEFINE_GUID(ImageFormatIcon, 0xb96b3cb5,0x0728,0x11d3,0x9d,0x7b,0x00,0x00,0xf8,0x1e,0xf3,0x2e);
+
+//---------------------------------------------------------------------------
+// Predefined multi-frame dimension IDs
+//---------------------------------------------------------------------------
+
+DEFINE_GUID(FrameDimensionTime, 0x6aedbd6d,0x3fb5,0x418a,0x83,0xa6,0x7f,0x45,0x22,0x9d,0xc8,0x72);
+DEFINE_GUID(FrameDimensionResolution, 0x84236f7b,0x3bd3,0x428f,0x8d,0xab,0x4e,0xa1,0x43,0x9c,0xa3,0x15);
+DEFINE_GUID(FrameDimensionPage, 0x7462dc86,0x6180,0x4c7e,0x8e,0x3f,0xee,0x73,0x33,0xa7,0xa4,0x83);
+
+//---------------------------------------------------------------------------
+// Property sets
+//---------------------------------------------------------------------------
+
+DEFINE_GUID(FormatIDImageInformation, 0xe5836cbe,0x5eef,0x4f1d,0xac,0xde,0xae,0x4c,0x43,0xb6,0x08,0xce);
+DEFINE_GUID(FormatIDJpegAppHeaders, 0x1c4afdcd,0x6177,0x43cf,0xab,0xc7,0x5f,0x51,0xaf,0x39,0xee,0x85);
+
+#ifndef DCR_USE_NEW_140855
+//---------------------------------------------------------------------------
+// Decoder parameter sets
+//---------------------------------------------------------------------------
+DEFINE_GUID(DecoderTransColor, 0xb7a98c8f,0xdce7,0x457d,0xbf,0xa5,0xce,0xa7,0x1b,0xd1,0x4d,0xd6);
+DEFINE_GUID(DecoderTransRange, 0xabeed189,0xd988,0x4d03,0xb4,0x25,0x57,0x10,0x55,0xc7,0x6a,0xd1);
+DEFINE_GUID(DecoderOutputChannel, 0x2ff8f51e,0x724d,0x45fe,0x86,0xce,0x17,0x77,0xa0,0x56,0xda,0x60);
+DEFINE_GUID(DecoderIconRes, 0x5c656eec,0xe94f,0x45ba,0xa6,0xf6,0x10,0x62,0xe8,0x5f,0x4a,0x7f);
+#endif
+
+//---------------------------------------------------------------------------
+// Encoder parameter sets
+//---------------------------------------------------------------------------
+
+DEFINE_GUID(EncoderCompression, 0xe09d739d,0xccd4,0x44ee,0x8e,0xba,0x3f,0xbf,0x8b,0xe4,0xfc,0x58);
+DEFINE_GUID(EncoderColorDepth, 0x66087055,0xad66,0x4c7c,0x9a,0x18,0x38,0xa2,0x31,0x0b,0x83,0x37);
+DEFINE_GUID(EncoderScanMethod, 0x3a4e2661,0x3109,0x4e56,0x85,0x36,0x42,0xc1,0x56,0xe7,0xdc,0xfa);
+DEFINE_GUID(EncoderVersion, 0x24d18c76,0x814a,0x41a4,0xbf,0x53,0x1c,0x21,0x9c,0xcc,0xf7,0x97);
+DEFINE_GUID(EncoderRenderMethod, 0x6d42c53a,0x229a,0x4825,0x8b,0xb7,0x5c,0x99,0xe2,0xb9,0xa8,0xb8);
+DEFINE_GUID(EncoderQuality, 0x1d5be4b5,0xfa4a,0x452d,0x9c,0xdd,0x5d,0xb3,0x51,0x05,0xe7,0xeb);
+DEFINE_GUID(EncoderTransformation,0x8d0eb2d1,0xa58e,0x4ea8,0xaa,0x14,0x10,0x80,0x74,0xb7,0xb6,0xf9);
+DEFINE_GUID(EncoderLuminanceTable,0xedb33bce,0x0266,0x4a77,0xb9,0x04,0x27,0x21,0x60,0x99,0xe7,0x17);
+DEFINE_GUID(EncoderChrominanceTable,0xf2e455dc,0x09b3,0x4316,0x82,0x60,0x67,0x6a,0xda,0x32,0x48,0x1c);
+DEFINE_GUID(EncoderSaveFlag,0x292266fc,0xac40,0x47bf,0x8c, 0xfc, 0xa8, 0x5b, 0x89, 0xa6, 0x55, 0xde);
+
+DEFINE_GUID(CodecIImageBytes,0x025d1823,0x6c7d,0x447b,0xbb, 0xdb, 0xa3, 0xcb, 0xc3, 0xdf, 0xa2, 0xfc);
+
+MIDL_INTERFACE("025D1823-6C7D-447B-BBDB-A3CBC3DFA2FC")
+IImageBytes : public IUnknown
+{
+public:
+ // Return total number of bytes in the IStream
+
+ STDMETHOD(CountBytes)(
+ OUT UINT *pcb
+ ) = 0;
+
+ // Locks "cb" bytes, starting from "ulOffset" in the stream, and returns the
+ // pointer to the beginning of the locked memory chunk in "ppvBytes"
+
+ STDMETHOD(LockBytes)(
+ IN UINT cb,
+ IN ULONG ulOffset,
+ OUT const VOID ** ppvBytes
+ ) = 0;
+
+ // Unlocks "cb" bytes, pointed by "pvBytes", starting from "ulOffset" in the
+ // stream
+
+ STDMETHOD(UnlockBytes)(
+ IN const VOID *pvBytes,
+ IN UINT cb,
+ IN ULONG ulOffset
+ ) = 0;
+};
+
+//--------------------------------------------------------------------------
+// ImageCodecInfo structure
+//--------------------------------------------------------------------------
+
+class ImageCodecInfo
+{
+public:
+ CLSID Clsid;
+ GUID FormatID;
+ const WCHAR* CodecName;
+ const WCHAR* DllName;
+ const WCHAR* FormatDescription;
+ const WCHAR* FilenameExtension;
+ const WCHAR* MimeType;
+ DWORD Flags;
+ DWORD Version;
+ DWORD SigCount;
+ DWORD SigSize;
+ const BYTE* SigPattern;
+ const BYTE* SigMask;
+};
+
+//--------------------------------------------------------------------------
+// Information flags about image codecs
+//--------------------------------------------------------------------------
+
+enum ImageCodecFlags
+{
+ ImageCodecFlagsEncoder = 0x00000001,
+ ImageCodecFlagsDecoder = 0x00000002,
+ ImageCodecFlagsSupportBitmap = 0x00000004,
+ ImageCodecFlagsSupportVector = 0x00000008,
+ ImageCodecFlagsSeekableEncode = 0x00000010,
+ ImageCodecFlagsBlockingDecode = 0x00000020,
+
+ ImageCodecFlagsBuiltin = 0x00010000,
+ ImageCodecFlagsSystem = 0x00020000,
+ ImageCodecFlagsUser = 0x00040000
+};
+
+//---------------------------------------------------------------------------
+// Access modes used when calling Image::LockBits
+//---------------------------------------------------------------------------
+
+enum ImageLockMode
+{
+ ImageLockModeRead = 0x0001,
+ ImageLockModeWrite = 0x0002,
+ ImageLockModeUserInputBuf= 0x0004
+};
+
+//---------------------------------------------------------------------------
+// Information about image pixel data
+//---------------------------------------------------------------------------
+
+class BitmapData
+{
+public:
+ UINT Width;
+ UINT Height;
+ INT Stride;
+ PixelFormat PixelFormat;
+ VOID* Scan0;
+ UINT_PTR Reserved;
+};
+
+//---------------------------------------------------------------------------
+// Image flags
+//---------------------------------------------------------------------------
+
+enum ImageFlags
+{
+ ImageFlagsNone = 0,
+
+ // Low-word: shared with SINKFLAG_x
+
+ ImageFlagsScalable = 0x0001,
+ ImageFlagsHasAlpha = 0x0002,
+ ImageFlagsHasTranslucent = 0x0004,
+ ImageFlagsPartiallyScalable = 0x0008,
+
+ // Low-word: color space definition
+
+ ImageFlagsColorSpaceRGB = 0x0010,
+ ImageFlagsColorSpaceCMYK = 0x0020,
+ ImageFlagsColorSpaceGRAY = 0x0040,
+ ImageFlagsColorSpaceYCBCR = 0x0080,
+ ImageFlagsColorSpaceYCCK = 0x0100,
+
+ // Low-word: image size info
+
+ ImageFlagsHasRealDPI = 0x1000,
+ ImageFlagsHasRealPixelSize = 0x2000,
+
+ // High-word
+
+ ImageFlagsReadOnly = 0x00010000,
+ ImageFlagsCaching = 0x00020000
+};
+
+enum RotateFlipType
+{
+ RotateNoneFlipNone = 0,
+ Rotate90FlipNone = 1,
+ Rotate180FlipNone = 2,
+ Rotate270FlipNone = 3,
+
+ RotateNoneFlipX = 4,
+ Rotate90FlipX = 5,
+ Rotate180FlipX = 6,
+ Rotate270FlipX = 7,
+
+ RotateNoneFlipY = Rotate180FlipX,
+ Rotate90FlipY = Rotate270FlipX,
+ Rotate180FlipY = RotateNoneFlipX,
+ Rotate270FlipY = Rotate90FlipX,
+
+ RotateNoneFlipXY = Rotate180FlipNone,
+ Rotate90FlipXY = Rotate270FlipNone,
+ Rotate180FlipXY = RotateNoneFlipNone,
+ Rotate270FlipXY = Rotate90FlipNone
+};
+
+//---------------------------------------------------------------------------
+// Encoder Parameter structure
+//---------------------------------------------------------------------------
+class EncoderParameter
+{
+public:
+ GUID Guid; // GUID of the parameter
+ ULONG NumberOfValues; // Number of the parameter values
+ ULONG Type; // Value type, like ValueTypeLONG etc.
+ VOID* Value; // A pointer to the parameter values
+};
+
+//---------------------------------------------------------------------------
+// Encoder Parameters structure
+//---------------------------------------------------------------------------
+class EncoderParameters
+{
+public:
+ UINT Count; // Number of parameters in this structure
+ EncoderParameter Parameter[1]; // Parameter values
+};
+
+//---------------------------------------------------------------------------
+// Property Item
+//---------------------------------------------------------------------------
+class PropertyItem
+{
+public:
+ PROPID id; // ID of this property
+ ULONG length; // Length of the property value, in bytes
+ WORD type; // Type of the value, as one of TAG_TYPE_XXX
+ // defined above
+ VOID* value; // property value
+};
+
+#ifdef DCR_USE_NEW_140857
+//---------------------------------------------------------------------------
+// Image property types
+//---------------------------------------------------------------------------
+#define PropertyTagTypeByte 1
+#define PropertyTagTypeASCII 2
+#define PropertyTagTypeShort 3
+#define PropertyTagTypeLong 4
+#define PropertyTagTypeRational 5
+#define PropertyTagTypeUndefined 7
+#define PropertyTagTypeSLONG 9
+#define PropertyTagTypeSRational 10
+#endif
+
+//---------------------------------------------------------------------------
+// Image property ID tags
+//---------------------------------------------------------------------------
+
+#define PropertyTagExifIFD 0x8769
+#define PropertyTagGpsIFD 0x8825
+
+#define PropertyTagNewSubfileType 0x00FE
+#define PropertyTagSubfileType 0x00FF
+#define PropertyTagImageWidth 0x0100
+#define PropertyTagImageHeight 0x0101
+#define PropertyTagBitsPerSample 0x0102
+#define PropertyTagCompression 0x0103
+#define PropertyTagPhotometricInterp 0x0106
+#define PropertyTagThreshHolding 0x0107
+#define PropertyTagCellWidth 0x0108
+#define PropertyTagCellHeight 0x0109
+#define PropertyTagFillOrder 0x010A
+#define PropertyTagDocumentName 0x010D
+#define PropertyTagImageDescription 0x010E
+#define PropertyTagEquipMake 0x010F
+#define PropertyTagEquipModel 0x0110
+#define PropertyTagStripOffsets 0x0111
+#define PropertyTagOrientation 0x0112
+#define PropertyTagSamplesPerPixel 0x0115
+#define PropertyTagRowsPerStrip 0x0116
+#define PropertyTagStripBytesCount 0x0117
+#define PropertyTagMinSampleValue 0x0118
+#define PropertyTagMaxSampleValue 0x0119
+#define PropertyTagXResolution 0x011A // Image resolution in width direction
+#define PropertyTagYResolution 0x011B // Image resolution in height direction
+#define PropertyTagPlanarConfig 0x011C // Image data arrangement
+#define PropertyTagPageName 0x011D
+#define PropertyTagXPosition 0x011E
+#define PropertyTagYPosition 0x011F
+#define PropertyTagFreeOffset 0x0120
+#define PropertyTagFreeByteCounts 0x0121
+#define PropertyTagGrayResponseUnit 0x0122
+#define PropertyTagGrayResponseCurve 0x0123
+#define PropertyTagT4Option 0x0124
+#define PropertyTagT6Option 0x0125
+#define PropertyTagResolutionUnit 0x0128 // Unit of X and Y resolution
+#define PropertyTagPageNumber 0x0129
+#define PropertyTagTransferFuncition 0x012D
+#define PropertyTagSoftwareUsed 0x0131
+#define PropertyTagDateTime 0x0132
+#define PropertyTagArtist 0x013B
+#define PropertyTagHostComputer 0x013C
+#define PropertyTagPredictor 0x013D
+#define PropertyTagWhitePoint 0x013E
+#define PropertyTagPrimaryChromaticities 0x013F
+#define PropertyTagColorMap 0x0140
+#define PropertyTagHalftoneHints 0x0141
+#define PropertyTagTileWidth 0x0142
+#define PropertyTagTileLength 0x0143
+#define PropertyTagTileOffset 0x0144
+#define PropertyTagTileByteCounts 0x0145
+#define PropertyTagInkSet 0x014C
+#define PropertyTagInkNames 0x014D
+#define PropertyTagNumberOfInks 0x014E
+#define PropertyTagDotRange 0x0150
+#define PropertyTagTargetPrinter 0x0151
+#define PropertyTagExtraSamples 0x0152
+#define PropertyTagSampleFormat 0x0153
+#define PropertyTagSMinSampleValue 0x0154
+#define PropertyTagSMaxSampleValue 0x0155
+#define PropertyTagTransferRange 0x0156
+
+#define PropertyTagJPEGProc 0x0200
+#define PropertyTagJPEGInterFormat 0x0201
+#define PropertyTagJPEGInterLength 0x0202
+#define PropertyTagJPEGRestartInterval 0x0203
+#define PropertyTagJPEGLosslessPredictors 0x0205
+#define PropertyTagJPEGPointTransforms 0x0206
+#define PropertyTagJPEGQTables 0x0207
+#define PropertyTagJPEGDCTables 0x0208
+#define PropertyTagJPEGACTables 0x0209
+
+#define PropertyTagYCbCrCoefficients 0x0211
+#define PropertyTagYCbCrSubsampling 0x0212
+#define PropertyTagYCbCrPositioning 0x0213
+#define PropertyTagREFBlackWhite 0x0214
+
+#define PropertyTagICCProfile 0x8773 // This TAG is defined by ICC
+ // for embedded ICC in TIFF
+#define PropertyTagGamma 0x0301
+#define PropertyTagICCProfileDescriptor 0x0302
+#define PropertyTagSRGBRenderingIntent 0x0303
+
+#define PropertyTagImageTitle 0x0320
+#define PropertyTagCopyright 0x8298
+
+// Extra TAGs (Like Adobe Image Information tags etc.)
+
+#define PropertyTagResolutionXUnit 0x5001
+#define PropertyTagResolutionYUnit 0x5002
+#define PropertyTagResolutionXLengthUnit 0x5003
+#define PropertyTagResolutionYLengthUnit 0x5004
+#define PropertyTagPrintFlags 0x5005
+#define PropertyTagPrintFlagsVersion 0x5006
+#define PropertyTagPrintFlagsCrop 0x5007
+#define PropertyTagPrintFlagsBleedWidth 0x5008
+#define PropertyTagPrintFlagsBleedWidthScale 0x5009
+#define PropertyTagHalftoneLPI 0x500A
+#define PropertyTagHalftoneLPIUnit 0x500B
+#define PropertyTagHalftoneDegree 0x500C
+#define PropertyTagHalftoneShape 0x500D
+#define PropertyTagHalftoneMisc 0x500E
+#define PropertyTagHalftoneScreen 0x500F
+#define PropertyTagJPEGQuality 0x5010
+#define PropertyTagGridSize 0x5011
+#define PropertyTagThumbnailFormat 0x5012 // 1 = JPEG, 0 = RAW RGB
+#define PropertyTagThumbnailWidth 0x5013
+#define PropertyTagThumbnailHeight 0x5014
+#define PropertyTagThumbnailColorDepth 0x5015
+#define PropertyTagThumbnailPlanes 0x5016
+#define PropertyTagThumbnailRawBytes 0x5017
+#define PropertyTagThumbnailSize 0x5018
+#define PropertyTagThumbnailCompressedSize 0x5019
+#define PropertyTagColorTransferFunction 0x501A
+#define PropertyTagThumbnailData 0x501B// RAW thumbnail bits in
+ // JPEG format or RGB format
+ // depends on
+ // PropertyTagThumbnailFormat
+
+// Thumbnail related TAGs
+
+#define PropertyTagThumbnailImageWidth 0x5020 // Thumbnail width
+#define PropertyTagThumbnailImageHeight 0x5021 // Thumbnail height
+#define PropertyTagThumbnailBitsPerSample 0x5022 // Number of bits per
+ // component
+#define PropertyTagThumbnailCompression 0x5023 // Compression Scheme
+#define PropertyTagThumbnailPhotometricInterp 0x5024 // Pixel composition
+#define PropertyTagThumbnailImageDescription 0x5025 // Image Tile
+#define PropertyTagThumbnailEquipMake 0x5026 // Manufacturer of Image
+ // Input equipment
+#define PropertyTagThumbnailEquipModel 0x5027 // Model of Image input
+ // equipment
+#define PropertyTagThumbnailStripOffsets 0x5028 // Image data location
+#define PropertyTagThumbnailOrientation 0x5029 // Orientation of image
+#define PropertyTagThumbnailSamplesPerPixel 0x502A // Number of components
+#define PropertyTagThumbnailRowsPerStrip 0x502B // Number of rows per strip
+#define PropertyTagThumbnailStripBytesCount 0x502C // Bytes per compressed
+ // strip
+#define PropertyTagThumbnailResolutionX 0x502D // Resolution in width
+ // direction
+#define PropertyTagThumbnailResolutionY 0x502E // Resolution in height
+ // direction
+#define PropertyTagThumbnailPlanarConfig 0x502F // Image data arrangement
+#define PropertyTagThumbnailResolutionUnit 0x5030 // Unit of X and Y
+ // Resolution
+#define PropertyTagThumbnailTransferFunction 0x5031 // Transfer function
+#define PropertyTagThumbnailSoftwareUsed 0x5032 // Software used
+#define PropertyTagThumbnailDateTime 0x5033 // File change date and
+ // time
+#define PropertyTagThumbnailArtist 0x5034 // Person who created the
+ // image
+#define PropertyTagThumbnailWhitePoint 0x5035 // White point chromaticity
+#define PropertyTagThumbnailPrimaryChromaticities 0x5036
+ // Chromaticities of
+ // primaries
+#define PropertyTagThumbnailYCbCrCoefficients 0x5037 // Color space transforma-
+ // tion coefficients
+#define PropertyTagThumbnailYCbCrSubsampling 0x5038 // Subsampling ratio of Y
+ // to C
+#define PropertyTagThumbnailYCbCrPositioning 0x5039 // Y and C position
+#define PropertyTagThumbnailRefBlackWhite 0x503A // Pair of black and white
+ // reference values
+#define PropertyTagThumbnailCopyRight 0x503B // CopyRight holder
+
+#define PropertyTagLuminanceTable 0x5090
+#define PropertyTagChrominanceTable 0x5091
+
+#define PropertyTagFrameDelay 0x5100
+#define PropertyTagLoopCount 0x5101
+
+#define PropertyTagPixelUnit 0x5110 // Unit specifier for pixel/unit
+#define PropertyTagPixelPerUnitX 0x5111 // Pixels per unit in X
+#define PropertyTagPixelPerUnitY 0x5112 // Pixels per unit in Y
+#define PropertyTagPaletteHistogram 0x5113 // Palette histogram
+
+// EXIF specific tag
+
+#define PropertyTagExifExposureTime 0x829A
+#define PropertyTagExifFNumber 0x829D
+
+#define PropertyTagExifExposureProg 0x8822
+#define PropertyTagExifSpectralSense 0x8824
+#define PropertyTagExifISOSpeed 0x8827
+#define PropertyTagExifOECF 0x8828
+
+#define PropertyTagExifVer 0x9000
+#define PropertyTagExifDTOrig 0x9003 // Date & time of original
+#define PropertyTagExifDTDigitized 0x9004 // Date & time of digital data generation
+
+#define PropertyTagExifCompConfig 0x9101
+#define PropertyTagExifCompBPP 0x9102
+
+#define PropertyTagExifShutterSpeed 0x9201
+#define PropertyTagExifAperture 0x9202
+#define PropertyTagExifBrightness 0x9203
+#define PropertyTagExifExposureBias 0x9204
+#define PropertyTagExifMaxAperture 0x9205
+#define PropertyTagExifSubjectDist 0x9206
+#define PropertyTagExifMeteringMode 0x9207
+#define PropertyTagExifLightSource 0x9208
+#define PropertyTagExifFlash 0x9209
+#define PropertyTagExifFocalLength 0x920A
+#define PropertyTagExifMakerNote 0x927C
+#define PropertyTagExifUserComment 0x9286
+#define PropertyTagExifDTSubsec 0x9290 // Date & Time subseconds
+#define PropertyTagExifDTOrigSS 0x9291 // Date & Time original subseconds
+#define PropertyTagExifDTDigSS 0x9292 // Date & TIme digitized subseconds
+
+#define PropertyTagExifFPXVer 0xA000
+#define PropertyTagExifColorSpace 0xA001
+#define PropertyTagExifPixXDim 0xA002
+#define PropertyTagExifPixYDim 0xA003
+#define PropertyTagExifRelatedWav 0xA004 // related sound file
+#define PropertyTagExifInterop 0xA005
+#define PropertyTagExifFlashEnergy 0xA20B
+#define PropertyTagExifSpatialFR 0xA20C // Spatial Frequency Response
+#define PropertyTagExifFocalXRes 0xA20E // Focal Plane X Resolution
+#define PropertyTagExifFocalYRes 0xA20F // Focal Plane Y Resolution
+#define PropertyTagExifFocalResUnit 0xA210 // Focal Plane Resolution Unit
+#define PropertyTagExifSubjectLoc 0xA214
+#define PropertyTagExifExposureIndex 0xA215
+#define PropertyTagExifSensingMethod 0xA217
+#define PropertyTagExifFileSource 0xA300
+#define PropertyTagExifSceneType 0xA301
+#define PropertyTagExifCfaPattern 0xA302
+
+#define PropertyTagGpsVer 0x0000
+#define PropertyTagGpsLatitudeRef 0x0001
+#define PropertyTagGpsLatitude 0x0002
+#define PropertyTagGpsLongitudeRef 0x0003
+#define PropertyTagGpsLongitude 0x0004
+#define PropertyTagGpsAltitudeRef 0x0005
+#define PropertyTagGpsAltitude 0x0006
+#define PropertyTagGpsGpsTime 0x0007
+#define PropertyTagGpsGpsSatellites 0x0008
+#define PropertyTagGpsGpsStatus 0x0009
+#define PropertyTagGpsGpsMeasureMode 0x00A
+#define PropertyTagGpsGpsDop 0x000B // Measurement precision
+#define PropertyTagGpsSpeedRef 0x000C
+#define PropertyTagGpsSpeed 0x000D
+#define PropertyTagGpsTrackRef 0x000E
+#define PropertyTagGpsTrack 0x000F
+#define PropertyTagGpsImgDirRef 0x0010
+#define PropertyTagGpsImgDir 0x0011
+#define PropertyTagGpsMapDatum 0x0012
+#define PropertyTagGpsDestLatRef 0x0013
+#define PropertyTagGpsDestLat 0x0014
+#define PropertyTagGpsDestLongRef 0x0015
+#define PropertyTagGpsDestLong 0x0016
+#define PropertyTagGpsDestBearRef 0x0017
+#define PropertyTagGpsDestBear 0x0018
+#define PropertyTagGpsDestDistRef 0x0019
+#define PropertyTagGpsDestDist 0x001A
+
+#endif
diff --git a/core/src/fxge/Microsoft SDK/include/GdiPlusLineCaps.h b/core/src/fxge/Microsoft SDK/include/GdiPlusLineCaps.h
index e8a2951f43..5ac880f59a 100644
--- a/core/src/fxge/Microsoft SDK/include/GdiPlusLineCaps.h
+++ b/core/src/fxge/Microsoft SDK/include/GdiPlusLineCaps.h
@@ -1,253 +1,253 @@
-/**************************************************************************\
-*
-* Copyright (c) 2000, Microsoft Corp. All Rights Reserved.
-*
-* Module Name:
-*
-* GdiplusLineCaps.h
-*
-* Abstract:
-*
-* APIs for Custom Line Caps
-*
-\**************************************************************************/
-
-#ifndef _GDIPLUSLINECAPS_H
-#define _GDIPLUSLINECAPS_H
-
-inline
-CustomLineCap::CustomLineCap(
- IN const GraphicsPath* fillPath,
- IN const GraphicsPath* strokePath,
- IN LineCap baseCap,
- IN REAL baseInset
- )
-{
- nativeCap = NULL;
- GpPath* nativeFillPath = NULL;
- GpPath* nativeStrokePath = NULL;
-
- if(fillPath)
- nativeFillPath = fillPath->nativePath;
- if(strokePath)
- nativeStrokePath = strokePath->nativePath;
-
- lastResult = DllExports::GdipCreateCustomLineCap(
- nativeFillPath, nativeStrokePath,
- baseCap, baseInset, &nativeCap);
-}
-
-inline
-CustomLineCap::CustomLineCap()
-{
- // This is used for default constructor for subclasses.
- // So don't create a nativeCap.
-
- nativeCap = NULL;
- lastResult = Ok;
-}
-
-inline
-CustomLineCap::~CustomLineCap()
-{
- DllExports::GdipDeleteCustomLineCap(nativeCap);
-}
-
-inline Status
-CustomLineCap::SetStrokeCaps(
- IN LineCap startCap,
- IN LineCap endCap)
-{
- return SetStatus(DllExports::GdipSetCustomLineCapStrokeCaps(nativeCap,
- startCap, endCap));
-}
-
-inline Status
-CustomLineCap::GetStrokeCaps(
- OUT LineCap* startCap,
- OUT LineCap* endCap) const
-{
- return SetStatus(DllExports::GdipGetCustomLineCapStrokeCaps(nativeCap,
- startCap, endCap));
-}
-
-inline Status
-CustomLineCap::SetStrokeJoin(
- IN LineJoin lineJoin)
-{
- return SetStatus(DllExports::GdipSetCustomLineCapStrokeJoin(nativeCap, lineJoin));
-}
-
-inline LineJoin
-CustomLineCap::GetStrokeJoin() const
-{
- LineJoin lineJoin;
-
- SetStatus(DllExports::GdipGetCustomLineCapStrokeJoin(nativeCap, &lineJoin));
-
- return lineJoin;
-}
-
-inline Status
-CustomLineCap::SetBaseCap(IN LineCap baseCap)
-{
- return SetStatus(DllExports::GdipSetCustomLineCapBaseCap(nativeCap, baseCap));
-}
-
-inline LineCap
-CustomLineCap::GetBaseCap() const
-{
- LineCap baseCap;
- SetStatus(DllExports::GdipGetCustomLineCapBaseCap(nativeCap, &baseCap));
-
- return baseCap;
-}
-
-inline Status
-CustomLineCap::SetBaseInset(IN REAL inset)
-{
- return SetStatus(DllExports::GdipSetCustomLineCapBaseInset(nativeCap, inset));
-}
-
-inline REAL
-CustomLineCap::GetBaseInset() const
-{
- REAL inset;
- SetStatus(DllExports::GdipGetCustomLineCapBaseInset(nativeCap, &inset));
-
- return inset;
-}
-
-
-inline Status
-CustomLineCap::SetWidthScale(IN REAL widthScale)
-{
- return SetStatus(DllExports::GdipSetCustomLineCapWidthScale(nativeCap, widthScale));
-}
-
-inline REAL
-CustomLineCap::GetWidthScale() const
-{
- REAL widthScale;
- SetStatus(DllExports::GdipGetCustomLineCapWidthScale(nativeCap, &widthScale));
-
- return widthScale;
-}
-
-inline CustomLineCap*
-CustomLineCap::Clone() const
-{
- GpCustomLineCap *newNativeLineCap = NULL;
-
- SetStatus(DllExports::GdipCloneCustomLineCap(nativeCap, &newNativeLineCap));
-
- if (lastResult == Ok)
- {
- CustomLineCap *newLineCap = new CustomLineCap(newNativeLineCap, lastResult);
- if (newLineCap == NULL)
- {
- SetStatus(DllExports::GdipDeleteCustomLineCap(newNativeLineCap));
- }
-
- return newLineCap;
- }
-
- return NULL;
-}
-
-class AdjustableArrowCap : public CustomLineCap
-{
-public:
-
- AdjustableArrowCap(
- IN REAL height,
- IN REAL width,
- IN BOOL isFilled = TRUE
- )
- {
- GpAdjustableArrowCap* cap = NULL;
-
- lastResult = DllExports::GdipCreateAdjustableArrowCap(
- height, width, isFilled, &cap);
- SetNativeCap(cap);
- }
-
- Status SetHeight(IN REAL height)
- {
- GpAdjustableArrowCap* cap = (GpAdjustableArrowCap*) nativeCap;
- return SetStatus(DllExports::GdipSetAdjustableArrowCapHeight(
- cap, height));
- }
-
- REAL GetHeight() const
- {
- GpAdjustableArrowCap* cap = (GpAdjustableArrowCap*) nativeCap;
- REAL height;
- SetStatus(DllExports::GdipGetAdjustableArrowCapHeight(
- cap, &height));
-
- return height;
- }
-
- Status SetWidth(IN REAL width)
- {
- GpAdjustableArrowCap* cap = (GpAdjustableArrowCap*) nativeCap;
- return SetStatus(DllExports::GdipSetAdjustableArrowCapWidth(
- cap, width));
- }
-
- REAL GetWidth() const
- {
- GpAdjustableArrowCap* cap = (GpAdjustableArrowCap*) nativeCap;
- REAL width;
- SetStatus(DllExports::GdipGetAdjustableArrowCapWidth(
- cap, &width));
-
- return width;
- }
-
- Status SetMiddleInset(IN REAL middleInset)
- {
- GpAdjustableArrowCap* cap = (GpAdjustableArrowCap*) nativeCap;
- return SetStatus(DllExports::GdipSetAdjustableArrowCapMiddleInset(
- cap, middleInset));
- }
-
- REAL GetMiddleInset() const
- {
- GpAdjustableArrowCap* cap = (GpAdjustableArrowCap*) nativeCap;
- REAL middleInset;
- SetStatus(DllExports::GdipGetAdjustableArrowCapMiddleInset(
- cap, &middleInset));
-
- return middleInset;
- }
-
- Status SetFillState(IN BOOL isFilled)
- {
- GpAdjustableArrowCap* cap = (GpAdjustableArrowCap*) nativeCap;
- return SetStatus(DllExports::GdipSetAdjustableArrowCapFillState(
- cap, isFilled));
- }
-
- BOOL IsFilled() const
- {
- GpAdjustableArrowCap* cap = (GpAdjustableArrowCap*) nativeCap;
- BOOL isFilled;
- SetStatus(DllExports::GdipGetAdjustableArrowCapFillState(
- cap, &isFilled));
-
- return isFilled;
- }
-
-#ifdef DCR_USE_NEW_250932
-
-private:
- AdjustableArrowCap(const AdjustableArrowCap &);
- AdjustableArrowCap& operator=(const AdjustableArrowCap &);
-
-#endif
-
-};
-
-#endif
+/**************************************************************************\
+*
+* Copyright (c) 2000, Microsoft Corp. All Rights Reserved.
+*
+* Module Name:
+*
+* GdiplusLineCaps.h
+*
+* Abstract:
+*
+* APIs for Custom Line Caps
+*
+\**************************************************************************/
+
+#ifndef _GDIPLUSLINECAPS_H
+#define _GDIPLUSLINECAPS_H
+
+inline
+CustomLineCap::CustomLineCap(
+ IN const GraphicsPath* fillPath,
+ IN const GraphicsPath* strokePath,
+ IN LineCap baseCap,
+ IN REAL baseInset
+ )
+{
+ nativeCap = NULL;
+ GpPath* nativeFillPath = NULL;
+ GpPath* nativeStrokePath = NULL;
+
+ if(fillPath)
+ nativeFillPath = fillPath->nativePath;
+ if(strokePath)
+ nativeStrokePath = strokePath->nativePath;
+
+ lastResult = DllExports::GdipCreateCustomLineCap(
+ nativeFillPath, nativeStrokePath,
+ baseCap, baseInset, &nativeCap);
+}
+
+inline
+CustomLineCap::CustomLineCap()
+{
+ // This is used for default constructor for subclasses.
+ // So don't create a nativeCap.
+
+ nativeCap = NULL;
+ lastResult = Ok;
+}
+
+inline
+CustomLineCap::~CustomLineCap()
+{
+ DllExports::GdipDeleteCustomLineCap(nativeCap);
+}
+
+inline Status
+CustomLineCap::SetStrokeCaps(
+ IN LineCap startCap,
+ IN LineCap endCap)
+{
+ return SetStatus(DllExports::GdipSetCustomLineCapStrokeCaps(nativeCap,
+ startCap, endCap));
+}
+
+inline Status
+CustomLineCap::GetStrokeCaps(
+ OUT LineCap* startCap,
+ OUT LineCap* endCap) const
+{
+ return SetStatus(DllExports::GdipGetCustomLineCapStrokeCaps(nativeCap,
+ startCap, endCap));
+}
+
+inline Status
+CustomLineCap::SetStrokeJoin(
+ IN LineJoin lineJoin)
+{
+ return SetStatus(DllExports::GdipSetCustomLineCapStrokeJoin(nativeCap, lineJoin));
+}
+
+inline LineJoin
+CustomLineCap::GetStrokeJoin() const
+{
+ LineJoin lineJoin;
+
+ SetStatus(DllExports::GdipGetCustomLineCapStrokeJoin(nativeCap, &lineJoin));
+
+ return lineJoin;
+}
+
+inline Status
+CustomLineCap::SetBaseCap(IN LineCap baseCap)
+{
+ return SetStatus(DllExports::GdipSetCustomLineCapBaseCap(nativeCap, baseCap));
+}
+
+inline LineCap
+CustomLineCap::GetBaseCap() const
+{
+ LineCap baseCap;
+ SetStatus(DllExports::GdipGetCustomLineCapBaseCap(nativeCap, &baseCap));
+
+ return baseCap;
+}
+
+inline Status
+CustomLineCap::SetBaseInset(IN REAL inset)
+{
+ return SetStatus(DllExports::GdipSetCustomLineCapBaseInset(nativeCap, inset));
+}
+
+inline REAL
+CustomLineCap::GetBaseInset() const
+{
+ REAL inset;
+ SetStatus(DllExports::GdipGetCustomLineCapBaseInset(nativeCap, &inset));
+
+ return inset;
+}
+
+
+inline Status
+CustomLineCap::SetWidthScale(IN REAL widthScale)
+{
+ return SetStatus(DllExports::GdipSetCustomLineCapWidthScale(nativeCap, widthScale));
+}
+
+inline REAL
+CustomLineCap::GetWidthScale() const
+{
+ REAL widthScale;
+ SetStatus(DllExports::GdipGetCustomLineCapWidthScale(nativeCap, &widthScale));
+
+ return widthScale;
+}
+
+inline CustomLineCap*
+CustomLineCap::Clone() const
+{
+ GpCustomLineCap *newNativeLineCap = NULL;
+
+ SetStatus(DllExports::GdipCloneCustomLineCap(nativeCap, &newNativeLineCap));
+
+ if (lastResult == Ok)
+ {
+ CustomLineCap *newLineCap = new CustomLineCap(newNativeLineCap, lastResult);
+ if (newLineCap == NULL)
+ {
+ SetStatus(DllExports::GdipDeleteCustomLineCap(newNativeLineCap));
+ }
+
+ return newLineCap;
+ }
+
+ return NULL;
+}
+
+class AdjustableArrowCap : public CustomLineCap
+{
+public:
+
+ AdjustableArrowCap(
+ IN REAL height,
+ IN REAL width,
+ IN BOOL isFilled = TRUE
+ )
+ {
+ GpAdjustableArrowCap* cap = NULL;
+
+ lastResult = DllExports::GdipCreateAdjustableArrowCap(
+ height, width, isFilled, &cap);
+ SetNativeCap(cap);
+ }
+
+ Status SetHeight(IN REAL height)
+ {
+ GpAdjustableArrowCap* cap = (GpAdjustableArrowCap*) nativeCap;
+ return SetStatus(DllExports::GdipSetAdjustableArrowCapHeight(
+ cap, height));
+ }
+
+ REAL GetHeight() const
+ {
+ GpAdjustableArrowCap* cap = (GpAdjustableArrowCap*) nativeCap;
+ REAL height;
+ SetStatus(DllExports::GdipGetAdjustableArrowCapHeight(
+ cap, &height));
+
+ return height;
+ }
+
+ Status SetWidth(IN REAL width)
+ {
+ GpAdjustableArrowCap* cap = (GpAdjustableArrowCap*) nativeCap;
+ return SetStatus(DllExports::GdipSetAdjustableArrowCapWidth(
+ cap, width));
+ }
+
+ REAL GetWidth() const
+ {
+ GpAdjustableArrowCap* cap = (GpAdjustableArrowCap*) nativeCap;
+ REAL width;
+ SetStatus(DllExports::GdipGetAdjustableArrowCapWidth(
+ cap, &width));
+
+ return width;
+ }
+
+ Status SetMiddleInset(IN REAL middleInset)
+ {
+ GpAdjustableArrowCap* cap = (GpAdjustableArrowCap*) nativeCap;
+ return SetStatus(DllExports::GdipSetAdjustableArrowCapMiddleInset(
+ cap, middleInset));
+ }
+
+ REAL GetMiddleInset() const
+ {
+ GpAdjustableArrowCap* cap = (GpAdjustableArrowCap*) nativeCap;
+ REAL middleInset;
+ SetStatus(DllExports::GdipGetAdjustableArrowCapMiddleInset(
+ cap, &middleInset));
+
+ return middleInset;
+ }
+
+ Status SetFillState(IN BOOL isFilled)
+ {
+ GpAdjustableArrowCap* cap = (GpAdjustableArrowCap*) nativeCap;
+ return SetStatus(DllExports::GdipSetAdjustableArrowCapFillState(
+ cap, isFilled));
+ }
+
+ BOOL IsFilled() const
+ {
+ GpAdjustableArrowCap* cap = (GpAdjustableArrowCap*) nativeCap;
+ BOOL isFilled;
+ SetStatus(DllExports::GdipGetAdjustableArrowCapFillState(
+ cap, &isFilled));
+
+ return isFilled;
+ }
+
+#ifdef DCR_USE_NEW_250932
+
+private:
+ AdjustableArrowCap(const AdjustableArrowCap &);
+ AdjustableArrowCap& operator=(const AdjustableArrowCap &);
+
+#endif
+
+};
+
+#endif
diff --git a/core/src/fxge/Microsoft SDK/include/GdiPlusMatrix.h b/core/src/fxge/Microsoft SDK/include/GdiPlusMatrix.h
index 7fa3df8cd1..1338d8c1ac 100644
--- a/core/src/fxge/Microsoft SDK/include/GdiPlusMatrix.h
+++ b/core/src/fxge/Microsoft SDK/include/GdiPlusMatrix.h
@@ -1,309 +1,309 @@
-/**************************************************************************\
-*
-* Copyright (c) 1998-2000, Microsoft Corp. All Rights Reserved.
-*
-* Module Name:
-*
-* GdiplusMatrix.h
-*
-* Abstract:
-*
-* GDI+ Matrix class
-*
-\**************************************************************************/
-
-class Matrix : public GdiplusBase
-{
-public:
- friend class Graphics;
- friend class GraphicsPath;
- friend class TextureBrush;
- friend class LinearGradientBrush;
- friend class PathGradientBrush;
- friend class Pen;
- friend class Region;
-
- // Default constructor - set to identity matrix
-
- Matrix()
- {
- GpMatrix *matrix = NULL;
-
- lastResult = DllExports::GdipCreateMatrix(&matrix);
-
- SetNativeMatrix(matrix);
- }
-
- Matrix(IN REAL m11,
- IN REAL m12,
- IN REAL m21,
- IN REAL m22,
- IN REAL dx,
- IN REAL dy)
- {
- GpMatrix *matrix = NULL;
-
- lastResult = DllExports::GdipCreateMatrix2(m11, m12, m21, m22,
- dx, dy, &matrix);
-
- SetNativeMatrix(matrix);
- }
-
- Matrix(IN const RectF& rect,
- IN const PointF* dstplg)
- {
- GpMatrix *matrix = NULL;
-
- lastResult = DllExports::GdipCreateMatrix3(&rect,
- dstplg,
- &matrix);
-
- SetNativeMatrix(matrix);
- }
-
- Matrix(IN const Rect& rect,
- IN const Point* dstplg)
- {
- GpMatrix *matrix = NULL;
-
- lastResult = DllExports::GdipCreateMatrix3I(&rect,
- dstplg,
- &matrix);
-
- SetNativeMatrix(matrix);
- }
-
- ~Matrix()
- {
- DllExports::GdipDeleteMatrix(nativeMatrix);
- }
-
- Matrix *Clone() const
- {
- GpMatrix *cloneMatrix = NULL;
-
- SetStatus(DllExports::GdipCloneMatrix(nativeMatrix,
- &cloneMatrix));
-
- if (lastResult != Ok)
- return NULL;
-
- return new Matrix(cloneMatrix);
- }
-
- Status GetElements(OUT REAL *m) const
- {
- return SetStatus(DllExports::GdipGetMatrixElements(nativeMatrix, m));
- }
-
- Status SetElements(IN REAL m11,
- IN REAL m12,
- IN REAL m21,
- IN REAL m22,
- IN REAL dx,
- IN REAL dy)
- {
- return SetStatus(DllExports::GdipSetMatrixElements(nativeMatrix,
- m11, m12, m21, m22, dx, dy));
- }
-
- REAL OffsetX() const
- {
- REAL elements[6];
-
- if (GetElements(&elements[0]) == Ok)
- return elements[4];
- else
- return 0.0f;
- }
-
- REAL OffsetY() const
- {
- REAL elements[6];
-
- if (GetElements(&elements[0]) == Ok)
- return elements[5];
- else
- return 0.0f;
- }
-
- Status Reset()
- {
- // set identity matrix elements
- return SetStatus(DllExports::GdipSetMatrixElements(nativeMatrix,
- 1.0, 0.0, 0.0, 1.0, 0.0, 0.0));
- }
-
- Status Multiply(IN const Matrix *matrix,
- IN MatrixOrder order = MatrixOrderPrepend)
- {
- return SetStatus(DllExports::GdipMultiplyMatrix(nativeMatrix,
- matrix->nativeMatrix,
- order));
- }
-
- Status Translate(IN REAL offsetX,
- IN REAL offsetY,
- IN MatrixOrder order = MatrixOrderPrepend)
- {
- return SetStatus(DllExports::GdipTranslateMatrix(nativeMatrix, offsetX, offsetY, order));
- }
-
- Status Scale(IN REAL scaleX,
- IN REAL scaleY,
- IN MatrixOrder order = MatrixOrderPrepend)
- {
- return SetStatus(DllExports::GdipScaleMatrix(nativeMatrix, scaleX, scaleY, order));
- }
-
- Status Rotate(IN REAL angle,
- IN MatrixOrder order = MatrixOrderPrepend)
- {
- return SetStatus(DllExports::GdipRotateMatrix(nativeMatrix, angle, order));
- }
-
- Status RotateAt(IN REAL angle,
- IN const PointF& center,
- IN MatrixOrder order = MatrixOrderPrepend)
- {
- if(order == MatrixOrderPrepend)
- {
- SetStatus(DllExports::GdipTranslateMatrix(nativeMatrix, center.X, center.Y, order));
- SetStatus(DllExports::GdipRotateMatrix(nativeMatrix, angle, order));
- return SetStatus(DllExports::GdipTranslateMatrix(nativeMatrix, - center.X, - center.Y, order));
- }
- else
- {
- SetStatus(DllExports::GdipTranslateMatrix(nativeMatrix, - center.X, - center.Y, order));
- SetStatus(DllExports::GdipRotateMatrix(nativeMatrix, angle, order));
- return SetStatus(DllExports::GdipTranslateMatrix(nativeMatrix, center.X, center.Y, order));
- }
- }
-
- Status Shear(IN REAL shearX,
- IN REAL shearY,
- IN MatrixOrder order = MatrixOrderPrepend)
- {
- return SetStatus(DllExports::GdipShearMatrix(nativeMatrix, shearX, shearY, order));
- }
-
- Status Invert()
- {
- return SetStatus(DllExports::GdipInvertMatrix(nativeMatrix));
- }
-
- // float version
- Status TransformPoints(IN OUT PointF* pts,
- IN INT count = 1) const
- {
- return SetStatus(DllExports::GdipTransformMatrixPoints(nativeMatrix, pts, count));
- }
-
- Status TransformPoints(IN OUT Point* pts,
- IN INT count = 1) const
- {
- return SetStatus(DllExports::GdipTransformMatrixPointsI(nativeMatrix,
- pts,
- count));
- }
-
- Status TransformVectors(IN OUT PointF* pts,
- IN INT count = 1) const
- {
- return SetStatus(DllExports::GdipVectorTransformMatrixPoints(nativeMatrix, pts, count));
- }
-
- Status TransformVectors(IN OUT Point* pts,
- IN INT count = 1) const
- {
- return SetStatus(DllExports::GdipVectorTransformMatrixPointsI(nativeMatrix,
- pts,
- count));
- }
-
- BOOL IsInvertible() const
- {
- BOOL result = FALSE;
-
- SetStatus(DllExports::GdipIsMatrixInvertible(nativeMatrix, &result));
-
- return result;
- }
-
- BOOL IsIdentity() const
- {
- BOOL result = FALSE;
-
- SetStatus(DllExports::GdipIsMatrixIdentity(nativeMatrix, &result));
-
- return result;
- }
-
- BOOL Equals(IN const Matrix *matrix) const
- {
- BOOL result = FALSE;
-
- SetStatus(DllExports::GdipIsMatrixEqual(nativeMatrix,
- matrix->nativeMatrix, &result));
-
- return result;
- }
-
- Status GetLastStatus() const
- {
- Status lastStatus = lastResult;
- lastResult = Ok;
-
- return lastStatus;
- }
-
-protected:
-
-#ifdef DCR_USE_NEW_250932
-
-private:
- Matrix(const Matrix &);
- Matrix& operator=(const Matrix &);
-protected:
-
-#else
-
- Matrix(const Matrix& matrix)
- {
- matrix;
- SetStatus(NotImplemented);
- SetNativeMatrix(NULL);
- }
-
- Matrix& operator=(const Matrix& matrix)
- {
- matrix;
- SetStatus(NotImplemented);
- return *this;
- }
-
-#endif
-
- Matrix(GpMatrix *nativeMatrix)
- {
- lastResult = Ok;
- SetNativeMatrix(nativeMatrix);
- }
-
- VOID SetNativeMatrix(GpMatrix *nativeMatrix)
- {
- this->nativeMatrix = nativeMatrix;
- }
-
- Status SetStatus(Status status) const
- {
- if (status != Ok)
- return (lastResult = status);
- else
- return status;
- }
-
-protected:
- GpMatrix *nativeMatrix;
- mutable Status lastResult;
-};
+/**************************************************************************\
+*
+* Copyright (c) 1998-2000, Microsoft Corp. All Rights Reserved.
+*
+* Module Name:
+*
+* GdiplusMatrix.h
+*
+* Abstract:
+*
+* GDI+ Matrix class
+*
+\**************************************************************************/
+
+class Matrix : public GdiplusBase
+{
+public:
+ friend class Graphics;
+ friend class GraphicsPath;
+ friend class TextureBrush;
+ friend class LinearGradientBrush;
+ friend class PathGradientBrush;
+ friend class Pen;
+ friend class Region;
+
+ // Default constructor - set to identity matrix
+
+ Matrix()
+ {
+ GpMatrix *matrix = NULL;
+
+ lastResult = DllExports::GdipCreateMatrix(&matrix);
+
+ SetNativeMatrix(matrix);
+ }
+
+ Matrix(IN REAL m11,
+ IN REAL m12,
+ IN REAL m21,
+ IN REAL m22,
+ IN REAL dx,
+ IN REAL dy)
+ {
+ GpMatrix *matrix = NULL;
+
+ lastResult = DllExports::GdipCreateMatrix2(m11, m12, m21, m22,
+ dx, dy, &matrix);
+
+ SetNativeMatrix(matrix);
+ }
+
+ Matrix(IN const RectF& rect,
+ IN const PointF* dstplg)
+ {
+ GpMatrix *matrix = NULL;
+
+ lastResult = DllExports::GdipCreateMatrix3(&rect,
+ dstplg,
+ &matrix);
+
+ SetNativeMatrix(matrix);
+ }
+
+ Matrix(IN const Rect& rect,
+ IN const Point* dstplg)
+ {
+ GpMatrix *matrix = NULL;
+
+ lastResult = DllExports::GdipCreateMatrix3I(&rect,
+ dstplg,
+ &matrix);
+
+ SetNativeMatrix(matrix);
+ }
+
+ ~Matrix()
+ {
+ DllExports::GdipDeleteMatrix(nativeMatrix);
+ }
+
+ Matrix *Clone() const
+ {
+ GpMatrix *cloneMatrix = NULL;
+
+ SetStatus(DllExports::GdipCloneMatrix(nativeMatrix,
+ &cloneMatrix));
+
+ if (lastResult != Ok)
+ return NULL;
+
+ return new Matrix(cloneMatrix);
+ }
+
+ Status GetElements(OUT REAL *m) const
+ {
+ return SetStatus(DllExports::GdipGetMatrixElements(nativeMatrix, m));
+ }
+
+ Status SetElements(IN REAL m11,
+ IN REAL m12,
+ IN REAL m21,
+ IN REAL m22,
+ IN REAL dx,
+ IN REAL dy)
+ {
+ return SetStatus(DllExports::GdipSetMatrixElements(nativeMatrix,
+ m11, m12, m21, m22, dx, dy));
+ }
+
+ REAL OffsetX() const
+ {
+ REAL elements[6];
+
+ if (GetElements(&elements[0]) == Ok)
+ return elements[4];
+ else
+ return 0.0f;
+ }
+
+ REAL OffsetY() const
+ {
+ REAL elements[6];
+
+ if (GetElements(&elements[0]) == Ok)
+ return elements[5];
+ else
+ return 0.0f;
+ }
+
+ Status Reset()
+ {
+ // set identity matrix elements
+ return SetStatus(DllExports::GdipSetMatrixElements(nativeMatrix,
+ 1.0, 0.0, 0.0, 1.0, 0.0, 0.0));
+ }
+
+ Status Multiply(IN const Matrix *matrix,
+ IN MatrixOrder order = MatrixOrderPrepend)
+ {
+ return SetStatus(DllExports::GdipMultiplyMatrix(nativeMatrix,
+ matrix->nativeMatrix,
+ order));
+ }
+
+ Status Translate(IN REAL offsetX,
+ IN REAL offsetY,
+ IN MatrixOrder order = MatrixOrderPrepend)
+ {
+ return SetStatus(DllExports::GdipTranslateMatrix(nativeMatrix, offsetX, offsetY, order));
+ }
+
+ Status Scale(IN REAL scaleX,
+ IN REAL scaleY,
+ IN MatrixOrder order = MatrixOrderPrepend)
+ {
+ return SetStatus(DllExports::GdipScaleMatrix(nativeMatrix, scaleX, scaleY, order));
+ }
+
+ Status Rotate(IN REAL angle,
+ IN MatrixOrder order = MatrixOrderPrepend)
+ {
+ return SetStatus(DllExports::GdipRotateMatrix(nativeMatrix, angle, order));
+ }
+
+ Status RotateAt(IN REAL angle,
+ IN const PointF& center,
+ IN MatrixOrder order = MatrixOrderPrepend)
+ {
+ if(order == MatrixOrderPrepend)
+ {
+ SetStatus(DllExports::GdipTranslateMatrix(nativeMatrix, center.X, center.Y, order));
+ SetStatus(DllExports::GdipRotateMatrix(nativeMatrix, angle, order));
+ return SetStatus(DllExports::GdipTranslateMatrix(nativeMatrix, - center.X, - center.Y, order));
+ }
+ else
+ {
+ SetStatus(DllExports::GdipTranslateMatrix(nativeMatrix, - center.X, - center.Y, order));
+ SetStatus(DllExports::GdipRotateMatrix(nativeMatrix, angle, order));
+ return SetStatus(DllExports::GdipTranslateMatrix(nativeMatrix, center.X, center.Y, order));
+ }
+ }
+
+ Status Shear(IN REAL shearX,
+ IN REAL shearY,
+ IN MatrixOrder order = MatrixOrderPrepend)
+ {
+ return SetStatus(DllExports::GdipShearMatrix(nativeMatrix, shearX, shearY, order));
+ }
+
+ Status Invert()
+ {
+ return SetStatus(DllExports::GdipInvertMatrix(nativeMatrix));
+ }
+
+ // float version
+ Status TransformPoints(IN OUT PointF* pts,
+ IN INT count = 1) const
+ {
+ return SetStatus(DllExports::GdipTransformMatrixPoints(nativeMatrix, pts, count));
+ }
+
+ Status TransformPoints(IN OUT Point* pts,
+ IN INT count = 1) const
+ {
+ return SetStatus(DllExports::GdipTransformMatrixPointsI(nativeMatrix,
+ pts,
+ count));
+ }
+
+ Status TransformVectors(IN OUT PointF* pts,
+ IN INT count = 1) const
+ {
+ return SetStatus(DllExports::GdipVectorTransformMatrixPoints(nativeMatrix, pts, count));
+ }
+
+ Status TransformVectors(IN OUT Point* pts,
+ IN INT count = 1) const
+ {
+ return SetStatus(DllExports::GdipVectorTransformMatrixPointsI(nativeMatrix,
+ pts,
+ count));
+ }
+
+ BOOL IsInvertible() const
+ {
+ BOOL result = FALSE;
+
+ SetStatus(DllExports::GdipIsMatrixInvertible(nativeMatrix, &result));
+
+ return result;
+ }
+
+ BOOL IsIdentity() const
+ {
+ BOOL result = FALSE;
+
+ SetStatus(DllExports::GdipIsMatrixIdentity(nativeMatrix, &result));
+
+ return result;
+ }
+
+ BOOL Equals(IN const Matrix *matrix) const
+ {
+ BOOL result = FALSE;
+
+ SetStatus(DllExports::GdipIsMatrixEqual(nativeMatrix,
+ matrix->nativeMatrix, &result));
+
+ return result;
+ }
+
+ Status GetLastStatus() const
+ {
+ Status lastStatus = lastResult;
+ lastResult = Ok;
+
+ return lastStatus;
+ }
+
+protected:
+
+#ifdef DCR_USE_NEW_250932
+
+private:
+ Matrix(const Matrix &);
+ Matrix& operator=(const Matrix &);
+protected:
+
+#else
+
+ Matrix(const Matrix& matrix)
+ {
+ matrix;
+ SetStatus(NotImplemented);
+ SetNativeMatrix(NULL);
+ }
+
+ Matrix& operator=(const Matrix& matrix)
+ {
+ matrix;
+ SetStatus(NotImplemented);
+ return *this;
+ }
+
+#endif
+
+ Matrix(GpMatrix *nativeMatrix)
+ {
+ lastResult = Ok;
+ SetNativeMatrix(nativeMatrix);
+ }
+
+ VOID SetNativeMatrix(GpMatrix *nativeMatrix)
+ {
+ this->nativeMatrix = nativeMatrix;
+ }
+
+ Status SetStatus(Status status) const
+ {
+ if (status != Ok)
+ return (lastResult = status);
+ else
+ return status;
+ }
+
+protected:
+ GpMatrix *nativeMatrix;
+ mutable Status lastResult;
+};
diff --git a/core/src/fxge/Microsoft SDK/include/GdiPlusMem.h b/core/src/fxge/Microsoft SDK/include/GdiPlusMem.h
index 5f92c1e141..a0e0e44f37 100644
--- a/core/src/fxge/Microsoft SDK/include/GdiPlusMem.h
+++ b/core/src/fxge/Microsoft SDK/include/GdiPlusMem.h
@@ -1,49 +1,49 @@
-/**************************************************************************\
-*
-* Copyright (c) 1998-2000, Microsoft Corp. All Rights Reserved.
-*
-* Module Name:
-*
-* GdiplusMem.h
-*
-* Abstract:
-*
-* Flat GDI+ Memory Allocators - header file
-*
-\**************************************************************************/
-
-// TODO: this file style needs to be made internally consistent with the way
-// it handles breaking the long argument lists across multiple lines
-
-#ifndef _GDIPLUSMEM_H
-#define _GDIPLUSMEM_H
-
-#define WINGDIPAPI __stdcall
-
-// currently, only C++ wrapper API's force const.
-
-#ifdef _GDIPLUS_H
-#define GDIPCONST const
-#else
-#define GDIPCONST
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-//----------------------------------------------------------------------------
-// Memory Allocation APIs
-//----------------------------------------------------------------------------
-
-void* WINGDIPAPI
-GdipAlloc(size_t size);
-
-void WINGDIPAPI
-GdipFree(void* ptr);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // !_GDIPLUSMEM_H
+/**************************************************************************\
+*
+* Copyright (c) 1998-2000, Microsoft Corp. All Rights Reserved.
+*
+* Module Name:
+*
+* GdiplusMem.h
+*
+* Abstract:
+*
+* Flat GDI+ Memory Allocators - header file
+*
+\**************************************************************************/
+
+// TODO: this file style needs to be made internally consistent with the way
+// it handles breaking the long argument lists across multiple lines
+
+#ifndef _GDIPLUSMEM_H
+#define _GDIPLUSMEM_H
+
+#define WINGDIPAPI __stdcall
+
+// currently, only C++ wrapper API's force const.
+
+#ifdef _GDIPLUS_H
+#define GDIPCONST const
+#else
+#define GDIPCONST
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+//----------------------------------------------------------------------------
+// Memory Allocation APIs
+//----------------------------------------------------------------------------
+
+void* WINGDIPAPI
+GdipAlloc(size_t size);
+
+void WINGDIPAPI
+GdipFree(void* ptr);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // !_GDIPLUSMEM_H
diff --git a/core/src/fxge/Microsoft SDK/include/GdiPlusMetaFile.h b/core/src/fxge/Microsoft SDK/include/GdiPlusMetaFile.h
index 3d07dd64d3..f7e0d91aaa 100644
--- a/core/src/fxge/Microsoft SDK/include/GdiPlusMetaFile.h
+++ b/core/src/fxge/Microsoft SDK/include/GdiPlusMetaFile.h
@@ -1,374 +1,374 @@
-/**************************************************************************\
-*
-* Copyright (c) 1998-2000, Microsoft Corp. All Rights Reserved.
-*
-* Module Name:
-*
-* GdiplusMetafile.h
-*
-* Abstract:
-*
-* Metafile related declarations
-*
-\**************************************************************************/
-
-#ifndef _GDIPLUSMETAFILE_H
-#define _GDIPLUSMETAFILE_H
-
-class Metafile : public Image
-{
-public:
- friend class Image;
-
- // Read a metafile
- Metafile()
- {
- SetNativeImage(NULL);
- lastResult = Ok;
- }
-
- // Playback a metafile from a HMETAFILE
- // If deleteWmf is TRUE, then when the metafile is deleted,
- // the hWmf will also be deleted. Otherwise, it won't be.
- Metafile(IN HMETAFILE hWmf,
- IN const APMFileHeader * apmFileHeader,
- IN BOOL deleteWmf = FALSE)
- {
- GpMetafile * metafile = NULL;
-
- lastResult = DllExports::GdipCreateMetafileFromWmf(hWmf, deleteWmf, apmFileHeader, &metafile);
-
- SetNativeImage(metafile);
- }
-
- // Playback a metafile from a HENHMETAFILE
- // If deleteEmf is TRUE, then when the metafile is deleted,
- // the hEmf will also be deleted. Otherwise, it won't be.
- Metafile(IN HENHMETAFILE hEmf,
- IN BOOL deleteEmf = FALSE)
- {
- GpMetafile * metafile = NULL;
-
- lastResult = DllExports::GdipCreateMetafileFromEmf(hEmf, deleteEmf, &metafile);
-
- SetNativeImage(metafile);
- }
-
- // Playback a metafile from a file
- Metafile(IN const WCHAR* filename)
- {
- GpMetafile * metafile = NULL;
-
- lastResult = DllExports::GdipCreateMetafileFromFile(filename, &metafile);
-
- SetNativeImage(metafile);
- }
-
- // Playback a WMF metafile from a file
- Metafile(IN const WCHAR* filename,
- IN const APMFileHeader * apmFileHeader
- )
- {
- GpMetafile * metafile = NULL;
-
- lastResult = DllExports::GdipCreateMetafileFromWmfFile(filename, apmFileHeader, &metafile);
-
- SetNativeImage(metafile);
- }
-
- // Playback a metafile from a stream
- Metafile(IN IStream* stream)
- {
- GpMetafile * metafile = NULL;
-
- lastResult = DllExports::GdipCreateMetafileFromStream(stream, &metafile);
-
- SetNativeImage(metafile);
- }
-
- // Record a metafile to memory
- Metafile(
- IN HDC referenceHdc,
- IN EmfType type = EmfTypeEmfPlusDual,
- IN const WCHAR * description = NULL
- )
- {
- GpMetafile * metafile = NULL;
-
- lastResult = DllExports::GdipRecordMetafile(
- referenceHdc, type, NULL, MetafileFrameUnitGdi,
- description, &metafile);
-
- SetNativeImage(metafile);
- }
-
- // Record a metafile to memory
- Metafile(
- IN HDC referenceHdc,
- IN const RectF & frameRect,
- IN MetafileFrameUnit frameUnit = MetafileFrameUnitGdi,
- IN EmfType type = EmfTypeEmfPlusDual,
- IN const WCHAR * description = NULL
- )
- {
- GpMetafile * metafile = NULL;
-
- lastResult = DllExports::GdipRecordMetafile(
- referenceHdc, type, &frameRect, frameUnit,
- description, &metafile);
-
- SetNativeImage(metafile);
- }
-
- // Record a metafile to memory
- Metafile(
- IN HDC referenceHdc,
- IN const Rect & frameRect,
- IN MetafileFrameUnit frameUnit = MetafileFrameUnitGdi,
- IN EmfType type = EmfTypeEmfPlusDual,
- IN const WCHAR * description = NULL
- )
- {
- GpMetafile * metafile = NULL;
-
- lastResult = DllExports::GdipRecordMetafileI(
- referenceHdc, type, &frameRect, frameUnit,
- description, &metafile);
-
- SetNativeImage(metafile);
- }
-
- // Record a metafile to a file
- Metafile(
- IN const WCHAR* fileName,
- IN HDC referenceHdc,
- IN EmfType type = EmfTypeEmfPlusDual,
- IN const WCHAR * description = NULL
- )
- {
- GpMetafile * metafile = NULL;
-
- lastResult = DllExports::GdipRecordMetafileFileName(fileName,
- referenceHdc, type, NULL, MetafileFrameUnitGdi,
- description, &metafile);
-
- SetNativeImage(metafile);
- }
-
- // Record a metafile to a file
- Metafile(
- IN const WCHAR* fileName,
- IN HDC referenceHdc,
- IN const RectF & frameRect,
- IN MetafileFrameUnit frameUnit = MetafileFrameUnitGdi,
- IN EmfType type = EmfTypeEmfPlusDual,
- IN const WCHAR * description = NULL
- )
- {
- GpMetafile * metafile = NULL;
-
- lastResult = DllExports::GdipRecordMetafileFileName(fileName,
- referenceHdc, type, &frameRect, frameUnit,
- description, &metafile);
-
- SetNativeImage(metafile);
- }
-
- // Record a metafile to a file
- Metafile(
- IN const WCHAR* fileName,
- IN HDC referenceHdc,
- IN const Rect & frameRect,
- IN MetafileFrameUnit frameUnit = MetafileFrameUnitGdi,
- IN EmfType type = EmfTypeEmfPlusDual,
- IN const WCHAR * description = NULL
- )
- {
- GpMetafile * metafile = NULL;
-
- lastResult = DllExports::GdipRecordMetafileFileNameI(fileName,
- referenceHdc, type, &frameRect, frameUnit,
- description, &metafile);
-
- SetNativeImage(metafile);
- }
-
- // Record a metafile to a stream
- Metafile(
- IN IStream * stream,
- IN HDC referenceHdc,
- IN EmfType type = EmfTypeEmfPlusDual,
- IN const WCHAR * description = NULL
- )
- {
- GpMetafile * metafile = NULL;
-
- lastResult = DllExports::GdipRecordMetafileStream(stream,
- referenceHdc, type, NULL, MetafileFrameUnitGdi,
- description, &metafile);
-
- SetNativeImage(metafile);
- }
-
- // Record a metafile to a stream
- Metafile(
- IN IStream * stream,
- IN HDC referenceHdc,
- IN const RectF & frameRect,
- IN MetafileFrameUnit frameUnit = MetafileFrameUnitGdi,
- IN EmfType type = EmfTypeEmfPlusDual,
- IN const WCHAR * description = NULL
- )
- {
- GpMetafile * metafile = NULL;
-
- lastResult = DllExports::GdipRecordMetafileStream(stream,
- referenceHdc, type, &frameRect, frameUnit,
- description, &metafile);
-
- SetNativeImage(metafile);
- }
-
- // Write a metafile to a stream with down-level GDI records
- Metafile(
- IN IStream * stream,
- IN HDC referenceHdc,
- IN const Rect & frameRect,
- IN MetafileFrameUnit frameUnit = MetafileFrameUnitGdi,
- IN EmfType type = EmfTypeEmfPlusDual,
- IN const WCHAR * description = NULL
- )
- {
- GpMetafile * metafile = NULL;
-
- lastResult = DllExports::GdipRecordMetafileStreamI(stream,
- referenceHdc, type, &frameRect, frameUnit,
- description, &metafile);
-
- SetNativeImage(metafile);
- }
-
- static Status GetMetafileHeader(
- IN HMETAFILE hWmf,
- IN const APMFileHeader * apmFileHeader,
- OUT MetafileHeader * header
- )
- {
- return DllExports::GdipGetMetafileHeaderFromWmf(hWmf, apmFileHeader, header);
- }
-
- static Status GetMetafileHeader(
- IN HENHMETAFILE hEmf,
- OUT MetafileHeader * header
- )
- {
- return DllExports::GdipGetMetafileHeaderFromEmf(hEmf, header);
- }
-
- static Status GetMetafileHeader(
- IN const WCHAR* filename,
- OUT MetafileHeader * header
- )
- {
- return DllExports::GdipGetMetafileHeaderFromFile(filename, header);
- }
-
- static Status GetMetafileHeader(
- IN IStream * stream,
- OUT MetafileHeader * header
- )
- {
- return DllExports::GdipGetMetafileHeaderFromStream(stream, header);
- }
-
- Status GetMetafileHeader(
- OUT MetafileHeader * header
- ) const
- {
- return SetStatus(DllExports::GdipGetMetafileHeaderFromMetafile(
- (GpMetafile *)nativeImage,
- header));
- }
-
- // Once this method is called, the Metafile object is in an invalid state
- // and can no longer be used. It is the responsiblity of the caller to
- // invoke DeleteEnhMetaFile to delete this hEmf.
-
- HENHMETAFILE GetHENHMETAFILE()
- {
- HENHMETAFILE hEmf;
-
- SetStatus(DllExports::GdipGetHemfFromMetafile((GpMetafile *)nativeImage, &hEmf));
-
- return hEmf;
- }
-
- // Used in conjuction with Graphics::EnumerateMetafile to play an EMF+
- // The data must be DWORD aligned if it's an EMF or EMF+. It must be
- // WORD aligned if it's a WMF.
- Status
- PlayRecord(
- IN EmfPlusRecordType recordType,
- IN UINT flags,
- IN UINT dataSize,
- IN const BYTE * data
- ) const
- {
- return SetStatus(DllExports::GdipPlayMetafileRecord(
- (GpMetafile *)nativeImage,
- recordType,
- flags,
- dataSize,
- data));
- }
-
- // If you're using a printer HDC for the metafile, but you want the
- // metafile rasterized at screen resolution, then use this API to set
- // the rasterization dpi of the metafile to the screen resolution,
- // e.g. 96 dpi or 120 dpi.
- Status SetDownLevelRasterizationLimit(
- IN UINT metafileRasterizationLimitDpi
- )
- {
- return SetStatus(DllExports::GdipSetMetafileDownLevelRasterizationLimit(
- (GpMetafile *)nativeImage,
- metafileRasterizationLimitDpi));
- }
-
- UINT GetDownLevelRasterizationLimit() const
- {
- UINT metafileRasterizationLimitDpi = 0;
-
- SetStatus(DllExports::GdipGetMetafileDownLevelRasterizationLimit(
- (GpMetafile *)nativeImage,
- &metafileRasterizationLimitDpi));
-
- return metafileRasterizationLimitDpi;
- }
-
- static UINT Metafile::EmfToWmfBits(
- IN HENHMETAFILE hemf,
- IN UINT cbData16,
- IN LPBYTE pData16,
- IN INT iMapMode = MM_ANISOTROPIC,
- IN EmfToWmfBitsFlags eFlags = EmfToWmfBitsFlagsDefault
- )
- {
- return DllExports::GdipEmfToWmfBits(
- hemf,
- cbData16,
- pData16,
- iMapMode,
- eFlags);
- }
-
-#ifdef DCR_USE_NEW_250932
-
-private:
- Metafile(const Metafile &);
- Metafile& operator=(const Metafile &);
-
-#endif
-};
-
-#endif // !_METAFILE_H
+/**************************************************************************\
+*
+* Copyright (c) 1998-2000, Microsoft Corp. All Rights Reserved.
+*
+* Module Name:
+*
+* GdiplusMetafile.h
+*
+* Abstract:
+*
+* Metafile related declarations
+*
+\**************************************************************************/
+
+#ifndef _GDIPLUSMETAFILE_H
+#define _GDIPLUSMETAFILE_H
+
+class Metafile : public Image
+{
+public:
+ friend class Image;
+
+ // Read a metafile
+ Metafile()
+ {
+ SetNativeImage(NULL);
+ lastResult = Ok;
+ }
+
+ // Playback a metafile from a HMETAFILE
+ // If deleteWmf is TRUE, then when the metafile is deleted,
+ // the hWmf will also be deleted. Otherwise, it won't be.
+ Metafile(IN HMETAFILE hWmf,
+ IN const APMFileHeader * apmFileHeader,
+ IN BOOL deleteWmf = FALSE)
+ {
+ GpMetafile * metafile = NULL;
+
+ lastResult = DllExports::GdipCreateMetafileFromWmf(hWmf, deleteWmf, apmFileHeader, &metafile);
+
+ SetNativeImage(metafile);
+ }
+
+ // Playback a metafile from a HENHMETAFILE
+ // If deleteEmf is TRUE, then when the metafile is deleted,
+ // the hEmf will also be deleted. Otherwise, it won't be.
+ Metafile(IN HENHMETAFILE hEmf,
+ IN BOOL deleteEmf = FALSE)
+ {
+ GpMetafile * metafile = NULL;
+
+ lastResult = DllExports::GdipCreateMetafileFromEmf(hEmf, deleteEmf, &metafile);
+
+ SetNativeImage(metafile);
+ }
+
+ // Playback a metafile from a file
+ Metafile(IN const WCHAR* filename)
+ {
+ GpMetafile * metafile = NULL;
+
+ lastResult = DllExports::GdipCreateMetafileFromFile(filename, &metafile);
+
+ SetNativeImage(metafile);
+ }
+
+ // Playback a WMF metafile from a file
+ Metafile(IN const WCHAR* filename,
+ IN const APMFileHeader * apmFileHeader
+ )
+ {
+ GpMetafile * metafile = NULL;
+
+ lastResult = DllExports::GdipCreateMetafileFromWmfFile(filename, apmFileHeader, &metafile);
+
+ SetNativeImage(metafile);
+ }
+
+ // Playback a metafile from a stream
+ Metafile(IN IStream* stream)
+ {
+ GpMetafile * metafile = NULL;
+
+ lastResult = DllExports::GdipCreateMetafileFromStream(stream, &metafile);
+
+ SetNativeImage(metafile);
+ }
+
+ // Record a metafile to memory
+ Metafile(
+ IN HDC referenceHdc,
+ IN EmfType type = EmfTypeEmfPlusDual,
+ IN const WCHAR * description = NULL
+ )
+ {
+ GpMetafile * metafile = NULL;
+
+ lastResult = DllExports::GdipRecordMetafile(
+ referenceHdc, type, NULL, MetafileFrameUnitGdi,
+ description, &metafile);
+
+ SetNativeImage(metafile);
+ }
+
+ // Record a metafile to memory
+ Metafile(
+ IN HDC referenceHdc,
+ IN const RectF & frameRect,
+ IN MetafileFrameUnit frameUnit = MetafileFrameUnitGdi,
+ IN EmfType type = EmfTypeEmfPlusDual,
+ IN const WCHAR * description = NULL
+ )
+ {
+ GpMetafile * metafile = NULL;
+
+ lastResult = DllExports::GdipRecordMetafile(
+ referenceHdc, type, &frameRect, frameUnit,
+ description, &metafile);
+
+ SetNativeImage(metafile);
+ }
+
+ // Record a metafile to memory
+ Metafile(
+ IN HDC referenceHdc,
+ IN const Rect & frameRect,
+ IN MetafileFrameUnit frameUnit = MetafileFrameUnitGdi,
+ IN EmfType type = EmfTypeEmfPlusDual,
+ IN const WCHAR * description = NULL
+ )
+ {
+ GpMetafile * metafile = NULL;
+
+ lastResult = DllExports::GdipRecordMetafileI(
+ referenceHdc, type, &frameRect, frameUnit,
+ description, &metafile);
+
+ SetNativeImage(metafile);
+ }
+
+ // Record a metafile to a file
+ Metafile(
+ IN const WCHAR* fileName,
+ IN HDC referenceHdc,
+ IN EmfType type = EmfTypeEmfPlusDual,
+ IN const WCHAR * description = NULL
+ )
+ {
+ GpMetafile * metafile = NULL;
+
+ lastResult = DllExports::GdipRecordMetafileFileName(fileName,
+ referenceHdc, type, NULL, MetafileFrameUnitGdi,
+ description, &metafile);
+
+ SetNativeImage(metafile);
+ }
+
+ // Record a metafile to a file
+ Metafile(
+ IN const WCHAR* fileName,
+ IN HDC referenceHdc,
+ IN const RectF & frameRect,
+ IN MetafileFrameUnit frameUnit = MetafileFrameUnitGdi,
+ IN EmfType type = EmfTypeEmfPlusDual,
+ IN const WCHAR * description = NULL
+ )
+ {
+ GpMetafile * metafile = NULL;
+
+ lastResult = DllExports::GdipRecordMetafileFileName(fileName,
+ referenceHdc, type, &frameRect, frameUnit,
+ description, &metafile);
+
+ SetNativeImage(metafile);
+ }
+
+ // Record a metafile to a file
+ Metafile(
+ IN const WCHAR* fileName,
+ IN HDC referenceHdc,
+ IN const Rect & frameRect,
+ IN MetafileFrameUnit frameUnit = MetafileFrameUnitGdi,
+ IN EmfType type = EmfTypeEmfPlusDual,
+ IN const WCHAR * description = NULL
+ )
+ {
+ GpMetafile * metafile = NULL;
+
+ lastResult = DllExports::GdipRecordMetafileFileNameI(fileName,
+ referenceHdc, type, &frameRect, frameUnit,
+ description, &metafile);
+
+ SetNativeImage(metafile);
+ }
+
+ // Record a metafile to a stream
+ Metafile(
+ IN IStream * stream,
+ IN HDC referenceHdc,
+ IN EmfType type = EmfTypeEmfPlusDual,
+ IN const WCHAR * description = NULL
+ )
+ {
+ GpMetafile * metafile = NULL;
+
+ lastResult = DllExports::GdipRecordMetafileStream(stream,
+ referenceHdc, type, NULL, MetafileFrameUnitGdi,
+ description, &metafile);
+
+ SetNativeImage(metafile);
+ }
+
+ // Record a metafile to a stream
+ Metafile(
+ IN IStream * stream,
+ IN HDC referenceHdc,
+ IN const RectF & frameRect,
+ IN MetafileFrameUnit frameUnit = MetafileFrameUnitGdi,
+ IN EmfType type = EmfTypeEmfPlusDual,
+ IN const WCHAR * description = NULL
+ )
+ {
+ GpMetafile * metafile = NULL;
+
+ lastResult = DllExports::GdipRecordMetafileStream(stream,
+ referenceHdc, type, &frameRect, frameUnit,
+ description, &metafile);
+
+ SetNativeImage(metafile);
+ }
+
+ // Write a metafile to a stream with down-level GDI records
+ Metafile(
+ IN IStream * stream,
+ IN HDC referenceHdc,
+ IN const Rect & frameRect,
+ IN MetafileFrameUnit frameUnit = MetafileFrameUnitGdi,
+ IN EmfType type = EmfTypeEmfPlusDual,
+ IN const WCHAR * description = NULL
+ )
+ {
+ GpMetafile * metafile = NULL;
+
+ lastResult = DllExports::GdipRecordMetafileStreamI(stream,
+ referenceHdc, type, &frameRect, frameUnit,
+ description, &metafile);
+
+ SetNativeImage(metafile);
+ }
+
+ static Status GetMetafileHeader(
+ IN HMETAFILE hWmf,
+ IN const APMFileHeader * apmFileHeader,
+ OUT MetafileHeader * header
+ )
+ {
+ return DllExports::GdipGetMetafileHeaderFromWmf(hWmf, apmFileHeader, header);
+ }
+
+ static Status GetMetafileHeader(
+ IN HENHMETAFILE hEmf,
+ OUT MetafileHeader * header
+ )
+ {
+ return DllExports::GdipGetMetafileHeaderFromEmf(hEmf, header);
+ }
+
+ static Status GetMetafileHeader(
+ IN const WCHAR* filename,
+ OUT MetafileHeader * header
+ )
+ {
+ return DllExports::GdipGetMetafileHeaderFromFile(filename, header);
+ }
+
+ static Status GetMetafileHeader(
+ IN IStream * stream,
+ OUT MetafileHeader * header
+ )
+ {
+ return DllExports::GdipGetMetafileHeaderFromStream(stream, header);
+ }
+
+ Status GetMetafileHeader(
+ OUT MetafileHeader * header
+ ) const
+ {
+ return SetStatus(DllExports::GdipGetMetafileHeaderFromMetafile(
+ (GpMetafile *)nativeImage,
+ header));
+ }
+
+ // Once this method is called, the Metafile object is in an invalid state
+ // and can no longer be used. It is the responsiblity of the caller to
+ // invoke DeleteEnhMetaFile to delete this hEmf.
+
+ HENHMETAFILE GetHENHMETAFILE()
+ {
+ HENHMETAFILE hEmf;
+
+ SetStatus(DllExports::GdipGetHemfFromMetafile((GpMetafile *)nativeImage, &hEmf));
+
+ return hEmf;
+ }
+
+ // Used in conjuction with Graphics::EnumerateMetafile to play an EMF+
+ // The data must be DWORD aligned if it's an EMF or EMF+. It must be
+ // WORD aligned if it's a WMF.
+ Status
+ PlayRecord(
+ IN EmfPlusRecordType recordType,
+ IN UINT flags,
+ IN UINT dataSize,
+ IN const BYTE * data
+ ) const
+ {
+ return SetStatus(DllExports::GdipPlayMetafileRecord(
+ (GpMetafile *)nativeImage,
+ recordType,
+ flags,
+ dataSize,
+ data));
+ }
+
+ // If you're using a printer HDC for the metafile, but you want the
+ // metafile rasterized at screen resolution, then use this API to set
+ // the rasterization dpi of the metafile to the screen resolution,
+ // e.g. 96 dpi or 120 dpi.
+ Status SetDownLevelRasterizationLimit(
+ IN UINT metafileRasterizationLimitDpi
+ )
+ {
+ return SetStatus(DllExports::GdipSetMetafileDownLevelRasterizationLimit(
+ (GpMetafile *)nativeImage,
+ metafileRasterizationLimitDpi));
+ }
+
+ UINT GetDownLevelRasterizationLimit() const
+ {
+ UINT metafileRasterizationLimitDpi = 0;
+
+ SetStatus(DllExports::GdipGetMetafileDownLevelRasterizationLimit(
+ (GpMetafile *)nativeImage,
+ &metafileRasterizationLimitDpi));
+
+ return metafileRasterizationLimitDpi;
+ }
+
+ static UINT Metafile::EmfToWmfBits(
+ IN HENHMETAFILE hemf,
+ IN UINT cbData16,
+ IN LPBYTE pData16,
+ IN INT iMapMode = MM_ANISOTROPIC,
+ IN EmfToWmfBitsFlags eFlags = EmfToWmfBitsFlagsDefault
+ )
+ {
+ return DllExports::GdipEmfToWmfBits(
+ hemf,
+ cbData16,
+ pData16,
+ iMapMode,
+ eFlags);
+ }
+
+#ifdef DCR_USE_NEW_250932
+
+private:
+ Metafile(const Metafile &);
+ Metafile& operator=(const Metafile &);
+
+#endif
+};
+
+#endif // !_METAFILE_H
diff --git a/core/src/fxge/Microsoft SDK/include/GdiPlusMetaHeader.h b/core/src/fxge/Microsoft SDK/include/GdiPlusMetaHeader.h
index 79b5bc9533..95ee190f04 100644
--- a/core/src/fxge/Microsoft SDK/include/GdiPlusMetaHeader.h
+++ b/core/src/fxge/Microsoft SDK/include/GdiPlusMetaHeader.h
@@ -1,213 +1,213 @@
-/**************************************************************************\
-*
-* Copyright (c) 1998-2000, Microsoft Corp. All Rights Reserved.
-*
-* Module Name:
-*
-* Metafile headers
-*
-* Abstract:
-*
-* Declarations for various metafile header structures.
-*
-\**************************************************************************/
-
-#ifndef _GDIPLUSMETAHEADER_H
-#define _GDIPLUSMETAHEADER_H
-
-typedef struct
-{
- DWORD iType; // Record type EMR_HEADER
- DWORD nSize; // Record size in bytes. This may be greater
- // than the sizeof(ENHMETAHEADER).
- RECTL rclBounds; // Inclusive-inclusive bounds in device units
- RECTL rclFrame; // Inclusive-inclusive Picture Frame of metafile in .01 mm units
- DWORD dSignature; // Signature. Must be ENHMETA_SIGNATURE.
- DWORD nVersion; // Version number
- DWORD nBytes; // Size of the metafile in bytes
- DWORD nRecords; // Number of records in the metafile
- WORD nHandles; // Number of handles in the handle table
- // Handle index zero is reserved.
- WORD sReserved; // Reserved. Must be zero.
- DWORD nDescription; // Number of chars in the unicode description string
- // This is 0 if there is no description string
- DWORD offDescription; // Offset to the metafile description record.
- // This is 0 if there is no description string
- DWORD nPalEntries; // Number of entries in the metafile palette.
- SIZEL szlDevice; // Size of the reference device in pels
- SIZEL szlMillimeters; // Size of the reference device in millimeters
-} ENHMETAHEADER3;
-
-// Aldus Placeable Metafiles
-
-// Placeable Metafiles were created by Aldus Corporation as a non-standard
-// way of specifying how a metafile is mapped and scaled on an output device.
-// Placeable metafiles are quite wide-spread, but not directly supported by
-// the Windows API. To playback a placeable metafile using the Windows API,
-// you will first need to strip the placeable metafile header from the file.
-// This is typically performed by copying the metafile to a temporary file
-// starting at file offset 22 (0x16). The contents of the temporary file may
-// then be used as input to the Windows GetMetaFile(), PlayMetaFile(),
-// CopyMetaFile(), etc. GDI functions.
-
-// Each placeable metafile begins with a 22-byte header,
-// followed by a standard metafile:
-
-#include <pshpack2.h> // set structure packing to 2
-
-typedef struct
-{
- INT16 Left;
- INT16 Top;
- INT16 Right;
- INT16 Bottom;
-} APMRect16;
-
-typedef struct
-{
- UINT32 Key; // GDIP_WMF_ALDUSKEY
- INT16 Hmf; // Metafile HANDLE number (always 0)
- APMRect16 BoundingBox; // Coordinates in metafile units
- INT16 Inch; // Number of metafile units per inch
- UINT32 Reserved; // Reserved (always 0)
- INT16 Checksum; // Checksum value for previous 10 WORDs
-} APMFileHeader;
-
-#include <poppack.h>
-
-// Key contains a special identification value that indicates the presence
-// of a placeable metafile header and is always 0x9AC6CDD7.
-
-// Handle is used to stored the handle of the metafile in memory. When written
-// to disk, this field is not used and will always contains the value 0.
-
-// Left, Top, Right, and Bottom contain the coordinates of the upper-left
-// and lower-right corners of the image on the output device. These are
-// measured in twips.
-
-// A twip (meaning "twentieth of a point") is the logical unit of measurement
-// used in Windows Metafiles. A twip is equal to 1/1440 of an inch. Thus 720
-// twips equal 1/2 inch, while 32,768 twips is 22.75 inches.
-
-// Inch contains the number of twips per inch used to represent the image.
-// Normally, there are 1440 twips per inch; however, this number may be
-// changed to scale the image. A value of 720 indicates that the image is
-// double its normal size, or scaled to a factor of 2:1. A value of 360
-// indicates a scale of 4:1, while a value of 2880 indicates that the image
-// is scaled down in size by a factor of two. A value of 1440 indicates
-// a 1:1 scale ratio.
-
-// Reserved is not used and is always set to 0.
-
-// Checksum contains a checksum value for the previous 10 WORDs in the header.
-// This value can be used in an attempt to detect if the metafile has become
-// corrupted. The checksum is calculated by XORing each WORD value to an
-// initial value of 0.
-
-// If the metafile was recorded with a reference Hdc that was a display.
-#define GDIP_EMFPLUSFLAGS_DISPLAY 0x00000001
-
-class MetafileHeader
-{
-public:
- MetafileType Type;
- UINT Size; // Size of the metafile (in bytes)
- UINT Version; // EMF+, EMF, or WMF version
- UINT EmfPlusFlags;
- REAL DpiX;
- REAL DpiY;
- INT X; // Bounds in device units
- INT Y;
- INT Width;
- INT Height;
- union
- {
- METAHEADER WmfHeader;
- ENHMETAHEADER3 EmfHeader;
- };
- INT EmfPlusHeaderSize; // size of the EMF+ header in file
- INT LogicalDpiX; // Logical Dpi of reference Hdc
- INT LogicalDpiY; // usually valid only for EMF+ files
-
-public:
- // Get the metafile type
- MetafileType GetType() const { return Type; }
-
- // Get the size of the metafile in BYTEs
- UINT GetMetafileSize() const { return Size; }
-
- // If IsEmfPlus, this is the EMF+ version; else it is the WMF or EMF version
- UINT GetVersion() const { return Version; }
-
- // Get the EMF+ flags associated with the metafile
- UINT GetEmfPlusFlags() const { return EmfPlusFlags; }
-
- // Get the X Dpi of the metafile
- REAL GetDpiX() const { return DpiX; }
-
- // Get the Y Dpi of the metafile
- REAL GetDpiY() const { return DpiY; }
-
- // Get the bounds of the metafile in device units
- VOID GetBounds (OUT Rect *rect) const
- {
- rect->X = X;
- rect->Y = Y;
- rect->Width = Width;
- rect->Height = Height;
- }
-
- // Is it any type of WMF (standard or Aldus Placeable Metafile)?
- BOOL IsWmf() const
- {
- return ((Type == MetafileTypeWmf) || (Type == MetafileTypeWmfAldus));
- }
-
- // Is this an Aldus Placeable Metafile?
- BOOL IsWmfAldus() const { return (Type == MetafileTypeWmf); }
-
- // Is this an EMF (not an EMF+)?
- BOOL IsEmf() const { return (Type == MetafileTypeEmf); }
-
- // Is this an EMF or EMF+ file?
- BOOL IsEmfOrEmfPlus() const { return (Type >= MetafileTypeEmf); }
-
- // Is this an EMF+ file?
- BOOL IsEmfPlus() const { return (Type >= MetafileTypeEmfPlusOnly); }
-
- // Is this an EMF+ dual (has dual, down-level records) file?
- BOOL IsEmfPlusDual() const { return (Type == MetafileTypeEmfPlusDual); }
-
- // Is this an EMF+ only (no dual records) file?
- BOOL IsEmfPlusOnly() const { return (Type == MetafileTypeEmfPlusOnly); }
-
- // If it's an EMF+ file, was it recorded against a display Hdc?
- BOOL IsDisplay() const
- {
- return (IsEmfPlus() &&
- ((EmfPlusFlags & GDIP_EMFPLUSFLAGS_DISPLAY) != 0));
- }
-
- // Get the WMF header of the metafile (if it is a WMF)
- const METAHEADER * GetWmfHeader() const
- {
- if (IsWmf())
- {
- return &WmfHeader;
- }
- return NULL;
- }
-
- // Get the EMF header of the metafile (if it is an EMF)
- const ENHMETAHEADER3 * GetEmfHeader() const
- {
- if (IsEmfOrEmfPlus())
- {
- return &EmfHeader;
- }
- return NULL;
- }
-};
-
-#endif
-
+/**************************************************************************\
+*
+* Copyright (c) 1998-2000, Microsoft Corp. All Rights Reserved.
+*
+* Module Name:
+*
+* Metafile headers
+*
+* Abstract:
+*
+* Declarations for various metafile header structures.
+*
+\**************************************************************************/
+
+#ifndef _GDIPLUSMETAHEADER_H
+#define _GDIPLUSMETAHEADER_H
+
+typedef struct
+{
+ DWORD iType; // Record type EMR_HEADER
+ DWORD nSize; // Record size in bytes. This may be greater
+ // than the sizeof(ENHMETAHEADER).
+ RECTL rclBounds; // Inclusive-inclusive bounds in device units
+ RECTL rclFrame; // Inclusive-inclusive Picture Frame of metafile in .01 mm units
+ DWORD dSignature; // Signature. Must be ENHMETA_SIGNATURE.
+ DWORD nVersion; // Version number
+ DWORD nBytes; // Size of the metafile in bytes
+ DWORD nRecords; // Number of records in the metafile
+ WORD nHandles; // Number of handles in the handle table
+ // Handle index zero is reserved.
+ WORD sReserved; // Reserved. Must be zero.
+ DWORD nDescription; // Number of chars in the unicode description string
+ // This is 0 if there is no description string
+ DWORD offDescription; // Offset to the metafile description record.
+ // This is 0 if there is no description string
+ DWORD nPalEntries; // Number of entries in the metafile palette.
+ SIZEL szlDevice; // Size of the reference device in pels
+ SIZEL szlMillimeters; // Size of the reference device in millimeters
+} ENHMETAHEADER3;
+
+// Aldus Placeable Metafiles
+
+// Placeable Metafiles were created by Aldus Corporation as a non-standard
+// way of specifying how a metafile is mapped and scaled on an output device.
+// Placeable metafiles are quite wide-spread, but not directly supported by
+// the Windows API. To playback a placeable metafile using the Windows API,
+// you will first need to strip the placeable metafile header from the file.
+// This is typically performed by copying the metafile to a temporary file
+// starting at file offset 22 (0x16). The contents of the temporary file may
+// then be used as input to the Windows GetMetaFile(), PlayMetaFile(),
+// CopyMetaFile(), etc. GDI functions.
+
+// Each placeable metafile begins with a 22-byte header,
+// followed by a standard metafile:
+
+#include <pshpack2.h> // set structure packing to 2
+
+typedef struct
+{
+ INT16 Left;
+ INT16 Top;
+ INT16 Right;
+ INT16 Bottom;
+} APMRect16;
+
+typedef struct
+{
+ UINT32 Key; // GDIP_WMF_ALDUSKEY
+ INT16 Hmf; // Metafile HANDLE number (always 0)
+ APMRect16 BoundingBox; // Coordinates in metafile units
+ INT16 Inch; // Number of metafile units per inch
+ UINT32 Reserved; // Reserved (always 0)
+ INT16 Checksum; // Checksum value for previous 10 WORDs
+} APMFileHeader;
+
+#include <poppack.h>
+
+// Key contains a special identification value that indicates the presence
+// of a placeable metafile header and is always 0x9AC6CDD7.
+
+// Handle is used to stored the handle of the metafile in memory. When written
+// to disk, this field is not used and will always contains the value 0.
+
+// Left, Top, Right, and Bottom contain the coordinates of the upper-left
+// and lower-right corners of the image on the output device. These are
+// measured in twips.
+
+// A twip (meaning "twentieth of a point") is the logical unit of measurement
+// used in Windows Metafiles. A twip is equal to 1/1440 of an inch. Thus 720
+// twips equal 1/2 inch, while 32,768 twips is 22.75 inches.
+
+// Inch contains the number of twips per inch used to represent the image.
+// Normally, there are 1440 twips per inch; however, this number may be
+// changed to scale the image. A value of 720 indicates that the image is
+// double its normal size, or scaled to a factor of 2:1. A value of 360
+// indicates a scale of 4:1, while a value of 2880 indicates that the image
+// is scaled down in size by a factor of two. A value of 1440 indicates
+// a 1:1 scale ratio.
+
+// Reserved is not used and is always set to 0.
+
+// Checksum contains a checksum value for the previous 10 WORDs in the header.
+// This value can be used in an attempt to detect if the metafile has become
+// corrupted. The checksum is calculated by XORing each WORD value to an
+// initial value of 0.
+
+// If the metafile was recorded with a reference Hdc that was a display.
+#define GDIP_EMFPLUSFLAGS_DISPLAY 0x00000001
+
+class MetafileHeader
+{
+public:
+ MetafileType Type;
+ UINT Size; // Size of the metafile (in bytes)
+ UINT Version; // EMF+, EMF, or WMF version
+ UINT EmfPlusFlags;
+ REAL DpiX;
+ REAL DpiY;
+ INT X; // Bounds in device units
+ INT Y;
+ INT Width;
+ INT Height;
+ union
+ {
+ METAHEADER WmfHeader;
+ ENHMETAHEADER3 EmfHeader;
+ };
+ INT EmfPlusHeaderSize; // size of the EMF+ header in file
+ INT LogicalDpiX; // Logical Dpi of reference Hdc
+ INT LogicalDpiY; // usually valid only for EMF+ files
+
+public:
+ // Get the metafile type
+ MetafileType GetType() const { return Type; }
+
+ // Get the size of the metafile in BYTEs
+ UINT GetMetafileSize() const { return Size; }
+
+ // If IsEmfPlus, this is the EMF+ version; else it is the WMF or EMF version
+ UINT GetVersion() const { return Version; }
+
+ // Get the EMF+ flags associated with the metafile
+ UINT GetEmfPlusFlags() const { return EmfPlusFlags; }
+
+ // Get the X Dpi of the metafile
+ REAL GetDpiX() const { return DpiX; }
+
+ // Get the Y Dpi of the metafile
+ REAL GetDpiY() const { return DpiY; }
+
+ // Get the bounds of the metafile in device units
+ VOID GetBounds (OUT Rect *rect) const
+ {
+ rect->X = X;
+ rect->Y = Y;
+ rect->Width = Width;
+ rect->Height = Height;
+ }
+
+ // Is it any type of WMF (standard or Aldus Placeable Metafile)?
+ BOOL IsWmf() const
+ {
+ return ((Type == MetafileTypeWmf) || (Type == MetafileTypeWmfAldus));
+ }
+
+ // Is this an Aldus Placeable Metafile?
+ BOOL IsWmfAldus() const { return (Type == MetafileTypeWmf); }
+
+ // Is this an EMF (not an EMF+)?
+ BOOL IsEmf() const { return (Type == MetafileTypeEmf); }
+
+ // Is this an EMF or EMF+ file?
+ BOOL IsEmfOrEmfPlus() const { return (Type >= MetafileTypeEmf); }
+
+ // Is this an EMF+ file?
+ BOOL IsEmfPlus() const { return (Type >= MetafileTypeEmfPlusOnly); }
+
+ // Is this an EMF+ dual (has dual, down-level records) file?
+ BOOL IsEmfPlusDual() const { return (Type == MetafileTypeEmfPlusDual); }
+
+ // Is this an EMF+ only (no dual records) file?
+ BOOL IsEmfPlusOnly() const { return (Type == MetafileTypeEmfPlusOnly); }
+
+ // If it's an EMF+ file, was it recorded against a display Hdc?
+ BOOL IsDisplay() const
+ {
+ return (IsEmfPlus() &&
+ ((EmfPlusFlags & GDIP_EMFPLUSFLAGS_DISPLAY) != 0));
+ }
+
+ // Get the WMF header of the metafile (if it is a WMF)
+ const METAHEADER * GetWmfHeader() const
+ {
+ if (IsWmf())
+ {
+ return &WmfHeader;
+ }
+ return NULL;
+ }
+
+ // Get the EMF header of the metafile (if it is an EMF)
+ const ENHMETAHEADER3 * GetEmfHeader() const
+ {
+ if (IsEmfOrEmfPlus())
+ {
+ return &EmfHeader;
+ }
+ return NULL;
+ }
+};
+
+#endif
+
diff --git a/core/src/fxge/Microsoft SDK/include/GdiPlusPath.h b/core/src/fxge/Microsoft SDK/include/GdiPlusPath.h
index cff0e1d9ce..99f8afdda8 100644
--- a/core/src/fxge/Microsoft SDK/include/GdiPlusPath.h
+++ b/core/src/fxge/Microsoft SDK/include/GdiPlusPath.h
@@ -1,1686 +1,1686 @@
-/**************************************************************************\
-*
-* Copyright (c) 1998-2000, Microsoft Corp. All Rights Reserved.
-*
-* Module Name:
-*
-* GdiplusPath.h
-*
-* Abstract:
-*
-* Path related declarations
-*
-\**************************************************************************/
-
-#ifndef _GDIPLUSPATH_H
-#define _GDIPLUSPATH_H
-
-class GraphicsPath : public GdiplusBase
-{
-public:
- friend class Graphics;
- friend class Region;
- friend class PathGradientBrush;
- friend class GraphicsPathIterator;
- friend class CustomLineCap;
-
- // Path constructors
-
- GraphicsPath(IN FillMode fillMode = FillModeAlternate)
- {
- nativePath = NULL;
- lastResult = DllExports::GdipCreatePath(fillMode, &nativePath);
- }
-
- GraphicsPath(IN const PointF* points,
- IN const BYTE* types,
- IN INT count,
- IN FillMode fillMode = FillModeAlternate)
- {
- nativePath = NULL;
- lastResult = DllExports::GdipCreatePath2(points,
- types,
- count,
- fillMode,
- &nativePath);
- }
-
- GraphicsPath(IN const Point* points,
- IN const BYTE* types,
- IN INT count,
- IN FillMode fillMode = FillModeAlternate)
- {
- nativePath = NULL;
- lastResult = DllExports::GdipCreatePath2I(points,
- types,
- count,
- fillMode,
- &nativePath);
- }
-
- ~GraphicsPath()
- {
- DllExports::GdipDeletePath(nativePath);
- }
-
- /**
- * Make a copy of the current path object
- */
- GraphicsPath* Clone() const
- {
- GpPath *clonepath = NULL;
-
- SetStatus(DllExports::GdipClonePath(nativePath, &clonepath));
-
- return new GraphicsPath(clonepath);
- }
-
- /**
- * Reset the path object to empty (and fill mode to FillModeAlternate)
- */
- Status Reset()
- {
- return SetStatus(DllExports::GdipResetPath(nativePath));
- }
-
- /**
- * Get path fill mode information
- */
- FillMode GetFillMode() const
- {
- FillMode fillmode = FillModeAlternate;
-
- SetStatus(DllExports::GdipGetPathFillMode(nativePath, &fillmode));
-
- return fillmode;
- }
-
- /**
- * Set path fill mode information
- */
- Status SetFillMode(IN FillMode fillmode)
- {
- return SetStatus(DllExports::GdipSetPathFillMode(nativePath, fillmode));
- }
-
- /**
- * Set/get path data
- */
- Status GetPathData(OUT PathData* pathData) const
- {
- if (pathData == NULL)
- {
- return SetStatus(InvalidParameter);
- }
-
- INT count = GetPointCount();
-
- if ((count <= 0) || (pathData->Count>0 && pathData->Count<count))
- {
- pathData->Count = 0;
- if (pathData->Points)
- {
- delete pathData->Points;
- pathData->Points = NULL;
- }
-
- if (pathData->Types)
- {
- delete pathData->Types;
- pathData->Types = NULL;
- }
-
- if (count <= 0)
- {
- return lastResult;
- }
- }
-
- if (pathData->Count == 0)
- {
- pathData->Points = new PointF[count];
- if (pathData->Points == NULL)
- {
- return SetStatus(OutOfMemory);
-
- }
- pathData->Types = new byte[count];
- if (pathData->Types == NULL)
- {
- delete pathData->Points;
- pathData->Points = NULL;
-
- return SetStatus(OutOfMemory);
- }
- pathData->Count = count;
- }
-
- return SetStatus(DllExports::GdipGetPathData(nativePath, pathData));
- }
-
- /**
- * Start/end a subpath
- */
- Status StartFigure()
- {
- return SetStatus(DllExports::GdipStartPathFigure(nativePath));
- }
-
- Status CloseFigure()
- {
- return SetStatus(DllExports::GdipClosePathFigure(nativePath));
- }
-
- Status CloseAllFigures()
- {
- return SetStatus(DllExports::GdipClosePathFigures(nativePath));
- }
-
- Status SetMarker()
- {
- return SetStatus(DllExports::GdipSetPathMarker(nativePath));
- }
-
- Status ClearMarkers()
- {
- return SetStatus(DllExports::GdipClearPathMarkers(nativePath));
- }
-
- Status Reverse()
- {
- return SetStatus(DllExports::GdipReversePath(nativePath));
- }
-
- Status GetLastPoint(OUT PointF* lastPoint) const
- {
- return SetStatus(DllExports::GdipGetPathLastPoint(nativePath, lastPoint));
- }
-
- /**
- * Add lines to the path object
- */
- // float version
- Status AddLine(IN const PointF& pt1,
- IN const PointF& pt2)
- {
- return AddLine(pt1.X, pt1.Y, pt2.X, pt2.Y);
- }
-
- Status AddLine(IN REAL x1,
- IN REAL y1,
- IN REAL x2,
- IN REAL y2)
- {
- return SetStatus(DllExports::GdipAddPathLine(nativePath, x1, y1, x2, y2));
- }
-
- Status AddLines(IN const PointF* points,
- IN INT count)
- {
- return SetStatus(DllExports::GdipAddPathLine2(nativePath, points, count));
- }
-
- // integer version
- Status AddLine(IN const Point& pt1,
- IN const Point& pt2)
- {
- return AddLine(pt1.X,
- pt1.Y,
- pt2.X,
- pt2.Y);
- }
-
- Status AddLine(IN INT x1,
- IN INT y1,
- IN INT x2,
- IN INT y2)
- {
- return SetStatus(DllExports::GdipAddPathLineI(nativePath,
- x1,
- y1,
- x2,
- y2));
- }
-
- Status AddLines(IN const Point* points,
- IN INT count)
- {
- return SetStatus(DllExports::GdipAddPathLine2I(nativePath,
- points,
- count));
- }
-
- /**
- * Add an arc to the path object
- */
- // float version
- Status AddArc(IN const RectF& rect,
- IN REAL startAngle,
- IN REAL sweepAngle)
- {
- return AddArc(rect.X, rect.Y, rect.Width, rect.Height,
- startAngle, sweepAngle);
- }
-
- Status AddArc(IN REAL x,
- IN REAL y,
- IN REAL width,
- IN REAL height,
- IN REAL startAngle,
- IN REAL sweepAngle)
- {
- return SetStatus(DllExports::GdipAddPathArc(nativePath, x, y, width, height,
- startAngle, sweepAngle));
- }
-
- // integer version
- Status AddArc(IN const Rect& rect,
- IN REAL startAngle,
- IN REAL sweepAngle)
- {
- return AddArc(rect.X, rect.Y, rect.Width, rect.Height,
- startAngle, sweepAngle);
- }
-
- Status AddArc(IN INT x,
- IN INT y,
- IN INT width,
- IN INT height,
- IN REAL startAngle,
- IN REAL sweepAngle)
- {
- return SetStatus(DllExports::GdipAddPathArcI(nativePath,
- x,
- y,
- width,
- height,
- startAngle,
- sweepAngle));
- }
-
- /**
- * Add Bezier curves to the path object
- */
- // float version
- Status AddBezier(IN const PointF& pt1,
- IN const PointF& pt2,
- IN const PointF& pt3,
- IN const PointF& pt4)
- {
- return AddBezier(pt1.X, pt1.Y, pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X,
- pt4.Y);
- }
-
- Status AddBezier(IN REAL x1,
- IN REAL y1,
- IN REAL x2,
- IN REAL y2,
- IN REAL x3,
- IN REAL y3,
- IN REAL x4,
- IN REAL y4)
- {
- return SetStatus(DllExports::GdipAddPathBezier(nativePath, x1, y1, x2, y2,
- x3, y3, x4, y4));
- }
-
- Status AddBeziers(IN const PointF* points,
- IN INT count)
- {
- return SetStatus(DllExports::GdipAddPathBeziers(nativePath, points, count));
- }
-
- // integer version
- Status AddBezier(IN const Point& pt1,
- IN const Point& pt2,
- IN const Point& pt3,
- IN const Point& pt4)
- {
- return AddBezier(pt1.X, pt1.Y, pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X,
- pt4.Y);
- }
-
- Status AddBezier(IN INT x1,
- IN INT y1,
- IN INT x2,
- IN INT y2,
- IN INT x3,
- IN INT y3,
- IN INT x4,
- IN INT y4)
- {
- return SetStatus(DllExports::GdipAddPathBezierI(nativePath,
- x1,
- y1,
- x2,
- y2,
- x3,
- y3,
- x4,
- y4));
- }
-
- Status AddBeziers(IN const Point* points,
- IN INT count)
- {
- return SetStatus(DllExports::GdipAddPathBeziersI(nativePath,
- points,
- count));
- }
-
- // float version
- Status AddCurve(IN const PointF* points,
- IN INT count)
- {
- return SetStatus(DllExports::GdipAddPathCurve(nativePath,
- points,
- count));
- }
-
- Status AddCurve(IN const PointF* points,
- IN INT count,
- IN REAL tension)
- {
- return SetStatus(DllExports::GdipAddPathCurve2(nativePath,
- points,
- count,
- tension));
- }
-
- Status AddCurve(IN const PointF* points,
- IN INT count,
- IN INT offset,
- IN INT numberOfSegments,
- IN REAL tension)
- {
- return SetStatus(DllExports::GdipAddPathCurve3(nativePath,
- points,
- count,
- offset,
- numberOfSegments,
- tension));
- }
-
- // integer version
- Status AddCurve(IN const Point* points,
- IN INT count)
- {
- return SetStatus(DllExports::GdipAddPathCurveI(nativePath,
- points,
- count));
- }
-
- Status AddCurve(IN const Point* points,
- IN INT count,
- IN REAL tension)
- {
- return SetStatus(DllExports::GdipAddPathCurve2I(nativePath,
- points,
- count,
- tension));
- }
-
- Status AddCurve(IN const Point* points,
- IN INT count,
- IN INT offset,
- IN INT numberOfSegments,
- IN REAL tension)
- {
- return SetStatus(DllExports::GdipAddPathCurve3I(nativePath,
- points,
- count,
- offset,
- numberOfSegments,
- tension));
- }
-
- // float version
- Status AddClosedCurve(IN const PointF* points,
- IN INT count)
- {
- return SetStatus(DllExports::GdipAddPathClosedCurve(nativePath,
- points,
- count));
- }
-
- Status AddClosedCurve(IN const PointF* points,
- IN INT count,
- IN REAL tension)
- {
- return SetStatus(DllExports::GdipAddPathClosedCurve2(nativePath,
- points,
- count,
- tension));
- }
-
- // integer version
- Status AddClosedCurve(IN const Point* points,
- IN INT count)
- {
- return SetStatus(DllExports::GdipAddPathClosedCurveI(nativePath,
- points,
- count));
- }
-
-
- Status AddClosedCurve(IN const Point* points,
- IN INT count,
- IN REAL tension)
- {
- return SetStatus(DllExports::GdipAddPathClosedCurve2I(nativePath,
- points,
- count,
- tension));
- }
-
-
- /**
- * Add closed shapes to the path object
- */
-
- // float version
- Status AddRectangle(IN const RectF& rect)
- {
- return SetStatus(DllExports::GdipAddPathRectangle(nativePath,
- rect.X,
- rect.Y,
- rect.Width,
- rect.Height));
- }
-
- Status AddRectangles(IN const RectF* rects,
- IN INT count)
- {
- return SetStatus(DllExports::GdipAddPathRectangles(nativePath,
- rects,
- count));
- }
-
- // integer version
- Status AddRectangle(IN const Rect& rect)
- {
- return SetStatus(DllExports::GdipAddPathRectangleI(nativePath,
- rect.X,
- rect.Y,
- rect.Width,
- rect.Height));
- }
-
- Status AddRectangles(IN const Rect* rects, INT count)
- {
- return SetStatus(DllExports::GdipAddPathRectanglesI(nativePath,
- rects,
- count));
- }
-
- // float version
- Status AddEllipse(IN const RectF& rect)
- {
- return AddEllipse(rect.X, rect.Y, rect.Width, rect.Height);
- }
-
- Status AddEllipse(IN REAL x,
- IN REAL y,
- IN REAL width,
- IN REAL height)
- {
- return SetStatus(DllExports::GdipAddPathEllipse(nativePath,
- x,
- y,
- width,
- height));
- }
-
- // integer version
- Status AddEllipse(IN const Rect& rect)
- {
- return AddEllipse(rect.X, rect.Y, rect.Width, rect.Height);
- }
-
- Status AddEllipse(IN INT x,
- IN INT y,
- IN INT width,
- IN INT height)
- {
- return SetStatus(DllExports::GdipAddPathEllipseI(nativePath,
- x,
- y,
- width,
- height));
- }
-
- // float version
- Status AddPie(IN const RectF& rect,
- IN REAL startAngle,
- IN REAL sweepAngle)
- {
- return AddPie(rect.X, rect.Y, rect.Width, rect.Height, startAngle,
- sweepAngle);
- }
-
- Status AddPie(IN REAL x,
- IN REAL y,
- IN REAL width,
- IN REAL height,
- IN REAL startAngle,
- IN REAL sweepAngle)
- {
- return SetStatus(DllExports::GdipAddPathPie(nativePath, x, y, width, height,
- startAngle, sweepAngle));
- }
-
- // integer version
- Status AddPie(IN const Rect& rect,
- IN REAL startAngle,
- IN REAL sweepAngle)
- {
- return AddPie(rect.X,
- rect.Y,
- rect.Width,
- rect.Height,
- startAngle,
- sweepAngle);
- }
-
- Status AddPie(IN INT x,
- IN INT y,
- IN INT width,
- IN INT height,
- IN REAL startAngle,
- IN REAL sweepAngle)
- {
- return SetStatus(DllExports::GdipAddPathPieI(nativePath,
- x,
- y,
- width,
- height,
- startAngle,
- sweepAngle));
- }
-
- // float version
- Status AddPolygon(IN const PointF* points,
- IN INT count)
- {
- return SetStatus(DllExports::GdipAddPathPolygon(nativePath, points, count));
- }
-
- // integer version
- Status AddPolygon(IN const Point* points,
- IN INT count)
- {
- return SetStatus(DllExports::GdipAddPathPolygonI(nativePath, points, count));
- }
-
- Status AddPath(IN const GraphicsPath* addingPath,
- IN BOOL connect)
- {
- GpPath* nativePath2 = NULL;
- if(addingPath)
- nativePath2 = addingPath->nativePath;
-
- return SetStatus(DllExports::GdipAddPathPath(nativePath, nativePath2, connect));
- }
-
- // AddString point version
-
- Status AddString(
- IN const WCHAR *string,
- IN INT length,
- IN const FontFamily *family,
- IN INT style,
- IN REAL emSize, // In world units
- IN const PointF &origin,
- IN const StringFormat *format
- )
- {
- RectF rect(origin.X, origin.Y, 0.0f, 0.0f);
-
- return SetStatus(DllExports::GdipAddPathString(
- nativePath,
- string,
- length,
- family ? family->nativeFamily : NULL,
- style,
- emSize,
- &rect,
- format ? format->nativeFormat : NULL
- ));
- }
-
- // AddString rectangle version
-
- Status AddString(
- IN const WCHAR *string,
- IN INT length,
- IN const FontFamily *family,
- IN INT style,
- IN REAL emSize, // In world units
- IN const RectF &layoutRect,
- IN const StringFormat *format
- )
- {
- return SetStatus(DllExports::GdipAddPathString(
- nativePath,
- string,
- length,
- family ? family->nativeFamily : NULL,
- style,
- emSize,
- &layoutRect,
- format ? format->nativeFormat : NULL
- ));
- }
-
- Status AddString(
- IN const WCHAR *string,
- IN INT length,
- IN const FontFamily *family,
- IN INT style,
- IN REAL emSize, // In world units
- IN const Point &origin,
- IN const StringFormat *format
- )
- {
- Rect rect(origin.X, origin.Y, 0, 0);
-
- return SetStatus(DllExports::GdipAddPathStringI(
- nativePath,
- string,
- length,
- family ? family->nativeFamily : NULL,
- style,
- emSize,
- &rect,
- format ? format->nativeFormat : NULL
- ));
- }
-
- // AddString rectangle version
-
- Status AddString(
- IN const WCHAR *string,
- IN INT length,
- IN const FontFamily *family,
- IN INT style,
- IN REAL emSize, // In world units
- IN const Rect &layoutRect,
- IN const StringFormat *format
- )
- {
- return SetStatus(DllExports::GdipAddPathStringI(
- nativePath,
- string,
- length,
- family ? family->nativeFamily : NULL,
- style,
- emSize,
- &layoutRect,
- format ? format->nativeFormat : NULL
- ));
- }
-
- /**
- * Transforms the path object
- */
- Status Transform(IN const Matrix* matrix)
- {
- if(matrix)
- return SetStatus(DllExports::GdipTransformPath(nativePath, matrix->nativeMatrix));
- else
- return Ok; // No need to transform.
- }
-
- /**
- * Get the bounds of the path object with the given transform.
- * This is not always the tightest bounds.
- *
- * Defined in GdiplusGraphics.h.
- */
- Status GetBounds(OUT RectF* bounds,
- IN const Matrix* matrix = NULL,
- IN const Pen* pen = NULL) const;
-
- // integer version (defined in GdiplusGraphics.h)
- Status GetBounds(OUT Rect* bounds,
- IN const Matrix* matrix = NULL,
- IN const Pen* pen = NULL) const;
-
- /**
- * Flatten the path object
- * Once this is called, the resultant path is made of line segments and
- * the original path information is lost.
- * When matrix = NULL, the identity matrix is assumed.
- */
- Status Flatten(IN const Matrix* matrix = NULL,
- IN REAL flatness = FlatnessDefault)
- {
- GpMatrix* nativeMatrix = NULL;
- if(matrix)
- {
- nativeMatrix = matrix->nativeMatrix;
- }
-
- return SetStatus(DllExports::GdipFlattenPath(
- nativePath,
- nativeMatrix,
- flatness
- ));
- }
-
-#ifdef DCR_USE_NEW_202903
-
- Status Widen(
- IN const Pen* pen,
- IN const Matrix* matrix = NULL,
- IN REAL flatness = FlatnessDefault
- )
- {
- GpMatrix* nativeMatrix = NULL;
- if(matrix)
- nativeMatrix = matrix->nativeMatrix;
-
- return SetStatus(DllExports::GdipWidenPath(
- nativePath,
- pen->nativePen,
- nativeMatrix,
- flatness
- ));
- }
-
-#else
-
- /**
- * Widen the path object
- * When removeSelfIntersects is TRUE, this returns the widened path
- * without self intersections.
- * When it is FALSE, it returns the widened path with selfintersections.
- * The latter is faster and is usually safficient for filling.
- */
- Status Widen(IN const Pen* pen,
- IN const Matrix* matrix = NULL,
- IN BOOL removeSelfIntersects = TRUE)
- {
- GpMatrix* nativeMatrix = NULL;
- if(matrix)
- nativeMatrix = matrix->nativeMatrix;
-
- return SetStatus(DllExports::GdipWidenPathWithMinimumResolutions(nativePath, pen->nativePen,
- 0, 0, nativeMatrix, removeSelfIntersects));
- }
-
- /**
- * Widen the path object
- * This is equivalent to Widen() method except that
- * The widths of the widened path are larger than the given
- * minimum resolutions in x and y coordinates after the transform.
- * This is usefull when widening a path with the limited device resolutions.
- */
-
- Status Widen(IN const Pen* pen,
- IN REAL minXres,
- IN REAL minYres,
- IN const Matrix* matrix = NULL,
- IN BOOL removeSelfIntersects = TRUE)
- {
- GpMatrix* nativeMatrix = NULL;
- if(matrix)
- nativeMatrix = matrix->nativeMatrix;
-
- return SetStatus(DllExports::GdipWidenPathWithMinimumResolutions(nativePath, pen->nativePen,
- minXres, minYres, nativeMatrix, removeSelfIntersects));
- }
-
-#endif // DCR_USE_NEW_202903
-
- Status Outline(
- IN const Matrix *matrix = NULL,
- IN REAL flatness = FlatnessDefault
- )
- {
- GpMatrix* nativeMatrix = NULL;
- if(matrix)
- {
- nativeMatrix = matrix->nativeMatrix;
- }
-
- return SetStatus(DllExports::GdipWindingModeOutline(
- nativePath, nativeMatrix, flatness
- ));
- }
-
- /**
- * Warp the path object
- * Once this is called, the resultant path is made of line segments and
- * the original path information is lost.
- * When matrix = NULL, the identity matrix is assumed.
- */
- Status Warp(IN const PointF* destPoints,
- IN INT count,
- IN const RectF& srcRect,
- IN const Matrix* matrix = NULL,
- IN WarpMode warpMode = WarpModePerspective,
- IN REAL flatness = FlatnessDefault)
- {
- GpMatrix* nativeMatrix = NULL;
- if(matrix)
- nativeMatrix = matrix->nativeMatrix;
-
- return SetStatus(DllExports::GdipWarpPath(
- nativePath,
- nativeMatrix,
- destPoints,
- count,
- srcRect.X,
- srcRect.Y,
- srcRect.Width,
- srcRect.Height,
- warpMode,
- flatness));
- }
-
- /**
- * Return the number of points in the current path
- */
- INT GetPointCount() const
- {
- INT count = 0;
-
- SetStatus(DllExports::GdipGetPointCount(nativePath, &count));
-
- return count;
- }
-
- /**
- * Return the path point type information
- */
- Status GetPathTypes(OUT BYTE* types,
- IN INT count) const
- {
- return SetStatus(DllExports::GdipGetPathTypes(nativePath, types, count));
- }
-
- /**
- * Return the path point coordinate information
- * @notes Should there be PathData that contains types[] and points[]
- * for get & set purposes.
- */
- Status GetPathPoints(OUT PointF* points,
- IN INT count) const
- {
- return SetStatus(DllExports::GdipGetPathPoints(nativePath, points, count));
- }
-
- // integer version
- Status GetPathPoints(OUT Point* points,
- IN INT count) const
- {
- return SetStatus(DllExports::GdipGetPathPointsI(nativePath, points, count));
- }
-
- Status GetLastStatus() const
- {
- Status lastStatus = lastResult;
- lastResult = Ok;
-
- return lastStatus;
- }
-
- /**
- * Hit testing operations
- *
- * inline implementation is in gdiplusgraphics.h.
- */
-
- BOOL IsVisible(IN const PointF& point,
- IN const Graphics* g = NULL) const
- {
- return IsVisible(point.X, point.Y, g);
- }
-
- BOOL IsVisible(IN REAL x,
- IN REAL y,
- IN const Graphics* g = NULL) const;
-
- BOOL IsVisible(IN const Point& point,
- IN const Graphics* g = NULL) const
- {
- return IsVisible(point.X, point.Y, g);
- }
-
- BOOL IsVisible(IN INT x,
- IN INT y,
- IN const Graphics* g = NULL) const;
-
- BOOL IsOutlineVisible(IN const PointF& point,
- IN const Pen* pen,
- IN const Graphics* g = NULL) const
- {
- return IsOutlineVisible(point.X, point.Y, pen, g);
- }
-
- BOOL IsOutlineVisible(IN REAL x,
- IN REAL y,
- IN const Pen* pen,
- IN const Graphics* g = NULL) const;
-
- BOOL IsOutlineVisible(IN const Point& point,
- IN const Pen* pen,
- IN const Graphics* g = NULL) const
- {
- return IsOutlineVisible(point.X, point.Y, pen, g);
- }
-
- BOOL IsOutlineVisible(IN INT x,
- IN INT y,
- IN const Pen* pen,
- IN const Graphics* g = NULL) const;
-
-protected:
-
- GraphicsPath(const GraphicsPath& path)
- {
- GpPath *clonepath = NULL;
- SetStatus(DllExports::GdipClonePath(path.nativePath, &clonepath));
- SetNativePath(clonepath);
- }
-
-#ifdef DCR_USE_NEW_250932
-
-private:
- GraphicsPath& operator=(const GraphicsPath &);
-protected:
-
-#else
-
- GraphicsPath& operator=(const GraphicsPath& path)
- {
- path;
- SetStatus(NotImplemented);
- return *this;
- }
-
-#endif
-
- GraphicsPath(GpPath* nativePath)
- {
- lastResult = Ok;
- SetNativePath(nativePath);
- }
-
- VOID SetNativePath(GpPath *nativePath)
- {
- this->nativePath = nativePath;
- }
-
- Status SetStatus(Status status) const
- {
- if (status != Ok)
- return (lastResult = status);
- else
- return status;
- }
-
-protected:
- GpPath* nativePath;
- mutable Status lastResult;
-};
-
-
-//--------------------------------------------------------------------------
-// GraphisPathIterator class
-//--------------------------------------------------------------------------
-
-class GraphicsPathIterator : public GdiplusBase
-{
-public:
-
- GraphicsPathIterator(IN const GraphicsPath* path)
- {
- GpPath* nativePath = NULL;
- if(path)
- nativePath = path->nativePath;
-
- GpPathIterator *iter = NULL;
- lastResult = DllExports::GdipCreatePathIter(&iter, nativePath);
- SetNativeIterator(iter);
- }
-
- ~GraphicsPathIterator()
- {
- DllExports::GdipDeletePathIter(nativeIterator);
- }
-
-
- INT NextSubpath(OUT INT* startIndex,
- OUT INT* endIndex,
- OUT BOOL* isClosed)
- {
- INT resultCount;
-
- SetStatus(DllExports::GdipPathIterNextSubpath(nativeIterator,
- &resultCount, startIndex, endIndex, isClosed));
-
- return resultCount;
- }
-
-
- INT NextSubpath(IN const GraphicsPath* path,
- OUT BOOL* isClosed)
- {
- GpPath* nativePath = NULL;
-
- INT resultCount;
-
- if(path)
- nativePath= path->nativePath;
-
- SetStatus(DllExports::GdipPathIterNextSubpathPath(nativeIterator,
- &resultCount, nativePath, isClosed));
-
- return resultCount;
- }
-
- INT NextPathType(OUT BYTE* pathType,
- OUT INT* startIndex,
- OUT INT* endIndex)
- {
- INT resultCount;
-
- SetStatus(DllExports::GdipPathIterNextPathType(nativeIterator,
- &resultCount, pathType, startIndex, endIndex));
-
- return resultCount;
- }
-
- INT NextMarker(OUT INT* startIndex,
- OUT INT* endIndex)
- {
- INT resultCount;
-
- SetStatus(DllExports::GdipPathIterNextMarker(nativeIterator,
- &resultCount, startIndex, endIndex));
-
- return resultCount;
- }
-
-
- INT NextMarker(IN const GraphicsPath* path)
- {
- GpPath* nativePath = NULL;
-
- INT resultCount;
-
- if(path)
- nativePath= path->nativePath;
-
- SetStatus(DllExports::GdipPathIterNextMarkerPath(nativeIterator,
- &resultCount, nativePath));
-
- return resultCount;
- }
-
- INT GetCount() const
- {
- INT resultCount;
-
- SetStatus(DllExports::GdipPathIterGetCount(nativeIterator, &resultCount));
-
- return resultCount;
- }
-
- INT GetSubpathCount() const
- {
- INT resultCount;
-
- SetStatus(DllExports::GdipPathIterGetSubpathCount(nativeIterator, &resultCount));
-
- return resultCount;
- }
-
- BOOL HasCurve() const
- {
- BOOL hasCurve;
-
- SetStatus(DllExports::GdipPathIterHasCurve(nativeIterator, &hasCurve));
-
- return hasCurve;
- }
-
- VOID Rewind()
- {
- SetStatus(DllExports::GdipPathIterRewind(nativeIterator));
- }
-
- INT Enumerate(OUT PointF *points,
- OUT BYTE *types,
- IN INT count)
- {
- INT resultCount;
-
- SetStatus(DllExports::GdipPathIterEnumerate(nativeIterator,
- &resultCount, points, types, count));
-
- return resultCount;
- }
-
- INT CopyData(OUT PointF* points,
- OUT BYTE* types,
- IN INT startIndex,
- IN INT endIndex)
- {
- INT resultCount;
-
- SetStatus(DllExports::GdipPathIterCopyData(nativeIterator,
- &resultCount, points, types, startIndex, endIndex));
-
- return resultCount;
- }
-
- Status GetLastStatus() const
- {
- Status lastStatus = lastResult;
- lastResult = Ok;
-
- return lastStatus;
- }
-
-#ifdef DCR_USE_NEW_250932
-
-private:
- GraphicsPathIterator(const GraphicsPathIterator &);
- GraphicsPathIterator& operator=(const GraphicsPathIterator &);
-
-#endif
-
-protected:
- VOID SetNativeIterator(GpPathIterator *nativeIterator)
- {
- this->nativeIterator = nativeIterator;
- }
-
- Status SetStatus(Status status) const
- {
- if (status != Ok)
- return (lastResult = status);
- else
- return status;
- }
-
-protected:
- GpPathIterator* nativeIterator;
- mutable Status lastResult;
-};
-
-
-//--------------------------------------------------------------------------
-// Represent polygon gradient brush object
-//--------------------------------------------------------------------------
-
-class PathGradientBrush : public Brush
-{
-public:
- friend class Pen;
-
- PathGradientBrush(
- IN const PointF* points,
- IN INT count,
- IN WrapMode wrapMode = WrapModeClamp)
- {
- GpPathGradient *brush = NULL;
-
- lastResult = DllExports::GdipCreatePathGradient(
- points, count,
- wrapMode, &brush);
- SetNativeBrush(brush);
- }
-
- PathGradientBrush(
- IN const Point* points,
- IN INT count,
- IN WrapMode wrapMode = WrapModeClamp)
- {
- GpPathGradient *brush = NULL;
-
- lastResult = DllExports::GdipCreatePathGradientI(
- points, count,
- wrapMode, &brush);
-
- SetNativeBrush(brush);
- }
-
- PathGradientBrush(
- IN const GraphicsPath* path
- )
- {
- GpPathGradient *brush = NULL;
-
- lastResult = DllExports::GdipCreatePathGradientFromPath(
- path->nativePath, &brush);
- SetNativeBrush(brush);
- }
-
- // Get/set colors
-
- Status GetCenterColor(OUT Color* color) const
- {
- ARGB argb;
-
- if (color == NULL)
- {
- return SetStatus(InvalidParameter);
- }
-
- SetStatus(DllExports::GdipGetPathGradientCenterColor(
- (GpPathGradient*) nativeBrush, &argb));
-
- color->SetValue(argb);
-
- return lastResult;
- }
-
- Status SetCenterColor(IN const Color& color)
- {
- SetStatus(DllExports::GdipSetPathGradientCenterColor(
- (GpPathGradient*) nativeBrush,
- color.GetValue()));
-
- return lastResult;
- }
-
- INT GetPointCount() const
- {
- INT count;
-
- SetStatus(DllExports::GdipGetPathGradientPointCount(
- (GpPathGradient*) nativeBrush, &count));
-
- return count;
- }
-
- INT GetSurroundColorCount() const
- {
- INT count;
-
- SetStatus(DllExports::GdipGetPathGradientSurroundColorCount(
- (GpPathGradient*) nativeBrush, &count));
-
- return count;
- }
-
- Status GetSurroundColors(OUT Color* colors,
- IN OUT INT* count) const
- {
- if(colors == NULL || count == NULL)
- {
- return SetStatus(InvalidParameter);
- }
-
- INT count1;
-
- SetStatus(DllExports::GdipGetPathGradientSurroundColorCount(
- (GpPathGradient*) nativeBrush, &count1));
-
- if(lastResult != Ok)
- return lastResult;
-
- if((*count < count1) || (count1 <= 0))
- return SetStatus(InsufficientBuffer);
-
- ARGB* argbs = (ARGB*) new ARGB[count1];
- if(argbs == NULL)
- return SetStatus(OutOfMemory);
-
- SetStatus(DllExports::GdipGetPathGradientSurroundColorsWithCount(
- (GpPathGradient*)nativeBrush, argbs, &count1));
-
- if(lastResult == Ok)
- {
- for(INT i = 0; i < count1; i++)
- {
- colors[i].SetValue(argbs[i]);
- }
- *count = count1;
- }
-
- delete [] argbs;
- return lastResult;
- }
-
- Status SetSurroundColors(IN const Color* colors,
- IN OUT INT* count)
- {
- if(colors == NULL || count == NULL)
- {
- return SetStatus(InvalidParameter);
- }
-
- INT count1 = GetPointCount();
-
- if((*count > count1) || (count1 <= 0))
- return SetStatus(InvalidParameter);
-
- count1 = *count;
-
- ARGB* argbs = (ARGB*) new ARGB[count1];
- if(argbs == NULL)
- return SetStatus(OutOfMemory);
-
- for(INT i = 0; i < count1; i++)
- {
- argbs[i] = colors[i].GetValue();
- }
-
- SetStatus(DllExports::GdipSetPathGradientSurroundColorsWithCount(
- (GpPathGradient*)nativeBrush, argbs, &count1));
-
- if(lastResult == Ok)
- *count = count1;
-
- delete [] argbs;
-
- return lastResult;
- }
-
- Status GetGraphicsPath(OUT GraphicsPath* path) const
- {
- if(path == NULL)
- return SetStatus(InvalidParameter);
-
- return SetStatus(DllExports::GdipGetPathGradientPath(
- (GpPathGradient*)nativeBrush, path->nativePath));
- }
-
- Status SetGraphicsPath(IN const GraphicsPath* path)
- {
- if(path == NULL)
- return SetStatus(InvalidParameter);
-
- return SetStatus(DllExports::GdipSetPathGradientPath(
- (GpPathGradient*)nativeBrush, path->nativePath));
- }
-
- Status GetCenterPoint(OUT PointF* point) const
- {
- return SetStatus(DllExports::GdipGetPathGradientCenterPoint(
- (GpPathGradient*)nativeBrush,
- point));
- }
-
-
- Status GetCenterPoint(OUT Point* point) const
- {
- return SetStatus(DllExports::GdipGetPathGradientCenterPointI(
- (GpPathGradient*)nativeBrush,
- point));
- }
-
- Status SetCenterPoint(IN const PointF& point)
- {
- return SetStatus(DllExports::GdipSetPathGradientCenterPoint(
- (GpPathGradient*)nativeBrush,
- &point));
- }
-
- Status SetCenterPoint(IN const Point& point)
- {
- return SetStatus(DllExports::GdipSetPathGradientCenterPointI(
- (GpPathGradient*)nativeBrush,
- &point));
- }
-
- Status GetRectangle(OUT RectF* rect) const
- {
- return SetStatus(DllExports::GdipGetPathGradientRect(
- (GpPathGradient*)nativeBrush, rect));
- }
-
- Status GetRectangle(OUT Rect* rect) const
- {
- return SetStatus(DllExports::GdipGetPathGradientRectI(
- (GpPathGradient*)nativeBrush, rect));
- }
-
- // Gamma correction.
-
- Status SetGammaCorrection(IN BOOL useGammaCorrection)
- {
- return SetStatus(DllExports::GdipSetPathGradientGammaCorrection(
- (GpPathGradient*)nativeBrush, useGammaCorrection));
- }
-
- BOOL GetGammaCorrection() const
- {
- BOOL useGammaCorrection;
-
- SetStatus(DllExports::GdipGetPathGradientGammaCorrection(
- (GpPathGradient*)nativeBrush, &useGammaCorrection));
-
- return useGammaCorrection;
- }
-
- INT GetBlendCount() const
- {
- INT count = 0;
-
- SetStatus(DllExports::GdipGetPathGradientBlendCount(
- (GpPathGradient*) nativeBrush, &count));
-
- return count;
- }
-
- Status GetBlend(OUT REAL* blendFactors,
- OUT REAL* blendPositions,
- IN INT count) const
- {
- return SetStatus(DllExports::GdipGetPathGradientBlend(
- (GpPathGradient*)nativeBrush,
- blendFactors, blendPositions, count));
- }
-
- Status SetBlend(IN const REAL* blendFactors,
- IN const REAL* blendPositions,
- IN INT count)
- {
- return SetStatus(DllExports::GdipSetPathGradientBlend(
- (GpPathGradient*)nativeBrush,
- blendFactors, blendPositions, count));
- }
-
- INT GetInterpolationColorCount() const
- {
- INT count = 0;
-
- SetStatus(DllExports::GdipGetPathGradientPresetBlendCount(
- (GpPathGradient*) nativeBrush, &count));
-
- return count;
- }
-
- Status SetInterpolationColors(IN const Color* presetColors,
- IN const REAL* blendPositions,
- IN INT count)
- {
- if ((count <= 0) || !presetColors)
- {
- return SetStatus(InvalidParameter);
- }
-
- ARGB* argbs = (ARGB*) new ARGB[count];
- if(argbs)
- {
- for(INT i = 0; i < count; i++)
- {
- argbs[i] = presetColors[i].GetValue();
- }
-
- Status status = SetStatus(DllExports::GdipSetPathGradientPresetBlend(
- (GpPathGradient*) nativeBrush,
- argbs,
- blendPositions,
- count));
- delete[] argbs;
- return status;
- }
- else
- {
- return SetStatus(OutOfMemory);
- }
- }
-
- Status GetInterpolationColors(OUT Color* presetColors,
- OUT REAL* blendPositions,
- IN INT count) const
- {
- if ((count <= 0) || !presetColors)
- {
- return SetStatus(InvalidParameter);
- }
-
- ARGB* argbs = (ARGB*) new ARGB[count];
-
- if (!argbs)
- {
- return SetStatus(OutOfMemory);
- }
-
- GpStatus status = SetStatus(DllExports::GdipGetPathGradientPresetBlend(
- (GpPathGradient*)nativeBrush,
- argbs,
- blendPositions,
- count));
-
- for(INT i = 0; i < count; i++)
- {
- presetColors[i] = Color(argbs[i]);
- }
- delete [] argbs;
-
- return status;
- }
-
- Status SetBlendBellShape(IN REAL focus,
- IN REAL scale = 1.0)
- {
- return SetStatus(DllExports::GdipSetPathGradientSigmaBlend(
- (GpPathGradient*)nativeBrush, focus, scale));
- }
-
- #ifdef DCR_USE_NEW_145135
- Status SetBlendTriangularShape(
- IN REAL focus,
- IN REAL scale = 1.0
- )
- #else
- Status SetBlendTrianglarShape(IN REAL focus,
- IN REAL scale = 1.0)
- #endif
- {
- return SetStatus(DllExports::GdipSetPathGradientLinearBlend(
- (GpPathGradient*)nativeBrush, focus, scale));
- }
-
- /**
- * Get/set brush transform
- */
- Status GetTransform(OUT Matrix *matrix) const
- {
- return SetStatus(DllExports::GdipGetPathGradientTransform(
- (GpPathGradient*) nativeBrush, matrix->nativeMatrix));
- }
-
- Status SetTransform(IN const Matrix* matrix)
- {
- return SetStatus(DllExports::GdipSetPathGradientTransform(
- (GpPathGradient*) nativeBrush, matrix->nativeMatrix));
- }
-
- Status ResetTransform()
- {
- return SetStatus(DllExports::GdipResetPathGradientTransform((GpPathGradient*)nativeBrush));
- }
-
- Status MultiplyTransform(IN const Matrix* matrix,
- IN MatrixOrder order = MatrixOrderPrepend)
- {
- return SetStatus(DllExports::GdipMultiplyPathGradientTransform((GpPathGradient*)nativeBrush,
- matrix->nativeMatrix,
- order));
- }
-
- Status TranslateTransform(IN REAL dx,
- IN REAL dy,
- IN MatrixOrder order = MatrixOrderPrepend)
- {
- return SetStatus(DllExports::GdipTranslatePathGradientTransform((GpPathGradient*)nativeBrush,
- dx, dy, order));
- }
-
- Status ScaleTransform(IN REAL sx,
- IN REAL sy,
- IN MatrixOrder order = MatrixOrderPrepend)
- {
- return SetStatus(DllExports::GdipScalePathGradientTransform((GpPathGradient*)nativeBrush,
- sx, sy, order));
- }
-
- Status RotateTransform(IN REAL angle,
- IN MatrixOrder order = MatrixOrderPrepend)
- {
- return SetStatus(DllExports::GdipRotatePathGradientTransform((GpPathGradient*)nativeBrush,
- angle, order));
- }
-
- /**
- * Get/set brush focus scales
- */
- Status GetFocusScales(OUT REAL* xScale,
- OUT REAL* yScale) const
- {
- return SetStatus(DllExports::GdipGetPathGradientFocusScales(
- (GpPathGradient*) nativeBrush, xScale, yScale));
- }
-
- Status SetFocusScales(IN REAL xScale,
- IN REAL yScale)
- {
- return SetStatus(DllExports::GdipSetPathGradientFocusScales(
- (GpPathGradient*) nativeBrush, xScale, yScale));
- }
-
- /**
- * Get/set brush wrapping mode
- */
- WrapMode GetWrapMode() const
- {
- WrapMode wrapMode;
-
- SetStatus(DllExports::GdipGetPathGradientWrapMode(
- (GpPathGradient*) nativeBrush, &wrapMode));
-
- return wrapMode;
- }
-
- Status SetWrapMode(IN WrapMode wrapMode)
- {
- return SetStatus(DllExports::GdipSetPathGradientWrapMode(
- (GpPathGradient*) nativeBrush, wrapMode));
- }
-
-#ifdef DCR_USE_NEW_250932
-
-private:
- PathGradientBrush(const PathGradientBrush &);
- PathGradientBrush& operator=(const PathGradientBrush &);
-
-#endif
-
-protected:
-
- PathGradientBrush()
- {
- }
-};
-
-
-#endif // !_GRAPHICSPATH_HPP
+/**************************************************************************\
+*
+* Copyright (c) 1998-2000, Microsoft Corp. All Rights Reserved.
+*
+* Module Name:
+*
+* GdiplusPath.h
+*
+* Abstract:
+*
+* Path related declarations
+*
+\**************************************************************************/
+
+#ifndef _GDIPLUSPATH_H
+#define _GDIPLUSPATH_H
+
+class GraphicsPath : public GdiplusBase
+{
+public:
+ friend class Graphics;
+ friend class Region;
+ friend class PathGradientBrush;
+ friend class GraphicsPathIterator;
+ friend class CustomLineCap;
+
+ // Path constructors
+
+ GraphicsPath(IN FillMode fillMode = FillModeAlternate)
+ {
+ nativePath = NULL;
+ lastResult = DllExports::GdipCreatePath(fillMode, &nativePath);
+ }
+
+ GraphicsPath(IN const PointF* points,
+ IN const BYTE* types,
+ IN INT count,
+ IN FillMode fillMode = FillModeAlternate)
+ {
+ nativePath = NULL;
+ lastResult = DllExports::GdipCreatePath2(points,
+ types,
+ count,
+ fillMode,
+ &nativePath);
+ }
+
+ GraphicsPath(IN const Point* points,
+ IN const BYTE* types,
+ IN INT count,
+ IN FillMode fillMode = FillModeAlternate)
+ {
+ nativePath = NULL;
+ lastResult = DllExports::GdipCreatePath2I(points,
+ types,
+ count,
+ fillMode,
+ &nativePath);
+ }
+
+ ~GraphicsPath()
+ {
+ DllExports::GdipDeletePath(nativePath);
+ }
+
+ /**
+ * Make a copy of the current path object
+ */
+ GraphicsPath* Clone() const
+ {
+ GpPath *clonepath = NULL;
+
+ SetStatus(DllExports::GdipClonePath(nativePath, &clonepath));
+
+ return new GraphicsPath(clonepath);
+ }
+
+ /**
+ * Reset the path object to empty (and fill mode to FillModeAlternate)
+ */
+ Status Reset()
+ {
+ return SetStatus(DllExports::GdipResetPath(nativePath));
+ }
+
+ /**
+ * Get path fill mode information
+ */
+ FillMode GetFillMode() const
+ {
+ FillMode fillmode = FillModeAlternate;
+
+ SetStatus(DllExports::GdipGetPathFillMode(nativePath, &fillmode));
+
+ return fillmode;
+ }
+
+ /**
+ * Set path fill mode information
+ */
+ Status SetFillMode(IN FillMode fillmode)
+ {
+ return SetStatus(DllExports::GdipSetPathFillMode(nativePath, fillmode));
+ }
+
+ /**
+ * Set/get path data
+ */
+ Status GetPathData(OUT PathData* pathData) const
+ {
+ if (pathData == NULL)
+ {
+ return SetStatus(InvalidParameter);
+ }
+
+ INT count = GetPointCount();
+
+ if ((count <= 0) || (pathData->Count>0 && pathData->Count<count))
+ {
+ pathData->Count = 0;
+ if (pathData->Points)
+ {
+ delete pathData->Points;
+ pathData->Points = NULL;
+ }
+
+ if (pathData->Types)
+ {
+ delete pathData->Types;
+ pathData->Types = NULL;
+ }
+
+ if (count <= 0)
+ {
+ return lastResult;
+ }
+ }
+
+ if (pathData->Count == 0)
+ {
+ pathData->Points = new PointF[count];
+ if (pathData->Points == NULL)
+ {
+ return SetStatus(OutOfMemory);
+
+ }
+ pathData->Types = new byte[count];
+ if (pathData->Types == NULL)
+ {
+ delete pathData->Points;
+ pathData->Points = NULL;
+
+ return SetStatus(OutOfMemory);
+ }
+ pathData->Count = count;
+ }
+
+ return SetStatus(DllExports::GdipGetPathData(nativePath, pathData));
+ }
+
+ /**
+ * Start/end a subpath
+ */
+ Status StartFigure()
+ {
+ return SetStatus(DllExports::GdipStartPathFigure(nativePath));
+ }
+
+ Status CloseFigure()
+ {
+ return SetStatus(DllExports::GdipClosePathFigure(nativePath));
+ }
+
+ Status CloseAllFigures()
+ {
+ return SetStatus(DllExports::GdipClosePathFigures(nativePath));
+ }
+
+ Status SetMarker()
+ {
+ return SetStatus(DllExports::GdipSetPathMarker(nativePath));
+ }
+
+ Status ClearMarkers()
+ {
+ return SetStatus(DllExports::GdipClearPathMarkers(nativePath));
+ }
+
+ Status Reverse()
+ {
+ return SetStatus(DllExports::GdipReversePath(nativePath));
+ }
+
+ Status GetLastPoint(OUT PointF* lastPoint) const
+ {
+ return SetStatus(DllExports::GdipGetPathLastPoint(nativePath, lastPoint));
+ }
+
+ /**
+ * Add lines to the path object
+ */
+ // float version
+ Status AddLine(IN const PointF& pt1,
+ IN const PointF& pt2)
+ {
+ return AddLine(pt1.X, pt1.Y, pt2.X, pt2.Y);
+ }
+
+ Status AddLine(IN REAL x1,
+ IN REAL y1,
+ IN REAL x2,
+ IN REAL y2)
+ {
+ return SetStatus(DllExports::GdipAddPathLine(nativePath, x1, y1, x2, y2));
+ }
+
+ Status AddLines(IN const PointF* points,
+ IN INT count)
+ {
+ return SetStatus(DllExports::GdipAddPathLine2(nativePath, points, count));
+ }
+
+ // integer version
+ Status AddLine(IN const Point& pt1,
+ IN const Point& pt2)
+ {
+ return AddLine(pt1.X,
+ pt1.Y,
+ pt2.X,
+ pt2.Y);
+ }
+
+ Status AddLine(IN INT x1,
+ IN INT y1,
+ IN INT x2,
+ IN INT y2)
+ {
+ return SetStatus(DllExports::GdipAddPathLineI(nativePath,
+ x1,
+ y1,
+ x2,
+ y2));
+ }
+
+ Status AddLines(IN const Point* points,
+ IN INT count)
+ {
+ return SetStatus(DllExports::GdipAddPathLine2I(nativePath,
+ points,
+ count));
+ }
+
+ /**
+ * Add an arc to the path object
+ */
+ // float version
+ Status AddArc(IN const RectF& rect,
+ IN REAL startAngle,
+ IN REAL sweepAngle)
+ {
+ return AddArc(rect.X, rect.Y, rect.Width, rect.Height,
+ startAngle, sweepAngle);
+ }
+
+ Status AddArc(IN REAL x,
+ IN REAL y,
+ IN REAL width,
+ IN REAL height,
+ IN REAL startAngle,
+ IN REAL sweepAngle)
+ {
+ return SetStatus(DllExports::GdipAddPathArc(nativePath, x, y, width, height,
+ startAngle, sweepAngle));
+ }
+
+ // integer version
+ Status AddArc(IN const Rect& rect,
+ IN REAL startAngle,
+ IN REAL sweepAngle)
+ {
+ return AddArc(rect.X, rect.Y, rect.Width, rect.Height,
+ startAngle, sweepAngle);
+ }
+
+ Status AddArc(IN INT x,
+ IN INT y,
+ IN INT width,
+ IN INT height,
+ IN REAL startAngle,
+ IN REAL sweepAngle)
+ {
+ return SetStatus(DllExports::GdipAddPathArcI(nativePath,
+ x,
+ y,
+ width,
+ height,
+ startAngle,
+ sweepAngle));
+ }
+
+ /**
+ * Add Bezier curves to the path object
+ */
+ // float version
+ Status AddBezier(IN const PointF& pt1,
+ IN const PointF& pt2,
+ IN const PointF& pt3,
+ IN const PointF& pt4)
+ {
+ return AddBezier(pt1.X, pt1.Y, pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X,
+ pt4.Y);
+ }
+
+ Status AddBezier(IN REAL x1,
+ IN REAL y1,
+ IN REAL x2,
+ IN REAL y2,
+ IN REAL x3,
+ IN REAL y3,
+ IN REAL x4,
+ IN REAL y4)
+ {
+ return SetStatus(DllExports::GdipAddPathBezier(nativePath, x1, y1, x2, y2,
+ x3, y3, x4, y4));
+ }
+
+ Status AddBeziers(IN const PointF* points,
+ IN INT count)
+ {
+ return SetStatus(DllExports::GdipAddPathBeziers(nativePath, points, count));
+ }
+
+ // integer version
+ Status AddBezier(IN const Point& pt1,
+ IN const Point& pt2,
+ IN const Point& pt3,
+ IN const Point& pt4)
+ {
+ return AddBezier(pt1.X, pt1.Y, pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X,
+ pt4.Y);
+ }
+
+ Status AddBezier(IN INT x1,
+ IN INT y1,
+ IN INT x2,
+ IN INT y2,
+ IN INT x3,
+ IN INT y3,
+ IN INT x4,
+ IN INT y4)
+ {
+ return SetStatus(DllExports::GdipAddPathBezierI(nativePath,
+ x1,
+ y1,
+ x2,
+ y2,
+ x3,
+ y3,
+ x4,
+ y4));
+ }
+
+ Status AddBeziers(IN const Point* points,
+ IN INT count)
+ {
+ return SetStatus(DllExports::GdipAddPathBeziersI(nativePath,
+ points,
+ count));
+ }
+
+ // float version
+ Status AddCurve(IN const PointF* points,
+ IN INT count)
+ {
+ return SetStatus(DllExports::GdipAddPathCurve(nativePath,
+ points,
+ count));
+ }
+
+ Status AddCurve(IN const PointF* points,
+ IN INT count,
+ IN REAL tension)
+ {
+ return SetStatus(DllExports::GdipAddPathCurve2(nativePath,
+ points,
+ count,
+ tension));
+ }
+
+ Status AddCurve(IN const PointF* points,
+ IN INT count,
+ IN INT offset,
+ IN INT numberOfSegments,
+ IN REAL tension)
+ {
+ return SetStatus(DllExports::GdipAddPathCurve3(nativePath,
+ points,
+ count,
+ offset,
+ numberOfSegments,
+ tension));
+ }
+
+ // integer version
+ Status AddCurve(IN const Point* points,
+ IN INT count)
+ {
+ return SetStatus(DllExports::GdipAddPathCurveI(nativePath,
+ points,
+ count));
+ }
+
+ Status AddCurve(IN const Point* points,
+ IN INT count,
+ IN REAL tension)
+ {
+ return SetStatus(DllExports::GdipAddPathCurve2I(nativePath,
+ points,
+ count,
+ tension));
+ }
+
+ Status AddCurve(IN const Point* points,
+ IN INT count,
+ IN INT offset,
+ IN INT numberOfSegments,
+ IN REAL tension)
+ {
+ return SetStatus(DllExports::GdipAddPathCurve3I(nativePath,
+ points,
+ count,
+ offset,
+ numberOfSegments,
+ tension));
+ }
+
+ // float version
+ Status AddClosedCurve(IN const PointF* points,
+ IN INT count)
+ {
+ return SetStatus(DllExports::GdipAddPathClosedCurve(nativePath,
+ points,
+ count));
+ }
+
+ Status AddClosedCurve(IN const PointF* points,
+ IN INT count,
+ IN REAL tension)
+ {
+ return SetStatus(DllExports::GdipAddPathClosedCurve2(nativePath,
+ points,
+ count,
+ tension));
+ }
+
+ // integer version
+ Status AddClosedCurve(IN const Point* points,
+ IN INT count)
+ {
+ return SetStatus(DllExports::GdipAddPathClosedCurveI(nativePath,
+ points,
+ count));
+ }
+
+
+ Status AddClosedCurve(IN const Point* points,
+ IN INT count,
+ IN REAL tension)
+ {
+ return SetStatus(DllExports::GdipAddPathClosedCurve2I(nativePath,
+ points,
+ count,
+ tension));
+ }
+
+
+ /**
+ * Add closed shapes to the path object
+ */
+
+ // float version
+ Status AddRectangle(IN const RectF& rect)
+ {
+ return SetStatus(DllExports::GdipAddPathRectangle(nativePath,
+ rect.X,
+ rect.Y,
+ rect.Width,
+ rect.Height));
+ }
+
+ Status AddRectangles(IN const RectF* rects,
+ IN INT count)
+ {
+ return SetStatus(DllExports::GdipAddPathRectangles(nativePath,
+ rects,
+ count));
+ }
+
+ // integer version
+ Status AddRectangle(IN const Rect& rect)
+ {
+ return SetStatus(DllExports::GdipAddPathRectangleI(nativePath,
+ rect.X,
+ rect.Y,
+ rect.Width,
+ rect.Height));
+ }
+
+ Status AddRectangles(IN const Rect* rects, INT count)
+ {
+ return SetStatus(DllExports::GdipAddPathRectanglesI(nativePath,
+ rects,
+ count));
+ }
+
+ // float version
+ Status AddEllipse(IN const RectF& rect)
+ {
+ return AddEllipse(rect.X, rect.Y, rect.Width, rect.Height);
+ }
+
+ Status AddEllipse(IN REAL x,
+ IN REAL y,
+ IN REAL width,
+ IN REAL height)
+ {
+ return SetStatus(DllExports::GdipAddPathEllipse(nativePath,
+ x,
+ y,
+ width,
+ height));
+ }
+
+ // integer version
+ Status AddEllipse(IN const Rect& rect)
+ {
+ return AddEllipse(rect.X, rect.Y, rect.Width, rect.Height);
+ }
+
+ Status AddEllipse(IN INT x,
+ IN INT y,
+ IN INT width,
+ IN INT height)
+ {
+ return SetStatus(DllExports::GdipAddPathEllipseI(nativePath,
+ x,
+ y,
+ width,
+ height));
+ }
+
+ // float version
+ Status AddPie(IN const RectF& rect,
+ IN REAL startAngle,
+ IN REAL sweepAngle)
+ {
+ return AddPie(rect.X, rect.Y, rect.Width, rect.Height, startAngle,
+ sweepAngle);
+ }
+
+ Status AddPie(IN REAL x,
+ IN REAL y,
+ IN REAL width,
+ IN REAL height,
+ IN REAL startAngle,
+ IN REAL sweepAngle)
+ {
+ return SetStatus(DllExports::GdipAddPathPie(nativePath, x, y, width, height,
+ startAngle, sweepAngle));
+ }
+
+ // integer version
+ Status AddPie(IN const Rect& rect,
+ IN REAL startAngle,
+ IN REAL sweepAngle)
+ {
+ return AddPie(rect.X,
+ rect.Y,
+ rect.Width,
+ rect.Height,
+ startAngle,
+ sweepAngle);
+ }
+
+ Status AddPie(IN INT x,
+ IN INT y,
+ IN INT width,
+ IN INT height,
+ IN REAL startAngle,
+ IN REAL sweepAngle)
+ {
+ return SetStatus(DllExports::GdipAddPathPieI(nativePath,
+ x,
+ y,
+ width,
+ height,
+ startAngle,
+ sweepAngle));
+ }
+
+ // float version
+ Status AddPolygon(IN const PointF* points,
+ IN INT count)
+ {
+ return SetStatus(DllExports::GdipAddPathPolygon(nativePath, points, count));
+ }
+
+ // integer version
+ Status AddPolygon(IN const Point* points,
+ IN INT count)
+ {
+ return SetStatus(DllExports::GdipAddPathPolygonI(nativePath, points, count));
+ }
+
+ Status AddPath(IN const GraphicsPath* addingPath,
+ IN BOOL connect)
+ {
+ GpPath* nativePath2 = NULL;
+ if(addingPath)
+ nativePath2 = addingPath->nativePath;
+
+ return SetStatus(DllExports::GdipAddPathPath(nativePath, nativePath2, connect));
+ }
+
+ // AddString point version
+
+ Status AddString(
+ IN const WCHAR *string,
+ IN INT length,
+ IN const FontFamily *family,
+ IN INT style,
+ IN REAL emSize, // In world units
+ IN const PointF &origin,
+ IN const StringFormat *format
+ )
+ {
+ RectF rect(origin.X, origin.Y, 0.0f, 0.0f);
+
+ return SetStatus(DllExports::GdipAddPathString(
+ nativePath,
+ string,
+ length,
+ family ? family->nativeFamily : NULL,
+ style,
+ emSize,
+ &rect,
+ format ? format->nativeFormat : NULL
+ ));
+ }
+
+ // AddString rectangle version
+
+ Status AddString(
+ IN const WCHAR *string,
+ IN INT length,
+ IN const FontFamily *family,
+ IN INT style,
+ IN REAL emSize, // In world units
+ IN const RectF &layoutRect,
+ IN const StringFormat *format
+ )
+ {
+ return SetStatus(DllExports::GdipAddPathString(
+ nativePath,
+ string,
+ length,
+ family ? family->nativeFamily : NULL,
+ style,
+ emSize,
+ &layoutRect,
+ format ? format->nativeFormat : NULL
+ ));
+ }
+
+ Status AddString(
+ IN const WCHAR *string,
+ IN INT length,
+ IN const FontFamily *family,
+ IN INT style,
+ IN REAL emSize, // In world units
+ IN const Point &origin,
+ IN const StringFormat *format
+ )
+ {
+ Rect rect(origin.X, origin.Y, 0, 0);
+
+ return SetStatus(DllExports::GdipAddPathStringI(
+ nativePath,
+ string,
+ length,
+ family ? family->nativeFamily : NULL,
+ style,
+ emSize,
+ &rect,
+ format ? format->nativeFormat : NULL
+ ));
+ }
+
+ // AddString rectangle version
+
+ Status AddString(
+ IN const WCHAR *string,
+ IN INT length,
+ IN const FontFamily *family,
+ IN INT style,
+ IN REAL emSize, // In world units
+ IN const Rect &layoutRect,
+ IN const StringFormat *format
+ )
+ {
+ return SetStatus(DllExports::GdipAddPathStringI(
+ nativePath,
+ string,
+ length,
+ family ? family->nativeFamily : NULL,
+ style,
+ emSize,
+ &layoutRect,
+ format ? format->nativeFormat : NULL
+ ));
+ }
+
+ /**
+ * Transforms the path object
+ */
+ Status Transform(IN const Matrix* matrix)
+ {
+ if(matrix)
+ return SetStatus(DllExports::GdipTransformPath(nativePath, matrix->nativeMatrix));
+ else
+ return Ok; // No need to transform.
+ }
+
+ /**
+ * Get the bounds of the path object with the given transform.
+ * This is not always the tightest bounds.
+ *
+ * Defined in GdiplusGraphics.h.
+ */
+ Status GetBounds(OUT RectF* bounds,
+ IN const Matrix* matrix = NULL,
+ IN const Pen* pen = NULL) const;
+
+ // integer version (defined in GdiplusGraphics.h)
+ Status GetBounds(OUT Rect* bounds,
+ IN const Matrix* matrix = NULL,
+ IN const Pen* pen = NULL) const;
+
+ /**
+ * Flatten the path object
+ * Once this is called, the resultant path is made of line segments and
+ * the original path information is lost.
+ * When matrix = NULL, the identity matrix is assumed.
+ */
+ Status Flatten(IN const Matrix* matrix = NULL,
+ IN REAL flatness = FlatnessDefault)
+ {
+ GpMatrix* nativeMatrix = NULL;
+ if(matrix)
+ {
+ nativeMatrix = matrix->nativeMatrix;
+ }
+
+ return SetStatus(DllExports::GdipFlattenPath(
+ nativePath,
+ nativeMatrix,
+ flatness
+ ));
+ }
+
+#ifdef DCR_USE_NEW_202903
+
+ Status Widen(
+ IN const Pen* pen,
+ IN const Matrix* matrix = NULL,
+ IN REAL flatness = FlatnessDefault
+ )
+ {
+ GpMatrix* nativeMatrix = NULL;
+ if(matrix)
+ nativeMatrix = matrix->nativeMatrix;
+
+ return SetStatus(DllExports::GdipWidenPath(
+ nativePath,
+ pen->nativePen,
+ nativeMatrix,
+ flatness
+ ));
+ }
+
+#else
+
+ /**
+ * Widen the path object
+ * When removeSelfIntersects is TRUE, this returns the widened path
+ * without self intersections.
+ * When it is FALSE, it returns the widened path with selfintersections.
+ * The latter is faster and is usually safficient for filling.
+ */
+ Status Widen(IN const Pen* pen,
+ IN const Matrix* matrix = NULL,
+ IN BOOL removeSelfIntersects = TRUE)
+ {
+ GpMatrix* nativeMatrix = NULL;
+ if(matrix)
+ nativeMatrix = matrix->nativeMatrix;
+
+ return SetStatus(DllExports::GdipWidenPathWithMinimumResolutions(nativePath, pen->nativePen,
+ 0, 0, nativeMatrix, removeSelfIntersects));
+ }
+
+ /**
+ * Widen the path object
+ * This is equivalent to Widen() method except that
+ * The widths of the widened path are larger than the given
+ * minimum resolutions in x and y coordinates after the transform.
+ * This is usefull when widening a path with the limited device resolutions.
+ */
+
+ Status Widen(IN const Pen* pen,
+ IN REAL minXres,
+ IN REAL minYres,
+ IN const Matrix* matrix = NULL,
+ IN BOOL removeSelfIntersects = TRUE)
+ {
+ GpMatrix* nativeMatrix = NULL;
+ if(matrix)
+ nativeMatrix = matrix->nativeMatrix;
+
+ return SetStatus(DllExports::GdipWidenPathWithMinimumResolutions(nativePath, pen->nativePen,
+ minXres, minYres, nativeMatrix, removeSelfIntersects));
+ }
+
+#endif // DCR_USE_NEW_202903
+
+ Status Outline(
+ IN const Matrix *matrix = NULL,
+ IN REAL flatness = FlatnessDefault
+ )
+ {
+ GpMatrix* nativeMatrix = NULL;
+ if(matrix)
+ {
+ nativeMatrix = matrix->nativeMatrix;
+ }
+
+ return SetStatus(DllExports::GdipWindingModeOutline(
+ nativePath, nativeMatrix, flatness
+ ));
+ }
+
+ /**
+ * Warp the path object
+ * Once this is called, the resultant path is made of line segments and
+ * the original path information is lost.
+ * When matrix = NULL, the identity matrix is assumed.
+ */
+ Status Warp(IN const PointF* destPoints,
+ IN INT count,
+ IN const RectF& srcRect,
+ IN const Matrix* matrix = NULL,
+ IN WarpMode warpMode = WarpModePerspective,
+ IN REAL flatness = FlatnessDefault)
+ {
+ GpMatrix* nativeMatrix = NULL;
+ if(matrix)
+ nativeMatrix = matrix->nativeMatrix;
+
+ return SetStatus(DllExports::GdipWarpPath(
+ nativePath,
+ nativeMatrix,
+ destPoints,
+ count,
+ srcRect.X,
+ srcRect.Y,
+ srcRect.Width,
+ srcRect.Height,
+ warpMode,
+ flatness));
+ }
+
+ /**
+ * Return the number of points in the current path
+ */
+ INT GetPointCount() const
+ {
+ INT count = 0;
+
+ SetStatus(DllExports::GdipGetPointCount(nativePath, &count));
+
+ return count;
+ }
+
+ /**
+ * Return the path point type information
+ */
+ Status GetPathTypes(OUT BYTE* types,
+ IN INT count) const
+ {
+ return SetStatus(DllExports::GdipGetPathTypes(nativePath, types, count));
+ }
+
+ /**
+ * Return the path point coordinate information
+ * @notes Should there be PathData that contains types[] and points[]
+ * for get & set purposes.
+ */
+ Status GetPathPoints(OUT PointF* points,
+ IN INT count) const
+ {
+ return SetStatus(DllExports::GdipGetPathPoints(nativePath, points, count));
+ }
+
+ // integer version
+ Status GetPathPoints(OUT Point* points,
+ IN INT count) const
+ {
+ return SetStatus(DllExports::GdipGetPathPointsI(nativePath, points, count));
+ }
+
+ Status GetLastStatus() const
+ {
+ Status lastStatus = lastResult;
+ lastResult = Ok;
+
+ return lastStatus;
+ }
+
+ /**
+ * Hit testing operations
+ *
+ * inline implementation is in gdiplusgraphics.h.
+ */
+
+ BOOL IsVisible(IN const PointF& point,
+ IN const Graphics* g = NULL) const
+ {
+ return IsVisible(point.X, point.Y, g);
+ }
+
+ BOOL IsVisible(IN REAL x,
+ IN REAL y,
+ IN const Graphics* g = NULL) const;
+
+ BOOL IsVisible(IN const Point& point,
+ IN const Graphics* g = NULL) const
+ {
+ return IsVisible(point.X, point.Y, g);
+ }
+
+ BOOL IsVisible(IN INT x,
+ IN INT y,
+ IN const Graphics* g = NULL) const;
+
+ BOOL IsOutlineVisible(IN const PointF& point,
+ IN const Pen* pen,
+ IN const Graphics* g = NULL) const
+ {
+ return IsOutlineVisible(point.X, point.Y, pen, g);
+ }
+
+ BOOL IsOutlineVisible(IN REAL x,
+ IN REAL y,
+ IN const Pen* pen,
+ IN const Graphics* g = NULL) const;
+
+ BOOL IsOutlineVisible(IN const Point& point,
+ IN const Pen* pen,
+ IN const Graphics* g = NULL) const
+ {
+ return IsOutlineVisible(point.X, point.Y, pen, g);
+ }
+
+ BOOL IsOutlineVisible(IN INT x,
+ IN INT y,
+ IN const Pen* pen,
+ IN const Graphics* g = NULL) const;
+
+protected:
+
+ GraphicsPath(const GraphicsPath& path)
+ {
+ GpPath *clonepath = NULL;
+ SetStatus(DllExports::GdipClonePath(path.nativePath, &clonepath));
+ SetNativePath(clonepath);
+ }
+
+#ifdef DCR_USE_NEW_250932
+
+private:
+ GraphicsPath& operator=(const GraphicsPath &);
+protected:
+
+#else
+
+ GraphicsPath& operator=(const GraphicsPath& path)
+ {
+ path;
+ SetStatus(NotImplemented);
+ return *this;
+ }
+
+#endif
+
+ GraphicsPath(GpPath* nativePath)
+ {
+ lastResult = Ok;
+ SetNativePath(nativePath);
+ }
+
+ VOID SetNativePath(GpPath *nativePath)
+ {
+ this->nativePath = nativePath;
+ }
+
+ Status SetStatus(Status status) const
+ {
+ if (status != Ok)
+ return (lastResult = status);
+ else
+ return status;
+ }
+
+protected:
+ GpPath* nativePath;
+ mutable Status lastResult;
+};
+
+
+//--------------------------------------------------------------------------
+// GraphisPathIterator class
+//--------------------------------------------------------------------------
+
+class GraphicsPathIterator : public GdiplusBase
+{
+public:
+
+ GraphicsPathIterator(IN const GraphicsPath* path)
+ {
+ GpPath* nativePath = NULL;
+ if(path)
+ nativePath = path->nativePath;
+
+ GpPathIterator *iter = NULL;
+ lastResult = DllExports::GdipCreatePathIter(&iter, nativePath);
+ SetNativeIterator(iter);
+ }
+
+ ~GraphicsPathIterator()
+ {
+ DllExports::GdipDeletePathIter(nativeIterator);
+ }
+
+
+ INT NextSubpath(OUT INT* startIndex,
+ OUT INT* endIndex,
+ OUT BOOL* isClosed)
+ {
+ INT resultCount;
+
+ SetStatus(DllExports::GdipPathIterNextSubpath(nativeIterator,
+ &resultCount, startIndex, endIndex, isClosed));
+
+ return resultCount;
+ }
+
+
+ INT NextSubpath(IN const GraphicsPath* path,
+ OUT BOOL* isClosed)
+ {
+ GpPath* nativePath = NULL;
+
+ INT resultCount;
+
+ if(path)
+ nativePath= path->nativePath;
+
+ SetStatus(DllExports::GdipPathIterNextSubpathPath(nativeIterator,
+ &resultCount, nativePath, isClosed));
+
+ return resultCount;
+ }
+
+ INT NextPathType(OUT BYTE* pathType,
+ OUT INT* startIndex,
+ OUT INT* endIndex)
+ {
+ INT resultCount;
+
+ SetStatus(DllExports::GdipPathIterNextPathType(nativeIterator,
+ &resultCount, pathType, startIndex, endIndex));
+
+ return resultCount;
+ }
+
+ INT NextMarker(OUT INT* startIndex,
+ OUT INT* endIndex)
+ {
+ INT resultCount;
+
+ SetStatus(DllExports::GdipPathIterNextMarker(nativeIterator,
+ &resultCount, startIndex, endIndex));
+
+ return resultCount;
+ }
+
+
+ INT NextMarker(IN const GraphicsPath* path)
+ {
+ GpPath* nativePath = NULL;
+
+ INT resultCount;
+
+ if(path)
+ nativePath= path->nativePath;
+
+ SetStatus(DllExports::GdipPathIterNextMarkerPath(nativeIterator,
+ &resultCount, nativePath));
+
+ return resultCount;
+ }
+
+ INT GetCount() const
+ {
+ INT resultCount;
+
+ SetStatus(DllExports::GdipPathIterGetCount(nativeIterator, &resultCount));
+
+ return resultCount;
+ }
+
+ INT GetSubpathCount() const
+ {
+ INT resultCount;
+
+ SetStatus(DllExports::GdipPathIterGetSubpathCount(nativeIterator, &resultCount));
+
+ return resultCount;
+ }
+
+ BOOL HasCurve() const
+ {
+ BOOL hasCurve;
+
+ SetStatus(DllExports::GdipPathIterHasCurve(nativeIterator, &hasCurve));
+
+ return hasCurve;
+ }
+
+ VOID Rewind()
+ {
+ SetStatus(DllExports::GdipPathIterRewind(nativeIterator));
+ }
+
+ INT Enumerate(OUT PointF *points,
+ OUT BYTE *types,
+ IN INT count)
+ {
+ INT resultCount;
+
+ SetStatus(DllExports::GdipPathIterEnumerate(nativeIterator,
+ &resultCount, points, types, count));
+
+ return resultCount;
+ }
+
+ INT CopyData(OUT PointF* points,
+ OUT BYTE* types,
+ IN INT startIndex,
+ IN INT endIndex)
+ {
+ INT resultCount;
+
+ SetStatus(DllExports::GdipPathIterCopyData(nativeIterator,
+ &resultCount, points, types, startIndex, endIndex));
+
+ return resultCount;
+ }
+
+ Status GetLastStatus() const
+ {
+ Status lastStatus = lastResult;
+ lastResult = Ok;
+
+ return lastStatus;
+ }
+
+#ifdef DCR_USE_NEW_250932
+
+private:
+ GraphicsPathIterator(const GraphicsPathIterator &);
+ GraphicsPathIterator& operator=(const GraphicsPathIterator &);
+
+#endif
+
+protected:
+ VOID SetNativeIterator(GpPathIterator *nativeIterator)
+ {
+ this->nativeIterator = nativeIterator;
+ }
+
+ Status SetStatus(Status status) const
+ {
+ if (status != Ok)
+ return (lastResult = status);
+ else
+ return status;
+ }
+
+protected:
+ GpPathIterator* nativeIterator;
+ mutable Status lastResult;
+};
+
+
+//--------------------------------------------------------------------------
+// Represent polygon gradient brush object
+//--------------------------------------------------------------------------
+
+class PathGradientBrush : public Brush
+{
+public:
+ friend class Pen;
+
+ PathGradientBrush(
+ IN const PointF* points,
+ IN INT count,
+ IN WrapMode wrapMode = WrapModeClamp)
+ {
+ GpPathGradient *brush = NULL;
+
+ lastResult = DllExports::GdipCreatePathGradient(
+ points, count,
+ wrapMode, &brush);
+ SetNativeBrush(brush);
+ }
+
+ PathGradientBrush(
+ IN const Point* points,
+ IN INT count,
+ IN WrapMode wrapMode = WrapModeClamp)
+ {
+ GpPathGradient *brush = NULL;
+
+ lastResult = DllExports::GdipCreatePathGradientI(
+ points, count,
+ wrapMode, &brush);
+
+ SetNativeBrush(brush);
+ }
+
+ PathGradientBrush(
+ IN const GraphicsPath* path
+ )
+ {
+ GpPathGradient *brush = NULL;
+
+ lastResult = DllExports::GdipCreatePathGradientFromPath(
+ path->nativePath, &brush);
+ SetNativeBrush(brush);
+ }
+
+ // Get/set colors
+
+ Status GetCenterColor(OUT Color* color) const
+ {
+ ARGB argb;
+
+ if (color == NULL)
+ {
+ return SetStatus(InvalidParameter);
+ }
+
+ SetStatus(DllExports::GdipGetPathGradientCenterColor(
+ (GpPathGradient*) nativeBrush, &argb));
+
+ color->SetValue(argb);
+
+ return lastResult;
+ }
+
+ Status SetCenterColor(IN const Color& color)
+ {
+ SetStatus(DllExports::GdipSetPathGradientCenterColor(
+ (GpPathGradient*) nativeBrush,
+ color.GetValue()));
+
+ return lastResult;
+ }
+
+ INT GetPointCount() const
+ {
+ INT count;
+
+ SetStatus(DllExports::GdipGetPathGradientPointCount(
+ (GpPathGradient*) nativeBrush, &count));
+
+ return count;
+ }
+
+ INT GetSurroundColorCount() const
+ {
+ INT count;
+
+ SetStatus(DllExports::GdipGetPathGradientSurroundColorCount(
+ (GpPathGradient*) nativeBrush, &count));
+
+ return count;
+ }
+
+ Status GetSurroundColors(OUT Color* colors,
+ IN OUT INT* count) const
+ {
+ if(colors == NULL || count == NULL)
+ {
+ return SetStatus(InvalidParameter);
+ }
+
+ INT count1;
+
+ SetStatus(DllExports::GdipGetPathGradientSurroundColorCount(
+ (GpPathGradient*) nativeBrush, &count1));
+
+ if(lastResult != Ok)
+ return lastResult;
+
+ if((*count < count1) || (count1 <= 0))
+ return SetStatus(InsufficientBuffer);
+
+ ARGB* argbs = (ARGB*) new ARGB[count1];
+ if(argbs == NULL)
+ return SetStatus(OutOfMemory);
+
+ SetStatus(DllExports::GdipGetPathGradientSurroundColorsWithCount(
+ (GpPathGradient*)nativeBrush, argbs, &count1));
+
+ if(lastResult == Ok)
+ {
+ for(INT i = 0; i < count1; i++)
+ {
+ colors[i].SetValue(argbs[i]);
+ }
+ *count = count1;
+ }
+
+ delete [] argbs;
+ return lastResult;
+ }
+
+ Status SetSurroundColors(IN const Color* colors,
+ IN OUT INT* count)
+ {
+ if(colors == NULL || count == NULL)
+ {
+ return SetStatus(InvalidParameter);
+ }
+
+ INT count1 = GetPointCount();
+
+ if((*count > count1) || (count1 <= 0))
+ return SetStatus(InvalidParameter);
+
+ count1 = *count;
+
+ ARGB* argbs = (ARGB*) new ARGB[count1];
+ if(argbs == NULL)
+ return SetStatus(OutOfMemory);
+
+ for(INT i = 0; i < count1; i++)
+ {
+ argbs[i] = colors[i].GetValue();
+ }
+
+ SetStatus(DllExports::GdipSetPathGradientSurroundColorsWithCount(
+ (GpPathGradient*)nativeBrush, argbs, &count1));
+
+ if(lastResult == Ok)
+ *count = count1;
+
+ delete [] argbs;
+
+ return lastResult;
+ }
+
+ Status GetGraphicsPath(OUT GraphicsPath* path) const
+ {
+ if(path == NULL)
+ return SetStatus(InvalidParameter);
+
+ return SetStatus(DllExports::GdipGetPathGradientPath(
+ (GpPathGradient*)nativeBrush, path->nativePath));
+ }
+
+ Status SetGraphicsPath(IN const GraphicsPath* path)
+ {
+ if(path == NULL)
+ return SetStatus(InvalidParameter);
+
+ return SetStatus(DllExports::GdipSetPathGradientPath(
+ (GpPathGradient*)nativeBrush, path->nativePath));
+ }
+
+ Status GetCenterPoint(OUT PointF* point) const
+ {
+ return SetStatus(DllExports::GdipGetPathGradientCenterPoint(
+ (GpPathGradient*)nativeBrush,
+ point));
+ }
+
+
+ Status GetCenterPoint(OUT Point* point) const
+ {
+ return SetStatus(DllExports::GdipGetPathGradientCenterPointI(
+ (GpPathGradient*)nativeBrush,
+ point));
+ }
+
+ Status SetCenterPoint(IN const PointF& point)
+ {
+ return SetStatus(DllExports::GdipSetPathGradientCenterPoint(
+ (GpPathGradient*)nativeBrush,
+ &point));
+ }
+
+ Status SetCenterPoint(IN const Point& point)
+ {
+ return SetStatus(DllExports::GdipSetPathGradientCenterPointI(
+ (GpPathGradient*)nativeBrush,
+ &point));
+ }
+
+ Status GetRectangle(OUT RectF* rect) const
+ {
+ return SetStatus(DllExports::GdipGetPathGradientRect(
+ (GpPathGradient*)nativeBrush, rect));
+ }
+
+ Status GetRectangle(OUT Rect* rect) const
+ {
+ return SetStatus(DllExports::GdipGetPathGradientRectI(
+ (GpPathGradient*)nativeBrush, rect));
+ }
+
+ // Gamma correction.
+
+ Status SetGammaCorrection(IN BOOL useGammaCorrection)
+ {
+ return SetStatus(DllExports::GdipSetPathGradientGammaCorrection(
+ (GpPathGradient*)nativeBrush, useGammaCorrection));
+ }
+
+ BOOL GetGammaCorrection() const
+ {
+ BOOL useGammaCorrection;
+
+ SetStatus(DllExports::GdipGetPathGradientGammaCorrection(
+ (GpPathGradient*)nativeBrush, &useGammaCorrection));
+
+ return useGammaCorrection;
+ }
+
+ INT GetBlendCount() const
+ {
+ INT count = 0;
+
+ SetStatus(DllExports::GdipGetPathGradientBlendCount(
+ (GpPathGradient*) nativeBrush, &count));
+
+ return count;
+ }
+
+ Status GetBlend(OUT REAL* blendFactors,
+ OUT REAL* blendPositions,
+ IN INT count) const
+ {
+ return SetStatus(DllExports::GdipGetPathGradientBlend(
+ (GpPathGradient*)nativeBrush,
+ blendFactors, blendPositions, count));
+ }
+
+ Status SetBlend(IN const REAL* blendFactors,
+ IN const REAL* blendPositions,
+ IN INT count)
+ {
+ return SetStatus(DllExports::GdipSetPathGradientBlend(
+ (GpPathGradient*)nativeBrush,
+ blendFactors, blendPositions, count));
+ }
+
+ INT GetInterpolationColorCount() const
+ {
+ INT count = 0;
+
+ SetStatus(DllExports::GdipGetPathGradientPresetBlendCount(
+ (GpPathGradient*) nativeBrush, &count));
+
+ return count;
+ }
+
+ Status SetInterpolationColors(IN const Color* presetColors,
+ IN const REAL* blendPositions,
+ IN INT count)
+ {
+ if ((count <= 0) || !presetColors)
+ {
+ return SetStatus(InvalidParameter);
+ }
+
+ ARGB* argbs = (ARGB*) new ARGB[count];
+ if(argbs)
+ {
+ for(INT i = 0; i < count; i++)
+ {
+ argbs[i] = presetColors[i].GetValue();
+ }
+
+ Status status = SetStatus(DllExports::GdipSetPathGradientPresetBlend(
+ (GpPathGradient*) nativeBrush,
+ argbs,
+ blendPositions,
+ count));
+ delete[] argbs;
+ return status;
+ }
+ else
+ {
+ return SetStatus(OutOfMemory);
+ }
+ }
+
+ Status GetInterpolationColors(OUT Color* presetColors,
+ OUT REAL* blendPositions,
+ IN INT count) const
+ {
+ if ((count <= 0) || !presetColors)
+ {
+ return SetStatus(InvalidParameter);
+ }
+
+ ARGB* argbs = (ARGB*) new ARGB[count];
+
+ if (!argbs)
+ {
+ return SetStatus(OutOfMemory);
+ }
+
+ GpStatus status = SetStatus(DllExports::GdipGetPathGradientPresetBlend(
+ (GpPathGradient*)nativeBrush,
+ argbs,
+ blendPositions,
+ count));
+
+ for(INT i = 0; i < count; i++)
+ {
+ presetColors[i] = Color(argbs[i]);
+ }
+ delete [] argbs;
+
+ return status;
+ }
+
+ Status SetBlendBellShape(IN REAL focus,
+ IN REAL scale = 1.0)
+ {
+ return SetStatus(DllExports::GdipSetPathGradientSigmaBlend(
+ (GpPathGradient*)nativeBrush, focus, scale));
+ }
+
+ #ifdef DCR_USE_NEW_145135
+ Status SetBlendTriangularShape(
+ IN REAL focus,
+ IN REAL scale = 1.0
+ )
+ #else
+ Status SetBlendTrianglarShape(IN REAL focus,
+ IN REAL scale = 1.0)
+ #endif
+ {
+ return SetStatus(DllExports::GdipSetPathGradientLinearBlend(
+ (GpPathGradient*)nativeBrush, focus, scale));
+ }
+
+ /**
+ * Get/set brush transform
+ */
+ Status GetTransform(OUT Matrix *matrix) const
+ {
+ return SetStatus(DllExports::GdipGetPathGradientTransform(
+ (GpPathGradient*) nativeBrush, matrix->nativeMatrix));
+ }
+
+ Status SetTransform(IN const Matrix* matrix)
+ {
+ return SetStatus(DllExports::GdipSetPathGradientTransform(
+ (GpPathGradient*) nativeBrush, matrix->nativeMatrix));
+ }
+
+ Status ResetTransform()
+ {
+ return SetStatus(DllExports::GdipResetPathGradientTransform((GpPathGradient*)nativeBrush));
+ }
+
+ Status MultiplyTransform(IN const Matrix* matrix,
+ IN MatrixOrder order = MatrixOrderPrepend)
+ {
+ return SetStatus(DllExports::GdipMultiplyPathGradientTransform((GpPathGradient*)nativeBrush,
+ matrix->nativeMatrix,
+ order));
+ }
+
+ Status TranslateTransform(IN REAL dx,
+ IN REAL dy,
+ IN MatrixOrder order = MatrixOrderPrepend)
+ {
+ return SetStatus(DllExports::GdipTranslatePathGradientTransform((GpPathGradient*)nativeBrush,
+ dx, dy, order));
+ }
+
+ Status ScaleTransform(IN REAL sx,
+ IN REAL sy,
+ IN MatrixOrder order = MatrixOrderPrepend)
+ {
+ return SetStatus(DllExports::GdipScalePathGradientTransform((GpPathGradient*)nativeBrush,
+ sx, sy, order));
+ }
+
+ Status RotateTransform(IN REAL angle,
+ IN MatrixOrder order = MatrixOrderPrepend)
+ {
+ return SetStatus(DllExports::GdipRotatePathGradientTransform((GpPathGradient*)nativeBrush,
+ angle, order));
+ }
+
+ /**
+ * Get/set brush focus scales
+ */
+ Status GetFocusScales(OUT REAL* xScale,
+ OUT REAL* yScale) const
+ {
+ return SetStatus(DllExports::GdipGetPathGradientFocusScales(
+ (GpPathGradient*) nativeBrush, xScale, yScale));
+ }
+
+ Status SetFocusScales(IN REAL xScale,
+ IN REAL yScale)
+ {
+ return SetStatus(DllExports::GdipSetPathGradientFocusScales(
+ (GpPathGradient*) nativeBrush, xScale, yScale));
+ }
+
+ /**
+ * Get/set brush wrapping mode
+ */
+ WrapMode GetWrapMode() const
+ {
+ WrapMode wrapMode;
+
+ SetStatus(DllExports::GdipGetPathGradientWrapMode(
+ (GpPathGradient*) nativeBrush, &wrapMode));
+
+ return wrapMode;
+ }
+
+ Status SetWrapMode(IN WrapMode wrapMode)
+ {
+ return SetStatus(DllExports::GdipSetPathGradientWrapMode(
+ (GpPathGradient*) nativeBrush, wrapMode));
+ }
+
+#ifdef DCR_USE_NEW_250932
+
+private:
+ PathGradientBrush(const PathGradientBrush &);
+ PathGradientBrush& operator=(const PathGradientBrush &);
+
+#endif
+
+protected:
+
+ PathGradientBrush()
+ {
+ }
+};
+
+
+#endif // !_GRAPHICSPATH_HPP
diff --git a/core/src/fxge/Microsoft SDK/include/GdiPlusPen.h b/core/src/fxge/Microsoft SDK/include/GdiPlusPen.h
index 20653db36e..c5776ab639 100644
--- a/core/src/fxge/Microsoft SDK/include/GdiPlusPen.h
+++ b/core/src/fxge/Microsoft SDK/include/GdiPlusPen.h
@@ -1,519 +1,519 @@
-/**************************************************************************\
-*
-* Copyright (c) 1998-2000, Microsoft Corp. All Rights Reserved.
-*
-* Module Name:
-*
-* GdiplusPen.h
-*
-* Abstract:
-*
-* Pen API related declarations
-*
-\**************************************************************************/
-#ifndef _GDIPLUSPEN_H
-#define _GDIPLUSPEN_H
-
-//--------------------------------------------------------------------------
-// class for various pen types
-//--------------------------------------------------------------------------
-
-class Pen : public GdiplusBase
-{
-public:
- friend class GraphicsPath;
- friend class Graphics;
-
- // abstract Clone() can't be implemented here because it can't
- // new an object with pure virtual functions
-
- // Constructors
-
- Pen(IN const Color& color,
- IN REAL width = 1.0f)
- {
- Unit unit = UnitWorld;
- nativePen = NULL;
- lastResult = DllExports::GdipCreatePen1(color.GetValue(),
- width, unit, &nativePen);
- }
-
- Pen(IN const Brush* brush,
- IN REAL width = 1.0f)
- {
- Unit unit = UnitWorld;
- nativePen = NULL;
- lastResult = DllExports::GdipCreatePen2(brush->nativeBrush,
- width, unit, &nativePen);
- }
-
- ~Pen()
- {
- DllExports::GdipDeletePen(nativePen);
- }
-
- Pen* Clone() const
- {
- GpPen *clonePen = NULL;
-
- lastResult = DllExports::GdipClonePen(nativePen, &clonePen);
-
- return new Pen(clonePen, lastResult);
- }
-
- Status SetWidth(IN REAL width)
- {
- return SetStatus(DllExports::GdipSetPenWidth(nativePen, width));
- }
-
- REAL GetWidth() const
- {
- REAL width;
-
- SetStatus(DllExports::GdipGetPenWidth(nativePen, &width));
-
- return width;
- }
-
- // Set/get line caps: start, end, and dash
-
- // Line cap and join APIs by using LineCap and LineJoin enums.
-
- #ifdef DCR_USE_NEW_197819
- Status SetLineCap(IN LineCap startCap,
- IN LineCap endCap,
- IN DashCap dashCap)
- {
- return SetStatus(DllExports::GdipSetPenLineCap197819(nativePen,
- startCap, endCap, dashCap));
- }
- #else
- Status SetLineCap(IN LineCap startCap,
- IN LineCap endCap,
- IN LineCap dashCap)
- {
- return SetStatus(DllExports::GdipSetPenLineCap(nativePen,
- startCap, endCap, dashCap));
- }
- #endif // DCR_USE_NEW_197819
-
- Status SetStartCap(IN LineCap startCap)
- {
- return SetStatus(DllExports::GdipSetPenStartCap(nativePen, startCap));
- }
-
- Status SetEndCap(IN LineCap endCap)
- {
- return SetStatus(DllExports::GdipSetPenEndCap(nativePen, endCap));
- }
-
- #ifdef DCR_USE_NEW_197819
- Status SetDashCap(IN DashCap dashCap)
- {
- return SetStatus(DllExports::GdipSetPenDashCap197819(nativePen,
- dashCap));
- }
- #else
- Status SetDashCap(IN LineCap dashCap)
- {
- return SetStatus(DllExports::GdipSetPenDashCap(nativePen, dashCap));
- }
- #endif // DCR_USE_NEW_197819
-
- LineCap GetStartCap() const
- {
- LineCap startCap;
-
- SetStatus(DllExports::GdipGetPenStartCap(nativePen, &startCap));
-
- return startCap;
- }
-
- LineCap GetEndCap() const
- {
- LineCap endCap;
-
- SetStatus(DllExports::GdipGetPenEndCap(nativePen, &endCap));
-
- return endCap;
- }
-
- #ifdef DCR_USE_NEW_197819
- DashCap GetDashCap() const
- {
- DashCap dashCap;
-
- SetStatus(DllExports::GdipGetPenDashCap197819(nativePen,
- &dashCap));
-
- return dashCap;
- }
- #else
- LineCap GetDashCap() const
- {
- LineCap dashCap;
-
- SetStatus(DllExports::GdipGetPenDashCap(nativePen, &dashCap));
-
- return dashCap;
- }
- #endif // DCR_USE_NEW_197819
-
-
- // Set/get line join
-
- Status SetLineJoin(IN LineJoin lineJoin)
- {
- return SetStatus(DllExports::GdipSetPenLineJoin(nativePen, lineJoin));
- }
-
- LineJoin GetLineJoin() const
- {
- LineJoin lineJoin;
-
- SetStatus(DllExports::GdipGetPenLineJoin(nativePen, &lineJoin));
-
- return lineJoin;
- }
-
- Status SetCustomStartCap(IN const CustomLineCap* customCap)
- {
- GpCustomLineCap* nativeCap = NULL;
- if(customCap)
- nativeCap = customCap->nativeCap;
-
- return SetStatus(DllExports::GdipSetPenCustomStartCap(nativePen, nativeCap));
- }
-
- Status GetCustomStartCap(OUT CustomLineCap* customCap) const
- {
- if(!customCap)
- return SetStatus(InvalidParameter);
-
- return SetStatus(DllExports::GdipGetPenCustomStartCap(nativePen, &(customCap->nativeCap)));
- }
-
- Status SetCustomEndCap(IN const CustomLineCap* customCap)
- {
- GpCustomLineCap* nativeCap = NULL;
- if(customCap)
- nativeCap = customCap->nativeCap;
-
- return SetStatus(DllExports::GdipSetPenCustomEndCap(nativePen, nativeCap));
- }
-
- Status GetCustomEndCap(OUT CustomLineCap* customCap) const
- {
- if(!customCap)
- return SetStatus(InvalidParameter);
-
- return SetStatus(DllExports::GdipGetPenCustomEndCap(nativePen, &(customCap->nativeCap)));
- }
-
- Status SetMiterLimit(IN REAL miterLimit)
- {
- return SetStatus(DllExports::GdipSetPenMiterLimit(nativePen, miterLimit));
- }
-
- REAL GetMiterLimit() const
- {
- REAL miterLimit;
-
- SetStatus(DllExports::GdipGetPenMiterLimit(nativePen, &miterLimit));
-
- return miterLimit;
- }
-
- // Set/get pen mode
- Status SetAlignment(IN PenAlignment penAlignment)
- {
- return SetStatus(DllExports::GdipSetPenMode(nativePen, penAlignment));
- }
-
- PenAlignment GetAlignment() const
- {
- PenAlignment penAlignment;
-
- SetStatus(DllExports::GdipGetPenMode(nativePen, &penAlignment));
-
- return penAlignment;
- }
-
- // Set/get pen transform
- Status SetTransform(IN const Matrix* matrix)
- {
- return SetStatus(DllExports::GdipSetPenTransform(nativePen,
- matrix->nativeMatrix));
- }
-
- Status GetTransform(OUT Matrix* matrix) const
- {
- return SetStatus(DllExports::GdipGetPenTransform(nativePen, matrix->nativeMatrix));
- }
-
- Status ResetTransform()
- {
- return SetStatus(DllExports::GdipResetPenTransform(nativePen));
- }
-
- Status MultiplyTransform(IN const Matrix* matrix,
- IN MatrixOrder order = MatrixOrderPrepend)
- {
- return SetStatus(DllExports::GdipMultiplyPenTransform(nativePen,
- matrix->nativeMatrix,
- order));
- }
-
- Status TranslateTransform(IN REAL dx,
- IN REAL dy,
- IN MatrixOrder order = MatrixOrderPrepend)
- {
- return SetStatus(DllExports::GdipTranslatePenTransform(nativePen,
- dx, dy, order));
- }
-
- Status ScaleTransform(IN REAL sx,
- IN REAL sy,
- IN MatrixOrder order = MatrixOrderPrepend)
- {
- return SetStatus(DllExports::GdipScalePenTransform(nativePen,
- sx, sy, order));
- }
-
- Status RotateTransform(IN REAL angle,
- IN MatrixOrder order = MatrixOrderPrepend)
- {
- return SetStatus(DllExports::GdipRotatePenTransform(nativePen,
- angle, order));
- }
-
- PenType GetPenType() const
- {
- PenType type;
- SetStatus(DllExports::GdipGetPenFillType(nativePen, &type));
-
- return type;
- }
-
- Status SetColor(IN const Color& color)
- {
- return SetStatus(DllExports::GdipSetPenColor(nativePen,
- color.GetValue()));
- }
-
- Status SetBrush(IN const Brush* brush)
- {
- return SetStatus(DllExports::GdipSetPenBrushFill(nativePen,
- brush->nativeBrush));
- }
-
- Status GetColor(OUT Color* color) const
- {
- if (color == NULL)
- {
- return SetStatus(InvalidParameter);
- }
-
- PenType type = GetPenType();
-
- if (type != PenTypeSolidColor)
- {
- return WrongState;
- }
-
- ARGB argb;
-
- SetStatus(DllExports::GdipGetPenColor(nativePen,
- &argb));
- if (lastResult == Ok)
- {
- color->SetValue(argb);
- }
-
- return lastResult;
- }
-
- Brush* GetBrush() const
- {
- PenType type = GetPenType();
-
- Brush* brush = NULL;
-
- switch(type)
- {
- case PenTypeSolidColor:
- brush = new SolidBrush();
- break;
-
- case PenTypeHatchFill:
- brush = new HatchBrush();
- break;
-
- case PenTypeTextureFill:
- brush = new TextureBrush();
- break;
-
- case PenTypePathGradient:
- brush = new Brush();
- break;
-
- case PenTypeLinearGradient:
- brush = new LinearGradientBrush();
- break;
-
- default:
- break;
- }
-
- if(brush)
- {
- GpBrush* nativeBrush;
-
- SetStatus(DllExports::GdipGetPenBrushFill(nativePen, &nativeBrush));
- brush->SetNativeBrush(nativeBrush);
- }
-
- return brush;
- }
-
- DashStyle GetDashStyle() const
- {
- DashStyle dashStyle;
-
- SetStatus(DllExports::GdipGetPenDashStyle(nativePen, &dashStyle));
-
- return dashStyle;
- }
-
- Status SetDashStyle(IN DashStyle dashStyle)
- {
- return SetStatus(DllExports::GdipSetPenDashStyle(nativePen, dashStyle));
- }
-
- REAL GetDashOffset() const
- {
- REAL dashOffset;
-
- SetStatus(DllExports::GdipGetPenDashOffset(nativePen, &dashOffset));
-
- return dashOffset;
- }
-
- Status SetDashOffset(IN REAL dashOffset)
- {
- return SetStatus(DllExports::GdipSetPenDashOffset(nativePen, dashOffset));
- }
-
- Status SetDashPattern(IN const REAL* dashArray, IN INT count)
- {
- return SetStatus(DllExports::GdipSetPenDashArray(nativePen, dashArray,
- count));
- }
-
- INT GetDashPatternCount() const
- {
- INT count = 0;
-
- SetStatus(DllExports::GdipGetPenDashCount(nativePen, &count));
-
- return count;
- }
-
- Status GetDashPattern(OUT REAL* dashArray,
- IN INT count) const
- {
- if (dashArray == NULL || count <= 0)
- return SetStatus(InvalidParameter);
-
- return SetStatus(DllExports::GdipGetPenDashArray(nativePen,
- dashArray,
- count));
- }
-
- Status SetCompoundArray(IN const REAL* compoundArray,
- IN INT count)
- {
- return SetStatus(DllExports::GdipSetPenCompoundArray(nativePen, compoundArray,
- count));
- }
-
- INT GetCompoundArrayCount() const
- {
- INT count = 0;
-
- SetStatus(DllExports::GdipGetPenCompoundCount(nativePen, &count));
-
- return count;
- }
-
- Status GetCompoundArray(OUT REAL* compoundArray,
- IN INT count) const
- {
- if (compoundArray == NULL || count <= 0)
- return SetStatus(InvalidParameter);
-
- return SetStatus(DllExports::GdipGetPenCompoundArray(nativePen,
- compoundArray,
- count));
- }
-
- Status GetLastStatus() const
- {
- Status lastStatus = lastResult;
- lastResult = Ok;
-
- return lastStatus;
- }
-
-protected:
-
-#ifdef DCR_USE_NEW_250932
-
-private:
- Pen(const Pen &);
- Pen& operator=(const Pen &);
-protected:
-
-#else
-
- Pen(const Pen& pen)
- {
- pen;
- SetStatus(NotImplemented);
- SetNativePen(NULL);
- }
-
- Pen& operator=(const Pen& pen)
- {
- pen;
- SetStatus(NotImplemented);
- return *this;
- }
-
-#endif
-
- Pen(GpPen* nativePen, Status status)
- {
- lastResult = status;
- SetNativePen(nativePen);
- }
-
- VOID SetNativePen(GpPen* nativePen)
- {
- this->nativePen = nativePen;
- }
-
- Status SetStatus(Status status) const
- {
- if (status != Ok)
- return (lastResult = status);
- else
- return status;
- }
-
-protected:
- GpPen* nativePen;
- mutable Status lastResult;
-};
-
-#endif
+/**************************************************************************\
+*
+* Copyright (c) 1998-2000, Microsoft Corp. All Rights Reserved.
+*
+* Module Name:
+*
+* GdiplusPen.h
+*
+* Abstract:
+*
+* Pen API related declarations
+*
+\**************************************************************************/
+#ifndef _GDIPLUSPEN_H
+#define _GDIPLUSPEN_H
+
+//--------------------------------------------------------------------------
+// class for various pen types
+//--------------------------------------------------------------------------
+
+class Pen : public GdiplusBase
+{
+public:
+ friend class GraphicsPath;
+ friend class Graphics;
+
+ // abstract Clone() can't be implemented here because it can't
+ // new an object with pure virtual functions
+
+ // Constructors
+
+ Pen(IN const Color& color,
+ IN REAL width = 1.0f)
+ {
+ Unit unit = UnitWorld;
+ nativePen = NULL;
+ lastResult = DllExports::GdipCreatePen1(color.GetValue(),
+ width, unit, &nativePen);
+ }
+
+ Pen(IN const Brush* brush,
+ IN REAL width = 1.0f)
+ {
+ Unit unit = UnitWorld;
+ nativePen = NULL;
+ lastResult = DllExports::GdipCreatePen2(brush->nativeBrush,
+ width, unit, &nativePen);
+ }
+
+ ~Pen()
+ {
+ DllExports::GdipDeletePen(nativePen);
+ }
+
+ Pen* Clone() const
+ {
+ GpPen *clonePen = NULL;
+
+ lastResult = DllExports::GdipClonePen(nativePen, &clonePen);
+
+ return new Pen(clonePen, lastResult);
+ }
+
+ Status SetWidth(IN REAL width)
+ {
+ return SetStatus(DllExports::GdipSetPenWidth(nativePen, width));
+ }
+
+ REAL GetWidth() const
+ {
+ REAL width;
+
+ SetStatus(DllExports::GdipGetPenWidth(nativePen, &width));
+
+ return width;
+ }
+
+ // Set/get line caps: start, end, and dash
+
+ // Line cap and join APIs by using LineCap and LineJoin enums.
+
+ #ifdef DCR_USE_NEW_197819
+ Status SetLineCap(IN LineCap startCap,
+ IN LineCap endCap,
+ IN DashCap dashCap)
+ {
+ return SetStatus(DllExports::GdipSetPenLineCap197819(nativePen,
+ startCap, endCap, dashCap));
+ }
+ #else
+ Status SetLineCap(IN LineCap startCap,
+ IN LineCap endCap,
+ IN LineCap dashCap)
+ {
+ return SetStatus(DllExports::GdipSetPenLineCap(nativePen,
+ startCap, endCap, dashCap));
+ }
+ #endif // DCR_USE_NEW_197819
+
+ Status SetStartCap(IN LineCap startCap)
+ {
+ return SetStatus(DllExports::GdipSetPenStartCap(nativePen, startCap));
+ }
+
+ Status SetEndCap(IN LineCap endCap)
+ {
+ return SetStatus(DllExports::GdipSetPenEndCap(nativePen, endCap));
+ }
+
+ #ifdef DCR_USE_NEW_197819
+ Status SetDashCap(IN DashCap dashCap)
+ {
+ return SetStatus(DllExports::GdipSetPenDashCap197819(nativePen,
+ dashCap));
+ }
+ #else
+ Status SetDashCap(IN LineCap dashCap)
+ {
+ return SetStatus(DllExports::GdipSetPenDashCap(nativePen, dashCap));
+ }
+ #endif // DCR_USE_NEW_197819
+
+ LineCap GetStartCap() const
+ {
+ LineCap startCap;
+
+ SetStatus(DllExports::GdipGetPenStartCap(nativePen, &startCap));
+
+ return startCap;
+ }
+
+ LineCap GetEndCap() const
+ {
+ LineCap endCap;
+
+ SetStatus(DllExports::GdipGetPenEndCap(nativePen, &endCap));
+
+ return endCap;
+ }
+
+ #ifdef DCR_USE_NEW_197819
+ DashCap GetDashCap() const
+ {
+ DashCap dashCap;
+
+ SetStatus(DllExports::GdipGetPenDashCap197819(nativePen,
+ &dashCap));
+
+ return dashCap;
+ }
+ #else
+ LineCap GetDashCap() const
+ {
+ LineCap dashCap;
+
+ SetStatus(DllExports::GdipGetPenDashCap(nativePen, &dashCap));
+
+ return dashCap;
+ }
+ #endif // DCR_USE_NEW_197819
+
+
+ // Set/get line join
+
+ Status SetLineJoin(IN LineJoin lineJoin)
+ {
+ return SetStatus(DllExports::GdipSetPenLineJoin(nativePen, lineJoin));
+ }
+
+ LineJoin GetLineJoin() const
+ {
+ LineJoin lineJoin;
+
+ SetStatus(DllExports::GdipGetPenLineJoin(nativePen, &lineJoin));
+
+ return lineJoin;
+ }
+
+ Status SetCustomStartCap(IN const CustomLineCap* customCap)
+ {
+ GpCustomLineCap* nativeCap = NULL;
+ if(customCap)
+ nativeCap = customCap->nativeCap;
+
+ return SetStatus(DllExports::GdipSetPenCustomStartCap(nativePen, nativeCap));
+ }
+
+ Status GetCustomStartCap(OUT CustomLineCap* customCap) const
+ {
+ if(!customCap)
+ return SetStatus(InvalidParameter);
+
+ return SetStatus(DllExports::GdipGetPenCustomStartCap(nativePen, &(customCap->nativeCap)));
+ }
+
+ Status SetCustomEndCap(IN const CustomLineCap* customCap)
+ {
+ GpCustomLineCap* nativeCap = NULL;
+ if(customCap)
+ nativeCap = customCap->nativeCap;
+
+ return SetStatus(DllExports::GdipSetPenCustomEndCap(nativePen, nativeCap));
+ }
+
+ Status GetCustomEndCap(OUT CustomLineCap* customCap) const
+ {
+ if(!customCap)
+ return SetStatus(InvalidParameter);
+
+ return SetStatus(DllExports::GdipGetPenCustomEndCap(nativePen, &(customCap->nativeCap)));
+ }
+
+ Status SetMiterLimit(IN REAL miterLimit)
+ {
+ return SetStatus(DllExports::GdipSetPenMiterLimit(nativePen, miterLimit));
+ }
+
+ REAL GetMiterLimit() const
+ {
+ REAL miterLimit;
+
+ SetStatus(DllExports::GdipGetPenMiterLimit(nativePen, &miterLimit));
+
+ return miterLimit;
+ }
+
+ // Set/get pen mode
+ Status SetAlignment(IN PenAlignment penAlignment)
+ {
+ return SetStatus(DllExports::GdipSetPenMode(nativePen, penAlignment));
+ }
+
+ PenAlignment GetAlignment() const
+ {
+ PenAlignment penAlignment;
+
+ SetStatus(DllExports::GdipGetPenMode(nativePen, &penAlignment));
+
+ return penAlignment;
+ }
+
+ // Set/get pen transform
+ Status SetTransform(IN const Matrix* matrix)
+ {
+ return SetStatus(DllExports::GdipSetPenTransform(nativePen,
+ matrix->nativeMatrix));
+ }
+
+ Status GetTransform(OUT Matrix* matrix) const
+ {
+ return SetStatus(DllExports::GdipGetPenTransform(nativePen, matrix->nativeMatrix));
+ }
+
+ Status ResetTransform()
+ {
+ return SetStatus(DllExports::GdipResetPenTransform(nativePen));
+ }
+
+ Status MultiplyTransform(IN const Matrix* matrix,
+ IN MatrixOrder order = MatrixOrderPrepend)
+ {
+ return SetStatus(DllExports::GdipMultiplyPenTransform(nativePen,
+ matrix->nativeMatrix,
+ order));
+ }
+
+ Status TranslateTransform(IN REAL dx,
+ IN REAL dy,
+ IN MatrixOrder order = MatrixOrderPrepend)
+ {
+ return SetStatus(DllExports::GdipTranslatePenTransform(nativePen,
+ dx, dy, order));
+ }
+
+ Status ScaleTransform(IN REAL sx,
+ IN REAL sy,
+ IN MatrixOrder order = MatrixOrderPrepend)
+ {
+ return SetStatus(DllExports::GdipScalePenTransform(nativePen,
+ sx, sy, order));
+ }
+
+ Status RotateTransform(IN REAL angle,
+ IN MatrixOrder order = MatrixOrderPrepend)
+ {
+ return SetStatus(DllExports::GdipRotatePenTransform(nativePen,
+ angle, order));
+ }
+
+ PenType GetPenType() const
+ {
+ PenType type;
+ SetStatus(DllExports::GdipGetPenFillType(nativePen, &type));
+
+ return type;
+ }
+
+ Status SetColor(IN const Color& color)
+ {
+ return SetStatus(DllExports::GdipSetPenColor(nativePen,
+ color.GetValue()));
+ }
+
+ Status SetBrush(IN const Brush* brush)
+ {
+ return SetStatus(DllExports::GdipSetPenBrushFill(nativePen,
+ brush->nativeBrush));
+ }
+
+ Status GetColor(OUT Color* color) const
+ {
+ if (color == NULL)
+ {
+ return SetStatus(InvalidParameter);
+ }
+
+ PenType type = GetPenType();
+
+ if (type != PenTypeSolidColor)
+ {
+ return WrongState;
+ }
+
+ ARGB argb;
+
+ SetStatus(DllExports::GdipGetPenColor(nativePen,
+ &argb));
+ if (lastResult == Ok)
+ {
+ color->SetValue(argb);
+ }
+
+ return lastResult;
+ }
+
+ Brush* GetBrush() const
+ {
+ PenType type = GetPenType();
+
+ Brush* brush = NULL;
+
+ switch(type)
+ {
+ case PenTypeSolidColor:
+ brush = new SolidBrush();
+ break;
+
+ case PenTypeHatchFill:
+ brush = new HatchBrush();
+ break;
+
+ case PenTypeTextureFill:
+ brush = new TextureBrush();
+ break;
+
+ case PenTypePathGradient:
+ brush = new Brush();
+ break;
+
+ case PenTypeLinearGradient:
+ brush = new LinearGradientBrush();
+ break;
+
+ default:
+ break;
+ }
+
+ if(brush)
+ {
+ GpBrush* nativeBrush;
+
+ SetStatus(DllExports::GdipGetPenBrushFill(nativePen, &nativeBrush));
+ brush->SetNativeBrush(nativeBrush);
+ }
+
+ return brush;
+ }
+
+ DashStyle GetDashStyle() const
+ {
+ DashStyle dashStyle;
+
+ SetStatus(DllExports::GdipGetPenDashStyle(nativePen, &dashStyle));
+
+ return dashStyle;
+ }
+
+ Status SetDashStyle(IN DashStyle dashStyle)
+ {
+ return SetStatus(DllExports::GdipSetPenDashStyle(nativePen, dashStyle));
+ }
+
+ REAL GetDashOffset() const
+ {
+ REAL dashOffset;
+
+ SetStatus(DllExports::GdipGetPenDashOffset(nativePen, &dashOffset));
+
+ return dashOffset;
+ }
+
+ Status SetDashOffset(IN REAL dashOffset)
+ {
+ return SetStatus(DllExports::GdipSetPenDashOffset(nativePen, dashOffset));
+ }
+
+ Status SetDashPattern(IN const REAL* dashArray, IN INT count)
+ {
+ return SetStatus(DllExports::GdipSetPenDashArray(nativePen, dashArray,
+ count));
+ }
+
+ INT GetDashPatternCount() const
+ {
+ INT count = 0;
+
+ SetStatus(DllExports::GdipGetPenDashCount(nativePen, &count));
+
+ return count;
+ }
+
+ Status GetDashPattern(OUT REAL* dashArray,
+ IN INT count) const
+ {
+ if (dashArray == NULL || count <= 0)
+ return SetStatus(InvalidParameter);
+
+ return SetStatus(DllExports::GdipGetPenDashArray(nativePen,
+ dashArray,
+ count));
+ }
+
+ Status SetCompoundArray(IN const REAL* compoundArray,
+ IN INT count)
+ {
+ return SetStatus(DllExports::GdipSetPenCompoundArray(nativePen, compoundArray,
+ count));
+ }
+
+ INT GetCompoundArrayCount() const
+ {
+ INT count = 0;
+
+ SetStatus(DllExports::GdipGetPenCompoundCount(nativePen, &count));
+
+ return count;
+ }
+
+ Status GetCompoundArray(OUT REAL* compoundArray,
+ IN INT count) const
+ {
+ if (compoundArray == NULL || count <= 0)
+ return SetStatus(InvalidParameter);
+
+ return SetStatus(DllExports::GdipGetPenCompoundArray(nativePen,
+ compoundArray,
+ count));
+ }
+
+ Status GetLastStatus() const
+ {
+ Status lastStatus = lastResult;
+ lastResult = Ok;
+
+ return lastStatus;
+ }
+
+protected:
+
+#ifdef DCR_USE_NEW_250932
+
+private:
+ Pen(const Pen &);
+ Pen& operator=(const Pen &);
+protected:
+
+#else
+
+ Pen(const Pen& pen)
+ {
+ pen;
+ SetStatus(NotImplemented);
+ SetNativePen(NULL);
+ }
+
+ Pen& operator=(const Pen& pen)
+ {
+ pen;
+ SetStatus(NotImplemented);
+ return *this;
+ }
+
+#endif
+
+ Pen(GpPen* nativePen, Status status)
+ {
+ lastResult = status;
+ SetNativePen(nativePen);
+ }
+
+ VOID SetNativePen(GpPen* nativePen)
+ {
+ this->nativePen = nativePen;
+ }
+
+ Status SetStatus(Status status) const
+ {
+ if (status != Ok)
+ return (lastResult = status);
+ else
+ return status;
+ }
+
+protected:
+ GpPen* nativePen;
+ mutable Status lastResult;
+};
+
+#endif
diff --git a/core/src/fxge/Microsoft SDK/include/GdiPlusPixelFormats.h b/core/src/fxge/Microsoft SDK/include/GdiPlusPixelFormats.h
index f9dc5991d4..68b7084074 100644
--- a/core/src/fxge/Microsoft SDK/include/GdiPlusPixelFormats.h
+++ b/core/src/fxge/Microsoft SDK/include/GdiPlusPixelFormats.h
@@ -1,201 +1,201 @@
-/**************************************************************************\
-*
-* Copyright (c) 1998-2000, Microsoft Corp. All Rights Reserved.
-*
-* Module Name:
-*
-* Gdiplus pixel formats
-*
-* Abstract:
-*
-* Definitions for color types, palettes, pixel format IDs.
-*
-\**************************************************************************/
-
-#ifndef _GDIPLUSPIXELFORMATS_H
-#define _GDIPLUSPIXELFORMATS_H
-
-/*
- * 32-bit and 64-bit ARGB pixel value
- */
-
-typedef DWORD ARGB;
-typedef DWORDLONG ARGB64;
-
-#define ALPHA_SHIFT 24
-#define RED_SHIFT 16
-#define GREEN_SHIFT 8
-#define BLUE_SHIFT 0
-#define ALPHA_MASK ((ARGB) 0xff << ALPHA_SHIFT)
-
-/*
- * In-memory pixel data formats:
- * bits 0-7 = format index
- * bits 8-15 = pixel size (in bits)
- * bits 16-23 = flags
- * bits 24-31 = reserved
- */
-
-#ifndef DCR_USE_NEW_105760
-
-enum PixelFormat
-{
- PixelFormatIndexed = 0x00010000, // Indexes into a palette
- PixelFormatGDI = 0x00020000, // Is a GDI-supported format
- PixelFormatAlpha = 0x00040000, // Has an alpha component
- PixelFormatPAlpha = 0x00080000, // Uses pre-multiplied alpha
- PixelFormatExtended = 0x00100000, // Uses extended color (16 bits per channel)
- PixelFormatCanonical = 0x00200000, // ?
-
- PixelFormatUndefined = 0,
- PixelFormatDontCare = 0,
-
- PixelFormat1bppIndexed = 1 | ( 1 << 8) | PixelFormatIndexed
- | PixelFormatGDI,
- PixelFormat4bppIndexed = 2 | ( 4 << 8) | PixelFormatIndexed
- | PixelFormatGDI,
- PixelFormat8bppIndexed = 3 | ( 8 << 8) | PixelFormatIndexed
- | PixelFormatGDI,
- PixelFormat16bppGrayScale = 4 | (16 << 8) | PixelFormatExtended,
- PixelFormat16bppRGB555 = 5 | (16 << 8) | PixelFormatGDI,
- PixelFormat16bppRGB565 = 6 | (16 << 8) | PixelFormatGDI,
- PixelFormat16bppARGB1555 = 7 | (16 << 8) | PixelFormatAlpha
- | PixelFormatGDI,
- PixelFormat24bppRGB = 8 | (24 << 8) | PixelFormatGDI,
- PixelFormat32bppRGB = 9 | (32 << 8) | PixelFormatGDI,
- PixelFormat32bppARGB = 10 | (32 << 8) | PixelFormatAlpha
- | PixelFormatGDI
- | PixelFormatCanonical,
- PixelFormat32bppPARGB = 11 | (32 << 8) | PixelFormatAlpha
- | PixelFormatPAlpha
- | PixelFormatGDI,
- PixelFormat48bppRGB = 12 | (48 << 8) | PixelFormatExtended,
- PixelFormat64bppARGB = 13 | (64 << 8) | PixelFormatAlpha
- | PixelFormatCanonical
- | PixelFormatExtended,
- PixelFormat64bppPARGB = 14 | (64 << 8) | PixelFormatAlpha
- | PixelFormatPAlpha
- | PixelFormatExtended,
- PixelFormat24bppBGR = 15 | (24 << 8) | PixelFormatGDI,
- PixelFormatMax = 16
-};
-
-#else
-
-typedef INT PixelFormat;
-
-#define PixelFormatIndexed 0x00010000 // Indexes into a palette
-#define PixelFormatGDI 0x00020000 // Is a GDI-supported format
-#define PixelFormatAlpha 0x00040000 // Has an alpha component
-#define PixelFormatPAlpha 0x00080000 // Uses pre-multiplied alpha
-#define PixelFormatExtended 0x00100000 // Uses extended color (16 bits per channel)
-#define PixelFormatCanonical 0x00200000 // ?
-
-#define PixelFormatUndefined 0
-#define PixelFormatDontCare 0
-
-#define PixelFormat1bppIndexed (1 | ( 1 << 8) | PixelFormatIndexed | PixelFormatGDI)
-#define PixelFormat4bppIndexed (2 | ( 4 << 8) | PixelFormatIndexed | PixelFormatGDI)
-#define PixelFormat8bppIndexed (3 | ( 8 << 8) | PixelFormatIndexed | PixelFormatGDI)
-#define PixelFormat16bppGrayScale (4 | (16 << 8) | PixelFormatExtended)
-#define PixelFormat16bppRGB555 (5 | (16 << 8) | PixelFormatGDI)
-#define PixelFormat16bppRGB565 (6 | (16 << 8) | PixelFormatGDI)
-#define PixelFormat16bppARGB1555 (7 | (16 << 8) | PixelFormatAlpha | PixelFormatGDI)
-#define PixelFormat24bppRGB (8 | (24 << 8) | PixelFormatGDI)
-#define PixelFormat32bppRGB (9 | (32 << 8) | PixelFormatGDI)
-#define PixelFormat32bppARGB (10 | (32 << 8) | PixelFormatAlpha | PixelFormatGDI | PixelFormatCanonical)
-#define PixelFormat32bppPARGB (11 | (32 << 8) | PixelFormatAlpha | PixelFormatPAlpha | PixelFormatGDI)
-#define PixelFormat48bppRGB (12 | (48 << 8) | PixelFormatExtended)
-#define PixelFormat64bppARGB (13 | (64 << 8) | PixelFormatAlpha | PixelFormatCanonical | PixelFormatExtended)
-#define PixelFormat64bppPARGB (14 | (64 << 8) | PixelFormatAlpha | PixelFormatPAlpha | PixelFormatExtended)
-#define PixelFormatMax 15
-
-#endif
-
-
-/*
- * Return the pixel size for the specified format (in bits)
- */
-
-inline UINT
-GetPixelFormatSize(
- PixelFormat pixfmt
- )
-{
- return (pixfmt >> 8) & 0xff;
-}
-
-/*
- * Determine if the specified pixel format is an indexed color format
- */
-
-inline BOOL
-IsIndexedPixelFormat(
- PixelFormat pixfmt
- )
-{
- return (pixfmt & PixelFormatIndexed) != 0;
-}
-
-/*
- * Determine if the pixel format can have alpha channel
- */
-
-inline BOOL
-IsAlphaPixelFormat(
- PixelFormat pixfmt
-)
-{
- return (pixfmt & PixelFormatAlpha) != 0;
-}
-
-/*
- * Determine if the pixel format is an extended format,
- * i.e. supports 16-bit per channel
- */
-
-inline BOOL
-IsExtendedPixelFormat(
- PixelFormat pixfmt
- )
-{
- return (pixfmt & PixelFormatExtended) != 0;
-}
-
-/*
- * Determine if the pixel format is canonical format:
- * PixelFormat32bppARGB
- * PixelFormat32bppPARGB
- * PixelFormat64bppARGB
- * PixelFormat64bppPARGB
- */
-
-inline BOOL
-IsCanonicalPixelFormat(
- PixelFormat pixfmt
- )
-{
- return (pixfmt & PixelFormatCanonical) != 0;
-}
-
-/*
- * Color palette
- * palette entries are limited to 32bpp ARGB pixel format
- */
-
-enum PaletteFlags
-{
- PaletteFlagsHasAlpha = 0x0001,
- PaletteFlagsGrayScale = 0x0002,
- PaletteFlagsHalftone = 0x0004
-};
-
-struct ColorPalette
-{
-public:
- UINT Flags; // palette flags
- UINT Count; // number of color entries
- ARGB Entries[1]; // palette color entries
-};
-
-#endif
+/**************************************************************************\
+*
+* Copyright (c) 1998-2000, Microsoft Corp. All Rights Reserved.
+*
+* Module Name:
+*
+* Gdiplus pixel formats
+*
+* Abstract:
+*
+* Definitions for color types, palettes, pixel format IDs.
+*
+\**************************************************************************/
+
+#ifndef _GDIPLUSPIXELFORMATS_H
+#define _GDIPLUSPIXELFORMATS_H
+
+/*
+ * 32-bit and 64-bit ARGB pixel value
+ */
+
+typedef DWORD ARGB;
+typedef DWORDLONG ARGB64;
+
+#define ALPHA_SHIFT 24
+#define RED_SHIFT 16
+#define GREEN_SHIFT 8
+#define BLUE_SHIFT 0
+#define ALPHA_MASK ((ARGB) 0xff << ALPHA_SHIFT)
+
+/*
+ * In-memory pixel data formats:
+ * bits 0-7 = format index
+ * bits 8-15 = pixel size (in bits)
+ * bits 16-23 = flags
+ * bits 24-31 = reserved
+ */
+
+#ifndef DCR_USE_NEW_105760
+
+enum PixelFormat
+{
+ PixelFormatIndexed = 0x00010000, // Indexes into a palette
+ PixelFormatGDI = 0x00020000, // Is a GDI-supported format
+ PixelFormatAlpha = 0x00040000, // Has an alpha component
+ PixelFormatPAlpha = 0x00080000, // Uses pre-multiplied alpha
+ PixelFormatExtended = 0x00100000, // Uses extended color (16 bits per channel)
+ PixelFormatCanonical = 0x00200000, // ?
+
+ PixelFormatUndefined = 0,
+ PixelFormatDontCare = 0,
+
+ PixelFormat1bppIndexed = 1 | ( 1 << 8) | PixelFormatIndexed
+ | PixelFormatGDI,
+ PixelFormat4bppIndexed = 2 | ( 4 << 8) | PixelFormatIndexed
+ | PixelFormatGDI,
+ PixelFormat8bppIndexed = 3 | ( 8 << 8) | PixelFormatIndexed
+ | PixelFormatGDI,
+ PixelFormat16bppGrayScale = 4 | (16 << 8) | PixelFormatExtended,
+ PixelFormat16bppRGB555 = 5 | (16 << 8) | PixelFormatGDI,
+ PixelFormat16bppRGB565 = 6 | (16 << 8) | PixelFormatGDI,
+ PixelFormat16bppARGB1555 = 7 | (16 << 8) | PixelFormatAlpha
+ | PixelFormatGDI,
+ PixelFormat24bppRGB = 8 | (24 << 8) | PixelFormatGDI,
+ PixelFormat32bppRGB = 9 | (32 << 8) | PixelFormatGDI,
+ PixelFormat32bppARGB = 10 | (32 << 8) | PixelFormatAlpha
+ | PixelFormatGDI
+ | PixelFormatCanonical,
+ PixelFormat32bppPARGB = 11 | (32 << 8) | PixelFormatAlpha
+ | PixelFormatPAlpha
+ | PixelFormatGDI,
+ PixelFormat48bppRGB = 12 | (48 << 8) | PixelFormatExtended,
+ PixelFormat64bppARGB = 13 | (64 << 8) | PixelFormatAlpha
+ | PixelFormatCanonical
+ | PixelFormatExtended,
+ PixelFormat64bppPARGB = 14 | (64 << 8) | PixelFormatAlpha
+ | PixelFormatPAlpha
+ | PixelFormatExtended,
+ PixelFormat24bppBGR = 15 | (24 << 8) | PixelFormatGDI,
+ PixelFormatMax = 16
+};
+
+#else
+
+typedef INT PixelFormat;
+
+#define PixelFormatIndexed 0x00010000 // Indexes into a palette
+#define PixelFormatGDI 0x00020000 // Is a GDI-supported format
+#define PixelFormatAlpha 0x00040000 // Has an alpha component
+#define PixelFormatPAlpha 0x00080000 // Uses pre-multiplied alpha
+#define PixelFormatExtended 0x00100000 // Uses extended color (16 bits per channel)
+#define PixelFormatCanonical 0x00200000 // ?
+
+#define PixelFormatUndefined 0
+#define PixelFormatDontCare 0
+
+#define PixelFormat1bppIndexed (1 | ( 1 << 8) | PixelFormatIndexed | PixelFormatGDI)
+#define PixelFormat4bppIndexed (2 | ( 4 << 8) | PixelFormatIndexed | PixelFormatGDI)
+#define PixelFormat8bppIndexed (3 | ( 8 << 8) | PixelFormatIndexed | PixelFormatGDI)
+#define PixelFormat16bppGrayScale (4 | (16 << 8) | PixelFormatExtended)
+#define PixelFormat16bppRGB555 (5 | (16 << 8) | PixelFormatGDI)
+#define PixelFormat16bppRGB565 (6 | (16 << 8) | PixelFormatGDI)
+#define PixelFormat16bppARGB1555 (7 | (16 << 8) | PixelFormatAlpha | PixelFormatGDI)
+#define PixelFormat24bppRGB (8 | (24 << 8) | PixelFormatGDI)
+#define PixelFormat32bppRGB (9 | (32 << 8) | PixelFormatGDI)
+#define PixelFormat32bppARGB (10 | (32 << 8) | PixelFormatAlpha | PixelFormatGDI | PixelFormatCanonical)
+#define PixelFormat32bppPARGB (11 | (32 << 8) | PixelFormatAlpha | PixelFormatPAlpha | PixelFormatGDI)
+#define PixelFormat48bppRGB (12 | (48 << 8) | PixelFormatExtended)
+#define PixelFormat64bppARGB (13 | (64 << 8) | PixelFormatAlpha | PixelFormatCanonical | PixelFormatExtended)
+#define PixelFormat64bppPARGB (14 | (64 << 8) | PixelFormatAlpha | PixelFormatPAlpha | PixelFormatExtended)
+#define PixelFormatMax 15
+
+#endif
+
+
+/*
+ * Return the pixel size for the specified format (in bits)
+ */
+
+inline UINT
+GetPixelFormatSize(
+ PixelFormat pixfmt
+ )
+{
+ return (pixfmt >> 8) & 0xff;
+}
+
+/*
+ * Determine if the specified pixel format is an indexed color format
+ */
+
+inline BOOL
+IsIndexedPixelFormat(
+ PixelFormat pixfmt
+ )
+{
+ return (pixfmt & PixelFormatIndexed) != 0;
+}
+
+/*
+ * Determine if the pixel format can have alpha channel
+ */
+
+inline BOOL
+IsAlphaPixelFormat(
+ PixelFormat pixfmt
+)
+{
+ return (pixfmt & PixelFormatAlpha) != 0;
+}
+
+/*
+ * Determine if the pixel format is an extended format,
+ * i.e. supports 16-bit per channel
+ */
+
+inline BOOL
+IsExtendedPixelFormat(
+ PixelFormat pixfmt
+ )
+{
+ return (pixfmt & PixelFormatExtended) != 0;
+}
+
+/*
+ * Determine if the pixel format is canonical format:
+ * PixelFormat32bppARGB
+ * PixelFormat32bppPARGB
+ * PixelFormat64bppARGB
+ * PixelFormat64bppPARGB
+ */
+
+inline BOOL
+IsCanonicalPixelFormat(
+ PixelFormat pixfmt
+ )
+{
+ return (pixfmt & PixelFormatCanonical) != 0;
+}
+
+/*
+ * Color palette
+ * palette entries are limited to 32bpp ARGB pixel format
+ */
+
+enum PaletteFlags
+{
+ PaletteFlagsHasAlpha = 0x0001,
+ PaletteFlagsGrayScale = 0x0002,
+ PaletteFlagsHalftone = 0x0004
+};
+
+struct ColorPalette
+{
+public:
+ UINT Flags; // palette flags
+ UINT Count; // number of color entries
+ ARGB Entries[1]; // palette color entries
+};
+
+#endif
diff --git a/core/src/fxge/Microsoft SDK/include/GdiPlusRegion.h b/core/src/fxge/Microsoft SDK/include/GdiPlusRegion.h
index dd1d20e273..cfb40a17dc 100644
--- a/core/src/fxge/Microsoft SDK/include/GdiPlusRegion.h
+++ b/core/src/fxge/Microsoft SDK/include/GdiPlusRegion.h
@@ -1,498 +1,498 @@
-/**************************************************************************\
-*
-* Copyright (c) 1998-2000, Microsoft Corp. All Rights Reserved.
-*
-* Module Name:
-*
-* GdiplusRegion.h
-*
-* Abstract:
-*
-* Region API related declarations
-*
-\**************************************************************************/
-
-#ifndef _GDIPLUSREGION_H
-#define _GDIPLUSREGION_H
-
-/**
- * Construct a new region object
- */
-
-inline
-Region::Region()
-{
- GpRegion *region = NULL;
-
- lastResult = DllExports::GdipCreateRegion(&region);
-
- SetNativeRegion(region);
-}
-
-inline
-Region::Region(IN const RectF& rect)
-{
- GpRegion *region = NULL;
-
- lastResult = DllExports::GdipCreateRegionRect(&rect, &region);
-
- SetNativeRegion(region);
-}
-
-inline
-Region::Region(IN const Rect& rect)
-{
- GpRegion *region = NULL;
-
- lastResult = DllExports::GdipCreateRegionRectI(&rect, &region);
-
- SetNativeRegion(region);
-}
-
-inline
-Region::Region(IN const GraphicsPath* path)
-{
- GpRegion *region = NULL;
-
- lastResult = DllExports::GdipCreateRegionPath(path->nativePath, &region);
-
- SetNativeRegion(region);
-}
-
-inline
-Region::Region(IN const BYTE* regionData, IN INT size)
-{
- GpRegion *region = NULL;
-
- lastResult = DllExports::GdipCreateRegionRgnData(regionData, size, &region);
-
- SetNativeRegion(region);
-}
-
-inline
-Region::Region(IN HRGN hRgn)
-{
- GpRegion *region = NULL;
-
- lastResult = DllExports::GdipCreateRegionHrgn(hRgn, &region);
-
- SetNativeRegion(region);
-}
-
-inline
-Region* Region::FromHRGN(IN HRGN hRgn)
-{
- GpRegion *region = NULL;
-
- if (DllExports::GdipCreateRegionHrgn(hRgn, &region) == Ok)
- {
- Region* newRegion = new Region(region);
-
- if (newRegion == NULL)
- {
- DllExports::GdipDeleteRegion(region);
- }
-
- return newRegion;
- }
- else
- return NULL;
-}
-
-inline
-Region::~Region()
-{
- DllExports::GdipDeleteRegion(nativeRegion);
-}
-
-/**
- * Make a copy of the region object
- */
-inline Region*
-Region::Clone() const
-{
- GpRegion *region = NULL;
-
- SetStatus(DllExports::GdipCloneRegion(nativeRegion, &region));
-
- return new Region(region);
-}
-
-inline Status
-Region::MakeInfinite()
-{
- return SetStatus(DllExports::GdipSetInfinite(nativeRegion));
-}
-
-inline Status
-Region::MakeEmpty()
-{
- return SetStatus(DllExports::GdipSetEmpty(nativeRegion));
-}
-
-/**
- * Region operations
- */
-inline Status
-Region::Intersect(IN const RectF& rect)
-{
- return SetStatus(DllExports::GdipCombineRegionRect(nativeRegion, &rect, CombineModeIntersect));
-}
-
-inline Status
-Region::Intersect(IN const Rect& rect)
-{
- return SetStatus(DllExports::GdipCombineRegionRectI(nativeRegion, &rect, CombineModeIntersect));
-}
-
-inline Status
-Region::Intersect(IN const GraphicsPath* path)
-{
- return SetStatus(DllExports::GdipCombineRegionPath(nativeRegion, path->nativePath, CombineModeIntersect));
-}
-
-inline Status
-Region::Intersect(IN const Region* region)
-{
- return SetStatus(DllExports::GdipCombineRegionRegion(nativeRegion, region->nativeRegion, CombineModeIntersect));
-}
-
-inline Status
-Region::Union(IN const RectF& rect)
-{
- return SetStatus(DllExports::GdipCombineRegionRect(nativeRegion, &rect, CombineModeUnion));
-}
-
-inline Status
-Region::Union(IN const Rect& rect)
-{
- return SetStatus(DllExports::GdipCombineRegionRectI(nativeRegion, &rect, CombineModeUnion));
-}
-
-inline Status
-Region::Union(IN const GraphicsPath* path)
-{
- return SetStatus(DllExports::GdipCombineRegionPath(nativeRegion, path->nativePath, CombineModeUnion));
-}
-
-inline Status
-Region::Union(IN const Region* region)
-{
- return SetStatus(DllExports::GdipCombineRegionRegion(nativeRegion, region->nativeRegion, CombineModeUnion));
-}
-
-inline Status
-Region::Xor(IN const RectF& rect)
-{
- return SetStatus(DllExports::GdipCombineRegionRect(nativeRegion, &rect, CombineModeXor));
-}
-
-inline Status
-Region::Xor(IN const Rect& rect)
-{
- return SetStatus(DllExports::GdipCombineRegionRectI(nativeRegion, &rect, CombineModeXor));
-}
-
-inline Status
-Region::Xor(IN const GraphicsPath* path)
-{
- return SetStatus(DllExports::GdipCombineRegionPath(nativeRegion, path->nativePath, CombineModeXor));
-}
-
-inline Status
-Region::Xor(IN const Region* region)
-{
- return SetStatus(DllExports::GdipCombineRegionRegion(nativeRegion, region->nativeRegion, CombineModeXor));
-}
-
-inline Status
-Region::Exclude(IN const RectF& rect)
-{
- return SetStatus(DllExports::GdipCombineRegionRect(nativeRegion, &rect, CombineModeExclude));
-}
-
-inline Status
-Region::Exclude(IN const Rect& rect)
-{
- return SetStatus(DllExports::GdipCombineRegionRectI(nativeRegion, &rect, CombineModeExclude));
-}
-
-inline Status
-Region::Exclude(IN const GraphicsPath* path)
-{
- return SetStatus(DllExports::GdipCombineRegionPath(nativeRegion, path->nativePath, CombineModeExclude));
-}
-
-inline Status
-Region::Exclude(IN const Region* region)
-{
- return SetStatus(DllExports::GdipCombineRegionRegion(nativeRegion,
- region->nativeRegion, CombineModeExclude));
-}
-
-inline Status
-Region::Complement(IN const RectF& rect)
-{
- return SetStatus(DllExports::GdipCombineRegionRect(nativeRegion, &rect, CombineModeComplement));
-}
-
-inline Status
-Region::Complement(IN const Rect& rect)
-{
- return SetStatus(DllExports::GdipCombineRegionRectI(nativeRegion, &rect, CombineModeComplement));
-}
-
-inline Status
-Region::Complement(IN const GraphicsPath* path)
-{
- return SetStatus(DllExports::GdipCombineRegionPath(nativeRegion,
- path->nativePath, CombineModeComplement));
-}
-
-inline Status
-Region::Complement(IN const Region* region)
-{
- return SetStatus(DllExports::GdipCombineRegionRegion(nativeRegion,
- region->nativeRegion, CombineModeComplement));
-}
-
-/**
- * Transform operations
- */
-inline Status
-Region::Translate(IN REAL dx,
- IN REAL dy)
-{
- return SetStatus(DllExports::GdipTranslateRegion(nativeRegion, dx, dy));
-}
-
-inline Status
-Region::Translate(IN INT dx,
- IN INT dy)
-{
- return SetStatus(DllExports::GdipTranslateRegionI(nativeRegion, dx, dy));
-}
-
-inline Status
-Region::Transform(IN const Matrix* matrix)
-{
- return SetStatus(DllExports::GdipTransformRegion(nativeRegion, matrix->nativeMatrix));
-}
-
-/**
- * Get region attributes
- */
-inline Status
-Region::GetBounds(OUT RectF* rect,
- IN const Graphics* g) const
-{
- return SetStatus(DllExports::GdipGetRegionBounds(nativeRegion,
- g->nativeGraphics,
- rect));
-}
-
-inline Status
-Region::GetBounds(OUT Rect* rect,
- IN const Graphics* g) const
-{
- return SetStatus(DllExports::GdipGetRegionBoundsI(nativeRegion,
- g->nativeGraphics,
- rect));
-}
-
-inline HRGN
-Region::GetHRGN(IN const Graphics* g) const
-{
- HRGN hrgn;
-
- SetStatus(DllExports::GdipGetRegionHRgn(nativeRegion,
- g->nativeGraphics,
- &hrgn));
-
- return hrgn;
-}
-
-inline BOOL
-Region::IsEmpty(IN const Graphics *g) const
-{
- BOOL booln = FALSE;
-
- SetStatus(DllExports::GdipIsEmptyRegion(nativeRegion,
- g->nativeGraphics,
- &booln));
-
- return booln;
-}
-
-inline BOOL
-Region::IsInfinite(IN const Graphics *g) const
-{
- BOOL booln = FALSE;
-
- SetStatus(DllExports::GdipIsInfiniteRegion(nativeRegion,
- g->nativeGraphics,
- &booln));
-
- return booln;
-}
-
-inline BOOL
-Region::Equals(IN const Region* region,
- IN const Graphics* g) const
-{
- BOOL booln = FALSE;
-
- SetStatus(DllExports::GdipIsEqualRegion(nativeRegion,
- region->nativeRegion,
- g->nativeGraphics,
- &booln));
- return booln;
-}
-
-// Get the size of the buffer needed for the GetData method
-inline UINT
-Region::GetDataSize() const
-{
- UINT bufferSize = 0;
-
- SetStatus(DllExports::GdipGetRegionDataSize(nativeRegion, &bufferSize));
-
- return bufferSize;
-}
-
-// buffer - where to put the data
-// bufferSize - how big the buffer is (should be at least as big as GetDataSize())
-// sizeFilled - if not NULL, this is an OUT param that says how many bytes
-// of data were written to the buffer.
-inline Status
-Region::GetData(OUT BYTE* buffer,
- IN UINT bufferSize,
- OUT UINT* sizeFilled) const
-{
- return SetStatus(DllExports::GdipGetRegionData(nativeRegion, buffer, bufferSize, sizeFilled));
-}
-
-/**
- * Hit testing operations
- */
-inline BOOL
-Region::IsVisible(IN const PointF& point,
- IN const Graphics* g) const
-{
- BOOL booln = FALSE;
-
- SetStatus(DllExports::GdipIsVisibleRegionPoint(nativeRegion,
- point.X, point.Y,
- (g == NULL) ? NULL : g->nativeGraphics,
- &booln));
- return booln;
-}
-
-inline BOOL
-Region::IsVisible(IN const RectF& rect,
- IN const Graphics* g) const
-{
- BOOL booln = FALSE;
-
- SetStatus(DllExports::GdipIsVisibleRegionRect(nativeRegion, rect.X,
- rect.Y, rect.Width,
- rect.Height,
- (g == NULL) ? NULL : g->nativeGraphics,
- &booln));
- return booln;
-}
-
-inline BOOL
-Region::IsVisible(IN const Point& point,
- IN const Graphics* g) const
-{
- BOOL booln = FALSE;
-
-
- SetStatus(DllExports::GdipIsVisibleRegionPointI(nativeRegion,
- point.X,
- point.Y,
- (g == NULL) ? NULL : g->nativeGraphics,
- &booln));
- return booln;
-}
-
-inline BOOL
-Region::IsVisible(IN const Rect& rect,
- IN const Graphics* g) const
-{
- BOOL booln = FALSE;
-
- SetStatus(DllExports::GdipIsVisibleRegionRectI(nativeRegion,
- rect.X,
- rect.Y,
- rect.Width,
- rect.Height,
- (g == NULL) ? NULL : g->nativeGraphics,
- &booln));
- return booln;
-}
-
-inline UINT
-Region::GetRegionScansCount(IN const Matrix* matrix) const
-{
- UINT count = 0;
-
- SetStatus(DllExports::GdipGetRegionScansCount(nativeRegion,
- &count,
- matrix->nativeMatrix));
- return count;
-}
-
-inline Status
-Region::GetRegionScans(
- IN const Matrix* matrix,
- OUT RectF* rects,
- IN OUT INT* count) const
-{
- return SetStatus(DllExports::GdipGetRegionScans(nativeRegion,
- rects,
- count,
- matrix->nativeMatrix));
-}
-
-// If rects is NULL, return the count of rects in the region.
-// Otherwise, assume rects is big enough to hold all the region rects
-// and fill them in and return the number of rects filled in.
-// The rects are returned in the units specified by the matrix
-// (which is typically a world-to-device transform).
-// Note that the number of rects returned can vary, depending on the
-// matrix that is used.
-inline Status
-Region::GetRegionScans(
- IN const Matrix* matrix,
- OUT Rect* rects, // NULL to just get the count
- IN OUT INT* count) const
-{
- return SetStatus(DllExports::GdipGetRegionScansI(nativeRegion,
- rects,
- count,
- matrix->nativeMatrix));
-}
-
-// protected method
-inline Region::Region(GpRegion* nativeRegion)
-{
- SetNativeRegion(nativeRegion);
-}
-
-// protected method
-inline VOID Region::SetNativeRegion(GpRegion* nativeRegion)
-{
- this->nativeRegion = nativeRegion;
-}
-
-inline Status Region::GetLastStatus() const
-{
- Status lastStatus = lastResult;
- lastResult = Ok;
-
- return lastStatus;
-}
-
-#endif // !_GDIPLUSREGION_H
+/**************************************************************************\
+*
+* Copyright (c) 1998-2000, Microsoft Corp. All Rights Reserved.
+*
+* Module Name:
+*
+* GdiplusRegion.h
+*
+* Abstract:
+*
+* Region API related declarations
+*
+\**************************************************************************/
+
+#ifndef _GDIPLUSREGION_H
+#define _GDIPLUSREGION_H
+
+/**
+ * Construct a new region object
+ */
+
+inline
+Region::Region()
+{
+ GpRegion *region = NULL;
+
+ lastResult = DllExports::GdipCreateRegion(&region);
+
+ SetNativeRegion(region);
+}
+
+inline
+Region::Region(IN const RectF& rect)
+{
+ GpRegion *region = NULL;
+
+ lastResult = DllExports::GdipCreateRegionRect(&rect, &region);
+
+ SetNativeRegion(region);
+}
+
+inline
+Region::Region(IN const Rect& rect)
+{
+ GpRegion *region = NULL;
+
+ lastResult = DllExports::GdipCreateRegionRectI(&rect, &region);
+
+ SetNativeRegion(region);
+}
+
+inline
+Region::Region(IN const GraphicsPath* path)
+{
+ GpRegion *region = NULL;
+
+ lastResult = DllExports::GdipCreateRegionPath(path->nativePath, &region);
+
+ SetNativeRegion(region);
+}
+
+inline
+Region::Region(IN const BYTE* regionData, IN INT size)
+{
+ GpRegion *region = NULL;
+
+ lastResult = DllExports::GdipCreateRegionRgnData(regionData, size, &region);
+
+ SetNativeRegion(region);
+}
+
+inline
+Region::Region(IN HRGN hRgn)
+{
+ GpRegion *region = NULL;
+
+ lastResult = DllExports::GdipCreateRegionHrgn(hRgn, &region);
+
+ SetNativeRegion(region);
+}
+
+inline
+Region* Region::FromHRGN(IN HRGN hRgn)
+{
+ GpRegion *region = NULL;
+
+ if (DllExports::GdipCreateRegionHrgn(hRgn, &region) == Ok)
+ {
+ Region* newRegion = new Region(region);
+
+ if (newRegion == NULL)
+ {
+ DllExports::GdipDeleteRegion(region);
+ }
+
+ return newRegion;
+ }
+ else
+ return NULL;
+}
+
+inline
+Region::~Region()
+{
+ DllExports::GdipDeleteRegion(nativeRegion);
+}
+
+/**
+ * Make a copy of the region object
+ */
+inline Region*
+Region::Clone() const
+{
+ GpRegion *region = NULL;
+
+ SetStatus(DllExports::GdipCloneRegion(nativeRegion, &region));
+
+ return new Region(region);
+}
+
+inline Status
+Region::MakeInfinite()
+{
+ return SetStatus(DllExports::GdipSetInfinite(nativeRegion));
+}
+
+inline Status
+Region::MakeEmpty()
+{
+ return SetStatus(DllExports::GdipSetEmpty(nativeRegion));
+}
+
+/**
+ * Region operations
+ */
+inline Status
+Region::Intersect(IN const RectF& rect)
+{
+ return SetStatus(DllExports::GdipCombineRegionRect(nativeRegion, &rect, CombineModeIntersect));
+}
+
+inline Status
+Region::Intersect(IN const Rect& rect)
+{
+ return SetStatus(DllExports::GdipCombineRegionRectI(nativeRegion, &rect, CombineModeIntersect));
+}
+
+inline Status
+Region::Intersect(IN const GraphicsPath* path)
+{
+ return SetStatus(DllExports::GdipCombineRegionPath(nativeRegion, path->nativePath, CombineModeIntersect));
+}
+
+inline Status
+Region::Intersect(IN const Region* region)
+{
+ return SetStatus(DllExports::GdipCombineRegionRegion(nativeRegion, region->nativeRegion, CombineModeIntersect));
+}
+
+inline Status
+Region::Union(IN const RectF& rect)
+{
+ return SetStatus(DllExports::GdipCombineRegionRect(nativeRegion, &rect, CombineModeUnion));
+}
+
+inline Status
+Region::Union(IN const Rect& rect)
+{
+ return SetStatus(DllExports::GdipCombineRegionRectI(nativeRegion, &rect, CombineModeUnion));
+}
+
+inline Status
+Region::Union(IN const GraphicsPath* path)
+{
+ return SetStatus(DllExports::GdipCombineRegionPath(nativeRegion, path->nativePath, CombineModeUnion));
+}
+
+inline Status
+Region::Union(IN const Region* region)
+{
+ return SetStatus(DllExports::GdipCombineRegionRegion(nativeRegion, region->nativeRegion, CombineModeUnion));
+}
+
+inline Status
+Region::Xor(IN const RectF& rect)
+{
+ return SetStatus(DllExports::GdipCombineRegionRect(nativeRegion, &rect, CombineModeXor));
+}
+
+inline Status
+Region::Xor(IN const Rect& rect)
+{
+ return SetStatus(DllExports::GdipCombineRegionRectI(nativeRegion, &rect, CombineModeXor));
+}
+
+inline Status
+Region::Xor(IN const GraphicsPath* path)
+{
+ return SetStatus(DllExports::GdipCombineRegionPath(nativeRegion, path->nativePath, CombineModeXor));
+}
+
+inline Status
+Region::Xor(IN const Region* region)
+{
+ return SetStatus(DllExports::GdipCombineRegionRegion(nativeRegion, region->nativeRegion, CombineModeXor));
+}
+
+inline Status
+Region::Exclude(IN const RectF& rect)
+{
+ return SetStatus(DllExports::GdipCombineRegionRect(nativeRegion, &rect, CombineModeExclude));
+}
+
+inline Status
+Region::Exclude(IN const Rect& rect)
+{
+ return SetStatus(DllExports::GdipCombineRegionRectI(nativeRegion, &rect, CombineModeExclude));
+}
+
+inline Status
+Region::Exclude(IN const GraphicsPath* path)
+{
+ return SetStatus(DllExports::GdipCombineRegionPath(nativeRegion, path->nativePath, CombineModeExclude));
+}
+
+inline Status
+Region::Exclude(IN const Region* region)
+{
+ return SetStatus(DllExports::GdipCombineRegionRegion(nativeRegion,
+ region->nativeRegion, CombineModeExclude));
+}
+
+inline Status
+Region::Complement(IN const RectF& rect)
+{
+ return SetStatus(DllExports::GdipCombineRegionRect(nativeRegion, &rect, CombineModeComplement));
+}
+
+inline Status
+Region::Complement(IN const Rect& rect)
+{
+ return SetStatus(DllExports::GdipCombineRegionRectI(nativeRegion, &rect, CombineModeComplement));
+}
+
+inline Status
+Region::Complement(IN const GraphicsPath* path)
+{
+ return SetStatus(DllExports::GdipCombineRegionPath(nativeRegion,
+ path->nativePath, CombineModeComplement));
+}
+
+inline Status
+Region::Complement(IN const Region* region)
+{
+ return SetStatus(DllExports::GdipCombineRegionRegion(nativeRegion,
+ region->nativeRegion, CombineModeComplement));
+}
+
+/**
+ * Transform operations
+ */
+inline Status
+Region::Translate(IN REAL dx,
+ IN REAL dy)
+{
+ return SetStatus(DllExports::GdipTranslateRegion(nativeRegion, dx, dy));
+}
+
+inline Status
+Region::Translate(IN INT dx,
+ IN INT dy)
+{
+ return SetStatus(DllExports::GdipTranslateRegionI(nativeRegion, dx, dy));
+}
+
+inline Status
+Region::Transform(IN const Matrix* matrix)
+{
+ return SetStatus(DllExports::GdipTransformRegion(nativeRegion, matrix->nativeMatrix));
+}
+
+/**
+ * Get region attributes
+ */
+inline Status
+Region::GetBounds(OUT RectF* rect,
+ IN const Graphics* g) const
+{
+ return SetStatus(DllExports::GdipGetRegionBounds(nativeRegion,
+ g->nativeGraphics,
+ rect));
+}
+
+inline Status
+Region::GetBounds(OUT Rect* rect,
+ IN const Graphics* g) const
+{
+ return SetStatus(DllExports::GdipGetRegionBoundsI(nativeRegion,
+ g->nativeGraphics,
+ rect));
+}
+
+inline HRGN
+Region::GetHRGN(IN const Graphics* g) const
+{
+ HRGN hrgn;
+
+ SetStatus(DllExports::GdipGetRegionHRgn(nativeRegion,
+ g->nativeGraphics,
+ &hrgn));
+
+ return hrgn;
+}
+
+inline BOOL
+Region::IsEmpty(IN const Graphics *g) const
+{
+ BOOL booln = FALSE;
+
+ SetStatus(DllExports::GdipIsEmptyRegion(nativeRegion,
+ g->nativeGraphics,
+ &booln));
+
+ return booln;
+}
+
+inline BOOL
+Region::IsInfinite(IN const Graphics *g) const
+{
+ BOOL booln = FALSE;
+
+ SetStatus(DllExports::GdipIsInfiniteRegion(nativeRegion,
+ g->nativeGraphics,
+ &booln));
+
+ return booln;
+}
+
+inline BOOL
+Region::Equals(IN const Region* region,
+ IN const Graphics* g) const
+{
+ BOOL booln = FALSE;
+
+ SetStatus(DllExports::GdipIsEqualRegion(nativeRegion,
+ region->nativeRegion,
+ g->nativeGraphics,
+ &booln));
+ return booln;
+}
+
+// Get the size of the buffer needed for the GetData method
+inline UINT
+Region::GetDataSize() const
+{
+ UINT bufferSize = 0;
+
+ SetStatus(DllExports::GdipGetRegionDataSize(nativeRegion, &bufferSize));
+
+ return bufferSize;
+}
+
+// buffer - where to put the data
+// bufferSize - how big the buffer is (should be at least as big as GetDataSize())
+// sizeFilled - if not NULL, this is an OUT param that says how many bytes
+// of data were written to the buffer.
+inline Status
+Region::GetData(OUT BYTE* buffer,
+ IN UINT bufferSize,
+ OUT UINT* sizeFilled) const
+{
+ return SetStatus(DllExports::GdipGetRegionData(nativeRegion, buffer, bufferSize, sizeFilled));
+}
+
+/**
+ * Hit testing operations
+ */
+inline BOOL
+Region::IsVisible(IN const PointF& point,
+ IN const Graphics* g) const
+{
+ BOOL booln = FALSE;
+
+ SetStatus(DllExports::GdipIsVisibleRegionPoint(nativeRegion,
+ point.X, point.Y,
+ (g == NULL) ? NULL : g->nativeGraphics,
+ &booln));
+ return booln;
+}
+
+inline BOOL
+Region::IsVisible(IN const RectF& rect,
+ IN const Graphics* g) const
+{
+ BOOL booln = FALSE;
+
+ SetStatus(DllExports::GdipIsVisibleRegionRect(nativeRegion, rect.X,
+ rect.Y, rect.Width,
+ rect.Height,
+ (g == NULL) ? NULL : g->nativeGraphics,
+ &booln));
+ return booln;
+}
+
+inline BOOL
+Region::IsVisible(IN const Point& point,
+ IN const Graphics* g) const
+{
+ BOOL booln = FALSE;
+
+
+ SetStatus(DllExports::GdipIsVisibleRegionPointI(nativeRegion,
+ point.X,
+ point.Y,
+ (g == NULL) ? NULL : g->nativeGraphics,
+ &booln));
+ return booln;
+}
+
+inline BOOL
+Region::IsVisible(IN const Rect& rect,
+ IN const Graphics* g) const
+{
+ BOOL booln = FALSE;
+
+ SetStatus(DllExports::GdipIsVisibleRegionRectI(nativeRegion,
+ rect.X,
+ rect.Y,
+ rect.Width,
+ rect.Height,
+ (g == NULL) ? NULL : g->nativeGraphics,
+ &booln));
+ return booln;
+}
+
+inline UINT
+Region::GetRegionScansCount(IN const Matrix* matrix) const
+{
+ UINT count = 0;
+
+ SetStatus(DllExports::GdipGetRegionScansCount(nativeRegion,
+ &count,
+ matrix->nativeMatrix));
+ return count;
+}
+
+inline Status
+Region::GetRegionScans(
+ IN const Matrix* matrix,
+ OUT RectF* rects,
+ IN OUT INT* count) const
+{
+ return SetStatus(DllExports::GdipGetRegionScans(nativeRegion,
+ rects,
+ count,
+ matrix->nativeMatrix));
+}
+
+// If rects is NULL, return the count of rects in the region.
+// Otherwise, assume rects is big enough to hold all the region rects
+// and fill them in and return the number of rects filled in.
+// The rects are returned in the units specified by the matrix
+// (which is typically a world-to-device transform).
+// Note that the number of rects returned can vary, depending on the
+// matrix that is used.
+inline Status
+Region::GetRegionScans(
+ IN const Matrix* matrix,
+ OUT Rect* rects, // NULL to just get the count
+ IN OUT INT* count) const
+{
+ return SetStatus(DllExports::GdipGetRegionScansI(nativeRegion,
+ rects,
+ count,
+ matrix->nativeMatrix));
+}
+
+// protected method
+inline Region::Region(GpRegion* nativeRegion)
+{
+ SetNativeRegion(nativeRegion);
+}
+
+// protected method
+inline VOID Region::SetNativeRegion(GpRegion* nativeRegion)
+{
+ this->nativeRegion = nativeRegion;
+}
+
+inline Status Region::GetLastStatus() const
+{
+ Status lastStatus = lastResult;
+ lastResult = Ok;
+
+ return lastStatus;
+}
+
+#endif // !_GDIPLUSREGION_H
diff --git a/core/src/fxge/Microsoft SDK/include/GdiPlusStringFormat.h b/core/src/fxge/Microsoft SDK/include/GdiPlusStringFormat.h
index 1c9ddb50ec..b4ed431a06 100644
--- a/core/src/fxge/Microsoft SDK/include/GdiPlusStringFormat.h
+++ b/core/src/fxge/Microsoft SDK/include/GdiPlusStringFormat.h
@@ -1,381 +1,381 @@
-/**************************************************************************\
-*
-* Copyright (c) 1998-2000, Microsoft Corp. All Rights Reserved.
-*
-* Module Name:
-*
-* GdiplusStringFormat.h
-*
-* Abstract:
-*
-* String format specification for DrawString and text APIs
-*
-\**************************************************************************/
-
-#ifndef _GDIPLUSSTRINGFORMAT_H
-#define _GDIPLUSSTRINGFORMAT_H
-
-
-class StringFormat : public GdiplusBase
-{
-public:
- friend class Graphics;
- friend class GraphicsPath;
-
-
- StringFormat(
- IN INT formatFlags = 0,
- IN LANGID language = LANG_NEUTRAL
- )
- {
- nativeFormat = NULL;
- lastError = DllExports::GdipCreateStringFormat(
- formatFlags,
- language,
- &nativeFormat
- );
- }
-
- static const StringFormat *GenericDefault();
- static const StringFormat *GenericTypographic();
-
- // Constructor based on existing string format
-
- StringFormat(
- IN const StringFormat *format
- )
- {
- nativeFormat = NULL;
- lastError = DllExports::GdipCloneStringFormat(
- format ? format->nativeFormat : NULL,
- &nativeFormat
- );
- }
-
- StringFormat *Clone() const
- {
- GpStringFormat *clonedStringFormat = NULL;
-
- lastError = DllExports::GdipCloneStringFormat(
- nativeFormat,
- &clonedStringFormat
- );
-
- if (lastError == Ok)
- return new StringFormat(clonedStringFormat, lastError);
- else
- return NULL;
- }
-
- ~StringFormat()
- {
- DllExports::GdipDeleteStringFormat(nativeFormat);
- }
-
- Status SetFormatFlags(IN INT flags)
- {
- return SetStatus(DllExports::GdipSetStringFormatFlags(
- nativeFormat,
- flags
- ));
- }
-
- INT GetFormatFlags() const
- {
- INT flags;
- SetStatus(DllExports::GdipGetStringFormatFlags(nativeFormat, &flags));
- return flags;
- }
-
-#ifndef DCR_USE_NEW_152154
- Status SetLineSpacing(
- IN REAL amount = 1.0f,
- IN LineSpacing method = LineSpacingRecommended
- )
- {
- return SetStatus(DllExports::GdipSetStringFormatLineSpacing(
- nativeFormat,
- amount,
- method
- ));
- }
-#endif
-
- Status SetAlignment(IN StringAlignment align)
- {
- return SetStatus(DllExports::GdipSetStringFormatAlign(
- nativeFormat,
- align
- ));
- }
-
- StringAlignment GetAlignment() const
- {
- StringAlignment alignment;
- SetStatus(DllExports::GdipGetStringFormatAlign(
- nativeFormat,
- &alignment
- ));
- return alignment;
- }
-
- Status SetLineAlignment(IN StringAlignment align)
- {
- return SetStatus(DllExports::GdipSetStringFormatLineAlign(
- nativeFormat,
- align
- ));
- }
-
- StringAlignment GetLineAlignment() const
- {
- StringAlignment alignment;
- SetStatus(DllExports::GdipGetStringFormatLineAlign(
- nativeFormat,
- &alignment
- ));
- return alignment;
- }
-
- Status SetHotkeyPrefix(IN HotkeyPrefix hotkeyPrefix)
- {
- return SetStatus(DllExports::GdipSetStringFormatHotkeyPrefix(
- nativeFormat,
- (INT)hotkeyPrefix
- ));
- }
-
- HotkeyPrefix GetHotkeyPrefix() const
- {
- HotkeyPrefix hotkeyPrefix;
- SetStatus(DllExports::GdipGetStringFormatHotkeyPrefix(
- nativeFormat,
- (INT*)&hotkeyPrefix
- ));
- return hotkeyPrefix;
- }
-
- Status SetTabStops(
- IN REAL firstTabOffset,
- IN INT count,
- IN const REAL *tabStops
- )
- {
- return SetStatus(DllExports::GdipSetStringFormatTabStops(
- nativeFormat,
- firstTabOffset,
- count,
- tabStops
- ));
- }
-
- INT GetTabStopCount() const
- {
- INT count;
- SetStatus(DllExports::GdipGetStringFormatTabStopCount(nativeFormat, &count));
- return count;
- }
-
- Status GetTabStops(
- IN INT count,
- OUT REAL *firstTabOffset,
- OUT REAL *tabStops
- ) const
- {
- return SetStatus(DllExports::GdipGetStringFormatTabStops(
- nativeFormat,
- count,
- firstTabOffset,
- tabStops
- ));
- }
-
-#ifdef DCR_USE_NEW_146933
- Status SetDigitSubstitution(
- IN LANGID language,
- IN StringDigitSubstitute substitute
- )
- {
- return SetStatus(DllExports::GdipSetStringFormatDigitSubstitution(
- nativeFormat,
- language,
- substitute
- ));
- }
-
- LANGID GetDigitSubstitutionLanguage(
- ) const
- {
- LANGID language;
- SetStatus(DllExports::GdipGetStringFormatDigitSubstitution(
- nativeFormat,
- &language,
- NULL
- ));
- return language;
- }
-
- StringDigitSubstitute GetDigitSubstitutionMethod(
- ) const
- {
- StringDigitSubstitute substitute;
- SetStatus(DllExports::GdipGetStringFormatDigitSubstitution(
- nativeFormat,
- NULL,
- &substitute
- ));
- return substitute;
- }
-#endif // DCR_USE_NEW_146933
-
- // String trimming. How to handle more text than can be displayed
- // in the limits available.
-
- Status SetTrimming(IN StringTrimming trimming)
- {
- return SetStatus(DllExports::GdipSetStringFormatTrimming(
- nativeFormat,
- trimming
- ));
- }
-
- StringTrimming StringFormat::GetTrimming() const
- {
- StringTrimming trimming;
- SetStatus(DllExports::GdipGetStringFormatTrimming(
- nativeFormat,
- &trimming
- ));
- return trimming;
- }
-
-#ifdef DCR_USE_NEW_174340
- Status SetMeasurableCharacterRanges(
- IN INT rangeCount,
- IN const CharacterRange *ranges
- )
- {
- return SetStatus(DllExports::GdipSetStringFormatMeasurableCharacterRanges(
- nativeFormat,
- rangeCount,
- ranges
- ));
- }
-
- INT GetMeasurableCharacterRangeCount()
- {
- INT count;
- SetStatus(DllExports::GdipGetStringFormatMeasurableCharacterRangeCount(
- nativeFormat,
- &count
- ));
- return count;
- }
-#endif
-
- // GetLastStatus - return last error code and clear error code
-
- Status GetLastStatus() const
- {
- Status lastStatus = lastError;
- lastError = Ok;
-
- return lastStatus;
- }
-
-protected:
-
- Status SetStatus(GpStatus newStatus) const
- {
- if (newStatus == Ok)
- {
- return Ok;
- }
- else
- {
- return lastError = newStatus;
- }
- }
-
-
-// Not allowed and move to private
- StringFormat(const StringFormat &source)
- {
- nativeFormat = NULL;
- lastError = DllExports::GdipCloneStringFormat(
- source.nativeFormat,
- &nativeFormat
- );
- }
-
- StringFormat& operator=(const StringFormat &source)
- {
- DllExports::GdipDeleteStringFormat(nativeFormat);
- lastError = DllExports::GdipCloneStringFormat(
- source.nativeFormat,
- &nativeFormat
- );
- return *this;
- }
-
-
- // private constructor for copy
- StringFormat(GpStringFormat * clonedStringFormat, Status status)
- {
- lastError = status;
- nativeFormat = clonedStringFormat;
-
- }
-
- GpStringFormat *nativeFormat;
- mutable Status lastError;
-};
-
-// Generic constant string formats.
-
-static BYTE GenericTypographicStringFormatBuffer[sizeof(StringFormat)] = {0};
-static BYTE GenericDefaultStringFormatBuffer[sizeof(StringFormat)] = {0};
-
-static StringFormat *GenericTypographicStringFormat = NULL;
-static StringFormat *GenericDefaultStringFormat = NULL;
-
-// Define the generic string formats
-
-
-inline const StringFormat *StringFormat::GenericDefault()
-{
- if (GenericDefaultStringFormat != NULL)
- {
- return GenericDefaultStringFormat;
- }
-
- GenericDefaultStringFormat =
- (StringFormat*)GenericDefaultStringFormatBuffer;
-
- GenericDefaultStringFormat->lastError =
- DllExports::GdipStringFormatGetGenericDefault(
- &(GenericDefaultStringFormat->nativeFormat)
- );
-
- return GenericDefaultStringFormat;
-}
-
-inline const StringFormat *StringFormat::GenericTypographic()
-{
- if (GenericTypographicStringFormat != NULL)
- {
- return GenericTypographicStringFormat;
- }
-
- GenericTypographicStringFormat =
- (StringFormat*)GenericTypographicStringFormatBuffer;
-
- GenericTypographicStringFormat->lastError =
- DllExports::GdipStringFormatGetGenericTypographic(
- &GenericTypographicStringFormat->nativeFormat
- );
-
- return GenericTypographicStringFormat;
-}
-
-#endif // !_GDIPLUSSTRINGFORMAT_H
+/**************************************************************************\
+*
+* Copyright (c) 1998-2000, Microsoft Corp. All Rights Reserved.
+*
+* Module Name:
+*
+* GdiplusStringFormat.h
+*
+* Abstract:
+*
+* String format specification for DrawString and text APIs
+*
+\**************************************************************************/
+
+#ifndef _GDIPLUSSTRINGFORMAT_H
+#define _GDIPLUSSTRINGFORMAT_H
+
+
+class StringFormat : public GdiplusBase
+{
+public:
+ friend class Graphics;
+ friend class GraphicsPath;
+
+
+ StringFormat(
+ IN INT formatFlags = 0,
+ IN LANGID language = LANG_NEUTRAL
+ )
+ {
+ nativeFormat = NULL;
+ lastError = DllExports::GdipCreateStringFormat(
+ formatFlags,
+ language,
+ &nativeFormat
+ );
+ }
+
+ static const StringFormat *GenericDefault();
+ static const StringFormat *GenericTypographic();
+
+ // Constructor based on existing string format
+
+ StringFormat(
+ IN const StringFormat *format
+ )
+ {
+ nativeFormat = NULL;
+ lastError = DllExports::GdipCloneStringFormat(
+ format ? format->nativeFormat : NULL,
+ &nativeFormat
+ );
+ }
+
+ StringFormat *Clone() const
+ {
+ GpStringFormat *clonedStringFormat = NULL;
+
+ lastError = DllExports::GdipCloneStringFormat(
+ nativeFormat,
+ &clonedStringFormat
+ );
+
+ if (lastError == Ok)
+ return new StringFormat(clonedStringFormat, lastError);
+ else
+ return NULL;
+ }
+
+ ~StringFormat()
+ {
+ DllExports::GdipDeleteStringFormat(nativeFormat);
+ }
+
+ Status SetFormatFlags(IN INT flags)
+ {
+ return SetStatus(DllExports::GdipSetStringFormatFlags(
+ nativeFormat,
+ flags
+ ));
+ }
+
+ INT GetFormatFlags() const
+ {
+ INT flags;
+ SetStatus(DllExports::GdipGetStringFormatFlags(nativeFormat, &flags));
+ return flags;
+ }
+
+#ifndef DCR_USE_NEW_152154
+ Status SetLineSpacing(
+ IN REAL amount = 1.0f,
+ IN LineSpacing method = LineSpacingRecommended
+ )
+ {
+ return SetStatus(DllExports::GdipSetStringFormatLineSpacing(
+ nativeFormat,
+ amount,
+ method
+ ));
+ }
+#endif
+
+ Status SetAlignment(IN StringAlignment align)
+ {
+ return SetStatus(DllExports::GdipSetStringFormatAlign(
+ nativeFormat,
+ align
+ ));
+ }
+
+ StringAlignment GetAlignment() const
+ {
+ StringAlignment alignment;
+ SetStatus(DllExports::GdipGetStringFormatAlign(
+ nativeFormat,
+ &alignment
+ ));
+ return alignment;
+ }
+
+ Status SetLineAlignment(IN StringAlignment align)
+ {
+ return SetStatus(DllExports::GdipSetStringFormatLineAlign(
+ nativeFormat,
+ align
+ ));
+ }
+
+ StringAlignment GetLineAlignment() const
+ {
+ StringAlignment alignment;
+ SetStatus(DllExports::GdipGetStringFormatLineAlign(
+ nativeFormat,
+ &alignment
+ ));
+ return alignment;
+ }
+
+ Status SetHotkeyPrefix(IN HotkeyPrefix hotkeyPrefix)
+ {
+ return SetStatus(DllExports::GdipSetStringFormatHotkeyPrefix(
+ nativeFormat,
+ (INT)hotkeyPrefix
+ ));
+ }
+
+ HotkeyPrefix GetHotkeyPrefix() const
+ {
+ HotkeyPrefix hotkeyPrefix;
+ SetStatus(DllExports::GdipGetStringFormatHotkeyPrefix(
+ nativeFormat,
+ (INT*)&hotkeyPrefix
+ ));
+ return hotkeyPrefix;
+ }
+
+ Status SetTabStops(
+ IN REAL firstTabOffset,
+ IN INT count,
+ IN const REAL *tabStops
+ )
+ {
+ return SetStatus(DllExports::GdipSetStringFormatTabStops(
+ nativeFormat,
+ firstTabOffset,
+ count,
+ tabStops
+ ));
+ }
+
+ INT GetTabStopCount() const
+ {
+ INT count;
+ SetStatus(DllExports::GdipGetStringFormatTabStopCount(nativeFormat, &count));
+ return count;
+ }
+
+ Status GetTabStops(
+ IN INT count,
+ OUT REAL *firstTabOffset,
+ OUT REAL *tabStops
+ ) const
+ {
+ return SetStatus(DllExports::GdipGetStringFormatTabStops(
+ nativeFormat,
+ count,
+ firstTabOffset,
+ tabStops
+ ));
+ }
+
+#ifdef DCR_USE_NEW_146933
+ Status SetDigitSubstitution(
+ IN LANGID language,
+ IN StringDigitSubstitute substitute
+ )
+ {
+ return SetStatus(DllExports::GdipSetStringFormatDigitSubstitution(
+ nativeFormat,
+ language,
+ substitute
+ ));
+ }
+
+ LANGID GetDigitSubstitutionLanguage(
+ ) const
+ {
+ LANGID language;
+ SetStatus(DllExports::GdipGetStringFormatDigitSubstitution(
+ nativeFormat,
+ &language,
+ NULL
+ ));
+ return language;
+ }
+
+ StringDigitSubstitute GetDigitSubstitutionMethod(
+ ) const
+ {
+ StringDigitSubstitute substitute;
+ SetStatus(DllExports::GdipGetStringFormatDigitSubstitution(
+ nativeFormat,
+ NULL,
+ &substitute
+ ));
+ return substitute;
+ }
+#endif // DCR_USE_NEW_146933
+
+ // String trimming. How to handle more text than can be displayed
+ // in the limits available.
+
+ Status SetTrimming(IN StringTrimming trimming)
+ {
+ return SetStatus(DllExports::GdipSetStringFormatTrimming(
+ nativeFormat,
+ trimming
+ ));
+ }
+
+ StringTrimming StringFormat::GetTrimming() const
+ {
+ StringTrimming trimming;
+ SetStatus(DllExports::GdipGetStringFormatTrimming(
+ nativeFormat,
+ &trimming
+ ));
+ return trimming;
+ }
+
+#ifdef DCR_USE_NEW_174340
+ Status SetMeasurableCharacterRanges(
+ IN INT rangeCount,
+ IN const CharacterRange *ranges
+ )
+ {
+ return SetStatus(DllExports::GdipSetStringFormatMeasurableCharacterRanges(
+ nativeFormat,
+ rangeCount,
+ ranges
+ ));
+ }
+
+ INT GetMeasurableCharacterRangeCount()
+ {
+ INT count;
+ SetStatus(DllExports::GdipGetStringFormatMeasurableCharacterRangeCount(
+ nativeFormat,
+ &count
+ ));
+ return count;
+ }
+#endif
+
+ // GetLastStatus - return last error code and clear error code
+
+ Status GetLastStatus() const
+ {
+ Status lastStatus = lastError;
+ lastError = Ok;
+
+ return lastStatus;
+ }
+
+protected:
+
+ Status SetStatus(GpStatus newStatus) const
+ {
+ if (newStatus == Ok)
+ {
+ return Ok;
+ }
+ else
+ {
+ return lastError = newStatus;
+ }
+ }
+
+
+// Not allowed and move to private
+ StringFormat(const StringFormat &source)
+ {
+ nativeFormat = NULL;
+ lastError = DllExports::GdipCloneStringFormat(
+ source.nativeFormat,
+ &nativeFormat
+ );
+ }
+
+ StringFormat& operator=(const StringFormat &source)
+ {
+ DllExports::GdipDeleteStringFormat(nativeFormat);
+ lastError = DllExports::GdipCloneStringFormat(
+ source.nativeFormat,
+ &nativeFormat
+ );
+ return *this;
+ }
+
+
+ // private constructor for copy
+ StringFormat(GpStringFormat * clonedStringFormat, Status status)
+ {
+ lastError = status;
+ nativeFormat = clonedStringFormat;
+
+ }
+
+ GpStringFormat *nativeFormat;
+ mutable Status lastError;
+};
+
+// Generic constant string formats.
+
+static BYTE GenericTypographicStringFormatBuffer[sizeof(StringFormat)] = {0};
+static BYTE GenericDefaultStringFormatBuffer[sizeof(StringFormat)] = {0};
+
+static StringFormat *GenericTypographicStringFormat = NULL;
+static StringFormat *GenericDefaultStringFormat = NULL;
+
+// Define the generic string formats
+
+
+inline const StringFormat *StringFormat::GenericDefault()
+{
+ if (GenericDefaultStringFormat != NULL)
+ {
+ return GenericDefaultStringFormat;
+ }
+
+ GenericDefaultStringFormat =
+ (StringFormat*)GenericDefaultStringFormatBuffer;
+
+ GenericDefaultStringFormat->lastError =
+ DllExports::GdipStringFormatGetGenericDefault(
+ &(GenericDefaultStringFormat->nativeFormat)
+ );
+
+ return GenericDefaultStringFormat;
+}
+
+inline const StringFormat *StringFormat::GenericTypographic()
+{
+ if (GenericTypographicStringFormat != NULL)
+ {
+ return GenericTypographicStringFormat;
+ }
+
+ GenericTypographicStringFormat =
+ (StringFormat*)GenericTypographicStringFormatBuffer;
+
+ GenericTypographicStringFormat->lastError =
+ DllExports::GdipStringFormatGetGenericTypographic(
+ &GenericTypographicStringFormat->nativeFormat
+ );
+
+ return GenericTypographicStringFormat;
+}
+
+#endif // !_GDIPLUSSTRINGFORMAT_H
diff --git a/core/src/fxge/Microsoft SDK/include/GdiPlusTypes.h b/core/src/fxge/Microsoft SDK/include/GdiPlusTypes.h
index 58c584dc1d..d5c03a265e 100644
--- a/core/src/fxge/Microsoft SDK/include/GdiPlusTypes.h
+++ b/core/src/fxge/Microsoft SDK/include/GdiPlusTypes.h
@@ -1,826 +1,826 @@
-/**************************************************************************\
-*
-* Copyright (c) 1998-2000, Microsoft Corp. All Rights Reserved.
-*
-* Module Name:
-*
-* GdiplusTypes.h
-*
-* Abstract:
-*
-* Basic types used by GDI+
-*
-\**************************************************************************/
-
-#ifndef _GDIPLUSTYPES_H
-#define _GDIPLUSTYPES_H
-
-#ifndef DCR_USE_NEW_175866
-
-//--------------------------------------------------------------------------
-// LIB version initialization functions
-//--------------------------------------------------------------------------
-
-typedef VOID (__cdecl *DEBUGEVENTFUNCTION)(INT level, CHAR *message);
-
-extern "C" BOOL __stdcall InitializeGdiplus(DEBUGEVENTFUNCTION);
-extern "C" VOID __stdcall UninitializeGdiplus();
-
-#endif
-
-//--------------------------------------------------------------------------
-// Callback functions
-//--------------------------------------------------------------------------
-
-extern "C" {
-typedef BOOL (CALLBACK * ImageAbort)(VOID *);
-typedef ImageAbort DrawImageAbort;
-typedef ImageAbort GetThumbnailImageAbort;
-}
-
-// Callback for EnumerateMetafile methods. The parameters are:
-
-// recordType WMF, EMF, or EMF+ record type
-// flags (always 0 for WMF/EMF records)
-// dataSize size of the record data (in bytes), or 0 if no data
-// data pointer to the record data, or NULL if no data
-// callbackData pointer to callbackData, if any
-
-// This method can then call Metafile::PlayRecord to play the
-// record that was just enumerated. If this method returns
-// FALSE, the enumeration process is aborted. Otherwise, it continues.
-
-extern "C" {
-typedef BOOL (CALLBACK * EnumerateMetafileProc)(EmfPlusRecordType,UINT,UINT,const BYTE*,VOID*);
-}
-
-//--------------------------------------------------------------------------
-// Primitive data types
-//
-// NOTE:
-// Types already defined in standard header files:
-// INT8
-// UINT8
-// INT16
-// UINT16
-// INT32
-// UINT32
-// INT64
-// UINT64
-//
-// Avoid using the following types:
-// LONG - use INT
-// ULONG - use UINT
-// DWORD - use UINT32
-//--------------------------------------------------------------------------
-
-typedef float REAL;
-
-#define REAL_MAX FLT_MAX
-#define REAL_MIN FLT_MIN
-#define REAL_TOLERANCE (FLT_MIN * 100)
-#define REAL_EPSILON 1.192092896e-07F /* FLT_EPSILON */
-
-//--------------------------------------------------------------------------
-// Forward declarations of various internal classes
-//--------------------------------------------------------------------------
-
-class Size;
-class SizeF;
-class Point;
-class PointF;
-class Rect;
-class RectF;
-class CharacterRange;
-
-//--------------------------------------------------------------------------
-// Return values from any GDI+ API
-//--------------------------------------------------------------------------
-
-enum Status
-{
- Ok = 0,
- GenericError = 1,
- InvalidParameter = 2,
- OutOfMemory = 3,
- ObjectBusy = 4,
- InsufficientBuffer = 5,
- NotImplemented = 6,
- Win32Error = 7,
- WrongState = 8,
- Aborted = 9,
-#ifdef DCR_USE_NEW_135429
- FileNotFound = 10,
- ValueOverflow = 11,
- AccessDenied = 12,
- UnknownImageFormat = 13,
- FontFamilyNotFound = 14,
- FontStyleNotFound = 15,
- NotTrueTypeFont = 16,
-#else
- NotFound = 10,
- ValueOverflow = 11,
-#endif
- UnsupportedGdiplusVersion = 17,
- GdiplusNotInitialized
-
-};
-
-//--------------------------------------------------------------------------
-// Represents a dimension in a 2D coordinate system
-// (floating-point coordinates)
-//--------------------------------------------------------------------------
-
-class SizeF
-{
-public:
-
- // Default constructor
- SizeF()
- {
- Width = Height = 0.0f;
- }
-
- SizeF(IN const SizeF& size)
- {
- Width = size.Width;
- Height = size.Height;
- }
-
- SizeF(IN REAL width,
- IN REAL height)
- {
- Width = width;
- Height = height;
- }
-
- SizeF operator+(IN const SizeF& sz) const
- {
- return SizeF(Width + sz.Width,
- Height + sz.Height);
- }
-
- SizeF operator-(IN const SizeF& sz) const
- {
- return SizeF(Width - sz.Width,
- Height - sz.Height);
- }
-
- BOOL Equals(IN const SizeF& sz) const
- {
- return (Width == sz.Width) && (Height == sz.Height);
- }
-
- BOOL Empty() const
- {
- return (Width == 0.0f && Height == 0.0f);
- }
-
-public:
-
- REAL Width;
- REAL Height;
-};
-
-//--------------------------------------------------------------------------
-// Represents a dimension in a 2D coordinate system
-// (integer coordinates)
-//--------------------------------------------------------------------------
-
-class Size
-{
-public:
-
- // Default constructor
- Size()
- {
- Width = Height = 0;
- }
-
- Size(IN const Size& size)
- {
- Width = size.Width;
- Height = size.Height;
- }
-
- Size(IN INT width,
- IN INT height)
- {
- Width = width;
- Height = height;
- }
-
- Size operator+(IN const Size& sz) const
- {
- return Size(Width + sz.Width,
- Height + sz.Height);
- }
-
- Size operator-(IN const Size& sz) const
- {
- return Size(Width - sz.Width,
- Height - sz.Height);
- }
-
- BOOL Equals(IN const Size& sz) const
- {
- return (Width == sz.Width) && (Height == sz.Height);
- }
-
- BOOL Empty() const
- {
- return (Width == 0 && Height == 0);
- }
-
-public:
-
- INT Width;
- INT Height;
-};
-
-//--------------------------------------------------------------------------
-// Represents a location in a 2D coordinate system
-// (floating-point coordinates)
-//--------------------------------------------------------------------------
-
-class PointF
-{
-public:
- PointF()
- {
- X = Y = 0.0f;
- }
-
- PointF(IN const PointF &point)
- {
- X = point.X;
- Y = point.Y;
- }
-
- PointF(IN const SizeF &size)
- {
- X = size.Width;
- Y = size.Height;
- }
-
- PointF(IN REAL x,
- IN REAL y)
- {
- X = x;
- Y = y;
- }
-
- PointF operator+(IN const PointF& point) const
- {
- return PointF(X + point.X,
- Y + point.Y);
- }
-
- PointF operator-(IN const PointF& point) const
- {
- return PointF(X - point.X,
- Y - point.Y);
- }
-
- BOOL Equals(IN const PointF& point)
- {
- return (X == point.X) && (Y == point.Y);
- }
-
-public:
-
- REAL X;
- REAL Y;
-};
-
-//--------------------------------------------------------------------------
-// Represents a location in a 2D coordinate system
-// (integer coordinates)
-//--------------------------------------------------------------------------
-
-class Point
-{
-public:
- Point()
- {
- X = Y = 0;
- }
-
- Point(IN const Point &point)
- {
- X = point.X;
- Y = point.Y;
- }
-
- Point(IN const Size &size)
- {
- X = size.Width;
- Y = size.Height;
- }
-
- Point(IN INT x,
- IN INT y)
- {
- X = x;
- Y = y;
- }
-
- Point operator+(IN const Point& point) const
- {
- return Point(X + point.X,
- Y + point.Y);
- }
-
- Point operator-(IN const Point& point) const
- {
- return Point(X - point.X,
- Y - point.Y);
- }
-
- BOOL Equals(IN const Point& point)
- {
- return (X == point.X) && (Y == point.Y);
- }
-
-public:
-
- INT X;
- INT Y;
-};
-
-//--------------------------------------------------------------------------
-// Represents a rectangle in a 2D coordinate system
-// (floating-point coordinates)
-//--------------------------------------------------------------------------
-
-class RectF
-{
-public:
-
- // Default constructor
-
- RectF()
- {
- X = Y = Width = Height = 0.0f;
- }
-
- RectF(IN REAL x,
- IN REAL y,
- IN REAL width,
- IN REAL height)
- {
- X = x;
- Y = y;
- Width = width;
- Height = height;
- }
-
- RectF(IN const PointF& location,
- IN const SizeF& size)
- {
- X = location.X;
- Y = location.Y;
- Width = size.Width;
- Height = size.Height;
- }
-
- RectF* Clone() const
- {
- return new RectF(X, Y, Width, Height);
- }
-
- VOID GetLocation(OUT PointF* point) const
- {
- point->X = X;
- point->Y = Y;
- }
-
- VOID GetSize(OUT SizeF* size) const
- {
- size->Width = Width;
- size->Height = Height;
- }
-
- VOID GetBounds(OUT RectF* rect) const
- {
- rect->X = X;
- rect->Y = Y;
- rect->Width = Width;
- rect->Height = Height;
- }
-
- // Return the left, top, right, and bottom
- // coordinates of the rectangle
-
- REAL GetLeft() const
- {
- return X;
- }
-
- REAL GetTop() const
- {
- return Y;
- }
-
- REAL GetRight() const
- {
- return X+Width;
- }
-
- REAL GetBottom() const
- {
- return Y+Height;
- }
-
- // Determine if the rectangle is empty
- BOOL IsEmptyArea() const
- {
- return (Width <= REAL_EPSILON) || (Height <= REAL_EPSILON);
- }
-
- BOOL Equals(IN const RectF & rect) const
- {
- return X == rect.X &&
- Y == rect.Y &&
- Width == rect.Width &&
- Height == rect.Height;
- }
-
- BOOL Contains(IN REAL x,
- IN REAL y) const
- {
- return x >= X && x < X+Width &&
- y >= Y && y < Y+Height;
- }
-
- BOOL Contains(IN const PointF& pt) const
- {
- return Contains(pt.X, pt.Y);
- }
-
- BOOL Contains(IN const RectF& rect) const
- {
- return (X <= rect.X) && (rect.GetRight() <= GetRight()) &&
- (Y <= rect.Y) && (rect.GetBottom() <= GetBottom());
- }
-
- VOID Inflate(IN REAL dx,
- IN REAL dy)
- {
- X -= dx;
- Y -= dy;
- Width += 2*dx;
- Height += 2*dy;
- }
-
- VOID Inflate(IN const PointF& point)
- {
- Inflate(point.X, point.Y);
- }
-
- // Intersect the current rect with the specified object
-
- BOOL Intersect(IN const RectF& rect)
- {
- return Intersect(*this, *this, rect);
- }
-
- // Intersect rect a and b and save the result into c
- // Notice that c may be the same object as a or b.
-
- static BOOL Intersect(OUT RectF& c,
- IN const RectF& a,
- IN const RectF& b)
- {
- REAL right = min(a.GetRight(), b.GetRight());
- REAL bottom = min(a.GetBottom(), b.GetBottom());
- REAL left = max(a.GetLeft(), b.GetLeft());
- REAL top = max(a.GetTop(), b.GetTop());
-
- c.X = left;
- c.Y = top;
- c.Width = right - left;
- c.Height = bottom - top;
- return !c.IsEmptyArea();
- }
-
- // Determine if the specified rect intersects with the
- // current rect object.
-
- BOOL IntersectsWith(IN const RectF& rect) const
- {
- return (GetLeft() < rect.GetRight() &&
- GetTop() < rect.GetTop() &&
- GetRight() > rect.GetLeft() &&
- GetBottom() > rect.GetTop());
- }
-
- static BOOL Union(OUT RectF& c,
- IN const RectF& a,
- IN const RectF& b)
- {
- REAL right = max(a.GetRight(), b.GetRight());
- REAL bottom = max(a.GetBottom(), b.GetBottom());
- REAL left = min(a.GetLeft(), b.GetLeft());
- REAL top = min(a.GetTop(), b.GetTop());
-
- c.X = left;
- c.Y = top;
- c.Width = right - left;
- c.Height = bottom - top;
- return !c.IsEmptyArea();
- }
-
- VOID Offset(IN const PointF& point)
- {
- Offset(point.X, point.Y);
- }
-
- VOID Offset(IN REAL dx,
- IN REAL dy)
- {
- X += dx;
- Y += dy;
- }
-
-public:
-
- REAL X;
- REAL Y;
- REAL Width;
- REAL Height;
-};
-
-//--------------------------------------------------------------------------
-// Represents a rectangle in a 2D coordinate system
-// (integer coordinates)
-//--------------------------------------------------------------------------
-
-class Rect
-{
-public:
-
- // Default constructor
-
- Rect()
- {
- X = Y = Width = Height = 0;
- }
-
- Rect(IN INT x,
- IN INT y,
- IN INT width,
- IN INT height)
- {
- X = x;
- Y = y;
- Width = width;
- Height = height;
- }
-
- Rect(IN const Point& location,
- IN const Size& size)
- {
- X = location.X;
- Y = location.Y;
- Width = size.Width;
- Height = size.Height;
- }
-
- Rect* Clone() const
- {
- return new Rect(X, Y, Width, Height);
- }
-
- VOID GetLocation(OUT Point* point) const
- {
- point->X = X;
- point->Y = Y;
- }
-
- VOID GetSize(OUT Size* size) const
- {
- size->Width = Width;
- size->Height = Height;
- }
-
- VOID GetBounds(OUT Rect* rect) const
- {
- rect->X = X;
- rect->Y = Y;
- rect->Width = Width;
- rect->Height = Height;
- }
-
- // Return the left, top, right, and bottom
- // coordinates of the rectangle
-
- INT GetLeft() const
- {
- return X;
- }
-
- INT GetTop() const
- {
- return Y;
- }
-
- INT GetRight() const
- {
- return X+Width;
- }
-
- INT GetBottom() const
- {
- return Y+Height;
- }
-
- // Determine if the rectangle is empty
- BOOL IsEmptyArea() const
- {
- return (Width <= 0) || (Height <= 0);
- }
-
- BOOL Equals(IN const Rect & rect) const
- {
- return X == rect.X &&
- Y == rect.Y &&
- Width == rect.Width &&
- Height == rect.Height;
- }
-
- BOOL Contains(IN INT x,
- IN INT y) const
- {
- return x >= X && x < X+Width &&
- y >= Y && y < Y+Height;
- }
-
- BOOL Contains(IN const Point& pt) const
- {
- return Contains(pt.X, pt.Y);
- }
-
- BOOL Contains(IN Rect& rect) const
- {
- return (X <= rect.X) && (rect.GetRight() <= GetRight()) &&
- (Y <= rect.Y) && (rect.GetBottom() <= GetBottom());
- }
-
- VOID Inflate(IN INT dx,
- IN INT dy)
- {
- X -= dx;
- Y -= dy;
- Width += 2*dx;
- Height += 2*dy;
- }
-
- VOID Inflate(IN const Point& point)
- {
- Inflate(point.X, point.Y);
- }
-
- // Intersect the current rect with the specified object
-
- BOOL Intersect(IN const Rect& rect)
- {
- return Intersect(*this, *this, rect);
- }
-
- // Intersect rect a and b and save the result into c
- // Notice that c may be the same object as a or b.
-
- static BOOL Intersect(OUT Rect& c,
- IN const Rect& a,
- IN const Rect& b)
- {
- INT right = min(a.GetRight(), b.GetRight());
- INT bottom = min(a.GetBottom(), b.GetBottom());
- INT left = max(a.GetLeft(), b.GetLeft());
- INT top = max(a.GetTop(), b.GetTop());
-
- c.X = left;
- c.Y = top;
- c.Width = right - left;
- c.Height = bottom - top;
- return !c.IsEmptyArea();
- }
-
- // Determine if the specified rect intersects with the
- // current rect object.
-
- BOOL IntersectsWith(IN const Rect& rect) const
- {
- return (GetLeft() < rect.GetRight() &&
- GetTop() < rect.GetTop() &&
- GetRight() > rect.GetLeft() &&
- GetBottom() > rect.GetTop());
- }
-
- static BOOL Union(OUT Rect& c,
- IN const Rect& a,
- IN const Rect& b)
- {
- INT right = max(a.GetRight(), b.GetRight());
- INT bottom = max(a.GetBottom(), b.GetBottom());
- INT left = min(a.GetLeft(), b.GetLeft());
- INT top = min(a.GetTop(), b.GetTop());
-
- c.X = left;
- c.Y = top;
- c.Width = right - left;
- c.Height = bottom - top;
- return !c.IsEmptyArea();
- }
-
- VOID Offset(IN const Point& point)
- {
- Offset(point.X, point.Y);
- }
-
- VOID Offset(IN INT dx,
- IN INT dy)
- {
- X += dx;
- Y += dy;
- }
-
-public:
-
- INT X;
- INT Y;
- INT Width;
- INT Height;
-};
-
-// A user must mange memory for PathData.
-
-class PathData
-{
-public:
- PathData()
- {
- Count = 0;
- Points = NULL;
- Types = NULL;
- }
-
- ~PathData()
- {
- if (Points != NULL)
- {
- delete Points;
- }
-
- if (Types != NULL)
- {
- delete Types;
- }
- }
-
-#ifdef DCR_USE_NEW_250932
-
-private:
- PathData(const PathData &);
- PathData& operator=(const PathData &);
-
-#endif
-
-public:
- INT Count;
- PointF* Points;
- BYTE* Types;
-};
-
-
-//-----------------------------
-// text character range
-//-----------------------------
-
-class CharacterRange
-{
-public:
- CharacterRange(
- INT first,
- INT length
- ) :
- First (first),
- Length (length)
- {}
-
- CharacterRange() : First(0), Length(0)
- {}
-
- CharacterRange & operator = (const CharacterRange &rhs)
- {
- First = rhs.First;
- Length = rhs.Length;
- return *this;
- }
-
- INT First;
- INT Length;
-};
-
-#endif // !_GDIPLUSTYPES_HPP
+/**************************************************************************\
+*
+* Copyright (c) 1998-2000, Microsoft Corp. All Rights Reserved.
+*
+* Module Name:
+*
+* GdiplusTypes.h
+*
+* Abstract:
+*
+* Basic types used by GDI+
+*
+\**************************************************************************/
+
+#ifndef _GDIPLUSTYPES_H
+#define _GDIPLUSTYPES_H
+
+#ifndef DCR_USE_NEW_175866
+
+//--------------------------------------------------------------------------
+// LIB version initialization functions
+//--------------------------------------------------------------------------
+
+typedef VOID (__cdecl *DEBUGEVENTFUNCTION)(INT level, CHAR *message);
+
+extern "C" BOOL __stdcall InitializeGdiplus(DEBUGEVENTFUNCTION);
+extern "C" VOID __stdcall UninitializeGdiplus();
+
+#endif
+
+//--------------------------------------------------------------------------
+// Callback functions
+//--------------------------------------------------------------------------
+
+extern "C" {
+typedef BOOL (CALLBACK * ImageAbort)(VOID *);
+typedef ImageAbort DrawImageAbort;
+typedef ImageAbort GetThumbnailImageAbort;
+}
+
+// Callback for EnumerateMetafile methods. The parameters are:
+
+// recordType WMF, EMF, or EMF+ record type
+// flags (always 0 for WMF/EMF records)
+// dataSize size of the record data (in bytes), or 0 if no data
+// data pointer to the record data, or NULL if no data
+// callbackData pointer to callbackData, if any
+
+// This method can then call Metafile::PlayRecord to play the
+// record that was just enumerated. If this method returns
+// FALSE, the enumeration process is aborted. Otherwise, it continues.
+
+extern "C" {
+typedef BOOL (CALLBACK * EnumerateMetafileProc)(EmfPlusRecordType,UINT,UINT,const BYTE*,VOID*);
+}
+
+//--------------------------------------------------------------------------
+// Primitive data types
+//
+// NOTE:
+// Types already defined in standard header files:
+// INT8
+// UINT8
+// INT16
+// UINT16
+// INT32
+// UINT32
+// INT64
+// UINT64
+//
+// Avoid using the following types:
+// LONG - use INT
+// ULONG - use UINT
+// DWORD - use UINT32
+//--------------------------------------------------------------------------
+
+typedef float REAL;
+
+#define REAL_MAX FLT_MAX
+#define REAL_MIN FLT_MIN
+#define REAL_TOLERANCE (FLT_MIN * 100)
+#define REAL_EPSILON 1.192092896e-07F /* FLT_EPSILON */
+
+//--------------------------------------------------------------------------
+// Forward declarations of various internal classes
+//--------------------------------------------------------------------------
+
+class Size;
+class SizeF;
+class Point;
+class PointF;
+class Rect;
+class RectF;
+class CharacterRange;
+
+//--------------------------------------------------------------------------
+// Return values from any GDI+ API
+//--------------------------------------------------------------------------
+
+enum Status
+{
+ Ok = 0,
+ GenericError = 1,
+ InvalidParameter = 2,
+ OutOfMemory = 3,
+ ObjectBusy = 4,
+ InsufficientBuffer = 5,
+ NotImplemented = 6,
+ Win32Error = 7,
+ WrongState = 8,
+ Aborted = 9,
+#ifdef DCR_USE_NEW_135429
+ FileNotFound = 10,
+ ValueOverflow = 11,
+ AccessDenied = 12,
+ UnknownImageFormat = 13,
+ FontFamilyNotFound = 14,
+ FontStyleNotFound = 15,
+ NotTrueTypeFont = 16,
+#else
+ NotFound = 10,
+ ValueOverflow = 11,
+#endif
+ UnsupportedGdiplusVersion = 17,
+ GdiplusNotInitialized
+
+};
+
+//--------------------------------------------------------------------------
+// Represents a dimension in a 2D coordinate system
+// (floating-point coordinates)
+//--------------------------------------------------------------------------
+
+class SizeF
+{
+public:
+
+ // Default constructor
+ SizeF()
+ {
+ Width = Height = 0.0f;
+ }
+
+ SizeF(IN const SizeF& size)
+ {
+ Width = size.Width;
+ Height = size.Height;
+ }
+
+ SizeF(IN REAL width,
+ IN REAL height)
+ {
+ Width = width;
+ Height = height;
+ }
+
+ SizeF operator+(IN const SizeF& sz) const
+ {
+ return SizeF(Width + sz.Width,
+ Height + sz.Height);
+ }
+
+ SizeF operator-(IN const SizeF& sz) const
+ {
+ return SizeF(Width - sz.Width,
+ Height - sz.Height);
+ }
+
+ BOOL Equals(IN const SizeF& sz) const
+ {
+ return (Width == sz.Width) && (Height == sz.Height);
+ }
+
+ BOOL Empty() const
+ {
+ return (Width == 0.0f && Height == 0.0f);
+ }
+
+public:
+
+ REAL Width;
+ REAL Height;
+};
+
+//--------------------------------------------------------------------------
+// Represents a dimension in a 2D coordinate system
+// (integer coordinates)
+//--------------------------------------------------------------------------
+
+class Size
+{
+public:
+
+ // Default constructor
+ Size()
+ {
+ Width = Height = 0;
+ }
+
+ Size(IN const Size& size)
+ {
+ Width = size.Width;
+ Height = size.Height;
+ }
+
+ Size(IN INT width,
+ IN INT height)
+ {
+ Width = width;
+ Height = height;
+ }
+
+ Size operator+(IN const Size& sz) const
+ {
+ return Size(Width + sz.Width,
+ Height + sz.Height);
+ }
+
+ Size operator-(IN const Size& sz) const
+ {
+ return Size(Width - sz.Width,
+ Height - sz.Height);
+ }
+
+ BOOL Equals(IN const Size& sz) const
+ {
+ return (Width == sz.Width) && (Height == sz.Height);
+ }
+
+ BOOL Empty() const
+ {
+ return (Width == 0 && Height == 0);
+ }
+
+public:
+
+ INT Width;
+ INT Height;
+};
+
+//--------------------------------------------------------------------------
+// Represents a location in a 2D coordinate system
+// (floating-point coordinates)
+//--------------------------------------------------------------------------
+
+class PointF
+{
+public:
+ PointF()
+ {
+ X = Y = 0.0f;
+ }
+
+ PointF(IN const PointF &point)
+ {
+ X = point.X;
+ Y = point.Y;
+ }
+
+ PointF(IN const SizeF &size)
+ {
+ X = size.Width;
+ Y = size.Height;
+ }
+
+ PointF(IN REAL x,
+ IN REAL y)
+ {
+ X = x;
+ Y = y;
+ }
+
+ PointF operator+(IN const PointF& point) const
+ {
+ return PointF(X + point.X,
+ Y + point.Y);
+ }
+
+ PointF operator-(IN const PointF& point) const
+ {
+ return PointF(X - point.X,
+ Y - point.Y);
+ }
+
+ BOOL Equals(IN const PointF& point)
+ {
+ return (X == point.X) && (Y == point.Y);
+ }
+
+public:
+
+ REAL X;
+ REAL Y;
+};
+
+//--------------------------------------------------------------------------
+// Represents a location in a 2D coordinate system
+// (integer coordinates)
+//--------------------------------------------------------------------------
+
+class Point
+{
+public:
+ Point()
+ {
+ X = Y = 0;
+ }
+
+ Point(IN const Point &point)
+ {
+ X = point.X;
+ Y = point.Y;
+ }
+
+ Point(IN const Size &size)
+ {
+ X = size.Width;
+ Y = size.Height;
+ }
+
+ Point(IN INT x,
+ IN INT y)
+ {
+ X = x;
+ Y = y;
+ }
+
+ Point operator+(IN const Point& point) const
+ {
+ return Point(X + point.X,
+ Y + point.Y);
+ }
+
+ Point operator-(IN const Point& point) const
+ {
+ return Point(X - point.X,
+ Y - point.Y);
+ }
+
+ BOOL Equals(IN const Point& point)
+ {
+ return (X == point.X) && (Y == point.Y);
+ }
+
+public:
+
+ INT X;
+ INT Y;
+};
+
+//--------------------------------------------------------------------------
+// Represents a rectangle in a 2D coordinate system
+// (floating-point coordinates)
+//--------------------------------------------------------------------------
+
+class RectF
+{
+public:
+
+ // Default constructor
+
+ RectF()
+ {
+ X = Y = Width = Height = 0.0f;
+ }
+
+ RectF(IN REAL x,
+ IN REAL y,
+ IN REAL width,
+ IN REAL height)
+ {
+ X = x;
+ Y = y;
+ Width = width;
+ Height = height;
+ }
+
+ RectF(IN const PointF& location,
+ IN const SizeF& size)
+ {
+ X = location.X;
+ Y = location.Y;
+ Width = size.Width;
+ Height = size.Height;
+ }
+
+ RectF* Clone() const
+ {
+ return new RectF(X, Y, Width, Height);
+ }
+
+ VOID GetLocation(OUT PointF* point) const
+ {
+ point->X = X;
+ point->Y = Y;
+ }
+
+ VOID GetSize(OUT SizeF* size) const
+ {
+ size->Width = Width;
+ size->Height = Height;
+ }
+
+ VOID GetBounds(OUT RectF* rect) const
+ {
+ rect->X = X;
+ rect->Y = Y;
+ rect->Width = Width;
+ rect->Height = Height;
+ }
+
+ // Return the left, top, right, and bottom
+ // coordinates of the rectangle
+
+ REAL GetLeft() const
+ {
+ return X;
+ }
+
+ REAL GetTop() const
+ {
+ return Y;
+ }
+
+ REAL GetRight() const
+ {
+ return X+Width;
+ }
+
+ REAL GetBottom() const
+ {
+ return Y+Height;
+ }
+
+ // Determine if the rectangle is empty
+ BOOL IsEmptyArea() const
+ {
+ return (Width <= REAL_EPSILON) || (Height <= REAL_EPSILON);
+ }
+
+ BOOL Equals(IN const RectF & rect) const
+ {
+ return X == rect.X &&
+ Y == rect.Y &&
+ Width == rect.Width &&
+ Height == rect.Height;
+ }
+
+ BOOL Contains(IN REAL x,
+ IN REAL y) const
+ {
+ return x >= X && x < X+Width &&
+ y >= Y && y < Y+Height;
+ }
+
+ BOOL Contains(IN const PointF& pt) const
+ {
+ return Contains(pt.X, pt.Y);
+ }
+
+ BOOL Contains(IN const RectF& rect) const
+ {
+ return (X <= rect.X) && (rect.GetRight() <= GetRight()) &&
+ (Y <= rect.Y) && (rect.GetBottom() <= GetBottom());
+ }
+
+ VOID Inflate(IN REAL dx,
+ IN REAL dy)
+ {
+ X -= dx;
+ Y -= dy;
+ Width += 2*dx;
+ Height += 2*dy;
+ }
+
+ VOID Inflate(IN const PointF& point)
+ {
+ Inflate(point.X, point.Y);
+ }
+
+ // Intersect the current rect with the specified object
+
+ BOOL Intersect(IN const RectF& rect)
+ {
+ return Intersect(*this, *this, rect);
+ }
+
+ // Intersect rect a and b and save the result into c
+ // Notice that c may be the same object as a or b.
+
+ static BOOL Intersect(OUT RectF& c,
+ IN const RectF& a,
+ IN const RectF& b)
+ {
+ REAL right = min(a.GetRight(), b.GetRight());
+ REAL bottom = min(a.GetBottom(), b.GetBottom());
+ REAL left = max(a.GetLeft(), b.GetLeft());
+ REAL top = max(a.GetTop(), b.GetTop());
+
+ c.X = left;
+ c.Y = top;
+ c.Width = right - left;
+ c.Height = bottom - top;
+ return !c.IsEmptyArea();
+ }
+
+ // Determine if the specified rect intersects with the
+ // current rect object.
+
+ BOOL IntersectsWith(IN const RectF& rect) const
+ {
+ return (GetLeft() < rect.GetRight() &&
+ GetTop() < rect.GetTop() &&
+ GetRight() > rect.GetLeft() &&
+ GetBottom() > rect.GetTop());
+ }
+
+ static BOOL Union(OUT RectF& c,
+ IN const RectF& a,
+ IN const RectF& b)
+ {
+ REAL right = max(a.GetRight(), b.GetRight());
+ REAL bottom = max(a.GetBottom(), b.GetBottom());
+ REAL left = min(a.GetLeft(), b.GetLeft());
+ REAL top = min(a.GetTop(), b.GetTop());
+
+ c.X = left;
+ c.Y = top;
+ c.Width = right - left;
+ c.Height = bottom - top;
+ return !c.IsEmptyArea();
+ }
+
+ VOID Offset(IN const PointF& point)
+ {
+ Offset(point.X, point.Y);
+ }
+
+ VOID Offset(IN REAL dx,
+ IN REAL dy)
+ {
+ X += dx;
+ Y += dy;
+ }
+
+public:
+
+ REAL X;
+ REAL Y;
+ REAL Width;
+ REAL Height;
+};
+
+//--------------------------------------------------------------------------
+// Represents a rectangle in a 2D coordinate system
+// (integer coordinates)
+//--------------------------------------------------------------------------
+
+class Rect
+{
+public:
+
+ // Default constructor
+
+ Rect()
+ {
+ X = Y = Width = Height = 0;
+ }
+
+ Rect(IN INT x,
+ IN INT y,
+ IN INT width,
+ IN INT height)
+ {
+ X = x;
+ Y = y;
+ Width = width;
+ Height = height;
+ }
+
+ Rect(IN const Point& location,
+ IN const Size& size)
+ {
+ X = location.X;
+ Y = location.Y;
+ Width = size.Width;
+ Height = size.Height;
+ }
+
+ Rect* Clone() const
+ {
+ return new Rect(X, Y, Width, Height);
+ }
+
+ VOID GetLocation(OUT Point* point) const
+ {
+ point->X = X;
+ point->Y = Y;
+ }
+
+ VOID GetSize(OUT Size* size) const
+ {
+ size->Width = Width;
+ size->Height = Height;
+ }
+
+ VOID GetBounds(OUT Rect* rect) const
+ {
+ rect->X = X;
+ rect->Y = Y;
+ rect->Width = Width;
+ rect->Height = Height;
+ }
+
+ // Return the left, top, right, and bottom
+ // coordinates of the rectangle
+
+ INT GetLeft() const
+ {
+ return X;
+ }
+
+ INT GetTop() const
+ {
+ return Y;
+ }
+
+ INT GetRight() const
+ {
+ return X+Width;
+ }
+
+ INT GetBottom() const
+ {
+ return Y+Height;
+ }
+
+ // Determine if the rectangle is empty
+ BOOL IsEmptyArea() const
+ {
+ return (Width <= 0) || (Height <= 0);
+ }
+
+ BOOL Equals(IN const Rect & rect) const
+ {
+ return X == rect.X &&
+ Y == rect.Y &&
+ Width == rect.Width &&
+ Height == rect.Height;
+ }
+
+ BOOL Contains(IN INT x,
+ IN INT y) const
+ {
+ return x >= X && x < X+Width &&
+ y >= Y && y < Y+Height;
+ }
+
+ BOOL Contains(IN const Point& pt) const
+ {
+ return Contains(pt.X, pt.Y);
+ }
+
+ BOOL Contains(IN Rect& rect) const
+ {
+ return (X <= rect.X) && (rect.GetRight() <= GetRight()) &&
+ (Y <= rect.Y) && (rect.GetBottom() <= GetBottom());
+ }
+
+ VOID Inflate(IN INT dx,
+ IN INT dy)
+ {
+ X -= dx;
+ Y -= dy;
+ Width += 2*dx;
+ Height += 2*dy;
+ }
+
+ VOID Inflate(IN const Point& point)
+ {
+ Inflate(point.X, point.Y);
+ }
+
+ // Intersect the current rect with the specified object
+
+ BOOL Intersect(IN const Rect& rect)
+ {
+ return Intersect(*this, *this, rect);
+ }
+
+ // Intersect rect a and b and save the result into c
+ // Notice that c may be the same object as a or b.
+
+ static BOOL Intersect(OUT Rect& c,
+ IN const Rect& a,
+ IN const Rect& b)
+ {
+ INT right = min(a.GetRight(), b.GetRight());
+ INT bottom = min(a.GetBottom(), b.GetBottom());
+ INT left = max(a.GetLeft(), b.GetLeft());
+ INT top = max(a.GetTop(), b.GetTop());
+
+ c.X = left;
+ c.Y = top;
+ c.Width = right - left;
+ c.Height = bottom - top;
+ return !c.IsEmptyArea();
+ }
+
+ // Determine if the specified rect intersects with the
+ // current rect object.
+
+ BOOL IntersectsWith(IN const Rect& rect) const
+ {
+ return (GetLeft() < rect.GetRight() &&
+ GetTop() < rect.GetTop() &&
+ GetRight() > rect.GetLeft() &&
+ GetBottom() > rect.GetTop());
+ }
+
+ static BOOL Union(OUT Rect& c,
+ IN const Rect& a,
+ IN const Rect& b)
+ {
+ INT right = max(a.GetRight(), b.GetRight());
+ INT bottom = max(a.GetBottom(), b.GetBottom());
+ INT left = min(a.GetLeft(), b.GetLeft());
+ INT top = min(a.GetTop(), b.GetTop());
+
+ c.X = left;
+ c.Y = top;
+ c.Width = right - left;
+ c.Height = bottom - top;
+ return !c.IsEmptyArea();
+ }
+
+ VOID Offset(IN const Point& point)
+ {
+ Offset(point.X, point.Y);
+ }
+
+ VOID Offset(IN INT dx,
+ IN INT dy)
+ {
+ X += dx;
+ Y += dy;
+ }
+
+public:
+
+ INT X;
+ INT Y;
+ INT Width;
+ INT Height;
+};
+
+// A user must mange memory for PathData.
+
+class PathData
+{
+public:
+ PathData()
+ {
+ Count = 0;
+ Points = NULL;
+ Types = NULL;
+ }
+
+ ~PathData()
+ {
+ if (Points != NULL)
+ {
+ delete Points;
+ }
+
+ if (Types != NULL)
+ {
+ delete Types;
+ }
+ }
+
+#ifdef DCR_USE_NEW_250932
+
+private:
+ PathData(const PathData &);
+ PathData& operator=(const PathData &);
+
+#endif
+
+public:
+ INT Count;
+ PointF* Points;
+ BYTE* Types;
+};
+
+
+//-----------------------------
+// text character range
+//-----------------------------
+
+class CharacterRange
+{
+public:
+ CharacterRange(
+ INT first,
+ INT length
+ ) :
+ First (first),
+ Length (length)
+ {}
+
+ CharacterRange() : First(0), Length(0)
+ {}
+
+ CharacterRange & operator = (const CharacterRange &rhs)
+ {
+ First = rhs.First;
+ Length = rhs.Length;
+ return *this;
+ }
+
+ INT First;
+ INT Length;
+};
+
+#endif // !_GDIPLUSTYPES_HPP
diff --git a/core/src/fxge/Microsoft SDK/include/GdiPlusimageAttributes.h b/core/src/fxge/Microsoft SDK/include/GdiPlusimageAttributes.h
index 0a514772bc..26da28c756 100644
--- a/core/src/fxge/Microsoft SDK/include/GdiPlusimageAttributes.h
+++ b/core/src/fxge/Microsoft SDK/include/GdiPlusimageAttributes.h
@@ -1,397 +1,397 @@
-/**************************************************************************\
-*
-* Copyright (c) 1998-2000, Microsoft Corp. All Rights Reserved.
-*
-* Module Name:
-*
-* Image Attributes
-*
-* Abstract:
-*
-* Class for color adjustment object passed to Graphics.DrawImage
-*
-\**************************************************************************/
-
-#ifndef _GDIPLUSIMAGEATTRIBUTES_H
-#define _GDIPLUSIMAGEATTRIBUTES_H
-
-class GpImageAttributes;
-
-// There are 5 possible sets of color adjustments:
-// ColorAdjustDefault,
-// ColorAdjustBitmap,
-// ColorAdjustBrush,
-// ColorAdjustPen,
-// ColorAdjustText,
-
-// Bitmaps, Brushes, Pens, and Text will all use any color adjustments
-// that have been set into the default ImageAttributes until their own
-// color adjustments have been set. So as soon as any "Set" method is
-// called for Bitmaps, Brushes, Pens, or Text, then they start from
-// scratch with only the color adjustments that have been set for them.
-// Calling Reset removes any individual color adjustments for a type
-// and makes it revert back to using all the default color adjustments
-// (if any). The SetToIdentity method is a way to force a type to
-// have no color adjustments at all, regardless of what previous adjustments
-// have been set for the defaults or for that type.
-
-class ImageAttributes : public GdiplusBase
-{
- friend class Graphics;
- friend class TextureBrush;
-
-public:
-
- ImageAttributes()
- {
- nativeImageAttr = NULL;
- lastResult = DllExports::GdipCreateImageAttributes(&nativeImageAttr);
- }
-
- ~ImageAttributes()
- {
- DllExports::GdipDisposeImageAttributes(nativeImageAttr);
- }
-
- ImageAttributes* Clone() const
- {
- GpImageAttributes* clone;
-
- SetStatus(DllExports::GdipCloneImageAttributes(
- nativeImageAttr,
- &clone));
-
- return new ImageAttributes(clone, lastResult);
- }
-
- // Set to identity, regardless of what the default color adjustment is.
- Status
- SetToIdentity(
- IN ColorAdjustType type = ColorAdjustTypeDefault
- )
- {
- return SetStatus(DllExports::GdipSetImageAttributesToIdentity(
- nativeImageAttr,
- type));
- }
-
- // Remove any individual color adjustments, and go back to using the default
- Status
- Reset(
- IN ColorAdjustType type = ColorAdjustTypeDefault
- )
- {
- return SetStatus(DllExports::GdipResetImageAttributes(
- nativeImageAttr,
- type));
- }
-
- Status
- SetColorMatrix(
- IN const ColorMatrix *colorMatrix,
- IN ColorMatrixFlags mode = ColorMatrixFlagsDefault,
- IN ColorAdjustType type = ColorAdjustTypeDefault
- )
- {
- return SetStatus(DllExports::GdipSetImageAttributesColorMatrix(
- nativeImageAttr,
- type,
- TRUE,
- colorMatrix,
- NULL,
- mode));
- }
-
- Status ClearColorMatrix(
- IN ColorAdjustType type = ColorAdjustTypeDefault
- )
- {
- return SetStatus(DllExports::GdipSetImageAttributesColorMatrix(
- nativeImageAttr,
- type,
- FALSE,
- NULL,
- NULL,
- ColorMatrixFlagsDefault));
- }
-
- Status
- SetColorMatrices(
- IN const ColorMatrix *colorMatrix,
- IN const ColorMatrix *grayMatrix,
- IN ColorMatrixFlags mode = ColorMatrixFlagsDefault,
- IN ColorAdjustType type = ColorAdjustTypeDefault
- )
- {
- return SetStatus(DllExports::GdipSetImageAttributesColorMatrix(
- nativeImageAttr,
- type,
- TRUE,
- colorMatrix,
- grayMatrix,
- mode));
- }
-
- Status ClearColorMatrices(
- IN ColorAdjustType type = ColorAdjustTypeDefault
- )
- {
- return SetStatus(DllExports::GdipSetImageAttributesColorMatrix(
- nativeImageAttr,
- type,
- FALSE,
- NULL,
- NULL,
- ColorMatrixFlagsDefault));
- }
-
- Status SetThreshold(
- IN REAL threshold,
- IN ColorAdjustType type = ColorAdjustTypeDefault
- )
- {
- return SetStatus(DllExports::GdipSetImageAttributesThreshold(
- nativeImageAttr,
- type,
- TRUE,
- threshold));
- }
-
- Status ClearThreshold(
- IN ColorAdjustType type = ColorAdjustTypeDefault
- )
- {
- return SetStatus(DllExports::GdipSetImageAttributesThreshold(
- nativeImageAttr,
- type,
- FALSE,
- 0.0));
- }
-
- Status SetGamma(
- IN REAL gamma,
- IN ColorAdjustType type = ColorAdjustTypeDefault
- )
- {
- return SetStatus(DllExports::GdipSetImageAttributesGamma(
- nativeImageAttr,
- type,
- TRUE,
- gamma));
- }
-
- Status ClearGamma(
- IN ColorAdjustType type = ColorAdjustTypeDefault
- )
- {
- return SetStatus(DllExports::GdipSetImageAttributesGamma(
- nativeImageAttr,
- type,
- FALSE,
- 0.0));
- }
-
- Status SetNoOp(
- IN ColorAdjustType type = ColorAdjustTypeDefault
- )
- {
- return SetStatus(DllExports::GdipSetImageAttributesNoOp(
- nativeImageAttr,
- type,
- TRUE));
- }
-
- Status ClearNoOp(
- IN ColorAdjustType type = ColorAdjustTypeDefault
- )
- {
- return SetStatus(DllExports::GdipSetImageAttributesNoOp(
- nativeImageAttr,
- type,
- FALSE));
- }
-
- Status SetColorKey(
- IN const Color& colorLow,
- IN const Color& colorHigh,
- IN ColorAdjustType type = ColorAdjustTypeDefault
- )
- {
- return SetStatus(DllExports::GdipSetImageAttributesColorKeys(
- nativeImageAttr,
- type,
- TRUE,
- colorLow.GetValue(),
- colorHigh.GetValue()));
- }
-
- Status ClearColorKey(
- IN ColorAdjustType type = ColorAdjustTypeDefault
- )
- {
- return SetStatus(DllExports::GdipSetImageAttributesColorKeys(
- nativeImageAttr,
- type,
- FALSE,
- NULL,
- NULL));
- }
-
- Status SetOutputChannel(
- IN ColorChannelFlags channelFlags,
- IN ColorAdjustType type = ColorAdjustTypeDefault
- )
- {
- return SetStatus(DllExports::GdipSetImageAttributesOutputChannel(
- nativeImageAttr,
- type,
- TRUE,
- channelFlags));
- }
-
- Status ClearOutputChannel(
- IN ColorAdjustType type = ColorAdjustTypeDefault
- )
- {
- return SetStatus(DllExports::GdipSetImageAttributesOutputChannel(
- nativeImageAttr,
- type,
- FALSE,
- ColorChannelFlagsLast));
- }
-
- Status SetOutputChannelColorProfile(
- IN const WCHAR *colorProfileFilename,
- IN ColorAdjustType type = ColorAdjustTypeDefault
- )
- {
- return SetStatus(DllExports::GdipSetImageAttributesOutputChannelColorProfile(
- nativeImageAttr,
- type,
- TRUE,
- colorProfileFilename));
- }
-
- Status ClearOutputChannelColorProfile(
- IN ColorAdjustType type = ColorAdjustTypeDefault
- )
- {
- return SetStatus(DllExports::GdipSetImageAttributesOutputChannelColorProfile(
- nativeImageAttr,
- type,
- FALSE,
- NULL));
- }
-
- Status SetRemapTable(
- IN UINT mapSize,
- IN const ColorMap *map,
- IN ColorAdjustType type = ColorAdjustTypeDefault
- )
- {
- return SetStatus(DllExports::GdipSetImageAttributesRemapTable(
- nativeImageAttr,
- type,
- TRUE,
- mapSize,
- map));
- }
-
- Status ClearRemapTable(
- IN ColorAdjustType type = ColorAdjustTypeDefault
- )
- {
- return SetStatus(DllExports::GdipSetImageAttributesRemapTable(
- nativeImageAttr,
- type,
- FALSE,
- 0,
- NULL));
- }
-
- Status SetBrushRemapTable(IN UINT mapSize,
- IN const ColorMap *map)
- {
- return this->SetRemapTable(mapSize, map, ColorAdjustTypeBrush);
- }
-
- Status ClearBrushRemapTable()
- {
- return this->ClearRemapTable(ColorAdjustTypeBrush);
- }
-
- Status SetWrapMode(IN WrapMode wrap,
- IN const Color& color = Color(),
- IN BOOL clamp = FALSE)
- {
- ARGB argb = color.GetValue();
-
- return SetStatus(DllExports::GdipSetImageAttributesWrapMode(
- nativeImageAttr, wrap, argb, clamp));
- }
-
- #ifndef DCR_USE_NEW_145139
- Status SetICMMode(IN BOOL on)
- {
- on;
- // This is not implemented.
- // The supported method for doing ICM conversion from the embedded
- // ICC profile is to use the Bitmap constructor from a file or stream
- // and specify TRUE for the useIcm parameter. This will cause the
- // image to be ICM converted when it's loaded from the file/stream
- // if the profile exists.
- return SetStatus(NotImplemented);
-// DllExports::GdipSetImageAttributesICMMode(nativeImageAttr, on)
- }
- #endif
-
- // The flags of the palette are ignored.
- Status GetAdjustedPalette(IN OUT ColorPalette* colorPalette,
- IN ColorAdjustType colorAdjustType) const
- {
- return SetStatus(DllExports::GdipGetImageAttributesAdjustedPalette(
- nativeImageAttr, colorPalette, colorAdjustType));
- }
-
- Status GetLastStatus() const
- {
- Status lastStatus = lastResult;
- lastResult = Ok;
-
- return lastStatus;
- }
-
-#ifdef DCR_USE_NEW_250932
-
-private:
- ImageAttributes(const ImageAttributes &);
- ImageAttributes& operator=(const ImageAttributes &);
-
-#endif
-
-protected:
- ImageAttributes(GpImageAttributes* imageAttr, Status status)
- {
- SetNativeImageAttr(imageAttr);
- lastResult = status;
- }
-
- VOID SetNativeImageAttr(GpImageAttributes* nativeImageAttr)
- {
- this->nativeImageAttr = nativeImageAttr;
- }
-
- Status SetStatus(Status status) const
- {
- if (status != Ok)
- return (lastResult = status);
- else
- return status;
- }
-
-protected:
- GpImageAttributes* nativeImageAttr;
- mutable Status lastResult;
-};
-
-#endif
+/**************************************************************************\
+*
+* Copyright (c) 1998-2000, Microsoft Corp. All Rights Reserved.
+*
+* Module Name:
+*
+* Image Attributes
+*
+* Abstract:
+*
+* Class for color adjustment object passed to Graphics.DrawImage
+*
+\**************************************************************************/
+
+#ifndef _GDIPLUSIMAGEATTRIBUTES_H
+#define _GDIPLUSIMAGEATTRIBUTES_H
+
+class GpImageAttributes;
+
+// There are 5 possible sets of color adjustments:
+// ColorAdjustDefault,
+// ColorAdjustBitmap,
+// ColorAdjustBrush,
+// ColorAdjustPen,
+// ColorAdjustText,
+
+// Bitmaps, Brushes, Pens, and Text will all use any color adjustments
+// that have been set into the default ImageAttributes until their own
+// color adjustments have been set. So as soon as any "Set" method is
+// called for Bitmaps, Brushes, Pens, or Text, then they start from
+// scratch with only the color adjustments that have been set for them.
+// Calling Reset removes any individual color adjustments for a type
+// and makes it revert back to using all the default color adjustments
+// (if any). The SetToIdentity method is a way to force a type to
+// have no color adjustments at all, regardless of what previous adjustments
+// have been set for the defaults or for that type.
+
+class ImageAttributes : public GdiplusBase
+{
+ friend class Graphics;
+ friend class TextureBrush;
+
+public:
+
+ ImageAttributes()
+ {
+ nativeImageAttr = NULL;
+ lastResult = DllExports::GdipCreateImageAttributes(&nativeImageAttr);
+ }
+
+ ~ImageAttributes()
+ {
+ DllExports::GdipDisposeImageAttributes(nativeImageAttr);
+ }
+
+ ImageAttributes* Clone() const
+ {
+ GpImageAttributes* clone;
+
+ SetStatus(DllExports::GdipCloneImageAttributes(
+ nativeImageAttr,
+ &clone));
+
+ return new ImageAttributes(clone, lastResult);
+ }
+
+ // Set to identity, regardless of what the default color adjustment is.
+ Status
+ SetToIdentity(
+ IN ColorAdjustType type = ColorAdjustTypeDefault
+ )
+ {
+ return SetStatus(DllExports::GdipSetImageAttributesToIdentity(
+ nativeImageAttr,
+ type));
+ }
+
+ // Remove any individual color adjustments, and go back to using the default
+ Status
+ Reset(
+ IN ColorAdjustType type = ColorAdjustTypeDefault
+ )
+ {
+ return SetStatus(DllExports::GdipResetImageAttributes(
+ nativeImageAttr,
+ type));
+ }
+
+ Status
+ SetColorMatrix(
+ IN const ColorMatrix *colorMatrix,
+ IN ColorMatrixFlags mode = ColorMatrixFlagsDefault,
+ IN ColorAdjustType type = ColorAdjustTypeDefault
+ )
+ {
+ return SetStatus(DllExports::GdipSetImageAttributesColorMatrix(
+ nativeImageAttr,
+ type,
+ TRUE,
+ colorMatrix,
+ NULL,
+ mode));
+ }
+
+ Status ClearColorMatrix(
+ IN ColorAdjustType type = ColorAdjustTypeDefault
+ )
+ {
+ return SetStatus(DllExports::GdipSetImageAttributesColorMatrix(
+ nativeImageAttr,
+ type,
+ FALSE,
+ NULL,
+ NULL,
+ ColorMatrixFlagsDefault));
+ }
+
+ Status
+ SetColorMatrices(
+ IN const ColorMatrix *colorMatrix,
+ IN const ColorMatrix *grayMatrix,
+ IN ColorMatrixFlags mode = ColorMatrixFlagsDefault,
+ IN ColorAdjustType type = ColorAdjustTypeDefault
+ )
+ {
+ return SetStatus(DllExports::GdipSetImageAttributesColorMatrix(
+ nativeImageAttr,
+ type,
+ TRUE,
+ colorMatrix,
+ grayMatrix,
+ mode));
+ }
+
+ Status ClearColorMatrices(
+ IN ColorAdjustType type = ColorAdjustTypeDefault
+ )
+ {
+ return SetStatus(DllExports::GdipSetImageAttributesColorMatrix(
+ nativeImageAttr,
+ type,
+ FALSE,
+ NULL,
+ NULL,
+ ColorMatrixFlagsDefault));
+ }
+
+ Status SetThreshold(
+ IN REAL threshold,
+ IN ColorAdjustType type = ColorAdjustTypeDefault
+ )
+ {
+ return SetStatus(DllExports::GdipSetImageAttributesThreshold(
+ nativeImageAttr,
+ type,
+ TRUE,
+ threshold));
+ }
+
+ Status ClearThreshold(
+ IN ColorAdjustType type = ColorAdjustTypeDefault
+ )
+ {
+ return SetStatus(DllExports::GdipSetImageAttributesThreshold(
+ nativeImageAttr,
+ type,
+ FALSE,
+ 0.0));
+ }
+
+ Status SetGamma(
+ IN REAL gamma,
+ IN ColorAdjustType type = ColorAdjustTypeDefault
+ )
+ {
+ return SetStatus(DllExports::GdipSetImageAttributesGamma(
+ nativeImageAttr,
+ type,
+ TRUE,
+ gamma));
+ }
+
+ Status ClearGamma(
+ IN ColorAdjustType type = ColorAdjustTypeDefault
+ )
+ {
+ return SetStatus(DllExports::GdipSetImageAttributesGamma(
+ nativeImageAttr,
+ type,
+ FALSE,
+ 0.0));
+ }
+
+ Status SetNoOp(
+ IN ColorAdjustType type = ColorAdjustTypeDefault
+ )
+ {
+ return SetStatus(DllExports::GdipSetImageAttributesNoOp(
+ nativeImageAttr,
+ type,
+ TRUE));
+ }
+
+ Status ClearNoOp(
+ IN ColorAdjustType type = ColorAdjustTypeDefault
+ )
+ {
+ return SetStatus(DllExports::GdipSetImageAttributesNoOp(
+ nativeImageAttr,
+ type,
+ FALSE));
+ }
+
+ Status SetColorKey(
+ IN const Color& colorLow,
+ IN const Color& colorHigh,
+ IN ColorAdjustType type = ColorAdjustTypeDefault
+ )
+ {
+ return SetStatus(DllExports::GdipSetImageAttributesColorKeys(
+ nativeImageAttr,
+ type,
+ TRUE,
+ colorLow.GetValue(),
+ colorHigh.GetValue()));
+ }
+
+ Status ClearColorKey(
+ IN ColorAdjustType type = ColorAdjustTypeDefault
+ )
+ {
+ return SetStatus(DllExports::GdipSetImageAttributesColorKeys(
+ nativeImageAttr,
+ type,
+ FALSE,
+ NULL,
+ NULL));
+ }
+
+ Status SetOutputChannel(
+ IN ColorChannelFlags channelFlags,
+ IN ColorAdjustType type = ColorAdjustTypeDefault
+ )
+ {
+ return SetStatus(DllExports::GdipSetImageAttributesOutputChannel(
+ nativeImageAttr,
+ type,
+ TRUE,
+ channelFlags));
+ }
+
+ Status ClearOutputChannel(
+ IN ColorAdjustType type = ColorAdjustTypeDefault
+ )
+ {
+ return SetStatus(DllExports::GdipSetImageAttributesOutputChannel(
+ nativeImageAttr,
+ type,
+ FALSE,
+ ColorChannelFlagsLast));
+ }
+
+ Status SetOutputChannelColorProfile(
+ IN const WCHAR *colorProfileFilename,
+ IN ColorAdjustType type = ColorAdjustTypeDefault
+ )
+ {
+ return SetStatus(DllExports::GdipSetImageAttributesOutputChannelColorProfile(
+ nativeImageAttr,
+ type,
+ TRUE,
+ colorProfileFilename));
+ }
+
+ Status ClearOutputChannelColorProfile(
+ IN ColorAdjustType type = ColorAdjustTypeDefault
+ )
+ {
+ return SetStatus(DllExports::GdipSetImageAttributesOutputChannelColorProfile(
+ nativeImageAttr,
+ type,
+ FALSE,
+ NULL));
+ }
+
+ Status SetRemapTable(
+ IN UINT mapSize,
+ IN const ColorMap *map,
+ IN ColorAdjustType type = ColorAdjustTypeDefault
+ )
+ {
+ return SetStatus(DllExports::GdipSetImageAttributesRemapTable(
+ nativeImageAttr,
+ type,
+ TRUE,
+ mapSize,
+ map));
+ }
+
+ Status ClearRemapTable(
+ IN ColorAdjustType type = ColorAdjustTypeDefault
+ )
+ {
+ return SetStatus(DllExports::GdipSetImageAttributesRemapTable(
+ nativeImageAttr,
+ type,
+ FALSE,
+ 0,
+ NULL));
+ }
+
+ Status SetBrushRemapTable(IN UINT mapSize,
+ IN const ColorMap *map)
+ {
+ return this->SetRemapTable(mapSize, map, ColorAdjustTypeBrush);
+ }
+
+ Status ClearBrushRemapTable()
+ {
+ return this->ClearRemapTable(ColorAdjustTypeBrush);
+ }
+
+ Status SetWrapMode(IN WrapMode wrap,
+ IN const Color& color = Color(),
+ IN BOOL clamp = FALSE)
+ {
+ ARGB argb = color.GetValue();
+
+ return SetStatus(DllExports::GdipSetImageAttributesWrapMode(
+ nativeImageAttr, wrap, argb, clamp));
+ }
+
+ #ifndef DCR_USE_NEW_145139
+ Status SetICMMode(IN BOOL on)
+ {
+ on;
+ // This is not implemented.
+ // The supported method for doing ICM conversion from the embedded
+ // ICC profile is to use the Bitmap constructor from a file or stream
+ // and specify TRUE for the useIcm parameter. This will cause the
+ // image to be ICM converted when it's loaded from the file/stream
+ // if the profile exists.
+ return SetStatus(NotImplemented);
+// DllExports::GdipSetImageAttributesICMMode(nativeImageAttr, on)
+ }
+ #endif
+
+ // The flags of the palette are ignored.
+ Status GetAdjustedPalette(IN OUT ColorPalette* colorPalette,
+ IN ColorAdjustType colorAdjustType) const
+ {
+ return SetStatus(DllExports::GdipGetImageAttributesAdjustedPalette(
+ nativeImageAttr, colorPalette, colorAdjustType));
+ }
+
+ Status GetLastStatus() const
+ {
+ Status lastStatus = lastResult;
+ lastResult = Ok;
+
+ return lastStatus;
+ }
+
+#ifdef DCR_USE_NEW_250932
+
+private:
+ ImageAttributes(const ImageAttributes &);
+ ImageAttributes& operator=(const ImageAttributes &);
+
+#endif
+
+protected:
+ ImageAttributes(GpImageAttributes* imageAttr, Status status)
+ {
+ SetNativeImageAttr(imageAttr);
+ lastResult = status;
+ }
+
+ VOID SetNativeImageAttr(GpImageAttributes* nativeImageAttr)
+ {
+ this->nativeImageAttr = nativeImageAttr;
+ }
+
+ Status SetStatus(Status status) const
+ {
+ if (status != Ok)
+ return (lastResult = status);
+ else
+ return status;
+ }
+
+protected:
+ GpImageAttributes* nativeImageAttr;
+ mutable Status lastResult;
+};
+
+#endif
diff --git a/core/src/fxge/Microsoft SDK/include/GdiplusInit.h b/core/src/fxge/Microsoft SDK/include/GdiplusInit.h
index 3320fa4b7e..48516d63d5 100644
--- a/core/src/fxge/Microsoft SDK/include/GdiplusInit.h
+++ b/core/src/fxge/Microsoft SDK/include/GdiplusInit.h
@@ -1,104 +1,104 @@
-/**************************************************************************
-*
-* Copyright (c) 2000 Microsoft Corporation
-*
-* Module Name:
-*
-* Gdiplus init
-*
-* Abstract:
-*
-* GDI+ startup/shutdown API's
-*
-* Created:
-*
-* 09/02/2000 agodfrey
-* Created it.
-*
-**************************************************************************/
-
-#ifndef _GDIPLUSINIT_H
-#define _GDIPLUSINIT_H
-//************************************************************************
-#if _FX_COMPILER_ == _FX_VC6_
-typedef unsigned long ULONG_PTR, *PULONG_PTR; //johnson add here.
-#endif
-//************************************************************************
-
-// Used for debug event notification (debug builds only)
-
-enum DebugEventLevel
-{
- DebugEventLevelFatal,
- DebugEventLevelWarning
-};
-
-// Callback function that GDI+ can call, on debug builds, for assertions
-// and warnings.
-
-typedef VOID (WINAPI *DebugEventProc)(DebugEventLevel level, CHAR *message);
-
-// Notification functions which the user must call appropriately if
-// "SuppressBackgroundThread" (below) is set.
-
-typedef Status (WINAPI *NotificationHookProc)(OUT ULONG_PTR *token);
-typedef VOID (WINAPI *NotificationUnhookProc)(ULONG_PTR token);
-
-// Input structure for GdiplusStartup()
-
-struct GdiplusStartupInput
-{
- UINT32 GdiplusVersion; // Must be 1
- DebugEventProc DebugEventCallback; // Ignored on free builds
- BOOL SuppressBackgroundThread; // FALSE unless you're prepared to call
- // the hook/unhook functions properly
- BOOL SuppressExternalCodecs; // FALSE unless you want GDI+ only to use
- // its internal image codecs.
-
- GdiplusStartupInput(
- DebugEventProc debugEventCallback = NULL,
- BOOL suppressBackgroundThread = FALSE,
- BOOL suppressExternalCodecs = FALSE)
- {
- GdiplusVersion = 1;
- DebugEventCallback = debugEventCallback;
- SuppressBackgroundThread = suppressBackgroundThread;
- SuppressExternalCodecs = suppressExternalCodecs;
- }
-};
-
-// Output structure for GdiplusStartup()
-
-struct GdiplusStartupOutput
-{
- // The following 2 fields are NULL if SuppressBackgroundThread is FALSE.
- // Otherwise, they are functions which must be called appropriately to
- // replace the background thread.
- //
- // These should be called on the application's main message loop - i.e.
- // a message loop which is active for the lifetime of GDI+.
- // "NotificationHook" should be called before starting the loop,
- // and "NotificationUnhook" should be called after the loop ends.
-
- NotificationHookProc NotificationHook;
- NotificationUnhookProc NotificationUnhook;
-};
-
-// GDI+ initialization. Must be called before GDI+ API's are used.
-//
-// token - may not be NULL - accepts a token to be passed in the corresponding
-// GdiplusShutdown call.
-// input - may not be NULL
-// output - may be NULL only if input->SuppressBackgroundThread is FALSE.
-
-extern "C" Status WINAPI GdiplusStartup(
- OUT ULONG_PTR *token,
- const GdiplusStartupInput *input,
- OUT GdiplusStartupOutput *output);
-
-// GDI+ termination. Must be called before GDI+ is unloaded. GDI+ API's may not
-// be called after this.
-
-extern "C" VOID WINAPI GdiplusShutdown(ULONG_PTR token);
-
-#endif
+/**************************************************************************
+*
+* Copyright (c) 2000 Microsoft Corporation
+*
+* Module Name:
+*
+* Gdiplus init
+*
+* Abstract:
+*
+* GDI+ startup/shutdown API's
+*
+* Created:
+*
+* 09/02/2000 agodfrey
+* Created it.
+*
+**************************************************************************/
+
+#ifndef _GDIPLUSINIT_H
+#define _GDIPLUSINIT_H
+//************************************************************************
+#if _FX_COMPILER_ == _FX_VC6_
+typedef unsigned long ULONG_PTR, *PULONG_PTR; //johnson add here.
+#endif
+//************************************************************************
+
+// Used for debug event notification (debug builds only)
+
+enum DebugEventLevel
+{
+ DebugEventLevelFatal,
+ DebugEventLevelWarning
+};
+
+// Callback function that GDI+ can call, on debug builds, for assertions
+// and warnings.
+
+typedef VOID (WINAPI *DebugEventProc)(DebugEventLevel level, CHAR *message);
+
+// Notification functions which the user must call appropriately if
+// "SuppressBackgroundThread" (below) is set.
+
+typedef Status (WINAPI *NotificationHookProc)(OUT ULONG_PTR *token);
+typedef VOID (WINAPI *NotificationUnhookProc)(ULONG_PTR token);
+
+// Input structure for GdiplusStartup()
+
+struct GdiplusStartupInput
+{
+ UINT32 GdiplusVersion; // Must be 1
+ DebugEventProc DebugEventCallback; // Ignored on free builds
+ BOOL SuppressBackgroundThread; // FALSE unless you're prepared to call
+ // the hook/unhook functions properly
+ BOOL SuppressExternalCodecs; // FALSE unless you want GDI+ only to use
+ // its internal image codecs.
+
+ GdiplusStartupInput(
+ DebugEventProc debugEventCallback = NULL,
+ BOOL suppressBackgroundThread = FALSE,
+ BOOL suppressExternalCodecs = FALSE)
+ {
+ GdiplusVersion = 1;
+ DebugEventCallback = debugEventCallback;
+ SuppressBackgroundThread = suppressBackgroundThread;
+ SuppressExternalCodecs = suppressExternalCodecs;
+ }
+};
+
+// Output structure for GdiplusStartup()
+
+struct GdiplusStartupOutput
+{
+ // The following 2 fields are NULL if SuppressBackgroundThread is FALSE.
+ // Otherwise, they are functions which must be called appropriately to
+ // replace the background thread.
+ //
+ // These should be called on the application's main message loop - i.e.
+ // a message loop which is active for the lifetime of GDI+.
+ // "NotificationHook" should be called before starting the loop,
+ // and "NotificationUnhook" should be called after the loop ends.
+
+ NotificationHookProc NotificationHook;
+ NotificationUnhookProc NotificationUnhook;
+};
+
+// GDI+ initialization. Must be called before GDI+ API's are used.
+//
+// token - may not be NULL - accepts a token to be passed in the corresponding
+// GdiplusShutdown call.
+// input - may not be NULL
+// output - may be NULL only if input->SuppressBackgroundThread is FALSE.
+
+extern "C" Status WINAPI GdiplusStartup(
+ OUT ULONG_PTR *token,
+ const GdiplusStartupInput *input,
+ OUT GdiplusStartupOutput *output);
+
+// GDI+ termination. Must be called before GDI+ is unloaded. GDI+ API's may not
+// be called after this.
+
+extern "C" VOID WINAPI GdiplusShutdown(ULONG_PTR token);
+
+#endif
diff --git a/core/src/fxge/Microsoft SDK/include/sal.h b/core/src/fxge/Microsoft SDK/include/sal.h
index 136996974a..07234950cd 100644
--- a/core/src/fxge/Microsoft SDK/include/sal.h
+++ b/core/src/fxge/Microsoft SDK/include/sal.h
@@ -1,729 +1,729 @@
-/***
-*sal.h - markers for documenting the semantics of APIs
-*
-* Copyright (c) Microsoft Corporation. All rights reserved.
-*
-*Purpose:
-* sal.h provides a set of annotations to describe how a function uses its
-* parameters - the assumptions it makes about them, and the guarantees it makes
-* upon finishing.
-*
-* [Public]
-*
-****/
-
-/*
- -------------------------------------------------------------------------------
- Introduction
-
- sal.h provides a set of annotations to describe how a function uses its
- parameters - the assumptions it makes about them, and the guarantees it makes
- upon finishing.
-
- Annotations may be placed before either a function parameter's type or its return
- type, and describe the function's behavior regarding the parameter or return value.
- There are two classes of annotations: buffer annotations and advanced annotations.
- Buffer annotations describe how functions use their pointer parameters, and
- advanced annotations either describe complex/unusual buffer behavior, or provide
- additional information about a parameter that is not otherwise expressible.
-
- -------------------------------------------------------------------------------
- Buffer Annotations
-
- The most important annotations in sal.h provide a consistent way to annotate
- buffer parameters or return values for a function. Each of these annotations describes
- a single buffer (which could be a string, a fixed-length or variable-length array,
- or just a pointer) that the function interacts with: where it is, how large it is,
- how much is initialized, and what the function does with it.
-
- The appropriate macro for a given buffer can be constructed using the table below.
- Just pick the appropriate values from each category, and combine them together
- with a leading underscore. Some combinations of values do not make sense as buffer
- annotations. Only meaningful annotations can be added to your code; for a list of
- these, see the buffer annotation definitions section.
-
- Only a single buffer annotation should be used for each parameter.
-
- |------------|------------|---------|--------|----------|----------|---------------|
- | Level | Usage | Size | Output | NullTerm | Optional | Parameters |
- |------------|------------|---------|--------|----------|----------|---------------|
- | <> | <> | <> | <> | _z | <> | <> |
- | _deref | _in | _ecount | _full | _nz | _opt | (size) |
- | _deref_opt | _out | _bcount | _part | | | (size,length) |
- | | _inout | | | | | |
- | | | | | | | |
- |------------|------------|---------|--------|----------|----------|---------------|
-
- Level: Describes the buffer pointer's level of indirection from the parameter or
- return value 'p'.
-
- <> : p is the buffer pointer.
- _deref : *p is the buffer pointer. p must not be NULL.
- _deref_opt : *p may be the buffer pointer. p may be NULL, in which case the rest of
- the annotation is ignored.
-
- Usage: Describes how the function uses the buffer.
-
- <> : The buffer is not accessed. If used on the return value or with _deref, the
- function will provide the buffer, and it will be uninitialized at exit.
- Otherwise, the caller must provide the buffer. This should only be used
- for alloc and free functions.
- _in : The function will only read from the buffer. The caller must provide the
- buffer and initialize it. Cannot be used with _deref.
- _out : The function will only write to the buffer. If used on the return value or
- with _deref, the function will provide the buffer and initialize it.
- Otherwise, the caller must provide the buffer, and the function will
- initialize it.
- _inout : The function may freely read from and write to the buffer. The caller must
- provide the buffer and initialize it. If used with _deref, the buffer may
- be reallocated by the function.
-
- Size: Describes the total size of the buffer. This may be less than the space actually
- allocated for the buffer, in which case it describes the accessible amount.
-
- <> : No buffer size is given. If the type specifies the buffer size (such as
- with LPSTR and LPWSTR), that amount is used. Otherwise, the buffer is one
- element long. Must be used with _in, _out, or _inout.
- _ecount : The buffer size is an explicit element count.
- _bcount : The buffer size is an explicit byte count.
-
- Output: Describes how much of the buffer will be initialized by the function. For
- _inout buffers, this also describes how much is initialized at entry. Omit this
- category for _in buffers; they must be fully initialized by the caller.
-
- <> : The type specifies how much is initialized. For instance, a function initializing
- an LPWSTR must NULL-terminate the string.
- _full : The function initializes the entire buffer.
- _part : The function initializes part of the buffer, and explicitly indicates how much.
-
- NullTerm: States if the present of a '\0' marks the end of valid elements in the buffer.
- _z : A '\0' indicated the end of the buffer
- _nz : The buffer may not be null terminated and a '\0' does not indicate the end of the
- buffer.
- Optional: Describes if the buffer itself is optional.
-
- <> : The pointer to the buffer must not be NULL.
- _opt : The pointer to the buffer might be NULL. It will be checked before being dereferenced.
-
- Parameters: Gives explicit counts for the size and length of the buffer.
-
- <> : There is no explicit count. Use when neither _ecount nor _bcount is used.
- (size) : Only the buffer's total size is given. Use with _ecount or _bcount but not _part.
- (size,length) : The buffer's total size and initialized length are given. Use with _ecount_part
- and _bcount_part.
-
- -------------------------------------------------------------------------------
- Buffer Annotation Examples
-
- LWSTDAPI_(BOOL) StrToIntExA(
- LPCSTR pszString, -- No annotation required, const implies __in.
- DWORD dwFlags,
- __out int *piRet -- A pointer whose dereference will be filled in.
- );
-
- void MyPaintingFunction(
- __in HWND hwndControl, -- An initialized read-only parameter.
- __in_opt HDC hdcOptional, -- An initialized read-only parameter that might be NULL.
- __inout IPropertyStore *ppsStore -- An initialized parameter that may be freely used
- -- and modified.
- );
-
- LWSTDAPI_(BOOL) PathCompactPathExA(
- __out_ecount(cchMax) LPSTR pszOut, -- A string buffer with cch elements that will
- -- be NULL terminated on exit.
- LPCSTR pszSrc, -- No annotation required, const implies __in.
- UINT cchMax,
- DWORD dwFlags
- );
-
- HRESULT SHLocalAllocBytes(
- size_t cb,
- __deref_bcount(cb) T **ppv -- A pointer whose dereference will be set to an
- -- uninitialized buffer with cb bytes.
- );
-
- __inout_bcount_full(cb) : A buffer with cb elements that is fully initialized at
- entry and exit, and may be written to by this function.
-
- __out_ecount_part(count, *countOut) : A buffer with count elements that will be
- partially initialized by this function. The function indicates how much it
- initialized by setting *countOut.
-
- -------------------------------------------------------------------------------
- Advanced Annotations
-
- Advanced annotations describe behavior that is not expressible with the regular
- buffer macros. These may be used either to annotate buffer parameters that involve
- complex or conditional behavior, or to enrich existing annotations with additional
- information.
-
- __success(expr) f :
- <expr> indicates whether function f succeeded or not. If <expr> is true at exit,
- all the function's guarantees (as given by other annotations) must hold. If <expr>
- is false at exit, the caller should not expect any of the function's guarantees
- to hold. If not used, the function must always satisfy its guarantees. Added
- automatically to functions that indicate success in standard ways, such as by
- returning an HRESULT.
-
- __nullterminated p :
- Pointer p is a buffer that may be read or written up to and including the first
- NULL character or pointer. May be used on typedefs, which marks valid (properly
- initialized) instances of that type as being NULL-terminated.
-
- __nullnullterminated p :
- Pointer p is a buffer that may be read or written up to and including the first
- sequence of two NULL characters or pointers. May be used on typedefs, which marks
- valid instances of that type as being double-NULL terminated.
-
- __reserved v :
- Value v must be 0/NULL, reserved for future use.
-
- __checkReturn v :
- Return value v must not be ignored by callers of this function.
-
- __typefix(ctype) v :
- Value v should be treated as an instance of ctype, rather than its declared type.
-
- __override f :
- Specify C#-style 'override' behaviour for overriding virtual methods.
-
- __callback f :
- Function f can be used as a function pointer.
-
- __format_string p :
- Pointer p is a string that contains % markers in the style of printf.
-
- __blocksOn(resource) f :
- Function f blocks on the resource 'resource'.
-
- __fallthrough :
- Annotates switch statement labels where fall-through is desired, to distinguish
- from forgotten break statements.
-
- -------------------------------------------------------------------------------
- Advanced Annotation Examples
-
- __success(return == TRUE) LWSTDAPI_(BOOL)
- PathCanonicalizeA(__out_ecount(MAX_PATH) LPSTR pszBuf, LPCSTR pszPath) :
- pszBuf is only guaranteed to be NULL-terminated when TRUE is returned.
-
- typedef __nullterminated WCHAR* LPWSTR : Initialized LPWSTRs are NULL-terminated strings.
-
- __out_ecount(cch) __typefix(LPWSTR) void *psz : psz is a buffer parameter which will be
- a NULL-terminated WCHAR string at exit, and which initially contains cch WCHARs.
-
- -------------------------------------------------------------------------------
-*/
-
-#pragma once
-
-#define __specstrings
-
-#ifdef __cplusplus
-#ifndef __nothrow
-# define __nothrow __declspec(nothrow)
-#endif
-extern "C" {
-#else
-#ifndef __nothrow
-# define __nothrow
-#endif
-#endif /* #ifdef __cplusplus */
-
-/*
- -------------------------------------------------------------------------------
- Helper Macro Definitions
-
- These express behavior common to many of the high-level annotations.
- DO NOT USE THESE IN YOUR CODE.
- -------------------------------------------------------------------------------
-*/
-
-/*
-The helper annotations are only understood by the compiler version used by various
-defect detection tools. When the regular compiler is running, they are defined into
-nothing, and do not affect the compiled code.
-*/
-
-#if !defined(__midl) && defined(_PREFAST_)
-
- /*
- In the primitive __declspec("SAL_*") annotations "SAL" stands for Standard
- Annotation Language. These __declspec("SAL_*") annotations are the
- primitives the compiler understands and all high-level SpecString MACROs
- will decompose into these primivates.
- */
-
- #define SPECSTRINGIZE( x ) #x
-
- /*
- __null p
- __notnull p
- __maybenull p
-
- Annotates a pointer p. States that pointer p is null. Commonly used
- in the negated form __notnull or the possibly null form __maybenull.
- */
-
- #define __null __declspec("SAL_null")
- #define __notnull __declspec("SAL_notnull")
- #define __maybenull __declspec("SAL_maybenull")
-
- /*
- __readonly l
- __notreadonly l
- __mabyereadonly l
-
- Annotates a location l. States that location l is not modified after
- this point. If the annotation is placed on the precondition state of
- a function, the restriction only applies until the postcondition state
- of the function. __maybereadonly states that the annotated location
- may be modified, whereas __notreadonly states that a location must be
- modified.
- */
-
- #define __readonly __declspec("SAL_readonly")
- #define __notreadonly __declspec("SAL_notreadonly")
- #define __maybereadonly __declspec("SAL_maybereadonly")
-
- /*
- __valid v
- __notvalid v
- __maybevalid v
-
- Annotates any value v. States that the value satisfies all properties of
- valid values of its type. For example, for a string buffer, valid means
- that the buffer pointer is either NULL or points to a NULL-terminated string.
- */
-
- #define __valid __declspec("SAL_valid")
- #define __notvalid __declspec("SAL_notvalid")
- #define __maybevalid __declspec("SAL_maybevalid")
-
- /*
- __readableTo(extent) p
-
- Annotates a buffer pointer p. If the buffer can be read, extent describes
- how much of the buffer is readable. For a reader of the buffer, this is
- an explicit permission to read up to that amount, rather than a restriction to
- read only up to it.
- */
-
- #define __readableTo(extent) __declspec("SAL_readableTo("SPECSTRINGIZE(extent)")")
-
- /*
-
- __elem_readableTo(size)
-
- Annotates a buffer pointer p as being readable to size elements.
- */
-
- #define __elem_readableTo(size) __declspec("SAL_readableTo(elementCount("SPECSTRINGIZE(size)"))")
-
- /*
- __byte_readableTo(size)
-
- Annotates a buffer pointer p as being readable to size bytes.
- */
- #define __byte_readableTo(size) __declspec("SAL_readableTo(byteCount("SPECSTRINGIZE(size)"))")
-
- /*
- __writableTo(extent) p
-
- Annotates a buffer pointer p. If the buffer can be modified, extent
- describes how much of the buffer is writable (usually the allocation
- size). For a writer of the buffer, this is an explicit permission to
- write up to that amount, rather than a restriction to write only up to it.
- */
- #define __writableTo(size) __declspec("SAL_writableTo("SPECSTRINGIZE(size)")")
-
- /*
- __elem_writableTo(size)
-
- Annotates a buffer pointer p as being writable to size elements.
- */
- #define __elem_writableTo(size) __declspec("SAL_writableTo(elementCount("SPECSTRINGIZE(size)"))")
-
- /*
- __byte_writableTo(size)
-
- Annotates a buffer pointer p as being writable to size bytes.
- */
- #define __byte_writableTo(size) __declspec("SAL_writableTo(byteCount("SPECSTRINGIZE(size)"))")
-
- /*
- __deref p
-
- Annotates a pointer p. The next annotation applies one dereference down
- in the type. If readableTo(p, size) then the next annotation applies to
- all elements *(p+i) for which i satisfies the size. If p is a pointer
- to a struct, the next annotation applies to all fields of the struct.
- */
- #define __deref __declspec("SAL_deref")
-
- /*
- __pre __next_annotation
-
- The next annotation applies in the precondition state
- */
- #define __pre __declspec("SAL_pre")
-
- /*
- __post __next_annotation
-
- The next annotation applies in the postcondition state
- */
- #define __post __declspec("SAL_post")
-
- /*
- __precond(<expr>)
-
- When <expr> is true, the next annotation applies in the precondition state
- (currently not enabled)
- */
- #define __precond(expr) __pre
-
- /*
- __postcond(<expr>)
-
- When <expr> is true, the next annotation applies in the postcondition state
- (currently not enabled)
- */
- #define __postcond(expr) __post
-
- /*
- __exceptthat
-
- Given a set of annotations Q containing __exceptthat maybeP, the effect of
- the except clause is to erase any P or notP annotations (explicit or
- implied) within Q at the same level of dereferencing that the except
- clause appears, and to replace it with maybeP.
-
- Example 1: __valid __exceptthat __maybenull on a pointer p means that the
- pointer may be null, and is otherwise valid, thus overriding
- the implicit notnull annotation implied by __valid on
- pointers.
-
- Example 2: __valid __deref __exceptthat __maybenull on an int **p means
- that p is not null (implied by valid), but the elements
- pointed to by p could be null, and are otherwise valid.
- */
- #define __exceptthat __declspec("SAL_except")
- #define __execeptthat __exceptthat
-
- /*
- _refparam
-
- Added to all out parameter macros to indicate that they are all reference
- parameters.
- */
- #define __refparam __deref __notreadonly
-
- /*
- __inner_*
-
- Helper macros that directly correspond to certain high-level annotations.
-
- */
-
- /*
- Macros to classify the entrypoints and indicate their category.
-
- Pre-defined control point categories include: RPC, LPC, DeviceDriver, UserToKernel, ISAPI, COM.
-
- */
- #define __inner_control_entrypoint(category) __declspec("SAL_entrypoint(controlEntry, "SPECSTRINGIZE(category)")")
-
- /*
- Pre-defined data entry point categories include: Registry, File, Network.
- */
- #define __inner_data_entrypoint(category) __declspec("SAL_entrypoint(dataEntry, "SPECSTRINGIZE(category)")")
-
- #define __inner_success(expr) __declspec("SAL_success("SPECSTRINGIZE(expr)")")
- #define __inner_checkReturn __declspec("SAL_checkReturn")
- #define __inner_typefix(ctype) __declspec("SAL_typefix("SPECSTRINGIZE(ctype)")")
- #define __inner_override __declspec("__override")
- #define __inner_callback __declspec("__callback")
- #define __inner_blocksOn(resource) __declspec("SAL_blocksOn("SPECSTRINGIZE(resource)")")
- #define __inner_fallthrough_dec __inline __nothrow void __FallThrough() {}
- #define __inner_fallthrough __FallThrough();
-
-#else
- #define __null
- #define __notnull
- #define __maybenull
- #define __readonly
- #define __notreadonly
- #define __maybereadonly
- #define __valid
- #define __notvalid
- #define __maybevalid
- #define __readableTo(extent)
- #define __elem_readableTo(size)
- #define __byte_readableTo(size)
- #define __writableTo(size)
- #define __elem_writableTo(size)
- #define __byte_writableTo(size)
- #define __deref
- #define __pre
- #define __post
- #define __precond(expr)
- #define __postcond(expr)
- #define __exceptthat
- #define __execeptthat
- #define __inner_success(expr)
- #define __inner_checkReturn
- #define __inner_typefix(ctype)
- #define __inner_override
- #define __inner_callback
- #define __inner_blocksOn(resource)
- #define __inner_fallthrough_dec
- #define __inner_fallthrough
- #define __refparam
- #define __inner_control_entrypoint(category)
- #define __inner_data_entrypoint(category)
-#endif /* #if !defined(__midl) && defined(_PREFAST_) */
-
-/*
--------------------------------------------------------------------------------
-Buffer Annotation Definitions
-
-Any of these may be used to directly annotate functions, but only one should
-be used for each parameter. To determine which annotation to use for a given
-buffer, use the table in the buffer annotations section.
--------------------------------------------------------------------------------
-*/
-
-#define __ecount(size) __notnull __elem_writableTo(size)
-#define __bcount(size) __notnull __byte_writableTo(size)
-#define __in __pre __valid __pre __deref __readonly
-#define __in_ecount(size) __in __pre __elem_readableTo(size)
-#define __in_bcount(size) __in __pre __byte_readableTo(size)
-#define __in_z __in __pre __nullterminated
-#define __in_ecount_z(size) __in_ecount(size) __pre __nullterminated
-#define __in_bcount_z(size) __in_bcount(size) __pre __nullterminated
-#define __in_nz __in
-#define __in_ecount_nz(size) __in_ecount(size)
-#define __in_bcount_nz(size) __in_bcount(size)
-#define __out __ecount(1) __post __valid __refparam
-#define __out_ecount(size) __ecount(size) __post __valid __refparam
-#define __out_bcount(size) __bcount(size) __post __valid __refparam
-#define __out_ecount_part(size,length) __out_ecount(size) __post __elem_readableTo(length)
-#define __out_bcount_part(size,length) __out_bcount(size) __post __byte_readableTo(length)
-#define __out_ecount_full(size) __out_ecount_part(size,size)
-#define __out_bcount_full(size) __out_bcount_part(size,size)
-#define __out_z __post __valid __refparam __post __nullterminated
-#define __out_z_opt __post __valid __refparam __post __nullterminated __exceptthat __maybenull
-#define __out_ecount_z(size) __ecount(size) __post __valid __refparam __post __nullterminated
-#define __out_bcount_z(size) __bcount(size) __post __valid __refparam __post __nullterminated
-#define __out_ecount_part_z(size,length) __out_ecount_part(size,length) __post __nullterminated
-#define __out_bcount_part_z(size,length) __out_bcount_part(size,length) __post __nullterminated
-#define __out_ecount_full_z(size) __out_ecount_full(size) __post __nullterminated
-#define __out_bcount_full_z(size) __out_bcount_full(size) __post __nullterminated
-#define __out_nz __post __valid __refparam __post
-#define __out_nz_opt __post __valid __refparam __post __exceptthat __maybenull
-#define __out_ecount_nz(size) __ecount(size) __post __valid __refparam
-#define __out_bcount_nz(size) __bcount(size) __post __valid __refparam
-#define __inout __pre __valid __post __valid __refparam
-#define __inout_ecount(size) __out_ecount(size) __pre __valid
-#define __inout_bcount(size) __out_bcount(size) __pre __valid
-#define __inout_ecount_part(size,length) __out_ecount_part(size,length) __pre __valid __pre __elem_readableTo(length)
-#define __inout_bcount_part(size,length) __out_bcount_part(size,length) __pre __valid __pre __byte_readableTo(length)
-#define __inout_ecount_full(size) __inout_ecount_part(size,size)
-#define __inout_bcount_full(size) __inout_bcount_part(size,size)
-#define __inout_z __inout __pre __nullterminated __post __nullterminated
-#define __inout_ecount_z(size) __inout_ecount(size) __pre __nullterminated __post __nullterminated
-#define __inout_bcount_z(size) __inout_bcount(size) __pre __nullterminated __post __nullterminated
-#define __inout_nz __inout
-#define __inout_ecount_nz(size) __inout_ecount(size)
-#define __inout_bcount_nz(size) __inout_bcount(size)
-#define __ecount_opt(size) __ecount(size) __exceptthat __maybenull
-#define __bcount_opt(size) __bcount(size) __exceptthat __maybenull
-#define __in_opt __in __exceptthat __maybenull
-#define __in_ecount_opt(size) __in_ecount(size) __exceptthat __maybenull
-#define __in_bcount_opt(size) __in_bcount(size) __exceptthat __maybenull
-#define __in_z_opt __in_opt __pre __nullterminated
-#define __in_ecount_z_opt(size) __in_ecount_opt(size) __pre __nullterminated
-#define __in_bcount_z_opt(size) __in_bcount_opt(size) __pre __nullterminated
-#define __in_nz_opt __in_opt
-#define __in_ecount_nz_opt(size) __in_ecount_opt(size)
-#define __in_bcount_nz_opt(size) __in_bcount_opt(size)
-#define __out_opt __out __exceptthat __maybenull
-#define __out_ecount_opt(size) __out_ecount(size) __exceptthat __maybenull
-#define __out_bcount_opt(size) __out_bcount(size) __exceptthat __maybenull
-#define __out_ecount_part_opt(size,length) __out_ecount_part(size,length) __exceptthat __maybenull
-#define __out_bcount_part_opt(size,length) __out_bcount_part(size,length) __exceptthat __maybenull
-#define __out_ecount_full_opt(size) __out_ecount_full(size) __exceptthat __maybenull
-#define __out_bcount_full_opt(size) __out_bcount_full(size) __exceptthat __maybenull
-#define __out_ecount_z_opt(size) __out_ecount_opt(size) __post __nullterminated
-#define __out_bcount_z_opt(size) __out_bcount_opt(size) __post __nullterminated
-#define __out_ecount_part_z_opt(size,length) __out_ecount_part_opt(size,length) __post __nullterminated
-#define __out_bcount_part_z_opt(size,length) __out_bcount_part_opt(size,length) __post __nullterminated
-#define __out_ecount_full_z_opt(size) __out_ecount_full_opt(size) __post __nullterminated
-#define __out_bcount_full_z_opt(size) __out_bcount_full_opt(size) __post __nullterminated
-#define __out_ecount_nz_opt(size) __out_ecount_opt(size) __post __nullterminated
-#define __out_bcount_nz_opt(size) __out_bcount_opt(size) __post __nullterminated
-#define __inout_opt __inout __exceptthat __maybenull
-#define __inout_ecount_opt(size) __inout_ecount(size) __exceptthat __maybenull
-#define __inout_bcount_opt(size) __inout_bcount(size) __exceptthat __maybenull
-#define __inout_ecount_part_opt(size,length) __inout_ecount_part(size,length) __exceptthat __maybenull
-#define __inout_bcount_part_opt(size,length) __inout_bcount_part(size,length) __exceptthat __maybenull
-#define __inout_ecount_full_opt(size) __inout_ecount_full(size) __exceptthat __maybenull
-#define __inout_bcount_full_opt(size) __inout_bcount_full(size) __exceptthat __maybenull
-#define __inout_z_opt __inout_opt __pre __nullterminated __post __nullterminated
-#define __inout_ecount_z_opt(size) __inout_ecount_opt(size) __pre __nullterminated __post __nullterminated
-#define __inout_ecount_z_opt(size) __inout_ecount_opt(size) __pre __nullterminated __post __nullterminated
-#define __inout_bcount_z_opt(size) __inout_bcount_opt(size)
-#define __inout_nz_opt __inout_opt
-#define __inout_ecount_nz_opt(size) __inout_ecount_opt(size)
-#define __inout_bcount_nz_opt(size) __inout_bcount_opt(size)
-#define __deref_ecount(size) __ecount(1) __post __elem_readableTo(1) __post __deref __notnull __post __deref __elem_writableTo(size)
-#define __deref_bcount(size) __ecount(1) __post __elem_readableTo(1) __post __deref __notnull __post __deref __byte_writableTo(size)
-#define __deref_out __deref_ecount(1) __post __deref __valid __refparam
-#define __deref_out_ecount(size) __deref_ecount(size) __post __deref __valid __refparam
-#define __deref_out_bcount(size) __deref_bcount(size) __post __deref __valid __refparam
-#define __deref_out_ecount_part(size,length) __deref_out_ecount(size) __post __deref __elem_readableTo(length)
-#define __deref_out_bcount_part(size,length) __deref_out_bcount(size) __post __deref __byte_readableTo(length)
-#define __deref_out_ecount_full(size) __deref_out_ecount_part(size,size)
-#define __deref_out_bcount_full(size) __deref_out_bcount_part(size,size)
-#define __deref_out_z __post __deref __valid __refparam __post __deref __nullterminated
-#define __deref_out_ecount_z(size) __deref_out_ecount(size) __post __deref __nullterminated
-#define __deref_out_bcount_z(size) __deref_out_ecount(size) __post __deref __nullterminated
-#define __deref_out_nz __deref_out
-#define __deref_out_ecount_nz(size) __deref_out_ecount(size)
-#define __deref_out_bcount_nz(size) __deref_out_ecount(size)
-#define __deref_inout __notnull __elem_readableTo(1) __pre __deref __valid __post __deref __valid __refparam
-#define __deref_inout_z __deref_inout __pre __deref __nullterminated __post __deref __nullterminated
-#define __deref_inout_ecount(size) __deref_inout __pre __deref __elem_writableTo(size) __post __deref __elem_writableTo(size)
-#define __deref_inout_bcount(size) __deref_inout __pre __deref __byte_writableTo(size) __post __deref __byte_writableTo(size)
-#define __deref_inout_ecount_part(size,length) __deref_inout_ecount(size) __pre __deref __elem_readableTo(length) __post __deref __elem_readableTo(length)
-#define __deref_inout_bcount_part(size,length) __deref_inout_bcount(size) __pre __deref __byte_readableTo(length) __post __deref __byte_readableTo(length)
-#define __deref_inout_ecount_full(size) __deref_inout_ecount_part(size,size)
-#define __deref_inout_bcount_full(size) __deref_inout_bcount_part(size,size)
-#define __deref_inout_z __deref_inout __pre __deref __nullterminated __post __deref __nullterminated
-#define __deref_inout_ecount_z(size) __deref_inout_ecount(size) __pre __deref __nullterminated __post __deref __nullterminated
-#define __deref_inout_bcount_z(size) __deref_inout_ecount(size) __pre __deref __nullterminated __post __deref __nullterminated
-#define __deref_inout_nz __deref_inout
-#define __deref_inout_ecount_nz(size) __deref_inout_ecount(size)
-#define __deref_inout_bcount_nz(size) __deref_inout_ecount(size)
-#define __deref_ecount_opt(size) __deref_ecount(size) __post __deref __exceptthat __maybenull
-#define __deref_bcount_opt(size) __deref_bcount(size) __post __deref __exceptthat __maybenull
-#define __deref_out_opt __deref_out __post __deref __exceptthat __maybenull
-#define __deref_out_ecount_opt(size) __deref_out_ecount(size) __post __deref __exceptthat __maybenull
-#define __deref_out_bcount_opt(size) __deref_out_bcount(size) __post __deref __exceptthat __maybenull
-#define __deref_out_ecount_part_opt(size,length) __deref_out_ecount_part(size,length) __post __deref __exceptthat __maybenull
-#define __deref_out_bcount_part_opt(size,length) __deref_out_bcount_part(size,length) __post __deref __exceptthat __maybenull
-#define __deref_out_ecount_full_opt(size) __deref_out_ecount_full(size) __post __deref __exceptthat __maybenull
-#define __deref_out_bcount_full_opt(size) __deref_out_bcount_full(size) __post __deref __exceptthat __maybenull
-#define __deref_out_z_opt __post __deref __valid __refparam __execeptthat __maybenull __post __deref __nullterminated
-#define __deref_out_ecount_z_opt(size) __deref_out_ecount_opt(size) __post __deref __nullterminated
-#define __deref_out_bcount_z_opt(size) __deref_out_bcount_opt(size) __post __deref __nullterminated
-#define __deref_out_nz_opt __deref_out_opt
-#define __deref_out_ecount_nz_opt(size) __deref_out_ecount_opt(size)
-#define __deref_out_bcount_nz_opt(size) __deref_out_bcount_opt(size)
-#define __deref_inout_opt __deref_inout __pre __deref __exceptthat __maybenull __post __deref __exceptthat __maybenull
-#define __deref_inout_ecount_opt(size) __deref_inout_ecount(size) __pre __deref __exceptthat __maybenull __post __deref __exceptthat __maybenull
-#define __deref_inout_bcount_opt(size) __deref_inout_bcount(size) __pre __deref __exceptthat __maybenull __post __deref __exceptthat __maybenull
-#define __deref_inout_ecount_part_opt(size,length) __deref_inout_ecount_part(size,length) __pre __deref __exceptthat __maybenull __post __deref __exceptthat __maybenull
-#define __deref_inout_bcount_part_opt(size,length) __deref_inout_bcount_part(size,length) __pre __deref __exceptthat __maybenull __post __deref __exceptthat __maybenull
-#define __deref_inout_ecount_full_opt(size) __deref_inout_ecount_full(size) __pre __deref __exceptthat __maybenull __post __deref __exceptthat __maybenull
-#define __deref_inout_bcount_full_opt(size) __deref_inout_bcount_full(size) __pre __deref __exceptthat __maybenull __post __deref __exceptthat __maybenull
-#define __deref_inout_z_opt __deref_inout_opt __pre __deref __nullterminated __post __deref __nullterminated
-#define __deref_inout_ecount_z_opt(size) __deref_inout_ecount_opt(size) __pre __deref __nullterminated __post __deref __nullterminated
-#define __deref_inout_bcount_z_opt(size) __deref_inout_bcount_opt(size) __pre __deref __nullterminated __post __deref __nullterminated
-#define __deref_inout_nz_opt __deref_inout_opt
-#define __deref_inout_ecount_nz_opt(size) __deref_inout_ecount_opt(size)
-#define __deref_inout_bcount_nz_opt(size) __deref_inout_bcount_opt(size)
-#define __deref_opt_ecount(size) __deref_ecount(size) __exceptthat __maybenull
-#define __deref_opt_bcount(size) __deref_bcount(size) __exceptthat __maybenull
-#define __deref_opt_out __deref_out __exceptthat __maybenull
-#define __deref_opt_out_z __deref_opt_out __post __deref __nullterminated
-#define __deref_opt_out_ecount(size) __deref_out_ecount(size) __exceptthat __maybenull
-#define __deref_opt_out_bcount(size) __deref_out_bcount(size) __exceptthat __maybenull
-#define __deref_opt_out_ecount_part(size,length) __deref_out_ecount_part(size,length) __exceptthat __maybenull
-#define __deref_opt_out_bcount_part(size,length) __deref_out_bcount_part(size,length) __exceptthat __maybenull
-#define __deref_opt_out_ecount_full(size) __deref_out_ecount_full(size) __exceptthat __maybenull
-#define __deref_opt_out_bcount_full(size) __deref_out_bcount_full(size) __exceptthat __maybenull
-#define __deref_opt_inout __deref_inout __exceptthat __maybenull
-#define __deref_opt_inout_ecount(size) __deref_inout_ecount(size) __exceptthat __maybenull
-#define __deref_opt_inout_bcount(size) __deref_inout_bcount(size) __exceptthat __maybenull
-#define __deref_opt_inout_ecount_part(size,length) __deref_inout_ecount_part(size,length) __exceptthat __maybenull
-#define __deref_opt_inout_bcount_part(size,length) __deref_inout_bcount_part(size,length) __exceptthat __maybenull
-#define __deref_opt_inout_ecount_full(size) __deref_inout_ecount_full(size) __exceptthat __maybenull
-#define __deref_opt_inout_bcount_full(size) __deref_inout_bcount_full(size) __exceptthat __maybenull
-#define __deref_opt_inout_z __deref_opt_inout __pre __deref __nullterminated __post __deref __nullterminated
-#define __deref_opt_inout_ecount_z(size) __deref_opt_inout_ecount(size) __pre __deref __nullterminated __post __deref __nullterminated
-#define __deref_opt_inout_bcount_z(size) __deref_opt_inout_bcount(size) __pre __deref __nullterminated __post __deref __nullterminated
-#define __deref_opt_inout_nz __deref_opt_inout
-#define __deref_opt_inout_ecount_nz(size) __deref_opt_inout_ecount(size)
-#define __deref_opt_inout_bcount_nz(size) __deref_opt_inout_bcount(size)
-#define __deref_opt_ecount_opt(size) __deref_ecount_opt(size) __exceptthat __maybenull
-#define __deref_opt_bcount_opt(size) __deref_bcount_opt(size) __exceptthat __maybenull
-#define __deref_opt_out_opt __deref_out_opt __exceptthat __maybenull
-#define __deref_opt_out_ecount_opt(size) __deref_out_ecount_opt(size) __exceptthat __maybenull
-#define __deref_opt_out_bcount_opt(size) __deref_out_bcount_opt(size) __exceptthat __maybenull
-#define __deref_opt_out_ecount_part_opt(size,length) __deref_out_ecount_part_opt(size,length) __exceptthat __maybenull
-#define __deref_opt_out_bcount_part_opt(size,length) __deref_out_bcount_part_opt(size,length) __exceptthat __maybenull
-#define __deref_opt_out_ecount_full_opt(size) __deref_out_ecount_full_opt(size) __exceptthat __maybenull
-#define __deref_opt_out_bcount_full_opt(size) __deref_out_bcount_full_opt(size) __exceptthat __maybenull
-#define __deref_opt_out_z_opt __post __deref __valid __refparam __exceptthat __maybenull __pre __deref __exceptthat __maybenull __post __deref __exceptthat __maybenull __post __deref __nullterminated
-#define __deref_opt_out_ecount_z_opt(size) __deref_opt_out_ecount_opt(size) __post __deref __nullterminated
-#define __deref_opt_out_bcount_z_opt(size) __deref_opt_out_bcount_opt(size) __post __deref __nullterminated
-#define __deref_opt_out_nz_opt __deref_opt_out_opt
-#define __deref_opt_out_ecount_nz_opt(size) __deref_opt_out_ecount_opt(size)
-#define __deref_opt_out_bcount_nz_opt(size) __deref_opt_out_bcount_opt(size)
-#define __deref_opt_inout_opt __deref_inout_opt __exceptthat __maybenull
-#define __deref_opt_inout_ecount_opt(size) __deref_inout_ecount_opt(size) __exceptthat __maybenull
-#define __deref_opt_inout_bcount_opt(size) __deref_inout_bcount_opt(size) __exceptthat __maybenull
-#define __deref_opt_inout_ecount_part_opt(size,length) __deref_inout_ecount_part_opt(size,length) __exceptthat __maybenull
-#define __deref_opt_inout_bcount_part_opt(size,length) __deref_inout_bcount_part_opt(size,length) __exceptthat __maybenull
-#define __deref_opt_inout_ecount_full_opt(size) __deref_inout_ecount_full_opt(size) __exceptthat __maybenull
-#define __deref_opt_inout_bcount_full_opt(size) __deref_inout_bcount_full_opt(size) __exceptthat __maybenull
-#define __deref_opt_inout_z_opt __deref_opt_inout_opt __pre __deref __nullterminated __post __deref __nullterminated
-#define __deref_opt_inout_ecount_z_opt(size) __deref_opt_inout_ecount_opt(size) __pre __deref __nullterminated __post __deref __nullterminated
-#define __deref_opt_inout_bcount_z_opt(size) __deref_opt_inout_bcount_opt(size) __pre __deref __nullterminated __post __deref __nullterminated
-#define __deref_opt_inout_nz_opt __deref_opt_inout_opt
-#define __deref_opt_inout_ecount_nz_opt(size) __deref_opt_inout_ecount_opt(size)
-#define __deref_opt_inout_bcount_nz_opt(size) __deref_opt_inout_bcount_opt(size)
-
-/*
--------------------------------------------------------------------------------
-Advanced Annotation Definitions
-
-Any of these may be used to directly annotate functions, and may be used in
-combination with each other or with regular buffer macros. For an explanation
-of each annotation, see the advanced annotations section.
--------------------------------------------------------------------------------
-*/
-
-#define __success(expr) __inner_success(expr)
-#define __nullterminated __readableTo(sentinel(0))
-#define __nullnullterminated
-#define __reserved __pre __null
-#define __checkReturn __inner_checkReturn
-#define __typefix(ctype) __inner_typefix(ctype)
-#define __override __inner_override
-#define __callback __inner_callback
-#define __format_string
-#define __blocksOn(resource) __inner_blocksOn(resource)
-#define __control_entrypoint(category) __inner_control_entrypoint(category)
-#define __data_entrypoint(category) __inner_data_entrypoint(category)
-
-#ifndef __fallthrough
- __inner_fallthrough_dec
- #define __fallthrough __inner_fallthrough
-#endif
-
-#ifndef __analysis_assume
-#ifdef _PREFAST_
-#define __analysis_assume(expr) __assume(expr)
-#else
-#define __analysis_assume(expr)
-#endif
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-
+/***
+*sal.h - markers for documenting the semantics of APIs
+*
+* Copyright (c) Microsoft Corporation. All rights reserved.
+*
+*Purpose:
+* sal.h provides a set of annotations to describe how a function uses its
+* parameters - the assumptions it makes about them, and the guarantees it makes
+* upon finishing.
+*
+* [Public]
+*
+****/
+
+/*
+ -------------------------------------------------------------------------------
+ Introduction
+
+ sal.h provides a set of annotations to describe how a function uses its
+ parameters - the assumptions it makes about them, and the guarantees it makes
+ upon finishing.
+
+ Annotations may be placed before either a function parameter's type or its return
+ type, and describe the function's behavior regarding the parameter or return value.
+ There are two classes of annotations: buffer annotations and advanced annotations.
+ Buffer annotations describe how functions use their pointer parameters, and
+ advanced annotations either describe complex/unusual buffer behavior, or provide
+ additional information about a parameter that is not otherwise expressible.
+
+ -------------------------------------------------------------------------------
+ Buffer Annotations
+
+ The most important annotations in sal.h provide a consistent way to annotate
+ buffer parameters or return values for a function. Each of these annotations describes
+ a single buffer (which could be a string, a fixed-length or variable-length array,
+ or just a pointer) that the function interacts with: where it is, how large it is,
+ how much is initialized, and what the function does with it.
+
+ The appropriate macro for a given buffer can be constructed using the table below.
+ Just pick the appropriate values from each category, and combine them together
+ with a leading underscore. Some combinations of values do not make sense as buffer
+ annotations. Only meaningful annotations can be added to your code; for a list of
+ these, see the buffer annotation definitions section.
+
+ Only a single buffer annotation should be used for each parameter.
+
+ |------------|------------|---------|--------|----------|----------|---------------|
+ | Level | Usage | Size | Output | NullTerm | Optional | Parameters |
+ |------------|------------|---------|--------|----------|----------|---------------|
+ | <> | <> | <> | <> | _z | <> | <> |
+ | _deref | _in | _ecount | _full | _nz | _opt | (size) |
+ | _deref_opt | _out | _bcount | _part | | | (size,length) |
+ | | _inout | | | | | |
+ | | | | | | | |
+ |------------|------------|---------|--------|----------|----------|---------------|
+
+ Level: Describes the buffer pointer's level of indirection from the parameter or
+ return value 'p'.
+
+ <> : p is the buffer pointer.
+ _deref : *p is the buffer pointer. p must not be NULL.
+ _deref_opt : *p may be the buffer pointer. p may be NULL, in which case the rest of
+ the annotation is ignored.
+
+ Usage: Describes how the function uses the buffer.
+
+ <> : The buffer is not accessed. If used on the return value or with _deref, the
+ function will provide the buffer, and it will be uninitialized at exit.
+ Otherwise, the caller must provide the buffer. This should only be used
+ for alloc and free functions.
+ _in : The function will only read from the buffer. The caller must provide the
+ buffer and initialize it. Cannot be used with _deref.
+ _out : The function will only write to the buffer. If used on the return value or
+ with _deref, the function will provide the buffer and initialize it.
+ Otherwise, the caller must provide the buffer, and the function will
+ initialize it.
+ _inout : The function may freely read from and write to the buffer. The caller must
+ provide the buffer and initialize it. If used with _deref, the buffer may
+ be reallocated by the function.
+
+ Size: Describes the total size of the buffer. This may be less than the space actually
+ allocated for the buffer, in which case it describes the accessible amount.
+
+ <> : No buffer size is given. If the type specifies the buffer size (such as
+ with LPSTR and LPWSTR), that amount is used. Otherwise, the buffer is one
+ element long. Must be used with _in, _out, or _inout.
+ _ecount : The buffer size is an explicit element count.
+ _bcount : The buffer size is an explicit byte count.
+
+ Output: Describes how much of the buffer will be initialized by the function. For
+ _inout buffers, this also describes how much is initialized at entry. Omit this
+ category for _in buffers; they must be fully initialized by the caller.
+
+ <> : The type specifies how much is initialized. For instance, a function initializing
+ an LPWSTR must NULL-terminate the string.
+ _full : The function initializes the entire buffer.
+ _part : The function initializes part of the buffer, and explicitly indicates how much.
+
+ NullTerm: States if the present of a '\0' marks the end of valid elements in the buffer.
+ _z : A '\0' indicated the end of the buffer
+ _nz : The buffer may not be null terminated and a '\0' does not indicate the end of the
+ buffer.
+ Optional: Describes if the buffer itself is optional.
+
+ <> : The pointer to the buffer must not be NULL.
+ _opt : The pointer to the buffer might be NULL. It will be checked before being dereferenced.
+
+ Parameters: Gives explicit counts for the size and length of the buffer.
+
+ <> : There is no explicit count. Use when neither _ecount nor _bcount is used.
+ (size) : Only the buffer's total size is given. Use with _ecount or _bcount but not _part.
+ (size,length) : The buffer's total size and initialized length are given. Use with _ecount_part
+ and _bcount_part.
+
+ -------------------------------------------------------------------------------
+ Buffer Annotation Examples
+
+ LWSTDAPI_(BOOL) StrToIntExA(
+ LPCSTR pszString, -- No annotation required, const implies __in.
+ DWORD dwFlags,
+ __out int *piRet -- A pointer whose dereference will be filled in.
+ );
+
+ void MyPaintingFunction(
+ __in HWND hwndControl, -- An initialized read-only parameter.
+ __in_opt HDC hdcOptional, -- An initialized read-only parameter that might be NULL.
+ __inout IPropertyStore *ppsStore -- An initialized parameter that may be freely used
+ -- and modified.
+ );
+
+ LWSTDAPI_(BOOL) PathCompactPathExA(
+ __out_ecount(cchMax) LPSTR pszOut, -- A string buffer with cch elements that will
+ -- be NULL terminated on exit.
+ LPCSTR pszSrc, -- No annotation required, const implies __in.
+ UINT cchMax,
+ DWORD dwFlags
+ );
+
+ HRESULT SHLocalAllocBytes(
+ size_t cb,
+ __deref_bcount(cb) T **ppv -- A pointer whose dereference will be set to an
+ -- uninitialized buffer with cb bytes.
+ );
+
+ __inout_bcount_full(cb) : A buffer with cb elements that is fully initialized at
+ entry and exit, and may be written to by this function.
+
+ __out_ecount_part(count, *countOut) : A buffer with count elements that will be
+ partially initialized by this function. The function indicates how much it
+ initialized by setting *countOut.
+
+ -------------------------------------------------------------------------------
+ Advanced Annotations
+
+ Advanced annotations describe behavior that is not expressible with the regular
+ buffer macros. These may be used either to annotate buffer parameters that involve
+ complex or conditional behavior, or to enrich existing annotations with additional
+ information.
+
+ __success(expr) f :
+ <expr> indicates whether function f succeeded or not. If <expr> is true at exit,
+ all the function's guarantees (as given by other annotations) must hold. If <expr>
+ is false at exit, the caller should not expect any of the function's guarantees
+ to hold. If not used, the function must always satisfy its guarantees. Added
+ automatically to functions that indicate success in standard ways, such as by
+ returning an HRESULT.
+
+ __nullterminated p :
+ Pointer p is a buffer that may be read or written up to and including the first
+ NULL character or pointer. May be used on typedefs, which marks valid (properly
+ initialized) instances of that type as being NULL-terminated.
+
+ __nullnullterminated p :
+ Pointer p is a buffer that may be read or written up to and including the first
+ sequence of two NULL characters or pointers. May be used on typedefs, which marks
+ valid instances of that type as being double-NULL terminated.
+
+ __reserved v :
+ Value v must be 0/NULL, reserved for future use.
+
+ __checkReturn v :
+ Return value v must not be ignored by callers of this function.
+
+ __typefix(ctype) v :
+ Value v should be treated as an instance of ctype, rather than its declared type.
+
+ __override f :
+ Specify C#-style 'override' behaviour for overriding virtual methods.
+
+ __callback f :
+ Function f can be used as a function pointer.
+
+ __format_string p :
+ Pointer p is a string that contains % markers in the style of printf.
+
+ __blocksOn(resource) f :
+ Function f blocks on the resource 'resource'.
+
+ __fallthrough :
+ Annotates switch statement labels where fall-through is desired, to distinguish
+ from forgotten break statements.
+
+ -------------------------------------------------------------------------------
+ Advanced Annotation Examples
+
+ __success(return == TRUE) LWSTDAPI_(BOOL)
+ PathCanonicalizeA(__out_ecount(MAX_PATH) LPSTR pszBuf, LPCSTR pszPath) :
+ pszBuf is only guaranteed to be NULL-terminated when TRUE is returned.
+
+ typedef __nullterminated WCHAR* LPWSTR : Initialized LPWSTRs are NULL-terminated strings.
+
+ __out_ecount(cch) __typefix(LPWSTR) void *psz : psz is a buffer parameter which will be
+ a NULL-terminated WCHAR string at exit, and which initially contains cch WCHARs.
+
+ -------------------------------------------------------------------------------
+*/
+
+#pragma once
+
+#define __specstrings
+
+#ifdef __cplusplus
+#ifndef __nothrow
+# define __nothrow __declspec(nothrow)
+#endif
+extern "C" {
+#else
+#ifndef __nothrow
+# define __nothrow
+#endif
+#endif /* #ifdef __cplusplus */
+
+/*
+ -------------------------------------------------------------------------------
+ Helper Macro Definitions
+
+ These express behavior common to many of the high-level annotations.
+ DO NOT USE THESE IN YOUR CODE.
+ -------------------------------------------------------------------------------
+*/
+
+/*
+The helper annotations are only understood by the compiler version used by various
+defect detection tools. When the regular compiler is running, they are defined into
+nothing, and do not affect the compiled code.
+*/
+
+#if !defined(__midl) && defined(_PREFAST_)
+
+ /*
+ In the primitive __declspec("SAL_*") annotations "SAL" stands for Standard
+ Annotation Language. These __declspec("SAL_*") annotations are the
+ primitives the compiler understands and all high-level SpecString MACROs
+ will decompose into these primivates.
+ */
+
+ #define SPECSTRINGIZE( x ) #x
+
+ /*
+ __null p
+ __notnull p
+ __maybenull p
+
+ Annotates a pointer p. States that pointer p is null. Commonly used
+ in the negated form __notnull or the possibly null form __maybenull.
+ */
+
+ #define __null __declspec("SAL_null")
+ #define __notnull __declspec("SAL_notnull")
+ #define __maybenull __declspec("SAL_maybenull")
+
+ /*
+ __readonly l
+ __notreadonly l
+ __mabyereadonly l
+
+ Annotates a location l. States that location l is not modified after
+ this point. If the annotation is placed on the precondition state of
+ a function, the restriction only applies until the postcondition state
+ of the function. __maybereadonly states that the annotated location
+ may be modified, whereas __notreadonly states that a location must be
+ modified.
+ */
+
+ #define __readonly __declspec("SAL_readonly")
+ #define __notreadonly __declspec("SAL_notreadonly")
+ #define __maybereadonly __declspec("SAL_maybereadonly")
+
+ /*
+ __valid v
+ __notvalid v
+ __maybevalid v
+
+ Annotates any value v. States that the value satisfies all properties of
+ valid values of its type. For example, for a string buffer, valid means
+ that the buffer pointer is either NULL or points to a NULL-terminated string.
+ */
+
+ #define __valid __declspec("SAL_valid")
+ #define __notvalid __declspec("SAL_notvalid")
+ #define __maybevalid __declspec("SAL_maybevalid")
+
+ /*
+ __readableTo(extent) p
+
+ Annotates a buffer pointer p. If the buffer can be read, extent describes
+ how much of the buffer is readable. For a reader of the buffer, this is
+ an explicit permission to read up to that amount, rather than a restriction to
+ read only up to it.
+ */
+
+ #define __readableTo(extent) __declspec("SAL_readableTo("SPECSTRINGIZE(extent)")")
+
+ /*
+
+ __elem_readableTo(size)
+
+ Annotates a buffer pointer p as being readable to size elements.
+ */
+
+ #define __elem_readableTo(size) __declspec("SAL_readableTo(elementCount("SPECSTRINGIZE(size)"))")
+
+ /*
+ __byte_readableTo(size)
+
+ Annotates a buffer pointer p as being readable to size bytes.
+ */
+ #define __byte_readableTo(size) __declspec("SAL_readableTo(byteCount("SPECSTRINGIZE(size)"))")
+
+ /*
+ __writableTo(extent) p
+
+ Annotates a buffer pointer p. If the buffer can be modified, extent
+ describes how much of the buffer is writable (usually the allocation
+ size). For a writer of the buffer, this is an explicit permission to
+ write up to that amount, rather than a restriction to write only up to it.
+ */
+ #define __writableTo(size) __declspec("SAL_writableTo("SPECSTRINGIZE(size)")")
+
+ /*
+ __elem_writableTo(size)
+
+ Annotates a buffer pointer p as being writable to size elements.
+ */
+ #define __elem_writableTo(size) __declspec("SAL_writableTo(elementCount("SPECSTRINGIZE(size)"))")
+
+ /*
+ __byte_writableTo(size)
+
+ Annotates a buffer pointer p as being writable to size bytes.
+ */
+ #define __byte_writableTo(size) __declspec("SAL_writableTo(byteCount("SPECSTRINGIZE(size)"))")
+
+ /*
+ __deref p
+
+ Annotates a pointer p. The next annotation applies one dereference down
+ in the type. If readableTo(p, size) then the next annotation applies to
+ all elements *(p+i) for which i satisfies the size. If p is a pointer
+ to a struct, the next annotation applies to all fields of the struct.
+ */
+ #define __deref __declspec("SAL_deref")
+
+ /*
+ __pre __next_annotation
+
+ The next annotation applies in the precondition state
+ */
+ #define __pre __declspec("SAL_pre")
+
+ /*
+ __post __next_annotation
+
+ The next annotation applies in the postcondition state
+ */
+ #define __post __declspec("SAL_post")
+
+ /*
+ __precond(<expr>)
+
+ When <expr> is true, the next annotation applies in the precondition state
+ (currently not enabled)
+ */
+ #define __precond(expr) __pre
+
+ /*
+ __postcond(<expr>)
+
+ When <expr> is true, the next annotation applies in the postcondition state
+ (currently not enabled)
+ */
+ #define __postcond(expr) __post
+
+ /*
+ __exceptthat
+
+ Given a set of annotations Q containing __exceptthat maybeP, the effect of
+ the except clause is to erase any P or notP annotations (explicit or
+ implied) within Q at the same level of dereferencing that the except
+ clause appears, and to replace it with maybeP.
+
+ Example 1: __valid __exceptthat __maybenull on a pointer p means that the
+ pointer may be null, and is otherwise valid, thus overriding
+ the implicit notnull annotation implied by __valid on
+ pointers.
+
+ Example 2: __valid __deref __exceptthat __maybenull on an int **p means
+ that p is not null (implied by valid), but the elements
+ pointed to by p could be null, and are otherwise valid.
+ */
+ #define __exceptthat __declspec("SAL_except")
+ #define __execeptthat __exceptthat
+
+ /*
+ _refparam
+
+ Added to all out parameter macros to indicate that they are all reference
+ parameters.
+ */
+ #define __refparam __deref __notreadonly
+
+ /*
+ __inner_*
+
+ Helper macros that directly correspond to certain high-level annotations.
+
+ */
+
+ /*
+ Macros to classify the entrypoints and indicate their category.
+
+ Pre-defined control point categories include: RPC, LPC, DeviceDriver, UserToKernel, ISAPI, COM.
+
+ */
+ #define __inner_control_entrypoint(category) __declspec("SAL_entrypoint(controlEntry, "SPECSTRINGIZE(category)")")
+
+ /*
+ Pre-defined data entry point categories include: Registry, File, Network.
+ */
+ #define __inner_data_entrypoint(category) __declspec("SAL_entrypoint(dataEntry, "SPECSTRINGIZE(category)")")
+
+ #define __inner_success(expr) __declspec("SAL_success("SPECSTRINGIZE(expr)")")
+ #define __inner_checkReturn __declspec("SAL_checkReturn")
+ #define __inner_typefix(ctype) __declspec("SAL_typefix("SPECSTRINGIZE(ctype)")")
+ #define __inner_override __declspec("__override")
+ #define __inner_callback __declspec("__callback")
+ #define __inner_blocksOn(resource) __declspec("SAL_blocksOn("SPECSTRINGIZE(resource)")")
+ #define __inner_fallthrough_dec __inline __nothrow void __FallThrough() {}
+ #define __inner_fallthrough __FallThrough();
+
+#else
+ #define __null
+ #define __notnull
+ #define __maybenull
+ #define __readonly
+ #define __notreadonly
+ #define __maybereadonly
+ #define __valid
+ #define __notvalid
+ #define __maybevalid
+ #define __readableTo(extent)
+ #define __elem_readableTo(size)
+ #define __byte_readableTo(size)
+ #define __writableTo(size)
+ #define __elem_writableTo(size)
+ #define __byte_writableTo(size)
+ #define __deref
+ #define __pre
+ #define __post
+ #define __precond(expr)
+ #define __postcond(expr)
+ #define __exceptthat
+ #define __execeptthat
+ #define __inner_success(expr)
+ #define __inner_checkReturn
+ #define __inner_typefix(ctype)
+ #define __inner_override
+ #define __inner_callback
+ #define __inner_blocksOn(resource)
+ #define __inner_fallthrough_dec
+ #define __inner_fallthrough
+ #define __refparam
+ #define __inner_control_entrypoint(category)
+ #define __inner_data_entrypoint(category)
+#endif /* #if !defined(__midl) && defined(_PREFAST_) */
+
+/*
+-------------------------------------------------------------------------------
+Buffer Annotation Definitions
+
+Any of these may be used to directly annotate functions, but only one should
+be used for each parameter. To determine which annotation to use for a given
+buffer, use the table in the buffer annotations section.
+-------------------------------------------------------------------------------
+*/
+
+#define __ecount(size) __notnull __elem_writableTo(size)
+#define __bcount(size) __notnull __byte_writableTo(size)
+#define __in __pre __valid __pre __deref __readonly
+#define __in_ecount(size) __in __pre __elem_readableTo(size)
+#define __in_bcount(size) __in __pre __byte_readableTo(size)
+#define __in_z __in __pre __nullterminated
+#define __in_ecount_z(size) __in_ecount(size) __pre __nullterminated
+#define __in_bcount_z(size) __in_bcount(size) __pre __nullterminated
+#define __in_nz __in
+#define __in_ecount_nz(size) __in_ecount(size)
+#define __in_bcount_nz(size) __in_bcount(size)
+#define __out __ecount(1) __post __valid __refparam
+#define __out_ecount(size) __ecount(size) __post __valid __refparam
+#define __out_bcount(size) __bcount(size) __post __valid __refparam
+#define __out_ecount_part(size,length) __out_ecount(size) __post __elem_readableTo(length)
+#define __out_bcount_part(size,length) __out_bcount(size) __post __byte_readableTo(length)
+#define __out_ecount_full(size) __out_ecount_part(size,size)
+#define __out_bcount_full(size) __out_bcount_part(size,size)
+#define __out_z __post __valid __refparam __post __nullterminated
+#define __out_z_opt __post __valid __refparam __post __nullterminated __exceptthat __maybenull
+#define __out_ecount_z(size) __ecount(size) __post __valid __refparam __post __nullterminated
+#define __out_bcount_z(size) __bcount(size) __post __valid __refparam __post __nullterminated
+#define __out_ecount_part_z(size,length) __out_ecount_part(size,length) __post __nullterminated
+#define __out_bcount_part_z(size,length) __out_bcount_part(size,length) __post __nullterminated
+#define __out_ecount_full_z(size) __out_ecount_full(size) __post __nullterminated
+#define __out_bcount_full_z(size) __out_bcount_full(size) __post __nullterminated
+#define __out_nz __post __valid __refparam __post
+#define __out_nz_opt __post __valid __refparam __post __exceptthat __maybenull
+#define __out_ecount_nz(size) __ecount(size) __post __valid __refparam
+#define __out_bcount_nz(size) __bcount(size) __post __valid __refparam
+#define __inout __pre __valid __post __valid __refparam
+#define __inout_ecount(size) __out_ecount(size) __pre __valid
+#define __inout_bcount(size) __out_bcount(size) __pre __valid
+#define __inout_ecount_part(size,length) __out_ecount_part(size,length) __pre __valid __pre __elem_readableTo(length)
+#define __inout_bcount_part(size,length) __out_bcount_part(size,length) __pre __valid __pre __byte_readableTo(length)
+#define __inout_ecount_full(size) __inout_ecount_part(size,size)
+#define __inout_bcount_full(size) __inout_bcount_part(size,size)
+#define __inout_z __inout __pre __nullterminated __post __nullterminated
+#define __inout_ecount_z(size) __inout_ecount(size) __pre __nullterminated __post __nullterminated
+#define __inout_bcount_z(size) __inout_bcount(size) __pre __nullterminated __post __nullterminated
+#define __inout_nz __inout
+#define __inout_ecount_nz(size) __inout_ecount(size)
+#define __inout_bcount_nz(size) __inout_bcount(size)
+#define __ecount_opt(size) __ecount(size) __exceptthat __maybenull
+#define __bcount_opt(size) __bcount(size) __exceptthat __maybenull
+#define __in_opt __in __exceptthat __maybenull
+#define __in_ecount_opt(size) __in_ecount(size) __exceptthat __maybenull
+#define __in_bcount_opt(size) __in_bcount(size) __exceptthat __maybenull
+#define __in_z_opt __in_opt __pre __nullterminated
+#define __in_ecount_z_opt(size) __in_ecount_opt(size) __pre __nullterminated
+#define __in_bcount_z_opt(size) __in_bcount_opt(size) __pre __nullterminated
+#define __in_nz_opt __in_opt
+#define __in_ecount_nz_opt(size) __in_ecount_opt(size)
+#define __in_bcount_nz_opt(size) __in_bcount_opt(size)
+#define __out_opt __out __exceptthat __maybenull
+#define __out_ecount_opt(size) __out_ecount(size) __exceptthat __maybenull
+#define __out_bcount_opt(size) __out_bcount(size) __exceptthat __maybenull
+#define __out_ecount_part_opt(size,length) __out_ecount_part(size,length) __exceptthat __maybenull
+#define __out_bcount_part_opt(size,length) __out_bcount_part(size,length) __exceptthat __maybenull
+#define __out_ecount_full_opt(size) __out_ecount_full(size) __exceptthat __maybenull
+#define __out_bcount_full_opt(size) __out_bcount_full(size) __exceptthat __maybenull
+#define __out_ecount_z_opt(size) __out_ecount_opt(size) __post __nullterminated
+#define __out_bcount_z_opt(size) __out_bcount_opt(size) __post __nullterminated
+#define __out_ecount_part_z_opt(size,length) __out_ecount_part_opt(size,length) __post __nullterminated
+#define __out_bcount_part_z_opt(size,length) __out_bcount_part_opt(size,length) __post __nullterminated
+#define __out_ecount_full_z_opt(size) __out_ecount_full_opt(size) __post __nullterminated
+#define __out_bcount_full_z_opt(size) __out_bcount_full_opt(size) __post __nullterminated
+#define __out_ecount_nz_opt(size) __out_ecount_opt(size) __post __nullterminated
+#define __out_bcount_nz_opt(size) __out_bcount_opt(size) __post __nullterminated
+#define __inout_opt __inout __exceptthat __maybenull
+#define __inout_ecount_opt(size) __inout_ecount(size) __exceptthat __maybenull
+#define __inout_bcount_opt(size) __inout_bcount(size) __exceptthat __maybenull
+#define __inout_ecount_part_opt(size,length) __inout_ecount_part(size,length) __exceptthat __maybenull
+#define __inout_bcount_part_opt(size,length) __inout_bcount_part(size,length) __exceptthat __maybenull
+#define __inout_ecount_full_opt(size) __inout_ecount_full(size) __exceptthat __maybenull
+#define __inout_bcount_full_opt(size) __inout_bcount_full(size) __exceptthat __maybenull
+#define __inout_z_opt __inout_opt __pre __nullterminated __post __nullterminated
+#define __inout_ecount_z_opt(size) __inout_ecount_opt(size) __pre __nullterminated __post __nullterminated
+#define __inout_ecount_z_opt(size) __inout_ecount_opt(size) __pre __nullterminated __post __nullterminated
+#define __inout_bcount_z_opt(size) __inout_bcount_opt(size)
+#define __inout_nz_opt __inout_opt
+#define __inout_ecount_nz_opt(size) __inout_ecount_opt(size)
+#define __inout_bcount_nz_opt(size) __inout_bcount_opt(size)
+#define __deref_ecount(size) __ecount(1) __post __elem_readableTo(1) __post __deref __notnull __post __deref __elem_writableTo(size)
+#define __deref_bcount(size) __ecount(1) __post __elem_readableTo(1) __post __deref __notnull __post __deref __byte_writableTo(size)
+#define __deref_out __deref_ecount(1) __post __deref __valid __refparam
+#define __deref_out_ecount(size) __deref_ecount(size) __post __deref __valid __refparam
+#define __deref_out_bcount(size) __deref_bcount(size) __post __deref __valid __refparam
+#define __deref_out_ecount_part(size,length) __deref_out_ecount(size) __post __deref __elem_readableTo(length)
+#define __deref_out_bcount_part(size,length) __deref_out_bcount(size) __post __deref __byte_readableTo(length)
+#define __deref_out_ecount_full(size) __deref_out_ecount_part(size,size)
+#define __deref_out_bcount_full(size) __deref_out_bcount_part(size,size)
+#define __deref_out_z __post __deref __valid __refparam __post __deref __nullterminated
+#define __deref_out_ecount_z(size) __deref_out_ecount(size) __post __deref __nullterminated
+#define __deref_out_bcount_z(size) __deref_out_ecount(size) __post __deref __nullterminated
+#define __deref_out_nz __deref_out
+#define __deref_out_ecount_nz(size) __deref_out_ecount(size)
+#define __deref_out_bcount_nz(size) __deref_out_ecount(size)
+#define __deref_inout __notnull __elem_readableTo(1) __pre __deref __valid __post __deref __valid __refparam
+#define __deref_inout_z __deref_inout __pre __deref __nullterminated __post __deref __nullterminated
+#define __deref_inout_ecount(size) __deref_inout __pre __deref __elem_writableTo(size) __post __deref __elem_writableTo(size)
+#define __deref_inout_bcount(size) __deref_inout __pre __deref __byte_writableTo(size) __post __deref __byte_writableTo(size)
+#define __deref_inout_ecount_part(size,length) __deref_inout_ecount(size) __pre __deref __elem_readableTo(length) __post __deref __elem_readableTo(length)
+#define __deref_inout_bcount_part(size,length) __deref_inout_bcount(size) __pre __deref __byte_readableTo(length) __post __deref __byte_readableTo(length)
+#define __deref_inout_ecount_full(size) __deref_inout_ecount_part(size,size)
+#define __deref_inout_bcount_full(size) __deref_inout_bcount_part(size,size)
+#define __deref_inout_z __deref_inout __pre __deref __nullterminated __post __deref __nullterminated
+#define __deref_inout_ecount_z(size) __deref_inout_ecount(size) __pre __deref __nullterminated __post __deref __nullterminated
+#define __deref_inout_bcount_z(size) __deref_inout_ecount(size) __pre __deref __nullterminated __post __deref __nullterminated
+#define __deref_inout_nz __deref_inout
+#define __deref_inout_ecount_nz(size) __deref_inout_ecount(size)
+#define __deref_inout_bcount_nz(size) __deref_inout_ecount(size)
+#define __deref_ecount_opt(size) __deref_ecount(size) __post __deref __exceptthat __maybenull
+#define __deref_bcount_opt(size) __deref_bcount(size) __post __deref __exceptthat __maybenull
+#define __deref_out_opt __deref_out __post __deref __exceptthat __maybenull
+#define __deref_out_ecount_opt(size) __deref_out_ecount(size) __post __deref __exceptthat __maybenull
+#define __deref_out_bcount_opt(size) __deref_out_bcount(size) __post __deref __exceptthat __maybenull
+#define __deref_out_ecount_part_opt(size,length) __deref_out_ecount_part(size,length) __post __deref __exceptthat __maybenull
+#define __deref_out_bcount_part_opt(size,length) __deref_out_bcount_part(size,length) __post __deref __exceptthat __maybenull
+#define __deref_out_ecount_full_opt(size) __deref_out_ecount_full(size) __post __deref __exceptthat __maybenull
+#define __deref_out_bcount_full_opt(size) __deref_out_bcount_full(size) __post __deref __exceptthat __maybenull
+#define __deref_out_z_opt __post __deref __valid __refparam __execeptthat __maybenull __post __deref __nullterminated
+#define __deref_out_ecount_z_opt(size) __deref_out_ecount_opt(size) __post __deref __nullterminated
+#define __deref_out_bcount_z_opt(size) __deref_out_bcount_opt(size) __post __deref __nullterminated
+#define __deref_out_nz_opt __deref_out_opt
+#define __deref_out_ecount_nz_opt(size) __deref_out_ecount_opt(size)
+#define __deref_out_bcount_nz_opt(size) __deref_out_bcount_opt(size)
+#define __deref_inout_opt __deref_inout __pre __deref __exceptthat __maybenull __post __deref __exceptthat __maybenull
+#define __deref_inout_ecount_opt(size) __deref_inout_ecount(size) __pre __deref __exceptthat __maybenull __post __deref __exceptthat __maybenull
+#define __deref_inout_bcount_opt(size) __deref_inout_bcount(size) __pre __deref __exceptthat __maybenull __post __deref __exceptthat __maybenull
+#define __deref_inout_ecount_part_opt(size,length) __deref_inout_ecount_part(size,length) __pre __deref __exceptthat __maybenull __post __deref __exceptthat __maybenull
+#define __deref_inout_bcount_part_opt(size,length) __deref_inout_bcount_part(size,length) __pre __deref __exceptthat __maybenull __post __deref __exceptthat __maybenull
+#define __deref_inout_ecount_full_opt(size) __deref_inout_ecount_full(size) __pre __deref __exceptthat __maybenull __post __deref __exceptthat __maybenull
+#define __deref_inout_bcount_full_opt(size) __deref_inout_bcount_full(size) __pre __deref __exceptthat __maybenull __post __deref __exceptthat __maybenull
+#define __deref_inout_z_opt __deref_inout_opt __pre __deref __nullterminated __post __deref __nullterminated
+#define __deref_inout_ecount_z_opt(size) __deref_inout_ecount_opt(size) __pre __deref __nullterminated __post __deref __nullterminated
+#define __deref_inout_bcount_z_opt(size) __deref_inout_bcount_opt(size) __pre __deref __nullterminated __post __deref __nullterminated
+#define __deref_inout_nz_opt __deref_inout_opt
+#define __deref_inout_ecount_nz_opt(size) __deref_inout_ecount_opt(size)
+#define __deref_inout_bcount_nz_opt(size) __deref_inout_bcount_opt(size)
+#define __deref_opt_ecount(size) __deref_ecount(size) __exceptthat __maybenull
+#define __deref_opt_bcount(size) __deref_bcount(size) __exceptthat __maybenull
+#define __deref_opt_out __deref_out __exceptthat __maybenull
+#define __deref_opt_out_z __deref_opt_out __post __deref __nullterminated
+#define __deref_opt_out_ecount(size) __deref_out_ecount(size) __exceptthat __maybenull
+#define __deref_opt_out_bcount(size) __deref_out_bcount(size) __exceptthat __maybenull
+#define __deref_opt_out_ecount_part(size,length) __deref_out_ecount_part(size,length) __exceptthat __maybenull
+#define __deref_opt_out_bcount_part(size,length) __deref_out_bcount_part(size,length) __exceptthat __maybenull
+#define __deref_opt_out_ecount_full(size) __deref_out_ecount_full(size) __exceptthat __maybenull
+#define __deref_opt_out_bcount_full(size) __deref_out_bcount_full(size) __exceptthat __maybenull
+#define __deref_opt_inout __deref_inout __exceptthat __maybenull
+#define __deref_opt_inout_ecount(size) __deref_inout_ecount(size) __exceptthat __maybenull
+#define __deref_opt_inout_bcount(size) __deref_inout_bcount(size) __exceptthat __maybenull
+#define __deref_opt_inout_ecount_part(size,length) __deref_inout_ecount_part(size,length) __exceptthat __maybenull
+#define __deref_opt_inout_bcount_part(size,length) __deref_inout_bcount_part(size,length) __exceptthat __maybenull
+#define __deref_opt_inout_ecount_full(size) __deref_inout_ecount_full(size) __exceptthat __maybenull
+#define __deref_opt_inout_bcount_full(size) __deref_inout_bcount_full(size) __exceptthat __maybenull
+#define __deref_opt_inout_z __deref_opt_inout __pre __deref __nullterminated __post __deref __nullterminated
+#define __deref_opt_inout_ecount_z(size) __deref_opt_inout_ecount(size) __pre __deref __nullterminated __post __deref __nullterminated
+#define __deref_opt_inout_bcount_z(size) __deref_opt_inout_bcount(size) __pre __deref __nullterminated __post __deref __nullterminated
+#define __deref_opt_inout_nz __deref_opt_inout
+#define __deref_opt_inout_ecount_nz(size) __deref_opt_inout_ecount(size)
+#define __deref_opt_inout_bcount_nz(size) __deref_opt_inout_bcount(size)
+#define __deref_opt_ecount_opt(size) __deref_ecount_opt(size) __exceptthat __maybenull
+#define __deref_opt_bcount_opt(size) __deref_bcount_opt(size) __exceptthat __maybenull
+#define __deref_opt_out_opt __deref_out_opt __exceptthat __maybenull
+#define __deref_opt_out_ecount_opt(size) __deref_out_ecount_opt(size) __exceptthat __maybenull
+#define __deref_opt_out_bcount_opt(size) __deref_out_bcount_opt(size) __exceptthat __maybenull
+#define __deref_opt_out_ecount_part_opt(size,length) __deref_out_ecount_part_opt(size,length) __exceptthat __maybenull
+#define __deref_opt_out_bcount_part_opt(size,length) __deref_out_bcount_part_opt(size,length) __exceptthat __maybenull
+#define __deref_opt_out_ecount_full_opt(size) __deref_out_ecount_full_opt(size) __exceptthat __maybenull
+#define __deref_opt_out_bcount_full_opt(size) __deref_out_bcount_full_opt(size) __exceptthat __maybenull
+#define __deref_opt_out_z_opt __post __deref __valid __refparam __exceptthat __maybenull __pre __deref __exceptthat __maybenull __post __deref __exceptthat __maybenull __post __deref __nullterminated
+#define __deref_opt_out_ecount_z_opt(size) __deref_opt_out_ecount_opt(size) __post __deref __nullterminated
+#define __deref_opt_out_bcount_z_opt(size) __deref_opt_out_bcount_opt(size) __post __deref __nullterminated
+#define __deref_opt_out_nz_opt __deref_opt_out_opt
+#define __deref_opt_out_ecount_nz_opt(size) __deref_opt_out_ecount_opt(size)
+#define __deref_opt_out_bcount_nz_opt(size) __deref_opt_out_bcount_opt(size)
+#define __deref_opt_inout_opt __deref_inout_opt __exceptthat __maybenull
+#define __deref_opt_inout_ecount_opt(size) __deref_inout_ecount_opt(size) __exceptthat __maybenull
+#define __deref_opt_inout_bcount_opt(size) __deref_inout_bcount_opt(size) __exceptthat __maybenull
+#define __deref_opt_inout_ecount_part_opt(size,length) __deref_inout_ecount_part_opt(size,length) __exceptthat __maybenull
+#define __deref_opt_inout_bcount_part_opt(size,length) __deref_inout_bcount_part_opt(size,length) __exceptthat __maybenull
+#define __deref_opt_inout_ecount_full_opt(size) __deref_inout_ecount_full_opt(size) __exceptthat __maybenull
+#define __deref_opt_inout_bcount_full_opt(size) __deref_inout_bcount_full_opt(size) __exceptthat __maybenull
+#define __deref_opt_inout_z_opt __deref_opt_inout_opt __pre __deref __nullterminated __post __deref __nullterminated
+#define __deref_opt_inout_ecount_z_opt(size) __deref_opt_inout_ecount_opt(size) __pre __deref __nullterminated __post __deref __nullterminated
+#define __deref_opt_inout_bcount_z_opt(size) __deref_opt_inout_bcount_opt(size) __pre __deref __nullterminated __post __deref __nullterminated
+#define __deref_opt_inout_nz_opt __deref_opt_inout_opt
+#define __deref_opt_inout_ecount_nz_opt(size) __deref_opt_inout_ecount_opt(size)
+#define __deref_opt_inout_bcount_nz_opt(size) __deref_opt_inout_bcount_opt(size)
+
+/*
+-------------------------------------------------------------------------------
+Advanced Annotation Definitions
+
+Any of these may be used to directly annotate functions, and may be used in
+combination with each other or with regular buffer macros. For an explanation
+of each annotation, see the advanced annotations section.
+-------------------------------------------------------------------------------
+*/
+
+#define __success(expr) __inner_success(expr)
+#define __nullterminated __readableTo(sentinel(0))
+#define __nullnullterminated
+#define __reserved __pre __null
+#define __checkReturn __inner_checkReturn
+#define __typefix(ctype) __inner_typefix(ctype)
+#define __override __inner_override
+#define __callback __inner_callback
+#define __format_string
+#define __blocksOn(resource) __inner_blocksOn(resource)
+#define __control_entrypoint(category) __inner_control_entrypoint(category)
+#define __data_entrypoint(category) __inner_data_entrypoint(category)
+
+#ifndef __fallthrough
+ __inner_fallthrough_dec
+ #define __fallthrough __inner_fallthrough
+#endif
+
+#ifndef __analysis_assume
+#ifdef _PREFAST_
+#define __analysis_assume(expr) __assume(expr)
+#else
+#define __analysis_assume(expr)
+#endif
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+
diff --git a/core/src/fxge/Microsoft SDK/include/specstrings.h b/core/src/fxge/Microsoft SDK/include/specstrings.h
index 00cdd332ec..27a589a985 100644
--- a/core/src/fxge/Microsoft SDK/include/specstrings.h
+++ b/core/src/fxge/Microsoft SDK/include/specstrings.h
@@ -1,978 +1,978 @@
-/***************************************************************\
-* *
-* SpecStrings.h - markers for documenting the semantics of APIs *
-* *
-* Version 1.0 *
-* *
-* Copyright (c) Microsoft Corporation. All rights reserved. *
-* *
-\***************************************************************/
-
-// @@BEGIN_DDKSPLIT
-
-// -------------------------------------------------------------------------------
-// Introduction
-//
-// SpecStrings.h provides a set of annotations to describe how a function uses its
-// parameters - the assumptions it makes about them, and the guarantees it makes
-// upon finishing.
-//
-// Annotations may be placed before either a function parameter's type or its return
-// type, and describe the function's behavior regarding the parameter or return value.
-// There are two classes of annotations: buffer annotations and advanced annotations.
-// Buffer annotations describe how functions use their pointer parameters, and
-// advanced annotations either describe complex/unusual buffer behavior, or provide
-// additional information about a parameter that is not otherwise expressible.
-//
-// -------------------------------------------------------------------------------
-// Buffer Annotations
-//
-// The most important annotations in SpecStrings.h provide a consistent way to annotate
-// buffer parameters or return values for a function. Each of these annotations describes
-// a single buffer (which could be a string, a fixed-length or variable-length array,
-// or just a pointer) that the function interacts with: where it is, how large it is,
-// how much is initialized, and what the function does with it.
-//
-// The appropriate macro for a given buffer can be constructed using the table below.
-// Just pick the appropriate values from each category, and combine them together
-// with a leading underscore. Some combinations of values do not make sense as buffer
-// annotations. Only meaningful annotations can be added to your code; for a list of
-// these, see the buffer annotation definitions section.
-//
-// Only a single buffer annotation should be used for each parameter.
-//
-// |------------|------------|---------|--------|----------|---------------|
-// | Level | Usage | Size | Output | Optional | Parameters |
-// |------------|------------|---------|--------|----------|---------------|
-// | <> | <> | <> | <> | <> | <> |
-// | _deref | _in | _ecount | _full | _opt | (size) |
-// | _deref_opt | _out | _bcount | _part | | (size,length) |
-// | | _inout | | | | |
-// | | | | | | |
-// |------------|------------|---------|--------|----------|---------------|
-//
-// Level: Describes the buffer pointer's level of indirection from the parameter or
-// return value 'p'.
-//
-// <> : p is the buffer pointer.
-// _deref : *p is the buffer pointer. p must not be NULL.
-// _deref_opt : *p may be the buffer pointer. p may be NULL, in which case the rest of
-// the annotation is ignored.
-//
-// Usage: Describes how the function uses the buffer.
-//
-// <> : The buffer is not accessed. If used on the return value or with _deref, the
-// function will provide the buffer, and it will be uninitialized at exit.
-// Otherwise, the caller must provide the buffer. This should only be used
-// for alloc and free functions.
-// _in : The function will only read from the buffer. The caller must provide the
-// buffer and initialize it.
-// _out : The function will only write to the buffer. If used on the return value or
-// with _deref, the function will provide the buffer and initialize it.
-// Otherwise, the caller must provide the buffer, and the function will
-// initialize it.
-// _inout : The function may freely read from and write to the buffer. The caller must
-// provide the buffer and initialize it. If used with _deref, the buffer may
-// be reallocated by the function.
-//
-// Size: Describes the total size of the buffer. This may be less than the space actually
-// allocated for the buffer, in which case it describes the accessible amount.
-//
-// <> : No buffer size is given. If the type specifies the buffer size (such as
-// with LPSTR and LPWSTR), that amount is used. Otherwise, the buffer is one
-// element long. Must be used with _in, _out, or _inout.
-// _ecount : The buffer size is an explicit element count.
-// _bcount : The buffer size is an explicit byte count.
-//
-// Output: Describes how much of the buffer will be initialized by the function. For
-// _inout buffers, this also describes how much is initialized at entry. Omit this
-// category for _in buffers; they must be fully initialized by the caller.
-//
-// <> : The type specifies how much is initialized. For instance, a function initializing
-// an LPWSTR must NULL-terminate the string.
-// _full : The function initializes the entire buffer.
-// _part : The function initializes part of the buffer, and explicitly indicates how much.
-//
-// Optional: Describes if the buffer itself is optional.
-//
-// <> : The pointer to the buffer must not be NULL.
-// _opt : The pointer to the buffer might be NULL. It will be checked before being dereferenced.
-//
-// Parameters: Gives explicit counts for the size and length of the buffer.
-//
-// <> : There is no explicit count. Use when neither _ecount nor _bcount is used.
-// (size) : Only the buffer's total size is given. Use with _ecount or _bcount but not _part.
-// (size,length) : The buffer's total size and initialized length are given. Use with _ecount_part
-// and _bcount_part.
-//
-// -------------------------------------------------------------------------------
-// Buffer Annotation Examples
-//
-// LWSTDAPI_(BOOL) StrToIntExA(
-// LPCSTR pszString, // No annotation required, const implies __in.
-// DWORD dwFlags,
-// __out int *piRet // A pointer whose dereference will be filled in.
-// );
-//
-// void MyPaintingFunction(
-// __in HWND hwndControl, // An initialized read-only parameter.
-// __in_opt HDC hdcOptional, // An initialized read-only parameter that might be NULL.
-// __inout IPropertyStore *ppsStore // An initialized parameter that may be freely used
-// // and modified.
-// );
-//
-// LWSTDAPI_(BOOL) PathCompactPathExA(
-// __out_ecount(cchMax) LPSTR pszOut, // A string buffer with cch elements that will
-// // be NULL terminated on exit.
-// LPCSTR pszSrc, // No annotation required, const implies __in.
-// UINT cchMax,
-// DWORD dwFlags
-// );
-//
-// HRESULT SHLocalAllocBytes(
-// size_t cb,
-// __deref_bcount(cb) T **ppv // A pointer whose dereference will be set to an
-// // uninitialized buffer with cb bytes.
-// );
-//
-// __inout_bcount_full(cb) : A buffer with cb elements that is fully initialized at
-// entry and exit, and may be written to by this function.
-//
-// __out_ecount_part(count, *countOut) : A buffer with count elements that will be
-// partially initialized by this function. The function indicates how much it
-// initialized by setting *countOut.
-//
-// -------------------------------------------------------------------------------
-// Advanced Annotations
-//
-// Advanced annotations describe behavior that is not expressible with the regular
-// buffer macros. These may be used either to annotate buffer parameters that involve
-// complex or conditional behavior, or to enrich existing annotations with additional
-// information.
-//
-// __success(expr) f :
-// <expr> indicates whether function f succeeded or not. If <expr> is true at exit,
-// all the function's guarantees (as given by other annotations) must hold. If <expr>
-// is false at exit, the caller should not expect any of the function's guarantees
-// to hold. If not used, the function must always satisfy its guarantees. Added
-// automatically to functions that indicate success in standard ways, such as by
-// returning an HRESULT.
-//
-// __out_awcount(expr, size) p :
-// Pointer p is a buffer whose size may be given in either bytes or elements. If
-// <expr> is true, this acts like __out_bcount. If <expr> is false, this acts
-// like __out_ecount. This should only be used to annotate old APIs.
-//
-// __in_awcount(expr, size) p :
-// Pointer p is a buffer whose size may be given in either bytes or elements. If
-// <expr> is true, this acts like __in_bcount. If <expr> is false, this acts
-// like __in_ecount. This should only be used to annotate old APIs.
-//
-// __nullterminated p :
-// Pointer p is a buffer that may be read or written up to and including the first
-// NULL character or pointer. May be used on typedefs, which marks valid (properly
-// initialized) instances of that type as being NULL-terminated.
-//
-// __nullnullterminated p :
-// Pointer p is a buffer that may be read or written up to and including the first
-// sequence of two NULL characters or pointers. May be used on typedefs, which marks
-// valid instances of that type as being double-NULL terminated.
-//
-// __reserved v :
-// Value v must be 0/NULL, reserved for future use.
-//
-// __checkReturn v :
-// Return value v must not be ignored by callers of this function.
-//
-// __typefix(ctype) v :
-// Value v should be treated as an instance of ctype, rather than its declared type.
-//
-// __override f :
-// Specify C#-style 'override' behaviour for overriding virtual methods.
-//
-// __callback f :
-// Function f can be used as a function pointer.
-//
-// __format_string p :
-// Pointer p is a string that contains % markers in the style of printf.
-//
-// __blocksOn(resource) f :
-// Function f blocks on the resource 'resource'.
-//
-// __fallthrough :
-// Annotates switch statement labels where fall-through is desired, to distinguish
-// from forgotten break statements.
-//
-// -------------------------------------------------------------------------------
-// Advanced Annotation Examples
-//
-// __success(return == TRUE) LWSTDAPI_(BOOL)
-// PathCanonicalizeA(__out_ecount(MAX_PATH) LPSTR pszBuf, LPCSTR pszPath) :
-// pszBuf is only guaranteed to be NULL-terminated when TRUE is returned.
-//
-// typedef __nullterminated WCHAR* LPWSTR : Initialized LPWSTRs are NULL-terminated strings.
-//
-// __out_ecount(cch) __typefix(LPWSTR) void *psz : psz is a buffer parameter which will be
-// a NULL-terminated WCHAR string at exit, and which initially contains cch WCHARs.
-//
-// -------------------------------------------------------------------------------
-
-// @@END_DDKSPLIT
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // #if _MSC_VER > 1000
-
-#define __specstrings
-
-#ifdef __cplusplus
-#ifndef __nothrow
-# define __nothrow __declspec(nothrow)
-#endif
-extern "C" {
-#else
-#ifndef __nothrow
-# define __nothrow
-#endif
-#endif // #ifdef __cplusplus
-
-// @@BEGIN_DDKSPLIT
-
-// -------------------------------------------------------------------------------
-// Helper Macro Definitions
-//
-// These express behavior common to many of the high-level annotations.
-// DO NOT USE THESE IN YOUR CODE.
-// -------------------------------------------------------------------------------
-
-// The helper annotations are only understood by the compiler version used by various
-// defect detection tools. When the regular compiler is running, they are defined into
-// nothing, and do not affect the compiled code.
-#if (_MSC_VER >= 1000) && !defined(MIDL_PASS) && defined(_PREFAST_)
-
- // In the primitive __declspec("SAL_*") annotations "SAL" stands for Standard
- // Annotation Language. These __declspec("SAL_*") annotations are the
- // primitives the compiler understands and all high-level SpecString MACROs
- // will decompose into these primivates.
-
- #define SPECSTRINGIZE( x ) #x
-
- //
- // __null p
- // __notnull p
- // __maybenull p
- //
- // Annotates a pointer p. States that pointer p is null. Commonly used
- // in the negated form __notnull or the possibly null form __maybenull.
- //
- #define __null __declspec("SAL_null")
- #define __notnull __declspec("SAL_notnull")
- #define __maybenull __declspec("SAL_maybenull")
-
- //
- // __readonly l
- // __notreadonly l
- // __mabyereadonly l
- //
- // Annotates a location l. States that location l is not modified after
- // this point. If the annotation is placed on the precondition state of
- // a function, the restriction only applies until the postcondition state
- // of the function. __maybereadonly states that the annotated location
- // may be modified, whereas __notreadonly states that a location must be
- // modified.
- //
- #define __readonly __declspec("SAL_readonly")
- #define __notreadonly __declspec("SAL_notreadonly")
- #define __maybereadonly __declspec("SAL_maybereadonly")
-
- //
- // __valid v
- // __notvalid v
- // __maybevalid v
- //
- // Annotates any value v. States that the value satisfies all properties of
- // valid values of its type. For example, for a string buffer, valid means
- // that the buffer pointer is either NULL or points to a NULL-terminated string.
- //
- #define __valid __declspec("SAL_valid")
- #define __notvalid __declspec("SAL_notvalid")
- #define __maybevalid __declspec("SAL_maybevalid")
-
- //
- // __readableTo(extent) p
- //
- // Annotates a buffer pointer p. If the buffer can be read, extent describes
- // how much of the buffer is readable. For a reader of the buffer, this is
- // an explicit permission to read up to that amount, rather than a restriction to
- // read only up to it.
- //
- #define __readableTo(extent) __declspec("SAL_readableTo("SPECSTRINGIZE(extent)")")
-
- //
- // __elem_readableTo(size)
- //
- // Annotates a buffer pointer p as being readable to size elements.
- //
- #define __elem_readableTo(size) __declspec("SAL_readableTo(elementCount("SPECSTRINGIZE(size)"))")
-
- //
- // __byte_readableTo(size)
- //
- // Annotates a buffer pointer p as being readable to size bytes.
- //
- #define __byte_readableTo(size) __declspec("SAL_readableTo(byteCount("SPECSTRINGIZE(size)"))")
-
- //
- // __writableTo(extent) p
- //
- // Annotates a buffer pointer p. If the buffer can be modified, extent
- // describes how much of the buffer is writable (usually the allocation
- // size). For a writer of the buffer, this is an explicit permission to
- // write up to that amount, rather than a restriction to write only up to it.
- //
- #define __writableTo(size) __declspec("SAL_writableTo("SPECSTRINGIZE(size)")")
-
- //
- // __elem_writableTo(size)
- //
- // Annotates a buffer pointer p as being writable to size elements.
- //
- #define __elem_writableTo(size) __declspec("SAL_writableTo(elementCount("SPECSTRINGIZE(size)"))")
-
- //
- // __byte_writableTo(size)
- //
- // Annotates a buffer pointer p as being writable to size bytes.
- //
- #define __byte_writableTo(size) __declspec("SAL_writableTo(byteCount("SPECSTRINGIZE(size)"))")
-
- //
- // __deref p
- //
- // Annotates a pointer p. The next annotation applies one dereference down
- // in the type. If readableTo(p, size) then the next annotation applies to
- // all elements *(p+i) for which i satisfies the size. If p is a pointer
- // to a struct, the next annotation applies to all fields of the struct.
- //
- #define __deref __declspec("SAL_deref")
-
- //
- // __pre __next_annotation
- //
- // The next annotation applies in the precondition state
- //
- #define __pre __declspec("SAL_pre")
-
- //
- // __post __next_annotation
- //
- // The next annotation applies in the postcondition state
- //
- #define __post __declspec("SAL_post")
-
- //
- // __precond(<expr>)
- //
- // When <expr> is true, the next annotation applies in the precondition state
- // (currently not enabled)
- //
- #define __precond(expr) __pre
-
- //
- // __postcond(<expr>)
- //
- // When <expr> is true, the next annotation applies in the postcondition state
- // (currently not enabled)
- //
- #define __postcond(expr) __post
-
- //
- // __exceptthat
- //
- // Given a set of annotations Q containing __exceptthat maybeP, the effect of
- // the except clause is to erase any P or notP annotations (explicit or
- // implied) within Q at the same level of dereferencing that the except
- // clause appears, and to replace it with maybeP.
- //
- // Example 1: __valid __exceptthat __maybenull on a pointer p means that the
- // pointer may be null, and is otherwise valid, thus overriding
- // the implicit notnull annotation implied by __valid on
- // pointers.
- //
- // Example 2: __valid __deref __exceptthat __maybenull on an int **p means
- // that p is not null (implied by valid), but the elements
- // pointed to by p could be null, and are otherwise valid.
- //
- #define __exceptthat __declspec("SAL_except")
-
- //
- // _refparam
- //
- // Added to all out parameter macros to indicate that they are all reference
- // parameters.
- //
- #define __refparam __deref __notreadonly
-
- //
- // __inner_*
- //
- // Helper macros that directly correspond to certain high-level annotations.
- //
- //
-
- // Macros to classify the entrypoints and indicate their category.
- //
- //
- // Pre-defined control point categories include: RPC, LPC, DeviceDriver, UserToKernel, ISAPI, COM.
- //
- #define __inner_control_entrypoint(category) __declspec("SAL_entrypoint(controlEntry, "SPECSTRINGIZE(category)")")
-
- //
- // Pre-defined data entry point categories include: Registry, File, Network.
- //
- #define __inner_data_entrypoint(category) __declspec("SAL_entrypoint(dataEntry, "SPECSTRINGIZE(category)")")
-
- #define __inner_success(expr) __declspec("SAL_success("SPECSTRINGIZE(expr)")")
- #define __inner_checkReturn __declspec("SAL_checkReturn")
- #define __inner_typefix(ctype) __declspec("SAL_typefix("SPECSTRINGIZE(ctype)")")
- #define __inner_override __declspec("__override")
- #define __inner_callback __declspec("__callback")
- #define __inner_blocksOn(resource) __declspec("SAL_blocksOn("SPECSTRINGIZE(resource)")")
- #define __inner_fallthrough_dec __inline __nothrow void __FallThrough() {}
- #define __inner_fallthrough __FallThrough();
-
-#else
-
-// @@END_DDKSPLIT
-
-#ifndef __null
- #define __null
-#endif
-#ifndef __notnull
- #define __notnull
-#endif
-#ifndef __maybenull
- #define __maybenull
-#endif
-#ifndef __readonly
- #define __readonly
-#endif
-#ifndef __notreadonly
- #define __notreadonly
-#endif
-#ifndef __maybereadonly
- #define __maybereadonly
-#endif
-#ifndef __valid
- #define __valid
-#endif
-#ifndef __notvalid
- #define __notvalid
-#endif
-#ifndef __maybevalid
- #define __maybevalid
-#endif
-#ifndef __readableTo
- #define __readableTo(extent)
-#endif
-#ifndef __elem_readableTo
- #define __elem_readableTo(size)
-#endif
-#ifndef __byte_readableTo
- #define __byte_readableTo(size)
-#endif
-#ifndef __writableTo
- #define __writableTo(size)
-#endif
-#ifndef __elem_writableTo
- #define __elem_writableTo(size)
-#endif
-#ifndef __byte_writableTo
- #define __byte_writableTo(size)
-#endif
-#ifndef __deref
- #define __deref
-#endif
-#ifndef __pre
- #define __pre
-#endif
-#ifndef __post
- #define __post
-#endif
-#ifndef __precond
- #define __precond(expr)
-#endif
-#ifndef __postcond
- #define __postcond(expr)
-#endif
-#ifndef __exceptthat
- #define __exceptthat
-#endif
-#ifndef __inner_success
- #define __inner_success(expr)
-#endif
-#ifndef __inner_checkReturn
- #define __inner_checkReturn
-#endif
-#ifndef __inner_typefix
- #define __inner_typefix(ctype)
-#endif
-#ifndef __inner_override
- #define __inner_override
-#endif
-#ifndef __inner_callback
- #define __inner_callback
-#endif
-#ifndef __inner_blocksOn
- #define __inner_blocksOn(resource)
-#endif
-#ifndef __inner_fallthrough_dec
- #define __inner_fallthrough_dec
-#endif
-#ifndef __inner_fallthrough
- #define __inner_fallthrough
-#endif
-#ifndef __refparam
- #define __refparam
-#endif
-#ifndef __inner_control_entrypoint
- #define __inner_control_entrypoint(category)
-#endif
-#ifndef __inner_data_entrypoint
- #define __inner_data_entrypoint(category)
-#endif
-// @@BEGIN_DDKSPLIT
-#endif // #if (_MSC_VER >= 1000) && !defined(MIDL_PASS) && defined(_PREFAST_)
-// -------------------------------------------------------------------------------
-// Buffer Annotation Definitions
-//
-// Any of these may be used to directly annotate functions, but only one should
-// be used for each parameter. To determine which annotation to use for a given
-// buffer, use the table in the buffer annotations section.
-// -------------------------------------------------------------------------------
-// @@END_DDKSPLIT
-
-#ifndef __ecount
-#define __ecount(size) __notnull __elem_writableTo(size)
-#endif
-#ifndef __bcount
-#define __bcount(size) __notnull __byte_writableTo(size)
-#endif
-#ifndef __in
-#define __in __pre __valid __pre __deref __readonly
-#endif
-#ifndef __in_ecount
-#define __in_ecount(size) __in __pre __elem_readableTo(size)
-#endif
-#ifndef __in_bcount
-#define __in_bcount(size) __in __pre __byte_readableTo(size)
-#endif
-#ifndef __out
-#define __out __ecount(1) __post __valid __refparam
-#endif
-#ifndef __out_ecount
-#define __out_ecount(size) __ecount(size) __post __valid __refparam
-#endif
-#ifndef __out_bcount
-#define __out_bcount(size) __bcount(size) __post __valid __refparam
-#endif
-#ifndef __out_ecount_part
-#define __out_ecount_part(size,length) __out_ecount(size) __post __elem_readableTo(length)
-#endif
-#ifndef __out_bcount_part
-#define __out_bcount_part(size,length) __out_bcount(size) __post __byte_readableTo(length)
-#endif
-#ifndef __out_ecount_full
-#define __out_ecount_full(size) __out_ecount_part(size,size)
-#endif
-#ifndef __out_bcount_full
-#define __out_bcount_full(size) __out_bcount_part(size,size)
-#endif
-#ifndef __inout
-#define __inout __pre __valid __post __valid __refparam
-#endif
-#ifndef __inout_ecount
-#define __inout_ecount(size) __out_ecount(size) __pre __valid
-#endif
-#ifndef __inout_bcount
-#define __inout_bcount(size) __out_bcount(size) __pre __valid
-#endif
-#ifndef __inout_ecount_part
-#define __inout_ecount_part(size,length) __out_ecount_part(size,length) __pre __valid __pre __elem_readableTo(length)
-#endif
-#ifndef __inout_bcount_part
-#define __inout_bcount_part(size,length) __out_bcount_part(size,length) __pre __valid __pre __byte_readableTo(length)
-#endif
-#ifndef __inout_ecount_full
-#define __inout_ecount_full(size) __inout_ecount_part(size,size)
-#endif
-#ifndef __inout_bcount_full
-#define __inout_bcount_full(size) __inout_bcount_part(size,size)
-#endif
-
-#ifndef __ecount_opt
-#define __ecount_opt(size) __ecount(size) __exceptthat __maybenull
-#endif
-#ifndef __bcount_opt
-#define __bcount_opt(size) __bcount(size) __exceptthat __maybenull
-#endif
-#ifndef __in_opt
-#define __in_opt __in __exceptthat __maybenull
-#endif
-#ifndef __in_ecount_opt
-#define __in_ecount_opt(size) __in_ecount(size) __exceptthat __maybenull
-#endif
-#ifndef __in_bcount_opt
-#define __in_bcount_opt(size) __in_bcount(size) __exceptthat __maybenull
-#endif
-#ifndef __out_opt
-#define __out_opt __out __exceptthat __maybenull
-#endif
-#ifndef __out_ecount_opt
-#define __out_ecount_opt(size) __out_ecount(size) __exceptthat __maybenull
-#endif
-#ifndef __out_bcount_opt
-#define __out_bcount_opt(size) __out_bcount(size) __exceptthat __maybenull
-#endif
-#ifndef __out_ecount_part_opt
-#define __out_ecount_part_opt(size,length) __out_ecount_part(size,length) __exceptthat __maybenull
-#endif
-#ifndef __out_bcount_part_opt
-#define __out_bcount_part_opt(size,length) __out_bcount_part(size,length) __exceptthat __maybenull
-#endif
-#ifndef __out_ecount_full_opt
-#define __out_ecount_full_opt(size) __out_ecount_full(size) __exceptthat __maybenull
-#endif
-#ifndef __out_bcount_full_opt
-#define __out_bcount_full_opt(size) __out_bcount_full(size) __exceptthat __maybenull
-#endif
-#ifndef __inout_opt
-#define __inout_opt __inout __exceptthat __maybenull
-#endif
-#ifndef __inout_ecount_opt
-#define __inout_ecount_opt(size) __inout_ecount(size) __exceptthat __maybenull
-#endif
-#ifndef __inout_bcount_opt
-#define __inout_bcount_opt(size) __inout_bcount(size) __exceptthat __maybenull
-#endif
-#ifndef __inout_ecount_part_opt
-#define __inout_ecount_part_opt(size,length) __inout_ecount_part(size,length) __exceptthat __maybenull
-#endif
-#ifndef __inout_bcount_part_opt
-#define __inout_bcount_part_opt(size,length) __inout_bcount_part(size,length) __exceptthat __maybenull
-#endif
-#ifndef __inout_ecount_full_opt
-#define __inout_ecount_full_opt(size) __inout_ecount_full(size) __exceptthat __maybenull
-#endif
-#ifndef __inout_bcount_full_opt
-#define __inout_bcount_full_opt(size) __inout_bcount_full(size) __exceptthat __maybenull
-#endif
-
-#ifndef __deref_ecount
-#define __deref_ecount(size) __ecount(1) __post __elem_readableTo(1) __post __deref __notnull __post __deref __elem_writableTo(size)
-#endif
-#ifndef __deref_bcount
-#define __deref_bcount(size) __ecount(1) __post __elem_readableTo(1) __post __deref __notnull __post __deref __byte_writableTo(size)
-#endif
-#ifndef __deref_in
-#define __deref_in __in __pre __deref __deref __readonly
-#endif
-#ifndef __deref_in_ecount
-#define __deref_in_ecount(size) __deref_in __pre __deref __elem_readableTo(size)
-#endif
-#ifndef __deref_in_bcount
-#define __deref_in_bcount(size) __deref_in __pre __deref __byte_readableTo(size)
-#endif
-#ifndef __deref_out
-#define __deref_out __deref_ecount(1) __post __deref __valid __refparam
-#endif
-#ifndef __deref_out_ecount
-#define __deref_out_ecount(size) __deref_ecount(size) __post __deref __valid __refparam
-#endif
-#ifndef __deref_out_bcount
-#define __deref_out_bcount(size) __deref_bcount(size) __post __deref __valid __refparam
-#endif
-#ifndef __deref_out_ecount_part
-#define __deref_out_ecount_part(size,length) __deref_out_ecount(size) __post __deref __elem_readableTo(length)
-#endif
-#ifndef __deref_out_bcount_part
-#define __deref_out_bcount_part(size,length) __deref_out_bcount(size) __post __deref __byte_readableTo(length)
-#endif
-#ifndef __deref_out_ecount_full
-#define __deref_out_ecount_full(size) __deref_out_ecount_part(size,size)
-#endif
-#ifndef __deref_out_bcount_full
-#define __deref_out_bcount_full(size) __deref_out_bcount_part(size,size)
-#endif
-#ifndef __deref_inout
-#define __deref_inout __notnull __elem_readableTo(1) __pre __deref __valid __post __deref __valid __refparam
-#endif
-#ifndef __deref_inout_ecount
-#define __deref_inout_ecount(size) __deref_inout __pre __deref __elem_writableTo(size) __post __deref __elem_writableTo(size)
-#endif
-#ifndef __deref_inout_bcount
-#define __deref_inout_bcount(size) __deref_inout __pre __deref __byte_writableTo(size) __post __deref __byte_writableTo(size)
-#endif
-#ifndef __deref_inout_ecount_part
-#define __deref_inout_ecount_part(size,length) __deref_inout_ecount(size) __pre __deref __elem_readableTo(length) __post __deref __elem_readableTo(length)
-#endif
-#ifndef __deref_inout_bcount_part
-#define __deref_inout_bcount_part(size,length) __deref_inout_bcount(size) __pre __deref __byte_readableTo(length) __post __deref __byte_readableTo(length)
-#endif
-#ifndef __deref_inout_ecount_full
-#define __deref_inout_ecount_full(size) __deref_inout_ecount_part(size,size)
-#endif
-#ifndef __deref_inout_bcount_full
-#define __deref_inout_bcount_full(size) __deref_inout_bcount_part(size,size)
-#endif
-
-#ifndef __deref_ecount_opt
-#define __deref_ecount_opt(size) __deref_ecount(size) __post __deref __exceptthat __maybenull
-#endif
-#ifndef __deref_bcount_opt
-#define __deref_bcount_opt(size) __deref_bcount(size) __post __deref __exceptthat __maybenull
-#endif
-#ifndef __deref_in_opt
-#define __deref_in_opt __deref_in __pre __deref __exceptthat __maybenull
-#endif
-#ifndef __deref_in_ecount_opt
-#define __deref_in_ecount_opt(size) __deref_in_ecount(size) __pre __deref __exceptthat __maybenull
-#endif
-#ifndef __deref_in_bcount_opt
-#define __deref_in_bcount_opt(size) __deref_in_bcount(size) __pre __deref __exceptthat __maybenull
-#endif
-#ifndef __deref_out_opt
-#define __deref_out_opt __deref_out __post __deref __exceptthat __maybenull
-#endif
-#ifndef __deref_out_ecount_opt
-#define __deref_out_ecount_opt(size) __deref_out_ecount(size) __post __deref __exceptthat __maybenull
-#endif
-#ifndef __deref_out_bcount_opt
-#define __deref_out_bcount_opt(size) __deref_out_bcount(size) __post __deref __exceptthat __maybenull
-#endif
-#ifndef __deref_out_ecount_part_opt
-#define __deref_out_ecount_part_opt(size,length) __deref_out_ecount_part(size,length) __post __deref __exceptthat __maybenull
-#endif
-#ifndef __deref_out_bcount_part_opt
-#define __deref_out_bcount_part_opt(size,length) __deref_out_bcount_part(size,length) __post __deref __exceptthat __maybenull
-#endif
-#ifndef __deref_out_ecount_full_opt
-#define __deref_out_ecount_full_opt(size) __deref_out_ecount_full(size) __post __deref __exceptthat __maybenull
-#endif
-#ifndef __deref_out_bcount_full_opt
-#define __deref_out_bcount_full_opt(size) __deref_out_bcount_full(size) __post __deref __exceptthat __maybenull
-#endif
-#ifndef __deref_inout_opt
-#define __deref_inout_opt __deref_inout __pre __deref __exceptthat __maybenull __post __deref __exceptthat __maybenull
-#endif
-#ifndef __deref_inout_ecount_opt
-#define __deref_inout_ecount_opt(size) __deref_inout_ecount(size) __pre __deref __exceptthat __maybenull __post __deref __exceptthat __maybenull
-#endif
-#ifndef __deref_inout_bcount_opt
-#define __deref_inout_bcount_opt(size) __deref_inout_bcount(size) __pre __deref __exceptthat __maybenull __post __deref __exceptthat __maybenull
-#endif
-#ifndef __deref_inout_ecount_part_opt
-#define __deref_inout_ecount_part_opt(size,length) __deref_inout_ecount_part(size,length) __pre __deref __exceptthat __maybenull __post __deref __exceptthat __maybenull
-#endif
-#ifndef __deref_inout_bcount_part_opt
-#define __deref_inout_bcount_part_opt(size,length) __deref_inout_bcount_part(size,length) __pre __deref __exceptthat __maybenull __post __deref __exceptthat __maybenull
-#endif
-#ifndef __deref_inout_ecount_full_opt
-#define __deref_inout_ecount_full_opt(size) __deref_inout_ecount_full(size) __pre __deref __exceptthat __maybenull __post __deref __exceptthat __maybenull
-#endif
-#ifndef __deref_inout_bcount_full_opt
-#define __deref_inout_bcount_full_opt(size) __deref_inout_bcount_full(size) __pre __deref __exceptthat __maybenull __post __deref __exceptthat __maybenull
-#endif
-
-#ifndef __deref_opt_ecount
-#define __deref_opt_ecount(size) __deref_ecount(size) __exceptthat __maybenull
-#endif
-#ifndef __deref_opt_bcount
-#define __deref_opt_bcount(size) __deref_bcount(size) __exceptthat __maybenull
-#endif
-#ifndef __deref_opt_in
-#define __deref_opt_in __deref_in __exceptthat __maybenull
-#endif
-#ifndef __deref_opt_in_ecount
-#define __deref_opt_in_ecount(size) __deref_in_ecount(size) __exceptthat __maybenull
-#endif
-#ifndef __deref_opt_in_bcount
-#define __deref_opt_in_bcount(size) __deref_in_bcount(size) __exceptthat __maybenull
-#endif
-#ifndef __deref_opt_out
-#define __deref_opt_out __deref_out __exceptthat __maybenull
-#endif
-#ifndef __deref_opt_out_ecount
-#define __deref_opt_out_ecount(size) __deref_out_ecount(size) __exceptthat __maybenull
-#endif
-#ifndef __deref_opt_out_bcount
-#define __deref_opt_out_bcount(size) __deref_out_bcount(size) __exceptthat __maybenull
-#endif
-#ifndef __deref_opt_out_ecount_part
-#define __deref_opt_out_ecount_part(size,length) __deref_out_ecount_part(size,length) __exceptthat __maybenull
-#endif
-#ifndef __deref_opt_out_bcount_part
-#define __deref_opt_out_bcount_part(size,length) __deref_out_bcount_part(size,length) __exceptthat __maybenull
-#endif
-#ifndef __deref_opt_out_ecount_full
-#define __deref_opt_out_ecount_full(size) __deref_out_ecount_full(size) __exceptthat __maybenull
-#endif
-#ifndef __deref_opt_out_bcount_full
-#define __deref_opt_out_bcount_full(size) __deref_out_bcount_full(size) __exceptthat __maybenull
-#endif
-#ifndef __deref_opt_inout
-#define __deref_opt_inout __deref_inout __exceptthat __maybenull
-#endif
-#ifndef __deref_opt_inout_ecount
-#define __deref_opt_inout_ecount(size) __deref_inout_ecount(size) __exceptthat __maybenull
-#endif
-#ifndef __deref_opt_inout_bcount
-#define __deref_opt_inout_bcount(size) __deref_inout_bcount(size) __exceptthat __maybenull
-#endif
-#ifndef __deref_opt_inout_ecount_part
-#define __deref_opt_inout_ecount_part(size,length) __deref_inout_ecount_part(size,length) __exceptthat __maybenull
-#endif
-#ifndef __deref_opt_inout_bcount_part
-#define __deref_opt_inout_bcount_part(size,length) __deref_inout_bcount_part(size,length) __exceptthat __maybenull
-#endif
-#ifndef __deref_opt_inout_ecount_full
-#define __deref_opt_inout_ecount_full(size) __deref_inout_ecount_full(size) __exceptthat __maybenull
-#endif
-#ifndef __deref_opt_inout_bcount_full
-#define __deref_opt_inout_bcount_full(size) __deref_inout_bcount_full(size) __exceptthat __maybenull
-#endif
-
-#ifndef __deref_opt_ecount_opt
-#define __deref_opt_ecount_opt(size) __deref_ecount_opt(size) __exceptthat __maybenull
-#endif
-#ifndef __deref_opt_bcount_opt
-#define __deref_opt_bcount_opt(size) __deref_bcount_opt(size) __exceptthat __maybenull
-#endif
-#ifndef __deref_opt_in_opt
-#define __deref_opt_in_opt __deref_in_opt __exceptthat __maybenull
-#endif
-#ifndef __deref_opt_in_ecount_opt
-#define __deref_opt_in_ecount_opt(size) __deref_in_ecount_opt(size) __exceptthat __maybenull
-#endif
-#ifndef __deref_opt_in_bcount_opt
-#define __deref_opt_in_bcount_opt(size) __deref_in_bcount_opt(size) __exceptthat __maybenull
-#endif
-#ifndef __deref_opt_out_opt
-#define __deref_opt_out_opt __deref_out_opt __exceptthat __maybenull
-#endif
-#ifndef __deref_opt_out_ecount_opt
-#define __deref_opt_out_ecount_opt(size) __deref_out_ecount_opt(size) __exceptthat __maybenull
-#endif
-#ifndef __deref_opt_out_bcount_opt
-#define __deref_opt_out_bcount_opt(size) __deref_out_bcount_opt(size) __exceptthat __maybenull
-#endif
-#ifndef __deref_opt_out_ecount_part_opt
-#define __deref_opt_out_ecount_part_opt(size,length) __deref_out_ecount_part_opt(size,length) __exceptthat __maybenull
-#endif
-#ifndef __deref_opt_out_bcount_part_opt
-#define __deref_opt_out_bcount_part_opt(size,length) __deref_out_bcount_part_opt(size,length) __exceptthat __maybenull
-#endif
-#ifndef __deref_opt_out_ecount_full_opt
-#define __deref_opt_out_ecount_full_opt(size) __deref_out_ecount_full_opt(size) __exceptthat __maybenull
-#endif
-#ifndef __deref_opt_out_bcount_full_opt
-#define __deref_opt_out_bcount_full_opt(size) __deref_out_bcount_full_opt(size) __exceptthat __maybenull
-#endif
-#ifndef __deref_opt_inout_opt
-#define __deref_opt_inout_opt __deref_inout_opt __exceptthat __maybenull
-#endif
-#ifndef __deref_opt_inout_ecount_opt
-#define __deref_opt_inout_ecount_opt(size) __deref_inout_ecount_opt(size) __exceptthat __maybenull
-#endif
-#ifndef __deref_opt_inout_bcount_opt
-#define __deref_opt_inout_bcount_opt(size) __deref_inout_bcount_opt(size) __exceptthat __maybenull
-#endif
-#ifndef __deref_opt_inout_ecount_part_opt
-#define __deref_opt_inout_ecount_part_opt(size,length) __deref_inout_ecount_part_opt(size,length) __exceptthat __maybenull
-#endif
-#ifndef __deref_opt_inout_bcount_part_opt
-#define __deref_opt_inout_bcount_part_opt(size,length) __deref_inout_bcount_part_opt(size,length) __exceptthat __maybenull
-#endif
-#ifndef __deref_opt_inout_ecount_full_opt
-#define __deref_opt_inout_ecount_full_opt(size) __deref_inout_ecount_full_opt(size) __exceptthat __maybenull
-#endif
-#ifndef __deref_opt_inout_bcount_full_opt
-#define __deref_opt_inout_bcount_full_opt(size) __deref_inout_bcount_full_opt(size) __exceptthat __maybenull
-#endif
-
-// @@BEGIN_DDKSPLIT
-// -------------------------------------------------------------------------------
-// Advanced Annotation Definitions
-//
-// Any of these may be used to directly annotate functions, and may be used in
-// combination with each other or with regular buffer macros. For an explanation
-// of each annotation, see the advanced annotations section.
-// -------------------------------------------------------------------------------
-// @@END_DDKSPLIT
-
-#ifndef __out_awcount
-#define __out_awcount(expr,size) __pre __notnull \
- __precond(expr) __byte_writableTo(size) \
- __precond(!(expr)) __byte_writableTo((size)*2) \
- __post __valid __refparam
-#endif
-#ifndef __in_awcount
-#define __in_awcount(expr,size) __pre __valid \
- __pre __deref __readonly \
- __precond(expr) __byte_readableTo(size) \
- __precond(!(expr)) __elem_readableTo(size)
-#endif
-#ifndef __success
-#define __success(expr) __inner_success(expr)
-#endif
-#ifndef __nullterminated
-#define __nullterminated __readableTo(sentinel(0))
-#endif
-#ifndef __nullnullterminated
-#define __nullnullterminated
-#endif
-#ifndef __reserved
-#define __reserved __pre __null
-#endif
-#ifndef __checkReturn
-#define __checkReturn __inner_checkReturn
-#endif
-#ifndef __typefix
-#define __typefix(ctype) __inner_typefix(ctype)
-#endif
-#ifndef __override
-#define __override __inner_override
-#endif
-#ifndef __callback
-#define __callback __inner_callback
-#endif
-#ifndef __format_string
-#define __format_string
-#endif
-#ifndef __blocksOn
-#define __blocksOn(resource) __inner_blocksOn(resource)
-#endif
-#ifndef __control_entrypoint
-#define __control_entrypoint(category) __inner_control_entrypoint(category)
-#endif
-#ifndef __data_entrypoint
-#define __data_entrypoint(category) __inner_data_entrypoint(category)
-#endif
-
-#ifndef __fallthrough
- __inner_fallthrough_dec
- #define __fallthrough __inner_fallthrough
-#endif
-
-// -------------------------------------------------------------------------------
-// Deprecated Annotation Definitions
-//
-// These should be removed from existing code.
-// -------------------------------------------------------------------------------
-
-// #define __opt __exceptthat __maybenull
-
-#ifdef __cplusplus
-}
-#endif
-
+/***************************************************************\
+* *
+* SpecStrings.h - markers for documenting the semantics of APIs *
+* *
+* Version 1.0 *
+* *
+* Copyright (c) Microsoft Corporation. All rights reserved. *
+* *
+\***************************************************************/
+
+// @@BEGIN_DDKSPLIT
+
+// -------------------------------------------------------------------------------
+// Introduction
+//
+// SpecStrings.h provides a set of annotations to describe how a function uses its
+// parameters - the assumptions it makes about them, and the guarantees it makes
+// upon finishing.
+//
+// Annotations may be placed before either a function parameter's type or its return
+// type, and describe the function's behavior regarding the parameter or return value.
+// There are two classes of annotations: buffer annotations and advanced annotations.
+// Buffer annotations describe how functions use their pointer parameters, and
+// advanced annotations either describe complex/unusual buffer behavior, or provide
+// additional information about a parameter that is not otherwise expressible.
+//
+// -------------------------------------------------------------------------------
+// Buffer Annotations
+//
+// The most important annotations in SpecStrings.h provide a consistent way to annotate
+// buffer parameters or return values for a function. Each of these annotations describes
+// a single buffer (which could be a string, a fixed-length or variable-length array,
+// or just a pointer) that the function interacts with: where it is, how large it is,
+// how much is initialized, and what the function does with it.
+//
+// The appropriate macro for a given buffer can be constructed using the table below.
+// Just pick the appropriate values from each category, and combine them together
+// with a leading underscore. Some combinations of values do not make sense as buffer
+// annotations. Only meaningful annotations can be added to your code; for a list of
+// these, see the buffer annotation definitions section.
+//
+// Only a single buffer annotation should be used for each parameter.
+//
+// |------------|------------|---------|--------|----------|---------------|
+// | Level | Usage | Size | Output | Optional | Parameters |
+// |------------|------------|---------|--------|----------|---------------|
+// | <> | <> | <> | <> | <> | <> |
+// | _deref | _in | _ecount | _full | _opt | (size) |
+// | _deref_opt | _out | _bcount | _part | | (size,length) |
+// | | _inout | | | | |
+// | | | | | | |
+// |------------|------------|---------|--------|----------|---------------|
+//
+// Level: Describes the buffer pointer's level of indirection from the parameter or
+// return value 'p'.
+//
+// <> : p is the buffer pointer.
+// _deref : *p is the buffer pointer. p must not be NULL.
+// _deref_opt : *p may be the buffer pointer. p may be NULL, in which case the rest of
+// the annotation is ignored.
+//
+// Usage: Describes how the function uses the buffer.
+//
+// <> : The buffer is not accessed. If used on the return value or with _deref, the
+// function will provide the buffer, and it will be uninitialized at exit.
+// Otherwise, the caller must provide the buffer. This should only be used
+// for alloc and free functions.
+// _in : The function will only read from the buffer. The caller must provide the
+// buffer and initialize it.
+// _out : The function will only write to the buffer. If used on the return value or
+// with _deref, the function will provide the buffer and initialize it.
+// Otherwise, the caller must provide the buffer, and the function will
+// initialize it.
+// _inout : The function may freely read from and write to the buffer. The caller must
+// provide the buffer and initialize it. If used with _deref, the buffer may
+// be reallocated by the function.
+//
+// Size: Describes the total size of the buffer. This may be less than the space actually
+// allocated for the buffer, in which case it describes the accessible amount.
+//
+// <> : No buffer size is given. If the type specifies the buffer size (such as
+// with LPSTR and LPWSTR), that amount is used. Otherwise, the buffer is one
+// element long. Must be used with _in, _out, or _inout.
+// _ecount : The buffer size is an explicit element count.
+// _bcount : The buffer size is an explicit byte count.
+//
+// Output: Describes how much of the buffer will be initialized by the function. For
+// _inout buffers, this also describes how much is initialized at entry. Omit this
+// category for _in buffers; they must be fully initialized by the caller.
+//
+// <> : The type specifies how much is initialized. For instance, a function initializing
+// an LPWSTR must NULL-terminate the string.
+// _full : The function initializes the entire buffer.
+// _part : The function initializes part of the buffer, and explicitly indicates how much.
+//
+// Optional: Describes if the buffer itself is optional.
+//
+// <> : The pointer to the buffer must not be NULL.
+// _opt : The pointer to the buffer might be NULL. It will be checked before being dereferenced.
+//
+// Parameters: Gives explicit counts for the size and length of the buffer.
+//
+// <> : There is no explicit count. Use when neither _ecount nor _bcount is used.
+// (size) : Only the buffer's total size is given. Use with _ecount or _bcount but not _part.
+// (size,length) : The buffer's total size and initialized length are given. Use with _ecount_part
+// and _bcount_part.
+//
+// -------------------------------------------------------------------------------
+// Buffer Annotation Examples
+//
+// LWSTDAPI_(BOOL) StrToIntExA(
+// LPCSTR pszString, // No annotation required, const implies __in.
+// DWORD dwFlags,
+// __out int *piRet // A pointer whose dereference will be filled in.
+// );
+//
+// void MyPaintingFunction(
+// __in HWND hwndControl, // An initialized read-only parameter.
+// __in_opt HDC hdcOptional, // An initialized read-only parameter that might be NULL.
+// __inout IPropertyStore *ppsStore // An initialized parameter that may be freely used
+// // and modified.
+// );
+//
+// LWSTDAPI_(BOOL) PathCompactPathExA(
+// __out_ecount(cchMax) LPSTR pszOut, // A string buffer with cch elements that will
+// // be NULL terminated on exit.
+// LPCSTR pszSrc, // No annotation required, const implies __in.
+// UINT cchMax,
+// DWORD dwFlags
+// );
+//
+// HRESULT SHLocalAllocBytes(
+// size_t cb,
+// __deref_bcount(cb) T **ppv // A pointer whose dereference will be set to an
+// // uninitialized buffer with cb bytes.
+// );
+//
+// __inout_bcount_full(cb) : A buffer with cb elements that is fully initialized at
+// entry and exit, and may be written to by this function.
+//
+// __out_ecount_part(count, *countOut) : A buffer with count elements that will be
+// partially initialized by this function. The function indicates how much it
+// initialized by setting *countOut.
+//
+// -------------------------------------------------------------------------------
+// Advanced Annotations
+//
+// Advanced annotations describe behavior that is not expressible with the regular
+// buffer macros. These may be used either to annotate buffer parameters that involve
+// complex or conditional behavior, or to enrich existing annotations with additional
+// information.
+//
+// __success(expr) f :
+// <expr> indicates whether function f succeeded or not. If <expr> is true at exit,
+// all the function's guarantees (as given by other annotations) must hold. If <expr>
+// is false at exit, the caller should not expect any of the function's guarantees
+// to hold. If not used, the function must always satisfy its guarantees. Added
+// automatically to functions that indicate success in standard ways, such as by
+// returning an HRESULT.
+//
+// __out_awcount(expr, size) p :
+// Pointer p is a buffer whose size may be given in either bytes or elements. If
+// <expr> is true, this acts like __out_bcount. If <expr> is false, this acts
+// like __out_ecount. This should only be used to annotate old APIs.
+//
+// __in_awcount(expr, size) p :
+// Pointer p is a buffer whose size may be given in either bytes or elements. If
+// <expr> is true, this acts like __in_bcount. If <expr> is false, this acts
+// like __in_ecount. This should only be used to annotate old APIs.
+//
+// __nullterminated p :
+// Pointer p is a buffer that may be read or written up to and including the first
+// NULL character or pointer. May be used on typedefs, which marks valid (properly
+// initialized) instances of that type as being NULL-terminated.
+//
+// __nullnullterminated p :
+// Pointer p is a buffer that may be read or written up to and including the first
+// sequence of two NULL characters or pointers. May be used on typedefs, which marks
+// valid instances of that type as being double-NULL terminated.
+//
+// __reserved v :
+// Value v must be 0/NULL, reserved for future use.
+//
+// __checkReturn v :
+// Return value v must not be ignored by callers of this function.
+//
+// __typefix(ctype) v :
+// Value v should be treated as an instance of ctype, rather than its declared type.
+//
+// __override f :
+// Specify C#-style 'override' behaviour for overriding virtual methods.
+//
+// __callback f :
+// Function f can be used as a function pointer.
+//
+// __format_string p :
+// Pointer p is a string that contains % markers in the style of printf.
+//
+// __blocksOn(resource) f :
+// Function f blocks on the resource 'resource'.
+//
+// __fallthrough :
+// Annotates switch statement labels where fall-through is desired, to distinguish
+// from forgotten break statements.
+//
+// -------------------------------------------------------------------------------
+// Advanced Annotation Examples
+//
+// __success(return == TRUE) LWSTDAPI_(BOOL)
+// PathCanonicalizeA(__out_ecount(MAX_PATH) LPSTR pszBuf, LPCSTR pszPath) :
+// pszBuf is only guaranteed to be NULL-terminated when TRUE is returned.
+//
+// typedef __nullterminated WCHAR* LPWSTR : Initialized LPWSTRs are NULL-terminated strings.
+//
+// __out_ecount(cch) __typefix(LPWSTR) void *psz : psz is a buffer parameter which will be
+// a NULL-terminated WCHAR string at exit, and which initially contains cch WCHARs.
+//
+// -------------------------------------------------------------------------------
+
+// @@END_DDKSPLIT
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // #if _MSC_VER > 1000
+
+#define __specstrings
+
+#ifdef __cplusplus
+#ifndef __nothrow
+# define __nothrow __declspec(nothrow)
+#endif
+extern "C" {
+#else
+#ifndef __nothrow
+# define __nothrow
+#endif
+#endif // #ifdef __cplusplus
+
+// @@BEGIN_DDKSPLIT
+
+// -------------------------------------------------------------------------------
+// Helper Macro Definitions
+//
+// These express behavior common to many of the high-level annotations.
+// DO NOT USE THESE IN YOUR CODE.
+// -------------------------------------------------------------------------------
+
+// The helper annotations are only understood by the compiler version used by various
+// defect detection tools. When the regular compiler is running, they are defined into
+// nothing, and do not affect the compiled code.
+#if (_MSC_VER >= 1000) && !defined(MIDL_PASS) && defined(_PREFAST_)
+
+ // In the primitive __declspec("SAL_*") annotations "SAL" stands for Standard
+ // Annotation Language. These __declspec("SAL_*") annotations are the
+ // primitives the compiler understands and all high-level SpecString MACROs
+ // will decompose into these primivates.
+
+ #define SPECSTRINGIZE( x ) #x
+
+ //
+ // __null p
+ // __notnull p
+ // __maybenull p
+ //
+ // Annotates a pointer p. States that pointer p is null. Commonly used
+ // in the negated form __notnull or the possibly null form __maybenull.
+ //
+ #define __null __declspec("SAL_null")
+ #define __notnull __declspec("SAL_notnull")
+ #define __maybenull __declspec("SAL_maybenull")
+
+ //
+ // __readonly l
+ // __notreadonly l
+ // __mabyereadonly l
+ //
+ // Annotates a location l. States that location l is not modified after
+ // this point. If the annotation is placed on the precondition state of
+ // a function, the restriction only applies until the postcondition state
+ // of the function. __maybereadonly states that the annotated location
+ // may be modified, whereas __notreadonly states that a location must be
+ // modified.
+ //
+ #define __readonly __declspec("SAL_readonly")
+ #define __notreadonly __declspec("SAL_notreadonly")
+ #define __maybereadonly __declspec("SAL_maybereadonly")
+
+ //
+ // __valid v
+ // __notvalid v
+ // __maybevalid v
+ //
+ // Annotates any value v. States that the value satisfies all properties of
+ // valid values of its type. For example, for a string buffer, valid means
+ // that the buffer pointer is either NULL or points to a NULL-terminated string.
+ //
+ #define __valid __declspec("SAL_valid")
+ #define __notvalid __declspec("SAL_notvalid")
+ #define __maybevalid __declspec("SAL_maybevalid")
+
+ //
+ // __readableTo(extent) p
+ //
+ // Annotates a buffer pointer p. If the buffer can be read, extent describes
+ // how much of the buffer is readable. For a reader of the buffer, this is
+ // an explicit permission to read up to that amount, rather than a restriction to
+ // read only up to it.
+ //
+ #define __readableTo(extent) __declspec("SAL_readableTo("SPECSTRINGIZE(extent)")")
+
+ //
+ // __elem_readableTo(size)
+ //
+ // Annotates a buffer pointer p as being readable to size elements.
+ //
+ #define __elem_readableTo(size) __declspec("SAL_readableTo(elementCount("SPECSTRINGIZE(size)"))")
+
+ //
+ // __byte_readableTo(size)
+ //
+ // Annotates a buffer pointer p as being readable to size bytes.
+ //
+ #define __byte_readableTo(size) __declspec("SAL_readableTo(byteCount("SPECSTRINGIZE(size)"))")
+
+ //
+ // __writableTo(extent) p
+ //
+ // Annotates a buffer pointer p. If the buffer can be modified, extent
+ // describes how much of the buffer is writable (usually the allocation
+ // size). For a writer of the buffer, this is an explicit permission to
+ // write up to that amount, rather than a restriction to write only up to it.
+ //
+ #define __writableTo(size) __declspec("SAL_writableTo("SPECSTRINGIZE(size)")")
+
+ //
+ // __elem_writableTo(size)
+ //
+ // Annotates a buffer pointer p as being writable to size elements.
+ //
+ #define __elem_writableTo(size) __declspec("SAL_writableTo(elementCount("SPECSTRINGIZE(size)"))")
+
+ //
+ // __byte_writableTo(size)
+ //
+ // Annotates a buffer pointer p as being writable to size bytes.
+ //
+ #define __byte_writableTo(size) __declspec("SAL_writableTo(byteCount("SPECSTRINGIZE(size)"))")
+
+ //
+ // __deref p
+ //
+ // Annotates a pointer p. The next annotation applies one dereference down
+ // in the type. If readableTo(p, size) then the next annotation applies to
+ // all elements *(p+i) for which i satisfies the size. If p is a pointer
+ // to a struct, the next annotation applies to all fields of the struct.
+ //
+ #define __deref __declspec("SAL_deref")
+
+ //
+ // __pre __next_annotation
+ //
+ // The next annotation applies in the precondition state
+ //
+ #define __pre __declspec("SAL_pre")
+
+ //
+ // __post __next_annotation
+ //
+ // The next annotation applies in the postcondition state
+ //
+ #define __post __declspec("SAL_post")
+
+ //
+ // __precond(<expr>)
+ //
+ // When <expr> is true, the next annotation applies in the precondition state
+ // (currently not enabled)
+ //
+ #define __precond(expr) __pre
+
+ //
+ // __postcond(<expr>)
+ //
+ // When <expr> is true, the next annotation applies in the postcondition state
+ // (currently not enabled)
+ //
+ #define __postcond(expr) __post
+
+ //
+ // __exceptthat
+ //
+ // Given a set of annotations Q containing __exceptthat maybeP, the effect of
+ // the except clause is to erase any P or notP annotations (explicit or
+ // implied) within Q at the same level of dereferencing that the except
+ // clause appears, and to replace it with maybeP.
+ //
+ // Example 1: __valid __exceptthat __maybenull on a pointer p means that the
+ // pointer may be null, and is otherwise valid, thus overriding
+ // the implicit notnull annotation implied by __valid on
+ // pointers.
+ //
+ // Example 2: __valid __deref __exceptthat __maybenull on an int **p means
+ // that p is not null (implied by valid), but the elements
+ // pointed to by p could be null, and are otherwise valid.
+ //
+ #define __exceptthat __declspec("SAL_except")
+
+ //
+ // _refparam
+ //
+ // Added to all out parameter macros to indicate that they are all reference
+ // parameters.
+ //
+ #define __refparam __deref __notreadonly
+
+ //
+ // __inner_*
+ //
+ // Helper macros that directly correspond to certain high-level annotations.
+ //
+ //
+
+ // Macros to classify the entrypoints and indicate their category.
+ //
+ //
+ // Pre-defined control point categories include: RPC, LPC, DeviceDriver, UserToKernel, ISAPI, COM.
+ //
+ #define __inner_control_entrypoint(category) __declspec("SAL_entrypoint(controlEntry, "SPECSTRINGIZE(category)")")
+
+ //
+ // Pre-defined data entry point categories include: Registry, File, Network.
+ //
+ #define __inner_data_entrypoint(category) __declspec("SAL_entrypoint(dataEntry, "SPECSTRINGIZE(category)")")
+
+ #define __inner_success(expr) __declspec("SAL_success("SPECSTRINGIZE(expr)")")
+ #define __inner_checkReturn __declspec("SAL_checkReturn")
+ #define __inner_typefix(ctype) __declspec("SAL_typefix("SPECSTRINGIZE(ctype)")")
+ #define __inner_override __declspec("__override")
+ #define __inner_callback __declspec("__callback")
+ #define __inner_blocksOn(resource) __declspec("SAL_blocksOn("SPECSTRINGIZE(resource)")")
+ #define __inner_fallthrough_dec __inline __nothrow void __FallThrough() {}
+ #define __inner_fallthrough __FallThrough();
+
+#else
+
+// @@END_DDKSPLIT
+
+#ifndef __null
+ #define __null
+#endif
+#ifndef __notnull
+ #define __notnull
+#endif
+#ifndef __maybenull
+ #define __maybenull
+#endif
+#ifndef __readonly
+ #define __readonly
+#endif
+#ifndef __notreadonly
+ #define __notreadonly
+#endif
+#ifndef __maybereadonly
+ #define __maybereadonly
+#endif
+#ifndef __valid
+ #define __valid
+#endif
+#ifndef __notvalid
+ #define __notvalid
+#endif
+#ifndef __maybevalid
+ #define __maybevalid
+#endif
+#ifndef __readableTo
+ #define __readableTo(extent)
+#endif
+#ifndef __elem_readableTo
+ #define __elem_readableTo(size)
+#endif
+#ifndef __byte_readableTo
+ #define __byte_readableTo(size)
+#endif
+#ifndef __writableTo
+ #define __writableTo(size)
+#endif
+#ifndef __elem_writableTo
+ #define __elem_writableTo(size)
+#endif
+#ifndef __byte_writableTo
+ #define __byte_writableTo(size)
+#endif
+#ifndef __deref
+ #define __deref
+#endif
+#ifndef __pre
+ #define __pre
+#endif
+#ifndef __post
+ #define __post
+#endif
+#ifndef __precond
+ #define __precond(expr)
+#endif
+#ifndef __postcond
+ #define __postcond(expr)
+#endif
+#ifndef __exceptthat
+ #define __exceptthat
+#endif
+#ifndef __inner_success
+ #define __inner_success(expr)
+#endif
+#ifndef __inner_checkReturn
+ #define __inner_checkReturn
+#endif
+#ifndef __inner_typefix
+ #define __inner_typefix(ctype)
+#endif
+#ifndef __inner_override
+ #define __inner_override
+#endif
+#ifndef __inner_callback
+ #define __inner_callback
+#endif
+#ifndef __inner_blocksOn
+ #define __inner_blocksOn(resource)
+#endif
+#ifndef __inner_fallthrough_dec
+ #define __inner_fallthrough_dec
+#endif
+#ifndef __inner_fallthrough
+ #define __inner_fallthrough
+#endif
+#ifndef __refparam
+ #define __refparam
+#endif
+#ifndef __inner_control_entrypoint
+ #define __inner_control_entrypoint(category)
+#endif
+#ifndef __inner_data_entrypoint
+ #define __inner_data_entrypoint(category)
+#endif
+// @@BEGIN_DDKSPLIT
+#endif // #if (_MSC_VER >= 1000) && !defined(MIDL_PASS) && defined(_PREFAST_)
+// -------------------------------------------------------------------------------
+// Buffer Annotation Definitions
+//
+// Any of these may be used to directly annotate functions, but only one should
+// be used for each parameter. To determine which annotation to use for a given
+// buffer, use the table in the buffer annotations section.
+// -------------------------------------------------------------------------------
+// @@END_DDKSPLIT
+
+#ifndef __ecount
+#define __ecount(size) __notnull __elem_writableTo(size)
+#endif
+#ifndef __bcount
+#define __bcount(size) __notnull __byte_writableTo(size)
+#endif
+#ifndef __in
+#define __in __pre __valid __pre __deref __readonly
+#endif
+#ifndef __in_ecount
+#define __in_ecount(size) __in __pre __elem_readableTo(size)
+#endif
+#ifndef __in_bcount
+#define __in_bcount(size) __in __pre __byte_readableTo(size)
+#endif
+#ifndef __out
+#define __out __ecount(1) __post __valid __refparam
+#endif
+#ifndef __out_ecount
+#define __out_ecount(size) __ecount(size) __post __valid __refparam
+#endif
+#ifndef __out_bcount
+#define __out_bcount(size) __bcount(size) __post __valid __refparam
+#endif
+#ifndef __out_ecount_part
+#define __out_ecount_part(size,length) __out_ecount(size) __post __elem_readableTo(length)
+#endif
+#ifndef __out_bcount_part
+#define __out_bcount_part(size,length) __out_bcount(size) __post __byte_readableTo(length)
+#endif
+#ifndef __out_ecount_full
+#define __out_ecount_full(size) __out_ecount_part(size,size)
+#endif
+#ifndef __out_bcount_full
+#define __out_bcount_full(size) __out_bcount_part(size,size)
+#endif
+#ifndef __inout
+#define __inout __pre __valid __post __valid __refparam
+#endif
+#ifndef __inout_ecount
+#define __inout_ecount(size) __out_ecount(size) __pre __valid
+#endif
+#ifndef __inout_bcount
+#define __inout_bcount(size) __out_bcount(size) __pre __valid
+#endif
+#ifndef __inout_ecount_part
+#define __inout_ecount_part(size,length) __out_ecount_part(size,length) __pre __valid __pre __elem_readableTo(length)
+#endif
+#ifndef __inout_bcount_part
+#define __inout_bcount_part(size,length) __out_bcount_part(size,length) __pre __valid __pre __byte_readableTo(length)
+#endif
+#ifndef __inout_ecount_full
+#define __inout_ecount_full(size) __inout_ecount_part(size,size)
+#endif
+#ifndef __inout_bcount_full
+#define __inout_bcount_full(size) __inout_bcount_part(size,size)
+#endif
+
+#ifndef __ecount_opt
+#define __ecount_opt(size) __ecount(size) __exceptthat __maybenull
+#endif
+#ifndef __bcount_opt
+#define __bcount_opt(size) __bcount(size) __exceptthat __maybenull
+#endif
+#ifndef __in_opt
+#define __in_opt __in __exceptthat __maybenull
+#endif
+#ifndef __in_ecount_opt
+#define __in_ecount_opt(size) __in_ecount(size) __exceptthat __maybenull
+#endif
+#ifndef __in_bcount_opt
+#define __in_bcount_opt(size) __in_bcount(size) __exceptthat __maybenull
+#endif
+#ifndef __out_opt
+#define __out_opt __out __exceptthat __maybenull
+#endif
+#ifndef __out_ecount_opt
+#define __out_ecount_opt(size) __out_ecount(size) __exceptthat __maybenull
+#endif
+#ifndef __out_bcount_opt
+#define __out_bcount_opt(size) __out_bcount(size) __exceptthat __maybenull
+#endif
+#ifndef __out_ecount_part_opt
+#define __out_ecount_part_opt(size,length) __out_ecount_part(size,length) __exceptthat __maybenull
+#endif
+#ifndef __out_bcount_part_opt
+#define __out_bcount_part_opt(size,length) __out_bcount_part(size,length) __exceptthat __maybenull
+#endif
+#ifndef __out_ecount_full_opt
+#define __out_ecount_full_opt(size) __out_ecount_full(size) __exceptthat __maybenull
+#endif
+#ifndef __out_bcount_full_opt
+#define __out_bcount_full_opt(size) __out_bcount_full(size) __exceptthat __maybenull
+#endif
+#ifndef __inout_opt
+#define __inout_opt __inout __exceptthat __maybenull
+#endif
+#ifndef __inout_ecount_opt
+#define __inout_ecount_opt(size) __inout_ecount(size) __exceptthat __maybenull
+#endif
+#ifndef __inout_bcount_opt
+#define __inout_bcount_opt(size) __inout_bcount(size) __exceptthat __maybenull
+#endif
+#ifndef __inout_ecount_part_opt
+#define __inout_ecount_part_opt(size,length) __inout_ecount_part(size,length) __exceptthat __maybenull
+#endif
+#ifndef __inout_bcount_part_opt
+#define __inout_bcount_part_opt(size,length) __inout_bcount_part(size,length) __exceptthat __maybenull
+#endif
+#ifndef __inout_ecount_full_opt
+#define __inout_ecount_full_opt(size) __inout_ecount_full(size) __exceptthat __maybenull
+#endif
+#ifndef __inout_bcount_full_opt
+#define __inout_bcount_full_opt(size) __inout_bcount_full(size) __exceptthat __maybenull
+#endif
+
+#ifndef __deref_ecount
+#define __deref_ecount(size) __ecount(1) __post __elem_readableTo(1) __post __deref __notnull __post __deref __elem_writableTo(size)
+#endif
+#ifndef __deref_bcount
+#define __deref_bcount(size) __ecount(1) __post __elem_readableTo(1) __post __deref __notnull __post __deref __byte_writableTo(size)
+#endif
+#ifndef __deref_in
+#define __deref_in __in __pre __deref __deref __readonly
+#endif
+#ifndef __deref_in_ecount
+#define __deref_in_ecount(size) __deref_in __pre __deref __elem_readableTo(size)
+#endif
+#ifndef __deref_in_bcount
+#define __deref_in_bcount(size) __deref_in __pre __deref __byte_readableTo(size)
+#endif
+#ifndef __deref_out
+#define __deref_out __deref_ecount(1) __post __deref __valid __refparam
+#endif
+#ifndef __deref_out_ecount
+#define __deref_out_ecount(size) __deref_ecount(size) __post __deref __valid __refparam
+#endif
+#ifndef __deref_out_bcount
+#define __deref_out_bcount(size) __deref_bcount(size) __post __deref __valid __refparam
+#endif
+#ifndef __deref_out_ecount_part
+#define __deref_out_ecount_part(size,length) __deref_out_ecount(size) __post __deref __elem_readableTo(length)
+#endif
+#ifndef __deref_out_bcount_part
+#define __deref_out_bcount_part(size,length) __deref_out_bcount(size) __post __deref __byte_readableTo(length)
+#endif
+#ifndef __deref_out_ecount_full
+#define __deref_out_ecount_full(size) __deref_out_ecount_part(size,size)
+#endif
+#ifndef __deref_out_bcount_full
+#define __deref_out_bcount_full(size) __deref_out_bcount_part(size,size)
+#endif
+#ifndef __deref_inout
+#define __deref_inout __notnull __elem_readableTo(1) __pre __deref __valid __post __deref __valid __refparam
+#endif
+#ifndef __deref_inout_ecount
+#define __deref_inout_ecount(size) __deref_inout __pre __deref __elem_writableTo(size) __post __deref __elem_writableTo(size)
+#endif
+#ifndef __deref_inout_bcount
+#define __deref_inout_bcount(size) __deref_inout __pre __deref __byte_writableTo(size) __post __deref __byte_writableTo(size)
+#endif
+#ifndef __deref_inout_ecount_part
+#define __deref_inout_ecount_part(size,length) __deref_inout_ecount(size) __pre __deref __elem_readableTo(length) __post __deref __elem_readableTo(length)
+#endif
+#ifndef __deref_inout_bcount_part
+#define __deref_inout_bcount_part(size,length) __deref_inout_bcount(size) __pre __deref __byte_readableTo(length) __post __deref __byte_readableTo(length)
+#endif
+#ifndef __deref_inout_ecount_full
+#define __deref_inout_ecount_full(size) __deref_inout_ecount_part(size,size)
+#endif
+#ifndef __deref_inout_bcount_full
+#define __deref_inout_bcount_full(size) __deref_inout_bcount_part(size,size)
+#endif
+
+#ifndef __deref_ecount_opt
+#define __deref_ecount_opt(size) __deref_ecount(size) __post __deref __exceptthat __maybenull
+#endif
+#ifndef __deref_bcount_opt
+#define __deref_bcount_opt(size) __deref_bcount(size) __post __deref __exceptthat __maybenull
+#endif
+#ifndef __deref_in_opt
+#define __deref_in_opt __deref_in __pre __deref __exceptthat __maybenull
+#endif
+#ifndef __deref_in_ecount_opt
+#define __deref_in_ecount_opt(size) __deref_in_ecount(size) __pre __deref __exceptthat __maybenull
+#endif
+#ifndef __deref_in_bcount_opt
+#define __deref_in_bcount_opt(size) __deref_in_bcount(size) __pre __deref __exceptthat __maybenull
+#endif
+#ifndef __deref_out_opt
+#define __deref_out_opt __deref_out __post __deref __exceptthat __maybenull
+#endif
+#ifndef __deref_out_ecount_opt
+#define __deref_out_ecount_opt(size) __deref_out_ecount(size) __post __deref __exceptthat __maybenull
+#endif
+#ifndef __deref_out_bcount_opt
+#define __deref_out_bcount_opt(size) __deref_out_bcount(size) __post __deref __exceptthat __maybenull
+#endif
+#ifndef __deref_out_ecount_part_opt
+#define __deref_out_ecount_part_opt(size,length) __deref_out_ecount_part(size,length) __post __deref __exceptthat __maybenull
+#endif
+#ifndef __deref_out_bcount_part_opt
+#define __deref_out_bcount_part_opt(size,length) __deref_out_bcount_part(size,length) __post __deref __exceptthat __maybenull
+#endif
+#ifndef __deref_out_ecount_full_opt
+#define __deref_out_ecount_full_opt(size) __deref_out_ecount_full(size) __post __deref __exceptthat __maybenull
+#endif
+#ifndef __deref_out_bcount_full_opt
+#define __deref_out_bcount_full_opt(size) __deref_out_bcount_full(size) __post __deref __exceptthat __maybenull
+#endif
+#ifndef __deref_inout_opt
+#define __deref_inout_opt __deref_inout __pre __deref __exceptthat __maybenull __post __deref __exceptthat __maybenull
+#endif
+#ifndef __deref_inout_ecount_opt
+#define __deref_inout_ecount_opt(size) __deref_inout_ecount(size) __pre __deref __exceptthat __maybenull __post __deref __exceptthat __maybenull
+#endif
+#ifndef __deref_inout_bcount_opt
+#define __deref_inout_bcount_opt(size) __deref_inout_bcount(size) __pre __deref __exceptthat __maybenull __post __deref __exceptthat __maybenull
+#endif
+#ifndef __deref_inout_ecount_part_opt
+#define __deref_inout_ecount_part_opt(size,length) __deref_inout_ecount_part(size,length) __pre __deref __exceptthat __maybenull __post __deref __exceptthat __maybenull
+#endif
+#ifndef __deref_inout_bcount_part_opt
+#define __deref_inout_bcount_part_opt(size,length) __deref_inout_bcount_part(size,length) __pre __deref __exceptthat __maybenull __post __deref __exceptthat __maybenull
+#endif
+#ifndef __deref_inout_ecount_full_opt
+#define __deref_inout_ecount_full_opt(size) __deref_inout_ecount_full(size) __pre __deref __exceptthat __maybenull __post __deref __exceptthat __maybenull
+#endif
+#ifndef __deref_inout_bcount_full_opt
+#define __deref_inout_bcount_full_opt(size) __deref_inout_bcount_full(size) __pre __deref __exceptthat __maybenull __post __deref __exceptthat __maybenull
+#endif
+
+#ifndef __deref_opt_ecount
+#define __deref_opt_ecount(size) __deref_ecount(size) __exceptthat __maybenull
+#endif
+#ifndef __deref_opt_bcount
+#define __deref_opt_bcount(size) __deref_bcount(size) __exceptthat __maybenull
+#endif
+#ifndef __deref_opt_in
+#define __deref_opt_in __deref_in __exceptthat __maybenull
+#endif
+#ifndef __deref_opt_in_ecount
+#define __deref_opt_in_ecount(size) __deref_in_ecount(size) __exceptthat __maybenull
+#endif
+#ifndef __deref_opt_in_bcount
+#define __deref_opt_in_bcount(size) __deref_in_bcount(size) __exceptthat __maybenull
+#endif
+#ifndef __deref_opt_out
+#define __deref_opt_out __deref_out __exceptthat __maybenull
+#endif
+#ifndef __deref_opt_out_ecount
+#define __deref_opt_out_ecount(size) __deref_out_ecount(size) __exceptthat __maybenull
+#endif
+#ifndef __deref_opt_out_bcount
+#define __deref_opt_out_bcount(size) __deref_out_bcount(size) __exceptthat __maybenull
+#endif
+#ifndef __deref_opt_out_ecount_part
+#define __deref_opt_out_ecount_part(size,length) __deref_out_ecount_part(size,length) __exceptthat __maybenull
+#endif
+#ifndef __deref_opt_out_bcount_part
+#define __deref_opt_out_bcount_part(size,length) __deref_out_bcount_part(size,length) __exceptthat __maybenull
+#endif
+#ifndef __deref_opt_out_ecount_full
+#define __deref_opt_out_ecount_full(size) __deref_out_ecount_full(size) __exceptthat __maybenull
+#endif
+#ifndef __deref_opt_out_bcount_full
+#define __deref_opt_out_bcount_full(size) __deref_out_bcount_full(size) __exceptthat __maybenull
+#endif
+#ifndef __deref_opt_inout
+#define __deref_opt_inout __deref_inout __exceptthat __maybenull
+#endif
+#ifndef __deref_opt_inout_ecount
+#define __deref_opt_inout_ecount(size) __deref_inout_ecount(size) __exceptthat __maybenull
+#endif
+#ifndef __deref_opt_inout_bcount
+#define __deref_opt_inout_bcount(size) __deref_inout_bcount(size) __exceptthat __maybenull
+#endif
+#ifndef __deref_opt_inout_ecount_part
+#define __deref_opt_inout_ecount_part(size,length) __deref_inout_ecount_part(size,length) __exceptthat __maybenull
+#endif
+#ifndef __deref_opt_inout_bcount_part
+#define __deref_opt_inout_bcount_part(size,length) __deref_inout_bcount_part(size,length) __exceptthat __maybenull
+#endif
+#ifndef __deref_opt_inout_ecount_full
+#define __deref_opt_inout_ecount_full(size) __deref_inout_ecount_full(size) __exceptthat __maybenull
+#endif
+#ifndef __deref_opt_inout_bcount_full
+#define __deref_opt_inout_bcount_full(size) __deref_inout_bcount_full(size) __exceptthat __maybenull
+#endif
+
+#ifndef __deref_opt_ecount_opt
+#define __deref_opt_ecount_opt(size) __deref_ecount_opt(size) __exceptthat __maybenull
+#endif
+#ifndef __deref_opt_bcount_opt
+#define __deref_opt_bcount_opt(size) __deref_bcount_opt(size) __exceptthat __maybenull
+#endif
+#ifndef __deref_opt_in_opt
+#define __deref_opt_in_opt __deref_in_opt __exceptthat __maybenull
+#endif
+#ifndef __deref_opt_in_ecount_opt
+#define __deref_opt_in_ecount_opt(size) __deref_in_ecount_opt(size) __exceptthat __maybenull
+#endif
+#ifndef __deref_opt_in_bcount_opt
+#define __deref_opt_in_bcount_opt(size) __deref_in_bcount_opt(size) __exceptthat __maybenull
+#endif
+#ifndef __deref_opt_out_opt
+#define __deref_opt_out_opt __deref_out_opt __exceptthat __maybenull
+#endif
+#ifndef __deref_opt_out_ecount_opt
+#define __deref_opt_out_ecount_opt(size) __deref_out_ecount_opt(size) __exceptthat __maybenull
+#endif
+#ifndef __deref_opt_out_bcount_opt
+#define __deref_opt_out_bcount_opt(size) __deref_out_bcount_opt(size) __exceptthat __maybenull
+#endif
+#ifndef __deref_opt_out_ecount_part_opt
+#define __deref_opt_out_ecount_part_opt(size,length) __deref_out_ecount_part_opt(size,length) __exceptthat __maybenull
+#endif
+#ifndef __deref_opt_out_bcount_part_opt
+#define __deref_opt_out_bcount_part_opt(size,length) __deref_out_bcount_part_opt(size,length) __exceptthat __maybenull
+#endif
+#ifndef __deref_opt_out_ecount_full_opt
+#define __deref_opt_out_ecount_full_opt(size) __deref_out_ecount_full_opt(size) __exceptthat __maybenull
+#endif
+#ifndef __deref_opt_out_bcount_full_opt
+#define __deref_opt_out_bcount_full_opt(size) __deref_out_bcount_full_opt(size) __exceptthat __maybenull
+#endif
+#ifndef __deref_opt_inout_opt
+#define __deref_opt_inout_opt __deref_inout_opt __exceptthat __maybenull
+#endif
+#ifndef __deref_opt_inout_ecount_opt
+#define __deref_opt_inout_ecount_opt(size) __deref_inout_ecount_opt(size) __exceptthat __maybenull
+#endif
+#ifndef __deref_opt_inout_bcount_opt
+#define __deref_opt_inout_bcount_opt(size) __deref_inout_bcount_opt(size) __exceptthat __maybenull
+#endif
+#ifndef __deref_opt_inout_ecount_part_opt
+#define __deref_opt_inout_ecount_part_opt(size,length) __deref_inout_ecount_part_opt(size,length) __exceptthat __maybenull
+#endif
+#ifndef __deref_opt_inout_bcount_part_opt
+#define __deref_opt_inout_bcount_part_opt(size,length) __deref_inout_bcount_part_opt(size,length) __exceptthat __maybenull
+#endif
+#ifndef __deref_opt_inout_ecount_full_opt
+#define __deref_opt_inout_ecount_full_opt(size) __deref_inout_ecount_full_opt(size) __exceptthat __maybenull
+#endif
+#ifndef __deref_opt_inout_bcount_full_opt
+#define __deref_opt_inout_bcount_full_opt(size) __deref_inout_bcount_full_opt(size) __exceptthat __maybenull
+#endif
+
+// @@BEGIN_DDKSPLIT
+// -------------------------------------------------------------------------------
+// Advanced Annotation Definitions
+//
+// Any of these may be used to directly annotate functions, and may be used in
+// combination with each other or with regular buffer macros. For an explanation
+// of each annotation, see the advanced annotations section.
+// -------------------------------------------------------------------------------
+// @@END_DDKSPLIT
+
+#ifndef __out_awcount
+#define __out_awcount(expr,size) __pre __notnull \
+ __precond(expr) __byte_writableTo(size) \
+ __precond(!(expr)) __byte_writableTo((size)*2) \
+ __post __valid __refparam
+#endif
+#ifndef __in_awcount
+#define __in_awcount(expr,size) __pre __valid \
+ __pre __deref __readonly \
+ __precond(expr) __byte_readableTo(size) \
+ __precond(!(expr)) __elem_readableTo(size)
+#endif
+#ifndef __success
+#define __success(expr) __inner_success(expr)
+#endif
+#ifndef __nullterminated
+#define __nullterminated __readableTo(sentinel(0))
+#endif
+#ifndef __nullnullterminated
+#define __nullnullterminated
+#endif
+#ifndef __reserved
+#define __reserved __pre __null
+#endif
+#ifndef __checkReturn
+#define __checkReturn __inner_checkReturn
+#endif
+#ifndef __typefix
+#define __typefix(ctype) __inner_typefix(ctype)
+#endif
+#ifndef __override
+#define __override __inner_override
+#endif
+#ifndef __callback
+#define __callback __inner_callback
+#endif
+#ifndef __format_string
+#define __format_string
+#endif
+#ifndef __blocksOn
+#define __blocksOn(resource) __inner_blocksOn(resource)
+#endif
+#ifndef __control_entrypoint
+#define __control_entrypoint(category) __inner_control_entrypoint(category)
+#endif
+#ifndef __data_entrypoint
+#define __data_entrypoint(category) __inner_data_entrypoint(category)
+#endif
+
+#ifndef __fallthrough
+ __inner_fallthrough_dec
+ #define __fallthrough __inner_fallthrough
+#endif
+
+// -------------------------------------------------------------------------------
+// Deprecated Annotation Definitions
+//
+// These should be removed from existing code.
+// -------------------------------------------------------------------------------
+
+// #define __opt __exceptthat __maybenull
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/core/src/fxge/apple/apple_int.h b/core/src/fxge/apple/apple_int.h
index 5c42f1b1fb..42d63628f2 100644
--- a/core/src/fxge/apple/apple_int.h
+++ b/core/src/fxge/apple/apple_int.h
@@ -1,246 +1,246 @@
-// 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 _APPLE_INT_H_
-#define _APPLE_INT_H_
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
-#if _FX_OS_ == _FX_MACOSX_
-#include <Carbon/Carbon.h>
-#endif
-typedef enum eFXIOSFONTCHARSET {
- eFXFontCharsetDEFAULT = 0,
- eFXFontCharsetANSI = 1,
- eFXFontCharsetSYMBOL = 1 << 1,
- eFXFontCharsetSHIFTJIS = 1 << 2,
- eFXFontCharsetHANGEUL = 1 << 3,
- eFXFontCharsetGB2312 = 1 << 4,
- eFXFontCharsetCHINESEBIG5 = 1 << 5,
- eFXFontCharsetTHAI = 1 << 6,
- eFXFontCharsetEASTEUROPE = 1 << 7,
- eFXFontCharsetRUSSIAN = 1 << 8,
- eFXFontCharsetGREEK = 1 << 9,
- eFXFontCharsetTURKISH = 1 << 10,
- eFXFontCharsetHEBREW = 1 << 11,
- eFXFontCharsetARABIC = 1 << 12,
- eFXFontCharsetBALTIC = 1 << 13,
-} FX_IOSCHARSET;
-FX_IOSCHARSET FX_GetiOSCharset(int charset);
-typedef enum eFXIOSFONTFLAG {
- eFXFontFlagBold = 1,
- eFXFontFlagItalic = 1 << 1,
- eFXFontFlagFixedPitch = 1 << 2,
- eFXFontFlagSerif = 1 << 3,
- eFXFontFlagScript = 1 << 4,
-} FX_IOSFONTFLAG;
-typedef struct _IOS_FONTDATA {
- FX_DWORD nHashCode;
- const char* psName;
- FX_DWORD charsets;
- FX_DWORD styles;
-} IOS_FONTDATA;
-class CQuartz2D
-{
-public:
- void* createGraphics(CFX_DIBitmap* bitmap);
- void destroyGraphics(void* graphics);
-
- void* CreateFont(FX_LPCBYTE pFontData, FX_DWORD dwFontSize);
- void DestroyFont(void* pFont);
- void setGraphicsTextMatrix(void* graphics, CFX_AffineMatrix* matrix);
- FX_BOOL drawGraphicsString(void* graphics,
- void* font,
- FX_FLOAT fontSize,
- FX_WORD* glyphIndices,
- CGPoint* glyphPositions,
- FX_INT32 chars,
- FX_ARGB argb,
- CFX_AffineMatrix* matrix = NULL);
- void saveGraphicsState(void* graphics);
- void restoreGraphicsState(void* graphics);
-};
-class CApplePlatform : public CFX_Object
-{
-public:
- CApplePlatform()
- {
- m_pFontMapper = NULL;
- }
- ~CApplePlatform()
- {
- if (m_pFontMapper) {
- delete m_pFontMapper;
- }
- }
- CQuartz2D _quartz2d;
- IFX_FontMapper* m_pFontMapper;
-};
-class CFX_QuartzDeviceDriver : public IFX_RenderDeviceDriver
-{
-public:
- CFX_QuartzDeviceDriver(CGContextRef context, FX_INT32 deviceClass);
- virtual ~CFX_QuartzDeviceDriver();
-
- virtual int GetDeviceCaps(int caps_id);
- virtual CFX_Matrix GetCTM() const;
- virtual CFX_DIBitmap* GetBackDrop()
- {
- return NULL;
- }
- virtual void* GetPlatformSurface()
- {
- return NULL;
- }
- virtual FX_BOOL IsPSPrintDriver()
- {
- return FALSE;
- }
- virtual FX_BOOL StartRendering()
- {
- return TRUE;
- }
- virtual void EndRendering() {}
- virtual void SaveState();
- virtual void RestoreState(FX_BOOL bKeepSaved);
- virtual FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData,
- const CFX_AffineMatrix* pObject2Device,
- int fill_mode
- );
- virtual FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData,
- const CFX_AffineMatrix* pObject2Device,
- const CFX_GraphStateData* pGraphState
- );
- virtual FX_BOOL DrawPath(const CFX_PathData* pPathData,
- const CFX_AffineMatrix* pObject2Device,
- const CFX_GraphStateData* pGraphState,
- FX_DWORD fill_color,
- FX_DWORD stroke_color,
- int fill_mode,
- int alpha_flag = 0,
- void* pIccTransform = NULL,
- int blend_type = FXDIB_BLEND_NORMAL
- );
- virtual FX_BOOL SetPixel(int x, int y, FX_DWORD color,
- int alpha_flag = 0, void* pIccTransform = NULL)
- {
- return FALSE;
- }
- virtual FX_BOOL FillRect(const FX_RECT* pRect, FX_DWORD fill_color,
- int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL);
- virtual FX_BOOL DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, FX_DWORD color,
- int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL);
- virtual FX_BOOL GetClipBox(FX_RECT* pRect);
- virtual FX_BOOL GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform = NULL, FX_BOOL bDEdge = FALSE);
- virtual FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, const FX_RECT* pSrcRect,
- int dest_left, int dest_top, int blend_type,
- int alpha_flag = 0, void* pIccTransform = NULL);
- virtual FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, int dest_left, int dest_top,
- int dest_width, int dest_height, const FX_RECT* pClipRect, FX_DWORD flags,
- int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL);
- virtual FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD color,
- const CFX_AffineMatrix* pMatrix, FX_DWORD flags, FX_LPVOID& handle,
- int alpha_flag = 0, void* pIccTransform = NULL,
- int blend_type = FXDIB_BLEND_NORMAL)
- {
- return FALSE;
- }
- virtual FX_BOOL ContinueDIBits(FX_LPVOID handle, IFX_Pause* pPause)
- {
- return FALSE;
- }
- virtual void CancelDIBits(FX_LPVOID handle) {}
- virtual FX_BOOL DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont,
- CFX_FontCache* pCache, const CFX_AffineMatrix* pObject2Device, FX_FLOAT font_size, FX_DWORD color,
- int alpha_flag = 0, void* pIccTransform = NULL);
- virtual void ClearDriver();
-protected:
- void setStrokeInfo(const CFX_GraphStateData * graphState, FX_ARGB argb, FX_FLOAT lineWidth);
- void setFillInfo(FX_ARGB argb);
- void setPathToContext(const CFX_PathData * pathData);
- FX_FLOAT getLineWidth(const CFX_GraphStateData * graphState, CGAffineTransform ctm);
- FX_BOOL CG_DrawGlypRun(int nChars,
- const FXTEXT_CHARPOS* pCharPos,
- CFX_Font* pFont,
- CFX_FontCache* pCache,
- const CFX_AffineMatrix* pGlyphMatrix,
- const CFX_AffineMatrix* pObject2Device,
- FX_FLOAT font_size,
- FX_DWORD argb,
- int alpha_flag,
- void* pIccTransform);
- void CG_SetImageTransform(int dest_left, int dest_top, int dest_width, int dest_height, CGRect* rect = NULL);
-protected:
- CGContextRef _context;
- CGAffineTransform _foxitDevice2User;
- CGAffineTransform _user2FoxitDevice;
- FX_INT32 m_saveCount;
-
- FX_INT32 _width;
- FX_INT32 _height;
- FX_INT32 _bitsPerPixel;
- FX_INT32 _deviceClass;
- FX_INT32 _renderCaps;
- FX_INT32 _horzSize;
- FX_INT32 _vertSize;
-};
-class CFX_FontProvider : public IFX_FileRead
-{
-public:
- virtual void Release()
- {
- delete this;
- }
- virtual FX_FILESIZE GetSize()
- {
- return (FX_FILESIZE)_totalSize;
- }
- virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size);
-
- virtual FX_BOOL IsEOF()
- {
- return _offSet == _totalSize;
- }
- virtual FX_FILESIZE GetPosition()
- {
- return (FX_FILESIZE)_offSet;
- }
- virtual size_t ReadBlock(void* buffer, size_t size);
-public:
- CFX_FontProvider(CGFontRef cgFont);
- ~CFX_FontProvider();
- void InitTableOffset();
- unsigned long Read(unsigned long offset, unsigned char *buffer, unsigned long count);
-protected:
- uint32_t CalcTableCheckSum(const uint32_t *table, uint32_t numberOfBytesInTable);
- uint32_t CalcTableDataRefCheckSum(CFDataRef dataRef);
-private:
- CGFontRef m_cgFont;
- UInt32 m_iTableSize;
- size_t _offSet;
- typedef struct FontHeader {
- int32_t fVersion;
- uint16_t fNumTables;
- uint16_t fSearchRange;
- uint16_t fEntrySelector;
- uint16_t fRangeShift;
- } FontHeader;
- typedef struct TableEntry {
- uint32_t fTag;
- uint32_t fCheckSum;
- uint32_t fOffset;
- uint32_t fLength;
- } TableEntry;
- FontHeader _fontHeader;
- unsigned char * _tableEntries;
- size_t * _tableOffsets;
- int _tableCount;
- int _totalSize;
-};
-FX_UINT32 FX_GetHashCode( FX_LPCSTR pStr);
-FX_DWORD FX_IOSGetMatchFamilyNameHashcode(FX_LPCSTR pFontName);
-FX_UINT32 FX_IOSGetFamilyNamesCount();
-FX_LPCSTR FX_IOSGetFamilyName( FX_UINT32 uIndex);
-#endif
-#endif
+// 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 _APPLE_INT_H_
+#define _APPLE_INT_H_
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
+#if _FX_OS_ == _FX_MACOSX_
+#include <Carbon/Carbon.h>
+#endif
+typedef enum eFXIOSFONTCHARSET {
+ eFXFontCharsetDEFAULT = 0,
+ eFXFontCharsetANSI = 1,
+ eFXFontCharsetSYMBOL = 1 << 1,
+ eFXFontCharsetSHIFTJIS = 1 << 2,
+ eFXFontCharsetHANGEUL = 1 << 3,
+ eFXFontCharsetGB2312 = 1 << 4,
+ eFXFontCharsetCHINESEBIG5 = 1 << 5,
+ eFXFontCharsetTHAI = 1 << 6,
+ eFXFontCharsetEASTEUROPE = 1 << 7,
+ eFXFontCharsetRUSSIAN = 1 << 8,
+ eFXFontCharsetGREEK = 1 << 9,
+ eFXFontCharsetTURKISH = 1 << 10,
+ eFXFontCharsetHEBREW = 1 << 11,
+ eFXFontCharsetARABIC = 1 << 12,
+ eFXFontCharsetBALTIC = 1 << 13,
+} FX_IOSCHARSET;
+FX_IOSCHARSET FX_GetiOSCharset(int charset);
+typedef enum eFXIOSFONTFLAG {
+ eFXFontFlagBold = 1,
+ eFXFontFlagItalic = 1 << 1,
+ eFXFontFlagFixedPitch = 1 << 2,
+ eFXFontFlagSerif = 1 << 3,
+ eFXFontFlagScript = 1 << 4,
+} FX_IOSFONTFLAG;
+typedef struct _IOS_FONTDATA {
+ FX_DWORD nHashCode;
+ const char* psName;
+ FX_DWORD charsets;
+ FX_DWORD styles;
+} IOS_FONTDATA;
+class CQuartz2D
+{
+public:
+ void* createGraphics(CFX_DIBitmap* bitmap);
+ void destroyGraphics(void* graphics);
+
+ void* CreateFont(FX_LPCBYTE pFontData, FX_DWORD dwFontSize);
+ void DestroyFont(void* pFont);
+ void setGraphicsTextMatrix(void* graphics, CFX_AffineMatrix* matrix);
+ FX_BOOL drawGraphicsString(void* graphics,
+ void* font,
+ FX_FLOAT fontSize,
+ FX_WORD* glyphIndices,
+ CGPoint* glyphPositions,
+ FX_INT32 chars,
+ FX_ARGB argb,
+ CFX_AffineMatrix* matrix = NULL);
+ void saveGraphicsState(void* graphics);
+ void restoreGraphicsState(void* graphics);
+};
+class CApplePlatform : public CFX_Object
+{
+public:
+ CApplePlatform()
+ {
+ m_pFontMapper = NULL;
+ }
+ ~CApplePlatform()
+ {
+ if (m_pFontMapper) {
+ delete m_pFontMapper;
+ }
+ }
+ CQuartz2D _quartz2d;
+ IFX_FontMapper* m_pFontMapper;
+};
+class CFX_QuartzDeviceDriver : public IFX_RenderDeviceDriver
+{
+public:
+ CFX_QuartzDeviceDriver(CGContextRef context, FX_INT32 deviceClass);
+ virtual ~CFX_QuartzDeviceDriver();
+
+ virtual int GetDeviceCaps(int caps_id);
+ virtual CFX_Matrix GetCTM() const;
+ virtual CFX_DIBitmap* GetBackDrop()
+ {
+ return NULL;
+ }
+ virtual void* GetPlatformSurface()
+ {
+ return NULL;
+ }
+ virtual FX_BOOL IsPSPrintDriver()
+ {
+ return FALSE;
+ }
+ virtual FX_BOOL StartRendering()
+ {
+ return TRUE;
+ }
+ virtual void EndRendering() {}
+ virtual void SaveState();
+ virtual void RestoreState(FX_BOOL bKeepSaved);
+ virtual FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData,
+ const CFX_AffineMatrix* pObject2Device,
+ int fill_mode
+ );
+ virtual FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData,
+ const CFX_AffineMatrix* pObject2Device,
+ const CFX_GraphStateData* pGraphState
+ );
+ virtual FX_BOOL DrawPath(const CFX_PathData* pPathData,
+ const CFX_AffineMatrix* pObject2Device,
+ const CFX_GraphStateData* pGraphState,
+ FX_DWORD fill_color,
+ FX_DWORD stroke_color,
+ int fill_mode,
+ int alpha_flag = 0,
+ void* pIccTransform = NULL,
+ int blend_type = FXDIB_BLEND_NORMAL
+ );
+ virtual FX_BOOL SetPixel(int x, int y, FX_DWORD color,
+ int alpha_flag = 0, void* pIccTransform = NULL)
+ {
+ return FALSE;
+ }
+ virtual FX_BOOL FillRect(const FX_RECT* pRect, FX_DWORD fill_color,
+ int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL);
+ virtual FX_BOOL DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, FX_DWORD color,
+ int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL);
+ virtual FX_BOOL GetClipBox(FX_RECT* pRect);
+ virtual FX_BOOL GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform = NULL, FX_BOOL bDEdge = FALSE);
+ virtual FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, const FX_RECT* pSrcRect,
+ int dest_left, int dest_top, int blend_type,
+ int alpha_flag = 0, void* pIccTransform = NULL);
+ virtual FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, int dest_left, int dest_top,
+ int dest_width, int dest_height, const FX_RECT* pClipRect, FX_DWORD flags,
+ int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL);
+ virtual FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD color,
+ const CFX_AffineMatrix* pMatrix, FX_DWORD flags, FX_LPVOID& handle,
+ int alpha_flag = 0, void* pIccTransform = NULL,
+ int blend_type = FXDIB_BLEND_NORMAL)
+ {
+ return FALSE;
+ }
+ virtual FX_BOOL ContinueDIBits(FX_LPVOID handle, IFX_Pause* pPause)
+ {
+ return FALSE;
+ }
+ virtual void CancelDIBits(FX_LPVOID handle) {}
+ virtual FX_BOOL DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont,
+ CFX_FontCache* pCache, const CFX_AffineMatrix* pObject2Device, FX_FLOAT font_size, FX_DWORD color,
+ int alpha_flag = 0, void* pIccTransform = NULL);
+ virtual void ClearDriver();
+protected:
+ void setStrokeInfo(const CFX_GraphStateData * graphState, FX_ARGB argb, FX_FLOAT lineWidth);
+ void setFillInfo(FX_ARGB argb);
+ void setPathToContext(const CFX_PathData * pathData);
+ FX_FLOAT getLineWidth(const CFX_GraphStateData * graphState, CGAffineTransform ctm);
+ FX_BOOL CG_DrawGlypRun(int nChars,
+ const FXTEXT_CHARPOS* pCharPos,
+ CFX_Font* pFont,
+ CFX_FontCache* pCache,
+ const CFX_AffineMatrix* pGlyphMatrix,
+ const CFX_AffineMatrix* pObject2Device,
+ FX_FLOAT font_size,
+ FX_DWORD argb,
+ int alpha_flag,
+ void* pIccTransform);
+ void CG_SetImageTransform(int dest_left, int dest_top, int dest_width, int dest_height, CGRect* rect = NULL);
+protected:
+ CGContextRef _context;
+ CGAffineTransform _foxitDevice2User;
+ CGAffineTransform _user2FoxitDevice;
+ FX_INT32 m_saveCount;
+
+ FX_INT32 _width;
+ FX_INT32 _height;
+ FX_INT32 _bitsPerPixel;
+ FX_INT32 _deviceClass;
+ FX_INT32 _renderCaps;
+ FX_INT32 _horzSize;
+ FX_INT32 _vertSize;
+};
+class CFX_FontProvider : public IFX_FileRead
+{
+public:
+ virtual void Release()
+ {
+ delete this;
+ }
+ virtual FX_FILESIZE GetSize()
+ {
+ return (FX_FILESIZE)_totalSize;
+ }
+ virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size);
+
+ virtual FX_BOOL IsEOF()
+ {
+ return _offSet == _totalSize;
+ }
+ virtual FX_FILESIZE GetPosition()
+ {
+ return (FX_FILESIZE)_offSet;
+ }
+ virtual size_t ReadBlock(void* buffer, size_t size);
+public:
+ CFX_FontProvider(CGFontRef cgFont);
+ ~CFX_FontProvider();
+ void InitTableOffset();
+ unsigned long Read(unsigned long offset, unsigned char *buffer, unsigned long count);
+protected:
+ uint32_t CalcTableCheckSum(const uint32_t *table, uint32_t numberOfBytesInTable);
+ uint32_t CalcTableDataRefCheckSum(CFDataRef dataRef);
+private:
+ CGFontRef m_cgFont;
+ UInt32 m_iTableSize;
+ size_t _offSet;
+ typedef struct FontHeader {
+ int32_t fVersion;
+ uint16_t fNumTables;
+ uint16_t fSearchRange;
+ uint16_t fEntrySelector;
+ uint16_t fRangeShift;
+ } FontHeader;
+ typedef struct TableEntry {
+ uint32_t fTag;
+ uint32_t fCheckSum;
+ uint32_t fOffset;
+ uint32_t fLength;
+ } TableEntry;
+ FontHeader _fontHeader;
+ unsigned char * _tableEntries;
+ size_t * _tableOffsets;
+ int _tableCount;
+ int _totalSize;
+};
+FX_UINT32 FX_GetHashCode( FX_LPCSTR pStr);
+FX_DWORD FX_IOSGetMatchFamilyNameHashcode(FX_LPCSTR pFontName);
+FX_UINT32 FX_IOSGetFamilyNamesCount();
+FX_LPCSTR FX_IOSGetFamilyName( FX_UINT32 uIndex);
+#endif
+#endif
diff --git a/core/src/fxge/apple/fx_apple_platform.cpp b/core/src/fxge/apple/fx_apple_platform.cpp
index 229d1785da..7bc1232900 100644
--- a/core/src/fxge/apple/fx_apple_platform.cpp
+++ b/core/src/fxge/apple/fx_apple_platform.cpp
@@ -1,173 +1,173 @@
-// 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
-
-#include "../../../include/fxcrt/fx_ext.h"
-#include "../../../include/fxge/fx_ge.h"
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
-#include "apple_int.h"
-#include "../../../include/fxge/fx_ge_apple.h"
-#include "../agg/include/fxfx_agg_clip_liang_barsky.h"
-#include "../ge/text_int.h"
-#include "../dib/dib_int.h"
-#include "../agg/include/fx_agg_driver.h"
-#include "../../../include/fxge/fx_freetype.h"
-#if (_FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ && (!defined(_FPDFAPI_MINI_)))
-void CFX_AggDeviceDriver::InitPlatform()
-{
- CQuartz2D & quartz2d = ((CApplePlatform *) CFX_GEModule::Get()->GetPlatformData())->_quartz2d;
- m_pPlatformGraphics = quartz2d.createGraphics(m_pBitmap);
-}
-void CFX_AggDeviceDriver::DestroyPlatform()
-{
- CQuartz2D & quartz2d = ((CApplePlatform *) CFX_GEModule::Get()->GetPlatformData())->_quartz2d;
- if (m_pPlatformGraphics) {
- quartz2d.destroyGraphics(m_pPlatformGraphics);
- m_pPlatformGraphics = NULL;
- }
-}
-void CFX_FaceCache::InitPlatform() {}
-void CFX_FaceCache::DestroyPlatform() {}
-CFX_GlyphBitmap* CFX_FaceCache::RenderGlyph_Nativetext(CFX_Font * pFont,
- FX_DWORD glyph_index,
- const CFX_AffineMatrix * pMatrix,
- int dest_width,
- int anti_alias)
-{
- return NULL;
-}
-static FX_BOOL _CGDrawGlyphRun(CGContextRef pContext,
- int nChars,
- const FXTEXT_CHARPOS* pCharPos,
- CFX_Font* pFont,
- CFX_FontCache* pCache,
- const CFX_AffineMatrix* pObject2Device,
- FX_FLOAT font_size,
- FX_DWORD argb,
- int alpha_flag,
- void* pIccTransform)
-{
- if (nChars == 0) {
- return TRUE;
- }
- CFX_AffineMatrix new_matrix;
- FX_BOOL bNegSize = font_size < 0;
- if (bNegSize) {
- font_size = -font_size;
- }
- FX_FLOAT ori_x = pCharPos[0].m_OriginX, ori_y = pCharPos[0].m_OriginY;
- new_matrix.Transform(ori_x, ori_y);
- if (pObject2Device) {
- new_matrix.Concat(*pObject2Device);
- }
- CQuartz2D& quartz2d = ((CApplePlatform *) CFX_GEModule::Get()->GetPlatformData())->_quartz2d;
- if (!pFont->m_pPlatformFont) {
- if (pFont->GetPsName() == CFX_WideString::FromLocal("DFHeiStd-W5")) {
- return FALSE;
- }
- pFont->m_pPlatformFont = quartz2d.CreateFont(pFont->m_pFontData, pFont->m_dwSize);
- if (NULL == pFont->m_pPlatformFont) {
- return FALSE;
- }
- }
- CFX_FixedBufGrow<FX_WORD, 32> glyph_indices(nChars);
- CFX_FixedBufGrow<CGPoint, 32> glyph_positions(nChars);
- for (int i = 0; i < nChars; i++ ) {
- glyph_indices[i] = pCharPos[i].m_ExtGID;
- if (bNegSize) {
- glyph_positions[i].x = -pCharPos[i].m_OriginX;
- } else {
- glyph_positions[i].x = pCharPos[i].m_OriginX;
- }
- glyph_positions[i].y = pCharPos[i].m_OriginY;
- }
- if (bNegSize) {
- new_matrix.a = -new_matrix.a;
- } else {
- new_matrix.b = -new_matrix.b;
- new_matrix.d = -new_matrix.d;
- }
- quartz2d.setGraphicsTextMatrix(pContext, &new_matrix);
- return quartz2d.drawGraphicsString(pContext,
- pFont->m_pPlatformFont,
- font_size,
- glyph_indices,
- glyph_positions,
- nChars,
- argb,
- NULL);
-}
-static void _DoNothing(void *info, const void *data, size_t size) {}
-FX_BOOL CFX_AggDeviceDriver::DrawDeviceText(int nChars,
- const FXTEXT_CHARPOS * pCharPos,
- CFX_Font * pFont,
- CFX_FontCache * pCache,
- const CFX_AffineMatrix * pObject2Device,
- FX_FLOAT font_size,
- FX_DWORD argb,
- int alpha_flag, void* pIccTransform)
-{
- if (!pFont) {
- return FALSE;
- }
- FX_BOOL bBold = pFont->IsBold();
- if (!bBold && pFont->GetSubstFont() &&
- pFont->GetSubstFont()->m_Weight >= 500 &&
- pFont->GetSubstFont()->m_Weight <= 600) {
- return FALSE;
- }
- for (int i = 0; i < nChars; i ++) {
- if (pCharPos[i].m_bGlyphAdjust) {
- return FALSE;
- }
- }
- CGContextRef ctx = CGContextRef(m_pPlatformGraphics);
- if (NULL == ctx) {
- return FALSE;
- }
- CGContextSaveGState(ctx);
- CGContextSetTextDrawingMode(ctx, kCGTextFillClip);
- CGRect rect_cg;
- CGImageRef pImageCG = NULL;
- if (m_pClipRgn) {
- rect_cg = CGRectMake(m_pClipRgn->GetBox().left, m_pClipRgn->GetBox().top, m_pClipRgn->GetBox().Width(), m_pClipRgn->GetBox().Height());
- const CFX_DIBitmap* pClipMask = m_pClipRgn->GetMask();
- if (pClipMask) {
- CGDataProviderRef pClipMaskDataProvider = CGDataProviderCreateWithData(NULL,
- pClipMask->GetBuffer(),
- pClipMask->GetPitch() * pClipMask->GetHeight(),
- _DoNothing);
- CGFloat decode_f[2] = {255.f, 0.f};
- pImageCG = CGImageMaskCreate(pClipMask->GetWidth(), pClipMask->GetHeight(),
- 8, 8, pClipMask->GetPitch(), pClipMaskDataProvider,
- decode_f, FALSE);
- CGDataProviderRelease(pClipMaskDataProvider);
- }
- } else {
- rect_cg = CGRectMake(0, 0, m_pBitmap->GetWidth(), m_pBitmap->GetHeight());
- }
- rect_cg = CGContextConvertRectToDeviceSpace(ctx, rect_cg);
- if (pImageCG) {
- CGContextClipToMask(ctx, rect_cg, pImageCG);
- } else {
- CGContextClipToRect(ctx, rect_cg);
- }
- FX_BOOL ret = _CGDrawGlyphRun(ctx, nChars, pCharPos, pFont, pCache, pObject2Device, font_size, argb, alpha_flag, pIccTransform);
- if (pImageCG) {
- CGImageRelease(pImageCG);
- }
- CGContextRestoreGState(ctx);
- return ret;
-}
-void CFX_Font::ReleasePlatformResource()
-{
- if (m_pPlatformFont) {
- CQuartz2D & quartz2d = ((CApplePlatform *) CFX_GEModule::Get()->GetPlatformData())->_quartz2d;
- quartz2d.DestroyFont(m_pPlatformFont);
- m_pPlatformFont = NULL;
- }
-}
-#endif
-#endif
+// 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
+
+#include "../../../include/fxcrt/fx_ext.h"
+#include "../../../include/fxge/fx_ge.h"
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
+#include "apple_int.h"
+#include "../../../include/fxge/fx_ge_apple.h"
+#include "../agg/include/fxfx_agg_clip_liang_barsky.h"
+#include "../ge/text_int.h"
+#include "../dib/dib_int.h"
+#include "../agg/include/fx_agg_driver.h"
+#include "../../../include/fxge/fx_freetype.h"
+#if (_FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ && (!defined(_FPDFAPI_MINI_)))
+void CFX_AggDeviceDriver::InitPlatform()
+{
+ CQuartz2D & quartz2d = ((CApplePlatform *) CFX_GEModule::Get()->GetPlatformData())->_quartz2d;
+ m_pPlatformGraphics = quartz2d.createGraphics(m_pBitmap);
+}
+void CFX_AggDeviceDriver::DestroyPlatform()
+{
+ CQuartz2D & quartz2d = ((CApplePlatform *) CFX_GEModule::Get()->GetPlatformData())->_quartz2d;
+ if (m_pPlatformGraphics) {
+ quartz2d.destroyGraphics(m_pPlatformGraphics);
+ m_pPlatformGraphics = NULL;
+ }
+}
+void CFX_FaceCache::InitPlatform() {}
+void CFX_FaceCache::DestroyPlatform() {}
+CFX_GlyphBitmap* CFX_FaceCache::RenderGlyph_Nativetext(CFX_Font * pFont,
+ FX_DWORD glyph_index,
+ const CFX_AffineMatrix * pMatrix,
+ int dest_width,
+ int anti_alias)
+{
+ return NULL;
+}
+static FX_BOOL _CGDrawGlyphRun(CGContextRef pContext,
+ int nChars,
+ const FXTEXT_CHARPOS* pCharPos,
+ CFX_Font* pFont,
+ CFX_FontCache* pCache,
+ const CFX_AffineMatrix* pObject2Device,
+ FX_FLOAT font_size,
+ FX_DWORD argb,
+ int alpha_flag,
+ void* pIccTransform)
+{
+ if (nChars == 0) {
+ return TRUE;
+ }
+ CFX_AffineMatrix new_matrix;
+ FX_BOOL bNegSize = font_size < 0;
+ if (bNegSize) {
+ font_size = -font_size;
+ }
+ FX_FLOAT ori_x = pCharPos[0].m_OriginX, ori_y = pCharPos[0].m_OriginY;
+ new_matrix.Transform(ori_x, ori_y);
+ if (pObject2Device) {
+ new_matrix.Concat(*pObject2Device);
+ }
+ CQuartz2D& quartz2d = ((CApplePlatform *) CFX_GEModule::Get()->GetPlatformData())->_quartz2d;
+ if (!pFont->m_pPlatformFont) {
+ if (pFont->GetPsName() == CFX_WideString::FromLocal("DFHeiStd-W5")) {
+ return FALSE;
+ }
+ pFont->m_pPlatformFont = quartz2d.CreateFont(pFont->m_pFontData, pFont->m_dwSize);
+ if (NULL == pFont->m_pPlatformFont) {
+ return FALSE;
+ }
+ }
+ CFX_FixedBufGrow<FX_WORD, 32> glyph_indices(nChars);
+ CFX_FixedBufGrow<CGPoint, 32> glyph_positions(nChars);
+ for (int i = 0; i < nChars; i++ ) {
+ glyph_indices[i] = pCharPos[i].m_ExtGID;
+ if (bNegSize) {
+ glyph_positions[i].x = -pCharPos[i].m_OriginX;
+ } else {
+ glyph_positions[i].x = pCharPos[i].m_OriginX;
+ }
+ glyph_positions[i].y = pCharPos[i].m_OriginY;
+ }
+ if (bNegSize) {
+ new_matrix.a = -new_matrix.a;
+ } else {
+ new_matrix.b = -new_matrix.b;
+ new_matrix.d = -new_matrix.d;
+ }
+ quartz2d.setGraphicsTextMatrix(pContext, &new_matrix);
+ return quartz2d.drawGraphicsString(pContext,
+ pFont->m_pPlatformFont,
+ font_size,
+ glyph_indices,
+ glyph_positions,
+ nChars,
+ argb,
+ NULL);
+}
+static void _DoNothing(void *info, const void *data, size_t size) {}
+FX_BOOL CFX_AggDeviceDriver::DrawDeviceText(int nChars,
+ const FXTEXT_CHARPOS * pCharPos,
+ CFX_Font * pFont,
+ CFX_FontCache * pCache,
+ const CFX_AffineMatrix * pObject2Device,
+ FX_FLOAT font_size,
+ FX_DWORD argb,
+ int alpha_flag, void* pIccTransform)
+{
+ if (!pFont) {
+ return FALSE;
+ }
+ FX_BOOL bBold = pFont->IsBold();
+ if (!bBold && pFont->GetSubstFont() &&
+ pFont->GetSubstFont()->m_Weight >= 500 &&
+ pFont->GetSubstFont()->m_Weight <= 600) {
+ return FALSE;
+ }
+ for (int i = 0; i < nChars; i ++) {
+ if (pCharPos[i].m_bGlyphAdjust) {
+ return FALSE;
+ }
+ }
+ CGContextRef ctx = CGContextRef(m_pPlatformGraphics);
+ if (NULL == ctx) {
+ return FALSE;
+ }
+ CGContextSaveGState(ctx);
+ CGContextSetTextDrawingMode(ctx, kCGTextFillClip);
+ CGRect rect_cg;
+ CGImageRef pImageCG = NULL;
+ if (m_pClipRgn) {
+ rect_cg = CGRectMake(m_pClipRgn->GetBox().left, m_pClipRgn->GetBox().top, m_pClipRgn->GetBox().Width(), m_pClipRgn->GetBox().Height());
+ const CFX_DIBitmap* pClipMask = m_pClipRgn->GetMask();
+ if (pClipMask) {
+ CGDataProviderRef pClipMaskDataProvider = CGDataProviderCreateWithData(NULL,
+ pClipMask->GetBuffer(),
+ pClipMask->GetPitch() * pClipMask->GetHeight(),
+ _DoNothing);
+ CGFloat decode_f[2] = {255.f, 0.f};
+ pImageCG = CGImageMaskCreate(pClipMask->GetWidth(), pClipMask->GetHeight(),
+ 8, 8, pClipMask->GetPitch(), pClipMaskDataProvider,
+ decode_f, FALSE);
+ CGDataProviderRelease(pClipMaskDataProvider);
+ }
+ } else {
+ rect_cg = CGRectMake(0, 0, m_pBitmap->GetWidth(), m_pBitmap->GetHeight());
+ }
+ rect_cg = CGContextConvertRectToDeviceSpace(ctx, rect_cg);
+ if (pImageCG) {
+ CGContextClipToMask(ctx, rect_cg, pImageCG);
+ } else {
+ CGContextClipToRect(ctx, rect_cg);
+ }
+ FX_BOOL ret = _CGDrawGlyphRun(ctx, nChars, pCharPos, pFont, pCache, pObject2Device, font_size, argb, alpha_flag, pIccTransform);
+ if (pImageCG) {
+ CGImageRelease(pImageCG);
+ }
+ CGContextRestoreGState(ctx);
+ return ret;
+}
+void CFX_Font::ReleasePlatformResource()
+{
+ if (m_pPlatformFont) {
+ CQuartz2D & quartz2d = ((CApplePlatform *) CFX_GEModule::Get()->GetPlatformData())->_quartz2d;
+ quartz2d.DestroyFont(m_pPlatformFont);
+ m_pPlatformFont = NULL;
+ }
+}
+#endif
+#endif
diff --git a/core/src/fxge/apple/fx_mac_imp.cpp b/core/src/fxge/apple/fx_mac_imp.cpp
index 9a1218bf0b..a21aa5ded5 100644
--- a/core/src/fxge/apple/fx_mac_imp.cpp
+++ b/core/src/fxge/apple/fx_mac_imp.cpp
@@ -1,117 +1,117 @@
-// 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
-
-#include "../../../include/fxge/fx_ge.h"
-#include "apple_int.h"
-#if _FX_OS_ == _FX_MACOSX_
-static const struct {
- FX_LPCSTR m_pName;
- FX_LPCSTR m_pSubstName;
-}
-Base14Substs[] = {
- {"Courier", "Courier New"},
- {"Courier-Bold", "Courier New Bold"},
- {"Courier-BoldOblique", "Courier New Bold Italic"},
- {"Courier-Oblique", "Courier New Italic"},
- {"Helvetica", "Arial"},
- {"Helvetica-Bold", "Arial Bold"},
- {"Helvetica-BoldOblique", "Arial Bold Italic"},
- {"Helvetica-Oblique", "Arial Italic"},
- {"Times-Roman", "Times New Roman"},
- {"Times-Bold", "Times New Roman Bold"},
- {"Times-BoldItalic", "Times New Roman Bold Italic"},
- {"Times-Italic", "Times New Roman Italic"},
-};
-#if !defined(_FPDFAPI_MINI_)
-class CFX_MacFontInfo : public CFX_FolderFontInfo
-{
-public:
- virtual void* MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, FX_LPCSTR family, FX_BOOL& bExact);
-};
-#define JAPAN_GOTHIC "Hiragino Kaku Gothic Pro W6"
-#define JAPAN_MINCHO "Hiragino Mincho Pro W6"
-static void GetJapanesePreference(CFX_ByteString& face, int weight, int picth_family)
-{
- if (face.Find("Gothic") >= 0) {
- face = JAPAN_GOTHIC;
- return;
- }
- if (!(picth_family & FXFONT_FF_ROMAN) && weight > 400) {
- face = JAPAN_GOTHIC;
- } else {
- face = JAPAN_MINCHO;
- }
-}
-void* CFX_MacFontInfo::MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, FX_LPCSTR cstr_face, FX_BOOL& bExact)
-{
- CFX_ByteString face = cstr_face;
- int iBaseFont;
- for (iBaseFont = 0; iBaseFont < 12; iBaseFont ++)
- if (face == CFX_ByteStringC(Base14Substs[iBaseFont].m_pName)) {
- face = Base14Substs[iBaseFont].m_pSubstName;
- bExact = TRUE;
- break;
- }
- if (iBaseFont < 12) {
- return GetFont(face);
- }
- FX_LPVOID p;
- if (m_FontList.Lookup(face, p)) {
- return p;
- }
- if (charset == FXFONT_ANSI_CHARSET && (pitch_family & FXFONT_FF_FIXEDPITCH)) {
- return GetFont("Courier New");
- }
- if (charset == FXFONT_ANSI_CHARSET || charset == FXFONT_SYMBOL_CHARSET) {
- return NULL;
- }
- switch (charset) {
- case FXFONT_SHIFTJIS_CHARSET:
- GetJapanesePreference(face, weight, pitch_family);
- break;
- case FXFONT_GB2312_CHARSET:
- face = "STSong";
- break;
- case FXFONT_HANGEUL_CHARSET:
- face = "AppleMyungjo";
- break;
- case FXFONT_CHINESEBIG5_CHARSET:
- face = "LiSong Pro Light";
- }
- if (m_FontList.Lookup(face, p)) {
- return p;
- }
- return NULL;
-}
-#endif
-IFX_SystemFontInfo* IFX_SystemFontInfo::CreateDefault()
-{
-#if !defined(_FPDFAPI_MINI_)
- CFX_MacFontInfo* pInfo = FX_NEW CFX_MacFontInfo;
- if (!pInfo) {
- return NULL;
- }
- pInfo->AddPath("~/Library/Fonts");
- pInfo->AddPath("/Library/Fonts");
- pInfo->AddPath("/System/Library/Fonts");
- return pInfo;
-#else
- return NULL;
-#endif
-}
-void CFX_GEModule::InitPlatform()
-{
- m_pPlatformData = FX_NEW CApplePlatform;
- m_pFontMgr->SetSystemFontInfo(IFX_SystemFontInfo::CreateDefault());
-}
-void CFX_GEModule::DestroyPlatform()
-{
- if (m_pPlatformData) {
- delete (CApplePlatform *) m_pPlatformData;
- }
- m_pPlatformData = NULL;
-}
-#endif
+// 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
+
+#include "../../../include/fxge/fx_ge.h"
+#include "apple_int.h"
+#if _FX_OS_ == _FX_MACOSX_
+static const struct {
+ FX_LPCSTR m_pName;
+ FX_LPCSTR m_pSubstName;
+}
+Base14Substs[] = {
+ {"Courier", "Courier New"},
+ {"Courier-Bold", "Courier New Bold"},
+ {"Courier-BoldOblique", "Courier New Bold Italic"},
+ {"Courier-Oblique", "Courier New Italic"},
+ {"Helvetica", "Arial"},
+ {"Helvetica-Bold", "Arial Bold"},
+ {"Helvetica-BoldOblique", "Arial Bold Italic"},
+ {"Helvetica-Oblique", "Arial Italic"},
+ {"Times-Roman", "Times New Roman"},
+ {"Times-Bold", "Times New Roman Bold"},
+ {"Times-BoldItalic", "Times New Roman Bold Italic"},
+ {"Times-Italic", "Times New Roman Italic"},
+};
+#if !defined(_FPDFAPI_MINI_)
+class CFX_MacFontInfo : public CFX_FolderFontInfo
+{
+public:
+ virtual void* MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, FX_LPCSTR family, FX_BOOL& bExact);
+};
+#define JAPAN_GOTHIC "Hiragino Kaku Gothic Pro W6"
+#define JAPAN_MINCHO "Hiragino Mincho Pro W6"
+static void GetJapanesePreference(CFX_ByteString& face, int weight, int picth_family)
+{
+ if (face.Find("Gothic") >= 0) {
+ face = JAPAN_GOTHIC;
+ return;
+ }
+ if (!(picth_family & FXFONT_FF_ROMAN) && weight > 400) {
+ face = JAPAN_GOTHIC;
+ } else {
+ face = JAPAN_MINCHO;
+ }
+}
+void* CFX_MacFontInfo::MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, FX_LPCSTR cstr_face, FX_BOOL& bExact)
+{
+ CFX_ByteString face = cstr_face;
+ int iBaseFont;
+ for (iBaseFont = 0; iBaseFont < 12; iBaseFont ++)
+ if (face == CFX_ByteStringC(Base14Substs[iBaseFont].m_pName)) {
+ face = Base14Substs[iBaseFont].m_pSubstName;
+ bExact = TRUE;
+ break;
+ }
+ if (iBaseFont < 12) {
+ return GetFont(face);
+ }
+ FX_LPVOID p;
+ if (m_FontList.Lookup(face, p)) {
+ return p;
+ }
+ if (charset == FXFONT_ANSI_CHARSET && (pitch_family & FXFONT_FF_FIXEDPITCH)) {
+ return GetFont("Courier New");
+ }
+ if (charset == FXFONT_ANSI_CHARSET || charset == FXFONT_SYMBOL_CHARSET) {
+ return NULL;
+ }
+ switch (charset) {
+ case FXFONT_SHIFTJIS_CHARSET:
+ GetJapanesePreference(face, weight, pitch_family);
+ break;
+ case FXFONT_GB2312_CHARSET:
+ face = "STSong";
+ break;
+ case FXFONT_HANGEUL_CHARSET:
+ face = "AppleMyungjo";
+ break;
+ case FXFONT_CHINESEBIG5_CHARSET:
+ face = "LiSong Pro Light";
+ }
+ if (m_FontList.Lookup(face, p)) {
+ return p;
+ }
+ return NULL;
+}
+#endif
+IFX_SystemFontInfo* IFX_SystemFontInfo::CreateDefault()
+{
+#if !defined(_FPDFAPI_MINI_)
+ CFX_MacFontInfo* pInfo = FX_NEW CFX_MacFontInfo;
+ if (!pInfo) {
+ return NULL;
+ }
+ pInfo->AddPath("~/Library/Fonts");
+ pInfo->AddPath("/Library/Fonts");
+ pInfo->AddPath("/System/Library/Fonts");
+ return pInfo;
+#else
+ return NULL;
+#endif
+}
+void CFX_GEModule::InitPlatform()
+{
+ m_pPlatformData = FX_NEW CApplePlatform;
+ m_pFontMgr->SetSystemFontInfo(IFX_SystemFontInfo::CreateDefault());
+}
+void CFX_GEModule::DestroyPlatform()
+{
+ if (m_pPlatformData) {
+ delete (CApplePlatform *) m_pPlatformData;
+ }
+ m_pPlatformData = NULL;
+}
+#endif
diff --git a/core/src/fxge/apple/fx_quartz_device.cpp b/core/src/fxge/apple/fx_quartz_device.cpp
index bef45163f7..7cb94f1093 100644
--- a/core/src/fxge/apple/fx_quartz_device.cpp
+++ b/core/src/fxge/apple/fx_quartz_device.cpp
@@ -1,1138 +1,1138 @@
-// 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
-
-#include "../../../include/fxcrt/fx_ext.h"
-#include "../../../include/fxge/fx_ge.h"
-#include "../agg/include/fxfx_agg_clip_liang_barsky.h"
-#include "../ge/text_int.h"
-#include "../dib/dib_int.h"
-#include "../agg/include/fx_agg_driver.h"
-#include "../../../include/fxge/fx_freetype.h"
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
-#include "apple_int.h"
-#include "../../../include/fxge/fx_ge_apple.h"
-#ifndef CGFLOAT_IS_DOUBLE
-#error Expected CGFLOAT_IS_DOUBLE to be defined by CoreGraphics headers
-#endif
-void* CQuartz2D::createGraphics(CFX_DIBitmap* pBitmap)
-{
- if (!pBitmap) {
- return NULL;
- }
- CGBitmapInfo bmpInfo = kCGBitmapByteOrder32Little;
- switch (pBitmap->GetFormat()) {
- case FXDIB_Rgb32:
- bmpInfo |= kCGImageAlphaNoneSkipFirst;
- break;
- case FXDIB_Argb:
- default:
- return NULL;
- }
- CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
- CGContextRef context = CGBitmapContextCreate(pBitmap->GetBuffer(),
- pBitmap->GetWidth(),
- pBitmap->GetHeight(),
- 8,
- pBitmap->GetPitch(),
- colorSpace,
- bmpInfo);
- CGColorSpaceRelease(colorSpace);
- return context;
-}
-void CQuartz2D::destroyGraphics(void* graphics)
-{
- if (graphics) {
- CGContextRelease((CGContextRef) graphics);
- }
-}
-void* CQuartz2D::CreateFont(FX_LPCBYTE pFontData, FX_DWORD dwFontSize)
-{
- CGDataProviderRef pDataProvider = CGDataProviderCreateWithData(NULL, pFontData, (size_t)dwFontSize, NULL);
- if (NULL == pDataProvider) {
- return NULL;
- }
- CGFontRef pCGFont = CGFontCreateWithDataProvider(pDataProvider);
- CGDataProviderRelease(pDataProvider);
- return pCGFont;
-}
-void CQuartz2D::DestroyFont(void* pFont)
-{
- CGFontRelease((CGFontRef)pFont);
-}
-void CQuartz2D::setGraphicsTextMatrix(void* graphics, CFX_AffineMatrix* matrix)
-{
- if (!graphics || !matrix) {
- return;
- }
- CGContextRef context = (CGContextRef) graphics;
- CGFloat ty = CGBitmapContextGetHeight(context) - matrix->f;
- CGContextSetTextMatrix(context, CGAffineTransformMake(matrix->a,
- matrix->b,
- matrix->c,
- matrix->d,
- matrix->e,
- ty));
-}
-FX_BOOL CQuartz2D::drawGraphicsString(void* graphics,
- void* font,
- FX_FLOAT fontSize,
- FX_WORD* glyphIndices,
- CGPoint* glyphPositions,
- FX_INT32 charsCount,
- FX_ARGB argb,
- CFX_AffineMatrix* matrix )
-{
- if (!graphics) {
- return FALSE;
- }
- CGContextRef context = (CGContextRef) graphics;
- CGContextSetFont(context, (CGFontRef)font);
- CGContextSetFontSize(context, fontSize);
- if (matrix) {
- CGAffineTransform m = CGContextGetTextMatrix(context);
- m = CGAffineTransformConcat(m,
- CGAffineTransformMake(matrix->a,
- matrix->b,
- matrix->c,
- matrix->d,
- matrix->e,
- matrix->f));
- CGContextSetTextMatrix(context, m);
- }
- FX_INT32 a, r, g, b;
- ArgbDecode(argb, a, r, g, b);
- CGContextSetRGBFillColor(context,
- r / 255.f,
- g / 255.f,
- b / 255.f,
- a / 255.f);
- CGContextSaveGState(context);
-#if CGFLOAT_IS_DOUBLE
- CGPoint* glyphPositionsCG = new CGPoint[charsCount];
- if (!glyphPositionsCG) {
- return FALSE;
- }
- for (int index = 0; index < charsCount; ++index) {
- glyphPositionsCG[index].x = glyphPositions[index].x;
- glyphPositionsCG[index].y = glyphPositions[index].y;
- }
-#else
- CGPoint* glyphPositionsCG = (CGPoint*)glyphPositions;
-#endif
- CGContextShowGlyphsAtPositions(context,
- (CGGlyph *) glyphIndices,
- glyphPositionsCG,
- charsCount);
-#if CGFLOAT_IS_DOUBLE
- delete[] glyphPositionsCG;
-#endif
- CGContextRestoreGState(context);
- return TRUE;
-}
-void CQuartz2D::saveGraphicsState(void * graphics)
-{
- if (graphics) {
- CGContextSaveGState((CGContextRef) graphics);
- }
-}
-void CQuartz2D::restoreGraphicsState(void * graphics)
-{
- if (graphics) {
- CGContextRestoreGState((CGContextRef) graphics);
- }
-}
-static CGContextRef createContextWithBitmap(CFX_DIBitmap* pBitmap)
-{
- if (!pBitmap || pBitmap->IsCmykImage() || pBitmap->GetBPP() < 32) {
- return NULL;
- }
- CGBitmapInfo bitmapInfo = kCGBitmapByteOrder32Little;
- if (pBitmap->HasAlpha()) {
- bitmapInfo |= kCGImageAlphaPremultipliedFirst;
- } else {
- bitmapInfo |= kCGImageAlphaNoneSkipFirst;
- }
- CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
- CGContextRef context = CGBitmapContextCreate(pBitmap->GetBuffer(),
- pBitmap->GetWidth(),
- pBitmap->GetHeight(),
- 8,
- pBitmap->GetPitch(),
- colorSpace,
- bitmapInfo);
- CGColorSpaceRelease(colorSpace);
- return context;
-}
-CFX_QuartzDeviceDriver::CFX_QuartzDeviceDriver(CGContextRef context, FX_INT32 deviceClass)
-{
- m_saveCount = 0;
- _context = context;
- _deviceClass = deviceClass;
- CGContextRetain(_context);
- CGRect r = CGContextGetClipBoundingBox(context);
- _width = FXSYS_round(r.size.width);
- _height = FXSYS_round(r.size.height);
- _renderCaps = FXRC_SOFT_CLIP | FXRC_BLEND_MODE |
- FXRC_ALPHA_PATH | FXRC_ALPHA_IMAGE |
- FXRC_BIT_MASK | FXRC_ALPHA_MASK;
- if (_deviceClass != FXDC_DISPLAY) {
- } else {
- CGImageRef image = CGBitmapContextCreateImage(_context);
- if (image) {
- _renderCaps |= FXRC_GET_BITS;
- _width = CGImageGetWidth(image);
- _height = CGImageGetHeight(image);
- CGImageAlphaInfo alphaInfo = CGImageGetAlphaInfo(image);
- if (kCGImageAlphaPremultipliedFirst == alphaInfo ||
- kCGImageAlphaPremultipliedLast == alphaInfo ||
- kCGImageAlphaOnly == alphaInfo) {
- _renderCaps |= FXRC_ALPHA_OUTPUT;
- }
- }
- CGImageRelease(image);
- }
- CGAffineTransform ctm = CGContextGetCTM(_context);
- CGContextSaveGState(_context);
- m_saveCount++;
- if (ctm.d >= 0) {
- CGFloat offset_x, offset_y;
- offset_x = ctm.tx;
- offset_y = ctm.ty;
- CGContextTranslateCTM(_context, -offset_x, -offset_y);
- CGContextConcatCTM(_context, CGAffineTransformMake(1, 0, 0, -1, offset_x, _height + offset_y));
- }
- _foxitDevice2User = CGAffineTransformIdentity;
- _user2FoxitDevice = CGAffineTransformInvert(_foxitDevice2User);
-}
-CFX_QuartzDeviceDriver::~CFX_QuartzDeviceDriver()
-{
- CGContextRestoreGState(_context);
- m_saveCount--;
- for (int i = 0; i < m_saveCount; ++i) {
- CGContextRestoreGState(_context);
- }
- if (_context) {
- CGContextRelease(_context);
- }
-}
-int CFX_QuartzDeviceDriver::GetDeviceCaps(int capsID)
-{
- switch (capsID) {
- case FXDC_DEVICE_CLASS: {
- return _deviceClass;
- }
- case FXDC_PIXEL_WIDTH: {
- return _width;
- }
- case FXDC_PIXEL_HEIGHT: {
- return _height;
- }
- case FXDC_BITS_PIXEL: {
- return 32;
- }
- case FXDC_RENDER_CAPS: {
- return _renderCaps;
- }
- default: {
- return 0;
- }
- }
-}
-CFX_Matrix CFX_QuartzDeviceDriver::GetCTM() const
-{
- CGAffineTransform ctm = CGContextGetCTM(_context);
- return CFX_Matrix(ctm.a, ctm.b, ctm.c, ctm.d, ctm.tx, ctm.ty);
-}
-void CFX_QuartzDeviceDriver::SaveState()
-{
- CGContextSaveGState(_context);
- m_saveCount++;
-}
-void CFX_QuartzDeviceDriver::RestoreState(FX_BOOL isKeepSaved )
-{
- CGContextRestoreGState(_context);
- if (isKeepSaved) {
- CGContextSaveGState(_context);
- } else {
- m_saveCount--;
- }
-}
-FX_BOOL CFX_QuartzDeviceDriver::SetClip_PathFill(const CFX_PathData* pathData,
- const CFX_AffineMatrix* matrix,
- int fillMode )
-{
- SaveState();
- CGAffineTransform m = CGAffineTransformIdentity;
- if (matrix) {
- m = CGAffineTransformMake(matrix->GetA(), matrix->GetB(), matrix->GetC(), matrix->GetD(), matrix->GetE(), matrix->GetF());
- }
- m = CGAffineTransformConcat(m, _foxitDevice2User);
- CGContextConcatCTM(_context, m);
- setPathToContext(pathData);
- RestoreState(FALSE);
- if ((fillMode & 3) == FXFILL_WINDING) {
- CGContextClip(_context);
- } else {
- CGContextEOClip(_context);
- }
- return TRUE;
-}
-FX_FLOAT CFX_QuartzDeviceDriver::getLineWidth(const CFX_GraphStateData * graphState, CGAffineTransform ctm)
-{
- FX_FLOAT lineWidth = graphState->m_LineWidth;
- if (graphState->m_LineWidth <= 0.f) {
- CGSize size;
- size.width = 1;
- size.height = 1;
- CGSize temp = CGSizeApplyAffineTransform(size, ctm);
- CGFloat x = 1 / temp.width;
- CGFloat y = 1 / temp.height;
- lineWidth = x > y ? x : y;
- }
- return lineWidth;
-}
-FX_BOOL CFX_QuartzDeviceDriver::SetClip_PathStroke(const CFX_PathData* pathData,
- const CFX_AffineMatrix* matrix,
- const CFX_GraphStateData* graphState )
-{
- SaveState();
- CGAffineTransform m = CGAffineTransformIdentity;
- if (matrix) {
- m = CGAffineTransformMake(matrix->GetA(), matrix->GetB(), matrix->GetC(), matrix->GetD(), matrix->GetE(), matrix->GetF());
- }
- m = CGAffineTransformConcat(m, _foxitDevice2User);
- CGContextConcatCTM(_context, m);
- FX_FLOAT lineWidth = getLineWidth(graphState, m);
- setStrokeInfo(graphState, 0xFF000000, lineWidth);
- setPathToContext(pathData);
- CGContextReplacePathWithStrokedPath(_context);
- RestoreState(FALSE);
- CGContextClip(_context);
- return TRUE;
-}
-static CGBlendMode GetCGBlendMode(int blend_type)
-{
- CGBlendMode mode = kCGBlendModeNormal;
- switch (blend_type) {
- case FXDIB_BLEND_NORMAL:
- mode = kCGBlendModeNormal;
- break;
- case FXDIB_BLEND_MULTIPLY:
- mode = kCGBlendModeMultiply;
- break;
- case FXDIB_BLEND_SCREEN:
- mode = kCGBlendModeScreen;
- break;
- case FXDIB_BLEND_OVERLAY:
- mode = kCGBlendModeOverlay;
- break;
- case FXDIB_BLEND_DARKEN:
- mode = kCGBlendModeDarken;
- break;
- case FXDIB_BLEND_LIGHTEN:
- mode = kCGBlendModeLighten;
- break;
- case FXDIB_BLEND_COLORDODGE:
- mode = kCGBlendModeColorDodge;
- break;
- case FXDIB_BLEND_COLORBURN:
- mode = kCGBlendModeColorBurn;
- break;
- case FXDIB_BLEND_HARDLIGHT:
- mode = kCGBlendModeHardLight;
- break;
- case FXDIB_BLEND_SOFTLIGHT:
- mode = kCGBlendModeSoftLight;
- break;
- case FXDIB_BLEND_DIFFERENCE:
- mode = kCGBlendModeDifference;
- break;
- case FXDIB_BLEND_EXCLUSION:
- mode = kCGBlendModeExclusion;
- break;
- case FXDIB_BLEND_HUE:
- mode = kCGBlendModeHue;
- break;
- case FXDIB_BLEND_SATURATION:
- mode = kCGBlendModeSaturation;
- break;
- case FXDIB_BLEND_COLOR:
- mode = kCGBlendModeColor;
- break;
- case FXDIB_BLEND_LUMINOSITY:
- mode = kCGBlendModeLuminosity;
- break;
- default:
- mode = kCGBlendModeNormal;
- break;
- }
- return mode;
-}
-FX_BOOL CFX_QuartzDeviceDriver::DrawPath(const CFX_PathData* pathData,
- const CFX_AffineMatrix* matrix,
- const CFX_GraphStateData* graphState,
- FX_DWORD fillArgb,
- FX_DWORD strokeArgb,
- int fillMode,
- int alpha_flag,
- void* pIccTransform,
- int blend_type
- )
-{
- SaveState();
- CGBlendMode mode = GetCGBlendMode(blend_type);
- if (mode != kCGBlendModeNormal) {
- CGContextSetBlendMode(_context, mode);
- }
- CGAffineTransform m = CGAffineTransformIdentity;
- if (matrix) {
- m = CGAffineTransformMake(matrix->GetA(), matrix->GetB(), matrix->GetC(), matrix->GetD(), matrix->GetE(), matrix->GetF());
- }
- m = CGAffineTransformConcat(m, _foxitDevice2User);
- CGContextConcatCTM(_context, m);
- int pathMode = 0;
- if (graphState && strokeArgb) {
- CGContextSetMiterLimit(_context, graphState->m_MiterLimit);
- FX_FLOAT lineWidth = getLineWidth(graphState, m);
- setStrokeInfo(graphState, strokeArgb, lineWidth);
- pathMode |= 4;
- }
- if (fillMode && fillArgb) {
- setFillInfo(fillArgb);
- if ((fillMode & 3) == FXFILL_WINDING) {
- pathMode |= 1;
- } else if ((fillMode & 3) == FXFILL_ALTERNATE) {
- pathMode |= 2;
- }
- }
- setPathToContext(pathData);
- if (fillMode & FXFILL_FULLCOVER) {
- CGContextSetShouldAntialias(_context, false);
- }
- if (pathMode == 4) {
- CGContextStrokePath(_context);
- } else if (pathMode == 1) {
- CGContextFillPath(_context);
- } else if (pathMode == 2) {
- CGContextEOFillPath(_context);
- } else if (pathMode == 5) {
- CGContextDrawPath(_context, kCGPathFillStroke);
- } else if (pathMode == 6) {
- CGContextDrawPath(_context, kCGPathEOFillStroke);
- }
- RestoreState(FALSE);
- return TRUE;
-}
-FX_BOOL CFX_QuartzDeviceDriver::FillRect(const FX_RECT* rect,
- FX_ARGB fillArgb,
- int alphaFlag ,
- void* iccTransform ,
- int blend_type )
-{
- CGBlendMode mode = GetCGBlendMode(blend_type);
- if (mode != kCGBlendModeNormal) {
- CGContextSetBlendMode(_context, mode);
- }
- CGRect rect_fx = CGRectMake(rect->left, rect->top, rect->Width(), rect->Height());
- CGRect rect_usr = CGRectApplyAffineTransform(rect_fx, _foxitDevice2User);
- FX_INT32 a, r, g, b;
- ArgbDecode(fillArgb, a, r, g, b);
- CGContextSetRGBFillColor(_context,
- r / 255.f,
- g / 255.f,
- b / 255.f,
- a / 255.f);
- CGContextFillRect(_context, rect_usr);
- if (mode != kCGBlendModeNormal) {
- CGContextSetBlendMode(_context, kCGBlendModeNormal);
- }
- return TRUE;
-}
-FX_BOOL CFX_QuartzDeviceDriver::DrawCosmeticLine(FX_FLOAT x1,
- FX_FLOAT y1,
- FX_FLOAT x2,
- FX_FLOAT y2,
- FX_DWORD argb,
- int alphaFlag ,
- void* iccTransform ,
- int blend_type )
-{
- CGBlendMode mode = GetCGBlendMode(blend_type);
- if (mode != kCGBlendModeNormal) {
- CGContextSetBlendMode(_context, mode);
- }
- CGPoint pt = CGPointApplyAffineTransform(CGPointMake(x1, y1), _foxitDevice2User);
- x1 = pt.x;
- y1 = pt.y;
- pt = CGPointApplyAffineTransform(CGPointMake(x2, y2), _foxitDevice2User);
- x2 = pt.x;
- y2 = pt.y;
- FX_INT32 a, r, g, b;
- ArgbDecode(argb, a, r, g, b);
- CGContextSetRGBStrokeColor(_context,
- r / 255.f,
- g / 255.f,
- b / 255.f,
- a / 255.f);
- CGContextMoveToPoint(_context, x1, y1);
- CGContextAddLineToPoint(_context, x2, y2);
- CGContextStrokePath(_context);
- if (mode != kCGBlendModeNormal) {
- CGContextSetBlendMode(_context, kCGBlendModeNormal);
- }
- return TRUE;
-}
-FX_BOOL CFX_QuartzDeviceDriver::GetClipBox(FX_RECT* rect)
-{
- CGRect r = CGContextGetClipBoundingBox(_context);
- r = CGRectApplyAffineTransform(r, _user2FoxitDevice);
- rect->left = FXSYS_floor(r.origin.x);
- rect->top = FXSYS_floor(r.origin.y);
- rect->right = FXSYS_ceil(r.origin.x + r.size.width);
- rect->bottom = FXSYS_ceil(r.origin.y + r.size.height);
- return TRUE;
-}
-FX_BOOL CFX_QuartzDeviceDriver::GetDIBits(CFX_DIBitmap* bitmap,
- FX_INT32 left,
- FX_INT32 top,
- void* pIccTransform,
- FX_BOOL bDEdge)
-{
- if (FXDC_PRINTER == _deviceClass) {
- return FALSE;
- }
- if (bitmap->GetBPP() < 32) {
- return FALSE;
- }
- if (!(_renderCaps | FXRC_GET_BITS)) {
- return FALSE;
- }
- CGPoint pt = CGPointMake(left, top);
- pt = CGPointApplyAffineTransform(pt, _foxitDevice2User);
- CGAffineTransform ctm = CGContextGetCTM(_context);
- pt.x *= FXSYS_fabs(ctm.a);
- pt.y *= FXSYS_fabs(ctm.d);
- CGImageRef image = CGBitmapContextCreateImage(_context);
- if (NULL == image) {
- return FALSE;
- }
- CGFloat width = (CGFloat) bitmap->GetWidth();
- CGFloat height = (CGFloat) bitmap->GetHeight();
- if (width + pt.x > _width) {
- width -= (width + pt.x - _width);
- }
- if (height + pt.y > _height) {
- height -= (height + pt.y - _height);
- }
- CGImageRef subImage = CGImageCreateWithImageInRect(image,
- CGRectMake(pt.x,
- pt.y,
- width,
- height));
- CGContextRef context = createContextWithBitmap(bitmap);
- CGRect rect = CGContextGetClipBoundingBox(context);
- CGContextClearRect(context, rect);
- CGContextDrawImage(context, rect, subImage);
- CGContextRelease(context);
- CGImageRelease(subImage);
- CGImageRelease(image);
- if (bitmap->HasAlpha()) {
- for (int row = 0; row < bitmap->GetHeight(); row ++) {
- FX_LPBYTE pScanline = (FX_LPBYTE)bitmap->GetScanline(row);
- for (int col = 0; col < bitmap->GetWidth(); col ++) {
- if (pScanline[3] > 0) {
- pScanline[0] = (pScanline[0] * 255.f / pScanline[3] + .5f);
- pScanline[1] = (pScanline[1] * 255.f / pScanline[3] + .5f);
- pScanline[2] = (pScanline[2] * 255.f / pScanline[3] + .5f);
- }
- pScanline += 4;
- }
- }
- }
- return TRUE;
-}
-FX_BOOL CFX_QuartzDeviceDriver::SetDIBits(const CFX_DIBSource* pBitmap,
- FX_ARGB argb,
- const FX_RECT* srcRect,
- int dest_left,
- int dest_top,
- int blendType,
- int alphaFlag ,
- void* iccTransform )
-{
- SaveState();
- CGFloat src_left, src_top, src_width, src_height;
- if (srcRect) {
- src_left = srcRect->left;
- src_top = srcRect->top;
- src_width = srcRect->Width();
- src_height = srcRect->Height();
- } else {
- src_left = src_top = 0;
- src_width = pBitmap->GetWidth();
- src_height = pBitmap->GetHeight();
- }
- CGAffineTransform ctm = CGContextGetCTM(_context);
- CGFloat scale_x = FXSYS_fabs(ctm.a);
- CGFloat scale_y = FXSYS_fabs(ctm.d);
- src_left /= scale_x;
- src_top /= scale_y;
- src_width /= scale_x;
- src_height /= scale_y;
- CGRect rect_fx = CGRectMake(dest_left, dest_top, src_width, src_height);
- CGRect rect_usr = CGRectApplyAffineTransform(rect_fx, _foxitDevice2User);
- CGContextBeginPath(_context);
- CGContextAddRect(_context, rect_usr);
- CGContextClip(_context);
- rect_usr.size = CGSizeMake(pBitmap->GetWidth() / scale_x, pBitmap->GetHeight() / scale_y);
- rect_usr = CGRectOffset(rect_usr, -src_left, -src_top);
- CG_SetImageTransform(dest_left, dest_top, src_width, src_height, &rect_usr);
- CFX_DIBitmap* pBitmap1 = NULL;
- if (pBitmap->IsAlphaMask()) {
- if (pBitmap->GetBuffer()) {
- pBitmap1 = (CFX_DIBitmap*)pBitmap;
- } else {
- pBitmap1 = pBitmap->Clone();
- }
- if (NULL == pBitmap1) {
- RestoreState(FALSE);
- return FALSE;
- }
- CGDataProviderRef pBitmapProvider = CGDataProviderCreateWithData(NULL,
- pBitmap1->GetBuffer(),
- pBitmap1->GetPitch() * pBitmap1->GetHeight(),
- NULL);
- CGColorSpaceRef pColorSpace = CGColorSpaceCreateDeviceGray();
- CGBitmapInfo bitmapInfo = kCGImageAlphaNone | kCGBitmapByteOrderDefault;
- CGImageRef pImage = CGImageCreate(pBitmap1->GetWidth(),
- pBitmap1->GetHeight(),
- pBitmap1->GetBPP(),
- pBitmap1->GetBPP(),
- pBitmap1->GetPitch(),
- pColorSpace,
- bitmapInfo,
- pBitmapProvider, NULL, true,
- kCGRenderingIntentDefault);
- CGContextClipToMask(_context, rect_usr, pImage);
- CGContextSetRGBFillColor(_context,
- FXARGB_R(argb) / 255.f,
- FXARGB_G(argb) / 255.f,
- FXARGB_B(argb) / 255.f,
- FXARGB_A(argb) / 255.f);
- CGContextFillRect(_context, rect_usr);
- CGImageRelease(pImage);
- CGColorSpaceRelease(pColorSpace);
- CGDataProviderRelease(pBitmapProvider);
- if (pBitmap1 != pBitmap) {
- delete pBitmap1;
- }
- RestoreState(FALSE);
- return TRUE;
- }
- if (pBitmap->GetBPP() < 32) {
- pBitmap1 = pBitmap->CloneConvert(FXDIB_Rgb32);
- } else {
- if (pBitmap->GetBuffer()) {
- pBitmap1 = (CFX_DIBitmap*)pBitmap;
- } else {
- pBitmap1 = pBitmap->Clone();
- }
- }
- if (NULL == pBitmap1) {
- RestoreState(FALSE);
- return FALSE;
- }
- if (pBitmap1->HasAlpha()) {
- if (pBitmap1 == pBitmap) {
- pBitmap1 = pBitmap->Clone();
- if (!pBitmap1) {
- RestoreState(FALSE);
- return FALSE;
- }
- }
- for (int row = 0; row < pBitmap1->GetHeight(); row ++) {
- FX_LPBYTE pScanline = (FX_LPBYTE)pBitmap1->GetScanline(row);
- for (int col = 0; col < pBitmap1->GetWidth(); col ++) {
- pScanline[0] = (FX_BYTE)(pScanline[0] * pScanline[3] / 255.f + .5f);
- pScanline[1] = (FX_BYTE)(pScanline[1] * pScanline[3] / 255.f + .5f);
- pScanline[2] = (FX_BYTE)(pScanline[2] * pScanline[3] / 255.f + .5f);
- pScanline += 4;
- }
- }
- }
- CGContextRef ctx = createContextWithBitmap(pBitmap1);
- CGImageRef image = CGBitmapContextCreateImage(ctx);
- int blend_mode = blendType;
- if (FXDIB_BLEND_HARDLIGHT == blendType) {
- blend_mode = kCGBlendModeSoftLight;
- } else if (FXDIB_BLEND_SOFTLIGHT == blendType) {
- blend_mode = kCGBlendModeHardLight;
- } else if (blendType >= FXDIB_BLEND_NONSEPARABLE && blendType <= FXDIB_BLEND_LUMINOSITY) {
- blend_mode = blendType - 9;
- } else if (blendType > FXDIB_BLEND_LUMINOSITY || blendType < 0) {
- blend_mode = kCGBlendModeNormal;
- }
- CGContextSetBlendMode(_context, (CGBlendMode)blend_mode);
- CGContextDrawImage(_context, rect_usr, image);
- CGImageRelease(image);
- CGContextRelease(ctx);
- if (pBitmap1 != pBitmap) {
- delete pBitmap1;
- }
- RestoreState(FALSE);
- return TRUE;
-}
-FX_BOOL CFX_QuartzDeviceDriver::StretchDIBits(const CFX_DIBSource* pBitmap,
- FX_ARGB argb,
- int dest_left,
- int dest_top,
- int dest_width,
- int dest_height,
- const FX_RECT* clipRect,
- FX_DWORD flags,
- int alphaFlag ,
- void* iccTransform ,
- int blend_type)
-{
- SaveState();
- if (clipRect) {
- CGContextBeginPath(_context);
- CGRect rect_clip = CGRectMake(clipRect->left, clipRect->top, clipRect->Width(), clipRect->Height());
- rect_clip = CGRectApplyAffineTransform(rect_clip, _foxitDevice2User);
- CGContextAddRect(_context, rect_clip);
- CGContextClip(_context);
- }
- CGRect rect = CGRectMake(dest_left, dest_top, dest_width, dest_height);
- rect = CGRectApplyAffineTransform(rect, _foxitDevice2User);
- if (FXDIB_BICUBIC_INTERPOL == flags) {
- CGContextSetInterpolationQuality(_context, kCGInterpolationHigh);
- } else if (FXDIB_DOWNSAMPLE == flags) {
- CGContextSetInterpolationQuality(_context, kCGInterpolationNone);
- } else {
- CGContextSetInterpolationQuality(_context, kCGInterpolationMedium);
- }
- CG_SetImageTransform(dest_left, dest_top, dest_width, dest_height);
- CFX_DIBitmap* pBitmap1 = NULL;
- if (pBitmap->IsAlphaMask()) {
- if (pBitmap->GetBuffer()) {
- pBitmap1 = (CFX_DIBitmap*)pBitmap;
- } else {
- pBitmap1 = pBitmap->Clone();
- }
- if (NULL == pBitmap1) {
- RestoreState(FALSE);
- return FALSE;
- }
- CGDataProviderRef pBitmapProvider = CGDataProviderCreateWithData(NULL,
- pBitmap1->GetBuffer(),
- pBitmap1->GetPitch() * pBitmap1->GetHeight(),
- NULL);
- CGColorSpaceRef pColorSpace = CGColorSpaceCreateDeviceGray();
- CGBitmapInfo bitmapInfo = kCGImageAlphaNone | kCGBitmapByteOrderDefault;
- CGImageRef pImage = CGImageCreate(pBitmap1->GetWidth(),
- pBitmap1->GetHeight(),
- pBitmap1->GetBPP(),
- pBitmap1->GetBPP(),
- pBitmap1->GetPitch(),
- pColorSpace,
- bitmapInfo,
- pBitmapProvider, NULL, true,
- kCGRenderingIntentDefault);
- CGContextClipToMask(_context, rect, pImage);
- CGContextSetRGBFillColor(_context,
- FXARGB_R(argb) / 255.f,
- FXARGB_G(argb) / 255.f,
- FXARGB_B(argb) / 255.f,
- FXARGB_A(argb) / 255.f);
- CGContextFillRect(_context, rect);
- CGImageRelease(pImage);
- CGColorSpaceRelease(pColorSpace);
- CGDataProviderRelease(pBitmapProvider);
- if (pBitmap1 != pBitmap) {
- delete pBitmap1;
- }
- RestoreState(FALSE);
- return TRUE;
- }
- if (pBitmap->GetBPP() < 32) {
- pBitmap1 = pBitmap->CloneConvert(FXDIB_Rgb32);
- } else {
- if (pBitmap->GetBuffer()) {
- pBitmap1 = (CFX_DIBitmap*)pBitmap;
- } else {
- pBitmap1 = pBitmap->Clone();
- }
- }
- if (NULL == pBitmap1) {
- RestoreState(FALSE);
- return FALSE;
- }
- if (pBitmap1->HasAlpha()) {
- if (pBitmap1 == pBitmap) {
- pBitmap1 = pBitmap->Clone();
- if (!pBitmap1) {
- RestoreState(FALSE);
- return FALSE;
- }
- }
- for (int row = 0; row < pBitmap1->GetHeight(); row ++) {
- FX_LPBYTE pScanline = (FX_LPBYTE)pBitmap1->GetScanline(row);
- for (int col = 0; col < pBitmap1->GetWidth(); col ++) {
- pScanline[0] = (FX_BYTE)(pScanline[0] * pScanline[3] / 255.f + .5f);
- pScanline[1] = (FX_BYTE)(pScanline[1] * pScanline[3] / 255.f + .5f);
- pScanline[2] = (FX_BYTE)(pScanline[2] * pScanline[3] / 255.f + .5f);
- pScanline += 4;
- }
- }
- }
- CGContextRef ctx = createContextWithBitmap(pBitmap1);
- CGImageRef image = CGBitmapContextCreateImage(ctx);
- CGContextDrawImage(_context, rect, image);
- CGImageRelease(image);
- CGContextRelease(ctx);
- if (pBitmap1 != pBitmap) {
- delete pBitmap1;
- }
- RestoreState(FALSE);
- return TRUE;
-}
-FX_BOOL CFX_QuartzDeviceDriver::CG_DrawGlypRun(int nChars,
- const FXTEXT_CHARPOS* pCharPos,
- CFX_Font* pFont,
- CFX_FontCache* pCache,
- const CFX_AffineMatrix* pGlyphMatrix,
- const CFX_AffineMatrix* pObject2Device,
- FX_FLOAT font_size,
- FX_DWORD argb,
- int alpha_flag,
- void* pIccTransform)
-{
- if (nChars == 0) {
- return TRUE;
- }
- CQuartz2D& quartz2d = ((CApplePlatform *) CFX_GEModule::Get()->GetPlatformData())->_quartz2d;
- if (!pFont->m_pPlatformFont) {
- if (pFont->GetPsName() == CFX_WideString::FromLocal("DFHeiStd-W5")) {
- return FALSE;
- }
- pFont->m_pPlatformFont = quartz2d.CreateFont(pFont->m_pFontData, pFont->m_dwSize);
- if (NULL == pFont->m_pPlatformFont) {
- return FALSE;
- }
- }
- CFX_FixedBufGrow<FX_WORD, 32> glyph_indices(nChars);
- CFX_FixedBufGrow<CGPoint, 32> glyph_positions(nChars);
- for (int i = 0; i < nChars; i++ ) {
- glyph_indices[i] = pCharPos[i].m_ExtGID;
- glyph_positions[i].x = pCharPos[i].m_OriginX;
- glyph_positions[i].y = pCharPos[i].m_OriginY;
- }
- CFX_AffineMatrix text_matrix;
- if (pObject2Device) {
- text_matrix.Concat(*pObject2Device);
- }
- CGAffineTransform matrix_cg = CGAffineTransformMake(text_matrix.a,
- text_matrix.b,
- text_matrix.c,
- text_matrix.d,
- text_matrix.e,
- text_matrix.f);
- matrix_cg = CGAffineTransformConcat(matrix_cg, _foxitDevice2User);
- CGContextSetTextMatrix(_context, matrix_cg);
- CGContextSetFont(_context, (CGFontRef)pFont->m_pPlatformFont);
- CGContextSetFontSize(_context, FXSYS_fabs(font_size));
- FX_INT32 a, r, g, b;
- ArgbDecode(argb, a, r, g, b);
- CGContextSetRGBFillColor(_context,
- r / 255.f,
- g / 255.f,
- b / 255.f,
- a / 255.f);
- SaveState();
- if (pGlyphMatrix) {
- CGAffineTransform ctm = CGContextGetCTM(_context);
- CGPoint origin = CGPointMake( glyph_positions[0].x, glyph_positions[0].y);
- origin = CGPointApplyAffineTransform(origin, matrix_cg);
- CGContextTranslateCTM(_context, origin.x, origin.y);
- CGAffineTransform glyph_matrix = CGAffineTransformMake(pGlyphMatrix->a,
- pGlyphMatrix->b,
- pGlyphMatrix->c,
- pGlyphMatrix->d,
- pGlyphMatrix->e,
- pGlyphMatrix->f);
- if (_foxitDevice2User.d < 0) {
- glyph_matrix = CGAffineTransformInvert(glyph_matrix);
- }
- CGContextConcatCTM(_context, glyph_matrix);
- CGContextTranslateCTM(_context, -origin.x, -origin.y);
- }
- CGContextShowGlyphsAtPositions(_context,
- (CGGlyph*)glyph_indices,
- glyph_positions,
- nChars);
- RestoreState(FALSE);
- return TRUE;
-}
-FX_BOOL CFX_QuartzDeviceDriver::DrawDeviceText(int nChars,
- const FXTEXT_CHARPOS* pCharPos,
- CFX_Font* pFont,
- CFX_FontCache* pCache,
- const CFX_AffineMatrix* pObject2Device,
- FX_FLOAT font_size,
- FX_DWORD color,
- int alpha_flag ,
- void* pIccTransform)
-{
- if (NULL == pFont || NULL == _context) {
- return FALSE;
- }
- FX_BOOL bBold = pFont->IsBold();
- if (!bBold && pFont->GetSubstFont() &&
- pFont->GetSubstFont()->m_Weight >= 500 &&
- pFont->GetSubstFont()->m_Weight <= 600) {
- return FALSE;
- }
- SaveState();
- CGContextSetTextDrawingMode(_context, kCGTextFillClip);
- FX_BOOL ret = FALSE;
- FX_INT32 i = 0;
- while (i < nChars) {
- if (pCharPos[i].m_bGlyphAdjust || font_size < 0) {
- if (i > 0) {
- ret = CG_DrawGlypRun(i, pCharPos, pFont, pCache, NULL, pObject2Device, font_size, color, alpha_flag, pIccTransform);
- if (!ret) {
- RestoreState(FALSE);
- return ret;
- }
- }
- const FXTEXT_CHARPOS* char_pos = pCharPos + i;
- CFX_AffineMatrix glphy_matrix;
- if (font_size < 0) {
- glphy_matrix.Concat(-1, 0, 0, -1, 0, 0);
- }
- if (char_pos->m_bGlyphAdjust) {
- glphy_matrix.Concat(char_pos->m_AdjustMatrix[0],
- char_pos->m_AdjustMatrix[1],
- char_pos->m_AdjustMatrix[2],
- char_pos->m_AdjustMatrix[3], 0, 0);
- }
- ret = CG_DrawGlypRun(1, char_pos, pFont, pCache, &glphy_matrix, pObject2Device, font_size, color, alpha_flag, pIccTransform);
- if (!ret) {
- RestoreState(FALSE);
- return ret;
- }
- i ++;
- pCharPos += i;
- nChars -= i;
- i = 0;
- } else {
- i ++;
- }
- }
- if (i > 0) {
- ret = CG_DrawGlypRun(i, pCharPos, pFont, pCache, NULL, pObject2Device, font_size, color, alpha_flag, pIccTransform);
- }
- RestoreState(FALSE);
- return ret;
-}
-void CFX_QuartzDeviceDriver::setStrokeInfo(const CFX_GraphStateData* graphState, FX_ARGB argb, FX_FLOAT lineWidth)
-{
- if (NULL == graphState) {
- return;
- }
- CGContextSetLineWidth(_context, lineWidth);
- CGLineCap cap;
- switch (graphState->m_LineCap) {
- case CFX_GraphStateData::LineCapRound: {
- cap = kCGLineCapRound;
- break;
- }
- case CFX_GraphStateData::LineCapSquare: {
- cap = kCGLineCapSquare;
- break;
- }
- case CFX_GraphStateData::LineCapButt:
- default: {
- cap = kCGLineCapButt;
- }
- }
- CGContextSetLineCap(_context, cap);
- CGLineJoin join;
- switch (graphState->m_LineJoin) {
- case CFX_GraphStateData::LineJoinRound: {
- join = kCGLineJoinRound;
- break;
- }
- case CFX_GraphStateData::LineJoinBevel: {
- join = kCGLineJoinBevel;
- break;
- }
- case CFX_GraphStateData::LineJoinMiter:
- default: {
- join = kCGLineJoinMiter;
- }
- }
- CGContextSetLineJoin(_context, join);
- if (graphState->m_DashCount) {
-#if CGFLOAT_IS_DOUBLE
- CGFloat* dashArray = new CGFloat[graphState->m_DashCount];
- if (!dashArray) {
- return;
- }
- for (int index = 0; index < graphState->m_DashCount; ++index) {
- dashArray[index] = graphState->m_DashArray[index];
- }
-#else
- CGFloat* dashArray = (CGFloat*)graphState->m_DashArray;
-#endif
- CGContextSetLineDash(_context, graphState->m_DashPhase, dashArray, graphState->m_DashCount);
-#if CGFLOAT_IS_DOUBLE
- delete[] dashArray;
-#endif
- }
- FX_INT32 a, r, g, b;
- ArgbDecode(argb, a, r, g, b);
- CGContextSetRGBStrokeColor(_context,
- r / 255.f,
- g / 255.f,
- b / 255.f,
- a / 255.f);
-}
-void CFX_QuartzDeviceDriver::setFillInfo(FX_ARGB argb)
-{
- FX_INT32 a, r, g, b;
- ArgbDecode(argb, a, r, g, b);
- CGContextSetRGBFillColor(_context,
- r / 255.f,
- g / 255.f,
- b / 255.f,
- a / 255.f);
-}
-void CFX_QuartzDeviceDriver::setPathToContext(const CFX_PathData* pathData)
-{
- FX_INT32 count = pathData->GetPointCount();
- FX_PATHPOINT* points = pathData->GetPoints();
- CGContextBeginPath(_context);
- for (FX_INT32 i = 0; i < count; i ++) {
- switch (points[i].m_Flag & FXPT_TYPE) {
- case FXPT_MOVETO:
- CGContextMoveToPoint(_context, points[i].m_PointX, points[i].m_PointY);
- break;
- case FXPT_LINETO:
- CGContextAddLineToPoint(_context, points[i].m_PointX, points[i].m_PointY);
- break;
- case FXPT_BEZIERTO: {
- CGContextAddCurveToPoint(_context,
- points[i].m_PointX, points[i].m_PointY,
- points[i + 1].m_PointX, points[i + 1].m_PointY,
- points[i + 2].m_PointX, points[i + 2].m_PointY);
- i += 2;
- }
- }
- if (points[i].m_Flag & FXPT_CLOSEFIGURE) {
- CGContextClosePath(_context);
- }
- }
-}
-void CFX_QuartzDeviceDriver::CG_SetImageTransform(int dest_left, int dest_top, int dest_width, int dest_height,
- CGRect* rect )
-{
- int flip_y = _foxitDevice2User.d * dest_height < 0 ? 1 : -1;
- int flip_x = _foxitDevice2User.a * dest_width > 0 ? 1 : -1;
- if (flip_y < 0 || flip_x < 0) {
- if (dest_height < 0) {
- dest_height = -dest_height;
- dest_top -= dest_height;
- }
- CGRect rt = CGRectApplyAffineTransform(CGRectMake(dest_left, dest_top, dest_width, dest_height), _foxitDevice2User);
- CGFloat offset_x = (rt.origin.x) + rt.size.width / 2.f,
- offset_y = (rt.origin.y) + rt.size.height / 2.f;
- CGAffineTransform transform = CGAffineTransformIdentity;
- transform = CGAffineTransformConcat(transform, CGAffineTransformMake(1, 0, 0, 1, -offset_x, -offset_y));
- transform = CGAffineTransformConcat(transform, CGAffineTransformMake(flip_x, 0, 0, flip_y, 0, 0));
- transform = CGAffineTransformConcat(transform, CGAffineTransformMake(1, 0, 0, 1, offset_x, offset_y));
- CGContextConcatCTM(_context, transform);
- if (rect) {
- *rect = CGRectApplyAffineTransform(*rect, transform);
- }
- }
-}
-void CFX_QuartzDeviceDriver::ClearDriver()
-{
- if (NULL == _context) {
- return;
- }
- for (int i = 0; i < m_saveCount; ++i) {
- CGContextRestoreGState(_context);
- }
- m_saveCount = 0;
- if (_context) {
- CGContextRelease(_context);
- }
-}
-CFX_QuartzDevice::CFX_QuartzDevice()
-{
- m_bOwnedBitmap = FALSE;
- m_pContext = NULL;
-}
-CFX_QuartzDevice::~CFX_QuartzDevice()
-{
- if (m_pContext) {
- CGContextRelease(m_pContext);
- }
- if (GetBitmap() && m_bOwnedBitmap) {
- delete GetBitmap();
- }
-}
-CGContextRef CFX_QuartzDevice::GetContext()
-{
- return m_pContext;
-}
-FX_BOOL CFX_QuartzDevice::Attach(CGContextRef context, FX_INT32 nDeviceClass)
-{
- if (m_pContext) {
- CGContextRelease(m_pContext);
- }
- m_pContext = context;
- CGContextRetain(m_pContext);
- IFX_RenderDeviceDriver* pDriver = FX_NEW CFX_QuartzDeviceDriver(m_pContext, nDeviceClass);
- if (!pDriver) {
- return FALSE;
- }
- SetDeviceDriver(pDriver);
- return TRUE;
-}
-FX_BOOL CFX_QuartzDevice::Attach(CFX_DIBitmap* pBitmap)
-{
- SetBitmap(pBitmap);
- m_pContext = createContextWithBitmap(pBitmap);
- if (NULL == m_pContext) {
- return FALSE;
- }
- IFX_RenderDeviceDriver* pDriver = FX_NEW CFX_QuartzDeviceDriver(m_pContext, FXDC_DISPLAY);
- if (!pDriver) {
- return FALSE;
- }
- SetDeviceDriver(pDriver);
- return TRUE;
-}
-FX_BOOL CFX_QuartzDevice::Create(FX_INT32 width, FX_INT32 height, FXDIB_Format format)
-{
- if ((FX_BYTE)format < 32) {
- return FALSE;
- }
- CFX_DIBitmap* pBitmap = FX_NEW CFX_DIBitmap;
- if (!pBitmap) {
- return FALSE;
- }
- if (!pBitmap->Create(width, height, format)) {
- delete pBitmap;
- return FALSE;
- }
- m_bOwnedBitmap = TRUE;
- return Attach(pBitmap);
-}
-#endif
+// 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
+
+#include "../../../include/fxcrt/fx_ext.h"
+#include "../../../include/fxge/fx_ge.h"
+#include "../agg/include/fxfx_agg_clip_liang_barsky.h"
+#include "../ge/text_int.h"
+#include "../dib/dib_int.h"
+#include "../agg/include/fx_agg_driver.h"
+#include "../../../include/fxge/fx_freetype.h"
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
+#include "apple_int.h"
+#include "../../../include/fxge/fx_ge_apple.h"
+#ifndef CGFLOAT_IS_DOUBLE
+#error Expected CGFLOAT_IS_DOUBLE to be defined by CoreGraphics headers
+#endif
+void* CQuartz2D::createGraphics(CFX_DIBitmap* pBitmap)
+{
+ if (!pBitmap) {
+ return NULL;
+ }
+ CGBitmapInfo bmpInfo = kCGBitmapByteOrder32Little;
+ switch (pBitmap->GetFormat()) {
+ case FXDIB_Rgb32:
+ bmpInfo |= kCGImageAlphaNoneSkipFirst;
+ break;
+ case FXDIB_Argb:
+ default:
+ return NULL;
+ }
+ CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
+ CGContextRef context = CGBitmapContextCreate(pBitmap->GetBuffer(),
+ pBitmap->GetWidth(),
+ pBitmap->GetHeight(),
+ 8,
+ pBitmap->GetPitch(),
+ colorSpace,
+ bmpInfo);
+ CGColorSpaceRelease(colorSpace);
+ return context;
+}
+void CQuartz2D::destroyGraphics(void* graphics)
+{
+ if (graphics) {
+ CGContextRelease((CGContextRef) graphics);
+ }
+}
+void* CQuartz2D::CreateFont(FX_LPCBYTE pFontData, FX_DWORD dwFontSize)
+{
+ CGDataProviderRef pDataProvider = CGDataProviderCreateWithData(NULL, pFontData, (size_t)dwFontSize, NULL);
+ if (NULL == pDataProvider) {
+ return NULL;
+ }
+ CGFontRef pCGFont = CGFontCreateWithDataProvider(pDataProvider);
+ CGDataProviderRelease(pDataProvider);
+ return pCGFont;
+}
+void CQuartz2D::DestroyFont(void* pFont)
+{
+ CGFontRelease((CGFontRef)pFont);
+}
+void CQuartz2D::setGraphicsTextMatrix(void* graphics, CFX_AffineMatrix* matrix)
+{
+ if (!graphics || !matrix) {
+ return;
+ }
+ CGContextRef context = (CGContextRef) graphics;
+ CGFloat ty = CGBitmapContextGetHeight(context) - matrix->f;
+ CGContextSetTextMatrix(context, CGAffineTransformMake(matrix->a,
+ matrix->b,
+ matrix->c,
+ matrix->d,
+ matrix->e,
+ ty));
+}
+FX_BOOL CQuartz2D::drawGraphicsString(void* graphics,
+ void* font,
+ FX_FLOAT fontSize,
+ FX_WORD* glyphIndices,
+ CGPoint* glyphPositions,
+ FX_INT32 charsCount,
+ FX_ARGB argb,
+ CFX_AffineMatrix* matrix )
+{
+ if (!graphics) {
+ return FALSE;
+ }
+ CGContextRef context = (CGContextRef) graphics;
+ CGContextSetFont(context, (CGFontRef)font);
+ CGContextSetFontSize(context, fontSize);
+ if (matrix) {
+ CGAffineTransform m = CGContextGetTextMatrix(context);
+ m = CGAffineTransformConcat(m,
+ CGAffineTransformMake(matrix->a,
+ matrix->b,
+ matrix->c,
+ matrix->d,
+ matrix->e,
+ matrix->f));
+ CGContextSetTextMatrix(context, m);
+ }
+ FX_INT32 a, r, g, b;
+ ArgbDecode(argb, a, r, g, b);
+ CGContextSetRGBFillColor(context,
+ r / 255.f,
+ g / 255.f,
+ b / 255.f,
+ a / 255.f);
+ CGContextSaveGState(context);
+#if CGFLOAT_IS_DOUBLE
+ CGPoint* glyphPositionsCG = new CGPoint[charsCount];
+ if (!glyphPositionsCG) {
+ return FALSE;
+ }
+ for (int index = 0; index < charsCount; ++index) {
+ glyphPositionsCG[index].x = glyphPositions[index].x;
+ glyphPositionsCG[index].y = glyphPositions[index].y;
+ }
+#else
+ CGPoint* glyphPositionsCG = (CGPoint*)glyphPositions;
+#endif
+ CGContextShowGlyphsAtPositions(context,
+ (CGGlyph *) glyphIndices,
+ glyphPositionsCG,
+ charsCount);
+#if CGFLOAT_IS_DOUBLE
+ delete[] glyphPositionsCG;
+#endif
+ CGContextRestoreGState(context);
+ return TRUE;
+}
+void CQuartz2D::saveGraphicsState(void * graphics)
+{
+ if (graphics) {
+ CGContextSaveGState((CGContextRef) graphics);
+ }
+}
+void CQuartz2D::restoreGraphicsState(void * graphics)
+{
+ if (graphics) {
+ CGContextRestoreGState((CGContextRef) graphics);
+ }
+}
+static CGContextRef createContextWithBitmap(CFX_DIBitmap* pBitmap)
+{
+ if (!pBitmap || pBitmap->IsCmykImage() || pBitmap->GetBPP() < 32) {
+ return NULL;
+ }
+ CGBitmapInfo bitmapInfo = kCGBitmapByteOrder32Little;
+ if (pBitmap->HasAlpha()) {
+ bitmapInfo |= kCGImageAlphaPremultipliedFirst;
+ } else {
+ bitmapInfo |= kCGImageAlphaNoneSkipFirst;
+ }
+ CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
+ CGContextRef context = CGBitmapContextCreate(pBitmap->GetBuffer(),
+ pBitmap->GetWidth(),
+ pBitmap->GetHeight(),
+ 8,
+ pBitmap->GetPitch(),
+ colorSpace,
+ bitmapInfo);
+ CGColorSpaceRelease(colorSpace);
+ return context;
+}
+CFX_QuartzDeviceDriver::CFX_QuartzDeviceDriver(CGContextRef context, FX_INT32 deviceClass)
+{
+ m_saveCount = 0;
+ _context = context;
+ _deviceClass = deviceClass;
+ CGContextRetain(_context);
+ CGRect r = CGContextGetClipBoundingBox(context);
+ _width = FXSYS_round(r.size.width);
+ _height = FXSYS_round(r.size.height);
+ _renderCaps = FXRC_SOFT_CLIP | FXRC_BLEND_MODE |
+ FXRC_ALPHA_PATH | FXRC_ALPHA_IMAGE |
+ FXRC_BIT_MASK | FXRC_ALPHA_MASK;
+ if (_deviceClass != FXDC_DISPLAY) {
+ } else {
+ CGImageRef image = CGBitmapContextCreateImage(_context);
+ if (image) {
+ _renderCaps |= FXRC_GET_BITS;
+ _width = CGImageGetWidth(image);
+ _height = CGImageGetHeight(image);
+ CGImageAlphaInfo alphaInfo = CGImageGetAlphaInfo(image);
+ if (kCGImageAlphaPremultipliedFirst == alphaInfo ||
+ kCGImageAlphaPremultipliedLast == alphaInfo ||
+ kCGImageAlphaOnly == alphaInfo) {
+ _renderCaps |= FXRC_ALPHA_OUTPUT;
+ }
+ }
+ CGImageRelease(image);
+ }
+ CGAffineTransform ctm = CGContextGetCTM(_context);
+ CGContextSaveGState(_context);
+ m_saveCount++;
+ if (ctm.d >= 0) {
+ CGFloat offset_x, offset_y;
+ offset_x = ctm.tx;
+ offset_y = ctm.ty;
+ CGContextTranslateCTM(_context, -offset_x, -offset_y);
+ CGContextConcatCTM(_context, CGAffineTransformMake(1, 0, 0, -1, offset_x, _height + offset_y));
+ }
+ _foxitDevice2User = CGAffineTransformIdentity;
+ _user2FoxitDevice = CGAffineTransformInvert(_foxitDevice2User);
+}
+CFX_QuartzDeviceDriver::~CFX_QuartzDeviceDriver()
+{
+ CGContextRestoreGState(_context);
+ m_saveCount--;
+ for (int i = 0; i < m_saveCount; ++i) {
+ CGContextRestoreGState(_context);
+ }
+ if (_context) {
+ CGContextRelease(_context);
+ }
+}
+int CFX_QuartzDeviceDriver::GetDeviceCaps(int capsID)
+{
+ switch (capsID) {
+ case FXDC_DEVICE_CLASS: {
+ return _deviceClass;
+ }
+ case FXDC_PIXEL_WIDTH: {
+ return _width;
+ }
+ case FXDC_PIXEL_HEIGHT: {
+ return _height;
+ }
+ case FXDC_BITS_PIXEL: {
+ return 32;
+ }
+ case FXDC_RENDER_CAPS: {
+ return _renderCaps;
+ }
+ default: {
+ return 0;
+ }
+ }
+}
+CFX_Matrix CFX_QuartzDeviceDriver::GetCTM() const
+{
+ CGAffineTransform ctm = CGContextGetCTM(_context);
+ return CFX_Matrix(ctm.a, ctm.b, ctm.c, ctm.d, ctm.tx, ctm.ty);
+}
+void CFX_QuartzDeviceDriver::SaveState()
+{
+ CGContextSaveGState(_context);
+ m_saveCount++;
+}
+void CFX_QuartzDeviceDriver::RestoreState(FX_BOOL isKeepSaved )
+{
+ CGContextRestoreGState(_context);
+ if (isKeepSaved) {
+ CGContextSaveGState(_context);
+ } else {
+ m_saveCount--;
+ }
+}
+FX_BOOL CFX_QuartzDeviceDriver::SetClip_PathFill(const CFX_PathData* pathData,
+ const CFX_AffineMatrix* matrix,
+ int fillMode )
+{
+ SaveState();
+ CGAffineTransform m = CGAffineTransformIdentity;
+ if (matrix) {
+ m = CGAffineTransformMake(matrix->GetA(), matrix->GetB(), matrix->GetC(), matrix->GetD(), matrix->GetE(), matrix->GetF());
+ }
+ m = CGAffineTransformConcat(m, _foxitDevice2User);
+ CGContextConcatCTM(_context, m);
+ setPathToContext(pathData);
+ RestoreState(FALSE);
+ if ((fillMode & 3) == FXFILL_WINDING) {
+ CGContextClip(_context);
+ } else {
+ CGContextEOClip(_context);
+ }
+ return TRUE;
+}
+FX_FLOAT CFX_QuartzDeviceDriver::getLineWidth(const CFX_GraphStateData * graphState, CGAffineTransform ctm)
+{
+ FX_FLOAT lineWidth = graphState->m_LineWidth;
+ if (graphState->m_LineWidth <= 0.f) {
+ CGSize size;
+ size.width = 1;
+ size.height = 1;
+ CGSize temp = CGSizeApplyAffineTransform(size, ctm);
+ CGFloat x = 1 / temp.width;
+ CGFloat y = 1 / temp.height;
+ lineWidth = x > y ? x : y;
+ }
+ return lineWidth;
+}
+FX_BOOL CFX_QuartzDeviceDriver::SetClip_PathStroke(const CFX_PathData* pathData,
+ const CFX_AffineMatrix* matrix,
+ const CFX_GraphStateData* graphState )
+{
+ SaveState();
+ CGAffineTransform m = CGAffineTransformIdentity;
+ if (matrix) {
+ m = CGAffineTransformMake(matrix->GetA(), matrix->GetB(), matrix->GetC(), matrix->GetD(), matrix->GetE(), matrix->GetF());
+ }
+ m = CGAffineTransformConcat(m, _foxitDevice2User);
+ CGContextConcatCTM(_context, m);
+ FX_FLOAT lineWidth = getLineWidth(graphState, m);
+ setStrokeInfo(graphState, 0xFF000000, lineWidth);
+ setPathToContext(pathData);
+ CGContextReplacePathWithStrokedPath(_context);
+ RestoreState(FALSE);
+ CGContextClip(_context);
+ return TRUE;
+}
+static CGBlendMode GetCGBlendMode(int blend_type)
+{
+ CGBlendMode mode = kCGBlendModeNormal;
+ switch (blend_type) {
+ case FXDIB_BLEND_NORMAL:
+ mode = kCGBlendModeNormal;
+ break;
+ case FXDIB_BLEND_MULTIPLY:
+ mode = kCGBlendModeMultiply;
+ break;
+ case FXDIB_BLEND_SCREEN:
+ mode = kCGBlendModeScreen;
+ break;
+ case FXDIB_BLEND_OVERLAY:
+ mode = kCGBlendModeOverlay;
+ break;
+ case FXDIB_BLEND_DARKEN:
+ mode = kCGBlendModeDarken;
+ break;
+ case FXDIB_BLEND_LIGHTEN:
+ mode = kCGBlendModeLighten;
+ break;
+ case FXDIB_BLEND_COLORDODGE:
+ mode = kCGBlendModeColorDodge;
+ break;
+ case FXDIB_BLEND_COLORBURN:
+ mode = kCGBlendModeColorBurn;
+ break;
+ case FXDIB_BLEND_HARDLIGHT:
+ mode = kCGBlendModeHardLight;
+ break;
+ case FXDIB_BLEND_SOFTLIGHT:
+ mode = kCGBlendModeSoftLight;
+ break;
+ case FXDIB_BLEND_DIFFERENCE:
+ mode = kCGBlendModeDifference;
+ break;
+ case FXDIB_BLEND_EXCLUSION:
+ mode = kCGBlendModeExclusion;
+ break;
+ case FXDIB_BLEND_HUE:
+ mode = kCGBlendModeHue;
+ break;
+ case FXDIB_BLEND_SATURATION:
+ mode = kCGBlendModeSaturation;
+ break;
+ case FXDIB_BLEND_COLOR:
+ mode = kCGBlendModeColor;
+ break;
+ case FXDIB_BLEND_LUMINOSITY:
+ mode = kCGBlendModeLuminosity;
+ break;
+ default:
+ mode = kCGBlendModeNormal;
+ break;
+ }
+ return mode;
+}
+FX_BOOL CFX_QuartzDeviceDriver::DrawPath(const CFX_PathData* pathData,
+ const CFX_AffineMatrix* matrix,
+ const CFX_GraphStateData* graphState,
+ FX_DWORD fillArgb,
+ FX_DWORD strokeArgb,
+ int fillMode,
+ int alpha_flag,
+ void* pIccTransform,
+ int blend_type
+ )
+{
+ SaveState();
+ CGBlendMode mode = GetCGBlendMode(blend_type);
+ if (mode != kCGBlendModeNormal) {
+ CGContextSetBlendMode(_context, mode);
+ }
+ CGAffineTransform m = CGAffineTransformIdentity;
+ if (matrix) {
+ m = CGAffineTransformMake(matrix->GetA(), matrix->GetB(), matrix->GetC(), matrix->GetD(), matrix->GetE(), matrix->GetF());
+ }
+ m = CGAffineTransformConcat(m, _foxitDevice2User);
+ CGContextConcatCTM(_context, m);
+ int pathMode = 0;
+ if (graphState && strokeArgb) {
+ CGContextSetMiterLimit(_context, graphState->m_MiterLimit);
+ FX_FLOAT lineWidth = getLineWidth(graphState, m);
+ setStrokeInfo(graphState, strokeArgb, lineWidth);
+ pathMode |= 4;
+ }
+ if (fillMode && fillArgb) {
+ setFillInfo(fillArgb);
+ if ((fillMode & 3) == FXFILL_WINDING) {
+ pathMode |= 1;
+ } else if ((fillMode & 3) == FXFILL_ALTERNATE) {
+ pathMode |= 2;
+ }
+ }
+ setPathToContext(pathData);
+ if (fillMode & FXFILL_FULLCOVER) {
+ CGContextSetShouldAntialias(_context, false);
+ }
+ if (pathMode == 4) {
+ CGContextStrokePath(_context);
+ } else if (pathMode == 1) {
+ CGContextFillPath(_context);
+ } else if (pathMode == 2) {
+ CGContextEOFillPath(_context);
+ } else if (pathMode == 5) {
+ CGContextDrawPath(_context, kCGPathFillStroke);
+ } else if (pathMode == 6) {
+ CGContextDrawPath(_context, kCGPathEOFillStroke);
+ }
+ RestoreState(FALSE);
+ return TRUE;
+}
+FX_BOOL CFX_QuartzDeviceDriver::FillRect(const FX_RECT* rect,
+ FX_ARGB fillArgb,
+ int alphaFlag ,
+ void* iccTransform ,
+ int blend_type )
+{
+ CGBlendMode mode = GetCGBlendMode(blend_type);
+ if (mode != kCGBlendModeNormal) {
+ CGContextSetBlendMode(_context, mode);
+ }
+ CGRect rect_fx = CGRectMake(rect->left, rect->top, rect->Width(), rect->Height());
+ CGRect rect_usr = CGRectApplyAffineTransform(rect_fx, _foxitDevice2User);
+ FX_INT32 a, r, g, b;
+ ArgbDecode(fillArgb, a, r, g, b);
+ CGContextSetRGBFillColor(_context,
+ r / 255.f,
+ g / 255.f,
+ b / 255.f,
+ a / 255.f);
+ CGContextFillRect(_context, rect_usr);
+ if (mode != kCGBlendModeNormal) {
+ CGContextSetBlendMode(_context, kCGBlendModeNormal);
+ }
+ return TRUE;
+}
+FX_BOOL CFX_QuartzDeviceDriver::DrawCosmeticLine(FX_FLOAT x1,
+ FX_FLOAT y1,
+ FX_FLOAT x2,
+ FX_FLOAT y2,
+ FX_DWORD argb,
+ int alphaFlag ,
+ void* iccTransform ,
+ int blend_type )
+{
+ CGBlendMode mode = GetCGBlendMode(blend_type);
+ if (mode != kCGBlendModeNormal) {
+ CGContextSetBlendMode(_context, mode);
+ }
+ CGPoint pt = CGPointApplyAffineTransform(CGPointMake(x1, y1), _foxitDevice2User);
+ x1 = pt.x;
+ y1 = pt.y;
+ pt = CGPointApplyAffineTransform(CGPointMake(x2, y2), _foxitDevice2User);
+ x2 = pt.x;
+ y2 = pt.y;
+ FX_INT32 a, r, g, b;
+ ArgbDecode(argb, a, r, g, b);
+ CGContextSetRGBStrokeColor(_context,
+ r / 255.f,
+ g / 255.f,
+ b / 255.f,
+ a / 255.f);
+ CGContextMoveToPoint(_context, x1, y1);
+ CGContextAddLineToPoint(_context, x2, y2);
+ CGContextStrokePath(_context);
+ if (mode != kCGBlendModeNormal) {
+ CGContextSetBlendMode(_context, kCGBlendModeNormal);
+ }
+ return TRUE;
+}
+FX_BOOL CFX_QuartzDeviceDriver::GetClipBox(FX_RECT* rect)
+{
+ CGRect r = CGContextGetClipBoundingBox(_context);
+ r = CGRectApplyAffineTransform(r, _user2FoxitDevice);
+ rect->left = FXSYS_floor(r.origin.x);
+ rect->top = FXSYS_floor(r.origin.y);
+ rect->right = FXSYS_ceil(r.origin.x + r.size.width);
+ rect->bottom = FXSYS_ceil(r.origin.y + r.size.height);
+ return TRUE;
+}
+FX_BOOL CFX_QuartzDeviceDriver::GetDIBits(CFX_DIBitmap* bitmap,
+ FX_INT32 left,
+ FX_INT32 top,
+ void* pIccTransform,
+ FX_BOOL bDEdge)
+{
+ if (FXDC_PRINTER == _deviceClass) {
+ return FALSE;
+ }
+ if (bitmap->GetBPP() < 32) {
+ return FALSE;
+ }
+ if (!(_renderCaps | FXRC_GET_BITS)) {
+ return FALSE;
+ }
+ CGPoint pt = CGPointMake(left, top);
+ pt = CGPointApplyAffineTransform(pt, _foxitDevice2User);
+ CGAffineTransform ctm = CGContextGetCTM(_context);
+ pt.x *= FXSYS_fabs(ctm.a);
+ pt.y *= FXSYS_fabs(ctm.d);
+ CGImageRef image = CGBitmapContextCreateImage(_context);
+ if (NULL == image) {
+ return FALSE;
+ }
+ CGFloat width = (CGFloat) bitmap->GetWidth();
+ CGFloat height = (CGFloat) bitmap->GetHeight();
+ if (width + pt.x > _width) {
+ width -= (width + pt.x - _width);
+ }
+ if (height + pt.y > _height) {
+ height -= (height + pt.y - _height);
+ }
+ CGImageRef subImage = CGImageCreateWithImageInRect(image,
+ CGRectMake(pt.x,
+ pt.y,
+ width,
+ height));
+ CGContextRef context = createContextWithBitmap(bitmap);
+ CGRect rect = CGContextGetClipBoundingBox(context);
+ CGContextClearRect(context, rect);
+ CGContextDrawImage(context, rect, subImage);
+ CGContextRelease(context);
+ CGImageRelease(subImage);
+ CGImageRelease(image);
+ if (bitmap->HasAlpha()) {
+ for (int row = 0; row < bitmap->GetHeight(); row ++) {
+ FX_LPBYTE pScanline = (FX_LPBYTE)bitmap->GetScanline(row);
+ for (int col = 0; col < bitmap->GetWidth(); col ++) {
+ if (pScanline[3] > 0) {
+ pScanline[0] = (pScanline[0] * 255.f / pScanline[3] + .5f);
+ pScanline[1] = (pScanline[1] * 255.f / pScanline[3] + .5f);
+ pScanline[2] = (pScanline[2] * 255.f / pScanline[3] + .5f);
+ }
+ pScanline += 4;
+ }
+ }
+ }
+ return TRUE;
+}
+FX_BOOL CFX_QuartzDeviceDriver::SetDIBits(const CFX_DIBSource* pBitmap,
+ FX_ARGB argb,
+ const FX_RECT* srcRect,
+ int dest_left,
+ int dest_top,
+ int blendType,
+ int alphaFlag ,
+ void* iccTransform )
+{
+ SaveState();
+ CGFloat src_left, src_top, src_width, src_height;
+ if (srcRect) {
+ src_left = srcRect->left;
+ src_top = srcRect->top;
+ src_width = srcRect->Width();
+ src_height = srcRect->Height();
+ } else {
+ src_left = src_top = 0;
+ src_width = pBitmap->GetWidth();
+ src_height = pBitmap->GetHeight();
+ }
+ CGAffineTransform ctm = CGContextGetCTM(_context);
+ CGFloat scale_x = FXSYS_fabs(ctm.a);
+ CGFloat scale_y = FXSYS_fabs(ctm.d);
+ src_left /= scale_x;
+ src_top /= scale_y;
+ src_width /= scale_x;
+ src_height /= scale_y;
+ CGRect rect_fx = CGRectMake(dest_left, dest_top, src_width, src_height);
+ CGRect rect_usr = CGRectApplyAffineTransform(rect_fx, _foxitDevice2User);
+ CGContextBeginPath(_context);
+ CGContextAddRect(_context, rect_usr);
+ CGContextClip(_context);
+ rect_usr.size = CGSizeMake(pBitmap->GetWidth() / scale_x, pBitmap->GetHeight() / scale_y);
+ rect_usr = CGRectOffset(rect_usr, -src_left, -src_top);
+ CG_SetImageTransform(dest_left, dest_top, src_width, src_height, &rect_usr);
+ CFX_DIBitmap* pBitmap1 = NULL;
+ if (pBitmap->IsAlphaMask()) {
+ if (pBitmap->GetBuffer()) {
+ pBitmap1 = (CFX_DIBitmap*)pBitmap;
+ } else {
+ pBitmap1 = pBitmap->Clone();
+ }
+ if (NULL == pBitmap1) {
+ RestoreState(FALSE);
+ return FALSE;
+ }
+ CGDataProviderRef pBitmapProvider = CGDataProviderCreateWithData(NULL,
+ pBitmap1->GetBuffer(),
+ pBitmap1->GetPitch() * pBitmap1->GetHeight(),
+ NULL);
+ CGColorSpaceRef pColorSpace = CGColorSpaceCreateDeviceGray();
+ CGBitmapInfo bitmapInfo = kCGImageAlphaNone | kCGBitmapByteOrderDefault;
+ CGImageRef pImage = CGImageCreate(pBitmap1->GetWidth(),
+ pBitmap1->GetHeight(),
+ pBitmap1->GetBPP(),
+ pBitmap1->GetBPP(),
+ pBitmap1->GetPitch(),
+ pColorSpace,
+ bitmapInfo,
+ pBitmapProvider, NULL, true,
+ kCGRenderingIntentDefault);
+ CGContextClipToMask(_context, rect_usr, pImage);
+ CGContextSetRGBFillColor(_context,
+ FXARGB_R(argb) / 255.f,
+ FXARGB_G(argb) / 255.f,
+ FXARGB_B(argb) / 255.f,
+ FXARGB_A(argb) / 255.f);
+ CGContextFillRect(_context, rect_usr);
+ CGImageRelease(pImage);
+ CGColorSpaceRelease(pColorSpace);
+ CGDataProviderRelease(pBitmapProvider);
+ if (pBitmap1 != pBitmap) {
+ delete pBitmap1;
+ }
+ RestoreState(FALSE);
+ return TRUE;
+ }
+ if (pBitmap->GetBPP() < 32) {
+ pBitmap1 = pBitmap->CloneConvert(FXDIB_Rgb32);
+ } else {
+ if (pBitmap->GetBuffer()) {
+ pBitmap1 = (CFX_DIBitmap*)pBitmap;
+ } else {
+ pBitmap1 = pBitmap->Clone();
+ }
+ }
+ if (NULL == pBitmap1) {
+ RestoreState(FALSE);
+ return FALSE;
+ }
+ if (pBitmap1->HasAlpha()) {
+ if (pBitmap1 == pBitmap) {
+ pBitmap1 = pBitmap->Clone();
+ if (!pBitmap1) {
+ RestoreState(FALSE);
+ return FALSE;
+ }
+ }
+ for (int row = 0; row < pBitmap1->GetHeight(); row ++) {
+ FX_LPBYTE pScanline = (FX_LPBYTE)pBitmap1->GetScanline(row);
+ for (int col = 0; col < pBitmap1->GetWidth(); col ++) {
+ pScanline[0] = (FX_BYTE)(pScanline[0] * pScanline[3] / 255.f + .5f);
+ pScanline[1] = (FX_BYTE)(pScanline[1] * pScanline[3] / 255.f + .5f);
+ pScanline[2] = (FX_BYTE)(pScanline[2] * pScanline[3] / 255.f + .5f);
+ pScanline += 4;
+ }
+ }
+ }
+ CGContextRef ctx = createContextWithBitmap(pBitmap1);
+ CGImageRef image = CGBitmapContextCreateImage(ctx);
+ int blend_mode = blendType;
+ if (FXDIB_BLEND_HARDLIGHT == blendType) {
+ blend_mode = kCGBlendModeSoftLight;
+ } else if (FXDIB_BLEND_SOFTLIGHT == blendType) {
+ blend_mode = kCGBlendModeHardLight;
+ } else if (blendType >= FXDIB_BLEND_NONSEPARABLE && blendType <= FXDIB_BLEND_LUMINOSITY) {
+ blend_mode = blendType - 9;
+ } else if (blendType > FXDIB_BLEND_LUMINOSITY || blendType < 0) {
+ blend_mode = kCGBlendModeNormal;
+ }
+ CGContextSetBlendMode(_context, (CGBlendMode)blend_mode);
+ CGContextDrawImage(_context, rect_usr, image);
+ CGImageRelease(image);
+ CGContextRelease(ctx);
+ if (pBitmap1 != pBitmap) {
+ delete pBitmap1;
+ }
+ RestoreState(FALSE);
+ return TRUE;
+}
+FX_BOOL CFX_QuartzDeviceDriver::StretchDIBits(const CFX_DIBSource* pBitmap,
+ FX_ARGB argb,
+ int dest_left,
+ int dest_top,
+ int dest_width,
+ int dest_height,
+ const FX_RECT* clipRect,
+ FX_DWORD flags,
+ int alphaFlag ,
+ void* iccTransform ,
+ int blend_type)
+{
+ SaveState();
+ if (clipRect) {
+ CGContextBeginPath(_context);
+ CGRect rect_clip = CGRectMake(clipRect->left, clipRect->top, clipRect->Width(), clipRect->Height());
+ rect_clip = CGRectApplyAffineTransform(rect_clip, _foxitDevice2User);
+ CGContextAddRect(_context, rect_clip);
+ CGContextClip(_context);
+ }
+ CGRect rect = CGRectMake(dest_left, dest_top, dest_width, dest_height);
+ rect = CGRectApplyAffineTransform(rect, _foxitDevice2User);
+ if (FXDIB_BICUBIC_INTERPOL == flags) {
+ CGContextSetInterpolationQuality(_context, kCGInterpolationHigh);
+ } else if (FXDIB_DOWNSAMPLE == flags) {
+ CGContextSetInterpolationQuality(_context, kCGInterpolationNone);
+ } else {
+ CGContextSetInterpolationQuality(_context, kCGInterpolationMedium);
+ }
+ CG_SetImageTransform(dest_left, dest_top, dest_width, dest_height);
+ CFX_DIBitmap* pBitmap1 = NULL;
+ if (pBitmap->IsAlphaMask()) {
+ if (pBitmap->GetBuffer()) {
+ pBitmap1 = (CFX_DIBitmap*)pBitmap;
+ } else {
+ pBitmap1 = pBitmap->Clone();
+ }
+ if (NULL == pBitmap1) {
+ RestoreState(FALSE);
+ return FALSE;
+ }
+ CGDataProviderRef pBitmapProvider = CGDataProviderCreateWithData(NULL,
+ pBitmap1->GetBuffer(),
+ pBitmap1->GetPitch() * pBitmap1->GetHeight(),
+ NULL);
+ CGColorSpaceRef pColorSpace = CGColorSpaceCreateDeviceGray();
+ CGBitmapInfo bitmapInfo = kCGImageAlphaNone | kCGBitmapByteOrderDefault;
+ CGImageRef pImage = CGImageCreate(pBitmap1->GetWidth(),
+ pBitmap1->GetHeight(),
+ pBitmap1->GetBPP(),
+ pBitmap1->GetBPP(),
+ pBitmap1->GetPitch(),
+ pColorSpace,
+ bitmapInfo,
+ pBitmapProvider, NULL, true,
+ kCGRenderingIntentDefault);
+ CGContextClipToMask(_context, rect, pImage);
+ CGContextSetRGBFillColor(_context,
+ FXARGB_R(argb) / 255.f,
+ FXARGB_G(argb) / 255.f,
+ FXARGB_B(argb) / 255.f,
+ FXARGB_A(argb) / 255.f);
+ CGContextFillRect(_context, rect);
+ CGImageRelease(pImage);
+ CGColorSpaceRelease(pColorSpace);
+ CGDataProviderRelease(pBitmapProvider);
+ if (pBitmap1 != pBitmap) {
+ delete pBitmap1;
+ }
+ RestoreState(FALSE);
+ return TRUE;
+ }
+ if (pBitmap->GetBPP() < 32) {
+ pBitmap1 = pBitmap->CloneConvert(FXDIB_Rgb32);
+ } else {
+ if (pBitmap->GetBuffer()) {
+ pBitmap1 = (CFX_DIBitmap*)pBitmap;
+ } else {
+ pBitmap1 = pBitmap->Clone();
+ }
+ }
+ if (NULL == pBitmap1) {
+ RestoreState(FALSE);
+ return FALSE;
+ }
+ if (pBitmap1->HasAlpha()) {
+ if (pBitmap1 == pBitmap) {
+ pBitmap1 = pBitmap->Clone();
+ if (!pBitmap1) {
+ RestoreState(FALSE);
+ return FALSE;
+ }
+ }
+ for (int row = 0; row < pBitmap1->GetHeight(); row ++) {
+ FX_LPBYTE pScanline = (FX_LPBYTE)pBitmap1->GetScanline(row);
+ for (int col = 0; col < pBitmap1->GetWidth(); col ++) {
+ pScanline[0] = (FX_BYTE)(pScanline[0] * pScanline[3] / 255.f + .5f);
+ pScanline[1] = (FX_BYTE)(pScanline[1] * pScanline[3] / 255.f + .5f);
+ pScanline[2] = (FX_BYTE)(pScanline[2] * pScanline[3] / 255.f + .5f);
+ pScanline += 4;
+ }
+ }
+ }
+ CGContextRef ctx = createContextWithBitmap(pBitmap1);
+ CGImageRef image = CGBitmapContextCreateImage(ctx);
+ CGContextDrawImage(_context, rect, image);
+ CGImageRelease(image);
+ CGContextRelease(ctx);
+ if (pBitmap1 != pBitmap) {
+ delete pBitmap1;
+ }
+ RestoreState(FALSE);
+ return TRUE;
+}
+FX_BOOL CFX_QuartzDeviceDriver::CG_DrawGlypRun(int nChars,
+ const FXTEXT_CHARPOS* pCharPos,
+ CFX_Font* pFont,
+ CFX_FontCache* pCache,
+ const CFX_AffineMatrix* pGlyphMatrix,
+ const CFX_AffineMatrix* pObject2Device,
+ FX_FLOAT font_size,
+ FX_DWORD argb,
+ int alpha_flag,
+ void* pIccTransform)
+{
+ if (nChars == 0) {
+ return TRUE;
+ }
+ CQuartz2D& quartz2d = ((CApplePlatform *) CFX_GEModule::Get()->GetPlatformData())->_quartz2d;
+ if (!pFont->m_pPlatformFont) {
+ if (pFont->GetPsName() == CFX_WideString::FromLocal("DFHeiStd-W5")) {
+ return FALSE;
+ }
+ pFont->m_pPlatformFont = quartz2d.CreateFont(pFont->m_pFontData, pFont->m_dwSize);
+ if (NULL == pFont->m_pPlatformFont) {
+ return FALSE;
+ }
+ }
+ CFX_FixedBufGrow<FX_WORD, 32> glyph_indices(nChars);
+ CFX_FixedBufGrow<CGPoint, 32> glyph_positions(nChars);
+ for (int i = 0; i < nChars; i++ ) {
+ glyph_indices[i] = pCharPos[i].m_ExtGID;
+ glyph_positions[i].x = pCharPos[i].m_OriginX;
+ glyph_positions[i].y = pCharPos[i].m_OriginY;
+ }
+ CFX_AffineMatrix text_matrix;
+ if (pObject2Device) {
+ text_matrix.Concat(*pObject2Device);
+ }
+ CGAffineTransform matrix_cg = CGAffineTransformMake(text_matrix.a,
+ text_matrix.b,
+ text_matrix.c,
+ text_matrix.d,
+ text_matrix.e,
+ text_matrix.f);
+ matrix_cg = CGAffineTransformConcat(matrix_cg, _foxitDevice2User);
+ CGContextSetTextMatrix(_context, matrix_cg);
+ CGContextSetFont(_context, (CGFontRef)pFont->m_pPlatformFont);
+ CGContextSetFontSize(_context, FXSYS_fabs(font_size));
+ FX_INT32 a, r, g, b;
+ ArgbDecode(argb, a, r, g, b);
+ CGContextSetRGBFillColor(_context,
+ r / 255.f,
+ g / 255.f,
+ b / 255.f,
+ a / 255.f);
+ SaveState();
+ if (pGlyphMatrix) {
+ CGAffineTransform ctm = CGContextGetCTM(_context);
+ CGPoint origin = CGPointMake( glyph_positions[0].x, glyph_positions[0].y);
+ origin = CGPointApplyAffineTransform(origin, matrix_cg);
+ CGContextTranslateCTM(_context, origin.x, origin.y);
+ CGAffineTransform glyph_matrix = CGAffineTransformMake(pGlyphMatrix->a,
+ pGlyphMatrix->b,
+ pGlyphMatrix->c,
+ pGlyphMatrix->d,
+ pGlyphMatrix->e,
+ pGlyphMatrix->f);
+ if (_foxitDevice2User.d < 0) {
+ glyph_matrix = CGAffineTransformInvert(glyph_matrix);
+ }
+ CGContextConcatCTM(_context, glyph_matrix);
+ CGContextTranslateCTM(_context, -origin.x, -origin.y);
+ }
+ CGContextShowGlyphsAtPositions(_context,
+ (CGGlyph*)glyph_indices,
+ glyph_positions,
+ nChars);
+ RestoreState(FALSE);
+ return TRUE;
+}
+FX_BOOL CFX_QuartzDeviceDriver::DrawDeviceText(int nChars,
+ const FXTEXT_CHARPOS* pCharPos,
+ CFX_Font* pFont,
+ CFX_FontCache* pCache,
+ const CFX_AffineMatrix* pObject2Device,
+ FX_FLOAT font_size,
+ FX_DWORD color,
+ int alpha_flag ,
+ void* pIccTransform)
+{
+ if (NULL == pFont || NULL == _context) {
+ return FALSE;
+ }
+ FX_BOOL bBold = pFont->IsBold();
+ if (!bBold && pFont->GetSubstFont() &&
+ pFont->GetSubstFont()->m_Weight >= 500 &&
+ pFont->GetSubstFont()->m_Weight <= 600) {
+ return FALSE;
+ }
+ SaveState();
+ CGContextSetTextDrawingMode(_context, kCGTextFillClip);
+ FX_BOOL ret = FALSE;
+ FX_INT32 i = 0;
+ while (i < nChars) {
+ if (pCharPos[i].m_bGlyphAdjust || font_size < 0) {
+ if (i > 0) {
+ ret = CG_DrawGlypRun(i, pCharPos, pFont, pCache, NULL, pObject2Device, font_size, color, alpha_flag, pIccTransform);
+ if (!ret) {
+ RestoreState(FALSE);
+ return ret;
+ }
+ }
+ const FXTEXT_CHARPOS* char_pos = pCharPos + i;
+ CFX_AffineMatrix glphy_matrix;
+ if (font_size < 0) {
+ glphy_matrix.Concat(-1, 0, 0, -1, 0, 0);
+ }
+ if (char_pos->m_bGlyphAdjust) {
+ glphy_matrix.Concat(char_pos->m_AdjustMatrix[0],
+ char_pos->m_AdjustMatrix[1],
+ char_pos->m_AdjustMatrix[2],
+ char_pos->m_AdjustMatrix[3], 0, 0);
+ }
+ ret = CG_DrawGlypRun(1, char_pos, pFont, pCache, &glphy_matrix, pObject2Device, font_size, color, alpha_flag, pIccTransform);
+ if (!ret) {
+ RestoreState(FALSE);
+ return ret;
+ }
+ i ++;
+ pCharPos += i;
+ nChars -= i;
+ i = 0;
+ } else {
+ i ++;
+ }
+ }
+ if (i > 0) {
+ ret = CG_DrawGlypRun(i, pCharPos, pFont, pCache, NULL, pObject2Device, font_size, color, alpha_flag, pIccTransform);
+ }
+ RestoreState(FALSE);
+ return ret;
+}
+void CFX_QuartzDeviceDriver::setStrokeInfo(const CFX_GraphStateData* graphState, FX_ARGB argb, FX_FLOAT lineWidth)
+{
+ if (NULL == graphState) {
+ return;
+ }
+ CGContextSetLineWidth(_context, lineWidth);
+ CGLineCap cap;
+ switch (graphState->m_LineCap) {
+ case CFX_GraphStateData::LineCapRound: {
+ cap = kCGLineCapRound;
+ break;
+ }
+ case CFX_GraphStateData::LineCapSquare: {
+ cap = kCGLineCapSquare;
+ break;
+ }
+ case CFX_GraphStateData::LineCapButt:
+ default: {
+ cap = kCGLineCapButt;
+ }
+ }
+ CGContextSetLineCap(_context, cap);
+ CGLineJoin join;
+ switch (graphState->m_LineJoin) {
+ case CFX_GraphStateData::LineJoinRound: {
+ join = kCGLineJoinRound;
+ break;
+ }
+ case CFX_GraphStateData::LineJoinBevel: {
+ join = kCGLineJoinBevel;
+ break;
+ }
+ case CFX_GraphStateData::LineJoinMiter:
+ default: {
+ join = kCGLineJoinMiter;
+ }
+ }
+ CGContextSetLineJoin(_context, join);
+ if (graphState->m_DashCount) {
+#if CGFLOAT_IS_DOUBLE
+ CGFloat* dashArray = new CGFloat[graphState->m_DashCount];
+ if (!dashArray) {
+ return;
+ }
+ for (int index = 0; index < graphState->m_DashCount; ++index) {
+ dashArray[index] = graphState->m_DashArray[index];
+ }
+#else
+ CGFloat* dashArray = (CGFloat*)graphState->m_DashArray;
+#endif
+ CGContextSetLineDash(_context, graphState->m_DashPhase, dashArray, graphState->m_DashCount);
+#if CGFLOAT_IS_DOUBLE
+ delete[] dashArray;
+#endif
+ }
+ FX_INT32 a, r, g, b;
+ ArgbDecode(argb, a, r, g, b);
+ CGContextSetRGBStrokeColor(_context,
+ r / 255.f,
+ g / 255.f,
+ b / 255.f,
+ a / 255.f);
+}
+void CFX_QuartzDeviceDriver::setFillInfo(FX_ARGB argb)
+{
+ FX_INT32 a, r, g, b;
+ ArgbDecode(argb, a, r, g, b);
+ CGContextSetRGBFillColor(_context,
+ r / 255.f,
+ g / 255.f,
+ b / 255.f,
+ a / 255.f);
+}
+void CFX_QuartzDeviceDriver::setPathToContext(const CFX_PathData* pathData)
+{
+ FX_INT32 count = pathData->GetPointCount();
+ FX_PATHPOINT* points = pathData->GetPoints();
+ CGContextBeginPath(_context);
+ for (FX_INT32 i = 0; i < count; i ++) {
+ switch (points[i].m_Flag & FXPT_TYPE) {
+ case FXPT_MOVETO:
+ CGContextMoveToPoint(_context, points[i].m_PointX, points[i].m_PointY);
+ break;
+ case FXPT_LINETO:
+ CGContextAddLineToPoint(_context, points[i].m_PointX, points[i].m_PointY);
+ break;
+ case FXPT_BEZIERTO: {
+ CGContextAddCurveToPoint(_context,
+ points[i].m_PointX, points[i].m_PointY,
+ points[i + 1].m_PointX, points[i + 1].m_PointY,
+ points[i + 2].m_PointX, points[i + 2].m_PointY);
+ i += 2;
+ }
+ }
+ if (points[i].m_Flag & FXPT_CLOSEFIGURE) {
+ CGContextClosePath(_context);
+ }
+ }
+}
+void CFX_QuartzDeviceDriver::CG_SetImageTransform(int dest_left, int dest_top, int dest_width, int dest_height,
+ CGRect* rect )
+{
+ int flip_y = _foxitDevice2User.d * dest_height < 0 ? 1 : -1;
+ int flip_x = _foxitDevice2User.a * dest_width > 0 ? 1 : -1;
+ if (flip_y < 0 || flip_x < 0) {
+ if (dest_height < 0) {
+ dest_height = -dest_height;
+ dest_top -= dest_height;
+ }
+ CGRect rt = CGRectApplyAffineTransform(CGRectMake(dest_left, dest_top, dest_width, dest_height), _foxitDevice2User);
+ CGFloat offset_x = (rt.origin.x) + rt.size.width / 2.f,
+ offset_y = (rt.origin.y) + rt.size.height / 2.f;
+ CGAffineTransform transform = CGAffineTransformIdentity;
+ transform = CGAffineTransformConcat(transform, CGAffineTransformMake(1, 0, 0, 1, -offset_x, -offset_y));
+ transform = CGAffineTransformConcat(transform, CGAffineTransformMake(flip_x, 0, 0, flip_y, 0, 0));
+ transform = CGAffineTransformConcat(transform, CGAffineTransformMake(1, 0, 0, 1, offset_x, offset_y));
+ CGContextConcatCTM(_context, transform);
+ if (rect) {
+ *rect = CGRectApplyAffineTransform(*rect, transform);
+ }
+ }
+}
+void CFX_QuartzDeviceDriver::ClearDriver()
+{
+ if (NULL == _context) {
+ return;
+ }
+ for (int i = 0; i < m_saveCount; ++i) {
+ CGContextRestoreGState(_context);
+ }
+ m_saveCount = 0;
+ if (_context) {
+ CGContextRelease(_context);
+ }
+}
+CFX_QuartzDevice::CFX_QuartzDevice()
+{
+ m_bOwnedBitmap = FALSE;
+ m_pContext = NULL;
+}
+CFX_QuartzDevice::~CFX_QuartzDevice()
+{
+ if (m_pContext) {
+ CGContextRelease(m_pContext);
+ }
+ if (GetBitmap() && m_bOwnedBitmap) {
+ delete GetBitmap();
+ }
+}
+CGContextRef CFX_QuartzDevice::GetContext()
+{
+ return m_pContext;
+}
+FX_BOOL CFX_QuartzDevice::Attach(CGContextRef context, FX_INT32 nDeviceClass)
+{
+ if (m_pContext) {
+ CGContextRelease(m_pContext);
+ }
+ m_pContext = context;
+ CGContextRetain(m_pContext);
+ IFX_RenderDeviceDriver* pDriver = FX_NEW CFX_QuartzDeviceDriver(m_pContext, nDeviceClass);
+ if (!pDriver) {
+ return FALSE;
+ }
+ SetDeviceDriver(pDriver);
+ return TRUE;
+}
+FX_BOOL CFX_QuartzDevice::Attach(CFX_DIBitmap* pBitmap)
+{
+ SetBitmap(pBitmap);
+ m_pContext = createContextWithBitmap(pBitmap);
+ if (NULL == m_pContext) {
+ return FALSE;
+ }
+ IFX_RenderDeviceDriver* pDriver = FX_NEW CFX_QuartzDeviceDriver(m_pContext, FXDC_DISPLAY);
+ if (!pDriver) {
+ return FALSE;
+ }
+ SetDeviceDriver(pDriver);
+ return TRUE;
+}
+FX_BOOL CFX_QuartzDevice::Create(FX_INT32 width, FX_INT32 height, FXDIB_Format format)
+{
+ if ((FX_BYTE)format < 32) {
+ return FALSE;
+ }
+ CFX_DIBitmap* pBitmap = FX_NEW CFX_DIBitmap;
+ if (!pBitmap) {
+ return FALSE;
+ }
+ if (!pBitmap->Create(width, height, format)) {
+ delete pBitmap;
+ return FALSE;
+ }
+ m_bOwnedBitmap = TRUE;
+ return Attach(pBitmap);
+}
+#endif
diff --git a/core/src/fxge/dib/dib_int.h b/core/src/fxge/dib/dib_int.h
index a9d0b027c5..1e6d82ea86 100644
--- a/core/src/fxge/dib/dib_int.h
+++ b/core/src/fxge/dib/dib_int.h
@@ -1,88 +1,88 @@
-// 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
-
-class CPDF_FixedMatrix : public CFX_Object
-{
-public:
- CPDF_FixedMatrix(const CFX_AffineMatrix& src, int bits)
- {
- base = 1 << bits;
- a = FXSYS_round(src.a * base);
- b = FXSYS_round(src.b * base);
- c = FXSYS_round(src.c * base);
- d = FXSYS_round(src.d * base);
- e = FXSYS_round(src.e * base);
- f = FXSYS_round(src.f * base);
- }
- inline void Transform(int x, int y, int& x1, int& y1)
- {
- x1 = (a * x + c * y + e + base / 2) / base;
- y1 = (b * x + d * y + f + base / 2) / base;
- }
- int a, b, c, d, e, f;
- int base;
-};
-#define FPDF_HUGE_IMAGE_SIZE 60000000
-struct PixelWeight {
- int m_SrcStart;
- int m_SrcEnd;
- int m_Weights[1];
-};
-class CWeightTable : public CFX_Object
-{
-public:
- CWeightTable()
- {
- m_pWeightTables = NULL;
- }
- ~CWeightTable()
- {
- if(m_pWeightTables) {
- FX_Free(m_pWeightTables);
- }
- m_pWeightTables = NULL;
- }
- void Calc(int dest_len, int dest_min, int dest_max, int src_len, int src_min, int src_max, int flags);
- PixelWeight* GetPixelWeight(int pixel)
- {
- return (PixelWeight*)(m_pWeightTables + (pixel - m_DestMin) * m_ItemSize);
- }
- int m_DestMin, m_ItemSize;
- FX_LPBYTE m_pWeightTables;
-};
-class CStretchEngine : public CFX_Object
-{
-public:
- CStretchEngine(IFX_ScanlineComposer* pDestBitmap, FXDIB_Format dest_format,
- int dest_width, int dest_height, const FX_RECT& clip_rect,
- const CFX_DIBSource* pSrcBitmap, int flags);
- ~CStretchEngine();
- FX_BOOL Continue(IFX_Pause* pPause);
-public:
- FXDIB_Format m_DestFormat;
- int m_DestBpp, m_SrcBpp, m_bHasAlpha;
- IFX_ScanlineComposer* m_pDestBitmap;
- int m_DestWidth, m_DestHeight;
- FX_RECT m_DestClip;
- FX_LPBYTE m_pDestScanline;
- FX_LPBYTE m_pDestMaskScanline;
- FX_RECT m_SrcClip;
- const CFX_DIBSource* m_pSource;
- FX_DWORD* m_pSrcPalette;
- int m_SrcWidth, m_SrcHeight;
- int m_SrcPitch, m_InterPitch;
- int m_ExtraMaskPitch;
- unsigned char* m_pInterBuf;
- unsigned char* m_pExtraAlphaBuf;
- int m_TransMethod;
- int m_Flags;
- CWeightTable m_WeightTable;
- int m_CurRow;
- FX_BOOL StartStretchHorz();
- FX_BOOL ContinueStretchHorz(IFX_Pause* pPause);
- void StretchVert();
- int m_State;
-};
+// 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
+
+class CPDF_FixedMatrix : public CFX_Object
+{
+public:
+ CPDF_FixedMatrix(const CFX_AffineMatrix& src, int bits)
+ {
+ base = 1 << bits;
+ a = FXSYS_round(src.a * base);
+ b = FXSYS_round(src.b * base);
+ c = FXSYS_round(src.c * base);
+ d = FXSYS_round(src.d * base);
+ e = FXSYS_round(src.e * base);
+ f = FXSYS_round(src.f * base);
+ }
+ inline void Transform(int x, int y, int& x1, int& y1)
+ {
+ x1 = (a * x + c * y + e + base / 2) / base;
+ y1 = (b * x + d * y + f + base / 2) / base;
+ }
+ int a, b, c, d, e, f;
+ int base;
+};
+#define FPDF_HUGE_IMAGE_SIZE 60000000
+struct PixelWeight {
+ int m_SrcStart;
+ int m_SrcEnd;
+ int m_Weights[1];
+};
+class CWeightTable : public CFX_Object
+{
+public:
+ CWeightTable()
+ {
+ m_pWeightTables = NULL;
+ }
+ ~CWeightTable()
+ {
+ if(m_pWeightTables) {
+ FX_Free(m_pWeightTables);
+ }
+ m_pWeightTables = NULL;
+ }
+ void Calc(int dest_len, int dest_min, int dest_max, int src_len, int src_min, int src_max, int flags);
+ PixelWeight* GetPixelWeight(int pixel)
+ {
+ return (PixelWeight*)(m_pWeightTables + (pixel - m_DestMin) * m_ItemSize);
+ }
+ int m_DestMin, m_ItemSize;
+ FX_LPBYTE m_pWeightTables;
+};
+class CStretchEngine : public CFX_Object
+{
+public:
+ CStretchEngine(IFX_ScanlineComposer* pDestBitmap, FXDIB_Format dest_format,
+ int dest_width, int dest_height, const FX_RECT& clip_rect,
+ const CFX_DIBSource* pSrcBitmap, int flags);
+ ~CStretchEngine();
+ FX_BOOL Continue(IFX_Pause* pPause);
+public:
+ FXDIB_Format m_DestFormat;
+ int m_DestBpp, m_SrcBpp, m_bHasAlpha;
+ IFX_ScanlineComposer* m_pDestBitmap;
+ int m_DestWidth, m_DestHeight;
+ FX_RECT m_DestClip;
+ FX_LPBYTE m_pDestScanline;
+ FX_LPBYTE m_pDestMaskScanline;
+ FX_RECT m_SrcClip;
+ const CFX_DIBSource* m_pSource;
+ FX_DWORD* m_pSrcPalette;
+ int m_SrcWidth, m_SrcHeight;
+ int m_SrcPitch, m_InterPitch;
+ int m_ExtraMaskPitch;
+ unsigned char* m_pInterBuf;
+ unsigned char* m_pExtraAlphaBuf;
+ int m_TransMethod;
+ int m_Flags;
+ CWeightTable m_WeightTable;
+ int m_CurRow;
+ FX_BOOL StartStretchHorz();
+ FX_BOOL ContinueStretchHorz(IFX_Pause* pPause);
+ void StretchVert();
+ int m_State;
+};
diff --git a/core/src/fxge/dib/fx_dib_composite.cpp b/core/src/fxge/dib/fx_dib_composite.cpp
index 8e9b4912a8..1bbe07725b 100644
--- a/core/src/fxge/dib/fx_dib_composite.cpp
+++ b/core/src/fxge/dib/fx_dib_composite.cpp
@@ -1,4602 +1,4602 @@
-// 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
-
-#include "../../../include/fxge/fx_ge.h"
-#include "../../../include/fxcodec/fx_codec.h"
-#include "dib_int.h"
-const FX_BYTE g_GammaRamp[256] = {
- 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3,
- 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7,
- 8, 8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 12, 12, 12, 13,
- 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 17, 18, 18, 19, 19, 20,
- 20, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 27, 27, 28, 29, 29,
- 30, 30, 31, 32, 32, 33, 34, 35, 35, 36, 37, 37, 38, 39, 40, 41,
- 41, 42, 43, 44, 45, 45, 46, 47, 48, 49, 50, 51, 51, 52, 53, 54,
- 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
- 71, 72, 73, 74, 76, 77, 78, 79, 80, 81, 82, 84, 85, 86, 87, 88,
- 90, 91, 92, 93, 95, 96, 97, 99, 100, 101, 103, 104, 105, 107, 108, 109,
- 111, 112, 114, 115, 116, 118, 119, 121, 122, 124, 125, 127, 128, 130, 131, 133,
- 134, 136, 138, 139, 141, 142, 144, 146, 147, 149, 151, 152, 154, 156, 157, 159,
- 161, 163, 164, 166, 168, 170, 171, 173, 175, 177, 179, 181, 183, 184, 186, 188,
- 190, 192, 194, 196, 198, 200, 202, 204, 206, 208, 210, 212, 214, 216, 218, 220,
- 222, 224, 226, 229, 231, 233, 235, 237, 239, 242, 244, 246, 248, 250, 253, 255,
-};
-const FX_BYTE g_GammaInverse[256] = {
- 0, 13, 22, 28, 34, 38, 42, 46, 50, 53, 56, 59, 61, 64, 66, 69,
- 71, 73, 75, 77, 79, 81, 83, 85, 86, 88, 90, 92, 93, 95, 96, 98,
- 99, 101, 102, 104, 105, 106, 108, 109, 110, 112, 113, 114, 115, 117, 118, 119,
- 120, 121, 122, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136,
- 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 148, 149, 150, 151,
- 152, 153, 154, 155, 155, 156, 157, 158, 159, 159, 160, 161, 162, 163, 163, 164,
- 165, 166, 167, 167, 168, 169, 170, 170, 171, 172, 173, 173, 174, 175, 175, 176,
- 177, 178, 178, 179, 180, 180, 181, 182, 182, 183, 184, 185, 185, 186, 187, 187,
- 188, 189, 189, 190, 190, 191, 192, 192, 193, 194, 194, 195, 196, 196, 197, 197,
- 198, 199, 199, 200, 200, 201, 202, 202, 203, 203, 204, 205, 205, 206, 206, 207,
- 208, 208, 209, 209, 210, 210, 211, 212, 212, 213, 213, 214, 214, 215, 215, 216,
- 216, 217, 218, 218, 219, 219, 220, 220, 221, 221, 222, 222, 223, 223, 224, 224,
- 225, 226, 226, 227, 227, 228, 228, 229, 229, 230, 230, 231, 231, 232, 232, 233,
- 233, 234, 234, 235, 235, 236, 236, 237, 237, 238, 238, 238, 239, 239, 240, 240,
- 241, 241, 242, 242, 243, 243, 244, 244, 245, 245, 246, 246, 246, 247, 247, 248,
- 248, 249, 249, 250, 250, 251, 251, 251, 252, 252, 253, 253, 254, 254, 255, 255,
-};
-const FX_BYTE _color_sqrt[256] = {
- 0x00, 0x03, 0x07, 0x0B, 0x0F, 0x12, 0x16, 0x19, 0x1D, 0x20, 0x23, 0x26, 0x29, 0x2C, 0x2F, 0x32,
- 0x35, 0x37, 0x3A, 0x3C, 0x3F, 0x41, 0x43, 0x46, 0x48, 0x4A, 0x4C, 0x4E, 0x50, 0x52, 0x54, 0x56,
- 0x57, 0x59, 0x5B, 0x5C, 0x5E, 0x60, 0x61, 0x63, 0x64, 0x65, 0x67, 0x68, 0x69, 0x6B, 0x6C, 0x6D,
- 0x6E, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E,
- 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E,
- 0x8F, 0x90, 0x91, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x97, 0x98, 0x99, 0x9A, 0x9B, 0x9C,
- 0x9C, 0x9D, 0x9E, 0x9F, 0xA0, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA4, 0xA5, 0xA6, 0xA7, 0xA7, 0xA8,
- 0xA9, 0xAA, 0xAA, 0xAB, 0xAC, 0xAD, 0xAD, 0xAE, 0xAF, 0xB0, 0xB0, 0xB1, 0xB2, 0xB3, 0xB3, 0xB4,
- 0xB5, 0xB5, 0xB6, 0xB7, 0xB7, 0xB8, 0xB9, 0xBA, 0xBA, 0xBB, 0xBC, 0xBC, 0xBD, 0xBE, 0xBE, 0xBF,
- 0xC0, 0xC0, 0xC1, 0xC2, 0xC2, 0xC3, 0xC4, 0xC4, 0xC5, 0xC6, 0xC6, 0xC7, 0xC7, 0xC8, 0xC9, 0xC9,
- 0xCA, 0xCB, 0xCB, 0xCC, 0xCC, 0xCD, 0xCE, 0xCE, 0xCF, 0xD0, 0xD0, 0xD1, 0xD1, 0xD2, 0xD3, 0xD3,
- 0xD4, 0xD4, 0xD5, 0xD6, 0xD6, 0xD7, 0xD7, 0xD8, 0xD9, 0xD9, 0xDA, 0xDA, 0xDB, 0xDC, 0xDC, 0xDD,
- 0xDD, 0xDE, 0xDE, 0xDF, 0xE0, 0xE0, 0xE1, 0xE1, 0xE2, 0xE2, 0xE3, 0xE4, 0xE4, 0xE5, 0xE5, 0xE6,
- 0xE6, 0xE7, 0xE7, 0xE8, 0xE9, 0xE9, 0xEA, 0xEA, 0xEB, 0xEB, 0xEC, 0xEC, 0xED, 0xED, 0xEE, 0xEE,
- 0xEF, 0xF0, 0xF0, 0xF1, 0xF1, 0xF2, 0xF2, 0xF3, 0xF3, 0xF4, 0xF4, 0xF5, 0xF5, 0xF6, 0xF6, 0xF7,
- 0xF7, 0xF8, 0xF8, 0xF9, 0xF9, 0xFA, 0xFA, 0xFB, 0xFB, 0xFC, 0xFC, 0xFD, 0xFD, 0xFE, 0xFE, 0xFF
-};
-int _BLEND(int blend_mode, int back_color, int src_color)
-{
- switch (blend_mode) {
- case FXDIB_BLEND_NORMAL:
- return src_color;
- case FXDIB_BLEND_MULTIPLY:
- return src_color * back_color / 255;
- case FXDIB_BLEND_SCREEN:
- return src_color + back_color - src_color * back_color / 255;
- case FXDIB_BLEND_OVERLAY:
- return _BLEND(FXDIB_BLEND_HARDLIGHT, src_color, back_color);
- case FXDIB_BLEND_DARKEN:
- return src_color < back_color ? src_color : back_color;
- case FXDIB_BLEND_LIGHTEN:
- return src_color > back_color ? src_color : back_color;
- case FXDIB_BLEND_COLORDODGE: {
- if (src_color == 255) {
- return src_color;
- }
- int result = back_color * 255 / (255 - src_color);
- if (result > 255) {
- return 255;
- }
- return result;
- }
- case FXDIB_BLEND_COLORBURN: {
- if (src_color == 0) {
- return src_color;
- }
- int result = (255 - back_color) * 255 / src_color;
- if (result > 255) {
- result = 255;
- }
- return 255 - result;
- }
- case FXDIB_BLEND_HARDLIGHT:
- if (src_color < 128) {
- return (src_color * back_color * 2) / 255;
- }
- return _BLEND(FXDIB_BLEND_SCREEN, back_color, 2 * src_color - 255);
- case FXDIB_BLEND_SOFTLIGHT: {
- if (src_color < 128) {
- return back_color - (255 - 2 * src_color) * back_color * (255 - back_color) / 255 / 255;
- }
- return back_color + (2 * src_color - 255) * (_color_sqrt[back_color] - back_color) / 255;
- }
- case FXDIB_BLEND_DIFFERENCE:
- return back_color < src_color ? src_color - back_color : back_color - src_color;
- case FXDIB_BLEND_EXCLUSION:
- return back_color + src_color - 2 * back_color * src_color / 255;
- }
- return src_color;
-}
-struct _RGB {
- int red;
- int green;
- int blue;
-};
-static inline int _Lum(_RGB color)
-{
- return (color.red * 30 + color.green * 59 + color.blue * 11) / 100;
-}
-static _RGB _ClipColor(_RGB color)
-{
- int l = _Lum(color);
- int n = color.red;
- if (color.green < n) {
- n = color.green;
- }
- if (color.blue < n) {
- n = color.blue;
- }
- int x = color.red;
- if (color.green > x) {
- x = color.green;
- }
- if (color.blue > x) {
- x = color.blue;
- }
- if (n < 0) {
- color.red = l + ((color.red - l) * l / (l - n));
- color.green = l + ((color.green - l) * l / (l - n));
- color.blue = l + ((color.blue - l) * l / (l - n));
- }
- if (x > 255) {
- color.red = l + ((color.red - l) * (255 - l) / (x - l));
- color.green = l + ((color.green - l) * (255 - l) / (x - l));
- color.blue = l + ((color.blue - l) * (255 - l) / (x - l));
- }
- return color;
-}
-static _RGB _SetLum(_RGB color, int l)
-{
- int d = l - _Lum(color);
- color.red += d;
- color.green += d;
- color.blue += d;
- return _ClipColor(color);
-}
-static int _Sat(_RGB color)
-{
- int n = color.red;
- if (color.green < n) {
- n = color.green;
- }
- if (color.blue < n) {
- n = color.blue;
- }
- int x = color.red;
- if (color.green > x) {
- x = color.green;
- }
- if (color.blue > x) {
- x = color.blue;
- }
- return x - n;
-}
-static _RGB _SetSat(_RGB color, int s)
-{
- int* max = &color.red;
- int* mid = &color.red;
- int* min = &color.red;
- if (color.green > *max) {
- max = &color.green;
- }
- if (color.blue > *max) {
- max = &color.blue;
- }
- if (color.green < *min) {
- min = &color.green;
- }
- if (color.blue < *min) {
- min = &color.blue;
- }
- if (*max == *min) {
- color.red = 0;
- color.green = 0;
- color.blue = 0;
- return color;
- }
- if (max == &color.red) {
- if (min == &color.green) {
- mid = &color.blue;
- } else {
- mid = &color.green;
- }
- } else if (max == &color.green) {
- if (min == &color.red) {
- mid = &color.blue;
- } else {
- mid = &color.red;
- }
- } else {
- if (min == &color.green) {
- mid = &color.red;
- } else {
- mid = &color.green;
- }
- }
- if (*max > *min) {
- *mid = (*mid - *min) * s / (*max - *min);
- *max = s;
- *min = 0;
- }
- return color;
-}
-void _RGB_Blend(int blend_mode, FX_LPCBYTE src_scan, FX_BYTE* dest_scan, int results[3])
-{
- _RGB src, back, result;
- src.red = src_scan[2];
- src.green = src_scan[1];
- src.blue = src_scan[0];
- back.red = dest_scan[2];
- back.green = dest_scan[1];
- back.blue = dest_scan[0];
- switch (blend_mode) {
- case FXDIB_BLEND_HUE:
- result = _SetLum(_SetSat(src, _Sat(back)), _Lum(back));
- break;
- case FXDIB_BLEND_SATURATION:
- result = _SetLum(_SetSat(back, _Sat(src)), _Lum(back));
- break;
- case FXDIB_BLEND_COLOR:
- result = _SetLum(src, _Lum(back));
- break;
- case FXDIB_BLEND_LUMINOSITY:
- result = _SetLum(back, _Lum(src));
- break;
- }
- results[0] = result.blue;
- results[1] = result.green;
- results[2] = result.red;
-}
-inline void _CompositeRow_Argb2Mask(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixel_count, FX_LPCBYTE clip_scan)
-{
- src_scan += 3;
- for (int col = 0; col < pixel_count; col ++) {
- int src_alpha = *src_scan;
- if (clip_scan) {
- src_alpha = clip_scan[col] * src_alpha / 255;
- }
- FX_BYTE back_alpha = *dest_scan;
- if (!back_alpha) {
- *dest_scan = src_alpha;
- } else if (src_alpha) {
- *dest_scan = back_alpha + src_alpha - back_alpha * src_alpha / 255;
- }
- dest_scan ++;
- src_scan += 4;
- }
-}
-void _CompositeRow_Rgba2Mask(FX_LPBYTE dest_scan, FX_LPCBYTE src_alpha_scan, int pixel_count, FX_LPCBYTE clip_scan)
-{
- for (int col = 0; col < pixel_count; col ++) {
- int src_alpha = *src_alpha_scan++;
- if (clip_scan) {
- src_alpha = clip_scan[col] * src_alpha / 255;
- }
- FX_BYTE back_alpha = *dest_scan;
- if (!back_alpha) {
- *dest_scan = src_alpha;
- } else if (src_alpha) {
- *dest_scan = back_alpha + src_alpha - back_alpha * src_alpha / 255;
- }
- dest_scan ++;
- }
-}
-void _CompositeRow_Rgb2Mask(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, FX_LPCBYTE clip_scan)
-{
- if (clip_scan) {
- for (int i = 0; i < width; i ++) {
- *dest_scan = FXDIB_ALPHA_UNION(*dest_scan, *clip_scan);
- dest_scan ++;
- clip_scan ++;
- }
- } else {
- FXSYS_memset8(dest_scan, 0xff, width);
- }
-}
-void _CompositeRow_Argb2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixel_count, int blend_type, FX_LPCBYTE clip_scan,
- FX_LPCBYTE src_alpha_scan, FX_LPBYTE dst_alpha_scan, void* pIccTransform)
-{
- ICodec_IccModule* pIccModule = NULL;
- if (pIccTransform) {
- pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
- }
- if (blend_type) {
- FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
- int blended_color;
- if (src_alpha_scan) {
- for (int col = 0; col < pixel_count; col ++) {
- FX_BYTE back_alpha = *dst_alpha_scan;
- if (back_alpha == 0) {
- int src_alpha = *src_alpha_scan++;
- if (clip_scan) {
- src_alpha = clip_scan[col] * src_alpha / 255;
- }
- if (src_alpha) {
- if (pIccTransform) {
- pIccModule->TranslateScanline(pIccTransform, dest_scan, src_scan, 1);
- } else {
- *dest_scan = FXRGB2GRAY(src_scan[2], src_scan[1], *src_scan);
- }
- *dst_alpha_scan = src_alpha;
- }
- dest_scan ++;
- dst_alpha_scan ++;
- src_scan += 3;
- continue;
- }
- FX_BYTE src_alpha = *src_alpha_scan++;
- if (clip_scan) {
- src_alpha = clip_scan[col] * src_alpha / 255;
- }
- if (src_alpha == 0) {
- dest_scan ++;
- dst_alpha_scan ++;
- src_scan += 3;
- continue;
- }
- *dst_alpha_scan = FXDIB_ALPHA_UNION(back_alpha, src_alpha);
- int alpha_ratio = src_alpha * 255 / (*dst_alpha_scan);
- FX_BYTE gray;
- if (pIccTransform) {
- pIccModule->TranslateScanline(pIccTransform, &gray, src_scan, 1);
- } else {
- gray = FXRGB2GRAY(src_scan[2], src_scan[1], *src_scan);
- }
- if (bNonseparableBlend) {
- blended_color = blend_type == FXDIB_BLEND_LUMINOSITY ? gray : *dest_scan;
- }
- gray = bNonseparableBlend ? blended_color : _BLEND(blend_type, *dest_scan, gray);
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, alpha_ratio);
- dest_scan ++;
- dst_alpha_scan++;
- src_scan += 3;
- }
- } else
- for (int col = 0; col < pixel_count; col ++) {
- FX_BYTE back_alpha = *dst_alpha_scan;
- if (back_alpha == 0) {
- int src_alpha = src_scan[3];
- if (clip_scan) {
- src_alpha = clip_scan[col] * src_alpha / 255;
- }
- if (src_alpha) {
- if (pIccTransform) {
- pIccModule->TranslateScanline(pIccTransform, dest_scan, src_scan, 1);
- } else {
- *dest_scan = FXRGB2GRAY(src_scan[2], src_scan[1], *src_scan);
- }
- *dst_alpha_scan = src_alpha;
- }
- dest_scan ++;
- dst_alpha_scan ++;
- src_scan += 4;
- continue;
- }
- FX_BYTE src_alpha = src_scan[3];
- if (clip_scan) {
- src_alpha = clip_scan[col] * src_alpha / 255;
- }
- if (src_alpha == 0) {
- dest_scan ++;
- dst_alpha_scan ++;
- src_scan += 4;
- continue;
- }
- *dst_alpha_scan = FXDIB_ALPHA_UNION(back_alpha, src_alpha);
- int alpha_ratio = src_alpha * 255 / (*dst_alpha_scan);
- FX_BYTE gray;
- if (pIccTransform) {
- pIccModule->TranslateScanline(pIccTransform, &gray, src_scan, 1);
- } else {
- gray = FXRGB2GRAY(src_scan[2], src_scan[1], *src_scan);
- }
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, alpha_ratio);
- dest_scan ++;
- dst_alpha_scan++;
- src_scan += 4;
- }
- return;
- }
- if (src_alpha_scan) {
- for (int col = 0; col < pixel_count; col ++) {
- FX_BYTE back_alpha = *dst_alpha_scan;
- if (back_alpha == 0) {
- int src_alpha = *src_alpha_scan++;
- if (clip_scan) {
- src_alpha = clip_scan[col] * src_alpha / 255;
- }
- if (src_alpha) {
- if (pIccTransform) {
- pIccModule->TranslateScanline(pIccTransform, dest_scan, src_scan, 1);
- } else {
- *dest_scan = FXRGB2GRAY(src_scan[2], src_scan[1], *src_scan);
- }
- *dst_alpha_scan = src_alpha;
- }
- dest_scan ++;
- dst_alpha_scan ++;
- src_scan += 3;
- continue;
- }
- FX_BYTE src_alpha = *src_alpha_scan++;
- if (clip_scan) {
- src_alpha = clip_scan[col] * src_alpha / 255;
- }
- if (src_alpha == 0) {
- dest_scan ++;
- dst_alpha_scan ++;
- src_scan += 3;
- continue;
- }
- *dst_alpha_scan = FXDIB_ALPHA_UNION(back_alpha, src_alpha);
- int alpha_ratio = src_alpha * 255 / (*dst_alpha_scan);
- FX_BYTE gray;
- if (pIccTransform) {
- pIccModule->TranslateScanline(pIccTransform, &gray, src_scan, 1);
- } else {
- gray = FXRGB2GRAY(src_scan[2], src_scan[1], *src_scan);
- }
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, alpha_ratio);
- dest_scan ++;
- dst_alpha_scan++;
- src_scan += 3;
- }
- } else
- for (int col = 0; col < pixel_count; col ++) {
- FX_BYTE back_alpha = *dst_alpha_scan;
- if (back_alpha == 0) {
- int src_alpha = src_scan[3];
- if (clip_scan) {
- src_alpha = clip_scan[col] * src_alpha / 255;
- }
- if (src_alpha) {
- if (pIccTransform) {
- pIccModule->TranslateScanline(pIccTransform, dest_scan, src_scan, 1);
- } else {
- *dest_scan = FXRGB2GRAY(src_scan[2], src_scan[1], *src_scan);
- }
- *dst_alpha_scan = src_alpha;
- }
- dest_scan ++;
- dst_alpha_scan ++;
- src_scan += 4;
- continue;
- }
- FX_BYTE src_alpha = src_scan[3];
- if (clip_scan) {
- src_alpha = clip_scan[col] * src_alpha / 255;
- }
- if (src_alpha == 0) {
- dest_scan ++;
- dst_alpha_scan ++;
- src_scan += 4;
- continue;
- }
- *dst_alpha_scan = FXDIB_ALPHA_UNION(back_alpha, src_alpha);
- int alpha_ratio = src_alpha * 255 / (*dst_alpha_scan);
- FX_BYTE gray;
- if (pIccTransform) {
- pIccModule->TranslateScanline(pIccTransform, &gray, src_scan, 1);
- } else {
- gray = FXRGB2GRAY(src_scan[2], src_scan[1], *src_scan);
- }
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, alpha_ratio);
- dest_scan ++;
- dst_alpha_scan++;
- src_scan += 4;
- }
-}
-inline void _CompositeRow_Argb2Gray(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixel_count,
- int blend_type, FX_LPCBYTE clip_scan,
- FX_LPCBYTE src_alpha_scan, void* pIccTransform)
-{
- ICodec_IccModule* pIccModule = NULL;
- FX_BYTE gray;
- if (pIccTransform) {
- pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
- }
- if (blend_type) {
- FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
- int blended_color;
- if (src_alpha_scan) {
- for (int col = 0; col < pixel_count; col ++) {
- int src_alpha = *src_alpha_scan++;
- if (clip_scan) {
- src_alpha = clip_scan[col] * src_alpha / 255;
- }
- if (src_alpha) {
- if (pIccTransform) {
- pIccModule->TranslateScanline(pIccTransform, &gray, src_scan, 1);
- } else {
- gray = FXRGB2GRAY(src_scan[2], src_scan[1], *src_scan);
- }
- if (bNonseparableBlend) {
- blended_color = blend_type == FXDIB_BLEND_LUMINOSITY ? gray : *dest_scan;
- }
- gray = bNonseparableBlend ? blended_color : _BLEND(blend_type, *dest_scan, gray);
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, src_alpha);
- }
- dest_scan ++;
- src_scan += 3;
- }
- } else
- for (int col = 0; col < pixel_count; col ++) {
- int src_alpha = src_scan[3];
- if (clip_scan) {
- src_alpha = clip_scan[col] * src_alpha / 255;
- }
- if (src_alpha) {
- if (pIccTransform) {
- pIccModule->TranslateScanline(pIccTransform, &gray, src_scan, 1);
- } else {
- gray = FXRGB2GRAY(src_scan[2], src_scan[1], *src_scan);
- }
- if (bNonseparableBlend) {
- blended_color = blend_type == FXDIB_BLEND_LUMINOSITY ? gray : *dest_scan;
- }
- gray = bNonseparableBlend ? blended_color : _BLEND(blend_type, *dest_scan, gray);
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, src_alpha);
- }
- dest_scan ++;
- src_scan += 4;
- }
- return;
- }
- if (src_alpha_scan) {
- for (int col = 0; col < pixel_count; col ++) {
- int src_alpha = *src_alpha_scan++;
- if (clip_scan) {
- src_alpha = clip_scan[col] * src_alpha / 255;
- }
- if (src_alpha) {
- if (pIccTransform) {
- pIccModule->TranslateScanline(pIccTransform, &gray, src_scan, 1);
- } else {
- gray = FXRGB2GRAY(src_scan[2], src_scan[1], *src_scan);
- }
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, src_alpha);
- }
- dest_scan ++;
- src_scan += 3;
- }
- } else
- for (int col = 0; col < pixel_count; col ++) {
- int src_alpha = src_scan[3];
- if (clip_scan) {
- src_alpha = clip_scan[col] * src_alpha / 255;
- }
- if (src_alpha) {
- if (pIccTransform) {
- pIccModule->TranslateScanline(pIccTransform, &gray, src_scan, 1);
- } else {
- gray = FXRGB2GRAY(src_scan[2], src_scan[1], *src_scan);
- }
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, src_alpha);
- }
- dest_scan ++;
- src_scan += 4;
- }
-}
-inline void _CompositeRow_Rgb2Gray(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int src_Bpp, int pixel_count,
- int blend_type, FX_LPCBYTE clip_scan,
- void* pIccTransform)
-{
- ICodec_IccModule* pIccModule = NULL;
- FX_BYTE gray;
- if (pIccTransform) {
- pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
- }
- if (blend_type) {
- FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
- int blended_color;
- for (int col = 0; col < pixel_count; col ++) {
- if (pIccTransform) {
- pIccModule->TranslateScanline(pIccTransform, &gray, src_scan, 1);
- } else {
- gray = FXRGB2GRAY(src_scan[2], src_scan[1], *src_scan);
- }
- if (bNonseparableBlend) {
- blended_color = blend_type == FXDIB_BLEND_LUMINOSITY ? gray : *dest_scan;
- }
- gray = bNonseparableBlend ? blended_color : _BLEND(blend_type, *dest_scan, gray);
- if (clip_scan && clip_scan[col] < 255) {
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, clip_scan[col]);
- } else {
- *dest_scan = gray;
- }
- dest_scan ++;
- src_scan += src_Bpp;
- }
- return;
- }
- for (int col = 0; col < pixel_count; col ++) {
- if (pIccTransform) {
- pIccModule->TranslateScanline(pIccTransform, &gray, src_scan, 1);
- } else {
- gray = FXRGB2GRAY(src_scan[2], src_scan[1], *src_scan);
- }
- if (clip_scan && clip_scan[col] < 255) {
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, clip_scan[col]);
- } else {
- *dest_scan = gray;
- }
- dest_scan ++;
- src_scan += src_Bpp;
- }
-}
-void _CompositeRow_Rgb2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int src_Bpp, int pixel_count,
- int blend_type, FX_LPCBYTE clip_scan,
- FX_LPBYTE dest_alpha_scan, void* pIccTransform)
-{
- ICodec_IccModule* pIccModule = NULL;
- if (pIccTransform) {
- pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
- }
- if (blend_type) {
- int blended_color;
- FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
- for (int col = 0; col < pixel_count; col ++) {
- int back_alpha = *dest_alpha_scan;
- if (back_alpha == 0) {
- if (pIccTransform) {
- pIccModule->TranslateScanline(pIccTransform, dest_scan, src_scan, 1);
- } else {
- *dest_scan = FXRGB2GRAY(src_scan[2], src_scan[1], *src_scan);
- }
- dest_scan ++;
- dest_alpha_scan++;
- src_scan += src_Bpp;
- continue;
- }
- int src_alpha = 255;
- if (clip_scan) {
- src_alpha = clip_scan[col];
- }
- if (src_alpha == 0) {
- dest_scan ++;
- dest_alpha_scan ++;
- src_scan += src_Bpp;
- continue;
- }
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
- *dest_alpha_scan++ = dest_alpha;
- int alpha_ratio = src_alpha * 255 / dest_alpha;
- FX_BYTE gray;
- if (pIccTransform) {
- pIccModule->TranslateScanline(pIccTransform, &gray, src_scan, 1);
- } else {
- gray = FXRGB2GRAY(src_scan[2], src_scan[1], *src_scan);
- }
- if (bNonseparableBlend) {
- blended_color = blend_type == FXDIB_BLEND_LUMINOSITY ? gray : *dest_scan;
- }
- gray = bNonseparableBlend ? blended_color : _BLEND(blend_type, *dest_scan, gray);
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, alpha_ratio);
- dest_scan ++;
- src_scan += src_Bpp;
- }
- return;
- }
- for (int col = 0; col < pixel_count; col ++) {
- int src_alpha = 255;
- if (clip_scan) {
- src_alpha = clip_scan[col];
- }
- if (src_alpha == 255) {
- if (pIccTransform) {
- pIccModule->TranslateScanline(pIccTransform, dest_scan, src_scan, 1);
- } else {
- *dest_scan = FXRGB2GRAY(src_scan[2], src_scan[1], *src_scan);
- }
- dest_scan ++;
- *dest_alpha_scan++ = 255;
- src_scan += src_Bpp;
- continue;
- }
- if (src_alpha == 0) {
- dest_scan ++;
- dest_alpha_scan ++;
- src_scan += src_Bpp;
- continue;
- }
- int back_alpha = *dest_alpha_scan;
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
- *dest_alpha_scan++ = dest_alpha;
- int alpha_ratio = src_alpha * 255 / dest_alpha;
- FX_BYTE gray;
- if (pIccTransform) {
- pIccModule->TranslateScanline(pIccTransform, &gray, src_scan, 1);
- } else {
- gray = FXRGB2GRAY(src_scan[2], src_scan[1], *src_scan);
- }
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, alpha_ratio);
- dest_scan ++;
- src_scan += src_Bpp;
- }
-}
-void _CompositeRow_Argb2Argb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixel_count, int blend_type, FX_LPCBYTE clip_scan,
- FX_LPBYTE dest_alpha_scan, FX_LPCBYTE src_alpha_scan)
-{
- int blended_colors[3];
- FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
- if (dest_alpha_scan == NULL) {
- if (src_alpha_scan == NULL) {
- FX_BYTE back_alpha = 0;
- for (int col = 0; col < pixel_count; col ++) {
- back_alpha = dest_scan[3];
- if (back_alpha == 0) {
- if (clip_scan) {
- int src_alpha = clip_scan[col] * src_scan[3] / 255;
- FXARGB_SETDIB(dest_scan, (FXARGB_GETDIB(src_scan) & 0xffffff) | (src_alpha << 24));
- } else {
- FXARGB_COPY(dest_scan, src_scan);
- }
- dest_scan += 4;
- src_scan += 4;
- continue;
- }
- FX_BYTE src_alpha;
- if (clip_scan == NULL) {
- src_alpha = src_scan[3];
- } else {
- src_alpha = clip_scan[col] * src_scan[3] / 255;
- }
- if (src_alpha == 0) {
- dest_scan += 4;
- src_scan += 4;
- continue;
- }
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
- dest_scan[3] = dest_alpha;
- int alpha_ratio = src_alpha * 255 / dest_alpha;
- if (bNonseparableBlend) {
- _RGB_Blend(blend_type, src_scan, dest_scan, blended_colors);
- }
- for (int color = 0; color < 3; color ++) {
- if (blend_type) {
- int blended = bNonseparableBlend ? blended_colors[color] :
- _BLEND(blend_type, *dest_scan, *src_scan);
- blended = FXDIB_ALPHA_MERGE(*src_scan, blended, back_alpha);
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended, alpha_ratio);
- } else {
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, *src_scan, alpha_ratio);
- }
- dest_scan ++;
- src_scan ++;
- }
- dest_scan ++;
- src_scan ++;
- }
- } else {
- for (int col = 0; col < pixel_count; col ++) {
- FX_BYTE back_alpha = dest_scan[3];
- if (back_alpha == 0) {
- if (clip_scan) {
- int src_alpha = clip_scan[col] * (*src_alpha_scan) / 255;
- FXARGB_SETDIB(dest_scan, FXARGB_MAKE((src_alpha << 24), src_scan[2], src_scan[1], *src_scan));
- } else {
- FXARGB_SETDIB(dest_scan, FXARGB_MAKE((*src_alpha_scan << 24), src_scan[2], src_scan[1], *src_scan));
- }
- dest_scan += 4;
- src_scan += 3;
- src_alpha_scan ++;
- continue;
- }
- FX_BYTE src_alpha;
- if (clip_scan == NULL) {
- src_alpha = *src_alpha_scan ++;
- } else {
- src_alpha = clip_scan[col] * (*src_alpha_scan ++) / 255;
- }
- if (src_alpha == 0) {
- dest_scan += 4;
- src_scan += 3;
- continue;
- }
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
- dest_scan[3] = dest_alpha;
- int alpha_ratio = src_alpha * 255 / dest_alpha;
- if (bNonseparableBlend) {
- _RGB_Blend(blend_type, src_scan, dest_scan, blended_colors);
- }
- for (int color = 0; color < 3; color ++) {
- if (blend_type) {
- int blended = bNonseparableBlend ? blended_colors[color] :
- _BLEND(blend_type, *dest_scan, *src_scan);
- blended = FXDIB_ALPHA_MERGE(*src_scan, blended, back_alpha);
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended, alpha_ratio);
- } else {
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, *src_scan, alpha_ratio);
- }
- dest_scan ++;
- src_scan ++;
- }
- dest_scan ++;
- }
- }
- } else {
- if (src_alpha_scan) {
- for (int col = 0; col < pixel_count; col ++) {
- FX_BYTE back_alpha = *dest_alpha_scan;
- if (back_alpha == 0) {
- if (clip_scan) {
- int src_alpha = clip_scan[col] * (*src_alpha_scan) / 255;
- *dest_alpha_scan = src_alpha;
- *dest_scan++ = *src_scan++;
- *dest_scan++ = *src_scan++;
- *dest_scan++ = *src_scan++;
- } else {
- *dest_alpha_scan = *src_alpha_scan;
- *dest_scan++ = *src_scan++;
- *dest_scan++ = *src_scan++;
- *dest_scan++ = *src_scan++;
- }
- dest_alpha_scan ++;
- src_alpha_scan ++;
- continue;
- }
- FX_BYTE src_alpha;
- if (clip_scan == NULL) {
- src_alpha = *src_alpha_scan ++;
- } else {
- src_alpha = clip_scan[col] * (*src_alpha_scan ++) / 255;
- }
- if (src_alpha == 0) {
- dest_scan += 3;
- src_scan += 3;
- dest_alpha_scan ++;
- continue;
- }
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
- *dest_alpha_scan ++ = dest_alpha;
- int alpha_ratio = src_alpha * 255 / dest_alpha;
- if (bNonseparableBlend) {
- _RGB_Blend(blend_type, src_scan, dest_scan, blended_colors);
- }
- for (int color = 0; color < 3; color ++) {
- if (blend_type) {
- int blended = bNonseparableBlend ? blended_colors[color] :
- _BLEND(blend_type, *dest_scan, *src_scan);
- blended = FXDIB_ALPHA_MERGE(*src_scan, blended, back_alpha);
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended, alpha_ratio);
- } else {
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, *src_scan, alpha_ratio);
- }
- dest_scan ++;
- src_scan ++;
- }
- }
- } else {
- for (int col = 0; col < pixel_count; col ++) {
- FX_BYTE back_alpha = *dest_alpha_scan;
- if (back_alpha == 0) {
- if (clip_scan) {
- int src_alpha = clip_scan[col] * src_scan[3] / 255;
- *dest_alpha_scan = src_alpha;
- *dest_scan++ = *src_scan++;
- *dest_scan++ = *src_scan++;
- *dest_scan++ = *src_scan++;
- } else {
- *dest_alpha_scan = src_scan[3];
- *dest_scan++ = *src_scan++;
- *dest_scan++ = *src_scan++;
- *dest_scan++ = *src_scan++;
- }
- dest_alpha_scan ++;
- src_scan ++;
- continue;
- }
- FX_BYTE src_alpha;
- if (clip_scan == NULL) {
- src_alpha = src_scan[3];
- } else {
- src_alpha = clip_scan[col] * src_scan[3] / 255;
- }
- if (src_alpha == 0) {
- dest_scan += 3;
- src_scan += 4;
- dest_alpha_scan ++;
- continue;
- }
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
- *dest_alpha_scan++ = dest_alpha;
- int alpha_ratio = src_alpha * 255 / dest_alpha;
- if (bNonseparableBlend) {
- _RGB_Blend(blend_type, src_scan, dest_scan, blended_colors);
- }
- for (int color = 0; color < 3; color ++) {
- if (blend_type) {
- int blended = bNonseparableBlend ? blended_colors[color] :
- _BLEND(blend_type, *dest_scan, *src_scan);
- blended = FXDIB_ALPHA_MERGE(*src_scan, blended, back_alpha);
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended, alpha_ratio);
- } else {
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, *src_scan, alpha_ratio);
- }
- dest_scan ++;
- src_scan ++;
- }
- src_scan ++;
- }
- }
- }
-}
-void _CompositeRow_Rgb2Argb_Blend_NoClip(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int blend_type, int src_Bpp,
- FX_LPBYTE dest_alpha_scan)
-{
- int blended_colors[3];
- FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
- int src_gap = src_Bpp - 3;
- if (dest_alpha_scan == NULL) {
- for (int col = 0; col < width; col ++) {
- FX_BYTE back_alpha = dest_scan[3];
- if (back_alpha == 0) {
- if (src_Bpp == 4) {
- FXARGB_SETDIB(dest_scan, 0xff000000 | FXARGB_GETDIB(src_scan));
- } else {
- FXARGB_SETDIB(dest_scan, FXARGB_MAKE(0xff, src_scan[2], src_scan[1], src_scan[0]));
- }
- dest_scan += 4;
- src_scan += src_Bpp;
- continue;
- }
- dest_scan[3] = 0xff;
- if (bNonseparableBlend) {
- _RGB_Blend(blend_type, src_scan, dest_scan, blended_colors);
- }
- for (int color = 0; color < 3; color ++) {
- int src_color = *src_scan;
- int blended = bNonseparableBlend ? blended_colors[color] :
- _BLEND(blend_type, *dest_scan, src_color);
- *dest_scan = FXDIB_ALPHA_MERGE(src_color, blended, back_alpha);
- dest_scan ++;
- src_scan ++;
- }
- dest_scan ++;
- src_scan += src_gap;
- }
- } else {
- for (int col = 0; col < width; col ++) {
- FX_BYTE back_alpha = *dest_alpha_scan;
- if (back_alpha == 0) {
- *dest_scan++ = *src_scan++;
- *dest_scan++ = *src_scan++;
- *dest_scan++ = *src_scan++;
- *dest_alpha_scan++ = 0xff;
- src_scan += src_gap;
- continue;
- }
- *dest_alpha_scan++ = 0xff;
- if (bNonseparableBlend) {
- _RGB_Blend(blend_type, src_scan, dest_scan, blended_colors);
- }
- for (int color = 0; color < 3; color ++) {
- int src_color = *src_scan;
- int blended = bNonseparableBlend ? blended_colors[color] :
- _BLEND(blend_type, *dest_scan, src_color);
- *dest_scan = FXDIB_ALPHA_MERGE(src_color, blended, back_alpha);
- dest_scan ++;
- src_scan ++;
- }
- src_scan += src_gap;
- }
- }
-}
-inline void _CompositeRow_Rgb2Argb_Blend_Clip(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int blend_type, int src_Bpp, FX_LPCBYTE clip_scan,
- FX_LPBYTE dest_alpha_scan)
-{
- int blended_colors[3];
- FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
- int src_gap = src_Bpp - 3;
- if (dest_alpha_scan == NULL) {
- for (int col = 0; col < width; col ++) {
- int src_alpha = *clip_scan ++;
- FX_BYTE back_alpha = dest_scan[3];
- if (back_alpha == 0) {
- *dest_scan++ = *src_scan++;
- *dest_scan++ = *src_scan++;
- *dest_scan++ = *src_scan++;
- src_scan += src_gap;
- dest_scan ++;
- continue;
- }
- if (src_alpha == 0) {
- dest_scan += 4;
- src_scan += src_Bpp;
- continue;
- }
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
- dest_scan[3] = dest_alpha;
- int alpha_ratio = src_alpha * 255 / dest_alpha;
- if (bNonseparableBlend) {
- _RGB_Blend(blend_type, src_scan, dest_scan, blended_colors);
- }
- for (int color = 0; color < 3; color ++) {
- int src_color = *src_scan;
- int blended = bNonseparableBlend ? blended_colors[color] :
- _BLEND(blend_type, *dest_scan, src_color);
- blended = FXDIB_ALPHA_MERGE(src_color, blended, back_alpha);
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended, alpha_ratio);
- dest_scan ++;
- src_scan ++;
- }
- dest_scan ++;
- src_scan += src_gap;
- }
- } else {
- for (int col = 0; col < width; col ++) {
- int src_alpha = *clip_scan ++;
- FX_BYTE back_alpha = *dest_alpha_scan;
- if (back_alpha == 0) {
- *dest_scan++ = *src_scan++;
- *dest_scan++ = *src_scan++;
- *dest_scan++ = *src_scan++;
- src_scan += src_gap;
- dest_alpha_scan++;
- continue;
- }
- if (src_alpha == 0) {
- dest_scan += 3;
- dest_alpha_scan++;
- src_scan += src_Bpp;
- continue;
- }
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
- *dest_alpha_scan++ = dest_alpha;
- int alpha_ratio = src_alpha * 255 / dest_alpha;
- if (bNonseparableBlend) {
- _RGB_Blend(blend_type, src_scan, dest_scan, blended_colors);
- }
- for (int color = 0; color < 3; color ++) {
- int src_color = *src_scan;
- int blended = bNonseparableBlend ? blended_colors[color] :
- _BLEND(blend_type, *dest_scan, src_color);
- blended = FXDIB_ALPHA_MERGE(src_color, blended, back_alpha);
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended, alpha_ratio);
- dest_scan ++;
- src_scan ++;
- }
- src_scan += src_gap;
- }
- }
-}
-inline void _CompositeRow_Rgb2Argb_NoBlend_Clip(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int src_Bpp, FX_LPCBYTE clip_scan,
- FX_LPBYTE dest_alpha_scan)
-{
- int src_gap = src_Bpp - 3;
- if (dest_alpha_scan == NULL) {
- for (int col = 0; col < width; col ++) {
- int src_alpha = clip_scan[col];
- if (src_alpha == 255) {
- *dest_scan++ = *src_scan++;
- *dest_scan++ = *src_scan++;
- *dest_scan++ = *src_scan++;
- *dest_scan++ = 255;
- src_scan += src_gap;
- continue;
- }
- if (src_alpha == 0) {
- dest_scan += 4;
- src_scan += src_Bpp;
- continue;
- }
- int back_alpha = dest_scan[3];
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
- dest_scan[3] = dest_alpha;
- int alpha_ratio = src_alpha * 255 / dest_alpha;
- for (int color = 0; color < 3; color ++) {
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, *src_scan, alpha_ratio);
- dest_scan ++;
- src_scan ++;
- }
- dest_scan ++;
- src_scan += src_gap;
- }
- } else {
- for (int col = 0; col < width; col ++) {
- int src_alpha = clip_scan[col];
- if (src_alpha == 255) {
- *dest_scan++ = *src_scan++;
- *dest_scan++ = *src_scan++;
- *dest_scan++ = *src_scan++;
- *dest_alpha_scan++ = 255;
- src_scan += src_gap;
- continue;
- }
- if (src_alpha == 0) {
- dest_scan += 3;
- dest_alpha_scan ++;
- src_scan += src_Bpp;
- continue;
- }
- int back_alpha = *dest_alpha_scan;
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
- *dest_alpha_scan ++ = dest_alpha;
- int alpha_ratio = src_alpha * 255 / dest_alpha;
- for (int color = 0; color < 3; color ++) {
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, *src_scan, alpha_ratio);
- dest_scan ++;
- src_scan ++;
- }
- src_scan += src_gap;
- }
- }
-}
-inline void _CompositeRow_Rgb2Argb_NoBlend_NoClip(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int src_Bpp,
- FX_LPBYTE dest_alpha_scan)
-{
- if (dest_alpha_scan == NULL) {
- for (int col = 0; col < width; col ++) {
- if (src_Bpp == 4) {
- FXARGB_SETDIB(dest_scan, 0xff000000 | FXARGB_GETDIB(src_scan));
- } else {
- FXARGB_SETDIB(dest_scan, FXARGB_MAKE(0xff, src_scan[2], src_scan[1], src_scan[0]));
- }
- dest_scan += 4;
- src_scan += src_Bpp;
- }
- } else {
- int src_gap = src_Bpp - 3;
- for (int col = 0; col < width; col ++) {
- *dest_scan++ = *src_scan++;
- *dest_scan++ = *src_scan++;
- *dest_scan++ = *src_scan++;
- *dest_alpha_scan++ = 0xff;
- src_scan += src_gap;
- }
- }
-}
-inline void _CompositeRow_Argb2Rgb_Blend(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int blend_type, int dest_Bpp, FX_LPCBYTE clip_scan,
- FX_LPCBYTE src_alpha_scan)
-{
- int blended_colors[3];
- FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
- int dest_gap = dest_Bpp - 3;
- if (src_alpha_scan == NULL) {
- for (int col = 0; col < width; col ++) {
- FX_BYTE src_alpha;
- if (clip_scan) {
- src_alpha = src_scan[3] * (*clip_scan++) / 255;
- } else {
- src_alpha = src_scan[3];
- }
- if (src_alpha == 0) {
- dest_scan += dest_Bpp;
- src_scan += 4;
- continue;
- }
- if (bNonseparableBlend) {
- _RGB_Blend(blend_type, src_scan, dest_scan, blended_colors);
- }
- for (int color = 0; color < 3; color ++) {
- int back_color = *dest_scan;
- int blended = bNonseparableBlend ? blended_colors[color] :
- _BLEND(blend_type, back_color, *src_scan);
- *dest_scan = FXDIB_ALPHA_MERGE(back_color, blended, src_alpha);
- dest_scan ++;
- src_scan ++;
- }
- dest_scan += dest_gap;
- src_scan ++;
- }
- } else {
- for (int col = 0; col < width; col ++) {
- FX_BYTE src_alpha;
- if (clip_scan) {
- src_alpha = (*src_alpha_scan++) * (*clip_scan++) / 255;
- } else {
- src_alpha = *src_alpha_scan++;
- }
- if (src_alpha == 0) {
- dest_scan += dest_Bpp;
- src_scan += 3;
- continue;
- }
- if (bNonseparableBlend) {
- _RGB_Blend(blend_type, src_scan, dest_scan, blended_colors);
- }
- for (int color = 0; color < 3; color ++) {
- int back_color = *dest_scan;
- int blended = bNonseparableBlend ? blended_colors[color] :
- _BLEND(blend_type, back_color, *src_scan);
- *dest_scan = FXDIB_ALPHA_MERGE(back_color, blended, src_alpha);
- dest_scan ++;
- src_scan ++;
- }
- dest_scan += dest_gap;
- }
- }
-}
-inline void _CompositeRow_Argb2Rgb_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int dest_Bpp, FX_LPCBYTE clip_scan,
- FX_LPCBYTE src_alpha_scan)
-{
- int dest_gap = dest_Bpp - 3;
- if (src_alpha_scan == NULL) {
- for (int col = 0; col < width; col ++) {
- FX_BYTE src_alpha;
- if (clip_scan) {
- src_alpha = src_scan[3] * (*clip_scan++) / 255;
- } else {
- src_alpha = src_scan[3];
- }
- if (src_alpha == 255) {
- *dest_scan++ = *src_scan++;
- *dest_scan++ = *src_scan++;
- *dest_scan++ = *src_scan++;
- dest_scan += dest_gap;
- src_scan ++;
- continue;
- }
- if (src_alpha == 0) {
- dest_scan += dest_Bpp;
- src_scan += 4;
- continue;
- }
- for (int color = 0; color < 3; color ++) {
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, *src_scan, src_alpha);
- dest_scan ++;
- src_scan ++;
- }
- dest_scan += dest_gap;
- src_scan ++;
- }
- } else {
- for (int col = 0; col < width; col ++) {
- FX_BYTE src_alpha;
- if (clip_scan) {
- src_alpha = (*src_alpha_scan++) * (*clip_scan++) / 255;
- } else {
- src_alpha = *src_alpha_scan++;
- }
- if (src_alpha == 255) {
- *dest_scan++ = *src_scan++;
- *dest_scan++ = *src_scan++;
- *dest_scan++ = *src_scan++;
- dest_scan += dest_gap;
- continue;
- }
- if (src_alpha == 0) {
- dest_scan += dest_Bpp;
- src_scan += 3;
- continue;
- }
- for (int color = 0; color < 3; color ++) {
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, *src_scan, src_alpha);
- dest_scan ++;
- src_scan ++;
- }
- dest_scan += dest_gap;
- }
- }
-}
-inline void _CompositeRow_Rgb2Rgb_Blend_NoClip(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int blend_type, int dest_Bpp, int src_Bpp)
-{
- int blended_colors[3];
- FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
- int dest_gap = dest_Bpp - 3;
- int src_gap = src_Bpp - 3;
- for (int col = 0; col < width; col ++) {
- if (bNonseparableBlend) {
- _RGB_Blend(blend_type, src_scan, dest_scan, blended_colors);
- }
- for (int color = 0; color < 3; color ++) {
- int back_color = *dest_scan;
- int src_color = *src_scan;
- int blended = bNonseparableBlend ? blended_colors[color] :
- _BLEND(blend_type, back_color, src_color);
- *dest_scan = blended;
- dest_scan ++;
- src_scan ++;
- }
- dest_scan += dest_gap;
- src_scan += src_gap;
- }
-}
-inline void _CompositeRow_Rgb2Rgb_Blend_Clip(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int blend_type, int dest_Bpp, int src_Bpp, FX_LPCBYTE clip_scan)
-{
- int blended_colors[3];
- FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
- int dest_gap = dest_Bpp - 3;
- int src_gap = src_Bpp - 3;
- for (int col = 0; col < width; col ++) {
- FX_BYTE src_alpha = *clip_scan ++;
- if (src_alpha == 0) {
- dest_scan += dest_Bpp;
- src_scan += src_Bpp;
- continue;
- }
- if (bNonseparableBlend) {
- _RGB_Blend(blend_type, src_scan, dest_scan, blended_colors);
- }
- for (int color = 0; color < 3; color ++) {
- int src_color = *src_scan;
- int back_color = *dest_scan;
- int blended = bNonseparableBlend ? blended_colors[color] :
- _BLEND(blend_type, back_color, src_color);
- *dest_scan = FXDIB_ALPHA_MERGE(back_color, blended, src_alpha);
- dest_scan ++;
- src_scan ++;
- }
- dest_scan += dest_gap;
- src_scan += src_gap;
- }
-}
-inline void _CompositeRow_Rgb2Rgb_NoBlend_NoClip(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int dest_Bpp, int src_Bpp)
-{
- if (dest_Bpp == src_Bpp) {
- FXSYS_memcpy32(dest_scan, src_scan, width * dest_Bpp);
- return;
- }
- for (int col = 0; col < width; col ++) {
- dest_scan[0] = src_scan[0];
- dest_scan[1] = src_scan[1];
- dest_scan[2] = src_scan[2];
- dest_scan += dest_Bpp;
- src_scan += src_Bpp;
- }
-}
-inline void _CompositeRow_Rgb2Rgb_NoBlend_Clip(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int dest_Bpp, int src_Bpp, FX_LPCBYTE clip_scan)
-{
- for (int col = 0; col < width; col ++) {
- int src_alpha = clip_scan[col];
- if (src_alpha == 255) {
- dest_scan[0] = src_scan[0];
- dest_scan[1] = src_scan[1];
- dest_scan[2] = src_scan[2];
- } else if (src_alpha) {
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, *src_scan, src_alpha);
- dest_scan ++;
- src_scan ++;
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, *src_scan, src_alpha);
- dest_scan ++;
- src_scan ++;
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, *src_scan, src_alpha);
- dest_scan += dest_Bpp - 2;
- src_scan += src_Bpp - 2;
- continue;
- }
- dest_scan += dest_Bpp;
- src_scan += src_Bpp;
- }
-}
-void _CompositeRow_Argb2Argb_Transform(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixel_count, int blend_type, FX_LPCBYTE clip_scan,
- FX_LPBYTE dest_alpha_scan, FX_LPCBYTE src_alpha_scan, FX_LPBYTE src_cache_scan, void* pIccTransform)
-{
- FX_LPBYTE dp = src_cache_scan;
- ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
- if (src_alpha_scan) {
- if (dest_alpha_scan == NULL) {
- for (int col = 0; col < pixel_count; col ++) {
- pIccModule->TranslateScanline(pIccTransform, dp, src_scan, 1);
- dp[3] = *src_alpha_scan++;
- src_scan += 3;
- dp += 4;
- }
- src_alpha_scan = NULL;
- } else {
- pIccModule->TranslateScanline(pIccTransform, dp, src_scan, pixel_count);
- }
- } else {
- if (dest_alpha_scan == NULL) {
- for (int col = 0; col < pixel_count; col ++) {
- pIccModule->TranslateScanline(pIccTransform, dp, src_scan, 1);
- dp[3] = src_scan[3];
- src_scan += 4;
- dp += 4;
- }
- } else {
- int blended_colors[3];
- FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
- for (int col = 0; col < pixel_count; col ++) {
- pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, 1);
- FX_BYTE back_alpha = *dest_alpha_scan;
- if (back_alpha == 0) {
- if (clip_scan) {
- int src_alpha = clip_scan[col] * src_scan[3] / 255;
- *dest_alpha_scan = src_alpha;
- *dest_scan++ = *src_cache_scan++;
- *dest_scan++ = *src_cache_scan++;
- *dest_scan++ = *src_cache_scan++;
- } else {
- *dest_alpha_scan = src_scan[3];
- *dest_scan++ = *src_cache_scan++;
- *dest_scan++ = *src_cache_scan++;
- *dest_scan++ = *src_cache_scan++;
- }
- dest_alpha_scan ++;
- src_scan += 4;
- continue;
- }
- FX_BYTE src_alpha;
- if (clip_scan == NULL) {
- src_alpha = src_scan[3];
- } else {
- src_alpha = clip_scan[col] * src_scan[3] / 255;
- }
- src_scan += 4;
- if (src_alpha == 0) {
- dest_scan += 3;
- src_cache_scan += 3;
- dest_alpha_scan ++;
- continue;
- }
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
- *dest_alpha_scan ++ = dest_alpha;
- int alpha_ratio = src_alpha * 255 / dest_alpha;
- if (bNonseparableBlend) {
- _RGB_Blend(blend_type, src_cache_scan, dest_scan, blended_colors);
- }
- for (int color = 0; color < 3; color ++) {
- if (blend_type) {
- int blended = bNonseparableBlend ? blended_colors[color] :
- _BLEND(blend_type, *dest_scan, *src_cache_scan);
- blended = FXDIB_ALPHA_MERGE(*src_cache_scan, blended, back_alpha);
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended, alpha_ratio);
- } else {
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, *src_cache_scan, alpha_ratio);
- }
- dest_scan ++;
- src_cache_scan ++;
- }
- }
- return;
- }
- }
- _CompositeRow_Argb2Argb(dest_scan, src_cache_scan, pixel_count, blend_type, clip_scan, dest_alpha_scan, src_alpha_scan);
-}
-void _CompositeRow_Rgb2Argb_Blend_NoClip_Transform(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int blend_type, int src_Bpp,
- FX_LPBYTE dest_alpha_scan, FX_LPBYTE src_cache_scan, void* pIccTransform)
-{
- ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
- if (src_Bpp == 3) {
- pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, width);
- } else {
- FX_LPBYTE dp = src_cache_scan;
- for (int col = 0; col < width; col ++) {
- pIccModule->TranslateScanline(pIccTransform, dp, src_scan, 1);
- src_scan += 4;
- dp += 3;
- }
- }
- _CompositeRow_Rgb2Argb_Blend_NoClip(dest_scan, src_cache_scan, width, blend_type, 3, dest_alpha_scan);
-}
-inline void _CompositeRow_Rgb2Argb_Blend_Clip_Transform(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int blend_type, int src_Bpp, FX_LPCBYTE clip_scan,
- FX_LPBYTE dest_alpha_scan, FX_LPBYTE src_cache_scan, void* pIccTransform)
-{
- ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
- if (src_Bpp == 3) {
- pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, width);
- } else {
- FX_LPBYTE dp = src_cache_scan;
- for (int col = 0; col < width; col ++) {
- pIccModule->TranslateScanline(pIccTransform, dp, src_scan, 1);
- src_scan += 4;
- dp += 3;
- }
- }
- _CompositeRow_Rgb2Argb_Blend_Clip(dest_scan, src_cache_scan, width, blend_type, 3, clip_scan, dest_alpha_scan);
-}
-inline void _CompositeRow_Rgb2Argb_NoBlend_Clip_Transform(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int src_Bpp, FX_LPCBYTE clip_scan,
- FX_LPBYTE dest_alpha_scan, FX_LPBYTE src_cache_scan, void* pIccTransform)
-{
- ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
- if (src_Bpp == 3) {
- pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, width);
- } else {
- FX_LPBYTE dp = src_cache_scan;
- for (int col = 0; col < width; col ++) {
- pIccModule->TranslateScanline(pIccTransform, dp, src_scan, 1);
- src_scan += 4;
- dp += 3;
- }
- }
- _CompositeRow_Rgb2Argb_NoBlend_Clip(dest_scan, src_cache_scan, width, 3, clip_scan, dest_alpha_scan);
-}
-inline void _CompositeRow_Rgb2Argb_NoBlend_NoClip_Transform(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int src_Bpp,
- FX_LPBYTE dest_alpha_scan, FX_LPBYTE src_cache_scan, void* pIccTransform)
-{
- ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
- if (src_Bpp == 3) {
- pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, width);
- } else {
- FX_LPBYTE dp = src_cache_scan;
- for (int col = 0; col < width; col ++) {
- pIccModule->TranslateScanline(pIccTransform, dp, src_scan, 1);
- src_scan += 4;
- dp += 3;
- }
- }
- _CompositeRow_Rgb2Argb_NoBlend_NoClip(dest_scan, src_cache_scan, width, 3, dest_alpha_scan);
-}
-inline void _CompositeRow_Argb2Rgb_Blend_Transform(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int blend_type, int dest_Bpp, FX_LPCBYTE clip_scan,
- FX_LPCBYTE src_alpha_scan, FX_LPBYTE src_cache_scan, void* pIccTransform)
-{
- ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
- if (src_alpha_scan) {
- pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, width);
- } else {
- int blended_colors[3];
- FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
- int dest_gap = dest_Bpp - 3;
- for (int col = 0; col < width; col ++) {
- pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, 1);
- FX_BYTE src_alpha;
- if (clip_scan) {
- src_alpha = src_scan[3] * (*clip_scan++) / 255;
- } else {
- src_alpha = src_scan[3];
- }
- src_scan += 4;
- if (src_alpha == 0) {
- dest_scan += dest_Bpp;
- src_cache_scan += 3;
- continue;
- }
- if (bNonseparableBlend) {
- _RGB_Blend(blend_type, src_cache_scan, dest_scan, blended_colors);
- }
- for (int color = 0; color < 3; color ++) {
- int back_color = *dest_scan;
- int blended = bNonseparableBlend ? blended_colors[color] :
- _BLEND(blend_type, back_color, *src_cache_scan);
- *dest_scan = FXDIB_ALPHA_MERGE(back_color, blended, src_alpha);
- dest_scan ++;
- src_cache_scan ++;
- }
- dest_scan += dest_gap;
- }
- return;
- }
- _CompositeRow_Argb2Rgb_Blend(dest_scan, src_cache_scan, width, blend_type, dest_Bpp, clip_scan, src_alpha_scan);
-}
-inline void _CompositeRow_Argb2Rgb_NoBlend_Transform(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int dest_Bpp, FX_LPCBYTE clip_scan,
- FX_LPCBYTE src_alpha_scan, FX_LPBYTE src_cache_scan, void* pIccTransform)
-{
- ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
- if (src_alpha_scan) {
- pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, width);
- } else {
- int dest_gap = dest_Bpp - 3;
- for (int col = 0; col < width; col ++) {
- pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, 1);
- FX_BYTE src_alpha;
- if (clip_scan) {
- src_alpha = src_scan[3] * (*clip_scan++) / 255;
- } else {
- src_alpha = src_scan[3];
- }
- src_scan += 4;
- if (src_alpha == 255) {
- *dest_scan++ = *src_cache_scan++;
- *dest_scan++ = *src_cache_scan++;
- *dest_scan++ = *src_cache_scan++;
- dest_scan += dest_gap;
- continue;
- }
- if (src_alpha == 0) {
- dest_scan += dest_Bpp;
- src_cache_scan += 3;
- continue;
- }
- for (int color = 0; color < 3; color ++) {
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, *src_cache_scan, src_alpha);
- dest_scan ++;
- src_cache_scan ++;
- }
- dest_scan += dest_gap;
- }
- return;
- }
- _CompositeRow_Argb2Rgb_NoBlend(dest_scan, src_cache_scan, width, dest_Bpp, clip_scan, src_alpha_scan);
-}
-inline void _CompositeRow_Rgb2Rgb_Blend_NoClip_Transform(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int blend_type, int dest_Bpp, int src_Bpp,
- FX_LPBYTE src_cache_scan, void* pIccTransform)
-{
- ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
- if (src_Bpp == 3) {
- pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, width);
- } else {
- FX_LPBYTE dp = src_cache_scan;
- for (int col = 0; col < width; col ++) {
- pIccModule->TranslateScanline(pIccTransform, dp, src_scan, 1);
- src_scan += 4;
- dp += 3;
- }
- }
- _CompositeRow_Rgb2Rgb_Blend_NoClip(dest_scan, src_cache_scan, width, blend_type, dest_Bpp, 3);
-}
-inline void _CompositeRow_Rgb2Rgb_Blend_Clip_Transform(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int blend_type, int dest_Bpp, int src_Bpp, FX_LPCBYTE clip_scan,
- FX_LPBYTE src_cache_scan, void* pIccTransform)
-{
- ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
- if (src_Bpp == 3) {
- pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, width);
- } else {
- FX_LPBYTE dp = src_cache_scan;
- for (int col = 0; col < width; col ++) {
- pIccModule->TranslateScanline(pIccTransform, dp, src_scan, 1);
- src_scan += 4;
- dp += 3;
- }
- }
- _CompositeRow_Rgb2Rgb_Blend_Clip(dest_scan, src_cache_scan, width, blend_type, dest_Bpp, 3, clip_scan);
-}
-inline void _CompositeRow_Rgb2Rgb_NoBlend_NoClip_Transform(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int dest_Bpp, int src_Bpp,
- FX_LPBYTE src_cache_scan, void* pIccTransform)
-{
- ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
- if (src_Bpp == 3) {
- pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, width);
- } else {
- FX_LPBYTE dp = src_cache_scan;
- for (int col = 0; col < width; col ++) {
- pIccModule->TranslateScanline(pIccTransform, dp, src_scan, 1);
- src_scan += 4;
- dp += 3;
- }
- }
- _CompositeRow_Rgb2Rgb_NoBlend_NoClip(dest_scan, src_cache_scan, width, dest_Bpp, 3);
-}
-inline void _CompositeRow_Rgb2Rgb_NoBlend_Clip_Transform(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int dest_Bpp, int src_Bpp, FX_LPCBYTE clip_scan,
- FX_LPBYTE src_cache_scan, void* pIccTransform)
-{
- ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
- if (src_Bpp == 3) {
- pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, width);
- } else {
- FX_LPBYTE dp = src_cache_scan;
- for (int col = 0; col < width; col ++) {
- pIccModule->TranslateScanline(pIccTransform, dp, src_scan, 1);
- src_scan += 4;
- dp += 3;
- }
- }
- _CompositeRow_Rgb2Rgb_NoBlend_Clip(dest_scan, src_cache_scan, width, dest_Bpp, 3, clip_scan);
-}
-inline void _CompositeRow_8bppPal2Gray(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, FX_LPCBYTE pPalette, int pixel_count,
- int blend_type, FX_LPCBYTE clip_scan,
- FX_LPCBYTE src_alpha_scan)
-{
- if (src_alpha_scan) {
- if (blend_type) {
- FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
- int blended_color;
- for (int col = 0; col < pixel_count; col ++) {
- FX_BYTE gray = pPalette[*src_scan];
- int src_alpha = *src_alpha_scan++;
- if (clip_scan) {
- src_alpha = clip_scan[col] * src_alpha / 255;
- }
- if (bNonseparableBlend) {
- blended_color = blend_type == FXDIB_BLEND_LUMINOSITY ? gray : *dest_scan;
- }
- gray = bNonseparableBlend ? blended_color : _BLEND(blend_type, *dest_scan, gray);
- if (src_alpha) {
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, src_alpha);
- } else {
- *dest_scan = gray;
- }
- dest_scan ++;
- src_scan ++;
- }
- return;
- }
- for (int col = 0; col < pixel_count; col ++) {
- FX_BYTE gray = pPalette[*src_scan];
- int src_alpha = *src_alpha_scan++;
- if (clip_scan) {
- src_alpha = clip_scan[col] * src_alpha / 255;
- }
- if (src_alpha) {
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, src_alpha);
- } else {
- *dest_scan = gray;
- }
- dest_scan ++;
- src_scan ++;
- }
- } else {
- if (blend_type) {
- FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
- int blended_color;
- for (int col = 0; col < pixel_count; col ++) {
- FX_BYTE gray = pPalette[*src_scan];
- if (bNonseparableBlend) {
- blended_color = blend_type == FXDIB_BLEND_LUMINOSITY ? gray : *dest_scan;
- }
- gray = bNonseparableBlend ? blended_color : _BLEND(blend_type, *dest_scan, gray);
- if (clip_scan && clip_scan[col] < 255) {
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, clip_scan[col]);
- } else {
- *dest_scan = gray;
- }
- dest_scan ++;
- src_scan ++;
- }
- return;
- }
- for (int col = 0; col < pixel_count; col ++) {
- FX_BYTE gray = pPalette[*src_scan];
- if (clip_scan && clip_scan[col] < 255) {
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, clip_scan[col]);
- } else {
- *dest_scan = gray;
- }
- dest_scan ++;
- src_scan ++;
- }
- }
-}
-inline void _CompositeRow_8bppPal2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, FX_LPCBYTE pPalette, int pixel_count,
- int blend_type, FX_LPCBYTE clip_scan,
- FX_LPBYTE dest_alpha_scan, FX_LPCBYTE src_alpha_scan)
-{
- if (src_alpha_scan) {
- if (blend_type) {
- FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
- int blended_color;
- for (int col = 0; col < pixel_count; col ++) {
- FX_BYTE gray = pPalette[*src_scan];
- src_scan ++;
- FX_BYTE back_alpha = *dest_alpha_scan;
- if (back_alpha == 0) {
- int src_alpha = *src_alpha_scan ++;
- if (clip_scan) {
- src_alpha = clip_scan[col] * src_alpha / 255;
- }
- if (src_alpha) {
- *dest_scan = gray;
- *dest_alpha_scan = src_alpha;
- }
- dest_scan ++;
- dest_alpha_scan ++;
- continue;
- }
- FX_BYTE src_alpha = *src_alpha_scan++;
- if (clip_scan) {
- src_alpha = clip_scan[col] * src_alpha / 255;
- }
- if (src_alpha == 0) {
- dest_scan ++;
- dest_alpha_scan ++;
- continue;
- }
- *dest_alpha_scan = back_alpha + src_alpha - back_alpha * src_alpha / 255;
- int alpha_ratio = src_alpha * 255 / (*dest_alpha_scan);
- if (bNonseparableBlend) {
- blended_color = blend_type == FXDIB_BLEND_LUMINOSITY ? gray : *dest_scan;
- }
- gray = bNonseparableBlend ? blended_color : _BLEND(blend_type, *dest_scan, gray);
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, alpha_ratio);
- dest_alpha_scan ++;
- dest_scan ++;
- }
- return;
- }
- for (int col = 0; col < pixel_count; col ++) {
- FX_BYTE gray = pPalette[*src_scan];
- src_scan ++;
- FX_BYTE back_alpha = *dest_alpha_scan;
- if (back_alpha == 0) {
- int src_alpha = *src_alpha_scan ++;
- if (clip_scan) {
- src_alpha = clip_scan[col] * src_alpha / 255;
- }
- if (src_alpha) {
- *dest_scan = gray;
- *dest_alpha_scan = src_alpha;
- }
- dest_scan ++;
- dest_alpha_scan ++;
- continue;
- }
- FX_BYTE src_alpha = *src_alpha_scan++;
- if (clip_scan) {
- src_alpha = clip_scan[col] * src_alpha / 255;
- }
- if (src_alpha == 0) {
- dest_scan ++;
- dest_alpha_scan ++;
- continue;
- }
- *dest_alpha_scan = back_alpha + src_alpha - back_alpha * src_alpha / 255;
- int alpha_ratio = src_alpha * 255 / (*dest_alpha_scan);
- dest_alpha_scan ++;
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, alpha_ratio);
- dest_scan ++;
- }
- } else {
- if (blend_type) {
- FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
- int blended_color;
- for (int col = 0; col < pixel_count; col ++) {
- FX_BYTE gray = pPalette[*src_scan];
- src_scan ++;
- if (clip_scan == NULL || clip_scan[col] == 255) {
- *dest_scan++ = gray;
- *dest_alpha_scan++ = 255;
- continue;
- }
- int src_alpha = clip_scan[col];
- if (src_alpha == 0) {
- dest_scan ++;
- dest_alpha_scan ++;
- continue;
- }
- int back_alpha = *dest_alpha_scan;
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
- *dest_alpha_scan ++ = dest_alpha;
- int alpha_ratio = src_alpha * 255 / dest_alpha;
- if (bNonseparableBlend) {
- blended_color = blend_type == FXDIB_BLEND_LUMINOSITY ? gray : *dest_scan;
- }
- gray = bNonseparableBlend ? blended_color : _BLEND(blend_type, *dest_scan, gray);
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, alpha_ratio);
- dest_scan ++;
- }
- return;
- }
- for (int col = 0; col < pixel_count; col ++) {
- FX_BYTE gray = pPalette[*src_scan];
- src_scan ++;
- if (clip_scan == NULL || clip_scan[col] == 255) {
- *dest_scan++ = gray;
- *dest_alpha_scan++ = 255;
- continue;
- }
- int src_alpha = clip_scan[col];
- if (src_alpha == 0) {
- dest_scan ++;
- dest_alpha_scan ++;
- continue;
- }
- int back_alpha = *dest_alpha_scan;
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
- *dest_alpha_scan ++ = dest_alpha;
- int alpha_ratio = src_alpha * 255 / dest_alpha;
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, alpha_ratio);
- dest_scan ++;
- }
- }
-}
-inline void _CompositeRow_1bppPal2Gray(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int src_left,
- FX_LPCBYTE pPalette, int pixel_count, int blend_type, FX_LPCBYTE clip_scan)
-{
- int reset_gray = pPalette[0];
- int set_gray = pPalette[1];
- if (blend_type) {
- FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
- int blended_color;
- for (int col = 0; col < pixel_count; col ++) {
- FX_BYTE gray = (src_scan[(col + src_left) / 8] & (1 << (7 - (col + src_left) % 8))) ? set_gray : reset_gray;
- if (bNonseparableBlend) {
- blended_color = blend_type == FXDIB_BLEND_LUMINOSITY ? gray : *dest_scan;
- }
- gray = bNonseparableBlend ? blended_color : _BLEND(blend_type, *dest_scan, gray);
- if (clip_scan && clip_scan[col] < 255) {
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, clip_scan[col]);
- } else {
- *dest_scan = gray;
- }
- dest_scan ++;
- }
- return;
- }
- for (int col = 0; col < pixel_count; col ++) {
- FX_BYTE gray = (src_scan[(col + src_left) / 8] & (1 << (7 - (col + src_left) % 8))) ? set_gray : reset_gray;
- if (clip_scan && clip_scan[col] < 255) {
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, clip_scan[col]);
- } else {
- *dest_scan = gray;
- }
- dest_scan ++;
- }
-}
-inline void _CompositeRow_1bppPal2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int src_left,
- FX_LPCBYTE pPalette, int pixel_count, int blend_type, FX_LPCBYTE clip_scan,
- FX_LPBYTE dest_alpha_scan)
-{
- int reset_gray = pPalette[0];
- int set_gray = pPalette[1];
- if (blend_type) {
- FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
- int blended_color;
- for (int col = 0; col < pixel_count; col ++) {
- FX_BYTE gray = (src_scan[(col + src_left) / 8] & (1 << (7 - (col + src_left) % 8))) ? set_gray : reset_gray;
- if (clip_scan == NULL || clip_scan[col] == 255) {
- *dest_scan++ = gray;
- *dest_alpha_scan ++ = 255;
- continue;
- }
- int src_alpha = clip_scan[col];
- if (src_alpha == 0) {
- dest_scan ++;
- dest_alpha_scan ++;
- continue;
- }
- int back_alpha = *dest_alpha_scan;
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
- *dest_alpha_scan ++ = dest_alpha;
- int alpha_ratio = src_alpha * 255 / dest_alpha;
- if (bNonseparableBlend) {
- blended_color = blend_type == FXDIB_BLEND_LUMINOSITY ? gray : *dest_scan;
- }
- gray = bNonseparableBlend ? blended_color : _BLEND(blend_type, *dest_scan, gray);
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, alpha_ratio);
- dest_scan ++;
- }
- return;
- }
- for (int col = 0; col < pixel_count; col ++) {
- FX_BYTE gray = (src_scan[(col + src_left) / 8] & (1 << (7 - (col + src_left) % 8))) ? set_gray : reset_gray;
- if (clip_scan == NULL || clip_scan[col] == 255) {
- *dest_scan++ = gray;
- *dest_alpha_scan ++ = 255;
- continue;
- }
- int src_alpha = clip_scan[col];
- if (src_alpha == 0) {
- dest_scan ++;
- dest_alpha_scan ++;
- continue;
- }
- int back_alpha = *dest_alpha_scan;
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
- *dest_alpha_scan ++ = dest_alpha;
- int alpha_ratio = src_alpha * 255 / dest_alpha;
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, alpha_ratio);
- dest_scan ++;
- }
-}
-inline void _CompositeRow_8bppRgb2Rgb_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, FX_DWORD* pPalette, int pixel_count,
- int DestBpp, FX_LPCBYTE clip_scan,
- FX_LPCBYTE src_alpha_scan)
-{
- if (src_alpha_scan) {
- int dest_gap = DestBpp - 3;
- FX_ARGB argb = 0;
- for (int col = 0; col < pixel_count; col ++) {
- argb = pPalette[*src_scan];
- int src_r = FXARGB_R(argb);
- int src_g = FXARGB_G(argb);
- int src_b = FXARGB_B(argb);
- src_scan ++;
- FX_BYTE src_alpha = 0;
- if (clip_scan) {
- src_alpha = (*src_alpha_scan++) * (*clip_scan++) / 255;
- } else {
- src_alpha = *src_alpha_scan++;
- }
- if (src_alpha == 255) {
- *dest_scan++ = src_b;
- *dest_scan++ = src_g;
- *dest_scan++ = src_r;
- dest_scan += dest_gap;
- continue;
- }
- if (src_alpha == 0) {
- dest_scan += DestBpp;
- continue;
- }
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_b, src_alpha);
- dest_scan ++;
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_g, src_alpha);
- dest_scan ++;
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_r, src_alpha);
- dest_scan ++;
- dest_scan += dest_gap;
- }
- } else {
- FX_ARGB argb = 0;
- for (int col = 0; col < pixel_count; col ++) {
- argb = pPalette[*src_scan];
- int src_r = FXARGB_R(argb);
- int src_g = FXARGB_G(argb);
- int src_b = FXARGB_B(argb);
- if (clip_scan && clip_scan[col] < 255) {
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_b, clip_scan[col]);
- dest_scan ++;
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_g, clip_scan[col]);
- dest_scan ++;
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_r, clip_scan[col]);
- dest_scan ++;
- } else {
- *dest_scan++ = src_b;
- *dest_scan++ = src_g;
- *dest_scan++ = src_r;
- }
- if (DestBpp == 4) {
- dest_scan++;
- }
- src_scan ++;
- }
- }
-}
-inline void _CompositeRow_1bppRgb2Rgb_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int src_left,
- FX_DWORD* pPalette, int pixel_count, int DestBpp, FX_LPCBYTE clip_scan)
-{
- int reset_r, reset_g, reset_b;
- int set_r, set_g, set_b;
- reset_r = FXARGB_R(pPalette[0]);
- reset_g = FXARGB_G(pPalette[0]);
- reset_b = FXARGB_B(pPalette[0]);
- set_r = FXARGB_R(pPalette[1]);
- set_g = FXARGB_G(pPalette[1]);
- set_b = FXARGB_B(pPalette[1]);
- for (int col = 0; col < pixel_count; col ++) {
- int src_r, src_g, src_b;
- if (src_scan[(col + src_left) / 8] & (1 << (7 - (col + src_left) % 8))) {
- src_r = set_r;
- src_g = set_g;
- src_b = set_b;
- } else {
- src_r = reset_r;
- src_g = reset_g;
- src_b = reset_b;
- }
- if (clip_scan && clip_scan[col] < 255) {
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_b, clip_scan[col]);
- dest_scan ++;
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_g, clip_scan[col]);
- dest_scan ++;
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_r, clip_scan[col]);
- dest_scan ++;
- } else {
- *dest_scan++ = src_b;
- *dest_scan++ = src_g;
- *dest_scan++ = src_r;
- }
- if (DestBpp == 4) {
- dest_scan++;
- }
- }
-}
-inline void _CompositeRow_8bppRgb2Argb_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width,
- FX_DWORD* pPalette, FX_LPCBYTE clip_scan,
- FX_LPCBYTE src_alpha_scan)
-{
- if (src_alpha_scan) {
- for (int col = 0; col < width; col ++) {
- FX_ARGB argb = pPalette[*src_scan];
- src_scan ++;
- int src_r = FXARGB_R(argb);
- int src_g = FXARGB_G(argb);
- int src_b = FXARGB_B(argb);
- FX_BYTE back_alpha = dest_scan[3];
- if (back_alpha == 0) {
- if (clip_scan) {
- int src_alpha = clip_scan[col] * (*src_alpha_scan) / 255;
- FXARGB_SETDIB(dest_scan, FXARGB_MAKE(src_alpha, src_r, src_g, src_b));
- } else {
- FXARGB_SETDIB(dest_scan, FXARGB_MAKE(*src_alpha_scan, src_r, src_g, src_b));
- }
- dest_scan += 4;
- src_alpha_scan ++;
- continue;
- }
- FX_BYTE src_alpha;
- if (clip_scan == NULL) {
- src_alpha = *src_alpha_scan ++;
- } else {
- src_alpha = clip_scan[col] * (*src_alpha_scan++) / 255;
- }
- if (src_alpha == 0) {
- dest_scan += 4;
- continue;
- }
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
- dest_scan[3] = dest_alpha;
- int alpha_ratio = src_alpha * 255 / dest_alpha;
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_b, alpha_ratio);
- dest_scan ++;
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_g, alpha_ratio);
- dest_scan ++;
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_r, alpha_ratio);
- dest_scan ++;
- dest_scan ++;
- }
- } else
- for (int col = 0; col < width; col ++) {
- FX_ARGB argb = pPalette[*src_scan];
- int src_r = FXARGB_R(argb);
- int src_g = FXARGB_G(argb);
- int src_b = FXARGB_B(argb);
- if (clip_scan == NULL || clip_scan[col] == 255) {
- *dest_scan++ = src_b;
- *dest_scan++ = src_g;
- *dest_scan++ = src_r;
- *dest_scan++ = 255;
- src_scan ++;
- continue;
- }
- int src_alpha = clip_scan[col];
- if (src_alpha == 0) {
- dest_scan += 4;
- src_scan ++;
- continue;
- }
- int back_alpha = dest_scan[3];
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
- dest_scan[3] = dest_alpha;
- int alpha_ratio = src_alpha * 255 / dest_alpha;
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_b, alpha_ratio);
- dest_scan ++;
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_g, alpha_ratio);
- dest_scan ++;
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_r, alpha_ratio);
- dest_scan ++;
- dest_scan ++;
- src_scan ++;
- }
-}
-void _CompositeRow_8bppRgb2Rgba_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width,
- FX_DWORD* pPalette, FX_LPCBYTE clip_scan,
- FX_LPBYTE dest_alpha_scan, FX_LPCBYTE src_alpha_scan)
-{
- if (src_alpha_scan) {
- for (int col = 0; col < width; col ++) {
- FX_ARGB argb = pPalette[*src_scan];
- src_scan ++;
- int src_r = FXARGB_R(argb);
- int src_g = FXARGB_G(argb);
- int src_b = FXARGB_B(argb);
- FX_BYTE back_alpha = *dest_alpha_scan;
- if (back_alpha == 0) {
- if (clip_scan) {
- int src_alpha = clip_scan[col] * (*src_alpha_scan) / 255;
- *dest_alpha_scan ++ = src_alpha;
- } else {
- *dest_alpha_scan ++ = *src_alpha_scan;
- }
- *dest_scan ++ = src_b;
- *dest_scan ++ = src_g;
- *dest_scan ++ = src_r;
- src_alpha_scan ++;
- continue;
- }
- FX_BYTE src_alpha;
- if (clip_scan == NULL) {
- src_alpha = *src_alpha_scan++;
- } else {
- src_alpha = clip_scan[col] * (*src_alpha_scan++) / 255;
- }
- if (src_alpha == 0) {
- dest_scan += 3;
- dest_alpha_scan ++;
- continue;
- }
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
- *dest_alpha_scan ++ = dest_alpha;
- int alpha_ratio = src_alpha * 255 / dest_alpha;
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_b, alpha_ratio);
- dest_scan ++;
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_g, alpha_ratio);
- dest_scan ++;
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_r, alpha_ratio);
- dest_scan ++;
- }
- } else
- for (int col = 0; col < width; col ++) {
- FX_ARGB argb = pPalette[*src_scan];
- int src_r = FXARGB_R(argb);
- int src_g = FXARGB_G(argb);
- int src_b = FXARGB_B(argb);
- if (clip_scan == NULL || clip_scan[col] == 255) {
- *dest_scan++ = src_b;
- *dest_scan++ = src_g;
- *dest_scan++ = src_r;
- *dest_alpha_scan++ = 255;
- src_scan ++;
- continue;
- }
- int src_alpha = clip_scan[col];
- if (src_alpha == 0) {
- dest_scan += 3;
- dest_alpha_scan ++;
- src_scan ++;
- continue;
- }
- int back_alpha = *dest_alpha_scan;
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
- *dest_alpha_scan ++ = dest_alpha;
- int alpha_ratio = src_alpha * 255 / dest_alpha;
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_b, alpha_ratio);
- dest_scan ++;
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_g, alpha_ratio);
- dest_scan ++;
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_r, alpha_ratio);
- dest_scan ++;
- src_scan ++;
- }
-}
-inline void _CompositeRow_1bppRgb2Argb_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int src_left, int width,
- FX_DWORD* pPalette, FX_LPCBYTE clip_scan)
-{
- int reset_r, reset_g, reset_b;
- int set_r, set_g, set_b;
- reset_r = FXARGB_R(pPalette[0]);
- reset_g = FXARGB_G(pPalette[0]);
- reset_b = FXARGB_B(pPalette[0]);
- set_r = FXARGB_R(pPalette[1]);
- set_g = FXARGB_G(pPalette[1]);
- set_b = FXARGB_B(pPalette[1]);
- for (int col = 0; col < width; col ++) {
- int src_r, src_g, src_b;
- if (src_scan[(col + src_left) / 8] & (1 << (7 - (col + src_left) % 8))) {
- src_r = set_r;
- src_g = set_g;
- src_b = set_b;
- } else {
- src_r = reset_r;
- src_g = reset_g;
- src_b = reset_b;
- }
- if (clip_scan == NULL || clip_scan[col] == 255) {
- *dest_scan++ = src_b;
- *dest_scan++ = src_g;
- *dest_scan++ = src_r;
- *dest_scan++ = 255;
- continue;
- }
- int src_alpha = clip_scan[col];
- if (src_alpha == 0) {
- dest_scan += 4;
- continue;
- }
- int back_alpha = dest_scan[3];
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
- dest_scan[3] = dest_alpha;
- int alpha_ratio = src_alpha * 255 / dest_alpha;
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_b, alpha_ratio);
- dest_scan ++;
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_g, alpha_ratio);
- dest_scan ++;
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_r, alpha_ratio);
- dest_scan ++;
- dest_scan ++;
- }
-}
-void _CompositeRow_1bppRgb2Rgba_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int src_left, int width,
- FX_DWORD* pPalette, FX_LPCBYTE clip_scan,
- FX_LPBYTE dest_alpha_scan)
-{
- int reset_r, reset_g, reset_b;
- int set_r, set_g, set_b;
- reset_r = FXARGB_R(pPalette[0]);
- reset_g = FXARGB_G(pPalette[0]);
- reset_b = FXARGB_B(pPalette[0]);
- set_r = FXARGB_R(pPalette[1]);
- set_g = FXARGB_G(pPalette[1]);
- set_b = FXARGB_B(pPalette[1]);
- for (int col = 0; col < width; col ++) {
- int src_r, src_g, src_b;
- if (src_scan[(col + src_left) / 8] & (1 << (7 - (col + src_left) % 8))) {
- src_r = set_r;
- src_g = set_g;
- src_b = set_b;
- } else {
- src_r = reset_r;
- src_g = reset_g;
- src_b = reset_b;
- }
- if (clip_scan == NULL || clip_scan[col] == 255) {
- *dest_scan++ = src_b;
- *dest_scan++ = src_g;
- *dest_scan++ = src_r;
- *dest_alpha_scan++ = 255;
- continue;
- }
- int src_alpha = clip_scan[col];
- if (src_alpha == 0) {
- dest_scan += 3;
- dest_alpha_scan ++;
- continue;
- }
- int back_alpha = *dest_alpha_scan;
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
- *dest_alpha_scan ++ = dest_alpha;
- int alpha_ratio = src_alpha * 255 / dest_alpha;
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_b, alpha_ratio);
- dest_scan ++;
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_g, alpha_ratio);
- dest_scan ++;
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_r, alpha_ratio);
- dest_scan ++;
- }
-}
-void _CompositeRow_ByteMask2Argb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int mask_alpha, int src_r, int src_g, int src_b, int pixel_count,
- int blend_type, FX_LPCBYTE clip_scan)
-{
- for (int col = 0; col < pixel_count; col ++) {
- int src_alpha;
- if (clip_scan) {
- src_alpha = mask_alpha * clip_scan[col] * src_scan[col] / 255 / 255;
- } else {
- src_alpha = mask_alpha * src_scan[col] / 255;
- }
- FX_BYTE back_alpha = dest_scan[3];
- if (back_alpha == 0) {
- FXARGB_SETDIB(dest_scan, FXARGB_MAKE(src_alpha, src_r, src_g, src_b));
- dest_scan += 4;
- continue;
- }
- if (src_alpha == 0) {
- dest_scan += 4;
- continue;
- }
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
- dest_scan[3] = dest_alpha;
- int alpha_ratio = src_alpha * 255 / dest_alpha;
- if (blend_type >= FXDIB_BLEND_NONSEPARABLE) {
- int blended_colors[3];
- FX_BYTE src_scan[3];
- src_scan[0] = src_b;
- src_scan[1] = src_g;
- src_scan[2] = src_r;
- _RGB_Blend(blend_type, src_scan, dest_scan, blended_colors);
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended_colors[0], alpha_ratio);
- dest_scan ++;
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended_colors[1], alpha_ratio);
- dest_scan ++;
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended_colors[2], alpha_ratio);
- } else if (blend_type) {
- int blended = _BLEND(blend_type, *dest_scan, src_b);
- blended = FXDIB_ALPHA_MERGE(src_b, blended, back_alpha);
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended, alpha_ratio);
- dest_scan ++;
- blended = _BLEND(blend_type, *dest_scan, src_g);
- blended = FXDIB_ALPHA_MERGE(src_g, blended, back_alpha);
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended, alpha_ratio);
- dest_scan ++;
- blended = _BLEND(blend_type, *dest_scan, src_r);
- blended = FXDIB_ALPHA_MERGE(src_r, blended, back_alpha);
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended, alpha_ratio);
- } else {
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_b, alpha_ratio);
- dest_scan ++;
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_g, alpha_ratio);
- dest_scan ++;
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_r, alpha_ratio);
- }
- dest_scan += 2;
- }
-}
-void _CompositeRow_ByteMask2Rgba(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int mask_alpha, int src_r, int src_g, int src_b, int pixel_count,
- int blend_type, FX_LPCBYTE clip_scan,
- FX_LPBYTE dest_alpha_scan)
-{
- for (int col = 0; col < pixel_count; col ++) {
- int src_alpha;
- if (clip_scan) {
- src_alpha = mask_alpha * clip_scan[col] * src_scan[col] / 255 / 255;
- } else {
- src_alpha = mask_alpha * src_scan[col] / 255;
- }
- FX_BYTE back_alpha = *dest_alpha_scan;
- if (back_alpha == 0) {
- *dest_scan ++ = src_b;
- *dest_scan ++ = src_g;
- *dest_scan ++ = src_r;
- *dest_alpha_scan ++ = src_alpha;
- continue;
- }
- if (src_alpha == 0) {
- dest_scan += 3;
- dest_alpha_scan ++;
- continue;
- }
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
- *dest_alpha_scan ++ = dest_alpha;
- int alpha_ratio = src_alpha * 255 / dest_alpha;
- if (blend_type >= FXDIB_BLEND_NONSEPARABLE) {
- int blended_colors[3];
- FX_BYTE src_scan[3];
- src_scan[0] = src_b;
- src_scan[1] = src_g;
- src_scan[2] = src_r;
- _RGB_Blend(blend_type, src_scan, dest_scan, blended_colors);
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended_colors[0], alpha_ratio);
- dest_scan ++;
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended_colors[1], alpha_ratio);
- dest_scan ++;
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended_colors[2], alpha_ratio);
- dest_scan ++;
- } else if (blend_type) {
- int blended = _BLEND(blend_type, *dest_scan, src_b);
- blended = FXDIB_ALPHA_MERGE(src_b, blended, back_alpha);
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended, alpha_ratio);
- dest_scan ++;
- blended = _BLEND(blend_type, *dest_scan, src_g);
- blended = FXDIB_ALPHA_MERGE(src_g, blended, back_alpha);
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended, alpha_ratio);
- dest_scan ++;
- blended = _BLEND(blend_type, *dest_scan, src_r);
- blended = FXDIB_ALPHA_MERGE(src_r, blended, back_alpha);
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended, alpha_ratio);
- dest_scan ++;
- } else {
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_b, alpha_ratio);
- dest_scan ++;
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_g, alpha_ratio);
- dest_scan ++;
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_r, alpha_ratio);
- dest_scan ++;
- }
- }
-}
-void _CompositeRow_ByteMask2Rgb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int mask_alpha, int src_r, int src_g, int src_b, int pixel_count,
- int blend_type, int Bpp, FX_LPCBYTE clip_scan)
-{
- for (int col = 0; col < pixel_count; col ++) {
- int src_alpha;
- if (clip_scan) {
- src_alpha = mask_alpha * clip_scan[col] * src_scan[col] / 255 / 255;
- } else {
- src_alpha = mask_alpha * src_scan[col] / 255;
- }
- if (src_alpha == 0) {
- dest_scan += Bpp;
- continue;
- }
- if (blend_type >= FXDIB_BLEND_NONSEPARABLE) {
- int blended_colors[3];
- FX_BYTE src_scan[3];
- src_scan[0] = src_b;
- src_scan[1] = src_g;
- src_scan[2] = src_r;
- _RGB_Blend(blend_type, src_scan, dest_scan, blended_colors);
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended_colors[0], src_alpha);
- dest_scan ++;
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended_colors[1], src_alpha);
- dest_scan ++;
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended_colors[2], src_alpha);
- } else if (blend_type) {
- int blended = _BLEND(blend_type, *dest_scan, src_b);
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended, src_alpha);
- dest_scan ++;
- blended = _BLEND(blend_type, *dest_scan, src_g);
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended, src_alpha);
- dest_scan ++;
- blended = _BLEND(blend_type, *dest_scan, src_r);
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended, src_alpha);
- } else {
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_b, src_alpha);
- dest_scan ++;
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_g, src_alpha);
- dest_scan ++;
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_r, src_alpha);
- }
- dest_scan += Bpp - 2;
- }
-}
-void _CompositeRow_ByteMask2Mask(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int mask_alpha, int pixel_count,
- FX_LPCBYTE clip_scan)
-{
- for (int col = 0; col < pixel_count; col ++) {
- int src_alpha;
- if (clip_scan) {
- src_alpha = mask_alpha * clip_scan[col] * src_scan[col] / 255 / 255;
- } else {
- src_alpha = mask_alpha * src_scan[col] / 255;
- }
- FX_BYTE back_alpha = *dest_scan;
- if (!back_alpha) {
- *dest_scan = src_alpha;
- } else if (src_alpha) {
- *dest_scan = back_alpha + src_alpha - back_alpha * src_alpha / 255;
- }
- dest_scan ++;
- }
-}
-void _CompositeRow_ByteMask2Gray(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int mask_alpha, int src_gray,
- int pixel_count, FX_LPCBYTE clip_scan)
-{
- for (int col = 0; col < pixel_count; col ++) {
- int src_alpha;
- if (clip_scan) {
- src_alpha = mask_alpha * clip_scan[col] * src_scan[col] / 255 / 255;
- } else {
- src_alpha = mask_alpha * src_scan[col] / 255;
- }
- if (src_alpha) {
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_gray, src_alpha);
- }
- dest_scan ++;
- }
-}
-void _CompositeRow_ByteMask2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int mask_alpha, int src_gray,
- int pixel_count, FX_LPCBYTE clip_scan,
- FX_LPBYTE dest_alpha_scan)
-{
- for (int col = 0; col < pixel_count; col ++) {
- int src_alpha;
- if (clip_scan) {
- src_alpha = mask_alpha * clip_scan[col] * src_scan[col] / 255 / 255;
- } else {
- src_alpha = mask_alpha * src_scan[col] / 255;
- }
- FX_BYTE back_alpha = *dest_alpha_scan;
- if (back_alpha == 0) {
- *dest_scan ++ = src_gray;
- *dest_alpha_scan ++ = src_alpha;
- continue;
- }
- if (src_alpha == 0) {
- dest_scan ++;
- dest_alpha_scan ++;
- continue;
- }
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
- *dest_alpha_scan++ = dest_alpha;
- int alpha_ratio = src_alpha * 255 / dest_alpha;
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_gray, alpha_ratio);
- dest_scan ++;
- }
-}
-void _CompositeRow_BitMask2Argb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int mask_alpha, int src_r, int src_g, int src_b,
- int src_left, int pixel_count, int blend_type, FX_LPCBYTE clip_scan)
-{
- if (blend_type == FXDIB_BLEND_NORMAL && clip_scan == NULL && mask_alpha == 255) {
- FX_ARGB argb = FXARGB_MAKE(0xff, src_r, src_g, src_b);
- for (int col = 0; col < pixel_count; col ++) {
- if (src_scan[(src_left + col) / 8] & (1 << (7 - (src_left + col) % 8))) {
- FXARGB_SETDIB(dest_scan, argb);
- }
- dest_scan += 4;
- }
- return;
- }
- for (int col = 0; col < pixel_count; col ++) {
- if (!(src_scan[(src_left + col) / 8] & (1 << (7 - (src_left + col) % 8)))) {
- dest_scan += 4;
- continue;
- }
- int src_alpha;
- if (clip_scan) {
- src_alpha = mask_alpha * clip_scan[col] / 255;
- } else {
- src_alpha = mask_alpha;
- }
- FX_BYTE back_alpha = dest_scan[3];
- if (back_alpha == 0) {
- FXARGB_SETDIB(dest_scan, FXARGB_MAKE(src_alpha, src_r, src_g, src_b));
- dest_scan += 4;
- continue;
- }
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
- dest_scan[3] = dest_alpha;
- int alpha_ratio = src_alpha * 255 / dest_alpha;
- if (blend_type >= FXDIB_BLEND_NONSEPARABLE) {
- int blended_colors[3];
- FX_BYTE src_scan[3];
- src_scan[0] = src_b;
- src_scan[1] = src_g;
- src_scan[2] = src_r;
- _RGB_Blend(blend_type, src_scan, dest_scan, blended_colors);
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended_colors[0], alpha_ratio);
- dest_scan ++;
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended_colors[1], alpha_ratio);
- dest_scan ++;
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended_colors[2], alpha_ratio);
- } else if (blend_type) {
- int blended = _BLEND(blend_type, *dest_scan, src_b);
- blended = FXDIB_ALPHA_MERGE(src_b, blended, back_alpha);
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended, alpha_ratio);
- dest_scan ++;
- blended = _BLEND(blend_type, *dest_scan, src_g);
- blended = FXDIB_ALPHA_MERGE(src_g, blended, back_alpha);
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended, alpha_ratio);
- dest_scan ++;
- blended = _BLEND(blend_type, *dest_scan, src_r);
- blended = FXDIB_ALPHA_MERGE(src_r, blended, back_alpha);
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended, alpha_ratio);
- } else {
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_b, alpha_ratio);
- dest_scan ++;
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_g, alpha_ratio);
- dest_scan ++;
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_r, alpha_ratio);
- }
- dest_scan += 2;
- }
-}
-void _CompositeRow_BitMask2Rgba(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int mask_alpha, int src_r, int src_g, int src_b,
- int src_left, int pixel_count, int blend_type, FX_LPCBYTE clip_scan,
- FX_LPBYTE dest_alpha_scan)
-{
- if (blend_type == FXDIB_BLEND_NORMAL && clip_scan == NULL && mask_alpha == 255) {
- for (int col = 0; col < pixel_count; col ++) {
- if (src_scan[(src_left + col) / 8] & (1 << (7 - (src_left + col) % 8))) {
- dest_scan[0] = src_b;
- dest_scan[1] = src_g;
- dest_scan[2] = src_r;
- *dest_alpha_scan = mask_alpha;
- }
- dest_scan += 3;
- dest_alpha_scan ++;
- }
- return;
- }
- for (int col = 0; col < pixel_count; col ++) {
- if (!(src_scan[(src_left + col) / 8] & (1 << (7 - (src_left + col) % 8)))) {
- dest_scan += 3;
- dest_alpha_scan ++;
- continue;
- }
- int src_alpha;
- if (clip_scan) {
- src_alpha = mask_alpha * clip_scan[col] / 255;
- } else {
- src_alpha = mask_alpha;
- }
- FX_BYTE back_alpha = dest_scan[3];
- if (back_alpha == 0) {
- *dest_scan ++ = src_b;
- *dest_scan ++ = src_g;
- *dest_scan ++ = src_r;
- *dest_alpha_scan ++ = mask_alpha;
- continue;
- }
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
- *dest_alpha_scan ++ = dest_alpha;
- int alpha_ratio = src_alpha * 255 / dest_alpha;
- if (blend_type >= FXDIB_BLEND_NONSEPARABLE) {
- int blended_colors[3];
- FX_BYTE src_scan[3];
- src_scan[0] = src_b;
- src_scan[1] = src_g;
- src_scan[2] = src_r;
- _RGB_Blend(blend_type, src_scan, dest_scan, blended_colors);
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended_colors[0], alpha_ratio);
- dest_scan ++;
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended_colors[1], alpha_ratio);
- dest_scan ++;
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended_colors[2], alpha_ratio);
- dest_scan ++;
- } else if (blend_type) {
- int blended = _BLEND(blend_type, *dest_scan, src_b);
- blended = FXDIB_ALPHA_MERGE(src_b, blended, back_alpha);
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended, alpha_ratio);
- dest_scan ++;
- blended = _BLEND(blend_type, *dest_scan, src_g);
- blended = FXDIB_ALPHA_MERGE(src_g, blended, back_alpha);
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended, alpha_ratio);
- dest_scan ++;
- blended = _BLEND(blend_type, *dest_scan, src_r);
- blended = FXDIB_ALPHA_MERGE(src_r, blended, back_alpha);
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended, alpha_ratio);
- dest_scan ++;
- } else {
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_b, alpha_ratio);
- dest_scan ++;
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_g, alpha_ratio);
- dest_scan ++;
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_r, alpha_ratio);
- dest_scan ++;
- }
- }
-}
-void _CompositeRow_BitMask2Rgb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int mask_alpha, int src_r, int src_g, int src_b,
- int src_left, int pixel_count, int blend_type, int Bpp, FX_LPCBYTE clip_scan)
-{
- if (blend_type == FXDIB_BLEND_NORMAL && clip_scan == NULL && mask_alpha == 255) {
- for (int col = 0; col < pixel_count; col ++) {
- if (src_scan[(src_left + col) / 8] & (1 << (7 - (src_left + col) % 8))) {
- dest_scan[2] = src_r;
- dest_scan[1] = src_g;
- dest_scan[0] = src_b;
- }
- dest_scan += Bpp;
- }
- return;
- }
- for (int col = 0; col < pixel_count; col ++) {
- if (!(src_scan[(src_left + col) / 8] & (1 << (7 - (src_left + col) % 8)))) {
- dest_scan += Bpp;
- continue;
- }
- int src_alpha;
- if (clip_scan) {
- src_alpha = mask_alpha * clip_scan[col] / 255;
- } else {
- src_alpha = mask_alpha;
- }
- if (src_alpha == 0) {
- dest_scan += Bpp;
- continue;
- }
- if (blend_type >= FXDIB_BLEND_NONSEPARABLE) {
- int blended_colors[3];
- FX_BYTE src_scan[3];
- src_scan[0] = src_b;
- src_scan[1] = src_g;
- src_scan[2] = src_r;
- _RGB_Blend(blend_type, src_scan, dest_scan, blended_colors);
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended_colors[0], src_alpha);
- dest_scan ++;
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended_colors[1], src_alpha);
- dest_scan ++;
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended_colors[2], src_alpha);
- } else if (blend_type) {
- int blended = _BLEND(blend_type, *dest_scan, src_b);
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended, src_alpha);
- dest_scan++;
- blended = _BLEND(blend_type, *dest_scan, src_g);
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended, src_alpha);
- dest_scan++;
- blended = _BLEND(blend_type, *dest_scan, src_r);
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended, src_alpha);
- } else {
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_b, src_alpha);
- dest_scan ++;
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_g, src_alpha);
- dest_scan ++;
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_r, src_alpha);
- }
- dest_scan += Bpp - 2;
- }
-}
-void _CompositeRow_BitMask2Mask(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int mask_alpha, int src_left,
- int pixel_count, FX_LPCBYTE clip_scan)
-{
- for (int col = 0; col < pixel_count; col ++) {
- if (!(src_scan[(src_left + col) / 8] & (1 << (7 - (src_left + col) % 8)))) {
- dest_scan ++;
- continue;
- }
- int src_alpha;
- if (clip_scan) {
- src_alpha = mask_alpha * clip_scan[col] / 255;
- } else {
- src_alpha = mask_alpha;
- }
- FX_BYTE back_alpha = *dest_scan;
- if (!back_alpha) {
- *dest_scan = src_alpha;
- } else if (src_alpha) {
- *dest_scan = back_alpha + src_alpha - back_alpha * src_alpha / 255;
- }
- dest_scan ++;
- }
-}
-void _CompositeRow_BitMask2Gray(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int mask_alpha, int src_gray,
- int src_left, int pixel_count, FX_LPCBYTE clip_scan)
-{
- for (int col = 0; col < pixel_count; col ++) {
- if (!(src_scan[(src_left + col) / 8] & (1 << (7 - (src_left + col) % 8)))) {
- dest_scan ++;
- continue;
- }
- int src_alpha;
- if (clip_scan) {
- src_alpha = mask_alpha * clip_scan[col] / 255;
- } else {
- src_alpha = mask_alpha;
- }
- if (src_alpha) {
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_gray, src_alpha);
- }
- dest_scan ++;
- }
-}
-void _CompositeRow_BitMask2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int mask_alpha, int src_gray,
- int src_left, int pixel_count, FX_LPCBYTE clip_scan,
- FX_LPBYTE dest_alpha_scan)
-{
- for (int col = 0; col < pixel_count; col ++) {
- if (!(src_scan[(src_left + col) / 8] & (1 << (7 - (src_left + col) % 8)))) {
- dest_scan ++;
- dest_alpha_scan ++;
- continue;
- }
- int src_alpha;
- if (clip_scan) {
- src_alpha = mask_alpha * clip_scan[col] / 255;
- } else {
- src_alpha = mask_alpha;
- }
- FX_BYTE back_alpha = *dest_alpha_scan;
- if (back_alpha == 0) {
- *dest_scan ++ = src_gray;
- *dest_alpha_scan ++ = src_alpha;
- continue;
- }
- if (src_alpha == 0) {
- dest_scan ++;
- dest_alpha_scan ++;
- continue;
- }
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
- *dest_alpha_scan++ = dest_alpha;
- int alpha_ratio = src_alpha * 255 / dest_alpha;
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_gray, alpha_ratio);
- dest_scan ++;
- }
-}
-void _CompositeRow_Argb2Argb_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixel_count, int blend_type, FX_LPCBYTE clip_scan)
-{
- int blended_colors[3];
- FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
- for (int col = 0; col < pixel_count; col ++) {
- FX_BYTE back_alpha = dest_scan[3];
- if (back_alpha == 0) {
- if (clip_scan) {
- int src_alpha = clip_scan[col] * src_scan[3] / 255;
- dest_scan[3] = src_alpha;
- dest_scan[0] = src_scan[2];
- dest_scan[1] = src_scan[1];
- dest_scan[2] = src_scan[0];
- } else {
- FXARGB_RGBORDERCOPY(dest_scan, src_scan);
- }
- dest_scan += 4;
- src_scan += 4;
- continue;
- }
- FX_BYTE src_alpha;
- if (clip_scan == NULL) {
- src_alpha = src_scan[3];
- } else {
- src_alpha = clip_scan[col] * src_scan[3] / 255;
- }
- if (src_alpha == 0) {
- dest_scan += 4;
- src_scan += 4;
- continue;
- }
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
- dest_scan[3] = dest_alpha;
- int alpha_ratio = src_alpha * 255 / dest_alpha;
- if (bNonseparableBlend) {
- FX_BYTE dest_scan_o[3];
- dest_scan_o[0] = dest_scan[2];
- dest_scan_o[1] = dest_scan[1];
- dest_scan_o[2] = dest_scan[0];
- _RGB_Blend(blend_type, src_scan, dest_scan_o, blended_colors);
- }
- for (int color = 0; color < 3; color ++) {
- int index = 2 - color;
- if (blend_type) {
- int blended = bNonseparableBlend ? blended_colors[color] :
- _BLEND(blend_type, dest_scan[index], *src_scan);
- blended = FXDIB_ALPHA_MERGE(*src_scan, blended, back_alpha);
- dest_scan[index] = FXDIB_ALPHA_MERGE(dest_scan[index], blended, alpha_ratio);
- } else {
- dest_scan[index] = FXDIB_ALPHA_MERGE(dest_scan[index], *src_scan, alpha_ratio);
- }
- src_scan ++;
- }
- dest_scan += 4;
- src_scan++;
- }
-}
-void _CompositeRow_Rgb2Argb_Blend_NoClip_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int blend_type, int src_Bpp)
-{
- int blended_colors[3];
- FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
- int src_gap = src_Bpp - 3;
- for (int col = 0; col < width; col ++) {
- FX_BYTE back_alpha = dest_scan[3];
- if (back_alpha == 0) {
- if (src_Bpp == 4) {
- FXARGB_SETRGBORDERDIB(dest_scan, 0xff000000 | FXARGB_GETDIB(src_scan));
- } else {
- FXARGB_SETRGBORDERDIB(dest_scan, FXARGB_MAKE(0xff, src_scan[2], src_scan[1], src_scan[0]));
- }
- dest_scan += 4;
- src_scan += src_Bpp;
- continue;
- }
- dest_scan[3] = 0xff;
- if (bNonseparableBlend) {
- FX_BYTE dest_scan_o[3];
- dest_scan_o[0] = dest_scan[2];
- dest_scan_o[1] = dest_scan[1];
- dest_scan_o[2] = dest_scan[0];
- _RGB_Blend(blend_type, src_scan, dest_scan_o, blended_colors);
- }
- for (int color = 0; color < 3; color ++) {
- int index = 2 - color;
- int src_color = FX_GAMMA(*src_scan);
- int blended = bNonseparableBlend ? blended_colors[color] :
- _BLEND(blend_type, dest_scan[index], src_color);
- dest_scan[index] = FXDIB_ALPHA_MERGE(src_color, blended, back_alpha);
- src_scan ++;
- }
- dest_scan += 4;
- src_scan += src_gap;
- }
-}
-inline void _CompositeRow_Argb2Rgb_Blend_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int blend_type, int dest_Bpp, FX_LPCBYTE clip_scan)
-{
- int blended_colors[3];
- FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
- for (int col = 0; col < width; col ++) {
- FX_BYTE src_alpha;
- if (clip_scan) {
- src_alpha = src_scan[3] * (*clip_scan++) / 255;
- } else {
- src_alpha = src_scan[3];
- }
- if (src_alpha == 0) {
- dest_scan += dest_Bpp;
- src_scan += 4;
- continue;
- }
- if (bNonseparableBlend) {
- FX_BYTE dest_scan_o[3];
- dest_scan_o[0] = dest_scan[2];
- dest_scan_o[1] = dest_scan[1];
- dest_scan_o[2] = dest_scan[0];
- _RGB_Blend(blend_type, src_scan, dest_scan_o, blended_colors);
- }
- for (int color = 0; color < 3; color ++) {
- int index = 2 - color;
- int back_color = FX_GAMMA(dest_scan[index]);
- int blended = bNonseparableBlend ? blended_colors[color] :
- _BLEND(blend_type, back_color, *src_scan);
- dest_scan[index] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(back_color, blended, src_alpha));
- src_scan ++;
- }
- dest_scan += dest_Bpp;
- src_scan ++;
- }
-}
-inline void _CompositeRow_Rgb2Argb_NoBlend_NoClip_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int src_Bpp)
-{
- int src_gap = src_Bpp - 3;
- for (int col = 0; col < width; col ++) {
- if (src_Bpp == 4) {
- FXARGB_SETRGBORDERDIB(dest_scan, 0xff000000 | FXARGB_GETDIB(src_scan));
- } else {
- FXARGB_SETRGBORDERDIB(dest_scan, FXARGB_MAKE(0xff, src_scan[2], src_scan[1], src_scan[0]));
- }
- dest_scan += 4;
- src_scan += src_Bpp;
- }
-}
-inline void _CompositeRow_Rgb2Rgb_Blend_NoClip_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int blend_type, int dest_Bpp, int src_Bpp)
-{
- int blended_colors[3];
- FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
- int src_gap = src_Bpp - 3;
- for (int col = 0; col < width; col ++) {
- if (bNonseparableBlend) {
- FX_BYTE dest_scan_o[3];
- dest_scan_o[0] = dest_scan[2];
- dest_scan_o[1] = dest_scan[1];
- dest_scan_o[2] = dest_scan[0];
- _RGB_Blend(blend_type, src_scan, dest_scan_o, blended_colors);
- }
- for (int color = 0; color < 3; color ++) {
- int index = 2 - color;
- int back_color = FX_GAMMA(dest_scan[index]);
- int src_color = FX_GAMMA(*src_scan);
- int blended = bNonseparableBlend ? blended_colors[color] :
- _BLEND(blend_type, back_color, src_color);
- dest_scan[index] = FX_GAMMA_INVERSE(blended);
- src_scan ++;
- }
- dest_scan += dest_Bpp;
- src_scan += src_gap;
- }
-}
-inline void _CompositeRow_Argb2Rgb_NoBlend_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int dest_Bpp, FX_LPCBYTE clip_scan)
-{
- for (int col = 0; col < width; col ++) {
- FX_BYTE src_alpha;
- if (clip_scan) {
- src_alpha = src_scan[3] * (*clip_scan++) / 255;
- } else {
- src_alpha = src_scan[3];
- }
- if (src_alpha == 255) {
- dest_scan[2] = FX_GAMMA_INVERSE(*src_scan++);
- dest_scan[1] = FX_GAMMA_INVERSE(*src_scan++);
- dest_scan[0] = FX_GAMMA_INVERSE(*src_scan++);
- dest_scan += dest_Bpp;
- src_scan ++;
- continue;
- }
- if (src_alpha == 0) {
- dest_scan += dest_Bpp;
- src_scan += 4;
- continue;
- }
- for (int color = 0; color < 3; color ++) {
- int index = 2 - color;
- dest_scan[index] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[index]), *src_scan, src_alpha));
- src_scan ++;
- }
- dest_scan += dest_Bpp;
- src_scan ++;
- }
-}
-inline void _CompositeRow_Rgb2Rgb_NoBlend_NoClip_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int dest_Bpp, int src_Bpp)
-{
- for (int col = 0; col < width; col ++) {
- dest_scan[2] = src_scan[0];
- dest_scan[1] = src_scan[1];
- dest_scan[0] = src_scan[2];
- dest_scan += dest_Bpp;
- src_scan += src_Bpp;
- }
-}
-inline void _CompositeRow_Rgb2Argb_Blend_Clip_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int blend_type, int src_Bpp, FX_LPCBYTE clip_scan)
-{
- int blended_colors[3];
- FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
- int src_gap = src_Bpp - 3;
- for (int col = 0; col < width; col ++) {
- int src_alpha = *clip_scan ++;
- FX_BYTE back_alpha = dest_scan[3];
- if (back_alpha == 0) {
- dest_scan[2] = FX_GAMMA(*src_scan++);
- dest_scan[1] = FX_GAMMA(*src_scan++);
- dest_scan[0] = FX_GAMMA(*src_scan++);
- src_scan += src_gap;
- dest_scan += 4;
- continue;
- }
- if (src_alpha == 0) {
- dest_scan += 4;
- src_scan += src_Bpp;
- continue;
- }
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
- dest_scan[3] = dest_alpha;
- int alpha_ratio = src_alpha * 255 / dest_alpha;
- if (bNonseparableBlend) {
- FX_BYTE dest_scan_o[3];
- dest_scan_o[0] = dest_scan[2];
- dest_scan_o[1] = dest_scan[1];
- dest_scan_o[2] = dest_scan[0];
- _RGB_Blend(blend_type, src_scan, dest_scan_o, blended_colors);
- }
- for (int color = 0; color < 3; color ++) {
- int index = 2 - color;
- int src_color = FX_GAMMA(*src_scan);
- int blended = bNonseparableBlend ? blended_colors[color] :
- _BLEND(blend_type, dest_scan[index], src_color);
- blended = FXDIB_ALPHA_MERGE(src_color, blended, back_alpha);
- dest_scan[index] = FXDIB_ALPHA_MERGE(dest_scan[index], blended, alpha_ratio);
- src_scan ++;
- }
- dest_scan += 4;
- src_scan += src_gap;
- }
-}
-inline void _CompositeRow_Rgb2Rgb_Blend_Clip_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int blend_type, int dest_Bpp, int src_Bpp, FX_LPCBYTE clip_scan)
-{
- int blended_colors[3];
- FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
- int src_gap = src_Bpp - 3;
- for (int col = 0; col < width; col ++) {
- FX_BYTE src_alpha = *clip_scan ++;
- if (src_alpha == 0) {
- dest_scan += dest_Bpp;
- src_scan += src_Bpp;
- continue;
- }
- if (bNonseparableBlend) {
- FX_BYTE dest_scan_o[3];
- dest_scan_o[0] = dest_scan[2];
- dest_scan_o[1] = dest_scan[1];
- dest_scan_o[2] = dest_scan[0];
- _RGB_Blend(blend_type, src_scan, dest_scan_o, blended_colors);
- }
- for (int color = 0; color < 3; color ++) {
- int index = 2 - color;
- int src_color = FX_GAMMA(*src_scan);
- int back_color = FX_GAMMA(dest_scan[index]);
- int blended = bNonseparableBlend ? blended_colors[color] :
- _BLEND(blend_type, back_color, src_color);
- dest_scan[index] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(back_color, blended, src_alpha));
- src_scan ++;
- }
- dest_scan += dest_Bpp;
- src_scan += src_gap;
- }
-}
-inline void _CompositeRow_Rgb2Argb_NoBlend_Clip_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int src_Bpp, FX_LPCBYTE clip_scan)
-{
- int src_gap = src_Bpp - 3;
- for (int col = 0; col < width; col ++) {
- int src_alpha = clip_scan[col];
- if (src_alpha == 255) {
- dest_scan[2] = FX_GAMMA(*src_scan++);
- dest_scan[1] = FX_GAMMA(*src_scan++);
- dest_scan[0] = FX_GAMMA(*src_scan++);
- dest_scan[3] = 255;
- dest_scan += 4;
- src_scan += src_gap;
- continue;
- }
- if (src_alpha == 0) {
- dest_scan += 4;
- src_scan += src_Bpp;
- continue;
- }
- int back_alpha = dest_scan[3];
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
- dest_scan[3] = dest_alpha;
- int alpha_ratio = src_alpha * 255 / dest_alpha;
- for (int color = 0; color < 3; color ++) {
- int index = 2 - color;
- dest_scan[index] = FXDIB_ALPHA_MERGE(dest_scan[index], FX_GAMMA(*src_scan), alpha_ratio);
- src_scan ++;
- }
- dest_scan += 4;
- src_scan += src_gap;
- }
-}
-inline void _CompositeRow_Rgb2Rgb_NoBlend_Clip_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int dest_Bpp, int src_Bpp, FX_LPCBYTE clip_scan)
-{
- for (int col = 0; col < width; col ++) {
- int src_alpha = clip_scan[col];
- if (src_alpha == 255) {
- dest_scan[2] = src_scan[0];
- dest_scan[1] = src_scan[1];
- dest_scan[0] = src_scan[2];
- } else if (src_alpha) {
- dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), FX_GAMMA(*src_scan), src_alpha));
- src_scan ++;
- dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), FX_GAMMA(*src_scan), src_alpha));
- src_scan ++;
- dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), FX_GAMMA(*src_scan), src_alpha));
- dest_scan += dest_Bpp;
- src_scan += src_Bpp - 2;
- continue;
- }
- dest_scan += dest_Bpp;
- src_scan += src_Bpp;
- }
-}
-inline void _CompositeRow_8bppRgb2Rgb_NoBlend_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, FX_ARGB* pPalette, int pixel_count,
- int DestBpp, FX_LPCBYTE clip_scan)
-{
- for (int col = 0; col < pixel_count; col ++) {
- FX_ARGB argb = pPalette ? pPalette[*src_scan] : (*src_scan) * 0x010101;
- int src_r = FXARGB_R(argb);
- int src_g = FXARGB_G(argb);
- int src_b = FXARGB_B(argb);
- if (clip_scan && clip_scan[col] < 255) {
- dest_scan[2] = FXDIB_ALPHA_MERGE(dest_scan[2], src_b, clip_scan[col]);
- dest_scan[1] = FXDIB_ALPHA_MERGE(dest_scan[1], src_g, clip_scan[col]);
- dest_scan[0] = FXDIB_ALPHA_MERGE(dest_scan[0], src_r, clip_scan[col]);
- } else {
- dest_scan[2] = src_b;
- dest_scan[1] = src_g;
- dest_scan[0] = src_r;
- }
- dest_scan += DestBpp;
- src_scan ++;
- }
-}
-inline void _CompositeRow_1bppRgb2Rgb_NoBlend_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int src_left,
- FX_ARGB* pPalette, int pixel_count, int DestBpp, FX_LPCBYTE clip_scan)
-{
- int reset_r, reset_g, reset_b;
- int set_r, set_g, set_b;
- if (pPalette) {
- reset_r = FXARGB_R(pPalette[0]);
- reset_g = FXARGB_G(pPalette[0]);
- reset_b = FXARGB_B(pPalette[0]);
- set_r = FXARGB_R(pPalette[1]);
- set_g = FXARGB_G(pPalette[1]);
- set_b = FXARGB_B(pPalette[1]);
- } else {
- reset_r = reset_g = reset_b = 0;
- set_r = set_g = set_b = 255;
- }
- for (int col = 0; col < pixel_count; col ++) {
- int src_r, src_g, src_b;
- if (src_scan[(col + src_left) / 8] & (1 << (7 - (col + src_left) % 8))) {
- src_r = set_r;
- src_g = set_g;
- src_b = set_b;
- } else {
- src_r = reset_r;
- src_g = reset_g;
- src_b = reset_b;
- }
- if (clip_scan && clip_scan[col] < 255) {
- dest_scan[2] = FXDIB_ALPHA_MERGE(dest_scan[2], src_b, clip_scan[col]);
- dest_scan[1] = FXDIB_ALPHA_MERGE(dest_scan[1], src_g, clip_scan[col]);
- dest_scan[0] = FXDIB_ALPHA_MERGE(dest_scan[0], src_r, clip_scan[col]);
- } else {
- dest_scan[2] = src_b;
- dest_scan[1] = src_g;
- dest_scan[0] = src_r;
- }
- dest_scan += DestBpp;
- }
-}
-inline void _CompositeRow_8bppRgb2Argb_NoBlend_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width,
- FX_ARGB* pPalette, FX_LPCBYTE clip_scan)
-{
- for (int col = 0; col < width; col ++) {
- int src_r, src_g, src_b;
- if (pPalette) {
- FX_ARGB argb = pPalette[*src_scan];
- src_r = FXARGB_R(argb);
- src_g = FXARGB_G(argb);
- src_b = FXARGB_B(argb);
- } else {
- src_r = src_g = src_b = *src_scan;
- }
- if (clip_scan == NULL || clip_scan[col] == 255) {
- dest_scan[2] = FX_GAMMA(src_b);
- dest_scan[1] = FX_GAMMA(src_g);
- dest_scan[0] = FX_GAMMA(src_r);
- dest_scan[3] = 255;
- src_scan ++;
- dest_scan += 4;
- continue;
- }
- int src_alpha = clip_scan[col];
- if (src_alpha == 0) {
- dest_scan += 4;
- src_scan ++;
- continue;
- }
- int back_alpha = dest_scan[3];
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
- dest_scan[3] = dest_alpha;
- int alpha_ratio = src_alpha * 255 / dest_alpha;
- dest_scan[2] = FXDIB_ALPHA_MERGE(dest_scan[2], FX_GAMMA(src_b), alpha_ratio);
- dest_scan[1] = FXDIB_ALPHA_MERGE(dest_scan[1], FX_GAMMA(src_g), alpha_ratio);
- dest_scan[0] = FXDIB_ALPHA_MERGE(dest_scan[0], FX_GAMMA(src_r), alpha_ratio);
- dest_scan += 4;
- src_scan ++;
- }
-}
-inline void _CompositeRow_1bppRgb2Argb_NoBlend_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int src_left, int width,
- FX_ARGB* pPalette, FX_LPCBYTE clip_scan)
-{
- int reset_r, reset_g, reset_b;
- int set_r, set_g, set_b;
- if (pPalette) {
- reset_r = FXARGB_R(pPalette[0]);
- reset_g = FXARGB_G(pPalette[0]);
- reset_b = FXARGB_B(pPalette[0]);
- set_r = FXARGB_R(pPalette[1]);
- set_g = FXARGB_G(pPalette[1]);
- set_b = FXARGB_B(pPalette[1]);
- } else {
- reset_r = reset_g = reset_b = 0;
- set_r = set_g = set_b = 255;
- }
- for (int col = 0; col < width; col ++) {
- int src_r, src_g, src_b;
- if (src_scan[(col + src_left) / 8] & (1 << (7 - (col + src_left) % 8))) {
- src_r = set_r;
- src_g = set_g;
- src_b = set_b;
- } else {
- src_r = reset_r;
- src_g = reset_g;
- src_b = reset_b;
- }
- if (clip_scan == NULL || clip_scan[col] == 255) {
- dest_scan[2] = FX_GAMMA(src_b);
- dest_scan[1] = FX_GAMMA(src_g);
- dest_scan[0] = FX_GAMMA(src_r);
- dest_scan[3] = 255;
- dest_scan += 4;
- continue;
- }
- int src_alpha = clip_scan[col];
- if (src_alpha == 0) {
- dest_scan += 4;
- continue;
- }
- int back_alpha = dest_scan[3];
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
- dest_scan[3] = dest_alpha;
- int alpha_ratio = src_alpha * 255 / dest_alpha;
- dest_scan[2] = FXDIB_ALPHA_MERGE(dest_scan[2], FX_GAMMA(src_b), alpha_ratio);
- dest_scan[1] = FXDIB_ALPHA_MERGE(dest_scan[1], FX_GAMMA(src_g), alpha_ratio);
- dest_scan[0] = FXDIB_ALPHA_MERGE(dest_scan[0], FX_GAMMA(src_r), alpha_ratio);
- dest_scan += 4;
- }
-}
-void _CompositeRow_ByteMask2Argb_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int mask_alpha, int src_r, int src_g, int src_b, int pixel_count,
- int blend_type, FX_LPCBYTE clip_scan)
-{
- for (int col = 0; col < pixel_count; col ++) {
- int src_alpha;
- if (clip_scan) {
- src_alpha = mask_alpha * clip_scan[col] * src_scan[col] / 255 / 255;
- } else {
- src_alpha = mask_alpha * src_scan[col] / 255;
- }
- FX_BYTE back_alpha = dest_scan[3];
- if (back_alpha == 0) {
- FXARGB_SETRGBORDERDIB(dest_scan, FXARGB_MAKE(src_alpha, src_r, src_g, src_b));
- dest_scan += 4;
- continue;
- }
- if (src_alpha == 0) {
- dest_scan += 4;
- continue;
- }
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
- dest_scan[3] = dest_alpha;
- int alpha_ratio = src_alpha * 255 / dest_alpha;
- if (blend_type >= FXDIB_BLEND_NONSEPARABLE) {
- int blended_colors[3];
- FX_BYTE src_scan[3];
- FX_BYTE dest_scan_o[3];
- src_scan[0] = src_b;
- src_scan[1] = src_g;
- src_scan[2] = src_r;
- dest_scan_o[0] = dest_scan[2];
- dest_scan_o[1] = dest_scan[1];
- dest_scan_o[2] = dest_scan[0];
- _RGB_Blend(blend_type, src_scan, dest_scan_o, blended_colors);
- dest_scan[2] = FXDIB_ALPHA_MERGE(dest_scan[2], blended_colors[0], alpha_ratio);
- dest_scan[1] = FXDIB_ALPHA_MERGE(dest_scan[1], blended_colors[1], alpha_ratio);
- dest_scan[0] = FXDIB_ALPHA_MERGE(dest_scan[0], blended_colors[2], alpha_ratio);
- } else if (blend_type) {
- int blended = _BLEND(blend_type, dest_scan[2], src_b);
- blended = FXDIB_ALPHA_MERGE(src_b, blended, back_alpha);
- dest_scan[2] = FXDIB_ALPHA_MERGE(dest_scan[2], blended, alpha_ratio);
- blended = _BLEND(blend_type, dest_scan[1], src_g);
- blended = FXDIB_ALPHA_MERGE(src_g, blended, back_alpha);
- dest_scan[1] = FXDIB_ALPHA_MERGE(dest_scan[1], blended, alpha_ratio);
- blended = _BLEND(blend_type, dest_scan[0], src_r);
- blended = FXDIB_ALPHA_MERGE(src_r, blended, back_alpha);
- dest_scan[0] = FXDIB_ALPHA_MERGE(dest_scan[0], blended, alpha_ratio);
- } else {
- dest_scan[2] = FXDIB_ALPHA_MERGE(dest_scan[2], src_b, alpha_ratio);
- dest_scan[1] = FXDIB_ALPHA_MERGE(dest_scan[1], src_g, alpha_ratio);
- dest_scan[0] = FXDIB_ALPHA_MERGE(dest_scan[0], src_r, alpha_ratio);
- }
- dest_scan += 4;
- }
-}
-void _CompositeRow_ByteMask2Rgb_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int mask_alpha, int src_r, int src_g, int src_b, int pixel_count,
- int blend_type, int Bpp, FX_LPCBYTE clip_scan)
-{
- for (int col = 0; col < pixel_count; col ++) {
- int src_alpha;
- if (clip_scan) {
- src_alpha = mask_alpha * clip_scan[col] * src_scan[col] / 255 / 255;
- } else {
- src_alpha = mask_alpha * src_scan[col] / 255;
- }
- if (src_alpha == 0) {
- dest_scan += Bpp;
- continue;
- }
- if (blend_type >= FXDIB_BLEND_NONSEPARABLE) {
- int blended_colors[3];
- FX_BYTE src_scan[3];
- FX_BYTE dest_scan_o[3];
- src_scan[0] = src_b;
- src_scan[1] = src_g;
- src_scan[2] = src_r;
- dest_scan_o[0] = dest_scan[2];
- dest_scan_o[1] = dest_scan[1];
- dest_scan_o[2] = dest_scan[0];
- _RGB_Blend(blend_type, src_scan, dest_scan_o, blended_colors);
- dest_scan[2] = FXDIB_ALPHA_MERGE(dest_scan[2], blended_colors[0], src_alpha);
- dest_scan[1] = FXDIB_ALPHA_MERGE(dest_scan[1], blended_colors[1], src_alpha);
- dest_scan[0] = FXDIB_ALPHA_MERGE(dest_scan[0], blended_colors[2], src_alpha);
- } else if (blend_type) {
- int blended = _BLEND(blend_type, dest_scan[2], src_b);
- dest_scan[2] = FXDIB_ALPHA_MERGE(dest_scan[2], blended, src_alpha);
- blended = _BLEND(blend_type, dest_scan[1], src_g);
- dest_scan[1] = FXDIB_ALPHA_MERGE(dest_scan[1], blended, src_alpha);
- blended = _BLEND(blend_type, dest_scan[0], src_r);
- dest_scan[0] = FXDIB_ALPHA_MERGE(dest_scan[0], blended, src_alpha);
- } else {
- dest_scan[2] = FXDIB_ALPHA_MERGE(dest_scan[2], src_b, src_alpha);
- dest_scan[1] = FXDIB_ALPHA_MERGE(dest_scan[1], src_g, src_alpha);
- dest_scan[0] = FXDIB_ALPHA_MERGE(dest_scan[0], src_r, src_alpha);
- }
- dest_scan += Bpp;
- }
-}
-void _CompositeRow_BitMask2Argb_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int mask_alpha, int src_r, int src_g, int src_b,
- int src_left, int pixel_count, int blend_type, FX_LPCBYTE clip_scan)
-{
- if (blend_type == FXDIB_BLEND_NORMAL && clip_scan == NULL && mask_alpha == 255) {
- FX_ARGB argb = FXARGB_MAKE(0xff, src_r, src_g, src_b);
- for (int col = 0; col < pixel_count; col ++) {
- if (src_scan[(src_left + col) / 8] & (1 << (7 - (src_left + col) % 8))) {
- FXARGB_SETRGBORDERDIB(dest_scan, argb);
- }
- dest_scan += 4;
- }
- return;
- }
- for (int col = 0; col < pixel_count; col ++) {
- if (!(src_scan[(src_left + col) / 8] & (1 << (7 - (src_left + col) % 8)))) {
- dest_scan += 4;
- continue;
- }
- int src_alpha;
- if (clip_scan) {
- src_alpha = mask_alpha * clip_scan[col] / 255;
- } else {
- src_alpha = mask_alpha;
- }
- FX_BYTE back_alpha = dest_scan[3];
- if (back_alpha == 0) {
- FXARGB_SETRGBORDERDIB(dest_scan, FXARGB_MAKE(src_alpha, src_r, src_g, src_b));
- dest_scan += 4;
- continue;
- }
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
- dest_scan[3] = dest_alpha;
- int alpha_ratio = src_alpha * 255 / dest_alpha;
- if (blend_type >= FXDIB_BLEND_NONSEPARABLE) {
- int blended_colors[3];
- FX_BYTE src_scan[3];
- FX_BYTE dest_scan_o[3];
- src_scan[0] = src_b;
- src_scan[1] = src_g;
- src_scan[2] = src_r;
- dest_scan_o[0] = dest_scan[2];
- dest_scan_o[1] = dest_scan[1];
- dest_scan_o[2] = dest_scan[0];
- _RGB_Blend(blend_type, src_scan, dest_scan_o, blended_colors);
- dest_scan[2] = FXDIB_ALPHA_MERGE(dest_scan[2], blended_colors[0], alpha_ratio);
- dest_scan[1] = FXDIB_ALPHA_MERGE(dest_scan[1], blended_colors[1], alpha_ratio);
- dest_scan[0] = FXDIB_ALPHA_MERGE(dest_scan[0], blended_colors[2], alpha_ratio);
- } else if (blend_type) {
- int blended = _BLEND(blend_type, dest_scan[2], src_b);
- blended = FXDIB_ALPHA_MERGE(src_b, blended, back_alpha);
- dest_scan[2] = FXDIB_ALPHA_MERGE(dest_scan[2], blended, alpha_ratio);
- blended = _BLEND(blend_type, dest_scan[1], src_g);
- blended = FXDIB_ALPHA_MERGE(src_g, blended, back_alpha);
- dest_scan[1] = FXDIB_ALPHA_MERGE(dest_scan[1], blended, alpha_ratio);
- blended = _BLEND(blend_type, dest_scan[0], src_r);
- blended = FXDIB_ALPHA_MERGE(src_r, blended, back_alpha);
- dest_scan[0] = FXDIB_ALPHA_MERGE(dest_scan[0], blended, alpha_ratio);
- } else {
- dest_scan[2] = FXDIB_ALPHA_MERGE(dest_scan[2], src_b, alpha_ratio);
- dest_scan[1] = FXDIB_ALPHA_MERGE(dest_scan[1], src_g, alpha_ratio);
- dest_scan[0] = FXDIB_ALPHA_MERGE(dest_scan[0], src_r, alpha_ratio);
- }
- dest_scan += 4;
- }
-}
-void _CompositeRow_BitMask2Rgb_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int mask_alpha, int src_r, int src_g, int src_b,
- int src_left, int pixel_count, int blend_type, int Bpp, FX_LPCBYTE clip_scan)
-{
- if (blend_type == FXDIB_BLEND_NORMAL && clip_scan == NULL && mask_alpha == 255) {
- for (int col = 0; col < pixel_count; col ++) {
- if (src_scan[(src_left + col) / 8] & (1 << (7 - (src_left + col) % 8))) {
- dest_scan[2] = src_b;
- dest_scan[1] = src_g;
- dest_scan[0] = src_r;
- }
- dest_scan += Bpp;
- }
- return;
- }
- for (int col = 0; col < pixel_count; col ++) {
- if (!(src_scan[(src_left + col) / 8] & (1 << (7 - (src_left + col) % 8)))) {
- dest_scan += Bpp;
- continue;
- }
- int src_alpha;
- if (clip_scan) {
- src_alpha = mask_alpha * clip_scan[col] / 255;
- } else {
- src_alpha = mask_alpha;
- }
- if (src_alpha == 0) {
- dest_scan += Bpp;
- continue;
- }
- if (blend_type >= FXDIB_BLEND_NONSEPARABLE) {
- int blended_colors[3];
- FX_BYTE src_scan[3];
- FX_BYTE dest_scan_o[3];
- src_scan[0] = src_b;
- src_scan[1] = src_g;
- src_scan[2] = src_r;
- dest_scan_o[0] = dest_scan[2];
- dest_scan_o[1] = dest_scan[1];
- dest_scan_o[2] = dest_scan[0];
- _RGB_Blend(blend_type, src_scan, dest_scan_o, blended_colors);
- dest_scan[2] = FXDIB_ALPHA_MERGE(dest_scan[2], blended_colors[0], src_alpha);
- dest_scan[1] = FXDIB_ALPHA_MERGE(dest_scan[1], blended_colors[1], src_alpha);
- dest_scan[0] = FXDIB_ALPHA_MERGE(dest_scan[0], blended_colors[2], src_alpha);
- } else if (blend_type) {
- int back_color = FX_GAMMA(dest_scan[2]);
- int blended = _BLEND(blend_type, back_color, src_b);
- dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(back_color, blended, src_alpha));
- back_color = FX_GAMMA(dest_scan[1]);
- blended = _BLEND(blend_type, back_color, src_g);
- dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(back_color, blended, src_alpha));
- back_color = FX_GAMMA(dest_scan[0]);
- blended = _BLEND(blend_type, back_color, src_r);
- dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(back_color, blended, src_alpha));
- } else {
- dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), src_b, src_alpha));
- dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), src_g, src_alpha));
- dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), src_r, src_alpha));
- }
- dest_scan += Bpp;
- }
-}
-inline FX_BOOL _ScanlineCompositor_InitSourceMask(FXDIB_Format dest_format, int alpha_flag, FX_DWORD mask_color, int& mask_alpha,
- int& mask_red, int& mask_green, int& mask_blue, int& mask_black,
- void* icc_module, void* pIccTransform)
-{
- ICodec_IccModule* pIccModule = (ICodec_IccModule*)icc_module;
- if (alpha_flag >> 8) {
- mask_alpha = alpha_flag & 0xff;
- mask_red = FXSYS_GetCValue(mask_color);
- mask_green = FXSYS_GetMValue(mask_color);
- mask_blue = FXSYS_GetYValue(mask_color);
- mask_black = FXSYS_GetKValue(mask_color);
- } else {
- mask_alpha = FXARGB_A(mask_color);
- mask_red = FXARGB_R(mask_color);
- mask_green = FXARGB_G(mask_color);
- mask_blue = FXARGB_B(mask_color);
- }
- if (dest_format == FXDIB_8bppMask) {
- return TRUE;
- }
- if ((dest_format & 0xff) == 8) {
- if (pIccTransform) {
- mask_color = (alpha_flag >> 8) ? FXCMYK_TODIB(mask_color) : FXARGB_TODIB(mask_color);
- FX_LPBYTE gray_p = (FX_LPBYTE)&mask_color;
- pIccModule->TranslateScanline(pIccTransform, gray_p, gray_p, 1);
- mask_red = dest_format & 0x0400 ? FX_CCOLOR(gray_p[0]) : gray_p[0];
- } else {
- if (alpha_flag >> 8) {
- FX_BYTE r, g, b;
- AdobeCMYK_to_sRGB1(mask_red, mask_green, mask_blue, mask_black,
- r, g, b);
- mask_red = FXRGB2GRAY(r, g, b);
- } else {
- mask_red = FXRGB2GRAY(mask_red, mask_green, mask_blue);
- }
- if (dest_format & 0x0400) {
- mask_red = FX_CCOLOR(mask_red);
- }
- }
- } else {
- FX_LPBYTE mask_color_p = (FX_LPBYTE)&mask_color;
- mask_color = (alpha_flag >> 8) ? FXCMYK_TODIB(mask_color) : FXARGB_TODIB(mask_color);
- if (pIccTransform) {
- pIccModule->TranslateScanline(pIccTransform, mask_color_p, mask_color_p, 1);
- mask_red = mask_color_p[2];
- mask_green = mask_color_p[1];
- mask_blue = mask_color_p[0];
- } else if (alpha_flag >> 8) {
- AdobeCMYK_to_sRGB1(mask_color_p[0], mask_color_p[1], mask_color_p[2], mask_color_p[3],
- mask_color_p[2], mask_color_p[1], mask_color_p[0]);
- mask_red = mask_color_p[2];
- mask_green = mask_color_p[1];
- mask_blue = mask_color_p[0];
- }
- }
- return TRUE;
-}
-inline void _ScanlineCompositor_InitSourcePalette(FXDIB_Format src_format, FXDIB_Format dest_format,
- FX_DWORD*& pDestPalette, FX_DWORD* pSrcPalette,
- void* icc_module, void* pIccTransform)
-{
- ICodec_IccModule* pIccModule = (ICodec_IccModule*)icc_module;
- FX_BOOL isSrcCmyk = src_format & 0x0400 ? TRUE : FALSE;
- FX_BOOL isDstCmyk = dest_format & 0x0400 ? TRUE : FALSE;
- pDestPalette = NULL;
- if (pIccTransform) {
- if (pSrcPalette) {
- if ((dest_format & 0xff) == 8) {
- int pal_count = 1 << (src_format & 0xff);
- FX_LPBYTE gray_pal = FX_Alloc(FX_BYTE, pal_count);
- if (!gray_pal) {
- return;
- }
- pDestPalette = (FX_DWORD*)gray_pal;
- for (int i = 0; i < pal_count; i ++) {
- FX_DWORD color = isSrcCmyk ? FXCMYK_TODIB(pSrcPalette[i]) : FXARGB_TODIB(pSrcPalette[i]);
- pIccModule->TranslateScanline(pIccTransform, gray_pal, (FX_LPCBYTE)&color, 1);
- gray_pal ++;
- }
- } else {
- int palsize = 1 << (src_format & 0xff);
- pDestPalette = FX_Alloc(FX_DWORD, palsize);
- if (!pDestPalette) {
- return;
- }
- for (int i = 0; i < palsize; i ++) {
- FX_DWORD color = isSrcCmyk ? FXCMYK_TODIB(pSrcPalette[i]) : FXARGB_TODIB(pSrcPalette[i]);
- pIccModule->TranslateScanline(pIccTransform, (FX_LPBYTE)&color, (FX_LPCBYTE)&color, 1);
- pDestPalette[i] = isDstCmyk ? FXCMYK_TODIB(color) : FXARGB_TODIB(color);
- }
- }
- } else {
- int pal_count = 1 << (src_format & 0xff);
- FX_LPBYTE gray_pal = FX_Alloc(FX_BYTE, pal_count);
- if (!gray_pal) {
- return;
- }
- if (pal_count == 2) {
- gray_pal[0] = 0;
- gray_pal[1] = 255;
- } else {
- for (int i = 0; i < pal_count; i++) {
- gray_pal[i] = i;
- }
- }
- if ((dest_format & 0xff) == 8) {
- pIccModule->TranslateScanline(pIccTransform, gray_pal, gray_pal, pal_count);
- pDestPalette = (FX_DWORD*)gray_pal;
- } else {
- pDestPalette = FX_Alloc(FX_DWORD, pal_count);
- if (!pDestPalette) {
- FX_Free(gray_pal);
- return;
- }
- for (int i = 0; i < pal_count; i ++) {
- pIccModule->TranslateScanline(pIccTransform, (FX_LPBYTE)&pDestPalette[i], &gray_pal[i], 1);
- pDestPalette[i] = isDstCmyk ? FXCMYK_TODIB(pDestPalette[i]) : FXARGB_TODIB(pDestPalette[i]);
- }
- FX_Free(gray_pal);
- }
- }
- } else {
- if (pSrcPalette) {
- if ((dest_format & 0xff) == 8) {
- int pal_count = 1 << (src_format & 0xff);
- FX_LPBYTE gray_pal = FX_Alloc(FX_BYTE, pal_count);
- if (!gray_pal) {
- return;
- }
- pDestPalette = (FX_DWORD*)gray_pal;
- if (isSrcCmyk) {
- for (int i = 0; i < pal_count; i ++) {
- FX_CMYK cmyk = pSrcPalette[i];
- FX_BYTE r, g, b;
- AdobeCMYK_to_sRGB1(FXSYS_GetCValue(cmyk), FXSYS_GetMValue(cmyk), FXSYS_GetYValue(cmyk), FXSYS_GetKValue(cmyk),
- r, g, b);
- *gray_pal ++ = FXRGB2GRAY(r, g, b);
- }
- } else
- for (int i = 0; i < pal_count; i ++) {
- FX_ARGB argb = pSrcPalette[i];
- *gray_pal ++ = FXRGB2GRAY(FXARGB_R(argb), FXARGB_G(argb), FXARGB_B(argb));
- }
- } else {
- int palsize = 1 << (src_format & 0xff);
- pDestPalette = FX_Alloc(FX_DWORD, palsize);
- if (!pDestPalette) {
- return;
- }
- if (isDstCmyk == isSrcCmyk) {
- FXSYS_memcpy32(pDestPalette, pSrcPalette, palsize * sizeof(FX_DWORD));
- } else {
- for (int i = 0; i < palsize; i ++) {
- FX_CMYK cmyk = pSrcPalette[i];
- FX_BYTE r, g, b;
- AdobeCMYK_to_sRGB1(FXSYS_GetCValue(cmyk), FXSYS_GetMValue(cmyk), FXSYS_GetYValue(cmyk), FXSYS_GetKValue(cmyk),
- r, g, b);
- pDestPalette[i] = FXARGB_MAKE(0xff, r, g, b);
- }
- }
- }
- } else {
- if ((dest_format & 0xff) == 8) {
- int pal_count = 1 << (src_format & 0xff);
- FX_LPBYTE gray_pal = FX_Alloc(FX_BYTE, pal_count);
- if (!gray_pal) {
- return;
- }
- if (pal_count == 2) {
- gray_pal[0] = 0;
- gray_pal[1] = 255;
- } else {
- for (int i = 0; i < pal_count; i++) {
- gray_pal[i] = i;
- }
- }
- pDestPalette = (FX_DWORD*)gray_pal;
- } else {
- int palsize = 1 << (src_format & 0xff);
- pDestPalette = FX_Alloc(FX_DWORD, palsize);
- if (!pDestPalette) {
- return;
- }
- if (palsize == 2) {
- pDestPalette[0] = isSrcCmyk ? 255 : 0xff000000;
- pDestPalette[1] = isSrcCmyk ? 0 : 0xffffffff;
- } else {
- for (int i = 0; i < palsize; i++) {
- pDestPalette[i] = isSrcCmyk ? FX_CCOLOR(i) : (i * 0x10101);
- }
- }
- if (isSrcCmyk != isDstCmyk) {
- for (int i = 0; i < palsize; i ++) {
- FX_CMYK cmyk = pDestPalette[i];
- FX_BYTE r, g, b;
- AdobeCMYK_to_sRGB1(FXSYS_GetCValue(cmyk), FXSYS_GetMValue(cmyk), FXSYS_GetYValue(cmyk), FXSYS_GetKValue(cmyk),
- r, g, b);
- pDestPalette[i] = FXARGB_MAKE(0xff, r, g, b);
- }
- }
- }
- }
- }
-}
-CFX_ScanlineCompositor::CFX_ScanlineCompositor()
-{
- m_pSrcPalette = NULL;
- m_pCacheScanline = NULL;
- m_CacheSize = 0;
- m_bRgbByteOrder = FALSE;
- m_BlendType = FXDIB_BLEND_NORMAL;
-}
-CFX_ScanlineCompositor::~CFX_ScanlineCompositor()
-{
- if (m_pSrcPalette) {
- FX_Free(m_pSrcPalette);
- }
- if (m_pCacheScanline) {
- FX_Free(m_pCacheScanline);
- }
-}
-FX_BOOL CFX_ScanlineCompositor::Init(FXDIB_Format dest_format, FXDIB_Format src_format, FX_INT32 width, FX_DWORD* pSrcPalette,
- FX_DWORD mask_color, int blend_type, FX_BOOL bClip, FX_BOOL bRgbByteOrder, int alpha_flag, void* pIccTransform)
-{
- m_SrcFormat = src_format;
- m_DestFormat = dest_format;
- m_BlendType = blend_type;
- m_bRgbByteOrder = bRgbByteOrder;
- ICodec_IccModule* pIccModule = NULL;
- if (CFX_GEModule::Get()->GetCodecModule()) {
- pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
- }
- if (pIccModule == NULL) {
- pIccTransform = NULL;
- }
- m_pIccTransform = pIccTransform;
- if ((dest_format & 0xff) == 1) {
- return FALSE;
- }
- if (m_SrcFormat == FXDIB_1bppMask || m_SrcFormat == FXDIB_8bppMask) {
- return _ScanlineCompositor_InitSourceMask(dest_format, alpha_flag, mask_color,
- m_MaskAlpha, m_MaskRed, m_MaskGreen, m_MaskBlue, m_MaskBlack,
- pIccModule, pIccTransform);
- }
- if (pIccTransform == NULL && (~src_format & 0x0400) && (dest_format & 0x0400)) {
- return FALSE;
- }
- if ((m_SrcFormat & 0xff) <= 8) {
- if (dest_format == FXDIB_8bppMask) {
- return TRUE;
- }
- _ScanlineCompositor_InitSourcePalette(src_format, dest_format, m_pSrcPalette, pSrcPalette,
- pIccModule, pIccTransform);
- m_Transparency = (dest_format == FXDIB_Argb ? 1 : 0)
- + (dest_format & 0x0200 ? 2 : 0)
- + (dest_format & 0x0400 ? 4 : 0)
- + ((src_format & 0xff) == 1 ? 8 : 0);
- return TRUE;
- }
- m_Transparency = (src_format & 0x0200 ? 0 : 1)
- + (dest_format & 0x0200 ? 0 : 2)
- + (blend_type == FXDIB_BLEND_NORMAL ? 4 : 0)
- + (bClip ? 8 : 0)
- + (src_format & 0x0400 ? 16 : 0)
- + (dest_format & 0x0400 ? 32 : 0)
- + (pIccTransform ? 64 : 0);
- return TRUE;
-}
-void CFX_ScanlineCompositor::CompositeRgbBitmapLine(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, FX_LPCBYTE clip_scan,
- FX_LPCBYTE src_extra_alpha, FX_LPBYTE dst_extra_alpha)
-{
- int src_Bpp = (m_SrcFormat & 0xff) >> 3;
- int dest_Bpp = (m_DestFormat & 0xff) >> 3;
- int dest_Size = width * dest_Bpp + 4;
- if (m_bRgbByteOrder) {
- switch (m_Transparency) {
- case 0:
- case 4:
- case 8:
- case 12:
- _CompositeRow_Argb2Argb_RgbByteOrder(dest_scan, src_scan, width, m_BlendType, clip_scan);
- break;
- case 1:
- _CompositeRow_Rgb2Argb_Blend_NoClip_RgbByteOrder(dest_scan, src_scan, width, m_BlendType, src_Bpp);
- break;
- case 2:
- case 10:
- _CompositeRow_Argb2Rgb_Blend_RgbByteOrder(dest_scan, src_scan, width, m_BlendType, dest_Bpp, clip_scan);
- break;
- case 3:
- _CompositeRow_Rgb2Rgb_Blend_NoClip_RgbByteOrder(dest_scan, src_scan, width, m_BlendType, dest_Bpp, src_Bpp);
- break;
- case 5:
- _CompositeRow_Rgb2Argb_NoBlend_NoClip_RgbByteOrder(dest_scan, src_scan, width, src_Bpp);
- break;
- case 6:
- case 14:
- _CompositeRow_Argb2Rgb_NoBlend_RgbByteOrder(dest_scan, src_scan, width, dest_Bpp, clip_scan);
- break;
- case 7:
- _CompositeRow_Rgb2Rgb_NoBlend_NoClip_RgbByteOrder(dest_scan, src_scan, width, dest_Bpp, src_Bpp);
- break;
- case 9:
- _CompositeRow_Rgb2Argb_Blend_Clip_RgbByteOrder(dest_scan, src_scan, width, m_BlendType, src_Bpp, clip_scan);
- break;
- case 11:
- _CompositeRow_Rgb2Rgb_Blend_Clip_RgbByteOrder(dest_scan, src_scan, width, m_BlendType, dest_Bpp, src_Bpp, clip_scan);
- break;
- case 13:
- _CompositeRow_Rgb2Argb_NoBlend_Clip_RgbByteOrder(dest_scan, src_scan, width, src_Bpp, clip_scan);
- break;
- case 15:
- _CompositeRow_Rgb2Rgb_NoBlend_Clip_RgbByteOrder(dest_scan, src_scan, width, dest_Bpp, src_Bpp, clip_scan);
- break;
- }
- return;
- }
- if (m_DestFormat == FXDIB_8bppMask) {
- if (m_SrcFormat & 0x0200) {
- if (m_SrcFormat == FXDIB_Argb) {
- _CompositeRow_Argb2Mask(dest_scan, src_scan, width, clip_scan);
- } else {
- _CompositeRow_Rgba2Mask(dest_scan, src_extra_alpha, width, clip_scan);
- }
- } else {
- _CompositeRow_Rgb2Mask(dest_scan, src_scan, width, clip_scan);
- }
- } else if ((m_DestFormat & 0xff) == 8) {
- if (m_DestFormat & 0x0400) {
- for (int i = 0; i < width; i ++) {
- *dest_scan = ~*dest_scan;
- dest_scan++;
- }
- }
- if (m_SrcFormat & 0x0200) {
- if (m_DestFormat & 0x0200) {
- _CompositeRow_Argb2Graya(dest_scan, src_scan, width, m_BlendType, clip_scan, src_extra_alpha, dst_extra_alpha, m_pIccTransform);
- } else {
- _CompositeRow_Argb2Gray(dest_scan, src_scan, width, m_BlendType, clip_scan, src_extra_alpha, m_pIccTransform);
- }
- } else {
- if (m_DestFormat & 0x0200) {
- _CompositeRow_Rgb2Graya(dest_scan, src_scan, src_Bpp, width, m_BlendType, clip_scan, dst_extra_alpha, m_pIccTransform);
- } else {
- _CompositeRow_Rgb2Gray(dest_scan, src_scan, src_Bpp, width, m_BlendType, clip_scan, m_pIccTransform);
- }
- }
- if (m_DestFormat & 0x0400) {
- for (int i = 0; i < width; i ++) {
- *dest_scan = ~*dest_scan;
- dest_scan++;
- }
- }
- } else {
- if (dest_Size > m_CacheSize) {
- m_pCacheScanline = FX_Realloc(FX_BYTE, m_pCacheScanline, dest_Size);
- if (!m_pCacheScanline) {
- return;
- }
- m_CacheSize = dest_Size;
- }
- switch (m_Transparency) {
- case 0:
- case 4:
- case 8:
- case 4+8: {
- _CompositeRow_Argb2Argb(dest_scan, src_scan, width, m_BlendType, clip_scan,
- dst_extra_alpha, src_extra_alpha);
- }
- break;
- case 64:
- case 4+64:
- case 8+64:
- case 4+8+64: {
- _CompositeRow_Argb2Argb_Transform(dest_scan, src_scan, width, m_BlendType, clip_scan,
- dst_extra_alpha, src_extra_alpha, m_pCacheScanline, m_pIccTransform);
- }
- break;
- case 1:
- _CompositeRow_Rgb2Argb_Blend_NoClip(dest_scan, src_scan, width, m_BlendType, src_Bpp,
- dst_extra_alpha);
- break;
- case 1+64:
- _CompositeRow_Rgb2Argb_Blend_NoClip_Transform(dest_scan, src_scan, width, m_BlendType, src_Bpp,
- dst_extra_alpha, m_pCacheScanline, m_pIccTransform);
- break;
- case 1+8:
- _CompositeRow_Rgb2Argb_Blend_Clip(dest_scan, src_scan, width, m_BlendType, src_Bpp, clip_scan,
- dst_extra_alpha);
- break;
- case 1+8+64:
- _CompositeRow_Rgb2Argb_Blend_Clip_Transform(dest_scan, src_scan, width, m_BlendType, src_Bpp, clip_scan,
- dst_extra_alpha, m_pCacheScanline, m_pIccTransform);
- break;
- case 1+4:
- _CompositeRow_Rgb2Argb_NoBlend_NoClip(dest_scan, src_scan, width, src_Bpp,
- dst_extra_alpha);
- break;
- case 1+4+64:
- _CompositeRow_Rgb2Argb_NoBlend_NoClip_Transform(dest_scan, src_scan, width, src_Bpp,
- dst_extra_alpha, m_pCacheScanline, m_pIccTransform);
- break;
- case 1+4+8:
- _CompositeRow_Rgb2Argb_NoBlend_Clip(dest_scan, src_scan, width, src_Bpp, clip_scan,
- dst_extra_alpha);
- break;
- case 1+4+8+64:
- _CompositeRow_Rgb2Argb_NoBlend_Clip_Transform(dest_scan, src_scan, width, src_Bpp, clip_scan,
- dst_extra_alpha, m_pCacheScanline, m_pIccTransform);
- break;
- case 2:
- case 2+8:
- _CompositeRow_Argb2Rgb_Blend(dest_scan, src_scan, width, m_BlendType, dest_Bpp, clip_scan,
- src_extra_alpha);
- break;
- case 2+64:
- case 2+8+64:
- _CompositeRow_Argb2Rgb_Blend_Transform(dest_scan, src_scan, width, m_BlendType, dest_Bpp, clip_scan,
- src_extra_alpha, m_pCacheScanline, m_pIccTransform);
- break;
- case 2+4:
- case 2+4+8:
- _CompositeRow_Argb2Rgb_NoBlend(dest_scan, src_scan, width, dest_Bpp, clip_scan,
- src_extra_alpha);
- break;
- case 2+4+64:
- case 2+4+8+64:
- _CompositeRow_Argb2Rgb_NoBlend_Transform(dest_scan, src_scan, width, dest_Bpp, clip_scan,
- src_extra_alpha, m_pCacheScanline, m_pIccTransform);
- break;
- case 1+2:
- _CompositeRow_Rgb2Rgb_Blend_NoClip(dest_scan, src_scan, width, m_BlendType, dest_Bpp, src_Bpp);
- break;
- case 1+2+64:
- _CompositeRow_Rgb2Rgb_Blend_NoClip_Transform(dest_scan, src_scan, width, m_BlendType, dest_Bpp, src_Bpp,
- m_pCacheScanline, m_pIccTransform);
- break;
- case 1+2+8:
- _CompositeRow_Rgb2Rgb_Blend_Clip(dest_scan, src_scan, width, m_BlendType, dest_Bpp, src_Bpp, clip_scan);
- break;
- case 1+2+8+64:
- _CompositeRow_Rgb2Rgb_Blend_Clip_Transform(dest_scan, src_scan, width, m_BlendType, dest_Bpp, src_Bpp, clip_scan,
- m_pCacheScanline, m_pIccTransform);
- break;
- case 1+2+4:
- _CompositeRow_Rgb2Rgb_NoBlend_NoClip(dest_scan, src_scan, width, dest_Bpp, src_Bpp);
- break;
- case 1+2+4+64:
- _CompositeRow_Rgb2Rgb_NoBlend_NoClip_Transform(dest_scan, src_scan, width, dest_Bpp, src_Bpp,
- m_pCacheScanline, m_pIccTransform);
- break;
- case 1+2+4+8:
- _CompositeRow_Rgb2Rgb_NoBlend_Clip(dest_scan, src_scan, width, dest_Bpp, src_Bpp, clip_scan);
- break;
- case 1+2+4+8+64:
- _CompositeRow_Rgb2Rgb_NoBlend_Clip_Transform(dest_scan, src_scan, width, dest_Bpp, src_Bpp, clip_scan,
- m_pCacheScanline, m_pIccTransform);
- break;
- }
- }
-}
-void CFX_ScanlineCompositor::CompositePalBitmapLine(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int src_left, int width, FX_LPCBYTE clip_scan,
- FX_LPCBYTE src_extra_alpha, FX_LPBYTE dst_extra_alpha)
-{
- if (m_bRgbByteOrder) {
- if (m_SrcFormat == FXDIB_1bppRgb) {
- if (m_DestFormat == FXDIB_8bppRgb) {
- return;
- } else if(m_DestFormat == FXDIB_Argb) {
- _CompositeRow_1bppRgb2Argb_NoBlend_RgbByteOrder(dest_scan, src_scan, src_left, width, m_pSrcPalette, clip_scan);
- } else {
- _CompositeRow_1bppRgb2Rgb_NoBlend_RgbByteOrder(dest_scan, src_scan, src_left, m_pSrcPalette, width, (m_DestFormat & 0xff) >> 3, clip_scan);
- }
- } else {
- if (m_DestFormat == FXDIB_8bppRgb) {
- return;
- } else if (m_DestFormat == FXDIB_Argb) {
- _CompositeRow_8bppRgb2Argb_NoBlend_RgbByteOrder(dest_scan, src_scan, width, m_pSrcPalette, clip_scan);
- } else {
- _CompositeRow_8bppRgb2Rgb_NoBlend_RgbByteOrder(dest_scan, src_scan, m_pSrcPalette, width, (m_DestFormat & 0xff) >> 3, clip_scan);
- }
- }
- return;
- }
- if (m_DestFormat == FXDIB_8bppMask) {
- _CompositeRow_Rgb2Mask(dest_scan, src_scan, width, clip_scan);
- return;
- } else if ((m_DestFormat & 0xff) == 8) {
- if (m_Transparency & 8) {
- if (m_DestFormat & 0x0200) {
- _CompositeRow_1bppPal2Graya(dest_scan, src_scan, src_left, (FX_LPCBYTE)m_pSrcPalette, width, m_BlendType, clip_scan, dst_extra_alpha);
- } else {
- _CompositeRow_1bppPal2Gray(dest_scan, src_scan, src_left, (FX_LPCBYTE)m_pSrcPalette, width, m_BlendType, clip_scan);
- }
- } else {
- if (m_DestFormat & 0x0200)
- _CompositeRow_8bppPal2Graya(dest_scan, src_scan, (FX_LPCBYTE)m_pSrcPalette, width, m_BlendType, clip_scan,
- dst_extra_alpha, src_extra_alpha);
- else
- _CompositeRow_8bppPal2Gray(dest_scan, src_scan, (FX_LPCBYTE)m_pSrcPalette, width, m_BlendType, clip_scan,
- src_extra_alpha);
- }
- } else {
- switch (m_Transparency) {
- case 1+2:
- _CompositeRow_8bppRgb2Argb_NoBlend(dest_scan, src_scan, width, m_pSrcPalette, clip_scan,
- src_extra_alpha);
- break;
- case 1+2+8:
- _CompositeRow_1bppRgb2Argb_NoBlend(dest_scan, src_scan, src_left, width, m_pSrcPalette, clip_scan);
- break;
- case 0:
- _CompositeRow_8bppRgb2Rgb_NoBlend(dest_scan, src_scan, m_pSrcPalette, width, (m_DestFormat & 0xff) >> 3, clip_scan,
- src_extra_alpha);
- break;
- case 0+8:
- _CompositeRow_1bppRgb2Rgb_NoBlend(dest_scan, src_scan, src_left, m_pSrcPalette, width, (m_DestFormat & 0xff) >> 3, clip_scan);
- break;
- case 0+2:
- _CompositeRow_8bppRgb2Rgb_NoBlend(dest_scan, src_scan, m_pSrcPalette, width, (m_DestFormat & 0xff) >> 3, clip_scan,
- src_extra_alpha);
- break;
- case 0+2+8:
- _CompositeRow_1bppRgb2Rgba_NoBlend(dest_scan, src_scan, src_left, width, m_pSrcPalette, clip_scan,
- dst_extra_alpha);
- break;
- break;
- }
- }
-}
-void CFX_ScanlineCompositor::CompositeByteMaskLine(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, FX_LPCBYTE clip_scan,
- FX_LPBYTE dst_extra_alpha)
-{
- if (m_DestFormat == FXDIB_8bppMask) {
- _CompositeRow_ByteMask2Mask(dest_scan, src_scan, m_MaskAlpha, width, clip_scan);
- } else if ((m_DestFormat & 0xff) == 8) {
- if (m_DestFormat & 0x0200) {
- _CompositeRow_ByteMask2Graya(dest_scan, src_scan, m_MaskAlpha, m_MaskRed, width, clip_scan, dst_extra_alpha);
- } else {
- _CompositeRow_ByteMask2Gray(dest_scan, src_scan, m_MaskAlpha, m_MaskRed, width, clip_scan);
- }
- } else if (m_bRgbByteOrder) {
- if (m_DestFormat == FXDIB_Argb)
- _CompositeRow_ByteMask2Argb_RgbByteOrder(dest_scan, src_scan, m_MaskAlpha, m_MaskRed, m_MaskGreen, m_MaskBlue,
- width, m_BlendType, clip_scan);
- else
- _CompositeRow_ByteMask2Rgb_RgbByteOrder(dest_scan, src_scan, m_MaskAlpha, m_MaskRed, m_MaskGreen, m_MaskBlue,
- width, m_BlendType, (m_DestFormat & 0xff) >> 3, clip_scan);
- return;
- } else if (m_DestFormat == FXDIB_Argb)
- _CompositeRow_ByteMask2Argb(dest_scan, src_scan, m_MaskAlpha, m_MaskRed, m_MaskGreen, m_MaskBlue,
- width, m_BlendType, clip_scan);
- else if (m_DestFormat == FXDIB_Rgb || m_DestFormat == FXDIB_Rgb32)
- _CompositeRow_ByteMask2Rgb(dest_scan, src_scan, m_MaskAlpha, m_MaskRed, m_MaskGreen, m_MaskBlue,
- width, m_BlendType, (m_DestFormat & 0xff) >> 3, clip_scan);
- else if (m_DestFormat == FXDIB_Rgba)
- _CompositeRow_ByteMask2Rgba(dest_scan, src_scan, m_MaskAlpha, m_MaskRed, m_MaskGreen, m_MaskBlue,
- width, m_BlendType, clip_scan, dst_extra_alpha);
-}
-void CFX_ScanlineCompositor::CompositeBitMaskLine(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int src_left, int width, FX_LPCBYTE clip_scan,
- FX_LPBYTE dst_extra_alpha)
-{
- if (m_DestFormat == FXDIB_8bppMask) {
- _CompositeRow_BitMask2Mask(dest_scan, src_scan, m_MaskAlpha, src_left, width, clip_scan);
- } else if ((m_DestFormat & 0xff) == 8) {
- if (m_DestFormat & 0x0200)
- _CompositeRow_BitMask2Graya(dest_scan, src_scan, m_MaskAlpha, m_MaskRed, src_left, width, clip_scan,
- dst_extra_alpha);
- else {
- _CompositeRow_BitMask2Gray(dest_scan, src_scan, m_MaskAlpha, m_MaskRed, src_left, width, clip_scan);
- }
- } else if (m_bRgbByteOrder) {
- if (m_DestFormat == FXDIB_Argb)
- _CompositeRow_BitMask2Argb_RgbByteOrder(dest_scan, src_scan, m_MaskAlpha, m_MaskRed, m_MaskGreen, m_MaskBlue,
- src_left, width, m_BlendType, clip_scan);
- else
- _CompositeRow_BitMask2Rgb_RgbByteOrder(dest_scan, src_scan, m_MaskAlpha, m_MaskRed, m_MaskGreen, m_MaskBlue,
- src_left, width, m_BlendType, (m_DestFormat & 0xff) >> 3, clip_scan);
- return;
- } else if (m_DestFormat == FXDIB_Argb)
- _CompositeRow_BitMask2Argb(dest_scan, src_scan, m_MaskAlpha, m_MaskRed, m_MaskGreen, m_MaskBlue,
- src_left, width, m_BlendType, clip_scan);
- else if (m_DestFormat == FXDIB_Rgb || m_DestFormat == FXDIB_Rgb32)
- _CompositeRow_BitMask2Rgb(dest_scan, src_scan, m_MaskAlpha, m_MaskRed, m_MaskGreen, m_MaskBlue,
- src_left, width, m_BlendType, (m_DestFormat & 0xff) >> 3, clip_scan);
-}
-FX_BOOL CFX_DIBitmap::CompositeBitmap(int dest_left, int dest_top, int width, int height,
- const CFX_DIBSource* pSrcBitmap, int src_left, int src_top,
- int blend_type, const CFX_ClipRgn* pClipRgn, FX_BOOL bRgbByteOrder, void* pIccTransform)
-{
- if (m_pBuffer == NULL) {
- return FALSE;
- }
- ASSERT(!pSrcBitmap->IsAlphaMask());
- ASSERT(m_bpp >= 8);
- if (pSrcBitmap->IsAlphaMask() || m_bpp < 8) {
- return FALSE;
- }
- GetOverlapRect(dest_left, dest_top, width, height, pSrcBitmap->GetWidth(), pSrcBitmap->GetHeight(),
- src_left, src_top, pClipRgn);
- if (width == 0 || height == 0) {
- return TRUE;
- }
- const CFX_DIBitmap* pClipMask = NULL;
- FX_RECT clip_box;
- if (pClipRgn && pClipRgn->GetType() != CFX_ClipRgn::RectI) {
- ASSERT(pClipRgn->GetType() == CFX_ClipRgn::MaskF);
- pClipMask = pClipRgn->GetMask();
- clip_box = pClipRgn->GetBox();
- }
- CFX_ScanlineCompositor compositor;
- if (!compositor.Init(GetFormat(), pSrcBitmap->GetFormat(), width, pSrcBitmap->GetPalette(), 0, blend_type,
- pClipMask != NULL, bRgbByteOrder, 0, pIccTransform)) {
- return FALSE;
- }
- int dest_Bpp = m_bpp / 8;
- int src_Bpp = pSrcBitmap->GetBPP() / 8;
- FX_BOOL bRgb = FALSE;
- FX_BOOL bCmyk = FALSE;
- if (src_Bpp > 1) {
- if (pSrcBitmap->IsCmykImage()) {
- bCmyk = TRUE;
- } else {
- bRgb = TRUE;
- }
- }
- CFX_DIBitmap* pSrcAlphaMask = pSrcBitmap->m_pAlphaMask;
- for (int row = 0; row < height; row ++) {
- FX_LPBYTE dest_scan = m_pBuffer + (dest_top + row) * m_Pitch + dest_left * dest_Bpp;
- FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left * src_Bpp;
- FX_LPCBYTE src_scan_extra_alpha = pSrcAlphaMask ? pSrcAlphaMask->GetScanline(src_top + row) + src_left : NULL;
- FX_LPBYTE dst_scan_extra_alpha = m_pAlphaMask ? (FX_LPBYTE)m_pAlphaMask->GetScanline(dest_top + row) + dest_left : NULL;
- FX_LPCBYTE clip_scan = NULL;
- if (pClipMask) {
- clip_scan = pClipMask->m_pBuffer + (dest_top + row - clip_box.top) * pClipMask->m_Pitch + (dest_left - clip_box.left);
- }
- if (bRgb) {
- compositor.CompositeRgbBitmapLine(dest_scan, src_scan, width, clip_scan, src_scan_extra_alpha, dst_scan_extra_alpha);
- } else {
- compositor.CompositePalBitmapLine(dest_scan, src_scan, src_left, width, clip_scan, src_scan_extra_alpha, dst_scan_extra_alpha);
- }
- }
- return TRUE;
-}
-FX_BOOL CFX_DIBitmap::CompositeMask(int dest_left, int dest_top, int width, int height,
- const CFX_DIBSource* pMask, FX_DWORD color, int src_left, int src_top,
- int blend_type, const CFX_ClipRgn* pClipRgn, FX_BOOL bRgbByteOrder, int alpha_flag, void* pIccTransform)
-{
- if (m_pBuffer == NULL) {
- return FALSE;
- }
- ASSERT(pMask->IsAlphaMask());
- ASSERT(m_bpp >= 8);
- if (!pMask->IsAlphaMask() || m_bpp < 8) {
- return FALSE;
- }
- GetOverlapRect(dest_left, dest_top, width, height, pMask->GetWidth(), pMask->GetHeight(), src_left, src_top, pClipRgn);
- if (width == 0 || height == 0) {
- return TRUE;
- }
- int src_alpha = (FX_BYTE)(alpha_flag >> 8) ? (alpha_flag & 0xff) : FXARGB_A(color);
- if (src_alpha == 0) {
- return TRUE;
- }
- const CFX_DIBitmap* pClipMask = NULL;
- FX_RECT clip_box;
- if (pClipRgn && pClipRgn->GetType() != CFX_ClipRgn::RectI) {
- ASSERT(pClipRgn->GetType() == CFX_ClipRgn::MaskF);
- pClipMask = pClipRgn->GetMask();
- clip_box = pClipRgn->GetBox();
- }
- int src_bpp = pMask->GetBPP();
- int Bpp = GetBPP() / 8;
- CFX_ScanlineCompositor compositor;
- if (!compositor.Init(GetFormat(), pMask->GetFormat(), width, NULL, color, blend_type, pClipMask != NULL, bRgbByteOrder, alpha_flag, pIccTransform)) {
- return FALSE;
- }
- for (int row = 0; row < height; row ++) {
- FX_LPBYTE dest_scan = m_pBuffer + (dest_top + row) * m_Pitch + dest_left * Bpp;
- FX_LPCBYTE src_scan = pMask->GetScanline(src_top + row);
- FX_LPBYTE dst_scan_extra_alpha = m_pAlphaMask ? (FX_LPBYTE)m_pAlphaMask->GetScanline(dest_top + row) + dest_left : NULL;
- FX_LPCBYTE clip_scan = NULL;
- if (pClipMask) {
- clip_scan = pClipMask->m_pBuffer + (dest_top + row - clip_box.top) * pClipMask->m_Pitch + (dest_left - clip_box.left);
- }
- if (src_bpp == 1) {
- compositor.CompositeBitMaskLine(dest_scan, src_scan, src_left, width, clip_scan, dst_scan_extra_alpha);
- } else {
- compositor.CompositeByteMaskLine(dest_scan, src_scan + src_left, width, clip_scan, dst_scan_extra_alpha);
- }
- }
- return TRUE;
-}
-FX_BOOL CFX_DIBitmap::CompositeRect(int left, int top, int width, int height, FX_DWORD color, int alpha_flag, void* pIccTransform)
-{
- if (m_pBuffer == NULL) {
- return FALSE;
- }
- int src_alpha = (alpha_flag >> 8) ? (alpha_flag & 0xff) : FXARGB_A(color);
- if (src_alpha == 0) {
- return TRUE;
- }
- FX_RECT rect(left, top, left + width, top + height);
- rect.Intersect(0, 0, m_Width, m_Height);
- if (rect.IsEmpty()) {
- return TRUE;
- }
- width = rect.Width();
- FX_DWORD dst_color;
- if (alpha_flag >> 8) {
- dst_color = FXCMYK_TODIB(color);
- } else {
- dst_color = FXARGB_TODIB(color);
- }
- FX_LPBYTE color_p = (FX_LPBYTE)&dst_color;
- if (m_bpp == 8) {
- FX_BYTE gray = 255;
- if (!IsAlphaMask()) {
- if (pIccTransform && CFX_GEModule::Get()->GetCodecModule() && CFX_GEModule::Get()->GetCodecModule()->GetIccModule()) {
- ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
- pIccModule->TranslateScanline(pIccTransform, &gray, color_p, 1);
- } else {
- if (alpha_flag >> 8) {
- FX_BYTE r, g, b;
- AdobeCMYK_to_sRGB1(color_p[0], color_p[1], color_p[2], color_p[3],
- r, g, b);
- gray = FXRGB2GRAY(r, g, b);
- } else {
- gray = (FX_BYTE)FXRGB2GRAY((int)color_p[2], color_p[1], color_p[0]);
- }
- }
- if (IsCmykImage()) {
- gray = ~gray;
- }
- }
- for (int row = rect.top; row < rect.bottom; row ++) {
- FX_LPBYTE dest_scan = m_pBuffer + row * m_Pitch + rect.left;
- if (src_alpha == 255) {
- FXSYS_memset8(dest_scan, gray, width);
- } else
- for (int col = 0; col < width; col ++) {
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, src_alpha);
- dest_scan ++;
- }
- }
- return TRUE;
- } else if (m_bpp == 1) {
- ASSERT(!IsCmykImage() && (FX_BYTE)(alpha_flag >> 8) == 0);
- int left_shift = rect.left % 8;
- int right_shift = rect.right % 8;
- int width = rect.right / 8 - rect.left / 8;
- int index = 0;
- if (m_pPalette == NULL) {
- index = ((FX_BYTE)color == 0xff) ? 1 : 0;
- } else {
- for (int i = 0; i < 2; i ++)
- if (m_pPalette[i] == color) {
- index = i;
- }
- }
- for (int row = rect.top; row < rect.bottom; row ++) {
- FX_BYTE* dest_scan_top = (FX_BYTE*)GetScanline(row) + rect.left / 8;
- FX_BYTE* dest_scan_top_r = (FX_BYTE*)GetScanline(row) + rect.right / 8;
- FX_BYTE left_flag = *dest_scan_top & (255 << (8 - left_shift));
- FX_BYTE right_flag = *dest_scan_top_r & (255 >> right_shift);
- if (width) {
- FXSYS_memset8(dest_scan_top + 1, index ? 255 : 0, width - 1);
- if (!index) {
- *dest_scan_top &= left_flag;
- *dest_scan_top_r &= right_flag;
- } else {
- *dest_scan_top |= ~left_flag;
- *dest_scan_top_r |= ~right_flag;
- }
- } else {
- if (!index) {
- *dest_scan_top &= left_flag | right_flag;
- } else {
- *dest_scan_top |= ~(left_flag | right_flag);
- }
- }
- }
- return TRUE;
- }
- ASSERT(m_bpp >= 24);
- if (m_bpp < 24) {
- return FALSE;
- }
- if (pIccTransform && CFX_GEModule::Get()->GetCodecModule()) {
- ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
- pIccModule->TranslateScanline(pIccTransform, color_p, color_p, 1);
- } else {
- if (alpha_flag >> 8 && !IsCmykImage())
- AdobeCMYK_to_sRGB1(FXSYS_GetCValue(color), FXSYS_GetMValue(color), FXSYS_GetYValue(color), FXSYS_GetKValue(color),
- color_p[2], color_p[1], color_p[0]);
- else if (!(alpha_flag >> 8) && IsCmykImage()) {
- return FALSE;
- }
- }
- if(!IsCmykImage()) {
- color_p[3] = (FX_BYTE)src_alpha;
- }
- int Bpp = m_bpp / 8;
- FX_BOOL bAlpha = HasAlpha();
- FX_BOOL bArgb = GetFormat() == FXDIB_Argb ? TRUE : FALSE;
- if (src_alpha == 255) {
- for (int row = rect.top; row < rect.bottom; row ++) {
- FX_LPBYTE dest_scan = m_pBuffer + row * m_Pitch + rect.left * Bpp;
- FX_LPBYTE dest_scan_alpha = m_pAlphaMask ? (FX_LPBYTE)m_pAlphaMask->GetScanline(row) + rect.left : NULL;
- if (dest_scan_alpha) {
- FXSYS_memset8(dest_scan_alpha, 0xff, width);
- }
- if (Bpp == 4) {
- FX_DWORD* scan = (FX_DWORD*)dest_scan;
- for (int col = 0; col < width; col ++) {
- *scan ++ = dst_color;
- }
- } else {
- for (int col = 0; col < width; col ++) {
- *dest_scan ++ = color_p[0];
- *dest_scan ++ = color_p[1];
- *dest_scan ++ = color_p[2];
- }
- }
- }
- return TRUE;
- }
- for (int row = rect.top; row < rect.bottom; row ++) {
- FX_LPBYTE dest_scan = m_pBuffer + row * m_Pitch + rect.left * Bpp;
- if (bAlpha) {
- if (bArgb) {
- for (int col = 0; col < width; col ++) {
- FX_BYTE back_alpha = dest_scan[3];
- if (back_alpha == 0) {
- FXARGB_SETDIB(dest_scan, FXARGB_MAKE(src_alpha, color_p[2], color_p[1], color_p[0]));
- dest_scan += 4;
- continue;
- }
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
- int alpha_ratio = src_alpha * 255 / dest_alpha;
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, color_p[0], alpha_ratio);
- dest_scan ++;
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, color_p[1], alpha_ratio);
- dest_scan ++;
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, color_p[2], alpha_ratio);
- dest_scan ++;
- *dest_scan++ = dest_alpha;
- }
- } else {
- FX_LPBYTE dest_scan_alpha = (FX_LPBYTE)m_pAlphaMask->GetScanline(row) + rect.left;
- for (int col = 0; col < width; col ++) {
- FX_BYTE back_alpha = *dest_scan_alpha;
- if (back_alpha == 0) {
- *dest_scan_alpha++ = src_alpha;
- FXSYS_memcpy32(dest_scan, color_p, Bpp);
- dest_scan += Bpp;
- continue;
- }
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
- *dest_scan_alpha ++ = dest_alpha;
- int alpha_ratio = src_alpha * 255 / dest_alpha;
- for(int comps = 0; comps < Bpp; comps ++) {
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, color_p[comps], alpha_ratio);
- dest_scan ++;
- }
- }
- }
- } else {
- for (int col = 0; col < width; col ++) {
- for(int comps = 0; comps < Bpp; comps ++) {
- if (comps == 3) {
- *dest_scan ++ = 255;
- continue;
- }
- *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, color_p[comps], src_alpha);
- dest_scan ++;
- }
- }
- }
- }
- return TRUE;
-}
-CFX_BitmapComposer::CFX_BitmapComposer()
-{
- m_pScanlineV = NULL;
- m_pScanlineAlphaV = NULL;
- m_pClipScanV = NULL;
- m_pAddClipScan = NULL;
- m_bRgbByteOrder = FALSE;
- m_BlendType = FXDIB_BLEND_NORMAL;
-}
-CFX_BitmapComposer::~CFX_BitmapComposer()
-{
- if (m_pScanlineV) {
- FX_Free(m_pScanlineV);
- }
- if (m_pScanlineAlphaV) {
- FX_Free(m_pScanlineAlphaV);
- }
- if (m_pClipScanV) {
- FX_Free(m_pClipScanV);
- }
- if (m_pAddClipScan) {
- FX_Free(m_pAddClipScan);
- }
-}
-void CFX_BitmapComposer::Compose(CFX_DIBitmap* pDest, const CFX_ClipRgn* pClipRgn, int bitmap_alpha,
- FX_DWORD mask_color, FX_RECT& dest_rect, FX_BOOL bVertical,
- FX_BOOL bFlipX, FX_BOOL bFlipY, FX_BOOL bRgbByteOrder,
- int alpha_flag, void* pIccTransform, int blend_type)
-{
- m_pBitmap = pDest;
- m_pClipRgn = pClipRgn;
- m_DestLeft = dest_rect.left;
- m_DestTop = dest_rect.top;
- m_DestWidth = dest_rect.Width();
- m_DestHeight = dest_rect.Height();
- m_BitmapAlpha = bitmap_alpha;
- m_MaskColor = mask_color;
- m_pClipMask = NULL;
- if (pClipRgn && pClipRgn->GetType() != CFX_ClipRgn::RectI) {
- m_pClipMask = pClipRgn->GetMask();
- }
- m_bVertical = bVertical;
- m_bFlipX = bFlipX;
- m_bFlipY = bFlipY;
- m_AlphaFlag = alpha_flag;
- m_pIccTransform = pIccTransform;
- m_bRgbByteOrder = bRgbByteOrder;
- m_BlendType = blend_type;
-}
-FX_BOOL CFX_BitmapComposer::SetInfo(int width, int height, FXDIB_Format src_format, FX_DWORD* pSrcPalette)
-{
- m_SrcFormat = src_format;
- if (!m_Compositor.Init(m_pBitmap->GetFormat(), src_format, width, pSrcPalette, m_MaskColor, FXDIB_BLEND_NORMAL,
- m_pClipMask != NULL || (m_BitmapAlpha < 255), m_bRgbByteOrder, m_AlphaFlag, m_pIccTransform)) {
- return FALSE;
- }
- if (m_bVertical) {
- m_pScanlineV = FX_Alloc(FX_BYTE, m_pBitmap->GetBPP() / 8 * width + 4);
- if (!m_pScanlineV) {
- return FALSE;
- }
- m_pClipScanV = FX_Alloc(FX_BYTE, m_pBitmap->GetHeight());
- if (!m_pClipScanV) {
- return FALSE;
- }
- if (m_pBitmap->m_pAlphaMask) {
- m_pScanlineAlphaV = FX_Alloc(FX_BYTE, width + 4);
- if (!m_pScanlineAlphaV) {
- return FALSE;
- }
- }
- }
- if (m_BitmapAlpha < 255) {
- m_pAddClipScan = FX_Alloc(FX_BYTE, m_bVertical ? m_pBitmap->GetHeight() : m_pBitmap->GetWidth());
- if (!m_pAddClipScan) {
- return FALSE;
- }
- }
- return TRUE;
-}
-void CFX_BitmapComposer::DoCompose(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int dest_width, FX_LPCBYTE clip_scan,
- FX_LPCBYTE src_extra_alpha, FX_LPBYTE dst_extra_alpha)
-{
- if (m_BitmapAlpha < 255) {
- if (clip_scan) {
- for (int i = 0; i < dest_width; i ++) {
- m_pAddClipScan[i] = clip_scan[i] * m_BitmapAlpha / 255;
- }
- } else {
- FXSYS_memset8(m_pAddClipScan, m_BitmapAlpha, dest_width);
- }
- clip_scan = m_pAddClipScan;
- }
- if (m_SrcFormat == FXDIB_8bppMask) {
- m_Compositor.CompositeByteMaskLine(dest_scan, src_scan, dest_width, clip_scan, dst_extra_alpha);
- } else if ((m_SrcFormat & 0xff) == 8) {
- m_Compositor.CompositePalBitmapLine(dest_scan, src_scan, 0, dest_width, clip_scan, src_extra_alpha, dst_extra_alpha);
- } else {
- m_Compositor.CompositeRgbBitmapLine(dest_scan, src_scan, dest_width, clip_scan, src_extra_alpha, dst_extra_alpha);
- }
-}
-void CFX_BitmapComposer::ComposeScanline(int line, FX_LPCBYTE scanline, FX_LPCBYTE scan_extra_alpha)
-{
- if (m_bVertical) {
- ComposeScanlineV(line, scanline, scan_extra_alpha);
- return;
- }
- FX_LPCBYTE clip_scan = NULL;
- if (m_pClipMask)
- clip_scan = m_pClipMask->GetBuffer() + (m_DestTop + line - m_pClipRgn->GetBox().top) *
- m_pClipMask->GetPitch() + (m_DestLeft - m_pClipRgn->GetBox().left);
- FX_LPBYTE dest_scan = (FX_LPBYTE)m_pBitmap->GetScanline(line + m_DestTop) +
- m_DestLeft * m_pBitmap->GetBPP() / 8;
- FX_LPBYTE dest_alpha_scan = m_pBitmap->m_pAlphaMask ?
- (FX_LPBYTE)m_pBitmap->m_pAlphaMask->GetScanline(line + m_DestTop) + m_DestLeft : NULL;
- DoCompose(dest_scan, scanline, m_DestWidth, clip_scan, scan_extra_alpha, dest_alpha_scan);
-}
-void CFX_BitmapComposer::ComposeScanlineV(int line, FX_LPCBYTE scanline, FX_LPCBYTE scan_extra_alpha)
-{
- int i;
- int Bpp = m_pBitmap->GetBPP() / 8;
- int dest_pitch = m_pBitmap->GetPitch();
- int dest_alpha_pitch = m_pBitmap->m_pAlphaMask ? m_pBitmap->m_pAlphaMask->GetPitch() : 0;
- int dest_x = m_DestLeft + (m_bFlipX ? (m_DestWidth - line - 1) : line);
- FX_LPBYTE dest_buf = m_pBitmap->GetBuffer() + dest_x * Bpp + m_DestTop * dest_pitch;
- FX_LPBYTE dest_alpha_buf = m_pBitmap->m_pAlphaMask ?
- m_pBitmap->m_pAlphaMask->GetBuffer() + dest_x + m_DestTop * dest_alpha_pitch : NULL;
- if (m_bFlipY) {
- dest_buf += dest_pitch * (m_DestHeight - 1);
- dest_alpha_buf += dest_alpha_pitch * (m_DestHeight - 1);
- }
- int y_step = dest_pitch;
- int y_alpha_step = dest_alpha_pitch;
- if (m_bFlipY) {
- y_step = -y_step;
- y_alpha_step = -y_alpha_step;
- }
- FX_LPBYTE src_scan = m_pScanlineV;
- FX_LPBYTE dest_scan = dest_buf;
- for (i = 0; i < m_DestHeight; i ++) {
- for (int j = 0; j < Bpp; j ++) {
- *src_scan++ = dest_scan[j];
- }
- dest_scan += y_step;
- }
- FX_LPBYTE src_alpha_scan = m_pScanlineAlphaV;
- FX_LPBYTE dest_alpha_scan = dest_alpha_buf;
- if (dest_alpha_scan) {
- for (i = 0; i < m_DestHeight; i ++) {
- *src_alpha_scan++ = *dest_alpha_scan;
- dest_alpha_scan += y_alpha_step;
- }
- }
- FX_LPBYTE clip_scan = NULL;
- if (m_pClipMask) {
- clip_scan = m_pClipScanV;
- int clip_pitch = m_pClipMask->GetPitch();
- FX_LPCBYTE src_clip = m_pClipMask->GetBuffer() + (m_DestTop - m_pClipRgn->GetBox().top) *
- clip_pitch + (dest_x - m_pClipRgn->GetBox().left);
- if (m_bFlipY) {
- src_clip += clip_pitch * (m_DestHeight - 1);
- clip_pitch = -clip_pitch;
- }
- for (i = 0; i < m_DestHeight; i ++) {
- clip_scan[i] = *src_clip;
- src_clip += clip_pitch;
- }
- }
- DoCompose(m_pScanlineV, scanline, m_DestHeight, clip_scan, scan_extra_alpha, m_pScanlineAlphaV);
- src_scan = m_pScanlineV;
- dest_scan = dest_buf;
- for (i = 0; i < m_DestHeight; i ++) {
- for (int j = 0; j < Bpp; j ++) {
- dest_scan[j] = *src_scan++;
- }
- dest_scan += y_step;
- }
- src_alpha_scan = m_pScanlineAlphaV;
- dest_alpha_scan = dest_alpha_buf;
- if (dest_alpha_scan) {
- for (i = 0; i < m_DestHeight; i ++) {
- *dest_alpha_scan = *src_alpha_scan++;
- dest_alpha_scan += y_alpha_step;
- }
- }
-}
+// 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
+
+#include "../../../include/fxge/fx_ge.h"
+#include "../../../include/fxcodec/fx_codec.h"
+#include "dib_int.h"
+const FX_BYTE g_GammaRamp[256] = {
+ 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3,
+ 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7,
+ 8, 8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 12, 12, 12, 13,
+ 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 17, 18, 18, 19, 19, 20,
+ 20, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 27, 27, 28, 29, 29,
+ 30, 30, 31, 32, 32, 33, 34, 35, 35, 36, 37, 37, 38, 39, 40, 41,
+ 41, 42, 43, 44, 45, 45, 46, 47, 48, 49, 50, 51, 51, 52, 53, 54,
+ 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
+ 71, 72, 73, 74, 76, 77, 78, 79, 80, 81, 82, 84, 85, 86, 87, 88,
+ 90, 91, 92, 93, 95, 96, 97, 99, 100, 101, 103, 104, 105, 107, 108, 109,
+ 111, 112, 114, 115, 116, 118, 119, 121, 122, 124, 125, 127, 128, 130, 131, 133,
+ 134, 136, 138, 139, 141, 142, 144, 146, 147, 149, 151, 152, 154, 156, 157, 159,
+ 161, 163, 164, 166, 168, 170, 171, 173, 175, 177, 179, 181, 183, 184, 186, 188,
+ 190, 192, 194, 196, 198, 200, 202, 204, 206, 208, 210, 212, 214, 216, 218, 220,
+ 222, 224, 226, 229, 231, 233, 235, 237, 239, 242, 244, 246, 248, 250, 253, 255,
+};
+const FX_BYTE g_GammaInverse[256] = {
+ 0, 13, 22, 28, 34, 38, 42, 46, 50, 53, 56, 59, 61, 64, 66, 69,
+ 71, 73, 75, 77, 79, 81, 83, 85, 86, 88, 90, 92, 93, 95, 96, 98,
+ 99, 101, 102, 104, 105, 106, 108, 109, 110, 112, 113, 114, 115, 117, 118, 119,
+ 120, 121, 122, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136,
+ 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 148, 149, 150, 151,
+ 152, 153, 154, 155, 155, 156, 157, 158, 159, 159, 160, 161, 162, 163, 163, 164,
+ 165, 166, 167, 167, 168, 169, 170, 170, 171, 172, 173, 173, 174, 175, 175, 176,
+ 177, 178, 178, 179, 180, 180, 181, 182, 182, 183, 184, 185, 185, 186, 187, 187,
+ 188, 189, 189, 190, 190, 191, 192, 192, 193, 194, 194, 195, 196, 196, 197, 197,
+ 198, 199, 199, 200, 200, 201, 202, 202, 203, 203, 204, 205, 205, 206, 206, 207,
+ 208, 208, 209, 209, 210, 210, 211, 212, 212, 213, 213, 214, 214, 215, 215, 216,
+ 216, 217, 218, 218, 219, 219, 220, 220, 221, 221, 222, 222, 223, 223, 224, 224,
+ 225, 226, 226, 227, 227, 228, 228, 229, 229, 230, 230, 231, 231, 232, 232, 233,
+ 233, 234, 234, 235, 235, 236, 236, 237, 237, 238, 238, 238, 239, 239, 240, 240,
+ 241, 241, 242, 242, 243, 243, 244, 244, 245, 245, 246, 246, 246, 247, 247, 248,
+ 248, 249, 249, 250, 250, 251, 251, 251, 252, 252, 253, 253, 254, 254, 255, 255,
+};
+const FX_BYTE _color_sqrt[256] = {
+ 0x00, 0x03, 0x07, 0x0B, 0x0F, 0x12, 0x16, 0x19, 0x1D, 0x20, 0x23, 0x26, 0x29, 0x2C, 0x2F, 0x32,
+ 0x35, 0x37, 0x3A, 0x3C, 0x3F, 0x41, 0x43, 0x46, 0x48, 0x4A, 0x4C, 0x4E, 0x50, 0x52, 0x54, 0x56,
+ 0x57, 0x59, 0x5B, 0x5C, 0x5E, 0x60, 0x61, 0x63, 0x64, 0x65, 0x67, 0x68, 0x69, 0x6B, 0x6C, 0x6D,
+ 0x6E, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E,
+ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E,
+ 0x8F, 0x90, 0x91, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x97, 0x98, 0x99, 0x9A, 0x9B, 0x9C,
+ 0x9C, 0x9D, 0x9E, 0x9F, 0xA0, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA4, 0xA5, 0xA6, 0xA7, 0xA7, 0xA8,
+ 0xA9, 0xAA, 0xAA, 0xAB, 0xAC, 0xAD, 0xAD, 0xAE, 0xAF, 0xB0, 0xB0, 0xB1, 0xB2, 0xB3, 0xB3, 0xB4,
+ 0xB5, 0xB5, 0xB6, 0xB7, 0xB7, 0xB8, 0xB9, 0xBA, 0xBA, 0xBB, 0xBC, 0xBC, 0xBD, 0xBE, 0xBE, 0xBF,
+ 0xC0, 0xC0, 0xC1, 0xC2, 0xC2, 0xC3, 0xC4, 0xC4, 0xC5, 0xC6, 0xC6, 0xC7, 0xC7, 0xC8, 0xC9, 0xC9,
+ 0xCA, 0xCB, 0xCB, 0xCC, 0xCC, 0xCD, 0xCE, 0xCE, 0xCF, 0xD0, 0xD0, 0xD1, 0xD1, 0xD2, 0xD3, 0xD3,
+ 0xD4, 0xD4, 0xD5, 0xD6, 0xD6, 0xD7, 0xD7, 0xD8, 0xD9, 0xD9, 0xDA, 0xDA, 0xDB, 0xDC, 0xDC, 0xDD,
+ 0xDD, 0xDE, 0xDE, 0xDF, 0xE0, 0xE0, 0xE1, 0xE1, 0xE2, 0xE2, 0xE3, 0xE4, 0xE4, 0xE5, 0xE5, 0xE6,
+ 0xE6, 0xE7, 0xE7, 0xE8, 0xE9, 0xE9, 0xEA, 0xEA, 0xEB, 0xEB, 0xEC, 0xEC, 0xED, 0xED, 0xEE, 0xEE,
+ 0xEF, 0xF0, 0xF0, 0xF1, 0xF1, 0xF2, 0xF2, 0xF3, 0xF3, 0xF4, 0xF4, 0xF5, 0xF5, 0xF6, 0xF6, 0xF7,
+ 0xF7, 0xF8, 0xF8, 0xF9, 0xF9, 0xFA, 0xFA, 0xFB, 0xFB, 0xFC, 0xFC, 0xFD, 0xFD, 0xFE, 0xFE, 0xFF
+};
+int _BLEND(int blend_mode, int back_color, int src_color)
+{
+ switch (blend_mode) {
+ case FXDIB_BLEND_NORMAL:
+ return src_color;
+ case FXDIB_BLEND_MULTIPLY:
+ return src_color * back_color / 255;
+ case FXDIB_BLEND_SCREEN:
+ return src_color + back_color - src_color * back_color / 255;
+ case FXDIB_BLEND_OVERLAY:
+ return _BLEND(FXDIB_BLEND_HARDLIGHT, src_color, back_color);
+ case FXDIB_BLEND_DARKEN:
+ return src_color < back_color ? src_color : back_color;
+ case FXDIB_BLEND_LIGHTEN:
+ return src_color > back_color ? src_color : back_color;
+ case FXDIB_BLEND_COLORDODGE: {
+ if (src_color == 255) {
+ return src_color;
+ }
+ int result = back_color * 255 / (255 - src_color);
+ if (result > 255) {
+ return 255;
+ }
+ return result;
+ }
+ case FXDIB_BLEND_COLORBURN: {
+ if (src_color == 0) {
+ return src_color;
+ }
+ int result = (255 - back_color) * 255 / src_color;
+ if (result > 255) {
+ result = 255;
+ }
+ return 255 - result;
+ }
+ case FXDIB_BLEND_HARDLIGHT:
+ if (src_color < 128) {
+ return (src_color * back_color * 2) / 255;
+ }
+ return _BLEND(FXDIB_BLEND_SCREEN, back_color, 2 * src_color - 255);
+ case FXDIB_BLEND_SOFTLIGHT: {
+ if (src_color < 128) {
+ return back_color - (255 - 2 * src_color) * back_color * (255 - back_color) / 255 / 255;
+ }
+ return back_color + (2 * src_color - 255) * (_color_sqrt[back_color] - back_color) / 255;
+ }
+ case FXDIB_BLEND_DIFFERENCE:
+ return back_color < src_color ? src_color - back_color : back_color - src_color;
+ case FXDIB_BLEND_EXCLUSION:
+ return back_color + src_color - 2 * back_color * src_color / 255;
+ }
+ return src_color;
+}
+struct _RGB {
+ int red;
+ int green;
+ int blue;
+};
+static inline int _Lum(_RGB color)
+{
+ return (color.red * 30 + color.green * 59 + color.blue * 11) / 100;
+}
+static _RGB _ClipColor(_RGB color)
+{
+ int l = _Lum(color);
+ int n = color.red;
+ if (color.green < n) {
+ n = color.green;
+ }
+ if (color.blue < n) {
+ n = color.blue;
+ }
+ int x = color.red;
+ if (color.green > x) {
+ x = color.green;
+ }
+ if (color.blue > x) {
+ x = color.blue;
+ }
+ if (n < 0) {
+ color.red = l + ((color.red - l) * l / (l - n));
+ color.green = l + ((color.green - l) * l / (l - n));
+ color.blue = l + ((color.blue - l) * l / (l - n));
+ }
+ if (x > 255) {
+ color.red = l + ((color.red - l) * (255 - l) / (x - l));
+ color.green = l + ((color.green - l) * (255 - l) / (x - l));
+ color.blue = l + ((color.blue - l) * (255 - l) / (x - l));
+ }
+ return color;
+}
+static _RGB _SetLum(_RGB color, int l)
+{
+ int d = l - _Lum(color);
+ color.red += d;
+ color.green += d;
+ color.blue += d;
+ return _ClipColor(color);
+}
+static int _Sat(_RGB color)
+{
+ int n = color.red;
+ if (color.green < n) {
+ n = color.green;
+ }
+ if (color.blue < n) {
+ n = color.blue;
+ }
+ int x = color.red;
+ if (color.green > x) {
+ x = color.green;
+ }
+ if (color.blue > x) {
+ x = color.blue;
+ }
+ return x - n;
+}
+static _RGB _SetSat(_RGB color, int s)
+{
+ int* max = &color.red;
+ int* mid = &color.red;
+ int* min = &color.red;
+ if (color.green > *max) {
+ max = &color.green;
+ }
+ if (color.blue > *max) {
+ max = &color.blue;
+ }
+ if (color.green < *min) {
+ min = &color.green;
+ }
+ if (color.blue < *min) {
+ min = &color.blue;
+ }
+ if (*max == *min) {
+ color.red = 0;
+ color.green = 0;
+ color.blue = 0;
+ return color;
+ }
+ if (max == &color.red) {
+ if (min == &color.green) {
+ mid = &color.blue;
+ } else {
+ mid = &color.green;
+ }
+ } else if (max == &color.green) {
+ if (min == &color.red) {
+ mid = &color.blue;
+ } else {
+ mid = &color.red;
+ }
+ } else {
+ if (min == &color.green) {
+ mid = &color.red;
+ } else {
+ mid = &color.green;
+ }
+ }
+ if (*max > *min) {
+ *mid = (*mid - *min) * s / (*max - *min);
+ *max = s;
+ *min = 0;
+ }
+ return color;
+}
+void _RGB_Blend(int blend_mode, FX_LPCBYTE src_scan, FX_BYTE* dest_scan, int results[3])
+{
+ _RGB src, back, result;
+ src.red = src_scan[2];
+ src.green = src_scan[1];
+ src.blue = src_scan[0];
+ back.red = dest_scan[2];
+ back.green = dest_scan[1];
+ back.blue = dest_scan[0];
+ switch (blend_mode) {
+ case FXDIB_BLEND_HUE:
+ result = _SetLum(_SetSat(src, _Sat(back)), _Lum(back));
+ break;
+ case FXDIB_BLEND_SATURATION:
+ result = _SetLum(_SetSat(back, _Sat(src)), _Lum(back));
+ break;
+ case FXDIB_BLEND_COLOR:
+ result = _SetLum(src, _Lum(back));
+ break;
+ case FXDIB_BLEND_LUMINOSITY:
+ result = _SetLum(back, _Lum(src));
+ break;
+ }
+ results[0] = result.blue;
+ results[1] = result.green;
+ results[2] = result.red;
+}
+inline void _CompositeRow_Argb2Mask(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixel_count, FX_LPCBYTE clip_scan)
+{
+ src_scan += 3;
+ for (int col = 0; col < pixel_count; col ++) {
+ int src_alpha = *src_scan;
+ if (clip_scan) {
+ src_alpha = clip_scan[col] * src_alpha / 255;
+ }
+ FX_BYTE back_alpha = *dest_scan;
+ if (!back_alpha) {
+ *dest_scan = src_alpha;
+ } else if (src_alpha) {
+ *dest_scan = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ }
+ dest_scan ++;
+ src_scan += 4;
+ }
+}
+void _CompositeRow_Rgba2Mask(FX_LPBYTE dest_scan, FX_LPCBYTE src_alpha_scan, int pixel_count, FX_LPCBYTE clip_scan)
+{
+ for (int col = 0; col < pixel_count; col ++) {
+ int src_alpha = *src_alpha_scan++;
+ if (clip_scan) {
+ src_alpha = clip_scan[col] * src_alpha / 255;
+ }
+ FX_BYTE back_alpha = *dest_scan;
+ if (!back_alpha) {
+ *dest_scan = src_alpha;
+ } else if (src_alpha) {
+ *dest_scan = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ }
+ dest_scan ++;
+ }
+}
+void _CompositeRow_Rgb2Mask(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, FX_LPCBYTE clip_scan)
+{
+ if (clip_scan) {
+ for (int i = 0; i < width; i ++) {
+ *dest_scan = FXDIB_ALPHA_UNION(*dest_scan, *clip_scan);
+ dest_scan ++;
+ clip_scan ++;
+ }
+ } else {
+ FXSYS_memset8(dest_scan, 0xff, width);
+ }
+}
+void _CompositeRow_Argb2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixel_count, int blend_type, FX_LPCBYTE clip_scan,
+ FX_LPCBYTE src_alpha_scan, FX_LPBYTE dst_alpha_scan, void* pIccTransform)
+{
+ ICodec_IccModule* pIccModule = NULL;
+ if (pIccTransform) {
+ pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
+ }
+ if (blend_type) {
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ int blended_color;
+ if (src_alpha_scan) {
+ for (int col = 0; col < pixel_count; col ++) {
+ FX_BYTE back_alpha = *dst_alpha_scan;
+ if (back_alpha == 0) {
+ int src_alpha = *src_alpha_scan++;
+ if (clip_scan) {
+ src_alpha = clip_scan[col] * src_alpha / 255;
+ }
+ if (src_alpha) {
+ if (pIccTransform) {
+ pIccModule->TranslateScanline(pIccTransform, dest_scan, src_scan, 1);
+ } else {
+ *dest_scan = FXRGB2GRAY(src_scan[2], src_scan[1], *src_scan);
+ }
+ *dst_alpha_scan = src_alpha;
+ }
+ dest_scan ++;
+ dst_alpha_scan ++;
+ src_scan += 3;
+ continue;
+ }
+ FX_BYTE src_alpha = *src_alpha_scan++;
+ if (clip_scan) {
+ src_alpha = clip_scan[col] * src_alpha / 255;
+ }
+ if (src_alpha == 0) {
+ dest_scan ++;
+ dst_alpha_scan ++;
+ src_scan += 3;
+ continue;
+ }
+ *dst_alpha_scan = FXDIB_ALPHA_UNION(back_alpha, src_alpha);
+ int alpha_ratio = src_alpha * 255 / (*dst_alpha_scan);
+ FX_BYTE gray;
+ if (pIccTransform) {
+ pIccModule->TranslateScanline(pIccTransform, &gray, src_scan, 1);
+ } else {
+ gray = FXRGB2GRAY(src_scan[2], src_scan[1], *src_scan);
+ }
+ if (bNonseparableBlend) {
+ blended_color = blend_type == FXDIB_BLEND_LUMINOSITY ? gray : *dest_scan;
+ }
+ gray = bNonseparableBlend ? blended_color : _BLEND(blend_type, *dest_scan, gray);
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, alpha_ratio);
+ dest_scan ++;
+ dst_alpha_scan++;
+ src_scan += 3;
+ }
+ } else
+ for (int col = 0; col < pixel_count; col ++) {
+ FX_BYTE back_alpha = *dst_alpha_scan;
+ if (back_alpha == 0) {
+ int src_alpha = src_scan[3];
+ if (clip_scan) {
+ src_alpha = clip_scan[col] * src_alpha / 255;
+ }
+ if (src_alpha) {
+ if (pIccTransform) {
+ pIccModule->TranslateScanline(pIccTransform, dest_scan, src_scan, 1);
+ } else {
+ *dest_scan = FXRGB2GRAY(src_scan[2], src_scan[1], *src_scan);
+ }
+ *dst_alpha_scan = src_alpha;
+ }
+ dest_scan ++;
+ dst_alpha_scan ++;
+ src_scan += 4;
+ continue;
+ }
+ FX_BYTE src_alpha = src_scan[3];
+ if (clip_scan) {
+ src_alpha = clip_scan[col] * src_alpha / 255;
+ }
+ if (src_alpha == 0) {
+ dest_scan ++;
+ dst_alpha_scan ++;
+ src_scan += 4;
+ continue;
+ }
+ *dst_alpha_scan = FXDIB_ALPHA_UNION(back_alpha, src_alpha);
+ int alpha_ratio = src_alpha * 255 / (*dst_alpha_scan);
+ FX_BYTE gray;
+ if (pIccTransform) {
+ pIccModule->TranslateScanline(pIccTransform, &gray, src_scan, 1);
+ } else {
+ gray = FXRGB2GRAY(src_scan[2], src_scan[1], *src_scan);
+ }
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, alpha_ratio);
+ dest_scan ++;
+ dst_alpha_scan++;
+ src_scan += 4;
+ }
+ return;
+ }
+ if (src_alpha_scan) {
+ for (int col = 0; col < pixel_count; col ++) {
+ FX_BYTE back_alpha = *dst_alpha_scan;
+ if (back_alpha == 0) {
+ int src_alpha = *src_alpha_scan++;
+ if (clip_scan) {
+ src_alpha = clip_scan[col] * src_alpha / 255;
+ }
+ if (src_alpha) {
+ if (pIccTransform) {
+ pIccModule->TranslateScanline(pIccTransform, dest_scan, src_scan, 1);
+ } else {
+ *dest_scan = FXRGB2GRAY(src_scan[2], src_scan[1], *src_scan);
+ }
+ *dst_alpha_scan = src_alpha;
+ }
+ dest_scan ++;
+ dst_alpha_scan ++;
+ src_scan += 3;
+ continue;
+ }
+ FX_BYTE src_alpha = *src_alpha_scan++;
+ if (clip_scan) {
+ src_alpha = clip_scan[col] * src_alpha / 255;
+ }
+ if (src_alpha == 0) {
+ dest_scan ++;
+ dst_alpha_scan ++;
+ src_scan += 3;
+ continue;
+ }
+ *dst_alpha_scan = FXDIB_ALPHA_UNION(back_alpha, src_alpha);
+ int alpha_ratio = src_alpha * 255 / (*dst_alpha_scan);
+ FX_BYTE gray;
+ if (pIccTransform) {
+ pIccModule->TranslateScanline(pIccTransform, &gray, src_scan, 1);
+ } else {
+ gray = FXRGB2GRAY(src_scan[2], src_scan[1], *src_scan);
+ }
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, alpha_ratio);
+ dest_scan ++;
+ dst_alpha_scan++;
+ src_scan += 3;
+ }
+ } else
+ for (int col = 0; col < pixel_count; col ++) {
+ FX_BYTE back_alpha = *dst_alpha_scan;
+ if (back_alpha == 0) {
+ int src_alpha = src_scan[3];
+ if (clip_scan) {
+ src_alpha = clip_scan[col] * src_alpha / 255;
+ }
+ if (src_alpha) {
+ if (pIccTransform) {
+ pIccModule->TranslateScanline(pIccTransform, dest_scan, src_scan, 1);
+ } else {
+ *dest_scan = FXRGB2GRAY(src_scan[2], src_scan[1], *src_scan);
+ }
+ *dst_alpha_scan = src_alpha;
+ }
+ dest_scan ++;
+ dst_alpha_scan ++;
+ src_scan += 4;
+ continue;
+ }
+ FX_BYTE src_alpha = src_scan[3];
+ if (clip_scan) {
+ src_alpha = clip_scan[col] * src_alpha / 255;
+ }
+ if (src_alpha == 0) {
+ dest_scan ++;
+ dst_alpha_scan ++;
+ src_scan += 4;
+ continue;
+ }
+ *dst_alpha_scan = FXDIB_ALPHA_UNION(back_alpha, src_alpha);
+ int alpha_ratio = src_alpha * 255 / (*dst_alpha_scan);
+ FX_BYTE gray;
+ if (pIccTransform) {
+ pIccModule->TranslateScanline(pIccTransform, &gray, src_scan, 1);
+ } else {
+ gray = FXRGB2GRAY(src_scan[2], src_scan[1], *src_scan);
+ }
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, alpha_ratio);
+ dest_scan ++;
+ dst_alpha_scan++;
+ src_scan += 4;
+ }
+}
+inline void _CompositeRow_Argb2Gray(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixel_count,
+ int blend_type, FX_LPCBYTE clip_scan,
+ FX_LPCBYTE src_alpha_scan, void* pIccTransform)
+{
+ ICodec_IccModule* pIccModule = NULL;
+ FX_BYTE gray;
+ if (pIccTransform) {
+ pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
+ }
+ if (blend_type) {
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ int blended_color;
+ if (src_alpha_scan) {
+ for (int col = 0; col < pixel_count; col ++) {
+ int src_alpha = *src_alpha_scan++;
+ if (clip_scan) {
+ src_alpha = clip_scan[col] * src_alpha / 255;
+ }
+ if (src_alpha) {
+ if (pIccTransform) {
+ pIccModule->TranslateScanline(pIccTransform, &gray, src_scan, 1);
+ } else {
+ gray = FXRGB2GRAY(src_scan[2], src_scan[1], *src_scan);
+ }
+ if (bNonseparableBlend) {
+ blended_color = blend_type == FXDIB_BLEND_LUMINOSITY ? gray : *dest_scan;
+ }
+ gray = bNonseparableBlend ? blended_color : _BLEND(blend_type, *dest_scan, gray);
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, src_alpha);
+ }
+ dest_scan ++;
+ src_scan += 3;
+ }
+ } else
+ for (int col = 0; col < pixel_count; col ++) {
+ int src_alpha = src_scan[3];
+ if (clip_scan) {
+ src_alpha = clip_scan[col] * src_alpha / 255;
+ }
+ if (src_alpha) {
+ if (pIccTransform) {
+ pIccModule->TranslateScanline(pIccTransform, &gray, src_scan, 1);
+ } else {
+ gray = FXRGB2GRAY(src_scan[2], src_scan[1], *src_scan);
+ }
+ if (bNonseparableBlend) {
+ blended_color = blend_type == FXDIB_BLEND_LUMINOSITY ? gray : *dest_scan;
+ }
+ gray = bNonseparableBlend ? blended_color : _BLEND(blend_type, *dest_scan, gray);
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, src_alpha);
+ }
+ dest_scan ++;
+ src_scan += 4;
+ }
+ return;
+ }
+ if (src_alpha_scan) {
+ for (int col = 0; col < pixel_count; col ++) {
+ int src_alpha = *src_alpha_scan++;
+ if (clip_scan) {
+ src_alpha = clip_scan[col] * src_alpha / 255;
+ }
+ if (src_alpha) {
+ if (pIccTransform) {
+ pIccModule->TranslateScanline(pIccTransform, &gray, src_scan, 1);
+ } else {
+ gray = FXRGB2GRAY(src_scan[2], src_scan[1], *src_scan);
+ }
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, src_alpha);
+ }
+ dest_scan ++;
+ src_scan += 3;
+ }
+ } else
+ for (int col = 0; col < pixel_count; col ++) {
+ int src_alpha = src_scan[3];
+ if (clip_scan) {
+ src_alpha = clip_scan[col] * src_alpha / 255;
+ }
+ if (src_alpha) {
+ if (pIccTransform) {
+ pIccModule->TranslateScanline(pIccTransform, &gray, src_scan, 1);
+ } else {
+ gray = FXRGB2GRAY(src_scan[2], src_scan[1], *src_scan);
+ }
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, src_alpha);
+ }
+ dest_scan ++;
+ src_scan += 4;
+ }
+}
+inline void _CompositeRow_Rgb2Gray(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int src_Bpp, int pixel_count,
+ int blend_type, FX_LPCBYTE clip_scan,
+ void* pIccTransform)
+{
+ ICodec_IccModule* pIccModule = NULL;
+ FX_BYTE gray;
+ if (pIccTransform) {
+ pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
+ }
+ if (blend_type) {
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ int blended_color;
+ for (int col = 0; col < pixel_count; col ++) {
+ if (pIccTransform) {
+ pIccModule->TranslateScanline(pIccTransform, &gray, src_scan, 1);
+ } else {
+ gray = FXRGB2GRAY(src_scan[2], src_scan[1], *src_scan);
+ }
+ if (bNonseparableBlend) {
+ blended_color = blend_type == FXDIB_BLEND_LUMINOSITY ? gray : *dest_scan;
+ }
+ gray = bNonseparableBlend ? blended_color : _BLEND(blend_type, *dest_scan, gray);
+ if (clip_scan && clip_scan[col] < 255) {
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, clip_scan[col]);
+ } else {
+ *dest_scan = gray;
+ }
+ dest_scan ++;
+ src_scan += src_Bpp;
+ }
+ return;
+ }
+ for (int col = 0; col < pixel_count; col ++) {
+ if (pIccTransform) {
+ pIccModule->TranslateScanline(pIccTransform, &gray, src_scan, 1);
+ } else {
+ gray = FXRGB2GRAY(src_scan[2], src_scan[1], *src_scan);
+ }
+ if (clip_scan && clip_scan[col] < 255) {
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, clip_scan[col]);
+ } else {
+ *dest_scan = gray;
+ }
+ dest_scan ++;
+ src_scan += src_Bpp;
+ }
+}
+void _CompositeRow_Rgb2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int src_Bpp, int pixel_count,
+ int blend_type, FX_LPCBYTE clip_scan,
+ FX_LPBYTE dest_alpha_scan, void* pIccTransform)
+{
+ ICodec_IccModule* pIccModule = NULL;
+ if (pIccTransform) {
+ pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
+ }
+ if (blend_type) {
+ int blended_color;
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ for (int col = 0; col < pixel_count; col ++) {
+ int back_alpha = *dest_alpha_scan;
+ if (back_alpha == 0) {
+ if (pIccTransform) {
+ pIccModule->TranslateScanline(pIccTransform, dest_scan, src_scan, 1);
+ } else {
+ *dest_scan = FXRGB2GRAY(src_scan[2], src_scan[1], *src_scan);
+ }
+ dest_scan ++;
+ dest_alpha_scan++;
+ src_scan += src_Bpp;
+ continue;
+ }
+ int src_alpha = 255;
+ if (clip_scan) {
+ src_alpha = clip_scan[col];
+ }
+ if (src_alpha == 0) {
+ dest_scan ++;
+ dest_alpha_scan ++;
+ src_scan += src_Bpp;
+ continue;
+ }
+ FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ *dest_alpha_scan++ = dest_alpha;
+ int alpha_ratio = src_alpha * 255 / dest_alpha;
+ FX_BYTE gray;
+ if (pIccTransform) {
+ pIccModule->TranslateScanline(pIccTransform, &gray, src_scan, 1);
+ } else {
+ gray = FXRGB2GRAY(src_scan[2], src_scan[1], *src_scan);
+ }
+ if (bNonseparableBlend) {
+ blended_color = blend_type == FXDIB_BLEND_LUMINOSITY ? gray : *dest_scan;
+ }
+ gray = bNonseparableBlend ? blended_color : _BLEND(blend_type, *dest_scan, gray);
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, alpha_ratio);
+ dest_scan ++;
+ src_scan += src_Bpp;
+ }
+ return;
+ }
+ for (int col = 0; col < pixel_count; col ++) {
+ int src_alpha = 255;
+ if (clip_scan) {
+ src_alpha = clip_scan[col];
+ }
+ if (src_alpha == 255) {
+ if (pIccTransform) {
+ pIccModule->TranslateScanline(pIccTransform, dest_scan, src_scan, 1);
+ } else {
+ *dest_scan = FXRGB2GRAY(src_scan[2], src_scan[1], *src_scan);
+ }
+ dest_scan ++;
+ *dest_alpha_scan++ = 255;
+ src_scan += src_Bpp;
+ continue;
+ }
+ if (src_alpha == 0) {
+ dest_scan ++;
+ dest_alpha_scan ++;
+ src_scan += src_Bpp;
+ continue;
+ }
+ int back_alpha = *dest_alpha_scan;
+ FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ *dest_alpha_scan++ = dest_alpha;
+ int alpha_ratio = src_alpha * 255 / dest_alpha;
+ FX_BYTE gray;
+ if (pIccTransform) {
+ pIccModule->TranslateScanline(pIccTransform, &gray, src_scan, 1);
+ } else {
+ gray = FXRGB2GRAY(src_scan[2], src_scan[1], *src_scan);
+ }
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, alpha_ratio);
+ dest_scan ++;
+ src_scan += src_Bpp;
+ }
+}
+void _CompositeRow_Argb2Argb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixel_count, int blend_type, FX_LPCBYTE clip_scan,
+ FX_LPBYTE dest_alpha_scan, FX_LPCBYTE src_alpha_scan)
+{
+ int blended_colors[3];
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ if (dest_alpha_scan == NULL) {
+ if (src_alpha_scan == NULL) {
+ FX_BYTE back_alpha = 0;
+ for (int col = 0; col < pixel_count; col ++) {
+ back_alpha = dest_scan[3];
+ if (back_alpha == 0) {
+ if (clip_scan) {
+ int src_alpha = clip_scan[col] * src_scan[3] / 255;
+ FXARGB_SETDIB(dest_scan, (FXARGB_GETDIB(src_scan) & 0xffffff) | (src_alpha << 24));
+ } else {
+ FXARGB_COPY(dest_scan, src_scan);
+ }
+ dest_scan += 4;
+ src_scan += 4;
+ continue;
+ }
+ FX_BYTE src_alpha;
+ if (clip_scan == NULL) {
+ src_alpha = src_scan[3];
+ } else {
+ src_alpha = clip_scan[col] * src_scan[3] / 255;
+ }
+ if (src_alpha == 0) {
+ dest_scan += 4;
+ src_scan += 4;
+ continue;
+ }
+ FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ dest_scan[3] = dest_alpha;
+ int alpha_ratio = src_alpha * 255 / dest_alpha;
+ if (bNonseparableBlend) {
+ _RGB_Blend(blend_type, src_scan, dest_scan, blended_colors);
+ }
+ for (int color = 0; color < 3; color ++) {
+ if (blend_type) {
+ int blended = bNonseparableBlend ? blended_colors[color] :
+ _BLEND(blend_type, *dest_scan, *src_scan);
+ blended = FXDIB_ALPHA_MERGE(*src_scan, blended, back_alpha);
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended, alpha_ratio);
+ } else {
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, *src_scan, alpha_ratio);
+ }
+ dest_scan ++;
+ src_scan ++;
+ }
+ dest_scan ++;
+ src_scan ++;
+ }
+ } else {
+ for (int col = 0; col < pixel_count; col ++) {
+ FX_BYTE back_alpha = dest_scan[3];
+ if (back_alpha == 0) {
+ if (clip_scan) {
+ int src_alpha = clip_scan[col] * (*src_alpha_scan) / 255;
+ FXARGB_SETDIB(dest_scan, FXARGB_MAKE((src_alpha << 24), src_scan[2], src_scan[1], *src_scan));
+ } else {
+ FXARGB_SETDIB(dest_scan, FXARGB_MAKE((*src_alpha_scan << 24), src_scan[2], src_scan[1], *src_scan));
+ }
+ dest_scan += 4;
+ src_scan += 3;
+ src_alpha_scan ++;
+ continue;
+ }
+ FX_BYTE src_alpha;
+ if (clip_scan == NULL) {
+ src_alpha = *src_alpha_scan ++;
+ } else {
+ src_alpha = clip_scan[col] * (*src_alpha_scan ++) / 255;
+ }
+ if (src_alpha == 0) {
+ dest_scan += 4;
+ src_scan += 3;
+ continue;
+ }
+ FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ dest_scan[3] = dest_alpha;
+ int alpha_ratio = src_alpha * 255 / dest_alpha;
+ if (bNonseparableBlend) {
+ _RGB_Blend(blend_type, src_scan, dest_scan, blended_colors);
+ }
+ for (int color = 0; color < 3; color ++) {
+ if (blend_type) {
+ int blended = bNonseparableBlend ? blended_colors[color] :
+ _BLEND(blend_type, *dest_scan, *src_scan);
+ blended = FXDIB_ALPHA_MERGE(*src_scan, blended, back_alpha);
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended, alpha_ratio);
+ } else {
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, *src_scan, alpha_ratio);
+ }
+ dest_scan ++;
+ src_scan ++;
+ }
+ dest_scan ++;
+ }
+ }
+ } else {
+ if (src_alpha_scan) {
+ for (int col = 0; col < pixel_count; col ++) {
+ FX_BYTE back_alpha = *dest_alpha_scan;
+ if (back_alpha == 0) {
+ if (clip_scan) {
+ int src_alpha = clip_scan[col] * (*src_alpha_scan) / 255;
+ *dest_alpha_scan = src_alpha;
+ *dest_scan++ = *src_scan++;
+ *dest_scan++ = *src_scan++;
+ *dest_scan++ = *src_scan++;
+ } else {
+ *dest_alpha_scan = *src_alpha_scan;
+ *dest_scan++ = *src_scan++;
+ *dest_scan++ = *src_scan++;
+ *dest_scan++ = *src_scan++;
+ }
+ dest_alpha_scan ++;
+ src_alpha_scan ++;
+ continue;
+ }
+ FX_BYTE src_alpha;
+ if (clip_scan == NULL) {
+ src_alpha = *src_alpha_scan ++;
+ } else {
+ src_alpha = clip_scan[col] * (*src_alpha_scan ++) / 255;
+ }
+ if (src_alpha == 0) {
+ dest_scan += 3;
+ src_scan += 3;
+ dest_alpha_scan ++;
+ continue;
+ }
+ FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ *dest_alpha_scan ++ = dest_alpha;
+ int alpha_ratio = src_alpha * 255 / dest_alpha;
+ if (bNonseparableBlend) {
+ _RGB_Blend(blend_type, src_scan, dest_scan, blended_colors);
+ }
+ for (int color = 0; color < 3; color ++) {
+ if (blend_type) {
+ int blended = bNonseparableBlend ? blended_colors[color] :
+ _BLEND(blend_type, *dest_scan, *src_scan);
+ blended = FXDIB_ALPHA_MERGE(*src_scan, blended, back_alpha);
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended, alpha_ratio);
+ } else {
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, *src_scan, alpha_ratio);
+ }
+ dest_scan ++;
+ src_scan ++;
+ }
+ }
+ } else {
+ for (int col = 0; col < pixel_count; col ++) {
+ FX_BYTE back_alpha = *dest_alpha_scan;
+ if (back_alpha == 0) {
+ if (clip_scan) {
+ int src_alpha = clip_scan[col] * src_scan[3] / 255;
+ *dest_alpha_scan = src_alpha;
+ *dest_scan++ = *src_scan++;
+ *dest_scan++ = *src_scan++;
+ *dest_scan++ = *src_scan++;
+ } else {
+ *dest_alpha_scan = src_scan[3];
+ *dest_scan++ = *src_scan++;
+ *dest_scan++ = *src_scan++;
+ *dest_scan++ = *src_scan++;
+ }
+ dest_alpha_scan ++;
+ src_scan ++;
+ continue;
+ }
+ FX_BYTE src_alpha;
+ if (clip_scan == NULL) {
+ src_alpha = src_scan[3];
+ } else {
+ src_alpha = clip_scan[col] * src_scan[3] / 255;
+ }
+ if (src_alpha == 0) {
+ dest_scan += 3;
+ src_scan += 4;
+ dest_alpha_scan ++;
+ continue;
+ }
+ FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ *dest_alpha_scan++ = dest_alpha;
+ int alpha_ratio = src_alpha * 255 / dest_alpha;
+ if (bNonseparableBlend) {
+ _RGB_Blend(blend_type, src_scan, dest_scan, blended_colors);
+ }
+ for (int color = 0; color < 3; color ++) {
+ if (blend_type) {
+ int blended = bNonseparableBlend ? blended_colors[color] :
+ _BLEND(blend_type, *dest_scan, *src_scan);
+ blended = FXDIB_ALPHA_MERGE(*src_scan, blended, back_alpha);
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended, alpha_ratio);
+ } else {
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, *src_scan, alpha_ratio);
+ }
+ dest_scan ++;
+ src_scan ++;
+ }
+ src_scan ++;
+ }
+ }
+ }
+}
+void _CompositeRow_Rgb2Argb_Blend_NoClip(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int blend_type, int src_Bpp,
+ FX_LPBYTE dest_alpha_scan)
+{
+ int blended_colors[3];
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ int src_gap = src_Bpp - 3;
+ if (dest_alpha_scan == NULL) {
+ for (int col = 0; col < width; col ++) {
+ FX_BYTE back_alpha = dest_scan[3];
+ if (back_alpha == 0) {
+ if (src_Bpp == 4) {
+ FXARGB_SETDIB(dest_scan, 0xff000000 | FXARGB_GETDIB(src_scan));
+ } else {
+ FXARGB_SETDIB(dest_scan, FXARGB_MAKE(0xff, src_scan[2], src_scan[1], src_scan[0]));
+ }
+ dest_scan += 4;
+ src_scan += src_Bpp;
+ continue;
+ }
+ dest_scan[3] = 0xff;
+ if (bNonseparableBlend) {
+ _RGB_Blend(blend_type, src_scan, dest_scan, blended_colors);
+ }
+ for (int color = 0; color < 3; color ++) {
+ int src_color = *src_scan;
+ int blended = bNonseparableBlend ? blended_colors[color] :
+ _BLEND(blend_type, *dest_scan, src_color);
+ *dest_scan = FXDIB_ALPHA_MERGE(src_color, blended, back_alpha);
+ dest_scan ++;
+ src_scan ++;
+ }
+ dest_scan ++;
+ src_scan += src_gap;
+ }
+ } else {
+ for (int col = 0; col < width; col ++) {
+ FX_BYTE back_alpha = *dest_alpha_scan;
+ if (back_alpha == 0) {
+ *dest_scan++ = *src_scan++;
+ *dest_scan++ = *src_scan++;
+ *dest_scan++ = *src_scan++;
+ *dest_alpha_scan++ = 0xff;
+ src_scan += src_gap;
+ continue;
+ }
+ *dest_alpha_scan++ = 0xff;
+ if (bNonseparableBlend) {
+ _RGB_Blend(blend_type, src_scan, dest_scan, blended_colors);
+ }
+ for (int color = 0; color < 3; color ++) {
+ int src_color = *src_scan;
+ int blended = bNonseparableBlend ? blended_colors[color] :
+ _BLEND(blend_type, *dest_scan, src_color);
+ *dest_scan = FXDIB_ALPHA_MERGE(src_color, blended, back_alpha);
+ dest_scan ++;
+ src_scan ++;
+ }
+ src_scan += src_gap;
+ }
+ }
+}
+inline void _CompositeRow_Rgb2Argb_Blend_Clip(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int blend_type, int src_Bpp, FX_LPCBYTE clip_scan,
+ FX_LPBYTE dest_alpha_scan)
+{
+ int blended_colors[3];
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ int src_gap = src_Bpp - 3;
+ if (dest_alpha_scan == NULL) {
+ for (int col = 0; col < width; col ++) {
+ int src_alpha = *clip_scan ++;
+ FX_BYTE back_alpha = dest_scan[3];
+ if (back_alpha == 0) {
+ *dest_scan++ = *src_scan++;
+ *dest_scan++ = *src_scan++;
+ *dest_scan++ = *src_scan++;
+ src_scan += src_gap;
+ dest_scan ++;
+ continue;
+ }
+ if (src_alpha == 0) {
+ dest_scan += 4;
+ src_scan += src_Bpp;
+ continue;
+ }
+ FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ dest_scan[3] = dest_alpha;
+ int alpha_ratio = src_alpha * 255 / dest_alpha;
+ if (bNonseparableBlend) {
+ _RGB_Blend(blend_type, src_scan, dest_scan, blended_colors);
+ }
+ for (int color = 0; color < 3; color ++) {
+ int src_color = *src_scan;
+ int blended = bNonseparableBlend ? blended_colors[color] :
+ _BLEND(blend_type, *dest_scan, src_color);
+ blended = FXDIB_ALPHA_MERGE(src_color, blended, back_alpha);
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended, alpha_ratio);
+ dest_scan ++;
+ src_scan ++;
+ }
+ dest_scan ++;
+ src_scan += src_gap;
+ }
+ } else {
+ for (int col = 0; col < width; col ++) {
+ int src_alpha = *clip_scan ++;
+ FX_BYTE back_alpha = *dest_alpha_scan;
+ if (back_alpha == 0) {
+ *dest_scan++ = *src_scan++;
+ *dest_scan++ = *src_scan++;
+ *dest_scan++ = *src_scan++;
+ src_scan += src_gap;
+ dest_alpha_scan++;
+ continue;
+ }
+ if (src_alpha == 0) {
+ dest_scan += 3;
+ dest_alpha_scan++;
+ src_scan += src_Bpp;
+ continue;
+ }
+ FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ *dest_alpha_scan++ = dest_alpha;
+ int alpha_ratio = src_alpha * 255 / dest_alpha;
+ if (bNonseparableBlend) {
+ _RGB_Blend(blend_type, src_scan, dest_scan, blended_colors);
+ }
+ for (int color = 0; color < 3; color ++) {
+ int src_color = *src_scan;
+ int blended = bNonseparableBlend ? blended_colors[color] :
+ _BLEND(blend_type, *dest_scan, src_color);
+ blended = FXDIB_ALPHA_MERGE(src_color, blended, back_alpha);
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended, alpha_ratio);
+ dest_scan ++;
+ src_scan ++;
+ }
+ src_scan += src_gap;
+ }
+ }
+}
+inline void _CompositeRow_Rgb2Argb_NoBlend_Clip(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int src_Bpp, FX_LPCBYTE clip_scan,
+ FX_LPBYTE dest_alpha_scan)
+{
+ int src_gap = src_Bpp - 3;
+ if (dest_alpha_scan == NULL) {
+ for (int col = 0; col < width; col ++) {
+ int src_alpha = clip_scan[col];
+ if (src_alpha == 255) {
+ *dest_scan++ = *src_scan++;
+ *dest_scan++ = *src_scan++;
+ *dest_scan++ = *src_scan++;
+ *dest_scan++ = 255;
+ src_scan += src_gap;
+ continue;
+ }
+ if (src_alpha == 0) {
+ dest_scan += 4;
+ src_scan += src_Bpp;
+ continue;
+ }
+ int back_alpha = dest_scan[3];
+ FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ dest_scan[3] = dest_alpha;
+ int alpha_ratio = src_alpha * 255 / dest_alpha;
+ for (int color = 0; color < 3; color ++) {
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, *src_scan, alpha_ratio);
+ dest_scan ++;
+ src_scan ++;
+ }
+ dest_scan ++;
+ src_scan += src_gap;
+ }
+ } else {
+ for (int col = 0; col < width; col ++) {
+ int src_alpha = clip_scan[col];
+ if (src_alpha == 255) {
+ *dest_scan++ = *src_scan++;
+ *dest_scan++ = *src_scan++;
+ *dest_scan++ = *src_scan++;
+ *dest_alpha_scan++ = 255;
+ src_scan += src_gap;
+ continue;
+ }
+ if (src_alpha == 0) {
+ dest_scan += 3;
+ dest_alpha_scan ++;
+ src_scan += src_Bpp;
+ continue;
+ }
+ int back_alpha = *dest_alpha_scan;
+ FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ *dest_alpha_scan ++ = dest_alpha;
+ int alpha_ratio = src_alpha * 255 / dest_alpha;
+ for (int color = 0; color < 3; color ++) {
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, *src_scan, alpha_ratio);
+ dest_scan ++;
+ src_scan ++;
+ }
+ src_scan += src_gap;
+ }
+ }
+}
+inline void _CompositeRow_Rgb2Argb_NoBlend_NoClip(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int src_Bpp,
+ FX_LPBYTE dest_alpha_scan)
+{
+ if (dest_alpha_scan == NULL) {
+ for (int col = 0; col < width; col ++) {
+ if (src_Bpp == 4) {
+ FXARGB_SETDIB(dest_scan, 0xff000000 | FXARGB_GETDIB(src_scan));
+ } else {
+ FXARGB_SETDIB(dest_scan, FXARGB_MAKE(0xff, src_scan[2], src_scan[1], src_scan[0]));
+ }
+ dest_scan += 4;
+ src_scan += src_Bpp;
+ }
+ } else {
+ int src_gap = src_Bpp - 3;
+ for (int col = 0; col < width; col ++) {
+ *dest_scan++ = *src_scan++;
+ *dest_scan++ = *src_scan++;
+ *dest_scan++ = *src_scan++;
+ *dest_alpha_scan++ = 0xff;
+ src_scan += src_gap;
+ }
+ }
+}
+inline void _CompositeRow_Argb2Rgb_Blend(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int blend_type, int dest_Bpp, FX_LPCBYTE clip_scan,
+ FX_LPCBYTE src_alpha_scan)
+{
+ int blended_colors[3];
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ int dest_gap = dest_Bpp - 3;
+ if (src_alpha_scan == NULL) {
+ for (int col = 0; col < width; col ++) {
+ FX_BYTE src_alpha;
+ if (clip_scan) {
+ src_alpha = src_scan[3] * (*clip_scan++) / 255;
+ } else {
+ src_alpha = src_scan[3];
+ }
+ if (src_alpha == 0) {
+ dest_scan += dest_Bpp;
+ src_scan += 4;
+ continue;
+ }
+ if (bNonseparableBlend) {
+ _RGB_Blend(blend_type, src_scan, dest_scan, blended_colors);
+ }
+ for (int color = 0; color < 3; color ++) {
+ int back_color = *dest_scan;
+ int blended = bNonseparableBlend ? blended_colors[color] :
+ _BLEND(blend_type, back_color, *src_scan);
+ *dest_scan = FXDIB_ALPHA_MERGE(back_color, blended, src_alpha);
+ dest_scan ++;
+ src_scan ++;
+ }
+ dest_scan += dest_gap;
+ src_scan ++;
+ }
+ } else {
+ for (int col = 0; col < width; col ++) {
+ FX_BYTE src_alpha;
+ if (clip_scan) {
+ src_alpha = (*src_alpha_scan++) * (*clip_scan++) / 255;
+ } else {
+ src_alpha = *src_alpha_scan++;
+ }
+ if (src_alpha == 0) {
+ dest_scan += dest_Bpp;
+ src_scan += 3;
+ continue;
+ }
+ if (bNonseparableBlend) {
+ _RGB_Blend(blend_type, src_scan, dest_scan, blended_colors);
+ }
+ for (int color = 0; color < 3; color ++) {
+ int back_color = *dest_scan;
+ int blended = bNonseparableBlend ? blended_colors[color] :
+ _BLEND(blend_type, back_color, *src_scan);
+ *dest_scan = FXDIB_ALPHA_MERGE(back_color, blended, src_alpha);
+ dest_scan ++;
+ src_scan ++;
+ }
+ dest_scan += dest_gap;
+ }
+ }
+}
+inline void _CompositeRow_Argb2Rgb_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int dest_Bpp, FX_LPCBYTE clip_scan,
+ FX_LPCBYTE src_alpha_scan)
+{
+ int dest_gap = dest_Bpp - 3;
+ if (src_alpha_scan == NULL) {
+ for (int col = 0; col < width; col ++) {
+ FX_BYTE src_alpha;
+ if (clip_scan) {
+ src_alpha = src_scan[3] * (*clip_scan++) / 255;
+ } else {
+ src_alpha = src_scan[3];
+ }
+ if (src_alpha == 255) {
+ *dest_scan++ = *src_scan++;
+ *dest_scan++ = *src_scan++;
+ *dest_scan++ = *src_scan++;
+ dest_scan += dest_gap;
+ src_scan ++;
+ continue;
+ }
+ if (src_alpha == 0) {
+ dest_scan += dest_Bpp;
+ src_scan += 4;
+ continue;
+ }
+ for (int color = 0; color < 3; color ++) {
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, *src_scan, src_alpha);
+ dest_scan ++;
+ src_scan ++;
+ }
+ dest_scan += dest_gap;
+ src_scan ++;
+ }
+ } else {
+ for (int col = 0; col < width; col ++) {
+ FX_BYTE src_alpha;
+ if (clip_scan) {
+ src_alpha = (*src_alpha_scan++) * (*clip_scan++) / 255;
+ } else {
+ src_alpha = *src_alpha_scan++;
+ }
+ if (src_alpha == 255) {
+ *dest_scan++ = *src_scan++;
+ *dest_scan++ = *src_scan++;
+ *dest_scan++ = *src_scan++;
+ dest_scan += dest_gap;
+ continue;
+ }
+ if (src_alpha == 0) {
+ dest_scan += dest_Bpp;
+ src_scan += 3;
+ continue;
+ }
+ for (int color = 0; color < 3; color ++) {
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, *src_scan, src_alpha);
+ dest_scan ++;
+ src_scan ++;
+ }
+ dest_scan += dest_gap;
+ }
+ }
+}
+inline void _CompositeRow_Rgb2Rgb_Blend_NoClip(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int blend_type, int dest_Bpp, int src_Bpp)
+{
+ int blended_colors[3];
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ int dest_gap = dest_Bpp - 3;
+ int src_gap = src_Bpp - 3;
+ for (int col = 0; col < width; col ++) {
+ if (bNonseparableBlend) {
+ _RGB_Blend(blend_type, src_scan, dest_scan, blended_colors);
+ }
+ for (int color = 0; color < 3; color ++) {
+ int back_color = *dest_scan;
+ int src_color = *src_scan;
+ int blended = bNonseparableBlend ? blended_colors[color] :
+ _BLEND(blend_type, back_color, src_color);
+ *dest_scan = blended;
+ dest_scan ++;
+ src_scan ++;
+ }
+ dest_scan += dest_gap;
+ src_scan += src_gap;
+ }
+}
+inline void _CompositeRow_Rgb2Rgb_Blend_Clip(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int blend_type, int dest_Bpp, int src_Bpp, FX_LPCBYTE clip_scan)
+{
+ int blended_colors[3];
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ int dest_gap = dest_Bpp - 3;
+ int src_gap = src_Bpp - 3;
+ for (int col = 0; col < width; col ++) {
+ FX_BYTE src_alpha = *clip_scan ++;
+ if (src_alpha == 0) {
+ dest_scan += dest_Bpp;
+ src_scan += src_Bpp;
+ continue;
+ }
+ if (bNonseparableBlend) {
+ _RGB_Blend(blend_type, src_scan, dest_scan, blended_colors);
+ }
+ for (int color = 0; color < 3; color ++) {
+ int src_color = *src_scan;
+ int back_color = *dest_scan;
+ int blended = bNonseparableBlend ? blended_colors[color] :
+ _BLEND(blend_type, back_color, src_color);
+ *dest_scan = FXDIB_ALPHA_MERGE(back_color, blended, src_alpha);
+ dest_scan ++;
+ src_scan ++;
+ }
+ dest_scan += dest_gap;
+ src_scan += src_gap;
+ }
+}
+inline void _CompositeRow_Rgb2Rgb_NoBlend_NoClip(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int dest_Bpp, int src_Bpp)
+{
+ if (dest_Bpp == src_Bpp) {
+ FXSYS_memcpy32(dest_scan, src_scan, width * dest_Bpp);
+ return;
+ }
+ for (int col = 0; col < width; col ++) {
+ dest_scan[0] = src_scan[0];
+ dest_scan[1] = src_scan[1];
+ dest_scan[2] = src_scan[2];
+ dest_scan += dest_Bpp;
+ src_scan += src_Bpp;
+ }
+}
+inline void _CompositeRow_Rgb2Rgb_NoBlend_Clip(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int dest_Bpp, int src_Bpp, FX_LPCBYTE clip_scan)
+{
+ for (int col = 0; col < width; col ++) {
+ int src_alpha = clip_scan[col];
+ if (src_alpha == 255) {
+ dest_scan[0] = src_scan[0];
+ dest_scan[1] = src_scan[1];
+ dest_scan[2] = src_scan[2];
+ } else if (src_alpha) {
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, *src_scan, src_alpha);
+ dest_scan ++;
+ src_scan ++;
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, *src_scan, src_alpha);
+ dest_scan ++;
+ src_scan ++;
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, *src_scan, src_alpha);
+ dest_scan += dest_Bpp - 2;
+ src_scan += src_Bpp - 2;
+ continue;
+ }
+ dest_scan += dest_Bpp;
+ src_scan += src_Bpp;
+ }
+}
+void _CompositeRow_Argb2Argb_Transform(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixel_count, int blend_type, FX_LPCBYTE clip_scan,
+ FX_LPBYTE dest_alpha_scan, FX_LPCBYTE src_alpha_scan, FX_LPBYTE src_cache_scan, void* pIccTransform)
+{
+ FX_LPBYTE dp = src_cache_scan;
+ ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
+ if (src_alpha_scan) {
+ if (dest_alpha_scan == NULL) {
+ for (int col = 0; col < pixel_count; col ++) {
+ pIccModule->TranslateScanline(pIccTransform, dp, src_scan, 1);
+ dp[3] = *src_alpha_scan++;
+ src_scan += 3;
+ dp += 4;
+ }
+ src_alpha_scan = NULL;
+ } else {
+ pIccModule->TranslateScanline(pIccTransform, dp, src_scan, pixel_count);
+ }
+ } else {
+ if (dest_alpha_scan == NULL) {
+ for (int col = 0; col < pixel_count; col ++) {
+ pIccModule->TranslateScanline(pIccTransform, dp, src_scan, 1);
+ dp[3] = src_scan[3];
+ src_scan += 4;
+ dp += 4;
+ }
+ } else {
+ int blended_colors[3];
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ for (int col = 0; col < pixel_count; col ++) {
+ pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, 1);
+ FX_BYTE back_alpha = *dest_alpha_scan;
+ if (back_alpha == 0) {
+ if (clip_scan) {
+ int src_alpha = clip_scan[col] * src_scan[3] / 255;
+ *dest_alpha_scan = src_alpha;
+ *dest_scan++ = *src_cache_scan++;
+ *dest_scan++ = *src_cache_scan++;
+ *dest_scan++ = *src_cache_scan++;
+ } else {
+ *dest_alpha_scan = src_scan[3];
+ *dest_scan++ = *src_cache_scan++;
+ *dest_scan++ = *src_cache_scan++;
+ *dest_scan++ = *src_cache_scan++;
+ }
+ dest_alpha_scan ++;
+ src_scan += 4;
+ continue;
+ }
+ FX_BYTE src_alpha;
+ if (clip_scan == NULL) {
+ src_alpha = src_scan[3];
+ } else {
+ src_alpha = clip_scan[col] * src_scan[3] / 255;
+ }
+ src_scan += 4;
+ if (src_alpha == 0) {
+ dest_scan += 3;
+ src_cache_scan += 3;
+ dest_alpha_scan ++;
+ continue;
+ }
+ FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ *dest_alpha_scan ++ = dest_alpha;
+ int alpha_ratio = src_alpha * 255 / dest_alpha;
+ if (bNonseparableBlend) {
+ _RGB_Blend(blend_type, src_cache_scan, dest_scan, blended_colors);
+ }
+ for (int color = 0; color < 3; color ++) {
+ if (blend_type) {
+ int blended = bNonseparableBlend ? blended_colors[color] :
+ _BLEND(blend_type, *dest_scan, *src_cache_scan);
+ blended = FXDIB_ALPHA_MERGE(*src_cache_scan, blended, back_alpha);
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended, alpha_ratio);
+ } else {
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, *src_cache_scan, alpha_ratio);
+ }
+ dest_scan ++;
+ src_cache_scan ++;
+ }
+ }
+ return;
+ }
+ }
+ _CompositeRow_Argb2Argb(dest_scan, src_cache_scan, pixel_count, blend_type, clip_scan, dest_alpha_scan, src_alpha_scan);
+}
+void _CompositeRow_Rgb2Argb_Blend_NoClip_Transform(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int blend_type, int src_Bpp,
+ FX_LPBYTE dest_alpha_scan, FX_LPBYTE src_cache_scan, void* pIccTransform)
+{
+ ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
+ if (src_Bpp == 3) {
+ pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, width);
+ } else {
+ FX_LPBYTE dp = src_cache_scan;
+ for (int col = 0; col < width; col ++) {
+ pIccModule->TranslateScanline(pIccTransform, dp, src_scan, 1);
+ src_scan += 4;
+ dp += 3;
+ }
+ }
+ _CompositeRow_Rgb2Argb_Blend_NoClip(dest_scan, src_cache_scan, width, blend_type, 3, dest_alpha_scan);
+}
+inline void _CompositeRow_Rgb2Argb_Blend_Clip_Transform(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int blend_type, int src_Bpp, FX_LPCBYTE clip_scan,
+ FX_LPBYTE dest_alpha_scan, FX_LPBYTE src_cache_scan, void* pIccTransform)
+{
+ ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
+ if (src_Bpp == 3) {
+ pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, width);
+ } else {
+ FX_LPBYTE dp = src_cache_scan;
+ for (int col = 0; col < width; col ++) {
+ pIccModule->TranslateScanline(pIccTransform, dp, src_scan, 1);
+ src_scan += 4;
+ dp += 3;
+ }
+ }
+ _CompositeRow_Rgb2Argb_Blend_Clip(dest_scan, src_cache_scan, width, blend_type, 3, clip_scan, dest_alpha_scan);
+}
+inline void _CompositeRow_Rgb2Argb_NoBlend_Clip_Transform(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int src_Bpp, FX_LPCBYTE clip_scan,
+ FX_LPBYTE dest_alpha_scan, FX_LPBYTE src_cache_scan, void* pIccTransform)
+{
+ ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
+ if (src_Bpp == 3) {
+ pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, width);
+ } else {
+ FX_LPBYTE dp = src_cache_scan;
+ for (int col = 0; col < width; col ++) {
+ pIccModule->TranslateScanline(pIccTransform, dp, src_scan, 1);
+ src_scan += 4;
+ dp += 3;
+ }
+ }
+ _CompositeRow_Rgb2Argb_NoBlend_Clip(dest_scan, src_cache_scan, width, 3, clip_scan, dest_alpha_scan);
+}
+inline void _CompositeRow_Rgb2Argb_NoBlend_NoClip_Transform(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int src_Bpp,
+ FX_LPBYTE dest_alpha_scan, FX_LPBYTE src_cache_scan, void* pIccTransform)
+{
+ ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
+ if (src_Bpp == 3) {
+ pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, width);
+ } else {
+ FX_LPBYTE dp = src_cache_scan;
+ for (int col = 0; col < width; col ++) {
+ pIccModule->TranslateScanline(pIccTransform, dp, src_scan, 1);
+ src_scan += 4;
+ dp += 3;
+ }
+ }
+ _CompositeRow_Rgb2Argb_NoBlend_NoClip(dest_scan, src_cache_scan, width, 3, dest_alpha_scan);
+}
+inline void _CompositeRow_Argb2Rgb_Blend_Transform(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int blend_type, int dest_Bpp, FX_LPCBYTE clip_scan,
+ FX_LPCBYTE src_alpha_scan, FX_LPBYTE src_cache_scan, void* pIccTransform)
+{
+ ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
+ if (src_alpha_scan) {
+ pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, width);
+ } else {
+ int blended_colors[3];
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ int dest_gap = dest_Bpp - 3;
+ for (int col = 0; col < width; col ++) {
+ pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, 1);
+ FX_BYTE src_alpha;
+ if (clip_scan) {
+ src_alpha = src_scan[3] * (*clip_scan++) / 255;
+ } else {
+ src_alpha = src_scan[3];
+ }
+ src_scan += 4;
+ if (src_alpha == 0) {
+ dest_scan += dest_Bpp;
+ src_cache_scan += 3;
+ continue;
+ }
+ if (bNonseparableBlend) {
+ _RGB_Blend(blend_type, src_cache_scan, dest_scan, blended_colors);
+ }
+ for (int color = 0; color < 3; color ++) {
+ int back_color = *dest_scan;
+ int blended = bNonseparableBlend ? blended_colors[color] :
+ _BLEND(blend_type, back_color, *src_cache_scan);
+ *dest_scan = FXDIB_ALPHA_MERGE(back_color, blended, src_alpha);
+ dest_scan ++;
+ src_cache_scan ++;
+ }
+ dest_scan += dest_gap;
+ }
+ return;
+ }
+ _CompositeRow_Argb2Rgb_Blend(dest_scan, src_cache_scan, width, blend_type, dest_Bpp, clip_scan, src_alpha_scan);
+}
+inline void _CompositeRow_Argb2Rgb_NoBlend_Transform(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int dest_Bpp, FX_LPCBYTE clip_scan,
+ FX_LPCBYTE src_alpha_scan, FX_LPBYTE src_cache_scan, void* pIccTransform)
+{
+ ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
+ if (src_alpha_scan) {
+ pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, width);
+ } else {
+ int dest_gap = dest_Bpp - 3;
+ for (int col = 0; col < width; col ++) {
+ pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, 1);
+ FX_BYTE src_alpha;
+ if (clip_scan) {
+ src_alpha = src_scan[3] * (*clip_scan++) / 255;
+ } else {
+ src_alpha = src_scan[3];
+ }
+ src_scan += 4;
+ if (src_alpha == 255) {
+ *dest_scan++ = *src_cache_scan++;
+ *dest_scan++ = *src_cache_scan++;
+ *dest_scan++ = *src_cache_scan++;
+ dest_scan += dest_gap;
+ continue;
+ }
+ if (src_alpha == 0) {
+ dest_scan += dest_Bpp;
+ src_cache_scan += 3;
+ continue;
+ }
+ for (int color = 0; color < 3; color ++) {
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, *src_cache_scan, src_alpha);
+ dest_scan ++;
+ src_cache_scan ++;
+ }
+ dest_scan += dest_gap;
+ }
+ return;
+ }
+ _CompositeRow_Argb2Rgb_NoBlend(dest_scan, src_cache_scan, width, dest_Bpp, clip_scan, src_alpha_scan);
+}
+inline void _CompositeRow_Rgb2Rgb_Blend_NoClip_Transform(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int blend_type, int dest_Bpp, int src_Bpp,
+ FX_LPBYTE src_cache_scan, void* pIccTransform)
+{
+ ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
+ if (src_Bpp == 3) {
+ pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, width);
+ } else {
+ FX_LPBYTE dp = src_cache_scan;
+ for (int col = 0; col < width; col ++) {
+ pIccModule->TranslateScanline(pIccTransform, dp, src_scan, 1);
+ src_scan += 4;
+ dp += 3;
+ }
+ }
+ _CompositeRow_Rgb2Rgb_Blend_NoClip(dest_scan, src_cache_scan, width, blend_type, dest_Bpp, 3);
+}
+inline void _CompositeRow_Rgb2Rgb_Blend_Clip_Transform(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int blend_type, int dest_Bpp, int src_Bpp, FX_LPCBYTE clip_scan,
+ FX_LPBYTE src_cache_scan, void* pIccTransform)
+{
+ ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
+ if (src_Bpp == 3) {
+ pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, width);
+ } else {
+ FX_LPBYTE dp = src_cache_scan;
+ for (int col = 0; col < width; col ++) {
+ pIccModule->TranslateScanline(pIccTransform, dp, src_scan, 1);
+ src_scan += 4;
+ dp += 3;
+ }
+ }
+ _CompositeRow_Rgb2Rgb_Blend_Clip(dest_scan, src_cache_scan, width, blend_type, dest_Bpp, 3, clip_scan);
+}
+inline void _CompositeRow_Rgb2Rgb_NoBlend_NoClip_Transform(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int dest_Bpp, int src_Bpp,
+ FX_LPBYTE src_cache_scan, void* pIccTransform)
+{
+ ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
+ if (src_Bpp == 3) {
+ pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, width);
+ } else {
+ FX_LPBYTE dp = src_cache_scan;
+ for (int col = 0; col < width; col ++) {
+ pIccModule->TranslateScanline(pIccTransform, dp, src_scan, 1);
+ src_scan += 4;
+ dp += 3;
+ }
+ }
+ _CompositeRow_Rgb2Rgb_NoBlend_NoClip(dest_scan, src_cache_scan, width, dest_Bpp, 3);
+}
+inline void _CompositeRow_Rgb2Rgb_NoBlend_Clip_Transform(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int dest_Bpp, int src_Bpp, FX_LPCBYTE clip_scan,
+ FX_LPBYTE src_cache_scan, void* pIccTransform)
+{
+ ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
+ if (src_Bpp == 3) {
+ pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, width);
+ } else {
+ FX_LPBYTE dp = src_cache_scan;
+ for (int col = 0; col < width; col ++) {
+ pIccModule->TranslateScanline(pIccTransform, dp, src_scan, 1);
+ src_scan += 4;
+ dp += 3;
+ }
+ }
+ _CompositeRow_Rgb2Rgb_NoBlend_Clip(dest_scan, src_cache_scan, width, dest_Bpp, 3, clip_scan);
+}
+inline void _CompositeRow_8bppPal2Gray(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, FX_LPCBYTE pPalette, int pixel_count,
+ int blend_type, FX_LPCBYTE clip_scan,
+ FX_LPCBYTE src_alpha_scan)
+{
+ if (src_alpha_scan) {
+ if (blend_type) {
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ int blended_color;
+ for (int col = 0; col < pixel_count; col ++) {
+ FX_BYTE gray = pPalette[*src_scan];
+ int src_alpha = *src_alpha_scan++;
+ if (clip_scan) {
+ src_alpha = clip_scan[col] * src_alpha / 255;
+ }
+ if (bNonseparableBlend) {
+ blended_color = blend_type == FXDIB_BLEND_LUMINOSITY ? gray : *dest_scan;
+ }
+ gray = bNonseparableBlend ? blended_color : _BLEND(blend_type, *dest_scan, gray);
+ if (src_alpha) {
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, src_alpha);
+ } else {
+ *dest_scan = gray;
+ }
+ dest_scan ++;
+ src_scan ++;
+ }
+ return;
+ }
+ for (int col = 0; col < pixel_count; col ++) {
+ FX_BYTE gray = pPalette[*src_scan];
+ int src_alpha = *src_alpha_scan++;
+ if (clip_scan) {
+ src_alpha = clip_scan[col] * src_alpha / 255;
+ }
+ if (src_alpha) {
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, src_alpha);
+ } else {
+ *dest_scan = gray;
+ }
+ dest_scan ++;
+ src_scan ++;
+ }
+ } else {
+ if (blend_type) {
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ int blended_color;
+ for (int col = 0; col < pixel_count; col ++) {
+ FX_BYTE gray = pPalette[*src_scan];
+ if (bNonseparableBlend) {
+ blended_color = blend_type == FXDIB_BLEND_LUMINOSITY ? gray : *dest_scan;
+ }
+ gray = bNonseparableBlend ? blended_color : _BLEND(blend_type, *dest_scan, gray);
+ if (clip_scan && clip_scan[col] < 255) {
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, clip_scan[col]);
+ } else {
+ *dest_scan = gray;
+ }
+ dest_scan ++;
+ src_scan ++;
+ }
+ return;
+ }
+ for (int col = 0; col < pixel_count; col ++) {
+ FX_BYTE gray = pPalette[*src_scan];
+ if (clip_scan && clip_scan[col] < 255) {
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, clip_scan[col]);
+ } else {
+ *dest_scan = gray;
+ }
+ dest_scan ++;
+ src_scan ++;
+ }
+ }
+}
+inline void _CompositeRow_8bppPal2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, FX_LPCBYTE pPalette, int pixel_count,
+ int blend_type, FX_LPCBYTE clip_scan,
+ FX_LPBYTE dest_alpha_scan, FX_LPCBYTE src_alpha_scan)
+{
+ if (src_alpha_scan) {
+ if (blend_type) {
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ int blended_color;
+ for (int col = 0; col < pixel_count; col ++) {
+ FX_BYTE gray = pPalette[*src_scan];
+ src_scan ++;
+ FX_BYTE back_alpha = *dest_alpha_scan;
+ if (back_alpha == 0) {
+ int src_alpha = *src_alpha_scan ++;
+ if (clip_scan) {
+ src_alpha = clip_scan[col] * src_alpha / 255;
+ }
+ if (src_alpha) {
+ *dest_scan = gray;
+ *dest_alpha_scan = src_alpha;
+ }
+ dest_scan ++;
+ dest_alpha_scan ++;
+ continue;
+ }
+ FX_BYTE src_alpha = *src_alpha_scan++;
+ if (clip_scan) {
+ src_alpha = clip_scan[col] * src_alpha / 255;
+ }
+ if (src_alpha == 0) {
+ dest_scan ++;
+ dest_alpha_scan ++;
+ continue;
+ }
+ *dest_alpha_scan = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ int alpha_ratio = src_alpha * 255 / (*dest_alpha_scan);
+ if (bNonseparableBlend) {
+ blended_color = blend_type == FXDIB_BLEND_LUMINOSITY ? gray : *dest_scan;
+ }
+ gray = bNonseparableBlend ? blended_color : _BLEND(blend_type, *dest_scan, gray);
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, alpha_ratio);
+ dest_alpha_scan ++;
+ dest_scan ++;
+ }
+ return;
+ }
+ for (int col = 0; col < pixel_count; col ++) {
+ FX_BYTE gray = pPalette[*src_scan];
+ src_scan ++;
+ FX_BYTE back_alpha = *dest_alpha_scan;
+ if (back_alpha == 0) {
+ int src_alpha = *src_alpha_scan ++;
+ if (clip_scan) {
+ src_alpha = clip_scan[col] * src_alpha / 255;
+ }
+ if (src_alpha) {
+ *dest_scan = gray;
+ *dest_alpha_scan = src_alpha;
+ }
+ dest_scan ++;
+ dest_alpha_scan ++;
+ continue;
+ }
+ FX_BYTE src_alpha = *src_alpha_scan++;
+ if (clip_scan) {
+ src_alpha = clip_scan[col] * src_alpha / 255;
+ }
+ if (src_alpha == 0) {
+ dest_scan ++;
+ dest_alpha_scan ++;
+ continue;
+ }
+ *dest_alpha_scan = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ int alpha_ratio = src_alpha * 255 / (*dest_alpha_scan);
+ dest_alpha_scan ++;
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, alpha_ratio);
+ dest_scan ++;
+ }
+ } else {
+ if (blend_type) {
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ int blended_color;
+ for (int col = 0; col < pixel_count; col ++) {
+ FX_BYTE gray = pPalette[*src_scan];
+ src_scan ++;
+ if (clip_scan == NULL || clip_scan[col] == 255) {
+ *dest_scan++ = gray;
+ *dest_alpha_scan++ = 255;
+ continue;
+ }
+ int src_alpha = clip_scan[col];
+ if (src_alpha == 0) {
+ dest_scan ++;
+ dest_alpha_scan ++;
+ continue;
+ }
+ int back_alpha = *dest_alpha_scan;
+ FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ *dest_alpha_scan ++ = dest_alpha;
+ int alpha_ratio = src_alpha * 255 / dest_alpha;
+ if (bNonseparableBlend) {
+ blended_color = blend_type == FXDIB_BLEND_LUMINOSITY ? gray : *dest_scan;
+ }
+ gray = bNonseparableBlend ? blended_color : _BLEND(blend_type, *dest_scan, gray);
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, alpha_ratio);
+ dest_scan ++;
+ }
+ return;
+ }
+ for (int col = 0; col < pixel_count; col ++) {
+ FX_BYTE gray = pPalette[*src_scan];
+ src_scan ++;
+ if (clip_scan == NULL || clip_scan[col] == 255) {
+ *dest_scan++ = gray;
+ *dest_alpha_scan++ = 255;
+ continue;
+ }
+ int src_alpha = clip_scan[col];
+ if (src_alpha == 0) {
+ dest_scan ++;
+ dest_alpha_scan ++;
+ continue;
+ }
+ int back_alpha = *dest_alpha_scan;
+ FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ *dest_alpha_scan ++ = dest_alpha;
+ int alpha_ratio = src_alpha * 255 / dest_alpha;
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, alpha_ratio);
+ dest_scan ++;
+ }
+ }
+}
+inline void _CompositeRow_1bppPal2Gray(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int src_left,
+ FX_LPCBYTE pPalette, int pixel_count, int blend_type, FX_LPCBYTE clip_scan)
+{
+ int reset_gray = pPalette[0];
+ int set_gray = pPalette[1];
+ if (blend_type) {
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ int blended_color;
+ for (int col = 0; col < pixel_count; col ++) {
+ FX_BYTE gray = (src_scan[(col + src_left) / 8] & (1 << (7 - (col + src_left) % 8))) ? set_gray : reset_gray;
+ if (bNonseparableBlend) {
+ blended_color = blend_type == FXDIB_BLEND_LUMINOSITY ? gray : *dest_scan;
+ }
+ gray = bNonseparableBlend ? blended_color : _BLEND(blend_type, *dest_scan, gray);
+ if (clip_scan && clip_scan[col] < 255) {
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, clip_scan[col]);
+ } else {
+ *dest_scan = gray;
+ }
+ dest_scan ++;
+ }
+ return;
+ }
+ for (int col = 0; col < pixel_count; col ++) {
+ FX_BYTE gray = (src_scan[(col + src_left) / 8] & (1 << (7 - (col + src_left) % 8))) ? set_gray : reset_gray;
+ if (clip_scan && clip_scan[col] < 255) {
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, clip_scan[col]);
+ } else {
+ *dest_scan = gray;
+ }
+ dest_scan ++;
+ }
+}
+inline void _CompositeRow_1bppPal2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int src_left,
+ FX_LPCBYTE pPalette, int pixel_count, int blend_type, FX_LPCBYTE clip_scan,
+ FX_LPBYTE dest_alpha_scan)
+{
+ int reset_gray = pPalette[0];
+ int set_gray = pPalette[1];
+ if (blend_type) {
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ int blended_color;
+ for (int col = 0; col < pixel_count; col ++) {
+ FX_BYTE gray = (src_scan[(col + src_left) / 8] & (1 << (7 - (col + src_left) % 8))) ? set_gray : reset_gray;
+ if (clip_scan == NULL || clip_scan[col] == 255) {
+ *dest_scan++ = gray;
+ *dest_alpha_scan ++ = 255;
+ continue;
+ }
+ int src_alpha = clip_scan[col];
+ if (src_alpha == 0) {
+ dest_scan ++;
+ dest_alpha_scan ++;
+ continue;
+ }
+ int back_alpha = *dest_alpha_scan;
+ FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ *dest_alpha_scan ++ = dest_alpha;
+ int alpha_ratio = src_alpha * 255 / dest_alpha;
+ if (bNonseparableBlend) {
+ blended_color = blend_type == FXDIB_BLEND_LUMINOSITY ? gray : *dest_scan;
+ }
+ gray = bNonseparableBlend ? blended_color : _BLEND(blend_type, *dest_scan, gray);
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, alpha_ratio);
+ dest_scan ++;
+ }
+ return;
+ }
+ for (int col = 0; col < pixel_count; col ++) {
+ FX_BYTE gray = (src_scan[(col + src_left) / 8] & (1 << (7 - (col + src_left) % 8))) ? set_gray : reset_gray;
+ if (clip_scan == NULL || clip_scan[col] == 255) {
+ *dest_scan++ = gray;
+ *dest_alpha_scan ++ = 255;
+ continue;
+ }
+ int src_alpha = clip_scan[col];
+ if (src_alpha == 0) {
+ dest_scan ++;
+ dest_alpha_scan ++;
+ continue;
+ }
+ int back_alpha = *dest_alpha_scan;
+ FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ *dest_alpha_scan ++ = dest_alpha;
+ int alpha_ratio = src_alpha * 255 / dest_alpha;
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, alpha_ratio);
+ dest_scan ++;
+ }
+}
+inline void _CompositeRow_8bppRgb2Rgb_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, FX_DWORD* pPalette, int pixel_count,
+ int DestBpp, FX_LPCBYTE clip_scan,
+ FX_LPCBYTE src_alpha_scan)
+{
+ if (src_alpha_scan) {
+ int dest_gap = DestBpp - 3;
+ FX_ARGB argb = 0;
+ for (int col = 0; col < pixel_count; col ++) {
+ argb = pPalette[*src_scan];
+ int src_r = FXARGB_R(argb);
+ int src_g = FXARGB_G(argb);
+ int src_b = FXARGB_B(argb);
+ src_scan ++;
+ FX_BYTE src_alpha = 0;
+ if (clip_scan) {
+ src_alpha = (*src_alpha_scan++) * (*clip_scan++) / 255;
+ } else {
+ src_alpha = *src_alpha_scan++;
+ }
+ if (src_alpha == 255) {
+ *dest_scan++ = src_b;
+ *dest_scan++ = src_g;
+ *dest_scan++ = src_r;
+ dest_scan += dest_gap;
+ continue;
+ }
+ if (src_alpha == 0) {
+ dest_scan += DestBpp;
+ continue;
+ }
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_b, src_alpha);
+ dest_scan ++;
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_g, src_alpha);
+ dest_scan ++;
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_r, src_alpha);
+ dest_scan ++;
+ dest_scan += dest_gap;
+ }
+ } else {
+ FX_ARGB argb = 0;
+ for (int col = 0; col < pixel_count; col ++) {
+ argb = pPalette[*src_scan];
+ int src_r = FXARGB_R(argb);
+ int src_g = FXARGB_G(argb);
+ int src_b = FXARGB_B(argb);
+ if (clip_scan && clip_scan[col] < 255) {
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_b, clip_scan[col]);
+ dest_scan ++;
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_g, clip_scan[col]);
+ dest_scan ++;
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_r, clip_scan[col]);
+ dest_scan ++;
+ } else {
+ *dest_scan++ = src_b;
+ *dest_scan++ = src_g;
+ *dest_scan++ = src_r;
+ }
+ if (DestBpp == 4) {
+ dest_scan++;
+ }
+ src_scan ++;
+ }
+ }
+}
+inline void _CompositeRow_1bppRgb2Rgb_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int src_left,
+ FX_DWORD* pPalette, int pixel_count, int DestBpp, FX_LPCBYTE clip_scan)
+{
+ int reset_r, reset_g, reset_b;
+ int set_r, set_g, set_b;
+ reset_r = FXARGB_R(pPalette[0]);
+ reset_g = FXARGB_G(pPalette[0]);
+ reset_b = FXARGB_B(pPalette[0]);
+ set_r = FXARGB_R(pPalette[1]);
+ set_g = FXARGB_G(pPalette[1]);
+ set_b = FXARGB_B(pPalette[1]);
+ for (int col = 0; col < pixel_count; col ++) {
+ int src_r, src_g, src_b;
+ if (src_scan[(col + src_left) / 8] & (1 << (7 - (col + src_left) % 8))) {
+ src_r = set_r;
+ src_g = set_g;
+ src_b = set_b;
+ } else {
+ src_r = reset_r;
+ src_g = reset_g;
+ src_b = reset_b;
+ }
+ if (clip_scan && clip_scan[col] < 255) {
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_b, clip_scan[col]);
+ dest_scan ++;
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_g, clip_scan[col]);
+ dest_scan ++;
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_r, clip_scan[col]);
+ dest_scan ++;
+ } else {
+ *dest_scan++ = src_b;
+ *dest_scan++ = src_g;
+ *dest_scan++ = src_r;
+ }
+ if (DestBpp == 4) {
+ dest_scan++;
+ }
+ }
+}
+inline void _CompositeRow_8bppRgb2Argb_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width,
+ FX_DWORD* pPalette, FX_LPCBYTE clip_scan,
+ FX_LPCBYTE src_alpha_scan)
+{
+ if (src_alpha_scan) {
+ for (int col = 0; col < width; col ++) {
+ FX_ARGB argb = pPalette[*src_scan];
+ src_scan ++;
+ int src_r = FXARGB_R(argb);
+ int src_g = FXARGB_G(argb);
+ int src_b = FXARGB_B(argb);
+ FX_BYTE back_alpha = dest_scan[3];
+ if (back_alpha == 0) {
+ if (clip_scan) {
+ int src_alpha = clip_scan[col] * (*src_alpha_scan) / 255;
+ FXARGB_SETDIB(dest_scan, FXARGB_MAKE(src_alpha, src_r, src_g, src_b));
+ } else {
+ FXARGB_SETDIB(dest_scan, FXARGB_MAKE(*src_alpha_scan, src_r, src_g, src_b));
+ }
+ dest_scan += 4;
+ src_alpha_scan ++;
+ continue;
+ }
+ FX_BYTE src_alpha;
+ if (clip_scan == NULL) {
+ src_alpha = *src_alpha_scan ++;
+ } else {
+ src_alpha = clip_scan[col] * (*src_alpha_scan++) / 255;
+ }
+ if (src_alpha == 0) {
+ dest_scan += 4;
+ continue;
+ }
+ FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ dest_scan[3] = dest_alpha;
+ int alpha_ratio = src_alpha * 255 / dest_alpha;
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_b, alpha_ratio);
+ dest_scan ++;
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_g, alpha_ratio);
+ dest_scan ++;
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_r, alpha_ratio);
+ dest_scan ++;
+ dest_scan ++;
+ }
+ } else
+ for (int col = 0; col < width; col ++) {
+ FX_ARGB argb = pPalette[*src_scan];
+ int src_r = FXARGB_R(argb);
+ int src_g = FXARGB_G(argb);
+ int src_b = FXARGB_B(argb);
+ if (clip_scan == NULL || clip_scan[col] == 255) {
+ *dest_scan++ = src_b;
+ *dest_scan++ = src_g;
+ *dest_scan++ = src_r;
+ *dest_scan++ = 255;
+ src_scan ++;
+ continue;
+ }
+ int src_alpha = clip_scan[col];
+ if (src_alpha == 0) {
+ dest_scan += 4;
+ src_scan ++;
+ continue;
+ }
+ int back_alpha = dest_scan[3];
+ FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ dest_scan[3] = dest_alpha;
+ int alpha_ratio = src_alpha * 255 / dest_alpha;
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_b, alpha_ratio);
+ dest_scan ++;
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_g, alpha_ratio);
+ dest_scan ++;
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_r, alpha_ratio);
+ dest_scan ++;
+ dest_scan ++;
+ src_scan ++;
+ }
+}
+void _CompositeRow_8bppRgb2Rgba_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width,
+ FX_DWORD* pPalette, FX_LPCBYTE clip_scan,
+ FX_LPBYTE dest_alpha_scan, FX_LPCBYTE src_alpha_scan)
+{
+ if (src_alpha_scan) {
+ for (int col = 0; col < width; col ++) {
+ FX_ARGB argb = pPalette[*src_scan];
+ src_scan ++;
+ int src_r = FXARGB_R(argb);
+ int src_g = FXARGB_G(argb);
+ int src_b = FXARGB_B(argb);
+ FX_BYTE back_alpha = *dest_alpha_scan;
+ if (back_alpha == 0) {
+ if (clip_scan) {
+ int src_alpha = clip_scan[col] * (*src_alpha_scan) / 255;
+ *dest_alpha_scan ++ = src_alpha;
+ } else {
+ *dest_alpha_scan ++ = *src_alpha_scan;
+ }
+ *dest_scan ++ = src_b;
+ *dest_scan ++ = src_g;
+ *dest_scan ++ = src_r;
+ src_alpha_scan ++;
+ continue;
+ }
+ FX_BYTE src_alpha;
+ if (clip_scan == NULL) {
+ src_alpha = *src_alpha_scan++;
+ } else {
+ src_alpha = clip_scan[col] * (*src_alpha_scan++) / 255;
+ }
+ if (src_alpha == 0) {
+ dest_scan += 3;
+ dest_alpha_scan ++;
+ continue;
+ }
+ FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ *dest_alpha_scan ++ = dest_alpha;
+ int alpha_ratio = src_alpha * 255 / dest_alpha;
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_b, alpha_ratio);
+ dest_scan ++;
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_g, alpha_ratio);
+ dest_scan ++;
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_r, alpha_ratio);
+ dest_scan ++;
+ }
+ } else
+ for (int col = 0; col < width; col ++) {
+ FX_ARGB argb = pPalette[*src_scan];
+ int src_r = FXARGB_R(argb);
+ int src_g = FXARGB_G(argb);
+ int src_b = FXARGB_B(argb);
+ if (clip_scan == NULL || clip_scan[col] == 255) {
+ *dest_scan++ = src_b;
+ *dest_scan++ = src_g;
+ *dest_scan++ = src_r;
+ *dest_alpha_scan++ = 255;
+ src_scan ++;
+ continue;
+ }
+ int src_alpha = clip_scan[col];
+ if (src_alpha == 0) {
+ dest_scan += 3;
+ dest_alpha_scan ++;
+ src_scan ++;
+ continue;
+ }
+ int back_alpha = *dest_alpha_scan;
+ FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ *dest_alpha_scan ++ = dest_alpha;
+ int alpha_ratio = src_alpha * 255 / dest_alpha;
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_b, alpha_ratio);
+ dest_scan ++;
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_g, alpha_ratio);
+ dest_scan ++;
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_r, alpha_ratio);
+ dest_scan ++;
+ src_scan ++;
+ }
+}
+inline void _CompositeRow_1bppRgb2Argb_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int src_left, int width,
+ FX_DWORD* pPalette, FX_LPCBYTE clip_scan)
+{
+ int reset_r, reset_g, reset_b;
+ int set_r, set_g, set_b;
+ reset_r = FXARGB_R(pPalette[0]);
+ reset_g = FXARGB_G(pPalette[0]);
+ reset_b = FXARGB_B(pPalette[0]);
+ set_r = FXARGB_R(pPalette[1]);
+ set_g = FXARGB_G(pPalette[1]);
+ set_b = FXARGB_B(pPalette[1]);
+ for (int col = 0; col < width; col ++) {
+ int src_r, src_g, src_b;
+ if (src_scan[(col + src_left) / 8] & (1 << (7 - (col + src_left) % 8))) {
+ src_r = set_r;
+ src_g = set_g;
+ src_b = set_b;
+ } else {
+ src_r = reset_r;
+ src_g = reset_g;
+ src_b = reset_b;
+ }
+ if (clip_scan == NULL || clip_scan[col] == 255) {
+ *dest_scan++ = src_b;
+ *dest_scan++ = src_g;
+ *dest_scan++ = src_r;
+ *dest_scan++ = 255;
+ continue;
+ }
+ int src_alpha = clip_scan[col];
+ if (src_alpha == 0) {
+ dest_scan += 4;
+ continue;
+ }
+ int back_alpha = dest_scan[3];
+ FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ dest_scan[3] = dest_alpha;
+ int alpha_ratio = src_alpha * 255 / dest_alpha;
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_b, alpha_ratio);
+ dest_scan ++;
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_g, alpha_ratio);
+ dest_scan ++;
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_r, alpha_ratio);
+ dest_scan ++;
+ dest_scan ++;
+ }
+}
+void _CompositeRow_1bppRgb2Rgba_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int src_left, int width,
+ FX_DWORD* pPalette, FX_LPCBYTE clip_scan,
+ FX_LPBYTE dest_alpha_scan)
+{
+ int reset_r, reset_g, reset_b;
+ int set_r, set_g, set_b;
+ reset_r = FXARGB_R(pPalette[0]);
+ reset_g = FXARGB_G(pPalette[0]);
+ reset_b = FXARGB_B(pPalette[0]);
+ set_r = FXARGB_R(pPalette[1]);
+ set_g = FXARGB_G(pPalette[1]);
+ set_b = FXARGB_B(pPalette[1]);
+ for (int col = 0; col < width; col ++) {
+ int src_r, src_g, src_b;
+ if (src_scan[(col + src_left) / 8] & (1 << (7 - (col + src_left) % 8))) {
+ src_r = set_r;
+ src_g = set_g;
+ src_b = set_b;
+ } else {
+ src_r = reset_r;
+ src_g = reset_g;
+ src_b = reset_b;
+ }
+ if (clip_scan == NULL || clip_scan[col] == 255) {
+ *dest_scan++ = src_b;
+ *dest_scan++ = src_g;
+ *dest_scan++ = src_r;
+ *dest_alpha_scan++ = 255;
+ continue;
+ }
+ int src_alpha = clip_scan[col];
+ if (src_alpha == 0) {
+ dest_scan += 3;
+ dest_alpha_scan ++;
+ continue;
+ }
+ int back_alpha = *dest_alpha_scan;
+ FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ *dest_alpha_scan ++ = dest_alpha;
+ int alpha_ratio = src_alpha * 255 / dest_alpha;
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_b, alpha_ratio);
+ dest_scan ++;
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_g, alpha_ratio);
+ dest_scan ++;
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_r, alpha_ratio);
+ dest_scan ++;
+ }
+}
+void _CompositeRow_ByteMask2Argb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int mask_alpha, int src_r, int src_g, int src_b, int pixel_count,
+ int blend_type, FX_LPCBYTE clip_scan)
+{
+ for (int col = 0; col < pixel_count; col ++) {
+ int src_alpha;
+ if (clip_scan) {
+ src_alpha = mask_alpha * clip_scan[col] * src_scan[col] / 255 / 255;
+ } else {
+ src_alpha = mask_alpha * src_scan[col] / 255;
+ }
+ FX_BYTE back_alpha = dest_scan[3];
+ if (back_alpha == 0) {
+ FXARGB_SETDIB(dest_scan, FXARGB_MAKE(src_alpha, src_r, src_g, src_b));
+ dest_scan += 4;
+ continue;
+ }
+ if (src_alpha == 0) {
+ dest_scan += 4;
+ continue;
+ }
+ FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ dest_scan[3] = dest_alpha;
+ int alpha_ratio = src_alpha * 255 / dest_alpha;
+ if (blend_type >= FXDIB_BLEND_NONSEPARABLE) {
+ int blended_colors[3];
+ FX_BYTE src_scan[3];
+ src_scan[0] = src_b;
+ src_scan[1] = src_g;
+ src_scan[2] = src_r;
+ _RGB_Blend(blend_type, src_scan, dest_scan, blended_colors);
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended_colors[0], alpha_ratio);
+ dest_scan ++;
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended_colors[1], alpha_ratio);
+ dest_scan ++;
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended_colors[2], alpha_ratio);
+ } else if (blend_type) {
+ int blended = _BLEND(blend_type, *dest_scan, src_b);
+ blended = FXDIB_ALPHA_MERGE(src_b, blended, back_alpha);
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended, alpha_ratio);
+ dest_scan ++;
+ blended = _BLEND(blend_type, *dest_scan, src_g);
+ blended = FXDIB_ALPHA_MERGE(src_g, blended, back_alpha);
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended, alpha_ratio);
+ dest_scan ++;
+ blended = _BLEND(blend_type, *dest_scan, src_r);
+ blended = FXDIB_ALPHA_MERGE(src_r, blended, back_alpha);
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended, alpha_ratio);
+ } else {
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_b, alpha_ratio);
+ dest_scan ++;
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_g, alpha_ratio);
+ dest_scan ++;
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_r, alpha_ratio);
+ }
+ dest_scan += 2;
+ }
+}
+void _CompositeRow_ByteMask2Rgba(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int mask_alpha, int src_r, int src_g, int src_b, int pixel_count,
+ int blend_type, FX_LPCBYTE clip_scan,
+ FX_LPBYTE dest_alpha_scan)
+{
+ for (int col = 0; col < pixel_count; col ++) {
+ int src_alpha;
+ if (clip_scan) {
+ src_alpha = mask_alpha * clip_scan[col] * src_scan[col] / 255 / 255;
+ } else {
+ src_alpha = mask_alpha * src_scan[col] / 255;
+ }
+ FX_BYTE back_alpha = *dest_alpha_scan;
+ if (back_alpha == 0) {
+ *dest_scan ++ = src_b;
+ *dest_scan ++ = src_g;
+ *dest_scan ++ = src_r;
+ *dest_alpha_scan ++ = src_alpha;
+ continue;
+ }
+ if (src_alpha == 0) {
+ dest_scan += 3;
+ dest_alpha_scan ++;
+ continue;
+ }
+ FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ *dest_alpha_scan ++ = dest_alpha;
+ int alpha_ratio = src_alpha * 255 / dest_alpha;
+ if (blend_type >= FXDIB_BLEND_NONSEPARABLE) {
+ int blended_colors[3];
+ FX_BYTE src_scan[3];
+ src_scan[0] = src_b;
+ src_scan[1] = src_g;
+ src_scan[2] = src_r;
+ _RGB_Blend(blend_type, src_scan, dest_scan, blended_colors);
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended_colors[0], alpha_ratio);
+ dest_scan ++;
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended_colors[1], alpha_ratio);
+ dest_scan ++;
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended_colors[2], alpha_ratio);
+ dest_scan ++;
+ } else if (blend_type) {
+ int blended = _BLEND(blend_type, *dest_scan, src_b);
+ blended = FXDIB_ALPHA_MERGE(src_b, blended, back_alpha);
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended, alpha_ratio);
+ dest_scan ++;
+ blended = _BLEND(blend_type, *dest_scan, src_g);
+ blended = FXDIB_ALPHA_MERGE(src_g, blended, back_alpha);
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended, alpha_ratio);
+ dest_scan ++;
+ blended = _BLEND(blend_type, *dest_scan, src_r);
+ blended = FXDIB_ALPHA_MERGE(src_r, blended, back_alpha);
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended, alpha_ratio);
+ dest_scan ++;
+ } else {
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_b, alpha_ratio);
+ dest_scan ++;
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_g, alpha_ratio);
+ dest_scan ++;
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_r, alpha_ratio);
+ dest_scan ++;
+ }
+ }
+}
+void _CompositeRow_ByteMask2Rgb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int mask_alpha, int src_r, int src_g, int src_b, int pixel_count,
+ int blend_type, int Bpp, FX_LPCBYTE clip_scan)
+{
+ for (int col = 0; col < pixel_count; col ++) {
+ int src_alpha;
+ if (clip_scan) {
+ src_alpha = mask_alpha * clip_scan[col] * src_scan[col] / 255 / 255;
+ } else {
+ src_alpha = mask_alpha * src_scan[col] / 255;
+ }
+ if (src_alpha == 0) {
+ dest_scan += Bpp;
+ continue;
+ }
+ if (blend_type >= FXDIB_BLEND_NONSEPARABLE) {
+ int blended_colors[3];
+ FX_BYTE src_scan[3];
+ src_scan[0] = src_b;
+ src_scan[1] = src_g;
+ src_scan[2] = src_r;
+ _RGB_Blend(blend_type, src_scan, dest_scan, blended_colors);
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended_colors[0], src_alpha);
+ dest_scan ++;
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended_colors[1], src_alpha);
+ dest_scan ++;
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended_colors[2], src_alpha);
+ } else if (blend_type) {
+ int blended = _BLEND(blend_type, *dest_scan, src_b);
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended, src_alpha);
+ dest_scan ++;
+ blended = _BLEND(blend_type, *dest_scan, src_g);
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended, src_alpha);
+ dest_scan ++;
+ blended = _BLEND(blend_type, *dest_scan, src_r);
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended, src_alpha);
+ } else {
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_b, src_alpha);
+ dest_scan ++;
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_g, src_alpha);
+ dest_scan ++;
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_r, src_alpha);
+ }
+ dest_scan += Bpp - 2;
+ }
+}
+void _CompositeRow_ByteMask2Mask(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int mask_alpha, int pixel_count,
+ FX_LPCBYTE clip_scan)
+{
+ for (int col = 0; col < pixel_count; col ++) {
+ int src_alpha;
+ if (clip_scan) {
+ src_alpha = mask_alpha * clip_scan[col] * src_scan[col] / 255 / 255;
+ } else {
+ src_alpha = mask_alpha * src_scan[col] / 255;
+ }
+ FX_BYTE back_alpha = *dest_scan;
+ if (!back_alpha) {
+ *dest_scan = src_alpha;
+ } else if (src_alpha) {
+ *dest_scan = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ }
+ dest_scan ++;
+ }
+}
+void _CompositeRow_ByteMask2Gray(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int mask_alpha, int src_gray,
+ int pixel_count, FX_LPCBYTE clip_scan)
+{
+ for (int col = 0; col < pixel_count; col ++) {
+ int src_alpha;
+ if (clip_scan) {
+ src_alpha = mask_alpha * clip_scan[col] * src_scan[col] / 255 / 255;
+ } else {
+ src_alpha = mask_alpha * src_scan[col] / 255;
+ }
+ if (src_alpha) {
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_gray, src_alpha);
+ }
+ dest_scan ++;
+ }
+}
+void _CompositeRow_ByteMask2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int mask_alpha, int src_gray,
+ int pixel_count, FX_LPCBYTE clip_scan,
+ FX_LPBYTE dest_alpha_scan)
+{
+ for (int col = 0; col < pixel_count; col ++) {
+ int src_alpha;
+ if (clip_scan) {
+ src_alpha = mask_alpha * clip_scan[col] * src_scan[col] / 255 / 255;
+ } else {
+ src_alpha = mask_alpha * src_scan[col] / 255;
+ }
+ FX_BYTE back_alpha = *dest_alpha_scan;
+ if (back_alpha == 0) {
+ *dest_scan ++ = src_gray;
+ *dest_alpha_scan ++ = src_alpha;
+ continue;
+ }
+ if (src_alpha == 0) {
+ dest_scan ++;
+ dest_alpha_scan ++;
+ continue;
+ }
+ FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ *dest_alpha_scan++ = dest_alpha;
+ int alpha_ratio = src_alpha * 255 / dest_alpha;
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_gray, alpha_ratio);
+ dest_scan ++;
+ }
+}
+void _CompositeRow_BitMask2Argb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int mask_alpha, int src_r, int src_g, int src_b,
+ int src_left, int pixel_count, int blend_type, FX_LPCBYTE clip_scan)
+{
+ if (blend_type == FXDIB_BLEND_NORMAL && clip_scan == NULL && mask_alpha == 255) {
+ FX_ARGB argb = FXARGB_MAKE(0xff, src_r, src_g, src_b);
+ for (int col = 0; col < pixel_count; col ++) {
+ if (src_scan[(src_left + col) / 8] & (1 << (7 - (src_left + col) % 8))) {
+ FXARGB_SETDIB(dest_scan, argb);
+ }
+ dest_scan += 4;
+ }
+ return;
+ }
+ for (int col = 0; col < pixel_count; col ++) {
+ if (!(src_scan[(src_left + col) / 8] & (1 << (7 - (src_left + col) % 8)))) {
+ dest_scan += 4;
+ continue;
+ }
+ int src_alpha;
+ if (clip_scan) {
+ src_alpha = mask_alpha * clip_scan[col] / 255;
+ } else {
+ src_alpha = mask_alpha;
+ }
+ FX_BYTE back_alpha = dest_scan[3];
+ if (back_alpha == 0) {
+ FXARGB_SETDIB(dest_scan, FXARGB_MAKE(src_alpha, src_r, src_g, src_b));
+ dest_scan += 4;
+ continue;
+ }
+ FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ dest_scan[3] = dest_alpha;
+ int alpha_ratio = src_alpha * 255 / dest_alpha;
+ if (blend_type >= FXDIB_BLEND_NONSEPARABLE) {
+ int blended_colors[3];
+ FX_BYTE src_scan[3];
+ src_scan[0] = src_b;
+ src_scan[1] = src_g;
+ src_scan[2] = src_r;
+ _RGB_Blend(blend_type, src_scan, dest_scan, blended_colors);
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended_colors[0], alpha_ratio);
+ dest_scan ++;
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended_colors[1], alpha_ratio);
+ dest_scan ++;
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended_colors[2], alpha_ratio);
+ } else if (blend_type) {
+ int blended = _BLEND(blend_type, *dest_scan, src_b);
+ blended = FXDIB_ALPHA_MERGE(src_b, blended, back_alpha);
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended, alpha_ratio);
+ dest_scan ++;
+ blended = _BLEND(blend_type, *dest_scan, src_g);
+ blended = FXDIB_ALPHA_MERGE(src_g, blended, back_alpha);
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended, alpha_ratio);
+ dest_scan ++;
+ blended = _BLEND(blend_type, *dest_scan, src_r);
+ blended = FXDIB_ALPHA_MERGE(src_r, blended, back_alpha);
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended, alpha_ratio);
+ } else {
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_b, alpha_ratio);
+ dest_scan ++;
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_g, alpha_ratio);
+ dest_scan ++;
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_r, alpha_ratio);
+ }
+ dest_scan += 2;
+ }
+}
+void _CompositeRow_BitMask2Rgba(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int mask_alpha, int src_r, int src_g, int src_b,
+ int src_left, int pixel_count, int blend_type, FX_LPCBYTE clip_scan,
+ FX_LPBYTE dest_alpha_scan)
+{
+ if (blend_type == FXDIB_BLEND_NORMAL && clip_scan == NULL && mask_alpha == 255) {
+ for (int col = 0; col < pixel_count; col ++) {
+ if (src_scan[(src_left + col) / 8] & (1 << (7 - (src_left + col) % 8))) {
+ dest_scan[0] = src_b;
+ dest_scan[1] = src_g;
+ dest_scan[2] = src_r;
+ *dest_alpha_scan = mask_alpha;
+ }
+ dest_scan += 3;
+ dest_alpha_scan ++;
+ }
+ return;
+ }
+ for (int col = 0; col < pixel_count; col ++) {
+ if (!(src_scan[(src_left + col) / 8] & (1 << (7 - (src_left + col) % 8)))) {
+ dest_scan += 3;
+ dest_alpha_scan ++;
+ continue;
+ }
+ int src_alpha;
+ if (clip_scan) {
+ src_alpha = mask_alpha * clip_scan[col] / 255;
+ } else {
+ src_alpha = mask_alpha;
+ }
+ FX_BYTE back_alpha = dest_scan[3];
+ if (back_alpha == 0) {
+ *dest_scan ++ = src_b;
+ *dest_scan ++ = src_g;
+ *dest_scan ++ = src_r;
+ *dest_alpha_scan ++ = mask_alpha;
+ continue;
+ }
+ FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ *dest_alpha_scan ++ = dest_alpha;
+ int alpha_ratio = src_alpha * 255 / dest_alpha;
+ if (blend_type >= FXDIB_BLEND_NONSEPARABLE) {
+ int blended_colors[3];
+ FX_BYTE src_scan[3];
+ src_scan[0] = src_b;
+ src_scan[1] = src_g;
+ src_scan[2] = src_r;
+ _RGB_Blend(blend_type, src_scan, dest_scan, blended_colors);
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended_colors[0], alpha_ratio);
+ dest_scan ++;
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended_colors[1], alpha_ratio);
+ dest_scan ++;
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended_colors[2], alpha_ratio);
+ dest_scan ++;
+ } else if (blend_type) {
+ int blended = _BLEND(blend_type, *dest_scan, src_b);
+ blended = FXDIB_ALPHA_MERGE(src_b, blended, back_alpha);
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended, alpha_ratio);
+ dest_scan ++;
+ blended = _BLEND(blend_type, *dest_scan, src_g);
+ blended = FXDIB_ALPHA_MERGE(src_g, blended, back_alpha);
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended, alpha_ratio);
+ dest_scan ++;
+ blended = _BLEND(blend_type, *dest_scan, src_r);
+ blended = FXDIB_ALPHA_MERGE(src_r, blended, back_alpha);
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended, alpha_ratio);
+ dest_scan ++;
+ } else {
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_b, alpha_ratio);
+ dest_scan ++;
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_g, alpha_ratio);
+ dest_scan ++;
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_r, alpha_ratio);
+ dest_scan ++;
+ }
+ }
+}
+void _CompositeRow_BitMask2Rgb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int mask_alpha, int src_r, int src_g, int src_b,
+ int src_left, int pixel_count, int blend_type, int Bpp, FX_LPCBYTE clip_scan)
+{
+ if (blend_type == FXDIB_BLEND_NORMAL && clip_scan == NULL && mask_alpha == 255) {
+ for (int col = 0; col < pixel_count; col ++) {
+ if (src_scan[(src_left + col) / 8] & (1 << (7 - (src_left + col) % 8))) {
+ dest_scan[2] = src_r;
+ dest_scan[1] = src_g;
+ dest_scan[0] = src_b;
+ }
+ dest_scan += Bpp;
+ }
+ return;
+ }
+ for (int col = 0; col < pixel_count; col ++) {
+ if (!(src_scan[(src_left + col) / 8] & (1 << (7 - (src_left + col) % 8)))) {
+ dest_scan += Bpp;
+ continue;
+ }
+ int src_alpha;
+ if (clip_scan) {
+ src_alpha = mask_alpha * clip_scan[col] / 255;
+ } else {
+ src_alpha = mask_alpha;
+ }
+ if (src_alpha == 0) {
+ dest_scan += Bpp;
+ continue;
+ }
+ if (blend_type >= FXDIB_BLEND_NONSEPARABLE) {
+ int blended_colors[3];
+ FX_BYTE src_scan[3];
+ src_scan[0] = src_b;
+ src_scan[1] = src_g;
+ src_scan[2] = src_r;
+ _RGB_Blend(blend_type, src_scan, dest_scan, blended_colors);
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended_colors[0], src_alpha);
+ dest_scan ++;
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended_colors[1], src_alpha);
+ dest_scan ++;
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended_colors[2], src_alpha);
+ } else if (blend_type) {
+ int blended = _BLEND(blend_type, *dest_scan, src_b);
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended, src_alpha);
+ dest_scan++;
+ blended = _BLEND(blend_type, *dest_scan, src_g);
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended, src_alpha);
+ dest_scan++;
+ blended = _BLEND(blend_type, *dest_scan, src_r);
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, blended, src_alpha);
+ } else {
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_b, src_alpha);
+ dest_scan ++;
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_g, src_alpha);
+ dest_scan ++;
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_r, src_alpha);
+ }
+ dest_scan += Bpp - 2;
+ }
+}
+void _CompositeRow_BitMask2Mask(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int mask_alpha, int src_left,
+ int pixel_count, FX_LPCBYTE clip_scan)
+{
+ for (int col = 0; col < pixel_count; col ++) {
+ if (!(src_scan[(src_left + col) / 8] & (1 << (7 - (src_left + col) % 8)))) {
+ dest_scan ++;
+ continue;
+ }
+ int src_alpha;
+ if (clip_scan) {
+ src_alpha = mask_alpha * clip_scan[col] / 255;
+ } else {
+ src_alpha = mask_alpha;
+ }
+ FX_BYTE back_alpha = *dest_scan;
+ if (!back_alpha) {
+ *dest_scan = src_alpha;
+ } else if (src_alpha) {
+ *dest_scan = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ }
+ dest_scan ++;
+ }
+}
+void _CompositeRow_BitMask2Gray(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int mask_alpha, int src_gray,
+ int src_left, int pixel_count, FX_LPCBYTE clip_scan)
+{
+ for (int col = 0; col < pixel_count; col ++) {
+ if (!(src_scan[(src_left + col) / 8] & (1 << (7 - (src_left + col) % 8)))) {
+ dest_scan ++;
+ continue;
+ }
+ int src_alpha;
+ if (clip_scan) {
+ src_alpha = mask_alpha * clip_scan[col] / 255;
+ } else {
+ src_alpha = mask_alpha;
+ }
+ if (src_alpha) {
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_gray, src_alpha);
+ }
+ dest_scan ++;
+ }
+}
+void _CompositeRow_BitMask2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int mask_alpha, int src_gray,
+ int src_left, int pixel_count, FX_LPCBYTE clip_scan,
+ FX_LPBYTE dest_alpha_scan)
+{
+ for (int col = 0; col < pixel_count; col ++) {
+ if (!(src_scan[(src_left + col) / 8] & (1 << (7 - (src_left + col) % 8)))) {
+ dest_scan ++;
+ dest_alpha_scan ++;
+ continue;
+ }
+ int src_alpha;
+ if (clip_scan) {
+ src_alpha = mask_alpha * clip_scan[col] / 255;
+ } else {
+ src_alpha = mask_alpha;
+ }
+ FX_BYTE back_alpha = *dest_alpha_scan;
+ if (back_alpha == 0) {
+ *dest_scan ++ = src_gray;
+ *dest_alpha_scan ++ = src_alpha;
+ continue;
+ }
+ if (src_alpha == 0) {
+ dest_scan ++;
+ dest_alpha_scan ++;
+ continue;
+ }
+ FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ *dest_alpha_scan++ = dest_alpha;
+ int alpha_ratio = src_alpha * 255 / dest_alpha;
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_gray, alpha_ratio);
+ dest_scan ++;
+ }
+}
+void _CompositeRow_Argb2Argb_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixel_count, int blend_type, FX_LPCBYTE clip_scan)
+{
+ int blended_colors[3];
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ for (int col = 0; col < pixel_count; col ++) {
+ FX_BYTE back_alpha = dest_scan[3];
+ if (back_alpha == 0) {
+ if (clip_scan) {
+ int src_alpha = clip_scan[col] * src_scan[3] / 255;
+ dest_scan[3] = src_alpha;
+ dest_scan[0] = src_scan[2];
+ dest_scan[1] = src_scan[1];
+ dest_scan[2] = src_scan[0];
+ } else {
+ FXARGB_RGBORDERCOPY(dest_scan, src_scan);
+ }
+ dest_scan += 4;
+ src_scan += 4;
+ continue;
+ }
+ FX_BYTE src_alpha;
+ if (clip_scan == NULL) {
+ src_alpha = src_scan[3];
+ } else {
+ src_alpha = clip_scan[col] * src_scan[3] / 255;
+ }
+ if (src_alpha == 0) {
+ dest_scan += 4;
+ src_scan += 4;
+ continue;
+ }
+ FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ dest_scan[3] = dest_alpha;
+ int alpha_ratio = src_alpha * 255 / dest_alpha;
+ if (bNonseparableBlend) {
+ FX_BYTE dest_scan_o[3];
+ dest_scan_o[0] = dest_scan[2];
+ dest_scan_o[1] = dest_scan[1];
+ dest_scan_o[2] = dest_scan[0];
+ _RGB_Blend(blend_type, src_scan, dest_scan_o, blended_colors);
+ }
+ for (int color = 0; color < 3; color ++) {
+ int index = 2 - color;
+ if (blend_type) {
+ int blended = bNonseparableBlend ? blended_colors[color] :
+ _BLEND(blend_type, dest_scan[index], *src_scan);
+ blended = FXDIB_ALPHA_MERGE(*src_scan, blended, back_alpha);
+ dest_scan[index] = FXDIB_ALPHA_MERGE(dest_scan[index], blended, alpha_ratio);
+ } else {
+ dest_scan[index] = FXDIB_ALPHA_MERGE(dest_scan[index], *src_scan, alpha_ratio);
+ }
+ src_scan ++;
+ }
+ dest_scan += 4;
+ src_scan++;
+ }
+}
+void _CompositeRow_Rgb2Argb_Blend_NoClip_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int blend_type, int src_Bpp)
+{
+ int blended_colors[3];
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ int src_gap = src_Bpp - 3;
+ for (int col = 0; col < width; col ++) {
+ FX_BYTE back_alpha = dest_scan[3];
+ if (back_alpha == 0) {
+ if (src_Bpp == 4) {
+ FXARGB_SETRGBORDERDIB(dest_scan, 0xff000000 | FXARGB_GETDIB(src_scan));
+ } else {
+ FXARGB_SETRGBORDERDIB(dest_scan, FXARGB_MAKE(0xff, src_scan[2], src_scan[1], src_scan[0]));
+ }
+ dest_scan += 4;
+ src_scan += src_Bpp;
+ continue;
+ }
+ dest_scan[3] = 0xff;
+ if (bNonseparableBlend) {
+ FX_BYTE dest_scan_o[3];
+ dest_scan_o[0] = dest_scan[2];
+ dest_scan_o[1] = dest_scan[1];
+ dest_scan_o[2] = dest_scan[0];
+ _RGB_Blend(blend_type, src_scan, dest_scan_o, blended_colors);
+ }
+ for (int color = 0; color < 3; color ++) {
+ int index = 2 - color;
+ int src_color = FX_GAMMA(*src_scan);
+ int blended = bNonseparableBlend ? blended_colors[color] :
+ _BLEND(blend_type, dest_scan[index], src_color);
+ dest_scan[index] = FXDIB_ALPHA_MERGE(src_color, blended, back_alpha);
+ src_scan ++;
+ }
+ dest_scan += 4;
+ src_scan += src_gap;
+ }
+}
+inline void _CompositeRow_Argb2Rgb_Blend_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int blend_type, int dest_Bpp, FX_LPCBYTE clip_scan)
+{
+ int blended_colors[3];
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ for (int col = 0; col < width; col ++) {
+ FX_BYTE src_alpha;
+ if (clip_scan) {
+ src_alpha = src_scan[3] * (*clip_scan++) / 255;
+ } else {
+ src_alpha = src_scan[3];
+ }
+ if (src_alpha == 0) {
+ dest_scan += dest_Bpp;
+ src_scan += 4;
+ continue;
+ }
+ if (bNonseparableBlend) {
+ FX_BYTE dest_scan_o[3];
+ dest_scan_o[0] = dest_scan[2];
+ dest_scan_o[1] = dest_scan[1];
+ dest_scan_o[2] = dest_scan[0];
+ _RGB_Blend(blend_type, src_scan, dest_scan_o, blended_colors);
+ }
+ for (int color = 0; color < 3; color ++) {
+ int index = 2 - color;
+ int back_color = FX_GAMMA(dest_scan[index]);
+ int blended = bNonseparableBlend ? blended_colors[color] :
+ _BLEND(blend_type, back_color, *src_scan);
+ dest_scan[index] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(back_color, blended, src_alpha));
+ src_scan ++;
+ }
+ dest_scan += dest_Bpp;
+ src_scan ++;
+ }
+}
+inline void _CompositeRow_Rgb2Argb_NoBlend_NoClip_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int src_Bpp)
+{
+ int src_gap = src_Bpp - 3;
+ for (int col = 0; col < width; col ++) {
+ if (src_Bpp == 4) {
+ FXARGB_SETRGBORDERDIB(dest_scan, 0xff000000 | FXARGB_GETDIB(src_scan));
+ } else {
+ FXARGB_SETRGBORDERDIB(dest_scan, FXARGB_MAKE(0xff, src_scan[2], src_scan[1], src_scan[0]));
+ }
+ dest_scan += 4;
+ src_scan += src_Bpp;
+ }
+}
+inline void _CompositeRow_Rgb2Rgb_Blend_NoClip_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int blend_type, int dest_Bpp, int src_Bpp)
+{
+ int blended_colors[3];
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ int src_gap = src_Bpp - 3;
+ for (int col = 0; col < width; col ++) {
+ if (bNonseparableBlend) {
+ FX_BYTE dest_scan_o[3];
+ dest_scan_o[0] = dest_scan[2];
+ dest_scan_o[1] = dest_scan[1];
+ dest_scan_o[2] = dest_scan[0];
+ _RGB_Blend(blend_type, src_scan, dest_scan_o, blended_colors);
+ }
+ for (int color = 0; color < 3; color ++) {
+ int index = 2 - color;
+ int back_color = FX_GAMMA(dest_scan[index]);
+ int src_color = FX_GAMMA(*src_scan);
+ int blended = bNonseparableBlend ? blended_colors[color] :
+ _BLEND(blend_type, back_color, src_color);
+ dest_scan[index] = FX_GAMMA_INVERSE(blended);
+ src_scan ++;
+ }
+ dest_scan += dest_Bpp;
+ src_scan += src_gap;
+ }
+}
+inline void _CompositeRow_Argb2Rgb_NoBlend_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int dest_Bpp, FX_LPCBYTE clip_scan)
+{
+ for (int col = 0; col < width; col ++) {
+ FX_BYTE src_alpha;
+ if (clip_scan) {
+ src_alpha = src_scan[3] * (*clip_scan++) / 255;
+ } else {
+ src_alpha = src_scan[3];
+ }
+ if (src_alpha == 255) {
+ dest_scan[2] = FX_GAMMA_INVERSE(*src_scan++);
+ dest_scan[1] = FX_GAMMA_INVERSE(*src_scan++);
+ dest_scan[0] = FX_GAMMA_INVERSE(*src_scan++);
+ dest_scan += dest_Bpp;
+ src_scan ++;
+ continue;
+ }
+ if (src_alpha == 0) {
+ dest_scan += dest_Bpp;
+ src_scan += 4;
+ continue;
+ }
+ for (int color = 0; color < 3; color ++) {
+ int index = 2 - color;
+ dest_scan[index] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[index]), *src_scan, src_alpha));
+ src_scan ++;
+ }
+ dest_scan += dest_Bpp;
+ src_scan ++;
+ }
+}
+inline void _CompositeRow_Rgb2Rgb_NoBlend_NoClip_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int dest_Bpp, int src_Bpp)
+{
+ for (int col = 0; col < width; col ++) {
+ dest_scan[2] = src_scan[0];
+ dest_scan[1] = src_scan[1];
+ dest_scan[0] = src_scan[2];
+ dest_scan += dest_Bpp;
+ src_scan += src_Bpp;
+ }
+}
+inline void _CompositeRow_Rgb2Argb_Blend_Clip_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int blend_type, int src_Bpp, FX_LPCBYTE clip_scan)
+{
+ int blended_colors[3];
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ int src_gap = src_Bpp - 3;
+ for (int col = 0; col < width; col ++) {
+ int src_alpha = *clip_scan ++;
+ FX_BYTE back_alpha = dest_scan[3];
+ if (back_alpha == 0) {
+ dest_scan[2] = FX_GAMMA(*src_scan++);
+ dest_scan[1] = FX_GAMMA(*src_scan++);
+ dest_scan[0] = FX_GAMMA(*src_scan++);
+ src_scan += src_gap;
+ dest_scan += 4;
+ continue;
+ }
+ if (src_alpha == 0) {
+ dest_scan += 4;
+ src_scan += src_Bpp;
+ continue;
+ }
+ FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ dest_scan[3] = dest_alpha;
+ int alpha_ratio = src_alpha * 255 / dest_alpha;
+ if (bNonseparableBlend) {
+ FX_BYTE dest_scan_o[3];
+ dest_scan_o[0] = dest_scan[2];
+ dest_scan_o[1] = dest_scan[1];
+ dest_scan_o[2] = dest_scan[0];
+ _RGB_Blend(blend_type, src_scan, dest_scan_o, blended_colors);
+ }
+ for (int color = 0; color < 3; color ++) {
+ int index = 2 - color;
+ int src_color = FX_GAMMA(*src_scan);
+ int blended = bNonseparableBlend ? blended_colors[color] :
+ _BLEND(blend_type, dest_scan[index], src_color);
+ blended = FXDIB_ALPHA_MERGE(src_color, blended, back_alpha);
+ dest_scan[index] = FXDIB_ALPHA_MERGE(dest_scan[index], blended, alpha_ratio);
+ src_scan ++;
+ }
+ dest_scan += 4;
+ src_scan += src_gap;
+ }
+}
+inline void _CompositeRow_Rgb2Rgb_Blend_Clip_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int blend_type, int dest_Bpp, int src_Bpp, FX_LPCBYTE clip_scan)
+{
+ int blended_colors[3];
+ FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
+ int src_gap = src_Bpp - 3;
+ for (int col = 0; col < width; col ++) {
+ FX_BYTE src_alpha = *clip_scan ++;
+ if (src_alpha == 0) {
+ dest_scan += dest_Bpp;
+ src_scan += src_Bpp;
+ continue;
+ }
+ if (bNonseparableBlend) {
+ FX_BYTE dest_scan_o[3];
+ dest_scan_o[0] = dest_scan[2];
+ dest_scan_o[1] = dest_scan[1];
+ dest_scan_o[2] = dest_scan[0];
+ _RGB_Blend(blend_type, src_scan, dest_scan_o, blended_colors);
+ }
+ for (int color = 0; color < 3; color ++) {
+ int index = 2 - color;
+ int src_color = FX_GAMMA(*src_scan);
+ int back_color = FX_GAMMA(dest_scan[index]);
+ int blended = bNonseparableBlend ? blended_colors[color] :
+ _BLEND(blend_type, back_color, src_color);
+ dest_scan[index] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(back_color, blended, src_alpha));
+ src_scan ++;
+ }
+ dest_scan += dest_Bpp;
+ src_scan += src_gap;
+ }
+}
+inline void _CompositeRow_Rgb2Argb_NoBlend_Clip_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int src_Bpp, FX_LPCBYTE clip_scan)
+{
+ int src_gap = src_Bpp - 3;
+ for (int col = 0; col < width; col ++) {
+ int src_alpha = clip_scan[col];
+ if (src_alpha == 255) {
+ dest_scan[2] = FX_GAMMA(*src_scan++);
+ dest_scan[1] = FX_GAMMA(*src_scan++);
+ dest_scan[0] = FX_GAMMA(*src_scan++);
+ dest_scan[3] = 255;
+ dest_scan += 4;
+ src_scan += src_gap;
+ continue;
+ }
+ if (src_alpha == 0) {
+ dest_scan += 4;
+ src_scan += src_Bpp;
+ continue;
+ }
+ int back_alpha = dest_scan[3];
+ FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ dest_scan[3] = dest_alpha;
+ int alpha_ratio = src_alpha * 255 / dest_alpha;
+ for (int color = 0; color < 3; color ++) {
+ int index = 2 - color;
+ dest_scan[index] = FXDIB_ALPHA_MERGE(dest_scan[index], FX_GAMMA(*src_scan), alpha_ratio);
+ src_scan ++;
+ }
+ dest_scan += 4;
+ src_scan += src_gap;
+ }
+}
+inline void _CompositeRow_Rgb2Rgb_NoBlend_Clip_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int dest_Bpp, int src_Bpp, FX_LPCBYTE clip_scan)
+{
+ for (int col = 0; col < width; col ++) {
+ int src_alpha = clip_scan[col];
+ if (src_alpha == 255) {
+ dest_scan[2] = src_scan[0];
+ dest_scan[1] = src_scan[1];
+ dest_scan[0] = src_scan[2];
+ } else if (src_alpha) {
+ dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), FX_GAMMA(*src_scan), src_alpha));
+ src_scan ++;
+ dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), FX_GAMMA(*src_scan), src_alpha));
+ src_scan ++;
+ dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), FX_GAMMA(*src_scan), src_alpha));
+ dest_scan += dest_Bpp;
+ src_scan += src_Bpp - 2;
+ continue;
+ }
+ dest_scan += dest_Bpp;
+ src_scan += src_Bpp;
+ }
+}
+inline void _CompositeRow_8bppRgb2Rgb_NoBlend_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, FX_ARGB* pPalette, int pixel_count,
+ int DestBpp, FX_LPCBYTE clip_scan)
+{
+ for (int col = 0; col < pixel_count; col ++) {
+ FX_ARGB argb = pPalette ? pPalette[*src_scan] : (*src_scan) * 0x010101;
+ int src_r = FXARGB_R(argb);
+ int src_g = FXARGB_G(argb);
+ int src_b = FXARGB_B(argb);
+ if (clip_scan && clip_scan[col] < 255) {
+ dest_scan[2] = FXDIB_ALPHA_MERGE(dest_scan[2], src_b, clip_scan[col]);
+ dest_scan[1] = FXDIB_ALPHA_MERGE(dest_scan[1], src_g, clip_scan[col]);
+ dest_scan[0] = FXDIB_ALPHA_MERGE(dest_scan[0], src_r, clip_scan[col]);
+ } else {
+ dest_scan[2] = src_b;
+ dest_scan[1] = src_g;
+ dest_scan[0] = src_r;
+ }
+ dest_scan += DestBpp;
+ src_scan ++;
+ }
+}
+inline void _CompositeRow_1bppRgb2Rgb_NoBlend_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int src_left,
+ FX_ARGB* pPalette, int pixel_count, int DestBpp, FX_LPCBYTE clip_scan)
+{
+ int reset_r, reset_g, reset_b;
+ int set_r, set_g, set_b;
+ if (pPalette) {
+ reset_r = FXARGB_R(pPalette[0]);
+ reset_g = FXARGB_G(pPalette[0]);
+ reset_b = FXARGB_B(pPalette[0]);
+ set_r = FXARGB_R(pPalette[1]);
+ set_g = FXARGB_G(pPalette[1]);
+ set_b = FXARGB_B(pPalette[1]);
+ } else {
+ reset_r = reset_g = reset_b = 0;
+ set_r = set_g = set_b = 255;
+ }
+ for (int col = 0; col < pixel_count; col ++) {
+ int src_r, src_g, src_b;
+ if (src_scan[(col + src_left) / 8] & (1 << (7 - (col + src_left) % 8))) {
+ src_r = set_r;
+ src_g = set_g;
+ src_b = set_b;
+ } else {
+ src_r = reset_r;
+ src_g = reset_g;
+ src_b = reset_b;
+ }
+ if (clip_scan && clip_scan[col] < 255) {
+ dest_scan[2] = FXDIB_ALPHA_MERGE(dest_scan[2], src_b, clip_scan[col]);
+ dest_scan[1] = FXDIB_ALPHA_MERGE(dest_scan[1], src_g, clip_scan[col]);
+ dest_scan[0] = FXDIB_ALPHA_MERGE(dest_scan[0], src_r, clip_scan[col]);
+ } else {
+ dest_scan[2] = src_b;
+ dest_scan[1] = src_g;
+ dest_scan[0] = src_r;
+ }
+ dest_scan += DestBpp;
+ }
+}
+inline void _CompositeRow_8bppRgb2Argb_NoBlend_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width,
+ FX_ARGB* pPalette, FX_LPCBYTE clip_scan)
+{
+ for (int col = 0; col < width; col ++) {
+ int src_r, src_g, src_b;
+ if (pPalette) {
+ FX_ARGB argb = pPalette[*src_scan];
+ src_r = FXARGB_R(argb);
+ src_g = FXARGB_G(argb);
+ src_b = FXARGB_B(argb);
+ } else {
+ src_r = src_g = src_b = *src_scan;
+ }
+ if (clip_scan == NULL || clip_scan[col] == 255) {
+ dest_scan[2] = FX_GAMMA(src_b);
+ dest_scan[1] = FX_GAMMA(src_g);
+ dest_scan[0] = FX_GAMMA(src_r);
+ dest_scan[3] = 255;
+ src_scan ++;
+ dest_scan += 4;
+ continue;
+ }
+ int src_alpha = clip_scan[col];
+ if (src_alpha == 0) {
+ dest_scan += 4;
+ src_scan ++;
+ continue;
+ }
+ int back_alpha = dest_scan[3];
+ FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ dest_scan[3] = dest_alpha;
+ int alpha_ratio = src_alpha * 255 / dest_alpha;
+ dest_scan[2] = FXDIB_ALPHA_MERGE(dest_scan[2], FX_GAMMA(src_b), alpha_ratio);
+ dest_scan[1] = FXDIB_ALPHA_MERGE(dest_scan[1], FX_GAMMA(src_g), alpha_ratio);
+ dest_scan[0] = FXDIB_ALPHA_MERGE(dest_scan[0], FX_GAMMA(src_r), alpha_ratio);
+ dest_scan += 4;
+ src_scan ++;
+ }
+}
+inline void _CompositeRow_1bppRgb2Argb_NoBlend_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int src_left, int width,
+ FX_ARGB* pPalette, FX_LPCBYTE clip_scan)
+{
+ int reset_r, reset_g, reset_b;
+ int set_r, set_g, set_b;
+ if (pPalette) {
+ reset_r = FXARGB_R(pPalette[0]);
+ reset_g = FXARGB_G(pPalette[0]);
+ reset_b = FXARGB_B(pPalette[0]);
+ set_r = FXARGB_R(pPalette[1]);
+ set_g = FXARGB_G(pPalette[1]);
+ set_b = FXARGB_B(pPalette[1]);
+ } else {
+ reset_r = reset_g = reset_b = 0;
+ set_r = set_g = set_b = 255;
+ }
+ for (int col = 0; col < width; col ++) {
+ int src_r, src_g, src_b;
+ if (src_scan[(col + src_left) / 8] & (1 << (7 - (col + src_left) % 8))) {
+ src_r = set_r;
+ src_g = set_g;
+ src_b = set_b;
+ } else {
+ src_r = reset_r;
+ src_g = reset_g;
+ src_b = reset_b;
+ }
+ if (clip_scan == NULL || clip_scan[col] == 255) {
+ dest_scan[2] = FX_GAMMA(src_b);
+ dest_scan[1] = FX_GAMMA(src_g);
+ dest_scan[0] = FX_GAMMA(src_r);
+ dest_scan[3] = 255;
+ dest_scan += 4;
+ continue;
+ }
+ int src_alpha = clip_scan[col];
+ if (src_alpha == 0) {
+ dest_scan += 4;
+ continue;
+ }
+ int back_alpha = dest_scan[3];
+ FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ dest_scan[3] = dest_alpha;
+ int alpha_ratio = src_alpha * 255 / dest_alpha;
+ dest_scan[2] = FXDIB_ALPHA_MERGE(dest_scan[2], FX_GAMMA(src_b), alpha_ratio);
+ dest_scan[1] = FXDIB_ALPHA_MERGE(dest_scan[1], FX_GAMMA(src_g), alpha_ratio);
+ dest_scan[0] = FXDIB_ALPHA_MERGE(dest_scan[0], FX_GAMMA(src_r), alpha_ratio);
+ dest_scan += 4;
+ }
+}
+void _CompositeRow_ByteMask2Argb_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int mask_alpha, int src_r, int src_g, int src_b, int pixel_count,
+ int blend_type, FX_LPCBYTE clip_scan)
+{
+ for (int col = 0; col < pixel_count; col ++) {
+ int src_alpha;
+ if (clip_scan) {
+ src_alpha = mask_alpha * clip_scan[col] * src_scan[col] / 255 / 255;
+ } else {
+ src_alpha = mask_alpha * src_scan[col] / 255;
+ }
+ FX_BYTE back_alpha = dest_scan[3];
+ if (back_alpha == 0) {
+ FXARGB_SETRGBORDERDIB(dest_scan, FXARGB_MAKE(src_alpha, src_r, src_g, src_b));
+ dest_scan += 4;
+ continue;
+ }
+ if (src_alpha == 0) {
+ dest_scan += 4;
+ continue;
+ }
+ FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ dest_scan[3] = dest_alpha;
+ int alpha_ratio = src_alpha * 255 / dest_alpha;
+ if (blend_type >= FXDIB_BLEND_NONSEPARABLE) {
+ int blended_colors[3];
+ FX_BYTE src_scan[3];
+ FX_BYTE dest_scan_o[3];
+ src_scan[0] = src_b;
+ src_scan[1] = src_g;
+ src_scan[2] = src_r;
+ dest_scan_o[0] = dest_scan[2];
+ dest_scan_o[1] = dest_scan[1];
+ dest_scan_o[2] = dest_scan[0];
+ _RGB_Blend(blend_type, src_scan, dest_scan_o, blended_colors);
+ dest_scan[2] = FXDIB_ALPHA_MERGE(dest_scan[2], blended_colors[0], alpha_ratio);
+ dest_scan[1] = FXDIB_ALPHA_MERGE(dest_scan[1], blended_colors[1], alpha_ratio);
+ dest_scan[0] = FXDIB_ALPHA_MERGE(dest_scan[0], blended_colors[2], alpha_ratio);
+ } else if (blend_type) {
+ int blended = _BLEND(blend_type, dest_scan[2], src_b);
+ blended = FXDIB_ALPHA_MERGE(src_b, blended, back_alpha);
+ dest_scan[2] = FXDIB_ALPHA_MERGE(dest_scan[2], blended, alpha_ratio);
+ blended = _BLEND(blend_type, dest_scan[1], src_g);
+ blended = FXDIB_ALPHA_MERGE(src_g, blended, back_alpha);
+ dest_scan[1] = FXDIB_ALPHA_MERGE(dest_scan[1], blended, alpha_ratio);
+ blended = _BLEND(blend_type, dest_scan[0], src_r);
+ blended = FXDIB_ALPHA_MERGE(src_r, blended, back_alpha);
+ dest_scan[0] = FXDIB_ALPHA_MERGE(dest_scan[0], blended, alpha_ratio);
+ } else {
+ dest_scan[2] = FXDIB_ALPHA_MERGE(dest_scan[2], src_b, alpha_ratio);
+ dest_scan[1] = FXDIB_ALPHA_MERGE(dest_scan[1], src_g, alpha_ratio);
+ dest_scan[0] = FXDIB_ALPHA_MERGE(dest_scan[0], src_r, alpha_ratio);
+ }
+ dest_scan += 4;
+ }
+}
+void _CompositeRow_ByteMask2Rgb_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int mask_alpha, int src_r, int src_g, int src_b, int pixel_count,
+ int blend_type, int Bpp, FX_LPCBYTE clip_scan)
+{
+ for (int col = 0; col < pixel_count; col ++) {
+ int src_alpha;
+ if (clip_scan) {
+ src_alpha = mask_alpha * clip_scan[col] * src_scan[col] / 255 / 255;
+ } else {
+ src_alpha = mask_alpha * src_scan[col] / 255;
+ }
+ if (src_alpha == 0) {
+ dest_scan += Bpp;
+ continue;
+ }
+ if (blend_type >= FXDIB_BLEND_NONSEPARABLE) {
+ int blended_colors[3];
+ FX_BYTE src_scan[3];
+ FX_BYTE dest_scan_o[3];
+ src_scan[0] = src_b;
+ src_scan[1] = src_g;
+ src_scan[2] = src_r;
+ dest_scan_o[0] = dest_scan[2];
+ dest_scan_o[1] = dest_scan[1];
+ dest_scan_o[2] = dest_scan[0];
+ _RGB_Blend(blend_type, src_scan, dest_scan_o, blended_colors);
+ dest_scan[2] = FXDIB_ALPHA_MERGE(dest_scan[2], blended_colors[0], src_alpha);
+ dest_scan[1] = FXDIB_ALPHA_MERGE(dest_scan[1], blended_colors[1], src_alpha);
+ dest_scan[0] = FXDIB_ALPHA_MERGE(dest_scan[0], blended_colors[2], src_alpha);
+ } else if (blend_type) {
+ int blended = _BLEND(blend_type, dest_scan[2], src_b);
+ dest_scan[2] = FXDIB_ALPHA_MERGE(dest_scan[2], blended, src_alpha);
+ blended = _BLEND(blend_type, dest_scan[1], src_g);
+ dest_scan[1] = FXDIB_ALPHA_MERGE(dest_scan[1], blended, src_alpha);
+ blended = _BLEND(blend_type, dest_scan[0], src_r);
+ dest_scan[0] = FXDIB_ALPHA_MERGE(dest_scan[0], blended, src_alpha);
+ } else {
+ dest_scan[2] = FXDIB_ALPHA_MERGE(dest_scan[2], src_b, src_alpha);
+ dest_scan[1] = FXDIB_ALPHA_MERGE(dest_scan[1], src_g, src_alpha);
+ dest_scan[0] = FXDIB_ALPHA_MERGE(dest_scan[0], src_r, src_alpha);
+ }
+ dest_scan += Bpp;
+ }
+}
+void _CompositeRow_BitMask2Argb_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int mask_alpha, int src_r, int src_g, int src_b,
+ int src_left, int pixel_count, int blend_type, FX_LPCBYTE clip_scan)
+{
+ if (blend_type == FXDIB_BLEND_NORMAL && clip_scan == NULL && mask_alpha == 255) {
+ FX_ARGB argb = FXARGB_MAKE(0xff, src_r, src_g, src_b);
+ for (int col = 0; col < pixel_count; col ++) {
+ if (src_scan[(src_left + col) / 8] & (1 << (7 - (src_left + col) % 8))) {
+ FXARGB_SETRGBORDERDIB(dest_scan, argb);
+ }
+ dest_scan += 4;
+ }
+ return;
+ }
+ for (int col = 0; col < pixel_count; col ++) {
+ if (!(src_scan[(src_left + col) / 8] & (1 << (7 - (src_left + col) % 8)))) {
+ dest_scan += 4;
+ continue;
+ }
+ int src_alpha;
+ if (clip_scan) {
+ src_alpha = mask_alpha * clip_scan[col] / 255;
+ } else {
+ src_alpha = mask_alpha;
+ }
+ FX_BYTE back_alpha = dest_scan[3];
+ if (back_alpha == 0) {
+ FXARGB_SETRGBORDERDIB(dest_scan, FXARGB_MAKE(src_alpha, src_r, src_g, src_b));
+ dest_scan += 4;
+ continue;
+ }
+ FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ dest_scan[3] = dest_alpha;
+ int alpha_ratio = src_alpha * 255 / dest_alpha;
+ if (blend_type >= FXDIB_BLEND_NONSEPARABLE) {
+ int blended_colors[3];
+ FX_BYTE src_scan[3];
+ FX_BYTE dest_scan_o[3];
+ src_scan[0] = src_b;
+ src_scan[1] = src_g;
+ src_scan[2] = src_r;
+ dest_scan_o[0] = dest_scan[2];
+ dest_scan_o[1] = dest_scan[1];
+ dest_scan_o[2] = dest_scan[0];
+ _RGB_Blend(blend_type, src_scan, dest_scan_o, blended_colors);
+ dest_scan[2] = FXDIB_ALPHA_MERGE(dest_scan[2], blended_colors[0], alpha_ratio);
+ dest_scan[1] = FXDIB_ALPHA_MERGE(dest_scan[1], blended_colors[1], alpha_ratio);
+ dest_scan[0] = FXDIB_ALPHA_MERGE(dest_scan[0], blended_colors[2], alpha_ratio);
+ } else if (blend_type) {
+ int blended = _BLEND(blend_type, dest_scan[2], src_b);
+ blended = FXDIB_ALPHA_MERGE(src_b, blended, back_alpha);
+ dest_scan[2] = FXDIB_ALPHA_MERGE(dest_scan[2], blended, alpha_ratio);
+ blended = _BLEND(blend_type, dest_scan[1], src_g);
+ blended = FXDIB_ALPHA_MERGE(src_g, blended, back_alpha);
+ dest_scan[1] = FXDIB_ALPHA_MERGE(dest_scan[1], blended, alpha_ratio);
+ blended = _BLEND(blend_type, dest_scan[0], src_r);
+ blended = FXDIB_ALPHA_MERGE(src_r, blended, back_alpha);
+ dest_scan[0] = FXDIB_ALPHA_MERGE(dest_scan[0], blended, alpha_ratio);
+ } else {
+ dest_scan[2] = FXDIB_ALPHA_MERGE(dest_scan[2], src_b, alpha_ratio);
+ dest_scan[1] = FXDIB_ALPHA_MERGE(dest_scan[1], src_g, alpha_ratio);
+ dest_scan[0] = FXDIB_ALPHA_MERGE(dest_scan[0], src_r, alpha_ratio);
+ }
+ dest_scan += 4;
+ }
+}
+void _CompositeRow_BitMask2Rgb_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int mask_alpha, int src_r, int src_g, int src_b,
+ int src_left, int pixel_count, int blend_type, int Bpp, FX_LPCBYTE clip_scan)
+{
+ if (blend_type == FXDIB_BLEND_NORMAL && clip_scan == NULL && mask_alpha == 255) {
+ for (int col = 0; col < pixel_count; col ++) {
+ if (src_scan[(src_left + col) / 8] & (1 << (7 - (src_left + col) % 8))) {
+ dest_scan[2] = src_b;
+ dest_scan[1] = src_g;
+ dest_scan[0] = src_r;
+ }
+ dest_scan += Bpp;
+ }
+ return;
+ }
+ for (int col = 0; col < pixel_count; col ++) {
+ if (!(src_scan[(src_left + col) / 8] & (1 << (7 - (src_left + col) % 8)))) {
+ dest_scan += Bpp;
+ continue;
+ }
+ int src_alpha;
+ if (clip_scan) {
+ src_alpha = mask_alpha * clip_scan[col] / 255;
+ } else {
+ src_alpha = mask_alpha;
+ }
+ if (src_alpha == 0) {
+ dest_scan += Bpp;
+ continue;
+ }
+ if (blend_type >= FXDIB_BLEND_NONSEPARABLE) {
+ int blended_colors[3];
+ FX_BYTE src_scan[3];
+ FX_BYTE dest_scan_o[3];
+ src_scan[0] = src_b;
+ src_scan[1] = src_g;
+ src_scan[2] = src_r;
+ dest_scan_o[0] = dest_scan[2];
+ dest_scan_o[1] = dest_scan[1];
+ dest_scan_o[2] = dest_scan[0];
+ _RGB_Blend(blend_type, src_scan, dest_scan_o, blended_colors);
+ dest_scan[2] = FXDIB_ALPHA_MERGE(dest_scan[2], blended_colors[0], src_alpha);
+ dest_scan[1] = FXDIB_ALPHA_MERGE(dest_scan[1], blended_colors[1], src_alpha);
+ dest_scan[0] = FXDIB_ALPHA_MERGE(dest_scan[0], blended_colors[2], src_alpha);
+ } else if (blend_type) {
+ int back_color = FX_GAMMA(dest_scan[2]);
+ int blended = _BLEND(blend_type, back_color, src_b);
+ dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(back_color, blended, src_alpha));
+ back_color = FX_GAMMA(dest_scan[1]);
+ blended = _BLEND(blend_type, back_color, src_g);
+ dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(back_color, blended, src_alpha));
+ back_color = FX_GAMMA(dest_scan[0]);
+ blended = _BLEND(blend_type, back_color, src_r);
+ dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(back_color, blended, src_alpha));
+ } else {
+ dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), src_b, src_alpha));
+ dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), src_g, src_alpha));
+ dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), src_r, src_alpha));
+ }
+ dest_scan += Bpp;
+ }
+}
+inline FX_BOOL _ScanlineCompositor_InitSourceMask(FXDIB_Format dest_format, int alpha_flag, FX_DWORD mask_color, int& mask_alpha,
+ int& mask_red, int& mask_green, int& mask_blue, int& mask_black,
+ void* icc_module, void* pIccTransform)
+{
+ ICodec_IccModule* pIccModule = (ICodec_IccModule*)icc_module;
+ if (alpha_flag >> 8) {
+ mask_alpha = alpha_flag & 0xff;
+ mask_red = FXSYS_GetCValue(mask_color);
+ mask_green = FXSYS_GetMValue(mask_color);
+ mask_blue = FXSYS_GetYValue(mask_color);
+ mask_black = FXSYS_GetKValue(mask_color);
+ } else {
+ mask_alpha = FXARGB_A(mask_color);
+ mask_red = FXARGB_R(mask_color);
+ mask_green = FXARGB_G(mask_color);
+ mask_blue = FXARGB_B(mask_color);
+ }
+ if (dest_format == FXDIB_8bppMask) {
+ return TRUE;
+ }
+ if ((dest_format & 0xff) == 8) {
+ if (pIccTransform) {
+ mask_color = (alpha_flag >> 8) ? FXCMYK_TODIB(mask_color) : FXARGB_TODIB(mask_color);
+ FX_LPBYTE gray_p = (FX_LPBYTE)&mask_color;
+ pIccModule->TranslateScanline(pIccTransform, gray_p, gray_p, 1);
+ mask_red = dest_format & 0x0400 ? FX_CCOLOR(gray_p[0]) : gray_p[0];
+ } else {
+ if (alpha_flag >> 8) {
+ FX_BYTE r, g, b;
+ AdobeCMYK_to_sRGB1(mask_red, mask_green, mask_blue, mask_black,
+ r, g, b);
+ mask_red = FXRGB2GRAY(r, g, b);
+ } else {
+ mask_red = FXRGB2GRAY(mask_red, mask_green, mask_blue);
+ }
+ if (dest_format & 0x0400) {
+ mask_red = FX_CCOLOR(mask_red);
+ }
+ }
+ } else {
+ FX_LPBYTE mask_color_p = (FX_LPBYTE)&mask_color;
+ mask_color = (alpha_flag >> 8) ? FXCMYK_TODIB(mask_color) : FXARGB_TODIB(mask_color);
+ if (pIccTransform) {
+ pIccModule->TranslateScanline(pIccTransform, mask_color_p, mask_color_p, 1);
+ mask_red = mask_color_p[2];
+ mask_green = mask_color_p[1];
+ mask_blue = mask_color_p[0];
+ } else if (alpha_flag >> 8) {
+ AdobeCMYK_to_sRGB1(mask_color_p[0], mask_color_p[1], mask_color_p[2], mask_color_p[3],
+ mask_color_p[2], mask_color_p[1], mask_color_p[0]);
+ mask_red = mask_color_p[2];
+ mask_green = mask_color_p[1];
+ mask_blue = mask_color_p[0];
+ }
+ }
+ return TRUE;
+}
+inline void _ScanlineCompositor_InitSourcePalette(FXDIB_Format src_format, FXDIB_Format dest_format,
+ FX_DWORD*& pDestPalette, FX_DWORD* pSrcPalette,
+ void* icc_module, void* pIccTransform)
+{
+ ICodec_IccModule* pIccModule = (ICodec_IccModule*)icc_module;
+ FX_BOOL isSrcCmyk = src_format & 0x0400 ? TRUE : FALSE;
+ FX_BOOL isDstCmyk = dest_format & 0x0400 ? TRUE : FALSE;
+ pDestPalette = NULL;
+ if (pIccTransform) {
+ if (pSrcPalette) {
+ if ((dest_format & 0xff) == 8) {
+ int pal_count = 1 << (src_format & 0xff);
+ FX_LPBYTE gray_pal = FX_Alloc(FX_BYTE, pal_count);
+ if (!gray_pal) {
+ return;
+ }
+ pDestPalette = (FX_DWORD*)gray_pal;
+ for (int i = 0; i < pal_count; i ++) {
+ FX_DWORD color = isSrcCmyk ? FXCMYK_TODIB(pSrcPalette[i]) : FXARGB_TODIB(pSrcPalette[i]);
+ pIccModule->TranslateScanline(pIccTransform, gray_pal, (FX_LPCBYTE)&color, 1);
+ gray_pal ++;
+ }
+ } else {
+ int palsize = 1 << (src_format & 0xff);
+ pDestPalette = FX_Alloc(FX_DWORD, palsize);
+ if (!pDestPalette) {
+ return;
+ }
+ for (int i = 0; i < palsize; i ++) {
+ FX_DWORD color = isSrcCmyk ? FXCMYK_TODIB(pSrcPalette[i]) : FXARGB_TODIB(pSrcPalette[i]);
+ pIccModule->TranslateScanline(pIccTransform, (FX_LPBYTE)&color, (FX_LPCBYTE)&color, 1);
+ pDestPalette[i] = isDstCmyk ? FXCMYK_TODIB(color) : FXARGB_TODIB(color);
+ }
+ }
+ } else {
+ int pal_count = 1 << (src_format & 0xff);
+ FX_LPBYTE gray_pal = FX_Alloc(FX_BYTE, pal_count);
+ if (!gray_pal) {
+ return;
+ }
+ if (pal_count == 2) {
+ gray_pal[0] = 0;
+ gray_pal[1] = 255;
+ } else {
+ for (int i = 0; i < pal_count; i++) {
+ gray_pal[i] = i;
+ }
+ }
+ if ((dest_format & 0xff) == 8) {
+ pIccModule->TranslateScanline(pIccTransform, gray_pal, gray_pal, pal_count);
+ pDestPalette = (FX_DWORD*)gray_pal;
+ } else {
+ pDestPalette = FX_Alloc(FX_DWORD, pal_count);
+ if (!pDestPalette) {
+ FX_Free(gray_pal);
+ return;
+ }
+ for (int i = 0; i < pal_count; i ++) {
+ pIccModule->TranslateScanline(pIccTransform, (FX_LPBYTE)&pDestPalette[i], &gray_pal[i], 1);
+ pDestPalette[i] = isDstCmyk ? FXCMYK_TODIB(pDestPalette[i]) : FXARGB_TODIB(pDestPalette[i]);
+ }
+ FX_Free(gray_pal);
+ }
+ }
+ } else {
+ if (pSrcPalette) {
+ if ((dest_format & 0xff) == 8) {
+ int pal_count = 1 << (src_format & 0xff);
+ FX_LPBYTE gray_pal = FX_Alloc(FX_BYTE, pal_count);
+ if (!gray_pal) {
+ return;
+ }
+ pDestPalette = (FX_DWORD*)gray_pal;
+ if (isSrcCmyk) {
+ for (int i = 0; i < pal_count; i ++) {
+ FX_CMYK cmyk = pSrcPalette[i];
+ FX_BYTE r, g, b;
+ AdobeCMYK_to_sRGB1(FXSYS_GetCValue(cmyk), FXSYS_GetMValue(cmyk), FXSYS_GetYValue(cmyk), FXSYS_GetKValue(cmyk),
+ r, g, b);
+ *gray_pal ++ = FXRGB2GRAY(r, g, b);
+ }
+ } else
+ for (int i = 0; i < pal_count; i ++) {
+ FX_ARGB argb = pSrcPalette[i];
+ *gray_pal ++ = FXRGB2GRAY(FXARGB_R(argb), FXARGB_G(argb), FXARGB_B(argb));
+ }
+ } else {
+ int palsize = 1 << (src_format & 0xff);
+ pDestPalette = FX_Alloc(FX_DWORD, palsize);
+ if (!pDestPalette) {
+ return;
+ }
+ if (isDstCmyk == isSrcCmyk) {
+ FXSYS_memcpy32(pDestPalette, pSrcPalette, palsize * sizeof(FX_DWORD));
+ } else {
+ for (int i = 0; i < palsize; i ++) {
+ FX_CMYK cmyk = pSrcPalette[i];
+ FX_BYTE r, g, b;
+ AdobeCMYK_to_sRGB1(FXSYS_GetCValue(cmyk), FXSYS_GetMValue(cmyk), FXSYS_GetYValue(cmyk), FXSYS_GetKValue(cmyk),
+ r, g, b);
+ pDestPalette[i] = FXARGB_MAKE(0xff, r, g, b);
+ }
+ }
+ }
+ } else {
+ if ((dest_format & 0xff) == 8) {
+ int pal_count = 1 << (src_format & 0xff);
+ FX_LPBYTE gray_pal = FX_Alloc(FX_BYTE, pal_count);
+ if (!gray_pal) {
+ return;
+ }
+ if (pal_count == 2) {
+ gray_pal[0] = 0;
+ gray_pal[1] = 255;
+ } else {
+ for (int i = 0; i < pal_count; i++) {
+ gray_pal[i] = i;
+ }
+ }
+ pDestPalette = (FX_DWORD*)gray_pal;
+ } else {
+ int palsize = 1 << (src_format & 0xff);
+ pDestPalette = FX_Alloc(FX_DWORD, palsize);
+ if (!pDestPalette) {
+ return;
+ }
+ if (palsize == 2) {
+ pDestPalette[0] = isSrcCmyk ? 255 : 0xff000000;
+ pDestPalette[1] = isSrcCmyk ? 0 : 0xffffffff;
+ } else {
+ for (int i = 0; i < palsize; i++) {
+ pDestPalette[i] = isSrcCmyk ? FX_CCOLOR(i) : (i * 0x10101);
+ }
+ }
+ if (isSrcCmyk != isDstCmyk) {
+ for (int i = 0; i < palsize; i ++) {
+ FX_CMYK cmyk = pDestPalette[i];
+ FX_BYTE r, g, b;
+ AdobeCMYK_to_sRGB1(FXSYS_GetCValue(cmyk), FXSYS_GetMValue(cmyk), FXSYS_GetYValue(cmyk), FXSYS_GetKValue(cmyk),
+ r, g, b);
+ pDestPalette[i] = FXARGB_MAKE(0xff, r, g, b);
+ }
+ }
+ }
+ }
+ }
+}
+CFX_ScanlineCompositor::CFX_ScanlineCompositor()
+{
+ m_pSrcPalette = NULL;
+ m_pCacheScanline = NULL;
+ m_CacheSize = 0;
+ m_bRgbByteOrder = FALSE;
+ m_BlendType = FXDIB_BLEND_NORMAL;
+}
+CFX_ScanlineCompositor::~CFX_ScanlineCompositor()
+{
+ if (m_pSrcPalette) {
+ FX_Free(m_pSrcPalette);
+ }
+ if (m_pCacheScanline) {
+ FX_Free(m_pCacheScanline);
+ }
+}
+FX_BOOL CFX_ScanlineCompositor::Init(FXDIB_Format dest_format, FXDIB_Format src_format, FX_INT32 width, FX_DWORD* pSrcPalette,
+ FX_DWORD mask_color, int blend_type, FX_BOOL bClip, FX_BOOL bRgbByteOrder, int alpha_flag, void* pIccTransform)
+{
+ m_SrcFormat = src_format;
+ m_DestFormat = dest_format;
+ m_BlendType = blend_type;
+ m_bRgbByteOrder = bRgbByteOrder;
+ ICodec_IccModule* pIccModule = NULL;
+ if (CFX_GEModule::Get()->GetCodecModule()) {
+ pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
+ }
+ if (pIccModule == NULL) {
+ pIccTransform = NULL;
+ }
+ m_pIccTransform = pIccTransform;
+ if ((dest_format & 0xff) == 1) {
+ return FALSE;
+ }
+ if (m_SrcFormat == FXDIB_1bppMask || m_SrcFormat == FXDIB_8bppMask) {
+ return _ScanlineCompositor_InitSourceMask(dest_format, alpha_flag, mask_color,
+ m_MaskAlpha, m_MaskRed, m_MaskGreen, m_MaskBlue, m_MaskBlack,
+ pIccModule, pIccTransform);
+ }
+ if (pIccTransform == NULL && (~src_format & 0x0400) && (dest_format & 0x0400)) {
+ return FALSE;
+ }
+ if ((m_SrcFormat & 0xff) <= 8) {
+ if (dest_format == FXDIB_8bppMask) {
+ return TRUE;
+ }
+ _ScanlineCompositor_InitSourcePalette(src_format, dest_format, m_pSrcPalette, pSrcPalette,
+ pIccModule, pIccTransform);
+ m_Transparency = (dest_format == FXDIB_Argb ? 1 : 0)
+ + (dest_format & 0x0200 ? 2 : 0)
+ + (dest_format & 0x0400 ? 4 : 0)
+ + ((src_format & 0xff) == 1 ? 8 : 0);
+ return TRUE;
+ }
+ m_Transparency = (src_format & 0x0200 ? 0 : 1)
+ + (dest_format & 0x0200 ? 0 : 2)
+ + (blend_type == FXDIB_BLEND_NORMAL ? 4 : 0)
+ + (bClip ? 8 : 0)
+ + (src_format & 0x0400 ? 16 : 0)
+ + (dest_format & 0x0400 ? 32 : 0)
+ + (pIccTransform ? 64 : 0);
+ return TRUE;
+}
+void CFX_ScanlineCompositor::CompositeRgbBitmapLine(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, FX_LPCBYTE clip_scan,
+ FX_LPCBYTE src_extra_alpha, FX_LPBYTE dst_extra_alpha)
+{
+ int src_Bpp = (m_SrcFormat & 0xff) >> 3;
+ int dest_Bpp = (m_DestFormat & 0xff) >> 3;
+ int dest_Size = width * dest_Bpp + 4;
+ if (m_bRgbByteOrder) {
+ switch (m_Transparency) {
+ case 0:
+ case 4:
+ case 8:
+ case 12:
+ _CompositeRow_Argb2Argb_RgbByteOrder(dest_scan, src_scan, width, m_BlendType, clip_scan);
+ break;
+ case 1:
+ _CompositeRow_Rgb2Argb_Blend_NoClip_RgbByteOrder(dest_scan, src_scan, width, m_BlendType, src_Bpp);
+ break;
+ case 2:
+ case 10:
+ _CompositeRow_Argb2Rgb_Blend_RgbByteOrder(dest_scan, src_scan, width, m_BlendType, dest_Bpp, clip_scan);
+ break;
+ case 3:
+ _CompositeRow_Rgb2Rgb_Blend_NoClip_RgbByteOrder(dest_scan, src_scan, width, m_BlendType, dest_Bpp, src_Bpp);
+ break;
+ case 5:
+ _CompositeRow_Rgb2Argb_NoBlend_NoClip_RgbByteOrder(dest_scan, src_scan, width, src_Bpp);
+ break;
+ case 6:
+ case 14:
+ _CompositeRow_Argb2Rgb_NoBlend_RgbByteOrder(dest_scan, src_scan, width, dest_Bpp, clip_scan);
+ break;
+ case 7:
+ _CompositeRow_Rgb2Rgb_NoBlend_NoClip_RgbByteOrder(dest_scan, src_scan, width, dest_Bpp, src_Bpp);
+ break;
+ case 9:
+ _CompositeRow_Rgb2Argb_Blend_Clip_RgbByteOrder(dest_scan, src_scan, width, m_BlendType, src_Bpp, clip_scan);
+ break;
+ case 11:
+ _CompositeRow_Rgb2Rgb_Blend_Clip_RgbByteOrder(dest_scan, src_scan, width, m_BlendType, dest_Bpp, src_Bpp, clip_scan);
+ break;
+ case 13:
+ _CompositeRow_Rgb2Argb_NoBlend_Clip_RgbByteOrder(dest_scan, src_scan, width, src_Bpp, clip_scan);
+ break;
+ case 15:
+ _CompositeRow_Rgb2Rgb_NoBlend_Clip_RgbByteOrder(dest_scan, src_scan, width, dest_Bpp, src_Bpp, clip_scan);
+ break;
+ }
+ return;
+ }
+ if (m_DestFormat == FXDIB_8bppMask) {
+ if (m_SrcFormat & 0x0200) {
+ if (m_SrcFormat == FXDIB_Argb) {
+ _CompositeRow_Argb2Mask(dest_scan, src_scan, width, clip_scan);
+ } else {
+ _CompositeRow_Rgba2Mask(dest_scan, src_extra_alpha, width, clip_scan);
+ }
+ } else {
+ _CompositeRow_Rgb2Mask(dest_scan, src_scan, width, clip_scan);
+ }
+ } else if ((m_DestFormat & 0xff) == 8) {
+ if (m_DestFormat & 0x0400) {
+ for (int i = 0; i < width; i ++) {
+ *dest_scan = ~*dest_scan;
+ dest_scan++;
+ }
+ }
+ if (m_SrcFormat & 0x0200) {
+ if (m_DestFormat & 0x0200) {
+ _CompositeRow_Argb2Graya(dest_scan, src_scan, width, m_BlendType, clip_scan, src_extra_alpha, dst_extra_alpha, m_pIccTransform);
+ } else {
+ _CompositeRow_Argb2Gray(dest_scan, src_scan, width, m_BlendType, clip_scan, src_extra_alpha, m_pIccTransform);
+ }
+ } else {
+ if (m_DestFormat & 0x0200) {
+ _CompositeRow_Rgb2Graya(dest_scan, src_scan, src_Bpp, width, m_BlendType, clip_scan, dst_extra_alpha, m_pIccTransform);
+ } else {
+ _CompositeRow_Rgb2Gray(dest_scan, src_scan, src_Bpp, width, m_BlendType, clip_scan, m_pIccTransform);
+ }
+ }
+ if (m_DestFormat & 0x0400) {
+ for (int i = 0; i < width; i ++) {
+ *dest_scan = ~*dest_scan;
+ dest_scan++;
+ }
+ }
+ } else {
+ if (dest_Size > m_CacheSize) {
+ m_pCacheScanline = FX_Realloc(FX_BYTE, m_pCacheScanline, dest_Size);
+ if (!m_pCacheScanline) {
+ return;
+ }
+ m_CacheSize = dest_Size;
+ }
+ switch (m_Transparency) {
+ case 0:
+ case 4:
+ case 8:
+ case 4+8: {
+ _CompositeRow_Argb2Argb(dest_scan, src_scan, width, m_BlendType, clip_scan,
+ dst_extra_alpha, src_extra_alpha);
+ }
+ break;
+ case 64:
+ case 4+64:
+ case 8+64:
+ case 4+8+64: {
+ _CompositeRow_Argb2Argb_Transform(dest_scan, src_scan, width, m_BlendType, clip_scan,
+ dst_extra_alpha, src_extra_alpha, m_pCacheScanline, m_pIccTransform);
+ }
+ break;
+ case 1:
+ _CompositeRow_Rgb2Argb_Blend_NoClip(dest_scan, src_scan, width, m_BlendType, src_Bpp,
+ dst_extra_alpha);
+ break;
+ case 1+64:
+ _CompositeRow_Rgb2Argb_Blend_NoClip_Transform(dest_scan, src_scan, width, m_BlendType, src_Bpp,
+ dst_extra_alpha, m_pCacheScanline, m_pIccTransform);
+ break;
+ case 1+8:
+ _CompositeRow_Rgb2Argb_Blend_Clip(dest_scan, src_scan, width, m_BlendType, src_Bpp, clip_scan,
+ dst_extra_alpha);
+ break;
+ case 1+8+64:
+ _CompositeRow_Rgb2Argb_Blend_Clip_Transform(dest_scan, src_scan, width, m_BlendType, src_Bpp, clip_scan,
+ dst_extra_alpha, m_pCacheScanline, m_pIccTransform);
+ break;
+ case 1+4:
+ _CompositeRow_Rgb2Argb_NoBlend_NoClip(dest_scan, src_scan, width, src_Bpp,
+ dst_extra_alpha);
+ break;
+ case 1+4+64:
+ _CompositeRow_Rgb2Argb_NoBlend_NoClip_Transform(dest_scan, src_scan, width, src_Bpp,
+ dst_extra_alpha, m_pCacheScanline, m_pIccTransform);
+ break;
+ case 1+4+8:
+ _CompositeRow_Rgb2Argb_NoBlend_Clip(dest_scan, src_scan, width, src_Bpp, clip_scan,
+ dst_extra_alpha);
+ break;
+ case 1+4+8+64:
+ _CompositeRow_Rgb2Argb_NoBlend_Clip_Transform(dest_scan, src_scan, width, src_Bpp, clip_scan,
+ dst_extra_alpha, m_pCacheScanline, m_pIccTransform);
+ break;
+ case 2:
+ case 2+8:
+ _CompositeRow_Argb2Rgb_Blend(dest_scan, src_scan, width, m_BlendType, dest_Bpp, clip_scan,
+ src_extra_alpha);
+ break;
+ case 2+64:
+ case 2+8+64:
+ _CompositeRow_Argb2Rgb_Blend_Transform(dest_scan, src_scan, width, m_BlendType, dest_Bpp, clip_scan,
+ src_extra_alpha, m_pCacheScanline, m_pIccTransform);
+ break;
+ case 2+4:
+ case 2+4+8:
+ _CompositeRow_Argb2Rgb_NoBlend(dest_scan, src_scan, width, dest_Bpp, clip_scan,
+ src_extra_alpha);
+ break;
+ case 2+4+64:
+ case 2+4+8+64:
+ _CompositeRow_Argb2Rgb_NoBlend_Transform(dest_scan, src_scan, width, dest_Bpp, clip_scan,
+ src_extra_alpha, m_pCacheScanline, m_pIccTransform);
+ break;
+ case 1+2:
+ _CompositeRow_Rgb2Rgb_Blend_NoClip(dest_scan, src_scan, width, m_BlendType, dest_Bpp, src_Bpp);
+ break;
+ case 1+2+64:
+ _CompositeRow_Rgb2Rgb_Blend_NoClip_Transform(dest_scan, src_scan, width, m_BlendType, dest_Bpp, src_Bpp,
+ m_pCacheScanline, m_pIccTransform);
+ break;
+ case 1+2+8:
+ _CompositeRow_Rgb2Rgb_Blend_Clip(dest_scan, src_scan, width, m_BlendType, dest_Bpp, src_Bpp, clip_scan);
+ break;
+ case 1+2+8+64:
+ _CompositeRow_Rgb2Rgb_Blend_Clip_Transform(dest_scan, src_scan, width, m_BlendType, dest_Bpp, src_Bpp, clip_scan,
+ m_pCacheScanline, m_pIccTransform);
+ break;
+ case 1+2+4:
+ _CompositeRow_Rgb2Rgb_NoBlend_NoClip(dest_scan, src_scan, width, dest_Bpp, src_Bpp);
+ break;
+ case 1+2+4+64:
+ _CompositeRow_Rgb2Rgb_NoBlend_NoClip_Transform(dest_scan, src_scan, width, dest_Bpp, src_Bpp,
+ m_pCacheScanline, m_pIccTransform);
+ break;
+ case 1+2+4+8:
+ _CompositeRow_Rgb2Rgb_NoBlend_Clip(dest_scan, src_scan, width, dest_Bpp, src_Bpp, clip_scan);
+ break;
+ case 1+2+4+8+64:
+ _CompositeRow_Rgb2Rgb_NoBlend_Clip_Transform(dest_scan, src_scan, width, dest_Bpp, src_Bpp, clip_scan,
+ m_pCacheScanline, m_pIccTransform);
+ break;
+ }
+ }
+}
+void CFX_ScanlineCompositor::CompositePalBitmapLine(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int src_left, int width, FX_LPCBYTE clip_scan,
+ FX_LPCBYTE src_extra_alpha, FX_LPBYTE dst_extra_alpha)
+{
+ if (m_bRgbByteOrder) {
+ if (m_SrcFormat == FXDIB_1bppRgb) {
+ if (m_DestFormat == FXDIB_8bppRgb) {
+ return;
+ } else if(m_DestFormat == FXDIB_Argb) {
+ _CompositeRow_1bppRgb2Argb_NoBlend_RgbByteOrder(dest_scan, src_scan, src_left, width, m_pSrcPalette, clip_scan);
+ } else {
+ _CompositeRow_1bppRgb2Rgb_NoBlend_RgbByteOrder(dest_scan, src_scan, src_left, m_pSrcPalette, width, (m_DestFormat & 0xff) >> 3, clip_scan);
+ }
+ } else {
+ if (m_DestFormat == FXDIB_8bppRgb) {
+ return;
+ } else if (m_DestFormat == FXDIB_Argb) {
+ _CompositeRow_8bppRgb2Argb_NoBlend_RgbByteOrder(dest_scan, src_scan, width, m_pSrcPalette, clip_scan);
+ } else {
+ _CompositeRow_8bppRgb2Rgb_NoBlend_RgbByteOrder(dest_scan, src_scan, m_pSrcPalette, width, (m_DestFormat & 0xff) >> 3, clip_scan);
+ }
+ }
+ return;
+ }
+ if (m_DestFormat == FXDIB_8bppMask) {
+ _CompositeRow_Rgb2Mask(dest_scan, src_scan, width, clip_scan);
+ return;
+ } else if ((m_DestFormat & 0xff) == 8) {
+ if (m_Transparency & 8) {
+ if (m_DestFormat & 0x0200) {
+ _CompositeRow_1bppPal2Graya(dest_scan, src_scan, src_left, (FX_LPCBYTE)m_pSrcPalette, width, m_BlendType, clip_scan, dst_extra_alpha);
+ } else {
+ _CompositeRow_1bppPal2Gray(dest_scan, src_scan, src_left, (FX_LPCBYTE)m_pSrcPalette, width, m_BlendType, clip_scan);
+ }
+ } else {
+ if (m_DestFormat & 0x0200)
+ _CompositeRow_8bppPal2Graya(dest_scan, src_scan, (FX_LPCBYTE)m_pSrcPalette, width, m_BlendType, clip_scan,
+ dst_extra_alpha, src_extra_alpha);
+ else
+ _CompositeRow_8bppPal2Gray(dest_scan, src_scan, (FX_LPCBYTE)m_pSrcPalette, width, m_BlendType, clip_scan,
+ src_extra_alpha);
+ }
+ } else {
+ switch (m_Transparency) {
+ case 1+2:
+ _CompositeRow_8bppRgb2Argb_NoBlend(dest_scan, src_scan, width, m_pSrcPalette, clip_scan,
+ src_extra_alpha);
+ break;
+ case 1+2+8:
+ _CompositeRow_1bppRgb2Argb_NoBlend(dest_scan, src_scan, src_left, width, m_pSrcPalette, clip_scan);
+ break;
+ case 0:
+ _CompositeRow_8bppRgb2Rgb_NoBlend(dest_scan, src_scan, m_pSrcPalette, width, (m_DestFormat & 0xff) >> 3, clip_scan,
+ src_extra_alpha);
+ break;
+ case 0+8:
+ _CompositeRow_1bppRgb2Rgb_NoBlend(dest_scan, src_scan, src_left, m_pSrcPalette, width, (m_DestFormat & 0xff) >> 3, clip_scan);
+ break;
+ case 0+2:
+ _CompositeRow_8bppRgb2Rgb_NoBlend(dest_scan, src_scan, m_pSrcPalette, width, (m_DestFormat & 0xff) >> 3, clip_scan,
+ src_extra_alpha);
+ break;
+ case 0+2+8:
+ _CompositeRow_1bppRgb2Rgba_NoBlend(dest_scan, src_scan, src_left, width, m_pSrcPalette, clip_scan,
+ dst_extra_alpha);
+ break;
+ break;
+ }
+ }
+}
+void CFX_ScanlineCompositor::CompositeByteMaskLine(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, FX_LPCBYTE clip_scan,
+ FX_LPBYTE dst_extra_alpha)
+{
+ if (m_DestFormat == FXDIB_8bppMask) {
+ _CompositeRow_ByteMask2Mask(dest_scan, src_scan, m_MaskAlpha, width, clip_scan);
+ } else if ((m_DestFormat & 0xff) == 8) {
+ if (m_DestFormat & 0x0200) {
+ _CompositeRow_ByteMask2Graya(dest_scan, src_scan, m_MaskAlpha, m_MaskRed, width, clip_scan, dst_extra_alpha);
+ } else {
+ _CompositeRow_ByteMask2Gray(dest_scan, src_scan, m_MaskAlpha, m_MaskRed, width, clip_scan);
+ }
+ } else if (m_bRgbByteOrder) {
+ if (m_DestFormat == FXDIB_Argb)
+ _CompositeRow_ByteMask2Argb_RgbByteOrder(dest_scan, src_scan, m_MaskAlpha, m_MaskRed, m_MaskGreen, m_MaskBlue,
+ width, m_BlendType, clip_scan);
+ else
+ _CompositeRow_ByteMask2Rgb_RgbByteOrder(dest_scan, src_scan, m_MaskAlpha, m_MaskRed, m_MaskGreen, m_MaskBlue,
+ width, m_BlendType, (m_DestFormat & 0xff) >> 3, clip_scan);
+ return;
+ } else if (m_DestFormat == FXDIB_Argb)
+ _CompositeRow_ByteMask2Argb(dest_scan, src_scan, m_MaskAlpha, m_MaskRed, m_MaskGreen, m_MaskBlue,
+ width, m_BlendType, clip_scan);
+ else if (m_DestFormat == FXDIB_Rgb || m_DestFormat == FXDIB_Rgb32)
+ _CompositeRow_ByteMask2Rgb(dest_scan, src_scan, m_MaskAlpha, m_MaskRed, m_MaskGreen, m_MaskBlue,
+ width, m_BlendType, (m_DestFormat & 0xff) >> 3, clip_scan);
+ else if (m_DestFormat == FXDIB_Rgba)
+ _CompositeRow_ByteMask2Rgba(dest_scan, src_scan, m_MaskAlpha, m_MaskRed, m_MaskGreen, m_MaskBlue,
+ width, m_BlendType, clip_scan, dst_extra_alpha);
+}
+void CFX_ScanlineCompositor::CompositeBitMaskLine(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int src_left, int width, FX_LPCBYTE clip_scan,
+ FX_LPBYTE dst_extra_alpha)
+{
+ if (m_DestFormat == FXDIB_8bppMask) {
+ _CompositeRow_BitMask2Mask(dest_scan, src_scan, m_MaskAlpha, src_left, width, clip_scan);
+ } else if ((m_DestFormat & 0xff) == 8) {
+ if (m_DestFormat & 0x0200)
+ _CompositeRow_BitMask2Graya(dest_scan, src_scan, m_MaskAlpha, m_MaskRed, src_left, width, clip_scan,
+ dst_extra_alpha);
+ else {
+ _CompositeRow_BitMask2Gray(dest_scan, src_scan, m_MaskAlpha, m_MaskRed, src_left, width, clip_scan);
+ }
+ } else if (m_bRgbByteOrder) {
+ if (m_DestFormat == FXDIB_Argb)
+ _CompositeRow_BitMask2Argb_RgbByteOrder(dest_scan, src_scan, m_MaskAlpha, m_MaskRed, m_MaskGreen, m_MaskBlue,
+ src_left, width, m_BlendType, clip_scan);
+ else
+ _CompositeRow_BitMask2Rgb_RgbByteOrder(dest_scan, src_scan, m_MaskAlpha, m_MaskRed, m_MaskGreen, m_MaskBlue,
+ src_left, width, m_BlendType, (m_DestFormat & 0xff) >> 3, clip_scan);
+ return;
+ } else if (m_DestFormat == FXDIB_Argb)
+ _CompositeRow_BitMask2Argb(dest_scan, src_scan, m_MaskAlpha, m_MaskRed, m_MaskGreen, m_MaskBlue,
+ src_left, width, m_BlendType, clip_scan);
+ else if (m_DestFormat == FXDIB_Rgb || m_DestFormat == FXDIB_Rgb32)
+ _CompositeRow_BitMask2Rgb(dest_scan, src_scan, m_MaskAlpha, m_MaskRed, m_MaskGreen, m_MaskBlue,
+ src_left, width, m_BlendType, (m_DestFormat & 0xff) >> 3, clip_scan);
+}
+FX_BOOL CFX_DIBitmap::CompositeBitmap(int dest_left, int dest_top, int width, int height,
+ const CFX_DIBSource* pSrcBitmap, int src_left, int src_top,
+ int blend_type, const CFX_ClipRgn* pClipRgn, FX_BOOL bRgbByteOrder, void* pIccTransform)
+{
+ if (m_pBuffer == NULL) {
+ return FALSE;
+ }
+ ASSERT(!pSrcBitmap->IsAlphaMask());
+ ASSERT(m_bpp >= 8);
+ if (pSrcBitmap->IsAlphaMask() || m_bpp < 8) {
+ return FALSE;
+ }
+ GetOverlapRect(dest_left, dest_top, width, height, pSrcBitmap->GetWidth(), pSrcBitmap->GetHeight(),
+ src_left, src_top, pClipRgn);
+ if (width == 0 || height == 0) {
+ return TRUE;
+ }
+ const CFX_DIBitmap* pClipMask = NULL;
+ FX_RECT clip_box;
+ if (pClipRgn && pClipRgn->GetType() != CFX_ClipRgn::RectI) {
+ ASSERT(pClipRgn->GetType() == CFX_ClipRgn::MaskF);
+ pClipMask = pClipRgn->GetMask();
+ clip_box = pClipRgn->GetBox();
+ }
+ CFX_ScanlineCompositor compositor;
+ if (!compositor.Init(GetFormat(), pSrcBitmap->GetFormat(), width, pSrcBitmap->GetPalette(), 0, blend_type,
+ pClipMask != NULL, bRgbByteOrder, 0, pIccTransform)) {
+ return FALSE;
+ }
+ int dest_Bpp = m_bpp / 8;
+ int src_Bpp = pSrcBitmap->GetBPP() / 8;
+ FX_BOOL bRgb = FALSE;
+ FX_BOOL bCmyk = FALSE;
+ if (src_Bpp > 1) {
+ if (pSrcBitmap->IsCmykImage()) {
+ bCmyk = TRUE;
+ } else {
+ bRgb = TRUE;
+ }
+ }
+ CFX_DIBitmap* pSrcAlphaMask = pSrcBitmap->m_pAlphaMask;
+ for (int row = 0; row < height; row ++) {
+ FX_LPBYTE dest_scan = m_pBuffer + (dest_top + row) * m_Pitch + dest_left * dest_Bpp;
+ FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left * src_Bpp;
+ FX_LPCBYTE src_scan_extra_alpha = pSrcAlphaMask ? pSrcAlphaMask->GetScanline(src_top + row) + src_left : NULL;
+ FX_LPBYTE dst_scan_extra_alpha = m_pAlphaMask ? (FX_LPBYTE)m_pAlphaMask->GetScanline(dest_top + row) + dest_left : NULL;
+ FX_LPCBYTE clip_scan = NULL;
+ if (pClipMask) {
+ clip_scan = pClipMask->m_pBuffer + (dest_top + row - clip_box.top) * pClipMask->m_Pitch + (dest_left - clip_box.left);
+ }
+ if (bRgb) {
+ compositor.CompositeRgbBitmapLine(dest_scan, src_scan, width, clip_scan, src_scan_extra_alpha, dst_scan_extra_alpha);
+ } else {
+ compositor.CompositePalBitmapLine(dest_scan, src_scan, src_left, width, clip_scan, src_scan_extra_alpha, dst_scan_extra_alpha);
+ }
+ }
+ return TRUE;
+}
+FX_BOOL CFX_DIBitmap::CompositeMask(int dest_left, int dest_top, int width, int height,
+ const CFX_DIBSource* pMask, FX_DWORD color, int src_left, int src_top,
+ int blend_type, const CFX_ClipRgn* pClipRgn, FX_BOOL bRgbByteOrder, int alpha_flag, void* pIccTransform)
+{
+ if (m_pBuffer == NULL) {
+ return FALSE;
+ }
+ ASSERT(pMask->IsAlphaMask());
+ ASSERT(m_bpp >= 8);
+ if (!pMask->IsAlphaMask() || m_bpp < 8) {
+ return FALSE;
+ }
+ GetOverlapRect(dest_left, dest_top, width, height, pMask->GetWidth(), pMask->GetHeight(), src_left, src_top, pClipRgn);
+ if (width == 0 || height == 0) {
+ return TRUE;
+ }
+ int src_alpha = (FX_BYTE)(alpha_flag >> 8) ? (alpha_flag & 0xff) : FXARGB_A(color);
+ if (src_alpha == 0) {
+ return TRUE;
+ }
+ const CFX_DIBitmap* pClipMask = NULL;
+ FX_RECT clip_box;
+ if (pClipRgn && pClipRgn->GetType() != CFX_ClipRgn::RectI) {
+ ASSERT(pClipRgn->GetType() == CFX_ClipRgn::MaskF);
+ pClipMask = pClipRgn->GetMask();
+ clip_box = pClipRgn->GetBox();
+ }
+ int src_bpp = pMask->GetBPP();
+ int Bpp = GetBPP() / 8;
+ CFX_ScanlineCompositor compositor;
+ if (!compositor.Init(GetFormat(), pMask->GetFormat(), width, NULL, color, blend_type, pClipMask != NULL, bRgbByteOrder, alpha_flag, pIccTransform)) {
+ return FALSE;
+ }
+ for (int row = 0; row < height; row ++) {
+ FX_LPBYTE dest_scan = m_pBuffer + (dest_top + row) * m_Pitch + dest_left * Bpp;
+ FX_LPCBYTE src_scan = pMask->GetScanline(src_top + row);
+ FX_LPBYTE dst_scan_extra_alpha = m_pAlphaMask ? (FX_LPBYTE)m_pAlphaMask->GetScanline(dest_top + row) + dest_left : NULL;
+ FX_LPCBYTE clip_scan = NULL;
+ if (pClipMask) {
+ clip_scan = pClipMask->m_pBuffer + (dest_top + row - clip_box.top) * pClipMask->m_Pitch + (dest_left - clip_box.left);
+ }
+ if (src_bpp == 1) {
+ compositor.CompositeBitMaskLine(dest_scan, src_scan, src_left, width, clip_scan, dst_scan_extra_alpha);
+ } else {
+ compositor.CompositeByteMaskLine(dest_scan, src_scan + src_left, width, clip_scan, dst_scan_extra_alpha);
+ }
+ }
+ return TRUE;
+}
+FX_BOOL CFX_DIBitmap::CompositeRect(int left, int top, int width, int height, FX_DWORD color, int alpha_flag, void* pIccTransform)
+{
+ if (m_pBuffer == NULL) {
+ return FALSE;
+ }
+ int src_alpha = (alpha_flag >> 8) ? (alpha_flag & 0xff) : FXARGB_A(color);
+ if (src_alpha == 0) {
+ return TRUE;
+ }
+ FX_RECT rect(left, top, left + width, top + height);
+ rect.Intersect(0, 0, m_Width, m_Height);
+ if (rect.IsEmpty()) {
+ return TRUE;
+ }
+ width = rect.Width();
+ FX_DWORD dst_color;
+ if (alpha_flag >> 8) {
+ dst_color = FXCMYK_TODIB(color);
+ } else {
+ dst_color = FXARGB_TODIB(color);
+ }
+ FX_LPBYTE color_p = (FX_LPBYTE)&dst_color;
+ if (m_bpp == 8) {
+ FX_BYTE gray = 255;
+ if (!IsAlphaMask()) {
+ if (pIccTransform && CFX_GEModule::Get()->GetCodecModule() && CFX_GEModule::Get()->GetCodecModule()->GetIccModule()) {
+ ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
+ pIccModule->TranslateScanline(pIccTransform, &gray, color_p, 1);
+ } else {
+ if (alpha_flag >> 8) {
+ FX_BYTE r, g, b;
+ AdobeCMYK_to_sRGB1(color_p[0], color_p[1], color_p[2], color_p[3],
+ r, g, b);
+ gray = FXRGB2GRAY(r, g, b);
+ } else {
+ gray = (FX_BYTE)FXRGB2GRAY((int)color_p[2], color_p[1], color_p[0]);
+ }
+ }
+ if (IsCmykImage()) {
+ gray = ~gray;
+ }
+ }
+ for (int row = rect.top; row < rect.bottom; row ++) {
+ FX_LPBYTE dest_scan = m_pBuffer + row * m_Pitch + rect.left;
+ if (src_alpha == 255) {
+ FXSYS_memset8(dest_scan, gray, width);
+ } else
+ for (int col = 0; col < width; col ++) {
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, src_alpha);
+ dest_scan ++;
+ }
+ }
+ return TRUE;
+ } else if (m_bpp == 1) {
+ ASSERT(!IsCmykImage() && (FX_BYTE)(alpha_flag >> 8) == 0);
+ int left_shift = rect.left % 8;
+ int right_shift = rect.right % 8;
+ int width = rect.right / 8 - rect.left / 8;
+ int index = 0;
+ if (m_pPalette == NULL) {
+ index = ((FX_BYTE)color == 0xff) ? 1 : 0;
+ } else {
+ for (int i = 0; i < 2; i ++)
+ if (m_pPalette[i] == color) {
+ index = i;
+ }
+ }
+ for (int row = rect.top; row < rect.bottom; row ++) {
+ FX_BYTE* dest_scan_top = (FX_BYTE*)GetScanline(row) + rect.left / 8;
+ FX_BYTE* dest_scan_top_r = (FX_BYTE*)GetScanline(row) + rect.right / 8;
+ FX_BYTE left_flag = *dest_scan_top & (255 << (8 - left_shift));
+ FX_BYTE right_flag = *dest_scan_top_r & (255 >> right_shift);
+ if (width) {
+ FXSYS_memset8(dest_scan_top + 1, index ? 255 : 0, width - 1);
+ if (!index) {
+ *dest_scan_top &= left_flag;
+ *dest_scan_top_r &= right_flag;
+ } else {
+ *dest_scan_top |= ~left_flag;
+ *dest_scan_top_r |= ~right_flag;
+ }
+ } else {
+ if (!index) {
+ *dest_scan_top &= left_flag | right_flag;
+ } else {
+ *dest_scan_top |= ~(left_flag | right_flag);
+ }
+ }
+ }
+ return TRUE;
+ }
+ ASSERT(m_bpp >= 24);
+ if (m_bpp < 24) {
+ return FALSE;
+ }
+ if (pIccTransform && CFX_GEModule::Get()->GetCodecModule()) {
+ ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
+ pIccModule->TranslateScanline(pIccTransform, color_p, color_p, 1);
+ } else {
+ if (alpha_flag >> 8 && !IsCmykImage())
+ AdobeCMYK_to_sRGB1(FXSYS_GetCValue(color), FXSYS_GetMValue(color), FXSYS_GetYValue(color), FXSYS_GetKValue(color),
+ color_p[2], color_p[1], color_p[0]);
+ else if (!(alpha_flag >> 8) && IsCmykImage()) {
+ return FALSE;
+ }
+ }
+ if(!IsCmykImage()) {
+ color_p[3] = (FX_BYTE)src_alpha;
+ }
+ int Bpp = m_bpp / 8;
+ FX_BOOL bAlpha = HasAlpha();
+ FX_BOOL bArgb = GetFormat() == FXDIB_Argb ? TRUE : FALSE;
+ if (src_alpha == 255) {
+ for (int row = rect.top; row < rect.bottom; row ++) {
+ FX_LPBYTE dest_scan = m_pBuffer + row * m_Pitch + rect.left * Bpp;
+ FX_LPBYTE dest_scan_alpha = m_pAlphaMask ? (FX_LPBYTE)m_pAlphaMask->GetScanline(row) + rect.left : NULL;
+ if (dest_scan_alpha) {
+ FXSYS_memset8(dest_scan_alpha, 0xff, width);
+ }
+ if (Bpp == 4) {
+ FX_DWORD* scan = (FX_DWORD*)dest_scan;
+ for (int col = 0; col < width; col ++) {
+ *scan ++ = dst_color;
+ }
+ } else {
+ for (int col = 0; col < width; col ++) {
+ *dest_scan ++ = color_p[0];
+ *dest_scan ++ = color_p[1];
+ *dest_scan ++ = color_p[2];
+ }
+ }
+ }
+ return TRUE;
+ }
+ for (int row = rect.top; row < rect.bottom; row ++) {
+ FX_LPBYTE dest_scan = m_pBuffer + row * m_Pitch + rect.left * Bpp;
+ if (bAlpha) {
+ if (bArgb) {
+ for (int col = 0; col < width; col ++) {
+ FX_BYTE back_alpha = dest_scan[3];
+ if (back_alpha == 0) {
+ FXARGB_SETDIB(dest_scan, FXARGB_MAKE(src_alpha, color_p[2], color_p[1], color_p[0]));
+ dest_scan += 4;
+ continue;
+ }
+ FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ int alpha_ratio = src_alpha * 255 / dest_alpha;
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, color_p[0], alpha_ratio);
+ dest_scan ++;
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, color_p[1], alpha_ratio);
+ dest_scan ++;
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, color_p[2], alpha_ratio);
+ dest_scan ++;
+ *dest_scan++ = dest_alpha;
+ }
+ } else {
+ FX_LPBYTE dest_scan_alpha = (FX_LPBYTE)m_pAlphaMask->GetScanline(row) + rect.left;
+ for (int col = 0; col < width; col ++) {
+ FX_BYTE back_alpha = *dest_scan_alpha;
+ if (back_alpha == 0) {
+ *dest_scan_alpha++ = src_alpha;
+ FXSYS_memcpy32(dest_scan, color_p, Bpp);
+ dest_scan += Bpp;
+ continue;
+ }
+ FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ *dest_scan_alpha ++ = dest_alpha;
+ int alpha_ratio = src_alpha * 255 / dest_alpha;
+ for(int comps = 0; comps < Bpp; comps ++) {
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, color_p[comps], alpha_ratio);
+ dest_scan ++;
+ }
+ }
+ }
+ } else {
+ for (int col = 0; col < width; col ++) {
+ for(int comps = 0; comps < Bpp; comps ++) {
+ if (comps == 3) {
+ *dest_scan ++ = 255;
+ continue;
+ }
+ *dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, color_p[comps], src_alpha);
+ dest_scan ++;
+ }
+ }
+ }
+ }
+ return TRUE;
+}
+CFX_BitmapComposer::CFX_BitmapComposer()
+{
+ m_pScanlineV = NULL;
+ m_pScanlineAlphaV = NULL;
+ m_pClipScanV = NULL;
+ m_pAddClipScan = NULL;
+ m_bRgbByteOrder = FALSE;
+ m_BlendType = FXDIB_BLEND_NORMAL;
+}
+CFX_BitmapComposer::~CFX_BitmapComposer()
+{
+ if (m_pScanlineV) {
+ FX_Free(m_pScanlineV);
+ }
+ if (m_pScanlineAlphaV) {
+ FX_Free(m_pScanlineAlphaV);
+ }
+ if (m_pClipScanV) {
+ FX_Free(m_pClipScanV);
+ }
+ if (m_pAddClipScan) {
+ FX_Free(m_pAddClipScan);
+ }
+}
+void CFX_BitmapComposer::Compose(CFX_DIBitmap* pDest, const CFX_ClipRgn* pClipRgn, int bitmap_alpha,
+ FX_DWORD mask_color, FX_RECT& dest_rect, FX_BOOL bVertical,
+ FX_BOOL bFlipX, FX_BOOL bFlipY, FX_BOOL bRgbByteOrder,
+ int alpha_flag, void* pIccTransform, int blend_type)
+{
+ m_pBitmap = pDest;
+ m_pClipRgn = pClipRgn;
+ m_DestLeft = dest_rect.left;
+ m_DestTop = dest_rect.top;
+ m_DestWidth = dest_rect.Width();
+ m_DestHeight = dest_rect.Height();
+ m_BitmapAlpha = bitmap_alpha;
+ m_MaskColor = mask_color;
+ m_pClipMask = NULL;
+ if (pClipRgn && pClipRgn->GetType() != CFX_ClipRgn::RectI) {
+ m_pClipMask = pClipRgn->GetMask();
+ }
+ m_bVertical = bVertical;
+ m_bFlipX = bFlipX;
+ m_bFlipY = bFlipY;
+ m_AlphaFlag = alpha_flag;
+ m_pIccTransform = pIccTransform;
+ m_bRgbByteOrder = bRgbByteOrder;
+ m_BlendType = blend_type;
+}
+FX_BOOL CFX_BitmapComposer::SetInfo(int width, int height, FXDIB_Format src_format, FX_DWORD* pSrcPalette)
+{
+ m_SrcFormat = src_format;
+ if (!m_Compositor.Init(m_pBitmap->GetFormat(), src_format, width, pSrcPalette, m_MaskColor, FXDIB_BLEND_NORMAL,
+ m_pClipMask != NULL || (m_BitmapAlpha < 255), m_bRgbByteOrder, m_AlphaFlag, m_pIccTransform)) {
+ return FALSE;
+ }
+ if (m_bVertical) {
+ m_pScanlineV = FX_Alloc(FX_BYTE, m_pBitmap->GetBPP() / 8 * width + 4);
+ if (!m_pScanlineV) {
+ return FALSE;
+ }
+ m_pClipScanV = FX_Alloc(FX_BYTE, m_pBitmap->GetHeight());
+ if (!m_pClipScanV) {
+ return FALSE;
+ }
+ if (m_pBitmap->m_pAlphaMask) {
+ m_pScanlineAlphaV = FX_Alloc(FX_BYTE, width + 4);
+ if (!m_pScanlineAlphaV) {
+ return FALSE;
+ }
+ }
+ }
+ if (m_BitmapAlpha < 255) {
+ m_pAddClipScan = FX_Alloc(FX_BYTE, m_bVertical ? m_pBitmap->GetHeight() : m_pBitmap->GetWidth());
+ if (!m_pAddClipScan) {
+ return FALSE;
+ }
+ }
+ return TRUE;
+}
+void CFX_BitmapComposer::DoCompose(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int dest_width, FX_LPCBYTE clip_scan,
+ FX_LPCBYTE src_extra_alpha, FX_LPBYTE dst_extra_alpha)
+{
+ if (m_BitmapAlpha < 255) {
+ if (clip_scan) {
+ for (int i = 0; i < dest_width; i ++) {
+ m_pAddClipScan[i] = clip_scan[i] * m_BitmapAlpha / 255;
+ }
+ } else {
+ FXSYS_memset8(m_pAddClipScan, m_BitmapAlpha, dest_width);
+ }
+ clip_scan = m_pAddClipScan;
+ }
+ if (m_SrcFormat == FXDIB_8bppMask) {
+ m_Compositor.CompositeByteMaskLine(dest_scan, src_scan, dest_width, clip_scan, dst_extra_alpha);
+ } else if ((m_SrcFormat & 0xff) == 8) {
+ m_Compositor.CompositePalBitmapLine(dest_scan, src_scan, 0, dest_width, clip_scan, src_extra_alpha, dst_extra_alpha);
+ } else {
+ m_Compositor.CompositeRgbBitmapLine(dest_scan, src_scan, dest_width, clip_scan, src_extra_alpha, dst_extra_alpha);
+ }
+}
+void CFX_BitmapComposer::ComposeScanline(int line, FX_LPCBYTE scanline, FX_LPCBYTE scan_extra_alpha)
+{
+ if (m_bVertical) {
+ ComposeScanlineV(line, scanline, scan_extra_alpha);
+ return;
+ }
+ FX_LPCBYTE clip_scan = NULL;
+ if (m_pClipMask)
+ clip_scan = m_pClipMask->GetBuffer() + (m_DestTop + line - m_pClipRgn->GetBox().top) *
+ m_pClipMask->GetPitch() + (m_DestLeft - m_pClipRgn->GetBox().left);
+ FX_LPBYTE dest_scan = (FX_LPBYTE)m_pBitmap->GetScanline(line + m_DestTop) +
+ m_DestLeft * m_pBitmap->GetBPP() / 8;
+ FX_LPBYTE dest_alpha_scan = m_pBitmap->m_pAlphaMask ?
+ (FX_LPBYTE)m_pBitmap->m_pAlphaMask->GetScanline(line + m_DestTop) + m_DestLeft : NULL;
+ DoCompose(dest_scan, scanline, m_DestWidth, clip_scan, scan_extra_alpha, dest_alpha_scan);
+}
+void CFX_BitmapComposer::ComposeScanlineV(int line, FX_LPCBYTE scanline, FX_LPCBYTE scan_extra_alpha)
+{
+ int i;
+ int Bpp = m_pBitmap->GetBPP() / 8;
+ int dest_pitch = m_pBitmap->GetPitch();
+ int dest_alpha_pitch = m_pBitmap->m_pAlphaMask ? m_pBitmap->m_pAlphaMask->GetPitch() : 0;
+ int dest_x = m_DestLeft + (m_bFlipX ? (m_DestWidth - line - 1) : line);
+ FX_LPBYTE dest_buf = m_pBitmap->GetBuffer() + dest_x * Bpp + m_DestTop * dest_pitch;
+ FX_LPBYTE dest_alpha_buf = m_pBitmap->m_pAlphaMask ?
+ m_pBitmap->m_pAlphaMask->GetBuffer() + dest_x + m_DestTop * dest_alpha_pitch : NULL;
+ if (m_bFlipY) {
+ dest_buf += dest_pitch * (m_DestHeight - 1);
+ dest_alpha_buf += dest_alpha_pitch * (m_DestHeight - 1);
+ }
+ int y_step = dest_pitch;
+ int y_alpha_step = dest_alpha_pitch;
+ if (m_bFlipY) {
+ y_step = -y_step;
+ y_alpha_step = -y_alpha_step;
+ }
+ FX_LPBYTE src_scan = m_pScanlineV;
+ FX_LPBYTE dest_scan = dest_buf;
+ for (i = 0; i < m_DestHeight; i ++) {
+ for (int j = 0; j < Bpp; j ++) {
+ *src_scan++ = dest_scan[j];
+ }
+ dest_scan += y_step;
+ }
+ FX_LPBYTE src_alpha_scan = m_pScanlineAlphaV;
+ FX_LPBYTE dest_alpha_scan = dest_alpha_buf;
+ if (dest_alpha_scan) {
+ for (i = 0; i < m_DestHeight; i ++) {
+ *src_alpha_scan++ = *dest_alpha_scan;
+ dest_alpha_scan += y_alpha_step;
+ }
+ }
+ FX_LPBYTE clip_scan = NULL;
+ if (m_pClipMask) {
+ clip_scan = m_pClipScanV;
+ int clip_pitch = m_pClipMask->GetPitch();
+ FX_LPCBYTE src_clip = m_pClipMask->GetBuffer() + (m_DestTop - m_pClipRgn->GetBox().top) *
+ clip_pitch + (dest_x - m_pClipRgn->GetBox().left);
+ if (m_bFlipY) {
+ src_clip += clip_pitch * (m_DestHeight - 1);
+ clip_pitch = -clip_pitch;
+ }
+ for (i = 0; i < m_DestHeight; i ++) {
+ clip_scan[i] = *src_clip;
+ src_clip += clip_pitch;
+ }
+ }
+ DoCompose(m_pScanlineV, scanline, m_DestHeight, clip_scan, scan_extra_alpha, m_pScanlineAlphaV);
+ src_scan = m_pScanlineV;
+ dest_scan = dest_buf;
+ for (i = 0; i < m_DestHeight; i ++) {
+ for (int j = 0; j < Bpp; j ++) {
+ dest_scan[j] = *src_scan++;
+ }
+ dest_scan += y_step;
+ }
+ src_alpha_scan = m_pScanlineAlphaV;
+ dest_alpha_scan = dest_alpha_buf;
+ if (dest_alpha_scan) {
+ for (i = 0; i < m_DestHeight; i ++) {
+ *dest_alpha_scan = *src_alpha_scan++;
+ dest_alpha_scan += y_alpha_step;
+ }
+ }
+}
diff --git a/core/src/fxge/dib/fx_dib_convert.cpp b/core/src/fxge/dib/fx_dib_convert.cpp
index fe4a7bfd9a..0120721e35 100644
--- a/core/src/fxge/dib/fx_dib_convert.cpp
+++ b/core/src/fxge/dib/fx_dib_convert.cpp
@@ -1,1090 +1,1090 @@
-// 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
-
-#include "../../../include/fxge/fx_dib.h"
-#include "../../../include/fxge/fx_ge.h"
-#include "../../../include/fxcodec/fx_codec.h"
-const FX_DWORD g_dwWinPalette[256] = {
- 0xff000000, 0xff800000, 0xff008000, 0xff808000, 0xff000080, 0xff800080,
- 0xff008080, 0xff808080, 0xffC0DCC0, 0xffA6CAF0, 0xff2A3FAA, 0xff2A3FFF,
- 0xff2A5F00, 0xff2A5F55, 0xff2A5FAA, 0xff2A5FFF, 0xff2A7F00, 0xff2A7F55,
- 0xff2A7FAA, 0xff2A7FFF, 0xff2A9F00, 0xff2A9F55, 0xff2A9FAA, 0xff2A9FFF,
- 0xff2ABF00, 0xff2ABF55, 0xff2ABFAA, 0xff2ABFFF, 0xff2ADF00, 0xff2ADF55,
- 0xff2ADFAA, 0xff2ADFFF, 0xff2AFF00, 0xff2AFF55, 0xff2AFFAA, 0xff2AFFFF,
- 0xff550000, 0xff550055, 0xff5500AA, 0xff5500FF, 0xff551F00, 0xff551F55,
- 0xff551FAA, 0xff551FFF, 0xff553F00, 0xff553F55, 0xff553FAA, 0xff553FFF,
- 0xff555F00, 0xff555F55, 0xff555FAA, 0xff555FFF, 0xff557F00, 0xff557F55,
- 0xff557FAA, 0xff557FFF, 0xff559F00, 0xff559F55, 0xff559FAA, 0xff559FFF,
- 0xff55BF00, 0xff55BF55, 0xff55BFAA, 0xff55BFFF, 0xff55DF00, 0xff55DF55,
- 0xff55DFAA, 0xff55DFFF, 0xff55FF00, 0xff55FF55, 0xff55FFAA, 0xff55FFFF,
- 0xff7F0000, 0xff7F0055, 0xff7F00AA, 0xff7F00FF, 0xff7F1F00, 0xff7F1F55,
- 0xff7F1FAA, 0xff7F1FFF, 0xff7F3F00, 0xff7F3F55, 0xff7F3FAA, 0xff7F3FFF,
- 0xff7F5F00, 0xff7F5F55, 0xff7F5FAA, 0xff7F5FFF, 0xff7F7F00, 0xff7F7F55,
- 0xff7F7FAA, 0xff7F7FFF, 0xff7F9F00, 0xff7F9F55, 0xff7F9FAA, 0xff7F9FFF,
- 0xff7FBF00, 0xff7FBF55, 0xff7FBFAA, 0xff7FBFFF, 0xff7FDF00, 0xff7FDF55,
- 0xff7FDFAA, 0xff7FDFFF, 0xff00FF7F, 0xff7FFF55, 0xff7FFFAA, 0xff7FFFFF,
- 0xffAA0000, 0xffAA0055, 0xffAA00AA, 0xffAA00FF, 0xffAA1F00, 0xffAA1F55,
- 0xffAA1FAA, 0xffAA1FFF, 0xffAA3F00, 0xffAA3F55, 0xffAA3FAA, 0xffAA3FFF,
- 0xffAA5F00, 0xffAA5F55, 0xffAA5FAA, 0xffAA5FFF, 0xffAA7F00, 0xffAA7F55,
- 0xffAA7FAA, 0xffAA7FFF, 0xffAA9F00, 0xffAA9F55, 0xffAA9FAA, 0xffAA9FFF,
- 0xffAABF00, 0xffAABF55, 0xffAABFAA, 0xffAABFFF, 0xffAADF00, 0xffAADF55,
- 0xffAADFAA, 0xffAADFFF, 0xffAAFF00, 0xffAAFF55, 0xffAAFFAA, 0xffAAFFFF,
- 0xffD40000, 0xffD40055, 0xffD400AA, 0xffD400FF, 0xffD41F00, 0xffD41F55,
- 0xffD41FAA, 0xffD41FFF, 0xffD43F00, 0xffD43F55, 0xffD43FAA, 0xffD43FFF,
- 0xffD45F00, 0xffD45F55, 0xffD45FAA, 0xffD45FFF, 0xffD47F00, 0xffD47F55,
- 0xffD47FAA, 0xffD4F7FF, 0xffD49F00, 0xffD49F55, 0xffD49FAA, 0xffD49FFF,
- 0xffD4BF00, 0xffD4BF55, 0xffD4BFAA, 0xffD4BFFF, 0xffD4DF00, 0xffD4DF55,
- 0xffD4DFAA, 0xffD4DFFF, 0xffD4FF00, 0xffD4FF55, 0xffD4FFAA, 0xffD4FFFF,
- 0xffFF0055, 0xffFF00AA, 0xffFF1F00, 0xffFF1F55, 0xffFF1FAA, 0xffFF1FFF,
- 0xffFF3F00, 0xffFF3F55, 0xffFF3FAA, 0xffFF3FFF, 0xffFF5F00, 0xffFF5F55,
- 0xffFF5FAA, 0xffFF5FFF, 0xffFF7F00, 0xffFF7F55, 0xffFF7FAA, 0xffFF7FFF,
- 0xffFF9F00, 0xffFF9F55, 0xffFF9FAA, 0xffFF9FFF, 0xffFFBF00, 0xffFFBF55,
- 0xffFFBFAA, 0xffFFBFFF, 0xffFFDF00, 0xffFFDF55, 0xffFFDFAA, 0xffFFDFFF,
- 0xffFFFF55, 0xffFFFFAA, 0xffCCCCFF, 0xffFFCCFF, 0xff33FFFF, 0xff66FFFF,
- 0xff99FFFF, 0xffCCFFFF, 0xff007F00, 0xff007F55, 0xff007FAA, 0xff007FFF,
- 0xff009F00, 0xff009F55, 0xff009FAA, 0xff009FFF, 0xff00BF00, 0xff00BF55,
- 0xff00BFAA, 0xff00BFFF, 0xff00DF00, 0xff00DF55, 0xff00DFAA, 0xff00DFFF,
- 0xff00FF55, 0xff00FFAA, 0xff2A0000, 0xff2A0055, 0xff2A00AA, 0xff2A00FF,
- 0xff2A1F00, 0xff2A1F55, 0xff2A1FAA, 0xff2A1FFF, 0xff2A3F00, 0xff2A3F55,
- 0xffFFFBF0, 0xffA0A0A4, 0xff808080, 0xffFF0000, 0xff00FF00, 0xffFF0000,
- 0xff0000FF, 0xffFF00FF, 0xff00FFFF, 0xffFFFFFF
-};
-const FX_DWORD g_dwMacPalette[256] = {
- 0xffFFFFFF, 0xffFFFFCC, 0xffFFFF99, 0xffFFFF66, 0xffFFFF33, 0xffFFFF00,
- 0xffFFCCFF, 0xffFFCCCC, 0xffFFCC99, 0xffFFCC66, 0xffFFCC33, 0xffFFCC00,
- 0xffFF99FF, 0xffFF99CC, 0xffFF9999, 0xffFF9966, 0xffFF9933, 0xffFF9900,
- 0xffFF66FF, 0xffFF66CC, 0xffFF6699, 0xffFF6666, 0xffFF6633, 0xffFF6600,
- 0xffFF33FF, 0xffFF33CC, 0xffFF3399, 0xffFF3366, 0xffFF3333, 0xffFF3300,
- 0xffFF00FF, 0xffFF00CC, 0xffFF0099, 0xffFF0066, 0xffFF0033, 0xffFF0000,
- 0xffCCFFFF, 0xffCCFFCC, 0xffCCFF99, 0xffCCFF66, 0xffCCFF33, 0xffCCFF00,
- 0xffCCCCFF, 0xffCCCCCC, 0xffCCCC99, 0xffCCCC66, 0xffCCCC33, 0xffCCCC00,
- 0xffCC99FF, 0xffCC99CC, 0xffCC9999, 0xffCC9966, 0xffCC9933, 0xffCC9900,
- 0xffCC66FF, 0xffCC66CC, 0xffCC6699, 0xffCC6666, 0xffCC6633, 0xffCC6600,
- 0xffCC33FF, 0xffCC33CC, 0xffCC3399, 0xffCC3366, 0xffCC3333, 0xffCC3300,
- 0xffCC00FF, 0xffCC00CC, 0xffCC0099, 0xffCC0066, 0xffCC0033, 0xffCC0000,
- 0xff99FFFF, 0xff99FFCC, 0xff99FF99, 0xff99FF66, 0xff99FF33, 0xff99FF00,
- 0xff99CCFF, 0xff99CCCC, 0xff99CC99, 0xff99CC66, 0xff99CC33, 0xff99CC00,
- 0xff9999FF, 0xff9999CC, 0xff999999, 0xff999966, 0xff999933, 0xff999900,
- 0xff9966FF, 0xff9966CC, 0xff996699, 0xff996666, 0xff996633, 0xff996600,
- 0xff9933FF, 0xff9933CC, 0xff993399, 0xff993366, 0xff993333, 0xff993300,
- 0xff9900FF, 0xff9900CC, 0xff990099, 0xff990066, 0xff990033, 0xff990000,
- 0xff66FFFF, 0xff66FFCC, 0xff66FF99, 0xff66FF66, 0xff66FF33, 0xff66FF00,
- 0xff66CCFF, 0xff66CCCC, 0xff66CC99, 0xff66CC66, 0xff66CC33, 0xff66CC00,
- 0xff6699FF, 0xff6699CC, 0xff669999, 0xff669966, 0xff669933, 0xff669900,
- 0xff6666FF, 0xff6666CC, 0xff666699, 0xff666666, 0xff666633, 0xff666600,
- 0xff6633FF, 0xff6633CC, 0xff663399, 0xff663366, 0xff663333, 0xff663300,
- 0xff6600FF, 0xff6600CC, 0xff660099, 0xff660066, 0xff660033, 0xff660000,
- 0xff33FFFF, 0xff33FFCC, 0xff33FF99, 0xff33FF66, 0xff33FF33, 0xff33FF00,
- 0xff33CCFF, 0xff33CCCC, 0xff33CC99, 0xff33CC66, 0xff33CC33, 0xff33CC00,
- 0xff3399FF, 0xff3399CC, 0xff339999, 0xff339966, 0xff339933, 0xff339900,
- 0xff3366FF, 0xff3366CC, 0xff336699, 0xff336666, 0xff336633, 0xff336600,
- 0xff3333FF, 0xff3333CC, 0xff333399, 0xff333366, 0xff333333, 0xff333300,
- 0xff3300FF, 0xff3300CC, 0xff330099, 0xff330066, 0xff330033, 0xff330000,
- 0xff00FFFF, 0xff00FFCC, 0xff00FF99, 0xff00FF66, 0xff00FF33, 0xff00FF00,
- 0xff00CCFF, 0xff00CCCC, 0xff00CC99, 0xff00CC66, 0xff00CC33, 0xff00CC00,
- 0xff0099FF, 0xff0099CC, 0xff009999, 0xff009966, 0xff009933, 0xff009900,
- 0xff0066FF, 0xff0066CC, 0xff006699, 0xff006666, 0xff006633, 0xff006600,
- 0xff0033FF, 0xff0033CC, 0xff003399, 0xff003366, 0xff003333, 0xff003300,
- 0xff0000FF, 0xff0000CC, 0xff000099, 0xff000066, 0xff000033,
- 0xffEE0000, 0xffDD0000, 0xffBB0000, 0xffAA0000, 0xff880000, 0xff770000,
- 0xff550000, 0xff440000, 0xff220000, 0xff110000, 0xff00EE00, 0xff00DD00,
- 0xff00BB00, 0xff00AA00, 0xff008800, 0xff007700, 0xff005500, 0xff004400,
- 0xff002200, 0xff001100, 0xff0000EE, 0xff0000DD, 0xff0000BB, 0xff0000AA,
- 0xff000088, 0xff000077, 0xff000055, 0xff000044, 0xff000022, 0xff000011,
- 0xffEEEEEE, 0xffDDDDDD, 0xffBBBBBB, 0xffAAAAAA, 0xff888888, 0xff777777,
- 0xff555555, 0xff444444, 0xff222222, 0xff111111, 0xff000000
-};
-class CFX_Palette : public CFX_Object
-{
-public:
- CFX_Palette();
- ~CFX_Palette();
-public:
- FX_BOOL BuildPalette(const CFX_DIBSource* pBitmap, int dwPaletteType);
- FX_DWORD* GetPalette() const
- {
- return m_pPalette;
- }
-
- FX_DWORD* GetColorLut()const
- {
- return m_cLut;
- }
- FX_DWORD* GetAmountLut()const
- {
- return m_aLut;
- }
- FX_INT32 Getlut()const
- {
- return m_lut;
- }
-protected:
- FX_DWORD* m_pPalette;
- FX_DWORD* m_cLut;
- FX_DWORD* m_aLut;
- int m_lut;
-};
-int _Partition(FX_DWORD* alut, FX_DWORD* clut, int l, int r)
-{
- FX_DWORD p_a = alut[l];
- FX_DWORD p_c = clut[l];
- while(l < r) {
- while(l < r && alut[r] >= p_a) {
- r--;
- }
- if (l < r) {
- alut[l] = alut[r];
- clut[l++] = clut[r];
- }
- while(l < r && alut[l] <= p_a) {
- l++;
- }
- if (l < r) {
- alut[r] = alut[l];
- clut[r--] = clut[l];
- }
- }
- alut[l] = p_a;
- clut[l] = p_c;
- return l;
-}
-void _Qsort(FX_DWORD* alut, FX_DWORD* clut, int l, int r)
-{
- if(l < r) {
- int pI = _Partition(alut, clut, l, r);
- _Qsort(alut, clut, l, pI - 1);
- _Qsort(alut, clut, pI + 1, r);
- }
-}
-void _ColorDecode(FX_DWORD pal_v, FX_BYTE& r, FX_BYTE& g, FX_BYTE& b)
-{
- r = (FX_BYTE)((pal_v & 0xf00) >> 4);
- g = (FX_BYTE)(pal_v & 0x0f0);
- b = (FX_BYTE)((pal_v & 0x00f) << 4);
-}
-void _Obtain_Pal(FX_DWORD* aLut, FX_DWORD*cLut, FX_DWORD* dest_pal, int pal_type, FX_DWORD* win_mac_pal, FX_DWORD lut)
-{
- int row, col;
- FX_DWORD lut_1 = lut - 1;
- if (pal_type == FXDIB_PALETTE_LOC) {
- for (row = 0; row < 256; row++) {
- int lut_offset = lut_1 - row;
- if (lut_offset < 0) {
- lut_offset += 256;
- }
- FX_DWORD color = cLut[lut_offset];
- FX_BYTE r, g, b;
- _ColorDecode(color, r, g, b);
- dest_pal[row] = ((FX_DWORD)r << 16) | ((FX_DWORD)g << 8) | b | 0xff000000;
- aLut[lut_offset] = row;
- }
- } else {
- for (row = 0; row < 256; row++) {
- int lut_offset = lut_1 - row;
- if (lut_offset < 0) {
- lut_offset += 256;
- }
- FX_BYTE r, g, b;
- _ColorDecode(cLut[lut_offset], r, g, b);
- int error, min_error = 1000000;
- int c_index = 0;
- for (col = 0; col < 256; col++) {
- FX_DWORD p_color = win_mac_pal[col];
- int d_r = r - (FX_BYTE)(p_color >> 16);
- int d_g = g - (FX_BYTE)(p_color >> 8);
- int d_b = b - (FX_BYTE)p_color;
- error = d_r * d_r + d_g * d_g + d_b * d_b;
- if (error < min_error) {
- min_error = error;
- c_index = col;
- }
- }
- dest_pal[row] = win_mac_pal[c_index];
- aLut[lut_offset] = row;
- }
- }
-}
-CFX_Palette::CFX_Palette()
-{
- m_pPalette = NULL;
- m_cLut = NULL;
- m_aLut = NULL;
- m_lut = 0;
-}
-CFX_Palette::~CFX_Palette()
-{
- if (m_pPalette) {
- FX_Free(m_pPalette);
- }
- if (m_cLut) {
- FX_Free(m_cLut);
- }
- if (m_aLut) {
- FX_Free(m_aLut);
- }
- m_lut = 0;
-}
-FX_BOOL CFX_Palette::BuildPalette(const CFX_DIBSource* pBitmap, int pal_type)
-{
- if (pBitmap == NULL) {
- return FALSE;
- }
- if (m_pPalette != NULL) {
- FX_Free(m_pPalette);
- }
- m_pPalette = FX_Alloc(FX_DWORD, 256);
- if (!m_pPalette) {
- return FALSE;
- }
- FXSYS_memset32(m_pPalette, 0, sizeof(FX_DWORD) * 256);
- int bpp = pBitmap->GetBPP() / 8;
- int width = pBitmap->GetWidth();
- int height = pBitmap->GetHeight();
- if (m_cLut) {
- FX_Free(m_cLut);
- m_cLut = NULL;
- }
- if (m_aLut) {
- FX_Free(m_aLut);
- m_aLut = NULL;
- }
- m_cLut = FX_Alloc(FX_DWORD, 4096);
- if (!m_cLut) {
- return FALSE;
- }
- m_aLut = FX_Alloc(FX_DWORD, 4096);
- if (!m_aLut) {
- return FALSE;
- }
- FXSYS_memset32(m_aLut, 0, sizeof(FX_DWORD) * 4096);
- FXSYS_memset32(m_cLut, 0, sizeof(FX_DWORD) * 4096);
- int row, col;
- m_lut = 0;
- for (row = 0; row < height; row++) {
- FX_BYTE* scan_line = (FX_BYTE*)pBitmap->GetScanline(row);
- for (col = 0; col < width; col++) {
- FX_BYTE* src_port = scan_line + col * bpp;
- FX_DWORD b = src_port[0] & 0xf0;
- FX_DWORD g = src_port[1] & 0xf0;
- FX_DWORD r = src_port[2] & 0xf0;
- FX_DWORD index = (r << 4) + g + (b >> 4);
- m_aLut[index]++;
- }
- }
- for (row = 0; row < 4096; row++) {
- if (m_aLut[row] != 0) {
- m_aLut[m_lut] = m_aLut[row];
- m_cLut[m_lut] = row;
- m_lut++;
- }
- }
- _Qsort(m_aLut, m_cLut, 0, m_lut - 1);
- FX_DWORD* win_mac_pal = NULL;
- if (pal_type == FXDIB_PALETTE_WIN) {
- win_mac_pal = (FX_DWORD*)g_dwWinPalette;
- } else if (pal_type == FXDIB_PALETTE_MAC) {
- win_mac_pal = (FX_DWORD*)g_dwMacPalette;
- }
- _Obtain_Pal(m_aLut, m_cLut, m_pPalette, pal_type, win_mac_pal, m_lut);
- return TRUE;
-}
-FX_BOOL _ConvertBuffer_1bppMask2Gray(FX_LPBYTE dest_buf, int dest_pitch, int width, int height,
- const CFX_DIBSource* pSrcBitmap, int src_left, int src_top)
-{
- FX_BYTE set_gray, reset_gray;
- set_gray = 0xff;
- reset_gray = 0x00;
- for (int row = 0; row < height; row ++) {
- FX_LPBYTE dest_scan = dest_buf + row * dest_pitch;
- FXSYS_memset8(dest_scan, reset_gray, width);
- FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row);
- for (int col = src_left; col < src_left + width; col ++) {
- if (src_scan[col / 8] & (1 << (7 - col % 8))) {
- *dest_scan = set_gray;
- }
- dest_scan ++;
- }
- }
- return TRUE;
-}
-FX_BOOL _ConvertBuffer_8bppMask2Gray(FX_LPBYTE dest_buf, int dest_pitch, int width, int height,
- const CFX_DIBSource* pSrcBitmap, int src_left, int src_top)
-{
- for (int row = 0; row < height; row ++) {
- FX_LPBYTE dest_scan = dest_buf + row * dest_pitch;
- FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left;
- FXSYS_memcpy32(dest_scan, src_scan, width);
- }
- return TRUE;
-}
-FX_BOOL _ConvertBuffer_1bppPlt2Gray(FX_LPBYTE dest_buf, int dest_pitch, int width, int height,
- const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform)
-{
- FX_DWORD* src_plt = pSrcBitmap->GetPalette();
- FX_BYTE gray[2];
- if (pIccTransform) {
- FX_DWORD plt[2];
- if (pSrcBitmap->IsCmykImage()) {
- plt[0] = FXCMYK_TODIB(src_plt[0]);
- plt[1] = FXCMYK_TODIB(src_plt[1]);
- } else {
- FX_LPBYTE bgr_ptr = (FX_LPBYTE)plt;
- bgr_ptr[0] = FXARGB_B(src_plt[0]);
- bgr_ptr[1] = FXARGB_G(src_plt[0]);
- bgr_ptr[2] = FXARGB_R(src_plt[0]);
- bgr_ptr[3] = FXARGB_B(src_plt[1]);
- bgr_ptr[4] = FXARGB_G(src_plt[1]);
- bgr_ptr[5] = FXARGB_R(src_plt[1]);
- }
- ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
- pIccModule->TranslateScanline(pIccTransform, gray, (FX_LPCBYTE)plt, 2);
- } else {
- FX_BYTE reset_r, reset_g, reset_b,
- set_r, set_g, set_b;
- if (pSrcBitmap->IsCmykImage()) {
- AdobeCMYK_to_sRGB1(FXSYS_GetCValue(src_plt[0]), FXSYS_GetMValue(src_plt[0]), FXSYS_GetYValue(src_plt[0]), FXSYS_GetKValue(src_plt[0]),
- reset_r, reset_g, reset_b);
- AdobeCMYK_to_sRGB1(FXSYS_GetCValue(src_plt[1]), FXSYS_GetMValue(src_plt[1]), FXSYS_GetYValue(src_plt[1]), FXSYS_GetKValue(src_plt[1]),
- set_r, set_g, set_b);
- } else {
- reset_r = FXARGB_R(src_plt[0]);
- reset_g = FXARGB_G(src_plt[0]);
- reset_b = FXARGB_B(src_plt[0]);
- set_r = FXARGB_R(src_plt[1]);
- set_g = FXARGB_G(src_plt[1]);
- set_b = FXARGB_B(src_plt[1]);
- }
- gray[0] = FXRGB2GRAY(reset_r, reset_g, reset_b);
- gray[1] = FXRGB2GRAY(set_r, set_g, set_b);
- }
- for (int row = 0; row < height; row ++) {
- FX_LPBYTE dest_scan = dest_buf + row * dest_pitch;
- FXSYS_memset8(dest_scan, gray[0], width);
- FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row);
- for (int col = src_left; col < src_left + width; col ++) {
- if (src_scan[col / 8] & (1 << (7 - col % 8))) {
- *dest_scan = gray[1];
- }
- dest_scan ++;
- }
- }
- return TRUE;
-}
-FX_BOOL _ConvertBuffer_8bppPlt2Gray(FX_LPBYTE dest_buf, int dest_pitch, int width, int height,
- const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform)
-{
- FX_DWORD* src_plt = pSrcBitmap->GetPalette();
- FX_BYTE gray[256];
- if (pIccTransform) {
- FX_DWORD plt[256];
- if (pSrcBitmap->IsCmykImage()) {
- for (int i = 0; i < 256; i ++) {
- plt[i] = FXCMYK_TODIB(src_plt[i]);
- }
- } else {
- FX_LPBYTE bgr_ptr = (FX_LPBYTE)plt;
- for (int i = 0; i < 256; i ++) {
- *bgr_ptr++ = FXARGB_B(src_plt[i]);
- *bgr_ptr++ = FXARGB_G(src_plt[i]);
- *bgr_ptr++ = FXARGB_R(src_plt[i]);
- }
- }
- ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
- pIccModule->TranslateScanline(pIccTransform, gray, (FX_LPCBYTE)plt, 256);
- } else {
- if (pSrcBitmap->IsCmykImage()) {
- FX_BYTE r, g, b;
- for (int i = 0; i < 256; i ++) {
- AdobeCMYK_to_sRGB1(FXSYS_GetCValue(src_plt[i]), FXSYS_GetMValue(src_plt[i]), FXSYS_GetYValue(src_plt[i]), FXSYS_GetKValue(src_plt[i]),
- r, g, b);
- gray[i] = FXRGB2GRAY(r, g, b);
- }
- } else
- for (int i = 0; i < 256; i ++) {
- gray[i] = FXRGB2GRAY(FXARGB_R(src_plt[i]), FXARGB_G(src_plt[i]), FXARGB_B(src_plt[i]));
- }
- }
- for (int row = 0; row < height; row ++) {
- FX_LPBYTE dest_scan = dest_buf + row * dest_pitch;
- FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left;
- for (int col = 0; col < width; col ++) {
- *dest_scan++ = gray[*src_scan++];
- }
- }
- return TRUE;
-}
-FX_BOOL _ConvertBuffer_RgbOrCmyk2Gray(FX_LPBYTE dest_buf, int dest_pitch, int width, int height,
- const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform)
-{
- int Bpp = pSrcBitmap->GetBPP() / 8;
- if (pIccTransform) {
- ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
- if (Bpp == 3 || pSrcBitmap->IsCmykImage()) {
- for (int row = 0; row < height; row ++) {
- FX_LPBYTE dest_scan = dest_buf + row * dest_pitch;
- FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left * Bpp;
- pIccModule->TranslateScanline(pIccTransform, dest_scan, src_scan, width);
- }
- } else {
- for (int row = 0; row < height; row ++) {
- FX_LPBYTE dest_scan = dest_buf + row * dest_pitch;
- FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left * 4;
- for (int col = 0; col < width; col ++) {
- pIccModule->TranslateScanline(pIccTransform, dest_scan, src_scan, 1);
- dest_scan++;
- src_scan += 4;
- }
- }
- }
- } else {
- if (pSrcBitmap->IsCmykImage()) {
- for (int row = 0; row < height; row ++) {
- FX_LPBYTE dest_scan = dest_buf + row * dest_pitch;
- FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left * 4;
- for (int col = 0; col < width; col ++) {
- FX_BYTE r, g, b;
- AdobeCMYK_to_sRGB1(FXSYS_GetCValue((FX_DWORD)src_scan[0]), FXSYS_GetMValue((FX_DWORD)src_scan[1]), FXSYS_GetYValue((FX_DWORD)src_scan[2]), FXSYS_GetKValue((FX_DWORD)src_scan[3]),
- r, g, b);
- *dest_scan++ = FXRGB2GRAY(r, g, b);
- src_scan += 4;
- }
- }
- } else
- for (int row = 0; row < height; row ++) {
- FX_LPBYTE dest_scan = dest_buf + row * dest_pitch;
- FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left * Bpp;
- for (int col = 0; col < width; col ++) {
- *dest_scan++ = FXRGB2GRAY(src_scan[2], src_scan[1], src_scan[0]);
- src_scan += Bpp;
- }
- }
- }
- return TRUE;
-}
-inline void _ConvertBuffer_IndexCopy(FX_LPBYTE dest_buf, int dest_pitch, int width, int height,
- const CFX_DIBSource* pSrcBitmap, int src_left, int src_top)
-{
- if (pSrcBitmap->GetBPP() == 1) {
- for (int row = 0; row < height; row ++) {
- FX_LPBYTE dest_scan = dest_buf + row * dest_pitch;
- FXSYS_memset32(dest_scan, 0, width);
- FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row);
- for (int col = src_left; col < src_left + width; col ++) {
- if (src_scan[col / 8] & (1 << (7 - col % 8))) {
- *dest_scan = 1;
- }
- dest_scan ++;
- }
- }
- } else {
- for (int row = 0; row < height; row ++) {
- FX_LPBYTE dest_scan = dest_buf + row * dest_pitch;
- FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left;
- FXSYS_memcpy32(dest_scan, src_scan, width);
- }
- }
-}
-FX_BOOL _ConvertBuffer_Plt2PltRgb8(FX_LPBYTE dest_buf, int dest_pitch, int width, int height,
- const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, FX_DWORD* dst_plt, void* pIccTransform)
-{
- _ConvertBuffer_IndexCopy(dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top);
- FX_DWORD* src_plt = pSrcBitmap->GetPalette();
- int plt_size = pSrcBitmap->GetPaletteSize();
- if (pIccTransform) {
- FX_DWORD plt[256];
- FX_LPBYTE bgr_ptr = (FX_LPBYTE)plt;
- if (pSrcBitmap->IsCmykImage()) {
- for (int i = 0; i < plt_size; i ++) {
- plt[i] = FXCMYK_TODIB(src_plt[i]);
- }
- } else {
- for (int i = 0; i < plt_size; i ++) {
- *bgr_ptr++ = FXARGB_B(src_plt[i]);
- *bgr_ptr++ = FXARGB_G(src_plt[i]);
- *bgr_ptr++ = FXARGB_R(src_plt[i]);
- }
- bgr_ptr = (FX_LPBYTE)plt;
- }
- ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
- pIccModule->TranslateScanline(pIccTransform, (FX_LPBYTE)plt, (FX_LPCBYTE)plt, plt_size);
- for (int i = 0; i < plt_size; i ++) {
- dst_plt[i] = FXARGB_MAKE(0xff, bgr_ptr[2], bgr_ptr[1], bgr_ptr[0]);
- bgr_ptr += 3;
- }
- } else {
- if (pSrcBitmap->IsCmykImage()) {
- for (int i = 0; i < plt_size; i ++) {
- FX_BYTE r, g, b;
- AdobeCMYK_to_sRGB1(FXSYS_GetCValue(src_plt[i]), FXSYS_GetMValue(src_plt[i]), FXSYS_GetYValue(src_plt[i]), FXSYS_GetKValue(src_plt[i]),
- r, g, b);
- dst_plt[i] = FXARGB_MAKE(0xff, r, g, b);
- }
- } else {
- FXSYS_memcpy32(dst_plt, src_plt, plt_size * 4);
- }
- }
- return TRUE;
-}
-inline FX_BOOL _ConvertBuffer_Rgb2PltRgb8_NoTransform(FX_LPBYTE dest_buf, int dest_pitch, int width, int height,
- const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, FX_DWORD* dst_plt)
-{
- int bpp = pSrcBitmap->GetBPP() / 8;
- int row, col;
- CFX_Palette palette;
- palette.BuildPalette(pSrcBitmap, FXDIB_PALETTE_LOC);
- FX_DWORD* cLut = palette.GetColorLut();
- FX_DWORD* aLut = palette.GetAmountLut();
- if (cLut == NULL || aLut == NULL) {
- return FALSE;
- }
- int lut = palette.Getlut();
- FX_DWORD* pPalette = palette.GetPalette();
- if (lut > 256) {
- int err, min_err;
- int lut_256 = lut - 256;
- for (row = 0; row < lut_256; row++) {
- min_err = 1000000;
- FX_BYTE r, g, b;
- _ColorDecode(cLut[row], r, g, b);
- int clrindex = 0;
- for (int col = 0; col < 256; col++) {
- FX_DWORD p_color = *(pPalette + col);
- int d_r = r - (FX_BYTE)(p_color >> 16);
- int d_g = g - (FX_BYTE)(p_color >> 8);
- int d_b = b - (FX_BYTE)(p_color);
- err = d_r * d_r + d_g * d_g + d_b * d_b;
- if (err < min_err) {
- min_err = err;
- clrindex = col;
- }
- }
- aLut[row] = clrindex;
- }
- }
- FX_INT32 lut_1 = lut - 1;
- for (row = 0; row < height; row ++) {
- FX_BYTE* src_scan = (FX_BYTE*)pSrcBitmap->GetScanline(src_top + row) + src_left;
- FX_BYTE* dest_scan = dest_buf + row * dest_pitch;
- for (col = 0; col < width; col++) {
- FX_BYTE* src_port = src_scan + col * bpp;
- int r = src_port[2] & 0xf0;
- int g = src_port[1] & 0xf0;
- int b = src_port[0] & 0xf0;
- FX_DWORD clrindex = (r << 4) + g + (b >> 4);
- for (int i = lut_1; i >= 0; i--)
- if (clrindex == cLut[i]) {
- *(dest_scan + col) = (FX_BYTE)(aLut[i]);
- break;
- }
- }
- }
- FXSYS_memcpy32(dst_plt, pPalette, sizeof(FX_DWORD) * 256);
- return TRUE;
-}
-FX_BOOL _ConvertBuffer_Rgb2PltRgb8(FX_LPBYTE dest_buf, int dest_pitch, int width, int height,
- const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, FX_DWORD* dst_plt, void* pIccTransform)
-{
- ICodec_IccModule* pIccModule = NULL;
- if (pIccTransform) {
- pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
- }
- FX_BOOL ret = _ConvertBuffer_Rgb2PltRgb8_NoTransform(dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top, dst_plt);
- if (ret && pIccTransform) {
- ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
- for (int i = 0; i < 256; i++) {
- FX_ARGB* plt = dst_plt + i;
- FX_ARGB plt_entry = FXARGB_TODIB(*plt);
- pIccModule->TranslateScanline(pIccTransform, (FX_LPBYTE)&plt_entry, (FX_LPCBYTE)&plt_entry, 1);
- *plt = FXARGB_TODIB(plt_entry);
- }
- }
- return ret;
-}
-FX_BOOL _ConvertBuffer_1bppMask2Rgb(FXDIB_Format dst_format, FX_LPBYTE dest_buf, int dest_pitch, int width, int height,
- const CFX_DIBSource* pSrcBitmap, int src_left, int src_top)
-{
- int comps = (dst_format & 0xff) / 8;
- FX_BYTE set_gray, reset_gray;
- set_gray = 0xff;
- reset_gray = 0x00;
- for (int row = 0; row < height; row ++) {
- FX_LPBYTE dest_scan = dest_buf + row * dest_pitch;
- FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row);
- for (int col = src_left; col < src_left + width; col ++) {
- if (src_scan[col / 8] & (1 << (7 - col % 8))) {
- dest_scan[0] = set_gray;
- dest_scan[1] = set_gray;
- dest_scan[2] = set_gray;
- } else {
- dest_scan[0] = reset_gray;
- dest_scan[1] = reset_gray;
- dest_scan[2] = reset_gray;
- }
- dest_scan += comps;
- }
- }
- return TRUE;
-}
-FX_BOOL _ConvertBuffer_8bppMask2Rgb(FXDIB_Format dst_format, FX_LPBYTE dest_buf, int dest_pitch, int width, int height,
- const CFX_DIBSource* pSrcBitmap, int src_left, int src_top)
-{
- int comps = (dst_format & 0xff) / 8;
- for (int row = 0; row < height; row ++) {
- FX_LPBYTE dest_scan = dest_buf + row * dest_pitch;
- FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left;
- FX_BYTE src_pixel;
- for (int col = 0; col < width; col ++) {
- src_pixel = *src_scan++;
- *dest_scan++ = src_pixel;
- *dest_scan++ = src_pixel;
- *dest_scan = src_pixel;
- dest_scan += comps - 2;
- }
- }
- return TRUE;
-}
-FX_BOOL _ConvertBuffer_1bppPlt2Rgb(FXDIB_Format dst_format, FX_LPBYTE dest_buf, int dest_pitch, int width, int height,
- const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform)
-{
- int comps = (dst_format & 0xff) / 8;
- FX_DWORD* src_plt = pSrcBitmap->GetPalette();
- FX_DWORD plt[2];
- FX_LPBYTE bgr_ptr = (FX_LPBYTE)plt;
- if (pSrcBitmap->IsCmykImage()) {
- plt[0] = FXCMYK_TODIB(src_plt[0]);
- plt[1] = FXCMYK_TODIB(src_plt[1]);
- } else {
- bgr_ptr[0] = FXARGB_B(src_plt[0]);
- bgr_ptr[1] = FXARGB_G(src_plt[0]);
- bgr_ptr[2] = FXARGB_R(src_plt[0]);
- bgr_ptr[3] = FXARGB_B(src_plt[1]);
- bgr_ptr[4] = FXARGB_G(src_plt[1]);
- bgr_ptr[5] = FXARGB_R(src_plt[1]);
- }
- if (pIccTransform) {
- ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
- pIccModule->TranslateScanline(pIccTransform, (FX_LPBYTE)plt, (FX_LPCBYTE)plt, 2);
- } else {
- if (pSrcBitmap->IsCmykImage()) {
- AdobeCMYK_to_sRGB1(FXSYS_GetCValue(src_plt[0]), FXSYS_GetMValue(src_plt[0]), FXSYS_GetYValue(src_plt[0]), FXSYS_GetKValue(src_plt[0]),
- bgr_ptr[2], bgr_ptr[1], bgr_ptr[0]);
- AdobeCMYK_to_sRGB1(FXSYS_GetCValue(src_plt[1]), FXSYS_GetMValue(src_plt[1]), FXSYS_GetYValue(src_plt[1]), FXSYS_GetKValue(src_plt[1]),
- bgr_ptr[5], bgr_ptr[4], bgr_ptr[3]);
- }
- }
- for (int row = 0; row < height; row ++) {
- FX_LPBYTE dest_scan = dest_buf + row * dest_pitch;
- FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row);
- for (int col = src_left; col < src_left + width; col ++) {
- if (src_scan[col / 8] & (1 << (7 - col % 8))) {
- *dest_scan++ = bgr_ptr[3];
- *dest_scan++ = bgr_ptr[4];
- *dest_scan = bgr_ptr[5];
- } else {
- *dest_scan++ = bgr_ptr[0];
- *dest_scan++ = bgr_ptr[1];
- *dest_scan = bgr_ptr[2];
- }
- dest_scan += comps - 2;
- }
- }
- return TRUE;
-}
-FX_BOOL _ConvertBuffer_8bppPlt2Rgb(FXDIB_Format dst_format, FX_LPBYTE dest_buf, int dest_pitch, int width, int height,
- const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform)
-{
- int comps = (dst_format & 0xff) / 8;
- FX_DWORD* src_plt = pSrcBitmap->GetPalette();
- FX_DWORD plt[256];
- FX_LPBYTE bgr_ptr = (FX_LPBYTE)plt;
- if (!pSrcBitmap->IsCmykImage()) {
- for (int i = 0; i < 256; i++) {
- *bgr_ptr++ = FXARGB_B(src_plt[i]);
- *bgr_ptr++ = FXARGB_G(src_plt[i]);
- *bgr_ptr++ = FXARGB_R(src_plt[i]);
- }
- bgr_ptr = (FX_LPBYTE)plt;
- }
- if (pIccTransform) {
- if (pSrcBitmap->IsCmykImage()) {
- for (int i = 0; i < 256; i++) {
- plt[i] = FXCMYK_TODIB(src_plt[i]);
- }
- }
- ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
- pIccModule->TranslateScanline(pIccTransform, (FX_LPBYTE)plt, (FX_LPCBYTE)plt, 256);
- } else {
- if (pSrcBitmap->IsCmykImage()) {
- for (int i = 0; i < 256; i++) {
- AdobeCMYK_to_sRGB1(FXSYS_GetCValue(src_plt[i]), FXSYS_GetMValue(src_plt[i]), FXSYS_GetYValue(src_plt[i]), FXSYS_GetKValue(src_plt[i]),
- bgr_ptr[2], bgr_ptr[1], bgr_ptr[0]);
- bgr_ptr += 3;
- }
- bgr_ptr = (FX_LPBYTE)plt;
- }
- }
- for (int row = 0; row < height; row ++) {
- FX_LPBYTE dest_scan = dest_buf + row * dest_pitch;
- FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left;
- for (int col = 0; col < width; col ++) {
- FX_LPBYTE src_pixel = bgr_ptr + 3 * (*src_scan++);
- *dest_scan++ = *src_pixel++;
- *dest_scan++ = *src_pixel++;
- *dest_scan = *src_pixel++;
- dest_scan += comps - 2;
- }
- }
- return TRUE;
-}
-FX_BOOL _ConvertBuffer_24bppRgb2Rgb24(FX_LPBYTE dest_buf, int dest_pitch, int width, int height,
- const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform)
-{
- if (pIccTransform) {
- ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
- for (int row = 0; row < height; row ++) {
- FX_LPBYTE dest_scan = dest_buf + row * dest_pitch;
- FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left * 3;
- pIccModule->TranslateScanline(pIccTransform, dest_scan, src_scan, width);
- }
- } else {
- for (int row = 0; row < height; row ++) {
- FX_LPBYTE dest_scan = dest_buf + row * dest_pitch;
- FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left * 3;
- FXSYS_memcpy32(dest_scan, src_scan, width * 3);
- }
- }
- return TRUE;
-}
-FX_BOOL _ConvertBuffer_32bppRgb2Rgb24(FX_LPBYTE dest_buf, int dest_pitch, int width, int height,
- const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform)
-{
- for (int row = 0; row < height; row ++) {
- FX_LPBYTE dest_scan = dest_buf + row * dest_pitch;
- FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left * 4;
- for (int col = 0; col < width; col ++) {
- *dest_scan++ = *src_scan++;
- *dest_scan++ = *src_scan++;
- *dest_scan++ = *src_scan++;
- src_scan++;
- }
- }
- if (pIccTransform) {
- ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
- for (int row = 0; row < height; row ++) {
- FX_LPBYTE dest_scan = dest_buf + row * dest_pitch;
- pIccModule->TranslateScanline(pIccTransform, dest_scan, dest_scan, width);
- }
- }
- return TRUE;
-}
-FX_BOOL _ConvertBuffer_Rgb2Rgb32(FX_LPBYTE dest_buf, int dest_pitch, int width, int height,
- const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform)
-{
- int comps = pSrcBitmap->GetBPP() / 8;
- if (pIccTransform) {
- ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
- for (int row = 0; row < height; row ++) {
- FX_LPBYTE dest_scan = dest_buf + row * dest_pitch;
- FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left * comps;
- for (int col = 0; col < width; col ++) {
- pIccModule->TranslateScanline(pIccTransform, dest_scan, src_scan, 1);
- dest_scan += 4;
- src_scan += comps;
- }
- }
- } else {
- for (int row = 0; row < height; row ++) {
- FX_LPBYTE dest_scan = dest_buf + row * dest_pitch;
- FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left * comps;
- for (int col = 0; col < width; col ++) {
- *dest_scan++ = *src_scan++;
- *dest_scan++ = *src_scan++;
- *dest_scan++ = *src_scan++;
- dest_scan++;
- src_scan += comps - 3;
- }
- }
- }
- return TRUE;
-}
-FX_BOOL _ConvertBuffer_32bppCmyk2Rgb32(FX_LPBYTE dest_buf, int dest_pitch, int width, int height,
- const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform)
-{
- if (pIccTransform) {
- ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
- for (int row = 0; row < height; row ++) {
- FX_LPBYTE dest_scan = dest_buf + row * dest_pitch;
- FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left * 4;
- for (int col = 0; col < width; col ++) {
- pIccModule->TranslateScanline(pIccTransform, dest_scan, src_scan, 1);
- dest_scan += 4;
- src_scan += 4;
- }
- }
- } else {
- for (int row = 0; row < height; row ++) {
- FX_LPBYTE dest_scan = dest_buf + row * dest_pitch;
- FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left * 4;
- for (int col = 0; col < width; col ++) {
- AdobeCMYK_to_sRGB1(src_scan[0], src_scan[1], src_scan[2], src_scan[3],
- dest_scan[2], dest_scan[1], dest_scan[0]);
- dest_scan += 4;
- src_scan += 4;
- }
- }
- }
- return TRUE;
-}
-FX_BOOL ConvertBuffer(FXDIB_Format dest_format, FX_LPBYTE dest_buf, int dest_pitch, int width, int height,
- const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, FX_DWORD*& d_pal, void* pIccTransform)
-{
- FXDIB_Format src_format = pSrcBitmap->GetFormat();
- if (!CFX_GEModule::Get()->GetCodecModule() || !CFX_GEModule::Get()->GetCodecModule()->GetIccModule()) {
- pIccTransform = NULL;
- }
- switch (dest_format) {
- case FXDIB_Invalid:
- case FXDIB_1bppCmyk:
- case FXDIB_1bppMask:
- case FXDIB_1bppRgb:
- ASSERT(FALSE);
- return FALSE;
- case FXDIB_8bppMask: {
- if ((src_format & 0xff) == 1) {
- if (pSrcBitmap->GetPalette()) {
- return _ConvertBuffer_1bppPlt2Gray(dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top, pIccTransform);
- }
- return _ConvertBuffer_1bppMask2Gray(dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top);
- } else if ((src_format & 0xff) == 8) {
- if (pSrcBitmap->GetPalette()) {
- return _ConvertBuffer_8bppPlt2Gray(dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top, pIccTransform);
- }
- return _ConvertBuffer_8bppMask2Gray(dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top);
- } else if ((src_format & 0xff) >= 24) {
- return _ConvertBuffer_RgbOrCmyk2Gray(dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top, pIccTransform);
- }
- return FALSE;
- }
- case FXDIB_8bppRgb:
- case FXDIB_8bppRgba: {
- if ((src_format & 0xff) == 8 && pSrcBitmap->GetPalette() == NULL) {
- return ConvertBuffer(FXDIB_8bppMask, dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top, d_pal, pIccTransform);
- }
- d_pal = FX_Alloc(FX_DWORD, 256);
- if (!d_pal) {
- return FALSE;
- }
- FXSYS_memset32(d_pal, 0, sizeof(FX_DWORD) * 256);
- if (((src_format & 0xff) == 1 || (src_format & 0xff) == 8) && pSrcBitmap->GetPalette()) {
- return _ConvertBuffer_Plt2PltRgb8(dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top, d_pal, pIccTransform);
- } else if ((src_format & 0xff) >= 24) {
- return _ConvertBuffer_Rgb2PltRgb8(dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top, d_pal, pIccTransform);
- }
- return FALSE;
- }
- case FXDIB_Rgb:
- case FXDIB_Rgba: {
- if ((src_format & 0xff) == 1) {
- if (pSrcBitmap->GetPalette()) {
- return _ConvertBuffer_1bppPlt2Rgb(dest_format, dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top, pIccTransform);
- }
- return _ConvertBuffer_1bppMask2Rgb(dest_format, dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top);
- } else if ((src_format & 0xff) == 8) {
- if (pSrcBitmap->GetPalette()) {
- return _ConvertBuffer_8bppPlt2Rgb(dest_format, dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top, pIccTransform);
- }
- return _ConvertBuffer_8bppMask2Rgb(dest_format, dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top);
- } else if ((src_format & 0xff) == 24) {
- return _ConvertBuffer_24bppRgb2Rgb24(dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top, pIccTransform);
- } else if ((src_format & 0xff) == 32) {
- return _ConvertBuffer_32bppRgb2Rgb24(dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top, pIccTransform);
- }
- return FALSE;
- }
- case FXDIB_Argb:
- case FXDIB_Rgb32: {
- if ((src_format & 0xff) == 1) {
- if (pSrcBitmap->GetPalette()) {
- return _ConvertBuffer_1bppPlt2Rgb(dest_format, dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top, pIccTransform);
- }
- return _ConvertBuffer_1bppMask2Rgb(dest_format, dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top);
- } else if ((src_format & 0xff) == 8) {
- if (pSrcBitmap->GetPalette()) {
- return _ConvertBuffer_8bppPlt2Rgb(dest_format, dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top, pIccTransform);
- }
- return _ConvertBuffer_8bppMask2Rgb(dest_format, dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top);
- } else if ((src_format & 0xff) >= 24) {
- if (src_format & 0x0400) {
- return _ConvertBuffer_32bppCmyk2Rgb32(dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top, pIccTransform);
- }
- return _ConvertBuffer_Rgb2Rgb32(dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top, pIccTransform);
- }
- return FALSE;
- }
- default:
- return FALSE;
- }
- return FALSE;
-}
-CFX_DIBitmap* CFX_DIBSource::CloneConvert(FXDIB_Format dest_format, const FX_RECT* pClip, void* pIccTransform) const
-{
- if(dest_format == GetFormat() && pIccTransform == NULL) {
- return Clone(pClip);
- }
- if (pClip) {
- CFX_DIBitmap* pClone = Clone(pClip);
- if (pClone == NULL) {
- return NULL;
- }
- if(!pClone->ConvertFormat(dest_format, pIccTransform)) {
- delete pClone;
- return NULL;
- }
- return pClone;
- }
- CFX_DIBitmap* pClone = FX_NEW CFX_DIBitmap;
- if (!pClone) {
- return NULL;
- }
- if(!pClone->Create(m_Width, m_Height, dest_format)) {
- delete pClone;
- return NULL;
- }
- FX_BOOL ret = TRUE;
- CFX_DIBitmap* pSrcAlpha = NULL;
- if (m_AlphaFlag & 2) {
- pSrcAlpha = (GetFormat() == FXDIB_Argb) ? GetAlphaMask() : m_pAlphaMask;
- if (pSrcAlpha == NULL) {
- delete pClone;
- return NULL;
- }
- }
- if (dest_format & 0x0200) {
- if (dest_format == FXDIB_Argb)
- ret = pSrcAlpha ?
- pClone->LoadChannel(FXDIB_Alpha, pSrcAlpha, FXDIB_Alpha) :
- pClone->LoadChannel(FXDIB_Alpha, 0xff);
- else {
- ret = pClone->CopyAlphaMask(pSrcAlpha);
- }
- }
- if (pSrcAlpha && pSrcAlpha != m_pAlphaMask) {
- delete pSrcAlpha;
- pSrcAlpha = NULL;
- }
- if (!ret) {
- delete pClone;
- return NULL;
- }
- FX_DWORD* pal_8bpp = NULL;
- ret = ConvertBuffer(dest_format, pClone->GetBuffer(), pClone->GetPitch(), m_Width, m_Height, this, 0, 0, pal_8bpp, pIccTransform);
- if (!ret) {
- if (pal_8bpp) {
- FX_Free(pal_8bpp);
- }
- delete pClone;
- return NULL;
- }
- if (pal_8bpp) {
- pClone->CopyPalette(pal_8bpp);
- FX_Free(pal_8bpp);
- pal_8bpp = NULL;
- }
- return pClone;
-}
-FX_BOOL CFX_DIBitmap::ConvertFormat(FXDIB_Format dest_format, void* pIccTransform)
-{
- FXDIB_Format src_format = GetFormat();
- if (dest_format == src_format && pIccTransform == NULL) {
- return TRUE;
- }
- if (dest_format == FXDIB_8bppMask && src_format == FXDIB_8bppRgb && m_pPalette == NULL) {
- m_AlphaFlag = 1;
- return TRUE;
- }
- if (dest_format == FXDIB_Argb && src_format == FXDIB_Rgb32 && pIccTransform == NULL) {
- m_AlphaFlag = 2;
- for (int row = 0; row < m_Height; row ++) {
- FX_LPBYTE scanline = m_pBuffer + row * m_Pitch + 3;
- for (int col = 0; col < m_Width; col ++) {
- *scanline = 0xff;
- scanline += 4;
- }
- }
- return TRUE;
- }
- int dest_bpp = dest_format & 0xff;
- int dest_pitch = (dest_bpp * m_Width + 31) / 32 * 4;
- FX_LPBYTE dest_buf = FX_AllocNL(FX_BYTE, dest_pitch * m_Height + 4);
- if (dest_buf == NULL) {
- return FALSE;
- }
- CFX_DIBitmap* pAlphaMask = NULL;
- if (dest_format == FXDIB_Argb) {
- FXSYS_memset8(dest_buf, 0xff, dest_pitch * m_Height + 4);
- if (m_pAlphaMask) {
- for (int row = 0; row < m_Height; row ++) {
- FX_LPBYTE pDstScanline = dest_buf + row * dest_pitch + 3;
- FX_LPCBYTE pSrcScanline = m_pAlphaMask->GetScanline(row);
- for (int col = 0; col < m_Width; col ++) {
- *pDstScanline = *pSrcScanline++;
- pDstScanline += 4;
- }
- }
- }
- } else if (dest_format & 0x0200) {
- if (src_format == FXDIB_Argb) {
- pAlphaMask = GetAlphaMask();
- if (pAlphaMask == NULL) {
- FX_Free(dest_buf);
- return FALSE;
- }
- } else {
- if (m_pAlphaMask == NULL) {
- if (!BuildAlphaMask()) {
- FX_Free(dest_buf);
- return FALSE;
- }
- pAlphaMask = m_pAlphaMask;
- m_pAlphaMask = NULL;
- } else {
- pAlphaMask = m_pAlphaMask;
- }
- }
- }
- FX_BOOL ret = FALSE;
- FX_DWORD* pal_8bpp = NULL;
- ret = ConvertBuffer(dest_format, dest_buf, dest_pitch, m_Width, m_Height, this, 0, 0, pal_8bpp, pIccTransform);
- if (!ret) {
- if (pal_8bpp) {
- FX_Free(pal_8bpp);
- }
- if (pAlphaMask != m_pAlphaMask) {
- delete pAlphaMask;
- }
- if (dest_buf) {
- FX_Free(dest_buf);
- }
- return FALSE;
- }
- if (m_pAlphaMask && pAlphaMask != m_pAlphaMask) {
- delete m_pAlphaMask;
- }
- m_pAlphaMask = pAlphaMask;
- if (m_pPalette) {
- FX_Free(m_pPalette);
- }
- m_pPalette = pal_8bpp;
- if (!m_bExtBuf) {
- FX_Free(m_pBuffer);
- }
- m_bExtBuf = FALSE;
- m_pBuffer = dest_buf;
- m_bpp = (FX_BYTE)dest_format;
- m_AlphaFlag = (FX_BYTE)(dest_format >> 8);
- m_Pitch = dest_pitch;
- return TRUE;
-}
+// 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
+
+#include "../../../include/fxge/fx_dib.h"
+#include "../../../include/fxge/fx_ge.h"
+#include "../../../include/fxcodec/fx_codec.h"
+const FX_DWORD g_dwWinPalette[256] = {
+ 0xff000000, 0xff800000, 0xff008000, 0xff808000, 0xff000080, 0xff800080,
+ 0xff008080, 0xff808080, 0xffC0DCC0, 0xffA6CAF0, 0xff2A3FAA, 0xff2A3FFF,
+ 0xff2A5F00, 0xff2A5F55, 0xff2A5FAA, 0xff2A5FFF, 0xff2A7F00, 0xff2A7F55,
+ 0xff2A7FAA, 0xff2A7FFF, 0xff2A9F00, 0xff2A9F55, 0xff2A9FAA, 0xff2A9FFF,
+ 0xff2ABF00, 0xff2ABF55, 0xff2ABFAA, 0xff2ABFFF, 0xff2ADF00, 0xff2ADF55,
+ 0xff2ADFAA, 0xff2ADFFF, 0xff2AFF00, 0xff2AFF55, 0xff2AFFAA, 0xff2AFFFF,
+ 0xff550000, 0xff550055, 0xff5500AA, 0xff5500FF, 0xff551F00, 0xff551F55,
+ 0xff551FAA, 0xff551FFF, 0xff553F00, 0xff553F55, 0xff553FAA, 0xff553FFF,
+ 0xff555F00, 0xff555F55, 0xff555FAA, 0xff555FFF, 0xff557F00, 0xff557F55,
+ 0xff557FAA, 0xff557FFF, 0xff559F00, 0xff559F55, 0xff559FAA, 0xff559FFF,
+ 0xff55BF00, 0xff55BF55, 0xff55BFAA, 0xff55BFFF, 0xff55DF00, 0xff55DF55,
+ 0xff55DFAA, 0xff55DFFF, 0xff55FF00, 0xff55FF55, 0xff55FFAA, 0xff55FFFF,
+ 0xff7F0000, 0xff7F0055, 0xff7F00AA, 0xff7F00FF, 0xff7F1F00, 0xff7F1F55,
+ 0xff7F1FAA, 0xff7F1FFF, 0xff7F3F00, 0xff7F3F55, 0xff7F3FAA, 0xff7F3FFF,
+ 0xff7F5F00, 0xff7F5F55, 0xff7F5FAA, 0xff7F5FFF, 0xff7F7F00, 0xff7F7F55,
+ 0xff7F7FAA, 0xff7F7FFF, 0xff7F9F00, 0xff7F9F55, 0xff7F9FAA, 0xff7F9FFF,
+ 0xff7FBF00, 0xff7FBF55, 0xff7FBFAA, 0xff7FBFFF, 0xff7FDF00, 0xff7FDF55,
+ 0xff7FDFAA, 0xff7FDFFF, 0xff00FF7F, 0xff7FFF55, 0xff7FFFAA, 0xff7FFFFF,
+ 0xffAA0000, 0xffAA0055, 0xffAA00AA, 0xffAA00FF, 0xffAA1F00, 0xffAA1F55,
+ 0xffAA1FAA, 0xffAA1FFF, 0xffAA3F00, 0xffAA3F55, 0xffAA3FAA, 0xffAA3FFF,
+ 0xffAA5F00, 0xffAA5F55, 0xffAA5FAA, 0xffAA5FFF, 0xffAA7F00, 0xffAA7F55,
+ 0xffAA7FAA, 0xffAA7FFF, 0xffAA9F00, 0xffAA9F55, 0xffAA9FAA, 0xffAA9FFF,
+ 0xffAABF00, 0xffAABF55, 0xffAABFAA, 0xffAABFFF, 0xffAADF00, 0xffAADF55,
+ 0xffAADFAA, 0xffAADFFF, 0xffAAFF00, 0xffAAFF55, 0xffAAFFAA, 0xffAAFFFF,
+ 0xffD40000, 0xffD40055, 0xffD400AA, 0xffD400FF, 0xffD41F00, 0xffD41F55,
+ 0xffD41FAA, 0xffD41FFF, 0xffD43F00, 0xffD43F55, 0xffD43FAA, 0xffD43FFF,
+ 0xffD45F00, 0xffD45F55, 0xffD45FAA, 0xffD45FFF, 0xffD47F00, 0xffD47F55,
+ 0xffD47FAA, 0xffD4F7FF, 0xffD49F00, 0xffD49F55, 0xffD49FAA, 0xffD49FFF,
+ 0xffD4BF00, 0xffD4BF55, 0xffD4BFAA, 0xffD4BFFF, 0xffD4DF00, 0xffD4DF55,
+ 0xffD4DFAA, 0xffD4DFFF, 0xffD4FF00, 0xffD4FF55, 0xffD4FFAA, 0xffD4FFFF,
+ 0xffFF0055, 0xffFF00AA, 0xffFF1F00, 0xffFF1F55, 0xffFF1FAA, 0xffFF1FFF,
+ 0xffFF3F00, 0xffFF3F55, 0xffFF3FAA, 0xffFF3FFF, 0xffFF5F00, 0xffFF5F55,
+ 0xffFF5FAA, 0xffFF5FFF, 0xffFF7F00, 0xffFF7F55, 0xffFF7FAA, 0xffFF7FFF,
+ 0xffFF9F00, 0xffFF9F55, 0xffFF9FAA, 0xffFF9FFF, 0xffFFBF00, 0xffFFBF55,
+ 0xffFFBFAA, 0xffFFBFFF, 0xffFFDF00, 0xffFFDF55, 0xffFFDFAA, 0xffFFDFFF,
+ 0xffFFFF55, 0xffFFFFAA, 0xffCCCCFF, 0xffFFCCFF, 0xff33FFFF, 0xff66FFFF,
+ 0xff99FFFF, 0xffCCFFFF, 0xff007F00, 0xff007F55, 0xff007FAA, 0xff007FFF,
+ 0xff009F00, 0xff009F55, 0xff009FAA, 0xff009FFF, 0xff00BF00, 0xff00BF55,
+ 0xff00BFAA, 0xff00BFFF, 0xff00DF00, 0xff00DF55, 0xff00DFAA, 0xff00DFFF,
+ 0xff00FF55, 0xff00FFAA, 0xff2A0000, 0xff2A0055, 0xff2A00AA, 0xff2A00FF,
+ 0xff2A1F00, 0xff2A1F55, 0xff2A1FAA, 0xff2A1FFF, 0xff2A3F00, 0xff2A3F55,
+ 0xffFFFBF0, 0xffA0A0A4, 0xff808080, 0xffFF0000, 0xff00FF00, 0xffFF0000,
+ 0xff0000FF, 0xffFF00FF, 0xff00FFFF, 0xffFFFFFF
+};
+const FX_DWORD g_dwMacPalette[256] = {
+ 0xffFFFFFF, 0xffFFFFCC, 0xffFFFF99, 0xffFFFF66, 0xffFFFF33, 0xffFFFF00,
+ 0xffFFCCFF, 0xffFFCCCC, 0xffFFCC99, 0xffFFCC66, 0xffFFCC33, 0xffFFCC00,
+ 0xffFF99FF, 0xffFF99CC, 0xffFF9999, 0xffFF9966, 0xffFF9933, 0xffFF9900,
+ 0xffFF66FF, 0xffFF66CC, 0xffFF6699, 0xffFF6666, 0xffFF6633, 0xffFF6600,
+ 0xffFF33FF, 0xffFF33CC, 0xffFF3399, 0xffFF3366, 0xffFF3333, 0xffFF3300,
+ 0xffFF00FF, 0xffFF00CC, 0xffFF0099, 0xffFF0066, 0xffFF0033, 0xffFF0000,
+ 0xffCCFFFF, 0xffCCFFCC, 0xffCCFF99, 0xffCCFF66, 0xffCCFF33, 0xffCCFF00,
+ 0xffCCCCFF, 0xffCCCCCC, 0xffCCCC99, 0xffCCCC66, 0xffCCCC33, 0xffCCCC00,
+ 0xffCC99FF, 0xffCC99CC, 0xffCC9999, 0xffCC9966, 0xffCC9933, 0xffCC9900,
+ 0xffCC66FF, 0xffCC66CC, 0xffCC6699, 0xffCC6666, 0xffCC6633, 0xffCC6600,
+ 0xffCC33FF, 0xffCC33CC, 0xffCC3399, 0xffCC3366, 0xffCC3333, 0xffCC3300,
+ 0xffCC00FF, 0xffCC00CC, 0xffCC0099, 0xffCC0066, 0xffCC0033, 0xffCC0000,
+ 0xff99FFFF, 0xff99FFCC, 0xff99FF99, 0xff99FF66, 0xff99FF33, 0xff99FF00,
+ 0xff99CCFF, 0xff99CCCC, 0xff99CC99, 0xff99CC66, 0xff99CC33, 0xff99CC00,
+ 0xff9999FF, 0xff9999CC, 0xff999999, 0xff999966, 0xff999933, 0xff999900,
+ 0xff9966FF, 0xff9966CC, 0xff996699, 0xff996666, 0xff996633, 0xff996600,
+ 0xff9933FF, 0xff9933CC, 0xff993399, 0xff993366, 0xff993333, 0xff993300,
+ 0xff9900FF, 0xff9900CC, 0xff990099, 0xff990066, 0xff990033, 0xff990000,
+ 0xff66FFFF, 0xff66FFCC, 0xff66FF99, 0xff66FF66, 0xff66FF33, 0xff66FF00,
+ 0xff66CCFF, 0xff66CCCC, 0xff66CC99, 0xff66CC66, 0xff66CC33, 0xff66CC00,
+ 0xff6699FF, 0xff6699CC, 0xff669999, 0xff669966, 0xff669933, 0xff669900,
+ 0xff6666FF, 0xff6666CC, 0xff666699, 0xff666666, 0xff666633, 0xff666600,
+ 0xff6633FF, 0xff6633CC, 0xff663399, 0xff663366, 0xff663333, 0xff663300,
+ 0xff6600FF, 0xff6600CC, 0xff660099, 0xff660066, 0xff660033, 0xff660000,
+ 0xff33FFFF, 0xff33FFCC, 0xff33FF99, 0xff33FF66, 0xff33FF33, 0xff33FF00,
+ 0xff33CCFF, 0xff33CCCC, 0xff33CC99, 0xff33CC66, 0xff33CC33, 0xff33CC00,
+ 0xff3399FF, 0xff3399CC, 0xff339999, 0xff339966, 0xff339933, 0xff339900,
+ 0xff3366FF, 0xff3366CC, 0xff336699, 0xff336666, 0xff336633, 0xff336600,
+ 0xff3333FF, 0xff3333CC, 0xff333399, 0xff333366, 0xff333333, 0xff333300,
+ 0xff3300FF, 0xff3300CC, 0xff330099, 0xff330066, 0xff330033, 0xff330000,
+ 0xff00FFFF, 0xff00FFCC, 0xff00FF99, 0xff00FF66, 0xff00FF33, 0xff00FF00,
+ 0xff00CCFF, 0xff00CCCC, 0xff00CC99, 0xff00CC66, 0xff00CC33, 0xff00CC00,
+ 0xff0099FF, 0xff0099CC, 0xff009999, 0xff009966, 0xff009933, 0xff009900,
+ 0xff0066FF, 0xff0066CC, 0xff006699, 0xff006666, 0xff006633, 0xff006600,
+ 0xff0033FF, 0xff0033CC, 0xff003399, 0xff003366, 0xff003333, 0xff003300,
+ 0xff0000FF, 0xff0000CC, 0xff000099, 0xff000066, 0xff000033,
+ 0xffEE0000, 0xffDD0000, 0xffBB0000, 0xffAA0000, 0xff880000, 0xff770000,
+ 0xff550000, 0xff440000, 0xff220000, 0xff110000, 0xff00EE00, 0xff00DD00,
+ 0xff00BB00, 0xff00AA00, 0xff008800, 0xff007700, 0xff005500, 0xff004400,
+ 0xff002200, 0xff001100, 0xff0000EE, 0xff0000DD, 0xff0000BB, 0xff0000AA,
+ 0xff000088, 0xff000077, 0xff000055, 0xff000044, 0xff000022, 0xff000011,
+ 0xffEEEEEE, 0xffDDDDDD, 0xffBBBBBB, 0xffAAAAAA, 0xff888888, 0xff777777,
+ 0xff555555, 0xff444444, 0xff222222, 0xff111111, 0xff000000
+};
+class CFX_Palette : public CFX_Object
+{
+public:
+ CFX_Palette();
+ ~CFX_Palette();
+public:
+ FX_BOOL BuildPalette(const CFX_DIBSource* pBitmap, int dwPaletteType);
+ FX_DWORD* GetPalette() const
+ {
+ return m_pPalette;
+ }
+
+ FX_DWORD* GetColorLut()const
+ {
+ return m_cLut;
+ }
+ FX_DWORD* GetAmountLut()const
+ {
+ return m_aLut;
+ }
+ FX_INT32 Getlut()const
+ {
+ return m_lut;
+ }
+protected:
+ FX_DWORD* m_pPalette;
+ FX_DWORD* m_cLut;
+ FX_DWORD* m_aLut;
+ int m_lut;
+};
+int _Partition(FX_DWORD* alut, FX_DWORD* clut, int l, int r)
+{
+ FX_DWORD p_a = alut[l];
+ FX_DWORD p_c = clut[l];
+ while(l < r) {
+ while(l < r && alut[r] >= p_a) {
+ r--;
+ }
+ if (l < r) {
+ alut[l] = alut[r];
+ clut[l++] = clut[r];
+ }
+ while(l < r && alut[l] <= p_a) {
+ l++;
+ }
+ if (l < r) {
+ alut[r] = alut[l];
+ clut[r--] = clut[l];
+ }
+ }
+ alut[l] = p_a;
+ clut[l] = p_c;
+ return l;
+}
+void _Qsort(FX_DWORD* alut, FX_DWORD* clut, int l, int r)
+{
+ if(l < r) {
+ int pI = _Partition(alut, clut, l, r);
+ _Qsort(alut, clut, l, pI - 1);
+ _Qsort(alut, clut, pI + 1, r);
+ }
+}
+void _ColorDecode(FX_DWORD pal_v, FX_BYTE& r, FX_BYTE& g, FX_BYTE& b)
+{
+ r = (FX_BYTE)((pal_v & 0xf00) >> 4);
+ g = (FX_BYTE)(pal_v & 0x0f0);
+ b = (FX_BYTE)((pal_v & 0x00f) << 4);
+}
+void _Obtain_Pal(FX_DWORD* aLut, FX_DWORD*cLut, FX_DWORD* dest_pal, int pal_type, FX_DWORD* win_mac_pal, FX_DWORD lut)
+{
+ int row, col;
+ FX_DWORD lut_1 = lut - 1;
+ if (pal_type == FXDIB_PALETTE_LOC) {
+ for (row = 0; row < 256; row++) {
+ int lut_offset = lut_1 - row;
+ if (lut_offset < 0) {
+ lut_offset += 256;
+ }
+ FX_DWORD color = cLut[lut_offset];
+ FX_BYTE r, g, b;
+ _ColorDecode(color, r, g, b);
+ dest_pal[row] = ((FX_DWORD)r << 16) | ((FX_DWORD)g << 8) | b | 0xff000000;
+ aLut[lut_offset] = row;
+ }
+ } else {
+ for (row = 0; row < 256; row++) {
+ int lut_offset = lut_1 - row;
+ if (lut_offset < 0) {
+ lut_offset += 256;
+ }
+ FX_BYTE r, g, b;
+ _ColorDecode(cLut[lut_offset], r, g, b);
+ int error, min_error = 1000000;
+ int c_index = 0;
+ for (col = 0; col < 256; col++) {
+ FX_DWORD p_color = win_mac_pal[col];
+ int d_r = r - (FX_BYTE)(p_color >> 16);
+ int d_g = g - (FX_BYTE)(p_color >> 8);
+ int d_b = b - (FX_BYTE)p_color;
+ error = d_r * d_r + d_g * d_g + d_b * d_b;
+ if (error < min_error) {
+ min_error = error;
+ c_index = col;
+ }
+ }
+ dest_pal[row] = win_mac_pal[c_index];
+ aLut[lut_offset] = row;
+ }
+ }
+}
+CFX_Palette::CFX_Palette()
+{
+ m_pPalette = NULL;
+ m_cLut = NULL;
+ m_aLut = NULL;
+ m_lut = 0;
+}
+CFX_Palette::~CFX_Palette()
+{
+ if (m_pPalette) {
+ FX_Free(m_pPalette);
+ }
+ if (m_cLut) {
+ FX_Free(m_cLut);
+ }
+ if (m_aLut) {
+ FX_Free(m_aLut);
+ }
+ m_lut = 0;
+}
+FX_BOOL CFX_Palette::BuildPalette(const CFX_DIBSource* pBitmap, int pal_type)
+{
+ if (pBitmap == NULL) {
+ return FALSE;
+ }
+ if (m_pPalette != NULL) {
+ FX_Free(m_pPalette);
+ }
+ m_pPalette = FX_Alloc(FX_DWORD, 256);
+ if (!m_pPalette) {
+ return FALSE;
+ }
+ FXSYS_memset32(m_pPalette, 0, sizeof(FX_DWORD) * 256);
+ int bpp = pBitmap->GetBPP() / 8;
+ int width = pBitmap->GetWidth();
+ int height = pBitmap->GetHeight();
+ if (m_cLut) {
+ FX_Free(m_cLut);
+ m_cLut = NULL;
+ }
+ if (m_aLut) {
+ FX_Free(m_aLut);
+ m_aLut = NULL;
+ }
+ m_cLut = FX_Alloc(FX_DWORD, 4096);
+ if (!m_cLut) {
+ return FALSE;
+ }
+ m_aLut = FX_Alloc(FX_DWORD, 4096);
+ if (!m_aLut) {
+ return FALSE;
+ }
+ FXSYS_memset32(m_aLut, 0, sizeof(FX_DWORD) * 4096);
+ FXSYS_memset32(m_cLut, 0, sizeof(FX_DWORD) * 4096);
+ int row, col;
+ m_lut = 0;
+ for (row = 0; row < height; row++) {
+ FX_BYTE* scan_line = (FX_BYTE*)pBitmap->GetScanline(row);
+ for (col = 0; col < width; col++) {
+ FX_BYTE* src_port = scan_line + col * bpp;
+ FX_DWORD b = src_port[0] & 0xf0;
+ FX_DWORD g = src_port[1] & 0xf0;
+ FX_DWORD r = src_port[2] & 0xf0;
+ FX_DWORD index = (r << 4) + g + (b >> 4);
+ m_aLut[index]++;
+ }
+ }
+ for (row = 0; row < 4096; row++) {
+ if (m_aLut[row] != 0) {
+ m_aLut[m_lut] = m_aLut[row];
+ m_cLut[m_lut] = row;
+ m_lut++;
+ }
+ }
+ _Qsort(m_aLut, m_cLut, 0, m_lut - 1);
+ FX_DWORD* win_mac_pal = NULL;
+ if (pal_type == FXDIB_PALETTE_WIN) {
+ win_mac_pal = (FX_DWORD*)g_dwWinPalette;
+ } else if (pal_type == FXDIB_PALETTE_MAC) {
+ win_mac_pal = (FX_DWORD*)g_dwMacPalette;
+ }
+ _Obtain_Pal(m_aLut, m_cLut, m_pPalette, pal_type, win_mac_pal, m_lut);
+ return TRUE;
+}
+FX_BOOL _ConvertBuffer_1bppMask2Gray(FX_LPBYTE dest_buf, int dest_pitch, int width, int height,
+ const CFX_DIBSource* pSrcBitmap, int src_left, int src_top)
+{
+ FX_BYTE set_gray, reset_gray;
+ set_gray = 0xff;
+ reset_gray = 0x00;
+ for (int row = 0; row < height; row ++) {
+ FX_LPBYTE dest_scan = dest_buf + row * dest_pitch;
+ FXSYS_memset8(dest_scan, reset_gray, width);
+ FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row);
+ for (int col = src_left; col < src_left + width; col ++) {
+ if (src_scan[col / 8] & (1 << (7 - col % 8))) {
+ *dest_scan = set_gray;
+ }
+ dest_scan ++;
+ }
+ }
+ return TRUE;
+}
+FX_BOOL _ConvertBuffer_8bppMask2Gray(FX_LPBYTE dest_buf, int dest_pitch, int width, int height,
+ const CFX_DIBSource* pSrcBitmap, int src_left, int src_top)
+{
+ for (int row = 0; row < height; row ++) {
+ FX_LPBYTE dest_scan = dest_buf + row * dest_pitch;
+ FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left;
+ FXSYS_memcpy32(dest_scan, src_scan, width);
+ }
+ return TRUE;
+}
+FX_BOOL _ConvertBuffer_1bppPlt2Gray(FX_LPBYTE dest_buf, int dest_pitch, int width, int height,
+ const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform)
+{
+ FX_DWORD* src_plt = pSrcBitmap->GetPalette();
+ FX_BYTE gray[2];
+ if (pIccTransform) {
+ FX_DWORD plt[2];
+ if (pSrcBitmap->IsCmykImage()) {
+ plt[0] = FXCMYK_TODIB(src_plt[0]);
+ plt[1] = FXCMYK_TODIB(src_plt[1]);
+ } else {
+ FX_LPBYTE bgr_ptr = (FX_LPBYTE)plt;
+ bgr_ptr[0] = FXARGB_B(src_plt[0]);
+ bgr_ptr[1] = FXARGB_G(src_plt[0]);
+ bgr_ptr[2] = FXARGB_R(src_plt[0]);
+ bgr_ptr[3] = FXARGB_B(src_plt[1]);
+ bgr_ptr[4] = FXARGB_G(src_plt[1]);
+ bgr_ptr[5] = FXARGB_R(src_plt[1]);
+ }
+ ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
+ pIccModule->TranslateScanline(pIccTransform, gray, (FX_LPCBYTE)plt, 2);
+ } else {
+ FX_BYTE reset_r, reset_g, reset_b,
+ set_r, set_g, set_b;
+ if (pSrcBitmap->IsCmykImage()) {
+ AdobeCMYK_to_sRGB1(FXSYS_GetCValue(src_plt[0]), FXSYS_GetMValue(src_plt[0]), FXSYS_GetYValue(src_plt[0]), FXSYS_GetKValue(src_plt[0]),
+ reset_r, reset_g, reset_b);
+ AdobeCMYK_to_sRGB1(FXSYS_GetCValue(src_plt[1]), FXSYS_GetMValue(src_plt[1]), FXSYS_GetYValue(src_plt[1]), FXSYS_GetKValue(src_plt[1]),
+ set_r, set_g, set_b);
+ } else {
+ reset_r = FXARGB_R(src_plt[0]);
+ reset_g = FXARGB_G(src_plt[0]);
+ reset_b = FXARGB_B(src_plt[0]);
+ set_r = FXARGB_R(src_plt[1]);
+ set_g = FXARGB_G(src_plt[1]);
+ set_b = FXARGB_B(src_plt[1]);
+ }
+ gray[0] = FXRGB2GRAY(reset_r, reset_g, reset_b);
+ gray[1] = FXRGB2GRAY(set_r, set_g, set_b);
+ }
+ for (int row = 0; row < height; row ++) {
+ FX_LPBYTE dest_scan = dest_buf + row * dest_pitch;
+ FXSYS_memset8(dest_scan, gray[0], width);
+ FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row);
+ for (int col = src_left; col < src_left + width; col ++) {
+ if (src_scan[col / 8] & (1 << (7 - col % 8))) {
+ *dest_scan = gray[1];
+ }
+ dest_scan ++;
+ }
+ }
+ return TRUE;
+}
+FX_BOOL _ConvertBuffer_8bppPlt2Gray(FX_LPBYTE dest_buf, int dest_pitch, int width, int height,
+ const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform)
+{
+ FX_DWORD* src_plt = pSrcBitmap->GetPalette();
+ FX_BYTE gray[256];
+ if (pIccTransform) {
+ FX_DWORD plt[256];
+ if (pSrcBitmap->IsCmykImage()) {
+ for (int i = 0; i < 256; i ++) {
+ plt[i] = FXCMYK_TODIB(src_plt[i]);
+ }
+ } else {
+ FX_LPBYTE bgr_ptr = (FX_LPBYTE)plt;
+ for (int i = 0; i < 256; i ++) {
+ *bgr_ptr++ = FXARGB_B(src_plt[i]);
+ *bgr_ptr++ = FXARGB_G(src_plt[i]);
+ *bgr_ptr++ = FXARGB_R(src_plt[i]);
+ }
+ }
+ ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
+ pIccModule->TranslateScanline(pIccTransform, gray, (FX_LPCBYTE)plt, 256);
+ } else {
+ if (pSrcBitmap->IsCmykImage()) {
+ FX_BYTE r, g, b;
+ for (int i = 0; i < 256; i ++) {
+ AdobeCMYK_to_sRGB1(FXSYS_GetCValue(src_plt[i]), FXSYS_GetMValue(src_plt[i]), FXSYS_GetYValue(src_plt[i]), FXSYS_GetKValue(src_plt[i]),
+ r, g, b);
+ gray[i] = FXRGB2GRAY(r, g, b);
+ }
+ } else
+ for (int i = 0; i < 256; i ++) {
+ gray[i] = FXRGB2GRAY(FXARGB_R(src_plt[i]), FXARGB_G(src_plt[i]), FXARGB_B(src_plt[i]));
+ }
+ }
+ for (int row = 0; row < height; row ++) {
+ FX_LPBYTE dest_scan = dest_buf + row * dest_pitch;
+ FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left;
+ for (int col = 0; col < width; col ++) {
+ *dest_scan++ = gray[*src_scan++];
+ }
+ }
+ return TRUE;
+}
+FX_BOOL _ConvertBuffer_RgbOrCmyk2Gray(FX_LPBYTE dest_buf, int dest_pitch, int width, int height,
+ const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform)
+{
+ int Bpp = pSrcBitmap->GetBPP() / 8;
+ if (pIccTransform) {
+ ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
+ if (Bpp == 3 || pSrcBitmap->IsCmykImage()) {
+ for (int row = 0; row < height; row ++) {
+ FX_LPBYTE dest_scan = dest_buf + row * dest_pitch;
+ FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left * Bpp;
+ pIccModule->TranslateScanline(pIccTransform, dest_scan, src_scan, width);
+ }
+ } else {
+ for (int row = 0; row < height; row ++) {
+ FX_LPBYTE dest_scan = dest_buf + row * dest_pitch;
+ FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left * 4;
+ for (int col = 0; col < width; col ++) {
+ pIccModule->TranslateScanline(pIccTransform, dest_scan, src_scan, 1);
+ dest_scan++;
+ src_scan += 4;
+ }
+ }
+ }
+ } else {
+ if (pSrcBitmap->IsCmykImage()) {
+ for (int row = 0; row < height; row ++) {
+ FX_LPBYTE dest_scan = dest_buf + row * dest_pitch;
+ FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left * 4;
+ for (int col = 0; col < width; col ++) {
+ FX_BYTE r, g, b;
+ AdobeCMYK_to_sRGB1(FXSYS_GetCValue((FX_DWORD)src_scan[0]), FXSYS_GetMValue((FX_DWORD)src_scan[1]), FXSYS_GetYValue((FX_DWORD)src_scan[2]), FXSYS_GetKValue((FX_DWORD)src_scan[3]),
+ r, g, b);
+ *dest_scan++ = FXRGB2GRAY(r, g, b);
+ src_scan += 4;
+ }
+ }
+ } else
+ for (int row = 0; row < height; row ++) {
+ FX_LPBYTE dest_scan = dest_buf + row * dest_pitch;
+ FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left * Bpp;
+ for (int col = 0; col < width; col ++) {
+ *dest_scan++ = FXRGB2GRAY(src_scan[2], src_scan[1], src_scan[0]);
+ src_scan += Bpp;
+ }
+ }
+ }
+ return TRUE;
+}
+inline void _ConvertBuffer_IndexCopy(FX_LPBYTE dest_buf, int dest_pitch, int width, int height,
+ const CFX_DIBSource* pSrcBitmap, int src_left, int src_top)
+{
+ if (pSrcBitmap->GetBPP() == 1) {
+ for (int row = 0; row < height; row ++) {
+ FX_LPBYTE dest_scan = dest_buf + row * dest_pitch;
+ FXSYS_memset32(dest_scan, 0, width);
+ FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row);
+ for (int col = src_left; col < src_left + width; col ++) {
+ if (src_scan[col / 8] & (1 << (7 - col % 8))) {
+ *dest_scan = 1;
+ }
+ dest_scan ++;
+ }
+ }
+ } else {
+ for (int row = 0; row < height; row ++) {
+ FX_LPBYTE dest_scan = dest_buf + row * dest_pitch;
+ FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left;
+ FXSYS_memcpy32(dest_scan, src_scan, width);
+ }
+ }
+}
+FX_BOOL _ConvertBuffer_Plt2PltRgb8(FX_LPBYTE dest_buf, int dest_pitch, int width, int height,
+ const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, FX_DWORD* dst_plt, void* pIccTransform)
+{
+ _ConvertBuffer_IndexCopy(dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top);
+ FX_DWORD* src_plt = pSrcBitmap->GetPalette();
+ int plt_size = pSrcBitmap->GetPaletteSize();
+ if (pIccTransform) {
+ FX_DWORD plt[256];
+ FX_LPBYTE bgr_ptr = (FX_LPBYTE)plt;
+ if (pSrcBitmap->IsCmykImage()) {
+ for (int i = 0; i < plt_size; i ++) {
+ plt[i] = FXCMYK_TODIB(src_plt[i]);
+ }
+ } else {
+ for (int i = 0; i < plt_size; i ++) {
+ *bgr_ptr++ = FXARGB_B(src_plt[i]);
+ *bgr_ptr++ = FXARGB_G(src_plt[i]);
+ *bgr_ptr++ = FXARGB_R(src_plt[i]);
+ }
+ bgr_ptr = (FX_LPBYTE)plt;
+ }
+ ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
+ pIccModule->TranslateScanline(pIccTransform, (FX_LPBYTE)plt, (FX_LPCBYTE)plt, plt_size);
+ for (int i = 0; i < plt_size; i ++) {
+ dst_plt[i] = FXARGB_MAKE(0xff, bgr_ptr[2], bgr_ptr[1], bgr_ptr[0]);
+ bgr_ptr += 3;
+ }
+ } else {
+ if (pSrcBitmap->IsCmykImage()) {
+ for (int i = 0; i < plt_size; i ++) {
+ FX_BYTE r, g, b;
+ AdobeCMYK_to_sRGB1(FXSYS_GetCValue(src_plt[i]), FXSYS_GetMValue(src_plt[i]), FXSYS_GetYValue(src_plt[i]), FXSYS_GetKValue(src_plt[i]),
+ r, g, b);
+ dst_plt[i] = FXARGB_MAKE(0xff, r, g, b);
+ }
+ } else {
+ FXSYS_memcpy32(dst_plt, src_plt, plt_size * 4);
+ }
+ }
+ return TRUE;
+}
+inline FX_BOOL _ConvertBuffer_Rgb2PltRgb8_NoTransform(FX_LPBYTE dest_buf, int dest_pitch, int width, int height,
+ const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, FX_DWORD* dst_plt)
+{
+ int bpp = pSrcBitmap->GetBPP() / 8;
+ int row, col;
+ CFX_Palette palette;
+ palette.BuildPalette(pSrcBitmap, FXDIB_PALETTE_LOC);
+ FX_DWORD* cLut = palette.GetColorLut();
+ FX_DWORD* aLut = palette.GetAmountLut();
+ if (cLut == NULL || aLut == NULL) {
+ return FALSE;
+ }
+ int lut = palette.Getlut();
+ FX_DWORD* pPalette = palette.GetPalette();
+ if (lut > 256) {
+ int err, min_err;
+ int lut_256 = lut - 256;
+ for (row = 0; row < lut_256; row++) {
+ min_err = 1000000;
+ FX_BYTE r, g, b;
+ _ColorDecode(cLut[row], r, g, b);
+ int clrindex = 0;
+ for (int col = 0; col < 256; col++) {
+ FX_DWORD p_color = *(pPalette + col);
+ int d_r = r - (FX_BYTE)(p_color >> 16);
+ int d_g = g - (FX_BYTE)(p_color >> 8);
+ int d_b = b - (FX_BYTE)(p_color);
+ err = d_r * d_r + d_g * d_g + d_b * d_b;
+ if (err < min_err) {
+ min_err = err;
+ clrindex = col;
+ }
+ }
+ aLut[row] = clrindex;
+ }
+ }
+ FX_INT32 lut_1 = lut - 1;
+ for (row = 0; row < height; row ++) {
+ FX_BYTE* src_scan = (FX_BYTE*)pSrcBitmap->GetScanline(src_top + row) + src_left;
+ FX_BYTE* dest_scan = dest_buf + row * dest_pitch;
+ for (col = 0; col < width; col++) {
+ FX_BYTE* src_port = src_scan + col * bpp;
+ int r = src_port[2] & 0xf0;
+ int g = src_port[1] & 0xf0;
+ int b = src_port[0] & 0xf0;
+ FX_DWORD clrindex = (r << 4) + g + (b >> 4);
+ for (int i = lut_1; i >= 0; i--)
+ if (clrindex == cLut[i]) {
+ *(dest_scan + col) = (FX_BYTE)(aLut[i]);
+ break;
+ }
+ }
+ }
+ FXSYS_memcpy32(dst_plt, pPalette, sizeof(FX_DWORD) * 256);
+ return TRUE;
+}
+FX_BOOL _ConvertBuffer_Rgb2PltRgb8(FX_LPBYTE dest_buf, int dest_pitch, int width, int height,
+ const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, FX_DWORD* dst_plt, void* pIccTransform)
+{
+ ICodec_IccModule* pIccModule = NULL;
+ if (pIccTransform) {
+ pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
+ }
+ FX_BOOL ret = _ConvertBuffer_Rgb2PltRgb8_NoTransform(dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top, dst_plt);
+ if (ret && pIccTransform) {
+ ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
+ for (int i = 0; i < 256; i++) {
+ FX_ARGB* plt = dst_plt + i;
+ FX_ARGB plt_entry = FXARGB_TODIB(*plt);
+ pIccModule->TranslateScanline(pIccTransform, (FX_LPBYTE)&plt_entry, (FX_LPCBYTE)&plt_entry, 1);
+ *plt = FXARGB_TODIB(plt_entry);
+ }
+ }
+ return ret;
+}
+FX_BOOL _ConvertBuffer_1bppMask2Rgb(FXDIB_Format dst_format, FX_LPBYTE dest_buf, int dest_pitch, int width, int height,
+ const CFX_DIBSource* pSrcBitmap, int src_left, int src_top)
+{
+ int comps = (dst_format & 0xff) / 8;
+ FX_BYTE set_gray, reset_gray;
+ set_gray = 0xff;
+ reset_gray = 0x00;
+ for (int row = 0; row < height; row ++) {
+ FX_LPBYTE dest_scan = dest_buf + row * dest_pitch;
+ FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row);
+ for (int col = src_left; col < src_left + width; col ++) {
+ if (src_scan[col / 8] & (1 << (7 - col % 8))) {
+ dest_scan[0] = set_gray;
+ dest_scan[1] = set_gray;
+ dest_scan[2] = set_gray;
+ } else {
+ dest_scan[0] = reset_gray;
+ dest_scan[1] = reset_gray;
+ dest_scan[2] = reset_gray;
+ }
+ dest_scan += comps;
+ }
+ }
+ return TRUE;
+}
+FX_BOOL _ConvertBuffer_8bppMask2Rgb(FXDIB_Format dst_format, FX_LPBYTE dest_buf, int dest_pitch, int width, int height,
+ const CFX_DIBSource* pSrcBitmap, int src_left, int src_top)
+{
+ int comps = (dst_format & 0xff) / 8;
+ for (int row = 0; row < height; row ++) {
+ FX_LPBYTE dest_scan = dest_buf + row * dest_pitch;
+ FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left;
+ FX_BYTE src_pixel;
+ for (int col = 0; col < width; col ++) {
+ src_pixel = *src_scan++;
+ *dest_scan++ = src_pixel;
+ *dest_scan++ = src_pixel;
+ *dest_scan = src_pixel;
+ dest_scan += comps - 2;
+ }
+ }
+ return TRUE;
+}
+FX_BOOL _ConvertBuffer_1bppPlt2Rgb(FXDIB_Format dst_format, FX_LPBYTE dest_buf, int dest_pitch, int width, int height,
+ const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform)
+{
+ int comps = (dst_format & 0xff) / 8;
+ FX_DWORD* src_plt = pSrcBitmap->GetPalette();
+ FX_DWORD plt[2];
+ FX_LPBYTE bgr_ptr = (FX_LPBYTE)plt;
+ if (pSrcBitmap->IsCmykImage()) {
+ plt[0] = FXCMYK_TODIB(src_plt[0]);
+ plt[1] = FXCMYK_TODIB(src_plt[1]);
+ } else {
+ bgr_ptr[0] = FXARGB_B(src_plt[0]);
+ bgr_ptr[1] = FXARGB_G(src_plt[0]);
+ bgr_ptr[2] = FXARGB_R(src_plt[0]);
+ bgr_ptr[3] = FXARGB_B(src_plt[1]);
+ bgr_ptr[4] = FXARGB_G(src_plt[1]);
+ bgr_ptr[5] = FXARGB_R(src_plt[1]);
+ }
+ if (pIccTransform) {
+ ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
+ pIccModule->TranslateScanline(pIccTransform, (FX_LPBYTE)plt, (FX_LPCBYTE)plt, 2);
+ } else {
+ if (pSrcBitmap->IsCmykImage()) {
+ AdobeCMYK_to_sRGB1(FXSYS_GetCValue(src_plt[0]), FXSYS_GetMValue(src_plt[0]), FXSYS_GetYValue(src_plt[0]), FXSYS_GetKValue(src_plt[0]),
+ bgr_ptr[2], bgr_ptr[1], bgr_ptr[0]);
+ AdobeCMYK_to_sRGB1(FXSYS_GetCValue(src_plt[1]), FXSYS_GetMValue(src_plt[1]), FXSYS_GetYValue(src_plt[1]), FXSYS_GetKValue(src_plt[1]),
+ bgr_ptr[5], bgr_ptr[4], bgr_ptr[3]);
+ }
+ }
+ for (int row = 0; row < height; row ++) {
+ FX_LPBYTE dest_scan = dest_buf + row * dest_pitch;
+ FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row);
+ for (int col = src_left; col < src_left + width; col ++) {
+ if (src_scan[col / 8] & (1 << (7 - col % 8))) {
+ *dest_scan++ = bgr_ptr[3];
+ *dest_scan++ = bgr_ptr[4];
+ *dest_scan = bgr_ptr[5];
+ } else {
+ *dest_scan++ = bgr_ptr[0];
+ *dest_scan++ = bgr_ptr[1];
+ *dest_scan = bgr_ptr[2];
+ }
+ dest_scan += comps - 2;
+ }
+ }
+ return TRUE;
+}
+FX_BOOL _ConvertBuffer_8bppPlt2Rgb(FXDIB_Format dst_format, FX_LPBYTE dest_buf, int dest_pitch, int width, int height,
+ const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform)
+{
+ int comps = (dst_format & 0xff) / 8;
+ FX_DWORD* src_plt = pSrcBitmap->GetPalette();
+ FX_DWORD plt[256];
+ FX_LPBYTE bgr_ptr = (FX_LPBYTE)plt;
+ if (!pSrcBitmap->IsCmykImage()) {
+ for (int i = 0; i < 256; i++) {
+ *bgr_ptr++ = FXARGB_B(src_plt[i]);
+ *bgr_ptr++ = FXARGB_G(src_plt[i]);
+ *bgr_ptr++ = FXARGB_R(src_plt[i]);
+ }
+ bgr_ptr = (FX_LPBYTE)plt;
+ }
+ if (pIccTransform) {
+ if (pSrcBitmap->IsCmykImage()) {
+ for (int i = 0; i < 256; i++) {
+ plt[i] = FXCMYK_TODIB(src_plt[i]);
+ }
+ }
+ ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
+ pIccModule->TranslateScanline(pIccTransform, (FX_LPBYTE)plt, (FX_LPCBYTE)plt, 256);
+ } else {
+ if (pSrcBitmap->IsCmykImage()) {
+ for (int i = 0; i < 256; i++) {
+ AdobeCMYK_to_sRGB1(FXSYS_GetCValue(src_plt[i]), FXSYS_GetMValue(src_plt[i]), FXSYS_GetYValue(src_plt[i]), FXSYS_GetKValue(src_plt[i]),
+ bgr_ptr[2], bgr_ptr[1], bgr_ptr[0]);
+ bgr_ptr += 3;
+ }
+ bgr_ptr = (FX_LPBYTE)plt;
+ }
+ }
+ for (int row = 0; row < height; row ++) {
+ FX_LPBYTE dest_scan = dest_buf + row * dest_pitch;
+ FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left;
+ for (int col = 0; col < width; col ++) {
+ FX_LPBYTE src_pixel = bgr_ptr + 3 * (*src_scan++);
+ *dest_scan++ = *src_pixel++;
+ *dest_scan++ = *src_pixel++;
+ *dest_scan = *src_pixel++;
+ dest_scan += comps - 2;
+ }
+ }
+ return TRUE;
+}
+FX_BOOL _ConvertBuffer_24bppRgb2Rgb24(FX_LPBYTE dest_buf, int dest_pitch, int width, int height,
+ const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform)
+{
+ if (pIccTransform) {
+ ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
+ for (int row = 0; row < height; row ++) {
+ FX_LPBYTE dest_scan = dest_buf + row * dest_pitch;
+ FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left * 3;
+ pIccModule->TranslateScanline(pIccTransform, dest_scan, src_scan, width);
+ }
+ } else {
+ for (int row = 0; row < height; row ++) {
+ FX_LPBYTE dest_scan = dest_buf + row * dest_pitch;
+ FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left * 3;
+ FXSYS_memcpy32(dest_scan, src_scan, width * 3);
+ }
+ }
+ return TRUE;
+}
+FX_BOOL _ConvertBuffer_32bppRgb2Rgb24(FX_LPBYTE dest_buf, int dest_pitch, int width, int height,
+ const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform)
+{
+ for (int row = 0; row < height; row ++) {
+ FX_LPBYTE dest_scan = dest_buf + row * dest_pitch;
+ FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left * 4;
+ for (int col = 0; col < width; col ++) {
+ *dest_scan++ = *src_scan++;
+ *dest_scan++ = *src_scan++;
+ *dest_scan++ = *src_scan++;
+ src_scan++;
+ }
+ }
+ if (pIccTransform) {
+ ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
+ for (int row = 0; row < height; row ++) {
+ FX_LPBYTE dest_scan = dest_buf + row * dest_pitch;
+ pIccModule->TranslateScanline(pIccTransform, dest_scan, dest_scan, width);
+ }
+ }
+ return TRUE;
+}
+FX_BOOL _ConvertBuffer_Rgb2Rgb32(FX_LPBYTE dest_buf, int dest_pitch, int width, int height,
+ const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform)
+{
+ int comps = pSrcBitmap->GetBPP() / 8;
+ if (pIccTransform) {
+ ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
+ for (int row = 0; row < height; row ++) {
+ FX_LPBYTE dest_scan = dest_buf + row * dest_pitch;
+ FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left * comps;
+ for (int col = 0; col < width; col ++) {
+ pIccModule->TranslateScanline(pIccTransform, dest_scan, src_scan, 1);
+ dest_scan += 4;
+ src_scan += comps;
+ }
+ }
+ } else {
+ for (int row = 0; row < height; row ++) {
+ FX_LPBYTE dest_scan = dest_buf + row * dest_pitch;
+ FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left * comps;
+ for (int col = 0; col < width; col ++) {
+ *dest_scan++ = *src_scan++;
+ *dest_scan++ = *src_scan++;
+ *dest_scan++ = *src_scan++;
+ dest_scan++;
+ src_scan += comps - 3;
+ }
+ }
+ }
+ return TRUE;
+}
+FX_BOOL _ConvertBuffer_32bppCmyk2Rgb32(FX_LPBYTE dest_buf, int dest_pitch, int width, int height,
+ const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform)
+{
+ if (pIccTransform) {
+ ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
+ for (int row = 0; row < height; row ++) {
+ FX_LPBYTE dest_scan = dest_buf + row * dest_pitch;
+ FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left * 4;
+ for (int col = 0; col < width; col ++) {
+ pIccModule->TranslateScanline(pIccTransform, dest_scan, src_scan, 1);
+ dest_scan += 4;
+ src_scan += 4;
+ }
+ }
+ } else {
+ for (int row = 0; row < height; row ++) {
+ FX_LPBYTE dest_scan = dest_buf + row * dest_pitch;
+ FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left * 4;
+ for (int col = 0; col < width; col ++) {
+ AdobeCMYK_to_sRGB1(src_scan[0], src_scan[1], src_scan[2], src_scan[3],
+ dest_scan[2], dest_scan[1], dest_scan[0]);
+ dest_scan += 4;
+ src_scan += 4;
+ }
+ }
+ }
+ return TRUE;
+}
+FX_BOOL ConvertBuffer(FXDIB_Format dest_format, FX_LPBYTE dest_buf, int dest_pitch, int width, int height,
+ const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, FX_DWORD*& d_pal, void* pIccTransform)
+{
+ FXDIB_Format src_format = pSrcBitmap->GetFormat();
+ if (!CFX_GEModule::Get()->GetCodecModule() || !CFX_GEModule::Get()->GetCodecModule()->GetIccModule()) {
+ pIccTransform = NULL;
+ }
+ switch (dest_format) {
+ case FXDIB_Invalid:
+ case FXDIB_1bppCmyk:
+ case FXDIB_1bppMask:
+ case FXDIB_1bppRgb:
+ ASSERT(FALSE);
+ return FALSE;
+ case FXDIB_8bppMask: {
+ if ((src_format & 0xff) == 1) {
+ if (pSrcBitmap->GetPalette()) {
+ return _ConvertBuffer_1bppPlt2Gray(dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top, pIccTransform);
+ }
+ return _ConvertBuffer_1bppMask2Gray(dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top);
+ } else if ((src_format & 0xff) == 8) {
+ if (pSrcBitmap->GetPalette()) {
+ return _ConvertBuffer_8bppPlt2Gray(dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top, pIccTransform);
+ }
+ return _ConvertBuffer_8bppMask2Gray(dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top);
+ } else if ((src_format & 0xff) >= 24) {
+ return _ConvertBuffer_RgbOrCmyk2Gray(dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top, pIccTransform);
+ }
+ return FALSE;
+ }
+ case FXDIB_8bppRgb:
+ case FXDIB_8bppRgba: {
+ if ((src_format & 0xff) == 8 && pSrcBitmap->GetPalette() == NULL) {
+ return ConvertBuffer(FXDIB_8bppMask, dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top, d_pal, pIccTransform);
+ }
+ d_pal = FX_Alloc(FX_DWORD, 256);
+ if (!d_pal) {
+ return FALSE;
+ }
+ FXSYS_memset32(d_pal, 0, sizeof(FX_DWORD) * 256);
+ if (((src_format & 0xff) == 1 || (src_format & 0xff) == 8) && pSrcBitmap->GetPalette()) {
+ return _ConvertBuffer_Plt2PltRgb8(dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top, d_pal, pIccTransform);
+ } else if ((src_format & 0xff) >= 24) {
+ return _ConvertBuffer_Rgb2PltRgb8(dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top, d_pal, pIccTransform);
+ }
+ return FALSE;
+ }
+ case FXDIB_Rgb:
+ case FXDIB_Rgba: {
+ if ((src_format & 0xff) == 1) {
+ if (pSrcBitmap->GetPalette()) {
+ return _ConvertBuffer_1bppPlt2Rgb(dest_format, dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top, pIccTransform);
+ }
+ return _ConvertBuffer_1bppMask2Rgb(dest_format, dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top);
+ } else if ((src_format & 0xff) == 8) {
+ if (pSrcBitmap->GetPalette()) {
+ return _ConvertBuffer_8bppPlt2Rgb(dest_format, dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top, pIccTransform);
+ }
+ return _ConvertBuffer_8bppMask2Rgb(dest_format, dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top);
+ } else if ((src_format & 0xff) == 24) {
+ return _ConvertBuffer_24bppRgb2Rgb24(dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top, pIccTransform);
+ } else if ((src_format & 0xff) == 32) {
+ return _ConvertBuffer_32bppRgb2Rgb24(dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top, pIccTransform);
+ }
+ return FALSE;
+ }
+ case FXDIB_Argb:
+ case FXDIB_Rgb32: {
+ if ((src_format & 0xff) == 1) {
+ if (pSrcBitmap->GetPalette()) {
+ return _ConvertBuffer_1bppPlt2Rgb(dest_format, dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top, pIccTransform);
+ }
+ return _ConvertBuffer_1bppMask2Rgb(dest_format, dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top);
+ } else if ((src_format & 0xff) == 8) {
+ if (pSrcBitmap->GetPalette()) {
+ return _ConvertBuffer_8bppPlt2Rgb(dest_format, dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top, pIccTransform);
+ }
+ return _ConvertBuffer_8bppMask2Rgb(dest_format, dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top);
+ } else if ((src_format & 0xff) >= 24) {
+ if (src_format & 0x0400) {
+ return _ConvertBuffer_32bppCmyk2Rgb32(dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top, pIccTransform);
+ }
+ return _ConvertBuffer_Rgb2Rgb32(dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top, pIccTransform);
+ }
+ return FALSE;
+ }
+ default:
+ return FALSE;
+ }
+ return FALSE;
+}
+CFX_DIBitmap* CFX_DIBSource::CloneConvert(FXDIB_Format dest_format, const FX_RECT* pClip, void* pIccTransform) const
+{
+ if(dest_format == GetFormat() && pIccTransform == NULL) {
+ return Clone(pClip);
+ }
+ if (pClip) {
+ CFX_DIBitmap* pClone = Clone(pClip);
+ if (pClone == NULL) {
+ return NULL;
+ }
+ if(!pClone->ConvertFormat(dest_format, pIccTransform)) {
+ delete pClone;
+ return NULL;
+ }
+ return pClone;
+ }
+ CFX_DIBitmap* pClone = FX_NEW CFX_DIBitmap;
+ if (!pClone) {
+ return NULL;
+ }
+ if(!pClone->Create(m_Width, m_Height, dest_format)) {
+ delete pClone;
+ return NULL;
+ }
+ FX_BOOL ret = TRUE;
+ CFX_DIBitmap* pSrcAlpha = NULL;
+ if (m_AlphaFlag & 2) {
+ pSrcAlpha = (GetFormat() == FXDIB_Argb) ? GetAlphaMask() : m_pAlphaMask;
+ if (pSrcAlpha == NULL) {
+ delete pClone;
+ return NULL;
+ }
+ }
+ if (dest_format & 0x0200) {
+ if (dest_format == FXDIB_Argb)
+ ret = pSrcAlpha ?
+ pClone->LoadChannel(FXDIB_Alpha, pSrcAlpha, FXDIB_Alpha) :
+ pClone->LoadChannel(FXDIB_Alpha, 0xff);
+ else {
+ ret = pClone->CopyAlphaMask(pSrcAlpha);
+ }
+ }
+ if (pSrcAlpha && pSrcAlpha != m_pAlphaMask) {
+ delete pSrcAlpha;
+ pSrcAlpha = NULL;
+ }
+ if (!ret) {
+ delete pClone;
+ return NULL;
+ }
+ FX_DWORD* pal_8bpp = NULL;
+ ret = ConvertBuffer(dest_format, pClone->GetBuffer(), pClone->GetPitch(), m_Width, m_Height, this, 0, 0, pal_8bpp, pIccTransform);
+ if (!ret) {
+ if (pal_8bpp) {
+ FX_Free(pal_8bpp);
+ }
+ delete pClone;
+ return NULL;
+ }
+ if (pal_8bpp) {
+ pClone->CopyPalette(pal_8bpp);
+ FX_Free(pal_8bpp);
+ pal_8bpp = NULL;
+ }
+ return pClone;
+}
+FX_BOOL CFX_DIBitmap::ConvertFormat(FXDIB_Format dest_format, void* pIccTransform)
+{
+ FXDIB_Format src_format = GetFormat();
+ if (dest_format == src_format && pIccTransform == NULL) {
+ return TRUE;
+ }
+ if (dest_format == FXDIB_8bppMask && src_format == FXDIB_8bppRgb && m_pPalette == NULL) {
+ m_AlphaFlag = 1;
+ return TRUE;
+ }
+ if (dest_format == FXDIB_Argb && src_format == FXDIB_Rgb32 && pIccTransform == NULL) {
+ m_AlphaFlag = 2;
+ for (int row = 0; row < m_Height; row ++) {
+ FX_LPBYTE scanline = m_pBuffer + row * m_Pitch + 3;
+ for (int col = 0; col < m_Width; col ++) {
+ *scanline = 0xff;
+ scanline += 4;
+ }
+ }
+ return TRUE;
+ }
+ int dest_bpp = dest_format & 0xff;
+ int dest_pitch = (dest_bpp * m_Width + 31) / 32 * 4;
+ FX_LPBYTE dest_buf = FX_AllocNL(FX_BYTE, dest_pitch * m_Height + 4);
+ if (dest_buf == NULL) {
+ return FALSE;
+ }
+ CFX_DIBitmap* pAlphaMask = NULL;
+ if (dest_format == FXDIB_Argb) {
+ FXSYS_memset8(dest_buf, 0xff, dest_pitch * m_Height + 4);
+ if (m_pAlphaMask) {
+ for (int row = 0; row < m_Height; row ++) {
+ FX_LPBYTE pDstScanline = dest_buf + row * dest_pitch + 3;
+ FX_LPCBYTE pSrcScanline = m_pAlphaMask->GetScanline(row);
+ for (int col = 0; col < m_Width; col ++) {
+ *pDstScanline = *pSrcScanline++;
+ pDstScanline += 4;
+ }
+ }
+ }
+ } else if (dest_format & 0x0200) {
+ if (src_format == FXDIB_Argb) {
+ pAlphaMask = GetAlphaMask();
+ if (pAlphaMask == NULL) {
+ FX_Free(dest_buf);
+ return FALSE;
+ }
+ } else {
+ if (m_pAlphaMask == NULL) {
+ if (!BuildAlphaMask()) {
+ FX_Free(dest_buf);
+ return FALSE;
+ }
+ pAlphaMask = m_pAlphaMask;
+ m_pAlphaMask = NULL;
+ } else {
+ pAlphaMask = m_pAlphaMask;
+ }
+ }
+ }
+ FX_BOOL ret = FALSE;
+ FX_DWORD* pal_8bpp = NULL;
+ ret = ConvertBuffer(dest_format, dest_buf, dest_pitch, m_Width, m_Height, this, 0, 0, pal_8bpp, pIccTransform);
+ if (!ret) {
+ if (pal_8bpp) {
+ FX_Free(pal_8bpp);
+ }
+ if (pAlphaMask != m_pAlphaMask) {
+ delete pAlphaMask;
+ }
+ if (dest_buf) {
+ FX_Free(dest_buf);
+ }
+ return FALSE;
+ }
+ if (m_pAlphaMask && pAlphaMask != m_pAlphaMask) {
+ delete m_pAlphaMask;
+ }
+ m_pAlphaMask = pAlphaMask;
+ if (m_pPalette) {
+ FX_Free(m_pPalette);
+ }
+ m_pPalette = pal_8bpp;
+ if (!m_bExtBuf) {
+ FX_Free(m_pBuffer);
+ }
+ m_bExtBuf = FALSE;
+ m_pBuffer = dest_buf;
+ m_bpp = (FX_BYTE)dest_format;
+ m_AlphaFlag = (FX_BYTE)(dest_format >> 8);
+ m_Pitch = dest_pitch;
+ return TRUE;
+}
diff --git a/core/src/fxge/dib/fx_dib_engine.cpp b/core/src/fxge/dib/fx_dib_engine.cpp
index 3ddbff6409..a51038628e 100644
--- a/core/src/fxge/dib/fx_dib_engine.cpp
+++ b/core/src/fxge/dib/fx_dib_engine.cpp
@@ -1,867 +1,867 @@
-// 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
-
-#include "../../../include/fxge/fx_dib.h"
-#include "../../../include/fxge/fx_ge.h"
-#include "dib_int.h"
-#include <limits.h>
-extern int SDP_Table[513];
-void CWeightTable::Calc(int dest_len, int dest_min, int dest_max, int src_len, int src_min, int src_max, int flags)
-{
- if (m_pWeightTables) {
- FX_Free(m_pWeightTables);
- m_pWeightTables = NULL;
- }
- double scale, base;
- scale = FXSYS_Div((FX_FLOAT)(src_len), (FX_FLOAT)(dest_len));
- if (dest_len < 0) {
- base = (FX_FLOAT)(src_len);
- } else {
- base = 0;
- }
- int ext_size = flags & FXDIB_BICUBIC_INTERPOL ? 3 : 1;
- m_ItemSize = sizeof(int) * 2 + (int)(sizeof(int) * (FXSYS_ceil(FXSYS_fabs((FX_FLOAT)scale)) + ext_size));
- m_DestMin = dest_min;
- if ((dest_max - dest_min) > (int)((1U << 30) - 4) / m_ItemSize) {
- return;
- }
- m_pWeightTables = FX_AllocNL(FX_BYTE, (dest_max - dest_min) * m_ItemSize + 4);
- if (m_pWeightTables == NULL) {
- return;
- }
- FXSYS_memset32(m_pWeightTables, 0, sizeof(FX_BYTE) * ((dest_max - dest_min)*m_ItemSize + 4));
- if ((flags & FXDIB_NOSMOOTH) != 0 || FXSYS_fabs((FX_FLOAT)scale) < 1.0f) {
- for (int dest_pixel = dest_min; dest_pixel < dest_max; dest_pixel ++) {
- PixelWeight& pixel_weights = *GetPixelWeight(dest_pixel);
- double src_pos = dest_pixel * scale + scale / 2 + base;
- if (flags & FXDIB_INTERPOL) {
- pixel_weights.m_SrcStart = (int)FXSYS_floor((FX_FLOAT)src_pos - 1.0f / 2);
- pixel_weights.m_SrcEnd = (int)FXSYS_floor((FX_FLOAT)src_pos + 1.0f / 2);
- if (pixel_weights.m_SrcStart < src_min) {
- pixel_weights.m_SrcStart = src_min;
- }
- if (pixel_weights.m_SrcEnd >= src_max) {
- pixel_weights.m_SrcEnd = src_max - 1;
- }
- if (pixel_weights.m_SrcStart == pixel_weights.m_SrcEnd) {
- pixel_weights.m_Weights[0] = 65536;
- } else {
- pixel_weights.m_Weights[1] = FXSYS_round((FX_FLOAT)(src_pos - pixel_weights.m_SrcStart - 1.0f / 2) * 65536);
- pixel_weights.m_Weights[0] = 65536 - pixel_weights.m_Weights[1];
- }
- } else if (flags & FXDIB_BICUBIC_INTERPOL) {
- pixel_weights.m_SrcStart = (int)FXSYS_floor((FX_FLOAT)src_pos - 1.0f / 2);
- pixel_weights.m_SrcEnd = (int)FXSYS_floor((FX_FLOAT)src_pos + 1.0f / 2);
- int start = pixel_weights.m_SrcStart - 1;
- int end = pixel_weights.m_SrcEnd + 1;
- if (start < src_min) {
- start = src_min;
- }
- if (end >= src_max) {
- end = src_max - 1;
- }
- if (pixel_weights.m_SrcStart < src_min) {
- src_pos += src_min - pixel_weights.m_SrcStart;
- pixel_weights.m_SrcStart = src_min;
- }
- if (pixel_weights.m_SrcEnd >= src_max) {
- pixel_weights.m_SrcEnd = src_max - 1;
- }
- int weight;
- weight = FXSYS_round((FX_FLOAT)(src_pos - pixel_weights.m_SrcStart - 1.0f / 2) * 256);
- if (start == end) {
- pixel_weights.m_Weights[0] = (SDP_Table[256 + weight] + SDP_Table[weight] + SDP_Table[256 - weight] + SDP_Table[512 - weight]) << 8;
- } else if ((start == pixel_weights.m_SrcStart && (pixel_weights.m_SrcStart == pixel_weights.m_SrcEnd ||
- end == pixel_weights.m_SrcEnd) && start < end) || (start < pixel_weights.m_SrcStart && pixel_weights.m_SrcStart == pixel_weights.m_SrcEnd && end == pixel_weights.m_SrcEnd)) {
- if (start < pixel_weights.m_SrcStart) {
- pixel_weights.m_Weights[0] = SDP_Table[256 + weight] << 8;
- pixel_weights.m_Weights[1] = (SDP_Table[weight] + SDP_Table[256 - weight] + SDP_Table[512 - weight]) << 8;
- } else {
- if (pixel_weights.m_SrcStart == pixel_weights.m_SrcEnd) {
- pixel_weights.m_Weights[0] = (SDP_Table[256 + weight] + SDP_Table[weight] + SDP_Table[256 - weight]) << 8;
- pixel_weights.m_Weights[1] = SDP_Table[512 - weight] << 8;
- } else {
- pixel_weights.m_Weights[0] = (SDP_Table[256 + weight] + SDP_Table[weight]) << 8;
- pixel_weights.m_Weights[1] = (SDP_Table[256 - weight] + SDP_Table[512 - weight]) << 8;
- }
- }
- if (pixel_weights.m_SrcStart == pixel_weights.m_SrcEnd) {
- pixel_weights.m_SrcEnd = end;
- }
- if (start < pixel_weights.m_SrcStart) {
- pixel_weights.m_SrcStart = start;
- }
- } else if (start == pixel_weights.m_SrcStart &&
- start < pixel_weights.m_SrcEnd &&
- pixel_weights.m_SrcEnd < end) {
- pixel_weights.m_Weights[0] = (SDP_Table[256 + weight] + SDP_Table[weight]) << 8;
- pixel_weights.m_Weights[1] = SDP_Table[256 - weight] << 8;
- pixel_weights.m_Weights[2] = SDP_Table[512 - weight] << 8;
- pixel_weights.m_SrcEnd = end;
- } else if (start < pixel_weights.m_SrcStart &&
- pixel_weights.m_SrcStart < pixel_weights.m_SrcEnd &&
- pixel_weights.m_SrcEnd == end) {
- pixel_weights.m_Weights[0] = SDP_Table[256 + weight] << 8;
- pixel_weights.m_Weights[1] = SDP_Table[weight] << 8;
- pixel_weights.m_Weights[2] = (SDP_Table[256 - weight] + SDP_Table[512 - weight]) << 8;
- pixel_weights.m_SrcStart = start;
- } else {
- pixel_weights.m_Weights[0] = SDP_Table[256 + weight] << 8;
- pixel_weights.m_Weights[1] = SDP_Table[weight] << 8;
- pixel_weights.m_Weights[2] = SDP_Table[256 - weight] << 8;
- pixel_weights.m_Weights[3] = SDP_Table[512 - weight] << 8;
- pixel_weights.m_SrcStart = start;
- pixel_weights.m_SrcEnd = end;
- }
- } else {
- pixel_weights.m_SrcStart = pixel_weights.m_SrcEnd = (int)FXSYS_floor((FX_FLOAT)src_pos);
- if (pixel_weights.m_SrcStart < src_min) {
- pixel_weights.m_SrcStart = src_min;
- }
- if (pixel_weights.m_SrcEnd >= src_max) {
- pixel_weights.m_SrcEnd = src_max - 1;
- }
- pixel_weights.m_Weights[0] = 65536;
- }
- }
- return;
- }
- for (int dest_pixel = dest_min; dest_pixel < dest_max; dest_pixel ++) {
- PixelWeight& pixel_weights = *GetPixelWeight(dest_pixel);
- double src_start = dest_pixel * scale + base;
- double src_end = src_start + scale;
- int start_i, end_i;
- if (src_start < src_end) {
- start_i = (int)FXSYS_floor((FX_FLOAT)src_start);
- end_i = (int)FXSYS_ceil((FX_FLOAT)src_end);
- } else {
- start_i = (int)FXSYS_floor((FX_FLOAT)src_end);
- end_i = (int)FXSYS_ceil((FX_FLOAT)src_start);
- }
- if (start_i < src_min) {
- start_i = src_min;
- }
- if (end_i >= src_max) {
- end_i = src_max - 1;
- }
- if (start_i > end_i) {
- if (start_i >= src_max) {
- start_i = src_max - 1;
- }
- pixel_weights.m_SrcStart = start_i;
- pixel_weights.m_SrcEnd = start_i;
- continue;
- }
- pixel_weights.m_SrcStart = start_i;
- pixel_weights.m_SrcEnd = end_i;
- for (int j = start_i; j <= end_i; j ++) {
- double dest_start = FXSYS_Div((FX_FLOAT)(j) - base, scale);
- double dest_end = FXSYS_Div((FX_FLOAT)(j + 1) - base, scale);
- if (dest_start > dest_end) {
- double temp = dest_start;
- dest_start = dest_end;
- dest_end = temp;
- }
- double area_start = dest_start > (FX_FLOAT)(dest_pixel) ? dest_start : (FX_FLOAT)(dest_pixel);
- double area_end = dest_end > (FX_FLOAT)(dest_pixel + 1) ? (FX_FLOAT)(dest_pixel + 1) : dest_end;
- double weight = area_start >= area_end ? 0.0f : area_end - area_start;
- if (weight == 0 && j == end_i) {
- pixel_weights.m_SrcEnd --;
- break;
- }
- pixel_weights.m_Weights[j - start_i] = FXSYS_round((FX_FLOAT)(weight * 65536));
- }
- }
-}
-CStretchEngine::CStretchEngine(IFX_ScanlineComposer* pDestBitmap, FXDIB_Format dest_format,
- int dest_width, int dest_height, const FX_RECT& clip_rect,
- const CFX_DIBSource* pSrcBitmap, int flags)
-{
- m_State = 0;
- m_DestFormat = dest_format;
- m_DestBpp = dest_format & 0xff;
- m_SrcBpp = pSrcBitmap->GetFormat() & 0xff;
- m_bHasAlpha = pSrcBitmap->GetFormat() & 0x200;
- m_pSrcPalette = pSrcBitmap->GetPalette();
- m_pDestBitmap = pDestBitmap;
- m_DestWidth = dest_width;
- m_DestHeight = dest_height;
- m_pInterBuf = NULL;
- m_pExtraAlphaBuf = NULL;
- m_pDestMaskScanline = NULL;
- m_DestClip = clip_rect;
- FX_DWORD size = clip_rect.Width();
- if (size && m_DestBpp > (int)(INT_MAX / size)) {
- return;
- }
- size *= m_DestBpp;
- if (size > INT_MAX - 31) {
- return;
- }
- size += 31;
- size = size / 32 * 4;
- m_pDestScanline = FX_AllocNL(FX_BYTE, size);
- if (m_pDestScanline == NULL) {
- return;
- }
- FXSYS_memset32(m_pDestScanline, 0, sizeof(FX_BYTE) * size);
- if (dest_format == FXDIB_Rgb32) {
- FXSYS_memset8(m_pDestScanline, 255, size);
- }
- m_InterPitch = (m_DestClip.Width() * m_DestBpp + 31) / 32 * 4;
- m_ExtraMaskPitch = (m_DestClip.Width() * 8 + 31) / 32 * 4;
- m_pInterBuf = NULL;
- m_pSource = pSrcBitmap;
- m_SrcWidth = pSrcBitmap->GetWidth();
- m_SrcHeight = pSrcBitmap->GetHeight();
- m_SrcPitch = (m_SrcWidth * m_SrcBpp + 31) / 32 * 4;
- if ((flags & FXDIB_NOSMOOTH) == 0) {
- FX_BOOL bInterpol = flags & FXDIB_INTERPOL || flags & FXDIB_BICUBIC_INTERPOL;
- if (!bInterpol && FXSYS_abs(dest_width) != 0 && FXSYS_abs(dest_height) < m_SrcWidth * m_SrcHeight * 8 / FXSYS_abs(dest_width)) {
- flags = FXDIB_INTERPOL;
- }
- m_Flags = flags;
- } else {
- m_Flags = FXDIB_NOSMOOTH;
- if (flags & FXDIB_DOWNSAMPLE) {
- m_Flags |= FXDIB_DOWNSAMPLE;
- }
- }
- double scale_x = FXSYS_Div((FX_FLOAT)(m_SrcWidth), (FX_FLOAT)(m_DestWidth));
- double scale_y = FXSYS_Div((FX_FLOAT)(m_SrcHeight), (FX_FLOAT)(m_DestHeight));
- double base_x = m_DestWidth > 0 ? 0.0f : (FX_FLOAT)(m_DestWidth);
- double base_y = m_DestHeight > 0 ? 0.0f : (FX_FLOAT)(m_DestHeight);
- double src_left = FXSYS_Mul(scale_x, (FX_FLOAT)(clip_rect.left) + base_x);
- double src_right = FXSYS_Mul(scale_x, (FX_FLOAT)(clip_rect.right) + base_x);
- double src_top = FXSYS_Mul(scale_y, (FX_FLOAT)(clip_rect.top) + base_y);
- double src_bottom = FXSYS_Mul(scale_y, (FX_FLOAT)(clip_rect.bottom) + base_y);
- if (src_left > src_right) {
- double temp = src_left;
- src_left = src_right;
- src_right = temp;
- }
- if (src_top > src_bottom) {
- double temp = src_top;
- src_top = src_bottom;
- src_bottom = temp;
- }
- m_SrcClip.left = (int)FXSYS_floor((FX_FLOAT)src_left);
- m_SrcClip.right = (int)FXSYS_ceil((FX_FLOAT)src_right);
- m_SrcClip.top = (int)FXSYS_floor((FX_FLOAT)src_top);
- m_SrcClip.bottom = (int)FXSYS_ceil((FX_FLOAT)src_bottom);
- FX_RECT src_rect(0, 0, m_SrcWidth, m_SrcHeight);
- m_SrcClip.Intersect(src_rect);
- if (m_SrcBpp == 1) {
- if (m_DestBpp == 8) {
- m_TransMethod = 1;
- } else {
- m_TransMethod = 2;
- }
- } else if (m_SrcBpp == 8) {
- if (m_DestBpp == 8) {
- if (!m_bHasAlpha) {
- m_TransMethod = 3;
- } else {
- m_TransMethod = 4;
- }
- } else {
- if (!m_bHasAlpha) {
- m_TransMethod = 5;
- } else {
- m_TransMethod = 6;
- }
- }
- } else {
- if (!m_bHasAlpha) {
- m_TransMethod = 7;
- } else {
- m_TransMethod = 8;
- }
- }
-}
-FX_BOOL CStretchEngine::Continue(IFX_Pause* pPause)
-{
- while (m_State == 1) {
- if (ContinueStretchHorz(pPause)) {
- return TRUE;
- }
- m_State = 2;
- StretchVert();
- }
- return FALSE;
-}
-CStretchEngine::~CStretchEngine()
-{
- if (m_pDestScanline) {
- FX_Free(m_pDestScanline);
- }
- if (m_pInterBuf) {
- FX_Free(m_pInterBuf);
- }
- if (m_pExtraAlphaBuf) {
- FX_Free(m_pExtraAlphaBuf);
- }
- if (m_pDestMaskScanline) {
- FX_Free(m_pDestMaskScanline);
- }
-}
-FX_BOOL CStretchEngine::StartStretchHorz()
-{
- if (m_DestWidth == 0 || m_pDestScanline == NULL || m_SrcClip.Height() > (int)((1U << 29) / m_InterPitch) || m_SrcClip.Height() == 0) {
- return FALSE;
- }
-#ifndef _FPDFAPI_MINI_
- m_pInterBuf = FX_AllocNL(unsigned char, m_SrcClip.Height() * m_InterPitch);
-#else
- m_pInterBuf = FX_Alloc(unsigned char, m_SrcClip.Height() * m_InterPitch);
-#endif
- if (m_pInterBuf == NULL) {
- return FALSE;
- }
- if (m_pSource && m_bHasAlpha && m_pSource->m_pAlphaMask) {
- m_pExtraAlphaBuf = FX_Alloc(unsigned char, m_SrcClip.Height() * m_ExtraMaskPitch);
- if (!m_pExtraAlphaBuf) {
- return FALSE;
- }
- FX_DWORD size = (m_DestClip.Width() * 8 + 31) / 32 * 4;
- m_pDestMaskScanline = FX_AllocNL(unsigned char, size);
- if (!m_pDestMaskScanline) {
- return FALSE;
- }
- }
- m_WeightTable.Calc(m_DestWidth, m_DestClip.left, m_DestClip.right, m_SrcWidth, m_SrcClip.left, m_SrcClip.right, m_Flags);
- if (m_WeightTable.m_pWeightTables == NULL) {
- return FALSE;
- }
- m_CurRow = m_SrcClip.top;
- m_State = 1;
- return TRUE;
-}
-#define FX_STRECH_PAUSE_ROWS 10
-FX_BOOL CStretchEngine::ContinueStretchHorz(IFX_Pause* pPause)
-{
- if (!m_DestWidth) {
- return 0;
- }
- if (m_pSource->SkipToScanline(m_CurRow, pPause)) {
- return TRUE;
- }
- int Bpp = m_DestBpp / 8;
- int rows_to_go = FX_STRECH_PAUSE_ROWS;
- for (; m_CurRow < m_SrcClip.bottom; m_CurRow ++) {
- if (rows_to_go == 0) {
- if (pPause && pPause->NeedToPauseNow()) {
- return TRUE;
- } else {
- rows_to_go = FX_STRECH_PAUSE_ROWS;
- }
- }
- FX_LPCBYTE src_scan = m_pSource->GetScanline(m_CurRow);
- FX_LPBYTE dest_scan = m_pInterBuf + (m_CurRow - m_SrcClip.top) * m_InterPitch;
- FX_LPCBYTE src_scan_mask = NULL;
- FX_LPBYTE dest_scan_mask = NULL;
- if (m_pExtraAlphaBuf) {
- src_scan_mask = m_pSource->m_pAlphaMask->GetScanline(m_CurRow);
- dest_scan_mask = m_pExtraAlphaBuf + (m_CurRow - m_SrcClip.top) * m_ExtraMaskPitch;
- }
- switch (m_TransMethod) {
- case 1:
- case 2: {
- for (int col = m_DestClip.left; col < m_DestClip.right; col ++) {
- PixelWeight* pPixelWeights = m_WeightTable.GetPixelWeight(col);
- int dest_a = 0;
- for (int j = pPixelWeights->m_SrcStart; j <= pPixelWeights->m_SrcEnd; j ++) {
- int pixel_weight = pPixelWeights->m_Weights[j - pPixelWeights->m_SrcStart];
- if (src_scan[j / 8] & (1 << (7 - j % 8))) {
- dest_a += pixel_weight * 255;
- }
- }
- if (m_Flags & FXDIB_BICUBIC_INTERPOL) {
- dest_a = dest_a < 0 ? 0 : dest_a > 16711680 ? 16711680 : dest_a;
- }
- *dest_scan++ = (FX_BYTE)(dest_a >> 16);
- }
- break;
- }
- case 3: {
- for (int col = m_DestClip.left; col < m_DestClip.right; col ++) {
- PixelWeight* pPixelWeights = m_WeightTable.GetPixelWeight(col);
- int dest_a = 0;
- for (int j = pPixelWeights->m_SrcStart; j <= pPixelWeights->m_SrcEnd; j ++) {
- int pixel_weight = pPixelWeights->m_Weights[j - pPixelWeights->m_SrcStart];
- dest_a += pixel_weight * src_scan[j];
- }
- if (m_Flags & FXDIB_BICUBIC_INTERPOL) {
- dest_a = dest_a < 0 ? 0 : dest_a > 16711680 ? 16711680 : dest_a;
- }
- *dest_scan++ = (FX_BYTE)(dest_a >> 16);
- }
- break;
- }
- case 4: {
- for (int col = m_DestClip.left; col < m_DestClip.right; col ++) {
- PixelWeight* pPixelWeights = m_WeightTable.GetPixelWeight(col);
- int dest_a = 0, dest_r = 0;
- for (int j = pPixelWeights->m_SrcStart; j <= pPixelWeights->m_SrcEnd; j ++) {
- int pixel_weight = pPixelWeights->m_Weights[j - pPixelWeights->m_SrcStart];
- pixel_weight = pixel_weight * src_scan_mask[j] / 255;
- dest_r += pixel_weight * src_scan[j];
- dest_a += pixel_weight;
- }
- if (m_Flags & FXDIB_BICUBIC_INTERPOL) {
- dest_r = dest_r < 0 ? 0 : dest_r > 16711680 ? 16711680 : dest_r;
- dest_a = dest_a < 0 ? 0 : dest_a > 65536 ? 65536 : dest_a;
- }
- *dest_scan++ = (FX_BYTE)(dest_r >> 16);
- *dest_scan_mask++ = (FX_BYTE)((dest_a * 255) >> 16);
- }
- break;
- }
- case 5: {
- for (int col = m_DestClip.left; col < m_DestClip.right; col ++) {
- PixelWeight* pPixelWeights = m_WeightTable.GetPixelWeight(col);
- int dest_r_y = 0, dest_g_m = 0, dest_b_c = 0, dest_k = 0;
- for (int j = pPixelWeights->m_SrcStart; j <= pPixelWeights->m_SrcEnd; j ++) {
- int pixel_weight = pPixelWeights->m_Weights[j - pPixelWeights->m_SrcStart];
- unsigned long argb_cmyk = m_pSrcPalette[src_scan[j]];
- if (m_DestFormat == FXDIB_Rgb) {
- dest_r_y += pixel_weight * (FX_BYTE)(argb_cmyk >> 16);
- dest_g_m += pixel_weight * (FX_BYTE)(argb_cmyk >> 8);
- dest_b_c += pixel_weight * (FX_BYTE)argb_cmyk;
- } else {
- dest_b_c += pixel_weight * (FX_BYTE)(argb_cmyk >> 24);
- dest_g_m += pixel_weight * (FX_BYTE)(argb_cmyk >> 16);
- dest_r_y += pixel_weight * (FX_BYTE)(argb_cmyk >> 8);
- }
- }
- if (m_Flags & FXDIB_BICUBIC_INTERPOL) {
- dest_r_y = dest_r_y < 0 ? 0 : dest_r_y > 16711680 ? 16711680 : dest_r_y;
- dest_g_m = dest_g_m < 0 ? 0 : dest_g_m > 16711680 ? 16711680 : dest_g_m;
- dest_b_c = dest_b_c < 0 ? 0 : dest_b_c > 16711680 ? 16711680 : dest_b_c;
- }
- *dest_scan++ = (FX_BYTE)(dest_b_c >> 16);
- *dest_scan++ = (FX_BYTE)(dest_g_m >> 16);
- *dest_scan++ = (FX_BYTE)(dest_r_y >> 16);
- }
- break;
- }
- case 6: {
- for (int col = m_DestClip.left; col < m_DestClip.right; col ++) {
- PixelWeight* pPixelWeights = m_WeightTable.GetPixelWeight(col);
- int dest_a = 0, dest_r_y = 0, dest_g_m = 0, dest_b_c = 0, dest_k = 0;
- for (int j = pPixelWeights->m_SrcStart; j <= pPixelWeights->m_SrcEnd; j ++) {
- int pixel_weight = pPixelWeights->m_Weights[j - pPixelWeights->m_SrcStart];
- pixel_weight = pixel_weight * src_scan_mask[j] / 255;
- unsigned long argb_cmyk = m_pSrcPalette[src_scan[j]];
- if (m_DestFormat == FXDIB_Rgba) {
- dest_r_y += pixel_weight * (FX_BYTE)(argb_cmyk >> 16);
- dest_g_m += pixel_weight * (FX_BYTE)(argb_cmyk >> 8);
- dest_b_c += pixel_weight * (FX_BYTE)argb_cmyk;
- } else {
- dest_b_c += pixel_weight * (FX_BYTE)(argb_cmyk >> 24);
- dest_g_m += pixel_weight * (FX_BYTE)(argb_cmyk >> 16);
- dest_r_y += pixel_weight * (FX_BYTE)(argb_cmyk >> 8);
- }
- dest_a += pixel_weight;
- }
- if (m_Flags & FXDIB_BICUBIC_INTERPOL) {
- dest_k = dest_k < 0 ? 0 : dest_k > 16711680 ? 16711680 : dest_k;
- dest_b_c = dest_b_c < 0 ? 0 : dest_b_c > 16711680 ? 16711680 : dest_b_c;
- dest_g_m = dest_g_m < 0 ? 0 : dest_g_m > 16711680 ? 16711680 : dest_g_m;
- dest_r_y = dest_r_y < 0 ? 0 : dest_r_y > 16711680 ? 16711680 : dest_r_y;
- dest_a = dest_a < 0 ? 0 : dest_a > 65536 ? 65536 : dest_a;
- }
- *dest_scan++ = (FX_BYTE)(dest_b_c >> 16);
- *dest_scan++ = (FX_BYTE)(dest_g_m >> 16);
- *dest_scan++ = (FX_BYTE)(dest_r_y >> 16);
- *dest_scan_mask++ = (FX_BYTE)((dest_a * 255) >> 16);
- }
- break;
- }
- case 7: {
- for (int col = m_DestClip.left; col < m_DestClip.right; col ++) {
- PixelWeight* pPixelWeights = m_WeightTable.GetPixelWeight(col);
- int dest_r_y = 0, dest_g_m = 0, dest_b_c = 0, dest_k = 0;
- for (int j = pPixelWeights->m_SrcStart; j <= pPixelWeights->m_SrcEnd; j ++) {
- int pixel_weight = pPixelWeights->m_Weights[j - pPixelWeights->m_SrcStart];
- FX_LPCBYTE src_pixel = src_scan + j * Bpp;
- dest_b_c += pixel_weight * (*src_pixel++);
- dest_g_m += pixel_weight * (*src_pixel++);
- dest_r_y += pixel_weight * (*src_pixel);
- }
- if (m_Flags & FXDIB_BICUBIC_INTERPOL) {
- dest_b_c = dest_b_c < 0 ? 0 : dest_b_c > 16711680 ? 16711680 : dest_b_c;
- dest_g_m = dest_g_m < 0 ? 0 : dest_g_m > 16711680 ? 16711680 : dest_g_m;
- dest_r_y = dest_r_y < 0 ? 0 : dest_r_y > 16711680 ? 16711680 : dest_r_y;
- }
- *dest_scan++ = (FX_BYTE)((dest_b_c) >> 16);
- *dest_scan++ = (FX_BYTE)((dest_g_m) >> 16);
- *dest_scan++ = (FX_BYTE)((dest_r_y) >> 16);
- dest_scan += Bpp - 3;
- }
- break;
- }
- case 8: {
- for (int col = m_DestClip.left; col < m_DestClip.right; col ++) {
- PixelWeight* pPixelWeights = m_WeightTable.GetPixelWeight(col);
- int dest_a = 0, dest_r_y = 0, dest_g_m = 0, dest_b_c = 0, dest_k = 0;
- for (int j = pPixelWeights->m_SrcStart; j <= pPixelWeights->m_SrcEnd; j ++) {
- int pixel_weight = pPixelWeights->m_Weights[j - pPixelWeights->m_SrcStart];
- FX_LPCBYTE src_pixel = src_scan + j * Bpp;
- if (m_DestFormat == FXDIB_Argb) {
- pixel_weight = pixel_weight * src_pixel[3] / 255;
- } else {
- pixel_weight = pixel_weight * src_scan_mask[j] / 255;
- }
- dest_b_c += pixel_weight * (*src_pixel++);
- dest_g_m += pixel_weight * (*src_pixel++);
- dest_r_y += pixel_weight * (*src_pixel);
- dest_a += pixel_weight;
- }
- if (m_Flags & FXDIB_BICUBIC_INTERPOL) {
- dest_r_y = dest_r_y < 0 ? 0 : dest_r_y > 16711680 ? 16711680 : dest_r_y;
- dest_g_m = dest_g_m < 0 ? 0 : dest_g_m > 16711680 ? 16711680 : dest_g_m;
- dest_b_c = dest_b_c < 0 ? 0 : dest_b_c > 16711680 ? 16711680 : dest_b_c;
- dest_a = dest_a < 0 ? 0 : dest_a > 65536 ? 65536 : dest_a;
- }
- *dest_scan++ = (FX_BYTE)((dest_b_c) >> 16);
- *dest_scan++ = (FX_BYTE)((dest_g_m) >> 16);
- *dest_scan++ = (FX_BYTE)((dest_r_y) >> 16);
- if (m_DestFormat == FXDIB_Argb) {
- *dest_scan = (FX_BYTE)((dest_a * 255) >> 16);
- }
- if (dest_scan_mask) {
- *dest_scan_mask++ = (FX_BYTE)((dest_a * 255) >> 16);
- }
- dest_scan += Bpp - 3;
- }
- break;
- }
- }
- rows_to_go --;
- }
- return FALSE;
-}
-void CStretchEngine::StretchVert()
-{
- if (m_DestHeight == 0) {
- return;
- }
- CWeightTable table;
- table.Calc(m_DestHeight, m_DestClip.top, m_DestClip.bottom, m_SrcHeight, m_SrcClip.top, m_SrcClip.bottom, m_Flags);
- if (table.m_pWeightTables == NULL) {
- return;
- }
- int DestBpp = m_DestBpp / 8;
- for (int row = m_DestClip.top; row < m_DestClip.bottom; row ++) {
- unsigned char* dest_scan = m_pDestScanline;
- unsigned char* dest_sacn_mask = m_pDestMaskScanline;
- PixelWeight* pPixelWeights = table.GetPixelWeight(row);
- switch(m_TransMethod) {
- case 1:
- case 2:
- case 3: {
- for (int col = m_DestClip.left; col < m_DestClip.right; col ++) {
- unsigned char* src_scan = m_pInterBuf + (col - m_DestClip.left) * DestBpp;
- int dest_a = 0;
- for (int j = pPixelWeights->m_SrcStart; j <= pPixelWeights->m_SrcEnd; j ++) {
- int pixel_weight = pPixelWeights->m_Weights[j - pPixelWeights->m_SrcStart];
- dest_a += pixel_weight * src_scan[(j - m_SrcClip.top) * m_InterPitch];
- }
- if (m_Flags & FXDIB_BICUBIC_INTERPOL) {
- dest_a = dest_a < 0 ? 0 : dest_a > 16711680 ? 16711680 : dest_a;
- }
- *dest_scan = (FX_BYTE)(dest_a >> 16);
- dest_scan += DestBpp;
- }
- break;
- }
- case 4: {
- for (int col = m_DestClip.left; col < m_DestClip.right; col ++) {
- unsigned char* src_scan = m_pInterBuf + (col - m_DestClip.left) * DestBpp;
- unsigned char* src_scan_mask = m_pExtraAlphaBuf + (col - m_DestClip.left);
- int dest_a = 0, dest_k = 0;
- for (int j = pPixelWeights->m_SrcStart; j <= pPixelWeights->m_SrcEnd; j ++) {
- int pixel_weight = pPixelWeights->m_Weights[j - pPixelWeights->m_SrcStart];
- dest_k += pixel_weight * src_scan[(j - m_SrcClip.top) * m_InterPitch];
- dest_a += pixel_weight * src_scan_mask[(j - m_SrcClip.top) * m_ExtraMaskPitch];
- }
- if (m_Flags & FXDIB_BICUBIC_INTERPOL) {
- dest_k = dest_k < 0 ? 0 : dest_k > 16711680 ? 16711680 : dest_k;
- dest_a = dest_a < 0 ? 0 : dest_a > 16711680 ? 16711680 : dest_a;
- }
- *dest_scan = (FX_BYTE)(dest_k >> 16);
- dest_scan += DestBpp;
- *dest_sacn_mask++ = (FX_BYTE)(dest_a >> 16);
- }
- break;
- }
- case 5:
- case 7: {
- for (int col = m_DestClip.left; col < m_DestClip.right; col ++) {
- unsigned char* src_scan = m_pInterBuf + (col - m_DestClip.left) * DestBpp;
- int dest_r_y = 0, dest_g_m = 0, dest_b_c = 0, dest_k = 0;
- for (int j = pPixelWeights->m_SrcStart; j <= pPixelWeights->m_SrcEnd; j ++) {
- int pixel_weight = pPixelWeights->m_Weights[j - pPixelWeights->m_SrcStart];
- FX_LPCBYTE src_pixel = src_scan + (j - m_SrcClip.top) * m_InterPitch;
- dest_b_c += pixel_weight * (*src_pixel++);
- dest_g_m += pixel_weight * (*src_pixel++);
- dest_r_y += pixel_weight * (*src_pixel);
- }
- if (m_Flags & FXDIB_BICUBIC_INTERPOL) {
- dest_r_y = dest_r_y < 0 ? 0 : dest_r_y > 16711680 ? 16711680 : dest_r_y;
- dest_g_m = dest_g_m < 0 ? 0 : dest_g_m > 16711680 ? 16711680 : dest_g_m;
- dest_b_c = dest_b_c < 0 ? 0 : dest_b_c > 16711680 ? 16711680 : dest_b_c;
- }
- dest_scan[0] = (FX_BYTE)((dest_b_c) >> 16);
- dest_scan[1] = (FX_BYTE)((dest_g_m) >> 16);
- dest_scan[2] = (FX_BYTE)((dest_r_y) >> 16);
- dest_scan += DestBpp;
- }
- break;
- }
- case 6:
- case 8: {
- for (int col = m_DestClip.left; col < m_DestClip.right; col ++) {
- unsigned char* src_scan = m_pInterBuf + (col - m_DestClip.left) * DestBpp;
- unsigned char* src_scan_mask = NULL;
- if (m_DestFormat != FXDIB_Argb) {
- src_scan_mask = m_pExtraAlphaBuf + (col - m_DestClip.left);
- }
- int dest_a = 0, dest_k = 0, dest_r_y = 0, dest_g_m = 0, dest_b_c = 0;
- for (int j = pPixelWeights->m_SrcStart; j <= pPixelWeights->m_SrcEnd; j ++) {
- int pixel_weight = pPixelWeights->m_Weights[j - pPixelWeights->m_SrcStart];
- FX_LPCBYTE src_pixel = src_scan + (j - m_SrcClip.top) * m_InterPitch;
- int mask_v = 255;
- if (src_scan_mask) {
- mask_v = src_scan_mask[(j - m_SrcClip.top) * m_ExtraMaskPitch];
- }
- dest_b_c += pixel_weight * (*src_pixel++);
- dest_g_m += pixel_weight * (*src_pixel++);
- dest_r_y += pixel_weight * (*src_pixel);
- if (m_DestFormat == FXDIB_Argb) {
- dest_a += pixel_weight * (*(src_pixel + 1));
- } else {
- dest_a += pixel_weight * mask_v;
- }
- }
- if (m_Flags & FXDIB_BICUBIC_INTERPOL) {
- dest_r_y = dest_r_y < 0 ? 0 : dest_r_y > 16711680 ? 16711680 : dest_r_y;
- dest_g_m = dest_g_m < 0 ? 0 : dest_g_m > 16711680 ? 16711680 : dest_g_m;
- dest_b_c = dest_b_c < 0 ? 0 : dest_b_c > 16711680 ? 16711680 : dest_b_c;
- dest_a = dest_a < 0 ? 0 : dest_a > 16711680 ? 16711680 : dest_a;
- }
- if (dest_a) {
- int r = ((FX_DWORD)dest_r_y) * 255 / dest_a;
- int g = ((FX_DWORD)dest_g_m) * 255 / dest_a;
- int b = ((FX_DWORD)dest_b_c) * 255 / dest_a;
- dest_scan[0] = b > 255 ? 255 : b < 0 ? 0 : b;
- dest_scan[1] = g > 255 ? 255 : g < 0 ? 0 : g;
- dest_scan[2] = r > 255 ? 255 : r < 0 ? 0 : r;
- }
- if (m_DestFormat == FXDIB_Argb) {
- dest_scan[3] = (FX_BYTE)((dest_a) >> 16);
- } else {
- *dest_sacn_mask = (FX_BYTE)((dest_a) >> 16);
- }
- dest_scan += DestBpp;
- if (dest_sacn_mask) {
- dest_sacn_mask++;
- }
- }
- break;
- }
- }
- m_pDestBitmap->ComposeScanline(row - m_DestClip.top, m_pDestScanline, m_pDestMaskScanline);
- }
-}
-CFX_ImageStretcher::CFX_ImageStretcher()
-{
- m_pScanline = NULL;
- m_pStretchEngine = NULL;
- m_pMaskScanline = NULL;
-}
-CFX_ImageStretcher::~CFX_ImageStretcher()
-{
- if (m_pScanline) {
- FX_Free(m_pScanline);
- }
- if (m_pStretchEngine) {
- delete m_pStretchEngine;
- }
- if (m_pMaskScanline) {
- FX_Free(m_pMaskScanline);
- }
-}
-FXDIB_Format _GetStretchedFormat(const CFX_DIBSource* pSrc)
-{
- FXDIB_Format format = pSrc->GetFormat();
- if (format == FXDIB_1bppMask) {
- format = FXDIB_8bppMask;
- } else if (format == FXDIB_1bppRgb) {
- format = FXDIB_8bppRgb;
- } else if (format == FXDIB_8bppRgb) {
- if (pSrc->GetPalette()) {
- format = FXDIB_Rgb;
- }
- }
- return format;
-}
-FX_BOOL CFX_ImageStretcher::Start(IFX_ScanlineComposer* pDest,
- const CFX_DIBSource* pSource, int dest_width, int dest_height,
- const FX_RECT& rect, FX_DWORD flags)
-{
- m_DestFormat = _GetStretchedFormat(pSource);
- m_DestBPP = m_DestFormat & 0xff;
- m_pDest = pDest;
- m_pSource = pSource;
- m_DestWidth = dest_width;
- m_DestHeight = dest_height;
- m_ClipRect = rect;
- m_Flags = flags;
- if (pSource->GetFormat() == FXDIB_1bppRgb && pSource->GetPalette()) {
- FX_ARGB pal[256];
- int a0, r0, g0, b0, a1, r1, g1, b1;
- ArgbDecode(pSource->GetPaletteEntry(0), a0, r0, g0, b0);
- ArgbDecode(pSource->GetPaletteEntry(1), a1, r1, g1, b1);
- for (int i = 0; i < 256; i ++) {
- int a = a0 + (a1 - a0) * i / 255;
- int r = r0 + (r1 - r0) * i / 255;
- int g = g0 + (g1 - g0) * i / 255;
- int b = b0 + (b1 - b0) * i / 255;
- pal[i] = ArgbEncode(a, r, g, b);
- }
- if (!pDest->SetInfo(rect.Width(), rect.Height(), m_DestFormat, pal)) {
- return FALSE;
- }
- } else if (pSource->GetFormat() == FXDIB_1bppCmyk && pSource->GetPalette()) {
- FX_CMYK pal[256];
- int c0, m0, y0, k0, c1, m1, y1, k1;
- CmykDecode(pSource->GetPaletteEntry(0), c0, m0, y0, k0);
- CmykDecode(pSource->GetPaletteEntry(1), c1, m1, y1, k1);
- for (int i = 0; i < 256; i ++) {
- int c = c0 + (c1 - c0) * i / 255;
- int m = m0 + (m1 - m0) * i / 255;
- int y = y0 + (y1 - y0) * i / 255;
- int k = k0 + (k1 - k0) * i / 255;
- pal[i] = CmykEncode(c, m, y, k);
- }
- if (!pDest->SetInfo(rect.Width(), rect.Height(), m_DestFormat, pal)) {
- return FALSE;
- }
- } else if (!pDest->SetInfo(rect.Width(), rect.Height(), m_DestFormat, NULL)) {
- return FALSE;
- }
- if (flags & FXDIB_DOWNSAMPLE) {
- return StartQuickStretch();
- } else {
- return StartStretch();
- }
-}
-FX_BOOL CFX_ImageStretcher::Continue(IFX_Pause* pPause)
-{
- if (m_Flags & FXDIB_DOWNSAMPLE) {
- return ContinueQuickStretch(pPause);
- } else {
- return ContinueStretch(pPause);
- }
-}
-#ifndef _FPDFAPI_MINI_
-#define MAX_PROGRESSIVE_STRETCH_PIXELS 1000000
-#else
-#define MAX_PROGRESSIVE_STRETCH_PIXELS 100000
-#endif
-FX_BOOL CFX_ImageStretcher::StartStretch()
-{
- m_pStretchEngine = FX_NEW CStretchEngine(m_pDest, m_DestFormat, m_DestWidth, m_DestHeight, m_ClipRect, m_pSource, m_Flags);
- if (!m_pStretchEngine) {
- return FALSE;
- }
- m_pStretchEngine->StartStretchHorz();
- if (m_pSource->GetWidth() * m_pSource->GetHeight() < MAX_PROGRESSIVE_STRETCH_PIXELS) {
- m_pStretchEngine->Continue(NULL);
- return FALSE;
- }
- return TRUE;
-}
-FX_BOOL CFX_ImageStretcher::ContinueStretch(IFX_Pause* pPause)
-{
- if (m_pStretchEngine == NULL) {
- return FALSE;
- }
- return m_pStretchEngine->Continue(pPause);
-}
-FX_BOOL CFX_ImageStretcher::StartQuickStretch()
-{
-#ifdef _FPDFAPI_MINI_
- m_pSource->SetDownSampleSize(m_DestWidth, m_DestHeight);
-#endif
- m_bFlipX = FALSE;
- m_bFlipY = FALSE;
- if (m_DestWidth < 0) {
- m_bFlipX = TRUE;
- m_DestWidth = -m_DestWidth;
- }
- if (m_DestHeight < 0) {
- m_bFlipY = TRUE;
- m_DestHeight = -m_DestHeight;
- }
- m_LineIndex = 0;
- FX_DWORD size = m_ClipRect.Width();
- if (size && m_DestBPP > (int)(INT_MAX / size)) {
- return FALSE;
- }
- size *= m_DestBPP;
- m_pScanline = FX_Alloc(FX_BYTE, (size / 8 + 3) / 4 * 4);
- if (!m_pScanline) {
- return FALSE;
- }
- if (m_pSource->m_pAlphaMask) {
- m_pMaskScanline = FX_Alloc(FX_BYTE, (m_ClipRect.Width() + 3) / 4 * 4);
- if (!m_pMaskScanline) {
- return FALSE;
- }
- }
- if (m_pSource->GetWidth() * m_pSource->GetHeight() < MAX_PROGRESSIVE_STRETCH_PIXELS) {
- ContinueQuickStretch(NULL);
- return FALSE;
- }
- return TRUE;
-}
-FX_BOOL CFX_ImageStretcher::ContinueQuickStretch(IFX_Pause* pPause)
-{
- if (m_pScanline == NULL) {
- return FALSE;
- }
- int result_width = m_ClipRect.Width(), result_height = m_ClipRect.Height();
- int src_width = m_pSource->GetWidth(), src_height = m_pSource->GetHeight();
- for (; m_LineIndex < result_height; m_LineIndex ++) {
- int dest_y, src_y;
- if (m_bFlipY) {
- dest_y = result_height - m_LineIndex - 1;
- src_y = (m_DestHeight - (dest_y + m_ClipRect.top) - 1) * src_height / m_DestHeight;
- } else {
- dest_y = m_LineIndex;
- src_y = (dest_y + m_ClipRect.top) * src_height / m_DestHeight;
- }
- if (src_y >= src_height) {
- src_y = src_height - 1;
- }
- if (src_y < 0) {
- src_y = 0;
- }
- if (m_pSource->SkipToScanline(src_y, pPause)) {
- return TRUE;
- }
- m_pSource->DownSampleScanline(src_y, m_pScanline, m_DestBPP, m_DestWidth, m_bFlipX, m_ClipRect.left, result_width);
- FX_LPBYTE scan_extra_alpha = NULL;
- if (m_pMaskScanline) {
- m_pSource->m_pAlphaMask->DownSampleScanline(src_y, m_pMaskScanline, 1, m_DestWidth, m_bFlipX, m_ClipRect.left, result_width);
- }
- m_pDest->ComposeScanline(dest_y, m_pScanline, m_pMaskScanline);
- }
- return FALSE;
-}
+// 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
+
+#include "../../../include/fxge/fx_dib.h"
+#include "../../../include/fxge/fx_ge.h"
+#include "dib_int.h"
+#include <limits.h>
+extern int SDP_Table[513];
+void CWeightTable::Calc(int dest_len, int dest_min, int dest_max, int src_len, int src_min, int src_max, int flags)
+{
+ if (m_pWeightTables) {
+ FX_Free(m_pWeightTables);
+ m_pWeightTables = NULL;
+ }
+ double scale, base;
+ scale = FXSYS_Div((FX_FLOAT)(src_len), (FX_FLOAT)(dest_len));
+ if (dest_len < 0) {
+ base = (FX_FLOAT)(src_len);
+ } else {
+ base = 0;
+ }
+ int ext_size = flags & FXDIB_BICUBIC_INTERPOL ? 3 : 1;
+ m_ItemSize = sizeof(int) * 2 + (int)(sizeof(int) * (FXSYS_ceil(FXSYS_fabs((FX_FLOAT)scale)) + ext_size));
+ m_DestMin = dest_min;
+ if ((dest_max - dest_min) > (int)((1U << 30) - 4) / m_ItemSize) {
+ return;
+ }
+ m_pWeightTables = FX_AllocNL(FX_BYTE, (dest_max - dest_min) * m_ItemSize + 4);
+ if (m_pWeightTables == NULL) {
+ return;
+ }
+ FXSYS_memset32(m_pWeightTables, 0, sizeof(FX_BYTE) * ((dest_max - dest_min)*m_ItemSize + 4));
+ if ((flags & FXDIB_NOSMOOTH) != 0 || FXSYS_fabs((FX_FLOAT)scale) < 1.0f) {
+ for (int dest_pixel = dest_min; dest_pixel < dest_max; dest_pixel ++) {
+ PixelWeight& pixel_weights = *GetPixelWeight(dest_pixel);
+ double src_pos = dest_pixel * scale + scale / 2 + base;
+ if (flags & FXDIB_INTERPOL) {
+ pixel_weights.m_SrcStart = (int)FXSYS_floor((FX_FLOAT)src_pos - 1.0f / 2);
+ pixel_weights.m_SrcEnd = (int)FXSYS_floor((FX_FLOAT)src_pos + 1.0f / 2);
+ if (pixel_weights.m_SrcStart < src_min) {
+ pixel_weights.m_SrcStart = src_min;
+ }
+ if (pixel_weights.m_SrcEnd >= src_max) {
+ pixel_weights.m_SrcEnd = src_max - 1;
+ }
+ if (pixel_weights.m_SrcStart == pixel_weights.m_SrcEnd) {
+ pixel_weights.m_Weights[0] = 65536;
+ } else {
+ pixel_weights.m_Weights[1] = FXSYS_round((FX_FLOAT)(src_pos - pixel_weights.m_SrcStart - 1.0f / 2) * 65536);
+ pixel_weights.m_Weights[0] = 65536 - pixel_weights.m_Weights[1];
+ }
+ } else if (flags & FXDIB_BICUBIC_INTERPOL) {
+ pixel_weights.m_SrcStart = (int)FXSYS_floor((FX_FLOAT)src_pos - 1.0f / 2);
+ pixel_weights.m_SrcEnd = (int)FXSYS_floor((FX_FLOAT)src_pos + 1.0f / 2);
+ int start = pixel_weights.m_SrcStart - 1;
+ int end = pixel_weights.m_SrcEnd + 1;
+ if (start < src_min) {
+ start = src_min;
+ }
+ if (end >= src_max) {
+ end = src_max - 1;
+ }
+ if (pixel_weights.m_SrcStart < src_min) {
+ src_pos += src_min - pixel_weights.m_SrcStart;
+ pixel_weights.m_SrcStart = src_min;
+ }
+ if (pixel_weights.m_SrcEnd >= src_max) {
+ pixel_weights.m_SrcEnd = src_max - 1;
+ }
+ int weight;
+ weight = FXSYS_round((FX_FLOAT)(src_pos - pixel_weights.m_SrcStart - 1.0f / 2) * 256);
+ if (start == end) {
+ pixel_weights.m_Weights[0] = (SDP_Table[256 + weight] + SDP_Table[weight] + SDP_Table[256 - weight] + SDP_Table[512 - weight]) << 8;
+ } else if ((start == pixel_weights.m_SrcStart && (pixel_weights.m_SrcStart == pixel_weights.m_SrcEnd ||
+ end == pixel_weights.m_SrcEnd) && start < end) || (start < pixel_weights.m_SrcStart && pixel_weights.m_SrcStart == pixel_weights.m_SrcEnd && end == pixel_weights.m_SrcEnd)) {
+ if (start < pixel_weights.m_SrcStart) {
+ pixel_weights.m_Weights[0] = SDP_Table[256 + weight] << 8;
+ pixel_weights.m_Weights[1] = (SDP_Table[weight] + SDP_Table[256 - weight] + SDP_Table[512 - weight]) << 8;
+ } else {
+ if (pixel_weights.m_SrcStart == pixel_weights.m_SrcEnd) {
+ pixel_weights.m_Weights[0] = (SDP_Table[256 + weight] + SDP_Table[weight] + SDP_Table[256 - weight]) << 8;
+ pixel_weights.m_Weights[1] = SDP_Table[512 - weight] << 8;
+ } else {
+ pixel_weights.m_Weights[0] = (SDP_Table[256 + weight] + SDP_Table[weight]) << 8;
+ pixel_weights.m_Weights[1] = (SDP_Table[256 - weight] + SDP_Table[512 - weight]) << 8;
+ }
+ }
+ if (pixel_weights.m_SrcStart == pixel_weights.m_SrcEnd) {
+ pixel_weights.m_SrcEnd = end;
+ }
+ if (start < pixel_weights.m_SrcStart) {
+ pixel_weights.m_SrcStart = start;
+ }
+ } else if (start == pixel_weights.m_SrcStart &&
+ start < pixel_weights.m_SrcEnd &&
+ pixel_weights.m_SrcEnd < end) {
+ pixel_weights.m_Weights[0] = (SDP_Table[256 + weight] + SDP_Table[weight]) << 8;
+ pixel_weights.m_Weights[1] = SDP_Table[256 - weight] << 8;
+ pixel_weights.m_Weights[2] = SDP_Table[512 - weight] << 8;
+ pixel_weights.m_SrcEnd = end;
+ } else if (start < pixel_weights.m_SrcStart &&
+ pixel_weights.m_SrcStart < pixel_weights.m_SrcEnd &&
+ pixel_weights.m_SrcEnd == end) {
+ pixel_weights.m_Weights[0] = SDP_Table[256 + weight] << 8;
+ pixel_weights.m_Weights[1] = SDP_Table[weight] << 8;
+ pixel_weights.m_Weights[2] = (SDP_Table[256 - weight] + SDP_Table[512 - weight]) << 8;
+ pixel_weights.m_SrcStart = start;
+ } else {
+ pixel_weights.m_Weights[0] = SDP_Table[256 + weight] << 8;
+ pixel_weights.m_Weights[1] = SDP_Table[weight] << 8;
+ pixel_weights.m_Weights[2] = SDP_Table[256 - weight] << 8;
+ pixel_weights.m_Weights[3] = SDP_Table[512 - weight] << 8;
+ pixel_weights.m_SrcStart = start;
+ pixel_weights.m_SrcEnd = end;
+ }
+ } else {
+ pixel_weights.m_SrcStart = pixel_weights.m_SrcEnd = (int)FXSYS_floor((FX_FLOAT)src_pos);
+ if (pixel_weights.m_SrcStart < src_min) {
+ pixel_weights.m_SrcStart = src_min;
+ }
+ if (pixel_weights.m_SrcEnd >= src_max) {
+ pixel_weights.m_SrcEnd = src_max - 1;
+ }
+ pixel_weights.m_Weights[0] = 65536;
+ }
+ }
+ return;
+ }
+ for (int dest_pixel = dest_min; dest_pixel < dest_max; dest_pixel ++) {
+ PixelWeight& pixel_weights = *GetPixelWeight(dest_pixel);
+ double src_start = dest_pixel * scale + base;
+ double src_end = src_start + scale;
+ int start_i, end_i;
+ if (src_start < src_end) {
+ start_i = (int)FXSYS_floor((FX_FLOAT)src_start);
+ end_i = (int)FXSYS_ceil((FX_FLOAT)src_end);
+ } else {
+ start_i = (int)FXSYS_floor((FX_FLOAT)src_end);
+ end_i = (int)FXSYS_ceil((FX_FLOAT)src_start);
+ }
+ if (start_i < src_min) {
+ start_i = src_min;
+ }
+ if (end_i >= src_max) {
+ end_i = src_max - 1;
+ }
+ if (start_i > end_i) {
+ if (start_i >= src_max) {
+ start_i = src_max - 1;
+ }
+ pixel_weights.m_SrcStart = start_i;
+ pixel_weights.m_SrcEnd = start_i;
+ continue;
+ }
+ pixel_weights.m_SrcStart = start_i;
+ pixel_weights.m_SrcEnd = end_i;
+ for (int j = start_i; j <= end_i; j ++) {
+ double dest_start = FXSYS_Div((FX_FLOAT)(j) - base, scale);
+ double dest_end = FXSYS_Div((FX_FLOAT)(j + 1) - base, scale);
+ if (dest_start > dest_end) {
+ double temp = dest_start;
+ dest_start = dest_end;
+ dest_end = temp;
+ }
+ double area_start = dest_start > (FX_FLOAT)(dest_pixel) ? dest_start : (FX_FLOAT)(dest_pixel);
+ double area_end = dest_end > (FX_FLOAT)(dest_pixel + 1) ? (FX_FLOAT)(dest_pixel + 1) : dest_end;
+ double weight = area_start >= area_end ? 0.0f : area_end - area_start;
+ if (weight == 0 && j == end_i) {
+ pixel_weights.m_SrcEnd --;
+ break;
+ }
+ pixel_weights.m_Weights[j - start_i] = FXSYS_round((FX_FLOAT)(weight * 65536));
+ }
+ }
+}
+CStretchEngine::CStretchEngine(IFX_ScanlineComposer* pDestBitmap, FXDIB_Format dest_format,
+ int dest_width, int dest_height, const FX_RECT& clip_rect,
+ const CFX_DIBSource* pSrcBitmap, int flags)
+{
+ m_State = 0;
+ m_DestFormat = dest_format;
+ m_DestBpp = dest_format & 0xff;
+ m_SrcBpp = pSrcBitmap->GetFormat() & 0xff;
+ m_bHasAlpha = pSrcBitmap->GetFormat() & 0x200;
+ m_pSrcPalette = pSrcBitmap->GetPalette();
+ m_pDestBitmap = pDestBitmap;
+ m_DestWidth = dest_width;
+ m_DestHeight = dest_height;
+ m_pInterBuf = NULL;
+ m_pExtraAlphaBuf = NULL;
+ m_pDestMaskScanline = NULL;
+ m_DestClip = clip_rect;
+ FX_DWORD size = clip_rect.Width();
+ if (size && m_DestBpp > (int)(INT_MAX / size)) {
+ return;
+ }
+ size *= m_DestBpp;
+ if (size > INT_MAX - 31) {
+ return;
+ }
+ size += 31;
+ size = size / 32 * 4;
+ m_pDestScanline = FX_AllocNL(FX_BYTE, size);
+ if (m_pDestScanline == NULL) {
+ return;
+ }
+ FXSYS_memset32(m_pDestScanline, 0, sizeof(FX_BYTE) * size);
+ if (dest_format == FXDIB_Rgb32) {
+ FXSYS_memset8(m_pDestScanline, 255, size);
+ }
+ m_InterPitch = (m_DestClip.Width() * m_DestBpp + 31) / 32 * 4;
+ m_ExtraMaskPitch = (m_DestClip.Width() * 8 + 31) / 32 * 4;
+ m_pInterBuf = NULL;
+ m_pSource = pSrcBitmap;
+ m_SrcWidth = pSrcBitmap->GetWidth();
+ m_SrcHeight = pSrcBitmap->GetHeight();
+ m_SrcPitch = (m_SrcWidth * m_SrcBpp + 31) / 32 * 4;
+ if ((flags & FXDIB_NOSMOOTH) == 0) {
+ FX_BOOL bInterpol = flags & FXDIB_INTERPOL || flags & FXDIB_BICUBIC_INTERPOL;
+ if (!bInterpol && FXSYS_abs(dest_width) != 0 && FXSYS_abs(dest_height) < m_SrcWidth * m_SrcHeight * 8 / FXSYS_abs(dest_width)) {
+ flags = FXDIB_INTERPOL;
+ }
+ m_Flags = flags;
+ } else {
+ m_Flags = FXDIB_NOSMOOTH;
+ if (flags & FXDIB_DOWNSAMPLE) {
+ m_Flags |= FXDIB_DOWNSAMPLE;
+ }
+ }
+ double scale_x = FXSYS_Div((FX_FLOAT)(m_SrcWidth), (FX_FLOAT)(m_DestWidth));
+ double scale_y = FXSYS_Div((FX_FLOAT)(m_SrcHeight), (FX_FLOAT)(m_DestHeight));
+ double base_x = m_DestWidth > 0 ? 0.0f : (FX_FLOAT)(m_DestWidth);
+ double base_y = m_DestHeight > 0 ? 0.0f : (FX_FLOAT)(m_DestHeight);
+ double src_left = FXSYS_Mul(scale_x, (FX_FLOAT)(clip_rect.left) + base_x);
+ double src_right = FXSYS_Mul(scale_x, (FX_FLOAT)(clip_rect.right) + base_x);
+ double src_top = FXSYS_Mul(scale_y, (FX_FLOAT)(clip_rect.top) + base_y);
+ double src_bottom = FXSYS_Mul(scale_y, (FX_FLOAT)(clip_rect.bottom) + base_y);
+ if (src_left > src_right) {
+ double temp = src_left;
+ src_left = src_right;
+ src_right = temp;
+ }
+ if (src_top > src_bottom) {
+ double temp = src_top;
+ src_top = src_bottom;
+ src_bottom = temp;
+ }
+ m_SrcClip.left = (int)FXSYS_floor((FX_FLOAT)src_left);
+ m_SrcClip.right = (int)FXSYS_ceil((FX_FLOAT)src_right);
+ m_SrcClip.top = (int)FXSYS_floor((FX_FLOAT)src_top);
+ m_SrcClip.bottom = (int)FXSYS_ceil((FX_FLOAT)src_bottom);
+ FX_RECT src_rect(0, 0, m_SrcWidth, m_SrcHeight);
+ m_SrcClip.Intersect(src_rect);
+ if (m_SrcBpp == 1) {
+ if (m_DestBpp == 8) {
+ m_TransMethod = 1;
+ } else {
+ m_TransMethod = 2;
+ }
+ } else if (m_SrcBpp == 8) {
+ if (m_DestBpp == 8) {
+ if (!m_bHasAlpha) {
+ m_TransMethod = 3;
+ } else {
+ m_TransMethod = 4;
+ }
+ } else {
+ if (!m_bHasAlpha) {
+ m_TransMethod = 5;
+ } else {
+ m_TransMethod = 6;
+ }
+ }
+ } else {
+ if (!m_bHasAlpha) {
+ m_TransMethod = 7;
+ } else {
+ m_TransMethod = 8;
+ }
+ }
+}
+FX_BOOL CStretchEngine::Continue(IFX_Pause* pPause)
+{
+ while (m_State == 1) {
+ if (ContinueStretchHorz(pPause)) {
+ return TRUE;
+ }
+ m_State = 2;
+ StretchVert();
+ }
+ return FALSE;
+}
+CStretchEngine::~CStretchEngine()
+{
+ if (m_pDestScanline) {
+ FX_Free(m_pDestScanline);
+ }
+ if (m_pInterBuf) {
+ FX_Free(m_pInterBuf);
+ }
+ if (m_pExtraAlphaBuf) {
+ FX_Free(m_pExtraAlphaBuf);
+ }
+ if (m_pDestMaskScanline) {
+ FX_Free(m_pDestMaskScanline);
+ }
+}
+FX_BOOL CStretchEngine::StartStretchHorz()
+{
+ if (m_DestWidth == 0 || m_pDestScanline == NULL || m_SrcClip.Height() > (int)((1U << 29) / m_InterPitch) || m_SrcClip.Height() == 0) {
+ return FALSE;
+ }
+#ifndef _FPDFAPI_MINI_
+ m_pInterBuf = FX_AllocNL(unsigned char, m_SrcClip.Height() * m_InterPitch);
+#else
+ m_pInterBuf = FX_Alloc(unsigned char, m_SrcClip.Height() * m_InterPitch);
+#endif
+ if (m_pInterBuf == NULL) {
+ return FALSE;
+ }
+ if (m_pSource && m_bHasAlpha && m_pSource->m_pAlphaMask) {
+ m_pExtraAlphaBuf = FX_Alloc(unsigned char, m_SrcClip.Height() * m_ExtraMaskPitch);
+ if (!m_pExtraAlphaBuf) {
+ return FALSE;
+ }
+ FX_DWORD size = (m_DestClip.Width() * 8 + 31) / 32 * 4;
+ m_pDestMaskScanline = FX_AllocNL(unsigned char, size);
+ if (!m_pDestMaskScanline) {
+ return FALSE;
+ }
+ }
+ m_WeightTable.Calc(m_DestWidth, m_DestClip.left, m_DestClip.right, m_SrcWidth, m_SrcClip.left, m_SrcClip.right, m_Flags);
+ if (m_WeightTable.m_pWeightTables == NULL) {
+ return FALSE;
+ }
+ m_CurRow = m_SrcClip.top;
+ m_State = 1;
+ return TRUE;
+}
+#define FX_STRECH_PAUSE_ROWS 10
+FX_BOOL CStretchEngine::ContinueStretchHorz(IFX_Pause* pPause)
+{
+ if (!m_DestWidth) {
+ return 0;
+ }
+ if (m_pSource->SkipToScanline(m_CurRow, pPause)) {
+ return TRUE;
+ }
+ int Bpp = m_DestBpp / 8;
+ int rows_to_go = FX_STRECH_PAUSE_ROWS;
+ for (; m_CurRow < m_SrcClip.bottom; m_CurRow ++) {
+ if (rows_to_go == 0) {
+ if (pPause && pPause->NeedToPauseNow()) {
+ return TRUE;
+ } else {
+ rows_to_go = FX_STRECH_PAUSE_ROWS;
+ }
+ }
+ FX_LPCBYTE src_scan = m_pSource->GetScanline(m_CurRow);
+ FX_LPBYTE dest_scan = m_pInterBuf + (m_CurRow - m_SrcClip.top) * m_InterPitch;
+ FX_LPCBYTE src_scan_mask = NULL;
+ FX_LPBYTE dest_scan_mask = NULL;
+ if (m_pExtraAlphaBuf) {
+ src_scan_mask = m_pSource->m_pAlphaMask->GetScanline(m_CurRow);
+ dest_scan_mask = m_pExtraAlphaBuf + (m_CurRow - m_SrcClip.top) * m_ExtraMaskPitch;
+ }
+ switch (m_TransMethod) {
+ case 1:
+ case 2: {
+ for (int col = m_DestClip.left; col < m_DestClip.right; col ++) {
+ PixelWeight* pPixelWeights = m_WeightTable.GetPixelWeight(col);
+ int dest_a = 0;
+ for (int j = pPixelWeights->m_SrcStart; j <= pPixelWeights->m_SrcEnd; j ++) {
+ int pixel_weight = pPixelWeights->m_Weights[j - pPixelWeights->m_SrcStart];
+ if (src_scan[j / 8] & (1 << (7 - j % 8))) {
+ dest_a += pixel_weight * 255;
+ }
+ }
+ if (m_Flags & FXDIB_BICUBIC_INTERPOL) {
+ dest_a = dest_a < 0 ? 0 : dest_a > 16711680 ? 16711680 : dest_a;
+ }
+ *dest_scan++ = (FX_BYTE)(dest_a >> 16);
+ }
+ break;
+ }
+ case 3: {
+ for (int col = m_DestClip.left; col < m_DestClip.right; col ++) {
+ PixelWeight* pPixelWeights = m_WeightTable.GetPixelWeight(col);
+ int dest_a = 0;
+ for (int j = pPixelWeights->m_SrcStart; j <= pPixelWeights->m_SrcEnd; j ++) {
+ int pixel_weight = pPixelWeights->m_Weights[j - pPixelWeights->m_SrcStart];
+ dest_a += pixel_weight * src_scan[j];
+ }
+ if (m_Flags & FXDIB_BICUBIC_INTERPOL) {
+ dest_a = dest_a < 0 ? 0 : dest_a > 16711680 ? 16711680 : dest_a;
+ }
+ *dest_scan++ = (FX_BYTE)(dest_a >> 16);
+ }
+ break;
+ }
+ case 4: {
+ for (int col = m_DestClip.left; col < m_DestClip.right; col ++) {
+ PixelWeight* pPixelWeights = m_WeightTable.GetPixelWeight(col);
+ int dest_a = 0, dest_r = 0;
+ for (int j = pPixelWeights->m_SrcStart; j <= pPixelWeights->m_SrcEnd; j ++) {
+ int pixel_weight = pPixelWeights->m_Weights[j - pPixelWeights->m_SrcStart];
+ pixel_weight = pixel_weight * src_scan_mask[j] / 255;
+ dest_r += pixel_weight * src_scan[j];
+ dest_a += pixel_weight;
+ }
+ if (m_Flags & FXDIB_BICUBIC_INTERPOL) {
+ dest_r = dest_r < 0 ? 0 : dest_r > 16711680 ? 16711680 : dest_r;
+ dest_a = dest_a < 0 ? 0 : dest_a > 65536 ? 65536 : dest_a;
+ }
+ *dest_scan++ = (FX_BYTE)(dest_r >> 16);
+ *dest_scan_mask++ = (FX_BYTE)((dest_a * 255) >> 16);
+ }
+ break;
+ }
+ case 5: {
+ for (int col = m_DestClip.left; col < m_DestClip.right; col ++) {
+ PixelWeight* pPixelWeights = m_WeightTable.GetPixelWeight(col);
+ int dest_r_y = 0, dest_g_m = 0, dest_b_c = 0, dest_k = 0;
+ for (int j = pPixelWeights->m_SrcStart; j <= pPixelWeights->m_SrcEnd; j ++) {
+ int pixel_weight = pPixelWeights->m_Weights[j - pPixelWeights->m_SrcStart];
+ unsigned long argb_cmyk = m_pSrcPalette[src_scan[j]];
+ if (m_DestFormat == FXDIB_Rgb) {
+ dest_r_y += pixel_weight * (FX_BYTE)(argb_cmyk >> 16);
+ dest_g_m += pixel_weight * (FX_BYTE)(argb_cmyk >> 8);
+ dest_b_c += pixel_weight * (FX_BYTE)argb_cmyk;
+ } else {
+ dest_b_c += pixel_weight * (FX_BYTE)(argb_cmyk >> 24);
+ dest_g_m += pixel_weight * (FX_BYTE)(argb_cmyk >> 16);
+ dest_r_y += pixel_weight * (FX_BYTE)(argb_cmyk >> 8);
+ }
+ }
+ if (m_Flags & FXDIB_BICUBIC_INTERPOL) {
+ dest_r_y = dest_r_y < 0 ? 0 : dest_r_y > 16711680 ? 16711680 : dest_r_y;
+ dest_g_m = dest_g_m < 0 ? 0 : dest_g_m > 16711680 ? 16711680 : dest_g_m;
+ dest_b_c = dest_b_c < 0 ? 0 : dest_b_c > 16711680 ? 16711680 : dest_b_c;
+ }
+ *dest_scan++ = (FX_BYTE)(dest_b_c >> 16);
+ *dest_scan++ = (FX_BYTE)(dest_g_m >> 16);
+ *dest_scan++ = (FX_BYTE)(dest_r_y >> 16);
+ }
+ break;
+ }
+ case 6: {
+ for (int col = m_DestClip.left; col < m_DestClip.right; col ++) {
+ PixelWeight* pPixelWeights = m_WeightTable.GetPixelWeight(col);
+ int dest_a = 0, dest_r_y = 0, dest_g_m = 0, dest_b_c = 0, dest_k = 0;
+ for (int j = pPixelWeights->m_SrcStart; j <= pPixelWeights->m_SrcEnd; j ++) {
+ int pixel_weight = pPixelWeights->m_Weights[j - pPixelWeights->m_SrcStart];
+ pixel_weight = pixel_weight * src_scan_mask[j] / 255;
+ unsigned long argb_cmyk = m_pSrcPalette[src_scan[j]];
+ if (m_DestFormat == FXDIB_Rgba) {
+ dest_r_y += pixel_weight * (FX_BYTE)(argb_cmyk >> 16);
+ dest_g_m += pixel_weight * (FX_BYTE)(argb_cmyk >> 8);
+ dest_b_c += pixel_weight * (FX_BYTE)argb_cmyk;
+ } else {
+ dest_b_c += pixel_weight * (FX_BYTE)(argb_cmyk >> 24);
+ dest_g_m += pixel_weight * (FX_BYTE)(argb_cmyk >> 16);
+ dest_r_y += pixel_weight * (FX_BYTE)(argb_cmyk >> 8);
+ }
+ dest_a += pixel_weight;
+ }
+ if (m_Flags & FXDIB_BICUBIC_INTERPOL) {
+ dest_k = dest_k < 0 ? 0 : dest_k > 16711680 ? 16711680 : dest_k;
+ dest_b_c = dest_b_c < 0 ? 0 : dest_b_c > 16711680 ? 16711680 : dest_b_c;
+ dest_g_m = dest_g_m < 0 ? 0 : dest_g_m > 16711680 ? 16711680 : dest_g_m;
+ dest_r_y = dest_r_y < 0 ? 0 : dest_r_y > 16711680 ? 16711680 : dest_r_y;
+ dest_a = dest_a < 0 ? 0 : dest_a > 65536 ? 65536 : dest_a;
+ }
+ *dest_scan++ = (FX_BYTE)(dest_b_c >> 16);
+ *dest_scan++ = (FX_BYTE)(dest_g_m >> 16);
+ *dest_scan++ = (FX_BYTE)(dest_r_y >> 16);
+ *dest_scan_mask++ = (FX_BYTE)((dest_a * 255) >> 16);
+ }
+ break;
+ }
+ case 7: {
+ for (int col = m_DestClip.left; col < m_DestClip.right; col ++) {
+ PixelWeight* pPixelWeights = m_WeightTable.GetPixelWeight(col);
+ int dest_r_y = 0, dest_g_m = 0, dest_b_c = 0, dest_k = 0;
+ for (int j = pPixelWeights->m_SrcStart; j <= pPixelWeights->m_SrcEnd; j ++) {
+ int pixel_weight = pPixelWeights->m_Weights[j - pPixelWeights->m_SrcStart];
+ FX_LPCBYTE src_pixel = src_scan + j * Bpp;
+ dest_b_c += pixel_weight * (*src_pixel++);
+ dest_g_m += pixel_weight * (*src_pixel++);
+ dest_r_y += pixel_weight * (*src_pixel);
+ }
+ if (m_Flags & FXDIB_BICUBIC_INTERPOL) {
+ dest_b_c = dest_b_c < 0 ? 0 : dest_b_c > 16711680 ? 16711680 : dest_b_c;
+ dest_g_m = dest_g_m < 0 ? 0 : dest_g_m > 16711680 ? 16711680 : dest_g_m;
+ dest_r_y = dest_r_y < 0 ? 0 : dest_r_y > 16711680 ? 16711680 : dest_r_y;
+ }
+ *dest_scan++ = (FX_BYTE)((dest_b_c) >> 16);
+ *dest_scan++ = (FX_BYTE)((dest_g_m) >> 16);
+ *dest_scan++ = (FX_BYTE)((dest_r_y) >> 16);
+ dest_scan += Bpp - 3;
+ }
+ break;
+ }
+ case 8: {
+ for (int col = m_DestClip.left; col < m_DestClip.right; col ++) {
+ PixelWeight* pPixelWeights = m_WeightTable.GetPixelWeight(col);
+ int dest_a = 0, dest_r_y = 0, dest_g_m = 0, dest_b_c = 0, dest_k = 0;
+ for (int j = pPixelWeights->m_SrcStart; j <= pPixelWeights->m_SrcEnd; j ++) {
+ int pixel_weight = pPixelWeights->m_Weights[j - pPixelWeights->m_SrcStart];
+ FX_LPCBYTE src_pixel = src_scan + j * Bpp;
+ if (m_DestFormat == FXDIB_Argb) {
+ pixel_weight = pixel_weight * src_pixel[3] / 255;
+ } else {
+ pixel_weight = pixel_weight * src_scan_mask[j] / 255;
+ }
+ dest_b_c += pixel_weight * (*src_pixel++);
+ dest_g_m += pixel_weight * (*src_pixel++);
+ dest_r_y += pixel_weight * (*src_pixel);
+ dest_a += pixel_weight;
+ }
+ if (m_Flags & FXDIB_BICUBIC_INTERPOL) {
+ dest_r_y = dest_r_y < 0 ? 0 : dest_r_y > 16711680 ? 16711680 : dest_r_y;
+ dest_g_m = dest_g_m < 0 ? 0 : dest_g_m > 16711680 ? 16711680 : dest_g_m;
+ dest_b_c = dest_b_c < 0 ? 0 : dest_b_c > 16711680 ? 16711680 : dest_b_c;
+ dest_a = dest_a < 0 ? 0 : dest_a > 65536 ? 65536 : dest_a;
+ }
+ *dest_scan++ = (FX_BYTE)((dest_b_c) >> 16);
+ *dest_scan++ = (FX_BYTE)((dest_g_m) >> 16);
+ *dest_scan++ = (FX_BYTE)((dest_r_y) >> 16);
+ if (m_DestFormat == FXDIB_Argb) {
+ *dest_scan = (FX_BYTE)((dest_a * 255) >> 16);
+ }
+ if (dest_scan_mask) {
+ *dest_scan_mask++ = (FX_BYTE)((dest_a * 255) >> 16);
+ }
+ dest_scan += Bpp - 3;
+ }
+ break;
+ }
+ }
+ rows_to_go --;
+ }
+ return FALSE;
+}
+void CStretchEngine::StretchVert()
+{
+ if (m_DestHeight == 0) {
+ return;
+ }
+ CWeightTable table;
+ table.Calc(m_DestHeight, m_DestClip.top, m_DestClip.bottom, m_SrcHeight, m_SrcClip.top, m_SrcClip.bottom, m_Flags);
+ if (table.m_pWeightTables == NULL) {
+ return;
+ }
+ int DestBpp = m_DestBpp / 8;
+ for (int row = m_DestClip.top; row < m_DestClip.bottom; row ++) {
+ unsigned char* dest_scan = m_pDestScanline;
+ unsigned char* dest_sacn_mask = m_pDestMaskScanline;
+ PixelWeight* pPixelWeights = table.GetPixelWeight(row);
+ switch(m_TransMethod) {
+ case 1:
+ case 2:
+ case 3: {
+ for (int col = m_DestClip.left; col < m_DestClip.right; col ++) {
+ unsigned char* src_scan = m_pInterBuf + (col - m_DestClip.left) * DestBpp;
+ int dest_a = 0;
+ for (int j = pPixelWeights->m_SrcStart; j <= pPixelWeights->m_SrcEnd; j ++) {
+ int pixel_weight = pPixelWeights->m_Weights[j - pPixelWeights->m_SrcStart];
+ dest_a += pixel_weight * src_scan[(j - m_SrcClip.top) * m_InterPitch];
+ }
+ if (m_Flags & FXDIB_BICUBIC_INTERPOL) {
+ dest_a = dest_a < 0 ? 0 : dest_a > 16711680 ? 16711680 : dest_a;
+ }
+ *dest_scan = (FX_BYTE)(dest_a >> 16);
+ dest_scan += DestBpp;
+ }
+ break;
+ }
+ case 4: {
+ for (int col = m_DestClip.left; col < m_DestClip.right; col ++) {
+ unsigned char* src_scan = m_pInterBuf + (col - m_DestClip.left) * DestBpp;
+ unsigned char* src_scan_mask = m_pExtraAlphaBuf + (col - m_DestClip.left);
+ int dest_a = 0, dest_k = 0;
+ for (int j = pPixelWeights->m_SrcStart; j <= pPixelWeights->m_SrcEnd; j ++) {
+ int pixel_weight = pPixelWeights->m_Weights[j - pPixelWeights->m_SrcStart];
+ dest_k += pixel_weight * src_scan[(j - m_SrcClip.top) * m_InterPitch];
+ dest_a += pixel_weight * src_scan_mask[(j - m_SrcClip.top) * m_ExtraMaskPitch];
+ }
+ if (m_Flags & FXDIB_BICUBIC_INTERPOL) {
+ dest_k = dest_k < 0 ? 0 : dest_k > 16711680 ? 16711680 : dest_k;
+ dest_a = dest_a < 0 ? 0 : dest_a > 16711680 ? 16711680 : dest_a;
+ }
+ *dest_scan = (FX_BYTE)(dest_k >> 16);
+ dest_scan += DestBpp;
+ *dest_sacn_mask++ = (FX_BYTE)(dest_a >> 16);
+ }
+ break;
+ }
+ case 5:
+ case 7: {
+ for (int col = m_DestClip.left; col < m_DestClip.right; col ++) {
+ unsigned char* src_scan = m_pInterBuf + (col - m_DestClip.left) * DestBpp;
+ int dest_r_y = 0, dest_g_m = 0, dest_b_c = 0, dest_k = 0;
+ for (int j = pPixelWeights->m_SrcStart; j <= pPixelWeights->m_SrcEnd; j ++) {
+ int pixel_weight = pPixelWeights->m_Weights[j - pPixelWeights->m_SrcStart];
+ FX_LPCBYTE src_pixel = src_scan + (j - m_SrcClip.top) * m_InterPitch;
+ dest_b_c += pixel_weight * (*src_pixel++);
+ dest_g_m += pixel_weight * (*src_pixel++);
+ dest_r_y += pixel_weight * (*src_pixel);
+ }
+ if (m_Flags & FXDIB_BICUBIC_INTERPOL) {
+ dest_r_y = dest_r_y < 0 ? 0 : dest_r_y > 16711680 ? 16711680 : dest_r_y;
+ dest_g_m = dest_g_m < 0 ? 0 : dest_g_m > 16711680 ? 16711680 : dest_g_m;
+ dest_b_c = dest_b_c < 0 ? 0 : dest_b_c > 16711680 ? 16711680 : dest_b_c;
+ }
+ dest_scan[0] = (FX_BYTE)((dest_b_c) >> 16);
+ dest_scan[1] = (FX_BYTE)((dest_g_m) >> 16);
+ dest_scan[2] = (FX_BYTE)((dest_r_y) >> 16);
+ dest_scan += DestBpp;
+ }
+ break;
+ }
+ case 6:
+ case 8: {
+ for (int col = m_DestClip.left; col < m_DestClip.right; col ++) {
+ unsigned char* src_scan = m_pInterBuf + (col - m_DestClip.left) * DestBpp;
+ unsigned char* src_scan_mask = NULL;
+ if (m_DestFormat != FXDIB_Argb) {
+ src_scan_mask = m_pExtraAlphaBuf + (col - m_DestClip.left);
+ }
+ int dest_a = 0, dest_k = 0, dest_r_y = 0, dest_g_m = 0, dest_b_c = 0;
+ for (int j = pPixelWeights->m_SrcStart; j <= pPixelWeights->m_SrcEnd; j ++) {
+ int pixel_weight = pPixelWeights->m_Weights[j - pPixelWeights->m_SrcStart];
+ FX_LPCBYTE src_pixel = src_scan + (j - m_SrcClip.top) * m_InterPitch;
+ int mask_v = 255;
+ if (src_scan_mask) {
+ mask_v = src_scan_mask[(j - m_SrcClip.top) * m_ExtraMaskPitch];
+ }
+ dest_b_c += pixel_weight * (*src_pixel++);
+ dest_g_m += pixel_weight * (*src_pixel++);
+ dest_r_y += pixel_weight * (*src_pixel);
+ if (m_DestFormat == FXDIB_Argb) {
+ dest_a += pixel_weight * (*(src_pixel + 1));
+ } else {
+ dest_a += pixel_weight * mask_v;
+ }
+ }
+ if (m_Flags & FXDIB_BICUBIC_INTERPOL) {
+ dest_r_y = dest_r_y < 0 ? 0 : dest_r_y > 16711680 ? 16711680 : dest_r_y;
+ dest_g_m = dest_g_m < 0 ? 0 : dest_g_m > 16711680 ? 16711680 : dest_g_m;
+ dest_b_c = dest_b_c < 0 ? 0 : dest_b_c > 16711680 ? 16711680 : dest_b_c;
+ dest_a = dest_a < 0 ? 0 : dest_a > 16711680 ? 16711680 : dest_a;
+ }
+ if (dest_a) {
+ int r = ((FX_DWORD)dest_r_y) * 255 / dest_a;
+ int g = ((FX_DWORD)dest_g_m) * 255 / dest_a;
+ int b = ((FX_DWORD)dest_b_c) * 255 / dest_a;
+ dest_scan[0] = b > 255 ? 255 : b < 0 ? 0 : b;
+ dest_scan[1] = g > 255 ? 255 : g < 0 ? 0 : g;
+ dest_scan[2] = r > 255 ? 255 : r < 0 ? 0 : r;
+ }
+ if (m_DestFormat == FXDIB_Argb) {
+ dest_scan[3] = (FX_BYTE)((dest_a) >> 16);
+ } else {
+ *dest_sacn_mask = (FX_BYTE)((dest_a) >> 16);
+ }
+ dest_scan += DestBpp;
+ if (dest_sacn_mask) {
+ dest_sacn_mask++;
+ }
+ }
+ break;
+ }
+ }
+ m_pDestBitmap->ComposeScanline(row - m_DestClip.top, m_pDestScanline, m_pDestMaskScanline);
+ }
+}
+CFX_ImageStretcher::CFX_ImageStretcher()
+{
+ m_pScanline = NULL;
+ m_pStretchEngine = NULL;
+ m_pMaskScanline = NULL;
+}
+CFX_ImageStretcher::~CFX_ImageStretcher()
+{
+ if (m_pScanline) {
+ FX_Free(m_pScanline);
+ }
+ if (m_pStretchEngine) {
+ delete m_pStretchEngine;
+ }
+ if (m_pMaskScanline) {
+ FX_Free(m_pMaskScanline);
+ }
+}
+FXDIB_Format _GetStretchedFormat(const CFX_DIBSource* pSrc)
+{
+ FXDIB_Format format = pSrc->GetFormat();
+ if (format == FXDIB_1bppMask) {
+ format = FXDIB_8bppMask;
+ } else if (format == FXDIB_1bppRgb) {
+ format = FXDIB_8bppRgb;
+ } else if (format == FXDIB_8bppRgb) {
+ if (pSrc->GetPalette()) {
+ format = FXDIB_Rgb;
+ }
+ }
+ return format;
+}
+FX_BOOL CFX_ImageStretcher::Start(IFX_ScanlineComposer* pDest,
+ const CFX_DIBSource* pSource, int dest_width, int dest_height,
+ const FX_RECT& rect, FX_DWORD flags)
+{
+ m_DestFormat = _GetStretchedFormat(pSource);
+ m_DestBPP = m_DestFormat & 0xff;
+ m_pDest = pDest;
+ m_pSource = pSource;
+ m_DestWidth = dest_width;
+ m_DestHeight = dest_height;
+ m_ClipRect = rect;
+ m_Flags = flags;
+ if (pSource->GetFormat() == FXDIB_1bppRgb && pSource->GetPalette()) {
+ FX_ARGB pal[256];
+ int a0, r0, g0, b0, a1, r1, g1, b1;
+ ArgbDecode(pSource->GetPaletteEntry(0), a0, r0, g0, b0);
+ ArgbDecode(pSource->GetPaletteEntry(1), a1, r1, g1, b1);
+ for (int i = 0; i < 256; i ++) {
+ int a = a0 + (a1 - a0) * i / 255;
+ int r = r0 + (r1 - r0) * i / 255;
+ int g = g0 + (g1 - g0) * i / 255;
+ int b = b0 + (b1 - b0) * i / 255;
+ pal[i] = ArgbEncode(a, r, g, b);
+ }
+ if (!pDest->SetInfo(rect.Width(), rect.Height(), m_DestFormat, pal)) {
+ return FALSE;
+ }
+ } else if (pSource->GetFormat() == FXDIB_1bppCmyk && pSource->GetPalette()) {
+ FX_CMYK pal[256];
+ int c0, m0, y0, k0, c1, m1, y1, k1;
+ CmykDecode(pSource->GetPaletteEntry(0), c0, m0, y0, k0);
+ CmykDecode(pSource->GetPaletteEntry(1), c1, m1, y1, k1);
+ for (int i = 0; i < 256; i ++) {
+ int c = c0 + (c1 - c0) * i / 255;
+ int m = m0 + (m1 - m0) * i / 255;
+ int y = y0 + (y1 - y0) * i / 255;
+ int k = k0 + (k1 - k0) * i / 255;
+ pal[i] = CmykEncode(c, m, y, k);
+ }
+ if (!pDest->SetInfo(rect.Width(), rect.Height(), m_DestFormat, pal)) {
+ return FALSE;
+ }
+ } else if (!pDest->SetInfo(rect.Width(), rect.Height(), m_DestFormat, NULL)) {
+ return FALSE;
+ }
+ if (flags & FXDIB_DOWNSAMPLE) {
+ return StartQuickStretch();
+ } else {
+ return StartStretch();
+ }
+}
+FX_BOOL CFX_ImageStretcher::Continue(IFX_Pause* pPause)
+{
+ if (m_Flags & FXDIB_DOWNSAMPLE) {
+ return ContinueQuickStretch(pPause);
+ } else {
+ return ContinueStretch(pPause);
+ }
+}
+#ifndef _FPDFAPI_MINI_
+#define MAX_PROGRESSIVE_STRETCH_PIXELS 1000000
+#else
+#define MAX_PROGRESSIVE_STRETCH_PIXELS 100000
+#endif
+FX_BOOL CFX_ImageStretcher::StartStretch()
+{
+ m_pStretchEngine = FX_NEW CStretchEngine(m_pDest, m_DestFormat, m_DestWidth, m_DestHeight, m_ClipRect, m_pSource, m_Flags);
+ if (!m_pStretchEngine) {
+ return FALSE;
+ }
+ m_pStretchEngine->StartStretchHorz();
+ if (m_pSource->GetWidth() * m_pSource->GetHeight() < MAX_PROGRESSIVE_STRETCH_PIXELS) {
+ m_pStretchEngine->Continue(NULL);
+ return FALSE;
+ }
+ return TRUE;
+}
+FX_BOOL CFX_ImageStretcher::ContinueStretch(IFX_Pause* pPause)
+{
+ if (m_pStretchEngine == NULL) {
+ return FALSE;
+ }
+ return m_pStretchEngine->Continue(pPause);
+}
+FX_BOOL CFX_ImageStretcher::StartQuickStretch()
+{
+#ifdef _FPDFAPI_MINI_
+ m_pSource->SetDownSampleSize(m_DestWidth, m_DestHeight);
+#endif
+ m_bFlipX = FALSE;
+ m_bFlipY = FALSE;
+ if (m_DestWidth < 0) {
+ m_bFlipX = TRUE;
+ m_DestWidth = -m_DestWidth;
+ }
+ if (m_DestHeight < 0) {
+ m_bFlipY = TRUE;
+ m_DestHeight = -m_DestHeight;
+ }
+ m_LineIndex = 0;
+ FX_DWORD size = m_ClipRect.Width();
+ if (size && m_DestBPP > (int)(INT_MAX / size)) {
+ return FALSE;
+ }
+ size *= m_DestBPP;
+ m_pScanline = FX_Alloc(FX_BYTE, (size / 8 + 3) / 4 * 4);
+ if (!m_pScanline) {
+ return FALSE;
+ }
+ if (m_pSource->m_pAlphaMask) {
+ m_pMaskScanline = FX_Alloc(FX_BYTE, (m_ClipRect.Width() + 3) / 4 * 4);
+ if (!m_pMaskScanline) {
+ return FALSE;
+ }
+ }
+ if (m_pSource->GetWidth() * m_pSource->GetHeight() < MAX_PROGRESSIVE_STRETCH_PIXELS) {
+ ContinueQuickStretch(NULL);
+ return FALSE;
+ }
+ return TRUE;
+}
+FX_BOOL CFX_ImageStretcher::ContinueQuickStretch(IFX_Pause* pPause)
+{
+ if (m_pScanline == NULL) {
+ return FALSE;
+ }
+ int result_width = m_ClipRect.Width(), result_height = m_ClipRect.Height();
+ int src_width = m_pSource->GetWidth(), src_height = m_pSource->GetHeight();
+ for (; m_LineIndex < result_height; m_LineIndex ++) {
+ int dest_y, src_y;
+ if (m_bFlipY) {
+ dest_y = result_height - m_LineIndex - 1;
+ src_y = (m_DestHeight - (dest_y + m_ClipRect.top) - 1) * src_height / m_DestHeight;
+ } else {
+ dest_y = m_LineIndex;
+ src_y = (dest_y + m_ClipRect.top) * src_height / m_DestHeight;
+ }
+ if (src_y >= src_height) {
+ src_y = src_height - 1;
+ }
+ if (src_y < 0) {
+ src_y = 0;
+ }
+ if (m_pSource->SkipToScanline(src_y, pPause)) {
+ return TRUE;
+ }
+ m_pSource->DownSampleScanline(src_y, m_pScanline, m_DestBPP, m_DestWidth, m_bFlipX, m_ClipRect.left, result_width);
+ FX_LPBYTE scan_extra_alpha = NULL;
+ if (m_pMaskScanline) {
+ m_pSource->m_pAlphaMask->DownSampleScanline(src_y, m_pMaskScanline, 1, m_DestWidth, m_bFlipX, m_ClipRect.left, result_width);
+ }
+ m_pDest->ComposeScanline(dest_y, m_pScanline, m_pMaskScanline);
+ }
+ return FALSE;
+}
diff --git a/core/src/fxge/dib/fx_dib_main.cpp b/core/src/fxge/dib/fx_dib_main.cpp
index 0953f2d2e5..9b27a13daf 100644
--- a/core/src/fxge/dib/fx_dib_main.cpp
+++ b/core/src/fxge/dib/fx_dib_main.cpp
@@ -1,1734 +1,1734 @@
-// 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
-
-#include "../../../include/fxge/fx_dib.h"
-#include "../../../include/fxge/fx_ge.h"
-#include "../../../include/fxcodec/fx_codec.h"
-#include "dib_int.h"
-#include <limits.h>
-FX_BOOL ConvertBuffer(FXDIB_Format dest_format, FX_LPBYTE dest_buf, int dest_pitch, int width, int height,
- const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, FX_DWORD*& pal, void* pIccTransform);
-void CmykDecode(FX_DWORD cmyk, int& c, int& m, int& y, int& k)
-{
- c = FXSYS_GetCValue(cmyk);
- m = FXSYS_GetMValue(cmyk);
- y = FXSYS_GetYValue(cmyk);
- k = FXSYS_GetKValue(cmyk);
-}
-void ArgbDecode(FX_DWORD argb, int& a, int& r, int& g, int& b)
-{
- a = FXARGB_A(argb);
- r = FXARGB_R(argb);
- g = FXARGB_G(argb);
- b = FXARGB_B(argb);
-}
-void ArgbDecode(FX_DWORD argb, int& a, FX_COLORREF& rgb)
-{
- a = FXARGB_A(argb);
- rgb = FXSYS_RGB(FXARGB_R(argb), FXARGB_G(argb), FXARGB_B(argb));
-}
-FX_DWORD ArgbEncode(int a, FX_COLORREF rgb)
-{
- return FXARGB_MAKE(a, FXSYS_GetRValue(rgb), FXSYS_GetGValue(rgb), FXSYS_GetBValue(rgb));
-}
-CFX_DIBSource::CFX_DIBSource()
-{
- m_bpp = 0;
- m_AlphaFlag = 0;
- m_Width = m_Height = 0;
- m_Pitch = 0;
- m_pPalette = NULL;
- m_pAlphaMask = NULL;
-}
-CFX_DIBSource::~CFX_DIBSource()
-{
- if (m_pPalette) {
- FX_Free(m_pPalette);
- }
- if (m_pAlphaMask) {
- delete m_pAlphaMask;
- }
-}
-CFX_DIBitmap::CFX_DIBitmap()
-{
- m_bExtBuf = FALSE;
- m_pBuffer = NULL;
- m_pPalette = NULL;
-}
-#define _MAX_OOM_LIMIT_ 12000000
-FX_BOOL CFX_DIBitmap::Create(int width, int height, FXDIB_Format format, FX_LPBYTE pBuffer, int pitch)
-{
- m_pBuffer = NULL;
- m_bpp = (FX_BYTE)format;
- m_AlphaFlag = (FX_BYTE)(format >> 8);
- m_Width = m_Height = m_Pitch = 0;
- if (width <= 0 || height <= 0 || pitch < 0) {
- return FALSE;
- }
- if ((INT_MAX - 31) / width < (format & 0xff)) {
- return FALSE;
- }
- if (!pitch) {
- pitch = (width * (format & 0xff) + 31) / 32 * 4;
- }
- if ((1 << 30) / pitch < height) {
- return FALSE;
- }
- if (pBuffer) {
- m_pBuffer = pBuffer;
- m_bExtBuf = TRUE;
- } else {
- int size = pitch * height + 4;
- int oomlimit = _MAX_OOM_LIMIT_;
- if (oomlimit >= 0 && size >= oomlimit) {
- m_pBuffer = FX_AllocNL(FX_BYTE, size);
- } else {
- m_pBuffer = FX_Alloc(FX_BYTE, size);
- }
- if (m_pBuffer == NULL) {
- return FALSE;
- }
- FXSYS_memset32(m_pBuffer, 0, sizeof (FX_BYTE) * size);
- }
- m_Width = width;
- m_Height = height;
- m_Pitch = pitch;
- if (HasAlpha() && format != FXDIB_Argb) {
- FX_BOOL ret = TRUE;
- ret = BuildAlphaMask();
- if (!ret) {
- if (!m_bExtBuf && m_pBuffer) {
- FX_Free(m_pBuffer);
- m_pBuffer = NULL;
- m_Width = m_Height = m_Pitch = 0;
- return FALSE;
- }
- }
- }
- return TRUE;
-}
-FX_BOOL CFX_DIBitmap::Copy(const CFX_DIBSource* pSrc)
-{
- if (m_pBuffer) {
- return FALSE;
- }
- if (!Create(pSrc->GetWidth(), pSrc->GetHeight(), pSrc->GetFormat())) {
- return FALSE;
- }
- CopyPalette(pSrc->GetPalette());
- CopyAlphaMask(pSrc->m_pAlphaMask);
- for (int row = 0; row < pSrc->GetHeight(); row ++) {
- FXSYS_memcpy32(m_pBuffer + row * m_Pitch, pSrc->GetScanline(row), m_Pitch);
- }
- return TRUE;
-}
-CFX_DIBitmap::~CFX_DIBitmap()
-{
- if (m_pBuffer && !m_bExtBuf) {
- FX_Free(m_pBuffer);
- }
- m_pBuffer = NULL;
-}
-void CFX_DIBitmap::TakeOver(CFX_DIBitmap* pSrcBitmap)
-{
- if (m_pBuffer && !m_bExtBuf) {
- FX_Free(m_pBuffer);
- }
- if (m_pPalette) {
- FX_Free(m_pPalette);
- }
- if (m_pAlphaMask) {
- delete m_pAlphaMask;
- }
- m_pBuffer = pSrcBitmap->m_pBuffer;
- m_pPalette = pSrcBitmap->m_pPalette;
- m_pAlphaMask = pSrcBitmap->m_pAlphaMask;
- pSrcBitmap->m_pBuffer = NULL;
- pSrcBitmap->m_pPalette = NULL;
- pSrcBitmap->m_pAlphaMask = NULL;
- m_bpp = pSrcBitmap->m_bpp;
- m_bExtBuf = pSrcBitmap->m_bExtBuf;
- m_AlphaFlag = pSrcBitmap->m_AlphaFlag;
- m_Width = pSrcBitmap->m_Width;
- m_Height = pSrcBitmap->m_Height;
- m_Pitch = pSrcBitmap->m_Pitch;
-}
-CFX_DIBitmap* CFX_DIBSource::Clone(const FX_RECT* pClip) const
-{
- FX_RECT rect(0, 0, m_Width, m_Height);
- if (pClip) {
- rect.Intersect(*pClip);
- if (rect.IsEmpty()) {
- return NULL;
- }
- }
- CFX_DIBitmap* pNewBitmap = FX_NEW CFX_DIBitmap;
- if (!pNewBitmap) {
- return NULL;
- }
- if (!pNewBitmap->Create(rect.Width(), rect.Height(), GetFormat())) {
- delete pNewBitmap;
- return NULL;
- }
- pNewBitmap->CopyPalette(m_pPalette);
- pNewBitmap->CopyAlphaMask(m_pAlphaMask, pClip);
- if (GetBPP() == 1 && rect.left % 8 != 0) {
- int left_shift = rect.left % 32;
- int right_shift = 32 - left_shift;
- int dword_count = pNewBitmap->m_Pitch / 4;
- for (int row = rect.top; row < rect.bottom; row ++) {
- FX_DWORD* src_scan = (FX_DWORD*)GetScanline(row) + rect.left / 32;
- FX_DWORD* dest_scan = (FX_DWORD*)pNewBitmap->GetScanline(row - rect.top);
- for (int i = 0; i < dword_count; i ++) {
- dest_scan[i] = (src_scan[i] << left_shift) | (src_scan[i + 1] >> right_shift);
- }
- }
- } else {
- int copy_len = (pNewBitmap->GetWidth() * pNewBitmap->GetBPP() + 7) / 8;
- if (m_Pitch < (FX_DWORD)copy_len) {
- copy_len = m_Pitch;
- }
- for (int row = rect.top; row < rect.bottom; row ++) {
- FX_LPCBYTE src_scan = GetScanline(row) + rect.left * m_bpp / 8;
- FX_LPBYTE dest_scan = (FX_LPBYTE)pNewBitmap->GetScanline(row - rect.top);
- FXSYS_memcpy32(dest_scan, src_scan, copy_len);
- }
- }
- return pNewBitmap;
-}
-void CFX_DIBSource::BuildPalette()
-{
- if (m_pPalette) {
- return;
- }
- if (GetBPP() == 1) {
- m_pPalette = FX_Alloc(FX_DWORD, 2);
- if (!m_pPalette) {
- return;
- }
- if(IsCmykImage()) {
- m_pPalette[0] = 0xff;
- m_pPalette[1] = 0;
- } else {
- m_pPalette[0] = 0xff000000;
- m_pPalette[1] = 0xffffffff;
- }
- } else if (GetBPP() == 8) {
- m_pPalette = FX_Alloc(FX_DWORD, 256);
- if (!m_pPalette) {
- return;
- }
- if(IsCmykImage()) {
- for (int i = 0; i < 256; i ++) {
- m_pPalette[i] = 0xff - i;
- }
- } else {
- for (int i = 0; i < 256; i ++) {
- m_pPalette[i] = 0xff000000 | (i * 0x10101);
- }
- }
- }
-}
-FX_BOOL CFX_DIBSource::BuildAlphaMask()
-{
- if (m_pAlphaMask) {
- return TRUE;
- }
- m_pAlphaMask = FX_NEW CFX_DIBitmap;
- if (!m_pAlphaMask) {
- return FALSE;
- }
- if (!m_pAlphaMask->Create(m_Width, m_Height, FXDIB_8bppMask)) {
- delete m_pAlphaMask;
- m_pAlphaMask = NULL;
- return FALSE;
- }
- FXSYS_memset8(m_pAlphaMask->GetBuffer(), 0xff, m_pAlphaMask->GetHeight()*m_pAlphaMask->GetPitch());
- return TRUE;
-}
-FX_DWORD CFX_DIBSource::GetPaletteEntry(int index) const
-{
- ASSERT((GetBPP() == 1 || GetBPP() == 8) && !IsAlphaMask());
- if (m_pPalette) {
- return m_pPalette[index];
- }
- if (IsCmykImage()) {
- if (GetBPP() == 1) {
- return index ? 0 : 0xff;
- }
- return 0xff - index;
- }
- if (GetBPP() == 1) {
- return index ? 0xffffffff : 0xff000000;
- }
- return index * 0x10101 | 0xff000000;
-}
-void CFX_DIBSource::SetPaletteEntry(int index, FX_DWORD color)
-{
- ASSERT((GetBPP() == 1 || GetBPP() == 8) && !IsAlphaMask());
- if (m_pPalette == NULL) {
- BuildPalette();
- }
- m_pPalette[index] = color;
-}
-int CFX_DIBSource::FindPalette(FX_DWORD color) const
-{
- ASSERT((GetBPP() == 1 || GetBPP() == 8) && !IsAlphaMask());
- if (m_pPalette == NULL) {
- if (IsCmykImage()) {
- if (GetBPP() == 1) {
- return ((FX_BYTE)color == 0xff) ? 0 : 1;
- }
- return 0xff - (FX_BYTE)color;
- }
- if (GetBPP() == 1) {
- return ((FX_BYTE)color == 0xff) ? 1 : 0;
- }
- return (FX_BYTE)color;
- }
- int palsize = (1 << GetBPP());
- for (int i = 0; i < palsize; i ++)
- if (m_pPalette[i] == color) {
- return i;
- }
- return -1;
-}
-void CFX_DIBitmap::Clear(FX_DWORD color)
-{
- if (m_pBuffer == NULL) {
- return;
- }
- switch (GetFormat()) {
- case FXDIB_1bppMask:
- FXSYS_memset8(m_pBuffer, (color & 0xff000000) ? 0xff : 0, m_Pitch * m_Height);
- break;
- case FXDIB_1bppRgb: {
- int index = FindPalette(color);
- FXSYS_memset8(m_pBuffer, index ? 0xff : 0, m_Pitch * m_Height);
- break;
- }
- case FXDIB_8bppMask:
- FXSYS_memset8(m_pBuffer, color >> 24, m_Pitch * m_Height);
- break;
- case FXDIB_8bppRgb: {
- int index = FindPalette(color);
- FXSYS_memset8(m_pBuffer, index, m_Pitch * m_Height);
- break;
- }
- case FXDIB_Rgb:
- case FXDIB_Rgba: {
- int a, r, g, b;
- ArgbDecode(color, a, r, g, b);
- if (r == g && g == b) {
- FXSYS_memset8(m_pBuffer, r, m_Pitch * m_Height);
- } else {
- int byte_pos = 0;
- for (int col = 0; col < m_Width; col ++) {
- m_pBuffer[byte_pos++] = b;
- m_pBuffer[byte_pos++] = g;
- m_pBuffer[byte_pos++] = r;
- }
- for (int row = 1; row < m_Height; row ++) {
- FXSYS_memcpy32(m_pBuffer + row * m_Pitch, m_pBuffer, m_Pitch);
- }
- }
- break;
- }
- case FXDIB_Rgb32:
- case FXDIB_Argb: {
- color = IsCmykImage() ? FXCMYK_TODIB(color) : FXARGB_TODIB(color);
- for (int i = 0; i < m_Width; i ++) {
- ((FX_DWORD*)m_pBuffer)[i] = color;
- }
- for (int row = 1; row < m_Height; row ++) {
- FXSYS_memcpy32(m_pBuffer + row * m_Pitch, m_pBuffer, m_Pitch);
- }
- break;
- }
- default:
- break;
- }
-}
-void CFX_DIBSource::GetOverlapRect(int& dest_left, int& dest_top, int& width, int& height,
- int src_width, int src_height, int& src_left, int& src_top,
- const CFX_ClipRgn* pClipRgn)
-{
- if (width == 0 || height == 0) {
- return;
- }
- ASSERT(width > 0 && height > 0);
- if (dest_left > m_Width || dest_top > m_Height) {
- width = 0;
- height = 0;
- return;
- }
- int x_offset = dest_left - src_left;
- int y_offset = dest_top - src_top;
- FX_RECT src_rect(src_left, src_top, src_left + width, src_top + height);
- FX_RECT src_bound(0, 0, src_width, src_height);
- src_rect.Intersect(src_bound);
- FX_RECT dest_rect(src_rect.left + x_offset, src_rect.top + y_offset,
- src_rect.right + x_offset, src_rect.bottom + y_offset);
- FX_RECT dest_bound(0, 0, m_Width, m_Height);
- dest_rect.Intersect(dest_bound);
- if (pClipRgn) {
- dest_rect.Intersect(pClipRgn->GetBox());
- }
- dest_left = dest_rect.left;
- dest_top = dest_rect.top;
- src_left = dest_left - x_offset;
- src_top = dest_top - y_offset;
- width = dest_rect.right - dest_rect.left;
- height = dest_rect.bottom - dest_rect.top;
-}
-FX_BOOL CFX_DIBitmap::TransferBitmap(int dest_left, int dest_top, int width, int height,
- const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform)
-{
- if (m_pBuffer == NULL) {
- return FALSE;
- }
- GetOverlapRect(dest_left, dest_top, width, height, pSrcBitmap->GetWidth(), pSrcBitmap->GetHeight(), src_left, src_top, NULL);
- if (width == 0 || height == 0) {
- return TRUE;
- }
- FXDIB_Format dest_format = GetFormat();
- FXDIB_Format src_format = pSrcBitmap->GetFormat();
- if (dest_format == src_format && pIccTransform == NULL) {
- if (GetBPP() == 1) {
- for (int row = 0; row < height; row ++) {
- FX_LPBYTE dest_scan = m_pBuffer + (dest_top + row) * m_Pitch;
- FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row);
- for (int col = 0; col < width; col ++) {
- if (src_scan[(src_left + col) / 8] & (1 << (7 - (src_left + col) % 8))) {
- dest_scan[(dest_left + col) / 8] |= 1 << (7 - (dest_left + col) % 8);
- } else {
- dest_scan[(dest_left + col) / 8] &= ~(1 << (7 - (dest_left + col) % 8));
- }
- }
- }
- } else {
- int Bpp = GetBPP() / 8;
- for (int row = 0; row < height; row ++) {
- FX_LPBYTE dest_scan = m_pBuffer + (dest_top + row) * m_Pitch + dest_left * Bpp;
- FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left * Bpp;
- FXSYS_memcpy32(dest_scan, src_scan, width * Bpp);
- }
- }
- } else {
- if (m_pPalette) {
- return FALSE;
- }
- if (m_bpp == 8) {
- dest_format = FXDIB_8bppMask;
- }
- FX_LPBYTE dest_buf = m_pBuffer + dest_top * m_Pitch + dest_left * GetBPP() / 8;
- FX_DWORD* d_plt = NULL;
- if(!ConvertBuffer(dest_format, dest_buf, m_Pitch, width, height, pSrcBitmap, src_left, src_top, d_plt, pIccTransform)) {
- return FALSE;
- }
- }
- return TRUE;
-}
-#ifndef _FPDFAPI_MINI_
-FX_BOOL CFX_DIBitmap::TransferMask(int dest_left, int dest_top, int width, int height,
- const CFX_DIBSource* pMask, FX_DWORD color, int src_left, int src_top, int alpha_flag, void* pIccTransform)
-{
- if (m_pBuffer == NULL) {
- return FALSE;
- }
- ASSERT(HasAlpha() && (m_bpp >= 24));
- ASSERT(pMask->IsAlphaMask());
- if (!HasAlpha() || !pMask->IsAlphaMask() || m_bpp < 24) {
- return FALSE;
- }
- GetOverlapRect(dest_left, dest_top, width, height, pMask->GetWidth(), pMask->GetHeight(), src_left, src_top, NULL);
- if (width == 0 || height == 0) {
- return TRUE;
- }
- int src_pitch = pMask->GetPitch();
- int src_bpp = pMask->GetBPP();
- int alpha;
- FX_DWORD dst_color;
- if (alpha_flag >> 8) {
- alpha = alpha_flag & 0xff;
- dst_color = FXCMYK_TODIB(color);
- } else {
- alpha = FXARGB_A(color);
- dst_color = FXARGB_TODIB(color);
- }
- FX_LPBYTE color_p = (FX_LPBYTE)&dst_color;
- if (pIccTransform && CFX_GEModule::Get()->GetCodecModule() && CFX_GEModule::Get()->GetCodecModule()->GetIccModule()) {
- ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
- pIccModule->TranslateScanline(pIccTransform, color_p, color_p, 1);
- } else {
- if (alpha_flag >> 8 && !IsCmykImage())
- AdobeCMYK_to_sRGB1(FXSYS_GetCValue(color), FXSYS_GetMValue(color), FXSYS_GetYValue(color), FXSYS_GetKValue(color),
- color_p[2], color_p[1], color_p[0]);
- else if (!(alpha_flag >> 8) && IsCmykImage()) {
- return FALSE;
- }
- }
- if(!IsCmykImage()) {
- color_p[3] = (FX_BYTE)alpha;
- }
- if (GetFormat() == FXDIB_Argb) {
- for (int row = 0; row < height; row ++) {
- FX_DWORD* dest_pos = (FX_DWORD*)(m_pBuffer + (dest_top + row) * m_Pitch + dest_left * 4);
- FX_LPCBYTE src_scan = pMask->GetScanline(src_top + row);
- if (src_bpp == 1) {
- for (int col = 0; col < width; col ++) {
- int src_bitpos = src_left + col;
- if (src_scan[src_bitpos / 8] & (1 << (7 - src_bitpos % 8))) {
- *dest_pos = dst_color;
- } else {
- *dest_pos = 0;
- }
- dest_pos ++;
- }
- } else {
- src_scan += src_left;
- dst_color = FXARGB_TODIB(dst_color);
- dst_color &= 0xffffff;
- for (int col = 0; col < width; col ++) {
- FXARGB_SETDIB(dest_pos++, dst_color | ((alpha * (*src_scan++) / 255) << 24));
- }
- }
- }
- } else {
- int comps = m_bpp / 8;
- for (int row = 0; row < height; row ++) {
- FX_LPBYTE dest_color_pos = m_pBuffer + (dest_top + row) * m_Pitch + dest_left * comps;
- FX_LPBYTE dest_alpha_pos = (FX_LPBYTE)m_pAlphaMask->GetScanline(dest_top + row) + dest_left;
- FX_LPCBYTE src_scan = pMask->GetScanline(src_top + row);
- if (src_bpp == 1) {
- for (int col = 0; col < width; col ++) {
- int src_bitpos = src_left + col;
- if (src_scan[src_bitpos / 8] & (1 << (7 - src_bitpos % 8))) {
- FXSYS_memcpy32(dest_color_pos, color_p, comps);
- *dest_alpha_pos = 0xff;
- } else {
- FXSYS_memset32(dest_color_pos, 0, comps);
- *dest_alpha_pos = 0;
- }
- dest_color_pos += comps;
- dest_alpha_pos ++;
- }
- } else {
- src_scan += src_left;
- for (int col = 0; col < width; col ++) {
- FXSYS_memcpy32(dest_color_pos, color_p, comps);
- dest_color_pos += comps;
- *dest_alpha_pos++ = (alpha * (*src_scan++) / 255);
- }
- }
- }
- }
- return TRUE;
-}
-#endif
-void CFX_DIBSource::CopyPalette(const FX_DWORD* pSrc, FX_DWORD size)
-{
- if (pSrc == NULL || GetBPP() > 8) {
- if (m_pPalette) {
- FX_Free(m_pPalette);
- }
- m_pPalette = NULL;
- } else {
- FX_DWORD pal_size = 1 << GetBPP();
- if (m_pPalette == NULL) {
- m_pPalette = FX_Alloc(FX_DWORD, pal_size);
- }
- if (!m_pPalette) {
- return;
- }
- if (pal_size > size) {
- pal_size = size;
- }
- FXSYS_memcpy32(m_pPalette, pSrc, pal_size * sizeof(FX_DWORD));
- }
-}
-void CFX_DIBSource::GetPalette(FX_DWORD* pal, int alpha) const
-{
- ASSERT(GetBPP() <= 8 && !IsCmykImage());
- if (GetBPP() == 1) {
- pal[0] = ((m_pPalette ? m_pPalette[0] : 0xff000000) & 0xffffff) | (alpha << 24);
- pal[1] = ((m_pPalette ? m_pPalette[1] : 0xffffffff) & 0xffffff) | (alpha << 24);
- return;
- }
- if (m_pPalette) {
- for (int i = 0; i < 256; i ++) {
- pal[i] = (m_pPalette[i] & 0x00ffffff) | (alpha << 24);
- }
- } else {
- for (int i = 0; i < 256; i ++) {
- pal[i] = (i * 0x10101) | (alpha << 24);
- }
- }
-}
-CFX_DIBitmap* CFX_DIBSource::GetAlphaMask(const FX_RECT* pClip) const
-{
- ASSERT(GetFormat() == FXDIB_Argb);
- FX_RECT rect(0, 0, m_Width, m_Height);
- if (pClip) {
- rect.Intersect(*pClip);
- if (rect.IsEmpty()) {
- return NULL;
- }
- }
- CFX_DIBitmap* pMask = FX_NEW CFX_DIBitmap;
- if (!pMask) {
- return NULL;
- }
- if (!pMask->Create(rect.Width(), rect.Height(), FXDIB_8bppMask)) {
- delete pMask;
- return NULL;
- }
- for (int row = rect.top; row < rect.bottom; row ++) {
- FX_LPCBYTE src_scan = GetScanline(row) + rect.left * 4 + 3;
- FX_LPBYTE dest_scan = (FX_LPBYTE)pMask->GetScanline(row - rect.top);
- for (int col = rect.left; col < rect.right; col ++) {
- *dest_scan ++ = *src_scan;
- src_scan += 4;
- }
- }
- return pMask;
-}
-FX_BOOL CFX_DIBSource::CopyAlphaMask(const CFX_DIBSource* pAlphaMask, const FX_RECT* pClip)
-{
- if (!HasAlpha() || GetFormat() == FXDIB_Argb) {
- return FALSE;
- }
- if (pAlphaMask) {
- FX_RECT rect(0, 0, pAlphaMask->m_Width, pAlphaMask->m_Height);
- if (pClip) {
- rect.Intersect(*pClip);
- if (rect.IsEmpty() || rect.Width() != m_Width || rect.Height() != m_Height) {
- return FALSE;
- }
- } else {
- if (pAlphaMask->m_Width != m_Width || pAlphaMask->m_Height != m_Height) {
- return FALSE;
- }
- }
- for (int row = 0; row < m_Height; row ++)
- FXSYS_memcpy32((void*)m_pAlphaMask->GetScanline(row),
- pAlphaMask->GetScanline(row + rect.top) + rect.left, m_pAlphaMask->m_Pitch);
- } else {
- m_pAlphaMask->Clear(0xff000000);
- }
- return TRUE;
-}
-const int g_ChannelOffset[] = {0, 2, 1, 0, 0, 1, 2, 3, 3};
-FX_BOOL CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, const CFX_DIBSource* pSrcBitmap, FXDIB_Channel srcChannel)
-{
- if (m_pBuffer == NULL) {
- return FALSE;
- }
- CFX_DIBSource* pSrcClone = (CFX_DIBSource*)pSrcBitmap;
- CFX_DIBitmap* pDst = this;
- int destOffset, srcOffset;
- if (srcChannel == FXDIB_Alpha) {
- if (!pSrcBitmap->HasAlpha() && !pSrcBitmap->IsAlphaMask()) {
- return FALSE;
- }
- if (pSrcBitmap->GetBPP() == 1) {
- pSrcClone = pSrcBitmap->CloneConvert(FXDIB_8bppMask);
- if (pSrcClone == NULL) {
- return FALSE;
- }
- }
- if(pSrcBitmap->GetFormat() == FXDIB_Argb) {
- srcOffset = 3;
- } else {
- srcOffset = 0;
- }
- } else {
- if (pSrcBitmap->IsAlphaMask()) {
- return FALSE;
- }
- if (pSrcBitmap->GetBPP() < 24) {
- if (pSrcBitmap->IsCmykImage()) {
- pSrcClone = pSrcBitmap->CloneConvert((FXDIB_Format)((pSrcBitmap->GetFormat() & 0xff00) | 0x20));
- } else {
- pSrcClone = pSrcBitmap->CloneConvert((FXDIB_Format)((pSrcBitmap->GetFormat() & 0xff00) | 0x18));
- }
- if (pSrcClone == NULL) {
- return FALSE;
- }
- }
- srcOffset = g_ChannelOffset[srcChannel];
- }
- if (destChannel == FXDIB_Alpha) {
- if (IsAlphaMask()) {
- if(!ConvertFormat(FXDIB_8bppMask)) {
- if (pSrcClone != pSrcBitmap) {
- delete pSrcClone;
- }
- return FALSE;
- }
- destOffset = 0;
- } else {
- destOffset = 0;
- if(!ConvertFormat(IsCmykImage() ? FXDIB_Cmyka : FXDIB_Argb)) {
- if (pSrcClone != pSrcBitmap) {
- delete pSrcClone;
- }
- return FALSE;
- }
- if (GetFormat() == FXDIB_Argb) {
- destOffset = 3;
- }
- }
- } else {
- if (IsAlphaMask()) {
- if (pSrcClone != pSrcBitmap) {
- delete pSrcClone;
- }
- return FALSE;
- }
- if (GetBPP() < 24) {
- if (HasAlpha()) {
- if (!ConvertFormat(IsCmykImage() ? FXDIB_Cmyka : FXDIB_Argb)) {
- if (pSrcClone != pSrcBitmap) {
- delete pSrcClone;
- }
- return FALSE;
- }
- } else
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
- if (!ConvertFormat(IsCmykImage() ? FXDIB_Cmyk : FXDIB_Rgb32)) {
-#else
- if (!ConvertFormat(IsCmykImage() ? FXDIB_Cmyk : FXDIB_Rgb)) {
-#endif
- if (pSrcClone != pSrcBitmap) {
- delete pSrcClone;
- }
- return FALSE;
- }
- }
- destOffset = g_ChannelOffset[destChannel];
- }
- if (srcChannel == FXDIB_Alpha && pSrcClone->m_pAlphaMask) {
- CFX_DIBitmap* pAlphaMask = pSrcClone->m_pAlphaMask;
- if (pSrcClone->GetWidth() != m_Width || pSrcClone->GetHeight() != m_Height) {
- if (pAlphaMask) {
- pAlphaMask = pAlphaMask->StretchTo(m_Width, m_Height);
- if (pAlphaMask == NULL) {
- if (pSrcClone != pSrcBitmap) {
- delete pSrcClone;
- }
- return FALSE;
- }
- }
- }
- if (pSrcClone != pSrcBitmap) {
- pSrcClone->m_pAlphaMask = NULL;
- delete pSrcClone;
- }
- pSrcClone = pAlphaMask;
- srcOffset = 0;
- } else if (pSrcClone->GetWidth() != m_Width || pSrcClone->GetHeight() != m_Height) {
- CFX_DIBitmap* pSrcMatched = pSrcClone->StretchTo(m_Width, m_Height);
- if (pSrcClone != pSrcBitmap) {
- delete pSrcClone;
- }
- if (pSrcMatched == NULL) {
- return FALSE;
- }
- pSrcClone = pSrcMatched;
- }
- if (destChannel == FXDIB_Alpha && m_pAlphaMask) {
- pDst = m_pAlphaMask;
- destOffset = 0;
- }
- int srcBytes = pSrcClone->GetBPP() / 8;
- int destBytes = pDst->GetBPP() / 8;
- for (int row = 0; row < m_Height; row ++) {
- FX_LPBYTE dest_pos = (FX_LPBYTE)pDst->GetScanline(row) + destOffset;
- FX_LPCBYTE src_pos = pSrcClone->GetScanline(row) + srcOffset;
- for (int col = 0; col < m_Width; col ++) {
- *dest_pos = *src_pos;
- dest_pos += destBytes;
- src_pos += srcBytes;
- }
- }
- if (pSrcClone != pSrcBitmap && pSrcClone != pSrcBitmap->m_pAlphaMask) {
- delete pSrcClone;
- }
- return TRUE;
-}
-FX_BOOL CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, int value)
-{
- if (m_pBuffer == NULL) {
- return FALSE;
- }
- int destOffset;
- if (destChannel == FXDIB_Alpha) {
- if (IsAlphaMask()) {
- if(!ConvertFormat(FXDIB_8bppMask)) {
- return FALSE;
- }
- destOffset = 0;
- } else {
- destOffset = 0;
- if(!ConvertFormat(IsCmykImage() ? FXDIB_Cmyka : FXDIB_Argb)) {
- return FALSE;
- }
- if (GetFormat() == FXDIB_Argb) {
- destOffset = 3;
- }
- }
- } else {
- if (IsAlphaMask()) {
- return FALSE;
- }
- if (GetBPP() < 24) {
- if (HasAlpha()) {
- if (!ConvertFormat(IsCmykImage() ? FXDIB_Cmyka : FXDIB_Argb)) {
- return FALSE;
- }
- } else
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
- if (!ConvertFormat(IsCmykImage() ? FXDIB_Cmyk : FXDIB_Rgb)) {
- return FALSE;
- }
-#else
- if (!ConvertFormat(IsCmykImage() ? FXDIB_Cmyk : FXDIB_Rgb32)) {
- return FALSE;
- }
-#endif
- }
- destOffset = g_ChannelOffset[destChannel];
- }
- int Bpp = GetBPP() / 8;
- if (Bpp == 1) {
- FXSYS_memset8(m_pBuffer, value, m_Height * m_Pitch);
- return TRUE;
- }
- if (destChannel == FXDIB_Alpha && m_pAlphaMask) {
- FXSYS_memset8(m_pAlphaMask->GetBuffer(), value, m_pAlphaMask->GetHeight()*m_pAlphaMask->GetPitch());
- return TRUE;
- }
- for (int row = 0; row < m_Height; row ++) {
- FX_LPBYTE scan_line = m_pBuffer + row * m_Pitch + destOffset;
- for (int col = 0; col < m_Width; col ++) {
- *scan_line = value;
- scan_line += Bpp;
- }
- }
- return TRUE;
-}
-FX_BOOL CFX_DIBitmap::MultiplyAlpha(const CFX_DIBSource* pSrcBitmap)
-{
- if (m_pBuffer == NULL) {
- return FALSE;
- }
- ASSERT(pSrcBitmap->IsAlphaMask());
- if (!pSrcBitmap->IsAlphaMask()) {
- return FALSE;
- }
- if (!IsAlphaMask() && !HasAlpha()) {
- return LoadChannel(FXDIB_Alpha, pSrcBitmap, FXDIB_Alpha);
- }
- CFX_DIBitmap* pSrcClone = (CFX_DIBitmap*)pSrcBitmap;
- if (pSrcBitmap->GetWidth() != m_Width || pSrcBitmap->GetHeight() != m_Height) {
- pSrcClone = pSrcBitmap->StretchTo(m_Width, m_Height);
- ASSERT(pSrcClone != NULL);
- if (pSrcClone == NULL) {
- return FALSE;
- }
- }
- if (IsAlphaMask()) {
- if(!ConvertFormat(FXDIB_8bppMask)) {
- if (pSrcClone != pSrcBitmap) {
- delete pSrcClone;
- }
- return FALSE;
- }
- for (int row = 0; row < m_Height; row ++) {
- FX_LPBYTE dest_scan = m_pBuffer + m_Pitch * row;
- FX_LPBYTE src_scan = pSrcClone->m_pBuffer + pSrcClone->m_Pitch * row;
- if (pSrcClone->GetBPP() == 1) {
- for (int col = 0; col < m_Width; col ++) {
- if (!((1 << (7 - col % 8)) & src_scan[col / 8])) {
- dest_scan[col] = 0;
- }
- }
- } else {
- for (int col = 0; col < m_Width; col ++) {
- *dest_scan = (*dest_scan) * src_scan[col] / 255;
- dest_scan ++;
- }
- }
- }
- } else {
- if(GetFormat() == FXDIB_Argb) {
- if (pSrcClone->GetBPP() == 1) {
- if (pSrcClone != pSrcBitmap) {
- delete pSrcClone;
- }
- return FALSE;
- }
- for (int row = 0; row < m_Height; row ++) {
- FX_LPBYTE dest_scan = m_pBuffer + m_Pitch * row + 3;
- FX_LPBYTE src_scan = pSrcClone->m_pBuffer + pSrcClone->m_Pitch * row;
- for (int col = 0; col < m_Width; col ++) {
- *dest_scan = (*dest_scan) * src_scan[col] / 255;
- dest_scan += 4;
- }
- }
- } else {
- m_pAlphaMask->MultiplyAlpha(pSrcClone);
- }
- }
- if (pSrcClone != pSrcBitmap) {
- delete pSrcClone;
- }
- return TRUE;
-}
-FX_BOOL CFX_DIBitmap::GetGrayData(void* pIccTransform)
-{
- if (m_pBuffer == NULL) {
- return FALSE;
- }
- switch (GetFormat()) {
- case FXDIB_1bppRgb: {
- if (m_pPalette == NULL) {
- return FALSE;
- }
- FX_BYTE gray[2];
- for (int i = 0; i < 2; i ++) {
- int r = (FX_BYTE)(m_pPalette[i] >> 16);
- int g = (FX_BYTE)(m_pPalette[i] >> 8);
- int b = (FX_BYTE)m_pPalette[i];
- gray[i] = (FX_BYTE)FXRGB2GRAY(r, g, b);
- }
- CFX_DIBitmap* pMask = FX_NEW CFX_DIBitmap;
- if (!pMask) {
- return FALSE;
- }
- if (!pMask->Create(m_Width, m_Height, FXDIB_8bppMask)) {
- delete pMask;
- return FALSE;
- }
- FXSYS_memset8(pMask->GetBuffer(), gray[0], pMask->GetPitch() * m_Height);
- for (int row = 0; row < m_Height; row ++) {
- FX_LPBYTE src_pos = m_pBuffer + row * m_Pitch;
- FX_LPBYTE dest_pos = (FX_LPBYTE)pMask->GetScanline(row);
- for (int col = 0; col < m_Width; col ++) {
- if (src_pos[col / 8] & (1 << (7 - col % 8))) {
- *dest_pos = gray[1];
- }
- dest_pos ++;
- }
- }
- TakeOver(pMask);
- delete pMask;
- break;
- }
- case FXDIB_8bppRgb: {
- if (m_pPalette == NULL) {
- return FALSE;
- }
- FX_BYTE gray[256];
- for (int i = 0; i < 256; i ++) {
- int r = (FX_BYTE)(m_pPalette[i] >> 16);
- int g = (FX_BYTE)(m_pPalette[i] >> 8);
- int b = (FX_BYTE)m_pPalette[i];
- gray[i] = (FX_BYTE)FXRGB2GRAY(r, g, b);
- }
- CFX_DIBitmap* pMask = FX_NEW CFX_DIBitmap;
- if (!pMask) {
- return FALSE;
- }
- if (!pMask->Create(m_Width, m_Height, FXDIB_8bppMask)) {
- delete pMask;
- return FALSE;
- }
- for (int row = 0; row < m_Height; row ++) {
- FX_LPBYTE dest_pos = pMask->GetBuffer() + row * pMask->GetPitch();
- FX_LPBYTE src_pos = m_pBuffer + row * m_Pitch;
- for (int col = 0; col < m_Width; col ++) {
- *dest_pos ++ = gray[*src_pos ++];
- }
- }
- TakeOver(pMask);
- delete pMask;
- break;
- }
- case FXDIB_Rgb: {
- CFX_DIBitmap* pMask = FX_NEW CFX_DIBitmap;
- if (!pMask) {
- return FALSE;
- }
- if (!pMask->Create(m_Width, m_Height, FXDIB_8bppMask)) {
- delete pMask;
- return FALSE;
- }
- for (int row = 0; row < m_Height; row ++) {
- FX_LPBYTE src_pos = m_pBuffer + row * m_Pitch;
- FX_LPBYTE dest_pos = pMask->GetBuffer() + row * pMask->GetPitch();
- for (int col = 0; col < m_Width; col ++) {
- *dest_pos ++ = FXRGB2GRAY(src_pos[2], src_pos[1], *src_pos);
- src_pos += 3;
- }
- }
- TakeOver(pMask);
- delete pMask;
- break;
- }
- case FXDIB_Rgb32: {
- CFX_DIBitmap* pMask = FX_NEW CFX_DIBitmap;
- if (!pMask) {
- return FALSE;
- }
- if (!pMask->Create(m_Width, m_Height, FXDIB_8bppMask)) {
- delete pMask;
- return FALSE;
- }
- for (int row = 0; row < m_Height; row ++) {
- FX_LPBYTE src_pos = m_pBuffer + row * m_Pitch;
- FX_LPBYTE dest_pos = pMask->GetBuffer() + row * pMask->GetPitch();
- for (int col = 0; col < m_Width; col ++) {
- *dest_pos ++ = FXRGB2GRAY(src_pos[2], src_pos[1], *src_pos);
- src_pos += 4;
- }
- }
- TakeOver(pMask);
- delete pMask;
- break;
- }
- default:
- return FALSE;
- }
- return TRUE;
-}
-FX_BOOL CFX_DIBitmap::MultiplyAlpha(int alpha)
-{
- if (m_pBuffer == NULL) {
- return FALSE;
- }
- switch (GetFormat()) {
- case FXDIB_1bppMask:
- if (!ConvertFormat(FXDIB_8bppMask)) {
- return FALSE;
- }
- MultiplyAlpha(alpha);
- break;
- case FXDIB_8bppMask: {
- for (int row = 0; row < m_Height; row ++) {
- FX_LPBYTE scan_line = m_pBuffer + row * m_Pitch;
- for (int col = 0; col < m_Width; col ++) {
- scan_line[col] = scan_line[col] * alpha / 255;
- }
- }
- break;
- }
- case FXDIB_Argb: {
- for (int row = 0; row < m_Height; row ++) {
- FX_LPBYTE scan_line = m_pBuffer + row * m_Pitch + 3;
- for (int col = 0; col < m_Width; col ++) {
- *scan_line = (*scan_line) * alpha / 255;
- scan_line += 4;
- }
- }
- break;
- }
- default:
- if (HasAlpha()) {
- m_pAlphaMask->MultiplyAlpha(alpha);
- } else if (IsCmykImage()) {
- if (!ConvertFormat((FXDIB_Format)(GetFormat() | 0x0200))) {
- return FALSE;
- }
- m_pAlphaMask->MultiplyAlpha(alpha);
- } else {
- if (!ConvertFormat(FXDIB_Argb)) {
- return FALSE;
- }
- MultiplyAlpha(alpha);
- }
- break;
- }
- return TRUE;
-}
-#if !defined(_FPDFAPI_MINI_) || defined(_FXCORE_FEATURE_ALL_)
-FX_DWORD CFX_DIBitmap::GetPixel(int x, int y) const
-{
- if (m_pBuffer == NULL) {
- return 0;
- }
- FX_LPBYTE pos = m_pBuffer + y * m_Pitch + x * GetBPP() / 8;
- switch (GetFormat()) {
- case FXDIB_1bppMask: {
- if ((*pos) & (1 << (7 - x % 8))) {
- return 0xff000000;
- }
- return 0;
- }
- case FXDIB_1bppRgb: {
- if ((*pos) & (1 << (7 - x % 8))) {
- return m_pPalette ? m_pPalette[1] : 0xffffffff;
- } else {
- return m_pPalette ? m_pPalette[0] : 0xff000000;
- }
- break;
- }
- case FXDIB_8bppMask:
- return (*pos) << 24;
- case FXDIB_8bppRgb:
- return m_pPalette ? m_pPalette[*pos] : (0xff000000 | ((*pos) * 0x10101));
- case FXDIB_Rgb:
- case FXDIB_Rgba:
- case FXDIB_Rgb32:
- return FXARGB_GETDIB(pos) | 0xff000000;
- case FXDIB_Argb:
- return FXARGB_GETDIB(pos);
- default:
- break;
- }
- return 0;
-}
-#endif
-void CFX_DIBitmap::SetPixel(int x, int y, FX_DWORD color)
-{
- if (m_pBuffer == NULL) {
- return;
- }
- if (x < 0 || x >= m_Width || y < 0 || y >= m_Height) {
- return;
- }
- FX_LPBYTE pos = m_pBuffer + y * m_Pitch + x * GetBPP() / 8;
- switch (GetFormat()) {
- case FXDIB_1bppMask:
- if (color >> 24) {
- *pos |= 1 << (7 - x % 8);
- } else {
- *pos &= ~(1 << (7 - x % 8));
- }
- break;
- case FXDIB_1bppRgb:
- if (m_pPalette) {
- if (color == m_pPalette[1]) {
- *pos |= 1 << (7 - x % 8);
- } else {
- *pos &= ~(1 << (7 - x % 8));
- }
- } else {
- if (color == 0xffffffff) {
- *pos |= 1 << (7 - x % 8);
- } else {
- *pos &= ~(1 << (7 - x % 8));
- }
- }
- break;
- case FXDIB_8bppMask:
- *pos = (FX_BYTE)(color >> 24);
- break;
- case FXDIB_8bppRgb: {
- if (m_pPalette) {
- for (int i = 0; i < 256; i ++) {
- if (m_pPalette[i] == color) {
- *pos = (FX_BYTE)i;
- return;
- }
- }
- *pos = 0;
- } else {
- *pos = FXRGB2GRAY(FXARGB_R(color), FXARGB_G(color), FXARGB_B(color));
- }
- break;
- }
- case FXDIB_Rgb:
- case FXDIB_Rgb32: {
- int alpha = FXARGB_A(color);
- pos[0] = (FXARGB_B(color) * alpha + pos[0] * (255 - alpha)) / 255;
- pos[1] = (FXARGB_G(color) * alpha + pos[1] * (255 - alpha)) / 255;
- pos[2] = (FXARGB_R(color) * alpha + pos[2] * (255 - alpha)) / 255;
- break;
- }
- case FXDIB_Rgba: {
- pos[0] = FXARGB_B(color);
- pos[1] = FXARGB_G(color);
- pos[2] = FXARGB_R(color);
- break;
- }
- case FXDIB_Argb:
- FXARGB_SETDIB(pos, color);
- break;
- default:
- break;
- }
-}
-void CFX_DIBitmap::DownSampleScanline(int line, FX_LPBYTE dest_scan, int dest_bpp,
- int dest_width, FX_BOOL bFlipX, int clip_left, int clip_width) const
-{
- if (m_pBuffer == NULL) {
- return;
- }
- int src_Bpp = m_bpp / 8;
- FX_LPBYTE scanline = m_pBuffer + line * m_Pitch;
- if (src_Bpp == 0) {
- for (int i = 0; i < clip_width; i ++) {
- FX_DWORD dest_x = clip_left + i;
- FX_DWORD src_x = dest_x * m_Width / dest_width;
- if (bFlipX) {
- src_x = m_Width - src_x - 1;
- }
-#ifdef FOXIT_CHROME_BUILD
- src_x %= m_Width;
-#endif
- dest_scan[i] = (scanline[src_x / 8] & (1 << (7 - src_x % 8))) ? 255 : 0;
- }
- } else if (src_Bpp == 1) {
- for (int i = 0; i < clip_width; i ++) {
- FX_DWORD dest_x = clip_left + i;
- FX_DWORD src_x = dest_x * m_Width / dest_width;
- if (bFlipX) {
- src_x = m_Width - src_x - 1;
- }
-#ifdef FOXIT_CHROME_BUILD
- src_x %= m_Width;
-#endif
- int dest_pos = i;
- if (m_pPalette) {
- if (!IsCmykImage()) {
- dest_pos *= 3;
- FX_ARGB argb = m_pPalette[scanline[src_x]];
- dest_scan[dest_pos] = FXARGB_B(argb);
- dest_scan[dest_pos + 1] = FXARGB_G(argb);
- dest_scan[dest_pos + 2] = FXARGB_R(argb);
- } else {
- dest_pos *= 4;
- FX_CMYK cmyk = m_pPalette[scanline[src_x]];
- dest_scan[dest_pos] = FXSYS_GetCValue(cmyk);
- dest_scan[dest_pos + 1] = FXSYS_GetMValue(cmyk);
- dest_scan[dest_pos + 2] = FXSYS_GetYValue(cmyk);
- dest_scan[dest_pos + 3] = FXSYS_GetKValue(cmyk);
- }
- } else {
- dest_scan[dest_pos] = scanline[src_x];
- }
- }
- } else {
- for (int i = 0; i < clip_width; i ++) {
- FX_DWORD dest_x = clip_left + i;
- FX_DWORD src_x = bFlipX ? (m_Width - dest_x * m_Width / dest_width - 1) * src_Bpp : (dest_x * m_Width / dest_width) * src_Bpp;
-#ifdef FOXIT_CHROME_BUILD
- src_x %= m_Width * src_Bpp;
-#endif
- int dest_pos = i * src_Bpp;
- for (int b = 0; b < src_Bpp; b ++) {
- dest_scan[dest_pos + b] = scanline[src_x + b];
- }
- }
- }
-}
-FX_BOOL CFX_DIBitmap::ConvertColorScale(FX_DWORD forecolor, FX_DWORD backcolor)
-{
- ASSERT(!IsAlphaMask());
- if (m_pBuffer == NULL || IsAlphaMask()) {
- return FALSE;
- }
- int fc, fm, fy, fk, bc, bm, by, bk;
- int fr, fg, fb, br, bg, bb;
- FX_BOOL isCmykImage = IsCmykImage();
- if (isCmykImage) {
- fc = FXSYS_GetCValue(forecolor);
- fm = FXSYS_GetMValue(forecolor);
- fy = FXSYS_GetYValue(forecolor);
- fk = FXSYS_GetKValue(forecolor);
- bc = FXSYS_GetCValue(backcolor);
- bm = FXSYS_GetMValue(backcolor);
- by = FXSYS_GetYValue(backcolor);
- bk = FXSYS_GetKValue(backcolor);
- } else {
- fr = FXSYS_GetRValue(forecolor);
- fg = FXSYS_GetGValue(forecolor);
- fb = FXSYS_GetBValue(forecolor);
- br = FXSYS_GetRValue(backcolor);
- bg = FXSYS_GetGValue(backcolor);
- bb = FXSYS_GetBValue(backcolor);
- }
- if (m_bpp <= 8) {
- if (isCmykImage) {
- if (forecolor == 0xff && backcolor == 0 && m_pPalette == NULL) {
- return TRUE;
- }
- } else if (forecolor == 0 && backcolor == 0xffffff && m_pPalette == NULL) {
- return TRUE;
- }
- if (m_pPalette == NULL) {
- BuildPalette();
- }
- int size = 1 << m_bpp;
- if (isCmykImage) {
- for (int i = 0; i < size; i ++) {
- FX_BYTE b, g, r;
- AdobeCMYK_to_sRGB1(FXSYS_GetCValue(m_pPalette[i]), FXSYS_GetMValue(m_pPalette[i]), FXSYS_GetYValue(m_pPalette[i]), FXSYS_GetKValue(m_pPalette[i]),
- r, g, b);
- int gray = 255 - FXRGB2GRAY(r, g, b);
- m_pPalette[i] = CmykEncode(bc + (fc - bc) * gray / 255, bm + (fm - bm) * gray / 255,
- by + (fy - by) * gray / 255, bk + (fk - bk) * gray / 255);
- }
- } else
- for (int i = 0; i < size; i ++) {
- int gray = FXRGB2GRAY(FXARGB_R(m_pPalette[i]), FXARGB_G(m_pPalette[i]), FXARGB_B(m_pPalette[i]));
- m_pPalette[i] = FXARGB_MAKE(0xff, br + (fr - br) * gray / 255, bg + (fg - bg) * gray / 255,
- bb + (fb - bb) * gray / 255);
- }
- return TRUE;
- }
- if (isCmykImage) {
- if (forecolor == 0xff && backcolor == 0x00) {
- for (int row = 0; row < m_Height; row ++) {
- FX_LPBYTE scanline = m_pBuffer + row * m_Pitch;
- for (int col = 0; col < m_Width; col ++) {
- FX_BYTE b, g, r;
- AdobeCMYK_to_sRGB1(scanline[0], scanline[1], scanline[2], scanline[3],
- r, g, b);
- *scanline ++ = 0;
- *scanline ++ = 0;
- *scanline ++ = 0;
- *scanline ++ = 255 - FXRGB2GRAY(r, g, b);
- }
- }
- return TRUE;
- }
- } else if (forecolor == 0 && backcolor == 0xffffff) {
- for (int row = 0; row < m_Height; row ++) {
- FX_LPBYTE scanline = m_pBuffer + row * m_Pitch;
- int gap = m_bpp / 8 - 2;
- for (int col = 0; col < m_Width; col ++) {
- int gray = FXRGB2GRAY(scanline[2], scanline[1], scanline[0]);
- *scanline ++ = gray;
- *scanline ++ = gray;
- *scanline = gray;
- scanline += gap;
- }
- }
- return TRUE;
- }
- if (isCmykImage) {
- for (int row = 0; row < m_Height; row ++) {
- FX_LPBYTE scanline = m_pBuffer + row * m_Pitch;
- for (int col = 0; col < m_Width; col ++) {
- FX_BYTE b, g, r;
- AdobeCMYK_to_sRGB1(scanline[0], scanline[1], scanline[2], scanline[3],
- r, g, b);
- int gray = 255 - FXRGB2GRAY(r, g, b);
- *scanline ++ = bc + (fc - bc) * gray / 255;
- *scanline ++ = bm + (fm - bm) * gray / 255;
- *scanline ++ = by + (fy - by) * gray / 255;
- *scanline ++ = bk + (fk - bk) * gray / 255;
- }
- }
- } else
- for (int row = 0; row < m_Height; row ++) {
- FX_LPBYTE scanline = m_pBuffer + row * m_Pitch;
- int gap = m_bpp / 8 - 2;
- for (int col = 0; col < m_Width; col ++) {
- int gray = FXRGB2GRAY(scanline[2], scanline[1], scanline[0]);
- *scanline ++ = bb + (fb - bb) * gray / 255;
- *scanline ++ = bg + (fg - bg) * gray / 255;
- *scanline = br + (fr - br) * gray / 255;
- scanline += gap;
- }
- }
- return TRUE;
-}
-FX_BOOL CFX_DIBitmap::DitherFS(const FX_DWORD* pPalette, int pal_size, const FX_RECT* pRect)
-{
- if (m_pBuffer == NULL) {
- return FALSE;
- }
- if (m_bpp != 8 && m_pPalette != NULL && m_AlphaFlag != 0) {
- return FALSE;
- }
- if (m_Width < 4 && m_Height < 4) {
- return FALSE;
- }
- FX_RECT rect(0, 0, m_Width, m_Height);
- if (pRect) {
- rect.Intersect(*pRect);
- }
- FX_BYTE translate[256];
- for (int i = 0; i < 256; i ++) {
- int err2 = 65536;
- for (int j = 0; j < pal_size; j ++) {
- FX_BYTE entry = (FX_BYTE)pPalette[j];
- int err = (int)entry - i;
- if (err * err < err2) {
- err2 = err * err;
- translate[i] = entry;
- }
- }
- }
- for (int row = rect.top; row < rect.bottom; row ++) {
- FX_LPBYTE scan = m_pBuffer + row * m_Pitch;
- FX_LPBYTE next_scan = m_pBuffer + (row + 1) * m_Pitch;
- for (int col = rect.left; col < rect.right; col ++) {
- int src_pixel = scan[col];
- int dest_pixel = translate[src_pixel];
- scan[col] = (FX_BYTE)dest_pixel;
- int error = -dest_pixel + src_pixel;
- if (col < rect.right - 1) {
- int src = scan[col + 1];
- src += error * 7 / 16;
- if (src > 255) {
- scan[col + 1] = 255;
- } else if (src < 0) {
- scan[col + 1] = 0;
- } else {
- scan[col + 1] = src;
- }
- }
- if (col < rect.right - 1 && row < rect.bottom - 1) {
- int src = next_scan[col + 1];
- src += error * 1 / 16;
- if (src > 255) {
- next_scan[col + 1] = 255;
- } else if (src < 0) {
- next_scan[col + 1] = 0;
- } else {
- next_scan[col + 1] = src;
- }
- }
- if (row < rect.bottom - 1) {
- int src = next_scan[col];
- src += error * 5 / 16;
- if (src > 255) {
- next_scan[col] = 255;
- } else if (src < 0) {
- next_scan[col] = 0;
- } else {
- next_scan[col] = src;
- }
- }
- if (col > rect.left && row < rect.bottom - 1) {
- int src = next_scan[col - 1];
- src += error * 3 / 16;
- if (src > 255) {
- next_scan[col - 1] = 255;
- } else if (src < 0) {
- next_scan[col - 1] = 0;
- } else {
- next_scan[col - 1] = src;
- }
- }
- }
- }
- return TRUE;
-}
-CFX_DIBitmap* CFX_DIBSource::FlipImage(FX_BOOL bXFlip, FX_BOOL bYFlip) const
-{
- CFX_DIBitmap* pFlipped = FX_NEW CFX_DIBitmap;
- if (!pFlipped) {
- return NULL;
- }
- if (!pFlipped->Create(m_Width, m_Height, GetFormat())) {
- delete pFlipped;
- return NULL;
- }
- pFlipped->CopyPalette(m_pPalette);
- FX_LPBYTE pDestBuffer = pFlipped->GetBuffer();
- int Bpp = m_bpp / 8;
- for (int row = 0; row < m_Height; row ++) {
- FX_LPCBYTE src_scan = GetScanline(row);
- FX_LPBYTE dest_scan = pDestBuffer + m_Pitch * (bYFlip ? (m_Height - row - 1) : row);
- if (!bXFlip) {
- FXSYS_memcpy32(dest_scan, src_scan, m_Pitch);
- continue;
- }
- if (m_bpp == 1) {
- FXSYS_memset32(dest_scan, 0, m_Pitch);
- for (int col = 0; col < m_Width; col ++)
- if (src_scan[col / 8] & (1 << (7 - col % 8))) {
- int dest_col = m_Width - col - 1;
- dest_scan[dest_col / 8] |= (1 << (7 - dest_col % 8));
- }
- } else {
- dest_scan += (m_Width - 1) * Bpp;
- if (Bpp == 1) {
- for (int col = 0; col < m_Width; col ++) {
- *dest_scan = *src_scan;
- dest_scan --;
- src_scan ++;
- }
- } else if (Bpp == 3) {
- for (int col = 0; col < m_Width; col ++) {
- dest_scan[0] = src_scan[0];
- dest_scan[1] = src_scan[1];
- dest_scan[2] = src_scan[2];
- dest_scan -= 3;
- src_scan += 3;
- }
- } else {
- ASSERT(Bpp == 4);
- for (int col = 0; col < m_Width; col ++) {
- *(FX_DWORD*)dest_scan = *(FX_DWORD*)src_scan;
- dest_scan -= 4;
- src_scan += 4;
- }
- }
- }
- }
- if (m_pAlphaMask) {
- pDestBuffer = pFlipped->m_pAlphaMask->GetBuffer();
- FX_DWORD dest_pitch = pFlipped->m_pAlphaMask->GetPitch();
- for (int row = 0; row < m_Height; row ++) {
- FX_LPCBYTE src_scan = m_pAlphaMask->GetScanline(row);
- FX_LPBYTE dest_scan = pDestBuffer + dest_pitch * (bYFlip ? (m_Height - row - 1) : row);
- if (!bXFlip) {
- FXSYS_memcpy32(dest_scan, src_scan, dest_pitch);
- continue;
- }
- dest_scan += (m_Width - 1);
- for (int col = 0; col < m_Width; col ++) {
- *dest_scan = *src_scan;
- dest_scan --;
- src_scan ++;
- }
- }
- }
- return pFlipped;
-}
-CFX_DIBExtractor::CFX_DIBExtractor(const CFX_DIBSource* pSrc)
-{
- m_pBitmap = NULL;
- if (pSrc->GetBuffer() == NULL) {
- m_pBitmap = pSrc->Clone();
- } else {
- m_pBitmap = FX_NEW CFX_DIBitmap;
- if (!m_pBitmap) {
- return;
- }
- if (!m_pBitmap->Create(pSrc->GetWidth(), pSrc->GetHeight(), pSrc->GetFormat(), pSrc->GetBuffer())) {
- delete m_pBitmap;
- m_pBitmap = NULL;
- return;
- }
- m_pBitmap->CopyPalette(pSrc->GetPalette());
- m_pBitmap->CopyAlphaMask(pSrc->m_pAlphaMask);
- }
-}
-CFX_DIBExtractor::~CFX_DIBExtractor()
-{
- if (m_pBitmap) {
- delete m_pBitmap;
- }
-}
-CFX_FilteredDIB::CFX_FilteredDIB()
-{
- m_pScanline = NULL;
- m_pSrc = NULL;
-}
-CFX_FilteredDIB::~CFX_FilteredDIB()
-{
- if (m_pSrc && m_bAutoDropSrc) {
- delete m_pSrc;
- }
- if (m_pScanline) {
- FX_Free(m_pScanline);
- }
-}
-void CFX_FilteredDIB::LoadSrc(const CFX_DIBSource* pSrc, FX_BOOL bAutoDropSrc)
-{
- m_pSrc = pSrc;
- m_bAutoDropSrc = bAutoDropSrc;
- m_Width = pSrc->GetWidth();
- m_Height = pSrc->GetHeight();
- FXDIB_Format format = GetDestFormat();
- m_bpp = (FX_BYTE)format;
- m_AlphaFlag = (FX_BYTE)(format >> 8);
- m_Pitch = (m_Width * (format & 0xff) + 31) / 32 * 4;
- m_pPalette = GetDestPalette();
- m_pScanline = FX_Alloc(FX_BYTE, m_Pitch);
-}
-FX_LPCBYTE CFX_FilteredDIB::GetScanline(int line) const
-{
- TranslateScanline(m_pScanline, m_pSrc->GetScanline(line));
- return m_pScanline;
-}
-void CFX_FilteredDIB::DownSampleScanline(int line, FX_LPBYTE dest_scan, int dest_bpp,
- int dest_width, FX_BOOL bFlipX, int clip_left, int clip_width) const
-{
- m_pSrc->DownSampleScanline(line, dest_scan, dest_bpp, dest_width, bFlipX, clip_left, clip_width);
- TranslateDownSamples(dest_scan, dest_scan, clip_width, dest_bpp);
-}
-CFX_ImageRenderer::CFX_ImageRenderer()
-{
- m_Status = 0;
- m_pTransformer = NULL;
- m_bRgbByteOrder = FALSE;
- m_BlendType = FXDIB_BLEND_NORMAL;
-}
-CFX_ImageRenderer::~CFX_ImageRenderer()
-{
- if (m_pTransformer) {
- delete m_pTransformer;
- }
-}
-extern FX_RECT _FXDIB_SwapClipBox(FX_RECT& clip, int width, int height, FX_BOOL bFlipX, FX_BOOL bFlipY);
-FX_BOOL CFX_ImageRenderer::Start(CFX_DIBitmap* pDevice, const CFX_ClipRgn* pClipRgn,
- const CFX_DIBSource* pSource, int bitmap_alpha,
- FX_DWORD mask_color, const CFX_AffineMatrix* pMatrix,
- FX_DWORD dib_flags, FX_BOOL bRgbByteOrder,
- int alpha_flag, void* pIccTransform, int blend_type)
-{
- m_Matrix = *pMatrix;
- CFX_FloatRect image_rect_f = m_Matrix.GetUnitRect();
- FX_RECT image_rect = image_rect_f.GetOutterRect();
- m_ClipBox = pClipRgn ? pClipRgn->GetBox() : FX_RECT(0, 0, pDevice->GetWidth(), pDevice->GetHeight());
- m_ClipBox.Intersect(image_rect);
- if (m_ClipBox.IsEmpty()) {
- return FALSE;
- }
- m_pDevice = pDevice;
- m_pClipRgn = pClipRgn;
- m_MaskColor = mask_color;
- m_BitmapAlpha = bitmap_alpha;
- m_Matrix = *pMatrix;
- m_Flags = dib_flags;
- m_AlphaFlag = alpha_flag;
- m_pIccTransform = pIccTransform;
- m_bRgbByteOrder = bRgbByteOrder;
- m_BlendType = blend_type;
- FX_BOOL ret = TRUE;
- if ((FXSYS_fabs(m_Matrix.b) >= 0.5f || m_Matrix.a == 0) ||
- (FXSYS_fabs(m_Matrix.c) >= 0.5f || m_Matrix.d == 0) ) {
- if (FXSYS_fabs(m_Matrix.a) < FXSYS_fabs(m_Matrix.b) / 20 && FXSYS_fabs(m_Matrix.d) < FXSYS_fabs(m_Matrix.c) / 20 &&
- FXSYS_fabs(m_Matrix.a) < 0.5f && FXSYS_fabs(m_Matrix.d) < 0.5f) {
- int dest_width = image_rect.Width();
- int dest_height = image_rect.Height();
- FX_RECT bitmap_clip = m_ClipBox;
- bitmap_clip.Offset(-image_rect.left, -image_rect.top);
- bitmap_clip = _FXDIB_SwapClipBox(bitmap_clip, dest_width, dest_height, m_Matrix.c > 0, m_Matrix.b < 0);
- m_Composer.Compose(pDevice, pClipRgn, bitmap_alpha, mask_color, m_ClipBox, TRUE,
- m_Matrix.c > 0, m_Matrix.b < 0, m_bRgbByteOrder, alpha_flag, pIccTransform, m_BlendType);
- if (!m_Stretcher.Start(&m_Composer, pSource, dest_height, dest_width, bitmap_clip, dib_flags)) {
- return FALSE;
- }
- m_Status = 1;
- return TRUE;
- }
- m_Status = 2;
- m_pTransformer = FX_NEW CFX_ImageTransformer;
- if (!m_pTransformer) {
- return FALSE;
- }
- m_pTransformer->Start(pSource, &m_Matrix, dib_flags, &m_ClipBox);
- return TRUE;
- }
- int dest_width = image_rect.Width();
- if (m_Matrix.a < 0) {
- dest_width = -dest_width;
- }
- int dest_height = image_rect.Height();
- if (m_Matrix.d > 0) {
- dest_height = -dest_height;
- }
- if (dest_width == 0 || dest_height == 0) {
- return FALSE;
- }
- FX_RECT bitmap_clip = m_ClipBox;
- bitmap_clip.Offset(-image_rect.left, -image_rect.top);
- m_Composer.Compose(pDevice, pClipRgn, bitmap_alpha, mask_color,
- m_ClipBox, FALSE, FALSE, FALSE, m_bRgbByteOrder, alpha_flag, pIccTransform, m_BlendType);
- m_Status = 1;
- ret = m_Stretcher.Start(&m_Composer, pSource, dest_width, dest_height, bitmap_clip, dib_flags);
- return ret;
-}
-FX_BOOL CFX_ImageRenderer::Continue(IFX_Pause* pPause)
-{
- if (m_Status == 1) {
- return m_Stretcher.Continue(pPause);
- } else if (m_Status == 2) {
- if (m_pTransformer->Continue(pPause)) {
- return TRUE;
- }
- CFX_DIBitmap* pBitmap = m_pTransformer->m_Storer.Detach();
- if (pBitmap == NULL) {
- return FALSE;
- }
- if (pBitmap->GetBuffer() == NULL) {
- delete pBitmap;
- return FALSE;
- }
- if (pBitmap->IsAlphaMask()) {
- if (m_BitmapAlpha != 255) {
- if (m_AlphaFlag >> 8) {
- m_AlphaFlag = (((FX_BYTE)((m_AlphaFlag & 0xff) * m_BitmapAlpha / 255)) | ((m_AlphaFlag >> 8) << 8));
- } else {
- m_MaskColor = FXARGB_MUL_ALPHA(m_MaskColor, m_BitmapAlpha);
- }
- }
- m_pDevice->CompositeMask(m_pTransformer->m_ResultLeft, m_pTransformer->m_ResultTop,
- pBitmap->GetWidth(), pBitmap->GetHeight(), pBitmap, m_MaskColor,
- 0, 0, m_BlendType, m_pClipRgn, m_bRgbByteOrder, m_AlphaFlag, m_pIccTransform);
- } else {
- if (m_BitmapAlpha != 255) {
- pBitmap->MultiplyAlpha(m_BitmapAlpha);
- }
- m_pDevice->CompositeBitmap(m_pTransformer->m_ResultLeft, m_pTransformer->m_ResultTop,
- pBitmap->GetWidth(), pBitmap->GetHeight(), pBitmap, 0, 0, m_BlendType, m_pClipRgn, m_bRgbByteOrder, m_pIccTransform);
- }
- delete pBitmap;
- return FALSE;
- }
- return FALSE;
-}
-CFX_BitmapStorer::CFX_BitmapStorer()
-{
- m_pBitmap = NULL;
-}
-CFX_BitmapStorer::~CFX_BitmapStorer()
-{
- if (m_pBitmap) {
- delete m_pBitmap;
- }
-}
-CFX_DIBitmap* CFX_BitmapStorer::Detach()
-{
- CFX_DIBitmap* pBitmap = m_pBitmap;
- m_pBitmap = NULL;
- return pBitmap;
-}
-void CFX_BitmapStorer::Replace(CFX_DIBitmap* pBitmap)
-{
- if (m_pBitmap) {
- delete m_pBitmap;
- }
- m_pBitmap = pBitmap;
-}
-void CFX_BitmapStorer::ComposeScanline(int line, FX_LPCBYTE scanline, FX_LPCBYTE scan_extra_alpha)
-{
- FX_LPBYTE dest_buf = (FX_LPBYTE)m_pBitmap->GetScanline(line);
- FX_LPBYTE dest_alpha_buf = m_pBitmap->m_pAlphaMask ?
- (FX_LPBYTE)m_pBitmap->m_pAlphaMask->GetScanline(line) : NULL;
- if (dest_buf) {
- FXSYS_memcpy32(dest_buf, scanline, m_pBitmap->GetPitch());
- }
- if (dest_alpha_buf) {
- FXSYS_memcpy32(dest_alpha_buf, scan_extra_alpha, m_pBitmap->m_pAlphaMask->GetPitch());
- }
-}
-FX_BOOL CFX_BitmapStorer::SetInfo(int width, int height, FXDIB_Format src_format, FX_DWORD* pSrcPalette)
-{
- m_pBitmap = FX_NEW CFX_DIBitmap;
- if (!m_pBitmap) {
- return FALSE;
- }
- if (!m_pBitmap->Create(width, height, src_format)) {
- delete m_pBitmap;
- m_pBitmap = NULL;
- return FALSE;
- }
- if (pSrcPalette) {
- m_pBitmap->CopyPalette(pSrcPalette);
- }
- return TRUE;
-}
+// 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
+
+#include "../../../include/fxge/fx_dib.h"
+#include "../../../include/fxge/fx_ge.h"
+#include "../../../include/fxcodec/fx_codec.h"
+#include "dib_int.h"
+#include <limits.h>
+FX_BOOL ConvertBuffer(FXDIB_Format dest_format, FX_LPBYTE dest_buf, int dest_pitch, int width, int height,
+ const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, FX_DWORD*& pal, void* pIccTransform);
+void CmykDecode(FX_DWORD cmyk, int& c, int& m, int& y, int& k)
+{
+ c = FXSYS_GetCValue(cmyk);
+ m = FXSYS_GetMValue(cmyk);
+ y = FXSYS_GetYValue(cmyk);
+ k = FXSYS_GetKValue(cmyk);
+}
+void ArgbDecode(FX_DWORD argb, int& a, int& r, int& g, int& b)
+{
+ a = FXARGB_A(argb);
+ r = FXARGB_R(argb);
+ g = FXARGB_G(argb);
+ b = FXARGB_B(argb);
+}
+void ArgbDecode(FX_DWORD argb, int& a, FX_COLORREF& rgb)
+{
+ a = FXARGB_A(argb);
+ rgb = FXSYS_RGB(FXARGB_R(argb), FXARGB_G(argb), FXARGB_B(argb));
+}
+FX_DWORD ArgbEncode(int a, FX_COLORREF rgb)
+{
+ return FXARGB_MAKE(a, FXSYS_GetRValue(rgb), FXSYS_GetGValue(rgb), FXSYS_GetBValue(rgb));
+}
+CFX_DIBSource::CFX_DIBSource()
+{
+ m_bpp = 0;
+ m_AlphaFlag = 0;
+ m_Width = m_Height = 0;
+ m_Pitch = 0;
+ m_pPalette = NULL;
+ m_pAlphaMask = NULL;
+}
+CFX_DIBSource::~CFX_DIBSource()
+{
+ if (m_pPalette) {
+ FX_Free(m_pPalette);
+ }
+ if (m_pAlphaMask) {
+ delete m_pAlphaMask;
+ }
+}
+CFX_DIBitmap::CFX_DIBitmap()
+{
+ m_bExtBuf = FALSE;
+ m_pBuffer = NULL;
+ m_pPalette = NULL;
+}
+#define _MAX_OOM_LIMIT_ 12000000
+FX_BOOL CFX_DIBitmap::Create(int width, int height, FXDIB_Format format, FX_LPBYTE pBuffer, int pitch)
+{
+ m_pBuffer = NULL;
+ m_bpp = (FX_BYTE)format;
+ m_AlphaFlag = (FX_BYTE)(format >> 8);
+ m_Width = m_Height = m_Pitch = 0;
+ if (width <= 0 || height <= 0 || pitch < 0) {
+ return FALSE;
+ }
+ if ((INT_MAX - 31) / width < (format & 0xff)) {
+ return FALSE;
+ }
+ if (!pitch) {
+ pitch = (width * (format & 0xff) + 31) / 32 * 4;
+ }
+ if ((1 << 30) / pitch < height) {
+ return FALSE;
+ }
+ if (pBuffer) {
+ m_pBuffer = pBuffer;
+ m_bExtBuf = TRUE;
+ } else {
+ int size = pitch * height + 4;
+ int oomlimit = _MAX_OOM_LIMIT_;
+ if (oomlimit >= 0 && size >= oomlimit) {
+ m_pBuffer = FX_AllocNL(FX_BYTE, size);
+ } else {
+ m_pBuffer = FX_Alloc(FX_BYTE, size);
+ }
+ if (m_pBuffer == NULL) {
+ return FALSE;
+ }
+ FXSYS_memset32(m_pBuffer, 0, sizeof (FX_BYTE) * size);
+ }
+ m_Width = width;
+ m_Height = height;
+ m_Pitch = pitch;
+ if (HasAlpha() && format != FXDIB_Argb) {
+ FX_BOOL ret = TRUE;
+ ret = BuildAlphaMask();
+ if (!ret) {
+ if (!m_bExtBuf && m_pBuffer) {
+ FX_Free(m_pBuffer);
+ m_pBuffer = NULL;
+ m_Width = m_Height = m_Pitch = 0;
+ return FALSE;
+ }
+ }
+ }
+ return TRUE;
+}
+FX_BOOL CFX_DIBitmap::Copy(const CFX_DIBSource* pSrc)
+{
+ if (m_pBuffer) {
+ return FALSE;
+ }
+ if (!Create(pSrc->GetWidth(), pSrc->GetHeight(), pSrc->GetFormat())) {
+ return FALSE;
+ }
+ CopyPalette(pSrc->GetPalette());
+ CopyAlphaMask(pSrc->m_pAlphaMask);
+ for (int row = 0; row < pSrc->GetHeight(); row ++) {
+ FXSYS_memcpy32(m_pBuffer + row * m_Pitch, pSrc->GetScanline(row), m_Pitch);
+ }
+ return TRUE;
+}
+CFX_DIBitmap::~CFX_DIBitmap()
+{
+ if (m_pBuffer && !m_bExtBuf) {
+ FX_Free(m_pBuffer);
+ }
+ m_pBuffer = NULL;
+}
+void CFX_DIBitmap::TakeOver(CFX_DIBitmap* pSrcBitmap)
+{
+ if (m_pBuffer && !m_bExtBuf) {
+ FX_Free(m_pBuffer);
+ }
+ if (m_pPalette) {
+ FX_Free(m_pPalette);
+ }
+ if (m_pAlphaMask) {
+ delete m_pAlphaMask;
+ }
+ m_pBuffer = pSrcBitmap->m_pBuffer;
+ m_pPalette = pSrcBitmap->m_pPalette;
+ m_pAlphaMask = pSrcBitmap->m_pAlphaMask;
+ pSrcBitmap->m_pBuffer = NULL;
+ pSrcBitmap->m_pPalette = NULL;
+ pSrcBitmap->m_pAlphaMask = NULL;
+ m_bpp = pSrcBitmap->m_bpp;
+ m_bExtBuf = pSrcBitmap->m_bExtBuf;
+ m_AlphaFlag = pSrcBitmap->m_AlphaFlag;
+ m_Width = pSrcBitmap->m_Width;
+ m_Height = pSrcBitmap->m_Height;
+ m_Pitch = pSrcBitmap->m_Pitch;
+}
+CFX_DIBitmap* CFX_DIBSource::Clone(const FX_RECT* pClip) const
+{
+ FX_RECT rect(0, 0, m_Width, m_Height);
+ if (pClip) {
+ rect.Intersect(*pClip);
+ if (rect.IsEmpty()) {
+ return NULL;
+ }
+ }
+ CFX_DIBitmap* pNewBitmap = FX_NEW CFX_DIBitmap;
+ if (!pNewBitmap) {
+ return NULL;
+ }
+ if (!pNewBitmap->Create(rect.Width(), rect.Height(), GetFormat())) {
+ delete pNewBitmap;
+ return NULL;
+ }
+ pNewBitmap->CopyPalette(m_pPalette);
+ pNewBitmap->CopyAlphaMask(m_pAlphaMask, pClip);
+ if (GetBPP() == 1 && rect.left % 8 != 0) {
+ int left_shift = rect.left % 32;
+ int right_shift = 32 - left_shift;
+ int dword_count = pNewBitmap->m_Pitch / 4;
+ for (int row = rect.top; row < rect.bottom; row ++) {
+ FX_DWORD* src_scan = (FX_DWORD*)GetScanline(row) + rect.left / 32;
+ FX_DWORD* dest_scan = (FX_DWORD*)pNewBitmap->GetScanline(row - rect.top);
+ for (int i = 0; i < dword_count; i ++) {
+ dest_scan[i] = (src_scan[i] << left_shift) | (src_scan[i + 1] >> right_shift);
+ }
+ }
+ } else {
+ int copy_len = (pNewBitmap->GetWidth() * pNewBitmap->GetBPP() + 7) / 8;
+ if (m_Pitch < (FX_DWORD)copy_len) {
+ copy_len = m_Pitch;
+ }
+ for (int row = rect.top; row < rect.bottom; row ++) {
+ FX_LPCBYTE src_scan = GetScanline(row) + rect.left * m_bpp / 8;
+ FX_LPBYTE dest_scan = (FX_LPBYTE)pNewBitmap->GetScanline(row - rect.top);
+ FXSYS_memcpy32(dest_scan, src_scan, copy_len);
+ }
+ }
+ return pNewBitmap;
+}
+void CFX_DIBSource::BuildPalette()
+{
+ if (m_pPalette) {
+ return;
+ }
+ if (GetBPP() == 1) {
+ m_pPalette = FX_Alloc(FX_DWORD, 2);
+ if (!m_pPalette) {
+ return;
+ }
+ if(IsCmykImage()) {
+ m_pPalette[0] = 0xff;
+ m_pPalette[1] = 0;
+ } else {
+ m_pPalette[0] = 0xff000000;
+ m_pPalette[1] = 0xffffffff;
+ }
+ } else if (GetBPP() == 8) {
+ m_pPalette = FX_Alloc(FX_DWORD, 256);
+ if (!m_pPalette) {
+ return;
+ }
+ if(IsCmykImage()) {
+ for (int i = 0; i < 256; i ++) {
+ m_pPalette[i] = 0xff - i;
+ }
+ } else {
+ for (int i = 0; i < 256; i ++) {
+ m_pPalette[i] = 0xff000000 | (i * 0x10101);
+ }
+ }
+ }
+}
+FX_BOOL CFX_DIBSource::BuildAlphaMask()
+{
+ if (m_pAlphaMask) {
+ return TRUE;
+ }
+ m_pAlphaMask = FX_NEW CFX_DIBitmap;
+ if (!m_pAlphaMask) {
+ return FALSE;
+ }
+ if (!m_pAlphaMask->Create(m_Width, m_Height, FXDIB_8bppMask)) {
+ delete m_pAlphaMask;
+ m_pAlphaMask = NULL;
+ return FALSE;
+ }
+ FXSYS_memset8(m_pAlphaMask->GetBuffer(), 0xff, m_pAlphaMask->GetHeight()*m_pAlphaMask->GetPitch());
+ return TRUE;
+}
+FX_DWORD CFX_DIBSource::GetPaletteEntry(int index) const
+{
+ ASSERT((GetBPP() == 1 || GetBPP() == 8) && !IsAlphaMask());
+ if (m_pPalette) {
+ return m_pPalette[index];
+ }
+ if (IsCmykImage()) {
+ if (GetBPP() == 1) {
+ return index ? 0 : 0xff;
+ }
+ return 0xff - index;
+ }
+ if (GetBPP() == 1) {
+ return index ? 0xffffffff : 0xff000000;
+ }
+ return index * 0x10101 | 0xff000000;
+}
+void CFX_DIBSource::SetPaletteEntry(int index, FX_DWORD color)
+{
+ ASSERT((GetBPP() == 1 || GetBPP() == 8) && !IsAlphaMask());
+ if (m_pPalette == NULL) {
+ BuildPalette();
+ }
+ m_pPalette[index] = color;
+}
+int CFX_DIBSource::FindPalette(FX_DWORD color) const
+{
+ ASSERT((GetBPP() == 1 || GetBPP() == 8) && !IsAlphaMask());
+ if (m_pPalette == NULL) {
+ if (IsCmykImage()) {
+ if (GetBPP() == 1) {
+ return ((FX_BYTE)color == 0xff) ? 0 : 1;
+ }
+ return 0xff - (FX_BYTE)color;
+ }
+ if (GetBPP() == 1) {
+ return ((FX_BYTE)color == 0xff) ? 1 : 0;
+ }
+ return (FX_BYTE)color;
+ }
+ int palsize = (1 << GetBPP());
+ for (int i = 0; i < palsize; i ++)
+ if (m_pPalette[i] == color) {
+ return i;
+ }
+ return -1;
+}
+void CFX_DIBitmap::Clear(FX_DWORD color)
+{
+ if (m_pBuffer == NULL) {
+ return;
+ }
+ switch (GetFormat()) {
+ case FXDIB_1bppMask:
+ FXSYS_memset8(m_pBuffer, (color & 0xff000000) ? 0xff : 0, m_Pitch * m_Height);
+ break;
+ case FXDIB_1bppRgb: {
+ int index = FindPalette(color);
+ FXSYS_memset8(m_pBuffer, index ? 0xff : 0, m_Pitch * m_Height);
+ break;
+ }
+ case FXDIB_8bppMask:
+ FXSYS_memset8(m_pBuffer, color >> 24, m_Pitch * m_Height);
+ break;
+ case FXDIB_8bppRgb: {
+ int index = FindPalette(color);
+ FXSYS_memset8(m_pBuffer, index, m_Pitch * m_Height);
+ break;
+ }
+ case FXDIB_Rgb:
+ case FXDIB_Rgba: {
+ int a, r, g, b;
+ ArgbDecode(color, a, r, g, b);
+ if (r == g && g == b) {
+ FXSYS_memset8(m_pBuffer, r, m_Pitch * m_Height);
+ } else {
+ int byte_pos = 0;
+ for (int col = 0; col < m_Width; col ++) {
+ m_pBuffer[byte_pos++] = b;
+ m_pBuffer[byte_pos++] = g;
+ m_pBuffer[byte_pos++] = r;
+ }
+ for (int row = 1; row < m_Height; row ++) {
+ FXSYS_memcpy32(m_pBuffer + row * m_Pitch, m_pBuffer, m_Pitch);
+ }
+ }
+ break;
+ }
+ case FXDIB_Rgb32:
+ case FXDIB_Argb: {
+ color = IsCmykImage() ? FXCMYK_TODIB(color) : FXARGB_TODIB(color);
+ for (int i = 0; i < m_Width; i ++) {
+ ((FX_DWORD*)m_pBuffer)[i] = color;
+ }
+ for (int row = 1; row < m_Height; row ++) {
+ FXSYS_memcpy32(m_pBuffer + row * m_Pitch, m_pBuffer, m_Pitch);
+ }
+ break;
+ }
+ default:
+ break;
+ }
+}
+void CFX_DIBSource::GetOverlapRect(int& dest_left, int& dest_top, int& width, int& height,
+ int src_width, int src_height, int& src_left, int& src_top,
+ const CFX_ClipRgn* pClipRgn)
+{
+ if (width == 0 || height == 0) {
+ return;
+ }
+ ASSERT(width > 0 && height > 0);
+ if (dest_left > m_Width || dest_top > m_Height) {
+ width = 0;
+ height = 0;
+ return;
+ }
+ int x_offset = dest_left - src_left;
+ int y_offset = dest_top - src_top;
+ FX_RECT src_rect(src_left, src_top, src_left + width, src_top + height);
+ FX_RECT src_bound(0, 0, src_width, src_height);
+ src_rect.Intersect(src_bound);
+ FX_RECT dest_rect(src_rect.left + x_offset, src_rect.top + y_offset,
+ src_rect.right + x_offset, src_rect.bottom + y_offset);
+ FX_RECT dest_bound(0, 0, m_Width, m_Height);
+ dest_rect.Intersect(dest_bound);
+ if (pClipRgn) {
+ dest_rect.Intersect(pClipRgn->GetBox());
+ }
+ dest_left = dest_rect.left;
+ dest_top = dest_rect.top;
+ src_left = dest_left - x_offset;
+ src_top = dest_top - y_offset;
+ width = dest_rect.right - dest_rect.left;
+ height = dest_rect.bottom - dest_rect.top;
+}
+FX_BOOL CFX_DIBitmap::TransferBitmap(int dest_left, int dest_top, int width, int height,
+ const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform)
+{
+ if (m_pBuffer == NULL) {
+ return FALSE;
+ }
+ GetOverlapRect(dest_left, dest_top, width, height, pSrcBitmap->GetWidth(), pSrcBitmap->GetHeight(), src_left, src_top, NULL);
+ if (width == 0 || height == 0) {
+ return TRUE;
+ }
+ FXDIB_Format dest_format = GetFormat();
+ FXDIB_Format src_format = pSrcBitmap->GetFormat();
+ if (dest_format == src_format && pIccTransform == NULL) {
+ if (GetBPP() == 1) {
+ for (int row = 0; row < height; row ++) {
+ FX_LPBYTE dest_scan = m_pBuffer + (dest_top + row) * m_Pitch;
+ FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row);
+ for (int col = 0; col < width; col ++) {
+ if (src_scan[(src_left + col) / 8] & (1 << (7 - (src_left + col) % 8))) {
+ dest_scan[(dest_left + col) / 8] |= 1 << (7 - (dest_left + col) % 8);
+ } else {
+ dest_scan[(dest_left + col) / 8] &= ~(1 << (7 - (dest_left + col) % 8));
+ }
+ }
+ }
+ } else {
+ int Bpp = GetBPP() / 8;
+ for (int row = 0; row < height; row ++) {
+ FX_LPBYTE dest_scan = m_pBuffer + (dest_top + row) * m_Pitch + dest_left * Bpp;
+ FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left * Bpp;
+ FXSYS_memcpy32(dest_scan, src_scan, width * Bpp);
+ }
+ }
+ } else {
+ if (m_pPalette) {
+ return FALSE;
+ }
+ if (m_bpp == 8) {
+ dest_format = FXDIB_8bppMask;
+ }
+ FX_LPBYTE dest_buf = m_pBuffer + dest_top * m_Pitch + dest_left * GetBPP() / 8;
+ FX_DWORD* d_plt = NULL;
+ if(!ConvertBuffer(dest_format, dest_buf, m_Pitch, width, height, pSrcBitmap, src_left, src_top, d_plt, pIccTransform)) {
+ return FALSE;
+ }
+ }
+ return TRUE;
+}
+#ifndef _FPDFAPI_MINI_
+FX_BOOL CFX_DIBitmap::TransferMask(int dest_left, int dest_top, int width, int height,
+ const CFX_DIBSource* pMask, FX_DWORD color, int src_left, int src_top, int alpha_flag, void* pIccTransform)
+{
+ if (m_pBuffer == NULL) {
+ return FALSE;
+ }
+ ASSERT(HasAlpha() && (m_bpp >= 24));
+ ASSERT(pMask->IsAlphaMask());
+ if (!HasAlpha() || !pMask->IsAlphaMask() || m_bpp < 24) {
+ return FALSE;
+ }
+ GetOverlapRect(dest_left, dest_top, width, height, pMask->GetWidth(), pMask->GetHeight(), src_left, src_top, NULL);
+ if (width == 0 || height == 0) {
+ return TRUE;
+ }
+ int src_pitch = pMask->GetPitch();
+ int src_bpp = pMask->GetBPP();
+ int alpha;
+ FX_DWORD dst_color;
+ if (alpha_flag >> 8) {
+ alpha = alpha_flag & 0xff;
+ dst_color = FXCMYK_TODIB(color);
+ } else {
+ alpha = FXARGB_A(color);
+ dst_color = FXARGB_TODIB(color);
+ }
+ FX_LPBYTE color_p = (FX_LPBYTE)&dst_color;
+ if (pIccTransform && CFX_GEModule::Get()->GetCodecModule() && CFX_GEModule::Get()->GetCodecModule()->GetIccModule()) {
+ ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
+ pIccModule->TranslateScanline(pIccTransform, color_p, color_p, 1);
+ } else {
+ if (alpha_flag >> 8 && !IsCmykImage())
+ AdobeCMYK_to_sRGB1(FXSYS_GetCValue(color), FXSYS_GetMValue(color), FXSYS_GetYValue(color), FXSYS_GetKValue(color),
+ color_p[2], color_p[1], color_p[0]);
+ else if (!(alpha_flag >> 8) && IsCmykImage()) {
+ return FALSE;
+ }
+ }
+ if(!IsCmykImage()) {
+ color_p[3] = (FX_BYTE)alpha;
+ }
+ if (GetFormat() == FXDIB_Argb) {
+ for (int row = 0; row < height; row ++) {
+ FX_DWORD* dest_pos = (FX_DWORD*)(m_pBuffer + (dest_top + row) * m_Pitch + dest_left * 4);
+ FX_LPCBYTE src_scan = pMask->GetScanline(src_top + row);
+ if (src_bpp == 1) {
+ for (int col = 0; col < width; col ++) {
+ int src_bitpos = src_left + col;
+ if (src_scan[src_bitpos / 8] & (1 << (7 - src_bitpos % 8))) {
+ *dest_pos = dst_color;
+ } else {
+ *dest_pos = 0;
+ }
+ dest_pos ++;
+ }
+ } else {
+ src_scan += src_left;
+ dst_color = FXARGB_TODIB(dst_color);
+ dst_color &= 0xffffff;
+ for (int col = 0; col < width; col ++) {
+ FXARGB_SETDIB(dest_pos++, dst_color | ((alpha * (*src_scan++) / 255) << 24));
+ }
+ }
+ }
+ } else {
+ int comps = m_bpp / 8;
+ for (int row = 0; row < height; row ++) {
+ FX_LPBYTE dest_color_pos = m_pBuffer + (dest_top + row) * m_Pitch + dest_left * comps;
+ FX_LPBYTE dest_alpha_pos = (FX_LPBYTE)m_pAlphaMask->GetScanline(dest_top + row) + dest_left;
+ FX_LPCBYTE src_scan = pMask->GetScanline(src_top + row);
+ if (src_bpp == 1) {
+ for (int col = 0; col < width; col ++) {
+ int src_bitpos = src_left + col;
+ if (src_scan[src_bitpos / 8] & (1 << (7 - src_bitpos % 8))) {
+ FXSYS_memcpy32(dest_color_pos, color_p, comps);
+ *dest_alpha_pos = 0xff;
+ } else {
+ FXSYS_memset32(dest_color_pos, 0, comps);
+ *dest_alpha_pos = 0;
+ }
+ dest_color_pos += comps;
+ dest_alpha_pos ++;
+ }
+ } else {
+ src_scan += src_left;
+ for (int col = 0; col < width; col ++) {
+ FXSYS_memcpy32(dest_color_pos, color_p, comps);
+ dest_color_pos += comps;
+ *dest_alpha_pos++ = (alpha * (*src_scan++) / 255);
+ }
+ }
+ }
+ }
+ return TRUE;
+}
+#endif
+void CFX_DIBSource::CopyPalette(const FX_DWORD* pSrc, FX_DWORD size)
+{
+ if (pSrc == NULL || GetBPP() > 8) {
+ if (m_pPalette) {
+ FX_Free(m_pPalette);
+ }
+ m_pPalette = NULL;
+ } else {
+ FX_DWORD pal_size = 1 << GetBPP();
+ if (m_pPalette == NULL) {
+ m_pPalette = FX_Alloc(FX_DWORD, pal_size);
+ }
+ if (!m_pPalette) {
+ return;
+ }
+ if (pal_size > size) {
+ pal_size = size;
+ }
+ FXSYS_memcpy32(m_pPalette, pSrc, pal_size * sizeof(FX_DWORD));
+ }
+}
+void CFX_DIBSource::GetPalette(FX_DWORD* pal, int alpha) const
+{
+ ASSERT(GetBPP() <= 8 && !IsCmykImage());
+ if (GetBPP() == 1) {
+ pal[0] = ((m_pPalette ? m_pPalette[0] : 0xff000000) & 0xffffff) | (alpha << 24);
+ pal[1] = ((m_pPalette ? m_pPalette[1] : 0xffffffff) & 0xffffff) | (alpha << 24);
+ return;
+ }
+ if (m_pPalette) {
+ for (int i = 0; i < 256; i ++) {
+ pal[i] = (m_pPalette[i] & 0x00ffffff) | (alpha << 24);
+ }
+ } else {
+ for (int i = 0; i < 256; i ++) {
+ pal[i] = (i * 0x10101) | (alpha << 24);
+ }
+ }
+}
+CFX_DIBitmap* CFX_DIBSource::GetAlphaMask(const FX_RECT* pClip) const
+{
+ ASSERT(GetFormat() == FXDIB_Argb);
+ FX_RECT rect(0, 0, m_Width, m_Height);
+ if (pClip) {
+ rect.Intersect(*pClip);
+ if (rect.IsEmpty()) {
+ return NULL;
+ }
+ }
+ CFX_DIBitmap* pMask = FX_NEW CFX_DIBitmap;
+ if (!pMask) {
+ return NULL;
+ }
+ if (!pMask->Create(rect.Width(), rect.Height(), FXDIB_8bppMask)) {
+ delete pMask;
+ return NULL;
+ }
+ for (int row = rect.top; row < rect.bottom; row ++) {
+ FX_LPCBYTE src_scan = GetScanline(row) + rect.left * 4 + 3;
+ FX_LPBYTE dest_scan = (FX_LPBYTE)pMask->GetScanline(row - rect.top);
+ for (int col = rect.left; col < rect.right; col ++) {
+ *dest_scan ++ = *src_scan;
+ src_scan += 4;
+ }
+ }
+ return pMask;
+}
+FX_BOOL CFX_DIBSource::CopyAlphaMask(const CFX_DIBSource* pAlphaMask, const FX_RECT* pClip)
+{
+ if (!HasAlpha() || GetFormat() == FXDIB_Argb) {
+ return FALSE;
+ }
+ if (pAlphaMask) {
+ FX_RECT rect(0, 0, pAlphaMask->m_Width, pAlphaMask->m_Height);
+ if (pClip) {
+ rect.Intersect(*pClip);
+ if (rect.IsEmpty() || rect.Width() != m_Width || rect.Height() != m_Height) {
+ return FALSE;
+ }
+ } else {
+ if (pAlphaMask->m_Width != m_Width || pAlphaMask->m_Height != m_Height) {
+ return FALSE;
+ }
+ }
+ for (int row = 0; row < m_Height; row ++)
+ FXSYS_memcpy32((void*)m_pAlphaMask->GetScanline(row),
+ pAlphaMask->GetScanline(row + rect.top) + rect.left, m_pAlphaMask->m_Pitch);
+ } else {
+ m_pAlphaMask->Clear(0xff000000);
+ }
+ return TRUE;
+}
+const int g_ChannelOffset[] = {0, 2, 1, 0, 0, 1, 2, 3, 3};
+FX_BOOL CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, const CFX_DIBSource* pSrcBitmap, FXDIB_Channel srcChannel)
+{
+ if (m_pBuffer == NULL) {
+ return FALSE;
+ }
+ CFX_DIBSource* pSrcClone = (CFX_DIBSource*)pSrcBitmap;
+ CFX_DIBitmap* pDst = this;
+ int destOffset, srcOffset;
+ if (srcChannel == FXDIB_Alpha) {
+ if (!pSrcBitmap->HasAlpha() && !pSrcBitmap->IsAlphaMask()) {
+ return FALSE;
+ }
+ if (pSrcBitmap->GetBPP() == 1) {
+ pSrcClone = pSrcBitmap->CloneConvert(FXDIB_8bppMask);
+ if (pSrcClone == NULL) {
+ return FALSE;
+ }
+ }
+ if(pSrcBitmap->GetFormat() == FXDIB_Argb) {
+ srcOffset = 3;
+ } else {
+ srcOffset = 0;
+ }
+ } else {
+ if (pSrcBitmap->IsAlphaMask()) {
+ return FALSE;
+ }
+ if (pSrcBitmap->GetBPP() < 24) {
+ if (pSrcBitmap->IsCmykImage()) {
+ pSrcClone = pSrcBitmap->CloneConvert((FXDIB_Format)((pSrcBitmap->GetFormat() & 0xff00) | 0x20));
+ } else {
+ pSrcClone = pSrcBitmap->CloneConvert((FXDIB_Format)((pSrcBitmap->GetFormat() & 0xff00) | 0x18));
+ }
+ if (pSrcClone == NULL) {
+ return FALSE;
+ }
+ }
+ srcOffset = g_ChannelOffset[srcChannel];
+ }
+ if (destChannel == FXDIB_Alpha) {
+ if (IsAlphaMask()) {
+ if(!ConvertFormat(FXDIB_8bppMask)) {
+ if (pSrcClone != pSrcBitmap) {
+ delete pSrcClone;
+ }
+ return FALSE;
+ }
+ destOffset = 0;
+ } else {
+ destOffset = 0;
+ if(!ConvertFormat(IsCmykImage() ? FXDIB_Cmyka : FXDIB_Argb)) {
+ if (pSrcClone != pSrcBitmap) {
+ delete pSrcClone;
+ }
+ return FALSE;
+ }
+ if (GetFormat() == FXDIB_Argb) {
+ destOffset = 3;
+ }
+ }
+ } else {
+ if (IsAlphaMask()) {
+ if (pSrcClone != pSrcBitmap) {
+ delete pSrcClone;
+ }
+ return FALSE;
+ }
+ if (GetBPP() < 24) {
+ if (HasAlpha()) {
+ if (!ConvertFormat(IsCmykImage() ? FXDIB_Cmyka : FXDIB_Argb)) {
+ if (pSrcClone != pSrcBitmap) {
+ delete pSrcClone;
+ }
+ return FALSE;
+ }
+ } else
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
+ if (!ConvertFormat(IsCmykImage() ? FXDIB_Cmyk : FXDIB_Rgb32)) {
+#else
+ if (!ConvertFormat(IsCmykImage() ? FXDIB_Cmyk : FXDIB_Rgb)) {
+#endif
+ if (pSrcClone != pSrcBitmap) {
+ delete pSrcClone;
+ }
+ return FALSE;
+ }
+ }
+ destOffset = g_ChannelOffset[destChannel];
+ }
+ if (srcChannel == FXDIB_Alpha && pSrcClone->m_pAlphaMask) {
+ CFX_DIBitmap* pAlphaMask = pSrcClone->m_pAlphaMask;
+ if (pSrcClone->GetWidth() != m_Width || pSrcClone->GetHeight() != m_Height) {
+ if (pAlphaMask) {
+ pAlphaMask = pAlphaMask->StretchTo(m_Width, m_Height);
+ if (pAlphaMask == NULL) {
+ if (pSrcClone != pSrcBitmap) {
+ delete pSrcClone;
+ }
+ return FALSE;
+ }
+ }
+ }
+ if (pSrcClone != pSrcBitmap) {
+ pSrcClone->m_pAlphaMask = NULL;
+ delete pSrcClone;
+ }
+ pSrcClone = pAlphaMask;
+ srcOffset = 0;
+ } else if (pSrcClone->GetWidth() != m_Width || pSrcClone->GetHeight() != m_Height) {
+ CFX_DIBitmap* pSrcMatched = pSrcClone->StretchTo(m_Width, m_Height);
+ if (pSrcClone != pSrcBitmap) {
+ delete pSrcClone;
+ }
+ if (pSrcMatched == NULL) {
+ return FALSE;
+ }
+ pSrcClone = pSrcMatched;
+ }
+ if (destChannel == FXDIB_Alpha && m_pAlphaMask) {
+ pDst = m_pAlphaMask;
+ destOffset = 0;
+ }
+ int srcBytes = pSrcClone->GetBPP() / 8;
+ int destBytes = pDst->GetBPP() / 8;
+ for (int row = 0; row < m_Height; row ++) {
+ FX_LPBYTE dest_pos = (FX_LPBYTE)pDst->GetScanline(row) + destOffset;
+ FX_LPCBYTE src_pos = pSrcClone->GetScanline(row) + srcOffset;
+ for (int col = 0; col < m_Width; col ++) {
+ *dest_pos = *src_pos;
+ dest_pos += destBytes;
+ src_pos += srcBytes;
+ }
+ }
+ if (pSrcClone != pSrcBitmap && pSrcClone != pSrcBitmap->m_pAlphaMask) {
+ delete pSrcClone;
+ }
+ return TRUE;
+}
+FX_BOOL CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, int value)
+{
+ if (m_pBuffer == NULL) {
+ return FALSE;
+ }
+ int destOffset;
+ if (destChannel == FXDIB_Alpha) {
+ if (IsAlphaMask()) {
+ if(!ConvertFormat(FXDIB_8bppMask)) {
+ return FALSE;
+ }
+ destOffset = 0;
+ } else {
+ destOffset = 0;
+ if(!ConvertFormat(IsCmykImage() ? FXDIB_Cmyka : FXDIB_Argb)) {
+ return FALSE;
+ }
+ if (GetFormat() == FXDIB_Argb) {
+ destOffset = 3;
+ }
+ }
+ } else {
+ if (IsAlphaMask()) {
+ return FALSE;
+ }
+ if (GetBPP() < 24) {
+ if (HasAlpha()) {
+ if (!ConvertFormat(IsCmykImage() ? FXDIB_Cmyka : FXDIB_Argb)) {
+ return FALSE;
+ }
+ } else
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
+ if (!ConvertFormat(IsCmykImage() ? FXDIB_Cmyk : FXDIB_Rgb)) {
+ return FALSE;
+ }
+#else
+ if (!ConvertFormat(IsCmykImage() ? FXDIB_Cmyk : FXDIB_Rgb32)) {
+ return FALSE;
+ }
+#endif
+ }
+ destOffset = g_ChannelOffset[destChannel];
+ }
+ int Bpp = GetBPP() / 8;
+ if (Bpp == 1) {
+ FXSYS_memset8(m_pBuffer, value, m_Height * m_Pitch);
+ return TRUE;
+ }
+ if (destChannel == FXDIB_Alpha && m_pAlphaMask) {
+ FXSYS_memset8(m_pAlphaMask->GetBuffer(), value, m_pAlphaMask->GetHeight()*m_pAlphaMask->GetPitch());
+ return TRUE;
+ }
+ for (int row = 0; row < m_Height; row ++) {
+ FX_LPBYTE scan_line = m_pBuffer + row * m_Pitch + destOffset;
+ for (int col = 0; col < m_Width; col ++) {
+ *scan_line = value;
+ scan_line += Bpp;
+ }
+ }
+ return TRUE;
+}
+FX_BOOL CFX_DIBitmap::MultiplyAlpha(const CFX_DIBSource* pSrcBitmap)
+{
+ if (m_pBuffer == NULL) {
+ return FALSE;
+ }
+ ASSERT(pSrcBitmap->IsAlphaMask());
+ if (!pSrcBitmap->IsAlphaMask()) {
+ return FALSE;
+ }
+ if (!IsAlphaMask() && !HasAlpha()) {
+ return LoadChannel(FXDIB_Alpha, pSrcBitmap, FXDIB_Alpha);
+ }
+ CFX_DIBitmap* pSrcClone = (CFX_DIBitmap*)pSrcBitmap;
+ if (pSrcBitmap->GetWidth() != m_Width || pSrcBitmap->GetHeight() != m_Height) {
+ pSrcClone = pSrcBitmap->StretchTo(m_Width, m_Height);
+ ASSERT(pSrcClone != NULL);
+ if (pSrcClone == NULL) {
+ return FALSE;
+ }
+ }
+ if (IsAlphaMask()) {
+ if(!ConvertFormat(FXDIB_8bppMask)) {
+ if (pSrcClone != pSrcBitmap) {
+ delete pSrcClone;
+ }
+ return FALSE;
+ }
+ for (int row = 0; row < m_Height; row ++) {
+ FX_LPBYTE dest_scan = m_pBuffer + m_Pitch * row;
+ FX_LPBYTE src_scan = pSrcClone->m_pBuffer + pSrcClone->m_Pitch * row;
+ if (pSrcClone->GetBPP() == 1) {
+ for (int col = 0; col < m_Width; col ++) {
+ if (!((1 << (7 - col % 8)) & src_scan[col / 8])) {
+ dest_scan[col] = 0;
+ }
+ }
+ } else {
+ for (int col = 0; col < m_Width; col ++) {
+ *dest_scan = (*dest_scan) * src_scan[col] / 255;
+ dest_scan ++;
+ }
+ }
+ }
+ } else {
+ if(GetFormat() == FXDIB_Argb) {
+ if (pSrcClone->GetBPP() == 1) {
+ if (pSrcClone != pSrcBitmap) {
+ delete pSrcClone;
+ }
+ return FALSE;
+ }
+ for (int row = 0; row < m_Height; row ++) {
+ FX_LPBYTE dest_scan = m_pBuffer + m_Pitch * row + 3;
+ FX_LPBYTE src_scan = pSrcClone->m_pBuffer + pSrcClone->m_Pitch * row;
+ for (int col = 0; col < m_Width; col ++) {
+ *dest_scan = (*dest_scan) * src_scan[col] / 255;
+ dest_scan += 4;
+ }
+ }
+ } else {
+ m_pAlphaMask->MultiplyAlpha(pSrcClone);
+ }
+ }
+ if (pSrcClone != pSrcBitmap) {
+ delete pSrcClone;
+ }
+ return TRUE;
+}
+FX_BOOL CFX_DIBitmap::GetGrayData(void* pIccTransform)
+{
+ if (m_pBuffer == NULL) {
+ return FALSE;
+ }
+ switch (GetFormat()) {
+ case FXDIB_1bppRgb: {
+ if (m_pPalette == NULL) {
+ return FALSE;
+ }
+ FX_BYTE gray[2];
+ for (int i = 0; i < 2; i ++) {
+ int r = (FX_BYTE)(m_pPalette[i] >> 16);
+ int g = (FX_BYTE)(m_pPalette[i] >> 8);
+ int b = (FX_BYTE)m_pPalette[i];
+ gray[i] = (FX_BYTE)FXRGB2GRAY(r, g, b);
+ }
+ CFX_DIBitmap* pMask = FX_NEW CFX_DIBitmap;
+ if (!pMask) {
+ return FALSE;
+ }
+ if (!pMask->Create(m_Width, m_Height, FXDIB_8bppMask)) {
+ delete pMask;
+ return FALSE;
+ }
+ FXSYS_memset8(pMask->GetBuffer(), gray[0], pMask->GetPitch() * m_Height);
+ for (int row = 0; row < m_Height; row ++) {
+ FX_LPBYTE src_pos = m_pBuffer + row * m_Pitch;
+ FX_LPBYTE dest_pos = (FX_LPBYTE)pMask->GetScanline(row);
+ for (int col = 0; col < m_Width; col ++) {
+ if (src_pos[col / 8] & (1 << (7 - col % 8))) {
+ *dest_pos = gray[1];
+ }
+ dest_pos ++;
+ }
+ }
+ TakeOver(pMask);
+ delete pMask;
+ break;
+ }
+ case FXDIB_8bppRgb: {
+ if (m_pPalette == NULL) {
+ return FALSE;
+ }
+ FX_BYTE gray[256];
+ for (int i = 0; i < 256; i ++) {
+ int r = (FX_BYTE)(m_pPalette[i] >> 16);
+ int g = (FX_BYTE)(m_pPalette[i] >> 8);
+ int b = (FX_BYTE)m_pPalette[i];
+ gray[i] = (FX_BYTE)FXRGB2GRAY(r, g, b);
+ }
+ CFX_DIBitmap* pMask = FX_NEW CFX_DIBitmap;
+ if (!pMask) {
+ return FALSE;
+ }
+ if (!pMask->Create(m_Width, m_Height, FXDIB_8bppMask)) {
+ delete pMask;
+ return FALSE;
+ }
+ for (int row = 0; row < m_Height; row ++) {
+ FX_LPBYTE dest_pos = pMask->GetBuffer() + row * pMask->GetPitch();
+ FX_LPBYTE src_pos = m_pBuffer + row * m_Pitch;
+ for (int col = 0; col < m_Width; col ++) {
+ *dest_pos ++ = gray[*src_pos ++];
+ }
+ }
+ TakeOver(pMask);
+ delete pMask;
+ break;
+ }
+ case FXDIB_Rgb: {
+ CFX_DIBitmap* pMask = FX_NEW CFX_DIBitmap;
+ if (!pMask) {
+ return FALSE;
+ }
+ if (!pMask->Create(m_Width, m_Height, FXDIB_8bppMask)) {
+ delete pMask;
+ return FALSE;
+ }
+ for (int row = 0; row < m_Height; row ++) {
+ FX_LPBYTE src_pos = m_pBuffer + row * m_Pitch;
+ FX_LPBYTE dest_pos = pMask->GetBuffer() + row * pMask->GetPitch();
+ for (int col = 0; col < m_Width; col ++) {
+ *dest_pos ++ = FXRGB2GRAY(src_pos[2], src_pos[1], *src_pos);
+ src_pos += 3;
+ }
+ }
+ TakeOver(pMask);
+ delete pMask;
+ break;
+ }
+ case FXDIB_Rgb32: {
+ CFX_DIBitmap* pMask = FX_NEW CFX_DIBitmap;
+ if (!pMask) {
+ return FALSE;
+ }
+ if (!pMask->Create(m_Width, m_Height, FXDIB_8bppMask)) {
+ delete pMask;
+ return FALSE;
+ }
+ for (int row = 0; row < m_Height; row ++) {
+ FX_LPBYTE src_pos = m_pBuffer + row * m_Pitch;
+ FX_LPBYTE dest_pos = pMask->GetBuffer() + row * pMask->GetPitch();
+ for (int col = 0; col < m_Width; col ++) {
+ *dest_pos ++ = FXRGB2GRAY(src_pos[2], src_pos[1], *src_pos);
+ src_pos += 4;
+ }
+ }
+ TakeOver(pMask);
+ delete pMask;
+ break;
+ }
+ default:
+ return FALSE;
+ }
+ return TRUE;
+}
+FX_BOOL CFX_DIBitmap::MultiplyAlpha(int alpha)
+{
+ if (m_pBuffer == NULL) {
+ return FALSE;
+ }
+ switch (GetFormat()) {
+ case FXDIB_1bppMask:
+ if (!ConvertFormat(FXDIB_8bppMask)) {
+ return FALSE;
+ }
+ MultiplyAlpha(alpha);
+ break;
+ case FXDIB_8bppMask: {
+ for (int row = 0; row < m_Height; row ++) {
+ FX_LPBYTE scan_line = m_pBuffer + row * m_Pitch;
+ for (int col = 0; col < m_Width; col ++) {
+ scan_line[col] = scan_line[col] * alpha / 255;
+ }
+ }
+ break;
+ }
+ case FXDIB_Argb: {
+ for (int row = 0; row < m_Height; row ++) {
+ FX_LPBYTE scan_line = m_pBuffer + row * m_Pitch + 3;
+ for (int col = 0; col < m_Width; col ++) {
+ *scan_line = (*scan_line) * alpha / 255;
+ scan_line += 4;
+ }
+ }
+ break;
+ }
+ default:
+ if (HasAlpha()) {
+ m_pAlphaMask->MultiplyAlpha(alpha);
+ } else if (IsCmykImage()) {
+ if (!ConvertFormat((FXDIB_Format)(GetFormat() | 0x0200))) {
+ return FALSE;
+ }
+ m_pAlphaMask->MultiplyAlpha(alpha);
+ } else {
+ if (!ConvertFormat(FXDIB_Argb)) {
+ return FALSE;
+ }
+ MultiplyAlpha(alpha);
+ }
+ break;
+ }
+ return TRUE;
+}
+#if !defined(_FPDFAPI_MINI_) || defined(_FXCORE_FEATURE_ALL_)
+FX_DWORD CFX_DIBitmap::GetPixel(int x, int y) const
+{
+ if (m_pBuffer == NULL) {
+ return 0;
+ }
+ FX_LPBYTE pos = m_pBuffer + y * m_Pitch + x * GetBPP() / 8;
+ switch (GetFormat()) {
+ case FXDIB_1bppMask: {
+ if ((*pos) & (1 << (7 - x % 8))) {
+ return 0xff000000;
+ }
+ return 0;
+ }
+ case FXDIB_1bppRgb: {
+ if ((*pos) & (1 << (7 - x % 8))) {
+ return m_pPalette ? m_pPalette[1] : 0xffffffff;
+ } else {
+ return m_pPalette ? m_pPalette[0] : 0xff000000;
+ }
+ break;
+ }
+ case FXDIB_8bppMask:
+ return (*pos) << 24;
+ case FXDIB_8bppRgb:
+ return m_pPalette ? m_pPalette[*pos] : (0xff000000 | ((*pos) * 0x10101));
+ case FXDIB_Rgb:
+ case FXDIB_Rgba:
+ case FXDIB_Rgb32:
+ return FXARGB_GETDIB(pos) | 0xff000000;
+ case FXDIB_Argb:
+ return FXARGB_GETDIB(pos);
+ default:
+ break;
+ }
+ return 0;
+}
+#endif
+void CFX_DIBitmap::SetPixel(int x, int y, FX_DWORD color)
+{
+ if (m_pBuffer == NULL) {
+ return;
+ }
+ if (x < 0 || x >= m_Width || y < 0 || y >= m_Height) {
+ return;
+ }
+ FX_LPBYTE pos = m_pBuffer + y * m_Pitch + x * GetBPP() / 8;
+ switch (GetFormat()) {
+ case FXDIB_1bppMask:
+ if (color >> 24) {
+ *pos |= 1 << (7 - x % 8);
+ } else {
+ *pos &= ~(1 << (7 - x % 8));
+ }
+ break;
+ case FXDIB_1bppRgb:
+ if (m_pPalette) {
+ if (color == m_pPalette[1]) {
+ *pos |= 1 << (7 - x % 8);
+ } else {
+ *pos &= ~(1 << (7 - x % 8));
+ }
+ } else {
+ if (color == 0xffffffff) {
+ *pos |= 1 << (7 - x % 8);
+ } else {
+ *pos &= ~(1 << (7 - x % 8));
+ }
+ }
+ break;
+ case FXDIB_8bppMask:
+ *pos = (FX_BYTE)(color >> 24);
+ break;
+ case FXDIB_8bppRgb: {
+ if (m_pPalette) {
+ for (int i = 0; i < 256; i ++) {
+ if (m_pPalette[i] == color) {
+ *pos = (FX_BYTE)i;
+ return;
+ }
+ }
+ *pos = 0;
+ } else {
+ *pos = FXRGB2GRAY(FXARGB_R(color), FXARGB_G(color), FXARGB_B(color));
+ }
+ break;
+ }
+ case FXDIB_Rgb:
+ case FXDIB_Rgb32: {
+ int alpha = FXARGB_A(color);
+ pos[0] = (FXARGB_B(color) * alpha + pos[0] * (255 - alpha)) / 255;
+ pos[1] = (FXARGB_G(color) * alpha + pos[1] * (255 - alpha)) / 255;
+ pos[2] = (FXARGB_R(color) * alpha + pos[2] * (255 - alpha)) / 255;
+ break;
+ }
+ case FXDIB_Rgba: {
+ pos[0] = FXARGB_B(color);
+ pos[1] = FXARGB_G(color);
+ pos[2] = FXARGB_R(color);
+ break;
+ }
+ case FXDIB_Argb:
+ FXARGB_SETDIB(pos, color);
+ break;
+ default:
+ break;
+ }
+}
+void CFX_DIBitmap::DownSampleScanline(int line, FX_LPBYTE dest_scan, int dest_bpp,
+ int dest_width, FX_BOOL bFlipX, int clip_left, int clip_width) const
+{
+ if (m_pBuffer == NULL) {
+ return;
+ }
+ int src_Bpp = m_bpp / 8;
+ FX_LPBYTE scanline = m_pBuffer + line * m_Pitch;
+ if (src_Bpp == 0) {
+ for (int i = 0; i < clip_width; i ++) {
+ FX_DWORD dest_x = clip_left + i;
+ FX_DWORD src_x = dest_x * m_Width / dest_width;
+ if (bFlipX) {
+ src_x = m_Width - src_x - 1;
+ }
+#ifdef FOXIT_CHROME_BUILD
+ src_x %= m_Width;
+#endif
+ dest_scan[i] = (scanline[src_x / 8] & (1 << (7 - src_x % 8))) ? 255 : 0;
+ }
+ } else if (src_Bpp == 1) {
+ for (int i = 0; i < clip_width; i ++) {
+ FX_DWORD dest_x = clip_left + i;
+ FX_DWORD src_x = dest_x * m_Width / dest_width;
+ if (bFlipX) {
+ src_x = m_Width - src_x - 1;
+ }
+#ifdef FOXIT_CHROME_BUILD
+ src_x %= m_Width;
+#endif
+ int dest_pos = i;
+ if (m_pPalette) {
+ if (!IsCmykImage()) {
+ dest_pos *= 3;
+ FX_ARGB argb = m_pPalette[scanline[src_x]];
+ dest_scan[dest_pos] = FXARGB_B(argb);
+ dest_scan[dest_pos + 1] = FXARGB_G(argb);
+ dest_scan[dest_pos + 2] = FXARGB_R(argb);
+ } else {
+ dest_pos *= 4;
+ FX_CMYK cmyk = m_pPalette[scanline[src_x]];
+ dest_scan[dest_pos] = FXSYS_GetCValue(cmyk);
+ dest_scan[dest_pos + 1] = FXSYS_GetMValue(cmyk);
+ dest_scan[dest_pos + 2] = FXSYS_GetYValue(cmyk);
+ dest_scan[dest_pos + 3] = FXSYS_GetKValue(cmyk);
+ }
+ } else {
+ dest_scan[dest_pos] = scanline[src_x];
+ }
+ }
+ } else {
+ for (int i = 0; i < clip_width; i ++) {
+ FX_DWORD dest_x = clip_left + i;
+ FX_DWORD src_x = bFlipX ? (m_Width - dest_x * m_Width / dest_width - 1) * src_Bpp : (dest_x * m_Width / dest_width) * src_Bpp;
+#ifdef FOXIT_CHROME_BUILD
+ src_x %= m_Width * src_Bpp;
+#endif
+ int dest_pos = i * src_Bpp;
+ for (int b = 0; b < src_Bpp; b ++) {
+ dest_scan[dest_pos + b] = scanline[src_x + b];
+ }
+ }
+ }
+}
+FX_BOOL CFX_DIBitmap::ConvertColorScale(FX_DWORD forecolor, FX_DWORD backcolor)
+{
+ ASSERT(!IsAlphaMask());
+ if (m_pBuffer == NULL || IsAlphaMask()) {
+ return FALSE;
+ }
+ int fc, fm, fy, fk, bc, bm, by, bk;
+ int fr, fg, fb, br, bg, bb;
+ FX_BOOL isCmykImage = IsCmykImage();
+ if (isCmykImage) {
+ fc = FXSYS_GetCValue(forecolor);
+ fm = FXSYS_GetMValue(forecolor);
+ fy = FXSYS_GetYValue(forecolor);
+ fk = FXSYS_GetKValue(forecolor);
+ bc = FXSYS_GetCValue(backcolor);
+ bm = FXSYS_GetMValue(backcolor);
+ by = FXSYS_GetYValue(backcolor);
+ bk = FXSYS_GetKValue(backcolor);
+ } else {
+ fr = FXSYS_GetRValue(forecolor);
+ fg = FXSYS_GetGValue(forecolor);
+ fb = FXSYS_GetBValue(forecolor);
+ br = FXSYS_GetRValue(backcolor);
+ bg = FXSYS_GetGValue(backcolor);
+ bb = FXSYS_GetBValue(backcolor);
+ }
+ if (m_bpp <= 8) {
+ if (isCmykImage) {
+ if (forecolor == 0xff && backcolor == 0 && m_pPalette == NULL) {
+ return TRUE;
+ }
+ } else if (forecolor == 0 && backcolor == 0xffffff && m_pPalette == NULL) {
+ return TRUE;
+ }
+ if (m_pPalette == NULL) {
+ BuildPalette();
+ }
+ int size = 1 << m_bpp;
+ if (isCmykImage) {
+ for (int i = 0; i < size; i ++) {
+ FX_BYTE b, g, r;
+ AdobeCMYK_to_sRGB1(FXSYS_GetCValue(m_pPalette[i]), FXSYS_GetMValue(m_pPalette[i]), FXSYS_GetYValue(m_pPalette[i]), FXSYS_GetKValue(m_pPalette[i]),
+ r, g, b);
+ int gray = 255 - FXRGB2GRAY(r, g, b);
+ m_pPalette[i] = CmykEncode(bc + (fc - bc) * gray / 255, bm + (fm - bm) * gray / 255,
+ by + (fy - by) * gray / 255, bk + (fk - bk) * gray / 255);
+ }
+ } else
+ for (int i = 0; i < size; i ++) {
+ int gray = FXRGB2GRAY(FXARGB_R(m_pPalette[i]), FXARGB_G(m_pPalette[i]), FXARGB_B(m_pPalette[i]));
+ m_pPalette[i] = FXARGB_MAKE(0xff, br + (fr - br) * gray / 255, bg + (fg - bg) * gray / 255,
+ bb + (fb - bb) * gray / 255);
+ }
+ return TRUE;
+ }
+ if (isCmykImage) {
+ if (forecolor == 0xff && backcolor == 0x00) {
+ for (int row = 0; row < m_Height; row ++) {
+ FX_LPBYTE scanline = m_pBuffer + row * m_Pitch;
+ for (int col = 0; col < m_Width; col ++) {
+ FX_BYTE b, g, r;
+ AdobeCMYK_to_sRGB1(scanline[0], scanline[1], scanline[2], scanline[3],
+ r, g, b);
+ *scanline ++ = 0;
+ *scanline ++ = 0;
+ *scanline ++ = 0;
+ *scanline ++ = 255 - FXRGB2GRAY(r, g, b);
+ }
+ }
+ return TRUE;
+ }
+ } else if (forecolor == 0 && backcolor == 0xffffff) {
+ for (int row = 0; row < m_Height; row ++) {
+ FX_LPBYTE scanline = m_pBuffer + row * m_Pitch;
+ int gap = m_bpp / 8 - 2;
+ for (int col = 0; col < m_Width; col ++) {
+ int gray = FXRGB2GRAY(scanline[2], scanline[1], scanline[0]);
+ *scanline ++ = gray;
+ *scanline ++ = gray;
+ *scanline = gray;
+ scanline += gap;
+ }
+ }
+ return TRUE;
+ }
+ if (isCmykImage) {
+ for (int row = 0; row < m_Height; row ++) {
+ FX_LPBYTE scanline = m_pBuffer + row * m_Pitch;
+ for (int col = 0; col < m_Width; col ++) {
+ FX_BYTE b, g, r;
+ AdobeCMYK_to_sRGB1(scanline[0], scanline[1], scanline[2], scanline[3],
+ r, g, b);
+ int gray = 255 - FXRGB2GRAY(r, g, b);
+ *scanline ++ = bc + (fc - bc) * gray / 255;
+ *scanline ++ = bm + (fm - bm) * gray / 255;
+ *scanline ++ = by + (fy - by) * gray / 255;
+ *scanline ++ = bk + (fk - bk) * gray / 255;
+ }
+ }
+ } else
+ for (int row = 0; row < m_Height; row ++) {
+ FX_LPBYTE scanline = m_pBuffer + row * m_Pitch;
+ int gap = m_bpp / 8 - 2;
+ for (int col = 0; col < m_Width; col ++) {
+ int gray = FXRGB2GRAY(scanline[2], scanline[1], scanline[0]);
+ *scanline ++ = bb + (fb - bb) * gray / 255;
+ *scanline ++ = bg + (fg - bg) * gray / 255;
+ *scanline = br + (fr - br) * gray / 255;
+ scanline += gap;
+ }
+ }
+ return TRUE;
+}
+FX_BOOL CFX_DIBitmap::DitherFS(const FX_DWORD* pPalette, int pal_size, const FX_RECT* pRect)
+{
+ if (m_pBuffer == NULL) {
+ return FALSE;
+ }
+ if (m_bpp != 8 && m_pPalette != NULL && m_AlphaFlag != 0) {
+ return FALSE;
+ }
+ if (m_Width < 4 && m_Height < 4) {
+ return FALSE;
+ }
+ FX_RECT rect(0, 0, m_Width, m_Height);
+ if (pRect) {
+ rect.Intersect(*pRect);
+ }
+ FX_BYTE translate[256];
+ for (int i = 0; i < 256; i ++) {
+ int err2 = 65536;
+ for (int j = 0; j < pal_size; j ++) {
+ FX_BYTE entry = (FX_BYTE)pPalette[j];
+ int err = (int)entry - i;
+ if (err * err < err2) {
+ err2 = err * err;
+ translate[i] = entry;
+ }
+ }
+ }
+ for (int row = rect.top; row < rect.bottom; row ++) {
+ FX_LPBYTE scan = m_pBuffer + row * m_Pitch;
+ FX_LPBYTE next_scan = m_pBuffer + (row + 1) * m_Pitch;
+ for (int col = rect.left; col < rect.right; col ++) {
+ int src_pixel = scan[col];
+ int dest_pixel = translate[src_pixel];
+ scan[col] = (FX_BYTE)dest_pixel;
+ int error = -dest_pixel + src_pixel;
+ if (col < rect.right - 1) {
+ int src = scan[col + 1];
+ src += error * 7 / 16;
+ if (src > 255) {
+ scan[col + 1] = 255;
+ } else if (src < 0) {
+ scan[col + 1] = 0;
+ } else {
+ scan[col + 1] = src;
+ }
+ }
+ if (col < rect.right - 1 && row < rect.bottom - 1) {
+ int src = next_scan[col + 1];
+ src += error * 1 / 16;
+ if (src > 255) {
+ next_scan[col + 1] = 255;
+ } else if (src < 0) {
+ next_scan[col + 1] = 0;
+ } else {
+ next_scan[col + 1] = src;
+ }
+ }
+ if (row < rect.bottom - 1) {
+ int src = next_scan[col];
+ src += error * 5 / 16;
+ if (src > 255) {
+ next_scan[col] = 255;
+ } else if (src < 0) {
+ next_scan[col] = 0;
+ } else {
+ next_scan[col] = src;
+ }
+ }
+ if (col > rect.left && row < rect.bottom - 1) {
+ int src = next_scan[col - 1];
+ src += error * 3 / 16;
+ if (src > 255) {
+ next_scan[col - 1] = 255;
+ } else if (src < 0) {
+ next_scan[col - 1] = 0;
+ } else {
+ next_scan[col - 1] = src;
+ }
+ }
+ }
+ }
+ return TRUE;
+}
+CFX_DIBitmap* CFX_DIBSource::FlipImage(FX_BOOL bXFlip, FX_BOOL bYFlip) const
+{
+ CFX_DIBitmap* pFlipped = FX_NEW CFX_DIBitmap;
+ if (!pFlipped) {
+ return NULL;
+ }
+ if (!pFlipped->Create(m_Width, m_Height, GetFormat())) {
+ delete pFlipped;
+ return NULL;
+ }
+ pFlipped->CopyPalette(m_pPalette);
+ FX_LPBYTE pDestBuffer = pFlipped->GetBuffer();
+ int Bpp = m_bpp / 8;
+ for (int row = 0; row < m_Height; row ++) {
+ FX_LPCBYTE src_scan = GetScanline(row);
+ FX_LPBYTE dest_scan = pDestBuffer + m_Pitch * (bYFlip ? (m_Height - row - 1) : row);
+ if (!bXFlip) {
+ FXSYS_memcpy32(dest_scan, src_scan, m_Pitch);
+ continue;
+ }
+ if (m_bpp == 1) {
+ FXSYS_memset32(dest_scan, 0, m_Pitch);
+ for (int col = 0; col < m_Width; col ++)
+ if (src_scan[col / 8] & (1 << (7 - col % 8))) {
+ int dest_col = m_Width - col - 1;
+ dest_scan[dest_col / 8] |= (1 << (7 - dest_col % 8));
+ }
+ } else {
+ dest_scan += (m_Width - 1) * Bpp;
+ if (Bpp == 1) {
+ for (int col = 0; col < m_Width; col ++) {
+ *dest_scan = *src_scan;
+ dest_scan --;
+ src_scan ++;
+ }
+ } else if (Bpp == 3) {
+ for (int col = 0; col < m_Width; col ++) {
+ dest_scan[0] = src_scan[0];
+ dest_scan[1] = src_scan[1];
+ dest_scan[2] = src_scan[2];
+ dest_scan -= 3;
+ src_scan += 3;
+ }
+ } else {
+ ASSERT(Bpp == 4);
+ for (int col = 0; col < m_Width; col ++) {
+ *(FX_DWORD*)dest_scan = *(FX_DWORD*)src_scan;
+ dest_scan -= 4;
+ src_scan += 4;
+ }
+ }
+ }
+ }
+ if (m_pAlphaMask) {
+ pDestBuffer = pFlipped->m_pAlphaMask->GetBuffer();
+ FX_DWORD dest_pitch = pFlipped->m_pAlphaMask->GetPitch();
+ for (int row = 0; row < m_Height; row ++) {
+ FX_LPCBYTE src_scan = m_pAlphaMask->GetScanline(row);
+ FX_LPBYTE dest_scan = pDestBuffer + dest_pitch * (bYFlip ? (m_Height - row - 1) : row);
+ if (!bXFlip) {
+ FXSYS_memcpy32(dest_scan, src_scan, dest_pitch);
+ continue;
+ }
+ dest_scan += (m_Width - 1);
+ for (int col = 0; col < m_Width; col ++) {
+ *dest_scan = *src_scan;
+ dest_scan --;
+ src_scan ++;
+ }
+ }
+ }
+ return pFlipped;
+}
+CFX_DIBExtractor::CFX_DIBExtractor(const CFX_DIBSource* pSrc)
+{
+ m_pBitmap = NULL;
+ if (pSrc->GetBuffer() == NULL) {
+ m_pBitmap = pSrc->Clone();
+ } else {
+ m_pBitmap = FX_NEW CFX_DIBitmap;
+ if (!m_pBitmap) {
+ return;
+ }
+ if (!m_pBitmap->Create(pSrc->GetWidth(), pSrc->GetHeight(), pSrc->GetFormat(), pSrc->GetBuffer())) {
+ delete m_pBitmap;
+ m_pBitmap = NULL;
+ return;
+ }
+ m_pBitmap->CopyPalette(pSrc->GetPalette());
+ m_pBitmap->CopyAlphaMask(pSrc->m_pAlphaMask);
+ }
+}
+CFX_DIBExtractor::~CFX_DIBExtractor()
+{
+ if (m_pBitmap) {
+ delete m_pBitmap;
+ }
+}
+CFX_FilteredDIB::CFX_FilteredDIB()
+{
+ m_pScanline = NULL;
+ m_pSrc = NULL;
+}
+CFX_FilteredDIB::~CFX_FilteredDIB()
+{
+ if (m_pSrc && m_bAutoDropSrc) {
+ delete m_pSrc;
+ }
+ if (m_pScanline) {
+ FX_Free(m_pScanline);
+ }
+}
+void CFX_FilteredDIB::LoadSrc(const CFX_DIBSource* pSrc, FX_BOOL bAutoDropSrc)
+{
+ m_pSrc = pSrc;
+ m_bAutoDropSrc = bAutoDropSrc;
+ m_Width = pSrc->GetWidth();
+ m_Height = pSrc->GetHeight();
+ FXDIB_Format format = GetDestFormat();
+ m_bpp = (FX_BYTE)format;
+ m_AlphaFlag = (FX_BYTE)(format >> 8);
+ m_Pitch = (m_Width * (format & 0xff) + 31) / 32 * 4;
+ m_pPalette = GetDestPalette();
+ m_pScanline = FX_Alloc(FX_BYTE, m_Pitch);
+}
+FX_LPCBYTE CFX_FilteredDIB::GetScanline(int line) const
+{
+ TranslateScanline(m_pScanline, m_pSrc->GetScanline(line));
+ return m_pScanline;
+}
+void CFX_FilteredDIB::DownSampleScanline(int line, FX_LPBYTE dest_scan, int dest_bpp,
+ int dest_width, FX_BOOL bFlipX, int clip_left, int clip_width) const
+{
+ m_pSrc->DownSampleScanline(line, dest_scan, dest_bpp, dest_width, bFlipX, clip_left, clip_width);
+ TranslateDownSamples(dest_scan, dest_scan, clip_width, dest_bpp);
+}
+CFX_ImageRenderer::CFX_ImageRenderer()
+{
+ m_Status = 0;
+ m_pTransformer = NULL;
+ m_bRgbByteOrder = FALSE;
+ m_BlendType = FXDIB_BLEND_NORMAL;
+}
+CFX_ImageRenderer::~CFX_ImageRenderer()
+{
+ if (m_pTransformer) {
+ delete m_pTransformer;
+ }
+}
+extern FX_RECT _FXDIB_SwapClipBox(FX_RECT& clip, int width, int height, FX_BOOL bFlipX, FX_BOOL bFlipY);
+FX_BOOL CFX_ImageRenderer::Start(CFX_DIBitmap* pDevice, const CFX_ClipRgn* pClipRgn,
+ const CFX_DIBSource* pSource, int bitmap_alpha,
+ FX_DWORD mask_color, const CFX_AffineMatrix* pMatrix,
+ FX_DWORD dib_flags, FX_BOOL bRgbByteOrder,
+ int alpha_flag, void* pIccTransform, int blend_type)
+{
+ m_Matrix = *pMatrix;
+ CFX_FloatRect image_rect_f = m_Matrix.GetUnitRect();
+ FX_RECT image_rect = image_rect_f.GetOutterRect();
+ m_ClipBox = pClipRgn ? pClipRgn->GetBox() : FX_RECT(0, 0, pDevice->GetWidth(), pDevice->GetHeight());
+ m_ClipBox.Intersect(image_rect);
+ if (m_ClipBox.IsEmpty()) {
+ return FALSE;
+ }
+ m_pDevice = pDevice;
+ m_pClipRgn = pClipRgn;
+ m_MaskColor = mask_color;
+ m_BitmapAlpha = bitmap_alpha;
+ m_Matrix = *pMatrix;
+ m_Flags = dib_flags;
+ m_AlphaFlag = alpha_flag;
+ m_pIccTransform = pIccTransform;
+ m_bRgbByteOrder = bRgbByteOrder;
+ m_BlendType = blend_type;
+ FX_BOOL ret = TRUE;
+ if ((FXSYS_fabs(m_Matrix.b) >= 0.5f || m_Matrix.a == 0) ||
+ (FXSYS_fabs(m_Matrix.c) >= 0.5f || m_Matrix.d == 0) ) {
+ if (FXSYS_fabs(m_Matrix.a) < FXSYS_fabs(m_Matrix.b) / 20 && FXSYS_fabs(m_Matrix.d) < FXSYS_fabs(m_Matrix.c) / 20 &&
+ FXSYS_fabs(m_Matrix.a) < 0.5f && FXSYS_fabs(m_Matrix.d) < 0.5f) {
+ int dest_width = image_rect.Width();
+ int dest_height = image_rect.Height();
+ FX_RECT bitmap_clip = m_ClipBox;
+ bitmap_clip.Offset(-image_rect.left, -image_rect.top);
+ bitmap_clip = _FXDIB_SwapClipBox(bitmap_clip, dest_width, dest_height, m_Matrix.c > 0, m_Matrix.b < 0);
+ m_Composer.Compose(pDevice, pClipRgn, bitmap_alpha, mask_color, m_ClipBox, TRUE,
+ m_Matrix.c > 0, m_Matrix.b < 0, m_bRgbByteOrder, alpha_flag, pIccTransform, m_BlendType);
+ if (!m_Stretcher.Start(&m_Composer, pSource, dest_height, dest_width, bitmap_clip, dib_flags)) {
+ return FALSE;
+ }
+ m_Status = 1;
+ return TRUE;
+ }
+ m_Status = 2;
+ m_pTransformer = FX_NEW CFX_ImageTransformer;
+ if (!m_pTransformer) {
+ return FALSE;
+ }
+ m_pTransformer->Start(pSource, &m_Matrix, dib_flags, &m_ClipBox);
+ return TRUE;
+ }
+ int dest_width = image_rect.Width();
+ if (m_Matrix.a < 0) {
+ dest_width = -dest_width;
+ }
+ int dest_height = image_rect.Height();
+ if (m_Matrix.d > 0) {
+ dest_height = -dest_height;
+ }
+ if (dest_width == 0 || dest_height == 0) {
+ return FALSE;
+ }
+ FX_RECT bitmap_clip = m_ClipBox;
+ bitmap_clip.Offset(-image_rect.left, -image_rect.top);
+ m_Composer.Compose(pDevice, pClipRgn, bitmap_alpha, mask_color,
+ m_ClipBox, FALSE, FALSE, FALSE, m_bRgbByteOrder, alpha_flag, pIccTransform, m_BlendType);
+ m_Status = 1;
+ ret = m_Stretcher.Start(&m_Composer, pSource, dest_width, dest_height, bitmap_clip, dib_flags);
+ return ret;
+}
+FX_BOOL CFX_ImageRenderer::Continue(IFX_Pause* pPause)
+{
+ if (m_Status == 1) {
+ return m_Stretcher.Continue(pPause);
+ } else if (m_Status == 2) {
+ if (m_pTransformer->Continue(pPause)) {
+ return TRUE;
+ }
+ CFX_DIBitmap* pBitmap = m_pTransformer->m_Storer.Detach();
+ if (pBitmap == NULL) {
+ return FALSE;
+ }
+ if (pBitmap->GetBuffer() == NULL) {
+ delete pBitmap;
+ return FALSE;
+ }
+ if (pBitmap->IsAlphaMask()) {
+ if (m_BitmapAlpha != 255) {
+ if (m_AlphaFlag >> 8) {
+ m_AlphaFlag = (((FX_BYTE)((m_AlphaFlag & 0xff) * m_BitmapAlpha / 255)) | ((m_AlphaFlag >> 8) << 8));
+ } else {
+ m_MaskColor = FXARGB_MUL_ALPHA(m_MaskColor, m_BitmapAlpha);
+ }
+ }
+ m_pDevice->CompositeMask(m_pTransformer->m_ResultLeft, m_pTransformer->m_ResultTop,
+ pBitmap->GetWidth(), pBitmap->GetHeight(), pBitmap, m_MaskColor,
+ 0, 0, m_BlendType, m_pClipRgn, m_bRgbByteOrder, m_AlphaFlag, m_pIccTransform);
+ } else {
+ if (m_BitmapAlpha != 255) {
+ pBitmap->MultiplyAlpha(m_BitmapAlpha);
+ }
+ m_pDevice->CompositeBitmap(m_pTransformer->m_ResultLeft, m_pTransformer->m_ResultTop,
+ pBitmap->GetWidth(), pBitmap->GetHeight(), pBitmap, 0, 0, m_BlendType, m_pClipRgn, m_bRgbByteOrder, m_pIccTransform);
+ }
+ delete pBitmap;
+ return FALSE;
+ }
+ return FALSE;
+}
+CFX_BitmapStorer::CFX_BitmapStorer()
+{
+ m_pBitmap = NULL;
+}
+CFX_BitmapStorer::~CFX_BitmapStorer()
+{
+ if (m_pBitmap) {
+ delete m_pBitmap;
+ }
+}
+CFX_DIBitmap* CFX_BitmapStorer::Detach()
+{
+ CFX_DIBitmap* pBitmap = m_pBitmap;
+ m_pBitmap = NULL;
+ return pBitmap;
+}
+void CFX_BitmapStorer::Replace(CFX_DIBitmap* pBitmap)
+{
+ if (m_pBitmap) {
+ delete m_pBitmap;
+ }
+ m_pBitmap = pBitmap;
+}
+void CFX_BitmapStorer::ComposeScanline(int line, FX_LPCBYTE scanline, FX_LPCBYTE scan_extra_alpha)
+{
+ FX_LPBYTE dest_buf = (FX_LPBYTE)m_pBitmap->GetScanline(line);
+ FX_LPBYTE dest_alpha_buf = m_pBitmap->m_pAlphaMask ?
+ (FX_LPBYTE)m_pBitmap->m_pAlphaMask->GetScanline(line) : NULL;
+ if (dest_buf) {
+ FXSYS_memcpy32(dest_buf, scanline, m_pBitmap->GetPitch());
+ }
+ if (dest_alpha_buf) {
+ FXSYS_memcpy32(dest_alpha_buf, scan_extra_alpha, m_pBitmap->m_pAlphaMask->GetPitch());
+ }
+}
+FX_BOOL CFX_BitmapStorer::SetInfo(int width, int height, FXDIB_Format src_format, FX_DWORD* pSrcPalette)
+{
+ m_pBitmap = FX_NEW CFX_DIBitmap;
+ if (!m_pBitmap) {
+ return FALSE;
+ }
+ if (!m_pBitmap->Create(width, height, src_format)) {
+ delete m_pBitmap;
+ m_pBitmap = NULL;
+ return FALSE;
+ }
+ if (pSrcPalette) {
+ m_pBitmap->CopyPalette(pSrcPalette);
+ }
+ return TRUE;
+}
diff --git a/core/src/fxge/dib/fx_dib_transform.cpp b/core/src/fxge/dib/fx_dib_transform.cpp
index 4d83005161..80475cbb1f 100644
--- a/core/src/fxge/dib/fx_dib_transform.cpp
+++ b/core/src/fxge/dib/fx_dib_transform.cpp
@@ -1,797 +1,797 @@
-// 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
-
-#include "../../../include/fxge/fx_dib.h"
-#include "dib_int.h"
-int SDP_Table[513] = {
- 256, 256, 256, 256, 256, 256, 256, 256, 256, 255, 255, 255, 255, 255, 255, 254, 254, 254, 254,
- 253, 253, 253, 252, 252, 252, 251, 251, 251, 250, 250, 249, 249, 249, 248, 248, 247, 247, 246,
- 246, 245, 244, 244, 243, 243, 242, 242, 241, 240, 240, 239, 238, 238, 237, 236, 236, 235, 234,
- 233, 233, 232, 231, 230, 230, 229, 228, 227, 226, 226, 225, 224, 223, 222, 221, 220, 219, 218,
- 218, 217, 216, 215, 214, 213, 212, 211, 210, 209, 208, 207, 206, 205, 204, 203, 202, 201, 200,
- 199, 198, 196, 195, 194, 193, 192, 191, 190, 189, 188, 186, 185, 184, 183, 182, 181, 179, 178,
- 177, 176, 175, 173, 172, 171, 170, 169, 167, 166, 165, 164, 162, 161, 160, 159, 157, 156, 155,
- 154, 152, 151, 150, 149, 147, 146, 145, 143, 142, 141, 140, 138, 137, 136, 134, 133, 132, 130,
- 129, 128, 126, 125, 124, 122, 121, 120, 119, 117, 116, 115, 113, 112, 111, 109, 108, 107, 105,
- 104, 103, 101, 100, 99, 97, 96, 95, 93, 92, 91, 89, 88, 87, 85, 84, 83, 81, 80, 79, 77, 76, 75,
- 73, 72, 71, 69, 68, 67, 66, 64, 63, 62, 60, 59, 58, 57, 55, 54, 53, 52, 50, 49, 48, 47, 45, 44,
- 43, 42, 40, 39, 38, 37, 36, 34, 33, 32, 31, 30, 28, 27, 26, 25, 24, 23, 21, 20, 19, 18, 17, 16,
- 15, 14, 13, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0, -1, -2, -3, -4, -5, -6, -7, -7, -8, -9, -10,
- -11, -12, -12, -13, -14, -15, -15, -16, -17, -17, -18, -19, -19, -20, -21, -21, -22, -22, -23, -24,
- -24, -25, -25, -26, -26, -27, -27, -27, -28, -28, -29, -29, -30, -30, -30, -31, -31, -31, -32, -32,
- -32, -33, -33, -33, -33, -34, -34, -34, -34, -35, -35, -35, -35, -35, -36, -36, -36, -36, -36, -36,
- -36, -36, -36, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37,
- -37, -37, -37, -37, -36, -36, -36, -36, -36, -36, -36, -36, -36, -35, -35, -35, -35, -35, -35, -34,
- -34, -34, -34, -34, -33, -33, -33, -33, -33, -32, -32, -32, -32, -31, -31, -31, -31, -30, -30, -30,
- -30, -29, -29, -29, -29, -28, -28, -28, -27, -27, -27, -27, -26, -26, -26, -25, -25, -25, -24, -24,
- -24, -23, -23, -23, -22, -22, -22, -22, -21, -21, -21, -20, -20, -20, -19, -19, -19, -18, -18, -18,
- -17, -17, -17, -16, -16, -16, -15, -15, -15, -14, -14, -14, -13, -13, -13, -12, -12, -12, -11, -11,
- -11, -10, -10, -10, -9, -9, -9, -9, -8, -8, -8, -7, -7, -7, -7, -6, -6, -6, -6, -5, -5, -5, -5, -4,
- -4, -4, -4, -3, -3, -3, -3, -3, -2, -2, -2, -2, -2, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-};
-class CFX_BilinearMatrix : public CPDF_FixedMatrix
-{
-public:
- CFX_BilinearMatrix(const CFX_AffineMatrix& src, int bits): CPDF_FixedMatrix(src, bits)
- {}
- inline void Transform(int x, int y, int& x1, int& y1, int&res_x, int&res_y)
- {
- x1 = a * x + c * y + e + base / 2;
- y1 = b * x + d * y + f + base / 2;
- res_x = x1 % base;
- res_y = y1 % base;
- if (res_x < 0 && res_x > -base) {
- res_x = base + res_x;
- }
- if (res_y < 0 && res_x > -base) {
- res_y = base + res_y;
- }
- x1 /= base;
- y1 /= base;
- }
-};
-CFX_DIBitmap* CFX_DIBSource::SwapXY(FX_BOOL bXFlip, FX_BOOL bYFlip, const FX_RECT* pDestClip) const
-{
- FX_RECT dest_clip(0, 0, m_Height, m_Width);
- if (pDestClip) {
- dest_clip.Intersect(*pDestClip);
- }
- if (dest_clip.IsEmpty()) {
- return NULL;
- }
- CFX_DIBitmap* pTransBitmap = FX_NEW CFX_DIBitmap;
- if (!pTransBitmap) {
- return NULL;
- }
- int result_height = dest_clip.Height(), result_width = dest_clip.Width();
- if (!pTransBitmap->Create(result_width, result_height, GetFormat())) {
- delete pTransBitmap;
- return NULL;
- }
- pTransBitmap->CopyPalette(m_pPalette);
- int src_pitch = m_Pitch;
- int dest_pitch = pTransBitmap->GetPitch();
- FX_LPBYTE dest_buf = pTransBitmap->GetBuffer();
- int row_start = bXFlip ? m_Height - dest_clip.right : dest_clip.left;
- int row_end = bXFlip ? m_Height - dest_clip.left : dest_clip.right;
- int col_start = bYFlip ? m_Width - dest_clip.bottom : dest_clip.top;
- int col_end = bYFlip ? m_Width - dest_clip.top : dest_clip.bottom;
- if (GetBPP() == 1) {
- FXSYS_memset8(dest_buf, 0xff, dest_pitch * result_height);
- for (int row = row_start; row < row_end; row ++) {
- FX_LPCBYTE src_scan = GetScanline(row);
- int dest_col = (bXFlip ? dest_clip.right - (row - row_start) - 1 : row) - dest_clip.left;
- FX_LPBYTE dest_scan = dest_buf;
- if (bYFlip) {
- dest_scan += (result_height - 1) * dest_pitch;
- }
- int dest_step = bYFlip ? -dest_pitch : dest_pitch;
- for (int col = col_start; col < col_end; col ++) {
- if (!(src_scan[col / 8] & (1 << (7 - col % 8)))) {
- dest_scan[dest_col / 8] &= ~(1 << (7 - dest_col % 8));
- }
- dest_scan += dest_step;
- }
- }
- } else {
- int nBytes = GetBPP() / 8;
- int dest_step = bYFlip ? -dest_pitch : dest_pitch;
- if (nBytes == 3) {
- dest_step -= 2;
- }
- for (int row = row_start; row < row_end; row ++) {
- int dest_col = (bXFlip ? dest_clip.right - (row - row_start) - 1 : row) - dest_clip.left;
- FX_LPBYTE dest_scan = dest_buf + dest_col * nBytes;
- if (bYFlip) {
- dest_scan += (result_height - 1) * dest_pitch;
- }
- if (nBytes == 4) {
- FX_DWORD* src_scan = (FX_DWORD*)GetScanline(row) + col_start;
- for (int col = col_start; col < col_end; col ++) {
- *(FX_DWORD*)dest_scan = *src_scan++;
- dest_scan += dest_step;
- }
- } else {
- FX_LPCBYTE src_scan = GetScanline(row) + col_start * nBytes;
- if (nBytes == 1)
- for (int col = col_start; col < col_end; col ++) {
- *dest_scan = *src_scan++;
- dest_scan += dest_step;
- }
- else
- for (int col = col_start; col < col_end; col ++) {
- *dest_scan++ = *src_scan++;
- *dest_scan++ = *src_scan++;
- *dest_scan = *src_scan++;
- dest_scan += dest_step;
- }
- }
- }
- }
- if (m_pAlphaMask) {
- src_pitch = m_pAlphaMask->m_Pitch;
- dest_pitch = pTransBitmap->m_pAlphaMask->GetPitch();
- dest_buf = pTransBitmap->m_pAlphaMask->GetBuffer();
- int dest_step = bYFlip ? -dest_pitch : dest_pitch;
- for (int row = row_start; row < row_end; row ++) {
- int dest_col = (bXFlip ? dest_clip.right - (row - row_start) - 1 : row) - dest_clip.left;
- FX_LPBYTE dest_scan = dest_buf + dest_col;
- if (bYFlip) {
- dest_scan += (result_height - 1) * dest_pitch;
- }
- FX_LPCBYTE src_scan = m_pAlphaMask->GetScanline(row) + col_start;
- for (int col = col_start; col < col_end; col ++) {
- *dest_scan = *src_scan++;
- dest_scan += dest_step;
- }
- }
- }
- return pTransBitmap;
-}
-#define FIX16_005 0.05f
-FX_RECT _FXDIB_SwapClipBox(FX_RECT& clip, int width, int height, FX_BOOL bFlipX, FX_BOOL bFlipY)
-{
- FX_RECT rect;
- if (bFlipY) {
- rect.left = height - clip.top;
- rect.right = height - clip.bottom;
- } else {
- rect.left = clip.top;
- rect.right = clip.bottom;
- }
- if (bFlipX) {
- rect.top = width - clip.left;
- rect.bottom = width - clip.right;
- } else {
- rect.top = clip.left;
- rect.bottom = clip.right;
- }
- rect.Normalize();
- return rect;
-}
-CFX_DIBitmap* CFX_DIBSource::TransformTo(const CFX_AffineMatrix* pDestMatrix, int& result_left, int& result_top,
- FX_DWORD flags, const FX_RECT* pDestClip) const
-{
- CFX_ImageTransformer transformer;
- transformer.Start(this, pDestMatrix, flags, pDestClip);
- transformer.Continue(NULL);
- result_left = transformer.m_ResultLeft;
- result_top = transformer.m_ResultTop;
- CFX_DIBitmap* pTransformed = transformer.m_Storer.Detach();
- return pTransformed;
-}
-CFX_DIBitmap* CFX_DIBSource::StretchTo(int dest_width, int dest_height, FX_DWORD flags, const FX_RECT* pClip) const
-{
- FX_RECT clip_rect(0, 0, FXSYS_abs(dest_width), FXSYS_abs(dest_height));
- if (pClip) {
- clip_rect.Intersect(*pClip);
- }
- if (clip_rect.IsEmpty()) {
- return NULL;
- }
- if (dest_width == m_Width && dest_height == m_Height) {
- return Clone(&clip_rect);
- }
- CFX_ImageStretcher stretcher;
- CFX_BitmapStorer storer;
- if (stretcher.Start(&storer, this, dest_width, dest_height, clip_rect, flags)) {
- stretcher.Continue(NULL);
- }
- return storer.Detach();
-}
-CFX_ImageTransformer::CFX_ImageTransformer()
-{
- m_Status = 0;
- m_pMatrix = NULL;
-}
-CFX_ImageTransformer::~CFX_ImageTransformer()
-{
-}
-FX_BOOL CFX_ImageTransformer::Start(const CFX_DIBSource* pSrc, const CFX_AffineMatrix* pDestMatrix, int flags, const FX_RECT* pDestClip)
-{
- m_pMatrix = (CFX_AffineMatrix*)pDestMatrix;
- CFX_FloatRect unit_rect = pDestMatrix->GetUnitRect();
- FX_RECT result_rect = unit_rect.GetClosestRect();
- FX_RECT result_clip = result_rect;
- if (pDestClip) {
- result_clip.Intersect(*pDestClip);
- }
- if (result_clip.IsEmpty()) {
- return FALSE;
- }
- m_ResultLeft = result_clip.left;
- m_ResultTop = result_clip.top;
- m_ResultWidth = result_clip.Width();
- m_ResultHeight = result_clip.Height();
- m_Flags = flags;
- if (FXSYS_fabs(pDestMatrix->a) < FXSYS_fabs(pDestMatrix->b) / 20 &&
- FXSYS_fabs(pDestMatrix->d) < FXSYS_fabs(pDestMatrix->c) / 20 &&
- FXSYS_fabs(pDestMatrix->a) < 0.5f && FXSYS_fabs(pDestMatrix->d) < 0.5f) {
- int dest_width = result_rect.Width();
- int dest_height = result_rect.Height();
- result_clip.Offset(-result_rect.left, -result_rect.top);
- result_clip = _FXDIB_SwapClipBox(result_clip, dest_width, dest_height, pDestMatrix->c > 0, pDestMatrix->b < 0);
- m_Stretcher.Start(&m_Storer, pSrc, dest_height, dest_width, result_clip, flags);
- m_Status = 1;
- return TRUE;
- }
- if (FXSYS_fabs(pDestMatrix->b) < FIX16_005 && FXSYS_fabs(pDestMatrix->c) < FIX16_005) {
- int dest_width = pDestMatrix->a > 0 ? (int)FXSYS_ceil(pDestMatrix->a) : (int)FXSYS_floor(pDestMatrix->a);
- int dest_height = pDestMatrix->d > 0 ? (int) - FXSYS_ceil(pDestMatrix->d) : (int) - FXSYS_floor(pDestMatrix->d);
- result_clip.Offset(-result_rect.left, -result_rect.top);
- m_Stretcher.Start(&m_Storer, pSrc, dest_width, dest_height, result_clip, flags);
- m_Status = 2;
- return TRUE;
- }
- int stretch_width = (int)FXSYS_ceil(FXSYS_sqrt2(pDestMatrix->a, pDestMatrix->b));
- int stretch_height = (int)FXSYS_ceil(FXSYS_sqrt2(pDestMatrix->c, pDestMatrix->d));
- CFX_AffineMatrix stretch2dest(1.0f, 0.0f, 0.0f, -1.0f, 0.0f, (FX_FLOAT)(stretch_height));
- stretch2dest.Concat(pDestMatrix->a / stretch_width, pDestMatrix->b / stretch_width,
- pDestMatrix->c / stretch_height, pDestMatrix->d / stretch_height, pDestMatrix->e, pDestMatrix->f);
- m_dest2stretch.SetReverse(stretch2dest);
- CFX_FloatRect clip_rect_f(result_clip);
- clip_rect_f.Transform(&m_dest2stretch);
- m_StretchClip = clip_rect_f.GetOutterRect();
- m_StretchClip.Intersect(0, 0, stretch_width, stretch_height);
- m_Stretcher.Start(&m_Storer, pSrc, stretch_width, stretch_height, m_StretchClip, flags);
- m_Status = 3;
- return TRUE;
-}
-FX_BYTE _bilinear_interpol(FX_LPCBYTE buf, int row_offset_l, int row_offset_r,
- int src_col_l, int src_col_r, int res_x, int res_y,
- int bpp, int c_offset)
-{
- int i_resx = 255 - res_x;
- int col_bpp_l = src_col_l * bpp;
- int col_bpp_r = src_col_r * bpp;
- FX_LPCBYTE buf_u = buf + row_offset_l + c_offset;
- FX_LPCBYTE buf_d = buf + row_offset_r + c_offset;
- FX_LPCBYTE src_pos0 = buf_u + col_bpp_l;
- FX_LPCBYTE src_pos1 = buf_u + col_bpp_r;
- FX_LPCBYTE src_pos2 = buf_d + col_bpp_l;
- FX_LPCBYTE src_pos3 = buf_d + col_bpp_r;
- FX_BYTE r_pos_0 = (*src_pos0 * i_resx + *src_pos1 * res_x) >> 8;
- FX_BYTE r_pos_1 = (*src_pos2 * i_resx + *src_pos3 * res_x) >> 8;
- return (r_pos_0 * (255 - res_y) + r_pos_1 * res_y) >> 8;
-}
-FX_BYTE _bicubic_interpol(FX_LPCBYTE buf, int pitch, int pos_pixel[], int u_w[], int v_w[], int res_x, int res_y,
- int bpp, int c_offset)
-{
- int s_result = 0;
- for (int i = 0; i < 4; i ++) {
- int a_result = 0;
- for (int j = 0; j < 4; j ++) {
- a_result += u_w[j] * (*(FX_BYTE*)(buf + pos_pixel[i + 4] * pitch + pos_pixel[j] * bpp + c_offset));
- }
- s_result += a_result * v_w[i];
- }
- s_result >>= 16;
- return (FX_BYTE)(s_result < 0 ? 0 : s_result > 255 ? 255 : s_result);
-}
-void _bicubic_get_pos_weight(int pos_pixel[], int u_w[], int v_w[], int src_col_l, int src_row_l,
- int res_x, int res_y, int stretch_width, int stretch_height)
-{
- pos_pixel[0] = src_col_l - 1;
- pos_pixel[1] = src_col_l;
- pos_pixel[2] = src_col_l + 1;
- pos_pixel[3] = src_col_l + 2;
- pos_pixel[4] = src_row_l - 1;
- pos_pixel[5] = src_row_l;
- pos_pixel[6] = src_row_l + 1;
- pos_pixel[7] = src_row_l + 2;
- for (int i = 0 ; i < 4; i ++) {
- if (pos_pixel[i] < 0) {
- pos_pixel[i] = 0;
- }
- if (pos_pixel[i] >= stretch_width) {
- pos_pixel[i] = stretch_width - 1;
- }
- if (pos_pixel[i + 4] < 0) {
- pos_pixel[i + 4] = 0;
- }
- if (pos_pixel[i + 4] >= stretch_height) {
- pos_pixel[i + 4] = stretch_height - 1;
- }
- }
- u_w[0] = SDP_Table[256 + res_x];
- u_w[1] = SDP_Table[res_x];
- u_w[2] = SDP_Table[256 - res_x];
- u_w[3] = SDP_Table[512 - res_x];
- v_w[0] = SDP_Table[256 + res_y];
- v_w[1] = SDP_Table[res_y];
- v_w[2] = SDP_Table[256 - res_y];
- v_w[3] = SDP_Table[512 - res_y];
-}
-FXDIB_Format _GetTransformedFormat(const CFX_DIBSource* pDrc)
-{
- FXDIB_Format format = pDrc->GetFormat();
- if (pDrc->IsAlphaMask()) {
- format = FXDIB_8bppMask;
- } else if (format >= 1025) {
- format = FXDIB_Cmyka;
- } else if (format <= 32 || format == FXDIB_Argb) {
- format = FXDIB_Argb;
- } else {
- format = FXDIB_Rgba;
- }
- return format;
-}
-FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause)
-{
- if (m_Status == 1) {
- if (m_Stretcher.Continue(pPause)) {
- return TRUE;
- }
- if (m_Storer.GetBitmap()) {
- m_Storer.Replace(m_Storer.GetBitmap()->SwapXY(m_pMatrix->c > 0, m_pMatrix->b < 0));
- }
- return FALSE;
- } else if (m_Status == 2) {
- return m_Stretcher.Continue(pPause);
- } else if (m_Status != 3) {
- return FALSE;
- }
- if (m_Stretcher.Continue(pPause)) {
- return TRUE;
- }
- int stretch_width = m_StretchClip.Width();
- int stretch_height = m_StretchClip.Height();
- if (m_Storer.GetBitmap() == NULL) {
- return FALSE;
- }
- FX_LPCBYTE stretch_buf = m_Storer.GetBitmap()->GetBuffer();
- FX_LPCBYTE stretch_buf_mask = NULL;
- if (m_Storer.GetBitmap()->m_pAlphaMask) {
- stretch_buf_mask = m_Storer.GetBitmap()->m_pAlphaMask->GetBuffer();
- }
- int stretch_pitch = m_Storer.GetBitmap()->GetPitch();
- CFX_DIBitmap* pTransformed = FX_NEW CFX_DIBitmap;
- if (!pTransformed) {
- return FALSE;
- }
- FXDIB_Format transformF = _GetTransformedFormat(m_Stretcher.m_pSource);
- if (!pTransformed->Create(m_ResultWidth, m_ResultHeight, transformF)) {
- delete pTransformed;
- return FALSE;
- }
- pTransformed->Clear(0);
- if (pTransformed->m_pAlphaMask) {
- pTransformed->m_pAlphaMask->Clear(0);
- }
- CFX_AffineMatrix result2stretch(1.0f, 0.0f, 0.0f, 1.0f, (FX_FLOAT)(m_ResultLeft), (FX_FLOAT)(m_ResultTop));
- result2stretch.Concat(m_dest2stretch);
- result2stretch.TranslateI(-m_StretchClip.left, -m_StretchClip.top);
- if (stretch_buf_mask == NULL && pTransformed->m_pAlphaMask) {
- pTransformed->m_pAlphaMask->Clear(0xff000000);
- } else if (pTransformed->m_pAlphaMask) {
- int stretch_pitch_mask = m_Storer.GetBitmap()->m_pAlphaMask->GetPitch();
- if (!(m_Flags & FXDIB_DOWNSAMPLE) && !(m_Flags & FXDIB_BICUBIC_INTERPOL)) {
- CFX_BilinearMatrix result2stretch_fix(result2stretch, 8);
- for (int row = 0; row < m_ResultHeight; row ++) {
- FX_BYTE* dest_pos_mask = (FX_BYTE*)pTransformed->m_pAlphaMask->GetScanline(row);
- for (int col = 0; col < m_ResultWidth; col ++) {
- int src_col_l, src_row_l, res_x, res_y;
- result2stretch_fix.Transform(col, row, src_col_l, src_row_l, res_x, res_y);
- if (src_col_l >= 0 && src_col_l <= stretch_width && src_row_l >= 0 && src_row_l <= stretch_height) {
- if (src_col_l == stretch_width) {
- src_col_l--;
- }
- if (src_row_l == stretch_height) {
- src_row_l--;
- }
- int src_col_r = src_col_l + 1;
- int src_row_r = src_row_l + 1;
- if (src_col_r == stretch_width) {
- src_col_r--;
- }
- if (src_row_r == stretch_height) {
- src_row_r--;
- }
- int row_offset_l = src_row_l * stretch_pitch_mask;
- int row_offset_r = src_row_r * stretch_pitch_mask;
- *dest_pos_mask = _bilinear_interpol(stretch_buf_mask, row_offset_l, row_offset_r, src_col_l, src_col_r, res_x, res_y, 1, 0);
- }
- dest_pos_mask++;
- }
- }
- } else if (m_Flags & FXDIB_BICUBIC_INTERPOL) {
- CFX_BilinearMatrix result2stretch_fix(result2stretch, 8);
- int pos_pixel[8];
- for (int row = 0; row < m_ResultHeight; row ++) {
- FX_BYTE* dest_pos_mask = (FX_BYTE*)pTransformed->m_pAlphaMask->GetScanline(row);
- for (int col = 0; col < m_ResultWidth; col ++) {
- int src_col_l, src_row_l, res_x, res_y;
- result2stretch_fix.Transform(col, row, src_col_l, src_row_l, res_x, res_y);
- if (src_col_l >= 0 && src_col_l <= stretch_width && src_row_l >= 0 && src_row_l <= stretch_height) {
- int u_w[4], v_w[4];
- if (src_col_l == stretch_width) {
- src_col_l--;
- }
- if (src_row_l == stretch_height) {
- src_row_l--;
- }
- _bicubic_get_pos_weight(pos_pixel, u_w, v_w, src_col_l, src_row_l, res_x, res_y, stretch_width, stretch_height);
- *dest_pos_mask = _bicubic_interpol(stretch_buf_mask, stretch_pitch_mask, pos_pixel, u_w, v_w, res_x, res_y, 1, 0);
- }
- dest_pos_mask++;
- }
- }
- } else {
- CPDF_FixedMatrix result2stretch_fix(result2stretch, 8);
- for (int row = 0; row < m_ResultHeight; row ++) {
- FX_BYTE* dest_pos_mask = (FX_BYTE*)pTransformed->m_pAlphaMask->GetScanline(row);
- for (int col = 0; col < m_ResultWidth; col ++) {
- int src_col, src_row;
- result2stretch_fix.Transform(col, row, src_col, src_row);
- if (src_col >= 0 && src_col <= stretch_width && src_row >= 0 && src_row <= stretch_height) {
- if (src_col == stretch_width) {
- src_col --;
- }
- if (src_row == stretch_height) {
- src_row --;
- }
- *dest_pos_mask = stretch_buf_mask[src_row * stretch_pitch_mask + src_col];
- }
- dest_pos_mask++;
- }
- }
- }
- }
- if (m_Storer.GetBitmap()->IsAlphaMask()) {
- if (!(m_Flags & FXDIB_DOWNSAMPLE) && !(m_Flags & FXDIB_BICUBIC_INTERPOL)) {
- CFX_BilinearMatrix result2stretch_fix(result2stretch, 8);
- for (int row = 0; row < m_ResultHeight; row ++) {
- FX_LPBYTE dest_scan = (FX_LPBYTE)pTransformed->GetScanline(row);
- for (int col = 0; col < m_ResultWidth; col ++) {
- int src_col_l, src_row_l, res_x, res_y;
- result2stretch_fix.Transform(col, row, src_col_l, src_row_l, res_x, res_y);
- if (src_col_l >= 0 && src_col_l <= stretch_width && src_row_l >= 0 && src_row_l <= stretch_height) {
- if (src_col_l == stretch_width) {
- src_col_l--;
- }
- if (src_row_l == stretch_height) {
- src_row_l--;
- }
- int src_col_r = src_col_l + 1;
- int src_row_r = src_row_l + 1;
- if (src_col_r == stretch_width) {
- src_col_r--;
- }
- if (src_row_r == stretch_height) {
- src_row_r--;
- }
- int row_offset_l = src_row_l * stretch_pitch;
- int row_offset_r = src_row_r * stretch_pitch;
- *dest_scan = _bilinear_interpol(stretch_buf, row_offset_l, row_offset_r, src_col_l, src_col_r, res_x, res_y, 1, 0);
- }
- dest_scan ++;
- }
- }
- } else if (m_Flags & FXDIB_BICUBIC_INTERPOL) {
- CFX_BilinearMatrix result2stretch_fix(result2stretch, 8);
- int pos_pixel[8];
- for (int row = 0; row < m_ResultHeight; row ++) {
- FX_LPBYTE dest_scan = (FX_LPBYTE)pTransformed->GetScanline(row);
- for (int col = 0; col < m_ResultWidth; col ++) {
- int src_col_l, src_row_l, res_x, res_y;
- result2stretch_fix.Transform(col, row, src_col_l, src_row_l, res_x, res_y);
- if (src_col_l >= 0 && src_col_l <= stretch_width && src_row_l >= 0 && src_row_l <= stretch_height) {
- int u_w[4], v_w[4];
- if (src_col_l == stretch_width) {
- src_col_l--;
- }
- if (src_row_l == stretch_height) {
- src_row_l--;
- }
- _bicubic_get_pos_weight(pos_pixel, u_w, v_w, src_col_l, src_row_l, res_x, res_y, stretch_width, stretch_height);
- *dest_scan = _bicubic_interpol(stretch_buf, stretch_pitch, pos_pixel, u_w, v_w, res_x, res_y, 1, 0);
- }
- dest_scan ++;
- }
- }
- } else {
- CPDF_FixedMatrix result2stretch_fix(result2stretch, 8);
- for (int row = 0; row < m_ResultHeight; row ++) {
- FX_LPBYTE dest_scan = (FX_LPBYTE)pTransformed->GetScanline(row);
- for (int col = 0; col < m_ResultWidth; col ++) {
- int src_col, src_row;
- result2stretch_fix.Transform(col, row, src_col, src_row);
- if (src_col >= 0 && src_col <= stretch_width && src_row >= 0 && src_row <= stretch_height) {
- if (src_col == stretch_width) {
- src_col --;
- }
- if (src_row == stretch_height) {
- src_row --;
- }
- FX_LPCBYTE src_pixel = stretch_buf + stretch_pitch * src_row + src_col;
- *dest_scan = *src_pixel;
- }
- dest_scan ++;
- }
- }
- }
- } else {
- int Bpp = m_Storer.GetBitmap()->GetBPP() / 8;
- int destBpp = pTransformed->GetBPP() / 8;
- if (Bpp == 1) {
- FX_BOOL bHasAlpha = m_Storer.GetBitmap()->HasAlpha();
- FX_DWORD argb[256];
- FX_ARGB* pPal = m_Storer.GetBitmap()->GetPalette();
- if (pPal) {
- for (int i = 0; i < 256; i ++) {
- argb[i] = pPal[i];
- }
- } else {
- if (m_Storer.GetBitmap()->IsCmykImage())
- for (int i = 0; i < 256; i ++) {
- argb[i] = 255 - i;
- }
- else
- for (int i = 0; i < 256; i ++) {
- argb[i] = 0xff000000 | (i * 0x010101);
- }
- }
- if (!(m_Flags & FXDIB_DOWNSAMPLE) && !(m_Flags & FXDIB_BICUBIC_INTERPOL)) {
- CFX_BilinearMatrix result2stretch_fix(result2stretch, 8);
- for (int row = 0; row < m_ResultHeight; row ++) {
- FX_BYTE* dest_pos = (FX_BYTE*)pTransformed->GetScanline(row);
- for (int col = 0; col < m_ResultWidth; col ++) {
- int src_col_l, src_row_l, res_x, res_y;
- result2stretch_fix.Transform(col, row, src_col_l, src_row_l, res_x, res_y);
- if (src_col_l >= 0 && src_col_l <= stretch_width && src_row_l >= 0 && src_row_l <= stretch_height) {
- if (src_col_l == stretch_width) {
- src_col_l--;
- }
- if (src_row_l == stretch_height) {
- src_row_l--;
- }
- int src_col_r = src_col_l + 1;
- int src_row_r = src_row_l + 1;
- if (src_col_r == stretch_width) {
- src_col_r--;
- }
- if (src_row_r == stretch_height) {
- src_row_r--;
- }
- int row_offset_l = src_row_l * stretch_pitch;
- int row_offset_r = src_row_r * stretch_pitch;
- FX_DWORD r_bgra_cmyk = argb[_bilinear_interpol(stretch_buf, row_offset_l, row_offset_r, src_col_l, src_col_r, res_x, res_y, 1, 0)];
- if (transformF == FXDIB_Rgba) {
- dest_pos[0] = (FX_BYTE)(r_bgra_cmyk >> 24);
- dest_pos[1] = (FX_BYTE)(r_bgra_cmyk >> 16);
- dest_pos[2] = (FX_BYTE)(r_bgra_cmyk >> 8);
- } else {
- *(FX_DWORD*)dest_pos = r_bgra_cmyk;
- }
- }
- dest_pos += destBpp;
- }
- }
- } else if (m_Flags & FXDIB_BICUBIC_INTERPOL) {
- CFX_BilinearMatrix result2stretch_fix(result2stretch, 8);
- int pos_pixel[8];
- for (int row = 0; row < m_ResultHeight; row ++) {
- FX_BYTE* dest_pos = (FX_BYTE*)pTransformed->GetScanline(row);
- for (int col = 0; col < m_ResultWidth; col ++) {
- int src_col_l, src_row_l, res_x, res_y;
- result2stretch_fix.Transform(col, row, src_col_l, src_row_l, res_x, res_y);
- if (src_col_l >= 0 && src_col_l <= stretch_width && src_row_l >= 0 && src_row_l <= stretch_height) {
- int u_w[4], v_w[4];
- if (src_col_l == stretch_width) {
- src_col_l--;
- }
- if (src_row_l == stretch_height) {
- src_row_l--;
- }
- _bicubic_get_pos_weight(pos_pixel, u_w, v_w, src_col_l, src_row_l, res_x, res_y, stretch_width, stretch_height);
- FX_DWORD r_bgra_cmyk = argb[_bicubic_interpol(stretch_buf, stretch_pitch, pos_pixel, u_w, v_w, res_x, res_y, 1, 0)];
- if (transformF == FXDIB_Rgba) {
- dest_pos[0] = (FX_BYTE)(r_bgra_cmyk >> 24);
- dest_pos[1] = (FX_BYTE)(r_bgra_cmyk >> 16);
- dest_pos[2] = (FX_BYTE)(r_bgra_cmyk >> 8);
- } else {
- *(FX_DWORD*)dest_pos = r_bgra_cmyk;
- }
- }
- dest_pos += destBpp;
- }
- }
- } else {
- CPDF_FixedMatrix result2stretch_fix(result2stretch, 8);
- for (int row = 0; row < m_ResultHeight; row ++) {
- FX_BYTE* dest_pos = (FX_BYTE*)pTransformed->GetScanline(row);
- for (int col = 0; col < m_ResultWidth; col ++) {
- int src_col, src_row;
- result2stretch_fix.Transform(col, row, src_col, src_row);
- if (src_col >= 0 && src_col <= stretch_width && src_row >= 0 && src_row <= stretch_height) {
- if (src_col == stretch_width) {
- src_col --;
- }
- if (src_row == stretch_height) {
- src_row --;
- }
- FX_DWORD r_bgra_cmyk = argb[stretch_buf[src_row * stretch_pitch + src_col]];
- if (transformF == FXDIB_Rgba) {
- dest_pos[0] = (FX_BYTE)(r_bgra_cmyk >> 24);
- dest_pos[1] = (FX_BYTE)(r_bgra_cmyk >> 16);
- dest_pos[2] = (FX_BYTE)(r_bgra_cmyk >> 8);
- } else {
- *(FX_DWORD*)dest_pos = r_bgra_cmyk;
- }
- }
- dest_pos += destBpp;
- }
- }
- }
- } else {
- FX_BOOL bHasAlpha = m_Storer.GetBitmap()->HasAlpha();
- int destBpp = pTransformed->GetBPP() / 8;
- if (!(m_Flags & FXDIB_DOWNSAMPLE) && !(m_Flags & FXDIB_BICUBIC_INTERPOL)) {
- CFX_BilinearMatrix result2stretch_fix(result2stretch, 8);
- for (int row = 0; row < m_ResultHeight; row ++) {
- FX_BYTE* dest_pos = (FX_BYTE*)pTransformed->GetScanline(row);
- for (int col = 0; col < m_ResultWidth; col ++) {
- int src_col_l, src_row_l, res_x, res_y, r_pos_k_r = 0;
- result2stretch_fix.Transform(col, row, src_col_l, src_row_l, res_x, res_y);
- if (src_col_l >= 0 && src_col_l <= stretch_width && src_row_l >= 0 && src_row_l <= stretch_height) {
- if (src_col_l == stretch_width) {
- src_col_l--;
- }
- if (src_row_l == stretch_height) {
- src_row_l--;
- }
- int src_col_r = src_col_l + 1;
- int src_row_r = src_row_l + 1;
- if (src_col_r == stretch_width) {
- src_col_r--;
- }
- if (src_row_r == stretch_height) {
- src_row_r--;
- }
- int row_offset_l = src_row_l * stretch_pitch;
- int row_offset_r = src_row_r * stretch_pitch;
- FX_BYTE r_pos_red_y_r = _bilinear_interpol(stretch_buf, row_offset_l, row_offset_r, src_col_l, src_col_r, res_x, res_y, Bpp, 2);
- FX_BYTE r_pos_green_m_r = _bilinear_interpol(stretch_buf, row_offset_l, row_offset_r, src_col_l, src_col_r, res_x, res_y, Bpp, 1);
- FX_BYTE r_pos_blue_c_r = _bilinear_interpol(stretch_buf, row_offset_l, row_offset_r, src_col_l, src_col_r, res_x, res_y, Bpp, 0);
- if (bHasAlpha) {
- if (transformF != FXDIB_Argb) {
- if (transformF == FXDIB_Rgba) {
- dest_pos[0] = r_pos_blue_c_r;
- dest_pos[1] = r_pos_green_m_r;
- dest_pos[2] = r_pos_red_y_r;
- } else {
- r_pos_k_r = _bilinear_interpol(stretch_buf, row_offset_l, row_offset_r, src_col_l, src_col_r, res_x, res_y, Bpp, 3);
- *(FX_DWORD*)dest_pos = FXCMYK_TODIB(CmykEncode(r_pos_blue_c_r, r_pos_green_m_r, r_pos_red_y_r, r_pos_k_r));
- }
- } else {
- FX_BYTE r_pos_a_r = _bilinear_interpol(stretch_buf, row_offset_l, row_offset_r, src_col_l, src_col_r, res_x, res_y, Bpp, 3);
- *(FX_DWORD*)dest_pos = FXARGB_TODIB(FXARGB_MAKE(r_pos_a_r, r_pos_red_y_r, r_pos_green_m_r, r_pos_blue_c_r));
- }
- } else {
- r_pos_k_r = 0xff;
- if (transformF == FXDIB_Cmyka) {
- r_pos_k_r = _bilinear_interpol(stretch_buf, row_offset_l, row_offset_r, src_col_l, src_col_r, res_x, res_y, Bpp, 3);
- *(FX_DWORD*)dest_pos = FXCMYK_TODIB(CmykEncode(r_pos_blue_c_r, r_pos_green_m_r, r_pos_red_y_r, r_pos_k_r));
- } else {
- *(FX_DWORD*)dest_pos = FXARGB_TODIB(FXARGB_MAKE(r_pos_k_r, r_pos_red_y_r, r_pos_green_m_r, r_pos_blue_c_r));
- }
- }
- }
- dest_pos += destBpp;
- }
- }
- } else if (m_Flags & FXDIB_BICUBIC_INTERPOL) {
- CFX_BilinearMatrix result2stretch_fix(result2stretch, 8);
- int pos_pixel[8];
- for (int row = 0; row < m_ResultHeight; row ++) {
- FX_BYTE* dest_pos = (FX_BYTE*)pTransformed->GetScanline(row);
- for (int col = 0; col < m_ResultWidth; col ++) {
- int src_col_l, src_row_l, res_x, res_y, r_pos_k_r = 0;
- result2stretch_fix.Transform(col, row, src_col_l, src_row_l, res_x, res_y);
- if (src_col_l >= 0 && src_col_l <= stretch_width && src_row_l >= 0 && src_row_l <= stretch_height) {
- int u_w[4], v_w[4];
- if (src_col_l == stretch_width) {
- src_col_l--;
- }
- if (src_row_l == stretch_height) {
- src_row_l--;
- }
- _bicubic_get_pos_weight(pos_pixel, u_w, v_w, src_col_l, src_row_l, res_x, res_y, stretch_width, stretch_height);
- FX_BYTE r_pos_red_y_r = _bicubic_interpol(stretch_buf, stretch_pitch, pos_pixel, u_w, v_w, res_x, res_y, Bpp, 2);
- FX_BYTE r_pos_green_m_r = _bicubic_interpol(stretch_buf, stretch_pitch, pos_pixel, u_w, v_w, res_x, res_y, Bpp, 1);
- FX_BYTE r_pos_blue_c_r = _bicubic_interpol(stretch_buf, stretch_pitch, pos_pixel, u_w, v_w, res_x, res_y, Bpp, 0);
- if (bHasAlpha) {
- if (transformF != FXDIB_Argb) {
- if (transformF == FXDIB_Rgba) {
- dest_pos[0] = r_pos_blue_c_r;
- dest_pos[1] = r_pos_green_m_r;
- dest_pos[2] = r_pos_red_y_r;
- } else {
- r_pos_k_r = _bicubic_interpol(stretch_buf, stretch_pitch, pos_pixel, u_w, v_w, res_x, res_y, Bpp, 3);
- *(FX_DWORD*)dest_pos = FXCMYK_TODIB(CmykEncode(r_pos_blue_c_r, r_pos_green_m_r, r_pos_red_y_r, r_pos_k_r));
- }
- } else {
- FX_BYTE r_pos_a_r = _bicubic_interpol(stretch_buf, stretch_pitch, pos_pixel, u_w, v_w, res_x, res_y, Bpp, 3);
- *(FX_DWORD*)dest_pos = FXARGB_TODIB(FXARGB_MAKE(r_pos_a_r, r_pos_red_y_r, r_pos_green_m_r, r_pos_blue_c_r));
- }
- } else {
- r_pos_k_r = 0xff;
- if (transformF == FXDIB_Cmyka) {
- r_pos_k_r = _bicubic_interpol(stretch_buf, stretch_pitch, pos_pixel, u_w, v_w, res_x, res_y, Bpp, 3);
- *(FX_DWORD*)dest_pos = FXCMYK_TODIB(CmykEncode(r_pos_blue_c_r, r_pos_green_m_r, r_pos_red_y_r, r_pos_k_r));
- } else {
- *(FX_DWORD*)dest_pos = FXARGB_TODIB(FXARGB_MAKE(r_pos_k_r, r_pos_red_y_r, r_pos_green_m_r, r_pos_blue_c_r));
- }
- }
- }
- dest_pos += destBpp;
- }
- }
- } else {
- CPDF_FixedMatrix result2stretch_fix(result2stretch, 8);
- for (int row = 0; row < m_ResultHeight; row ++) {
- FX_BYTE* dest_pos = (FX_BYTE*)pTransformed->GetScanline(row);
- for (int col = 0; col < m_ResultWidth; col ++) {
- int src_col, src_row;
- result2stretch_fix.Transform(col, row, src_col, src_row);
- if (src_col >= 0 && src_col <= stretch_width && src_row >= 0 && src_row <= stretch_height) {
- if (src_col == stretch_width) {
- src_col --;
- }
- if (src_row == stretch_height) {
- src_row --;
- }
- FX_LPCBYTE src_pos = stretch_buf + src_row * stretch_pitch + src_col * Bpp;
- if (bHasAlpha) {
- if (transformF != FXDIB_Argb) {
- if (transformF == FXDIB_Rgba) {
- dest_pos[0] = src_pos[0];
- dest_pos[1] = src_pos[1];
- dest_pos[2] = src_pos[2];
- } else {
- *(FX_DWORD*)dest_pos = FXCMYK_TODIB(CmykEncode(src_pos[0], src_pos[1], src_pos[2], src_pos[3]));
- }
- } else {
- *(FX_DWORD*)dest_pos = FXARGB_TODIB(FXARGB_MAKE(src_pos[3], src_pos[2], src_pos[1], src_pos[0]));
- }
- } else {
- if (transformF == FXDIB_Cmyka) {
- *(FX_DWORD*)dest_pos = FXCMYK_TODIB(CmykEncode(src_pos[0], src_pos[1], src_pos[2], src_pos[3]));
- } else {
- *(FX_DWORD*)dest_pos = FXARGB_TODIB(FXARGB_MAKE(0xff, src_pos[2], src_pos[1], src_pos[0]));
- }
- }
- }
- dest_pos += destBpp;
- }
- }
- }
- }
- }
- m_Storer.Replace(pTransformed);
- return FALSE;
-}
+// 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
+
+#include "../../../include/fxge/fx_dib.h"
+#include "dib_int.h"
+int SDP_Table[513] = {
+ 256, 256, 256, 256, 256, 256, 256, 256, 256, 255, 255, 255, 255, 255, 255, 254, 254, 254, 254,
+ 253, 253, 253, 252, 252, 252, 251, 251, 251, 250, 250, 249, 249, 249, 248, 248, 247, 247, 246,
+ 246, 245, 244, 244, 243, 243, 242, 242, 241, 240, 240, 239, 238, 238, 237, 236, 236, 235, 234,
+ 233, 233, 232, 231, 230, 230, 229, 228, 227, 226, 226, 225, 224, 223, 222, 221, 220, 219, 218,
+ 218, 217, 216, 215, 214, 213, 212, 211, 210, 209, 208, 207, 206, 205, 204, 203, 202, 201, 200,
+ 199, 198, 196, 195, 194, 193, 192, 191, 190, 189, 188, 186, 185, 184, 183, 182, 181, 179, 178,
+ 177, 176, 175, 173, 172, 171, 170, 169, 167, 166, 165, 164, 162, 161, 160, 159, 157, 156, 155,
+ 154, 152, 151, 150, 149, 147, 146, 145, 143, 142, 141, 140, 138, 137, 136, 134, 133, 132, 130,
+ 129, 128, 126, 125, 124, 122, 121, 120, 119, 117, 116, 115, 113, 112, 111, 109, 108, 107, 105,
+ 104, 103, 101, 100, 99, 97, 96, 95, 93, 92, 91, 89, 88, 87, 85, 84, 83, 81, 80, 79, 77, 76, 75,
+ 73, 72, 71, 69, 68, 67, 66, 64, 63, 62, 60, 59, 58, 57, 55, 54, 53, 52, 50, 49, 48, 47, 45, 44,
+ 43, 42, 40, 39, 38, 37, 36, 34, 33, 32, 31, 30, 28, 27, 26, 25, 24, 23, 21, 20, 19, 18, 17, 16,
+ 15, 14, 13, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0, -1, -2, -3, -4, -5, -6, -7, -7, -8, -9, -10,
+ -11, -12, -12, -13, -14, -15, -15, -16, -17, -17, -18, -19, -19, -20, -21, -21, -22, -22, -23, -24,
+ -24, -25, -25, -26, -26, -27, -27, -27, -28, -28, -29, -29, -30, -30, -30, -31, -31, -31, -32, -32,
+ -32, -33, -33, -33, -33, -34, -34, -34, -34, -35, -35, -35, -35, -35, -36, -36, -36, -36, -36, -36,
+ -36, -36, -36, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37,
+ -37, -37, -37, -37, -36, -36, -36, -36, -36, -36, -36, -36, -36, -35, -35, -35, -35, -35, -35, -34,
+ -34, -34, -34, -34, -33, -33, -33, -33, -33, -32, -32, -32, -32, -31, -31, -31, -31, -30, -30, -30,
+ -30, -29, -29, -29, -29, -28, -28, -28, -27, -27, -27, -27, -26, -26, -26, -25, -25, -25, -24, -24,
+ -24, -23, -23, -23, -22, -22, -22, -22, -21, -21, -21, -20, -20, -20, -19, -19, -19, -18, -18, -18,
+ -17, -17, -17, -16, -16, -16, -15, -15, -15, -14, -14, -14, -13, -13, -13, -12, -12, -12, -11, -11,
+ -11, -10, -10, -10, -9, -9, -9, -9, -8, -8, -8, -7, -7, -7, -7, -6, -6, -6, -6, -5, -5, -5, -5, -4,
+ -4, -4, -4, -3, -3, -3, -3, -3, -2, -2, -2, -2, -2, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+};
+class CFX_BilinearMatrix : public CPDF_FixedMatrix
+{
+public:
+ CFX_BilinearMatrix(const CFX_AffineMatrix& src, int bits): CPDF_FixedMatrix(src, bits)
+ {}
+ inline void Transform(int x, int y, int& x1, int& y1, int&res_x, int&res_y)
+ {
+ x1 = a * x + c * y + e + base / 2;
+ y1 = b * x + d * y + f + base / 2;
+ res_x = x1 % base;
+ res_y = y1 % base;
+ if (res_x < 0 && res_x > -base) {
+ res_x = base + res_x;
+ }
+ if (res_y < 0 && res_x > -base) {
+ res_y = base + res_y;
+ }
+ x1 /= base;
+ y1 /= base;
+ }
+};
+CFX_DIBitmap* CFX_DIBSource::SwapXY(FX_BOOL bXFlip, FX_BOOL bYFlip, const FX_RECT* pDestClip) const
+{
+ FX_RECT dest_clip(0, 0, m_Height, m_Width);
+ if (pDestClip) {
+ dest_clip.Intersect(*pDestClip);
+ }
+ if (dest_clip.IsEmpty()) {
+ return NULL;
+ }
+ CFX_DIBitmap* pTransBitmap = FX_NEW CFX_DIBitmap;
+ if (!pTransBitmap) {
+ return NULL;
+ }
+ int result_height = dest_clip.Height(), result_width = dest_clip.Width();
+ if (!pTransBitmap->Create(result_width, result_height, GetFormat())) {
+ delete pTransBitmap;
+ return NULL;
+ }
+ pTransBitmap->CopyPalette(m_pPalette);
+ int src_pitch = m_Pitch;
+ int dest_pitch = pTransBitmap->GetPitch();
+ FX_LPBYTE dest_buf = pTransBitmap->GetBuffer();
+ int row_start = bXFlip ? m_Height - dest_clip.right : dest_clip.left;
+ int row_end = bXFlip ? m_Height - dest_clip.left : dest_clip.right;
+ int col_start = bYFlip ? m_Width - dest_clip.bottom : dest_clip.top;
+ int col_end = bYFlip ? m_Width - dest_clip.top : dest_clip.bottom;
+ if (GetBPP() == 1) {
+ FXSYS_memset8(dest_buf, 0xff, dest_pitch * result_height);
+ for (int row = row_start; row < row_end; row ++) {
+ FX_LPCBYTE src_scan = GetScanline(row);
+ int dest_col = (bXFlip ? dest_clip.right - (row - row_start) - 1 : row) - dest_clip.left;
+ FX_LPBYTE dest_scan = dest_buf;
+ if (bYFlip) {
+ dest_scan += (result_height - 1) * dest_pitch;
+ }
+ int dest_step = bYFlip ? -dest_pitch : dest_pitch;
+ for (int col = col_start; col < col_end; col ++) {
+ if (!(src_scan[col / 8] & (1 << (7 - col % 8)))) {
+ dest_scan[dest_col / 8] &= ~(1 << (7 - dest_col % 8));
+ }
+ dest_scan += dest_step;
+ }
+ }
+ } else {
+ int nBytes = GetBPP() / 8;
+ int dest_step = bYFlip ? -dest_pitch : dest_pitch;
+ if (nBytes == 3) {
+ dest_step -= 2;
+ }
+ for (int row = row_start; row < row_end; row ++) {
+ int dest_col = (bXFlip ? dest_clip.right - (row - row_start) - 1 : row) - dest_clip.left;
+ FX_LPBYTE dest_scan = dest_buf + dest_col * nBytes;
+ if (bYFlip) {
+ dest_scan += (result_height - 1) * dest_pitch;
+ }
+ if (nBytes == 4) {
+ FX_DWORD* src_scan = (FX_DWORD*)GetScanline(row) + col_start;
+ for (int col = col_start; col < col_end; col ++) {
+ *(FX_DWORD*)dest_scan = *src_scan++;
+ dest_scan += dest_step;
+ }
+ } else {
+ FX_LPCBYTE src_scan = GetScanline(row) + col_start * nBytes;
+ if (nBytes == 1)
+ for (int col = col_start; col < col_end; col ++) {
+ *dest_scan = *src_scan++;
+ dest_scan += dest_step;
+ }
+ else
+ for (int col = col_start; col < col_end; col ++) {
+ *dest_scan++ = *src_scan++;
+ *dest_scan++ = *src_scan++;
+ *dest_scan = *src_scan++;
+ dest_scan += dest_step;
+ }
+ }
+ }
+ }
+ if (m_pAlphaMask) {
+ src_pitch = m_pAlphaMask->m_Pitch;
+ dest_pitch = pTransBitmap->m_pAlphaMask->GetPitch();
+ dest_buf = pTransBitmap->m_pAlphaMask->GetBuffer();
+ int dest_step = bYFlip ? -dest_pitch : dest_pitch;
+ for (int row = row_start; row < row_end; row ++) {
+ int dest_col = (bXFlip ? dest_clip.right - (row - row_start) - 1 : row) - dest_clip.left;
+ FX_LPBYTE dest_scan = dest_buf + dest_col;
+ if (bYFlip) {
+ dest_scan += (result_height - 1) * dest_pitch;
+ }
+ FX_LPCBYTE src_scan = m_pAlphaMask->GetScanline(row) + col_start;
+ for (int col = col_start; col < col_end; col ++) {
+ *dest_scan = *src_scan++;
+ dest_scan += dest_step;
+ }
+ }
+ }
+ return pTransBitmap;
+}
+#define FIX16_005 0.05f
+FX_RECT _FXDIB_SwapClipBox(FX_RECT& clip, int width, int height, FX_BOOL bFlipX, FX_BOOL bFlipY)
+{
+ FX_RECT rect;
+ if (bFlipY) {
+ rect.left = height - clip.top;
+ rect.right = height - clip.bottom;
+ } else {
+ rect.left = clip.top;
+ rect.right = clip.bottom;
+ }
+ if (bFlipX) {
+ rect.top = width - clip.left;
+ rect.bottom = width - clip.right;
+ } else {
+ rect.top = clip.left;
+ rect.bottom = clip.right;
+ }
+ rect.Normalize();
+ return rect;
+}
+CFX_DIBitmap* CFX_DIBSource::TransformTo(const CFX_AffineMatrix* pDestMatrix, int& result_left, int& result_top,
+ FX_DWORD flags, const FX_RECT* pDestClip) const
+{
+ CFX_ImageTransformer transformer;
+ transformer.Start(this, pDestMatrix, flags, pDestClip);
+ transformer.Continue(NULL);
+ result_left = transformer.m_ResultLeft;
+ result_top = transformer.m_ResultTop;
+ CFX_DIBitmap* pTransformed = transformer.m_Storer.Detach();
+ return pTransformed;
+}
+CFX_DIBitmap* CFX_DIBSource::StretchTo(int dest_width, int dest_height, FX_DWORD flags, const FX_RECT* pClip) const
+{
+ FX_RECT clip_rect(0, 0, FXSYS_abs(dest_width), FXSYS_abs(dest_height));
+ if (pClip) {
+ clip_rect.Intersect(*pClip);
+ }
+ if (clip_rect.IsEmpty()) {
+ return NULL;
+ }
+ if (dest_width == m_Width && dest_height == m_Height) {
+ return Clone(&clip_rect);
+ }
+ CFX_ImageStretcher stretcher;
+ CFX_BitmapStorer storer;
+ if (stretcher.Start(&storer, this, dest_width, dest_height, clip_rect, flags)) {
+ stretcher.Continue(NULL);
+ }
+ return storer.Detach();
+}
+CFX_ImageTransformer::CFX_ImageTransformer()
+{
+ m_Status = 0;
+ m_pMatrix = NULL;
+}
+CFX_ImageTransformer::~CFX_ImageTransformer()
+{
+}
+FX_BOOL CFX_ImageTransformer::Start(const CFX_DIBSource* pSrc, const CFX_AffineMatrix* pDestMatrix, int flags, const FX_RECT* pDestClip)
+{
+ m_pMatrix = (CFX_AffineMatrix*)pDestMatrix;
+ CFX_FloatRect unit_rect = pDestMatrix->GetUnitRect();
+ FX_RECT result_rect = unit_rect.GetClosestRect();
+ FX_RECT result_clip = result_rect;
+ if (pDestClip) {
+ result_clip.Intersect(*pDestClip);
+ }
+ if (result_clip.IsEmpty()) {
+ return FALSE;
+ }
+ m_ResultLeft = result_clip.left;
+ m_ResultTop = result_clip.top;
+ m_ResultWidth = result_clip.Width();
+ m_ResultHeight = result_clip.Height();
+ m_Flags = flags;
+ if (FXSYS_fabs(pDestMatrix->a) < FXSYS_fabs(pDestMatrix->b) / 20 &&
+ FXSYS_fabs(pDestMatrix->d) < FXSYS_fabs(pDestMatrix->c) / 20 &&
+ FXSYS_fabs(pDestMatrix->a) < 0.5f && FXSYS_fabs(pDestMatrix->d) < 0.5f) {
+ int dest_width = result_rect.Width();
+ int dest_height = result_rect.Height();
+ result_clip.Offset(-result_rect.left, -result_rect.top);
+ result_clip = _FXDIB_SwapClipBox(result_clip, dest_width, dest_height, pDestMatrix->c > 0, pDestMatrix->b < 0);
+ m_Stretcher.Start(&m_Storer, pSrc, dest_height, dest_width, result_clip, flags);
+ m_Status = 1;
+ return TRUE;
+ }
+ if (FXSYS_fabs(pDestMatrix->b) < FIX16_005 && FXSYS_fabs(pDestMatrix->c) < FIX16_005) {
+ int dest_width = pDestMatrix->a > 0 ? (int)FXSYS_ceil(pDestMatrix->a) : (int)FXSYS_floor(pDestMatrix->a);
+ int dest_height = pDestMatrix->d > 0 ? (int) - FXSYS_ceil(pDestMatrix->d) : (int) - FXSYS_floor(pDestMatrix->d);
+ result_clip.Offset(-result_rect.left, -result_rect.top);
+ m_Stretcher.Start(&m_Storer, pSrc, dest_width, dest_height, result_clip, flags);
+ m_Status = 2;
+ return TRUE;
+ }
+ int stretch_width = (int)FXSYS_ceil(FXSYS_sqrt2(pDestMatrix->a, pDestMatrix->b));
+ int stretch_height = (int)FXSYS_ceil(FXSYS_sqrt2(pDestMatrix->c, pDestMatrix->d));
+ CFX_AffineMatrix stretch2dest(1.0f, 0.0f, 0.0f, -1.0f, 0.0f, (FX_FLOAT)(stretch_height));
+ stretch2dest.Concat(pDestMatrix->a / stretch_width, pDestMatrix->b / stretch_width,
+ pDestMatrix->c / stretch_height, pDestMatrix->d / stretch_height, pDestMatrix->e, pDestMatrix->f);
+ m_dest2stretch.SetReverse(stretch2dest);
+ CFX_FloatRect clip_rect_f(result_clip);
+ clip_rect_f.Transform(&m_dest2stretch);
+ m_StretchClip = clip_rect_f.GetOutterRect();
+ m_StretchClip.Intersect(0, 0, stretch_width, stretch_height);
+ m_Stretcher.Start(&m_Storer, pSrc, stretch_width, stretch_height, m_StretchClip, flags);
+ m_Status = 3;
+ return TRUE;
+}
+FX_BYTE _bilinear_interpol(FX_LPCBYTE buf, int row_offset_l, int row_offset_r,
+ int src_col_l, int src_col_r, int res_x, int res_y,
+ int bpp, int c_offset)
+{
+ int i_resx = 255 - res_x;
+ int col_bpp_l = src_col_l * bpp;
+ int col_bpp_r = src_col_r * bpp;
+ FX_LPCBYTE buf_u = buf + row_offset_l + c_offset;
+ FX_LPCBYTE buf_d = buf + row_offset_r + c_offset;
+ FX_LPCBYTE src_pos0 = buf_u + col_bpp_l;
+ FX_LPCBYTE src_pos1 = buf_u + col_bpp_r;
+ FX_LPCBYTE src_pos2 = buf_d + col_bpp_l;
+ FX_LPCBYTE src_pos3 = buf_d + col_bpp_r;
+ FX_BYTE r_pos_0 = (*src_pos0 * i_resx + *src_pos1 * res_x) >> 8;
+ FX_BYTE r_pos_1 = (*src_pos2 * i_resx + *src_pos3 * res_x) >> 8;
+ return (r_pos_0 * (255 - res_y) + r_pos_1 * res_y) >> 8;
+}
+FX_BYTE _bicubic_interpol(FX_LPCBYTE buf, int pitch, int pos_pixel[], int u_w[], int v_w[], int res_x, int res_y,
+ int bpp, int c_offset)
+{
+ int s_result = 0;
+ for (int i = 0; i < 4; i ++) {
+ int a_result = 0;
+ for (int j = 0; j < 4; j ++) {
+ a_result += u_w[j] * (*(FX_BYTE*)(buf + pos_pixel[i + 4] * pitch + pos_pixel[j] * bpp + c_offset));
+ }
+ s_result += a_result * v_w[i];
+ }
+ s_result >>= 16;
+ return (FX_BYTE)(s_result < 0 ? 0 : s_result > 255 ? 255 : s_result);
+}
+void _bicubic_get_pos_weight(int pos_pixel[], int u_w[], int v_w[], int src_col_l, int src_row_l,
+ int res_x, int res_y, int stretch_width, int stretch_height)
+{
+ pos_pixel[0] = src_col_l - 1;
+ pos_pixel[1] = src_col_l;
+ pos_pixel[2] = src_col_l + 1;
+ pos_pixel[3] = src_col_l + 2;
+ pos_pixel[4] = src_row_l - 1;
+ pos_pixel[5] = src_row_l;
+ pos_pixel[6] = src_row_l + 1;
+ pos_pixel[7] = src_row_l + 2;
+ for (int i = 0 ; i < 4; i ++) {
+ if (pos_pixel[i] < 0) {
+ pos_pixel[i] = 0;
+ }
+ if (pos_pixel[i] >= stretch_width) {
+ pos_pixel[i] = stretch_width - 1;
+ }
+ if (pos_pixel[i + 4] < 0) {
+ pos_pixel[i + 4] = 0;
+ }
+ if (pos_pixel[i + 4] >= stretch_height) {
+ pos_pixel[i + 4] = stretch_height - 1;
+ }
+ }
+ u_w[0] = SDP_Table[256 + res_x];
+ u_w[1] = SDP_Table[res_x];
+ u_w[2] = SDP_Table[256 - res_x];
+ u_w[3] = SDP_Table[512 - res_x];
+ v_w[0] = SDP_Table[256 + res_y];
+ v_w[1] = SDP_Table[res_y];
+ v_w[2] = SDP_Table[256 - res_y];
+ v_w[3] = SDP_Table[512 - res_y];
+}
+FXDIB_Format _GetTransformedFormat(const CFX_DIBSource* pDrc)
+{
+ FXDIB_Format format = pDrc->GetFormat();
+ if (pDrc->IsAlphaMask()) {
+ format = FXDIB_8bppMask;
+ } else if (format >= 1025) {
+ format = FXDIB_Cmyka;
+ } else if (format <= 32 || format == FXDIB_Argb) {
+ format = FXDIB_Argb;
+ } else {
+ format = FXDIB_Rgba;
+ }
+ return format;
+}
+FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause)
+{
+ if (m_Status == 1) {
+ if (m_Stretcher.Continue(pPause)) {
+ return TRUE;
+ }
+ if (m_Storer.GetBitmap()) {
+ m_Storer.Replace(m_Storer.GetBitmap()->SwapXY(m_pMatrix->c > 0, m_pMatrix->b < 0));
+ }
+ return FALSE;
+ } else if (m_Status == 2) {
+ return m_Stretcher.Continue(pPause);
+ } else if (m_Status != 3) {
+ return FALSE;
+ }
+ if (m_Stretcher.Continue(pPause)) {
+ return TRUE;
+ }
+ int stretch_width = m_StretchClip.Width();
+ int stretch_height = m_StretchClip.Height();
+ if (m_Storer.GetBitmap() == NULL) {
+ return FALSE;
+ }
+ FX_LPCBYTE stretch_buf = m_Storer.GetBitmap()->GetBuffer();
+ FX_LPCBYTE stretch_buf_mask = NULL;
+ if (m_Storer.GetBitmap()->m_pAlphaMask) {
+ stretch_buf_mask = m_Storer.GetBitmap()->m_pAlphaMask->GetBuffer();
+ }
+ int stretch_pitch = m_Storer.GetBitmap()->GetPitch();
+ CFX_DIBitmap* pTransformed = FX_NEW CFX_DIBitmap;
+ if (!pTransformed) {
+ return FALSE;
+ }
+ FXDIB_Format transformF = _GetTransformedFormat(m_Stretcher.m_pSource);
+ if (!pTransformed->Create(m_ResultWidth, m_ResultHeight, transformF)) {
+ delete pTransformed;
+ return FALSE;
+ }
+ pTransformed->Clear(0);
+ if (pTransformed->m_pAlphaMask) {
+ pTransformed->m_pAlphaMask->Clear(0);
+ }
+ CFX_AffineMatrix result2stretch(1.0f, 0.0f, 0.0f, 1.0f, (FX_FLOAT)(m_ResultLeft), (FX_FLOAT)(m_ResultTop));
+ result2stretch.Concat(m_dest2stretch);
+ result2stretch.TranslateI(-m_StretchClip.left, -m_StretchClip.top);
+ if (stretch_buf_mask == NULL && pTransformed->m_pAlphaMask) {
+ pTransformed->m_pAlphaMask->Clear(0xff000000);
+ } else if (pTransformed->m_pAlphaMask) {
+ int stretch_pitch_mask = m_Storer.GetBitmap()->m_pAlphaMask->GetPitch();
+ if (!(m_Flags & FXDIB_DOWNSAMPLE) && !(m_Flags & FXDIB_BICUBIC_INTERPOL)) {
+ CFX_BilinearMatrix result2stretch_fix(result2stretch, 8);
+ for (int row = 0; row < m_ResultHeight; row ++) {
+ FX_BYTE* dest_pos_mask = (FX_BYTE*)pTransformed->m_pAlphaMask->GetScanline(row);
+ for (int col = 0; col < m_ResultWidth; col ++) {
+ int src_col_l, src_row_l, res_x, res_y;
+ result2stretch_fix.Transform(col, row, src_col_l, src_row_l, res_x, res_y);
+ if (src_col_l >= 0 && src_col_l <= stretch_width && src_row_l >= 0 && src_row_l <= stretch_height) {
+ if (src_col_l == stretch_width) {
+ src_col_l--;
+ }
+ if (src_row_l == stretch_height) {
+ src_row_l--;
+ }
+ int src_col_r = src_col_l + 1;
+ int src_row_r = src_row_l + 1;
+ if (src_col_r == stretch_width) {
+ src_col_r--;
+ }
+ if (src_row_r == stretch_height) {
+ src_row_r--;
+ }
+ int row_offset_l = src_row_l * stretch_pitch_mask;
+ int row_offset_r = src_row_r * stretch_pitch_mask;
+ *dest_pos_mask = _bilinear_interpol(stretch_buf_mask, row_offset_l, row_offset_r, src_col_l, src_col_r, res_x, res_y, 1, 0);
+ }
+ dest_pos_mask++;
+ }
+ }
+ } else if (m_Flags & FXDIB_BICUBIC_INTERPOL) {
+ CFX_BilinearMatrix result2stretch_fix(result2stretch, 8);
+ int pos_pixel[8];
+ for (int row = 0; row < m_ResultHeight; row ++) {
+ FX_BYTE* dest_pos_mask = (FX_BYTE*)pTransformed->m_pAlphaMask->GetScanline(row);
+ for (int col = 0; col < m_ResultWidth; col ++) {
+ int src_col_l, src_row_l, res_x, res_y;
+ result2stretch_fix.Transform(col, row, src_col_l, src_row_l, res_x, res_y);
+ if (src_col_l >= 0 && src_col_l <= stretch_width && src_row_l >= 0 && src_row_l <= stretch_height) {
+ int u_w[4], v_w[4];
+ if (src_col_l == stretch_width) {
+ src_col_l--;
+ }
+ if (src_row_l == stretch_height) {
+ src_row_l--;
+ }
+ _bicubic_get_pos_weight(pos_pixel, u_w, v_w, src_col_l, src_row_l, res_x, res_y, stretch_width, stretch_height);
+ *dest_pos_mask = _bicubic_interpol(stretch_buf_mask, stretch_pitch_mask, pos_pixel, u_w, v_w, res_x, res_y, 1, 0);
+ }
+ dest_pos_mask++;
+ }
+ }
+ } else {
+ CPDF_FixedMatrix result2stretch_fix(result2stretch, 8);
+ for (int row = 0; row < m_ResultHeight; row ++) {
+ FX_BYTE* dest_pos_mask = (FX_BYTE*)pTransformed->m_pAlphaMask->GetScanline(row);
+ for (int col = 0; col < m_ResultWidth; col ++) {
+ int src_col, src_row;
+ result2stretch_fix.Transform(col, row, src_col, src_row);
+ if (src_col >= 0 && src_col <= stretch_width && src_row >= 0 && src_row <= stretch_height) {
+ if (src_col == stretch_width) {
+ src_col --;
+ }
+ if (src_row == stretch_height) {
+ src_row --;
+ }
+ *dest_pos_mask = stretch_buf_mask[src_row * stretch_pitch_mask + src_col];
+ }
+ dest_pos_mask++;
+ }
+ }
+ }
+ }
+ if (m_Storer.GetBitmap()->IsAlphaMask()) {
+ if (!(m_Flags & FXDIB_DOWNSAMPLE) && !(m_Flags & FXDIB_BICUBIC_INTERPOL)) {
+ CFX_BilinearMatrix result2stretch_fix(result2stretch, 8);
+ for (int row = 0; row < m_ResultHeight; row ++) {
+ FX_LPBYTE dest_scan = (FX_LPBYTE)pTransformed->GetScanline(row);
+ for (int col = 0; col < m_ResultWidth; col ++) {
+ int src_col_l, src_row_l, res_x, res_y;
+ result2stretch_fix.Transform(col, row, src_col_l, src_row_l, res_x, res_y);
+ if (src_col_l >= 0 && src_col_l <= stretch_width && src_row_l >= 0 && src_row_l <= stretch_height) {
+ if (src_col_l == stretch_width) {
+ src_col_l--;
+ }
+ if (src_row_l == stretch_height) {
+ src_row_l--;
+ }
+ int src_col_r = src_col_l + 1;
+ int src_row_r = src_row_l + 1;
+ if (src_col_r == stretch_width) {
+ src_col_r--;
+ }
+ if (src_row_r == stretch_height) {
+ src_row_r--;
+ }
+ int row_offset_l = src_row_l * stretch_pitch;
+ int row_offset_r = src_row_r * stretch_pitch;
+ *dest_scan = _bilinear_interpol(stretch_buf, row_offset_l, row_offset_r, src_col_l, src_col_r, res_x, res_y, 1, 0);
+ }
+ dest_scan ++;
+ }
+ }
+ } else if (m_Flags & FXDIB_BICUBIC_INTERPOL) {
+ CFX_BilinearMatrix result2stretch_fix(result2stretch, 8);
+ int pos_pixel[8];
+ for (int row = 0; row < m_ResultHeight; row ++) {
+ FX_LPBYTE dest_scan = (FX_LPBYTE)pTransformed->GetScanline(row);
+ for (int col = 0; col < m_ResultWidth; col ++) {
+ int src_col_l, src_row_l, res_x, res_y;
+ result2stretch_fix.Transform(col, row, src_col_l, src_row_l, res_x, res_y);
+ if (src_col_l >= 0 && src_col_l <= stretch_width && src_row_l >= 0 && src_row_l <= stretch_height) {
+ int u_w[4], v_w[4];
+ if (src_col_l == stretch_width) {
+ src_col_l--;
+ }
+ if (src_row_l == stretch_height) {
+ src_row_l--;
+ }
+ _bicubic_get_pos_weight(pos_pixel, u_w, v_w, src_col_l, src_row_l, res_x, res_y, stretch_width, stretch_height);
+ *dest_scan = _bicubic_interpol(stretch_buf, stretch_pitch, pos_pixel, u_w, v_w, res_x, res_y, 1, 0);
+ }
+ dest_scan ++;
+ }
+ }
+ } else {
+ CPDF_FixedMatrix result2stretch_fix(result2stretch, 8);
+ for (int row = 0; row < m_ResultHeight; row ++) {
+ FX_LPBYTE dest_scan = (FX_LPBYTE)pTransformed->GetScanline(row);
+ for (int col = 0; col < m_ResultWidth; col ++) {
+ int src_col, src_row;
+ result2stretch_fix.Transform(col, row, src_col, src_row);
+ if (src_col >= 0 && src_col <= stretch_width && src_row >= 0 && src_row <= stretch_height) {
+ if (src_col == stretch_width) {
+ src_col --;
+ }
+ if (src_row == stretch_height) {
+ src_row --;
+ }
+ FX_LPCBYTE src_pixel = stretch_buf + stretch_pitch * src_row + src_col;
+ *dest_scan = *src_pixel;
+ }
+ dest_scan ++;
+ }
+ }
+ }
+ } else {
+ int Bpp = m_Storer.GetBitmap()->GetBPP() / 8;
+ int destBpp = pTransformed->GetBPP() / 8;
+ if (Bpp == 1) {
+ FX_BOOL bHasAlpha = m_Storer.GetBitmap()->HasAlpha();
+ FX_DWORD argb[256];
+ FX_ARGB* pPal = m_Storer.GetBitmap()->GetPalette();
+ if (pPal) {
+ for (int i = 0; i < 256; i ++) {
+ argb[i] = pPal[i];
+ }
+ } else {
+ if (m_Storer.GetBitmap()->IsCmykImage())
+ for (int i = 0; i < 256; i ++) {
+ argb[i] = 255 - i;
+ }
+ else
+ for (int i = 0; i < 256; i ++) {
+ argb[i] = 0xff000000 | (i * 0x010101);
+ }
+ }
+ if (!(m_Flags & FXDIB_DOWNSAMPLE) && !(m_Flags & FXDIB_BICUBIC_INTERPOL)) {
+ CFX_BilinearMatrix result2stretch_fix(result2stretch, 8);
+ for (int row = 0; row < m_ResultHeight; row ++) {
+ FX_BYTE* dest_pos = (FX_BYTE*)pTransformed->GetScanline(row);
+ for (int col = 0; col < m_ResultWidth; col ++) {
+ int src_col_l, src_row_l, res_x, res_y;
+ result2stretch_fix.Transform(col, row, src_col_l, src_row_l, res_x, res_y);
+ if (src_col_l >= 0 && src_col_l <= stretch_width && src_row_l >= 0 && src_row_l <= stretch_height) {
+ if (src_col_l == stretch_width) {
+ src_col_l--;
+ }
+ if (src_row_l == stretch_height) {
+ src_row_l--;
+ }
+ int src_col_r = src_col_l + 1;
+ int src_row_r = src_row_l + 1;
+ if (src_col_r == stretch_width) {
+ src_col_r--;
+ }
+ if (src_row_r == stretch_height) {
+ src_row_r--;
+ }
+ int row_offset_l = src_row_l * stretch_pitch;
+ int row_offset_r = src_row_r * stretch_pitch;
+ FX_DWORD r_bgra_cmyk = argb[_bilinear_interpol(stretch_buf, row_offset_l, row_offset_r, src_col_l, src_col_r, res_x, res_y, 1, 0)];
+ if (transformF == FXDIB_Rgba) {
+ dest_pos[0] = (FX_BYTE)(r_bgra_cmyk >> 24);
+ dest_pos[1] = (FX_BYTE)(r_bgra_cmyk >> 16);
+ dest_pos[2] = (FX_BYTE)(r_bgra_cmyk >> 8);
+ } else {
+ *(FX_DWORD*)dest_pos = r_bgra_cmyk;
+ }
+ }
+ dest_pos += destBpp;
+ }
+ }
+ } else if (m_Flags & FXDIB_BICUBIC_INTERPOL) {
+ CFX_BilinearMatrix result2stretch_fix(result2stretch, 8);
+ int pos_pixel[8];
+ for (int row = 0; row < m_ResultHeight; row ++) {
+ FX_BYTE* dest_pos = (FX_BYTE*)pTransformed->GetScanline(row);
+ for (int col = 0; col < m_ResultWidth; col ++) {
+ int src_col_l, src_row_l, res_x, res_y;
+ result2stretch_fix.Transform(col, row, src_col_l, src_row_l, res_x, res_y);
+ if (src_col_l >= 0 && src_col_l <= stretch_width && src_row_l >= 0 && src_row_l <= stretch_height) {
+ int u_w[4], v_w[4];
+ if (src_col_l == stretch_width) {
+ src_col_l--;
+ }
+ if (src_row_l == stretch_height) {
+ src_row_l--;
+ }
+ _bicubic_get_pos_weight(pos_pixel, u_w, v_w, src_col_l, src_row_l, res_x, res_y, stretch_width, stretch_height);
+ FX_DWORD r_bgra_cmyk = argb[_bicubic_interpol(stretch_buf, stretch_pitch, pos_pixel, u_w, v_w, res_x, res_y, 1, 0)];
+ if (transformF == FXDIB_Rgba) {
+ dest_pos[0] = (FX_BYTE)(r_bgra_cmyk >> 24);
+ dest_pos[1] = (FX_BYTE)(r_bgra_cmyk >> 16);
+ dest_pos[2] = (FX_BYTE)(r_bgra_cmyk >> 8);
+ } else {
+ *(FX_DWORD*)dest_pos = r_bgra_cmyk;
+ }
+ }
+ dest_pos += destBpp;
+ }
+ }
+ } else {
+ CPDF_FixedMatrix result2stretch_fix(result2stretch, 8);
+ for (int row = 0; row < m_ResultHeight; row ++) {
+ FX_BYTE* dest_pos = (FX_BYTE*)pTransformed->GetScanline(row);
+ for (int col = 0; col < m_ResultWidth; col ++) {
+ int src_col, src_row;
+ result2stretch_fix.Transform(col, row, src_col, src_row);
+ if (src_col >= 0 && src_col <= stretch_width && src_row >= 0 && src_row <= stretch_height) {
+ if (src_col == stretch_width) {
+ src_col --;
+ }
+ if (src_row == stretch_height) {
+ src_row --;
+ }
+ FX_DWORD r_bgra_cmyk = argb[stretch_buf[src_row * stretch_pitch + src_col]];
+ if (transformF == FXDIB_Rgba) {
+ dest_pos[0] = (FX_BYTE)(r_bgra_cmyk >> 24);
+ dest_pos[1] = (FX_BYTE)(r_bgra_cmyk >> 16);
+ dest_pos[2] = (FX_BYTE)(r_bgra_cmyk >> 8);
+ } else {
+ *(FX_DWORD*)dest_pos = r_bgra_cmyk;
+ }
+ }
+ dest_pos += destBpp;
+ }
+ }
+ }
+ } else {
+ FX_BOOL bHasAlpha = m_Storer.GetBitmap()->HasAlpha();
+ int destBpp = pTransformed->GetBPP() / 8;
+ if (!(m_Flags & FXDIB_DOWNSAMPLE) && !(m_Flags & FXDIB_BICUBIC_INTERPOL)) {
+ CFX_BilinearMatrix result2stretch_fix(result2stretch, 8);
+ for (int row = 0; row < m_ResultHeight; row ++) {
+ FX_BYTE* dest_pos = (FX_BYTE*)pTransformed->GetScanline(row);
+ for (int col = 0; col < m_ResultWidth; col ++) {
+ int src_col_l, src_row_l, res_x, res_y, r_pos_k_r = 0;
+ result2stretch_fix.Transform(col, row, src_col_l, src_row_l, res_x, res_y);
+ if (src_col_l >= 0 && src_col_l <= stretch_width && src_row_l >= 0 && src_row_l <= stretch_height) {
+ if (src_col_l == stretch_width) {
+ src_col_l--;
+ }
+ if (src_row_l == stretch_height) {
+ src_row_l--;
+ }
+ int src_col_r = src_col_l + 1;
+ int src_row_r = src_row_l + 1;
+ if (src_col_r == stretch_width) {
+ src_col_r--;
+ }
+ if (src_row_r == stretch_height) {
+ src_row_r--;
+ }
+ int row_offset_l = src_row_l * stretch_pitch;
+ int row_offset_r = src_row_r * stretch_pitch;
+ FX_BYTE r_pos_red_y_r = _bilinear_interpol(stretch_buf, row_offset_l, row_offset_r, src_col_l, src_col_r, res_x, res_y, Bpp, 2);
+ FX_BYTE r_pos_green_m_r = _bilinear_interpol(stretch_buf, row_offset_l, row_offset_r, src_col_l, src_col_r, res_x, res_y, Bpp, 1);
+ FX_BYTE r_pos_blue_c_r = _bilinear_interpol(stretch_buf, row_offset_l, row_offset_r, src_col_l, src_col_r, res_x, res_y, Bpp, 0);
+ if (bHasAlpha) {
+ if (transformF != FXDIB_Argb) {
+ if (transformF == FXDIB_Rgba) {
+ dest_pos[0] = r_pos_blue_c_r;
+ dest_pos[1] = r_pos_green_m_r;
+ dest_pos[2] = r_pos_red_y_r;
+ } else {
+ r_pos_k_r = _bilinear_interpol(stretch_buf, row_offset_l, row_offset_r, src_col_l, src_col_r, res_x, res_y, Bpp, 3);
+ *(FX_DWORD*)dest_pos = FXCMYK_TODIB(CmykEncode(r_pos_blue_c_r, r_pos_green_m_r, r_pos_red_y_r, r_pos_k_r));
+ }
+ } else {
+ FX_BYTE r_pos_a_r = _bilinear_interpol(stretch_buf, row_offset_l, row_offset_r, src_col_l, src_col_r, res_x, res_y, Bpp, 3);
+ *(FX_DWORD*)dest_pos = FXARGB_TODIB(FXARGB_MAKE(r_pos_a_r, r_pos_red_y_r, r_pos_green_m_r, r_pos_blue_c_r));
+ }
+ } else {
+ r_pos_k_r = 0xff;
+ if (transformF == FXDIB_Cmyka) {
+ r_pos_k_r = _bilinear_interpol(stretch_buf, row_offset_l, row_offset_r, src_col_l, src_col_r, res_x, res_y, Bpp, 3);
+ *(FX_DWORD*)dest_pos = FXCMYK_TODIB(CmykEncode(r_pos_blue_c_r, r_pos_green_m_r, r_pos_red_y_r, r_pos_k_r));
+ } else {
+ *(FX_DWORD*)dest_pos = FXARGB_TODIB(FXARGB_MAKE(r_pos_k_r, r_pos_red_y_r, r_pos_green_m_r, r_pos_blue_c_r));
+ }
+ }
+ }
+ dest_pos += destBpp;
+ }
+ }
+ } else if (m_Flags & FXDIB_BICUBIC_INTERPOL) {
+ CFX_BilinearMatrix result2stretch_fix(result2stretch, 8);
+ int pos_pixel[8];
+ for (int row = 0; row < m_ResultHeight; row ++) {
+ FX_BYTE* dest_pos = (FX_BYTE*)pTransformed->GetScanline(row);
+ for (int col = 0; col < m_ResultWidth; col ++) {
+ int src_col_l, src_row_l, res_x, res_y, r_pos_k_r = 0;
+ result2stretch_fix.Transform(col, row, src_col_l, src_row_l, res_x, res_y);
+ if (src_col_l >= 0 && src_col_l <= stretch_width && src_row_l >= 0 && src_row_l <= stretch_height) {
+ int u_w[4], v_w[4];
+ if (src_col_l == stretch_width) {
+ src_col_l--;
+ }
+ if (src_row_l == stretch_height) {
+ src_row_l--;
+ }
+ _bicubic_get_pos_weight(pos_pixel, u_w, v_w, src_col_l, src_row_l, res_x, res_y, stretch_width, stretch_height);
+ FX_BYTE r_pos_red_y_r = _bicubic_interpol(stretch_buf, stretch_pitch, pos_pixel, u_w, v_w, res_x, res_y, Bpp, 2);
+ FX_BYTE r_pos_green_m_r = _bicubic_interpol(stretch_buf, stretch_pitch, pos_pixel, u_w, v_w, res_x, res_y, Bpp, 1);
+ FX_BYTE r_pos_blue_c_r = _bicubic_interpol(stretch_buf, stretch_pitch, pos_pixel, u_w, v_w, res_x, res_y, Bpp, 0);
+ if (bHasAlpha) {
+ if (transformF != FXDIB_Argb) {
+ if (transformF == FXDIB_Rgba) {
+ dest_pos[0] = r_pos_blue_c_r;
+ dest_pos[1] = r_pos_green_m_r;
+ dest_pos[2] = r_pos_red_y_r;
+ } else {
+ r_pos_k_r = _bicubic_interpol(stretch_buf, stretch_pitch, pos_pixel, u_w, v_w, res_x, res_y, Bpp, 3);
+ *(FX_DWORD*)dest_pos = FXCMYK_TODIB(CmykEncode(r_pos_blue_c_r, r_pos_green_m_r, r_pos_red_y_r, r_pos_k_r));
+ }
+ } else {
+ FX_BYTE r_pos_a_r = _bicubic_interpol(stretch_buf, stretch_pitch, pos_pixel, u_w, v_w, res_x, res_y, Bpp, 3);
+ *(FX_DWORD*)dest_pos = FXARGB_TODIB(FXARGB_MAKE(r_pos_a_r, r_pos_red_y_r, r_pos_green_m_r, r_pos_blue_c_r));
+ }
+ } else {
+ r_pos_k_r = 0xff;
+ if (transformF == FXDIB_Cmyka) {
+ r_pos_k_r = _bicubic_interpol(stretch_buf, stretch_pitch, pos_pixel, u_w, v_w, res_x, res_y, Bpp, 3);
+ *(FX_DWORD*)dest_pos = FXCMYK_TODIB(CmykEncode(r_pos_blue_c_r, r_pos_green_m_r, r_pos_red_y_r, r_pos_k_r));
+ } else {
+ *(FX_DWORD*)dest_pos = FXARGB_TODIB(FXARGB_MAKE(r_pos_k_r, r_pos_red_y_r, r_pos_green_m_r, r_pos_blue_c_r));
+ }
+ }
+ }
+ dest_pos += destBpp;
+ }
+ }
+ } else {
+ CPDF_FixedMatrix result2stretch_fix(result2stretch, 8);
+ for (int row = 0; row < m_ResultHeight; row ++) {
+ FX_BYTE* dest_pos = (FX_BYTE*)pTransformed->GetScanline(row);
+ for (int col = 0; col < m_ResultWidth; col ++) {
+ int src_col, src_row;
+ result2stretch_fix.Transform(col, row, src_col, src_row);
+ if (src_col >= 0 && src_col <= stretch_width && src_row >= 0 && src_row <= stretch_height) {
+ if (src_col == stretch_width) {
+ src_col --;
+ }
+ if (src_row == stretch_height) {
+ src_row --;
+ }
+ FX_LPCBYTE src_pos = stretch_buf + src_row * stretch_pitch + src_col * Bpp;
+ if (bHasAlpha) {
+ if (transformF != FXDIB_Argb) {
+ if (transformF == FXDIB_Rgba) {
+ dest_pos[0] = src_pos[0];
+ dest_pos[1] = src_pos[1];
+ dest_pos[2] = src_pos[2];
+ } else {
+ *(FX_DWORD*)dest_pos = FXCMYK_TODIB(CmykEncode(src_pos[0], src_pos[1], src_pos[2], src_pos[3]));
+ }
+ } else {
+ *(FX_DWORD*)dest_pos = FXARGB_TODIB(FXARGB_MAKE(src_pos[3], src_pos[2], src_pos[1], src_pos[0]));
+ }
+ } else {
+ if (transformF == FXDIB_Cmyka) {
+ *(FX_DWORD*)dest_pos = FXCMYK_TODIB(CmykEncode(src_pos[0], src_pos[1], src_pos[2], src_pos[3]));
+ } else {
+ *(FX_DWORD*)dest_pos = FXARGB_TODIB(FXARGB_MAKE(0xff, src_pos[2], src_pos[1], src_pos[0]));
+ }
+ }
+ }
+ dest_pos += destBpp;
+ }
+ }
+ }
+ }
+ }
+ m_Storer.Replace(pTransformed);
+ return FALSE;
+}
diff --git a/core/src/fxge/ge/fx_ge.cpp b/core/src/fxge/ge/fx_ge.cpp
index df200d5b48..d044d721e6 100644
--- a/core/src/fxge/ge/fx_ge.cpp
+++ b/core/src/fxge/ge/fx_ge.cpp
@@ -1,79 +1,79 @@
-// 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
-
-#include "../../../include/fxge/fx_ge.h"
-#include "text_int.h"
-static CFX_GEModule* g_pGEModule = NULL;
-CFX_GEModule::CFX_GEModule()
-{
- m_pFontCache = NULL;
- m_pFontMgr = NULL;
- m_FTLibrary = NULL;
- m_pCodecModule = NULL;
- m_pPlatformData = NULL;
-}
-CFX_GEModule::~CFX_GEModule()
-{
- if (m_pFontCache) {
- delete m_pFontCache;
- }
- m_pFontCache = NULL;
- if (m_pFontMgr) {
- delete m_pFontMgr;
- }
- m_pFontMgr = NULL;
- DestroyPlatform();
-}
-CFX_GEModule* CFX_GEModule::Get()
-{
- return g_pGEModule;
-}
-void CFX_GEModule::Create()
-{
- g_pGEModule = FX_NEW CFX_GEModule;
- if (!g_pGEModule) {
- return;
- }
- g_pGEModule->m_pFontMgr = FX_NEW CFX_FontMgr;
- g_pGEModule->InitPlatform();
- g_pGEModule->SetTextGamma(2.2f);
-}
-void CFX_GEModule::Use(CFX_GEModule* pModule)
-{
- g_pGEModule = pModule;
-}
-void CFX_GEModule::Destroy()
-{
- if (g_pGEModule) {
- delete g_pGEModule;
- }
- g_pGEModule = NULL;
-}
-CFX_FontCache* CFX_GEModule::GetFontCache()
-{
- if (m_pFontCache == NULL) {
- m_pFontCache = FX_NEW CFX_FontCache();
- }
- return m_pFontCache;
-}
-void CFX_GEModule::SetTextGamma(FX_FLOAT gammaValue)
-{
- gammaValue /= 2.2f;
- int i = 0;
- while (i < 256) {
- m_GammaValue[i] = (FX_BYTE)(FXSYS_pow((FX_FLOAT)i / 255, gammaValue) * 255.0f + 0.5f);
- i++;
- }
-}
-FX_LPCBYTE CFX_GEModule::GetTextGammaTable()
-{
- return m_GammaValue;
-}
-void CFX_GEModule::SetExtFontMapper(IFX_FontMapper* pFontMapper)
-{
- GetFontMgr()->m_pExtMapper = pFontMapper;
- pFontMapper->m_pFontMgr = m_pFontMgr;
-}
+// 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
+
+#include "../../../include/fxge/fx_ge.h"
+#include "text_int.h"
+static CFX_GEModule* g_pGEModule = NULL;
+CFX_GEModule::CFX_GEModule()
+{
+ m_pFontCache = NULL;
+ m_pFontMgr = NULL;
+ m_FTLibrary = NULL;
+ m_pCodecModule = NULL;
+ m_pPlatformData = NULL;
+}
+CFX_GEModule::~CFX_GEModule()
+{
+ if (m_pFontCache) {
+ delete m_pFontCache;
+ }
+ m_pFontCache = NULL;
+ if (m_pFontMgr) {
+ delete m_pFontMgr;
+ }
+ m_pFontMgr = NULL;
+ DestroyPlatform();
+}
+CFX_GEModule* CFX_GEModule::Get()
+{
+ return g_pGEModule;
+}
+void CFX_GEModule::Create()
+{
+ g_pGEModule = FX_NEW CFX_GEModule;
+ if (!g_pGEModule) {
+ return;
+ }
+ g_pGEModule->m_pFontMgr = FX_NEW CFX_FontMgr;
+ g_pGEModule->InitPlatform();
+ g_pGEModule->SetTextGamma(2.2f);
+}
+void CFX_GEModule::Use(CFX_GEModule* pModule)
+{
+ g_pGEModule = pModule;
+}
+void CFX_GEModule::Destroy()
+{
+ if (g_pGEModule) {
+ delete g_pGEModule;
+ }
+ g_pGEModule = NULL;
+}
+CFX_FontCache* CFX_GEModule::GetFontCache()
+{
+ if (m_pFontCache == NULL) {
+ m_pFontCache = FX_NEW CFX_FontCache();
+ }
+ return m_pFontCache;
+}
+void CFX_GEModule::SetTextGamma(FX_FLOAT gammaValue)
+{
+ gammaValue /= 2.2f;
+ int i = 0;
+ while (i < 256) {
+ m_GammaValue[i] = (FX_BYTE)(FXSYS_pow((FX_FLOAT)i / 255, gammaValue) * 255.0f + 0.5f);
+ i++;
+ }
+}
+FX_LPCBYTE CFX_GEModule::GetTextGammaTable()
+{
+ return m_GammaValue;
+}
+void CFX_GEModule::SetExtFontMapper(IFX_FontMapper* pFontMapper)
+{
+ GetFontMgr()->m_pExtMapper = pFontMapper;
+ pFontMapper->m_pFontMgr = m_pFontMgr;
+}
diff --git a/core/src/fxge/ge/fx_ge_device.cpp b/core/src/fxge/ge/fx_ge_device.cpp
index 8f7ccdb7d9..9c268b5606 100644
--- a/core/src/fxge/ge/fx_ge_device.cpp
+++ b/core/src/fxge/ge/fx_ge_device.cpp
@@ -1,405 +1,405 @@
-// 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
-
-#include "../../../include/fxge/fx_ge.h"
-CFX_RenderDevice::CFX_RenderDevice()
-{
- m_pDeviceDriver = NULL;
- m_pBitmap = NULL;
-}
-CFX_RenderDevice::~CFX_RenderDevice()
-{
- if (m_pDeviceDriver) {
- delete m_pDeviceDriver;
- }
-}
-void CFX_RenderDevice::SetDeviceDriver(IFX_RenderDeviceDriver* pDriver)
-{
- if (m_pDeviceDriver) {
- delete m_pDeviceDriver;
- }
- m_pDeviceDriver = pDriver;
- InitDeviceInfo();
-}
-void CFX_RenderDevice::InitDeviceInfo()
-{
- ASSERT(m_pDeviceDriver != NULL);
- m_Width = m_pDeviceDriver->GetDeviceCaps(FXDC_PIXEL_WIDTH);
- m_Height = m_pDeviceDriver->GetDeviceCaps(FXDC_PIXEL_HEIGHT);
- m_bpp = m_pDeviceDriver->GetDeviceCaps(FXDC_BITS_PIXEL);
- m_RenderCaps = m_pDeviceDriver->GetDeviceCaps(FXDC_RENDER_CAPS);
- m_DeviceClass = m_pDeviceDriver->GetDeviceCaps(FXDC_DEVICE_CLASS);
- if (!m_pDeviceDriver->GetClipBox(&m_ClipBox)) {
- m_ClipBox.left = 0;
- m_ClipBox.top = 0;
- m_ClipBox.right = m_Width;
- m_ClipBox.bottom = m_Height;
- }
-}
-FX_BOOL CFX_RenderDevice::StartRendering()
-{
- return m_pDeviceDriver->StartRendering();
-}
-void CFX_RenderDevice::EndRendering()
-{
- m_pDeviceDriver->EndRendering();
-}
-void CFX_RenderDevice::SaveState()
-{
- m_pDeviceDriver->SaveState();
-}
-void CFX_RenderDevice::RestoreState(FX_BOOL bKeepSaved)
-{
- m_pDeviceDriver->RestoreState(bKeepSaved);
- UpdateClipBox();
-}
-int CFX_RenderDevice::GetDeviceCaps(int caps_id) const
-{
- return m_pDeviceDriver->GetDeviceCaps(caps_id);
-}
-CFX_Matrix CFX_RenderDevice::GetCTM() const
-{
- return m_pDeviceDriver->GetCTM();
-}
-FX_BOOL CFX_RenderDevice::CreateCompatibleBitmap(CFX_DIBitmap* pDIB, int width, int height) const
-{
- if (m_RenderCaps & FXRC_CMYK_OUTPUT) {
- return pDIB->Create(width, height, m_RenderCaps & FXRC_ALPHA_OUTPUT ? FXDIB_Cmyka : FXDIB_Cmyk);
- } else if (m_RenderCaps & FXRC_BYTEMASK_OUTPUT) {
- return pDIB->Create(width, height, FXDIB_8bppMask);
- } else
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
- return pDIB->Create(width, height, m_RenderCaps & FXRC_ALPHA_OUTPUT ? FXDIB_Argb : FXDIB_Rgb32);
-#else
- return pDIB->Create(width, height, m_RenderCaps & FXRC_ALPHA_OUTPUT ? FXDIB_Argb : FXDIB_Rgb);
-#endif
-}
-FX_BOOL CFX_RenderDevice::SetClip_PathFill(const CFX_PathData* pPathData,
- const CFX_AffineMatrix* pObject2Device,
- int fill_mode
- )
-{
- if (!m_pDeviceDriver->SetClip_PathFill(pPathData, pObject2Device, fill_mode)) {
- return FALSE;
- }
- UpdateClipBox();
- return TRUE;
-}
-FX_BOOL CFX_RenderDevice::SetClip_PathStroke(const CFX_PathData* pPathData,
- const CFX_AffineMatrix* pObject2Device,
- const CFX_GraphStateData* pGraphState
- )
-{
- if (!m_pDeviceDriver->SetClip_PathStroke(pPathData, pObject2Device, pGraphState)) {
- return FALSE;
- }
- UpdateClipBox();
- return TRUE;
-}
-FX_BOOL CFX_RenderDevice::SetClip_Rect(const FX_RECT* pRect)
-{
- CFX_PathData path;
- path.AppendRect((FX_FLOAT)(pRect->left), (FX_FLOAT)(pRect->bottom), (FX_FLOAT)(pRect->right), (FX_FLOAT)(pRect->top));
- if (!SetClip_PathFill(&path, NULL, FXFILL_WINDING)) {
- return FALSE;
- }
- UpdateClipBox();
- return TRUE;
-}
-void CFX_RenderDevice::UpdateClipBox()
-{
- if (m_pDeviceDriver->GetClipBox(&m_ClipBox)) {
- return;
- }
- m_ClipBox.left = 0;
- m_ClipBox.top = 0;
- m_ClipBox.right = m_Width;
- m_ClipBox.bottom = m_Height;
-}
-FX_BOOL CFX_RenderDevice::DrawPath(const CFX_PathData* pPathData,
- const CFX_AffineMatrix* pObject2Device,
- const CFX_GraphStateData* pGraphState,
- FX_DWORD fill_color, FX_DWORD stroke_color, int fill_mode,
- int alpha_flag, void* pIccTransform, int blend_type)
-{
- FX_BYTE fill_alpha, stroke_alpha;
- if (FXGETFLAG_COLORTYPE(alpha_flag)) {
- fill_alpha = FXGETFLAG_ALPHA_FILL(alpha_flag);
- stroke_alpha = FXGETFLAG_ALPHA_STROKE(alpha_flag);
- } else {
- fill_alpha = FXARGB_A(fill_color);
- stroke_alpha = FXARGB_A(stroke_color);
- }
- if ((fill_mode & 3) == 0) {
- fill_alpha = 0;
- }
- if (pGraphState == NULL) {
- stroke_alpha = 0;
- }
- if (stroke_alpha == 0 && pPathData->GetPointCount() == 2) {
- FX_PATHPOINT* pPoints = pPathData->GetPoints();
- FX_FLOAT x1, x2, y1, y2;
- if (pObject2Device) {
- pObject2Device->Transform(pPoints[0].m_PointX, pPoints[0].m_PointY, x1, y1);
- pObject2Device->Transform(pPoints[1].m_PointX, pPoints[1].m_PointY, x2, y2);
- } else {
- x1 = pPoints[0].m_PointX;
- y1 = pPoints[0].m_PointY;
- x2 = pPoints[1].m_PointX;
- y2 = pPoints[1].m_PointY;
- }
- DrawCosmeticLine(x1, y1, x2, y2, fill_color, fill_mode, alpha_flag, pIccTransform, blend_type);
- return TRUE;
- }
- if ((pPathData->GetPointCount() == 5 || pPathData->GetPointCount() == 4) && stroke_alpha == 0) {
- CFX_FloatRect rect_f;
- if (!(fill_mode & FXFILL_RECT_AA) && pPathData->IsRect(pObject2Device, &rect_f)) {
- FX_RECT rect_i = rect_f.GetOutterRect();
- int width = (int)FXSYS_ceil(rect_f.right - rect_f.left);
- if (width < 1) {
- width = 1;
- if (rect_i.left == rect_i.right) {
- rect_i.right ++;
- }
- }
- int height = (int)FXSYS_ceil(rect_f.top - rect_f.bottom);
- if (height < 1) {
- height = 1;
- if (rect_i.bottom == rect_i.top) {
- rect_i.bottom ++;
- }
- }
- if (rect_i.Width() >= width + 1) {
- if (rect_f.left - (FX_FLOAT)(rect_i.left) > (FX_FLOAT)(rect_i.right) - rect_f.right) {
- rect_i.left ++;
- } else {
- rect_i.right --;
- }
- }
- if (rect_i.Height() >= height + 1) {
- if (rect_f.top - (FX_FLOAT)(rect_i.top) > (FX_FLOAT)(rect_i.bottom) - rect_f.bottom) {
- rect_i.top ++;
- } else {
- rect_i.bottom --;
- }
- }
- if (FillRect(&rect_i, fill_color, alpha_flag, pIccTransform, blend_type)) {
- return TRUE;
- }
- }
- }
- if((fill_mode & 3) && stroke_alpha == 0 && !(fill_mode & FX_FILL_STROKE) && !(fill_mode & FX_FILL_TEXT_MODE)) {
- CFX_PathData newPath;
- FX_BOOL bThin = FALSE;
- if (pPathData->GetZeroAreaPath(newPath, (CFX_Matrix*)pObject2Device, bThin, m_pDeviceDriver->GetDriverType())) {
- CFX_GraphStateData graphState;
- graphState.m_LineWidth = 0.0f;
- FX_DWORD strokecolor = fill_color;
- if (bThin) {
- if (FXGETFLAG_COLORTYPE(alpha_flag)) {
- FXSETFLAG_ALPHA_STROKE(alpha_flag, fill_alpha >> 2);
- } else {
- strokecolor = (((fill_alpha >> 2) << 24) | (strokecolor & 0x00ffffff));
- }
- }
- CFX_AffineMatrix* pMatrix = NULL;
- if (pObject2Device && !pObject2Device->IsIdentity()) {
- pMatrix = (CFX_AffineMatrix*)pObject2Device;
- }
- int smooth_path = FX_ZEROAREA_FILL;
- if (fill_mode & FXFILL_NOPATHSMOOTH) {
- smooth_path |= FXFILL_NOPATHSMOOTH;
- }
- m_pDeviceDriver->DrawPath(&newPath, pMatrix, &graphState, 0, strokecolor, smooth_path, alpha_flag, pIccTransform, blend_type);
- }
- }
- if ((fill_mode & 3) && fill_alpha && stroke_alpha < 0xff && (fill_mode & FX_FILL_STROKE)) {
- if (!(m_RenderCaps & FXRC_GET_BITS)) {
- return FALSE;
- }
- CFX_FloatRect bbox;
- if (pGraphState) {
- bbox = pPathData->GetBoundingBox(pGraphState->m_LineWidth, pGraphState->m_MiterLimit);
- } else {
- bbox = pPathData->GetBoundingBox();
- }
- if (pObject2Device) {
- bbox.Transform(pObject2Device);
- }
- CFX_Matrix ctm = GetCTM();
- FX_FLOAT fScaleX = FXSYS_fabs(ctm.a);
- FX_FLOAT fScaleY = FXSYS_fabs(ctm.d);
- FX_RECT rect = bbox.GetOutterRect();
- CFX_DIBitmap bitmap, Backdrop;
- if (!CreateCompatibleBitmap(&bitmap, FXSYS_round(rect.Width() * fScaleX), FXSYS_round(rect.Height() * fScaleY))) {
- return FALSE;
- }
- if (bitmap.HasAlpha()) {
- bitmap.Clear(0);
- Backdrop.Copy(&bitmap);
- } else {
- if (!m_pDeviceDriver->GetDIBits(&bitmap, rect.left, rect.top, NULL)) {
- return FALSE;
- }
- Backdrop.Copy(&bitmap);
- }
- CFX_FxgeDevice bitmap_device;
- bitmap_device.Attach(&bitmap, 0, FALSE, &Backdrop, TRUE);
- CFX_AffineMatrix matrix;
- if (pObject2Device) {
- matrix = *pObject2Device;
- }
- matrix.TranslateI(-rect.left, -rect.top);
- matrix.Concat(fScaleX, 0, 0, fScaleY, 0, 0);
- if (!bitmap_device.GetDeviceDriver()->DrawPath(pPathData, &matrix, pGraphState, fill_color, stroke_color, fill_mode, alpha_flag, pIccTransform, blend_type)) {
- return FALSE;
- }
- FX_RECT src_rect(0, 0, FXSYS_round(rect.Width() * fScaleX), FXSYS_round(rect.Height() * fScaleY));
- return m_pDeviceDriver->SetDIBits(&bitmap, 0, &src_rect, rect.left, rect.top, FXDIB_BLEND_NORMAL);
- }
- return m_pDeviceDriver->DrawPath(pPathData, pObject2Device, pGraphState, fill_color, stroke_color, fill_mode, alpha_flag, pIccTransform, blend_type);
-}
-FX_BOOL CFX_RenderDevice::SetPixel(int x, int y, FX_DWORD color, int alpha_flag, void* pIccTransform)
-{
- if (m_pDeviceDriver->SetPixel(x, y, color, alpha_flag, pIccTransform)) {
- return TRUE;
- }
- FX_RECT rect(x, y, x + 1, y + 1);
- return FillRect(&rect, color, alpha_flag, pIccTransform);
-}
-FX_BOOL CFX_RenderDevice::FillRect(const FX_RECT* pRect, FX_DWORD fill_color, int alpha_flag, void* pIccTransform, int blend_type)
-{
- if (m_pDeviceDriver->FillRect(pRect, fill_color, alpha_flag, pIccTransform, blend_type)) {
- return TRUE;
- }
- if (!(m_RenderCaps & FXRC_GET_BITS)) {
- return FALSE;
- }
- CFX_DIBitmap bitmap;
- if (!CreateCompatibleBitmap(&bitmap, pRect->Width(), pRect->Height())) {
- return FALSE;
- }
- if (!m_pDeviceDriver->GetDIBits(&bitmap, pRect->left, pRect->top)) {
- return FALSE;
- }
- if (!bitmap.CompositeRect(0, 0, pRect->Width(), pRect->Height(), fill_color, alpha_flag, pIccTransform)) {
- return FALSE;
- }
- FX_RECT src_rect(0, 0, pRect->Width(), pRect->Height());
- m_pDeviceDriver->SetDIBits(&bitmap, 0, &src_rect, pRect->left, pRect->top, FXDIB_BLEND_NORMAL);
- return TRUE;
-}
-FX_BOOL CFX_RenderDevice::DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, FX_DWORD color,
- int fill_mode, int alpha_flag, void* pIccTransform, int blend_type)
-{
- if (((m_RenderCaps & FXRC_ALPHA_PATH) &&
- (FXGETFLAG_COLORTYPE(alpha_flag) && FXGETFLAG_ALPHA_FILL(alpha_flag) == 0xff)) ||
- color >= 0xff000000)
- if (m_pDeviceDriver->DrawCosmeticLine(x1, y1, x2, y2, color, alpha_flag, pIccTransform, blend_type)) {
- return TRUE;
- }
- CFX_GraphStateData graph_state;
- CFX_PathData path;
- path.SetPointCount(2);
- path.SetPoint(0, x1, y1, FXPT_MOVETO);
- path.SetPoint(1, x2, y2, FXPT_LINETO);
- return m_pDeviceDriver->DrawPath(&path, NULL, &graph_state, 0, color, fill_mode, alpha_flag, pIccTransform, blend_type);
-}
-FX_BOOL CFX_RenderDevice::GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform)
-{
- if (!(m_RenderCaps & FXRC_GET_BITS)) {
- return FALSE;
- }
- return m_pDeviceDriver->GetDIBits(pBitmap, left, top, pIccTransform);
-}
-CFX_DIBitmap* CFX_RenderDevice::GetBackDrop()
-{
- return m_pDeviceDriver->GetBackDrop();
-}
-FX_BOOL CFX_RenderDevice::SetDIBits(const CFX_DIBSource* pBitmap, int left, int top, int blend_mode,
- void* pIccTransform)
-{
- ASSERT(!pBitmap->IsAlphaMask());
- CFX_AffineMatrix ctm = GetCTM();
- FX_FLOAT fScaleX = FXSYS_fabs(ctm.a);
- FX_FLOAT fScaleY = FXSYS_fabs(ctm.d);
- FX_RECT dest_rect(left, top, FXSYS_round(left + pBitmap->GetWidth() / fScaleX), FXSYS_round(top + pBitmap->GetHeight() / fScaleY));
- dest_rect.Intersect(m_ClipBox);
- if (dest_rect.IsEmpty()) {
- return TRUE;
- }
- FX_RECT src_rect(dest_rect.left - left, dest_rect.top - top,
- dest_rect.left - left + dest_rect.Width(), dest_rect.top - top + dest_rect.Height());
- src_rect.left = FXSYS_round(src_rect.left * fScaleX);
- src_rect.top = FXSYS_round(src_rect.top * fScaleY);
- src_rect.right = FXSYS_round(src_rect.right * fScaleX);
- src_rect.bottom = FXSYS_round(src_rect.bottom * fScaleY);
- if ((blend_mode != FXDIB_BLEND_NORMAL && !(m_RenderCaps & FXRC_BLEND_MODE)) ||
- (pBitmap->HasAlpha() && !(m_RenderCaps & FXRC_ALPHA_IMAGE))) {
- if (!(m_RenderCaps & FXRC_GET_BITS)) {
- return FALSE;
- }
- int bg_pixel_width = FXSYS_round(dest_rect.Width() * fScaleX);
- int bg_pixel_height = FXSYS_round(dest_rect.Height() * fScaleY);
- CFX_DIBitmap background;
- if (!background.Create(bg_pixel_width, bg_pixel_height,
- (m_RenderCaps & FXRC_CMYK_OUTPUT) ? FXDIB_Cmyk : FXDIB_Rgb32)) {
- return FALSE;
- }
- if (!m_pDeviceDriver->GetDIBits(&background, dest_rect.left, dest_rect.top)) {
- return FALSE;
- }
- if (!background.CompositeBitmap(0, 0, bg_pixel_width, bg_pixel_height,
- pBitmap, src_rect.left, src_rect.top,
- blend_mode, NULL, FALSE, pIccTransform)) {
- return FALSE;
- }
- FX_RECT src_rect(0, 0, bg_pixel_width, bg_pixel_height);
- return m_pDeviceDriver->SetDIBits(&background, 0, &src_rect, dest_rect.left, dest_rect.top, FXDIB_BLEND_NORMAL);
- }
- return m_pDeviceDriver->SetDIBits(pBitmap, 0, &src_rect, dest_rect.left, dest_rect.top, blend_mode, 0, pIccTransform);
-}
-FX_BOOL CFX_RenderDevice::StretchDIBits(const CFX_DIBSource* pBitmap, int left, int top,
- int dest_width, int dest_height, FX_DWORD flags,
- void* pIccTransform, int blend_mode)
-{
- FX_RECT dest_rect(left, top, left + dest_width, top + dest_height);
- FX_RECT clip_box = m_ClipBox;
- clip_box.Intersect(dest_rect);
- if (clip_box.IsEmpty()) {
- return TRUE;
- }
- return m_pDeviceDriver->StretchDIBits(pBitmap, 0, left, top, dest_width, dest_height, &clip_box, flags, 0, pIccTransform, blend_mode);
-}
-FX_BOOL CFX_RenderDevice::SetBitMask(const CFX_DIBSource* pBitmap, int left, int top, FX_DWORD argb,
- int alpha_flag, void* pIccTransform)
-{
- FX_RECT src_rect(0, 0, pBitmap->GetWidth(), pBitmap->GetHeight());
- return m_pDeviceDriver->SetDIBits(pBitmap, argb, &src_rect, left, top, FXDIB_BLEND_NORMAL, alpha_flag, pIccTransform);
-}
-FX_BOOL CFX_RenderDevice::StretchBitMask(const CFX_DIBSource* pBitmap, int left, int top,
- int dest_width, int dest_height, FX_DWORD argb, FX_DWORD flags,
- int alpha_flag, void* pIccTransform)
-{
- FX_RECT dest_rect(left, top, left + dest_width, top + dest_height);
- FX_RECT clip_box = m_ClipBox;
- clip_box.Intersect(dest_rect);
- return m_pDeviceDriver->StretchDIBits(pBitmap, argb, left, top, dest_width, dest_height, &clip_box, flags, alpha_flag, pIccTransform);
-}
-FX_BOOL CFX_RenderDevice::StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD argb,
- const CFX_AffineMatrix* pMatrix, FX_DWORD flags, FX_LPVOID& handle,
- int alpha_flag, void* pIccTransform, int blend_mode)
-{
- return m_pDeviceDriver->StartDIBits(pBitmap, bitmap_alpha, argb, pMatrix, flags, handle, alpha_flag, pIccTransform, blend_mode);
-}
-FX_BOOL CFX_RenderDevice::ContinueDIBits(FX_LPVOID handle, IFX_Pause* pPause)
-{
- return m_pDeviceDriver->ContinueDIBits(handle, pPause);
-}
-void CFX_RenderDevice::CancelDIBits(FX_LPVOID handle)
-{
- m_pDeviceDriver->CancelDIBits(handle);
-}
+// 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
+
+#include "../../../include/fxge/fx_ge.h"
+CFX_RenderDevice::CFX_RenderDevice()
+{
+ m_pDeviceDriver = NULL;
+ m_pBitmap = NULL;
+}
+CFX_RenderDevice::~CFX_RenderDevice()
+{
+ if (m_pDeviceDriver) {
+ delete m_pDeviceDriver;
+ }
+}
+void CFX_RenderDevice::SetDeviceDriver(IFX_RenderDeviceDriver* pDriver)
+{
+ if (m_pDeviceDriver) {
+ delete m_pDeviceDriver;
+ }
+ m_pDeviceDriver = pDriver;
+ InitDeviceInfo();
+}
+void CFX_RenderDevice::InitDeviceInfo()
+{
+ ASSERT(m_pDeviceDriver != NULL);
+ m_Width = m_pDeviceDriver->GetDeviceCaps(FXDC_PIXEL_WIDTH);
+ m_Height = m_pDeviceDriver->GetDeviceCaps(FXDC_PIXEL_HEIGHT);
+ m_bpp = m_pDeviceDriver->GetDeviceCaps(FXDC_BITS_PIXEL);
+ m_RenderCaps = m_pDeviceDriver->GetDeviceCaps(FXDC_RENDER_CAPS);
+ m_DeviceClass = m_pDeviceDriver->GetDeviceCaps(FXDC_DEVICE_CLASS);
+ if (!m_pDeviceDriver->GetClipBox(&m_ClipBox)) {
+ m_ClipBox.left = 0;
+ m_ClipBox.top = 0;
+ m_ClipBox.right = m_Width;
+ m_ClipBox.bottom = m_Height;
+ }
+}
+FX_BOOL CFX_RenderDevice::StartRendering()
+{
+ return m_pDeviceDriver->StartRendering();
+}
+void CFX_RenderDevice::EndRendering()
+{
+ m_pDeviceDriver->EndRendering();
+}
+void CFX_RenderDevice::SaveState()
+{
+ m_pDeviceDriver->SaveState();
+}
+void CFX_RenderDevice::RestoreState(FX_BOOL bKeepSaved)
+{
+ m_pDeviceDriver->RestoreState(bKeepSaved);
+ UpdateClipBox();
+}
+int CFX_RenderDevice::GetDeviceCaps(int caps_id) const
+{
+ return m_pDeviceDriver->GetDeviceCaps(caps_id);
+}
+CFX_Matrix CFX_RenderDevice::GetCTM() const
+{
+ return m_pDeviceDriver->GetCTM();
+}
+FX_BOOL CFX_RenderDevice::CreateCompatibleBitmap(CFX_DIBitmap* pDIB, int width, int height) const
+{
+ if (m_RenderCaps & FXRC_CMYK_OUTPUT) {
+ return pDIB->Create(width, height, m_RenderCaps & FXRC_ALPHA_OUTPUT ? FXDIB_Cmyka : FXDIB_Cmyk);
+ } else if (m_RenderCaps & FXRC_BYTEMASK_OUTPUT) {
+ return pDIB->Create(width, height, FXDIB_8bppMask);
+ } else
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
+ return pDIB->Create(width, height, m_RenderCaps & FXRC_ALPHA_OUTPUT ? FXDIB_Argb : FXDIB_Rgb32);
+#else
+ return pDIB->Create(width, height, m_RenderCaps & FXRC_ALPHA_OUTPUT ? FXDIB_Argb : FXDIB_Rgb);
+#endif
+}
+FX_BOOL CFX_RenderDevice::SetClip_PathFill(const CFX_PathData* pPathData,
+ const CFX_AffineMatrix* pObject2Device,
+ int fill_mode
+ )
+{
+ if (!m_pDeviceDriver->SetClip_PathFill(pPathData, pObject2Device, fill_mode)) {
+ return FALSE;
+ }
+ UpdateClipBox();
+ return TRUE;
+}
+FX_BOOL CFX_RenderDevice::SetClip_PathStroke(const CFX_PathData* pPathData,
+ const CFX_AffineMatrix* pObject2Device,
+ const CFX_GraphStateData* pGraphState
+ )
+{
+ if (!m_pDeviceDriver->SetClip_PathStroke(pPathData, pObject2Device, pGraphState)) {
+ return FALSE;
+ }
+ UpdateClipBox();
+ return TRUE;
+}
+FX_BOOL CFX_RenderDevice::SetClip_Rect(const FX_RECT* pRect)
+{
+ CFX_PathData path;
+ path.AppendRect((FX_FLOAT)(pRect->left), (FX_FLOAT)(pRect->bottom), (FX_FLOAT)(pRect->right), (FX_FLOAT)(pRect->top));
+ if (!SetClip_PathFill(&path, NULL, FXFILL_WINDING)) {
+ return FALSE;
+ }
+ UpdateClipBox();
+ return TRUE;
+}
+void CFX_RenderDevice::UpdateClipBox()
+{
+ if (m_pDeviceDriver->GetClipBox(&m_ClipBox)) {
+ return;
+ }
+ m_ClipBox.left = 0;
+ m_ClipBox.top = 0;
+ m_ClipBox.right = m_Width;
+ m_ClipBox.bottom = m_Height;
+}
+FX_BOOL CFX_RenderDevice::DrawPath(const CFX_PathData* pPathData,
+ const CFX_AffineMatrix* pObject2Device,
+ const CFX_GraphStateData* pGraphState,
+ FX_DWORD fill_color, FX_DWORD stroke_color, int fill_mode,
+ int alpha_flag, void* pIccTransform, int blend_type)
+{
+ FX_BYTE fill_alpha, stroke_alpha;
+ if (FXGETFLAG_COLORTYPE(alpha_flag)) {
+ fill_alpha = FXGETFLAG_ALPHA_FILL(alpha_flag);
+ stroke_alpha = FXGETFLAG_ALPHA_STROKE(alpha_flag);
+ } else {
+ fill_alpha = FXARGB_A(fill_color);
+ stroke_alpha = FXARGB_A(stroke_color);
+ }
+ if ((fill_mode & 3) == 0) {
+ fill_alpha = 0;
+ }
+ if (pGraphState == NULL) {
+ stroke_alpha = 0;
+ }
+ if (stroke_alpha == 0 && pPathData->GetPointCount() == 2) {
+ FX_PATHPOINT* pPoints = pPathData->GetPoints();
+ FX_FLOAT x1, x2, y1, y2;
+ if (pObject2Device) {
+ pObject2Device->Transform(pPoints[0].m_PointX, pPoints[0].m_PointY, x1, y1);
+ pObject2Device->Transform(pPoints[1].m_PointX, pPoints[1].m_PointY, x2, y2);
+ } else {
+ x1 = pPoints[0].m_PointX;
+ y1 = pPoints[0].m_PointY;
+ x2 = pPoints[1].m_PointX;
+ y2 = pPoints[1].m_PointY;
+ }
+ DrawCosmeticLine(x1, y1, x2, y2, fill_color, fill_mode, alpha_flag, pIccTransform, blend_type);
+ return TRUE;
+ }
+ if ((pPathData->GetPointCount() == 5 || pPathData->GetPointCount() == 4) && stroke_alpha == 0) {
+ CFX_FloatRect rect_f;
+ if (!(fill_mode & FXFILL_RECT_AA) && pPathData->IsRect(pObject2Device, &rect_f)) {
+ FX_RECT rect_i = rect_f.GetOutterRect();
+ int width = (int)FXSYS_ceil(rect_f.right - rect_f.left);
+ if (width < 1) {
+ width = 1;
+ if (rect_i.left == rect_i.right) {
+ rect_i.right ++;
+ }
+ }
+ int height = (int)FXSYS_ceil(rect_f.top - rect_f.bottom);
+ if (height < 1) {
+ height = 1;
+ if (rect_i.bottom == rect_i.top) {
+ rect_i.bottom ++;
+ }
+ }
+ if (rect_i.Width() >= width + 1) {
+ if (rect_f.left - (FX_FLOAT)(rect_i.left) > (FX_FLOAT)(rect_i.right) - rect_f.right) {
+ rect_i.left ++;
+ } else {
+ rect_i.right --;
+ }
+ }
+ if (rect_i.Height() >= height + 1) {
+ if (rect_f.top - (FX_FLOAT)(rect_i.top) > (FX_FLOAT)(rect_i.bottom) - rect_f.bottom) {
+ rect_i.top ++;
+ } else {
+ rect_i.bottom --;
+ }
+ }
+ if (FillRect(&rect_i, fill_color, alpha_flag, pIccTransform, blend_type)) {
+ return TRUE;
+ }
+ }
+ }
+ if((fill_mode & 3) && stroke_alpha == 0 && !(fill_mode & FX_FILL_STROKE) && !(fill_mode & FX_FILL_TEXT_MODE)) {
+ CFX_PathData newPath;
+ FX_BOOL bThin = FALSE;
+ if (pPathData->GetZeroAreaPath(newPath, (CFX_Matrix*)pObject2Device, bThin, m_pDeviceDriver->GetDriverType())) {
+ CFX_GraphStateData graphState;
+ graphState.m_LineWidth = 0.0f;
+ FX_DWORD strokecolor = fill_color;
+ if (bThin) {
+ if (FXGETFLAG_COLORTYPE(alpha_flag)) {
+ FXSETFLAG_ALPHA_STROKE(alpha_flag, fill_alpha >> 2);
+ } else {
+ strokecolor = (((fill_alpha >> 2) << 24) | (strokecolor & 0x00ffffff));
+ }
+ }
+ CFX_AffineMatrix* pMatrix = NULL;
+ if (pObject2Device && !pObject2Device->IsIdentity()) {
+ pMatrix = (CFX_AffineMatrix*)pObject2Device;
+ }
+ int smooth_path = FX_ZEROAREA_FILL;
+ if (fill_mode & FXFILL_NOPATHSMOOTH) {
+ smooth_path |= FXFILL_NOPATHSMOOTH;
+ }
+ m_pDeviceDriver->DrawPath(&newPath, pMatrix, &graphState, 0, strokecolor, smooth_path, alpha_flag, pIccTransform, blend_type);
+ }
+ }
+ if ((fill_mode & 3) && fill_alpha && stroke_alpha < 0xff && (fill_mode & FX_FILL_STROKE)) {
+ if (!(m_RenderCaps & FXRC_GET_BITS)) {
+ return FALSE;
+ }
+ CFX_FloatRect bbox;
+ if (pGraphState) {
+ bbox = pPathData->GetBoundingBox(pGraphState->m_LineWidth, pGraphState->m_MiterLimit);
+ } else {
+ bbox = pPathData->GetBoundingBox();
+ }
+ if (pObject2Device) {
+ bbox.Transform(pObject2Device);
+ }
+ CFX_Matrix ctm = GetCTM();
+ FX_FLOAT fScaleX = FXSYS_fabs(ctm.a);
+ FX_FLOAT fScaleY = FXSYS_fabs(ctm.d);
+ FX_RECT rect = bbox.GetOutterRect();
+ CFX_DIBitmap bitmap, Backdrop;
+ if (!CreateCompatibleBitmap(&bitmap, FXSYS_round(rect.Width() * fScaleX), FXSYS_round(rect.Height() * fScaleY))) {
+ return FALSE;
+ }
+ if (bitmap.HasAlpha()) {
+ bitmap.Clear(0);
+ Backdrop.Copy(&bitmap);
+ } else {
+ if (!m_pDeviceDriver->GetDIBits(&bitmap, rect.left, rect.top, NULL)) {
+ return FALSE;
+ }
+ Backdrop.Copy(&bitmap);
+ }
+ CFX_FxgeDevice bitmap_device;
+ bitmap_device.Attach(&bitmap, 0, FALSE, &Backdrop, TRUE);
+ CFX_AffineMatrix matrix;
+ if (pObject2Device) {
+ matrix = *pObject2Device;
+ }
+ matrix.TranslateI(-rect.left, -rect.top);
+ matrix.Concat(fScaleX, 0, 0, fScaleY, 0, 0);
+ if (!bitmap_device.GetDeviceDriver()->DrawPath(pPathData, &matrix, pGraphState, fill_color, stroke_color, fill_mode, alpha_flag, pIccTransform, blend_type)) {
+ return FALSE;
+ }
+ FX_RECT src_rect(0, 0, FXSYS_round(rect.Width() * fScaleX), FXSYS_round(rect.Height() * fScaleY));
+ return m_pDeviceDriver->SetDIBits(&bitmap, 0, &src_rect, rect.left, rect.top, FXDIB_BLEND_NORMAL);
+ }
+ return m_pDeviceDriver->DrawPath(pPathData, pObject2Device, pGraphState, fill_color, stroke_color, fill_mode, alpha_flag, pIccTransform, blend_type);
+}
+FX_BOOL CFX_RenderDevice::SetPixel(int x, int y, FX_DWORD color, int alpha_flag, void* pIccTransform)
+{
+ if (m_pDeviceDriver->SetPixel(x, y, color, alpha_flag, pIccTransform)) {
+ return TRUE;
+ }
+ FX_RECT rect(x, y, x + 1, y + 1);
+ return FillRect(&rect, color, alpha_flag, pIccTransform);
+}
+FX_BOOL CFX_RenderDevice::FillRect(const FX_RECT* pRect, FX_DWORD fill_color, int alpha_flag, void* pIccTransform, int blend_type)
+{
+ if (m_pDeviceDriver->FillRect(pRect, fill_color, alpha_flag, pIccTransform, blend_type)) {
+ return TRUE;
+ }
+ if (!(m_RenderCaps & FXRC_GET_BITS)) {
+ return FALSE;
+ }
+ CFX_DIBitmap bitmap;
+ if (!CreateCompatibleBitmap(&bitmap, pRect->Width(), pRect->Height())) {
+ return FALSE;
+ }
+ if (!m_pDeviceDriver->GetDIBits(&bitmap, pRect->left, pRect->top)) {
+ return FALSE;
+ }
+ if (!bitmap.CompositeRect(0, 0, pRect->Width(), pRect->Height(), fill_color, alpha_flag, pIccTransform)) {
+ return FALSE;
+ }
+ FX_RECT src_rect(0, 0, pRect->Width(), pRect->Height());
+ m_pDeviceDriver->SetDIBits(&bitmap, 0, &src_rect, pRect->left, pRect->top, FXDIB_BLEND_NORMAL);
+ return TRUE;
+}
+FX_BOOL CFX_RenderDevice::DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, FX_DWORD color,
+ int fill_mode, int alpha_flag, void* pIccTransform, int blend_type)
+{
+ if (((m_RenderCaps & FXRC_ALPHA_PATH) &&
+ (FXGETFLAG_COLORTYPE(alpha_flag) && FXGETFLAG_ALPHA_FILL(alpha_flag) == 0xff)) ||
+ color >= 0xff000000)
+ if (m_pDeviceDriver->DrawCosmeticLine(x1, y1, x2, y2, color, alpha_flag, pIccTransform, blend_type)) {
+ return TRUE;
+ }
+ CFX_GraphStateData graph_state;
+ CFX_PathData path;
+ path.SetPointCount(2);
+ path.SetPoint(0, x1, y1, FXPT_MOVETO);
+ path.SetPoint(1, x2, y2, FXPT_LINETO);
+ return m_pDeviceDriver->DrawPath(&path, NULL, &graph_state, 0, color, fill_mode, alpha_flag, pIccTransform, blend_type);
+}
+FX_BOOL CFX_RenderDevice::GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform)
+{
+ if (!(m_RenderCaps & FXRC_GET_BITS)) {
+ return FALSE;
+ }
+ return m_pDeviceDriver->GetDIBits(pBitmap, left, top, pIccTransform);
+}
+CFX_DIBitmap* CFX_RenderDevice::GetBackDrop()
+{
+ return m_pDeviceDriver->GetBackDrop();
+}
+FX_BOOL CFX_RenderDevice::SetDIBits(const CFX_DIBSource* pBitmap, int left, int top, int blend_mode,
+ void* pIccTransform)
+{
+ ASSERT(!pBitmap->IsAlphaMask());
+ CFX_AffineMatrix ctm = GetCTM();
+ FX_FLOAT fScaleX = FXSYS_fabs(ctm.a);
+ FX_FLOAT fScaleY = FXSYS_fabs(ctm.d);
+ FX_RECT dest_rect(left, top, FXSYS_round(left + pBitmap->GetWidth() / fScaleX), FXSYS_round(top + pBitmap->GetHeight() / fScaleY));
+ dest_rect.Intersect(m_ClipBox);
+ if (dest_rect.IsEmpty()) {
+ return TRUE;
+ }
+ FX_RECT src_rect(dest_rect.left - left, dest_rect.top - top,
+ dest_rect.left - left + dest_rect.Width(), dest_rect.top - top + dest_rect.Height());
+ src_rect.left = FXSYS_round(src_rect.left * fScaleX);
+ src_rect.top = FXSYS_round(src_rect.top * fScaleY);
+ src_rect.right = FXSYS_round(src_rect.right * fScaleX);
+ src_rect.bottom = FXSYS_round(src_rect.bottom * fScaleY);
+ if ((blend_mode != FXDIB_BLEND_NORMAL && !(m_RenderCaps & FXRC_BLEND_MODE)) ||
+ (pBitmap->HasAlpha() && !(m_RenderCaps & FXRC_ALPHA_IMAGE))) {
+ if (!(m_RenderCaps & FXRC_GET_BITS)) {
+ return FALSE;
+ }
+ int bg_pixel_width = FXSYS_round(dest_rect.Width() * fScaleX);
+ int bg_pixel_height = FXSYS_round(dest_rect.Height() * fScaleY);
+ CFX_DIBitmap background;
+ if (!background.Create(bg_pixel_width, bg_pixel_height,
+ (m_RenderCaps & FXRC_CMYK_OUTPUT) ? FXDIB_Cmyk : FXDIB_Rgb32)) {
+ return FALSE;
+ }
+ if (!m_pDeviceDriver->GetDIBits(&background, dest_rect.left, dest_rect.top)) {
+ return FALSE;
+ }
+ if (!background.CompositeBitmap(0, 0, bg_pixel_width, bg_pixel_height,
+ pBitmap, src_rect.left, src_rect.top,
+ blend_mode, NULL, FALSE, pIccTransform)) {
+ return FALSE;
+ }
+ FX_RECT src_rect(0, 0, bg_pixel_width, bg_pixel_height);
+ return m_pDeviceDriver->SetDIBits(&background, 0, &src_rect, dest_rect.left, dest_rect.top, FXDIB_BLEND_NORMAL);
+ }
+ return m_pDeviceDriver->SetDIBits(pBitmap, 0, &src_rect, dest_rect.left, dest_rect.top, blend_mode, 0, pIccTransform);
+}
+FX_BOOL CFX_RenderDevice::StretchDIBits(const CFX_DIBSource* pBitmap, int left, int top,
+ int dest_width, int dest_height, FX_DWORD flags,
+ void* pIccTransform, int blend_mode)
+{
+ FX_RECT dest_rect(left, top, left + dest_width, top + dest_height);
+ FX_RECT clip_box = m_ClipBox;
+ clip_box.Intersect(dest_rect);
+ if (clip_box.IsEmpty()) {
+ return TRUE;
+ }
+ return m_pDeviceDriver->StretchDIBits(pBitmap, 0, left, top, dest_width, dest_height, &clip_box, flags, 0, pIccTransform, blend_mode);
+}
+FX_BOOL CFX_RenderDevice::SetBitMask(const CFX_DIBSource* pBitmap, int left, int top, FX_DWORD argb,
+ int alpha_flag, void* pIccTransform)
+{
+ FX_RECT src_rect(0, 0, pBitmap->GetWidth(), pBitmap->GetHeight());
+ return m_pDeviceDriver->SetDIBits(pBitmap, argb, &src_rect, left, top, FXDIB_BLEND_NORMAL, alpha_flag, pIccTransform);
+}
+FX_BOOL CFX_RenderDevice::StretchBitMask(const CFX_DIBSource* pBitmap, int left, int top,
+ int dest_width, int dest_height, FX_DWORD argb, FX_DWORD flags,
+ int alpha_flag, void* pIccTransform)
+{
+ FX_RECT dest_rect(left, top, left + dest_width, top + dest_height);
+ FX_RECT clip_box = m_ClipBox;
+ clip_box.Intersect(dest_rect);
+ return m_pDeviceDriver->StretchDIBits(pBitmap, argb, left, top, dest_width, dest_height, &clip_box, flags, alpha_flag, pIccTransform);
+}
+FX_BOOL CFX_RenderDevice::StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD argb,
+ const CFX_AffineMatrix* pMatrix, FX_DWORD flags, FX_LPVOID& handle,
+ int alpha_flag, void* pIccTransform, int blend_mode)
+{
+ return m_pDeviceDriver->StartDIBits(pBitmap, bitmap_alpha, argb, pMatrix, flags, handle, alpha_flag, pIccTransform, blend_mode);
+}
+FX_BOOL CFX_RenderDevice::ContinueDIBits(FX_LPVOID handle, IFX_Pause* pPause)
+{
+ return m_pDeviceDriver->ContinueDIBits(handle, pPause);
+}
+void CFX_RenderDevice::CancelDIBits(FX_LPVOID handle)
+{
+ m_pDeviceDriver->CancelDIBits(handle);
+}
diff --git a/core/src/fxge/ge/fx_ge_font.cpp b/core/src/fxge/ge/fx_ge_font.cpp
index e047d2ecb0..f3254ea3de 100644
--- a/core/src/fxge/ge/fx_ge_font.cpp
+++ b/core/src/fxge/ge/fx_ge_font.cpp
@@ -1,458 +1,458 @@
-// 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
-
-#include "../../../include/fxge/fx_ge.h"
-#include "../../../include/fxge/fx_freetype.h"
-#include "text_int.h"
-#define EM_ADJUST(em, a) (em == 0?(a): (a)*1000/em)
-extern void _FPDFAPI_GetInternalFontData(int id1, FX_LPCBYTE& data, FX_DWORD& size);
-CFX_Font::CFX_Font()
-{
- m_pSubstFont = NULL;
- m_Face = NULL;
- m_bEmbedded = FALSE;
- m_bVertical = FALSE;
- m_pFontData = NULL;
- m_pFontDataAllocation = NULL;
- m_dwSize = 0;
- m_pOwnedStream = NULL;
- m_pGsubData = NULL;
- m_pPlatformFont = NULL;
- m_pPlatformFontCollection = NULL;
- m_pDwFont = NULL;
- m_hHandle = NULL;
- m_bDwLoaded = FALSE;
-}
-CFX_Font::~CFX_Font()
-{
- if (m_pSubstFont) {
- delete m_pSubstFont;
- m_pSubstFont = NULL;
- }
-#ifdef FOXIT_CHROME_BUILD
- if (m_pFontDataAllocation) {
- FX_Free(m_pFontDataAllocation);
- m_pFontDataAllocation = NULL;
- }
-#endif
- if (m_Face) {
-#ifdef FOXIT_CHROME_BUILD
- FXFT_Library library = FXFT_Get_Face_FreeType(m_Face);
- if (FXFT_Get_Face_External_Stream(m_Face)) {
- FXFT_Clear_Face_External_Stream(m_Face);
- }
-#endif
- if(m_bEmbedded) {
- DeleteFace();
- } else {
- CFX_GEModule::Get()->GetFontMgr()->ReleaseFace(m_Face);
- }
- }
- if (m_pOwnedStream) {
- FX_Free(m_pOwnedStream);
- m_pOwnedStream = NULL;
- }
- if (m_pGsubData) {
- FX_Free(m_pGsubData);
- m_pGsubData = NULL;
- }
-#if (_FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ && (!defined(_FPDFAPI_MINI_)))
- ReleasePlatformResource();
-#endif
-}
-void CFX_Font::DeleteFace()
-{
- FXFT_Done_Face(m_Face);
- m_Face = NULL;
-}
-FX_BOOL CFX_Font::LoadSubst(const CFX_ByteString& face_name, FX_BOOL bTrueType, FX_DWORD flags,
- int weight, int italic_angle, int CharsetCP, FX_BOOL bVertical)
-{
- m_bEmbedded = FALSE;
- m_bVertical = bVertical;
- m_pSubstFont = FX_NEW CFX_SubstFont;
- if (!m_pSubstFont) {
- return FALSE;
- }
- m_Face = CFX_GEModule::Get()->GetFontMgr()->FindSubstFont(face_name, bTrueType, flags, weight, italic_angle,
- CharsetCP, m_pSubstFont);
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
- if(m_pSubstFont->m_ExtHandle) {
- m_pPlatformFont = m_pSubstFont->m_ExtHandle;
- m_pSubstFont->m_ExtHandle = NULL;
- }
-#endif
- if (m_Face) {
- m_pFontData = FXFT_Get_Face_Stream_Base(m_Face);
- m_dwSize = FXFT_Get_Face_Stream_Size(m_Face);
- }
- return TRUE;
-}
-extern "C" {
- unsigned long _FTStreamRead(FXFT_Stream stream, unsigned long offset,
- unsigned char* buffer, unsigned long count)
- {
- if (count == 0) {
- return 0;
- }
- IFX_FileRead* pFile = (IFX_FileRead*)stream->descriptor.pointer;
- int res = pFile->ReadBlock(buffer, offset, count);
- if (res) {
- return count;
- }
- return 0;
- }
- void _FTStreamClose(FXFT_Stream stream)
- {
- }
-};
-FX_BOOL _LoadFile(FXFT_Library library, FXFT_Face* Face, IFX_FileRead* pFile, FXFT_Stream* stream)
-{
- FXFT_Stream stream1 = (FXFT_Stream)FX_Alloc(FX_BYTE, sizeof (FXFT_StreamRec));
- if (!stream1) {
- return FALSE;
- }
- stream1->base = NULL;
- stream1->size = (unsigned long)pFile->GetSize();
- stream1->pos = 0;
- stream1->descriptor.pointer = pFile;
- stream1->close = _FTStreamClose;
- stream1->read = _FTStreamRead;
- FXFT_Open_Args args;
- args.flags = FT_OPEN_STREAM;
- args.stream = stream1;
- if (FXFT_Open_Face(library, &args, 0, Face)) {
- FX_Free(stream1);
- return FALSE;
- }
- if (stream) {
- *stream = stream1;
- }
- return TRUE;
-}
-FX_BOOL CFX_Font::LoadFile(IFX_FileRead* pFile)
-{
- m_bEmbedded = FALSE;
- FXFT_Library library;
- if (CFX_GEModule::Get()->GetFontMgr()->m_FTLibrary == NULL) {
- FXFT_Init_FreeType(&CFX_GEModule::Get()->GetFontMgr()->m_FTLibrary);
- }
- library = CFX_GEModule::Get()->GetFontMgr()->m_FTLibrary;
- FXFT_Stream stream = NULL;
- if (!_LoadFile(library, &m_Face, pFile, &stream)) {
- return FALSE;
- }
- m_pOwnedStream = stream;
- FXFT_Set_Pixel_Sizes(m_Face, 0, 64);
- return TRUE;
-}
-int CFX_Font::GetGlyphWidth(FX_DWORD glyph_index)
-{
- if (!m_Face) {
- return 0;
- }
- if (m_pSubstFont && (m_pSubstFont->m_SubstFlags & FXFONT_SUBST_MM)) {
- AdjustMMParams(glyph_index, 0, 0);
- }
- int err = FXFT_Load_Glyph(m_Face, glyph_index, FXFT_LOAD_NO_SCALE | FXFT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH);
- if (err) {
- return 0;
- }
- int width = EM_ADJUST(FXFT_Get_Face_UnitsPerEM(m_Face), FXFT_Get_Glyph_HoriAdvance(m_Face));
- return width;
-}
-static FXFT_Face FT_LoadFont(FX_LPBYTE pData, int size)
-{
- FXFT_Library library;
- if (CFX_GEModule::Get()->GetFontMgr()->m_FTLibrary == NULL) {
- FXFT_Init_FreeType(&CFX_GEModule::Get()->GetFontMgr()->m_FTLibrary);
- }
- library = CFX_GEModule::Get()->GetFontMgr()->m_FTLibrary;
- FXFT_Face face;
- int error = FXFT_New_Memory_Face(library, pData, size, 0, &face);
- if (error) {
- return NULL;
- }
- error = FXFT_Set_Pixel_Sizes(face, 64, 64);
- if (error) {
- return NULL;
- }
- return face;
-}
-FX_BOOL CFX_Font::LoadEmbedded(FX_LPCBYTE data, FX_DWORD size)
-{
-#ifdef FOXIT_CHROME_BUILD
- m_pFontDataAllocation = FX_Alloc(FX_BYTE, size);
- if (!m_pFontDataAllocation) {
- return FALSE;
- }
- FXSYS_memcpy32(m_pFontDataAllocation, data, size);
- m_Face = FT_LoadFont((FX_LPBYTE)m_pFontDataAllocation, size);
- m_pFontData = (FX_LPBYTE)m_pFontDataAllocation;
-#else
- m_Face = FT_LoadFont((FX_LPBYTE)data, size);
- m_pFontData = (FX_LPBYTE)data;
-#endif
- m_bEmbedded = TRUE;
- m_dwSize = size;
- return m_Face != NULL;
-}
-FX_BOOL CFX_Font::IsTTFont()
-{
- if (m_Face == NULL) {
- return FALSE;
- }
- return FXFT_Is_Face_TT_OT(m_Face) == FXFT_FACE_FLAG_SFNT;
-}
-int CFX_Font::GetAscent() const
-{
- if (m_Face == NULL) {
- return 0;
- }
- int ascent = EM_ADJUST(FXFT_Get_Face_UnitsPerEM(m_Face), FXFT_Get_Face_Ascender(m_Face));
- return ascent;
-}
-int CFX_Font::GetDescent() const
-{
- if (m_Face == NULL) {
- return 0;
- }
- int descent = EM_ADJUST(FXFT_Get_Face_UnitsPerEM(m_Face), FXFT_Get_Face_Descender(m_Face));
- return descent;
-}
-FX_BOOL CFX_Font::GetGlyphBBox(FX_DWORD glyph_index, FX_RECT &bbox)
-{
- if (m_Face == NULL) {
- return FALSE;
- }
- if (FXFT_Is_Face_Tricky(m_Face)) {
- int error = FXFT_Set_Char_Size(m_Face, 0, 1000 * 64, 72, 72);
- if (error) {
- return FALSE;
- }
- error = FXFT_Load_Glyph(m_Face, glyph_index, FXFT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH);
- if (error) {
- return FALSE;
- }
- FXFT_BBox cbox;
- FT_Glyph glyph;
- error = FXFT_Get_Glyph(((FXFT_Face)m_Face)->glyph, &glyph);
- if (error) {
- return FALSE;
- }
- FXFT_Glyph_Get_CBox(glyph, FXFT_GLYPH_BBOX_PIXELS, &cbox);
- int pixel_size_x = ((FXFT_Face)m_Face)->size->metrics.x_ppem,
- pixel_size_y = ((FXFT_Face)m_Face)->size->metrics.y_ppem;
- if (pixel_size_x == 0 || pixel_size_y == 0) {
- bbox.left = cbox.xMin;
- bbox.right = cbox.xMax;
- bbox.top = cbox.yMax;
- bbox.bottom = cbox.yMin;
- } else {
- bbox.left = cbox.xMin * 1000 / pixel_size_x;
- bbox.right = cbox.xMax * 1000 / pixel_size_x;
- bbox.top = cbox.yMax * 1000 / pixel_size_y;
- bbox.bottom = cbox.yMin * 1000 / pixel_size_y;
- }
- if (bbox.top > FXFT_Get_Face_Ascender(m_Face)) {
- bbox.top = FXFT_Get_Face_Ascender(m_Face);
- }
- if (bbox.bottom < FXFT_Get_Face_Descender(m_Face)) {
- bbox.bottom = FXFT_Get_Face_Descender(m_Face);
- }
- FT_Done_Glyph(glyph);
- return FXFT_Set_Pixel_Sizes(m_Face, 0, 64) == 0;
- }
- if (FXFT_Load_Glyph(m_Face, glyph_index, FXFT_LOAD_NO_SCALE | FXFT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH)) {
- return FALSE;
- }
- int em = FXFT_Get_Face_UnitsPerEM(m_Face);
- if (em == 0) {
- bbox.left = FXFT_Get_Glyph_HoriBearingX(m_Face);
- bbox.bottom = FXFT_Get_Glyph_HoriBearingY(m_Face);
- bbox.top = bbox.bottom - FXFT_Get_Glyph_Height(m_Face);
- bbox.right = bbox.left + FXFT_Get_Glyph_Width(m_Face);
- } else {
- bbox.left = FXFT_Get_Glyph_HoriBearingX(m_Face) * 1000 / em;
- bbox.top = (FXFT_Get_Glyph_HoriBearingY(m_Face) - FXFT_Get_Glyph_Height(m_Face)) * 1000 / em;
- bbox.right = (FXFT_Get_Glyph_HoriBearingX(m_Face) + FXFT_Get_Glyph_Width(m_Face)) * 1000 / em;
- bbox.bottom = (FXFT_Get_Glyph_HoriBearingY(m_Face)) * 1000 / em;
- }
- return TRUE;
-}
-FX_BOOL CFX_Font::IsItalic()
-{
- if (m_Face == NULL) {
- return FALSE;
- }
- FX_BOOL ret = FXFT_Is_Face_Italic(m_Face) == FXFT_STYLE_FLAG_ITALIC;
- if (!ret) {
- CFX_ByteString str(FXFT_Get_Face_Style_Name(m_Face));
- str.MakeLower();
- if (str.Find("italic") != -1) {
- ret = TRUE;
- }
- }
- return ret;
-}
-FX_BOOL CFX_Font::IsBold()
-{
- if (m_Face == NULL) {
- return FALSE;
- }
- return FXFT_Is_Face_Bold(m_Face) == FXFT_STYLE_FLAG_BOLD;
-}
-FX_BOOL CFX_Font::IsFixedWidth()
-{
- if (m_Face == NULL) {
- return FALSE;
- }
- return FXFT_Is_Face_fixedwidth(m_Face);
-}
-CFX_WideString CFX_Font::GetPsName() const
-{
- if (m_Face == NULL) {
- return CFX_WideString();
- }
- CFX_WideString psName = CFX_WideString::FromLocal(FXFT_Get_Postscript_Name(m_Face));
- if (psName.IsEmpty()) {
- psName = CFX_WideString::FromLocal("Untitled");
- }
- return psName;
-}
-CFX_ByteString CFX_Font::GetFamilyName() const
-{
- if (m_Face == NULL && m_pSubstFont == NULL) {
- return CFX_ByteString();
- }
- if (m_Face) {
- return CFX_ByteString(FXFT_Get_Face_Family_Name(m_Face));
- } else {
- return m_pSubstFont->m_Family;
- }
-}
-CFX_ByteString CFX_Font::GetFaceName() const
-{
- if (m_Face == NULL && m_pSubstFont == NULL) {
- return CFX_ByteString();
- }
- if (m_Face) {
- CFX_ByteString facename;
- CFX_ByteString style = CFX_ByteString(FXFT_Get_Face_Style_Name(m_Face));
- facename = GetFamilyName();
- if (facename.IsEmpty()) {
- facename = "Untitled";
- }
- if (!style.IsEmpty() && style != "Regular") {
- facename += " " + style;
- }
- return facename;
- } else {
- return m_pSubstFont->m_Family;
- }
-}
-FX_BOOL CFX_Font::GetBBox(FX_RECT &bbox)
-{
- if (m_Face == NULL) {
- return FALSE;
- }
- int em = FXFT_Get_Face_UnitsPerEM(m_Face);
- if (em == 0) {
- bbox.left = FXFT_Get_Face_xMin(m_Face);
- bbox.bottom = FXFT_Get_Face_yMax(m_Face);
- bbox.top = FXFT_Get_Face_yMin(m_Face);
- bbox.right = FXFT_Get_Face_xMax(m_Face);
- } else {
- bbox.left = FXFT_Get_Face_xMin(m_Face) * 1000 / em;
- bbox.top = FXFT_Get_Face_yMin(m_Face) * 1000 / em;
- bbox.right = FXFT_Get_Face_xMax(m_Face) * 1000 / em;
- bbox.bottom = FXFT_Get_Face_yMax(m_Face) * 1000 / em;
- }
- return TRUE;
-}
-int CFX_Font::GetHeight()
-{
- if (m_Face == NULL) {
- return 0;
- }
- int height = EM_ADJUST(FXFT_Get_Face_UnitsPerEM(m_Face), FXFT_Get_Face_Height(m_Face));
- return height;
-}
-int CFX_Font::GetMaxAdvanceWidth()
-{
- if (m_Face == NULL) {
- return 0;
- }
- int width = EM_ADJUST(FXFT_Get_Face_UnitsPerEM(m_Face), FXFT_Get_Face_MaxAdvanceWidth(m_Face));
- return width;
-}
-int CFX_Font::GetULPos()
-{
- if (m_Face == NULL) {
- return 0;
- }
- int pos = EM_ADJUST(FXFT_Get_Face_UnitsPerEM(m_Face), FXFT_Get_Face_UnderLinePosition(m_Face));
- return pos;
-}
-int CFX_Font::GetULthickness()
-{
- if (m_Face == NULL) {
- return 0;
- }
- int thickness = EM_ADJUST(FXFT_Get_Face_UnitsPerEM(m_Face), FXFT_Get_Face_UnderLineThickness(m_Face));
- return thickness;
-}
-CFX_UnicodeEncoding::CFX_UnicodeEncoding(CFX_Font* pFont)
-{
- m_pFont = pFont;
-}
-FX_DWORD CFX_UnicodeEncoding::GlyphFromCharCode(FX_DWORD charcode)
-{
- FXFT_Face face = m_pFont->GetFace();
- if (!face) {
- return charcode;
- }
- if (FXFT_Select_Charmap(face, FXFT_ENCODING_UNICODE) == 0) {
- return FXFT_Get_Char_Index(face, charcode);
- }
- if (m_pFont->m_pSubstFont && m_pFont->m_pSubstFont->m_Charset == 2) {
- FX_DWORD index = 0;
- if (FXFT_Select_Charmap(face, FXFT_ENCODING_MS_SYMBOL) == 0) {
- index = FXFT_Get_Char_Index(face, charcode);
- }
- if (!index && !FXFT_Select_Charmap(face, FXFT_ENCODING_APPLE_ROMAN)) {
- return FXFT_Get_Char_Index(face, charcode);
- }
- }
- return charcode;
-}
-FX_DWORD CFX_UnicodeEncoding::GlyphFromCharCodeEx(FX_DWORD charcode, int encoding)
-{
- FXFT_Face face = m_pFont->GetFace();
- if (!face) {
- return charcode;
- }
- if (encoding == ENCODING_UNICODE) {
- return GlyphFromCharCode(charcode);
- } else {
- int nmaps = FXFT_Get_Face_CharmapCount(m_pFont->m_Face);
- int i = 0;
- while (i < nmaps) {
- int encoding = FXFT_Get_Charmap_Encoding(FXFT_Get_Face_Charmaps(face)[i++]);
- if (encoding != FXFT_ENCODING_UNICODE) {
- FXFT_Select_Charmap(face, encoding);
- break;
- }
- }
- }
- return FXFT_Get_Char_Index(face, charcode);
-}
-IFX_FontEncoding* FXGE_CreateUnicodeEncoding(CFX_Font* pFont)
-{
- CFX_UnicodeEncoding* pEncoding = NULL;
- pEncoding = FX_NEW CFX_UnicodeEncoding(pFont);
- return pEncoding;
-}
+// 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
+
+#include "../../../include/fxge/fx_ge.h"
+#include "../../../include/fxge/fx_freetype.h"
+#include "text_int.h"
+#define EM_ADJUST(em, a) (em == 0?(a): (a)*1000/em)
+extern void _FPDFAPI_GetInternalFontData(int id1, FX_LPCBYTE& data, FX_DWORD& size);
+CFX_Font::CFX_Font()
+{
+ m_pSubstFont = NULL;
+ m_Face = NULL;
+ m_bEmbedded = FALSE;
+ m_bVertical = FALSE;
+ m_pFontData = NULL;
+ m_pFontDataAllocation = NULL;
+ m_dwSize = 0;
+ m_pOwnedStream = NULL;
+ m_pGsubData = NULL;
+ m_pPlatformFont = NULL;
+ m_pPlatformFontCollection = NULL;
+ m_pDwFont = NULL;
+ m_hHandle = NULL;
+ m_bDwLoaded = FALSE;
+}
+CFX_Font::~CFX_Font()
+{
+ if (m_pSubstFont) {
+ delete m_pSubstFont;
+ m_pSubstFont = NULL;
+ }
+#ifdef FOXIT_CHROME_BUILD
+ if (m_pFontDataAllocation) {
+ FX_Free(m_pFontDataAllocation);
+ m_pFontDataAllocation = NULL;
+ }
+#endif
+ if (m_Face) {
+#ifdef FOXIT_CHROME_BUILD
+ FXFT_Library library = FXFT_Get_Face_FreeType(m_Face);
+ if (FXFT_Get_Face_External_Stream(m_Face)) {
+ FXFT_Clear_Face_External_Stream(m_Face);
+ }
+#endif
+ if(m_bEmbedded) {
+ DeleteFace();
+ } else {
+ CFX_GEModule::Get()->GetFontMgr()->ReleaseFace(m_Face);
+ }
+ }
+ if (m_pOwnedStream) {
+ FX_Free(m_pOwnedStream);
+ m_pOwnedStream = NULL;
+ }
+ if (m_pGsubData) {
+ FX_Free(m_pGsubData);
+ m_pGsubData = NULL;
+ }
+#if (_FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ && (!defined(_FPDFAPI_MINI_)))
+ ReleasePlatformResource();
+#endif
+}
+void CFX_Font::DeleteFace()
+{
+ FXFT_Done_Face(m_Face);
+ m_Face = NULL;
+}
+FX_BOOL CFX_Font::LoadSubst(const CFX_ByteString& face_name, FX_BOOL bTrueType, FX_DWORD flags,
+ int weight, int italic_angle, int CharsetCP, FX_BOOL bVertical)
+{
+ m_bEmbedded = FALSE;
+ m_bVertical = bVertical;
+ m_pSubstFont = FX_NEW CFX_SubstFont;
+ if (!m_pSubstFont) {
+ return FALSE;
+ }
+ m_Face = CFX_GEModule::Get()->GetFontMgr()->FindSubstFont(face_name, bTrueType, flags, weight, italic_angle,
+ CharsetCP, m_pSubstFont);
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
+ if(m_pSubstFont->m_ExtHandle) {
+ m_pPlatformFont = m_pSubstFont->m_ExtHandle;
+ m_pSubstFont->m_ExtHandle = NULL;
+ }
+#endif
+ if (m_Face) {
+ m_pFontData = FXFT_Get_Face_Stream_Base(m_Face);
+ m_dwSize = FXFT_Get_Face_Stream_Size(m_Face);
+ }
+ return TRUE;
+}
+extern "C" {
+ unsigned long _FTStreamRead(FXFT_Stream stream, unsigned long offset,
+ unsigned char* buffer, unsigned long count)
+ {
+ if (count == 0) {
+ return 0;
+ }
+ IFX_FileRead* pFile = (IFX_FileRead*)stream->descriptor.pointer;
+ int res = pFile->ReadBlock(buffer, offset, count);
+ if (res) {
+ return count;
+ }
+ return 0;
+ }
+ void _FTStreamClose(FXFT_Stream stream)
+ {
+ }
+};
+FX_BOOL _LoadFile(FXFT_Library library, FXFT_Face* Face, IFX_FileRead* pFile, FXFT_Stream* stream)
+{
+ FXFT_Stream stream1 = (FXFT_Stream)FX_Alloc(FX_BYTE, sizeof (FXFT_StreamRec));
+ if (!stream1) {
+ return FALSE;
+ }
+ stream1->base = NULL;
+ stream1->size = (unsigned long)pFile->GetSize();
+ stream1->pos = 0;
+ stream1->descriptor.pointer = pFile;
+ stream1->close = _FTStreamClose;
+ stream1->read = _FTStreamRead;
+ FXFT_Open_Args args;
+ args.flags = FT_OPEN_STREAM;
+ args.stream = stream1;
+ if (FXFT_Open_Face(library, &args, 0, Face)) {
+ FX_Free(stream1);
+ return FALSE;
+ }
+ if (stream) {
+ *stream = stream1;
+ }
+ return TRUE;
+}
+FX_BOOL CFX_Font::LoadFile(IFX_FileRead* pFile)
+{
+ m_bEmbedded = FALSE;
+ FXFT_Library library;
+ if (CFX_GEModule::Get()->GetFontMgr()->m_FTLibrary == NULL) {
+ FXFT_Init_FreeType(&CFX_GEModule::Get()->GetFontMgr()->m_FTLibrary);
+ }
+ library = CFX_GEModule::Get()->GetFontMgr()->m_FTLibrary;
+ FXFT_Stream stream = NULL;
+ if (!_LoadFile(library, &m_Face, pFile, &stream)) {
+ return FALSE;
+ }
+ m_pOwnedStream = stream;
+ FXFT_Set_Pixel_Sizes(m_Face, 0, 64);
+ return TRUE;
+}
+int CFX_Font::GetGlyphWidth(FX_DWORD glyph_index)
+{
+ if (!m_Face) {
+ return 0;
+ }
+ if (m_pSubstFont && (m_pSubstFont->m_SubstFlags & FXFONT_SUBST_MM)) {
+ AdjustMMParams(glyph_index, 0, 0);
+ }
+ int err = FXFT_Load_Glyph(m_Face, glyph_index, FXFT_LOAD_NO_SCALE | FXFT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH);
+ if (err) {
+ return 0;
+ }
+ int width = EM_ADJUST(FXFT_Get_Face_UnitsPerEM(m_Face), FXFT_Get_Glyph_HoriAdvance(m_Face));
+ return width;
+}
+static FXFT_Face FT_LoadFont(FX_LPBYTE pData, int size)
+{
+ FXFT_Library library;
+ if (CFX_GEModule::Get()->GetFontMgr()->m_FTLibrary == NULL) {
+ FXFT_Init_FreeType(&CFX_GEModule::Get()->GetFontMgr()->m_FTLibrary);
+ }
+ library = CFX_GEModule::Get()->GetFontMgr()->m_FTLibrary;
+ FXFT_Face face;
+ int error = FXFT_New_Memory_Face(library, pData, size, 0, &face);
+ if (error) {
+ return NULL;
+ }
+ error = FXFT_Set_Pixel_Sizes(face, 64, 64);
+ if (error) {
+ return NULL;
+ }
+ return face;
+}
+FX_BOOL CFX_Font::LoadEmbedded(FX_LPCBYTE data, FX_DWORD size)
+{
+#ifdef FOXIT_CHROME_BUILD
+ m_pFontDataAllocation = FX_Alloc(FX_BYTE, size);
+ if (!m_pFontDataAllocation) {
+ return FALSE;
+ }
+ FXSYS_memcpy32(m_pFontDataAllocation, data, size);
+ m_Face = FT_LoadFont((FX_LPBYTE)m_pFontDataAllocation, size);
+ m_pFontData = (FX_LPBYTE)m_pFontDataAllocation;
+#else
+ m_Face = FT_LoadFont((FX_LPBYTE)data, size);
+ m_pFontData = (FX_LPBYTE)data;
+#endif
+ m_bEmbedded = TRUE;
+ m_dwSize = size;
+ return m_Face != NULL;
+}
+FX_BOOL CFX_Font::IsTTFont()
+{
+ if (m_Face == NULL) {
+ return FALSE;
+ }
+ return FXFT_Is_Face_TT_OT(m_Face) == FXFT_FACE_FLAG_SFNT;
+}
+int CFX_Font::GetAscent() const
+{
+ if (m_Face == NULL) {
+ return 0;
+ }
+ int ascent = EM_ADJUST(FXFT_Get_Face_UnitsPerEM(m_Face), FXFT_Get_Face_Ascender(m_Face));
+ return ascent;
+}
+int CFX_Font::GetDescent() const
+{
+ if (m_Face == NULL) {
+ return 0;
+ }
+ int descent = EM_ADJUST(FXFT_Get_Face_UnitsPerEM(m_Face), FXFT_Get_Face_Descender(m_Face));
+ return descent;
+}
+FX_BOOL CFX_Font::GetGlyphBBox(FX_DWORD glyph_index, FX_RECT &bbox)
+{
+ if (m_Face == NULL) {
+ return FALSE;
+ }
+ if (FXFT_Is_Face_Tricky(m_Face)) {
+ int error = FXFT_Set_Char_Size(m_Face, 0, 1000 * 64, 72, 72);
+ if (error) {
+ return FALSE;
+ }
+ error = FXFT_Load_Glyph(m_Face, glyph_index, FXFT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH);
+ if (error) {
+ return FALSE;
+ }
+ FXFT_BBox cbox;
+ FT_Glyph glyph;
+ error = FXFT_Get_Glyph(((FXFT_Face)m_Face)->glyph, &glyph);
+ if (error) {
+ return FALSE;
+ }
+ FXFT_Glyph_Get_CBox(glyph, FXFT_GLYPH_BBOX_PIXELS, &cbox);
+ int pixel_size_x = ((FXFT_Face)m_Face)->size->metrics.x_ppem,
+ pixel_size_y = ((FXFT_Face)m_Face)->size->metrics.y_ppem;
+ if (pixel_size_x == 0 || pixel_size_y == 0) {
+ bbox.left = cbox.xMin;
+ bbox.right = cbox.xMax;
+ bbox.top = cbox.yMax;
+ bbox.bottom = cbox.yMin;
+ } else {
+ bbox.left = cbox.xMin * 1000 / pixel_size_x;
+ bbox.right = cbox.xMax * 1000 / pixel_size_x;
+ bbox.top = cbox.yMax * 1000 / pixel_size_y;
+ bbox.bottom = cbox.yMin * 1000 / pixel_size_y;
+ }
+ if (bbox.top > FXFT_Get_Face_Ascender(m_Face)) {
+ bbox.top = FXFT_Get_Face_Ascender(m_Face);
+ }
+ if (bbox.bottom < FXFT_Get_Face_Descender(m_Face)) {
+ bbox.bottom = FXFT_Get_Face_Descender(m_Face);
+ }
+ FT_Done_Glyph(glyph);
+ return FXFT_Set_Pixel_Sizes(m_Face, 0, 64) == 0;
+ }
+ if (FXFT_Load_Glyph(m_Face, glyph_index, FXFT_LOAD_NO_SCALE | FXFT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH)) {
+ return FALSE;
+ }
+ int em = FXFT_Get_Face_UnitsPerEM(m_Face);
+ if (em == 0) {
+ bbox.left = FXFT_Get_Glyph_HoriBearingX(m_Face);
+ bbox.bottom = FXFT_Get_Glyph_HoriBearingY(m_Face);
+ bbox.top = bbox.bottom - FXFT_Get_Glyph_Height(m_Face);
+ bbox.right = bbox.left + FXFT_Get_Glyph_Width(m_Face);
+ } else {
+ bbox.left = FXFT_Get_Glyph_HoriBearingX(m_Face) * 1000 / em;
+ bbox.top = (FXFT_Get_Glyph_HoriBearingY(m_Face) - FXFT_Get_Glyph_Height(m_Face)) * 1000 / em;
+ bbox.right = (FXFT_Get_Glyph_HoriBearingX(m_Face) + FXFT_Get_Glyph_Width(m_Face)) * 1000 / em;
+ bbox.bottom = (FXFT_Get_Glyph_HoriBearingY(m_Face)) * 1000 / em;
+ }
+ return TRUE;
+}
+FX_BOOL CFX_Font::IsItalic()
+{
+ if (m_Face == NULL) {
+ return FALSE;
+ }
+ FX_BOOL ret = FXFT_Is_Face_Italic(m_Face) == FXFT_STYLE_FLAG_ITALIC;
+ if (!ret) {
+ CFX_ByteString str(FXFT_Get_Face_Style_Name(m_Face));
+ str.MakeLower();
+ if (str.Find("italic") != -1) {
+ ret = TRUE;
+ }
+ }
+ return ret;
+}
+FX_BOOL CFX_Font::IsBold()
+{
+ if (m_Face == NULL) {
+ return FALSE;
+ }
+ return FXFT_Is_Face_Bold(m_Face) == FXFT_STYLE_FLAG_BOLD;
+}
+FX_BOOL CFX_Font::IsFixedWidth()
+{
+ if (m_Face == NULL) {
+ return FALSE;
+ }
+ return FXFT_Is_Face_fixedwidth(m_Face);
+}
+CFX_WideString CFX_Font::GetPsName() const
+{
+ if (m_Face == NULL) {
+ return CFX_WideString();
+ }
+ CFX_WideString psName = CFX_WideString::FromLocal(FXFT_Get_Postscript_Name(m_Face));
+ if (psName.IsEmpty()) {
+ psName = CFX_WideString::FromLocal("Untitled");
+ }
+ return psName;
+}
+CFX_ByteString CFX_Font::GetFamilyName() const
+{
+ if (m_Face == NULL && m_pSubstFont == NULL) {
+ return CFX_ByteString();
+ }
+ if (m_Face) {
+ return CFX_ByteString(FXFT_Get_Face_Family_Name(m_Face));
+ } else {
+ return m_pSubstFont->m_Family;
+ }
+}
+CFX_ByteString CFX_Font::GetFaceName() const
+{
+ if (m_Face == NULL && m_pSubstFont == NULL) {
+ return CFX_ByteString();
+ }
+ if (m_Face) {
+ CFX_ByteString facename;
+ CFX_ByteString style = CFX_ByteString(FXFT_Get_Face_Style_Name(m_Face));
+ facename = GetFamilyName();
+ if (facename.IsEmpty()) {
+ facename = "Untitled";
+ }
+ if (!style.IsEmpty() && style != "Regular") {
+ facename += " " + style;
+ }
+ return facename;
+ } else {
+ return m_pSubstFont->m_Family;
+ }
+}
+FX_BOOL CFX_Font::GetBBox(FX_RECT &bbox)
+{
+ if (m_Face == NULL) {
+ return FALSE;
+ }
+ int em = FXFT_Get_Face_UnitsPerEM(m_Face);
+ if (em == 0) {
+ bbox.left = FXFT_Get_Face_xMin(m_Face);
+ bbox.bottom = FXFT_Get_Face_yMax(m_Face);
+ bbox.top = FXFT_Get_Face_yMin(m_Face);
+ bbox.right = FXFT_Get_Face_xMax(m_Face);
+ } else {
+ bbox.left = FXFT_Get_Face_xMin(m_Face) * 1000 / em;
+ bbox.top = FXFT_Get_Face_yMin(m_Face) * 1000 / em;
+ bbox.right = FXFT_Get_Face_xMax(m_Face) * 1000 / em;
+ bbox.bottom = FXFT_Get_Face_yMax(m_Face) * 1000 / em;
+ }
+ return TRUE;
+}
+int CFX_Font::GetHeight()
+{
+ if (m_Face == NULL) {
+ return 0;
+ }
+ int height = EM_ADJUST(FXFT_Get_Face_UnitsPerEM(m_Face), FXFT_Get_Face_Height(m_Face));
+ return height;
+}
+int CFX_Font::GetMaxAdvanceWidth()
+{
+ if (m_Face == NULL) {
+ return 0;
+ }
+ int width = EM_ADJUST(FXFT_Get_Face_UnitsPerEM(m_Face), FXFT_Get_Face_MaxAdvanceWidth(m_Face));
+ return width;
+}
+int CFX_Font::GetULPos()
+{
+ if (m_Face == NULL) {
+ return 0;
+ }
+ int pos = EM_ADJUST(FXFT_Get_Face_UnitsPerEM(m_Face), FXFT_Get_Face_UnderLinePosition(m_Face));
+ return pos;
+}
+int CFX_Font::GetULthickness()
+{
+ if (m_Face == NULL) {
+ return 0;
+ }
+ int thickness = EM_ADJUST(FXFT_Get_Face_UnitsPerEM(m_Face), FXFT_Get_Face_UnderLineThickness(m_Face));
+ return thickness;
+}
+CFX_UnicodeEncoding::CFX_UnicodeEncoding(CFX_Font* pFont)
+{
+ m_pFont = pFont;
+}
+FX_DWORD CFX_UnicodeEncoding::GlyphFromCharCode(FX_DWORD charcode)
+{
+ FXFT_Face face = m_pFont->GetFace();
+ if (!face) {
+ return charcode;
+ }
+ if (FXFT_Select_Charmap(face, FXFT_ENCODING_UNICODE) == 0) {
+ return FXFT_Get_Char_Index(face, charcode);
+ }
+ if (m_pFont->m_pSubstFont && m_pFont->m_pSubstFont->m_Charset == 2) {
+ FX_DWORD index = 0;
+ if (FXFT_Select_Charmap(face, FXFT_ENCODING_MS_SYMBOL) == 0) {
+ index = FXFT_Get_Char_Index(face, charcode);
+ }
+ if (!index && !FXFT_Select_Charmap(face, FXFT_ENCODING_APPLE_ROMAN)) {
+ return FXFT_Get_Char_Index(face, charcode);
+ }
+ }
+ return charcode;
+}
+FX_DWORD CFX_UnicodeEncoding::GlyphFromCharCodeEx(FX_DWORD charcode, int encoding)
+{
+ FXFT_Face face = m_pFont->GetFace();
+ if (!face) {
+ return charcode;
+ }
+ if (encoding == ENCODING_UNICODE) {
+ return GlyphFromCharCode(charcode);
+ } else {
+ int nmaps = FXFT_Get_Face_CharmapCount(m_pFont->m_Face);
+ int i = 0;
+ while (i < nmaps) {
+ int encoding = FXFT_Get_Charmap_Encoding(FXFT_Get_Face_Charmaps(face)[i++]);
+ if (encoding != FXFT_ENCODING_UNICODE) {
+ FXFT_Select_Charmap(face, encoding);
+ break;
+ }
+ }
+ }
+ return FXFT_Get_Char_Index(face, charcode);
+}
+IFX_FontEncoding* FXGE_CreateUnicodeEncoding(CFX_Font* pFont)
+{
+ CFX_UnicodeEncoding* pEncoding = NULL;
+ pEncoding = FX_NEW CFX_UnicodeEncoding(pFont);
+ return pEncoding;
+}
diff --git a/core/src/fxge/ge/fx_ge_fontmap.cpp b/core/src/fxge/ge/fx_ge_fontmap.cpp
index 6549e8e531..8c2751d84a 100644
--- a/core/src/fxge/ge/fx_ge_fontmap.cpp
+++ b/core/src/fxge/ge/fx_ge_fontmap.cpp
@@ -1,1558 +1,1558 @@
-// 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
-
-#include "../../../include/fxge/fx_ge.h"
-#include "../../../include/fxge/fx_freetype.h"
-#include "text_int.h"
-#define GET_TT_SHORT(w) (FX_WORD)(((w)[0] << 8) | (w)[1])
-#define GET_TT_LONG(w) (FX_DWORD)(((w)[0] << 24) | ((w)[1] << 16) | ((w)[2] << 8) | (w)[3])
-CFX_SubstFont::CFX_SubstFont()
-{
- m_ExtHandle = NULL;
- m_Charset = 0;
- m_SubstFlags = 0;
- m_Weight = 0;
- m_ItalicAngle = 0;
- m_bSubstOfCJK = FALSE;
- m_WeightCJK = 0;
- m_bItlicCJK = FALSE;
-}
-CTTFontDesc::~CTTFontDesc()
-{
- if (m_Type == 1) {
- if (m_SingleFace.m_pFace) {
- FXFT_Done_Face(m_SingleFace.m_pFace);
- }
- } else if (m_Type == 2) {
- for (int i = 0; i < 16; i ++)
- if (m_TTCFace.m_pFaces[i]) {
- FXFT_Done_Face(m_TTCFace.m_pFaces[i]);
- }
- }
- if (m_pFontData) {
- FX_Free(m_pFontData);
- }
-}
-FX_BOOL CTTFontDesc::ReleaseFace(FXFT_Face face)
-{
- if (m_Type == 1) {
- if (m_SingleFace.m_pFace != face) {
- return FALSE;
- }
- } else if (m_Type == 2) {
- int i;
- for (i = 0; i < 16; i ++)
- if (m_TTCFace.m_pFaces[i] == face) {
- break;
- }
- if (i == 16) {
- return FALSE;
- }
- }
- m_RefCount --;
- if (m_RefCount) {
- return FALSE;
- }
- delete this;
- return TRUE;
-}
-CFX_FontMgr::CFX_FontMgr()
-{
- m_pBuiltinMapper = FX_NEW CFX_FontMapper;
- if (!m_pBuiltinMapper) {
- return;
- }
- m_pBuiltinMapper->m_pFontMgr = this;
- m_pExtMapper = NULL;
- m_FTLibrary = NULL;
- FXSYS_memset32(m_ExternalFonts, 0, sizeof m_ExternalFonts);
-}
-CFX_FontMgr::~CFX_FontMgr()
-{
- if (m_pBuiltinMapper) {
- delete m_pBuiltinMapper;
- }
- FreeCache();
- if (m_FTLibrary) {
- FXFT_Done_FreeType(m_FTLibrary);
- }
-}
-void CFX_FontMgr::InitFTLibrary()
-{
- if (m_FTLibrary == NULL) {
- FXFT_Init_FreeType(&m_FTLibrary);
- }
-}
-void CFX_FontMgr::FreeCache()
-{
- FX_POSITION pos = m_FaceMap.GetStartPosition();
- while(pos) {
- CFX_ByteString Key;
- CTTFontDesc* face;
- m_FaceMap.GetNextAssoc(pos, Key, (void*&)face);
- delete face;
- }
- m_FaceMap.RemoveAll();
-}
-void CFX_FontMgr::SetSystemFontInfo(IFX_SystemFontInfo* pFontInfo)
-{
- m_pBuiltinMapper->SetSystemFontInfo(pFontInfo);
-}
-FXFT_Face CFX_FontMgr::FindSubstFont(const CFX_ByteString& face_name, FX_BOOL bTrueType,
- FX_DWORD flags, int weight, int italic_angle, int CharsetCP, CFX_SubstFont* pSubstFont)
-{
- if (m_FTLibrary == NULL) {
- FXFT_Init_FreeType(&m_FTLibrary);
- }
- if (m_pExtMapper) {
- FXFT_Face face = m_pExtMapper->FindSubstFont(face_name, bTrueType, flags, weight, italic_angle,
- CharsetCP, pSubstFont);
- if (face) {
- return face;
- }
- }
- return m_pBuiltinMapper->FindSubstFont(face_name, bTrueType, flags, weight, italic_angle,
- CharsetCP, pSubstFont);
-}
-FXFT_Face CFX_FontMgr::GetCachedFace(const CFX_ByteString& face_name,
- int weight, FX_BOOL bItalic, FX_LPBYTE& pFontData)
-{
- CFX_ByteString key(face_name);
- key += ',';
- key += CFX_ByteString::FormatInteger(weight);
- key += bItalic ? 'I' : 'N';
- CTTFontDesc* pFontDesc = NULL;
- m_FaceMap.Lookup(key, (void*&)pFontDesc);
- if(pFontDesc) {
- pFontData = pFontDesc->m_pFontData;
- pFontDesc->m_RefCount ++;
- return pFontDesc->m_SingleFace.m_pFace;
- }
- return NULL;
-}
-FXFT_Face CFX_FontMgr::AddCachedFace(const CFX_ByteString& face_name,
- int weight, FX_BOOL bItalic, FX_LPBYTE pData, FX_DWORD size, int face_index)
-{
- CTTFontDesc* pFontDesc = FX_NEW CTTFontDesc;
- if (!pFontDesc) {
- return NULL;
- }
- pFontDesc->m_Type = 1;
- pFontDesc->m_SingleFace.m_pFace = NULL;
- pFontDesc->m_SingleFace.m_bBold = weight;
- pFontDesc->m_SingleFace.m_bItalic = bItalic;
- pFontDesc->m_pFontData = pData;
- pFontDesc->m_RefCount = 1;
- FXFT_Library library;
- if (m_FTLibrary == NULL) {
- FXFT_Init_FreeType(&m_FTLibrary);
- }
- library = m_FTLibrary;
- int ret = FXFT_New_Memory_Face(library, pData, size, face_index, &pFontDesc->m_SingleFace.m_pFace);
- if (ret) {
- delete pFontDesc;
- return NULL;
- }
- ret = FXFT_Set_Pixel_Sizes(pFontDesc->m_SingleFace.m_pFace, 64, 64);
- if (ret) {
- delete pFontDesc;
- return NULL;
- }
- CFX_ByteString key(face_name);
- key += ',';
- key += CFX_ByteString::FormatInteger(weight);
- key += bItalic ? 'I' : 'N';
- m_FaceMap.SetAt(key, pFontDesc);
- return pFontDesc->m_SingleFace.m_pFace;
-}
-const FX_LPCSTR g_Base14FontNames[14] = {
- "Courier",
- "Courier-Bold",
- "Courier-BoldOblique",
- "Courier-Oblique",
- "Helvetica",
- "Helvetica-Bold",
- "Helvetica-BoldOblique",
- "Helvetica-Oblique",
- "Times-Roman",
- "Times-Bold",
- "Times-BoldItalic",
- "Times-Italic",
- "Symbol",
- "ZapfDingbats",
-};
-const struct _AltFontName {
- const FX_CHAR* m_pName;
- int m_Index;
-}
-g_AltFontNames[] = {
- {"Arial", 4},
- {"Arial,Bold", 5},
- {"Arial,BoldItalic", 6},
- {"Arial,Italic", 7},
- {"Arial-Bold", 5},
- {"Arial-BoldItalic", 6},
- {"Arial-BoldItalicMT", 6},
- {"Arial-BoldMT", 5},
- {"Arial-Italic", 7},
- {"Arial-ItalicMT", 7},
- {"ArialBold", 5},
- {"ArialBoldItalic", 6},
- {"ArialItalic", 7},
- {"ArialMT", 4},
- {"ArialMT,Bold", 5},
- {"ArialMT,BoldItalic", 6},
- {"ArialMT,Italic", 7},
- {"ArialRoundedMTBold", 5},
- {"Courier", 0},
- {"Courier,Bold", 1},
- {"Courier,BoldItalic", 2},
- {"Courier,Italic", 3},
- {"Courier-Bold", 1},
- {"Courier-BoldOblique", 2},
- {"Courier-Oblique", 3},
- {"CourierBold", 1},
- {"CourierBoldItalic", 2},
- {"CourierItalic", 3},
- {"CourierNew", 0},
- {"CourierNew,Bold", 1},
- {"CourierNew,BoldItalic", 2},
- {"CourierNew,Italic", 3},
- {"CourierNew-Bold", 1},
- {"CourierNew-BoldItalic", 2},
- {"CourierNew-Italic", 3},
- {"CourierNewBold", 1},
- {"CourierNewBoldItalic", 2},
- {"CourierNewItalic", 3},
- {"CourierNewPS-BoldItalicMT", 2},
- {"CourierNewPS-BoldMT", 1},
- {"CourierNewPS-ItalicMT", 3},
- {"CourierNewPSMT", 0},
- {"CourierStd", 0},
- {"CourierStd-Bold", 1},
- {"CourierStd-BoldOblique", 2},
- {"CourierStd-Oblique", 3},
- {"Helvetica", 4},
- {"Helvetica,Bold", 5},
- {"Helvetica,BoldItalic", 6},
- {"Helvetica,Italic", 7},
- {"Helvetica-Bold", 5},
- {"Helvetica-BoldItalic", 6},
- {"Helvetica-BoldOblique", 6},
- {"Helvetica-Italic", 7},
- {"Helvetica-Oblique", 7},
- {"HelveticaBold", 5},
- {"HelveticaBoldItalic", 6},
- {"HelveticaItalic", 7},
- {"Symbol", 12},
- {"SymbolMT", 12},
- {"Times-Bold", 9},
- {"Times-BoldItalic", 10},
- {"Times-Italic", 11},
- {"Times-Roman", 8},
- {"TimesBold", 9},
- {"TimesBoldItalic", 10},
- {"TimesItalic", 11},
- {"TimesNewRoman", 8},
- {"TimesNewRoman,Bold", 9},
- {"TimesNewRoman,BoldItalic", 10},
- {"TimesNewRoman,Italic", 11},
- {"TimesNewRoman-Bold", 9},
- {"TimesNewRoman-BoldItalic", 10},
- {"TimesNewRoman-Italic", 11},
- {"TimesNewRomanBold", 9},
- {"TimesNewRomanBoldItalic", 10},
- {"TimesNewRomanItalic", 11},
- {"TimesNewRomanPS", 8},
- {"TimesNewRomanPS-Bold", 9},
- {"TimesNewRomanPS-BoldItalic", 10},
- {"TimesNewRomanPS-BoldItalicMT", 10},
- {"TimesNewRomanPS-BoldMT", 9},
- {"TimesNewRomanPS-Italic", 11},
- {"TimesNewRomanPS-ItalicMT", 11},
- {"TimesNewRomanPSMT", 8},
- {"TimesNewRomanPSMT,Bold", 9},
- {"TimesNewRomanPSMT,BoldItalic", 10},
- {"TimesNewRomanPSMT,Italic", 11},
- {"ZapfDingbats", 13},
-};
-extern "C" {
- static int compareString(const void* key, const void* element)
- {
- return FXSYS_stricmp((FX_LPCSTR)key, ((_AltFontName*)element)->m_pName);
- }
-}
-int _PDF_GetStandardFontName(CFX_ByteString& name)
-{
- _AltFontName* found = (_AltFontName*)FXSYS_bsearch((FX_LPCSTR)name, g_AltFontNames,
- sizeof g_AltFontNames / sizeof (_AltFontName), sizeof (_AltFontName), compareString);
- if (found == NULL) {
- return -1;
- }
- name = g_Base14FontNames[found->m_Index];
- return found->m_Index;
-}
-int GetTTCIndex(FX_LPCBYTE pFontData, FX_DWORD ttc_size, FX_DWORD font_offset)
-{
- int face_index = 0;
- FX_LPCBYTE p = pFontData + 8;
- FX_DWORD nfont = GET_TT_LONG(p);
- FX_DWORD index;
- for (index = 0; index < nfont; index ++) {
- p = pFontData + 12 + index * 4;
- if (GET_TT_LONG(p) == font_offset) {
- break;
- }
- }
- if(index >= nfont) {
- face_index = 0;
- } else {
- face_index = index;
- }
- return face_index;
-}
-FXFT_Face CFX_FontMgr::GetCachedTTCFace(int ttc_size, FX_DWORD checksum,
- int font_offset, FX_LPBYTE& pFontData)
-{
- CFX_ByteString key;
- key.Format("%d:%d", ttc_size, checksum);
- CTTFontDesc* pFontDesc = NULL;
- m_FaceMap.Lookup(key, (void*&)pFontDesc);
- if (pFontDesc == NULL) {
- return NULL;
- }
- pFontData = pFontDesc->m_pFontData;
- pFontDesc->m_RefCount ++;
- int face_index = GetTTCIndex(pFontDesc->m_pFontData, ttc_size, font_offset);
- if (pFontDesc->m_TTCFace.m_pFaces[face_index] == NULL) {
- pFontDesc->m_TTCFace.m_pFaces[face_index] = GetFixedFace(pFontDesc->m_pFontData, ttc_size, face_index);
- }
- return pFontDesc->m_TTCFace.m_pFaces[face_index];
-}
-FXFT_Face CFX_FontMgr::AddCachedTTCFace(int ttc_size, FX_DWORD checksum,
- FX_LPBYTE pData, FX_DWORD size, int font_offset)
-{
- CFX_ByteString key;
- key.Format("%d:%d", ttc_size, checksum);
- CTTFontDesc* pFontDesc = FX_NEW CTTFontDesc;
- if (!pFontDesc) {
- return NULL;
- }
- pFontDesc->m_Type = 2;
- pFontDesc->m_pFontData = pData;
- for (int i = 0; i < 16; i ++) {
- pFontDesc->m_TTCFace.m_pFaces[i] = NULL;
- }
- pFontDesc->m_RefCount ++;
- key.Format("%d:%d", ttc_size, checksum);
- m_FaceMap.SetAt(key, pFontDesc);
- int face_index = GetTTCIndex(pFontDesc->m_pFontData, ttc_size, font_offset);
- pFontDesc->m_TTCFace.m_pFaces[face_index] = GetFixedFace(pFontDesc->m_pFontData, ttc_size, face_index);
- return pFontDesc->m_TTCFace.m_pFaces[face_index];
-}
-FXFT_Face CFX_FontMgr::GetFixedFace(FX_LPCBYTE pData, FX_DWORD size, int face_index)
-{
- FXFT_Library library;
- if (m_FTLibrary == NULL) {
- FXFT_Init_FreeType(&m_FTLibrary);
- }
- library = m_FTLibrary;
- FXFT_Face face = NULL;
- int ret = FXFT_New_Memory_Face(library, pData, size, face_index, &face);
- if (ret) {
- return NULL;
- }
- ret = FXFT_Set_Pixel_Sizes(face, 64, 64);
- if (ret) {
- return NULL;
- }
- return face;
-}
-FXFT_Face CFX_FontMgr::GetFileFace(FX_LPCSTR filename, int face_index)
-{
- FXFT_Library library;
- if (m_FTLibrary == NULL) {
- FXFT_Init_FreeType(&m_FTLibrary);
- }
- library = m_FTLibrary;
- FXFT_Face face = NULL;
- int ret = FXFT_New_Face(library, filename, face_index, &face);
- if (ret) {
- return NULL;
- }
- ret = FXFT_Set_Pixel_Sizes(face, 64, 64);
- if (ret) {
- return NULL;
- }
- return face;
-}
-void CFX_FontMgr::ReleaseFace(FXFT_Face face)
-{
- if (face == NULL) {
- return;
- }
- FX_POSITION pos = m_FaceMap.GetStartPosition();
- while(pos) {
- CFX_ByteString Key;
- CTTFontDesc* ttface;
- m_FaceMap.GetNextAssoc(pos, Key, (void*&)ttface);
- if (ttface->ReleaseFace(face)) {
- m_FaceMap.RemoveKey(Key);
- }
- }
-}
-extern "C" {
- extern const unsigned char g_FoxitFixedItalicFontData [18746];
- extern const unsigned char g_FoxitFixedFontData [17597];
- extern const unsigned char g_FoxitSansItalicFontData [16339];
- extern const unsigned char g_FoxitSansFontData [15025];
- extern const unsigned char g_FoxitSerifItalicFontData [21227];
- extern const unsigned char g_FoxitSerifFontData [19469];
- extern const unsigned char g_FoxitFixedBoldItalicFontData [19151];
- extern const unsigned char g_FoxitFixedBoldFontData [18055];
- extern const unsigned char g_FoxitSansBoldItalicFontData [16418];
- extern const unsigned char g_FoxitSansBoldFontData [16344];
- extern const unsigned char g_FoxitSerifBoldItalicFontData [20733];
- extern const unsigned char g_FoxitSerifBoldFontData [19395];
- extern const unsigned char g_FoxitSymbolFontData[16729];
- extern const unsigned char g_FoxitDingbatsFontData[29513];
- extern const unsigned char g_FoxitSerifMMFontData[113417];
- extern const unsigned char g_FoxitSansMMFontData[66919];
-};
-const FoxitFonts g_FoxitFonts[14] = {
- {g_FoxitFixedFontData, 17597},
- {g_FoxitFixedBoldFontData, 18055},
- {g_FoxitFixedBoldItalicFontData, 19151},
- {g_FoxitFixedItalicFontData, 18746},
- {g_FoxitSansFontData, 15025},
- {g_FoxitSansBoldFontData, 16344},
- {g_FoxitSansBoldItalicFontData, 16418},
- {g_FoxitSansItalicFontData, 16339},
- {g_FoxitSerifFontData, 19469},
- {g_FoxitSerifBoldFontData, 19395},
- {g_FoxitSerifBoldItalicFontData, 20733},
- {g_FoxitSerifItalicFontData, 21227},
- {g_FoxitSymbolFontData, 16729},
- {g_FoxitDingbatsFontData, 29513},
-};
-void _FPDFAPI_GetInternalFontData(int id, FX_LPCBYTE& data, FX_DWORD& size)
-{
- CFX_GEModule::Get()->GetFontMgr()->GetStandardFont(data, size, id);
-}
-FX_BOOL CFX_FontMgr::GetStandardFont(FX_LPCBYTE& pFontData, FX_DWORD& size, int index)
-{
- if (index > 15 || index < 0) {
- return FALSE;
- }
- {
- if (index >= 14) {
- if (index == 14) {
- pFontData = g_FoxitSerifMMFontData;
- size = 113417;
- } else {
- pFontData = g_FoxitSansMMFontData;
- size = 66919;
- }
- } else {
- pFontData = g_FoxitFonts[index].m_pFontData;
- size = g_FoxitFonts[index].m_dwSize;
- }
- }
- return TRUE;
-}
-CFX_FontMapper::CFX_FontMapper()
-{
- FXSYS_memset32(m_FoxitFaces, 0, sizeof m_FoxitFaces);
- m_MMFaces[0] = m_MMFaces[1] = NULL;
- m_pFontInfo = NULL;
- m_bListLoaded = FALSE;
- m_pFontEnumerator = NULL;
-}
-CFX_FontMapper::~CFX_FontMapper()
-{
- for (int i = 0; i < 14; i ++)
- if (m_FoxitFaces[i]) {
- FXFT_Done_Face(m_FoxitFaces[i]);
- }
- if (m_MMFaces[0]) {
- FXFT_Done_Face(m_MMFaces[0]);
- }
- if (m_MMFaces[1]) {
- FXFT_Done_Face(m_MMFaces[1]);
- }
- if (m_pFontInfo) {
- m_pFontInfo->Release();
- }
-}
-void CFX_FontMapper::SetSystemFontInfo(IFX_SystemFontInfo* pFontInfo)
-{
- if (pFontInfo == NULL) {
- return;
- }
- if (m_pFontInfo) {
- m_pFontInfo->Release();
- }
- m_pFontInfo = pFontInfo;
-}
-static CFX_ByteString _TT_NormalizeName(FX_LPCSTR family)
-{
- CFX_ByteString norm(family, -1);
- norm.Remove(' ');
- norm.Remove('-');
- norm.Remove(',');
- int pos = norm.Find('+');
- if (pos > 0) {
- norm = norm.Left(pos);
- }
- norm.MakeLower();
- return norm;
-}
-CFX_ByteString _FPDF_GetNameFromTT(FX_LPCBYTE name_table, FX_DWORD name_id)
-{
- FX_LPCBYTE ptr = name_table + 2;
- int name_count = GET_TT_SHORT(ptr);
- int string_offset = GET_TT_SHORT(ptr + 2);
- FX_LPCBYTE string_ptr = name_table + string_offset;
- ptr += 4;
- for (int i = 0; i < name_count; i ++) {
- if (GET_TT_SHORT(ptr + 6) == name_id && GET_TT_SHORT(ptr) == 1 && GET_TT_SHORT(ptr + 2) == 0) {
- return CFX_ByteStringC(string_ptr + GET_TT_SHORT(ptr + 10), GET_TT_SHORT(ptr + 8));
- }
- ptr += 12;
- }
- return CFX_ByteString();
-}
-static CFX_ByteString _FPDF_ReadStringFromFile(FXSYS_FILE* pFile, FX_DWORD size)
-{
- CFX_ByteString buffer;
- if (!FXSYS_fread(buffer.GetBuffer(size), size, 1, pFile)) {
- return CFX_ByteString();
- }
- buffer.ReleaseBuffer(size);
- return buffer;
-}
-static CFX_ByteString _FPDF_ReadStringFromStreamFile(IFX_FileStream* pFile, FX_DWORD size)
-{
- CFX_ByteString buffer;
- if (!pFile->ReadBlock(buffer.GetBuffer(size), size)) {
- return CFX_ByteString();
- }
- buffer.ReleaseBuffer(size);
- return buffer;
-}
-CFX_ByteString _FPDF_LoadTableFromTT(FXSYS_FILE* pFile, FX_LPCBYTE pTables, FX_DWORD nTables, FX_DWORD tag)
-{
- for (FX_DWORD i = 0; i < nTables; i ++) {
- FX_LPCBYTE p = pTables + i * 16;
- if (GET_TT_LONG(p) == tag) {
- FX_DWORD offset = GET_TT_LONG(p + 8);
- FX_DWORD size = GET_TT_LONG(p + 12);
- FXSYS_fseek(pFile, offset, FXSYS_SEEK_SET);
- return _FPDF_ReadStringFromFile(pFile, size);
- }
- }
- return CFX_ByteString();
-}
-CFX_ByteString _FPDF_LoadTableFromTTStreamFile(IFX_FileStream* pFile, FX_LPCBYTE pTables, FX_DWORD nTables, FX_DWORD tag)
-{
- for (FX_DWORD i = 0; i < nTables; i ++) {
- FX_LPCBYTE p = pTables + i * 16;
- if (GET_TT_LONG(p) == tag) {
- FX_DWORD offset = GET_TT_LONG(p + 8);
- FX_DWORD size = GET_TT_LONG(p + 12);
- CFX_ByteString buffer;
- if (!pFile->ReadBlock(buffer.GetBuffer(size), offset, size)) {
- return CFX_ByteString();
- }
- buffer.ReleaseBuffer(size);
- return buffer;
- }
- }
- return CFX_ByteString();
-}
-CFX_ByteString CFX_FontMapper::GetPSNameFromTT(void* hFont)
-{
- if (m_pFontInfo == NULL) {
- CFX_ByteString();
- }
- CFX_ByteString result;
- FX_DWORD size = m_pFontInfo->GetFontData(hFont, 0x6e616d65, NULL, 0);
- if (size) {
- FX_LPBYTE buffer = FX_Alloc(FX_BYTE, size);
- if (!buffer) {
- return result;
- }
- m_pFontInfo->GetFontData(hFont, 0x6e616d65, buffer, size);
- result = _FPDF_GetNameFromTT(buffer, 6);
- FX_Free(buffer);
- }
- return result;
-}
-void CFX_FontMapper::AddInstalledFont(const CFX_ByteString& name, int charset)
-{
- if (m_pFontInfo == NULL) {
- return;
- }
- if (m_CharsetArray.Find((FX_DWORD)charset) == -1) {
- m_CharsetArray.Add((FX_DWORD)charset);
- m_FaceArray.Add(name);
- }
- if (name == m_LastFamily) {
- return;
- }
- FX_LPCBYTE ptr = name;
- FX_BOOL bLocalized = FALSE;
- for (int i = 0; i < name.GetLength(); i ++)
- if (ptr[i] > 0x80) {
- bLocalized = TRUE;
- break;
- }
- if (bLocalized) {
- void* hFont = m_pFontInfo->GetFont(name);
- if (hFont == NULL) {
- FX_BOOL bExact;
- hFont = m_pFontInfo->MapFont(0, 0, FXFONT_DEFAULT_CHARSET, 0, name, bExact);
- if (hFont == NULL) {
- return;
- }
- }
- CFX_ByteString new_name = GetPSNameFromTT(hFont);
- if (!new_name.IsEmpty()) {
- new_name.Insert(0, ' ');
- m_InstalledTTFonts.Add(new_name);
- }
- m_pFontInfo->DeleteFont(hFont);
- }
- m_InstalledTTFonts.Add(name);
- m_LastFamily = name;
-}
-void CFX_FontMapper::LoadInstalledFonts()
-{
- if (m_pFontInfo == NULL) {
- return;
- }
- if (m_bListLoaded) {
- return;
- }
- if (m_bListLoaded) {
- return;
- }
- m_pFontInfo->EnumFontList(this);
- m_bListLoaded = TRUE;
-}
-CFX_ByteString CFX_FontMapper::MatchInstalledFonts(const CFX_ByteString& norm_name)
-{
- LoadInstalledFonts();
- int i;
- for (i = m_InstalledTTFonts.GetSize() - 1; i >= 0; i --) {
- CFX_ByteString norm1 = _TT_NormalizeName(m_InstalledTTFonts[i]);
- if (norm1 == norm_name) {
- break;
- }
- }
- if (i < 0) {
- return CFX_ByteString();
- }
- CFX_ByteString match = m_InstalledTTFonts[i];
- if (match[0] == ' ') {
- match = m_InstalledTTFonts[i + 1];
- }
- return match;
-}
-typedef struct _CHARSET_MAP_ {
- FX_BYTE charset;
- FX_WORD codepage;
-} CHARSET_MAP;
-static const CHARSET_MAP g_Codepage2CharsetTable[] = {
- { 1 , 0 },
- { 2 , 42 },
- { 254, 437 },
- { 255, 850 },
- { 222, 874 },
- { 128, 932 },
- { 134, 936 },
- { 129, 949 },
- { 136, 950 },
- { 238, 1250 },
- { 204, 1251 },
- { 0, 1252 },
- { 161, 1253 },
- { 162, 1254 },
- { 177, 1255 },
- { 178, 1256 },
- { 186, 1257 },
- { 163, 1258 },
- { 130, 1361 },
- { 77, 10000 },
- { 78, 10001 },
- { 79, 10003 },
- { 80, 10008 },
- { 81, 10002 },
- { 83, 10005 },
- { 84, 10004 },
- { 85, 10006 },
- { 86, 10081 },
- { 87, 10021 },
- { 88, 10029 },
- { 89, 10007 },
-};
-FX_BYTE _GetCharsetFromCodePage(FX_WORD codepage)
-{
- FX_INT32 iEnd = sizeof(g_Codepage2CharsetTable) / sizeof(CHARSET_MAP) - 1;
- FXSYS_assert(iEnd >= 0);
- FX_INT32 iStart = 0, iMid;
- do {
- iMid = (iStart + iEnd) / 2;
- const CHARSET_MAP & cp = g_Codepage2CharsetTable[iMid];
- if (codepage == cp.codepage) {
- return cp.charset;
- } else if (codepage < cp.codepage) {
- iEnd = iMid - 1;
- } else {
- iStart = iMid + 1;
- }
- } while (iStart <= iEnd);
- return 1;
-}
-FX_DWORD _GetCodePageRangeFromCharset(int charset)
-{
- if (charset == FXFONT_EASTEUROPE_CHARSET) {
- return 1 << 1;
- }
- if (charset == FXFONT_GREEK_CHARSET) {
- return 1 << 3;
- }
- if (charset == FXFONT_TURKISH_CHARSET) {
- return 1 << 4;
- }
- if (charset == FXFONT_HEBREW_CHARSET) {
- return 1 << 5;
- }
- if (charset == FXFONT_ARABIC_CHARSET) {
- return 1 << 6;
- }
- if (charset == FXFONT_BALTIC_CHARSET) {
- return 1 << 7;
- }
- if (charset == FXFONT_THAI_CHARSET) {
- return 1 << 16;
- }
- if (charset == FXFONT_SHIFTJIS_CHARSET) {
- return 1 << 17;
- }
- if (charset == FXFONT_GB2312_CHARSET) {
- return 1 << 18;
- }
- if (charset == FXFONT_CHINESEBIG5_CHARSET) {
- return 1 << 20;
- }
- if (charset == FXFONT_HANGEUL_CHARSET) {
- return 1 << 19;
- }
- if (charset == FXFONT_SYMBOL_CHARSET) {
- return 1 << 31;
- }
- return 1 << 21;
-}
-static int CP2CharSet(int cp)
-{
- if(cp == 932) {
- return FXFONT_SHIFTJIS_CHARSET;
- } else if(cp == 936) {
- return FXFONT_GB2312_CHARSET;
- } else if(cp == 949) {
- return FXFONT_HANGEUL_CHARSET;
- } else if(cp == 950) {
- return FXFONT_CHINESEBIG5_CHARSET;
- }
- return FXFONT_DEFAULT_CHARSET;
-}
-FXFT_Face CFX_FontMapper::UseInternalSubst(CFX_SubstFont* pSubstFont, int iBaseFont, int italic_angle, int weight, int picthfamily)
-{
- if (iBaseFont < 12) {
- if (m_FoxitFaces[iBaseFont]) {
- return m_FoxitFaces[iBaseFont];
- }
- FX_LPCBYTE pFontData = NULL;
- FX_DWORD size = 0;
- if (m_pFontMgr->GetStandardFont(pFontData, size, iBaseFont)) {
- m_FoxitFaces[iBaseFont] = m_pFontMgr->GetFixedFace(pFontData, size, 0);
- return m_FoxitFaces[iBaseFont];
- }
- }
- pSubstFont->m_SubstFlags |= FXFONT_SUBST_MM;
- pSubstFont->m_ItalicAngle = italic_angle;
- if (weight) {
- pSubstFont->m_Weight = weight;
- }
- if (picthfamily & FXFONT_FF_ROMAN) {
- pSubstFont->m_Weight = pSubstFont->m_Weight * 4 / 5;
- pSubstFont->m_Family = "Chrome Serif";
- if (m_MMFaces[1]) {
- return m_MMFaces[1];
- }
- FX_LPCBYTE pFontData = NULL;
- FX_DWORD size;
- m_pFontMgr->GetStandardFont(pFontData, size, 14);
- m_MMFaces[1] = m_pFontMgr->GetFixedFace(pFontData, size, 0);
- return m_MMFaces[1];
- }
- pSubstFont->m_Family = "Chrome Sans";
- if (m_MMFaces[0]) {
- return m_MMFaces[0];
- }
- FX_LPCBYTE pFontData = NULL;
- FX_DWORD size = 0;
- m_pFontMgr->GetStandardFont(pFontData, size, 15);
- m_MMFaces[0] = m_pFontMgr->GetFixedFace(pFontData, size, 0);
- return m_MMFaces[0];
-}
-const struct _AltFontFamily {
- FX_LPCSTR m_pFontName;
- FX_LPCSTR m_pFontFamily;
-}
-g_AltFontFamilies[] = {
- {"AGaramondPro", "Adobe Garamond Pro"},
- {"BankGothicBT-Medium", "BankGothic Md BT"},
- {"ForteMT", "Forte"},
-};
-extern "C" {
- static int compareFontFamilyString(const void* key, const void* element)
- {
- CFX_ByteString str_key((FX_LPCSTR)key);
- if (str_key.Find(((_AltFontFamily*)element)->m_pFontName) != -1) {
- return 0;
- }
- return FXSYS_stricmp((FX_LPCSTR)key, ((_AltFontFamily*)element)->m_pFontName);
- }
-}
-#define FX_FONT_STYLE_None 0x00
-#define FX_FONT_STYLE_Bold 0x01
-#define FX_FONT_STYLE_Italic 0x02
-#define FX_FONT_STYLE_BoldBold 0x04
-static CFX_ByteString _GetFontFamily(CFX_ByteString fontName, int nStyle)
-{
- if (fontName.Find("Script") >= 0) {
- if ((nStyle & FX_FONT_STYLE_Bold) == FX_FONT_STYLE_Bold) {
- fontName = "ScriptMTBold";
- } else if (fontName.Find("Palace") >= 0) {
- fontName = "PalaceScriptMT";
- } else if (fontName.Find("French") >= 0) {
- fontName = "FrenchScriptMT";
- } else if (fontName.Find("FreeStyle") >= 0) {
- fontName = "FreeStyleScript";
- }
- return fontName;
- }
- _AltFontFamily* found = (_AltFontFamily*)FXSYS_bsearch((FX_LPCSTR)fontName, g_AltFontFamilies,
- sizeof g_AltFontFamilies / sizeof (_AltFontFamily), sizeof (_AltFontFamily), compareFontFamilyString);
- if (found == NULL) {
- return fontName;
- }
- return found->m_pFontFamily;
-};
-typedef struct _FX_FontStyle {
- FX_LPCSTR style;
- FX_INT32 len;
-} FX_FontStyle;
-const FX_FontStyle g_FontStyles[] = {
- "Bold", 4,
- "Italic", 6,
- "BoldItalic", 10,
- "Reg", 3,
- "Regular", 7,
-};
-CFX_ByteString ParseStyle(FX_LPCSTR pStyle, int iLen, int iIndex)
-{
- CFX_ByteTextBuf buf;
- if (!iLen || iLen <= iIndex) {
- return buf.GetByteString();
- }
- while (iIndex < iLen) {
- if (pStyle[iIndex] == ',') {
- break;
- }
- buf.AppendChar(pStyle[iIndex]);
- ++iIndex;
- }
- return buf.GetByteString();
-}
-FX_INT32 GetStyleType(const CFX_ByteString &bsStyle, FX_BOOL bRevert)
-{
- FX_INT32 iLen = bsStyle.GetLength();
- if (!iLen) {
- return -1;
- }
- int iSize = sizeof(g_FontStyles) / sizeof(FX_FontStyle);
- const FX_FontStyle *pStyle = NULL;
- for (int i = iSize - 1; i >= 0; --i) {
- pStyle = g_FontStyles + i;
- if (!pStyle || pStyle->len > iLen) {
- continue;
- }
- if (!bRevert) {
- if (bsStyle.Left(pStyle->len).Compare(pStyle->style) == 0) {
- return i;
- }
- } else {
- if (bsStyle.Right(pStyle->len).Compare(pStyle->style) == 0) {
- return i;
- }
- }
- }
- return -1;
-}
-FX_BOOL CheckSupportThirdPartFont(CFX_ByteString name, int &PitchFamily)
-{
- if (name == FX_BSTRC("MyriadPro")) {
- PitchFamily &= ~FXFONT_FF_ROMAN;
- return TRUE;
- }
- return FALSE;
-}
-FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, FX_BOOL bTrueType, FX_DWORD flags,
- int weight, int italic_angle, int WindowCP, CFX_SubstFont* pSubstFont)
-{
- if (!(flags & FXFONT_USEEXTERNATTR)) {
- weight = FXFONT_FW_NORMAL;
- italic_angle = 0;
- }
- CFX_ByteString SubstName = name;
- SubstName.Remove(0x20);
- if (bTrueType) {
- if (name[0] == '@') {
- SubstName = name.Mid(1);
- }
- }
- _PDF_GetStandardFontName(SubstName);
- if (SubstName == FX_BSTRC("Symbol") && !bTrueType) {
- pSubstFont->m_Family = "Chrome Symbol";
- pSubstFont->m_Charset = FXFONT_SYMBOL_CHARSET;
- pSubstFont->m_SubstFlags |= FXFONT_SUBST_STANDARD;
- if (m_FoxitFaces[12]) {
- return m_FoxitFaces[12];
- }
- FX_LPCBYTE pFontData = NULL;
- FX_DWORD size = 0;
- m_pFontMgr->GetStandardFont(pFontData, size, 12);
- m_FoxitFaces[12] = m_pFontMgr->GetFixedFace(pFontData, size, 0);
- return m_FoxitFaces[12];
- }
- if (SubstName == FX_BSTRC("ZapfDingbats")) {
- pSubstFont->m_Family = "Chrome Dingbats";
- pSubstFont->m_Charset = FXFONT_SYMBOL_CHARSET;
- pSubstFont->m_SubstFlags |= FXFONT_SUBST_STANDARD;
- if (m_FoxitFaces[13]) {
- return m_FoxitFaces[13];
- }
- FX_LPCBYTE pFontData = NULL;
- FX_DWORD size = 0;
- m_pFontMgr->GetStandardFont(pFontData, size, 13);
- m_FoxitFaces[13] = m_pFontMgr->GetFixedFace(pFontData, size, 0);
- return m_FoxitFaces[13];
- }
- int iBaseFont = 0;
- CFX_ByteString family, style;
- FX_BOOL bHasComma = FALSE;
- FX_BOOL bHasHypen = FALSE;
- int find = SubstName.Find(FX_BSTRC(","), 0);
- if (find >= 0) {
- family = SubstName.Left(find);
- _PDF_GetStandardFontName(family);
- style = SubstName.Mid(find + 1);
- bHasComma = TRUE;
- } else {
- family = SubstName;
- }
- for (; iBaseFont < 12; iBaseFont ++)
- if (family == CFX_ByteStringC(g_Base14FontNames[iBaseFont])) {
- break;
- }
- int PitchFamily = 0;
- FX_BOOL bItalic = FALSE;
- FX_DWORD nStyle = 0;
- FX_BOOL bStyleAvail = FALSE;
- FX_BOOL bFamilyStyleIsWhole = FALSE;
- FX_BOOL bNextF = FALSE;
- if (iBaseFont < 12) {
- family = g_Base14FontNames[iBaseFont];
- if ((iBaseFont % 4) == 1 || (iBaseFont % 4) == 2) {
- nStyle |= FX_FONT_STYLE_Bold;
- }
- if ((iBaseFont % 4) / 2) {
- nStyle |= FX_FONT_STYLE_Italic;
- }
- if (iBaseFont < 4) {
- PitchFamily |= FXFONT_FF_FIXEDPITCH;
- }
- if (iBaseFont >= 8) {
- PitchFamily |= FXFONT_FF_ROMAN;
- }
- } else {
- if (!bHasComma) {
- find = family.ReverseFind('-');
- if (find >= 0) {
- style = family.Mid(find + 1);
- family = family.Left(find);
- bHasHypen = TRUE;
- }
- }
- if (!bHasHypen) {
- int nLen = family.GetLength();
- FX_INT32 nRet = GetStyleType(family, TRUE);
- if (nRet > -1) {
- family = family.Left(nLen - g_FontStyles[nRet].len);
- if (nRet == 0) {
- nStyle |= FX_FONT_STYLE_Bold;
- }
- if (nRet == 1) {
- nStyle |= FX_FONT_STYLE_Italic;
- }
- if (nRet == 2) {
- nStyle |= (FX_FONT_STYLE_Bold | FX_FONT_STYLE_Italic);
- }
- }
- }
- if (flags & FXFONT_SERIF) {
- PitchFamily |= FXFONT_FF_ROMAN;
- }
- if (flags & FXFONT_SCRIPT) {
- PitchFamily |= FXFONT_FF_SCRIPT;
- }
- if (flags & FXFONT_FIXED_PITCH) {
- PitchFamily |= FXFONT_FF_FIXEDPITCH;
- }
- }
- if (!style.IsEmpty()) {
- int nLen = style.GetLength();
- FX_LPCSTR pStyle = style;
- int i = 0;
- FX_BOOL bFirstItem = TRUE;
- CFX_ByteString buf;
- while (i < nLen) {
- buf = ParseStyle(pStyle, nLen, i);
- FX_INT32 nRet = GetStyleType(buf, FALSE);
- if ((i && !bStyleAvail) || (!i && nRet < 0)) {
- family = SubstName;
- iBaseFont = 12;
- break;
- } else if (nRet >= 0) {
- bStyleAvail = TRUE;
- }
- if (nRet == 0) {
- if (nStyle & FX_FONT_STYLE_Bold) {
- nStyle |= FX_FONT_STYLE_BoldBold;
- } else {
- nStyle |= FX_FONT_STYLE_Bold;
- }
- bFirstItem = FALSE;
- }
- if (nRet == 1) {
- if (bFirstItem) {
- nStyle |= FX_FONT_STYLE_Italic;
- } else {
- family = SubstName;
- iBaseFont = 12;
- }
- break;
- }
- if (nRet == 2) {
- nStyle |= FX_FONT_STYLE_Italic;
- if (nStyle & FX_FONT_STYLE_Bold) {
- nStyle |= FX_FONT_STYLE_BoldBold;
- } else {
- nStyle |= FX_FONT_STYLE_Bold;
- }
- bFirstItem = FALSE;
- }
- i += buf.GetLength() + 1;
- }
- }
- weight = weight ? weight : FXFONT_FW_NORMAL;
- int old_weight = weight;
- if (nStyle) {
- weight = nStyle & FX_FONT_STYLE_BoldBold ? 900 : (nStyle & FX_FONT_STYLE_Bold ? FXFONT_FW_BOLD : FXFONT_FW_NORMAL);
- }
- if (nStyle & FX_FONT_STYLE_Italic) {
- bItalic = TRUE;
- }
- FX_BOOL bCJK = FALSE;
- FX_BOOL bExact = FALSE;
- int Charset = FXFONT_ANSI_CHARSET;
- if (WindowCP) {
- Charset = _GetCharsetFromCodePage(WindowCP);
- } else if (iBaseFont == 12 && (flags & FXFONT_SYMBOLIC)) {
- Charset = FXFONT_SYMBOL_CHARSET;
- }
- if (Charset == FXFONT_SHIFTJIS_CHARSET || Charset == FXFONT_GB2312_CHARSET ||
- Charset == FXFONT_HANGEUL_CHARSET || Charset == FXFONT_CHINESEBIG5_CHARSET) {
- bCJK = TRUE;
- }
- if (m_pFontInfo == NULL) {
- pSubstFont->m_SubstFlags |= FXFONT_SUBST_STANDARD;
- return UseInternalSubst(pSubstFont, iBaseFont, italic_angle, old_weight, PitchFamily);
- }
- family = _GetFontFamily(family, nStyle);
- CFX_ByteString match = MatchInstalledFonts(_TT_NormalizeName(family));
- if (match.IsEmpty() && family != SubstName && (!bHasComma && (!bHasHypen || (bHasHypen && !bStyleAvail)))) {
- match = MatchInstalledFonts(_TT_NormalizeName(SubstName));
- }
- if (match.IsEmpty() && iBaseFont >= 12) {
- if (!bCJK) {
- if (!CheckSupportThirdPartFont(family, PitchFamily)) {
- if (italic_angle != 0) {
- bItalic = TRUE;
- } else {
- bItalic = FALSE;
- }
- weight = old_weight;
- }
- } else {
- pSubstFont->m_bSubstOfCJK = TRUE;
- if (nStyle) {
- pSubstFont->m_WeightCJK = weight;
- } else {
- pSubstFont->m_WeightCJK = FXFONT_FW_NORMAL;
- }
- if (nStyle & FX_FONT_STYLE_Italic) {
- pSubstFont->m_bItlicCJK = TRUE;
- }
- }
- } else {
- italic_angle = 0;
- weight = nStyle & FX_FONT_STYLE_BoldBold ? 900 : (nStyle & FX_FONT_STYLE_Bold ? FXFONT_FW_BOLD : FXFONT_FW_NORMAL);
- }
- if (!match.IsEmpty() || iBaseFont < 12) {
- pSubstFont->m_SubstFlags |= FXFONT_SUBST_EXACT;
- if (!match.IsEmpty()) {
- family = match;
- }
- if (iBaseFont < 12) {
- if (nStyle && !(iBaseFont % 4)) {
- if ((nStyle & 0x3) == 1) {
- iBaseFont += 1;
- }
- if ((nStyle & 0x3) == 2) {
- iBaseFont += 3;
- }
- if ((nStyle & 0x3) == 3) {
- iBaseFont += 2;
- }
- }
- if (m_pFontMgr->m_ExternalFonts[iBaseFont].m_pFontData) {
- if (m_FoxitFaces[iBaseFont]) {
- return m_FoxitFaces[iBaseFont];
- }
- m_FoxitFaces[iBaseFont] = m_pFontMgr->GetFixedFace(m_pFontMgr->m_ExternalFonts[iBaseFont].m_pFontData,
- m_pFontMgr->m_ExternalFonts[iBaseFont].m_dwSize, 0);
- if (m_FoxitFaces[iBaseFont]) {
- return m_FoxitFaces[iBaseFont];
- }
- } else {
- family = g_Base14FontNames[iBaseFont];
- }
- pSubstFont->m_SubstFlags |= FXFONT_SUBST_STANDARD;
- }
- } else {
- if (flags & FXFONT_ITALIC) {
- bItalic = TRUE;
- }
- }
- bExact = !match.IsEmpty();
- void* hFont = m_pFontInfo->MapFont(weight, bItalic, Charset, PitchFamily, family, bExact);
- if (bExact) {
- pSubstFont->m_SubstFlags |= FXFONT_SUBST_EXACT;
- }
- if (hFont == NULL) {
- if (bCJK) {
- if (italic_angle != 0) {
- bItalic = TRUE;
- } else {
- bItalic = FALSE;
- }
- weight = old_weight;
- }
- if (!match.IsEmpty()) {
- hFont = m_pFontInfo->GetFont(match);
- if (hFont == NULL) {
- return UseInternalSubst(pSubstFont, iBaseFont, italic_angle, old_weight, PitchFamily);
- }
- } else {
- if (Charset == FXFONT_SYMBOL_CHARSET) {
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ || _FXM_PLATFORM_ == _FXM_PLATFORM_ANDROID_
- if (SubstName == FX_BSTRC("Symbol")) {
- pSubstFont->m_Family = "Chrome Symbol";
- pSubstFont->m_SubstFlags |= FXFONT_SUBST_STANDARD;
- pSubstFont->m_Charset = FXFONT_SYMBOL_CHARSET;
- if (m_FoxitFaces[12]) {
- return m_FoxitFaces[12];
- }
- FX_LPCBYTE pFontData = NULL;
- FX_DWORD size = 0;
- m_pFontMgr->GetStandardFont(pFontData, size, 12);
- m_FoxitFaces[12] = m_pFontMgr->GetFixedFace(pFontData, size, 0);
- return m_FoxitFaces[12];
- } else {
- pSubstFont->m_SubstFlags |= FXFONT_SUBST_NONSYMBOL;
- return FindSubstFont(family, bTrueType, flags & ~FXFONT_SYMBOLIC, weight, italic_angle, 0, pSubstFont);
- }
-#else
- pSubstFont->m_SubstFlags |= FXFONT_SUBST_NONSYMBOL;
- return FindSubstFont(family, bTrueType, flags & ~FXFONT_SYMBOLIC, weight, italic_angle, 0, pSubstFont);
-#endif
- }
- if (Charset == FXFONT_ANSI_CHARSET) {
- pSubstFont->m_SubstFlags |= FXFONT_SUBST_STANDARD;
- return UseInternalSubst(pSubstFont, iBaseFont, italic_angle, old_weight, PitchFamily);
- }
- int index = m_CharsetArray.Find(Charset);
- if (index < 0) {
- return UseInternalSubst(pSubstFont, iBaseFont, italic_angle, old_weight, PitchFamily);
- } else {
- hFont = m_pFontInfo->GetFont(m_FaceArray[index]);
- }
- }
- }
- pSubstFont->m_ExtHandle = m_pFontInfo->RetainFont(hFont);
- if (hFont == NULL) {
- return NULL;
- }
- m_pFontInfo->GetFaceName(hFont, SubstName);
- if (Charset == FXFONT_DEFAULT_CHARSET) {
- m_pFontInfo->GetFontCharset(hFont, Charset);
- }
- FX_DWORD ttc_size = m_pFontInfo->GetFontData(hFont, 0x74746366, NULL, 0);
- FX_DWORD font_size = m_pFontInfo->GetFontData(hFont, 0, NULL, 0);
- if(font_size == 0 && ttc_size == 0) {
- m_pFontInfo->DeleteFont(hFont);
- return NULL;
- }
- FXFT_Face face = NULL;
- if (ttc_size) {
- FX_BYTE temp[1024];
- m_pFontInfo->GetFontData(hFont, 0x74746366, temp, 1024);
- FX_DWORD checksum = 0;
- for (int i = 0; i < 256; i ++) {
- checksum += ((FX_DWORD*)temp)[i];
- }
- FX_LPBYTE pFontData;
- face = m_pFontMgr->GetCachedTTCFace(ttc_size, checksum, ttc_size - font_size, pFontData);
- if (face == NULL) {
- pFontData = FX_Alloc(FX_BYTE, ttc_size);
- if (pFontData) {
- m_pFontInfo->GetFontData(hFont, 0x74746366, pFontData, ttc_size);
- face = m_pFontMgr->AddCachedTTCFace(ttc_size, checksum, pFontData, ttc_size,
- ttc_size - font_size);
- }
- }
- } else {
- FX_LPBYTE pFontData;
- face = m_pFontMgr->GetCachedFace(SubstName, weight, bItalic, pFontData);
- if (face == NULL) {
- pFontData = FX_Alloc(FX_BYTE, font_size);
- if (!pFontData) {
- m_pFontInfo->DeleteFont(hFont);
- return NULL;
- }
- m_pFontInfo->GetFontData(hFont, 0, pFontData, font_size);
- face = m_pFontMgr->AddCachedFace(SubstName, weight, bItalic, pFontData, font_size, m_pFontInfo->GetFaceIndex(hFont));
- }
- }
- if (face == NULL) {
- m_pFontInfo->DeleteFont(hFont);
- return NULL;
- }
- pSubstFont->m_Family = SubstName;
- pSubstFont->m_Charset = Charset;
- FX_BOOL bNeedUpdateWeight = FALSE;
- if (FXFT_Is_Face_Bold(face)) {
- if (weight == FXFONT_FW_BOLD) {
- bNeedUpdateWeight = FALSE;
- } else {
- bNeedUpdateWeight = TRUE;
- }
- } else {
- if (weight == FXFONT_FW_NORMAL) {
- bNeedUpdateWeight = FALSE;
- } else {
- bNeedUpdateWeight = TRUE;
- }
- }
- if (bNeedUpdateWeight) {
- pSubstFont->m_Weight = weight;
- }
- if (bItalic && !FXFT_Is_Face_Italic(face)) {
- if (italic_angle == 0) {
- italic_angle = -12;
- } else if (FXSYS_abs(italic_angle) < 5) {
- italic_angle = 0;
- }
- pSubstFont->m_ItalicAngle = italic_angle;
- }
- m_pFontInfo->DeleteFont(hFont);
- return face;
-}
-extern "C" {
- unsigned long _FTStreamRead(FXFT_Stream stream, unsigned long offset,
- unsigned char* buffer, unsigned long count);
- void _FTStreamClose(FXFT_Stream stream);
-};
-CFontFileFaceInfo::CFontFileFaceInfo()
-{
- m_pFile = NULL;
- m_Face = NULL;
- m_Charsets = 0;
- m_FileSize = 0;
- m_FontOffset = 0;
- m_Weight = 0;
- m_bItalic = FALSE;
- m_PitchFamily = 0;
-}
-CFontFileFaceInfo::~CFontFileFaceInfo()
-{
- if (m_Face) {
- FXFT_Done_Face(m_Face);
- }
- m_Face = NULL;
-}
-extern FX_BOOL _LoadFile(FXFT_Library library, FXFT_Face* Face, IFX_FileRead* pFile, FXFT_Stream* stream);
-#if defined(_FPDFAPI_MINI_) || _FX_OS_ == _FX_ANDROID_
-IFX_SystemFontInfo* IFX_SystemFontInfo::CreateDefault()
-{
- return NULL;
-}
-#endif
-#if !defined(_FPDFAPI_MINI_)
-CFX_FolderFontInfo::CFX_FolderFontInfo()
-{
-}
-CFX_FolderFontInfo::~CFX_FolderFontInfo()
-{
- FX_POSITION pos = m_FontList.GetStartPosition();
- while (pos) {
- CFX_ByteString key;
- FX_LPVOID value;
- m_FontList.GetNextAssoc(pos, key, value);
- delete (CFontFaceInfo*)value;
- }
-}
-void CFX_FolderFontInfo::AddPath(FX_BSTR path)
-{
- m_PathList.Add(path);
-}
-void CFX_FolderFontInfo::Release()
-{
- delete this;
-}
-FX_BOOL CFX_FolderFontInfo::EnumFontList(CFX_FontMapper* pMapper)
-{
- m_pMapper = pMapper;
- for (int i = 0; i < m_PathList.GetSize(); i ++) {
- ScanPath(m_PathList[i]);
- }
- return TRUE;
-}
-void CFX_FolderFontInfo::ScanPath(CFX_ByteString& path)
-{
- void* handle = FX_OpenFolder(path);
- if (handle == NULL) {
- return;
- }
- CFX_ByteString filename;
- FX_BOOL bFolder;
- while (FX_GetNextFile(handle, filename, bFolder)) {
- if (bFolder) {
- if (filename == "." || filename == "..") {
- continue;
- }
- } else {
- CFX_ByteString ext = filename.Right(4);
- ext.MakeUpper();
- if (ext != ".TTF" && ext != ".OTF" && ext != ".TTC") {
- continue;
- }
- }
- CFX_ByteString fullpath = path;
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
- fullpath += "\\";
-#else
- fullpath += "/";
-#endif
- fullpath += filename;
- if (bFolder) {
- ScanPath(fullpath);
- } else {
- ScanFile(fullpath);
- }
- }
- FX_CloseFolder(handle);
-}
-void CFX_FolderFontInfo::ScanFile(CFX_ByteString& path)
-{
- FXSYS_FILE* pFile = FXSYS_fopen(path, "rb");
- if (pFile == NULL) {
- return;
- }
- FXSYS_fseek(pFile, 0, FXSYS_SEEK_END);
- FX_DWORD filesize = FXSYS_ftell(pFile);
- FX_BYTE buffer[16];
- FXSYS_fseek(pFile, 0, FXSYS_SEEK_SET);
- size_t readCnt = FXSYS_fread(buffer, 12, 1, pFile);
- if (GET_TT_LONG(buffer) == 0x74746366) {
- FX_DWORD nFaces = GET_TT_LONG(buffer + 8);
- FX_LPBYTE offsets = FX_Alloc(FX_BYTE, nFaces * 4);
- if (!offsets) {
- FXSYS_fclose(pFile);
- return;
- }
- readCnt = FXSYS_fread(offsets, nFaces * 4, 1, pFile);
- for (FX_DWORD i = 0; i < nFaces; i ++) {
- FX_LPBYTE p = offsets + i * 4;
- ReportFace(path, pFile, filesize, GET_TT_LONG(p));
- }
- FX_Free(offsets);
- } else {
- ReportFace(path, pFile, filesize, 0);
- }
- FXSYS_fclose(pFile);
-}
-void CFX_FolderFontInfo::ReportFace(CFX_ByteString& path, FXSYS_FILE* pFile, FX_DWORD filesize, FX_DWORD offset)
-{
- FXSYS_fseek(pFile, offset, FXSYS_SEEK_SET);
- char buffer[16];
- if (!FXSYS_fread(buffer, 12, 1, pFile)) {
- return;
- }
- FX_DWORD nTables = GET_TT_SHORT(buffer + 4);
- CFX_ByteString tables = _FPDF_ReadStringFromFile(pFile, nTables * 16);
- CFX_ByteString names = _FPDF_LoadTableFromTT(pFile, tables, nTables, 0x6e616d65);
- CFX_ByteString facename = _FPDF_GetNameFromTT(names, 1);
- CFX_ByteString style = _FPDF_GetNameFromTT(names, 2);
- if (style != "Regular") {
- facename += " " + style;
- }
- FX_LPVOID p;
- if (m_FontList.Lookup(facename, p)) {
- return;
- }
- CFontFaceInfo* pInfo = FX_NEW CFontFaceInfo;
- if (!pInfo) {
- return;
- }
- pInfo->m_FilePath = path;
- pInfo->m_FaceName = facename;
- pInfo->m_FontTables = tables;
- pInfo->m_FontOffset = offset;
- pInfo->m_FileSize = filesize;
- pInfo->m_Charsets = 0;
- CFX_ByteString os2 = _FPDF_LoadTableFromTT(pFile, tables, nTables, 0x4f532f32);
- if (os2.GetLength() >= 86) {
- FX_LPCBYTE p = (FX_LPCBYTE)os2 + 78;
- FX_DWORD codepages = GET_TT_LONG(p);
- if (codepages & (1 << 17)) {
- m_pMapper->AddInstalledFont(facename, FXFONT_SHIFTJIS_CHARSET);
- pInfo->m_Charsets |= CHARSET_FLAG_SHIFTJIS;
- }
- if (codepages & (1 << 18)) {
- m_pMapper->AddInstalledFont(facename, FXFONT_GB2312_CHARSET);
- pInfo->m_Charsets |= CHARSET_FLAG_GB;
- }
- if (codepages & (1 << 20)) {
- m_pMapper->AddInstalledFont(facename, FXFONT_CHINESEBIG5_CHARSET);
- pInfo->m_Charsets |= CHARSET_FLAG_BIG5;
- }
- if ((codepages & (1 << 19)) || (codepages & (1 << 21))) {
- m_pMapper->AddInstalledFont(facename, FXFONT_HANGEUL_CHARSET);
- pInfo->m_Charsets |= CHARSET_FLAG_KOREAN;
- }
- if (codepages & (1 << 31)) {
- m_pMapper->AddInstalledFont(facename, FXFONT_SYMBOL_CHARSET);
- pInfo->m_Charsets |= CHARSET_FLAG_SYMBOL;
- }
- }
- m_pMapper->AddInstalledFont(facename, FXFONT_ANSI_CHARSET);
- pInfo->m_Charsets |= CHARSET_FLAG_ANSI;
- pInfo->m_Styles = 0;
- if (style.Find(FX_BSTRC("Bold")) > -1) {
- pInfo->m_Styles |= FXFONT_BOLD;
- }
- if (style.Find(FX_BSTRC("Italic")) > -1 || style.Find(FX_BSTRC("Oblique")) > -1) {
- pInfo->m_Styles |= FXFONT_ITALIC;
- }
- if (facename.Find(FX_BSTRC("Serif")) > -1) {
- pInfo->m_Styles |= FXFONT_SERIF;
- }
- m_FontList.SetAt(facename, pInfo);
-}
-void* CFX_FolderFontInfo::MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, FX_LPCSTR family, FX_BOOL& bExact)
-{
- return NULL;
-}
-void* CFX_FolderFontInfo::GetFont(FX_LPCSTR face)
-{
- FX_LPVOID p;
- if (!m_FontList.Lookup(face, p)) {
- return NULL;
- }
- return p;
-}
-FX_DWORD CFX_FolderFontInfo::GetFontData(void* hFont, FX_DWORD table, FX_LPBYTE buffer, FX_DWORD size)
-{
- if (hFont == NULL) {
- return 0;
- }
- CFontFaceInfo* pFont = (CFontFaceInfo*)hFont;
- FXSYS_FILE* pFile = NULL;
- if (size > 0) {
- pFile = FXSYS_fopen(pFont->m_FilePath, "rb");
- if (pFile == NULL) {
- return 0;
- }
- }
- FX_DWORD datasize = 0;
- FX_DWORD offset;
- if (table == 0) {
- datasize = pFont->m_FontOffset ? 0 : pFont->m_FileSize;
- offset = 0;
- } else if (table == 0x74746366) {
- datasize = pFont->m_FontOffset ? pFont->m_FileSize : 0;
- offset = 0;
- } else {
- FX_DWORD nTables = pFont->m_FontTables.GetLength() / 16;
- for (FX_DWORD i = 0; i < nTables; i ++) {
- FX_LPCBYTE p = (FX_LPCBYTE)pFont->m_FontTables + i * 16;
- if (GET_TT_LONG(p) == table) {
- offset = GET_TT_LONG(p + 8);
- datasize = GET_TT_LONG(p + 12);
- }
- }
- }
- if (datasize && size >= datasize && pFile) {
- FXSYS_fseek(pFile, offset, FXSYS_SEEK_SET);
- size_t readCnt = FXSYS_fread(buffer, datasize, 1, pFile);
- }
- if (pFile) {
- FXSYS_fclose(pFile);
- }
- return datasize;
-}
-void CFX_FolderFontInfo::DeleteFont(void* hFont)
-{
-}
-FX_BOOL CFX_FolderFontInfo::GetFaceName(void* hFont, CFX_ByteString& name)
-{
- if (hFont == NULL) {
- return FALSE;
- }
- CFontFaceInfo* pFont = (CFontFaceInfo*)hFont;
- name = pFont->m_FaceName;
- return TRUE;
-}
-FX_BOOL CFX_FolderFontInfo::GetFontCharset(void* hFont, int& charset)
-{
- return FALSE;
-}
-#endif
+// 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
+
+#include "../../../include/fxge/fx_ge.h"
+#include "../../../include/fxge/fx_freetype.h"
+#include "text_int.h"
+#define GET_TT_SHORT(w) (FX_WORD)(((w)[0] << 8) | (w)[1])
+#define GET_TT_LONG(w) (FX_DWORD)(((w)[0] << 24) | ((w)[1] << 16) | ((w)[2] << 8) | (w)[3])
+CFX_SubstFont::CFX_SubstFont()
+{
+ m_ExtHandle = NULL;
+ m_Charset = 0;
+ m_SubstFlags = 0;
+ m_Weight = 0;
+ m_ItalicAngle = 0;
+ m_bSubstOfCJK = FALSE;
+ m_WeightCJK = 0;
+ m_bItlicCJK = FALSE;
+}
+CTTFontDesc::~CTTFontDesc()
+{
+ if (m_Type == 1) {
+ if (m_SingleFace.m_pFace) {
+ FXFT_Done_Face(m_SingleFace.m_pFace);
+ }
+ } else if (m_Type == 2) {
+ for (int i = 0; i < 16; i ++)
+ if (m_TTCFace.m_pFaces[i]) {
+ FXFT_Done_Face(m_TTCFace.m_pFaces[i]);
+ }
+ }
+ if (m_pFontData) {
+ FX_Free(m_pFontData);
+ }
+}
+FX_BOOL CTTFontDesc::ReleaseFace(FXFT_Face face)
+{
+ if (m_Type == 1) {
+ if (m_SingleFace.m_pFace != face) {
+ return FALSE;
+ }
+ } else if (m_Type == 2) {
+ int i;
+ for (i = 0; i < 16; i ++)
+ if (m_TTCFace.m_pFaces[i] == face) {
+ break;
+ }
+ if (i == 16) {
+ return FALSE;
+ }
+ }
+ m_RefCount --;
+ if (m_RefCount) {
+ return FALSE;
+ }
+ delete this;
+ return TRUE;
+}
+CFX_FontMgr::CFX_FontMgr()
+{
+ m_pBuiltinMapper = FX_NEW CFX_FontMapper;
+ if (!m_pBuiltinMapper) {
+ return;
+ }
+ m_pBuiltinMapper->m_pFontMgr = this;
+ m_pExtMapper = NULL;
+ m_FTLibrary = NULL;
+ FXSYS_memset32(m_ExternalFonts, 0, sizeof m_ExternalFonts);
+}
+CFX_FontMgr::~CFX_FontMgr()
+{
+ if (m_pBuiltinMapper) {
+ delete m_pBuiltinMapper;
+ }
+ FreeCache();
+ if (m_FTLibrary) {
+ FXFT_Done_FreeType(m_FTLibrary);
+ }
+}
+void CFX_FontMgr::InitFTLibrary()
+{
+ if (m_FTLibrary == NULL) {
+ FXFT_Init_FreeType(&m_FTLibrary);
+ }
+}
+void CFX_FontMgr::FreeCache()
+{
+ FX_POSITION pos = m_FaceMap.GetStartPosition();
+ while(pos) {
+ CFX_ByteString Key;
+ CTTFontDesc* face;
+ m_FaceMap.GetNextAssoc(pos, Key, (void*&)face);
+ delete face;
+ }
+ m_FaceMap.RemoveAll();
+}
+void CFX_FontMgr::SetSystemFontInfo(IFX_SystemFontInfo* pFontInfo)
+{
+ m_pBuiltinMapper->SetSystemFontInfo(pFontInfo);
+}
+FXFT_Face CFX_FontMgr::FindSubstFont(const CFX_ByteString& face_name, FX_BOOL bTrueType,
+ FX_DWORD flags, int weight, int italic_angle, int CharsetCP, CFX_SubstFont* pSubstFont)
+{
+ if (m_FTLibrary == NULL) {
+ FXFT_Init_FreeType(&m_FTLibrary);
+ }
+ if (m_pExtMapper) {
+ FXFT_Face face = m_pExtMapper->FindSubstFont(face_name, bTrueType, flags, weight, italic_angle,
+ CharsetCP, pSubstFont);
+ if (face) {
+ return face;
+ }
+ }
+ return m_pBuiltinMapper->FindSubstFont(face_name, bTrueType, flags, weight, italic_angle,
+ CharsetCP, pSubstFont);
+}
+FXFT_Face CFX_FontMgr::GetCachedFace(const CFX_ByteString& face_name,
+ int weight, FX_BOOL bItalic, FX_LPBYTE& pFontData)
+{
+ CFX_ByteString key(face_name);
+ key += ',';
+ key += CFX_ByteString::FormatInteger(weight);
+ key += bItalic ? 'I' : 'N';
+ CTTFontDesc* pFontDesc = NULL;
+ m_FaceMap.Lookup(key, (void*&)pFontDesc);
+ if(pFontDesc) {
+ pFontData = pFontDesc->m_pFontData;
+ pFontDesc->m_RefCount ++;
+ return pFontDesc->m_SingleFace.m_pFace;
+ }
+ return NULL;
+}
+FXFT_Face CFX_FontMgr::AddCachedFace(const CFX_ByteString& face_name,
+ int weight, FX_BOOL bItalic, FX_LPBYTE pData, FX_DWORD size, int face_index)
+{
+ CTTFontDesc* pFontDesc = FX_NEW CTTFontDesc;
+ if (!pFontDesc) {
+ return NULL;
+ }
+ pFontDesc->m_Type = 1;
+ pFontDesc->m_SingleFace.m_pFace = NULL;
+ pFontDesc->m_SingleFace.m_bBold = weight;
+ pFontDesc->m_SingleFace.m_bItalic = bItalic;
+ pFontDesc->m_pFontData = pData;
+ pFontDesc->m_RefCount = 1;
+ FXFT_Library library;
+ if (m_FTLibrary == NULL) {
+ FXFT_Init_FreeType(&m_FTLibrary);
+ }
+ library = m_FTLibrary;
+ int ret = FXFT_New_Memory_Face(library, pData, size, face_index, &pFontDesc->m_SingleFace.m_pFace);
+ if (ret) {
+ delete pFontDesc;
+ return NULL;
+ }
+ ret = FXFT_Set_Pixel_Sizes(pFontDesc->m_SingleFace.m_pFace, 64, 64);
+ if (ret) {
+ delete pFontDesc;
+ return NULL;
+ }
+ CFX_ByteString key(face_name);
+ key += ',';
+ key += CFX_ByteString::FormatInteger(weight);
+ key += bItalic ? 'I' : 'N';
+ m_FaceMap.SetAt(key, pFontDesc);
+ return pFontDesc->m_SingleFace.m_pFace;
+}
+const FX_LPCSTR g_Base14FontNames[14] = {
+ "Courier",
+ "Courier-Bold",
+ "Courier-BoldOblique",
+ "Courier-Oblique",
+ "Helvetica",
+ "Helvetica-Bold",
+ "Helvetica-BoldOblique",
+ "Helvetica-Oblique",
+ "Times-Roman",
+ "Times-Bold",
+ "Times-BoldItalic",
+ "Times-Italic",
+ "Symbol",
+ "ZapfDingbats",
+};
+const struct _AltFontName {
+ const FX_CHAR* m_pName;
+ int m_Index;
+}
+g_AltFontNames[] = {
+ {"Arial", 4},
+ {"Arial,Bold", 5},
+ {"Arial,BoldItalic", 6},
+ {"Arial,Italic", 7},
+ {"Arial-Bold", 5},
+ {"Arial-BoldItalic", 6},
+ {"Arial-BoldItalicMT", 6},
+ {"Arial-BoldMT", 5},
+ {"Arial-Italic", 7},
+ {"Arial-ItalicMT", 7},
+ {"ArialBold", 5},
+ {"ArialBoldItalic", 6},
+ {"ArialItalic", 7},
+ {"ArialMT", 4},
+ {"ArialMT,Bold", 5},
+ {"ArialMT,BoldItalic", 6},
+ {"ArialMT,Italic", 7},
+ {"ArialRoundedMTBold", 5},
+ {"Courier", 0},
+ {"Courier,Bold", 1},
+ {"Courier,BoldItalic", 2},
+ {"Courier,Italic", 3},
+ {"Courier-Bold", 1},
+ {"Courier-BoldOblique", 2},
+ {"Courier-Oblique", 3},
+ {"CourierBold", 1},
+ {"CourierBoldItalic", 2},
+ {"CourierItalic", 3},
+ {"CourierNew", 0},
+ {"CourierNew,Bold", 1},
+ {"CourierNew,BoldItalic", 2},
+ {"CourierNew,Italic", 3},
+ {"CourierNew-Bold", 1},
+ {"CourierNew-BoldItalic", 2},
+ {"CourierNew-Italic", 3},
+ {"CourierNewBold", 1},
+ {"CourierNewBoldItalic", 2},
+ {"CourierNewItalic", 3},
+ {"CourierNewPS-BoldItalicMT", 2},
+ {"CourierNewPS-BoldMT", 1},
+ {"CourierNewPS-ItalicMT", 3},
+ {"CourierNewPSMT", 0},
+ {"CourierStd", 0},
+ {"CourierStd-Bold", 1},
+ {"CourierStd-BoldOblique", 2},
+ {"CourierStd-Oblique", 3},
+ {"Helvetica", 4},
+ {"Helvetica,Bold", 5},
+ {"Helvetica,BoldItalic", 6},
+ {"Helvetica,Italic", 7},
+ {"Helvetica-Bold", 5},
+ {"Helvetica-BoldItalic", 6},
+ {"Helvetica-BoldOblique", 6},
+ {"Helvetica-Italic", 7},
+ {"Helvetica-Oblique", 7},
+ {"HelveticaBold", 5},
+ {"HelveticaBoldItalic", 6},
+ {"HelveticaItalic", 7},
+ {"Symbol", 12},
+ {"SymbolMT", 12},
+ {"Times-Bold", 9},
+ {"Times-BoldItalic", 10},
+ {"Times-Italic", 11},
+ {"Times-Roman", 8},
+ {"TimesBold", 9},
+ {"TimesBoldItalic", 10},
+ {"TimesItalic", 11},
+ {"TimesNewRoman", 8},
+ {"TimesNewRoman,Bold", 9},
+ {"TimesNewRoman,BoldItalic", 10},
+ {"TimesNewRoman,Italic", 11},
+ {"TimesNewRoman-Bold", 9},
+ {"TimesNewRoman-BoldItalic", 10},
+ {"TimesNewRoman-Italic", 11},
+ {"TimesNewRomanBold", 9},
+ {"TimesNewRomanBoldItalic", 10},
+ {"TimesNewRomanItalic", 11},
+ {"TimesNewRomanPS", 8},
+ {"TimesNewRomanPS-Bold", 9},
+ {"TimesNewRomanPS-BoldItalic", 10},
+ {"TimesNewRomanPS-BoldItalicMT", 10},
+ {"TimesNewRomanPS-BoldMT", 9},
+ {"TimesNewRomanPS-Italic", 11},
+ {"TimesNewRomanPS-ItalicMT", 11},
+ {"TimesNewRomanPSMT", 8},
+ {"TimesNewRomanPSMT,Bold", 9},
+ {"TimesNewRomanPSMT,BoldItalic", 10},
+ {"TimesNewRomanPSMT,Italic", 11},
+ {"ZapfDingbats", 13},
+};
+extern "C" {
+ static int compareString(const void* key, const void* element)
+ {
+ return FXSYS_stricmp((FX_LPCSTR)key, ((_AltFontName*)element)->m_pName);
+ }
+}
+int _PDF_GetStandardFontName(CFX_ByteString& name)
+{
+ _AltFontName* found = (_AltFontName*)FXSYS_bsearch((FX_LPCSTR)name, g_AltFontNames,
+ sizeof g_AltFontNames / sizeof (_AltFontName), sizeof (_AltFontName), compareString);
+ if (found == NULL) {
+ return -1;
+ }
+ name = g_Base14FontNames[found->m_Index];
+ return found->m_Index;
+}
+int GetTTCIndex(FX_LPCBYTE pFontData, FX_DWORD ttc_size, FX_DWORD font_offset)
+{
+ int face_index = 0;
+ FX_LPCBYTE p = pFontData + 8;
+ FX_DWORD nfont = GET_TT_LONG(p);
+ FX_DWORD index;
+ for (index = 0; index < nfont; index ++) {
+ p = pFontData + 12 + index * 4;
+ if (GET_TT_LONG(p) == font_offset) {
+ break;
+ }
+ }
+ if(index >= nfont) {
+ face_index = 0;
+ } else {
+ face_index = index;
+ }
+ return face_index;
+}
+FXFT_Face CFX_FontMgr::GetCachedTTCFace(int ttc_size, FX_DWORD checksum,
+ int font_offset, FX_LPBYTE& pFontData)
+{
+ CFX_ByteString key;
+ key.Format("%d:%d", ttc_size, checksum);
+ CTTFontDesc* pFontDesc = NULL;
+ m_FaceMap.Lookup(key, (void*&)pFontDesc);
+ if (pFontDesc == NULL) {
+ return NULL;
+ }
+ pFontData = pFontDesc->m_pFontData;
+ pFontDesc->m_RefCount ++;
+ int face_index = GetTTCIndex(pFontDesc->m_pFontData, ttc_size, font_offset);
+ if (pFontDesc->m_TTCFace.m_pFaces[face_index] == NULL) {
+ pFontDesc->m_TTCFace.m_pFaces[face_index] = GetFixedFace(pFontDesc->m_pFontData, ttc_size, face_index);
+ }
+ return pFontDesc->m_TTCFace.m_pFaces[face_index];
+}
+FXFT_Face CFX_FontMgr::AddCachedTTCFace(int ttc_size, FX_DWORD checksum,
+ FX_LPBYTE pData, FX_DWORD size, int font_offset)
+{
+ CFX_ByteString key;
+ key.Format("%d:%d", ttc_size, checksum);
+ CTTFontDesc* pFontDesc = FX_NEW CTTFontDesc;
+ if (!pFontDesc) {
+ return NULL;
+ }
+ pFontDesc->m_Type = 2;
+ pFontDesc->m_pFontData = pData;
+ for (int i = 0; i < 16; i ++) {
+ pFontDesc->m_TTCFace.m_pFaces[i] = NULL;
+ }
+ pFontDesc->m_RefCount ++;
+ key.Format("%d:%d", ttc_size, checksum);
+ m_FaceMap.SetAt(key, pFontDesc);
+ int face_index = GetTTCIndex(pFontDesc->m_pFontData, ttc_size, font_offset);
+ pFontDesc->m_TTCFace.m_pFaces[face_index] = GetFixedFace(pFontDesc->m_pFontData, ttc_size, face_index);
+ return pFontDesc->m_TTCFace.m_pFaces[face_index];
+}
+FXFT_Face CFX_FontMgr::GetFixedFace(FX_LPCBYTE pData, FX_DWORD size, int face_index)
+{
+ FXFT_Library library;
+ if (m_FTLibrary == NULL) {
+ FXFT_Init_FreeType(&m_FTLibrary);
+ }
+ library = m_FTLibrary;
+ FXFT_Face face = NULL;
+ int ret = FXFT_New_Memory_Face(library, pData, size, face_index, &face);
+ if (ret) {
+ return NULL;
+ }
+ ret = FXFT_Set_Pixel_Sizes(face, 64, 64);
+ if (ret) {
+ return NULL;
+ }
+ return face;
+}
+FXFT_Face CFX_FontMgr::GetFileFace(FX_LPCSTR filename, int face_index)
+{
+ FXFT_Library library;
+ if (m_FTLibrary == NULL) {
+ FXFT_Init_FreeType(&m_FTLibrary);
+ }
+ library = m_FTLibrary;
+ FXFT_Face face = NULL;
+ int ret = FXFT_New_Face(library, filename, face_index, &face);
+ if (ret) {
+ return NULL;
+ }
+ ret = FXFT_Set_Pixel_Sizes(face, 64, 64);
+ if (ret) {
+ return NULL;
+ }
+ return face;
+}
+void CFX_FontMgr::ReleaseFace(FXFT_Face face)
+{
+ if (face == NULL) {
+ return;
+ }
+ FX_POSITION pos = m_FaceMap.GetStartPosition();
+ while(pos) {
+ CFX_ByteString Key;
+ CTTFontDesc* ttface;
+ m_FaceMap.GetNextAssoc(pos, Key, (void*&)ttface);
+ if (ttface->ReleaseFace(face)) {
+ m_FaceMap.RemoveKey(Key);
+ }
+ }
+}
+extern "C" {
+ extern const unsigned char g_FoxitFixedItalicFontData [18746];
+ extern const unsigned char g_FoxitFixedFontData [17597];
+ extern const unsigned char g_FoxitSansItalicFontData [16339];
+ extern const unsigned char g_FoxitSansFontData [15025];
+ extern const unsigned char g_FoxitSerifItalicFontData [21227];
+ extern const unsigned char g_FoxitSerifFontData [19469];
+ extern const unsigned char g_FoxitFixedBoldItalicFontData [19151];
+ extern const unsigned char g_FoxitFixedBoldFontData [18055];
+ extern const unsigned char g_FoxitSansBoldItalicFontData [16418];
+ extern const unsigned char g_FoxitSansBoldFontData [16344];
+ extern const unsigned char g_FoxitSerifBoldItalicFontData [20733];
+ extern const unsigned char g_FoxitSerifBoldFontData [19395];
+ extern const unsigned char g_FoxitSymbolFontData[16729];
+ extern const unsigned char g_FoxitDingbatsFontData[29513];
+ extern const unsigned char g_FoxitSerifMMFontData[113417];
+ extern const unsigned char g_FoxitSansMMFontData[66919];
+};
+const FoxitFonts g_FoxitFonts[14] = {
+ {g_FoxitFixedFontData, 17597},
+ {g_FoxitFixedBoldFontData, 18055},
+ {g_FoxitFixedBoldItalicFontData, 19151},
+ {g_FoxitFixedItalicFontData, 18746},
+ {g_FoxitSansFontData, 15025},
+ {g_FoxitSansBoldFontData, 16344},
+ {g_FoxitSansBoldItalicFontData, 16418},
+ {g_FoxitSansItalicFontData, 16339},
+ {g_FoxitSerifFontData, 19469},
+ {g_FoxitSerifBoldFontData, 19395},
+ {g_FoxitSerifBoldItalicFontData, 20733},
+ {g_FoxitSerifItalicFontData, 21227},
+ {g_FoxitSymbolFontData, 16729},
+ {g_FoxitDingbatsFontData, 29513},
+};
+void _FPDFAPI_GetInternalFontData(int id, FX_LPCBYTE& data, FX_DWORD& size)
+{
+ CFX_GEModule::Get()->GetFontMgr()->GetStandardFont(data, size, id);
+}
+FX_BOOL CFX_FontMgr::GetStandardFont(FX_LPCBYTE& pFontData, FX_DWORD& size, int index)
+{
+ if (index > 15 || index < 0) {
+ return FALSE;
+ }
+ {
+ if (index >= 14) {
+ if (index == 14) {
+ pFontData = g_FoxitSerifMMFontData;
+ size = 113417;
+ } else {
+ pFontData = g_FoxitSansMMFontData;
+ size = 66919;
+ }
+ } else {
+ pFontData = g_FoxitFonts[index].m_pFontData;
+ size = g_FoxitFonts[index].m_dwSize;
+ }
+ }
+ return TRUE;
+}
+CFX_FontMapper::CFX_FontMapper()
+{
+ FXSYS_memset32(m_FoxitFaces, 0, sizeof m_FoxitFaces);
+ m_MMFaces[0] = m_MMFaces[1] = NULL;
+ m_pFontInfo = NULL;
+ m_bListLoaded = FALSE;
+ m_pFontEnumerator = NULL;
+}
+CFX_FontMapper::~CFX_FontMapper()
+{
+ for (int i = 0; i < 14; i ++)
+ if (m_FoxitFaces[i]) {
+ FXFT_Done_Face(m_FoxitFaces[i]);
+ }
+ if (m_MMFaces[0]) {
+ FXFT_Done_Face(m_MMFaces[0]);
+ }
+ if (m_MMFaces[1]) {
+ FXFT_Done_Face(m_MMFaces[1]);
+ }
+ if (m_pFontInfo) {
+ m_pFontInfo->Release();
+ }
+}
+void CFX_FontMapper::SetSystemFontInfo(IFX_SystemFontInfo* pFontInfo)
+{
+ if (pFontInfo == NULL) {
+ return;
+ }
+ if (m_pFontInfo) {
+ m_pFontInfo->Release();
+ }
+ m_pFontInfo = pFontInfo;
+}
+static CFX_ByteString _TT_NormalizeName(FX_LPCSTR family)
+{
+ CFX_ByteString norm(family, -1);
+ norm.Remove(' ');
+ norm.Remove('-');
+ norm.Remove(',');
+ int pos = norm.Find('+');
+ if (pos > 0) {
+ norm = norm.Left(pos);
+ }
+ norm.MakeLower();
+ return norm;
+}
+CFX_ByteString _FPDF_GetNameFromTT(FX_LPCBYTE name_table, FX_DWORD name_id)
+{
+ FX_LPCBYTE ptr = name_table + 2;
+ int name_count = GET_TT_SHORT(ptr);
+ int string_offset = GET_TT_SHORT(ptr + 2);
+ FX_LPCBYTE string_ptr = name_table + string_offset;
+ ptr += 4;
+ for (int i = 0; i < name_count; i ++) {
+ if (GET_TT_SHORT(ptr + 6) == name_id && GET_TT_SHORT(ptr) == 1 && GET_TT_SHORT(ptr + 2) == 0) {
+ return CFX_ByteStringC(string_ptr + GET_TT_SHORT(ptr + 10), GET_TT_SHORT(ptr + 8));
+ }
+ ptr += 12;
+ }
+ return CFX_ByteString();
+}
+static CFX_ByteString _FPDF_ReadStringFromFile(FXSYS_FILE* pFile, FX_DWORD size)
+{
+ CFX_ByteString buffer;
+ if (!FXSYS_fread(buffer.GetBuffer(size), size, 1, pFile)) {
+ return CFX_ByteString();
+ }
+ buffer.ReleaseBuffer(size);
+ return buffer;
+}
+static CFX_ByteString _FPDF_ReadStringFromStreamFile(IFX_FileStream* pFile, FX_DWORD size)
+{
+ CFX_ByteString buffer;
+ if (!pFile->ReadBlock(buffer.GetBuffer(size), size)) {
+ return CFX_ByteString();
+ }
+ buffer.ReleaseBuffer(size);
+ return buffer;
+}
+CFX_ByteString _FPDF_LoadTableFromTT(FXSYS_FILE* pFile, FX_LPCBYTE pTables, FX_DWORD nTables, FX_DWORD tag)
+{
+ for (FX_DWORD i = 0; i < nTables; i ++) {
+ FX_LPCBYTE p = pTables + i * 16;
+ if (GET_TT_LONG(p) == tag) {
+ FX_DWORD offset = GET_TT_LONG(p + 8);
+ FX_DWORD size = GET_TT_LONG(p + 12);
+ FXSYS_fseek(pFile, offset, FXSYS_SEEK_SET);
+ return _FPDF_ReadStringFromFile(pFile, size);
+ }
+ }
+ return CFX_ByteString();
+}
+CFX_ByteString _FPDF_LoadTableFromTTStreamFile(IFX_FileStream* pFile, FX_LPCBYTE pTables, FX_DWORD nTables, FX_DWORD tag)
+{
+ for (FX_DWORD i = 0; i < nTables; i ++) {
+ FX_LPCBYTE p = pTables + i * 16;
+ if (GET_TT_LONG(p) == tag) {
+ FX_DWORD offset = GET_TT_LONG(p + 8);
+ FX_DWORD size = GET_TT_LONG(p + 12);
+ CFX_ByteString buffer;
+ if (!pFile->ReadBlock(buffer.GetBuffer(size), offset, size)) {
+ return CFX_ByteString();
+ }
+ buffer.ReleaseBuffer(size);
+ return buffer;
+ }
+ }
+ return CFX_ByteString();
+}
+CFX_ByteString CFX_FontMapper::GetPSNameFromTT(void* hFont)
+{
+ if (m_pFontInfo == NULL) {
+ CFX_ByteString();
+ }
+ CFX_ByteString result;
+ FX_DWORD size = m_pFontInfo->GetFontData(hFont, 0x6e616d65, NULL, 0);
+ if (size) {
+ FX_LPBYTE buffer = FX_Alloc(FX_BYTE, size);
+ if (!buffer) {
+ return result;
+ }
+ m_pFontInfo->GetFontData(hFont, 0x6e616d65, buffer, size);
+ result = _FPDF_GetNameFromTT(buffer, 6);
+ FX_Free(buffer);
+ }
+ return result;
+}
+void CFX_FontMapper::AddInstalledFont(const CFX_ByteString& name, int charset)
+{
+ if (m_pFontInfo == NULL) {
+ return;
+ }
+ if (m_CharsetArray.Find((FX_DWORD)charset) == -1) {
+ m_CharsetArray.Add((FX_DWORD)charset);
+ m_FaceArray.Add(name);
+ }
+ if (name == m_LastFamily) {
+ return;
+ }
+ FX_LPCBYTE ptr = name;
+ FX_BOOL bLocalized = FALSE;
+ for (int i = 0; i < name.GetLength(); i ++)
+ if (ptr[i] > 0x80) {
+ bLocalized = TRUE;
+ break;
+ }
+ if (bLocalized) {
+ void* hFont = m_pFontInfo->GetFont(name);
+ if (hFont == NULL) {
+ FX_BOOL bExact;
+ hFont = m_pFontInfo->MapFont(0, 0, FXFONT_DEFAULT_CHARSET, 0, name, bExact);
+ if (hFont == NULL) {
+ return;
+ }
+ }
+ CFX_ByteString new_name = GetPSNameFromTT(hFont);
+ if (!new_name.IsEmpty()) {
+ new_name.Insert(0, ' ');
+ m_InstalledTTFonts.Add(new_name);
+ }
+ m_pFontInfo->DeleteFont(hFont);
+ }
+ m_InstalledTTFonts.Add(name);
+ m_LastFamily = name;
+}
+void CFX_FontMapper::LoadInstalledFonts()
+{
+ if (m_pFontInfo == NULL) {
+ return;
+ }
+ if (m_bListLoaded) {
+ return;
+ }
+ if (m_bListLoaded) {
+ return;
+ }
+ m_pFontInfo->EnumFontList(this);
+ m_bListLoaded = TRUE;
+}
+CFX_ByteString CFX_FontMapper::MatchInstalledFonts(const CFX_ByteString& norm_name)
+{
+ LoadInstalledFonts();
+ int i;
+ for (i = m_InstalledTTFonts.GetSize() - 1; i >= 0; i --) {
+ CFX_ByteString norm1 = _TT_NormalizeName(m_InstalledTTFonts[i]);
+ if (norm1 == norm_name) {
+ break;
+ }
+ }
+ if (i < 0) {
+ return CFX_ByteString();
+ }
+ CFX_ByteString match = m_InstalledTTFonts[i];
+ if (match[0] == ' ') {
+ match = m_InstalledTTFonts[i + 1];
+ }
+ return match;
+}
+typedef struct _CHARSET_MAP_ {
+ FX_BYTE charset;
+ FX_WORD codepage;
+} CHARSET_MAP;
+static const CHARSET_MAP g_Codepage2CharsetTable[] = {
+ { 1 , 0 },
+ { 2 , 42 },
+ { 254, 437 },
+ { 255, 850 },
+ { 222, 874 },
+ { 128, 932 },
+ { 134, 936 },
+ { 129, 949 },
+ { 136, 950 },
+ { 238, 1250 },
+ { 204, 1251 },
+ { 0, 1252 },
+ { 161, 1253 },
+ { 162, 1254 },
+ { 177, 1255 },
+ { 178, 1256 },
+ { 186, 1257 },
+ { 163, 1258 },
+ { 130, 1361 },
+ { 77, 10000 },
+ { 78, 10001 },
+ { 79, 10003 },
+ { 80, 10008 },
+ { 81, 10002 },
+ { 83, 10005 },
+ { 84, 10004 },
+ { 85, 10006 },
+ { 86, 10081 },
+ { 87, 10021 },
+ { 88, 10029 },
+ { 89, 10007 },
+};
+FX_BYTE _GetCharsetFromCodePage(FX_WORD codepage)
+{
+ FX_INT32 iEnd = sizeof(g_Codepage2CharsetTable) / sizeof(CHARSET_MAP) - 1;
+ FXSYS_assert(iEnd >= 0);
+ FX_INT32 iStart = 0, iMid;
+ do {
+ iMid = (iStart + iEnd) / 2;
+ const CHARSET_MAP & cp = g_Codepage2CharsetTable[iMid];
+ if (codepage == cp.codepage) {
+ return cp.charset;
+ } else if (codepage < cp.codepage) {
+ iEnd = iMid - 1;
+ } else {
+ iStart = iMid + 1;
+ }
+ } while (iStart <= iEnd);
+ return 1;
+}
+FX_DWORD _GetCodePageRangeFromCharset(int charset)
+{
+ if (charset == FXFONT_EASTEUROPE_CHARSET) {
+ return 1 << 1;
+ }
+ if (charset == FXFONT_GREEK_CHARSET) {
+ return 1 << 3;
+ }
+ if (charset == FXFONT_TURKISH_CHARSET) {
+ return 1 << 4;
+ }
+ if (charset == FXFONT_HEBREW_CHARSET) {
+ return 1 << 5;
+ }
+ if (charset == FXFONT_ARABIC_CHARSET) {
+ return 1 << 6;
+ }
+ if (charset == FXFONT_BALTIC_CHARSET) {
+ return 1 << 7;
+ }
+ if (charset == FXFONT_THAI_CHARSET) {
+ return 1 << 16;
+ }
+ if (charset == FXFONT_SHIFTJIS_CHARSET) {
+ return 1 << 17;
+ }
+ if (charset == FXFONT_GB2312_CHARSET) {
+ return 1 << 18;
+ }
+ if (charset == FXFONT_CHINESEBIG5_CHARSET) {
+ return 1 << 20;
+ }
+ if (charset == FXFONT_HANGEUL_CHARSET) {
+ return 1 << 19;
+ }
+ if (charset == FXFONT_SYMBOL_CHARSET) {
+ return 1 << 31;
+ }
+ return 1 << 21;
+}
+static int CP2CharSet(int cp)
+{
+ if(cp == 932) {
+ return FXFONT_SHIFTJIS_CHARSET;
+ } else if(cp == 936) {
+ return FXFONT_GB2312_CHARSET;
+ } else if(cp == 949) {
+ return FXFONT_HANGEUL_CHARSET;
+ } else if(cp == 950) {
+ return FXFONT_CHINESEBIG5_CHARSET;
+ }
+ return FXFONT_DEFAULT_CHARSET;
+}
+FXFT_Face CFX_FontMapper::UseInternalSubst(CFX_SubstFont* pSubstFont, int iBaseFont, int italic_angle, int weight, int picthfamily)
+{
+ if (iBaseFont < 12) {
+ if (m_FoxitFaces[iBaseFont]) {
+ return m_FoxitFaces[iBaseFont];
+ }
+ FX_LPCBYTE pFontData = NULL;
+ FX_DWORD size = 0;
+ if (m_pFontMgr->GetStandardFont(pFontData, size, iBaseFont)) {
+ m_FoxitFaces[iBaseFont] = m_pFontMgr->GetFixedFace(pFontData, size, 0);
+ return m_FoxitFaces[iBaseFont];
+ }
+ }
+ pSubstFont->m_SubstFlags |= FXFONT_SUBST_MM;
+ pSubstFont->m_ItalicAngle = italic_angle;
+ if (weight) {
+ pSubstFont->m_Weight = weight;
+ }
+ if (picthfamily & FXFONT_FF_ROMAN) {
+ pSubstFont->m_Weight = pSubstFont->m_Weight * 4 / 5;
+ pSubstFont->m_Family = "Chrome Serif";
+ if (m_MMFaces[1]) {
+ return m_MMFaces[1];
+ }
+ FX_LPCBYTE pFontData = NULL;
+ FX_DWORD size;
+ m_pFontMgr->GetStandardFont(pFontData, size, 14);
+ m_MMFaces[1] = m_pFontMgr->GetFixedFace(pFontData, size, 0);
+ return m_MMFaces[1];
+ }
+ pSubstFont->m_Family = "Chrome Sans";
+ if (m_MMFaces[0]) {
+ return m_MMFaces[0];
+ }
+ FX_LPCBYTE pFontData = NULL;
+ FX_DWORD size = 0;
+ m_pFontMgr->GetStandardFont(pFontData, size, 15);
+ m_MMFaces[0] = m_pFontMgr->GetFixedFace(pFontData, size, 0);
+ return m_MMFaces[0];
+}
+const struct _AltFontFamily {
+ FX_LPCSTR m_pFontName;
+ FX_LPCSTR m_pFontFamily;
+}
+g_AltFontFamilies[] = {
+ {"AGaramondPro", "Adobe Garamond Pro"},
+ {"BankGothicBT-Medium", "BankGothic Md BT"},
+ {"ForteMT", "Forte"},
+};
+extern "C" {
+ static int compareFontFamilyString(const void* key, const void* element)
+ {
+ CFX_ByteString str_key((FX_LPCSTR)key);
+ if (str_key.Find(((_AltFontFamily*)element)->m_pFontName) != -1) {
+ return 0;
+ }
+ return FXSYS_stricmp((FX_LPCSTR)key, ((_AltFontFamily*)element)->m_pFontName);
+ }
+}
+#define FX_FONT_STYLE_None 0x00
+#define FX_FONT_STYLE_Bold 0x01
+#define FX_FONT_STYLE_Italic 0x02
+#define FX_FONT_STYLE_BoldBold 0x04
+static CFX_ByteString _GetFontFamily(CFX_ByteString fontName, int nStyle)
+{
+ if (fontName.Find("Script") >= 0) {
+ if ((nStyle & FX_FONT_STYLE_Bold) == FX_FONT_STYLE_Bold) {
+ fontName = "ScriptMTBold";
+ } else if (fontName.Find("Palace") >= 0) {
+ fontName = "PalaceScriptMT";
+ } else if (fontName.Find("French") >= 0) {
+ fontName = "FrenchScriptMT";
+ } else if (fontName.Find("FreeStyle") >= 0) {
+ fontName = "FreeStyleScript";
+ }
+ return fontName;
+ }
+ _AltFontFamily* found = (_AltFontFamily*)FXSYS_bsearch((FX_LPCSTR)fontName, g_AltFontFamilies,
+ sizeof g_AltFontFamilies / sizeof (_AltFontFamily), sizeof (_AltFontFamily), compareFontFamilyString);
+ if (found == NULL) {
+ return fontName;
+ }
+ return found->m_pFontFamily;
+};
+typedef struct _FX_FontStyle {
+ FX_LPCSTR style;
+ FX_INT32 len;
+} FX_FontStyle;
+const FX_FontStyle g_FontStyles[] = {
+ "Bold", 4,
+ "Italic", 6,
+ "BoldItalic", 10,
+ "Reg", 3,
+ "Regular", 7,
+};
+CFX_ByteString ParseStyle(FX_LPCSTR pStyle, int iLen, int iIndex)
+{
+ CFX_ByteTextBuf buf;
+ if (!iLen || iLen <= iIndex) {
+ return buf.GetByteString();
+ }
+ while (iIndex < iLen) {
+ if (pStyle[iIndex] == ',') {
+ break;
+ }
+ buf.AppendChar(pStyle[iIndex]);
+ ++iIndex;
+ }
+ return buf.GetByteString();
+}
+FX_INT32 GetStyleType(const CFX_ByteString &bsStyle, FX_BOOL bRevert)
+{
+ FX_INT32 iLen = bsStyle.GetLength();
+ if (!iLen) {
+ return -1;
+ }
+ int iSize = sizeof(g_FontStyles) / sizeof(FX_FontStyle);
+ const FX_FontStyle *pStyle = NULL;
+ for (int i = iSize - 1; i >= 0; --i) {
+ pStyle = g_FontStyles + i;
+ if (!pStyle || pStyle->len > iLen) {
+ continue;
+ }
+ if (!bRevert) {
+ if (bsStyle.Left(pStyle->len).Compare(pStyle->style) == 0) {
+ return i;
+ }
+ } else {
+ if (bsStyle.Right(pStyle->len).Compare(pStyle->style) == 0) {
+ return i;
+ }
+ }
+ }
+ return -1;
+}
+FX_BOOL CheckSupportThirdPartFont(CFX_ByteString name, int &PitchFamily)
+{
+ if (name == FX_BSTRC("MyriadPro")) {
+ PitchFamily &= ~FXFONT_FF_ROMAN;
+ return TRUE;
+ }
+ return FALSE;
+}
+FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, FX_BOOL bTrueType, FX_DWORD flags,
+ int weight, int italic_angle, int WindowCP, CFX_SubstFont* pSubstFont)
+{
+ if (!(flags & FXFONT_USEEXTERNATTR)) {
+ weight = FXFONT_FW_NORMAL;
+ italic_angle = 0;
+ }
+ CFX_ByteString SubstName = name;
+ SubstName.Remove(0x20);
+ if (bTrueType) {
+ if (name[0] == '@') {
+ SubstName = name.Mid(1);
+ }
+ }
+ _PDF_GetStandardFontName(SubstName);
+ if (SubstName == FX_BSTRC("Symbol") && !bTrueType) {
+ pSubstFont->m_Family = "Chrome Symbol";
+ pSubstFont->m_Charset = FXFONT_SYMBOL_CHARSET;
+ pSubstFont->m_SubstFlags |= FXFONT_SUBST_STANDARD;
+ if (m_FoxitFaces[12]) {
+ return m_FoxitFaces[12];
+ }
+ FX_LPCBYTE pFontData = NULL;
+ FX_DWORD size = 0;
+ m_pFontMgr->GetStandardFont(pFontData, size, 12);
+ m_FoxitFaces[12] = m_pFontMgr->GetFixedFace(pFontData, size, 0);
+ return m_FoxitFaces[12];
+ }
+ if (SubstName == FX_BSTRC("ZapfDingbats")) {
+ pSubstFont->m_Family = "Chrome Dingbats";
+ pSubstFont->m_Charset = FXFONT_SYMBOL_CHARSET;
+ pSubstFont->m_SubstFlags |= FXFONT_SUBST_STANDARD;
+ if (m_FoxitFaces[13]) {
+ return m_FoxitFaces[13];
+ }
+ FX_LPCBYTE pFontData = NULL;
+ FX_DWORD size = 0;
+ m_pFontMgr->GetStandardFont(pFontData, size, 13);
+ m_FoxitFaces[13] = m_pFontMgr->GetFixedFace(pFontData, size, 0);
+ return m_FoxitFaces[13];
+ }
+ int iBaseFont = 0;
+ CFX_ByteString family, style;
+ FX_BOOL bHasComma = FALSE;
+ FX_BOOL bHasHypen = FALSE;
+ int find = SubstName.Find(FX_BSTRC(","), 0);
+ if (find >= 0) {
+ family = SubstName.Left(find);
+ _PDF_GetStandardFontName(family);
+ style = SubstName.Mid(find + 1);
+ bHasComma = TRUE;
+ } else {
+ family = SubstName;
+ }
+ for (; iBaseFont < 12; iBaseFont ++)
+ if (family == CFX_ByteStringC(g_Base14FontNames[iBaseFont])) {
+ break;
+ }
+ int PitchFamily = 0;
+ FX_BOOL bItalic = FALSE;
+ FX_DWORD nStyle = 0;
+ FX_BOOL bStyleAvail = FALSE;
+ FX_BOOL bFamilyStyleIsWhole = FALSE;
+ FX_BOOL bNextF = FALSE;
+ if (iBaseFont < 12) {
+ family = g_Base14FontNames[iBaseFont];
+ if ((iBaseFont % 4) == 1 || (iBaseFont % 4) == 2) {
+ nStyle |= FX_FONT_STYLE_Bold;
+ }
+ if ((iBaseFont % 4) / 2) {
+ nStyle |= FX_FONT_STYLE_Italic;
+ }
+ if (iBaseFont < 4) {
+ PitchFamily |= FXFONT_FF_FIXEDPITCH;
+ }
+ if (iBaseFont >= 8) {
+ PitchFamily |= FXFONT_FF_ROMAN;
+ }
+ } else {
+ if (!bHasComma) {
+ find = family.ReverseFind('-');
+ if (find >= 0) {
+ style = family.Mid(find + 1);
+ family = family.Left(find);
+ bHasHypen = TRUE;
+ }
+ }
+ if (!bHasHypen) {
+ int nLen = family.GetLength();
+ FX_INT32 nRet = GetStyleType(family, TRUE);
+ if (nRet > -1) {
+ family = family.Left(nLen - g_FontStyles[nRet].len);
+ if (nRet == 0) {
+ nStyle |= FX_FONT_STYLE_Bold;
+ }
+ if (nRet == 1) {
+ nStyle |= FX_FONT_STYLE_Italic;
+ }
+ if (nRet == 2) {
+ nStyle |= (FX_FONT_STYLE_Bold | FX_FONT_STYLE_Italic);
+ }
+ }
+ }
+ if (flags & FXFONT_SERIF) {
+ PitchFamily |= FXFONT_FF_ROMAN;
+ }
+ if (flags & FXFONT_SCRIPT) {
+ PitchFamily |= FXFONT_FF_SCRIPT;
+ }
+ if (flags & FXFONT_FIXED_PITCH) {
+ PitchFamily |= FXFONT_FF_FIXEDPITCH;
+ }
+ }
+ if (!style.IsEmpty()) {
+ int nLen = style.GetLength();
+ FX_LPCSTR pStyle = style;
+ int i = 0;
+ FX_BOOL bFirstItem = TRUE;
+ CFX_ByteString buf;
+ while (i < nLen) {
+ buf = ParseStyle(pStyle, nLen, i);
+ FX_INT32 nRet = GetStyleType(buf, FALSE);
+ if ((i && !bStyleAvail) || (!i && nRet < 0)) {
+ family = SubstName;
+ iBaseFont = 12;
+ break;
+ } else if (nRet >= 0) {
+ bStyleAvail = TRUE;
+ }
+ if (nRet == 0) {
+ if (nStyle & FX_FONT_STYLE_Bold) {
+ nStyle |= FX_FONT_STYLE_BoldBold;
+ } else {
+ nStyle |= FX_FONT_STYLE_Bold;
+ }
+ bFirstItem = FALSE;
+ }
+ if (nRet == 1) {
+ if (bFirstItem) {
+ nStyle |= FX_FONT_STYLE_Italic;
+ } else {
+ family = SubstName;
+ iBaseFont = 12;
+ }
+ break;
+ }
+ if (nRet == 2) {
+ nStyle |= FX_FONT_STYLE_Italic;
+ if (nStyle & FX_FONT_STYLE_Bold) {
+ nStyle |= FX_FONT_STYLE_BoldBold;
+ } else {
+ nStyle |= FX_FONT_STYLE_Bold;
+ }
+ bFirstItem = FALSE;
+ }
+ i += buf.GetLength() + 1;
+ }
+ }
+ weight = weight ? weight : FXFONT_FW_NORMAL;
+ int old_weight = weight;
+ if (nStyle) {
+ weight = nStyle & FX_FONT_STYLE_BoldBold ? 900 : (nStyle & FX_FONT_STYLE_Bold ? FXFONT_FW_BOLD : FXFONT_FW_NORMAL);
+ }
+ if (nStyle & FX_FONT_STYLE_Italic) {
+ bItalic = TRUE;
+ }
+ FX_BOOL bCJK = FALSE;
+ FX_BOOL bExact = FALSE;
+ int Charset = FXFONT_ANSI_CHARSET;
+ if (WindowCP) {
+ Charset = _GetCharsetFromCodePage(WindowCP);
+ } else if (iBaseFont == 12 && (flags & FXFONT_SYMBOLIC)) {
+ Charset = FXFONT_SYMBOL_CHARSET;
+ }
+ if (Charset == FXFONT_SHIFTJIS_CHARSET || Charset == FXFONT_GB2312_CHARSET ||
+ Charset == FXFONT_HANGEUL_CHARSET || Charset == FXFONT_CHINESEBIG5_CHARSET) {
+ bCJK = TRUE;
+ }
+ if (m_pFontInfo == NULL) {
+ pSubstFont->m_SubstFlags |= FXFONT_SUBST_STANDARD;
+ return UseInternalSubst(pSubstFont, iBaseFont, italic_angle, old_weight, PitchFamily);
+ }
+ family = _GetFontFamily(family, nStyle);
+ CFX_ByteString match = MatchInstalledFonts(_TT_NormalizeName(family));
+ if (match.IsEmpty() && family != SubstName && (!bHasComma && (!bHasHypen || (bHasHypen && !bStyleAvail)))) {
+ match = MatchInstalledFonts(_TT_NormalizeName(SubstName));
+ }
+ if (match.IsEmpty() && iBaseFont >= 12) {
+ if (!bCJK) {
+ if (!CheckSupportThirdPartFont(family, PitchFamily)) {
+ if (italic_angle != 0) {
+ bItalic = TRUE;
+ } else {
+ bItalic = FALSE;
+ }
+ weight = old_weight;
+ }
+ } else {
+ pSubstFont->m_bSubstOfCJK = TRUE;
+ if (nStyle) {
+ pSubstFont->m_WeightCJK = weight;
+ } else {
+ pSubstFont->m_WeightCJK = FXFONT_FW_NORMAL;
+ }
+ if (nStyle & FX_FONT_STYLE_Italic) {
+ pSubstFont->m_bItlicCJK = TRUE;
+ }
+ }
+ } else {
+ italic_angle = 0;
+ weight = nStyle & FX_FONT_STYLE_BoldBold ? 900 : (nStyle & FX_FONT_STYLE_Bold ? FXFONT_FW_BOLD : FXFONT_FW_NORMAL);
+ }
+ if (!match.IsEmpty() || iBaseFont < 12) {
+ pSubstFont->m_SubstFlags |= FXFONT_SUBST_EXACT;
+ if (!match.IsEmpty()) {
+ family = match;
+ }
+ if (iBaseFont < 12) {
+ if (nStyle && !(iBaseFont % 4)) {
+ if ((nStyle & 0x3) == 1) {
+ iBaseFont += 1;
+ }
+ if ((nStyle & 0x3) == 2) {
+ iBaseFont += 3;
+ }
+ if ((nStyle & 0x3) == 3) {
+ iBaseFont += 2;
+ }
+ }
+ if (m_pFontMgr->m_ExternalFonts[iBaseFont].m_pFontData) {
+ if (m_FoxitFaces[iBaseFont]) {
+ return m_FoxitFaces[iBaseFont];
+ }
+ m_FoxitFaces[iBaseFont] = m_pFontMgr->GetFixedFace(m_pFontMgr->m_ExternalFonts[iBaseFont].m_pFontData,
+ m_pFontMgr->m_ExternalFonts[iBaseFont].m_dwSize, 0);
+ if (m_FoxitFaces[iBaseFont]) {
+ return m_FoxitFaces[iBaseFont];
+ }
+ } else {
+ family = g_Base14FontNames[iBaseFont];
+ }
+ pSubstFont->m_SubstFlags |= FXFONT_SUBST_STANDARD;
+ }
+ } else {
+ if (flags & FXFONT_ITALIC) {
+ bItalic = TRUE;
+ }
+ }
+ bExact = !match.IsEmpty();
+ void* hFont = m_pFontInfo->MapFont(weight, bItalic, Charset, PitchFamily, family, bExact);
+ if (bExact) {
+ pSubstFont->m_SubstFlags |= FXFONT_SUBST_EXACT;
+ }
+ if (hFont == NULL) {
+ if (bCJK) {
+ if (italic_angle != 0) {
+ bItalic = TRUE;
+ } else {
+ bItalic = FALSE;
+ }
+ weight = old_weight;
+ }
+ if (!match.IsEmpty()) {
+ hFont = m_pFontInfo->GetFont(match);
+ if (hFont == NULL) {
+ return UseInternalSubst(pSubstFont, iBaseFont, italic_angle, old_weight, PitchFamily);
+ }
+ } else {
+ if (Charset == FXFONT_SYMBOL_CHARSET) {
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ || _FXM_PLATFORM_ == _FXM_PLATFORM_ANDROID_
+ if (SubstName == FX_BSTRC("Symbol")) {
+ pSubstFont->m_Family = "Chrome Symbol";
+ pSubstFont->m_SubstFlags |= FXFONT_SUBST_STANDARD;
+ pSubstFont->m_Charset = FXFONT_SYMBOL_CHARSET;
+ if (m_FoxitFaces[12]) {
+ return m_FoxitFaces[12];
+ }
+ FX_LPCBYTE pFontData = NULL;
+ FX_DWORD size = 0;
+ m_pFontMgr->GetStandardFont(pFontData, size, 12);
+ m_FoxitFaces[12] = m_pFontMgr->GetFixedFace(pFontData, size, 0);
+ return m_FoxitFaces[12];
+ } else {
+ pSubstFont->m_SubstFlags |= FXFONT_SUBST_NONSYMBOL;
+ return FindSubstFont(family, bTrueType, flags & ~FXFONT_SYMBOLIC, weight, italic_angle, 0, pSubstFont);
+ }
+#else
+ pSubstFont->m_SubstFlags |= FXFONT_SUBST_NONSYMBOL;
+ return FindSubstFont(family, bTrueType, flags & ~FXFONT_SYMBOLIC, weight, italic_angle, 0, pSubstFont);
+#endif
+ }
+ if (Charset == FXFONT_ANSI_CHARSET) {
+ pSubstFont->m_SubstFlags |= FXFONT_SUBST_STANDARD;
+ return UseInternalSubst(pSubstFont, iBaseFont, italic_angle, old_weight, PitchFamily);
+ }
+ int index = m_CharsetArray.Find(Charset);
+ if (index < 0) {
+ return UseInternalSubst(pSubstFont, iBaseFont, italic_angle, old_weight, PitchFamily);
+ } else {
+ hFont = m_pFontInfo->GetFont(m_FaceArray[index]);
+ }
+ }
+ }
+ pSubstFont->m_ExtHandle = m_pFontInfo->RetainFont(hFont);
+ if (hFont == NULL) {
+ return NULL;
+ }
+ m_pFontInfo->GetFaceName(hFont, SubstName);
+ if (Charset == FXFONT_DEFAULT_CHARSET) {
+ m_pFontInfo->GetFontCharset(hFont, Charset);
+ }
+ FX_DWORD ttc_size = m_pFontInfo->GetFontData(hFont, 0x74746366, NULL, 0);
+ FX_DWORD font_size = m_pFontInfo->GetFontData(hFont, 0, NULL, 0);
+ if(font_size == 0 && ttc_size == 0) {
+ m_pFontInfo->DeleteFont(hFont);
+ return NULL;
+ }
+ FXFT_Face face = NULL;
+ if (ttc_size) {
+ FX_BYTE temp[1024];
+ m_pFontInfo->GetFontData(hFont, 0x74746366, temp, 1024);
+ FX_DWORD checksum = 0;
+ for (int i = 0; i < 256; i ++) {
+ checksum += ((FX_DWORD*)temp)[i];
+ }
+ FX_LPBYTE pFontData;
+ face = m_pFontMgr->GetCachedTTCFace(ttc_size, checksum, ttc_size - font_size, pFontData);
+ if (face == NULL) {
+ pFontData = FX_Alloc(FX_BYTE, ttc_size);
+ if (pFontData) {
+ m_pFontInfo->GetFontData(hFont, 0x74746366, pFontData, ttc_size);
+ face = m_pFontMgr->AddCachedTTCFace(ttc_size, checksum, pFontData, ttc_size,
+ ttc_size - font_size);
+ }
+ }
+ } else {
+ FX_LPBYTE pFontData;
+ face = m_pFontMgr->GetCachedFace(SubstName, weight, bItalic, pFontData);
+ if (face == NULL) {
+ pFontData = FX_Alloc(FX_BYTE, font_size);
+ if (!pFontData) {
+ m_pFontInfo->DeleteFont(hFont);
+ return NULL;
+ }
+ m_pFontInfo->GetFontData(hFont, 0, pFontData, font_size);
+ face = m_pFontMgr->AddCachedFace(SubstName, weight, bItalic, pFontData, font_size, m_pFontInfo->GetFaceIndex(hFont));
+ }
+ }
+ if (face == NULL) {
+ m_pFontInfo->DeleteFont(hFont);
+ return NULL;
+ }
+ pSubstFont->m_Family = SubstName;
+ pSubstFont->m_Charset = Charset;
+ FX_BOOL bNeedUpdateWeight = FALSE;
+ if (FXFT_Is_Face_Bold(face)) {
+ if (weight == FXFONT_FW_BOLD) {
+ bNeedUpdateWeight = FALSE;
+ } else {
+ bNeedUpdateWeight = TRUE;
+ }
+ } else {
+ if (weight == FXFONT_FW_NORMAL) {
+ bNeedUpdateWeight = FALSE;
+ } else {
+ bNeedUpdateWeight = TRUE;
+ }
+ }
+ if (bNeedUpdateWeight) {
+ pSubstFont->m_Weight = weight;
+ }
+ if (bItalic && !FXFT_Is_Face_Italic(face)) {
+ if (italic_angle == 0) {
+ italic_angle = -12;
+ } else if (FXSYS_abs(italic_angle) < 5) {
+ italic_angle = 0;
+ }
+ pSubstFont->m_ItalicAngle = italic_angle;
+ }
+ m_pFontInfo->DeleteFont(hFont);
+ return face;
+}
+extern "C" {
+ unsigned long _FTStreamRead(FXFT_Stream stream, unsigned long offset,
+ unsigned char* buffer, unsigned long count);
+ void _FTStreamClose(FXFT_Stream stream);
+};
+CFontFileFaceInfo::CFontFileFaceInfo()
+{
+ m_pFile = NULL;
+ m_Face = NULL;
+ m_Charsets = 0;
+ m_FileSize = 0;
+ m_FontOffset = 0;
+ m_Weight = 0;
+ m_bItalic = FALSE;
+ m_PitchFamily = 0;
+}
+CFontFileFaceInfo::~CFontFileFaceInfo()
+{
+ if (m_Face) {
+ FXFT_Done_Face(m_Face);
+ }
+ m_Face = NULL;
+}
+extern FX_BOOL _LoadFile(FXFT_Library library, FXFT_Face* Face, IFX_FileRead* pFile, FXFT_Stream* stream);
+#if defined(_FPDFAPI_MINI_) || _FX_OS_ == _FX_ANDROID_
+IFX_SystemFontInfo* IFX_SystemFontInfo::CreateDefault()
+{
+ return NULL;
+}
+#endif
+#if !defined(_FPDFAPI_MINI_)
+CFX_FolderFontInfo::CFX_FolderFontInfo()
+{
+}
+CFX_FolderFontInfo::~CFX_FolderFontInfo()
+{
+ FX_POSITION pos = m_FontList.GetStartPosition();
+ while (pos) {
+ CFX_ByteString key;
+ FX_LPVOID value;
+ m_FontList.GetNextAssoc(pos, key, value);
+ delete (CFontFaceInfo*)value;
+ }
+}
+void CFX_FolderFontInfo::AddPath(FX_BSTR path)
+{
+ m_PathList.Add(path);
+}
+void CFX_FolderFontInfo::Release()
+{
+ delete this;
+}
+FX_BOOL CFX_FolderFontInfo::EnumFontList(CFX_FontMapper* pMapper)
+{
+ m_pMapper = pMapper;
+ for (int i = 0; i < m_PathList.GetSize(); i ++) {
+ ScanPath(m_PathList[i]);
+ }
+ return TRUE;
+}
+void CFX_FolderFontInfo::ScanPath(CFX_ByteString& path)
+{
+ void* handle = FX_OpenFolder(path);
+ if (handle == NULL) {
+ return;
+ }
+ CFX_ByteString filename;
+ FX_BOOL bFolder;
+ while (FX_GetNextFile(handle, filename, bFolder)) {
+ if (bFolder) {
+ if (filename == "." || filename == "..") {
+ continue;
+ }
+ } else {
+ CFX_ByteString ext = filename.Right(4);
+ ext.MakeUpper();
+ if (ext != ".TTF" && ext != ".OTF" && ext != ".TTC") {
+ continue;
+ }
+ }
+ CFX_ByteString fullpath = path;
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
+ fullpath += "\\";
+#else
+ fullpath += "/";
+#endif
+ fullpath += filename;
+ if (bFolder) {
+ ScanPath(fullpath);
+ } else {
+ ScanFile(fullpath);
+ }
+ }
+ FX_CloseFolder(handle);
+}
+void CFX_FolderFontInfo::ScanFile(CFX_ByteString& path)
+{
+ FXSYS_FILE* pFile = FXSYS_fopen(path, "rb");
+ if (pFile == NULL) {
+ return;
+ }
+ FXSYS_fseek(pFile, 0, FXSYS_SEEK_END);
+ FX_DWORD filesize = FXSYS_ftell(pFile);
+ FX_BYTE buffer[16];
+ FXSYS_fseek(pFile, 0, FXSYS_SEEK_SET);
+ size_t readCnt = FXSYS_fread(buffer, 12, 1, pFile);
+ if (GET_TT_LONG(buffer) == 0x74746366) {
+ FX_DWORD nFaces = GET_TT_LONG(buffer + 8);
+ FX_LPBYTE offsets = FX_Alloc(FX_BYTE, nFaces * 4);
+ if (!offsets) {
+ FXSYS_fclose(pFile);
+ return;
+ }
+ readCnt = FXSYS_fread(offsets, nFaces * 4, 1, pFile);
+ for (FX_DWORD i = 0; i < nFaces; i ++) {
+ FX_LPBYTE p = offsets + i * 4;
+ ReportFace(path, pFile, filesize, GET_TT_LONG(p));
+ }
+ FX_Free(offsets);
+ } else {
+ ReportFace(path, pFile, filesize, 0);
+ }
+ FXSYS_fclose(pFile);
+}
+void CFX_FolderFontInfo::ReportFace(CFX_ByteString& path, FXSYS_FILE* pFile, FX_DWORD filesize, FX_DWORD offset)
+{
+ FXSYS_fseek(pFile, offset, FXSYS_SEEK_SET);
+ char buffer[16];
+ if (!FXSYS_fread(buffer, 12, 1, pFile)) {
+ return;
+ }
+ FX_DWORD nTables = GET_TT_SHORT(buffer + 4);
+ CFX_ByteString tables = _FPDF_ReadStringFromFile(pFile, nTables * 16);
+ CFX_ByteString names = _FPDF_LoadTableFromTT(pFile, tables, nTables, 0x6e616d65);
+ CFX_ByteString facename = _FPDF_GetNameFromTT(names, 1);
+ CFX_ByteString style = _FPDF_GetNameFromTT(names, 2);
+ if (style != "Regular") {
+ facename += " " + style;
+ }
+ FX_LPVOID p;
+ if (m_FontList.Lookup(facename, p)) {
+ return;
+ }
+ CFontFaceInfo* pInfo = FX_NEW CFontFaceInfo;
+ if (!pInfo) {
+ return;
+ }
+ pInfo->m_FilePath = path;
+ pInfo->m_FaceName = facename;
+ pInfo->m_FontTables = tables;
+ pInfo->m_FontOffset = offset;
+ pInfo->m_FileSize = filesize;
+ pInfo->m_Charsets = 0;
+ CFX_ByteString os2 = _FPDF_LoadTableFromTT(pFile, tables, nTables, 0x4f532f32);
+ if (os2.GetLength() >= 86) {
+ FX_LPCBYTE p = (FX_LPCBYTE)os2 + 78;
+ FX_DWORD codepages = GET_TT_LONG(p);
+ if (codepages & (1 << 17)) {
+ m_pMapper->AddInstalledFont(facename, FXFONT_SHIFTJIS_CHARSET);
+ pInfo->m_Charsets |= CHARSET_FLAG_SHIFTJIS;
+ }
+ if (codepages & (1 << 18)) {
+ m_pMapper->AddInstalledFont(facename, FXFONT_GB2312_CHARSET);
+ pInfo->m_Charsets |= CHARSET_FLAG_GB;
+ }
+ if (codepages & (1 << 20)) {
+ m_pMapper->AddInstalledFont(facename, FXFONT_CHINESEBIG5_CHARSET);
+ pInfo->m_Charsets |= CHARSET_FLAG_BIG5;
+ }
+ if ((codepages & (1 << 19)) || (codepages & (1 << 21))) {
+ m_pMapper->AddInstalledFont(facename, FXFONT_HANGEUL_CHARSET);
+ pInfo->m_Charsets |= CHARSET_FLAG_KOREAN;
+ }
+ if (codepages & (1 << 31)) {
+ m_pMapper->AddInstalledFont(facename, FXFONT_SYMBOL_CHARSET);
+ pInfo->m_Charsets |= CHARSET_FLAG_SYMBOL;
+ }
+ }
+ m_pMapper->AddInstalledFont(facename, FXFONT_ANSI_CHARSET);
+ pInfo->m_Charsets |= CHARSET_FLAG_ANSI;
+ pInfo->m_Styles = 0;
+ if (style.Find(FX_BSTRC("Bold")) > -1) {
+ pInfo->m_Styles |= FXFONT_BOLD;
+ }
+ if (style.Find(FX_BSTRC("Italic")) > -1 || style.Find(FX_BSTRC("Oblique")) > -1) {
+ pInfo->m_Styles |= FXFONT_ITALIC;
+ }
+ if (facename.Find(FX_BSTRC("Serif")) > -1) {
+ pInfo->m_Styles |= FXFONT_SERIF;
+ }
+ m_FontList.SetAt(facename, pInfo);
+}
+void* CFX_FolderFontInfo::MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, FX_LPCSTR family, FX_BOOL& bExact)
+{
+ return NULL;
+}
+void* CFX_FolderFontInfo::GetFont(FX_LPCSTR face)
+{
+ FX_LPVOID p;
+ if (!m_FontList.Lookup(face, p)) {
+ return NULL;
+ }
+ return p;
+}
+FX_DWORD CFX_FolderFontInfo::GetFontData(void* hFont, FX_DWORD table, FX_LPBYTE buffer, FX_DWORD size)
+{
+ if (hFont == NULL) {
+ return 0;
+ }
+ CFontFaceInfo* pFont = (CFontFaceInfo*)hFont;
+ FXSYS_FILE* pFile = NULL;
+ if (size > 0) {
+ pFile = FXSYS_fopen(pFont->m_FilePath, "rb");
+ if (pFile == NULL) {
+ return 0;
+ }
+ }
+ FX_DWORD datasize = 0;
+ FX_DWORD offset;
+ if (table == 0) {
+ datasize = pFont->m_FontOffset ? 0 : pFont->m_FileSize;
+ offset = 0;
+ } else if (table == 0x74746366) {
+ datasize = pFont->m_FontOffset ? pFont->m_FileSize : 0;
+ offset = 0;
+ } else {
+ FX_DWORD nTables = pFont->m_FontTables.GetLength() / 16;
+ for (FX_DWORD i = 0; i < nTables; i ++) {
+ FX_LPCBYTE p = (FX_LPCBYTE)pFont->m_FontTables + i * 16;
+ if (GET_TT_LONG(p) == table) {
+ offset = GET_TT_LONG(p + 8);
+ datasize = GET_TT_LONG(p + 12);
+ }
+ }
+ }
+ if (datasize && size >= datasize && pFile) {
+ FXSYS_fseek(pFile, offset, FXSYS_SEEK_SET);
+ size_t readCnt = FXSYS_fread(buffer, datasize, 1, pFile);
+ }
+ if (pFile) {
+ FXSYS_fclose(pFile);
+ }
+ return datasize;
+}
+void CFX_FolderFontInfo::DeleteFont(void* hFont)
+{
+}
+FX_BOOL CFX_FolderFontInfo::GetFaceName(void* hFont, CFX_ByteString& name)
+{
+ if (hFont == NULL) {
+ return FALSE;
+ }
+ CFontFaceInfo* pFont = (CFontFaceInfo*)hFont;
+ name = pFont->m_FaceName;
+ return TRUE;
+}
+FX_BOOL CFX_FolderFontInfo::GetFontCharset(void* hFont, int& charset)
+{
+ return FALSE;
+}
+#endif
diff --git a/core/src/fxge/ge/fx_ge_linux.cpp b/core/src/fxge/ge/fx_ge_linux.cpp
index 33cfcfe722..735ecac0c8 100644
--- a/core/src/fxge/ge/fx_ge_linux.cpp
+++ b/core/src/fxge/ge/fx_ge_linux.cpp
@@ -1,259 +1,259 @@
-// 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
-
-#include "../../../include/fxge/fx_ge.h"
-#include "../agg/include/fx_agg_driver.h"
-#include "text_int.h"
-#if !defined(_FPDFAPI_MINI_) && _FXM_PLATFORM_ == _FXM_PLATFORM_LINUX_
-#if (_FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ && (!defined(_FPDFAPI_MINI_)))
-void CFX_AggDeviceDriver::InitPlatform()
-{
-}
-void CFX_AggDeviceDriver::DestroyPlatform()
-{
-}
-void CFX_FaceCache::InitPlatform()
-{
-}
-FX_BOOL CFX_AggDeviceDriver::DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont,
- CFX_FontCache* pCache, const CFX_AffineMatrix* pObject2Device,
- FX_FLOAT font_size, FX_DWORD argb)
-{
- return FALSE;
-}
-CFX_GlyphBitmap* CFX_FaceCache::RenderGlyph_Nativetext(CFX_Font* pFont, FX_DWORD glyph_index, const CFX_AffineMatrix* pMatrix,
- int dest_width, int anti_alias)
-{
- return NULL;
-}
-void CFX_Font::ReleasePlatformResource()
-{
-}
-#endif
-static const struct {
- FX_LPCSTR m_pName;
- FX_LPCSTR m_pSubstName;
-}
-Base14Substs[] = {
- {"Courier", "Courier New"},
- {"Courier-Bold", "Courier New Bold"},
- {"Courier-BoldOblique", "Courier New Bold Italic"},
- {"Courier-Oblique", "Courier New Italic"},
- {"Helvetica", "Arial"},
- {"Helvetica-Bold", "Arial Bold"},
- {"Helvetica-BoldOblique", "Arial Bold Italic"},
- {"Helvetica-Oblique", "Arial Italic"},
- {"Times-Roman", "Times New Roman"},
- {"Times-Bold", "Times New Roman Bold"},
- {"Times-BoldItalic", "Times New Roman Bold Italic"},
- {"Times-Italic", "Times New Roman Italic"},
-};
-class CFX_LinuxFontInfo : public CFX_FolderFontInfo
-{
-public:
- virtual void* MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, FX_LPCSTR family, FX_BOOL& bExact);
- FX_BOOL ParseFontCfg();
- void* FindFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, FX_LPCSTR family, FX_BOOL bMatchName);
-};
-#define LINUX_GPNAMESIZE 6
-static const struct {
- FX_LPCSTR NameArr[LINUX_GPNAMESIZE];
-}
-LinuxGpFontList[] = {
- {{"TakaoPGothic", "VL PGothic", "IPAPGothic", "VL Gothic", "Kochi Gothic", "VL Gothic regular"}},
- {{"TakaoGothic", "VL Gothic", "IPAGothic", "Kochi Gothic", NULL, "VL Gothic regular"}},
- {{"TakaoPMincho", "IPAPMincho", "VL Gothic", "Kochi Mincho", NULL, "VL Gothic regular"}},
- {{"TakaoMincho", "IPAMincho", "VL Gothic", "Kochi Mincho", NULL, "VL Gothic regular"}},
-};
-static const FX_LPCSTR g_LinuxGbFontList[] = {
- "AR PL UMing CN Light",
- "WenQuanYi Micro Hei",
- "AR PL UKai CN",
-};
-static const FX_LPCSTR g_LinuxB5FontList[] = {
- "AR PL UMing TW Light",
- "WenQuanYi Micro Hei",
- "AR PL UKai TW",
-};
-static const FX_LPCSTR g_LinuxHGFontList[] = {
- "UnDotum",
-};
-static FX_INT32 GetJapanesePreference(FX_LPCSTR facearr, int weight, int picth_family)
-{
- CFX_ByteString face = facearr;
- if (face.Find("Gothic") >= 0 || face.Find("\x83\x53\x83\x56\x83\x62\x83\x4e") >= 0) {
- if (face.Find("PGothic") >= 0 || face.Find("\x82\x6f\x83\x53\x83\x56\x83\x62\x83\x4e") >= 0) {
- return 0;
- } else {
- return 1;
- }
- } else if (face.Find("Mincho") >= 0 || face.Find("\x96\xbe\x92\xa9") >= 0) {
- if (face.Find("PMincho") >= 0 || face.Find("\x82\x6f\x96\xbe\x92\xa9") >= 0) {
- return 2;
- } else {
- return 3;
- }
- }
- if (!(picth_family & FXFONT_FF_ROMAN) && weight > 400) {
- return 0;
- }
- return 2;
-}
-void* CFX_LinuxFontInfo::MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, FX_LPCSTR cstr_face, FX_BOOL& bExact)
-{
- CFX_ByteString face = cstr_face;
- int iBaseFont;
- for (iBaseFont = 0; iBaseFont < 12; iBaseFont ++)
- if (face == CFX_ByteStringC(Base14Substs[iBaseFont].m_pName)) {
- face = Base14Substs[iBaseFont].m_pSubstName;
- bExact = TRUE;
- break;
- }
- if (iBaseFont < 12) {
- return GetFont(face);
- }
- FX_LPVOID p = NULL;
- FX_BOOL bCJK = TRUE;
- switch (charset) {
- case FXFONT_SHIFTJIS_CHARSET: {
- FX_INT32 index = GetJapanesePreference(cstr_face, weight, pitch_family);
- if (index < 0) {
- break;
- }
- for (FX_INT32 i = 0; i < LINUX_GPNAMESIZE; i++)
- if (m_FontList.Lookup(LinuxGpFontList[index].NameArr[i], p)) {
- return p;
- }
- }
- break;
- case FXFONT_GB2312_CHARSET: {
- static FX_INT32 s_gbCount = sizeof(g_LinuxGbFontList) / sizeof(FX_LPCSTR);
- for (FX_INT32 i = 0; i < s_gbCount; i++)
- if (m_FontList.Lookup(g_LinuxGbFontList[i], p)) {
- return p;
- }
- }
- break;
- case FXFONT_CHINESEBIG5_CHARSET: {
- static FX_INT32 s_b5Count = sizeof(g_LinuxB5FontList) / sizeof(FX_LPCSTR);
- for (FX_INT32 i = 0; i < s_b5Count; i++)
- if (m_FontList.Lookup(g_LinuxB5FontList[i], p)) {
- return p;
- }
- }
- break;
- case FXFONT_HANGEUL_CHARSET: {
- static FX_INT32 s_hgCount = sizeof(g_LinuxHGFontList) / sizeof(FX_LPCSTR);
- for (FX_INT32 i = 0; i < s_hgCount; i++)
- if (m_FontList.Lookup(g_LinuxHGFontList[i], p)) {
- return p;
- }
- }
- break;
- default:
- bCJK = FALSE;
- break;
- }
- if (charset == FXFONT_ANSI_CHARSET && (pitch_family & FXFONT_FF_FIXEDPITCH)) {
- return GetFont("Courier New");
- }
- return FindFont(weight, bItalic, charset, pitch_family, cstr_face, !bCJK);
-}
-static FX_DWORD _LinuxGetCharset(int charset)
-{
- switch(charset) {
- case FXFONT_SHIFTJIS_CHARSET:
- return CHARSET_FLAG_SHIFTJIS;
- case FXFONT_GB2312_CHARSET:
- return CHARSET_FLAG_GB;
- case FXFONT_CHINESEBIG5_CHARSET:
- return CHARSET_FLAG_BIG5;
- case FXFONT_HANGEUL_CHARSET:
- return CHARSET_FLAG_KOREAN;
- case FXFONT_SYMBOL_CHARSET:
- return CHARSET_FLAG_SYMBOL;
- case FXFONT_ANSI_CHARSET:
- return CHARSET_FLAG_ANSI;
- default:
- break;
- }
- return 0;
-}
-static FX_INT32 _LinuxGetSimilarValue(int weight, FX_BOOL bItalic, int pitch_family, FX_DWORD style)
-{
- FX_INT32 iSimilarValue = 0;
- if ((style & FXFONT_BOLD) == (weight > 400)) {
- iSimilarValue += 16;
- }
- if ((style & FXFONT_ITALIC) == bItalic) {
- iSimilarValue += 16;
- }
- if ((style & FXFONT_SERIF) == (pitch_family & FXFONT_FF_ROMAN)) {
- iSimilarValue += 16;
- }
- if ((style & FXFONT_SCRIPT) == (pitch_family & FXFONT_FF_SCRIPT)) {
- iSimilarValue += 8;
- }
- if ((style & FXFONT_FIXED_PITCH) == (pitch_family & FXFONT_FF_FIXEDPITCH)) {
- iSimilarValue += 8;
- }
- return iSimilarValue;
-}
-void* CFX_LinuxFontInfo::FindFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, FX_LPCSTR family, FX_BOOL bMatchName)
-{
- CFontFaceInfo* pFind = NULL;
- FX_DWORD charset_flag = _LinuxGetCharset(charset);
- FX_INT32 iBestSimilar = 0;
- FX_POSITION pos = m_FontList.GetStartPosition();
- while (pos) {
- CFX_ByteString bsName;
- CFontFaceInfo* pFont = NULL;
- m_FontList.GetNextAssoc(pos, bsName, (FX_LPVOID&)pFont);
- if (!(pFont->m_Charsets & charset_flag) && charset != FXFONT_DEFAULT_CHARSET) {
- continue;
- }
- FX_INT32 iSimilarValue = 0;
- FX_INT32 index = bsName.Find(family);
- if (bMatchName && index < 0) {
- continue;
- }
- if (!bMatchName && index > 0) {
- iSimilarValue += 64;
- }
- iSimilarValue = _LinuxGetSimilarValue(weight, bItalic, pitch_family, pFont->m_Styles);
- if (iSimilarValue > iBestSimilar) {
- iBestSimilar = iSimilarValue;
- pFind = pFont;
- }
- }
- return pFind;
-}
-IFX_SystemFontInfo* IFX_SystemFontInfo::CreateDefault()
-{
- CFX_LinuxFontInfo* pInfo = FX_NEW CFX_LinuxFontInfo;
- if (!pInfo) {
- return NULL;
- }
- if (!pInfo->ParseFontCfg()) {
- pInfo->AddPath("/usr/share/fonts");
- pInfo->AddPath("/usr/share/X11/fonts/Type1");
- pInfo->AddPath("/usr/share/X11/fonts/TTF");
- pInfo->AddPath("/usr/local/share/fonts");
- }
- return pInfo;
-}
-FX_BOOL CFX_LinuxFontInfo::ParseFontCfg()
-{
- return FALSE;
-}
-void CFX_GEModule::InitPlatform()
-{
- m_pFontMgr->SetSystemFontInfo(IFX_SystemFontInfo::CreateDefault());
-}
-void CFX_GEModule::DestroyPlatform()
-{
-}
-#endif
+// 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
+
+#include "../../../include/fxge/fx_ge.h"
+#include "../agg/include/fx_agg_driver.h"
+#include "text_int.h"
+#if !defined(_FPDFAPI_MINI_) && _FXM_PLATFORM_ == _FXM_PLATFORM_LINUX_
+#if (_FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ && (!defined(_FPDFAPI_MINI_)))
+void CFX_AggDeviceDriver::InitPlatform()
+{
+}
+void CFX_AggDeviceDriver::DestroyPlatform()
+{
+}
+void CFX_FaceCache::InitPlatform()
+{
+}
+FX_BOOL CFX_AggDeviceDriver::DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont,
+ CFX_FontCache* pCache, const CFX_AffineMatrix* pObject2Device,
+ FX_FLOAT font_size, FX_DWORD argb)
+{
+ return FALSE;
+}
+CFX_GlyphBitmap* CFX_FaceCache::RenderGlyph_Nativetext(CFX_Font* pFont, FX_DWORD glyph_index, const CFX_AffineMatrix* pMatrix,
+ int dest_width, int anti_alias)
+{
+ return NULL;
+}
+void CFX_Font::ReleasePlatformResource()
+{
+}
+#endif
+static const struct {
+ FX_LPCSTR m_pName;
+ FX_LPCSTR m_pSubstName;
+}
+Base14Substs[] = {
+ {"Courier", "Courier New"},
+ {"Courier-Bold", "Courier New Bold"},
+ {"Courier-BoldOblique", "Courier New Bold Italic"},
+ {"Courier-Oblique", "Courier New Italic"},
+ {"Helvetica", "Arial"},
+ {"Helvetica-Bold", "Arial Bold"},
+ {"Helvetica-BoldOblique", "Arial Bold Italic"},
+ {"Helvetica-Oblique", "Arial Italic"},
+ {"Times-Roman", "Times New Roman"},
+ {"Times-Bold", "Times New Roman Bold"},
+ {"Times-BoldItalic", "Times New Roman Bold Italic"},
+ {"Times-Italic", "Times New Roman Italic"},
+};
+class CFX_LinuxFontInfo : public CFX_FolderFontInfo
+{
+public:
+ virtual void* MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, FX_LPCSTR family, FX_BOOL& bExact);
+ FX_BOOL ParseFontCfg();
+ void* FindFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, FX_LPCSTR family, FX_BOOL bMatchName);
+};
+#define LINUX_GPNAMESIZE 6
+static const struct {
+ FX_LPCSTR NameArr[LINUX_GPNAMESIZE];
+}
+LinuxGpFontList[] = {
+ {{"TakaoPGothic", "VL PGothic", "IPAPGothic", "VL Gothic", "Kochi Gothic", "VL Gothic regular"}},
+ {{"TakaoGothic", "VL Gothic", "IPAGothic", "Kochi Gothic", NULL, "VL Gothic regular"}},
+ {{"TakaoPMincho", "IPAPMincho", "VL Gothic", "Kochi Mincho", NULL, "VL Gothic regular"}},
+ {{"TakaoMincho", "IPAMincho", "VL Gothic", "Kochi Mincho", NULL, "VL Gothic regular"}},
+};
+static const FX_LPCSTR g_LinuxGbFontList[] = {
+ "AR PL UMing CN Light",
+ "WenQuanYi Micro Hei",
+ "AR PL UKai CN",
+};
+static const FX_LPCSTR g_LinuxB5FontList[] = {
+ "AR PL UMing TW Light",
+ "WenQuanYi Micro Hei",
+ "AR PL UKai TW",
+};
+static const FX_LPCSTR g_LinuxHGFontList[] = {
+ "UnDotum",
+};
+static FX_INT32 GetJapanesePreference(FX_LPCSTR facearr, int weight, int picth_family)
+{
+ CFX_ByteString face = facearr;
+ if (face.Find("Gothic") >= 0 || face.Find("\x83\x53\x83\x56\x83\x62\x83\x4e") >= 0) {
+ if (face.Find("PGothic") >= 0 || face.Find("\x82\x6f\x83\x53\x83\x56\x83\x62\x83\x4e") >= 0) {
+ return 0;
+ } else {
+ return 1;
+ }
+ } else if (face.Find("Mincho") >= 0 || face.Find("\x96\xbe\x92\xa9") >= 0) {
+ if (face.Find("PMincho") >= 0 || face.Find("\x82\x6f\x96\xbe\x92\xa9") >= 0) {
+ return 2;
+ } else {
+ return 3;
+ }
+ }
+ if (!(picth_family & FXFONT_FF_ROMAN) && weight > 400) {
+ return 0;
+ }
+ return 2;
+}
+void* CFX_LinuxFontInfo::MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, FX_LPCSTR cstr_face, FX_BOOL& bExact)
+{
+ CFX_ByteString face = cstr_face;
+ int iBaseFont;
+ for (iBaseFont = 0; iBaseFont < 12; iBaseFont ++)
+ if (face == CFX_ByteStringC(Base14Substs[iBaseFont].m_pName)) {
+ face = Base14Substs[iBaseFont].m_pSubstName;
+ bExact = TRUE;
+ break;
+ }
+ if (iBaseFont < 12) {
+ return GetFont(face);
+ }
+ FX_LPVOID p = NULL;
+ FX_BOOL bCJK = TRUE;
+ switch (charset) {
+ case FXFONT_SHIFTJIS_CHARSET: {
+ FX_INT32 index = GetJapanesePreference(cstr_face, weight, pitch_family);
+ if (index < 0) {
+ break;
+ }
+ for (FX_INT32 i = 0; i < LINUX_GPNAMESIZE; i++)
+ if (m_FontList.Lookup(LinuxGpFontList[index].NameArr[i], p)) {
+ return p;
+ }
+ }
+ break;
+ case FXFONT_GB2312_CHARSET: {
+ static FX_INT32 s_gbCount = sizeof(g_LinuxGbFontList) / sizeof(FX_LPCSTR);
+ for (FX_INT32 i = 0; i < s_gbCount; i++)
+ if (m_FontList.Lookup(g_LinuxGbFontList[i], p)) {
+ return p;
+ }
+ }
+ break;
+ case FXFONT_CHINESEBIG5_CHARSET: {
+ static FX_INT32 s_b5Count = sizeof(g_LinuxB5FontList) / sizeof(FX_LPCSTR);
+ for (FX_INT32 i = 0; i < s_b5Count; i++)
+ if (m_FontList.Lookup(g_LinuxB5FontList[i], p)) {
+ return p;
+ }
+ }
+ break;
+ case FXFONT_HANGEUL_CHARSET: {
+ static FX_INT32 s_hgCount = sizeof(g_LinuxHGFontList) / sizeof(FX_LPCSTR);
+ for (FX_INT32 i = 0; i < s_hgCount; i++)
+ if (m_FontList.Lookup(g_LinuxHGFontList[i], p)) {
+ return p;
+ }
+ }
+ break;
+ default:
+ bCJK = FALSE;
+ break;
+ }
+ if (charset == FXFONT_ANSI_CHARSET && (pitch_family & FXFONT_FF_FIXEDPITCH)) {
+ return GetFont("Courier New");
+ }
+ return FindFont(weight, bItalic, charset, pitch_family, cstr_face, !bCJK);
+}
+static FX_DWORD _LinuxGetCharset(int charset)
+{
+ switch(charset) {
+ case FXFONT_SHIFTJIS_CHARSET:
+ return CHARSET_FLAG_SHIFTJIS;
+ case FXFONT_GB2312_CHARSET:
+ return CHARSET_FLAG_GB;
+ case FXFONT_CHINESEBIG5_CHARSET:
+ return CHARSET_FLAG_BIG5;
+ case FXFONT_HANGEUL_CHARSET:
+ return CHARSET_FLAG_KOREAN;
+ case FXFONT_SYMBOL_CHARSET:
+ return CHARSET_FLAG_SYMBOL;
+ case FXFONT_ANSI_CHARSET:
+ return CHARSET_FLAG_ANSI;
+ default:
+ break;
+ }
+ return 0;
+}
+static FX_INT32 _LinuxGetSimilarValue(int weight, FX_BOOL bItalic, int pitch_family, FX_DWORD style)
+{
+ FX_INT32 iSimilarValue = 0;
+ if ((style & FXFONT_BOLD) == (weight > 400)) {
+ iSimilarValue += 16;
+ }
+ if ((style & FXFONT_ITALIC) == bItalic) {
+ iSimilarValue += 16;
+ }
+ if ((style & FXFONT_SERIF) == (pitch_family & FXFONT_FF_ROMAN)) {
+ iSimilarValue += 16;
+ }
+ if ((style & FXFONT_SCRIPT) == (pitch_family & FXFONT_FF_SCRIPT)) {
+ iSimilarValue += 8;
+ }
+ if ((style & FXFONT_FIXED_PITCH) == (pitch_family & FXFONT_FF_FIXEDPITCH)) {
+ iSimilarValue += 8;
+ }
+ return iSimilarValue;
+}
+void* CFX_LinuxFontInfo::FindFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, FX_LPCSTR family, FX_BOOL bMatchName)
+{
+ CFontFaceInfo* pFind = NULL;
+ FX_DWORD charset_flag = _LinuxGetCharset(charset);
+ FX_INT32 iBestSimilar = 0;
+ FX_POSITION pos = m_FontList.GetStartPosition();
+ while (pos) {
+ CFX_ByteString bsName;
+ CFontFaceInfo* pFont = NULL;
+ m_FontList.GetNextAssoc(pos, bsName, (FX_LPVOID&)pFont);
+ if (!(pFont->m_Charsets & charset_flag) && charset != FXFONT_DEFAULT_CHARSET) {
+ continue;
+ }
+ FX_INT32 iSimilarValue = 0;
+ FX_INT32 index = bsName.Find(family);
+ if (bMatchName && index < 0) {
+ continue;
+ }
+ if (!bMatchName && index > 0) {
+ iSimilarValue += 64;
+ }
+ iSimilarValue = _LinuxGetSimilarValue(weight, bItalic, pitch_family, pFont->m_Styles);
+ if (iSimilarValue > iBestSimilar) {
+ iBestSimilar = iSimilarValue;
+ pFind = pFont;
+ }
+ }
+ return pFind;
+}
+IFX_SystemFontInfo* IFX_SystemFontInfo::CreateDefault()
+{
+ CFX_LinuxFontInfo* pInfo = FX_NEW CFX_LinuxFontInfo;
+ if (!pInfo) {
+ return NULL;
+ }
+ if (!pInfo->ParseFontCfg()) {
+ pInfo->AddPath("/usr/share/fonts");
+ pInfo->AddPath("/usr/share/X11/fonts/Type1");
+ pInfo->AddPath("/usr/share/X11/fonts/TTF");
+ pInfo->AddPath("/usr/local/share/fonts");
+ }
+ return pInfo;
+}
+FX_BOOL CFX_LinuxFontInfo::ParseFontCfg()
+{
+ return FALSE;
+}
+void CFX_GEModule::InitPlatform()
+{
+ m_pFontMgr->SetSystemFontInfo(IFX_SystemFontInfo::CreateDefault());
+}
+void CFX_GEModule::DestroyPlatform()
+{
+}
+#endif
diff --git a/core/src/fxge/ge/fx_ge_path.cpp b/core/src/fxge/ge/fx_ge_path.cpp
index fc6ee52f1f..cd3ff0efbe 100644
--- a/core/src/fxge/ge/fx_ge_path.cpp
+++ b/core/src/fxge/ge/fx_ge_path.cpp
@@ -1,654 +1,654 @@
-// 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
-
-#include "../../../include/fxcrt/fx_basic.h"
-#include "../../../include/fxge/fx_ge.h"
-CFX_ClipRgn::CFX_ClipRgn(int width, int height)
-{
- m_Type = RectI;
- m_Box.left = m_Box.top = 0;
- m_Box.right = width;
- m_Box.bottom = height;
-}
-CFX_ClipRgn::CFX_ClipRgn(const FX_RECT& rect)
-{
- m_Type = RectI;
- m_Box = rect;
-}
-CFX_ClipRgn::CFX_ClipRgn(const CFX_ClipRgn& src)
-{
- m_Type = src.m_Type;
- m_Box = src.m_Box;
- m_Mask = src.m_Mask;
-}
-CFX_ClipRgn::~CFX_ClipRgn()
-{
-}
-void CFX_ClipRgn::Reset(const FX_RECT& rect)
-{
- m_Type = RectI;
- m_Box = rect;
- m_Mask.SetNull();
-}
-void CFX_ClipRgn::IntersectRect(const FX_RECT& rect)
-{
- if (m_Type == RectI) {
- m_Box.Intersect(rect);
- return;
- }
- if (m_Type == MaskF) {
- IntersectMaskRect(rect, m_Box, m_Mask);
- return;
- }
-}
-void CFX_ClipRgn::IntersectMaskRect(FX_RECT rect, FX_RECT mask_rect, CFX_DIBitmapRef Mask)
-{
- const CFX_DIBitmap* mask_dib = Mask;
- m_Type = MaskF;
- m_Box = rect;
- m_Box.Intersect(mask_rect);
- if (m_Box.IsEmpty()) {
- m_Type = RectI;
- return;
- } else if (m_Box == mask_rect) {
- m_Mask = Mask;
- return;
- }
- CFX_DIBitmap* new_dib = m_Mask.New();
- if (!new_dib) {
- return;
- }
- new_dib->Create(m_Box.Width(), m_Box.Height(), FXDIB_8bppMask);
- for (int row = m_Box.top; row < m_Box.bottom; row ++) {
- FX_LPBYTE dest_scan = new_dib->GetBuffer() + new_dib->GetPitch() * (row - m_Box.top);
- FX_LPBYTE src_scan = mask_dib->GetBuffer() + mask_dib->GetPitch() * (row - mask_rect.top);
- for (int col = m_Box.left; col < m_Box.right; col ++) {
- dest_scan[col - m_Box.left] = src_scan[col - mask_rect.left];
- }
- }
-}
-void CFX_ClipRgn::IntersectMaskF(int left, int top, CFX_DIBitmapRef Mask)
-{
- const CFX_DIBitmap* mask_dib = Mask;
- ASSERT(mask_dib->GetFormat() == FXDIB_8bppMask);
- FX_RECT mask_box(left, top, left + mask_dib->GetWidth(), top + mask_dib->GetHeight());
- if (m_Type == RectI) {
- IntersectMaskRect(m_Box, mask_box, Mask);
- return;
- }
- if (m_Type == MaskF) {
- FX_RECT new_box = m_Box;
- new_box.Intersect(mask_box);
- if (new_box.IsEmpty()) {
- m_Type = RectI;
- m_Mask.SetNull();
- m_Box = new_box;
- return;
- }
- CFX_DIBitmapRef new_mask;
- CFX_DIBitmap* new_dib = new_mask.New();
- if (!new_dib) {
- return;
- }
- new_dib->Create(new_box.Width(), new_box.Height(), FXDIB_8bppMask);
- const CFX_DIBitmap* old_dib = m_Mask;
- for (int row = new_box.top; row < new_box.bottom; row ++) {
- FX_LPBYTE old_scan = old_dib->GetBuffer() + (row - m_Box.top) * old_dib->GetPitch();
- FX_LPBYTE mask_scan = mask_dib->GetBuffer() + (row - top) * mask_dib->GetPitch();
- FX_LPBYTE new_scan = new_dib->GetBuffer() + (row - new_box.top) * new_dib->GetPitch();
- for (int col = new_box.left; col < new_box.right; col ++) {
- new_scan[col - new_box.left] = old_scan[col - m_Box.left] * mask_scan[col - left] / 255;
- }
- }
- m_Box = new_box;
- m_Mask = new_mask;
- return;
- }
- ASSERT(FALSE);
-}
-CFX_PathData::CFX_PathData()
-{
- m_PointCount = m_AllocCount = 0;
- m_pPoints = NULL;
-}
-CFX_PathData::~CFX_PathData()
-{
- if (m_pPoints) {
- FX_Free(m_pPoints);
- }
-}
-FX_BOOL CFX_PathData::SetPointCount(int nPoints)
-{
- m_PointCount = nPoints;
- if (m_AllocCount < nPoints) {
- if (m_pPoints) {
- FX_Free(m_pPoints);
- m_pPoints = NULL;
- }
- m_pPoints = FX_Alloc(FX_PATHPOINT, nPoints);
- if (!m_pPoints) {
- return FALSE;
- }
- m_AllocCount = nPoints;
- }
- return TRUE;
-}
-FX_BOOL CFX_PathData::AllocPointCount(int nPoints)
-{
- if (m_AllocCount < nPoints) {
- FX_PATHPOINT* pNewBuf = FX_Alloc(FX_PATHPOINT, nPoints);
- if (!pNewBuf) {
- return FALSE;
- }
- if (m_PointCount) {
- FXSYS_memcpy32(pNewBuf, m_pPoints, m_PointCount * sizeof(FX_PATHPOINT));
- }
- if (m_pPoints) {
- FX_Free(m_pPoints);
- }
- m_pPoints = pNewBuf;
- m_AllocCount = nPoints;
- }
- return TRUE;
-}
-CFX_PathData::CFX_PathData(const CFX_PathData& src)
-{
- m_pPoints = NULL;
- m_PointCount = m_AllocCount = src.m_PointCount;
- m_pPoints = FX_Alloc(FX_PATHPOINT, src.m_PointCount);
- if (!m_pPoints) {
- return;
- }
- FXSYS_memcpy32(m_pPoints, src.m_pPoints, sizeof(FX_PATHPOINT) * m_PointCount);
-}
-void CFX_PathData::TrimPoints(int nPoints)
-{
- if (m_PointCount <= nPoints) {
- return;
- }
- SetPointCount(nPoints);
-}
-FX_BOOL CFX_PathData::AddPointCount(int addPoints)
-{
- int new_count = m_PointCount + addPoints;
- if (!AllocPointCount(new_count)) {
- return FALSE;
- }
- m_PointCount = new_count;
- return TRUE;
-}
-FX_BOOL CFX_PathData::Append(const CFX_PathData* pSrc, const CFX_AffineMatrix* pMatrix)
-{
- int old_count = m_PointCount;
- if (!AddPointCount(pSrc->m_PointCount)) {
- return FALSE;
- }
- FXSYS_memcpy32(m_pPoints + old_count, pSrc->m_pPoints, pSrc->m_PointCount * sizeof(FX_PATHPOINT));
- if (pMatrix == NULL) {
- return TRUE;
- }
- for (int i = 0; i < pSrc->m_PointCount; i ++) {
- pMatrix->Transform(m_pPoints[old_count + i].m_PointX, m_pPoints[old_count + i].m_PointY);
- }
- return TRUE;
-}
-void CFX_PathData::SetPoint(int index, FX_FLOAT x, FX_FLOAT y, int flag)
-{
- ASSERT(index < m_PointCount);
- m_pPoints[index].m_PointX = x;
- m_pPoints[index].m_PointY = y;
- m_pPoints[index].m_Flag = flag;
-}
-FX_BOOL CFX_PathData::AppendRect(FX_FLOAT left, FX_FLOAT bottom, FX_FLOAT right, FX_FLOAT top)
-{
- int old_count = m_PointCount;
- if (!AddPointCount(5)) {
- return FALSE;
- }
- FX_PATHPOINT* pPoints = m_pPoints + old_count;
- pPoints[0].m_PointX = pPoints[1].m_PointX = pPoints[4].m_PointX = left;
- pPoints[2].m_PointX = pPoints[3].m_PointX = right;
- pPoints[0].m_PointY = pPoints[3].m_PointY = pPoints[4].m_PointY = bottom;
- pPoints[1].m_PointY = pPoints[2].m_PointY = top;
- pPoints[0].m_Flag = FXPT_MOVETO;
- pPoints[1].m_Flag = pPoints[2].m_Flag = pPoints[3].m_Flag = FXPT_LINETO;
- pPoints[4].m_Flag = FXPT_LINETO | FXPT_CLOSEFIGURE;
- return TRUE;
-}
-CFX_FloatRect CFX_PathData::GetBoundingBox() const
-{
- CFX_FloatRect rect;
- if (m_PointCount) {
- rect.InitRect(m_pPoints[0].m_PointX, m_pPoints[0].m_PointY);
- for (int i = 1; i < m_PointCount; i ++) {
- rect.UpdateRect(m_pPoints[i].m_PointX, m_pPoints[i].m_PointY);
- }
- }
- return rect;
-}
-static void _UpdateLineEndPoints(CFX_FloatRect& rect, FX_FLOAT start_x, FX_FLOAT start_y, FX_FLOAT end_x, FX_FLOAT end_y,
- FX_FLOAT hw)
-{
- if (start_x == end_x) {
- if (start_y == end_y) {
- rect.UpdateRect(end_x + hw, end_y + hw);
- rect.UpdateRect(end_x - hw, end_y - hw);
- return;
- }
- FX_FLOAT point_y;
- if (end_y < start_y) {
- point_y = end_y - hw;
- } else {
- point_y = end_y + hw;
- }
- rect.UpdateRect(end_x + hw, point_y);
- rect.UpdateRect(end_x - hw, point_y);
- return;
- } else if (start_y == end_y) {
- FX_FLOAT point_x;
- if (end_x < start_x) {
- point_x = end_x - hw;
- } else {
- point_x = end_x + hw;
- }
- rect.UpdateRect(point_x, end_y + hw);
- rect.UpdateRect(point_x, end_y - hw);
- return;
- }
- FX_FLOAT dx = end_x - start_x;
- FX_FLOAT dy = end_y - start_y;
- FX_FLOAT ll = FXSYS_sqrt2(dx, dy);
- FX_FLOAT mx = end_x + hw * dx / ll;
- FX_FLOAT my = end_y + hw * dy / ll;
- FX_FLOAT dx1 = hw * dy / ll;
- FX_FLOAT dy1 = hw * dx / ll;
- rect.UpdateRect(mx - dx1, my + dy1);
- rect.UpdateRect(mx + dx1, my - dy1);
-}
-static void _UpdateLineJoinPoints(CFX_FloatRect& rect, FX_FLOAT start_x, FX_FLOAT start_y,
- FX_FLOAT middle_x, FX_FLOAT middle_y, FX_FLOAT end_x, FX_FLOAT end_y,
- FX_FLOAT half_width, FX_FLOAT miter_limit)
-{
- FX_FLOAT start_k = 0, start_c = 0, end_k = 0, end_c = 0, start_len = 0, start_dc = 0, end_len = 0, end_dc = 0;
- FX_BOOL bStartVert = FXSYS_fabs(start_x - middle_x) < 1.0f / 20;
- FX_BOOL bEndVert = FXSYS_fabs(middle_x - end_x) < 1.0f / 20;
- if (bStartVert && bEndVert) {
- int start_dir = middle_y > start_y ? 1 : -1;
- FX_FLOAT point_y = middle_y + half_width * start_dir;
- rect.UpdateRect(middle_x + half_width, point_y);
- rect.UpdateRect(middle_x - half_width, point_y);
- return;
- }
- if (!bStartVert) {
- start_k = FXSYS_Div(middle_y - start_y, middle_x - start_x);
- start_c = middle_y - FXSYS_Mul(start_k, middle_x);
- start_len = FXSYS_sqrt2(start_x - middle_x, start_y - middle_y);
- start_dc = (FX_FLOAT)FXSYS_fabs(FXSYS_MulDiv(half_width, start_len, start_x - middle_x));
- }
- if (!bEndVert) {
- end_k = FXSYS_Div(end_y - middle_y, end_x - middle_x);
- end_c = middle_y - FXSYS_Mul(end_k, middle_x);
- end_len = FXSYS_sqrt2(end_x - middle_x, end_y - middle_y);
- end_dc = (FX_FLOAT)FXSYS_fabs(FXSYS_MulDiv(half_width, end_len, end_x - middle_x));
- }
- if (bStartVert) {
- FX_FLOAT outside_x = start_x;
- if (end_x < start_x) {
- outside_x += half_width;
- } else {
- outside_x -= half_width;
- }
- FX_FLOAT outside_y;
- if (start_y < FXSYS_Mul(end_k, start_x) + end_c) {
- outside_y = FXSYS_Mul(end_k, outside_x) + end_c + end_dc;
- } else {
- outside_y = FXSYS_Mul(end_k, outside_x) + end_c - end_dc;
- }
- rect.UpdateRect(outside_x, outside_y);
- return;
- }
- if (bEndVert) {
- FX_FLOAT outside_x = end_x;
- if (start_x < end_x) {
- outside_x += half_width;
- } else {
- outside_x -= half_width;
- }
- FX_FLOAT outside_y;
- if (end_y < FXSYS_Mul(start_k, end_x) + start_c) {
- outside_y = FXSYS_Mul(start_k, outside_x) + start_c + start_dc;
- } else {
- outside_y = FXSYS_Mul(start_k, outside_x) + start_c - start_dc;
- }
- rect.UpdateRect(outside_x, outside_y);
- return;
- }
- if (FXSYS_fabs(start_k - end_k) < 1.0f / 20) {
- int start_dir = middle_x > start_x ? 1 : -1;
- int end_dir = end_x > middle_x ? 1 : -1;
- if (start_dir == end_dir) {
- _UpdateLineEndPoints(rect, middle_x, middle_y, end_x, end_y, half_width);
- } else {
- _UpdateLineEndPoints(rect, start_x, start_y, middle_x, middle_y, half_width);
- }
- return;
- }
- FX_FLOAT start_outside_c = start_c;
- if (end_y < FXSYS_Mul(start_k, end_x) + start_c) {
- start_outside_c += start_dc;
- } else {
- start_outside_c -= start_dc;
- }
- FX_FLOAT end_outside_c = end_c;
- if (start_y < FXSYS_Mul(end_k, start_x) + end_c) {
- end_outside_c += end_dc;
- } else {
- end_outside_c -= end_dc;
- }
- FX_FLOAT join_x = FXSYS_Div(end_outside_c - start_outside_c, start_k - end_k);
- FX_FLOAT join_y = FXSYS_Mul(start_k, join_x) + start_outside_c;
- rect.UpdateRect(join_x, join_y);
-}
-CFX_FloatRect CFX_PathData::GetBoundingBox(FX_FLOAT line_width, FX_FLOAT miter_limit) const
-{
- CFX_FloatRect rect(100000 * 1.0f, 100000 * 1.0f, -100000 * 1.0f, -100000 * 1.0f);
- int iPoint = 0;
- FX_FLOAT half_width = line_width;
- int iStartPoint, iEndPoint, iMiddlePoint;
- FX_BOOL bJoin;
- while (iPoint < m_PointCount) {
- if (m_pPoints[iPoint].m_Flag == FXPT_MOVETO) {
- iStartPoint = iPoint + 1;
- iEndPoint = iPoint;
- bJoin = FALSE;
- } else {
- if (m_pPoints[iPoint].m_Flag == FXPT_BEZIERTO) {
- rect.UpdateRect(m_pPoints[iPoint].m_PointX, m_pPoints[iPoint].m_PointY);
- rect.UpdateRect(m_pPoints[iPoint + 1].m_PointX, m_pPoints[iPoint + 1].m_PointY);
- iPoint += 2;
- }
- if (iPoint == m_PointCount - 1 || m_pPoints[iPoint + 1].m_Flag == FXPT_MOVETO) {
- iStartPoint = iPoint - 1;
- iEndPoint = iPoint;
- bJoin = FALSE;
- } else {
- iStartPoint = iPoint - 1;
- iMiddlePoint = iPoint;
- iEndPoint = iPoint + 1;
- bJoin = TRUE;
- }
- }
- FX_FLOAT start_x = m_pPoints[iStartPoint].m_PointX;
- FX_FLOAT start_y = m_pPoints[iStartPoint].m_PointY;
- FX_FLOAT end_x = m_pPoints[iEndPoint].m_PointX;
- FX_FLOAT end_y = m_pPoints[iEndPoint].m_PointY;
- if (bJoin) {
- FX_FLOAT middle_x = m_pPoints[iMiddlePoint].m_PointX;
- FX_FLOAT middle_y = m_pPoints[iMiddlePoint].m_PointY;
- _UpdateLineJoinPoints(rect, start_x, start_y, middle_x, middle_y, end_x, end_y, half_width, miter_limit);
- } else {
- _UpdateLineEndPoints(rect, start_x, start_y, end_x, end_y, half_width);
- }
- iPoint ++;
- }
- return rect;
-}
-void CFX_PathData::Transform(const CFX_AffineMatrix* pMatrix)
-{
- if (pMatrix == NULL) {
- return;
- }
- for (int i = 0; i < m_PointCount; i ++) {
- pMatrix->Transform(m_pPoints[i].m_PointX, m_pPoints[i].m_PointY);
- }
-}
-const int g_Distant[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
-FX_BOOL CFX_PathData::GetZeroAreaPath(CFX_PathData& NewPath, CFX_AffineMatrix* pMatrix, FX_BOOL&bThin, FX_BOOL bAdjust) const
-{
- if (m_PointCount < 3) {
- return FALSE;
- }
- if (m_PointCount == 3 && (m_pPoints[0].m_Flag & FXPT_TYPE) == FXPT_MOVETO &&
- (m_pPoints[1].m_Flag & FXPT_TYPE) == FXPT_LINETO && (m_pPoints[2].m_Flag & FXPT_TYPE) == FXPT_LINETO
- && m_pPoints[0].m_PointX == m_pPoints[2].m_PointX && m_pPoints[0].m_PointY == m_pPoints[2].m_PointY) {
- NewPath.AddPointCount(2);
- if (bAdjust) {
- if (pMatrix) {
- FX_FLOAT x = m_pPoints[0].m_PointX, y = m_pPoints[0].m_PointY;
- pMatrix->TransformPoint(x, y);
- x = (int)x + 0.5f;
- y = (int)y + 0.5f;
- NewPath.SetPoint(0, x, y, FXPT_MOVETO);
- x = m_pPoints[1].m_PointX, y = m_pPoints[1].m_PointY;
- pMatrix->TransformPoint(x, y);
- x = (int)x + 0.5f;
- y = (int)y + 0.5f;
- NewPath.SetPoint(1, x, y, FXPT_LINETO);
- pMatrix->SetIdentity();
- } else {
- FX_FLOAT x = (int)m_pPoints[0].m_PointX + 0.5f, y = (int)m_pPoints[0].m_PointY + 0.5f;
- NewPath.SetPoint(0, x, y, FXPT_MOVETO);
- x = (int)m_pPoints[1].m_PointX + 0.5f, y = (int)m_pPoints[1].m_PointY + 0.5f;
- NewPath.SetPoint(1, x, y, FXPT_LINETO);
- }
- } else {
- NewPath.SetPoint(0, m_pPoints[0].m_PointX, m_pPoints[0].m_PointY, FXPT_MOVETO);
- NewPath.SetPoint(1, m_pPoints[1].m_PointX, m_pPoints[1].m_PointY, FXPT_LINETO);
- }
- if (m_pPoints[0].m_PointX != m_pPoints[1].m_PointX && m_pPoints[0].m_PointY != m_pPoints[1].m_PointY) {
- bThin = TRUE;
- }
- return TRUE;
- }
- if (((m_PointCount > 3) && (m_PointCount % 2))) {
- int mid = m_PointCount / 2;
- FX_BOOL bZeroArea = FALSE;
- CFX_PathData t_path;
- for (int i = 0; i < mid; i++) {
- if (!(m_pPoints[mid - i - 1].m_PointX == m_pPoints[mid + i + 1].m_PointX
- && m_pPoints[mid - i - 1].m_PointY == m_pPoints[mid + i + 1].m_PointY &&
- ((m_pPoints[mid - i - 1].m_Flag & FXPT_TYPE) != FXPT_BEZIERTO && (m_pPoints[mid + i + 1].m_Flag & FXPT_TYPE) != FXPT_BEZIERTO))) {
- bZeroArea = TRUE;
- break;
- }
- int new_count = t_path.GetPointCount();
- t_path.AddPointCount(2);
- t_path.SetPoint(new_count, m_pPoints[mid - i].m_PointX, m_pPoints[mid - i].m_PointY, FXPT_MOVETO);
- t_path.SetPoint(new_count + 1, m_pPoints[mid - i - 1].m_PointX, m_pPoints[mid - i - 1].m_PointY, FXPT_LINETO);
- }
- if (!bZeroArea) {
- NewPath.Append(&t_path, NULL);
- bThin = TRUE;
- return TRUE;
- }
- }
- int stratPoint = 0;
- int next = 0, i;
- for (i = 0; i < m_PointCount; i++) {
- int point_type = m_pPoints[i].m_Flag & FXPT_TYPE;
- if (point_type == FXPT_MOVETO) {
- stratPoint = i;
- } else if (point_type == FXPT_LINETO) {
- next = (i + 1 - stratPoint) % (m_PointCount - stratPoint) + stratPoint;
- if ((m_pPoints[next].m_Flag & FXPT_TYPE) != FXPT_BEZIERTO && (m_pPoints[next].m_Flag & FXPT_TYPE) != FXPT_MOVETO) {
- if((m_pPoints[i - 1].m_PointX == m_pPoints[i].m_PointX && m_pPoints[i].m_PointX == m_pPoints[next].m_PointX)
- && ((m_pPoints[i].m_PointY - m_pPoints[i - 1].m_PointY) * (m_pPoints[i].m_PointY - m_pPoints[next].m_PointY) > 0)) {
- int pre = i;
- if (FXSYS_fabs(m_pPoints[i].m_PointY - m_pPoints[i - 1].m_PointY)
- < FXSYS_fabs(m_pPoints[i].m_PointY - m_pPoints[next].m_PointY)) {
- pre --;
- next--;
- }
- int new_count = NewPath.GetPointCount();
- NewPath.AddPointCount(2);
- NewPath.SetPoint(new_count, m_pPoints[pre].m_PointX, m_pPoints[pre].m_PointY, FXPT_MOVETO);
- NewPath.SetPoint(new_count + 1, m_pPoints[next].m_PointX, m_pPoints[next].m_PointY, FXPT_LINETO);
- } else if((m_pPoints[i - 1].m_PointY == m_pPoints[i].m_PointY && m_pPoints[i].m_PointY == m_pPoints[next].m_PointY)
- && ((m_pPoints[i].m_PointX - m_pPoints[i - 1].m_PointX) * (m_pPoints[i].m_PointX - m_pPoints[next].m_PointX) > 0)) {
- int pre = i;
- if (FXSYS_fabs(m_pPoints[i].m_PointX - m_pPoints[i - 1].m_PointX)
- < FXSYS_fabs(m_pPoints[i].m_PointX - m_pPoints[next].m_PointX)) {
- pre --;
- next--;
- }
- int new_count = NewPath.GetPointCount();
- NewPath.AddPointCount(2);
- NewPath.SetPoint(new_count, m_pPoints[pre].m_PointX, m_pPoints[pre].m_PointY, FXPT_MOVETO);
- NewPath.SetPoint(new_count + 1, m_pPoints[next].m_PointX, m_pPoints[next].m_PointY, FXPT_LINETO);
- } else if ((m_pPoints[i - 1].m_Flag & FXPT_TYPE) == FXPT_MOVETO && (m_pPoints[next].m_Flag & FXPT_TYPE) == FXPT_LINETO &&
- m_pPoints[i - 1].m_PointX == m_pPoints[next].m_PointX && m_pPoints[i - 1].m_PointY == m_pPoints[next].m_PointY
- && m_pPoints[next].m_Flag & FXPT_CLOSEFIGURE) {
- int new_count = NewPath.GetPointCount();
- NewPath.AddPointCount(2);
- NewPath.SetPoint(new_count, m_pPoints[i - 1].m_PointX, m_pPoints[i - 1].m_PointY, FXPT_MOVETO);
- NewPath.SetPoint(new_count + 1, m_pPoints[i].m_PointX, m_pPoints[i].m_PointY, FXPT_LINETO);
- bThin = TRUE;
- }
- }
- } else if (point_type == FXPT_BEZIERTO) {
- i += 2;
- continue;
- }
- }
- if (m_PointCount > 3 && NewPath.GetPointCount()) {
- bThin = TRUE;
- }
- if (NewPath.GetPointCount() == 0) {
- return FALSE;
- }
- return TRUE;
-}
-FX_BOOL CFX_PathData::IsRect() const
-{
- if (m_PointCount != 5 && m_PointCount != 4) {
- return FALSE;
- }
- if ((m_PointCount == 5 && (m_pPoints[0].m_PointX != m_pPoints[4].m_PointX ||
- m_pPoints[0].m_PointY != m_pPoints[4].m_PointY)) ||
- (m_pPoints[0].m_PointX == m_pPoints[2].m_PointX && m_pPoints[0].m_PointY == m_pPoints[2].m_PointY) ||
- (m_pPoints[1].m_PointX == m_pPoints[3].m_PointX && m_pPoints[1].m_PointY == m_pPoints[3].m_PointY)) {
- return FALSE;
- }
- if (m_pPoints[0].m_PointX != m_pPoints[3].m_PointX && m_pPoints[0].m_PointY != m_pPoints[3].m_PointY) {
- return FALSE;
- }
- for (int i = 1; i < 4; i ++) {
- if ((m_pPoints[i].m_Flag & FXPT_TYPE) != FXPT_LINETO) {
- return FALSE;
- }
- if (m_pPoints[i].m_PointX != m_pPoints[i - 1].m_PointX && m_pPoints[i].m_PointY != m_pPoints[i - 1].m_PointY) {
- return FALSE;
- }
- }
- return m_PointCount == 5 || (m_pPoints[3].m_Flag & FXPT_CLOSEFIGURE);
-}
-FX_BOOL CFX_PathData::IsRect(const CFX_AffineMatrix* pMatrix, CFX_FloatRect* pRect) const
-{
- if (pMatrix == NULL) {
- if (!IsRect()) {
- return FALSE;
- }
- if (pRect) {
- pRect->left = m_pPoints[0].m_PointX;
- pRect->right = m_pPoints[2].m_PointX;
- pRect->bottom = m_pPoints[0].m_PointY;
- pRect->top = m_pPoints[2].m_PointY;
- pRect->Normalize();
- }
- return TRUE;
- }
- if (m_PointCount != 5 && m_PointCount != 4) {
- return FALSE;
- }
- if ((m_PointCount == 5 && (m_pPoints[0].m_PointX != m_pPoints[4].m_PointX || m_pPoints[0].m_PointY != m_pPoints[4].m_PointY)) ||
- (m_pPoints[1].m_PointX == m_pPoints[3].m_PointX && m_pPoints[1].m_PointY == m_pPoints[3].m_PointY)) {
- return FALSE;
- }
- if (m_PointCount == 4 && m_pPoints[0].m_PointX != m_pPoints[3].m_PointX && m_pPoints[0].m_PointY != m_pPoints[3].m_PointY) {
- return FALSE;
- }
- FX_FLOAT x[5], y[5];
- for (int i = 0; i < m_PointCount; i ++) {
- pMatrix->Transform(m_pPoints[i].m_PointX, m_pPoints[i].m_PointY, x[i], y[i]);
- if (i) {
- if ((m_pPoints[i].m_Flag & FXPT_TYPE) != FXPT_LINETO) {
- return FALSE;
- }
- if (x[i] != x[i - 1] && y[i] != y[i - 1]) {
- return FALSE;
- }
- }
- }
- if (pRect) {
- pRect->left = x[0];
- pRect->right = x[2];
- pRect->bottom = y[0];
- pRect->top = y[2];
- pRect->Normalize();
- }
- return TRUE;
-}
-FX_BOOL CFX_PathData::Copy(const CFX_PathData &src)
-{
- if (!SetPointCount(src.m_PointCount)) {
- return FALSE;
- }
- FXSYS_memcpy32(m_pPoints, src.m_pPoints, sizeof(FX_PATHPOINT) * m_PointCount);
- return TRUE;
-}
-CFX_GraphStateData::CFX_GraphStateData()
-{
- m_LineCap = LineCapButt;
- m_DashCount = 0;
- m_DashArray = NULL;
- m_DashPhase = 0;
- m_LineJoin = LineJoinMiter;
- m_MiterLimit = 10 * 1.0f;
- m_LineWidth = 1.0f;
-}
-CFX_GraphStateData::CFX_GraphStateData(const CFX_GraphStateData& src)
-{
- m_DashArray = NULL;
- Copy(src);
-}
-void CFX_GraphStateData::Copy(const CFX_GraphStateData& src)
-{
- m_LineCap = src.m_LineCap;
- m_DashCount = src.m_DashCount;
- if (m_DashArray) {
- FX_Free(m_DashArray);
- }
- m_DashArray = NULL;
- m_DashPhase = src.m_DashPhase;
- m_LineJoin = src.m_LineJoin;
- m_MiterLimit = src.m_MiterLimit;
- m_LineWidth = src.m_LineWidth;
- if (m_DashCount) {
- m_DashArray = FX_Alloc(FX_FLOAT, m_DashCount);
- if (!m_DashArray) {
- return;
- }
- FXSYS_memcpy32(m_DashArray, src.m_DashArray, m_DashCount * sizeof(FX_FLOAT));
- }
-}
-CFX_GraphStateData::~CFX_GraphStateData()
-{
- if (m_DashArray) {
- FX_Free(m_DashArray);
- }
-}
-void CFX_GraphStateData::SetDashCount(int count)
-{
- if (m_DashArray) {
- FX_Free(m_DashArray);
- }
- m_DashArray = NULL;
- m_DashCount = count;
- if (count == 0) {
- return;
- }
- m_DashArray = FX_Alloc(FX_FLOAT, count);
-}
+// 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
+
+#include "../../../include/fxcrt/fx_basic.h"
+#include "../../../include/fxge/fx_ge.h"
+CFX_ClipRgn::CFX_ClipRgn(int width, int height)
+{
+ m_Type = RectI;
+ m_Box.left = m_Box.top = 0;
+ m_Box.right = width;
+ m_Box.bottom = height;
+}
+CFX_ClipRgn::CFX_ClipRgn(const FX_RECT& rect)
+{
+ m_Type = RectI;
+ m_Box = rect;
+}
+CFX_ClipRgn::CFX_ClipRgn(const CFX_ClipRgn& src)
+{
+ m_Type = src.m_Type;
+ m_Box = src.m_Box;
+ m_Mask = src.m_Mask;
+}
+CFX_ClipRgn::~CFX_ClipRgn()
+{
+}
+void CFX_ClipRgn::Reset(const FX_RECT& rect)
+{
+ m_Type = RectI;
+ m_Box = rect;
+ m_Mask.SetNull();
+}
+void CFX_ClipRgn::IntersectRect(const FX_RECT& rect)
+{
+ if (m_Type == RectI) {
+ m_Box.Intersect(rect);
+ return;
+ }
+ if (m_Type == MaskF) {
+ IntersectMaskRect(rect, m_Box, m_Mask);
+ return;
+ }
+}
+void CFX_ClipRgn::IntersectMaskRect(FX_RECT rect, FX_RECT mask_rect, CFX_DIBitmapRef Mask)
+{
+ const CFX_DIBitmap* mask_dib = Mask;
+ m_Type = MaskF;
+ m_Box = rect;
+ m_Box.Intersect(mask_rect);
+ if (m_Box.IsEmpty()) {
+ m_Type = RectI;
+ return;
+ } else if (m_Box == mask_rect) {
+ m_Mask = Mask;
+ return;
+ }
+ CFX_DIBitmap* new_dib = m_Mask.New();
+ if (!new_dib) {
+ return;
+ }
+ new_dib->Create(m_Box.Width(), m_Box.Height(), FXDIB_8bppMask);
+ for (int row = m_Box.top; row < m_Box.bottom; row ++) {
+ FX_LPBYTE dest_scan = new_dib->GetBuffer() + new_dib->GetPitch() * (row - m_Box.top);
+ FX_LPBYTE src_scan = mask_dib->GetBuffer() + mask_dib->GetPitch() * (row - mask_rect.top);
+ for (int col = m_Box.left; col < m_Box.right; col ++) {
+ dest_scan[col - m_Box.left] = src_scan[col - mask_rect.left];
+ }
+ }
+}
+void CFX_ClipRgn::IntersectMaskF(int left, int top, CFX_DIBitmapRef Mask)
+{
+ const CFX_DIBitmap* mask_dib = Mask;
+ ASSERT(mask_dib->GetFormat() == FXDIB_8bppMask);
+ FX_RECT mask_box(left, top, left + mask_dib->GetWidth(), top + mask_dib->GetHeight());
+ if (m_Type == RectI) {
+ IntersectMaskRect(m_Box, mask_box, Mask);
+ return;
+ }
+ if (m_Type == MaskF) {
+ FX_RECT new_box = m_Box;
+ new_box.Intersect(mask_box);
+ if (new_box.IsEmpty()) {
+ m_Type = RectI;
+ m_Mask.SetNull();
+ m_Box = new_box;
+ return;
+ }
+ CFX_DIBitmapRef new_mask;
+ CFX_DIBitmap* new_dib = new_mask.New();
+ if (!new_dib) {
+ return;
+ }
+ new_dib->Create(new_box.Width(), new_box.Height(), FXDIB_8bppMask);
+ const CFX_DIBitmap* old_dib = m_Mask;
+ for (int row = new_box.top; row < new_box.bottom; row ++) {
+ FX_LPBYTE old_scan = old_dib->GetBuffer() + (row - m_Box.top) * old_dib->GetPitch();
+ FX_LPBYTE mask_scan = mask_dib->GetBuffer() + (row - top) * mask_dib->GetPitch();
+ FX_LPBYTE new_scan = new_dib->GetBuffer() + (row - new_box.top) * new_dib->GetPitch();
+ for (int col = new_box.left; col < new_box.right; col ++) {
+ new_scan[col - new_box.left] = old_scan[col - m_Box.left] * mask_scan[col - left] / 255;
+ }
+ }
+ m_Box = new_box;
+ m_Mask = new_mask;
+ return;
+ }
+ ASSERT(FALSE);
+}
+CFX_PathData::CFX_PathData()
+{
+ m_PointCount = m_AllocCount = 0;
+ m_pPoints = NULL;
+}
+CFX_PathData::~CFX_PathData()
+{
+ if (m_pPoints) {
+ FX_Free(m_pPoints);
+ }
+}
+FX_BOOL CFX_PathData::SetPointCount(int nPoints)
+{
+ m_PointCount = nPoints;
+ if (m_AllocCount < nPoints) {
+ if (m_pPoints) {
+ FX_Free(m_pPoints);
+ m_pPoints = NULL;
+ }
+ m_pPoints = FX_Alloc(FX_PATHPOINT, nPoints);
+ if (!m_pPoints) {
+ return FALSE;
+ }
+ m_AllocCount = nPoints;
+ }
+ return TRUE;
+}
+FX_BOOL CFX_PathData::AllocPointCount(int nPoints)
+{
+ if (m_AllocCount < nPoints) {
+ FX_PATHPOINT* pNewBuf = FX_Alloc(FX_PATHPOINT, nPoints);
+ if (!pNewBuf) {
+ return FALSE;
+ }
+ if (m_PointCount) {
+ FXSYS_memcpy32(pNewBuf, m_pPoints, m_PointCount * sizeof(FX_PATHPOINT));
+ }
+ if (m_pPoints) {
+ FX_Free(m_pPoints);
+ }
+ m_pPoints = pNewBuf;
+ m_AllocCount = nPoints;
+ }
+ return TRUE;
+}
+CFX_PathData::CFX_PathData(const CFX_PathData& src)
+{
+ m_pPoints = NULL;
+ m_PointCount = m_AllocCount = src.m_PointCount;
+ m_pPoints = FX_Alloc(FX_PATHPOINT, src.m_PointCount);
+ if (!m_pPoints) {
+ return;
+ }
+ FXSYS_memcpy32(m_pPoints, src.m_pPoints, sizeof(FX_PATHPOINT) * m_PointCount);
+}
+void CFX_PathData::TrimPoints(int nPoints)
+{
+ if (m_PointCount <= nPoints) {
+ return;
+ }
+ SetPointCount(nPoints);
+}
+FX_BOOL CFX_PathData::AddPointCount(int addPoints)
+{
+ int new_count = m_PointCount + addPoints;
+ if (!AllocPointCount(new_count)) {
+ return FALSE;
+ }
+ m_PointCount = new_count;
+ return TRUE;
+}
+FX_BOOL CFX_PathData::Append(const CFX_PathData* pSrc, const CFX_AffineMatrix* pMatrix)
+{
+ int old_count = m_PointCount;
+ if (!AddPointCount(pSrc->m_PointCount)) {
+ return FALSE;
+ }
+ FXSYS_memcpy32(m_pPoints + old_count, pSrc->m_pPoints, pSrc->m_PointCount * sizeof(FX_PATHPOINT));
+ if (pMatrix == NULL) {
+ return TRUE;
+ }
+ for (int i = 0; i < pSrc->m_PointCount; i ++) {
+ pMatrix->Transform(m_pPoints[old_count + i].m_PointX, m_pPoints[old_count + i].m_PointY);
+ }
+ return TRUE;
+}
+void CFX_PathData::SetPoint(int index, FX_FLOAT x, FX_FLOAT y, int flag)
+{
+ ASSERT(index < m_PointCount);
+ m_pPoints[index].m_PointX = x;
+ m_pPoints[index].m_PointY = y;
+ m_pPoints[index].m_Flag = flag;
+}
+FX_BOOL CFX_PathData::AppendRect(FX_FLOAT left, FX_FLOAT bottom, FX_FLOAT right, FX_FLOAT top)
+{
+ int old_count = m_PointCount;
+ if (!AddPointCount(5)) {
+ return FALSE;
+ }
+ FX_PATHPOINT* pPoints = m_pPoints + old_count;
+ pPoints[0].m_PointX = pPoints[1].m_PointX = pPoints[4].m_PointX = left;
+ pPoints[2].m_PointX = pPoints[3].m_PointX = right;
+ pPoints[0].m_PointY = pPoints[3].m_PointY = pPoints[4].m_PointY = bottom;
+ pPoints[1].m_PointY = pPoints[2].m_PointY = top;
+ pPoints[0].m_Flag = FXPT_MOVETO;
+ pPoints[1].m_Flag = pPoints[2].m_Flag = pPoints[3].m_Flag = FXPT_LINETO;
+ pPoints[4].m_Flag = FXPT_LINETO | FXPT_CLOSEFIGURE;
+ return TRUE;
+}
+CFX_FloatRect CFX_PathData::GetBoundingBox() const
+{
+ CFX_FloatRect rect;
+ if (m_PointCount) {
+ rect.InitRect(m_pPoints[0].m_PointX, m_pPoints[0].m_PointY);
+ for (int i = 1; i < m_PointCount; i ++) {
+ rect.UpdateRect(m_pPoints[i].m_PointX, m_pPoints[i].m_PointY);
+ }
+ }
+ return rect;
+}
+static void _UpdateLineEndPoints(CFX_FloatRect& rect, FX_FLOAT start_x, FX_FLOAT start_y, FX_FLOAT end_x, FX_FLOAT end_y,
+ FX_FLOAT hw)
+{
+ if (start_x == end_x) {
+ if (start_y == end_y) {
+ rect.UpdateRect(end_x + hw, end_y + hw);
+ rect.UpdateRect(end_x - hw, end_y - hw);
+ return;
+ }
+ FX_FLOAT point_y;
+ if (end_y < start_y) {
+ point_y = end_y - hw;
+ } else {
+ point_y = end_y + hw;
+ }
+ rect.UpdateRect(end_x + hw, point_y);
+ rect.UpdateRect(end_x - hw, point_y);
+ return;
+ } else if (start_y == end_y) {
+ FX_FLOAT point_x;
+ if (end_x < start_x) {
+ point_x = end_x - hw;
+ } else {
+ point_x = end_x + hw;
+ }
+ rect.UpdateRect(point_x, end_y + hw);
+ rect.UpdateRect(point_x, end_y - hw);
+ return;
+ }
+ FX_FLOAT dx = end_x - start_x;
+ FX_FLOAT dy = end_y - start_y;
+ FX_FLOAT ll = FXSYS_sqrt2(dx, dy);
+ FX_FLOAT mx = end_x + hw * dx / ll;
+ FX_FLOAT my = end_y + hw * dy / ll;
+ FX_FLOAT dx1 = hw * dy / ll;
+ FX_FLOAT dy1 = hw * dx / ll;
+ rect.UpdateRect(mx - dx1, my + dy1);
+ rect.UpdateRect(mx + dx1, my - dy1);
+}
+static void _UpdateLineJoinPoints(CFX_FloatRect& rect, FX_FLOAT start_x, FX_FLOAT start_y,
+ FX_FLOAT middle_x, FX_FLOAT middle_y, FX_FLOAT end_x, FX_FLOAT end_y,
+ FX_FLOAT half_width, FX_FLOAT miter_limit)
+{
+ FX_FLOAT start_k = 0, start_c = 0, end_k = 0, end_c = 0, start_len = 0, start_dc = 0, end_len = 0, end_dc = 0;
+ FX_BOOL bStartVert = FXSYS_fabs(start_x - middle_x) < 1.0f / 20;
+ FX_BOOL bEndVert = FXSYS_fabs(middle_x - end_x) < 1.0f / 20;
+ if (bStartVert && bEndVert) {
+ int start_dir = middle_y > start_y ? 1 : -1;
+ FX_FLOAT point_y = middle_y + half_width * start_dir;
+ rect.UpdateRect(middle_x + half_width, point_y);
+ rect.UpdateRect(middle_x - half_width, point_y);
+ return;
+ }
+ if (!bStartVert) {
+ start_k = FXSYS_Div(middle_y - start_y, middle_x - start_x);
+ start_c = middle_y - FXSYS_Mul(start_k, middle_x);
+ start_len = FXSYS_sqrt2(start_x - middle_x, start_y - middle_y);
+ start_dc = (FX_FLOAT)FXSYS_fabs(FXSYS_MulDiv(half_width, start_len, start_x - middle_x));
+ }
+ if (!bEndVert) {
+ end_k = FXSYS_Div(end_y - middle_y, end_x - middle_x);
+ end_c = middle_y - FXSYS_Mul(end_k, middle_x);
+ end_len = FXSYS_sqrt2(end_x - middle_x, end_y - middle_y);
+ end_dc = (FX_FLOAT)FXSYS_fabs(FXSYS_MulDiv(half_width, end_len, end_x - middle_x));
+ }
+ if (bStartVert) {
+ FX_FLOAT outside_x = start_x;
+ if (end_x < start_x) {
+ outside_x += half_width;
+ } else {
+ outside_x -= half_width;
+ }
+ FX_FLOAT outside_y;
+ if (start_y < FXSYS_Mul(end_k, start_x) + end_c) {
+ outside_y = FXSYS_Mul(end_k, outside_x) + end_c + end_dc;
+ } else {
+ outside_y = FXSYS_Mul(end_k, outside_x) + end_c - end_dc;
+ }
+ rect.UpdateRect(outside_x, outside_y);
+ return;
+ }
+ if (bEndVert) {
+ FX_FLOAT outside_x = end_x;
+ if (start_x < end_x) {
+ outside_x += half_width;
+ } else {
+ outside_x -= half_width;
+ }
+ FX_FLOAT outside_y;
+ if (end_y < FXSYS_Mul(start_k, end_x) + start_c) {
+ outside_y = FXSYS_Mul(start_k, outside_x) + start_c + start_dc;
+ } else {
+ outside_y = FXSYS_Mul(start_k, outside_x) + start_c - start_dc;
+ }
+ rect.UpdateRect(outside_x, outside_y);
+ return;
+ }
+ if (FXSYS_fabs(start_k - end_k) < 1.0f / 20) {
+ int start_dir = middle_x > start_x ? 1 : -1;
+ int end_dir = end_x > middle_x ? 1 : -1;
+ if (start_dir == end_dir) {
+ _UpdateLineEndPoints(rect, middle_x, middle_y, end_x, end_y, half_width);
+ } else {
+ _UpdateLineEndPoints(rect, start_x, start_y, middle_x, middle_y, half_width);
+ }
+ return;
+ }
+ FX_FLOAT start_outside_c = start_c;
+ if (end_y < FXSYS_Mul(start_k, end_x) + start_c) {
+ start_outside_c += start_dc;
+ } else {
+ start_outside_c -= start_dc;
+ }
+ FX_FLOAT end_outside_c = end_c;
+ if (start_y < FXSYS_Mul(end_k, start_x) + end_c) {
+ end_outside_c += end_dc;
+ } else {
+ end_outside_c -= end_dc;
+ }
+ FX_FLOAT join_x = FXSYS_Div(end_outside_c - start_outside_c, start_k - end_k);
+ FX_FLOAT join_y = FXSYS_Mul(start_k, join_x) + start_outside_c;
+ rect.UpdateRect(join_x, join_y);
+}
+CFX_FloatRect CFX_PathData::GetBoundingBox(FX_FLOAT line_width, FX_FLOAT miter_limit) const
+{
+ CFX_FloatRect rect(100000 * 1.0f, 100000 * 1.0f, -100000 * 1.0f, -100000 * 1.0f);
+ int iPoint = 0;
+ FX_FLOAT half_width = line_width;
+ int iStartPoint, iEndPoint, iMiddlePoint;
+ FX_BOOL bJoin;
+ while (iPoint < m_PointCount) {
+ if (m_pPoints[iPoint].m_Flag == FXPT_MOVETO) {
+ iStartPoint = iPoint + 1;
+ iEndPoint = iPoint;
+ bJoin = FALSE;
+ } else {
+ if (m_pPoints[iPoint].m_Flag == FXPT_BEZIERTO) {
+ rect.UpdateRect(m_pPoints[iPoint].m_PointX, m_pPoints[iPoint].m_PointY);
+ rect.UpdateRect(m_pPoints[iPoint + 1].m_PointX, m_pPoints[iPoint + 1].m_PointY);
+ iPoint += 2;
+ }
+ if (iPoint == m_PointCount - 1 || m_pPoints[iPoint + 1].m_Flag == FXPT_MOVETO) {
+ iStartPoint = iPoint - 1;
+ iEndPoint = iPoint;
+ bJoin = FALSE;
+ } else {
+ iStartPoint = iPoint - 1;
+ iMiddlePoint = iPoint;
+ iEndPoint = iPoint + 1;
+ bJoin = TRUE;
+ }
+ }
+ FX_FLOAT start_x = m_pPoints[iStartPoint].m_PointX;
+ FX_FLOAT start_y = m_pPoints[iStartPoint].m_PointY;
+ FX_FLOAT end_x = m_pPoints[iEndPoint].m_PointX;
+ FX_FLOAT end_y = m_pPoints[iEndPoint].m_PointY;
+ if (bJoin) {
+ FX_FLOAT middle_x = m_pPoints[iMiddlePoint].m_PointX;
+ FX_FLOAT middle_y = m_pPoints[iMiddlePoint].m_PointY;
+ _UpdateLineJoinPoints(rect, start_x, start_y, middle_x, middle_y, end_x, end_y, half_width, miter_limit);
+ } else {
+ _UpdateLineEndPoints(rect, start_x, start_y, end_x, end_y, half_width);
+ }
+ iPoint ++;
+ }
+ return rect;
+}
+void CFX_PathData::Transform(const CFX_AffineMatrix* pMatrix)
+{
+ if (pMatrix == NULL) {
+ return;
+ }
+ for (int i = 0; i < m_PointCount; i ++) {
+ pMatrix->Transform(m_pPoints[i].m_PointX, m_pPoints[i].m_PointY);
+ }
+}
+const int g_Distant[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
+FX_BOOL CFX_PathData::GetZeroAreaPath(CFX_PathData& NewPath, CFX_AffineMatrix* pMatrix, FX_BOOL&bThin, FX_BOOL bAdjust) const
+{
+ if (m_PointCount < 3) {
+ return FALSE;
+ }
+ if (m_PointCount == 3 && (m_pPoints[0].m_Flag & FXPT_TYPE) == FXPT_MOVETO &&
+ (m_pPoints[1].m_Flag & FXPT_TYPE) == FXPT_LINETO && (m_pPoints[2].m_Flag & FXPT_TYPE) == FXPT_LINETO
+ && m_pPoints[0].m_PointX == m_pPoints[2].m_PointX && m_pPoints[0].m_PointY == m_pPoints[2].m_PointY) {
+ NewPath.AddPointCount(2);
+ if (bAdjust) {
+ if (pMatrix) {
+ FX_FLOAT x = m_pPoints[0].m_PointX, y = m_pPoints[0].m_PointY;
+ pMatrix->TransformPoint(x, y);
+ x = (int)x + 0.5f;
+ y = (int)y + 0.5f;
+ NewPath.SetPoint(0, x, y, FXPT_MOVETO);
+ x = m_pPoints[1].m_PointX, y = m_pPoints[1].m_PointY;
+ pMatrix->TransformPoint(x, y);
+ x = (int)x + 0.5f;
+ y = (int)y + 0.5f;
+ NewPath.SetPoint(1, x, y, FXPT_LINETO);
+ pMatrix->SetIdentity();
+ } else {
+ FX_FLOAT x = (int)m_pPoints[0].m_PointX + 0.5f, y = (int)m_pPoints[0].m_PointY + 0.5f;
+ NewPath.SetPoint(0, x, y, FXPT_MOVETO);
+ x = (int)m_pPoints[1].m_PointX + 0.5f, y = (int)m_pPoints[1].m_PointY + 0.5f;
+ NewPath.SetPoint(1, x, y, FXPT_LINETO);
+ }
+ } else {
+ NewPath.SetPoint(0, m_pPoints[0].m_PointX, m_pPoints[0].m_PointY, FXPT_MOVETO);
+ NewPath.SetPoint(1, m_pPoints[1].m_PointX, m_pPoints[1].m_PointY, FXPT_LINETO);
+ }
+ if (m_pPoints[0].m_PointX != m_pPoints[1].m_PointX && m_pPoints[0].m_PointY != m_pPoints[1].m_PointY) {
+ bThin = TRUE;
+ }
+ return TRUE;
+ }
+ if (((m_PointCount > 3) && (m_PointCount % 2))) {
+ int mid = m_PointCount / 2;
+ FX_BOOL bZeroArea = FALSE;
+ CFX_PathData t_path;
+ for (int i = 0; i < mid; i++) {
+ if (!(m_pPoints[mid - i - 1].m_PointX == m_pPoints[mid + i + 1].m_PointX
+ && m_pPoints[mid - i - 1].m_PointY == m_pPoints[mid + i + 1].m_PointY &&
+ ((m_pPoints[mid - i - 1].m_Flag & FXPT_TYPE) != FXPT_BEZIERTO && (m_pPoints[mid + i + 1].m_Flag & FXPT_TYPE) != FXPT_BEZIERTO))) {
+ bZeroArea = TRUE;
+ break;
+ }
+ int new_count = t_path.GetPointCount();
+ t_path.AddPointCount(2);
+ t_path.SetPoint(new_count, m_pPoints[mid - i].m_PointX, m_pPoints[mid - i].m_PointY, FXPT_MOVETO);
+ t_path.SetPoint(new_count + 1, m_pPoints[mid - i - 1].m_PointX, m_pPoints[mid - i - 1].m_PointY, FXPT_LINETO);
+ }
+ if (!bZeroArea) {
+ NewPath.Append(&t_path, NULL);
+ bThin = TRUE;
+ return TRUE;
+ }
+ }
+ int stratPoint = 0;
+ int next = 0, i;
+ for (i = 0; i < m_PointCount; i++) {
+ int point_type = m_pPoints[i].m_Flag & FXPT_TYPE;
+ if (point_type == FXPT_MOVETO) {
+ stratPoint = i;
+ } else if (point_type == FXPT_LINETO) {
+ next = (i + 1 - stratPoint) % (m_PointCount - stratPoint) + stratPoint;
+ if ((m_pPoints[next].m_Flag & FXPT_TYPE) != FXPT_BEZIERTO && (m_pPoints[next].m_Flag & FXPT_TYPE) != FXPT_MOVETO) {
+ if((m_pPoints[i - 1].m_PointX == m_pPoints[i].m_PointX && m_pPoints[i].m_PointX == m_pPoints[next].m_PointX)
+ && ((m_pPoints[i].m_PointY - m_pPoints[i - 1].m_PointY) * (m_pPoints[i].m_PointY - m_pPoints[next].m_PointY) > 0)) {
+ int pre = i;
+ if (FXSYS_fabs(m_pPoints[i].m_PointY - m_pPoints[i - 1].m_PointY)
+ < FXSYS_fabs(m_pPoints[i].m_PointY - m_pPoints[next].m_PointY)) {
+ pre --;
+ next--;
+ }
+ int new_count = NewPath.GetPointCount();
+ NewPath.AddPointCount(2);
+ NewPath.SetPoint(new_count, m_pPoints[pre].m_PointX, m_pPoints[pre].m_PointY, FXPT_MOVETO);
+ NewPath.SetPoint(new_count + 1, m_pPoints[next].m_PointX, m_pPoints[next].m_PointY, FXPT_LINETO);
+ } else if((m_pPoints[i - 1].m_PointY == m_pPoints[i].m_PointY && m_pPoints[i].m_PointY == m_pPoints[next].m_PointY)
+ && ((m_pPoints[i].m_PointX - m_pPoints[i - 1].m_PointX) * (m_pPoints[i].m_PointX - m_pPoints[next].m_PointX) > 0)) {
+ int pre = i;
+ if (FXSYS_fabs(m_pPoints[i].m_PointX - m_pPoints[i - 1].m_PointX)
+ < FXSYS_fabs(m_pPoints[i].m_PointX - m_pPoints[next].m_PointX)) {
+ pre --;
+ next--;
+ }
+ int new_count = NewPath.GetPointCount();
+ NewPath.AddPointCount(2);
+ NewPath.SetPoint(new_count, m_pPoints[pre].m_PointX, m_pPoints[pre].m_PointY, FXPT_MOVETO);
+ NewPath.SetPoint(new_count + 1, m_pPoints[next].m_PointX, m_pPoints[next].m_PointY, FXPT_LINETO);
+ } else if ((m_pPoints[i - 1].m_Flag & FXPT_TYPE) == FXPT_MOVETO && (m_pPoints[next].m_Flag & FXPT_TYPE) == FXPT_LINETO &&
+ m_pPoints[i - 1].m_PointX == m_pPoints[next].m_PointX && m_pPoints[i - 1].m_PointY == m_pPoints[next].m_PointY
+ && m_pPoints[next].m_Flag & FXPT_CLOSEFIGURE) {
+ int new_count = NewPath.GetPointCount();
+ NewPath.AddPointCount(2);
+ NewPath.SetPoint(new_count, m_pPoints[i - 1].m_PointX, m_pPoints[i - 1].m_PointY, FXPT_MOVETO);
+ NewPath.SetPoint(new_count + 1, m_pPoints[i].m_PointX, m_pPoints[i].m_PointY, FXPT_LINETO);
+ bThin = TRUE;
+ }
+ }
+ } else if (point_type == FXPT_BEZIERTO) {
+ i += 2;
+ continue;
+ }
+ }
+ if (m_PointCount > 3 && NewPath.GetPointCount()) {
+ bThin = TRUE;
+ }
+ if (NewPath.GetPointCount() == 0) {
+ return FALSE;
+ }
+ return TRUE;
+}
+FX_BOOL CFX_PathData::IsRect() const
+{
+ if (m_PointCount != 5 && m_PointCount != 4) {
+ return FALSE;
+ }
+ if ((m_PointCount == 5 && (m_pPoints[0].m_PointX != m_pPoints[4].m_PointX ||
+ m_pPoints[0].m_PointY != m_pPoints[4].m_PointY)) ||
+ (m_pPoints[0].m_PointX == m_pPoints[2].m_PointX && m_pPoints[0].m_PointY == m_pPoints[2].m_PointY) ||
+ (m_pPoints[1].m_PointX == m_pPoints[3].m_PointX && m_pPoints[1].m_PointY == m_pPoints[3].m_PointY)) {
+ return FALSE;
+ }
+ if (m_pPoints[0].m_PointX != m_pPoints[3].m_PointX && m_pPoints[0].m_PointY != m_pPoints[3].m_PointY) {
+ return FALSE;
+ }
+ for (int i = 1; i < 4; i ++) {
+ if ((m_pPoints[i].m_Flag & FXPT_TYPE) != FXPT_LINETO) {
+ return FALSE;
+ }
+ if (m_pPoints[i].m_PointX != m_pPoints[i - 1].m_PointX && m_pPoints[i].m_PointY != m_pPoints[i - 1].m_PointY) {
+ return FALSE;
+ }
+ }
+ return m_PointCount == 5 || (m_pPoints[3].m_Flag & FXPT_CLOSEFIGURE);
+}
+FX_BOOL CFX_PathData::IsRect(const CFX_AffineMatrix* pMatrix, CFX_FloatRect* pRect) const
+{
+ if (pMatrix == NULL) {
+ if (!IsRect()) {
+ return FALSE;
+ }
+ if (pRect) {
+ pRect->left = m_pPoints[0].m_PointX;
+ pRect->right = m_pPoints[2].m_PointX;
+ pRect->bottom = m_pPoints[0].m_PointY;
+ pRect->top = m_pPoints[2].m_PointY;
+ pRect->Normalize();
+ }
+ return TRUE;
+ }
+ if (m_PointCount != 5 && m_PointCount != 4) {
+ return FALSE;
+ }
+ if ((m_PointCount == 5 && (m_pPoints[0].m_PointX != m_pPoints[4].m_PointX || m_pPoints[0].m_PointY != m_pPoints[4].m_PointY)) ||
+ (m_pPoints[1].m_PointX == m_pPoints[3].m_PointX && m_pPoints[1].m_PointY == m_pPoints[3].m_PointY)) {
+ return FALSE;
+ }
+ if (m_PointCount == 4 && m_pPoints[0].m_PointX != m_pPoints[3].m_PointX && m_pPoints[0].m_PointY != m_pPoints[3].m_PointY) {
+ return FALSE;
+ }
+ FX_FLOAT x[5], y[5];
+ for (int i = 0; i < m_PointCount; i ++) {
+ pMatrix->Transform(m_pPoints[i].m_PointX, m_pPoints[i].m_PointY, x[i], y[i]);
+ if (i) {
+ if ((m_pPoints[i].m_Flag & FXPT_TYPE) != FXPT_LINETO) {
+ return FALSE;
+ }
+ if (x[i] != x[i - 1] && y[i] != y[i - 1]) {
+ return FALSE;
+ }
+ }
+ }
+ if (pRect) {
+ pRect->left = x[0];
+ pRect->right = x[2];
+ pRect->bottom = y[0];
+ pRect->top = y[2];
+ pRect->Normalize();
+ }
+ return TRUE;
+}
+FX_BOOL CFX_PathData::Copy(const CFX_PathData &src)
+{
+ if (!SetPointCount(src.m_PointCount)) {
+ return FALSE;
+ }
+ FXSYS_memcpy32(m_pPoints, src.m_pPoints, sizeof(FX_PATHPOINT) * m_PointCount);
+ return TRUE;
+}
+CFX_GraphStateData::CFX_GraphStateData()
+{
+ m_LineCap = LineCapButt;
+ m_DashCount = 0;
+ m_DashArray = NULL;
+ m_DashPhase = 0;
+ m_LineJoin = LineJoinMiter;
+ m_MiterLimit = 10 * 1.0f;
+ m_LineWidth = 1.0f;
+}
+CFX_GraphStateData::CFX_GraphStateData(const CFX_GraphStateData& src)
+{
+ m_DashArray = NULL;
+ Copy(src);
+}
+void CFX_GraphStateData::Copy(const CFX_GraphStateData& src)
+{
+ m_LineCap = src.m_LineCap;
+ m_DashCount = src.m_DashCount;
+ if (m_DashArray) {
+ FX_Free(m_DashArray);
+ }
+ m_DashArray = NULL;
+ m_DashPhase = src.m_DashPhase;
+ m_LineJoin = src.m_LineJoin;
+ m_MiterLimit = src.m_MiterLimit;
+ m_LineWidth = src.m_LineWidth;
+ if (m_DashCount) {
+ m_DashArray = FX_Alloc(FX_FLOAT, m_DashCount);
+ if (!m_DashArray) {
+ return;
+ }
+ FXSYS_memcpy32(m_DashArray, src.m_DashArray, m_DashCount * sizeof(FX_FLOAT));
+ }
+}
+CFX_GraphStateData::~CFX_GraphStateData()
+{
+ if (m_DashArray) {
+ FX_Free(m_DashArray);
+ }
+}
+void CFX_GraphStateData::SetDashCount(int count)
+{
+ if (m_DashArray) {
+ FX_Free(m_DashArray);
+ }
+ m_DashArray = NULL;
+ m_DashCount = count;
+ if (count == 0) {
+ return;
+ }
+ m_DashArray = FX_Alloc(FX_FLOAT, count);
+}
diff --git a/core/src/fxge/ge/fx_ge_ps.cpp b/core/src/fxge/ge/fx_ge_ps.cpp
index a39ab2dee0..d664b706b0 100644
--- a/core/src/fxge/ge/fx_ge_ps.cpp
+++ b/core/src/fxge/ge/fx_ge_ps.cpp
@@ -1,657 +1,657 @@
-// 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
-
-#include "../../../include/fxge/fx_ge.h"
-#include "../../../include/fxcodec/fx_codec.h"
-#include "text_int.h"
-struct PSGlyph {
- CFX_Font* m_pFont;
- FX_DWORD m_GlyphIndex;
- FX_BOOL m_bGlyphAdjust;
- FX_FLOAT m_AdjustMatrix[4];
-};
-class CPSFont : public CFX_Object
-{
-public:
- PSGlyph m_Glyphs[256];
- int m_nGlyphs;
-};
-CFX_PSRenderer::CFX_PSRenderer()
-{
- m_pOutput = NULL;
- m_bColorSet = m_bGraphStateSet = FALSE;
- m_bInited = FALSE;
-}
-CFX_PSRenderer::~CFX_PSRenderer()
-{
- for (int i = 0; i < (int)m_PSFontList.GetSize(); i ++) {
- CPSFont* pFont = m_PSFontList[i];
- delete pFont;
- }
-}
-#define OUTPUT_PS(str) m_pOutput->OutputPS(str, sizeof str-1)
-void CFX_PSRenderer::Init(IFX_PSOutput* pOutput, int pslevel, int width, int height, FX_BOOL bCmykOutput)
-{
- m_PSLevel = pslevel;
- m_pOutput = pOutput;
- m_ClipBox.left = m_ClipBox.top = 0;
- m_ClipBox.right = width;
- m_ClipBox.bottom = height;
- m_bCmykOutput = bCmykOutput;
-}
-FX_BOOL CFX_PSRenderer::StartRendering()
-{
- if (m_bInited) {
- return TRUE;
- }
- static const char init_str[] = "\nsave\n/im/initmatrix load def\n"
- "/n/newpath load def/m/moveto load def/l/lineto load def/c/curveto load def/h/closepath load def\n"
- "/f/fill load def/F/eofill load def/s/stroke load def/W/clip load def/W*/eoclip load def\n"
- "/rg/setrgbcolor load def/k/setcmykcolor load def\n"
- "/J/setlinecap load def/j/setlinejoin load def/w/setlinewidth load def/M/setmiterlimit load def/d/setdash load def\n"
- "/q/gsave load def/Q/grestore load def/iM/imagemask load def\n"
- "/Tj/show load def/Ff/findfont load def/Fs/scalefont load def/Sf/setfont load def\n"
- "/cm/concat load def/Cm/currentmatrix load def/mx/matrix load def/sm/setmatrix load def\n"
- ;
- OUTPUT_PS(init_str);
- m_bInited = TRUE;
- return TRUE;
-}
-void CFX_PSRenderer::EndRendering()
-{
- if (m_bInited) {
- OUTPUT_PS("\nrestore\n");
- }
- m_bInited = FALSE;
-}
-void CFX_PSRenderer::SaveState()
-{
- StartRendering();
- OUTPUT_PS("q\n");
- m_ClipBoxStack.Add(m_ClipBox);
-}
-void CFX_PSRenderer::RestoreState(FX_BOOL bKeepSaved)
-{
- StartRendering();
- if (bKeepSaved) {
- OUTPUT_PS("Q\nq\n");
- } else {
- OUTPUT_PS("Q\n");
- }
- m_bColorSet = m_bGraphStateSet = FALSE;
- m_ClipBox = m_ClipBoxStack.GetAt(m_ClipBoxStack.GetSize() - 1);
- if (!bKeepSaved) {
- m_ClipBoxStack.RemoveAt(m_ClipBoxStack.GetSize() - 1);
- }
-}
-void CFX_PSRenderer::OutputPath(const CFX_PathData* pPathData, const CFX_AffineMatrix* pObject2Device)
-{
- int nPoints = pPathData->GetPointCount();
- CFX_ByteTextBuf buf;
- buf.EstimateSize(nPoints * 10);
- for (int i = 0; i < nPoints; i ++) {
- FX_BYTE flag = pPathData->GetFlag(i);
- FX_FLOAT x = pPathData->GetPointX(i);
- FX_FLOAT y = pPathData->GetPointY(i);
- if (pObject2Device) {
- pObject2Device->Transform(x, y);
- }
- buf << x << FX_BSTRC(" ") << y;
- switch (flag & FXPT_TYPE) {
- case FXPT_MOVETO:
- buf << FX_BSTRC(" m ");
- break;
- case FXPT_LINETO:
- if (flag & FXPT_CLOSEFIGURE) {
- buf << FX_BSTRC(" l h ");
- } else {
- buf << FX_BSTRC(" l ");
- }
- break;
- case FXPT_BEZIERTO: {
- FX_FLOAT x1 = pPathData->GetPointX(i + 1);
- FX_FLOAT x2 = pPathData->GetPointX(i + 2);
- FX_FLOAT y1 = pPathData->GetPointY(i + 1);
- FX_FLOAT y2 = pPathData->GetPointY(i + 2);
- if (pObject2Device) {
- pObject2Device->Transform(x1, y1);
- pObject2Device->Transform(x2, y2);
- }
- buf << FX_BSTRC(" ") << x1 << FX_BSTRC(" ") << y1 << FX_BSTRC(" ") << x2 << FX_BSTRC(" ") << y2;
- if (flag & FXPT_CLOSEFIGURE) {
- buf << FX_BSTRC(" c h\n");
- } else {
- buf << FX_BSTRC(" c\n");
- }
- i += 2;
- break;
- }
- }
- }
- m_pOutput->OutputPS((FX_LPCSTR)buf.GetBuffer(), buf.GetSize());
-}
-void CFX_PSRenderer::SetClip_PathFill(const CFX_PathData* pPathData,
- const CFX_AffineMatrix* pObject2Device,
- int fill_mode
- )
-{
- StartRendering();
- OutputPath(pPathData, pObject2Device);
- CFX_FloatRect rect = pPathData->GetBoundingBox();
- if (pObject2Device) {
- rect.Transform(pObject2Device);
- }
- m_ClipBox.Intersect(rect.GetOutterRect());
- if ((fill_mode & 3) == FXFILL_WINDING) {
- OUTPUT_PS("W n\n");
- } else {
- OUTPUT_PS("W* n\n");
- }
-}
-void CFX_PSRenderer::SetClip_PathStroke(const CFX_PathData* pPathData,
- const CFX_AffineMatrix* pObject2Device,
- const CFX_GraphStateData* pGraphState
- )
-{
- StartRendering();
- SetGraphState(pGraphState);
- if (pObject2Device) {
- CFX_ByteTextBuf buf;
- buf << FX_BSTRC("mx Cm [") << pObject2Device->a << FX_BSTRC(" ") << pObject2Device->b << FX_BSTRC(" ") <<
- pObject2Device->c << FX_BSTRC(" ") << pObject2Device->d << FX_BSTRC(" ") << pObject2Device->e <<
- FX_BSTRC(" ") << pObject2Device->f << FX_BSTRC("]cm ");
- m_pOutput->OutputPS((FX_LPCSTR)buf.GetBuffer(), buf.GetSize());
- }
- OutputPath(pPathData, NULL);
- CFX_FloatRect rect = pPathData->GetBoundingBox(pGraphState->m_LineWidth, pGraphState->m_MiterLimit);
- rect.Transform(pObject2Device);
- m_ClipBox.Intersect(rect.GetOutterRect());
- if (pObject2Device) {
- OUTPUT_PS("strokepath W n sm\n");
- } else {
- OUTPUT_PS("strokepath W n\n");
- }
-}
-FX_BOOL CFX_PSRenderer::DrawPath(const CFX_PathData* pPathData,
- const CFX_AffineMatrix* pObject2Device,
- const CFX_GraphStateData* pGraphState,
- FX_DWORD fill_color,
- FX_DWORD stroke_color,
- int fill_mode,
- int alpha_flag,
- void* pIccTransform
- )
-{
- StartRendering();
- int fill_alpha = FXGETFLAG_COLORTYPE(alpha_flag) ? FXGETFLAG_ALPHA_FILL(alpha_flag) : FXARGB_A(fill_color);
- int stroke_alpha = FXGETFLAG_COLORTYPE(alpha_flag) ? FXGETFLAG_ALPHA_STROKE(alpha_flag) : FXARGB_A(stroke_color);
- if (fill_alpha && fill_alpha < 255) {
- return FALSE;
- }
- if (stroke_alpha && stroke_alpha < 255) {
- return FALSE;
- }
- if (fill_alpha == 0 && stroke_alpha == 0) {
- return FALSE;
- }
- if (stroke_alpha) {
- SetGraphState(pGraphState);
- if (pObject2Device) {
- CFX_ByteTextBuf buf;
- buf << FX_BSTRC("mx Cm [") << pObject2Device->a << FX_BSTRC(" ") << pObject2Device->b << FX_BSTRC(" ") <<
- pObject2Device->c << FX_BSTRC(" ") << pObject2Device->d << FX_BSTRC(" ") << pObject2Device->e <<
- FX_BSTRC(" ") << pObject2Device->f << FX_BSTRC("]cm ");
- m_pOutput->OutputPS((FX_LPCSTR)buf.GetBuffer(), buf.GetSize());
- }
- }
- OutputPath(pPathData, stroke_alpha ? NULL : pObject2Device);
- if (fill_mode && fill_alpha) {
- SetColor(fill_color, alpha_flag, pIccTransform);
- if ((fill_mode & 3) == FXFILL_WINDING) {
- if (stroke_alpha) {
- OUTPUT_PS("q f Q ");
- } else {
- OUTPUT_PS("f");
- }
- } else if ((fill_mode & 3) == FXFILL_ALTERNATE) {
- if (stroke_alpha) {
- OUTPUT_PS("q F Q ");
- } else {
- OUTPUT_PS("F");
- }
- }
- }
- if (stroke_alpha) {
- SetColor(stroke_color, alpha_flag, pIccTransform);
- if (pObject2Device) {
- OUTPUT_PS("s sm");
- } else {
- OUTPUT_PS("s");
- }
- }
- OUTPUT_PS("\n");
- return TRUE;
-}
-void CFX_PSRenderer::SetGraphState(const CFX_GraphStateData* pGraphState)
-{
- CFX_ByteTextBuf buf;
- if (!m_bGraphStateSet || m_CurGraphState.m_LineCap != pGraphState->m_LineCap) {
- buf << pGraphState->m_LineCap << FX_BSTRC(" J\n");
- }
- if (!m_bGraphStateSet || m_CurGraphState.m_DashCount != pGraphState->m_DashCount ||
- FXSYS_memcmp32(m_CurGraphState.m_DashArray, pGraphState->m_DashArray, sizeof(FX_FLOAT)*m_CurGraphState.m_DashCount)) {
- buf << FX_BSTRC("[");
- for (int i = 0; i < pGraphState->m_DashCount; i ++) {
- buf << pGraphState->m_DashArray[i] << FX_BSTRC(" ");
- }
- buf << FX_BSTRC("]") << pGraphState->m_DashPhase << FX_BSTRC(" d\n");
- }
- if (!m_bGraphStateSet || m_CurGraphState.m_LineJoin != pGraphState->m_LineJoin) {
- buf << pGraphState->m_LineJoin << FX_BSTRC(" j\n");
- }
- if (!m_bGraphStateSet || m_CurGraphState.m_LineWidth != pGraphState->m_LineWidth) {
- buf << pGraphState->m_LineWidth << FX_BSTRC(" w\n");
- }
- if (!m_bGraphStateSet || m_CurGraphState.m_MiterLimit != pGraphState->m_MiterLimit) {
- buf << pGraphState->m_MiterLimit << FX_BSTRC(" M\n");
- }
- m_CurGraphState.Copy(*pGraphState);
- m_bGraphStateSet = TRUE;
- if (buf.GetSize()) {
- m_pOutput->OutputPS((FX_LPCSTR)buf.GetBuffer(), buf.GetSize());
- }
-}
-static void FaxCompressData(FX_LPBYTE src_buf, int width, int height, FX_LPBYTE& dest_buf, FX_DWORD& dest_size)
-{
- CCodec_ModuleMgr* pEncoders = CFX_GEModule::Get()->GetCodecModule();
- if (width * height > 128 && pEncoders && pEncoders->GetFaxModule()->Encode(src_buf, width, height, (width + 7) / 8, dest_buf, dest_size)) {
- FX_Free(src_buf);
- } else {
- dest_buf = src_buf;
- dest_size = (width + 7) / 8 * height;
- }
-}
-static void PSCompressData(int PSLevel, FX_LPBYTE src_buf, FX_DWORD src_size,
- FX_LPBYTE& output_buf, FX_DWORD& output_size, FX_LPCSTR& filter)
-{
- output_buf = src_buf;
- output_size = src_size;
- filter = "";
- if (src_size < 1024) {
- return;
- }
- CCodec_ModuleMgr* pEncoders = CFX_GEModule::Get()->GetCodecModule();
- FX_LPBYTE dest_buf = NULL;
- FX_DWORD dest_size = src_size;
- if (PSLevel >= 3) {
- if (pEncoders && pEncoders->GetFlateModule()->Encode(src_buf, src_size, dest_buf, dest_size)) {
- filter = "/FlateDecode filter ";
- }
- } else {
- if (pEncoders && pEncoders->GetBasicModule()->RunLengthEncode(src_buf, src_size, dest_buf, dest_size)) {
- filter = "/RunLengthDecode filter ";
- }
- }
- if (dest_size < src_size) {
- output_buf = dest_buf;
- output_size = dest_size;
- } else {
- filter = NULL;
- if (dest_buf) {
- FX_Free(dest_buf);
- }
- }
-}
-FX_BOOL CFX_PSRenderer::SetDIBits(const CFX_DIBSource* pSource, FX_DWORD color, int left, int top,
- int alpha_flag, void* pIccTransform)
-{
- StartRendering();
- CFX_AffineMatrix matrix((FX_FLOAT)(pSource->GetWidth()), 0.0f, 0.0f, -(FX_FLOAT)(pSource->GetHeight()),
- (FX_FLOAT)(left), (FX_FLOAT)(top + pSource->GetHeight()));
- return DrawDIBits(pSource, color, &matrix, 0, alpha_flag, pIccTransform);
-}
-FX_BOOL CFX_PSRenderer::StretchDIBits(const CFX_DIBSource* pSource, FX_DWORD color, int dest_left, int dest_top,
- int dest_width, int dest_height, FX_DWORD flags,
- int alpha_flag, void* pIccTransform)
-{
- StartRendering();
- CFX_AffineMatrix matrix((FX_FLOAT)(dest_width), 0.0f, 0.0f, (FX_FLOAT)(-dest_height),
- (FX_FLOAT)(dest_left), (FX_FLOAT)(dest_top + dest_height));
- return DrawDIBits(pSource, color, &matrix, flags, alpha_flag, pIccTransform);
-}
-FX_BOOL CFX_PSRenderer::DrawDIBits(const CFX_DIBSource* pSource, FX_DWORD color,
- const CFX_AffineMatrix* pMatrix, FX_DWORD flags,
- int alpha_flag, void* pIccTransform)
-{
- StartRendering();
- if ((pMatrix->a == 0 && pMatrix->b == 0) || (pMatrix->c == 0 && pMatrix->d == 0)) {
- return TRUE;
- }
- if (pSource->HasAlpha()) {
- return FALSE;
- }
- int alpha = FXGETFLAG_COLORTYPE(alpha_flag) ? FXGETFLAG_ALPHA_FILL(color) : FXARGB_A(color);
- if (pSource->IsAlphaMask() && (alpha < 255 || pSource->GetBPP() != 1)) {
- return FALSE;
- }
- OUTPUT_PS("q\n");
- CFX_ByteTextBuf buf;
- buf << FX_BSTRC("[") << pMatrix->a << FX_BSTRC(" ") << pMatrix->b << FX_BSTRC(" ") <<
- pMatrix->c << FX_BSTRC(" ") << pMatrix->d << FX_BSTRC(" ") << pMatrix->e <<
- FX_BSTRC(" ") << pMatrix->f << FX_BSTRC("]cm ");
- int width = pSource->GetWidth();
- int height = pSource->GetHeight();
- buf << width << FX_BSTRC(" ") << height;
- if (pSource->GetBPP() == 1 && pSource->GetPalette() == NULL) {
- int pitch = (width + 7) / 8;
- FX_DWORD src_size = height * pitch;
- FX_LPBYTE src_buf = FX_Alloc(FX_BYTE, src_size);
- if (!src_buf) {
- return FALSE;
- }
- for (int row = 0; row < height; row ++) {
- FX_LPCBYTE src_scan = pSource->GetScanline(row);
- FXSYS_memcpy32(src_buf + row * pitch, src_scan, pitch);
- }
- FX_LPBYTE output_buf;
- FX_DWORD output_size;
- FaxCompressData(src_buf, width, height, output_buf, output_size);
- if (pSource->IsAlphaMask()) {
- SetColor(color, alpha_flag, pIccTransform);
- m_bColorSet = FALSE;
- buf << FX_BSTRC(" true[");
- } else {
- buf << FX_BSTRC(" 1[");
- }
- buf << width << FX_BSTRC(" 0 0 -") << height << FX_BSTRC(" 0 ") << height <<
- FX_BSTRC("]currentfile/ASCII85Decode filter ");
- if (output_buf != src_buf)
- buf << FX_BSTRC("<</K -1/EndOfBlock false/Columns ") << width << FX_BSTRC("/Rows ") << height <<
- FX_BSTRC(">>/CCITTFaxDecode filter ");
- if (pSource->IsAlphaMask()) {
- buf << FX_BSTRC("iM\n");
- } else {
- buf << FX_BSTRC("false 1 colorimage\n");
- }
- m_pOutput->OutputPS((FX_LPCSTR)buf.GetBuffer(), buf.GetSize());
- WritePSBinary(output_buf, output_size);
- FX_Free(output_buf);
- } else {
- CFX_DIBSource* pConverted = (CFX_DIBSource*)pSource;
- if (pIccTransform) {
- FXDIB_Format format = m_bCmykOutput ? FXDIB_Cmyk : FXDIB_Rgb;
- pConverted = pSource->CloneConvert(format, NULL, pIccTransform);
- } else {
- switch (pSource->GetFormat()) {
- case FXDIB_1bppRgb:
- case FXDIB_Rgb32:
- pConverted = pSource->CloneConvert(FXDIB_Rgb);
- break;
- case FXDIB_8bppRgb:
- if (pSource->GetPalette() != NULL) {
- pConverted = pSource->CloneConvert(FXDIB_Rgb);
- }
- break;
- case FXDIB_1bppCmyk:
- pConverted = pSource->CloneConvert(FXDIB_Cmyk);
- break;
- case FXDIB_8bppCmyk:
- if (pSource->GetPalette() != NULL) {
- pConverted = pSource->CloneConvert(FXDIB_Cmyk);
- }
- break;
- default:
- break;
- }
- }
- if (pConverted == NULL) {
- OUTPUT_PS("\nQ\n");
- return FALSE;
- }
- int Bpp = pConverted->GetBPP() / 8;
- FX_LPBYTE output_buf = NULL;
- FX_STRSIZE output_size = 0;
- FX_LPCSTR filter = NULL;
- if (flags & FXRENDER_IMAGE_LOSSY) {
- CCodec_ModuleMgr* pEncoders = CFX_GEModule::Get()->GetCodecModule();
- if (pEncoders && pEncoders->GetJpegModule()->Encode(pConverted, output_buf, output_size)) {
- filter = "/DCTDecode filter ";
- }
- }
- if (filter == NULL) {
- int src_pitch = width * Bpp;
- output_size = height * src_pitch;
- output_buf = FX_Alloc(FX_BYTE, output_size);
- if (!output_buf) {
- if (pConverted != pSource) {
- delete pConverted;
- pConverted = NULL;
- }
- return FALSE;
- }
- for (int row = 0; row < height; row ++) {
- FX_LPCBYTE src_scan = pConverted->GetScanline(row);
- FX_LPBYTE dest_scan = output_buf + row * src_pitch;
- if (Bpp == 3) {
- for (int col = 0; col < width; col ++) {
- *dest_scan++ = src_scan[2];
- *dest_scan++ = src_scan[1];
- *dest_scan++ = *src_scan;
- src_scan += 3;
- }
- } else {
- FXSYS_memcpy32(dest_scan, src_scan, src_pitch);
- }
- }
- FX_LPBYTE compressed_buf;
- FX_DWORD compressed_size;
- PSCompressData(m_PSLevel, output_buf, output_size, compressed_buf, compressed_size, filter);
- if (output_buf != compressed_buf) {
- FX_Free(output_buf);
- }
- output_buf = compressed_buf;
- output_size = compressed_size;
- }
- if (pConverted != pSource) {
- delete pConverted;
- pConverted = NULL;
- }
- buf << FX_BSTRC(" 8[");
- buf << width << FX_BSTRC(" 0 0 -") << height << FX_BSTRC(" 0 ") << height << FX_BSTRC("]");
- buf << FX_BSTRC("currentfile/ASCII85Decode filter ");
- if (filter) {
- buf << filter;
- }
- buf << FX_BSTRC("false ") << Bpp;
- buf << FX_BSTRC(" colorimage\n");
- m_pOutput->OutputPS((FX_LPCSTR)buf.GetBuffer(), buf.GetSize());
- WritePSBinary(output_buf, output_size);
- FX_Free(output_buf);
- }
- OUTPUT_PS("\nQ\n");
- return TRUE;
-}
-void CFX_PSRenderer::SetColor(FX_DWORD color, int alpha_flag, void* pIccTransform)
-{
- if (!CFX_GEModule::Get()->GetCodecModule() || !CFX_GEModule::Get()->GetCodecModule()->GetIccModule()) {
- pIccTransform = NULL;
- }
- FX_BOOL bCMYK = FALSE;
- if (pIccTransform) {
- ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
- color = FXGETFLAG_COLORTYPE(alpha_flag) ? FXCMYK_TODIB(color) : FXARGB_TODIB(color);
- FX_LPBYTE pColor = (FX_LPBYTE)&color;
- pIccModule->TranslateScanline(pIccTransform, pColor, pColor, 1);
- color = m_bCmykOutput ? FXCMYK_TODIB(color) : FXARGB_TODIB(color);
- bCMYK = m_bCmykOutput;
- } else {
- bCMYK = FXGETFLAG_COLORTYPE(alpha_flag);
- }
- if (bCMYK != m_bCmykOutput || !m_bColorSet || m_LastColor != color) {
- CFX_ByteTextBuf buf;
- if (bCMYK) {
- buf << FXSYS_GetCValue(color) / 255.0 << FX_BSTRC(" ") << FXSYS_GetMValue(color) / 255.0 << FX_BSTRC(" ")
- << FXSYS_GetYValue(color) / 255.0 << FX_BSTRC(" ") << FXSYS_GetKValue(color) / 255.0 << FX_BSTRC(" k\n");
- } else {
- buf << FXARGB_R(color) / 255.0 << FX_BSTRC(" ") << FXARGB_G(color) / 255.0 << FX_BSTRC(" ")
- << FXARGB_B(color) / 255.0 << FX_BSTRC(" rg\n");
- }
- if (bCMYK == m_bCmykOutput) {
- m_bColorSet = TRUE;
- m_LastColor = color;
- }
- m_pOutput->OutputPS((FX_LPCSTR)buf.GetBuffer(), buf.GetSize());
- }
-}
-void CFX_PSRenderer::FindPSFontGlyph(CFX_FaceCache* pFaceCache, CFX_Font* pFont, const FXTEXT_CHARPOS& charpos,
- int& ps_fontnum, int &ps_glyphindex)
-{
- for (int i = 0; i < (int)m_PSFontList.GetSize(); i ++) {
- CPSFont* pPSFont = m_PSFontList[i];
- for (int j = 0; j < pPSFont->m_nGlyphs; j ++)
- if (pPSFont->m_Glyphs[j].m_pFont == pFont && pPSFont->m_Glyphs[j].m_GlyphIndex == charpos.m_GlyphIndex) {
- if ((!pPSFont->m_Glyphs[j].m_bGlyphAdjust && !charpos.m_bGlyphAdjust) ||
- (pPSFont->m_Glyphs[j].m_bGlyphAdjust && charpos.m_bGlyphAdjust &&
- (FXSYS_fabs(pPSFont->m_Glyphs[j].m_AdjustMatrix[0] - charpos.m_AdjustMatrix[0]) < 0.01 &&
- FXSYS_fabs(pPSFont->m_Glyphs[j].m_AdjustMatrix[1] - charpos.m_AdjustMatrix[1]) < 0.01 &&
- FXSYS_fabs(pPSFont->m_Glyphs[j].m_AdjustMatrix[2] - charpos.m_AdjustMatrix[2]) < 0.01 &&
- FXSYS_fabs(pPSFont->m_Glyphs[j].m_AdjustMatrix[3] - charpos.m_AdjustMatrix[3]) < 0.01))) {
- ps_fontnum = i;
- ps_glyphindex = j;
- return;
- }
- }
- }
- if (m_PSFontList.GetSize() == 0 || m_PSFontList[m_PSFontList.GetSize() - 1]->m_nGlyphs == 256) {
- CPSFont* pPSFont = FX_NEW CPSFont;
- if (!pPSFont) {
- return;
- }
- pPSFont->m_nGlyphs = 0;
- m_PSFontList.Add(pPSFont);
- CFX_ByteTextBuf buf;
- buf << FX_BSTRC("8 dict begin/FontType 3 def/FontMatrix[1 0 0 1 0 0]def\n"
- "/FontBBox[0 0 0 0]def/Encoding 256 array def 0 1 255{Encoding exch/.notdef put}for\n"
- "/CharProcs 1 dict def CharProcs begin/.notdef {} def end\n"
- "/BuildGlyph{1 0 -10 -10 10 10 setcachedevice exch/CharProcs get exch 2 copy known not{pop/.notdef}if get exec}bind def\n"
- "/BuildChar{1 index/Encoding get exch get 1 index/BuildGlyph get exec}bind def\n"
- "currentdict end\n");
- buf << FX_BSTRC("/X") << m_PSFontList.GetSize() - 1 << FX_BSTRC(" exch definefont pop\n");
- m_pOutput->OutputPS((FX_LPCSTR)buf.GetBuffer(), buf.GetSize());
- buf.Clear();
- }
- ps_fontnum = m_PSFontList.GetSize() - 1;
- CPSFont* pPSFont = m_PSFontList[ps_fontnum];
- ps_glyphindex = pPSFont->m_nGlyphs;
- pPSFont->m_Glyphs[ps_glyphindex].m_GlyphIndex = charpos.m_GlyphIndex;
- pPSFont->m_Glyphs[ps_glyphindex].m_pFont = pFont;
- pPSFont->m_Glyphs[ps_glyphindex].m_bGlyphAdjust = charpos.m_bGlyphAdjust;
- if (charpos.m_bGlyphAdjust) {
- pPSFont->m_Glyphs[ps_glyphindex].m_AdjustMatrix[0] = charpos.m_AdjustMatrix[0];
- pPSFont->m_Glyphs[ps_glyphindex].m_AdjustMatrix[1] = charpos.m_AdjustMatrix[1];
- pPSFont->m_Glyphs[ps_glyphindex].m_AdjustMatrix[2] = charpos.m_AdjustMatrix[2];
- pPSFont->m_Glyphs[ps_glyphindex].m_AdjustMatrix[3] = charpos.m_AdjustMatrix[3];
- }
- pPSFont->m_nGlyphs ++;
- CFX_AffineMatrix matrix;
- if (charpos.m_bGlyphAdjust)
- matrix.Set(charpos.m_AdjustMatrix[0], charpos.m_AdjustMatrix[1],
- charpos.m_AdjustMatrix[2], charpos.m_AdjustMatrix[3], 0, 0);
- matrix.Concat(1.0f, 0, 0, 1.0f, 0, 0);
- const CFX_PathData* pPathData = pFaceCache->LoadGlyphPath(pFont, charpos.m_GlyphIndex, charpos.m_FontCharWidth);
- if (pPathData == NULL) {
- return;
- }
- CFX_PathData TransformedPath(*pPathData);
- if (charpos.m_bGlyphAdjust) {
- TransformedPath.Transform(&matrix);
- }
- CFX_ByteTextBuf buf;
- buf << FX_BSTRC("/X") << ps_fontnum << FX_BSTRC(" Ff/CharProcs get begin/")
- << ps_glyphindex << FX_BSTRC("{");
- buf << FX_BSTRC("n ");
- for (int p = 0; p < TransformedPath.GetPointCount(); p ++) {
- FX_FLOAT x = TransformedPath.GetPointX(p), y = TransformedPath.GetPointY(p);
- switch (TransformedPath.GetFlag(p) & FXPT_TYPE) {
- case FXPT_MOVETO: {
- buf << x << FX_BSTRC(" ") << y << FX_BSTRC(" m\n");
- break;
- }
- case FXPT_LINETO: {
- buf << x << FX_BSTRC(" ") << y << FX_BSTRC(" l\n");
- break;
- }
- case FXPT_BEZIERTO: {
- buf << x << FX_BSTRC(" ") << y << FX_BSTRC(" ")
- << TransformedPath.GetPointX(p + 1) << FX_BSTRC(" ")
- << TransformedPath.GetPointY(p + 1) << FX_BSTRC(" ")
- << TransformedPath.GetPointX(p + 2) << FX_BSTRC(" ")
- << TransformedPath.GetPointY(p + 2) << FX_BSTRC(" c\n");
- p += 2;
- break;
- }
- }
- }
- buf << FX_BSTRC("f");
- buf << FX_BSTRC("}bind def end\n");
- buf << FX_BSTRC("/X") << ps_fontnum << FX_BSTRC(" Ff/Encoding get ") << ps_glyphindex
- << FX_BSTRC("/") << ps_glyphindex << FX_BSTRC(" put\n");
- m_pOutput->OutputPS((FX_LPCSTR)buf.GetBuffer(), buf.GetSize());
-}
-FX_BOOL CFX_PSRenderer::DrawText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont,
- CFX_FontCache* pCache, const CFX_AffineMatrix* pObject2Device,
- FX_FLOAT font_size, FX_DWORD color,
- int alpha_flag, void* pIccTransform)
-{
- StartRendering();
- int alpha = FXGETFLAG_COLORTYPE(alpha_flag) ? FXGETFLAG_ALPHA_FILL(alpha_flag) : FXARGB_A(color);
- if (alpha < 255) {
- return FALSE;
- }
- if ((pObject2Device->a == 0 && pObject2Device->b == 0) || (pObject2Device->c == 0 && pObject2Device->d == 0)) {
- return TRUE;
- }
- SetColor(color, alpha_flag, pIccTransform);
- CFX_ByteTextBuf buf;
- buf << FX_BSTRC("q[") << pObject2Device->a << FX_BSTRC(" ") << pObject2Device->b << FX_BSTRC(" ")
- << pObject2Device->c << FX_BSTRC(" ") << pObject2Device->d;
- buf << FX_BSTRC(" ") << pObject2Device->e << FX_BSTRC(" ") << pObject2Device->f << "]cm\n";
- if (pCache == NULL) {
- pCache = CFX_GEModule::Get()->GetFontCache();
- }
- CFX_FaceCache* pFaceCache = pCache->GetCachedFace(pFont);
- FX_FONTCACHE_DEFINE(pCache, pFont);
- int last_fontnum = -1;
- for (int i = 0; i < nChars; i ++) {
- int ps_fontnum, ps_glyphindex;
- FindPSFontGlyph(pFaceCache, pFont, pCharPos[i], ps_fontnum, ps_glyphindex);
- if (last_fontnum != ps_fontnum) {
- buf << FX_BSTRC("/X") << ps_fontnum << FX_BSTRC(" Ff ") << font_size
- << FX_BSTRC(" Fs Sf ");
- last_fontnum = ps_fontnum;
- }
- buf << pCharPos[i].m_OriginX << FX_BSTRC(" ")
- << pCharPos[i].m_OriginY << FX_BSTRC(" m");
- CFX_ByteString hex;
- hex.Format("<%02X>", ps_glyphindex);
- buf << hex << FX_BSTRC("Tj\n");
- }
- buf << FX_BSTRC("Q\n");
- m_pOutput->OutputPS((FX_LPCSTR)buf.GetBuffer(), buf.GetSize());
- return TRUE;
-}
-void CFX_PSRenderer::WritePSBinary(FX_LPCBYTE data, int len)
-{
- FX_LPBYTE dest_buf;
- FX_DWORD dest_size;
- CCodec_ModuleMgr* pEncoders = CFX_GEModule::Get()->GetCodecModule();
- if (pEncoders && pEncoders->GetBasicModule()->A85Encode(data, len, dest_buf, dest_size)) {
- m_pOutput->OutputPS((FX_LPCSTR)dest_buf, dest_size);
- FX_Free(dest_buf);
- } else {
- m_pOutput->OutputPS((FX_LPCSTR)data, len);
- }
-}
+// 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
+
+#include "../../../include/fxge/fx_ge.h"
+#include "../../../include/fxcodec/fx_codec.h"
+#include "text_int.h"
+struct PSGlyph {
+ CFX_Font* m_pFont;
+ FX_DWORD m_GlyphIndex;
+ FX_BOOL m_bGlyphAdjust;
+ FX_FLOAT m_AdjustMatrix[4];
+};
+class CPSFont : public CFX_Object
+{
+public:
+ PSGlyph m_Glyphs[256];
+ int m_nGlyphs;
+};
+CFX_PSRenderer::CFX_PSRenderer()
+{
+ m_pOutput = NULL;
+ m_bColorSet = m_bGraphStateSet = FALSE;
+ m_bInited = FALSE;
+}
+CFX_PSRenderer::~CFX_PSRenderer()
+{
+ for (int i = 0; i < (int)m_PSFontList.GetSize(); i ++) {
+ CPSFont* pFont = m_PSFontList[i];
+ delete pFont;
+ }
+}
+#define OUTPUT_PS(str) m_pOutput->OutputPS(str, sizeof str-1)
+void CFX_PSRenderer::Init(IFX_PSOutput* pOutput, int pslevel, int width, int height, FX_BOOL bCmykOutput)
+{
+ m_PSLevel = pslevel;
+ m_pOutput = pOutput;
+ m_ClipBox.left = m_ClipBox.top = 0;
+ m_ClipBox.right = width;
+ m_ClipBox.bottom = height;
+ m_bCmykOutput = bCmykOutput;
+}
+FX_BOOL CFX_PSRenderer::StartRendering()
+{
+ if (m_bInited) {
+ return TRUE;
+ }
+ static const char init_str[] = "\nsave\n/im/initmatrix load def\n"
+ "/n/newpath load def/m/moveto load def/l/lineto load def/c/curveto load def/h/closepath load def\n"
+ "/f/fill load def/F/eofill load def/s/stroke load def/W/clip load def/W*/eoclip load def\n"
+ "/rg/setrgbcolor load def/k/setcmykcolor load def\n"
+ "/J/setlinecap load def/j/setlinejoin load def/w/setlinewidth load def/M/setmiterlimit load def/d/setdash load def\n"
+ "/q/gsave load def/Q/grestore load def/iM/imagemask load def\n"
+ "/Tj/show load def/Ff/findfont load def/Fs/scalefont load def/Sf/setfont load def\n"
+ "/cm/concat load def/Cm/currentmatrix load def/mx/matrix load def/sm/setmatrix load def\n"
+ ;
+ OUTPUT_PS(init_str);
+ m_bInited = TRUE;
+ return TRUE;
+}
+void CFX_PSRenderer::EndRendering()
+{
+ if (m_bInited) {
+ OUTPUT_PS("\nrestore\n");
+ }
+ m_bInited = FALSE;
+}
+void CFX_PSRenderer::SaveState()
+{
+ StartRendering();
+ OUTPUT_PS("q\n");
+ m_ClipBoxStack.Add(m_ClipBox);
+}
+void CFX_PSRenderer::RestoreState(FX_BOOL bKeepSaved)
+{
+ StartRendering();
+ if (bKeepSaved) {
+ OUTPUT_PS("Q\nq\n");
+ } else {
+ OUTPUT_PS("Q\n");
+ }
+ m_bColorSet = m_bGraphStateSet = FALSE;
+ m_ClipBox = m_ClipBoxStack.GetAt(m_ClipBoxStack.GetSize() - 1);
+ if (!bKeepSaved) {
+ m_ClipBoxStack.RemoveAt(m_ClipBoxStack.GetSize() - 1);
+ }
+}
+void CFX_PSRenderer::OutputPath(const CFX_PathData* pPathData, const CFX_AffineMatrix* pObject2Device)
+{
+ int nPoints = pPathData->GetPointCount();
+ CFX_ByteTextBuf buf;
+ buf.EstimateSize(nPoints * 10);
+ for (int i = 0; i < nPoints; i ++) {
+ FX_BYTE flag = pPathData->GetFlag(i);
+ FX_FLOAT x = pPathData->GetPointX(i);
+ FX_FLOAT y = pPathData->GetPointY(i);
+ if (pObject2Device) {
+ pObject2Device->Transform(x, y);
+ }
+ buf << x << FX_BSTRC(" ") << y;
+ switch (flag & FXPT_TYPE) {
+ case FXPT_MOVETO:
+ buf << FX_BSTRC(" m ");
+ break;
+ case FXPT_LINETO:
+ if (flag & FXPT_CLOSEFIGURE) {
+ buf << FX_BSTRC(" l h ");
+ } else {
+ buf << FX_BSTRC(" l ");
+ }
+ break;
+ case FXPT_BEZIERTO: {
+ FX_FLOAT x1 = pPathData->GetPointX(i + 1);
+ FX_FLOAT x2 = pPathData->GetPointX(i + 2);
+ FX_FLOAT y1 = pPathData->GetPointY(i + 1);
+ FX_FLOAT y2 = pPathData->GetPointY(i + 2);
+ if (pObject2Device) {
+ pObject2Device->Transform(x1, y1);
+ pObject2Device->Transform(x2, y2);
+ }
+ buf << FX_BSTRC(" ") << x1 << FX_BSTRC(" ") << y1 << FX_BSTRC(" ") << x2 << FX_BSTRC(" ") << y2;
+ if (flag & FXPT_CLOSEFIGURE) {
+ buf << FX_BSTRC(" c h\n");
+ } else {
+ buf << FX_BSTRC(" c\n");
+ }
+ i += 2;
+ break;
+ }
+ }
+ }
+ m_pOutput->OutputPS((FX_LPCSTR)buf.GetBuffer(), buf.GetSize());
+}
+void CFX_PSRenderer::SetClip_PathFill(const CFX_PathData* pPathData,
+ const CFX_AffineMatrix* pObject2Device,
+ int fill_mode
+ )
+{
+ StartRendering();
+ OutputPath(pPathData, pObject2Device);
+ CFX_FloatRect rect = pPathData->GetBoundingBox();
+ if (pObject2Device) {
+ rect.Transform(pObject2Device);
+ }
+ m_ClipBox.Intersect(rect.GetOutterRect());
+ if ((fill_mode & 3) == FXFILL_WINDING) {
+ OUTPUT_PS("W n\n");
+ } else {
+ OUTPUT_PS("W* n\n");
+ }
+}
+void CFX_PSRenderer::SetClip_PathStroke(const CFX_PathData* pPathData,
+ const CFX_AffineMatrix* pObject2Device,
+ const CFX_GraphStateData* pGraphState
+ )
+{
+ StartRendering();
+ SetGraphState(pGraphState);
+ if (pObject2Device) {
+ CFX_ByteTextBuf buf;
+ buf << FX_BSTRC("mx Cm [") << pObject2Device->a << FX_BSTRC(" ") << pObject2Device->b << FX_BSTRC(" ") <<
+ pObject2Device->c << FX_BSTRC(" ") << pObject2Device->d << FX_BSTRC(" ") << pObject2Device->e <<
+ FX_BSTRC(" ") << pObject2Device->f << FX_BSTRC("]cm ");
+ m_pOutput->OutputPS((FX_LPCSTR)buf.GetBuffer(), buf.GetSize());
+ }
+ OutputPath(pPathData, NULL);
+ CFX_FloatRect rect = pPathData->GetBoundingBox(pGraphState->m_LineWidth, pGraphState->m_MiterLimit);
+ rect.Transform(pObject2Device);
+ m_ClipBox.Intersect(rect.GetOutterRect());
+ if (pObject2Device) {
+ OUTPUT_PS("strokepath W n sm\n");
+ } else {
+ OUTPUT_PS("strokepath W n\n");
+ }
+}
+FX_BOOL CFX_PSRenderer::DrawPath(const CFX_PathData* pPathData,
+ const CFX_AffineMatrix* pObject2Device,
+ const CFX_GraphStateData* pGraphState,
+ FX_DWORD fill_color,
+ FX_DWORD stroke_color,
+ int fill_mode,
+ int alpha_flag,
+ void* pIccTransform
+ )
+{
+ StartRendering();
+ int fill_alpha = FXGETFLAG_COLORTYPE(alpha_flag) ? FXGETFLAG_ALPHA_FILL(alpha_flag) : FXARGB_A(fill_color);
+ int stroke_alpha = FXGETFLAG_COLORTYPE(alpha_flag) ? FXGETFLAG_ALPHA_STROKE(alpha_flag) : FXARGB_A(stroke_color);
+ if (fill_alpha && fill_alpha < 255) {
+ return FALSE;
+ }
+ if (stroke_alpha && stroke_alpha < 255) {
+ return FALSE;
+ }
+ if (fill_alpha == 0 && stroke_alpha == 0) {
+ return FALSE;
+ }
+ if (stroke_alpha) {
+ SetGraphState(pGraphState);
+ if (pObject2Device) {
+ CFX_ByteTextBuf buf;
+ buf << FX_BSTRC("mx Cm [") << pObject2Device->a << FX_BSTRC(" ") << pObject2Device->b << FX_BSTRC(" ") <<
+ pObject2Device->c << FX_BSTRC(" ") << pObject2Device->d << FX_BSTRC(" ") << pObject2Device->e <<
+ FX_BSTRC(" ") << pObject2Device->f << FX_BSTRC("]cm ");
+ m_pOutput->OutputPS((FX_LPCSTR)buf.GetBuffer(), buf.GetSize());
+ }
+ }
+ OutputPath(pPathData, stroke_alpha ? NULL : pObject2Device);
+ if (fill_mode && fill_alpha) {
+ SetColor(fill_color, alpha_flag, pIccTransform);
+ if ((fill_mode & 3) == FXFILL_WINDING) {
+ if (stroke_alpha) {
+ OUTPUT_PS("q f Q ");
+ } else {
+ OUTPUT_PS("f");
+ }
+ } else if ((fill_mode & 3) == FXFILL_ALTERNATE) {
+ if (stroke_alpha) {
+ OUTPUT_PS("q F Q ");
+ } else {
+ OUTPUT_PS("F");
+ }
+ }
+ }
+ if (stroke_alpha) {
+ SetColor(stroke_color, alpha_flag, pIccTransform);
+ if (pObject2Device) {
+ OUTPUT_PS("s sm");
+ } else {
+ OUTPUT_PS("s");
+ }
+ }
+ OUTPUT_PS("\n");
+ return TRUE;
+}
+void CFX_PSRenderer::SetGraphState(const CFX_GraphStateData* pGraphState)
+{
+ CFX_ByteTextBuf buf;
+ if (!m_bGraphStateSet || m_CurGraphState.m_LineCap != pGraphState->m_LineCap) {
+ buf << pGraphState->m_LineCap << FX_BSTRC(" J\n");
+ }
+ if (!m_bGraphStateSet || m_CurGraphState.m_DashCount != pGraphState->m_DashCount ||
+ FXSYS_memcmp32(m_CurGraphState.m_DashArray, pGraphState->m_DashArray, sizeof(FX_FLOAT)*m_CurGraphState.m_DashCount)) {
+ buf << FX_BSTRC("[");
+ for (int i = 0; i < pGraphState->m_DashCount; i ++) {
+ buf << pGraphState->m_DashArray[i] << FX_BSTRC(" ");
+ }
+ buf << FX_BSTRC("]") << pGraphState->m_DashPhase << FX_BSTRC(" d\n");
+ }
+ if (!m_bGraphStateSet || m_CurGraphState.m_LineJoin != pGraphState->m_LineJoin) {
+ buf << pGraphState->m_LineJoin << FX_BSTRC(" j\n");
+ }
+ if (!m_bGraphStateSet || m_CurGraphState.m_LineWidth != pGraphState->m_LineWidth) {
+ buf << pGraphState->m_LineWidth << FX_BSTRC(" w\n");
+ }
+ if (!m_bGraphStateSet || m_CurGraphState.m_MiterLimit != pGraphState->m_MiterLimit) {
+ buf << pGraphState->m_MiterLimit << FX_BSTRC(" M\n");
+ }
+ m_CurGraphState.Copy(*pGraphState);
+ m_bGraphStateSet = TRUE;
+ if (buf.GetSize()) {
+ m_pOutput->OutputPS((FX_LPCSTR)buf.GetBuffer(), buf.GetSize());
+ }
+}
+static void FaxCompressData(FX_LPBYTE src_buf, int width, int height, FX_LPBYTE& dest_buf, FX_DWORD& dest_size)
+{
+ CCodec_ModuleMgr* pEncoders = CFX_GEModule::Get()->GetCodecModule();
+ if (width * height > 128 && pEncoders && pEncoders->GetFaxModule()->Encode(src_buf, width, height, (width + 7) / 8, dest_buf, dest_size)) {
+ FX_Free(src_buf);
+ } else {
+ dest_buf = src_buf;
+ dest_size = (width + 7) / 8 * height;
+ }
+}
+static void PSCompressData(int PSLevel, FX_LPBYTE src_buf, FX_DWORD src_size,
+ FX_LPBYTE& output_buf, FX_DWORD& output_size, FX_LPCSTR& filter)
+{
+ output_buf = src_buf;
+ output_size = src_size;
+ filter = "";
+ if (src_size < 1024) {
+ return;
+ }
+ CCodec_ModuleMgr* pEncoders = CFX_GEModule::Get()->GetCodecModule();
+ FX_LPBYTE dest_buf = NULL;
+ FX_DWORD dest_size = src_size;
+ if (PSLevel >= 3) {
+ if (pEncoders && pEncoders->GetFlateModule()->Encode(src_buf, src_size, dest_buf, dest_size)) {
+ filter = "/FlateDecode filter ";
+ }
+ } else {
+ if (pEncoders && pEncoders->GetBasicModule()->RunLengthEncode(src_buf, src_size, dest_buf, dest_size)) {
+ filter = "/RunLengthDecode filter ";
+ }
+ }
+ if (dest_size < src_size) {
+ output_buf = dest_buf;
+ output_size = dest_size;
+ } else {
+ filter = NULL;
+ if (dest_buf) {
+ FX_Free(dest_buf);
+ }
+ }
+}
+FX_BOOL CFX_PSRenderer::SetDIBits(const CFX_DIBSource* pSource, FX_DWORD color, int left, int top,
+ int alpha_flag, void* pIccTransform)
+{
+ StartRendering();
+ CFX_AffineMatrix matrix((FX_FLOAT)(pSource->GetWidth()), 0.0f, 0.0f, -(FX_FLOAT)(pSource->GetHeight()),
+ (FX_FLOAT)(left), (FX_FLOAT)(top + pSource->GetHeight()));
+ return DrawDIBits(pSource, color, &matrix, 0, alpha_flag, pIccTransform);
+}
+FX_BOOL CFX_PSRenderer::StretchDIBits(const CFX_DIBSource* pSource, FX_DWORD color, int dest_left, int dest_top,
+ int dest_width, int dest_height, FX_DWORD flags,
+ int alpha_flag, void* pIccTransform)
+{
+ StartRendering();
+ CFX_AffineMatrix matrix((FX_FLOAT)(dest_width), 0.0f, 0.0f, (FX_FLOAT)(-dest_height),
+ (FX_FLOAT)(dest_left), (FX_FLOAT)(dest_top + dest_height));
+ return DrawDIBits(pSource, color, &matrix, flags, alpha_flag, pIccTransform);
+}
+FX_BOOL CFX_PSRenderer::DrawDIBits(const CFX_DIBSource* pSource, FX_DWORD color,
+ const CFX_AffineMatrix* pMatrix, FX_DWORD flags,
+ int alpha_flag, void* pIccTransform)
+{
+ StartRendering();
+ if ((pMatrix->a == 0 && pMatrix->b == 0) || (pMatrix->c == 0 && pMatrix->d == 0)) {
+ return TRUE;
+ }
+ if (pSource->HasAlpha()) {
+ return FALSE;
+ }
+ int alpha = FXGETFLAG_COLORTYPE(alpha_flag) ? FXGETFLAG_ALPHA_FILL(color) : FXARGB_A(color);
+ if (pSource->IsAlphaMask() && (alpha < 255 || pSource->GetBPP() != 1)) {
+ return FALSE;
+ }
+ OUTPUT_PS("q\n");
+ CFX_ByteTextBuf buf;
+ buf << FX_BSTRC("[") << pMatrix->a << FX_BSTRC(" ") << pMatrix->b << FX_BSTRC(" ") <<
+ pMatrix->c << FX_BSTRC(" ") << pMatrix->d << FX_BSTRC(" ") << pMatrix->e <<
+ FX_BSTRC(" ") << pMatrix->f << FX_BSTRC("]cm ");
+ int width = pSource->GetWidth();
+ int height = pSource->GetHeight();
+ buf << width << FX_BSTRC(" ") << height;
+ if (pSource->GetBPP() == 1 && pSource->GetPalette() == NULL) {
+ int pitch = (width + 7) / 8;
+ FX_DWORD src_size = height * pitch;
+ FX_LPBYTE src_buf = FX_Alloc(FX_BYTE, src_size);
+ if (!src_buf) {
+ return FALSE;
+ }
+ for (int row = 0; row < height; row ++) {
+ FX_LPCBYTE src_scan = pSource->GetScanline(row);
+ FXSYS_memcpy32(src_buf + row * pitch, src_scan, pitch);
+ }
+ FX_LPBYTE output_buf;
+ FX_DWORD output_size;
+ FaxCompressData(src_buf, width, height, output_buf, output_size);
+ if (pSource->IsAlphaMask()) {
+ SetColor(color, alpha_flag, pIccTransform);
+ m_bColorSet = FALSE;
+ buf << FX_BSTRC(" true[");
+ } else {
+ buf << FX_BSTRC(" 1[");
+ }
+ buf << width << FX_BSTRC(" 0 0 -") << height << FX_BSTRC(" 0 ") << height <<
+ FX_BSTRC("]currentfile/ASCII85Decode filter ");
+ if (output_buf != src_buf)
+ buf << FX_BSTRC("<</K -1/EndOfBlock false/Columns ") << width << FX_BSTRC("/Rows ") << height <<
+ FX_BSTRC(">>/CCITTFaxDecode filter ");
+ if (pSource->IsAlphaMask()) {
+ buf << FX_BSTRC("iM\n");
+ } else {
+ buf << FX_BSTRC("false 1 colorimage\n");
+ }
+ m_pOutput->OutputPS((FX_LPCSTR)buf.GetBuffer(), buf.GetSize());
+ WritePSBinary(output_buf, output_size);
+ FX_Free(output_buf);
+ } else {
+ CFX_DIBSource* pConverted = (CFX_DIBSource*)pSource;
+ if (pIccTransform) {
+ FXDIB_Format format = m_bCmykOutput ? FXDIB_Cmyk : FXDIB_Rgb;
+ pConverted = pSource->CloneConvert(format, NULL, pIccTransform);
+ } else {
+ switch (pSource->GetFormat()) {
+ case FXDIB_1bppRgb:
+ case FXDIB_Rgb32:
+ pConverted = pSource->CloneConvert(FXDIB_Rgb);
+ break;
+ case FXDIB_8bppRgb:
+ if (pSource->GetPalette() != NULL) {
+ pConverted = pSource->CloneConvert(FXDIB_Rgb);
+ }
+ break;
+ case FXDIB_1bppCmyk:
+ pConverted = pSource->CloneConvert(FXDIB_Cmyk);
+ break;
+ case FXDIB_8bppCmyk:
+ if (pSource->GetPalette() != NULL) {
+ pConverted = pSource->CloneConvert(FXDIB_Cmyk);
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ if (pConverted == NULL) {
+ OUTPUT_PS("\nQ\n");
+ return FALSE;
+ }
+ int Bpp = pConverted->GetBPP() / 8;
+ FX_LPBYTE output_buf = NULL;
+ FX_STRSIZE output_size = 0;
+ FX_LPCSTR filter = NULL;
+ if (flags & FXRENDER_IMAGE_LOSSY) {
+ CCodec_ModuleMgr* pEncoders = CFX_GEModule::Get()->GetCodecModule();
+ if (pEncoders && pEncoders->GetJpegModule()->Encode(pConverted, output_buf, output_size)) {
+ filter = "/DCTDecode filter ";
+ }
+ }
+ if (filter == NULL) {
+ int src_pitch = width * Bpp;
+ output_size = height * src_pitch;
+ output_buf = FX_Alloc(FX_BYTE, output_size);
+ if (!output_buf) {
+ if (pConverted != pSource) {
+ delete pConverted;
+ pConverted = NULL;
+ }
+ return FALSE;
+ }
+ for (int row = 0; row < height; row ++) {
+ FX_LPCBYTE src_scan = pConverted->GetScanline(row);
+ FX_LPBYTE dest_scan = output_buf + row * src_pitch;
+ if (Bpp == 3) {
+ for (int col = 0; col < width; col ++) {
+ *dest_scan++ = src_scan[2];
+ *dest_scan++ = src_scan[1];
+ *dest_scan++ = *src_scan;
+ src_scan += 3;
+ }
+ } else {
+ FXSYS_memcpy32(dest_scan, src_scan, src_pitch);
+ }
+ }
+ FX_LPBYTE compressed_buf;
+ FX_DWORD compressed_size;
+ PSCompressData(m_PSLevel, output_buf, output_size, compressed_buf, compressed_size, filter);
+ if (output_buf != compressed_buf) {
+ FX_Free(output_buf);
+ }
+ output_buf = compressed_buf;
+ output_size = compressed_size;
+ }
+ if (pConverted != pSource) {
+ delete pConverted;
+ pConverted = NULL;
+ }
+ buf << FX_BSTRC(" 8[");
+ buf << width << FX_BSTRC(" 0 0 -") << height << FX_BSTRC(" 0 ") << height << FX_BSTRC("]");
+ buf << FX_BSTRC("currentfile/ASCII85Decode filter ");
+ if (filter) {
+ buf << filter;
+ }
+ buf << FX_BSTRC("false ") << Bpp;
+ buf << FX_BSTRC(" colorimage\n");
+ m_pOutput->OutputPS((FX_LPCSTR)buf.GetBuffer(), buf.GetSize());
+ WritePSBinary(output_buf, output_size);
+ FX_Free(output_buf);
+ }
+ OUTPUT_PS("\nQ\n");
+ return TRUE;
+}
+void CFX_PSRenderer::SetColor(FX_DWORD color, int alpha_flag, void* pIccTransform)
+{
+ if (!CFX_GEModule::Get()->GetCodecModule() || !CFX_GEModule::Get()->GetCodecModule()->GetIccModule()) {
+ pIccTransform = NULL;
+ }
+ FX_BOOL bCMYK = FALSE;
+ if (pIccTransform) {
+ ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
+ color = FXGETFLAG_COLORTYPE(alpha_flag) ? FXCMYK_TODIB(color) : FXARGB_TODIB(color);
+ FX_LPBYTE pColor = (FX_LPBYTE)&color;
+ pIccModule->TranslateScanline(pIccTransform, pColor, pColor, 1);
+ color = m_bCmykOutput ? FXCMYK_TODIB(color) : FXARGB_TODIB(color);
+ bCMYK = m_bCmykOutput;
+ } else {
+ bCMYK = FXGETFLAG_COLORTYPE(alpha_flag);
+ }
+ if (bCMYK != m_bCmykOutput || !m_bColorSet || m_LastColor != color) {
+ CFX_ByteTextBuf buf;
+ if (bCMYK) {
+ buf << FXSYS_GetCValue(color) / 255.0 << FX_BSTRC(" ") << FXSYS_GetMValue(color) / 255.0 << FX_BSTRC(" ")
+ << FXSYS_GetYValue(color) / 255.0 << FX_BSTRC(" ") << FXSYS_GetKValue(color) / 255.0 << FX_BSTRC(" k\n");
+ } else {
+ buf << FXARGB_R(color) / 255.0 << FX_BSTRC(" ") << FXARGB_G(color) / 255.0 << FX_BSTRC(" ")
+ << FXARGB_B(color) / 255.0 << FX_BSTRC(" rg\n");
+ }
+ if (bCMYK == m_bCmykOutput) {
+ m_bColorSet = TRUE;
+ m_LastColor = color;
+ }
+ m_pOutput->OutputPS((FX_LPCSTR)buf.GetBuffer(), buf.GetSize());
+ }
+}
+void CFX_PSRenderer::FindPSFontGlyph(CFX_FaceCache* pFaceCache, CFX_Font* pFont, const FXTEXT_CHARPOS& charpos,
+ int& ps_fontnum, int &ps_glyphindex)
+{
+ for (int i = 0; i < (int)m_PSFontList.GetSize(); i ++) {
+ CPSFont* pPSFont = m_PSFontList[i];
+ for (int j = 0; j < pPSFont->m_nGlyphs; j ++)
+ if (pPSFont->m_Glyphs[j].m_pFont == pFont && pPSFont->m_Glyphs[j].m_GlyphIndex == charpos.m_GlyphIndex) {
+ if ((!pPSFont->m_Glyphs[j].m_bGlyphAdjust && !charpos.m_bGlyphAdjust) ||
+ (pPSFont->m_Glyphs[j].m_bGlyphAdjust && charpos.m_bGlyphAdjust &&
+ (FXSYS_fabs(pPSFont->m_Glyphs[j].m_AdjustMatrix[0] - charpos.m_AdjustMatrix[0]) < 0.01 &&
+ FXSYS_fabs(pPSFont->m_Glyphs[j].m_AdjustMatrix[1] - charpos.m_AdjustMatrix[1]) < 0.01 &&
+ FXSYS_fabs(pPSFont->m_Glyphs[j].m_AdjustMatrix[2] - charpos.m_AdjustMatrix[2]) < 0.01 &&
+ FXSYS_fabs(pPSFont->m_Glyphs[j].m_AdjustMatrix[3] - charpos.m_AdjustMatrix[3]) < 0.01))) {
+ ps_fontnum = i;
+ ps_glyphindex = j;
+ return;
+ }
+ }
+ }
+ if (m_PSFontList.GetSize() == 0 || m_PSFontList[m_PSFontList.GetSize() - 1]->m_nGlyphs == 256) {
+ CPSFont* pPSFont = FX_NEW CPSFont;
+ if (!pPSFont) {
+ return;
+ }
+ pPSFont->m_nGlyphs = 0;
+ m_PSFontList.Add(pPSFont);
+ CFX_ByteTextBuf buf;
+ buf << FX_BSTRC("8 dict begin/FontType 3 def/FontMatrix[1 0 0 1 0 0]def\n"
+ "/FontBBox[0 0 0 0]def/Encoding 256 array def 0 1 255{Encoding exch/.notdef put}for\n"
+ "/CharProcs 1 dict def CharProcs begin/.notdef {} def end\n"
+ "/BuildGlyph{1 0 -10 -10 10 10 setcachedevice exch/CharProcs get exch 2 copy known not{pop/.notdef}if get exec}bind def\n"
+ "/BuildChar{1 index/Encoding get exch get 1 index/BuildGlyph get exec}bind def\n"
+ "currentdict end\n");
+ buf << FX_BSTRC("/X") << m_PSFontList.GetSize() - 1 << FX_BSTRC(" exch definefont pop\n");
+ m_pOutput->OutputPS((FX_LPCSTR)buf.GetBuffer(), buf.GetSize());
+ buf.Clear();
+ }
+ ps_fontnum = m_PSFontList.GetSize() - 1;
+ CPSFont* pPSFont = m_PSFontList[ps_fontnum];
+ ps_glyphindex = pPSFont->m_nGlyphs;
+ pPSFont->m_Glyphs[ps_glyphindex].m_GlyphIndex = charpos.m_GlyphIndex;
+ pPSFont->m_Glyphs[ps_glyphindex].m_pFont = pFont;
+ pPSFont->m_Glyphs[ps_glyphindex].m_bGlyphAdjust = charpos.m_bGlyphAdjust;
+ if (charpos.m_bGlyphAdjust) {
+ pPSFont->m_Glyphs[ps_glyphindex].m_AdjustMatrix[0] = charpos.m_AdjustMatrix[0];
+ pPSFont->m_Glyphs[ps_glyphindex].m_AdjustMatrix[1] = charpos.m_AdjustMatrix[1];
+ pPSFont->m_Glyphs[ps_glyphindex].m_AdjustMatrix[2] = charpos.m_AdjustMatrix[2];
+ pPSFont->m_Glyphs[ps_glyphindex].m_AdjustMatrix[3] = charpos.m_AdjustMatrix[3];
+ }
+ pPSFont->m_nGlyphs ++;
+ CFX_AffineMatrix matrix;
+ if (charpos.m_bGlyphAdjust)
+ matrix.Set(charpos.m_AdjustMatrix[0], charpos.m_AdjustMatrix[1],
+ charpos.m_AdjustMatrix[2], charpos.m_AdjustMatrix[3], 0, 0);
+ matrix.Concat(1.0f, 0, 0, 1.0f, 0, 0);
+ const CFX_PathData* pPathData = pFaceCache->LoadGlyphPath(pFont, charpos.m_GlyphIndex, charpos.m_FontCharWidth);
+ if (pPathData == NULL) {
+ return;
+ }
+ CFX_PathData TransformedPath(*pPathData);
+ if (charpos.m_bGlyphAdjust) {
+ TransformedPath.Transform(&matrix);
+ }
+ CFX_ByteTextBuf buf;
+ buf << FX_BSTRC("/X") << ps_fontnum << FX_BSTRC(" Ff/CharProcs get begin/")
+ << ps_glyphindex << FX_BSTRC("{");
+ buf << FX_BSTRC("n ");
+ for (int p = 0; p < TransformedPath.GetPointCount(); p ++) {
+ FX_FLOAT x = TransformedPath.GetPointX(p), y = TransformedPath.GetPointY(p);
+ switch (TransformedPath.GetFlag(p) & FXPT_TYPE) {
+ case FXPT_MOVETO: {
+ buf << x << FX_BSTRC(" ") << y << FX_BSTRC(" m\n");
+ break;
+ }
+ case FXPT_LINETO: {
+ buf << x << FX_BSTRC(" ") << y << FX_BSTRC(" l\n");
+ break;
+ }
+ case FXPT_BEZIERTO: {
+ buf << x << FX_BSTRC(" ") << y << FX_BSTRC(" ")
+ << TransformedPath.GetPointX(p + 1) << FX_BSTRC(" ")
+ << TransformedPath.GetPointY(p + 1) << FX_BSTRC(" ")
+ << TransformedPath.GetPointX(p + 2) << FX_BSTRC(" ")
+ << TransformedPath.GetPointY(p + 2) << FX_BSTRC(" c\n");
+ p += 2;
+ break;
+ }
+ }
+ }
+ buf << FX_BSTRC("f");
+ buf << FX_BSTRC("}bind def end\n");
+ buf << FX_BSTRC("/X") << ps_fontnum << FX_BSTRC(" Ff/Encoding get ") << ps_glyphindex
+ << FX_BSTRC("/") << ps_glyphindex << FX_BSTRC(" put\n");
+ m_pOutput->OutputPS((FX_LPCSTR)buf.GetBuffer(), buf.GetSize());
+}
+FX_BOOL CFX_PSRenderer::DrawText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont,
+ CFX_FontCache* pCache, const CFX_AffineMatrix* pObject2Device,
+ FX_FLOAT font_size, FX_DWORD color,
+ int alpha_flag, void* pIccTransform)
+{
+ StartRendering();
+ int alpha = FXGETFLAG_COLORTYPE(alpha_flag) ? FXGETFLAG_ALPHA_FILL(alpha_flag) : FXARGB_A(color);
+ if (alpha < 255) {
+ return FALSE;
+ }
+ if ((pObject2Device->a == 0 && pObject2Device->b == 0) || (pObject2Device->c == 0 && pObject2Device->d == 0)) {
+ return TRUE;
+ }
+ SetColor(color, alpha_flag, pIccTransform);
+ CFX_ByteTextBuf buf;
+ buf << FX_BSTRC("q[") << pObject2Device->a << FX_BSTRC(" ") << pObject2Device->b << FX_BSTRC(" ")
+ << pObject2Device->c << FX_BSTRC(" ") << pObject2Device->d;
+ buf << FX_BSTRC(" ") << pObject2Device->e << FX_BSTRC(" ") << pObject2Device->f << "]cm\n";
+ if (pCache == NULL) {
+ pCache = CFX_GEModule::Get()->GetFontCache();
+ }
+ CFX_FaceCache* pFaceCache = pCache->GetCachedFace(pFont);
+ FX_FONTCACHE_DEFINE(pCache, pFont);
+ int last_fontnum = -1;
+ for (int i = 0; i < nChars; i ++) {
+ int ps_fontnum, ps_glyphindex;
+ FindPSFontGlyph(pFaceCache, pFont, pCharPos[i], ps_fontnum, ps_glyphindex);
+ if (last_fontnum != ps_fontnum) {
+ buf << FX_BSTRC("/X") << ps_fontnum << FX_BSTRC(" Ff ") << font_size
+ << FX_BSTRC(" Fs Sf ");
+ last_fontnum = ps_fontnum;
+ }
+ buf << pCharPos[i].m_OriginX << FX_BSTRC(" ")
+ << pCharPos[i].m_OriginY << FX_BSTRC(" m");
+ CFX_ByteString hex;
+ hex.Format("<%02X>", ps_glyphindex);
+ buf << hex << FX_BSTRC("Tj\n");
+ }
+ buf << FX_BSTRC("Q\n");
+ m_pOutput->OutputPS((FX_LPCSTR)buf.GetBuffer(), buf.GetSize());
+ return TRUE;
+}
+void CFX_PSRenderer::WritePSBinary(FX_LPCBYTE data, int len)
+{
+ FX_LPBYTE dest_buf;
+ FX_DWORD dest_size;
+ CCodec_ModuleMgr* pEncoders = CFX_GEModule::Get()->GetCodecModule();
+ if (pEncoders && pEncoders->GetBasicModule()->A85Encode(data, len, dest_buf, dest_size)) {
+ m_pOutput->OutputPS((FX_LPCSTR)dest_buf, dest_size);
+ FX_Free(dest_buf);
+ } else {
+ m_pOutput->OutputPS((FX_LPCSTR)data, len);
+ }
+}
diff --git a/core/src/fxge/ge/fx_ge_text.cpp b/core/src/fxge/ge/fx_ge_text.cpp
index 92f631e615..40acc5fe34 100644
--- a/core/src/fxge/ge/fx_ge_text.cpp
+++ b/core/src/fxge/ge/fx_ge_text.cpp
@@ -1,1774 +1,1774 @@
-// 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
-
-#include "../../../include/fxge/fx_ge.h"
-#include "../../../include/fxge/fx_freetype.h"
-#include "../../../include/fxcodec/fx_codec.h"
-#include "text_int.h"
-#undef FX_GAMMA
-#undef FX_GAMMA_INVERSE
-#define FX_GAMMA(value) (value)
-#define FX_GAMMA_INVERSE(value) (value)
-FX_RECT FXGE_GetGlyphsBBox(FXTEXT_GLYPHPOS* pGlyphAndPos, int nChars, int anti_alias, FX_FLOAT retinaScaleX, FX_FLOAT retinaScaleY)
-{
- FX_RECT rect(0, 0, 0, 0);
- FX_BOOL bStarted = FALSE;
- for (int iChar = 0; iChar < nChars; iChar ++) {
- FXTEXT_GLYPHPOS& glyph = pGlyphAndPos[iChar];
- const CFX_GlyphBitmap* pGlyph = glyph.m_pGlyph;
- if (pGlyph == NULL) {
- continue;
- }
- int char_left = glyph.m_OriginX + pGlyph->m_Left;
- int char_width = (int)(pGlyph->m_Bitmap.GetWidth() / retinaScaleX);
- if (anti_alias == FXFT_RENDER_MODE_LCD) {
- char_width /= 3;
- }
- int char_right = char_left + char_width;
- int char_top = glyph.m_OriginY - pGlyph->m_Top;
- int char_bottom = char_top + (int)(pGlyph->m_Bitmap.GetHeight() / retinaScaleY);
- if (!bStarted) {
- rect.left = char_left;
- rect.right = char_right;
- rect.top = char_top;
- rect.bottom = char_bottom;
- bStarted = TRUE;
- } else {
- if (rect.left > char_left) {
- rect.left = char_left;
- }
- if (rect.right < char_right) {
- rect.right = char_right;
- }
- if (rect.top > char_top) {
- rect.top = char_top;
- }
- if (rect.bottom < char_bottom) {
- rect.bottom = char_bottom;
- }
- }
- }
- return rect;
-}
-static void _AdjustGlyphSpace(FXTEXT_GLYPHPOS* pGlyphAndPos, int nChars)
-{
- ASSERT(nChars > 1);
- FX_BOOL bVertical = FALSE;
- if (pGlyphAndPos[nChars - 1].m_OriginX == pGlyphAndPos[0].m_OriginX) {
- bVertical = TRUE;
- } else if (pGlyphAndPos[nChars - 1].m_OriginY != pGlyphAndPos[0].m_OriginY) {
- return;
- }
- int i = nChars - 1;
- int* next_origin = bVertical ? &pGlyphAndPos[i].m_OriginY : &pGlyphAndPos[i].m_OriginX;
- FX_FLOAT next_origin_f = bVertical ? pGlyphAndPos[i].m_fOriginY : pGlyphAndPos[i].m_fOriginX;
- for (i --; i > 0; i --) {
- int* this_origin = bVertical ? &pGlyphAndPos[i].m_OriginY : &pGlyphAndPos[i].m_OriginX;
- FX_FLOAT this_origin_f = bVertical ? pGlyphAndPos[i].m_fOriginY : pGlyphAndPos[i].m_fOriginX;
- int space = (*next_origin) - (*this_origin);
- FX_FLOAT space_f = next_origin_f - this_origin_f;
- FX_FLOAT error = (FX_FLOAT)(FXSYS_fabs(space_f) - FXSYS_fabs((FX_FLOAT)(space)));
- if (error > 0.5f) {
- *this_origin += space > 0 ? -1 : 1;
- }
- next_origin = this_origin;
- next_origin_f = this_origin_f;
- }
-}
-static const FX_BYTE g_GdipGamma_bgw[9] = {0, 0, 63, 120, 0, 168, 210, 239, 255};
-static const FX_BYTE g_GdipGamma_fgw[9] = {0, 0, 16, 45, 0, 87, 135, 192, 255};
-static const FX_BYTE g_GdipGammaAdjust_47[48] = {
- 0, 30, 33, 34, 35, 36, 37, 38, 38, 39, 39, 40, 40, 40, 41, 41, 41, 42, 42, 42, 42, 43,
- 43, 43, 43, 43, 44, 44, 44, 44, 44, 44, 45, 45, 45, 45, 45, 45, 45, 46,
- 46, 46, 46, 46, 46, 46, 46, 47
-};
-static const FX_BYTE g_GdipGammaAdjust_75[76] = {
- 0, 46, 50, 52, 54, 55, 56, 57, 58, 59, 60, 60, 61, 61, 62, 62, 63, 63, 64, 64, 64, 65,
- 65, 65, 66, 66, 66, 67, 67, 67, 67, 68, 68, 68, 68, 68, 69, 69, 69, 69, 69, 70, 70, 70,
- 70, 70, 71, 71, 71, 71, 71, 71, 72, 72, 72, 72, 72, 72, 72, 73, 73, 73, 73, 73, 73, 73,
- 73, 74, 74, 74, 74, 74, 74, 74, 74, 75
-};
-static const FX_BYTE g_GdipGammaAdjust_81[82] = {
- 0, 49, 53, 56, 58, 59, 60, 61, 62, 63, 64, 65, 65, 66, 66, 67, 67, 68, 68, 69, 69, 69, 70, 70, 70,
- 71, 71, 71, 72, 72, 72, 72, 73, 73, 73, 73, 74, 74, 74, 74, 74, 75, 75, 75, 75, 75, 76, 76, 76, 76,
- 76, 76, 77, 77, 77, 77, 77, 77, 78, 78, 78, 78, 78, 78, 78, 79, 79, 79, 79, 79, 79, 79, 79, 80,
- 80, 80, 80, 80, 80, 80, 80, 81
-};
-static void _Adjust_alpha(int background, int foreground, int& src_alpha, int text_flags, int a)
-{
-}
-static const FX_BYTE g_TextGammaAdjust[256] = {
- 0, 2, 3, 4, 6, 7, 8, 10, 11, 12, 13, 15, 16, 17, 18, 19,
- 21, 22, 23, 24, 25, 26, 27, 29, 30, 31, 32, 33, 34, 35, 36, 38,
- 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 51, 52, 53, 54, 55,
- 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 71, 72,
- 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
- 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
- 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120,
- 121, 122, 123, 124, 125, 126, 127, 128, 129, 129, 130, 131, 132, 133, 134, 135,
- 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151,
- 152, 153, 154, 155, 156, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166,
- 167, 168, 169, 170, 171, 172, 173, 174, 174, 175, 176, 177, 178, 179, 180, 181,
- 182, 183, 184, 185, 186, 187, 188, 189, 190, 190, 191, 192, 193, 194, 195, 196,
- 197, 198, 199, 200, 201, 202, 203, 204, 204, 205, 206, 207, 208, 209, 210, 211,
- 212, 213, 214, 215, 216, 217, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226,
- 227, 228, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 239, 240,
- 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 250, 251, 252, 253, 254, 255,
-};
-#define ADJUST_ALPHA(background, foreground, src_alpha, text_flags, a) \
- src_alpha = g_TextGammaAdjust[(FX_BYTE)src_alpha];
-void _Color2Argb(FX_ARGB& argb, FX_DWORD color, int alpha_flag, void* pIccTransform)
-{
- if (pIccTransform == NULL && !FXGETFLAG_COLORTYPE(alpha_flag)) {
- argb = color;
- return;
- }
- if (!CFX_GEModule::Get()->GetCodecModule() || !CFX_GEModule::Get()->GetCodecModule()->GetIccModule()) {
- pIccTransform = NULL;
- }
- FX_BYTE bgra[4];
- if (pIccTransform) {
- ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
- color = FXGETFLAG_COLORTYPE(alpha_flag) ? FXCMYK_TODIB(color) : FXARGB_TODIB(color);
- pIccModule->TranslateScanline(pIccTransform, bgra, (FX_LPCBYTE)&color, 1);
- bgra[3] = FXGETFLAG_COLORTYPE(alpha_flag) ?
- (alpha_flag >> 24) ? FXGETFLAG_ALPHA_FILL(alpha_flag) : FXGETFLAG_ALPHA_STROKE(alpha_flag) :
- FXARGB_A(color);
- argb = FXARGB_MAKE(bgra[3], bgra[2], bgra[1], bgra[0]);
- return;
- }
- AdobeCMYK_to_sRGB1(FXSYS_GetCValue(color), FXSYS_GetMValue(color),
- FXSYS_GetYValue(color), FXSYS_GetKValue(color),
- bgra[2], bgra[1], bgra[0]);
- bgra[3] = (alpha_flag >> 24) ? FXGETFLAG_ALPHA_FILL(alpha_flag) : FXGETFLAG_ALPHA_STROKE(alpha_flag);
- argb = FXARGB_MAKE(bgra[3], bgra[2], bgra[1], bgra[0]);
-}
-FX_BOOL CFX_RenderDevice::DrawNormalText(int nChars, const FXTEXT_CHARPOS* pCharPos,
- CFX_Font* pFont, CFX_FontCache* pCache,
- FX_FLOAT font_size, const CFX_AffineMatrix* pText2Device,
- FX_DWORD fill_color, FX_DWORD text_flags,
- int alpha_flag, void* pIccTransform)
-{
- int nativetext_flags = text_flags;
- if (m_DeviceClass != FXDC_DISPLAY) {
- if (!(text_flags & FXTEXT_PRINTGRAPHICTEXT)) {
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
- if (!(text_flags & FXFONT_CIDFONT) && pFont->GetPsName().Find(CFX_WideString::FromLocal("+ZJHL")) == -1)
-#ifdef FOXIT_CHROME_BUILD
- if (pFont->GetPsName() != CFX_WideString::FromLocal("CNAAJI+cmex10"))
-#endif
-#endif
- if (m_pDeviceDriver->DrawDeviceText(nChars, pCharPos, pFont, pCache, pText2Device, font_size, fill_color, alpha_flag, pIccTransform)) {
- return TRUE;
- }
- }
- int alpha = FXGETFLAG_COLORTYPE(alpha_flag) ? FXGETFLAG_ALPHA_FILL(alpha_flag) : FXARGB_A(fill_color);
- if (alpha < 255) {
- return FALSE;
- }
- } else if (!(text_flags & FXTEXT_NO_NATIVETEXT)) {
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
- if (!(text_flags & FXFONT_CIDFONT))
-#ifdef FOXIT_CHROME_BUILD
- if (pFont->GetPsName() != CFX_WideString::FromLocal("CNAAJI+cmex10"))
-#endif
-#endif
- if (m_pDeviceDriver->DrawDeviceText(nChars, pCharPos, pFont, pCache, pText2Device, font_size, fill_color, alpha_flag, pIccTransform)) {
- return TRUE;
- }
- }
- CFX_AffineMatrix char2device, deviceCtm, text2Device;
- if (pText2Device) {
- char2device = *pText2Device;
- text2Device = *pText2Device;
- }
- char2device.Scale(font_size, -font_size);
- if (FXSYS_fabs(char2device.a) + FXSYS_fabs(char2device.b) > 50 * 1.0f ||
- ((m_DeviceClass == FXDC_PRINTER && !m_pDeviceDriver->IsPSPrintDriver())
- && !(text_flags & FXTEXT_PRINTIMAGETEXT))) {
- if (pFont->GetFace() != NULL || (pFont->GetSubstFont()->m_SubstFlags & FXFONT_SUBST_GLYPHPATH)) {
- int nPathFlags = (text_flags & FXTEXT_NOSMOOTH) == 0 ? 0 : FXFILL_NOPATHSMOOTH;
- return DrawTextPath(nChars, pCharPos, pFont, pCache, font_size, pText2Device, NULL, NULL, fill_color, 0, NULL, nPathFlags, alpha_flag, pIccTransform);
- }
- }
- int anti_alias = FXFT_RENDER_MODE_MONO;
- FX_BOOL bNormal = FALSE;
- if ((text_flags & FXTEXT_NOSMOOTH) == 0) {
- if (m_DeviceClass == FXDC_DISPLAY && m_bpp > 1) {
- FX_BOOL bClearType;
- if (pFont->GetFace() == NULL && !(pFont->GetSubstFont()->m_SubstFlags & FXFONT_SUBST_CLEARTYPE)) {
- bClearType = FALSE;
- } else {
- bClearType = text_flags & FXTEXT_CLEARTYPE;
- }
- if ((m_RenderCaps & (FXRC_ALPHA_OUTPUT | FXRC_CMYK_OUTPUT))) {
- anti_alias = FXFT_RENDER_MODE_LCD;
- bNormal = TRUE;
- } else if (m_bpp < 16) {
- anti_alias = FXFT_RENDER_MODE_NORMAL;
- } else {
- if (bClearType == FALSE) {
- anti_alias = FXFT_RENDER_MODE_LCD;
- bNormal = TRUE;
- } else {
- anti_alias = FXFT_RENDER_MODE_LCD;
- }
- }
- }
- }
- if (pCache == NULL) {
- pCache = CFX_GEModule::Get()->GetFontCache();
- }
- CFX_FaceCache* pFaceCache = pCache->GetCachedFace(pFont);
- FX_FONTCACHE_DEFINE(pCache, pFont);
- FXTEXT_GLYPHPOS* pGlyphAndPos = FX_Alloc(FXTEXT_GLYPHPOS, nChars);
- if (!pGlyphAndPos) {
- return FALSE;
- }
- int iChar;
- deviceCtm = char2device;
- CFX_AffineMatrix matrixCTM = GetCTM();
- FX_FLOAT scale_x = FXSYS_fabs(matrixCTM.a);
- FX_FLOAT scale_y = FXSYS_fabs(matrixCTM.d);
- deviceCtm.Concat(scale_x, 0, 0, scale_y, 0, 0);
- text2Device.Concat(scale_x, 0, 0, scale_y, 0, 0);
- for (iChar = 0; iChar < nChars; iChar ++) {
- FXTEXT_GLYPHPOS& glyph = pGlyphAndPos[iChar];
- const FXTEXT_CHARPOS& charpos = pCharPos[iChar];
- glyph.m_fOriginX = charpos.m_OriginX;
- glyph.m_fOriginY = charpos.m_OriginY;
- text2Device.Transform(glyph.m_fOriginX, glyph.m_fOriginY);
- if (anti_alias < FXFT_RENDER_MODE_LCD) {
- glyph.m_OriginX = FXSYS_round(glyph.m_fOriginX);
- } else {
- glyph.m_OriginX = (int)FXSYS_floor(glyph.m_fOriginX);
- }
- glyph.m_OriginY = FXSYS_round(glyph.m_fOriginY);
- if (charpos.m_bGlyphAdjust) {
- CFX_AffineMatrix new_matrix(charpos.m_AdjustMatrix[0], charpos.m_AdjustMatrix[1],
- charpos.m_AdjustMatrix[2], charpos.m_AdjustMatrix[3], 0, 0);
- new_matrix.Concat(deviceCtm);
- glyph.m_pGlyph = pFaceCache->LoadGlyphBitmap(pFont, charpos.m_GlyphIndex, charpos.m_bFontStyle, &new_matrix,
- charpos.m_FontCharWidth, anti_alias, nativetext_flags);
- } else
- glyph.m_pGlyph = pFaceCache->LoadGlyphBitmap(pFont, charpos.m_GlyphIndex, charpos.m_bFontStyle, &deviceCtm,
- charpos.m_FontCharWidth, anti_alias, nativetext_flags);
- }
- if (anti_alias < FXFT_RENDER_MODE_LCD && nChars > 1) {
- _AdjustGlyphSpace(pGlyphAndPos, nChars);
- }
- FX_RECT bmp_rect1 = FXGE_GetGlyphsBBox(pGlyphAndPos, nChars, anti_alias);
- if (scale_x > 1 && scale_y > 1) {
- bmp_rect1.left--;
- bmp_rect1.top --;
- bmp_rect1.right ++;
- bmp_rect1.bottom ++;
- }
- FX_RECT bmp_rect(FXSYS_round((FX_FLOAT)(bmp_rect1.left) / scale_x), FXSYS_round((FX_FLOAT)(bmp_rect1.top) / scale_y),
- FXSYS_round((FX_FLOAT)bmp_rect1.right / scale_x), FXSYS_round((FX_FLOAT)bmp_rect1.bottom / scale_y));
- bmp_rect.Intersect(m_ClipBox);
- if (bmp_rect.IsEmpty()) {
- FX_Free(pGlyphAndPos);
- return TRUE;
- }
- int pixel_width = FXSYS_round(bmp_rect.Width() * scale_x);
- int pixel_height = FXSYS_round(bmp_rect.Height() * scale_y);
- int pixel_left = FXSYS_round(bmp_rect.left * scale_x);
- int pixel_top = FXSYS_round(bmp_rect.top * scale_y);
- if (anti_alias == FXFT_RENDER_MODE_MONO) {
- CFX_DIBitmap bitmap;
- if (!bitmap.Create(pixel_width, pixel_height, FXDIB_1bppMask)) {
- FX_Free(pGlyphAndPos);
- return FALSE;
- }
- bitmap.Clear(0);
- for (iChar = 0; iChar < nChars; iChar ++) {
- FXTEXT_GLYPHPOS& glyph = pGlyphAndPos[iChar];
- if (glyph.m_pGlyph == NULL) {
- continue;
- }
- const CFX_DIBitmap* pGlyph = &glyph.m_pGlyph->m_Bitmap;
- bitmap.TransferBitmap(glyph.m_OriginX + glyph.m_pGlyph->m_Left - pixel_left,
- glyph.m_OriginY - glyph.m_pGlyph->m_Top - pixel_top,
- pGlyph->GetWidth(), pGlyph->GetHeight(), pGlyph, 0, 0);
- }
- FX_Free(pGlyphAndPos);
- return SetBitMask(&bitmap, bmp_rect.left, bmp_rect.top, fill_color);
- }
- CFX_DIBitmap bitmap;
- if (m_bpp == 8) {
- if (!bitmap.Create(pixel_width, pixel_height, FXDIB_8bppMask)) {
- FX_Free(pGlyphAndPos);
- return FALSE;
- }
- } else {
- if (!CreateCompatibleBitmap(&bitmap, pixel_width, pixel_height)) {
- FX_Free(pGlyphAndPos);
- return FALSE;
- }
- }
- if (!bitmap.HasAlpha() && !bitmap.IsAlphaMask()) {
- bitmap.Clear(0xFFFFFFFF);
- if (!GetDIBits(&bitmap, bmp_rect.left, bmp_rect.top)) {
- FX_Free(pGlyphAndPos);
- return FALSE;
- }
- } else {
- bitmap.Clear(0);
- if (bitmap.m_pAlphaMask) {
- bitmap.m_pAlphaMask->Clear(0);
- }
- }
- int dest_width = pixel_width;
- FX_LPBYTE dest_buf = bitmap.GetBuffer();
- int dest_pitch = bitmap.GetPitch();
- int Bpp = bitmap.GetBPP() / 8;
- int a, r, g, b;
- if (anti_alias == FXFT_RENDER_MODE_LCD) {
- _Color2Argb(fill_color, fill_color, alpha_flag | (1 << 24), pIccTransform);
- ArgbDecode(fill_color, a, r, g, b);
- r = FX_GAMMA(r);
- g = FX_GAMMA(g);
- b = FX_GAMMA(b);
- }
- for (iChar = 0; iChar < nChars; iChar ++) {
- FXTEXT_GLYPHPOS& glyph = pGlyphAndPos[iChar];
- if (glyph.m_pGlyph == NULL) {
- continue;
- }
- const CFX_DIBitmap* pGlyph = &glyph.m_pGlyph->m_Bitmap;
- int left = glyph.m_OriginX + glyph.m_pGlyph->m_Left - pixel_left;
- int top = glyph.m_OriginY - glyph.m_pGlyph->m_Top - pixel_top;
- int ncols = pGlyph->GetWidth();
- int nrows = pGlyph->GetHeight();
- if (anti_alias == FXFT_RENDER_MODE_NORMAL) {
- if (!bitmap.CompositeMask(left, top, ncols, nrows, pGlyph, fill_color,
- 0, 0, FXDIB_BLEND_NORMAL, NULL, FALSE, alpha_flag, pIccTransform)) {
- FX_Free(pGlyphAndPos);
- return FALSE;
- }
- continue;
- }
- FX_BOOL bBGRStripe = text_flags & FXTEXT_BGR_STRIPE;
- ncols /= 3;
- int x_subpixel = (int)(glyph.m_fOriginX * 3) % 3;
- FX_LPBYTE src_buf = pGlyph->GetBuffer();
- int src_pitch = pGlyph->GetPitch();
- int start_col = left;
- if (start_col < 0) {
- start_col = 0;
- }
- int end_col = left + ncols;
- if (end_col > dest_width) {
- end_col = dest_width;
- }
- if (start_col >= end_col) {
- continue;
- }
- if (bitmap.GetFormat() == FXDIB_Argb) {
- for (int row = 0; row < nrows; row ++) {
- int dest_row = row + top;
- if (dest_row < 0 || dest_row >= bitmap.GetHeight()) {
- continue;
- }
- FX_LPBYTE src_scan = src_buf + row * src_pitch + (start_col - left) * 3;
- FX_LPBYTE dest_scan = dest_buf + dest_row * dest_pitch + (start_col << 2);
- if (bBGRStripe) {
- if (x_subpixel == 0) {
- for (int col = start_col; col < end_col; col ++) {
- int src_alpha = src_scan[2];
- src_alpha = src_alpha * a / 255;
- dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, src_alpha));
- src_alpha = src_scan[1];
- src_alpha = src_alpha * a / 255;
- dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), g, src_alpha));
- src_alpha = src_scan[0];
- src_alpha = src_alpha * a / 255;
- dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), b, src_alpha));
- dest_scan[3] = 255;
- dest_scan += 4;
- src_scan += 3;
- }
- } else if (x_subpixel == 1) {
- int src_alpha = src_scan[1];
- ADJUST_ALPHA(dest_scan[2], r, src_alpha, nativetext_flags, a);
- src_alpha = src_alpha * a / 255;
- dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, src_alpha));
- src_alpha = src_scan[0];
- ADJUST_ALPHA(dest_scan[1], g, src_alpha, nativetext_flags, a);
- src_alpha = src_alpha * a / 255;
- dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), g, src_alpha));
- if (start_col > left) {
- src_alpha = src_scan[-1];
- ADJUST_ALPHA(dest_scan[0], b, src_alpha, nativetext_flags, a);
- src_alpha = src_alpha * a / 255;
- dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), b, src_alpha));
- }
- dest_scan[3] = 255;
- dest_scan += 4;
- src_scan += 3;
- for (int col = start_col + 1; col < end_col - 1; col ++) {
- int src_alpha = src_scan[1];
- ADJUST_ALPHA(dest_scan[2], r, src_alpha, nativetext_flags, a);
- src_alpha = src_alpha * a / 255;
- dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, src_alpha));
- src_alpha = src_scan[0];
- ADJUST_ALPHA(dest_scan[1], g, src_alpha, nativetext_flags, a);
- src_alpha = src_alpha * a / 255;
- dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), g, src_alpha));
- src_alpha = src_scan[-1];
- ADJUST_ALPHA(dest_scan[0], b, src_alpha, nativetext_flags, a);
- src_alpha = src_alpha * a / 255;
- dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), b, src_alpha));
- dest_scan[3] = 255;
- dest_scan += 4;
- src_scan += 3;
- }
- } else {
- int src_alpha = src_scan[0];
- ADJUST_ALPHA(dest_scan[2], r, src_alpha, nativetext_flags, a);
- src_alpha = src_alpha * a / 255;
- dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, src_alpha));
- if (start_col > left) {
- src_alpha = src_scan[-1];
- ADJUST_ALPHA(dest_scan[1], g, src_alpha, nativetext_flags, a);
- src_alpha = src_alpha * a / 255;
- dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), g, src_alpha));
- src_alpha = src_scan[-2];
- ADJUST_ALPHA(dest_scan[0], b, src_alpha, nativetext_flags, a);
- src_alpha = src_alpha * a / 255;
- dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), b, src_alpha));
- }
- dest_scan[3] = 255;
- dest_scan += 4;
- src_scan += 3;
- for (int col = start_col + 1; col < end_col - 1; col ++) {
- int src_alpha = src_scan[0];
- ADJUST_ALPHA(dest_scan[2], r, src_alpha, nativetext_flags, a);
- src_alpha = src_alpha * a / 255;
- dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, src_alpha));
- src_alpha = src_scan[-1];
- ADJUST_ALPHA(dest_scan[1], g, src_alpha, nativetext_flags, a);
- src_alpha = src_alpha * a / 255;
- dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), g, src_alpha));
- src_alpha = src_scan[-2];
- ADJUST_ALPHA(dest_scan[0], b, src_alpha, nativetext_flags, a);
- src_alpha = src_alpha * a / 255;
- dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), b, src_alpha));
- dest_scan[3] = 255;
- dest_scan += 4;
- src_scan += 3;
- }
- }
- } else {
- if (x_subpixel == 0) {
- for (int col = start_col; col < end_col; col ++) {
- if (bNormal) {
- int src_alpha1 = (src_scan[0] + src_scan[1] + src_scan[2]) / 3;
- ADJUST_ALPHA(dest_scan[2], r, src_alpha1, nativetext_flags, a);
- src_alpha1 = src_alpha1 * a / 255;
- FX_BYTE back_alpha = dest_scan[3];
- if (back_alpha == 0) {
- FXARGB_SETDIB(dest_scan, FXARGB_MAKE(src_alpha1, r, g, b));
- dest_scan += 4;
- src_scan += 3;
- continue;
- }
- if (src_alpha1 == 0) {
- dest_scan += 4;
- src_scan += 3;
- continue;
- }
- FX_BYTE dest_alpha = back_alpha + src_alpha1 - back_alpha * src_alpha1 / 255;
- dest_scan[3] = dest_alpha;
- int alpha_ratio = src_alpha1 * 255 / dest_alpha;
- dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, alpha_ratio));
- dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), g, alpha_ratio));
- dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), b, alpha_ratio));
- dest_scan += 4;
- src_scan += 3;
- continue;
- }
- int src_alpha = src_scan[0];
- ADJUST_ALPHA(dest_scan[2], r, src_alpha, nativetext_flags, a);
- src_alpha = src_alpha * a / 255;
- dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, src_alpha));
- src_alpha = src_scan[1];
- ADJUST_ALPHA(dest_scan[1], g, src_alpha, nativetext_flags, a);
- src_alpha = src_alpha * a / 255;
- dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), g, src_alpha));
- src_alpha = src_scan[2];
- ADJUST_ALPHA(dest_scan[0], b, src_alpha, nativetext_flags, a);
- src_alpha = src_alpha * a / 255;
- dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), b, src_alpha));
- dest_scan[3] = 255;
- dest_scan += 4;
- src_scan += 3;
- }
- } else if (x_subpixel == 1) {
- if (bNormal) {
- int src_alpha1 = start_col > left ? ((src_scan[-1] + src_scan[0] + src_scan[1]) / 3) : ((src_scan[0] + src_scan[1]) / 3);
- ADJUST_ALPHA(dest_scan[2], r, src_alpha1, nativetext_flags, a);
- src_alpha1 = src_alpha1 * a / 255;
- if (src_alpha1 == 0) {
- dest_scan += 4;
- src_scan += 3;
- } else {
- FX_BYTE back_alpha = dest_scan[3];
- if (back_alpha == 0) {
- FXARGB_SETDIB(dest_scan, FXARGB_MAKE(src_alpha1, r, g, b));
- } else {
- FX_BYTE dest_alpha = back_alpha + src_alpha1 - back_alpha * src_alpha1 / 255;
- dest_scan[3] = dest_alpha;
- int alpha_ratio = src_alpha1 * 255 / dest_alpha;
- dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, alpha_ratio));
- dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), g, alpha_ratio));
- dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), b, alpha_ratio));
- }
- dest_scan += 4;
- src_scan += 3;
- }
- } else {
- if (start_col > left) {
- int src_alpha = src_scan[-1];
- ADJUST_ALPHA(dest_scan[2], r, src_alpha, nativetext_flags, a);
- src_alpha = src_alpha * a / 255;
- dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, src_alpha));
- }
- int src_alpha = src_scan[0];
- ADJUST_ALPHA(dest_scan[1], g, src_alpha, nativetext_flags, a);
- src_alpha = src_alpha * a / 255;
- dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), g, src_alpha));
- src_alpha = src_scan[1];
- ADJUST_ALPHA(dest_scan[0], b, src_alpha, nativetext_flags, a);
- src_alpha = src_alpha * a / 255;
- dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), b, src_alpha));
- dest_scan[3] = 255;
- dest_scan += 4;
- src_scan += 3;
- }
- for (int col = start_col + 1; col < end_col; col ++) {
- if (bNormal) {
- int src_alpha1 = (src_scan[-1] + src_scan[0] + src_scan[1]) / 3;
- ADJUST_ALPHA(dest_scan[2], r, src_alpha1, nativetext_flags, a);
- src_alpha1 = src_alpha1 * a / 255;
- FX_BYTE back_alpha = dest_scan[3];
- if (back_alpha == 0) {
- FXARGB_SETDIB(dest_scan, FXARGB_MAKE(src_alpha1, r, g, b));
- dest_scan += 4;
- src_scan += 3;
- continue;
- }
- if (src_alpha1 == 0) {
- dest_scan += 4;
- src_scan += 3;
- continue;
- }
- FX_BYTE dest_alpha = back_alpha + src_alpha1 - back_alpha * src_alpha1 / 255;
- dest_scan[3] = dest_alpha;
- int alpha_ratio = src_alpha1 * 255 / dest_alpha;
- dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, alpha_ratio));
- dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), g, alpha_ratio));
- dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), b, alpha_ratio));
- dest_scan += 4;
- src_scan += 3;
- continue;
- }
- int src_alpha = src_scan[-1];
- ADJUST_ALPHA(dest_scan[2], r, src_alpha, nativetext_flags, a);
- src_alpha = src_alpha * a / 255;
- dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, src_alpha));
- src_alpha = src_scan[0];
- ADJUST_ALPHA(dest_scan[1], g, src_alpha, nativetext_flags, a);
- src_alpha = src_alpha * a / 255;
- dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), g, src_alpha));
- src_alpha = src_scan[1];
- ADJUST_ALPHA(dest_scan[0], b, src_alpha, nativetext_flags, a);
- src_alpha = src_alpha * a / 255;
- dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), b, src_alpha));
- dest_scan[3] = 255;
- dest_scan += 4;
- src_scan += 3;
- }
- } else {
- if (bNormal) {
- int src_alpha1 = start_col > left ? ((src_scan[-2] + src_scan[-1] + src_scan[0]) / 3) : ((src_scan[0]) / 3);
- ADJUST_ALPHA(dest_scan[2], r, src_alpha1, nativetext_flags, a);
- src_alpha1 = src_alpha1 * a / 255;
- if (src_alpha1 == 0) {
- dest_scan += 4;
- src_scan += 3;
- } else {
- FX_BYTE back_alpha = dest_scan[3];
- if (back_alpha == 0) {
- FXARGB_SETDIB(dest_scan, FXARGB_MAKE(src_alpha1, r, g, b));
- } else {
- FX_BYTE dest_alpha = back_alpha + src_alpha1 - back_alpha * src_alpha1 / 255;
- dest_scan[3] = dest_alpha;
- int alpha_ratio = src_alpha1 * 255 / dest_alpha;
- dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, alpha_ratio));
- dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), g, alpha_ratio));
- dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), b, alpha_ratio));
- }
- dest_scan += 4;
- src_scan += 3;
- }
- } else {
- if (start_col > left) {
- int src_alpha = src_scan[-2];
- ADJUST_ALPHA(dest_scan[2], r, src_alpha, nativetext_flags, a);
- src_alpha = src_alpha * a / 255;
- dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, src_alpha));
- src_alpha = src_scan[-1];
- ADJUST_ALPHA(dest_scan[1], g, src_alpha, nativetext_flags, a);
- src_alpha = src_alpha * a / 255;
- dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), g, src_alpha));
- }
- int src_alpha = src_scan[0];
- ADJUST_ALPHA(dest_scan[0], b, src_alpha, nativetext_flags, a);
- src_alpha = src_alpha * a / 255;
- dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), b, src_alpha));
- dest_scan[3] = 255;
- dest_scan += 4;
- src_scan += 3;
- }
- for (int col = start_col + 1; col < end_col; col ++) {
- if (bNormal) {
- int src_alpha1 = (src_scan[-2] + src_scan[-1] + src_scan[0]) / 3;
- ADJUST_ALPHA(dest_scan[2], r, src_alpha1, nativetext_flags, a);
- src_alpha1 = src_alpha1 * a / 255;
- FX_BYTE back_alpha = dest_scan[3];
- if (back_alpha == 0) {
- FXARGB_SETDIB(dest_scan, FXARGB_MAKE(src_alpha1, r, g, b));
- dest_scan += 4;
- src_scan += 3;
- continue;
- }
- if (src_alpha1 == 0) {
- dest_scan += 4;
- src_scan += 3;
- continue;
- }
- FX_BYTE dest_alpha = back_alpha + src_alpha1 - back_alpha * src_alpha1 / 255;
- dest_scan[3] = dest_alpha;
- int alpha_ratio = src_alpha1 * 255 / dest_alpha;
- dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, alpha_ratio));
- dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), g, alpha_ratio));
- dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), b, alpha_ratio));
- dest_scan += 4;
- src_scan += 3;
- continue;
- }
- int src_alpha = src_scan[-2];
- ADJUST_ALPHA(dest_scan[2], r, src_alpha, nativetext_flags, a);
- src_alpha = src_alpha * a / 255;
- dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, src_alpha));
- src_alpha = src_scan[-1];
- ADJUST_ALPHA(dest_scan[1], g, src_alpha, nativetext_flags, a);
- src_alpha = src_alpha * a / 255;
- dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), g, src_alpha));
- src_alpha = src_scan[0];
- ADJUST_ALPHA(dest_scan[0], b, src_alpha, nativetext_flags, a);
- src_alpha = src_alpha * a / 255;
- dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), b, src_alpha));
- dest_scan[3] = 255;
- dest_scan += 4;
- src_scan += 3;
- }
- }
- }
- }
- } else {
- for (int row = 0; row < nrows; row ++) {
- int dest_row = row + top;
- if (dest_row < 0 || dest_row >= bitmap.GetHeight()) {
- continue;
- }
- FX_LPBYTE src_scan = src_buf + row * src_pitch + (start_col - left) * 3;
- FX_LPBYTE dest_scan = dest_buf + dest_row * dest_pitch + start_col * Bpp;
- if (bBGRStripe) {
- if (x_subpixel == 0) {
- for (int col = start_col; col < end_col; col ++) {
- int src_alpha = src_scan[2];
- ADJUST_ALPHA(dest_scan[2], r, src_alpha, nativetext_flags, a);
- src_alpha = src_alpha * a / 255;
- dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, src_alpha));
- src_alpha = src_scan[1];
- ADJUST_ALPHA(dest_scan[1], g, src_alpha, nativetext_flags, a);
- src_alpha = src_alpha * a / 255;
- dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), g, src_alpha));
- src_alpha = src_scan[0];
- ADJUST_ALPHA(dest_scan[0], b, src_alpha, nativetext_flags, a);
- src_alpha = src_alpha * a / 255;
- dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), b, src_alpha));
- dest_scan += Bpp;
- src_scan += 3;
- }
- } else if (x_subpixel == 1) {
- int src_alpha = src_scan[1];
- ADJUST_ALPHA(dest_scan[2], r, src_alpha, nativetext_flags, a);
- src_alpha = src_alpha * a / 255;
- dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, src_alpha));
- src_alpha = src_scan[0];
- ADJUST_ALPHA(dest_scan[1], g, src_alpha, nativetext_flags, a);
- src_alpha = src_alpha * a / 255;
- dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), g, src_alpha));
- if (start_col > left) {
- src_alpha = src_scan[-1];
- ADJUST_ALPHA(dest_scan[0], b, src_alpha, nativetext_flags, a);
- src_alpha = src_alpha * a / 255;
- dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), b, src_alpha));
- }
- dest_scan += Bpp;
- src_scan += 3;
- for (int col = start_col + 1; col < end_col - 1; col ++) {
- int src_alpha = src_scan[1];
- ADJUST_ALPHA(dest_scan[2], r, src_alpha, nativetext_flags, a);
- src_alpha = src_alpha * a / 255;
- dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, src_alpha));
- src_alpha = src_scan[0];
- ADJUST_ALPHA(dest_scan[1], g, src_alpha, nativetext_flags, a);
- src_alpha = src_alpha * a / 255;
- dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), g, src_alpha));
- src_alpha = src_scan[-1];
- ADJUST_ALPHA(dest_scan[0], b, src_alpha, nativetext_flags, a);
- src_alpha = src_alpha * a / 255;
- dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), b, src_alpha));
- dest_scan += Bpp;
- src_scan += 3;
- }
- } else {
- int src_alpha = src_scan[0];
- ADJUST_ALPHA(dest_scan[2], r, src_alpha, nativetext_flags, a);
- src_alpha = src_alpha * a / 255;
- dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, src_alpha));
- if (start_col > left) {
- src_alpha = src_scan[-1];
- ADJUST_ALPHA(dest_scan[1], g, src_alpha, nativetext_flags, a);
- src_alpha = src_alpha * a / 255;
- dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), g, src_alpha));
- src_alpha = src_scan[-2];
- ADJUST_ALPHA(dest_scan[0], b, src_alpha, nativetext_flags, a);
- src_alpha = src_alpha * a / 255;
- dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), b, src_alpha));
- }
- dest_scan += Bpp;
- src_scan += 3;
- for (int col = start_col + 1; col < end_col - 1; col ++) {
- int src_alpha = src_scan[0];
- ADJUST_ALPHA(dest_scan[2], r, src_alpha, nativetext_flags, a);
- src_alpha = src_alpha * a / 255;
- dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, src_alpha));
- src_alpha = src_scan[-1];
- ADJUST_ALPHA(dest_scan[1], g, src_alpha, nativetext_flags, a);
- src_alpha = src_alpha * a / 255;
- dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), g, src_alpha));
- src_alpha = src_scan[-2];
- ADJUST_ALPHA(dest_scan[0], b, src_alpha, nativetext_flags, a);
- src_alpha = src_alpha * a / 255;
- dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), b, src_alpha));
- dest_scan += Bpp;
- src_scan += 3;
- }
- }
- } else {
- if (x_subpixel == 0) {
- for (int col = start_col; col < end_col; col ++) {
- if (bNormal) {
- int src_alpha1 = (src_scan[0] + src_scan[1] + src_scan[2]) / 3;
- ADJUST_ALPHA(dest_scan[2], r, src_alpha1, nativetext_flags, a);
- src_alpha1 = src_alpha1 * a / 255;
- if (src_alpha1 == 0) {
- dest_scan += Bpp;
- src_scan += 3;
- continue;
- }
- dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, src_alpha1));
- dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), g, src_alpha1));
- dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), b, src_alpha1));
- dest_scan += Bpp;
- src_scan += 3;
- continue;
- }
- int src_alpha = src_scan[0];
- ADJUST_ALPHA(dest_scan[2], r, src_alpha, nativetext_flags, a);
- src_alpha = src_alpha * a / 255;
- dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, src_alpha));
- src_alpha = src_scan[1];
- ADJUST_ALPHA(dest_scan[1], g, src_alpha, nativetext_flags, a);
- src_alpha = src_alpha * a / 255;
- dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), g, src_alpha));
- src_alpha = src_scan[2];
- ADJUST_ALPHA(dest_scan[0], b, src_alpha, nativetext_flags, a);
- src_alpha = src_alpha * a / 255;
- dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), b, src_alpha));
- dest_scan += Bpp;
- src_scan += 3;
- }
- } else if (x_subpixel == 1) {
- if (bNormal) {
- int src_alpha1 = start_col > left ? (src_scan[0] + src_scan[1] + src_scan[-1]) / 3 : (src_scan[0] + src_scan[1]) / 3;
- ADJUST_ALPHA(dest_scan[2], r, src_alpha1, nativetext_flags, a);
- src_alpha1 = src_alpha1 * a / 255;
- dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, src_alpha1));
- dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), g, src_alpha1));
- dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), b, src_alpha1));
- dest_scan += Bpp;
- src_scan += 3;
- } else {
- if (start_col > left) {
- int src_alpha = src_scan[-1];
- ADJUST_ALPHA(dest_scan[2], r, src_alpha, nativetext_flags, a);
- src_alpha = src_alpha * a / 255;
- dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, src_alpha));
- }
- int src_alpha = src_scan[0];
- ADJUST_ALPHA(dest_scan[1], g, src_alpha, nativetext_flags, a);
- src_alpha = src_alpha * a / 255;
- dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), g, src_alpha));
- src_alpha = src_scan[1];
- ADJUST_ALPHA(dest_scan[0], b, src_alpha, nativetext_flags, a);
- src_alpha = src_alpha * a / 255;
- dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), b, src_alpha));
- dest_scan += Bpp;
- src_scan += 3;
- }
- for (int col = start_col + 1; col < end_col; col ++) {
- if (bNormal) {
- int src_alpha1 = (src_scan[0] + src_scan[1] + src_scan[-1]) / 3;
- ADJUST_ALPHA(dest_scan[2], r, src_alpha1, nativetext_flags, a);
- src_alpha1 = src_alpha1 * a / 255;
- if (src_alpha1 == 0) {
- dest_scan += Bpp;
- src_scan += 3;
- continue;
- }
- dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, src_alpha1));
- dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), g, src_alpha1));
- dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), b, src_alpha1));
- dest_scan += Bpp;
- src_scan += 3;
- continue;
- }
- int src_alpha = src_scan[-1];
- ADJUST_ALPHA(dest_scan[2], r, src_alpha, nativetext_flags, a);
- src_alpha = src_alpha * a / 255;
- dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, src_alpha));
- src_alpha = src_scan[0];
- ADJUST_ALPHA(dest_scan[1], g, src_alpha, nativetext_flags, a);
- src_alpha = src_alpha * a / 255;
- dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), g, src_alpha));
- src_alpha = src_scan[1];
- ADJUST_ALPHA(dest_scan[0], b, src_alpha, nativetext_flags, a);
- src_alpha = src_alpha * a / 255;
- dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), b, src_alpha));
- dest_scan += Bpp;
- src_scan += 3;
- }
- } else {
- if (bNormal) {
- int src_alpha1 = start_col > left ? (src_scan[0] + src_scan[-2] + src_scan[-1]) / 3 : src_scan[0] / 3;
- ADJUST_ALPHA(dest_scan[2], r, src_alpha1, nativetext_flags, a);
- src_alpha1 = src_alpha1 * a / 255;
- dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, src_alpha1));
- dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), g, src_alpha1));
- dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), b, src_alpha1));
- dest_scan += Bpp;
- src_scan += 3;
- } else {
- if (start_col > left) {
- int src_alpha = src_scan[-2];
- ADJUST_ALPHA(dest_scan[2], r, src_alpha, nativetext_flags, a);
- src_alpha = src_alpha * a / 255;
- dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, src_alpha));
- src_alpha = src_scan[-1];
- ADJUST_ALPHA(dest_scan[1], g, src_alpha, nativetext_flags, a);
- src_alpha = src_alpha * a / 255;
- dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), g, src_alpha));
- }
- int src_alpha = src_scan[0];
- ADJUST_ALPHA(dest_scan[0], b, src_alpha, nativetext_flags, a);
- src_alpha = src_alpha * a / 255;
- dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), b, src_alpha));
- dest_scan += Bpp;
- src_scan += 3;
- }
- for (int col = start_col + 1; col < end_col; col ++) {
- if (bNormal) {
- int src_alpha1 = ((int)(src_scan[0]) + (int)(src_scan[-2]) + (int)(src_scan[-1])) / 3;
- ADJUST_ALPHA(dest_scan[2], r, src_alpha1, nativetext_flags, a);
- src_alpha1 = src_alpha1 * a / 255;
- if (src_alpha1 == 0) {
- dest_scan += Bpp;
- src_scan += 3;
- continue;
- }
- dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, src_alpha1));
- dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), g, src_alpha1));
- dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), b, src_alpha1));
- dest_scan += Bpp;
- src_scan += 3;
- continue;
- }
- int src_alpha = src_scan[-2];
- ADJUST_ALPHA(dest_scan[2], r, src_alpha, nativetext_flags, a);
- src_alpha = src_alpha * a / 255;
- dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, src_alpha));
- src_alpha = src_scan[-1];
- ADJUST_ALPHA(dest_scan[1], g, src_alpha, nativetext_flags, a);
- src_alpha = src_alpha * a / 255;
- dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), g, src_alpha));
- src_alpha = src_scan[0];
- ADJUST_ALPHA(dest_scan[0], b, src_alpha, nativetext_flags, a);
- src_alpha = src_alpha * a / 255;
- dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), b, src_alpha));
- dest_scan += Bpp;
- src_scan += 3;
- }
- }
- }
- }
- }
- }
- if (bitmap.IsAlphaMask()) {
- SetBitMask(&bitmap, bmp_rect.left, bmp_rect.top, fill_color, alpha_flag, pIccTransform);
- } else {
- SetDIBits(&bitmap, bmp_rect.left, bmp_rect.top);
- }
- FX_Free(pGlyphAndPos);
- return TRUE;
-}
-FX_BOOL CFX_RenderDevice::DrawTextPath(int nChars, const FXTEXT_CHARPOS* pCharPos,
- CFX_Font* pFont, CFX_FontCache* pCache,
- FX_FLOAT font_size, const CFX_AffineMatrix* pText2User,
- const CFX_AffineMatrix* pUser2Device, const CFX_GraphStateData* pGraphState,
- FX_DWORD fill_color, FX_ARGB stroke_color, CFX_PathData* pClippingPath, int nFlag,
- int alpha_flag, void* pIccTransform, int blend_type)
-{
- if (pCache == NULL) {
- pCache = CFX_GEModule::Get()->GetFontCache();
- }
- CFX_FaceCache* pFaceCache = pCache->GetCachedFace(pFont);
- FX_FONTCACHE_DEFINE(pCache, pFont);
- for (int iChar = 0; iChar < nChars; iChar ++) {
- const FXTEXT_CHARPOS& charpos = pCharPos[iChar];
- CFX_AffineMatrix matrix;
- if (charpos.m_bGlyphAdjust)
- matrix.Set(charpos.m_AdjustMatrix[0], charpos.m_AdjustMatrix[1],
- charpos.m_AdjustMatrix[2], charpos.m_AdjustMatrix[3], 0, 0);
- matrix.Concat(font_size, 0, 0, font_size, charpos.m_OriginX, charpos.m_OriginY);
- const CFX_PathData* pPath = pFaceCache->LoadGlyphPath(pFont, charpos.m_GlyphIndex, charpos.m_FontCharWidth);
- if (pPath == NULL) {
- continue;
- }
- matrix.Concat(*pText2User);
- CFX_PathData TransformedPath(*pPath);
- TransformedPath.Transform(&matrix);
- FX_BOOL bHasAlpha = FXGETFLAG_COLORTYPE(alpha_flag) ?
- (FXGETFLAG_ALPHA_FILL(alpha_flag) || FXGETFLAG_ALPHA_STROKE(alpha_flag)) :
- (fill_color || stroke_color);
- if (bHasAlpha) {
- int fill_mode = nFlag;
- if (FXGETFLAG_COLORTYPE(alpha_flag)) {
- if (FXGETFLAG_ALPHA_FILL(alpha_flag)) {
- fill_mode |= FXFILL_WINDING;
- }
- } else {
- if (fill_color) {
- fill_mode |= FXFILL_WINDING;
- }
- }
- fill_mode |= FX_FILL_TEXT_MODE;
- if (!DrawPath(&TransformedPath, pUser2Device, pGraphState, fill_color, stroke_color, fill_mode, alpha_flag, pIccTransform, blend_type)) {
- return FALSE;
- }
- }
- if (pClippingPath) {
- pClippingPath->Append(&TransformedPath, pUser2Device);
- }
- }
- return TRUE;
-}
-CFX_FontCache::~CFX_FontCache()
-{
- FreeCache(TRUE);
-}
-CFX_FaceCache* CFX_FontCache::GetCachedFace(CFX_Font* pFont)
-{
- FX_BOOL bExternal = pFont->GetFace() == NULL;
- void* face = bExternal ? pFont->GetSubstFont()->m_ExtHandle : pFont->GetFace();
- CFX_FTCacheMap& map = bExternal ? m_ExtFaceMap : m_FTFaceMap;
- CFX_CountedFaceCache* counted_face_cache = NULL;
- if (map.Lookup((FXFT_Face)face, counted_face_cache)) {
- counted_face_cache->m_nCount++;
- return counted_face_cache->m_Obj;
- }
- CFX_FaceCache* face_cache = NULL;
- face_cache = FX_NEW CFX_FaceCache(bExternal ? NULL : (FXFT_Face)face);
- if (face_cache == NULL) {
- return NULL;
- }
- counted_face_cache = FX_NEW CFX_CountedFaceCache;
- if (!counted_face_cache) {
- if (face_cache) {
- delete face_cache;
- face_cache = NULL;
- }
- return NULL;
- }
- counted_face_cache->m_nCount = 2;
- counted_face_cache->m_Obj = face_cache;
- map.SetAt((FXFT_Face)face, counted_face_cache);
- return face_cache;
-}
-void CFX_FontCache::ReleaseCachedFace(CFX_Font* pFont)
-{
- FX_BOOL bExternal = pFont->GetFace() == NULL;
- void* face = bExternal ? pFont->GetSubstFont()->m_ExtHandle : pFont->GetFace();
- CFX_FTCacheMap& map = bExternal ? m_ExtFaceMap : m_FTFaceMap;
- CFX_CountedFaceCache* counted_face_cache = NULL;
- if (!map.Lookup((FXFT_Face)face, counted_face_cache)) {
- return;
- }
- if (counted_face_cache->m_nCount > 1) {
- counted_face_cache->m_nCount--;
- }
-}
-void CFX_FontCache::FreeCache(FX_BOOL bRelease)
-{
- {
- FX_POSITION pos;
- pos = m_FTFaceMap.GetStartPosition();
- while (pos) {
- FXFT_Face face;
- CFX_CountedFaceCache* cache;
- m_FTFaceMap.GetNextAssoc(pos, face, cache);
- if (bRelease || cache->m_nCount < 2) {
- delete cache->m_Obj;
- delete cache;
- m_FTFaceMap.RemoveKey(face);
- }
- }
- pos = m_ExtFaceMap.GetStartPosition();
- while (pos) {
- FXFT_Face face;
- CFX_CountedFaceCache* cache;
- m_ExtFaceMap.GetNextAssoc(pos, face, cache);
- if (bRelease || cache->m_nCount < 2) {
- delete cache->m_Obj;
- delete cache;
- m_ExtFaceMap.RemoveKey(face);
- }
- }
- }
-}
-CFX_FaceCache::CFX_FaceCache(FXFT_Face face)
-{
- m_Face = face;
- m_pBitmap = NULL;
-}
-CFX_FaceCache::~CFX_FaceCache()
-{
- FX_POSITION pos = m_SizeMap.GetStartPosition();
- CFX_ByteString Key;
- CFX_SizeGlyphCache* pSizeCache = NULL;
- while(pos) {
- m_SizeMap.GetNextAssoc( pos, Key, (void*&)pSizeCache);
- delete pSizeCache;
- }
- m_SizeMap.RemoveAll();
- pos = m_PathMap.GetStartPosition();
- FX_LPVOID key1;
- CFX_PathData* pPath;
- while (pos) {
- m_PathMap.GetNextAssoc(pos, key1, (FX_LPVOID&)pPath);
- delete pPath;
- }
- if (m_pBitmap) {
- delete m_pBitmap;
- }
- m_PathMap.RemoveAll();
-}
-#if ((_FXM_PLATFORM_ != _FXM_PLATFORM_APPLE_)|| defined(_FPDFAPI_MINI_))
-void CFX_FaceCache::InitPlatform()
-{
-}
-#endif
-CFX_GlyphBitmap* CFX_FaceCache::LookUpGlyphBitmap(CFX_Font* pFont, const CFX_AffineMatrix* pMatrix,
- CFX_ByteStringC& FaceGlyphsKey, FX_DWORD glyph_index, FX_BOOL bFontStyle,
- int dest_width, int anti_alias)
-{
- CFX_SizeGlyphCache* pSizeCache = NULL;
- if (!m_SizeMap.Lookup(FaceGlyphsKey, (void*&)pSizeCache)) {
- pSizeCache = FX_NEW CFX_SizeGlyphCache;
- if (pSizeCache == NULL) {
- return NULL;
- }
- m_SizeMap.SetAt(FaceGlyphsKey, pSizeCache);
- }
- CFX_GlyphBitmap* pGlyphBitmap = NULL;
- if (pSizeCache->m_GlyphMap.Lookup((FX_LPVOID)(FX_UINTPTR)glyph_index, (void*&)pGlyphBitmap)) {
- return pGlyphBitmap;
- }
- pGlyphBitmap = RenderGlyph(pFont, glyph_index, bFontStyle, pMatrix, dest_width, anti_alias);
- if (pGlyphBitmap == NULL) {
- return NULL;
- }
- pSizeCache->m_GlyphMap.SetAt((FX_LPVOID)(FX_UINTPTR)glyph_index, pGlyphBitmap);
- return pGlyphBitmap;
-}
-const CFX_GlyphBitmap* CFX_FaceCache::LoadGlyphBitmap(CFX_Font* pFont, FX_DWORD glyph_index, FX_BOOL bFontStyle, const CFX_AffineMatrix* pMatrix,
- int dest_width, int anti_alias, int& text_flags)
-{
- if (glyph_index == (FX_DWORD) - 1) {
- return NULL;
- }
- _CFX_UniqueKeyGen keygen;
-#if ((_FXM_PLATFORM_ != _FXM_PLATFORM_APPLE_)|| defined(_FPDFAPI_MINI_))
- if (pFont->GetSubstFont())
- keygen.Generate(9, (int)(pMatrix->a * 10000), (int)(pMatrix->b * 10000),
- (int)(pMatrix->c * 10000), (int)(pMatrix->d * 10000), dest_width, anti_alias,
- pFont->GetSubstFont()->m_Weight, pFont->GetSubstFont()->m_ItalicAngle, pFont->IsVertical());
- else
- keygen.Generate(6, (int)(pMatrix->a * 10000), (int)(pMatrix->b * 10000),
- (int)(pMatrix->c * 10000), (int)(pMatrix->d * 10000), dest_width, anti_alias);
-#else
- if (text_flags & FXTEXT_NO_NATIVETEXT) {
- if (pFont->GetSubstFont())
- keygen.Generate(9, (int)(pMatrix->a * 10000), (int)(pMatrix->b * 10000),
- (int)(pMatrix->c * 10000), (int)(pMatrix->d * 10000), dest_width, anti_alias,
- pFont->GetSubstFont()->m_Weight, pFont->GetSubstFont()->m_ItalicAngle, pFont->IsVertical());
- else
- keygen.Generate(6, (int)(pMatrix->a * 10000), (int)(pMatrix->b * 10000),
- (int)(pMatrix->c * 10000), (int)(pMatrix->d * 10000), dest_width, anti_alias);
- } else {
- if (pFont->GetSubstFont())
- keygen.Generate(10, (int)(pMatrix->a * 10000), (int)(pMatrix->b * 10000),
- (int)(pMatrix->c * 10000), (int)(pMatrix->d * 10000), dest_width, anti_alias,
- pFont->GetSubstFont()->m_Weight, pFont->GetSubstFont()->m_ItalicAngle, pFont->IsVertical(), 3);
- else
- keygen.Generate(7, (int)(pMatrix->a * 10000), (int)(pMatrix->b * 10000),
- (int)(pMatrix->c * 10000), (int)(pMatrix->d * 10000), dest_width, anti_alias, 3);
- }
-#endif
- CFX_ByteStringC FaceGlyphsKey(keygen.m_Key, keygen.m_KeyLen);
-#if ((_FXM_PLATFORM_ != _FXM_PLATFORM_APPLE_)|| defined(_FPDFAPI_MINI_))
- return LookUpGlyphBitmap(pFont, pMatrix, FaceGlyphsKey, glyph_index, bFontStyle, dest_width, anti_alias);
-#else
- if (text_flags & FXTEXT_NO_NATIVETEXT) {
- return LookUpGlyphBitmap(pFont, pMatrix, FaceGlyphsKey, glyph_index, bFontStyle, dest_width, anti_alias);
- } else {
- CFX_GlyphBitmap* pGlyphBitmap;
- CFX_SizeGlyphCache* pSizeCache = NULL;
- if (m_SizeMap.Lookup(FaceGlyphsKey, (void*&)pSizeCache)) {
- if (pSizeCache->m_GlyphMap.Lookup((FX_LPVOID)(FX_UINTPTR)glyph_index, (void*&)pGlyphBitmap)) {
- return pGlyphBitmap;
- }
- pGlyphBitmap = RenderGlyph_Nativetext(pFont, glyph_index, pMatrix, dest_width, anti_alias);
- if (pGlyphBitmap) {
- pSizeCache->m_GlyphMap.SetAt((FX_LPVOID)(FX_UINTPTR)glyph_index, pGlyphBitmap);
- return pGlyphBitmap;
- }
- } else {
- pGlyphBitmap = RenderGlyph_Nativetext(pFont, glyph_index, pMatrix, dest_width, anti_alias);
- if (pGlyphBitmap) {
- pSizeCache = FX_NEW CFX_SizeGlyphCache;
- if (pSizeCache == NULL) {
- return NULL;
- }
- m_SizeMap.SetAt(FaceGlyphsKey, pSizeCache);
- pSizeCache->m_GlyphMap.SetAt((FX_LPVOID)(FX_UINTPTR)glyph_index, pGlyphBitmap);
- return pGlyphBitmap;
- }
- }
- if (pFont->GetSubstFont())
- keygen.Generate(9, (int)(pMatrix->a * 10000), (int)(pMatrix->b * 10000),
- (int)(pMatrix->c * 10000), (int)(pMatrix->d * 10000), dest_width, anti_alias,
- pFont->GetSubstFont()->m_Weight, pFont->GetSubstFont()->m_ItalicAngle, pFont->IsVertical());
- else
- keygen.Generate(6, (int)(pMatrix->a * 10000), (int)(pMatrix->b * 10000),
- (int)(pMatrix->c * 10000), (int)(pMatrix->d * 10000), dest_width, anti_alias);
- CFX_ByteStringC FaceGlyphsKey(keygen.m_Key, keygen.m_KeyLen);
- text_flags |= FXTEXT_NO_NATIVETEXT;
- return LookUpGlyphBitmap(pFont, pMatrix, FaceGlyphsKey, glyph_index, bFontStyle, dest_width, anti_alias);
- }
-#endif
-}
-CFX_SizeGlyphCache::~CFX_SizeGlyphCache()
-{
- FX_POSITION pos = m_GlyphMap.GetStartPosition();
- FX_LPVOID Key;
- CFX_GlyphBitmap* pGlyphBitmap = NULL;
- while(pos) {
- m_GlyphMap.GetNextAssoc(pos, Key, (void*&)pGlyphBitmap);
- delete pGlyphBitmap;
- }
- m_GlyphMap.RemoveAll();
-}
-#if defined(_FPDFAPI_MINI_)
-#define CONTRAST_RAMP_STEP 16
-#else
-#define CONTRAST_RAMP_STEP 1
-#endif
-static const FX_BYTE g_adjust_contrast11[256] = {
- 0, 0, 2, 3, 4, 5, 6, 8, 9, 10, 11, 13, 14, 15, 17, 18, 19, 21, 22, 24, 25, 26, 28, 29, 31,
- 32, 33, 35, 36, 38, 39, 40, 42, 43, 45, 46, 48, 49, 51, 52, 54, 55, 56, 58, 59, 61, 62, 64, 65,
- 67, 68, 70, 71, 72, 74, 75, 77, 78, 80, 81, 83, 84, 86, 87, 89, 90, 91, 93, 94, 96, 97, 99, 100,
- 101, 103, 104, 106, 107, 109, 110, 111, 113, 114, 116, 117, 118, 120, 121, 123, 124, 125, 127,
- 128, 130, 131, 132, 134, 135, 136, 138, 139, 140, 142, 143, 144, 146, 147, 148, 149, 151, 152,
- 153, 155, 156, 157, 158, 160, 161, 162, 163, 165, 166, 167, 168, 169, 171, 172, 173, 174, 175,
- 177, 178, 179, 180, 181, 182, 183, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196,
- 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215,
- 215, 216, 217, 218, 219, 220, 221, 221, 222, 223, 224, 224, 225, 226, 227, 227, 228, 229, 230,
- 230, 231, 232, 232, 233, 234, 234, 235, 236, 236, 237, 237, 238, 239, 239, 240, 240, 241, 241,
- 242, 242, 243, 243, 244, 244, 245, 245, 246, 246, 246, 247, 247, 248, 248, 248, 249, 249, 249,
- 250, 250, 250, 251, 251, 251, 251, 252, 252, 252, 252, 253, 253, 253, 253, 253, 253, 254, 254,
- 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 255,
-};
-static const FX_BYTE g_adjust_contrast15[256] = {
- 0, 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 5, 5, 6, 7, 7, 8, 9, 10, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
- 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 34, 35, 36, 37, 38, 40, 41, 42, 43, 45, 46, 47, 48, 50, 51,
- 52, 54, 55, 56, 58, 59, 60, 62, 63, 64, 66, 67, 68, 70, 71, 73, 74, 75, 77, 78, 80, 81, 82, 84, 85, 87,
- 88, 90, 91, 93, 94, 95, 97, 98, 100, 101, 103, 104, 106, 107, 109, 110, 111, 113, 114, 116, 117, 119,
- 120, 122, 123, 125, 126, 128, 129, 130, 132, 133, 135, 136, 138, 139, 141, 142, 143, 145, 146, 148,
- 149, 150, 152, 153, 155, 156, 157, 159, 160, 161, 163, 164, 166, 167, 168, 170, 171, 172, 174, 175,
- 176, 177, 179, 180, 181, 183, 184, 185, 186, 188, 189, 190, 191, 192, 194, 195, 196, 197, 198, 199,
- 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220,
- 221, 222, 223, 224, 225, 226, 227, 227, 228, 229, 230, 231, 232, 232, 233, 234, 235, 235, 236, 237,
- 237, 238, 239, 239, 240, 241, 241, 242, 242, 243, 244, 244, 245, 245, 246, 246, 247, 247, 248, 248,
- 248, 249, 249, 250, 250, 250, 251, 251, 251, 252, 252, 252, 252, 253, 253, 253, 253, 253, 254, 254,
- 254, 254, 254, 254, 254, 254, 254, 254, 254, 255,
-};
-static void _CalcContrastRamp(FX_LPBYTE ramp, int level)
-{
- int contrast_min = 0, contrast_max = 255 - level, i;
- for (i = 0; i < contrast_min; i ++) {
- ramp[i] = 0;
- }
- for (i = contrast_min; i < contrast_max; i ++) {
- ramp[i] = 255 * (i - contrast_min) / (contrast_max - contrast_min);
- }
- for (i = contrast_max; i < 256; i ++) {
- ramp[i] = 255;
- }
-}
-void CFX_Font::AdjustMMParams(int glyph_index, int dest_width, int weight)
-{
- FXFT_MM_Var pMasters = NULL;
- FXFT_Get_MM_Var(m_Face, &pMasters);
- if (pMasters == NULL) {
- return;
- }
- long coords[2];
- if (weight == 0) {
- coords[0] = FXFT_Get_MM_Axis_Def(FXFT_Get_MM_Axis(pMasters, 0)) / 65536;
- } else {
- coords[0] = weight;
- }
- if (dest_width == 0) {
- coords[1] = FXFT_Get_MM_Axis_Def(FXFT_Get_MM_Axis(pMasters, 1)) / 65536;
- } else {
- int min_param = FXFT_Get_MM_Axis_Min(FXFT_Get_MM_Axis(pMasters, 1)) / 65536;
- int max_param = FXFT_Get_MM_Axis_Max(FXFT_Get_MM_Axis(pMasters, 1)) / 65536;
- coords[1] = min_param;
- int error = FXFT_Set_MM_Design_Coordinates(m_Face, 2, coords);
- error = FXFT_Load_Glyph(m_Face, glyph_index, FXFT_LOAD_NO_SCALE | FXFT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH);
- int min_width = FXFT_Get_Glyph_HoriAdvance(m_Face) * 1000 / FXFT_Get_Face_UnitsPerEM(m_Face);
- coords[1] = max_param;
- error = FXFT_Set_MM_Design_Coordinates(m_Face, 2, coords);
- error = FXFT_Load_Glyph(m_Face, glyph_index, FXFT_LOAD_NO_SCALE | FXFT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH);
- int max_width = FXFT_Get_Glyph_HoriAdvance(m_Face) * 1000 / FXFT_Get_Face_UnitsPerEM(m_Face);
- if (max_width == min_width) {
- return;
- }
- int param = min_param + (max_param - min_param) * (dest_width - min_width) / (max_width - min_width);
- coords[1] = param;
- }
- FXFT_Free(m_Face, pMasters);
- FXFT_Set_MM_Design_Coordinates(m_Face, 2, coords);
-}
-extern const char g_AngleSkew[30] = {
- 0, 2, 3, 5, 7, 9, 11, 12, 14, 16,
- 18, 19, 21, 23, 25, 27, 29, 31, 32, 34,
- 36, 38, 40, 42, 45, 47, 49, 51, 53, 55,
-};
-static const FX_BYTE g_WeightPow[100] = {
- 0, 3, 6, 7, 8, 9, 11, 12, 14, 15, 16, 17, 18, 19, 20,
- 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 35, 36, 36,
- 37, 37, 37, 38, 38, 38, 39, 39, 39, 40, 40, 40, 41, 41, 41, 42, 42, 42,
- 42, 43, 43, 43, 44, 44, 44, 44, 45, 45, 45, 45, 46, 46, 46, 46, 47, 47,
- 47, 47, 48, 48, 48, 48, 48, 49, 49, 49, 49, 50, 50, 50, 50, 50, 51, 51,
- 51, 51, 51, 52, 52, 52, 52, 52, 53, 53, 53, 53, 53,
-};
-extern const FX_BYTE g_WeightPow_11[100] = {
- 0, 4, 7, 8, 9, 10, 12, 13, 15, 17, 18, 19, 20, 21, 22,
- 23, 24, 25, 26, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 39, 39, 40, 40,
- 41, 41, 41, 42, 42, 42, 43, 43, 43, 44, 44, 44, 45, 45, 45, 46, 46, 46,
- 46, 43, 47, 47, 48, 48, 48, 48, 45, 50, 50, 50, 46, 51, 51, 51, 52, 52,
- 52, 52, 53, 53, 53, 53, 53, 54, 54, 54, 54, 55, 55, 55, 55, 55, 56, 56,
- 56, 56, 56, 57, 57, 57, 57, 57, 58, 58, 58, 58, 58,
-};
-extern const FX_BYTE g_WeightPow_SHIFTJIS[100] = {
- 0, 0, 1, 2, 3, 4, 5, 7, 8, 10, 11, 13, 14, 16, 17, 19, 21, 22, 24, 26, 28,
- 30, 32, 33, 35, 37, 39, 41, 43, 45, 48, 48, 48, 48, 49, 49, 49, 50, 50, 50, 50,
- 51, 51, 51, 51, 52, 52, 52, 52, 52, 53, 53, 53, 53, 53, 54, 54, 54, 54, 54, 55, 55,
- 55, 55, 55, 56, 56, 56, 56, 56 , 56, 57, 57, 57 , 57 , 57, 57, 57, 58, 58, 58, 58, 58,
- 58, 58, 59, 59, 59, 59, 59, 59, 59, 60, 60, 60, 60, 60, 60, 60, 60,
-};
-static void _GammaAdjust(FX_LPBYTE pData, int nWid, int nHei, int src_pitch, FX_LPCBYTE gammaTable)
-{
- int count = nHei * src_pitch;
- for(int i = 0; i < count; i++) {
- pData[i] = gammaTable[pData[i]];
- }
-}
-static void _ContrastAdjust(FX_LPBYTE pDataIn, FX_LPBYTE pDataOut, int nWid, int nHei, int nSrcRowBytes, int nDstRowBytes)
-{
- int col, row, temp;
- int max = 0, min = 255;
- FX_FLOAT rate;
- for (row = 0; row < nHei; row ++) {
- FX_LPBYTE pRow = pDataIn + row * nSrcRowBytes;
- for (col = 0; col < nWid; col++) {
- temp = *pRow ++;
- if (temp > max) {
- max = temp;
- }
- if (temp < min) {
- min = temp;
- }
- }
- }
- temp = max - min;
- if (0 == temp || 255 == temp) {
- int rowbytes = FXSYS_abs(nSrcRowBytes) > nDstRowBytes ? nDstRowBytes : FXSYS_abs(nSrcRowBytes);
- for (row = 0; row < nHei; row ++) {
- FXSYS_memcpy32(pDataOut + row * nDstRowBytes, pDataIn + row * nSrcRowBytes, rowbytes);
- }
- return;
- }
- rate = 255.f / temp;
- for (row = 0; row < nHei; row ++) {
- FX_LPBYTE pSrcRow = pDataIn + row * nSrcRowBytes;
- FX_LPBYTE pDstRow = pDataOut + row * nDstRowBytes;
- for (col = 0; col < nWid; col ++) {
- temp = (int)((*(pSrcRow++) - min) * rate + 0.5);
- if (temp > 255) {
- temp = 255;
- } else if (temp < 0) {
- temp = 0;
- }
- *pDstRow ++ = (FX_BYTE)temp;
- }
- }
-}
-CFX_GlyphBitmap* CFX_FaceCache::RenderGlyph(CFX_Font* pFont, FX_DWORD glyph_index, FX_BOOL bFontStyle,
- const CFX_AffineMatrix* pMatrix, int dest_width, int anti_alias)
-{
- if (m_Face == NULL) {
- return NULL;
- }
- FXFT_Matrix ft_matrix;
- ft_matrix.xx = (signed long)(pMatrix->GetA() / 64 * 65536);
- ft_matrix.xy = (signed long)(pMatrix->GetC() / 64 * 65536);
- ft_matrix.yx = (signed long)(pMatrix->GetB() / 64 * 65536);
- ft_matrix.yy = (signed long)(pMatrix->GetD() / 64 * 65536);
- FX_BOOL bUseCJKSubFont = FALSE;
- const CFX_SubstFont* pSubstFont = pFont->GetSubstFont();
- if (pSubstFont) {
- bUseCJKSubFont = pSubstFont->m_bSubstOfCJK && bFontStyle;
- int skew = 0;
- if (bUseCJKSubFont) {
- skew = pSubstFont->m_bItlicCJK ? -15 : 0;
- } else {
- skew = pSubstFont->m_ItalicAngle;
- }
- if (skew) {
- skew = skew <= -30 ? -58 : -g_AngleSkew[-skew];
- if (pFont->IsVertical()) {
- ft_matrix.yx += ft_matrix.yy * skew / 100;
- } else {
- ft_matrix.xy += -ft_matrix.xx * skew / 100;
- }
- }
- if (pSubstFont->m_SubstFlags & FXFONT_SUBST_MM) {
- pFont->AdjustMMParams(glyph_index, dest_width, pFont->GetSubstFont()->m_Weight);
- }
- }
- int transflag = FXFT_Get_Face_Internal_Flag(m_Face);
- FXFT_Set_Transform(m_Face, &ft_matrix, 0);
- int load_flags = (m_Face->face_flags & FT_FACE_FLAG_SFNT) ? FXFT_LOAD_NO_BITMAP : (FXFT_LOAD_NO_BITMAP | FT_LOAD_NO_HINTING);
- int error = FXFT_Load_Glyph(m_Face, glyph_index, load_flags);
- if (error) {
- FXFT_Set_Face_Internal_Flag(m_Face, transflag);
- return NULL;
- }
- int weight = 0;
- if (bUseCJKSubFont) {
- weight = pSubstFont->m_WeightCJK;
- } else {
- weight = pSubstFont ? pSubstFont->m_Weight : 0;
- }
- if (pSubstFont && !(pSubstFont->m_SubstFlags & FXFONT_SUBST_MM) && weight > 400) {
- int index = (weight - 400) / 10;
- if (index >= 100) {
- FXFT_Set_Face_Internal_Flag(m_Face, transflag);
- return NULL;
- }
- int level = 0;
- if (pSubstFont->m_Charset == FXFONT_SHIFTJIS_CHARSET) {
- level = g_WeightPow_SHIFTJIS[index] * 2 * (FXSYS_abs((int)(ft_matrix.xx)) + FXSYS_abs((int)(ft_matrix.xy))) / 36655;
- } else {
- level = g_WeightPow_11[index] * (FXSYS_abs((int)(ft_matrix.xx)) + FXSYS_abs((int)(ft_matrix.xy))) / 36655;
- }
- FXFT_Outline_Embolden(FXFT_Get_Glyph_Outline(m_Face), level);
- }
- FXFT_Library_SetLcdFilter(CFX_GEModule::Get()->GetFontMgr()->m_FTLibrary, FT_LCD_FILTER_DEFAULT);
- error = FXFT_Render_Glyph(m_Face, anti_alias);
- if (error) {
- FXFT_Set_Face_Internal_Flag(m_Face, transflag);
- return NULL;
- }
- int bmwidth = FXFT_Get_Bitmap_Width(FXFT_Get_Glyph_Bitmap(m_Face));
- int bmheight = FXFT_Get_Bitmap_Rows(FXFT_Get_Glyph_Bitmap(m_Face));
- if (bmwidth > 2048 || bmheight > 2048) {
- FXFT_Set_Face_Internal_Flag(m_Face, transflag);
- return NULL;
- }
- int dib_width = bmwidth;
- CFX_GlyphBitmap* pGlyphBitmap = FX_NEW CFX_GlyphBitmap;
- if (!pGlyphBitmap) {
- return NULL;
- }
- pGlyphBitmap->m_Bitmap.Create(dib_width, bmheight,
- anti_alias == FXFT_RENDER_MODE_MONO ? FXDIB_1bppMask : FXDIB_8bppMask);
- pGlyphBitmap->m_Left = FXFT_Get_Glyph_BitmapLeft(m_Face);
- pGlyphBitmap->m_Top = FXFT_Get_Glyph_BitmapTop(m_Face);
- int dest_pitch = pGlyphBitmap->m_Bitmap.GetPitch();
- int src_pitch = FXFT_Get_Bitmap_Pitch(FXFT_Get_Glyph_Bitmap(m_Face));
- FX_BYTE* pDestBuf = pGlyphBitmap->m_Bitmap.GetBuffer();
- FX_BYTE* pSrcBuf = (FX_BYTE*)FXFT_Get_Bitmap_Buffer(FXFT_Get_Glyph_Bitmap(m_Face));
- if (anti_alias != FXFT_RENDER_MODE_MONO && FXFT_Get_Bitmap_PixelMode(FXFT_Get_Glyph_Bitmap(m_Face)) == FXFT_PIXEL_MODE_MONO) {
- int bytes = anti_alias == FXFT_RENDER_MODE_LCD ? 3 : 1;
- for(int i = 0; i < bmheight; i++)
- for(int n = 0; n < bmwidth; n++) {
- FX_BYTE data = (pSrcBuf[i * src_pitch + n / 8] & (0x80 >> (n % 8))) ? 255 : 0;
- for (int b = 0; b < bytes; b ++) {
- pDestBuf[i * dest_pitch + n * bytes + b] = data;
- }
- }
- } else {
- FXSYS_memset32(pDestBuf, 0, dest_pitch * bmheight);
- if (anti_alias == FXFT_RENDER_MODE_MONO && FXFT_Get_Bitmap_PixelMode(FXFT_Get_Glyph_Bitmap(m_Face)) == FXFT_PIXEL_MODE_MONO) {
- int rowbytes = FXSYS_abs(src_pitch) > dest_pitch ? dest_pitch : FXSYS_abs(src_pitch);
- for (int row = 0; row < bmheight; row ++) {
- FXSYS_memcpy32(pDestBuf + row * dest_pitch, pSrcBuf + row * src_pitch, rowbytes);
- }
- } else {
- _ContrastAdjust(pSrcBuf, pDestBuf, bmwidth, bmheight, src_pitch, dest_pitch);
- _GammaAdjust(pDestBuf, bmwidth, bmheight, dest_pitch, CFX_GEModule::Get()->GetTextGammaTable());
- }
- }
- FXFT_Set_Face_Internal_Flag(m_Face, transflag);
- return pGlyphBitmap;
-}
-FX_BOOL _OutputGlyph(void* dib, int x, int y, CFX_Font* pFont,
- int glyph_index, FX_ARGB argb)
-{
- CFX_DIBitmap* pDib = (CFX_DIBitmap*)dib;
- FXFT_Face face = pFont->GetFace();
- int error = FXFT_Load_Glyph(face, glyph_index, FXFT_LOAD_NO_BITMAP);
- if (error) {
- return FALSE;
- }
- error = FXFT_Render_Glyph(face, FXFT_RENDER_MODE_NORMAL);
- if (error) {
- return FALSE;
- }
- int bmwidth = FXFT_Get_Bitmap_Width(FXFT_Get_Glyph_Bitmap(face));
- int bmheight = FXFT_Get_Bitmap_Rows(FXFT_Get_Glyph_Bitmap(face));
- int left = FXFT_Get_Glyph_BitmapLeft(face);
- int top = FXFT_Get_Glyph_BitmapTop(face);
- FX_LPCBYTE src_buf = (FX_LPCBYTE)FXFT_Get_Bitmap_Buffer(FXFT_Get_Glyph_Bitmap(face));
- int src_pitch = FXFT_Get_Bitmap_Pitch(FXFT_Get_Glyph_Bitmap(face));
- CFX_DIBitmap mask;
- mask.Create(bmwidth, bmheight, FXDIB_8bppMask);
- FX_LPBYTE dest_buf = mask.GetBuffer();
- int dest_pitch = mask.GetPitch();
- for (int row = 0; row < bmheight; row ++) {
- FX_LPCBYTE src_scan = src_buf + row * src_pitch;
- FX_LPBYTE dest_scan = dest_buf + row * dest_pitch;
- FXSYS_memcpy32(dest_scan, src_scan, dest_pitch);
- }
- pDib->CompositeMask(x + left, y - top, bmwidth, bmheight, &mask, argb, 0, 0);
- return TRUE;
-}
-FX_BOOL OutputText(void* dib, int x, int y, CFX_Font* pFont, double font_size,
- CFX_AffineMatrix* pText_matrix, unsigned short const* text, unsigned long argb)
-{
- if (!pFont) {
- return FALSE;
- }
- FXFT_Face face = pFont->GetFace();
- FXFT_Select_Charmap(pFont->m_Face, FXFT_ENCODING_UNICODE);
- int transflag = FXFT_Get_Face_Internal_Flag(pFont->m_Face);
- if (pText_matrix) {
- FXFT_Matrix ft_matrix;
- ft_matrix.xx = (signed long)(pText_matrix->a / 64 * 65536);
- ft_matrix.xy = (signed long)(pText_matrix->c / 64 * 65536);
- ft_matrix.yx = (signed long)(pText_matrix->b / 64 * 65536);
- ft_matrix.yy = (signed long)(pText_matrix->d / 64 * 65536);
- FXFT_Set_Transform(face, &ft_matrix, 0);
- }
- FX_FLOAT x_pos = 0;
- for (; *text != 0; text ++) {
- FX_WCHAR unicode = *text;
- int glyph_index = FXFT_Get_Char_Index(pFont->m_Face, unicode);
- if (glyph_index <= 0) {
- continue;
- }
- int err = FXFT_Load_Glyph(pFont->m_Face, glyph_index, FXFT_LOAD_NO_SCALE | FXFT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH);
- if (err) {
- continue;
- }
- int w = FXFT_Get_Glyph_HoriAdvance(pFont->m_Face);
- int em = FXFT_Get_Face_UnitsPerEM(pFont->m_Face);
- FX_FLOAT x1, y1;
- pText_matrix->Transform(x_pos, 0, x1, y1);
- _OutputGlyph(dib, (int)x1 + x, (int) - y1 + y, pFont,
- glyph_index, argb);
- x_pos += (FX_FLOAT)w / em;
- }
- FXFT_Set_Face_Internal_Flag(pFont->m_Face, transflag);
- return TRUE;
-}
-FX_BOOL OutputGlyph(void* dib, int x, int y, CFX_Font* pFont, double font_size,
- CFX_AffineMatrix* pMatrix, unsigned long glyph_index, unsigned long argb)
-{
- FXFT_Matrix ft_matrix;
- if (pMatrix) {
- ft_matrix.xx = (signed long)(pMatrix->a * font_size / 64 * 65536);
- ft_matrix.xy = (signed long)(pMatrix->c * font_size / 64 * 65536);
- ft_matrix.yx = (signed long)(pMatrix->b * font_size / 64 * 65536);
- ft_matrix.yy = (signed long)(pMatrix->d * font_size / 64 * 65536);
- } else {
- ft_matrix.xx = (signed long)(font_size / 64 * 65536);
- ft_matrix.xy = ft_matrix.yx = 0;
- ft_matrix.yy = (signed long)(font_size / 64 * 65536);
- }
- int transflag = FXFT_Get_Face_Internal_Flag(pFont->m_Face);
- FXFT_Set_Transform(pFont->m_Face, &ft_matrix, 0);
- FX_BOOL ret = _OutputGlyph(dib, x, y, pFont,
- glyph_index, argb);
- FXFT_Set_Face_Internal_Flag(pFont->m_Face, transflag);
- return ret;
-}
-const CFX_PathData* CFX_FaceCache::LoadGlyphPath(CFX_Font* pFont, FX_DWORD glyph_index, int dest_width)
-{
- if (m_Face == NULL || glyph_index == (FX_DWORD) - 1) {
- return NULL;
- }
- CFX_PathData* pGlyphPath = NULL;
- FX_LPVOID key;
- if (pFont->GetSubstFont())
- key = (FX_LPVOID)(FX_UINTPTR)(glyph_index + ((pFont->GetSubstFont()->m_Weight / 16) << 15) +
- ((pFont->GetSubstFont()->m_ItalicAngle / 2) << 21) + ((dest_width / 16) << 25) +
- (pFont->IsVertical() << 31));
- else {
- key = (FX_LPVOID)(FX_UINTPTR)glyph_index;
- }
- if (m_PathMap.Lookup(key, (FX_LPVOID&)pGlyphPath)) {
- return pGlyphPath;
- }
- pGlyphPath = pFont->LoadGlyphPath(glyph_index, dest_width);
- m_PathMap.SetAt(key, pGlyphPath);
- return pGlyphPath;
-}
-typedef struct {
- FX_BOOL m_bCount;
- int m_PointCount;
- FX_PATHPOINT* m_pPoints;
- int m_CurX;
- int m_CurY;
- FX_FLOAT m_CoordUnit;
-} OUTLINE_PARAMS;
-void _Outline_CheckEmptyContour(OUTLINE_PARAMS* param)
-{
- if (param->m_PointCount >= 2 && param->m_pPoints[param->m_PointCount - 2].m_Flag == FXPT_MOVETO &&
- param->m_pPoints[param->m_PointCount - 2].m_PointX == param->m_pPoints[param->m_PointCount - 1].m_PointX &&
- param->m_pPoints[param->m_PointCount - 2].m_PointY == param->m_pPoints[param->m_PointCount - 1].m_PointY) {
- param->m_PointCount -= 2;
- }
- if (param->m_PointCount >= 4 && param->m_pPoints[param->m_PointCount - 4].m_Flag == FXPT_MOVETO &&
- param->m_pPoints[param->m_PointCount - 3].m_Flag == FXPT_BEZIERTO &&
- param->m_pPoints[param->m_PointCount - 3].m_PointX == param->m_pPoints[param->m_PointCount - 4].m_PointX &&
- param->m_pPoints[param->m_PointCount - 3].m_PointY == param->m_pPoints[param->m_PointCount - 4].m_PointY &&
- param->m_pPoints[param->m_PointCount - 2].m_PointX == param->m_pPoints[param->m_PointCount - 4].m_PointX &&
- param->m_pPoints[param->m_PointCount - 2].m_PointY == param->m_pPoints[param->m_PointCount - 4].m_PointY &&
- param->m_pPoints[param->m_PointCount - 1].m_PointX == param->m_pPoints[param->m_PointCount - 4].m_PointX &&
- param->m_pPoints[param->m_PointCount - 1].m_PointY == param->m_pPoints[param->m_PointCount - 4].m_PointY) {
- param->m_PointCount -= 4;
- }
-}
-extern "C" {
- static int _Outline_MoveTo(const FXFT_Vector* to, void* user)
- {
- OUTLINE_PARAMS* param = (OUTLINE_PARAMS*)user;
- if (!param->m_bCount) {
- _Outline_CheckEmptyContour(param);
- param->m_pPoints[param->m_PointCount].m_PointX = to->x / param->m_CoordUnit;
- param->m_pPoints[param->m_PointCount].m_PointY = to->y / param->m_CoordUnit;
- param->m_pPoints[param->m_PointCount].m_Flag = FXPT_MOVETO;
- param->m_CurX = to->x;
- param->m_CurY = to->y;
- if (param->m_PointCount) {
- param->m_pPoints[param->m_PointCount - 1].m_Flag |= FXPT_CLOSEFIGURE;
- }
- }
- param->m_PointCount ++;
- return 0;
- }
-};
-extern "C" {
- static int _Outline_LineTo(const FXFT_Vector* to, void* user)
- {
- OUTLINE_PARAMS* param = (OUTLINE_PARAMS*)user;
- if (!param->m_bCount) {
- param->m_pPoints[param->m_PointCount].m_PointX = to->x / param->m_CoordUnit;
- param->m_pPoints[param->m_PointCount].m_PointY = to->y / param->m_CoordUnit;
- param->m_pPoints[param->m_PointCount].m_Flag = FXPT_LINETO;
- param->m_CurX = to->x;
- param->m_CurY = to->y;
- }
- param->m_PointCount ++;
- return 0;
- }
-};
-extern "C" {
- static int _Outline_ConicTo(const FXFT_Vector* control, const FXFT_Vector* to, void* user)
- {
- OUTLINE_PARAMS* param = (OUTLINE_PARAMS*)user;
- if (!param->m_bCount) {
- param->m_pPoints[param->m_PointCount].m_PointX = (param->m_CurX + (control->x - param->m_CurX) * 2 / 3) / param->m_CoordUnit;
- param->m_pPoints[param->m_PointCount].m_PointY = (param->m_CurY + (control->y - param->m_CurY) * 2 / 3) / param->m_CoordUnit;
- param->m_pPoints[param->m_PointCount].m_Flag = FXPT_BEZIERTO;
- param->m_pPoints[param->m_PointCount + 1].m_PointX = (control->x + (to->x - control->x) / 3) / param->m_CoordUnit;
- param->m_pPoints[param->m_PointCount + 1].m_PointY = (control->y + (to->y - control->y) / 3) / param->m_CoordUnit;
- param->m_pPoints[param->m_PointCount + 1].m_Flag = FXPT_BEZIERTO;
- param->m_pPoints[param->m_PointCount + 2].m_PointX = to->x / param->m_CoordUnit;
- param->m_pPoints[param->m_PointCount + 2].m_PointY = to->y / param->m_CoordUnit;
- param->m_pPoints[param->m_PointCount + 2].m_Flag = FXPT_BEZIERTO;
- param->m_CurX = to->x;
- param->m_CurY = to->y;
- }
- param->m_PointCount += 3;
- return 0;
- }
-};
-extern "C" {
- static int _Outline_CubicTo(const FXFT_Vector* control1, const FXFT_Vector* control2, const FXFT_Vector* to, void* user)
- {
- OUTLINE_PARAMS* param = (OUTLINE_PARAMS*)user;
- if (!param->m_bCount) {
- param->m_pPoints[param->m_PointCount].m_PointX = control1->x / param->m_CoordUnit;
- param->m_pPoints[param->m_PointCount].m_PointY = control1->y / param->m_CoordUnit;
- param->m_pPoints[param->m_PointCount].m_Flag = FXPT_BEZIERTO;
- param->m_pPoints[param->m_PointCount + 1].m_PointX = control2->x / param->m_CoordUnit;
- param->m_pPoints[param->m_PointCount + 1].m_PointY = control2->y / param->m_CoordUnit;
- param->m_pPoints[param->m_PointCount + 1].m_Flag = FXPT_BEZIERTO;
- param->m_pPoints[param->m_PointCount + 2].m_PointX = to->x / param->m_CoordUnit;
- param->m_pPoints[param->m_PointCount + 2].m_PointY = to->y / param->m_CoordUnit;
- param->m_pPoints[param->m_PointCount + 2].m_Flag = FXPT_BEZIERTO;
- param->m_CurX = to->x;
- param->m_CurY = to->y;
- }
- param->m_PointCount += 3;
- return 0;
- }
-};
-CFX_PathData* CFX_Font::LoadGlyphPath(FX_DWORD glyph_index, int dest_width)
-{
- if (m_Face == NULL) {
- return NULL;
- }
- FXFT_Set_Pixel_Sizes(m_Face, 0, 64);
- FXFT_Matrix ft_matrix = {65536, 0, 0, 65536};
- if (m_pSubstFont) {
- if (m_pSubstFont->m_ItalicAngle) {
- int skew = m_pSubstFont->m_ItalicAngle;
- skew = skew <= -30 ? -58 : -g_AngleSkew[-skew];
- if (m_bVertical) {
- ft_matrix.yx += ft_matrix.yy * skew / 100;
- } else {
- ft_matrix.xy += -ft_matrix.xx * skew / 100;
- }
- }
- if (m_pSubstFont->m_SubstFlags & FXFONT_SUBST_MM) {
- AdjustMMParams(glyph_index, dest_width, m_pSubstFont->m_Weight);
- }
- }
- int transflag = FXFT_Get_Face_Internal_Flag(m_Face);
- FXFT_Set_Transform(m_Face, &ft_matrix, 0);
- int load_flags = (m_Face->face_flags & FT_FACE_FLAG_SFNT) ? FXFT_LOAD_NO_BITMAP : FXFT_LOAD_NO_BITMAP | FT_LOAD_NO_HINTING;
- int error = FXFT_Load_Glyph(m_Face, glyph_index, load_flags);
- if (error) {
- FXFT_Set_Face_Internal_Flag(m_Face, transflag);
- return NULL;
- }
- if (m_pSubstFont && !(m_pSubstFont->m_SubstFlags & FXFONT_SUBST_MM) && m_pSubstFont->m_Weight > 400) {
- int level = 0;
- if (m_pSubstFont->m_Charset == FXFONT_SHIFTJIS_CHARSET) {
- level = g_WeightPow_SHIFTJIS[(m_pSubstFont->m_Weight - 400) / 10] * 2 * 65536 / 36655;
- } else {
- level = g_WeightPow[(m_pSubstFont->m_Weight - 400) / 10] * 2;
- }
- FXFT_Outline_Embolden(FXFT_Get_Glyph_Outline(m_Face), level);
- }
- FXFT_Outline_Funcs funcs;
- funcs.move_to = _Outline_MoveTo;
- funcs.line_to = _Outline_LineTo;
- funcs.conic_to = _Outline_ConicTo;
- funcs.cubic_to = _Outline_CubicTo;
- funcs.shift = 0;
- funcs.delta = 0;
- OUTLINE_PARAMS params;
- params.m_bCount = TRUE;
- params.m_PointCount = 0;
- FXFT_Outline_Decompose(FXFT_Get_Glyph_Outline(m_Face), &funcs, &params);
- if (params.m_PointCount == 0) {
- FXFT_Set_Face_Internal_Flag(m_Face, transflag);
- return NULL;
- }
- CFX_PathData* pPath = FX_NEW CFX_PathData;
- if (!pPath) {
- return NULL;
- }
- pPath->SetPointCount(params.m_PointCount);
- params.m_bCount = FALSE;
- params.m_PointCount = 0;
- params.m_pPoints = pPath->GetPoints();
- params.m_CurX = params.m_CurY = 0;
- params.m_CoordUnit = 64 * 64.0;
- FXFT_Outline_Decompose(FXFT_Get_Glyph_Outline(m_Face), &funcs, &params);
- _Outline_CheckEmptyContour(&params);
- pPath->TrimPoints(params.m_PointCount);
- if (params.m_PointCount) {
- pPath->GetPoints()[params.m_PointCount - 1].m_Flag |= FXPT_CLOSEFIGURE;
- }
- FXFT_Set_Face_Internal_Flag(m_Face, transflag);
- return pPath;
-}
-void _CFX_UniqueKeyGen::Generate(int count, ...)
-{
- va_list argList;
- va_start(argList, count);
- for (int i = 0; i < count; i ++) {
- int p = va_arg(argList, int);
- ((FX_DWORD*)m_Key)[i] = p;
- }
- va_end(argList);
- m_KeyLen = count * sizeof(FX_DWORD);
-}
+// 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
+
+#include "../../../include/fxge/fx_ge.h"
+#include "../../../include/fxge/fx_freetype.h"
+#include "../../../include/fxcodec/fx_codec.h"
+#include "text_int.h"
+#undef FX_GAMMA
+#undef FX_GAMMA_INVERSE
+#define FX_GAMMA(value) (value)
+#define FX_GAMMA_INVERSE(value) (value)
+FX_RECT FXGE_GetGlyphsBBox(FXTEXT_GLYPHPOS* pGlyphAndPos, int nChars, int anti_alias, FX_FLOAT retinaScaleX, FX_FLOAT retinaScaleY)
+{
+ FX_RECT rect(0, 0, 0, 0);
+ FX_BOOL bStarted = FALSE;
+ for (int iChar = 0; iChar < nChars; iChar ++) {
+ FXTEXT_GLYPHPOS& glyph = pGlyphAndPos[iChar];
+ const CFX_GlyphBitmap* pGlyph = glyph.m_pGlyph;
+ if (pGlyph == NULL) {
+ continue;
+ }
+ int char_left = glyph.m_OriginX + pGlyph->m_Left;
+ int char_width = (int)(pGlyph->m_Bitmap.GetWidth() / retinaScaleX);
+ if (anti_alias == FXFT_RENDER_MODE_LCD) {
+ char_width /= 3;
+ }
+ int char_right = char_left + char_width;
+ int char_top = glyph.m_OriginY - pGlyph->m_Top;
+ int char_bottom = char_top + (int)(pGlyph->m_Bitmap.GetHeight() / retinaScaleY);
+ if (!bStarted) {
+ rect.left = char_left;
+ rect.right = char_right;
+ rect.top = char_top;
+ rect.bottom = char_bottom;
+ bStarted = TRUE;
+ } else {
+ if (rect.left > char_left) {
+ rect.left = char_left;
+ }
+ if (rect.right < char_right) {
+ rect.right = char_right;
+ }
+ if (rect.top > char_top) {
+ rect.top = char_top;
+ }
+ if (rect.bottom < char_bottom) {
+ rect.bottom = char_bottom;
+ }
+ }
+ }
+ return rect;
+}
+static void _AdjustGlyphSpace(FXTEXT_GLYPHPOS* pGlyphAndPos, int nChars)
+{
+ ASSERT(nChars > 1);
+ FX_BOOL bVertical = FALSE;
+ if (pGlyphAndPos[nChars - 1].m_OriginX == pGlyphAndPos[0].m_OriginX) {
+ bVertical = TRUE;
+ } else if (pGlyphAndPos[nChars - 1].m_OriginY != pGlyphAndPos[0].m_OriginY) {
+ return;
+ }
+ int i = nChars - 1;
+ int* next_origin = bVertical ? &pGlyphAndPos[i].m_OriginY : &pGlyphAndPos[i].m_OriginX;
+ FX_FLOAT next_origin_f = bVertical ? pGlyphAndPos[i].m_fOriginY : pGlyphAndPos[i].m_fOriginX;
+ for (i --; i > 0; i --) {
+ int* this_origin = bVertical ? &pGlyphAndPos[i].m_OriginY : &pGlyphAndPos[i].m_OriginX;
+ FX_FLOAT this_origin_f = bVertical ? pGlyphAndPos[i].m_fOriginY : pGlyphAndPos[i].m_fOriginX;
+ int space = (*next_origin) - (*this_origin);
+ FX_FLOAT space_f = next_origin_f - this_origin_f;
+ FX_FLOAT error = (FX_FLOAT)(FXSYS_fabs(space_f) - FXSYS_fabs((FX_FLOAT)(space)));
+ if (error > 0.5f) {
+ *this_origin += space > 0 ? -1 : 1;
+ }
+ next_origin = this_origin;
+ next_origin_f = this_origin_f;
+ }
+}
+static const FX_BYTE g_GdipGamma_bgw[9] = {0, 0, 63, 120, 0, 168, 210, 239, 255};
+static const FX_BYTE g_GdipGamma_fgw[9] = {0, 0, 16, 45, 0, 87, 135, 192, 255};
+static const FX_BYTE g_GdipGammaAdjust_47[48] = {
+ 0, 30, 33, 34, 35, 36, 37, 38, 38, 39, 39, 40, 40, 40, 41, 41, 41, 42, 42, 42, 42, 43,
+ 43, 43, 43, 43, 44, 44, 44, 44, 44, 44, 45, 45, 45, 45, 45, 45, 45, 46,
+ 46, 46, 46, 46, 46, 46, 46, 47
+};
+static const FX_BYTE g_GdipGammaAdjust_75[76] = {
+ 0, 46, 50, 52, 54, 55, 56, 57, 58, 59, 60, 60, 61, 61, 62, 62, 63, 63, 64, 64, 64, 65,
+ 65, 65, 66, 66, 66, 67, 67, 67, 67, 68, 68, 68, 68, 68, 69, 69, 69, 69, 69, 70, 70, 70,
+ 70, 70, 71, 71, 71, 71, 71, 71, 72, 72, 72, 72, 72, 72, 72, 73, 73, 73, 73, 73, 73, 73,
+ 73, 74, 74, 74, 74, 74, 74, 74, 74, 75
+};
+static const FX_BYTE g_GdipGammaAdjust_81[82] = {
+ 0, 49, 53, 56, 58, 59, 60, 61, 62, 63, 64, 65, 65, 66, 66, 67, 67, 68, 68, 69, 69, 69, 70, 70, 70,
+ 71, 71, 71, 72, 72, 72, 72, 73, 73, 73, 73, 74, 74, 74, 74, 74, 75, 75, 75, 75, 75, 76, 76, 76, 76,
+ 76, 76, 77, 77, 77, 77, 77, 77, 78, 78, 78, 78, 78, 78, 78, 79, 79, 79, 79, 79, 79, 79, 79, 80,
+ 80, 80, 80, 80, 80, 80, 80, 81
+};
+static void _Adjust_alpha(int background, int foreground, int& src_alpha, int text_flags, int a)
+{
+}
+static const FX_BYTE g_TextGammaAdjust[256] = {
+ 0, 2, 3, 4, 6, 7, 8, 10, 11, 12, 13, 15, 16, 17, 18, 19,
+ 21, 22, 23, 24, 25, 26, 27, 29, 30, 31, 32, 33, 34, 35, 36, 38,
+ 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 51, 52, 53, 54, 55,
+ 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 71, 72,
+ 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
+ 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
+ 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120,
+ 121, 122, 123, 124, 125, 126, 127, 128, 129, 129, 130, 131, 132, 133, 134, 135,
+ 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151,
+ 152, 153, 154, 155, 156, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166,
+ 167, 168, 169, 170, 171, 172, 173, 174, 174, 175, 176, 177, 178, 179, 180, 181,
+ 182, 183, 184, 185, 186, 187, 188, 189, 190, 190, 191, 192, 193, 194, 195, 196,
+ 197, 198, 199, 200, 201, 202, 203, 204, 204, 205, 206, 207, 208, 209, 210, 211,
+ 212, 213, 214, 215, 216, 217, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226,
+ 227, 228, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 239, 240,
+ 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 250, 251, 252, 253, 254, 255,
+};
+#define ADJUST_ALPHA(background, foreground, src_alpha, text_flags, a) \
+ src_alpha = g_TextGammaAdjust[(FX_BYTE)src_alpha];
+void _Color2Argb(FX_ARGB& argb, FX_DWORD color, int alpha_flag, void* pIccTransform)
+{
+ if (pIccTransform == NULL && !FXGETFLAG_COLORTYPE(alpha_flag)) {
+ argb = color;
+ return;
+ }
+ if (!CFX_GEModule::Get()->GetCodecModule() || !CFX_GEModule::Get()->GetCodecModule()->GetIccModule()) {
+ pIccTransform = NULL;
+ }
+ FX_BYTE bgra[4];
+ if (pIccTransform) {
+ ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
+ color = FXGETFLAG_COLORTYPE(alpha_flag) ? FXCMYK_TODIB(color) : FXARGB_TODIB(color);
+ pIccModule->TranslateScanline(pIccTransform, bgra, (FX_LPCBYTE)&color, 1);
+ bgra[3] = FXGETFLAG_COLORTYPE(alpha_flag) ?
+ (alpha_flag >> 24) ? FXGETFLAG_ALPHA_FILL(alpha_flag) : FXGETFLAG_ALPHA_STROKE(alpha_flag) :
+ FXARGB_A(color);
+ argb = FXARGB_MAKE(bgra[3], bgra[2], bgra[1], bgra[0]);
+ return;
+ }
+ AdobeCMYK_to_sRGB1(FXSYS_GetCValue(color), FXSYS_GetMValue(color),
+ FXSYS_GetYValue(color), FXSYS_GetKValue(color),
+ bgra[2], bgra[1], bgra[0]);
+ bgra[3] = (alpha_flag >> 24) ? FXGETFLAG_ALPHA_FILL(alpha_flag) : FXGETFLAG_ALPHA_STROKE(alpha_flag);
+ argb = FXARGB_MAKE(bgra[3], bgra[2], bgra[1], bgra[0]);
+}
+FX_BOOL CFX_RenderDevice::DrawNormalText(int nChars, const FXTEXT_CHARPOS* pCharPos,
+ CFX_Font* pFont, CFX_FontCache* pCache,
+ FX_FLOAT font_size, const CFX_AffineMatrix* pText2Device,
+ FX_DWORD fill_color, FX_DWORD text_flags,
+ int alpha_flag, void* pIccTransform)
+{
+ int nativetext_flags = text_flags;
+ if (m_DeviceClass != FXDC_DISPLAY) {
+ if (!(text_flags & FXTEXT_PRINTGRAPHICTEXT)) {
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
+ if (!(text_flags & FXFONT_CIDFONT) && pFont->GetPsName().Find(CFX_WideString::FromLocal("+ZJHL")) == -1)
+#ifdef FOXIT_CHROME_BUILD
+ if (pFont->GetPsName() != CFX_WideString::FromLocal("CNAAJI+cmex10"))
+#endif
+#endif
+ if (m_pDeviceDriver->DrawDeviceText(nChars, pCharPos, pFont, pCache, pText2Device, font_size, fill_color, alpha_flag, pIccTransform)) {
+ return TRUE;
+ }
+ }
+ int alpha = FXGETFLAG_COLORTYPE(alpha_flag) ? FXGETFLAG_ALPHA_FILL(alpha_flag) : FXARGB_A(fill_color);
+ if (alpha < 255) {
+ return FALSE;
+ }
+ } else if (!(text_flags & FXTEXT_NO_NATIVETEXT)) {
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
+ if (!(text_flags & FXFONT_CIDFONT))
+#ifdef FOXIT_CHROME_BUILD
+ if (pFont->GetPsName() != CFX_WideString::FromLocal("CNAAJI+cmex10"))
+#endif
+#endif
+ if (m_pDeviceDriver->DrawDeviceText(nChars, pCharPos, pFont, pCache, pText2Device, font_size, fill_color, alpha_flag, pIccTransform)) {
+ return TRUE;
+ }
+ }
+ CFX_AffineMatrix char2device, deviceCtm, text2Device;
+ if (pText2Device) {
+ char2device = *pText2Device;
+ text2Device = *pText2Device;
+ }
+ char2device.Scale(font_size, -font_size);
+ if (FXSYS_fabs(char2device.a) + FXSYS_fabs(char2device.b) > 50 * 1.0f ||
+ ((m_DeviceClass == FXDC_PRINTER && !m_pDeviceDriver->IsPSPrintDriver())
+ && !(text_flags & FXTEXT_PRINTIMAGETEXT))) {
+ if (pFont->GetFace() != NULL || (pFont->GetSubstFont()->m_SubstFlags & FXFONT_SUBST_GLYPHPATH)) {
+ int nPathFlags = (text_flags & FXTEXT_NOSMOOTH) == 0 ? 0 : FXFILL_NOPATHSMOOTH;
+ return DrawTextPath(nChars, pCharPos, pFont, pCache, font_size, pText2Device, NULL, NULL, fill_color, 0, NULL, nPathFlags, alpha_flag, pIccTransform);
+ }
+ }
+ int anti_alias = FXFT_RENDER_MODE_MONO;
+ FX_BOOL bNormal = FALSE;
+ if ((text_flags & FXTEXT_NOSMOOTH) == 0) {
+ if (m_DeviceClass == FXDC_DISPLAY && m_bpp > 1) {
+ FX_BOOL bClearType;
+ if (pFont->GetFace() == NULL && !(pFont->GetSubstFont()->m_SubstFlags & FXFONT_SUBST_CLEARTYPE)) {
+ bClearType = FALSE;
+ } else {
+ bClearType = text_flags & FXTEXT_CLEARTYPE;
+ }
+ if ((m_RenderCaps & (FXRC_ALPHA_OUTPUT | FXRC_CMYK_OUTPUT))) {
+ anti_alias = FXFT_RENDER_MODE_LCD;
+ bNormal = TRUE;
+ } else if (m_bpp < 16) {
+ anti_alias = FXFT_RENDER_MODE_NORMAL;
+ } else {
+ if (bClearType == FALSE) {
+ anti_alias = FXFT_RENDER_MODE_LCD;
+ bNormal = TRUE;
+ } else {
+ anti_alias = FXFT_RENDER_MODE_LCD;
+ }
+ }
+ }
+ }
+ if (pCache == NULL) {
+ pCache = CFX_GEModule::Get()->GetFontCache();
+ }
+ CFX_FaceCache* pFaceCache = pCache->GetCachedFace(pFont);
+ FX_FONTCACHE_DEFINE(pCache, pFont);
+ FXTEXT_GLYPHPOS* pGlyphAndPos = FX_Alloc(FXTEXT_GLYPHPOS, nChars);
+ if (!pGlyphAndPos) {
+ return FALSE;
+ }
+ int iChar;
+ deviceCtm = char2device;
+ CFX_AffineMatrix matrixCTM = GetCTM();
+ FX_FLOAT scale_x = FXSYS_fabs(matrixCTM.a);
+ FX_FLOAT scale_y = FXSYS_fabs(matrixCTM.d);
+ deviceCtm.Concat(scale_x, 0, 0, scale_y, 0, 0);
+ text2Device.Concat(scale_x, 0, 0, scale_y, 0, 0);
+ for (iChar = 0; iChar < nChars; iChar ++) {
+ FXTEXT_GLYPHPOS& glyph = pGlyphAndPos[iChar];
+ const FXTEXT_CHARPOS& charpos = pCharPos[iChar];
+ glyph.m_fOriginX = charpos.m_OriginX;
+ glyph.m_fOriginY = charpos.m_OriginY;
+ text2Device.Transform(glyph.m_fOriginX, glyph.m_fOriginY);
+ if (anti_alias < FXFT_RENDER_MODE_LCD) {
+ glyph.m_OriginX = FXSYS_round(glyph.m_fOriginX);
+ } else {
+ glyph.m_OriginX = (int)FXSYS_floor(glyph.m_fOriginX);
+ }
+ glyph.m_OriginY = FXSYS_round(glyph.m_fOriginY);
+ if (charpos.m_bGlyphAdjust) {
+ CFX_AffineMatrix new_matrix(charpos.m_AdjustMatrix[0], charpos.m_AdjustMatrix[1],
+ charpos.m_AdjustMatrix[2], charpos.m_AdjustMatrix[3], 0, 0);
+ new_matrix.Concat(deviceCtm);
+ glyph.m_pGlyph = pFaceCache->LoadGlyphBitmap(pFont, charpos.m_GlyphIndex, charpos.m_bFontStyle, &new_matrix,
+ charpos.m_FontCharWidth, anti_alias, nativetext_flags);
+ } else
+ glyph.m_pGlyph = pFaceCache->LoadGlyphBitmap(pFont, charpos.m_GlyphIndex, charpos.m_bFontStyle, &deviceCtm,
+ charpos.m_FontCharWidth, anti_alias, nativetext_flags);
+ }
+ if (anti_alias < FXFT_RENDER_MODE_LCD && nChars > 1) {
+ _AdjustGlyphSpace(pGlyphAndPos, nChars);
+ }
+ FX_RECT bmp_rect1 = FXGE_GetGlyphsBBox(pGlyphAndPos, nChars, anti_alias);
+ if (scale_x > 1 && scale_y > 1) {
+ bmp_rect1.left--;
+ bmp_rect1.top --;
+ bmp_rect1.right ++;
+ bmp_rect1.bottom ++;
+ }
+ FX_RECT bmp_rect(FXSYS_round((FX_FLOAT)(bmp_rect1.left) / scale_x), FXSYS_round((FX_FLOAT)(bmp_rect1.top) / scale_y),
+ FXSYS_round((FX_FLOAT)bmp_rect1.right / scale_x), FXSYS_round((FX_FLOAT)bmp_rect1.bottom / scale_y));
+ bmp_rect.Intersect(m_ClipBox);
+ if (bmp_rect.IsEmpty()) {
+ FX_Free(pGlyphAndPos);
+ return TRUE;
+ }
+ int pixel_width = FXSYS_round(bmp_rect.Width() * scale_x);
+ int pixel_height = FXSYS_round(bmp_rect.Height() * scale_y);
+ int pixel_left = FXSYS_round(bmp_rect.left * scale_x);
+ int pixel_top = FXSYS_round(bmp_rect.top * scale_y);
+ if (anti_alias == FXFT_RENDER_MODE_MONO) {
+ CFX_DIBitmap bitmap;
+ if (!bitmap.Create(pixel_width, pixel_height, FXDIB_1bppMask)) {
+ FX_Free(pGlyphAndPos);
+ return FALSE;
+ }
+ bitmap.Clear(0);
+ for (iChar = 0; iChar < nChars; iChar ++) {
+ FXTEXT_GLYPHPOS& glyph = pGlyphAndPos[iChar];
+ if (glyph.m_pGlyph == NULL) {
+ continue;
+ }
+ const CFX_DIBitmap* pGlyph = &glyph.m_pGlyph->m_Bitmap;
+ bitmap.TransferBitmap(glyph.m_OriginX + glyph.m_pGlyph->m_Left - pixel_left,
+ glyph.m_OriginY - glyph.m_pGlyph->m_Top - pixel_top,
+ pGlyph->GetWidth(), pGlyph->GetHeight(), pGlyph, 0, 0);
+ }
+ FX_Free(pGlyphAndPos);
+ return SetBitMask(&bitmap, bmp_rect.left, bmp_rect.top, fill_color);
+ }
+ CFX_DIBitmap bitmap;
+ if (m_bpp == 8) {
+ if (!bitmap.Create(pixel_width, pixel_height, FXDIB_8bppMask)) {
+ FX_Free(pGlyphAndPos);
+ return FALSE;
+ }
+ } else {
+ if (!CreateCompatibleBitmap(&bitmap, pixel_width, pixel_height)) {
+ FX_Free(pGlyphAndPos);
+ return FALSE;
+ }
+ }
+ if (!bitmap.HasAlpha() && !bitmap.IsAlphaMask()) {
+ bitmap.Clear(0xFFFFFFFF);
+ if (!GetDIBits(&bitmap, bmp_rect.left, bmp_rect.top)) {
+ FX_Free(pGlyphAndPos);
+ return FALSE;
+ }
+ } else {
+ bitmap.Clear(0);
+ if (bitmap.m_pAlphaMask) {
+ bitmap.m_pAlphaMask->Clear(0);
+ }
+ }
+ int dest_width = pixel_width;
+ FX_LPBYTE dest_buf = bitmap.GetBuffer();
+ int dest_pitch = bitmap.GetPitch();
+ int Bpp = bitmap.GetBPP() / 8;
+ int a, r, g, b;
+ if (anti_alias == FXFT_RENDER_MODE_LCD) {
+ _Color2Argb(fill_color, fill_color, alpha_flag | (1 << 24), pIccTransform);
+ ArgbDecode(fill_color, a, r, g, b);
+ r = FX_GAMMA(r);
+ g = FX_GAMMA(g);
+ b = FX_GAMMA(b);
+ }
+ for (iChar = 0; iChar < nChars; iChar ++) {
+ FXTEXT_GLYPHPOS& glyph = pGlyphAndPos[iChar];
+ if (glyph.m_pGlyph == NULL) {
+ continue;
+ }
+ const CFX_DIBitmap* pGlyph = &glyph.m_pGlyph->m_Bitmap;
+ int left = glyph.m_OriginX + glyph.m_pGlyph->m_Left - pixel_left;
+ int top = glyph.m_OriginY - glyph.m_pGlyph->m_Top - pixel_top;
+ int ncols = pGlyph->GetWidth();
+ int nrows = pGlyph->GetHeight();
+ if (anti_alias == FXFT_RENDER_MODE_NORMAL) {
+ if (!bitmap.CompositeMask(left, top, ncols, nrows, pGlyph, fill_color,
+ 0, 0, FXDIB_BLEND_NORMAL, NULL, FALSE, alpha_flag, pIccTransform)) {
+ FX_Free(pGlyphAndPos);
+ return FALSE;
+ }
+ continue;
+ }
+ FX_BOOL bBGRStripe = text_flags & FXTEXT_BGR_STRIPE;
+ ncols /= 3;
+ int x_subpixel = (int)(glyph.m_fOriginX * 3) % 3;
+ FX_LPBYTE src_buf = pGlyph->GetBuffer();
+ int src_pitch = pGlyph->GetPitch();
+ int start_col = left;
+ if (start_col < 0) {
+ start_col = 0;
+ }
+ int end_col = left + ncols;
+ if (end_col > dest_width) {
+ end_col = dest_width;
+ }
+ if (start_col >= end_col) {
+ continue;
+ }
+ if (bitmap.GetFormat() == FXDIB_Argb) {
+ for (int row = 0; row < nrows; row ++) {
+ int dest_row = row + top;
+ if (dest_row < 0 || dest_row >= bitmap.GetHeight()) {
+ continue;
+ }
+ FX_LPBYTE src_scan = src_buf + row * src_pitch + (start_col - left) * 3;
+ FX_LPBYTE dest_scan = dest_buf + dest_row * dest_pitch + (start_col << 2);
+ if (bBGRStripe) {
+ if (x_subpixel == 0) {
+ for (int col = start_col; col < end_col; col ++) {
+ int src_alpha = src_scan[2];
+ src_alpha = src_alpha * a / 255;
+ dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, src_alpha));
+ src_alpha = src_scan[1];
+ src_alpha = src_alpha * a / 255;
+ dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), g, src_alpha));
+ src_alpha = src_scan[0];
+ src_alpha = src_alpha * a / 255;
+ dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), b, src_alpha));
+ dest_scan[3] = 255;
+ dest_scan += 4;
+ src_scan += 3;
+ }
+ } else if (x_subpixel == 1) {
+ int src_alpha = src_scan[1];
+ ADJUST_ALPHA(dest_scan[2], r, src_alpha, nativetext_flags, a);
+ src_alpha = src_alpha * a / 255;
+ dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, src_alpha));
+ src_alpha = src_scan[0];
+ ADJUST_ALPHA(dest_scan[1], g, src_alpha, nativetext_flags, a);
+ src_alpha = src_alpha * a / 255;
+ dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), g, src_alpha));
+ if (start_col > left) {
+ src_alpha = src_scan[-1];
+ ADJUST_ALPHA(dest_scan[0], b, src_alpha, nativetext_flags, a);
+ src_alpha = src_alpha * a / 255;
+ dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), b, src_alpha));
+ }
+ dest_scan[3] = 255;
+ dest_scan += 4;
+ src_scan += 3;
+ for (int col = start_col + 1; col < end_col - 1; col ++) {
+ int src_alpha = src_scan[1];
+ ADJUST_ALPHA(dest_scan[2], r, src_alpha, nativetext_flags, a);
+ src_alpha = src_alpha * a / 255;
+ dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, src_alpha));
+ src_alpha = src_scan[0];
+ ADJUST_ALPHA(dest_scan[1], g, src_alpha, nativetext_flags, a);
+ src_alpha = src_alpha * a / 255;
+ dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), g, src_alpha));
+ src_alpha = src_scan[-1];
+ ADJUST_ALPHA(dest_scan[0], b, src_alpha, nativetext_flags, a);
+ src_alpha = src_alpha * a / 255;
+ dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), b, src_alpha));
+ dest_scan[3] = 255;
+ dest_scan += 4;
+ src_scan += 3;
+ }
+ } else {
+ int src_alpha = src_scan[0];
+ ADJUST_ALPHA(dest_scan[2], r, src_alpha, nativetext_flags, a);
+ src_alpha = src_alpha * a / 255;
+ dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, src_alpha));
+ if (start_col > left) {
+ src_alpha = src_scan[-1];
+ ADJUST_ALPHA(dest_scan[1], g, src_alpha, nativetext_flags, a);
+ src_alpha = src_alpha * a / 255;
+ dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), g, src_alpha));
+ src_alpha = src_scan[-2];
+ ADJUST_ALPHA(dest_scan[0], b, src_alpha, nativetext_flags, a);
+ src_alpha = src_alpha * a / 255;
+ dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), b, src_alpha));
+ }
+ dest_scan[3] = 255;
+ dest_scan += 4;
+ src_scan += 3;
+ for (int col = start_col + 1; col < end_col - 1; col ++) {
+ int src_alpha = src_scan[0];
+ ADJUST_ALPHA(dest_scan[2], r, src_alpha, nativetext_flags, a);
+ src_alpha = src_alpha * a / 255;
+ dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, src_alpha));
+ src_alpha = src_scan[-1];
+ ADJUST_ALPHA(dest_scan[1], g, src_alpha, nativetext_flags, a);
+ src_alpha = src_alpha * a / 255;
+ dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), g, src_alpha));
+ src_alpha = src_scan[-2];
+ ADJUST_ALPHA(dest_scan[0], b, src_alpha, nativetext_flags, a);
+ src_alpha = src_alpha * a / 255;
+ dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), b, src_alpha));
+ dest_scan[3] = 255;
+ dest_scan += 4;
+ src_scan += 3;
+ }
+ }
+ } else {
+ if (x_subpixel == 0) {
+ for (int col = start_col; col < end_col; col ++) {
+ if (bNormal) {
+ int src_alpha1 = (src_scan[0] + src_scan[1] + src_scan[2]) / 3;
+ ADJUST_ALPHA(dest_scan[2], r, src_alpha1, nativetext_flags, a);
+ src_alpha1 = src_alpha1 * a / 255;
+ FX_BYTE back_alpha = dest_scan[3];
+ if (back_alpha == 0) {
+ FXARGB_SETDIB(dest_scan, FXARGB_MAKE(src_alpha1, r, g, b));
+ dest_scan += 4;
+ src_scan += 3;
+ continue;
+ }
+ if (src_alpha1 == 0) {
+ dest_scan += 4;
+ src_scan += 3;
+ continue;
+ }
+ FX_BYTE dest_alpha = back_alpha + src_alpha1 - back_alpha * src_alpha1 / 255;
+ dest_scan[3] = dest_alpha;
+ int alpha_ratio = src_alpha1 * 255 / dest_alpha;
+ dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, alpha_ratio));
+ dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), g, alpha_ratio));
+ dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), b, alpha_ratio));
+ dest_scan += 4;
+ src_scan += 3;
+ continue;
+ }
+ int src_alpha = src_scan[0];
+ ADJUST_ALPHA(dest_scan[2], r, src_alpha, nativetext_flags, a);
+ src_alpha = src_alpha * a / 255;
+ dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, src_alpha));
+ src_alpha = src_scan[1];
+ ADJUST_ALPHA(dest_scan[1], g, src_alpha, nativetext_flags, a);
+ src_alpha = src_alpha * a / 255;
+ dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), g, src_alpha));
+ src_alpha = src_scan[2];
+ ADJUST_ALPHA(dest_scan[0], b, src_alpha, nativetext_flags, a);
+ src_alpha = src_alpha * a / 255;
+ dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), b, src_alpha));
+ dest_scan[3] = 255;
+ dest_scan += 4;
+ src_scan += 3;
+ }
+ } else if (x_subpixel == 1) {
+ if (bNormal) {
+ int src_alpha1 = start_col > left ? ((src_scan[-1] + src_scan[0] + src_scan[1]) / 3) : ((src_scan[0] + src_scan[1]) / 3);
+ ADJUST_ALPHA(dest_scan[2], r, src_alpha1, nativetext_flags, a);
+ src_alpha1 = src_alpha1 * a / 255;
+ if (src_alpha1 == 0) {
+ dest_scan += 4;
+ src_scan += 3;
+ } else {
+ FX_BYTE back_alpha = dest_scan[3];
+ if (back_alpha == 0) {
+ FXARGB_SETDIB(dest_scan, FXARGB_MAKE(src_alpha1, r, g, b));
+ } else {
+ FX_BYTE dest_alpha = back_alpha + src_alpha1 - back_alpha * src_alpha1 / 255;
+ dest_scan[3] = dest_alpha;
+ int alpha_ratio = src_alpha1 * 255 / dest_alpha;
+ dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, alpha_ratio));
+ dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), g, alpha_ratio));
+ dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), b, alpha_ratio));
+ }
+ dest_scan += 4;
+ src_scan += 3;
+ }
+ } else {
+ if (start_col > left) {
+ int src_alpha = src_scan[-1];
+ ADJUST_ALPHA(dest_scan[2], r, src_alpha, nativetext_flags, a);
+ src_alpha = src_alpha * a / 255;
+ dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, src_alpha));
+ }
+ int src_alpha = src_scan[0];
+ ADJUST_ALPHA(dest_scan[1], g, src_alpha, nativetext_flags, a);
+ src_alpha = src_alpha * a / 255;
+ dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), g, src_alpha));
+ src_alpha = src_scan[1];
+ ADJUST_ALPHA(dest_scan[0], b, src_alpha, nativetext_flags, a);
+ src_alpha = src_alpha * a / 255;
+ dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), b, src_alpha));
+ dest_scan[3] = 255;
+ dest_scan += 4;
+ src_scan += 3;
+ }
+ for (int col = start_col + 1; col < end_col; col ++) {
+ if (bNormal) {
+ int src_alpha1 = (src_scan[-1] + src_scan[0] + src_scan[1]) / 3;
+ ADJUST_ALPHA(dest_scan[2], r, src_alpha1, nativetext_flags, a);
+ src_alpha1 = src_alpha1 * a / 255;
+ FX_BYTE back_alpha = dest_scan[3];
+ if (back_alpha == 0) {
+ FXARGB_SETDIB(dest_scan, FXARGB_MAKE(src_alpha1, r, g, b));
+ dest_scan += 4;
+ src_scan += 3;
+ continue;
+ }
+ if (src_alpha1 == 0) {
+ dest_scan += 4;
+ src_scan += 3;
+ continue;
+ }
+ FX_BYTE dest_alpha = back_alpha + src_alpha1 - back_alpha * src_alpha1 / 255;
+ dest_scan[3] = dest_alpha;
+ int alpha_ratio = src_alpha1 * 255 / dest_alpha;
+ dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, alpha_ratio));
+ dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), g, alpha_ratio));
+ dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), b, alpha_ratio));
+ dest_scan += 4;
+ src_scan += 3;
+ continue;
+ }
+ int src_alpha = src_scan[-1];
+ ADJUST_ALPHA(dest_scan[2], r, src_alpha, nativetext_flags, a);
+ src_alpha = src_alpha * a / 255;
+ dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, src_alpha));
+ src_alpha = src_scan[0];
+ ADJUST_ALPHA(dest_scan[1], g, src_alpha, nativetext_flags, a);
+ src_alpha = src_alpha * a / 255;
+ dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), g, src_alpha));
+ src_alpha = src_scan[1];
+ ADJUST_ALPHA(dest_scan[0], b, src_alpha, nativetext_flags, a);
+ src_alpha = src_alpha * a / 255;
+ dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), b, src_alpha));
+ dest_scan[3] = 255;
+ dest_scan += 4;
+ src_scan += 3;
+ }
+ } else {
+ if (bNormal) {
+ int src_alpha1 = start_col > left ? ((src_scan[-2] + src_scan[-1] + src_scan[0]) / 3) : ((src_scan[0]) / 3);
+ ADJUST_ALPHA(dest_scan[2], r, src_alpha1, nativetext_flags, a);
+ src_alpha1 = src_alpha1 * a / 255;
+ if (src_alpha1 == 0) {
+ dest_scan += 4;
+ src_scan += 3;
+ } else {
+ FX_BYTE back_alpha = dest_scan[3];
+ if (back_alpha == 0) {
+ FXARGB_SETDIB(dest_scan, FXARGB_MAKE(src_alpha1, r, g, b));
+ } else {
+ FX_BYTE dest_alpha = back_alpha + src_alpha1 - back_alpha * src_alpha1 / 255;
+ dest_scan[3] = dest_alpha;
+ int alpha_ratio = src_alpha1 * 255 / dest_alpha;
+ dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, alpha_ratio));
+ dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), g, alpha_ratio));
+ dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), b, alpha_ratio));
+ }
+ dest_scan += 4;
+ src_scan += 3;
+ }
+ } else {
+ if (start_col > left) {
+ int src_alpha = src_scan[-2];
+ ADJUST_ALPHA(dest_scan[2], r, src_alpha, nativetext_flags, a);
+ src_alpha = src_alpha * a / 255;
+ dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, src_alpha));
+ src_alpha = src_scan[-1];
+ ADJUST_ALPHA(dest_scan[1], g, src_alpha, nativetext_flags, a);
+ src_alpha = src_alpha * a / 255;
+ dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), g, src_alpha));
+ }
+ int src_alpha = src_scan[0];
+ ADJUST_ALPHA(dest_scan[0], b, src_alpha, nativetext_flags, a);
+ src_alpha = src_alpha * a / 255;
+ dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), b, src_alpha));
+ dest_scan[3] = 255;
+ dest_scan += 4;
+ src_scan += 3;
+ }
+ for (int col = start_col + 1; col < end_col; col ++) {
+ if (bNormal) {
+ int src_alpha1 = (src_scan[-2] + src_scan[-1] + src_scan[0]) / 3;
+ ADJUST_ALPHA(dest_scan[2], r, src_alpha1, nativetext_flags, a);
+ src_alpha1 = src_alpha1 * a / 255;
+ FX_BYTE back_alpha = dest_scan[3];
+ if (back_alpha == 0) {
+ FXARGB_SETDIB(dest_scan, FXARGB_MAKE(src_alpha1, r, g, b));
+ dest_scan += 4;
+ src_scan += 3;
+ continue;
+ }
+ if (src_alpha1 == 0) {
+ dest_scan += 4;
+ src_scan += 3;
+ continue;
+ }
+ FX_BYTE dest_alpha = back_alpha + src_alpha1 - back_alpha * src_alpha1 / 255;
+ dest_scan[3] = dest_alpha;
+ int alpha_ratio = src_alpha1 * 255 / dest_alpha;
+ dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, alpha_ratio));
+ dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), g, alpha_ratio));
+ dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), b, alpha_ratio));
+ dest_scan += 4;
+ src_scan += 3;
+ continue;
+ }
+ int src_alpha = src_scan[-2];
+ ADJUST_ALPHA(dest_scan[2], r, src_alpha, nativetext_flags, a);
+ src_alpha = src_alpha * a / 255;
+ dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, src_alpha));
+ src_alpha = src_scan[-1];
+ ADJUST_ALPHA(dest_scan[1], g, src_alpha, nativetext_flags, a);
+ src_alpha = src_alpha * a / 255;
+ dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), g, src_alpha));
+ src_alpha = src_scan[0];
+ ADJUST_ALPHA(dest_scan[0], b, src_alpha, nativetext_flags, a);
+ src_alpha = src_alpha * a / 255;
+ dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), b, src_alpha));
+ dest_scan[3] = 255;
+ dest_scan += 4;
+ src_scan += 3;
+ }
+ }
+ }
+ }
+ } else {
+ for (int row = 0; row < nrows; row ++) {
+ int dest_row = row + top;
+ if (dest_row < 0 || dest_row >= bitmap.GetHeight()) {
+ continue;
+ }
+ FX_LPBYTE src_scan = src_buf + row * src_pitch + (start_col - left) * 3;
+ FX_LPBYTE dest_scan = dest_buf + dest_row * dest_pitch + start_col * Bpp;
+ if (bBGRStripe) {
+ if (x_subpixel == 0) {
+ for (int col = start_col; col < end_col; col ++) {
+ int src_alpha = src_scan[2];
+ ADJUST_ALPHA(dest_scan[2], r, src_alpha, nativetext_flags, a);
+ src_alpha = src_alpha * a / 255;
+ dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, src_alpha));
+ src_alpha = src_scan[1];
+ ADJUST_ALPHA(dest_scan[1], g, src_alpha, nativetext_flags, a);
+ src_alpha = src_alpha * a / 255;
+ dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), g, src_alpha));
+ src_alpha = src_scan[0];
+ ADJUST_ALPHA(dest_scan[0], b, src_alpha, nativetext_flags, a);
+ src_alpha = src_alpha * a / 255;
+ dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), b, src_alpha));
+ dest_scan += Bpp;
+ src_scan += 3;
+ }
+ } else if (x_subpixel == 1) {
+ int src_alpha = src_scan[1];
+ ADJUST_ALPHA(dest_scan[2], r, src_alpha, nativetext_flags, a);
+ src_alpha = src_alpha * a / 255;
+ dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, src_alpha));
+ src_alpha = src_scan[0];
+ ADJUST_ALPHA(dest_scan[1], g, src_alpha, nativetext_flags, a);
+ src_alpha = src_alpha * a / 255;
+ dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), g, src_alpha));
+ if (start_col > left) {
+ src_alpha = src_scan[-1];
+ ADJUST_ALPHA(dest_scan[0], b, src_alpha, nativetext_flags, a);
+ src_alpha = src_alpha * a / 255;
+ dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), b, src_alpha));
+ }
+ dest_scan += Bpp;
+ src_scan += 3;
+ for (int col = start_col + 1; col < end_col - 1; col ++) {
+ int src_alpha = src_scan[1];
+ ADJUST_ALPHA(dest_scan[2], r, src_alpha, nativetext_flags, a);
+ src_alpha = src_alpha * a / 255;
+ dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, src_alpha));
+ src_alpha = src_scan[0];
+ ADJUST_ALPHA(dest_scan[1], g, src_alpha, nativetext_flags, a);
+ src_alpha = src_alpha * a / 255;
+ dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), g, src_alpha));
+ src_alpha = src_scan[-1];
+ ADJUST_ALPHA(dest_scan[0], b, src_alpha, nativetext_flags, a);
+ src_alpha = src_alpha * a / 255;
+ dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), b, src_alpha));
+ dest_scan += Bpp;
+ src_scan += 3;
+ }
+ } else {
+ int src_alpha = src_scan[0];
+ ADJUST_ALPHA(dest_scan[2], r, src_alpha, nativetext_flags, a);
+ src_alpha = src_alpha * a / 255;
+ dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, src_alpha));
+ if (start_col > left) {
+ src_alpha = src_scan[-1];
+ ADJUST_ALPHA(dest_scan[1], g, src_alpha, nativetext_flags, a);
+ src_alpha = src_alpha * a / 255;
+ dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), g, src_alpha));
+ src_alpha = src_scan[-2];
+ ADJUST_ALPHA(dest_scan[0], b, src_alpha, nativetext_flags, a);
+ src_alpha = src_alpha * a / 255;
+ dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), b, src_alpha));
+ }
+ dest_scan += Bpp;
+ src_scan += 3;
+ for (int col = start_col + 1; col < end_col - 1; col ++) {
+ int src_alpha = src_scan[0];
+ ADJUST_ALPHA(dest_scan[2], r, src_alpha, nativetext_flags, a);
+ src_alpha = src_alpha * a / 255;
+ dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, src_alpha));
+ src_alpha = src_scan[-1];
+ ADJUST_ALPHA(dest_scan[1], g, src_alpha, nativetext_flags, a);
+ src_alpha = src_alpha * a / 255;
+ dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), g, src_alpha));
+ src_alpha = src_scan[-2];
+ ADJUST_ALPHA(dest_scan[0], b, src_alpha, nativetext_flags, a);
+ src_alpha = src_alpha * a / 255;
+ dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), b, src_alpha));
+ dest_scan += Bpp;
+ src_scan += 3;
+ }
+ }
+ } else {
+ if (x_subpixel == 0) {
+ for (int col = start_col; col < end_col; col ++) {
+ if (bNormal) {
+ int src_alpha1 = (src_scan[0] + src_scan[1] + src_scan[2]) / 3;
+ ADJUST_ALPHA(dest_scan[2], r, src_alpha1, nativetext_flags, a);
+ src_alpha1 = src_alpha1 * a / 255;
+ if (src_alpha1 == 0) {
+ dest_scan += Bpp;
+ src_scan += 3;
+ continue;
+ }
+ dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, src_alpha1));
+ dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), g, src_alpha1));
+ dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), b, src_alpha1));
+ dest_scan += Bpp;
+ src_scan += 3;
+ continue;
+ }
+ int src_alpha = src_scan[0];
+ ADJUST_ALPHA(dest_scan[2], r, src_alpha, nativetext_flags, a);
+ src_alpha = src_alpha * a / 255;
+ dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, src_alpha));
+ src_alpha = src_scan[1];
+ ADJUST_ALPHA(dest_scan[1], g, src_alpha, nativetext_flags, a);
+ src_alpha = src_alpha * a / 255;
+ dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), g, src_alpha));
+ src_alpha = src_scan[2];
+ ADJUST_ALPHA(dest_scan[0], b, src_alpha, nativetext_flags, a);
+ src_alpha = src_alpha * a / 255;
+ dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), b, src_alpha));
+ dest_scan += Bpp;
+ src_scan += 3;
+ }
+ } else if (x_subpixel == 1) {
+ if (bNormal) {
+ int src_alpha1 = start_col > left ? (src_scan[0] + src_scan[1] + src_scan[-1]) / 3 : (src_scan[0] + src_scan[1]) / 3;
+ ADJUST_ALPHA(dest_scan[2], r, src_alpha1, nativetext_flags, a);
+ src_alpha1 = src_alpha1 * a / 255;
+ dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, src_alpha1));
+ dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), g, src_alpha1));
+ dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), b, src_alpha1));
+ dest_scan += Bpp;
+ src_scan += 3;
+ } else {
+ if (start_col > left) {
+ int src_alpha = src_scan[-1];
+ ADJUST_ALPHA(dest_scan[2], r, src_alpha, nativetext_flags, a);
+ src_alpha = src_alpha * a / 255;
+ dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, src_alpha));
+ }
+ int src_alpha = src_scan[0];
+ ADJUST_ALPHA(dest_scan[1], g, src_alpha, nativetext_flags, a);
+ src_alpha = src_alpha * a / 255;
+ dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), g, src_alpha));
+ src_alpha = src_scan[1];
+ ADJUST_ALPHA(dest_scan[0], b, src_alpha, nativetext_flags, a);
+ src_alpha = src_alpha * a / 255;
+ dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), b, src_alpha));
+ dest_scan += Bpp;
+ src_scan += 3;
+ }
+ for (int col = start_col + 1; col < end_col; col ++) {
+ if (bNormal) {
+ int src_alpha1 = (src_scan[0] + src_scan[1] + src_scan[-1]) / 3;
+ ADJUST_ALPHA(dest_scan[2], r, src_alpha1, nativetext_flags, a);
+ src_alpha1 = src_alpha1 * a / 255;
+ if (src_alpha1 == 0) {
+ dest_scan += Bpp;
+ src_scan += 3;
+ continue;
+ }
+ dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, src_alpha1));
+ dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), g, src_alpha1));
+ dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), b, src_alpha1));
+ dest_scan += Bpp;
+ src_scan += 3;
+ continue;
+ }
+ int src_alpha = src_scan[-1];
+ ADJUST_ALPHA(dest_scan[2], r, src_alpha, nativetext_flags, a);
+ src_alpha = src_alpha * a / 255;
+ dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, src_alpha));
+ src_alpha = src_scan[0];
+ ADJUST_ALPHA(dest_scan[1], g, src_alpha, nativetext_flags, a);
+ src_alpha = src_alpha * a / 255;
+ dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), g, src_alpha));
+ src_alpha = src_scan[1];
+ ADJUST_ALPHA(dest_scan[0], b, src_alpha, nativetext_flags, a);
+ src_alpha = src_alpha * a / 255;
+ dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), b, src_alpha));
+ dest_scan += Bpp;
+ src_scan += 3;
+ }
+ } else {
+ if (bNormal) {
+ int src_alpha1 = start_col > left ? (src_scan[0] + src_scan[-2] + src_scan[-1]) / 3 : src_scan[0] / 3;
+ ADJUST_ALPHA(dest_scan[2], r, src_alpha1, nativetext_flags, a);
+ src_alpha1 = src_alpha1 * a / 255;
+ dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, src_alpha1));
+ dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), g, src_alpha1));
+ dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), b, src_alpha1));
+ dest_scan += Bpp;
+ src_scan += 3;
+ } else {
+ if (start_col > left) {
+ int src_alpha = src_scan[-2];
+ ADJUST_ALPHA(dest_scan[2], r, src_alpha, nativetext_flags, a);
+ src_alpha = src_alpha * a / 255;
+ dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, src_alpha));
+ src_alpha = src_scan[-1];
+ ADJUST_ALPHA(dest_scan[1], g, src_alpha, nativetext_flags, a);
+ src_alpha = src_alpha * a / 255;
+ dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), g, src_alpha));
+ }
+ int src_alpha = src_scan[0];
+ ADJUST_ALPHA(dest_scan[0], b, src_alpha, nativetext_flags, a);
+ src_alpha = src_alpha * a / 255;
+ dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), b, src_alpha));
+ dest_scan += Bpp;
+ src_scan += 3;
+ }
+ for (int col = start_col + 1; col < end_col; col ++) {
+ if (bNormal) {
+ int src_alpha1 = ((int)(src_scan[0]) + (int)(src_scan[-2]) + (int)(src_scan[-1])) / 3;
+ ADJUST_ALPHA(dest_scan[2], r, src_alpha1, nativetext_flags, a);
+ src_alpha1 = src_alpha1 * a / 255;
+ if (src_alpha1 == 0) {
+ dest_scan += Bpp;
+ src_scan += 3;
+ continue;
+ }
+ dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, src_alpha1));
+ dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), g, src_alpha1));
+ dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), b, src_alpha1));
+ dest_scan += Bpp;
+ src_scan += 3;
+ continue;
+ }
+ int src_alpha = src_scan[-2];
+ ADJUST_ALPHA(dest_scan[2], r, src_alpha, nativetext_flags, a);
+ src_alpha = src_alpha * a / 255;
+ dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, src_alpha));
+ src_alpha = src_scan[-1];
+ ADJUST_ALPHA(dest_scan[1], g, src_alpha, nativetext_flags, a);
+ src_alpha = src_alpha * a / 255;
+ dest_scan[1] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[1]), g, src_alpha));
+ src_alpha = src_scan[0];
+ ADJUST_ALPHA(dest_scan[0], b, src_alpha, nativetext_flags, a);
+ src_alpha = src_alpha * a / 255;
+ dest_scan[0] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[0]), b, src_alpha));
+ dest_scan += Bpp;
+ src_scan += 3;
+ }
+ }
+ }
+ }
+ }
+ }
+ if (bitmap.IsAlphaMask()) {
+ SetBitMask(&bitmap, bmp_rect.left, bmp_rect.top, fill_color, alpha_flag, pIccTransform);
+ } else {
+ SetDIBits(&bitmap, bmp_rect.left, bmp_rect.top);
+ }
+ FX_Free(pGlyphAndPos);
+ return TRUE;
+}
+FX_BOOL CFX_RenderDevice::DrawTextPath(int nChars, const FXTEXT_CHARPOS* pCharPos,
+ CFX_Font* pFont, CFX_FontCache* pCache,
+ FX_FLOAT font_size, const CFX_AffineMatrix* pText2User,
+ const CFX_AffineMatrix* pUser2Device, const CFX_GraphStateData* pGraphState,
+ FX_DWORD fill_color, FX_ARGB stroke_color, CFX_PathData* pClippingPath, int nFlag,
+ int alpha_flag, void* pIccTransform, int blend_type)
+{
+ if (pCache == NULL) {
+ pCache = CFX_GEModule::Get()->GetFontCache();
+ }
+ CFX_FaceCache* pFaceCache = pCache->GetCachedFace(pFont);
+ FX_FONTCACHE_DEFINE(pCache, pFont);
+ for (int iChar = 0; iChar < nChars; iChar ++) {
+ const FXTEXT_CHARPOS& charpos = pCharPos[iChar];
+ CFX_AffineMatrix matrix;
+ if (charpos.m_bGlyphAdjust)
+ matrix.Set(charpos.m_AdjustMatrix[0], charpos.m_AdjustMatrix[1],
+ charpos.m_AdjustMatrix[2], charpos.m_AdjustMatrix[3], 0, 0);
+ matrix.Concat(font_size, 0, 0, font_size, charpos.m_OriginX, charpos.m_OriginY);
+ const CFX_PathData* pPath = pFaceCache->LoadGlyphPath(pFont, charpos.m_GlyphIndex, charpos.m_FontCharWidth);
+ if (pPath == NULL) {
+ continue;
+ }
+ matrix.Concat(*pText2User);
+ CFX_PathData TransformedPath(*pPath);
+ TransformedPath.Transform(&matrix);
+ FX_BOOL bHasAlpha = FXGETFLAG_COLORTYPE(alpha_flag) ?
+ (FXGETFLAG_ALPHA_FILL(alpha_flag) || FXGETFLAG_ALPHA_STROKE(alpha_flag)) :
+ (fill_color || stroke_color);
+ if (bHasAlpha) {
+ int fill_mode = nFlag;
+ if (FXGETFLAG_COLORTYPE(alpha_flag)) {
+ if (FXGETFLAG_ALPHA_FILL(alpha_flag)) {
+ fill_mode |= FXFILL_WINDING;
+ }
+ } else {
+ if (fill_color) {
+ fill_mode |= FXFILL_WINDING;
+ }
+ }
+ fill_mode |= FX_FILL_TEXT_MODE;
+ if (!DrawPath(&TransformedPath, pUser2Device, pGraphState, fill_color, stroke_color, fill_mode, alpha_flag, pIccTransform, blend_type)) {
+ return FALSE;
+ }
+ }
+ if (pClippingPath) {
+ pClippingPath->Append(&TransformedPath, pUser2Device);
+ }
+ }
+ return TRUE;
+}
+CFX_FontCache::~CFX_FontCache()
+{
+ FreeCache(TRUE);
+}
+CFX_FaceCache* CFX_FontCache::GetCachedFace(CFX_Font* pFont)
+{
+ FX_BOOL bExternal = pFont->GetFace() == NULL;
+ void* face = bExternal ? pFont->GetSubstFont()->m_ExtHandle : pFont->GetFace();
+ CFX_FTCacheMap& map = bExternal ? m_ExtFaceMap : m_FTFaceMap;
+ CFX_CountedFaceCache* counted_face_cache = NULL;
+ if (map.Lookup((FXFT_Face)face, counted_face_cache)) {
+ counted_face_cache->m_nCount++;
+ return counted_face_cache->m_Obj;
+ }
+ CFX_FaceCache* face_cache = NULL;
+ face_cache = FX_NEW CFX_FaceCache(bExternal ? NULL : (FXFT_Face)face);
+ if (face_cache == NULL) {
+ return NULL;
+ }
+ counted_face_cache = FX_NEW CFX_CountedFaceCache;
+ if (!counted_face_cache) {
+ if (face_cache) {
+ delete face_cache;
+ face_cache = NULL;
+ }
+ return NULL;
+ }
+ counted_face_cache->m_nCount = 2;
+ counted_face_cache->m_Obj = face_cache;
+ map.SetAt((FXFT_Face)face, counted_face_cache);
+ return face_cache;
+}
+void CFX_FontCache::ReleaseCachedFace(CFX_Font* pFont)
+{
+ FX_BOOL bExternal = pFont->GetFace() == NULL;
+ void* face = bExternal ? pFont->GetSubstFont()->m_ExtHandle : pFont->GetFace();
+ CFX_FTCacheMap& map = bExternal ? m_ExtFaceMap : m_FTFaceMap;
+ CFX_CountedFaceCache* counted_face_cache = NULL;
+ if (!map.Lookup((FXFT_Face)face, counted_face_cache)) {
+ return;
+ }
+ if (counted_face_cache->m_nCount > 1) {
+ counted_face_cache->m_nCount--;
+ }
+}
+void CFX_FontCache::FreeCache(FX_BOOL bRelease)
+{
+ {
+ FX_POSITION pos;
+ pos = m_FTFaceMap.GetStartPosition();
+ while (pos) {
+ FXFT_Face face;
+ CFX_CountedFaceCache* cache;
+ m_FTFaceMap.GetNextAssoc(pos, face, cache);
+ if (bRelease || cache->m_nCount < 2) {
+ delete cache->m_Obj;
+ delete cache;
+ m_FTFaceMap.RemoveKey(face);
+ }
+ }
+ pos = m_ExtFaceMap.GetStartPosition();
+ while (pos) {
+ FXFT_Face face;
+ CFX_CountedFaceCache* cache;
+ m_ExtFaceMap.GetNextAssoc(pos, face, cache);
+ if (bRelease || cache->m_nCount < 2) {
+ delete cache->m_Obj;
+ delete cache;
+ m_ExtFaceMap.RemoveKey(face);
+ }
+ }
+ }
+}
+CFX_FaceCache::CFX_FaceCache(FXFT_Face face)
+{
+ m_Face = face;
+ m_pBitmap = NULL;
+}
+CFX_FaceCache::~CFX_FaceCache()
+{
+ FX_POSITION pos = m_SizeMap.GetStartPosition();
+ CFX_ByteString Key;
+ CFX_SizeGlyphCache* pSizeCache = NULL;
+ while(pos) {
+ m_SizeMap.GetNextAssoc( pos, Key, (void*&)pSizeCache);
+ delete pSizeCache;
+ }
+ m_SizeMap.RemoveAll();
+ pos = m_PathMap.GetStartPosition();
+ FX_LPVOID key1;
+ CFX_PathData* pPath;
+ while (pos) {
+ m_PathMap.GetNextAssoc(pos, key1, (FX_LPVOID&)pPath);
+ delete pPath;
+ }
+ if (m_pBitmap) {
+ delete m_pBitmap;
+ }
+ m_PathMap.RemoveAll();
+}
+#if ((_FXM_PLATFORM_ != _FXM_PLATFORM_APPLE_)|| defined(_FPDFAPI_MINI_))
+void CFX_FaceCache::InitPlatform()
+{
+}
+#endif
+CFX_GlyphBitmap* CFX_FaceCache::LookUpGlyphBitmap(CFX_Font* pFont, const CFX_AffineMatrix* pMatrix,
+ CFX_ByteStringC& FaceGlyphsKey, FX_DWORD glyph_index, FX_BOOL bFontStyle,
+ int dest_width, int anti_alias)
+{
+ CFX_SizeGlyphCache* pSizeCache = NULL;
+ if (!m_SizeMap.Lookup(FaceGlyphsKey, (void*&)pSizeCache)) {
+ pSizeCache = FX_NEW CFX_SizeGlyphCache;
+ if (pSizeCache == NULL) {
+ return NULL;
+ }
+ m_SizeMap.SetAt(FaceGlyphsKey, pSizeCache);
+ }
+ CFX_GlyphBitmap* pGlyphBitmap = NULL;
+ if (pSizeCache->m_GlyphMap.Lookup((FX_LPVOID)(FX_UINTPTR)glyph_index, (void*&)pGlyphBitmap)) {
+ return pGlyphBitmap;
+ }
+ pGlyphBitmap = RenderGlyph(pFont, glyph_index, bFontStyle, pMatrix, dest_width, anti_alias);
+ if (pGlyphBitmap == NULL) {
+ return NULL;
+ }
+ pSizeCache->m_GlyphMap.SetAt((FX_LPVOID)(FX_UINTPTR)glyph_index, pGlyphBitmap);
+ return pGlyphBitmap;
+}
+const CFX_GlyphBitmap* CFX_FaceCache::LoadGlyphBitmap(CFX_Font* pFont, FX_DWORD glyph_index, FX_BOOL bFontStyle, const CFX_AffineMatrix* pMatrix,
+ int dest_width, int anti_alias, int& text_flags)
+{
+ if (glyph_index == (FX_DWORD) - 1) {
+ return NULL;
+ }
+ _CFX_UniqueKeyGen keygen;
+#if ((_FXM_PLATFORM_ != _FXM_PLATFORM_APPLE_)|| defined(_FPDFAPI_MINI_))
+ if (pFont->GetSubstFont())
+ keygen.Generate(9, (int)(pMatrix->a * 10000), (int)(pMatrix->b * 10000),
+ (int)(pMatrix->c * 10000), (int)(pMatrix->d * 10000), dest_width, anti_alias,
+ pFont->GetSubstFont()->m_Weight, pFont->GetSubstFont()->m_ItalicAngle, pFont->IsVertical());
+ else
+ keygen.Generate(6, (int)(pMatrix->a * 10000), (int)(pMatrix->b * 10000),
+ (int)(pMatrix->c * 10000), (int)(pMatrix->d * 10000), dest_width, anti_alias);
+#else
+ if (text_flags & FXTEXT_NO_NATIVETEXT) {
+ if (pFont->GetSubstFont())
+ keygen.Generate(9, (int)(pMatrix->a * 10000), (int)(pMatrix->b * 10000),
+ (int)(pMatrix->c * 10000), (int)(pMatrix->d * 10000), dest_width, anti_alias,
+ pFont->GetSubstFont()->m_Weight, pFont->GetSubstFont()->m_ItalicAngle, pFont->IsVertical());
+ else
+ keygen.Generate(6, (int)(pMatrix->a * 10000), (int)(pMatrix->b * 10000),
+ (int)(pMatrix->c * 10000), (int)(pMatrix->d * 10000), dest_width, anti_alias);
+ } else {
+ if (pFont->GetSubstFont())
+ keygen.Generate(10, (int)(pMatrix->a * 10000), (int)(pMatrix->b * 10000),
+ (int)(pMatrix->c * 10000), (int)(pMatrix->d * 10000), dest_width, anti_alias,
+ pFont->GetSubstFont()->m_Weight, pFont->GetSubstFont()->m_ItalicAngle, pFont->IsVertical(), 3);
+ else
+ keygen.Generate(7, (int)(pMatrix->a * 10000), (int)(pMatrix->b * 10000),
+ (int)(pMatrix->c * 10000), (int)(pMatrix->d * 10000), dest_width, anti_alias, 3);
+ }
+#endif
+ CFX_ByteStringC FaceGlyphsKey(keygen.m_Key, keygen.m_KeyLen);
+#if ((_FXM_PLATFORM_ != _FXM_PLATFORM_APPLE_)|| defined(_FPDFAPI_MINI_))
+ return LookUpGlyphBitmap(pFont, pMatrix, FaceGlyphsKey, glyph_index, bFontStyle, dest_width, anti_alias);
+#else
+ if (text_flags & FXTEXT_NO_NATIVETEXT) {
+ return LookUpGlyphBitmap(pFont, pMatrix, FaceGlyphsKey, glyph_index, bFontStyle, dest_width, anti_alias);
+ } else {
+ CFX_GlyphBitmap* pGlyphBitmap;
+ CFX_SizeGlyphCache* pSizeCache = NULL;
+ if (m_SizeMap.Lookup(FaceGlyphsKey, (void*&)pSizeCache)) {
+ if (pSizeCache->m_GlyphMap.Lookup((FX_LPVOID)(FX_UINTPTR)glyph_index, (void*&)pGlyphBitmap)) {
+ return pGlyphBitmap;
+ }
+ pGlyphBitmap = RenderGlyph_Nativetext(pFont, glyph_index, pMatrix, dest_width, anti_alias);
+ if (pGlyphBitmap) {
+ pSizeCache->m_GlyphMap.SetAt((FX_LPVOID)(FX_UINTPTR)glyph_index, pGlyphBitmap);
+ return pGlyphBitmap;
+ }
+ } else {
+ pGlyphBitmap = RenderGlyph_Nativetext(pFont, glyph_index, pMatrix, dest_width, anti_alias);
+ if (pGlyphBitmap) {
+ pSizeCache = FX_NEW CFX_SizeGlyphCache;
+ if (pSizeCache == NULL) {
+ return NULL;
+ }
+ m_SizeMap.SetAt(FaceGlyphsKey, pSizeCache);
+ pSizeCache->m_GlyphMap.SetAt((FX_LPVOID)(FX_UINTPTR)glyph_index, pGlyphBitmap);
+ return pGlyphBitmap;
+ }
+ }
+ if (pFont->GetSubstFont())
+ keygen.Generate(9, (int)(pMatrix->a * 10000), (int)(pMatrix->b * 10000),
+ (int)(pMatrix->c * 10000), (int)(pMatrix->d * 10000), dest_width, anti_alias,
+ pFont->GetSubstFont()->m_Weight, pFont->GetSubstFont()->m_ItalicAngle, pFont->IsVertical());
+ else
+ keygen.Generate(6, (int)(pMatrix->a * 10000), (int)(pMatrix->b * 10000),
+ (int)(pMatrix->c * 10000), (int)(pMatrix->d * 10000), dest_width, anti_alias);
+ CFX_ByteStringC FaceGlyphsKey(keygen.m_Key, keygen.m_KeyLen);
+ text_flags |= FXTEXT_NO_NATIVETEXT;
+ return LookUpGlyphBitmap(pFont, pMatrix, FaceGlyphsKey, glyph_index, bFontStyle, dest_width, anti_alias);
+ }
+#endif
+}
+CFX_SizeGlyphCache::~CFX_SizeGlyphCache()
+{
+ FX_POSITION pos = m_GlyphMap.GetStartPosition();
+ FX_LPVOID Key;
+ CFX_GlyphBitmap* pGlyphBitmap = NULL;
+ while(pos) {
+ m_GlyphMap.GetNextAssoc(pos, Key, (void*&)pGlyphBitmap);
+ delete pGlyphBitmap;
+ }
+ m_GlyphMap.RemoveAll();
+}
+#if defined(_FPDFAPI_MINI_)
+#define CONTRAST_RAMP_STEP 16
+#else
+#define CONTRAST_RAMP_STEP 1
+#endif
+static const FX_BYTE g_adjust_contrast11[256] = {
+ 0, 0, 2, 3, 4, 5, 6, 8, 9, 10, 11, 13, 14, 15, 17, 18, 19, 21, 22, 24, 25, 26, 28, 29, 31,
+ 32, 33, 35, 36, 38, 39, 40, 42, 43, 45, 46, 48, 49, 51, 52, 54, 55, 56, 58, 59, 61, 62, 64, 65,
+ 67, 68, 70, 71, 72, 74, 75, 77, 78, 80, 81, 83, 84, 86, 87, 89, 90, 91, 93, 94, 96, 97, 99, 100,
+ 101, 103, 104, 106, 107, 109, 110, 111, 113, 114, 116, 117, 118, 120, 121, 123, 124, 125, 127,
+ 128, 130, 131, 132, 134, 135, 136, 138, 139, 140, 142, 143, 144, 146, 147, 148, 149, 151, 152,
+ 153, 155, 156, 157, 158, 160, 161, 162, 163, 165, 166, 167, 168, 169, 171, 172, 173, 174, 175,
+ 177, 178, 179, 180, 181, 182, 183, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196,
+ 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215,
+ 215, 216, 217, 218, 219, 220, 221, 221, 222, 223, 224, 224, 225, 226, 227, 227, 228, 229, 230,
+ 230, 231, 232, 232, 233, 234, 234, 235, 236, 236, 237, 237, 238, 239, 239, 240, 240, 241, 241,
+ 242, 242, 243, 243, 244, 244, 245, 245, 246, 246, 246, 247, 247, 248, 248, 248, 249, 249, 249,
+ 250, 250, 250, 251, 251, 251, 251, 252, 252, 252, 252, 253, 253, 253, 253, 253, 253, 254, 254,
+ 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 255,
+};
+static const FX_BYTE g_adjust_contrast15[256] = {
+ 0, 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 5, 5, 6, 7, 7, 8, 9, 10, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
+ 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 34, 35, 36, 37, 38, 40, 41, 42, 43, 45, 46, 47, 48, 50, 51,
+ 52, 54, 55, 56, 58, 59, 60, 62, 63, 64, 66, 67, 68, 70, 71, 73, 74, 75, 77, 78, 80, 81, 82, 84, 85, 87,
+ 88, 90, 91, 93, 94, 95, 97, 98, 100, 101, 103, 104, 106, 107, 109, 110, 111, 113, 114, 116, 117, 119,
+ 120, 122, 123, 125, 126, 128, 129, 130, 132, 133, 135, 136, 138, 139, 141, 142, 143, 145, 146, 148,
+ 149, 150, 152, 153, 155, 156, 157, 159, 160, 161, 163, 164, 166, 167, 168, 170, 171, 172, 174, 175,
+ 176, 177, 179, 180, 181, 183, 184, 185, 186, 188, 189, 190, 191, 192, 194, 195, 196, 197, 198, 199,
+ 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220,
+ 221, 222, 223, 224, 225, 226, 227, 227, 228, 229, 230, 231, 232, 232, 233, 234, 235, 235, 236, 237,
+ 237, 238, 239, 239, 240, 241, 241, 242, 242, 243, 244, 244, 245, 245, 246, 246, 247, 247, 248, 248,
+ 248, 249, 249, 250, 250, 250, 251, 251, 251, 252, 252, 252, 252, 253, 253, 253, 253, 253, 254, 254,
+ 254, 254, 254, 254, 254, 254, 254, 254, 254, 255,
+};
+static void _CalcContrastRamp(FX_LPBYTE ramp, int level)
+{
+ int contrast_min = 0, contrast_max = 255 - level, i;
+ for (i = 0; i < contrast_min; i ++) {
+ ramp[i] = 0;
+ }
+ for (i = contrast_min; i < contrast_max; i ++) {
+ ramp[i] = 255 * (i - contrast_min) / (contrast_max - contrast_min);
+ }
+ for (i = contrast_max; i < 256; i ++) {
+ ramp[i] = 255;
+ }
+}
+void CFX_Font::AdjustMMParams(int glyph_index, int dest_width, int weight)
+{
+ FXFT_MM_Var pMasters = NULL;
+ FXFT_Get_MM_Var(m_Face, &pMasters);
+ if (pMasters == NULL) {
+ return;
+ }
+ long coords[2];
+ if (weight == 0) {
+ coords[0] = FXFT_Get_MM_Axis_Def(FXFT_Get_MM_Axis(pMasters, 0)) / 65536;
+ } else {
+ coords[0] = weight;
+ }
+ if (dest_width == 0) {
+ coords[1] = FXFT_Get_MM_Axis_Def(FXFT_Get_MM_Axis(pMasters, 1)) / 65536;
+ } else {
+ int min_param = FXFT_Get_MM_Axis_Min(FXFT_Get_MM_Axis(pMasters, 1)) / 65536;
+ int max_param = FXFT_Get_MM_Axis_Max(FXFT_Get_MM_Axis(pMasters, 1)) / 65536;
+ coords[1] = min_param;
+ int error = FXFT_Set_MM_Design_Coordinates(m_Face, 2, coords);
+ error = FXFT_Load_Glyph(m_Face, glyph_index, FXFT_LOAD_NO_SCALE | FXFT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH);
+ int min_width = FXFT_Get_Glyph_HoriAdvance(m_Face) * 1000 / FXFT_Get_Face_UnitsPerEM(m_Face);
+ coords[1] = max_param;
+ error = FXFT_Set_MM_Design_Coordinates(m_Face, 2, coords);
+ error = FXFT_Load_Glyph(m_Face, glyph_index, FXFT_LOAD_NO_SCALE | FXFT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH);
+ int max_width = FXFT_Get_Glyph_HoriAdvance(m_Face) * 1000 / FXFT_Get_Face_UnitsPerEM(m_Face);
+ if (max_width == min_width) {
+ return;
+ }
+ int param = min_param + (max_param - min_param) * (dest_width - min_width) / (max_width - min_width);
+ coords[1] = param;
+ }
+ FXFT_Free(m_Face, pMasters);
+ FXFT_Set_MM_Design_Coordinates(m_Face, 2, coords);
+}
+extern const char g_AngleSkew[30] = {
+ 0, 2, 3, 5, 7, 9, 11, 12, 14, 16,
+ 18, 19, 21, 23, 25, 27, 29, 31, 32, 34,
+ 36, 38, 40, 42, 45, 47, 49, 51, 53, 55,
+};
+static const FX_BYTE g_WeightPow[100] = {
+ 0, 3, 6, 7, 8, 9, 11, 12, 14, 15, 16, 17, 18, 19, 20,
+ 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 35, 36, 36,
+ 37, 37, 37, 38, 38, 38, 39, 39, 39, 40, 40, 40, 41, 41, 41, 42, 42, 42,
+ 42, 43, 43, 43, 44, 44, 44, 44, 45, 45, 45, 45, 46, 46, 46, 46, 47, 47,
+ 47, 47, 48, 48, 48, 48, 48, 49, 49, 49, 49, 50, 50, 50, 50, 50, 51, 51,
+ 51, 51, 51, 52, 52, 52, 52, 52, 53, 53, 53, 53, 53,
+};
+extern const FX_BYTE g_WeightPow_11[100] = {
+ 0, 4, 7, 8, 9, 10, 12, 13, 15, 17, 18, 19, 20, 21, 22,
+ 23, 24, 25, 26, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 39, 39, 40, 40,
+ 41, 41, 41, 42, 42, 42, 43, 43, 43, 44, 44, 44, 45, 45, 45, 46, 46, 46,
+ 46, 43, 47, 47, 48, 48, 48, 48, 45, 50, 50, 50, 46, 51, 51, 51, 52, 52,
+ 52, 52, 53, 53, 53, 53, 53, 54, 54, 54, 54, 55, 55, 55, 55, 55, 56, 56,
+ 56, 56, 56, 57, 57, 57, 57, 57, 58, 58, 58, 58, 58,
+};
+extern const FX_BYTE g_WeightPow_SHIFTJIS[100] = {
+ 0, 0, 1, 2, 3, 4, 5, 7, 8, 10, 11, 13, 14, 16, 17, 19, 21, 22, 24, 26, 28,
+ 30, 32, 33, 35, 37, 39, 41, 43, 45, 48, 48, 48, 48, 49, 49, 49, 50, 50, 50, 50,
+ 51, 51, 51, 51, 52, 52, 52, 52, 52, 53, 53, 53, 53, 53, 54, 54, 54, 54, 54, 55, 55,
+ 55, 55, 55, 56, 56, 56, 56, 56 , 56, 57, 57, 57 , 57 , 57, 57, 57, 58, 58, 58, 58, 58,
+ 58, 58, 59, 59, 59, 59, 59, 59, 59, 60, 60, 60, 60, 60, 60, 60, 60,
+};
+static void _GammaAdjust(FX_LPBYTE pData, int nWid, int nHei, int src_pitch, FX_LPCBYTE gammaTable)
+{
+ int count = nHei * src_pitch;
+ for(int i = 0; i < count; i++) {
+ pData[i] = gammaTable[pData[i]];
+ }
+}
+static void _ContrastAdjust(FX_LPBYTE pDataIn, FX_LPBYTE pDataOut, int nWid, int nHei, int nSrcRowBytes, int nDstRowBytes)
+{
+ int col, row, temp;
+ int max = 0, min = 255;
+ FX_FLOAT rate;
+ for (row = 0; row < nHei; row ++) {
+ FX_LPBYTE pRow = pDataIn + row * nSrcRowBytes;
+ for (col = 0; col < nWid; col++) {
+ temp = *pRow ++;
+ if (temp > max) {
+ max = temp;
+ }
+ if (temp < min) {
+ min = temp;
+ }
+ }
+ }
+ temp = max - min;
+ if (0 == temp || 255 == temp) {
+ int rowbytes = FXSYS_abs(nSrcRowBytes) > nDstRowBytes ? nDstRowBytes : FXSYS_abs(nSrcRowBytes);
+ for (row = 0; row < nHei; row ++) {
+ FXSYS_memcpy32(pDataOut + row * nDstRowBytes, pDataIn + row * nSrcRowBytes, rowbytes);
+ }
+ return;
+ }
+ rate = 255.f / temp;
+ for (row = 0; row < nHei; row ++) {
+ FX_LPBYTE pSrcRow = pDataIn + row * nSrcRowBytes;
+ FX_LPBYTE pDstRow = pDataOut + row * nDstRowBytes;
+ for (col = 0; col < nWid; col ++) {
+ temp = (int)((*(pSrcRow++) - min) * rate + 0.5);
+ if (temp > 255) {
+ temp = 255;
+ } else if (temp < 0) {
+ temp = 0;
+ }
+ *pDstRow ++ = (FX_BYTE)temp;
+ }
+ }
+}
+CFX_GlyphBitmap* CFX_FaceCache::RenderGlyph(CFX_Font* pFont, FX_DWORD glyph_index, FX_BOOL bFontStyle,
+ const CFX_AffineMatrix* pMatrix, int dest_width, int anti_alias)
+{
+ if (m_Face == NULL) {
+ return NULL;
+ }
+ FXFT_Matrix ft_matrix;
+ ft_matrix.xx = (signed long)(pMatrix->GetA() / 64 * 65536);
+ ft_matrix.xy = (signed long)(pMatrix->GetC() / 64 * 65536);
+ ft_matrix.yx = (signed long)(pMatrix->GetB() / 64 * 65536);
+ ft_matrix.yy = (signed long)(pMatrix->GetD() / 64 * 65536);
+ FX_BOOL bUseCJKSubFont = FALSE;
+ const CFX_SubstFont* pSubstFont = pFont->GetSubstFont();
+ if (pSubstFont) {
+ bUseCJKSubFont = pSubstFont->m_bSubstOfCJK && bFontStyle;
+ int skew = 0;
+ if (bUseCJKSubFont) {
+ skew = pSubstFont->m_bItlicCJK ? -15 : 0;
+ } else {
+ skew = pSubstFont->m_ItalicAngle;
+ }
+ if (skew) {
+ skew = skew <= -30 ? -58 : -g_AngleSkew[-skew];
+ if (pFont->IsVertical()) {
+ ft_matrix.yx += ft_matrix.yy * skew / 100;
+ } else {
+ ft_matrix.xy += -ft_matrix.xx * skew / 100;
+ }
+ }
+ if (pSubstFont->m_SubstFlags & FXFONT_SUBST_MM) {
+ pFont->AdjustMMParams(glyph_index, dest_width, pFont->GetSubstFont()->m_Weight);
+ }
+ }
+ int transflag = FXFT_Get_Face_Internal_Flag(m_Face);
+ FXFT_Set_Transform(m_Face, &ft_matrix, 0);
+ int load_flags = (m_Face->face_flags & FT_FACE_FLAG_SFNT) ? FXFT_LOAD_NO_BITMAP : (FXFT_LOAD_NO_BITMAP | FT_LOAD_NO_HINTING);
+ int error = FXFT_Load_Glyph(m_Face, glyph_index, load_flags);
+ if (error) {
+ FXFT_Set_Face_Internal_Flag(m_Face, transflag);
+ return NULL;
+ }
+ int weight = 0;
+ if (bUseCJKSubFont) {
+ weight = pSubstFont->m_WeightCJK;
+ } else {
+ weight = pSubstFont ? pSubstFont->m_Weight : 0;
+ }
+ if (pSubstFont && !(pSubstFont->m_SubstFlags & FXFONT_SUBST_MM) && weight > 400) {
+ int index = (weight - 400) / 10;
+ if (index >= 100) {
+ FXFT_Set_Face_Internal_Flag(m_Face, transflag);
+ return NULL;
+ }
+ int level = 0;
+ if (pSubstFont->m_Charset == FXFONT_SHIFTJIS_CHARSET) {
+ level = g_WeightPow_SHIFTJIS[index] * 2 * (FXSYS_abs((int)(ft_matrix.xx)) + FXSYS_abs((int)(ft_matrix.xy))) / 36655;
+ } else {
+ level = g_WeightPow_11[index] * (FXSYS_abs((int)(ft_matrix.xx)) + FXSYS_abs((int)(ft_matrix.xy))) / 36655;
+ }
+ FXFT_Outline_Embolden(FXFT_Get_Glyph_Outline(m_Face), level);
+ }
+ FXFT_Library_SetLcdFilter(CFX_GEModule::Get()->GetFontMgr()->m_FTLibrary, FT_LCD_FILTER_DEFAULT);
+ error = FXFT_Render_Glyph(m_Face, anti_alias);
+ if (error) {
+ FXFT_Set_Face_Internal_Flag(m_Face, transflag);
+ return NULL;
+ }
+ int bmwidth = FXFT_Get_Bitmap_Width(FXFT_Get_Glyph_Bitmap(m_Face));
+ int bmheight = FXFT_Get_Bitmap_Rows(FXFT_Get_Glyph_Bitmap(m_Face));
+ if (bmwidth > 2048 || bmheight > 2048) {
+ FXFT_Set_Face_Internal_Flag(m_Face, transflag);
+ return NULL;
+ }
+ int dib_width = bmwidth;
+ CFX_GlyphBitmap* pGlyphBitmap = FX_NEW CFX_GlyphBitmap;
+ if (!pGlyphBitmap) {
+ return NULL;
+ }
+ pGlyphBitmap->m_Bitmap.Create(dib_width, bmheight,
+ anti_alias == FXFT_RENDER_MODE_MONO ? FXDIB_1bppMask : FXDIB_8bppMask);
+ pGlyphBitmap->m_Left = FXFT_Get_Glyph_BitmapLeft(m_Face);
+ pGlyphBitmap->m_Top = FXFT_Get_Glyph_BitmapTop(m_Face);
+ int dest_pitch = pGlyphBitmap->m_Bitmap.GetPitch();
+ int src_pitch = FXFT_Get_Bitmap_Pitch(FXFT_Get_Glyph_Bitmap(m_Face));
+ FX_BYTE* pDestBuf = pGlyphBitmap->m_Bitmap.GetBuffer();
+ FX_BYTE* pSrcBuf = (FX_BYTE*)FXFT_Get_Bitmap_Buffer(FXFT_Get_Glyph_Bitmap(m_Face));
+ if (anti_alias != FXFT_RENDER_MODE_MONO && FXFT_Get_Bitmap_PixelMode(FXFT_Get_Glyph_Bitmap(m_Face)) == FXFT_PIXEL_MODE_MONO) {
+ int bytes = anti_alias == FXFT_RENDER_MODE_LCD ? 3 : 1;
+ for(int i = 0; i < bmheight; i++)
+ for(int n = 0; n < bmwidth; n++) {
+ FX_BYTE data = (pSrcBuf[i * src_pitch + n / 8] & (0x80 >> (n % 8))) ? 255 : 0;
+ for (int b = 0; b < bytes; b ++) {
+ pDestBuf[i * dest_pitch + n * bytes + b] = data;
+ }
+ }
+ } else {
+ FXSYS_memset32(pDestBuf, 0, dest_pitch * bmheight);
+ if (anti_alias == FXFT_RENDER_MODE_MONO && FXFT_Get_Bitmap_PixelMode(FXFT_Get_Glyph_Bitmap(m_Face)) == FXFT_PIXEL_MODE_MONO) {
+ int rowbytes = FXSYS_abs(src_pitch) > dest_pitch ? dest_pitch : FXSYS_abs(src_pitch);
+ for (int row = 0; row < bmheight; row ++) {
+ FXSYS_memcpy32(pDestBuf + row * dest_pitch, pSrcBuf + row * src_pitch, rowbytes);
+ }
+ } else {
+ _ContrastAdjust(pSrcBuf, pDestBuf, bmwidth, bmheight, src_pitch, dest_pitch);
+ _GammaAdjust(pDestBuf, bmwidth, bmheight, dest_pitch, CFX_GEModule::Get()->GetTextGammaTable());
+ }
+ }
+ FXFT_Set_Face_Internal_Flag(m_Face, transflag);
+ return pGlyphBitmap;
+}
+FX_BOOL _OutputGlyph(void* dib, int x, int y, CFX_Font* pFont,
+ int glyph_index, FX_ARGB argb)
+{
+ CFX_DIBitmap* pDib = (CFX_DIBitmap*)dib;
+ FXFT_Face face = pFont->GetFace();
+ int error = FXFT_Load_Glyph(face, glyph_index, FXFT_LOAD_NO_BITMAP);
+ if (error) {
+ return FALSE;
+ }
+ error = FXFT_Render_Glyph(face, FXFT_RENDER_MODE_NORMAL);
+ if (error) {
+ return FALSE;
+ }
+ int bmwidth = FXFT_Get_Bitmap_Width(FXFT_Get_Glyph_Bitmap(face));
+ int bmheight = FXFT_Get_Bitmap_Rows(FXFT_Get_Glyph_Bitmap(face));
+ int left = FXFT_Get_Glyph_BitmapLeft(face);
+ int top = FXFT_Get_Glyph_BitmapTop(face);
+ FX_LPCBYTE src_buf = (FX_LPCBYTE)FXFT_Get_Bitmap_Buffer(FXFT_Get_Glyph_Bitmap(face));
+ int src_pitch = FXFT_Get_Bitmap_Pitch(FXFT_Get_Glyph_Bitmap(face));
+ CFX_DIBitmap mask;
+ mask.Create(bmwidth, bmheight, FXDIB_8bppMask);
+ FX_LPBYTE dest_buf = mask.GetBuffer();
+ int dest_pitch = mask.GetPitch();
+ for (int row = 0; row < bmheight; row ++) {
+ FX_LPCBYTE src_scan = src_buf + row * src_pitch;
+ FX_LPBYTE dest_scan = dest_buf + row * dest_pitch;
+ FXSYS_memcpy32(dest_scan, src_scan, dest_pitch);
+ }
+ pDib->CompositeMask(x + left, y - top, bmwidth, bmheight, &mask, argb, 0, 0);
+ return TRUE;
+}
+FX_BOOL OutputText(void* dib, int x, int y, CFX_Font* pFont, double font_size,
+ CFX_AffineMatrix* pText_matrix, unsigned short const* text, unsigned long argb)
+{
+ if (!pFont) {
+ return FALSE;
+ }
+ FXFT_Face face = pFont->GetFace();
+ FXFT_Select_Charmap(pFont->m_Face, FXFT_ENCODING_UNICODE);
+ int transflag = FXFT_Get_Face_Internal_Flag(pFont->m_Face);
+ if (pText_matrix) {
+ FXFT_Matrix ft_matrix;
+ ft_matrix.xx = (signed long)(pText_matrix->a / 64 * 65536);
+ ft_matrix.xy = (signed long)(pText_matrix->c / 64 * 65536);
+ ft_matrix.yx = (signed long)(pText_matrix->b / 64 * 65536);
+ ft_matrix.yy = (signed long)(pText_matrix->d / 64 * 65536);
+ FXFT_Set_Transform(face, &ft_matrix, 0);
+ }
+ FX_FLOAT x_pos = 0;
+ for (; *text != 0; text ++) {
+ FX_WCHAR unicode = *text;
+ int glyph_index = FXFT_Get_Char_Index(pFont->m_Face, unicode);
+ if (glyph_index <= 0) {
+ continue;
+ }
+ int err = FXFT_Load_Glyph(pFont->m_Face, glyph_index, FXFT_LOAD_NO_SCALE | FXFT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH);
+ if (err) {
+ continue;
+ }
+ int w = FXFT_Get_Glyph_HoriAdvance(pFont->m_Face);
+ int em = FXFT_Get_Face_UnitsPerEM(pFont->m_Face);
+ FX_FLOAT x1, y1;
+ pText_matrix->Transform(x_pos, 0, x1, y1);
+ _OutputGlyph(dib, (int)x1 + x, (int) - y1 + y, pFont,
+ glyph_index, argb);
+ x_pos += (FX_FLOAT)w / em;
+ }
+ FXFT_Set_Face_Internal_Flag(pFont->m_Face, transflag);
+ return TRUE;
+}
+FX_BOOL OutputGlyph(void* dib, int x, int y, CFX_Font* pFont, double font_size,
+ CFX_AffineMatrix* pMatrix, unsigned long glyph_index, unsigned long argb)
+{
+ FXFT_Matrix ft_matrix;
+ if (pMatrix) {
+ ft_matrix.xx = (signed long)(pMatrix->a * font_size / 64 * 65536);
+ ft_matrix.xy = (signed long)(pMatrix->c * font_size / 64 * 65536);
+ ft_matrix.yx = (signed long)(pMatrix->b * font_size / 64 * 65536);
+ ft_matrix.yy = (signed long)(pMatrix->d * font_size / 64 * 65536);
+ } else {
+ ft_matrix.xx = (signed long)(font_size / 64 * 65536);
+ ft_matrix.xy = ft_matrix.yx = 0;
+ ft_matrix.yy = (signed long)(font_size / 64 * 65536);
+ }
+ int transflag = FXFT_Get_Face_Internal_Flag(pFont->m_Face);
+ FXFT_Set_Transform(pFont->m_Face, &ft_matrix, 0);
+ FX_BOOL ret = _OutputGlyph(dib, x, y, pFont,
+ glyph_index, argb);
+ FXFT_Set_Face_Internal_Flag(pFont->m_Face, transflag);
+ return ret;
+}
+const CFX_PathData* CFX_FaceCache::LoadGlyphPath(CFX_Font* pFont, FX_DWORD glyph_index, int dest_width)
+{
+ if (m_Face == NULL || glyph_index == (FX_DWORD) - 1) {
+ return NULL;
+ }
+ CFX_PathData* pGlyphPath = NULL;
+ FX_LPVOID key;
+ if (pFont->GetSubstFont())
+ key = (FX_LPVOID)(FX_UINTPTR)(glyph_index + ((pFont->GetSubstFont()->m_Weight / 16) << 15) +
+ ((pFont->GetSubstFont()->m_ItalicAngle / 2) << 21) + ((dest_width / 16) << 25) +
+ (pFont->IsVertical() << 31));
+ else {
+ key = (FX_LPVOID)(FX_UINTPTR)glyph_index;
+ }
+ if (m_PathMap.Lookup(key, (FX_LPVOID&)pGlyphPath)) {
+ return pGlyphPath;
+ }
+ pGlyphPath = pFont->LoadGlyphPath(glyph_index, dest_width);
+ m_PathMap.SetAt(key, pGlyphPath);
+ return pGlyphPath;
+}
+typedef struct {
+ FX_BOOL m_bCount;
+ int m_PointCount;
+ FX_PATHPOINT* m_pPoints;
+ int m_CurX;
+ int m_CurY;
+ FX_FLOAT m_CoordUnit;
+} OUTLINE_PARAMS;
+void _Outline_CheckEmptyContour(OUTLINE_PARAMS* param)
+{
+ if (param->m_PointCount >= 2 && param->m_pPoints[param->m_PointCount - 2].m_Flag == FXPT_MOVETO &&
+ param->m_pPoints[param->m_PointCount - 2].m_PointX == param->m_pPoints[param->m_PointCount - 1].m_PointX &&
+ param->m_pPoints[param->m_PointCount - 2].m_PointY == param->m_pPoints[param->m_PointCount - 1].m_PointY) {
+ param->m_PointCount -= 2;
+ }
+ if (param->m_PointCount >= 4 && param->m_pPoints[param->m_PointCount - 4].m_Flag == FXPT_MOVETO &&
+ param->m_pPoints[param->m_PointCount - 3].m_Flag == FXPT_BEZIERTO &&
+ param->m_pPoints[param->m_PointCount - 3].m_PointX == param->m_pPoints[param->m_PointCount - 4].m_PointX &&
+ param->m_pPoints[param->m_PointCount - 3].m_PointY == param->m_pPoints[param->m_PointCount - 4].m_PointY &&
+ param->m_pPoints[param->m_PointCount - 2].m_PointX == param->m_pPoints[param->m_PointCount - 4].m_PointX &&
+ param->m_pPoints[param->m_PointCount - 2].m_PointY == param->m_pPoints[param->m_PointCount - 4].m_PointY &&
+ param->m_pPoints[param->m_PointCount - 1].m_PointX == param->m_pPoints[param->m_PointCount - 4].m_PointX &&
+ param->m_pPoints[param->m_PointCount - 1].m_PointY == param->m_pPoints[param->m_PointCount - 4].m_PointY) {
+ param->m_PointCount -= 4;
+ }
+}
+extern "C" {
+ static int _Outline_MoveTo(const FXFT_Vector* to, void* user)
+ {
+ OUTLINE_PARAMS* param = (OUTLINE_PARAMS*)user;
+ if (!param->m_bCount) {
+ _Outline_CheckEmptyContour(param);
+ param->m_pPoints[param->m_PointCount].m_PointX = to->x / param->m_CoordUnit;
+ param->m_pPoints[param->m_PointCount].m_PointY = to->y / param->m_CoordUnit;
+ param->m_pPoints[param->m_PointCount].m_Flag = FXPT_MOVETO;
+ param->m_CurX = to->x;
+ param->m_CurY = to->y;
+ if (param->m_PointCount) {
+ param->m_pPoints[param->m_PointCount - 1].m_Flag |= FXPT_CLOSEFIGURE;
+ }
+ }
+ param->m_PointCount ++;
+ return 0;
+ }
+};
+extern "C" {
+ static int _Outline_LineTo(const FXFT_Vector* to, void* user)
+ {
+ OUTLINE_PARAMS* param = (OUTLINE_PARAMS*)user;
+ if (!param->m_bCount) {
+ param->m_pPoints[param->m_PointCount].m_PointX = to->x / param->m_CoordUnit;
+ param->m_pPoints[param->m_PointCount].m_PointY = to->y / param->m_CoordUnit;
+ param->m_pPoints[param->m_PointCount].m_Flag = FXPT_LINETO;
+ param->m_CurX = to->x;
+ param->m_CurY = to->y;
+ }
+ param->m_PointCount ++;
+ return 0;
+ }
+};
+extern "C" {
+ static int _Outline_ConicTo(const FXFT_Vector* control, const FXFT_Vector* to, void* user)
+ {
+ OUTLINE_PARAMS* param = (OUTLINE_PARAMS*)user;
+ if (!param->m_bCount) {
+ param->m_pPoints[param->m_PointCount].m_PointX = (param->m_CurX + (control->x - param->m_CurX) * 2 / 3) / param->m_CoordUnit;
+ param->m_pPoints[param->m_PointCount].m_PointY = (param->m_CurY + (control->y - param->m_CurY) * 2 / 3) / param->m_CoordUnit;
+ param->m_pPoints[param->m_PointCount].m_Flag = FXPT_BEZIERTO;
+ param->m_pPoints[param->m_PointCount + 1].m_PointX = (control->x + (to->x - control->x) / 3) / param->m_CoordUnit;
+ param->m_pPoints[param->m_PointCount + 1].m_PointY = (control->y + (to->y - control->y) / 3) / param->m_CoordUnit;
+ param->m_pPoints[param->m_PointCount + 1].m_Flag = FXPT_BEZIERTO;
+ param->m_pPoints[param->m_PointCount + 2].m_PointX = to->x / param->m_CoordUnit;
+ param->m_pPoints[param->m_PointCount + 2].m_PointY = to->y / param->m_CoordUnit;
+ param->m_pPoints[param->m_PointCount + 2].m_Flag = FXPT_BEZIERTO;
+ param->m_CurX = to->x;
+ param->m_CurY = to->y;
+ }
+ param->m_PointCount += 3;
+ return 0;
+ }
+};
+extern "C" {
+ static int _Outline_CubicTo(const FXFT_Vector* control1, const FXFT_Vector* control2, const FXFT_Vector* to, void* user)
+ {
+ OUTLINE_PARAMS* param = (OUTLINE_PARAMS*)user;
+ if (!param->m_bCount) {
+ param->m_pPoints[param->m_PointCount].m_PointX = control1->x / param->m_CoordUnit;
+ param->m_pPoints[param->m_PointCount].m_PointY = control1->y / param->m_CoordUnit;
+ param->m_pPoints[param->m_PointCount].m_Flag = FXPT_BEZIERTO;
+ param->m_pPoints[param->m_PointCount + 1].m_PointX = control2->x / param->m_CoordUnit;
+ param->m_pPoints[param->m_PointCount + 1].m_PointY = control2->y / param->m_CoordUnit;
+ param->m_pPoints[param->m_PointCount + 1].m_Flag = FXPT_BEZIERTO;
+ param->m_pPoints[param->m_PointCount + 2].m_PointX = to->x / param->m_CoordUnit;
+ param->m_pPoints[param->m_PointCount + 2].m_PointY = to->y / param->m_CoordUnit;
+ param->m_pPoints[param->m_PointCount + 2].m_Flag = FXPT_BEZIERTO;
+ param->m_CurX = to->x;
+ param->m_CurY = to->y;
+ }
+ param->m_PointCount += 3;
+ return 0;
+ }
+};
+CFX_PathData* CFX_Font::LoadGlyphPath(FX_DWORD glyph_index, int dest_width)
+{
+ if (m_Face == NULL) {
+ return NULL;
+ }
+ FXFT_Set_Pixel_Sizes(m_Face, 0, 64);
+ FXFT_Matrix ft_matrix = {65536, 0, 0, 65536};
+ if (m_pSubstFont) {
+ if (m_pSubstFont->m_ItalicAngle) {
+ int skew = m_pSubstFont->m_ItalicAngle;
+ skew = skew <= -30 ? -58 : -g_AngleSkew[-skew];
+ if (m_bVertical) {
+ ft_matrix.yx += ft_matrix.yy * skew / 100;
+ } else {
+ ft_matrix.xy += -ft_matrix.xx * skew / 100;
+ }
+ }
+ if (m_pSubstFont->m_SubstFlags & FXFONT_SUBST_MM) {
+ AdjustMMParams(glyph_index, dest_width, m_pSubstFont->m_Weight);
+ }
+ }
+ int transflag = FXFT_Get_Face_Internal_Flag(m_Face);
+ FXFT_Set_Transform(m_Face, &ft_matrix, 0);
+ int load_flags = (m_Face->face_flags & FT_FACE_FLAG_SFNT) ? FXFT_LOAD_NO_BITMAP : FXFT_LOAD_NO_BITMAP | FT_LOAD_NO_HINTING;
+ int error = FXFT_Load_Glyph(m_Face, glyph_index, load_flags);
+ if (error) {
+ FXFT_Set_Face_Internal_Flag(m_Face, transflag);
+ return NULL;
+ }
+ if (m_pSubstFont && !(m_pSubstFont->m_SubstFlags & FXFONT_SUBST_MM) && m_pSubstFont->m_Weight > 400) {
+ int level = 0;
+ if (m_pSubstFont->m_Charset == FXFONT_SHIFTJIS_CHARSET) {
+ level = g_WeightPow_SHIFTJIS[(m_pSubstFont->m_Weight - 400) / 10] * 2 * 65536 / 36655;
+ } else {
+ level = g_WeightPow[(m_pSubstFont->m_Weight - 400) / 10] * 2;
+ }
+ FXFT_Outline_Embolden(FXFT_Get_Glyph_Outline(m_Face), level);
+ }
+ FXFT_Outline_Funcs funcs;
+ funcs.move_to = _Outline_MoveTo;
+ funcs.line_to = _Outline_LineTo;
+ funcs.conic_to = _Outline_ConicTo;
+ funcs.cubic_to = _Outline_CubicTo;
+ funcs.shift = 0;
+ funcs.delta = 0;
+ OUTLINE_PARAMS params;
+ params.m_bCount = TRUE;
+ params.m_PointCount = 0;
+ FXFT_Outline_Decompose(FXFT_Get_Glyph_Outline(m_Face), &funcs, &params);
+ if (params.m_PointCount == 0) {
+ FXFT_Set_Face_Internal_Flag(m_Face, transflag);
+ return NULL;
+ }
+ CFX_PathData* pPath = FX_NEW CFX_PathData;
+ if (!pPath) {
+ return NULL;
+ }
+ pPath->SetPointCount(params.m_PointCount);
+ params.m_bCount = FALSE;
+ params.m_PointCount = 0;
+ params.m_pPoints = pPath->GetPoints();
+ params.m_CurX = params.m_CurY = 0;
+ params.m_CoordUnit = 64 * 64.0;
+ FXFT_Outline_Decompose(FXFT_Get_Glyph_Outline(m_Face), &funcs, &params);
+ _Outline_CheckEmptyContour(&params);
+ pPath->TrimPoints(params.m_PointCount);
+ if (params.m_PointCount) {
+ pPath->GetPoints()[params.m_PointCount - 1].m_Flag |= FXPT_CLOSEFIGURE;
+ }
+ FXFT_Set_Face_Internal_Flag(m_Face, transflag);
+ return pPath;
+}
+void _CFX_UniqueKeyGen::Generate(int count, ...)
+{
+ va_list argList;
+ va_start(argList, count);
+ for (int i = 0; i < count; i ++) {
+ int p = va_arg(argList, int);
+ ((FX_DWORD*)m_Key)[i] = p;
+ }
+ va_end(argList);
+ m_KeyLen = count * sizeof(FX_DWORD);
+}
diff --git a/core/src/fxge/ge/text_int.h b/core/src/fxge/ge/text_int.h
index 7608f8a2ed..a3c9417bfc 100644
--- a/core/src/fxge/ge/text_int.h
+++ b/core/src/fxge/ge/text_int.h
@@ -1,100 +1,100 @@
-// 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
-
-struct _CFX_UniqueKeyGen {
- void Generate(int count, ...);
- FX_CHAR m_Key[128];
- int m_KeyLen;
-};
-class CFX_SizeGlyphCache : public CFX_Object
-{
-public:
- CFX_SizeGlyphCache()
- {
- m_GlyphMap.InitHashTable(253);
- }
- ~CFX_SizeGlyphCache();
- CFX_MapPtrToPtr m_GlyphMap;
-};
-class CTTFontDesc : public CFX_Object
-{
-public:
- CTTFontDesc()
- {
- m_Type = 0;
- m_pFontData = NULL;
- m_RefCount = 0;
- }
- ~CTTFontDesc();
- FX_BOOL ReleaseFace(FXFT_Face face);
- int m_Type;
- union {
- struct {
- FX_BOOL m_bItalic;
- FX_BOOL m_bBold;
- FXFT_Face m_pFace;
- } m_SingleFace;
- struct {
- FXFT_Face m_pFaces[16];
- } m_TTCFace;
- };
- FX_BYTE* m_pFontData;
- int m_RefCount;
-};
-class CFX_UnicodeEncoding : public IFX_FontEncoding
-{
-public:
- CFX_UnicodeEncoding(CFX_Font* pFont);
- virtual FX_DWORD GlyphFromCharCodeEx(FX_DWORD charcode, int encoding = ENCODING_UNICODE);
-private:
- CFX_Font* m_pFont;
- virtual FX_DWORD GlyphFromCharCode(FX_DWORD charcode);
- virtual CFX_WideString UnicodeFromCharCode(FX_DWORD charcode) const
- {
- return CFX_WideString((FX_WCHAR)charcode);
- }
- virtual FX_DWORD CharCodeFromUnicode(FX_WCHAR Unicode) const
- {
- return Unicode;
- }
- virtual FX_BOOL IsUnicodeCompatible() const
- {
- return TRUE;
- }
-};
-#define CHARSET_FLAG_ANSI 1
-#define CHARSET_FLAG_SYMBOL 2
-#define CHARSET_FLAG_SHIFTJIS 4
-#define CHARSET_FLAG_BIG5 8
-#define CHARSET_FLAG_GB 16
-#define CHARSET_FLAG_KOREAN 32
-class CFontFaceInfo : public CFX_Object
-{
-public:
- CFX_ByteString m_FilePath;
- CFX_ByteString m_FaceName;
- FX_DWORD m_Styles;
- FX_DWORD m_Charsets;
- FX_DWORD m_FontOffset;
- FX_DWORD m_FileSize;
- CFX_ByteString m_FontTables;
-};
-class CFontFileFaceInfo : public CFX_Object
-{
-public:
- CFontFileFaceInfo();
- ~CFontFileFaceInfo();
- IFX_FileStream* m_pFile;
- FXFT_Face m_Face;
- CFX_ByteString m_FaceName;
- FX_DWORD m_Charsets;
- FX_DWORD m_FileSize;
- FX_DWORD m_FontOffset;
- int m_Weight;
- FX_BOOL m_bItalic;
- int m_PitchFamily;
- CFX_ByteString m_FontTables;
-};
+// 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
+
+struct _CFX_UniqueKeyGen {
+ void Generate(int count, ...);
+ FX_CHAR m_Key[128];
+ int m_KeyLen;
+};
+class CFX_SizeGlyphCache : public CFX_Object
+{
+public:
+ CFX_SizeGlyphCache()
+ {
+ m_GlyphMap.InitHashTable(253);
+ }
+ ~CFX_SizeGlyphCache();
+ CFX_MapPtrToPtr m_GlyphMap;
+};
+class CTTFontDesc : public CFX_Object
+{
+public:
+ CTTFontDesc()
+ {
+ m_Type = 0;
+ m_pFontData = NULL;
+ m_RefCount = 0;
+ }
+ ~CTTFontDesc();
+ FX_BOOL ReleaseFace(FXFT_Face face);
+ int m_Type;
+ union {
+ struct {
+ FX_BOOL m_bItalic;
+ FX_BOOL m_bBold;
+ FXFT_Face m_pFace;
+ } m_SingleFace;
+ struct {
+ FXFT_Face m_pFaces[16];
+ } m_TTCFace;
+ };
+ FX_BYTE* m_pFontData;
+ int m_RefCount;
+};
+class CFX_UnicodeEncoding : public IFX_FontEncoding
+{
+public:
+ CFX_UnicodeEncoding(CFX_Font* pFont);
+ virtual FX_DWORD GlyphFromCharCodeEx(FX_DWORD charcode, int encoding = ENCODING_UNICODE);
+private:
+ CFX_Font* m_pFont;
+ virtual FX_DWORD GlyphFromCharCode(FX_DWORD charcode);
+ virtual CFX_WideString UnicodeFromCharCode(FX_DWORD charcode) const
+ {
+ return CFX_WideString((FX_WCHAR)charcode);
+ }
+ virtual FX_DWORD CharCodeFromUnicode(FX_WCHAR Unicode) const
+ {
+ return Unicode;
+ }
+ virtual FX_BOOL IsUnicodeCompatible() const
+ {
+ return TRUE;
+ }
+};
+#define CHARSET_FLAG_ANSI 1
+#define CHARSET_FLAG_SYMBOL 2
+#define CHARSET_FLAG_SHIFTJIS 4
+#define CHARSET_FLAG_BIG5 8
+#define CHARSET_FLAG_GB 16
+#define CHARSET_FLAG_KOREAN 32
+class CFontFaceInfo : public CFX_Object
+{
+public:
+ CFX_ByteString m_FilePath;
+ CFX_ByteString m_FaceName;
+ FX_DWORD m_Styles;
+ FX_DWORD m_Charsets;
+ FX_DWORD m_FontOffset;
+ FX_DWORD m_FileSize;
+ CFX_ByteString m_FontTables;
+};
+class CFontFileFaceInfo : public CFX_Object
+{
+public:
+ CFontFileFaceInfo();
+ ~CFontFileFaceInfo();
+ IFX_FileStream* m_pFile;
+ FXFT_Face m_Face;
+ CFX_ByteString m_FaceName;
+ FX_DWORD m_Charsets;
+ FX_DWORD m_FileSize;
+ FX_DWORD m_FontOffset;
+ int m_Weight;
+ FX_BOOL m_bItalic;
+ int m_PitchFamily;
+ CFX_ByteString m_FontTables;
+};
diff --git a/core/src/fxge/win32/dwrite_int.h b/core/src/fxge/win32/dwrite_int.h
index 1f0770d0bf..2eecc7c76b 100644
--- a/core/src/fxge/win32/dwrite_int.h
+++ b/core/src/fxge/win32/dwrite_int.h
@@ -1,59 +1,59 @@
-// 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 _FX_DIRECT_WRITE_
-#define _FX_DIRECT_WRITE_
-#ifndef DECLSPEC_UUID
-#if (_MSC_VER >= 1100) && defined (__cplusplus)
-#define DECLSPEC_UUID(x) __declspec(uuid(x))
-#else
-#define DECLSPEC_UUID(x)
-#endif
-#endif
-#ifndef DECLSPEC_NOVTABLE
-#if (_MSC_VER >= 1100) && defined(__cplusplus)
-#define DECLSPEC_NOVTABLE __declspec(novtable)
-#else
-#define DECLSPEC_NOVTABLE
-#endif
-#endif
-#if(WINVER < 0x0500)
-#ifndef _MAC
-DECLARE_HANDLE(HMONITOR);
-#endif
-#endif
-class CDWriteExt
-{
-public:
- CDWriteExt();
- ~CDWriteExt();
-
- void Load();
- void Unload();
-
- FX_BOOL IsAvailable()
- {
- return m_pDWriteFactory != NULL;
- }
-
- void* DwCreateFontFaceFromStream(FX_LPBYTE pData, FX_DWORD size, int simulation_style);
- FX_BOOL DwCreateRenderingTarget(CFX_DIBitmap* pSrc, void** renderTarget);
- void DwDeleteRenderingTarget(void* renderTarget);
- FX_BOOL DwRendingString(void* renderTarget, CFX_ClipRgn* pClipRgn, FX_RECT& stringRect, CFX_AffineMatrix* pMatrix,
- void *font, FX_FLOAT font_size, FX_ARGB text_color,
- int glyph_count, unsigned short* glyph_indices,
- FX_FLOAT baselineOriginX, FX_FLOAT baselineOriginY,
- void* glyph_offsets,
- FX_FLOAT* glyph_advances);
- void DwDeleteFont(void* pFont);
-
-protected:
- void* m_hModule;
- void* m_pDWriteFactory;
- void* m_pDwFontContext;
- void* m_pDwTextRenderer;
-};
-#endif
+// 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 _FX_DIRECT_WRITE_
+#define _FX_DIRECT_WRITE_
+#ifndef DECLSPEC_UUID
+#if (_MSC_VER >= 1100) && defined (__cplusplus)
+#define DECLSPEC_UUID(x) __declspec(uuid(x))
+#else
+#define DECLSPEC_UUID(x)
+#endif
+#endif
+#ifndef DECLSPEC_NOVTABLE
+#if (_MSC_VER >= 1100) && defined(__cplusplus)
+#define DECLSPEC_NOVTABLE __declspec(novtable)
+#else
+#define DECLSPEC_NOVTABLE
+#endif
+#endif
+#if(WINVER < 0x0500)
+#ifndef _MAC
+DECLARE_HANDLE(HMONITOR);
+#endif
+#endif
+class CDWriteExt
+{
+public:
+ CDWriteExt();
+ ~CDWriteExt();
+
+ void Load();
+ void Unload();
+
+ FX_BOOL IsAvailable()
+ {
+ return m_pDWriteFactory != NULL;
+ }
+
+ void* DwCreateFontFaceFromStream(FX_LPBYTE pData, FX_DWORD size, int simulation_style);
+ FX_BOOL DwCreateRenderingTarget(CFX_DIBitmap* pSrc, void** renderTarget);
+ void DwDeleteRenderingTarget(void* renderTarget);
+ FX_BOOL DwRendingString(void* renderTarget, CFX_ClipRgn* pClipRgn, FX_RECT& stringRect, CFX_AffineMatrix* pMatrix,
+ void *font, FX_FLOAT font_size, FX_ARGB text_color,
+ int glyph_count, unsigned short* glyph_indices,
+ FX_FLOAT baselineOriginX, FX_FLOAT baselineOriginY,
+ void* glyph_offsets,
+ FX_FLOAT* glyph_advances);
+ void DwDeleteFont(void* pFont);
+
+protected:
+ void* m_hModule;
+ void* m_pDWriteFactory;
+ void* m_pDwFontContext;
+ void* m_pDwTextRenderer;
+};
+#endif
diff --git a/core/src/fxge/win32/fx_win32_device.cpp b/core/src/fxge/win32/fx_win32_device.cpp
index e3f5ae0609..592886249b 100644
--- a/core/src/fxge/win32/fx_win32_device.cpp
+++ b/core/src/fxge/win32/fx_win32_device.cpp
@@ -1,1200 +1,1200 @@
-// 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
-
-#include "../../../include/fxge/fx_ge.h"
-#if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_
-#include "../../../include/fxge/fx_ge_win32.h"
-#include <crtdbg.h>
-#include "../agg/include/fxfx_agg_clip_liang_barsky.h"
-#include "dwrite_int.h"
-#include "win32_int.h"
-#include "../ge/text_int.h"
-#include "../dib/dib_int.h"
-#include "../agg/include/fx_agg_driver.h"
-#include "../../../include/fxge/fx_freetype.h"
-#include "../../../include/fxcodec/fx_codec.h"
-class CWin32FontInfo : public IFX_SystemFontInfo
-{
-public:
- CWin32FontInfo();
- ~CWin32FontInfo();
- virtual void Release();
- virtual FX_BOOL EnumFontList(CFX_FontMapper* pMapper);
- virtual void* MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, FX_LPCSTR face, FX_BOOL& bExact);
- virtual void* GetFont(FX_LPCSTR face)
- {
- return NULL;
- }
- virtual FX_DWORD GetFontData(void* hFont, FX_DWORD table, FX_LPBYTE buffer, FX_DWORD size);
- virtual void DeleteFont(void* hFont);
- virtual FX_BOOL GetFaceName(void* hFont, CFX_ByteString& name);
- virtual FX_BOOL GetFontCharset(void* hFont, int& charset);
- FX_BOOL IsOpenTypeFromDiv(const LOGFONTA *plf);
- FX_BOOL IsSupportFontFormDiv(const LOGFONTA* plf);
- void AddInstalledFont(const LOGFONTA *plf, FX_DWORD FontType);
- void GetGBPreference(CFX_ByteString& face, int weight, int picth_family);
- void GetJapanesePreference(CFX_ByteString& face, int weight, int picth_family);
- CFX_ByteString FindFont(const CFX_ByteString& name);
- HDC m_hDC;
- CFX_FontMapper* m_pMapper;
- CFX_ByteString m_LastFamily;
- CFX_ByteString m_KaiTi, m_FangSong;
-};
-CWin32FontInfo::CWin32FontInfo()
-{
- m_hDC = CreateCompatibleDC(NULL);
-}
-CWin32FontInfo::~CWin32FontInfo()
-{
- m_pMapper = NULL;
-}
-void CWin32FontInfo::Release()
-{
- DeleteDC(m_hDC);
- delete this;
-}
-#define TT_MAKE_TAG(x1, x2, x3, x4) (((FX_DWORD)x1<<24)|((FX_DWORD)x2<<16)|((FX_DWORD)x3<<8)|(FX_DWORD)x4)
-FX_BOOL CWin32FontInfo::IsOpenTypeFromDiv(const LOGFONTA *plf)
-{
- HFONT hFont = CreateFontIndirectA(plf);
- FX_BOOL ret = FALSE;
- FX_DWORD font_size = GetFontData(hFont, 0, NULL, 0);
- if (font_size != GDI_ERROR && font_size >= sizeof(FX_DWORD)) {
- FX_DWORD lVersion = 0;
- GetFontData(hFont, 0, (FX_BYTE*)(&lVersion), sizeof(FX_DWORD));
- lVersion = (((FX_DWORD)(FX_BYTE)(lVersion)) << 24) | ((FX_DWORD)((FX_BYTE)(lVersion >> 8))) << 16 |
- ((FX_DWORD)((FX_BYTE)(lVersion >> 16))) << 8 | ((FX_BYTE)(lVersion >> 24));
- if (lVersion == TT_MAKE_TAG('O', 'T', 'T', 'O') ||
- lVersion == 0x00010000 ||
- lVersion == TT_MAKE_TAG('t', 't', 'c', 'f') ||
- lVersion == TT_MAKE_TAG('t', 'r', 'u', 'e') ||
- lVersion == 0x00020000) {
- ret = TRUE;
- }
- }
- DeleteFont(hFont);
- return ret;
-}
-FX_BOOL CWin32FontInfo::IsSupportFontFormDiv(const LOGFONTA* plf)
-{
- HFONT hFont = CreateFontIndirectA(plf);
- FX_BOOL ret = FALSE;
- FX_DWORD font_size = GetFontData(hFont, 0, NULL, 0);
- if (font_size != GDI_ERROR && font_size >= sizeof(FX_DWORD)) {
- FX_DWORD lVersion = 0;
- GetFontData(hFont, 0, (FX_BYTE*)(&lVersion), sizeof(FX_DWORD));
- lVersion = (((FX_DWORD)(FX_BYTE)(lVersion)) << 24) | ((FX_DWORD)((FX_BYTE)(lVersion >> 8))) << 16 |
- ((FX_DWORD)((FX_BYTE)(lVersion >> 16))) << 8 | ((FX_BYTE)(lVersion >> 24));
- if (lVersion == TT_MAKE_TAG('O', 'T', 'T', 'O') ||
- lVersion == 0x00010000 ||
- lVersion == TT_MAKE_TAG('t', 't', 'c', 'f') ||
- lVersion == TT_MAKE_TAG('t', 'r', 'u', 'e') ||
- lVersion == 0x00020000) {
- ret = TRUE;
- } else if ((lVersion & 0xFFFF0000) == TT_MAKE_TAG(0x80, 0x01, 0x00, 0x00) ||
- (lVersion & 0xFFFF0000) == TT_MAKE_TAG('%', '!', 0, 0)) {
- ret = TRUE;
- }
- }
- DeleteFont(hFont);
- return ret;
-}
-void CWin32FontInfo::AddInstalledFont(const LOGFONTA *plf, FX_DWORD FontType)
-{
- CFX_ByteString name(plf->lfFaceName, -1);
- if (name[0] == '@') {
- return;
- }
- if (name == m_LastFamily) {
- m_pMapper->AddInstalledFont(name, plf->lfCharSet);
- return;
- }
- if (!(FontType & TRUETYPE_FONTTYPE) && !(FontType & DEVICE_FONTTYPE)) {
- return;
- }
- if (!(FontType & TRUETYPE_FONTTYPE)) {
- if (!IsSupportFontFormDiv(plf)) {
- return;
- }
- }
- m_pMapper->AddInstalledFont(name, plf->lfCharSet);
- m_LastFamily = name;
-}
-static int CALLBACK FontEnumProc(
- const LOGFONTA *plf,
- const TEXTMETRICA *lpntme,
- FX_DWORD FontType,
- LPARAM lParam
-)
-{
- CWin32FontInfo* pFontInfo = (CWin32FontInfo*)lParam;
- if (pFontInfo->m_pMapper->GetFontEnumerator()) {
- pFontInfo->m_pMapper->GetFontEnumerator()->HitFont();
- }
- pFontInfo->AddInstalledFont(plf, FontType);
- return 1;
-}
-FX_BOOL CWin32FontInfo::EnumFontList(CFX_FontMapper* pMapper)
-{
- m_pMapper = pMapper;
- LOGFONTA lf;
- FXSYS_memset32(&lf, 0, sizeof(LOGFONTA));
- lf.lfCharSet = DEFAULT_CHARSET;
- lf.lfFaceName[0] = 0;
- lf.lfPitchAndFamily = 0;
- EnumFontFamiliesExA(m_hDC, &lf, (FONTENUMPROCA)FontEnumProc, (FX_UINTPTR)this, 0);
- if (pMapper->GetFontEnumerator()) {
- pMapper->GetFontEnumerator()->Finish();
- }
- return TRUE;
-}
-static const struct {
- FX_LPCSTR m_pFaceName;
- FX_LPCSTR m_pVariantName;
-}
-VariantNames[] = {
- {"DFKai-SB", "\x19\x6A\x77\x69\xD4\x9A"},
-};
-static const struct {
- FX_LPCSTR m_pName;
- FX_LPCSTR m_pWinName;
- FX_BOOL m_bBold;
- FX_BOOL m_bItalic;
-}
-Base14Substs[] = {
- {"Courier", "Courier New", FALSE, FALSE},
- {"Courier-Bold", "Courier New", TRUE, FALSE},
- {"Courier-BoldOblique", "Courier New", TRUE, TRUE},
- {"Courier-Oblique", "Courier New", FALSE, TRUE},
- {"Helvetica", "Arial", FALSE, FALSE},
- {"Helvetica-Bold", "Arial", TRUE, FALSE},
- {"Helvetica-BoldOblique", "Arial", TRUE, TRUE},
- {"Helvetica-Oblique", "Arial", FALSE, TRUE},
- {"Times-Roman", "Times New Roman", FALSE, FALSE},
- {"Times-Bold", "Times New Roman", TRUE, FALSE},
- {"Times-BoldItalic", "Times New Roman", TRUE, TRUE},
- {"Times-Italic", "Times New Roman", FALSE, TRUE},
-};
-CFX_ByteString CWin32FontInfo::FindFont(const CFX_ByteString& name)
-{
- if (m_pMapper == NULL) {
- return name;
- }
- int nFonts = m_pMapper->m_InstalledTTFonts.GetSize();
- for (int i = 0; i < nFonts; i ++) {
- CFX_ByteString thisname = m_pMapper->m_InstalledTTFonts[i];
- if (thisname[0] == ' ') {
- if (thisname.Mid(1, name.GetLength()) == name) {
- return m_pMapper->m_InstalledTTFonts[i + 1];
- }
- } else if (thisname.Left(name.GetLength()) == name) {
- return m_pMapper->m_InstalledTTFonts[i];
- }
- }
- return CFX_ByteString();
-}
-struct _FontNameMap {
- FX_LPCSTR m_pSubFontName;
- FX_LPCSTR m_pSrcFontName;
-};
-const _FontNameMap g_JpFontNameMap[] = {
- {"MS Mincho", "Heiseimin-W3"},
- {"MS Gothic", "Jun101-Light"},
-};
-const _FontNameMap g_GbFontNameMap[1];
-extern "C" {
- static int compareString(const void* key, const void* element)
- {
- return FXSYS_stricmp((FX_LPCSTR)key, ((_FontNameMap*)element)->m_pSrcFontName);
- }
-}
-FX_BOOL _GetSubFontName(CFX_ByteString& name, int lang)
-{
- int size = sizeof g_JpFontNameMap;
- void* pFontnameMap = (void*)g_JpFontNameMap;
- if (lang == 1) {
- size = sizeof g_GbFontNameMap;
- pFontnameMap = (void*)g_GbFontNameMap;
- } else if (lang == 2) {
- size = 0;
- }
- _FontNameMap* found = (_FontNameMap*)FXSYS_bsearch((FX_LPCSTR)name, pFontnameMap,
- size / sizeof (_FontNameMap), sizeof (_FontNameMap), compareString);
- if (found == NULL) {
- return FALSE;
- }
- name = found->m_pSubFontName;
- return TRUE;
-}
-void CWin32FontInfo::GetGBPreference(CFX_ByteString& face, int weight, int picth_family)
-{
- if (face.Find("KaiTi") >= 0 || face.Find("\xbf\xac") >= 0) {
- if (m_KaiTi.IsEmpty()) {
- m_KaiTi = FindFont("KaiTi");
- if (m_KaiTi.IsEmpty()) {
- m_KaiTi = "SimSun";
- }
- }
- face = m_KaiTi;
- } else if (face.Find("FangSong") >= 0 || face.Find("\xb7\xc2\xcb\xce") >= 0) {
- if (m_FangSong.IsEmpty()) {
- m_FangSong = FindFont("FangSong");
- if (m_FangSong.IsEmpty()) {
- m_FangSong = "SimSun";
- }
- }
- face = m_FangSong;
- } else if (face.Find("SimSun") >= 0 || face.Find("\xcb\xce") >= 0) {
- face = "SimSun";
- } else if (face.Find("SimHei") >= 0 || face.Find("\xba\xda") >= 0) {
- face = "SimHei";
- } else if (!(picth_family & FF_ROMAN) && weight > 550) {
- face = "SimHei";
- } else {
- face = "SimSun";
- }
-}
-void CWin32FontInfo::GetJapanesePreference(CFX_ByteString& face, int weight, int picth_family)
-{
- if (face.Find("Gothic") >= 0 || face.Find("\x83\x53\x83\x56\x83\x62\x83\x4e") >= 0) {
- if (face.Find("PGothic") >= 0 || face.Find("\x82\x6f\x83\x53\x83\x56\x83\x62\x83\x4e") >= 0) {
- face = "MS PGothic";
- } else if (face.Find("UI Gothic") >= 0) {
- face = "MS UI Gothic";
- } else {
- if (face.Find("HGSGothicM") >= 0 || face.Find("HGMaruGothicMPRO") >= 0) {
- face = "MS PGothic";
- } else {
- face = "MS Gothic";
- }
- }
- return;
- } else if (face.Find("Mincho") >= 0 || face.Find("\x96\xbe\x92\xa9") >= 0) {
- if (face.Find("PMincho") >= 0 || face.Find("\x82\x6f\x96\xbe\x92\xa9") >= 0) {
- face = "MS PMincho";
- } else {
- face = "MS Mincho";
- }
- return;
- }
- if (_GetSubFontName(face, 0)) {
- return;
- }
- if (!(picth_family & FF_ROMAN) && weight > 400) {
- face = "MS PGothic";
- } else {
- face = "MS PMincho";
- }
-}
-void* CWin32FontInfo::MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, FX_LPCSTR cstr_face, FX_BOOL& bExact)
-{
- CFX_ByteString face = cstr_face;
- int iBaseFont;
- for (iBaseFont = 0; iBaseFont < 12; iBaseFont ++)
- if (face == CFX_ByteStringC(Base14Substs[iBaseFont].m_pName)) {
- face = Base14Substs[iBaseFont].m_pWinName;
- weight = Base14Substs[iBaseFont].m_bBold ? FW_BOLD : FW_NORMAL;
- bItalic = Base14Substs[iBaseFont].m_bItalic;
- bExact = TRUE;
- break;
- }
- if (charset == ANSI_CHARSET || charset == SYMBOL_CHARSET) {
- charset = DEFAULT_CHARSET;
- }
- int subst_pitch_family = pitch_family;
- switch (charset) {
- case SHIFTJIS_CHARSET:
- subst_pitch_family = FF_ROMAN;
- break;
- case CHINESEBIG5_CHARSET:
- case HANGUL_CHARSET:
- case GB2312_CHARSET:
- subst_pitch_family = 0;
- break;
- }
- HFONT hFont = ::CreateFontA(-10, 0, 0, 0, weight, bItalic, 0, 0, charset, OUT_TT_ONLY_PRECIS,
- 0, 0, subst_pitch_family, face);
- char facebuf[100];
- HFONT hOldFont = (HFONT)::SelectObject(m_hDC, hFont);
- int ret = ::GetTextFaceA(m_hDC, 100, facebuf);
- ::SelectObject(m_hDC, hOldFont);
- if (face.EqualNoCase(facebuf)) {
- return hFont;
- }
- int iCount = sizeof(VariantNames) / sizeof(VariantNames[0]);
- for (int i = 0; i < iCount; ++i) {
- if (face == VariantNames[i].m_pFaceName) {
- CFX_WideString wsFace = CFX_WideString::FromLocal(facebuf);
- CFX_WideString wsName = CFX_WideString::FromUTF16LE((const unsigned short*)VariantNames[i].m_pVariantName);
- if (wsFace == wsName) {
- return hFont;
- }
- }
- }
- ::DeleteObject(hFont);
- if (charset == DEFAULT_CHARSET) {
- return NULL;
- }
- switch (charset) {
- case SHIFTJIS_CHARSET:
- GetJapanesePreference(face, weight, pitch_family);
- break;
- case GB2312_CHARSET:
- GetGBPreference(face, weight, pitch_family);
- break;
- case HANGUL_CHARSET:
- face = "Gulim";
- break;
- case CHINESEBIG5_CHARSET:
- if (face.Find("MSung") >= 0) {
- face = "MingLiU";
- } else {
- face = "PMingLiU";
- }
- break;
- }
- hFont = ::CreateFontA(-10, 0, 0, 0, weight, bItalic, 0, 0, charset, OUT_TT_ONLY_PRECIS,
- 0, 0, subst_pitch_family, face);
- return hFont;
-}
-void CWin32FontInfo::DeleteFont(void* hFont)
-{
- ::DeleteObject(hFont);
-}
-FX_DWORD CWin32FontInfo::GetFontData(void* hFont, FX_DWORD table, FX_LPBYTE buffer, FX_DWORD size)
-{
- HFONT hOldFont = (HFONT)::SelectObject(m_hDC, (HFONT)hFont);
- table = FXDWORD_FROM_MSBFIRST(table);
- size = ::GetFontData(m_hDC, table, 0, buffer, size);
- ::SelectObject(m_hDC, hOldFont);
- if (size == GDI_ERROR) {
- return 0;
- }
- return size;
-}
-FX_BOOL CWin32FontInfo::GetFaceName(void* hFont, CFX_ByteString& name)
-{
- char facebuf[100];
- HFONT hOldFont = (HFONT)::SelectObject(m_hDC, (HFONT)hFont);
- int ret = ::GetTextFaceA(m_hDC, 100, facebuf);
- ::SelectObject(m_hDC, hOldFont);
- if (ret == 0) {
- return FALSE;
- }
- name = facebuf;
- return TRUE;
-}
-FX_BOOL CWin32FontInfo::GetFontCharset(void* hFont, int& charset)
-{
- TEXTMETRIC tm;
- HFONT hOldFont = (HFONT)::SelectObject(m_hDC, (HFONT)hFont);
- ::GetTextMetrics(m_hDC, &tm);
- ::SelectObject(m_hDC, hOldFont);
- charset = tm.tmCharSet;
- return TRUE;
-}
-#ifndef _FPDFAPI_MINI_
-IFX_SystemFontInfo* IFX_SystemFontInfo::CreateDefault()
-{
- return FX_NEW CWin32FontInfo;
-}
-#endif
-void CFX_GEModule::InitPlatform()
-{
- CWin32Platform* pPlatformData = FX_NEW CWin32Platform;
- if (!pPlatformData) {
- return;
- }
- OSVERSIONINFO ver;
- ver.dwOSVersionInfoSize = sizeof(ver);
- GetVersionEx(&ver);
- pPlatformData->m_bHalfTone = ver.dwMajorVersion >= 5;
- pPlatformData->m_GdiplusExt.Load();
- m_pPlatformData = pPlatformData;
- m_pFontMgr->SetSystemFontInfo(IFX_SystemFontInfo::CreateDefault());
-}
-void CFX_GEModule::DestroyPlatform()
-{
- if (m_pPlatformData) {
- delete (CWin32Platform*)m_pPlatformData;
- }
- m_pPlatformData = NULL;
-}
-CGdiDeviceDriver::CGdiDeviceDriver(HDC hDC, int device_class)
-{
- m_hDC = hDC;
- m_DeviceClass = device_class;
- CWin32Platform* pPlatform = (CWin32Platform*)CFX_GEModule::Get()->GetPlatformData();
- SetStretchBltMode(hDC, pPlatform->m_bHalfTone ? HALFTONE : COLORONCOLOR);
- if (GetObjectType(m_hDC) == OBJ_MEMDC) {
- HBITMAP hBitmap = CreateBitmap(1, 1, 1, 1, NULL);
- hBitmap = (HBITMAP)SelectObject(m_hDC, hBitmap);
- BITMAP bitmap;
- GetObject(hBitmap, sizeof bitmap, &bitmap);
- m_nBitsPerPixel = bitmap.bmBitsPixel;
- m_Width = bitmap.bmWidth;
- m_Height = abs(bitmap.bmHeight);
- hBitmap = (HBITMAP)SelectObject(m_hDC, hBitmap);
- DeleteObject(hBitmap);
- } else {
- m_nBitsPerPixel = ::GetDeviceCaps(m_hDC, BITSPIXEL);
- m_Width = ::GetDeviceCaps(m_hDC, HORZRES);
- m_Height = ::GetDeviceCaps(m_hDC, VERTRES);
- }
- if (m_DeviceClass != FXDC_DISPLAY) {
- m_RenderCaps = FXRC_BIT_MASK;
- } else {
- m_RenderCaps = FXRC_GET_BITS | FXRC_BIT_MASK;
- }
-}
-int CGdiDeviceDriver::GetDeviceCaps(int caps_id)
-{
- switch (caps_id) {
- case FXDC_DEVICE_CLASS:
- return m_DeviceClass;
- case FXDC_PIXEL_WIDTH:
- return m_Width;
- case FXDC_PIXEL_HEIGHT:
- return m_Height;
- case FXDC_BITS_PIXEL:
- return m_nBitsPerPixel;
- case FXDC_RENDER_CAPS:
- return m_RenderCaps;
- }
- return 0;
-}
-FX_LPVOID CGdiDeviceDriver::GetClipRgn()
-{
- HRGN hClipRgn = CreateRectRgn(0, 0, 1, 1);
- if (::GetClipRgn(m_hDC, hClipRgn) == 0) {
- DeleteObject(hClipRgn);
- hClipRgn = NULL;
- }
- return (FX_LPVOID)hClipRgn;
-}
-FX_BOOL CGdiDeviceDriver::GDI_SetDIBits(const CFX_DIBitmap* pBitmap1, const FX_RECT* pSrcRect, int left, int top, void* pIccTransform)
-{
- if (m_DeviceClass == FXDC_PRINTER) {
- CFX_DIBitmap* pBitmap = pBitmap1->FlipImage(FALSE, TRUE);
- if (pBitmap == NULL) {
- return FALSE;
- }
- if ((pBitmap->IsCmykImage() || pIccTransform) &&
- !pBitmap->ConvertFormat(FXDIB_Rgb, pIccTransform)) {
- return FALSE;
- }
- int width = pSrcRect->Width(), height = pSrcRect->Height();
- int pitch = pBitmap->GetPitch();
- LPBYTE pBuffer = pBitmap->GetBuffer();
- CFX_ByteString info = CFX_WindowsDIB::GetBitmapInfo(pBitmap);
- ((BITMAPINFOHEADER*)(FX_LPCSTR)info)->biHeight *= -1;
- FX_RECT dst_rect(0, 0, width, height);
- dst_rect.Intersect(0, 0, pBitmap->GetWidth(), pBitmap->GetHeight());
- int dst_width = dst_rect.Width();
- int dst_height = dst_rect.Height();
- ::StretchDIBits(m_hDC, left, top, dst_width, dst_height,
- 0, 0, dst_width, dst_height, pBuffer, (BITMAPINFO*)(FX_LPCSTR)info, DIB_RGB_COLORS, SRCCOPY);
- delete pBitmap;
- } else {
- CFX_DIBitmap* pBitmap = (CFX_DIBitmap*)pBitmap1;
- if ((pBitmap->IsCmykImage() || pIccTransform) &&
- (pBitmap = pBitmap->CloneConvert(FXDIB_Rgb, NULL, pIccTransform)) == NULL) {
- return FALSE;
- }
- int width = pSrcRect->Width(), height = pSrcRect->Height();
- int pitch = pBitmap->GetPitch();
- LPBYTE pBuffer = pBitmap->GetBuffer();
- CFX_ByteString info = CFX_WindowsDIB::GetBitmapInfo(pBitmap);
- ::SetDIBitsToDevice(m_hDC, left, top, width, height, pSrcRect->left, pBitmap->GetHeight() - pSrcRect->bottom,
- 0, pBitmap->GetHeight(), pBuffer, (BITMAPINFO*)(FX_LPCSTR)info, DIB_RGB_COLORS);
- if (pBitmap != pBitmap1) {
- delete pBitmap;
- }
- }
- return TRUE;
-}
-FX_BOOL CGdiDeviceDriver::GDI_StretchDIBits(const CFX_DIBitmap* pBitmap1, int dest_left, int dest_top,
- int dest_width, int dest_height, FX_DWORD flags, void* pIccTransform)
-{
- CFX_DIBitmap* pBitmap = (CFX_DIBitmap*)pBitmap1;
- if (pBitmap == NULL) {
- return FALSE;
- }
- if ((pBitmap->IsCmykImage() || pIccTransform) &&
- !pBitmap->ConvertFormat(FXDIB_Rgb, pIccTransform)) {
- return FALSE;
- }
- CFX_ByteString info = CFX_WindowsDIB::GetBitmapInfo(pBitmap);
- if (abs(dest_width) * abs(dest_height) < pBitmap1->GetWidth() * pBitmap1->GetHeight() * 4 ||
- (flags & FXDIB_INTERPOL) || (flags & FXDIB_BICUBIC_INTERPOL)) {
- SetStretchBltMode(m_hDC, HALFTONE);
- } else {
- SetStretchBltMode(m_hDC, COLORONCOLOR);
- }
- CFX_DIBitmap* pToStrechBitmap = pBitmap;
- bool del = false;
- if (m_DeviceClass == FXDC_PRINTER && (pBitmap->GetWidth() * pBitmap->GetHeight() > abs(dest_width) * abs(dest_height))) {
- pToStrechBitmap = pBitmap->StretchTo(dest_width, dest_height);
- del = true;
- }
- CFX_ByteString toStrechBitmapInfo = CFX_WindowsDIB::GetBitmapInfo(pToStrechBitmap);
- ::StretchDIBits(m_hDC, dest_left, dest_top, dest_width, dest_height,
- 0, 0, pToStrechBitmap->GetWidth(), pToStrechBitmap->GetHeight(), pToStrechBitmap->GetBuffer(),
- (BITMAPINFO*)(FX_LPCSTR)toStrechBitmapInfo, DIB_RGB_COLORS, SRCCOPY);
- if (del) {
- delete pToStrechBitmap;
- }
- return TRUE;
-}
-FX_BOOL CGdiDeviceDriver::GDI_StretchBitMask(const CFX_DIBitmap* pBitmap1, int dest_left, int dest_top,
- int dest_width, int dest_height, FX_DWORD bitmap_color, FX_DWORD flags,
- int alpha_flag, void* pIccTransform)
-{
- CFX_DIBitmap* pBitmap = (CFX_DIBitmap*)pBitmap1;
- if (pBitmap == NULL) {
- return FALSE;
- }
- _Color2Argb(bitmap_color, bitmap_color, alpha_flag | (1 << 24), pIccTransform);
- int width = pBitmap->GetWidth(), height = pBitmap->GetHeight();
- struct {
- BITMAPINFOHEADER bmiHeader;
- FX_DWORD bmiColors[2];
- } bmi;
- FXSYS_memset32(&bmi.bmiHeader, 0, sizeof (BITMAPINFOHEADER));
- bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
- bmi.bmiHeader.biBitCount = 1;
- bmi.bmiHeader.biCompression = BI_RGB;
- bmi.bmiHeader.biHeight = -height;
- bmi.bmiHeader.biPlanes = 1;
- bmi.bmiHeader.biWidth = width;
- if (m_nBitsPerPixel != 1) {
- SetStretchBltMode(m_hDC, HALFTONE);
- }
- bmi.bmiColors[0] = 0xffffff;
- bmi.bmiColors[1] = 0;
- ::StretchDIBits(m_hDC, dest_left, dest_top, dest_width, dest_height,
- 0, 0, width, height, pBitmap->GetBuffer(), (BITMAPINFO*)&bmi, DIB_RGB_COLORS, SRCAND);
- return TRUE;
-}
-BOOL CGdiDeviceDriver::GetClipBox(FX_RECT* pRect)
-{
- return ::GetClipBox(m_hDC, (RECT*)pRect);
-}
-FX_BOOL CGdiDeviceDriver::SetClipRgn(FX_LPVOID hRgn)
-{
- ::SelectClipRgn(m_hDC, (HRGN)hRgn);
- return TRUE;
-}
-static HPEN _CreatePen(const CFX_GraphStateData* pGraphState, const CFX_AffineMatrix* pMatrix, FX_DWORD argb)
-{
- FX_FLOAT width;
- FX_FLOAT scale = 1.f;
- if (pMatrix)
- scale = FXSYS_fabs(pMatrix->a) > FXSYS_fabs(pMatrix->b) ?
- FXSYS_fabs(pMatrix->a) : FXSYS_fabs(pMatrix->b);
- if (pGraphState) {
- width = scale * pGraphState->m_LineWidth;
- } else {
- width = 1.0f;
- }
- FX_DWORD PenStyle = PS_GEOMETRIC;
- if (width < 1) {
- width = 1;
- }
- if(pGraphState->m_DashCount) {
- PenStyle |= PS_USERSTYLE;
- } else {
- PenStyle |= PS_SOLID;
- }
- switch(pGraphState->m_LineCap) {
- case 0:
- PenStyle |= PS_ENDCAP_FLAT;
- break;
- case 1:
- PenStyle |= PS_ENDCAP_ROUND;
- break;
- case 2:
- PenStyle |= PS_ENDCAP_SQUARE;
- break;
- }
- switch(pGraphState->m_LineJoin) {
- case 0:
- PenStyle |= PS_JOIN_MITER;
- break;
- case 1:
- PenStyle |= PS_JOIN_ROUND;
- break;
- case 2:
- PenStyle |= PS_JOIN_BEVEL;
- break;
- }
- int a;
- FX_COLORREF rgb;
- ArgbDecode(argb, a, rgb);
- LOGBRUSH lb;
- lb.lbColor = rgb;
- lb.lbStyle = BS_SOLID;
- lb.lbHatch = 0;
- FX_DWORD* pDash = NULL;
- if (pGraphState->m_DashCount) {
- pDash = FX_Alloc(FX_DWORD, pGraphState->m_DashCount);
- if (!pDash) {
- return NULL;
- }
- for (int i = 0; i < pGraphState->m_DashCount; i ++) {
- pDash[i] = FXSYS_round(pMatrix ? pMatrix->TransformDistance(pGraphState->m_DashArray[i]) : pGraphState->m_DashArray[i]);
- if (pDash[i] < 1) {
- pDash[i] = 1;
- }
- }
- }
- HPEN hPen = ExtCreatePen(PenStyle, (DWORD)FXSYS_ceil(width), &lb, pGraphState->m_DashCount, (const DWORD*)pDash);
- if (pDash) {
- FX_Free(pDash);
- }
- return hPen;
-}
-static HBRUSH _CreateBrush(FX_DWORD argb)
-{
- int a;
- FX_COLORREF rgb;
- ArgbDecode(argb, a, rgb);
- return CreateSolidBrush(rgb);
-}
-static void _SetPathToDC(HDC hDC, const CFX_PathData* pPathData, const CFX_AffineMatrix* pMatrix)
-{
- BeginPath(hDC);
- int nPoints = pPathData->GetPointCount();
- FX_PATHPOINT* pPoints = pPathData->GetPoints();
- for(int i = 0; i < nPoints; i++) {
- FX_FLOAT posx = pPoints[i].m_PointX, posy = pPoints[i].m_PointY;
- if (pMatrix) {
- pMatrix->Transform(posx, posy);
- }
- int screen_x = FXSYS_round(posx), screen_y = FXSYS_round(posy);
- int point_type = pPoints[i].m_Flag & FXPT_TYPE;
- if(point_type == PT_MOVETO) {
- MoveToEx(hDC, screen_x, screen_y, NULL);
- } else if(point_type == PT_LINETO) {
- if (pPoints[i].m_PointY == pPoints[i - 1].m_PointY && pPoints[i].m_PointX == pPoints[i - 1].m_PointX) {
- screen_x ++;
- }
- LineTo(hDC, screen_x, screen_y);
- } else if(point_type == PT_BEZIERTO) {
- POINT lppt[3];
- lppt[0].x = screen_x;
- lppt[0].y = screen_y;
- posx = pPoints[i + 1].m_PointX;
- posy = pPoints[i + 1].m_PointY;
- if (pMatrix) {
- pMatrix->Transform(posx, posy);
- }
- lppt[1].x = FXSYS_round(posx);
- lppt[1].y = FXSYS_round(posy);
- posx = pPoints[i + 2].m_PointX;
- posy = pPoints[i + 2].m_PointY;
- if (pMatrix) {
- pMatrix->Transform(posx, posy);
- }
- lppt[2].x = FXSYS_round(posx);
- lppt[2].y = FXSYS_round(posy);
- PolyBezierTo(hDC, lppt, 3);
- i += 2;
- }
- if (pPoints[i].m_Flag & PT_CLOSEFIGURE) {
- CloseFigure(hDC);
- }
- }
- EndPath(hDC);
-}
-void CGdiDeviceDriver::DrawLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2)
-{
- int flag1 = (x1 < 0) | ((x1 > m_Width) << 1) | ((y1 < 0) << 2) | ((y1 > m_Height) << 3);
- int flag2 = (x2 < 0) | ((x2 > m_Width) << 1) | ((y2 < 0) << 2) | ((y2 > m_Height) << 3);
- if (flag1 & flag2) {
- return;
- }
- if (flag1 || flag2) {
- agg::rect_base<FX_FLOAT> rect(0.0f, 0.0f, (FX_FLOAT)(m_Width), (FX_FLOAT)(m_Height));
- FX_FLOAT x[2], y[2];
- int np = agg::clip_liang_barsky<FX_FLOAT>(x1, y1, x2, y2, rect, x, y);
- if (np == 0) {
- return;
- }
- if (np == 1) {
- x2 = x[0];
- y2 = y[0];
- } else {
- x1 = x[0];
- y1 = y[0];
- x2 = x[np - 1];
- y2 = y[np - 1];
- }
- }
- MoveToEx(m_hDC, FXSYS_round(x1), FXSYS_round(y1), NULL);
- LineTo(m_hDC, FXSYS_round(x2), FXSYS_round(y2));
-}
-static FX_BOOL _MatrixNoScaled(const CFX_AffineMatrix* pMatrix)
-{
- return pMatrix->GetA() == 1.0f && pMatrix->GetB() == 0 && pMatrix->GetC() == 0 && pMatrix->GetD() == 1.0f;
-}
-FX_BOOL CGdiDeviceDriver::DrawPath(const CFX_PathData* pPathData,
- const CFX_AffineMatrix* pMatrix,
- const CFX_GraphStateData* pGraphState,
- FX_DWORD fill_color,
- FX_DWORD stroke_color,
- int fill_mode,
- int alpha_flag,
- void* pIccTransform,
- int blend_type
- )
-{
- if (blend_type != FXDIB_BLEND_NORMAL) {
- return FALSE;
- }
- _Color2Argb(fill_color, fill_color, alpha_flag | (1 << 24), pIccTransform);
- _Color2Argb(stroke_color, stroke_color, alpha_flag, pIccTransform);
- CWin32Platform* pPlatform = (CWin32Platform*)CFX_GEModule::Get()->GetPlatformData();
- if ((pGraphState == NULL || stroke_color == 0) && !pPlatform->m_GdiplusExt.IsAvailable()) {
- CFX_FloatRect bbox_f = pPathData->GetBoundingBox();
- if (pMatrix) {
- bbox_f.Transform(pMatrix);
- }
- FX_RECT bbox = bbox_f.GetInnerRect();
- if (bbox.Width() <= 0) {
- return DrawCosmeticLine((FX_FLOAT)(bbox.left), (FX_FLOAT)(bbox.top), (FX_FLOAT)(bbox.left), (FX_FLOAT)(bbox.bottom + 1), fill_color,
- alpha_flag, pIccTransform, FXDIB_BLEND_NORMAL);
- } else if (bbox.Height() <= 0) {
- return DrawCosmeticLine((FX_FLOAT)(bbox.left), (FX_FLOAT)(bbox.top), (FX_FLOAT)(bbox.right + 1), (FX_FLOAT)(bbox.top), fill_color,
- alpha_flag, pIccTransform, FXDIB_BLEND_NORMAL);
- }
- }
- int fill_alpha = FXARGB_A(fill_color);
- int stroke_alpha = FXARGB_A(stroke_color);
- FX_BOOL bDrawAlpha = (fill_alpha > 0 && fill_alpha < 255) || (stroke_alpha > 0 && stroke_alpha < 255 && pGraphState);
- if (!pPlatform->m_GdiplusExt.IsAvailable() && bDrawAlpha) {
- return FALSE;
- }
- if (pPlatform->m_GdiplusExt.IsAvailable()) {
- if (bDrawAlpha || ((m_DeviceClass != FXDC_PRINTER && !(fill_mode & FXFILL_FULLCOVER)) || pGraphState && pGraphState->m_DashCount)) {
- if ( !((NULL == pMatrix || _MatrixNoScaled(pMatrix)) &&
- pGraphState && pGraphState->m_LineWidth == 1.f &&
- (pPathData->GetPointCount() == 5 || pPathData->GetPointCount() == 4) &&
- pPathData->IsRect()) ) {
- if (pPlatform->m_GdiplusExt.DrawPath(m_hDC, pPathData, pMatrix, pGraphState, fill_color, stroke_color, fill_mode)) {
- return TRUE;
- }
- }
- }
- }
- int old_fill_mode = fill_mode;
- fill_mode &= 3;
- HPEN hPen = NULL;
- HBRUSH hBrush = NULL;
- if (pGraphState && stroke_alpha) {
- SetMiterLimit(m_hDC, pGraphState->m_MiterLimit, NULL);
- hPen = _CreatePen(pGraphState, pMatrix, stroke_color);
- hPen = (HPEN)SelectObject(m_hDC, hPen);
- }
- if (fill_mode && fill_alpha) {
- SetPolyFillMode(m_hDC, fill_mode);
- hBrush = _CreateBrush(fill_color);
- hBrush = (HBRUSH)SelectObject(m_hDC, hBrush);
- }
- if (pPathData->GetPointCount() == 2 && pGraphState && pGraphState->m_DashCount) {
- FX_FLOAT x1 = pPathData->GetPointX(0), y1 = pPathData->GetPointY(0);
- if (pMatrix) {
- pMatrix->Transform(x1, y1);
- }
- FX_FLOAT x2 = pPathData->GetPointX(1), y2 = pPathData->GetPointY(1);
- if (pMatrix) {
- pMatrix->Transform(x2, y2);
- }
- DrawLine(x1, y1, x2, y2);
- } else {
- _SetPathToDC(m_hDC, pPathData, pMatrix);
- if (pGraphState && stroke_alpha) {
- if (fill_mode && fill_alpha) {
- if (old_fill_mode & FX_FILL_TEXT_MODE) {
- StrokeAndFillPath(m_hDC);
- } else {
- FillPath(m_hDC);
- _SetPathToDC(m_hDC, pPathData, pMatrix);
- StrokePath(m_hDC);
- }
- } else {
- StrokePath(m_hDC);
- }
- } else if (fill_mode && fill_alpha) {
- FillPath(m_hDC);
- }
- }
- if (hPen) {
- hPen = (HPEN)SelectObject(m_hDC, hPen);
- DeleteObject(hPen);
- }
- if (hBrush) {
- hBrush = (HBRUSH)SelectObject(m_hDC, hBrush);
- DeleteObject(hBrush);
- }
- return TRUE;
-}
-FX_BOOL CGdiDeviceDriver::FillRect(const FX_RECT* pRect, FX_DWORD fill_color, int alpha_flag, void* pIccTransform, int blend_type)
-{
- if (blend_type != FXDIB_BLEND_NORMAL) {
- return FALSE;
- }
- _Color2Argb(fill_color, fill_color, alpha_flag | (1 << 24), pIccTransform);
- int alpha;
- FX_COLORREF rgb;
- ArgbDecode(fill_color, alpha, rgb);
- if (alpha == 0) {
- return TRUE;
- }
- if (alpha < 255) {
- return FALSE;
- }
- HBRUSH hBrush = CreateSolidBrush(rgb);
- ::FillRect(m_hDC, (RECT*)pRect, hBrush);
- DeleteObject(hBrush);
- return TRUE;
-}
-FX_BOOL CGdiDeviceDriver::SetClip_PathFill(const CFX_PathData* pPathData,
- const CFX_AffineMatrix* pMatrix,
- int fill_mode
- )
-{
- if (pPathData->GetPointCount() == 5) {
- CFX_FloatRect rectf;
- if (pPathData->IsRect(pMatrix, &rectf)) {
- FX_RECT rect = rectf.GetOutterRect();
- IntersectClipRect(m_hDC, rect.left, rect.top, rect.right, rect.bottom);
- return TRUE;
- }
- }
- _SetPathToDC(m_hDC, pPathData, pMatrix);
- SetPolyFillMode(m_hDC, fill_mode & 3);
- SelectClipPath(m_hDC, RGN_AND);
- return TRUE;
-}
-FX_BOOL CGdiDeviceDriver::SetClip_PathStroke(const CFX_PathData* pPathData,
- const CFX_AffineMatrix* pMatrix,
- const CFX_GraphStateData* pGraphState
- )
-{
- HPEN hPen = _CreatePen(pGraphState, pMatrix, 0xff000000);
- hPen = (HPEN)SelectObject(m_hDC, hPen);
- _SetPathToDC(m_hDC, pPathData, pMatrix);
- WidenPath(m_hDC);
- SetPolyFillMode(m_hDC, WINDING);
- FX_BOOL ret = SelectClipPath(m_hDC, RGN_AND);
- hPen = (HPEN)SelectObject(m_hDC, hPen);
- DeleteObject(hPen);
- return ret;
-}
-FX_BOOL CGdiDeviceDriver::DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, FX_DWORD color,
- int alpha_flag, void* pIccTransform, int blend_type)
-{
- if (blend_type != FXDIB_BLEND_NORMAL) {
- return FALSE;
- }
- _Color2Argb(color, color, alpha_flag | (1 << 24), pIccTransform);
- int a;
- FX_COLORREF rgb;
- ArgbDecode(color, a, rgb);
- if (a == 0) {
- return TRUE;
- }
- HPEN hPen = CreatePen(PS_SOLID, 1, rgb);
- hPen = (HPEN)SelectObject(m_hDC, hPen);
- MoveToEx(m_hDC, FXSYS_round(x1), FXSYS_round(y1), NULL);
- LineTo(m_hDC, FXSYS_round(x2), FXSYS_round(y2));
- hPen = (HPEN)SelectObject(m_hDC, hPen);
- DeleteObject(hPen);
- return TRUE;
-}
-FX_BOOL CGdiDeviceDriver::DeleteDeviceRgn(FX_LPVOID pRgn)
-{
- DeleteObject((HGDIOBJ)pRgn);
- return TRUE;
-}
-CGdiDisplayDriver::CGdiDisplayDriver(HDC hDC) : CGdiDeviceDriver(hDC, FXDC_DISPLAY)
-{
- CWin32Platform* pPlatform = (CWin32Platform*)CFX_GEModule::Get()->GetPlatformData();
- if (pPlatform->m_GdiplusExt.IsAvailable()) {
- m_RenderCaps |= FXRC_ALPHA_PATH | FXRC_ALPHA_IMAGE;
- }
-}
-FX_BOOL CGdiDisplayDriver::GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform, FX_BOOL bDEdge)
-{
- FX_BOOL ret = FALSE;
- int width = pBitmap->GetWidth();
- int height = pBitmap->GetHeight();
- HBITMAP hbmp = CreateCompatibleBitmap(m_hDC, width, height);
- HDC hDCMemory = CreateCompatibleDC(m_hDC);
- HBITMAP holdbmp = (HBITMAP)SelectObject(hDCMemory, hbmp);
- BitBlt(hDCMemory, 0, 0, width, height, m_hDC, left, top, SRCCOPY);
- SelectObject(hDCMemory, holdbmp);
- BITMAPINFO bmi;
- FXSYS_memset32(&bmi, 0, sizeof bmi);
- bmi.bmiHeader.biSize = sizeof bmi.bmiHeader;
- bmi.bmiHeader.biBitCount = pBitmap->GetBPP();
- bmi.bmiHeader.biHeight = -height;
- bmi.bmiHeader.biPlanes = 1;
- bmi.bmiHeader.biWidth = width;
- if (!CFX_GEModule::Get()->GetCodecModule() || !CFX_GEModule::Get()->GetCodecModule()->GetIccModule()) {
- pIccTransform = NULL;
- }
- if (pBitmap->GetBPP() > 8 && !pBitmap->IsCmykImage() && pIccTransform == NULL) {
- ret = ::GetDIBits(hDCMemory, hbmp, 0, height, pBitmap->GetBuffer(), &bmi, DIB_RGB_COLORS) == height;
- } else {
- CFX_DIBitmap bitmap;
- if (bitmap.Create(width, height, FXDIB_Rgb)) {
- bmi.bmiHeader.biBitCount = 24;
- ::GetDIBits(hDCMemory, hbmp, 0, height, bitmap.GetBuffer(), &bmi, DIB_RGB_COLORS);
- ret = pBitmap->TransferBitmap(0, 0, width, height, &bitmap, 0, 0, pIccTransform);
- } else {
- ret = FALSE;
- }
- }
-#ifndef _FPDFAPI_MINI_
- if (pBitmap->HasAlpha() && ret) {
- pBitmap->LoadChannel(FXDIB_Alpha, 0xff);
- }
-#endif
- DeleteObject(hbmp);
- DeleteObject(hDCMemory);
- return ret;
-}
-FX_BOOL CGdiDisplayDriver::SetDIBits(const CFX_DIBSource* pSource, FX_DWORD color, const FX_RECT* pSrcRect, int left, int top, int blend_type,
- int alpha_flag, void* pIccTransform)
-{
- ASSERT(blend_type == FXDIB_BLEND_NORMAL);
- if (pSource->IsAlphaMask()) {
- int width = pSource->GetWidth(), height = pSource->GetHeight();
- int alpha = FXGETFLAG_COLORTYPE(alpha_flag) ? FXGETFLAG_ALPHA_FILL(alpha_flag) : FXARGB_A(color);
- FX_BOOL bGDI = pSource->GetBPP() == 1 && alpha == 255;
- if (!bGDI) {
- CFX_DIBitmap background;
- if (!background.Create(width, height, FXDIB_Rgb32) ||
- !GetDIBits(&background, left, top, NULL) ||
- !background.CompositeMask(0, 0, width, height, pSource, color, 0, 0, FXDIB_BLEND_NORMAL, NULL, FALSE, alpha_flag, pIccTransform)) {
- return FALSE;
- }
- FX_RECT src_rect(0, 0, width, height);
- return SetDIBits(&background, 0, &src_rect, left, top, FXDIB_BLEND_NORMAL, 0, NULL);
- }
- FX_RECT clip_rect(left, top, left + pSrcRect->Width(), top + pSrcRect->Height());
- return StretchDIBits(pSource, color, left - pSrcRect->left, top - pSrcRect->top, width, height,
- &clip_rect, 0, alpha_flag, pIccTransform, FXDIB_BLEND_NORMAL);
- } else {
- int width = pSrcRect->Width(), height = pSrcRect->Height();
- if (pSource->HasAlpha()) {
- CFX_DIBitmap bitmap;
- if (!bitmap.Create(width, height, FXDIB_Rgb) ||
- !GetDIBits(&bitmap, left, top, NULL) ||
- !bitmap.CompositeBitmap(0, 0, width, height, pSource, pSrcRect->left, pSrcRect->top, FXDIB_BLEND_NORMAL, NULL, FALSE, pIccTransform)) {
- return FALSE;
- }
- FX_RECT src_rect(0, 0, width, height);
- return SetDIBits(&bitmap, 0, &src_rect, left, top, FXDIB_BLEND_NORMAL, 0, NULL);
- }
- CFX_DIBExtractor temp(pSource);
- CFX_DIBitmap* pBitmap = temp;
- if (pBitmap) {
- return GDI_SetDIBits(pBitmap, pSrcRect, left, top, pIccTransform);
- }
- }
- return FALSE;
-}
-FX_BOOL CGdiDisplayDriver::UseFoxitStretchEngine(const CFX_DIBSource* pSource, FX_DWORD color, int dest_left, int dest_top,
- int dest_width, int dest_height, const FX_RECT* pClipRect, int render_flags,
- int alpha_flag, void* pIccTransform, int blend_type)
-{
- FX_RECT bitmap_clip = *pClipRect;
- if (dest_width < 0) {
- dest_left += dest_width;
- }
- if (dest_height < 0) {
- dest_top += dest_height;
- }
- bitmap_clip.Offset(-dest_left, -dest_top);
- CFX_DIBitmap* pStretched = pSource->StretchTo(dest_width, dest_height, render_flags, &bitmap_clip);
- if (pStretched == NULL) {
- return TRUE;
- }
- FX_RECT src_rect(0, 0, pStretched->GetWidth(), pStretched->GetHeight());
- FX_BOOL ret = SetDIBits(pStretched, color, &src_rect, pClipRect->left, pClipRect->top, FXDIB_BLEND_NORMAL, alpha_flag, pIccTransform);
- delete pStretched;
- return ret;
-}
-FX_BOOL CGdiDisplayDriver::StretchDIBits(const CFX_DIBSource* pSource, FX_DWORD color, int dest_left, int dest_top,
- int dest_width, int dest_height, const FX_RECT* pClipRect, FX_DWORD flags,
- int alpha_flag, void* pIccTransform, int blend_type)
-{
- ASSERT(pSource != NULL && pClipRect != NULL);
- if (flags || dest_width > 10000 || dest_width < -10000 || dest_height > 10000 || dest_height < -10000)
- return UseFoxitStretchEngine(pSource, color, dest_left, dest_top, dest_width, dest_height,
- pClipRect, flags, alpha_flag, pIccTransform, blend_type);
- if (pSource->IsAlphaMask()) {
- FX_RECT image_rect;
- image_rect.left = dest_width > 0 ? dest_left : dest_left + dest_width;
- image_rect.right = dest_width > 0 ? dest_left + dest_width : dest_left;
- image_rect.top = dest_height > 0 ? dest_top : dest_top + dest_height;
- image_rect.bottom = dest_height > 0 ? dest_top + dest_height : dest_top;
- FX_RECT clip_rect = image_rect;
- clip_rect.Intersect(*pClipRect);
- clip_rect.Offset(-image_rect.left, -image_rect.top);
- int clip_width = clip_rect.Width(), clip_height = clip_rect.Height();
- CFX_DIBitmap* pStretched = pSource->StretchTo(dest_width, dest_height, flags, &clip_rect);
- if (pStretched == NULL) {
- return TRUE;
- }
- CFX_DIBitmap background;
- if (!background.Create(clip_width, clip_height, FXDIB_Rgb32) ||
- !GetDIBits(&background, image_rect.left + clip_rect.left, image_rect.top + clip_rect.top, NULL) ||
- !background.CompositeMask(0, 0, clip_width, clip_height, pStretched, color, 0, 0, FXDIB_BLEND_NORMAL, NULL, FALSE, alpha_flag, pIccTransform)) {
- delete pStretched;
- return FALSE;
- }
- FX_RECT src_rect(0, 0, clip_width, clip_height);
- FX_BOOL ret = SetDIBits(&background, 0, &src_rect, image_rect.left + clip_rect.left, image_rect.top + clip_rect.top, FXDIB_BLEND_NORMAL, 0, NULL);
- delete pStretched;
- return ret;
- } else {
- if (pSource->HasAlpha()) {
- CWin32Platform* pPlatform = (CWin32Platform*)CFX_GEModule::Get()->GetPlatformData();
- if (pPlatform->m_GdiplusExt.IsAvailable() && pIccTransform == NULL && !pSource->IsCmykImage()) {
- CFX_DIBExtractor temp(pSource);
- CFX_DIBitmap* pBitmap = temp;
- if (pBitmap == NULL) {
- return FALSE;
- }
- return pPlatform->m_GdiplusExt.StretchDIBits(m_hDC, pBitmap, dest_left, dest_top, dest_width, dest_height, pClipRect, flags);
- }
- return UseFoxitStretchEngine(pSource, color, dest_left, dest_top, dest_width, dest_height,
- pClipRect, flags, alpha_flag, pIccTransform, blend_type);
- }
- CFX_DIBExtractor temp(pSource);
- CFX_DIBitmap* pBitmap = temp;
- if (pBitmap) {
- return GDI_StretchDIBits(pBitmap, dest_left, dest_top, dest_width, dest_height, flags, pIccTransform);
- }
- }
- return FALSE;
-}
-#define GET_PS_FEATURESETTING 4121
-#define FEATURESETTING_PSLEVEL 2
-int GetPSLevel(HDC hDC)
-{
- int device_type = ::GetDeviceCaps(hDC, TECHNOLOGY);
- if (device_type != DT_RASPRINTER) {
- return 0;
- }
- FX_DWORD esc = GET_PS_FEATURESETTING;
- if (ExtEscape(hDC, QUERYESCSUPPORT, sizeof esc, (char*)&esc, 0, NULL)) {
- int param = FEATURESETTING_PSLEVEL;
- if (ExtEscape(hDC, GET_PS_FEATURESETTING, sizeof(int), (char*)&param, sizeof(int), (char*)&param) > 0) {
- return param;
- }
- }
- esc = POSTSCRIPT_IDENTIFY;
- if (ExtEscape(hDC, QUERYESCSUPPORT, sizeof esc, (char*)&esc, 0, NULL) == 0) {
- esc = POSTSCRIPT_DATA;
- if (ExtEscape(hDC, QUERYESCSUPPORT, sizeof esc, (char*)&esc, 0, NULL)) {
- return 2;
- }
- return 0;
- }
- esc = PSIDENT_GDICENTRIC;
- if (ExtEscape(hDC, POSTSCRIPT_IDENTIFY, sizeof(FX_DWORD), (char*)&esc, 0, NULL) <= 0) {
- return 2;
- }
- esc = GET_PS_FEATURESETTING;
- if (ExtEscape(hDC, QUERYESCSUPPORT, sizeof esc, (char*)&esc, 0, NULL)) {
- int param = FEATURESETTING_PSLEVEL;
- if (ExtEscape(hDC, GET_PS_FEATURESETTING, sizeof(int), (char*)&param, sizeof(int), (char*)&param) > 0) {
- return param;
- }
- }
- return 2;
-}
-int CFX_WindowsDevice::m_psLevel = 2;
-CFX_WindowsDevice::CFX_WindowsDevice(HDC hDC, FX_BOOL bCmykOutput, FX_BOOL bForcePSOutput, int psLevel)
-{
- m_bForcePSOutput = bForcePSOutput;
- m_psLevel = psLevel;
- if (bForcePSOutput) {
- IFX_RenderDeviceDriver* pDriver = FX_NEW CPSPrinterDriver;
- if (!pDriver) {
- return;
- }
- ((CPSPrinterDriver*)pDriver)->Init(hDC, psLevel, bCmykOutput);
- SetDeviceDriver(pDriver);
- return;
- }
- SetDeviceDriver(CreateDriver(hDC, bCmykOutput));
-}
-HDC CFX_WindowsDevice::GetDC() const
-{
- IFX_RenderDeviceDriver *pRDD = GetDeviceDriver();
- if (!pRDD) {
- return NULL;
- }
- return (HDC)pRDD->GetPlatformSurface();
-}
-IFX_RenderDeviceDriver* CFX_WindowsDevice::CreateDriver(HDC hDC, FX_BOOL bCmykOutput)
-{
- int device_type = ::GetDeviceCaps(hDC, TECHNOLOGY);
- int obj_type = ::GetObjectType(hDC);
- int device_class;
- if (device_type == DT_RASPRINTER || device_type == DT_PLOTTER || obj_type == OBJ_ENHMETADC) {
- device_class = FXDC_PRINTER;
- } else {
- device_class = FXDC_DISPLAY;
- }
- return FX_NEW CGdiDisplayDriver(hDC);
-}
-CFX_WinBitmapDevice::CFX_WinBitmapDevice(int width, int height, FXDIB_Format format)
-{
- BITMAPINFOHEADER bmih;
- FXSYS_memset32(&bmih, 0, sizeof (BITMAPINFOHEADER));
- bmih.biSize = sizeof(BITMAPINFOHEADER);
- bmih.biBitCount = format & 0xff;
- bmih.biHeight = -height;
- bmih.biPlanes = 1;
- bmih.biWidth = width;
- FX_LPBYTE pBuffer;
- m_hBitmap = CreateDIBSection(NULL, (BITMAPINFO*)&bmih, DIB_RGB_COLORS, (FX_LPVOID*)&pBuffer, NULL, 0);
- if (m_hBitmap == NULL) {
- return;
- }
- CFX_DIBitmap* pBitmap = FX_NEW CFX_DIBitmap;
- if (!pBitmap) {
- return;
- }
- pBitmap->Create(width, height, format, pBuffer);
- SetBitmap(pBitmap);
- m_hDC = ::CreateCompatibleDC(NULL);
- m_hOldBitmap = (HBITMAP)SelectObject(m_hDC, m_hBitmap);
- IFX_RenderDeviceDriver* pDriver = FX_NEW CGdiDisplayDriver(m_hDC);
- if (!pDriver) {
- return;
- }
- SetDeviceDriver(pDriver);
-}
-CFX_WinBitmapDevice::~CFX_WinBitmapDevice()
-{
- if (m_hDC) {
- SelectObject(m_hDC, m_hOldBitmap);
- DeleteDC(m_hDC);
- }
- if (m_hBitmap) {
- DeleteObject(m_hBitmap);
- }
- delete GetBitmap();
-}
-#endif
+// 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
+
+#include "../../../include/fxge/fx_ge.h"
+#if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_
+#include "../../../include/fxge/fx_ge_win32.h"
+#include <crtdbg.h>
+#include "../agg/include/fxfx_agg_clip_liang_barsky.h"
+#include "dwrite_int.h"
+#include "win32_int.h"
+#include "../ge/text_int.h"
+#include "../dib/dib_int.h"
+#include "../agg/include/fx_agg_driver.h"
+#include "../../../include/fxge/fx_freetype.h"
+#include "../../../include/fxcodec/fx_codec.h"
+class CWin32FontInfo : public IFX_SystemFontInfo
+{
+public:
+ CWin32FontInfo();
+ ~CWin32FontInfo();
+ virtual void Release();
+ virtual FX_BOOL EnumFontList(CFX_FontMapper* pMapper);
+ virtual void* MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, FX_LPCSTR face, FX_BOOL& bExact);
+ virtual void* GetFont(FX_LPCSTR face)
+ {
+ return NULL;
+ }
+ virtual FX_DWORD GetFontData(void* hFont, FX_DWORD table, FX_LPBYTE buffer, FX_DWORD size);
+ virtual void DeleteFont(void* hFont);
+ virtual FX_BOOL GetFaceName(void* hFont, CFX_ByteString& name);
+ virtual FX_BOOL GetFontCharset(void* hFont, int& charset);
+ FX_BOOL IsOpenTypeFromDiv(const LOGFONTA *plf);
+ FX_BOOL IsSupportFontFormDiv(const LOGFONTA* plf);
+ void AddInstalledFont(const LOGFONTA *plf, FX_DWORD FontType);
+ void GetGBPreference(CFX_ByteString& face, int weight, int picth_family);
+ void GetJapanesePreference(CFX_ByteString& face, int weight, int picth_family);
+ CFX_ByteString FindFont(const CFX_ByteString& name);
+ HDC m_hDC;
+ CFX_FontMapper* m_pMapper;
+ CFX_ByteString m_LastFamily;
+ CFX_ByteString m_KaiTi, m_FangSong;
+};
+CWin32FontInfo::CWin32FontInfo()
+{
+ m_hDC = CreateCompatibleDC(NULL);
+}
+CWin32FontInfo::~CWin32FontInfo()
+{
+ m_pMapper = NULL;
+}
+void CWin32FontInfo::Release()
+{
+ DeleteDC(m_hDC);
+ delete this;
+}
+#define TT_MAKE_TAG(x1, x2, x3, x4) (((FX_DWORD)x1<<24)|((FX_DWORD)x2<<16)|((FX_DWORD)x3<<8)|(FX_DWORD)x4)
+FX_BOOL CWin32FontInfo::IsOpenTypeFromDiv(const LOGFONTA *plf)
+{
+ HFONT hFont = CreateFontIndirectA(plf);
+ FX_BOOL ret = FALSE;
+ FX_DWORD font_size = GetFontData(hFont, 0, NULL, 0);
+ if (font_size != GDI_ERROR && font_size >= sizeof(FX_DWORD)) {
+ FX_DWORD lVersion = 0;
+ GetFontData(hFont, 0, (FX_BYTE*)(&lVersion), sizeof(FX_DWORD));
+ lVersion = (((FX_DWORD)(FX_BYTE)(lVersion)) << 24) | ((FX_DWORD)((FX_BYTE)(lVersion >> 8))) << 16 |
+ ((FX_DWORD)((FX_BYTE)(lVersion >> 16))) << 8 | ((FX_BYTE)(lVersion >> 24));
+ if (lVersion == TT_MAKE_TAG('O', 'T', 'T', 'O') ||
+ lVersion == 0x00010000 ||
+ lVersion == TT_MAKE_TAG('t', 't', 'c', 'f') ||
+ lVersion == TT_MAKE_TAG('t', 'r', 'u', 'e') ||
+ lVersion == 0x00020000) {
+ ret = TRUE;
+ }
+ }
+ DeleteFont(hFont);
+ return ret;
+}
+FX_BOOL CWin32FontInfo::IsSupportFontFormDiv(const LOGFONTA* plf)
+{
+ HFONT hFont = CreateFontIndirectA(plf);
+ FX_BOOL ret = FALSE;
+ FX_DWORD font_size = GetFontData(hFont, 0, NULL, 0);
+ if (font_size != GDI_ERROR && font_size >= sizeof(FX_DWORD)) {
+ FX_DWORD lVersion = 0;
+ GetFontData(hFont, 0, (FX_BYTE*)(&lVersion), sizeof(FX_DWORD));
+ lVersion = (((FX_DWORD)(FX_BYTE)(lVersion)) << 24) | ((FX_DWORD)((FX_BYTE)(lVersion >> 8))) << 16 |
+ ((FX_DWORD)((FX_BYTE)(lVersion >> 16))) << 8 | ((FX_BYTE)(lVersion >> 24));
+ if (lVersion == TT_MAKE_TAG('O', 'T', 'T', 'O') ||
+ lVersion == 0x00010000 ||
+ lVersion == TT_MAKE_TAG('t', 't', 'c', 'f') ||
+ lVersion == TT_MAKE_TAG('t', 'r', 'u', 'e') ||
+ lVersion == 0x00020000) {
+ ret = TRUE;
+ } else if ((lVersion & 0xFFFF0000) == TT_MAKE_TAG(0x80, 0x01, 0x00, 0x00) ||
+ (lVersion & 0xFFFF0000) == TT_MAKE_TAG('%', '!', 0, 0)) {
+ ret = TRUE;
+ }
+ }
+ DeleteFont(hFont);
+ return ret;
+}
+void CWin32FontInfo::AddInstalledFont(const LOGFONTA *plf, FX_DWORD FontType)
+{
+ CFX_ByteString name(plf->lfFaceName, -1);
+ if (name[0] == '@') {
+ return;
+ }
+ if (name == m_LastFamily) {
+ m_pMapper->AddInstalledFont(name, plf->lfCharSet);
+ return;
+ }
+ if (!(FontType & TRUETYPE_FONTTYPE) && !(FontType & DEVICE_FONTTYPE)) {
+ return;
+ }
+ if (!(FontType & TRUETYPE_FONTTYPE)) {
+ if (!IsSupportFontFormDiv(plf)) {
+ return;
+ }
+ }
+ m_pMapper->AddInstalledFont(name, plf->lfCharSet);
+ m_LastFamily = name;
+}
+static int CALLBACK FontEnumProc(
+ const LOGFONTA *plf,
+ const TEXTMETRICA *lpntme,
+ FX_DWORD FontType,
+ LPARAM lParam
+)
+{
+ CWin32FontInfo* pFontInfo = (CWin32FontInfo*)lParam;
+ if (pFontInfo->m_pMapper->GetFontEnumerator()) {
+ pFontInfo->m_pMapper->GetFontEnumerator()->HitFont();
+ }
+ pFontInfo->AddInstalledFont(plf, FontType);
+ return 1;
+}
+FX_BOOL CWin32FontInfo::EnumFontList(CFX_FontMapper* pMapper)
+{
+ m_pMapper = pMapper;
+ LOGFONTA lf;
+ FXSYS_memset32(&lf, 0, sizeof(LOGFONTA));
+ lf.lfCharSet = DEFAULT_CHARSET;
+ lf.lfFaceName[0] = 0;
+ lf.lfPitchAndFamily = 0;
+ EnumFontFamiliesExA(m_hDC, &lf, (FONTENUMPROCA)FontEnumProc, (FX_UINTPTR)this, 0);
+ if (pMapper->GetFontEnumerator()) {
+ pMapper->GetFontEnumerator()->Finish();
+ }
+ return TRUE;
+}
+static const struct {
+ FX_LPCSTR m_pFaceName;
+ FX_LPCSTR m_pVariantName;
+}
+VariantNames[] = {
+ {"DFKai-SB", "\x19\x6A\x77\x69\xD4\x9A"},
+};
+static const struct {
+ FX_LPCSTR m_pName;
+ FX_LPCSTR m_pWinName;
+ FX_BOOL m_bBold;
+ FX_BOOL m_bItalic;
+}
+Base14Substs[] = {
+ {"Courier", "Courier New", FALSE, FALSE},
+ {"Courier-Bold", "Courier New", TRUE, FALSE},
+ {"Courier-BoldOblique", "Courier New", TRUE, TRUE},
+ {"Courier-Oblique", "Courier New", FALSE, TRUE},
+ {"Helvetica", "Arial", FALSE, FALSE},
+ {"Helvetica-Bold", "Arial", TRUE, FALSE},
+ {"Helvetica-BoldOblique", "Arial", TRUE, TRUE},
+ {"Helvetica-Oblique", "Arial", FALSE, TRUE},
+ {"Times-Roman", "Times New Roman", FALSE, FALSE},
+ {"Times-Bold", "Times New Roman", TRUE, FALSE},
+ {"Times-BoldItalic", "Times New Roman", TRUE, TRUE},
+ {"Times-Italic", "Times New Roman", FALSE, TRUE},
+};
+CFX_ByteString CWin32FontInfo::FindFont(const CFX_ByteString& name)
+{
+ if (m_pMapper == NULL) {
+ return name;
+ }
+ int nFonts = m_pMapper->m_InstalledTTFonts.GetSize();
+ for (int i = 0; i < nFonts; i ++) {
+ CFX_ByteString thisname = m_pMapper->m_InstalledTTFonts[i];
+ if (thisname[0] == ' ') {
+ if (thisname.Mid(1, name.GetLength()) == name) {
+ return m_pMapper->m_InstalledTTFonts[i + 1];
+ }
+ } else if (thisname.Left(name.GetLength()) == name) {
+ return m_pMapper->m_InstalledTTFonts[i];
+ }
+ }
+ return CFX_ByteString();
+}
+struct _FontNameMap {
+ FX_LPCSTR m_pSubFontName;
+ FX_LPCSTR m_pSrcFontName;
+};
+const _FontNameMap g_JpFontNameMap[] = {
+ {"MS Mincho", "Heiseimin-W3"},
+ {"MS Gothic", "Jun101-Light"},
+};
+const _FontNameMap g_GbFontNameMap[1];
+extern "C" {
+ static int compareString(const void* key, const void* element)
+ {
+ return FXSYS_stricmp((FX_LPCSTR)key, ((_FontNameMap*)element)->m_pSrcFontName);
+ }
+}
+FX_BOOL _GetSubFontName(CFX_ByteString& name, int lang)
+{
+ int size = sizeof g_JpFontNameMap;
+ void* pFontnameMap = (void*)g_JpFontNameMap;
+ if (lang == 1) {
+ size = sizeof g_GbFontNameMap;
+ pFontnameMap = (void*)g_GbFontNameMap;
+ } else if (lang == 2) {
+ size = 0;
+ }
+ _FontNameMap* found = (_FontNameMap*)FXSYS_bsearch((FX_LPCSTR)name, pFontnameMap,
+ size / sizeof (_FontNameMap), sizeof (_FontNameMap), compareString);
+ if (found == NULL) {
+ return FALSE;
+ }
+ name = found->m_pSubFontName;
+ return TRUE;
+}
+void CWin32FontInfo::GetGBPreference(CFX_ByteString& face, int weight, int picth_family)
+{
+ if (face.Find("KaiTi") >= 0 || face.Find("\xbf\xac") >= 0) {
+ if (m_KaiTi.IsEmpty()) {
+ m_KaiTi = FindFont("KaiTi");
+ if (m_KaiTi.IsEmpty()) {
+ m_KaiTi = "SimSun";
+ }
+ }
+ face = m_KaiTi;
+ } else if (face.Find("FangSong") >= 0 || face.Find("\xb7\xc2\xcb\xce") >= 0) {
+ if (m_FangSong.IsEmpty()) {
+ m_FangSong = FindFont("FangSong");
+ if (m_FangSong.IsEmpty()) {
+ m_FangSong = "SimSun";
+ }
+ }
+ face = m_FangSong;
+ } else if (face.Find("SimSun") >= 0 || face.Find("\xcb\xce") >= 0) {
+ face = "SimSun";
+ } else if (face.Find("SimHei") >= 0 || face.Find("\xba\xda") >= 0) {
+ face = "SimHei";
+ } else if (!(picth_family & FF_ROMAN) && weight > 550) {
+ face = "SimHei";
+ } else {
+ face = "SimSun";
+ }
+}
+void CWin32FontInfo::GetJapanesePreference(CFX_ByteString& face, int weight, int picth_family)
+{
+ if (face.Find("Gothic") >= 0 || face.Find("\x83\x53\x83\x56\x83\x62\x83\x4e") >= 0) {
+ if (face.Find("PGothic") >= 0 || face.Find("\x82\x6f\x83\x53\x83\x56\x83\x62\x83\x4e") >= 0) {
+ face = "MS PGothic";
+ } else if (face.Find("UI Gothic") >= 0) {
+ face = "MS UI Gothic";
+ } else {
+ if (face.Find("HGSGothicM") >= 0 || face.Find("HGMaruGothicMPRO") >= 0) {
+ face = "MS PGothic";
+ } else {
+ face = "MS Gothic";
+ }
+ }
+ return;
+ } else if (face.Find("Mincho") >= 0 || face.Find("\x96\xbe\x92\xa9") >= 0) {
+ if (face.Find("PMincho") >= 0 || face.Find("\x82\x6f\x96\xbe\x92\xa9") >= 0) {
+ face = "MS PMincho";
+ } else {
+ face = "MS Mincho";
+ }
+ return;
+ }
+ if (_GetSubFontName(face, 0)) {
+ return;
+ }
+ if (!(picth_family & FF_ROMAN) && weight > 400) {
+ face = "MS PGothic";
+ } else {
+ face = "MS PMincho";
+ }
+}
+void* CWin32FontInfo::MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, FX_LPCSTR cstr_face, FX_BOOL& bExact)
+{
+ CFX_ByteString face = cstr_face;
+ int iBaseFont;
+ for (iBaseFont = 0; iBaseFont < 12; iBaseFont ++)
+ if (face == CFX_ByteStringC(Base14Substs[iBaseFont].m_pName)) {
+ face = Base14Substs[iBaseFont].m_pWinName;
+ weight = Base14Substs[iBaseFont].m_bBold ? FW_BOLD : FW_NORMAL;
+ bItalic = Base14Substs[iBaseFont].m_bItalic;
+ bExact = TRUE;
+ break;
+ }
+ if (charset == ANSI_CHARSET || charset == SYMBOL_CHARSET) {
+ charset = DEFAULT_CHARSET;
+ }
+ int subst_pitch_family = pitch_family;
+ switch (charset) {
+ case SHIFTJIS_CHARSET:
+ subst_pitch_family = FF_ROMAN;
+ break;
+ case CHINESEBIG5_CHARSET:
+ case HANGUL_CHARSET:
+ case GB2312_CHARSET:
+ subst_pitch_family = 0;
+ break;
+ }
+ HFONT hFont = ::CreateFontA(-10, 0, 0, 0, weight, bItalic, 0, 0, charset, OUT_TT_ONLY_PRECIS,
+ 0, 0, subst_pitch_family, face);
+ char facebuf[100];
+ HFONT hOldFont = (HFONT)::SelectObject(m_hDC, hFont);
+ int ret = ::GetTextFaceA(m_hDC, 100, facebuf);
+ ::SelectObject(m_hDC, hOldFont);
+ if (face.EqualNoCase(facebuf)) {
+ return hFont;
+ }
+ int iCount = sizeof(VariantNames) / sizeof(VariantNames[0]);
+ for (int i = 0; i < iCount; ++i) {
+ if (face == VariantNames[i].m_pFaceName) {
+ CFX_WideString wsFace = CFX_WideString::FromLocal(facebuf);
+ CFX_WideString wsName = CFX_WideString::FromUTF16LE((const unsigned short*)VariantNames[i].m_pVariantName);
+ if (wsFace == wsName) {
+ return hFont;
+ }
+ }
+ }
+ ::DeleteObject(hFont);
+ if (charset == DEFAULT_CHARSET) {
+ return NULL;
+ }
+ switch (charset) {
+ case SHIFTJIS_CHARSET:
+ GetJapanesePreference(face, weight, pitch_family);
+ break;
+ case GB2312_CHARSET:
+ GetGBPreference(face, weight, pitch_family);
+ break;
+ case HANGUL_CHARSET:
+ face = "Gulim";
+ break;
+ case CHINESEBIG5_CHARSET:
+ if (face.Find("MSung") >= 0) {
+ face = "MingLiU";
+ } else {
+ face = "PMingLiU";
+ }
+ break;
+ }
+ hFont = ::CreateFontA(-10, 0, 0, 0, weight, bItalic, 0, 0, charset, OUT_TT_ONLY_PRECIS,
+ 0, 0, subst_pitch_family, face);
+ return hFont;
+}
+void CWin32FontInfo::DeleteFont(void* hFont)
+{
+ ::DeleteObject(hFont);
+}
+FX_DWORD CWin32FontInfo::GetFontData(void* hFont, FX_DWORD table, FX_LPBYTE buffer, FX_DWORD size)
+{
+ HFONT hOldFont = (HFONT)::SelectObject(m_hDC, (HFONT)hFont);
+ table = FXDWORD_FROM_MSBFIRST(table);
+ size = ::GetFontData(m_hDC, table, 0, buffer, size);
+ ::SelectObject(m_hDC, hOldFont);
+ if (size == GDI_ERROR) {
+ return 0;
+ }
+ return size;
+}
+FX_BOOL CWin32FontInfo::GetFaceName(void* hFont, CFX_ByteString& name)
+{
+ char facebuf[100];
+ HFONT hOldFont = (HFONT)::SelectObject(m_hDC, (HFONT)hFont);
+ int ret = ::GetTextFaceA(m_hDC, 100, facebuf);
+ ::SelectObject(m_hDC, hOldFont);
+ if (ret == 0) {
+ return FALSE;
+ }
+ name = facebuf;
+ return TRUE;
+}
+FX_BOOL CWin32FontInfo::GetFontCharset(void* hFont, int& charset)
+{
+ TEXTMETRIC tm;
+ HFONT hOldFont = (HFONT)::SelectObject(m_hDC, (HFONT)hFont);
+ ::GetTextMetrics(m_hDC, &tm);
+ ::SelectObject(m_hDC, hOldFont);
+ charset = tm.tmCharSet;
+ return TRUE;
+}
+#ifndef _FPDFAPI_MINI_
+IFX_SystemFontInfo* IFX_SystemFontInfo::CreateDefault()
+{
+ return FX_NEW CWin32FontInfo;
+}
+#endif
+void CFX_GEModule::InitPlatform()
+{
+ CWin32Platform* pPlatformData = FX_NEW CWin32Platform;
+ if (!pPlatformData) {
+ return;
+ }
+ OSVERSIONINFO ver;
+ ver.dwOSVersionInfoSize = sizeof(ver);
+ GetVersionEx(&ver);
+ pPlatformData->m_bHalfTone = ver.dwMajorVersion >= 5;
+ pPlatformData->m_GdiplusExt.Load();
+ m_pPlatformData = pPlatformData;
+ m_pFontMgr->SetSystemFontInfo(IFX_SystemFontInfo::CreateDefault());
+}
+void CFX_GEModule::DestroyPlatform()
+{
+ if (m_pPlatformData) {
+ delete (CWin32Platform*)m_pPlatformData;
+ }
+ m_pPlatformData = NULL;
+}
+CGdiDeviceDriver::CGdiDeviceDriver(HDC hDC, int device_class)
+{
+ m_hDC = hDC;
+ m_DeviceClass = device_class;
+ CWin32Platform* pPlatform = (CWin32Platform*)CFX_GEModule::Get()->GetPlatformData();
+ SetStretchBltMode(hDC, pPlatform->m_bHalfTone ? HALFTONE : COLORONCOLOR);
+ if (GetObjectType(m_hDC) == OBJ_MEMDC) {
+ HBITMAP hBitmap = CreateBitmap(1, 1, 1, 1, NULL);
+ hBitmap = (HBITMAP)SelectObject(m_hDC, hBitmap);
+ BITMAP bitmap;
+ GetObject(hBitmap, sizeof bitmap, &bitmap);
+ m_nBitsPerPixel = bitmap.bmBitsPixel;
+ m_Width = bitmap.bmWidth;
+ m_Height = abs(bitmap.bmHeight);
+ hBitmap = (HBITMAP)SelectObject(m_hDC, hBitmap);
+ DeleteObject(hBitmap);
+ } else {
+ m_nBitsPerPixel = ::GetDeviceCaps(m_hDC, BITSPIXEL);
+ m_Width = ::GetDeviceCaps(m_hDC, HORZRES);
+ m_Height = ::GetDeviceCaps(m_hDC, VERTRES);
+ }
+ if (m_DeviceClass != FXDC_DISPLAY) {
+ m_RenderCaps = FXRC_BIT_MASK;
+ } else {
+ m_RenderCaps = FXRC_GET_BITS | FXRC_BIT_MASK;
+ }
+}
+int CGdiDeviceDriver::GetDeviceCaps(int caps_id)
+{
+ switch (caps_id) {
+ case FXDC_DEVICE_CLASS:
+ return m_DeviceClass;
+ case FXDC_PIXEL_WIDTH:
+ return m_Width;
+ case FXDC_PIXEL_HEIGHT:
+ return m_Height;
+ case FXDC_BITS_PIXEL:
+ return m_nBitsPerPixel;
+ case FXDC_RENDER_CAPS:
+ return m_RenderCaps;
+ }
+ return 0;
+}
+FX_LPVOID CGdiDeviceDriver::GetClipRgn()
+{
+ HRGN hClipRgn = CreateRectRgn(0, 0, 1, 1);
+ if (::GetClipRgn(m_hDC, hClipRgn) == 0) {
+ DeleteObject(hClipRgn);
+ hClipRgn = NULL;
+ }
+ return (FX_LPVOID)hClipRgn;
+}
+FX_BOOL CGdiDeviceDriver::GDI_SetDIBits(const CFX_DIBitmap* pBitmap1, const FX_RECT* pSrcRect, int left, int top, void* pIccTransform)
+{
+ if (m_DeviceClass == FXDC_PRINTER) {
+ CFX_DIBitmap* pBitmap = pBitmap1->FlipImage(FALSE, TRUE);
+ if (pBitmap == NULL) {
+ return FALSE;
+ }
+ if ((pBitmap->IsCmykImage() || pIccTransform) &&
+ !pBitmap->ConvertFormat(FXDIB_Rgb, pIccTransform)) {
+ return FALSE;
+ }
+ int width = pSrcRect->Width(), height = pSrcRect->Height();
+ int pitch = pBitmap->GetPitch();
+ LPBYTE pBuffer = pBitmap->GetBuffer();
+ CFX_ByteString info = CFX_WindowsDIB::GetBitmapInfo(pBitmap);
+ ((BITMAPINFOHEADER*)(FX_LPCSTR)info)->biHeight *= -1;
+ FX_RECT dst_rect(0, 0, width, height);
+ dst_rect.Intersect(0, 0, pBitmap->GetWidth(), pBitmap->GetHeight());
+ int dst_width = dst_rect.Width();
+ int dst_height = dst_rect.Height();
+ ::StretchDIBits(m_hDC, left, top, dst_width, dst_height,
+ 0, 0, dst_width, dst_height, pBuffer, (BITMAPINFO*)(FX_LPCSTR)info, DIB_RGB_COLORS, SRCCOPY);
+ delete pBitmap;
+ } else {
+ CFX_DIBitmap* pBitmap = (CFX_DIBitmap*)pBitmap1;
+ if ((pBitmap->IsCmykImage() || pIccTransform) &&
+ (pBitmap = pBitmap->CloneConvert(FXDIB_Rgb, NULL, pIccTransform)) == NULL) {
+ return FALSE;
+ }
+ int width = pSrcRect->Width(), height = pSrcRect->Height();
+ int pitch = pBitmap->GetPitch();
+ LPBYTE pBuffer = pBitmap->GetBuffer();
+ CFX_ByteString info = CFX_WindowsDIB::GetBitmapInfo(pBitmap);
+ ::SetDIBitsToDevice(m_hDC, left, top, width, height, pSrcRect->left, pBitmap->GetHeight() - pSrcRect->bottom,
+ 0, pBitmap->GetHeight(), pBuffer, (BITMAPINFO*)(FX_LPCSTR)info, DIB_RGB_COLORS);
+ if (pBitmap != pBitmap1) {
+ delete pBitmap;
+ }
+ }
+ return TRUE;
+}
+FX_BOOL CGdiDeviceDriver::GDI_StretchDIBits(const CFX_DIBitmap* pBitmap1, int dest_left, int dest_top,
+ int dest_width, int dest_height, FX_DWORD flags, void* pIccTransform)
+{
+ CFX_DIBitmap* pBitmap = (CFX_DIBitmap*)pBitmap1;
+ if (pBitmap == NULL) {
+ return FALSE;
+ }
+ if ((pBitmap->IsCmykImage() || pIccTransform) &&
+ !pBitmap->ConvertFormat(FXDIB_Rgb, pIccTransform)) {
+ return FALSE;
+ }
+ CFX_ByteString info = CFX_WindowsDIB::GetBitmapInfo(pBitmap);
+ if (abs(dest_width) * abs(dest_height) < pBitmap1->GetWidth() * pBitmap1->GetHeight() * 4 ||
+ (flags & FXDIB_INTERPOL) || (flags & FXDIB_BICUBIC_INTERPOL)) {
+ SetStretchBltMode(m_hDC, HALFTONE);
+ } else {
+ SetStretchBltMode(m_hDC, COLORONCOLOR);
+ }
+ CFX_DIBitmap* pToStrechBitmap = pBitmap;
+ bool del = false;
+ if (m_DeviceClass == FXDC_PRINTER && (pBitmap->GetWidth() * pBitmap->GetHeight() > abs(dest_width) * abs(dest_height))) {
+ pToStrechBitmap = pBitmap->StretchTo(dest_width, dest_height);
+ del = true;
+ }
+ CFX_ByteString toStrechBitmapInfo = CFX_WindowsDIB::GetBitmapInfo(pToStrechBitmap);
+ ::StretchDIBits(m_hDC, dest_left, dest_top, dest_width, dest_height,
+ 0, 0, pToStrechBitmap->GetWidth(), pToStrechBitmap->GetHeight(), pToStrechBitmap->GetBuffer(),
+ (BITMAPINFO*)(FX_LPCSTR)toStrechBitmapInfo, DIB_RGB_COLORS, SRCCOPY);
+ if (del) {
+ delete pToStrechBitmap;
+ }
+ return TRUE;
+}
+FX_BOOL CGdiDeviceDriver::GDI_StretchBitMask(const CFX_DIBitmap* pBitmap1, int dest_left, int dest_top,
+ int dest_width, int dest_height, FX_DWORD bitmap_color, FX_DWORD flags,
+ int alpha_flag, void* pIccTransform)
+{
+ CFX_DIBitmap* pBitmap = (CFX_DIBitmap*)pBitmap1;
+ if (pBitmap == NULL) {
+ return FALSE;
+ }
+ _Color2Argb(bitmap_color, bitmap_color, alpha_flag | (1 << 24), pIccTransform);
+ int width = pBitmap->GetWidth(), height = pBitmap->GetHeight();
+ struct {
+ BITMAPINFOHEADER bmiHeader;
+ FX_DWORD bmiColors[2];
+ } bmi;
+ FXSYS_memset32(&bmi.bmiHeader, 0, sizeof (BITMAPINFOHEADER));
+ bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
+ bmi.bmiHeader.biBitCount = 1;
+ bmi.bmiHeader.biCompression = BI_RGB;
+ bmi.bmiHeader.biHeight = -height;
+ bmi.bmiHeader.biPlanes = 1;
+ bmi.bmiHeader.biWidth = width;
+ if (m_nBitsPerPixel != 1) {
+ SetStretchBltMode(m_hDC, HALFTONE);
+ }
+ bmi.bmiColors[0] = 0xffffff;
+ bmi.bmiColors[1] = 0;
+ ::StretchDIBits(m_hDC, dest_left, dest_top, dest_width, dest_height,
+ 0, 0, width, height, pBitmap->GetBuffer(), (BITMAPINFO*)&bmi, DIB_RGB_COLORS, SRCAND);
+ return TRUE;
+}
+BOOL CGdiDeviceDriver::GetClipBox(FX_RECT* pRect)
+{
+ return ::GetClipBox(m_hDC, (RECT*)pRect);
+}
+FX_BOOL CGdiDeviceDriver::SetClipRgn(FX_LPVOID hRgn)
+{
+ ::SelectClipRgn(m_hDC, (HRGN)hRgn);
+ return TRUE;
+}
+static HPEN _CreatePen(const CFX_GraphStateData* pGraphState, const CFX_AffineMatrix* pMatrix, FX_DWORD argb)
+{
+ FX_FLOAT width;
+ FX_FLOAT scale = 1.f;
+ if (pMatrix)
+ scale = FXSYS_fabs(pMatrix->a) > FXSYS_fabs(pMatrix->b) ?
+ FXSYS_fabs(pMatrix->a) : FXSYS_fabs(pMatrix->b);
+ if (pGraphState) {
+ width = scale * pGraphState->m_LineWidth;
+ } else {
+ width = 1.0f;
+ }
+ FX_DWORD PenStyle = PS_GEOMETRIC;
+ if (width < 1) {
+ width = 1;
+ }
+ if(pGraphState->m_DashCount) {
+ PenStyle |= PS_USERSTYLE;
+ } else {
+ PenStyle |= PS_SOLID;
+ }
+ switch(pGraphState->m_LineCap) {
+ case 0:
+ PenStyle |= PS_ENDCAP_FLAT;
+ break;
+ case 1:
+ PenStyle |= PS_ENDCAP_ROUND;
+ break;
+ case 2:
+ PenStyle |= PS_ENDCAP_SQUARE;
+ break;
+ }
+ switch(pGraphState->m_LineJoin) {
+ case 0:
+ PenStyle |= PS_JOIN_MITER;
+ break;
+ case 1:
+ PenStyle |= PS_JOIN_ROUND;
+ break;
+ case 2:
+ PenStyle |= PS_JOIN_BEVEL;
+ break;
+ }
+ int a;
+ FX_COLORREF rgb;
+ ArgbDecode(argb, a, rgb);
+ LOGBRUSH lb;
+ lb.lbColor = rgb;
+ lb.lbStyle = BS_SOLID;
+ lb.lbHatch = 0;
+ FX_DWORD* pDash = NULL;
+ if (pGraphState->m_DashCount) {
+ pDash = FX_Alloc(FX_DWORD, pGraphState->m_DashCount);
+ if (!pDash) {
+ return NULL;
+ }
+ for (int i = 0; i < pGraphState->m_DashCount; i ++) {
+ pDash[i] = FXSYS_round(pMatrix ? pMatrix->TransformDistance(pGraphState->m_DashArray[i]) : pGraphState->m_DashArray[i]);
+ if (pDash[i] < 1) {
+ pDash[i] = 1;
+ }
+ }
+ }
+ HPEN hPen = ExtCreatePen(PenStyle, (DWORD)FXSYS_ceil(width), &lb, pGraphState->m_DashCount, (const DWORD*)pDash);
+ if (pDash) {
+ FX_Free(pDash);
+ }
+ return hPen;
+}
+static HBRUSH _CreateBrush(FX_DWORD argb)
+{
+ int a;
+ FX_COLORREF rgb;
+ ArgbDecode(argb, a, rgb);
+ return CreateSolidBrush(rgb);
+}
+static void _SetPathToDC(HDC hDC, const CFX_PathData* pPathData, const CFX_AffineMatrix* pMatrix)
+{
+ BeginPath(hDC);
+ int nPoints = pPathData->GetPointCount();
+ FX_PATHPOINT* pPoints = pPathData->GetPoints();
+ for(int i = 0; i < nPoints; i++) {
+ FX_FLOAT posx = pPoints[i].m_PointX, posy = pPoints[i].m_PointY;
+ if (pMatrix) {
+ pMatrix->Transform(posx, posy);
+ }
+ int screen_x = FXSYS_round(posx), screen_y = FXSYS_round(posy);
+ int point_type = pPoints[i].m_Flag & FXPT_TYPE;
+ if(point_type == PT_MOVETO) {
+ MoveToEx(hDC, screen_x, screen_y, NULL);
+ } else if(point_type == PT_LINETO) {
+ if (pPoints[i].m_PointY == pPoints[i - 1].m_PointY && pPoints[i].m_PointX == pPoints[i - 1].m_PointX) {
+ screen_x ++;
+ }
+ LineTo(hDC, screen_x, screen_y);
+ } else if(point_type == PT_BEZIERTO) {
+ POINT lppt[3];
+ lppt[0].x = screen_x;
+ lppt[0].y = screen_y;
+ posx = pPoints[i + 1].m_PointX;
+ posy = pPoints[i + 1].m_PointY;
+ if (pMatrix) {
+ pMatrix->Transform(posx, posy);
+ }
+ lppt[1].x = FXSYS_round(posx);
+ lppt[1].y = FXSYS_round(posy);
+ posx = pPoints[i + 2].m_PointX;
+ posy = pPoints[i + 2].m_PointY;
+ if (pMatrix) {
+ pMatrix->Transform(posx, posy);
+ }
+ lppt[2].x = FXSYS_round(posx);
+ lppt[2].y = FXSYS_round(posy);
+ PolyBezierTo(hDC, lppt, 3);
+ i += 2;
+ }
+ if (pPoints[i].m_Flag & PT_CLOSEFIGURE) {
+ CloseFigure(hDC);
+ }
+ }
+ EndPath(hDC);
+}
+void CGdiDeviceDriver::DrawLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2)
+{
+ int flag1 = (x1 < 0) | ((x1 > m_Width) << 1) | ((y1 < 0) << 2) | ((y1 > m_Height) << 3);
+ int flag2 = (x2 < 0) | ((x2 > m_Width) << 1) | ((y2 < 0) << 2) | ((y2 > m_Height) << 3);
+ if (flag1 & flag2) {
+ return;
+ }
+ if (flag1 || flag2) {
+ agg::rect_base<FX_FLOAT> rect(0.0f, 0.0f, (FX_FLOAT)(m_Width), (FX_FLOAT)(m_Height));
+ FX_FLOAT x[2], y[2];
+ int np = agg::clip_liang_barsky<FX_FLOAT>(x1, y1, x2, y2, rect, x, y);
+ if (np == 0) {
+ return;
+ }
+ if (np == 1) {
+ x2 = x[0];
+ y2 = y[0];
+ } else {
+ x1 = x[0];
+ y1 = y[0];
+ x2 = x[np - 1];
+ y2 = y[np - 1];
+ }
+ }
+ MoveToEx(m_hDC, FXSYS_round(x1), FXSYS_round(y1), NULL);
+ LineTo(m_hDC, FXSYS_round(x2), FXSYS_round(y2));
+}
+static FX_BOOL _MatrixNoScaled(const CFX_AffineMatrix* pMatrix)
+{
+ return pMatrix->GetA() == 1.0f && pMatrix->GetB() == 0 && pMatrix->GetC() == 0 && pMatrix->GetD() == 1.0f;
+}
+FX_BOOL CGdiDeviceDriver::DrawPath(const CFX_PathData* pPathData,
+ const CFX_AffineMatrix* pMatrix,
+ const CFX_GraphStateData* pGraphState,
+ FX_DWORD fill_color,
+ FX_DWORD stroke_color,
+ int fill_mode,
+ int alpha_flag,
+ void* pIccTransform,
+ int blend_type
+ )
+{
+ if (blend_type != FXDIB_BLEND_NORMAL) {
+ return FALSE;
+ }
+ _Color2Argb(fill_color, fill_color, alpha_flag | (1 << 24), pIccTransform);
+ _Color2Argb(stroke_color, stroke_color, alpha_flag, pIccTransform);
+ CWin32Platform* pPlatform = (CWin32Platform*)CFX_GEModule::Get()->GetPlatformData();
+ if ((pGraphState == NULL || stroke_color == 0) && !pPlatform->m_GdiplusExt.IsAvailable()) {
+ CFX_FloatRect bbox_f = pPathData->GetBoundingBox();
+ if (pMatrix) {
+ bbox_f.Transform(pMatrix);
+ }
+ FX_RECT bbox = bbox_f.GetInnerRect();
+ if (bbox.Width() <= 0) {
+ return DrawCosmeticLine((FX_FLOAT)(bbox.left), (FX_FLOAT)(bbox.top), (FX_FLOAT)(bbox.left), (FX_FLOAT)(bbox.bottom + 1), fill_color,
+ alpha_flag, pIccTransform, FXDIB_BLEND_NORMAL);
+ } else if (bbox.Height() <= 0) {
+ return DrawCosmeticLine((FX_FLOAT)(bbox.left), (FX_FLOAT)(bbox.top), (FX_FLOAT)(bbox.right + 1), (FX_FLOAT)(bbox.top), fill_color,
+ alpha_flag, pIccTransform, FXDIB_BLEND_NORMAL);
+ }
+ }
+ int fill_alpha = FXARGB_A(fill_color);
+ int stroke_alpha = FXARGB_A(stroke_color);
+ FX_BOOL bDrawAlpha = (fill_alpha > 0 && fill_alpha < 255) || (stroke_alpha > 0 && stroke_alpha < 255 && pGraphState);
+ if (!pPlatform->m_GdiplusExt.IsAvailable() && bDrawAlpha) {
+ return FALSE;
+ }
+ if (pPlatform->m_GdiplusExt.IsAvailable()) {
+ if (bDrawAlpha || ((m_DeviceClass != FXDC_PRINTER && !(fill_mode & FXFILL_FULLCOVER)) || pGraphState && pGraphState->m_DashCount)) {
+ if ( !((NULL == pMatrix || _MatrixNoScaled(pMatrix)) &&
+ pGraphState && pGraphState->m_LineWidth == 1.f &&
+ (pPathData->GetPointCount() == 5 || pPathData->GetPointCount() == 4) &&
+ pPathData->IsRect()) ) {
+ if (pPlatform->m_GdiplusExt.DrawPath(m_hDC, pPathData, pMatrix, pGraphState, fill_color, stroke_color, fill_mode)) {
+ return TRUE;
+ }
+ }
+ }
+ }
+ int old_fill_mode = fill_mode;
+ fill_mode &= 3;
+ HPEN hPen = NULL;
+ HBRUSH hBrush = NULL;
+ if (pGraphState && stroke_alpha) {
+ SetMiterLimit(m_hDC, pGraphState->m_MiterLimit, NULL);
+ hPen = _CreatePen(pGraphState, pMatrix, stroke_color);
+ hPen = (HPEN)SelectObject(m_hDC, hPen);
+ }
+ if (fill_mode && fill_alpha) {
+ SetPolyFillMode(m_hDC, fill_mode);
+ hBrush = _CreateBrush(fill_color);
+ hBrush = (HBRUSH)SelectObject(m_hDC, hBrush);
+ }
+ if (pPathData->GetPointCount() == 2 && pGraphState && pGraphState->m_DashCount) {
+ FX_FLOAT x1 = pPathData->GetPointX(0), y1 = pPathData->GetPointY(0);
+ if (pMatrix) {
+ pMatrix->Transform(x1, y1);
+ }
+ FX_FLOAT x2 = pPathData->GetPointX(1), y2 = pPathData->GetPointY(1);
+ if (pMatrix) {
+ pMatrix->Transform(x2, y2);
+ }
+ DrawLine(x1, y1, x2, y2);
+ } else {
+ _SetPathToDC(m_hDC, pPathData, pMatrix);
+ if (pGraphState && stroke_alpha) {
+ if (fill_mode && fill_alpha) {
+ if (old_fill_mode & FX_FILL_TEXT_MODE) {
+ StrokeAndFillPath(m_hDC);
+ } else {
+ FillPath(m_hDC);
+ _SetPathToDC(m_hDC, pPathData, pMatrix);
+ StrokePath(m_hDC);
+ }
+ } else {
+ StrokePath(m_hDC);
+ }
+ } else if (fill_mode && fill_alpha) {
+ FillPath(m_hDC);
+ }
+ }
+ if (hPen) {
+ hPen = (HPEN)SelectObject(m_hDC, hPen);
+ DeleteObject(hPen);
+ }
+ if (hBrush) {
+ hBrush = (HBRUSH)SelectObject(m_hDC, hBrush);
+ DeleteObject(hBrush);
+ }
+ return TRUE;
+}
+FX_BOOL CGdiDeviceDriver::FillRect(const FX_RECT* pRect, FX_DWORD fill_color, int alpha_flag, void* pIccTransform, int blend_type)
+{
+ if (blend_type != FXDIB_BLEND_NORMAL) {
+ return FALSE;
+ }
+ _Color2Argb(fill_color, fill_color, alpha_flag | (1 << 24), pIccTransform);
+ int alpha;
+ FX_COLORREF rgb;
+ ArgbDecode(fill_color, alpha, rgb);
+ if (alpha == 0) {
+ return TRUE;
+ }
+ if (alpha < 255) {
+ return FALSE;
+ }
+ HBRUSH hBrush = CreateSolidBrush(rgb);
+ ::FillRect(m_hDC, (RECT*)pRect, hBrush);
+ DeleteObject(hBrush);
+ return TRUE;
+}
+FX_BOOL CGdiDeviceDriver::SetClip_PathFill(const CFX_PathData* pPathData,
+ const CFX_AffineMatrix* pMatrix,
+ int fill_mode
+ )
+{
+ if (pPathData->GetPointCount() == 5) {
+ CFX_FloatRect rectf;
+ if (pPathData->IsRect(pMatrix, &rectf)) {
+ FX_RECT rect = rectf.GetOutterRect();
+ IntersectClipRect(m_hDC, rect.left, rect.top, rect.right, rect.bottom);
+ return TRUE;
+ }
+ }
+ _SetPathToDC(m_hDC, pPathData, pMatrix);
+ SetPolyFillMode(m_hDC, fill_mode & 3);
+ SelectClipPath(m_hDC, RGN_AND);
+ return TRUE;
+}
+FX_BOOL CGdiDeviceDriver::SetClip_PathStroke(const CFX_PathData* pPathData,
+ const CFX_AffineMatrix* pMatrix,
+ const CFX_GraphStateData* pGraphState
+ )
+{
+ HPEN hPen = _CreatePen(pGraphState, pMatrix, 0xff000000);
+ hPen = (HPEN)SelectObject(m_hDC, hPen);
+ _SetPathToDC(m_hDC, pPathData, pMatrix);
+ WidenPath(m_hDC);
+ SetPolyFillMode(m_hDC, WINDING);
+ FX_BOOL ret = SelectClipPath(m_hDC, RGN_AND);
+ hPen = (HPEN)SelectObject(m_hDC, hPen);
+ DeleteObject(hPen);
+ return ret;
+}
+FX_BOOL CGdiDeviceDriver::DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, FX_DWORD color,
+ int alpha_flag, void* pIccTransform, int blend_type)
+{
+ if (blend_type != FXDIB_BLEND_NORMAL) {
+ return FALSE;
+ }
+ _Color2Argb(color, color, alpha_flag | (1 << 24), pIccTransform);
+ int a;
+ FX_COLORREF rgb;
+ ArgbDecode(color, a, rgb);
+ if (a == 0) {
+ return TRUE;
+ }
+ HPEN hPen = CreatePen(PS_SOLID, 1, rgb);
+ hPen = (HPEN)SelectObject(m_hDC, hPen);
+ MoveToEx(m_hDC, FXSYS_round(x1), FXSYS_round(y1), NULL);
+ LineTo(m_hDC, FXSYS_round(x2), FXSYS_round(y2));
+ hPen = (HPEN)SelectObject(m_hDC, hPen);
+ DeleteObject(hPen);
+ return TRUE;
+}
+FX_BOOL CGdiDeviceDriver::DeleteDeviceRgn(FX_LPVOID pRgn)
+{
+ DeleteObject((HGDIOBJ)pRgn);
+ return TRUE;
+}
+CGdiDisplayDriver::CGdiDisplayDriver(HDC hDC) : CGdiDeviceDriver(hDC, FXDC_DISPLAY)
+{
+ CWin32Platform* pPlatform = (CWin32Platform*)CFX_GEModule::Get()->GetPlatformData();
+ if (pPlatform->m_GdiplusExt.IsAvailable()) {
+ m_RenderCaps |= FXRC_ALPHA_PATH | FXRC_ALPHA_IMAGE;
+ }
+}
+FX_BOOL CGdiDisplayDriver::GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform, FX_BOOL bDEdge)
+{
+ FX_BOOL ret = FALSE;
+ int width = pBitmap->GetWidth();
+ int height = pBitmap->GetHeight();
+ HBITMAP hbmp = CreateCompatibleBitmap(m_hDC, width, height);
+ HDC hDCMemory = CreateCompatibleDC(m_hDC);
+ HBITMAP holdbmp = (HBITMAP)SelectObject(hDCMemory, hbmp);
+ BitBlt(hDCMemory, 0, 0, width, height, m_hDC, left, top, SRCCOPY);
+ SelectObject(hDCMemory, holdbmp);
+ BITMAPINFO bmi;
+ FXSYS_memset32(&bmi, 0, sizeof bmi);
+ bmi.bmiHeader.biSize = sizeof bmi.bmiHeader;
+ bmi.bmiHeader.biBitCount = pBitmap->GetBPP();
+ bmi.bmiHeader.biHeight = -height;
+ bmi.bmiHeader.biPlanes = 1;
+ bmi.bmiHeader.biWidth = width;
+ if (!CFX_GEModule::Get()->GetCodecModule() || !CFX_GEModule::Get()->GetCodecModule()->GetIccModule()) {
+ pIccTransform = NULL;
+ }
+ if (pBitmap->GetBPP() > 8 && !pBitmap->IsCmykImage() && pIccTransform == NULL) {
+ ret = ::GetDIBits(hDCMemory, hbmp, 0, height, pBitmap->GetBuffer(), &bmi, DIB_RGB_COLORS) == height;
+ } else {
+ CFX_DIBitmap bitmap;
+ if (bitmap.Create(width, height, FXDIB_Rgb)) {
+ bmi.bmiHeader.biBitCount = 24;
+ ::GetDIBits(hDCMemory, hbmp, 0, height, bitmap.GetBuffer(), &bmi, DIB_RGB_COLORS);
+ ret = pBitmap->TransferBitmap(0, 0, width, height, &bitmap, 0, 0, pIccTransform);
+ } else {
+ ret = FALSE;
+ }
+ }
+#ifndef _FPDFAPI_MINI_
+ if (pBitmap->HasAlpha() && ret) {
+ pBitmap->LoadChannel(FXDIB_Alpha, 0xff);
+ }
+#endif
+ DeleteObject(hbmp);
+ DeleteObject(hDCMemory);
+ return ret;
+}
+FX_BOOL CGdiDisplayDriver::SetDIBits(const CFX_DIBSource* pSource, FX_DWORD color, const FX_RECT* pSrcRect, int left, int top, int blend_type,
+ int alpha_flag, void* pIccTransform)
+{
+ ASSERT(blend_type == FXDIB_BLEND_NORMAL);
+ if (pSource->IsAlphaMask()) {
+ int width = pSource->GetWidth(), height = pSource->GetHeight();
+ int alpha = FXGETFLAG_COLORTYPE(alpha_flag) ? FXGETFLAG_ALPHA_FILL(alpha_flag) : FXARGB_A(color);
+ FX_BOOL bGDI = pSource->GetBPP() == 1 && alpha == 255;
+ if (!bGDI) {
+ CFX_DIBitmap background;
+ if (!background.Create(width, height, FXDIB_Rgb32) ||
+ !GetDIBits(&background, left, top, NULL) ||
+ !background.CompositeMask(0, 0, width, height, pSource, color, 0, 0, FXDIB_BLEND_NORMAL, NULL, FALSE, alpha_flag, pIccTransform)) {
+ return FALSE;
+ }
+ FX_RECT src_rect(0, 0, width, height);
+ return SetDIBits(&background, 0, &src_rect, left, top, FXDIB_BLEND_NORMAL, 0, NULL);
+ }
+ FX_RECT clip_rect(left, top, left + pSrcRect->Width(), top + pSrcRect->Height());
+ return StretchDIBits(pSource, color, left - pSrcRect->left, top - pSrcRect->top, width, height,
+ &clip_rect, 0, alpha_flag, pIccTransform, FXDIB_BLEND_NORMAL);
+ } else {
+ int width = pSrcRect->Width(), height = pSrcRect->Height();
+ if (pSource->HasAlpha()) {
+ CFX_DIBitmap bitmap;
+ if (!bitmap.Create(width, height, FXDIB_Rgb) ||
+ !GetDIBits(&bitmap, left, top, NULL) ||
+ !bitmap.CompositeBitmap(0, 0, width, height, pSource, pSrcRect->left, pSrcRect->top, FXDIB_BLEND_NORMAL, NULL, FALSE, pIccTransform)) {
+ return FALSE;
+ }
+ FX_RECT src_rect(0, 0, width, height);
+ return SetDIBits(&bitmap, 0, &src_rect, left, top, FXDIB_BLEND_NORMAL, 0, NULL);
+ }
+ CFX_DIBExtractor temp(pSource);
+ CFX_DIBitmap* pBitmap = temp;
+ if (pBitmap) {
+ return GDI_SetDIBits(pBitmap, pSrcRect, left, top, pIccTransform);
+ }
+ }
+ return FALSE;
+}
+FX_BOOL CGdiDisplayDriver::UseFoxitStretchEngine(const CFX_DIBSource* pSource, FX_DWORD color, int dest_left, int dest_top,
+ int dest_width, int dest_height, const FX_RECT* pClipRect, int render_flags,
+ int alpha_flag, void* pIccTransform, int blend_type)
+{
+ FX_RECT bitmap_clip = *pClipRect;
+ if (dest_width < 0) {
+ dest_left += dest_width;
+ }
+ if (dest_height < 0) {
+ dest_top += dest_height;
+ }
+ bitmap_clip.Offset(-dest_left, -dest_top);
+ CFX_DIBitmap* pStretched = pSource->StretchTo(dest_width, dest_height, render_flags, &bitmap_clip);
+ if (pStretched == NULL) {
+ return TRUE;
+ }
+ FX_RECT src_rect(0, 0, pStretched->GetWidth(), pStretched->GetHeight());
+ FX_BOOL ret = SetDIBits(pStretched, color, &src_rect, pClipRect->left, pClipRect->top, FXDIB_BLEND_NORMAL, alpha_flag, pIccTransform);
+ delete pStretched;
+ return ret;
+}
+FX_BOOL CGdiDisplayDriver::StretchDIBits(const CFX_DIBSource* pSource, FX_DWORD color, int dest_left, int dest_top,
+ int dest_width, int dest_height, const FX_RECT* pClipRect, FX_DWORD flags,
+ int alpha_flag, void* pIccTransform, int blend_type)
+{
+ ASSERT(pSource != NULL && pClipRect != NULL);
+ if (flags || dest_width > 10000 || dest_width < -10000 || dest_height > 10000 || dest_height < -10000)
+ return UseFoxitStretchEngine(pSource, color, dest_left, dest_top, dest_width, dest_height,
+ pClipRect, flags, alpha_flag, pIccTransform, blend_type);
+ if (pSource->IsAlphaMask()) {
+ FX_RECT image_rect;
+ image_rect.left = dest_width > 0 ? dest_left : dest_left + dest_width;
+ image_rect.right = dest_width > 0 ? dest_left + dest_width : dest_left;
+ image_rect.top = dest_height > 0 ? dest_top : dest_top + dest_height;
+ image_rect.bottom = dest_height > 0 ? dest_top + dest_height : dest_top;
+ FX_RECT clip_rect = image_rect;
+ clip_rect.Intersect(*pClipRect);
+ clip_rect.Offset(-image_rect.left, -image_rect.top);
+ int clip_width = clip_rect.Width(), clip_height = clip_rect.Height();
+ CFX_DIBitmap* pStretched = pSource->StretchTo(dest_width, dest_height, flags, &clip_rect);
+ if (pStretched == NULL) {
+ return TRUE;
+ }
+ CFX_DIBitmap background;
+ if (!background.Create(clip_width, clip_height, FXDIB_Rgb32) ||
+ !GetDIBits(&background, image_rect.left + clip_rect.left, image_rect.top + clip_rect.top, NULL) ||
+ !background.CompositeMask(0, 0, clip_width, clip_height, pStretched, color, 0, 0, FXDIB_BLEND_NORMAL, NULL, FALSE, alpha_flag, pIccTransform)) {
+ delete pStretched;
+ return FALSE;
+ }
+ FX_RECT src_rect(0, 0, clip_width, clip_height);
+ FX_BOOL ret = SetDIBits(&background, 0, &src_rect, image_rect.left + clip_rect.left, image_rect.top + clip_rect.top, FXDIB_BLEND_NORMAL, 0, NULL);
+ delete pStretched;
+ return ret;
+ } else {
+ if (pSource->HasAlpha()) {
+ CWin32Platform* pPlatform = (CWin32Platform*)CFX_GEModule::Get()->GetPlatformData();
+ if (pPlatform->m_GdiplusExt.IsAvailable() && pIccTransform == NULL && !pSource->IsCmykImage()) {
+ CFX_DIBExtractor temp(pSource);
+ CFX_DIBitmap* pBitmap = temp;
+ if (pBitmap == NULL) {
+ return FALSE;
+ }
+ return pPlatform->m_GdiplusExt.StretchDIBits(m_hDC, pBitmap, dest_left, dest_top, dest_width, dest_height, pClipRect, flags);
+ }
+ return UseFoxitStretchEngine(pSource, color, dest_left, dest_top, dest_width, dest_height,
+ pClipRect, flags, alpha_flag, pIccTransform, blend_type);
+ }
+ CFX_DIBExtractor temp(pSource);
+ CFX_DIBitmap* pBitmap = temp;
+ if (pBitmap) {
+ return GDI_StretchDIBits(pBitmap, dest_left, dest_top, dest_width, dest_height, flags, pIccTransform);
+ }
+ }
+ return FALSE;
+}
+#define GET_PS_FEATURESETTING 4121
+#define FEATURESETTING_PSLEVEL 2
+int GetPSLevel(HDC hDC)
+{
+ int device_type = ::GetDeviceCaps(hDC, TECHNOLOGY);
+ if (device_type != DT_RASPRINTER) {
+ return 0;
+ }
+ FX_DWORD esc = GET_PS_FEATURESETTING;
+ if (ExtEscape(hDC, QUERYESCSUPPORT, sizeof esc, (char*)&esc, 0, NULL)) {
+ int param = FEATURESETTING_PSLEVEL;
+ if (ExtEscape(hDC, GET_PS_FEATURESETTING, sizeof(int), (char*)&param, sizeof(int), (char*)&param) > 0) {
+ return param;
+ }
+ }
+ esc = POSTSCRIPT_IDENTIFY;
+ if (ExtEscape(hDC, QUERYESCSUPPORT, sizeof esc, (char*)&esc, 0, NULL) == 0) {
+ esc = POSTSCRIPT_DATA;
+ if (ExtEscape(hDC, QUERYESCSUPPORT, sizeof esc, (char*)&esc, 0, NULL)) {
+ return 2;
+ }
+ return 0;
+ }
+ esc = PSIDENT_GDICENTRIC;
+ if (ExtEscape(hDC, POSTSCRIPT_IDENTIFY, sizeof(FX_DWORD), (char*)&esc, 0, NULL) <= 0) {
+ return 2;
+ }
+ esc = GET_PS_FEATURESETTING;
+ if (ExtEscape(hDC, QUERYESCSUPPORT, sizeof esc, (char*)&esc, 0, NULL)) {
+ int param = FEATURESETTING_PSLEVEL;
+ if (ExtEscape(hDC, GET_PS_FEATURESETTING, sizeof(int), (char*)&param, sizeof(int), (char*)&param) > 0) {
+ return param;
+ }
+ }
+ return 2;
+}
+int CFX_WindowsDevice::m_psLevel = 2;
+CFX_WindowsDevice::CFX_WindowsDevice(HDC hDC, FX_BOOL bCmykOutput, FX_BOOL bForcePSOutput, int psLevel)
+{
+ m_bForcePSOutput = bForcePSOutput;
+ m_psLevel = psLevel;
+ if (bForcePSOutput) {
+ IFX_RenderDeviceDriver* pDriver = FX_NEW CPSPrinterDriver;
+ if (!pDriver) {
+ return;
+ }
+ ((CPSPrinterDriver*)pDriver)->Init(hDC, psLevel, bCmykOutput);
+ SetDeviceDriver(pDriver);
+ return;
+ }
+ SetDeviceDriver(CreateDriver(hDC, bCmykOutput));
+}
+HDC CFX_WindowsDevice::GetDC() const
+{
+ IFX_RenderDeviceDriver *pRDD = GetDeviceDriver();
+ if (!pRDD) {
+ return NULL;
+ }
+ return (HDC)pRDD->GetPlatformSurface();
+}
+IFX_RenderDeviceDriver* CFX_WindowsDevice::CreateDriver(HDC hDC, FX_BOOL bCmykOutput)
+{
+ int device_type = ::GetDeviceCaps(hDC, TECHNOLOGY);
+ int obj_type = ::GetObjectType(hDC);
+ int device_class;
+ if (device_type == DT_RASPRINTER || device_type == DT_PLOTTER || obj_type == OBJ_ENHMETADC) {
+ device_class = FXDC_PRINTER;
+ } else {
+ device_class = FXDC_DISPLAY;
+ }
+ return FX_NEW CGdiDisplayDriver(hDC);
+}
+CFX_WinBitmapDevice::CFX_WinBitmapDevice(int width, int height, FXDIB_Format format)
+{
+ BITMAPINFOHEADER bmih;
+ FXSYS_memset32(&bmih, 0, sizeof (BITMAPINFOHEADER));
+ bmih.biSize = sizeof(BITMAPINFOHEADER);
+ bmih.biBitCount = format & 0xff;
+ bmih.biHeight = -height;
+ bmih.biPlanes = 1;
+ bmih.biWidth = width;
+ FX_LPBYTE pBuffer;
+ m_hBitmap = CreateDIBSection(NULL, (BITMAPINFO*)&bmih, DIB_RGB_COLORS, (FX_LPVOID*)&pBuffer, NULL, 0);
+ if (m_hBitmap == NULL) {
+ return;
+ }
+ CFX_DIBitmap* pBitmap = FX_NEW CFX_DIBitmap;
+ if (!pBitmap) {
+ return;
+ }
+ pBitmap->Create(width, height, format, pBuffer);
+ SetBitmap(pBitmap);
+ m_hDC = ::CreateCompatibleDC(NULL);
+ m_hOldBitmap = (HBITMAP)SelectObject(m_hDC, m_hBitmap);
+ IFX_RenderDeviceDriver* pDriver = FX_NEW CGdiDisplayDriver(m_hDC);
+ if (!pDriver) {
+ return;
+ }
+ SetDeviceDriver(pDriver);
+}
+CFX_WinBitmapDevice::~CFX_WinBitmapDevice()
+{
+ if (m_hDC) {
+ SelectObject(m_hDC, m_hOldBitmap);
+ DeleteDC(m_hDC);
+ }
+ if (m_hBitmap) {
+ DeleteObject(m_hBitmap);
+ }
+ delete GetBitmap();
+}
+#endif
diff --git a/core/src/fxge/win32/fx_win32_dib.cpp b/core/src/fxge/win32/fx_win32_dib.cpp
index a9cf78eac3..0093d5e41b 100644
--- a/core/src/fxge/win32/fx_win32_dib.cpp
+++ b/core/src/fxge/win32/fx_win32_dib.cpp
@@ -1,310 +1,310 @@
-// 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
-
-#include "../../../include/fxge/fx_ge.h"
-#if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_
-#include <windows.h>
-#include "../../../include/fxge/fx_ge_win32.h"
-#include "win32_int.h"
-CFX_ByteString CFX_WindowsDIB::GetBitmapInfo(const CFX_DIBitmap* pBitmap)
-{
- CFX_ByteString result;
- int len = sizeof (BITMAPINFOHEADER);
- if (pBitmap->GetBPP() == 1 || pBitmap->GetBPP() == 8) {
- len += sizeof (DWORD) * (int)(1 << pBitmap->GetBPP());
- }
- BITMAPINFOHEADER* pbmih = (BITMAPINFOHEADER*)result.GetBuffer(len);
- FXSYS_memset32(pbmih, 0, sizeof (BITMAPINFOHEADER));
- pbmih->biSize = sizeof(BITMAPINFOHEADER);
- pbmih->biBitCount = pBitmap->GetBPP();
- pbmih->biCompression = BI_RGB;
- pbmih->biHeight = -(int)pBitmap->GetHeight();
- pbmih->biPlanes = 1;
- pbmih->biWidth = pBitmap->GetWidth();
- if (pBitmap->GetBPP() == 8) {
- FX_DWORD* pPalette = (FX_DWORD*)(pbmih + 1);
- if (pBitmap->GetPalette() == NULL) {
- for (int i = 0; i < 256; i ++) {
- pPalette[i] = i * 0x010101;
- }
- } else {
- for (int i = 0; i < 256; i ++) {
- pPalette[i] = pBitmap->GetPalette()[i];
- }
- }
- }
- if (pBitmap->GetBPP() == 1) {
- FX_DWORD* pPalette = (FX_DWORD*)(pbmih + 1);
- if (pBitmap->GetPalette() == NULL) {
- pPalette[0] = 0;
- pPalette[1] = 0xffffff;
- } else {
- pPalette[0] = pBitmap->GetPalette()[0];
- pPalette[1] = pBitmap->GetPalette()[1];
- }
- }
- result.ReleaseBuffer(len);
- return result;
-}
-CFX_DIBitmap* _FX_WindowsDIB_LoadFromBuf(BITMAPINFO* pbmi, LPVOID pData, FX_BOOL bAlpha)
-{
- int width = pbmi->bmiHeader.biWidth;
- int height = pbmi->bmiHeader.biHeight;
- BOOL bBottomUp = TRUE;
- if (height < 0) {
- height = -height;
- bBottomUp = FALSE;
- }
- int pitch = (width * pbmi->bmiHeader.biBitCount + 31) / 32 * 4;
- CFX_DIBitmap* pBitmap = FX_NEW CFX_DIBitmap;
- if (!pBitmap) {
- return NULL;
- }
- FXDIB_Format format = bAlpha ? (FXDIB_Format)(pbmi->bmiHeader.biBitCount + 0x200) : (FXDIB_Format)pbmi->bmiHeader.biBitCount;
- FX_BOOL ret = pBitmap->Create(width, height, format);
- if (!ret) {
- delete pBitmap;
- return NULL;
- }
- FXSYS_memcpy32(pBitmap->GetBuffer(), pData, pitch * height);
- if (bBottomUp) {
- FX_LPBYTE temp_buf = FX_Alloc(FX_BYTE, pitch);
- if (!temp_buf) {
- if (pBitmap) {
- delete pBitmap;
- }
- return NULL;
- }
- int top = 0, bottom = height - 1;
- while (top < bottom) {
- FXSYS_memcpy32(temp_buf, pBitmap->GetBuffer() + top * pitch, pitch);
- FXSYS_memcpy32(pBitmap->GetBuffer() + top * pitch, pBitmap->GetBuffer() + bottom * pitch, pitch);
- FXSYS_memcpy32(pBitmap->GetBuffer() + bottom * pitch, temp_buf, pitch);
- top ++;
- bottom --;
- }
- FX_Free(temp_buf);
- temp_buf = NULL;
- }
- if (pbmi->bmiHeader.biBitCount == 1) {
- for (int i = 0; i < 2; i ++) {
- pBitmap->SetPaletteEntry(i, ((FX_DWORD*)pbmi->bmiColors)[i] | 0xff000000);
- }
- } else if (pbmi->bmiHeader.biBitCount == 8) {
- for (int i = 0; i < 256; i ++) {
- pBitmap->SetPaletteEntry(i, ((FX_DWORD*)pbmi->bmiColors)[i] | 0xff000000);
- }
- }
- return pBitmap;
-}
-CFX_DIBitmap* CFX_WindowsDIB::LoadFromBuf(BITMAPINFO* pbmi, LPVOID pData)
-{
- return _FX_WindowsDIB_LoadFromBuf(pbmi, pData, FALSE);
-}
-HBITMAP CFX_WindowsDIB::GetDDBitmap(const CFX_DIBitmap* pBitmap, HDC hDC)
-{
- CFX_ByteString info = GetBitmapInfo(pBitmap);
- HBITMAP hBitmap = NULL;
- hBitmap = CreateDIBitmap(hDC, (BITMAPINFOHEADER*)(FX_LPCSTR)info, CBM_INIT,
- pBitmap->GetBuffer(), (BITMAPINFO*)(FX_LPCSTR)info, DIB_RGB_COLORS);
- return hBitmap;
-}
-void GetBitmapSize(HBITMAP hBitmap, int& w, int& h)
-{
- BITMAP bmp;
- GetObject(hBitmap, sizeof bmp, &bmp);
- w = bmp.bmWidth;
- h = bmp.bmHeight;
-}
-CFX_DIBitmap* CFX_WindowsDIB::LoadFromFile(FX_LPCWSTR filename)
-{
- CWin32Platform* pPlatform = (CWin32Platform*)CFX_GEModule::Get()->GetPlatformData();
- if (pPlatform->m_GdiplusExt.IsAvailable()) {
- WINDIB_Open_Args_ args;
- args.flags = WINDIB_OPEN_PATHNAME;
- args.path_name = filename;
- return pPlatform->m_GdiplusExt.LoadDIBitmap(args);
- }
- HBITMAP hBitmap = (HBITMAP)LoadImageW(NULL, (wchar_t*)filename, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
- if (hBitmap == NULL) {
- return NULL;
- }
- HDC hDC = CreateCompatibleDC(NULL);
- int width, height;
- GetBitmapSize(hBitmap, width, height);
- CFX_DIBitmap* pDIBitmap = FX_NEW CFX_DIBitmap;
- if (!pDIBitmap) {
- DeleteDC(hDC);
- return NULL;
- }
- if (!pDIBitmap->Create(width, height, FXDIB_Rgb)) {
- delete pDIBitmap;
- DeleteDC(hDC);
- return NULL;
- }
- CFX_ByteString info = GetBitmapInfo(pDIBitmap);
- int ret = GetDIBits(hDC, hBitmap, 0, height, pDIBitmap->GetBuffer(), (BITMAPINFO*)(FX_LPCSTR)info, DIB_RGB_COLORS);
- if (!ret) {
- if (pDIBitmap) {
- delete pDIBitmap;
- }
- pDIBitmap = NULL;
- }
- DeleteDC(hDC);
- return pDIBitmap;
-}
-CFX_DIBitmap* CFX_WindowsDIB::LoadDIBitmap(WINDIB_Open_Args_ args)
-{
- CWin32Platform* pPlatform = (CWin32Platform*)CFX_GEModule::Get()->GetPlatformData();
- if (pPlatform->m_GdiplusExt.IsAvailable()) {
- return pPlatform->m_GdiplusExt.LoadDIBitmap(args);
- } else if (args.flags == WINDIB_OPEN_MEMORY) {
- return NULL;
- }
- HBITMAP hBitmap = (HBITMAP)LoadImageW(NULL, (wchar_t*)args.path_name, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
- if (hBitmap == NULL) {
- return NULL;
- }
- HDC hDC = CreateCompatibleDC(NULL);
- int width, height;
- GetBitmapSize(hBitmap, width, height);
- CFX_DIBitmap* pDIBitmap = FX_NEW CFX_DIBitmap;
- if (!pDIBitmap) {
- DeleteDC(hDC);
- return NULL;
- }
- if (!pDIBitmap->Create(width, height, FXDIB_Rgb)) {
- delete pDIBitmap;
- DeleteDC(hDC);
- return NULL;
- }
- CFX_ByteString info = GetBitmapInfo(pDIBitmap);
- int ret = GetDIBits(hDC, hBitmap, 0, height, pDIBitmap->GetBuffer(), (BITMAPINFO*)(FX_LPCSTR)info, DIB_RGB_COLORS);
- if (!ret) {
- if (pDIBitmap) {
- delete pDIBitmap;
- }
- pDIBitmap = NULL;
- }
- DeleteDC(hDC);
- return pDIBitmap;
-}
-CFX_DIBitmap* CFX_WindowsDIB::LoadFromDDB(HDC hDC, HBITMAP hBitmap, FX_DWORD* pPalette, FX_DWORD palsize)
-{
- FX_BOOL bCreatedDC = hDC == NULL;
- if (hDC == NULL) {
- hDC = CreateCompatibleDC(NULL);
- }
- BITMAPINFOHEADER bmih;
- FXSYS_memset32(&bmih, 0, sizeof bmih);
- bmih.biSize = sizeof bmih;
- GetDIBits(hDC, hBitmap, 0, 0, NULL, (BITMAPINFO*)&bmih, DIB_RGB_COLORS);
- int width = bmih.biWidth;
- int height = abs(bmih.biHeight);
- bmih.biHeight = -height;
- bmih.biCompression = BI_RGB;
- CFX_DIBitmap* pDIBitmap = FX_NEW CFX_DIBitmap;
- if (!pDIBitmap) {
- return NULL;
- }
- int ret = 0;
- if (bmih.biBitCount == 1 || bmih.biBitCount == 8) {
- int size = sizeof (BITMAPINFOHEADER) + 8;
- if (bmih.biBitCount == 8) {
- size += sizeof (FX_DWORD) * 254;
- }
- BITMAPINFO* pbmih = (BITMAPINFO*)FX_Alloc(FX_BYTE, size);
- if (!pbmih) {
- delete pDIBitmap;
- if (bCreatedDC) {
- DeleteDC(hDC);
- }
- return NULL;
- }
- FXSYS_memset32(pbmih, 0, sizeof (BITMAPINFOHEADER));
- pbmih->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
- pbmih->bmiHeader.biBitCount = bmih.biBitCount;
- pbmih->bmiHeader.biCompression = BI_RGB;
- pbmih->bmiHeader.biHeight = -height;
- pbmih->bmiHeader.biPlanes = 1;
- pbmih->bmiHeader.biWidth = bmih.biWidth;
- if (!pDIBitmap->Create(bmih.biWidth, height, bmih.biBitCount == 1 ? FXDIB_1bppRgb : FXDIB_8bppRgb)) {
- delete pDIBitmap;
- FX_Free(pbmih);
- if (bCreatedDC) {
- DeleteDC(hDC);
- }
- return NULL;
- }
- ret = GetDIBits(hDC, hBitmap, 0, height, pDIBitmap->GetBuffer(), (BITMAPINFO*)pbmih, DIB_RGB_COLORS);
- FX_Free(pbmih);
- pbmih = NULL;
- pDIBitmap->CopyPalette(pPalette, palsize);
- } else {
- if (bmih.biBitCount <= 24) {
- bmih.biBitCount = 24;
- } else {
- bmih.biBitCount = 32;
- }
- if (!pDIBitmap->Create(bmih.biWidth, height, bmih.biBitCount == 24 ? FXDIB_Rgb : FXDIB_Rgb32)) {
- delete pDIBitmap;
- if (bCreatedDC) {
- DeleteDC(hDC);
- }
- return NULL;
- }
- ret = GetDIBits(hDC, hBitmap, 0, height, pDIBitmap->GetBuffer(), (BITMAPINFO*)&bmih, DIB_RGB_COLORS);
- if (ret != 0 && bmih.biBitCount == 32) {
- int pitch = pDIBitmap->GetPitch();
- for (int row = 0; row < height; row ++) {
- FX_BYTE* dest_scan = (FX_BYTE*)(pDIBitmap->GetBuffer() + row * pitch);
- for (int col = 0; col < width; col++) {
- dest_scan[3] = 255;
- dest_scan += 4;
- }
- }
- }
- }
- if (ret == 0) {
- if (pDIBitmap) {
- delete pDIBitmap;
- }
- pDIBitmap = NULL;
- }
- if (bCreatedDC) {
- DeleteDC(hDC);
- }
- return pDIBitmap;
-}
-CFX_WindowsDIB::CFX_WindowsDIB(HDC hDC, int width, int height)
-{
- Create(width, height, FXDIB_Rgb, (FX_LPBYTE)1);
- BITMAPINFOHEADER bmih;
- FXSYS_memset32(&bmih, 0, sizeof bmih);
- bmih.biSize = sizeof bmih;
- bmih.biBitCount = 24;
- bmih.biHeight = -height;
- bmih.biPlanes = 1;
- bmih.biWidth = width;
- m_hBitmap = CreateDIBSection(hDC, (BITMAPINFO*)&bmih, DIB_RGB_COLORS, (LPVOID*)&m_pBuffer, NULL, 0);
- m_hMemDC = CreateCompatibleDC(hDC);
- m_hOldBitmap = (HBITMAP)SelectObject(m_hMemDC, m_hBitmap);
-}
-CFX_WindowsDIB::~CFX_WindowsDIB()
-{
- SelectObject(m_hMemDC, m_hOldBitmap);
- DeleteDC(m_hMemDC);
- DeleteObject(m_hBitmap);
-}
-void CFX_WindowsDIB::LoadFromDevice(HDC hDC, int left, int top)
-{
- ::BitBlt(m_hMemDC, 0, 0, m_Width, m_Height, hDC, left, top, SRCCOPY);
-}
-void CFX_WindowsDIB::SetToDevice(HDC hDC, int left, int top)
-{
- ::BitBlt(hDC, left, top, m_Width, m_Height, m_hMemDC, 0, 0, SRCCOPY);
-}
-#endif
+// 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
+
+#include "../../../include/fxge/fx_ge.h"
+#if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_
+#include <windows.h>
+#include "../../../include/fxge/fx_ge_win32.h"
+#include "win32_int.h"
+CFX_ByteString CFX_WindowsDIB::GetBitmapInfo(const CFX_DIBitmap* pBitmap)
+{
+ CFX_ByteString result;
+ int len = sizeof (BITMAPINFOHEADER);
+ if (pBitmap->GetBPP() == 1 || pBitmap->GetBPP() == 8) {
+ len += sizeof (DWORD) * (int)(1 << pBitmap->GetBPP());
+ }
+ BITMAPINFOHEADER* pbmih = (BITMAPINFOHEADER*)result.GetBuffer(len);
+ FXSYS_memset32(pbmih, 0, sizeof (BITMAPINFOHEADER));
+ pbmih->biSize = sizeof(BITMAPINFOHEADER);
+ pbmih->biBitCount = pBitmap->GetBPP();
+ pbmih->biCompression = BI_RGB;
+ pbmih->biHeight = -(int)pBitmap->GetHeight();
+ pbmih->biPlanes = 1;
+ pbmih->biWidth = pBitmap->GetWidth();
+ if (pBitmap->GetBPP() == 8) {
+ FX_DWORD* pPalette = (FX_DWORD*)(pbmih + 1);
+ if (pBitmap->GetPalette() == NULL) {
+ for (int i = 0; i < 256; i ++) {
+ pPalette[i] = i * 0x010101;
+ }
+ } else {
+ for (int i = 0; i < 256; i ++) {
+ pPalette[i] = pBitmap->GetPalette()[i];
+ }
+ }
+ }
+ if (pBitmap->GetBPP() == 1) {
+ FX_DWORD* pPalette = (FX_DWORD*)(pbmih + 1);
+ if (pBitmap->GetPalette() == NULL) {
+ pPalette[0] = 0;
+ pPalette[1] = 0xffffff;
+ } else {
+ pPalette[0] = pBitmap->GetPalette()[0];
+ pPalette[1] = pBitmap->GetPalette()[1];
+ }
+ }
+ result.ReleaseBuffer(len);
+ return result;
+}
+CFX_DIBitmap* _FX_WindowsDIB_LoadFromBuf(BITMAPINFO* pbmi, LPVOID pData, FX_BOOL bAlpha)
+{
+ int width = pbmi->bmiHeader.biWidth;
+ int height = pbmi->bmiHeader.biHeight;
+ BOOL bBottomUp = TRUE;
+ if (height < 0) {
+ height = -height;
+ bBottomUp = FALSE;
+ }
+ int pitch = (width * pbmi->bmiHeader.biBitCount + 31) / 32 * 4;
+ CFX_DIBitmap* pBitmap = FX_NEW CFX_DIBitmap;
+ if (!pBitmap) {
+ return NULL;
+ }
+ FXDIB_Format format = bAlpha ? (FXDIB_Format)(pbmi->bmiHeader.biBitCount + 0x200) : (FXDIB_Format)pbmi->bmiHeader.biBitCount;
+ FX_BOOL ret = pBitmap->Create(width, height, format);
+ if (!ret) {
+ delete pBitmap;
+ return NULL;
+ }
+ FXSYS_memcpy32(pBitmap->GetBuffer(), pData, pitch * height);
+ if (bBottomUp) {
+ FX_LPBYTE temp_buf = FX_Alloc(FX_BYTE, pitch);
+ if (!temp_buf) {
+ if (pBitmap) {
+ delete pBitmap;
+ }
+ return NULL;
+ }
+ int top = 0, bottom = height - 1;
+ while (top < bottom) {
+ FXSYS_memcpy32(temp_buf, pBitmap->GetBuffer() + top * pitch, pitch);
+ FXSYS_memcpy32(pBitmap->GetBuffer() + top * pitch, pBitmap->GetBuffer() + bottom * pitch, pitch);
+ FXSYS_memcpy32(pBitmap->GetBuffer() + bottom * pitch, temp_buf, pitch);
+ top ++;
+ bottom --;
+ }
+ FX_Free(temp_buf);
+ temp_buf = NULL;
+ }
+ if (pbmi->bmiHeader.biBitCount == 1) {
+ for (int i = 0; i < 2; i ++) {
+ pBitmap->SetPaletteEntry(i, ((FX_DWORD*)pbmi->bmiColors)[i] | 0xff000000);
+ }
+ } else if (pbmi->bmiHeader.biBitCount == 8) {
+ for (int i = 0; i < 256; i ++) {
+ pBitmap->SetPaletteEntry(i, ((FX_DWORD*)pbmi->bmiColors)[i] | 0xff000000);
+ }
+ }
+ return pBitmap;
+}
+CFX_DIBitmap* CFX_WindowsDIB::LoadFromBuf(BITMAPINFO* pbmi, LPVOID pData)
+{
+ return _FX_WindowsDIB_LoadFromBuf(pbmi, pData, FALSE);
+}
+HBITMAP CFX_WindowsDIB::GetDDBitmap(const CFX_DIBitmap* pBitmap, HDC hDC)
+{
+ CFX_ByteString info = GetBitmapInfo(pBitmap);
+ HBITMAP hBitmap = NULL;
+ hBitmap = CreateDIBitmap(hDC, (BITMAPINFOHEADER*)(FX_LPCSTR)info, CBM_INIT,
+ pBitmap->GetBuffer(), (BITMAPINFO*)(FX_LPCSTR)info, DIB_RGB_COLORS);
+ return hBitmap;
+}
+void GetBitmapSize(HBITMAP hBitmap, int& w, int& h)
+{
+ BITMAP bmp;
+ GetObject(hBitmap, sizeof bmp, &bmp);
+ w = bmp.bmWidth;
+ h = bmp.bmHeight;
+}
+CFX_DIBitmap* CFX_WindowsDIB::LoadFromFile(FX_LPCWSTR filename)
+{
+ CWin32Platform* pPlatform = (CWin32Platform*)CFX_GEModule::Get()->GetPlatformData();
+ if (pPlatform->m_GdiplusExt.IsAvailable()) {
+ WINDIB_Open_Args_ args;
+ args.flags = WINDIB_OPEN_PATHNAME;
+ args.path_name = filename;
+ return pPlatform->m_GdiplusExt.LoadDIBitmap(args);
+ }
+ HBITMAP hBitmap = (HBITMAP)LoadImageW(NULL, (wchar_t*)filename, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
+ if (hBitmap == NULL) {
+ return NULL;
+ }
+ HDC hDC = CreateCompatibleDC(NULL);
+ int width, height;
+ GetBitmapSize(hBitmap, width, height);
+ CFX_DIBitmap* pDIBitmap = FX_NEW CFX_DIBitmap;
+ if (!pDIBitmap) {
+ DeleteDC(hDC);
+ return NULL;
+ }
+ if (!pDIBitmap->Create(width, height, FXDIB_Rgb)) {
+ delete pDIBitmap;
+ DeleteDC(hDC);
+ return NULL;
+ }
+ CFX_ByteString info = GetBitmapInfo(pDIBitmap);
+ int ret = GetDIBits(hDC, hBitmap, 0, height, pDIBitmap->GetBuffer(), (BITMAPINFO*)(FX_LPCSTR)info, DIB_RGB_COLORS);
+ if (!ret) {
+ if (pDIBitmap) {
+ delete pDIBitmap;
+ }
+ pDIBitmap = NULL;
+ }
+ DeleteDC(hDC);
+ return pDIBitmap;
+}
+CFX_DIBitmap* CFX_WindowsDIB::LoadDIBitmap(WINDIB_Open_Args_ args)
+{
+ CWin32Platform* pPlatform = (CWin32Platform*)CFX_GEModule::Get()->GetPlatformData();
+ if (pPlatform->m_GdiplusExt.IsAvailable()) {
+ return pPlatform->m_GdiplusExt.LoadDIBitmap(args);
+ } else if (args.flags == WINDIB_OPEN_MEMORY) {
+ return NULL;
+ }
+ HBITMAP hBitmap = (HBITMAP)LoadImageW(NULL, (wchar_t*)args.path_name, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
+ if (hBitmap == NULL) {
+ return NULL;
+ }
+ HDC hDC = CreateCompatibleDC(NULL);
+ int width, height;
+ GetBitmapSize(hBitmap, width, height);
+ CFX_DIBitmap* pDIBitmap = FX_NEW CFX_DIBitmap;
+ if (!pDIBitmap) {
+ DeleteDC(hDC);
+ return NULL;
+ }
+ if (!pDIBitmap->Create(width, height, FXDIB_Rgb)) {
+ delete pDIBitmap;
+ DeleteDC(hDC);
+ return NULL;
+ }
+ CFX_ByteString info = GetBitmapInfo(pDIBitmap);
+ int ret = GetDIBits(hDC, hBitmap, 0, height, pDIBitmap->GetBuffer(), (BITMAPINFO*)(FX_LPCSTR)info, DIB_RGB_COLORS);
+ if (!ret) {
+ if (pDIBitmap) {
+ delete pDIBitmap;
+ }
+ pDIBitmap = NULL;
+ }
+ DeleteDC(hDC);
+ return pDIBitmap;
+}
+CFX_DIBitmap* CFX_WindowsDIB::LoadFromDDB(HDC hDC, HBITMAP hBitmap, FX_DWORD* pPalette, FX_DWORD palsize)
+{
+ FX_BOOL bCreatedDC = hDC == NULL;
+ if (hDC == NULL) {
+ hDC = CreateCompatibleDC(NULL);
+ }
+ BITMAPINFOHEADER bmih;
+ FXSYS_memset32(&bmih, 0, sizeof bmih);
+ bmih.biSize = sizeof bmih;
+ GetDIBits(hDC, hBitmap, 0, 0, NULL, (BITMAPINFO*)&bmih, DIB_RGB_COLORS);
+ int width = bmih.biWidth;
+ int height = abs(bmih.biHeight);
+ bmih.biHeight = -height;
+ bmih.biCompression = BI_RGB;
+ CFX_DIBitmap* pDIBitmap = FX_NEW CFX_DIBitmap;
+ if (!pDIBitmap) {
+ return NULL;
+ }
+ int ret = 0;
+ if (bmih.biBitCount == 1 || bmih.biBitCount == 8) {
+ int size = sizeof (BITMAPINFOHEADER) + 8;
+ if (bmih.biBitCount == 8) {
+ size += sizeof (FX_DWORD) * 254;
+ }
+ BITMAPINFO* pbmih = (BITMAPINFO*)FX_Alloc(FX_BYTE, size);
+ if (!pbmih) {
+ delete pDIBitmap;
+ if (bCreatedDC) {
+ DeleteDC(hDC);
+ }
+ return NULL;
+ }
+ FXSYS_memset32(pbmih, 0, sizeof (BITMAPINFOHEADER));
+ pbmih->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
+ pbmih->bmiHeader.biBitCount = bmih.biBitCount;
+ pbmih->bmiHeader.biCompression = BI_RGB;
+ pbmih->bmiHeader.biHeight = -height;
+ pbmih->bmiHeader.biPlanes = 1;
+ pbmih->bmiHeader.biWidth = bmih.biWidth;
+ if (!pDIBitmap->Create(bmih.biWidth, height, bmih.biBitCount == 1 ? FXDIB_1bppRgb : FXDIB_8bppRgb)) {
+ delete pDIBitmap;
+ FX_Free(pbmih);
+ if (bCreatedDC) {
+ DeleteDC(hDC);
+ }
+ return NULL;
+ }
+ ret = GetDIBits(hDC, hBitmap, 0, height, pDIBitmap->GetBuffer(), (BITMAPINFO*)pbmih, DIB_RGB_COLORS);
+ FX_Free(pbmih);
+ pbmih = NULL;
+ pDIBitmap->CopyPalette(pPalette, palsize);
+ } else {
+ if (bmih.biBitCount <= 24) {
+ bmih.biBitCount = 24;
+ } else {
+ bmih.biBitCount = 32;
+ }
+ if (!pDIBitmap->Create(bmih.biWidth, height, bmih.biBitCount == 24 ? FXDIB_Rgb : FXDIB_Rgb32)) {
+ delete pDIBitmap;
+ if (bCreatedDC) {
+ DeleteDC(hDC);
+ }
+ return NULL;
+ }
+ ret = GetDIBits(hDC, hBitmap, 0, height, pDIBitmap->GetBuffer(), (BITMAPINFO*)&bmih, DIB_RGB_COLORS);
+ if (ret != 0 && bmih.biBitCount == 32) {
+ int pitch = pDIBitmap->GetPitch();
+ for (int row = 0; row < height; row ++) {
+ FX_BYTE* dest_scan = (FX_BYTE*)(pDIBitmap->GetBuffer() + row * pitch);
+ for (int col = 0; col < width; col++) {
+ dest_scan[3] = 255;
+ dest_scan += 4;
+ }
+ }
+ }
+ }
+ if (ret == 0) {
+ if (pDIBitmap) {
+ delete pDIBitmap;
+ }
+ pDIBitmap = NULL;
+ }
+ if (bCreatedDC) {
+ DeleteDC(hDC);
+ }
+ return pDIBitmap;
+}
+CFX_WindowsDIB::CFX_WindowsDIB(HDC hDC, int width, int height)
+{
+ Create(width, height, FXDIB_Rgb, (FX_LPBYTE)1);
+ BITMAPINFOHEADER bmih;
+ FXSYS_memset32(&bmih, 0, sizeof bmih);
+ bmih.biSize = sizeof bmih;
+ bmih.biBitCount = 24;
+ bmih.biHeight = -height;
+ bmih.biPlanes = 1;
+ bmih.biWidth = width;
+ m_hBitmap = CreateDIBSection(hDC, (BITMAPINFO*)&bmih, DIB_RGB_COLORS, (LPVOID*)&m_pBuffer, NULL, 0);
+ m_hMemDC = CreateCompatibleDC(hDC);
+ m_hOldBitmap = (HBITMAP)SelectObject(m_hMemDC, m_hBitmap);
+}
+CFX_WindowsDIB::~CFX_WindowsDIB()
+{
+ SelectObject(m_hMemDC, m_hOldBitmap);
+ DeleteDC(m_hMemDC);
+ DeleteObject(m_hBitmap);
+}
+void CFX_WindowsDIB::LoadFromDevice(HDC hDC, int left, int top)
+{
+ ::BitBlt(m_hMemDC, 0, 0, m_Width, m_Height, hDC, left, top, SRCCOPY);
+}
+void CFX_WindowsDIB::SetToDevice(HDC hDC, int left, int top)
+{
+ ::BitBlt(hDC, left, top, m_Width, m_Height, m_hMemDC, 0, 0, SRCCOPY);
+}
+#endif
diff --git a/core/src/fxge/win32/fx_win32_dwrite.cpp b/core/src/fxge/win32/fx_win32_dwrite.cpp
index d4c962036e..2c275a88c8 100644
--- a/core/src/fxge/win32/fx_win32_dwrite.cpp
+++ b/core/src/fxge/win32/fx_win32_dwrite.cpp
@@ -1,480 +1,480 @@
-// 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
-
-#include "../../../include/fxge/fx_ge.h"
-#if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_
-#include "../../../include/fxge/fx_ge_win32.h"
-#include "dwrite_int.h"
-#include "../Microsoft SDK/include/DWrite.h"
-typedef HRESULT (__stdcall *FuncType_DWriteCreateFactory)(__in DWRITE_FACTORY_TYPE, __in REFIID, __out IUnknown **);
-template <typename InterfaceType>
-inline void SafeRelease(InterfaceType** currentObject)
-{
- if (*currentObject != NULL) {
- (*currentObject)->Release();
- *currentObject = NULL;
- }
-}
-template <typename InterfaceType>
-inline InterfaceType* SafeAcquire(InterfaceType* newObject)
-{
- if (newObject != NULL) {
- newObject->AddRef();
- }
- return newObject;
-}
-class CDwFontFileStream : public IDWriteFontFileStream, public CFX_Object
-{
-public:
- explicit CDwFontFileStream(void const* fontFileReferenceKey, UINT32 fontFileReferenceKeySize);
- virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, void** ppvObject);
- virtual ULONG STDMETHODCALLTYPE AddRef();
- virtual ULONG STDMETHODCALLTYPE Release();
- virtual HRESULT STDMETHODCALLTYPE ReadFileFragment(void const** fragmentStart, UINT64 fileOffset, UINT64 fragmentSize, OUT void** fragmentContext);
- virtual void STDMETHODCALLTYPE ReleaseFileFragment(void* fragmentContext);
- virtual HRESULT STDMETHODCALLTYPE GetFileSize(OUT UINT64* fileSize);
- virtual HRESULT STDMETHODCALLTYPE GetLastWriteTime(OUT UINT64* lastWriteTime);
- bool IsInitialized()
- {
- return resourcePtr_ != NULL;
- }
-private:
- ULONG refCount_;
- void const* resourcePtr_;
- DWORD resourceSize_;
-};
-class CDwFontFileLoader : public IDWriteFontFileLoader, public CFX_Object
-{
-public:
- virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, void** ppvObject);
- virtual ULONG STDMETHODCALLTYPE AddRef();
- virtual ULONG STDMETHODCALLTYPE Release();
- virtual HRESULT STDMETHODCALLTYPE CreateStreamFromKey(void const* fontFileReferenceKey, UINT32 fontFileReferenceKeySize, OUT IDWriteFontFileStream** fontFileStream);
-
- static IDWriteFontFileLoader* GetLoader()
- {
- if (instance_ == NULL) {
- instance_ = FX_NEW CDwFontFileLoader();
- return instance_;
- }
- return instance_;
- }
- static bool IsLoaderInitialized()
- {
- return instance_ != NULL;
- }
-private:
- CDwFontFileLoader();
- ULONG refCount_;
- static IDWriteFontFileLoader* instance_;
-};
-class CDwFontContext : public CFX_Object
-{
-public:
- CDwFontContext(IDWriteFactory* dwriteFactory);
- ~CDwFontContext();
- HRESULT Initialize();
-private:
- CDwFontContext(CDwFontContext const&);
- void operator=(CDwFontContext const&);
- HRESULT hr_;
- IDWriteFactory* dwriteFactory_;
-};
-class CDwGdiTextRenderer : public CFX_Object
-{
-public:
- CDwGdiTextRenderer(
- CFX_DIBitmap* pBitmap,
- IDWriteBitmapRenderTarget* bitmapRenderTarget,
- IDWriteRenderingParams* renderingParams
- );
- CDwGdiTextRenderer::~CDwGdiTextRenderer();
- HRESULT STDMETHODCALLTYPE DrawGlyphRun(
- const FX_RECT& text_bbox,
- __in_opt CFX_ClipRgn* pClipRgn,
- __in_opt DWRITE_MATRIX const* pMatrix,
- FLOAT baselineOriginX,
- FLOAT baselineOriginY,
- DWRITE_MEASURING_MODE measuringMode,
- __in DWRITE_GLYPH_RUN const* glyphRun,
- const COLORREF& textColor
- );
-private:
- CFX_DIBitmap* pBitmap_;
- IDWriteBitmapRenderTarget* pRenderTarget_;
- IDWriteRenderingParams* pRenderingParams_;
-};
-CDWriteExt::CDWriteExt()
-{
- m_hModule = NULL;
- m_pDWriteFactory = NULL;
- m_pDwFontContext = NULL;
- m_pDwTextRenderer = NULL;
-}
-void CDWriteExt::Load()
-{
-}
-void CDWriteExt::Unload()
-{
- if (m_pDwFontContext) {
- delete (CDwFontContext*)m_pDwFontContext;
- m_pDwFontContext = NULL;
- }
- SafeRelease((IDWriteFactory**)&m_pDWriteFactory);
-}
-CDWriteExt::~CDWriteExt()
-{
- Unload();
-}
-LPVOID CDWriteExt::DwCreateFontFaceFromStream(FX_LPBYTE pData, FX_DWORD size, int simulation_style)
-{
- IDWriteFactory* pDwFactory = (IDWriteFactory*)m_pDWriteFactory;
- IDWriteFontFile* pDwFontFile = NULL;
- IDWriteFontFace* pDwFontFace = NULL;
- BOOL isSupportedFontType = FALSE;
- DWRITE_FONT_FILE_TYPE fontFileType;
- DWRITE_FONT_FACE_TYPE fontFaceType;
- UINT32 numberOfFaces;
- DWRITE_FONT_SIMULATIONS fontStyle = (DWRITE_FONT_SIMULATIONS)(simulation_style & 3);
- HRESULT hr = S_OK;
- hr = pDwFactory->CreateCustomFontFileReference(
- (void const*)pData,
- (UINT32)size,
- CDwFontFileLoader::GetLoader(),
- &pDwFontFile
- );
- if (FAILED(hr)) {
- goto failed;
- }
- hr = pDwFontFile->Analyze(
- &isSupportedFontType,
- &fontFileType,
- &fontFaceType,
- &numberOfFaces
- );
- if (FAILED(hr) || !isSupportedFontType || fontFaceType == DWRITE_FONT_FACE_TYPE_UNKNOWN) {
- goto failed;
- }
- hr = pDwFactory->CreateFontFace(
- fontFaceType,
- 1,
- &pDwFontFile,
- 0,
- fontStyle,
- &pDwFontFace
- );
- if (FAILED(hr)) {
- goto failed;
- }
- SafeRelease(&pDwFontFile);
- return pDwFontFace;
-failed:
- SafeRelease(&pDwFontFile);
- return NULL;
-}
-FX_BOOL CDWriteExt::DwCreateRenderingTarget(CFX_DIBitmap* pBitmap, void** renderTarget)
-{
- if (pBitmap->GetFormat() > FXDIB_Argb) {
- return FALSE;
- }
- IDWriteFactory* pDwFactory = (IDWriteFactory*)m_pDWriteFactory;
- IDWriteGdiInterop* pGdiInterop = NULL;
- IDWriteBitmapRenderTarget* pBitmapRenderTarget = NULL;
- IDWriteRenderingParams* pRenderingParams = NULL;
- HRESULT hr = S_OK;
- hr = pDwFactory->GetGdiInterop(&pGdiInterop);
- if (FAILED(hr)) {
- goto failed;
- }
- hr = pGdiInterop->CreateBitmapRenderTarget(NULL, pBitmap->GetWidth(), pBitmap->GetHeight(),
- &pBitmapRenderTarget);
- if (FAILED(hr)) {
- goto failed;
- }
- hr = pDwFactory->CreateCustomRenderingParams(
- 1.0f,
- 0.0f,
- 1.0f,
- DWRITE_PIXEL_GEOMETRY_RGB,
- DWRITE_RENDERING_MODE_DEFAULT,
- &pRenderingParams
- );
- if (FAILED(hr)) {
- goto failed;
- }
- hr = pBitmapRenderTarget->SetPixelsPerDip(1.0f);
- if (FAILED(hr)) {
- goto failed;
- }
- *(CDwGdiTextRenderer**)renderTarget = FX_NEW CDwGdiTextRenderer(pBitmap, pBitmapRenderTarget, pRenderingParams);
- if (*(CDwGdiTextRenderer**)renderTarget == NULL) {
- goto failed;
- }
- SafeRelease(&pGdiInterop);
- SafeRelease(&pBitmapRenderTarget);
- SafeRelease(&pRenderingParams);
- return TRUE;
-failed:
- SafeRelease(&pGdiInterop);
- SafeRelease(&pBitmapRenderTarget);
- SafeRelease(&pRenderingParams);
- return FALSE;
-}
-FX_BOOL CDWriteExt::DwRendingString(void* renderTarget, CFX_ClipRgn* pClipRgn, FX_RECT& stringRect, CFX_AffineMatrix* pMatrix,
- void *font, FX_FLOAT font_size, FX_ARGB text_color,
- int glyph_count, unsigned short* glyph_indices,
- FX_FLOAT baselineOriginX, FX_FLOAT baselineOriginY,
- void* glyph_offsets,
- FX_FLOAT* glyph_advances)
-{
- if (renderTarget == NULL) {
- return TRUE;
- }
- CDwGdiTextRenderer* pTextRenderer = (CDwGdiTextRenderer*)renderTarget;
- DWRITE_MATRIX transform;
- DWRITE_GLYPH_RUN glyphRun;
- HRESULT hr = S_OK;
- if (pMatrix) {
- transform.m11 = pMatrix->a;
- transform.m12 = pMatrix->b;
- transform.m21 = pMatrix->c;
- transform.m22 = pMatrix->d;
- transform.dx = pMatrix->e;
- transform.dy = pMatrix->f;
- }
- glyphRun.fontFace = (IDWriteFontFace*)font;
- glyphRun.fontEmSize = font_size;
- glyphRun.glyphCount = glyph_count;
- glyphRun.glyphIndices = glyph_indices;
- glyphRun.glyphAdvances = glyph_advances;
- glyphRun.glyphOffsets = (DWRITE_GLYPH_OFFSET*)glyph_offsets;
- glyphRun.isSideways = FALSE;
- glyphRun.bidiLevel = 0;
- hr = pTextRenderer->DrawGlyphRun(
- stringRect,
- pClipRgn,
- pMatrix ? &transform : NULL,
- baselineOriginX, baselineOriginY,
- DWRITE_MEASURING_MODE_NATURAL,
- &glyphRun,
- RGB(FXARGB_R(text_color), FXARGB_G(text_color), FXARGB_B(text_color))
- );
- return SUCCEEDED(hr) ? TRUE : FALSE;
-}
-void CDWriteExt::DwDeleteRenderingTarget(void* renderTarget)
-{
- if (renderTarget) {
- delete (CDwGdiTextRenderer*)renderTarget;
- }
-}
-void CDWriteExt::DwDeleteFont(void* pFont)
-{
- if (pFont) {
- SafeRelease((IDWriteFontFace**)&pFont);
- }
-}
-CDwFontFileStream::CDwFontFileStream(void const* fontFileReferenceKey, UINT32 fontFileReferenceKeySize)
-{
- refCount_ = 0;
- resourcePtr_ = fontFileReferenceKey;
- resourceSize_ = fontFileReferenceKeySize;
-}
-HRESULT STDMETHODCALLTYPE CDwFontFileStream::QueryInterface(REFIID iid, void** ppvObject)
-{
- if (iid == IID_IUnknown || iid == __uuidof(IDWriteFontFileStream)) {
- *ppvObject = this;
- AddRef();
- return S_OK;
- } else {
- *ppvObject = NULL;
- return E_NOINTERFACE;
- }
-}
-ULONG STDMETHODCALLTYPE CDwFontFileStream::AddRef()
-{
- return InterlockedIncrement((long*)(&refCount_));
-}
-ULONG STDMETHODCALLTYPE CDwFontFileStream::Release()
-{
- ULONG newCount = InterlockedDecrement((long*)(&refCount_));
- if (newCount == 0) {
- delete this;
- }
- return newCount;
-}
-HRESULT STDMETHODCALLTYPE CDwFontFileStream::ReadFileFragment(
- void const** fragmentStart,
- UINT64 fileOffset,
- UINT64 fragmentSize,
- OUT void** fragmentContext
-)
-{
- if (fileOffset <= resourceSize_ &&
- fragmentSize <= resourceSize_ - fileOffset) {
- *fragmentStart = static_cast<FX_BYTE const*>(resourcePtr_) + static_cast<size_t>(fileOffset);
- *fragmentContext = NULL;
- return S_OK;
- } else {
- *fragmentStart = NULL;
- *fragmentContext = NULL;
- return E_FAIL;
- }
-}
-void STDMETHODCALLTYPE CDwFontFileStream::ReleaseFileFragment(void* fragmentContext)
-{
-}
-HRESULT STDMETHODCALLTYPE CDwFontFileStream::GetFileSize(OUT UINT64* fileSize)
-{
- *fileSize = resourceSize_;
- return S_OK;
-}
-HRESULT STDMETHODCALLTYPE CDwFontFileStream::GetLastWriteTime(OUT UINT64* lastWriteTime)
-{
- *lastWriteTime = 0;
- return E_NOTIMPL;
-}
-IDWriteFontFileLoader* CDwFontFileLoader::instance_ = NULL;
-CDwFontFileLoader::CDwFontFileLoader() :
- refCount_(0)
-{
-}
-HRESULT STDMETHODCALLTYPE CDwFontFileLoader::QueryInterface(REFIID iid, void** ppvObject)
-{
- if (iid == IID_IUnknown || iid == __uuidof(IDWriteFontFileLoader)) {
- *ppvObject = this;
- AddRef();
- return S_OK;
- } else {
- *ppvObject = NULL;
- return E_NOINTERFACE;
- }
-}
-ULONG STDMETHODCALLTYPE CDwFontFileLoader::AddRef()
-{
- return InterlockedIncrement((long*)(&refCount_));
-}
-ULONG STDMETHODCALLTYPE CDwFontFileLoader::Release()
-{
- ULONG newCount = InterlockedDecrement((long*)(&refCount_));
- if (newCount == 0) {
- instance_ = NULL;
- delete this;
- }
- return newCount;
-}
-HRESULT STDMETHODCALLTYPE CDwFontFileLoader::CreateStreamFromKey(
- void const* fontFileReferenceKey,
- UINT32 fontFileReferenceKeySize,
- OUT IDWriteFontFileStream** fontFileStream
-)
-{
- *fontFileStream = NULL;
- CDwFontFileStream* stream = FX_NEW CDwFontFileStream(fontFileReferenceKey, fontFileReferenceKeySize);
- if (stream == NULL) {
- return E_OUTOFMEMORY;
- }
- if (!stream->IsInitialized()) {
- delete stream;
- return E_FAIL;
- }
- *fontFileStream = SafeAcquire(stream);
- return S_OK;
-}
-CDwFontContext::CDwFontContext(IDWriteFactory* dwriteFactory) :
- hr_(S_FALSE),
- dwriteFactory_(SafeAcquire(dwriteFactory))
-{
-}
-CDwFontContext::~CDwFontContext()
-{
- if(dwriteFactory_ && hr_ == S_OK) {
- dwriteFactory_->UnregisterFontFileLoader(CDwFontFileLoader::GetLoader());
- }
- SafeRelease(&dwriteFactory_);
-}
-HRESULT CDwFontContext::Initialize()
-{
- if (hr_ == S_FALSE) {
- return hr_ = dwriteFactory_->RegisterFontFileLoader(CDwFontFileLoader::GetLoader());
- }
- return hr_;
-}
-CDwGdiTextRenderer::CDwGdiTextRenderer(CFX_DIBitmap* pBitmap, IDWriteBitmapRenderTarget* bitmapRenderTarget, IDWriteRenderingParams* renderingParams):
- pBitmap_(pBitmap),
- pRenderTarget_(SafeAcquire(bitmapRenderTarget)),
- pRenderingParams_(SafeAcquire(renderingParams))
-{
-}
-CDwGdiTextRenderer::~CDwGdiTextRenderer()
-{
- SafeRelease(&pRenderTarget_);
- SafeRelease(&pRenderingParams_);
-}
-STDMETHODIMP CDwGdiTextRenderer::DrawGlyphRun(
- const FX_RECT& text_bbox,
- __in_opt CFX_ClipRgn* pClipRgn,
- __in_opt DWRITE_MATRIX const* pMatrix,
- FLOAT baselineOriginX,
- FLOAT baselineOriginY,
- DWRITE_MEASURING_MODE measuringMode,
- __in DWRITE_GLYPH_RUN const* glyphRun,
- const COLORREF& textColor
-)
-{
- HRESULT hr = S_OK;
- if (pMatrix) {
- hr = pRenderTarget_->SetCurrentTransform(pMatrix);
- if (FAILED(hr)) {
- return hr;
- }
- }
- HDC hDC = pRenderTarget_->GetMemoryDC();
- HBITMAP hBitmap = (HBITMAP)::GetCurrentObject(hDC, OBJ_BITMAP);
- BITMAP bitmap;
- GetObject(hBitmap, sizeof bitmap, &bitmap);
- CFX_DIBitmap dib;
- dib.Create(
- bitmap.bmWidth,
- bitmap.bmHeight,
- bitmap.bmBitsPixel == 24 ? FXDIB_Rgb : FXDIB_Rgb32,
- (FX_LPBYTE)bitmap.bmBits
- );
- dib.CompositeBitmap(
- text_bbox.left,
- text_bbox.top,
- text_bbox.Width(),
- text_bbox.Height(),
- pBitmap_,
- text_bbox.left,
- text_bbox.top,
- FXDIB_BLEND_NORMAL,
- NULL
- );
- hr = pRenderTarget_->DrawGlyphRun(
- baselineOriginX,
- baselineOriginY,
- measuringMode,
- glyphRun,
- pRenderingParams_,
- textColor
- );
- if (FAILED(hr)) {
- return hr;
- }
- pBitmap_->CompositeBitmap(
- text_bbox.left,
- text_bbox.top,
- text_bbox.Width(),
- text_bbox.Height(),
- &dib,
- text_bbox.left,
- text_bbox.top,
- FXDIB_BLEND_NORMAL,
- pClipRgn
- );
- return hr;
-}
-#endif
+// 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
+
+#include "../../../include/fxge/fx_ge.h"
+#if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_
+#include "../../../include/fxge/fx_ge_win32.h"
+#include "dwrite_int.h"
+#include "../Microsoft SDK/include/DWrite.h"
+typedef HRESULT (__stdcall *FuncType_DWriteCreateFactory)(__in DWRITE_FACTORY_TYPE, __in REFIID, __out IUnknown **);
+template <typename InterfaceType>
+inline void SafeRelease(InterfaceType** currentObject)
+{
+ if (*currentObject != NULL) {
+ (*currentObject)->Release();
+ *currentObject = NULL;
+ }
+}
+template <typename InterfaceType>
+inline InterfaceType* SafeAcquire(InterfaceType* newObject)
+{
+ if (newObject != NULL) {
+ newObject->AddRef();
+ }
+ return newObject;
+}
+class CDwFontFileStream : public IDWriteFontFileStream, public CFX_Object
+{
+public:
+ explicit CDwFontFileStream(void const* fontFileReferenceKey, UINT32 fontFileReferenceKeySize);
+ virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, void** ppvObject);
+ virtual ULONG STDMETHODCALLTYPE AddRef();
+ virtual ULONG STDMETHODCALLTYPE Release();
+ virtual HRESULT STDMETHODCALLTYPE ReadFileFragment(void const** fragmentStart, UINT64 fileOffset, UINT64 fragmentSize, OUT void** fragmentContext);
+ virtual void STDMETHODCALLTYPE ReleaseFileFragment(void* fragmentContext);
+ virtual HRESULT STDMETHODCALLTYPE GetFileSize(OUT UINT64* fileSize);
+ virtual HRESULT STDMETHODCALLTYPE GetLastWriteTime(OUT UINT64* lastWriteTime);
+ bool IsInitialized()
+ {
+ return resourcePtr_ != NULL;
+ }
+private:
+ ULONG refCount_;
+ void const* resourcePtr_;
+ DWORD resourceSize_;
+};
+class CDwFontFileLoader : public IDWriteFontFileLoader, public CFX_Object
+{
+public:
+ virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, void** ppvObject);
+ virtual ULONG STDMETHODCALLTYPE AddRef();
+ virtual ULONG STDMETHODCALLTYPE Release();
+ virtual HRESULT STDMETHODCALLTYPE CreateStreamFromKey(void const* fontFileReferenceKey, UINT32 fontFileReferenceKeySize, OUT IDWriteFontFileStream** fontFileStream);
+
+ static IDWriteFontFileLoader* GetLoader()
+ {
+ if (instance_ == NULL) {
+ instance_ = FX_NEW CDwFontFileLoader();
+ return instance_;
+ }
+ return instance_;
+ }
+ static bool IsLoaderInitialized()
+ {
+ return instance_ != NULL;
+ }
+private:
+ CDwFontFileLoader();
+ ULONG refCount_;
+ static IDWriteFontFileLoader* instance_;
+};
+class CDwFontContext : public CFX_Object
+{
+public:
+ CDwFontContext(IDWriteFactory* dwriteFactory);
+ ~CDwFontContext();
+ HRESULT Initialize();
+private:
+ CDwFontContext(CDwFontContext const&);
+ void operator=(CDwFontContext const&);
+ HRESULT hr_;
+ IDWriteFactory* dwriteFactory_;
+};
+class CDwGdiTextRenderer : public CFX_Object
+{
+public:
+ CDwGdiTextRenderer(
+ CFX_DIBitmap* pBitmap,
+ IDWriteBitmapRenderTarget* bitmapRenderTarget,
+ IDWriteRenderingParams* renderingParams
+ );
+ CDwGdiTextRenderer::~CDwGdiTextRenderer();
+ HRESULT STDMETHODCALLTYPE DrawGlyphRun(
+ const FX_RECT& text_bbox,
+ __in_opt CFX_ClipRgn* pClipRgn,
+ __in_opt DWRITE_MATRIX const* pMatrix,
+ FLOAT baselineOriginX,
+ FLOAT baselineOriginY,
+ DWRITE_MEASURING_MODE measuringMode,
+ __in DWRITE_GLYPH_RUN const* glyphRun,
+ const COLORREF& textColor
+ );
+private:
+ CFX_DIBitmap* pBitmap_;
+ IDWriteBitmapRenderTarget* pRenderTarget_;
+ IDWriteRenderingParams* pRenderingParams_;
+};
+CDWriteExt::CDWriteExt()
+{
+ m_hModule = NULL;
+ m_pDWriteFactory = NULL;
+ m_pDwFontContext = NULL;
+ m_pDwTextRenderer = NULL;
+}
+void CDWriteExt::Load()
+{
+}
+void CDWriteExt::Unload()
+{
+ if (m_pDwFontContext) {
+ delete (CDwFontContext*)m_pDwFontContext;
+ m_pDwFontContext = NULL;
+ }
+ SafeRelease((IDWriteFactory**)&m_pDWriteFactory);
+}
+CDWriteExt::~CDWriteExt()
+{
+ Unload();
+}
+LPVOID CDWriteExt::DwCreateFontFaceFromStream(FX_LPBYTE pData, FX_DWORD size, int simulation_style)
+{
+ IDWriteFactory* pDwFactory = (IDWriteFactory*)m_pDWriteFactory;
+ IDWriteFontFile* pDwFontFile = NULL;
+ IDWriteFontFace* pDwFontFace = NULL;
+ BOOL isSupportedFontType = FALSE;
+ DWRITE_FONT_FILE_TYPE fontFileType;
+ DWRITE_FONT_FACE_TYPE fontFaceType;
+ UINT32 numberOfFaces;
+ DWRITE_FONT_SIMULATIONS fontStyle = (DWRITE_FONT_SIMULATIONS)(simulation_style & 3);
+ HRESULT hr = S_OK;
+ hr = pDwFactory->CreateCustomFontFileReference(
+ (void const*)pData,
+ (UINT32)size,
+ CDwFontFileLoader::GetLoader(),
+ &pDwFontFile
+ );
+ if (FAILED(hr)) {
+ goto failed;
+ }
+ hr = pDwFontFile->Analyze(
+ &isSupportedFontType,
+ &fontFileType,
+ &fontFaceType,
+ &numberOfFaces
+ );
+ if (FAILED(hr) || !isSupportedFontType || fontFaceType == DWRITE_FONT_FACE_TYPE_UNKNOWN) {
+ goto failed;
+ }
+ hr = pDwFactory->CreateFontFace(
+ fontFaceType,
+ 1,
+ &pDwFontFile,
+ 0,
+ fontStyle,
+ &pDwFontFace
+ );
+ if (FAILED(hr)) {
+ goto failed;
+ }
+ SafeRelease(&pDwFontFile);
+ return pDwFontFace;
+failed:
+ SafeRelease(&pDwFontFile);
+ return NULL;
+}
+FX_BOOL CDWriteExt::DwCreateRenderingTarget(CFX_DIBitmap* pBitmap, void** renderTarget)
+{
+ if (pBitmap->GetFormat() > FXDIB_Argb) {
+ return FALSE;
+ }
+ IDWriteFactory* pDwFactory = (IDWriteFactory*)m_pDWriteFactory;
+ IDWriteGdiInterop* pGdiInterop = NULL;
+ IDWriteBitmapRenderTarget* pBitmapRenderTarget = NULL;
+ IDWriteRenderingParams* pRenderingParams = NULL;
+ HRESULT hr = S_OK;
+ hr = pDwFactory->GetGdiInterop(&pGdiInterop);
+ if (FAILED(hr)) {
+ goto failed;
+ }
+ hr = pGdiInterop->CreateBitmapRenderTarget(NULL, pBitmap->GetWidth(), pBitmap->GetHeight(),
+ &pBitmapRenderTarget);
+ if (FAILED(hr)) {
+ goto failed;
+ }
+ hr = pDwFactory->CreateCustomRenderingParams(
+ 1.0f,
+ 0.0f,
+ 1.0f,
+ DWRITE_PIXEL_GEOMETRY_RGB,
+ DWRITE_RENDERING_MODE_DEFAULT,
+ &pRenderingParams
+ );
+ if (FAILED(hr)) {
+ goto failed;
+ }
+ hr = pBitmapRenderTarget->SetPixelsPerDip(1.0f);
+ if (FAILED(hr)) {
+ goto failed;
+ }
+ *(CDwGdiTextRenderer**)renderTarget = FX_NEW CDwGdiTextRenderer(pBitmap, pBitmapRenderTarget, pRenderingParams);
+ if (*(CDwGdiTextRenderer**)renderTarget == NULL) {
+ goto failed;
+ }
+ SafeRelease(&pGdiInterop);
+ SafeRelease(&pBitmapRenderTarget);
+ SafeRelease(&pRenderingParams);
+ return TRUE;
+failed:
+ SafeRelease(&pGdiInterop);
+ SafeRelease(&pBitmapRenderTarget);
+ SafeRelease(&pRenderingParams);
+ return FALSE;
+}
+FX_BOOL CDWriteExt::DwRendingString(void* renderTarget, CFX_ClipRgn* pClipRgn, FX_RECT& stringRect, CFX_AffineMatrix* pMatrix,
+ void *font, FX_FLOAT font_size, FX_ARGB text_color,
+ int glyph_count, unsigned short* glyph_indices,
+ FX_FLOAT baselineOriginX, FX_FLOAT baselineOriginY,
+ void* glyph_offsets,
+ FX_FLOAT* glyph_advances)
+{
+ if (renderTarget == NULL) {
+ return TRUE;
+ }
+ CDwGdiTextRenderer* pTextRenderer = (CDwGdiTextRenderer*)renderTarget;
+ DWRITE_MATRIX transform;
+ DWRITE_GLYPH_RUN glyphRun;
+ HRESULT hr = S_OK;
+ if (pMatrix) {
+ transform.m11 = pMatrix->a;
+ transform.m12 = pMatrix->b;
+ transform.m21 = pMatrix->c;
+ transform.m22 = pMatrix->d;
+ transform.dx = pMatrix->e;
+ transform.dy = pMatrix->f;
+ }
+ glyphRun.fontFace = (IDWriteFontFace*)font;
+ glyphRun.fontEmSize = font_size;
+ glyphRun.glyphCount = glyph_count;
+ glyphRun.glyphIndices = glyph_indices;
+ glyphRun.glyphAdvances = glyph_advances;
+ glyphRun.glyphOffsets = (DWRITE_GLYPH_OFFSET*)glyph_offsets;
+ glyphRun.isSideways = FALSE;
+ glyphRun.bidiLevel = 0;
+ hr = pTextRenderer->DrawGlyphRun(
+ stringRect,
+ pClipRgn,
+ pMatrix ? &transform : NULL,
+ baselineOriginX, baselineOriginY,
+ DWRITE_MEASURING_MODE_NATURAL,
+ &glyphRun,
+ RGB(FXARGB_R(text_color), FXARGB_G(text_color), FXARGB_B(text_color))
+ );
+ return SUCCEEDED(hr) ? TRUE : FALSE;
+}
+void CDWriteExt::DwDeleteRenderingTarget(void* renderTarget)
+{
+ if (renderTarget) {
+ delete (CDwGdiTextRenderer*)renderTarget;
+ }
+}
+void CDWriteExt::DwDeleteFont(void* pFont)
+{
+ if (pFont) {
+ SafeRelease((IDWriteFontFace**)&pFont);
+ }
+}
+CDwFontFileStream::CDwFontFileStream(void const* fontFileReferenceKey, UINT32 fontFileReferenceKeySize)
+{
+ refCount_ = 0;
+ resourcePtr_ = fontFileReferenceKey;
+ resourceSize_ = fontFileReferenceKeySize;
+}
+HRESULT STDMETHODCALLTYPE CDwFontFileStream::QueryInterface(REFIID iid, void** ppvObject)
+{
+ if (iid == IID_IUnknown || iid == __uuidof(IDWriteFontFileStream)) {
+ *ppvObject = this;
+ AddRef();
+ return S_OK;
+ } else {
+ *ppvObject = NULL;
+ return E_NOINTERFACE;
+ }
+}
+ULONG STDMETHODCALLTYPE CDwFontFileStream::AddRef()
+{
+ return InterlockedIncrement((long*)(&refCount_));
+}
+ULONG STDMETHODCALLTYPE CDwFontFileStream::Release()
+{
+ ULONG newCount = InterlockedDecrement((long*)(&refCount_));
+ if (newCount == 0) {
+ delete this;
+ }
+ return newCount;
+}
+HRESULT STDMETHODCALLTYPE CDwFontFileStream::ReadFileFragment(
+ void const** fragmentStart,
+ UINT64 fileOffset,
+ UINT64 fragmentSize,
+ OUT void** fragmentContext
+)
+{
+ if (fileOffset <= resourceSize_ &&
+ fragmentSize <= resourceSize_ - fileOffset) {
+ *fragmentStart = static_cast<FX_BYTE const*>(resourcePtr_) + static_cast<size_t>(fileOffset);
+ *fragmentContext = NULL;
+ return S_OK;
+ } else {
+ *fragmentStart = NULL;
+ *fragmentContext = NULL;
+ return E_FAIL;
+ }
+}
+void STDMETHODCALLTYPE CDwFontFileStream::ReleaseFileFragment(void* fragmentContext)
+{
+}
+HRESULT STDMETHODCALLTYPE CDwFontFileStream::GetFileSize(OUT UINT64* fileSize)
+{
+ *fileSize = resourceSize_;
+ return S_OK;
+}
+HRESULT STDMETHODCALLTYPE CDwFontFileStream::GetLastWriteTime(OUT UINT64* lastWriteTime)
+{
+ *lastWriteTime = 0;
+ return E_NOTIMPL;
+}
+IDWriteFontFileLoader* CDwFontFileLoader::instance_ = NULL;
+CDwFontFileLoader::CDwFontFileLoader() :
+ refCount_(0)
+{
+}
+HRESULT STDMETHODCALLTYPE CDwFontFileLoader::QueryInterface(REFIID iid, void** ppvObject)
+{
+ if (iid == IID_IUnknown || iid == __uuidof(IDWriteFontFileLoader)) {
+ *ppvObject = this;
+ AddRef();
+ return S_OK;
+ } else {
+ *ppvObject = NULL;
+ return E_NOINTERFACE;
+ }
+}
+ULONG STDMETHODCALLTYPE CDwFontFileLoader::AddRef()
+{
+ return InterlockedIncrement((long*)(&refCount_));
+}
+ULONG STDMETHODCALLTYPE CDwFontFileLoader::Release()
+{
+ ULONG newCount = InterlockedDecrement((long*)(&refCount_));
+ if (newCount == 0) {
+ instance_ = NULL;
+ delete this;
+ }
+ return newCount;
+}
+HRESULT STDMETHODCALLTYPE CDwFontFileLoader::CreateStreamFromKey(
+ void const* fontFileReferenceKey,
+ UINT32 fontFileReferenceKeySize,
+ OUT IDWriteFontFileStream** fontFileStream
+)
+{
+ *fontFileStream = NULL;
+ CDwFontFileStream* stream = FX_NEW CDwFontFileStream(fontFileReferenceKey, fontFileReferenceKeySize);
+ if (stream == NULL) {
+ return E_OUTOFMEMORY;
+ }
+ if (!stream->IsInitialized()) {
+ delete stream;
+ return E_FAIL;
+ }
+ *fontFileStream = SafeAcquire(stream);
+ return S_OK;
+}
+CDwFontContext::CDwFontContext(IDWriteFactory* dwriteFactory) :
+ hr_(S_FALSE),
+ dwriteFactory_(SafeAcquire(dwriteFactory))
+{
+}
+CDwFontContext::~CDwFontContext()
+{
+ if(dwriteFactory_ && hr_ == S_OK) {
+ dwriteFactory_->UnregisterFontFileLoader(CDwFontFileLoader::GetLoader());
+ }
+ SafeRelease(&dwriteFactory_);
+}
+HRESULT CDwFontContext::Initialize()
+{
+ if (hr_ == S_FALSE) {
+ return hr_ = dwriteFactory_->RegisterFontFileLoader(CDwFontFileLoader::GetLoader());
+ }
+ return hr_;
+}
+CDwGdiTextRenderer::CDwGdiTextRenderer(CFX_DIBitmap* pBitmap, IDWriteBitmapRenderTarget* bitmapRenderTarget, IDWriteRenderingParams* renderingParams):
+ pBitmap_(pBitmap),
+ pRenderTarget_(SafeAcquire(bitmapRenderTarget)),
+ pRenderingParams_(SafeAcquire(renderingParams))
+{
+}
+CDwGdiTextRenderer::~CDwGdiTextRenderer()
+{
+ SafeRelease(&pRenderTarget_);
+ SafeRelease(&pRenderingParams_);
+}
+STDMETHODIMP CDwGdiTextRenderer::DrawGlyphRun(
+ const FX_RECT& text_bbox,
+ __in_opt CFX_ClipRgn* pClipRgn,
+ __in_opt DWRITE_MATRIX const* pMatrix,
+ FLOAT baselineOriginX,
+ FLOAT baselineOriginY,
+ DWRITE_MEASURING_MODE measuringMode,
+ __in DWRITE_GLYPH_RUN const* glyphRun,
+ const COLORREF& textColor
+)
+{
+ HRESULT hr = S_OK;
+ if (pMatrix) {
+ hr = pRenderTarget_->SetCurrentTransform(pMatrix);
+ if (FAILED(hr)) {
+ return hr;
+ }
+ }
+ HDC hDC = pRenderTarget_->GetMemoryDC();
+ HBITMAP hBitmap = (HBITMAP)::GetCurrentObject(hDC, OBJ_BITMAP);
+ BITMAP bitmap;
+ GetObject(hBitmap, sizeof bitmap, &bitmap);
+ CFX_DIBitmap dib;
+ dib.Create(
+ bitmap.bmWidth,
+ bitmap.bmHeight,
+ bitmap.bmBitsPixel == 24 ? FXDIB_Rgb : FXDIB_Rgb32,
+ (FX_LPBYTE)bitmap.bmBits
+ );
+ dib.CompositeBitmap(
+ text_bbox.left,
+ text_bbox.top,
+ text_bbox.Width(),
+ text_bbox.Height(),
+ pBitmap_,
+ text_bbox.left,
+ text_bbox.top,
+ FXDIB_BLEND_NORMAL,
+ NULL
+ );
+ hr = pRenderTarget_->DrawGlyphRun(
+ baselineOriginX,
+ baselineOriginY,
+ measuringMode,
+ glyphRun,
+ pRenderingParams_,
+ textColor
+ );
+ if (FAILED(hr)) {
+ return hr;
+ }
+ pBitmap_->CompositeBitmap(
+ text_bbox.left,
+ text_bbox.top,
+ text_bbox.Width(),
+ text_bbox.Height(),
+ &dib,
+ text_bbox.left,
+ text_bbox.top,
+ FXDIB_BLEND_NORMAL,
+ pClipRgn
+ );
+ return hr;
+}
+#endif
diff --git a/core/src/fxge/win32/fx_win32_gdipext.cpp b/core/src/fxge/win32/fx_win32_gdipext.cpp
index 7f9240629c..d3aeecc515 100644
--- a/core/src/fxge/win32/fx_win32_gdipext.cpp
+++ b/core/src/fxge/win32/fx_win32_gdipext.cpp
@@ -1,1286 +1,1286 @@
-// 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
-
-#include "../../../include/fxge/fx_ge.h"
-#if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_
-#include <windows.h>
-#include "../../../include/fxge/fx_ge_win32.h"
-#include "win32_int.h"
-#include "../Microsoft SDK/include/GdiPlus.h"
-using namespace Gdiplus;
-using namespace Gdiplus::DllExports;
-#define GdiFillType2Gdip(fill_type) (fill_type == ALTERNATE ? FillModeAlternate : FillModeWinding)
-static CombineMode GdiCombineMode2Gdip(int mode)
-{
- switch (mode) {
- case RGN_AND:
- return CombineModeIntersect;
- }
- return CombineModeIntersect;
-}
-enum {
- FuncId_GdipCreatePath2,
- FuncId_GdipSetPenDashStyle,
- FuncId_GdipSetPenDashArray,
- FuncId_GdipSetPenDashCap197819,
- FuncId_GdipSetPenLineJoin,
- FuncId_GdipSetPenWidth,
- FuncId_GdipCreateFromHDC,
- FuncId_GdipSetPageUnit,
- FuncId_GdipSetSmoothingMode,
- FuncId_GdipCreateSolidFill,
- FuncId_GdipFillPath,
- FuncId_GdipDeleteBrush,
- FuncId_GdipCreatePen1,
- FuncId_GdipSetPenMiterLimit,
- FuncId_GdipDrawPath,
- FuncId_GdipDeletePen,
- FuncId_GdipDeletePath,
- FuncId_GdipDeleteGraphics,
- FuncId_GdipCreateBitmapFromFileICM,
- FuncId_GdipCreateBitmapFromStreamICM,
- FuncId_GdipGetImageHeight,
- FuncId_GdipGetImageWidth,
- FuncId_GdipGetImagePixelFormat,
- FuncId_GdipBitmapLockBits,
- FuncId_GdipGetImagePaletteSize,
- FuncId_GdipGetImagePalette,
- FuncId_GdipBitmapUnlockBits,
- FuncId_GdipDisposeImage,
- FuncId_GdipFillRectangle,
- FuncId_GdipCreateBitmapFromScan0,
- FuncId_GdipSetImagePalette,
- FuncId_GdipSetInterpolationMode,
- FuncId_GdipDrawImagePointsI,
- FuncId_GdipCreateBitmapFromGdiDib,
- FuncId_GdiplusStartup,
- FuncId_GdipDrawLineI,
- FuncId_GdipResetClip,
- FuncId_GdipCreatePath,
- FuncId_GdipAddPathPath,
- FuncId_GdipSetPathFillMode,
- FuncId_GdipSetClipPath,
- FuncId_GdipGetClip,
- FuncId_GdipCreateRegion,
- FuncId_GdipGetClipBoundsI,
- FuncId_GdipSetClipRegion,
- FuncId_GdipWidenPath,
- FuncId_GdipAddPathLine,
- FuncId_GdipAddPathRectangle,
- FuncId_GdipDeleteRegion,
- FuncId_GdipGetDC,
- FuncId_GdipReleaseDC,
- FuncId_GdipSetPenLineCap197819,
- FuncId_GdipSetPenDashOffset,
- FuncId_GdipResetPath,
- FuncId_GdipCreateRegionPath,
- FuncId_GdipCreateFont,
- FuncId_GdipGetFontSize,
- FuncId_GdipCreateFontFamilyFromName,
- FuncId_GdipSetTextRenderingHint,
- FuncId_GdipDrawDriverString,
- FuncId_GdipCreateMatrix2,
- FuncId_GdipDeleteMatrix,
- FuncId_GdipSetWorldTransform,
- FuncId_GdipResetWorldTransform,
- FuncId_GdipDeleteFontFamily,
- FuncId_GdipDeleteFont,
- FuncId_GdipNewPrivateFontCollection,
- FuncId_GdipDeletePrivateFontCollection,
- FuncId_GdipPrivateAddMemoryFont,
- FuncId_GdipGetFontCollectionFamilyList,
- FuncId_GdipGetFontCollectionFamilyCount,
- FuncId_GdipSetTextContrast,
- FuncId_GdipSetPixelOffsetMode,
- FuncId_GdipGetImageGraphicsContext,
- FuncId_GdipDrawImageI,
- FuncId_GdipDrawImageRectI,
- FuncId_GdipDrawString,
- FuncId_GdipSetPenTransform,
-};
-static LPCSTR g_GdipFuncNames[] = {
- "GdipCreatePath2",
- "GdipSetPenDashStyle",
- "GdipSetPenDashArray",
- "GdipSetPenDashCap197819",
- "GdipSetPenLineJoin",
- "GdipSetPenWidth",
- "GdipCreateFromHDC",
- "GdipSetPageUnit",
- "GdipSetSmoothingMode",
- "GdipCreateSolidFill",
- "GdipFillPath",
- "GdipDeleteBrush",
- "GdipCreatePen1",
- "GdipSetPenMiterLimit",
- "GdipDrawPath",
- "GdipDeletePen",
- "GdipDeletePath",
- "GdipDeleteGraphics",
- "GdipCreateBitmapFromFileICM",
- "GdipCreateBitmapFromStreamICM",
- "GdipGetImageHeight",
- "GdipGetImageWidth",
- "GdipGetImagePixelFormat",
- "GdipBitmapLockBits",
- "GdipGetImagePaletteSize",
- "GdipGetImagePalette",
- "GdipBitmapUnlockBits",
- "GdipDisposeImage",
- "GdipFillRectangle",
- "GdipCreateBitmapFromScan0",
- "GdipSetImagePalette",
- "GdipSetInterpolationMode",
- "GdipDrawImagePointsI",
- "GdipCreateBitmapFromGdiDib",
- "GdiplusStartup",
- "GdipDrawLineI",
- "GdipResetClip",
- "GdipCreatePath",
- "GdipAddPathPath",
- "GdipSetPathFillMode",
- "GdipSetClipPath",
- "GdipGetClip",
- "GdipCreateRegion",
- "GdipGetClipBoundsI",
- "GdipSetClipRegion",
- "GdipWidenPath",
- "GdipAddPathLine",
- "GdipAddPathRectangle",
- "GdipDeleteRegion",
- "GdipGetDC",
- "GdipReleaseDC",
- "GdipSetPenLineCap197819",
- "GdipSetPenDashOffset",
- "GdipResetPath",
- "GdipCreateRegionPath",
- "GdipCreateFont",
- "GdipGetFontSize",
- "GdipCreateFontFamilyFromName",
- "GdipSetTextRenderingHint",
- "GdipDrawDriverString",
- "GdipCreateMatrix2",
- "GdipDeleteMatrix",
- "GdipSetWorldTransform",
- "GdipResetWorldTransform",
- "GdipDeleteFontFamily",
- "GdipDeleteFont",
- "GdipNewPrivateFontCollection",
- "GdipDeletePrivateFontCollection",
- "GdipPrivateAddMemoryFont",
- "GdipGetFontCollectionFamilyList",
- "GdipGetFontCollectionFamilyCount",
- "GdipSetTextContrast",
- "GdipSetPixelOffsetMode",
- "GdipGetImageGraphicsContext",
- "GdipDrawImageI",
- "GdipDrawImageRectI",
- "GdipDrawString",
- "GdipSetPenTransform",
-};
-typedef GpStatus (WINGDIPAPI *FuncType_GdipCreatePath2)(GDIPCONST GpPointF*, GDIPCONST BYTE*, INT, GpFillMode, GpPath **path);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipSetPenDashStyle)(GpPen *pen, GpDashStyle dashstyle);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipSetPenDashArray)(GpPen *pen, GDIPCONST REAL *dash, INT count);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipSetPenDashCap197819)(GpPen *pen, GpDashCap dashCap);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipSetPenLineJoin)(GpPen *pen, GpLineJoin lineJoin);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipSetPenWidth)(GpPen *pen, REAL width);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipCreateFromHDC)(HDC hdc, GpGraphics **graphics);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipSetPageUnit)(GpGraphics *graphics, GpUnit unit);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipSetSmoothingMode)(GpGraphics *graphics, SmoothingMode smoothingMode);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipCreateSolidFill)(ARGB color, GpSolidFill **brush);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipFillPath)(GpGraphics *graphics, GpBrush *brush, GpPath *path);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipDeleteBrush)(GpBrush *brush);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipCreatePen1)(ARGB color, REAL width, GpUnit unit, GpPen **pen);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipSetPenMiterLimit)(GpPen *pen, REAL miterLimit);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipDrawPath)(GpGraphics *graphics, GpPen *pen, GpPath *path);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipDeletePen)(GpPen *pen);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipDeletePath)(GpPath* path);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipDeleteGraphics)(GpGraphics *graphics);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipCreateBitmapFromFileICM)(GDIPCONST WCHAR* filename, GpBitmap **bitmap);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipCreateBitmapFromStreamICM)(IStream* stream, GpBitmap **bitmap);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipGetImageWidth)(GpImage *image, UINT *width);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipGetImageHeight)(GpImage *image, UINT *height);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipGetImagePixelFormat)(GpImage *image, PixelFormat *format);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipBitmapLockBits)(GpBitmap* bitmap, GDIPCONST GpRect* rect, UINT flags, PixelFormat format, BitmapData* lockedBitmapData);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipGetImagePalette)(GpImage *image, ColorPalette *palette, INT size);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipGetImagePaletteSize)(GpImage *image, INT *size);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipBitmapUnlockBits)(GpBitmap* bitmap, BitmapData* lockedBitmapData);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipDisposeImage)(GpImage *image);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipFillRectangle)(GpGraphics *graphics, GpBrush *brush, REAL x, REAL y, REAL width, REAL height);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipCreateBitmapFromScan0)(INT width, INT height, INT stride, PixelFormat format, BYTE* scan0, GpBitmap** bitmap);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipSetImagePalette)(GpImage *image, GDIPCONST ColorPalette *palette);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipSetInterpolationMode)(GpGraphics *graphics, InterpolationMode interpolationMode);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipDrawImagePointsI)(GpGraphics *graphics, GpImage *image, GDIPCONST GpPoint *dstpoints, INT count);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipCreateBitmapFromGdiDib)(GDIPCONST BITMAPINFO* gdiBitmapInfo, VOID* gdiBitmapData, GpBitmap** bitmap);
-typedef Status (WINAPI *FuncType_GdiplusStartup)(OUT FX_UINTPTR *token, const GdiplusStartupInput *input, OUT GdiplusStartupOutput *output);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipDrawLineI)(GpGraphics *graphics, GpPen *pen, int x1, int y1, int x2, int y2);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipResetClip)(GpGraphics *graphics);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipCreatePath)(GpFillMode brushMode, GpPath **path);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipAddPathPath)(GpPath *path, GDIPCONST GpPath* addingPath, BOOL connect);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipSetPathFillMode)(GpPath *path, GpFillMode fillmode);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipSetClipPath)(GpGraphics *graphics, GpPath *path, CombineMode combineMode);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipGetClip)(GpGraphics *graphics, GpRegion *region);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipCreateRegion)(GpRegion **region);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipGetClipBoundsI)(GpGraphics *graphics, GpRect *rect);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipSetClipRegion)(GpGraphics *graphics, GpRegion *region, CombineMode combineMode);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipWidenPath)(GpPath *nativePath, GpPen *pen, GpMatrix *matrix, REAL flatness);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipAddPathLine)(GpPath *path, REAL x1, REAL y1, REAL x2, REAL y2);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipAddPathRectangle)(GpPath *path, REAL x, REAL y, REAL width, REAL height);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipDeleteRegion)(GpRegion *region);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipGetDC)(GpGraphics* graphics, HDC * hdc);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipReleaseDC)(GpGraphics* graphics, HDC hdc);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipSetPenLineCap197819)(GpPen *pen, GpLineCap startCap, GpLineCap endCap, GpDashCap dashCap);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipSetPenDashOffset)(GpPen *pen, REAL offset);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipResetPath)(GpPath *path);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipCreateRegionPath)(GpPath *path, GpRegion **region);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipCreateFont)(GDIPCONST GpFontFamily *fontFamily, REAL emSize, INT style, Unit unit, GpFont **font);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipGetFontSize)(GpFont *font, REAL *size);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipCreateFontFamilyFromName)(GDIPCONST WCHAR *name, GpFontCollection *fontCollection, GpFontFamily **FontFamily);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipSetTextRenderingHint)(GpGraphics *graphics, TextRenderingHint mode);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipDrawDriverString)(GpGraphics *graphics, GDIPCONST UINT16 *text, INT length, GDIPCONST GpFont *font, GDIPCONST GpBrush *brush, GDIPCONST PointF *positions, INT flags, GDIPCONST GpMatrix *matrix);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipCreateMatrix2)(REAL m11, REAL m12, REAL m21, REAL m22, REAL dx, REAL dy, GpMatrix **matrix);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipDeleteMatrix)(GpMatrix *matrix);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipSetWorldTransform)(GpGraphics *graphics, GpMatrix *matrix);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipResetWorldTransform)(GpGraphics *graphics);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipDeleteFontFamily)(GpFontFamily *FontFamily);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipDeleteFont)(GpFont* font);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipNewPrivateFontCollection)(GpFontCollection** fontCollection);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipDeletePrivateFontCollection)(GpFontCollection** fontCollection);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipPrivateAddMemoryFont)(GpFontCollection* fontCollection, GDIPCONST void* memory, INT length);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipGetFontCollectionFamilyList)(GpFontCollection* fontCollection, INT numSought, GpFontFamily* gpfamilies[], INT* numFound);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipGetFontCollectionFamilyCount)(GpFontCollection* fontCollection, INT* numFound);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipSetTextContrast)(GpGraphics *graphics, UINT contrast);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipSetPixelOffsetMode)(GpGraphics* graphics, PixelOffsetMode pixelOffsetMode);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipGetImageGraphicsContext)(GpImage *image, GpGraphics **graphics);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipDrawImageI)(GpGraphics *graphics, GpImage *image, INT x, INT y);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipDrawImageRectI)(GpGraphics *graphics, GpImage *image, INT x, INT y, INT width, INT height);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipDrawString)(GpGraphics *graphics, GDIPCONST WCHAR *string, INT length, GDIPCONST GpFont *font, GDIPCONST RectF *layoutRect, GDIPCONST GpStringFormat *stringFormat, GDIPCONST GpBrush *brush);
-typedef GpStatus (WINGDIPAPI *FuncType_GdipSetPenTransform)(GpPen *pen, GpMatrix *matrix);
-#define CallFunc(funcname) ((FuncType_##funcname)GdiplusExt.m_Functions[FuncId_##funcname])
-typedef HANDLE (__stdcall *FuncType_GdiAddFontMemResourceEx)(PVOID pbFont, DWORD cbFont, PVOID pdv, DWORD *pcFonts);
-typedef BOOL (__stdcall *FuncType_GdiRemoveFontMemResourceEx)(HANDLE handle);
-void* CGdiplusExt::GdiAddFontMemResourceEx(void *pFontdata, FX_DWORD size, void* pdv, FX_DWORD* num_face)
-{
- if (m_pGdiAddFontMemResourceEx) {
- return ((FuncType_GdiAddFontMemResourceEx)m_pGdiAddFontMemResourceEx)((PVOID)pFontdata, (DWORD)size, (PVOID)pdv, (DWORD*)num_face);
- }
- return NULL;
-}
-FX_BOOL CGdiplusExt::GdiRemoveFontMemResourceEx(void* handle)
-{
- if (m_pGdiRemoveFontMemResourseEx) {
- return ((FuncType_GdiRemoveFontMemResourceEx)m_pGdiRemoveFontMemResourseEx)((HANDLE)handle);
- }
- return FALSE;
-}
-static GpBrush* _GdipCreateBrush(DWORD argb)
-{
- CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
- GpSolidFill* solidBrush = NULL;
- CallFunc(GdipCreateSolidFill)((ARGB)argb, &solidBrush);
- return solidBrush;
-}
-static CFX_DIBitmap* _StretchMonoToGray(int dest_width, int dest_height,
- const CFX_DIBitmap* pSource, FX_RECT* pClipRect)
-{
- FX_BOOL bFlipX = dest_width < 0;
- if (bFlipX) {
- dest_width = -dest_width;
- }
- FX_BOOL bFlipY = dest_height < 0;
- if (bFlipY) {
- dest_height = -dest_height;
- }
- int result_width = pClipRect->Width();
- int result_height = pClipRect->Height();
- int result_pitch = (result_width + 3) / 4 * 4;
- CFX_DIBitmap* pStretched = FX_NEW CFX_DIBitmap;
- if (!pStretched) {
- return NULL;
- }
- if (!pStretched->Create(result_width, result_height, FXDIB_8bppRgb)) {
- delete pStretched;
- return NULL;
- }
- LPBYTE dest_buf = pStretched->GetBuffer();
- int src_width = pSource->GetWidth();
- int src_height = pSource->GetHeight();
- int src_count = src_width * src_height;
- int dest_count = dest_width * dest_height;
- int ratio = 255 * dest_count / src_count;
- int y_unit = src_height / dest_height;
- int x_unit = src_width / dest_width;
- int area_unit = y_unit * x_unit;
- LPBYTE src_buf = pSource->GetBuffer();
- int src_pitch = pSource->GetPitch();
- for (int dest_y = 0; dest_y < result_height; dest_y ++) {
- LPBYTE dest_scan = dest_buf + dest_y * result_pitch;
- int src_y_start = bFlipY ? (dest_height - 1 - dest_y - pClipRect->top) : (dest_y + pClipRect->top);
- src_y_start = src_y_start * src_height / dest_height;
- LPBYTE src_scan = src_buf + src_y_start * src_pitch;
- for (int dest_x = 0; dest_x < result_width; dest_x ++) {
- int sum = 0;
- int src_x_start = bFlipX ? (dest_width - 1 - dest_x - pClipRect->left) : (dest_x + pClipRect->left);
- src_x_start = src_x_start * src_width / dest_width;
- int src_x_end = src_x_start + x_unit;
- LPBYTE src_line = src_scan;
- for (int src_y = 0; src_y < y_unit; src_y ++) {
- for (int src_x = src_x_start; src_x < src_x_end; src_x ++) {
- if (!(src_line[src_x / 8] & (1 << (7 - src_x % 8)))) {
- sum += 255;
- }
- }
- src_line += src_pitch;
- }
- dest_scan[dest_x] = 255 - sum / area_unit;
- }
- }
- return pStretched;
-}
-static void OutputImageMask(GpGraphics* pGraphics, BOOL bMonoDevice, const CFX_DIBitmap* pBitmap, int dest_left, int dest_top,
- int dest_width, int dest_height, FX_ARGB argb, const FX_RECT* pClipRect)
-{
- ASSERT(pBitmap->GetBPP() == 1);
- CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
- int src_width = pBitmap->GetWidth(), src_height = pBitmap->GetHeight();
- int src_pitch = pBitmap->GetPitch();
- FX_LPBYTE scan0 = pBitmap->GetBuffer();
- if (src_width == 1 && src_height == 1) {
- if ((scan0[0] & 0x80) == 0) {
- return;
- }
- GpSolidFill* solidBrush;
- CallFunc(GdipCreateSolidFill)((ARGB)argb, &solidBrush);
- if (dest_width < 0) {
- dest_width = -dest_width;
- dest_left -= dest_width;
- }
- if (dest_height < 0) {
- dest_height = -dest_height;
- dest_top -= dest_height;
- }
- CallFunc(GdipFillRectangle)(pGraphics, solidBrush, (float)dest_left, (float)dest_top,
- (float)dest_width, (float)dest_height);
- CallFunc(GdipDeleteBrush)(solidBrush);
- return;
- }
- if (!bMonoDevice && abs(dest_width) < src_width && abs(dest_height) < src_height) {
- FX_RECT image_rect(dest_left, dest_top, dest_left + dest_width, dest_top + dest_height);
- image_rect.Normalize();
- FX_RECT image_clip = image_rect;
- image_clip.Intersect(*pClipRect);
- if (image_clip.IsEmpty()) {
- return;
- }
- image_clip.Offset(-image_rect.left, -image_rect.top);
- CFX_DIBitmap* pStretched = NULL;
- if (src_width * src_height > 10000) {
- pStretched = _StretchMonoToGray(dest_width, dest_height, pBitmap, &image_clip);
- } else {
- pStretched = pBitmap->StretchTo(dest_width, dest_height, FALSE, &image_clip);
- }
- GpBitmap* bitmap;
- CallFunc(GdipCreateBitmapFromScan0)(image_clip.Width(), image_clip.Height(),
- (image_clip.Width() + 3) / 4 * 4, PixelFormat8bppIndexed, pStretched->GetBuffer(), &bitmap);
- int a, r, g, b;
- ArgbDecode(argb, a, r, g, b);
- UINT pal[258];
- pal[0] = 0;
- pal[1] = 256;
- for (int i = 0; i < 256; i ++) {
- pal[i + 2] = ArgbEncode(i * a / 255, r, g, b);
- }
- CallFunc(GdipSetImagePalette)(bitmap, (ColorPalette*)pal);
- CallFunc(GdipDrawImageI)(pGraphics, bitmap, image_rect.left + image_clip.left,
- image_rect.top + image_clip.top);
- CallFunc(GdipDisposeImage)(bitmap);
- delete pStretched;
- return;
- }
- GpBitmap* bitmap;
- CallFunc(GdipCreateBitmapFromScan0)(src_width, src_height, src_pitch, PixelFormat1bppIndexed, scan0, &bitmap);
- UINT palette[4] = { PaletteFlagsHasAlpha, 2, 0, argb };
- CallFunc(GdipSetImagePalette)(bitmap, (ColorPalette*)palette);
- Point destinationPoints[] = {
- Point(dest_left, dest_top),
- Point(dest_left + dest_width, dest_top),
- Point(dest_left, dest_top + dest_height)
- };
- CallFunc(GdipDrawImagePointsI)(pGraphics, bitmap, destinationPoints, 3);
- CallFunc(GdipDisposeImage)(bitmap);
-}
-static void OutputImage(GpGraphics* pGraphics, const CFX_DIBitmap* pBitmap, const FX_RECT* pSrcRect,
- int dest_left, int dest_top, int dest_width, int dest_height)
-{
- int src_width = pSrcRect->Width(), src_height = pSrcRect->Height();
- CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
- if (pBitmap->GetBPP() == 1 && (pSrcRect->left % 8)) {
- FX_RECT new_rect(0, 0, src_width, src_height);
- CFX_DIBitmap* pCloned = pBitmap->Clone(pSrcRect);
- if (!pCloned) {
- return;
- }
- OutputImage(pGraphics, pCloned, &new_rect, dest_left, dest_top, dest_width, dest_height);
- delete pCloned;
- return;
- }
- int src_pitch = pBitmap->GetPitch();
- FX_LPBYTE scan0 = pBitmap->GetBuffer() + pSrcRect->top * src_pitch + pBitmap->GetBPP() * pSrcRect->left / 8;
- GpBitmap* bitmap = NULL;
- switch (pBitmap->GetFormat()) {
- case FXDIB_Argb:
- CallFunc(GdipCreateBitmapFromScan0)(src_width, src_height, src_pitch,
- PixelFormat32bppARGB, scan0, &bitmap);
- break;
- case FXDIB_Rgb32:
- CallFunc(GdipCreateBitmapFromScan0)(src_width, src_height, src_pitch,
- PixelFormat32bppRGB, scan0, &bitmap);
- break;
- case FXDIB_Rgb:
- CallFunc(GdipCreateBitmapFromScan0)(src_width, src_height, src_pitch,
- PixelFormat24bppRGB, scan0, &bitmap);
- break;
- case FXDIB_8bppRgb: {
- CallFunc(GdipCreateBitmapFromScan0)(src_width, src_height, src_pitch,
- PixelFormat8bppIndexed, scan0, &bitmap);
- UINT pal[258];
- pal[0] = 0;
- pal[1] = 256;
- for (int i = 0; i < 256; i ++) {
- pal[i + 2] = pBitmap->GetPaletteEntry(i);
- }
- CallFunc(GdipSetImagePalette)(bitmap, (ColorPalette*)pal);
- break;
- }
- case FXDIB_1bppRgb: {
- CallFunc(GdipCreateBitmapFromScan0)(src_width, src_height, src_pitch,
- PixelFormat1bppIndexed, scan0, &bitmap);
- break;
- }
- }
- if (dest_height < 0) {
- dest_height --;
- }
- if (dest_width < 0) {
- dest_width --;
- }
- Point destinationPoints[] = {
- Point(dest_left, dest_top),
- Point(dest_left + dest_width, dest_top),
- Point(dest_left, dest_top + dest_height)
- };
- CallFunc(GdipDrawImagePointsI)(pGraphics, bitmap, destinationPoints, 3);
- CallFunc(GdipDisposeImage)(bitmap);
-}
-CGdiplusExt::CGdiplusExt()
-{
- m_hModule = NULL;
- m_GdiModule = NULL;
- for (int i = 0; i < sizeof g_GdipFuncNames / sizeof(LPCSTR); i ++) {
- m_Functions[i] = NULL;
- }
- m_pGdiAddFontMemResourceEx = NULL;
- m_pGdiRemoveFontMemResourseEx = NULL;
-}
-void CGdiplusExt::Load()
-{
- CFX_ByteString strPlusPath = "";
- FX_CHAR buf[MAX_PATH];
- GetSystemDirectoryA(buf, MAX_PATH);
- strPlusPath += buf;
- strPlusPath += "\\";
- strPlusPath += "GDIPLUS.DLL";
- m_hModule = LoadLibraryA(strPlusPath);
- if (m_hModule == NULL) {
- return;
- }
- for (int i = 0; i < sizeof g_GdipFuncNames / sizeof(LPCSTR); i ++) {
- m_Functions[i] = GetProcAddress(m_hModule, g_GdipFuncNames[i]);
- if (m_Functions[i] == NULL) {
- m_hModule = NULL;
- return;
- }
- }
- FX_UINTPTR gdiplusToken;
- GdiplusStartupInput gdiplusStartupInput;
- ((FuncType_GdiplusStartup)m_Functions[FuncId_GdiplusStartup])(&gdiplusToken, &gdiplusStartupInput, NULL);
- m_GdiModule = LoadLibraryA("GDI32.DLL");
- if (m_GdiModule == NULL) {
- return;
- }
- m_pGdiAddFontMemResourceEx = GetProcAddress(m_GdiModule, "AddFontMemResourceEx");
- m_pGdiRemoveFontMemResourseEx = GetProcAddress(m_GdiModule, "RemoveFontMemResourceEx");
-}
-CGdiplusExt::~CGdiplusExt()
-{
-}
-LPVOID CGdiplusExt::LoadMemFont(LPBYTE pData, FX_DWORD size)
-{
- GpFontCollection* pCollection = NULL;
- CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
- CallFunc(GdipNewPrivateFontCollection)(&pCollection);
- GpStatus status = CallFunc(GdipPrivateAddMemoryFont)(pCollection, pData, size);
- if (status == Ok) {
- return pCollection;
- }
- CallFunc(GdipDeletePrivateFontCollection)(&pCollection);
- return NULL;
-}
-void CGdiplusExt::DeleteMemFont(LPVOID pCollection)
-{
- CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
- CallFunc(GdipDeletePrivateFontCollection)((GpFontCollection**)&pCollection);
-}
-FX_BOOL CGdiplusExt::GdipCreateBitmap(CFX_DIBitmap* pBitmap, void**bitmap)
-{
- CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
- PixelFormat format;
- switch (pBitmap->GetFormat()) {
- case FXDIB_Rgb:
- format = PixelFormat24bppRGB;
- break;
- case FXDIB_Rgb32:
- format = PixelFormat32bppRGB;
- break;
- case FXDIB_Argb:
- format = PixelFormat32bppARGB;
- break;
- default:
- return FALSE;
- }
- GpStatus status = CallFunc(GdipCreateBitmapFromScan0)(pBitmap->GetWidth(), pBitmap->GetHeight(),
- pBitmap->GetPitch(), format, pBitmap->GetBuffer(), (GpBitmap**)bitmap);
- if (status == Ok) {
- return TRUE;
- }
- return FALSE;
-}
-FX_BOOL CGdiplusExt::GdipCreateFromImage(void* bitmap, void** graphics)
-{
- CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
- GpStatus status = CallFunc(GdipGetImageGraphicsContext)((GpBitmap*)bitmap, (GpGraphics**)graphics);
- if (status == Ok) {
- return TRUE;
- }
- return FALSE;
-}
-FX_BOOL CGdiplusExt::GdipCreateFontFamilyFromName(FX_LPCWSTR name, void* pFontCollection, void**pFamily)
-{
- CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
- GpStatus status = CallFunc(GdipCreateFontFamilyFromName)((GDIPCONST WCHAR *)name, (GpFontCollection*)pFontCollection, (GpFontFamily**)pFamily);
- if (status == Ok) {
- return TRUE;
- }
- return FALSE;
-}
-FX_BOOL CGdiplusExt::GdipCreateFontFromFamily(void* pFamily, FX_FLOAT font_size, int fontstyle, int flag, void** pFont)
-{
- CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
- GpStatus status = CallFunc(GdipCreateFont)((GpFontFamily*)pFamily, font_size, fontstyle, Unit(flag), (GpFont**)pFont);
- if (status == Ok) {
- return TRUE;
- }
- return FALSE;
-}
-void CGdiplusExt::GdipGetFontSize(void *pFont, FX_FLOAT *size)
-{
- REAL get_size;
- CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
- GpStatus status = CallFunc(GdipGetFontSize)((GpFont *)pFont, (REAL*)&get_size);
- if (status == Ok) {
- *size = (FX_FLOAT)get_size;
- } else {
- *size = 0;
- }
-}
-void CGdiplusExt::GdipSetTextRenderingHint(void* graphics, int mode)
-{
- CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
- CallFunc(GdipSetTextRenderingHint)((GpGraphics*)graphics, (TextRenderingHint)mode);
-}
-void CGdiplusExt::GdipSetPageUnit(void* graphics, FX_DWORD unit)
-{
- CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
- CallFunc(GdipSetPageUnit)((GpGraphics*)graphics, (GpUnit)unit);
-}
-FX_BOOL CGdiplusExt::GdipDrawDriverString(void *graphics, unsigned short *text, int length,
- void *font, void* brush, void *positions, int flags, const void *matrix)
-{
- CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
- GpStatus status = CallFunc(GdipDrawDriverString)((GpGraphics*)graphics, (GDIPCONST UINT16 *)text, (INT)length, (GDIPCONST GpFont *)font, (GDIPCONST GpBrush*)brush,
- (GDIPCONST PointF *)positions, (INT)flags, (GDIPCONST GpMatrix *)matrix);
- if (status == Ok) {
- return TRUE;
- }
- return FALSE;
-}
-void CGdiplusExt::GdipCreateBrush(FX_DWORD fill_argb, void** pBrush)
-{
- CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
- CallFunc(GdipCreateSolidFill)((ARGB)fill_argb, (GpSolidFill**)pBrush);
-}
-void CGdiplusExt::GdipDeleteBrush(void* pBrush)
-{
- CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
- CallFunc(GdipDeleteBrush)((GpSolidFill*)pBrush);
-}
-void* CGdiplusExt::GdipCreateFontFromCollection(void* pFontCollection, FX_FLOAT font_size, int fontstyle)
-{
- CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
- int numFamilies = 0;
- GpStatus status = CallFunc(GdipGetFontCollectionFamilyCount)((GpFontCollection*)pFontCollection, &numFamilies);
- if (status != Ok) {
- return NULL;
- }
- GpFontFamily* family_list[1];
- status = CallFunc(GdipGetFontCollectionFamilyList)((GpFontCollection*)pFontCollection, 1, family_list, &numFamilies);
- if (status != Ok) {
- return NULL;
- }
- GpFont* pFont = NULL;
- status = CallFunc(GdipCreateFont)(family_list[0], font_size, fontstyle, UnitPixel, &pFont);
- if (status != Ok) {
- return NULL;
- }
- return pFont;
-}
-void CGdiplusExt::GdipCreateMatrix(FX_FLOAT a, FX_FLOAT b, FX_FLOAT c, FX_FLOAT d, FX_FLOAT e, FX_FLOAT f, void** matrix)
-{
- CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
- CallFunc(GdipCreateMatrix2)(a, b, c, d, e, f, (GpMatrix**)matrix);
-}
-void CGdiplusExt::GdipDeleteMatrix(void* matrix)
-{
- CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
- CallFunc(GdipDeleteMatrix)((GpMatrix*)matrix);
-}
-void CGdiplusExt::GdipDeleteFontFamily(void* pFamily)
-{
- CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
- CallFunc(GdipDeleteFontFamily)((GpFontFamily*)pFamily);
-}
-void CGdiplusExt::GdipDeleteFont(void* pFont)
-{
- CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
- CallFunc(GdipDeleteFont)((GpFont*)pFont);
-}
-void CGdiplusExt::GdipSetWorldTransform(void* graphics, void* pMatrix)
-{
- CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
- CallFunc(GdipSetWorldTransform)((GpGraphics*)graphics, (GpMatrix*)pMatrix);
-}
-void CGdiplusExt::GdipDisposeImage(void* bitmap)
-{
- CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
- CallFunc(GdipDisposeImage)((GpBitmap*)bitmap);
-}
-void CGdiplusExt::GdipDeleteGraphics(void* graphics)
-{
- CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
- CallFunc(GdipDeleteGraphics)((GpGraphics*)graphics);
-}
-FX_BOOL CGdiplusExt::StretchBitMask(HDC hDC, BOOL bMonoDevice, const CFX_DIBitmap* pBitmap, int dest_left, int dest_top,
- int dest_width, int dest_height, FX_DWORD argb, const FX_RECT* pClipRect, int flags)
-{
- ASSERT(pBitmap->GetBPP() == 1);
- CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
- GpGraphics* pGraphics = NULL;
- CallFunc(GdipCreateFromHDC)(hDC, &pGraphics);
- CallFunc(GdipSetPageUnit)(pGraphics, UnitPixel);
- if (flags & FXDIB_NOSMOOTH) {
- CallFunc(GdipSetInterpolationMode)(pGraphics, InterpolationModeNearestNeighbor);
- } else {
- CallFunc(GdipSetInterpolationMode)(pGraphics, InterpolationModeHighQuality);
- }
- OutputImageMask(pGraphics, bMonoDevice, pBitmap, dest_left, dest_top, dest_width, dest_height, argb, pClipRect);
- CallFunc(GdipDeleteGraphics)(pGraphics);
- return TRUE;
-}
-FX_BOOL CGdiplusExt::StretchDIBits(HDC hDC, const CFX_DIBitmap* pBitmap, int dest_left, int dest_top,
- int dest_width, int dest_height, const FX_RECT* pClipRect, int flags)
-{
- GpGraphics* pGraphics;
- CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
- CallFunc(GdipCreateFromHDC)(hDC, &pGraphics);
- CallFunc(GdipSetPageUnit)(pGraphics, UnitPixel);
- if (flags & FXDIB_NOSMOOTH) {
- CallFunc(GdipSetInterpolationMode)(pGraphics, InterpolationModeNearestNeighbor);
- } else if (pBitmap->GetWidth() > abs(dest_width) / 2 || pBitmap->GetHeight() > abs(dest_height) / 2) {
- CallFunc(GdipSetInterpolationMode)(pGraphics, InterpolationModeHighQuality);
- } else {
- CallFunc(GdipSetInterpolationMode)(pGraphics, InterpolationModeBilinear);
- }
- FX_RECT src_rect(0, 0, pBitmap->GetWidth(), pBitmap->GetHeight());
- OutputImage(pGraphics, pBitmap, &src_rect, dest_left, dest_top, dest_width, dest_height);
- CallFunc(GdipDeleteGraphics)(pGraphics);
- CallFunc(GdipDeleteGraphics)(pGraphics);
- return TRUE;
-}
-static GpPen* _GdipCreatePen(const CFX_GraphStateData* pGraphState, const CFX_AffineMatrix* pMatrix, DWORD argb, FX_BOOL bTextMode = FALSE)
-{
- CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
- FX_FLOAT width = pGraphState ? pGraphState->m_LineWidth : 1.0f;
- if (!bTextMode) {
- FX_FLOAT unit = pMatrix == NULL ? 1.0f : FXSYS_Div(1.0f, (pMatrix->GetXUnit() + pMatrix->GetYUnit()) / 2);
- if (width < unit) {
- width = unit;
- }
- }
- GpPen* pPen = NULL;
- CallFunc(GdipCreatePen1)((ARGB)argb, width, UnitWorld, &pPen);
- LineCap lineCap;
- DashCap dashCap = DashCapFlat;
- FX_BOOL bDashExtend = FALSE;
- switch(pGraphState->m_LineCap) {
- case CFX_GraphStateData::LineCapButt:
- lineCap = LineCapFlat;
- break;
- case CFX_GraphStateData::LineCapRound:
- lineCap = LineCapRound;
- dashCap = DashCapRound;
- bDashExtend = TRUE;
- break;
- case CFX_GraphStateData::LineCapSquare:
- lineCap = LineCapSquare;
- bDashExtend = TRUE;
- break;
- }
- CallFunc(GdipSetPenLineCap197819)(pPen, lineCap, lineCap, dashCap);
- LineJoin lineJoin;
- switch(pGraphState->m_LineJoin) {
- case CFX_GraphStateData::LineJoinMiter:
- lineJoin = LineJoinMiterClipped;
- break;
- case CFX_GraphStateData::LineJoinRound:
- lineJoin = LineJoinRound;
- break;
- case CFX_GraphStateData::LineJoinBevel:
- lineJoin = LineJoinBevel;
- break;
- }
- CallFunc(GdipSetPenLineJoin)(pPen, lineJoin);
- if(pGraphState->m_DashCount) {
- FX_FLOAT* pDashArray = FX_Alloc(FX_FLOAT, pGraphState->m_DashCount + pGraphState->m_DashCount % 2);
- if (!pDashArray) {
- return NULL;
- }
- int nCount = 0;
- FX_FLOAT on_leftover = 0, off_leftover = 0;
- for (int i = 0; i < pGraphState->m_DashCount; i += 2) {
- FX_FLOAT on_phase = pGraphState->m_DashArray[i];
- FX_FLOAT off_phase;
- if (i == pGraphState->m_DashCount - 1) {
- off_phase = on_phase;
- } else {
- off_phase = pGraphState->m_DashArray[i + 1];
- }
- on_phase /= width;
- off_phase /= width;
- if (on_phase + off_phase <= 0.00002f) {
- on_phase = 1.0f / 10;
- off_phase = 1.0f / 10;
- }
- if (bDashExtend) {
- if (off_phase < 1) {
- off_phase = 0;
- } else {
- off_phase -= 1;
- }
- on_phase += 1;
- }
- if (on_phase == 0 || off_phase == 0) {
- if (nCount == 0) {
- on_leftover += on_phase;
- off_leftover += off_phase;
- } else {
- pDashArray[nCount - 2] += on_phase;
- pDashArray[nCount - 1] += off_phase;
- }
- } else {
- pDashArray[nCount++] = on_phase + on_leftover;
- on_leftover = 0;
- pDashArray[nCount++] = off_phase + off_leftover;
- off_leftover = 0;
- }
- }
- CallFunc(GdipSetPenDashArray)(pPen, pDashArray, nCount);
- FX_FLOAT phase = pGraphState->m_DashPhase;
- if (bDashExtend)
- if (phase < 0.5f) {
- phase = 0;
- } else {
- phase -= 0.5f;
- }
- CallFunc(GdipSetPenDashOffset)(pPen, phase);
- FX_Free(pDashArray);
- pDashArray = NULL;
- }
- CallFunc(GdipSetPenMiterLimit)(pPen, pGraphState->m_MiterLimit);
- return pPen;
-}
-static BOOL IsSmallTriangle(PointF* points, const CFX_AffineMatrix* pMatrix, int& v1, int& v2)
-{
- int pairs[] = {1, 2, 0, 2, 0, 1};
- for (int i = 0; i < 3; i ++) {
- int pair1 = pairs[i * 2];
- int pair2 = pairs[i * 2 + 1];
- FX_FLOAT x1 = points[pair1].X, x2 = points[pair2].X;
- FX_FLOAT y1 = points[pair1].Y, y2 = points[pair2].Y;
- if (pMatrix) {
- pMatrix->Transform(x1, y1);
- pMatrix->Transform(x2, y2);
- }
- FX_FLOAT dx = x1 - x2;
- FX_FLOAT dy = y1 - y2;
- FX_FLOAT distance_square = FXSYS_Mul(dx, dx) + FXSYS_Mul(dy, dy);
- if (distance_square < (1.0f * 2 + 1.0f / 4)) {
- v1 = i;
- v2 = pair1;
- return TRUE;
- }
- }
- return FALSE;
-}
-BOOL CGdiplusExt::DrawPath(HDC hDC, const CFX_PathData* pPathData,
- const CFX_AffineMatrix* pObject2Device,
- const CFX_GraphStateData* pGraphState,
- FX_DWORD fill_argb,
- FX_DWORD stroke_argb,
- int fill_mode
- )
-{
- int nPoints = pPathData->GetPointCount();
- if (nPoints == 0) {
- return TRUE;
- }
- FX_PATHPOINT* pPoints = pPathData->GetPoints();
- GpGraphics* pGraphics = NULL;
- CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
- CallFunc(GdipCreateFromHDC)(hDC, &pGraphics);
- CallFunc(GdipSetPageUnit)(pGraphics, UnitPixel);
- CallFunc(GdipSetPixelOffsetMode)(pGraphics, PixelOffsetModeHalf);
- GpMatrix* pMatrix = NULL;
- if (pObject2Device) {
- CallFunc(GdipCreateMatrix2)(pObject2Device->a, pObject2Device->b, pObject2Device->c, pObject2Device->d, pObject2Device->e, pObject2Device->f, &pMatrix);
- CallFunc(GdipSetWorldTransform)(pGraphics, pMatrix);
- }
- PointF *points = FX_Alloc(PointF, nPoints);
- if (!points) {
- return FALSE;
- }
- BYTE * types = FX_Alloc(BYTE, nPoints);
- if (!types) {
- FX_Free(points);
- return FALSE;
- }
- int nSubPathes = 0;
- FX_BOOL bSubClose = FALSE;
- int pos_subclose = 0;
- FX_BOOL bSmooth = FALSE;
- int startpoint = 0;
- for(int i = 0; i < nPoints; i++) {
- points[i].X = pPoints[i].m_PointX;
- points[i].Y = pPoints[i].m_PointY;
- FX_FLOAT x, y;
- if (pObject2Device) {
- pObject2Device->Transform(pPoints[i].m_PointX, pPoints[i].m_PointY, x, y);
- } else {
- x = pPoints[i].m_PointX;
- y = pPoints[i].m_PointY;
- }
- if (x > 50000 * 1.0f) {
- points[i].X = 50000 * 1.0f;
- }
- if (x < -50000 * 1.0f) {
- points[i].X = -50000 * 1.0f;
- }
- if (y > 50000 * 1.0f) {
- points[i].Y = 50000 * 1.0f;
- }
- if (y < -50000 * 1.0f) {
- points[i].Y = -50000 * 1.0f;
- }
- int point_type = pPoints[i].m_Flag & FXPT_TYPE;
- if(point_type == FXPT_MOVETO) {
- types[i] = PathPointTypeStart;
- nSubPathes ++;
- bSubClose = FALSE;
- startpoint = i;
- } else if (point_type == FXPT_LINETO) {
- types[i] = PathPointTypeLine;
- if (pPoints[i - 1].m_Flag == FXPT_MOVETO && (i == nPoints - 1 || pPoints[i + 1].m_Flag == FXPT_MOVETO) &&
- points[i].Y == points[i - 1].Y && points[i].X == points[i - 1].X) {
- points[i].X += 0.01f;
- continue;
- }
- if (!bSmooth && points[i].X != points[i - 1].X && points[i].Y != points[i - 1].Y) {
- bSmooth = TRUE;
- }
- } else if (point_type == FXPT_BEZIERTO) {
- types[i] = PathPointTypeBezier;
- bSmooth = TRUE;
- }
- if (pPoints[i].m_Flag & FXPT_CLOSEFIGURE) {
- if (bSubClose) {
- types[pos_subclose] &= ~PathPointTypeCloseSubpath;
- } else {
- bSubClose = TRUE;
- }
- pos_subclose = i;
- types[i] |= PathPointTypeCloseSubpath;
- if (!bSmooth && points[i].X != points[startpoint].X && points[i].Y != points[startpoint].Y) {
- bSmooth = TRUE;
- }
- }
- }
- if (fill_mode & FXFILL_NOPATHSMOOTH) {
- bSmooth = FALSE;
- CallFunc(GdipSetSmoothingMode)(pGraphics, SmoothingModeNone);
- } else if (!(fill_mode & FXFILL_FULLCOVER)) {
- if (!bSmooth && (fill_mode & 3)) {
- bSmooth = TRUE;
- }
- if (bSmooth || pGraphState && pGraphState->m_LineWidth > 2) {
- CallFunc(GdipSetSmoothingMode)(pGraphics, SmoothingModeAntiAlias);
- }
- }
- int new_fill_mode = fill_mode & 3;
- if (nPoints == 4 && pGraphState == NULL) {
- int v1, v2;
- if (IsSmallTriangle(points, pObject2Device, v1, v2)) {
- GpPen* pPen = NULL;
- CallFunc(GdipCreatePen1)(fill_argb, 1.0f, UnitPixel, &pPen);
- CallFunc(GdipDrawLineI)(pGraphics, pPen, FXSYS_round(points[v1].X), FXSYS_round(points[v1].Y),
- FXSYS_round(points[v2].X), FXSYS_round(points[v2].Y));
- CallFunc(GdipDeletePen)(pPen);
- return TRUE;
- }
- }
- GpPath* pGpPath = NULL;
- CallFunc(GdipCreatePath2)(points, types, nPoints, GdiFillType2Gdip(new_fill_mode), &pGpPath);
- if (!pGpPath) {
- if (pMatrix) {
- CallFunc(GdipDeleteMatrix)(pMatrix);
- }
- FX_Free(points);
- FX_Free(types);
- CallFunc(GdipDeleteGraphics)(pGraphics);
- return FALSE;
- }
- if (new_fill_mode) {
- GpBrush* pBrush = _GdipCreateBrush(fill_argb);
- CallFunc(GdipSetPathFillMode)(pGpPath, GdiFillType2Gdip(new_fill_mode));
- CallFunc(GdipFillPath)(pGraphics, pBrush, pGpPath);
- CallFunc(GdipDeleteBrush)(pBrush);
- }
- if (pGraphState && stroke_argb) {
- GpPen* pPen = _GdipCreatePen(pGraphState, pObject2Device, stroke_argb, fill_mode & FX_STROKE_TEXT_MODE);
- if (nSubPathes == 1) {
- CallFunc(GdipDrawPath)(pGraphics, pPen, pGpPath);
- } else {
- int iStart = 0;
- for (int i = 0; i < nPoints; i ++) {
- if (i == nPoints - 1 || types[i + 1] == PathPointTypeStart) {
- GpPath* pSubPath;
- CallFunc(GdipCreatePath2)(points + iStart, types + iStart, i - iStart + 1, GdiFillType2Gdip(new_fill_mode), &pSubPath);
- iStart = i + 1;
- CallFunc(GdipDrawPath)(pGraphics, pPen, pSubPath);
- CallFunc(GdipDeletePath)(pSubPath);
- }
- }
- }
- CallFunc(GdipDeletePen)(pPen);
- }
- if (pMatrix) {
- CallFunc(GdipDeleteMatrix)(pMatrix);
- }
- FX_Free(points);
- FX_Free(types);
- CallFunc(GdipDeletePath)(pGpPath);
- CallFunc(GdipDeleteGraphics)(pGraphics);
- return TRUE;
-}
-class GpStream : public IStream, public CFX_Object
-{
- LONG m_RefCount;
- int m_ReadPos;
- CFX_ByteTextBuf m_InterStream;
-public:
- GpStream()
- {
- m_RefCount = 1;
- m_ReadPos = 0;
- }
- virtual HRESULT STDMETHODCALLTYPE
- QueryInterface(REFIID iid, void ** ppvObject)
- {
- if (iid == __uuidof(IUnknown) || iid == __uuidof(IStream) ||
- iid == __uuidof(ISequentialStream)) {
- *ppvObject = static_cast<IStream*>(this);
- AddRef();
- return S_OK;
- } else {
- return E_NOINTERFACE;
- }
- }
- virtual ULONG STDMETHODCALLTYPE AddRef(void)
- {
- return (ULONG)InterlockedIncrement(&m_RefCount);
- }
- virtual ULONG STDMETHODCALLTYPE Release(void)
- {
- ULONG res = (ULONG) InterlockedDecrement(&m_RefCount);
- if (res == 0) {
- delete this;
- }
- return res;
- }
-public:
- virtual HRESULT STDMETHODCALLTYPE Read(void* Output, ULONG cb, ULONG* pcbRead)
- {
- size_t bytes_left;
- size_t bytes_out;
- if (pcbRead != NULL) {
- *pcbRead = 0;
- }
- if (m_ReadPos == m_InterStream.GetLength()) {
- return HRESULT_FROM_WIN32(ERROR_END_OF_MEDIA);
- }
- bytes_left = m_InterStream.GetLength() - m_ReadPos;
- bytes_out = FX_MIN(cb, bytes_left);
- FXSYS_memcpy32(Output, m_InterStream.GetBuffer() + m_ReadPos, bytes_out);
- m_ReadPos += (FX_INT32)bytes_out;
- if (pcbRead != NULL) {
- *pcbRead = (ULONG)bytes_out;
- }
- return S_OK;
- }
- virtual HRESULT STDMETHODCALLTYPE Write(void const* Input, ULONG cb, ULONG* pcbWritten)
- {
- if (cb <= 0) {
- if (pcbWritten != NULL) {
- *pcbWritten = 0;
- }
- return S_OK;
- }
- m_InterStream.InsertBlock(m_InterStream.GetLength(), Input, cb);
- if (pcbWritten != NULL) {
- *pcbWritten = cb;
- }
- return S_OK;
- }
-public:
- virtual HRESULT STDMETHODCALLTYPE SetSize(ULARGE_INTEGER)
- {
- return E_NOTIMPL;
- }
- virtual HRESULT STDMETHODCALLTYPE CopyTo(IStream*, ULARGE_INTEGER, ULARGE_INTEGER*, ULARGE_INTEGER*)
- {
- return E_NOTIMPL;
- }
- virtual HRESULT STDMETHODCALLTYPE Commit(DWORD)
- {
- return E_NOTIMPL;
- }
- virtual HRESULT STDMETHODCALLTYPE Revert(void)
- {
- return E_NOTIMPL;
- }
- virtual HRESULT STDMETHODCALLTYPE LockRegion(ULARGE_INTEGER, ULARGE_INTEGER, DWORD)
- {
- return E_NOTIMPL;
- }
- virtual HRESULT STDMETHODCALLTYPE UnlockRegion(ULARGE_INTEGER, ULARGE_INTEGER, DWORD)
- {
- return E_NOTIMPL;
- }
- virtual HRESULT STDMETHODCALLTYPE Clone(IStream **)
- {
- return E_NOTIMPL;
- }
- virtual HRESULT STDMETHODCALLTYPE Seek(LARGE_INTEGER liDistanceToMove, DWORD dwOrigin, ULARGE_INTEGER* lpNewFilePointer)
- {
- long start = 0;
- long new_read_position;
- switch(dwOrigin) {
- case STREAM_SEEK_SET:
- start = 0;
- break;
- case STREAM_SEEK_CUR:
- start = m_ReadPos;
- break;
- case STREAM_SEEK_END:
- start = m_InterStream.GetLength();
- break;
- default:
- return STG_E_INVALIDFUNCTION;
- break;
- }
- new_read_position = start + (long)liDistanceToMove.QuadPart;
- if (new_read_position < 0 || new_read_position > m_InterStream.GetLength()) {
- return STG_E_SEEKERROR;
- }
- m_ReadPos = new_read_position;
- if (lpNewFilePointer != NULL) {
- lpNewFilePointer->QuadPart = m_ReadPos;
- }
- return S_OK;
- }
- virtual HRESULT STDMETHODCALLTYPE Stat(STATSTG* pStatstg, DWORD grfStatFlag)
- {
- if (pStatstg == NULL) {
- return STG_E_INVALIDFUNCTION;
- }
- ZeroMemory(pStatstg, sizeof(STATSTG));
- pStatstg->cbSize.QuadPart = m_InterStream.GetLength();
- return S_OK;
- }
-};
-typedef struct {
- BITMAPINFO* pbmi;
- int Stride;
- LPBYTE pScan0;
- GpBitmap* pBitmap;
- BitmapData* pBitmapData;
- GpStream* pStream;
-} PREVIEW3_DIBITMAP;
-static PREVIEW3_DIBITMAP* LoadDIBitmap(WINDIB_Open_Args_ args)
-{
- GpBitmap* pBitmap;
- GpStream* pStream = NULL;
- CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
- Status status = Ok;
- if (args.flags == WINDIB_OPEN_PATHNAME) {
- status = CallFunc(GdipCreateBitmapFromFileICM)((wchar_t*)args.path_name, &pBitmap);
- } else {
- if (args.memory_size == 0 || !args.memory_base) {
- return NULL;
- }
- pStream = FX_NEW GpStream;
- if (!pStream) {
- return NULL;
- }
- pStream->Write(args.memory_base, (ULONG)args.memory_size, NULL);
- status = CallFunc(GdipCreateBitmapFromStreamICM)(pStream, &pBitmap);
- }
- if (status != Ok) {
- if (pStream) {
- pStream->Release();
- }
- return NULL;
- }
- UINT height, width;
- CallFunc(GdipGetImageHeight)(pBitmap, &height);
- CallFunc(GdipGetImageWidth)(pBitmap, &width);
- PixelFormat pixel_format;
- CallFunc(GdipGetImagePixelFormat)(pBitmap, &pixel_format);
- int info_size = sizeof(BITMAPINFOHEADER);
- int bpp = 24;
- int dest_pixel_format = PixelFormat24bppRGB;
- if (pixel_format == PixelFormat1bppIndexed) {
- info_size += 8;
- bpp = 1;
- dest_pixel_format = PixelFormat1bppIndexed;
- } else if (pixel_format == PixelFormat8bppIndexed) {
- info_size += 1024;
- bpp = 8;
- dest_pixel_format = PixelFormat8bppIndexed;
- } else if (pixel_format == PixelFormat32bppARGB) {
- bpp = 32;
- dest_pixel_format = PixelFormat32bppARGB;
- }
- LPBYTE buf = FX_Alloc(BYTE, info_size);
- if (!buf) {
- if (pStream) {
- pStream->Release();
- }
- return NULL;
- }
- BITMAPINFOHEADER* pbmih = (BITMAPINFOHEADER*)buf;
- FXSYS_memset32(buf, 0, info_size);
- pbmih->biBitCount = bpp;
- pbmih->biCompression = BI_RGB;
- pbmih->biHeight = -(int)height;
- pbmih->biPlanes = 1;
- pbmih->biWidth = width;
- Rect rect(0, 0, width, height);
- BitmapData* pBitmapData = FX_Alloc(BitmapData, 1);
- if (!pBitmapData) {
- if (pStream) {
- pStream->Release();
- }
- return NULL;
- }
- CallFunc(GdipBitmapLockBits)(pBitmap, &rect, ImageLockModeRead,
- dest_pixel_format, pBitmapData);
- if (pixel_format == PixelFormat1bppIndexed || pixel_format == PixelFormat8bppIndexed) {
- DWORD* ppal = (DWORD*)(buf + sizeof(BITMAPINFOHEADER));
- struct {
- UINT flags;
- UINT Count;
- DWORD Entries[256];
- } pal;
- int size = 0;
- CallFunc(GdipGetImagePaletteSize)(pBitmap, &size);
- CallFunc(GdipGetImagePalette)(pBitmap, (ColorPalette*)&pal, size);
- int entries = pixel_format == PixelFormat1bppIndexed ? 2 : 256;
- for (int i = 0; i < entries; i ++) {
- ppal[i] = pal.Entries[i] & 0x00ffffff;
- }
- }
- PREVIEW3_DIBITMAP* pInfo = FX_Alloc(PREVIEW3_DIBITMAP, 1);
- if (!pInfo) {
- if (pStream) {
- pStream->Release();
- }
- return NULL;
- }
- pInfo->pbmi = (BITMAPINFO*)buf;
- pInfo->pScan0 = (LPBYTE)pBitmapData->Scan0;
- pInfo->Stride = pBitmapData->Stride;
- pInfo->pBitmap = pBitmap;
- pInfo->pBitmapData = pBitmapData;
- pInfo->pStream = pStream;
- return pInfo;
-}
-static void FreeDIBitmap(PREVIEW3_DIBITMAP* pInfo)
-{
- CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
- CallFunc(GdipBitmapUnlockBits)(pInfo->pBitmap, pInfo->pBitmapData);
- CallFunc(GdipDisposeImage)(pInfo->pBitmap);
- FX_Free(pInfo->pBitmapData);
- FX_Free((LPBYTE)pInfo->pbmi);
- if (pInfo->pStream) {
- pInfo->pStream->Release();
- }
- FX_Free(pInfo);
-}
-CFX_DIBitmap* _FX_WindowsDIB_LoadFromBuf(BITMAPINFO* pbmi, LPVOID pData, FX_BOOL bAlpha);
-CFX_DIBitmap* CGdiplusExt::LoadDIBitmap(WINDIB_Open_Args_ args)
-{
- PREVIEW3_DIBITMAP* pInfo = ::LoadDIBitmap(args);
- if (pInfo == NULL) {
- return NULL;
- }
- int height = abs(pInfo->pbmi->bmiHeader.biHeight);
- int width = pInfo->pbmi->bmiHeader.biWidth;
- int dest_pitch = (width * pInfo->pbmi->bmiHeader.biBitCount + 31) / 32 * 4;
- LPBYTE pData = FX_Alloc(BYTE, dest_pitch * height);
- if (pData == NULL) {
- FreeDIBitmap(pInfo);
- return NULL;
- }
- if (dest_pitch == pInfo->Stride) {
- FXSYS_memcpy32(pData, pInfo->pScan0, dest_pitch * height);
- } else for (int i = 0; i < height; i ++) {
- FXSYS_memcpy32(pData + dest_pitch * i, pInfo->pScan0 + pInfo->Stride * i, dest_pitch);
- }
- CFX_DIBitmap* pDIBitmap = _FX_WindowsDIB_LoadFromBuf(pInfo->pbmi, pData, pInfo->pbmi->bmiHeader.biBitCount == 32);
- FX_Free(pData);
- FreeDIBitmap(pInfo);
- return pDIBitmap;
-}
-#endif
+// 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
+
+#include "../../../include/fxge/fx_ge.h"
+#if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_
+#include <windows.h>
+#include "../../../include/fxge/fx_ge_win32.h"
+#include "win32_int.h"
+#include "../Microsoft SDK/include/GdiPlus.h"
+using namespace Gdiplus;
+using namespace Gdiplus::DllExports;
+#define GdiFillType2Gdip(fill_type) (fill_type == ALTERNATE ? FillModeAlternate : FillModeWinding)
+static CombineMode GdiCombineMode2Gdip(int mode)
+{
+ switch (mode) {
+ case RGN_AND:
+ return CombineModeIntersect;
+ }
+ return CombineModeIntersect;
+}
+enum {
+ FuncId_GdipCreatePath2,
+ FuncId_GdipSetPenDashStyle,
+ FuncId_GdipSetPenDashArray,
+ FuncId_GdipSetPenDashCap197819,
+ FuncId_GdipSetPenLineJoin,
+ FuncId_GdipSetPenWidth,
+ FuncId_GdipCreateFromHDC,
+ FuncId_GdipSetPageUnit,
+ FuncId_GdipSetSmoothingMode,
+ FuncId_GdipCreateSolidFill,
+ FuncId_GdipFillPath,
+ FuncId_GdipDeleteBrush,
+ FuncId_GdipCreatePen1,
+ FuncId_GdipSetPenMiterLimit,
+ FuncId_GdipDrawPath,
+ FuncId_GdipDeletePen,
+ FuncId_GdipDeletePath,
+ FuncId_GdipDeleteGraphics,
+ FuncId_GdipCreateBitmapFromFileICM,
+ FuncId_GdipCreateBitmapFromStreamICM,
+ FuncId_GdipGetImageHeight,
+ FuncId_GdipGetImageWidth,
+ FuncId_GdipGetImagePixelFormat,
+ FuncId_GdipBitmapLockBits,
+ FuncId_GdipGetImagePaletteSize,
+ FuncId_GdipGetImagePalette,
+ FuncId_GdipBitmapUnlockBits,
+ FuncId_GdipDisposeImage,
+ FuncId_GdipFillRectangle,
+ FuncId_GdipCreateBitmapFromScan0,
+ FuncId_GdipSetImagePalette,
+ FuncId_GdipSetInterpolationMode,
+ FuncId_GdipDrawImagePointsI,
+ FuncId_GdipCreateBitmapFromGdiDib,
+ FuncId_GdiplusStartup,
+ FuncId_GdipDrawLineI,
+ FuncId_GdipResetClip,
+ FuncId_GdipCreatePath,
+ FuncId_GdipAddPathPath,
+ FuncId_GdipSetPathFillMode,
+ FuncId_GdipSetClipPath,
+ FuncId_GdipGetClip,
+ FuncId_GdipCreateRegion,
+ FuncId_GdipGetClipBoundsI,
+ FuncId_GdipSetClipRegion,
+ FuncId_GdipWidenPath,
+ FuncId_GdipAddPathLine,
+ FuncId_GdipAddPathRectangle,
+ FuncId_GdipDeleteRegion,
+ FuncId_GdipGetDC,
+ FuncId_GdipReleaseDC,
+ FuncId_GdipSetPenLineCap197819,
+ FuncId_GdipSetPenDashOffset,
+ FuncId_GdipResetPath,
+ FuncId_GdipCreateRegionPath,
+ FuncId_GdipCreateFont,
+ FuncId_GdipGetFontSize,
+ FuncId_GdipCreateFontFamilyFromName,
+ FuncId_GdipSetTextRenderingHint,
+ FuncId_GdipDrawDriverString,
+ FuncId_GdipCreateMatrix2,
+ FuncId_GdipDeleteMatrix,
+ FuncId_GdipSetWorldTransform,
+ FuncId_GdipResetWorldTransform,
+ FuncId_GdipDeleteFontFamily,
+ FuncId_GdipDeleteFont,
+ FuncId_GdipNewPrivateFontCollection,
+ FuncId_GdipDeletePrivateFontCollection,
+ FuncId_GdipPrivateAddMemoryFont,
+ FuncId_GdipGetFontCollectionFamilyList,
+ FuncId_GdipGetFontCollectionFamilyCount,
+ FuncId_GdipSetTextContrast,
+ FuncId_GdipSetPixelOffsetMode,
+ FuncId_GdipGetImageGraphicsContext,
+ FuncId_GdipDrawImageI,
+ FuncId_GdipDrawImageRectI,
+ FuncId_GdipDrawString,
+ FuncId_GdipSetPenTransform,
+};
+static LPCSTR g_GdipFuncNames[] = {
+ "GdipCreatePath2",
+ "GdipSetPenDashStyle",
+ "GdipSetPenDashArray",
+ "GdipSetPenDashCap197819",
+ "GdipSetPenLineJoin",
+ "GdipSetPenWidth",
+ "GdipCreateFromHDC",
+ "GdipSetPageUnit",
+ "GdipSetSmoothingMode",
+ "GdipCreateSolidFill",
+ "GdipFillPath",
+ "GdipDeleteBrush",
+ "GdipCreatePen1",
+ "GdipSetPenMiterLimit",
+ "GdipDrawPath",
+ "GdipDeletePen",
+ "GdipDeletePath",
+ "GdipDeleteGraphics",
+ "GdipCreateBitmapFromFileICM",
+ "GdipCreateBitmapFromStreamICM",
+ "GdipGetImageHeight",
+ "GdipGetImageWidth",
+ "GdipGetImagePixelFormat",
+ "GdipBitmapLockBits",
+ "GdipGetImagePaletteSize",
+ "GdipGetImagePalette",
+ "GdipBitmapUnlockBits",
+ "GdipDisposeImage",
+ "GdipFillRectangle",
+ "GdipCreateBitmapFromScan0",
+ "GdipSetImagePalette",
+ "GdipSetInterpolationMode",
+ "GdipDrawImagePointsI",
+ "GdipCreateBitmapFromGdiDib",
+ "GdiplusStartup",
+ "GdipDrawLineI",
+ "GdipResetClip",
+ "GdipCreatePath",
+ "GdipAddPathPath",
+ "GdipSetPathFillMode",
+ "GdipSetClipPath",
+ "GdipGetClip",
+ "GdipCreateRegion",
+ "GdipGetClipBoundsI",
+ "GdipSetClipRegion",
+ "GdipWidenPath",
+ "GdipAddPathLine",
+ "GdipAddPathRectangle",
+ "GdipDeleteRegion",
+ "GdipGetDC",
+ "GdipReleaseDC",
+ "GdipSetPenLineCap197819",
+ "GdipSetPenDashOffset",
+ "GdipResetPath",
+ "GdipCreateRegionPath",
+ "GdipCreateFont",
+ "GdipGetFontSize",
+ "GdipCreateFontFamilyFromName",
+ "GdipSetTextRenderingHint",
+ "GdipDrawDriverString",
+ "GdipCreateMatrix2",
+ "GdipDeleteMatrix",
+ "GdipSetWorldTransform",
+ "GdipResetWorldTransform",
+ "GdipDeleteFontFamily",
+ "GdipDeleteFont",
+ "GdipNewPrivateFontCollection",
+ "GdipDeletePrivateFontCollection",
+ "GdipPrivateAddMemoryFont",
+ "GdipGetFontCollectionFamilyList",
+ "GdipGetFontCollectionFamilyCount",
+ "GdipSetTextContrast",
+ "GdipSetPixelOffsetMode",
+ "GdipGetImageGraphicsContext",
+ "GdipDrawImageI",
+ "GdipDrawImageRectI",
+ "GdipDrawString",
+ "GdipSetPenTransform",
+};
+typedef GpStatus (WINGDIPAPI *FuncType_GdipCreatePath2)(GDIPCONST GpPointF*, GDIPCONST BYTE*, INT, GpFillMode, GpPath **path);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipSetPenDashStyle)(GpPen *pen, GpDashStyle dashstyle);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipSetPenDashArray)(GpPen *pen, GDIPCONST REAL *dash, INT count);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipSetPenDashCap197819)(GpPen *pen, GpDashCap dashCap);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipSetPenLineJoin)(GpPen *pen, GpLineJoin lineJoin);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipSetPenWidth)(GpPen *pen, REAL width);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipCreateFromHDC)(HDC hdc, GpGraphics **graphics);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipSetPageUnit)(GpGraphics *graphics, GpUnit unit);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipSetSmoothingMode)(GpGraphics *graphics, SmoothingMode smoothingMode);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipCreateSolidFill)(ARGB color, GpSolidFill **brush);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipFillPath)(GpGraphics *graphics, GpBrush *brush, GpPath *path);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipDeleteBrush)(GpBrush *brush);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipCreatePen1)(ARGB color, REAL width, GpUnit unit, GpPen **pen);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipSetPenMiterLimit)(GpPen *pen, REAL miterLimit);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipDrawPath)(GpGraphics *graphics, GpPen *pen, GpPath *path);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipDeletePen)(GpPen *pen);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipDeletePath)(GpPath* path);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipDeleteGraphics)(GpGraphics *graphics);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipCreateBitmapFromFileICM)(GDIPCONST WCHAR* filename, GpBitmap **bitmap);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipCreateBitmapFromStreamICM)(IStream* stream, GpBitmap **bitmap);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipGetImageWidth)(GpImage *image, UINT *width);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipGetImageHeight)(GpImage *image, UINT *height);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipGetImagePixelFormat)(GpImage *image, PixelFormat *format);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipBitmapLockBits)(GpBitmap* bitmap, GDIPCONST GpRect* rect, UINT flags, PixelFormat format, BitmapData* lockedBitmapData);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipGetImagePalette)(GpImage *image, ColorPalette *palette, INT size);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipGetImagePaletteSize)(GpImage *image, INT *size);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipBitmapUnlockBits)(GpBitmap* bitmap, BitmapData* lockedBitmapData);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipDisposeImage)(GpImage *image);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipFillRectangle)(GpGraphics *graphics, GpBrush *brush, REAL x, REAL y, REAL width, REAL height);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipCreateBitmapFromScan0)(INT width, INT height, INT stride, PixelFormat format, BYTE* scan0, GpBitmap** bitmap);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipSetImagePalette)(GpImage *image, GDIPCONST ColorPalette *palette);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipSetInterpolationMode)(GpGraphics *graphics, InterpolationMode interpolationMode);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipDrawImagePointsI)(GpGraphics *graphics, GpImage *image, GDIPCONST GpPoint *dstpoints, INT count);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipCreateBitmapFromGdiDib)(GDIPCONST BITMAPINFO* gdiBitmapInfo, VOID* gdiBitmapData, GpBitmap** bitmap);
+typedef Status (WINAPI *FuncType_GdiplusStartup)(OUT FX_UINTPTR *token, const GdiplusStartupInput *input, OUT GdiplusStartupOutput *output);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipDrawLineI)(GpGraphics *graphics, GpPen *pen, int x1, int y1, int x2, int y2);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipResetClip)(GpGraphics *graphics);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipCreatePath)(GpFillMode brushMode, GpPath **path);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipAddPathPath)(GpPath *path, GDIPCONST GpPath* addingPath, BOOL connect);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipSetPathFillMode)(GpPath *path, GpFillMode fillmode);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipSetClipPath)(GpGraphics *graphics, GpPath *path, CombineMode combineMode);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipGetClip)(GpGraphics *graphics, GpRegion *region);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipCreateRegion)(GpRegion **region);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipGetClipBoundsI)(GpGraphics *graphics, GpRect *rect);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipSetClipRegion)(GpGraphics *graphics, GpRegion *region, CombineMode combineMode);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipWidenPath)(GpPath *nativePath, GpPen *pen, GpMatrix *matrix, REAL flatness);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipAddPathLine)(GpPath *path, REAL x1, REAL y1, REAL x2, REAL y2);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipAddPathRectangle)(GpPath *path, REAL x, REAL y, REAL width, REAL height);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipDeleteRegion)(GpRegion *region);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipGetDC)(GpGraphics* graphics, HDC * hdc);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipReleaseDC)(GpGraphics* graphics, HDC hdc);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipSetPenLineCap197819)(GpPen *pen, GpLineCap startCap, GpLineCap endCap, GpDashCap dashCap);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipSetPenDashOffset)(GpPen *pen, REAL offset);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipResetPath)(GpPath *path);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipCreateRegionPath)(GpPath *path, GpRegion **region);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipCreateFont)(GDIPCONST GpFontFamily *fontFamily, REAL emSize, INT style, Unit unit, GpFont **font);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipGetFontSize)(GpFont *font, REAL *size);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipCreateFontFamilyFromName)(GDIPCONST WCHAR *name, GpFontCollection *fontCollection, GpFontFamily **FontFamily);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipSetTextRenderingHint)(GpGraphics *graphics, TextRenderingHint mode);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipDrawDriverString)(GpGraphics *graphics, GDIPCONST UINT16 *text, INT length, GDIPCONST GpFont *font, GDIPCONST GpBrush *brush, GDIPCONST PointF *positions, INT flags, GDIPCONST GpMatrix *matrix);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipCreateMatrix2)(REAL m11, REAL m12, REAL m21, REAL m22, REAL dx, REAL dy, GpMatrix **matrix);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipDeleteMatrix)(GpMatrix *matrix);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipSetWorldTransform)(GpGraphics *graphics, GpMatrix *matrix);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipResetWorldTransform)(GpGraphics *graphics);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipDeleteFontFamily)(GpFontFamily *FontFamily);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipDeleteFont)(GpFont* font);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipNewPrivateFontCollection)(GpFontCollection** fontCollection);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipDeletePrivateFontCollection)(GpFontCollection** fontCollection);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipPrivateAddMemoryFont)(GpFontCollection* fontCollection, GDIPCONST void* memory, INT length);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipGetFontCollectionFamilyList)(GpFontCollection* fontCollection, INT numSought, GpFontFamily* gpfamilies[], INT* numFound);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipGetFontCollectionFamilyCount)(GpFontCollection* fontCollection, INT* numFound);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipSetTextContrast)(GpGraphics *graphics, UINT contrast);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipSetPixelOffsetMode)(GpGraphics* graphics, PixelOffsetMode pixelOffsetMode);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipGetImageGraphicsContext)(GpImage *image, GpGraphics **graphics);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipDrawImageI)(GpGraphics *graphics, GpImage *image, INT x, INT y);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipDrawImageRectI)(GpGraphics *graphics, GpImage *image, INT x, INT y, INT width, INT height);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipDrawString)(GpGraphics *graphics, GDIPCONST WCHAR *string, INT length, GDIPCONST GpFont *font, GDIPCONST RectF *layoutRect, GDIPCONST GpStringFormat *stringFormat, GDIPCONST GpBrush *brush);
+typedef GpStatus (WINGDIPAPI *FuncType_GdipSetPenTransform)(GpPen *pen, GpMatrix *matrix);
+#define CallFunc(funcname) ((FuncType_##funcname)GdiplusExt.m_Functions[FuncId_##funcname])
+typedef HANDLE (__stdcall *FuncType_GdiAddFontMemResourceEx)(PVOID pbFont, DWORD cbFont, PVOID pdv, DWORD *pcFonts);
+typedef BOOL (__stdcall *FuncType_GdiRemoveFontMemResourceEx)(HANDLE handle);
+void* CGdiplusExt::GdiAddFontMemResourceEx(void *pFontdata, FX_DWORD size, void* pdv, FX_DWORD* num_face)
+{
+ if (m_pGdiAddFontMemResourceEx) {
+ return ((FuncType_GdiAddFontMemResourceEx)m_pGdiAddFontMemResourceEx)((PVOID)pFontdata, (DWORD)size, (PVOID)pdv, (DWORD*)num_face);
+ }
+ return NULL;
+}
+FX_BOOL CGdiplusExt::GdiRemoveFontMemResourceEx(void* handle)
+{
+ if (m_pGdiRemoveFontMemResourseEx) {
+ return ((FuncType_GdiRemoveFontMemResourceEx)m_pGdiRemoveFontMemResourseEx)((HANDLE)handle);
+ }
+ return FALSE;
+}
+static GpBrush* _GdipCreateBrush(DWORD argb)
+{
+ CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
+ GpSolidFill* solidBrush = NULL;
+ CallFunc(GdipCreateSolidFill)((ARGB)argb, &solidBrush);
+ return solidBrush;
+}
+static CFX_DIBitmap* _StretchMonoToGray(int dest_width, int dest_height,
+ const CFX_DIBitmap* pSource, FX_RECT* pClipRect)
+{
+ FX_BOOL bFlipX = dest_width < 0;
+ if (bFlipX) {
+ dest_width = -dest_width;
+ }
+ FX_BOOL bFlipY = dest_height < 0;
+ if (bFlipY) {
+ dest_height = -dest_height;
+ }
+ int result_width = pClipRect->Width();
+ int result_height = pClipRect->Height();
+ int result_pitch = (result_width + 3) / 4 * 4;
+ CFX_DIBitmap* pStretched = FX_NEW CFX_DIBitmap;
+ if (!pStretched) {
+ return NULL;
+ }
+ if (!pStretched->Create(result_width, result_height, FXDIB_8bppRgb)) {
+ delete pStretched;
+ return NULL;
+ }
+ LPBYTE dest_buf = pStretched->GetBuffer();
+ int src_width = pSource->GetWidth();
+ int src_height = pSource->GetHeight();
+ int src_count = src_width * src_height;
+ int dest_count = dest_width * dest_height;
+ int ratio = 255 * dest_count / src_count;
+ int y_unit = src_height / dest_height;
+ int x_unit = src_width / dest_width;
+ int area_unit = y_unit * x_unit;
+ LPBYTE src_buf = pSource->GetBuffer();
+ int src_pitch = pSource->GetPitch();
+ for (int dest_y = 0; dest_y < result_height; dest_y ++) {
+ LPBYTE dest_scan = dest_buf + dest_y * result_pitch;
+ int src_y_start = bFlipY ? (dest_height - 1 - dest_y - pClipRect->top) : (dest_y + pClipRect->top);
+ src_y_start = src_y_start * src_height / dest_height;
+ LPBYTE src_scan = src_buf + src_y_start * src_pitch;
+ for (int dest_x = 0; dest_x < result_width; dest_x ++) {
+ int sum = 0;
+ int src_x_start = bFlipX ? (dest_width - 1 - dest_x - pClipRect->left) : (dest_x + pClipRect->left);
+ src_x_start = src_x_start * src_width / dest_width;
+ int src_x_end = src_x_start + x_unit;
+ LPBYTE src_line = src_scan;
+ for (int src_y = 0; src_y < y_unit; src_y ++) {
+ for (int src_x = src_x_start; src_x < src_x_end; src_x ++) {
+ if (!(src_line[src_x / 8] & (1 << (7 - src_x % 8)))) {
+ sum += 255;
+ }
+ }
+ src_line += src_pitch;
+ }
+ dest_scan[dest_x] = 255 - sum / area_unit;
+ }
+ }
+ return pStretched;
+}
+static void OutputImageMask(GpGraphics* pGraphics, BOOL bMonoDevice, const CFX_DIBitmap* pBitmap, int dest_left, int dest_top,
+ int dest_width, int dest_height, FX_ARGB argb, const FX_RECT* pClipRect)
+{
+ ASSERT(pBitmap->GetBPP() == 1);
+ CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
+ int src_width = pBitmap->GetWidth(), src_height = pBitmap->GetHeight();
+ int src_pitch = pBitmap->GetPitch();
+ FX_LPBYTE scan0 = pBitmap->GetBuffer();
+ if (src_width == 1 && src_height == 1) {
+ if ((scan0[0] & 0x80) == 0) {
+ return;
+ }
+ GpSolidFill* solidBrush;
+ CallFunc(GdipCreateSolidFill)((ARGB)argb, &solidBrush);
+ if (dest_width < 0) {
+ dest_width = -dest_width;
+ dest_left -= dest_width;
+ }
+ if (dest_height < 0) {
+ dest_height = -dest_height;
+ dest_top -= dest_height;
+ }
+ CallFunc(GdipFillRectangle)(pGraphics, solidBrush, (float)dest_left, (float)dest_top,
+ (float)dest_width, (float)dest_height);
+ CallFunc(GdipDeleteBrush)(solidBrush);
+ return;
+ }
+ if (!bMonoDevice && abs(dest_width) < src_width && abs(dest_height) < src_height) {
+ FX_RECT image_rect(dest_left, dest_top, dest_left + dest_width, dest_top + dest_height);
+ image_rect.Normalize();
+ FX_RECT image_clip = image_rect;
+ image_clip.Intersect(*pClipRect);
+ if (image_clip.IsEmpty()) {
+ return;
+ }
+ image_clip.Offset(-image_rect.left, -image_rect.top);
+ CFX_DIBitmap* pStretched = NULL;
+ if (src_width * src_height > 10000) {
+ pStretched = _StretchMonoToGray(dest_width, dest_height, pBitmap, &image_clip);
+ } else {
+ pStretched = pBitmap->StretchTo(dest_width, dest_height, FALSE, &image_clip);
+ }
+ GpBitmap* bitmap;
+ CallFunc(GdipCreateBitmapFromScan0)(image_clip.Width(), image_clip.Height(),
+ (image_clip.Width() + 3) / 4 * 4, PixelFormat8bppIndexed, pStretched->GetBuffer(), &bitmap);
+ int a, r, g, b;
+ ArgbDecode(argb, a, r, g, b);
+ UINT pal[258];
+ pal[0] = 0;
+ pal[1] = 256;
+ for (int i = 0; i < 256; i ++) {
+ pal[i + 2] = ArgbEncode(i * a / 255, r, g, b);
+ }
+ CallFunc(GdipSetImagePalette)(bitmap, (ColorPalette*)pal);
+ CallFunc(GdipDrawImageI)(pGraphics, bitmap, image_rect.left + image_clip.left,
+ image_rect.top + image_clip.top);
+ CallFunc(GdipDisposeImage)(bitmap);
+ delete pStretched;
+ return;
+ }
+ GpBitmap* bitmap;
+ CallFunc(GdipCreateBitmapFromScan0)(src_width, src_height, src_pitch, PixelFormat1bppIndexed, scan0, &bitmap);
+ UINT palette[4] = { PaletteFlagsHasAlpha, 2, 0, argb };
+ CallFunc(GdipSetImagePalette)(bitmap, (ColorPalette*)palette);
+ Point destinationPoints[] = {
+ Point(dest_left, dest_top),
+ Point(dest_left + dest_width, dest_top),
+ Point(dest_left, dest_top + dest_height)
+ };
+ CallFunc(GdipDrawImagePointsI)(pGraphics, bitmap, destinationPoints, 3);
+ CallFunc(GdipDisposeImage)(bitmap);
+}
+static void OutputImage(GpGraphics* pGraphics, const CFX_DIBitmap* pBitmap, const FX_RECT* pSrcRect,
+ int dest_left, int dest_top, int dest_width, int dest_height)
+{
+ int src_width = pSrcRect->Width(), src_height = pSrcRect->Height();
+ CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
+ if (pBitmap->GetBPP() == 1 && (pSrcRect->left % 8)) {
+ FX_RECT new_rect(0, 0, src_width, src_height);
+ CFX_DIBitmap* pCloned = pBitmap->Clone(pSrcRect);
+ if (!pCloned) {
+ return;
+ }
+ OutputImage(pGraphics, pCloned, &new_rect, dest_left, dest_top, dest_width, dest_height);
+ delete pCloned;
+ return;
+ }
+ int src_pitch = pBitmap->GetPitch();
+ FX_LPBYTE scan0 = pBitmap->GetBuffer() + pSrcRect->top * src_pitch + pBitmap->GetBPP() * pSrcRect->left / 8;
+ GpBitmap* bitmap = NULL;
+ switch (pBitmap->GetFormat()) {
+ case FXDIB_Argb:
+ CallFunc(GdipCreateBitmapFromScan0)(src_width, src_height, src_pitch,
+ PixelFormat32bppARGB, scan0, &bitmap);
+ break;
+ case FXDIB_Rgb32:
+ CallFunc(GdipCreateBitmapFromScan0)(src_width, src_height, src_pitch,
+ PixelFormat32bppRGB, scan0, &bitmap);
+ break;
+ case FXDIB_Rgb:
+ CallFunc(GdipCreateBitmapFromScan0)(src_width, src_height, src_pitch,
+ PixelFormat24bppRGB, scan0, &bitmap);
+ break;
+ case FXDIB_8bppRgb: {
+ CallFunc(GdipCreateBitmapFromScan0)(src_width, src_height, src_pitch,
+ PixelFormat8bppIndexed, scan0, &bitmap);
+ UINT pal[258];
+ pal[0] = 0;
+ pal[1] = 256;
+ for (int i = 0; i < 256; i ++) {
+ pal[i + 2] = pBitmap->GetPaletteEntry(i);
+ }
+ CallFunc(GdipSetImagePalette)(bitmap, (ColorPalette*)pal);
+ break;
+ }
+ case FXDIB_1bppRgb: {
+ CallFunc(GdipCreateBitmapFromScan0)(src_width, src_height, src_pitch,
+ PixelFormat1bppIndexed, scan0, &bitmap);
+ break;
+ }
+ }
+ if (dest_height < 0) {
+ dest_height --;
+ }
+ if (dest_width < 0) {
+ dest_width --;
+ }
+ Point destinationPoints[] = {
+ Point(dest_left, dest_top),
+ Point(dest_left + dest_width, dest_top),
+ Point(dest_left, dest_top + dest_height)
+ };
+ CallFunc(GdipDrawImagePointsI)(pGraphics, bitmap, destinationPoints, 3);
+ CallFunc(GdipDisposeImage)(bitmap);
+}
+CGdiplusExt::CGdiplusExt()
+{
+ m_hModule = NULL;
+ m_GdiModule = NULL;
+ for (int i = 0; i < sizeof g_GdipFuncNames / sizeof(LPCSTR); i ++) {
+ m_Functions[i] = NULL;
+ }
+ m_pGdiAddFontMemResourceEx = NULL;
+ m_pGdiRemoveFontMemResourseEx = NULL;
+}
+void CGdiplusExt::Load()
+{
+ CFX_ByteString strPlusPath = "";
+ FX_CHAR buf[MAX_PATH];
+ GetSystemDirectoryA(buf, MAX_PATH);
+ strPlusPath += buf;
+ strPlusPath += "\\";
+ strPlusPath += "GDIPLUS.DLL";
+ m_hModule = LoadLibraryA(strPlusPath);
+ if (m_hModule == NULL) {
+ return;
+ }
+ for (int i = 0; i < sizeof g_GdipFuncNames / sizeof(LPCSTR); i ++) {
+ m_Functions[i] = GetProcAddress(m_hModule, g_GdipFuncNames[i]);
+ if (m_Functions[i] == NULL) {
+ m_hModule = NULL;
+ return;
+ }
+ }
+ FX_UINTPTR gdiplusToken;
+ GdiplusStartupInput gdiplusStartupInput;
+ ((FuncType_GdiplusStartup)m_Functions[FuncId_GdiplusStartup])(&gdiplusToken, &gdiplusStartupInput, NULL);
+ m_GdiModule = LoadLibraryA("GDI32.DLL");
+ if (m_GdiModule == NULL) {
+ return;
+ }
+ m_pGdiAddFontMemResourceEx = GetProcAddress(m_GdiModule, "AddFontMemResourceEx");
+ m_pGdiRemoveFontMemResourseEx = GetProcAddress(m_GdiModule, "RemoveFontMemResourceEx");
+}
+CGdiplusExt::~CGdiplusExt()
+{
+}
+LPVOID CGdiplusExt::LoadMemFont(LPBYTE pData, FX_DWORD size)
+{
+ GpFontCollection* pCollection = NULL;
+ CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
+ CallFunc(GdipNewPrivateFontCollection)(&pCollection);
+ GpStatus status = CallFunc(GdipPrivateAddMemoryFont)(pCollection, pData, size);
+ if (status == Ok) {
+ return pCollection;
+ }
+ CallFunc(GdipDeletePrivateFontCollection)(&pCollection);
+ return NULL;
+}
+void CGdiplusExt::DeleteMemFont(LPVOID pCollection)
+{
+ CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
+ CallFunc(GdipDeletePrivateFontCollection)((GpFontCollection**)&pCollection);
+}
+FX_BOOL CGdiplusExt::GdipCreateBitmap(CFX_DIBitmap* pBitmap, void**bitmap)
+{
+ CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
+ PixelFormat format;
+ switch (pBitmap->GetFormat()) {
+ case FXDIB_Rgb:
+ format = PixelFormat24bppRGB;
+ break;
+ case FXDIB_Rgb32:
+ format = PixelFormat32bppRGB;
+ break;
+ case FXDIB_Argb:
+ format = PixelFormat32bppARGB;
+ break;
+ default:
+ return FALSE;
+ }
+ GpStatus status = CallFunc(GdipCreateBitmapFromScan0)(pBitmap->GetWidth(), pBitmap->GetHeight(),
+ pBitmap->GetPitch(), format, pBitmap->GetBuffer(), (GpBitmap**)bitmap);
+ if (status == Ok) {
+ return TRUE;
+ }
+ return FALSE;
+}
+FX_BOOL CGdiplusExt::GdipCreateFromImage(void* bitmap, void** graphics)
+{
+ CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
+ GpStatus status = CallFunc(GdipGetImageGraphicsContext)((GpBitmap*)bitmap, (GpGraphics**)graphics);
+ if (status == Ok) {
+ return TRUE;
+ }
+ return FALSE;
+}
+FX_BOOL CGdiplusExt::GdipCreateFontFamilyFromName(FX_LPCWSTR name, void* pFontCollection, void**pFamily)
+{
+ CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
+ GpStatus status = CallFunc(GdipCreateFontFamilyFromName)((GDIPCONST WCHAR *)name, (GpFontCollection*)pFontCollection, (GpFontFamily**)pFamily);
+ if (status == Ok) {
+ return TRUE;
+ }
+ return FALSE;
+}
+FX_BOOL CGdiplusExt::GdipCreateFontFromFamily(void* pFamily, FX_FLOAT font_size, int fontstyle, int flag, void** pFont)
+{
+ CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
+ GpStatus status = CallFunc(GdipCreateFont)((GpFontFamily*)pFamily, font_size, fontstyle, Unit(flag), (GpFont**)pFont);
+ if (status == Ok) {
+ return TRUE;
+ }
+ return FALSE;
+}
+void CGdiplusExt::GdipGetFontSize(void *pFont, FX_FLOAT *size)
+{
+ REAL get_size;
+ CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
+ GpStatus status = CallFunc(GdipGetFontSize)((GpFont *)pFont, (REAL*)&get_size);
+ if (status == Ok) {
+ *size = (FX_FLOAT)get_size;
+ } else {
+ *size = 0;
+ }
+}
+void CGdiplusExt::GdipSetTextRenderingHint(void* graphics, int mode)
+{
+ CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
+ CallFunc(GdipSetTextRenderingHint)((GpGraphics*)graphics, (TextRenderingHint)mode);
+}
+void CGdiplusExt::GdipSetPageUnit(void* graphics, FX_DWORD unit)
+{
+ CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
+ CallFunc(GdipSetPageUnit)((GpGraphics*)graphics, (GpUnit)unit);
+}
+FX_BOOL CGdiplusExt::GdipDrawDriverString(void *graphics, unsigned short *text, int length,
+ void *font, void* brush, void *positions, int flags, const void *matrix)
+{
+ CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
+ GpStatus status = CallFunc(GdipDrawDriverString)((GpGraphics*)graphics, (GDIPCONST UINT16 *)text, (INT)length, (GDIPCONST GpFont *)font, (GDIPCONST GpBrush*)brush,
+ (GDIPCONST PointF *)positions, (INT)flags, (GDIPCONST GpMatrix *)matrix);
+ if (status == Ok) {
+ return TRUE;
+ }
+ return FALSE;
+}
+void CGdiplusExt::GdipCreateBrush(FX_DWORD fill_argb, void** pBrush)
+{
+ CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
+ CallFunc(GdipCreateSolidFill)((ARGB)fill_argb, (GpSolidFill**)pBrush);
+}
+void CGdiplusExt::GdipDeleteBrush(void* pBrush)
+{
+ CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
+ CallFunc(GdipDeleteBrush)((GpSolidFill*)pBrush);
+}
+void* CGdiplusExt::GdipCreateFontFromCollection(void* pFontCollection, FX_FLOAT font_size, int fontstyle)
+{
+ CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
+ int numFamilies = 0;
+ GpStatus status = CallFunc(GdipGetFontCollectionFamilyCount)((GpFontCollection*)pFontCollection, &numFamilies);
+ if (status != Ok) {
+ return NULL;
+ }
+ GpFontFamily* family_list[1];
+ status = CallFunc(GdipGetFontCollectionFamilyList)((GpFontCollection*)pFontCollection, 1, family_list, &numFamilies);
+ if (status != Ok) {
+ return NULL;
+ }
+ GpFont* pFont = NULL;
+ status = CallFunc(GdipCreateFont)(family_list[0], font_size, fontstyle, UnitPixel, &pFont);
+ if (status != Ok) {
+ return NULL;
+ }
+ return pFont;
+}
+void CGdiplusExt::GdipCreateMatrix(FX_FLOAT a, FX_FLOAT b, FX_FLOAT c, FX_FLOAT d, FX_FLOAT e, FX_FLOAT f, void** matrix)
+{
+ CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
+ CallFunc(GdipCreateMatrix2)(a, b, c, d, e, f, (GpMatrix**)matrix);
+}
+void CGdiplusExt::GdipDeleteMatrix(void* matrix)
+{
+ CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
+ CallFunc(GdipDeleteMatrix)((GpMatrix*)matrix);
+}
+void CGdiplusExt::GdipDeleteFontFamily(void* pFamily)
+{
+ CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
+ CallFunc(GdipDeleteFontFamily)((GpFontFamily*)pFamily);
+}
+void CGdiplusExt::GdipDeleteFont(void* pFont)
+{
+ CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
+ CallFunc(GdipDeleteFont)((GpFont*)pFont);
+}
+void CGdiplusExt::GdipSetWorldTransform(void* graphics, void* pMatrix)
+{
+ CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
+ CallFunc(GdipSetWorldTransform)((GpGraphics*)graphics, (GpMatrix*)pMatrix);
+}
+void CGdiplusExt::GdipDisposeImage(void* bitmap)
+{
+ CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
+ CallFunc(GdipDisposeImage)((GpBitmap*)bitmap);
+}
+void CGdiplusExt::GdipDeleteGraphics(void* graphics)
+{
+ CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
+ CallFunc(GdipDeleteGraphics)((GpGraphics*)graphics);
+}
+FX_BOOL CGdiplusExt::StretchBitMask(HDC hDC, BOOL bMonoDevice, const CFX_DIBitmap* pBitmap, int dest_left, int dest_top,
+ int dest_width, int dest_height, FX_DWORD argb, const FX_RECT* pClipRect, int flags)
+{
+ ASSERT(pBitmap->GetBPP() == 1);
+ CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
+ GpGraphics* pGraphics = NULL;
+ CallFunc(GdipCreateFromHDC)(hDC, &pGraphics);
+ CallFunc(GdipSetPageUnit)(pGraphics, UnitPixel);
+ if (flags & FXDIB_NOSMOOTH) {
+ CallFunc(GdipSetInterpolationMode)(pGraphics, InterpolationModeNearestNeighbor);
+ } else {
+ CallFunc(GdipSetInterpolationMode)(pGraphics, InterpolationModeHighQuality);
+ }
+ OutputImageMask(pGraphics, bMonoDevice, pBitmap, dest_left, dest_top, dest_width, dest_height, argb, pClipRect);
+ CallFunc(GdipDeleteGraphics)(pGraphics);
+ return TRUE;
+}
+FX_BOOL CGdiplusExt::StretchDIBits(HDC hDC, const CFX_DIBitmap* pBitmap, int dest_left, int dest_top,
+ int dest_width, int dest_height, const FX_RECT* pClipRect, int flags)
+{
+ GpGraphics* pGraphics;
+ CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
+ CallFunc(GdipCreateFromHDC)(hDC, &pGraphics);
+ CallFunc(GdipSetPageUnit)(pGraphics, UnitPixel);
+ if (flags & FXDIB_NOSMOOTH) {
+ CallFunc(GdipSetInterpolationMode)(pGraphics, InterpolationModeNearestNeighbor);
+ } else if (pBitmap->GetWidth() > abs(dest_width) / 2 || pBitmap->GetHeight() > abs(dest_height) / 2) {
+ CallFunc(GdipSetInterpolationMode)(pGraphics, InterpolationModeHighQuality);
+ } else {
+ CallFunc(GdipSetInterpolationMode)(pGraphics, InterpolationModeBilinear);
+ }
+ FX_RECT src_rect(0, 0, pBitmap->GetWidth(), pBitmap->GetHeight());
+ OutputImage(pGraphics, pBitmap, &src_rect, dest_left, dest_top, dest_width, dest_height);
+ CallFunc(GdipDeleteGraphics)(pGraphics);
+ CallFunc(GdipDeleteGraphics)(pGraphics);
+ return TRUE;
+}
+static GpPen* _GdipCreatePen(const CFX_GraphStateData* pGraphState, const CFX_AffineMatrix* pMatrix, DWORD argb, FX_BOOL bTextMode = FALSE)
+{
+ CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
+ FX_FLOAT width = pGraphState ? pGraphState->m_LineWidth : 1.0f;
+ if (!bTextMode) {
+ FX_FLOAT unit = pMatrix == NULL ? 1.0f : FXSYS_Div(1.0f, (pMatrix->GetXUnit() + pMatrix->GetYUnit()) / 2);
+ if (width < unit) {
+ width = unit;
+ }
+ }
+ GpPen* pPen = NULL;
+ CallFunc(GdipCreatePen1)((ARGB)argb, width, UnitWorld, &pPen);
+ LineCap lineCap;
+ DashCap dashCap = DashCapFlat;
+ FX_BOOL bDashExtend = FALSE;
+ switch(pGraphState->m_LineCap) {
+ case CFX_GraphStateData::LineCapButt:
+ lineCap = LineCapFlat;
+ break;
+ case CFX_GraphStateData::LineCapRound:
+ lineCap = LineCapRound;
+ dashCap = DashCapRound;
+ bDashExtend = TRUE;
+ break;
+ case CFX_GraphStateData::LineCapSquare:
+ lineCap = LineCapSquare;
+ bDashExtend = TRUE;
+ break;
+ }
+ CallFunc(GdipSetPenLineCap197819)(pPen, lineCap, lineCap, dashCap);
+ LineJoin lineJoin;
+ switch(pGraphState->m_LineJoin) {
+ case CFX_GraphStateData::LineJoinMiter:
+ lineJoin = LineJoinMiterClipped;
+ break;
+ case CFX_GraphStateData::LineJoinRound:
+ lineJoin = LineJoinRound;
+ break;
+ case CFX_GraphStateData::LineJoinBevel:
+ lineJoin = LineJoinBevel;
+ break;
+ }
+ CallFunc(GdipSetPenLineJoin)(pPen, lineJoin);
+ if(pGraphState->m_DashCount) {
+ FX_FLOAT* pDashArray = FX_Alloc(FX_FLOAT, pGraphState->m_DashCount + pGraphState->m_DashCount % 2);
+ if (!pDashArray) {
+ return NULL;
+ }
+ int nCount = 0;
+ FX_FLOAT on_leftover = 0, off_leftover = 0;
+ for (int i = 0; i < pGraphState->m_DashCount; i += 2) {
+ FX_FLOAT on_phase = pGraphState->m_DashArray[i];
+ FX_FLOAT off_phase;
+ if (i == pGraphState->m_DashCount - 1) {
+ off_phase = on_phase;
+ } else {
+ off_phase = pGraphState->m_DashArray[i + 1];
+ }
+ on_phase /= width;
+ off_phase /= width;
+ if (on_phase + off_phase <= 0.00002f) {
+ on_phase = 1.0f / 10;
+ off_phase = 1.0f / 10;
+ }
+ if (bDashExtend) {
+ if (off_phase < 1) {
+ off_phase = 0;
+ } else {
+ off_phase -= 1;
+ }
+ on_phase += 1;
+ }
+ if (on_phase == 0 || off_phase == 0) {
+ if (nCount == 0) {
+ on_leftover += on_phase;
+ off_leftover += off_phase;
+ } else {
+ pDashArray[nCount - 2] += on_phase;
+ pDashArray[nCount - 1] += off_phase;
+ }
+ } else {
+ pDashArray[nCount++] = on_phase + on_leftover;
+ on_leftover = 0;
+ pDashArray[nCount++] = off_phase + off_leftover;
+ off_leftover = 0;
+ }
+ }
+ CallFunc(GdipSetPenDashArray)(pPen, pDashArray, nCount);
+ FX_FLOAT phase = pGraphState->m_DashPhase;
+ if (bDashExtend)
+ if (phase < 0.5f) {
+ phase = 0;
+ } else {
+ phase -= 0.5f;
+ }
+ CallFunc(GdipSetPenDashOffset)(pPen, phase);
+ FX_Free(pDashArray);
+ pDashArray = NULL;
+ }
+ CallFunc(GdipSetPenMiterLimit)(pPen, pGraphState->m_MiterLimit);
+ return pPen;
+}
+static BOOL IsSmallTriangle(PointF* points, const CFX_AffineMatrix* pMatrix, int& v1, int& v2)
+{
+ int pairs[] = {1, 2, 0, 2, 0, 1};
+ for (int i = 0; i < 3; i ++) {
+ int pair1 = pairs[i * 2];
+ int pair2 = pairs[i * 2 + 1];
+ FX_FLOAT x1 = points[pair1].X, x2 = points[pair2].X;
+ FX_FLOAT y1 = points[pair1].Y, y2 = points[pair2].Y;
+ if (pMatrix) {
+ pMatrix->Transform(x1, y1);
+ pMatrix->Transform(x2, y2);
+ }
+ FX_FLOAT dx = x1 - x2;
+ FX_FLOAT dy = y1 - y2;
+ FX_FLOAT distance_square = FXSYS_Mul(dx, dx) + FXSYS_Mul(dy, dy);
+ if (distance_square < (1.0f * 2 + 1.0f / 4)) {
+ v1 = i;
+ v2 = pair1;
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+BOOL CGdiplusExt::DrawPath(HDC hDC, const CFX_PathData* pPathData,
+ const CFX_AffineMatrix* pObject2Device,
+ const CFX_GraphStateData* pGraphState,
+ FX_DWORD fill_argb,
+ FX_DWORD stroke_argb,
+ int fill_mode
+ )
+{
+ int nPoints = pPathData->GetPointCount();
+ if (nPoints == 0) {
+ return TRUE;
+ }
+ FX_PATHPOINT* pPoints = pPathData->GetPoints();
+ GpGraphics* pGraphics = NULL;
+ CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
+ CallFunc(GdipCreateFromHDC)(hDC, &pGraphics);
+ CallFunc(GdipSetPageUnit)(pGraphics, UnitPixel);
+ CallFunc(GdipSetPixelOffsetMode)(pGraphics, PixelOffsetModeHalf);
+ GpMatrix* pMatrix = NULL;
+ if (pObject2Device) {
+ CallFunc(GdipCreateMatrix2)(pObject2Device->a, pObject2Device->b, pObject2Device->c, pObject2Device->d, pObject2Device->e, pObject2Device->f, &pMatrix);
+ CallFunc(GdipSetWorldTransform)(pGraphics, pMatrix);
+ }
+ PointF *points = FX_Alloc(PointF, nPoints);
+ if (!points) {
+ return FALSE;
+ }
+ BYTE * types = FX_Alloc(BYTE, nPoints);
+ if (!types) {
+ FX_Free(points);
+ return FALSE;
+ }
+ int nSubPathes = 0;
+ FX_BOOL bSubClose = FALSE;
+ int pos_subclose = 0;
+ FX_BOOL bSmooth = FALSE;
+ int startpoint = 0;
+ for(int i = 0; i < nPoints; i++) {
+ points[i].X = pPoints[i].m_PointX;
+ points[i].Y = pPoints[i].m_PointY;
+ FX_FLOAT x, y;
+ if (pObject2Device) {
+ pObject2Device->Transform(pPoints[i].m_PointX, pPoints[i].m_PointY, x, y);
+ } else {
+ x = pPoints[i].m_PointX;
+ y = pPoints[i].m_PointY;
+ }
+ if (x > 50000 * 1.0f) {
+ points[i].X = 50000 * 1.0f;
+ }
+ if (x < -50000 * 1.0f) {
+ points[i].X = -50000 * 1.0f;
+ }
+ if (y > 50000 * 1.0f) {
+ points[i].Y = 50000 * 1.0f;
+ }
+ if (y < -50000 * 1.0f) {
+ points[i].Y = -50000 * 1.0f;
+ }
+ int point_type = pPoints[i].m_Flag & FXPT_TYPE;
+ if(point_type == FXPT_MOVETO) {
+ types[i] = PathPointTypeStart;
+ nSubPathes ++;
+ bSubClose = FALSE;
+ startpoint = i;
+ } else if (point_type == FXPT_LINETO) {
+ types[i] = PathPointTypeLine;
+ if (pPoints[i - 1].m_Flag == FXPT_MOVETO && (i == nPoints - 1 || pPoints[i + 1].m_Flag == FXPT_MOVETO) &&
+ points[i].Y == points[i - 1].Y && points[i].X == points[i - 1].X) {
+ points[i].X += 0.01f;
+ continue;
+ }
+ if (!bSmooth && points[i].X != points[i - 1].X && points[i].Y != points[i - 1].Y) {
+ bSmooth = TRUE;
+ }
+ } else if (point_type == FXPT_BEZIERTO) {
+ types[i] = PathPointTypeBezier;
+ bSmooth = TRUE;
+ }
+ if (pPoints[i].m_Flag & FXPT_CLOSEFIGURE) {
+ if (bSubClose) {
+ types[pos_subclose] &= ~PathPointTypeCloseSubpath;
+ } else {
+ bSubClose = TRUE;
+ }
+ pos_subclose = i;
+ types[i] |= PathPointTypeCloseSubpath;
+ if (!bSmooth && points[i].X != points[startpoint].X && points[i].Y != points[startpoint].Y) {
+ bSmooth = TRUE;
+ }
+ }
+ }
+ if (fill_mode & FXFILL_NOPATHSMOOTH) {
+ bSmooth = FALSE;
+ CallFunc(GdipSetSmoothingMode)(pGraphics, SmoothingModeNone);
+ } else if (!(fill_mode & FXFILL_FULLCOVER)) {
+ if (!bSmooth && (fill_mode & 3)) {
+ bSmooth = TRUE;
+ }
+ if (bSmooth || pGraphState && pGraphState->m_LineWidth > 2) {
+ CallFunc(GdipSetSmoothingMode)(pGraphics, SmoothingModeAntiAlias);
+ }
+ }
+ int new_fill_mode = fill_mode & 3;
+ if (nPoints == 4 && pGraphState == NULL) {
+ int v1, v2;
+ if (IsSmallTriangle(points, pObject2Device, v1, v2)) {
+ GpPen* pPen = NULL;
+ CallFunc(GdipCreatePen1)(fill_argb, 1.0f, UnitPixel, &pPen);
+ CallFunc(GdipDrawLineI)(pGraphics, pPen, FXSYS_round(points[v1].X), FXSYS_round(points[v1].Y),
+ FXSYS_round(points[v2].X), FXSYS_round(points[v2].Y));
+ CallFunc(GdipDeletePen)(pPen);
+ return TRUE;
+ }
+ }
+ GpPath* pGpPath = NULL;
+ CallFunc(GdipCreatePath2)(points, types, nPoints, GdiFillType2Gdip(new_fill_mode), &pGpPath);
+ if (!pGpPath) {
+ if (pMatrix) {
+ CallFunc(GdipDeleteMatrix)(pMatrix);
+ }
+ FX_Free(points);
+ FX_Free(types);
+ CallFunc(GdipDeleteGraphics)(pGraphics);
+ return FALSE;
+ }
+ if (new_fill_mode) {
+ GpBrush* pBrush = _GdipCreateBrush(fill_argb);
+ CallFunc(GdipSetPathFillMode)(pGpPath, GdiFillType2Gdip(new_fill_mode));
+ CallFunc(GdipFillPath)(pGraphics, pBrush, pGpPath);
+ CallFunc(GdipDeleteBrush)(pBrush);
+ }
+ if (pGraphState && stroke_argb) {
+ GpPen* pPen = _GdipCreatePen(pGraphState, pObject2Device, stroke_argb, fill_mode & FX_STROKE_TEXT_MODE);
+ if (nSubPathes == 1) {
+ CallFunc(GdipDrawPath)(pGraphics, pPen, pGpPath);
+ } else {
+ int iStart = 0;
+ for (int i = 0; i < nPoints; i ++) {
+ if (i == nPoints - 1 || types[i + 1] == PathPointTypeStart) {
+ GpPath* pSubPath;
+ CallFunc(GdipCreatePath2)(points + iStart, types + iStart, i - iStart + 1, GdiFillType2Gdip(new_fill_mode), &pSubPath);
+ iStart = i + 1;
+ CallFunc(GdipDrawPath)(pGraphics, pPen, pSubPath);
+ CallFunc(GdipDeletePath)(pSubPath);
+ }
+ }
+ }
+ CallFunc(GdipDeletePen)(pPen);
+ }
+ if (pMatrix) {
+ CallFunc(GdipDeleteMatrix)(pMatrix);
+ }
+ FX_Free(points);
+ FX_Free(types);
+ CallFunc(GdipDeletePath)(pGpPath);
+ CallFunc(GdipDeleteGraphics)(pGraphics);
+ return TRUE;
+}
+class GpStream : public IStream, public CFX_Object
+{
+ LONG m_RefCount;
+ int m_ReadPos;
+ CFX_ByteTextBuf m_InterStream;
+public:
+ GpStream()
+ {
+ m_RefCount = 1;
+ m_ReadPos = 0;
+ }
+ virtual HRESULT STDMETHODCALLTYPE
+ QueryInterface(REFIID iid, void ** ppvObject)
+ {
+ if (iid == __uuidof(IUnknown) || iid == __uuidof(IStream) ||
+ iid == __uuidof(ISequentialStream)) {
+ *ppvObject = static_cast<IStream*>(this);
+ AddRef();
+ return S_OK;
+ } else {
+ return E_NOINTERFACE;
+ }
+ }
+ virtual ULONG STDMETHODCALLTYPE AddRef(void)
+ {
+ return (ULONG)InterlockedIncrement(&m_RefCount);
+ }
+ virtual ULONG STDMETHODCALLTYPE Release(void)
+ {
+ ULONG res = (ULONG) InterlockedDecrement(&m_RefCount);
+ if (res == 0) {
+ delete this;
+ }
+ return res;
+ }
+public:
+ virtual HRESULT STDMETHODCALLTYPE Read(void* Output, ULONG cb, ULONG* pcbRead)
+ {
+ size_t bytes_left;
+ size_t bytes_out;
+ if (pcbRead != NULL) {
+ *pcbRead = 0;
+ }
+ if (m_ReadPos == m_InterStream.GetLength()) {
+ return HRESULT_FROM_WIN32(ERROR_END_OF_MEDIA);
+ }
+ bytes_left = m_InterStream.GetLength() - m_ReadPos;
+ bytes_out = FX_MIN(cb, bytes_left);
+ FXSYS_memcpy32(Output, m_InterStream.GetBuffer() + m_ReadPos, bytes_out);
+ m_ReadPos += (FX_INT32)bytes_out;
+ if (pcbRead != NULL) {
+ *pcbRead = (ULONG)bytes_out;
+ }
+ return S_OK;
+ }
+ virtual HRESULT STDMETHODCALLTYPE Write(void const* Input, ULONG cb, ULONG* pcbWritten)
+ {
+ if (cb <= 0) {
+ if (pcbWritten != NULL) {
+ *pcbWritten = 0;
+ }
+ return S_OK;
+ }
+ m_InterStream.InsertBlock(m_InterStream.GetLength(), Input, cb);
+ if (pcbWritten != NULL) {
+ *pcbWritten = cb;
+ }
+ return S_OK;
+ }
+public:
+ virtual HRESULT STDMETHODCALLTYPE SetSize(ULARGE_INTEGER)
+ {
+ return E_NOTIMPL;
+ }
+ virtual HRESULT STDMETHODCALLTYPE CopyTo(IStream*, ULARGE_INTEGER, ULARGE_INTEGER*, ULARGE_INTEGER*)
+ {
+ return E_NOTIMPL;
+ }
+ virtual HRESULT STDMETHODCALLTYPE Commit(DWORD)
+ {
+ return E_NOTIMPL;
+ }
+ virtual HRESULT STDMETHODCALLTYPE Revert(void)
+ {
+ return E_NOTIMPL;
+ }
+ virtual HRESULT STDMETHODCALLTYPE LockRegion(ULARGE_INTEGER, ULARGE_INTEGER, DWORD)
+ {
+ return E_NOTIMPL;
+ }
+ virtual HRESULT STDMETHODCALLTYPE UnlockRegion(ULARGE_INTEGER, ULARGE_INTEGER, DWORD)
+ {
+ return E_NOTIMPL;
+ }
+ virtual HRESULT STDMETHODCALLTYPE Clone(IStream **)
+ {
+ return E_NOTIMPL;
+ }
+ virtual HRESULT STDMETHODCALLTYPE Seek(LARGE_INTEGER liDistanceToMove, DWORD dwOrigin, ULARGE_INTEGER* lpNewFilePointer)
+ {
+ long start = 0;
+ long new_read_position;
+ switch(dwOrigin) {
+ case STREAM_SEEK_SET:
+ start = 0;
+ break;
+ case STREAM_SEEK_CUR:
+ start = m_ReadPos;
+ break;
+ case STREAM_SEEK_END:
+ start = m_InterStream.GetLength();
+ break;
+ default:
+ return STG_E_INVALIDFUNCTION;
+ break;
+ }
+ new_read_position = start + (long)liDistanceToMove.QuadPart;
+ if (new_read_position < 0 || new_read_position > m_InterStream.GetLength()) {
+ return STG_E_SEEKERROR;
+ }
+ m_ReadPos = new_read_position;
+ if (lpNewFilePointer != NULL) {
+ lpNewFilePointer->QuadPart = m_ReadPos;
+ }
+ return S_OK;
+ }
+ virtual HRESULT STDMETHODCALLTYPE Stat(STATSTG* pStatstg, DWORD grfStatFlag)
+ {
+ if (pStatstg == NULL) {
+ return STG_E_INVALIDFUNCTION;
+ }
+ ZeroMemory(pStatstg, sizeof(STATSTG));
+ pStatstg->cbSize.QuadPart = m_InterStream.GetLength();
+ return S_OK;
+ }
+};
+typedef struct {
+ BITMAPINFO* pbmi;
+ int Stride;
+ LPBYTE pScan0;
+ GpBitmap* pBitmap;
+ BitmapData* pBitmapData;
+ GpStream* pStream;
+} PREVIEW3_DIBITMAP;
+static PREVIEW3_DIBITMAP* LoadDIBitmap(WINDIB_Open_Args_ args)
+{
+ GpBitmap* pBitmap;
+ GpStream* pStream = NULL;
+ CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
+ Status status = Ok;
+ if (args.flags == WINDIB_OPEN_PATHNAME) {
+ status = CallFunc(GdipCreateBitmapFromFileICM)((wchar_t*)args.path_name, &pBitmap);
+ } else {
+ if (args.memory_size == 0 || !args.memory_base) {
+ return NULL;
+ }
+ pStream = FX_NEW GpStream;
+ if (!pStream) {
+ return NULL;
+ }
+ pStream->Write(args.memory_base, (ULONG)args.memory_size, NULL);
+ status = CallFunc(GdipCreateBitmapFromStreamICM)(pStream, &pBitmap);
+ }
+ if (status != Ok) {
+ if (pStream) {
+ pStream->Release();
+ }
+ return NULL;
+ }
+ UINT height, width;
+ CallFunc(GdipGetImageHeight)(pBitmap, &height);
+ CallFunc(GdipGetImageWidth)(pBitmap, &width);
+ PixelFormat pixel_format;
+ CallFunc(GdipGetImagePixelFormat)(pBitmap, &pixel_format);
+ int info_size = sizeof(BITMAPINFOHEADER);
+ int bpp = 24;
+ int dest_pixel_format = PixelFormat24bppRGB;
+ if (pixel_format == PixelFormat1bppIndexed) {
+ info_size += 8;
+ bpp = 1;
+ dest_pixel_format = PixelFormat1bppIndexed;
+ } else if (pixel_format == PixelFormat8bppIndexed) {
+ info_size += 1024;
+ bpp = 8;
+ dest_pixel_format = PixelFormat8bppIndexed;
+ } else if (pixel_format == PixelFormat32bppARGB) {
+ bpp = 32;
+ dest_pixel_format = PixelFormat32bppARGB;
+ }
+ LPBYTE buf = FX_Alloc(BYTE, info_size);
+ if (!buf) {
+ if (pStream) {
+ pStream->Release();
+ }
+ return NULL;
+ }
+ BITMAPINFOHEADER* pbmih = (BITMAPINFOHEADER*)buf;
+ FXSYS_memset32(buf, 0, info_size);
+ pbmih->biBitCount = bpp;
+ pbmih->biCompression = BI_RGB;
+ pbmih->biHeight = -(int)height;
+ pbmih->biPlanes = 1;
+ pbmih->biWidth = width;
+ Rect rect(0, 0, width, height);
+ BitmapData* pBitmapData = FX_Alloc(BitmapData, 1);
+ if (!pBitmapData) {
+ if (pStream) {
+ pStream->Release();
+ }
+ return NULL;
+ }
+ CallFunc(GdipBitmapLockBits)(pBitmap, &rect, ImageLockModeRead,
+ dest_pixel_format, pBitmapData);
+ if (pixel_format == PixelFormat1bppIndexed || pixel_format == PixelFormat8bppIndexed) {
+ DWORD* ppal = (DWORD*)(buf + sizeof(BITMAPINFOHEADER));
+ struct {
+ UINT flags;
+ UINT Count;
+ DWORD Entries[256];
+ } pal;
+ int size = 0;
+ CallFunc(GdipGetImagePaletteSize)(pBitmap, &size);
+ CallFunc(GdipGetImagePalette)(pBitmap, (ColorPalette*)&pal, size);
+ int entries = pixel_format == PixelFormat1bppIndexed ? 2 : 256;
+ for (int i = 0; i < entries; i ++) {
+ ppal[i] = pal.Entries[i] & 0x00ffffff;
+ }
+ }
+ PREVIEW3_DIBITMAP* pInfo = FX_Alloc(PREVIEW3_DIBITMAP, 1);
+ if (!pInfo) {
+ if (pStream) {
+ pStream->Release();
+ }
+ return NULL;
+ }
+ pInfo->pbmi = (BITMAPINFO*)buf;
+ pInfo->pScan0 = (LPBYTE)pBitmapData->Scan0;
+ pInfo->Stride = pBitmapData->Stride;
+ pInfo->pBitmap = pBitmap;
+ pInfo->pBitmapData = pBitmapData;
+ pInfo->pStream = pStream;
+ return pInfo;
+}
+static void FreeDIBitmap(PREVIEW3_DIBITMAP* pInfo)
+{
+ CGdiplusExt& GdiplusExt = ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
+ CallFunc(GdipBitmapUnlockBits)(pInfo->pBitmap, pInfo->pBitmapData);
+ CallFunc(GdipDisposeImage)(pInfo->pBitmap);
+ FX_Free(pInfo->pBitmapData);
+ FX_Free((LPBYTE)pInfo->pbmi);
+ if (pInfo->pStream) {
+ pInfo->pStream->Release();
+ }
+ FX_Free(pInfo);
+}
+CFX_DIBitmap* _FX_WindowsDIB_LoadFromBuf(BITMAPINFO* pbmi, LPVOID pData, FX_BOOL bAlpha);
+CFX_DIBitmap* CGdiplusExt::LoadDIBitmap(WINDIB_Open_Args_ args)
+{
+ PREVIEW3_DIBITMAP* pInfo = ::LoadDIBitmap(args);
+ if (pInfo == NULL) {
+ return NULL;
+ }
+ int height = abs(pInfo->pbmi->bmiHeader.biHeight);
+ int width = pInfo->pbmi->bmiHeader.biWidth;
+ int dest_pitch = (width * pInfo->pbmi->bmiHeader.biBitCount + 31) / 32 * 4;
+ LPBYTE pData = FX_Alloc(BYTE, dest_pitch * height);
+ if (pData == NULL) {
+ FreeDIBitmap(pInfo);
+ return NULL;
+ }
+ if (dest_pitch == pInfo->Stride) {
+ FXSYS_memcpy32(pData, pInfo->pScan0, dest_pitch * height);
+ } else for (int i = 0; i < height; i ++) {
+ FXSYS_memcpy32(pData + dest_pitch * i, pInfo->pScan0 + pInfo->Stride * i, dest_pitch);
+ }
+ CFX_DIBitmap* pDIBitmap = _FX_WindowsDIB_LoadFromBuf(pInfo->pbmi, pData, pInfo->pbmi->bmiHeader.biBitCount == 32);
+ FX_Free(pData);
+ FreeDIBitmap(pInfo);
+ return pDIBitmap;
+}
+#endif
diff --git a/core/src/fxge/win32/fx_win32_print.cpp b/core/src/fxge/win32/fx_win32_print.cpp
index c08c8e7bb6..9e7a0aae95 100644
--- a/core/src/fxge/win32/fx_win32_print.cpp
+++ b/core/src/fxge/win32/fx_win32_print.cpp
@@ -1,426 +1,426 @@
-// 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
-
-#include "../../../include/fxge/fx_ge.h"
-#if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_
-#include <windows.h>
-#include "../../../include/fxge/fx_ge_win32.h"
-#include "win32_int.h"
-#include "../../../include/fxge/fx_freetype.h"
-#include "../ge/text_int.h"
-#include "../dib/dib_int.h"
-#define SIZETHRESHOLD 1000
-#define OUTPUTPSLEN 4096
-CGdiPrinterDriver::CGdiPrinterDriver(HDC hDC) : CGdiDeviceDriver(hDC, FXDC_PRINTER)
-{
- m_HorzSize = ::GetDeviceCaps(m_hDC, HORZSIZE);
- m_VertSize = ::GetDeviceCaps(m_hDC, VERTSIZE);
- m_bSupportROP = TRUE;
-}
-int CGdiPrinterDriver::GetDeviceCaps(int caps_id)
-{
- if (caps_id == FXDC_HORZ_SIZE) {
- return m_HorzSize;
- }
- if (caps_id == FXDC_VERT_SIZE) {
- return m_VertSize;
- }
- return CGdiDeviceDriver::GetDeviceCaps(caps_id);
-}
-FX_BOOL CGdiPrinterDriver::SetDIBits(const CFX_DIBSource* pSource, FX_DWORD color, const FX_RECT* pSrcRect, int left, int top, int blend_type,
- int alpha_flag, void* pIccTransform)
-{
- if (pSource->IsAlphaMask()) {
- FX_RECT clip_rect(left, top, left + pSrcRect->Width(), top + pSrcRect->Height());
- return StretchDIBits(pSource, color, left - pSrcRect->left, top - pSrcRect->top, pSource->GetWidth(), pSource->GetHeight(),
- &clip_rect, 0, alpha_flag, pIccTransform, FXDIB_BLEND_NORMAL);
- }
- ASSERT(pSource != NULL && !pSource->IsAlphaMask() && pSrcRect != NULL);
- ASSERT(blend_type == FXDIB_BLEND_NORMAL);
- if (pSource->HasAlpha()) {
- return FALSE;
- }
- CFX_DIBExtractor temp(pSource);
- CFX_DIBitmap* pBitmap = temp;
- if (pBitmap == NULL) {
- return FALSE;
- }
- return GDI_SetDIBits(pBitmap, pSrcRect, left, top, pIccTransform);
-}
-FX_BOOL CGdiPrinterDriver::StretchDIBits(const CFX_DIBSource* pSource, FX_DWORD color, int dest_left, int dest_top,
- int dest_width, int dest_height, const FX_RECT* pClipRect, FX_DWORD flags,
- int alpha_flag, void* pIccTransform, int blend_type)
-{
- if (pSource->IsAlphaMask()) {
- int alpha = FXGETFLAG_COLORTYPE(alpha_flag) ? FXGETFLAG_ALPHA_FILL(alpha_flag) : FXARGB_A(color);
- if (pSource->GetBPP() != 1 || alpha != 255 || !m_bSupportROP) {
- return FALSE;
- }
- if (dest_width < 0 || dest_height < 0) {
- CFX_DIBitmap* pFlipped = pSource->FlipImage(dest_width < 0, dest_height < 0);
- if (pFlipped == NULL) {
- return FALSE;
- }
- if (dest_width < 0) {
- dest_left += dest_width;
- }
- if (dest_height < 0) {
- dest_top += dest_height;
- }
- FX_BOOL ret = GDI_StretchBitMask(pFlipped, dest_left, dest_top, abs(dest_width), abs(dest_height), color, flags, alpha_flag, pIccTransform);
- delete pFlipped;
- return ret;
- }
- CFX_DIBExtractor temp(pSource);
- CFX_DIBitmap* pBitmap = temp;
- if (pBitmap == NULL) {
- return FALSE;
- }
- return GDI_StretchBitMask(pBitmap, dest_left, dest_top, dest_width, dest_height, color, flags, alpha_flag, pIccTransform);
- } else {
- ASSERT(pSource != NULL);
- if (pSource->HasAlpha()) {
- return FALSE;
- }
- if (dest_width < 0 || dest_height < 0) {
- CFX_DIBitmap* pFlipped = pSource->FlipImage(dest_width < 0, dest_height < 0);
- if (pFlipped == NULL) {
- return FALSE;
- }
- if (dest_width < 0) {
- dest_left += dest_width;
- }
- if (dest_height < 0) {
- dest_top += dest_height;
- }
- FX_BOOL ret = GDI_StretchDIBits(pFlipped, dest_left, dest_top, abs(dest_width), abs(dest_height), flags, pIccTransform);
- delete pFlipped;
- return ret;
- }
- CFX_DIBExtractor temp(pSource);
- CFX_DIBitmap* pBitmap = temp;
- if (pBitmap == NULL) {
- return FALSE;
- }
- return GDI_StretchDIBits(pBitmap, dest_left, dest_top, dest_width, dest_height, flags, pIccTransform);
- }
-}
-static CFX_DIBitmap* Transform1bppBitmap(const CFX_DIBSource* pSrc, const CFX_AffineMatrix* pDestMatrix)
-{
- ASSERT(pSrc->GetFormat() == FXDIB_1bppRgb || pSrc->GetFormat() == FXDIB_1bppMask || pSrc->GetFormat() == FXDIB_1bppCmyk);
- CFX_FloatRect unit_rect = pDestMatrix->GetUnitRect();
- FX_RECT full_rect = unit_rect.GetOutterRect();
- int full_left = full_rect.left;
- int full_top = full_rect.top;
- CFX_DIBExtractor src_bitmap(pSrc);
- CFX_DIBitmap* pSrcBitmap = src_bitmap;
- if (pSrcBitmap == NULL) {
- return NULL;
- }
- int src_width = pSrcBitmap->GetWidth(), src_height = pSrcBitmap->GetHeight();
- FX_LPBYTE src_buf = pSrcBitmap->GetBuffer();
- FX_DWORD src_pitch = pSrcBitmap->GetPitch();
- FX_FLOAT dest_area = pDestMatrix->GetUnitArea();
- FX_FLOAT area_scale = FXSYS_Div((FX_FLOAT)(src_width * src_height), dest_area);
- FX_FLOAT size_scale = FXSYS_sqrt(area_scale);
- CFX_AffineMatrix adjusted_matrix(*pDestMatrix);
- adjusted_matrix.Scale(size_scale, size_scale);
- CFX_FloatRect result_rect_f = adjusted_matrix.GetUnitRect();
- FX_RECT result_rect = result_rect_f.GetOutterRect();
- CFX_AffineMatrix src2result;
- src2result.e = adjusted_matrix.c + adjusted_matrix.e;
- src2result.f = adjusted_matrix.d + adjusted_matrix.f;
- src2result.a = adjusted_matrix.a / pSrcBitmap->GetWidth();
- src2result.b = adjusted_matrix.b / pSrcBitmap->GetWidth();
- src2result.c = -adjusted_matrix.c / pSrcBitmap->GetHeight();
- src2result.d = -adjusted_matrix.d / pSrcBitmap->GetHeight();
- src2result.TranslateI(-result_rect.left, -result_rect.top);
- CFX_AffineMatrix result2src;
- result2src.SetReverse(src2result);
- CPDF_FixedMatrix result2src_fix(result2src, 8);
- int result_width = result_rect.Width();
- int result_height = result_rect.Height();
- CFX_DIBitmap* pTempBitmap = FX_NEW CFX_DIBitmap;
- if (!pTempBitmap) {
- if (pSrcBitmap != src_bitmap) {
- delete pSrcBitmap;
- }
- return NULL;
- }
- if (!pTempBitmap->Create(result_width, result_height, pSrc->GetFormat())) {
- delete pTempBitmap;
- if (pSrcBitmap != src_bitmap) {
- delete pSrcBitmap;
- }
- return NULL;
- }
- pTempBitmap->CopyPalette(pSrc->GetPalette());
- FX_LPBYTE dest_buf = pTempBitmap->GetBuffer();
- int dest_pitch = pTempBitmap->GetPitch();
- FXSYS_memset8(dest_buf, pSrc->IsAlphaMask() ? 0 : 0xff, dest_pitch * result_height);
- if (pSrcBitmap->IsAlphaMask()) {
- for (int dest_y = 0; dest_y < result_height; dest_y ++) {
- FX_LPBYTE dest_scan = dest_buf + dest_y * dest_pitch;
- for (int dest_x = 0; dest_x < result_width; dest_x ++) {
- int src_x, src_y;
- result2src_fix.Transform(dest_x, dest_y, src_x, src_y);
- if (src_x < 0 || src_x >= src_width || src_y < 0 || src_y >= src_height) {
- continue;
- }
- if (!((src_buf + src_pitch * src_y)[src_x / 8] & (1 << (7 - src_x % 8)))) {
- continue;
- }
- dest_scan[dest_x / 8] |= 1 << (7 - dest_x % 8);
- }
- }
- } else {
- for (int dest_y = 0; dest_y < result_height; dest_y ++) {
- FX_LPBYTE dest_scan = dest_buf + dest_y * dest_pitch;
- for (int dest_x = 0; dest_x < result_width; dest_x ++) {
- int src_x, src_y;
- result2src_fix.Transform(dest_x, dest_y, src_x, src_y);
- if (src_x < 0 || src_x >= src_width || src_y < 0 || src_y >= src_height) {
- continue;
- }
- if ((src_buf + src_pitch * src_y)[src_x / 8] & (1 << (7 - src_x % 8))) {
- continue;
- }
- dest_scan[dest_x / 8] &= ~(1 << (7 - dest_x % 8));
- }
- }
- }
- if (pSrcBitmap != src_bitmap) {
- delete pSrcBitmap;
- }
- return pTempBitmap;
-}
-FX_BOOL CGdiPrinterDriver::StartDIBits(const CFX_DIBSource* pSource, int bitmap_alpha, FX_DWORD color,
- const CFX_AffineMatrix* pMatrix, FX_DWORD render_flags, FX_LPVOID& handle,
- int alpha_flag, void* pIccTransform, int blend_type)
-{
- if (bitmap_alpha < 255 || pSource->HasAlpha() || (pSource->IsAlphaMask() && (pSource->GetBPP() != 1 || !m_bSupportROP))) {
- return FALSE;
- }
- CFX_FloatRect unit_rect = pMatrix->GetUnitRect();
- FX_RECT full_rect = unit_rect.GetOutterRect();
- if (FXSYS_fabs(pMatrix->b) < 0.5f && pMatrix->a != 0 && FXSYS_fabs(pMatrix->c) < 0.5f && pMatrix->d != 0) {
- FX_BOOL bFlipX = pMatrix->a < 0;
- FX_BOOL bFlipY = pMatrix->d > 0;
- return StretchDIBits(pSource, color, bFlipX ? full_rect.right : full_rect.left, bFlipY ? full_rect.bottom : full_rect.top,
- bFlipX ? -full_rect.Width() : full_rect.Width(), bFlipY ? -full_rect.Height() : full_rect.Height(), NULL, 0,
- alpha_flag, pIccTransform, blend_type);
- }
- if (FXSYS_fabs(pMatrix->a) < 0.5f && FXSYS_fabs(pMatrix->d) < 0.5f) {
- CFX_DIBitmap* pTransformed = pSource->SwapXY(pMatrix->c > 0, pMatrix->b < 0);
- if (pTransformed == NULL) {
- return FALSE;
- }
- FX_BOOL ret = StretchDIBits(pTransformed, color, full_rect.left, full_rect.top, full_rect.Width(), full_rect.Height(), NULL, 0,
- alpha_flag, pIccTransform, blend_type);
- delete pTransformed;
- return ret;
- }
- if (pSource->GetBPP() == 1) {
- CFX_DIBitmap* pTransformed = Transform1bppBitmap(pSource, pMatrix);
- if (pIccTransform == NULL) {
- return FALSE;
- }
- SaveState();
- CFX_PathData path;
- path.AppendRect(0, 0, 1.0f, 1.0f);
- SetClip_PathFill(&path, pMatrix, WINDING);
- FX_BOOL ret = StretchDIBits(pTransformed, color, full_rect.left, full_rect.top, full_rect.Width(), full_rect.Height(), NULL, 0,
- alpha_flag, pIccTransform, blend_type);
- RestoreState();
- delete pTransformed;
- handle = NULL;
- return ret;
- }
- return FALSE;
-}
-CPSOutput::CPSOutput(HDC hDC)
-{
- m_hDC = hDC;
- m_pBuf = NULL;
-}
-CPSOutput::~CPSOutput()
-{
- if (m_pBuf) {
- FX_Free(m_pBuf);
- }
-}
-void CPSOutput::Init()
-{
- m_pBuf = FX_Alloc(FX_CHAR, 1026);
-}
-void CPSOutput::OutputPS(FX_LPCSTR string, int len)
-{
- if (len < 0) {
- len = (int)FXSYS_strlen(string);
- }
- int sent_len = 0;
- while (len > 0) {
- int send_len = len > 1024 ? 1024 : len;
- *(FX_WORD*)m_pBuf = send_len;
- FXSYS_memcpy(m_pBuf + 2, string + sent_len, send_len);
- int ret = ExtEscape(m_hDC, PASSTHROUGH, send_len + 2, m_pBuf, 0, NULL);
- sent_len += send_len;
- len -= send_len;
- }
-}
-CPSPrinterDriver::CPSPrinterDriver()
-{
- m_pPSOutput = NULL;
- m_bCmykOutput = FALSE;
-}
-CPSPrinterDriver::~CPSPrinterDriver()
-{
- EndRendering();
- if (m_pPSOutput) {
- delete m_pPSOutput;
- }
-}
-FX_BOOL CPSPrinterDriver::Init(HDC hDC, int pslevel, FX_BOOL bCmykOutput)
-{
- m_hDC = hDC;
- m_HorzSize = ::GetDeviceCaps(m_hDC, HORZSIZE);
- m_VertSize = ::GetDeviceCaps(m_hDC, VERTSIZE);
- m_Width = ::GetDeviceCaps(m_hDC, HORZRES);
- m_Height = ::GetDeviceCaps(m_hDC, VERTRES);
- m_nBitsPerPixel = ::GetDeviceCaps(m_hDC, BITSPIXEL);
- m_pPSOutput = FX_NEW CPSOutput(hDC);
- if (!m_pPSOutput) {
- return FALSE;
- }
- ((CPSOutput*)m_pPSOutput)->Init();
- m_PSRenderer.Init(m_pPSOutput, pslevel, m_Width, m_Height, bCmykOutput);
- m_bCmykOutput = bCmykOutput;
- HRGN hRgn = ::CreateRectRgn(0, 0, 1, 1);
- int ret = ::GetClipRgn(hDC, hRgn);
- if (ret == 1) {
- ret = ::GetRegionData(hRgn, 0, NULL);
- if (ret) {
- RGNDATA* pData = (RGNDATA*)FX_Alloc(FX_BYTE, ret);
- if (!pData) {
- return FALSE;
- }
- ret = ::GetRegionData(hRgn, ret, pData);
- if (ret) {
- CFX_PathData path;
- path.AllocPointCount(pData->rdh.nCount * 5);
- for (FX_DWORD i = 0; i < pData->rdh.nCount; i ++) {
- RECT* pRect = (RECT*)(pData->Buffer + pData->rdh.nRgnSize * i);
- path.AppendRect((FX_FLOAT)pRect->left, (FX_FLOAT)pRect->bottom, (FX_FLOAT)pRect->right, (FX_FLOAT)pRect->top);
- }
- m_PSRenderer.SetClip_PathFill(&path, NULL, FXFILL_WINDING);
- }
- FX_Free(pData);
- }
- }
- ::DeleteObject(hRgn);
- return TRUE;
-}
-int CPSPrinterDriver::GetDeviceCaps(int caps_id)
-{
- switch (caps_id) {
- case FXDC_DEVICE_CLASS:
- return FXDC_PRINTER;
- case FXDC_PIXEL_WIDTH:
- return m_Width;
- case FXDC_PIXEL_HEIGHT:
- return m_Height;
- case FXDC_BITS_PIXEL:
- return m_nBitsPerPixel;
- case FXDC_RENDER_CAPS:
- return m_bCmykOutput ? FXRC_BIT_MASK | FXRC_CMYK_OUTPUT : FXRC_BIT_MASK;
- case FXDC_HORZ_SIZE:
- return m_HorzSize;
- case FXDC_VERT_SIZE:
- return m_VertSize;
- }
- return 0;
-}
-FX_BOOL CPSPrinterDriver::StartRendering()
-{
- return m_PSRenderer.StartRendering();
-}
-void CPSPrinterDriver::EndRendering()
-{
- m_PSRenderer.EndRendering();
-}
-void CPSPrinterDriver::SaveState()
-{
- m_PSRenderer.SaveState();
-}
-void CPSPrinterDriver::RestoreState(FX_BOOL bKeepSaved)
-{
- m_PSRenderer.RestoreState(bKeepSaved);
-}
-FX_BOOL CPSPrinterDriver::SetClip_PathFill(const CFX_PathData* pPathData, const CFX_AffineMatrix* pObject2Device,
- int fill_mode)
-{
- m_PSRenderer.SetClip_PathFill(pPathData, pObject2Device, fill_mode);
- return TRUE;
-}
-FX_BOOL CPSPrinterDriver::SetClip_PathStroke(const CFX_PathData* pPathData,
- const CFX_AffineMatrix* pObject2Device,
- const CFX_GraphStateData* pGraphState)
-{
- m_PSRenderer.SetClip_PathStroke(pPathData, pObject2Device, pGraphState);
- return TRUE;
-}
-FX_BOOL CPSPrinterDriver::DrawPath(const CFX_PathData* pPathData,
- const CFX_AffineMatrix* pObject2Device,
- const CFX_GraphStateData* pGraphState, FX_ARGB fill_color, FX_ARGB stroke_color,
- int fill_mode, int alpha_flag, void* pIccTransform, int blend_type)
-{
- if (blend_type != FXDIB_BLEND_NORMAL) {
- return FALSE;
- }
- return m_PSRenderer.DrawPath(pPathData, pObject2Device, pGraphState, fill_color, stroke_color, fill_mode & 3, alpha_flag, pIccTransform);
-}
-FX_BOOL CPSPrinterDriver::GetClipBox(FX_RECT* pRect)
-{
- *pRect = m_PSRenderer.GetClipBox();
- return TRUE;
-}
-FX_BOOL CPSPrinterDriver::SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, const FX_RECT* pSrcRect, int left, int top, int blend_type,
- int alpha_flag, void* pIccTransform)
-{
- if (blend_type != FXDIB_BLEND_NORMAL) {
- return FALSE;
- }
- return m_PSRenderer.SetDIBits(pBitmap, color, left, top, alpha_flag, pIccTransform);
-}
-FX_BOOL CPSPrinterDriver::StretchDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, int dest_left, int dest_top,
- int dest_width, int dest_height, const FX_RECT* pClipRect, FX_DWORD flags,
- int alpha_flag, void* pIccTransform, int blend_type)
-{
- if (blend_type != FXDIB_BLEND_NORMAL) {
- return FALSE;
- }
- return m_PSRenderer.StretchDIBits(pBitmap, color, dest_left, dest_top, dest_width, dest_height, flags, alpha_flag, pIccTransform);
-}
-FX_BOOL CPSPrinterDriver::StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD color,
- const CFX_AffineMatrix* pMatrix, FX_DWORD render_flags, FX_LPVOID& handle,
- int alpha_flag, void* pIccTransform, int blend_type)
-{
- if (blend_type != FXDIB_BLEND_NORMAL) {
- return FALSE;
- }
- if (bitmap_alpha < 255) {
- return FALSE;
- }
- handle = NULL;
- return m_PSRenderer.DrawDIBits(pBitmap, color, pMatrix, render_flags, alpha_flag, pIccTransform);
-}
-FX_BOOL CPSPrinterDriver::DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont,
- CFX_FontCache* pCache, const CFX_AffineMatrix* pObject2Device, FX_FLOAT font_size, FX_DWORD color,
- int alpha_flag, void* pIccTransform)
-{
- return m_PSRenderer.DrawText(nChars, pCharPos, pFont, pCache, pObject2Device, font_size, color, alpha_flag, pIccTransform);
-}
-#endif
+// 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
+
+#include "../../../include/fxge/fx_ge.h"
+#if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_
+#include <windows.h>
+#include "../../../include/fxge/fx_ge_win32.h"
+#include "win32_int.h"
+#include "../../../include/fxge/fx_freetype.h"
+#include "../ge/text_int.h"
+#include "../dib/dib_int.h"
+#define SIZETHRESHOLD 1000
+#define OUTPUTPSLEN 4096
+CGdiPrinterDriver::CGdiPrinterDriver(HDC hDC) : CGdiDeviceDriver(hDC, FXDC_PRINTER)
+{
+ m_HorzSize = ::GetDeviceCaps(m_hDC, HORZSIZE);
+ m_VertSize = ::GetDeviceCaps(m_hDC, VERTSIZE);
+ m_bSupportROP = TRUE;
+}
+int CGdiPrinterDriver::GetDeviceCaps(int caps_id)
+{
+ if (caps_id == FXDC_HORZ_SIZE) {
+ return m_HorzSize;
+ }
+ if (caps_id == FXDC_VERT_SIZE) {
+ return m_VertSize;
+ }
+ return CGdiDeviceDriver::GetDeviceCaps(caps_id);
+}
+FX_BOOL CGdiPrinterDriver::SetDIBits(const CFX_DIBSource* pSource, FX_DWORD color, const FX_RECT* pSrcRect, int left, int top, int blend_type,
+ int alpha_flag, void* pIccTransform)
+{
+ if (pSource->IsAlphaMask()) {
+ FX_RECT clip_rect(left, top, left + pSrcRect->Width(), top + pSrcRect->Height());
+ return StretchDIBits(pSource, color, left - pSrcRect->left, top - pSrcRect->top, pSource->GetWidth(), pSource->GetHeight(),
+ &clip_rect, 0, alpha_flag, pIccTransform, FXDIB_BLEND_NORMAL);
+ }
+ ASSERT(pSource != NULL && !pSource->IsAlphaMask() && pSrcRect != NULL);
+ ASSERT(blend_type == FXDIB_BLEND_NORMAL);
+ if (pSource->HasAlpha()) {
+ return FALSE;
+ }
+ CFX_DIBExtractor temp(pSource);
+ CFX_DIBitmap* pBitmap = temp;
+ if (pBitmap == NULL) {
+ return FALSE;
+ }
+ return GDI_SetDIBits(pBitmap, pSrcRect, left, top, pIccTransform);
+}
+FX_BOOL CGdiPrinterDriver::StretchDIBits(const CFX_DIBSource* pSource, FX_DWORD color, int dest_left, int dest_top,
+ int dest_width, int dest_height, const FX_RECT* pClipRect, FX_DWORD flags,
+ int alpha_flag, void* pIccTransform, int blend_type)
+{
+ if (pSource->IsAlphaMask()) {
+ int alpha = FXGETFLAG_COLORTYPE(alpha_flag) ? FXGETFLAG_ALPHA_FILL(alpha_flag) : FXARGB_A(color);
+ if (pSource->GetBPP() != 1 || alpha != 255 || !m_bSupportROP) {
+ return FALSE;
+ }
+ if (dest_width < 0 || dest_height < 0) {
+ CFX_DIBitmap* pFlipped = pSource->FlipImage(dest_width < 0, dest_height < 0);
+ if (pFlipped == NULL) {
+ return FALSE;
+ }
+ if (dest_width < 0) {
+ dest_left += dest_width;
+ }
+ if (dest_height < 0) {
+ dest_top += dest_height;
+ }
+ FX_BOOL ret = GDI_StretchBitMask(pFlipped, dest_left, dest_top, abs(dest_width), abs(dest_height), color, flags, alpha_flag, pIccTransform);
+ delete pFlipped;
+ return ret;
+ }
+ CFX_DIBExtractor temp(pSource);
+ CFX_DIBitmap* pBitmap = temp;
+ if (pBitmap == NULL) {
+ return FALSE;
+ }
+ return GDI_StretchBitMask(pBitmap, dest_left, dest_top, dest_width, dest_height, color, flags, alpha_flag, pIccTransform);
+ } else {
+ ASSERT(pSource != NULL);
+ if (pSource->HasAlpha()) {
+ return FALSE;
+ }
+ if (dest_width < 0 || dest_height < 0) {
+ CFX_DIBitmap* pFlipped = pSource->FlipImage(dest_width < 0, dest_height < 0);
+ if (pFlipped == NULL) {
+ return FALSE;
+ }
+ if (dest_width < 0) {
+ dest_left += dest_width;
+ }
+ if (dest_height < 0) {
+ dest_top += dest_height;
+ }
+ FX_BOOL ret = GDI_StretchDIBits(pFlipped, dest_left, dest_top, abs(dest_width), abs(dest_height), flags, pIccTransform);
+ delete pFlipped;
+ return ret;
+ }
+ CFX_DIBExtractor temp(pSource);
+ CFX_DIBitmap* pBitmap = temp;
+ if (pBitmap == NULL) {
+ return FALSE;
+ }
+ return GDI_StretchDIBits(pBitmap, dest_left, dest_top, dest_width, dest_height, flags, pIccTransform);
+ }
+}
+static CFX_DIBitmap* Transform1bppBitmap(const CFX_DIBSource* pSrc, const CFX_AffineMatrix* pDestMatrix)
+{
+ ASSERT(pSrc->GetFormat() == FXDIB_1bppRgb || pSrc->GetFormat() == FXDIB_1bppMask || pSrc->GetFormat() == FXDIB_1bppCmyk);
+ CFX_FloatRect unit_rect = pDestMatrix->GetUnitRect();
+ FX_RECT full_rect = unit_rect.GetOutterRect();
+ int full_left = full_rect.left;
+ int full_top = full_rect.top;
+ CFX_DIBExtractor src_bitmap(pSrc);
+ CFX_DIBitmap* pSrcBitmap = src_bitmap;
+ if (pSrcBitmap == NULL) {
+ return NULL;
+ }
+ int src_width = pSrcBitmap->GetWidth(), src_height = pSrcBitmap->GetHeight();
+ FX_LPBYTE src_buf = pSrcBitmap->GetBuffer();
+ FX_DWORD src_pitch = pSrcBitmap->GetPitch();
+ FX_FLOAT dest_area = pDestMatrix->GetUnitArea();
+ FX_FLOAT area_scale = FXSYS_Div((FX_FLOAT)(src_width * src_height), dest_area);
+ FX_FLOAT size_scale = FXSYS_sqrt(area_scale);
+ CFX_AffineMatrix adjusted_matrix(*pDestMatrix);
+ adjusted_matrix.Scale(size_scale, size_scale);
+ CFX_FloatRect result_rect_f = adjusted_matrix.GetUnitRect();
+ FX_RECT result_rect = result_rect_f.GetOutterRect();
+ CFX_AffineMatrix src2result;
+ src2result.e = adjusted_matrix.c + adjusted_matrix.e;
+ src2result.f = adjusted_matrix.d + adjusted_matrix.f;
+ src2result.a = adjusted_matrix.a / pSrcBitmap->GetWidth();
+ src2result.b = adjusted_matrix.b / pSrcBitmap->GetWidth();
+ src2result.c = -adjusted_matrix.c / pSrcBitmap->GetHeight();
+ src2result.d = -adjusted_matrix.d / pSrcBitmap->GetHeight();
+ src2result.TranslateI(-result_rect.left, -result_rect.top);
+ CFX_AffineMatrix result2src;
+ result2src.SetReverse(src2result);
+ CPDF_FixedMatrix result2src_fix(result2src, 8);
+ int result_width = result_rect.Width();
+ int result_height = result_rect.Height();
+ CFX_DIBitmap* pTempBitmap = FX_NEW CFX_DIBitmap;
+ if (!pTempBitmap) {
+ if (pSrcBitmap != src_bitmap) {
+ delete pSrcBitmap;
+ }
+ return NULL;
+ }
+ if (!pTempBitmap->Create(result_width, result_height, pSrc->GetFormat())) {
+ delete pTempBitmap;
+ if (pSrcBitmap != src_bitmap) {
+ delete pSrcBitmap;
+ }
+ return NULL;
+ }
+ pTempBitmap->CopyPalette(pSrc->GetPalette());
+ FX_LPBYTE dest_buf = pTempBitmap->GetBuffer();
+ int dest_pitch = pTempBitmap->GetPitch();
+ FXSYS_memset8(dest_buf, pSrc->IsAlphaMask() ? 0 : 0xff, dest_pitch * result_height);
+ if (pSrcBitmap->IsAlphaMask()) {
+ for (int dest_y = 0; dest_y < result_height; dest_y ++) {
+ FX_LPBYTE dest_scan = dest_buf + dest_y * dest_pitch;
+ for (int dest_x = 0; dest_x < result_width; dest_x ++) {
+ int src_x, src_y;
+ result2src_fix.Transform(dest_x, dest_y, src_x, src_y);
+ if (src_x < 0 || src_x >= src_width || src_y < 0 || src_y >= src_height) {
+ continue;
+ }
+ if (!((src_buf + src_pitch * src_y)[src_x / 8] & (1 << (7 - src_x % 8)))) {
+ continue;
+ }
+ dest_scan[dest_x / 8] |= 1 << (7 - dest_x % 8);
+ }
+ }
+ } else {
+ for (int dest_y = 0; dest_y < result_height; dest_y ++) {
+ FX_LPBYTE dest_scan = dest_buf + dest_y * dest_pitch;
+ for (int dest_x = 0; dest_x < result_width; dest_x ++) {
+ int src_x, src_y;
+ result2src_fix.Transform(dest_x, dest_y, src_x, src_y);
+ if (src_x < 0 || src_x >= src_width || src_y < 0 || src_y >= src_height) {
+ continue;
+ }
+ if ((src_buf + src_pitch * src_y)[src_x / 8] & (1 << (7 - src_x % 8))) {
+ continue;
+ }
+ dest_scan[dest_x / 8] &= ~(1 << (7 - dest_x % 8));
+ }
+ }
+ }
+ if (pSrcBitmap != src_bitmap) {
+ delete pSrcBitmap;
+ }
+ return pTempBitmap;
+}
+FX_BOOL CGdiPrinterDriver::StartDIBits(const CFX_DIBSource* pSource, int bitmap_alpha, FX_DWORD color,
+ const CFX_AffineMatrix* pMatrix, FX_DWORD render_flags, FX_LPVOID& handle,
+ int alpha_flag, void* pIccTransform, int blend_type)
+{
+ if (bitmap_alpha < 255 || pSource->HasAlpha() || (pSource->IsAlphaMask() && (pSource->GetBPP() != 1 || !m_bSupportROP))) {
+ return FALSE;
+ }
+ CFX_FloatRect unit_rect = pMatrix->GetUnitRect();
+ FX_RECT full_rect = unit_rect.GetOutterRect();
+ if (FXSYS_fabs(pMatrix->b) < 0.5f && pMatrix->a != 0 && FXSYS_fabs(pMatrix->c) < 0.5f && pMatrix->d != 0) {
+ FX_BOOL bFlipX = pMatrix->a < 0;
+ FX_BOOL bFlipY = pMatrix->d > 0;
+ return StretchDIBits(pSource, color, bFlipX ? full_rect.right : full_rect.left, bFlipY ? full_rect.bottom : full_rect.top,
+ bFlipX ? -full_rect.Width() : full_rect.Width(), bFlipY ? -full_rect.Height() : full_rect.Height(), NULL, 0,
+ alpha_flag, pIccTransform, blend_type);
+ }
+ if (FXSYS_fabs(pMatrix->a) < 0.5f && FXSYS_fabs(pMatrix->d) < 0.5f) {
+ CFX_DIBitmap* pTransformed = pSource->SwapXY(pMatrix->c > 0, pMatrix->b < 0);
+ if (pTransformed == NULL) {
+ return FALSE;
+ }
+ FX_BOOL ret = StretchDIBits(pTransformed, color, full_rect.left, full_rect.top, full_rect.Width(), full_rect.Height(), NULL, 0,
+ alpha_flag, pIccTransform, blend_type);
+ delete pTransformed;
+ return ret;
+ }
+ if (pSource->GetBPP() == 1) {
+ CFX_DIBitmap* pTransformed = Transform1bppBitmap(pSource, pMatrix);
+ if (pIccTransform == NULL) {
+ return FALSE;
+ }
+ SaveState();
+ CFX_PathData path;
+ path.AppendRect(0, 0, 1.0f, 1.0f);
+ SetClip_PathFill(&path, pMatrix, WINDING);
+ FX_BOOL ret = StretchDIBits(pTransformed, color, full_rect.left, full_rect.top, full_rect.Width(), full_rect.Height(), NULL, 0,
+ alpha_flag, pIccTransform, blend_type);
+ RestoreState();
+ delete pTransformed;
+ handle = NULL;
+ return ret;
+ }
+ return FALSE;
+}
+CPSOutput::CPSOutput(HDC hDC)
+{
+ m_hDC = hDC;
+ m_pBuf = NULL;
+}
+CPSOutput::~CPSOutput()
+{
+ if (m_pBuf) {
+ FX_Free(m_pBuf);
+ }
+}
+void CPSOutput::Init()
+{
+ m_pBuf = FX_Alloc(FX_CHAR, 1026);
+}
+void CPSOutput::OutputPS(FX_LPCSTR string, int len)
+{
+ if (len < 0) {
+ len = (int)FXSYS_strlen(string);
+ }
+ int sent_len = 0;
+ while (len > 0) {
+ int send_len = len > 1024 ? 1024 : len;
+ *(FX_WORD*)m_pBuf = send_len;
+ FXSYS_memcpy(m_pBuf + 2, string + sent_len, send_len);
+ int ret = ExtEscape(m_hDC, PASSTHROUGH, send_len + 2, m_pBuf, 0, NULL);
+ sent_len += send_len;
+ len -= send_len;
+ }
+}
+CPSPrinterDriver::CPSPrinterDriver()
+{
+ m_pPSOutput = NULL;
+ m_bCmykOutput = FALSE;
+}
+CPSPrinterDriver::~CPSPrinterDriver()
+{
+ EndRendering();
+ if (m_pPSOutput) {
+ delete m_pPSOutput;
+ }
+}
+FX_BOOL CPSPrinterDriver::Init(HDC hDC, int pslevel, FX_BOOL bCmykOutput)
+{
+ m_hDC = hDC;
+ m_HorzSize = ::GetDeviceCaps(m_hDC, HORZSIZE);
+ m_VertSize = ::GetDeviceCaps(m_hDC, VERTSIZE);
+ m_Width = ::GetDeviceCaps(m_hDC, HORZRES);
+ m_Height = ::GetDeviceCaps(m_hDC, VERTRES);
+ m_nBitsPerPixel = ::GetDeviceCaps(m_hDC, BITSPIXEL);
+ m_pPSOutput = FX_NEW CPSOutput(hDC);
+ if (!m_pPSOutput) {
+ return FALSE;
+ }
+ ((CPSOutput*)m_pPSOutput)->Init();
+ m_PSRenderer.Init(m_pPSOutput, pslevel, m_Width, m_Height, bCmykOutput);
+ m_bCmykOutput = bCmykOutput;
+ HRGN hRgn = ::CreateRectRgn(0, 0, 1, 1);
+ int ret = ::GetClipRgn(hDC, hRgn);
+ if (ret == 1) {
+ ret = ::GetRegionData(hRgn, 0, NULL);
+ if (ret) {
+ RGNDATA* pData = (RGNDATA*)FX_Alloc(FX_BYTE, ret);
+ if (!pData) {
+ return FALSE;
+ }
+ ret = ::GetRegionData(hRgn, ret, pData);
+ if (ret) {
+ CFX_PathData path;
+ path.AllocPointCount(pData->rdh.nCount * 5);
+ for (FX_DWORD i = 0; i < pData->rdh.nCount; i ++) {
+ RECT* pRect = (RECT*)(pData->Buffer + pData->rdh.nRgnSize * i);
+ path.AppendRect((FX_FLOAT)pRect->left, (FX_FLOAT)pRect->bottom, (FX_FLOAT)pRect->right, (FX_FLOAT)pRect->top);
+ }
+ m_PSRenderer.SetClip_PathFill(&path, NULL, FXFILL_WINDING);
+ }
+ FX_Free(pData);
+ }
+ }
+ ::DeleteObject(hRgn);
+ return TRUE;
+}
+int CPSPrinterDriver::GetDeviceCaps(int caps_id)
+{
+ switch (caps_id) {
+ case FXDC_DEVICE_CLASS:
+ return FXDC_PRINTER;
+ case FXDC_PIXEL_WIDTH:
+ return m_Width;
+ case FXDC_PIXEL_HEIGHT:
+ return m_Height;
+ case FXDC_BITS_PIXEL:
+ return m_nBitsPerPixel;
+ case FXDC_RENDER_CAPS:
+ return m_bCmykOutput ? FXRC_BIT_MASK | FXRC_CMYK_OUTPUT : FXRC_BIT_MASK;
+ case FXDC_HORZ_SIZE:
+ return m_HorzSize;
+ case FXDC_VERT_SIZE:
+ return m_VertSize;
+ }
+ return 0;
+}
+FX_BOOL CPSPrinterDriver::StartRendering()
+{
+ return m_PSRenderer.StartRendering();
+}
+void CPSPrinterDriver::EndRendering()
+{
+ m_PSRenderer.EndRendering();
+}
+void CPSPrinterDriver::SaveState()
+{
+ m_PSRenderer.SaveState();
+}
+void CPSPrinterDriver::RestoreState(FX_BOOL bKeepSaved)
+{
+ m_PSRenderer.RestoreState(bKeepSaved);
+}
+FX_BOOL CPSPrinterDriver::SetClip_PathFill(const CFX_PathData* pPathData, const CFX_AffineMatrix* pObject2Device,
+ int fill_mode)
+{
+ m_PSRenderer.SetClip_PathFill(pPathData, pObject2Device, fill_mode);
+ return TRUE;
+}
+FX_BOOL CPSPrinterDriver::SetClip_PathStroke(const CFX_PathData* pPathData,
+ const CFX_AffineMatrix* pObject2Device,
+ const CFX_GraphStateData* pGraphState)
+{
+ m_PSRenderer.SetClip_PathStroke(pPathData, pObject2Device, pGraphState);
+ return TRUE;
+}
+FX_BOOL CPSPrinterDriver::DrawPath(const CFX_PathData* pPathData,
+ const CFX_AffineMatrix* pObject2Device,
+ const CFX_GraphStateData* pGraphState, FX_ARGB fill_color, FX_ARGB stroke_color,
+ int fill_mode, int alpha_flag, void* pIccTransform, int blend_type)
+{
+ if (blend_type != FXDIB_BLEND_NORMAL) {
+ return FALSE;
+ }
+ return m_PSRenderer.DrawPath(pPathData, pObject2Device, pGraphState, fill_color, stroke_color, fill_mode & 3, alpha_flag, pIccTransform);
+}
+FX_BOOL CPSPrinterDriver::GetClipBox(FX_RECT* pRect)
+{
+ *pRect = m_PSRenderer.GetClipBox();
+ return TRUE;
+}
+FX_BOOL CPSPrinterDriver::SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, const FX_RECT* pSrcRect, int left, int top, int blend_type,
+ int alpha_flag, void* pIccTransform)
+{
+ if (blend_type != FXDIB_BLEND_NORMAL) {
+ return FALSE;
+ }
+ return m_PSRenderer.SetDIBits(pBitmap, color, left, top, alpha_flag, pIccTransform);
+}
+FX_BOOL CPSPrinterDriver::StretchDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, int dest_left, int dest_top,
+ int dest_width, int dest_height, const FX_RECT* pClipRect, FX_DWORD flags,
+ int alpha_flag, void* pIccTransform, int blend_type)
+{
+ if (blend_type != FXDIB_BLEND_NORMAL) {
+ return FALSE;
+ }
+ return m_PSRenderer.StretchDIBits(pBitmap, color, dest_left, dest_top, dest_width, dest_height, flags, alpha_flag, pIccTransform);
+}
+FX_BOOL CPSPrinterDriver::StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD color,
+ const CFX_AffineMatrix* pMatrix, FX_DWORD render_flags, FX_LPVOID& handle,
+ int alpha_flag, void* pIccTransform, int blend_type)
+{
+ if (blend_type != FXDIB_BLEND_NORMAL) {
+ return FALSE;
+ }
+ if (bitmap_alpha < 255) {
+ return FALSE;
+ }
+ handle = NULL;
+ return m_PSRenderer.DrawDIBits(pBitmap, color, pMatrix, render_flags, alpha_flag, pIccTransform);
+}
+FX_BOOL CPSPrinterDriver::DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont,
+ CFX_FontCache* pCache, const CFX_AffineMatrix* pObject2Device, FX_FLOAT font_size, FX_DWORD color,
+ int alpha_flag, void* pIccTransform)
+{
+ return m_PSRenderer.DrawText(nChars, pCharPos, pFont, pCache, pObject2Device, font_size, color, alpha_flag, pIccTransform);
+}
+#endif
diff --git a/core/src/fxge/win32/win32_int.h b/core/src/fxge/win32/win32_int.h
index 3f940eda1e..83595cbf8d 100644
--- a/core/src/fxge/win32/win32_int.h
+++ b/core/src/fxge/win32/win32_int.h
@@ -1,238 +1,238 @@
-// 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
-
-struct WINDIB_Open_Args_;
-class CGdiplusExt
-{
-public:
- CGdiplusExt();
- ~CGdiplusExt();
- void Load();
- FX_BOOL IsAvailable()
- {
- return m_hModule != NULL;
- }
- FX_BOOL StretchBitMask(HDC hDC, BOOL bMonoDevice, const CFX_DIBitmap* pBitmap, int dest_left, int dest_top,
- int dest_width, int dest_height, FX_DWORD argb, const FX_RECT* pClipRect, int flags);
- FX_BOOL StretchDIBits(HDC hDC, const CFX_DIBitmap* pBitmap, int dest_left, int dest_top,
- int dest_width, int dest_height, const FX_RECT* pClipRect, int flags);
- FX_BOOL DrawPath(HDC hDC, const CFX_PathData* pPathData,
- const CFX_AffineMatrix* pObject2Device,
- const CFX_GraphStateData* pGraphState,
- FX_DWORD fill_argb,
- FX_DWORD stroke_argb,
- int fill_mode
- );
-
- void* LoadMemFont(FX_BYTE* pData, FX_DWORD size);
- void DeleteMemFont(void* pFontCollection);
- FX_BOOL GdipCreateFromImage(void* bitmap, void** graphics);
- void GdipDeleteGraphics(void* graphics);
- void GdipSetTextRenderingHint(void* graphics, int mode);
- void GdipSetPageUnit(void* graphics, FX_DWORD unit);
- void GdipSetWorldTransform(void* graphics, void* pMatrix);
- FX_BOOL GdipDrawDriverString(void *graphics, unsigned short *text, int length, void *font, void* brush, void *positions, int flags, const void *matrix);
- void GdipCreateBrush(FX_DWORD fill_argb, void** pBrush);
- void GdipDeleteBrush(void* pBrush);
- void GdipCreateMatrix(FX_FLOAT a, FX_FLOAT b, FX_FLOAT c, FX_FLOAT d, FX_FLOAT e, FX_FLOAT f, void** matrix);
- void GdipDeleteMatrix(void* matrix);
- FX_BOOL GdipCreateFontFamilyFromName(FX_LPCWSTR name, void* pFontCollection, void**pFamily);
- void GdipDeleteFontFamily(void* pFamily);
- FX_BOOL GdipCreateFontFromFamily(void* pFamily, FX_FLOAT font_size, int fontstyle, int flag, void** pFont);
- void* GdipCreateFontFromCollection(void* pFontCollection, FX_FLOAT font_size, int fontstyle);
- void GdipDeleteFont(void* pFont);
- FX_BOOL GdipCreateBitmap(CFX_DIBitmap* pBitmap, void**bitmap);
- void GdipDisposeImage(void* bitmap);
- void GdipGetFontSize(void *pFont, FX_FLOAT *size);
- void* GdiAddFontMemResourceEx(void *pFontdata, FX_DWORD size, void* pdv, FX_DWORD* num_face);
- FX_BOOL GdiRemoveFontMemResourceEx(void* handle);
- void* m_Functions[100];
- void* m_pGdiAddFontMemResourceEx;
- void* m_pGdiRemoveFontMemResourseEx;
- CFX_DIBitmap* LoadDIBitmap(WINDIB_Open_Args_ args);
-protected:
- HMODULE m_hModule;
- HMODULE m_GdiModule;
-};
-#include "dwrite_int.h"
-class CWin32Platform : public CFX_Object
-{
-public:
- FX_BOOL m_bHalfTone;
- CGdiplusExt m_GdiplusExt;
- CDWriteExt m_DWriteExt;
-};
-class CGdiDeviceDriver : public IFX_RenderDeviceDriver
-{
-protected:
- virtual int GetDeviceCaps(int caps_id);
- virtual void SaveState()
- {
- SaveDC(m_hDC);
- }
- virtual void RestoreState(FX_BOOL bKeepSaved = FALSE)
- {
- RestoreDC(m_hDC, -1);
- if (bKeepSaved) {
- SaveDC(m_hDC);
- }
- }
- virtual FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData,
- const CFX_AffineMatrix* pObject2Device,
- int fill_mode
- );
- virtual FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData,
- const CFX_AffineMatrix* pObject2Device,
- const CFX_GraphStateData* pGraphState
- );
- virtual FX_BOOL DrawPath(const CFX_PathData* pPathData,
- const CFX_AffineMatrix* pObject2Device,
- const CFX_GraphStateData* pGraphState,
- FX_DWORD fill_color,
- FX_DWORD stroke_color,
- int fill_mode,
- int alpha_flag,
- void* pIccTransform,
- int blend_type
- );
- virtual FX_BOOL FillRect(const FX_RECT* pRect,
- FX_DWORD fill_color,
- int alpha_flag, void* pIccTransform, int blend_type);
- virtual FX_BOOL DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, FX_DWORD color,
- int alpha_flag, void* pIccTransform, int blend_type);
- virtual FX_LPVOID GetClipRgn() ;
- virtual FX_BOOL SetClipRgn(FX_LPVOID pRgn) ;
- virtual FX_BOOL GetClipBox(FX_RECT* pRect);
- virtual FX_BOOL DeleteDeviceRgn(FX_LPVOID pRgn);
- virtual void DrawLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2);
- virtual void* GetPlatformSurface()
- {
- return (void*)m_hDC;
- }
- FX_BOOL GDI_SetDIBits(const CFX_DIBitmap* pBitmap, const FX_RECT* pSrcRect, int left, int top,
- void* pIccTransform);
- FX_BOOL GDI_StretchDIBits(const CFX_DIBitmap* pBitmap, int dest_left, int dest_top,
- int dest_width, int dest_height, FX_DWORD flags,
- void* pIccTransform);
- FX_BOOL GDI_StretchBitMask(const CFX_DIBitmap* pBitmap, int dest_left, int dest_top,
- int dest_width, int dest_height, FX_DWORD bitmap_color, FX_DWORD flags,
- int alpha_flag, void* pIccTransform);
- HDC m_hDC;
- int m_Width, m_Height, m_nBitsPerPixel;
- int m_DeviceClass, m_RenderCaps;
- CGdiDeviceDriver(HDC hDC, int device_class);
- ~CGdiDeviceDriver() {}
-};
-class CGdiDisplayDriver : public CGdiDeviceDriver
-{
-public:
- CGdiDisplayDriver(HDC hDC);
-protected:
- virtual FX_BOOL GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform = NULL, FX_BOOL bDEdge = FALSE);
- virtual FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, const FX_RECT* pSrcRect, int left, int top, int blend_type,
- int alpha_flag, void* pIccTransform);
- virtual FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, int dest_left, int dest_top,
- int dest_width, int dest_height, const FX_RECT* pClipRect, FX_DWORD flags,
- int alpha_flag, void* pIccTransform, int blend_type);
- virtual FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD color,
- const CFX_AffineMatrix* pMatrix, FX_DWORD render_flags, FX_LPVOID& handle,
- int alpha_flag, void* pIccTransform, int blend_type)
- {
- return FALSE;
- }
- FX_BOOL UseFoxitStretchEngine(const CFX_DIBSource* pSource, FX_DWORD color, int dest_left, int dest_top,
- int dest_width, int dest_height, const FX_RECT* pClipRect, int render_flags,
- int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL);
-};
-class CGdiPrinterDriver : public CGdiDeviceDriver
-{
-public:
- CGdiPrinterDriver(HDC hDC);
-protected:
- virtual int GetDeviceCaps(int caps_id);
- virtual FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, const FX_RECT* pSrcRect, int left, int top, int blend_type,
- int alpha_flag, void* pIccTransform);
- virtual FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, int dest_left, int dest_top,
- int dest_width, int dest_height, const FX_RECT* pClipRect, FX_DWORD flags,
- int alpha_flag, void* pIccTransform, int blend_type);
- virtual FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD color,
- const CFX_AffineMatrix* pMatrix, FX_DWORD render_flags, FX_LPVOID& handle,
- int alpha_flag, void* pIccTransform, int blend_type);
- int m_HorzSize, m_VertSize;
- FX_BOOL m_bSupportROP;
-};
-class CPSOutput : public IFX_PSOutput, public CFX_Object
-{
-public:
- CPSOutput(HDC hDC);
- virtual ~CPSOutput();
- virtual void Release()
- {
- delete this;
- }
- void Init();
- virtual void OutputPS(FX_LPCSTR string, int len);
- HDC m_hDC;
- FX_LPSTR m_pBuf;
-};
-class CPSPrinterDriver : public IFX_RenderDeviceDriver
-{
-public:
- CPSPrinterDriver();
- FX_BOOL Init(HDC hDC, int ps_level, FX_BOOL bCmykOutput);
- ~CPSPrinterDriver();
-protected:
- virtual FX_BOOL IsPSPrintDriver()
- {
- return TRUE;
- }
- virtual int GetDeviceCaps(int caps_id);
- virtual FX_BOOL StartRendering();
- virtual void EndRendering();
- virtual void SaveState();
- virtual void RestoreState(FX_BOOL bKeepSaved = FALSE);
- virtual FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData,
- const CFX_AffineMatrix* pObject2Device,
- int fill_mode
- );
- virtual FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData,
- const CFX_AffineMatrix* pObject2Device,
- const CFX_GraphStateData* pGraphState
- );
- virtual FX_BOOL DrawPath(const CFX_PathData* pPathData,
- const CFX_AffineMatrix* pObject2Device,
- const CFX_GraphStateData* pGraphState,
- FX_DWORD fill_color,
- FX_DWORD stroke_color,
- int fill_mode,
- int alpha_flag,
- void* pIccTransform,
- int blend_type
- );
- virtual FX_BOOL GetClipBox(FX_RECT* pRect);
- virtual FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, const FX_RECT* pSrcRect, int left, int top, int blend_type,
- int alpha_flag, void* pIccTransform);
- virtual FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, int dest_left, int dest_top,
- int dest_width, int dest_height, const FX_RECT* pClipRect, FX_DWORD flags,
- int alpha_flag, void* pIccTransform, int blend_type);
- virtual FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD color,
- const CFX_AffineMatrix* pMatrix, FX_DWORD render_flags, FX_LPVOID& handle,
- int alpha_flag, void* pIccTransform, int blend_type);
- virtual FX_BOOL DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont,
- CFX_FontCache* pCache, const CFX_AffineMatrix* pObject2Device, FX_FLOAT font_size, FX_DWORD color,
- int alpha_flag, void* pIccTransform);
- virtual void* GetPlatformSurface()
- {
- return (void*)m_hDC;
- }
- HDC m_hDC;
- FX_BOOL m_bCmykOutput;
- int m_Width, m_Height, m_nBitsPerPixel;
- int m_HorzSize, m_VertSize;
- CPSOutput* m_pPSOutput;
- CFX_PSRenderer m_PSRenderer;
-};
-void _Color2Argb(FX_ARGB& argb, FX_DWORD color, int alpha_flag, void* pIccTransform);
+// 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
+
+struct WINDIB_Open_Args_;
+class CGdiplusExt
+{
+public:
+ CGdiplusExt();
+ ~CGdiplusExt();
+ void Load();
+ FX_BOOL IsAvailable()
+ {
+ return m_hModule != NULL;
+ }
+ FX_BOOL StretchBitMask(HDC hDC, BOOL bMonoDevice, const CFX_DIBitmap* pBitmap, int dest_left, int dest_top,
+ int dest_width, int dest_height, FX_DWORD argb, const FX_RECT* pClipRect, int flags);
+ FX_BOOL StretchDIBits(HDC hDC, const CFX_DIBitmap* pBitmap, int dest_left, int dest_top,
+ int dest_width, int dest_height, const FX_RECT* pClipRect, int flags);
+ FX_BOOL DrawPath(HDC hDC, const CFX_PathData* pPathData,
+ const CFX_AffineMatrix* pObject2Device,
+ const CFX_GraphStateData* pGraphState,
+ FX_DWORD fill_argb,
+ FX_DWORD stroke_argb,
+ int fill_mode
+ );
+
+ void* LoadMemFont(FX_BYTE* pData, FX_DWORD size);
+ void DeleteMemFont(void* pFontCollection);
+ FX_BOOL GdipCreateFromImage(void* bitmap, void** graphics);
+ void GdipDeleteGraphics(void* graphics);
+ void GdipSetTextRenderingHint(void* graphics, int mode);
+ void GdipSetPageUnit(void* graphics, FX_DWORD unit);
+ void GdipSetWorldTransform(void* graphics, void* pMatrix);
+ FX_BOOL GdipDrawDriverString(void *graphics, unsigned short *text, int length, void *font, void* brush, void *positions, int flags, const void *matrix);
+ void GdipCreateBrush(FX_DWORD fill_argb, void** pBrush);
+ void GdipDeleteBrush(void* pBrush);
+ void GdipCreateMatrix(FX_FLOAT a, FX_FLOAT b, FX_FLOAT c, FX_FLOAT d, FX_FLOAT e, FX_FLOAT f, void** matrix);
+ void GdipDeleteMatrix(void* matrix);
+ FX_BOOL GdipCreateFontFamilyFromName(FX_LPCWSTR name, void* pFontCollection, void**pFamily);
+ void GdipDeleteFontFamily(void* pFamily);
+ FX_BOOL GdipCreateFontFromFamily(void* pFamily, FX_FLOAT font_size, int fontstyle, int flag, void** pFont);
+ void* GdipCreateFontFromCollection(void* pFontCollection, FX_FLOAT font_size, int fontstyle);
+ void GdipDeleteFont(void* pFont);
+ FX_BOOL GdipCreateBitmap(CFX_DIBitmap* pBitmap, void**bitmap);
+ void GdipDisposeImage(void* bitmap);
+ void GdipGetFontSize(void *pFont, FX_FLOAT *size);
+ void* GdiAddFontMemResourceEx(void *pFontdata, FX_DWORD size, void* pdv, FX_DWORD* num_face);
+ FX_BOOL GdiRemoveFontMemResourceEx(void* handle);
+ void* m_Functions[100];
+ void* m_pGdiAddFontMemResourceEx;
+ void* m_pGdiRemoveFontMemResourseEx;
+ CFX_DIBitmap* LoadDIBitmap(WINDIB_Open_Args_ args);
+protected:
+ HMODULE m_hModule;
+ HMODULE m_GdiModule;
+};
+#include "dwrite_int.h"
+class CWin32Platform : public CFX_Object
+{
+public:
+ FX_BOOL m_bHalfTone;
+ CGdiplusExt m_GdiplusExt;
+ CDWriteExt m_DWriteExt;
+};
+class CGdiDeviceDriver : public IFX_RenderDeviceDriver
+{
+protected:
+ virtual int GetDeviceCaps(int caps_id);
+ virtual void SaveState()
+ {
+ SaveDC(m_hDC);
+ }
+ virtual void RestoreState(FX_BOOL bKeepSaved = FALSE)
+ {
+ RestoreDC(m_hDC, -1);
+ if (bKeepSaved) {
+ SaveDC(m_hDC);
+ }
+ }
+ virtual FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData,
+ const CFX_AffineMatrix* pObject2Device,
+ int fill_mode
+ );
+ virtual FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData,
+ const CFX_AffineMatrix* pObject2Device,
+ const CFX_GraphStateData* pGraphState
+ );
+ virtual FX_BOOL DrawPath(const CFX_PathData* pPathData,
+ const CFX_AffineMatrix* pObject2Device,
+ const CFX_GraphStateData* pGraphState,
+ FX_DWORD fill_color,
+ FX_DWORD stroke_color,
+ int fill_mode,
+ int alpha_flag,
+ void* pIccTransform,
+ int blend_type
+ );
+ virtual FX_BOOL FillRect(const FX_RECT* pRect,
+ FX_DWORD fill_color,
+ int alpha_flag, void* pIccTransform, int blend_type);
+ virtual FX_BOOL DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2, FX_DWORD color,
+ int alpha_flag, void* pIccTransform, int blend_type);
+ virtual FX_LPVOID GetClipRgn() ;
+ virtual FX_BOOL SetClipRgn(FX_LPVOID pRgn) ;
+ virtual FX_BOOL GetClipBox(FX_RECT* pRect);
+ virtual FX_BOOL DeleteDeviceRgn(FX_LPVOID pRgn);
+ virtual void DrawLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2);
+ virtual void* GetPlatformSurface()
+ {
+ return (void*)m_hDC;
+ }
+ FX_BOOL GDI_SetDIBits(const CFX_DIBitmap* pBitmap, const FX_RECT* pSrcRect, int left, int top,
+ void* pIccTransform);
+ FX_BOOL GDI_StretchDIBits(const CFX_DIBitmap* pBitmap, int dest_left, int dest_top,
+ int dest_width, int dest_height, FX_DWORD flags,
+ void* pIccTransform);
+ FX_BOOL GDI_StretchBitMask(const CFX_DIBitmap* pBitmap, int dest_left, int dest_top,
+ int dest_width, int dest_height, FX_DWORD bitmap_color, FX_DWORD flags,
+ int alpha_flag, void* pIccTransform);
+ HDC m_hDC;
+ int m_Width, m_Height, m_nBitsPerPixel;
+ int m_DeviceClass, m_RenderCaps;
+ CGdiDeviceDriver(HDC hDC, int device_class);
+ ~CGdiDeviceDriver() {}
+};
+class CGdiDisplayDriver : public CGdiDeviceDriver
+{
+public:
+ CGdiDisplayDriver(HDC hDC);
+protected:
+ virtual FX_BOOL GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform = NULL, FX_BOOL bDEdge = FALSE);
+ virtual FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, const FX_RECT* pSrcRect, int left, int top, int blend_type,
+ int alpha_flag, void* pIccTransform);
+ virtual FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, int dest_left, int dest_top,
+ int dest_width, int dest_height, const FX_RECT* pClipRect, FX_DWORD flags,
+ int alpha_flag, void* pIccTransform, int blend_type);
+ virtual FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD color,
+ const CFX_AffineMatrix* pMatrix, FX_DWORD render_flags, FX_LPVOID& handle,
+ int alpha_flag, void* pIccTransform, int blend_type)
+ {
+ return FALSE;
+ }
+ FX_BOOL UseFoxitStretchEngine(const CFX_DIBSource* pSource, FX_DWORD color, int dest_left, int dest_top,
+ int dest_width, int dest_height, const FX_RECT* pClipRect, int render_flags,
+ int alpha_flag = 0, void* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL);
+};
+class CGdiPrinterDriver : public CGdiDeviceDriver
+{
+public:
+ CGdiPrinterDriver(HDC hDC);
+protected:
+ virtual int GetDeviceCaps(int caps_id);
+ virtual FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, const FX_RECT* pSrcRect, int left, int top, int blend_type,
+ int alpha_flag, void* pIccTransform);
+ virtual FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, int dest_left, int dest_top,
+ int dest_width, int dest_height, const FX_RECT* pClipRect, FX_DWORD flags,
+ int alpha_flag, void* pIccTransform, int blend_type);
+ virtual FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD color,
+ const CFX_AffineMatrix* pMatrix, FX_DWORD render_flags, FX_LPVOID& handle,
+ int alpha_flag, void* pIccTransform, int blend_type);
+ int m_HorzSize, m_VertSize;
+ FX_BOOL m_bSupportROP;
+};
+class CPSOutput : public IFX_PSOutput, public CFX_Object
+{
+public:
+ CPSOutput(HDC hDC);
+ virtual ~CPSOutput();
+ virtual void Release()
+ {
+ delete this;
+ }
+ void Init();
+ virtual void OutputPS(FX_LPCSTR string, int len);
+ HDC m_hDC;
+ FX_LPSTR m_pBuf;
+};
+class CPSPrinterDriver : public IFX_RenderDeviceDriver
+{
+public:
+ CPSPrinterDriver();
+ FX_BOOL Init(HDC hDC, int ps_level, FX_BOOL bCmykOutput);
+ ~CPSPrinterDriver();
+protected:
+ virtual FX_BOOL IsPSPrintDriver()
+ {
+ return TRUE;
+ }
+ virtual int GetDeviceCaps(int caps_id);
+ virtual FX_BOOL StartRendering();
+ virtual void EndRendering();
+ virtual void SaveState();
+ virtual void RestoreState(FX_BOOL bKeepSaved = FALSE);
+ virtual FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData,
+ const CFX_AffineMatrix* pObject2Device,
+ int fill_mode
+ );
+ virtual FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData,
+ const CFX_AffineMatrix* pObject2Device,
+ const CFX_GraphStateData* pGraphState
+ );
+ virtual FX_BOOL DrawPath(const CFX_PathData* pPathData,
+ const CFX_AffineMatrix* pObject2Device,
+ const CFX_GraphStateData* pGraphState,
+ FX_DWORD fill_color,
+ FX_DWORD stroke_color,
+ int fill_mode,
+ int alpha_flag,
+ void* pIccTransform,
+ int blend_type
+ );
+ virtual FX_BOOL GetClipBox(FX_RECT* pRect);
+ virtual FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, const FX_RECT* pSrcRect, int left, int top, int blend_type,
+ int alpha_flag, void* pIccTransform);
+ virtual FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, int dest_left, int dest_top,
+ int dest_width, int dest_height, const FX_RECT* pClipRect, FX_DWORD flags,
+ int alpha_flag, void* pIccTransform, int blend_type);
+ virtual FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD color,
+ const CFX_AffineMatrix* pMatrix, FX_DWORD render_flags, FX_LPVOID& handle,
+ int alpha_flag, void* pIccTransform, int blend_type);
+ virtual FX_BOOL DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont,
+ CFX_FontCache* pCache, const CFX_AffineMatrix* pObject2Device, FX_FLOAT font_size, FX_DWORD color,
+ int alpha_flag, void* pIccTransform);
+ virtual void* GetPlatformSurface()
+ {
+ return (void*)m_hDC;
+ }
+ HDC m_hDC;
+ FX_BOOL m_bCmykOutput;
+ int m_Width, m_Height, m_nBitsPerPixel;
+ int m_HorzSize, m_VertSize;
+ CPSOutput* m_pPSOutput;
+ CFX_PSRenderer m_PSRenderer;
+};
+void _Color2Argb(FX_ARGB& argb, FX_DWORD color, int alpha_flag, void* pIccTransform);
diff --git a/fpdfsdk/include/formfiller/FFL_CBA_Fontmap.h b/fpdfsdk/include/formfiller/FFL_CBA_Fontmap.h
index 7624596788..50f516041e 100644
--- a/fpdfsdk/include/formfiller/FFL_CBA_Fontmap.h
+++ b/fpdfsdk/include/formfiller/FFL_CBA_Fontmap.h
@@ -1,51 +1,51 @@
-// 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 _RAO_FONTMAP_H_
-#define _RAO_FONTMAP_H_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-class CPDFSDK_Annot;
-
-class CBA_FontMap : public CPWL_FontMap
-{
-public:
- CBA_FontMap(CPDFSDK_Annot* pAnnot, IFX_SystemHandler* pSystemHandler);
- CBA_FontMap(CPDF_Document* pDocument, CPDF_Dictionary* pAnnotDict, IFX_SystemHandler* pSystemHandler);
-
- virtual ~CBA_FontMap();
-
- virtual void Initial(FX_LPCSTR fontname = NULL);
-
-public:
- void SetDefaultFont(CPDF_Font * pFont, const CFX_ByteString & sFontName);
-
- void Reset();
- void SetAPType(const CFX_ByteString& sAPType);
-
-protected:
- virtual CPDF_Font* FindFontSameCharset(CFX_ByteString& sFontAlias, FX_INT32 nCharset);
- virtual void AddedFont(CPDF_Font* pFont, const CFX_ByteString& sFontAlias);
- virtual CPDF_Document* GetDocument();
-private:
- CPDF_Font* FindResFontSameCharset(CPDF_Dictionary* pResDict, CFX_ByteString& sFontAlias,
- FX_INT32 nCharset);
- CPDF_Font* GetAnnotDefaultFont(CFX_ByteString &csNameTag);
- void AddFontToAnnotDict(CPDF_Font* pFont, const CFX_ByteString& sAlias);
-
-private:
- CPDF_Document* m_pDocument;
- CPDF_Dictionary* m_pAnnotDict;
- CPDF_Font* m_pDefaultFont;
- CFX_ByteString m_sDefaultFontName;
-
- CFX_ByteString m_sAPType;
-};
-
-#endif // _RAO_FONTMAP_H_
+// 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 _RAO_FONTMAP_H_
+#define _RAO_FONTMAP_H_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+class CPDFSDK_Annot;
+
+class CBA_FontMap : public CPWL_FontMap
+{
+public:
+ CBA_FontMap(CPDFSDK_Annot* pAnnot, IFX_SystemHandler* pSystemHandler);
+ CBA_FontMap(CPDF_Document* pDocument, CPDF_Dictionary* pAnnotDict, IFX_SystemHandler* pSystemHandler);
+
+ virtual ~CBA_FontMap();
+
+ virtual void Initial(FX_LPCSTR fontname = NULL);
+
+public:
+ void SetDefaultFont(CPDF_Font * pFont, const CFX_ByteString & sFontName);
+
+ void Reset();
+ void SetAPType(const CFX_ByteString& sAPType);
+
+protected:
+ virtual CPDF_Font* FindFontSameCharset(CFX_ByteString& sFontAlias, FX_INT32 nCharset);
+ virtual void AddedFont(CPDF_Font* pFont, const CFX_ByteString& sFontAlias);
+ virtual CPDF_Document* GetDocument();
+private:
+ CPDF_Font* FindResFontSameCharset(CPDF_Dictionary* pResDict, CFX_ByteString& sFontAlias,
+ FX_INT32 nCharset);
+ CPDF_Font* GetAnnotDefaultFont(CFX_ByteString &csNameTag);
+ void AddFontToAnnotDict(CPDF_Font* pFont, const CFX_ByteString& sAlias);
+
+private:
+ CPDF_Document* m_pDocument;
+ CPDF_Dictionary* m_pAnnotDict;
+ CPDF_Font* m_pDefaultFont;
+ CFX_ByteString m_sDefaultFontName;
+
+ CFX_ByteString m_sAPType;
+};
+
+#endif // _RAO_FONTMAP_H_
diff --git a/fpdfsdk/include/formfiller/FFL_CheckBox.h b/fpdfsdk/include/formfiller/FFL_CheckBox.h
index f8ee370519..9aaf7fe526 100644
--- a/fpdfsdk/include/formfiller/FFL_CheckBox.h
+++ b/fpdfsdk/include/formfiller/FFL_CheckBox.h
@@ -1,27 +1,27 @@
-// 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 _FFL_CHECKBOX_H_
-#define _FFL_CHECKBOX_H_
-
-class CFFL_CheckBox : public CFFL_Button
-{
-public:
- CFFL_CheckBox(CPDFDoc_Environment* pApp, CPDFSDK_Widget* pWidget);
- virtual ~CFFL_CheckBox();
-
- virtual CPWL_Wnd* NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageView* pPageView);
-
- virtual FX_BOOL OnKeyDown(CPDFSDK_Annot* pAnnot, FX_UINT nKeyCode, FX_UINT nFlags);
- virtual FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags);
- virtual FX_BOOL OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
-
- virtual FX_BOOL IsDataChanged(CPDFSDK_PageView* pPageView);
- virtual void SaveData(CPDFSDK_PageView* pPageView);
-};
-
-#endif //_FFL_CHECKBOX_H_
-
+// 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 _FFL_CHECKBOX_H_
+#define _FFL_CHECKBOX_H_
+
+class CFFL_CheckBox : public CFFL_Button
+{
+public:
+ CFFL_CheckBox(CPDFDoc_Environment* pApp, CPDFSDK_Widget* pWidget);
+ virtual ~CFFL_CheckBox();
+
+ virtual CPWL_Wnd* NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageView* pPageView);
+
+ virtual FX_BOOL OnKeyDown(CPDFSDK_Annot* pAnnot, FX_UINT nKeyCode, FX_UINT nFlags);
+ virtual FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags);
+ virtual FX_BOOL OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
+
+ virtual FX_BOOL IsDataChanged(CPDFSDK_PageView* pPageView);
+ virtual void SaveData(CPDFSDK_PageView* pPageView);
+};
+
+#endif //_FFL_CHECKBOX_H_
+
diff --git a/fpdfsdk/include/formfiller/FFL_ComboBox.h b/fpdfsdk/include/formfiller/FFL_ComboBox.h
index f116acffd9..6df8347a76 100644
--- a/fpdfsdk/include/formfiller/FFL_ComboBox.h
+++ b/fpdfsdk/include/formfiller/FFL_ComboBox.h
@@ -1,69 +1,69 @@
-// 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 _FFL_COMBOBOX_H_
- #define _FFL_COMBOBOX_H_
-
-struct FFL_ComboBoxState
-{
- int nIndex;
- int nStart;
- int nEnd;
- CFX_WideString sValue;
-};
-class CBA_FontMap;
-
-class CFFL_ComboBox : public CFFL_FormFiller, public IPWL_FocusHandler, public IPWL_Edit_Notify
-{
-public:
- CFFL_ComboBox(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pWidget);
- virtual ~CFFL_ComboBox();
-
- virtual PWL_CREATEPARAM GetCreateParam();
- virtual CPWL_Wnd* NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageView* pPageView);
-
-
- virtual FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags);
-
- virtual FX_BOOL IsDataChanged(CPDFSDK_PageView* pPageView);
- virtual void SaveData(CPDFSDK_PageView* pPageView);
-
- virtual void GetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type, PDFSDK_FieldAction& fa);
- virtual void SetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type, const PDFSDK_FieldAction& fa);
- virtual FX_BOOL IsActionDataChanged(CPDF_AAction::AActionType type, const PDFSDK_FieldAction& faOld, const PDFSDK_FieldAction& faNew);
- virtual void SaveState(CPDFSDK_PageView* pPageView);
- virtual void RestoreState(CPDFSDK_PageView* pPageView);
-
- virtual CPWL_Wnd* ResetPDFWindow(CPDFSDK_PageView* pPageView, FX_BOOL bRestoreValue);
- virtual void OnKeyStroke(FX_BOOL bKeyDown, FX_UINT nFlag);
-
-public:
- virtual void OnSetFocus(CPWL_Wnd* pWnd);
- virtual void OnKillFocus(CPWL_Wnd* pWnd);
-
-public:
- virtual void OnAddUndo(CPWL_Edit* pEdit);
-
-public:
- virtual FX_BOOL CanCopy(CPDFSDK_Document* pDocument);
- virtual FX_BOOL CanCut(CPDFSDK_Document* pDocument);
- virtual FX_BOOL CanPaste(CPDFSDK_Document* pDocument);
-
- virtual void DoCopy(CPDFSDK_Document* pDocument);
- virtual void DoCut(CPDFSDK_Document* pDocument);
- virtual void DoPaste(CPDFSDK_Document* pDocument);
-
-private:
- CFX_WideString GetSelectExportText();
-
-private:
- CBA_FontMap* m_pFontMap;
- FFL_ComboBoxState m_State;
- //CFFL_IM_BOX m_IMBox;
-};
-
-#endif //_FFL_COMBOBOX_H_
-
+// 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 _FFL_COMBOBOX_H_
+ #define _FFL_COMBOBOX_H_
+
+struct FFL_ComboBoxState
+{
+ int nIndex;
+ int nStart;
+ int nEnd;
+ CFX_WideString sValue;
+};
+class CBA_FontMap;
+
+class CFFL_ComboBox : public CFFL_FormFiller, public IPWL_FocusHandler, public IPWL_Edit_Notify
+{
+public:
+ CFFL_ComboBox(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pWidget);
+ virtual ~CFFL_ComboBox();
+
+ virtual PWL_CREATEPARAM GetCreateParam();
+ virtual CPWL_Wnd* NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageView* pPageView);
+
+
+ virtual FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags);
+
+ virtual FX_BOOL IsDataChanged(CPDFSDK_PageView* pPageView);
+ virtual void SaveData(CPDFSDK_PageView* pPageView);
+
+ virtual void GetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type, PDFSDK_FieldAction& fa);
+ virtual void SetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type, const PDFSDK_FieldAction& fa);
+ virtual FX_BOOL IsActionDataChanged(CPDF_AAction::AActionType type, const PDFSDK_FieldAction& faOld, const PDFSDK_FieldAction& faNew);
+ virtual void SaveState(CPDFSDK_PageView* pPageView);
+ virtual void RestoreState(CPDFSDK_PageView* pPageView);
+
+ virtual CPWL_Wnd* ResetPDFWindow(CPDFSDK_PageView* pPageView, FX_BOOL bRestoreValue);
+ virtual void OnKeyStroke(FX_BOOL bKeyDown, FX_UINT nFlag);
+
+public:
+ virtual void OnSetFocus(CPWL_Wnd* pWnd);
+ virtual void OnKillFocus(CPWL_Wnd* pWnd);
+
+public:
+ virtual void OnAddUndo(CPWL_Edit* pEdit);
+
+public:
+ virtual FX_BOOL CanCopy(CPDFSDK_Document* pDocument);
+ virtual FX_BOOL CanCut(CPDFSDK_Document* pDocument);
+ virtual FX_BOOL CanPaste(CPDFSDK_Document* pDocument);
+
+ virtual void DoCopy(CPDFSDK_Document* pDocument);
+ virtual void DoCut(CPDFSDK_Document* pDocument);
+ virtual void DoPaste(CPDFSDK_Document* pDocument);
+
+private:
+ CFX_WideString GetSelectExportText();
+
+private:
+ CBA_FontMap* m_pFontMap;
+ FFL_ComboBoxState m_State;
+ //CFFL_IM_BOX m_IMBox;
+};
+
+#endif //_FFL_COMBOBOX_H_
+
diff --git a/fpdfsdk/include/formfiller/FFL_FormFiller.h b/fpdfsdk/include/formfiller/FFL_FormFiller.h
index eb81675fa4..7a3402a7f9 100644
--- a/fpdfsdk/include/formfiller/FFL_FormFiller.h
+++ b/fpdfsdk/include/formfiller/FFL_FormFiller.h
@@ -1,178 +1,178 @@
-// 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 _FFL_FORMFILLER_H_
-#define _FFL_FORMFILLER_H_
-
-#include "FFL_IFormFiller.h"
-#include "FFL_CBA_Fontmap.h"
-
-class CPDFSDK_Annot;
-class CFFL_FormFiller;
-class CFFL_Notify;
-class CPDFDoc_Environment;
-class CPDFSDK_PageView;
-class CPDFSDK_Document;
-class CPDFSDK_Widget;
-
-
-#define CFFL_PageView2PDFWindow CFX_MapPtrTemplate<CPDFSDK_PageView*, CPWL_Wnd*>
-
-struct FFL_KeyStrokeData
-{
- CFX_WideString swValue;
- FX_BOOL bFull;
- int nSelStart;
- int nSelEnd;
-};
-
-
-
-class CFFL_FormFiller : /*public IBA_AnnotFiller,*/ public IPWL_Provider, public CPWL_TimerHandler
-{
-public:
- CFFL_FormFiller(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pAnnot);
- virtual ~CFFL_FormFiller();
-
- virtual FX_RECT GetViewBBox(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot);
- virtual void OnDraw(CPDFSDK_PageView *pPageView, /*HDC hDC,*/ CPDFSDK_Annot* pAnnot,
- CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
- /*const CRect& rcWindow, */FX_DWORD dwFlags);
- virtual void OnDrawDeactive(CPDFSDK_PageView *pPageView, /*HDC hDC,*/ CPDFSDK_Annot* pAnnot,
- CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
- /*const CRect& rcWindow, */FX_DWORD dwFlags);
-
- virtual void OnCreate(CPDFSDK_Annot* pAnnot);
- virtual void OnLoad(CPDFSDK_Annot* pAnnot);
- virtual void OnDelete(CPDFSDK_Annot* pAnnot);
-
- virtual void OnMouseEnter(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot);
- virtual void OnMouseExit(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot);
-
- virtual FX_BOOL OnLButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
- virtual FX_BOOL OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
- virtual FX_BOOL OnLButtonDblClk(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
- virtual FX_BOOL OnMouseMove(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
- virtual FX_BOOL OnMouseWheel(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, short zDelta, const CPDF_Point& point);
- virtual FX_BOOL OnRButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
- virtual FX_BOOL OnRButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
- virtual FX_BOOL OnRButtonDblClk(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
-
- virtual FX_BOOL OnKeyDown(CPDFSDK_Annot* pAnnot, FX_UINT nKeyCode, FX_UINT nFlags);
- virtual FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags);
-
- virtual void OnDeSelected(CPDFSDK_Annot* pAnnot);
- virtual void OnSelected(CPDFSDK_Annot* pAnnot);
-
- virtual FX_BOOL OnSetFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag);
- virtual FX_BOOL OnKillFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag);
-
- virtual FX_BOOL CanCopy(CPDFSDK_Document* pDocument);
- virtual FX_BOOL CanCut(CPDFSDK_Document* pDocument);
- virtual FX_BOOL CanPaste(CPDFSDK_Document* pDocument);
-
- virtual void DoCopy(CPDFSDK_Document* pDocument);
- virtual void DoCut(CPDFSDK_Document* pDocument);
- virtual void DoPaste(CPDFSDK_Document* pDocument);
-
-public: //CPWL_TimerHandler
- virtual void TimerProc();
- virtual IFX_SystemHandler* GetSystemHandler() const;
-
-public:
- virtual CPDF_Matrix GetWindowMatrix(void* pAttachedData);
- virtual CFX_WideString LoadPopupMenuString(int nIndex);
-
- virtual void GetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type,
- PDFSDK_FieldAction& fa);
- virtual void SetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type,
- const PDFSDK_FieldAction& fa);
- virtual FX_BOOL IsActionDataChanged(CPDF_AAction::AActionType type, const PDFSDK_FieldAction& faOld,
- const PDFSDK_FieldAction& faNew);
-
- virtual void SaveState(CPDFSDK_PageView* pPageView);
- virtual void RestoreState(CPDFSDK_PageView* pPageView);
-
- virtual CPWL_Wnd* ResetPDFWindow(CPDFSDK_PageView* pPageView, FX_BOOL bRestoreValue);
-
- virtual void OnKeyStroke(FX_BOOL bKeyDown);
-
- CPDF_Matrix GetCurMatrix();
-
- CPDF_Rect FFLtoPWL(const CPDF_Rect& rect);
- CPDF_Rect PWLtoFFL(const CPDF_Rect& rect);
- CPDF_Point FFLtoPWL(const CPDF_Point& point);
- CPDF_Point PWLtoFFL(const CPDF_Point& point);
-
- CPDF_Point WndtoPWL(CPDFSDK_PageView* pPageView, const CPDF_Point& pt);
- CPDF_Rect FFLtoWnd(CPDFSDK_PageView* pPageView, const CPDF_Rect& rect);
-
- void SetWindowRect(CPDFSDK_PageView* pPageView, const CPDF_Rect& rcWindow);
- CPDF_Rect GetWindowRect(CPDFSDK_PageView* pPageView);
-
- static void FFL_FreeData(void* pData);
-
- FX_BOOL CommitData(CPDFSDK_PageView* pPageView, FX_UINT nFlag);
- virtual FX_BOOL IsDataChanged(CPDFSDK_PageView* pPageView);
- virtual void SaveData(CPDFSDK_PageView* pPageView);
-
- virtual void GetKeyStrokeData(CPDFSDK_PageView* pPageView, FFL_KeyStrokeData& data);
-
-public:
- CPWL_Wnd* GetPDFWindow(CPDFSDK_PageView* pPageView, FX_BOOL bNew);
- void DestroyPDFWindow(CPDFSDK_PageView* pPageView);
- void EscapeFiller(CPDFSDK_PageView* pPageView, FX_BOOL bDestroyPDFWindow);
-
- virtual PWL_CREATEPARAM GetCreateParam();
- virtual CPWL_Wnd* NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageView* pPageView) = 0;
- virtual CPDF_Rect GetFocusBox(CPDFSDK_PageView* pPageView);
-
-public:
- FX_BOOL IsValid() const;
- CPDF_Rect GetPDFWindowRect() const;
-
- CPDFSDK_PageView* GetCurPageView();
- void SetChangeMark();
-
- virtual void InvalidateRect(double left, double top, double right, double bottom);
- CPDFDoc_Environment* GetApp(){return m_pApp;}
- CPDFSDK_Annot* GetSDKAnnot() {return m_pAnnot;}
-protected:
- CPDFDoc_Environment* m_pApp;
- CPDFSDK_Widget* m_pWidget;
- CPDFSDK_Annot* m_pAnnot;
-
- FX_BOOL m_bValid;
- CFFL_PageView2PDFWindow m_Maps;
- CPDF_Point m_ptOldPos;
-};
-
-class CFFL_Button : public CFFL_FormFiller
-{
-public:
- CFFL_Button(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pWidget);
- virtual ~CFFL_Button();
-
- virtual void OnMouseEnter(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot);
- virtual void OnMouseExit(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot);
- virtual FX_BOOL OnLButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
- virtual FX_BOOL OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
- virtual FX_BOOL OnMouseMove(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
- virtual void OnDraw(CPDFSDK_PageView *pPageView/*, HDC hDC*/, CPDFSDK_Annot* pAnnot,
- CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
- /*const CRect& rcWindow,*/ FX_DWORD dwFlags);
-
- virtual void OnDrawDeactive(CPDFSDK_PageView *pPageView, /*HDC hDC,*/ CPDFSDK_Annot* pAnnot,
- CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
- /*const CRect& rcWindow, */FX_DWORD dwFlags);
-protected:
- FX_BOOL m_bMouseIn;
- FX_BOOL m_bMouseDown;
-};
-
-//#define CFFL_IM_BOX CFX_ArrayTemplate<CBA_EditInput*>
-
-#endif
+// 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 _FFL_FORMFILLER_H_
+#define _FFL_FORMFILLER_H_
+
+#include "FFL_IFormFiller.h"
+#include "FFL_CBA_Fontmap.h"
+
+class CPDFSDK_Annot;
+class CFFL_FormFiller;
+class CFFL_Notify;
+class CPDFDoc_Environment;
+class CPDFSDK_PageView;
+class CPDFSDK_Document;
+class CPDFSDK_Widget;
+
+
+#define CFFL_PageView2PDFWindow CFX_MapPtrTemplate<CPDFSDK_PageView*, CPWL_Wnd*>
+
+struct FFL_KeyStrokeData
+{
+ CFX_WideString swValue;
+ FX_BOOL bFull;
+ int nSelStart;
+ int nSelEnd;
+};
+
+
+
+class CFFL_FormFiller : /*public IBA_AnnotFiller,*/ public IPWL_Provider, public CPWL_TimerHandler
+{
+public:
+ CFFL_FormFiller(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pAnnot);
+ virtual ~CFFL_FormFiller();
+
+ virtual FX_RECT GetViewBBox(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot);
+ virtual void OnDraw(CPDFSDK_PageView *pPageView, /*HDC hDC,*/ CPDFSDK_Annot* pAnnot,
+ CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
+ /*const CRect& rcWindow, */FX_DWORD dwFlags);
+ virtual void OnDrawDeactive(CPDFSDK_PageView *pPageView, /*HDC hDC,*/ CPDFSDK_Annot* pAnnot,
+ CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
+ /*const CRect& rcWindow, */FX_DWORD dwFlags);
+
+ virtual void OnCreate(CPDFSDK_Annot* pAnnot);
+ virtual void OnLoad(CPDFSDK_Annot* pAnnot);
+ virtual void OnDelete(CPDFSDK_Annot* pAnnot);
+
+ virtual void OnMouseEnter(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot);
+ virtual void OnMouseExit(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot);
+
+ virtual FX_BOOL OnLButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
+ virtual FX_BOOL OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
+ virtual FX_BOOL OnLButtonDblClk(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
+ virtual FX_BOOL OnMouseMove(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
+ virtual FX_BOOL OnMouseWheel(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, short zDelta, const CPDF_Point& point);
+ virtual FX_BOOL OnRButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
+ virtual FX_BOOL OnRButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
+ virtual FX_BOOL OnRButtonDblClk(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
+
+ virtual FX_BOOL OnKeyDown(CPDFSDK_Annot* pAnnot, FX_UINT nKeyCode, FX_UINT nFlags);
+ virtual FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags);
+
+ virtual void OnDeSelected(CPDFSDK_Annot* pAnnot);
+ virtual void OnSelected(CPDFSDK_Annot* pAnnot);
+
+ virtual FX_BOOL OnSetFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag);
+ virtual FX_BOOL OnKillFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag);
+
+ virtual FX_BOOL CanCopy(CPDFSDK_Document* pDocument);
+ virtual FX_BOOL CanCut(CPDFSDK_Document* pDocument);
+ virtual FX_BOOL CanPaste(CPDFSDK_Document* pDocument);
+
+ virtual void DoCopy(CPDFSDK_Document* pDocument);
+ virtual void DoCut(CPDFSDK_Document* pDocument);
+ virtual void DoPaste(CPDFSDK_Document* pDocument);
+
+public: //CPWL_TimerHandler
+ virtual void TimerProc();
+ virtual IFX_SystemHandler* GetSystemHandler() const;
+
+public:
+ virtual CPDF_Matrix GetWindowMatrix(void* pAttachedData);
+ virtual CFX_WideString LoadPopupMenuString(int nIndex);
+
+ virtual void GetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type,
+ PDFSDK_FieldAction& fa);
+ virtual void SetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type,
+ const PDFSDK_FieldAction& fa);
+ virtual FX_BOOL IsActionDataChanged(CPDF_AAction::AActionType type, const PDFSDK_FieldAction& faOld,
+ const PDFSDK_FieldAction& faNew);
+
+ virtual void SaveState(CPDFSDK_PageView* pPageView);
+ virtual void RestoreState(CPDFSDK_PageView* pPageView);
+
+ virtual CPWL_Wnd* ResetPDFWindow(CPDFSDK_PageView* pPageView, FX_BOOL bRestoreValue);
+
+ virtual void OnKeyStroke(FX_BOOL bKeyDown);
+
+ CPDF_Matrix GetCurMatrix();
+
+ CPDF_Rect FFLtoPWL(const CPDF_Rect& rect);
+ CPDF_Rect PWLtoFFL(const CPDF_Rect& rect);
+ CPDF_Point FFLtoPWL(const CPDF_Point& point);
+ CPDF_Point PWLtoFFL(const CPDF_Point& point);
+
+ CPDF_Point WndtoPWL(CPDFSDK_PageView* pPageView, const CPDF_Point& pt);
+ CPDF_Rect FFLtoWnd(CPDFSDK_PageView* pPageView, const CPDF_Rect& rect);
+
+ void SetWindowRect(CPDFSDK_PageView* pPageView, const CPDF_Rect& rcWindow);
+ CPDF_Rect GetWindowRect(CPDFSDK_PageView* pPageView);
+
+ static void FFL_FreeData(void* pData);
+
+ FX_BOOL CommitData(CPDFSDK_PageView* pPageView, FX_UINT nFlag);
+ virtual FX_BOOL IsDataChanged(CPDFSDK_PageView* pPageView);
+ virtual void SaveData(CPDFSDK_PageView* pPageView);
+
+ virtual void GetKeyStrokeData(CPDFSDK_PageView* pPageView, FFL_KeyStrokeData& data);
+
+public:
+ CPWL_Wnd* GetPDFWindow(CPDFSDK_PageView* pPageView, FX_BOOL bNew);
+ void DestroyPDFWindow(CPDFSDK_PageView* pPageView);
+ void EscapeFiller(CPDFSDK_PageView* pPageView, FX_BOOL bDestroyPDFWindow);
+
+ virtual PWL_CREATEPARAM GetCreateParam();
+ virtual CPWL_Wnd* NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageView* pPageView) = 0;
+ virtual CPDF_Rect GetFocusBox(CPDFSDK_PageView* pPageView);
+
+public:
+ FX_BOOL IsValid() const;
+ CPDF_Rect GetPDFWindowRect() const;
+
+ CPDFSDK_PageView* GetCurPageView();
+ void SetChangeMark();
+
+ virtual void InvalidateRect(double left, double top, double right, double bottom);
+ CPDFDoc_Environment* GetApp(){return m_pApp;}
+ CPDFSDK_Annot* GetSDKAnnot() {return m_pAnnot;}
+protected:
+ CPDFDoc_Environment* m_pApp;
+ CPDFSDK_Widget* m_pWidget;
+ CPDFSDK_Annot* m_pAnnot;
+
+ FX_BOOL m_bValid;
+ CFFL_PageView2PDFWindow m_Maps;
+ CPDF_Point m_ptOldPos;
+};
+
+class CFFL_Button : public CFFL_FormFiller
+{
+public:
+ CFFL_Button(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pWidget);
+ virtual ~CFFL_Button();
+
+ virtual void OnMouseEnter(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot);
+ virtual void OnMouseExit(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot);
+ virtual FX_BOOL OnLButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
+ virtual FX_BOOL OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
+ virtual FX_BOOL OnMouseMove(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
+ virtual void OnDraw(CPDFSDK_PageView *pPageView/*, HDC hDC*/, CPDFSDK_Annot* pAnnot,
+ CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
+ /*const CRect& rcWindow,*/ FX_DWORD dwFlags);
+
+ virtual void OnDrawDeactive(CPDFSDK_PageView *pPageView, /*HDC hDC,*/ CPDFSDK_Annot* pAnnot,
+ CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
+ /*const CRect& rcWindow, */FX_DWORD dwFlags);
+protected:
+ FX_BOOL m_bMouseIn;
+ FX_BOOL m_bMouseDown;
+};
+
+//#define CFFL_IM_BOX CFX_ArrayTemplate<CBA_EditInput*>
+
+#endif
diff --git a/fpdfsdk/include/formfiller/FFL_IFormFiller.h b/fpdfsdk/include/formfiller/FFL_IFormFiller.h
index 79b4b8e6d7..393f0be331 100644
--- a/fpdfsdk/include/formfiller/FFL_IFormFiller.h
+++ b/fpdfsdk/include/formfiller/FFL_IFormFiller.h
@@ -1,144 +1,144 @@
-// 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 _FFL_IFORMFILLER_H_
-#define _FFL_IFORMFILLER_H_
-
-#include "FormFiller.h"
-class CFFL_FormFiller;
-class CFFL_PrivateData;
-
-#define CFFL_Widget2Filler CFX_MapPtrTemplate<CPDFSDK_Annot*, CFFL_FormFiller*>
-
-// #define IsALTpressed() (GetKeyState(VK_MENU) < 0)
-// #define IsCTRLpressed() (GetKeyState(VK_CONTROL) < 0)
-// #define IsSHIFTpressed() (GetKeyState(VK_SHIFT)&0x8000)
-// #define IsINSERTpressed() (GetKeyState(VK_INSERT) & 0x01)
-// #define VK_SHIFT 0x10
-// #define VK_CONTROL 0x11
-// #define VK_MENU 0x12
-// #define VK_RETURN 0x0D
-// #define VK_SPACE 0x20
-// #define VK_ESCAPE 0x1B
-
-
-
-class CFFL_IFormFiller :/* public IBA_AnnotFiller, */public IPWL_Filler_Notify//,
-// public IUndo_EventHandler, public IClipboard_Handler
-{
-public:
- CFFL_IFormFiller(CPDFDoc_Environment* pApp);
- virtual ~CFFL_IFormFiller();
-
- virtual FX_BOOL Annot_HitTest(CPDFSDK_PageView* pPageView,CPDFSDK_Annot* pAnnot, CPDF_Point point);
- virtual FX_RECT GetViewBBox(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot);
- virtual void OnDraw(CPDFSDK_PageView *pPageView, /*HDC hDC,*/ CPDFSDK_Annot* pAnnot,
- CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
- /*const CRect& rcWindow,*/ FX_DWORD dwFlags);
-
-
- virtual void OnCreate(CPDFSDK_Annot* pAnnot);
- virtual void OnLoad(CPDFSDK_Annot* pAnnot);
- virtual void OnDelete(CPDFSDK_Annot* pAnnot);
-
- virtual void OnMouseEnter(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlag);
- virtual void OnMouseExit(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlag);
-
- virtual FX_BOOL OnLButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
- virtual FX_BOOL OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
- virtual FX_BOOL OnLButtonDblClk(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
- virtual FX_BOOL OnMouseMove(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
- virtual FX_BOOL OnMouseWheel(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, short zDelta, const CPDF_Point& point);
- virtual FX_BOOL OnRButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
- virtual FX_BOOL OnRButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
- virtual FX_BOOL OnRButtonDblClk(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
-
- virtual FX_BOOL OnKeyDown(CPDFSDK_Annot* pAnnot, FX_UINT nKeyCode, FX_UINT nFlags);
- virtual FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags);
-
- virtual void OnDeSelected(CPDFSDK_Annot* pAnnot);
- virtual void OnSelected(CPDFSDK_Annot* pAnnot);
-
- virtual FX_BOOL OnSetFocus(CPDFSDK_Annot* pAnnot,FX_UINT nFlag);
- virtual FX_BOOL OnKillFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag);
-
-public:
- virtual void QueryWherePopup(void* pPrivateData, FX_FLOAT fPopupMin,FX_FLOAT fPopupMax, FX_INT32 & nRet, FX_FLOAT & fPopupRet);
- virtual void OnBeforeKeyStroke(FX_BOOL bEditOrList, void* pPrivateData, FX_INT32 nKeyCode,
- CFX_WideString & strChange, const CFX_WideString& strChangeEx,
- int nSelStart, int nSelEnd,
- FX_BOOL bKeyDown, FX_BOOL & bRC, FX_BOOL & bExit, FX_DWORD nFlag);
- virtual void OnAfterKeyStroke(FX_BOOL bEditOrList, void* pPrivateData, FX_BOOL & bExit, FX_DWORD nFlag) ;
-
- virtual void OnSetWindowRect(void* pPrivateData, const CPDF_Rect & rcWindow);
- virtual void OnKeyStroke(FX_BOOL bEditOrList, void* pPrivateData, FX_INT32 nKeyCode, CFX_WideString & strChange,
- const CFX_WideString& strChangeEx, FX_BOOL bKeyDown, FX_BOOL & bRC, FX_BOOL & bExit);
-
-public:
- virtual void BeforeUndo(CPDFSDK_Document* pDocument);
- virtual void BeforeRedo(CPDFSDK_Document* pDocument);
- virtual void AfterUndo(CPDFSDK_Document* pDocument);
- virtual void AfterRedo(CPDFSDK_Document* pDocument);
-
-public:
- virtual FX_BOOL CanCopy(CPDFSDK_Document* pDocument);
- virtual FX_BOOL CanCut(CPDFSDK_Document* pDocument);
- virtual FX_BOOL CanPaste(CPDFSDK_Document* pDocument);
-
- virtual void DoCopy(CPDFSDK_Document* pDocument);
- virtual void DoCut(CPDFSDK_Document* pDocument);
- virtual void DoPaste(CPDFSDK_Document* pDocument);
-
-public:
- CFFL_FormFiller* GetFormFiller(CPDFSDK_Annot* pAnnot, FX_BOOL bRegister);
- void RemoveFormFiller(CPDFSDK_Annot* pAnnot);
-
- static FX_BOOL IsVisible(CPDFSDK_Widget* pWidget);
- static FX_BOOL IsReadOnly(CPDFSDK_Widget* pWidget);
- static FX_BOOL IsFillingAllowed(CPDFSDK_Widget* pWidget);
- static FX_BOOL IsValidAnnot(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot);
-
- void OnKeyStrokeCommit(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPageView, FX_BOOL& bRC, FX_BOOL& bExit, FX_DWORD nFlag);
- void OnValidate(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPageView, FX_BOOL& bRC, FX_BOOL& bExit, FX_DWORD nFlag);
-
- void OnCalculate(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPageView, FX_BOOL& bExit, FX_DWORD nFlag);
- void OnFormat(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPageView, FX_BOOL& bExit, FX_DWORD nFlag);
- void OnButtonUp(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPageView, FX_BOOL& bReset, FX_BOOL& bExit,FX_UINT nFlag);
-// static LRESULT CALLBACK FFL_WndProc(
-// int code, // hook code
-// WPARAM wParam, // virtual-key code
-// LPARAM lParam // keystroke-message information
-// );
-// static MSG GetLastMessage();
- static int GetCommitKey();
- static FX_BOOL GetKeyDown();
-
-
-public:
-// static MSG g_Msg;
-// static HHOOK m_hookSheet;
-
-private:
- void UnRegisterFormFiller(CPDFSDK_Annot* pAnnot);
- void SetFocusAnnotTab(CPDFSDK_Annot* pWidget, FX_BOOL bSameField, FX_BOOL bNext);
-
-private:
- CPDFDoc_Environment* m_pApp;
- CFFL_Widget2Filler m_Maps;
- FX_BOOL m_bNotifying;
-};
-
-class CFFL_PrivateData
-{
-public:
- CPDFSDK_Widget* pWidget;
- CPDFSDK_PageView* pPageView;
- int nWidgetAge;
- int nValueAge;
-};
-
-#endif //_FFL_IFORMFILLER_H_
-
+// 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 _FFL_IFORMFILLER_H_
+#define _FFL_IFORMFILLER_H_
+
+#include "FormFiller.h"
+class CFFL_FormFiller;
+class CFFL_PrivateData;
+
+#define CFFL_Widget2Filler CFX_MapPtrTemplate<CPDFSDK_Annot*, CFFL_FormFiller*>
+
+// #define IsALTpressed() (GetKeyState(VK_MENU) < 0)
+// #define IsCTRLpressed() (GetKeyState(VK_CONTROL) < 0)
+// #define IsSHIFTpressed() (GetKeyState(VK_SHIFT)&0x8000)
+// #define IsINSERTpressed() (GetKeyState(VK_INSERT) & 0x01)
+// #define VK_SHIFT 0x10
+// #define VK_CONTROL 0x11
+// #define VK_MENU 0x12
+// #define VK_RETURN 0x0D
+// #define VK_SPACE 0x20
+// #define VK_ESCAPE 0x1B
+
+
+
+class CFFL_IFormFiller :/* public IBA_AnnotFiller, */public IPWL_Filler_Notify//,
+// public IUndo_EventHandler, public IClipboard_Handler
+{
+public:
+ CFFL_IFormFiller(CPDFDoc_Environment* pApp);
+ virtual ~CFFL_IFormFiller();
+
+ virtual FX_BOOL Annot_HitTest(CPDFSDK_PageView* pPageView,CPDFSDK_Annot* pAnnot, CPDF_Point point);
+ virtual FX_RECT GetViewBBox(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot);
+ virtual void OnDraw(CPDFSDK_PageView *pPageView, /*HDC hDC,*/ CPDFSDK_Annot* pAnnot,
+ CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
+ /*const CRect& rcWindow,*/ FX_DWORD dwFlags);
+
+
+ virtual void OnCreate(CPDFSDK_Annot* pAnnot);
+ virtual void OnLoad(CPDFSDK_Annot* pAnnot);
+ virtual void OnDelete(CPDFSDK_Annot* pAnnot);
+
+ virtual void OnMouseEnter(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlag);
+ virtual void OnMouseExit(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlag);
+
+ virtual FX_BOOL OnLButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
+ virtual FX_BOOL OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
+ virtual FX_BOOL OnLButtonDblClk(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
+ virtual FX_BOOL OnMouseMove(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
+ virtual FX_BOOL OnMouseWheel(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, short zDelta, const CPDF_Point& point);
+ virtual FX_BOOL OnRButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
+ virtual FX_BOOL OnRButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
+ virtual FX_BOOL OnRButtonDblClk(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
+
+ virtual FX_BOOL OnKeyDown(CPDFSDK_Annot* pAnnot, FX_UINT nKeyCode, FX_UINT nFlags);
+ virtual FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags);
+
+ virtual void OnDeSelected(CPDFSDK_Annot* pAnnot);
+ virtual void OnSelected(CPDFSDK_Annot* pAnnot);
+
+ virtual FX_BOOL OnSetFocus(CPDFSDK_Annot* pAnnot,FX_UINT nFlag);
+ virtual FX_BOOL OnKillFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag);
+
+public:
+ virtual void QueryWherePopup(void* pPrivateData, FX_FLOAT fPopupMin,FX_FLOAT fPopupMax, FX_INT32 & nRet, FX_FLOAT & fPopupRet);
+ virtual void OnBeforeKeyStroke(FX_BOOL bEditOrList, void* pPrivateData, FX_INT32 nKeyCode,
+ CFX_WideString & strChange, const CFX_WideString& strChangeEx,
+ int nSelStart, int nSelEnd,
+ FX_BOOL bKeyDown, FX_BOOL & bRC, FX_BOOL & bExit, FX_DWORD nFlag);
+ virtual void OnAfterKeyStroke(FX_BOOL bEditOrList, void* pPrivateData, FX_BOOL & bExit, FX_DWORD nFlag) ;
+
+ virtual void OnSetWindowRect(void* pPrivateData, const CPDF_Rect & rcWindow);
+ virtual void OnKeyStroke(FX_BOOL bEditOrList, void* pPrivateData, FX_INT32 nKeyCode, CFX_WideString & strChange,
+ const CFX_WideString& strChangeEx, FX_BOOL bKeyDown, FX_BOOL & bRC, FX_BOOL & bExit);
+
+public:
+ virtual void BeforeUndo(CPDFSDK_Document* pDocument);
+ virtual void BeforeRedo(CPDFSDK_Document* pDocument);
+ virtual void AfterUndo(CPDFSDK_Document* pDocument);
+ virtual void AfterRedo(CPDFSDK_Document* pDocument);
+
+public:
+ virtual FX_BOOL CanCopy(CPDFSDK_Document* pDocument);
+ virtual FX_BOOL CanCut(CPDFSDK_Document* pDocument);
+ virtual FX_BOOL CanPaste(CPDFSDK_Document* pDocument);
+
+ virtual void DoCopy(CPDFSDK_Document* pDocument);
+ virtual void DoCut(CPDFSDK_Document* pDocument);
+ virtual void DoPaste(CPDFSDK_Document* pDocument);
+
+public:
+ CFFL_FormFiller* GetFormFiller(CPDFSDK_Annot* pAnnot, FX_BOOL bRegister);
+ void RemoveFormFiller(CPDFSDK_Annot* pAnnot);
+
+ static FX_BOOL IsVisible(CPDFSDK_Widget* pWidget);
+ static FX_BOOL IsReadOnly(CPDFSDK_Widget* pWidget);
+ static FX_BOOL IsFillingAllowed(CPDFSDK_Widget* pWidget);
+ static FX_BOOL IsValidAnnot(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot);
+
+ void OnKeyStrokeCommit(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPageView, FX_BOOL& bRC, FX_BOOL& bExit, FX_DWORD nFlag);
+ void OnValidate(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPageView, FX_BOOL& bRC, FX_BOOL& bExit, FX_DWORD nFlag);
+
+ void OnCalculate(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPageView, FX_BOOL& bExit, FX_DWORD nFlag);
+ void OnFormat(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPageView, FX_BOOL& bExit, FX_DWORD nFlag);
+ void OnButtonUp(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPageView, FX_BOOL& bReset, FX_BOOL& bExit,FX_UINT nFlag);
+// static LRESULT CALLBACK FFL_WndProc(
+// int code, // hook code
+// WPARAM wParam, // virtual-key code
+// LPARAM lParam // keystroke-message information
+// );
+// static MSG GetLastMessage();
+ static int GetCommitKey();
+ static FX_BOOL GetKeyDown();
+
+
+public:
+// static MSG g_Msg;
+// static HHOOK m_hookSheet;
+
+private:
+ void UnRegisterFormFiller(CPDFSDK_Annot* pAnnot);
+ void SetFocusAnnotTab(CPDFSDK_Annot* pWidget, FX_BOOL bSameField, FX_BOOL bNext);
+
+private:
+ CPDFDoc_Environment* m_pApp;
+ CFFL_Widget2Filler m_Maps;
+ FX_BOOL m_bNotifying;
+};
+
+class CFFL_PrivateData
+{
+public:
+ CPDFSDK_Widget* pWidget;
+ CPDFSDK_PageView* pPageView;
+ int nWidgetAge;
+ int nValueAge;
+};
+
+#endif //_FFL_IFORMFILLER_H_
+
diff --git a/fpdfsdk/include/formfiller/FFL_ListBox.h b/fpdfsdk/include/formfiller/FFL_ListBox.h
index 899c44da2d..43f5fce40b 100644
--- a/fpdfsdk/include/formfiller/FFL_ListBox.h
+++ b/fpdfsdk/include/formfiller/FFL_ListBox.h
@@ -1,44 +1,44 @@
-// 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 _FFL_LISTBOX_H_
-#define _FFL_LISTBOX_H_
-
-class CBA_FontMap;
-class CFFL_ListBox : public CFFL_FormFiller
-{
-public:
- CFFL_ListBox(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pWidget);
- virtual ~CFFL_ListBox();
-
- virtual PWL_CREATEPARAM GetCreateParam();
- virtual CPWL_Wnd* NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageView* pPageView);
-
- virtual FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags);
-
- virtual FX_BOOL IsDataChanged(CPDFSDK_PageView* pPageView);
- virtual void SaveData(CPDFSDK_PageView* pPageView);
-
- virtual void GetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type,
- PDFSDK_FieldAction& fa);
- virtual void SetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type,
- const PDFSDK_FieldAction& fa);
-
- virtual void SaveState(CPDFSDK_PageView* pPageView);
- virtual void RestoreState(CPDFSDK_PageView* pPageView);
-
- virtual CPWL_Wnd* ResetPDFWindow(CPDFSDK_PageView* pPageView, FX_BOOL bRestoreValue);
- virtual void OnKeyStroke(FX_BOOL bKeyDown, FX_DWORD nFlag);
-
-private:
- CBA_FontMap* m_pFontMap;
- CFX_MapPtrTemplate<int, void*> m_OriginSelections;
- CFX_ArrayTemplate<int> m_State;
-};
-
-
-#endif //_FFL_LISTBOX_H_
-
+// 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 _FFL_LISTBOX_H_
+#define _FFL_LISTBOX_H_
+
+class CBA_FontMap;
+class CFFL_ListBox : public CFFL_FormFiller
+{
+public:
+ CFFL_ListBox(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pWidget);
+ virtual ~CFFL_ListBox();
+
+ virtual PWL_CREATEPARAM GetCreateParam();
+ virtual CPWL_Wnd* NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageView* pPageView);
+
+ virtual FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags);
+
+ virtual FX_BOOL IsDataChanged(CPDFSDK_PageView* pPageView);
+ virtual void SaveData(CPDFSDK_PageView* pPageView);
+
+ virtual void GetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type,
+ PDFSDK_FieldAction& fa);
+ virtual void SetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type,
+ const PDFSDK_FieldAction& fa);
+
+ virtual void SaveState(CPDFSDK_PageView* pPageView);
+ virtual void RestoreState(CPDFSDK_PageView* pPageView);
+
+ virtual CPWL_Wnd* ResetPDFWindow(CPDFSDK_PageView* pPageView, FX_BOOL bRestoreValue);
+ virtual void OnKeyStroke(FX_BOOL bKeyDown, FX_DWORD nFlag);
+
+private:
+ CBA_FontMap* m_pFontMap;
+ CFX_MapPtrTemplate<int, void*> m_OriginSelections;
+ CFX_ArrayTemplate<int> m_State;
+};
+
+
+#endif //_FFL_LISTBOX_H_
+
diff --git a/fpdfsdk/include/formfiller/FFL_Notify.h b/fpdfsdk/include/formfiller/FFL_Notify.h
index 8a0b7a3fa3..c729b7452b 100644
--- a/fpdfsdk/include/formfiller/FFL_Notify.h
+++ b/fpdfsdk/include/formfiller/FFL_Notify.h
@@ -1,54 +1,54 @@
-// 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
-
-#if !defined(_FFL_NOTIFY_H_)
-#define _FFL_NOTIFY_H_
-
-class CFFL_FormFiller;
-
-class CFFL_Notify
-{
-public:
- CFFL_Notify(CFFL_FormFiller * pFormFiller);
- virtual ~CFFL_Notify();
-
-public:
- FX_BOOL OnSetFocus(FX_BOOL & bExit);
- FX_BOOL OnMouseEnter(FX_BOOL & bExit);
- FX_BOOL OnMouseDown(FX_BOOL & bExit);
- FX_BOOL OnMouseUp(FX_BOOL & bExit);
- FX_BOOL OnMouseExit(FX_BOOL & bExit);
- FX_BOOL OnKillFocus(FX_BOOL & bExit);
-
- FX_BOOL OnCalculate();
- FX_BOOL OnFormat(int iCommitKey);
- FX_BOOL OnValidate(CPDF_FormField* pFormField, CFX_WideString& strValue, CFX_WideString & strChange,
- const CFX_WideString& strChangeEx, FX_BOOL bKeyDown, FX_BOOL bModifier,
- FX_BOOL bShift, FX_BOOL & bRC);
- FX_BOOL OnKeyStroke(CPDF_FormField* pFormField, int nCommitKey, CFX_WideString& strValue, CFX_WideString& strChange,
- const CFX_WideString& strChangeEx, FX_BOOL bKeyDown, FX_BOOL bModifier,
- FX_BOOL bShift, FX_BOOL bWillCommit, FX_BOOL bFieldFull,
- int& nSelStart, int& nSelEnd, FX_BOOL& bRC);
-
- void BeforeNotify();
- void AfterNotify();
- FX_BOOL IsNotifying() const {return m_nNotifyFlag > 0;}
-
-private:
-// CReader_InterForm * GetReaderInterForm();
- FX_BOOL DoAAction(CPDF_AAction::AActionType eAAT, FX_BOOL & bExit);
- FX_BOOL FindAAction(CPDF_AAction::AActionType eAAT,CPDF_Action & action);
- FX_BOOL FindAAction(CPDF_AAction aaction,CPDF_AAction::AActionType eAAT,CPDF_Action & action);
- FX_BOOL ExecuteActionTree(CPDF_AAction::AActionType eAAT, CPDF_Action & action, FX_BOOL& bExit);
- FX_BOOL ExecuteAction(CPDF_AAction::AActionType eAAT,CPDF_Action & action,FX_BOOL& bExit);
-
- CFFL_FormFiller * m_pFormFiller;
- FX_BOOL m_bDoActioning;
- FX_INT32 m_nNotifyFlag;
-};
-
-#endif
-
+// 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
+
+#if !defined(_FFL_NOTIFY_H_)
+#define _FFL_NOTIFY_H_
+
+class CFFL_FormFiller;
+
+class CFFL_Notify
+{
+public:
+ CFFL_Notify(CFFL_FormFiller * pFormFiller);
+ virtual ~CFFL_Notify();
+
+public:
+ FX_BOOL OnSetFocus(FX_BOOL & bExit);
+ FX_BOOL OnMouseEnter(FX_BOOL & bExit);
+ FX_BOOL OnMouseDown(FX_BOOL & bExit);
+ FX_BOOL OnMouseUp(FX_BOOL & bExit);
+ FX_BOOL OnMouseExit(FX_BOOL & bExit);
+ FX_BOOL OnKillFocus(FX_BOOL & bExit);
+
+ FX_BOOL OnCalculate();
+ FX_BOOL OnFormat(int iCommitKey);
+ FX_BOOL OnValidate(CPDF_FormField* pFormField, CFX_WideString& strValue, CFX_WideString & strChange,
+ const CFX_WideString& strChangeEx, FX_BOOL bKeyDown, FX_BOOL bModifier,
+ FX_BOOL bShift, FX_BOOL & bRC);
+ FX_BOOL OnKeyStroke(CPDF_FormField* pFormField, int nCommitKey, CFX_WideString& strValue, CFX_WideString& strChange,
+ const CFX_WideString& strChangeEx, FX_BOOL bKeyDown, FX_BOOL bModifier,
+ FX_BOOL bShift, FX_BOOL bWillCommit, FX_BOOL bFieldFull,
+ int& nSelStart, int& nSelEnd, FX_BOOL& bRC);
+
+ void BeforeNotify();
+ void AfterNotify();
+ FX_BOOL IsNotifying() const {return m_nNotifyFlag > 0;}
+
+private:
+// CReader_InterForm * GetReaderInterForm();
+ FX_BOOL DoAAction(CPDF_AAction::AActionType eAAT, FX_BOOL & bExit);
+ FX_BOOL FindAAction(CPDF_AAction::AActionType eAAT,CPDF_Action & action);
+ FX_BOOL FindAAction(CPDF_AAction aaction,CPDF_AAction::AActionType eAAT,CPDF_Action & action);
+ FX_BOOL ExecuteActionTree(CPDF_AAction::AActionType eAAT, CPDF_Action & action, FX_BOOL& bExit);
+ FX_BOOL ExecuteAction(CPDF_AAction::AActionType eAAT,CPDF_Action & action,FX_BOOL& bExit);
+
+ CFFL_FormFiller * m_pFormFiller;
+ FX_BOOL m_bDoActioning;
+ FX_INT32 m_nNotifyFlag;
+};
+
+#endif
+
diff --git a/fpdfsdk/include/formfiller/FFL_PushButton.h b/fpdfsdk/include/formfiller/FFL_PushButton.h
index 4dcff145ae..be5e735dcb 100644
--- a/fpdfsdk/include/formfiller/FFL_PushButton.h
+++ b/fpdfsdk/include/formfiller/FFL_PushButton.h
@@ -1,25 +1,25 @@
-// 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 _FFL_PUSHBUTTON_H_
-#define _FFL_PUSHBUTTON_H_
-
-class CFFL_PushButton : public CFFL_Button
-{
-public:
- CFFL_PushButton(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pAnnot);
- virtual ~CFFL_PushButton();
-
- virtual CPWL_Wnd* NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageView* pPageView);
-
- virtual FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags);
- virtual void OnDraw(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot,
- CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
- FX_DWORD dwFlags);
-};
-
-#endif //_FFL_PUSHBUTTON_H_
-
+// 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 _FFL_PUSHBUTTON_H_
+#define _FFL_PUSHBUTTON_H_
+
+class CFFL_PushButton : public CFFL_Button
+{
+public:
+ CFFL_PushButton(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pAnnot);
+ virtual ~CFFL_PushButton();
+
+ virtual CPWL_Wnd* NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageView* pPageView);
+
+ virtual FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags);
+ virtual void OnDraw(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot,
+ CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
+ FX_DWORD dwFlags);
+};
+
+#endif //_FFL_PUSHBUTTON_H_
+
diff --git a/fpdfsdk/include/formfiller/FFL_RadioButton.h b/fpdfsdk/include/formfiller/FFL_RadioButton.h
index bab8584db9..037e56344d 100644
--- a/fpdfsdk/include/formfiller/FFL_RadioButton.h
+++ b/fpdfsdk/include/formfiller/FFL_RadioButton.h
@@ -1,25 +1,25 @@
-// 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 _FFL_RADIOBUTTON_H_
-#define _FFL_RADIOBUTTON_H_
-
-class CFFL_RadioButton : public CFFL_Button
-{
-public:
- CFFL_RadioButton(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pAnnot);
- virtual ~CFFL_RadioButton();
-
- virtual CPWL_Wnd* NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageView* pPageView);
- virtual FX_BOOL OnKeyDown(CPDFSDK_Annot* pAnnot, FX_UINT nKeyCode, FX_UINT nFlags);
- virtual FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags);
- virtual FX_BOOL OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
- virtual FX_BOOL IsDataChanged(CPDFSDK_PageView* pPageView);
- virtual void SaveData(CPDFSDK_PageView* pPageView);
-};
-
-#endif //_FFL_RADIOBUTTON_H_
-
+// 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 _FFL_RADIOBUTTON_H_
+#define _FFL_RADIOBUTTON_H_
+
+class CFFL_RadioButton : public CFFL_Button
+{
+public:
+ CFFL_RadioButton(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pAnnot);
+ virtual ~CFFL_RadioButton();
+
+ virtual CPWL_Wnd* NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageView* pPageView);
+ virtual FX_BOOL OnKeyDown(CPDFSDK_Annot* pAnnot, FX_UINT nKeyCode, FX_UINT nFlags);
+ virtual FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags);
+ virtual FX_BOOL OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
+ virtual FX_BOOL IsDataChanged(CPDFSDK_PageView* pPageView);
+ virtual void SaveData(CPDFSDK_PageView* pPageView);
+};
+
+#endif //_FFL_RADIOBUTTON_H_
+
diff --git a/fpdfsdk/include/formfiller/FFL_TextField.h b/fpdfsdk/include/formfiller/FFL_TextField.h
index 2b6f069af2..d2808e99c7 100644
--- a/fpdfsdk/include/formfiller/FFL_TextField.h
+++ b/fpdfsdk/include/formfiller/FFL_TextField.h
@@ -1,89 +1,89 @@
-// 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
-
-#if !defined(AFX_FFL_EDIT_H__8E0C9456_CBA2_4EFB_9F31_53C6D8C1A8AC__INCLUDED_)
-#define AFX_FFL_EDIT_H__8E0C9456_CBA2_4EFB_9F31_53C6D8C1A8AC__INCLUDED_
-
-#include "FFL_FormFiller.h"
-
-#define BF_ALIGN_LEFT 0
-#define BF_ALIGN_MIDDLE 1
-#define BF_ALIGN_RIGHT 2
-
-class CBA_FontMap;
-
-class CFFL_EditUndoItem //: public IUndoItem
-{
-public:
- CFFL_EditUndoItem(CPWL_Edit* pEdit);
- virtual ~CFFL_EditUndoItem();
-
- virtual void Undo();
- virtual void Redo();
- virtual CFX_WideString GetDescr();
- virtual void Release();
-
-private:
- CPWL_Edit* m_pEdit;
-};
-
-struct FFL_TextFieldState
-{
- int nStart;
- int nEnd;
- CFX_WideString sValue;
-};
-
-class CFFL_TextField : public CFFL_FormFiller, public IPWL_FocusHandler, public IPWL_Edit_Notify
-{
-public:
- CFFL_TextField(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pAnnot);
- virtual ~CFFL_TextField();
-
- virtual PWL_CREATEPARAM GetCreateParam();
- virtual CPWL_Wnd* NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageView* pPageView);
-
-
- virtual FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags);
-
- virtual FX_BOOL IsDataChanged(CPDFSDK_PageView* pPageView);
- virtual void SaveData(CPDFSDK_PageView* pPageView);
-
- virtual void GetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type,
- PDFSDK_FieldAction& fa);
- virtual void SetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type,
- const PDFSDK_FieldAction& fa);
- virtual FX_BOOL IsActionDataChanged(CPDF_AAction::AActionType type, const PDFSDK_FieldAction& faOld,
- const PDFSDK_FieldAction& faNew);
- virtual void SaveState(CPDFSDK_PageView* pPageView);
- virtual void RestoreState(CPDFSDK_PageView* pPageView);
-
- virtual CPWL_Wnd* ResetPDFWindow(CPDFSDK_PageView* pPageView, FX_BOOL bRestoreValue);
-
-public:
- virtual void OnSetFocus(CPWL_Wnd* pWnd);
- virtual void OnKillFocus(CPWL_Wnd* pWnd);
-
-public:
- virtual void OnAddUndo(CPWL_Edit* pEdit);
-
-public:
- virtual FX_BOOL CanCopy(CPDFSDK_Document* pDocument);
- virtual FX_BOOL CanCut(CPDFSDK_Document* pDocument);
- virtual FX_BOOL CanPaste(CPDFSDK_Document* pDocument);
-
- virtual void DoCopy(CPDFSDK_Document* pDocument);
- virtual void DoCut(CPDFSDK_Document* pDocument);
- virtual void DoPaste(CPDFSDK_Document* pDocument);
-
-private:
- CBA_FontMap* m_pFontMap;
-// CBA_SpellCheck* m_pSpellCheck;
- FFL_TextFieldState m_State;
-// CFFL_IM_BOX m_IMBox;
-};
-
-#endif // !defined(AFX_FFL_EDIT_H__8E0C9456_CBA2_4EFB_9F31_53C6D8C1A8AC__INCLUDED_)
+// 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
+
+#if !defined(AFX_FFL_EDIT_H__8E0C9456_CBA2_4EFB_9F31_53C6D8C1A8AC__INCLUDED_)
+#define AFX_FFL_EDIT_H__8E0C9456_CBA2_4EFB_9F31_53C6D8C1A8AC__INCLUDED_
+
+#include "FFL_FormFiller.h"
+
+#define BF_ALIGN_LEFT 0
+#define BF_ALIGN_MIDDLE 1
+#define BF_ALIGN_RIGHT 2
+
+class CBA_FontMap;
+
+class CFFL_EditUndoItem //: public IUndoItem
+{
+public:
+ CFFL_EditUndoItem(CPWL_Edit* pEdit);
+ virtual ~CFFL_EditUndoItem();
+
+ virtual void Undo();
+ virtual void Redo();
+ virtual CFX_WideString GetDescr();
+ virtual void Release();
+
+private:
+ CPWL_Edit* m_pEdit;
+};
+
+struct FFL_TextFieldState
+{
+ int nStart;
+ int nEnd;
+ CFX_WideString sValue;
+};
+
+class CFFL_TextField : public CFFL_FormFiller, public IPWL_FocusHandler, public IPWL_Edit_Notify
+{
+public:
+ CFFL_TextField(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pAnnot);
+ virtual ~CFFL_TextField();
+
+ virtual PWL_CREATEPARAM GetCreateParam();
+ virtual CPWL_Wnd* NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageView* pPageView);
+
+
+ virtual FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags);
+
+ virtual FX_BOOL IsDataChanged(CPDFSDK_PageView* pPageView);
+ virtual void SaveData(CPDFSDK_PageView* pPageView);
+
+ virtual void GetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type,
+ PDFSDK_FieldAction& fa);
+ virtual void SetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type,
+ const PDFSDK_FieldAction& fa);
+ virtual FX_BOOL IsActionDataChanged(CPDF_AAction::AActionType type, const PDFSDK_FieldAction& faOld,
+ const PDFSDK_FieldAction& faNew);
+ virtual void SaveState(CPDFSDK_PageView* pPageView);
+ virtual void RestoreState(CPDFSDK_PageView* pPageView);
+
+ virtual CPWL_Wnd* ResetPDFWindow(CPDFSDK_PageView* pPageView, FX_BOOL bRestoreValue);
+
+public:
+ virtual void OnSetFocus(CPWL_Wnd* pWnd);
+ virtual void OnKillFocus(CPWL_Wnd* pWnd);
+
+public:
+ virtual void OnAddUndo(CPWL_Edit* pEdit);
+
+public:
+ virtual FX_BOOL CanCopy(CPDFSDK_Document* pDocument);
+ virtual FX_BOOL CanCut(CPDFSDK_Document* pDocument);
+ virtual FX_BOOL CanPaste(CPDFSDK_Document* pDocument);
+
+ virtual void DoCopy(CPDFSDK_Document* pDocument);
+ virtual void DoCut(CPDFSDK_Document* pDocument);
+ virtual void DoPaste(CPDFSDK_Document* pDocument);
+
+private:
+ CBA_FontMap* m_pFontMap;
+// CBA_SpellCheck* m_pSpellCheck;
+ FFL_TextFieldState m_State;
+// CFFL_IM_BOX m_IMBox;
+};
+
+#endif // !defined(AFX_FFL_EDIT_H__8E0C9456_CBA2_4EFB_9F31_53C6D8C1A8AC__INCLUDED_)
diff --git a/fpdfsdk/include/formfiller/FFL_Utils.h b/fpdfsdk/include/formfiller/FFL_Utils.h
index 07f2bee761..2fdc7b171c 100644
--- a/fpdfsdk/include/formfiller/FFL_Utils.h
+++ b/fpdfsdk/include/formfiller/FFL_Utils.h
@@ -1,20 +1,20 @@
-// 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
-
-#define FFL_BASE_USERUNIT 1.0f / 72.0f
-
-template<class T> T FFL_MIN (const T & i, const T & j) { return ((i < j) ? i : j); }
-template<class T> T FFL_MAX (const T & i, const T & j) { return ((i > j) ? i : j); }
-
-class CFFL_Utils
-{
-public:
- static CPDF_Rect MaxRect(const CPDF_Rect & rect1,const CPDF_Rect & rect2);
- static CPDF_Rect InflateRect(const CPDF_Rect & crRect, const FX_FLOAT & fSize);
- static CPDF_Rect DeflateRect(const CPDF_Rect & crRect, const FX_FLOAT & fSize);
- static FX_BOOL TraceObject(CPDF_Object* pObj);
-};
-
+// 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
+
+#define FFL_BASE_USERUNIT 1.0f / 72.0f
+
+template<class T> T FFL_MIN (const T & i, const T & j) { return ((i < j) ? i : j); }
+template<class T> T FFL_MAX (const T & i, const T & j) { return ((i > j) ? i : j); }
+
+class CFFL_Utils
+{
+public:
+ static CPDF_Rect MaxRect(const CPDF_Rect & rect1,const CPDF_Rect & rect2);
+ static CPDF_Rect InflateRect(const CPDF_Rect & crRect, const FX_FLOAT & fSize);
+ static CPDF_Rect DeflateRect(const CPDF_Rect & crRect, const FX_FLOAT & fSize);
+ static FX_BOOL TraceObject(CPDF_Object* pObj);
+};
+
diff --git a/fpdfsdk/include/formfiller/FormFiller.h b/fpdfsdk/include/formfiller/FormFiller.h
index e7a22a0101..8e45d5eddb 100644
--- a/fpdfsdk/include/formfiller/FormFiller.h
+++ b/fpdfsdk/include/formfiller/FormFiller.h
@@ -1,30 +1,30 @@
-// 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 _FORMFILLER_H_
-#define _FORMFILLER_H_
-
-
-
-#ifndef _INC_PDFAPI
- #define _INC_PDFAPI
-
- #include "../../../core/include/fpdfapi/fpdf_module.h"
- #include "../../../core/include/fpdfdoc/fpdf_doc.h"
- #include "../../../core/include/fpdfdoc/fpdf_vt.h"
- #include "../../../core/include/fxcrt/fx_xml.h"
-
-#endif
-
-#include "../fsdk_mgr.h"
-
-#include "../fxedit/fx_edit.h"
-#include "../pdfwindow/IPDFWindow.h"
-
-
-
-#endif //_FORMFILLER_H_
-
+// 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 _FORMFILLER_H_
+#define _FORMFILLER_H_
+
+
+
+#ifndef _INC_PDFAPI
+ #define _INC_PDFAPI
+
+ #include "../../../core/include/fpdfapi/fpdf_module.h"
+ #include "../../../core/include/fpdfdoc/fpdf_doc.h"
+ #include "../../../core/include/fpdfdoc/fpdf_vt.h"
+ #include "../../../core/include/fxcrt/fx_xml.h"
+
+#endif
+
+#include "../fsdk_mgr.h"
+
+#include "../fxedit/fx_edit.h"
+#include "../pdfwindow/IPDFWindow.h"
+
+
+
+#endif //_FORMFILLER_H_
+
diff --git a/fpdfsdk/include/fpdf_dataavail.h b/fpdfsdk/include/fpdf_dataavail.h
index 9d373fc959..971ab2505c 100644
--- a/fpdfsdk/include/fpdf_dataavail.h
+++ b/fpdfsdk/include/fpdf_dataavail.h
@@ -1,222 +1,222 @@
-// 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 _FPDF_DATAAVAIL_H_
-#define _FPDF_DATAAVAIL_H_
-
-#ifndef _FPDFVIEW_H_
-#include "fpdfview.h"
-#endif
-
-
-/** The result of the process which check linearized PDF. */
-#define FSDK_IS_LINEARIZED 1
-#define FSDK_NOT_LINEARIZED 0
-#define FSDK_UNKNOW_LINEARIZED -1
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * Interface: FX_FILEAVAIL
- * Interface for checking whether the section of the file is available.
- */
-typedef struct _FX_FILEAVAIL {
- /**
- * Version number of the interface. Currently must be 1.
- */
- int version;
-
- /**
- * Method: IsDataAvail
- * Report whether the specified data section is available. A section is available only if all bytes in the section is available.
- * Interface Version:
- * 1
- * Implementation Required:
- * Yes
- * Parameters:
- * pThis - Pointer to the interface structure itself.
- * offset - The offset of the data section in the file.
- * size - The size of the data section
- * Return Value:
- * true means the specified data section is available.
- * Comments:
- * Called by Foxit SDK to check whether the data section is ready.
- */
- bool (*IsDataAvail)(struct _FX_FILEAVAIL* pThis, size_t offset, size_t size);
-} FX_FILEAVAIL;
-
-typedef void* FPDF_AVAIL;
-
-/**
-* Function: FPDFAvail_Create
-* Create a document availability provider.
-*
-* Parameters:
-* file_avail - Pointer to file availability interface to check availability of file data.
-* file - Pointer to a file access interface for reading data from file.
-* Return value:
-* A handle to the document availability provider. NULL for error.
-* Comments:
-* Application must call FPDFAvail_Destroy when done with the availability provider.
-*/
-DLLEXPORT FPDF_AVAIL STDCALL FPDFAvail_Create(FX_FILEAVAIL* file_avail, FPDF_FILEACCESS* file);
-
-/**
-* Function: FPDFAvail_Destroy
-* Destroy a document availibity provider.
-*
-* Parameters:
-* avail - Handle to document availability provider returned by FPDFAvail_Create
-* Return Value:
-* None.
-*/
-DLLEXPORT void STDCALL FPDFAvail_Destroy(FPDF_AVAIL avail);
-
-/**
- * Interface: FX_DOWNLOADHINTS
- * Download hints interface. Used to receive hints for further downloading.
- */
-typedef struct _FX_DOWNLOADHINTS {
- /**
- * Version number of the interface. Currently must be 1.
- */
- int version;
-
- /**
- * Method: AddSegment
- * Add a section to be downloaded.
- * Interface Version:
- * 1
- * Implementation Required:
- * Yes
- * Parameters:
- * pThis - Pointer to the interface structure itself.
- * offset - The offset of the hint reported to be downloaded.
- * size - The size of the hint reported to be downloaded.
- * Return Value:
- * None.
- * Comments:
- * Called by Foxit SDK to report some downloading hints for download manager.
- * The position and size of section may be not accurate, part of the section might be already available.
- * The download manager must deal with that to maximize download efficiency.
- */
- void (*AddSegment)(struct _FX_DOWNLOADHINTS* pThis, size_t offset, size_t size);
-} FX_DOWNLOADHINTS;
-
-/**
-* Function: FPDFAvail_IsDocAvail
-* Check whether the document is ready for loading, if not, get download hints.
-*
-* Parameters:
-* avail - Handle to document availability provider returned by FPDFAvail_Create
-* hints - Pointer to a download hints interface, receiving generated hints
-* Return value:
-* Non-zero for page is fully available, 0 for page not yet available.
-* Comments:
-* The application should call this function whenever new data arrived, and process all the
-* generated download hints if any, until the function returns non-zero value. Then the
-* application can call FPDFAvail_GetDocument() to get a document handle.
-*/
-DLLEXPORT int STDCALL FPDFAvail_IsDocAvail(FPDF_AVAIL avail, FX_DOWNLOADHINTS* hints);
-
-/**
-* Function: FPDFAvail_GetDocument
-* Get document from the availability provider.
-*
-* Parameters:
-* avail - Handle to document availability provider returned by FPDFAvail_Create
-* password - Optional password for decrypting the PDF file.
-* Return value:
-* Handle to the document.
-* Comments:
-* After FPDFAvail_IsDocAvail() returns TRUE, the application should call this function to
-* get the document handle. To close the document, use FPDF_CloseDocument function.
-*/
-DLLEXPORT FPDF_DOCUMENT STDCALL FPDFAvail_GetDocument(FPDF_AVAIL avail,
- FPDF_BYTESTRING password);
-
-/**
-* Function: FPDFAvail_GetFirstPageNum
-* Get page number for the first available page in a linearized PDF
-*
-* Parameters:
-* doc - A document handle returned by FPDFAvail_GetDocument
-* Return Value:
-* Zero-based index for the first available page.
-* Comments:
-* For most linearized PDFs, the first available page would be just the first page, however,
-* some PDFs might make other page to be the first available page.
-* For non-linearized PDF, this function will always return zero.
-*/
-DLLEXPORT int STDCALL FPDFAvail_GetFirstPageNum(FPDF_DOCUMENT doc);
-
-/**
-* Function: FPDFAvail_IsPageAvail
-* Check whether a page is ready for loading, if not, get download hints.
-*
-* Parameters:
-* avail - Handle to document availability provider returned by FPDFAvail_Create
-* page_index - Index number of the page. 0 for the first page.
-* hints - Pointer to a download hints interface, receiving generated hints
-* Return value:
-* Non-zero for page is fully available, 0 for page not yet available.
-* Comments:
-* This function call be called only after FPDFAvail_GetDocument if called.
-* The application should call this function whenever new data arrived, and process all the
-* generated download hints if any, until the function returns non-zero value. Then the
-* application can perform page loading.
-*/
-DLLEXPORT int STDCALL FPDFAvail_IsPageAvail(FPDF_AVAIL avail, int page_index, FX_DOWNLOADHINTS* hints);
-
-/**
-* Function: FPDFAvail_ISFormAvail
-* Check whether Form data is ready for init, if not, get download hints.
-*
-* Parameters:
-* avail - Handle to document availability provider returned by FPDFAvail_Create
-* hints - Pointer to a download hints interface, receiving generated hints
-* Return value:
-* Non-zero for Form data is fully available, 0 for Form data not yet available.
-* Details: -1 - error, the input parameter not correct, such as hints is null.
-* 0 - data not available
-* 1 - data available
-* 2 - no form data.
-* Comments:
-* This function call be called only after FPDFAvail_GetDocument if called.
-* The application should call this function whenever new data arrived, and process all the
-* generated download hints if any, until the function returns non-zero value. Then the
-* application can perform page loading. Recommend to call FPDFDOC_InitFormFillEnviroument
-* after the function returns non-zero value.
-*/
-DLLEXPORT int STDCALL FPDFAvail_IsFormAvail(FPDF_AVAIL avail, FX_DOWNLOADHINTS* hints);
-
-/**
-* Function: FPDFAvail_IsLinearized
-* To check whether a document is Linearized PDF file.
-*
-* Parameters:
-* avail - Handle to document availability provider returned by FPDFAvail_Create
-* Return value:
-* return TRUE means the document is linearized PDF else not.
-* FSDK_IS_LINEARIZED is a linearize file.
-* FSDK_NOT_LINEARIZED is not a linearize file.
-* FSDK_UNKNOW_LINEARIZED don't know whether the file is a linearize file.
-* Comments:
-* It return TRUE/FALSE as soon as we have first 1K data. If the file's size less than
-* 1K,we don't known whether the PDF is a linearized file.
-*
-*/
-DLLEXPORT FPDF_BOOL STDCALL FPDFAvail_IsLinearized(FPDF_AVAIL avail);
-
-#ifdef __cplusplus
-};
-#endif
-
-#endif
-
+// 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 _FPDF_DATAAVAIL_H_
+#define _FPDF_DATAAVAIL_H_
+
+#ifndef _FPDFVIEW_H_
+#include "fpdfview.h"
+#endif
+
+
+/** The result of the process which check linearized PDF. */
+#define FSDK_IS_LINEARIZED 1
+#define FSDK_NOT_LINEARIZED 0
+#define FSDK_UNKNOW_LINEARIZED -1
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Interface: FX_FILEAVAIL
+ * Interface for checking whether the section of the file is available.
+ */
+typedef struct _FX_FILEAVAIL {
+ /**
+ * Version number of the interface. Currently must be 1.
+ */
+ int version;
+
+ /**
+ * Method: IsDataAvail
+ * Report whether the specified data section is available. A section is available only if all bytes in the section is available.
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * Yes
+ * Parameters:
+ * pThis - Pointer to the interface structure itself.
+ * offset - The offset of the data section in the file.
+ * size - The size of the data section
+ * Return Value:
+ * true means the specified data section is available.
+ * Comments:
+ * Called by Foxit SDK to check whether the data section is ready.
+ */
+ bool (*IsDataAvail)(struct _FX_FILEAVAIL* pThis, size_t offset, size_t size);
+} FX_FILEAVAIL;
+
+typedef void* FPDF_AVAIL;
+
+/**
+* Function: FPDFAvail_Create
+* Create a document availability provider.
+*
+* Parameters:
+* file_avail - Pointer to file availability interface to check availability of file data.
+* file - Pointer to a file access interface for reading data from file.
+* Return value:
+* A handle to the document availability provider. NULL for error.
+* Comments:
+* Application must call FPDFAvail_Destroy when done with the availability provider.
+*/
+DLLEXPORT FPDF_AVAIL STDCALL FPDFAvail_Create(FX_FILEAVAIL* file_avail, FPDF_FILEACCESS* file);
+
+/**
+* Function: FPDFAvail_Destroy
+* Destroy a document availibity provider.
+*
+* Parameters:
+* avail - Handle to document availability provider returned by FPDFAvail_Create
+* Return Value:
+* None.
+*/
+DLLEXPORT void STDCALL FPDFAvail_Destroy(FPDF_AVAIL avail);
+
+/**
+ * Interface: FX_DOWNLOADHINTS
+ * Download hints interface. Used to receive hints for further downloading.
+ */
+typedef struct _FX_DOWNLOADHINTS {
+ /**
+ * Version number of the interface. Currently must be 1.
+ */
+ int version;
+
+ /**
+ * Method: AddSegment
+ * Add a section to be downloaded.
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * Yes
+ * Parameters:
+ * pThis - Pointer to the interface structure itself.
+ * offset - The offset of the hint reported to be downloaded.
+ * size - The size of the hint reported to be downloaded.
+ * Return Value:
+ * None.
+ * Comments:
+ * Called by Foxit SDK to report some downloading hints for download manager.
+ * The position and size of section may be not accurate, part of the section might be already available.
+ * The download manager must deal with that to maximize download efficiency.
+ */
+ void (*AddSegment)(struct _FX_DOWNLOADHINTS* pThis, size_t offset, size_t size);
+} FX_DOWNLOADHINTS;
+
+/**
+* Function: FPDFAvail_IsDocAvail
+* Check whether the document is ready for loading, if not, get download hints.
+*
+* Parameters:
+* avail - Handle to document availability provider returned by FPDFAvail_Create
+* hints - Pointer to a download hints interface, receiving generated hints
+* Return value:
+* Non-zero for page is fully available, 0 for page not yet available.
+* Comments:
+* The application should call this function whenever new data arrived, and process all the
+* generated download hints if any, until the function returns non-zero value. Then the
+* application can call FPDFAvail_GetDocument() to get a document handle.
+*/
+DLLEXPORT int STDCALL FPDFAvail_IsDocAvail(FPDF_AVAIL avail, FX_DOWNLOADHINTS* hints);
+
+/**
+* Function: FPDFAvail_GetDocument
+* Get document from the availability provider.
+*
+* Parameters:
+* avail - Handle to document availability provider returned by FPDFAvail_Create
+* password - Optional password for decrypting the PDF file.
+* Return value:
+* Handle to the document.
+* Comments:
+* After FPDFAvail_IsDocAvail() returns TRUE, the application should call this function to
+* get the document handle. To close the document, use FPDF_CloseDocument function.
+*/
+DLLEXPORT FPDF_DOCUMENT STDCALL FPDFAvail_GetDocument(FPDF_AVAIL avail,
+ FPDF_BYTESTRING password);
+
+/**
+* Function: FPDFAvail_GetFirstPageNum
+* Get page number for the first available page in a linearized PDF
+*
+* Parameters:
+* doc - A document handle returned by FPDFAvail_GetDocument
+* Return Value:
+* Zero-based index for the first available page.
+* Comments:
+* For most linearized PDFs, the first available page would be just the first page, however,
+* some PDFs might make other page to be the first available page.
+* For non-linearized PDF, this function will always return zero.
+*/
+DLLEXPORT int STDCALL FPDFAvail_GetFirstPageNum(FPDF_DOCUMENT doc);
+
+/**
+* Function: FPDFAvail_IsPageAvail
+* Check whether a page is ready for loading, if not, get download hints.
+*
+* Parameters:
+* avail - Handle to document availability provider returned by FPDFAvail_Create
+* page_index - Index number of the page. 0 for the first page.
+* hints - Pointer to a download hints interface, receiving generated hints
+* Return value:
+* Non-zero for page is fully available, 0 for page not yet available.
+* Comments:
+* This function call be called only after FPDFAvail_GetDocument if called.
+* The application should call this function whenever new data arrived, and process all the
+* generated download hints if any, until the function returns non-zero value. Then the
+* application can perform page loading.
+*/
+DLLEXPORT int STDCALL FPDFAvail_IsPageAvail(FPDF_AVAIL avail, int page_index, FX_DOWNLOADHINTS* hints);
+
+/**
+* Function: FPDFAvail_ISFormAvail
+* Check whether Form data is ready for init, if not, get download hints.
+*
+* Parameters:
+* avail - Handle to document availability provider returned by FPDFAvail_Create
+* hints - Pointer to a download hints interface, receiving generated hints
+* Return value:
+* Non-zero for Form data is fully available, 0 for Form data not yet available.
+* Details: -1 - error, the input parameter not correct, such as hints is null.
+* 0 - data not available
+* 1 - data available
+* 2 - no form data.
+* Comments:
+* This function call be called only after FPDFAvail_GetDocument if called.
+* The application should call this function whenever new data arrived, and process all the
+* generated download hints if any, until the function returns non-zero value. Then the
+* application can perform page loading. Recommend to call FPDFDOC_InitFormFillEnviroument
+* after the function returns non-zero value.
+*/
+DLLEXPORT int STDCALL FPDFAvail_IsFormAvail(FPDF_AVAIL avail, FX_DOWNLOADHINTS* hints);
+
+/**
+* Function: FPDFAvail_IsLinearized
+* To check whether a document is Linearized PDF file.
+*
+* Parameters:
+* avail - Handle to document availability provider returned by FPDFAvail_Create
+* Return value:
+* return TRUE means the document is linearized PDF else not.
+* FSDK_IS_LINEARIZED is a linearize file.
+* FSDK_NOT_LINEARIZED is not a linearize file.
+* FSDK_UNKNOW_LINEARIZED don't know whether the file is a linearize file.
+* Comments:
+* It return TRUE/FALSE as soon as we have first 1K data. If the file's size less than
+* 1K,we don't known whether the PDF is a linearized file.
+*
+*/
+DLLEXPORT FPDF_BOOL STDCALL FPDFAvail_IsLinearized(FPDF_AVAIL avail);
+
+#ifdef __cplusplus
+};
+#endif
+
+#endif
+
diff --git a/fpdfsdk/include/fpdf_ext.h b/fpdfsdk/include/fpdf_ext.h
index a8f268a4a0..5efe0e662d 100644
--- a/fpdfsdk/include/fpdf_ext.h
+++ b/fpdfsdk/include/fpdf_ext.h
@@ -1,108 +1,108 @@
-// 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 _FPDF_EXT_H_
-#define _FPDF_EXT_H_
-
-#ifndef _FPDFVIEW_H_
-#include "fpdfview.h"
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-//flags for type of unsupport object.
-#define FPDF_UNSP_DOC_XFAFORM 1
-#define FPDF_UNSP_DOC_PORTABLECOLLECTION 2
-#define FPDF_UNSP_DOC_ATTACHMENT 3
-#define FPDF_UNSP_DOC_SECURITY 4
-#define FPDF_UNSP_DOC_SHAREDREVIEW 5
-#define FPDF_UNSP_DOC_SHAREDFORM_ACROBAT 6
-#define FPDF_UNSP_DOC_SHAREDFORM_FILESYSTEM 7
-#define FPDF_UNSP_DOC_SHAREDFORM_EMAIL 8
-#define FPDF_UNSP_ANNOT_3DANNOT 11
-#define FPDF_UNSP_ANNOT_MOVIE 12
-#define FPDF_UNSP_ANNOT_SOUND 13
-#define FPDF_UNSP_ANNOT_SCREEN_MEDIA 14
-#define FPDF_UNSP_ANNOT_SCREEN_RICHMEDIA 15
-#define FPDF_UNSP_ANNOT_ATTACHMENT 16
-#define FPDF_UNSP_ANNOT_SIG 17
-
-typedef struct _UNSUPPORT_INFO
-{
- /**
- * Version number of the interface. Currently must be 1.
- **/
- int version;
-
- /**
- * Method: FSDK_UnSupport_Handler
- * UnSupport Object process handling function.
- * Interface Version:
- * 1
- * Implementation Required:
- * Yes
- * Parameters:
- * pThis - Pointer to the interface structure itself.
- * nType - The type of unsupportObject
- * Return value:
- * None.
- * */
-
- void(*FSDK_UnSupport_Handler)(_UNSUPPORT_INFO* pThis,int nType);
-}UNSUPPORT_INFO;
-
-
-/**
- * Function: FSDK_SetUnSpObjProcessHandler
- * Setup A UnSupport Object process handler for foxit sdk.
- * Parameters:
- * unsp_info - Pointer to a UNSUPPORT_INFO structure.
- * Return Value:
- * TRUE means successful. FALSE means fails.
- **/
-
-DLLEXPORT FPDF_BOOL STDCALL FSDK_SetUnSpObjProcessHandler(UNSUPPORT_INFO* unsp_info);
-
-//flags for page mode.
-
-//Unknown value
-#define PAGEMODE_UNKONOWN -1
-
-//Neither document outline nor thumbnail images visible
-#define PAGEMODE_USENONE 0
-
-//Document outline visible
-#define PAGEMODE_USEOUTLINES 1
-
-//Thumbnial images visible
-#define PAGEMODE_USETHUMBS 2
-
-//Full-screen mode, with no menu bar, window controls, or any other window visible
-#define PAGEMODE_FULLSCREEN 3
-
-//Optional content group panel visible
-#define PAGEMODE_USEOC 4
-
-//Attachments panel visible
-#define PAGEMODE_USEATTACHMENTS 5
-
-
-/**
- * Function: FPDFDoc_GetPageMode
- * Get the document's PageMode(How the document should be displayed when opened)
- * Parameters:
- * doc - Handle to document. Returned by FPDF_LoadDocument function.
- * Return Value:
- * The flags for page mode.
- **/
-DLLEXPORT int FPDFDoc_GetPageMode(FPDF_DOCUMENT document);
-
-#ifdef __cplusplus
-};
-#endif
-#endif
+// 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 _FPDF_EXT_H_
+#define _FPDF_EXT_H_
+
+#ifndef _FPDFVIEW_H_
+#include "fpdfview.h"
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+//flags for type of unsupport object.
+#define FPDF_UNSP_DOC_XFAFORM 1
+#define FPDF_UNSP_DOC_PORTABLECOLLECTION 2
+#define FPDF_UNSP_DOC_ATTACHMENT 3
+#define FPDF_UNSP_DOC_SECURITY 4
+#define FPDF_UNSP_DOC_SHAREDREVIEW 5
+#define FPDF_UNSP_DOC_SHAREDFORM_ACROBAT 6
+#define FPDF_UNSP_DOC_SHAREDFORM_FILESYSTEM 7
+#define FPDF_UNSP_DOC_SHAREDFORM_EMAIL 8
+#define FPDF_UNSP_ANNOT_3DANNOT 11
+#define FPDF_UNSP_ANNOT_MOVIE 12
+#define FPDF_UNSP_ANNOT_SOUND 13
+#define FPDF_UNSP_ANNOT_SCREEN_MEDIA 14
+#define FPDF_UNSP_ANNOT_SCREEN_RICHMEDIA 15
+#define FPDF_UNSP_ANNOT_ATTACHMENT 16
+#define FPDF_UNSP_ANNOT_SIG 17
+
+typedef struct _UNSUPPORT_INFO
+{
+ /**
+ * Version number of the interface. Currently must be 1.
+ **/
+ int version;
+
+ /**
+ * Method: FSDK_UnSupport_Handler
+ * UnSupport Object process handling function.
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * Yes
+ * Parameters:
+ * pThis - Pointer to the interface structure itself.
+ * nType - The type of unsupportObject
+ * Return value:
+ * None.
+ * */
+
+ void(*FSDK_UnSupport_Handler)(_UNSUPPORT_INFO* pThis,int nType);
+}UNSUPPORT_INFO;
+
+
+/**
+ * Function: FSDK_SetUnSpObjProcessHandler
+ * Setup A UnSupport Object process handler for foxit sdk.
+ * Parameters:
+ * unsp_info - Pointer to a UNSUPPORT_INFO structure.
+ * Return Value:
+ * TRUE means successful. FALSE means fails.
+ **/
+
+DLLEXPORT FPDF_BOOL STDCALL FSDK_SetUnSpObjProcessHandler(UNSUPPORT_INFO* unsp_info);
+
+//flags for page mode.
+
+//Unknown value
+#define PAGEMODE_UNKONOWN -1
+
+//Neither document outline nor thumbnail images visible
+#define PAGEMODE_USENONE 0
+
+//Document outline visible
+#define PAGEMODE_USEOUTLINES 1
+
+//Thumbnial images visible
+#define PAGEMODE_USETHUMBS 2
+
+//Full-screen mode, with no menu bar, window controls, or any other window visible
+#define PAGEMODE_FULLSCREEN 3
+
+//Optional content group panel visible
+#define PAGEMODE_USEOC 4
+
+//Attachments panel visible
+#define PAGEMODE_USEATTACHMENTS 5
+
+
+/**
+ * Function: FPDFDoc_GetPageMode
+ * Get the document's PageMode(How the document should be displayed when opened)
+ * Parameters:
+ * doc - Handle to document. Returned by FPDF_LoadDocument function.
+ * Return Value:
+ * The flags for page mode.
+ **/
+DLLEXPORT int FPDFDoc_GetPageMode(FPDF_DOCUMENT document);
+
+#ifdef __cplusplus
+};
+#endif
+#endif
diff --git a/fpdfsdk/include/fpdf_flatten.h b/fpdfsdk/include/fpdf_flatten.h
index 26e324df73..2e9e5092f9 100644
--- a/fpdfsdk/include/fpdf_flatten.h
+++ b/fpdfsdk/include/fpdf_flatten.h
@@ -1,42 +1,42 @@
-// 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 _FPDF_FLATTEN_H_
-#define _FPDF_FLATTEN_H_
-
-#include "fpdfview.h"
-
-#define FLATTEN_FAIL 0 // Flatten operation failed.
-#define FLATTEN_SUCCESS 1 // Flatten operation succeed.
-#define FLATTEN_NOTINGTODO 2 // There is nothing can be flatten.
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define FLAT_NORMALDISPLAY 0
-#define FLAT_PRINT 1
- //Function: FPDFPage_Flatten
-
- // Flat a pdf page,annotations or form fields will become part of the page contents.
- //Parameters:
-
- // page - Handle to the page. Returned by FPDF_LoadPage function.
- // nFlag - the flag for the use of flatten result. Zero for normal display, 1 for print.
- //Return value:
- // The result flag of the function, See flags above ( FLATTEN_FAIL, FLATTEN_SUCCESS, FLATTEN_NOTINGTODO ).
- //
- // Comments: Current version all fails return zero. If necessary we will assign different value
- // to indicate different fail reason.
- //
- DLLEXPORT int STDCALL FPDFPage_Flatten( FPDF_PAGE page, int nFlag);
-
-
-#ifdef __cplusplus
-};
-#endif
-
-#endif //_FPDF_FLATTEN_H_
+// 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 _FPDF_FLATTEN_H_
+#define _FPDF_FLATTEN_H_
+
+#include "fpdfview.h"
+
+#define FLATTEN_FAIL 0 // Flatten operation failed.
+#define FLATTEN_SUCCESS 1 // Flatten operation succeed.
+#define FLATTEN_NOTINGTODO 2 // There is nothing can be flatten.
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define FLAT_NORMALDISPLAY 0
+#define FLAT_PRINT 1
+ //Function: FPDFPage_Flatten
+
+ // Flat a pdf page,annotations or form fields will become part of the page contents.
+ //Parameters:
+
+ // page - Handle to the page. Returned by FPDF_LoadPage function.
+ // nFlag - the flag for the use of flatten result. Zero for normal display, 1 for print.
+ //Return value:
+ // The result flag of the function, See flags above ( FLATTEN_FAIL, FLATTEN_SUCCESS, FLATTEN_NOTINGTODO ).
+ //
+ // Comments: Current version all fails return zero. If necessary we will assign different value
+ // to indicate different fail reason.
+ //
+ DLLEXPORT int STDCALL FPDFPage_Flatten( FPDF_PAGE page, int nFlag);
+
+
+#ifdef __cplusplus
+};
+#endif
+
+#endif //_FPDF_FLATTEN_H_
diff --git a/fpdfsdk/include/fpdf_fwlevent.h b/fpdfsdk/include/fpdf_fwlevent.h
index cf34c2103f..f77e7e399f 100644
--- a/fpdfsdk/include/fpdf_fwlevent.h
+++ b/fpdfsdk/include/fpdf_fwlevent.h
@@ -1,286 +1,286 @@
-// 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 _FWL_EVENT_H
-#define _FWL_EVENT_H
-
-#include "fpdfview.h"
-
-typedef int FPDF_INT32;
-typedef unsigned int FPDF_UINT32;
-typedef float FPDF_FLOAT;
-//event type
-typedef enum
-{
- FWL_EVENTTYPE_Mouse = 0 ,
- FWL_EVENTTYPE_MouseWheel,
- FWL_EVENTTYPE_Key ,
-} FWL_EVENTTYPE;
-
-//key flag
-typedef enum
-{
- FWL_EVENTFLAG_ShiftKey = 1 << 0,
- FWL_EVENTFLAG_ControlKey = 1 << 1,
- FWL_EVENTFLAG_AltKey = 1 << 2,
- FWL_EVENTFLAG_MetaKey = 1 << 3,
- FWL_EVENTFLAG_KeyPad = 1 << 4,
- FWL_EVENTFLAG_AutoRepeat = 1 << 5,
- FWL_EVENTFLAG_LeftButtonDown = 1 << 6,
- FWL_EVENTFLAG_MiddleButtonDown = 1 << 7,
- FWL_EVENTFLAG_RightButtonDown = 1 << 8,
-} FWL_EVENTFLAG;
-
-// Mouse message command
-typedef enum
-{
- FWL_EVENTMOUSECMD_LButtonDown = 1 ,
- FWL_EVENTMOUSECMD_LButtonUp ,
- FWL_EVENTMOUSECMD_LButtonDblClk ,
- FWL_EVENTMOUSECMD_RButtonDown ,
- FWL_EVENTMOUSECMD_RButtonUp ,
- FWL_EVENTMOUSECMD_RButtonDblClk ,
- FWL_EVENTMOUSECMD_MButtonDown ,
- FWL_EVENTMOUSECMD_MButtonUp ,
- FWL_EVENTMOUSECMD_MButtonDblClk ,
- FWL_EVENTMOUSECMD_MouseMove ,
- FWL_EVENTMOUSECMD_MouseEnter ,
- FWL_EVENTMOUSECMD_MouseHover ,
- FWL_EVENTMOUSECMD_MouseLeave ,
-} FWL_EVENT_MOUSECMD;
-
-//mouse event
-struct FWL_EVENT_MOUSE
-{
- FPDF_UINT32 command;
- FPDF_DWORD flag;
- FPDF_FLOAT x;
- FPDF_FLOAT y;
-};
-
-//mouse wheel
-struct FWL_EVENT_MOUSEWHEEL
-{
- FPDF_DWORD flag;
- FPDF_FLOAT x;
- FPDF_FLOAT y;
- FPDF_FLOAT deltaX;
- FPDF_FLOAT deltaY;
-};
-
-//virtual keycode
-typedef enum
-{
- FWL_VKEY_Back = 0x08,
- FWL_VKEY_Tab = 0x09,
- FWL_VKEY_Clear = 0x0C,
- FWL_VKEY_Return = 0x0D,
- FWL_VKEY_Shift = 0x10,
- FWL_VKEY_Control = 0x11,
- FWL_VKEY_Menu = 0x12,
- FWL_VKEY_Pause = 0x13,
- FWL_VKEY_Capital = 0x14,
- FWL_VKEY_Kana = 0x15,
- FWL_VKEY_Hangul = 0x15,
- FWL_VKEY_Junja = 0x17,
- FWL_VKEY_Final = 0x18,
- FWL_VKEY_Hanja = 0x19,
- FWL_VKEY_Kanji = 0x19,
- FWL_VKEY_Escape = 0x1B,
- FWL_VKEY_Convert = 0x1C,
- FWL_VKEY_NonConvert = 0x1D,
- FWL_VKEY_Accept = 0x1E,
- FWL_VKEY_ModeChange = 0x1F,
- FWL_VKEY_Space = 0x20,
- FWL_VKEY_Prior = 0x21,
- FWL_VKEY_Next = 0x22,
- FWL_VKEY_End = 0x23,
- FWL_VKEY_Home = 0x24,
- FWL_VKEY_Left = 0x25,
- FWL_VKEY_Up = 0x26,
- FWL_VKEY_Right = 0x27,
- FWL_VKEY_Down = 0x28,
- FWL_VKEY_Select = 0x29,
- FWL_VKEY_Print = 0x2A,
- FWL_VKEY_Execute = 0x2B,
- FWL_VKEY_Snapshot = 0x2C,
- FWL_VKEY_Insert = 0x2D,
- FWL_VKEY_Delete = 0x2E,
- FWL_VKEY_Help = 0x2F,
- FWL_VKEY_0 = 0x30,
- FWL_VKEY_1 = 0x31,
- FWL_VKEY_2 = 0x32,
- FWL_VKEY_3 = 0x33,
- FWL_VKEY_4 = 0x34,
- FWL_VKEY_5 = 0x35,
- FWL_VKEY_6 = 0x36,
- FWL_VKEY_7 = 0x37,
- FWL_VKEY_8 = 0x38,
- FWL_VKEY_9 = 0x39,
- FWL_VKEY_A = 0x41,
- FWL_VKEY_B = 0x42,
- FWL_VKEY_C = 0x43,
- FWL_VKEY_D = 0x44,
- FWL_VKEY_E = 0x45,
- FWL_VKEY_F = 0x46,
- FWL_VKEY_G = 0x47,
- FWL_VKEY_H = 0x48,
- FWL_VKEY_I = 0x49,
- FWL_VKEY_J = 0x4A,
- FWL_VKEY_K = 0x4B,
- FWL_VKEY_L = 0x4C,
- FWL_VKEY_M = 0x4D,
- FWL_VKEY_N = 0x4E,
- FWL_VKEY_O = 0x4F,
- FWL_VKEY_P = 0x50,
- FWL_VKEY_Q = 0x51,
- FWL_VKEY_R = 0x52,
- FWL_VKEY_S = 0x53,
- FWL_VKEY_T = 0x54,
- FWL_VKEY_U = 0x55,
- FWL_VKEY_V = 0x56,
- FWL_VKEY_W = 0x57,
- FWL_VKEY_X = 0x58,
- FWL_VKEY_Y = 0x59,
- FWL_VKEY_Z = 0x5A,
- FWL_VKEY_LWin = 0x5B,
- FWL_VKEY_Command = 0x5B,
- FWL_VKEY_RWin = 0x5C,
- FWL_VKEY_Apps = 0x5D,
- FWL_VKEY_Sleep = 0x5F,
- FWL_VKEY_NumPad0 = 0x60,
- FWL_VKEY_NumPad1 = 0x61,
- FWL_VKEY_NumPad2 = 0x62,
- FWL_VKEY_NumPad3 = 0x63,
- FWL_VKEY_NumPad4 = 0x64,
- FWL_VKEY_NumPad5 = 0x65,
- FWL_VKEY_NumPad6 = 0x66,
- FWL_VKEY_NumPad7 = 0x67,
- FWL_VKEY_NumPad8 = 0x68,
- FWL_VKEY_NumPad9 = 0x69,
- FWL_VKEY_Multiply = 0x6A,
- FWL_VKEY_Add = 0x6B,
- FWL_VKEY_Separator = 0x6C,
- FWL_VKEY_Subtract = 0x6D,
- FWL_VKEY_Decimal = 0x6E,
- FWL_VKEY_Divide = 0x6F,
- FWL_VKEY_F1 = 0x70,
- FWL_VKEY_F2 = 0x71,
- FWL_VKEY_F3 = 0x72,
- FWL_VKEY_F4 = 0x73,
- FWL_VKEY_F5 = 0x74,
- FWL_VKEY_F6 = 0x75,
- FWL_VKEY_F7 = 0x76,
- FWL_VKEY_F8 = 0x77,
- FWL_VKEY_F9 = 0x78,
- FWL_VKEY_F10 = 0x79,
- FWL_VKEY_F11 = 0x7A,
- FWL_VKEY_F12 = 0x7B,
- FWL_VKEY_F13 = 0x7C,
- FWL_VKEY_F14 = 0x7D,
- FWL_VKEY_F15 = 0x7E,
- FWL_VKEY_F16 = 0x7F,
- FWL_VKEY_F17 = 0x80,
- FWL_VKEY_F18 = 0x81,
- FWL_VKEY_F19 = 0x82,
- FWL_VKEY_F20 = 0x83,
- FWL_VKEY_F21 = 0x84,
- FWL_VKEY_F22 = 0x85,
- FWL_VKEY_F23 = 0x86,
- FWL_VKEY_F24 = 0x87,
- FWL_VKEY_NunLock = 0x90,
- FWL_VKEY_Scroll = 0x91,
- FWL_VKEY_LShift = 0xA0,
- FWL_VKEY_RShift = 0xA1,
- FWL_VKEY_LControl = 0xA2,
- FWL_VKEY_RControl = 0xA3,
- FWL_VKEY_LMenu = 0xA4,
- FWL_VKEY_RMenu = 0xA5,
- FWL_VKEY_BROWSER_Back = 0xA6,
- FWL_VKEY_BROWSER_Forward = 0xA7,
- FWL_VKEY_BROWSER_Refresh = 0xA8,
- FWL_VKEY_BROWSER_Stop = 0xA9,
- FWL_VKEY_BROWSER_Search = 0xAA,
- FWL_VKEY_BROWSER_Favorites = 0xAB,
- FWL_VKEY_BROWSER_Home = 0xAC,
- FWL_VKEY_VOLUME_Mute = 0xAD,
- FWL_VKEY_VOLUME_Down = 0xAE,
- FWL_VKEY_VOLUME_Up = 0xAF,
- FWL_VKEY_MEDIA_NEXT_Track = 0xB0,
- FWL_VKEY_MEDIA_PREV_Track = 0xB1,
- FWL_VKEY_MEDIA_Stop = 0xB2,
- FWL_VKEY_MEDIA_PLAY_Pause = 0xB3,
- FWL_VKEY_MEDIA_LAUNCH_Mail = 0xB4,
- FWL_VKEY_MEDIA_LAUNCH_MEDIA_Select = 0xB5,
- FWL_VKEY_MEDIA_LAUNCH_APP1 = 0xB6,
- FWL_VKEY_MEDIA_LAUNCH_APP2 = 0xB7,
- FWL_VKEY_OEM_1 = 0xBA,
- FWL_VKEY_OEM_Plus = 0xBB,
- FWL_VKEY_OEM_Comma = 0xBC,
- FWL_VKEY_OEM_Minus = 0xBD,
- FWL_VKEY_OEM_Period = 0xBE,
- FWL_VKEY_OEM_2 = 0xBF,
- FWL_VKEY_OEM_3 = 0xC0,
- FWL_VKEY_OEM_4 = 0xDB,
- FWL_VKEY_OEM_5 = 0xDC,
- FWL_VKEY_OEM_6 = 0xDD,
- FWL_VKEY_OEM_7 = 0xDE,
- FWL_VKEY_OEM_8 = 0xDF,
- FWL_VKEY_OEM_102 = 0xE2,
- FWL_VKEY_ProcessKey = 0xE5,
- FWL_VKEY_Packet = 0xE7,
- FWL_VKEY_Attn = 0xF6,
- FWL_VKEY_Crsel = 0xF7,
- FWL_VKEY_Exsel = 0xF8,
- FWL_VKEY_Ereof = 0xF9,
- FWL_VKEY_Play = 0xFA,
- FWL_VKEY_Zoom = 0xFB,
- FWL_VKEY_NoName = 0xFC,
- FWL_VKEY_PA1 = 0xFD,
- FWL_VKEY_OEM_Clear = 0xFE,
- FWL_VKEY_Unknown = 0,
-} FWL_VKEYCODE;
-
-//key event command
-typedef enum
-{
- FWL_EVENTKEYCMD_KeyDown = 1 ,
- FWL_EVENTKEYCMD_KeyUp ,
- FWL_EVENTKEYCMD_Char ,
-} FWL_EVENTKEYCMD;
-
-//key event
-struct FWL_EVENT_KEY
-{
- FPDF_UINT32 command;
- FPDF_DWORD flag;
- union
- {
- //Virtual key code.
- FPDF_UINT32 vkcode;
- //Character code.
- FPDF_DWORD charcode;
- }code;
-};
-
-//event type
-struct FWL_EVENT
-{
- //structure size.
- FPDF_UINT32 size;
- //FWL_EVENTTYPE.
- FPDF_UINT32 type;
- union
- {
- struct FWL_EVENT_MOUSE mouse;
- struct FWL_EVENT_MOUSEWHEEL wheel;
- struct FWL_EVENT_KEY key;
- }s;
-};
-
-#endif //_FWL_EVENT_H
-
-
+// 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 _FWL_EVENT_H
+#define _FWL_EVENT_H
+
+#include "fpdfview.h"
+
+typedef int FPDF_INT32;
+typedef unsigned int FPDF_UINT32;
+typedef float FPDF_FLOAT;
+//event type
+typedef enum
+{
+ FWL_EVENTTYPE_Mouse = 0 ,
+ FWL_EVENTTYPE_MouseWheel,
+ FWL_EVENTTYPE_Key ,
+} FWL_EVENTTYPE;
+
+//key flag
+typedef enum
+{
+ FWL_EVENTFLAG_ShiftKey = 1 << 0,
+ FWL_EVENTFLAG_ControlKey = 1 << 1,
+ FWL_EVENTFLAG_AltKey = 1 << 2,
+ FWL_EVENTFLAG_MetaKey = 1 << 3,
+ FWL_EVENTFLAG_KeyPad = 1 << 4,
+ FWL_EVENTFLAG_AutoRepeat = 1 << 5,
+ FWL_EVENTFLAG_LeftButtonDown = 1 << 6,
+ FWL_EVENTFLAG_MiddleButtonDown = 1 << 7,
+ FWL_EVENTFLAG_RightButtonDown = 1 << 8,
+} FWL_EVENTFLAG;
+
+// Mouse message command
+typedef enum
+{
+ FWL_EVENTMOUSECMD_LButtonDown = 1 ,
+ FWL_EVENTMOUSECMD_LButtonUp ,
+ FWL_EVENTMOUSECMD_LButtonDblClk ,
+ FWL_EVENTMOUSECMD_RButtonDown ,
+ FWL_EVENTMOUSECMD_RButtonUp ,
+ FWL_EVENTMOUSECMD_RButtonDblClk ,
+ FWL_EVENTMOUSECMD_MButtonDown ,
+ FWL_EVENTMOUSECMD_MButtonUp ,
+ FWL_EVENTMOUSECMD_MButtonDblClk ,
+ FWL_EVENTMOUSECMD_MouseMove ,
+ FWL_EVENTMOUSECMD_MouseEnter ,
+ FWL_EVENTMOUSECMD_MouseHover ,
+ FWL_EVENTMOUSECMD_MouseLeave ,
+} FWL_EVENT_MOUSECMD;
+
+//mouse event
+struct FWL_EVENT_MOUSE
+{
+ FPDF_UINT32 command;
+ FPDF_DWORD flag;
+ FPDF_FLOAT x;
+ FPDF_FLOAT y;
+};
+
+//mouse wheel
+struct FWL_EVENT_MOUSEWHEEL
+{
+ FPDF_DWORD flag;
+ FPDF_FLOAT x;
+ FPDF_FLOAT y;
+ FPDF_FLOAT deltaX;
+ FPDF_FLOAT deltaY;
+};
+
+//virtual keycode
+typedef enum
+{
+ FWL_VKEY_Back = 0x08,
+ FWL_VKEY_Tab = 0x09,
+ FWL_VKEY_Clear = 0x0C,
+ FWL_VKEY_Return = 0x0D,
+ FWL_VKEY_Shift = 0x10,
+ FWL_VKEY_Control = 0x11,
+ FWL_VKEY_Menu = 0x12,
+ FWL_VKEY_Pause = 0x13,
+ FWL_VKEY_Capital = 0x14,
+ FWL_VKEY_Kana = 0x15,
+ FWL_VKEY_Hangul = 0x15,
+ FWL_VKEY_Junja = 0x17,
+ FWL_VKEY_Final = 0x18,
+ FWL_VKEY_Hanja = 0x19,
+ FWL_VKEY_Kanji = 0x19,
+ FWL_VKEY_Escape = 0x1B,
+ FWL_VKEY_Convert = 0x1C,
+ FWL_VKEY_NonConvert = 0x1D,
+ FWL_VKEY_Accept = 0x1E,
+ FWL_VKEY_ModeChange = 0x1F,
+ FWL_VKEY_Space = 0x20,
+ FWL_VKEY_Prior = 0x21,
+ FWL_VKEY_Next = 0x22,
+ FWL_VKEY_End = 0x23,
+ FWL_VKEY_Home = 0x24,
+ FWL_VKEY_Left = 0x25,
+ FWL_VKEY_Up = 0x26,
+ FWL_VKEY_Right = 0x27,
+ FWL_VKEY_Down = 0x28,
+ FWL_VKEY_Select = 0x29,
+ FWL_VKEY_Print = 0x2A,
+ FWL_VKEY_Execute = 0x2B,
+ FWL_VKEY_Snapshot = 0x2C,
+ FWL_VKEY_Insert = 0x2D,
+ FWL_VKEY_Delete = 0x2E,
+ FWL_VKEY_Help = 0x2F,
+ FWL_VKEY_0 = 0x30,
+ FWL_VKEY_1 = 0x31,
+ FWL_VKEY_2 = 0x32,
+ FWL_VKEY_3 = 0x33,
+ FWL_VKEY_4 = 0x34,
+ FWL_VKEY_5 = 0x35,
+ FWL_VKEY_6 = 0x36,
+ FWL_VKEY_7 = 0x37,
+ FWL_VKEY_8 = 0x38,
+ FWL_VKEY_9 = 0x39,
+ FWL_VKEY_A = 0x41,
+ FWL_VKEY_B = 0x42,
+ FWL_VKEY_C = 0x43,
+ FWL_VKEY_D = 0x44,
+ FWL_VKEY_E = 0x45,
+ FWL_VKEY_F = 0x46,
+ FWL_VKEY_G = 0x47,
+ FWL_VKEY_H = 0x48,
+ FWL_VKEY_I = 0x49,
+ FWL_VKEY_J = 0x4A,
+ FWL_VKEY_K = 0x4B,
+ FWL_VKEY_L = 0x4C,
+ FWL_VKEY_M = 0x4D,
+ FWL_VKEY_N = 0x4E,
+ FWL_VKEY_O = 0x4F,
+ FWL_VKEY_P = 0x50,
+ FWL_VKEY_Q = 0x51,
+ FWL_VKEY_R = 0x52,
+ FWL_VKEY_S = 0x53,
+ FWL_VKEY_T = 0x54,
+ FWL_VKEY_U = 0x55,
+ FWL_VKEY_V = 0x56,
+ FWL_VKEY_W = 0x57,
+ FWL_VKEY_X = 0x58,
+ FWL_VKEY_Y = 0x59,
+ FWL_VKEY_Z = 0x5A,
+ FWL_VKEY_LWin = 0x5B,
+ FWL_VKEY_Command = 0x5B,
+ FWL_VKEY_RWin = 0x5C,
+ FWL_VKEY_Apps = 0x5D,
+ FWL_VKEY_Sleep = 0x5F,
+ FWL_VKEY_NumPad0 = 0x60,
+ FWL_VKEY_NumPad1 = 0x61,
+ FWL_VKEY_NumPad2 = 0x62,
+ FWL_VKEY_NumPad3 = 0x63,
+ FWL_VKEY_NumPad4 = 0x64,
+ FWL_VKEY_NumPad5 = 0x65,
+ FWL_VKEY_NumPad6 = 0x66,
+ FWL_VKEY_NumPad7 = 0x67,
+ FWL_VKEY_NumPad8 = 0x68,
+ FWL_VKEY_NumPad9 = 0x69,
+ FWL_VKEY_Multiply = 0x6A,
+ FWL_VKEY_Add = 0x6B,
+ FWL_VKEY_Separator = 0x6C,
+ FWL_VKEY_Subtract = 0x6D,
+ FWL_VKEY_Decimal = 0x6E,
+ FWL_VKEY_Divide = 0x6F,
+ FWL_VKEY_F1 = 0x70,
+ FWL_VKEY_F2 = 0x71,
+ FWL_VKEY_F3 = 0x72,
+ FWL_VKEY_F4 = 0x73,
+ FWL_VKEY_F5 = 0x74,
+ FWL_VKEY_F6 = 0x75,
+ FWL_VKEY_F7 = 0x76,
+ FWL_VKEY_F8 = 0x77,
+ FWL_VKEY_F9 = 0x78,
+ FWL_VKEY_F10 = 0x79,
+ FWL_VKEY_F11 = 0x7A,
+ FWL_VKEY_F12 = 0x7B,
+ FWL_VKEY_F13 = 0x7C,
+ FWL_VKEY_F14 = 0x7D,
+ FWL_VKEY_F15 = 0x7E,
+ FWL_VKEY_F16 = 0x7F,
+ FWL_VKEY_F17 = 0x80,
+ FWL_VKEY_F18 = 0x81,
+ FWL_VKEY_F19 = 0x82,
+ FWL_VKEY_F20 = 0x83,
+ FWL_VKEY_F21 = 0x84,
+ FWL_VKEY_F22 = 0x85,
+ FWL_VKEY_F23 = 0x86,
+ FWL_VKEY_F24 = 0x87,
+ FWL_VKEY_NunLock = 0x90,
+ FWL_VKEY_Scroll = 0x91,
+ FWL_VKEY_LShift = 0xA0,
+ FWL_VKEY_RShift = 0xA1,
+ FWL_VKEY_LControl = 0xA2,
+ FWL_VKEY_RControl = 0xA3,
+ FWL_VKEY_LMenu = 0xA4,
+ FWL_VKEY_RMenu = 0xA5,
+ FWL_VKEY_BROWSER_Back = 0xA6,
+ FWL_VKEY_BROWSER_Forward = 0xA7,
+ FWL_VKEY_BROWSER_Refresh = 0xA8,
+ FWL_VKEY_BROWSER_Stop = 0xA9,
+ FWL_VKEY_BROWSER_Search = 0xAA,
+ FWL_VKEY_BROWSER_Favorites = 0xAB,
+ FWL_VKEY_BROWSER_Home = 0xAC,
+ FWL_VKEY_VOLUME_Mute = 0xAD,
+ FWL_VKEY_VOLUME_Down = 0xAE,
+ FWL_VKEY_VOLUME_Up = 0xAF,
+ FWL_VKEY_MEDIA_NEXT_Track = 0xB0,
+ FWL_VKEY_MEDIA_PREV_Track = 0xB1,
+ FWL_VKEY_MEDIA_Stop = 0xB2,
+ FWL_VKEY_MEDIA_PLAY_Pause = 0xB3,
+ FWL_VKEY_MEDIA_LAUNCH_Mail = 0xB4,
+ FWL_VKEY_MEDIA_LAUNCH_MEDIA_Select = 0xB5,
+ FWL_VKEY_MEDIA_LAUNCH_APP1 = 0xB6,
+ FWL_VKEY_MEDIA_LAUNCH_APP2 = 0xB7,
+ FWL_VKEY_OEM_1 = 0xBA,
+ FWL_VKEY_OEM_Plus = 0xBB,
+ FWL_VKEY_OEM_Comma = 0xBC,
+ FWL_VKEY_OEM_Minus = 0xBD,
+ FWL_VKEY_OEM_Period = 0xBE,
+ FWL_VKEY_OEM_2 = 0xBF,
+ FWL_VKEY_OEM_3 = 0xC0,
+ FWL_VKEY_OEM_4 = 0xDB,
+ FWL_VKEY_OEM_5 = 0xDC,
+ FWL_VKEY_OEM_6 = 0xDD,
+ FWL_VKEY_OEM_7 = 0xDE,
+ FWL_VKEY_OEM_8 = 0xDF,
+ FWL_VKEY_OEM_102 = 0xE2,
+ FWL_VKEY_ProcessKey = 0xE5,
+ FWL_VKEY_Packet = 0xE7,
+ FWL_VKEY_Attn = 0xF6,
+ FWL_VKEY_Crsel = 0xF7,
+ FWL_VKEY_Exsel = 0xF8,
+ FWL_VKEY_Ereof = 0xF9,
+ FWL_VKEY_Play = 0xFA,
+ FWL_VKEY_Zoom = 0xFB,
+ FWL_VKEY_NoName = 0xFC,
+ FWL_VKEY_PA1 = 0xFD,
+ FWL_VKEY_OEM_Clear = 0xFE,
+ FWL_VKEY_Unknown = 0,
+} FWL_VKEYCODE;
+
+//key event command
+typedef enum
+{
+ FWL_EVENTKEYCMD_KeyDown = 1 ,
+ FWL_EVENTKEYCMD_KeyUp ,
+ FWL_EVENTKEYCMD_Char ,
+} FWL_EVENTKEYCMD;
+
+//key event
+struct FWL_EVENT_KEY
+{
+ FPDF_UINT32 command;
+ FPDF_DWORD flag;
+ union
+ {
+ //Virtual key code.
+ FPDF_UINT32 vkcode;
+ //Character code.
+ FPDF_DWORD charcode;
+ }code;
+};
+
+//event type
+struct FWL_EVENT
+{
+ //structure size.
+ FPDF_UINT32 size;
+ //FWL_EVENTTYPE.
+ FPDF_UINT32 type;
+ union
+ {
+ struct FWL_EVENT_MOUSE mouse;
+ struct FWL_EVENT_MOUSEWHEEL wheel;
+ struct FWL_EVENT_KEY key;
+ }s;
+};
+
+#endif //_FWL_EVENT_H
+
+
diff --git a/fpdfsdk/include/fpdf_progressive.h b/fpdfsdk/include/fpdf_progressive.h
index d590f78817..029264eae2 100644
--- a/fpdfsdk/include/fpdf_progressive.h
+++ b/fpdfsdk/include/fpdf_progressive.h
@@ -1,94 +1,94 @@
-// 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 _FPDF_PROGRESSIVE_H_
-#define _FPDF_PROGRESSIVE_H_
-
-#include "fpdfview.h"
-
-//Flags for progressive process status.
-#define FPDF_RENDER_READER 0
-#define FPDF_RENDER_TOBECOUNTINUED 1
-#define FPDF_RENDER_DONE 2
-#define FPDF_RENDER_FAILED 3
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-//IFPDF_RENDERINFO interface.
-typedef struct _IFSDK_PAUSE
-{
- /**
- * Version number of the interface. Currently must be 1.
- **/
- int version;
-
- /*
- * Method: NeedToPauseNow
- * Check if we need to pause a progressive process now.
- * Interface Version:
- * 1
- * Implementation Required:
- * yes
- * Parameters:
- * pThis - Pointer to the interface structure itself
- * Return Value:
- * Non-zero for pause now, 0 for continue.
- *
- */
- FPDF_BOOL (*NeedToPauseNow) (struct _IFSDK_PAUSE* pThis);
-
- //A user defined data pointer, used by user's application. Can be NULL.
- void* user;
-} IFSDK_PAUSE;
-
-// Function: FPDF_RenderPageBitmap_Start
-// Start to render page contents to a device independent bitmap progressively.
-// Parameters:
-// bitmap - Handle to the device independent bitmap (as the output buffer).
-// Bitmap handle can be created by FPDFBitmap_Create function.
-// page - Handle to the page. Returned by FPDF_LoadPage function.
-// start_x - Left pixel position of the display area in the bitmap coordinate.
-// start_y - Top pixel position of the display area in the bitmap coordinate.
-// size_x - Horizontal size (in pixels) for displaying the page.
-// size_y - Vertical size (in pixels) for displaying the page.
-// rotate - Page orientation: 0 (normal), 1 (rotated 90 degrees clockwise),
-// 2 (rotated 180 degrees), 3 (rotated 90 degrees counter-clockwise).
-// flags - 0 for normal display, or combination of flags defined above.
-// pause - The IFSDK_PAUSE interface.A callback mechanism allowing the page rendering process
-// Return value:
-// Rendering Status. See flags for progressive process status for the details.
-//
-DLLEXPORT int STDCALL FPDF_RenderPageBitmap_Start(FPDF_BITMAP bitmap, FPDF_PAGE page, int start_x, int start_y, int size_x,
- int size_y, int rotate, int flags,IFSDK_PAUSE * pause);
-
-// Function: FPDF_RenderPage_Continue
-// Continue rendering a PDF page.
-// Parameters:
-// page - Handle to the page. Returned by FPDF_LoadPage function.
-// pause - The IFSDK_PAUSE interface.A callback mechanism allowing the page rendering process
-// to be paused before it's finished. This can be NULL if you don't want to pause.
-// Return value:
-// The rendering status. See flags for progressive process status for the details.
-DLLEXPORT int STDCALL FPDF_RenderPage_Continue(FPDF_PAGE page,IFSDK_PAUSE * pause);
-
-// Function: FPDF_RenderPage_Close
-// Release the resource allocate during page rendering. Need to be called after finishing rendering or
-// cancel the rendering.
-// Parameters:
-// page - Handle to the page. Returned by FPDF_LoadPage function.
-// Return value:
-// NULL
-DLLEXPORT void STDCALL FPDF_RenderPage_Close(FPDF_PAGE page);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif //_FPDF_PROGRESSIVE_H_
+// 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 _FPDF_PROGRESSIVE_H_
+#define _FPDF_PROGRESSIVE_H_
+
+#include "fpdfview.h"
+
+//Flags for progressive process status.
+#define FPDF_RENDER_READER 0
+#define FPDF_RENDER_TOBECOUNTINUED 1
+#define FPDF_RENDER_DONE 2
+#define FPDF_RENDER_FAILED 3
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+//IFPDF_RENDERINFO interface.
+typedef struct _IFSDK_PAUSE
+{
+ /**
+ * Version number of the interface. Currently must be 1.
+ **/
+ int version;
+
+ /*
+ * Method: NeedToPauseNow
+ * Check if we need to pause a progressive process now.
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * yes
+ * Parameters:
+ * pThis - Pointer to the interface structure itself
+ * Return Value:
+ * Non-zero for pause now, 0 for continue.
+ *
+ */
+ FPDF_BOOL (*NeedToPauseNow) (struct _IFSDK_PAUSE* pThis);
+
+ //A user defined data pointer, used by user's application. Can be NULL.
+ void* user;
+} IFSDK_PAUSE;
+
+// Function: FPDF_RenderPageBitmap_Start
+// Start to render page contents to a device independent bitmap progressively.
+// Parameters:
+// bitmap - Handle to the device independent bitmap (as the output buffer).
+// Bitmap handle can be created by FPDFBitmap_Create function.
+// page - Handle to the page. Returned by FPDF_LoadPage function.
+// start_x - Left pixel position of the display area in the bitmap coordinate.
+// start_y - Top pixel position of the display area in the bitmap coordinate.
+// size_x - Horizontal size (in pixels) for displaying the page.
+// size_y - Vertical size (in pixels) for displaying the page.
+// rotate - Page orientation: 0 (normal), 1 (rotated 90 degrees clockwise),
+// 2 (rotated 180 degrees), 3 (rotated 90 degrees counter-clockwise).
+// flags - 0 for normal display, or combination of flags defined above.
+// pause - The IFSDK_PAUSE interface.A callback mechanism allowing the page rendering process
+// Return value:
+// Rendering Status. See flags for progressive process status for the details.
+//
+DLLEXPORT int STDCALL FPDF_RenderPageBitmap_Start(FPDF_BITMAP bitmap, FPDF_PAGE page, int start_x, int start_y, int size_x,
+ int size_y, int rotate, int flags,IFSDK_PAUSE * pause);
+
+// Function: FPDF_RenderPage_Continue
+// Continue rendering a PDF page.
+// Parameters:
+// page - Handle to the page. Returned by FPDF_LoadPage function.
+// pause - The IFSDK_PAUSE interface.A callback mechanism allowing the page rendering process
+// to be paused before it's finished. This can be NULL if you don't want to pause.
+// Return value:
+// The rendering status. See flags for progressive process status for the details.
+DLLEXPORT int STDCALL FPDF_RenderPage_Continue(FPDF_PAGE page,IFSDK_PAUSE * pause);
+
+// Function: FPDF_RenderPage_Close
+// Release the resource allocate during page rendering. Need to be called after finishing rendering or
+// cancel the rendering.
+// Parameters:
+// page - Handle to the page. Returned by FPDF_LoadPage function.
+// Return value:
+// NULL
+DLLEXPORT void STDCALL FPDF_RenderPage_Close(FPDF_PAGE page);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif //_FPDF_PROGRESSIVE_H_
diff --git a/fpdfsdk/include/fpdf_searchex.h b/fpdfsdk/include/fpdf_searchex.h
index c291c0c280..d70dddc984 100644
--- a/fpdfsdk/include/fpdf_searchex.h
+++ b/fpdfsdk/include/fpdf_searchex.h
@@ -1,33 +1,33 @@
-// 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 _FPDF_SEARCH_EX_H
-#define _FPDF_SEARCH_EX_H
-
-#ifndef _FPDFVIEW_H_
-#include "fpdfview.h"
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-// Function: FPDFText_GetCharIndexFromTextIndex
-// Get the actually char index in text_page's internal char list.
-// Parameters:
-// text_page - Handle to a text page information structure. Returned by FPDFText_LoadPage function.
-// nTextIndex - The index of the text in the string get from FPDFText_GetText.
-// Return value:
-// The index of the character in internal charlist. -1 for error.
-DLLEXPORT int STDCALL FPDFText_GetCharIndexFromTextIndex(FPDF_TEXTPAGE text_page, int nTextIndex);
-
-#ifdef __cplusplus
-};
-#endif
-
-
-#endif
-
+// 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 _FPDF_SEARCH_EX_H
+#define _FPDF_SEARCH_EX_H
+
+#ifndef _FPDFVIEW_H_
+#include "fpdfview.h"
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// Function: FPDFText_GetCharIndexFromTextIndex
+// Get the actually char index in text_page's internal char list.
+// Parameters:
+// text_page - Handle to a text page information structure. Returned by FPDFText_LoadPage function.
+// nTextIndex - The index of the text in the string get from FPDFText_GetText.
+// Return value:
+// The index of the character in internal charlist. -1 for error.
+DLLEXPORT int STDCALL FPDFText_GetCharIndexFromTextIndex(FPDF_TEXTPAGE text_page, int nTextIndex);
+
+#ifdef __cplusplus
+};
+#endif
+
+
+#endif
+
diff --git a/fpdfsdk/include/fpdf_transformpage.h b/fpdfsdk/include/fpdf_transformpage.h
index caafeda0e4..69ffe24009 100644
--- a/fpdfsdk/include/fpdf_transformpage.h
+++ b/fpdfsdk/include/fpdf_transformpage.h
@@ -1,113 +1,113 @@
-// 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 _TRANSFORMPAGE_H_
-#define _TRANSFORMPAGE_H_
-
-#ifndef _FPDFVIEW_H_
-#include "fpdfview.h"
-#endif
-
-typedef void* FPDF_PAGEARCSAVER;
-typedef void* FPDF_PAGEARCLOADER;
-/**
-* Set "MediaBox" entry to the page dictionary.
-* @param[in] page - Handle to a page.
-* @param[in] left - The left of the rectangle.
-* @param[in] bottom - The bottom of the rectangle.
-* @param[in] right - The right of the rectangle.
-* @param[in] top - The top of the rectangle.
-* @retval None.
-*/
-DLLEXPORT void STDCALL FPDFPage_SetMediaBox(FPDF_PAGE page, float left, float bottom, float right, float top);
-
-/**
-* Set "CropBox" entry to the page dictionary.
-* @param[in] page - Handle to a page.
-* @param[in] left - The left of the rectangle.
-* @param[in] bottom - The bottom of the rectangle.
-* @param[in] right - The right of the rectangle.
-* @param[in] top - The top of the rectangle.
-* @retval None.
-*/
-DLLEXPORT void STDCALL FPDFPage_SetCropBox(FPDF_PAGE page, float left, float bottom, float right, float top);
-
-
-/** Get "MediaBox" entry from the page dictionary.
-* @param[in] page - Handle to a page.
-* @param[in] left - Pointer to a double value receiving the left of the rectangle.
-* @param[in] bottom - Pointer to a double value receiving the bottom of the rectangle.
-* @param[in] right - Pointer to a double value receiving the right of the rectangle.
-* @param[in] top - Pointer to a double value receiving the top of the rectangle.
-* @retval True if success,else fail.
-*/
-DLLEXPORT FPDF_BOOL STDCALL FPDFPage_GetMediaBox(FPDF_PAGE page, float* left, float* bottom, float* right, float* top);
-
-/** Get "CropBox" entry from the page dictionary.
-* @param[in] page - Handle to a page.
-* @param[in] left - Pointer to a double value receiving the left of the rectangle.
-* @param[in] bottom - Pointer to a double value receiving the bottom of the rectangle.
-* @param[in] right - Pointer to a double value receiving the right of the rectangle.
-* @param[in] top - Pointer to a double value receiving the top of the rectangle.
-* @retval True if success,else fail.
-*/
-DLLEXPORT FPDF_BOOL STDCALL FPDFPage_GetCropBox(FPDF_PAGE page, float* left, float* bottom, float* right, float* top);
-
-/**
-* Transform the whole page with a specified matrix, then clip the page content region.
-*
-* @param[in] page - A page handle.
-* @param[in] matrix - The transform matrix.
-* @param[in] clipRect - A rectangle page area to be clipped.
-* @Note. This function will transform the whole page, and would take effect to all the objects in the page.
-*/
-DLLEXPORT FPDF_BOOL STDCALL FPDFPage_TransFormWithClip(FPDF_PAGE page, FS_MATRIX* matrix, FS_RECTF* clipRect);
-
-/**
-* Transform (scale, rotate, shear, move) the clip path of page object.
-* @param[in] page_object - Handle to a page object. Returned by FPDFPageObj_NewImageObj.
-* @param[in] a - The coefficient "a" of the matrix.
-* @param[in] b - The coefficient "b" of the matrix.
-* @param[in] c - The coefficient "c" of the matrix.
-* @param[in] d - The coefficient "d" of the matrix.
-* @param[in] e - The coefficient "e" of the matrix.
-* @param[in] f - The coefficient "f" of the matrix.
-* @retval None.
-*/
-DLLEXPORT void STDCALL FPDFPageObj_TransformClipPath(FPDF_PAGEOBJECT page_object,double a, double b, double c, double d, double e, double f);
-
-/**
-* Create a new clip path, with a rectangle inserted.
-*
-* @param[in] left - The left of the clip box.
-* @param[in] bottom - The bottom of the clip box.
-* @param[in] right - The right of the clip box.
-* @param[in] top - The top of the clip box.
-* @retval a handle to the clip path.
-*/
-DLLEXPORT FPDF_CLIPPATH STDCALL FPDF_CreateClipPath(float left, float bottom, float right, float top);
-
-/**
-* Destroy the clip path.
-*
-* @param[in] clipPath - A handle to the clip path.
-* Destroy the clip path.
-* @retval None.
-*/
-DLLEXPORT void STDCALL FPDF_DestroyClipPath(FPDF_CLIPPATH clipPath);
-
-/**
-* Clip the page content, the page content that outside the clipping region become invisible.
-*
-* @param[in] page - A page handle.
-* @param[in] clipPath - A handle to the clip path.
-* @Note. A clip path will be inserted before the page content stream or content array. In this way, the page content will be clipped
-* by this clip path.
-*/
-DLLEXPORT void STDCALL FPDFPage_InsertClipPath(FPDF_PAGE page,FPDF_CLIPPATH clipPath);
-
-#endif
-
+// 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 _TRANSFORMPAGE_H_
+#define _TRANSFORMPAGE_H_
+
+#ifndef _FPDFVIEW_H_
+#include "fpdfview.h"
+#endif
+
+typedef void* FPDF_PAGEARCSAVER;
+typedef void* FPDF_PAGEARCLOADER;
+/**
+* Set "MediaBox" entry to the page dictionary.
+* @param[in] page - Handle to a page.
+* @param[in] left - The left of the rectangle.
+* @param[in] bottom - The bottom of the rectangle.
+* @param[in] right - The right of the rectangle.
+* @param[in] top - The top of the rectangle.
+* @retval None.
+*/
+DLLEXPORT void STDCALL FPDFPage_SetMediaBox(FPDF_PAGE page, float left, float bottom, float right, float top);
+
+/**
+* Set "CropBox" entry to the page dictionary.
+* @param[in] page - Handle to a page.
+* @param[in] left - The left of the rectangle.
+* @param[in] bottom - The bottom of the rectangle.
+* @param[in] right - The right of the rectangle.
+* @param[in] top - The top of the rectangle.
+* @retval None.
+*/
+DLLEXPORT void STDCALL FPDFPage_SetCropBox(FPDF_PAGE page, float left, float bottom, float right, float top);
+
+
+/** Get "MediaBox" entry from the page dictionary.
+* @param[in] page - Handle to a page.
+* @param[in] left - Pointer to a double value receiving the left of the rectangle.
+* @param[in] bottom - Pointer to a double value receiving the bottom of the rectangle.
+* @param[in] right - Pointer to a double value receiving the right of the rectangle.
+* @param[in] top - Pointer to a double value receiving the top of the rectangle.
+* @retval True if success,else fail.
+*/
+DLLEXPORT FPDF_BOOL STDCALL FPDFPage_GetMediaBox(FPDF_PAGE page, float* left, float* bottom, float* right, float* top);
+
+/** Get "CropBox" entry from the page dictionary.
+* @param[in] page - Handle to a page.
+* @param[in] left - Pointer to a double value receiving the left of the rectangle.
+* @param[in] bottom - Pointer to a double value receiving the bottom of the rectangle.
+* @param[in] right - Pointer to a double value receiving the right of the rectangle.
+* @param[in] top - Pointer to a double value receiving the top of the rectangle.
+* @retval True if success,else fail.
+*/
+DLLEXPORT FPDF_BOOL STDCALL FPDFPage_GetCropBox(FPDF_PAGE page, float* left, float* bottom, float* right, float* top);
+
+/**
+* Transform the whole page with a specified matrix, then clip the page content region.
+*
+* @param[in] page - A page handle.
+* @param[in] matrix - The transform matrix.
+* @param[in] clipRect - A rectangle page area to be clipped.
+* @Note. This function will transform the whole page, and would take effect to all the objects in the page.
+*/
+DLLEXPORT FPDF_BOOL STDCALL FPDFPage_TransFormWithClip(FPDF_PAGE page, FS_MATRIX* matrix, FS_RECTF* clipRect);
+
+/**
+* Transform (scale, rotate, shear, move) the clip path of page object.
+* @param[in] page_object - Handle to a page object. Returned by FPDFPageObj_NewImageObj.
+* @param[in] a - The coefficient "a" of the matrix.
+* @param[in] b - The coefficient "b" of the matrix.
+* @param[in] c - The coefficient "c" of the matrix.
+* @param[in] d - The coefficient "d" of the matrix.
+* @param[in] e - The coefficient "e" of the matrix.
+* @param[in] f - The coefficient "f" of the matrix.
+* @retval None.
+*/
+DLLEXPORT void STDCALL FPDFPageObj_TransformClipPath(FPDF_PAGEOBJECT page_object,double a, double b, double c, double d, double e, double f);
+
+/**
+* Create a new clip path, with a rectangle inserted.
+*
+* @param[in] left - The left of the clip box.
+* @param[in] bottom - The bottom of the clip box.
+* @param[in] right - The right of the clip box.
+* @param[in] top - The top of the clip box.
+* @retval a handle to the clip path.
+*/
+DLLEXPORT FPDF_CLIPPATH STDCALL FPDF_CreateClipPath(float left, float bottom, float right, float top);
+
+/**
+* Destroy the clip path.
+*
+* @param[in] clipPath - A handle to the clip path.
+* Destroy the clip path.
+* @retval None.
+*/
+DLLEXPORT void STDCALL FPDF_DestroyClipPath(FPDF_CLIPPATH clipPath);
+
+/**
+* Clip the page content, the page content that outside the clipping region become invisible.
+*
+* @param[in] page - A page handle.
+* @param[in] clipPath - A handle to the clip path.
+* @Note. A clip path will be inserted before the page content stream or content array. In this way, the page content will be clipped
+* by this clip path.
+*/
+DLLEXPORT void STDCALL FPDFPage_InsertClipPath(FPDF_PAGE page,FPDF_CLIPPATH clipPath);
+
+#endif
+
diff --git a/fpdfsdk/include/fpdfdoc.h b/fpdfsdk/include/fpdfdoc.h
index 35c2c9674c..54ede4037a 100644
--- a/fpdfsdk/include/fpdfdoc.h
+++ b/fpdfsdk/include/fpdfdoc.h
@@ -1,230 +1,230 @@
-// 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 _FPDFDOC_H_
-#define _FPDFDOC_H_
-
-#include "fpdfview.h"
-
-// Exported Functions
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-// Function: FPDFBookmark_Find
-// Find a bookmark in the document, using the bookmark title.
-// Parameters:
-// document - Handle to the document. Returned by FPDF_LoadDocument or FPDF_LoadMemDocument.
-// title - The UTF-16LE encoded Unicode string for the bookmark title to be searched. Can't be NULL.
-// Return value:
-// Handle to the found bookmark item. NULL if the title can't be found.
-// Comments:
-// It always returns the first found bookmark if more than one bookmarks have the same title.
-//
-DLLEXPORT FPDF_BOOKMARK STDCALL FPDFBookmark_Find(FPDF_DOCUMENT document, FPDF_WIDESTRING title);
-
-// Function: FPDFBookmark_GetDest
-// Get the destination associated with a bookmark item.
-// Parameters:
-// document - Handle to the document.
-// bookmark - Handle to the bookmark.
-// Return value:
-// Handle to the destination data. NULL if no destination is associated with this bookmark.
-//
-DLLEXPORT FPDF_DEST STDCALL FPDFBookmark_GetDest(FPDF_DOCUMENT document, FPDF_BOOKMARK bookmark);
-
-// Function: FPDFBookmark_GetAction
-// Get the action associated with a bookmark item.
-// Parameters:
-// bookmark - Handle to the bookmark.
-// Return value:
-// Handle to the action data. NULL if no action is associated with this bookmark. In this case, the
-// application should try FPDFBookmark_GetDest.
-//
-DLLEXPORT FPDF_ACTION STDCALL FPDFBookmark_GetAction(FPDF_BOOKMARK bookmark);
-
-#define PDFACTION_UNSUPPORTED 0 // Unsupported action type.
-#define PDFACTION_GOTO 1 // Go to a destination within current document.
-#define PDFACTION_REMOTEGOTO 2 // Go to a destination within another document.
-#define PDFACTION_URI 3 // Universal Resource Identifier, including web pages and
- // other Internet based resources.
-#define PDFACTION_LAUNCH 4 // Launch an application or open a file.
-
-// Function: FPDFAction_GetType
-// Get type of an action.
-// Parameters:
-// action - Handle to the action.
-// Return value:
-// A type number as defined above.
-//
-DLLEXPORT unsigned long STDCALL FPDFAction_GetType(FPDF_ACTION action);
-
-// Function: FPDFAction_GetDest
-// Get destination of an action.
-// Parameters:
-// document - Handle to the document.
-// action - Handle to the action. It must be a GOTO or REMOTEGOTO action.
-// Return value:
-// Handle to the destination data.
-// Comments:
-// In case of remote goto action, the application should first use FPDFAction_GetFilePath to
-// get file path, then load that particular document, and use its document handle to call this
-// function.
-//
-DLLEXPORT FPDF_DEST STDCALL FPDFAction_GetDest(FPDF_DOCUMENT document, FPDF_ACTION action);
-
-// Function: FPDFAction_GetURIPath
-// Get URI path of a URI action.
-// Parameters:
-// document - Handle to the document.
-// action - Handle to the action. Must be a URI action.
-// buffer - A buffer for output the path string. Can be NULL.
-// buflen - The length of the buffer, number of bytes. Can be 0.
-// Return value:
-// Number of bytes the URI path consumes, including trailing zeros.
-// Comments:
-// The URI path is always encoded in 7-bit ASCII.
-//
-// The return value always indicated number of bytes required for the buffer, even when there is
-// no buffer specified, or the buffer size is less then required. In this case, the buffer will not
-// be modified.
-//
-DLLEXPORT unsigned long STDCALL FPDFAction_GetURIPath(FPDF_DOCUMENT document, FPDF_ACTION action,
- void* buffer, unsigned long buflen);
-
-// Function: FPDFDest_GetPageIndex
-// Get page index of a destination.
-// Parameters:
-// document - Handle to the document.
-// dest - Handle to the destination.
-// Return value:
-// The page index. Starting from 0 for the first page.
-//
-DLLEXPORT unsigned long STDCALL FPDFDest_GetPageIndex(FPDF_DOCUMENT document, FPDF_DEST dest);
-
-// Function: FPDFLink_GetLinkAtPoint
-// Find a link at specified point on a document page.
-// Parameters:
-// page - Handle to the document page.
-// x - The x coordinate of the point, specified in page coordinate system.
-// y - The y coordinate of the point, specified in page coordinate system.
-// Return value:
-// Handle to the link. NULL if no link found at that point.
-// Comments:
-// The point coordinates are specified in page coordinate system. You can convert coordinates
-// from screen system to page system using FPDF_DeviceToPage functions.
-//
-DLLEXPORT FPDF_LINK STDCALL FPDFLink_GetLinkAtPoint(FPDF_PAGE page, double x, double y);
-
-// Function: FPDFLink_GetDest
-// Get destination info of a link.
-// Parameters:
-// document - Handle to the document.
-// link - Handle to the link. Returned by FPDFLink_GetLinkAtPoint.
-// Return value:
-// Handle to the destination. NULL if there is no destination associated with the link, in this case
-// the application should try FPDFLink_GetAction.
-//
-DLLEXPORT FPDF_DEST STDCALL FPDFLink_GetDest(FPDF_DOCUMENT document, FPDF_LINK link);
-
-// Function: FPDFLink_GetAction
-// Get action info of a link.
-// Parameters:
-// link - Handle to the link.
-// Return value:
-// Handle to the action. NULL if there is no action associated with the link.
-//
-DLLEXPORT FPDF_ACTION STDCALL FPDFLink_GetAction(FPDF_LINK link);
-
-// Function: FPDFLink_Enumerate
-// This function would enumerate all the link annotations in a single PDF page.
-// Parameters:
-// page[in] - Handle to the page.
-// startPos[in,out] - The start position to enumerate the link annotations, which should be specified to start from
-// - 0 for the first call, and would receive the next position for enumerating to start from.
-// linkAnnot[out] - Receive the link handle.
-// Return value:
-// TRUE if succceed, else False;
-//
-DLLEXPORT FPDF_BOOL STDCALL FPDFLink_Enumerate(FPDF_PAGE page, int* startPos, FPDF_LINK* linkAnnot);
-
-// Function: FPDFLink_GetAnnotRect
-// Get the annotation rectangle. (Specified by the ¡°Rect¡± entry of annotation dictionary).
-// Parameters:
-// linkAnnot[in] - Handle to the link annotation.
-// rect[out] - The annotation rect.
-// Return value:
-// TRUE if succceed, else False;
-//
-DLLEXPORT FPDF_BOOL STDCALL FPDFLink_GetAnnotRect(FPDF_LINK linkAnnot, FS_RECTF* rect);
-
-// Function: FPDFLink_CountQuadPoints
-// Get the count of quadrilateral points to the link annotation.
-// Parameters:
-// linkAnnot[in] - Handle to the link annotation.
-// Return value:
-// The count of quadrilateral points.
-//
-DLLEXPORT int STDCALL FPDFLink_CountQuadPoints(FPDF_LINK linkAnnot);
-
-/* _FS_DEF_STRUCTURE_QUADPOINTSF_ */
-#ifndef _FS_DEF_STRUCTURE_QUADPOINTSF_
-#define _FS_DEF_STRUCTURE_QUADPOINTSF_
-typedef struct _FS_QUADPOINTSF
-{
- FS_FLOAT x1;
- FS_FLOAT y1;
- FS_FLOAT x2;
- FS_FLOAT y2;
- FS_FLOAT x3;
- FS_FLOAT y3;
- FS_FLOAT x4;
- FS_FLOAT y4;
-} FS_QUADPOINTSF;
-#endif /* _FS_DEF_STRUCTURE_QUADPOINTSF_ */
-
-// Function: FPDFLink_GetQuadPoints
-// Get the quadrilateral points for the specified index in the link annotation.
-// Parameters:
-// linkAnnot[in] - Handle to the link annotation.
-// quadIndex[in] - The specified quad points index.
-// quadPoints[out] - Receive the quadrilateral points.
-// Return value:
-// True if succeed, else False.
-//
-DLLEXPORT FPDF_BOOL STDCALL FPDFLink_GetQuadPoints(FPDF_LINK linkAnnot, int quadIndex, FS_QUADPOINTSF* quadPoints);
-
-// Function: FPDF_GetMetaText
-// Get a text from meta data of the document. Result is encoded in UTF-16LE.
-// Parameters:
-// doc - Handle to a document
-// tag - The tag for the meta data. Currently, It can be "Title", "Author",
-// "Subject", "Keywords", "Creator", "Producer", "CreationDate", or "ModDate".
-// For detailed explanation of these tags and their respective values,
-// please refer to PDF Reference 1.6, section 10.2.1, "Document Information Dictionary".
-// buffer - A buffer for output the title. Can be NULL.
-// buflen - The length of the buffer, number of bytes. Can be 0.
-// Return value:
-// Number of bytes the title consumes, including trailing zeros.
-// Comments:
-// No matter on what platform, the title is always output in UTF-16LE encoding, which means the buffer
-// can be regarded as an array of WORD (on Intel and compatible CPUs), each WORD represent the Unicode of
-// a character (some special Unicode may take 2 WORDs). The string is followed by two bytes of zero
-// indicating end of the string.
-//
-// The return value always indicated number of bytes required for the buffer, even when there is
-// no buffer specified, or the buffer size is less then required. In this case, the buffer will not
-// be modified.
-//
-DLLEXPORT unsigned long STDCALL FPDF_GetMetaText(FPDF_DOCUMENT doc, FPDF_BYTESTRING tag,
- void* buffer, unsigned long buflen);
-
-
-#ifdef __cplusplus
-};
-#endif
-
-#endif // _FPDFDOC_H_
+// 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 _FPDFDOC_H_
+#define _FPDFDOC_H_
+
+#include "fpdfview.h"
+
+// Exported Functions
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// Function: FPDFBookmark_Find
+// Find a bookmark in the document, using the bookmark title.
+// Parameters:
+// document - Handle to the document. Returned by FPDF_LoadDocument or FPDF_LoadMemDocument.
+// title - The UTF-16LE encoded Unicode string for the bookmark title to be searched. Can't be NULL.
+// Return value:
+// Handle to the found bookmark item. NULL if the title can't be found.
+// Comments:
+// It always returns the first found bookmark if more than one bookmarks have the same title.
+//
+DLLEXPORT FPDF_BOOKMARK STDCALL FPDFBookmark_Find(FPDF_DOCUMENT document, FPDF_WIDESTRING title);
+
+// Function: FPDFBookmark_GetDest
+// Get the destination associated with a bookmark item.
+// Parameters:
+// document - Handle to the document.
+// bookmark - Handle to the bookmark.
+// Return value:
+// Handle to the destination data. NULL if no destination is associated with this bookmark.
+//
+DLLEXPORT FPDF_DEST STDCALL FPDFBookmark_GetDest(FPDF_DOCUMENT document, FPDF_BOOKMARK bookmark);
+
+// Function: FPDFBookmark_GetAction
+// Get the action associated with a bookmark item.
+// Parameters:
+// bookmark - Handle to the bookmark.
+// Return value:
+// Handle to the action data. NULL if no action is associated with this bookmark. In this case, the
+// application should try FPDFBookmark_GetDest.
+//
+DLLEXPORT FPDF_ACTION STDCALL FPDFBookmark_GetAction(FPDF_BOOKMARK bookmark);
+
+#define PDFACTION_UNSUPPORTED 0 // Unsupported action type.
+#define PDFACTION_GOTO 1 // Go to a destination within current document.
+#define PDFACTION_REMOTEGOTO 2 // Go to a destination within another document.
+#define PDFACTION_URI 3 // Universal Resource Identifier, including web pages and
+ // other Internet based resources.
+#define PDFACTION_LAUNCH 4 // Launch an application or open a file.
+
+// Function: FPDFAction_GetType
+// Get type of an action.
+// Parameters:
+// action - Handle to the action.
+// Return value:
+// A type number as defined above.
+//
+DLLEXPORT unsigned long STDCALL FPDFAction_GetType(FPDF_ACTION action);
+
+// Function: FPDFAction_GetDest
+// Get destination of an action.
+// Parameters:
+// document - Handle to the document.
+// action - Handle to the action. It must be a GOTO or REMOTEGOTO action.
+// Return value:
+// Handle to the destination data.
+// Comments:
+// In case of remote goto action, the application should first use FPDFAction_GetFilePath to
+// get file path, then load that particular document, and use its document handle to call this
+// function.
+//
+DLLEXPORT FPDF_DEST STDCALL FPDFAction_GetDest(FPDF_DOCUMENT document, FPDF_ACTION action);
+
+// Function: FPDFAction_GetURIPath
+// Get URI path of a URI action.
+// Parameters:
+// document - Handle to the document.
+// action - Handle to the action. Must be a URI action.
+// buffer - A buffer for output the path string. Can be NULL.
+// buflen - The length of the buffer, number of bytes. Can be 0.
+// Return value:
+// Number of bytes the URI path consumes, including trailing zeros.
+// Comments:
+// The URI path is always encoded in 7-bit ASCII.
+//
+// The return value always indicated number of bytes required for the buffer, even when there is
+// no buffer specified, or the buffer size is less then required. In this case, the buffer will not
+// be modified.
+//
+DLLEXPORT unsigned long STDCALL FPDFAction_GetURIPath(FPDF_DOCUMENT document, FPDF_ACTION action,
+ void* buffer, unsigned long buflen);
+
+// Function: FPDFDest_GetPageIndex
+// Get page index of a destination.
+// Parameters:
+// document - Handle to the document.
+// dest - Handle to the destination.
+// Return value:
+// The page index. Starting from 0 for the first page.
+//
+DLLEXPORT unsigned long STDCALL FPDFDest_GetPageIndex(FPDF_DOCUMENT document, FPDF_DEST dest);
+
+// Function: FPDFLink_GetLinkAtPoint
+// Find a link at specified point on a document page.
+// Parameters:
+// page - Handle to the document page.
+// x - The x coordinate of the point, specified in page coordinate system.
+// y - The y coordinate of the point, specified in page coordinate system.
+// Return value:
+// Handle to the link. NULL if no link found at that point.
+// Comments:
+// The point coordinates are specified in page coordinate system. You can convert coordinates
+// from screen system to page system using FPDF_DeviceToPage functions.
+//
+DLLEXPORT FPDF_LINK STDCALL FPDFLink_GetLinkAtPoint(FPDF_PAGE page, double x, double y);
+
+// Function: FPDFLink_GetDest
+// Get destination info of a link.
+// Parameters:
+// document - Handle to the document.
+// link - Handle to the link. Returned by FPDFLink_GetLinkAtPoint.
+// Return value:
+// Handle to the destination. NULL if there is no destination associated with the link, in this case
+// the application should try FPDFLink_GetAction.
+//
+DLLEXPORT FPDF_DEST STDCALL FPDFLink_GetDest(FPDF_DOCUMENT document, FPDF_LINK link);
+
+// Function: FPDFLink_GetAction
+// Get action info of a link.
+// Parameters:
+// link - Handle to the link.
+// Return value:
+// Handle to the action. NULL if there is no action associated with the link.
+//
+DLLEXPORT FPDF_ACTION STDCALL FPDFLink_GetAction(FPDF_LINK link);
+
+// Function: FPDFLink_Enumerate
+// This function would enumerate all the link annotations in a single PDF page.
+// Parameters:
+// page[in] - Handle to the page.
+// startPos[in,out] - The start position to enumerate the link annotations, which should be specified to start from
+// - 0 for the first call, and would receive the next position for enumerating to start from.
+// linkAnnot[out] - Receive the link handle.
+// Return value:
+// TRUE if succceed, else False;
+//
+DLLEXPORT FPDF_BOOL STDCALL FPDFLink_Enumerate(FPDF_PAGE page, int* startPos, FPDF_LINK* linkAnnot);
+
+// Function: FPDFLink_GetAnnotRect
+// Get the annotation rectangle. (Specified by the ¡°Rect¡± entry of annotation dictionary).
+// Parameters:
+// linkAnnot[in] - Handle to the link annotation.
+// rect[out] - The annotation rect.
+// Return value:
+// TRUE if succceed, else False;
+//
+DLLEXPORT FPDF_BOOL STDCALL FPDFLink_GetAnnotRect(FPDF_LINK linkAnnot, FS_RECTF* rect);
+
+// Function: FPDFLink_CountQuadPoints
+// Get the count of quadrilateral points to the link annotation.
+// Parameters:
+// linkAnnot[in] - Handle to the link annotation.
+// Return value:
+// The count of quadrilateral points.
+//
+DLLEXPORT int STDCALL FPDFLink_CountQuadPoints(FPDF_LINK linkAnnot);
+
+/* _FS_DEF_STRUCTURE_QUADPOINTSF_ */
+#ifndef _FS_DEF_STRUCTURE_QUADPOINTSF_
+#define _FS_DEF_STRUCTURE_QUADPOINTSF_
+typedef struct _FS_QUADPOINTSF
+{
+ FS_FLOAT x1;
+ FS_FLOAT y1;
+ FS_FLOAT x2;
+ FS_FLOAT y2;
+ FS_FLOAT x3;
+ FS_FLOAT y3;
+ FS_FLOAT x4;
+ FS_FLOAT y4;
+} FS_QUADPOINTSF;
+#endif /* _FS_DEF_STRUCTURE_QUADPOINTSF_ */
+
+// Function: FPDFLink_GetQuadPoints
+// Get the quadrilateral points for the specified index in the link annotation.
+// Parameters:
+// linkAnnot[in] - Handle to the link annotation.
+// quadIndex[in] - The specified quad points index.
+// quadPoints[out] - Receive the quadrilateral points.
+// Return value:
+// True if succeed, else False.
+//
+DLLEXPORT FPDF_BOOL STDCALL FPDFLink_GetQuadPoints(FPDF_LINK linkAnnot, int quadIndex, FS_QUADPOINTSF* quadPoints);
+
+// Function: FPDF_GetMetaText
+// Get a text from meta data of the document. Result is encoded in UTF-16LE.
+// Parameters:
+// doc - Handle to a document
+// tag - The tag for the meta data. Currently, It can be "Title", "Author",
+// "Subject", "Keywords", "Creator", "Producer", "CreationDate", or "ModDate".
+// For detailed explanation of these tags and their respective values,
+// please refer to PDF Reference 1.6, section 10.2.1, "Document Information Dictionary".
+// buffer - A buffer for output the title. Can be NULL.
+// buflen - The length of the buffer, number of bytes. Can be 0.
+// Return value:
+// Number of bytes the title consumes, including trailing zeros.
+// Comments:
+// No matter on what platform, the title is always output in UTF-16LE encoding, which means the buffer
+// can be regarded as an array of WORD (on Intel and compatible CPUs), each WORD represent the Unicode of
+// a character (some special Unicode may take 2 WORDs). The string is followed by two bytes of zero
+// indicating end of the string.
+//
+// The return value always indicated number of bytes required for the buffer, even when there is
+// no buffer specified, or the buffer size is less then required. In this case, the buffer will not
+// be modified.
+//
+DLLEXPORT unsigned long STDCALL FPDF_GetMetaText(FPDF_DOCUMENT doc, FPDF_BYTESTRING tag,
+ void* buffer, unsigned long buflen);
+
+
+#ifdef __cplusplus
+};
+#endif
+
+#endif // _FPDFDOC_H_
diff --git a/fpdfsdk/include/fpdfedit.h b/fpdfsdk/include/fpdfedit.h
index 52fb1484a5..c7d8b01f69 100644
--- a/fpdfsdk/include/fpdfedit.h
+++ b/fpdfsdk/include/fpdfedit.h
@@ -1,235 +1,235 @@
-// 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 _FPDFEDIT_H_
-#define _FPDFEDIT_H_
-
-#include "fpdfview.h"
-
-// Define all types used in the SDK. Note they can be simply regarded as opaque pointers
-// or long integer numbers.
-
-#define FPDF_ARGB(a,r,g,b) ((((FX_DWORD)(((FX_BYTE)(b)|((FX_WORD)((FX_BYTE)(g))<<8))|(((FX_DWORD)(FX_BYTE)(r))<<16)))) | (((FX_DWORD)(FX_BYTE)(a))<<24))
-#define FPDF_GetBValue(argb) ((FX_BYTE)(argb))
-#define FPDF_GetGValue(argb) ((FX_BYTE)(((FX_WORD)(argb)) >> 8))
-#define FPDF_GetRValue(argb) ((FX_BYTE)((argb)>>16))
-#define FPDF_GetAValue(argb) ((FX_BYTE)((argb)>>24))
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-//////////////////////////////////////////////////////////////////////
-//
-// Document functions
-//
-//////////////////////////////////////////////////////////////////////
-
-// Function: FPDF_CreateNewDocument
-// Create a new PDF document.
-// Parameters:
-// None.
-// Return value:
-// A handle to a document. If failed, NULL is returned.
-DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_CreateNewDocument();
-
-//////////////////////////////////////////////////////////////////////
-//
-// Page functions
-//
-//////////////////////////////////////////////////////////////////////
-
-// Function: FPDFPage_New
-// Construct an empty page.
-// Parameters:
-// document - Handle to document. Returned by FPDF_LoadDocument and FPDF_CreateNewDocument.
-// page_index - The index of a page.
-// width - The page width.
-// height - The page height.
-// Return value:
-// The handle to the page.
-// Comments:
-// Loaded page can be deleted by FPDFPage_Delete.
-DLLEXPORT FPDF_PAGE STDCALL FPDFPage_New(FPDF_DOCUMENT document, int page_index, double width, double height);
-
-// Function: FPDFPage_Delete
-// Delete a PDF page.
-// Parameters:
-// document - Handle to document. Returned by FPDF_LoadDocument and FPDF_CreateNewDocument.
-// page_index - The index of a page.
-// Return value:
-// None.
-DLLEXPORT void STDCALL FPDFPage_Delete(FPDF_DOCUMENT document, int page_index);
-
-// Function: FPDFPage_GetRotation
-// Get the page rotation. One of following values will be returned: 0(0), 1(90), 2(180), 3(270).
-// Parameters:
-// page - Handle to a page. Returned by FPDFPage_New.
-// Return value:
-// The PDF page rotation.
-// Comment:
-// The PDF page rotation is rotated clockwise.
-DLLEXPORT int STDCALL FPDFPage_GetRotation(FPDF_PAGE page);
-
-// Function: FPDFPage_InsertObject
-// Insert an object to the page. The page object is automatically freed.
-// Parameters:
-// page - Handle to a page. Returned by FPDFPage_New.
-// page_obj - Handle to a page object. Returned by FPDFPageObj_NewTextObj,FPDFPageObj_NewTextObjEx and
-// FPDFPageObj_NewPathObj.
-// Return value:
-// None.
-DLLEXPORT void STDCALL FPDFPage_InsertObject(FPDF_PAGE page, FPDF_PAGEOBJECT page_obj);
-
-// Function: FPDFPage_CountObject
-// Get number of page objects inside the page.
-// Parameters:
-// page - Handle to a page. Returned by FPDFPage_New.
-// Return value:
-// The number of the page object.
-DLLEXPORT int STDCALL FPDFPage_CountObject(FPDF_PAGE page);
-
-// Function: FPDFPage_GetObject
-// Get page object by index.
-// Parameters:
-// page - Handle to a page. Returned by FPDFPage_New.
-// index - The index of a page object.
-// Return value:
-// The handle of the page object. Null for failed.
-DLLEXPORT FPDF_PAGEOBJECT STDCALL FPDFPage_GetObject(FPDF_PAGE page, int index);
-
-// Function: FPDFPage_HasTransparency
-// Check that whether the content of specified PDF page contains transparency.
-// Parameters:
-// page - Handle to a page. Returned by FPDFPage_New or FPDF_LoadPage.
-// Return value:
-// TRUE means that the PDF page does contains transparency.
-// Otherwise, returns FALSE.
-DLLEXPORT FPDF_BOOL STDCALL FPDFPage_HasTransparency(FPDF_PAGE page);
-
-// Function: FPDFPage_GenerateContent
-// Generate PDF Page content.
-// Parameters:
-// page - Handle to a page. Returned by FPDFPage_New.
-// Return value:
-// True if successful, false otherwise.
-// Comment:
-// Before you save the page to a file, or reload the page, you must call the FPDFPage_GenerateContent function.
-// Or the changed information will be lost.
-DLLEXPORT FPDF_BOOL STDCALL FPDFPage_GenerateContent(FPDF_PAGE page);
-
-//////////////////////////////////////////////////////////////////////
-//
-// Page Object functions
-//
-//////////////////////////////////////////////////////////////////////
-
-// Function: FPDFPageObj_HasTransparency
-// Check that whether the specified PDF page object contains transparency.
-// Parameters:
-// pageObject - Handle to a page object.
-// Return value:
-// TRUE means that the PDF page object does contains transparency.
-// Otherwise, returns FALSE.
-DLLEXPORT FPDF_BOOL STDCALL FPDFPageObj_HasTransparency(FPDF_PAGEOBJECT pageObject);
-
-// Function: FPDFPageObj_Transform
-// Transform (scale, rotate, shear, move) page object.
-// Parameters:
-// page_object - Handle to a page object. Returned by FPDFPageObj_NewImageObj.
-// a - The coefficient "a" of the matrix.
-// b - The coefficient "b" of the matrix.
-// c - The coefficient "c" of the matrix.
-// d - The coefficient "d" of the matrix.
-// e - The coefficient "e" of the matrix.
-// f - The coefficient "f" of the matrix.
-// Return value:
-// None.
-DLLEXPORT void STDCALL FPDFPageObj_Transform(FPDF_PAGEOBJECT page_object,
- double a, double b, double c, double d, double e, double f);
-
-// Function: FPDFPage_TransformAnnots
-// Transform (scale, rotate, shear, move) all annots in a page.
-// Parameters:
-// page - Handle to a page.
-// a - The coefficient "a" of the matrix.
-// b - The coefficient "b" of the matrix.
-// c - The coefficient "c" of the matrix.
-// d - The coefficient "d" of the matrix.
-// e - The coefficient "e" of the matrix.
-// f - The coefficient "f" of the matrix.
-// Return value:
-// None.
-DLLEXPORT void STDCALL FPDFPage_TransformAnnots(FPDF_PAGE page,
- double a, double b, double c, double d, double e, double f);
-
-// The page object constants.
-#define FPDF_PAGEOBJ_TEXT 1
-#define FPDF_PAGEOBJ_PATH 2
-#define FPDF_PAGEOBJ_IMAGE 3
-#define FPDF_PAGEOBJ_SHADING 4
-#define FPDF_PAGEOBJ_FORM 5
-
-//////////////////////////////////////////////////////////////////////
-//
-// Image functions
-//
-//////////////////////////////////////////////////////////////////////
-
-// Function: FPDFPageObj_NewImgeObj
-// Create a new Image Object.
-// Parameters:
-// document - Handle to document. Returned by FPDF_LoadDocument or FPDF_CreateNewDocument function.
-// Return Value:
-// Handle of image object.
-DLLEXPORT FPDF_PAGEOBJECT STDCALL FPDFPageObj_NewImgeObj(FPDF_DOCUMENT document);
-
-
-// Function: FPDFImageObj_LoadJpegFile
-// Load Image from a JPEG image file and then set it to an image object.
-// Parameters:
-// pages - Pointers to the start of all loaded pages, could be NULL.
-// nCount - Number of pages, could be 0.
-// image_object - Handle of image object returned by FPDFPageObj_NewImgeObj.
-// fileAccess - The custom file access handler, which specifies the JPEG image file.
-// Return Value:
-// TRUE if successful, FALSE otherwise.
-// Note:
-// The image object might already has an associated image, which is shared and cached by the loaded pages, In this case, we need to clear the cache of image for all the loaded pages.
-// Pass pages and count to this API to clear the image cache.
-DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_LoadJpegFile(FPDF_PAGE* pages, int nCount,FPDF_PAGEOBJECT image_object, FPDF_FILEACCESS* fileAccess);
-
-
-// Function: FPDFImageObj_SetMatrix
-// Set the matrix of an image object.
-// Parameters:
-// image_object - Handle of image object returned by FPDFPageObj_NewImgeObj.
-// a - The coefficient "a" of the matrix.
-// b - The coefficient "b" of the matrix.
-// c - The coefficient "c" of the matrix.
-// d - The coefficient "d" of the matrix.
-// e - The coefficient "e" of the matrix.
-// f - The coefficient "f" of the matrix.
-// Return value:
-// TRUE if successful, FALSE otherwise.
-DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_SetMatrix(FPDF_PAGEOBJECT image_object,
- double a, double b, double c, double d, double e, double f);
-
-// Function: FPDFImageObj_SetBitmap
-// Set the bitmap to an image object.
-// Parameters:
-// pages - Pointer's to the start of all loaded pages.
-// nCount - Number of pages.
-// image_object - Handle of image object returned by FPDFPageObj_NewImgeObj.
-// bitmap - The handle of the bitmap which you want to set it to the image object.
-// Return value:
-// TRUE if successful, FALSE otherwise.
-DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_SetBitmap(FPDF_PAGE* pages,int nCount,FPDF_PAGEOBJECT image_object, FPDF_BITMAP bitmap);
-
-#ifdef __cplusplus
-}
-#endif
-#endif // _FPDFEDIT_H_
+// 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 _FPDFEDIT_H_
+#define _FPDFEDIT_H_
+
+#include "fpdfview.h"
+
+// Define all types used in the SDK. Note they can be simply regarded as opaque pointers
+// or long integer numbers.
+
+#define FPDF_ARGB(a,r,g,b) ((((FX_DWORD)(((FX_BYTE)(b)|((FX_WORD)((FX_BYTE)(g))<<8))|(((FX_DWORD)(FX_BYTE)(r))<<16)))) | (((FX_DWORD)(FX_BYTE)(a))<<24))
+#define FPDF_GetBValue(argb) ((FX_BYTE)(argb))
+#define FPDF_GetGValue(argb) ((FX_BYTE)(((FX_WORD)(argb)) >> 8))
+#define FPDF_GetRValue(argb) ((FX_BYTE)((argb)>>16))
+#define FPDF_GetAValue(argb) ((FX_BYTE)((argb)>>24))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+//////////////////////////////////////////////////////////////////////
+//
+// Document functions
+//
+//////////////////////////////////////////////////////////////////////
+
+// Function: FPDF_CreateNewDocument
+// Create a new PDF document.
+// Parameters:
+// None.
+// Return value:
+// A handle to a document. If failed, NULL is returned.
+DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_CreateNewDocument();
+
+//////////////////////////////////////////////////////////////////////
+//
+// Page functions
+//
+//////////////////////////////////////////////////////////////////////
+
+// Function: FPDFPage_New
+// Construct an empty page.
+// Parameters:
+// document - Handle to document. Returned by FPDF_LoadDocument and FPDF_CreateNewDocument.
+// page_index - The index of a page.
+// width - The page width.
+// height - The page height.
+// Return value:
+// The handle to the page.
+// Comments:
+// Loaded page can be deleted by FPDFPage_Delete.
+DLLEXPORT FPDF_PAGE STDCALL FPDFPage_New(FPDF_DOCUMENT document, int page_index, double width, double height);
+
+// Function: FPDFPage_Delete
+// Delete a PDF page.
+// Parameters:
+// document - Handle to document. Returned by FPDF_LoadDocument and FPDF_CreateNewDocument.
+// page_index - The index of a page.
+// Return value:
+// None.
+DLLEXPORT void STDCALL FPDFPage_Delete(FPDF_DOCUMENT document, int page_index);
+
+// Function: FPDFPage_GetRotation
+// Get the page rotation. One of following values will be returned: 0(0), 1(90), 2(180), 3(270).
+// Parameters:
+// page - Handle to a page. Returned by FPDFPage_New.
+// Return value:
+// The PDF page rotation.
+// Comment:
+// The PDF page rotation is rotated clockwise.
+DLLEXPORT int STDCALL FPDFPage_GetRotation(FPDF_PAGE page);
+
+// Function: FPDFPage_InsertObject
+// Insert an object to the page. The page object is automatically freed.
+// Parameters:
+// page - Handle to a page. Returned by FPDFPage_New.
+// page_obj - Handle to a page object. Returned by FPDFPageObj_NewTextObj,FPDFPageObj_NewTextObjEx and
+// FPDFPageObj_NewPathObj.
+// Return value:
+// None.
+DLLEXPORT void STDCALL FPDFPage_InsertObject(FPDF_PAGE page, FPDF_PAGEOBJECT page_obj);
+
+// Function: FPDFPage_CountObject
+// Get number of page objects inside the page.
+// Parameters:
+// page - Handle to a page. Returned by FPDFPage_New.
+// Return value:
+// The number of the page object.
+DLLEXPORT int STDCALL FPDFPage_CountObject(FPDF_PAGE page);
+
+// Function: FPDFPage_GetObject
+// Get page object by index.
+// Parameters:
+// page - Handle to a page. Returned by FPDFPage_New.
+// index - The index of a page object.
+// Return value:
+// The handle of the page object. Null for failed.
+DLLEXPORT FPDF_PAGEOBJECT STDCALL FPDFPage_GetObject(FPDF_PAGE page, int index);
+
+// Function: FPDFPage_HasTransparency
+// Check that whether the content of specified PDF page contains transparency.
+// Parameters:
+// page - Handle to a page. Returned by FPDFPage_New or FPDF_LoadPage.
+// Return value:
+// TRUE means that the PDF page does contains transparency.
+// Otherwise, returns FALSE.
+DLLEXPORT FPDF_BOOL STDCALL FPDFPage_HasTransparency(FPDF_PAGE page);
+
+// Function: FPDFPage_GenerateContent
+// Generate PDF Page content.
+// Parameters:
+// page - Handle to a page. Returned by FPDFPage_New.
+// Return value:
+// True if successful, false otherwise.
+// Comment:
+// Before you save the page to a file, or reload the page, you must call the FPDFPage_GenerateContent function.
+// Or the changed information will be lost.
+DLLEXPORT FPDF_BOOL STDCALL FPDFPage_GenerateContent(FPDF_PAGE page);
+
+//////////////////////////////////////////////////////////////////////
+//
+// Page Object functions
+//
+//////////////////////////////////////////////////////////////////////
+
+// Function: FPDFPageObj_HasTransparency
+// Check that whether the specified PDF page object contains transparency.
+// Parameters:
+// pageObject - Handle to a page object.
+// Return value:
+// TRUE means that the PDF page object does contains transparency.
+// Otherwise, returns FALSE.
+DLLEXPORT FPDF_BOOL STDCALL FPDFPageObj_HasTransparency(FPDF_PAGEOBJECT pageObject);
+
+// Function: FPDFPageObj_Transform
+// Transform (scale, rotate, shear, move) page object.
+// Parameters:
+// page_object - Handle to a page object. Returned by FPDFPageObj_NewImageObj.
+// a - The coefficient "a" of the matrix.
+// b - The coefficient "b" of the matrix.
+// c - The coefficient "c" of the matrix.
+// d - The coefficient "d" of the matrix.
+// e - The coefficient "e" of the matrix.
+// f - The coefficient "f" of the matrix.
+// Return value:
+// None.
+DLLEXPORT void STDCALL FPDFPageObj_Transform(FPDF_PAGEOBJECT page_object,
+ double a, double b, double c, double d, double e, double f);
+
+// Function: FPDFPage_TransformAnnots
+// Transform (scale, rotate, shear, move) all annots in a page.
+// Parameters:
+// page - Handle to a page.
+// a - The coefficient "a" of the matrix.
+// b - The coefficient "b" of the matrix.
+// c - The coefficient "c" of the matrix.
+// d - The coefficient "d" of the matrix.
+// e - The coefficient "e" of the matrix.
+// f - The coefficient "f" of the matrix.
+// Return value:
+// None.
+DLLEXPORT void STDCALL FPDFPage_TransformAnnots(FPDF_PAGE page,
+ double a, double b, double c, double d, double e, double f);
+
+// The page object constants.
+#define FPDF_PAGEOBJ_TEXT 1
+#define FPDF_PAGEOBJ_PATH 2
+#define FPDF_PAGEOBJ_IMAGE 3
+#define FPDF_PAGEOBJ_SHADING 4
+#define FPDF_PAGEOBJ_FORM 5
+
+//////////////////////////////////////////////////////////////////////
+//
+// Image functions
+//
+//////////////////////////////////////////////////////////////////////
+
+// Function: FPDFPageObj_NewImgeObj
+// Create a new Image Object.
+// Parameters:
+// document - Handle to document. Returned by FPDF_LoadDocument or FPDF_CreateNewDocument function.
+// Return Value:
+// Handle of image object.
+DLLEXPORT FPDF_PAGEOBJECT STDCALL FPDFPageObj_NewImgeObj(FPDF_DOCUMENT document);
+
+
+// Function: FPDFImageObj_LoadJpegFile
+// Load Image from a JPEG image file and then set it to an image object.
+// Parameters:
+// pages - Pointers to the start of all loaded pages, could be NULL.
+// nCount - Number of pages, could be 0.
+// image_object - Handle of image object returned by FPDFPageObj_NewImgeObj.
+// fileAccess - The custom file access handler, which specifies the JPEG image file.
+// Return Value:
+// TRUE if successful, FALSE otherwise.
+// Note:
+// The image object might already has an associated image, which is shared and cached by the loaded pages, In this case, we need to clear the cache of image for all the loaded pages.
+// Pass pages and count to this API to clear the image cache.
+DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_LoadJpegFile(FPDF_PAGE* pages, int nCount,FPDF_PAGEOBJECT image_object, FPDF_FILEACCESS* fileAccess);
+
+
+// Function: FPDFImageObj_SetMatrix
+// Set the matrix of an image object.
+// Parameters:
+// image_object - Handle of image object returned by FPDFPageObj_NewImgeObj.
+// a - The coefficient "a" of the matrix.
+// b - The coefficient "b" of the matrix.
+// c - The coefficient "c" of the matrix.
+// d - The coefficient "d" of the matrix.
+// e - The coefficient "e" of the matrix.
+// f - The coefficient "f" of the matrix.
+// Return value:
+// TRUE if successful, FALSE otherwise.
+DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_SetMatrix(FPDF_PAGEOBJECT image_object,
+ double a, double b, double c, double d, double e, double f);
+
+// Function: FPDFImageObj_SetBitmap
+// Set the bitmap to an image object.
+// Parameters:
+// pages - Pointer's to the start of all loaded pages.
+// nCount - Number of pages.
+// image_object - Handle of image object returned by FPDFPageObj_NewImgeObj.
+// bitmap - The handle of the bitmap which you want to set it to the image object.
+// Return value:
+// TRUE if successful, FALSE otherwise.
+DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_SetBitmap(FPDF_PAGE* pages,int nCount,FPDF_PAGEOBJECT image_object, FPDF_BITMAP bitmap);
+
+#ifdef __cplusplus
+}
+#endif
+#endif // _FPDFEDIT_H_
diff --git a/fpdfsdk/include/fpdfformfill.h b/fpdfsdk/include/fpdfformfill.h
index 0e7556e0a8..50a2dff66e 100644
--- a/fpdfsdk/include/fpdfformfill.h
+++ b/fpdfsdk/include/fpdfformfill.h
@@ -1,841 +1,841 @@
-// 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 _FPDFORMFILL_H
-#define _FPDFORMFILL_H
-#include "fpdfview.h"
-
-typedef void* FPDF_FORMHANDLE;
-
-// Exported Functions
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct _IPDF_JsPlatform
-{
-/**
-* Version number of the interface. Currently must be 1.
- **/
- int version;
-
- /**
- * Method: app_alert
- * pop up a dialog to show warning or hint.
- * Interface Version:
- * 1
- * Implementation Required:
- * yes
- * Parameters:
- * pThis - Pointer to the interface structure itself
- * Msg - A string containing the message to be displayed.
- * Title - The title of the dialog.
- * Type - The stype of button group.
- * 0-OK(default);
- * 1-OK,Cancel;
- * 2-Yes,NO;
- * 3-Yes, NO, Cancel.
- * nIcon - The Icon type.
- * 0-Error(default);
- * 1-Warning;
- * 2-Question;
- * 3-Status.
- * Return Value:
- * The return value could be the folowing type:
- * 1-OK;
- * 2-Cancel;
- * 3-NO;
- * 4-Yes;
- */
- int (*app_alert)(struct _IPDF_JsPlatform* pThis, FPDF_WIDESTRING Msg, FPDF_WIDESTRING Title, int Type, int Icon);
-
- /**
- * Method: app_beep
- * Causes the system to play a sound.
- * Interface Version:
- * 1
- * Implementation Required:
- * yes
- * Parameters:
- * pThis - Pointer to the interface structure itself
- * nType - The sound type.
- * 0 - Error
- * 1 - Warning
- * 2 - Question
- * 3 - Status
- * 4 - Default (default value)
- * Return Value:
- * None
- */
- void (*app_beep)(struct _IPDF_JsPlatform* pThis, int nType);
-
-
- /**
- * Method: app_response
- * Displays a dialog box containing a question and an entry field for the user to reply to the question.
- * Interface Version:
- * 1
- * Implementation Required:
- * yes
- * Parameters:
- * pThis - Pointer to the interface structure itself
- * Question - The question to be posed to the user.
- * Title - The title of the dialog box.
- * Default - A default value for the answer to the question. If not specified, no default value is presented.
- * cLabel - A short string to appear in front of and on the same line as the edit text field.
- * bPassword - If true, indicates that the user's response should show as asterisks (*) or bullets (?) to mask the response, which might be sensitive information. The default is false.
- * response - A string buffer allocated by SDK, to receive the user's response.
- * length - The length of the buffer, number of bytes. Currently, It's always be 2048.
- * Return Value:
- * Number of bytes the user input text consumes, not including trailing zeros. If the text exceed 2048 bytes,
- * the exceeded part will be ignored.
- * Comments:
- * No matter on what platform, the response should be always input in UTF-16LE encoding.
- * The return value always indicated number of bytes required for the buffer, even when there is
- * no buffer specified, or the buffer size is less then required. In this case, the buffer will not
- * be modified.
- */
- int (*app_response)(struct _IPDF_JsPlatform* pThis, FPDF_WIDESTRING Question, FPDF_WIDESTRING Title, FPDF_WIDESTRING Default, FPDF_WIDESTRING cLabel, FPDF_BOOL bPassword, void* response, int length);
-
-
-
- /*
- * Method: Doc_getFilePath
- * Get the file path of the current document.
- * Interface Version:
- * 1
- * Implementation Required:
- * yes
- * Parameters:
- * pThis - Pointer to the interface structure itself
- * filePath - The string buffer to receive the file path. Can be NULL.
- * length - The length of the buffer, number of bytes. Can be 0.
- * Return Value:
- * Number of bytes the filePath consumes, including trailing zeros.
- * Comments:
- * The filePath should be always input in local encoding.
- *
- * The return value always indicated number of bytes required for the buffer, even when there is
- * no buffer specified, or the buffer size is less then required. In this case, the buffer will not
- * be modified.
- */
- int (*Doc_getFilePath)(struct _IPDF_JsPlatform* pThis, void* filePath, int length);
-
-
- /*
- * Method: Doc_mail
- * Mails the data buffer as an attachment to all recipients, with or without user interaction.
- * Interface Version:
- * 1
- * Implementation Required:
- * yes
- * Parameters:
- * pThis - Pointer to the interface structure itself
- * mailData - Pointer to the data buffer to be sent.Can be NULL.
- * length - The size,in bytes, of the buffer pointed by mailData parameter.Can be 0.
- * bUI - If true, the rest of the parameters are used in a compose-new-message window that is displayed to the user. If false, the cTo parameter is required and all others are optional.
- * To - A semicolon-delimited list of recipients for the message.
- * Subject - The subject of the message. The length limit is 64 KB.
- * CC - A semicolon-delimited list of CC recipients for the message.
- * BCC - A semicolon-delimited list of BCC recipients for the message.
- * Msg - The content of the message. The length limit is 64 KB.
- * Return Value:
- * None.
- * Comments:
- * If the parameter mailData is NULL or length is 0, the current document will be mailed as an attachment to all recipients.
- */
- void (*Doc_mail)(struct _IPDF_JsPlatform* pThis,void* mailData, int length,FPDF_BOOL bUI, FPDF_WIDESTRING To, FPDF_WIDESTRING Subject, FPDF_WIDESTRING CC, FPDF_WIDESTRING BCC, FPDF_WIDESTRING Msg);
-
-
- /*
- * Method: Doc_print
- * Prints all or a specific number of pages of the document.
- * Interface Version:
- * 1
- * Implementation Required:
- * yes
- * Parameters:
- * pThis - Pointer to the interface structure itself.
- * bUI - If true, will cause a UI to be presented to the user to obtain printing information and confirm the action.
- * nStart - A 0-based index that defines the start of an inclusive range of pages.
- * nEnd - A 0-based index that defines the end of an inclusive page range.
- * bSilent - If true, suppresses the cancel dialog box while the document is printing. The default is false.
- * bShrinkToFit - If true, the page is shrunk (if necessary) to fit within the imageable area of the printed page.
- * bPrintAsImage - If true, print pages as an image.
- * bReverse - If true, print from nEnd to nStart.
- * bAnnotations - If true (the default), annotations are printed.
- */
- void (*Doc_print)(struct _IPDF_JsPlatform* pThis, FPDF_BOOL bUI, int nStart, int nEnd, FPDF_BOOL bSilent ,FPDF_BOOL bShrinkToFit,FPDF_BOOL bPrintAsImage ,FPDF_BOOL bReverse ,FPDF_BOOL bAnnotations);
-
- /*
- * Method: Doc_submitForm
- * Send the form data to a specified URL.
- * Interface Version:
- * 1
- * Implementation Required:
- * yes
- * Parameters:
- * pThis - Pointer to the interface structure itself
- * formData - Pointer to the data buffer to be sent.
- * length - The size,in bytes, of the buffer pointed by formData parameter.
- * URL - The URL to send to.
- * Return Value:
- * None.
- *
- */
- void (*Doc_submitForm)(struct _IPDF_JsPlatform* pThis,void* formData, int length, FPDF_WIDESTRING URL);
-
- /*
- * Method: Doc_gotoPage
- * Jump to a specified page.
- * Interface Version:
- * 1
- * Implementation Required:
- * yes
- * Parameters:
- * pThis - Pointer to the interface structure itself
- * nPageNum - The specified page number, zero for the first page.
- * Return Value:
- * None.
- *
- */
- void (*Doc_gotoPage)(struct _IPDF_JsPlatform* pThis, int nPageNum);
- /*
- * Method: Field_browse
- * Show a file selection dialog, and return the selected file path.
- * Interface Version:
- * 1
- * Implementation Required:
- * yes
- * Parameters:
- * pThis - Pointer to the interface structure itself.
- * filePath - Pointer to the data buffer to receive the file path.Can be NULL.
- * length - The length of the buffer, number of bytes. Can be 0.
- * Return Value:
- * Number of bytes the filePath consumes, including trailing zeros.
- * Comments:
- * The filePath shoule be always input in local encoding.
- */
- int (*Field_browse)(struct _IPDF_JsPlatform* pThis,void* filePath, int length);
-
- /**
- * pointer to FPDF_FORMFILLINFO interface.
- **/
- void* m_pFormfillinfo;
-} IPDF_JSPLATFORM;
-
-// Flags for Cursor type
-#define FXCT_ARROW 0
-#define FXCT_NESW 1
-#define FXCT_NWSE 2
-#define FXCT_VBEAM 3
-#define FXCT_HBEAM 4
-#define FXCT_HAND 5
-
-/**
- * Declares of a pointer type to the callback function for the FFI_SetTimer method.
- * Parameters:
- * idEvent - Identifier of the timer.
- * Return value:
- * None.
- **/
-typedef void (*TimerCallback)(int idEvent);
-
-/**
- * Declares of a struct type to the local system time.
-**/
-typedef struct _FPDF_SYSTEMTIME
-{
- unsigned short wYear; /* years since 1900 */
- unsigned short wMonth; /* months since January - [0,11] */
- unsigned short wDayOfWeek; /* days since Sunday - [0,6] */
- unsigned short wDay; /* day of the month - [1,31] */
- unsigned short wHour; /* hours since midnight - [0,23] */
- unsigned short wMinute; /* minutes after the hour - [0,59] */
- unsigned short wSecond; /* seconds after the minute - [0,59] */
- unsigned short wMilliseconds; /* milliseconds after the second - [0,999] */
-}FPDF_SYSTEMTIME;
-
-
-typedef struct _FPDF_FORMFILLINFO
-{
- /**
- * Version number of the interface. Currently must be 1.
- **/
- int version;
-
- /**
- * Method: Release
- * Give implementation a chance to release any data after the interface is no longer used
- * Interface Version:
- * 1
- * Implementation Required:
- * No
- * Comments:
- * Called by Foxit SDK during the final cleanup process.
- * Parameters:
- * pThis - Pointer to the interface structure itself
- * Return Value:
- * None
- */
-
- void (*Release)(struct _FPDF_FORMFILLINFO* pThis);
-
- /**
- * Method: FFI_Invalidate
- * Invalidate the client area within the specified rectangle.
- * Interface Version:
- * 1
- * Implementation Required:
- * yes
- * Parameters:
- * pThis - Pointer to the interface structure itself.
- * page - Handle to the page. Returned by FPDF_LoadPage function.
- * left - Left position of the client area in PDF page coordinate.
- * top - Top position of the client area in PDF page coordinate.
- * right - Right position of the client area in PDF page coordinate.
- * bottom - Bottom position of the client area in PDF page coordinate.
- * Return Value:
- * None.
- *
- *comments:
- * All positions are measured in PDF "user space".
- * Implementation should call FPDF_RenderPageBitmap() function for repainting a specified page area.
- */
- void (*FFI_Invalidate)(struct _FPDF_FORMFILLINFO* pThis,FPDF_PAGE page, double left, double top, double right, double bottom);
-
- /**
- * Method: FFI_OutputSelectedRect
- * When user is taking the mouse to select texts on a form field, this callback function will keep
- * returning the selected areas to the implementation.
- *
- * Interface Version:
- * 1
- * Implementation Required:
- * No
- * Parameters:
- * pThis - Pointer to the interface structure itself.
- * page - Handle to the page. Returned by FPDF_LoadPage function.
- * left - Left position of the client area in PDF page coordinate.
- * top - Top position of the client area in PDF page coordinate.
- * right - Right position of the client area in PDF page coordinate.
- * bottom - Bottom position of the client area in PDF page coordinate.
- * Return Value:
- * None.
- *
- * comments:
- * This CALLBACK function is useful for implementing special text selection effect. Implementation should
- * first records the returned rectangles, then draw them one by one at the painting period, last,remove all
- * the recorded rectangles when finish painting.
- */
- void (*FFI_OutputSelectedRect)(struct _FPDF_FORMFILLINFO* pThis,FPDF_PAGE page, double left, double top, double right, double bottom);
-
- /**
- * Method: FFI_SetCursor
- * Set the Cursor shape.
- * Interface Version:
- * 1
- * Implementation Required:
- * yes
- * Parameters:
- * pThis - Pointer to the interface structure itself.
- * nCursorType - Cursor type. see Flags for Cursor type for the details.
- * Return value:
- * None.
- * */
- void (*FFI_SetCursor)(struct _FPDF_FORMFILLINFO* pThis, int nCursorType);
-
- /**
- * Method: FFI_SetTimer
- * This method installs a system timer. A time-out value is specified,
- * and every time a time-out occurs, the system passes a message to
- * the TimerProc callback function.
- * Interface Version:
- * 1
- * Implementation Required:
- * yes
- * Parameters:
- * pThis - Pointer to the interface structure itself.
- * uElapse - Specifies the time-out value, in milliseconds.
- * lpTimerFunc - A pointer to the callback function-TimerCallback.
- * Return value:
- * The timer identifier of the new timer if the function is successful.
- * An application passes this value to the FFI_KillTimer method to kill
- * the timer. Nonzero if it is successful; otherwise, it is zero.
- * */
- int (*FFI_SetTimer)(struct _FPDF_FORMFILLINFO* pThis, int uElapse, TimerCallback lpTimerFunc);
-
- /**
- * Method: FFI_KillTimer
- * This method kills the timer event identified by nIDEvent, set by an earlier call to FFI_SetTimer.
- * Interface Version:
- * 1
- * Implementation Required:
- * yes
- * Parameters:
- * pThis - Pointer to the interface structure itself.
- * nTimerID - The timer ID return by FFI_SetTimer function.
- * Return value:
- * None.
- * */
- void (*FFI_KillTimer)(struct _FPDF_FORMFILLINFO* pThis, int nTimerID);
-
-
- /**
- * Method: FFI_GetLocalTime
- * This method receives the current local time on the system.
- * Interface Version:
- * 1
- * Implementation Required:
- * yes
- * Parameters:
- * pThis - Pointer to the interface structure itself.
- * Return value:
- * None.
- * */
- FPDF_SYSTEMTIME (*FFI_GetLocalTime)(struct _FPDF_FORMFILLINFO* pThis);
-
- /**
- * Method: FFI_OnChange
- * This method will be invoked to notify implementation when the value of any FormField on the document had been changed.
- * Interface Version:
- * 1
- * Implementation Required:
- * no
- * Parameters:
- * pThis - Pointer to the interface structure itself.
- * Return value:
- * None.
- * */
- void (*FFI_OnChange)(struct _FPDF_FORMFILLINFO* pThis);
-
- /**
- * Method: FFI_GetPage
- * This method receives the page pointer associated with a specified page index.
- * Interface Version:
- * 1
- * Implementation Required:
- * yes
- * Parameters:
- * pThis - Pointer to the interface structure itself.
- * document - Handle to document. Returned by FPDF_LoadDocument function.
- * nPageIndex - Index number of the page. 0 for the first page.
- * Return value:
- * Handle to the page. Returned by FPDF_LoadPage function.
- * Comments:
- * In some cases, the document-level JavaScript action may refer to a page which hadn't been loaded yet.
- * To successfully run the javascript action, implementation need to load the page for SDK.
- * */
- FPDF_PAGE (*FFI_GetPage)(struct _FPDF_FORMFILLINFO* pThis, FPDF_DOCUMENT document, int nPageIndex);
-
- /**
- * Method: FFI_GetCurrentPage
- * This method receives the current page pointer.
- * Interface Version:
- * 1
- * Implementation Required:
- * yes
- * Parameters:
- * pThis - Pointer to the interface structure itself.
- * document - Handle to document. Returned by FPDF_LoadDocument function.
- * Return value:
- * Handle to the page. Returned by FPDF_LoadPage function.
- * */
- FPDF_PAGE (*FFI_GetCurrentPage)(struct _FPDF_FORMFILLINFO* pThis, FPDF_DOCUMENT document);
-
- /**
- * Method: FFI_GetRotation
- * This method receives currently rotation of the page view.
- * Interface Version:
- * 1
- * Implementation Required:
- * yes
- * Parameters:
- * pThis - Pointer to the interface structure itself.
- * page - Handle to page. Returned by FPDF_LoadPage function.
- * Return value:
- * The page rotation. Should be 0(0 degree),1(90 degree),2(180 degree),3(270 degree), in a clockwise direction.
- * */
- int (*FFI_GetRotation)(struct _FPDF_FORMFILLINFO* pThis, FPDF_PAGE page);
-
- /**
- * Method: FFI_ExecuteNamedAction
- * This method will execute an named action.
- * Interface Version:
- * 1
- * Implementation Required:
- * yes
- * Parameters:
- * pThis - Pointer to the interface structure itself.
- * namedAction - A byte string which indicates the named action, terminated by 0.
- * Return value:
- * None.
- * Comments:
- * See the named actions description of <<PDF Reference, version 1.7>> for more details.
- * */
- void (*FFI_ExecuteNamedAction)(struct _FPDF_FORMFILLINFO* pThis, FPDF_BYTESTRING namedAction);
- /**
- * @brief This method will be called when a text field is getting or losing a focus.
- *
- * @param[in] pThis Pointer to the interface structure itself.
- * @param[in] value The string value of the form field, in UTF-16LE format.
- * @param[in] valueLen The length of the string value, number of characters (not bytes).
- * @param[in] is_focus True if the form field is getting a focus, False for losing a focus.
- *
- * @return None.
- *
- * @note Currently,only support text field and combobox field.
- * */
- void (*FFI_SetTextFieldFocus)(struct _FPDF_FORMFILLINFO* pThis, FPDF_WIDESTRING value, FPDF_DWORD valueLen, FPDF_BOOL is_focus);
-
-
- /**
- * Method: FFI_DoURIAction
- * This action resolves to a uniform resource identifier.
- * Interface Version:
- * 1
- * Implementation Required:
- * No
- * Parameters:
- * pThis - Pointer to the interface structure itself.
- * bsURI - A byte string which indicates the uniform resource identifier, terminated by 0.
- * Return value:
- * None.
- * Comments:
- * See the URI actions description of <<PDF Reference, version 1.7>> for more details.
- * */
- void (*FFI_DoURIAction)(struct _FPDF_FORMFILLINFO* pThis, FPDF_BYTESTRING bsURI);
-
- /**
- * Method: FFI_DoGoToAction
- * This action changes the view to a specified destination.
- * Interface Version:
- * 1
- * Implementation Required:
- * No
- * Parameters:
- * pThis - Pointer to the interface structure itself.
- * nPageIndex - The index of the PDF page.
- * zoomMode - The zoom mode for viewing page.See Macros "PDFZOOM_XXX" defined in "fpdfdoc.h".
- * fPosArray - The float array which carries the position info.
- * sizeofArray - The size of float array.
- * Return value:
- * None.
- * Comments:
- * See the Destinations description of <<PDF Reference, version 1.7>> in 8.2.1 for more details.
- **/
- void (*FFI_DoGoToAction)(struct _FPDF_FORMFILLINFO* pThis, int nPageIndex, int zoomMode, float* fPosArray, int sizeofArray);
- /**
- * pointer to IPDF_JSPLATFORM interface
- **/
- IPDF_JSPLATFORM* m_pJsPlatform;
-
-} FPDF_FORMFILLINFO;
-
-
-
-/**
- * Function: FPDFDOC_InitFormFillEnviroument
- * Init form fill environment.
- * Comments:
- * This function should be called before any form fill operation.
- * Parameters:
- * document - Handle to document. Returned by FPDF_LoadDocument function.
- * pFormFillInfo - Pointer to a FPDF_FORMFILLINFO structure.
- * Return Value:
- * Return handler to the form fill module. NULL means fails.
- **/
-DLLEXPORT FPDF_FORMHANDLE STDCALL FPDFDOC_InitFormFillEnviroument(FPDF_DOCUMENT document, FPDF_FORMFILLINFO* formInfo);
-
-/**
- * Function: FPDFDOC_ExitFormFillEnviroument
- * Exit form fill environment.
- * Parameters:
- * hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnviroument.
- * Return Value:
- * NULL.
- **/
-DLLEXPORT void STDCALL FPDFDOC_ExitFormFillEnviroument(FPDF_FORMHANDLE hHandle);
-
-/**
- * Function: FORM_OnAfterLoadPage
- * This method is required for implementing all the form related functions. Should be invoked after user
- * successfully loaded a PDF page, and method FPDFDOC_InitFormFillEnviroument had been invoked.
- * Parameters:
- * hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnviroument.
- * Return Value:
- * NONE.
- **/
-DLLEXPORT void STDCALL FORM_OnAfterLoadPage(FPDF_PAGE page, FPDF_FORMHANDLE hHandle);
-
-/**
- * Function: FORM_OnBeforeClosePage
- * This method is required for implementing all the form related functions. Should be invoked before user
- * close the PDF page.
- * Parameters:
- * page - Handle to the page. Returned by FPDF_LoadPage function.
- * hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnviroument.
- * Return Value:
- * NONE.
- **/
-DLLEXPORT void STDCALL FORM_OnBeforeClosePage(FPDF_PAGE page, FPDF_FORMHANDLE hHandle);
-
-/**
-* Function: FORM_DoDocumentJSAction
-* This method is required for performing Document-level JavaScript action. It should be invoked after the PDF document
-* had been loaded.
-* Parameters:
-* hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnviroument.
-* Return Value:
-* NONE
-* Comments:
-* If there is Document-level JavaScript action embedded in the document, this method will execute the javascript action;
-* otherwise, the method will do nothing.
-**/
-DLLEXPORT void STDCALL FORM_DoDocumentJSAction(FPDF_FORMHANDLE hHandle);
-
-
-/**
-* Function: FORM_DoDocumentOpenAction
-* This method is required for performing open-action when the document is opened.
-* Parameters:
-* hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnviroument.
-* Return Value:
-* NONE
-* Comments:
-* This method will do nothing if there is no open-actions embedded in the document.
-**/
-DLLEXPORT void STDCALL FORM_DoDocumentOpenAction(FPDF_FORMHANDLE hHandle);
-
-
-// additional actions type of document.
-#define FPDFDOC_AACTION_WC 0x10 //WC, before closing document, JavaScript action.
-#define FPDFDOC_AACTION_WS 0x11 //WS, before saving document, JavaScript action.
-#define FPDFDOC_AACTION_DS 0x12 //DS, after saving document, JavaScript action.
-#define FPDFDOC_AACTION_WP 0x13 //WP, before printing document, JavaScript action.
-#define FPDFDOC_AACTION_DP 0x14 //DP, after printing document, JavaScript action.
-/**
-* Function: FORM_DoDocumentAAction
-* This method is required for performing the document's additional-action.
-* Parameters:
-* hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnviroument.
-* aaType - The type of the additional-actions which defined above.
-* Return Value:
-* NONE
-* Comments:
-* This method will do nothing if there is no document additional-action corresponding to the specified aaType.
-**/
-
-DLLEXPORT void STDCALL FORM_DoDocumentAAction(FPDF_FORMHANDLE hHandle, int aaType);
-
-// Additional-action types of page object
-#define FPDFPAGE_AACTION_OPEN 0 // /O -- An action to be performed when the page is opened
-#define FPDFPAGE_AACTION_CLOSE 1 // /C -- An action to be performed when the page is closed
-
-/**
-* Function: FORM_DoPageAAction
-* This method is required for performing the page object's additional-action when opened or closed.
-* Parameters:
-* page - Handle to the page. Returned by FPDF_LoadPage function.
-* hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnviroument.
-* aaType - The type of the page object's additional-actions which defined above.
-* Return Value:
-* NONE
-* Comments:
-* This method will do nothing if no additional-action corresponding to the specified aaType exists.
-**/
-DLLEXPORT void STDCALL FORM_DoPageAAction(FPDF_PAGE page, FPDF_FORMHANDLE hHandle, int aaType);
-
-/**
- * Function: FORM_OnMouseMove
- * You can call this member function when the mouse cursor moves.
- * Parameters:
- * hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnviroument.
- * page - Handle to the page. Returned by FPDF_LoadPage function.
- * modifier - Indicates whether various virtual keys are down.
- * page_x - Specifies the x-coordinate of the cursor in PDF user space.
- * page_y - Specifies the y-coordinate of the cursor in PDF user space.
- * Return Value:
- * TRUE indicates success; otherwise false.
- **/
-DLLEXPORT FPDF_BOOL STDCALL FORM_OnMouseMove(FPDF_FORMHANDLE hHandle,FPDF_PAGE page, int modifier, double page_x, double page_y);
-
-/**
- * Function: FORM_OnLButtonDown
- * You can call this member function when the user presses the left mouse button.
- * Parameters:
- * hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnviroument.
- * page - Handle to the page. Returned by FPDF_LoadPage function.
- * modifier - Indicates whether various virtual keys are down.
- * page_x - Specifies the x-coordinate of the cursor in PDF user space.
- * page_y - Specifies the y-coordinate of the cursor in PDF user space.
- * Return Value:
- * TRUE indicates success; otherwise false.
- **/
-DLLEXPORT FPDF_BOOL STDCALL FORM_OnLButtonDown(FPDF_FORMHANDLE hHandle,FPDF_PAGE page, int modifier, double page_x, double page_y);
-
-/**
- * Function: FORM_OnLButtonUp
- * You can call this member function when the user releases the left mouse button.
- * Parameters:
- * hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnviroument.
- * page - Handle to the page. Returned by FPDF_LoadPage function.
- * modifier - Indicates whether various virtual keys are down.
- * page_x - Specifies the x-coordinate of the cursor in device.
- * page_y - Specifies the y-coordinate of the cursor in device.
- * Return Value:
- * TRUE indicates success; otherwise false.
- **/
-DLLEXPORT FPDF_BOOL STDCALL FORM_OnLButtonUp(FPDF_FORMHANDLE hHandle,FPDF_PAGE page, int modifier, double page_x, double page_y);
-
-/**
- * Function: FORM_OnKeyDown
- * You can call this member function when a nonsystem key is pressed.
- * Parameters:
- * hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnviroument.
- * page - Handle to the page. Returned by FPDF_LoadPage function.
- * nKeyCode - Indicates whether various virtual keys are down.
- * modifier - Contains the scan code, key-transition code, previous key state, and context code.
- * Return Value:
- * TRUE indicates success; otherwise false.
- **/
-DLLEXPORT FPDF_BOOL STDCALL FORM_OnKeyDown(FPDF_FORMHANDLE hHandle,FPDF_PAGE page, int nKeyCode, int modifier);
-
-/**
- * Function: FORM_OnKeyUp
- * You can call this member function when a nonsystem key is released.
- * Parameters:
- * hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnviroument.
- * page - Handle to the page. Returned by FPDF_LoadPage function.
- * nKeyCode - The virtual-key code of the given key.
- * modifier - Contains the scan code, key-transition code, previous key state, and context code.
- * Return Value:
- * TRUE indicates success; otherwise false.
- **/
-DLLEXPORT FPDF_BOOL STDCALL FORM_OnKeyUp(FPDF_FORMHANDLE hHandle,FPDF_PAGE page, int nKeyCode, int modifier);
-
-/**
- * Function: FORM_OnChar
- * You can call this member function when a keystroke translates to a nonsystem character.
- * Parameters:
- * hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnviroument.
- * page - Handle to the page. Returned by FPDF_LoadPage function.
- * nChar - The character code value of the key.
- * modifier - Contains the scan code, key-transition code, previous key state, and context code.
- * Return Value:
- * TRUE indicates success; otherwise false.
- **/
-DLLEXPORT FPDF_BOOL STDCALL FORM_OnChar(FPDF_FORMHANDLE hHandle,FPDF_PAGE page, int nChar, int modifier);
-
-/**
- * Function: FORM_ForceToKillFocus.
- * You can call this member function to force to kill the focus of the form field which got focus.
- * It would kill the focus on the form field, save the value of form field if it's changed by user.
- * Parameters:
- * hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnviroument.
- * Return Value:
- * TRUE indicates success; otherwise false.
- **/
-DLLEXPORT FPDF_BOOL STDCALL FORM_ForceToKillFocus(FPDF_FORMHANDLE hHandle);
-
-// Field Types
-#define FPDF_FORMFIELD_UNKNOWN 0 // Unknown.
-#define FPDF_FORMFIELD_PUSHBUTTON 1 // push button type.
-#define FPDF_FORMFIELD_CHECKBOX 2 // check box type.
-#define FPDF_FORMFIELD_RADIOBUTTON 3 // radio button type.
-#define FPDF_FORMFIELD_COMBOBOX 4 // combo box type.
-#define FPDF_FORMFIELD_LISTBOX 5 // list box type.
-#define FPDF_FORMFIELD_TEXTFIELD 6 // text field type.
-
-/**
- * Function: FPDPage_HasFormFieldAtPoint
- * Check the form filed position by point.
- * Parameters:
- * hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnviroument.
- * page - Handle to the page. Returned by FPDF_LoadPage function.
- * page_x - X position in PDF "user space".
- * page_y - Y position in PDF "user space".
- * Return Value:
- * Return the type of the formfiled; -1 indicates no fields.
- **/
-DLLEXPORT int STDCALL FPDPage_HasFormFieldAtPoint(FPDF_FORMHANDLE hHandle,FPDF_PAGE page,double page_x, double page_y);
-
-/**
- * Function: FPDF_SetFormFieldHighlightColor
- * Set the highlight color of specified or all the form fields in the document.
- * Parameters:
- * hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnviroument.
- * doc - Handle to the document. Returned by FPDF_LoadDocument function.
- * fieldType - A 32-bit integer indicating the type of a form field(defined above).
- * color - The highlight color of the form field.Constructed by 0xxxrrggbb.
- * Return Value:
- * NONE.
- * Comments:
- * When the parameter fieldType is set to zero, the highlight color will be applied to all the form fields in the
- * document.
- * Please refresh the client window to show the highlight immediately if necessary.
- **/
-DLLEXPORT void STDCALL FPDF_SetFormFieldHighlightColor(FPDF_FORMHANDLE hHandle, int fieldType, unsigned long color);
-
-/**
- * Function: FPDF_SetFormFieldHighlightAlpha
- * Set the transparency of the form field highlight color in the document.
- * Parameters:
- * hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnviroument.
- * doc - Handle to the document. Returned by FPDF_LoadDocument function.
- * alpha - The transparency of the form field highlight color. between 0-255.
- * Return Value:
- * NONE.
- **/
-DLLEXPORT void STDCALL FPDF_SetFormFieldHighlightAlpha(FPDF_FORMHANDLE hHandle, unsigned char alpha);
-
-
-/**
- * Function: FPDF_RemoveFormFieldHighlight
- * Remove the form field highlight color in the document.
- * Parameters:
- * hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnviroument.
- * Return Value:
- * NONE.
- * Comments:
- * Please refresh the client window to remove the highlight immediately if necessary.
- **/
-DLLEXPORT void STDCALL FPDF_RemoveFormFieldHighlight(FPDF_FORMHANDLE hHandle);
-
-/**
-* Function: FPDF_FFLDraw
-* Render FormFeilds on a page to a device independent bitmap.
-* Parameters:
-* hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnviroument.
-* bitmap - Handle to the device independent bitmap (as the output buffer).
-* Bitmap handle can be created by FPDFBitmap_Create function.
-* page - Handle to the page. Returned by FPDF_LoadPage function.
-* start_x - Left pixel position of the display area in the device coordinate.
-* start_y - Top pixel position of the display area in the device coordinate.
-* size_x - Horizontal size (in pixels) for displaying the page.
-* size_y - Vertical size (in pixels) for displaying the page.
-* rotate - Page orientation: 0 (normal), 1 (rotated 90 degrees clockwise),
-* 2 (rotated 180 degrees), 3 (rotated 90 degrees counter-clockwise).
-* flags - 0 for normal display, or combination of flags defined above.
-* Return Value:
-* None.
-* Comments:
-* This method is designed to only render annotations and FormFields on the page.
-* Without FPDF_ANNOT specified for flags, Rendering functions such as FPDF_RenderPageBitmap or FPDF_RenderPageBitmap_Start will only render page contents(without annotations) to a bitmap.
-* In order to implement the FormFill functions,Implementation should call this method after rendering functions finish rendering the page contents.
-**/
-DLLEXPORT void STDCALL FPDF_FFLDraw(FPDF_FORMHANDLE hHandle,FPDF_BITMAP bitmap, FPDF_PAGE page, int start_x, int start_y,
- int size_x, int size_y, int rotate, int flags);
-
-
-
-#ifdef __cplusplus
-};
-#endif
-
-#endif //_FPDFORMFILL_H
-
+// 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 _FPDFORMFILL_H
+#define _FPDFORMFILL_H
+#include "fpdfview.h"
+
+typedef void* FPDF_FORMHANDLE;
+
+// Exported Functions
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct _IPDF_JsPlatform
+{
+/**
+* Version number of the interface. Currently must be 1.
+ **/
+ int version;
+
+ /**
+ * Method: app_alert
+ * pop up a dialog to show warning or hint.
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * yes
+ * Parameters:
+ * pThis - Pointer to the interface structure itself
+ * Msg - A string containing the message to be displayed.
+ * Title - The title of the dialog.
+ * Type - The stype of button group.
+ * 0-OK(default);
+ * 1-OK,Cancel;
+ * 2-Yes,NO;
+ * 3-Yes, NO, Cancel.
+ * nIcon - The Icon type.
+ * 0-Error(default);
+ * 1-Warning;
+ * 2-Question;
+ * 3-Status.
+ * Return Value:
+ * The return value could be the folowing type:
+ * 1-OK;
+ * 2-Cancel;
+ * 3-NO;
+ * 4-Yes;
+ */
+ int (*app_alert)(struct _IPDF_JsPlatform* pThis, FPDF_WIDESTRING Msg, FPDF_WIDESTRING Title, int Type, int Icon);
+
+ /**
+ * Method: app_beep
+ * Causes the system to play a sound.
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * yes
+ * Parameters:
+ * pThis - Pointer to the interface structure itself
+ * nType - The sound type.
+ * 0 - Error
+ * 1 - Warning
+ * 2 - Question
+ * 3 - Status
+ * 4 - Default (default value)
+ * Return Value:
+ * None
+ */
+ void (*app_beep)(struct _IPDF_JsPlatform* pThis, int nType);
+
+
+ /**
+ * Method: app_response
+ * Displays a dialog box containing a question and an entry field for the user to reply to the question.
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * yes
+ * Parameters:
+ * pThis - Pointer to the interface structure itself
+ * Question - The question to be posed to the user.
+ * Title - The title of the dialog box.
+ * Default - A default value for the answer to the question. If not specified, no default value is presented.
+ * cLabel - A short string to appear in front of and on the same line as the edit text field.
+ * bPassword - If true, indicates that the user's response should show as asterisks (*) or bullets (?) to mask the response, which might be sensitive information. The default is false.
+ * response - A string buffer allocated by SDK, to receive the user's response.
+ * length - The length of the buffer, number of bytes. Currently, It's always be 2048.
+ * Return Value:
+ * Number of bytes the user input text consumes, not including trailing zeros. If the text exceed 2048 bytes,
+ * the exceeded part will be ignored.
+ * Comments:
+ * No matter on what platform, the response should be always input in UTF-16LE encoding.
+ * The return value always indicated number of bytes required for the buffer, even when there is
+ * no buffer specified, or the buffer size is less then required. In this case, the buffer will not
+ * be modified.
+ */
+ int (*app_response)(struct _IPDF_JsPlatform* pThis, FPDF_WIDESTRING Question, FPDF_WIDESTRING Title, FPDF_WIDESTRING Default, FPDF_WIDESTRING cLabel, FPDF_BOOL bPassword, void* response, int length);
+
+
+
+ /*
+ * Method: Doc_getFilePath
+ * Get the file path of the current document.
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * yes
+ * Parameters:
+ * pThis - Pointer to the interface structure itself
+ * filePath - The string buffer to receive the file path. Can be NULL.
+ * length - The length of the buffer, number of bytes. Can be 0.
+ * Return Value:
+ * Number of bytes the filePath consumes, including trailing zeros.
+ * Comments:
+ * The filePath should be always input in local encoding.
+ *
+ * The return value always indicated number of bytes required for the buffer, even when there is
+ * no buffer specified, or the buffer size is less then required. In this case, the buffer will not
+ * be modified.
+ */
+ int (*Doc_getFilePath)(struct _IPDF_JsPlatform* pThis, void* filePath, int length);
+
+
+ /*
+ * Method: Doc_mail
+ * Mails the data buffer as an attachment to all recipients, with or without user interaction.
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * yes
+ * Parameters:
+ * pThis - Pointer to the interface structure itself
+ * mailData - Pointer to the data buffer to be sent.Can be NULL.
+ * length - The size,in bytes, of the buffer pointed by mailData parameter.Can be 0.
+ * bUI - If true, the rest of the parameters are used in a compose-new-message window that is displayed to the user. If false, the cTo parameter is required and all others are optional.
+ * To - A semicolon-delimited list of recipients for the message.
+ * Subject - The subject of the message. The length limit is 64 KB.
+ * CC - A semicolon-delimited list of CC recipients for the message.
+ * BCC - A semicolon-delimited list of BCC recipients for the message.
+ * Msg - The content of the message. The length limit is 64 KB.
+ * Return Value:
+ * None.
+ * Comments:
+ * If the parameter mailData is NULL or length is 0, the current document will be mailed as an attachment to all recipients.
+ */
+ void (*Doc_mail)(struct _IPDF_JsPlatform* pThis,void* mailData, int length,FPDF_BOOL bUI, FPDF_WIDESTRING To, FPDF_WIDESTRING Subject, FPDF_WIDESTRING CC, FPDF_WIDESTRING BCC, FPDF_WIDESTRING Msg);
+
+
+ /*
+ * Method: Doc_print
+ * Prints all or a specific number of pages of the document.
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * yes
+ * Parameters:
+ * pThis - Pointer to the interface structure itself.
+ * bUI - If true, will cause a UI to be presented to the user to obtain printing information and confirm the action.
+ * nStart - A 0-based index that defines the start of an inclusive range of pages.
+ * nEnd - A 0-based index that defines the end of an inclusive page range.
+ * bSilent - If true, suppresses the cancel dialog box while the document is printing. The default is false.
+ * bShrinkToFit - If true, the page is shrunk (if necessary) to fit within the imageable area of the printed page.
+ * bPrintAsImage - If true, print pages as an image.
+ * bReverse - If true, print from nEnd to nStart.
+ * bAnnotations - If true (the default), annotations are printed.
+ */
+ void (*Doc_print)(struct _IPDF_JsPlatform* pThis, FPDF_BOOL bUI, int nStart, int nEnd, FPDF_BOOL bSilent ,FPDF_BOOL bShrinkToFit,FPDF_BOOL bPrintAsImage ,FPDF_BOOL bReverse ,FPDF_BOOL bAnnotations);
+
+ /*
+ * Method: Doc_submitForm
+ * Send the form data to a specified URL.
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * yes
+ * Parameters:
+ * pThis - Pointer to the interface structure itself
+ * formData - Pointer to the data buffer to be sent.
+ * length - The size,in bytes, of the buffer pointed by formData parameter.
+ * URL - The URL to send to.
+ * Return Value:
+ * None.
+ *
+ */
+ void (*Doc_submitForm)(struct _IPDF_JsPlatform* pThis,void* formData, int length, FPDF_WIDESTRING URL);
+
+ /*
+ * Method: Doc_gotoPage
+ * Jump to a specified page.
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * yes
+ * Parameters:
+ * pThis - Pointer to the interface structure itself
+ * nPageNum - The specified page number, zero for the first page.
+ * Return Value:
+ * None.
+ *
+ */
+ void (*Doc_gotoPage)(struct _IPDF_JsPlatform* pThis, int nPageNum);
+ /*
+ * Method: Field_browse
+ * Show a file selection dialog, and return the selected file path.
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * yes
+ * Parameters:
+ * pThis - Pointer to the interface structure itself.
+ * filePath - Pointer to the data buffer to receive the file path.Can be NULL.
+ * length - The length of the buffer, number of bytes. Can be 0.
+ * Return Value:
+ * Number of bytes the filePath consumes, including trailing zeros.
+ * Comments:
+ * The filePath shoule be always input in local encoding.
+ */
+ int (*Field_browse)(struct _IPDF_JsPlatform* pThis,void* filePath, int length);
+
+ /**
+ * pointer to FPDF_FORMFILLINFO interface.
+ **/
+ void* m_pFormfillinfo;
+} IPDF_JSPLATFORM;
+
+// Flags for Cursor type
+#define FXCT_ARROW 0
+#define FXCT_NESW 1
+#define FXCT_NWSE 2
+#define FXCT_VBEAM 3
+#define FXCT_HBEAM 4
+#define FXCT_HAND 5
+
+/**
+ * Declares of a pointer type to the callback function for the FFI_SetTimer method.
+ * Parameters:
+ * idEvent - Identifier of the timer.
+ * Return value:
+ * None.
+ **/
+typedef void (*TimerCallback)(int idEvent);
+
+/**
+ * Declares of a struct type to the local system time.
+**/
+typedef struct _FPDF_SYSTEMTIME
+{
+ unsigned short wYear; /* years since 1900 */
+ unsigned short wMonth; /* months since January - [0,11] */
+ unsigned short wDayOfWeek; /* days since Sunday - [0,6] */
+ unsigned short wDay; /* day of the month - [1,31] */
+ unsigned short wHour; /* hours since midnight - [0,23] */
+ unsigned short wMinute; /* minutes after the hour - [0,59] */
+ unsigned short wSecond; /* seconds after the minute - [0,59] */
+ unsigned short wMilliseconds; /* milliseconds after the second - [0,999] */
+}FPDF_SYSTEMTIME;
+
+
+typedef struct _FPDF_FORMFILLINFO
+{
+ /**
+ * Version number of the interface. Currently must be 1.
+ **/
+ int version;
+
+ /**
+ * Method: Release
+ * Give implementation a chance to release any data after the interface is no longer used
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * No
+ * Comments:
+ * Called by Foxit SDK during the final cleanup process.
+ * Parameters:
+ * pThis - Pointer to the interface structure itself
+ * Return Value:
+ * None
+ */
+
+ void (*Release)(struct _FPDF_FORMFILLINFO* pThis);
+
+ /**
+ * Method: FFI_Invalidate
+ * Invalidate the client area within the specified rectangle.
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * yes
+ * Parameters:
+ * pThis - Pointer to the interface structure itself.
+ * page - Handle to the page. Returned by FPDF_LoadPage function.
+ * left - Left position of the client area in PDF page coordinate.
+ * top - Top position of the client area in PDF page coordinate.
+ * right - Right position of the client area in PDF page coordinate.
+ * bottom - Bottom position of the client area in PDF page coordinate.
+ * Return Value:
+ * None.
+ *
+ *comments:
+ * All positions are measured in PDF "user space".
+ * Implementation should call FPDF_RenderPageBitmap() function for repainting a specified page area.
+ */
+ void (*FFI_Invalidate)(struct _FPDF_FORMFILLINFO* pThis,FPDF_PAGE page, double left, double top, double right, double bottom);
+
+ /**
+ * Method: FFI_OutputSelectedRect
+ * When user is taking the mouse to select texts on a form field, this callback function will keep
+ * returning the selected areas to the implementation.
+ *
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * No
+ * Parameters:
+ * pThis - Pointer to the interface structure itself.
+ * page - Handle to the page. Returned by FPDF_LoadPage function.
+ * left - Left position of the client area in PDF page coordinate.
+ * top - Top position of the client area in PDF page coordinate.
+ * right - Right position of the client area in PDF page coordinate.
+ * bottom - Bottom position of the client area in PDF page coordinate.
+ * Return Value:
+ * None.
+ *
+ * comments:
+ * This CALLBACK function is useful for implementing special text selection effect. Implementation should
+ * first records the returned rectangles, then draw them one by one at the painting period, last,remove all
+ * the recorded rectangles when finish painting.
+ */
+ void (*FFI_OutputSelectedRect)(struct _FPDF_FORMFILLINFO* pThis,FPDF_PAGE page, double left, double top, double right, double bottom);
+
+ /**
+ * Method: FFI_SetCursor
+ * Set the Cursor shape.
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * yes
+ * Parameters:
+ * pThis - Pointer to the interface structure itself.
+ * nCursorType - Cursor type. see Flags for Cursor type for the details.
+ * Return value:
+ * None.
+ * */
+ void (*FFI_SetCursor)(struct _FPDF_FORMFILLINFO* pThis, int nCursorType);
+
+ /**
+ * Method: FFI_SetTimer
+ * This method installs a system timer. A time-out value is specified,
+ * and every time a time-out occurs, the system passes a message to
+ * the TimerProc callback function.
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * yes
+ * Parameters:
+ * pThis - Pointer to the interface structure itself.
+ * uElapse - Specifies the time-out value, in milliseconds.
+ * lpTimerFunc - A pointer to the callback function-TimerCallback.
+ * Return value:
+ * The timer identifier of the new timer if the function is successful.
+ * An application passes this value to the FFI_KillTimer method to kill
+ * the timer. Nonzero if it is successful; otherwise, it is zero.
+ * */
+ int (*FFI_SetTimer)(struct _FPDF_FORMFILLINFO* pThis, int uElapse, TimerCallback lpTimerFunc);
+
+ /**
+ * Method: FFI_KillTimer
+ * This method kills the timer event identified by nIDEvent, set by an earlier call to FFI_SetTimer.
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * yes
+ * Parameters:
+ * pThis - Pointer to the interface structure itself.
+ * nTimerID - The timer ID return by FFI_SetTimer function.
+ * Return value:
+ * None.
+ * */
+ void (*FFI_KillTimer)(struct _FPDF_FORMFILLINFO* pThis, int nTimerID);
+
+
+ /**
+ * Method: FFI_GetLocalTime
+ * This method receives the current local time on the system.
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * yes
+ * Parameters:
+ * pThis - Pointer to the interface structure itself.
+ * Return value:
+ * None.
+ * */
+ FPDF_SYSTEMTIME (*FFI_GetLocalTime)(struct _FPDF_FORMFILLINFO* pThis);
+
+ /**
+ * Method: FFI_OnChange
+ * This method will be invoked to notify implementation when the value of any FormField on the document had been changed.
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * no
+ * Parameters:
+ * pThis - Pointer to the interface structure itself.
+ * Return value:
+ * None.
+ * */
+ void (*FFI_OnChange)(struct _FPDF_FORMFILLINFO* pThis);
+
+ /**
+ * Method: FFI_GetPage
+ * This method receives the page pointer associated with a specified page index.
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * yes
+ * Parameters:
+ * pThis - Pointer to the interface structure itself.
+ * document - Handle to document. Returned by FPDF_LoadDocument function.
+ * nPageIndex - Index number of the page. 0 for the first page.
+ * Return value:
+ * Handle to the page. Returned by FPDF_LoadPage function.
+ * Comments:
+ * In some cases, the document-level JavaScript action may refer to a page which hadn't been loaded yet.
+ * To successfully run the javascript action, implementation need to load the page for SDK.
+ * */
+ FPDF_PAGE (*FFI_GetPage)(struct _FPDF_FORMFILLINFO* pThis, FPDF_DOCUMENT document, int nPageIndex);
+
+ /**
+ * Method: FFI_GetCurrentPage
+ * This method receives the current page pointer.
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * yes
+ * Parameters:
+ * pThis - Pointer to the interface structure itself.
+ * document - Handle to document. Returned by FPDF_LoadDocument function.
+ * Return value:
+ * Handle to the page. Returned by FPDF_LoadPage function.
+ * */
+ FPDF_PAGE (*FFI_GetCurrentPage)(struct _FPDF_FORMFILLINFO* pThis, FPDF_DOCUMENT document);
+
+ /**
+ * Method: FFI_GetRotation
+ * This method receives currently rotation of the page view.
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * yes
+ * Parameters:
+ * pThis - Pointer to the interface structure itself.
+ * page - Handle to page. Returned by FPDF_LoadPage function.
+ * Return value:
+ * The page rotation. Should be 0(0 degree),1(90 degree),2(180 degree),3(270 degree), in a clockwise direction.
+ * */
+ int (*FFI_GetRotation)(struct _FPDF_FORMFILLINFO* pThis, FPDF_PAGE page);
+
+ /**
+ * Method: FFI_ExecuteNamedAction
+ * This method will execute an named action.
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * yes
+ * Parameters:
+ * pThis - Pointer to the interface structure itself.
+ * namedAction - A byte string which indicates the named action, terminated by 0.
+ * Return value:
+ * None.
+ * Comments:
+ * See the named actions description of <<PDF Reference, version 1.7>> for more details.
+ * */
+ void (*FFI_ExecuteNamedAction)(struct _FPDF_FORMFILLINFO* pThis, FPDF_BYTESTRING namedAction);
+ /**
+ * @brief This method will be called when a text field is getting or losing a focus.
+ *
+ * @param[in] pThis Pointer to the interface structure itself.
+ * @param[in] value The string value of the form field, in UTF-16LE format.
+ * @param[in] valueLen The length of the string value, number of characters (not bytes).
+ * @param[in] is_focus True if the form field is getting a focus, False for losing a focus.
+ *
+ * @return None.
+ *
+ * @note Currently,only support text field and combobox field.
+ * */
+ void (*FFI_SetTextFieldFocus)(struct _FPDF_FORMFILLINFO* pThis, FPDF_WIDESTRING value, FPDF_DWORD valueLen, FPDF_BOOL is_focus);
+
+
+ /**
+ * Method: FFI_DoURIAction
+ * This action resolves to a uniform resource identifier.
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * No
+ * Parameters:
+ * pThis - Pointer to the interface structure itself.
+ * bsURI - A byte string which indicates the uniform resource identifier, terminated by 0.
+ * Return value:
+ * None.
+ * Comments:
+ * See the URI actions description of <<PDF Reference, version 1.7>> for more details.
+ * */
+ void (*FFI_DoURIAction)(struct _FPDF_FORMFILLINFO* pThis, FPDF_BYTESTRING bsURI);
+
+ /**
+ * Method: FFI_DoGoToAction
+ * This action changes the view to a specified destination.
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * No
+ * Parameters:
+ * pThis - Pointer to the interface structure itself.
+ * nPageIndex - The index of the PDF page.
+ * zoomMode - The zoom mode for viewing page.See Macros "PDFZOOM_XXX" defined in "fpdfdoc.h".
+ * fPosArray - The float array which carries the position info.
+ * sizeofArray - The size of float array.
+ * Return value:
+ * None.
+ * Comments:
+ * See the Destinations description of <<PDF Reference, version 1.7>> in 8.2.1 for more details.
+ **/
+ void (*FFI_DoGoToAction)(struct _FPDF_FORMFILLINFO* pThis, int nPageIndex, int zoomMode, float* fPosArray, int sizeofArray);
+ /**
+ * pointer to IPDF_JSPLATFORM interface
+ **/
+ IPDF_JSPLATFORM* m_pJsPlatform;
+
+} FPDF_FORMFILLINFO;
+
+
+
+/**
+ * Function: FPDFDOC_InitFormFillEnviroument
+ * Init form fill environment.
+ * Comments:
+ * This function should be called before any form fill operation.
+ * Parameters:
+ * document - Handle to document. Returned by FPDF_LoadDocument function.
+ * pFormFillInfo - Pointer to a FPDF_FORMFILLINFO structure.
+ * Return Value:
+ * Return handler to the form fill module. NULL means fails.
+ **/
+DLLEXPORT FPDF_FORMHANDLE STDCALL FPDFDOC_InitFormFillEnviroument(FPDF_DOCUMENT document, FPDF_FORMFILLINFO* formInfo);
+
+/**
+ * Function: FPDFDOC_ExitFormFillEnviroument
+ * Exit form fill environment.
+ * Parameters:
+ * hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnviroument.
+ * Return Value:
+ * NULL.
+ **/
+DLLEXPORT void STDCALL FPDFDOC_ExitFormFillEnviroument(FPDF_FORMHANDLE hHandle);
+
+/**
+ * Function: FORM_OnAfterLoadPage
+ * This method is required for implementing all the form related functions. Should be invoked after user
+ * successfully loaded a PDF page, and method FPDFDOC_InitFormFillEnviroument had been invoked.
+ * Parameters:
+ * hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnviroument.
+ * Return Value:
+ * NONE.
+ **/
+DLLEXPORT void STDCALL FORM_OnAfterLoadPage(FPDF_PAGE page, FPDF_FORMHANDLE hHandle);
+
+/**
+ * Function: FORM_OnBeforeClosePage
+ * This method is required for implementing all the form related functions. Should be invoked before user
+ * close the PDF page.
+ * Parameters:
+ * page - Handle to the page. Returned by FPDF_LoadPage function.
+ * hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnviroument.
+ * Return Value:
+ * NONE.
+ **/
+DLLEXPORT void STDCALL FORM_OnBeforeClosePage(FPDF_PAGE page, FPDF_FORMHANDLE hHandle);
+
+/**
+* Function: FORM_DoDocumentJSAction
+* This method is required for performing Document-level JavaScript action. It should be invoked after the PDF document
+* had been loaded.
+* Parameters:
+* hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnviroument.
+* Return Value:
+* NONE
+* Comments:
+* If there is Document-level JavaScript action embedded in the document, this method will execute the javascript action;
+* otherwise, the method will do nothing.
+**/
+DLLEXPORT void STDCALL FORM_DoDocumentJSAction(FPDF_FORMHANDLE hHandle);
+
+
+/**
+* Function: FORM_DoDocumentOpenAction
+* This method is required for performing open-action when the document is opened.
+* Parameters:
+* hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnviroument.
+* Return Value:
+* NONE
+* Comments:
+* This method will do nothing if there is no open-actions embedded in the document.
+**/
+DLLEXPORT void STDCALL FORM_DoDocumentOpenAction(FPDF_FORMHANDLE hHandle);
+
+
+// additional actions type of document.
+#define FPDFDOC_AACTION_WC 0x10 //WC, before closing document, JavaScript action.
+#define FPDFDOC_AACTION_WS 0x11 //WS, before saving document, JavaScript action.
+#define FPDFDOC_AACTION_DS 0x12 //DS, after saving document, JavaScript action.
+#define FPDFDOC_AACTION_WP 0x13 //WP, before printing document, JavaScript action.
+#define FPDFDOC_AACTION_DP 0x14 //DP, after printing document, JavaScript action.
+/**
+* Function: FORM_DoDocumentAAction
+* This method is required for performing the document's additional-action.
+* Parameters:
+* hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnviroument.
+* aaType - The type of the additional-actions which defined above.
+* Return Value:
+* NONE
+* Comments:
+* This method will do nothing if there is no document additional-action corresponding to the specified aaType.
+**/
+
+DLLEXPORT void STDCALL FORM_DoDocumentAAction(FPDF_FORMHANDLE hHandle, int aaType);
+
+// Additional-action types of page object
+#define FPDFPAGE_AACTION_OPEN 0 // /O -- An action to be performed when the page is opened
+#define FPDFPAGE_AACTION_CLOSE 1 // /C -- An action to be performed when the page is closed
+
+/**
+* Function: FORM_DoPageAAction
+* This method is required for performing the page object's additional-action when opened or closed.
+* Parameters:
+* page - Handle to the page. Returned by FPDF_LoadPage function.
+* hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnviroument.
+* aaType - The type of the page object's additional-actions which defined above.
+* Return Value:
+* NONE
+* Comments:
+* This method will do nothing if no additional-action corresponding to the specified aaType exists.
+**/
+DLLEXPORT void STDCALL FORM_DoPageAAction(FPDF_PAGE page, FPDF_FORMHANDLE hHandle, int aaType);
+
+/**
+ * Function: FORM_OnMouseMove
+ * You can call this member function when the mouse cursor moves.
+ * Parameters:
+ * hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnviroument.
+ * page - Handle to the page. Returned by FPDF_LoadPage function.
+ * modifier - Indicates whether various virtual keys are down.
+ * page_x - Specifies the x-coordinate of the cursor in PDF user space.
+ * page_y - Specifies the y-coordinate of the cursor in PDF user space.
+ * Return Value:
+ * TRUE indicates success; otherwise false.
+ **/
+DLLEXPORT FPDF_BOOL STDCALL FORM_OnMouseMove(FPDF_FORMHANDLE hHandle,FPDF_PAGE page, int modifier, double page_x, double page_y);
+
+/**
+ * Function: FORM_OnLButtonDown
+ * You can call this member function when the user presses the left mouse button.
+ * Parameters:
+ * hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnviroument.
+ * page - Handle to the page. Returned by FPDF_LoadPage function.
+ * modifier - Indicates whether various virtual keys are down.
+ * page_x - Specifies the x-coordinate of the cursor in PDF user space.
+ * page_y - Specifies the y-coordinate of the cursor in PDF user space.
+ * Return Value:
+ * TRUE indicates success; otherwise false.
+ **/
+DLLEXPORT FPDF_BOOL STDCALL FORM_OnLButtonDown(FPDF_FORMHANDLE hHandle,FPDF_PAGE page, int modifier, double page_x, double page_y);
+
+/**
+ * Function: FORM_OnLButtonUp
+ * You can call this member function when the user releases the left mouse button.
+ * Parameters:
+ * hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnviroument.
+ * page - Handle to the page. Returned by FPDF_LoadPage function.
+ * modifier - Indicates whether various virtual keys are down.
+ * page_x - Specifies the x-coordinate of the cursor in device.
+ * page_y - Specifies the y-coordinate of the cursor in device.
+ * Return Value:
+ * TRUE indicates success; otherwise false.
+ **/
+DLLEXPORT FPDF_BOOL STDCALL FORM_OnLButtonUp(FPDF_FORMHANDLE hHandle,FPDF_PAGE page, int modifier, double page_x, double page_y);
+
+/**
+ * Function: FORM_OnKeyDown
+ * You can call this member function when a nonsystem key is pressed.
+ * Parameters:
+ * hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnviroument.
+ * page - Handle to the page. Returned by FPDF_LoadPage function.
+ * nKeyCode - Indicates whether various virtual keys are down.
+ * modifier - Contains the scan code, key-transition code, previous key state, and context code.
+ * Return Value:
+ * TRUE indicates success; otherwise false.
+ **/
+DLLEXPORT FPDF_BOOL STDCALL FORM_OnKeyDown(FPDF_FORMHANDLE hHandle,FPDF_PAGE page, int nKeyCode, int modifier);
+
+/**
+ * Function: FORM_OnKeyUp
+ * You can call this member function when a nonsystem key is released.
+ * Parameters:
+ * hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnviroument.
+ * page - Handle to the page. Returned by FPDF_LoadPage function.
+ * nKeyCode - The virtual-key code of the given key.
+ * modifier - Contains the scan code, key-transition code, previous key state, and context code.
+ * Return Value:
+ * TRUE indicates success; otherwise false.
+ **/
+DLLEXPORT FPDF_BOOL STDCALL FORM_OnKeyUp(FPDF_FORMHANDLE hHandle,FPDF_PAGE page, int nKeyCode, int modifier);
+
+/**
+ * Function: FORM_OnChar
+ * You can call this member function when a keystroke translates to a nonsystem character.
+ * Parameters:
+ * hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnviroument.
+ * page - Handle to the page. Returned by FPDF_LoadPage function.
+ * nChar - The character code value of the key.
+ * modifier - Contains the scan code, key-transition code, previous key state, and context code.
+ * Return Value:
+ * TRUE indicates success; otherwise false.
+ **/
+DLLEXPORT FPDF_BOOL STDCALL FORM_OnChar(FPDF_FORMHANDLE hHandle,FPDF_PAGE page, int nChar, int modifier);
+
+/**
+ * Function: FORM_ForceToKillFocus.
+ * You can call this member function to force to kill the focus of the form field which got focus.
+ * It would kill the focus on the form field, save the value of form field if it's changed by user.
+ * Parameters:
+ * hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnviroument.
+ * Return Value:
+ * TRUE indicates success; otherwise false.
+ **/
+DLLEXPORT FPDF_BOOL STDCALL FORM_ForceToKillFocus(FPDF_FORMHANDLE hHandle);
+
+// Field Types
+#define FPDF_FORMFIELD_UNKNOWN 0 // Unknown.
+#define FPDF_FORMFIELD_PUSHBUTTON 1 // push button type.
+#define FPDF_FORMFIELD_CHECKBOX 2 // check box type.
+#define FPDF_FORMFIELD_RADIOBUTTON 3 // radio button type.
+#define FPDF_FORMFIELD_COMBOBOX 4 // combo box type.
+#define FPDF_FORMFIELD_LISTBOX 5 // list box type.
+#define FPDF_FORMFIELD_TEXTFIELD 6 // text field type.
+
+/**
+ * Function: FPDPage_HasFormFieldAtPoint
+ * Check the form filed position by point.
+ * Parameters:
+ * hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnviroument.
+ * page - Handle to the page. Returned by FPDF_LoadPage function.
+ * page_x - X position in PDF "user space".
+ * page_y - Y position in PDF "user space".
+ * Return Value:
+ * Return the type of the formfiled; -1 indicates no fields.
+ **/
+DLLEXPORT int STDCALL FPDPage_HasFormFieldAtPoint(FPDF_FORMHANDLE hHandle,FPDF_PAGE page,double page_x, double page_y);
+
+/**
+ * Function: FPDF_SetFormFieldHighlightColor
+ * Set the highlight color of specified or all the form fields in the document.
+ * Parameters:
+ * hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnviroument.
+ * doc - Handle to the document. Returned by FPDF_LoadDocument function.
+ * fieldType - A 32-bit integer indicating the type of a form field(defined above).
+ * color - The highlight color of the form field.Constructed by 0xxxrrggbb.
+ * Return Value:
+ * NONE.
+ * Comments:
+ * When the parameter fieldType is set to zero, the highlight color will be applied to all the form fields in the
+ * document.
+ * Please refresh the client window to show the highlight immediately if necessary.
+ **/
+DLLEXPORT void STDCALL FPDF_SetFormFieldHighlightColor(FPDF_FORMHANDLE hHandle, int fieldType, unsigned long color);
+
+/**
+ * Function: FPDF_SetFormFieldHighlightAlpha
+ * Set the transparency of the form field highlight color in the document.
+ * Parameters:
+ * hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnviroument.
+ * doc - Handle to the document. Returned by FPDF_LoadDocument function.
+ * alpha - The transparency of the form field highlight color. between 0-255.
+ * Return Value:
+ * NONE.
+ **/
+DLLEXPORT void STDCALL FPDF_SetFormFieldHighlightAlpha(FPDF_FORMHANDLE hHandle, unsigned char alpha);
+
+
+/**
+ * Function: FPDF_RemoveFormFieldHighlight
+ * Remove the form field highlight color in the document.
+ * Parameters:
+ * hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnviroument.
+ * Return Value:
+ * NONE.
+ * Comments:
+ * Please refresh the client window to remove the highlight immediately if necessary.
+ **/
+DLLEXPORT void STDCALL FPDF_RemoveFormFieldHighlight(FPDF_FORMHANDLE hHandle);
+
+/**
+* Function: FPDF_FFLDraw
+* Render FormFeilds on a page to a device independent bitmap.
+* Parameters:
+* hHandle - Handle to the form fill module. Returned by FPDFDOC_InitFormFillEnviroument.
+* bitmap - Handle to the device independent bitmap (as the output buffer).
+* Bitmap handle can be created by FPDFBitmap_Create function.
+* page - Handle to the page. Returned by FPDF_LoadPage function.
+* start_x - Left pixel position of the display area in the device coordinate.
+* start_y - Top pixel position of the display area in the device coordinate.
+* size_x - Horizontal size (in pixels) for displaying the page.
+* size_y - Vertical size (in pixels) for displaying the page.
+* rotate - Page orientation: 0 (normal), 1 (rotated 90 degrees clockwise),
+* 2 (rotated 180 degrees), 3 (rotated 90 degrees counter-clockwise).
+* flags - 0 for normal display, or combination of flags defined above.
+* Return Value:
+* None.
+* Comments:
+* This method is designed to only render annotations and FormFields on the page.
+* Without FPDF_ANNOT specified for flags, Rendering functions such as FPDF_RenderPageBitmap or FPDF_RenderPageBitmap_Start will only render page contents(without annotations) to a bitmap.
+* In order to implement the FormFill functions,Implementation should call this method after rendering functions finish rendering the page contents.
+**/
+DLLEXPORT void STDCALL FPDF_FFLDraw(FPDF_FORMHANDLE hHandle,FPDF_BITMAP bitmap, FPDF_PAGE page, int start_x, int start_y,
+ int size_x, int size_y, int rotate, int flags);
+
+
+
+#ifdef __cplusplus
+};
+#endif
+
+#endif //_FPDFORMFILL_H
+
diff --git a/fpdfsdk/include/fpdfoom.h b/fpdfsdk/include/fpdfoom.h
index 638b012b74..dd14b74b4f 100644
--- a/fpdfsdk/include/fpdfoom.h
+++ b/fpdfsdk/include/fpdfoom.h
@@ -1,61 +1,61 @@
-// 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 _FPDFOOM_H_
-#define _FPDFOOM_H_
-
-#ifndef _FPDFVIEW_H_
-#include "fpdfview.h"
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct _OOM_INFO
-{
- /**
- * Version number of the interface. Currently must be 1.
- **/
- int version;
-
- /**
- * Method: FSDK_OOM_Handler
- * Out-Of-Memory handling function.
- * Interface Version:
- * 1
- * Implementation Required:
- * Yes
- * Parameters:
- * pThis - Pointer to the interface structure itself.
- * Return value:
- * None.
- * */
-
- void(*FSDK_OOM_Handler)(_OOM_INFO* pThis);
-}OOM_INFO;
-
-
-/**
- * Function: FSDK_SetOOMHandler
- * Setup A Out-Of-Memory handler for foxit sdk.
- * Parameters:
- * oomInfo - Pointer to a OOM_INFO structure.
- * Return Value:
- * TRUE means successful. FALSE means fails.
- **/
-
-DLLEXPORT FPDF_BOOL STDCALL FSDK_SetOOMHandler(OOM_INFO* oomInfo);
-
-
-#ifdef __cplusplus
-};
-#endif
-
-
-
-
-#endif
+// 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 _FPDFOOM_H_
+#define _FPDFOOM_H_
+
+#ifndef _FPDFVIEW_H_
+#include "fpdfview.h"
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct _OOM_INFO
+{
+ /**
+ * Version number of the interface. Currently must be 1.
+ **/
+ int version;
+
+ /**
+ * Method: FSDK_OOM_Handler
+ * Out-Of-Memory handling function.
+ * Interface Version:
+ * 1
+ * Implementation Required:
+ * Yes
+ * Parameters:
+ * pThis - Pointer to the interface structure itself.
+ * Return value:
+ * None.
+ * */
+
+ void(*FSDK_OOM_Handler)(_OOM_INFO* pThis);
+}OOM_INFO;
+
+
+/**
+ * Function: FSDK_SetOOMHandler
+ * Setup A Out-Of-Memory handler for foxit sdk.
+ * Parameters:
+ * oomInfo - Pointer to a OOM_INFO structure.
+ * Return Value:
+ * TRUE means successful. FALSE means fails.
+ **/
+
+DLLEXPORT FPDF_BOOL STDCALL FSDK_SetOOMHandler(OOM_INFO* oomInfo);
+
+
+#ifdef __cplusplus
+};
+#endif
+
+
+
+
+#endif
diff --git a/fpdfsdk/include/fpdfppo.h b/fpdfsdk/include/fpdfppo.h
index 5f77b5bf8d..57fd638313 100644
--- a/fpdfsdk/include/fpdfppo.h
+++ b/fpdfsdk/include/fpdfppo.h
@@ -1,34 +1,34 @@
-// 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 _FPDFPPO_H_
-#define _FPDFPPO_H_
-
-#include "fpdfview.h"
-
-// Function: FPDF_ImportPages
-// Import some pages to a PDF document.
-// Parameters:
-// dest_doc - The destination document which add the pages.
-// src_doc - A document to be imported.
-// pagerange - A page range string, Such as "1,3,5-7".
-// If this parameter is NULL, it would import all pages in src_doc.
-// index - The page index wanted to insert from.
-// Return value:
-// TRUE for succeed, FALSE for Failed.
-DLLEXPORT FPDF_BOOL STDCALL FPDF_ImportPages(FPDF_DOCUMENT dest_doc,FPDF_DOCUMENT src_doc, FPDF_BYTESTRING pagerange, int index);
-
-
-// Function: FPDF_CopyViewerPreferences
-// Copy the viewer preferences from one PDF document to another.#endif
-// Parameters:
-// dest_doc - Handle to document to write the viewer preferences to.
-// src_doc - Handle to document with the viewer preferences.
-// Return value:
-// TRUE for success, FALSE for failure.
-DLLEXPORT FPDF_BOOL STDCALL FPDF_CopyViewerPreferences(FPDF_DOCUMENT dest_doc, FPDF_DOCUMENT src_doc);
-#endif
-
+// 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 _FPDFPPO_H_
+#define _FPDFPPO_H_
+
+#include "fpdfview.h"
+
+// Function: FPDF_ImportPages
+// Import some pages to a PDF document.
+// Parameters:
+// dest_doc - The destination document which add the pages.
+// src_doc - A document to be imported.
+// pagerange - A page range string, Such as "1,3,5-7".
+// If this parameter is NULL, it would import all pages in src_doc.
+// index - The page index wanted to insert from.
+// Return value:
+// TRUE for succeed, FALSE for Failed.
+DLLEXPORT FPDF_BOOL STDCALL FPDF_ImportPages(FPDF_DOCUMENT dest_doc,FPDF_DOCUMENT src_doc, FPDF_BYTESTRING pagerange, int index);
+
+
+// Function: FPDF_CopyViewerPreferences
+// Copy the viewer preferences from one PDF document to another.#endif
+// Parameters:
+// dest_doc - Handle to document to write the viewer preferences to.
+// src_doc - Handle to document with the viewer preferences.
+// Return value:
+// TRUE for success, FALSE for failure.
+DLLEXPORT FPDF_BOOL STDCALL FPDF_CopyViewerPreferences(FPDF_DOCUMENT dest_doc, FPDF_DOCUMENT src_doc);
+#endif
+
diff --git a/fpdfsdk/include/fpdfsave.h b/fpdfsdk/include/fpdfsave.h
index be340f44a1..a69456086a 100644
--- a/fpdfsdk/include/fpdfsave.h
+++ b/fpdfsdk/include/fpdfsave.h
@@ -1,81 +1,81 @@
-// 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 _FPDFSAVE_H_
-#define _FPDFSAVE_H_
-
-#include "fpdfview.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-// Structure for custom file write
-struct FPDF_FILEWRITE{
-
- //
- //Version number of the interface. Currently must be 1.
- //
- int version;
-
- //
- // Method: WriteBlock
- // Output a block of data in your custom way.
- // Interface Version:
- // 1
- // Implementation Required:
- // Yes
- // Comments:
- // Called by function FPDF_SaveDocument
- // Parameters:
- // pThis - Pointer to the structure itself
- // pData - Pointer to a buffer to output
- // size - The size of the buffer.
- // Return value:
- // Should be non-zero if successful, zero for error.
- //
- int (*WriteBlock)( FPDF_FILEWRITE* pThis, const void* pData, unsigned long size);
-
-};
-
-
-/** @brief Incremental. */
-#define FPDF_INCREMENTAL 1
-/** @brief No Incremental. */
-#define FPDF_NO_INCREMENTAL 2
-
-
-// Function: FPDF_SaveAsCopy
-// Saves the copy of specified document in custom way.
-// Parameters:
-// document - Handle to document. Returned by FPDF_LoadDocument and FPDF_CreateNewDocument.
-// pFileWrite - A pointer to a custom file write structure.
-// flags - The creating flags.
-// Return value:
-// TRUE for succeed, FALSE for failed.
-//
-DLLEXPORT FPDF_BOOL STDCALL FPDF_SaveAsCopy( FPDF_DOCUMENT document,FPDF_FILEWRITE * pFileWrite,
- FPDF_DWORD flags );
-
-// Function: FPDF_SaveWithVersion
-// Same as function ::FPDF_SaveAsCopy, except the file version of the saved document could be specified by user.
-// Parameters:
-// document - Handle to document.
-// pFileWrite - A pointer to a custom file write structure.
-// flags - The creating flags.
-// fileVersion - The PDF file version. File version: 14 for 1.4, 15 for 1.5, ...
-// Return value:
-// TRUE if succeed, FALSE if failed.
-//
-DLLEXPORT FPDF_BOOL STDCALL FPDF_SaveWithVersion(FPDF_DOCUMENT document,FPDF_FILEWRITE * pFileWrite,
- FPDF_DWORD flags, int fileVersion);
-
-#ifdef __cplusplus
-};
-#endif
-
-#endif //_FPDFSAVE_H_
+// 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 _FPDFSAVE_H_
+#define _FPDFSAVE_H_
+
+#include "fpdfview.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+// Structure for custom file write
+struct FPDF_FILEWRITE{
+
+ //
+ //Version number of the interface. Currently must be 1.
+ //
+ int version;
+
+ //
+ // Method: WriteBlock
+ // Output a block of data in your custom way.
+ // Interface Version:
+ // 1
+ // Implementation Required:
+ // Yes
+ // Comments:
+ // Called by function FPDF_SaveDocument
+ // Parameters:
+ // pThis - Pointer to the structure itself
+ // pData - Pointer to a buffer to output
+ // size - The size of the buffer.
+ // Return value:
+ // Should be non-zero if successful, zero for error.
+ //
+ int (*WriteBlock)( FPDF_FILEWRITE* pThis, const void* pData, unsigned long size);
+
+};
+
+
+/** @brief Incremental. */
+#define FPDF_INCREMENTAL 1
+/** @brief No Incremental. */
+#define FPDF_NO_INCREMENTAL 2
+
+
+// Function: FPDF_SaveAsCopy
+// Saves the copy of specified document in custom way.
+// Parameters:
+// document - Handle to document. Returned by FPDF_LoadDocument and FPDF_CreateNewDocument.
+// pFileWrite - A pointer to a custom file write structure.
+// flags - The creating flags.
+// Return value:
+// TRUE for succeed, FALSE for failed.
+//
+DLLEXPORT FPDF_BOOL STDCALL FPDF_SaveAsCopy( FPDF_DOCUMENT document,FPDF_FILEWRITE * pFileWrite,
+ FPDF_DWORD flags );
+
+// Function: FPDF_SaveWithVersion
+// Same as function ::FPDF_SaveAsCopy, except the file version of the saved document could be specified by user.
+// Parameters:
+// document - Handle to document.
+// pFileWrite - A pointer to a custom file write structure.
+// flags - The creating flags.
+// fileVersion - The PDF file version. File version: 14 for 1.4, 15 for 1.5, ...
+// Return value:
+// TRUE if succeed, FALSE if failed.
+//
+DLLEXPORT FPDF_BOOL STDCALL FPDF_SaveWithVersion(FPDF_DOCUMENT document,FPDF_FILEWRITE * pFileWrite,
+ FPDF_DWORD flags, int fileVersion);
+
+#ifdef __cplusplus
+};
+#endif
+
+#endif //_FPDFSAVE_H_
diff --git a/fpdfsdk/include/fpdftext.h b/fpdfsdk/include/fpdftext.h
index f862db4cbe..8b897798e6 100644
--- a/fpdfsdk/include/fpdftext.h
+++ b/fpdfsdk/include/fpdftext.h
@@ -1,316 +1,316 @@
-// 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 _FPDFTEXT_H_
-#define _FPDFTEXT_H_
-
-#include "fpdfview.h"
-
-// Exported Functions
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-// Function: FPDFText_LoadPage
-// Prepare information about all characters in a page.
-// Parameters:
-// page - Handle to the page. Returned by FPDF_LoadPage function (in FPDFVIEW module).
-// Return value:
-// A handle to the text page information structure.
-// NULL if something goes wrong.
-// Comments:
-// Application must call FPDFText_ClosePage to release the text page information.
-// If you don't purchase Text Module , this function will return NULL.
-//
-DLLEXPORT FPDF_TEXTPAGE STDCALL FPDFText_LoadPage(FPDF_PAGE page);
-
-// Function: FPDFText_ClosePage
-// Release all resources allocated for a text page information structure.
-// Parameters:
-// text_page - Handle to a text page information structure. Returned by FPDFText_LoadPage function.
-// Return Value:
-// None.
-//
-DLLEXPORT void STDCALL FPDFText_ClosePage(FPDF_TEXTPAGE text_page);
-
-// Function: FPDFText_CountChars
-// Get number of characters in a page.
-// Parameters:
-// text_page - Handle to a text page information structure. Returned by FPDFText_LoadPage function.
-// Return value:
-// Number of characters in the page. Return -1 for error.
-// Generated characters, like additional space characters, new line characters, are also counted.
-// Comments:
-// Characters in a page form a "stream", inside the stream, each character has an index.
-// We will use the index parameters in many of FPDFTEXT functions. The first character in the page
-// has an index value of zero.
-//
-DLLEXPORT int STDCALL FPDFText_CountChars(FPDF_TEXTPAGE text_page);
-
-// Function: FPDFText_GetUnicode
-// Get Unicode of a character in a page.
-// Parameters:
-// text_page - Handle to a text page information structure. Returned by FPDFText_LoadPage function.
-// index - Zero-based index of the character.
-// Return value:
-// The Unicode of the particular character.
-// If a character is not encoded in Unicode and Foxit engine can't convert to Unicode,
-// the return value will be zero.
-//
-DLLEXPORT unsigned int STDCALL FPDFText_GetUnicode(FPDF_TEXTPAGE text_page, int index);
-
-// Function: FPDFText_GetFontSize
-// Get the font size of a particular character.
-// Parameters:
-// text_page - Handle to a text page information structure. Returned by FPDFText_LoadPage function.
-// index - Zero-based index of the character.
-// Return value:
-// The font size of the particular character, measured in points (about 1/72 inch).
-// This is the typographic size of the font (so called "em size").
-//
-DLLEXPORT double STDCALL FPDFText_GetFontSize(FPDF_TEXTPAGE text_page, int index);
-
-// Function: FPDFText_GetCharBox
-// Get bounding box of a particular character.
-// Parameters:
-// text_page - Handle to a text page information structure. Returned by FPDFText_LoadPage function.
-// index - Zero-based index of the character.
-// left - Pointer to a double number receiving left position of the character box.
-// right - Pointer to a double number receiving right position of the character box.
-// bottom - Pointer to a double number receiving bottom position of the character box.
-// top - Pointer to a double number receiving top position of the character box.
-// Return Value:
-// None.
-// Comments:
-// All positions are measured in PDF "user space".
-//
-DLLEXPORT void STDCALL FPDFText_GetCharBox(FPDF_TEXTPAGE text_page, int index, double* left,
- double* right, double* bottom, double* top);
-
-// Function: FPDFText_GetCharIndexAtPos
-// Get the index of a character at or nearby a certain position on the page.
-// Parameters:
-// text_page - Handle to a text page information structure. Returned by FPDFText_LoadPage function.
-// x - X position in PDF "user space".
-// y - Y position in PDF "user space".
-// xTolerance - An x-axis tolerance value for character hit detection, in point unit.
-// yTolerance - A y-axis tolerance value for character hit detection, in point unit.
-// Return Value:
-// The zero-based index of the character at, or nearby the point (x,y).
-// If there is no character at or nearby the point, return value will be -1.
-// If an error occurs, -3 will be returned.
-//
-DLLEXPORT int STDCALL FPDFText_GetCharIndexAtPos(FPDF_TEXTPAGE text_page,
- double x, double y, double xTorelance, double yTolerance);
-
-// Function: FPDFText_GetText
-// Extract unicode text string from the page.
-// Parameters:
-// text_page - Handle to a text page information structure. Returned by FPDFText_LoadPage function.
-// start_index - Index for the start characters.
-// count - Number of characters to be extracted.
-// result - A buffer (allocated by application) receiving the extracted unicodes.
-// The size of the buffer must be able to hold the number of characters plus a terminator.
-// Return Value:
-// Number of characters written into the result buffer, including the trailing terminator.
-// Comments:
-// This function ignores characters without unicode information.
-//
-DLLEXPORT int STDCALL FPDFText_GetText(FPDF_TEXTPAGE text_page, int start_index, int count, unsigned short* result);
-
-// Function: FPDFText_CountRects
-// Count number of rectangular areas occupied by a segment of texts.
-// Parameters:
-// text_page - Handle to a text page information structure. Returned by FPDFText_LoadPage function.
-// start_index - Index for the start characters.
-// count - Number of characters.
-// Return value:
-// Number of rectangles. Zero for error.
-// Comments:
-// This function, along with FPDFText_GetRect can be used by applications to detect the position
-// on the page for a text segment, so proper areas can be highlighted or something.
-// FPDFTEXT will automatically merge small character boxes into bigger one if those characters
-// are on the same line and use same font settings.
-//
-DLLEXPORT int STDCALL FPDFText_CountRects(FPDF_TEXTPAGE text_page, int start_index, int count);
-
-// Function: FPDFText_GetRect
-// Get a rectangular area from the result generated by FPDFText_CountRects.
-// Parameters:
-// text_page - Handle to a text page information structure. Returned by FPDFText_LoadPage function.
-// rect_index - Zero-based index for the rectangle.
-// left - Pointer to a double value receiving the rectangle left boundary.
-// top - Pointer to a double value receiving the rectangle top boundary.
-// right - Pointer to a double value receiving the rectangle right boundary.
-// bottom - Pointer to a double value receiving the rectangle bottom boundary.
-// Return Value:
-// None.
-//
-DLLEXPORT void STDCALL FPDFText_GetRect(FPDF_TEXTPAGE text_page, int rect_index, double* left, double* top,
- double* right, double* bottom);
-
-// Function: FPDFText_GetBoundedText
-// Extract unicode text within a rectangular boundary on the page.
-// Parameters:
-// text_page - Handle to a text page information structure. Returned by FPDFText_LoadPage function.
-// left - Left boundary.
-// top - Top boundary.
-// right - Right boundary.
-// bottom - Bottom boundary.
-// buffer - A unicode buffer.
-// buflen - Number of characters (not bytes) for the buffer, excluding an additional terminator.
-// Return Value:
-// If buffer is NULL or buflen is zero, return number of characters (not bytes) needed,
-// otherwise, return number of characters copied into the buffer.
-//
-DLLEXPORT int STDCALL FPDFText_GetBoundedText(FPDF_TEXTPAGE text_page,double left, double top,
- double right, double bottom,unsigned short* buffer,int buflen);
-
-
-// Flags used by FPDFText_FindStart function.
-#define FPDF_MATCHCASE 0x00000001 //If not set, it will not match case by default.
-#define FPDF_MATCHWHOLEWORD 0x00000002 //If not set, it will not match the whole word by default.
-
-// Function: FPDFText_FindStart
-// Start a search.
-// Parameters:
-// text_page - Handle to a text page information structure. Returned by FPDFText_LoadPage function.
-// findwhat - A unicode match pattern.
-// flags - Option flags.
-// start_index - Start from this character. -1 for end of the page.
-// Return Value:
-// A handle for the search context. FPDFText_FindClose must be called to release this handle.
-//
-DLLEXPORT FPDF_SCHHANDLE STDCALL FPDFText_FindStart(FPDF_TEXTPAGE text_page, FPDF_WIDESTRING findwhat,
- unsigned long flags, int start_index);
-
-// Function: FPDFText_FindNext
-// Search in the direction from page start to end.
-// Parameters:
-// handle - A search context handle returned by FPDFText_FindStart.
-// Return Value:
-// Whether a match is found.
-//
-DLLEXPORT FPDF_BOOL STDCALL FPDFText_FindNext(FPDF_SCHHANDLE handle);
-
-// Function: FPDFText_FindPrev
-// Search in the direction from page end to start.
-// Parameters:
-// handle - A search context handle returned by FPDFText_FindStart.
-// Return Value:
-// Whether a match is found.
-//
-DLLEXPORT FPDF_BOOL STDCALL FPDFText_FindPrev(FPDF_SCHHANDLE handle);
-
-// Function: FPDFText_GetSchResultIndex
-// Get the starting character index of the search result.
-// Parameters:
-// handle - A search context handle returned by FPDFText_FindStart.
-// Return Value:
-// Index for the starting character.
-//
-DLLEXPORT int STDCALL FPDFText_GetSchResultIndex(FPDF_SCHHANDLE handle);
-
-// Function: FPDFText_GetSchCount
-// Get the number of matched characters in the search result.
-// Parameters:
-// handle - A search context handle returned by FPDFText_FindStart.
-// Return Value:
-// Number of matched characters.
-//
-DLLEXPORT int STDCALL FPDFText_GetSchCount(FPDF_SCHHANDLE handle);
-
-// Function: FPDFText_FindClose
-// Release a search context.
-// Parameters:
-// handle - A search context handle returned by FPDFText_FindStart.
-// Return Value:
-// None.
-//
-DLLEXPORT void STDCALL FPDFText_FindClose(FPDF_SCHHANDLE handle);
-
-// Function: FPDFLink_LoadWebLinks
-// Prepare information about weblinks in a page.
-// Parameters:
-// text_page - Handle to a text page information structure. Returned by FPDFText_LoadPage function.
-// Return Value:
-// A handle to the page's links information structure.
-// NULL if something goes wrong.
-// Comments:
-// Weblinks are those links implicitly embedded in PDF pages. PDF also has a type of
-// annotation called "link", FPDFTEXT doesn't deal with that kind of link.
-// FPDFTEXT weblink feature is useful for automatically detecting links in the page
-// contents. For example, things like "http://www.foxitsoftware.com" will be detected,
-// so applications can allow user to click on those characters to activate the link,
-// even the PDF doesn't come with link annotations.
-//
-// FPDFLink_CloseWebLinks must be called to release resources.
-//
-DLLEXPORT FPDF_PAGELINK STDCALL FPDFLink_LoadWebLinks(FPDF_TEXTPAGE text_page);
-
-// Function: FPDFLink_CountWebLinks
-// Count number of detected web links.
-// Parameters:
-// link_page - Handle returned by FPDFLink_LoadWebLinks.
-// Return Value:
-// Number of detected web links.
-//
-DLLEXPORT int STDCALL FPDFLink_CountWebLinks(FPDF_PAGELINK link_page);
-
-// Function: FPDFLink_GetURL
-// Fetch the URL information for a detected web link.
-// Parameters:
-// link_page - Handle returned by FPDFLink_LoadWebLinks.
-// link_index - Zero-based index for the link.
-// buffer - A unicode buffer.
-// buflen - Number of characters (not bytes) for the buffer, including an additional terminator.
-// Return Value:
-// If buffer is NULL or buflen is zero, return number of characters (not bytes and an additional terminator is also counted) needed,
-// otherwise, return number of characters copied into the buffer.
-//
-DLLEXPORT int STDCALL FPDFLink_GetURL(FPDF_PAGELINK link_page, int link_index, unsigned short* buffer,int buflen);
-
-// Function: FPDFLink_CountRects
-// Count number of rectangular areas for the link.
-// Parameters:
-// link_page - Handle returned by FPDFLink_LoadWebLinks.
-// link_index - Zero-based index for the link.
-// Return Value:
-// Number of rectangular areas for the link.
-//
-DLLEXPORT int STDCALL FPDFLink_CountRects(FPDF_PAGELINK link_page, int link_index);
-
-// Function: FPDFLink_GetRect
-// Fetch the boundaries of a rectangle for a link.
-// Parameters:
-// link_page - Handle returned by FPDFLink_LoadWebLinks.
-// link_index - Zero-based index for the link.
-// rect_index - Zero-based index for a rectangle.
-// left - Pointer to a double value receiving the rectangle left boundary.
-// top - Pointer to a double value receiving the rectangle top boundary.
-// right - Pointer to a double value receiving the rectangle right boundary.
-// bottom - Pointer to a double value receiving the rectangle bottom boundary.
-// Return Value:
-// None.
-//
-DLLEXPORT void STDCALL FPDFLink_GetRect(FPDF_PAGELINK link_page, int link_index, int rect_index,
- double* left, double* top,double* right, double* bottom);
-
-// Function: FPDFLink_CloseWebLinks
-// Release resources used by weblink feature.
-// Parameters:
-// link_page - Handle returned by FPDFLink_LoadWebLinks.
-// Return Value:
-// None.
-//
-DLLEXPORT void STDCALL FPDFLink_CloseWebLinks(FPDF_PAGELINK link_page);
-
-
-#ifdef __cplusplus
-};
-#endif
-
-#endif//_FPDFTEXT_H_
+// 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 _FPDFTEXT_H_
+#define _FPDFTEXT_H_
+
+#include "fpdfview.h"
+
+// Exported Functions
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// Function: FPDFText_LoadPage
+// Prepare information about all characters in a page.
+// Parameters:
+// page - Handle to the page. Returned by FPDF_LoadPage function (in FPDFVIEW module).
+// Return value:
+// A handle to the text page information structure.
+// NULL if something goes wrong.
+// Comments:
+// Application must call FPDFText_ClosePage to release the text page information.
+// If you don't purchase Text Module , this function will return NULL.
+//
+DLLEXPORT FPDF_TEXTPAGE STDCALL FPDFText_LoadPage(FPDF_PAGE page);
+
+// Function: FPDFText_ClosePage
+// Release all resources allocated for a text page information structure.
+// Parameters:
+// text_page - Handle to a text page information structure. Returned by FPDFText_LoadPage function.
+// Return Value:
+// None.
+//
+DLLEXPORT void STDCALL FPDFText_ClosePage(FPDF_TEXTPAGE text_page);
+
+// Function: FPDFText_CountChars
+// Get number of characters in a page.
+// Parameters:
+// text_page - Handle to a text page information structure. Returned by FPDFText_LoadPage function.
+// Return value:
+// Number of characters in the page. Return -1 for error.
+// Generated characters, like additional space characters, new line characters, are also counted.
+// Comments:
+// Characters in a page form a "stream", inside the stream, each character has an index.
+// We will use the index parameters in many of FPDFTEXT functions. The first character in the page
+// has an index value of zero.
+//
+DLLEXPORT int STDCALL FPDFText_CountChars(FPDF_TEXTPAGE text_page);
+
+// Function: FPDFText_GetUnicode
+// Get Unicode of a character in a page.
+// Parameters:
+// text_page - Handle to a text page information structure. Returned by FPDFText_LoadPage function.
+// index - Zero-based index of the character.
+// Return value:
+// The Unicode of the particular character.
+// If a character is not encoded in Unicode and Foxit engine can't convert to Unicode,
+// the return value will be zero.
+//
+DLLEXPORT unsigned int STDCALL FPDFText_GetUnicode(FPDF_TEXTPAGE text_page, int index);
+
+// Function: FPDFText_GetFontSize
+// Get the font size of a particular character.
+// Parameters:
+// text_page - Handle to a text page information structure. Returned by FPDFText_LoadPage function.
+// index - Zero-based index of the character.
+// Return value:
+// The font size of the particular character, measured in points (about 1/72 inch).
+// This is the typographic size of the font (so called "em size").
+//
+DLLEXPORT double STDCALL FPDFText_GetFontSize(FPDF_TEXTPAGE text_page, int index);
+
+// Function: FPDFText_GetCharBox
+// Get bounding box of a particular character.
+// Parameters:
+// text_page - Handle to a text page information structure. Returned by FPDFText_LoadPage function.
+// index - Zero-based index of the character.
+// left - Pointer to a double number receiving left position of the character box.
+// right - Pointer to a double number receiving right position of the character box.
+// bottom - Pointer to a double number receiving bottom position of the character box.
+// top - Pointer to a double number receiving top position of the character box.
+// Return Value:
+// None.
+// Comments:
+// All positions are measured in PDF "user space".
+//
+DLLEXPORT void STDCALL FPDFText_GetCharBox(FPDF_TEXTPAGE text_page, int index, double* left,
+ double* right, double* bottom, double* top);
+
+// Function: FPDFText_GetCharIndexAtPos
+// Get the index of a character at or nearby a certain position on the page.
+// Parameters:
+// text_page - Handle to a text page information structure. Returned by FPDFText_LoadPage function.
+// x - X position in PDF "user space".
+// y - Y position in PDF "user space".
+// xTolerance - An x-axis tolerance value for character hit detection, in point unit.
+// yTolerance - A y-axis tolerance value for character hit detection, in point unit.
+// Return Value:
+// The zero-based index of the character at, or nearby the point (x,y).
+// If there is no character at or nearby the point, return value will be -1.
+// If an error occurs, -3 will be returned.
+//
+DLLEXPORT int STDCALL FPDFText_GetCharIndexAtPos(FPDF_TEXTPAGE text_page,
+ double x, double y, double xTorelance, double yTolerance);
+
+// Function: FPDFText_GetText
+// Extract unicode text string from the page.
+// Parameters:
+// text_page - Handle to a text page information structure. Returned by FPDFText_LoadPage function.
+// start_index - Index for the start characters.
+// count - Number of characters to be extracted.
+// result - A buffer (allocated by application) receiving the extracted unicodes.
+// The size of the buffer must be able to hold the number of characters plus a terminator.
+// Return Value:
+// Number of characters written into the result buffer, including the trailing terminator.
+// Comments:
+// This function ignores characters without unicode information.
+//
+DLLEXPORT int STDCALL FPDFText_GetText(FPDF_TEXTPAGE text_page, int start_index, int count, unsigned short* result);
+
+// Function: FPDFText_CountRects
+// Count number of rectangular areas occupied by a segment of texts.
+// Parameters:
+// text_page - Handle to a text page information structure. Returned by FPDFText_LoadPage function.
+// start_index - Index for the start characters.
+// count - Number of characters.
+// Return value:
+// Number of rectangles. Zero for error.
+// Comments:
+// This function, along with FPDFText_GetRect can be used by applications to detect the position
+// on the page for a text segment, so proper areas can be highlighted or something.
+// FPDFTEXT will automatically merge small character boxes into bigger one if those characters
+// are on the same line and use same font settings.
+//
+DLLEXPORT int STDCALL FPDFText_CountRects(FPDF_TEXTPAGE text_page, int start_index, int count);
+
+// Function: FPDFText_GetRect
+// Get a rectangular area from the result generated by FPDFText_CountRects.
+// Parameters:
+// text_page - Handle to a text page information structure. Returned by FPDFText_LoadPage function.
+// rect_index - Zero-based index for the rectangle.
+// left - Pointer to a double value receiving the rectangle left boundary.
+// top - Pointer to a double value receiving the rectangle top boundary.
+// right - Pointer to a double value receiving the rectangle right boundary.
+// bottom - Pointer to a double value receiving the rectangle bottom boundary.
+// Return Value:
+// None.
+//
+DLLEXPORT void STDCALL FPDFText_GetRect(FPDF_TEXTPAGE text_page, int rect_index, double* left, double* top,
+ double* right, double* bottom);
+
+// Function: FPDFText_GetBoundedText
+// Extract unicode text within a rectangular boundary on the page.
+// Parameters:
+// text_page - Handle to a text page information structure. Returned by FPDFText_LoadPage function.
+// left - Left boundary.
+// top - Top boundary.
+// right - Right boundary.
+// bottom - Bottom boundary.
+// buffer - A unicode buffer.
+// buflen - Number of characters (not bytes) for the buffer, excluding an additional terminator.
+// Return Value:
+// If buffer is NULL or buflen is zero, return number of characters (not bytes) needed,
+// otherwise, return number of characters copied into the buffer.
+//
+DLLEXPORT int STDCALL FPDFText_GetBoundedText(FPDF_TEXTPAGE text_page,double left, double top,
+ double right, double bottom,unsigned short* buffer,int buflen);
+
+
+// Flags used by FPDFText_FindStart function.
+#define FPDF_MATCHCASE 0x00000001 //If not set, it will not match case by default.
+#define FPDF_MATCHWHOLEWORD 0x00000002 //If not set, it will not match the whole word by default.
+
+// Function: FPDFText_FindStart
+// Start a search.
+// Parameters:
+// text_page - Handle to a text page information structure. Returned by FPDFText_LoadPage function.
+// findwhat - A unicode match pattern.
+// flags - Option flags.
+// start_index - Start from this character. -1 for end of the page.
+// Return Value:
+// A handle for the search context. FPDFText_FindClose must be called to release this handle.
+//
+DLLEXPORT FPDF_SCHHANDLE STDCALL FPDFText_FindStart(FPDF_TEXTPAGE text_page, FPDF_WIDESTRING findwhat,
+ unsigned long flags, int start_index);
+
+// Function: FPDFText_FindNext
+// Search in the direction from page start to end.
+// Parameters:
+// handle - A search context handle returned by FPDFText_FindStart.
+// Return Value:
+// Whether a match is found.
+//
+DLLEXPORT FPDF_BOOL STDCALL FPDFText_FindNext(FPDF_SCHHANDLE handle);
+
+// Function: FPDFText_FindPrev
+// Search in the direction from page end to start.
+// Parameters:
+// handle - A search context handle returned by FPDFText_FindStart.
+// Return Value:
+// Whether a match is found.
+//
+DLLEXPORT FPDF_BOOL STDCALL FPDFText_FindPrev(FPDF_SCHHANDLE handle);
+
+// Function: FPDFText_GetSchResultIndex
+// Get the starting character index of the search result.
+// Parameters:
+// handle - A search context handle returned by FPDFText_FindStart.
+// Return Value:
+// Index for the starting character.
+//
+DLLEXPORT int STDCALL FPDFText_GetSchResultIndex(FPDF_SCHHANDLE handle);
+
+// Function: FPDFText_GetSchCount
+// Get the number of matched characters in the search result.
+// Parameters:
+// handle - A search context handle returned by FPDFText_FindStart.
+// Return Value:
+// Number of matched characters.
+//
+DLLEXPORT int STDCALL FPDFText_GetSchCount(FPDF_SCHHANDLE handle);
+
+// Function: FPDFText_FindClose
+// Release a search context.
+// Parameters:
+// handle - A search context handle returned by FPDFText_FindStart.
+// Return Value:
+// None.
+//
+DLLEXPORT void STDCALL FPDFText_FindClose(FPDF_SCHHANDLE handle);
+
+// Function: FPDFLink_LoadWebLinks
+// Prepare information about weblinks in a page.
+// Parameters:
+// text_page - Handle to a text page information structure. Returned by FPDFText_LoadPage function.
+// Return Value:
+// A handle to the page's links information structure.
+// NULL if something goes wrong.
+// Comments:
+// Weblinks are those links implicitly embedded in PDF pages. PDF also has a type of
+// annotation called "link", FPDFTEXT doesn't deal with that kind of link.
+// FPDFTEXT weblink feature is useful for automatically detecting links in the page
+// contents. For example, things like "http://www.foxitsoftware.com" will be detected,
+// so applications can allow user to click on those characters to activate the link,
+// even the PDF doesn't come with link annotations.
+//
+// FPDFLink_CloseWebLinks must be called to release resources.
+//
+DLLEXPORT FPDF_PAGELINK STDCALL FPDFLink_LoadWebLinks(FPDF_TEXTPAGE text_page);
+
+// Function: FPDFLink_CountWebLinks
+// Count number of detected web links.
+// Parameters:
+// link_page - Handle returned by FPDFLink_LoadWebLinks.
+// Return Value:
+// Number of detected web links.
+//
+DLLEXPORT int STDCALL FPDFLink_CountWebLinks(FPDF_PAGELINK link_page);
+
+// Function: FPDFLink_GetURL
+// Fetch the URL information for a detected web link.
+// Parameters:
+// link_page - Handle returned by FPDFLink_LoadWebLinks.
+// link_index - Zero-based index for the link.
+// buffer - A unicode buffer.
+// buflen - Number of characters (not bytes) for the buffer, including an additional terminator.
+// Return Value:
+// If buffer is NULL or buflen is zero, return number of characters (not bytes and an additional terminator is also counted) needed,
+// otherwise, return number of characters copied into the buffer.
+//
+DLLEXPORT int STDCALL FPDFLink_GetURL(FPDF_PAGELINK link_page, int link_index, unsigned short* buffer,int buflen);
+
+// Function: FPDFLink_CountRects
+// Count number of rectangular areas for the link.
+// Parameters:
+// link_page - Handle returned by FPDFLink_LoadWebLinks.
+// link_index - Zero-based index for the link.
+// Return Value:
+// Number of rectangular areas for the link.
+//
+DLLEXPORT int STDCALL FPDFLink_CountRects(FPDF_PAGELINK link_page, int link_index);
+
+// Function: FPDFLink_GetRect
+// Fetch the boundaries of a rectangle for a link.
+// Parameters:
+// link_page - Handle returned by FPDFLink_LoadWebLinks.
+// link_index - Zero-based index for the link.
+// rect_index - Zero-based index for a rectangle.
+// left - Pointer to a double value receiving the rectangle left boundary.
+// top - Pointer to a double value receiving the rectangle top boundary.
+// right - Pointer to a double value receiving the rectangle right boundary.
+// bottom - Pointer to a double value receiving the rectangle bottom boundary.
+// Return Value:
+// None.
+//
+DLLEXPORT void STDCALL FPDFLink_GetRect(FPDF_PAGELINK link_page, int link_index, int rect_index,
+ double* left, double* top,double* right, double* bottom);
+
+// Function: FPDFLink_CloseWebLinks
+// Release resources used by weblink feature.
+// Parameters:
+// link_page - Handle returned by FPDFLink_LoadWebLinks.
+// Return Value:
+// None.
+//
+DLLEXPORT void STDCALL FPDFLink_CloseWebLinks(FPDF_PAGELINK link_page);
+
+
+#ifdef __cplusplus
+};
+#endif
+
+#endif//_FPDFTEXT_H_
diff --git a/fpdfsdk/include/fpdfview.h b/fpdfsdk/include/fpdfview.h
index 182d3cfdbd..a563762613 100644
--- a/fpdfsdk/include/fpdfview.h
+++ b/fpdfsdk/include/fpdfview.h
@@ -1,578 +1,578 @@
-// 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 _FPDFVIEW_H_
-#define _FPDFVIEW_H_
-
-#if defined(_WIN32) && !defined(__WINDOWS__)
-#include <windows.h>
-#endif
-
-// Data types
-typedef void* FPDF_MODULEMGR;
-
-// PDF types
-typedef void* FPDF_DOCUMENT;
-typedef void* FPDF_PAGE;
-typedef void* FPDF_PAGEOBJECT; // Page object(text, path, etc)
-typedef void* FPDF_PATH;
-typedef void* FPDF_CLIPPATH;
-typedef void* FPDF_BITMAP;
-typedef void* FPDF_FONT;
-
-typedef void* FPDF_TEXTPAGE;
-typedef void* FPDF_SCHHANDLE;
-typedef void* FPDF_PAGELINK;
-typedef void* FPDF_HMODULE;
-typedef void* FPDF_DOCSCHHANDLE;
-
-typedef void* FPDF_BOOKMARK;
-typedef void* FPDF_DEST;
-typedef void* FPDF_ACTION;
-typedef void* FPDF_LINK;
-
-// Basic data types
-typedef int FPDF_BOOL;
-typedef int FPDF_ERROR;
-typedef unsigned long FPDF_DWORD;
-
-typedef float FS_FLOAT;
-
-// String types
-typedef unsigned short FPDF_WCHAR;
-typedef unsigned char const* FPDF_LPCBYTE;
-
-// FPDFSDK may use three types of strings: byte string, wide string (UTF-16LE encoded), and platform dependent string
-typedef const char* FPDF_BYTESTRING;
-
-typedef const unsigned short* FPDF_WIDESTRING; // Foxit PDF SDK always use UTF-16LE encoding wide string,
- // each character use 2 bytes (except surrogation), with low byte first.
-
-// For Windows programmers: for most case it's OK to treat FPDF_WIDESTRING as Windows unicode string,
-// however, special care needs to be taken if you expect to process Unicode larger than 0xffff.
-// For Linux/Unix programmers: most compiler/library environment uses 4 bytes for a Unicode character,
-// you have to convert between FPDF_WIDESTRING and system wide string by yourself.
-
-#ifdef _WIN32_WCE
-typedef const unsigned short* FPDF_STRING;
-#else
-typedef const char* FPDF_STRING;
-#endif
-
-#ifndef _FS_DEF_MATRIX_
-#define _FS_DEF_MATRIX_
-/** @brief Matrix for transformation. */
-typedef struct _FS_MATRIX_
-{
- float a; /**< @brief Coefficient a.*/
- float b; /**< @brief Coefficient b.*/
- float c; /**< @brief Coefficient c.*/
- float d; /**< @brief Coefficient d.*/
- float e; /**< @brief Coefficient e.*/
- float f; /**< @brief Coefficient f.*/
-} FS_MATRIX;
-#endif
-
-#ifndef _FS_DEF_RECTF_
-#define _FS_DEF_RECTF_
-/** @brief Rectangle area(float) in device or page coordination system. */
-typedef struct _FS_RECTF_
-{
- /**@{*/
- /** @brief The x-coordinate of the left-top corner. */
- float left;
- /** @brief The y-coordinate of the left-top corner. */
- float top;
- /** @brief The x-coordinate of the right-bottom corner. */
- float right;
- /** @brief The y-coordinate of the right-bottom corner. */
- float bottom;
- /**@}*/
-}* FS_LPRECTF, FS_RECTF;
-/** @brief Const Pointer to ::FS_RECTF structure.*/
-typedef const FS_RECTF* FS_LPCRECTF;
-#endif
-
-#if defined(_WIN32) && defined(FPDFSDK_EXPORTS)
-// On Windows system, functions are exported in a DLL
-#define DLLEXPORT __declspec( dllexport )
-#define STDCALL __stdcall
-#else
-#define DLLEXPORT
-#define STDCALL
-#endif
-
-extern const char g_ExpireDate[];
-extern const char g_ModuleCodes[];
-
-// Exported Functions
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-// Function: FPDF_InitLibrary
-// Initialize the FPDFSDK library
-// Parameters:
-// hInstance - For WIN32 system only: the instance of the executable or DLL module.
-// Return value:
-// None.
-// Comments:
-// You have to call this function before you can call any PDF processing functions.
-
-DLLEXPORT void STDCALL FPDF_InitLibrary(void* hInstance);
-
-
-// Function: FPDF_DestroyLibary
-// Release all resources allocated by the FPDFSDK library.
-// Parameters:
-// None.
-// Return value:
-// None.
-// Comments:
-// You can call this function to release all memory blocks allocated by the library.
-// After this function called, you should not call any PDF processing functions.
-DLLEXPORT void STDCALL FPDF_DestroyLibrary();
-
-//Policy for accessing the local machine time.
-#define FPDF_POLICY_MACHINETIME_ACCESS 0
-
-// Function: FPDF_SetSandBoxPolicy
-// Set the policy for the sandbox environment.
-// Parameters:
-// policy - The specified policy for setting, for example:FPDF_POLICY_MACHINETIME_ACCESS.
-// enable - True for enable, False for disable the policy.
-// Return value:
-// None.
-DLLEXPORT void STDCALL FPDF_SetSandBoxPolicy(FPDF_DWORD policy, FPDF_BOOL enable);
-
-/**
-* Open and load a PDF document.
-* @param[in] file_path - Path to the PDF file (including extension).
-* @param[in] password - A string used as the password for PDF file.
-* If no password needed, empty or NULL can be used.
-* @note Loaded document can be closed by FPDF_CloseDocument.
-* If this function fails, you can use FPDF_GetLastError() to retrieve
-* the reason why it fails.
-* @retval A handle to the loaded document. If failed, NULL is returned.
-*/
-DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadDocument(FPDF_STRING file_path,
- FPDF_BYTESTRING password);
-
-// Function: FPDF_LoadMemDocument
-// Open and load a PDF document from memory.
-// Parameters:
-// data_buf - Pointer to a buffer containing the PDF document.
-// size - Number of bytes in the PDF document.
-// password - A string used as the password for PDF file.
-// If no password needed, empty or NULL can be used.
-// Return value:
-// A handle to the loaded document. If failed, NULL is returned.
-// Comments:
-// The memory buffer must remain valid when the document is open.
-// Loaded document can be closed by FPDF_CloseDocument.
-// If this function fails, you can use FPDF_GetLastError() to retrieve
-// the reason why it fails.
-//
-DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadMemDocument(const void* data_buf,
- int size, FPDF_BYTESTRING password);
-
-// Structure for custom file access.
-typedef struct {
- // File length, in bytes.
- unsigned long m_FileLen;
-
- // A function pointer for getting a block of data from specific position.
- // Position is specified by byte offset from beginning of the file.
- // The position and size will never go out range of file length.
- // It may be possible for FPDFSDK to call this function multiple times for same position.
- // Return value: should be non-zero if successful, zero for error.
- int (*m_GetBlock)(void* param, unsigned long position, unsigned char* pBuf, unsigned long size);
-
- // A custom pointer for all implementation specific data.
- // This pointer will be used as the first parameter to m_GetBlock callback.
- void* m_Param;
-} FPDF_FILEACCESS;
-
-// Function: FPDF_LoadCustomDocument
-// Load PDF document from a custom access descriptor.
-// Parameters:
-// pFileAccess - A structure for access the file.
-// password - Optional password for decrypting the PDF file.
-// Return value:
-// A handle to the loaded document. If failed, NULL is returned.
-// Comments:
-// The application should maintain the file resources being valid until the PDF document close.
-// Loaded document can be closed by FPDF_CloseDocument.
-DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadCustomDocument(FPDF_FILEACCESS* pFileAccess,
- FPDF_BYTESTRING password);
-
-// Function: FPDF_GetFileVersion
-// Get the file version of the specific PDF document.
-// Parameters:
-// doc - Handle to document.
-// fileVersion - The PDF file version. File version: 14 for 1.4, 15 for 1.5, ...
-// Return value:
-// TRUE if this call succeed, If failed, FALSE is returned.
-// Comments:
-// If the document is created by function ::FPDF_CreateNewDocument, then this function would always fail.
-DLLEXPORT FPDF_BOOL STDCALL FPDF_GetFileVersion(FPDF_DOCUMENT doc, int* fileVersion);
-
-#define FPDF_ERR_SUCCESS 0 // No error.
-#define FPDF_ERR_UNKNOWN 1 // Unknown error.
-#define FPDF_ERR_FILE 2 // File not found or could not be opened.
-#define FPDF_ERR_FORMAT 3 // File not in PDF format or corrupted.
-#define FPDF_ERR_PASSWORD 4 // Password required or incorrect password.
-#define FPDF_ERR_SECURITY 5 // Unsupported security scheme.
-#define FPDF_ERR_PAGE 6 // Page not found or content error.
-
-// Function: FPDF_GetLastError
-// Get last error code when an SDK function failed.
-// Parameters:
-// None.
-// Return value:
-// A 32-bit integer indicating error codes (defined above).
-// Comments:
-// If the previous SDK call succeeded, the return value of this function
-// is not defined.
-//
-DLLEXPORT unsigned long STDCALL FPDF_GetLastError();
-
-// Function: FPDF_GetDocPermission
-// Get file permission flags of the document.
-// Parameters:
-// document - Handle to document. Returned by FPDF_LoadDocument function.
-// Return value:
-// A 32-bit integer indicating permission flags. Please refer to PDF Reference for
-// detailed description. If the document is not protected, 0xffffffff will be returned.
-//
-DLLEXPORT unsigned long STDCALL FPDF_GetDocPermissions(FPDF_DOCUMENT document);
-
-// Function: FPDF_GetPageCount
-// Get total number of pages in a document.
-// Parameters:
-// document - Handle to document. Returned by FPDF_LoadDocument function.
-// Return value:
-// Total number of pages in the document.
-//
-DLLEXPORT int STDCALL FPDF_GetPageCount(FPDF_DOCUMENT document);
-
-// Function: FPDF_LoadPage
-// Load a page inside a document.
-// Parameters:
-// document - Handle to document. Returned by FPDF_LoadDocument function.
-// page_index - Index number of the page. 0 for the first page.
-// Return value:
-// A handle to the loaded page. If failed, NULL is returned.
-// Comments:
-// Loaded page can be rendered to devices using FPDF_RenderPage function.
-// Loaded page can be closed by FPDF_ClosePage.
-//
-DLLEXPORT FPDF_PAGE STDCALL FPDF_LoadPage(FPDF_DOCUMENT document, int page_index);
-
-// Function: FPDF_GetPageWidth
-// Get page width.
-// Parameters:
-// page - Handle to the page. Returned by FPDF_LoadPage function.
-// Return value:
-// Page width (excluding non-displayable area) measured in points.
-// One point is 1/72 inch (around 0.3528 mm).
-//
-DLLEXPORT double STDCALL FPDF_GetPageWidth(FPDF_PAGE page);
-
-// Function: FPDF_GetPageHeight
-// Get page height.
-// Parameters:
-// page - Handle to the page. Returned by FPDF_LoadPage function.
-// Return value:
-// Page height (excluding non-displayable area) measured in points.
-// One point is 1/72 inch (around 0.3528 mm)
-//
-DLLEXPORT double STDCALL FPDF_GetPageHeight(FPDF_PAGE page);
-
-// Function: FPDF_GetPageSizeByIndex
-// Get the size of a page by index.
-// Parameters:
-// document - Handle to document. Returned by FPDF_LoadDocument function.
-// page_index - Page index, zero for the first page.
-// width - Pointer to a double value receiving the page width (in points).
-// height - Pointer to a double value receiving the page height (in points).
-// Return value:
-// Non-zero for success. 0 for error (document or page not found).
-//
-DLLEXPORT int STDCALL FPDF_GetPageSizeByIndex(FPDF_DOCUMENT document, int page_index, double* width, double* height);
-
-
-// Page rendering flags. They can be combined with bit OR.
-#define FPDF_ANNOT 0x01 // Set if annotations are to be rendered.
-#define FPDF_LCD_TEXT 0x02 // Set if using text rendering optimized for LCD display.
-#define FPDF_NO_NATIVETEXT 0x04 // Don't use the native text output available on some platforms
-#define FPDF_GRAYSCALE 0x08 // Grayscale output.
-#define FPDF_DEBUG_INFO 0x80 // Set if you want to get some debug info.
- // Please discuss with Foxit first if you need to collect debug info.
-#define FPDF_NO_CATCH 0x100 // Set if you don't want to catch exception.
-#define FPDF_RENDER_LIMITEDIMAGECACHE 0x200 // Limit image cache size.
-#define FPDF_RENDER_FORCEHALFTONE 0x400 // Always use halftone for image stretching.
-#define FPDF_PRINTING 0x800 // Render for printing.
-#define FPDF_REVERSE_BYTE_ORDER 0x10 //set whether render in a reverse Byte order, this flag only
- //enable when render to a bitmap.
-#ifdef _WIN32
-// Function: FPDF_RenderPage
-// Render contents in a page to a device (screen, bitmap, or printer).
-// This function is only supported on Windows system.
-// Parameters:
-// dc - Handle to device context.
-// page - Handle to the page. Returned by FPDF_LoadPage function.
-// start_x - Left pixel position of the display area in the device coordinate.
-// start_y - Top pixel position of the display area in the device coordinate.
-// size_x - Horizontal size (in pixels) for displaying the page.
-// size_y - Vertical size (in pixels) for displaying the page.
-// rotate - Page orientation: 0 (normal), 1 (rotated 90 degrees clockwise),
-// 2 (rotated 180 degrees), 3 (rotated 90 degrees counter-clockwise).
-// flags - 0 for normal display, or combination of flags defined above.
-// Return value:
-// None.
-//
-DLLEXPORT void STDCALL FPDF_RenderPage(HDC dc, FPDF_PAGE page, int start_x, int start_y, int size_x, int size_y,
- int rotate, int flags);
-#endif
-
-// Function: FPDF_RenderPageBitmap
-// Render contents in a page to a device independent bitmap
-// Parameters:
-// bitmap - Handle to the device independent bitmap (as the output buffer).
-// Bitmap handle can be created by FPDFBitmap_Create function.
-// page - Handle to the page. Returned by FPDF_LoadPage function.
-// start_x - Left pixel position of the display area in the bitmap coordinate.
-// start_y - Top pixel position of the display area in the bitmap coordinate.
-// size_x - Horizontal size (in pixels) for displaying the page.
-// size_y - Vertical size (in pixels) for displaying the page.
-// rotate - Page orientation: 0 (normal), 1 (rotated 90 degrees clockwise),
-// 2 (rotated 180 degrees), 3 (rotated 90 degrees counter-clockwise).
-// flags - 0 for normal display, or combination of flags defined above.
-// Return value:
-// None.
-//
-DLLEXPORT void STDCALL FPDF_RenderPageBitmap(FPDF_BITMAP bitmap, FPDF_PAGE page, int start_x, int start_y,
- int size_x, int size_y, int rotate, int flags);
-
-// Function: FPDF_ClosePage
-// Close a loaded PDF page.
-// Parameters:
-// page - Handle to the loaded page.
-// Return value:
-// None.
-//
-DLLEXPORT void STDCALL FPDF_ClosePage(FPDF_PAGE page);
-
-// Function: FPDF_CloseDocument
-// Close a loaded PDF document.
-// Parameters:
-// document - Handle to the loaded document.
-// Return value:
-// None.
-//
-DLLEXPORT void STDCALL FPDF_CloseDocument(FPDF_DOCUMENT document);
-
-// Function: FPDF_DeviceToPage
-// Convert the screen coordinate of a point to page coordinate.
-// Parameters:
-// page - Handle to the page. Returned by FPDF_LoadPage function.
-// start_x - Left pixel position of the display area in the device coordinate.
-// start_y - Top pixel position of the display area in the device coordinate.
-// size_x - Horizontal size (in pixels) for displaying the page.
-// size_y - Vertical size (in pixels) for displaying the page.
-// rotate - Page orientation: 0 (normal), 1 (rotated 90 degrees clockwise),
-// 2 (rotated 180 degrees), 3 (rotated 90 degrees counter-clockwise).
-// device_x - X value in device coordinate, for the point to be converted.
-// device_y - Y value in device coordinate, for the point to be converted.
-// page_x - A Pointer to a double receiving the converted X value in page coordinate.
-// page_y - A Pointer to a double receiving the converted Y value in page coordinate.
-// Return value:
-// None.
-// Comments:
-// The page coordinate system has its origin at left-bottom corner of the page, with X axis goes along
-// the bottom side to the right, and Y axis goes along the left side upward. NOTE: this coordinate system
-// can be altered when you zoom, scroll, or rotate a page, however, a point on the page should always have
-// the same coordinate values in the page coordinate system.
-//
-// The device coordinate system is device dependent. For screen device, its origin is at left-top
-// corner of the window. However this origin can be altered by Windows coordinate transformation
-// utilities. You must make sure the start_x, start_y, size_x, size_y and rotate parameters have exactly
-// same values as you used in FPDF_RenderPage() function call.
-//
-DLLEXPORT void STDCALL FPDF_DeviceToPage(FPDF_PAGE page, int start_x, int start_y, int size_x, int size_y,
- int rotate, int device_x, int device_y, double* page_x, double* page_y);
-
-// Function: FPDF_PageToDevice
-// Convert the page coordinate of a point to screen coordinate.
-// Parameters:
-// page - Handle to the page. Returned by FPDF_LoadPage function.
-// start_x - Left pixel position of the display area in the device coordinate.
-// start_y - Top pixel position of the display area in the device coordinate.
-// size_x - Horizontal size (in pixels) for displaying the page.
-// size_y - Vertical size (in pixels) for displaying the page.
-// rotate - Page orientation: 0 (normal), 1 (rotated 90 degrees clockwise),
-// 2 (rotated 180 degrees), 3 (rotated 90 degrees counter-clockwise).
-// page_x - X value in page coordinate, for the point to be converted.
-// page_y - Y value in page coordinate, for the point to be converted.
-// device_x - A pointer to an integer receiving the result X value in device coordinate.
-// device_y - A pointer to an integer receiving the result Y value in device coordinate.
-// Return value:
-// None.
-// Comments:
-// See comments of FPDF_DeviceToPage() function.
-//
-DLLEXPORT void STDCALL FPDF_PageToDevice(FPDF_PAGE page, int start_x, int start_y, int size_x, int size_y,
- int rotate, double page_x, double page_y, int* device_x, int* device_y);
-
-// Function: FPDFBitmap_Create
-// Create a Foxit Device Independent Bitmap (FXDIB).
-// Parameters:
-// width - Number of pixels in a horizontal line of the bitmap. Must be greater than 0.
-// height - Number of pixels in a vertical line of the bitmap. Must be greater than 0.
-// alpha - A flag indicating whether alpha channel is used. Non-zero for using alpha, zero for not using.
-// Return value:
-// The created bitmap handle, or NULL if parameter error or out of memory.
-// Comments:
-// An FXDIB always use 4 byte per pixel. The first byte of a pixel is always double word aligned.
-// Each pixel contains red (R), green (G), blue (B) and optionally alpha (A) values.
-// The byte order is BGRx (the last byte unused if no alpha channel) or BGRA.
-//
-// The pixels in a horizontal line (also called scan line) are stored side by side, with left most
-// pixel stored first (with lower memory address). Each scan line uses width*4 bytes.
-//
-// Scan lines are stored one after another, with top most scan line stored first. There is no gap
-// between adjacent scan lines.
-//
-// This function allocates enough memory for holding all pixels in the bitmap, but it doesn't
-// initialize the buffer. Applications can use FPDFBitmap_FillRect to fill the bitmap using any color.
-DLLEXPORT FPDF_BITMAP STDCALL FPDFBitmap_Create(int width, int height, int alpha);
-
-// More DIB formats
-#define FPDFBitmap_Gray 1 // Gray scale bitmap, one byte per pixel.
-#define FPDFBitmap_BGR 2 // 3 bytes per pixel, byte order: blue, green, red.
-#define FPDFBitmap_BGRx 3 // 4 bytes per pixel, byte order: blue, green, red, unused.
-#define FPDFBitmap_BGRA 4 // 4 bytes per pixel, byte order: blue, green, red, alpha.
-
-// Function: FPDFBitmap_CreateEx
-// Create a Foxit Device Independent Bitmap (FXDIB)
-// Parameters:
-// width - Number of pixels in a horizontal line of the bitmap. Must be greater than 0.
-// height - Number of pixels in a vertical line of the bitmap. Must be greater than 0.
-// format - A number indicating for bitmap format, as defined above.
-// first_scan - A pointer to the first byte of first scan line, for external buffer
-// only. If this parameter is NULL, then the SDK will create its own buffer.
-// stride - Number of bytes for each scan line, for external buffer only..
-// Return value:
-// The created bitmap handle, or NULL if parameter error or out of memory.
-// Comments:
-// Similar to FPDFBitmap_Create function, with more formats and external buffer supported.
-// Bitmap created by this function can be used in any place that a FPDF_BITMAP handle is
-// required.
-//
-// If external scanline buffer is used, then the application should destroy the buffer
-// by itself. FPDFBitmap_Destroy function will not destroy the buffer.
-//
-DLLEXPORT FPDF_BITMAP STDCALL FPDFBitmap_CreateEx(int width, int height, int format, void* first_scan, int stride);
-
-// Function: FPDFBitmap_FillRect
-// Fill a rectangle area in an FXDIB.
-// Parameters:
-// bitmap - The handle to the bitmap. Returned by FPDFBitmap_Create function.
-// left - The left side position. Starting from 0 at the left-most pixel.
-// top - The top side position. Starting from 0 at the top-most scan line.
-// width - Number of pixels to be filled in each scan line.
-// height - Number of scan lines to be filled.
-// red - A number from 0 to 255, identifying the red intensity.
-// green - A number from 0 to 255, identifying the green intensity.
-// blue - A number from 0 to 255, identifying the blue intensity.
-// alpha - (Only if the alpha channeled is used when bitmap created) A number from 0 to 255,
-// identifying the alpha value.
-// Return value:
-// None.
-// Comments:
-// This function set the color and (optionally) alpha value in specified region of the bitmap.
-// NOTE: If alpha channel is used, this function does NOT composite the background with the source color,
-// instead the background will be replaced by the source color and alpha.
-// If alpha channel is not used, the "alpha" parameter is ignored.
-//
-DLLEXPORT void STDCALL FPDFBitmap_FillRect(FPDF_BITMAP bitmap, int left, int top, int width, int height,
- int red, int green, int blue, int alpha);
-
-// Function: FPDFBitmap_GetBuffer
-// Get data buffer of an FXDIB
-// Parameters:
-// bitmap - Handle to the bitmap. Returned by FPDFBitmap_Create function.
-// Return value:
-// The pointer to the first byte of the bitmap buffer.
-// Comments:
-// The stride may be more than width * number of bytes per pixel
-// Applications can use this function to get the bitmap buffer pointer, then manipulate any color
-// and/or alpha values for any pixels in the bitmap.
-DLLEXPORT void* STDCALL FPDFBitmap_GetBuffer(FPDF_BITMAP bitmap);
-
-// Function: FPDFBitmap_GetWidth
-// Get width of an FXDIB.
-// Parameters:
-// bitmap - Handle to the bitmap. Returned by FPDFBitmap_Create function.
-// Return value:
-// The number of pixels in a horizontal line of the bitmap.
-DLLEXPORT int STDCALL FPDFBitmap_GetWidth(FPDF_BITMAP bitmap);
-
-// Function: FPDFBitmap_GetHeight
-// Get height of an FXDIB.
-// Parameters:
-// bitmap - Handle to the bitmap. Returned by FPDFBitmap_Create function.
-// Return value:
-// The number of pixels in a vertical line of the bitmap.
-DLLEXPORT int STDCALL FPDFBitmap_GetHeight(FPDF_BITMAP bitmap);
-
-// Function: FPDFBitmap_GetStride
-// Get number of bytes for each scan line in the bitmap buffer.
-// Parameters:
-// bitmap - Handle to the bitmap. Returned by FPDFBitmap_Create function.
-// Return value:
-// The number of bytes for each scan line in the bitmap buffer.
-// Comments:
-// The stride may be more than width * number of bytes per pixel
-DLLEXPORT int STDCALL FPDFBitmap_GetStride(FPDF_BITMAP bitmap);
-
-// Function: FPDFBitmap_Destroy
-// Destroy an FXDIB and release all related buffers.
-// Parameters:
-// bitmap - Handle to the bitmap. Returned by FPDFBitmap_Create function.
-// Return value:
-// None.
-// Comments:
-// This function will not destroy any external buffer.
-//
-DLLEXPORT void STDCALL FPDFBitmap_Destroy(FPDF_BITMAP bitmap);
-
-// Function: FPDF_VIEWERREF_GetPrintScaling
-// Whether the PDF document prefers to be scaled or not.
-// Parameters:
-// document - Handle to the loaded document.
-// Return value:
-// None.
-//
-DLLEXPORT FPDF_BOOL STDCALL FPDF_VIEWERREF_GetPrintScaling(FPDF_DOCUMENT document);
-
-// Function: FPDF_GetNamedDestByName
-// get a special dest handle by the index.
-// Parameters:
-// document - Handle to the loaded document.
-// name - The name of a special named dest.
-// Return value:
-// The handle of the dest.
-//
-DLLEXPORT FPDF_DEST STDCALL FPDF_GetNamedDestByName(FPDF_DOCUMENT document,FPDF_BYTESTRING name);
-
-#ifdef __cplusplus
-};
-#endif
-
-#endif // _FPDFVIEW_H_
+// 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 _FPDFVIEW_H_
+#define _FPDFVIEW_H_
+
+#if defined(_WIN32) && !defined(__WINDOWS__)
+#include <windows.h>
+#endif
+
+// Data types
+typedef void* FPDF_MODULEMGR;
+
+// PDF types
+typedef void* FPDF_DOCUMENT;
+typedef void* FPDF_PAGE;
+typedef void* FPDF_PAGEOBJECT; // Page object(text, path, etc)
+typedef void* FPDF_PATH;
+typedef void* FPDF_CLIPPATH;
+typedef void* FPDF_BITMAP;
+typedef void* FPDF_FONT;
+
+typedef void* FPDF_TEXTPAGE;
+typedef void* FPDF_SCHHANDLE;
+typedef void* FPDF_PAGELINK;
+typedef void* FPDF_HMODULE;
+typedef void* FPDF_DOCSCHHANDLE;
+
+typedef void* FPDF_BOOKMARK;
+typedef void* FPDF_DEST;
+typedef void* FPDF_ACTION;
+typedef void* FPDF_LINK;
+
+// Basic data types
+typedef int FPDF_BOOL;
+typedef int FPDF_ERROR;
+typedef unsigned long FPDF_DWORD;
+
+typedef float FS_FLOAT;
+
+// String types
+typedef unsigned short FPDF_WCHAR;
+typedef unsigned char const* FPDF_LPCBYTE;
+
+// FPDFSDK may use three types of strings: byte string, wide string (UTF-16LE encoded), and platform dependent string
+typedef const char* FPDF_BYTESTRING;
+
+typedef const unsigned short* FPDF_WIDESTRING; // Foxit PDF SDK always use UTF-16LE encoding wide string,
+ // each character use 2 bytes (except surrogation), with low byte first.
+
+// For Windows programmers: for most case it's OK to treat FPDF_WIDESTRING as Windows unicode string,
+// however, special care needs to be taken if you expect to process Unicode larger than 0xffff.
+// For Linux/Unix programmers: most compiler/library environment uses 4 bytes for a Unicode character,
+// you have to convert between FPDF_WIDESTRING and system wide string by yourself.
+
+#ifdef _WIN32_WCE
+typedef const unsigned short* FPDF_STRING;
+#else
+typedef const char* FPDF_STRING;
+#endif
+
+#ifndef _FS_DEF_MATRIX_
+#define _FS_DEF_MATRIX_
+/** @brief Matrix for transformation. */
+typedef struct _FS_MATRIX_
+{
+ float a; /**< @brief Coefficient a.*/
+ float b; /**< @brief Coefficient b.*/
+ float c; /**< @brief Coefficient c.*/
+ float d; /**< @brief Coefficient d.*/
+ float e; /**< @brief Coefficient e.*/
+ float f; /**< @brief Coefficient f.*/
+} FS_MATRIX;
+#endif
+
+#ifndef _FS_DEF_RECTF_
+#define _FS_DEF_RECTF_
+/** @brief Rectangle area(float) in device or page coordination system. */
+typedef struct _FS_RECTF_
+{
+ /**@{*/
+ /** @brief The x-coordinate of the left-top corner. */
+ float left;
+ /** @brief The y-coordinate of the left-top corner. */
+ float top;
+ /** @brief The x-coordinate of the right-bottom corner. */
+ float right;
+ /** @brief The y-coordinate of the right-bottom corner. */
+ float bottom;
+ /**@}*/
+}* FS_LPRECTF, FS_RECTF;
+/** @brief Const Pointer to ::FS_RECTF structure.*/
+typedef const FS_RECTF* FS_LPCRECTF;
+#endif
+
+#if defined(_WIN32) && defined(FPDFSDK_EXPORTS)
+// On Windows system, functions are exported in a DLL
+#define DLLEXPORT __declspec( dllexport )
+#define STDCALL __stdcall
+#else
+#define DLLEXPORT
+#define STDCALL
+#endif
+
+extern const char g_ExpireDate[];
+extern const char g_ModuleCodes[];
+
+// Exported Functions
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// Function: FPDF_InitLibrary
+// Initialize the FPDFSDK library
+// Parameters:
+// hInstance - For WIN32 system only: the instance of the executable or DLL module.
+// Return value:
+// None.
+// Comments:
+// You have to call this function before you can call any PDF processing functions.
+
+DLLEXPORT void STDCALL FPDF_InitLibrary(void* hInstance);
+
+
+// Function: FPDF_DestroyLibary
+// Release all resources allocated by the FPDFSDK library.
+// Parameters:
+// None.
+// Return value:
+// None.
+// Comments:
+// You can call this function to release all memory blocks allocated by the library.
+// After this function called, you should not call any PDF processing functions.
+DLLEXPORT void STDCALL FPDF_DestroyLibrary();
+
+//Policy for accessing the local machine time.
+#define FPDF_POLICY_MACHINETIME_ACCESS 0
+
+// Function: FPDF_SetSandBoxPolicy
+// Set the policy for the sandbox environment.
+// Parameters:
+// policy - The specified policy for setting, for example:FPDF_POLICY_MACHINETIME_ACCESS.
+// enable - True for enable, False for disable the policy.
+// Return value:
+// None.
+DLLEXPORT void STDCALL FPDF_SetSandBoxPolicy(FPDF_DWORD policy, FPDF_BOOL enable);
+
+/**
+* Open and load a PDF document.
+* @param[in] file_path - Path to the PDF file (including extension).
+* @param[in] password - A string used as the password for PDF file.
+* If no password needed, empty or NULL can be used.
+* @note Loaded document can be closed by FPDF_CloseDocument.
+* If this function fails, you can use FPDF_GetLastError() to retrieve
+* the reason why it fails.
+* @retval A handle to the loaded document. If failed, NULL is returned.
+*/
+DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadDocument(FPDF_STRING file_path,
+ FPDF_BYTESTRING password);
+
+// Function: FPDF_LoadMemDocument
+// Open and load a PDF document from memory.
+// Parameters:
+// data_buf - Pointer to a buffer containing the PDF document.
+// size - Number of bytes in the PDF document.
+// password - A string used as the password for PDF file.
+// If no password needed, empty or NULL can be used.
+// Return value:
+// A handle to the loaded document. If failed, NULL is returned.
+// Comments:
+// The memory buffer must remain valid when the document is open.
+// Loaded document can be closed by FPDF_CloseDocument.
+// If this function fails, you can use FPDF_GetLastError() to retrieve
+// the reason why it fails.
+//
+DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadMemDocument(const void* data_buf,
+ int size, FPDF_BYTESTRING password);
+
+// Structure for custom file access.
+typedef struct {
+ // File length, in bytes.
+ unsigned long m_FileLen;
+
+ // A function pointer for getting a block of data from specific position.
+ // Position is specified by byte offset from beginning of the file.
+ // The position and size will never go out range of file length.
+ // It may be possible for FPDFSDK to call this function multiple times for same position.
+ // Return value: should be non-zero if successful, zero for error.
+ int (*m_GetBlock)(void* param, unsigned long position, unsigned char* pBuf, unsigned long size);
+
+ // A custom pointer for all implementation specific data.
+ // This pointer will be used as the first parameter to m_GetBlock callback.
+ void* m_Param;
+} FPDF_FILEACCESS;
+
+// Function: FPDF_LoadCustomDocument
+// Load PDF document from a custom access descriptor.
+// Parameters:
+// pFileAccess - A structure for access the file.
+// password - Optional password for decrypting the PDF file.
+// Return value:
+// A handle to the loaded document. If failed, NULL is returned.
+// Comments:
+// The application should maintain the file resources being valid until the PDF document close.
+// Loaded document can be closed by FPDF_CloseDocument.
+DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadCustomDocument(FPDF_FILEACCESS* pFileAccess,
+ FPDF_BYTESTRING password);
+
+// Function: FPDF_GetFileVersion
+// Get the file version of the specific PDF document.
+// Parameters:
+// doc - Handle to document.
+// fileVersion - The PDF file version. File version: 14 for 1.4, 15 for 1.5, ...
+// Return value:
+// TRUE if this call succeed, If failed, FALSE is returned.
+// Comments:
+// If the document is created by function ::FPDF_CreateNewDocument, then this function would always fail.
+DLLEXPORT FPDF_BOOL STDCALL FPDF_GetFileVersion(FPDF_DOCUMENT doc, int* fileVersion);
+
+#define FPDF_ERR_SUCCESS 0 // No error.
+#define FPDF_ERR_UNKNOWN 1 // Unknown error.
+#define FPDF_ERR_FILE 2 // File not found or could not be opened.
+#define FPDF_ERR_FORMAT 3 // File not in PDF format or corrupted.
+#define FPDF_ERR_PASSWORD 4 // Password required or incorrect password.
+#define FPDF_ERR_SECURITY 5 // Unsupported security scheme.
+#define FPDF_ERR_PAGE 6 // Page not found or content error.
+
+// Function: FPDF_GetLastError
+// Get last error code when an SDK function failed.
+// Parameters:
+// None.
+// Return value:
+// A 32-bit integer indicating error codes (defined above).
+// Comments:
+// If the previous SDK call succeeded, the return value of this function
+// is not defined.
+//
+DLLEXPORT unsigned long STDCALL FPDF_GetLastError();
+
+// Function: FPDF_GetDocPermission
+// Get file permission flags of the document.
+// Parameters:
+// document - Handle to document. Returned by FPDF_LoadDocument function.
+// Return value:
+// A 32-bit integer indicating permission flags. Please refer to PDF Reference for
+// detailed description. If the document is not protected, 0xffffffff will be returned.
+//
+DLLEXPORT unsigned long STDCALL FPDF_GetDocPermissions(FPDF_DOCUMENT document);
+
+// Function: FPDF_GetPageCount
+// Get total number of pages in a document.
+// Parameters:
+// document - Handle to document. Returned by FPDF_LoadDocument function.
+// Return value:
+// Total number of pages in the document.
+//
+DLLEXPORT int STDCALL FPDF_GetPageCount(FPDF_DOCUMENT document);
+
+// Function: FPDF_LoadPage
+// Load a page inside a document.
+// Parameters:
+// document - Handle to document. Returned by FPDF_LoadDocument function.
+// page_index - Index number of the page. 0 for the first page.
+// Return value:
+// A handle to the loaded page. If failed, NULL is returned.
+// Comments:
+// Loaded page can be rendered to devices using FPDF_RenderPage function.
+// Loaded page can be closed by FPDF_ClosePage.
+//
+DLLEXPORT FPDF_PAGE STDCALL FPDF_LoadPage(FPDF_DOCUMENT document, int page_index);
+
+// Function: FPDF_GetPageWidth
+// Get page width.
+// Parameters:
+// page - Handle to the page. Returned by FPDF_LoadPage function.
+// Return value:
+// Page width (excluding non-displayable area) measured in points.
+// One point is 1/72 inch (around 0.3528 mm).
+//
+DLLEXPORT double STDCALL FPDF_GetPageWidth(FPDF_PAGE page);
+
+// Function: FPDF_GetPageHeight
+// Get page height.
+// Parameters:
+// page - Handle to the page. Returned by FPDF_LoadPage function.
+// Return value:
+// Page height (excluding non-displayable area) measured in points.
+// One point is 1/72 inch (around 0.3528 mm)
+//
+DLLEXPORT double STDCALL FPDF_GetPageHeight(FPDF_PAGE page);
+
+// Function: FPDF_GetPageSizeByIndex
+// Get the size of a page by index.
+// Parameters:
+// document - Handle to document. Returned by FPDF_LoadDocument function.
+// page_index - Page index, zero for the first page.
+// width - Pointer to a double value receiving the page width (in points).
+// height - Pointer to a double value receiving the page height (in points).
+// Return value:
+// Non-zero for success. 0 for error (document or page not found).
+//
+DLLEXPORT int STDCALL FPDF_GetPageSizeByIndex(FPDF_DOCUMENT document, int page_index, double* width, double* height);
+
+
+// Page rendering flags. They can be combined with bit OR.
+#define FPDF_ANNOT 0x01 // Set if annotations are to be rendered.
+#define FPDF_LCD_TEXT 0x02 // Set if using text rendering optimized for LCD display.
+#define FPDF_NO_NATIVETEXT 0x04 // Don't use the native text output available on some platforms
+#define FPDF_GRAYSCALE 0x08 // Grayscale output.
+#define FPDF_DEBUG_INFO 0x80 // Set if you want to get some debug info.
+ // Please discuss with Foxit first if you need to collect debug info.
+#define FPDF_NO_CATCH 0x100 // Set if you don't want to catch exception.
+#define FPDF_RENDER_LIMITEDIMAGECACHE 0x200 // Limit image cache size.
+#define FPDF_RENDER_FORCEHALFTONE 0x400 // Always use halftone for image stretching.
+#define FPDF_PRINTING 0x800 // Render for printing.
+#define FPDF_REVERSE_BYTE_ORDER 0x10 //set whether render in a reverse Byte order, this flag only
+ //enable when render to a bitmap.
+#ifdef _WIN32
+// Function: FPDF_RenderPage
+// Render contents in a page to a device (screen, bitmap, or printer).
+// This function is only supported on Windows system.
+// Parameters:
+// dc - Handle to device context.
+// page - Handle to the page. Returned by FPDF_LoadPage function.
+// start_x - Left pixel position of the display area in the device coordinate.
+// start_y - Top pixel position of the display area in the device coordinate.
+// size_x - Horizontal size (in pixels) for displaying the page.
+// size_y - Vertical size (in pixels) for displaying the page.
+// rotate - Page orientation: 0 (normal), 1 (rotated 90 degrees clockwise),
+// 2 (rotated 180 degrees), 3 (rotated 90 degrees counter-clockwise).
+// flags - 0 for normal display, or combination of flags defined above.
+// Return value:
+// None.
+//
+DLLEXPORT void STDCALL FPDF_RenderPage(HDC dc, FPDF_PAGE page, int start_x, int start_y, int size_x, int size_y,
+ int rotate, int flags);
+#endif
+
+// Function: FPDF_RenderPageBitmap
+// Render contents in a page to a device independent bitmap
+// Parameters:
+// bitmap - Handle to the device independent bitmap (as the output buffer).
+// Bitmap handle can be created by FPDFBitmap_Create function.
+// page - Handle to the page. Returned by FPDF_LoadPage function.
+// start_x - Left pixel position of the display area in the bitmap coordinate.
+// start_y - Top pixel position of the display area in the bitmap coordinate.
+// size_x - Horizontal size (in pixels) for displaying the page.
+// size_y - Vertical size (in pixels) for displaying the page.
+// rotate - Page orientation: 0 (normal), 1 (rotated 90 degrees clockwise),
+// 2 (rotated 180 degrees), 3 (rotated 90 degrees counter-clockwise).
+// flags - 0 for normal display, or combination of flags defined above.
+// Return value:
+// None.
+//
+DLLEXPORT void STDCALL FPDF_RenderPageBitmap(FPDF_BITMAP bitmap, FPDF_PAGE page, int start_x, int start_y,
+ int size_x, int size_y, int rotate, int flags);
+
+// Function: FPDF_ClosePage
+// Close a loaded PDF page.
+// Parameters:
+// page - Handle to the loaded page.
+// Return value:
+// None.
+//
+DLLEXPORT void STDCALL FPDF_ClosePage(FPDF_PAGE page);
+
+// Function: FPDF_CloseDocument
+// Close a loaded PDF document.
+// Parameters:
+// document - Handle to the loaded document.
+// Return value:
+// None.
+//
+DLLEXPORT void STDCALL FPDF_CloseDocument(FPDF_DOCUMENT document);
+
+// Function: FPDF_DeviceToPage
+// Convert the screen coordinate of a point to page coordinate.
+// Parameters:
+// page - Handle to the page. Returned by FPDF_LoadPage function.
+// start_x - Left pixel position of the display area in the device coordinate.
+// start_y - Top pixel position of the display area in the device coordinate.
+// size_x - Horizontal size (in pixels) for displaying the page.
+// size_y - Vertical size (in pixels) for displaying the page.
+// rotate - Page orientation: 0 (normal), 1 (rotated 90 degrees clockwise),
+// 2 (rotated 180 degrees), 3 (rotated 90 degrees counter-clockwise).
+// device_x - X value in device coordinate, for the point to be converted.
+// device_y - Y value in device coordinate, for the point to be converted.
+// page_x - A Pointer to a double receiving the converted X value in page coordinate.
+// page_y - A Pointer to a double receiving the converted Y value in page coordinate.
+// Return value:
+// None.
+// Comments:
+// The page coordinate system has its origin at left-bottom corner of the page, with X axis goes along
+// the bottom side to the right, and Y axis goes along the left side upward. NOTE: this coordinate system
+// can be altered when you zoom, scroll, or rotate a page, however, a point on the page should always have
+// the same coordinate values in the page coordinate system.
+//
+// The device coordinate system is device dependent. For screen device, its origin is at left-top
+// corner of the window. However this origin can be altered by Windows coordinate transformation
+// utilities. You must make sure the start_x, start_y, size_x, size_y and rotate parameters have exactly
+// same values as you used in FPDF_RenderPage() function call.
+//
+DLLEXPORT void STDCALL FPDF_DeviceToPage(FPDF_PAGE page, int start_x, int start_y, int size_x, int size_y,
+ int rotate, int device_x, int device_y, double* page_x, double* page_y);
+
+// Function: FPDF_PageToDevice
+// Convert the page coordinate of a point to screen coordinate.
+// Parameters:
+// page - Handle to the page. Returned by FPDF_LoadPage function.
+// start_x - Left pixel position of the display area in the device coordinate.
+// start_y - Top pixel position of the display area in the device coordinate.
+// size_x - Horizontal size (in pixels) for displaying the page.
+// size_y - Vertical size (in pixels) for displaying the page.
+// rotate - Page orientation: 0 (normal), 1 (rotated 90 degrees clockwise),
+// 2 (rotated 180 degrees), 3 (rotated 90 degrees counter-clockwise).
+// page_x - X value in page coordinate, for the point to be converted.
+// page_y - Y value in page coordinate, for the point to be converted.
+// device_x - A pointer to an integer receiving the result X value in device coordinate.
+// device_y - A pointer to an integer receiving the result Y value in device coordinate.
+// Return value:
+// None.
+// Comments:
+// See comments of FPDF_DeviceToPage() function.
+//
+DLLEXPORT void STDCALL FPDF_PageToDevice(FPDF_PAGE page, int start_x, int start_y, int size_x, int size_y,
+ int rotate, double page_x, double page_y, int* device_x, int* device_y);
+
+// Function: FPDFBitmap_Create
+// Create a Foxit Device Independent Bitmap (FXDIB).
+// Parameters:
+// width - Number of pixels in a horizontal line of the bitmap. Must be greater than 0.
+// height - Number of pixels in a vertical line of the bitmap. Must be greater than 0.
+// alpha - A flag indicating whether alpha channel is used. Non-zero for using alpha, zero for not using.
+// Return value:
+// The created bitmap handle, or NULL if parameter error or out of memory.
+// Comments:
+// An FXDIB always use 4 byte per pixel. The first byte of a pixel is always double word aligned.
+// Each pixel contains red (R), green (G), blue (B) and optionally alpha (A) values.
+// The byte order is BGRx (the last byte unused if no alpha channel) or BGRA.
+//
+// The pixels in a horizontal line (also called scan line) are stored side by side, with left most
+// pixel stored first (with lower memory address). Each scan line uses width*4 bytes.
+//
+// Scan lines are stored one after another, with top most scan line stored first. There is no gap
+// between adjacent scan lines.
+//
+// This function allocates enough memory for holding all pixels in the bitmap, but it doesn't
+// initialize the buffer. Applications can use FPDFBitmap_FillRect to fill the bitmap using any color.
+DLLEXPORT FPDF_BITMAP STDCALL FPDFBitmap_Create(int width, int height, int alpha);
+
+// More DIB formats
+#define FPDFBitmap_Gray 1 // Gray scale bitmap, one byte per pixel.
+#define FPDFBitmap_BGR 2 // 3 bytes per pixel, byte order: blue, green, red.
+#define FPDFBitmap_BGRx 3 // 4 bytes per pixel, byte order: blue, green, red, unused.
+#define FPDFBitmap_BGRA 4 // 4 bytes per pixel, byte order: blue, green, red, alpha.
+
+// Function: FPDFBitmap_CreateEx
+// Create a Foxit Device Independent Bitmap (FXDIB)
+// Parameters:
+// width - Number of pixels in a horizontal line of the bitmap. Must be greater than 0.
+// height - Number of pixels in a vertical line of the bitmap. Must be greater than 0.
+// format - A number indicating for bitmap format, as defined above.
+// first_scan - A pointer to the first byte of first scan line, for external buffer
+// only. If this parameter is NULL, then the SDK will create its own buffer.
+// stride - Number of bytes for each scan line, for external buffer only..
+// Return value:
+// The created bitmap handle, or NULL if parameter error or out of memory.
+// Comments:
+// Similar to FPDFBitmap_Create function, with more formats and external buffer supported.
+// Bitmap created by this function can be used in any place that a FPDF_BITMAP handle is
+// required.
+//
+// If external scanline buffer is used, then the application should destroy the buffer
+// by itself. FPDFBitmap_Destroy function will not destroy the buffer.
+//
+DLLEXPORT FPDF_BITMAP STDCALL FPDFBitmap_CreateEx(int width, int height, int format, void* first_scan, int stride);
+
+// Function: FPDFBitmap_FillRect
+// Fill a rectangle area in an FXDIB.
+// Parameters:
+// bitmap - The handle to the bitmap. Returned by FPDFBitmap_Create function.
+// left - The left side position. Starting from 0 at the left-most pixel.
+// top - The top side position. Starting from 0 at the top-most scan line.
+// width - Number of pixels to be filled in each scan line.
+// height - Number of scan lines to be filled.
+// red - A number from 0 to 255, identifying the red intensity.
+// green - A number from 0 to 255, identifying the green intensity.
+// blue - A number from 0 to 255, identifying the blue intensity.
+// alpha - (Only if the alpha channeled is used when bitmap created) A number from 0 to 255,
+// identifying the alpha value.
+// Return value:
+// None.
+// Comments:
+// This function set the color and (optionally) alpha value in specified region of the bitmap.
+// NOTE: If alpha channel is used, this function does NOT composite the background with the source color,
+// instead the background will be replaced by the source color and alpha.
+// If alpha channel is not used, the "alpha" parameter is ignored.
+//
+DLLEXPORT void STDCALL FPDFBitmap_FillRect(FPDF_BITMAP bitmap, int left, int top, int width, int height,
+ int red, int green, int blue, int alpha);
+
+// Function: FPDFBitmap_GetBuffer
+// Get data buffer of an FXDIB
+// Parameters:
+// bitmap - Handle to the bitmap. Returned by FPDFBitmap_Create function.
+// Return value:
+// The pointer to the first byte of the bitmap buffer.
+// Comments:
+// The stride may be more than width * number of bytes per pixel
+// Applications can use this function to get the bitmap buffer pointer, then manipulate any color
+// and/or alpha values for any pixels in the bitmap.
+DLLEXPORT void* STDCALL FPDFBitmap_GetBuffer(FPDF_BITMAP bitmap);
+
+// Function: FPDFBitmap_GetWidth
+// Get width of an FXDIB.
+// Parameters:
+// bitmap - Handle to the bitmap. Returned by FPDFBitmap_Create function.
+// Return value:
+// The number of pixels in a horizontal line of the bitmap.
+DLLEXPORT int STDCALL FPDFBitmap_GetWidth(FPDF_BITMAP bitmap);
+
+// Function: FPDFBitmap_GetHeight
+// Get height of an FXDIB.
+// Parameters:
+// bitmap - Handle to the bitmap. Returned by FPDFBitmap_Create function.
+// Return value:
+// The number of pixels in a vertical line of the bitmap.
+DLLEXPORT int STDCALL FPDFBitmap_GetHeight(FPDF_BITMAP bitmap);
+
+// Function: FPDFBitmap_GetStride
+// Get number of bytes for each scan line in the bitmap buffer.
+// Parameters:
+// bitmap - Handle to the bitmap. Returned by FPDFBitmap_Create function.
+// Return value:
+// The number of bytes for each scan line in the bitmap buffer.
+// Comments:
+// The stride may be more than width * number of bytes per pixel
+DLLEXPORT int STDCALL FPDFBitmap_GetStride(FPDF_BITMAP bitmap);
+
+// Function: FPDFBitmap_Destroy
+// Destroy an FXDIB and release all related buffers.
+// Parameters:
+// bitmap - Handle to the bitmap. Returned by FPDFBitmap_Create function.
+// Return value:
+// None.
+// Comments:
+// This function will not destroy any external buffer.
+//
+DLLEXPORT void STDCALL FPDFBitmap_Destroy(FPDF_BITMAP bitmap);
+
+// Function: FPDF_VIEWERREF_GetPrintScaling
+// Whether the PDF document prefers to be scaled or not.
+// Parameters:
+// document - Handle to the loaded document.
+// Return value:
+// None.
+//
+DLLEXPORT FPDF_BOOL STDCALL FPDF_VIEWERREF_GetPrintScaling(FPDF_DOCUMENT document);
+
+// Function: FPDF_GetNamedDestByName
+// get a special dest handle by the index.
+// Parameters:
+// document - Handle to the loaded document.
+// name - The name of a special named dest.
+// Return value:
+// The handle of the dest.
+//
+DLLEXPORT FPDF_DEST STDCALL FPDF_GetNamedDestByName(FPDF_DOCUMENT document,FPDF_BYTESTRING name);
+
+#ifdef __cplusplus
+};
+#endif
+
+#endif // _FPDFVIEW_H_
diff --git a/fpdfsdk/include/fsdk_actionhandler.h b/fpdfsdk/include/fsdk_actionhandler.h
index c93e679e79..0ffbddb48a 100644
--- a/fpdfsdk/include/fsdk_actionhandler.h
+++ b/fpdfsdk/include/fsdk_actionhandler.h
@@ -1,82 +1,82 @@
-// 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 _FSDK_ACTIONHANDLER_H_
-#define _FSDK_ACTIONHANDLER_H_
-
-
-class CPDFDoc_Environment;
-class IFXJS_Runtime;
-
-class CPDFSDK_FormActionHandler
-{
-public:
- FX_BOOL DoAction_Hide(const CPDF_Action& action, CPDFSDK_Document* pDocument);
- FX_BOOL DoAction_SubmitForm(const CPDF_Action& action, CPDFSDK_Document* pDocument);
- FX_BOOL DoAction_ResetForm(const CPDF_Action& action, CPDFSDK_Document* pDocument);
- FX_BOOL DoAction_ImportData(const CPDF_Action& action, CPDFSDK_Document* pDocument);
-};
-
-class CPDFSDK_MediaActionHandler
-{
-public:
- FX_BOOL DoAction_Rendition(const CPDF_Action& action, CPDFSDK_Document* pDocument);
- FX_BOOL DoAction_Sound(const CPDF_Action& action, CPDFSDK_Document* pDocument);
- FX_BOOL DoAction_Movie(const CPDF_Action& action, CPDFSDK_Document* pDocument);
-};
-
-class CPDFSDK_ActionHandler /*: public CReader_ActionHandler*/
-{
-public:
- CPDFSDK_ActionHandler(CPDFDoc_Environment* pEvi);
- virtual ~CPDFSDK_ActionHandler();
-
- virtual void Destroy();
- virtual FX_BOOL DoAction_DocOpen(const CPDF_Action& action, CPDFSDK_Document* pDocument/*, CPDFSDK_DocView *pDocView*/);
- virtual FX_BOOL DoAction_JavaScript(const CPDF_Action& JsAction,CFX_WideString csJSName, CPDFSDK_Document* pDocument/*, CReader_DocView *pDocView*/);
- virtual FX_BOOL DoAction_Page(const CPDF_Action& action, enum CPDF_AAction::AActionType eType, CPDFSDK_Document* pDocument/*, CReader_DocView *pDocView*/);
- virtual FX_BOOL DoAction_Document(const CPDF_Action& action, enum CPDF_AAction::AActionType eType, CPDFSDK_Document* pDocument/*, CReader_DocView *pDocView*/);
- virtual FX_BOOL DoAction_BookMark(CPDF_Bookmark *pBookMark, const CPDF_Action& action, CPDF_AAction::AActionType type, CPDFSDK_Document* pDocument/*, CReader_DocView *pDocView*/);
- virtual FX_BOOL DoAction_Screen(const CPDF_Action& action, CPDF_AAction::AActionType type, CPDFSDK_Document* pDocument,/* CReader_DocView *pDocView,*/ CPDFSDK_Annot* pScreen);
- virtual FX_BOOL DoAction_Link(const CPDF_Action& action, CPDFSDK_Document* pDocument/*, CReader_DocView *pDocView*/);
- virtual FX_BOOL DoAction_Field(const CPDF_Action& action, CPDF_AAction::AActionType type, CPDFSDK_Document* pDocument, /*CReader_DocView *pDocView,*/ CPDF_FormField* pFormField, PDFSDK_FieldAction& data);
- virtual FX_BOOL DoAction_FieldJavaScript(const CPDF_Action& JsAction, CPDF_AAction::AActionType type, CPDFSDK_Document* pDocument, CPDF_FormField* pFormField, PDFSDK_FieldAction& data);
-public:
- void SetFormActionHandler(CPDFSDK_FormActionHandler* pHandler);
- void SetMediaActionHandler(CPDFSDK_MediaActionHandler* pHandler);
-
-private:
- FX_BOOL ExecuteDocumentOpenAction(const CPDF_Action& action, CPDFSDK_Document* pDocument, /*CReader_DocView *pDocView,*/ CFX_PtrList& list);
- FX_BOOL ExecuteDocumentPageAction(const CPDF_Action& action, CPDF_AAction::AActionType type, CPDFSDK_Document* pDocument, /*CReader_DocView *pDocView,*/ CFX_PtrList& list);
- FX_BOOL ExecuteFieldAction(const CPDF_Action& action, CPDF_AAction::AActionType type, CPDFSDK_Document* pDocument, /*CReader_DocView* pDocView,*/ CPDF_FormField* pFormField, PDFSDK_FieldAction& data, CFX_PtrList& list);
- FX_BOOL ExecuteScreenAction(const CPDF_Action& action, CPDF_AAction::AActionType type, CPDFSDK_Document* pDocument, /*CReader_DocView* pDocView,*/ CPDFSDK_Annot* pScreen, CFX_PtrList& list);
- FX_BOOL ExecuteBookMark(const CPDF_Action& action, CPDFSDK_Document* pDocument, /*CReader_DocView* pDocView,*/ CPDF_Bookmark* pBookmark, CFX_PtrList& list);
- FX_BOOL ExecuteLinkAction(const CPDF_Action& action, CPDFSDK_Document* pDocument, /*CReader_DocView* pDocView,*/ CFX_PtrList& list);
-
- void DoAction_NoJs(const CPDF_Action& action, CPDFSDK_Document* pDocument/*, CReader_DocView* pDocView*/);
- void RunDocumentPageJavaScript(CPDFSDK_Document* pDocument, CPDF_AAction::AActionType type, const CFX_WideString& script);
- void RunDocumentOpenJavaScript(CPDFSDK_Document* pDocument, const CFX_WideString& sScriptName, const CFX_WideString& script);
- void RunFieldJavaScript(CPDFSDK_Document* pDocument, CPDF_FormField* pFormField, CPDF_AAction::AActionType type, PDFSDK_FieldAction& data, const CFX_WideString& script);
-
-private:
- FX_BOOL IsValidField(CPDFSDK_Document* pDocument, CPDF_Dictionary* pFieldDict);
- FX_BOOL IsValidDocView(CPDFSDK_Document* pDocument/*, CReader_DocView* pDocView*/);
-
- void DoAction_GoTo(CPDFSDK_Document* pDocument, /*CReader_DocView *pDocView,*/ const CPDF_Action& action);
- void DoAction_GoToR(CPDFSDK_Document* pDocument, const CPDF_Action& action);
- void DoAction_Launch(CPDFSDK_Document* pDocument, const CPDF_Action& action);
- void DoAction_URI(CPDFSDK_Document* pDocument, const CPDF_Action& action);
- void DoAction_Named(CPDFSDK_Document* pDocument, const CPDF_Action& action);
- void DoAction_SetOCGState(CPDFSDK_Document* pDocument, /*CReader_DocView* pDocView,*/ const CPDF_Action& action);
-
-private:
- CPDFDoc_Environment* m_pEvi;
- CPDFSDK_FormActionHandler* m_pFormActionHandler;
- CPDFSDK_MediaActionHandler* m_pMediaActionHandler;
-};
-
-#endif //_BA_ACTIONHANDLER_H_
-
+// 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 _FSDK_ACTIONHANDLER_H_
+#define _FSDK_ACTIONHANDLER_H_
+
+
+class CPDFDoc_Environment;
+class IFXJS_Runtime;
+
+class CPDFSDK_FormActionHandler
+{
+public:
+ FX_BOOL DoAction_Hide(const CPDF_Action& action, CPDFSDK_Document* pDocument);
+ FX_BOOL DoAction_SubmitForm(const CPDF_Action& action, CPDFSDK_Document* pDocument);
+ FX_BOOL DoAction_ResetForm(const CPDF_Action& action, CPDFSDK_Document* pDocument);
+ FX_BOOL DoAction_ImportData(const CPDF_Action& action, CPDFSDK_Document* pDocument);
+};
+
+class CPDFSDK_MediaActionHandler
+{
+public:
+ FX_BOOL DoAction_Rendition(const CPDF_Action& action, CPDFSDK_Document* pDocument);
+ FX_BOOL DoAction_Sound(const CPDF_Action& action, CPDFSDK_Document* pDocument);
+ FX_BOOL DoAction_Movie(const CPDF_Action& action, CPDFSDK_Document* pDocument);
+};
+
+class CPDFSDK_ActionHandler /*: public CReader_ActionHandler*/
+{
+public:
+ CPDFSDK_ActionHandler(CPDFDoc_Environment* pEvi);
+ virtual ~CPDFSDK_ActionHandler();
+
+ virtual void Destroy();
+ virtual FX_BOOL DoAction_DocOpen(const CPDF_Action& action, CPDFSDK_Document* pDocument/*, CPDFSDK_DocView *pDocView*/);
+ virtual FX_BOOL DoAction_JavaScript(const CPDF_Action& JsAction,CFX_WideString csJSName, CPDFSDK_Document* pDocument/*, CReader_DocView *pDocView*/);
+ virtual FX_BOOL DoAction_Page(const CPDF_Action& action, enum CPDF_AAction::AActionType eType, CPDFSDK_Document* pDocument/*, CReader_DocView *pDocView*/);
+ virtual FX_BOOL DoAction_Document(const CPDF_Action& action, enum CPDF_AAction::AActionType eType, CPDFSDK_Document* pDocument/*, CReader_DocView *pDocView*/);
+ virtual FX_BOOL DoAction_BookMark(CPDF_Bookmark *pBookMark, const CPDF_Action& action, CPDF_AAction::AActionType type, CPDFSDK_Document* pDocument/*, CReader_DocView *pDocView*/);
+ virtual FX_BOOL DoAction_Screen(const CPDF_Action& action, CPDF_AAction::AActionType type, CPDFSDK_Document* pDocument,/* CReader_DocView *pDocView,*/ CPDFSDK_Annot* pScreen);
+ virtual FX_BOOL DoAction_Link(const CPDF_Action& action, CPDFSDK_Document* pDocument/*, CReader_DocView *pDocView*/);
+ virtual FX_BOOL DoAction_Field(const CPDF_Action& action, CPDF_AAction::AActionType type, CPDFSDK_Document* pDocument, /*CReader_DocView *pDocView,*/ CPDF_FormField* pFormField, PDFSDK_FieldAction& data);
+ virtual FX_BOOL DoAction_FieldJavaScript(const CPDF_Action& JsAction, CPDF_AAction::AActionType type, CPDFSDK_Document* pDocument, CPDF_FormField* pFormField, PDFSDK_FieldAction& data);
+public:
+ void SetFormActionHandler(CPDFSDK_FormActionHandler* pHandler);
+ void SetMediaActionHandler(CPDFSDK_MediaActionHandler* pHandler);
+
+private:
+ FX_BOOL ExecuteDocumentOpenAction(const CPDF_Action& action, CPDFSDK_Document* pDocument, /*CReader_DocView *pDocView,*/ CFX_PtrList& list);
+ FX_BOOL ExecuteDocumentPageAction(const CPDF_Action& action, CPDF_AAction::AActionType type, CPDFSDK_Document* pDocument, /*CReader_DocView *pDocView,*/ CFX_PtrList& list);
+ FX_BOOL ExecuteFieldAction(const CPDF_Action& action, CPDF_AAction::AActionType type, CPDFSDK_Document* pDocument, /*CReader_DocView* pDocView,*/ CPDF_FormField* pFormField, PDFSDK_FieldAction& data, CFX_PtrList& list);
+ FX_BOOL ExecuteScreenAction(const CPDF_Action& action, CPDF_AAction::AActionType type, CPDFSDK_Document* pDocument, /*CReader_DocView* pDocView,*/ CPDFSDK_Annot* pScreen, CFX_PtrList& list);
+ FX_BOOL ExecuteBookMark(const CPDF_Action& action, CPDFSDK_Document* pDocument, /*CReader_DocView* pDocView,*/ CPDF_Bookmark* pBookmark, CFX_PtrList& list);
+ FX_BOOL ExecuteLinkAction(const CPDF_Action& action, CPDFSDK_Document* pDocument, /*CReader_DocView* pDocView,*/ CFX_PtrList& list);
+
+ void DoAction_NoJs(const CPDF_Action& action, CPDFSDK_Document* pDocument/*, CReader_DocView* pDocView*/);
+ void RunDocumentPageJavaScript(CPDFSDK_Document* pDocument, CPDF_AAction::AActionType type, const CFX_WideString& script);
+ void RunDocumentOpenJavaScript(CPDFSDK_Document* pDocument, const CFX_WideString& sScriptName, const CFX_WideString& script);
+ void RunFieldJavaScript(CPDFSDK_Document* pDocument, CPDF_FormField* pFormField, CPDF_AAction::AActionType type, PDFSDK_FieldAction& data, const CFX_WideString& script);
+
+private:
+ FX_BOOL IsValidField(CPDFSDK_Document* pDocument, CPDF_Dictionary* pFieldDict);
+ FX_BOOL IsValidDocView(CPDFSDK_Document* pDocument/*, CReader_DocView* pDocView*/);
+
+ void DoAction_GoTo(CPDFSDK_Document* pDocument, /*CReader_DocView *pDocView,*/ const CPDF_Action& action);
+ void DoAction_GoToR(CPDFSDK_Document* pDocument, const CPDF_Action& action);
+ void DoAction_Launch(CPDFSDK_Document* pDocument, const CPDF_Action& action);
+ void DoAction_URI(CPDFSDK_Document* pDocument, const CPDF_Action& action);
+ void DoAction_Named(CPDFSDK_Document* pDocument, const CPDF_Action& action);
+ void DoAction_SetOCGState(CPDFSDK_Document* pDocument, /*CReader_DocView* pDocView,*/ const CPDF_Action& action);
+
+private:
+ CPDFDoc_Environment* m_pEvi;
+ CPDFSDK_FormActionHandler* m_pFormActionHandler;
+ CPDFSDK_MediaActionHandler* m_pMediaActionHandler;
+};
+
+#endif //_BA_ACTIONHANDLER_H_
+
diff --git a/fpdfsdk/include/fsdk_annothandler.h b/fpdfsdk/include/fsdk_annothandler.h
index dc2e40a9c7..fec3d927d9 100644
--- a/fpdfsdk/include/fsdk_annothandler.h
+++ b/fpdfsdk/include/fsdk_annothandler.h
@@ -1,248 +1,248 @@
-// Copyright 2014 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#ifndef _FSDK_ANNOTHANDLER_H_
-#define _FSDK_ANNOTHANDLER_H_
-
-
-class CPDFDoc_Environment;
-class CFFL_IFormFiller;
-class CPDFSDK_PageView;
-class IPDFSDK_AnnotHandler
-{
-
-public:
- virtual ~IPDFSDK_AnnotHandler() {};
-
- virtual CFX_ByteString GetType() = 0;
-
- virtual CFX_ByteString GetName() = 0;
-
- virtual FX_BOOL CanAnswer(CPDFSDK_Annot* pAnnot) = 0;
-
-
- virtual CPDFSDK_Annot* NewAnnot(CPDF_Annot* pAnnot, CPDFSDK_PageView* pPage) = 0;
-
- virtual void ReleaseAnnot(CPDFSDK_Annot* pAnnot) = 0;
-
- virtual void DeleteAnnot(CPDFSDK_Annot* pAnnot) = 0;
-
-
- virtual CPDF_Rect GetViewBBox(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot) = 0;
-
- virtual FX_BOOL HitTest(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, const CPDF_Point& point) = 0;
-
-
- virtual void OnDraw(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot,
- CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
- FX_DWORD dwFlags) = 0;
-
- virtual void OnDrawSleep(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot,
- CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
- const CPDF_Rect& rcWindow, FX_DWORD dwFlags) = 0;
-
-
-
-
- virtual void OnCreate(CPDFSDK_Annot* pAnnot) = 0;
-
- virtual void OnLoad(CPDFSDK_Annot* pAnnot) = 0;
-
- virtual void OnDelete(CPDFSDK_Annot* pAnnot) = 0;
-
- virtual void OnRelease(CPDFSDK_Annot* pAnnot) = 0;
-
-
- virtual void OnMouseEnter(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlag) = 0;
- virtual void OnMouseExit(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlag) = 0;
-
-
- virtual FX_BOOL OnLButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) = 0;
- virtual FX_BOOL OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) = 0;
- virtual FX_BOOL OnLButtonDblClk(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) = 0;
- virtual FX_BOOL OnMouseMove(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) = 0;
- virtual FX_BOOL OnMouseWheel(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, short zDelta, const CPDF_Point& point) = 0;
- virtual FX_BOOL OnRButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) = 0;
- virtual FX_BOOL OnRButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) = 0;
- virtual FX_BOOL OnRButtonDblClk(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) = 0;
-//by wjm.
- virtual FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, FX_DWORD nChar, FX_DWORD nFlags) = 0;
- virtual FX_BOOL OnKeyDown(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag) = 0;
- virtual FX_BOOL OnKeyUp(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag) =0 ;
-
- virtual void OnDeSelected(CPDFSDK_Annot* pAnnot) = 0;
- virtual void OnSelected(CPDFSDK_Annot* pAnnot) = 0;
-
- virtual FX_BOOL OnSetFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag) = 0;
- virtual FX_BOOL OnKillFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag) = 0;
-
-};
-
-
-class CPDFSDK_BFAnnotHandler:public IPDFSDK_AnnotHandler
-{
-public:
- CPDFSDK_BFAnnotHandler(CPDFDoc_Environment* pApp):m_pFormFiller(NULL),m_pApp(pApp) {}
- virtual ~CPDFSDK_BFAnnotHandler() {}
-public:
-
- virtual CFX_ByteString GetType() {return CFX_ByteString("Widget");}
-
- virtual CFX_ByteString GetName() {return CFX_ByteString("WidgetHandler");}
-
- virtual FX_BOOL CanAnswer(CPDFSDK_Annot* pAnnot);
-
- virtual CPDFSDK_Annot* NewAnnot(CPDF_Annot* pAnnot, CPDFSDK_PageView* pPage);
-
- virtual void ReleaseAnnot(CPDFSDK_Annot* pAnnot) ;
-
- virtual void DeleteAnnot(CPDFSDK_Annot* pAnnot) {}
-
-
- virtual CPDF_Rect GetViewBBox(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot) ;
-
- virtual FX_BOOL HitTest(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, const CPDF_Point& point);
-
-
- virtual void OnDraw(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot,
- CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
- FX_DWORD dwFlags) ;
-
- virtual void OnDrawSleep(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot,
- CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
- const CPDF_Rect& rcWindow, FX_DWORD dwFlags) {}
-
-
- virtual void OnCreate(CPDFSDK_Annot* pAnnot) ;
-
- virtual void OnLoad(CPDFSDK_Annot* pAnnot) ;
-
- virtual void OnDelete(CPDFSDK_Annot* pAnnot) {}
-
- virtual void OnRelease(CPDFSDK_Annot* pAnnot) {}
-
-
- virtual void OnMouseEnter(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlag) ;
- virtual void OnMouseExit(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlag) ;
-
-
- virtual FX_BOOL OnLButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) ;
- virtual FX_BOOL OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) ;
- virtual FX_BOOL OnLButtonDblClk(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) ;
- virtual FX_BOOL OnMouseMove(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) ;
- virtual FX_BOOL OnMouseWheel(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, short zDelta, const CPDF_Point& point) ;
- virtual FX_BOOL OnRButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) ;
- virtual FX_BOOL OnRButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) ;
- virtual FX_BOOL OnRButtonDblClk(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) {return FALSE;}
-
-//by wjm.
- virtual FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, FX_DWORD nChar, FX_DWORD nFlags);
- virtual FX_BOOL OnKeyDown(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag);
- virtual FX_BOOL OnKeyUp(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag);
-
- virtual void OnDeSelected(CPDFSDK_Annot* pAnnot) {}
- virtual void OnSelected(CPDFSDK_Annot* pAnnot) {}
-
- virtual FX_BOOL OnSetFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag);
- virtual FX_BOOL OnKillFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag);
-
- void SetFormFiller(CFFL_IFormFiller* pFiller){m_pFormFiller = pFiller;}
- CFFL_IFormFiller* GetFormFiller() {return m_pFormFiller;}
-private:
-
- CPDFDoc_Environment* m_pApp;
- CFFL_IFormFiller* m_pFormFiller;
-};
-
-#define CBA_AnnotHandlerArray CFX_ArrayTemplate<IPDFSDK_AnnotHandler*>
-class CPDFSDK_AnnotHandlerMgr
-{
-public:
- // Destroy the handler
- CPDFSDK_AnnotHandlerMgr(CPDFDoc_Environment* pApp);
- virtual ~CPDFSDK_AnnotHandlerMgr() ;
-
-public:
- void RegisterAnnotHandler(IPDFSDK_AnnotHandler* pAnnotHandler);
- void UnRegisterAnnotHandler(IPDFSDK_AnnotHandler* pAnnotHandler);
-
- virtual CPDFSDK_Annot* NewAnnot(CPDF_Annot * pAnnot, CPDFSDK_PageView *pPageView);
- virtual void ReleaseAnnot(CPDFSDK_Annot * pAnnot);
-
- virtual void Annot_OnCreate(CPDFSDK_Annot* pAnnot);
- virtual void Annot_OnLoad(CPDFSDK_Annot* pAnnot);
-public:
- IPDFSDK_AnnotHandler* GetAnnotHandler(CPDFSDK_Annot* pAnnot) const;
- virtual void Annot_OnDraw(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot,
- CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,FX_DWORD dwFlags);
-
- virtual void Annot_OnMouseEnter(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags);
- virtual void Annot_OnMouseExit(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags);
-
- virtual FX_BOOL Annot_OnLButtonDown(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point);
- virtual FX_BOOL Annot_OnLButtonUp(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point);
- virtual FX_BOOL Annot_OnLButtonDblClk(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point);
-
- virtual FX_BOOL Annot_OnMouseMove(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point);
- virtual FX_BOOL Annot_OnMouseWheel(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, short zDelta, const CPDF_Point& point);
- virtual FX_BOOL Annot_OnRButtonDown(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point);
- virtual FX_BOOL Annot_OnRButtonUp(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point);
-
-
- virtual FX_BOOL Annot_OnChar(CPDFSDK_Annot* pAnnot, FX_DWORD nChar, FX_DWORD nFlags);
- virtual FX_BOOL Annot_OnKeyDown(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag);
- virtual FX_BOOL Annot_OnKeyUp(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag);
-
- virtual FX_BOOL Annot_OnSetFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag);
- virtual FX_BOOL Annot_OnKillFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag);
-
- virtual CPDF_Rect Annot_OnGetViewBBox(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot);
- virtual FX_BOOL Annot_OnHitTest(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, const CPDF_Point& point);
-
-private:
- IPDFSDK_AnnotHandler* GetAnnotHandler(const CFX_ByteString& sType) const;
- CPDFSDK_Annot* GetNextAnnot(CPDFSDK_Annot* pSDKAnnot,FX_BOOL bNext);
-private:
- CBA_AnnotHandlerArray m_Handlers;
- CFX_MapByteStringToPtr m_mapType2Handler;
- CPDFDoc_Environment* m_pApp;
-};
-
-//#define CBF_Page2Accessible CFX_MapPtrTemplate<CPDFSDK_PageView*, IAccessible*>
-
-typedef int (*AI_COMPARE) (CPDFSDK_Annot* p1, CPDFSDK_Annot* p2);
-
-class CPDFSDK_AnnotIterator
-{
-protected:
- CPDFSDK_Annot* NextAnnot (const CPDFSDK_Annot* pCurrent) ;
- CPDFSDK_Annot* PrevAnnot (const CPDFSDK_Annot* pCurrent) ;
- CPDFSDK_Annot* NextAnnot(int& index ) ;
- CPDFSDK_Annot* PrevAnnot(int& index ) ;
-public:
- CPDFSDK_AnnotIterator(CPDFSDK_PageView * pPageView, FX_BOOL bReverse,
- FX_BOOL bIgnoreTopmost=FALSE,FX_BOOL bCircle=FALSE,CFX_PtrArray* pList=NULL);
- virtual CPDFSDK_Annot* Next (const CPDFSDK_Annot* pCurrent) ;
- virtual CPDFSDK_Annot* Prev (const CPDFSDK_Annot* pCurrent) ;
- virtual CPDFSDK_Annot* Next(int& index ) ;
- virtual CPDFSDK_Annot* Prev(int& index ) ;
- virtual int Count(){return m_pIteratorAnnotList.GetSize();}
-
- virtual FX_BOOL InitIteratorAnnotList(CPDFSDK_PageView * pPageView,CFX_PtrArray* pList=NULL);
-
- void InsertSort(CFX_PtrArray &arrayList, AI_COMPARE pCompare);
-protected:
- // CFX_PtrList m_pIteratorAnnotList;
- CFX_PtrArray m_pIteratorAnnotList;
- FX_BOOL m_bReverse;
- FX_BOOL m_bIgnoreTopmost;
- FX_BOOL m_bCircle;
-};
-
-
-
-#endif
-
+// 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 _FSDK_ANNOTHANDLER_H_
+#define _FSDK_ANNOTHANDLER_H_
+
+
+class CPDFDoc_Environment;
+class CFFL_IFormFiller;
+class CPDFSDK_PageView;
+class IPDFSDK_AnnotHandler
+{
+
+public:
+ virtual ~IPDFSDK_AnnotHandler() {};
+
+ virtual CFX_ByteString GetType() = 0;
+
+ virtual CFX_ByteString GetName() = 0;
+
+ virtual FX_BOOL CanAnswer(CPDFSDK_Annot* pAnnot) = 0;
+
+
+ virtual CPDFSDK_Annot* NewAnnot(CPDF_Annot* pAnnot, CPDFSDK_PageView* pPage) = 0;
+
+ virtual void ReleaseAnnot(CPDFSDK_Annot* pAnnot) = 0;
+
+ virtual void DeleteAnnot(CPDFSDK_Annot* pAnnot) = 0;
+
+
+ virtual CPDF_Rect GetViewBBox(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot) = 0;
+
+ virtual FX_BOOL HitTest(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, const CPDF_Point& point) = 0;
+
+
+ virtual void OnDraw(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot,
+ CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
+ FX_DWORD dwFlags) = 0;
+
+ virtual void OnDrawSleep(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot,
+ CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
+ const CPDF_Rect& rcWindow, FX_DWORD dwFlags) = 0;
+
+
+
+
+ virtual void OnCreate(CPDFSDK_Annot* pAnnot) = 0;
+
+ virtual void OnLoad(CPDFSDK_Annot* pAnnot) = 0;
+
+ virtual void OnDelete(CPDFSDK_Annot* pAnnot) = 0;
+
+ virtual void OnRelease(CPDFSDK_Annot* pAnnot) = 0;
+
+
+ virtual void OnMouseEnter(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlag) = 0;
+ virtual void OnMouseExit(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlag) = 0;
+
+
+ virtual FX_BOOL OnLButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) = 0;
+ virtual FX_BOOL OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) = 0;
+ virtual FX_BOOL OnLButtonDblClk(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) = 0;
+ virtual FX_BOOL OnMouseMove(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) = 0;
+ virtual FX_BOOL OnMouseWheel(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, short zDelta, const CPDF_Point& point) = 0;
+ virtual FX_BOOL OnRButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) = 0;
+ virtual FX_BOOL OnRButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) = 0;
+ virtual FX_BOOL OnRButtonDblClk(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) = 0;
+//by wjm.
+ virtual FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, FX_DWORD nChar, FX_DWORD nFlags) = 0;
+ virtual FX_BOOL OnKeyDown(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag) = 0;
+ virtual FX_BOOL OnKeyUp(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag) =0 ;
+
+ virtual void OnDeSelected(CPDFSDK_Annot* pAnnot) = 0;
+ virtual void OnSelected(CPDFSDK_Annot* pAnnot) = 0;
+
+ virtual FX_BOOL OnSetFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag) = 0;
+ virtual FX_BOOL OnKillFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag) = 0;
+
+};
+
+
+class CPDFSDK_BFAnnotHandler:public IPDFSDK_AnnotHandler
+{
+public:
+ CPDFSDK_BFAnnotHandler(CPDFDoc_Environment* pApp):m_pFormFiller(NULL),m_pApp(pApp) {}
+ virtual ~CPDFSDK_BFAnnotHandler() {}
+public:
+
+ virtual CFX_ByteString GetType() {return CFX_ByteString("Widget");}
+
+ virtual CFX_ByteString GetName() {return CFX_ByteString("WidgetHandler");}
+
+ virtual FX_BOOL CanAnswer(CPDFSDK_Annot* pAnnot);
+
+ virtual CPDFSDK_Annot* NewAnnot(CPDF_Annot* pAnnot, CPDFSDK_PageView* pPage);
+
+ virtual void ReleaseAnnot(CPDFSDK_Annot* pAnnot) ;
+
+ virtual void DeleteAnnot(CPDFSDK_Annot* pAnnot) {}
+
+
+ virtual CPDF_Rect GetViewBBox(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot) ;
+
+ virtual FX_BOOL HitTest(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, const CPDF_Point& point);
+
+
+ virtual void OnDraw(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot,
+ CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
+ FX_DWORD dwFlags) ;
+
+ virtual void OnDrawSleep(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot,
+ CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
+ const CPDF_Rect& rcWindow, FX_DWORD dwFlags) {}
+
+
+ virtual void OnCreate(CPDFSDK_Annot* pAnnot) ;
+
+ virtual void OnLoad(CPDFSDK_Annot* pAnnot) ;
+
+ virtual void OnDelete(CPDFSDK_Annot* pAnnot) {}
+
+ virtual void OnRelease(CPDFSDK_Annot* pAnnot) {}
+
+
+ virtual void OnMouseEnter(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlag) ;
+ virtual void OnMouseExit(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlag) ;
+
+
+ virtual FX_BOOL OnLButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) ;
+ virtual FX_BOOL OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) ;
+ virtual FX_BOOL OnLButtonDblClk(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) ;
+ virtual FX_BOOL OnMouseMove(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) ;
+ virtual FX_BOOL OnMouseWheel(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, short zDelta, const CPDF_Point& point) ;
+ virtual FX_BOOL OnRButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) ;
+ virtual FX_BOOL OnRButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) ;
+ virtual FX_BOOL OnRButtonDblClk(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) {return FALSE;}
+
+//by wjm.
+ virtual FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, FX_DWORD nChar, FX_DWORD nFlags);
+ virtual FX_BOOL OnKeyDown(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag);
+ virtual FX_BOOL OnKeyUp(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag);
+
+ virtual void OnDeSelected(CPDFSDK_Annot* pAnnot) {}
+ virtual void OnSelected(CPDFSDK_Annot* pAnnot) {}
+
+ virtual FX_BOOL OnSetFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag);
+ virtual FX_BOOL OnKillFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag);
+
+ void SetFormFiller(CFFL_IFormFiller* pFiller){m_pFormFiller = pFiller;}
+ CFFL_IFormFiller* GetFormFiller() {return m_pFormFiller;}
+private:
+
+ CPDFDoc_Environment* m_pApp;
+ CFFL_IFormFiller* m_pFormFiller;
+};
+
+#define CBA_AnnotHandlerArray CFX_ArrayTemplate<IPDFSDK_AnnotHandler*>
+class CPDFSDK_AnnotHandlerMgr
+{
+public:
+ // Destroy the handler
+ CPDFSDK_AnnotHandlerMgr(CPDFDoc_Environment* pApp);
+ virtual ~CPDFSDK_AnnotHandlerMgr() ;
+
+public:
+ void RegisterAnnotHandler(IPDFSDK_AnnotHandler* pAnnotHandler);
+ void UnRegisterAnnotHandler(IPDFSDK_AnnotHandler* pAnnotHandler);
+
+ virtual CPDFSDK_Annot* NewAnnot(CPDF_Annot * pAnnot, CPDFSDK_PageView *pPageView);
+ virtual void ReleaseAnnot(CPDFSDK_Annot * pAnnot);
+
+ virtual void Annot_OnCreate(CPDFSDK_Annot* pAnnot);
+ virtual void Annot_OnLoad(CPDFSDK_Annot* pAnnot);
+public:
+ IPDFSDK_AnnotHandler* GetAnnotHandler(CPDFSDK_Annot* pAnnot) const;
+ virtual void Annot_OnDraw(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot,
+ CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,FX_DWORD dwFlags);
+
+ virtual void Annot_OnMouseEnter(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags);
+ virtual void Annot_OnMouseExit(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags);
+
+ virtual FX_BOOL Annot_OnLButtonDown(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point);
+ virtual FX_BOOL Annot_OnLButtonUp(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point);
+ virtual FX_BOOL Annot_OnLButtonDblClk(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point);
+
+ virtual FX_BOOL Annot_OnMouseMove(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point);
+ virtual FX_BOOL Annot_OnMouseWheel(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, short zDelta, const CPDF_Point& point);
+ virtual FX_BOOL Annot_OnRButtonDown(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point);
+ virtual FX_BOOL Annot_OnRButtonUp(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point);
+
+
+ virtual FX_BOOL Annot_OnChar(CPDFSDK_Annot* pAnnot, FX_DWORD nChar, FX_DWORD nFlags);
+ virtual FX_BOOL Annot_OnKeyDown(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag);
+ virtual FX_BOOL Annot_OnKeyUp(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag);
+
+ virtual FX_BOOL Annot_OnSetFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag);
+ virtual FX_BOOL Annot_OnKillFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag);
+
+ virtual CPDF_Rect Annot_OnGetViewBBox(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot);
+ virtual FX_BOOL Annot_OnHitTest(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, const CPDF_Point& point);
+
+private:
+ IPDFSDK_AnnotHandler* GetAnnotHandler(const CFX_ByteString& sType) const;
+ CPDFSDK_Annot* GetNextAnnot(CPDFSDK_Annot* pSDKAnnot,FX_BOOL bNext);
+private:
+ CBA_AnnotHandlerArray m_Handlers;
+ CFX_MapByteStringToPtr m_mapType2Handler;
+ CPDFDoc_Environment* m_pApp;
+};
+
+//#define CBF_Page2Accessible CFX_MapPtrTemplate<CPDFSDK_PageView*, IAccessible*>
+
+typedef int (*AI_COMPARE) (CPDFSDK_Annot* p1, CPDFSDK_Annot* p2);
+
+class CPDFSDK_AnnotIterator
+{
+protected:
+ CPDFSDK_Annot* NextAnnot (const CPDFSDK_Annot* pCurrent) ;
+ CPDFSDK_Annot* PrevAnnot (const CPDFSDK_Annot* pCurrent) ;
+ CPDFSDK_Annot* NextAnnot(int& index ) ;
+ CPDFSDK_Annot* PrevAnnot(int& index ) ;
+public:
+ CPDFSDK_AnnotIterator(CPDFSDK_PageView * pPageView, FX_BOOL bReverse,
+ FX_BOOL bIgnoreTopmost=FALSE,FX_BOOL bCircle=FALSE,CFX_PtrArray* pList=NULL);
+ virtual CPDFSDK_Annot* Next (const CPDFSDK_Annot* pCurrent) ;
+ virtual CPDFSDK_Annot* Prev (const CPDFSDK_Annot* pCurrent) ;
+ virtual CPDFSDK_Annot* Next(int& index ) ;
+ virtual CPDFSDK_Annot* Prev(int& index ) ;
+ virtual int Count(){return m_pIteratorAnnotList.GetSize();}
+
+ virtual FX_BOOL InitIteratorAnnotList(CPDFSDK_PageView * pPageView,CFX_PtrArray* pList=NULL);
+
+ void InsertSort(CFX_PtrArray &arrayList, AI_COMPARE pCompare);
+protected:
+ // CFX_PtrList m_pIteratorAnnotList;
+ CFX_PtrArray m_pIteratorAnnotList;
+ FX_BOOL m_bReverse;
+ FX_BOOL m_bIgnoreTopmost;
+ FX_BOOL m_bCircle;
+};
+
+
+
+#endif
+
diff --git a/fpdfsdk/include/fsdk_baseannot.h b/fpdfsdk/include/fsdk_baseannot.h
index b6cadb7e5d..46425089aa 100644
--- a/fpdfsdk/include/fsdk_baseannot.h
+++ b/fpdfsdk/include/fsdk_baseannot.h
@@ -1,186 +1,186 @@
-// 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 _FSDK_BASEANNOT_H_
-#define _FSDK_BASEANNOT_H_
-
-#if _FX_OS_ == _FX_ANDROID_
-#include "time.h"
-#else
-#include <ctime>
-#endif
-
-class CPDFSDK_PageView;
-#define CFX_IntArray CFX_ArrayTemplate<int>
-
-class CPDFSDK_DateTime : public CFX_Object
-{
-public:
- CPDFSDK_DateTime();
- CPDFSDK_DateTime(const CFX_ByteString& dtStr);
- CPDFSDK_DateTime(const CPDFSDK_DateTime& datetime);
- CPDFSDK_DateTime(const FX_SYSTEMTIME& st);
-
-
- CPDFSDK_DateTime& operator = (const CPDFSDK_DateTime& datetime);
- CPDFSDK_DateTime& operator = (const FX_SYSTEMTIME& st);
- FX_BOOL operator == (CPDFSDK_DateTime& datetime);
- FX_BOOL operator != (CPDFSDK_DateTime& datetime);
- FX_BOOL operator > (CPDFSDK_DateTime& datetime);
- FX_BOOL operator >= (CPDFSDK_DateTime& datetime);
- FX_BOOL operator < (CPDFSDK_DateTime& datetime);
- FX_BOOL operator <= (CPDFSDK_DateTime& datetime);
- operator time_t();
-
- CPDFSDK_DateTime& FromPDFDateTimeString(const CFX_ByteString& dtStr);
- CFX_ByteString ToCommonDateTimeString();
- CFX_ByteString ToPDFDateTimeString();
- void ToSystemTime(FX_SYSTEMTIME& st);
- CPDFSDK_DateTime ToGMT();
- CPDFSDK_DateTime& AddDays(short days);
- CPDFSDK_DateTime& AddSeconds(int seconds);
-
- void ResetDateTime();
-
- struct FX_DATETIME
- {
- FX_SHORT year;
- FX_BYTE month;
- FX_BYTE day;
- FX_BYTE hour;
- FX_BYTE minute;
- FX_BYTE second;
- FX_CHAR tzHour;
- FX_BYTE tzMinute;
- }dt;
-};
-
-class CPDFSDK_Annot
-{
-public:
- CPDFSDK_Annot(CPDF_Annot* pAnnot, CPDFSDK_PageView* pPageView);
- virtual ~CPDFSDK_Annot();
-public:
- virtual FX_FLOAT GetMinWidth() const;
- virtual FX_FLOAT GetMinHeight() const;
- //define layout order to 5.
- virtual int GetLayoutOrder() const { return 5; }
-
-public:
- CPDF_Annot* GetPDFAnnot();
-
- void SetPage(CPDFSDK_PageView* pPageView);
- CPDFSDK_PageView* GetPageView();
- FX_DWORD GetFlags();
-
- // Tab Order
- int GetTabOrder();
- void SetTabOrder(int iTabOrder);
-
- // Selection
- FX_BOOL IsSelected();
- void SetSelected(FX_BOOL bSelected);
-
- CFX_ByteString GetType() const;
- virtual CFX_ByteString GetSubType() const;
-
- CPDF_Page* GetPDFPage();
-
-public:
- CPDF_Dictionary* GetAnnotDict() const;
-
- void SetRect(const CPDF_Rect& rect);
- CPDF_Rect GetRect() const;
-
- void SetContents(const CFX_WideString& sContents);
- CFX_WideString GetContents() const;
-
- void SetAnnotName(const CFX_WideString& sName);
- CFX_WideString GetAnnotName() const;
-
- void SetModifiedDate(const FX_SYSTEMTIME& st);
- FX_SYSTEMTIME GetModifiedDate() const;
-
- void SetFlags(int nFlags);
- int GetFlags() const;
-
- void SetAppState(const CFX_ByteString& str);
- CFX_ByteString GetAppState() const;
-
- void SetStructParent(int key);
- int GetStructParent() const;
-
- //border
- void SetBorderWidth(int nWidth);
- int GetBorderWidth() const;
-
- //BBS_SOLID
- //BBS_DASH
- //BBS_BEVELED
- //BBS_INSET
- //BBS_UNDERLINE
-
- void SetBorderStyle(int nStyle);
- int GetBorderStyle() const;
-
- void SetBorderDash(const CFX_IntArray& array);
- void GetBorderDash(CFX_IntArray& array) const;
-
- //The background of the annotation's icon when closed
- //The title bar of the annotation's pop-up window
- //The border of a link annotation
-
- void SetColor(FX_COLORREF color);
- void RemoveColor();
- FX_BOOL GetColor(FX_COLORREF& color) const;
-
- FX_BOOL IsVisible() const;
- //action
-
- CPDF_Action GetAction() const;
- void SetAction(const CPDF_Action& a);
- void RemoveAction();
-
- CPDF_AAction GetAAction() const;
- void SetAAction(const CPDF_AAction& aa);
- void RemoveAAction();
-
- virtual CPDF_Action GetAAction(CPDF_AAction::AActionType eAAT);
-
-public:
- FX_BOOL IsAppearanceValid();
- FX_BOOL IsAppearanceValid(CPDF_Annot::AppearanceMode mode);
- void DrawAppearance(CFX_RenderDevice* pDevice, const CPDF_Matrix* pUser2Device,
- CPDF_Annot::AppearanceMode mode, const CPDF_RenderOptions* pOptions);
- void DrawBorder(CFX_RenderDevice* pDevice, const CPDF_Matrix* pUser2Device,
- const CPDF_RenderOptions* pOptions);
-
- void ClearCachedAP();
-
- virtual void ResetAppearance();
- void WriteAppearance(const CFX_ByteString& sAPType, const CPDF_Rect& rcBBox,
- const CPDF_Matrix& matrix, const CFX_ByteString& sContents,
- const CFX_ByteString& sAPState = "");
-
-public:
- virtual void Annot_OnDraw(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,CPDF_RenderOptions* pOptions);
-public:
-
-
-private:
- FX_BOOL CreateFormFiller();
-protected:
- CPDF_Annot* m_pAnnot;
- CPDFSDK_PageView* m_pPageView;
- FX_BOOL m_bSelected;
- int m_nTabOrder;
-
-};
-
-
-
-#endif
-
+// 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 _FSDK_BASEANNOT_H_
+#define _FSDK_BASEANNOT_H_
+
+#if _FX_OS_ == _FX_ANDROID_
+#include "time.h"
+#else
+#include <ctime>
+#endif
+
+class CPDFSDK_PageView;
+#define CFX_IntArray CFX_ArrayTemplate<int>
+
+class CPDFSDK_DateTime : public CFX_Object
+{
+public:
+ CPDFSDK_DateTime();
+ CPDFSDK_DateTime(const CFX_ByteString& dtStr);
+ CPDFSDK_DateTime(const CPDFSDK_DateTime& datetime);
+ CPDFSDK_DateTime(const FX_SYSTEMTIME& st);
+
+
+ CPDFSDK_DateTime& operator = (const CPDFSDK_DateTime& datetime);
+ CPDFSDK_DateTime& operator = (const FX_SYSTEMTIME& st);
+ FX_BOOL operator == (CPDFSDK_DateTime& datetime);
+ FX_BOOL operator != (CPDFSDK_DateTime& datetime);
+ FX_BOOL operator > (CPDFSDK_DateTime& datetime);
+ FX_BOOL operator >= (CPDFSDK_DateTime& datetime);
+ FX_BOOL operator < (CPDFSDK_DateTime& datetime);
+ FX_BOOL operator <= (CPDFSDK_DateTime& datetime);
+ operator time_t();
+
+ CPDFSDK_DateTime& FromPDFDateTimeString(const CFX_ByteString& dtStr);
+ CFX_ByteString ToCommonDateTimeString();
+ CFX_ByteString ToPDFDateTimeString();
+ void ToSystemTime(FX_SYSTEMTIME& st);
+ CPDFSDK_DateTime ToGMT();
+ CPDFSDK_DateTime& AddDays(short days);
+ CPDFSDK_DateTime& AddSeconds(int seconds);
+
+ void ResetDateTime();
+
+ struct FX_DATETIME
+ {
+ FX_SHORT year;
+ FX_BYTE month;
+ FX_BYTE day;
+ FX_BYTE hour;
+ FX_BYTE minute;
+ FX_BYTE second;
+ FX_CHAR tzHour;
+ FX_BYTE tzMinute;
+ }dt;
+};
+
+class CPDFSDK_Annot
+{
+public:
+ CPDFSDK_Annot(CPDF_Annot* pAnnot, CPDFSDK_PageView* pPageView);
+ virtual ~CPDFSDK_Annot();
+public:
+ virtual FX_FLOAT GetMinWidth() const;
+ virtual FX_FLOAT GetMinHeight() const;
+ //define layout order to 5.
+ virtual int GetLayoutOrder() const { return 5; }
+
+public:
+ CPDF_Annot* GetPDFAnnot();
+
+ void SetPage(CPDFSDK_PageView* pPageView);
+ CPDFSDK_PageView* GetPageView();
+ FX_DWORD GetFlags();
+
+ // Tab Order
+ int GetTabOrder();
+ void SetTabOrder(int iTabOrder);
+
+ // Selection
+ FX_BOOL IsSelected();
+ void SetSelected(FX_BOOL bSelected);
+
+ CFX_ByteString GetType() const;
+ virtual CFX_ByteString GetSubType() const;
+
+ CPDF_Page* GetPDFPage();
+
+public:
+ CPDF_Dictionary* GetAnnotDict() const;
+
+ void SetRect(const CPDF_Rect& rect);
+ CPDF_Rect GetRect() const;
+
+ void SetContents(const CFX_WideString& sContents);
+ CFX_WideString GetContents() const;
+
+ void SetAnnotName(const CFX_WideString& sName);
+ CFX_WideString GetAnnotName() const;
+
+ void SetModifiedDate(const FX_SYSTEMTIME& st);
+ FX_SYSTEMTIME GetModifiedDate() const;
+
+ void SetFlags(int nFlags);
+ int GetFlags() const;
+
+ void SetAppState(const CFX_ByteString& str);
+ CFX_ByteString GetAppState() const;
+
+ void SetStructParent(int key);
+ int GetStructParent() const;
+
+ //border
+ void SetBorderWidth(int nWidth);
+ int GetBorderWidth() const;
+
+ //BBS_SOLID
+ //BBS_DASH
+ //BBS_BEVELED
+ //BBS_INSET
+ //BBS_UNDERLINE
+
+ void SetBorderStyle(int nStyle);
+ int GetBorderStyle() const;
+
+ void SetBorderDash(const CFX_IntArray& array);
+ void GetBorderDash(CFX_IntArray& array) const;
+
+ //The background of the annotation's icon when closed
+ //The title bar of the annotation's pop-up window
+ //The border of a link annotation
+
+ void SetColor(FX_COLORREF color);
+ void RemoveColor();
+ FX_BOOL GetColor(FX_COLORREF& color) const;
+
+ FX_BOOL IsVisible() const;
+ //action
+
+ CPDF_Action GetAction() const;
+ void SetAction(const CPDF_Action& a);
+ void RemoveAction();
+
+ CPDF_AAction GetAAction() const;
+ void SetAAction(const CPDF_AAction& aa);
+ void RemoveAAction();
+
+ virtual CPDF_Action GetAAction(CPDF_AAction::AActionType eAAT);
+
+public:
+ FX_BOOL IsAppearanceValid();
+ FX_BOOL IsAppearanceValid(CPDF_Annot::AppearanceMode mode);
+ void DrawAppearance(CFX_RenderDevice* pDevice, const CPDF_Matrix* pUser2Device,
+ CPDF_Annot::AppearanceMode mode, const CPDF_RenderOptions* pOptions);
+ void DrawBorder(CFX_RenderDevice* pDevice, const CPDF_Matrix* pUser2Device,
+ const CPDF_RenderOptions* pOptions);
+
+ void ClearCachedAP();
+
+ virtual void ResetAppearance();
+ void WriteAppearance(const CFX_ByteString& sAPType, const CPDF_Rect& rcBBox,
+ const CPDF_Matrix& matrix, const CFX_ByteString& sContents,
+ const CFX_ByteString& sAPState = "");
+
+public:
+ virtual void Annot_OnDraw(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,CPDF_RenderOptions* pOptions);
+public:
+
+
+private:
+ FX_BOOL CreateFormFiller();
+protected:
+ CPDF_Annot* m_pAnnot;
+ CPDFSDK_PageView* m_pPageView;
+ FX_BOOL m_bSelected;
+ int m_nTabOrder;
+
+};
+
+
+
+#endif
+
diff --git a/fpdfsdk/include/fsdk_baseform.h b/fpdfsdk/include/fsdk_baseform.h
index baa1c28485..b93cbbd81f 100644
--- a/fpdfsdk/include/fsdk_baseform.h
+++ b/fpdfsdk/include/fsdk_baseform.h
@@ -1,292 +1,292 @@
-// 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 _FSDK_BASEFORM_H_
-#define _FSDK_BASEFORM_H_
-
-#if _FX_OS_ == _FX_ANDROID_
-#include "time.h"
-#else
-#include <ctime>
-#endif
-
-class CPDFSDK_Document;
-class CPDFSDK_DateTime;
-struct CPWL_Color;
-class CFFL_FormFiller;
-class CPDFSDK_PageView;
-class CPDFSDK_InterForm;
-
-
-typedef struct _PDFSDK_FieldAction
-{
- _PDFSDK_FieldAction()
- {
- bModifier = FALSE;
- bShift = FALSE;
- nCommitKey = 0;
- bKeyDown = FALSE;
- nSelEnd = nSelStart = 0;
- bWillCommit = FALSE;
- bFieldFull = FALSE;
- bRC = TRUE;
- }
-
- FX_BOOL bModifier; //in
- FX_BOOL bShift; //in
- int nCommitKey; //in
- CFX_WideString sChange; //in[out]
- CFX_WideString sChangeEx; //in
- FX_BOOL bKeyDown; //in
- int nSelEnd; //in[out]
- int nSelStart; //in[out]
- CFX_WideString sValue; //in[out]
- FX_BOOL bWillCommit; //in
- FX_BOOL bFieldFull; //in
- FX_BOOL bRC; //in[out]
-}PDFSDK_FieldAction;
-class CPDFSDK_Widget:public CPDFSDK_Annot
-{
-public:
- CPDFSDK_Widget(CPDF_Annot* pAnnot, CPDFSDK_PageView* pPageView, CPDFSDK_InterForm* pInterForm);
- virtual ~CPDFSDK_Widget();
-
- virtual CFX_ByteString GetSubType() const;
-
- virtual CPDF_Action GetAAction(CPDF_AAction::AActionType eAAT);
-
- int GetFieldType() const;
- //define layout order to 2.
- virtual int GetLayoutOrder() {return 2;}
- /*
- FIELDFLAG_READONLY
- FIELDFLAG_REQUIRED
- FIELDFLAG_NOEXPORT
- */
-
- int GetFieldFlags() const;
- int GetRotate() const;
-
- FX_BOOL GetFillColor(FX_COLORREF& color) const;
- FX_BOOL GetBorderColor(FX_COLORREF& color) const;
- FX_BOOL GetTextColor(FX_COLORREF& color) const;
- FX_FLOAT GetFontSize() const;
-
- int GetSelectedIndex(int nIndex) const;
- CFX_WideString GetValue() const;
- CFX_WideString GetDefaultValue() const;
- CFX_WideString GetOptionLabel(int nIndex) const;
- int CountOptions() const;
- FX_BOOL IsOptionSelected(int nIndex) const;
- int GetTopVisibleIndex() const;
- FX_BOOL IsChecked() const;
- /*
- BF_ALIGN_LEFT
- BF_ALIGN_MIDDL
- BF_ALIGN_RIGHT
- */
- int GetAlignment() const;
- int GetMaxLen() const;
- CFX_WideString GetAlternateName() const;
-
-//Set Properties.
- void SetCheck(FX_BOOL bChecked, FX_BOOL bNotify);
- void SetValue(const CFX_WideString& sValue, FX_BOOL bNotify);
- void SetDefaultValue(const CFX_WideString& sValue);
- void SetOptionSelection(int index, FX_BOOL bSelected, FX_BOOL bNotify);
- void ClearSelection(FX_BOOL bNotify);
- void SetTopVisibleIndex(int index);
-
- void ResetAppearance(FX_LPCWSTR sValue, FX_BOOL bValueChanged);
- void ResetFieldAppearance(FX_BOOL bValueChanged);
- void UpdateField();
- CFX_WideString OnFormat(int nCommitKey, FX_BOOL& bFormated);
-
-//Message.
- FX_BOOL OnAAction(CPDF_AAction::AActionType type, PDFSDK_FieldAction& data,
- CPDFSDK_PageView* pPageView);
-
- CPDFSDK_InterForm* GetInterForm() const {return m_pInterForm;}
- CPDF_FormField* GetFormField() const;
- CPDF_FormControl* GetFormControl() const;
- static CPDF_FormControl* GetFormControl(CPDF_InterForm* pInterForm, CPDF_Dictionary* pAnnotDict);
-
- void DrawShadow(CFX_RenderDevice* pDevice, CPDFSDK_PageView* pPageView);
-
- void SetAppModified();
- void ClearAppModified();
- FX_BOOL IsAppModified() const;
-
- FX_INT32 GetAppearanceAge() const;
- FX_INT32 GetValueAge() const;
-
-private:
- void ResetAppearance_PushButton();
- void ResetAppearance_CheckBox();
- void ResetAppearance_RadioButton();
- void ResetAppearance_ComboBox(FX_LPCWSTR sValue);
- void ResetAppearance_ListBox();
- void ResetAppearance_TextField(FX_LPCWSTR sValue);
-
- CPDF_Rect GetClientRect() const;
- CPDF_Rect GetRotatedRect() const;
-
- CFX_ByteString GetBackgroundAppStream() const;
- CFX_ByteString GetBorderAppStream() const;
- CPDF_Matrix GetMatrix() const;
-
- CPWL_Color GetTextPWLColor() const;
- CPWL_Color GetBorderPWLColor() const;
- CPWL_Color GetFillPWLColor() const;
-
- void AddImageToAppearance(const CFX_ByteString& sAPType, CPDF_Stream* pImage);
- void RemoveAppearance(const CFX_ByteString& sAPType);
-public:
- FX_BOOL IsWidgetAppearanceValid(CPDF_Annot::AppearanceMode mode);
- void DrawAppearance(CFX_RenderDevice* pDevice, const CPDF_Matrix* pUser2Device,
- CPDF_Annot::AppearanceMode mode, const CPDF_RenderOptions* pOptions);
-public:
- FX_BOOL HitTest(FX_FLOAT pageX, FX_FLOAT pageY);
-private:
- CPDFSDK_InterForm* m_pInterForm;
- FX_BOOL m_bAppModified;
- FX_INT32 m_nAppAge;
- FX_INT32 m_nValueAge;
-};
-
-#define CPDFSDK_WidgetMap CFX_MapPtrTemplate<CPDF_FormControl*, CPDFSDK_Widget*>
-
-class CPDFSDK_InterForm : public CPDF_FormNotify
-{
-public:
- CPDFSDK_InterForm(CPDFSDK_Document* pDocument);
- virtual ~CPDFSDK_InterForm();
-
-public:
- virtual void Destroy();
- virtual CPDF_InterForm* GetInterForm();
-
- CPDFSDK_Document* GetDocument();
- FX_BOOL HighlightWidgets();
-
- CPDFSDK_Widget* GetSibling(CPDFSDK_Widget* pWidget, FX_BOOL bNext) const;
- CPDFSDK_Widget* GetWidget(CPDF_FormControl* pControl) const;
- void GetWidgets(const CFX_WideString& sFieldName, CFX_PtrArray& widgets);
- void GetWidgets(CPDF_FormField* pField, CFX_PtrArray& widgets);
-
- void AddMap(CPDF_FormControl* pControl, CPDFSDK_Widget* pWidget);
- void RemoveMap(CPDF_FormControl* pControl);
-
- void EnableCalculate(FX_BOOL bEnabled);
- FX_BOOL IsCalculateEnabled() const;
-
-#ifdef _WIN32
- CPDF_Stream* LoadImageFromFile(const CFX_WideString& sFile);
-#endif
-
- void OnKeyStrokeCommit(CPDF_FormField* pFormField, CFX_WideString& csValue, FX_BOOL& bRC);
- void OnValidate(CPDF_FormField* pFormField, CFX_WideString& csValue, FX_BOOL& bRC);
- void OnCalculate(CPDF_FormField* pFormField = NULL);
- CFX_WideString OnFormat(CPDF_FormField* pFormField, int nCommitKey, FX_BOOL& bFormated);
-
- void ResetFieldAppearance(CPDF_FormField* pFormField, FX_LPCWSTR sValue, FX_BOOL bValueChanged);
- void UpdateField(CPDF_FormField* pFormField);
-
-public:
- FX_BOOL DoAction_Hide(const CPDF_Action& action);
- FX_BOOL DoAction_SubmitForm(const CPDF_Action& action);
- FX_BOOL DoAction_ResetForm(const CPDF_Action& action);
- FX_BOOL DoAction_ImportData(const CPDF_Action& action);
-
- void GetFieldFromObjects(const CFX_PtrArray& objects, CFX_PtrArray& fields);
- FX_BOOL IsValidField(CPDF_Dictionary* pFieldDict);
- FX_BOOL SubmitFields(const CFX_WideString& csDestination, const CFX_PtrArray& fields,
- FX_BOOL bIncludeOrExclude, FX_BOOL bUrlEncoded);
- FX_BOOL SubmitForm(const CFX_WideString& sDestination, FX_BOOL bUrlEncoded);
- FX_BOOL ImportFormFromFDFFile(const CFX_WideString& csFDFFileName, FX_BOOL bNotify);
- FX_BOOL ExportFormToFDFFile(const CFX_WideString& sFDFFileName);
- FX_BOOL ExportFormToFDFTextBuf(CFX_ByteTextBuf& textBuf);
- FX_BOOL ExportFieldsToFDFFile(const CFX_WideString& sFDFFileName, const CFX_PtrArray& fields,
- FX_BOOL bIncludeOrExclude);
- FX_BOOL ExportFieldsToFDFTextBuf(const CFX_PtrArray& fields,FX_BOOL bIncludeOrExclude, CFX_ByteTextBuf& textBuf);
- FX_BOOL ExportFormToTxtFile(const CFX_WideString& sTxtFileName);
- FX_BOOL ImportFormFromTxtFile(const CFX_WideString& sTxtFileName);
- CFX_WideString GetTemporaryFileName(const CFX_WideString& sFileExt);
-
-private:
- virtual int BeforeValueChange(const CPDF_FormField* pField, CFX_WideString& csValue);
- virtual int AfterValueChange(const CPDF_FormField* pField);
- virtual int BeforeSelectionChange(const CPDF_FormField* pField, CFX_WideString& csValue);
- virtual int AfterSelectionChange(const CPDF_FormField* pField);
- virtual int AfterCheckedStatusChange(const CPDF_FormField* pField, const CFX_ByteArray& statusArray);
- virtual int BeforeFormReset(const CPDF_InterForm* pForm);
- virtual int AfterFormReset(const CPDF_InterForm* pForm);
- virtual int BeforeFormImportData(const CPDF_InterForm* pForm);
- virtual int AfterFormImportData(const CPDF_InterForm* pForm);
-
-private:
- FX_BOOL FDFToURLEncodedData(CFX_WideString csFDFFile, CFX_WideString csTxtFile);
- FX_BOOL FDFToURLEncodedData(FX_LPBYTE& pBuf, FX_STRSIZE& nBufSize);
- int GetPageIndexByAnnotDict(CPDF_Document* pDocument, CPDF_Dictionary* pAnnotDict) const;
- void DoFDFBuffer(CFX_ByteString sBuffer);
-
-private:
- CPDFSDK_Document* m_pDocument;
- CPDF_InterForm* m_pInterForm;
- CPDFSDK_WidgetMap m_Map;
- FX_BOOL m_bCalculate;
- FX_BOOL m_bBusy;
-
-public:
- FX_BOOL IsNeedHighLight(int nFieldType);
- void RemoveAllHighLight();
- void SetHighlightAlpha(FX_BYTE alpha) {m_iHighlightAlpha = alpha;}
- FX_BYTE GetHighlightAlpha() {return m_iHighlightAlpha;}
- void SetHighlightColor(FX_COLORREF clr, int nFieldType);
- FX_COLORREF GetHighlightColor(int nFieldType);
-private:
- FX_COLORREF m_aHighlightColor[6];
- FX_BYTE m_iHighlightAlpha;
- FX_BOOL m_bNeedHightlight[6];
-};
-
-#define BAI_STRUCTURE 0
-#define BAI_ROW 1
-#define BAI_COLUMN 2
-
-#define CPDFSDK_Annots CFX_ArrayTemplate<CPDFSDK_Annot*>
-#define CPDFSDK_SortAnnots CGW_ArrayTemplate<CPDFSDK_Annot*>
-class CBA_AnnotIterator
-{
-public:
- CBA_AnnotIterator(CPDFSDK_PageView* pPageView, const CFX_ByteString& sType, const CFX_ByteString& sSubType);
- virtual ~CBA_AnnotIterator();
-
- virtual CPDFSDK_Annot* GetFirstAnnot();
- virtual CPDFSDK_Annot* GetLastAnnot();
- virtual CPDFSDK_Annot* GetNextAnnot(CPDFSDK_Annot* pAnnot);
- virtual CPDFSDK_Annot* GetPrevAnnot(CPDFSDK_Annot* pAnnot);
-
- virtual void Release(){delete this;}
-
-private:
- void GenerateResults();
- static int CompareByLeft(CPDFSDK_Annot* p1, CPDFSDK_Annot* p2);
- static int CompareByTop(CPDFSDK_Annot* p1, CPDFSDK_Annot* p2);
-
- static CPDF_Rect GetAnnotRect(CPDFSDK_Annot* pAnnot);
-
-private:
- CPDFSDK_PageView* m_pPageView;
- CFX_ByteString m_sType;
- CFX_ByteString m_sSubType;
- int m_nTabs;
-
- CPDFSDK_Annots m_Annots;
-};
-
-#endif //#define _FSDK_BASEFORM_H_
-
+// 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 _FSDK_BASEFORM_H_
+#define _FSDK_BASEFORM_H_
+
+#if _FX_OS_ == _FX_ANDROID_
+#include "time.h"
+#else
+#include <ctime>
+#endif
+
+class CPDFSDK_Document;
+class CPDFSDK_DateTime;
+struct CPWL_Color;
+class CFFL_FormFiller;
+class CPDFSDK_PageView;
+class CPDFSDK_InterForm;
+
+
+typedef struct _PDFSDK_FieldAction
+{
+ _PDFSDK_FieldAction()
+ {
+ bModifier = FALSE;
+ bShift = FALSE;
+ nCommitKey = 0;
+ bKeyDown = FALSE;
+ nSelEnd = nSelStart = 0;
+ bWillCommit = FALSE;
+ bFieldFull = FALSE;
+ bRC = TRUE;
+ }
+
+ FX_BOOL bModifier; //in
+ FX_BOOL bShift; //in
+ int nCommitKey; //in
+ CFX_WideString sChange; //in[out]
+ CFX_WideString sChangeEx; //in
+ FX_BOOL bKeyDown; //in
+ int nSelEnd; //in[out]
+ int nSelStart; //in[out]
+ CFX_WideString sValue; //in[out]
+ FX_BOOL bWillCommit; //in
+ FX_BOOL bFieldFull; //in
+ FX_BOOL bRC; //in[out]
+}PDFSDK_FieldAction;
+class CPDFSDK_Widget:public CPDFSDK_Annot
+{
+public:
+ CPDFSDK_Widget(CPDF_Annot* pAnnot, CPDFSDK_PageView* pPageView, CPDFSDK_InterForm* pInterForm);
+ virtual ~CPDFSDK_Widget();
+
+ virtual CFX_ByteString GetSubType() const;
+
+ virtual CPDF_Action GetAAction(CPDF_AAction::AActionType eAAT);
+
+ int GetFieldType() const;
+ //define layout order to 2.
+ virtual int GetLayoutOrder() {return 2;}
+ /*
+ FIELDFLAG_READONLY
+ FIELDFLAG_REQUIRED
+ FIELDFLAG_NOEXPORT
+ */
+
+ int GetFieldFlags() const;
+ int GetRotate() const;
+
+ FX_BOOL GetFillColor(FX_COLORREF& color) const;
+ FX_BOOL GetBorderColor(FX_COLORREF& color) const;
+ FX_BOOL GetTextColor(FX_COLORREF& color) const;
+ FX_FLOAT GetFontSize() const;
+
+ int GetSelectedIndex(int nIndex) const;
+ CFX_WideString GetValue() const;
+ CFX_WideString GetDefaultValue() const;
+ CFX_WideString GetOptionLabel(int nIndex) const;
+ int CountOptions() const;
+ FX_BOOL IsOptionSelected(int nIndex) const;
+ int GetTopVisibleIndex() const;
+ FX_BOOL IsChecked() const;
+ /*
+ BF_ALIGN_LEFT
+ BF_ALIGN_MIDDL
+ BF_ALIGN_RIGHT
+ */
+ int GetAlignment() const;
+ int GetMaxLen() const;
+ CFX_WideString GetAlternateName() const;
+
+//Set Properties.
+ void SetCheck(FX_BOOL bChecked, FX_BOOL bNotify);
+ void SetValue(const CFX_WideString& sValue, FX_BOOL bNotify);
+ void SetDefaultValue(const CFX_WideString& sValue);
+ void SetOptionSelection(int index, FX_BOOL bSelected, FX_BOOL bNotify);
+ void ClearSelection(FX_BOOL bNotify);
+ void SetTopVisibleIndex(int index);
+
+ void ResetAppearance(FX_LPCWSTR sValue, FX_BOOL bValueChanged);
+ void ResetFieldAppearance(FX_BOOL bValueChanged);
+ void UpdateField();
+ CFX_WideString OnFormat(int nCommitKey, FX_BOOL& bFormated);
+
+//Message.
+ FX_BOOL OnAAction(CPDF_AAction::AActionType type, PDFSDK_FieldAction& data,
+ CPDFSDK_PageView* pPageView);
+
+ CPDFSDK_InterForm* GetInterForm() const {return m_pInterForm;}
+ CPDF_FormField* GetFormField() const;
+ CPDF_FormControl* GetFormControl() const;
+ static CPDF_FormControl* GetFormControl(CPDF_InterForm* pInterForm, CPDF_Dictionary* pAnnotDict);
+
+ void DrawShadow(CFX_RenderDevice* pDevice, CPDFSDK_PageView* pPageView);
+
+ void SetAppModified();
+ void ClearAppModified();
+ FX_BOOL IsAppModified() const;
+
+ FX_INT32 GetAppearanceAge() const;
+ FX_INT32 GetValueAge() const;
+
+private:
+ void ResetAppearance_PushButton();
+ void ResetAppearance_CheckBox();
+ void ResetAppearance_RadioButton();
+ void ResetAppearance_ComboBox(FX_LPCWSTR sValue);
+ void ResetAppearance_ListBox();
+ void ResetAppearance_TextField(FX_LPCWSTR sValue);
+
+ CPDF_Rect GetClientRect() const;
+ CPDF_Rect GetRotatedRect() const;
+
+ CFX_ByteString GetBackgroundAppStream() const;
+ CFX_ByteString GetBorderAppStream() const;
+ CPDF_Matrix GetMatrix() const;
+
+ CPWL_Color GetTextPWLColor() const;
+ CPWL_Color GetBorderPWLColor() const;
+ CPWL_Color GetFillPWLColor() const;
+
+ void AddImageToAppearance(const CFX_ByteString& sAPType, CPDF_Stream* pImage);
+ void RemoveAppearance(const CFX_ByteString& sAPType);
+public:
+ FX_BOOL IsWidgetAppearanceValid(CPDF_Annot::AppearanceMode mode);
+ void DrawAppearance(CFX_RenderDevice* pDevice, const CPDF_Matrix* pUser2Device,
+ CPDF_Annot::AppearanceMode mode, const CPDF_RenderOptions* pOptions);
+public:
+ FX_BOOL HitTest(FX_FLOAT pageX, FX_FLOAT pageY);
+private:
+ CPDFSDK_InterForm* m_pInterForm;
+ FX_BOOL m_bAppModified;
+ FX_INT32 m_nAppAge;
+ FX_INT32 m_nValueAge;
+};
+
+#define CPDFSDK_WidgetMap CFX_MapPtrTemplate<CPDF_FormControl*, CPDFSDK_Widget*>
+
+class CPDFSDK_InterForm : public CPDF_FormNotify
+{
+public:
+ CPDFSDK_InterForm(CPDFSDK_Document* pDocument);
+ virtual ~CPDFSDK_InterForm();
+
+public:
+ virtual void Destroy();
+ virtual CPDF_InterForm* GetInterForm();
+
+ CPDFSDK_Document* GetDocument();
+ FX_BOOL HighlightWidgets();
+
+ CPDFSDK_Widget* GetSibling(CPDFSDK_Widget* pWidget, FX_BOOL bNext) const;
+ CPDFSDK_Widget* GetWidget(CPDF_FormControl* pControl) const;
+ void GetWidgets(const CFX_WideString& sFieldName, CFX_PtrArray& widgets);
+ void GetWidgets(CPDF_FormField* pField, CFX_PtrArray& widgets);
+
+ void AddMap(CPDF_FormControl* pControl, CPDFSDK_Widget* pWidget);
+ void RemoveMap(CPDF_FormControl* pControl);
+
+ void EnableCalculate(FX_BOOL bEnabled);
+ FX_BOOL IsCalculateEnabled() const;
+
+#ifdef _WIN32
+ CPDF_Stream* LoadImageFromFile(const CFX_WideString& sFile);
+#endif
+
+ void OnKeyStrokeCommit(CPDF_FormField* pFormField, CFX_WideString& csValue, FX_BOOL& bRC);
+ void OnValidate(CPDF_FormField* pFormField, CFX_WideString& csValue, FX_BOOL& bRC);
+ void OnCalculate(CPDF_FormField* pFormField = NULL);
+ CFX_WideString OnFormat(CPDF_FormField* pFormField, int nCommitKey, FX_BOOL& bFormated);
+
+ void ResetFieldAppearance(CPDF_FormField* pFormField, FX_LPCWSTR sValue, FX_BOOL bValueChanged);
+ void UpdateField(CPDF_FormField* pFormField);
+
+public:
+ FX_BOOL DoAction_Hide(const CPDF_Action& action);
+ FX_BOOL DoAction_SubmitForm(const CPDF_Action& action);
+ FX_BOOL DoAction_ResetForm(const CPDF_Action& action);
+ FX_BOOL DoAction_ImportData(const CPDF_Action& action);
+
+ void GetFieldFromObjects(const CFX_PtrArray& objects, CFX_PtrArray& fields);
+ FX_BOOL IsValidField(CPDF_Dictionary* pFieldDict);
+ FX_BOOL SubmitFields(const CFX_WideString& csDestination, const CFX_PtrArray& fields,
+ FX_BOOL bIncludeOrExclude, FX_BOOL bUrlEncoded);
+ FX_BOOL SubmitForm(const CFX_WideString& sDestination, FX_BOOL bUrlEncoded);
+ FX_BOOL ImportFormFromFDFFile(const CFX_WideString& csFDFFileName, FX_BOOL bNotify);
+ FX_BOOL ExportFormToFDFFile(const CFX_WideString& sFDFFileName);
+ FX_BOOL ExportFormToFDFTextBuf(CFX_ByteTextBuf& textBuf);
+ FX_BOOL ExportFieldsToFDFFile(const CFX_WideString& sFDFFileName, const CFX_PtrArray& fields,
+ FX_BOOL bIncludeOrExclude);
+ FX_BOOL ExportFieldsToFDFTextBuf(const CFX_PtrArray& fields,FX_BOOL bIncludeOrExclude, CFX_ByteTextBuf& textBuf);
+ FX_BOOL ExportFormToTxtFile(const CFX_WideString& sTxtFileName);
+ FX_BOOL ImportFormFromTxtFile(const CFX_WideString& sTxtFileName);
+ CFX_WideString GetTemporaryFileName(const CFX_WideString& sFileExt);
+
+private:
+ virtual int BeforeValueChange(const CPDF_FormField* pField, CFX_WideString& csValue);
+ virtual int AfterValueChange(const CPDF_FormField* pField);
+ virtual int BeforeSelectionChange(const CPDF_FormField* pField, CFX_WideString& csValue);
+ virtual int AfterSelectionChange(const CPDF_FormField* pField);
+ virtual int AfterCheckedStatusChange(const CPDF_FormField* pField, const CFX_ByteArray& statusArray);
+ virtual int BeforeFormReset(const CPDF_InterForm* pForm);
+ virtual int AfterFormReset(const CPDF_InterForm* pForm);
+ virtual int BeforeFormImportData(const CPDF_InterForm* pForm);
+ virtual int AfterFormImportData(const CPDF_InterForm* pForm);
+
+private:
+ FX_BOOL FDFToURLEncodedData(CFX_WideString csFDFFile, CFX_WideString csTxtFile);
+ FX_BOOL FDFToURLEncodedData(FX_LPBYTE& pBuf, FX_STRSIZE& nBufSize);
+ int GetPageIndexByAnnotDict(CPDF_Document* pDocument, CPDF_Dictionary* pAnnotDict) const;
+ void DoFDFBuffer(CFX_ByteString sBuffer);
+
+private:
+ CPDFSDK_Document* m_pDocument;
+ CPDF_InterForm* m_pInterForm;
+ CPDFSDK_WidgetMap m_Map;
+ FX_BOOL m_bCalculate;
+ FX_BOOL m_bBusy;
+
+public:
+ FX_BOOL IsNeedHighLight(int nFieldType);
+ void RemoveAllHighLight();
+ void SetHighlightAlpha(FX_BYTE alpha) {m_iHighlightAlpha = alpha;}
+ FX_BYTE GetHighlightAlpha() {return m_iHighlightAlpha;}
+ void SetHighlightColor(FX_COLORREF clr, int nFieldType);
+ FX_COLORREF GetHighlightColor(int nFieldType);
+private:
+ FX_COLORREF m_aHighlightColor[6];
+ FX_BYTE m_iHighlightAlpha;
+ FX_BOOL m_bNeedHightlight[6];
+};
+
+#define BAI_STRUCTURE 0
+#define BAI_ROW 1
+#define BAI_COLUMN 2
+
+#define CPDFSDK_Annots CFX_ArrayTemplate<CPDFSDK_Annot*>
+#define CPDFSDK_SortAnnots CGW_ArrayTemplate<CPDFSDK_Annot*>
+class CBA_AnnotIterator
+{
+public:
+ CBA_AnnotIterator(CPDFSDK_PageView* pPageView, const CFX_ByteString& sType, const CFX_ByteString& sSubType);
+ virtual ~CBA_AnnotIterator();
+
+ virtual CPDFSDK_Annot* GetFirstAnnot();
+ virtual CPDFSDK_Annot* GetLastAnnot();
+ virtual CPDFSDK_Annot* GetNextAnnot(CPDFSDK_Annot* pAnnot);
+ virtual CPDFSDK_Annot* GetPrevAnnot(CPDFSDK_Annot* pAnnot);
+
+ virtual void Release(){delete this;}
+
+private:
+ void GenerateResults();
+ static int CompareByLeft(CPDFSDK_Annot* p1, CPDFSDK_Annot* p2);
+ static int CompareByTop(CPDFSDK_Annot* p1, CPDFSDK_Annot* p2);
+
+ static CPDF_Rect GetAnnotRect(CPDFSDK_Annot* pAnnot);
+
+private:
+ CPDFSDK_PageView* m_pPageView;
+ CFX_ByteString m_sType;
+ CFX_ByteString m_sSubType;
+ int m_nTabs;
+
+ CPDFSDK_Annots m_Annots;
+};
+
+#endif //#define _FSDK_BASEFORM_H_
+
diff --git a/fpdfsdk/include/fsdk_common.h b/fpdfsdk/include/fsdk_common.h
index b49c1d1690..197917c567 100644
--- a/fpdfsdk/include/fsdk_common.h
+++ b/fpdfsdk/include/fsdk_common.h
@@ -1,46 +1,46 @@
-// 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 _FSDK_COMMON_H_
-#define _FSDK_COMMON_H_
-
-#define BFFT_SIGNATURE "Signature"
-
-//for all fields
-#define FIELDFLAG_READONLY 1
-#define FIELDFLAG_REQUIRED 2
-#define FIELDFLAG_NOEXPORT 4
-//for text fields
-#define FIELDFLAG_MULTILINE (1<<12)
-#define FIELDFLAG_PASSWORD (1<<13)
-#define FIELDFLAG_FILESELECT (1<<20)
-#define FIELDFLAG_DONOTSPELLCHECK (1<<22)
-#define FIELDFLAG_DONOTSCROLL (1<<23)
-#define FIELDFLAG_COMB (1<<24)
-#define FIELDFLAG_RICHTEXT (1<<25)
-//for button fileds
-#define FIELDFLAG_NOTOGGLETOOFF (1<<14)
-#define FIELDFLAG_RADIO (1<<15)
-#define FIELDFLAG_PUSHBUTTON (1<<16)
-#define FIELDFLAG_RADIOSINUNISON (1<<25)
-//for choice fields
-#define FIELDFLAG_COMBO (1<<17)
-#define FIELDFLAG_EDIT (1<<18)
-#define FIELDFLAG_SORT (1<<19)
-#define FIELDFLAG_MULTISELECT (1<<21)
-#ifndef FIELDFLAG_DONOTSPELLCHECK
-#define FIELDFLAG_DONOTSPELLCHECK (1<<22)
-#endif
-#define FIELDFLAG_COMMITONSELCHANGE (1<<26)
-
-#define BBS_SOLID 0
-#define BBS_DASH 1
-#define BBS_BEVELED 2
-#define BBS_INSET 3
-#define BBS_UNDERLINE 4
-
-
-#endif
+// 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 _FSDK_COMMON_H_
+#define _FSDK_COMMON_H_
+
+#define BFFT_SIGNATURE "Signature"
+
+//for all fields
+#define FIELDFLAG_READONLY 1
+#define FIELDFLAG_REQUIRED 2
+#define FIELDFLAG_NOEXPORT 4
+//for text fields
+#define FIELDFLAG_MULTILINE (1<<12)
+#define FIELDFLAG_PASSWORD (1<<13)
+#define FIELDFLAG_FILESELECT (1<<20)
+#define FIELDFLAG_DONOTSPELLCHECK (1<<22)
+#define FIELDFLAG_DONOTSCROLL (1<<23)
+#define FIELDFLAG_COMB (1<<24)
+#define FIELDFLAG_RICHTEXT (1<<25)
+//for button fileds
+#define FIELDFLAG_NOTOGGLETOOFF (1<<14)
+#define FIELDFLAG_RADIO (1<<15)
+#define FIELDFLAG_PUSHBUTTON (1<<16)
+#define FIELDFLAG_RADIOSINUNISON (1<<25)
+//for choice fields
+#define FIELDFLAG_COMBO (1<<17)
+#define FIELDFLAG_EDIT (1<<18)
+#define FIELDFLAG_SORT (1<<19)
+#define FIELDFLAG_MULTISELECT (1<<21)
+#ifndef FIELDFLAG_DONOTSPELLCHECK
+#define FIELDFLAG_DONOTSPELLCHECK (1<<22)
+#endif
+#define FIELDFLAG_COMMITONSELCHANGE (1<<26)
+
+#define BBS_SOLID 0
+#define BBS_DASH 1
+#define BBS_BEVELED 2
+#define BBS_INSET 3
+#define BBS_UNDERLINE 4
+
+
+#endif
diff --git a/fpdfsdk/include/fsdk_define.h b/fpdfsdk/include/fsdk_define.h
index 5f9cde3858..2bf4721c0d 100644
--- a/fpdfsdk/include/fsdk_define.h
+++ b/fpdfsdk/include/fsdk_define.h
@@ -1,128 +1,128 @@
-// 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 _FPDFSDK_DEFINE_H
-#define _FPDFSDK_DEFINE_H
-
-#ifdef _WIN32
-#include <tchar.h>
-#include <math.h>
-#endif
-
-//#define API5
-#define API6
-#define _FPDFAPI_ASYNC_PARSING_
-#define _FXSDK_OPENSOURCE_
-
-#ifdef _FPDFEMB_WCE_
- #include "../../core/include/fpdfapi/fpdfapi.h"
- #include "../../core/include/fpdfapi/fpdf_parser.h"
- #include "../../core/include/fpdfapi/fpdf_module.h"
- #include "../../core/include/fpdfapi/fpdf_render.h"
- #include "../../core/include/fpdfapi/fpdf_pageobj.h"
- #include "../../core/include/fpdfapi/fpdf_serial.h"
-
- #include "../../core/include/fpdftext/fpdf_text.h"
-
- #include "../../core/include/fxge/fx_ge_win32.h"
- #include "../../core/include/fxge/fx_ge.h"
-
- #include "../../core/include/fxcodec/fx_codec.h"
-
- #include "../../core/include/fpdfdoc/fpdf_doc.h"
- #include "../../core/include/fpdfdoc/fpdf_vt.h"
-
- #include "../../core/include/fxcrt/fx_xml.h"
- #include "../../core/include/fxcrt/fx_crypt.h"
-
-#else
- #ifdef API6
- #include "../../core/include/fpdfapi/fpdf_parser.h"
- #include "../../core/include/fpdfapi/fpdfapi.h"
- #include "../../core/include/fpdfapi/fpdf_parser.h"
- #include "../../core/include/fpdfapi/fpdf_module.h"
- #include "../../core/include/fpdfapi/fpdf_render.h"
- #include "../../core/include/fpdfapi/fpdf_pageobj.h"
- #include "../../core/include/fpdfapi/fpdf_serial.h"
-
- #include "../../core/include/fpdftext/fpdf_text.h"
-
- #include "../../core/include/fxge/fx_ge_win32.h"
- #include "../../core/include/fxge/fx_ge.h"
-
- #include "../../core/include/fxcodec/fx_codec.h"
-
- #include "../../core/include/fpdfdoc/fpdf_doc.h"
- #include "../../core/include/fpdfdoc/fpdf_vt.h"
-
- #include "../../core/include/fxcrt/fx_xml.h"
- // #include "../../core/include/fdrm/fx_crypt.h"
- #ifdef _LICENSED_BUILD_
- #include "../../cryptopp/Cryptlib.h"
- #endif
- #endif
-#endif
-
-
-#ifndef FX_GetAValue
-/** @brief It retrieves an intensity value for the alpha component of a #FX_ARGB value. */
-#define FX_GetAValue(argb) ((argb & 0xFF000000) >> 24)
-#endif
-
-#ifndef FX_GetRValue
-/** @brief It retrieves an intensity value for the red component of a #FX_ARGB value. */
-#define FX_GetRValue(argb) ((argb & 0x00FF0000) >> 16)
-#endif
-
-#ifndef FX_GetGValue
-/** @brief It retrieves an intensity value for the green component of a #FX_ARGB value. */
-#define FX_GetGValue(argb) ((argb & 0x0000FF00) >> 8)
-#endif
-
-#ifndef FX_GetBValue
-/** @brief It retrieves an intensity value for the blue component of a #FX_ARGB value. */
-#define FX_GetBValue(argb) (argb & 0x000000FF)
-#endif
-
-#ifndef FX_ARGBTOCOLORREF
-/** @brief Convert a #FX_ARGB to a #FX_COLORREF. */
-#define FX_ARGBTOCOLORREF(argb) ((((FX_DWORD)argb & 0x00FF0000) >> 16)|((FX_DWORD)argb & 0x0000FF00)|(((FX_DWORD)argb & 0x000000FF) << 16))
-#endif
-
-#ifndef FX_COLORREFTOARGB
-/** @brief Convert a #FX_COLORREF to a #FX_ARGB. */
-#define FX_COLORREFTOARGB(rgb) ((FX_DWORD)0xFF000000|(((FX_DWORD)rgb & 0x000000FF) << 16)|((FX_DWORD)rgb & 0x0000FF00)|(((FX_DWORD)rgb & 0x00FF0000) >> 16))
-#endif
-
-typedef unsigned int FX_UINT;
-
-#include "fpdfview.h"
-
-class CPDF_CustomAccess : public IFX_FileRead, public CFX_Object
-{
-public:
- CPDF_CustomAccess(FPDF_FILEACCESS* pFileAccess);
- ~CPDF_CustomAccess() {}
-
- virtual CFX_ByteString GetFullPath() { return ""; }
- virtual FX_FILESIZE GetSize() { return m_FileAccess.m_FileLen; }
-
- virtual FX_BOOL GetByte(FX_DWORD pos, FX_BYTE& ch);
- virtual FX_BOOL GetBlock(FX_DWORD pos, FX_LPBYTE pBuf, FX_DWORD size);
- virtual void Release() { delete this; }
-
- virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size);
-
- FPDF_FILEACCESS m_FileAccess;
- FX_BYTE m_Buffer[512];
- FX_DWORD m_BufferOffset;
-};
-
-void FSDK_SetSandBoxPolicy(FPDF_DWORD policy, FPDF_BOOL enable);
-FPDF_BOOL FSDK_IsSandBoxPolicyEnabled(FPDF_DWORD policy);
-
-
-#endif//_FPDFSDK_DEFINE_H
+// 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 _FPDFSDK_DEFINE_H
+#define _FPDFSDK_DEFINE_H
+
+#ifdef _WIN32
+#include <tchar.h>
+#include <math.h>
+#endif
+
+//#define API5
+#define API6
+#define _FPDFAPI_ASYNC_PARSING_
+#define _FXSDK_OPENSOURCE_
+
+#ifdef _FPDFEMB_WCE_
+ #include "../../core/include/fpdfapi/fpdfapi.h"
+ #include "../../core/include/fpdfapi/fpdf_parser.h"
+ #include "../../core/include/fpdfapi/fpdf_module.h"
+ #include "../../core/include/fpdfapi/fpdf_render.h"
+ #include "../../core/include/fpdfapi/fpdf_pageobj.h"
+ #include "../../core/include/fpdfapi/fpdf_serial.h"
+
+ #include "../../core/include/fpdftext/fpdf_text.h"
+
+ #include "../../core/include/fxge/fx_ge_win32.h"
+ #include "../../core/include/fxge/fx_ge.h"
+
+ #include "../../core/include/fxcodec/fx_codec.h"
+
+ #include "../../core/include/fpdfdoc/fpdf_doc.h"
+ #include "../../core/include/fpdfdoc/fpdf_vt.h"
+
+ #include "../../core/include/fxcrt/fx_xml.h"
+ #include "../../core/include/fxcrt/fx_crypt.h"
+
+#else
+ #ifdef API6
+ #include "../../core/include/fpdfapi/fpdf_parser.h"
+ #include "../../core/include/fpdfapi/fpdfapi.h"
+ #include "../../core/include/fpdfapi/fpdf_parser.h"
+ #include "../../core/include/fpdfapi/fpdf_module.h"
+ #include "../../core/include/fpdfapi/fpdf_render.h"
+ #include "../../core/include/fpdfapi/fpdf_pageobj.h"
+ #include "../../core/include/fpdfapi/fpdf_serial.h"
+
+ #include "../../core/include/fpdftext/fpdf_text.h"
+
+ #include "../../core/include/fxge/fx_ge_win32.h"
+ #include "../../core/include/fxge/fx_ge.h"
+
+ #include "../../core/include/fxcodec/fx_codec.h"
+
+ #include "../../core/include/fpdfdoc/fpdf_doc.h"
+ #include "../../core/include/fpdfdoc/fpdf_vt.h"
+
+ #include "../../core/include/fxcrt/fx_xml.h"
+ // #include "../../core/include/fdrm/fx_crypt.h"
+ #ifdef _LICENSED_BUILD_
+ #include "../../cryptopp/Cryptlib.h"
+ #endif
+ #endif
+#endif
+
+
+#ifndef FX_GetAValue
+/** @brief It retrieves an intensity value for the alpha component of a #FX_ARGB value. */
+#define FX_GetAValue(argb) ((argb & 0xFF000000) >> 24)
+#endif
+
+#ifndef FX_GetRValue
+/** @brief It retrieves an intensity value for the red component of a #FX_ARGB value. */
+#define FX_GetRValue(argb) ((argb & 0x00FF0000) >> 16)
+#endif
+
+#ifndef FX_GetGValue
+/** @brief It retrieves an intensity value for the green component of a #FX_ARGB value. */
+#define FX_GetGValue(argb) ((argb & 0x0000FF00) >> 8)
+#endif
+
+#ifndef FX_GetBValue
+/** @brief It retrieves an intensity value for the blue component of a #FX_ARGB value. */
+#define FX_GetBValue(argb) (argb & 0x000000FF)
+#endif
+
+#ifndef FX_ARGBTOCOLORREF
+/** @brief Convert a #FX_ARGB to a #FX_COLORREF. */
+#define FX_ARGBTOCOLORREF(argb) ((((FX_DWORD)argb & 0x00FF0000) >> 16)|((FX_DWORD)argb & 0x0000FF00)|(((FX_DWORD)argb & 0x000000FF) << 16))
+#endif
+
+#ifndef FX_COLORREFTOARGB
+/** @brief Convert a #FX_COLORREF to a #FX_ARGB. */
+#define FX_COLORREFTOARGB(rgb) ((FX_DWORD)0xFF000000|(((FX_DWORD)rgb & 0x000000FF) << 16)|((FX_DWORD)rgb & 0x0000FF00)|(((FX_DWORD)rgb & 0x00FF0000) >> 16))
+#endif
+
+typedef unsigned int FX_UINT;
+
+#include "fpdfview.h"
+
+class CPDF_CustomAccess : public IFX_FileRead, public CFX_Object
+{
+public:
+ CPDF_CustomAccess(FPDF_FILEACCESS* pFileAccess);
+ ~CPDF_CustomAccess() {}
+
+ virtual CFX_ByteString GetFullPath() { return ""; }
+ virtual FX_FILESIZE GetSize() { return m_FileAccess.m_FileLen; }
+
+ virtual FX_BOOL GetByte(FX_DWORD pos, FX_BYTE& ch);
+ virtual FX_BOOL GetBlock(FX_DWORD pos, FX_LPBYTE pBuf, FX_DWORD size);
+ virtual void Release() { delete this; }
+
+ virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size);
+
+ FPDF_FILEACCESS m_FileAccess;
+ FX_BYTE m_Buffer[512];
+ FX_DWORD m_BufferOffset;
+};
+
+void FSDK_SetSandBoxPolicy(FPDF_DWORD policy, FPDF_BOOL enable);
+FPDF_BOOL FSDK_IsSandBoxPolicyEnabled(FPDF_DWORD policy);
+
+
+#endif//_FPDFSDK_DEFINE_H
diff --git a/fpdfsdk/include/fsdk_mgr.h b/fpdfsdk/include/fsdk_mgr.h
index 9933c41974..bb25b35e97 100644
--- a/fpdfsdk/include/fsdk_mgr.h
+++ b/fpdfsdk/include/fsdk_mgr.h
@@ -1,615 +1,615 @@
-// 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 _FPDFSDK_MGR_H
-#define _FPDFSDK_MGR_H
-
-#include "fsdk_common.h"
-#include "fsdk_define.h"
-#include "fx_systemhandler.h"
-#include "fsdk_baseannot.h"
-#include "fsdk_baseform.h"
-#include "fpdfformfill.h"
-#include "fsdk_annothandler.h"
-#include "fsdk_actionhandler.h"
-
-//cross platform keycode and events define.
-#include "fpdf_fwlevent.h"
-
-
-class CPDFSDK_Document;
-class CPDFSDK_PageView;
-class CPDFSDK_Annot;
-class CFFL_IFormFiller;
-class CPDFSDK_Widget;
-class IFX_SystemHandler;
-class CPDFSDK_ActionHandler;
-class CJS_RuntimeFactory;
-
-#include "javascript/IJavaScript.h"
-
-class CPDFDoc_Environment
-{
-public:
- CPDFDoc_Environment(CPDF_Document * pDoc);
- ~CPDFDoc_Environment();
-
- int RegAppHandle(FPDF_FORMFILLINFO* pFFinfo);//{ m_pInfo = pFFinfo; return TRUE;}
-
- virtual void Release()
- {
- if (m_pInfo && m_pInfo->Release)
- m_pInfo->Release(m_pInfo);
- delete this;
- }
-
- virtual void FFI_Invalidate(FPDF_PAGE page, double left, double top, double right, double bottom)
- {
- if (m_pInfo && m_pInfo->FFI_Invalidate)
- {
- m_pInfo->FFI_Invalidate(m_pInfo, page, left, top, right, bottom);
- }
- }
- virtual void FFI_OutputSelectedRect(FPDF_PAGE page, double left, double top, double right, double bottom)
- {
- if (m_pInfo && m_pInfo->FFI_OutputSelectedRect)
- {
- m_pInfo->FFI_OutputSelectedRect(m_pInfo, page, left, top, right, bottom);
- }
- }
-
- virtual void FFI_SetCursor(int nCursorType)
- {
- if (m_pInfo && m_pInfo->FFI_SetCursor)
- {
- m_pInfo->FFI_SetCursor(m_pInfo, nCursorType);
- }
- }
-
- virtual int FFI_SetTimer(int uElapse, TimerCallback lpTimerFunc)
- {
- if (m_pInfo && m_pInfo->FFI_SetTimer)
- {
- return m_pInfo->FFI_SetTimer(m_pInfo, uElapse, lpTimerFunc);
- }
- return -1;
- }
-
- virtual void FFI_KillTimer(int nTimerID)
- {
- if (m_pInfo && m_pInfo->FFI_KillTimer)
- {
- m_pInfo->FFI_KillTimer(m_pInfo, nTimerID);
- }
- }
- FX_SYSTEMTIME FFI_GetLocalTime()
- {
- FX_SYSTEMTIME fxtime;
- if(m_pInfo && m_pInfo->FFI_GetLocalTime)
- {
- FPDF_SYSTEMTIME systime = m_pInfo->FFI_GetLocalTime(m_pInfo);
- fxtime.wDay = systime.wDay;
- fxtime.wDayOfWeek = systime.wDayOfWeek;
- fxtime.wHour = systime.wHour;
- fxtime.wMilliseconds = systime.wMilliseconds;
- fxtime.wMinute = systime.wMinute;
- fxtime.wMonth = systime.wMonth;
- fxtime.wSecond = systime.wSecond;
- fxtime.wYear = systime.wYear;
- }
- return fxtime;
- }
-
- virtual void FFI_OnChange()
- {
- if(m_pInfo && m_pInfo->FFI_OnChange)
- {
- m_pInfo->FFI_OnChange(m_pInfo);
- }
- }
-
- virtual FX_BOOL FFI_IsSHIFTKeyDown(FX_DWORD nFlag)
- {
-
- return (nFlag & FWL_EVENTFLAG_ShiftKey) != 0;
- }
- virtual FX_BOOL FFI_IsCTRLKeyDown(FX_DWORD nFlag)
- {
-
- return (nFlag & FWL_EVENTFLAG_ControlKey) != 0;
- }
- virtual FX_BOOL FFI_IsALTKeyDown(FX_DWORD nFlag)
- {
-
- return (nFlag & FWL_EVENTFLAG_AltKey) != 0;
- }
- virtual FX_BOOL FFI_IsINSERTKeyDown(FX_DWORD nFlag)
- {
- return FALSE;
- }
-
- virtual int JS_appAlert(FX_LPCWSTR Msg, FX_LPCWSTR Title, FX_UINT Type, FX_UINT Icon)
- {
- if(m_pInfo && m_pInfo->m_pJsPlatform && m_pInfo->m_pJsPlatform->app_alert)
- {
- CFX_ByteString bsMsg = CFX_WideString(Msg).UTF16LE_Encode();
- CFX_ByteString bsTitle = CFX_WideString(Title).UTF16LE_Encode();
- FPDF_WIDESTRING pMsg = (FPDF_WIDESTRING)bsMsg.GetBuffer(bsMsg.GetLength());
- FPDF_WIDESTRING pTitle = (FPDF_WIDESTRING)bsTitle.GetBuffer(bsTitle.GetLength());
- int ret = m_pInfo->m_pJsPlatform->app_alert(m_pInfo->m_pJsPlatform, pMsg, pTitle, Type, Icon);
- bsMsg.ReleaseBuffer();
- bsTitle.ReleaseBuffer();
- return ret;
- }
- return -1;
- }
-
- virtual int JS_appResponse(FX_LPCWSTR Question, FX_LPCWSTR Title, FX_LPCWSTR Default, FX_LPCWSTR cLabel, FPDF_BOOL bPassword, void* response, int length)
- {
- if (m_pInfo && m_pInfo->m_pJsPlatform && m_pInfo->m_pJsPlatform->app_response)
- {
- CFX_ByteString bsQuestion = CFX_WideString(Question).UTF16LE_Encode();
- CFX_ByteString bsTitle = CFX_WideString(Title).UTF16LE_Encode();
- CFX_ByteString bsDefault = CFX_WideString(Default).UTF16LE_Encode();
- CFX_ByteString bsLabel = CFX_WideString(cLabel).UTF16LE_Encode();
- FPDF_WIDESTRING pQuestion = (FPDF_WIDESTRING)bsQuestion.GetBuffer(bsQuestion.GetLength());
- FPDF_WIDESTRING pTitle = (FPDF_WIDESTRING)bsTitle.GetBuffer(bsTitle.GetLength());
- FPDF_WIDESTRING pDefault = (FPDF_WIDESTRING)bsDefault.GetBuffer(bsDefault.GetLength());
- FPDF_WIDESTRING pLabel = (FPDF_WIDESTRING)bsLabel.GetBuffer(bsLabel.GetLength());
- int ret = m_pInfo->m_pJsPlatform->app_response(m_pInfo->m_pJsPlatform, pQuestion, pTitle,
- pDefault, pLabel, bPassword, response, length);
- bsQuestion.ReleaseBuffer();
- bsTitle.ReleaseBuffer();
- bsDefault.ReleaseBuffer();
- bsLabel.ReleaseBuffer();
- return ret;
- }
- return -1;
- }
-
- virtual void JS_appBeep(int nType)
- {
- if(m_pInfo && m_pInfo->m_pJsPlatform && m_pInfo->m_pJsPlatform->app_beep)
- {
- m_pInfo->m_pJsPlatform->app_beep(m_pInfo->m_pJsPlatform, nType);
- }
- }
-
- virtual CFX_WideString JS_fieldBrowse()
- {
- if(m_pInfo && m_pInfo->m_pJsPlatform && m_pInfo->m_pJsPlatform->Field_browse)
- {
- int nLen = m_pInfo->m_pJsPlatform->Field_browse(m_pInfo->m_pJsPlatform, NULL, 0);
- if(nLen <= 0)
- return L"";
- char* pbuff = new char[nLen];
- if(pbuff)
- memset(pbuff, 0, nLen);
- else
- return L"";
- nLen = m_pInfo->m_pJsPlatform->Field_browse(m_pInfo->m_pJsPlatform, pbuff, nLen);
- CFX_ByteString bsRet = CFX_ByteString(pbuff, nLen);
- CFX_WideString wsRet = CFX_WideString::FromLocal(bsRet);
- delete[] pbuff;
- return wsRet;
- }
- return L"";
- }
-
- CFX_WideString JS_docGetFilePath()
- {
- if(m_pInfo && m_pInfo->m_pJsPlatform && m_pInfo->m_pJsPlatform->Doc_getFilePath)
- {
- int nLen = m_pInfo->m_pJsPlatform->Doc_getFilePath(m_pInfo->m_pJsPlatform, NULL, 0);
- if(nLen <= 0)
- return L"";
- char* pbuff = new char[nLen];
- if(pbuff)
- memset(pbuff, 0, nLen);
- else
- return L"";
- nLen = m_pInfo->m_pJsPlatform->Doc_getFilePath(m_pInfo->m_pJsPlatform, pbuff, nLen);
- CFX_ByteString bsRet = CFX_ByteString(pbuff, nLen);
- CFX_WideString wsRet = CFX_WideString::FromLocal(bsRet);
- delete[] pbuff;
- return wsRet;
- }
- return L"";
- }
-
- void JS_docSubmitForm(void* formData, int length, FX_LPCWSTR URL)
- {
- if(m_pInfo && m_pInfo->m_pJsPlatform && m_pInfo->m_pJsPlatform->Doc_submitForm)
- {
- CFX_ByteString bsDestination = CFX_WideString(URL).UTF16LE_Encode();
- FPDF_WIDESTRING pDestination = (FPDF_WIDESTRING)bsDestination.GetBuffer(bsDestination.GetLength());
- m_pInfo->m_pJsPlatform->Doc_submitForm(m_pInfo->m_pJsPlatform, formData, length, pDestination);
- bsDestination.ReleaseBuffer();
- }
- }
-
- void JS_docmailForm(void* mailData, int length, FPDF_BOOL bUI,FX_LPCWSTR To, FX_LPCWSTR Subject, FX_LPCWSTR CC, FX_LPCWSTR BCC, FX_LPCWSTR Msg)
- {
- if(m_pInfo && m_pInfo->m_pJsPlatform && m_pInfo->m_pJsPlatform->Doc_mail)
- {
- CFX_ByteString bsTo = CFX_WideString(To).UTF16LE_Encode();
- CFX_ByteString bsCC = CFX_WideString(Subject).UTF16LE_Encode();
- CFX_ByteString bsBcc = CFX_WideString(BCC).UTF16LE_Encode();
- CFX_ByteString bsSubject = CFX_WideString(Subject).UTF16LE_Encode();
- CFX_ByteString bsMsg = CFX_WideString(Msg).UTF16LE_Encode();
- FPDF_WIDESTRING pTo = (FPDF_WIDESTRING)bsTo.GetBuffer(bsTo.GetLength());
- FPDF_WIDESTRING pCC = (FPDF_WIDESTRING)bsCC.GetBuffer(bsCC.GetLength());
- FPDF_WIDESTRING pBcc = (FPDF_WIDESTRING)bsBcc.GetBuffer(bsBcc.GetLength());
- FPDF_WIDESTRING pSubject = (FPDF_WIDESTRING)bsSubject.GetBuffer(bsSubject.GetLength());
- FPDF_WIDESTRING pMsg = (FPDF_WIDESTRING)bsMsg.GetBuffer(bsMsg.GetLength());
- m_pInfo->m_pJsPlatform->Doc_mail(m_pInfo->m_pJsPlatform, mailData, length, bUI, pTo, pSubject,
- pCC, pBcc, pMsg);
- bsTo.ReleaseBuffer();
- bsCC.ReleaseBuffer();
- bsBcc.ReleaseBuffer();
- bsSubject.ReleaseBuffer();
- bsMsg.ReleaseBuffer();
- }
- }
- CFX_WideString JS_appbrowseForDoc(FPDF_BOOL bSave, FX_LPCWSTR cFilenameInit)
- {
- //to do....
- return L"";
-// if(m_pInfo && m_pInfo->m_pJsPlatform && m_pInfo->m_pJsPlatform->app_browseForDoc)
-// {
-// CFX_ByteString bsFilenameInit = CFX_WideString(cFilenameInit).UTF16LE_Encode();
-// FPDF_WIDESTRING pFileNameInit = (FPDF_WIDESTRING)bsFilenameInit.GetBuffer(bsFilenameInit.GetLength());
-//
-// m_pInfo->m_pJsPlatform->app_browseForDoc(m_pInfo->m_pJsPlatform, pFileNameInit);
-// bsFilenameInit.ReleaseBuffer();
-// }
- }
-
- void JS_docprint(FPDF_BOOL bUI , int nStart, int nEnd, FPDF_BOOL bSilent ,FPDF_BOOL bShrinkToFit,FPDF_BOOL bPrintAsImage ,FPDF_BOOL bReverse ,FPDF_BOOL bAnnotations)
- {
- if(m_pInfo && m_pInfo->m_pJsPlatform && m_pInfo->m_pJsPlatform->Doc_print)
- {
- m_pInfo->m_pJsPlatform->Doc_print(m_pInfo->m_pJsPlatform, bUI, nStart, nEnd, bSilent, bShrinkToFit, bPrintAsImage, bReverse, bAnnotations);
- }
- }
- void JS_docgotoPage(int nPageNum)
- {
- if(m_pInfo && m_pInfo->m_pJsPlatform && m_pInfo->m_pJsPlatform->Doc_gotoPage)
- {
- m_pInfo->m_pJsPlatform->Doc_gotoPage(m_pInfo->m_pJsPlatform, nPageNum);
- }
- }
-
- virtual FPDF_PAGE FFI_GetPage(FPDF_DOCUMENT document,int nPageIndex)
- {
- if(m_pInfo && m_pInfo->FFI_GetPage)
- {
- return m_pInfo->FFI_GetPage(m_pInfo, document, nPageIndex);
- }
- return NULL;
- }
-
- virtual FPDF_PAGE FFI_GetCurrentPage(FPDF_DOCUMENT document)
- {
- if(m_pInfo && m_pInfo->FFI_GetCurrentPage)
- {
- return m_pInfo->FFI_GetCurrentPage(m_pInfo, document);
- }
- return NULL;
- }
-
- int FFI_GetRotation(FPDF_PAGE page)
- {
- if(m_pInfo && m_pInfo->FFI_GetRotation)
- {
- return m_pInfo->FFI_GetRotation(m_pInfo, page);
- }
- return 0;
- }
- void FFI_ExecuteNamedAction(FX_LPCSTR namedAction)
- {
- if(m_pInfo && m_pInfo->FFI_ExecuteNamedAction)
- {
- m_pInfo->FFI_ExecuteNamedAction(m_pInfo, namedAction);
- }
- }
- void FFI_OnSetFieldInputFocus(void* field,FPDF_WIDESTRING focusText, FPDF_DWORD nTextLen, FX_BOOL bFocus)
- {
- if(m_pInfo && m_pInfo->FFI_SetTextFieldFocus)
- {
- m_pInfo->FFI_SetTextFieldFocus(m_pInfo, focusText, nTextLen, bFocus);
- }
- }
-
- void FFI_DoURIAction(FX_LPCSTR bsURI)
- {
- if(m_pInfo && m_pInfo->FFI_DoURIAction)
- {
- m_pInfo->FFI_DoURIAction(m_pInfo, bsURI);
- }
- }
-
- void FFI_DoGoToAction(int nPageIndex, int zoomMode, float* fPosArray, int sizeOfArray)
- {
- if(m_pInfo && m_pInfo->FFI_DoGoToAction)
- {
- m_pInfo->FFI_DoGoToAction(m_pInfo, nPageIndex, zoomMode, fPosArray, sizeOfArray);
- }
- }
-
-public:
- FX_BOOL IsJSInitiated();
-
-public:
- void SetCurrentDoc(CPDFSDK_Document* pFXDoc) {m_pSDKDoc = pFXDoc;}
- CPDFSDK_Document* GetCurrentDoc();
- CPDF_Document* GetPDFDocument() {return m_pPDFDoc;}
-// CPDFSDK_Document* GetDocument(int nIndex);
-// int CountDocuments() {return m_docMap.GetCount();}
-
- CPDFSDK_Document* OpenDocument(CFX_WideString &fileName);
- CPDFSDK_Document* OpenMemPDFDoc(CPDF_Document* pNewDoc, CFX_WideString &fileName);
- FX_BOOL OpenURL(CFX_WideString &filePath);
-
-
- CFX_ByteString GetAppName() {return "";}
-
- CFFL_IFormFiller* GetIFormFiller();
- IFX_SystemHandler* GetSysHandler() {return m_pSysHandler;}
-
-public:
- CPDFSDK_AnnotHandlerMgr* GetAnnotHandlerMgr();
- IFXJS_Runtime* GetJSRuntime();
- CPDFSDK_ActionHandler* GetActionHander();
-private:
- CPDFSDK_AnnotHandlerMgr* m_pAnnotHandlerMgr;
- CPDFSDK_ActionHandler* m_pActionHandler;
- IFXJS_Runtime* m_pJSRuntime;
-public:
- FPDF_FORMFILLINFO* GetFormFillInfo() {return m_pInfo;}
-private:
- FPDF_FORMFILLINFO* m_pInfo;
-// CFX_MapPtrTemplate<CPDF_Document*, CPDFSDK_Document*> m_docMap;
- CPDFSDK_Document* m_pSDKDoc;
- CPDF_Document* m_pPDFDoc;
-
- CFFL_IFormFiller* m_pIFormFiller;
- IFX_SystemHandler* m_pSysHandler;
-
-public:
- CJS_RuntimeFactory* m_pJSRuntimeFactory;
-};
-
-
-
-// class CFX_App
-// {
-// public:
-// CFX_App():m_pCurDoc(NULL) {}
-// void SetAt(CPDF_Document* pPDFDoc, CPDFSDK_Document* pFXDoc);
-// CPDFSDK_Document* GetAt(CPDF_Document* pPDFDoc);
-// public:
-// void SetCurrentDocument(CPDFSDK_Document* pFXDoc) {m_pCurDoc = pFXDoc;}
-// CPDFSDK_Document* GetCurrentDocument() {return m_pCurDoc;}
-// private:
-// CFX_MapPtrTemplate<CPDF_Document*, CPDFSDK_Document*> m_docArray;
-// CPDFSDK_Document* m_pCurDoc;
-// };
-class CPDFSDK_InterForm;
-class CPDFSDK_Document
-{
-public:
- CPDFSDK_Document(CPDF_Document* pDoc, CPDFDoc_Environment* pEnv);
- ~CPDFSDK_Document();
-public:
- CPDFSDK_InterForm* GetInterForm() ;
- CPDF_Document* GetDocument() {return m_pDoc;}
-
-public:
- void InitPageView();
- void AddPageView(CPDF_Page* pPDFPage, CPDFSDK_PageView* pPageView);
- CPDFSDK_PageView* GetPageView(CPDF_Page* pPDFPage, FX_BOOL ReNew = TRUE);
- CPDFSDK_PageView* GetPageView(int nIndex);
- CPDFSDK_PageView* GetCurrentView();
- void ReMovePageView(CPDF_Page* pPDFPage);
- void UpdateAllViews(CPDFSDK_PageView* pSender, CPDFSDK_Annot* pAnnot);
-
- CPDFSDK_Annot* GetFocusAnnot();//{return NULL;}
-
- IFXJS_Runtime * GetJsRuntime();
-
- FX_BOOL SetFocusAnnot(CPDFSDK_Annot* pAnnot, FX_UINT nFlag = 0);//{return FALSE;}
- FX_BOOL KillFocusAnnot(FX_UINT nFlag = 0);
-
- FX_BOOL ExtractPages(const CFX_WordArray &arrExtraPages, CPDF_Document* pDstDoc);
- FX_BOOL InsertPages(int nInsertAt, const CPDF_Document* pSrcDoc, const CFX_WordArray &arrSrcPages);
- FX_BOOL DeletePages(int nStart, int nCount);
- FX_BOOL ReplacePages(int nPage, const CPDF_Document* pSrcDoc, const CFX_WordArray &arrSrcPages);
-
- void OnCloseDocument();
-
- int GetPageCount() {return m_pDoc->GetPageCount();}
- FX_BOOL GetPermissions(int nFlag);
- FX_BOOL GetChangeMark() {return m_bChangeMask;}
- void SetChangeMark() {m_bChangeMask = TRUE;}
- void ClearChangeMark() {m_bChangeMask= FALSE;}
-// FX_BOOL GetChangeMark(){return FALSE;}//IsAnnotModified()||IsFormModified() || IsWidgetModified()|| m_nChangeMark>0 ;}
-// void ClearChangeMark(){}
- CFX_WideString GetPath() ;
- CPDF_Page* GetPage(int nIndex);
- CPDFDoc_Environment * GetEnv() {return m_pEnv; }
- void ProcJavascriptFun();
- FX_BOOL ProcOpenAction();
- CPDF_OCContext* GetOCContext();
-private:
- //CFX_ArrayTemplate<CPDFSDK_PageView*> m_pageArray;
- CFX_MapPtrTemplate<CPDF_Page*, CPDFSDK_PageView*> m_pageMap;
- CPDF_Document* m_pDoc;
-
- CPDFSDK_InterForm* m_pInterForm;
- CPDFSDK_Annot* m_pFocusAnnot;
- CPDFDoc_Environment * m_pEnv;
- CPDF_OCContext * m_pOccontent;
- FX_BOOL m_bChangeMask;
-};
-
-class CPDFSDK_PageView
-{
-public:
- CPDFSDK_PageView(CPDFSDK_Document* pSDKDoc,CPDF_Page* page);
- ~CPDFSDK_PageView();
-public:
- virtual void PageView_OnDraw(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,CPDF_RenderOptions* pOptions) ;
-public:
- CPDF_Annot* GetPDFAnnotAtPoint(FX_FLOAT pageX, FX_FLOAT pageY);
- CPDFSDK_Annot* GetFXAnnotAtPoint(FX_FLOAT pageX, FX_FLOAT pageY);
- CPDF_Annot* GetPDFWidgetAtPoint(FX_FLOAT pageX, FX_FLOAT pageY);
- CPDFSDK_Annot* GetFXWidgetAtPoint(FX_FLOAT pageX, FX_FLOAT pageY);
- CPDFSDK_Annot* GetFocusAnnot() ;
- void SetFocusAnnot(CPDFSDK_Annot* pSDKAnnot,FX_UINT nFlag = 0) {m_pSDKDoc->SetFocusAnnot(pSDKAnnot, nFlag);}
- FX_BOOL KillFocusAnnot(FX_UINT nFlag = 0) {return m_pSDKDoc->KillFocusAnnot(nFlag);}
- FX_BOOL Annot_HasAppearance(CPDF_Annot* pAnnot);
-
- CPDFSDK_Annot* AddAnnot(CPDF_Dictionary * pDict);
- CPDFSDK_Annot* AddAnnot(FX_LPCSTR lpSubType,CPDF_Dictionary * pDict);
- CPDFSDK_Annot* AddAnnot(CPDF_Annot * pPDFAnnot);
- FX_BOOL DeleteAnnot(CPDFSDK_Annot* pAnnot);
-
- int CountAnnots();
- CPDFSDK_Annot* GetAnnot(int nIndex);
- CPDFSDK_Annot* GetAnnotByDict(CPDF_Dictionary * pDict);
- CPDF_Page* GetPDFPage(){return m_page;}
- CPDF_Document* GetPDFDocument();
- CPDFSDK_Document* GetSDKDocument() {return m_pSDKDoc;}
-public:
- virtual FX_BOOL OnLButtonDown(const CPDF_Point & point, FX_UINT nFlag);
- virtual FX_BOOL OnLButtonUp(const CPDF_Point & point, FX_UINT nFlag);
- virtual FX_BOOL OnChar(int nChar, FX_UINT nFlag);
- virtual FX_BOOL OnKeyDown(int nKeyCode, int nFlag);
- virtual FX_BOOL OnKeyUp(int nKeyCode, int nFlag);
-
- virtual FX_BOOL OnMouseMove(const CPDF_Point & point, int nFlag);
- virtual FX_BOOL OnMouseWheel(double deltaX, double deltaY,const CPDF_Point& point, int nFlag);
- virtual FX_BOOL IsValidAnnot(FX_LPVOID p);
-public:
- virtual void GetCurrentMatrix(CPDF_Matrix& matrix) {matrix = m_curMatrix;}
- virtual void UpdateRects(CFX_RectArray& rects);
- void UpdateView(CPDFSDK_Annot* pAnnot);
- CFX_PtrArray* GetAnnotList(){ return &m_fxAnnotArray; }
-
-public:
- virtual int GetPageIndex();
- void LoadFXAnnots();
-private:
- CPDF_Matrix m_curMatrix;
-
-private:
- void PageView_OnHighlightFormFields(CFX_RenderDevice* pDevice, CPDFSDK_Widget* pWidget);
-
-private:
- CPDF_Page* m_page;
- CPDF_AnnotList* m_pAnnotList;
-
- //CPDFSDK_Annot* m_pFocusAnnot;
- CFX_PtrArray m_fxAnnotArray;
-
- CPDFSDK_Document* m_pSDKDoc;
-private:
- CPDFSDK_Widget* m_CaptureWidget;
- FX_BOOL m_bEnterWidget;
- FX_BOOL m_bExitWidget;
- FX_BOOL m_bOnWidget;
-public:
- void SetValid(FX_BOOL bValid) {m_bValid = bValid;}
- FX_BOOL IsValid() {return m_bValid;}
-private:
- FX_BOOL m_bValid;
-};
-
-
-template<class TYPE>
-class CGW_ArrayTemplate : public CFX_ArrayTemplate<TYPE>
-{
-public:
- CGW_ArrayTemplate(){}
- virtual ~CGW_ArrayTemplate(){}
-
- typedef int (*LP_COMPARE)(TYPE p1, TYPE p2);
-
- void Sort(LP_COMPARE pCompare, FX_BOOL bAscent = TRUE)
- {
- int nSize = this->GetSize();
- QuickSort(0, nSize -1, bAscent, pCompare);
- }
-
-private:
- void QuickSort(FX_UINT nStartPos, FX_UINT nStopPos, FX_BOOL bAscend, LP_COMPARE pCompare)
- {
- if (nStartPos >= nStopPos) return;
-
- if ((nStopPos - nStartPos) == 1)
- {
- TYPE Value1 = this->GetAt(nStartPos);
- TYPE Value2 = this->GetAt(nStopPos);
-
- int iGreate = (*pCompare)(Value1, Value2);
- if ((bAscend && iGreate > 0) || (!bAscend && iGreate < 0))
- {
- this->SetAt(nStartPos, Value2);
- this->SetAt(nStopPos, Value1);
- }
- return;
- }
-
- FX_UINT m = (nStartPos + nStopPos) / 2;
- FX_UINT i = nStartPos;
-
- TYPE Value = this->GetAt(m);
-
- while (i < m)
- {
- TYPE temp = this->GetAt(i);
-
- int iGreate = (*pCompare)(temp, Value);
- if ((bAscend && iGreate > 0) || (!bAscend && iGreate < 0))
- {
- this->InsertAt(m+1, temp);
- this->RemoveAt(i);
- m--;
- }
- else
- {
- i++;
- }
- }
-
- FX_UINT j = nStopPos;
-
- while (j > m)
- {
- TYPE temp = this->GetAt(j);
-
- int iGreate = (*pCompare)(temp, Value);
- if ((bAscend && iGreate < 0) || (!bAscend && iGreate > 0))
- {
- this->RemoveAt(j);
- this->InsertAt(m, temp);
- m++;
- }
- else
- {
- j--;
- }
- }
-
- if (nStartPos < m) QuickSort(nStartPos, m, bAscend, pCompare);
- if (nStopPos > m) QuickSort(m, nStopPos, bAscend, pCompare);
- }
-};
-
-
-#endif //_FPDFSDK_MGR_H
-
+// 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 _FPDFSDK_MGR_H
+#define _FPDFSDK_MGR_H
+
+#include "fsdk_common.h"
+#include "fsdk_define.h"
+#include "fx_systemhandler.h"
+#include "fsdk_baseannot.h"
+#include "fsdk_baseform.h"
+#include "fpdfformfill.h"
+#include "fsdk_annothandler.h"
+#include "fsdk_actionhandler.h"
+
+//cross platform keycode and events define.
+#include "fpdf_fwlevent.h"
+
+
+class CPDFSDK_Document;
+class CPDFSDK_PageView;
+class CPDFSDK_Annot;
+class CFFL_IFormFiller;
+class CPDFSDK_Widget;
+class IFX_SystemHandler;
+class CPDFSDK_ActionHandler;
+class CJS_RuntimeFactory;
+
+#include "javascript/IJavaScript.h"
+
+class CPDFDoc_Environment
+{
+public:
+ CPDFDoc_Environment(CPDF_Document * pDoc);
+ ~CPDFDoc_Environment();
+
+ int RegAppHandle(FPDF_FORMFILLINFO* pFFinfo);//{ m_pInfo = pFFinfo; return TRUE;}
+
+ virtual void Release()
+ {
+ if (m_pInfo && m_pInfo->Release)
+ m_pInfo->Release(m_pInfo);
+ delete this;
+ }
+
+ virtual void FFI_Invalidate(FPDF_PAGE page, double left, double top, double right, double bottom)
+ {
+ if (m_pInfo && m_pInfo->FFI_Invalidate)
+ {
+ m_pInfo->FFI_Invalidate(m_pInfo, page, left, top, right, bottom);
+ }
+ }
+ virtual void FFI_OutputSelectedRect(FPDF_PAGE page, double left, double top, double right, double bottom)
+ {
+ if (m_pInfo && m_pInfo->FFI_OutputSelectedRect)
+ {
+ m_pInfo->FFI_OutputSelectedRect(m_pInfo, page, left, top, right, bottom);
+ }
+ }
+
+ virtual void FFI_SetCursor(int nCursorType)
+ {
+ if (m_pInfo && m_pInfo->FFI_SetCursor)
+ {
+ m_pInfo->FFI_SetCursor(m_pInfo, nCursorType);
+ }
+ }
+
+ virtual int FFI_SetTimer(int uElapse, TimerCallback lpTimerFunc)
+ {
+ if (m_pInfo && m_pInfo->FFI_SetTimer)
+ {
+ return m_pInfo->FFI_SetTimer(m_pInfo, uElapse, lpTimerFunc);
+ }
+ return -1;
+ }
+
+ virtual void FFI_KillTimer(int nTimerID)
+ {
+ if (m_pInfo && m_pInfo->FFI_KillTimer)
+ {
+ m_pInfo->FFI_KillTimer(m_pInfo, nTimerID);
+ }
+ }
+ FX_SYSTEMTIME FFI_GetLocalTime()
+ {
+ FX_SYSTEMTIME fxtime;
+ if(m_pInfo && m_pInfo->FFI_GetLocalTime)
+ {
+ FPDF_SYSTEMTIME systime = m_pInfo->FFI_GetLocalTime(m_pInfo);
+ fxtime.wDay = systime.wDay;
+ fxtime.wDayOfWeek = systime.wDayOfWeek;
+ fxtime.wHour = systime.wHour;
+ fxtime.wMilliseconds = systime.wMilliseconds;
+ fxtime.wMinute = systime.wMinute;
+ fxtime.wMonth = systime.wMonth;
+ fxtime.wSecond = systime.wSecond;
+ fxtime.wYear = systime.wYear;
+ }
+ return fxtime;
+ }
+
+ virtual void FFI_OnChange()
+ {
+ if(m_pInfo && m_pInfo->FFI_OnChange)
+ {
+ m_pInfo->FFI_OnChange(m_pInfo);
+ }
+ }
+
+ virtual FX_BOOL FFI_IsSHIFTKeyDown(FX_DWORD nFlag)
+ {
+
+ return (nFlag & FWL_EVENTFLAG_ShiftKey) != 0;
+ }
+ virtual FX_BOOL FFI_IsCTRLKeyDown(FX_DWORD nFlag)
+ {
+
+ return (nFlag & FWL_EVENTFLAG_ControlKey) != 0;
+ }
+ virtual FX_BOOL FFI_IsALTKeyDown(FX_DWORD nFlag)
+ {
+
+ return (nFlag & FWL_EVENTFLAG_AltKey) != 0;
+ }
+ virtual FX_BOOL FFI_IsINSERTKeyDown(FX_DWORD nFlag)
+ {
+ return FALSE;
+ }
+
+ virtual int JS_appAlert(FX_LPCWSTR Msg, FX_LPCWSTR Title, FX_UINT Type, FX_UINT Icon)
+ {
+ if(m_pInfo && m_pInfo->m_pJsPlatform && m_pInfo->m_pJsPlatform->app_alert)
+ {
+ CFX_ByteString bsMsg = CFX_WideString(Msg).UTF16LE_Encode();
+ CFX_ByteString bsTitle = CFX_WideString(Title).UTF16LE_Encode();
+ FPDF_WIDESTRING pMsg = (FPDF_WIDESTRING)bsMsg.GetBuffer(bsMsg.GetLength());
+ FPDF_WIDESTRING pTitle = (FPDF_WIDESTRING)bsTitle.GetBuffer(bsTitle.GetLength());
+ int ret = m_pInfo->m_pJsPlatform->app_alert(m_pInfo->m_pJsPlatform, pMsg, pTitle, Type, Icon);
+ bsMsg.ReleaseBuffer();
+ bsTitle.ReleaseBuffer();
+ return ret;
+ }
+ return -1;
+ }
+
+ virtual int JS_appResponse(FX_LPCWSTR Question, FX_LPCWSTR Title, FX_LPCWSTR Default, FX_LPCWSTR cLabel, FPDF_BOOL bPassword, void* response, int length)
+ {
+ if (m_pInfo && m_pInfo->m_pJsPlatform && m_pInfo->m_pJsPlatform->app_response)
+ {
+ CFX_ByteString bsQuestion = CFX_WideString(Question).UTF16LE_Encode();
+ CFX_ByteString bsTitle = CFX_WideString(Title).UTF16LE_Encode();
+ CFX_ByteString bsDefault = CFX_WideString(Default).UTF16LE_Encode();
+ CFX_ByteString bsLabel = CFX_WideString(cLabel).UTF16LE_Encode();
+ FPDF_WIDESTRING pQuestion = (FPDF_WIDESTRING)bsQuestion.GetBuffer(bsQuestion.GetLength());
+ FPDF_WIDESTRING pTitle = (FPDF_WIDESTRING)bsTitle.GetBuffer(bsTitle.GetLength());
+ FPDF_WIDESTRING pDefault = (FPDF_WIDESTRING)bsDefault.GetBuffer(bsDefault.GetLength());
+ FPDF_WIDESTRING pLabel = (FPDF_WIDESTRING)bsLabel.GetBuffer(bsLabel.GetLength());
+ int ret = m_pInfo->m_pJsPlatform->app_response(m_pInfo->m_pJsPlatform, pQuestion, pTitle,
+ pDefault, pLabel, bPassword, response, length);
+ bsQuestion.ReleaseBuffer();
+ bsTitle.ReleaseBuffer();
+ bsDefault.ReleaseBuffer();
+ bsLabel.ReleaseBuffer();
+ return ret;
+ }
+ return -1;
+ }
+
+ virtual void JS_appBeep(int nType)
+ {
+ if(m_pInfo && m_pInfo->m_pJsPlatform && m_pInfo->m_pJsPlatform->app_beep)
+ {
+ m_pInfo->m_pJsPlatform->app_beep(m_pInfo->m_pJsPlatform, nType);
+ }
+ }
+
+ virtual CFX_WideString JS_fieldBrowse()
+ {
+ if(m_pInfo && m_pInfo->m_pJsPlatform && m_pInfo->m_pJsPlatform->Field_browse)
+ {
+ int nLen = m_pInfo->m_pJsPlatform->Field_browse(m_pInfo->m_pJsPlatform, NULL, 0);
+ if(nLen <= 0)
+ return L"";
+ char* pbuff = new char[nLen];
+ if(pbuff)
+ memset(pbuff, 0, nLen);
+ else
+ return L"";
+ nLen = m_pInfo->m_pJsPlatform->Field_browse(m_pInfo->m_pJsPlatform, pbuff, nLen);
+ CFX_ByteString bsRet = CFX_ByteString(pbuff, nLen);
+ CFX_WideString wsRet = CFX_WideString::FromLocal(bsRet);
+ delete[] pbuff;
+ return wsRet;
+ }
+ return L"";
+ }
+
+ CFX_WideString JS_docGetFilePath()
+ {
+ if(m_pInfo && m_pInfo->m_pJsPlatform && m_pInfo->m_pJsPlatform->Doc_getFilePath)
+ {
+ int nLen = m_pInfo->m_pJsPlatform->Doc_getFilePath(m_pInfo->m_pJsPlatform, NULL, 0);
+ if(nLen <= 0)
+ return L"";
+ char* pbuff = new char[nLen];
+ if(pbuff)
+ memset(pbuff, 0, nLen);
+ else
+ return L"";
+ nLen = m_pInfo->m_pJsPlatform->Doc_getFilePath(m_pInfo->m_pJsPlatform, pbuff, nLen);
+ CFX_ByteString bsRet = CFX_ByteString(pbuff, nLen);
+ CFX_WideString wsRet = CFX_WideString::FromLocal(bsRet);
+ delete[] pbuff;
+ return wsRet;
+ }
+ return L"";
+ }
+
+ void JS_docSubmitForm(void* formData, int length, FX_LPCWSTR URL)
+ {
+ if(m_pInfo && m_pInfo->m_pJsPlatform && m_pInfo->m_pJsPlatform->Doc_submitForm)
+ {
+ CFX_ByteString bsDestination = CFX_WideString(URL).UTF16LE_Encode();
+ FPDF_WIDESTRING pDestination = (FPDF_WIDESTRING)bsDestination.GetBuffer(bsDestination.GetLength());
+ m_pInfo->m_pJsPlatform->Doc_submitForm(m_pInfo->m_pJsPlatform, formData, length, pDestination);
+ bsDestination.ReleaseBuffer();
+ }
+ }
+
+ void JS_docmailForm(void* mailData, int length, FPDF_BOOL bUI,FX_LPCWSTR To, FX_LPCWSTR Subject, FX_LPCWSTR CC, FX_LPCWSTR BCC, FX_LPCWSTR Msg)
+ {
+ if(m_pInfo && m_pInfo->m_pJsPlatform && m_pInfo->m_pJsPlatform->Doc_mail)
+ {
+ CFX_ByteString bsTo = CFX_WideString(To).UTF16LE_Encode();
+ CFX_ByteString bsCC = CFX_WideString(Subject).UTF16LE_Encode();
+ CFX_ByteString bsBcc = CFX_WideString(BCC).UTF16LE_Encode();
+ CFX_ByteString bsSubject = CFX_WideString(Subject).UTF16LE_Encode();
+ CFX_ByteString bsMsg = CFX_WideString(Msg).UTF16LE_Encode();
+ FPDF_WIDESTRING pTo = (FPDF_WIDESTRING)bsTo.GetBuffer(bsTo.GetLength());
+ FPDF_WIDESTRING pCC = (FPDF_WIDESTRING)bsCC.GetBuffer(bsCC.GetLength());
+ FPDF_WIDESTRING pBcc = (FPDF_WIDESTRING)bsBcc.GetBuffer(bsBcc.GetLength());
+ FPDF_WIDESTRING pSubject = (FPDF_WIDESTRING)bsSubject.GetBuffer(bsSubject.GetLength());
+ FPDF_WIDESTRING pMsg = (FPDF_WIDESTRING)bsMsg.GetBuffer(bsMsg.GetLength());
+ m_pInfo->m_pJsPlatform->Doc_mail(m_pInfo->m_pJsPlatform, mailData, length, bUI, pTo, pSubject,
+ pCC, pBcc, pMsg);
+ bsTo.ReleaseBuffer();
+ bsCC.ReleaseBuffer();
+ bsBcc.ReleaseBuffer();
+ bsSubject.ReleaseBuffer();
+ bsMsg.ReleaseBuffer();
+ }
+ }
+ CFX_WideString JS_appbrowseForDoc(FPDF_BOOL bSave, FX_LPCWSTR cFilenameInit)
+ {
+ //to do....
+ return L"";
+// if(m_pInfo && m_pInfo->m_pJsPlatform && m_pInfo->m_pJsPlatform->app_browseForDoc)
+// {
+// CFX_ByteString bsFilenameInit = CFX_WideString(cFilenameInit).UTF16LE_Encode();
+// FPDF_WIDESTRING pFileNameInit = (FPDF_WIDESTRING)bsFilenameInit.GetBuffer(bsFilenameInit.GetLength());
+//
+// m_pInfo->m_pJsPlatform->app_browseForDoc(m_pInfo->m_pJsPlatform, pFileNameInit);
+// bsFilenameInit.ReleaseBuffer();
+// }
+ }
+
+ void JS_docprint(FPDF_BOOL bUI , int nStart, int nEnd, FPDF_BOOL bSilent ,FPDF_BOOL bShrinkToFit,FPDF_BOOL bPrintAsImage ,FPDF_BOOL bReverse ,FPDF_BOOL bAnnotations)
+ {
+ if(m_pInfo && m_pInfo->m_pJsPlatform && m_pInfo->m_pJsPlatform->Doc_print)
+ {
+ m_pInfo->m_pJsPlatform->Doc_print(m_pInfo->m_pJsPlatform, bUI, nStart, nEnd, bSilent, bShrinkToFit, bPrintAsImage, bReverse, bAnnotations);
+ }
+ }
+ void JS_docgotoPage(int nPageNum)
+ {
+ if(m_pInfo && m_pInfo->m_pJsPlatform && m_pInfo->m_pJsPlatform->Doc_gotoPage)
+ {
+ m_pInfo->m_pJsPlatform->Doc_gotoPage(m_pInfo->m_pJsPlatform, nPageNum);
+ }
+ }
+
+ virtual FPDF_PAGE FFI_GetPage(FPDF_DOCUMENT document,int nPageIndex)
+ {
+ if(m_pInfo && m_pInfo->FFI_GetPage)
+ {
+ return m_pInfo->FFI_GetPage(m_pInfo, document, nPageIndex);
+ }
+ return NULL;
+ }
+
+ virtual FPDF_PAGE FFI_GetCurrentPage(FPDF_DOCUMENT document)
+ {
+ if(m_pInfo && m_pInfo->FFI_GetCurrentPage)
+ {
+ return m_pInfo->FFI_GetCurrentPage(m_pInfo, document);
+ }
+ return NULL;
+ }
+
+ int FFI_GetRotation(FPDF_PAGE page)
+ {
+ if(m_pInfo && m_pInfo->FFI_GetRotation)
+ {
+ return m_pInfo->FFI_GetRotation(m_pInfo, page);
+ }
+ return 0;
+ }
+ void FFI_ExecuteNamedAction(FX_LPCSTR namedAction)
+ {
+ if(m_pInfo && m_pInfo->FFI_ExecuteNamedAction)
+ {
+ m_pInfo->FFI_ExecuteNamedAction(m_pInfo, namedAction);
+ }
+ }
+ void FFI_OnSetFieldInputFocus(void* field,FPDF_WIDESTRING focusText, FPDF_DWORD nTextLen, FX_BOOL bFocus)
+ {
+ if(m_pInfo && m_pInfo->FFI_SetTextFieldFocus)
+ {
+ m_pInfo->FFI_SetTextFieldFocus(m_pInfo, focusText, nTextLen, bFocus);
+ }
+ }
+
+ void FFI_DoURIAction(FX_LPCSTR bsURI)
+ {
+ if(m_pInfo && m_pInfo->FFI_DoURIAction)
+ {
+ m_pInfo->FFI_DoURIAction(m_pInfo, bsURI);
+ }
+ }
+
+ void FFI_DoGoToAction(int nPageIndex, int zoomMode, float* fPosArray, int sizeOfArray)
+ {
+ if(m_pInfo && m_pInfo->FFI_DoGoToAction)
+ {
+ m_pInfo->FFI_DoGoToAction(m_pInfo, nPageIndex, zoomMode, fPosArray, sizeOfArray);
+ }
+ }
+
+public:
+ FX_BOOL IsJSInitiated();
+
+public:
+ void SetCurrentDoc(CPDFSDK_Document* pFXDoc) {m_pSDKDoc = pFXDoc;}
+ CPDFSDK_Document* GetCurrentDoc();
+ CPDF_Document* GetPDFDocument() {return m_pPDFDoc;}
+// CPDFSDK_Document* GetDocument(int nIndex);
+// int CountDocuments() {return m_docMap.GetCount();}
+
+ CPDFSDK_Document* OpenDocument(CFX_WideString &fileName);
+ CPDFSDK_Document* OpenMemPDFDoc(CPDF_Document* pNewDoc, CFX_WideString &fileName);
+ FX_BOOL OpenURL(CFX_WideString &filePath);
+
+
+ CFX_ByteString GetAppName() {return "";}
+
+ CFFL_IFormFiller* GetIFormFiller();
+ IFX_SystemHandler* GetSysHandler() {return m_pSysHandler;}
+
+public:
+ CPDFSDK_AnnotHandlerMgr* GetAnnotHandlerMgr();
+ IFXJS_Runtime* GetJSRuntime();
+ CPDFSDK_ActionHandler* GetActionHander();
+private:
+ CPDFSDK_AnnotHandlerMgr* m_pAnnotHandlerMgr;
+ CPDFSDK_ActionHandler* m_pActionHandler;
+ IFXJS_Runtime* m_pJSRuntime;
+public:
+ FPDF_FORMFILLINFO* GetFormFillInfo() {return m_pInfo;}
+private:
+ FPDF_FORMFILLINFO* m_pInfo;
+// CFX_MapPtrTemplate<CPDF_Document*, CPDFSDK_Document*> m_docMap;
+ CPDFSDK_Document* m_pSDKDoc;
+ CPDF_Document* m_pPDFDoc;
+
+ CFFL_IFormFiller* m_pIFormFiller;
+ IFX_SystemHandler* m_pSysHandler;
+
+public:
+ CJS_RuntimeFactory* m_pJSRuntimeFactory;
+};
+
+
+
+// class CFX_App
+// {
+// public:
+// CFX_App():m_pCurDoc(NULL) {}
+// void SetAt(CPDF_Document* pPDFDoc, CPDFSDK_Document* pFXDoc);
+// CPDFSDK_Document* GetAt(CPDF_Document* pPDFDoc);
+// public:
+// void SetCurrentDocument(CPDFSDK_Document* pFXDoc) {m_pCurDoc = pFXDoc;}
+// CPDFSDK_Document* GetCurrentDocument() {return m_pCurDoc;}
+// private:
+// CFX_MapPtrTemplate<CPDF_Document*, CPDFSDK_Document*> m_docArray;
+// CPDFSDK_Document* m_pCurDoc;
+// };
+class CPDFSDK_InterForm;
+class CPDFSDK_Document
+{
+public:
+ CPDFSDK_Document(CPDF_Document* pDoc, CPDFDoc_Environment* pEnv);
+ ~CPDFSDK_Document();
+public:
+ CPDFSDK_InterForm* GetInterForm() ;
+ CPDF_Document* GetDocument() {return m_pDoc;}
+
+public:
+ void InitPageView();
+ void AddPageView(CPDF_Page* pPDFPage, CPDFSDK_PageView* pPageView);
+ CPDFSDK_PageView* GetPageView(CPDF_Page* pPDFPage, FX_BOOL ReNew = TRUE);
+ CPDFSDK_PageView* GetPageView(int nIndex);
+ CPDFSDK_PageView* GetCurrentView();
+ void ReMovePageView(CPDF_Page* pPDFPage);
+ void UpdateAllViews(CPDFSDK_PageView* pSender, CPDFSDK_Annot* pAnnot);
+
+ CPDFSDK_Annot* GetFocusAnnot();//{return NULL;}
+
+ IFXJS_Runtime * GetJsRuntime();
+
+ FX_BOOL SetFocusAnnot(CPDFSDK_Annot* pAnnot, FX_UINT nFlag = 0);//{return FALSE;}
+ FX_BOOL KillFocusAnnot(FX_UINT nFlag = 0);
+
+ FX_BOOL ExtractPages(const CFX_WordArray &arrExtraPages, CPDF_Document* pDstDoc);
+ FX_BOOL InsertPages(int nInsertAt, const CPDF_Document* pSrcDoc, const CFX_WordArray &arrSrcPages);
+ FX_BOOL DeletePages(int nStart, int nCount);
+ FX_BOOL ReplacePages(int nPage, const CPDF_Document* pSrcDoc, const CFX_WordArray &arrSrcPages);
+
+ void OnCloseDocument();
+
+ int GetPageCount() {return m_pDoc->GetPageCount();}
+ FX_BOOL GetPermissions(int nFlag);
+ FX_BOOL GetChangeMark() {return m_bChangeMask;}
+ void SetChangeMark() {m_bChangeMask = TRUE;}
+ void ClearChangeMark() {m_bChangeMask= FALSE;}
+// FX_BOOL GetChangeMark(){return FALSE;}//IsAnnotModified()||IsFormModified() || IsWidgetModified()|| m_nChangeMark>0 ;}
+// void ClearChangeMark(){}
+ CFX_WideString GetPath() ;
+ CPDF_Page* GetPage(int nIndex);
+ CPDFDoc_Environment * GetEnv() {return m_pEnv; }
+ void ProcJavascriptFun();
+ FX_BOOL ProcOpenAction();
+ CPDF_OCContext* GetOCContext();
+private:
+ //CFX_ArrayTemplate<CPDFSDK_PageView*> m_pageArray;
+ CFX_MapPtrTemplate<CPDF_Page*, CPDFSDK_PageView*> m_pageMap;
+ CPDF_Document* m_pDoc;
+
+ CPDFSDK_InterForm* m_pInterForm;
+ CPDFSDK_Annot* m_pFocusAnnot;
+ CPDFDoc_Environment * m_pEnv;
+ CPDF_OCContext * m_pOccontent;
+ FX_BOOL m_bChangeMask;
+};
+
+class CPDFSDK_PageView
+{
+public:
+ CPDFSDK_PageView(CPDFSDK_Document* pSDKDoc,CPDF_Page* page);
+ ~CPDFSDK_PageView();
+public:
+ virtual void PageView_OnDraw(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,CPDF_RenderOptions* pOptions) ;
+public:
+ CPDF_Annot* GetPDFAnnotAtPoint(FX_FLOAT pageX, FX_FLOAT pageY);
+ CPDFSDK_Annot* GetFXAnnotAtPoint(FX_FLOAT pageX, FX_FLOAT pageY);
+ CPDF_Annot* GetPDFWidgetAtPoint(FX_FLOAT pageX, FX_FLOAT pageY);
+ CPDFSDK_Annot* GetFXWidgetAtPoint(FX_FLOAT pageX, FX_FLOAT pageY);
+ CPDFSDK_Annot* GetFocusAnnot() ;
+ void SetFocusAnnot(CPDFSDK_Annot* pSDKAnnot,FX_UINT nFlag = 0) {m_pSDKDoc->SetFocusAnnot(pSDKAnnot, nFlag);}
+ FX_BOOL KillFocusAnnot(FX_UINT nFlag = 0) {return m_pSDKDoc->KillFocusAnnot(nFlag);}
+ FX_BOOL Annot_HasAppearance(CPDF_Annot* pAnnot);
+
+ CPDFSDK_Annot* AddAnnot(CPDF_Dictionary * pDict);
+ CPDFSDK_Annot* AddAnnot(FX_LPCSTR lpSubType,CPDF_Dictionary * pDict);
+ CPDFSDK_Annot* AddAnnot(CPDF_Annot * pPDFAnnot);
+ FX_BOOL DeleteAnnot(CPDFSDK_Annot* pAnnot);
+
+ int CountAnnots();
+ CPDFSDK_Annot* GetAnnot(int nIndex);
+ CPDFSDK_Annot* GetAnnotByDict(CPDF_Dictionary * pDict);
+ CPDF_Page* GetPDFPage(){return m_page;}
+ CPDF_Document* GetPDFDocument();
+ CPDFSDK_Document* GetSDKDocument() {return m_pSDKDoc;}
+public:
+ virtual FX_BOOL OnLButtonDown(const CPDF_Point & point, FX_UINT nFlag);
+ virtual FX_BOOL OnLButtonUp(const CPDF_Point & point, FX_UINT nFlag);
+ virtual FX_BOOL OnChar(int nChar, FX_UINT nFlag);
+ virtual FX_BOOL OnKeyDown(int nKeyCode, int nFlag);
+ virtual FX_BOOL OnKeyUp(int nKeyCode, int nFlag);
+
+ virtual FX_BOOL OnMouseMove(const CPDF_Point & point, int nFlag);
+ virtual FX_BOOL OnMouseWheel(double deltaX, double deltaY,const CPDF_Point& point, int nFlag);
+ virtual FX_BOOL IsValidAnnot(FX_LPVOID p);
+public:
+ virtual void GetCurrentMatrix(CPDF_Matrix& matrix) {matrix = m_curMatrix;}
+ virtual void UpdateRects(CFX_RectArray& rects);
+ void UpdateView(CPDFSDK_Annot* pAnnot);
+ CFX_PtrArray* GetAnnotList(){ return &m_fxAnnotArray; }
+
+public:
+ virtual int GetPageIndex();
+ void LoadFXAnnots();
+private:
+ CPDF_Matrix m_curMatrix;
+
+private:
+ void PageView_OnHighlightFormFields(CFX_RenderDevice* pDevice, CPDFSDK_Widget* pWidget);
+
+private:
+ CPDF_Page* m_page;
+ CPDF_AnnotList* m_pAnnotList;
+
+ //CPDFSDK_Annot* m_pFocusAnnot;
+ CFX_PtrArray m_fxAnnotArray;
+
+ CPDFSDK_Document* m_pSDKDoc;
+private:
+ CPDFSDK_Widget* m_CaptureWidget;
+ FX_BOOL m_bEnterWidget;
+ FX_BOOL m_bExitWidget;
+ FX_BOOL m_bOnWidget;
+public:
+ void SetValid(FX_BOOL bValid) {m_bValid = bValid;}
+ FX_BOOL IsValid() {return m_bValid;}
+private:
+ FX_BOOL m_bValid;
+};
+
+
+template<class TYPE>
+class CGW_ArrayTemplate : public CFX_ArrayTemplate<TYPE>
+{
+public:
+ CGW_ArrayTemplate(){}
+ virtual ~CGW_ArrayTemplate(){}
+
+ typedef int (*LP_COMPARE)(TYPE p1, TYPE p2);
+
+ void Sort(LP_COMPARE pCompare, FX_BOOL bAscent = TRUE)
+ {
+ int nSize = this->GetSize();
+ QuickSort(0, nSize -1, bAscent, pCompare);
+ }
+
+private:
+ void QuickSort(FX_UINT nStartPos, FX_UINT nStopPos, FX_BOOL bAscend, LP_COMPARE pCompare)
+ {
+ if (nStartPos >= nStopPos) return;
+
+ if ((nStopPos - nStartPos) == 1)
+ {
+ TYPE Value1 = this->GetAt(nStartPos);
+ TYPE Value2 = this->GetAt(nStopPos);
+
+ int iGreate = (*pCompare)(Value1, Value2);
+ if ((bAscend && iGreate > 0) || (!bAscend && iGreate < 0))
+ {
+ this->SetAt(nStartPos, Value2);
+ this->SetAt(nStopPos, Value1);
+ }
+ return;
+ }
+
+ FX_UINT m = (nStartPos + nStopPos) / 2;
+ FX_UINT i = nStartPos;
+
+ TYPE Value = this->GetAt(m);
+
+ while (i < m)
+ {
+ TYPE temp = this->GetAt(i);
+
+ int iGreate = (*pCompare)(temp, Value);
+ if ((bAscend && iGreate > 0) || (!bAscend && iGreate < 0))
+ {
+ this->InsertAt(m+1, temp);
+ this->RemoveAt(i);
+ m--;
+ }
+ else
+ {
+ i++;
+ }
+ }
+
+ FX_UINT j = nStopPos;
+
+ while (j > m)
+ {
+ TYPE temp = this->GetAt(j);
+
+ int iGreate = (*pCompare)(temp, Value);
+ if ((bAscend && iGreate < 0) || (!bAscend && iGreate > 0))
+ {
+ this->RemoveAt(j);
+ this->InsertAt(m, temp);
+ m++;
+ }
+ else
+ {
+ j--;
+ }
+ }
+
+ if (nStartPos < m) QuickSort(nStartPos, m, bAscend, pCompare);
+ if (nStopPos > m) QuickSort(m, nStopPos, bAscend, pCompare);
+ }
+};
+
+
+#endif //_FPDFSDK_MGR_H
+
diff --git a/fpdfsdk/include/fsdk_rendercontext.h b/fpdfsdk/include/fsdk_rendercontext.h
index c33dfddfa5..51c37b3624 100644
--- a/fpdfsdk/include/fsdk_rendercontext.h
+++ b/fpdfsdk/include/fsdk_rendercontext.h
@@ -1,41 +1,41 @@
-// 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 _RENDERCONTENT_H_
-#define _RENDERCONTENT_H_
-#include "../include/fsdk_define.h"
-#include "../include/fpdf_progressive.h"
-
-// Everything about rendering is put here: for OOM recovery
-class CRenderContext : public CFX_Object
-{
-public:
- CRenderContext() { Clear(); }
- ~CRenderContext();
-
- void Clear();
-
- CFX_RenderDevice* m_pDevice;
- CPDF_RenderContext* m_pContext;
- CPDF_ProgressiveRenderer* m_pRenderer;
- CPDF_AnnotList* m_pAnnots;
- CPDF_RenderOptions* m_pOptions;
-#ifdef _WIN32_WCE
- CFX_DIBitmap* m_pBitmap;
- HBITMAP m_hBitmap;
-#endif
-};
-
-class IFSDK_PAUSE_Adapter : public IFX_Pause
-{
-public:
- IFSDK_PAUSE_Adapter(IFSDK_PAUSE* IPause );
- FX_BOOL NeedToPauseNow();
-
-private:
- IFSDK_PAUSE* m_IPause;
-};
-#endif
+// 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 _RENDERCONTENT_H_
+#define _RENDERCONTENT_H_
+#include "../include/fsdk_define.h"
+#include "../include/fpdf_progressive.h"
+
+// Everything about rendering is put here: for OOM recovery
+class CRenderContext : public CFX_Object
+{
+public:
+ CRenderContext() { Clear(); }
+ ~CRenderContext();
+
+ void Clear();
+
+ CFX_RenderDevice* m_pDevice;
+ CPDF_RenderContext* m_pContext;
+ CPDF_ProgressiveRenderer* m_pRenderer;
+ CPDF_AnnotList* m_pAnnots;
+ CPDF_RenderOptions* m_pOptions;
+#ifdef _WIN32_WCE
+ CFX_DIBitmap* m_pBitmap;
+ HBITMAP m_hBitmap;
+#endif
+};
+
+class IFSDK_PAUSE_Adapter : public IFX_Pause
+{
+public:
+ IFSDK_PAUSE_Adapter(IFSDK_PAUSE* IPause );
+ FX_BOOL NeedToPauseNow();
+
+private:
+ IFSDK_PAUSE* m_IPause;
+};
+#endif
diff --git a/fpdfsdk/include/fx_systemhandler.h b/fpdfsdk/include/fx_systemhandler.h
index c760377194..b9ac413696 100644
--- a/fpdfsdk/include/fx_systemhandler.h
+++ b/fpdfsdk/include/fx_systemhandler.h
@@ -1,85 +1,85 @@
-// 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 _FX_SYSTEMHANDLER_H_
-#define _FX_SYSTEMHANDLER_H_
-
-typedef FX_LPVOID FX_HWND;
-typedef FX_LPVOID FX_HMENU;
-typedef void (*TimerCallback)(FX_INT32 idEvent);
-
-typedef struct _FX_SYSTEMTIME
-{
- FX_WORD wYear;
- FX_WORD wMonth;
- FX_WORD wDayOfWeek;
- FX_WORD wDay;
- FX_WORD wHour;
- FX_WORD wMinute;
- FX_WORD wSecond;
- FX_WORD wMilliseconds;
-}FX_SYSTEMTIME;
-
-//cursor style
-#define FXCT_ARROW 0
-#define FXCT_NESW 1
-#define FXCT_NWSE 2
-#define FXCT_VBEAM 3
-#define FXCT_HBEAM 4
-#define FXCT_HAND 5
-
-class IFX_SystemHandler
-{
-public:
- virtual ~IFX_SystemHandler() {}
- virtual void InvalidateRect(FX_HWND hWnd, FX_RECT rect) = 0;
- virtual void OutputSelectedRect(void* pFormFiller, CPDF_Rect&rect) = 0;
-
- virtual FX_BOOL IsSelectionImplemented() = 0;
-
- virtual CFX_WideString GetClipboardText(FX_HWND hWnd) = 0;
- virtual FX_BOOL SetClipboardText(FX_HWND hWnd, CFX_WideString string) = 0;
-
- virtual void ClientToScreen(FX_HWND hWnd, FX_INT32& x, FX_INT32& y) = 0;
- virtual void ScreenToClient(FX_HWND hWnd, FX_INT32& x, FX_INT32& y) = 0;
-
- /*cursor style
- FXCT_ARROW
- FXCT_NESW
- FXCT_NWSE
- FXCT_VBEAM
- FXCT_HBEAM
- FXCT_HAND
- */
- virtual void SetCursor(FX_INT32 nCursorType) = 0;
-
- virtual FX_HMENU CreatePopupMenu() = 0;
- virtual FX_BOOL AppendMenuItem(FX_HMENU hMenu, FX_INT32 nIDNewItem, CFX_WideString string) = 0;
- virtual FX_BOOL EnableMenuItem(FX_HMENU hMenu, FX_INT32 nIDItem, FX_BOOL bEnabled) = 0;
- virtual FX_INT32 TrackPopupMenu(FX_HMENU hMenu, FX_INT32 x, FX_INT32 y, FX_HWND hParent) = 0;
- virtual void DestroyMenu(FX_HMENU hMenu) = 0;
-
- virtual CFX_ByteString GetNativeTrueTypeFont(FX_INT32 nCharset) = 0;
- virtual FX_BOOL FindNativeTrueTypeFont(FX_INT32 nCharset, CFX_ByteString sFontFaceName) = 0;
- virtual CPDF_Font* AddNativeTrueTypeFontToPDF(CPDF_Document* pDoc, CFX_ByteString sFontFaceName, FX_BYTE nCharset) = 0;
-
- virtual FX_INT32 SetTimer(FX_INT32 uElapse, TimerCallback lpTimerFunc) = 0;
- virtual void KillTimer(FX_INT32 nID) = 0;
-
-
- virtual FX_BOOL IsSHIFTKeyDown(FX_DWORD nFlag) = 0;
- virtual FX_BOOL IsCTRLKeyDown(FX_DWORD nFlag) = 0;
- virtual FX_BOOL IsALTKeyDown(FX_DWORD nFlag) = 0;
- virtual FX_BOOL IsINSERTKeyDown(FX_DWORD nFlag) = 0;
-
- virtual FX_SYSTEMTIME GetLocalTime() = 0;
-
- virtual FX_INT32 GetCharSet() = 0;
- virtual void SetCharSet(FX_INT32 nCharSet) = 0;
-};
-
-#endif //_FX_SYSTEMHANDLER_H_
-
+// 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 _FX_SYSTEMHANDLER_H_
+#define _FX_SYSTEMHANDLER_H_
+
+typedef FX_LPVOID FX_HWND;
+typedef FX_LPVOID FX_HMENU;
+typedef void (*TimerCallback)(FX_INT32 idEvent);
+
+typedef struct _FX_SYSTEMTIME
+{
+ FX_WORD wYear;
+ FX_WORD wMonth;
+ FX_WORD wDayOfWeek;
+ FX_WORD wDay;
+ FX_WORD wHour;
+ FX_WORD wMinute;
+ FX_WORD wSecond;
+ FX_WORD wMilliseconds;
+}FX_SYSTEMTIME;
+
+//cursor style
+#define FXCT_ARROW 0
+#define FXCT_NESW 1
+#define FXCT_NWSE 2
+#define FXCT_VBEAM 3
+#define FXCT_HBEAM 4
+#define FXCT_HAND 5
+
+class IFX_SystemHandler
+{
+public:
+ virtual ~IFX_SystemHandler() {}
+ virtual void InvalidateRect(FX_HWND hWnd, FX_RECT rect) = 0;
+ virtual void OutputSelectedRect(void* pFormFiller, CPDF_Rect&rect) = 0;
+
+ virtual FX_BOOL IsSelectionImplemented() = 0;
+
+ virtual CFX_WideString GetClipboardText(FX_HWND hWnd) = 0;
+ virtual FX_BOOL SetClipboardText(FX_HWND hWnd, CFX_WideString string) = 0;
+
+ virtual void ClientToScreen(FX_HWND hWnd, FX_INT32& x, FX_INT32& y) = 0;
+ virtual void ScreenToClient(FX_HWND hWnd, FX_INT32& x, FX_INT32& y) = 0;
+
+ /*cursor style
+ FXCT_ARROW
+ FXCT_NESW
+ FXCT_NWSE
+ FXCT_VBEAM
+ FXCT_HBEAM
+ FXCT_HAND
+ */
+ virtual void SetCursor(FX_INT32 nCursorType) = 0;
+
+ virtual FX_HMENU CreatePopupMenu() = 0;
+ virtual FX_BOOL AppendMenuItem(FX_HMENU hMenu, FX_INT32 nIDNewItem, CFX_WideString string) = 0;
+ virtual FX_BOOL EnableMenuItem(FX_HMENU hMenu, FX_INT32 nIDItem, FX_BOOL bEnabled) = 0;
+ virtual FX_INT32 TrackPopupMenu(FX_HMENU hMenu, FX_INT32 x, FX_INT32 y, FX_HWND hParent) = 0;
+ virtual void DestroyMenu(FX_HMENU hMenu) = 0;
+
+ virtual CFX_ByteString GetNativeTrueTypeFont(FX_INT32 nCharset) = 0;
+ virtual FX_BOOL FindNativeTrueTypeFont(FX_INT32 nCharset, CFX_ByteString sFontFaceName) = 0;
+ virtual CPDF_Font* AddNativeTrueTypeFontToPDF(CPDF_Document* pDoc, CFX_ByteString sFontFaceName, FX_BYTE nCharset) = 0;
+
+ virtual FX_INT32 SetTimer(FX_INT32 uElapse, TimerCallback lpTimerFunc) = 0;
+ virtual void KillTimer(FX_INT32 nID) = 0;
+
+
+ virtual FX_BOOL IsSHIFTKeyDown(FX_DWORD nFlag) = 0;
+ virtual FX_BOOL IsCTRLKeyDown(FX_DWORD nFlag) = 0;
+ virtual FX_BOOL IsALTKeyDown(FX_DWORD nFlag) = 0;
+ virtual FX_BOOL IsINSERTKeyDown(FX_DWORD nFlag) = 0;
+
+ virtual FX_SYSTEMTIME GetLocalTime() = 0;
+
+ virtual FX_INT32 GetCharSet() = 0;
+ virtual void SetCharSet(FX_INT32 nCharSet) = 0;
+};
+
+#endif //_FX_SYSTEMHANDLER_H_
+
diff --git a/fpdfsdk/include/fxedit/fx_edit.h b/fpdfsdk/include/fxedit/fx_edit.h
index 2b73e61bc4..95b9096159 100644
--- a/fpdfsdk/include/fxedit/fx_edit.h
+++ b/fpdfsdk/include/fxedit/fx_edit.h
@@ -1,471 +1,471 @@
-// 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 _FX_EDIT_H_
-#define _FX_EDIT_H_
-
-#define PVTWORD_STYLE_NORMAL 0x0000L
-#define PVTWORD_STYLE_HIGHLIGHT 0x0001L
-#define PVTWORD_STYLE_UNDERLINE 0x0002L
-#define PVTWORD_STYLE_CROSSOUT 0x0004L
-#define PVTWORD_STYLE_SQUIGGLY 0x0008L
-#define PVTWORD_STYLE_DUALCROSSOUT 0x0010L
-#define PVTWORD_STYLE_BOLD 0x0020L
-#define PVTWORD_STYLE_ITALIC 0x0040L
-
-#define FX_EDIT_ISLATINWORD(u) (u == 0x2D || (u <= 0x005A && u >= 0x0041) || (u <= 0x007A && u >= 0x0061) || (u <= 0x02AF && u >= 0x00C0))
-
-#ifdef FX_READER_DLL
- #ifdef FXET_EXPORT
- #define FXET_CLASS __declspec(dllexport)
- #else
- #define FXET_CLASS
- #endif
-#else
- #define FXET_CLASS
-#endif
-
-#ifndef DEFAULT_CHARSET
-#define DEFAULT_CHARSET 1
-#endif
-
-class IFX_Edit_FontMap;
-class IFX_Edit_Notify;
-class IFX_Edit_Iterator;
-class IFX_Edit_UndoItem;
-class IFX_Edit;
-class IFX_List_Notify;
-class IFX_List;
-class IFX_SystemHandler;
-
-class IFX_Edit_FontMap
-{
-public:
- //map a fontindex to pdf font.
- virtual CPDF_Font * GetPDFFont(FX_INT32 nFontIndex) = 0;
- //get the alias of a pdf font.
- virtual CFX_ByteString GetPDFFontAlias(FX_INT32 nFontIndex) = 0;
- //get the index of a font that can show a word.
- virtual FX_INT32 GetWordFontIndex(FX_WORD word, FX_INT32 charset, FX_INT32 nFontIndex) = 0;
- //get the charcode of word from unicode
- virtual FX_INT32 CharCodeFromUnicode(FX_INT32 nFontIndex, FX_WORD word) = 0;
- //get the charset of unicode
- virtual FX_INT32 CharSetFromUnicode(FX_WORD word, FX_INT32 nOldCharset) = 0;
-};
-
-class IFX_Edit_Notify
-{
- //this class is implemented by user
-public:
- //set the horizontal scrollbar information.
- virtual void IOnSetScrollInfoX(FX_FLOAT fPlateMin, FX_FLOAT fPlateMax,
- FX_FLOAT fContentMin, FX_FLOAT fContentMax,
- FX_FLOAT fSmallStep, FX_FLOAT fBigStep) = 0;
- //set the vertical scrollbar information.
- virtual void IOnSetScrollInfoY(FX_FLOAT fPlateMin, FX_FLOAT fPlateMax,
- FX_FLOAT fContentMin, FX_FLOAT fContentMax,
- FX_FLOAT fSmallStep, FX_FLOAT fBigStep) = 0;
- //set the position of horizontal scrollbar.
- virtual void IOnSetScrollPosX(FX_FLOAT fx) = 0;
- //set the position of vertical scrollbar.
- virtual void IOnSetScrollPosY(FX_FLOAT fy) = 0;
- //set the caret information.
- virtual void IOnSetCaret(FX_BOOL bVisible,const CPDF_Point & ptHead,const CPDF_Point & ptFoot, const CPVT_WordPlace& place) = 0;
- //if the caret position is changed ,send the information of current postion to user.
- virtual void IOnCaretChange(const CPVT_SecProps & secProps, const CPVT_WordProps & wordProps) = 0;
- //if the text area is changed, send the information to user.
- virtual void IOnContentChange(const CPDF_Rect& rcContent) = 0;
- //Invalidate the rectangle relative to the bounding box of edit.
- virtual void IOnInvalidateRect(CPDF_Rect * pRect) = 0;
-};
-
-class IFX_Edit_OprNotify
-{
- //this class is implemented by user
-public:
- //OprType: 0
- virtual void OnInsertWord(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace) = 0;
- //OprType: 1
- virtual void OnInsertReturn(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace) = 0;
- //OprType: 2
- virtual void OnBackSpace(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace) = 0;
- //OprType: 3
- virtual void OnDelete(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace) = 0;
- //OprType: 4
- virtual void OnClear(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace) = 0;
- //OprType: 5
- virtual void OnInsertText(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace) = 0;
- //OprType: 6
- virtual void OnSetText(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace) = 0;
- //
- virtual void OnAddUndo(IFX_Edit_UndoItem* pUndoItem) = 0;
-};
-
-class IFX_Edit_Iterator
-{
-public:
- virtual ~IFX_Edit_Iterator() {}
-public:
- //move the current position to the next word.
- virtual FX_BOOL NextWord() = 0;
- //move the current position to the next line.
- virtual FX_BOOL NextLine() = 0;
- //move the current position to the next section.
- virtual FX_BOOL NextSection() = 0;
-
- //move the current position to the previous word.
- virtual FX_BOOL PrevWord() = 0;
- //move the current position to the previous line.
- virtual FX_BOOL PrevLine() = 0;
- //move the current position to the previous section.
- virtual FX_BOOL PrevSection() = 0;
-
- //get the information of the current word.
- virtual FX_BOOL GetWord(CPVT_Word & word) const = 0;
- //get the information of the current line.
- virtual FX_BOOL GetLine(CPVT_Line & line) const = 0;
- //get the information of the current section.
- virtual FX_BOOL GetSection(CPVT_Section & section) const = 0;
- //set the current position.
- virtual void SetAt(FX_INT32 nWordIndex) = 0;
- //set the current position.
- virtual void SetAt(const CPVT_WordPlace & place) = 0;
- //get the current position.
- virtual const CPVT_WordPlace & GetAt() const = 0;
-
- //get the edit which this iterator belongs to
- virtual IFX_Edit* GetEdit() const = 0;
-};
-
-class IFX_Edit_UndoItem
-{
-public:
- virtual void Undo() = 0;
- virtual void Redo() = 0;
- virtual CFX_WideString GetUndoTitle() = 0;
- virtual void Release() = 0;
-};
-
-class FXET_CLASS IFX_Edit
-{
-public:
- static IFX_Edit* NewEdit();
- static void DelEdit(IFX_Edit* pEdit);
-
-public:
- //set a IFX_Edit_FontMap pointer implemented by user.
- virtual void SetFontMap(IFX_Edit_FontMap* pFontMap) = 0;
- //if user don't like to use FontMap, implement VTProvider and set it directly.
- virtual void SetVTProvider(IPDF_VariableText_Provider* pProvider) = 0;
- //set a IFX_Edit_Notify pointer implemented by user.
- virtual void SetNotify(IFX_Edit_Notify * pNotify) = 0;
- virtual void SetOprNotify(IFX_Edit_OprNotify* pOprNotify) = 0;
- //get a pointer allocated by CPDF_Edit, by this pointer, user can iterate the contents of edit, but don't need to release.
- virtual IFX_Edit_Iterator* GetIterator() = 0;
- //get a VT pointer relative to this edit.
- virtual IPDF_VariableText* GetVariableText() = 0;
- //get the IFX_Edit_FontMap pointer set by user.
- virtual IFX_Edit_FontMap* GetFontMap() = 0;
-
- //initialize the edit.
- virtual void Initialize() = 0;
-
- //set the bounding box of the text area.
- virtual void SetPlateRect(const CPDF_Rect & rect, FX_BOOL bPaint = TRUE) = 0;
- //set the scroll origin
- virtual void SetScrollPos(const CPDF_Point & point) = 0;
-
- //set the horizontal text alignment in text box, nFormat (0:left 1:middle 2:right).
- virtual void SetAlignmentH(FX_INT32 nFormat = 0, FX_BOOL bPaint = TRUE) = 0;
- //set the vertical text alignment in text box, nFormat (0:top 1:center 2:bottom).
- virtual void SetAlignmentV(FX_INT32 nFormat = 0, FX_BOOL bPaint = TRUE) = 0;
- //if the text is shown in secret , set a character for substitute.
- virtual void SetPasswordChar(FX_WORD wSubWord = '*', FX_BOOL bPaint = TRUE) = 0;
- //set the maximal count of words of the text.
- virtual void SetLimitChar(FX_INT32 nLimitChar = 0, FX_BOOL bPaint = TRUE) = 0;
- //if set the count of charArray , then all words is shown in equal space.
- virtual void SetCharArray(FX_INT32 nCharArray = 0, FX_BOOL bPaint = TRUE) = 0;
- //set the space of two characters.
- virtual void SetCharSpace(FX_FLOAT fCharSpace = 0.0f, FX_BOOL bPaint = TRUE) = 0;
- //set the horizontal scale of all characters.
- virtual void SetHorzScale(FX_INT32 nHorzScale = 100, FX_BOOL bPaint = TRUE) = 0;
- //set the leading of all lines
- virtual void SetLineLeading(FX_FLOAT fLineLeading, FX_BOOL bPaint = TRUE) = 0;
- //if set, CRLF is allowed.
- virtual void SetMultiLine(FX_BOOL bMultiLine = TRUE, FX_BOOL bPaint = TRUE) = 0;
- //if set, all words auto fit the width of the bounding box.
- virtual void SetAutoReturn(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE) = 0;
- //if set, a font size is calculated to full fit the bounding box.
- virtual void SetAutoFontSize(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE) = 0;
- //is set, the text is allowed to scroll.
- virtual void SetAutoScroll(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE) = 0;
- //set the font size of all words.
- virtual void SetFontSize(FX_FLOAT fFontSize, FX_BOOL bPaint = TRUE) = 0;
- //the text is allowed to auto-scroll, allow the text overflow?
- virtual void SetTextOverflow(FX_BOOL bAllowed = FALSE, FX_BOOL bPaint = TRUE) = 0;
-
- //query if the edit is richedit.
- virtual FX_BOOL IsRichText() const = 0;
- //set the edit is richedit.
- virtual void SetRichText(FX_BOOL bRichText = TRUE, FX_BOOL bPaint = TRUE) = 0;
- //set the fontsize of selected text.
- virtual FX_BOOL SetRichFontSize(FX_FLOAT fFontSize) = 0;
- //set the fontindex of selected text, user can change the font of selected text.
- virtual FX_BOOL SetRichFontIndex(FX_INT32 nFontIndex) = 0;
- //set the textcolor of selected text.
- virtual FX_BOOL SetRichTextColor(FX_COLORREF dwColor) = 0;
- //set the text script type of selected text. (0:normal 1:superscript 2:subscript)
- virtual FX_BOOL SetRichTextScript(FX_INT32 nScriptType) = 0;
- //set the bold font style of selected text.
- virtual FX_BOOL SetRichTextBold(FX_BOOL bBold = TRUE) = 0;
- //set the italic font style of selected text.
- virtual FX_BOOL SetRichTextItalic(FX_BOOL bItalic = TRUE) = 0;
- //set the underline style of selected text.
- virtual FX_BOOL SetRichTextUnderline(FX_BOOL bUnderline = TRUE) = 0;
- //set the crossout style of selected text.
- virtual FX_BOOL SetRichTextCrossout(FX_BOOL bCrossout = TRUE) = 0;
- //set the charspace of selected text, in user coordinate.
- virtual FX_BOOL SetRichTextCharSpace(FX_FLOAT fCharSpace) = 0;
- //set the horizontal scale of selected text, default value is 100.
- virtual FX_BOOL SetRichTextHorzScale(FX_INT32 nHorzScale = 100) = 0;
- //set the leading of selected section, in user coordinate.
- virtual FX_BOOL SetRichTextLineLeading(FX_FLOAT fLineLeading) = 0;
- //set the indent of selected section, in user coordinate.
- virtual FX_BOOL SetRichTextLineIndent(FX_FLOAT fLineIndent) = 0;
- //set the alignment of selected section, nAlignment(0:left 1:middle 2:right)
- virtual FX_BOOL SetRichTextAlignment(FX_INT32 nAlignment) = 0;
-
- //set the selected range of text.
- //if nStartChar == 0 and nEndChar == -1, select all the text.
- virtual void SetSel(FX_INT32 nStartChar,FX_INT32 nEndChar) = 0;
- //get the selected range of text.
- virtual void GetSel(FX_INT32 & nStartChar, FX_INT32 & nEndChar) const = 0;
- //select all the text.
- virtual void SelectAll() = 0;
- //set text is not selected.
- virtual void SelectNone() = 0;
- //get the caret position.
- virtual FX_INT32 GetCaret() const = 0;
- virtual CPVT_WordPlace GetCaretWordPlace() const = 0;
- //get the string of selected text.
- virtual CFX_WideString GetSelText() const = 0;
- //get the text conent
- virtual CFX_WideString GetText() const = 0;
- //query if any text is selected.
- virtual FX_BOOL IsSelected() const = 0;
- //get the scroll origin
- virtual CPDF_Point GetScrollPos() const = 0;
- //get the bounding box of the text area.
- virtual CPDF_Rect GetPlateRect() const = 0;
- //get the fact area of the text.
- virtual CPDF_Rect GetContentRect() const = 0;
- //get the visible word range
- virtual CPVT_WordRange GetVisibleWordRange() const = 0;
- //get the whole word range
- virtual CPVT_WordRange GetWholeWordRange() const = 0;
- //get the word range of select text
- virtual CPVT_WordRange GetSelectWordRange() const = 0;
-
- //send the mousedown message to edit for response.
- //if Shift key is hold, bShift is TRUE, is Ctrl key is hold, bCtrl is TRUE.
- virtual void OnMouseDown(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl) = 0;
- //send the mousemove message to edit when mouse down is TRUE.
- virtual void OnMouseMove(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl) = 0;
- //send the UP key message to edit.
- virtual void OnVK_UP(FX_BOOL bShift,FX_BOOL bCtrl) = 0;
- //send the DOWN key message to edit.
- virtual void OnVK_DOWN(FX_BOOL bShift,FX_BOOL bCtrl) = 0;
- //send the LEFT key message to edit.
- virtual void OnVK_LEFT(FX_BOOL bShift,FX_BOOL bCtrl) = 0;
- //send the RIGHT key message to edit.
- virtual void OnVK_RIGHT(FX_BOOL bShift,FX_BOOL bCtrl) = 0;
- //send the HOME key message to edit.
- virtual void OnVK_HOME(FX_BOOL bShift,FX_BOOL bCtrl) = 0;
- //send the END key message to edit.
- virtual void OnVK_END(FX_BOOL bShift,FX_BOOL bCtrl) = 0;
-
- //put text into edit.
- virtual void SetText(FX_LPCWSTR text,FX_INT32 charset = DEFAULT_CHARSET,
- const CPVT_SecProps * pSecProps = NULL,const CPVT_WordProps * pWordProps = NULL) = 0;
- //insert a word into the edit.
- virtual FX_BOOL InsertWord(FX_WORD word, FX_INT32 charset = DEFAULT_CHARSET, const CPVT_WordProps * pWordProps = NULL) = 0;
- //insert a return into the edit.
- virtual FX_BOOL InsertReturn(const CPVT_SecProps * pSecProps = NULL,const CPVT_WordProps * pWordProps = NULL) = 0;
- //insert text into the edit.
- virtual FX_BOOL InsertText(FX_LPCWSTR text, FX_INT32 charset = DEFAULT_CHARSET,
- const CPVT_SecProps * pSecProps = NULL,const CPVT_WordProps * pWordProps = NULL) = 0;
- //do backspace operation.
- virtual FX_BOOL Backspace() = 0;
- //do delete operation.
- virtual FX_BOOL Delete() = 0;
- //delete the selected text.
- virtual FX_BOOL Clear() = 0;
-
- //do Redo operation.
- virtual FX_BOOL Redo() = 0;
- //do Undo operation.
- virtual FX_BOOL Undo() = 0;
- //move caret
- virtual void SetCaret(FX_INT32 nPos) = 0;
-
- //arrange all words over again
- virtual void Paint() = 0;
-
- //allow to refresh screen?
- virtual void EnableRefresh(FX_BOOL bRefresh) = 0;
-
- virtual void RefreshWordRange(const CPVT_WordRange& wr) = 0;
-
- //allow undo/redo?
- virtual void EnableUndo(FX_BOOL bUndo) = 0;
-
- //allow notify?
- virtual void EnableNotify(FX_BOOL bNotify) = 0;
-
- //allow opr notify?
- virtual void EnableOprNotify(FX_BOOL bNotify) = 0;
-
- //map word place to word index.
- virtual FX_INT32 WordPlaceToWordIndex(const CPVT_WordPlace & place) const = 0;
- //map word index to word place.
- virtual CPVT_WordPlace WordIndexToWordPlace(FX_INT32 index) const = 0;
-
- //get the beginning position of a line
- virtual CPVT_WordPlace GetLineBeginPlace(const CPVT_WordPlace & place) const = 0;
-
- //get the ending position of a line
- virtual CPVT_WordPlace GetLineEndPlace(const CPVT_WordPlace & place) const = 0;
-
- //get the beginning position of a section
- virtual CPVT_WordPlace GetSectionBeginPlace(const CPVT_WordPlace & place) const = 0;
-
- //get the ending position of a section
- virtual CPVT_WordPlace GetSectionEndPlace(const CPVT_WordPlace & place) const = 0;
-
- //search a wordplace form point
- virtual CPVT_WordPlace SearchWordPlace(const CPDF_Point& point) const = 0;
-
- //get the font size of non_rich text or default font size of richtext.
- virtual FX_FLOAT GetFontSize() const = 0;
- //get the mask character.
- virtual FX_WORD GetPasswordChar() const = 0;
- //get the count of charArray
- virtual FX_INT32 GetCharArray() const = 0;
- //get the horizontal scale of all characters
- virtual FX_INT32 GetHorzScale() const = 0;
- //get the space of two characters
- virtual FX_FLOAT GetCharSpace() const = 0;
- //get the latin words of specified range
- virtual CFX_WideString GetRangeText(const CPVT_WordRange & range) const = 0;
- //is the text full in bounding box
- virtual FX_BOOL IsTextFull() const = 0;
- virtual FX_BOOL CanUndo() const = 0;
- virtual FX_BOOL CanRedo() const = 0;
- //if the content is changed after settext?
- virtual FX_BOOL IsModified() const = 0;
- //get the total words in edit
- virtual FX_INT32 GetTotalWords() const = 0;
-
- virtual void AddUndoItem(IFX_Edit_UndoItem* pUndoItem) = 0;
-
-public:
- static CFX_ByteString GetEditAppearanceStream(IFX_Edit* pEdit, const CPDF_Point & ptOffset,
- const CPVT_WordRange* pRange = NULL,
- FX_BOOL bContinuous = TRUE, FX_WORD SubWord = 0);
- static CFX_ByteString GetSelectAppearanceStream(IFX_Edit* pEdit, const CPDF_Point & ptOffset, const CPVT_WordRange* pRange = NULL);
- static void DrawEdit(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, IFX_Edit* pEdit, FX_COLORREF crTextFill, FX_COLORREF crTextStroke,
- const CPDF_Rect& rcClip, const CPDF_Point& ptOffset, const CPVT_WordRange* pRange, IFX_SystemHandler* pSystemHandler, void* pFFLData);
- static void DrawUnderline(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, IFX_Edit* pEdit, FX_COLORREF color,
- const CPDF_Rect& rcClip, const CPDF_Point& ptOffset, const CPVT_WordRange* pRange);
- static void DrawRichEdit(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, IFX_Edit* pEdit,
- const CPDF_Rect& rcClip, const CPDF_Point& ptOffset, const CPVT_WordRange* pRange);
- static void GeneratePageObjects(CPDF_PageObjects* pPageObjects, IFX_Edit* pEdit,
- const CPDF_Point& ptOffset, const CPVT_WordRange* pRange, FX_COLORREF crText, CFX_ArrayTemplate<CPDF_TextObject*>& ObjArray);
- static void GenerateRichPageObjects(CPDF_PageObjects* pPageObjects, IFX_Edit* pEdit,
- const CPDF_Point& ptOffset, const CPVT_WordRange* pRange, CFX_ArrayTemplate<CPDF_TextObject*>& ObjArray);
- static void GenerateUnderlineObjects(CPDF_PageObjects* pPageObjects, IFX_Edit* pEdit,
- const CPDF_Point& ptOffset, const CPVT_WordRange* pRange, FX_COLORREF color);
-};
-
-class IFX_List_Notify
-{
- //this class is implemented by user
-public:
- //set the horizontal scrollbar information.
- virtual void IOnSetScrollInfoX(FX_FLOAT fPlateMin, FX_FLOAT fPlateMax,
- FX_FLOAT fContentMin, FX_FLOAT fContentMax,
- FX_FLOAT fSmallStep, FX_FLOAT fBigStep) = 0;
- //set the vertical scrollbar information.
- virtual void IOnSetScrollInfoY(FX_FLOAT fPlateMin, FX_FLOAT fPlateMax,
- FX_FLOAT fContentMin, FX_FLOAT fContentMax,
- FX_FLOAT fSmallStep, FX_FLOAT fBigStep) = 0;
- //set the position of horizontal scrollbar.
- virtual void IOnSetScrollPosX(FX_FLOAT fx) = 0;
- //set the position of vertical scrollbar.
- virtual void IOnSetScrollPosY(FX_FLOAT fy) = 0;
- //Invalidate the rectangle relative to the bounding box of edit.
- virtual void IOnInvalidateRect(CPDF_Rect * pRect) = 0;
-};
-
-class FXET_CLASS IFX_List
-{
-public:
- static IFX_List* NewList();
- static void DelList(IFX_List* pList);
-
-public:
- virtual void SetFontMap(IFX_Edit_FontMap * pFontMap) = 0;
- virtual void SetNotify(IFX_List_Notify * pNotify) = 0;
-
- virtual void SetPlateRect(const CPDF_Rect & rect) = 0;
- virtual void SetFontSize(FX_FLOAT fFontSize) = 0;
-
- virtual CPDF_Rect GetPlateRect() const = 0;
- virtual CPDF_Rect GetContentRect() const = 0;
-
- virtual FX_FLOAT GetFontSize() const = 0;
- virtual IFX_Edit* GetItemEdit(FX_INT32 nIndex) const = 0;
- virtual FX_INT32 GetCount() const = 0;
- virtual FX_BOOL IsItemSelected(FX_INT32 nIndex) const = 0;
- virtual FX_FLOAT GetFirstHeight() const = 0;
-
- virtual void SetMultipleSel(FX_BOOL bMultiple) = 0;
- virtual FX_BOOL IsMultipleSel() const = 0;
- virtual FX_BOOL IsValid(FX_INT32 nItemIndex) const = 0;
- virtual FX_INT32 FindNext(FX_INT32 nIndex,FX_WCHAR nChar) const = 0;
-
- virtual void SetScrollPos(const CPDF_Point & point) = 0;
- virtual void ScrollToListItem(FX_INT32 nItemIndex) = 0;
- virtual CPDF_Rect GetItemRect(FX_INT32 nIndex) const = 0;
- virtual FX_INT32 GetCaret() const = 0;
- virtual FX_INT32 GetSelect() const = 0;
- virtual FX_INT32 GetTopItem() const = 0;
- virtual FX_INT32 GetItemIndex(const CPDF_Point & point) const = 0;
- virtual FX_INT32 GetFirstSelected() const = 0;
-
- virtual void AddString(FX_LPCWSTR string) = 0;
- virtual void SetTopItem(FX_INT32 nIndex) = 0;
- virtual void Select(FX_INT32 nItemIndex) = 0;
- virtual void SetCaret(FX_INT32 nItemIndex) = 0;
- virtual void Empty() = 0;
- virtual void Cancel() = 0;
- virtual CFX_WideString GetText() const = 0;
-
-
- virtual void OnMouseDown(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl) = 0;
- virtual void OnMouseMove(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl) = 0;
- virtual void OnVK_UP(FX_BOOL bShift,FX_BOOL bCtrl) = 0;
- virtual void OnVK_DOWN(FX_BOOL bShift,FX_BOOL bCtrl) = 0;
- virtual void OnVK_LEFT(FX_BOOL bShift,FX_BOOL bCtrl) = 0;
- virtual void OnVK_RIGHT(FX_BOOL bShift,FX_BOOL bCtrl) = 0;
- virtual void OnVK_HOME(FX_BOOL bShift,FX_BOOL bCtrl) = 0;
- virtual void OnVK_END(FX_BOOL bShift,FX_BOOL bCtrl) = 0;
- virtual void OnVK(FX_INT32 nItemIndex,FX_BOOL bShift,FX_BOOL bCtrl) = 0;
- virtual FX_BOOL OnChar(FX_WORD nChar,FX_BOOL bShift,FX_BOOL bCtrl) = 0;
-};
-
-#endif
-
+// 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 _FX_EDIT_H_
+#define _FX_EDIT_H_
+
+#define PVTWORD_STYLE_NORMAL 0x0000L
+#define PVTWORD_STYLE_HIGHLIGHT 0x0001L
+#define PVTWORD_STYLE_UNDERLINE 0x0002L
+#define PVTWORD_STYLE_CROSSOUT 0x0004L
+#define PVTWORD_STYLE_SQUIGGLY 0x0008L
+#define PVTWORD_STYLE_DUALCROSSOUT 0x0010L
+#define PVTWORD_STYLE_BOLD 0x0020L
+#define PVTWORD_STYLE_ITALIC 0x0040L
+
+#define FX_EDIT_ISLATINWORD(u) (u == 0x2D || (u <= 0x005A && u >= 0x0041) || (u <= 0x007A && u >= 0x0061) || (u <= 0x02AF && u >= 0x00C0))
+
+#ifdef FX_READER_DLL
+ #ifdef FXET_EXPORT
+ #define FXET_CLASS __declspec(dllexport)
+ #else
+ #define FXET_CLASS
+ #endif
+#else
+ #define FXET_CLASS
+#endif
+
+#ifndef DEFAULT_CHARSET
+#define DEFAULT_CHARSET 1
+#endif
+
+class IFX_Edit_FontMap;
+class IFX_Edit_Notify;
+class IFX_Edit_Iterator;
+class IFX_Edit_UndoItem;
+class IFX_Edit;
+class IFX_List_Notify;
+class IFX_List;
+class IFX_SystemHandler;
+
+class IFX_Edit_FontMap
+{
+public:
+ //map a fontindex to pdf font.
+ virtual CPDF_Font * GetPDFFont(FX_INT32 nFontIndex) = 0;
+ //get the alias of a pdf font.
+ virtual CFX_ByteString GetPDFFontAlias(FX_INT32 nFontIndex) = 0;
+ //get the index of a font that can show a word.
+ virtual FX_INT32 GetWordFontIndex(FX_WORD word, FX_INT32 charset, FX_INT32 nFontIndex) = 0;
+ //get the charcode of word from unicode
+ virtual FX_INT32 CharCodeFromUnicode(FX_INT32 nFontIndex, FX_WORD word) = 0;
+ //get the charset of unicode
+ virtual FX_INT32 CharSetFromUnicode(FX_WORD word, FX_INT32 nOldCharset) = 0;
+};
+
+class IFX_Edit_Notify
+{
+ //this class is implemented by user
+public:
+ //set the horizontal scrollbar information.
+ virtual void IOnSetScrollInfoX(FX_FLOAT fPlateMin, FX_FLOAT fPlateMax,
+ FX_FLOAT fContentMin, FX_FLOAT fContentMax,
+ FX_FLOAT fSmallStep, FX_FLOAT fBigStep) = 0;
+ //set the vertical scrollbar information.
+ virtual void IOnSetScrollInfoY(FX_FLOAT fPlateMin, FX_FLOAT fPlateMax,
+ FX_FLOAT fContentMin, FX_FLOAT fContentMax,
+ FX_FLOAT fSmallStep, FX_FLOAT fBigStep) = 0;
+ //set the position of horizontal scrollbar.
+ virtual void IOnSetScrollPosX(FX_FLOAT fx) = 0;
+ //set the position of vertical scrollbar.
+ virtual void IOnSetScrollPosY(FX_FLOAT fy) = 0;
+ //set the caret information.
+ virtual void IOnSetCaret(FX_BOOL bVisible,const CPDF_Point & ptHead,const CPDF_Point & ptFoot, const CPVT_WordPlace& place) = 0;
+ //if the caret position is changed ,send the information of current postion to user.
+ virtual void IOnCaretChange(const CPVT_SecProps & secProps, const CPVT_WordProps & wordProps) = 0;
+ //if the text area is changed, send the information to user.
+ virtual void IOnContentChange(const CPDF_Rect& rcContent) = 0;
+ //Invalidate the rectangle relative to the bounding box of edit.
+ virtual void IOnInvalidateRect(CPDF_Rect * pRect) = 0;
+};
+
+class IFX_Edit_OprNotify
+{
+ //this class is implemented by user
+public:
+ //OprType: 0
+ virtual void OnInsertWord(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace) = 0;
+ //OprType: 1
+ virtual void OnInsertReturn(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace) = 0;
+ //OprType: 2
+ virtual void OnBackSpace(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace) = 0;
+ //OprType: 3
+ virtual void OnDelete(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace) = 0;
+ //OprType: 4
+ virtual void OnClear(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace) = 0;
+ //OprType: 5
+ virtual void OnInsertText(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace) = 0;
+ //OprType: 6
+ virtual void OnSetText(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace) = 0;
+ //
+ virtual void OnAddUndo(IFX_Edit_UndoItem* pUndoItem) = 0;
+};
+
+class IFX_Edit_Iterator
+{
+public:
+ virtual ~IFX_Edit_Iterator() {}
+public:
+ //move the current position to the next word.
+ virtual FX_BOOL NextWord() = 0;
+ //move the current position to the next line.
+ virtual FX_BOOL NextLine() = 0;
+ //move the current position to the next section.
+ virtual FX_BOOL NextSection() = 0;
+
+ //move the current position to the previous word.
+ virtual FX_BOOL PrevWord() = 0;
+ //move the current position to the previous line.
+ virtual FX_BOOL PrevLine() = 0;
+ //move the current position to the previous section.
+ virtual FX_BOOL PrevSection() = 0;
+
+ //get the information of the current word.
+ virtual FX_BOOL GetWord(CPVT_Word & word) const = 0;
+ //get the information of the current line.
+ virtual FX_BOOL GetLine(CPVT_Line & line) const = 0;
+ //get the information of the current section.
+ virtual FX_BOOL GetSection(CPVT_Section & section) const = 0;
+ //set the current position.
+ virtual void SetAt(FX_INT32 nWordIndex) = 0;
+ //set the current position.
+ virtual void SetAt(const CPVT_WordPlace & place) = 0;
+ //get the current position.
+ virtual const CPVT_WordPlace & GetAt() const = 0;
+
+ //get the edit which this iterator belongs to
+ virtual IFX_Edit* GetEdit() const = 0;
+};
+
+class IFX_Edit_UndoItem
+{
+public:
+ virtual void Undo() = 0;
+ virtual void Redo() = 0;
+ virtual CFX_WideString GetUndoTitle() = 0;
+ virtual void Release() = 0;
+};
+
+class FXET_CLASS IFX_Edit
+{
+public:
+ static IFX_Edit* NewEdit();
+ static void DelEdit(IFX_Edit* pEdit);
+
+public:
+ //set a IFX_Edit_FontMap pointer implemented by user.
+ virtual void SetFontMap(IFX_Edit_FontMap* pFontMap) = 0;
+ //if user don't like to use FontMap, implement VTProvider and set it directly.
+ virtual void SetVTProvider(IPDF_VariableText_Provider* pProvider) = 0;
+ //set a IFX_Edit_Notify pointer implemented by user.
+ virtual void SetNotify(IFX_Edit_Notify * pNotify) = 0;
+ virtual void SetOprNotify(IFX_Edit_OprNotify* pOprNotify) = 0;
+ //get a pointer allocated by CPDF_Edit, by this pointer, user can iterate the contents of edit, but don't need to release.
+ virtual IFX_Edit_Iterator* GetIterator() = 0;
+ //get a VT pointer relative to this edit.
+ virtual IPDF_VariableText* GetVariableText() = 0;
+ //get the IFX_Edit_FontMap pointer set by user.
+ virtual IFX_Edit_FontMap* GetFontMap() = 0;
+
+ //initialize the edit.
+ virtual void Initialize() = 0;
+
+ //set the bounding box of the text area.
+ virtual void SetPlateRect(const CPDF_Rect & rect, FX_BOOL bPaint = TRUE) = 0;
+ //set the scroll origin
+ virtual void SetScrollPos(const CPDF_Point & point) = 0;
+
+ //set the horizontal text alignment in text box, nFormat (0:left 1:middle 2:right).
+ virtual void SetAlignmentH(FX_INT32 nFormat = 0, FX_BOOL bPaint = TRUE) = 0;
+ //set the vertical text alignment in text box, nFormat (0:top 1:center 2:bottom).
+ virtual void SetAlignmentV(FX_INT32 nFormat = 0, FX_BOOL bPaint = TRUE) = 0;
+ //if the text is shown in secret , set a character for substitute.
+ virtual void SetPasswordChar(FX_WORD wSubWord = '*', FX_BOOL bPaint = TRUE) = 0;
+ //set the maximal count of words of the text.
+ virtual void SetLimitChar(FX_INT32 nLimitChar = 0, FX_BOOL bPaint = TRUE) = 0;
+ //if set the count of charArray , then all words is shown in equal space.
+ virtual void SetCharArray(FX_INT32 nCharArray = 0, FX_BOOL bPaint = TRUE) = 0;
+ //set the space of two characters.
+ virtual void SetCharSpace(FX_FLOAT fCharSpace = 0.0f, FX_BOOL bPaint = TRUE) = 0;
+ //set the horizontal scale of all characters.
+ virtual void SetHorzScale(FX_INT32 nHorzScale = 100, FX_BOOL bPaint = TRUE) = 0;
+ //set the leading of all lines
+ virtual void SetLineLeading(FX_FLOAT fLineLeading, FX_BOOL bPaint = TRUE) = 0;
+ //if set, CRLF is allowed.
+ virtual void SetMultiLine(FX_BOOL bMultiLine = TRUE, FX_BOOL bPaint = TRUE) = 0;
+ //if set, all words auto fit the width of the bounding box.
+ virtual void SetAutoReturn(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE) = 0;
+ //if set, a font size is calculated to full fit the bounding box.
+ virtual void SetAutoFontSize(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE) = 0;
+ //is set, the text is allowed to scroll.
+ virtual void SetAutoScroll(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE) = 0;
+ //set the font size of all words.
+ virtual void SetFontSize(FX_FLOAT fFontSize, FX_BOOL bPaint = TRUE) = 0;
+ //the text is allowed to auto-scroll, allow the text overflow?
+ virtual void SetTextOverflow(FX_BOOL bAllowed = FALSE, FX_BOOL bPaint = TRUE) = 0;
+
+ //query if the edit is richedit.
+ virtual FX_BOOL IsRichText() const = 0;
+ //set the edit is richedit.
+ virtual void SetRichText(FX_BOOL bRichText = TRUE, FX_BOOL bPaint = TRUE) = 0;
+ //set the fontsize of selected text.
+ virtual FX_BOOL SetRichFontSize(FX_FLOAT fFontSize) = 0;
+ //set the fontindex of selected text, user can change the font of selected text.
+ virtual FX_BOOL SetRichFontIndex(FX_INT32 nFontIndex) = 0;
+ //set the textcolor of selected text.
+ virtual FX_BOOL SetRichTextColor(FX_COLORREF dwColor) = 0;
+ //set the text script type of selected text. (0:normal 1:superscript 2:subscript)
+ virtual FX_BOOL SetRichTextScript(FX_INT32 nScriptType) = 0;
+ //set the bold font style of selected text.
+ virtual FX_BOOL SetRichTextBold(FX_BOOL bBold = TRUE) = 0;
+ //set the italic font style of selected text.
+ virtual FX_BOOL SetRichTextItalic(FX_BOOL bItalic = TRUE) = 0;
+ //set the underline style of selected text.
+ virtual FX_BOOL SetRichTextUnderline(FX_BOOL bUnderline = TRUE) = 0;
+ //set the crossout style of selected text.
+ virtual FX_BOOL SetRichTextCrossout(FX_BOOL bCrossout = TRUE) = 0;
+ //set the charspace of selected text, in user coordinate.
+ virtual FX_BOOL SetRichTextCharSpace(FX_FLOAT fCharSpace) = 0;
+ //set the horizontal scale of selected text, default value is 100.
+ virtual FX_BOOL SetRichTextHorzScale(FX_INT32 nHorzScale = 100) = 0;
+ //set the leading of selected section, in user coordinate.
+ virtual FX_BOOL SetRichTextLineLeading(FX_FLOAT fLineLeading) = 0;
+ //set the indent of selected section, in user coordinate.
+ virtual FX_BOOL SetRichTextLineIndent(FX_FLOAT fLineIndent) = 0;
+ //set the alignment of selected section, nAlignment(0:left 1:middle 2:right)
+ virtual FX_BOOL SetRichTextAlignment(FX_INT32 nAlignment) = 0;
+
+ //set the selected range of text.
+ //if nStartChar == 0 and nEndChar == -1, select all the text.
+ virtual void SetSel(FX_INT32 nStartChar,FX_INT32 nEndChar) = 0;
+ //get the selected range of text.
+ virtual void GetSel(FX_INT32 & nStartChar, FX_INT32 & nEndChar) const = 0;
+ //select all the text.
+ virtual void SelectAll() = 0;
+ //set text is not selected.
+ virtual void SelectNone() = 0;
+ //get the caret position.
+ virtual FX_INT32 GetCaret() const = 0;
+ virtual CPVT_WordPlace GetCaretWordPlace() const = 0;
+ //get the string of selected text.
+ virtual CFX_WideString GetSelText() const = 0;
+ //get the text conent
+ virtual CFX_WideString GetText() const = 0;
+ //query if any text is selected.
+ virtual FX_BOOL IsSelected() const = 0;
+ //get the scroll origin
+ virtual CPDF_Point GetScrollPos() const = 0;
+ //get the bounding box of the text area.
+ virtual CPDF_Rect GetPlateRect() const = 0;
+ //get the fact area of the text.
+ virtual CPDF_Rect GetContentRect() const = 0;
+ //get the visible word range
+ virtual CPVT_WordRange GetVisibleWordRange() const = 0;
+ //get the whole word range
+ virtual CPVT_WordRange GetWholeWordRange() const = 0;
+ //get the word range of select text
+ virtual CPVT_WordRange GetSelectWordRange() const = 0;
+
+ //send the mousedown message to edit for response.
+ //if Shift key is hold, bShift is TRUE, is Ctrl key is hold, bCtrl is TRUE.
+ virtual void OnMouseDown(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl) = 0;
+ //send the mousemove message to edit when mouse down is TRUE.
+ virtual void OnMouseMove(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl) = 0;
+ //send the UP key message to edit.
+ virtual void OnVK_UP(FX_BOOL bShift,FX_BOOL bCtrl) = 0;
+ //send the DOWN key message to edit.
+ virtual void OnVK_DOWN(FX_BOOL bShift,FX_BOOL bCtrl) = 0;
+ //send the LEFT key message to edit.
+ virtual void OnVK_LEFT(FX_BOOL bShift,FX_BOOL bCtrl) = 0;
+ //send the RIGHT key message to edit.
+ virtual void OnVK_RIGHT(FX_BOOL bShift,FX_BOOL bCtrl) = 0;
+ //send the HOME key message to edit.
+ virtual void OnVK_HOME(FX_BOOL bShift,FX_BOOL bCtrl) = 0;
+ //send the END key message to edit.
+ virtual void OnVK_END(FX_BOOL bShift,FX_BOOL bCtrl) = 0;
+
+ //put text into edit.
+ virtual void SetText(FX_LPCWSTR text,FX_INT32 charset = DEFAULT_CHARSET,
+ const CPVT_SecProps * pSecProps = NULL,const CPVT_WordProps * pWordProps = NULL) = 0;
+ //insert a word into the edit.
+ virtual FX_BOOL InsertWord(FX_WORD word, FX_INT32 charset = DEFAULT_CHARSET, const CPVT_WordProps * pWordProps = NULL) = 0;
+ //insert a return into the edit.
+ virtual FX_BOOL InsertReturn(const CPVT_SecProps * pSecProps = NULL,const CPVT_WordProps * pWordProps = NULL) = 0;
+ //insert text into the edit.
+ virtual FX_BOOL InsertText(FX_LPCWSTR text, FX_INT32 charset = DEFAULT_CHARSET,
+ const CPVT_SecProps * pSecProps = NULL,const CPVT_WordProps * pWordProps = NULL) = 0;
+ //do backspace operation.
+ virtual FX_BOOL Backspace() = 0;
+ //do delete operation.
+ virtual FX_BOOL Delete() = 0;
+ //delete the selected text.
+ virtual FX_BOOL Clear() = 0;
+
+ //do Redo operation.
+ virtual FX_BOOL Redo() = 0;
+ //do Undo operation.
+ virtual FX_BOOL Undo() = 0;
+ //move caret
+ virtual void SetCaret(FX_INT32 nPos) = 0;
+
+ //arrange all words over again
+ virtual void Paint() = 0;
+
+ //allow to refresh screen?
+ virtual void EnableRefresh(FX_BOOL bRefresh) = 0;
+
+ virtual void RefreshWordRange(const CPVT_WordRange& wr) = 0;
+
+ //allow undo/redo?
+ virtual void EnableUndo(FX_BOOL bUndo) = 0;
+
+ //allow notify?
+ virtual void EnableNotify(FX_BOOL bNotify) = 0;
+
+ //allow opr notify?
+ virtual void EnableOprNotify(FX_BOOL bNotify) = 0;
+
+ //map word place to word index.
+ virtual FX_INT32 WordPlaceToWordIndex(const CPVT_WordPlace & place) const = 0;
+ //map word index to word place.
+ virtual CPVT_WordPlace WordIndexToWordPlace(FX_INT32 index) const = 0;
+
+ //get the beginning position of a line
+ virtual CPVT_WordPlace GetLineBeginPlace(const CPVT_WordPlace & place) const = 0;
+
+ //get the ending position of a line
+ virtual CPVT_WordPlace GetLineEndPlace(const CPVT_WordPlace & place) const = 0;
+
+ //get the beginning position of a section
+ virtual CPVT_WordPlace GetSectionBeginPlace(const CPVT_WordPlace & place) const = 0;
+
+ //get the ending position of a section
+ virtual CPVT_WordPlace GetSectionEndPlace(const CPVT_WordPlace & place) const = 0;
+
+ //search a wordplace form point
+ virtual CPVT_WordPlace SearchWordPlace(const CPDF_Point& point) const = 0;
+
+ //get the font size of non_rich text or default font size of richtext.
+ virtual FX_FLOAT GetFontSize() const = 0;
+ //get the mask character.
+ virtual FX_WORD GetPasswordChar() const = 0;
+ //get the count of charArray
+ virtual FX_INT32 GetCharArray() const = 0;
+ //get the horizontal scale of all characters
+ virtual FX_INT32 GetHorzScale() const = 0;
+ //get the space of two characters
+ virtual FX_FLOAT GetCharSpace() const = 0;
+ //get the latin words of specified range
+ virtual CFX_WideString GetRangeText(const CPVT_WordRange & range) const = 0;
+ //is the text full in bounding box
+ virtual FX_BOOL IsTextFull() const = 0;
+ virtual FX_BOOL CanUndo() const = 0;
+ virtual FX_BOOL CanRedo() const = 0;
+ //if the content is changed after settext?
+ virtual FX_BOOL IsModified() const = 0;
+ //get the total words in edit
+ virtual FX_INT32 GetTotalWords() const = 0;
+
+ virtual void AddUndoItem(IFX_Edit_UndoItem* pUndoItem) = 0;
+
+public:
+ static CFX_ByteString GetEditAppearanceStream(IFX_Edit* pEdit, const CPDF_Point & ptOffset,
+ const CPVT_WordRange* pRange = NULL,
+ FX_BOOL bContinuous = TRUE, FX_WORD SubWord = 0);
+ static CFX_ByteString GetSelectAppearanceStream(IFX_Edit* pEdit, const CPDF_Point & ptOffset, const CPVT_WordRange* pRange = NULL);
+ static void DrawEdit(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, IFX_Edit* pEdit, FX_COLORREF crTextFill, FX_COLORREF crTextStroke,
+ const CPDF_Rect& rcClip, const CPDF_Point& ptOffset, const CPVT_WordRange* pRange, IFX_SystemHandler* pSystemHandler, void* pFFLData);
+ static void DrawUnderline(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, IFX_Edit* pEdit, FX_COLORREF color,
+ const CPDF_Rect& rcClip, const CPDF_Point& ptOffset, const CPVT_WordRange* pRange);
+ static void DrawRichEdit(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, IFX_Edit* pEdit,
+ const CPDF_Rect& rcClip, const CPDF_Point& ptOffset, const CPVT_WordRange* pRange);
+ static void GeneratePageObjects(CPDF_PageObjects* pPageObjects, IFX_Edit* pEdit,
+ const CPDF_Point& ptOffset, const CPVT_WordRange* pRange, FX_COLORREF crText, CFX_ArrayTemplate<CPDF_TextObject*>& ObjArray);
+ static void GenerateRichPageObjects(CPDF_PageObjects* pPageObjects, IFX_Edit* pEdit,
+ const CPDF_Point& ptOffset, const CPVT_WordRange* pRange, CFX_ArrayTemplate<CPDF_TextObject*>& ObjArray);
+ static void GenerateUnderlineObjects(CPDF_PageObjects* pPageObjects, IFX_Edit* pEdit,
+ const CPDF_Point& ptOffset, const CPVT_WordRange* pRange, FX_COLORREF color);
+};
+
+class IFX_List_Notify
+{
+ //this class is implemented by user
+public:
+ //set the horizontal scrollbar information.
+ virtual void IOnSetScrollInfoX(FX_FLOAT fPlateMin, FX_FLOAT fPlateMax,
+ FX_FLOAT fContentMin, FX_FLOAT fContentMax,
+ FX_FLOAT fSmallStep, FX_FLOAT fBigStep) = 0;
+ //set the vertical scrollbar information.
+ virtual void IOnSetScrollInfoY(FX_FLOAT fPlateMin, FX_FLOAT fPlateMax,
+ FX_FLOAT fContentMin, FX_FLOAT fContentMax,
+ FX_FLOAT fSmallStep, FX_FLOAT fBigStep) = 0;
+ //set the position of horizontal scrollbar.
+ virtual void IOnSetScrollPosX(FX_FLOAT fx) = 0;
+ //set the position of vertical scrollbar.
+ virtual void IOnSetScrollPosY(FX_FLOAT fy) = 0;
+ //Invalidate the rectangle relative to the bounding box of edit.
+ virtual void IOnInvalidateRect(CPDF_Rect * pRect) = 0;
+};
+
+class FXET_CLASS IFX_List
+{
+public:
+ static IFX_List* NewList();
+ static void DelList(IFX_List* pList);
+
+public:
+ virtual void SetFontMap(IFX_Edit_FontMap * pFontMap) = 0;
+ virtual void SetNotify(IFX_List_Notify * pNotify) = 0;
+
+ virtual void SetPlateRect(const CPDF_Rect & rect) = 0;
+ virtual void SetFontSize(FX_FLOAT fFontSize) = 0;
+
+ virtual CPDF_Rect GetPlateRect() const = 0;
+ virtual CPDF_Rect GetContentRect() const = 0;
+
+ virtual FX_FLOAT GetFontSize() const = 0;
+ virtual IFX_Edit* GetItemEdit(FX_INT32 nIndex) const = 0;
+ virtual FX_INT32 GetCount() const = 0;
+ virtual FX_BOOL IsItemSelected(FX_INT32 nIndex) const = 0;
+ virtual FX_FLOAT GetFirstHeight() const = 0;
+
+ virtual void SetMultipleSel(FX_BOOL bMultiple) = 0;
+ virtual FX_BOOL IsMultipleSel() const = 0;
+ virtual FX_BOOL IsValid(FX_INT32 nItemIndex) const = 0;
+ virtual FX_INT32 FindNext(FX_INT32 nIndex,FX_WCHAR nChar) const = 0;
+
+ virtual void SetScrollPos(const CPDF_Point & point) = 0;
+ virtual void ScrollToListItem(FX_INT32 nItemIndex) = 0;
+ virtual CPDF_Rect GetItemRect(FX_INT32 nIndex) const = 0;
+ virtual FX_INT32 GetCaret() const = 0;
+ virtual FX_INT32 GetSelect() const = 0;
+ virtual FX_INT32 GetTopItem() const = 0;
+ virtual FX_INT32 GetItemIndex(const CPDF_Point & point) const = 0;
+ virtual FX_INT32 GetFirstSelected() const = 0;
+
+ virtual void AddString(FX_LPCWSTR string) = 0;
+ virtual void SetTopItem(FX_INT32 nIndex) = 0;
+ virtual void Select(FX_INT32 nItemIndex) = 0;
+ virtual void SetCaret(FX_INT32 nItemIndex) = 0;
+ virtual void Empty() = 0;
+ virtual void Cancel() = 0;
+ virtual CFX_WideString GetText() const = 0;
+
+
+ virtual void OnMouseDown(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl) = 0;
+ virtual void OnMouseMove(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl) = 0;
+ virtual void OnVK_UP(FX_BOOL bShift,FX_BOOL bCtrl) = 0;
+ virtual void OnVK_DOWN(FX_BOOL bShift,FX_BOOL bCtrl) = 0;
+ virtual void OnVK_LEFT(FX_BOOL bShift,FX_BOOL bCtrl) = 0;
+ virtual void OnVK_RIGHT(FX_BOOL bShift,FX_BOOL bCtrl) = 0;
+ virtual void OnVK_HOME(FX_BOOL bShift,FX_BOOL bCtrl) = 0;
+ virtual void OnVK_END(FX_BOOL bShift,FX_BOOL bCtrl) = 0;
+ virtual void OnVK(FX_INT32 nItemIndex,FX_BOOL bShift,FX_BOOL bCtrl) = 0;
+ virtual FX_BOOL OnChar(FX_WORD nChar,FX_BOOL bShift,FX_BOOL bCtrl) = 0;
+};
+
+#endif
+
diff --git a/fpdfsdk/include/fxedit/fxet_edit.h b/fpdfsdk/include/fxedit/fxet_edit.h
index 72b780956d..f65715b196 100644
--- a/fpdfsdk/include/fxedit/fxet_edit.h
+++ b/fpdfsdk/include/fxedit/fxet_edit.h
@@ -1,823 +1,823 @@
-// 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 _FXET_EDIT_H_
-#define _FXET_EDIT_H_
-
-#include "fx_edit.h"
-
-class CFX_Edit_Page;
-struct CFX_Edit_LineRect;
-class CFX_Edit_LineRectArray;
-class CFX_Edit_RectArray;
-class CFX_Edit_Refresh;
-class CFX_Edit_Select;
-class CFX_Edit;
-class CFX_Edit_Iterator;
-class CFX_Edit_Refresh;
-class CFX_Edit_UndoItem;
-class CFX_Edit_Undo;
-class CFX_Edit_Provider;
-
-#define FX_EDIT_IsFloatZero(f) (f < 0.0001 && f > -0.0001)
-#define FX_EDIT_IsFloatEqual(fa,fb) FX_EDIT_IsFloatZero(fa - fb)
-#define FX_EDIT_IsFloatBigger(fa,fb) (fa > fb && !FX_EDIT_IsFloatEqual(fa,fb))
-#define FX_EDIT_IsFloatSmaller(fa,fb) (fa < fb && !FX_EDIT_IsFloatEqual(fa,fb))
-
-template<class T> T FX_EDIT_MIN (const T & i, const T & j) { return ((i < j) ? i : j); }
-template<class T> T FX_EDIT_MAX (const T & i, const T & j) { return ((i > j) ? i : j); }
-
-#define FX_EDIT_PI 3.14159265358979f
-#define FX_EDIT_ITALIC_ANGEL 10 * FX_EDIT_PI / 180.0f
-
-
-/* ------------------------- CFX_Edit_Refresh ---------------------------- */
-
-enum REFRESH_PLAN_E
-{
- RP_ANALYSE,
- RP_NOANALYSE,
- RP_OPTIONAL
-};
-
-enum EDIT_PROPS_E
-{
- EP_LINELEADING,
- EP_LINEINDENT,
- EP_ALIGNMENT,
- EP_FONTINDEX,
- EP_FONTSIZE,
- EP_WORDCOLOR,
- EP_SCRIPTTYPE,
- EP_UNDERLINE,
- EP_CROSSOUT,
- EP_CHARSPACE,
- EP_HORZSCALE,
- EP_BOLD,
- EP_ITALIC
-};
-
-struct CFX_Edit_LineRect
-{
- CFX_Edit_LineRect(const CPVT_WordRange & wrLine,const CPDF_Rect & rcLine) :
- m_wrLine(wrLine), m_rcLine(rcLine)
- {
- }
-
- FX_BOOL operator != (const CFX_Edit_LineRect & linerect) const
- {
- return FXSYS_memcmp(this, &linerect, sizeof(CFX_Edit_LineRect)) != 0;
- }
-
- FX_BOOL IsSameHeight(const CFX_Edit_LineRect & linerect) const
- {
- return FX_EDIT_IsFloatZero((m_rcLine.top - m_rcLine.bottom) - (linerect.m_rcLine.top -linerect.m_rcLine.bottom));
- }
-
- FX_BOOL IsSameTop(const CFX_Edit_LineRect & linerect) const
- {
- return FX_EDIT_IsFloatZero(m_rcLine.top - linerect.m_rcLine.top);
- }
-
- FX_BOOL IsSameLeft(const CFX_Edit_LineRect & linerect) const
- {
- return FX_EDIT_IsFloatZero(m_rcLine.left - linerect.m_rcLine.left);
- }
-
- FX_BOOL IsSameRight(const CFX_Edit_LineRect & linerect) const
- {
- return FX_EDIT_IsFloatZero(m_rcLine.right - linerect.m_rcLine.right);
- }
-
- CPVT_WordRange m_wrLine;
- CPDF_Rect m_rcLine;
-};
-
-class CFX_Edit_LineRectArray
-{
-public:
- CFX_Edit_LineRectArray()
- {
- }
-
- virtual ~CFX_Edit_LineRectArray()
- {
- Empty();
- }
-
- void Empty()
- {
- for (FX_INT32 i = 0, sz = m_LineRects.GetSize(); i < sz; i++)
- delete m_LineRects.GetAt(i);
-
- m_LineRects.RemoveAll();
- }
-
- void RemoveAll()
- {
- m_LineRects.RemoveAll();
- }
-
- void operator = (CFX_Edit_LineRectArray & rects)
- {
- Empty();
- for (FX_INT32 i = 0, sz = rects.GetSize(); i < sz; i++)
- m_LineRects.Add(rects.GetAt(i));
-
- rects.RemoveAll();
- }
-
- void Add(const CPVT_WordRange & wrLine,const CPDF_Rect & rcLine)
- {
- if (CFX_Edit_LineRect * pRect = new CFX_Edit_LineRect(wrLine,rcLine))
- m_LineRects.Add(pRect);
- }
-
- FX_INT32 GetSize() const
- {
- return m_LineRects.GetSize();
- }
-
- CFX_Edit_LineRect * GetAt(FX_INT32 nIndex) const
- {
- if (nIndex < 0 || nIndex >= m_LineRects.GetSize())
- return NULL;
-
- return m_LineRects.GetAt(nIndex);
- }
-
- CFX_ArrayTemplate<CFX_Edit_LineRect*> m_LineRects;
-};
-
-class CFX_Edit_RectArray
-{
-public:
- CFX_Edit_RectArray()
- {
- }
-
- virtual ~CFX_Edit_RectArray()
- {
- this->Empty();
- }
-
- void Empty()
- {
- for (FX_INT32 i = 0, sz = m_Rects.GetSize(); i < sz; i++)
- delete m_Rects.GetAt(i);
-
- this->m_Rects.RemoveAll();
- }
-
- void Add(const CPDF_Rect & rect)
- {
- //check for overlaped area
- for (FX_INT32 i = 0, sz = m_Rects.GetSize(); i < sz; i++)
- if (CPDF_Rect * pRect = m_Rects.GetAt(i))
- if (pRect->Contains(rect))return;
-
- if (CPDF_Rect * pNewRect = new CPDF_Rect(rect))
- m_Rects.Add(pNewRect);
- }
-
- FX_INT32 GetSize() const
- {
- return m_Rects.GetSize();
- }
-
- CPDF_Rect * GetAt(FX_INT32 nIndex) const
- {
- if (nIndex < 0 || nIndex >= m_Rects.GetSize())
- return NULL;
-
- return m_Rects.GetAt(nIndex);
- }
-
- CFX_ArrayTemplate<CPDF_Rect*> m_Rects;
-};
-
-class CFX_Edit_Refresh
-{
-public:
- CFX_Edit_Refresh();
- virtual ~CFX_Edit_Refresh();
-
- void BeginRefresh();
- void Push(const CPVT_WordRange & linerange,const CPDF_Rect & rect);
- void NoAnalyse();
- void Analyse(FX_INT32 nAlignment);
- void AddRefresh(const CPDF_Rect & rect);
- const CFX_Edit_RectArray * GetRefreshRects() const;
- void EndRefresh();
-
-private:
- CFX_Edit_LineRectArray m_NewLineRects;
- CFX_Edit_LineRectArray m_OldLineRects;
- CFX_Edit_RectArray m_RefreshRects;
-};
-
-
-/* ------------------------- CFX_Edit_Select ---------------------------- */
-
-class CFX_Edit_Select
-{
-public:
- CFX_Edit_Select()
- {
- }
-
- CFX_Edit_Select(const CPVT_WordPlace & begin,const CPVT_WordPlace & end)
- {
- Set(begin,end);
- }
-
- CFX_Edit_Select(const CPVT_WordRange & range)
- {
- Set(range.BeginPos,range.EndPos);
- }
-
- CPVT_WordRange ConvertToWordRange() const
- {
- return CPVT_WordRange(this->BeginPos,this->EndPos);
- }
-
- void Default()
- {
- BeginPos.Default();
- EndPos.Default();
- }
-
- void Set(const CPVT_WordPlace & begin,const CPVT_WordPlace & end)
- {
- this->BeginPos = begin;
- this->EndPos = end;
- }
-
- void SetBeginPos(const CPVT_WordPlace & begin)
- {
- this->BeginPos = begin;
- }
-
- void SetEndPos(const CPVT_WordPlace & end)
- {
- this->EndPos = end;
- }
-
- FX_BOOL IsExist() const
- {
- return this->BeginPos != this->EndPos;
- }
-
- FX_BOOL operator != (const CPVT_WordRange & wr) const
- {
- return wr.BeginPos != this->BeginPos || wr.EndPos != this->EndPos;
- }
-
- CPVT_WordPlace BeginPos,EndPos;
-};
-
-/* ------------------------- CFX_Edit_Undo ---------------------------- */
-
-class CFX_Edit_Undo
-{
-public:
- CFX_Edit_Undo(FX_INT32 nBufsize = 10000);
- virtual ~CFX_Edit_Undo();
-
- void Undo();
- void Redo();
-
- void AddItem(IFX_Edit_UndoItem* pItem);
-
- FX_BOOL CanUndo() const;
- FX_BOOL CanRedo() const;
- FX_BOOL IsModified() const;
- FX_BOOL IsWorking() const;
-
- void Reset();
-
- IFX_Edit_UndoItem* GetItem(FX_INT32 nIndex);
- FX_INT32 GetItemCount(){return m_UndoItemStack.GetSize();}
- FX_INT32 GetCurUndoPos(){return m_nCurUndoPos;}
-
-private:
- void SetBufSize(FX_INT32 nSize){m_nBufSize = nSize;}
- FX_INT32 GetBufSize(){return m_nBufSize;}
-
- void RemoveHeads();
- void RemoveTails();
-
-private:
- CFX_ArrayTemplate<IFX_Edit_UndoItem*> m_UndoItemStack;
-
- FX_INT32 m_nCurUndoPos;
- FX_INT32 m_nBufSize;
- FX_BOOL m_bModified;
- FX_BOOL m_bVirgin;
- FX_BOOL m_bWorking;
-};
-
-class CFX_Edit_UndoItem : public IFX_Edit_UndoItem
-{
-public:
- CFX_Edit_UndoItem() : m_bFirst(TRUE), m_bLast(TRUE) {}
- virtual ~CFX_Edit_UndoItem(){}
-
- virtual CFX_WideString GetUndoTitle() {return L"";}
- virtual void Release(){delete this;}
-
-public:
- void SetFirst(FX_BOOL bFirst){m_bFirst = bFirst;}
- FX_BOOL IsFirst(){return m_bFirst;}
- void SetLast(FX_BOOL bLast){m_bLast = bLast;}
- FX_BOOL IsLast(){return m_bLast;}
-
-private:
- FX_BOOL m_bFirst;
- FX_BOOL m_bLast;
-};
-
-class CFX_Edit_GroupUndoItem : public IFX_Edit_UndoItem
-{
-public:
- CFX_Edit_GroupUndoItem(const CFX_WideString& sTitle);
- virtual ~CFX_Edit_GroupUndoItem();
-
- void AddUndoItem(CFX_Edit_UndoItem* pUndoItem);
- void UpdateItems();
-
-public:
- virtual void Undo();
- virtual void Redo();
- virtual CFX_WideString GetUndoTitle();
- virtual void Release();
-
-private:
- CFX_WideString m_sTitle;
- CFX_ArrayTemplate<CFX_Edit_UndoItem*> m_Items;
-};
-
-/* ------------------------- CFX_Edit_UndoItem derived classes ---------------------------- */
-
-class CFXEU_InsertWord : public CFX_Edit_UndoItem
-{
-public:
- CFXEU_InsertWord(CFX_Edit * pEdit, const CPVT_WordPlace & wpOldPlace, const CPVT_WordPlace & wpNewPlace,
- FX_WORD word, FX_INT32 charset, const CPVT_WordProps * pWordProps);
- virtual ~CFXEU_InsertWord();
-
- void Redo();
- void Undo();
-
-private:
- CFX_Edit* m_pEdit;
-
- CPVT_WordPlace m_wpOld;
- CPVT_WordPlace m_wpNew;
- FX_WORD m_Word;
- FX_INT32 m_nCharset;
- CPVT_WordProps m_WordProps;
-};
-
-class CFXEU_InsertReturn : public CFX_Edit_UndoItem
-{
-public:
- CFXEU_InsertReturn(CFX_Edit * pEdit, const CPVT_WordPlace & wpOldPlace, const CPVT_WordPlace & wpNewPlace,
- const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordProps);
- virtual ~CFXEU_InsertReturn();
-
- void Redo();
- void Undo();
-
-private:
- CFX_Edit * m_pEdit;
-
- CPVT_WordPlace m_wpOld;
- CPVT_WordPlace m_wpNew;
- CPVT_SecProps m_SecProps;
- CPVT_WordProps m_WordProps;
-};
-
-class CFXEU_Backspace : public CFX_Edit_UndoItem
-{
-public:
- CFXEU_Backspace(CFX_Edit * pEdit, const CPVT_WordPlace & wpOldPlace, const CPVT_WordPlace & wpNewPlace,
- FX_WORD word, FX_INT32 charset,
- const CPVT_SecProps & SecProps, const CPVT_WordProps & WordProps);
- virtual ~CFXEU_Backspace();
-
- void Redo();
- void Undo();
-
-private:
- CFX_Edit * m_pEdit;
-
- CPVT_WordPlace m_wpOld;
- CPVT_WordPlace m_wpNew;
- FX_WORD m_Word;
- FX_INT32 m_nCharset;
- CPVT_SecProps m_SecProps;
- CPVT_WordProps m_WordProps;
-};
-
-class CFXEU_Delete : public CFX_Edit_UndoItem
-{
-public:
- CFXEU_Delete(CFX_Edit * pEdit, const CPVT_WordPlace & wpOldPlace, const CPVT_WordPlace & wpNewPlace,
- FX_WORD word, FX_INT32 charset,
- const CPVT_SecProps & SecProps, const CPVT_WordProps & WordProps, FX_BOOL bSecEnd);
- virtual ~CFXEU_Delete();
-
- void Redo();
- void Undo();
-
-private:
- CFX_Edit * m_pEdit;
-
- CPVT_WordPlace m_wpOld;
- CPVT_WordPlace m_wpNew;
- FX_WORD m_Word;
- FX_INT32 m_nCharset;
- CPVT_SecProps m_SecProps;
- CPVT_WordProps m_WordProps;
- FX_BOOL m_bSecEnd;
-};
-
-class CFXEU_Clear : public CFX_Edit_UndoItem
-{
-public:
- CFXEU_Clear(CFX_Edit * pEdit, const CPVT_WordRange & wrSel, const CFX_WideString & swText);
- virtual ~CFXEU_Clear();
-
- void Redo();
- void Undo();
-
-private:
- CFX_Edit* m_pEdit;
-
- CPVT_WordRange m_wrSel;
- CFX_WideString m_swText;
-};
-
-class CFXEU_ClearRich : public CFX_Edit_UndoItem
-{
-public:
- CFXEU_ClearRich(CFX_Edit * pEdit, const CPVT_WordPlace & wpOldPlace, const CPVT_WordPlace & wpNewPlace,
- const CPVT_WordRange & wrSel,
- FX_WORD word, FX_INT32 charset,
- const CPVT_SecProps & SecProps, const CPVT_WordProps & WordProps);
- virtual ~CFXEU_ClearRich();
-
- void Redo();
- void Undo();
-
-private:
- CFX_Edit * m_pEdit;
-
- CPVT_WordPlace m_wpOld;
- CPVT_WordPlace m_wpNew;
- CPVT_WordRange m_wrSel;
- FX_WORD m_Word;
- FX_INT32 m_nCharset;
- CPVT_SecProps m_SecProps;
- CPVT_WordProps m_WordProps;
-};
-
-class CFXEU_InsertText : public CFX_Edit_UndoItem
-{
-public:
- CFXEU_InsertText(CFX_Edit * pEdit, const CPVT_WordPlace & wpOldPlace, const CPVT_WordPlace & wpNewPlace,
- const CFX_WideString & swText, FX_INT32 charset,
- const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordProps);
- virtual ~CFXEU_InsertText();
-
- void Redo();
- void Undo();
-
-private:
- CFX_Edit * m_pEdit;
-
- CPVT_WordPlace m_wpOld;
- CPVT_WordPlace m_wpNew;
- CFX_WideString m_swText;
- FX_INT32 m_nCharset;
- CPVT_SecProps m_SecProps;
- CPVT_WordProps m_WordProps;
-};
-
-class CFXEU_SetSecProps : public CFX_Edit_UndoItem
-{
-public:
- CFXEU_SetSecProps(CFX_Edit * pEdit, const CPVT_WordPlace & place, EDIT_PROPS_E ep,
- const CPVT_SecProps & oldsecprops, const CPVT_WordProps & oldwordprops,
- const CPVT_SecProps & newsecprops, const CPVT_WordProps & newwordprops, const CPVT_WordRange & range);
- virtual ~CFXEU_SetSecProps();
-
- void Redo();
- void Undo();
-
-private:
- CFX_Edit * m_pEdit;
- CPVT_WordPlace m_wpPlace;
- CPVT_WordRange m_wrPlace;
- EDIT_PROPS_E m_eProps;
-
- CPVT_SecProps m_OldSecProps;
- CPVT_SecProps m_NewSecProps;
- CPVT_WordProps m_OldWordProps;
- CPVT_WordProps m_NewWordProps;
-};
-
-class CFXEU_SetWordProps : public CFX_Edit_UndoItem
-{
-public:
- CFXEU_SetWordProps(CFX_Edit * pEdit, const CPVT_WordPlace & place, EDIT_PROPS_E ep,
- const CPVT_WordProps & oldprops, const CPVT_WordProps & newprops, const CPVT_WordRange & range);
- virtual ~CFXEU_SetWordProps();
-
- void Redo();
- void Undo();
-
-private:
- CFX_Edit * m_pEdit;
- CPVT_WordPlace m_wpPlace;
- CPVT_WordRange m_wrPlace;
- EDIT_PROPS_E m_eProps;
-
- CPVT_WordProps m_OldWordProps;
- CPVT_WordProps m_NewWordProps;
-};
-
-/* ------------------------- CFX_Edit ---------------------------- */
-
-class CFX_Edit : public IFX_Edit
-{
- friend class CFX_Edit_Iterator;
- friend class CFXEU_InsertWord;
- friend class CFXEU_InsertReturn;
- friend class CFXEU_Backspace;
- friend class CFXEU_Delete;
- friend class CFXEU_Clear;
- friend class CFXEU_ClearRich;
- friend class CFXEU_SetSecProps;
- friend class CFXEU_SetWordProps;
- friend class CFXEU_InsertText;
-
-public:
- CFX_Edit(IPDF_VariableText * pVT);
- virtual ~CFX_Edit();
-
- void SetFontMap(IFX_Edit_FontMap * pFontMap);
- void SetVTProvider(IPDF_VariableText_Provider* pProvider);
- void SetNotify(IFX_Edit_Notify * pNotify);
- void SetOprNotify(IFX_Edit_OprNotify* pOprNotify);
- IFX_Edit_Iterator* GetIterator();
- IPDF_VariableText * GetVariableText();
- IFX_Edit_FontMap* GetFontMap();
-
- void Initialize();
- void SetPlateRect(const CPDF_Rect & rect, FX_BOOL bPaint = TRUE);
- void SetScrollPos(const CPDF_Point & point);
-
- void SetAlignmentH(FX_INT32 nFormat = 0, FX_BOOL bPaint = TRUE);
- void SetAlignmentV(FX_INT32 nFormat = 0, FX_BOOL bPaint = TRUE);
- void SetPasswordChar(FX_WORD wSubWord = '*', FX_BOOL bPaint = TRUE);
- void SetLimitChar(FX_INT32 nLimitChar = 0, FX_BOOL bPaint = TRUE);
- void SetCharArray(FX_INT32 nCharArray = 0, FX_BOOL bPaint = TRUE);
- void SetCharSpace(FX_FLOAT fCharSpace = 0.0f, FX_BOOL bPaint = TRUE);
- void SetHorzScale(FX_INT32 nHorzScale = 100, FX_BOOL bPaint = TRUE);
- void SetLineLeading(FX_FLOAT fLineLeading, FX_BOOL bPaint = TRUE);
- void SetMultiLine(FX_BOOL bMultiLine = TRUE, FX_BOOL bPaint = TRUE);
- void SetAutoReturn(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE);
- void SetAutoFontSize(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE);
- void SetAutoScroll(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE);
- void SetFontSize(FX_FLOAT fFontSize, FX_BOOL bPaint = TRUE);
- void SetTextOverflow(FX_BOOL bAllowed = FALSE, FX_BOOL bPaint = TRUE);
-
- FX_BOOL IsRichText() const;
- void SetRichText(FX_BOOL bRichText = TRUE, FX_BOOL bPaint = TRUE);
- FX_BOOL SetRichFontSize(FX_FLOAT fFontSize);
- FX_BOOL SetRichFontIndex(FX_INT32 nFontIndex);
- FX_BOOL SetRichTextColor(FX_COLORREF dwColor);
- FX_BOOL SetRichTextScript(FX_INT32 nScriptType);
- FX_BOOL SetRichTextBold(FX_BOOL bBold = TRUE);
- FX_BOOL SetRichTextItalic(FX_BOOL bItalic = TRUE);
- FX_BOOL SetRichTextUnderline(FX_BOOL bUnderline = TRUE);
- FX_BOOL SetRichTextCrossout(FX_BOOL bCrossout = TRUE);
- FX_BOOL SetRichTextCharSpace(FX_FLOAT fCharSpace);
- FX_BOOL SetRichTextHorzScale(FX_INT32 nHorzScale = 100);
- FX_BOOL SetRichTextLineLeading(FX_FLOAT fLineLeading);
- FX_BOOL SetRichTextLineIndent(FX_FLOAT fLineIndent);
- FX_BOOL SetRichTextAlignment(FX_INT32 nAlignment);
-
- void OnMouseDown(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl);
- void OnMouseMove(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl);
- void OnVK_UP(FX_BOOL bShift,FX_BOOL bCtrl);
- void OnVK_DOWN(FX_BOOL bShift,FX_BOOL bCtrl);
- void OnVK_LEFT(FX_BOOL bShift,FX_BOOL bCtrl);
- void OnVK_RIGHT(FX_BOOL bShift,FX_BOOL bCtrl);
- void OnVK_HOME(FX_BOOL bShift,FX_BOOL bCtrl);
- void OnVK_END(FX_BOOL bShift,FX_BOOL bCtrl);
-
- void SetText(FX_LPCWSTR text,FX_INT32 charset = DEFAULT_CHARSET,
- const CPVT_SecProps * pSecProps = NULL,const CPVT_WordProps * pWordProps = NULL);
- FX_BOOL InsertWord(FX_WORD word, FX_INT32 charset = DEFAULT_CHARSET, const CPVT_WordProps * pWordProps = NULL);
- FX_BOOL InsertReturn(const CPVT_SecProps * pSecProps = NULL,const CPVT_WordProps * pWordProps = NULL);
- FX_BOOL Backspace();
- FX_BOOL Delete();
- FX_BOOL Clear();
- FX_BOOL Empty();
- FX_BOOL InsertText(FX_LPCWSTR text, FX_INT32 charset = DEFAULT_CHARSET,
- const CPVT_SecProps * pSecProps = NULL,const CPVT_WordProps * pWordProps = NULL);
- FX_BOOL Redo();
- FX_BOOL Undo();
- CPVT_WordPlace DoInsertText(const CPVT_WordPlace& place, FX_LPCWSTR text, FX_INT32 charset,
- const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordProps);
- FX_INT32 GetCharSetFromUnicode(FX_WORD word, FX_INT32 nOldCharset);
-
- FX_INT32 WordPlaceToWordIndex(const CPVT_WordPlace & place) const;
- CPVT_WordPlace WordIndexToWordPlace(FX_INT32 index) const;
-
- CPVT_WordPlace GetLineBeginPlace(const CPVT_WordPlace & place) const;
- CPVT_WordPlace GetLineEndPlace(const CPVT_WordPlace & place) const;
- CPVT_WordPlace GetSectionBeginPlace(const CPVT_WordPlace & place) const;
- CPVT_WordPlace GetSectionEndPlace(const CPVT_WordPlace & place) const;
- CPVT_WordPlace SearchWordPlace(const CPDF_Point& point) const;
-
- FX_INT32 GetCaret() const;
- CPVT_WordPlace GetCaretWordPlace() const;
- CFX_WideString GetSelText() const;
- CFX_WideString GetText() const;
- FX_FLOAT GetFontSize() const;
- FX_WORD GetPasswordChar() const;
- CPDF_Point GetScrollPos() const;
- FX_INT32 GetCharArray() const;
- CPDF_Rect GetPlateRect() const;
- CPDF_Rect GetContentRect() const;
- CFX_WideString GetRangeText(const CPVT_WordRange & range) const;
- FX_INT32 GetHorzScale() const;
- FX_FLOAT GetCharSpace() const;
- FX_INT32 GetTotalWords() const;
- FX_INT32 GetTotalLines() const;
-
- void SetSel(FX_INT32 nStartChar,FX_INT32 nEndChar);
- void GetSel(FX_INT32 & nStartChar, FX_INT32 & nEndChar) const;
-
-private:
- void SelectAll();
- void SelectNone();
- void SetSel(const CPVT_WordPlace & begin,const CPVT_WordPlace & end);
- FX_BOOL IsSelected() const;
-
- void RearrangeAll();
- void RearrangePart(const CPVT_WordRange & range);
- void Paint();
- void ScrollToCaret();
- void SetScrollInfo();
- void SetScrollPosX(FX_FLOAT fx);
- void SetScrollPosY(FX_FLOAT fy);
- void SetScrollLimit();
- void SetContentChanged();
- void EnableNotify(FX_BOOL bNotify);
-
- void SetText(FX_LPCWSTR text,FX_INT32 charset,
- const CPVT_SecProps * pSecProps,const CPVT_WordProps * pWordProps,FX_BOOL bAddUndo, FX_BOOL bPaint);
- FX_BOOL InsertWord(FX_WORD word, FX_INT32 charset, const CPVT_WordProps * pWordProps,FX_BOOL bAddUndo, FX_BOOL bPaint);
- FX_BOOL InsertReturn(const CPVT_SecProps * pSecProps,const CPVT_WordProps * pWordProps,FX_BOOL bAddUndo, FX_BOOL bPaint);
- FX_BOOL Backspace(FX_BOOL bAddUndo, FX_BOOL bPaint);
- FX_BOOL Delete(FX_BOOL bAddUndo, FX_BOOL bPaint);
- FX_BOOL Clear(FX_BOOL bAddUndo, FX_BOOL bPaint);
- FX_BOOL InsertText(FX_LPCWSTR text, FX_INT32 charset,
- const CPVT_SecProps * pSecProps,const CPVT_WordProps * pWordProps,FX_BOOL bAddUndo, FX_BOOL bPaint);
- FX_BOOL SetRichTextProps(EDIT_PROPS_E eProps,
- const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordProps);
- FX_BOOL SetSecProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place,
- const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordProps, const CPVT_WordRange & wr, FX_BOOL bAddUndo);
- FX_BOOL SetWordProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place,
- const CPVT_WordProps * pWordProps, const CPVT_WordRange & wr, FX_BOOL bAddUndo);
- void PaintSetProps(EDIT_PROPS_E eProps, const CPVT_WordRange & wr);
- void PaintInsertText(const CPVT_WordPlace & wpOld, const CPVT_WordPlace & wpNew);
-
- inline CPDF_Point VTToEdit(const CPDF_Point & point) const;
- inline CPDF_Point EditToVT(const CPDF_Point & point) const;
- inline CPDF_Rect VTToEdit(const CPDF_Rect & rect) const;
- inline CPDF_Rect EditToVT(const CPDF_Rect & rect) const;
-
- void EnableRefresh(FX_BOOL bRefresh);
- void Refresh(REFRESH_PLAN_E ePlan,const CPVT_WordRange * pRange1 = NULL,const CPVT_WordRange * pRange2 = NULL);
- void RefreshPushLineRects(const CPVT_WordRange & wr);
- void RefreshPushRandomRects(const CPVT_WordRange & wr);
- void RefreshWordRange(const CPVT_WordRange& wr);
-
- void SetCaret(FX_INT32 nPos);
- void SetCaret(const CPVT_WordPlace & place);
- void SetCaretInfo();
- void SetCaretOrigin();
- void SetCaretChange();
-
- CPVT_WordRange GetWholeWordRange() const;
- CPVT_WordRange GetVisibleWordRange() const;
- CPVT_WordRange GetLatinWordsRange(const CPVT_WordPlace & place) const;
- CPVT_WordRange CombineWordRange(const CPVT_WordRange & wr1, const CPVT_WordRange & wr2);
- CPVT_WordRange GetSelectWordRange() const;
-
- void EnableUndo(FX_BOOL bUndo);
- void EnableOprNotify(FX_BOOL bNotify);
-
- FX_BOOL IsTextFull() const;
- FX_BOOL IsTextOverflow() const;
- FX_BOOL CanUndo() const;
- FX_BOOL CanRedo() const;
- FX_BOOL IsModified() const;
-
- void BeginGroupUndo(const CFX_WideString& sTitle);
- void EndGroupUndo();
- void AddEditUndoItem(CFX_Edit_UndoItem* pEditUndoItem);
- void AddUndoItem(IFX_Edit_UndoItem* pUndoItem);
-
- void SetPageInfo(const CPVT_WordPlace& place);
- CPVT_WordPlace SearchPageEndPlace(const CPVT_WordPlace& wpPageBegin, const CPDF_Point& point) const;
- FX_FLOAT GetLineTop(const CPVT_WordPlace& place) const;
- FX_FLOAT GetLineBottom(const CPVT_WordPlace& place) const;
-
-private:
- IPDF_VariableText* m_pVT;
- IFX_Edit_Notify* m_pNotify;
- IFX_Edit_OprNotify* m_pOprNotify;
- CFX_Edit_Provider* m_pVTProvide;
-
- CPVT_WordPlace m_wpCaret;
- CPVT_WordPlace m_wpOldCaret;
- CFX_Edit_Select m_SelState;
-
- CPDF_Point m_ptScrollPos;
- CPDF_Point m_ptRefreshScrollPos;
- FX_BOOL m_bEnableScroll;
- IFX_Edit_Iterator * m_pIterator;
- CFX_Edit_Refresh m_Refresh;
- CPDF_Point m_ptCaret;
- CFX_Edit_Undo m_Undo;
- FX_INT32 m_nAlignment;
- FX_BOOL m_bNotifyFlag;
- FX_BOOL m_bTextFullFlag;
- FX_BOOL m_bEnableOverflow;
- FX_BOOL m_bEnableRefresh;
- CPDF_Rect m_rcOldContent;
- FX_BOOL m_bEnableUndo;
- FX_BOOL m_bNotify;
- FX_BOOL m_bOprNotify;
- CFX_Edit_GroupUndoItem* m_pGroupUndoItem;
-};
-
-/* ------------------------- CFX_Edit_Iterator ---------------------------- */
-
-class CFX_Edit_Iterator : public IFX_Edit_Iterator
-{
-public:
- CFX_Edit_Iterator(CFX_Edit * pEdit,IPDF_VariableText_Iterator * pVTIterator);
- virtual ~CFX_Edit_Iterator();
-
- FX_BOOL NextWord();
- FX_BOOL NextLine();
- FX_BOOL NextSection();
- FX_BOOL PrevWord();
- FX_BOOL PrevLine();
- FX_BOOL PrevSection();
-
- FX_BOOL GetWord(CPVT_Word & word) const;
- FX_BOOL GetLine(CPVT_Line & line) const;
- FX_BOOL GetSection(CPVT_Section & section) const;
- void SetAt(FX_INT32 nWordIndex);
- void SetAt(const CPVT_WordPlace & place);
- const CPVT_WordPlace & GetAt() const;
- IFX_Edit* GetEdit() const;
-
-private:
- CFX_Edit * m_pEdit;
- IPDF_VariableText_Iterator* m_pVTIterator;
-};
-
-class CFX_Edit_Provider : public IPDF_VariableText_Provider
-{
-public:
- CFX_Edit_Provider(IFX_Edit_FontMap* pFontMap);
- virtual ~CFX_Edit_Provider();
-
- IFX_Edit_FontMap* GetFontMap();
-
- FX_INT32 GetCharWidth(FX_INT32 nFontIndex, FX_WORD word, FX_INT32 nWordStyle);
- FX_INT32 GetTypeAscent(FX_INT32 nFontIndex);
- FX_INT32 GetTypeDescent(FX_INT32 nFontIndex);
- FX_INT32 GetWordFontIndex(FX_WORD word, FX_INT32 charset, FX_INT32 nFontIndex);
- FX_INT32 GetDefaultFontIndex();
- FX_BOOL IsLatinWord(FX_WORD word);
-
-private:
- IFX_Edit_FontMap* m_pFontMap;
-};
-
-#endif //_FXET_EDIT_H_
-
+// 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 _FXET_EDIT_H_
+#define _FXET_EDIT_H_
+
+#include "fx_edit.h"
+
+class CFX_Edit_Page;
+struct CFX_Edit_LineRect;
+class CFX_Edit_LineRectArray;
+class CFX_Edit_RectArray;
+class CFX_Edit_Refresh;
+class CFX_Edit_Select;
+class CFX_Edit;
+class CFX_Edit_Iterator;
+class CFX_Edit_Refresh;
+class CFX_Edit_UndoItem;
+class CFX_Edit_Undo;
+class CFX_Edit_Provider;
+
+#define FX_EDIT_IsFloatZero(f) (f < 0.0001 && f > -0.0001)
+#define FX_EDIT_IsFloatEqual(fa,fb) FX_EDIT_IsFloatZero(fa - fb)
+#define FX_EDIT_IsFloatBigger(fa,fb) (fa > fb && !FX_EDIT_IsFloatEqual(fa,fb))
+#define FX_EDIT_IsFloatSmaller(fa,fb) (fa < fb && !FX_EDIT_IsFloatEqual(fa,fb))
+
+template<class T> T FX_EDIT_MIN (const T & i, const T & j) { return ((i < j) ? i : j); }
+template<class T> T FX_EDIT_MAX (const T & i, const T & j) { return ((i > j) ? i : j); }
+
+#define FX_EDIT_PI 3.14159265358979f
+#define FX_EDIT_ITALIC_ANGEL 10 * FX_EDIT_PI / 180.0f
+
+
+/* ------------------------- CFX_Edit_Refresh ---------------------------- */
+
+enum REFRESH_PLAN_E
+{
+ RP_ANALYSE,
+ RP_NOANALYSE,
+ RP_OPTIONAL
+};
+
+enum EDIT_PROPS_E
+{
+ EP_LINELEADING,
+ EP_LINEINDENT,
+ EP_ALIGNMENT,
+ EP_FONTINDEX,
+ EP_FONTSIZE,
+ EP_WORDCOLOR,
+ EP_SCRIPTTYPE,
+ EP_UNDERLINE,
+ EP_CROSSOUT,
+ EP_CHARSPACE,
+ EP_HORZSCALE,
+ EP_BOLD,
+ EP_ITALIC
+};
+
+struct CFX_Edit_LineRect
+{
+ CFX_Edit_LineRect(const CPVT_WordRange & wrLine,const CPDF_Rect & rcLine) :
+ m_wrLine(wrLine), m_rcLine(rcLine)
+ {
+ }
+
+ FX_BOOL operator != (const CFX_Edit_LineRect & linerect) const
+ {
+ return FXSYS_memcmp(this, &linerect, sizeof(CFX_Edit_LineRect)) != 0;
+ }
+
+ FX_BOOL IsSameHeight(const CFX_Edit_LineRect & linerect) const
+ {
+ return FX_EDIT_IsFloatZero((m_rcLine.top - m_rcLine.bottom) - (linerect.m_rcLine.top -linerect.m_rcLine.bottom));
+ }
+
+ FX_BOOL IsSameTop(const CFX_Edit_LineRect & linerect) const
+ {
+ return FX_EDIT_IsFloatZero(m_rcLine.top - linerect.m_rcLine.top);
+ }
+
+ FX_BOOL IsSameLeft(const CFX_Edit_LineRect & linerect) const
+ {
+ return FX_EDIT_IsFloatZero(m_rcLine.left - linerect.m_rcLine.left);
+ }
+
+ FX_BOOL IsSameRight(const CFX_Edit_LineRect & linerect) const
+ {
+ return FX_EDIT_IsFloatZero(m_rcLine.right - linerect.m_rcLine.right);
+ }
+
+ CPVT_WordRange m_wrLine;
+ CPDF_Rect m_rcLine;
+};
+
+class CFX_Edit_LineRectArray
+{
+public:
+ CFX_Edit_LineRectArray()
+ {
+ }
+
+ virtual ~CFX_Edit_LineRectArray()
+ {
+ Empty();
+ }
+
+ void Empty()
+ {
+ for (FX_INT32 i = 0, sz = m_LineRects.GetSize(); i < sz; i++)
+ delete m_LineRects.GetAt(i);
+
+ m_LineRects.RemoveAll();
+ }
+
+ void RemoveAll()
+ {
+ m_LineRects.RemoveAll();
+ }
+
+ void operator = (CFX_Edit_LineRectArray & rects)
+ {
+ Empty();
+ for (FX_INT32 i = 0, sz = rects.GetSize(); i < sz; i++)
+ m_LineRects.Add(rects.GetAt(i));
+
+ rects.RemoveAll();
+ }
+
+ void Add(const CPVT_WordRange & wrLine,const CPDF_Rect & rcLine)
+ {
+ if (CFX_Edit_LineRect * pRect = new CFX_Edit_LineRect(wrLine,rcLine))
+ m_LineRects.Add(pRect);
+ }
+
+ FX_INT32 GetSize() const
+ {
+ return m_LineRects.GetSize();
+ }
+
+ CFX_Edit_LineRect * GetAt(FX_INT32 nIndex) const
+ {
+ if (nIndex < 0 || nIndex >= m_LineRects.GetSize())
+ return NULL;
+
+ return m_LineRects.GetAt(nIndex);
+ }
+
+ CFX_ArrayTemplate<CFX_Edit_LineRect*> m_LineRects;
+};
+
+class CFX_Edit_RectArray
+{
+public:
+ CFX_Edit_RectArray()
+ {
+ }
+
+ virtual ~CFX_Edit_RectArray()
+ {
+ this->Empty();
+ }
+
+ void Empty()
+ {
+ for (FX_INT32 i = 0, sz = m_Rects.GetSize(); i < sz; i++)
+ delete m_Rects.GetAt(i);
+
+ this->m_Rects.RemoveAll();
+ }
+
+ void Add(const CPDF_Rect & rect)
+ {
+ //check for overlaped area
+ for (FX_INT32 i = 0, sz = m_Rects.GetSize(); i < sz; i++)
+ if (CPDF_Rect * pRect = m_Rects.GetAt(i))
+ if (pRect->Contains(rect))return;
+
+ if (CPDF_Rect * pNewRect = new CPDF_Rect(rect))
+ m_Rects.Add(pNewRect);
+ }
+
+ FX_INT32 GetSize() const
+ {
+ return m_Rects.GetSize();
+ }
+
+ CPDF_Rect * GetAt(FX_INT32 nIndex) const
+ {
+ if (nIndex < 0 || nIndex >= m_Rects.GetSize())
+ return NULL;
+
+ return m_Rects.GetAt(nIndex);
+ }
+
+ CFX_ArrayTemplate<CPDF_Rect*> m_Rects;
+};
+
+class CFX_Edit_Refresh
+{
+public:
+ CFX_Edit_Refresh();
+ virtual ~CFX_Edit_Refresh();
+
+ void BeginRefresh();
+ void Push(const CPVT_WordRange & linerange,const CPDF_Rect & rect);
+ void NoAnalyse();
+ void Analyse(FX_INT32 nAlignment);
+ void AddRefresh(const CPDF_Rect & rect);
+ const CFX_Edit_RectArray * GetRefreshRects() const;
+ void EndRefresh();
+
+private:
+ CFX_Edit_LineRectArray m_NewLineRects;
+ CFX_Edit_LineRectArray m_OldLineRects;
+ CFX_Edit_RectArray m_RefreshRects;
+};
+
+
+/* ------------------------- CFX_Edit_Select ---------------------------- */
+
+class CFX_Edit_Select
+{
+public:
+ CFX_Edit_Select()
+ {
+ }
+
+ CFX_Edit_Select(const CPVT_WordPlace & begin,const CPVT_WordPlace & end)
+ {
+ Set(begin,end);
+ }
+
+ CFX_Edit_Select(const CPVT_WordRange & range)
+ {
+ Set(range.BeginPos,range.EndPos);
+ }
+
+ CPVT_WordRange ConvertToWordRange() const
+ {
+ return CPVT_WordRange(this->BeginPos,this->EndPos);
+ }
+
+ void Default()
+ {
+ BeginPos.Default();
+ EndPos.Default();
+ }
+
+ void Set(const CPVT_WordPlace & begin,const CPVT_WordPlace & end)
+ {
+ this->BeginPos = begin;
+ this->EndPos = end;
+ }
+
+ void SetBeginPos(const CPVT_WordPlace & begin)
+ {
+ this->BeginPos = begin;
+ }
+
+ void SetEndPos(const CPVT_WordPlace & end)
+ {
+ this->EndPos = end;
+ }
+
+ FX_BOOL IsExist() const
+ {
+ return this->BeginPos != this->EndPos;
+ }
+
+ FX_BOOL operator != (const CPVT_WordRange & wr) const
+ {
+ return wr.BeginPos != this->BeginPos || wr.EndPos != this->EndPos;
+ }
+
+ CPVT_WordPlace BeginPos,EndPos;
+};
+
+/* ------------------------- CFX_Edit_Undo ---------------------------- */
+
+class CFX_Edit_Undo
+{
+public:
+ CFX_Edit_Undo(FX_INT32 nBufsize = 10000);
+ virtual ~CFX_Edit_Undo();
+
+ void Undo();
+ void Redo();
+
+ void AddItem(IFX_Edit_UndoItem* pItem);
+
+ FX_BOOL CanUndo() const;
+ FX_BOOL CanRedo() const;
+ FX_BOOL IsModified() const;
+ FX_BOOL IsWorking() const;
+
+ void Reset();
+
+ IFX_Edit_UndoItem* GetItem(FX_INT32 nIndex);
+ FX_INT32 GetItemCount(){return m_UndoItemStack.GetSize();}
+ FX_INT32 GetCurUndoPos(){return m_nCurUndoPos;}
+
+private:
+ void SetBufSize(FX_INT32 nSize){m_nBufSize = nSize;}
+ FX_INT32 GetBufSize(){return m_nBufSize;}
+
+ void RemoveHeads();
+ void RemoveTails();
+
+private:
+ CFX_ArrayTemplate<IFX_Edit_UndoItem*> m_UndoItemStack;
+
+ FX_INT32 m_nCurUndoPos;
+ FX_INT32 m_nBufSize;
+ FX_BOOL m_bModified;
+ FX_BOOL m_bVirgin;
+ FX_BOOL m_bWorking;
+};
+
+class CFX_Edit_UndoItem : public IFX_Edit_UndoItem
+{
+public:
+ CFX_Edit_UndoItem() : m_bFirst(TRUE), m_bLast(TRUE) {}
+ virtual ~CFX_Edit_UndoItem(){}
+
+ virtual CFX_WideString GetUndoTitle() {return L"";}
+ virtual void Release(){delete this;}
+
+public:
+ void SetFirst(FX_BOOL bFirst){m_bFirst = bFirst;}
+ FX_BOOL IsFirst(){return m_bFirst;}
+ void SetLast(FX_BOOL bLast){m_bLast = bLast;}
+ FX_BOOL IsLast(){return m_bLast;}
+
+private:
+ FX_BOOL m_bFirst;
+ FX_BOOL m_bLast;
+};
+
+class CFX_Edit_GroupUndoItem : public IFX_Edit_UndoItem
+{
+public:
+ CFX_Edit_GroupUndoItem(const CFX_WideString& sTitle);
+ virtual ~CFX_Edit_GroupUndoItem();
+
+ void AddUndoItem(CFX_Edit_UndoItem* pUndoItem);
+ void UpdateItems();
+
+public:
+ virtual void Undo();
+ virtual void Redo();
+ virtual CFX_WideString GetUndoTitle();
+ virtual void Release();
+
+private:
+ CFX_WideString m_sTitle;
+ CFX_ArrayTemplate<CFX_Edit_UndoItem*> m_Items;
+};
+
+/* ------------------------- CFX_Edit_UndoItem derived classes ---------------------------- */
+
+class CFXEU_InsertWord : public CFX_Edit_UndoItem
+{
+public:
+ CFXEU_InsertWord(CFX_Edit * pEdit, const CPVT_WordPlace & wpOldPlace, const CPVT_WordPlace & wpNewPlace,
+ FX_WORD word, FX_INT32 charset, const CPVT_WordProps * pWordProps);
+ virtual ~CFXEU_InsertWord();
+
+ void Redo();
+ void Undo();
+
+private:
+ CFX_Edit* m_pEdit;
+
+ CPVT_WordPlace m_wpOld;
+ CPVT_WordPlace m_wpNew;
+ FX_WORD m_Word;
+ FX_INT32 m_nCharset;
+ CPVT_WordProps m_WordProps;
+};
+
+class CFXEU_InsertReturn : public CFX_Edit_UndoItem
+{
+public:
+ CFXEU_InsertReturn(CFX_Edit * pEdit, const CPVT_WordPlace & wpOldPlace, const CPVT_WordPlace & wpNewPlace,
+ const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordProps);
+ virtual ~CFXEU_InsertReturn();
+
+ void Redo();
+ void Undo();
+
+private:
+ CFX_Edit * m_pEdit;
+
+ CPVT_WordPlace m_wpOld;
+ CPVT_WordPlace m_wpNew;
+ CPVT_SecProps m_SecProps;
+ CPVT_WordProps m_WordProps;
+};
+
+class CFXEU_Backspace : public CFX_Edit_UndoItem
+{
+public:
+ CFXEU_Backspace(CFX_Edit * pEdit, const CPVT_WordPlace & wpOldPlace, const CPVT_WordPlace & wpNewPlace,
+ FX_WORD word, FX_INT32 charset,
+ const CPVT_SecProps & SecProps, const CPVT_WordProps & WordProps);
+ virtual ~CFXEU_Backspace();
+
+ void Redo();
+ void Undo();
+
+private:
+ CFX_Edit * m_pEdit;
+
+ CPVT_WordPlace m_wpOld;
+ CPVT_WordPlace m_wpNew;
+ FX_WORD m_Word;
+ FX_INT32 m_nCharset;
+ CPVT_SecProps m_SecProps;
+ CPVT_WordProps m_WordProps;
+};
+
+class CFXEU_Delete : public CFX_Edit_UndoItem
+{
+public:
+ CFXEU_Delete(CFX_Edit * pEdit, const CPVT_WordPlace & wpOldPlace, const CPVT_WordPlace & wpNewPlace,
+ FX_WORD word, FX_INT32 charset,
+ const CPVT_SecProps & SecProps, const CPVT_WordProps & WordProps, FX_BOOL bSecEnd);
+ virtual ~CFXEU_Delete();
+
+ void Redo();
+ void Undo();
+
+private:
+ CFX_Edit * m_pEdit;
+
+ CPVT_WordPlace m_wpOld;
+ CPVT_WordPlace m_wpNew;
+ FX_WORD m_Word;
+ FX_INT32 m_nCharset;
+ CPVT_SecProps m_SecProps;
+ CPVT_WordProps m_WordProps;
+ FX_BOOL m_bSecEnd;
+};
+
+class CFXEU_Clear : public CFX_Edit_UndoItem
+{
+public:
+ CFXEU_Clear(CFX_Edit * pEdit, const CPVT_WordRange & wrSel, const CFX_WideString & swText);
+ virtual ~CFXEU_Clear();
+
+ void Redo();
+ void Undo();
+
+private:
+ CFX_Edit* m_pEdit;
+
+ CPVT_WordRange m_wrSel;
+ CFX_WideString m_swText;
+};
+
+class CFXEU_ClearRich : public CFX_Edit_UndoItem
+{
+public:
+ CFXEU_ClearRich(CFX_Edit * pEdit, const CPVT_WordPlace & wpOldPlace, const CPVT_WordPlace & wpNewPlace,
+ const CPVT_WordRange & wrSel,
+ FX_WORD word, FX_INT32 charset,
+ const CPVT_SecProps & SecProps, const CPVT_WordProps & WordProps);
+ virtual ~CFXEU_ClearRich();
+
+ void Redo();
+ void Undo();
+
+private:
+ CFX_Edit * m_pEdit;
+
+ CPVT_WordPlace m_wpOld;
+ CPVT_WordPlace m_wpNew;
+ CPVT_WordRange m_wrSel;
+ FX_WORD m_Word;
+ FX_INT32 m_nCharset;
+ CPVT_SecProps m_SecProps;
+ CPVT_WordProps m_WordProps;
+};
+
+class CFXEU_InsertText : public CFX_Edit_UndoItem
+{
+public:
+ CFXEU_InsertText(CFX_Edit * pEdit, const CPVT_WordPlace & wpOldPlace, const CPVT_WordPlace & wpNewPlace,
+ const CFX_WideString & swText, FX_INT32 charset,
+ const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordProps);
+ virtual ~CFXEU_InsertText();
+
+ void Redo();
+ void Undo();
+
+private:
+ CFX_Edit * m_pEdit;
+
+ CPVT_WordPlace m_wpOld;
+ CPVT_WordPlace m_wpNew;
+ CFX_WideString m_swText;
+ FX_INT32 m_nCharset;
+ CPVT_SecProps m_SecProps;
+ CPVT_WordProps m_WordProps;
+};
+
+class CFXEU_SetSecProps : public CFX_Edit_UndoItem
+{
+public:
+ CFXEU_SetSecProps(CFX_Edit * pEdit, const CPVT_WordPlace & place, EDIT_PROPS_E ep,
+ const CPVT_SecProps & oldsecprops, const CPVT_WordProps & oldwordprops,
+ const CPVT_SecProps & newsecprops, const CPVT_WordProps & newwordprops, const CPVT_WordRange & range);
+ virtual ~CFXEU_SetSecProps();
+
+ void Redo();
+ void Undo();
+
+private:
+ CFX_Edit * m_pEdit;
+ CPVT_WordPlace m_wpPlace;
+ CPVT_WordRange m_wrPlace;
+ EDIT_PROPS_E m_eProps;
+
+ CPVT_SecProps m_OldSecProps;
+ CPVT_SecProps m_NewSecProps;
+ CPVT_WordProps m_OldWordProps;
+ CPVT_WordProps m_NewWordProps;
+};
+
+class CFXEU_SetWordProps : public CFX_Edit_UndoItem
+{
+public:
+ CFXEU_SetWordProps(CFX_Edit * pEdit, const CPVT_WordPlace & place, EDIT_PROPS_E ep,
+ const CPVT_WordProps & oldprops, const CPVT_WordProps & newprops, const CPVT_WordRange & range);
+ virtual ~CFXEU_SetWordProps();
+
+ void Redo();
+ void Undo();
+
+private:
+ CFX_Edit * m_pEdit;
+ CPVT_WordPlace m_wpPlace;
+ CPVT_WordRange m_wrPlace;
+ EDIT_PROPS_E m_eProps;
+
+ CPVT_WordProps m_OldWordProps;
+ CPVT_WordProps m_NewWordProps;
+};
+
+/* ------------------------- CFX_Edit ---------------------------- */
+
+class CFX_Edit : public IFX_Edit
+{
+ friend class CFX_Edit_Iterator;
+ friend class CFXEU_InsertWord;
+ friend class CFXEU_InsertReturn;
+ friend class CFXEU_Backspace;
+ friend class CFXEU_Delete;
+ friend class CFXEU_Clear;
+ friend class CFXEU_ClearRich;
+ friend class CFXEU_SetSecProps;
+ friend class CFXEU_SetWordProps;
+ friend class CFXEU_InsertText;
+
+public:
+ CFX_Edit(IPDF_VariableText * pVT);
+ virtual ~CFX_Edit();
+
+ void SetFontMap(IFX_Edit_FontMap * pFontMap);
+ void SetVTProvider(IPDF_VariableText_Provider* pProvider);
+ void SetNotify(IFX_Edit_Notify * pNotify);
+ void SetOprNotify(IFX_Edit_OprNotify* pOprNotify);
+ IFX_Edit_Iterator* GetIterator();
+ IPDF_VariableText * GetVariableText();
+ IFX_Edit_FontMap* GetFontMap();
+
+ void Initialize();
+ void SetPlateRect(const CPDF_Rect & rect, FX_BOOL bPaint = TRUE);
+ void SetScrollPos(const CPDF_Point & point);
+
+ void SetAlignmentH(FX_INT32 nFormat = 0, FX_BOOL bPaint = TRUE);
+ void SetAlignmentV(FX_INT32 nFormat = 0, FX_BOOL bPaint = TRUE);
+ void SetPasswordChar(FX_WORD wSubWord = '*', FX_BOOL bPaint = TRUE);
+ void SetLimitChar(FX_INT32 nLimitChar = 0, FX_BOOL bPaint = TRUE);
+ void SetCharArray(FX_INT32 nCharArray = 0, FX_BOOL bPaint = TRUE);
+ void SetCharSpace(FX_FLOAT fCharSpace = 0.0f, FX_BOOL bPaint = TRUE);
+ void SetHorzScale(FX_INT32 nHorzScale = 100, FX_BOOL bPaint = TRUE);
+ void SetLineLeading(FX_FLOAT fLineLeading, FX_BOOL bPaint = TRUE);
+ void SetMultiLine(FX_BOOL bMultiLine = TRUE, FX_BOOL bPaint = TRUE);
+ void SetAutoReturn(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE);
+ void SetAutoFontSize(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE);
+ void SetAutoScroll(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE);
+ void SetFontSize(FX_FLOAT fFontSize, FX_BOOL bPaint = TRUE);
+ void SetTextOverflow(FX_BOOL bAllowed = FALSE, FX_BOOL bPaint = TRUE);
+
+ FX_BOOL IsRichText() const;
+ void SetRichText(FX_BOOL bRichText = TRUE, FX_BOOL bPaint = TRUE);
+ FX_BOOL SetRichFontSize(FX_FLOAT fFontSize);
+ FX_BOOL SetRichFontIndex(FX_INT32 nFontIndex);
+ FX_BOOL SetRichTextColor(FX_COLORREF dwColor);
+ FX_BOOL SetRichTextScript(FX_INT32 nScriptType);
+ FX_BOOL SetRichTextBold(FX_BOOL bBold = TRUE);
+ FX_BOOL SetRichTextItalic(FX_BOOL bItalic = TRUE);
+ FX_BOOL SetRichTextUnderline(FX_BOOL bUnderline = TRUE);
+ FX_BOOL SetRichTextCrossout(FX_BOOL bCrossout = TRUE);
+ FX_BOOL SetRichTextCharSpace(FX_FLOAT fCharSpace);
+ FX_BOOL SetRichTextHorzScale(FX_INT32 nHorzScale = 100);
+ FX_BOOL SetRichTextLineLeading(FX_FLOAT fLineLeading);
+ FX_BOOL SetRichTextLineIndent(FX_FLOAT fLineIndent);
+ FX_BOOL SetRichTextAlignment(FX_INT32 nAlignment);
+
+ void OnMouseDown(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl);
+ void OnMouseMove(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl);
+ void OnVK_UP(FX_BOOL bShift,FX_BOOL bCtrl);
+ void OnVK_DOWN(FX_BOOL bShift,FX_BOOL bCtrl);
+ void OnVK_LEFT(FX_BOOL bShift,FX_BOOL bCtrl);
+ void OnVK_RIGHT(FX_BOOL bShift,FX_BOOL bCtrl);
+ void OnVK_HOME(FX_BOOL bShift,FX_BOOL bCtrl);
+ void OnVK_END(FX_BOOL bShift,FX_BOOL bCtrl);
+
+ void SetText(FX_LPCWSTR text,FX_INT32 charset = DEFAULT_CHARSET,
+ const CPVT_SecProps * pSecProps = NULL,const CPVT_WordProps * pWordProps = NULL);
+ FX_BOOL InsertWord(FX_WORD word, FX_INT32 charset = DEFAULT_CHARSET, const CPVT_WordProps * pWordProps = NULL);
+ FX_BOOL InsertReturn(const CPVT_SecProps * pSecProps = NULL,const CPVT_WordProps * pWordProps = NULL);
+ FX_BOOL Backspace();
+ FX_BOOL Delete();
+ FX_BOOL Clear();
+ FX_BOOL Empty();
+ FX_BOOL InsertText(FX_LPCWSTR text, FX_INT32 charset = DEFAULT_CHARSET,
+ const CPVT_SecProps * pSecProps = NULL,const CPVT_WordProps * pWordProps = NULL);
+ FX_BOOL Redo();
+ FX_BOOL Undo();
+ CPVT_WordPlace DoInsertText(const CPVT_WordPlace& place, FX_LPCWSTR text, FX_INT32 charset,
+ const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordProps);
+ FX_INT32 GetCharSetFromUnicode(FX_WORD word, FX_INT32 nOldCharset);
+
+ FX_INT32 WordPlaceToWordIndex(const CPVT_WordPlace & place) const;
+ CPVT_WordPlace WordIndexToWordPlace(FX_INT32 index) const;
+
+ CPVT_WordPlace GetLineBeginPlace(const CPVT_WordPlace & place) const;
+ CPVT_WordPlace GetLineEndPlace(const CPVT_WordPlace & place) const;
+ CPVT_WordPlace GetSectionBeginPlace(const CPVT_WordPlace & place) const;
+ CPVT_WordPlace GetSectionEndPlace(const CPVT_WordPlace & place) const;
+ CPVT_WordPlace SearchWordPlace(const CPDF_Point& point) const;
+
+ FX_INT32 GetCaret() const;
+ CPVT_WordPlace GetCaretWordPlace() const;
+ CFX_WideString GetSelText() const;
+ CFX_WideString GetText() const;
+ FX_FLOAT GetFontSize() const;
+ FX_WORD GetPasswordChar() const;
+ CPDF_Point GetScrollPos() const;
+ FX_INT32 GetCharArray() const;
+ CPDF_Rect GetPlateRect() const;
+ CPDF_Rect GetContentRect() const;
+ CFX_WideString GetRangeText(const CPVT_WordRange & range) const;
+ FX_INT32 GetHorzScale() const;
+ FX_FLOAT GetCharSpace() const;
+ FX_INT32 GetTotalWords() const;
+ FX_INT32 GetTotalLines() const;
+
+ void SetSel(FX_INT32 nStartChar,FX_INT32 nEndChar);
+ void GetSel(FX_INT32 & nStartChar, FX_INT32 & nEndChar) const;
+
+private:
+ void SelectAll();
+ void SelectNone();
+ void SetSel(const CPVT_WordPlace & begin,const CPVT_WordPlace & end);
+ FX_BOOL IsSelected() const;
+
+ void RearrangeAll();
+ void RearrangePart(const CPVT_WordRange & range);
+ void Paint();
+ void ScrollToCaret();
+ void SetScrollInfo();
+ void SetScrollPosX(FX_FLOAT fx);
+ void SetScrollPosY(FX_FLOAT fy);
+ void SetScrollLimit();
+ void SetContentChanged();
+ void EnableNotify(FX_BOOL bNotify);
+
+ void SetText(FX_LPCWSTR text,FX_INT32 charset,
+ const CPVT_SecProps * pSecProps,const CPVT_WordProps * pWordProps,FX_BOOL bAddUndo, FX_BOOL bPaint);
+ FX_BOOL InsertWord(FX_WORD word, FX_INT32 charset, const CPVT_WordProps * pWordProps,FX_BOOL bAddUndo, FX_BOOL bPaint);
+ FX_BOOL InsertReturn(const CPVT_SecProps * pSecProps,const CPVT_WordProps * pWordProps,FX_BOOL bAddUndo, FX_BOOL bPaint);
+ FX_BOOL Backspace(FX_BOOL bAddUndo, FX_BOOL bPaint);
+ FX_BOOL Delete(FX_BOOL bAddUndo, FX_BOOL bPaint);
+ FX_BOOL Clear(FX_BOOL bAddUndo, FX_BOOL bPaint);
+ FX_BOOL InsertText(FX_LPCWSTR text, FX_INT32 charset,
+ const CPVT_SecProps * pSecProps,const CPVT_WordProps * pWordProps,FX_BOOL bAddUndo, FX_BOOL bPaint);
+ FX_BOOL SetRichTextProps(EDIT_PROPS_E eProps,
+ const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordProps);
+ FX_BOOL SetSecProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place,
+ const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordProps, const CPVT_WordRange & wr, FX_BOOL bAddUndo);
+ FX_BOOL SetWordProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place,
+ const CPVT_WordProps * pWordProps, const CPVT_WordRange & wr, FX_BOOL bAddUndo);
+ void PaintSetProps(EDIT_PROPS_E eProps, const CPVT_WordRange & wr);
+ void PaintInsertText(const CPVT_WordPlace & wpOld, const CPVT_WordPlace & wpNew);
+
+ inline CPDF_Point VTToEdit(const CPDF_Point & point) const;
+ inline CPDF_Point EditToVT(const CPDF_Point & point) const;
+ inline CPDF_Rect VTToEdit(const CPDF_Rect & rect) const;
+ inline CPDF_Rect EditToVT(const CPDF_Rect & rect) const;
+
+ void EnableRefresh(FX_BOOL bRefresh);
+ void Refresh(REFRESH_PLAN_E ePlan,const CPVT_WordRange * pRange1 = NULL,const CPVT_WordRange * pRange2 = NULL);
+ void RefreshPushLineRects(const CPVT_WordRange & wr);
+ void RefreshPushRandomRects(const CPVT_WordRange & wr);
+ void RefreshWordRange(const CPVT_WordRange& wr);
+
+ void SetCaret(FX_INT32 nPos);
+ void SetCaret(const CPVT_WordPlace & place);
+ void SetCaretInfo();
+ void SetCaretOrigin();
+ void SetCaretChange();
+
+ CPVT_WordRange GetWholeWordRange() const;
+ CPVT_WordRange GetVisibleWordRange() const;
+ CPVT_WordRange GetLatinWordsRange(const CPVT_WordPlace & place) const;
+ CPVT_WordRange CombineWordRange(const CPVT_WordRange & wr1, const CPVT_WordRange & wr2);
+ CPVT_WordRange GetSelectWordRange() const;
+
+ void EnableUndo(FX_BOOL bUndo);
+ void EnableOprNotify(FX_BOOL bNotify);
+
+ FX_BOOL IsTextFull() const;
+ FX_BOOL IsTextOverflow() const;
+ FX_BOOL CanUndo() const;
+ FX_BOOL CanRedo() const;
+ FX_BOOL IsModified() const;
+
+ void BeginGroupUndo(const CFX_WideString& sTitle);
+ void EndGroupUndo();
+ void AddEditUndoItem(CFX_Edit_UndoItem* pEditUndoItem);
+ void AddUndoItem(IFX_Edit_UndoItem* pUndoItem);
+
+ void SetPageInfo(const CPVT_WordPlace& place);
+ CPVT_WordPlace SearchPageEndPlace(const CPVT_WordPlace& wpPageBegin, const CPDF_Point& point) const;
+ FX_FLOAT GetLineTop(const CPVT_WordPlace& place) const;
+ FX_FLOAT GetLineBottom(const CPVT_WordPlace& place) const;
+
+private:
+ IPDF_VariableText* m_pVT;
+ IFX_Edit_Notify* m_pNotify;
+ IFX_Edit_OprNotify* m_pOprNotify;
+ CFX_Edit_Provider* m_pVTProvide;
+
+ CPVT_WordPlace m_wpCaret;
+ CPVT_WordPlace m_wpOldCaret;
+ CFX_Edit_Select m_SelState;
+
+ CPDF_Point m_ptScrollPos;
+ CPDF_Point m_ptRefreshScrollPos;
+ FX_BOOL m_bEnableScroll;
+ IFX_Edit_Iterator * m_pIterator;
+ CFX_Edit_Refresh m_Refresh;
+ CPDF_Point m_ptCaret;
+ CFX_Edit_Undo m_Undo;
+ FX_INT32 m_nAlignment;
+ FX_BOOL m_bNotifyFlag;
+ FX_BOOL m_bTextFullFlag;
+ FX_BOOL m_bEnableOverflow;
+ FX_BOOL m_bEnableRefresh;
+ CPDF_Rect m_rcOldContent;
+ FX_BOOL m_bEnableUndo;
+ FX_BOOL m_bNotify;
+ FX_BOOL m_bOprNotify;
+ CFX_Edit_GroupUndoItem* m_pGroupUndoItem;
+};
+
+/* ------------------------- CFX_Edit_Iterator ---------------------------- */
+
+class CFX_Edit_Iterator : public IFX_Edit_Iterator
+{
+public:
+ CFX_Edit_Iterator(CFX_Edit * pEdit,IPDF_VariableText_Iterator * pVTIterator);
+ virtual ~CFX_Edit_Iterator();
+
+ FX_BOOL NextWord();
+ FX_BOOL NextLine();
+ FX_BOOL NextSection();
+ FX_BOOL PrevWord();
+ FX_BOOL PrevLine();
+ FX_BOOL PrevSection();
+
+ FX_BOOL GetWord(CPVT_Word & word) const;
+ FX_BOOL GetLine(CPVT_Line & line) const;
+ FX_BOOL GetSection(CPVT_Section & section) const;
+ void SetAt(FX_INT32 nWordIndex);
+ void SetAt(const CPVT_WordPlace & place);
+ const CPVT_WordPlace & GetAt() const;
+ IFX_Edit* GetEdit() const;
+
+private:
+ CFX_Edit * m_pEdit;
+ IPDF_VariableText_Iterator* m_pVTIterator;
+};
+
+class CFX_Edit_Provider : public IPDF_VariableText_Provider
+{
+public:
+ CFX_Edit_Provider(IFX_Edit_FontMap* pFontMap);
+ virtual ~CFX_Edit_Provider();
+
+ IFX_Edit_FontMap* GetFontMap();
+
+ FX_INT32 GetCharWidth(FX_INT32 nFontIndex, FX_WORD word, FX_INT32 nWordStyle);
+ FX_INT32 GetTypeAscent(FX_INT32 nFontIndex);
+ FX_INT32 GetTypeDescent(FX_INT32 nFontIndex);
+ FX_INT32 GetWordFontIndex(FX_WORD word, FX_INT32 charset, FX_INT32 nFontIndex);
+ FX_INT32 GetDefaultFontIndex();
+ FX_BOOL IsLatinWord(FX_WORD word);
+
+private:
+ IFX_Edit_FontMap* m_pFontMap;
+};
+
+#endif //_FXET_EDIT_H_
+
diff --git a/fpdfsdk/include/fxedit/fxet_list.h b/fpdfsdk/include/fxedit/fxet_list.h
index d77be86be4..1157bbec3b 100644
--- a/fpdfsdk/include/fxedit/fxet_list.h
+++ b/fpdfsdk/include/fxedit/fxet_list.h
@@ -1,363 +1,363 @@
-// 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 _FXET_LIST_H_
-#define _FXET_LIST_H_
-
-#include "fx_edit.h"
-
-class IFX_Edit;
-
-class CLST_Size
-{
-public:
- CLST_Size() : x(0.0f), y(0.0f)
- {
- }
-
- CLST_Size(FX_FLOAT x,FX_FLOAT y)
- {
- this->x = x;
- this->y = y;
- }
-
- void Default()
- {
- x = 0.0f;
- y = 0.0f;
- }
-
- FX_BOOL operator != (const CLST_Size & size) const
- {
- return FXSYS_memcmp(this, &size, sizeof(CLST_Size)) != 0;
- }
-
- FX_FLOAT x,y;
-};
-
-class CLST_Rect : public CPDF_Rect
-{
-public:
- CLST_Rect()
- {
- left = top = right = bottom = 0.0f;
- }
-
- CLST_Rect(FX_FLOAT left,FX_FLOAT top,
- FX_FLOAT right,FX_FLOAT bottom)
- {
- this->left = left;
- this->top = top;
- this->right = right;
- this->bottom = bottom;
- }
-
- CLST_Rect(const CPDF_Rect & rect)
- {
- this->left = rect.left;
- this->top = rect.top;
- this->right = rect.right;
- this->bottom = rect.bottom;
- }
-
- void Default()
- {
- left = top = right = bottom = 0.0f;
- }
-
- const CLST_Rect operator = (const CPDF_Rect & rect)
- {
- this->left = rect.left;
- this->top = rect.top;
- this->right = rect.right;
- this->bottom = rect.bottom;
-
- return *this;
- }
-
- FX_BOOL operator == (const CLST_Rect & rect) const
- {
- return FXSYS_memcmp(this, &rect, sizeof(CLST_Rect)) == 0;
- }
-
- FX_BOOL operator != (const CLST_Rect & rect) const
- {
- return FXSYS_memcmp(this, &rect, sizeof(CLST_Rect)) != 0;
- }
-
- FX_FLOAT Width() const
- {
- return this->right - this->left;
- }
-
- FX_FLOAT Height() const
- {
- if (this->top > this->bottom)
- return this->top - this->bottom;
- else
- return this->bottom - this->top;
- }
-
- CPDF_Point LeftTop() const
- {
- return CPDF_Point(left,top);
- }
-
- CPDF_Point RightBottom() const
- {
- return CPDF_Point(right,bottom);
- }
-
- const CLST_Rect operator += (const CPDF_Point & point)
- {
- this->left += point.x;
- this->right += point.x;
- this->top += point.y;
- this->bottom += point.y;
-
- return *this;
- }
-
- const CLST_Rect operator -= (const CPDF_Point & point)
- {
- this->left -= point.x;
- this->right -= point.x;
- this->top -= point.y;
- this->bottom -= point.y;
-
- return *this;
- }
-
- CLST_Rect operator + (const CPDF_Point & point) const
- {
- return CLST_Rect(left + point.x,
- top + point.y,
- right + point.x,
- bottom + point.y);
- }
-
- CLST_Rect operator - (const CPDF_Point & point) const
- {
- return CLST_Rect(left - point.x,
- top - point.y,
- right - point.x,
- bottom - point.y);
- }
-};
-
-class CFX_ListItem
-{
-public:
- CFX_ListItem();
- virtual ~CFX_ListItem();
-
- void SetFontMap(IFX_Edit_FontMap * pFontMap);
- IFX_Edit_Iterator* GetIterator() const;
- IFX_Edit* GetEdit() const;
-
-public:
- void SetRect(const CLST_Rect & rect);
- void SetSelect(FX_BOOL bSelected);
- void SetCaret(FX_BOOL bCaret);
- void SetText(FX_LPCWSTR text);
- void SetFontSize(FX_FLOAT fFontSize);
- CFX_WideString GetText() const;
-
- CLST_Rect GetRect() const;
- FX_BOOL IsSelected() const;
- FX_BOOL IsCaret() const;
- FX_FLOAT GetItemHeight() const;
- FX_WORD GetFirstChar() const;
-
-private:
- IFX_Edit* m_pEdit;
- FX_BOOL m_bSelected; //ÊÇ·ñÑ¡ÖÐ
- FX_BOOL m_bCaret; //ÊÇ·ñΪ½¹µã£¬¶àѡʱÓÃ
- CLST_Rect m_rcListItem; //ÄÚ²¿×ø±ê
-};
-
-class CFX_ListContainer
-{
-public:
- CFX_ListContainer() : m_rcPlate(0.0f,0.0f,0.0f,0.0f), m_rcContent(0.0f,0.0f,0.0f,0.0f){}
- virtual ~CFX_ListContainer(){}
- virtual void SetPlateRect(const CPDF_Rect & rect){m_rcPlate = rect;}
- CPDF_Rect GetPlateRect() const{return m_rcPlate;}
- void SetContentRect(const CLST_Rect & rect){m_rcContent = rect;}
- CLST_Rect GetContentRect() const{return m_rcContent;}
- CPDF_Point GetBTPoint() const{return CPDF_Point(m_rcPlate.left,m_rcPlate.top);}
- CPDF_Point GetETPoint() const{return CPDF_Point(m_rcPlate.right,m_rcPlate.bottom);}
-public:
- CPDF_Point InnerToOuter(const CPDF_Point & point) const{return CPDF_Point(point.x + GetBTPoint().x,GetBTPoint().y - point.y);}
- CPDF_Point OuterToInner(const CPDF_Point & point) const{return CPDF_Point(point.x - GetBTPoint().x,GetBTPoint().y - point.y);}
- CPDF_Rect InnerToOuter(const CLST_Rect & rect) const{CPDF_Point ptLeftTop = InnerToOuter(CPDF_Point(rect.left,rect.top));
- CPDF_Point ptRightBottom = InnerToOuter(CPDF_Point(rect.right,rect.bottom));
- return CPDF_Rect(ptLeftTop.x,ptRightBottom.y,ptRightBottom.x,ptLeftTop.y);}
- CLST_Rect OuterToInner(const CPDF_Rect & rect) const{CPDF_Point ptLeftTop = OuterToInner(CPDF_Point(rect.left,rect.top));
- CPDF_Point ptRightBottom = OuterToInner(CPDF_Point(rect.right,rect.bottom));
- return CLST_Rect(ptLeftTop.x,ptLeftTop.y,ptRightBottom.x,ptRightBottom.y);}
-private:
- CPDF_Rect m_rcPlate;
- CLST_Rect m_rcContent; //positive forever!
-};
-
-template<class TYPE> class CLST_ArrayTemplate : public CFX_ArrayTemplate<TYPE>
-{
-public:
- FX_BOOL IsEmpty() { return CFX_ArrayTemplate<TYPE>::GetSize() <= 0; }
- TYPE GetAt(FX_INT32 nIndex) const { if (nIndex >= 0 && nIndex < CFX_ArrayTemplate<TYPE>::GetSize()) return CFX_ArrayTemplate<TYPE>::GetAt(nIndex); return NULL;}
- void RemoveAt(FX_INT32 nIndex){if (nIndex >= 0 && nIndex < CFX_ArrayTemplate<TYPE>::GetSize()) CFX_ArrayTemplate<TYPE>::RemoveAt(nIndex);}
-};
-
-class CFX_List : protected CFX_ListContainer , public IFX_List
-{
-public:
- CFX_List();
- virtual ~CFX_List();
-
-public:
- virtual void SetFontMap(IFX_Edit_FontMap * pFontMap);
- virtual void SetFontSize(FX_FLOAT fFontSize);
-
- virtual CPDF_Rect GetPlateRect() const;
- virtual CPDF_Rect GetContentRect() const;
-
- virtual FX_FLOAT GetFontSize() const;
- virtual IFX_Edit* GetItemEdit(FX_INT32 nIndex) const;
- virtual FX_INT32 GetCount() const;
- virtual FX_BOOL IsItemSelected(FX_INT32 nIndex) const;
- virtual FX_FLOAT GetFirstHeight() const;
-
- virtual void SetMultipleSel(FX_BOOL bMultiple);
- virtual FX_BOOL IsMultipleSel() const;
- virtual FX_BOOL IsValid(FX_INT32 nItemIndex) const;
- virtual FX_INT32 FindNext(FX_INT32 nIndex,FX_WCHAR nChar) const;
-
-protected:
- virtual void Empty();
-
- void AddItem(FX_LPCWSTR str);
- virtual void ReArrange(FX_INT32 nItemIndex);
-
- virtual CPDF_Rect GetItemRect(FX_INT32 nIndex) const;
- CFX_WideString GetItemText(FX_INT32 nIndex) const;
-
- void SetItemSelect(FX_INT32 nItemIndex, FX_BOOL bSelected);
- void SetItemCaret(FX_INT32 nItemIndex, FX_BOOL bCaret);
-
- virtual FX_INT32 GetItemIndex(const CPDF_Point & point) const;
- FX_INT32 GetFirstSelected() const;
- FX_INT32 GetLastSelected() const;
- FX_WCHAR Toupper(FX_WCHAR c) const;
-
-private:
- CLST_ArrayTemplate<CFX_ListItem*> m_aListItems;
- FX_FLOAT m_fFontSize;
- IFX_Edit_FontMap* m_pFontMap;
- FX_BOOL m_bMultiple;
-};
-
-struct CPLST_Select_Item
-{
- CPLST_Select_Item(FX_INT32 nItemIndex,FX_INT32 nState)
- {
- this->nItemIndex = nItemIndex;
- this->nState = nState;
- }
-
- FX_INT32 nItemIndex;
- FX_INT32 nState; //0:normal select -1:to deselect 1: to select
-};
-
-class CPLST_Select
-{
-public:
- CPLST_Select();
- virtual ~CPLST_Select();
-
-public:
- void Add(FX_INT32 nItemIndex);
- void Add(FX_INT32 nBeginIndex, FX_INT32 nEndIndex);
- void Sub(FX_INT32 nItemIndex);
- void Sub(FX_INT32 nBeginIndex, FX_INT32 nEndIndex);
- FX_BOOL IsExist(FX_INT32 nItemIndex) const;
- FX_INT32 Find(FX_INT32 nItemIndex) const;
- FX_INT32 GetCount() const;
- FX_INT32 GetItemIndex(FX_INT32 nIndex) const;
- FX_INT32 GetState(FX_INT32 nIndex) const;
- void Done();
- void DeselectAll();
-
-private:
- CFX_ArrayTemplate<CPLST_Select_Item*> m_aItems;
-};
-
-class CFX_ListCtrl : public CFX_List
-{
-public:
- CFX_ListCtrl();
- virtual ~CFX_ListCtrl();
-
-public:
- void SetNotify(IFX_List_Notify * pNotify);
-
- void OnMouseDown(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl);
- void OnMouseMove(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl);
- void OnVK_UP(FX_BOOL bShift,FX_BOOL bCtrl);
- void OnVK_DOWN(FX_BOOL bShift,FX_BOOL bCtrl);
- void OnVK_LEFT(FX_BOOL bShift,FX_BOOL bCtrl);
- void OnVK_RIGHT(FX_BOOL bShift,FX_BOOL bCtrl);
- void OnVK_HOME(FX_BOOL bShift,FX_BOOL bCtrl);
- void OnVK_END(FX_BOOL bShift,FX_BOOL bCtrl);
- void OnVK(FX_INT32 nItemIndex,FX_BOOL bShift,FX_BOOL bCtrl);
- FX_BOOL OnChar(FX_WORD nChar,FX_BOOL bShift,FX_BOOL bCtrl);
-
- virtual CPDF_Point InToOut(const CPDF_Point & point) const;
- virtual CPDF_Point OutToIn(const CPDF_Point & point) const;
- virtual CPDF_Rect InToOut(const CPDF_Rect & rect) const;
- virtual CPDF_Rect OutToIn(const CPDF_Rect & rect) const;
-
- virtual void SetPlateRect(const CPDF_Rect & rect);
- void SetScrollPos(const CPDF_Point & point);
- void ScrollToListItem(FX_INT32 nItemIndex);
- virtual CPDF_Rect GetItemRect(FX_INT32 nIndex) const;
- FX_INT32 GetCaret() const {return m_nCaretIndex;}
- FX_INT32 GetSelect() const {return m_nSelItem;}
- FX_INT32 GetTopItem() const;
- virtual CPDF_Rect GetContentRect() const;
- virtual FX_INT32 GetItemIndex(const CPDF_Point & point) const;
-
- void AddString(FX_LPCWSTR string);
- void SetTopItem(FX_INT32 nIndex);
- void Select(FX_INT32 nItemIndex);
- virtual void SetCaret(FX_INT32 nItemIndex);
- virtual void Empty();
- virtual void Cancel();
- CFX_WideString GetText() const;
-
-private:
- void SetMultipleSelect(FX_INT32 nItemIndex, FX_BOOL bSelected);
- void SetSingleSelect(FX_INT32 nItemIndex);
- void InvalidateItem(FX_INT32 nItemIndex);
- void SelectItems();
- FX_BOOL IsItemVisible(FX_INT32 nItemIndex) const;
- void SetScrollInfo();
- void SetScrollPosY(FX_FLOAT fy);
- virtual void ReArrange(FX_INT32 nItemIndex);
-
-private:
- IFX_List_Notify* m_pNotify;
- FX_BOOL m_bNotifyFlag;
- CPDF_Point m_ptScrollPos;
- CPLST_Select m_aSelItems; //for multiple
- FX_INT32 m_nSelItem; //for single
- FX_INT32 m_nFootIndex; //for multiple
- FX_BOOL m_bCtrlSel; //for multiple
- FX_INT32 m_nCaretIndex; //for multiple
-};
-
-#endif
-
+// 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 _FXET_LIST_H_
+#define _FXET_LIST_H_
+
+#include "fx_edit.h"
+
+class IFX_Edit;
+
+class CLST_Size
+{
+public:
+ CLST_Size() : x(0.0f), y(0.0f)
+ {
+ }
+
+ CLST_Size(FX_FLOAT x,FX_FLOAT y)
+ {
+ this->x = x;
+ this->y = y;
+ }
+
+ void Default()
+ {
+ x = 0.0f;
+ y = 0.0f;
+ }
+
+ FX_BOOL operator != (const CLST_Size & size) const
+ {
+ return FXSYS_memcmp(this, &size, sizeof(CLST_Size)) != 0;
+ }
+
+ FX_FLOAT x,y;
+};
+
+class CLST_Rect : public CPDF_Rect
+{
+public:
+ CLST_Rect()
+ {
+ left = top = right = bottom = 0.0f;
+ }
+
+ CLST_Rect(FX_FLOAT left,FX_FLOAT top,
+ FX_FLOAT right,FX_FLOAT bottom)
+ {
+ this->left = left;
+ this->top = top;
+ this->right = right;
+ this->bottom = bottom;
+ }
+
+ CLST_Rect(const CPDF_Rect & rect)
+ {
+ this->left = rect.left;
+ this->top = rect.top;
+ this->right = rect.right;
+ this->bottom = rect.bottom;
+ }
+
+ void Default()
+ {
+ left = top = right = bottom = 0.0f;
+ }
+
+ const CLST_Rect operator = (const CPDF_Rect & rect)
+ {
+ this->left = rect.left;
+ this->top = rect.top;
+ this->right = rect.right;
+ this->bottom = rect.bottom;
+
+ return *this;
+ }
+
+ FX_BOOL operator == (const CLST_Rect & rect) const
+ {
+ return FXSYS_memcmp(this, &rect, sizeof(CLST_Rect)) == 0;
+ }
+
+ FX_BOOL operator != (const CLST_Rect & rect) const
+ {
+ return FXSYS_memcmp(this, &rect, sizeof(CLST_Rect)) != 0;
+ }
+
+ FX_FLOAT Width() const
+ {
+ return this->right - this->left;
+ }
+
+ FX_FLOAT Height() const
+ {
+ if (this->top > this->bottom)
+ return this->top - this->bottom;
+ else
+ return this->bottom - this->top;
+ }
+
+ CPDF_Point LeftTop() const
+ {
+ return CPDF_Point(left,top);
+ }
+
+ CPDF_Point RightBottom() const
+ {
+ return CPDF_Point(right,bottom);
+ }
+
+ const CLST_Rect operator += (const CPDF_Point & point)
+ {
+ this->left += point.x;
+ this->right += point.x;
+ this->top += point.y;
+ this->bottom += point.y;
+
+ return *this;
+ }
+
+ const CLST_Rect operator -= (const CPDF_Point & point)
+ {
+ this->left -= point.x;
+ this->right -= point.x;
+ this->top -= point.y;
+ this->bottom -= point.y;
+
+ return *this;
+ }
+
+ CLST_Rect operator + (const CPDF_Point & point) const
+ {
+ return CLST_Rect(left + point.x,
+ top + point.y,
+ right + point.x,
+ bottom + point.y);
+ }
+
+ CLST_Rect operator - (const CPDF_Point & point) const
+ {
+ return CLST_Rect(left - point.x,
+ top - point.y,
+ right - point.x,
+ bottom - point.y);
+ }
+};
+
+class CFX_ListItem
+{
+public:
+ CFX_ListItem();
+ virtual ~CFX_ListItem();
+
+ void SetFontMap(IFX_Edit_FontMap * pFontMap);
+ IFX_Edit_Iterator* GetIterator() const;
+ IFX_Edit* GetEdit() const;
+
+public:
+ void SetRect(const CLST_Rect & rect);
+ void SetSelect(FX_BOOL bSelected);
+ void SetCaret(FX_BOOL bCaret);
+ void SetText(FX_LPCWSTR text);
+ void SetFontSize(FX_FLOAT fFontSize);
+ CFX_WideString GetText() const;
+
+ CLST_Rect GetRect() const;
+ FX_BOOL IsSelected() const;
+ FX_BOOL IsCaret() const;
+ FX_FLOAT GetItemHeight() const;
+ FX_WORD GetFirstChar() const;
+
+private:
+ IFX_Edit* m_pEdit;
+ FX_BOOL m_bSelected; //ÊÇ·ñÑ¡ÖÐ
+ FX_BOOL m_bCaret; //ÊÇ·ñΪ½¹µã£¬¶àѡʱÓÃ
+ CLST_Rect m_rcListItem; //ÄÚ²¿×ø±ê
+};
+
+class CFX_ListContainer
+{
+public:
+ CFX_ListContainer() : m_rcPlate(0.0f,0.0f,0.0f,0.0f), m_rcContent(0.0f,0.0f,0.0f,0.0f){}
+ virtual ~CFX_ListContainer(){}
+ virtual void SetPlateRect(const CPDF_Rect & rect){m_rcPlate = rect;}
+ CPDF_Rect GetPlateRect() const{return m_rcPlate;}
+ void SetContentRect(const CLST_Rect & rect){m_rcContent = rect;}
+ CLST_Rect GetContentRect() const{return m_rcContent;}
+ CPDF_Point GetBTPoint() const{return CPDF_Point(m_rcPlate.left,m_rcPlate.top);}
+ CPDF_Point GetETPoint() const{return CPDF_Point(m_rcPlate.right,m_rcPlate.bottom);}
+public:
+ CPDF_Point InnerToOuter(const CPDF_Point & point) const{return CPDF_Point(point.x + GetBTPoint().x,GetBTPoint().y - point.y);}
+ CPDF_Point OuterToInner(const CPDF_Point & point) const{return CPDF_Point(point.x - GetBTPoint().x,GetBTPoint().y - point.y);}
+ CPDF_Rect InnerToOuter(const CLST_Rect & rect) const{CPDF_Point ptLeftTop = InnerToOuter(CPDF_Point(rect.left,rect.top));
+ CPDF_Point ptRightBottom = InnerToOuter(CPDF_Point(rect.right,rect.bottom));
+ return CPDF_Rect(ptLeftTop.x,ptRightBottom.y,ptRightBottom.x,ptLeftTop.y);}
+ CLST_Rect OuterToInner(const CPDF_Rect & rect) const{CPDF_Point ptLeftTop = OuterToInner(CPDF_Point(rect.left,rect.top));
+ CPDF_Point ptRightBottom = OuterToInner(CPDF_Point(rect.right,rect.bottom));
+ return CLST_Rect(ptLeftTop.x,ptLeftTop.y,ptRightBottom.x,ptRightBottom.y);}
+private:
+ CPDF_Rect m_rcPlate;
+ CLST_Rect m_rcContent; //positive forever!
+};
+
+template<class TYPE> class CLST_ArrayTemplate : public CFX_ArrayTemplate<TYPE>
+{
+public:
+ FX_BOOL IsEmpty() { return CFX_ArrayTemplate<TYPE>::GetSize() <= 0; }
+ TYPE GetAt(FX_INT32 nIndex) const { if (nIndex >= 0 && nIndex < CFX_ArrayTemplate<TYPE>::GetSize()) return CFX_ArrayTemplate<TYPE>::GetAt(nIndex); return NULL;}
+ void RemoveAt(FX_INT32 nIndex){if (nIndex >= 0 && nIndex < CFX_ArrayTemplate<TYPE>::GetSize()) CFX_ArrayTemplate<TYPE>::RemoveAt(nIndex);}
+};
+
+class CFX_List : protected CFX_ListContainer , public IFX_List
+{
+public:
+ CFX_List();
+ virtual ~CFX_List();
+
+public:
+ virtual void SetFontMap(IFX_Edit_FontMap * pFontMap);
+ virtual void SetFontSize(FX_FLOAT fFontSize);
+
+ virtual CPDF_Rect GetPlateRect() const;
+ virtual CPDF_Rect GetContentRect() const;
+
+ virtual FX_FLOAT GetFontSize() const;
+ virtual IFX_Edit* GetItemEdit(FX_INT32 nIndex) const;
+ virtual FX_INT32 GetCount() const;
+ virtual FX_BOOL IsItemSelected(FX_INT32 nIndex) const;
+ virtual FX_FLOAT GetFirstHeight() const;
+
+ virtual void SetMultipleSel(FX_BOOL bMultiple);
+ virtual FX_BOOL IsMultipleSel() const;
+ virtual FX_BOOL IsValid(FX_INT32 nItemIndex) const;
+ virtual FX_INT32 FindNext(FX_INT32 nIndex,FX_WCHAR nChar) const;
+
+protected:
+ virtual void Empty();
+
+ void AddItem(FX_LPCWSTR str);
+ virtual void ReArrange(FX_INT32 nItemIndex);
+
+ virtual CPDF_Rect GetItemRect(FX_INT32 nIndex) const;
+ CFX_WideString GetItemText(FX_INT32 nIndex) const;
+
+ void SetItemSelect(FX_INT32 nItemIndex, FX_BOOL bSelected);
+ void SetItemCaret(FX_INT32 nItemIndex, FX_BOOL bCaret);
+
+ virtual FX_INT32 GetItemIndex(const CPDF_Point & point) const;
+ FX_INT32 GetFirstSelected() const;
+ FX_INT32 GetLastSelected() const;
+ FX_WCHAR Toupper(FX_WCHAR c) const;
+
+private:
+ CLST_ArrayTemplate<CFX_ListItem*> m_aListItems;
+ FX_FLOAT m_fFontSize;
+ IFX_Edit_FontMap* m_pFontMap;
+ FX_BOOL m_bMultiple;
+};
+
+struct CPLST_Select_Item
+{
+ CPLST_Select_Item(FX_INT32 nItemIndex,FX_INT32 nState)
+ {
+ this->nItemIndex = nItemIndex;
+ this->nState = nState;
+ }
+
+ FX_INT32 nItemIndex;
+ FX_INT32 nState; //0:normal select -1:to deselect 1: to select
+};
+
+class CPLST_Select
+{
+public:
+ CPLST_Select();
+ virtual ~CPLST_Select();
+
+public:
+ void Add(FX_INT32 nItemIndex);
+ void Add(FX_INT32 nBeginIndex, FX_INT32 nEndIndex);
+ void Sub(FX_INT32 nItemIndex);
+ void Sub(FX_INT32 nBeginIndex, FX_INT32 nEndIndex);
+ FX_BOOL IsExist(FX_INT32 nItemIndex) const;
+ FX_INT32 Find(FX_INT32 nItemIndex) const;
+ FX_INT32 GetCount() const;
+ FX_INT32 GetItemIndex(FX_INT32 nIndex) const;
+ FX_INT32 GetState(FX_INT32 nIndex) const;
+ void Done();
+ void DeselectAll();
+
+private:
+ CFX_ArrayTemplate<CPLST_Select_Item*> m_aItems;
+};
+
+class CFX_ListCtrl : public CFX_List
+{
+public:
+ CFX_ListCtrl();
+ virtual ~CFX_ListCtrl();
+
+public:
+ void SetNotify(IFX_List_Notify * pNotify);
+
+ void OnMouseDown(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl);
+ void OnMouseMove(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl);
+ void OnVK_UP(FX_BOOL bShift,FX_BOOL bCtrl);
+ void OnVK_DOWN(FX_BOOL bShift,FX_BOOL bCtrl);
+ void OnVK_LEFT(FX_BOOL bShift,FX_BOOL bCtrl);
+ void OnVK_RIGHT(FX_BOOL bShift,FX_BOOL bCtrl);
+ void OnVK_HOME(FX_BOOL bShift,FX_BOOL bCtrl);
+ void OnVK_END(FX_BOOL bShift,FX_BOOL bCtrl);
+ void OnVK(FX_INT32 nItemIndex,FX_BOOL bShift,FX_BOOL bCtrl);
+ FX_BOOL OnChar(FX_WORD nChar,FX_BOOL bShift,FX_BOOL bCtrl);
+
+ virtual CPDF_Point InToOut(const CPDF_Point & point) const;
+ virtual CPDF_Point OutToIn(const CPDF_Point & point) const;
+ virtual CPDF_Rect InToOut(const CPDF_Rect & rect) const;
+ virtual CPDF_Rect OutToIn(const CPDF_Rect & rect) const;
+
+ virtual void SetPlateRect(const CPDF_Rect & rect);
+ void SetScrollPos(const CPDF_Point & point);
+ void ScrollToListItem(FX_INT32 nItemIndex);
+ virtual CPDF_Rect GetItemRect(FX_INT32 nIndex) const;
+ FX_INT32 GetCaret() const {return m_nCaretIndex;}
+ FX_INT32 GetSelect() const {return m_nSelItem;}
+ FX_INT32 GetTopItem() const;
+ virtual CPDF_Rect GetContentRect() const;
+ virtual FX_INT32 GetItemIndex(const CPDF_Point & point) const;
+
+ void AddString(FX_LPCWSTR string);
+ void SetTopItem(FX_INT32 nIndex);
+ void Select(FX_INT32 nItemIndex);
+ virtual void SetCaret(FX_INT32 nItemIndex);
+ virtual void Empty();
+ virtual void Cancel();
+ CFX_WideString GetText() const;
+
+private:
+ void SetMultipleSelect(FX_INT32 nItemIndex, FX_BOOL bSelected);
+ void SetSingleSelect(FX_INT32 nItemIndex);
+ void InvalidateItem(FX_INT32 nItemIndex);
+ void SelectItems();
+ FX_BOOL IsItemVisible(FX_INT32 nItemIndex) const;
+ void SetScrollInfo();
+ void SetScrollPosY(FX_FLOAT fy);
+ virtual void ReArrange(FX_INT32 nItemIndex);
+
+private:
+ IFX_List_Notify* m_pNotify;
+ FX_BOOL m_bNotifyFlag;
+ CPDF_Point m_ptScrollPos;
+ CPLST_Select m_aSelItems; //for multiple
+ FX_INT32 m_nSelItem; //for single
+ FX_INT32 m_nFootIndex; //for multiple
+ FX_BOOL m_bCtrlSel; //for multiple
+ FX_INT32 m_nCaretIndex; //for multiple
+};
+
+#endif
+
diff --git a/fpdfsdk/include/fxedit/fxet_stub.h b/fpdfsdk/include/fxedit/fxet_stub.h
index aa50cd59a0..a1aa2e25ca 100644
--- a/fpdfsdk/include/fxedit/fxet_stub.h
+++ b/fpdfsdk/include/fxedit/fxet_stub.h
@@ -1,26 +1,26 @@
-// 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 _FXET_STUB_H_
-#define _FXET_STUB_H_
-
-#include "../../../core/include/fpdfapi/fpdf_module.h"
-#include "../../../core/include/fpdfapi/fpdf_render.h"
-#include "../../../core/include/fpdfapi/fpdf_pageobj.h"
-#include "../../../core/include/fpdfdoc/fpdf_vt.h"
-#include "../fx_systemhandler.h"
-#ifdef FX_READER_DLL
- #ifdef _DEBUG
- #pragma comment(lib, "X:/pdf/fxcore/Lib/dbg_w32_vc6/fxcoredll[dbg,w32,vc6].lib")
- #pragma comment(lib, "X:/pdf/fxcore/Lib/dbg_w32_vc6/fpdfdocdll[dbg,w32,vc6].lib")
- #else
- #pragma comment(lib, "X:/pdf/fxcore/Lib/rel_w32_vc6/fxcoredll[rel,w32,vc6].lib")
- #pragma comment(lib, "X:/pdf/fxcore/Lib/rel_w32_vc6/fpdfdocdll[rel,w32,vc6].lib")
- #endif
-#endif
-
-#endif
-
+// 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 _FXET_STUB_H_
+#define _FXET_STUB_H_
+
+#include "../../../core/include/fpdfapi/fpdf_module.h"
+#include "../../../core/include/fpdfapi/fpdf_render.h"
+#include "../../../core/include/fpdfapi/fpdf_pageobj.h"
+#include "../../../core/include/fpdfdoc/fpdf_vt.h"
+#include "../fx_systemhandler.h"
+#ifdef FX_READER_DLL
+ #ifdef _DEBUG
+ #pragma comment(lib, "X:/pdf/fxcore/Lib/dbg_w32_vc6/fxcoredll[dbg,w32,vc6].lib")
+ #pragma comment(lib, "X:/pdf/fxcore/Lib/dbg_w32_vc6/fpdfdocdll[dbg,w32,vc6].lib")
+ #else
+ #pragma comment(lib, "X:/pdf/fxcore/Lib/rel_w32_vc6/fxcoredll[rel,w32,vc6].lib")
+ #pragma comment(lib, "X:/pdf/fxcore/Lib/rel_w32_vc6/fpdfdocdll[rel,w32,vc6].lib")
+ #endif
+#endif
+
+#endif
+
diff --git a/fpdfsdk/include/javascript/Consts.h b/fpdfsdk/include/javascript/Consts.h
index 32b0217502..c3a954efa6 100644
--- a/fpdfsdk/include/javascript/Consts.h
+++ b/fpdfsdk/include/javascript/Consts.h
@@ -1,126 +1,126 @@
-// 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 _CONSTS_H_
-#define _CONSTS_H_
-
-/* ------------------------------ border ------------------------------ */
-
-class CJS_Border : public CJS_Object
-{
-public:
- CJS_Border(JSFXObject pObject) : CJS_Object(pObject) {};
- virtual ~CJS_Border(void){};
-
- DECLARE_JS_CLASS_CONST();
-};
-
-/* ------------------------------ display ------------------------------ */
-
-class CJS_Display : public CJS_Object
-{
-public:
- CJS_Display(JSFXObject pObject) : CJS_Object(pObject) {};
- virtual ~CJS_Display(void){};
-
- DECLARE_JS_CLASS_CONST();
-};
-
-/* ------------------------------ font ------------------------------ */
-
-class CJS_Font : public CJS_Object
-{
-public:
- CJS_Font(JSFXObject pObject) : CJS_Object(pObject) {};
- virtual ~CJS_Font(void){};
-
- DECLARE_JS_CLASS_CONST();
-};
-
-/* ------------------------------ highlight ------------------------------ */
-
-class CJS_Highlight : public CJS_Object
-{
-public:
- CJS_Highlight(JSFXObject pObject) : CJS_Object(pObject) {};
- virtual ~CJS_Highlight(void){};
-
- DECLARE_JS_CLASS_CONST();
-};
-
-/* ------------------------------ position ------------------------------ */
-
-class CJS_Position : public CJS_Object
-{
-public:
- CJS_Position(JSFXObject pObject) : CJS_Object(pObject) {};
- virtual ~CJS_Position(void){};
-
- DECLARE_JS_CLASS_CONST();
-};
-
-/* ------------------------------ scaleHow ------------------------------ */
-
-class CJS_ScaleHow : public CJS_Object
-{
-public:
- CJS_ScaleHow(JSFXObject pObject) : CJS_Object(pObject) {};
- virtual ~CJS_ScaleHow(void){};
-
- DECLARE_JS_CLASS_CONST();
-};
-
-/* ------------------------------ scaleWhen ------------------------------ */
-
-class CJS_ScaleWhen : public CJS_Object
-{
-public:
- CJS_ScaleWhen(JSFXObject pObject) : CJS_Object(pObject) {};
- virtual ~CJS_ScaleWhen(void){};
-
- DECLARE_JS_CLASS_CONST();
-};
-
-/* ------------------------------ style ------------------------------ */
-
-class CJS_Style : public CJS_Object
-{
-public:
- CJS_Style(JSFXObject pObject) : CJS_Object(pObject) {};
- virtual ~CJS_Style(void){};
-
- DECLARE_JS_CLASS_CONST();
-};
-
-/* ------------------------------ zoomtype ------------------------------ */
-
-class CJS_Zoomtype : public CJS_Object
-{
-public:
- CJS_Zoomtype(JSFXObject pObject) : CJS_Object(pObject) {};
- virtual ~CJS_Zoomtype(void){};
-
- DECLARE_JS_CLASS_CONST();
-};
-
-/* ------------------------------ CJS_GlobalConsts ------------------------------ */
-
-class CJS_GlobalConsts : public CJS_Object
-{
-public:
- static int Init(IJS_Runtime* pRuntime);
-};
-
-/* ------------------------------ CJS_GlobalArrays ------------------------------ */
-
-class CJS_GlobalArrays : public CJS_Object
-{
-public:
- static int Init(IJS_Runtime* pRuntime);
-};
-
-#endif //_CONSTS_H_
-
+// 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 _CONSTS_H_
+#define _CONSTS_H_
+
+/* ------------------------------ border ------------------------------ */
+
+class CJS_Border : public CJS_Object
+{
+public:
+ CJS_Border(JSFXObject pObject) : CJS_Object(pObject) {};
+ virtual ~CJS_Border(void){};
+
+ DECLARE_JS_CLASS_CONST();
+};
+
+/* ------------------------------ display ------------------------------ */
+
+class CJS_Display : public CJS_Object
+{
+public:
+ CJS_Display(JSFXObject pObject) : CJS_Object(pObject) {};
+ virtual ~CJS_Display(void){};
+
+ DECLARE_JS_CLASS_CONST();
+};
+
+/* ------------------------------ font ------------------------------ */
+
+class CJS_Font : public CJS_Object
+{
+public:
+ CJS_Font(JSFXObject pObject) : CJS_Object(pObject) {};
+ virtual ~CJS_Font(void){};
+
+ DECLARE_JS_CLASS_CONST();
+};
+
+/* ------------------------------ highlight ------------------------------ */
+
+class CJS_Highlight : public CJS_Object
+{
+public:
+ CJS_Highlight(JSFXObject pObject) : CJS_Object(pObject) {};
+ virtual ~CJS_Highlight(void){};
+
+ DECLARE_JS_CLASS_CONST();
+};
+
+/* ------------------------------ position ------------------------------ */
+
+class CJS_Position : public CJS_Object
+{
+public:
+ CJS_Position(JSFXObject pObject) : CJS_Object(pObject) {};
+ virtual ~CJS_Position(void){};
+
+ DECLARE_JS_CLASS_CONST();
+};
+
+/* ------------------------------ scaleHow ------------------------------ */
+
+class CJS_ScaleHow : public CJS_Object
+{
+public:
+ CJS_ScaleHow(JSFXObject pObject) : CJS_Object(pObject) {};
+ virtual ~CJS_ScaleHow(void){};
+
+ DECLARE_JS_CLASS_CONST();
+};
+
+/* ------------------------------ scaleWhen ------------------------------ */
+
+class CJS_ScaleWhen : public CJS_Object
+{
+public:
+ CJS_ScaleWhen(JSFXObject pObject) : CJS_Object(pObject) {};
+ virtual ~CJS_ScaleWhen(void){};
+
+ DECLARE_JS_CLASS_CONST();
+};
+
+/* ------------------------------ style ------------------------------ */
+
+class CJS_Style : public CJS_Object
+{
+public:
+ CJS_Style(JSFXObject pObject) : CJS_Object(pObject) {};
+ virtual ~CJS_Style(void){};
+
+ DECLARE_JS_CLASS_CONST();
+};
+
+/* ------------------------------ zoomtype ------------------------------ */
+
+class CJS_Zoomtype : public CJS_Object
+{
+public:
+ CJS_Zoomtype(JSFXObject pObject) : CJS_Object(pObject) {};
+ virtual ~CJS_Zoomtype(void){};
+
+ DECLARE_JS_CLASS_CONST();
+};
+
+/* ------------------------------ CJS_GlobalConsts ------------------------------ */
+
+class CJS_GlobalConsts : public CJS_Object
+{
+public:
+ static int Init(IJS_Runtime* pRuntime);
+};
+
+/* ------------------------------ CJS_GlobalArrays ------------------------------ */
+
+class CJS_GlobalArrays : public CJS_Object
+{
+public:
+ static int Init(IJS_Runtime* pRuntime);
+};
+
+#endif //_CONSTS_H_
+
diff --git a/fpdfsdk/include/javascript/Document.h b/fpdfsdk/include/javascript/Document.h
index 3e9669b8ef..ca8b51b88c 100644
--- a/fpdfsdk/include/javascript/Document.h
+++ b/fpdfsdk/include/javascript/Document.h
@@ -1,282 +1,282 @@
-// 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 _DOCUMENT_H_
-#define _DOCUMENT_H_
-
-
-
-class PrintParamsObj : public CJS_EmbedObj
-{
-public:
- PrintParamsObj(CJS_Object* pJSObject);
- virtual ~PrintParamsObj(){}
-
-public:
- FX_BOOL bUI;
- int nStart;
- int nEnd;
- FX_BOOL bSilent;
- FX_BOOL bShrinkToFit;
- FX_BOOL bPrintAsImage;
- FX_BOOL bReverse;
- FX_BOOL bAnnotations;
-};
-
-class CJS_PrintParamsObj : public CJS_Object
-{
-public:
- CJS_PrintParamsObj(JSFXObject pObject) : CJS_Object(pObject) {}
- virtual ~CJS_PrintParamsObj(){}
-
- DECLARE_JS_CLASS(CJS_PrintParamsObj);
-};
-
-
-class Icon;
-class Field;
-
-struct IconElement
-{
- IconElement() : IconName(L""), IconStream(NULL), NextIcon(NULL){}
- virtual ~IconElement()
- {
- }
- CFX_WideString IconName;
- IconElement* NextIcon;
- Icon* IconStream;
-};
-
-class IconTree
-{
-public:
- IconTree():m_pHead(NULL), m_pEnd(NULL), m_iLength(0)
- {
-
- }
-
- virtual ~IconTree()
- {
- }
-
-public:
- void InsertIconElement(IconElement* pNewIcon);
- void DeleteIconElement(CFX_WideString swIconName);
- void DeleteIconTree();
- int GetLength();
- IconElement* operator[](int iIndex);
-
-private:
- IconElement* m_pHead;
- IconElement* m_pEnd;
- int m_iLength;
-};
-
-struct CJS_DelayData;
-struct CJS_DelayAnnot;
-struct CJS_AnnotObj;
-
-class Document : public CJS_EmbedObj
-{
-public:
- Document(CJS_Object* pJSObject);
- virtual ~Document();
-
-public:
- FX_BOOL ADBE(OBJ_PROP_PARAMS);
- FX_BOOL author(OBJ_PROP_PARAMS);
- FX_BOOL baseURL(OBJ_PROP_PARAMS);
- FX_BOOL bookmarkRoot(OBJ_PROP_PARAMS);
- FX_BOOL calculate(OBJ_PROP_PARAMS);
- FX_BOOL Collab(OBJ_PROP_PARAMS);
- FX_BOOL creationDate(OBJ_PROP_PARAMS);
- FX_BOOL creator(OBJ_PROP_PARAMS);
- FX_BOOL delay(OBJ_PROP_PARAMS);
- FX_BOOL dirty(OBJ_PROP_PARAMS);
- FX_BOOL documentFileName(OBJ_PROP_PARAMS);
- FX_BOOL external(OBJ_PROP_PARAMS);
- FX_BOOL filesize(OBJ_PROP_PARAMS);
- FX_BOOL icons(OBJ_PROP_PARAMS);
- FX_BOOL info(OBJ_PROP_PARAMS);
- FX_BOOL keywords(OBJ_PROP_PARAMS);
- FX_BOOL layout(OBJ_PROP_PARAMS);
- FX_BOOL media(OBJ_PROP_PARAMS);
- FX_BOOL modDate(OBJ_PROP_PARAMS);
- FX_BOOL mouseX(OBJ_PROP_PARAMS);
- FX_BOOL mouseY(OBJ_PROP_PARAMS);
- FX_BOOL numFields(OBJ_PROP_PARAMS);
- FX_BOOL numPages(OBJ_PROP_PARAMS);
- FX_BOOL pageNum(OBJ_PROP_PARAMS);
- FX_BOOL pageWindowRect(OBJ_PROP_PARAMS);
- FX_BOOL path(OBJ_PROP_PARAMS);
- FX_BOOL producer(OBJ_PROP_PARAMS);
- FX_BOOL subject(OBJ_PROP_PARAMS);
- FX_BOOL title(OBJ_PROP_PARAMS);
- FX_BOOL zoom(OBJ_PROP_PARAMS);
- FX_BOOL zoomType(OBJ_PROP_PARAMS);
-
- FX_BOOL addAnnot(OBJ_METHOD_PARAMS);
- FX_BOOL addField(OBJ_METHOD_PARAMS);
- FX_BOOL addLink(OBJ_METHOD_PARAMS);
- FX_BOOL addIcon(OBJ_METHOD_PARAMS);
- FX_BOOL calculateNow(OBJ_METHOD_PARAMS);
- FX_BOOL closeDoc(OBJ_METHOD_PARAMS);
- FX_BOOL createDataObject(OBJ_METHOD_PARAMS);
- FX_BOOL deletePages(OBJ_METHOD_PARAMS);
- FX_BOOL exportAsText(OBJ_METHOD_PARAMS);
- FX_BOOL exportAsFDF(OBJ_METHOD_PARAMS);
- FX_BOOL exportAsXFDF(OBJ_METHOD_PARAMS);
- FX_BOOL extractPages(OBJ_METHOD_PARAMS);
- FX_BOOL getAnnot(OBJ_METHOD_PARAMS);
- FX_BOOL getAnnots(OBJ_METHOD_PARAMS);
- FX_BOOL getAnnot3D(OBJ_METHOD_PARAMS);
- FX_BOOL getAnnots3D(OBJ_METHOD_PARAMS);
- FX_BOOL getField(OBJ_METHOD_PARAMS);
- FX_BOOL getIcon(OBJ_METHOD_PARAMS);
- FX_BOOL getLinks(OBJ_METHOD_PARAMS);
- FX_BOOL getNthFieldName(OBJ_METHOD_PARAMS);
- FX_BOOL getOCGs(OBJ_METHOD_PARAMS);
- FX_BOOL getPageBox(OBJ_METHOD_PARAMS);
- FX_BOOL getPageNthWord(OBJ_METHOD_PARAMS);
- FX_BOOL getPageNthWordQuads(OBJ_METHOD_PARAMS);
- FX_BOOL getPageNumWords(OBJ_METHOD_PARAMS);
- FX_BOOL getPrintParams(OBJ_METHOD_PARAMS);
- FX_BOOL getURL(OBJ_METHOD_PARAMS);
- FX_BOOL importAnFDF(OBJ_METHOD_PARAMS);
- FX_BOOL importAnXFDF(OBJ_METHOD_PARAMS);
- FX_BOOL importTextData(OBJ_METHOD_PARAMS);
- FX_BOOL insertPages(OBJ_METHOD_PARAMS);
- FX_BOOL mailForm(OBJ_METHOD_PARAMS);
- FX_BOOL print(OBJ_METHOD_PARAMS);
- FX_BOOL removeField(OBJ_METHOD_PARAMS);
- FX_BOOL replacePages(OBJ_METHOD_PARAMS);
- FX_BOOL resetForm(OBJ_METHOD_PARAMS);
- FX_BOOL saveAs(OBJ_METHOD_PARAMS);
- FX_BOOL submitForm(OBJ_METHOD_PARAMS);
- FX_BOOL mailDoc(OBJ_METHOD_PARAMS);
- FX_BOOL removeIcon(OBJ_METHOD_PARAMS);
-
-public:
- void AttachDoc(CPDFSDK_Document* pDoc);
- CPDFSDK_Document* GetReaderDoc();
-
- static FX_BOOL ExtractFileName(CPDFSDK_Document* pDoc, CFX_ByteString& strFileName);
- static FX_BOOL ExtractFolderName(CPDFSDK_Document* pDoc, CFX_ByteString& strFolderName);
-
-public:
- void AddDelayData(CJS_DelayData* pData);
- void DoFieldDelay(const CFX_WideString& sFieldName, int nControlIndex);
-
- void AddDelayAnnotData(CJS_AnnotObj *pData);
- void DoAnnotDelay();
- void SetIsolate(v8::Isolate* isolate) {m_isolate = isolate;}
-
-private:
- CFX_WideString ReversalStr(CFX_WideString cbFrom);
- CFX_WideString CutString(CFX_WideString cbFrom);
- bool IsEnclosedInRect(CFX_FloatRect rect, CFX_FloatRect LinkRect);
- int CountWords(CPDF_TextObject* pTextObj);
- CFX_WideString GetObjWordStr(CPDF_TextObject* pTextObj, int nWordIndex);
-
- FX_BOOL ParserParams(JSObject *pObj,CJS_AnnotObj& annotobj);
-
-private:
- v8::Isolate* m_isolate;
- IconTree* m_pIconTree;
- CPDFSDK_Document* m_pDocument;
- CFX_WideString m_cwBaseURL;
-
- FX_BOOL m_bDelay;
- CFX_ArrayTemplate<CJS_DelayData*> m_DelayData;
- CFX_ArrayTemplate<CJS_AnnotObj*> m_DelayAnnotData;
-};
-
-class CJS_Document : public CJS_Object
-{
-public:
- CJS_Document(JSFXObject pObject) : CJS_Object(pObject) {};
- virtual ~CJS_Document(){};
-
- virtual FX_BOOL InitInstance(IFXJS_Context* cc);
-
- DECLARE_JS_CLASS(CJS_Document);
-
- JS_STATIC_PROP(ADBE, Document);
- JS_STATIC_PROP(author, Document);
- JS_STATIC_PROP(baseURL, Document);
- JS_STATIC_PROP(bookmarkRoot, Document);
- JS_STATIC_PROP(calculate, Document);
- JS_STATIC_PROP(Collab, Document);
- JS_STATIC_PROP(creationDate, Document);
- JS_STATIC_PROP(creator, Document);
- JS_STATIC_PROP(delay, Document);
- JS_STATIC_PROP(dirty, Document);
- JS_STATIC_PROP(documentFileName, Document);
- JS_STATIC_PROP(external, Document);
- JS_STATIC_PROP(filesize, Document);
- JS_STATIC_PROP(icons, Document);
- JS_STATIC_PROP(info, Document);
- JS_STATIC_PROP(keywords, Document);
- JS_STATIC_PROP(layout, Document);
- JS_STATIC_PROP(media, Document);
- JS_STATIC_PROP(modDate, Document);
- JS_STATIC_PROP(mouseX, Document);
- JS_STATIC_PROP(mouseY, Document);
- JS_STATIC_PROP(numFields, Document);
- JS_STATIC_PROP(numPages, Document);
- JS_STATIC_PROP(pageNum, Document);
- JS_STATIC_PROP(pageWindowRect, Document);
- JS_STATIC_PROP(path, Document);
- JS_STATIC_PROP(producer, Document);
- JS_STATIC_PROP(subject, Document);
- JS_STATIC_PROP(title, Document);
- JS_STATIC_PROP(zoom, Document);
- JS_STATIC_PROP(zoomType, Document);
-
- JS_STATIC_METHOD(addAnnot,Document);
- JS_STATIC_METHOD(addField, Document);
- JS_STATIC_METHOD(addLink, Document);
- JS_STATIC_METHOD(addIcon, Document);
- JS_STATIC_METHOD(calculateNow, Document);
- JS_STATIC_METHOD(closeDoc, Document);
- JS_STATIC_METHOD(createDataObject, Document);
- JS_STATIC_METHOD(deletePages, Document);
- JS_STATIC_METHOD(exportAsText, Document);
- JS_STATIC_METHOD(exportAsFDF, Document);
- JS_STATIC_METHOD(exportAsXFDF, Document);
- JS_STATIC_METHOD(extractPages, Document);
- JS_STATIC_METHOD(getAnnot, Document);
- JS_STATIC_METHOD(getAnnots, Document);
- JS_STATIC_METHOD(getAnnot3D, Document);
- JS_STATIC_METHOD(getAnnots3D, Document);
- JS_STATIC_METHOD(getField, Document);
- JS_STATIC_METHOD(getIcon, Document);
- JS_STATIC_METHOD(getLinks, Document);
- JS_STATIC_METHOD(getNthFieldName, Document);
- JS_STATIC_METHOD(getOCGs, Document);
- JS_STATIC_METHOD(getPageBox, Document);
- JS_STATIC_METHOD(getPageNthWord, Document);
- JS_STATIC_METHOD(getPageNthWordQuads, Document);
- JS_STATIC_METHOD(getPageNumWords, Document);
- JS_STATIC_METHOD(getPrintParams, Document);
- JS_STATIC_METHOD(getURL, Document);
- JS_STATIC_METHOD(importAnFDF, Document);
- JS_STATIC_METHOD(importAnXFDF, Document);
- JS_STATIC_METHOD(importTextData, Document);
- JS_STATIC_METHOD(insertPages, Document);
- JS_STATIC_METHOD(mailForm, Document);
- JS_STATIC_METHOD(print, Document);
- JS_STATIC_METHOD(removeField, Document);
- JS_STATIC_METHOD(replacePages, Document);
- JS_STATIC_METHOD(removeIcon, Document);
- JS_STATIC_METHOD(resetForm, Document);
- JS_STATIC_METHOD(saveAs, Document);
- JS_STATIC_METHOD(submitForm, Document);
- JS_STATIC_METHOD(mailDoc, Document);
-};
-
-#endif//_DOCUMENT_H_
-
+// 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 _DOCUMENT_H_
+#define _DOCUMENT_H_
+
+
+
+class PrintParamsObj : public CJS_EmbedObj
+{
+public:
+ PrintParamsObj(CJS_Object* pJSObject);
+ virtual ~PrintParamsObj(){}
+
+public:
+ FX_BOOL bUI;
+ int nStart;
+ int nEnd;
+ FX_BOOL bSilent;
+ FX_BOOL bShrinkToFit;
+ FX_BOOL bPrintAsImage;
+ FX_BOOL bReverse;
+ FX_BOOL bAnnotations;
+};
+
+class CJS_PrintParamsObj : public CJS_Object
+{
+public:
+ CJS_PrintParamsObj(JSFXObject pObject) : CJS_Object(pObject) {}
+ virtual ~CJS_PrintParamsObj(){}
+
+ DECLARE_JS_CLASS(CJS_PrintParamsObj);
+};
+
+
+class Icon;
+class Field;
+
+struct IconElement
+{
+ IconElement() : IconName(L""), IconStream(NULL), NextIcon(NULL){}
+ virtual ~IconElement()
+ {
+ }
+ CFX_WideString IconName;
+ IconElement* NextIcon;
+ Icon* IconStream;
+};
+
+class IconTree
+{
+public:
+ IconTree():m_pHead(NULL), m_pEnd(NULL), m_iLength(0)
+ {
+
+ }
+
+ virtual ~IconTree()
+ {
+ }
+
+public:
+ void InsertIconElement(IconElement* pNewIcon);
+ void DeleteIconElement(CFX_WideString swIconName);
+ void DeleteIconTree();
+ int GetLength();
+ IconElement* operator[](int iIndex);
+
+private:
+ IconElement* m_pHead;
+ IconElement* m_pEnd;
+ int m_iLength;
+};
+
+struct CJS_DelayData;
+struct CJS_DelayAnnot;
+struct CJS_AnnotObj;
+
+class Document : public CJS_EmbedObj
+{
+public:
+ Document(CJS_Object* pJSObject);
+ virtual ~Document();
+
+public:
+ FX_BOOL ADBE(OBJ_PROP_PARAMS);
+ FX_BOOL author(OBJ_PROP_PARAMS);
+ FX_BOOL baseURL(OBJ_PROP_PARAMS);
+ FX_BOOL bookmarkRoot(OBJ_PROP_PARAMS);
+ FX_BOOL calculate(OBJ_PROP_PARAMS);
+ FX_BOOL Collab(OBJ_PROP_PARAMS);
+ FX_BOOL creationDate(OBJ_PROP_PARAMS);
+ FX_BOOL creator(OBJ_PROP_PARAMS);
+ FX_BOOL delay(OBJ_PROP_PARAMS);
+ FX_BOOL dirty(OBJ_PROP_PARAMS);
+ FX_BOOL documentFileName(OBJ_PROP_PARAMS);
+ FX_BOOL external(OBJ_PROP_PARAMS);
+ FX_BOOL filesize(OBJ_PROP_PARAMS);
+ FX_BOOL icons(OBJ_PROP_PARAMS);
+ FX_BOOL info(OBJ_PROP_PARAMS);
+ FX_BOOL keywords(OBJ_PROP_PARAMS);
+ FX_BOOL layout(OBJ_PROP_PARAMS);
+ FX_BOOL media(OBJ_PROP_PARAMS);
+ FX_BOOL modDate(OBJ_PROP_PARAMS);
+ FX_BOOL mouseX(OBJ_PROP_PARAMS);
+ FX_BOOL mouseY(OBJ_PROP_PARAMS);
+ FX_BOOL numFields(OBJ_PROP_PARAMS);
+ FX_BOOL numPages(OBJ_PROP_PARAMS);
+ FX_BOOL pageNum(OBJ_PROP_PARAMS);
+ FX_BOOL pageWindowRect(OBJ_PROP_PARAMS);
+ FX_BOOL path(OBJ_PROP_PARAMS);
+ FX_BOOL producer(OBJ_PROP_PARAMS);
+ FX_BOOL subject(OBJ_PROP_PARAMS);
+ FX_BOOL title(OBJ_PROP_PARAMS);
+ FX_BOOL zoom(OBJ_PROP_PARAMS);
+ FX_BOOL zoomType(OBJ_PROP_PARAMS);
+
+ FX_BOOL addAnnot(OBJ_METHOD_PARAMS);
+ FX_BOOL addField(OBJ_METHOD_PARAMS);
+ FX_BOOL addLink(OBJ_METHOD_PARAMS);
+ FX_BOOL addIcon(OBJ_METHOD_PARAMS);
+ FX_BOOL calculateNow(OBJ_METHOD_PARAMS);
+ FX_BOOL closeDoc(OBJ_METHOD_PARAMS);
+ FX_BOOL createDataObject(OBJ_METHOD_PARAMS);
+ FX_BOOL deletePages(OBJ_METHOD_PARAMS);
+ FX_BOOL exportAsText(OBJ_METHOD_PARAMS);
+ FX_BOOL exportAsFDF(OBJ_METHOD_PARAMS);
+ FX_BOOL exportAsXFDF(OBJ_METHOD_PARAMS);
+ FX_BOOL extractPages(OBJ_METHOD_PARAMS);
+ FX_BOOL getAnnot(OBJ_METHOD_PARAMS);
+ FX_BOOL getAnnots(OBJ_METHOD_PARAMS);
+ FX_BOOL getAnnot3D(OBJ_METHOD_PARAMS);
+ FX_BOOL getAnnots3D(OBJ_METHOD_PARAMS);
+ FX_BOOL getField(OBJ_METHOD_PARAMS);
+ FX_BOOL getIcon(OBJ_METHOD_PARAMS);
+ FX_BOOL getLinks(OBJ_METHOD_PARAMS);
+ FX_BOOL getNthFieldName(OBJ_METHOD_PARAMS);
+ FX_BOOL getOCGs(OBJ_METHOD_PARAMS);
+ FX_BOOL getPageBox(OBJ_METHOD_PARAMS);
+ FX_BOOL getPageNthWord(OBJ_METHOD_PARAMS);
+ FX_BOOL getPageNthWordQuads(OBJ_METHOD_PARAMS);
+ FX_BOOL getPageNumWords(OBJ_METHOD_PARAMS);
+ FX_BOOL getPrintParams(OBJ_METHOD_PARAMS);
+ FX_BOOL getURL(OBJ_METHOD_PARAMS);
+ FX_BOOL importAnFDF(OBJ_METHOD_PARAMS);
+ FX_BOOL importAnXFDF(OBJ_METHOD_PARAMS);
+ FX_BOOL importTextData(OBJ_METHOD_PARAMS);
+ FX_BOOL insertPages(OBJ_METHOD_PARAMS);
+ FX_BOOL mailForm(OBJ_METHOD_PARAMS);
+ FX_BOOL print(OBJ_METHOD_PARAMS);
+ FX_BOOL removeField(OBJ_METHOD_PARAMS);
+ FX_BOOL replacePages(OBJ_METHOD_PARAMS);
+ FX_BOOL resetForm(OBJ_METHOD_PARAMS);
+ FX_BOOL saveAs(OBJ_METHOD_PARAMS);
+ FX_BOOL submitForm(OBJ_METHOD_PARAMS);
+ FX_BOOL mailDoc(OBJ_METHOD_PARAMS);
+ FX_BOOL removeIcon(OBJ_METHOD_PARAMS);
+
+public:
+ void AttachDoc(CPDFSDK_Document* pDoc);
+ CPDFSDK_Document* GetReaderDoc();
+
+ static FX_BOOL ExtractFileName(CPDFSDK_Document* pDoc, CFX_ByteString& strFileName);
+ static FX_BOOL ExtractFolderName(CPDFSDK_Document* pDoc, CFX_ByteString& strFolderName);
+
+public:
+ void AddDelayData(CJS_DelayData* pData);
+ void DoFieldDelay(const CFX_WideString& sFieldName, int nControlIndex);
+
+ void AddDelayAnnotData(CJS_AnnotObj *pData);
+ void DoAnnotDelay();
+ void SetIsolate(v8::Isolate* isolate) {m_isolate = isolate;}
+
+private:
+ CFX_WideString ReversalStr(CFX_WideString cbFrom);
+ CFX_WideString CutString(CFX_WideString cbFrom);
+ bool IsEnclosedInRect(CFX_FloatRect rect, CFX_FloatRect LinkRect);
+ int CountWords(CPDF_TextObject* pTextObj);
+ CFX_WideString GetObjWordStr(CPDF_TextObject* pTextObj, int nWordIndex);
+
+ FX_BOOL ParserParams(JSObject *pObj,CJS_AnnotObj& annotobj);
+
+private:
+ v8::Isolate* m_isolate;
+ IconTree* m_pIconTree;
+ CPDFSDK_Document* m_pDocument;
+ CFX_WideString m_cwBaseURL;
+
+ FX_BOOL m_bDelay;
+ CFX_ArrayTemplate<CJS_DelayData*> m_DelayData;
+ CFX_ArrayTemplate<CJS_AnnotObj*> m_DelayAnnotData;
+};
+
+class CJS_Document : public CJS_Object
+{
+public:
+ CJS_Document(JSFXObject pObject) : CJS_Object(pObject) {};
+ virtual ~CJS_Document(){};
+
+ virtual FX_BOOL InitInstance(IFXJS_Context* cc);
+
+ DECLARE_JS_CLASS(CJS_Document);
+
+ JS_STATIC_PROP(ADBE, Document);
+ JS_STATIC_PROP(author, Document);
+ JS_STATIC_PROP(baseURL, Document);
+ JS_STATIC_PROP(bookmarkRoot, Document);
+ JS_STATIC_PROP(calculate, Document);
+ JS_STATIC_PROP(Collab, Document);
+ JS_STATIC_PROP(creationDate, Document);
+ JS_STATIC_PROP(creator, Document);
+ JS_STATIC_PROP(delay, Document);
+ JS_STATIC_PROP(dirty, Document);
+ JS_STATIC_PROP(documentFileName, Document);
+ JS_STATIC_PROP(external, Document);
+ JS_STATIC_PROP(filesize, Document);
+ JS_STATIC_PROP(icons, Document);
+ JS_STATIC_PROP(info, Document);
+ JS_STATIC_PROP(keywords, Document);
+ JS_STATIC_PROP(layout, Document);
+ JS_STATIC_PROP(media, Document);
+ JS_STATIC_PROP(modDate, Document);
+ JS_STATIC_PROP(mouseX, Document);
+ JS_STATIC_PROP(mouseY, Document);
+ JS_STATIC_PROP(numFields, Document);
+ JS_STATIC_PROP(numPages, Document);
+ JS_STATIC_PROP(pageNum, Document);
+ JS_STATIC_PROP(pageWindowRect, Document);
+ JS_STATIC_PROP(path, Document);
+ JS_STATIC_PROP(producer, Document);
+ JS_STATIC_PROP(subject, Document);
+ JS_STATIC_PROP(title, Document);
+ JS_STATIC_PROP(zoom, Document);
+ JS_STATIC_PROP(zoomType, Document);
+
+ JS_STATIC_METHOD(addAnnot,Document);
+ JS_STATIC_METHOD(addField, Document);
+ JS_STATIC_METHOD(addLink, Document);
+ JS_STATIC_METHOD(addIcon, Document);
+ JS_STATIC_METHOD(calculateNow, Document);
+ JS_STATIC_METHOD(closeDoc, Document);
+ JS_STATIC_METHOD(createDataObject, Document);
+ JS_STATIC_METHOD(deletePages, Document);
+ JS_STATIC_METHOD(exportAsText, Document);
+ JS_STATIC_METHOD(exportAsFDF, Document);
+ JS_STATIC_METHOD(exportAsXFDF, Document);
+ JS_STATIC_METHOD(extractPages, Document);
+ JS_STATIC_METHOD(getAnnot, Document);
+ JS_STATIC_METHOD(getAnnots, Document);
+ JS_STATIC_METHOD(getAnnot3D, Document);
+ JS_STATIC_METHOD(getAnnots3D, Document);
+ JS_STATIC_METHOD(getField, Document);
+ JS_STATIC_METHOD(getIcon, Document);
+ JS_STATIC_METHOD(getLinks, Document);
+ JS_STATIC_METHOD(getNthFieldName, Document);
+ JS_STATIC_METHOD(getOCGs, Document);
+ JS_STATIC_METHOD(getPageBox, Document);
+ JS_STATIC_METHOD(getPageNthWord, Document);
+ JS_STATIC_METHOD(getPageNthWordQuads, Document);
+ JS_STATIC_METHOD(getPageNumWords, Document);
+ JS_STATIC_METHOD(getPrintParams, Document);
+ JS_STATIC_METHOD(getURL, Document);
+ JS_STATIC_METHOD(importAnFDF, Document);
+ JS_STATIC_METHOD(importAnXFDF, Document);
+ JS_STATIC_METHOD(importTextData, Document);
+ JS_STATIC_METHOD(insertPages, Document);
+ JS_STATIC_METHOD(mailForm, Document);
+ JS_STATIC_METHOD(print, Document);
+ JS_STATIC_METHOD(removeField, Document);
+ JS_STATIC_METHOD(replacePages, Document);
+ JS_STATIC_METHOD(removeIcon, Document);
+ JS_STATIC_METHOD(resetForm, Document);
+ JS_STATIC_METHOD(saveAs, Document);
+ JS_STATIC_METHOD(submitForm, Document);
+ JS_STATIC_METHOD(mailDoc, Document);
+};
+
+#endif//_DOCUMENT_H_
+
diff --git a/fpdfsdk/include/javascript/Field.h b/fpdfsdk/include/javascript/Field.h
index 1b0bb05a12..2aea85afa4 100644
--- a/fpdfsdk/include/javascript/Field.h
+++ b/fpdfsdk/include/javascript/Field.h
@@ -1,355 +1,355 @@
-// 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 _FIELD_H_
-#define _FIELD_H_
-
-class Document;
-
-enum FIELD_PROP
-{
- FP_ALIGNMENT,
- FP_BORDERSTYLE,
- FP_BUTTONALIGNX,
- FP_BUTTONALIGNY,
- FP_BUTTONFITBOUNDS,
- FP_BUTTONPOSITION,
- FP_BUTTONSCALEHOW,
- FP_BUTTONSCALEWHEN,
- FP_CALCORDERINDEX,
- FP_CHARLIMIT,
- FP_COMB,
- FP_COMMITONSELCHANGE,
- FP_CURRENTVALUEINDICES,
- FP_DEFAULTVALUE,
- FP_DONOTSCROLL,
- FP_DISPLAY,
- FP_FILLCOLOR,
- FP_HIDDEN,
- FP_HIGHLIGHT,
- FP_LINEWIDTH,
- FP_MULTILINE,
- FP_MULTIPLESELECTION,
- FP_PASSWORD,
- FP_RECT,
- FP_RICHTEXT,
- FP_RICHVALUE,
- FP_ROTATION,
- FP_STROKECOLOR,
- FP_STYLE,
- FP_TEXTCOLOR,
- FP_TEXTFONT,
- FP_TEXTSIZE,
- FP_USERNAME,
- FP_VALUE
-};
-
-class CJS_WideStringArray
-{
-public:
- CJS_WideStringArray(){}
- virtual ~CJS_WideStringArray()
- {
- for (int i=0,sz=m_Data.GetSize(); i<sz; i++)
- delete m_Data.GetAt(i);
- m_Data.RemoveAll();
- }
-
- void Add(const CFX_WideString& string)
- {
- m_Data.Add(new CFX_WideString(string));
- }
-
- int GetSize() const
- {
- return m_Data.GetSize();
- }
-
- CFX_WideString GetAt(int i) const
- {
- return *m_Data.GetAt(i);
- }
-
-private:
- CFX_ArrayTemplate<CFX_WideString*> m_Data;
-};
-
-struct CJS_DelayData
-{
- CFX_WideString sFieldName;
- int nControlIndex;
- enum FIELD_PROP eProp;
- FX_INT32 num;
- bool b;
- CFX_ByteString string;
- CFX_WideString widestring;
- CPDF_Rect rect;
- CPWL_Color color;
- CFX_DWordArray wordarray;
- CJS_WideStringArray widestringarray;
-};
-
-class Field : public CJS_EmbedObj
-{
-public:
- Field(CJS_Object* pJSObject);
- virtual ~Field(void);
-
- FX_BOOL alignment(OBJ_PROP_PARAMS);
- FX_BOOL borderStyle(OBJ_PROP_PARAMS);
- FX_BOOL buttonAlignX(OBJ_PROP_PARAMS);
- FX_BOOL buttonAlignY(OBJ_PROP_PARAMS);
- FX_BOOL buttonFitBounds(OBJ_PROP_PARAMS);
- FX_BOOL buttonPosition(OBJ_PROP_PARAMS);
- FX_BOOL buttonScaleHow(OBJ_PROP_PARAMS);
- FX_BOOL buttonScaleWhen(OBJ_PROP_PARAMS);
- FX_BOOL calcOrderIndex(OBJ_PROP_PARAMS);
- FX_BOOL charLimit(OBJ_PROP_PARAMS);
- FX_BOOL comb(OBJ_PROP_PARAMS);
- FX_BOOL commitOnSelChange(OBJ_PROP_PARAMS);
- FX_BOOL currentValueIndices(OBJ_PROP_PARAMS);
- FX_BOOL defaultStyle(OBJ_PROP_PARAMS);
- FX_BOOL defaultValue(OBJ_PROP_PARAMS);
- FX_BOOL doNotScroll(OBJ_PROP_PARAMS);
- FX_BOOL doNotSpellCheck(OBJ_PROP_PARAMS);
- FX_BOOL delay(OBJ_PROP_PARAMS);
- FX_BOOL display(OBJ_PROP_PARAMS);
- FX_BOOL doc(OBJ_PROP_PARAMS);
- FX_BOOL editable(OBJ_PROP_PARAMS);
- FX_BOOL exportValues(OBJ_PROP_PARAMS);
- FX_BOOL fileSelect(OBJ_PROP_PARAMS);
- FX_BOOL fillColor(OBJ_PROP_PARAMS);
- FX_BOOL hidden(OBJ_PROP_PARAMS);
- FX_BOOL highlight(OBJ_PROP_PARAMS);
- FX_BOOL lineWidth(OBJ_PROP_PARAMS);
- FX_BOOL multiline(OBJ_PROP_PARAMS);
- FX_BOOL multipleSelection(OBJ_PROP_PARAMS);
- FX_BOOL name(OBJ_PROP_PARAMS);
- FX_BOOL numItems(OBJ_PROP_PARAMS);
- FX_BOOL page(OBJ_PROP_PARAMS);
- FX_BOOL password(OBJ_PROP_PARAMS);
- FX_BOOL print(OBJ_PROP_PARAMS);
- FX_BOOL radiosInUnison(OBJ_PROP_PARAMS);
- FX_BOOL readonly(OBJ_PROP_PARAMS);
- FX_BOOL rect(OBJ_PROP_PARAMS);
- FX_BOOL required(OBJ_PROP_PARAMS);
- FX_BOOL richText(OBJ_PROP_PARAMS);
- FX_BOOL richValue(OBJ_PROP_PARAMS);
- FX_BOOL rotation(OBJ_PROP_PARAMS);
- FX_BOOL strokeColor(OBJ_PROP_PARAMS);
- FX_BOOL style(OBJ_PROP_PARAMS);
- FX_BOOL submitName(OBJ_PROP_PARAMS);
- FX_BOOL textColor(OBJ_PROP_PARAMS);
- FX_BOOL textFont(OBJ_PROP_PARAMS);
- FX_BOOL textSize(OBJ_PROP_PARAMS);
- FX_BOOL type(OBJ_PROP_PARAMS);
- FX_BOOL userName(OBJ_PROP_PARAMS);
- FX_BOOL value(OBJ_PROP_PARAMS);
- FX_BOOL valueAsString(OBJ_PROP_PARAMS);
- FX_BOOL source(OBJ_PROP_PARAMS);
-
- FX_BOOL browseForFileToSubmit(OBJ_METHOD_PARAMS);
- FX_BOOL buttonGetCaption(OBJ_METHOD_PARAMS);
- FX_BOOL buttonGetIcon(OBJ_METHOD_PARAMS);
- FX_BOOL buttonImportIcon(OBJ_METHOD_PARAMS);
- FX_BOOL buttonSetCaption(OBJ_METHOD_PARAMS);
- FX_BOOL buttonSetIcon(OBJ_METHOD_PARAMS);
- FX_BOOL checkThisBox(OBJ_METHOD_PARAMS);
- FX_BOOL clearItems(OBJ_METHOD_PARAMS);
- FX_BOOL defaultIsChecked(OBJ_METHOD_PARAMS);
- FX_BOOL deleteItemAt(OBJ_METHOD_PARAMS);
- FX_BOOL getArray(OBJ_METHOD_PARAMS);
- FX_BOOL getItemAt(OBJ_METHOD_PARAMS);
- FX_BOOL getLock(OBJ_METHOD_PARAMS);
- FX_BOOL insertItemAt(OBJ_METHOD_PARAMS);
- FX_BOOL isBoxChecked(OBJ_METHOD_PARAMS);
- FX_BOOL isDefaultChecked(OBJ_METHOD_PARAMS);
- FX_BOOL setAction(OBJ_METHOD_PARAMS);
- FX_BOOL setFocus(OBJ_METHOD_PARAMS);
- FX_BOOL setItems(OBJ_METHOD_PARAMS);
- FX_BOOL setLock(OBJ_METHOD_PARAMS);
- FX_BOOL signatureGetModifications(OBJ_METHOD_PARAMS);
- FX_BOOL signatureGetSeedValue(OBJ_METHOD_PARAMS);
- FX_BOOL signatureInfo(OBJ_METHOD_PARAMS);
- FX_BOOL signatureSetSeedValue(OBJ_METHOD_PARAMS);
- FX_BOOL signatureSign(OBJ_METHOD_PARAMS);
- FX_BOOL signatureValidate(OBJ_METHOD_PARAMS);
-
-public:
- static void SetAlignment(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CFX_ByteString& string);
- static void SetBorderStyle(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CFX_ByteString& string);
- static void SetButtonAlignX(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number);
- static void SetButtonAlignY(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number);
- static void SetButtonFitBounds(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b);
- static void SetButtonPosition(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number);
- static void SetButtonScaleHow(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number);
- static void SetButtonScaleWhen(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number);
- static void SetCalcOrderIndex(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number);
- static void SetCharLimit(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number);
- static void SetComb(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b);
- static void SetCommitOnSelChange(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b);
- static void SetCurrentValueIndices(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CFX_DWordArray& array);
- static void SetDefaultStyle(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex);
- static void SetDefaultValue(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CFX_WideString& string);
- static void SetDoNotScroll(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b);
- static void SetDisplay(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number);
- static void SetFillColor(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CPWL_Color& color);
- static void SetHidden(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b);
- static void SetHighlight(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CFX_ByteString& string);
- static void SetLineWidth(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number);
- static void SetMultiline(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b);
- static void SetMultipleSelection(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b);
- static void SetPassword(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b);
- static void SetRect(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CPDF_Rect& rect);
- static void SetRichText(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b);
- static void SetRichValue(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex);
- static void SetRotation(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number);
- static void SetStrokeColor(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CPWL_Color& color);
- static void SetStyle(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CFX_ByteString& string);
- static void SetTextColor(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CPWL_Color& color);
- static void SetTextFont(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CFX_ByteString& string);
- static void SetTextSize(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number);
- static void SetUserName(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CFX_WideString& string);
- static void SetValue(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CJS_WideStringArray& strArray);
-
-public:
- static void AddField(CPDFSDK_Document* pDocument, int nPageIndex, int nFieldType,
- const CFX_WideString& sName, const CPDF_Rect& rcCoords);
-public:
- static void UpdateFormField(CPDFSDK_Document* pDocument, CPDF_FormField* pFormField,
- FX_BOOL bChangeMark, FX_BOOL bResetAP, FX_BOOL bRefresh);
- static void UpdateFormControl(CPDFSDK_Document* pDocument, CPDF_FormControl* pFormControl,
- FX_BOOL bChangeMark, FX_BOOL bResetAP, FX_BOOL bRefresh);
-
- static CPDFSDK_Widget* GetWidget(CPDFSDK_Document* pDocument, CPDF_FormControl* pFormControl);
- static void GetFormFields(CPDFSDK_Document* pDocument, const CFX_WideString& csFieldName, CFX_PtrArray& FieldsArray);
-
- static void DoDelay(CPDFSDK_Document* pDocument, CJS_DelayData* pData);
-
-public:
- FX_BOOL AttachField(Document* pDocument, const CFX_WideString& csFieldName);
- void SetDelay(FX_BOOL bDelay);
- void SetIsolate(v8::Isolate* isolate) {m_isolate = isolate;}
-protected:
- void ParseFieldName(const std::wstring &strFieldNameParsed,std::wstring &strFieldName,int & iControlNo);
- void GetFormFields(const CFX_WideString& csFieldName, CFX_PtrArray& FieldsArray);
- CPDF_FormControl* GetSmartFieldControl(CPDF_FormField* pFormField);
- FX_BOOL ValueIsOccur(CPDF_FormField* pFormField, CFX_WideString csOptLabel);
-
- void AddDelay_Int(enum FIELD_PROP prop, FX_INT32 n);
- void AddDelay_Bool(enum FIELD_PROP prop,bool b);
- void AddDelay_String(enum FIELD_PROP prop, const CFX_ByteString& string);
- void AddDelay_WideString(enum FIELD_PROP prop, const CFX_WideString& string);
- void AddDelay_Rect(enum FIELD_PROP prop, const CPDF_Rect& rect);
- void AddDelay_Color(enum FIELD_PROP prop, const CPWL_Color& color);
- void AddDelay_WordArray(enum FIELD_PROP prop, const CFX_DWordArray& array);
- void AddDelay_WideStringArray(enum FIELD_PROP prop, const CJS_WideStringArray& array);
-
- void DoDelay();
-public:
- Document* m_pJSDoc;
- CPDFSDK_Document* m_pDocument;
- CFX_WideString m_FieldName;
- int m_nFormControlIndex;
- FX_BOOL m_bCanSet;
-
- FX_BOOL m_bDelay;
- v8::Isolate* m_isolate;
-};
-
-class CJS_Field : public CJS_Object
-{
-public:
- CJS_Field(JSFXObject pObject) : CJS_Object(pObject) {};
- virtual ~CJS_Field(void){};
-
- virtual FX_BOOL InitInstance(IFXJS_Context* cc);
-
- DECLARE_JS_CLASS(CJS_Field);
-
- JS_STATIC_PROP(alignment, Field);
- JS_STATIC_PROP(borderStyle, Field);
- JS_STATIC_PROP(buttonAlignX, Field);
- JS_STATIC_PROP(buttonAlignY, Field);
- JS_STATIC_PROP(buttonFitBounds, Field);
- JS_STATIC_PROP(buttonPosition, Field);
- JS_STATIC_PROP(buttonScaleHow, Field);
- JS_STATIC_PROP(buttonScaleWhen, Field);
- JS_STATIC_PROP(calcOrderIndex, Field);
- JS_STATIC_PROP(charLimit, Field);
- JS_STATIC_PROP(comb, Field);
- JS_STATIC_PROP(commitOnSelChange, Field);
- JS_STATIC_PROP(currentValueIndices, Field);
- JS_STATIC_PROP(defaultStyle, Field);
- JS_STATIC_PROP(defaultValue, Field);
- JS_STATIC_PROP(doNotScroll, Field);
- JS_STATIC_PROP(doNotSpellCheck, Field);
- JS_STATIC_PROP(delay, Field);
- JS_STATIC_PROP(display, Field);
- JS_STATIC_PROP(doc, Field);
- JS_STATIC_PROP(editable, Field);
- JS_STATIC_PROP(exportValues, Field);
- JS_STATIC_PROP(fileSelect, Field);
- JS_STATIC_PROP(fillColor, Field);
- JS_STATIC_PROP(hidden, Field);
- JS_STATIC_PROP(highlight, Field);
- JS_STATIC_PROP(lineWidth, Field);
- JS_STATIC_PROP(multiline, Field);
- JS_STATIC_PROP(multipleSelection, Field);
- JS_STATIC_PROP(name, Field);
- JS_STATIC_PROP(numItems, Field);
- JS_STATIC_PROP(page, Field);
- JS_STATIC_PROP(password, Field);
- JS_STATIC_PROP(print, Field);
- JS_STATIC_PROP(radiosInUnison, Field);
- JS_STATIC_PROP(readonly, Field);
- JS_STATIC_PROP(rect, Field);
- JS_STATIC_PROP(required, Field);
- JS_STATIC_PROP(richText, Field);
- JS_STATIC_PROP(richValue, Field);
- JS_STATIC_PROP(rotation, Field);
- JS_STATIC_PROP(strokeColor, Field);
- JS_STATIC_PROP(style, Field);
- JS_STATIC_PROP(submitName, Field);
- JS_STATIC_PROP(textColor, Field);
- JS_STATIC_PROP(textFont, Field);
- JS_STATIC_PROP(textSize, Field);
- JS_STATIC_PROP(type, Field);
- JS_STATIC_PROP(userName, Field);
- JS_STATIC_PROP(value, Field);
- JS_STATIC_PROP(valueAsString, Field);
- JS_STATIC_PROP(source, Field);
-
- JS_STATIC_METHOD(browseForFileToSubmit, Field);
- JS_STATIC_METHOD(buttonGetCaption, Field);
- JS_STATIC_METHOD(buttonGetIcon, Field);
- JS_STATIC_METHOD(buttonImportIcon, Field);
- JS_STATIC_METHOD(buttonSetCaption, Field);
- JS_STATIC_METHOD(buttonSetIcon, Field);
- JS_STATIC_METHOD(checkThisBox, Field);
- JS_STATIC_METHOD(clearItems, Field);
- JS_STATIC_METHOD(defaultIsChecked, Field);
- JS_STATIC_METHOD(deleteItemAt, Field);
- JS_STATIC_METHOD(getArray, Field);
- JS_STATIC_METHOD(getItemAt, Field);
- JS_STATIC_METHOD(getLock, Field);
- JS_STATIC_METHOD(insertItemAt, Field);
- JS_STATIC_METHOD(isBoxChecked, Field);
- JS_STATIC_METHOD(isDefaultChecked, Field);
- JS_STATIC_METHOD(setAction, Field);
- JS_STATIC_METHOD(setFocus, Field);
- JS_STATIC_METHOD(setItems, Field);
- JS_STATIC_METHOD(setLock, Field);
- JS_STATIC_METHOD(signatureGetModifications, Field);
- JS_STATIC_METHOD(signatureGetSeedValue, Field);
- JS_STATIC_METHOD(signatureInfo, Field);
- JS_STATIC_METHOD(signatureSetSeedValue, Field);
- JS_STATIC_METHOD(signatureSign, Field);
- JS_STATIC_METHOD(signatureValidate, Field);
-};
-
-#endif //_FIELD_H_
-
+// 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 _FIELD_H_
+#define _FIELD_H_
+
+class Document;
+
+enum FIELD_PROP
+{
+ FP_ALIGNMENT,
+ FP_BORDERSTYLE,
+ FP_BUTTONALIGNX,
+ FP_BUTTONALIGNY,
+ FP_BUTTONFITBOUNDS,
+ FP_BUTTONPOSITION,
+ FP_BUTTONSCALEHOW,
+ FP_BUTTONSCALEWHEN,
+ FP_CALCORDERINDEX,
+ FP_CHARLIMIT,
+ FP_COMB,
+ FP_COMMITONSELCHANGE,
+ FP_CURRENTVALUEINDICES,
+ FP_DEFAULTVALUE,
+ FP_DONOTSCROLL,
+ FP_DISPLAY,
+ FP_FILLCOLOR,
+ FP_HIDDEN,
+ FP_HIGHLIGHT,
+ FP_LINEWIDTH,
+ FP_MULTILINE,
+ FP_MULTIPLESELECTION,
+ FP_PASSWORD,
+ FP_RECT,
+ FP_RICHTEXT,
+ FP_RICHVALUE,
+ FP_ROTATION,
+ FP_STROKECOLOR,
+ FP_STYLE,
+ FP_TEXTCOLOR,
+ FP_TEXTFONT,
+ FP_TEXTSIZE,
+ FP_USERNAME,
+ FP_VALUE
+};
+
+class CJS_WideStringArray
+{
+public:
+ CJS_WideStringArray(){}
+ virtual ~CJS_WideStringArray()
+ {
+ for (int i=0,sz=m_Data.GetSize(); i<sz; i++)
+ delete m_Data.GetAt(i);
+ m_Data.RemoveAll();
+ }
+
+ void Add(const CFX_WideString& string)
+ {
+ m_Data.Add(new CFX_WideString(string));
+ }
+
+ int GetSize() const
+ {
+ return m_Data.GetSize();
+ }
+
+ CFX_WideString GetAt(int i) const
+ {
+ return *m_Data.GetAt(i);
+ }
+
+private:
+ CFX_ArrayTemplate<CFX_WideString*> m_Data;
+};
+
+struct CJS_DelayData
+{
+ CFX_WideString sFieldName;
+ int nControlIndex;
+ enum FIELD_PROP eProp;
+ FX_INT32 num;
+ bool b;
+ CFX_ByteString string;
+ CFX_WideString widestring;
+ CPDF_Rect rect;
+ CPWL_Color color;
+ CFX_DWordArray wordarray;
+ CJS_WideStringArray widestringarray;
+};
+
+class Field : public CJS_EmbedObj
+{
+public:
+ Field(CJS_Object* pJSObject);
+ virtual ~Field(void);
+
+ FX_BOOL alignment(OBJ_PROP_PARAMS);
+ FX_BOOL borderStyle(OBJ_PROP_PARAMS);
+ FX_BOOL buttonAlignX(OBJ_PROP_PARAMS);
+ FX_BOOL buttonAlignY(OBJ_PROP_PARAMS);
+ FX_BOOL buttonFitBounds(OBJ_PROP_PARAMS);
+ FX_BOOL buttonPosition(OBJ_PROP_PARAMS);
+ FX_BOOL buttonScaleHow(OBJ_PROP_PARAMS);
+ FX_BOOL buttonScaleWhen(OBJ_PROP_PARAMS);
+ FX_BOOL calcOrderIndex(OBJ_PROP_PARAMS);
+ FX_BOOL charLimit(OBJ_PROP_PARAMS);
+ FX_BOOL comb(OBJ_PROP_PARAMS);
+ FX_BOOL commitOnSelChange(OBJ_PROP_PARAMS);
+ FX_BOOL currentValueIndices(OBJ_PROP_PARAMS);
+ FX_BOOL defaultStyle(OBJ_PROP_PARAMS);
+ FX_BOOL defaultValue(OBJ_PROP_PARAMS);
+ FX_BOOL doNotScroll(OBJ_PROP_PARAMS);
+ FX_BOOL doNotSpellCheck(OBJ_PROP_PARAMS);
+ FX_BOOL delay(OBJ_PROP_PARAMS);
+ FX_BOOL display(OBJ_PROP_PARAMS);
+ FX_BOOL doc(OBJ_PROP_PARAMS);
+ FX_BOOL editable(OBJ_PROP_PARAMS);
+ FX_BOOL exportValues(OBJ_PROP_PARAMS);
+ FX_BOOL fileSelect(OBJ_PROP_PARAMS);
+ FX_BOOL fillColor(OBJ_PROP_PARAMS);
+ FX_BOOL hidden(OBJ_PROP_PARAMS);
+ FX_BOOL highlight(OBJ_PROP_PARAMS);
+ FX_BOOL lineWidth(OBJ_PROP_PARAMS);
+ FX_BOOL multiline(OBJ_PROP_PARAMS);
+ FX_BOOL multipleSelection(OBJ_PROP_PARAMS);
+ FX_BOOL name(OBJ_PROP_PARAMS);
+ FX_BOOL numItems(OBJ_PROP_PARAMS);
+ FX_BOOL page(OBJ_PROP_PARAMS);
+ FX_BOOL password(OBJ_PROP_PARAMS);
+ FX_BOOL print(OBJ_PROP_PARAMS);
+ FX_BOOL radiosInUnison(OBJ_PROP_PARAMS);
+ FX_BOOL readonly(OBJ_PROP_PARAMS);
+ FX_BOOL rect(OBJ_PROP_PARAMS);
+ FX_BOOL required(OBJ_PROP_PARAMS);
+ FX_BOOL richText(OBJ_PROP_PARAMS);
+ FX_BOOL richValue(OBJ_PROP_PARAMS);
+ FX_BOOL rotation(OBJ_PROP_PARAMS);
+ FX_BOOL strokeColor(OBJ_PROP_PARAMS);
+ FX_BOOL style(OBJ_PROP_PARAMS);
+ FX_BOOL submitName(OBJ_PROP_PARAMS);
+ FX_BOOL textColor(OBJ_PROP_PARAMS);
+ FX_BOOL textFont(OBJ_PROP_PARAMS);
+ FX_BOOL textSize(OBJ_PROP_PARAMS);
+ FX_BOOL type(OBJ_PROP_PARAMS);
+ FX_BOOL userName(OBJ_PROP_PARAMS);
+ FX_BOOL value(OBJ_PROP_PARAMS);
+ FX_BOOL valueAsString(OBJ_PROP_PARAMS);
+ FX_BOOL source(OBJ_PROP_PARAMS);
+
+ FX_BOOL browseForFileToSubmit(OBJ_METHOD_PARAMS);
+ FX_BOOL buttonGetCaption(OBJ_METHOD_PARAMS);
+ FX_BOOL buttonGetIcon(OBJ_METHOD_PARAMS);
+ FX_BOOL buttonImportIcon(OBJ_METHOD_PARAMS);
+ FX_BOOL buttonSetCaption(OBJ_METHOD_PARAMS);
+ FX_BOOL buttonSetIcon(OBJ_METHOD_PARAMS);
+ FX_BOOL checkThisBox(OBJ_METHOD_PARAMS);
+ FX_BOOL clearItems(OBJ_METHOD_PARAMS);
+ FX_BOOL defaultIsChecked(OBJ_METHOD_PARAMS);
+ FX_BOOL deleteItemAt(OBJ_METHOD_PARAMS);
+ FX_BOOL getArray(OBJ_METHOD_PARAMS);
+ FX_BOOL getItemAt(OBJ_METHOD_PARAMS);
+ FX_BOOL getLock(OBJ_METHOD_PARAMS);
+ FX_BOOL insertItemAt(OBJ_METHOD_PARAMS);
+ FX_BOOL isBoxChecked(OBJ_METHOD_PARAMS);
+ FX_BOOL isDefaultChecked(OBJ_METHOD_PARAMS);
+ FX_BOOL setAction(OBJ_METHOD_PARAMS);
+ FX_BOOL setFocus(OBJ_METHOD_PARAMS);
+ FX_BOOL setItems(OBJ_METHOD_PARAMS);
+ FX_BOOL setLock(OBJ_METHOD_PARAMS);
+ FX_BOOL signatureGetModifications(OBJ_METHOD_PARAMS);
+ FX_BOOL signatureGetSeedValue(OBJ_METHOD_PARAMS);
+ FX_BOOL signatureInfo(OBJ_METHOD_PARAMS);
+ FX_BOOL signatureSetSeedValue(OBJ_METHOD_PARAMS);
+ FX_BOOL signatureSign(OBJ_METHOD_PARAMS);
+ FX_BOOL signatureValidate(OBJ_METHOD_PARAMS);
+
+public:
+ static void SetAlignment(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CFX_ByteString& string);
+ static void SetBorderStyle(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CFX_ByteString& string);
+ static void SetButtonAlignX(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number);
+ static void SetButtonAlignY(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number);
+ static void SetButtonFitBounds(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b);
+ static void SetButtonPosition(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number);
+ static void SetButtonScaleHow(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number);
+ static void SetButtonScaleWhen(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number);
+ static void SetCalcOrderIndex(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number);
+ static void SetCharLimit(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number);
+ static void SetComb(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b);
+ static void SetCommitOnSelChange(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b);
+ static void SetCurrentValueIndices(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CFX_DWordArray& array);
+ static void SetDefaultStyle(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex);
+ static void SetDefaultValue(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CFX_WideString& string);
+ static void SetDoNotScroll(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b);
+ static void SetDisplay(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number);
+ static void SetFillColor(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CPWL_Color& color);
+ static void SetHidden(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b);
+ static void SetHighlight(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CFX_ByteString& string);
+ static void SetLineWidth(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number);
+ static void SetMultiline(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b);
+ static void SetMultipleSelection(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b);
+ static void SetPassword(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b);
+ static void SetRect(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CPDF_Rect& rect);
+ static void SetRichText(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b);
+ static void SetRichValue(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex);
+ static void SetRotation(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number);
+ static void SetStrokeColor(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CPWL_Color& color);
+ static void SetStyle(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CFX_ByteString& string);
+ static void SetTextColor(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CPWL_Color& color);
+ static void SetTextFont(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CFX_ByteString& string);
+ static void SetTextSize(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number);
+ static void SetUserName(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CFX_WideString& string);
+ static void SetValue(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CJS_WideStringArray& strArray);
+
+public:
+ static void AddField(CPDFSDK_Document* pDocument, int nPageIndex, int nFieldType,
+ const CFX_WideString& sName, const CPDF_Rect& rcCoords);
+public:
+ static void UpdateFormField(CPDFSDK_Document* pDocument, CPDF_FormField* pFormField,
+ FX_BOOL bChangeMark, FX_BOOL bResetAP, FX_BOOL bRefresh);
+ static void UpdateFormControl(CPDFSDK_Document* pDocument, CPDF_FormControl* pFormControl,
+ FX_BOOL bChangeMark, FX_BOOL bResetAP, FX_BOOL bRefresh);
+
+ static CPDFSDK_Widget* GetWidget(CPDFSDK_Document* pDocument, CPDF_FormControl* pFormControl);
+ static void GetFormFields(CPDFSDK_Document* pDocument, const CFX_WideString& csFieldName, CFX_PtrArray& FieldsArray);
+
+ static void DoDelay(CPDFSDK_Document* pDocument, CJS_DelayData* pData);
+
+public:
+ FX_BOOL AttachField(Document* pDocument, const CFX_WideString& csFieldName);
+ void SetDelay(FX_BOOL bDelay);
+ void SetIsolate(v8::Isolate* isolate) {m_isolate = isolate;}
+protected:
+ void ParseFieldName(const std::wstring &strFieldNameParsed,std::wstring &strFieldName,int & iControlNo);
+ void GetFormFields(const CFX_WideString& csFieldName, CFX_PtrArray& FieldsArray);
+ CPDF_FormControl* GetSmartFieldControl(CPDF_FormField* pFormField);
+ FX_BOOL ValueIsOccur(CPDF_FormField* pFormField, CFX_WideString csOptLabel);
+
+ void AddDelay_Int(enum FIELD_PROP prop, FX_INT32 n);
+ void AddDelay_Bool(enum FIELD_PROP prop,bool b);
+ void AddDelay_String(enum FIELD_PROP prop, const CFX_ByteString& string);
+ void AddDelay_WideString(enum FIELD_PROP prop, const CFX_WideString& string);
+ void AddDelay_Rect(enum FIELD_PROP prop, const CPDF_Rect& rect);
+ void AddDelay_Color(enum FIELD_PROP prop, const CPWL_Color& color);
+ void AddDelay_WordArray(enum FIELD_PROP prop, const CFX_DWordArray& array);
+ void AddDelay_WideStringArray(enum FIELD_PROP prop, const CJS_WideStringArray& array);
+
+ void DoDelay();
+public:
+ Document* m_pJSDoc;
+ CPDFSDK_Document* m_pDocument;
+ CFX_WideString m_FieldName;
+ int m_nFormControlIndex;
+ FX_BOOL m_bCanSet;
+
+ FX_BOOL m_bDelay;
+ v8::Isolate* m_isolate;
+};
+
+class CJS_Field : public CJS_Object
+{
+public:
+ CJS_Field(JSFXObject pObject) : CJS_Object(pObject) {};
+ virtual ~CJS_Field(void){};
+
+ virtual FX_BOOL InitInstance(IFXJS_Context* cc);
+
+ DECLARE_JS_CLASS(CJS_Field);
+
+ JS_STATIC_PROP(alignment, Field);
+ JS_STATIC_PROP(borderStyle, Field);
+ JS_STATIC_PROP(buttonAlignX, Field);
+ JS_STATIC_PROP(buttonAlignY, Field);
+ JS_STATIC_PROP(buttonFitBounds, Field);
+ JS_STATIC_PROP(buttonPosition, Field);
+ JS_STATIC_PROP(buttonScaleHow, Field);
+ JS_STATIC_PROP(buttonScaleWhen, Field);
+ JS_STATIC_PROP(calcOrderIndex, Field);
+ JS_STATIC_PROP(charLimit, Field);
+ JS_STATIC_PROP(comb, Field);
+ JS_STATIC_PROP(commitOnSelChange, Field);
+ JS_STATIC_PROP(currentValueIndices, Field);
+ JS_STATIC_PROP(defaultStyle, Field);
+ JS_STATIC_PROP(defaultValue, Field);
+ JS_STATIC_PROP(doNotScroll, Field);
+ JS_STATIC_PROP(doNotSpellCheck, Field);
+ JS_STATIC_PROP(delay, Field);
+ JS_STATIC_PROP(display, Field);
+ JS_STATIC_PROP(doc, Field);
+ JS_STATIC_PROP(editable, Field);
+ JS_STATIC_PROP(exportValues, Field);
+ JS_STATIC_PROP(fileSelect, Field);
+ JS_STATIC_PROP(fillColor, Field);
+ JS_STATIC_PROP(hidden, Field);
+ JS_STATIC_PROP(highlight, Field);
+ JS_STATIC_PROP(lineWidth, Field);
+ JS_STATIC_PROP(multiline, Field);
+ JS_STATIC_PROP(multipleSelection, Field);
+ JS_STATIC_PROP(name, Field);
+ JS_STATIC_PROP(numItems, Field);
+ JS_STATIC_PROP(page, Field);
+ JS_STATIC_PROP(password, Field);
+ JS_STATIC_PROP(print, Field);
+ JS_STATIC_PROP(radiosInUnison, Field);
+ JS_STATIC_PROP(readonly, Field);
+ JS_STATIC_PROP(rect, Field);
+ JS_STATIC_PROP(required, Field);
+ JS_STATIC_PROP(richText, Field);
+ JS_STATIC_PROP(richValue, Field);
+ JS_STATIC_PROP(rotation, Field);
+ JS_STATIC_PROP(strokeColor, Field);
+ JS_STATIC_PROP(style, Field);
+ JS_STATIC_PROP(submitName, Field);
+ JS_STATIC_PROP(textColor, Field);
+ JS_STATIC_PROP(textFont, Field);
+ JS_STATIC_PROP(textSize, Field);
+ JS_STATIC_PROP(type, Field);
+ JS_STATIC_PROP(userName, Field);
+ JS_STATIC_PROP(value, Field);
+ JS_STATIC_PROP(valueAsString, Field);
+ JS_STATIC_PROP(source, Field);
+
+ JS_STATIC_METHOD(browseForFileToSubmit, Field);
+ JS_STATIC_METHOD(buttonGetCaption, Field);
+ JS_STATIC_METHOD(buttonGetIcon, Field);
+ JS_STATIC_METHOD(buttonImportIcon, Field);
+ JS_STATIC_METHOD(buttonSetCaption, Field);
+ JS_STATIC_METHOD(buttonSetIcon, Field);
+ JS_STATIC_METHOD(checkThisBox, Field);
+ JS_STATIC_METHOD(clearItems, Field);
+ JS_STATIC_METHOD(defaultIsChecked, Field);
+ JS_STATIC_METHOD(deleteItemAt, Field);
+ JS_STATIC_METHOD(getArray, Field);
+ JS_STATIC_METHOD(getItemAt, Field);
+ JS_STATIC_METHOD(getLock, Field);
+ JS_STATIC_METHOD(insertItemAt, Field);
+ JS_STATIC_METHOD(isBoxChecked, Field);
+ JS_STATIC_METHOD(isDefaultChecked, Field);
+ JS_STATIC_METHOD(setAction, Field);
+ JS_STATIC_METHOD(setFocus, Field);
+ JS_STATIC_METHOD(setItems, Field);
+ JS_STATIC_METHOD(setLock, Field);
+ JS_STATIC_METHOD(signatureGetModifications, Field);
+ JS_STATIC_METHOD(signatureGetSeedValue, Field);
+ JS_STATIC_METHOD(signatureInfo, Field);
+ JS_STATIC_METHOD(signatureSetSeedValue, Field);
+ JS_STATIC_METHOD(signatureSign, Field);
+ JS_STATIC_METHOD(signatureValidate, Field);
+};
+
+#endif //_FIELD_H_
+
diff --git a/fpdfsdk/include/javascript/IJavaScript.h b/fpdfsdk/include/javascript/IJavaScript.h
index 567ee82651..3087b6a865 100644
--- a/fpdfsdk/include/javascript/IJavaScript.h
+++ b/fpdfsdk/include/javascript/IJavaScript.h
@@ -1,112 +1,112 @@
-// 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 _IJAVASCRIPT_H_
-#define _IJAVASCRIPT_H_
-
-class IFXJS_Context
-{
-public:
- virtual FX_BOOL Compile(const CFX_WideString& script, CFX_WideString& info) = 0;
- virtual FX_BOOL RunScript(const CFX_WideString& script, CFX_WideString& info) = 0;
-
-public:
- virtual void OnApp_Init() = 0;
-
- virtual void OnDoc_Open(CPDFSDK_Document* pDoc, const CFX_WideString& strTargetName) = 0;
- virtual void OnDoc_WillPrint(CPDFSDK_Document* pDoc) = 0;
- virtual void OnDoc_DidPrint(CPDFSDK_Document* pDoc) = 0;
- virtual void OnDoc_WillSave(CPDFSDK_Document* pDoc) = 0;
- virtual void OnDoc_DidSave(CPDFSDK_Document* pDoc) = 0;
- virtual void OnDoc_WillClose(CPDFSDK_Document* pDoc) = 0;
-
- virtual void OnPage_Open(CPDFSDK_Document* pTarget) = 0;
- virtual void OnPage_Close(CPDFSDK_Document* pTarget) = 0;
- virtual void OnPage_InView(CPDFSDK_Document* pTarget) = 0;
- virtual void OnPage_OutView(CPDFSDK_Document* pTarget) = 0;
-
- virtual void OnField_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget) = 0;
- virtual void OnField_MouseEnter(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget) = 0;
- virtual void OnField_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget) = 0;
- virtual void OnField_MouseUp(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget) = 0;
- virtual void OnField_Focus(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget, const CFX_WideString& Value) = 0;
- virtual void OnField_Blur(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget, const CFX_WideString& Value) = 0;
-
- virtual void OnField_Calculate(CPDF_FormField* pSource, CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL& bRc) = 0;
- virtual void OnField_Format(int nCommitKey, CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL bWillCommit) = 0;
- virtual void OnField_Keystroke(int nCommitKey, CFX_WideString& strChange, const CFX_WideString& strChangeEx,
- FX_BOOL KeyDown, FX_BOOL bModifier, int &nSelEnd,int &nSelStart, FX_BOOL bShift,
- CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL bWillCommit,
- FX_BOOL bFieldFull, FX_BOOL &bRc) = 0;
- virtual void OnField_Validate(CFX_WideString& strChange, const CFX_WideString& strChangeEx, FX_BOOL bKeyDown,
- FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL& bRc) = 0;
-
- virtual void OnScreen_Focus(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen) = 0;
- virtual void OnScreen_Blur(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen) = 0;
- virtual void OnScreen_Open(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen) = 0;
- virtual void OnScreen_Close(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen) = 0;
- virtual void OnScreen_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen) = 0;
- virtual void OnScreen_MouseUp(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen) = 0;
- virtual void OnScreen_MouseEnter(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen) = 0;
- virtual void OnScreen_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen) = 0;
- virtual void OnScreen_InView(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen) = 0;
- virtual void OnScreen_OutView(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen) = 0;
-
- virtual void OnBookmark_MouseUp(CPDF_Bookmark* pBookMark) = 0;
- virtual void OnLink_MouseUp(CPDFSDK_Document* pTarget) = 0;
-
- virtual void OnMenu_Exec(CPDFSDK_Document* pTarget, const CFX_WideString &) = 0;
- virtual void OnBatchExec(CPDFSDK_Document* pTarget) = 0;
- virtual void OnConsole_Exec() = 0;
- virtual void OnExternal_Exec() = 0;
-
- virtual void EnableMessageBox(FX_BOOL bEnable) = 0;
-};
-
-class IFXJS_Runtime
-{
-public:
- virtual IFXJS_Context* NewContext() = 0;
- virtual void ReleaseContext(IFXJS_Context * pContext) = 0;
- virtual IFXJS_Context* GetCurrentContext() = 0;
-
- virtual void SetReaderDocument(CPDFSDK_Document* pReaderDoc) = 0;
- virtual CPDFSDK_Document* GetReaderDocument() = 0;
-
- virtual void GetObjectNames(CFX_WideStringArray& array) = 0;
- virtual void GetObjectConsts(const CFX_WideString& swObjName, CFX_WideStringArray& array) = 0;
- virtual void GetObjectProps(const CFX_WideString& swObjName, CFX_WideStringArray& array) = 0;
- virtual void GetObjectMethods(const CFX_WideString& swObjName, CFX_WideStringArray& array) = 0;
-
- virtual void Exit() = 0;
- virtual void Enter() = 0;
- virtual FX_BOOL IsEntered() = 0;
-};
-
-class CPDFDoc_Environment;
-class CJS_GlobalData;
-
-class CJS_RuntimeFactory
-{
-public:
- CJS_RuntimeFactory():m_bInit(FALSE),m_nRef(0),m_pGlobalData(NULL),m_nGlobalDataCount(0) {}
- ~CJS_RuntimeFactory();
- IFXJS_Runtime* NewJSRuntime(CPDFDoc_Environment* pApp);
- void DeleteJSRuntime(IFXJS_Runtime* pRuntime);
- void AddRef();
- void Release();
-
- CJS_GlobalData* NewGlobalData(CPDFDoc_Environment* pApp);
- void ReleaseGlobalData();
-private:
- FX_BOOL m_bInit;
- int m_nRef;
- CJS_GlobalData* m_pGlobalData;
- FX_INT32 m_nGlobalDataCount;
-};
-
-#endif //_IJAVASCRIPT_H_
-
+// 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 _IJAVASCRIPT_H_
+#define _IJAVASCRIPT_H_
+
+class IFXJS_Context
+{
+public:
+ virtual FX_BOOL Compile(const CFX_WideString& script, CFX_WideString& info) = 0;
+ virtual FX_BOOL RunScript(const CFX_WideString& script, CFX_WideString& info) = 0;
+
+public:
+ virtual void OnApp_Init() = 0;
+
+ virtual void OnDoc_Open(CPDFSDK_Document* pDoc, const CFX_WideString& strTargetName) = 0;
+ virtual void OnDoc_WillPrint(CPDFSDK_Document* pDoc) = 0;
+ virtual void OnDoc_DidPrint(CPDFSDK_Document* pDoc) = 0;
+ virtual void OnDoc_WillSave(CPDFSDK_Document* pDoc) = 0;
+ virtual void OnDoc_DidSave(CPDFSDK_Document* pDoc) = 0;
+ virtual void OnDoc_WillClose(CPDFSDK_Document* pDoc) = 0;
+
+ virtual void OnPage_Open(CPDFSDK_Document* pTarget) = 0;
+ virtual void OnPage_Close(CPDFSDK_Document* pTarget) = 0;
+ virtual void OnPage_InView(CPDFSDK_Document* pTarget) = 0;
+ virtual void OnPage_OutView(CPDFSDK_Document* pTarget) = 0;
+
+ virtual void OnField_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget) = 0;
+ virtual void OnField_MouseEnter(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget) = 0;
+ virtual void OnField_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget) = 0;
+ virtual void OnField_MouseUp(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget) = 0;
+ virtual void OnField_Focus(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget, const CFX_WideString& Value) = 0;
+ virtual void OnField_Blur(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget, const CFX_WideString& Value) = 0;
+
+ virtual void OnField_Calculate(CPDF_FormField* pSource, CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL& bRc) = 0;
+ virtual void OnField_Format(int nCommitKey, CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL bWillCommit) = 0;
+ virtual void OnField_Keystroke(int nCommitKey, CFX_WideString& strChange, const CFX_WideString& strChangeEx,
+ FX_BOOL KeyDown, FX_BOOL bModifier, int &nSelEnd,int &nSelStart, FX_BOOL bShift,
+ CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL bWillCommit,
+ FX_BOOL bFieldFull, FX_BOOL &bRc) = 0;
+ virtual void OnField_Validate(CFX_WideString& strChange, const CFX_WideString& strChangeEx, FX_BOOL bKeyDown,
+ FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL& bRc) = 0;
+
+ virtual void OnScreen_Focus(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen) = 0;
+ virtual void OnScreen_Blur(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen) = 0;
+ virtual void OnScreen_Open(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen) = 0;
+ virtual void OnScreen_Close(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen) = 0;
+ virtual void OnScreen_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen) = 0;
+ virtual void OnScreen_MouseUp(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen) = 0;
+ virtual void OnScreen_MouseEnter(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen) = 0;
+ virtual void OnScreen_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen) = 0;
+ virtual void OnScreen_InView(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen) = 0;
+ virtual void OnScreen_OutView(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen) = 0;
+
+ virtual void OnBookmark_MouseUp(CPDF_Bookmark* pBookMark) = 0;
+ virtual void OnLink_MouseUp(CPDFSDK_Document* pTarget) = 0;
+
+ virtual void OnMenu_Exec(CPDFSDK_Document* pTarget, const CFX_WideString &) = 0;
+ virtual void OnBatchExec(CPDFSDK_Document* pTarget) = 0;
+ virtual void OnConsole_Exec() = 0;
+ virtual void OnExternal_Exec() = 0;
+
+ virtual void EnableMessageBox(FX_BOOL bEnable) = 0;
+};
+
+class IFXJS_Runtime
+{
+public:
+ virtual IFXJS_Context* NewContext() = 0;
+ virtual void ReleaseContext(IFXJS_Context * pContext) = 0;
+ virtual IFXJS_Context* GetCurrentContext() = 0;
+
+ virtual void SetReaderDocument(CPDFSDK_Document* pReaderDoc) = 0;
+ virtual CPDFSDK_Document* GetReaderDocument() = 0;
+
+ virtual void GetObjectNames(CFX_WideStringArray& array) = 0;
+ virtual void GetObjectConsts(const CFX_WideString& swObjName, CFX_WideStringArray& array) = 0;
+ virtual void GetObjectProps(const CFX_WideString& swObjName, CFX_WideStringArray& array) = 0;
+ virtual void GetObjectMethods(const CFX_WideString& swObjName, CFX_WideStringArray& array) = 0;
+
+ virtual void Exit() = 0;
+ virtual void Enter() = 0;
+ virtual FX_BOOL IsEntered() = 0;
+};
+
+class CPDFDoc_Environment;
+class CJS_GlobalData;
+
+class CJS_RuntimeFactory
+{
+public:
+ CJS_RuntimeFactory():m_bInit(FALSE),m_nRef(0),m_pGlobalData(NULL),m_nGlobalDataCount(0) {}
+ ~CJS_RuntimeFactory();
+ IFXJS_Runtime* NewJSRuntime(CPDFDoc_Environment* pApp);
+ void DeleteJSRuntime(IFXJS_Runtime* pRuntime);
+ void AddRef();
+ void Release();
+
+ CJS_GlobalData* NewGlobalData(CPDFDoc_Environment* pApp);
+ void ReleaseGlobalData();
+private:
+ FX_BOOL m_bInit;
+ int m_nRef;
+ CJS_GlobalData* m_pGlobalData;
+ FX_INT32 m_nGlobalDataCount;
+};
+
+#endif //_IJAVASCRIPT_H_
+
diff --git a/fpdfsdk/include/javascript/Icon.h b/fpdfsdk/include/javascript/Icon.h
index 26fec2ddfd..9426d322bd 100644
--- a/fpdfsdk/include/javascript/Icon.h
+++ b/fpdfsdk/include/javascript/Icon.h
@@ -1,42 +1,42 @@
-// 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 _ICON_H_
-#define _ICON_H_
-
-class Icon : public CJS_EmbedObj
-{
-public:
- Icon(CJS_Object* pJSObject);
- virtual ~Icon();
-
-public:
- FX_BOOL name(OBJ_PROP_PARAMS);
-
-public:
- void SetStream(CPDF_Stream* pIconStream);
- CPDF_Stream* GetStream();
- void SetIconName(CFX_WideString name);
- CFX_WideString GetIconName();
-private:
- CPDF_Stream* m_pIconStream;
- CFX_WideString m_swIconName;
-};
-
-class CJS_Icon : public CJS_Object
-{
-public:
- CJS_Icon(JSFXObject pObject) : CJS_Object(pObject){};
- virtual ~CJS_Icon(){};
-
-public:
- DECLARE_JS_CLASS(CJS_Icon);
-
- JS_STATIC_PROP(name, Icon);
-};
-
-#endif //_ICON_H_
-
+// 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 _ICON_H_
+#define _ICON_H_
+
+class Icon : public CJS_EmbedObj
+{
+public:
+ Icon(CJS_Object* pJSObject);
+ virtual ~Icon();
+
+public:
+ FX_BOOL name(OBJ_PROP_PARAMS);
+
+public:
+ void SetStream(CPDF_Stream* pIconStream);
+ CPDF_Stream* GetStream();
+ void SetIconName(CFX_WideString name);
+ CFX_WideString GetIconName();
+private:
+ CPDF_Stream* m_pIconStream;
+ CFX_WideString m_swIconName;
+};
+
+class CJS_Icon : public CJS_Object
+{
+public:
+ CJS_Icon(JSFXObject pObject) : CJS_Object(pObject){};
+ virtual ~CJS_Icon(){};
+
+public:
+ DECLARE_JS_CLASS(CJS_Icon);
+
+ JS_STATIC_PROP(name, Icon);
+};
+
+#endif //_ICON_H_
+
diff --git a/fpdfsdk/include/javascript/JS_Console.h b/fpdfsdk/include/javascript/JS_Console.h
index da842bdde7..f43513566c 100644
--- a/fpdfsdk/include/javascript/JS_Console.h
+++ b/fpdfsdk/include/javascript/JS_Console.h
@@ -1,239 +1,239 @@
-// 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 _JS_CONSOLE_H_
-#define _JS_CONSOLE_H_
-
-#include "../res/resource.h"
-
-#define WST_NONE 0x00 // No size changed
-#define WST_LEFT 0x01 // size to left
-#define WST_TOP 0x02 // size to top
-#define WST_RIGHT 0x04 // size to right
-#define WST_BOTTOM 0x08 // size to bottom
-#define WST_TOPLEFT (WST_TOP|WST_LEFT) // size to top & left
-#define WST_TOPRIGHT (WST_TOP|WST_RIGHT) // size to top & right
-#define WST_BOTTOMRIGHT (WST_BOTTOM|WST_RIGHT) // size to bottom & right
-#define WST_BOTTOMLEFT (WST_BOTTOM|WST_LEFT) // size to bottom & right
-
-#ifndef IDC_DLGSIZEBOX
-#define IDC_DLGSIZEBOX 50
-#endif /* IDC_DLGSIZEBOX */
-
-enum { m_idSizeIcon = IDC_DLGSIZEBOX };
-enum { // possible Control reSize Type
- CST_NONE = 0,
- CST_RESIZE, // NOMOVE + SIZE, add all delta-size of dlg to control
- CST_REPOS, // MOVE(absolutely) + NOSIZE, move control's pos by delta-size
- CST_RELATIVE, // MOVE(proportional) + NOSIZE, keep control always at a relative pos
- CST_ZOOM, // MOVE + SIZE (both are automatically proportional)
- CST_DELTA_ZOOM // MOVE(proportional, set manually) + SIZE(proportional, set manuall)
-};
-
-// contained class to hold item state
-//
-class CJS_ItemCtrl
-{
-public:
- UINT m_nID;
- UINT m_stxLeft : 4; // when left resizing ...
- UINT m_stxRight : 4; // when right resizing ...
- UINT m_styTop : 4; // when top resizing ...
- UINT m_styBottom : 4; // when bottom resizing ...
- UINT m_bFlickerFree : 1;
- UINT m_bInvalidate : 1; // Invalidate ctrl's rect(eg. no-automatical update for static when resize+move)
- UINT m_r0 : 14;
- CRect m_wRect;
- double m_xRatio, m_cxRatio;
- double m_yRatio, m_cyRatio;
-
-protected:
- void Assign(const CJS_ItemCtrl& src);
-
-public:
- CJS_ItemCtrl();
- CJS_ItemCtrl(const CJS_ItemCtrl& src);
-
- HDWP OnSize(HDWP hdwp, int sizeType, CRect *pnCltRect, CRect *poCltRect, CRect *pR0, CWnd *pDlg);
-
- CJS_ItemCtrl& operator=(const CJS_ItemCtrl& src);
-};
-
-class CJS_ResizeDlg : public CDialog
-{
-// DECLARE_DYNAMIC(CJS_ResizeDlg)
-public:
- CJS_ResizeDlg(UINT nID,CWnd *pParentWnd = NULL);
- virtual ~CJS_ResizeDlg();
-
-
-public:
- std::vector<CJS_ItemCtrl> m_Items; // array of controlled items
- CRect m_cltRect, m_cltR0;
- int m_xMin, m_yMin;
- int m_xSt, m_ySt; //step?
- UINT m_nDelaySide; //drag side of window
- CStatic m_wndSizeIcon; // size icon window
-
-protected:
- void AddControl( UINT nID, int xl, int xr, int yt, int yb, int bFlickerFree = 0,
- double xRatio = -1.0, double cxRatio = -1.0,
- double yRatio = -1.0, double cyRatio = -1.0 );
- void AllowSizing(int xst, int yst);
- void HideSizeIcon(void);
- virtual BOOL OnInitDialog();
-
- void OnSizing(UINT nSide, LPRECT lpRect);
- void OnSize(UINT nType, int cx, int cy);
- void OnGetMinMaxInfo(MINMAXINFO *pmmi);
- BOOL OnEraseBkgnd(CDC* pDC);
-
-public:
- int UpdateControlRect(UINT nID, CRect *pnr);
-};
-
-
-//------------------------CIconListBox for CWndElementList-------------------------------------
-
-class CIconListBox : public CListBox
-{
-public:
- CIconListBox();
- virtual ~CIconListBox();
-
-public:
- int InsertString(int nIndex, LPCWSTR lpszItem , int nImage);
- virtual void ResetContent();
- virtual void GetText(int nIndex, CString& rString);
-
- virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
- void MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct);
- int CompareItem(LPCOMPAREITEMSTRUCT lpCompareItemStruct);
-
-protected:
- // Generated message map functions
- //{{AFX_MSG(CIconListBox)
- afx_msg void OnMouseMove(UINT nFlags, CPoint point);
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-
-protected:
- struct ItemDatas
- {
- CString csText;
- int nImage;
- };
-};
-//----------------------------------CWndElementList--------------------------------------------
-#define IDC_LIST_JS_ELEMENT 10070
-
-#define ELEMENT_LIST_WIDTH 140
-#define ELEMENT_LIST_HEIGHT 180
-#define ELEMENT_LIST_TOP_OFFSET 13
-
-#define ELEMENT_TYPE_NAME 0
-#define ELEMENT_TYPE_CONST 1
-#define ELEMENT_TYPE_FUN 2
-#define ELEMENT_TYPE_PRO 3
-
-class CWndElementList : public CWnd
-{
-public:
- CWndElementList();
- virtual ~CWndElementList();
-
-public:
- virtual void OnSize(UINT nType, int cx, int cy);
- virtual BOOL Create(CWnd* pParentWnd);
- virtual BOOL ShowWindow(int nCmdShow);
- void RemoveAllElement();
- void SetElementList(LPCWSTR* pElement, int* pType , int iCount);
- void AddElement(CFX_WideString csValue , int nType);
- BOOL GetElementSel(CString &csElement);
- BOOL SelectNext();
- BOOL SelectPrevious();
- BOOL SelectFirst();
- BOOL SelectLast();
- BOOL SelectNextPage();
- BOOL SelectPreviousPage();
- int GetListHeight();
-
-protected:
- // Generated message map functions
- //{{AFX_MSG(CWndElementList)
- afx_msg void OnPaint();
- afx_msg BOOL OnNcActivate(BOOL bActive);
- afx_msg void OnSelJSElement();
- afx_msg void OnDblclkJSElement();
- afx_msg void OnDestroy();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-protected:
- CIconListBox m_ListBox;
- BOOL m_bBlock;
-};
-
-///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-// CJS_ConsoleDlg ¶Ô»°¿ò
-class CJS_ConsoleDlg : public CJS_ResizeDlg
-{
- DECLARE_DYNAMIC(CJS_ConsoleDlg)
-
-public:
- CJS_ConsoleDlg(CReader_App* pApp, CWnd* pParent);
- virtual ~CJS_ConsoleDlg();
-
- enum { IDD = IDD_JS_CONSOLE };
-
- void Create();
-
- void AppendConsoleText(const CFX_WideString& swText);
- void SetConsoleText(const CFX_WideString& swText);
- CFX_WideString GetConsoleText() const;
- CFX_WideString GetScriptText() const;
-
- BOOL ResetElementList(LPCWSTR lpstrRef);
- IFXJS_Runtime* GetJSRuntime();
-
-protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV Ö§³Ö
-
-protected:
- virtual BOOL OnInitDialog();
- virtual void OnCancel();
-
- virtual BOOL PreTranslateMessage(MSG* pMsg);
-
-protected:
- // Generated message map functions
- //{{AFX_MSG(CJS_ConsoleDlg)
- afx_msg void OnBnClickedClear();
- afx_msg void OnBnClickedOk();
- afx_msg void OnBnClickTips();
- afx_msg void OnSizing(UINT nSide, LPRECT lpRect);
- afx_msg void OnSize(UINT nType, int cx, int cy);
- afx_msg void OnGetMinMaxInfo(MINMAXINFO *pmmi);
- afx_msg BOOL OnEraseBkgnd(CDC* pDC);
- afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
-
- afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
- afx_msg void OnChangeScriptEdit(WPARAM wParam , LPARAM lParam);
- afx_msg void OnMove(int x , int y);
- public:
- virtual int DoModal();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-
-public:
- CGW_LineNumberEdit m_edtSC;
- BOOL m_bTips;
- const UINT m_uTextlimited;
- FX_HGLOBAL m_hGlobal;
- CReader_App * m_pApp;
- CWndElementList m_WndElementList;
-};
-
+// 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 _JS_CONSOLE_H_
+#define _JS_CONSOLE_H_
+
+#include "../res/resource.h"
+
+#define WST_NONE 0x00 // No size changed
+#define WST_LEFT 0x01 // size to left
+#define WST_TOP 0x02 // size to top
+#define WST_RIGHT 0x04 // size to right
+#define WST_BOTTOM 0x08 // size to bottom
+#define WST_TOPLEFT (WST_TOP|WST_LEFT) // size to top & left
+#define WST_TOPRIGHT (WST_TOP|WST_RIGHT) // size to top & right
+#define WST_BOTTOMRIGHT (WST_BOTTOM|WST_RIGHT) // size to bottom & right
+#define WST_BOTTOMLEFT (WST_BOTTOM|WST_LEFT) // size to bottom & right
+
+#ifndef IDC_DLGSIZEBOX
+#define IDC_DLGSIZEBOX 50
+#endif /* IDC_DLGSIZEBOX */
+
+enum { m_idSizeIcon = IDC_DLGSIZEBOX };
+enum { // possible Control reSize Type
+ CST_NONE = 0,
+ CST_RESIZE, // NOMOVE + SIZE, add all delta-size of dlg to control
+ CST_REPOS, // MOVE(absolutely) + NOSIZE, move control's pos by delta-size
+ CST_RELATIVE, // MOVE(proportional) + NOSIZE, keep control always at a relative pos
+ CST_ZOOM, // MOVE + SIZE (both are automatically proportional)
+ CST_DELTA_ZOOM // MOVE(proportional, set manually) + SIZE(proportional, set manuall)
+};
+
+// contained class to hold item state
+//
+class CJS_ItemCtrl
+{
+public:
+ UINT m_nID;
+ UINT m_stxLeft : 4; // when left resizing ...
+ UINT m_stxRight : 4; // when right resizing ...
+ UINT m_styTop : 4; // when top resizing ...
+ UINT m_styBottom : 4; // when bottom resizing ...
+ UINT m_bFlickerFree : 1;
+ UINT m_bInvalidate : 1; // Invalidate ctrl's rect(eg. no-automatical update for static when resize+move)
+ UINT m_r0 : 14;
+ CRect m_wRect;
+ double m_xRatio, m_cxRatio;
+ double m_yRatio, m_cyRatio;
+
+protected:
+ void Assign(const CJS_ItemCtrl& src);
+
+public:
+ CJS_ItemCtrl();
+ CJS_ItemCtrl(const CJS_ItemCtrl& src);
+
+ HDWP OnSize(HDWP hdwp, int sizeType, CRect *pnCltRect, CRect *poCltRect, CRect *pR0, CWnd *pDlg);
+
+ CJS_ItemCtrl& operator=(const CJS_ItemCtrl& src);
+};
+
+class CJS_ResizeDlg : public CDialog
+{
+// DECLARE_DYNAMIC(CJS_ResizeDlg)
+public:
+ CJS_ResizeDlg(UINT nID,CWnd *pParentWnd = NULL);
+ virtual ~CJS_ResizeDlg();
+
+
+public:
+ std::vector<CJS_ItemCtrl> m_Items; // array of controlled items
+ CRect m_cltRect, m_cltR0;
+ int m_xMin, m_yMin;
+ int m_xSt, m_ySt; //step?
+ UINT m_nDelaySide; //drag side of window
+ CStatic m_wndSizeIcon; // size icon window
+
+protected:
+ void AddControl( UINT nID, int xl, int xr, int yt, int yb, int bFlickerFree = 0,
+ double xRatio = -1.0, double cxRatio = -1.0,
+ double yRatio = -1.0, double cyRatio = -1.0 );
+ void AllowSizing(int xst, int yst);
+ void HideSizeIcon(void);
+ virtual BOOL OnInitDialog();
+
+ void OnSizing(UINT nSide, LPRECT lpRect);
+ void OnSize(UINT nType, int cx, int cy);
+ void OnGetMinMaxInfo(MINMAXINFO *pmmi);
+ BOOL OnEraseBkgnd(CDC* pDC);
+
+public:
+ int UpdateControlRect(UINT nID, CRect *pnr);
+};
+
+
+//------------------------CIconListBox for CWndElementList-------------------------------------
+
+class CIconListBox : public CListBox
+{
+public:
+ CIconListBox();
+ virtual ~CIconListBox();
+
+public:
+ int InsertString(int nIndex, LPCWSTR lpszItem , int nImage);
+ virtual void ResetContent();
+ virtual void GetText(int nIndex, CString& rString);
+
+ virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
+ void MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct);
+ int CompareItem(LPCOMPAREITEMSTRUCT lpCompareItemStruct);
+
+protected:
+ // Generated message map functions
+ //{{AFX_MSG(CIconListBox)
+ afx_msg void OnMouseMove(UINT nFlags, CPoint point);
+ //}}AFX_MSG
+ DECLARE_MESSAGE_MAP()
+
+protected:
+ struct ItemDatas
+ {
+ CString csText;
+ int nImage;
+ };
+};
+//----------------------------------CWndElementList--------------------------------------------
+#define IDC_LIST_JS_ELEMENT 10070
+
+#define ELEMENT_LIST_WIDTH 140
+#define ELEMENT_LIST_HEIGHT 180
+#define ELEMENT_LIST_TOP_OFFSET 13
+
+#define ELEMENT_TYPE_NAME 0
+#define ELEMENT_TYPE_CONST 1
+#define ELEMENT_TYPE_FUN 2
+#define ELEMENT_TYPE_PRO 3
+
+class CWndElementList : public CWnd
+{
+public:
+ CWndElementList();
+ virtual ~CWndElementList();
+
+public:
+ virtual void OnSize(UINT nType, int cx, int cy);
+ virtual BOOL Create(CWnd* pParentWnd);
+ virtual BOOL ShowWindow(int nCmdShow);
+ void RemoveAllElement();
+ void SetElementList(LPCWSTR* pElement, int* pType , int iCount);
+ void AddElement(CFX_WideString csValue , int nType);
+ BOOL GetElementSel(CString &csElement);
+ BOOL SelectNext();
+ BOOL SelectPrevious();
+ BOOL SelectFirst();
+ BOOL SelectLast();
+ BOOL SelectNextPage();
+ BOOL SelectPreviousPage();
+ int GetListHeight();
+
+protected:
+ // Generated message map functions
+ //{{AFX_MSG(CWndElementList)
+ afx_msg void OnPaint();
+ afx_msg BOOL OnNcActivate(BOOL bActive);
+ afx_msg void OnSelJSElement();
+ afx_msg void OnDblclkJSElement();
+ afx_msg void OnDestroy();
+ //}}AFX_MSG
+ DECLARE_MESSAGE_MAP()
+protected:
+ CIconListBox m_ListBox;
+ BOOL m_bBlock;
+};
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+// CJS_ConsoleDlg ¶Ô»°¿ò
+class CJS_ConsoleDlg : public CJS_ResizeDlg
+{
+ DECLARE_DYNAMIC(CJS_ConsoleDlg)
+
+public:
+ CJS_ConsoleDlg(CReader_App* pApp, CWnd* pParent);
+ virtual ~CJS_ConsoleDlg();
+
+ enum { IDD = IDD_JS_CONSOLE };
+
+ void Create();
+
+ void AppendConsoleText(const CFX_WideString& swText);
+ void SetConsoleText(const CFX_WideString& swText);
+ CFX_WideString GetConsoleText() const;
+ CFX_WideString GetScriptText() const;
+
+ BOOL ResetElementList(LPCWSTR lpstrRef);
+ IFXJS_Runtime* GetJSRuntime();
+
+protected:
+ virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV Ö§³Ö
+
+protected:
+ virtual BOOL OnInitDialog();
+ virtual void OnCancel();
+
+ virtual BOOL PreTranslateMessage(MSG* pMsg);
+
+protected:
+ // Generated message map functions
+ //{{AFX_MSG(CJS_ConsoleDlg)
+ afx_msg void OnBnClickedClear();
+ afx_msg void OnBnClickedOk();
+ afx_msg void OnBnClickTips();
+ afx_msg void OnSizing(UINT nSide, LPRECT lpRect);
+ afx_msg void OnSize(UINT nType, int cx, int cy);
+ afx_msg void OnGetMinMaxInfo(MINMAXINFO *pmmi);
+ afx_msg BOOL OnEraseBkgnd(CDC* pDC);
+ afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
+
+ afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
+ afx_msg void OnChangeScriptEdit(WPARAM wParam , LPARAM lParam);
+ afx_msg void OnMove(int x , int y);
+ public:
+ virtual int DoModal();
+ //}}AFX_MSG
+ DECLARE_MESSAGE_MAP()
+
+public:
+ CGW_LineNumberEdit m_edtSC;
+ BOOL m_bTips;
+ const UINT m_uTextlimited;
+ FX_HGLOBAL m_hGlobal;
+ CReader_App * m_pApp;
+ CWndElementList m_WndElementList;
+};
+
#endif //_JS_CONSOLE_H_ \ No newline at end of file
diff --git a/fpdfsdk/include/javascript/JS_Context.h b/fpdfsdk/include/javascript/JS_Context.h
index 0e79169d53..806808651d 100644
--- a/fpdfsdk/include/javascript/JS_Context.h
+++ b/fpdfsdk/include/javascript/JS_Context.h
@@ -1,101 +1,101 @@
-// 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 _JS_CONTEXT_H_
-#define _JS_CONTEXT_H_
-
-class CJS_EventHandler;
-class CJS_Runtime;
-
-class CJS_Context : public IFXJS_Context
-{
-public:
- CJS_Context(CJS_Runtime* pRuntime);
- virtual ~CJS_Context();
-
-public:
- virtual FX_BOOL Compile(const CFX_WideString& script, CFX_WideString& info);
- virtual FX_BOOL RunScript(const CFX_WideString& script, CFX_WideString& info);
-
-public:
- virtual void OnApp_Init();
-
- virtual void OnDoc_Open(CPDFSDK_Document* pDoc, const CFX_WideString& strTargetName);
- virtual void OnDoc_WillPrint(CPDFSDK_Document* pDoc);
- virtual void OnDoc_DidPrint(CPDFSDK_Document* pDoc);
- virtual void OnDoc_WillSave(CPDFSDK_Document* pDoc);
- virtual void OnDoc_DidSave(CPDFSDK_Document* pDoc);
- virtual void OnDoc_WillClose(CPDFSDK_Document* pDoc);
-
- virtual void OnPage_Open(CPDFSDK_Document* pTarget);
- virtual void OnPage_Close(CPDFSDK_Document* pTarget);
- virtual void OnPage_InView(CPDFSDK_Document* pTarget);
- virtual void OnPage_OutView(CPDFSDK_Document* pTarget);
-
- virtual void OnField_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField *pTarget);
- virtual void OnField_MouseEnter(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField *pTarget);
- virtual void OnField_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField *pTarget);
- virtual void OnField_MouseUp(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField *pTarget);
- virtual void OnField_Focus(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget, const CFX_WideString& Value);
- virtual void OnField_Blur(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget, const CFX_WideString& Value);
-
- virtual void OnField_Calculate(CPDF_FormField* pSource, CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL& bRc);
- virtual void OnField_Format(int nCommitKey, CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL bWillCommit);
- virtual void OnField_Keystroke(int nCommitKey, CFX_WideString& strChange, const CFX_WideString& strChangeEx,
- FX_BOOL bKeyDown, FX_BOOL bModifier, int &nSelEnd,int &nSelStart, FX_BOOL bShift,
- CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL bWillCommit,
- FX_BOOL bFieldFull, FX_BOOL &bRc);
- virtual void OnField_Validate(CFX_WideString& strChange, const CFX_WideString& strChangeEx, FX_BOOL bKeyDown,
- FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL& bRc);
-
- virtual void OnScreen_Focus(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen);
- virtual void OnScreen_Blur(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen);
- virtual void OnScreen_Open(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen);
- virtual void OnScreen_Close(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen);
- virtual void OnScreen_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen);
- virtual void OnScreen_MouseUp(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen);
- virtual void OnScreen_MouseEnter(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen);
- virtual void OnScreen_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen);
- virtual void OnScreen_InView(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen);
- virtual void OnScreen_OutView(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen);
-
- virtual void OnBookmark_MouseUp(CPDF_Bookmark* pBookMark);
- virtual void OnLink_MouseUp(CPDFSDK_Document* pTarget);
-
- virtual void OnMenu_Exec(CPDFSDK_Document* pTarget, const CFX_WideString& strTargetName);
- virtual void OnBatchExec(CPDFSDK_Document* pTarget);
- virtual void OnConsole_Exec();
- virtual void OnExternal_Exec();
-
- virtual void EnableMessageBox(FX_BOOL bEnable) {m_bMsgBoxEnable = bEnable;}
- FX_BOOL IsMsgBoxEnabled() const {return m_bMsgBoxEnable;}
-
-public:
- CPDFDoc_Environment* GetReaderApp();
- CJS_Runtime* GetJSRuntime(){return m_pRuntime;}
-
- FX_BOOL DoJob(int nMode, const CFX_WideString& script, CFX_WideString& info);
-
- CJS_EventHandler* GetEventHandler(){return m_pEventHandler;};
- CPDFSDK_Document* GetReaderDocument();
-
-private:
- CJS_Runtime* m_pRuntime;
- CJS_EventHandler* m_pEventHandler;
-
- FX_BOOL m_bBusy;
- FX_BOOL m_bMsgBoxEnable;
-};
-
-// static CFX_WideString JSGetStringFromID(CJS_Context* pContext, UINT ID)
-// {
-// ASSERT(pContext != NULL);
-//
-// return JS_LoadString(pContext->GetReaderApp(), ID);
-// }
-
-#endif //_JS_CONTEXT_H_
-
+// 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 _JS_CONTEXT_H_
+#define _JS_CONTEXT_H_
+
+class CJS_EventHandler;
+class CJS_Runtime;
+
+class CJS_Context : public IFXJS_Context
+{
+public:
+ CJS_Context(CJS_Runtime* pRuntime);
+ virtual ~CJS_Context();
+
+public:
+ virtual FX_BOOL Compile(const CFX_WideString& script, CFX_WideString& info);
+ virtual FX_BOOL RunScript(const CFX_WideString& script, CFX_WideString& info);
+
+public:
+ virtual void OnApp_Init();
+
+ virtual void OnDoc_Open(CPDFSDK_Document* pDoc, const CFX_WideString& strTargetName);
+ virtual void OnDoc_WillPrint(CPDFSDK_Document* pDoc);
+ virtual void OnDoc_DidPrint(CPDFSDK_Document* pDoc);
+ virtual void OnDoc_WillSave(CPDFSDK_Document* pDoc);
+ virtual void OnDoc_DidSave(CPDFSDK_Document* pDoc);
+ virtual void OnDoc_WillClose(CPDFSDK_Document* pDoc);
+
+ virtual void OnPage_Open(CPDFSDK_Document* pTarget);
+ virtual void OnPage_Close(CPDFSDK_Document* pTarget);
+ virtual void OnPage_InView(CPDFSDK_Document* pTarget);
+ virtual void OnPage_OutView(CPDFSDK_Document* pTarget);
+
+ virtual void OnField_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField *pTarget);
+ virtual void OnField_MouseEnter(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField *pTarget);
+ virtual void OnField_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField *pTarget);
+ virtual void OnField_MouseUp(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField *pTarget);
+ virtual void OnField_Focus(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget, const CFX_WideString& Value);
+ virtual void OnField_Blur(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget, const CFX_WideString& Value);
+
+ virtual void OnField_Calculate(CPDF_FormField* pSource, CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL& bRc);
+ virtual void OnField_Format(int nCommitKey, CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL bWillCommit);
+ virtual void OnField_Keystroke(int nCommitKey, CFX_WideString& strChange, const CFX_WideString& strChangeEx,
+ FX_BOOL bKeyDown, FX_BOOL bModifier, int &nSelEnd,int &nSelStart, FX_BOOL bShift,
+ CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL bWillCommit,
+ FX_BOOL bFieldFull, FX_BOOL &bRc);
+ virtual void OnField_Validate(CFX_WideString& strChange, const CFX_WideString& strChangeEx, FX_BOOL bKeyDown,
+ FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL& bRc);
+
+ virtual void OnScreen_Focus(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen);
+ virtual void OnScreen_Blur(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen);
+ virtual void OnScreen_Open(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen);
+ virtual void OnScreen_Close(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen);
+ virtual void OnScreen_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen);
+ virtual void OnScreen_MouseUp(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen);
+ virtual void OnScreen_MouseEnter(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen);
+ virtual void OnScreen_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen);
+ virtual void OnScreen_InView(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen);
+ virtual void OnScreen_OutView(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen);
+
+ virtual void OnBookmark_MouseUp(CPDF_Bookmark* pBookMark);
+ virtual void OnLink_MouseUp(CPDFSDK_Document* pTarget);
+
+ virtual void OnMenu_Exec(CPDFSDK_Document* pTarget, const CFX_WideString& strTargetName);
+ virtual void OnBatchExec(CPDFSDK_Document* pTarget);
+ virtual void OnConsole_Exec();
+ virtual void OnExternal_Exec();
+
+ virtual void EnableMessageBox(FX_BOOL bEnable) {m_bMsgBoxEnable = bEnable;}
+ FX_BOOL IsMsgBoxEnabled() const {return m_bMsgBoxEnable;}
+
+public:
+ CPDFDoc_Environment* GetReaderApp();
+ CJS_Runtime* GetJSRuntime(){return m_pRuntime;}
+
+ FX_BOOL DoJob(int nMode, const CFX_WideString& script, CFX_WideString& info);
+
+ CJS_EventHandler* GetEventHandler(){return m_pEventHandler;};
+ CPDFSDK_Document* GetReaderDocument();
+
+private:
+ CJS_Runtime* m_pRuntime;
+ CJS_EventHandler* m_pEventHandler;
+
+ FX_BOOL m_bBusy;
+ FX_BOOL m_bMsgBoxEnable;
+};
+
+// static CFX_WideString JSGetStringFromID(CJS_Context* pContext, UINT ID)
+// {
+// ASSERT(pContext != NULL);
+//
+// return JS_LoadString(pContext->GetReaderApp(), ID);
+// }
+
+#endif //_JS_CONTEXT_H_
+
diff --git a/fpdfsdk/include/javascript/JS_Define.h b/fpdfsdk/include/javascript/JS_Define.h
index 81d44550c4..cc20333706 100644
--- a/fpdfsdk/include/javascript/JS_Define.h
+++ b/fpdfsdk/include/javascript/JS_Define.h
@@ -1,785 +1,785 @@
-// 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 _JS_DEFINE_H_
-#define _JS_DEFINE_H_
-
-typedef v8::Value JSValue;
-typedef v8::Handle<v8::Object> JSObject;
-typedef v8::Handle<v8::Object> JSFXObject;
-typedef unsigned JSBool;
-
-struct JSConstSpec
-{
- const wchar_t* pName;
- double number;
- const wchar_t* string;
- FX_BYTE t; //0:double 1:str
-};
-
-struct JSPropertySpec
-{
- const wchar_t* pName;
- v8::AccessorGetterCallback pPropGet;
- v8::AccessorSetterCallback pPropPut;
-};
-
-struct JSMethodSpec
-{
- const wchar_t* pName;
- v8::FunctionCallback pMethodCall;
- unsigned nParamNum;
-};
-
-typedef CFX_WideString JS_ErrorString;
-
-#define JS_TRUE (unsigned)1
-#define JS_FALSE (unsigned)0
-
-
-#define CJS_PointsArray CFX_ArrayTemplate<float>
-#define CJS_IntArray CFX_ArrayTemplate<int>
-
-/* ====================================== PUBLIC DEFINE SPEC ============================================== */
-#ifndef __GNUC__
-#define JS_WIDESTRING(widestring) L#widestring
-#else
-#define JS_WIDESTRING(widestring) L""#widestring
-#endif
-
-#define OBJ_PROP_PARAMS IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError
-#define OBJ_METHOD_PARAMS IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError
-#define BEGIN_JS_STATIC_CONST(js_class_name) JSConstSpec js_class_name::JS_Class_Consts[] = {
-#define JS_STATIC_CONST_ENTRY_NUMBER(const_name, pValue) {JS_WIDESTRING(const_name), pValue, L"", 0},
-#define JS_STATIC_CONST_ENTRY_STRING(const_name, pValue) {JS_WIDESTRING(const_name), 0, JS_WIDESTRING(pValue), 1},
-#define END_JS_STATIC_CONST() {0, 0, 0, 0}};
-
-#define BEGIN_JS_STATIC_PROP(js_class_name) JSPropertySpec js_class_name::JS_Class_Properties[] = {
-#define JS_STATIC_PROP_ENTRY(prop_name) {JS_WIDESTRING(prop_name), get_##prop_name##_static, set_##prop_name##_static},
-#define END_JS_STATIC_PROP() {0, 0, 0}};
-
-#define BEGIN_JS_STATIC_METHOD(js_class_name) JSMethodSpec js_class_name::JS_Class_Methods[] = {
-#define JS_STATIC_METHOD_ENTRY(method_name, nargs) {JS_WIDESTRING(method_name), method_name##_static, nargs},
-#define END_JS_STATIC_METHOD() {0, 0, 0}};
-#define MEMLEAKCHECK_1() ((void)0)
-#define MEMLEAKCHECK_2(main_name, sub_name) ((void)0)
-
-
-/*
-#ifdef _DEBUG
-#define MEMLEAKCHECK_1() \
- _CrtMemState state1;\
- _CrtMemCheckpoint(&state1);
-
-#define MEMLEAKCHECK_2(main_name,sub_name) \
- _CrtMemState state2;\
- _CrtMemCheckpoint(&state2);\
- _CrtMemState diff;\
- _CrtMemDifference(&diff,&state1,&state2);\
- if (diff.lSizes[_NORMAL_BLOCK] > 0)\
- {\
- TRACE("Detected normal block memory leaks in JS Module! [%s.%s]\n",#main_name,#sub_name);\
- _CrtMemDumpStatistics(&diff);\
- }
-#else
- #define MEMLEAKCHECK_1() ((void)0)
- #define MEMLEAKCHECK_2(main_name,sub_name) ((void)0)
-#endif
-*/
-
-/* ======================================== PROP CALLBACK ============================================ */
-
-#define JS_STATIC_PROP_GET(prop_name, class_name)\
- static void get_##prop_name##_static(JS_PROPGET_ARGS)\
-{\
- v8::Isolate* isolate = info.GetIsolate();\
- v8::Local<v8::Context> context = isolate->GetCurrentContext();\
- v8::Local<v8::Value> v = context->GetEmbedderData(1);\
- ASSERT(!v.IsEmpty());\
- if(v.IsEmpty()) return;\
- v8::Handle<v8::External> field = v8::Handle<v8::External>::Cast(v);\
- IFXJS_Runtime* pRuntime = (IFXJS_Runtime*)field->Value();\
- IFXJS_Context* cc = pRuntime->GetCurrentContext();\
- CJS_PropValue value(isolate);\
- value.StartGetting();\
- CJS_Object* pJSObj = (CJS_Object*)JS_GetPrivate(isolate,info.Holder());\
- ASSERT(pJSObj != NULL);\
- class_name* pObj = (class_name*)pJSObj->GetEmbedObject();\
- ASSERT(pObj != NULL);\
- JS_ErrorString sError;\
- FX_BOOL bRet = FALSE;\
- try\
- {\
- MEMLEAKCHECK_1();\
- bRet = pObj->prop_name(cc, value, sError);\
- MEMLEAKCHECK_2(class_name, prop_name);\
- }\
- catch (...)\
- {\
- CFX_ByteString cbName;\
- cbName.Format("%s.%s", #class_name, #prop_name);\
- JS_Error(NULL,CFX_WideString::FromLocal(cbName), L"Unknown error is catched!");\
- return ;\
- }\
- if (bRet)\
- {\
- info.GetReturnValue().Set((v8::Handle<v8::Value>)value);\
- return ;\
- }\
- else\
- {\
- CFX_ByteString cbName;\
- cbName.Format("%s.%s", #class_name, #prop_name);\
- JS_Error(NULL,CFX_WideString::FromLocal(cbName), sError);\
- return ;\
- }\
-}
-
-#define JS_STATIC_PROP_SET(prop_name, class_name)\
- static void set_##prop_name##_static(JS_PROPPUT_ARGS)\
-{\
- v8::Isolate* isolate = info.GetIsolate();\
- v8::Local<v8::Context> context = isolate->GetCurrentContext();\
- v8::Local<v8::Value> v = context->GetEmbedderData(1);\
- ASSERT(!v.IsEmpty());\
- if(v.IsEmpty()) return;\
- v8::Handle<v8::External> field = v8::Handle<v8::External>::Cast(v);\
- IFXJS_Runtime* pRuntime = (IFXJS_Runtime*)field->Value();\
- IFXJS_Context* cc = pRuntime->GetCurrentContext();\
- CJS_PropValue propValue(CJS_Value(isolate,value,VT_unknown));\
- propValue.StartSetting();\
- CJS_Object* pJSObj = (CJS_Object*)JS_GetPrivate(isolate,info.Holder());\
- ASSERT(pJSObj != NULL);\
- class_name* pObj = (class_name*)pJSObj->GetEmbedObject();\
- ASSERT(pObj != NULL);\
- JS_ErrorString sError;\
- FX_BOOL bRet = FALSE;\
- try\
- {\
- MEMLEAKCHECK_1();\
- bRet = pObj->prop_name(cc, propValue, sError);\
- MEMLEAKCHECK_2(class_name, prop_name);\
- }\
- catch (...)\
- {\
- CFX_ByteString cbName;\
- cbName.Format("%s.%s", #class_name, #prop_name);\
- JS_Error(NULL,CFX_WideString::FromLocal(cbName), L"Unknown error is catched!");\
- return ;\
- }\
- if (bRet)\
- {\
- return ;\
- }\
- else\
- {\
- CFX_ByteString cbName;\
- cbName.Format("%s.%s", #class_name, #prop_name);\
- JS_Error(NULL,CFX_WideString::FromLocal(cbName), sError);\
- return ;\
- }\
-}
-
-#define JS_STATIC_PROP(prop_name, class_name)\
-JS_STATIC_PROP_GET(prop_name, class_name);\
-JS_STATIC_PROP_SET(prop_name, class_name)
-
-/* ========================================= METHOD CALLBACK =========================================== */
-
-#define JS_STATIC_METHOD(method_name, class_name)\
- static void method_name##_static(JS_METHOD_ARGS)\
-{\
- v8::Isolate* isolate = info.GetIsolate();\
- v8::Local<v8::Context> context = isolate->GetCurrentContext();\
- v8::Local<v8::Value> v = context->GetEmbedderData(1);\
- ASSERT(!v.IsEmpty());\
- if(v.IsEmpty()) return;\
- v8::Handle<v8::External> field = v8::Handle<v8::External>::Cast(v);\
- IFXJS_Runtime* pRuntime = (IFXJS_Runtime*)field->Value();\
- IFXJS_Context* cc = pRuntime->GetCurrentContext();\
- CJS_Parameters parameters;\
- for (unsigned int i = 0; i<(unsigned int)info.Length(); i++)\
- {\
- parameters.push_back(CJS_Value(isolate, info[i], VT_unknown));\
- }\
- CJS_Value valueRes(isolate);\
- CJS_Object* pJSObj = (CJS_Object *)JS_GetPrivate(isolate,info.Holder());\
- ASSERT(pJSObj != NULL);\
- class_name* pObj = (class_name*)pJSObj->GetEmbedObject();\
- ASSERT(pObj != NULL);\
- JS_ErrorString sError;\
- FX_BOOL bRet = FALSE;\
- try\
- {\
- MEMLEAKCHECK_1();\
- bRet = pObj->method_name(cc, parameters, valueRes, sError);\
- MEMLEAKCHECK_2(class_name, method_name);\
- }\
- catch (...)\
- {\
- CFX_ByteString cbName;\
- cbName.Format("%s.%s", #class_name, #method_name);\
- JS_Error(NULL, CFX_WideString::FromLocal(cbName), L"Unknown error is catched!");\
- return ;\
- }\
- if (bRet)\
- {\
- info.GetReturnValue().Set(valueRes.ToJSValue());\
- return ;\
- }\
- else\
- {\
- CFX_ByteString cbName;\
- cbName.Format("%s.%s", #class_name, #method_name);\
- JS_Error(NULL, CFX_WideString::FromLocal(cbName), sError);\
- return ;\
- }\
-}
-
-/* ===================================== JS CLASS =============================================== */
-
-#define DECLARE_JS_CLASS(js_class_name) \
- static JSBool JSConstructor(IFXJS_Context* cc, JSFXObject obj,JSFXObject global);\
- static JSBool JSDestructor(JSFXObject obj);\
- static int Init(IJS_Runtime* pRuntime, FXJSOBJTYPE eObjType);\
- static void GetConsts(JSConstSpec*& pConsts, int& nSize);\
- static void GetProperties(JSPropertySpec*& pProperties, int& nSize);\
- static void GetMethods(JSMethodSpec*& pMethods, int& nSize);\
- static JSConstSpec JS_Class_Consts[];\
- static JSPropertySpec JS_Class_Properties[];\
- static JSMethodSpec JS_Class_Methods[];\
- static const wchar_t* m_pClassName
-
-#define IMPLEMENT_JS_CLASS_RICH(js_class_name, class_alternate, class_name) \
-const wchar_t* js_class_name::m_pClassName = JS_WIDESTRING(class_name);\
-JSBool js_class_name::JSConstructor(IFXJS_Context* cc, JSFXObject obj, JSFXObject global)\
-{\
- CJS_Object* pObj = FX_NEW js_class_name(obj);\
- pObj->SetEmbedObject(FX_NEW class_alternate(pObj));\
- JS_SetPrivate(NULL,obj,(void*)pObj); \
- pObj->InitInstance(cc);\
- return JS_TRUE;\
-}\
-\
-JSBool js_class_name::JSDestructor(JSFXObject obj) \
-{\
- js_class_name* pObj = (js_class_name*)JS_GetPrivate(NULL,obj);\
- ASSERT(pObj != NULL);\
- pObj->ExitInstance();\
- delete pObj;\
- return JS_TRUE;\
-}\
-\
-int js_class_name::Init(IJS_Runtime* pRuntime, FXJSOBJTYPE eObjType)\
-{\
- int nObjDefnID = JS_DefineObj(pRuntime, js_class_name::m_pClassName, eObjType, JSConstructor, JSDestructor, 0);\
- if (nObjDefnID >= 0)\
- {\
- for (int j=0, szj=sizeof(JS_Class_Properties)/sizeof(JSPropertySpec)-1; j<szj; j++)\
- {\
- if (JS_DefineObjProperty(pRuntime, nObjDefnID, JS_Class_Properties[j].pName, JS_Class_Properties[j].pPropGet, JS_Class_Properties[j].pPropPut) < 0) return -1;\
- }\
- for (int k=0, szk=sizeof(JS_Class_Methods)/sizeof(JSMethodSpec)-1; k<szk; k++)\
- {\
- if (JS_DefineObjMethod(pRuntime, nObjDefnID,JS_Class_Methods[k].pName, JS_Class_Methods[k].pMethodCall, JS_Class_Methods[k].nParamNum) < 0) return -1;\
- }\
- return nObjDefnID;\
- }\
- return -1;\
-}\
-void js_class_name::GetConsts(JSConstSpec*& pConsts, int& nSize)\
-{\
- pConsts = JS_Class_Consts;\
- nSize = sizeof(JS_Class_Consts) / sizeof(JSConstSpec) - 1;\
-}\
-void js_class_name::GetProperties(JSPropertySpec*& pProperties, int& nSize)\
-{\
- pProperties = JS_Class_Properties;\
- nSize = sizeof(JS_Class_Properties) / sizeof(JSPropertySpec) - 1;\
-}\
-void js_class_name::GetMethods(JSMethodSpec*& pMethods, int& nSize)\
-{\
- pMethods = JS_Class_Methods;\
- nSize = sizeof(JS_Class_Methods) / sizeof(JSMethodSpec) - 1;\
-}
-
-#define IMPLEMENT_JS_CLASS(js_class_name, class_name) IMPLEMENT_JS_CLASS_RICH(js_class_name, class_name, class_name)
-
-/* ======================================== CONST CLASS ============================================ */
-
-#define DECLARE_JS_CLASS_CONST() \
- static int Init(IJS_Runtime* pRuntime, FXJSOBJTYPE eObjType);\
- static void GetConsts(JSConstSpec*& pConsts, int& nSize);\
- static JSConstSpec JS_Class_Consts[];\
- static const wchar_t* m_pClassName
-
-#define IMPLEMENT_JS_CLASS_CONST(js_class_name, class_name) \
-const wchar_t* js_class_name::m_pClassName = JS_WIDESTRING(class_name);\
-int js_class_name::Init(IJS_Runtime* pRuntime, FXJSOBJTYPE eObjType)\
-{\
- int nObjDefnID = JS_DefineObj(pRuntime, js_class_name::m_pClassName, eObjType, NULL, NULL, 0);\
- if (nObjDefnID >=0)\
- {\
- for (int i=0, sz=sizeof(JS_Class_Consts)/sizeof(JSConstSpec)-1; i<sz; i++)\
- {\
- if (JS_Class_Consts[i].t == 0)\
- {\
- if (JS_DefineObjConst(pRuntime, nObjDefnID, JS_Class_Consts[i].pName, JS_NewNumber(pRuntime,JS_Class_Consts[i].number)) < 0) return -1;\
- }\
- else\
- {\
- if (JS_DefineObjConst(pRuntime, nObjDefnID, JS_Class_Consts[i].pName, JS_NewString(pRuntime,JS_Class_Consts[i].string)) < 0) return -1;\
- }\
- }\
- return nObjDefnID;\
- }\
- return -1;\
-}\
-void js_class_name::GetConsts(JSConstSpec*& pConsts, int& nSize)\
-{\
- pConsts = JS_Class_Consts;\
- nSize = sizeof(JS_Class_Consts)/sizeof(JSConstSpec)-1;\
-}
-
-/* ===================================== SPECIAL JS CLASS =============================================== */
-
-#define DECLARE_SPECIAL_JS_CLASS(js_class_name) \
- static JSBool JSConstructor(IFXJS_Context* cc, JSFXObject obj, JSFXObject global);\
- static JSBool JSDestructor(JSFXObject obj);\
- static void GetConsts(JSConstSpec*& pConsts, int& nSize);\
- static void GetProperties(JSPropertySpec*& pProperties, int& nSize);\
- static void GetMethods(JSMethodSpec*& pMethods, int& nSize);\
- static JSConstSpec JS_Class_Consts[];\
- static JSPropertySpec JS_Class_Properties[];\
- static JSMethodSpec JS_Class_Methods[];\
- static int Init(IJS_Runtime* pRuntime, FXJSOBJTYPE eObjType);\
- static const wchar_t* m_pClassName;\
- static void queryprop_##js_class_name##_static(JS_PROPQUERY_ARGS);\
- static void getprop_##js_class_name##_static(JS_NAMED_PROPGET_ARGS);\
- static void putprop_##js_class_name##_static(JS_NAMED_PROPPUT_ARGS);\
- static void delprop_##js_class_name##_static(JS_PROPDEL_ARGS)
-
-#define IMPLEMENT_SPECIAL_JS_CLASS(js_class_name, class_alternate, class_name) \
-const wchar_t * js_class_name::m_pClassName = JS_WIDESTRING(class_name);\
- void js_class_name::queryprop_##js_class_name##_static(JS_PROPQUERY_ARGS)\
-{\
- v8::Isolate* isolate = info.GetIsolate();\
- v8::String::Utf8Value utf8_value(property);\
- CFX_WideString propname = CFX_WideString::FromUTF8(*utf8_value, utf8_value.length());\
- CJS_Object* pJSObj = (CJS_Object*)JS_GetPrivate(isolate,info.Holder());\
- ASSERT(pJSObj != NULL);\
- class_alternate* pObj = (class_alternate*)pJSObj->GetEmbedObject();\
- ASSERT(pObj != NULL);\
- FX_BOOL bRet = FALSE;\
- try\
- {\
- MEMLEAKCHECK_1();\
- bRet = pObj->QueryProperty((FX_LPCWSTR)propname);\
- MEMLEAKCHECK_2(class_name, (FX_LPCWSTR)prop_name);\
- }\
- catch (...)\
- {\
- return ;\
- }\
- if (bRet)\
- {\
- info.GetReturnValue().Set(0x004);\
- return ;\
- }\
- else\
- {\
- info.GetReturnValue().Set(0);\
- return ;\
- }\
- return ;\
-}\
- void js_class_name::getprop_##js_class_name##_static(JS_NAMED_PROPGET_ARGS)\
-{\
- v8::Isolate* isolate = info.GetIsolate();\
- v8::Local<v8::Context> context = isolate->GetCurrentContext();\
- v8::Local<v8::Value> v = context->GetEmbedderData(1);\
- ASSERT(!v.IsEmpty());\
- if(v.IsEmpty()) return;\
- v8::Handle<v8::External> field = v8::Handle<v8::External>::Cast(v);\
- IFXJS_Runtime* pRuntime = (IFXJS_Runtime*)field->Value();\
- IFXJS_Context* cc = pRuntime->GetCurrentContext();\
- v8::String::Utf8Value utf8_value(property);\
- CFX_WideString propname = CFX_WideString::FromUTF8(*utf8_value, utf8_value.length());\
- CJS_PropValue value(isolate);\
- value.StartGetting();\
- CJS_Object* pJSObj = (CJS_Object*)JS_GetPrivate(isolate,info.Holder());\
- ASSERT(pJSObj != NULL);\
- class_alternate* pObj = (class_alternate*)pJSObj->GetEmbedObject();\
- ASSERT(pObj != NULL);\
- JS_ErrorString sError;\
- FX_BOOL bRet = FALSE;\
- try\
- {\
- MEMLEAKCHECK_1();\
- bRet = pObj->DoProperty(cc, (FX_LPCWSTR)propname, value, sError);\
- MEMLEAKCHECK_2(class_name, L"GetProperty");\
- }\
- catch (...)\
- {\
- CFX_ByteString cbName;\
- cbName.Format("%s.%s", #class_name, L"GetProperty");\
- JS_Error(NULL,CFX_WideString::FromLocal(cbName), L"Unknown error is catched!");\
- return ;\
- }\
- if (bRet)\
- {\
- info.GetReturnValue().Set((v8::Handle<v8::Value>)value);\
- return ;\
- }\
- else\
- {\
- CFX_ByteString cbName;\
- cbName.Format("%s.%s", #class_name, L"GetProperty");\
- JS_Error(NULL,CFX_WideString::FromLocal(cbName), sError);\
- return ;\
- }\
- JS_Error(NULL,L"GetProperty", L"Embeded object not found!");\
- return ;\
-}\
- void js_class_name::putprop_##js_class_name##_static(JS_NAMED_PROPPUT_ARGS)\
-{\
- v8::Isolate* isolate = info.GetIsolate();\
- v8::Local<v8::Context> context = isolate->GetCurrentContext();\
- v8::Local<v8::Value> v = context->GetEmbedderData(1);\
- ASSERT(!v.IsEmpty());\
- if(v.IsEmpty()) return;\
- v8::Handle<v8::External> field = v8::Handle<v8::External>::Cast(v);\
- IFXJS_Runtime* pRuntime = (IFXJS_Runtime*)field->Value();\
- IFXJS_Context* cc = pRuntime->GetCurrentContext();\
- v8::String::Utf8Value utf8_value(property);\
- CFX_WideString propname = CFX_WideString::FromUTF8(*utf8_value, utf8_value.length());\
- CJS_PropValue PropValue(CJS_Value(isolate,value,VT_unknown));\
- PropValue.StartSetting();\
- CJS_Object* pJSObj = (CJS_Object*)JS_GetPrivate(isolate,info.Holder());\
- if(!pJSObj) return;\
- class_alternate* pObj = (class_alternate*)pJSObj->GetEmbedObject();\
- ASSERT(pObj != NULL);\
- JS_ErrorString sError;\
- FX_BOOL bRet = FALSE;\
- try\
- {\
- MEMLEAKCHECK_1();\
- bRet = pObj->DoProperty(cc, (FX_LPCWSTR)propname, PropValue, sError);\
- MEMLEAKCHECK_2(class_name,L"PutProperty");\
- }\
- catch (...)\
- {\
- CFX_ByteString cbName;\
- cbName.Format("%s.%s", #class_name, "PutProperty");\
- JS_Error(NULL,CFX_WideString::FromLocal(cbName), L"Unknown error is catched!");\
- return ;\
- }\
- if (bRet)\
- {\
- return ;\
- }\
- else\
- {\
- CFX_ByteString cbName;\
- cbName.Format("%s.%s", #class_name, "PutProperty");\
- JS_Error(NULL,CFX_WideString::FromLocal(cbName), sError);\
- return ;\
- }\
- JS_Error(NULL,L"PutProperty", L"Embeded object not found!");\
- return ;\
-}\
- void js_class_name::delprop_##js_class_name##_static(JS_PROPDEL_ARGS)\
-{\
- v8::Isolate* isolate = info.GetIsolate();\
- v8::Local<v8::Context> context = isolate->GetCurrentContext();\
- v8::Local<v8::Value> v = context->GetEmbedderData(1);\
- ASSERT(!v.IsEmpty());\
- if(v.IsEmpty()) return;\
- v8::Handle<v8::External> field = v8::Handle<v8::External>::Cast(v);\
- IFXJS_Runtime* pRuntime = (IFXJS_Runtime*)field->Value();\
- IFXJS_Context* cc = pRuntime->GetCurrentContext();\
- v8::String::Utf8Value utf8_value(property);\
- CFX_WideString propname = CFX_WideString::FromUTF8(*utf8_value, utf8_value.length());\
- CJS_Object* pJSObj = (CJS_Object*)JS_GetPrivate(isolate,info.Holder());\
- ASSERT(pJSObj != NULL);\
- class_alternate* pObj = (class_alternate*)pJSObj->GetEmbedObject();\
- ASSERT(pObj != NULL);\
- JS_ErrorString sError;\
- FX_BOOL bRet = FALSE;\
- try\
- {\
- MEMLEAKCHECK_1();\
- bRet = pObj->DelProperty(cc, (FX_LPCWSTR)propname, sError);\
- MEMLEAKCHECK_2(class_name,L"DelProperty");\
- }\
- catch (...)\
- {\
- CFX_ByteString cbName;\
- cbName.Format("%s.%s", #class_name, "DelProperty");\
- return ;\
- }\
- if (bRet)\
- {\
- return ;\
- }\
- else\
- {\
- CFX_ByteString cbName;\
- cbName.Format("%s.%s", #class_name, "DelProperty");\
- return ;\
- }\
- return ;\
-}\
-JSBool js_class_name::JSConstructor(IFXJS_Context* cc, JSFXObject obj,JSFXObject global)\
-{\
- CJS_Object* pObj = FX_NEW js_class_name(obj);\
- pObj->SetEmbedObject(FX_NEW class_alternate(pObj));\
- JS_SetPrivate(NULL,obj, (void*)pObj); \
- pObj->InitInstance(cc);\
- return JS_TRUE;\
-}\
-\
-JSBool js_class_name::JSDestructor(JSFXObject obj) \
-{\
- js_class_name* pObj = (js_class_name*)JS_GetPrivate(NULL,obj);\
- ASSERT(pObj != NULL);\
- pObj->ExitInstance();\
- delete pObj;\
- return JS_TRUE;\
-}\
-\
-int js_class_name::Init(IJS_Runtime* pRuntime, FXJSOBJTYPE eObjType)\
-{\
-\
- int nObjDefnID = JS_DefineObj(pRuntime, js_class_name::m_pClassName, eObjType, JSConstructor, JSDestructor, 0);\
-\
- if (nObjDefnID >= 0)\
- {\
- for (int j=0, szj=sizeof(JS_Class_Properties)/sizeof(JSPropertySpec)-1; j<szj; j++)\
- {\
- if (JS_DefineObjProperty(pRuntime, nObjDefnID, JS_Class_Properties[j].pName, JS_Class_Properties[j].pPropGet,JS_Class_Properties[j].pPropPut)<0)return -1;\
- }\
-\
- for (int k=0, szk=sizeof(JS_Class_Methods)/sizeof(JSMethodSpec)-1; k<szk; k++)\
- {\
- if (JS_DefineObjMethod(pRuntime, nObjDefnID,JS_Class_Methods[k].pName,JS_Class_Methods[k].pMethodCall,JS_Class_Methods[k].nParamNum)<0)return -1;\
- }\
- if (JS_DefineObjAllProperties(pRuntime, nObjDefnID, js_class_name::queryprop_##js_class_name##_static, js_class_name::getprop_##js_class_name##_static,js_class_name::putprop_##js_class_name##_static,js_class_name::delprop_##js_class_name##_static)<0) return -1;\
-\
- return nObjDefnID;\
- }\
-\
- return -1;\
-}\
-void js_class_name::GetConsts(JSConstSpec*& pConsts, int& nSize)\
-{\
- pConsts = JS_Class_Consts;\
- nSize = sizeof(JS_Class_Consts)/sizeof(JSConstSpec)-1;\
-}\
-void js_class_name::GetProperties(JSPropertySpec*& pProperties, int& nSize)\
-{\
- pProperties = JS_Class_Properties;\
- nSize = sizeof(JS_Class_Properties)/sizeof(JSPropertySpec)-1;\
-}\
-void js_class_name::GetMethods(JSMethodSpec*& pMethods, int& nSize)\
-{\
- pMethods = JS_Class_Methods;\
- nSize = sizeof(JS_Class_Methods)/sizeof(JSMethodSpec)-1;\
-}
-
-#define JS_SPECIAL_STATIC_METHOD(method_name, class_alternate, class_name)\
- static void method_name##_static(JS_METHOD_ARGS)\
-{\
- v8::Isolate* isolate = info.GetIsolate();\
- v8::Local<v8::Context> context = isolate->GetCurrentContext();\
- v8::Local<v8::Value> v = context->GetEmbedderData(1);\
- ASSERT(!v.IsEmpty());\
- if(v.IsEmpty()) return;\
- v8::Handle<v8::External> field = v8::Handle<v8::External>::Cast(v);\
- IFXJS_Runtime* pRuntime = (IFXJS_Runtime*)field->Value();\
- IFXJS_Context* cc = pRuntime->GetCurrentContext();\
- CJS_Parameters parameters;\
- for (unsigned int i = 0; i<(unsigned int)info.Length(); i++)\
- {\
- parameters.push_back(CJS_Value(isolate, info[i], VT_unknown));\
- }\
- CJS_Value valueRes(isolate);\
- CJS_Object* pJSObj = (CJS_Object *)JS_GetPrivate(isolate, info.Holder());\
- ASSERT(pJSObj != NULL);\
- class_alternate* pObj = (class_alternate*)pJSObj->GetEmbedObject();\
- ASSERT(pObj != NULL);\
- JS_ErrorString sError;\
- FX_BOOL bRet = FALSE;\
- try\
- {\
- MEMLEAKCHECK_1();\
- bRet = pObj->method_name(cc, parameters, valueRes, sError);\
- MEMLEAKCHECK_2(class_name, method_name);\
- }\
- catch (...)\
- {\
- CFX_ByteString cbName;\
- cbName.Format("%s.%s", #class_name, #method_name);\
- JS_Error(NULL, CFX_WideString::FromLocal(cbName), L"Unknown error is catched!");\
- return ;\
- }\
- if (bRet)\
- {\
- info.GetReturnValue().Set(valueRes.ToJSValue());\
- return ;\
- }\
- else\
- {\
- CFX_ByteString cbName;\
- cbName.Format("%s.%s", #class_name, #method_name);\
- JS_Error(NULL, CFX_WideString::FromLocal(cbName), sError);\
- return ;\
- }\
- JS_Error(NULL, JS_WIDESTRING(method_name), L"Embeded object not found!");\
- return ;\
-}
-
-/* ======================================== GLOBAL METHODS ============================================ */
-#define JS_STATIC_GLOBAL_FUN(fun_name) \
-static void fun_name##_static(JS_METHOD_ARGS)\
-{\
- v8::Isolate* isolate = info.GetIsolate();\
- v8::Local<v8::Context> context = isolate->GetCurrentContext();\
- v8::Local<v8::Value> v = context->GetEmbedderData(1);\
- ASSERT(!v.IsEmpty());\
- if(v.IsEmpty()) return;\
- v8::Handle<v8::External> field = v8::Handle<v8::External>::Cast(v);\
- IFXJS_Runtime* pRuntime = (IFXJS_Runtime*)field->Value();\
- IFXJS_Context* cc = pRuntime->GetCurrentContext();\
- CJS_Parameters parameters;\
- for (unsigned int i = 0; i<(unsigned int)info.Length(); i++)\
- {\
- parameters.push_back(CJS_Value(isolate, info[i], VT_unknown));\
- }\
- CJS_Value valueRes(isolate);\
- JS_ErrorString sError;\
- if (!fun_name(cc, parameters, valueRes, sError))\
- {\
- JS_Error(NULL, JS_WIDESTRING(fun_name), sError);\
- return ;\
- }\
- info.GetReturnValue().Set(valueRes.ToJSValue());\
- return ;\
-}
-
-#define JS_STATIC_DECLARE_GLOBAL_FUN() \
-static JSMethodSpec global_methods[]; \
-static int Init(IJS_Runtime* pRuntime)
-
-#define BEGIN_JS_STATIC_GLOBAL_FUN(js_class_name) \
-JSMethodSpec js_class_name::global_methods[] = {
-
-#define JS_STATIC_GLOBAL_FUN_ENTRY(method_name,nargs) JS_STATIC_METHOD_ENTRY(method_name,nargs)
-
-#define END_JS_STATIC_GLOBAL_FUN() END_JS_STATIC_METHOD()
-
-#define IMPLEMENT_JS_STATIC_GLOBAL_FUN(js_class_name) \
-int js_class_name::Init(IJS_Runtime* pRuntime)\
-{\
- for (int i=0, sz=sizeof(js_class_name::global_methods)/sizeof(JSMethodSpec)-1; i<sz; i++)\
- {\
- if (JS_DefineGlobalMethod(pRuntime,\
- js_class_name::global_methods[i].pName,\
- js_class_name::global_methods[i].pMethodCall,\
- js_class_name::global_methods[i].nParamNum\
- ) < 0\
- )return -1;\
- }\
- return 0;\
-}
-
-/* ======================================== GLOBAL CONSTS ============================================ */
-#define DEFINE_GLOBAL_CONST(pRuntime, const_name , const_value)\
-if (JS_DefineGlobalConst(pRuntime,JS_WIDESTRING(const_name),JS_NewString(pRuntime,JS_WIDESTRING(const_value)))) return -1
-
-/* ======================================== GLOBAL ARRAYS ============================================ */
-
-#define DEFINE_GLOBAL_ARRAY(pRuntime)\
-int size = sizeof(ArrayContent) / sizeof(FX_LPCWSTR);\
-\
-CJS_Array array(pRuntime);\
-for (int i=0; i<size; i++) array.SetElement(i,CJS_Value(pRuntime,(FX_LPCWSTR)ArrayContent[i]));\
-\
-CJS_PropValue prop(pRuntime);\
-prop << array;\
-if (JS_DefineGlobalConst(pRuntime, (const wchar_t*)ArrayName, prop.ToJSValue()) < 0)\
- return -1
-
-/* ============================================================ */
-
-#define VALUE_NAME_STRING L"string"
-#define VALUE_NAME_NUMBER L"number"
-#define VALUE_NAME_BOOLEAN L"boolean"
-#define VALUE_NAME_DATE L"date"
-#define VALUE_NAME_OBJECT L"object"
-#define VALUE_NAME_FXOBJ L"fxobj"
-#define VALUE_NAME_NULL L"null"
-#define VALUE_NAME_UNDEFINED L"undefined"
-
-#define CLASSNAME_ARRAY L"Array"
-#define CLASSNAME_DATE L"Date"
-#define CLASSNAME_STRING L"v8::String"
-
-const unsigned int JSCONST_nStringHash = JS_CalcHash(VALUE_NAME_STRING,wcslen(VALUE_NAME_STRING));
-const unsigned int JSCONST_nNumberHash = JS_CalcHash(VALUE_NAME_NUMBER,wcslen(VALUE_NAME_NUMBER));
-const unsigned int JSCONST_nBoolHash = JS_CalcHash(VALUE_NAME_BOOLEAN,wcslen(VALUE_NAME_BOOLEAN));
-const unsigned int JSCONST_nDateHash = JS_CalcHash(VALUE_NAME_DATE,wcslen(VALUE_NAME_DATE));
-const unsigned int JSCONST_nObjectHash = JS_CalcHash(VALUE_NAME_OBJECT,wcslen(VALUE_NAME_OBJECT));
-const unsigned int JSCONST_nFXobjHash = JS_CalcHash(VALUE_NAME_FXOBJ,wcslen(VALUE_NAME_FXOBJ));
-const unsigned int JSCONST_nNullHash = JS_CalcHash(VALUE_NAME_NULL,wcslen(VALUE_NAME_NULL));
-const unsigned int JSCONST_nUndefHash = JS_CalcHash(VALUE_NAME_UNDEFINED,wcslen(VALUE_NAME_UNDEFINED));
-
-static FXJSVALUETYPE GET_VALUE_TYPE(v8::Handle<v8::Value> p)
-{
-
- const unsigned int nHash = JS_CalcHash(JS_GetTypeof(p));
-
- if (nHash == JSCONST_nUndefHash)
- return VT_undefined;
- else if (nHash == JSCONST_nNullHash)
- return VT_null;
- else if (nHash == JSCONST_nStringHash)
- return VT_string;
- else if (nHash == JSCONST_nNumberHash)
- return VT_number;
- else if (nHash == JSCONST_nBoolHash)
- return VT_boolean;
- else if (nHash == JSCONST_nDateHash)
- return VT_date;
- else if (nHash == JSCONST_nObjectHash)
- return VT_object;
- else if (nHash == JSCONST_nFXobjHash)
- return VT_fxobject;
-
- /*
- const char * sType = p->getTypeof()->toDchars();
- if (strcmp(sType,VALUE_NAME_STRING) == 0)
- return VT_string;
- else if (strcmp(sType,VALUE_NAME_NUMBER) == 0)
- return VT_number;
- else if (strcmp(sType,VALUE_NAME_BOOLEAN) == 0)
- return VT_boolean;
- else if (strcmp(sType,VALUE_NAME_DATE) == 0)
- return VT_date;
- else if (strcmp(sType,VALUE_NAME_OBJECT) == 0)
- return VT_object;
- else if (strcmp(sType,VALUE_NAME_FXOBJ) == 0)
- return VT_object;
- else if (strcmp(sType,VALUE_NAME_NULL) == 0)
- return VT_null;
- else if (strcmp(sType,VALUE_NAME_UNDEFINED) == 0)
- return VT_undefined;
- */
-
- return VT_unknown;
-}
-
-#endif //_JS_DEFINE_H_
+// 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 _JS_DEFINE_H_
+#define _JS_DEFINE_H_
+
+typedef v8::Value JSValue;
+typedef v8::Handle<v8::Object> JSObject;
+typedef v8::Handle<v8::Object> JSFXObject;
+typedef unsigned JSBool;
+
+struct JSConstSpec
+{
+ const wchar_t* pName;
+ double number;
+ const wchar_t* string;
+ FX_BYTE t; //0:double 1:str
+};
+
+struct JSPropertySpec
+{
+ const wchar_t* pName;
+ v8::AccessorGetterCallback pPropGet;
+ v8::AccessorSetterCallback pPropPut;
+};
+
+struct JSMethodSpec
+{
+ const wchar_t* pName;
+ v8::FunctionCallback pMethodCall;
+ unsigned nParamNum;
+};
+
+typedef CFX_WideString JS_ErrorString;
+
+#define JS_TRUE (unsigned)1
+#define JS_FALSE (unsigned)0
+
+
+#define CJS_PointsArray CFX_ArrayTemplate<float>
+#define CJS_IntArray CFX_ArrayTemplate<int>
+
+/* ====================================== PUBLIC DEFINE SPEC ============================================== */
+#ifndef __GNUC__
+#define JS_WIDESTRING(widestring) L#widestring
+#else
+#define JS_WIDESTRING(widestring) L""#widestring
+#endif
+
+#define OBJ_PROP_PARAMS IFXJS_Context* cc, CJS_PropValue& vp, JS_ErrorString& sError
+#define OBJ_METHOD_PARAMS IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, JS_ErrorString& sError
+#define BEGIN_JS_STATIC_CONST(js_class_name) JSConstSpec js_class_name::JS_Class_Consts[] = {
+#define JS_STATIC_CONST_ENTRY_NUMBER(const_name, pValue) {JS_WIDESTRING(const_name), pValue, L"", 0},
+#define JS_STATIC_CONST_ENTRY_STRING(const_name, pValue) {JS_WIDESTRING(const_name), 0, JS_WIDESTRING(pValue), 1},
+#define END_JS_STATIC_CONST() {0, 0, 0, 0}};
+
+#define BEGIN_JS_STATIC_PROP(js_class_name) JSPropertySpec js_class_name::JS_Class_Properties[] = {
+#define JS_STATIC_PROP_ENTRY(prop_name) {JS_WIDESTRING(prop_name), get_##prop_name##_static, set_##prop_name##_static},
+#define END_JS_STATIC_PROP() {0, 0, 0}};
+
+#define BEGIN_JS_STATIC_METHOD(js_class_name) JSMethodSpec js_class_name::JS_Class_Methods[] = {
+#define JS_STATIC_METHOD_ENTRY(method_name, nargs) {JS_WIDESTRING(method_name), method_name##_static, nargs},
+#define END_JS_STATIC_METHOD() {0, 0, 0}};
+#define MEMLEAKCHECK_1() ((void)0)
+#define MEMLEAKCHECK_2(main_name, sub_name) ((void)0)
+
+
+/*
+#ifdef _DEBUG
+#define MEMLEAKCHECK_1() \
+ _CrtMemState state1;\
+ _CrtMemCheckpoint(&state1);
+
+#define MEMLEAKCHECK_2(main_name,sub_name) \
+ _CrtMemState state2;\
+ _CrtMemCheckpoint(&state2);\
+ _CrtMemState diff;\
+ _CrtMemDifference(&diff,&state1,&state2);\
+ if (diff.lSizes[_NORMAL_BLOCK] > 0)\
+ {\
+ TRACE("Detected normal block memory leaks in JS Module! [%s.%s]\n",#main_name,#sub_name);\
+ _CrtMemDumpStatistics(&diff);\
+ }
+#else
+ #define MEMLEAKCHECK_1() ((void)0)
+ #define MEMLEAKCHECK_2(main_name,sub_name) ((void)0)
+#endif
+*/
+
+/* ======================================== PROP CALLBACK ============================================ */
+
+#define JS_STATIC_PROP_GET(prop_name, class_name)\
+ static void get_##prop_name##_static(JS_PROPGET_ARGS)\
+{\
+ v8::Isolate* isolate = info.GetIsolate();\
+ v8::Local<v8::Context> context = isolate->GetCurrentContext();\
+ v8::Local<v8::Value> v = context->GetEmbedderData(1);\
+ ASSERT(!v.IsEmpty());\
+ if(v.IsEmpty()) return;\
+ v8::Handle<v8::External> field = v8::Handle<v8::External>::Cast(v);\
+ IFXJS_Runtime* pRuntime = (IFXJS_Runtime*)field->Value();\
+ IFXJS_Context* cc = pRuntime->GetCurrentContext();\
+ CJS_PropValue value(isolate);\
+ value.StartGetting();\
+ CJS_Object* pJSObj = (CJS_Object*)JS_GetPrivate(isolate,info.Holder());\
+ ASSERT(pJSObj != NULL);\
+ class_name* pObj = (class_name*)pJSObj->GetEmbedObject();\
+ ASSERT(pObj != NULL);\
+ JS_ErrorString sError;\
+ FX_BOOL bRet = FALSE;\
+ try\
+ {\
+ MEMLEAKCHECK_1();\
+ bRet = pObj->prop_name(cc, value, sError);\
+ MEMLEAKCHECK_2(class_name, prop_name);\
+ }\
+ catch (...)\
+ {\
+ CFX_ByteString cbName;\
+ cbName.Format("%s.%s", #class_name, #prop_name);\
+ JS_Error(NULL,CFX_WideString::FromLocal(cbName), L"Unknown error is catched!");\
+ return ;\
+ }\
+ if (bRet)\
+ {\
+ info.GetReturnValue().Set((v8::Handle<v8::Value>)value);\
+ return ;\
+ }\
+ else\
+ {\
+ CFX_ByteString cbName;\
+ cbName.Format("%s.%s", #class_name, #prop_name);\
+ JS_Error(NULL,CFX_WideString::FromLocal(cbName), sError);\
+ return ;\
+ }\
+}
+
+#define JS_STATIC_PROP_SET(prop_name, class_name)\
+ static void set_##prop_name##_static(JS_PROPPUT_ARGS)\
+{\
+ v8::Isolate* isolate = info.GetIsolate();\
+ v8::Local<v8::Context> context = isolate->GetCurrentContext();\
+ v8::Local<v8::Value> v = context->GetEmbedderData(1);\
+ ASSERT(!v.IsEmpty());\
+ if(v.IsEmpty()) return;\
+ v8::Handle<v8::External> field = v8::Handle<v8::External>::Cast(v);\
+ IFXJS_Runtime* pRuntime = (IFXJS_Runtime*)field->Value();\
+ IFXJS_Context* cc = pRuntime->GetCurrentContext();\
+ CJS_PropValue propValue(CJS_Value(isolate,value,VT_unknown));\
+ propValue.StartSetting();\
+ CJS_Object* pJSObj = (CJS_Object*)JS_GetPrivate(isolate,info.Holder());\
+ ASSERT(pJSObj != NULL);\
+ class_name* pObj = (class_name*)pJSObj->GetEmbedObject();\
+ ASSERT(pObj != NULL);\
+ JS_ErrorString sError;\
+ FX_BOOL bRet = FALSE;\
+ try\
+ {\
+ MEMLEAKCHECK_1();\
+ bRet = pObj->prop_name(cc, propValue, sError);\
+ MEMLEAKCHECK_2(class_name, prop_name);\
+ }\
+ catch (...)\
+ {\
+ CFX_ByteString cbName;\
+ cbName.Format("%s.%s", #class_name, #prop_name);\
+ JS_Error(NULL,CFX_WideString::FromLocal(cbName), L"Unknown error is catched!");\
+ return ;\
+ }\
+ if (bRet)\
+ {\
+ return ;\
+ }\
+ else\
+ {\
+ CFX_ByteString cbName;\
+ cbName.Format("%s.%s", #class_name, #prop_name);\
+ JS_Error(NULL,CFX_WideString::FromLocal(cbName), sError);\
+ return ;\
+ }\
+}
+
+#define JS_STATIC_PROP(prop_name, class_name)\
+JS_STATIC_PROP_GET(prop_name, class_name);\
+JS_STATIC_PROP_SET(prop_name, class_name)
+
+/* ========================================= METHOD CALLBACK =========================================== */
+
+#define JS_STATIC_METHOD(method_name, class_name)\
+ static void method_name##_static(JS_METHOD_ARGS)\
+{\
+ v8::Isolate* isolate = info.GetIsolate();\
+ v8::Local<v8::Context> context = isolate->GetCurrentContext();\
+ v8::Local<v8::Value> v = context->GetEmbedderData(1);\
+ ASSERT(!v.IsEmpty());\
+ if(v.IsEmpty()) return;\
+ v8::Handle<v8::External> field = v8::Handle<v8::External>::Cast(v);\
+ IFXJS_Runtime* pRuntime = (IFXJS_Runtime*)field->Value();\
+ IFXJS_Context* cc = pRuntime->GetCurrentContext();\
+ CJS_Parameters parameters;\
+ for (unsigned int i = 0; i<(unsigned int)info.Length(); i++)\
+ {\
+ parameters.push_back(CJS_Value(isolate, info[i], VT_unknown));\
+ }\
+ CJS_Value valueRes(isolate);\
+ CJS_Object* pJSObj = (CJS_Object *)JS_GetPrivate(isolate,info.Holder());\
+ ASSERT(pJSObj != NULL);\
+ class_name* pObj = (class_name*)pJSObj->GetEmbedObject();\
+ ASSERT(pObj != NULL);\
+ JS_ErrorString sError;\
+ FX_BOOL bRet = FALSE;\
+ try\
+ {\
+ MEMLEAKCHECK_1();\
+ bRet = pObj->method_name(cc, parameters, valueRes, sError);\
+ MEMLEAKCHECK_2(class_name, method_name);\
+ }\
+ catch (...)\
+ {\
+ CFX_ByteString cbName;\
+ cbName.Format("%s.%s", #class_name, #method_name);\
+ JS_Error(NULL, CFX_WideString::FromLocal(cbName), L"Unknown error is catched!");\
+ return ;\
+ }\
+ if (bRet)\
+ {\
+ info.GetReturnValue().Set(valueRes.ToJSValue());\
+ return ;\
+ }\
+ else\
+ {\
+ CFX_ByteString cbName;\
+ cbName.Format("%s.%s", #class_name, #method_name);\
+ JS_Error(NULL, CFX_WideString::FromLocal(cbName), sError);\
+ return ;\
+ }\
+}
+
+/* ===================================== JS CLASS =============================================== */
+
+#define DECLARE_JS_CLASS(js_class_name) \
+ static JSBool JSConstructor(IFXJS_Context* cc, JSFXObject obj,JSFXObject global);\
+ static JSBool JSDestructor(JSFXObject obj);\
+ static int Init(IJS_Runtime* pRuntime, FXJSOBJTYPE eObjType);\
+ static void GetConsts(JSConstSpec*& pConsts, int& nSize);\
+ static void GetProperties(JSPropertySpec*& pProperties, int& nSize);\
+ static void GetMethods(JSMethodSpec*& pMethods, int& nSize);\
+ static JSConstSpec JS_Class_Consts[];\
+ static JSPropertySpec JS_Class_Properties[];\
+ static JSMethodSpec JS_Class_Methods[];\
+ static const wchar_t* m_pClassName
+
+#define IMPLEMENT_JS_CLASS_RICH(js_class_name, class_alternate, class_name) \
+const wchar_t* js_class_name::m_pClassName = JS_WIDESTRING(class_name);\
+JSBool js_class_name::JSConstructor(IFXJS_Context* cc, JSFXObject obj, JSFXObject global)\
+{\
+ CJS_Object* pObj = FX_NEW js_class_name(obj);\
+ pObj->SetEmbedObject(FX_NEW class_alternate(pObj));\
+ JS_SetPrivate(NULL,obj,(void*)pObj); \
+ pObj->InitInstance(cc);\
+ return JS_TRUE;\
+}\
+\
+JSBool js_class_name::JSDestructor(JSFXObject obj) \
+{\
+ js_class_name* pObj = (js_class_name*)JS_GetPrivate(NULL,obj);\
+ ASSERT(pObj != NULL);\
+ pObj->ExitInstance();\
+ delete pObj;\
+ return JS_TRUE;\
+}\
+\
+int js_class_name::Init(IJS_Runtime* pRuntime, FXJSOBJTYPE eObjType)\
+{\
+ int nObjDefnID = JS_DefineObj(pRuntime, js_class_name::m_pClassName, eObjType, JSConstructor, JSDestructor, 0);\
+ if (nObjDefnID >= 0)\
+ {\
+ for (int j=0, szj=sizeof(JS_Class_Properties)/sizeof(JSPropertySpec)-1; j<szj; j++)\
+ {\
+ if (JS_DefineObjProperty(pRuntime, nObjDefnID, JS_Class_Properties[j].pName, JS_Class_Properties[j].pPropGet, JS_Class_Properties[j].pPropPut) < 0) return -1;\
+ }\
+ for (int k=0, szk=sizeof(JS_Class_Methods)/sizeof(JSMethodSpec)-1; k<szk; k++)\
+ {\
+ if (JS_DefineObjMethod(pRuntime, nObjDefnID,JS_Class_Methods[k].pName, JS_Class_Methods[k].pMethodCall, JS_Class_Methods[k].nParamNum) < 0) return -1;\
+ }\
+ return nObjDefnID;\
+ }\
+ return -1;\
+}\
+void js_class_name::GetConsts(JSConstSpec*& pConsts, int& nSize)\
+{\
+ pConsts = JS_Class_Consts;\
+ nSize = sizeof(JS_Class_Consts) / sizeof(JSConstSpec) - 1;\
+}\
+void js_class_name::GetProperties(JSPropertySpec*& pProperties, int& nSize)\
+{\
+ pProperties = JS_Class_Properties;\
+ nSize = sizeof(JS_Class_Properties) / sizeof(JSPropertySpec) - 1;\
+}\
+void js_class_name::GetMethods(JSMethodSpec*& pMethods, int& nSize)\
+{\
+ pMethods = JS_Class_Methods;\
+ nSize = sizeof(JS_Class_Methods) / sizeof(JSMethodSpec) - 1;\
+}
+
+#define IMPLEMENT_JS_CLASS(js_class_name, class_name) IMPLEMENT_JS_CLASS_RICH(js_class_name, class_name, class_name)
+
+/* ======================================== CONST CLASS ============================================ */
+
+#define DECLARE_JS_CLASS_CONST() \
+ static int Init(IJS_Runtime* pRuntime, FXJSOBJTYPE eObjType);\
+ static void GetConsts(JSConstSpec*& pConsts, int& nSize);\
+ static JSConstSpec JS_Class_Consts[];\
+ static const wchar_t* m_pClassName
+
+#define IMPLEMENT_JS_CLASS_CONST(js_class_name, class_name) \
+const wchar_t* js_class_name::m_pClassName = JS_WIDESTRING(class_name);\
+int js_class_name::Init(IJS_Runtime* pRuntime, FXJSOBJTYPE eObjType)\
+{\
+ int nObjDefnID = JS_DefineObj(pRuntime, js_class_name::m_pClassName, eObjType, NULL, NULL, 0);\
+ if (nObjDefnID >=0)\
+ {\
+ for (int i=0, sz=sizeof(JS_Class_Consts)/sizeof(JSConstSpec)-1; i<sz; i++)\
+ {\
+ if (JS_Class_Consts[i].t == 0)\
+ {\
+ if (JS_DefineObjConst(pRuntime, nObjDefnID, JS_Class_Consts[i].pName, JS_NewNumber(pRuntime,JS_Class_Consts[i].number)) < 0) return -1;\
+ }\
+ else\
+ {\
+ if (JS_DefineObjConst(pRuntime, nObjDefnID, JS_Class_Consts[i].pName, JS_NewString(pRuntime,JS_Class_Consts[i].string)) < 0) return -1;\
+ }\
+ }\
+ return nObjDefnID;\
+ }\
+ return -1;\
+}\
+void js_class_name::GetConsts(JSConstSpec*& pConsts, int& nSize)\
+{\
+ pConsts = JS_Class_Consts;\
+ nSize = sizeof(JS_Class_Consts)/sizeof(JSConstSpec)-1;\
+}
+
+/* ===================================== SPECIAL JS CLASS =============================================== */
+
+#define DECLARE_SPECIAL_JS_CLASS(js_class_name) \
+ static JSBool JSConstructor(IFXJS_Context* cc, JSFXObject obj, JSFXObject global);\
+ static JSBool JSDestructor(JSFXObject obj);\
+ static void GetConsts(JSConstSpec*& pConsts, int& nSize);\
+ static void GetProperties(JSPropertySpec*& pProperties, int& nSize);\
+ static void GetMethods(JSMethodSpec*& pMethods, int& nSize);\
+ static JSConstSpec JS_Class_Consts[];\
+ static JSPropertySpec JS_Class_Properties[];\
+ static JSMethodSpec JS_Class_Methods[];\
+ static int Init(IJS_Runtime* pRuntime, FXJSOBJTYPE eObjType);\
+ static const wchar_t* m_pClassName;\
+ static void queryprop_##js_class_name##_static(JS_PROPQUERY_ARGS);\
+ static void getprop_##js_class_name##_static(JS_NAMED_PROPGET_ARGS);\
+ static void putprop_##js_class_name##_static(JS_NAMED_PROPPUT_ARGS);\
+ static void delprop_##js_class_name##_static(JS_PROPDEL_ARGS)
+
+#define IMPLEMENT_SPECIAL_JS_CLASS(js_class_name, class_alternate, class_name) \
+const wchar_t * js_class_name::m_pClassName = JS_WIDESTRING(class_name);\
+ void js_class_name::queryprop_##js_class_name##_static(JS_PROPQUERY_ARGS)\
+{\
+ v8::Isolate* isolate = info.GetIsolate();\
+ v8::String::Utf8Value utf8_value(property);\
+ CFX_WideString propname = CFX_WideString::FromUTF8(*utf8_value, utf8_value.length());\
+ CJS_Object* pJSObj = (CJS_Object*)JS_GetPrivate(isolate,info.Holder());\
+ ASSERT(pJSObj != NULL);\
+ class_alternate* pObj = (class_alternate*)pJSObj->GetEmbedObject();\
+ ASSERT(pObj != NULL);\
+ FX_BOOL bRet = FALSE;\
+ try\
+ {\
+ MEMLEAKCHECK_1();\
+ bRet = pObj->QueryProperty((FX_LPCWSTR)propname);\
+ MEMLEAKCHECK_2(class_name, (FX_LPCWSTR)prop_name);\
+ }\
+ catch (...)\
+ {\
+ return ;\
+ }\
+ if (bRet)\
+ {\
+ info.GetReturnValue().Set(0x004);\
+ return ;\
+ }\
+ else\
+ {\
+ info.GetReturnValue().Set(0);\
+ return ;\
+ }\
+ return ;\
+}\
+ void js_class_name::getprop_##js_class_name##_static(JS_NAMED_PROPGET_ARGS)\
+{\
+ v8::Isolate* isolate = info.GetIsolate();\
+ v8::Local<v8::Context> context = isolate->GetCurrentContext();\
+ v8::Local<v8::Value> v = context->GetEmbedderData(1);\
+ ASSERT(!v.IsEmpty());\
+ if(v.IsEmpty()) return;\
+ v8::Handle<v8::External> field = v8::Handle<v8::External>::Cast(v);\
+ IFXJS_Runtime* pRuntime = (IFXJS_Runtime*)field->Value();\
+ IFXJS_Context* cc = pRuntime->GetCurrentContext();\
+ v8::String::Utf8Value utf8_value(property);\
+ CFX_WideString propname = CFX_WideString::FromUTF8(*utf8_value, utf8_value.length());\
+ CJS_PropValue value(isolate);\
+ value.StartGetting();\
+ CJS_Object* pJSObj = (CJS_Object*)JS_GetPrivate(isolate,info.Holder());\
+ ASSERT(pJSObj != NULL);\
+ class_alternate* pObj = (class_alternate*)pJSObj->GetEmbedObject();\
+ ASSERT(pObj != NULL);\
+ JS_ErrorString sError;\
+ FX_BOOL bRet = FALSE;\
+ try\
+ {\
+ MEMLEAKCHECK_1();\
+ bRet = pObj->DoProperty(cc, (FX_LPCWSTR)propname, value, sError);\
+ MEMLEAKCHECK_2(class_name, L"GetProperty");\
+ }\
+ catch (...)\
+ {\
+ CFX_ByteString cbName;\
+ cbName.Format("%s.%s", #class_name, L"GetProperty");\
+ JS_Error(NULL,CFX_WideString::FromLocal(cbName), L"Unknown error is catched!");\
+ return ;\
+ }\
+ if (bRet)\
+ {\
+ info.GetReturnValue().Set((v8::Handle<v8::Value>)value);\
+ return ;\
+ }\
+ else\
+ {\
+ CFX_ByteString cbName;\
+ cbName.Format("%s.%s", #class_name, L"GetProperty");\
+ JS_Error(NULL,CFX_WideString::FromLocal(cbName), sError);\
+ return ;\
+ }\
+ JS_Error(NULL,L"GetProperty", L"Embeded object not found!");\
+ return ;\
+}\
+ void js_class_name::putprop_##js_class_name##_static(JS_NAMED_PROPPUT_ARGS)\
+{\
+ v8::Isolate* isolate = info.GetIsolate();\
+ v8::Local<v8::Context> context = isolate->GetCurrentContext();\
+ v8::Local<v8::Value> v = context->GetEmbedderData(1);\
+ ASSERT(!v.IsEmpty());\
+ if(v.IsEmpty()) return;\
+ v8::Handle<v8::External> field = v8::Handle<v8::External>::Cast(v);\
+ IFXJS_Runtime* pRuntime = (IFXJS_Runtime*)field->Value();\
+ IFXJS_Context* cc = pRuntime->GetCurrentContext();\
+ v8::String::Utf8Value utf8_value(property);\
+ CFX_WideString propname = CFX_WideString::FromUTF8(*utf8_value, utf8_value.length());\
+ CJS_PropValue PropValue(CJS_Value(isolate,value,VT_unknown));\
+ PropValue.StartSetting();\
+ CJS_Object* pJSObj = (CJS_Object*)JS_GetPrivate(isolate,info.Holder());\
+ if(!pJSObj) return;\
+ class_alternate* pObj = (class_alternate*)pJSObj->GetEmbedObject();\
+ ASSERT(pObj != NULL);\
+ JS_ErrorString sError;\
+ FX_BOOL bRet = FALSE;\
+ try\
+ {\
+ MEMLEAKCHECK_1();\
+ bRet = pObj->DoProperty(cc, (FX_LPCWSTR)propname, PropValue, sError);\
+ MEMLEAKCHECK_2(class_name,L"PutProperty");\
+ }\
+ catch (...)\
+ {\
+ CFX_ByteString cbName;\
+ cbName.Format("%s.%s", #class_name, "PutProperty");\
+ JS_Error(NULL,CFX_WideString::FromLocal(cbName), L"Unknown error is catched!");\
+ return ;\
+ }\
+ if (bRet)\
+ {\
+ return ;\
+ }\
+ else\
+ {\
+ CFX_ByteString cbName;\
+ cbName.Format("%s.%s", #class_name, "PutProperty");\
+ JS_Error(NULL,CFX_WideString::FromLocal(cbName), sError);\
+ return ;\
+ }\
+ JS_Error(NULL,L"PutProperty", L"Embeded object not found!");\
+ return ;\
+}\
+ void js_class_name::delprop_##js_class_name##_static(JS_PROPDEL_ARGS)\
+{\
+ v8::Isolate* isolate = info.GetIsolate();\
+ v8::Local<v8::Context> context = isolate->GetCurrentContext();\
+ v8::Local<v8::Value> v = context->GetEmbedderData(1);\
+ ASSERT(!v.IsEmpty());\
+ if(v.IsEmpty()) return;\
+ v8::Handle<v8::External> field = v8::Handle<v8::External>::Cast(v);\
+ IFXJS_Runtime* pRuntime = (IFXJS_Runtime*)field->Value();\
+ IFXJS_Context* cc = pRuntime->GetCurrentContext();\
+ v8::String::Utf8Value utf8_value(property);\
+ CFX_WideString propname = CFX_WideString::FromUTF8(*utf8_value, utf8_value.length());\
+ CJS_Object* pJSObj = (CJS_Object*)JS_GetPrivate(isolate,info.Holder());\
+ ASSERT(pJSObj != NULL);\
+ class_alternate* pObj = (class_alternate*)pJSObj->GetEmbedObject();\
+ ASSERT(pObj != NULL);\
+ JS_ErrorString sError;\
+ FX_BOOL bRet = FALSE;\
+ try\
+ {\
+ MEMLEAKCHECK_1();\
+ bRet = pObj->DelProperty(cc, (FX_LPCWSTR)propname, sError);\
+ MEMLEAKCHECK_2(class_name,L"DelProperty");\
+ }\
+ catch (...)\
+ {\
+ CFX_ByteString cbName;\
+ cbName.Format("%s.%s", #class_name, "DelProperty");\
+ return ;\
+ }\
+ if (bRet)\
+ {\
+ return ;\
+ }\
+ else\
+ {\
+ CFX_ByteString cbName;\
+ cbName.Format("%s.%s", #class_name, "DelProperty");\
+ return ;\
+ }\
+ return ;\
+}\
+JSBool js_class_name::JSConstructor(IFXJS_Context* cc, JSFXObject obj,JSFXObject global)\
+{\
+ CJS_Object* pObj = FX_NEW js_class_name(obj);\
+ pObj->SetEmbedObject(FX_NEW class_alternate(pObj));\
+ JS_SetPrivate(NULL,obj, (void*)pObj); \
+ pObj->InitInstance(cc);\
+ return JS_TRUE;\
+}\
+\
+JSBool js_class_name::JSDestructor(JSFXObject obj) \
+{\
+ js_class_name* pObj = (js_class_name*)JS_GetPrivate(NULL,obj);\
+ ASSERT(pObj != NULL);\
+ pObj->ExitInstance();\
+ delete pObj;\
+ return JS_TRUE;\
+}\
+\
+int js_class_name::Init(IJS_Runtime* pRuntime, FXJSOBJTYPE eObjType)\
+{\
+\
+ int nObjDefnID = JS_DefineObj(pRuntime, js_class_name::m_pClassName, eObjType, JSConstructor, JSDestructor, 0);\
+\
+ if (nObjDefnID >= 0)\
+ {\
+ for (int j=0, szj=sizeof(JS_Class_Properties)/sizeof(JSPropertySpec)-1; j<szj; j++)\
+ {\
+ if (JS_DefineObjProperty(pRuntime, nObjDefnID, JS_Class_Properties[j].pName, JS_Class_Properties[j].pPropGet,JS_Class_Properties[j].pPropPut)<0)return -1;\
+ }\
+\
+ for (int k=0, szk=sizeof(JS_Class_Methods)/sizeof(JSMethodSpec)-1; k<szk; k++)\
+ {\
+ if (JS_DefineObjMethod(pRuntime, nObjDefnID,JS_Class_Methods[k].pName,JS_Class_Methods[k].pMethodCall,JS_Class_Methods[k].nParamNum)<0)return -1;\
+ }\
+ if (JS_DefineObjAllProperties(pRuntime, nObjDefnID, js_class_name::queryprop_##js_class_name##_static, js_class_name::getprop_##js_class_name##_static,js_class_name::putprop_##js_class_name##_static,js_class_name::delprop_##js_class_name##_static)<0) return -1;\
+\
+ return nObjDefnID;\
+ }\
+\
+ return -1;\
+}\
+void js_class_name::GetConsts(JSConstSpec*& pConsts, int& nSize)\
+{\
+ pConsts = JS_Class_Consts;\
+ nSize = sizeof(JS_Class_Consts)/sizeof(JSConstSpec)-1;\
+}\
+void js_class_name::GetProperties(JSPropertySpec*& pProperties, int& nSize)\
+{\
+ pProperties = JS_Class_Properties;\
+ nSize = sizeof(JS_Class_Properties)/sizeof(JSPropertySpec)-1;\
+}\
+void js_class_name::GetMethods(JSMethodSpec*& pMethods, int& nSize)\
+{\
+ pMethods = JS_Class_Methods;\
+ nSize = sizeof(JS_Class_Methods)/sizeof(JSMethodSpec)-1;\
+}
+
+#define JS_SPECIAL_STATIC_METHOD(method_name, class_alternate, class_name)\
+ static void method_name##_static(JS_METHOD_ARGS)\
+{\
+ v8::Isolate* isolate = info.GetIsolate();\
+ v8::Local<v8::Context> context = isolate->GetCurrentContext();\
+ v8::Local<v8::Value> v = context->GetEmbedderData(1);\
+ ASSERT(!v.IsEmpty());\
+ if(v.IsEmpty()) return;\
+ v8::Handle<v8::External> field = v8::Handle<v8::External>::Cast(v);\
+ IFXJS_Runtime* pRuntime = (IFXJS_Runtime*)field->Value();\
+ IFXJS_Context* cc = pRuntime->GetCurrentContext();\
+ CJS_Parameters parameters;\
+ for (unsigned int i = 0; i<(unsigned int)info.Length(); i++)\
+ {\
+ parameters.push_back(CJS_Value(isolate, info[i], VT_unknown));\
+ }\
+ CJS_Value valueRes(isolate);\
+ CJS_Object* pJSObj = (CJS_Object *)JS_GetPrivate(isolate, info.Holder());\
+ ASSERT(pJSObj != NULL);\
+ class_alternate* pObj = (class_alternate*)pJSObj->GetEmbedObject();\
+ ASSERT(pObj != NULL);\
+ JS_ErrorString sError;\
+ FX_BOOL bRet = FALSE;\
+ try\
+ {\
+ MEMLEAKCHECK_1();\
+ bRet = pObj->method_name(cc, parameters, valueRes, sError);\
+ MEMLEAKCHECK_2(class_name, method_name);\
+ }\
+ catch (...)\
+ {\
+ CFX_ByteString cbName;\
+ cbName.Format("%s.%s", #class_name, #method_name);\
+ JS_Error(NULL, CFX_WideString::FromLocal(cbName), L"Unknown error is catched!");\
+ return ;\
+ }\
+ if (bRet)\
+ {\
+ info.GetReturnValue().Set(valueRes.ToJSValue());\
+ return ;\
+ }\
+ else\
+ {\
+ CFX_ByteString cbName;\
+ cbName.Format("%s.%s", #class_name, #method_name);\
+ JS_Error(NULL, CFX_WideString::FromLocal(cbName), sError);\
+ return ;\
+ }\
+ JS_Error(NULL, JS_WIDESTRING(method_name), L"Embeded object not found!");\
+ return ;\
+}
+
+/* ======================================== GLOBAL METHODS ============================================ */
+#define JS_STATIC_GLOBAL_FUN(fun_name) \
+static void fun_name##_static(JS_METHOD_ARGS)\
+{\
+ v8::Isolate* isolate = info.GetIsolate();\
+ v8::Local<v8::Context> context = isolate->GetCurrentContext();\
+ v8::Local<v8::Value> v = context->GetEmbedderData(1);\
+ ASSERT(!v.IsEmpty());\
+ if(v.IsEmpty()) return;\
+ v8::Handle<v8::External> field = v8::Handle<v8::External>::Cast(v);\
+ IFXJS_Runtime* pRuntime = (IFXJS_Runtime*)field->Value();\
+ IFXJS_Context* cc = pRuntime->GetCurrentContext();\
+ CJS_Parameters parameters;\
+ for (unsigned int i = 0; i<(unsigned int)info.Length(); i++)\
+ {\
+ parameters.push_back(CJS_Value(isolate, info[i], VT_unknown));\
+ }\
+ CJS_Value valueRes(isolate);\
+ JS_ErrorString sError;\
+ if (!fun_name(cc, parameters, valueRes, sError))\
+ {\
+ JS_Error(NULL, JS_WIDESTRING(fun_name), sError);\
+ return ;\
+ }\
+ info.GetReturnValue().Set(valueRes.ToJSValue());\
+ return ;\
+}
+
+#define JS_STATIC_DECLARE_GLOBAL_FUN() \
+static JSMethodSpec global_methods[]; \
+static int Init(IJS_Runtime* pRuntime)
+
+#define BEGIN_JS_STATIC_GLOBAL_FUN(js_class_name) \
+JSMethodSpec js_class_name::global_methods[] = {
+
+#define JS_STATIC_GLOBAL_FUN_ENTRY(method_name,nargs) JS_STATIC_METHOD_ENTRY(method_name,nargs)
+
+#define END_JS_STATIC_GLOBAL_FUN() END_JS_STATIC_METHOD()
+
+#define IMPLEMENT_JS_STATIC_GLOBAL_FUN(js_class_name) \
+int js_class_name::Init(IJS_Runtime* pRuntime)\
+{\
+ for (int i=0, sz=sizeof(js_class_name::global_methods)/sizeof(JSMethodSpec)-1; i<sz; i++)\
+ {\
+ if (JS_DefineGlobalMethod(pRuntime,\
+ js_class_name::global_methods[i].pName,\
+ js_class_name::global_methods[i].pMethodCall,\
+ js_class_name::global_methods[i].nParamNum\
+ ) < 0\
+ )return -1;\
+ }\
+ return 0;\
+}
+
+/* ======================================== GLOBAL CONSTS ============================================ */
+#define DEFINE_GLOBAL_CONST(pRuntime, const_name , const_value)\
+if (JS_DefineGlobalConst(pRuntime,JS_WIDESTRING(const_name),JS_NewString(pRuntime,JS_WIDESTRING(const_value)))) return -1
+
+/* ======================================== GLOBAL ARRAYS ============================================ */
+
+#define DEFINE_GLOBAL_ARRAY(pRuntime)\
+int size = sizeof(ArrayContent) / sizeof(FX_LPCWSTR);\
+\
+CJS_Array array(pRuntime);\
+for (int i=0; i<size; i++) array.SetElement(i,CJS_Value(pRuntime,(FX_LPCWSTR)ArrayContent[i]));\
+\
+CJS_PropValue prop(pRuntime);\
+prop << array;\
+if (JS_DefineGlobalConst(pRuntime, (const wchar_t*)ArrayName, prop.ToJSValue()) < 0)\
+ return -1
+
+/* ============================================================ */
+
+#define VALUE_NAME_STRING L"string"
+#define VALUE_NAME_NUMBER L"number"
+#define VALUE_NAME_BOOLEAN L"boolean"
+#define VALUE_NAME_DATE L"date"
+#define VALUE_NAME_OBJECT L"object"
+#define VALUE_NAME_FXOBJ L"fxobj"
+#define VALUE_NAME_NULL L"null"
+#define VALUE_NAME_UNDEFINED L"undefined"
+
+#define CLASSNAME_ARRAY L"Array"
+#define CLASSNAME_DATE L"Date"
+#define CLASSNAME_STRING L"v8::String"
+
+const unsigned int JSCONST_nStringHash = JS_CalcHash(VALUE_NAME_STRING,wcslen(VALUE_NAME_STRING));
+const unsigned int JSCONST_nNumberHash = JS_CalcHash(VALUE_NAME_NUMBER,wcslen(VALUE_NAME_NUMBER));
+const unsigned int JSCONST_nBoolHash = JS_CalcHash(VALUE_NAME_BOOLEAN,wcslen(VALUE_NAME_BOOLEAN));
+const unsigned int JSCONST_nDateHash = JS_CalcHash(VALUE_NAME_DATE,wcslen(VALUE_NAME_DATE));
+const unsigned int JSCONST_nObjectHash = JS_CalcHash(VALUE_NAME_OBJECT,wcslen(VALUE_NAME_OBJECT));
+const unsigned int JSCONST_nFXobjHash = JS_CalcHash(VALUE_NAME_FXOBJ,wcslen(VALUE_NAME_FXOBJ));
+const unsigned int JSCONST_nNullHash = JS_CalcHash(VALUE_NAME_NULL,wcslen(VALUE_NAME_NULL));
+const unsigned int JSCONST_nUndefHash = JS_CalcHash(VALUE_NAME_UNDEFINED,wcslen(VALUE_NAME_UNDEFINED));
+
+static FXJSVALUETYPE GET_VALUE_TYPE(v8::Handle<v8::Value> p)
+{
+
+ const unsigned int nHash = JS_CalcHash(JS_GetTypeof(p));
+
+ if (nHash == JSCONST_nUndefHash)
+ return VT_undefined;
+ else if (nHash == JSCONST_nNullHash)
+ return VT_null;
+ else if (nHash == JSCONST_nStringHash)
+ return VT_string;
+ else if (nHash == JSCONST_nNumberHash)
+ return VT_number;
+ else if (nHash == JSCONST_nBoolHash)
+ return VT_boolean;
+ else if (nHash == JSCONST_nDateHash)
+ return VT_date;
+ else if (nHash == JSCONST_nObjectHash)
+ return VT_object;
+ else if (nHash == JSCONST_nFXobjHash)
+ return VT_fxobject;
+
+ /*
+ const char * sType = p->getTypeof()->toDchars();
+ if (strcmp(sType,VALUE_NAME_STRING) == 0)
+ return VT_string;
+ else if (strcmp(sType,VALUE_NAME_NUMBER) == 0)
+ return VT_number;
+ else if (strcmp(sType,VALUE_NAME_BOOLEAN) == 0)
+ return VT_boolean;
+ else if (strcmp(sType,VALUE_NAME_DATE) == 0)
+ return VT_date;
+ else if (strcmp(sType,VALUE_NAME_OBJECT) == 0)
+ return VT_object;
+ else if (strcmp(sType,VALUE_NAME_FXOBJ) == 0)
+ return VT_object;
+ else if (strcmp(sType,VALUE_NAME_NULL) == 0)
+ return VT_null;
+ else if (strcmp(sType,VALUE_NAME_UNDEFINED) == 0)
+ return VT_undefined;
+ */
+
+ return VT_unknown;
+}
+
+#endif //_JS_DEFINE_H_
diff --git a/fpdfsdk/include/javascript/JS_EventHandler.h b/fpdfsdk/include/javascript/JS_EventHandler.h
index d88c50c06b..d16933aeef 100644
--- a/fpdfsdk/include/javascript/JS_EventHandler.h
+++ b/fpdfsdk/include/javascript/JS_EventHandler.h
@@ -1,167 +1,167 @@
-// 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 _JS_EVENTHANDLER_H_
-#define _JS_EVENTHANDLER_H_
-
-class CJS_Context;
-class Field;
-
-enum JS_EVENT_T
-{
- JET_UNKNOWN,
- JET_APP_INIT,
- JET_DOC_OPEN,
- JET_DOC_WILLPRINT,
- JET_DOC_DIDPRINT,
- JET_DOC_WILLSAVE,
- JET_DOC_DIDSAVE,
- JET_DOC_WILLCLOSE,
- JET_PAGE_OPEN,
- JET_PAGE_CLOSE,
- JET_PAGE_INVIEW,
- JET_PAGE_OUTVIEW,
- JET_FIELD_MOUSEDOWN,
- JET_FIELD_MOUSEUP,
- JET_FIELD_MOUSEENTER,
- JET_FIELD_MOUSEEXIT,
- JET_FIELD_FOCUS,
- JET_FIELD_BLUR,
- JET_FIELD_KEYSTROKE,
- JET_FIELD_VALIDATE,
- JET_FIELD_CALCULATE,
- JET_FIELD_FORMAT,
- JET_SCREEN_FOCUS,
- JET_SCREEN_BLUR,
- JET_SCREEN_OPEN,
- JET_SCREEN_CLOSE,
- JET_SCREEN_MOUSEDOWN,
- JET_SCREEN_MOUSEUP,
- JET_SCREEN_MOUSEENTER,
- JET_SCREEN_MOUSEEXIT,
- JET_SCREEN_INVIEW,
- JET_SCREEN_OUTVIEW,
- JET_BATCH_EXEC,
- JET_MENU_EXEC,
- JET_CONSOLE_EXEC,
- JET_EXTERNAL_EXEC,
- JET_BOOKMARK_MOUSEUP,
- JET_LINK_MOUSEUP
-};
-
-class CJS_EventHandler
-{
-public:
- CJS_EventHandler(CJS_Context * pContext);
- virtual ~CJS_EventHandler();
-
- void OnApp_Init();
-
- void OnDoc_Open(CPDFSDK_Document* pDoc, const CFX_WideString& strTargetName);
- void OnDoc_WillPrint(CPDFSDK_Document* pDoc);
- void OnDoc_DidPrint(CPDFSDK_Document* pDoc);
- void OnDoc_WillSave(CPDFSDK_Document* pDoc);
- void OnDoc_DidSave(CPDFSDK_Document* pDoc);
- void OnDoc_WillClose(CPDFSDK_Document* pDoc);
-
- void OnPage_Open(CPDFSDK_Document* pDoc);
- void OnPage_Close(CPDFSDK_Document* pDoc);
- void OnPage_InView(CPDFSDK_Document* pTarget);
- void OnPage_OutView(CPDFSDK_Document* pTarget);
-
- void OnField_Calculate(CPDF_FormField* pSource, CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL& bRc);
- void OnField_Format(int nCommitKey, CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL bWillCommit);
- void OnField_Keystroke(int nCommitKey, CFX_WideString& strChange, const CFX_WideString& strChangeEx,
- FX_BOOL KeyDown, FX_BOOL bModifier, int &nSelEnd,int &nSelStart, FX_BOOL bShift,
- CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL bWillCommit,
- FX_BOOL bFieldFull, FX_BOOL &bRc);
- void OnField_Validate(CFX_WideString& strChange, const CFX_WideString& strChangeEx, FX_BOOL bKeyDown,
- FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL& bRc);
-
- void OnField_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField *pTarget);
- void OnField_MouseEnter(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField *pTarget);
- void OnField_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField *pTarget);
- void OnField_MouseUp(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField *pTarget);
- void OnField_Blur(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget, const CFX_WideString& Value);
- void OnField_Focus(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget, const CFX_WideString& Value);
-
- void OnScreen_Focus(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen);
- void OnScreen_Blur(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen);
- void OnScreen_Open(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen);
- void OnScreen_Close(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen);
- void OnScreen_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen);
- void OnScreen_MouseUp(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen);
- void OnScreen_MouseEnter(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen);
- void OnScreen_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen);
- void OnScreen_InView(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen);
- void OnScreen_OutView(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen);
-
- void OnBookmark_MouseUp(CPDF_Bookmark* pBookMark);
- void OnLink_MouseUp(CPDFSDK_Document* pTarget);
-
- void OnMenu_Exec(CPDFSDK_Document* pTarget, const CFX_WideString& strTargetName);
- void OnBatchExec(CPDFSDK_Document *pTarget);
- void OnConsole_Exec();
- void OnExternal_Exec();
-
-public:
- void Initial(JS_EVENT_T type);
- void Destroy();
- FX_BOOL IsValid();
-
-
- CFX_WideString& Change();
- CFX_WideString ChangeEx();
- int CommitKey();
- FX_BOOL FieldFull();
- FX_BOOL KeyDown();
- FX_BOOL Modifier();
- FX_LPCWSTR Name();
- FX_LPCWSTR Type();
- FX_BOOL& Rc();
- int& SelEnd();
- int& SelStart();
- FX_BOOL Shift();
- Field* Source();
- Field* Target_Field();
- CFX_WideString& Value();
- FX_BOOL WillCommit();
- CFX_WideString TargetName();
-
- JS_EVENT_T EventType() {return m_eEventType;};
-
-public:
- CJS_Context* m_pJSContext;
- JS_EVENT_T m_eEventType;
- FX_BOOL m_bValid;
-
- CFX_WideString m_strTargetName;
- CFX_WideString m_strSourceName;
- CFX_WideString* m_pWideStrChange;
- CFX_WideString m_WideStrChangeDu;
- CFX_WideString m_WideStrChangeEx;
- int m_nCommitKey;
- FX_BOOL m_bKeyDown;
- FX_BOOL m_bModifier;
- FX_BOOL m_bShift;
- int* m_pISelEnd;
- int m_nSelEndDu;
- int* m_pISelStart;
- int m_nSelStartDu;
- FX_BOOL m_bWillCommit;
- CFX_WideString* m_pValue;
- FX_BOOL m_bFieldFull;
- FX_BOOL* m_pbRc;
- FX_BOOL m_bRcDu;
-
- CPDFSDK_Document* m_pSourceDoc;
- CPDF_Bookmark* m_pTargetBookMark;
- CPDFSDK_Document* m_pTargetDoc;
- CPDFSDK_Annot* m_pTargetAnnot;
-};
-
-#endif //_JS_EVENTHANDLER_H_
-
+// 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 _JS_EVENTHANDLER_H_
+#define _JS_EVENTHANDLER_H_
+
+class CJS_Context;
+class Field;
+
+enum JS_EVENT_T
+{
+ JET_UNKNOWN,
+ JET_APP_INIT,
+ JET_DOC_OPEN,
+ JET_DOC_WILLPRINT,
+ JET_DOC_DIDPRINT,
+ JET_DOC_WILLSAVE,
+ JET_DOC_DIDSAVE,
+ JET_DOC_WILLCLOSE,
+ JET_PAGE_OPEN,
+ JET_PAGE_CLOSE,
+ JET_PAGE_INVIEW,
+ JET_PAGE_OUTVIEW,
+ JET_FIELD_MOUSEDOWN,
+ JET_FIELD_MOUSEUP,
+ JET_FIELD_MOUSEENTER,
+ JET_FIELD_MOUSEEXIT,
+ JET_FIELD_FOCUS,
+ JET_FIELD_BLUR,
+ JET_FIELD_KEYSTROKE,
+ JET_FIELD_VALIDATE,
+ JET_FIELD_CALCULATE,
+ JET_FIELD_FORMAT,
+ JET_SCREEN_FOCUS,
+ JET_SCREEN_BLUR,
+ JET_SCREEN_OPEN,
+ JET_SCREEN_CLOSE,
+ JET_SCREEN_MOUSEDOWN,
+ JET_SCREEN_MOUSEUP,
+ JET_SCREEN_MOUSEENTER,
+ JET_SCREEN_MOUSEEXIT,
+ JET_SCREEN_INVIEW,
+ JET_SCREEN_OUTVIEW,
+ JET_BATCH_EXEC,
+ JET_MENU_EXEC,
+ JET_CONSOLE_EXEC,
+ JET_EXTERNAL_EXEC,
+ JET_BOOKMARK_MOUSEUP,
+ JET_LINK_MOUSEUP
+};
+
+class CJS_EventHandler
+{
+public:
+ CJS_EventHandler(CJS_Context * pContext);
+ virtual ~CJS_EventHandler();
+
+ void OnApp_Init();
+
+ void OnDoc_Open(CPDFSDK_Document* pDoc, const CFX_WideString& strTargetName);
+ void OnDoc_WillPrint(CPDFSDK_Document* pDoc);
+ void OnDoc_DidPrint(CPDFSDK_Document* pDoc);
+ void OnDoc_WillSave(CPDFSDK_Document* pDoc);
+ void OnDoc_DidSave(CPDFSDK_Document* pDoc);
+ void OnDoc_WillClose(CPDFSDK_Document* pDoc);
+
+ void OnPage_Open(CPDFSDK_Document* pDoc);
+ void OnPage_Close(CPDFSDK_Document* pDoc);
+ void OnPage_InView(CPDFSDK_Document* pTarget);
+ void OnPage_OutView(CPDFSDK_Document* pTarget);
+
+ void OnField_Calculate(CPDF_FormField* pSource, CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL& bRc);
+ void OnField_Format(int nCommitKey, CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL bWillCommit);
+ void OnField_Keystroke(int nCommitKey, CFX_WideString& strChange, const CFX_WideString& strChangeEx,
+ FX_BOOL KeyDown, FX_BOOL bModifier, int &nSelEnd,int &nSelStart, FX_BOOL bShift,
+ CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL bWillCommit,
+ FX_BOOL bFieldFull, FX_BOOL &bRc);
+ void OnField_Validate(CFX_WideString& strChange, const CFX_WideString& strChangeEx, FX_BOOL bKeyDown,
+ FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL& bRc);
+
+ void OnField_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField *pTarget);
+ void OnField_MouseEnter(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField *pTarget);
+ void OnField_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField *pTarget);
+ void OnField_MouseUp(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField *pTarget);
+ void OnField_Blur(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget, const CFX_WideString& Value);
+ void OnField_Focus(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget, const CFX_WideString& Value);
+
+ void OnScreen_Focus(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen);
+ void OnScreen_Blur(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen);
+ void OnScreen_Open(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen);
+ void OnScreen_Close(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen);
+ void OnScreen_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen);
+ void OnScreen_MouseUp(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen);
+ void OnScreen_MouseEnter(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen);
+ void OnScreen_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen);
+ void OnScreen_InView(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen);
+ void OnScreen_OutView(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen);
+
+ void OnBookmark_MouseUp(CPDF_Bookmark* pBookMark);
+ void OnLink_MouseUp(CPDFSDK_Document* pTarget);
+
+ void OnMenu_Exec(CPDFSDK_Document* pTarget, const CFX_WideString& strTargetName);
+ void OnBatchExec(CPDFSDK_Document *pTarget);
+ void OnConsole_Exec();
+ void OnExternal_Exec();
+
+public:
+ void Initial(JS_EVENT_T type);
+ void Destroy();
+ FX_BOOL IsValid();
+
+
+ CFX_WideString& Change();
+ CFX_WideString ChangeEx();
+ int CommitKey();
+ FX_BOOL FieldFull();
+ FX_BOOL KeyDown();
+ FX_BOOL Modifier();
+ FX_LPCWSTR Name();
+ FX_LPCWSTR Type();
+ FX_BOOL& Rc();
+ int& SelEnd();
+ int& SelStart();
+ FX_BOOL Shift();
+ Field* Source();
+ Field* Target_Field();
+ CFX_WideString& Value();
+ FX_BOOL WillCommit();
+ CFX_WideString TargetName();
+
+ JS_EVENT_T EventType() {return m_eEventType;};
+
+public:
+ CJS_Context* m_pJSContext;
+ JS_EVENT_T m_eEventType;
+ FX_BOOL m_bValid;
+
+ CFX_WideString m_strTargetName;
+ CFX_WideString m_strSourceName;
+ CFX_WideString* m_pWideStrChange;
+ CFX_WideString m_WideStrChangeDu;
+ CFX_WideString m_WideStrChangeEx;
+ int m_nCommitKey;
+ FX_BOOL m_bKeyDown;
+ FX_BOOL m_bModifier;
+ FX_BOOL m_bShift;
+ int* m_pISelEnd;
+ int m_nSelEndDu;
+ int* m_pISelStart;
+ int m_nSelStartDu;
+ FX_BOOL m_bWillCommit;
+ CFX_WideString* m_pValue;
+ FX_BOOL m_bFieldFull;
+ FX_BOOL* m_pbRc;
+ FX_BOOL m_bRcDu;
+
+ CPDFSDK_Document* m_pSourceDoc;
+ CPDF_Bookmark* m_pTargetBookMark;
+ CPDFSDK_Document* m_pTargetDoc;
+ CPDFSDK_Annot* m_pTargetAnnot;
+};
+
+#endif //_JS_EVENTHANDLER_H_
+
diff --git a/fpdfsdk/include/javascript/JS_GlobalData.h b/fpdfsdk/include/javascript/JS_GlobalData.h
index 97a54024d0..1001ff6320 100644
--- a/fpdfsdk/include/javascript/JS_GlobalData.h
+++ b/fpdfsdk/include/javascript/JS_GlobalData.h
@@ -1,97 +1,97 @@
-// 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 _JS_GLOBALDATA_H_
-#define _JS_GLOBALDATA_H_
-
-#define JS_GLOBALDATA_TYPE_NUMBER 0
-#define JS_GLOBALDATA_TYPE_BOOLEAN 1
-#define JS_GLOBALDATA_TYPE_STRING 2
-#define JS_GLOBALDATA_TYPE_OBJECT 3
-#define JS_GLOBALDATA_TYPE_NULL 4
-
-class CJS_KeyValue;
-class CJS_GlobalVariableArray;
-class CJS_GlobalData_Element;
-
-class CJS_GlobalVariableArray
-{
-public:
- CJS_GlobalVariableArray();
- virtual ~CJS_GlobalVariableArray();
-
- void Add(CJS_KeyValue* p);
- int Count() const;
- CJS_KeyValue* GetAt(int index) const;
- void Copy(const CJS_GlobalVariableArray& array);
-
- void Empty();
-
-private:
- CFX_ArrayTemplate<CJS_KeyValue*> array;
-};
-
-class CJS_KeyValue
-{
-public:
- CJS_KeyValue(){}
- virtual ~CJS_KeyValue(){}
-
- CFX_ByteString sKey;
- int nType; //0:int 1:bool 2:string 3:obj
- double dData;
- bool bData;
- CFX_ByteString sData;
- CJS_GlobalVariableArray objData;
-};
-
-class CJS_GlobalData_Element
-{
-public:
- CJS_GlobalData_Element(){}
- virtual ~CJS_GlobalData_Element(){}
-
- CJS_KeyValue data;
- FX_BOOL bPersistent;
-};
-
-class CJS_GlobalData
-{
-public:
- CJS_GlobalData(CPDFDoc_Environment* pApp);
- virtual ~CJS_GlobalData();
-
-public:
- void SetGlobalVariableNumber(FX_LPCSTR propname, double dData);
- void SetGlobalVariableBoolean(FX_LPCSTR propname, bool bData);
- void SetGlobalVariableString(FX_LPCSTR propname, const CFX_ByteString& sData);
- void SetGlobalVariableObject(FX_LPCSTR propname, const CJS_GlobalVariableArray& array);
- void SetGlobalVariableNull(FX_LPCSTR propname);
-
- FX_BOOL SetGlobalVariablePersistent(FX_LPCSTR propname, FX_BOOL bPersistent);
- FX_BOOL DeleteGlobalVariable(FX_LPCSTR propname);
-
- FX_INT32 GetSize() const;
- CJS_GlobalData_Element* GetAt(int index) const;
-
-private:
- void LoadGlobalPersistentVariables();
- void SaveGlobalPersisitentVariables();
-
- CJS_GlobalData_Element* GetGlobalVariable(FX_LPCSTR propname);
- int FindGlobalVariable(FX_LPCSTR propname);
-
- void LoadFileBuffer(FX_LPCWSTR sFilePath, FX_LPBYTE& pBuffer, FX_INT32& nLength);
- void WriteFileBuffer(FX_LPCWSTR sFilePath, FX_LPCSTR pBuffer, FX_INT32 nLength);
- void MakeByteString(const CFX_ByteString& name, CJS_KeyValue* pData, CFX_BinaryBuf& sData);
-
-private:
- CFX_ArrayTemplate<CJS_GlobalData_Element*> m_arrayGlobalData;
- CFX_WideString m_sFilePath;
- CPDFDoc_Environment* m_pApp;
-};
-
-#endif //_JS_GLOBALDATA_H_
+// 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 _JS_GLOBALDATA_H_
+#define _JS_GLOBALDATA_H_
+
+#define JS_GLOBALDATA_TYPE_NUMBER 0
+#define JS_GLOBALDATA_TYPE_BOOLEAN 1
+#define JS_GLOBALDATA_TYPE_STRING 2
+#define JS_GLOBALDATA_TYPE_OBJECT 3
+#define JS_GLOBALDATA_TYPE_NULL 4
+
+class CJS_KeyValue;
+class CJS_GlobalVariableArray;
+class CJS_GlobalData_Element;
+
+class CJS_GlobalVariableArray
+{
+public:
+ CJS_GlobalVariableArray();
+ virtual ~CJS_GlobalVariableArray();
+
+ void Add(CJS_KeyValue* p);
+ int Count() const;
+ CJS_KeyValue* GetAt(int index) const;
+ void Copy(const CJS_GlobalVariableArray& array);
+
+ void Empty();
+
+private:
+ CFX_ArrayTemplate<CJS_KeyValue*> array;
+};
+
+class CJS_KeyValue
+{
+public:
+ CJS_KeyValue(){}
+ virtual ~CJS_KeyValue(){}
+
+ CFX_ByteString sKey;
+ int nType; //0:int 1:bool 2:string 3:obj
+ double dData;
+ bool bData;
+ CFX_ByteString sData;
+ CJS_GlobalVariableArray objData;
+};
+
+class CJS_GlobalData_Element
+{
+public:
+ CJS_GlobalData_Element(){}
+ virtual ~CJS_GlobalData_Element(){}
+
+ CJS_KeyValue data;
+ FX_BOOL bPersistent;
+};
+
+class CJS_GlobalData
+{
+public:
+ CJS_GlobalData(CPDFDoc_Environment* pApp);
+ virtual ~CJS_GlobalData();
+
+public:
+ void SetGlobalVariableNumber(FX_LPCSTR propname, double dData);
+ void SetGlobalVariableBoolean(FX_LPCSTR propname, bool bData);
+ void SetGlobalVariableString(FX_LPCSTR propname, const CFX_ByteString& sData);
+ void SetGlobalVariableObject(FX_LPCSTR propname, const CJS_GlobalVariableArray& array);
+ void SetGlobalVariableNull(FX_LPCSTR propname);
+
+ FX_BOOL SetGlobalVariablePersistent(FX_LPCSTR propname, FX_BOOL bPersistent);
+ FX_BOOL DeleteGlobalVariable(FX_LPCSTR propname);
+
+ FX_INT32 GetSize() const;
+ CJS_GlobalData_Element* GetAt(int index) const;
+
+private:
+ void LoadGlobalPersistentVariables();
+ void SaveGlobalPersisitentVariables();
+
+ CJS_GlobalData_Element* GetGlobalVariable(FX_LPCSTR propname);
+ int FindGlobalVariable(FX_LPCSTR propname);
+
+ void LoadFileBuffer(FX_LPCWSTR sFilePath, FX_LPBYTE& pBuffer, FX_INT32& nLength);
+ void WriteFileBuffer(FX_LPCWSTR sFilePath, FX_LPCSTR pBuffer, FX_INT32 nLength);
+ void MakeByteString(const CFX_ByteString& name, CJS_KeyValue* pData, CFX_BinaryBuf& sData);
+
+private:
+ CFX_ArrayTemplate<CJS_GlobalData_Element*> m_arrayGlobalData;
+ CFX_WideString m_sFilePath;
+ CPDFDoc_Environment* m_pApp;
+};
+
+#endif //_JS_GLOBALDATA_H_
diff --git a/fpdfsdk/include/javascript/JS_Module.h b/fpdfsdk/include/javascript/JS_Module.h
index d725f6bc17..1fcb583a9d 100644
--- a/fpdfsdk/include/javascript/JS_Module.h
+++ b/fpdfsdk/include/javascript/JS_Module.h
@@ -1,47 +1,47 @@
-// 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 _JS_MODULE_H_
-#define _JS_MODULE_H_
-
-class CJS_GlobalData;
-class CJS_ConsoleDlg;
-
-class CJS_Module : public IReader_Module
-{
-public:
- CJS_Module(HMODULE hModule, CReader_App* pApp);
- virtual ~CJS_Module();
-
- virtual void Destroy(){delete this;}
- virtual CFX_ByteString GetModuleName();
-
-public:
- static CJS_Module* GetModule(CReader_App* pApp);
-
- IFXJS_Runtime* NewJSRuntime();
- CJS_GlobalData* NewGlobalData();
- void ReleaseGlobalData();
-
-public:
- //console
- void ShowConsole();
- void HideConsole();
- void ClearConsole();
- void PrintLineConsole(FX_LPCWSTR string);
-
-private:
- HMODULE m_hModule;
- CReader_App* m_pApp;
-
- FX_BOOL m_bInitial;
- CJS_GlobalData* m_pGlobalData;
- FX_INT32 m_nGlobalDataCount;
-
- CJS_ConsoleDlg* m_pConsole;
-};
-
+// 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 _JS_MODULE_H_
+#define _JS_MODULE_H_
+
+class CJS_GlobalData;
+class CJS_ConsoleDlg;
+
+class CJS_Module : public IReader_Module
+{
+public:
+ CJS_Module(HMODULE hModule, CReader_App* pApp);
+ virtual ~CJS_Module();
+
+ virtual void Destroy(){delete this;}
+ virtual CFX_ByteString GetModuleName();
+
+public:
+ static CJS_Module* GetModule(CReader_App* pApp);
+
+ IFXJS_Runtime* NewJSRuntime();
+ CJS_GlobalData* NewGlobalData();
+ void ReleaseGlobalData();
+
+public:
+ //console
+ void ShowConsole();
+ void HideConsole();
+ void ClearConsole();
+ void PrintLineConsole(FX_LPCWSTR string);
+
+private:
+ HMODULE m_hModule;
+ CReader_App* m_pApp;
+
+ FX_BOOL m_bInitial;
+ CJS_GlobalData* m_pGlobalData;
+ FX_INT32 m_nGlobalDataCount;
+
+ CJS_ConsoleDlg* m_pConsole;
+};
+
#endif //_JS_MODULE_H_ \ No newline at end of file
diff --git a/fpdfsdk/include/javascript/JS_Object.h b/fpdfsdk/include/javascript/JS_Object.h
index 8b91f8cd0d..f22da761fb 100644
--- a/fpdfsdk/include/javascript/JS_Object.h
+++ b/fpdfsdk/include/javascript/JS_Object.h
@@ -1,288 +1,288 @@
-// 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 _JS_OBJECT_H_
-#define _JS_OBJECT_H_
-
-class CJS_Object;
-class CJS_Timer;
-class CJS_Context;
-
-class CJS_EmbedObj : public CFX_Object
-{
-public:
- CJS_EmbedObj(CJS_Object* pJSObject);
- virtual ~CJS_EmbedObj();
-
- virtual void TimerProc(CJS_Timer* pTimer){};
-
- CJS_Timer* BeginTimer(CPDFDoc_Environment * pApp, FX_UINT nElapse);
- void EndTimer(CJS_Timer* pTimer);
-
- CJS_Object* GetJSObject(){return m_pJSObject;};
- operator CJS_Object* (){return m_pJSObject;};
-
- CPDFSDK_PageView * JSGetPageView(IFXJS_Context* cc);
- int MsgBox(CPDFDoc_Environment* pApp, CPDFSDK_PageView* pPageView, FX_LPCWSTR swMsg, FX_LPCWSTR swTitle = NULL, FX_UINT nType = 0, FX_UINT nIcon = 0);
- void Alert(CJS_Context* pContext, FX_LPCWSTR swMsg);
- FX_BOOL IsSafeMode(IFXJS_Context* cc);
-
-protected:
-
- CJS_Object* m_pJSObject;
-};
-
-class CJS_Object : public CFX_Object
-{
-public:
- CJS_Object(JSFXObject pObject);
- virtual ~CJS_Object(void);
-
- void MakeWeak();
-
- virtual FX_BOOL IsType(FX_LPCSTR sClassName){return TRUE;};
- virtual CFX_ByteString GetClassName(){return "";};
-
- virtual FX_BOOL InitInstance(IFXJS_Context* cc){return TRUE;};
- virtual FX_BOOL ExitInstance(){return TRUE;};
-
- operator JSFXObject () {return v8::Local<v8::Object>::New(m_pIsolate, m_pObject);}
- operator CJS_EmbedObj* (){return m_pEmbedObj;};
-
- void SetEmbedObject(CJS_EmbedObj* pObj){m_pEmbedObj = pObj;};
- CJS_EmbedObj * GetEmbedObject(){return m_pEmbedObj;};
-
- static CPDFSDK_PageView * JSGetPageView(IFXJS_Context* cc);
- static int MsgBox(CPDFDoc_Environment* pApp, CPDFSDK_PageView* pPageView, FX_LPCWSTR swMsg, FX_LPCWSTR swTitle = NULL, FX_UINT nType = 0,FX_UINT nIcon = 0);
- static void Alert(CJS_Context* pContext, FX_LPCWSTR swMsg);
-
- v8::Isolate* GetIsolate() {return m_pIsolate;}
-protected:
- CJS_EmbedObj * m_pEmbedObj;
- v8::Persistent<v8::Object> m_pObject;
- v8::Isolate* m_pIsolate;
-};
-
-struct JS_TIMER_MAP
-{
- FX_UINT nID;
- CJS_Timer * pTimer;
-};
-
-typedef CFX_ArrayTemplate<JS_TIMER_MAP*> CTimerMapArray;
-
-struct JS_TIMER_MAPARRAY
-{
-public:
- JS_TIMER_MAPARRAY()
- {
- }
-
- ~JS_TIMER_MAPARRAY()
- {
- Reset();
- }
-
- void Reset()
- {
- for (int i=0,sz=m_Array.GetSize(); i<sz; i++)
- delete m_Array.GetAt(i);
-
- m_Array.RemoveAll();
- }
-
- void SetAt(FX_UINT nIndex,CJS_Timer * pTimer)
- {
- int i = Find(nIndex);
-
- if (i>=0)
- {
- if (JS_TIMER_MAP * pMap = m_Array.GetAt(i))
- pMap->pTimer = pTimer;
- }
- else
- {
- if (JS_TIMER_MAP * pMap = new JS_TIMER_MAP)
- {
- pMap->nID = nIndex;
- pMap->pTimer = pTimer;
- m_Array.Add(pMap);
- }
- }
- }
-
- CJS_Timer * GetAt(FX_UINT nIndex)
- {
- int i = Find(nIndex);
-
- if (i>=0)
- {
- if (JS_TIMER_MAP * pMap = m_Array.GetAt(i))
- return pMap->pTimer;
- }
- return NULL;
- }
-
- void RemoveAt(FX_UINT nIndex)
- {
- int i = Find(nIndex);
-
- if (i>=0)
- {
- delete m_Array.GetAt(i);
- m_Array.RemoveAt(i);
- }
- //To prevent potential fake memory leak reported by vc6.
- if(m_Array.GetSize() == 0)
- m_Array.RemoveAll();
- }
-
- int Find(FX_UINT nIndex)
- {
- for (int i=0,sz=m_Array.GetSize(); i<sz; i++)
- {
- if (JS_TIMER_MAP * pMap = m_Array.GetAt(i))
- {
- if (pMap->nID == nIndex)
- return i;
- }
- }
-
- return -1;
- }
-
- CTimerMapArray m_Array;
-};
-
-static JS_TIMER_MAPARRAY m_sTimeMap;
-
-class CJS_Runtime;
-
-class CJS_Timer
-{
-public:
- CJS_Timer(CJS_EmbedObj * pObj,CPDFDoc_Environment* pApp): m_pEmbedObj(pObj),
- m_nTimerID(0),
- m_bProcessing(FALSE),
- m_dwStartTime(0),
- m_dwTimeOut(0),
- m_dwElapse(0),
- m_pRuntime(NULL),
- m_nType(0),
- m_pApp(pApp)
- {
- }
-
- virtual ~CJS_Timer()
- {
- KillJSTimer();
- }
-
-public:
- FX_UINT SetJSTimer(FX_UINT nElapse)
- {
- if (m_nTimerID)KillJSTimer();
- IFX_SystemHandler* pHandler = m_pApp->GetSysHandler();
- m_nTimerID = pHandler->SetTimer(nElapse,TimerProc);
- m_sTimeMap.SetAt(m_nTimerID,this);
- m_dwElapse = nElapse;
- return m_nTimerID;
- };
-
- void KillJSTimer()
- {
- if (m_nTimerID)
- {
- IFX_SystemHandler* pHandler = m_pApp->GetSysHandler();
- pHandler->KillTimer(m_nTimerID);
- m_sTimeMap.RemoveAt(m_nTimerID);
- m_nTimerID = 0;
- }
- };
-
- void SetType(int nType)
- {
- m_nType = nType;
- }
-
- int GetType() const
- {
- return m_nType;
- }
-
- void SetStartTime(FX_DWORD dwStartTime)
- {
- m_dwStartTime = dwStartTime;
- }
-
- FX_DWORD GetStartTime() const
- {
- return m_dwStartTime;
- }
-
- void SetTimeOut(FX_DWORD dwTimeOut)
- {
- m_dwTimeOut = dwTimeOut;
- }
-
- FX_DWORD GetTimeOut() const
- {
- return m_dwTimeOut;
- }
-
- void SetRuntime(CJS_Runtime* pRuntime)
- {
- m_pRuntime = pRuntime;
- }
-
- CJS_Runtime* GetRuntime() const
- {
- return m_pRuntime;
- }
-
- void SetJScript(const CFX_WideString& script)
- {
- m_swJScript = script;
- }
-
- CFX_WideString GetJScript() const
- {
- return m_swJScript;
- }
-
- static void TimerProc(int idEvent)
- {
- if (CJS_Timer * pTimer = m_sTimeMap.GetAt(idEvent))
- {
- if (!pTimer->m_bProcessing)
- {
- pTimer->m_bProcessing = TRUE;
- if (pTimer->m_pEmbedObj) pTimer->m_pEmbedObj->TimerProc(pTimer);
- pTimer->m_bProcessing = FALSE;
- }
- else
- {
- // TRACE(L"BUSY!\n");
- }
- }
- };
-
-private:
- FX_UINT m_nTimerID;
- CJS_EmbedObj* m_pEmbedObj;
- FX_BOOL m_bProcessing;
-
- //data
- FX_DWORD m_dwStartTime;
- FX_DWORD m_dwTimeOut;
- FX_DWORD m_dwElapse;
- CJS_Runtime* m_pRuntime;
- CFX_WideString m_swJScript;
- int m_nType; //0:Interval; 1:TimeOut
-
- CPDFDoc_Environment* m_pApp;
-};
-#endif //_JS_OBJECT_H_
+// 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 _JS_OBJECT_H_
+#define _JS_OBJECT_H_
+
+class CJS_Object;
+class CJS_Timer;
+class CJS_Context;
+
+class CJS_EmbedObj : public CFX_Object
+{
+public:
+ CJS_EmbedObj(CJS_Object* pJSObject);
+ virtual ~CJS_EmbedObj();
+
+ virtual void TimerProc(CJS_Timer* pTimer){};
+
+ CJS_Timer* BeginTimer(CPDFDoc_Environment * pApp, FX_UINT nElapse);
+ void EndTimer(CJS_Timer* pTimer);
+
+ CJS_Object* GetJSObject(){return m_pJSObject;};
+ operator CJS_Object* (){return m_pJSObject;};
+
+ CPDFSDK_PageView * JSGetPageView(IFXJS_Context* cc);
+ int MsgBox(CPDFDoc_Environment* pApp, CPDFSDK_PageView* pPageView, FX_LPCWSTR swMsg, FX_LPCWSTR swTitle = NULL, FX_UINT nType = 0, FX_UINT nIcon = 0);
+ void Alert(CJS_Context* pContext, FX_LPCWSTR swMsg);
+ FX_BOOL IsSafeMode(IFXJS_Context* cc);
+
+protected:
+
+ CJS_Object* m_pJSObject;
+};
+
+class CJS_Object : public CFX_Object
+{
+public:
+ CJS_Object(JSFXObject pObject);
+ virtual ~CJS_Object(void);
+
+ void MakeWeak();
+
+ virtual FX_BOOL IsType(FX_LPCSTR sClassName){return TRUE;};
+ virtual CFX_ByteString GetClassName(){return "";};
+
+ virtual FX_BOOL InitInstance(IFXJS_Context* cc){return TRUE;};
+ virtual FX_BOOL ExitInstance(){return TRUE;};
+
+ operator JSFXObject () {return v8::Local<v8::Object>::New(m_pIsolate, m_pObject);}
+ operator CJS_EmbedObj* (){return m_pEmbedObj;};
+
+ void SetEmbedObject(CJS_EmbedObj* pObj){m_pEmbedObj = pObj;};
+ CJS_EmbedObj * GetEmbedObject(){return m_pEmbedObj;};
+
+ static CPDFSDK_PageView * JSGetPageView(IFXJS_Context* cc);
+ static int MsgBox(CPDFDoc_Environment* pApp, CPDFSDK_PageView* pPageView, FX_LPCWSTR swMsg, FX_LPCWSTR swTitle = NULL, FX_UINT nType = 0,FX_UINT nIcon = 0);
+ static void Alert(CJS_Context* pContext, FX_LPCWSTR swMsg);
+
+ v8::Isolate* GetIsolate() {return m_pIsolate;}
+protected:
+ CJS_EmbedObj * m_pEmbedObj;
+ v8::Persistent<v8::Object> m_pObject;
+ v8::Isolate* m_pIsolate;
+};
+
+struct JS_TIMER_MAP
+{
+ FX_UINT nID;
+ CJS_Timer * pTimer;
+};
+
+typedef CFX_ArrayTemplate<JS_TIMER_MAP*> CTimerMapArray;
+
+struct JS_TIMER_MAPARRAY
+{
+public:
+ JS_TIMER_MAPARRAY()
+ {
+ }
+
+ ~JS_TIMER_MAPARRAY()
+ {
+ Reset();
+ }
+
+ void Reset()
+ {
+ for (int i=0,sz=m_Array.GetSize(); i<sz; i++)
+ delete m_Array.GetAt(i);
+
+ m_Array.RemoveAll();
+ }
+
+ void SetAt(FX_UINT nIndex,CJS_Timer * pTimer)
+ {
+ int i = Find(nIndex);
+
+ if (i>=0)
+ {
+ if (JS_TIMER_MAP * pMap = m_Array.GetAt(i))
+ pMap->pTimer = pTimer;
+ }
+ else
+ {
+ if (JS_TIMER_MAP * pMap = new JS_TIMER_MAP)
+ {
+ pMap->nID = nIndex;
+ pMap->pTimer = pTimer;
+ m_Array.Add(pMap);
+ }
+ }
+ }
+
+ CJS_Timer * GetAt(FX_UINT nIndex)
+ {
+ int i = Find(nIndex);
+
+ if (i>=0)
+ {
+ if (JS_TIMER_MAP * pMap = m_Array.GetAt(i))
+ return pMap->pTimer;
+ }
+ return NULL;
+ }
+
+ void RemoveAt(FX_UINT nIndex)
+ {
+ int i = Find(nIndex);
+
+ if (i>=0)
+ {
+ delete m_Array.GetAt(i);
+ m_Array.RemoveAt(i);
+ }
+ //To prevent potential fake memory leak reported by vc6.
+ if(m_Array.GetSize() == 0)
+ m_Array.RemoveAll();
+ }
+
+ int Find(FX_UINT nIndex)
+ {
+ for (int i=0,sz=m_Array.GetSize(); i<sz; i++)
+ {
+ if (JS_TIMER_MAP * pMap = m_Array.GetAt(i))
+ {
+ if (pMap->nID == nIndex)
+ return i;
+ }
+ }
+
+ return -1;
+ }
+
+ CTimerMapArray m_Array;
+};
+
+static JS_TIMER_MAPARRAY m_sTimeMap;
+
+class CJS_Runtime;
+
+class CJS_Timer
+{
+public:
+ CJS_Timer(CJS_EmbedObj * pObj,CPDFDoc_Environment* pApp): m_pEmbedObj(pObj),
+ m_nTimerID(0),
+ m_bProcessing(FALSE),
+ m_dwStartTime(0),
+ m_dwTimeOut(0),
+ m_dwElapse(0),
+ m_pRuntime(NULL),
+ m_nType(0),
+ m_pApp(pApp)
+ {
+ }
+
+ virtual ~CJS_Timer()
+ {
+ KillJSTimer();
+ }
+
+public:
+ FX_UINT SetJSTimer(FX_UINT nElapse)
+ {
+ if (m_nTimerID)KillJSTimer();
+ IFX_SystemHandler* pHandler = m_pApp->GetSysHandler();
+ m_nTimerID = pHandler->SetTimer(nElapse,TimerProc);
+ m_sTimeMap.SetAt(m_nTimerID,this);
+ m_dwElapse = nElapse;
+ return m_nTimerID;
+ };
+
+ void KillJSTimer()
+ {
+ if (m_nTimerID)
+ {
+ IFX_SystemHandler* pHandler = m_pApp->GetSysHandler();
+ pHandler->KillTimer(m_nTimerID);
+ m_sTimeMap.RemoveAt(m_nTimerID);
+ m_nTimerID = 0;
+ }
+ };
+
+ void SetType(int nType)
+ {
+ m_nType = nType;
+ }
+
+ int GetType() const
+ {
+ return m_nType;
+ }
+
+ void SetStartTime(FX_DWORD dwStartTime)
+ {
+ m_dwStartTime = dwStartTime;
+ }
+
+ FX_DWORD GetStartTime() const
+ {
+ return m_dwStartTime;
+ }
+
+ void SetTimeOut(FX_DWORD dwTimeOut)
+ {
+ m_dwTimeOut = dwTimeOut;
+ }
+
+ FX_DWORD GetTimeOut() const
+ {
+ return m_dwTimeOut;
+ }
+
+ void SetRuntime(CJS_Runtime* pRuntime)
+ {
+ m_pRuntime = pRuntime;
+ }
+
+ CJS_Runtime* GetRuntime() const
+ {
+ return m_pRuntime;
+ }
+
+ void SetJScript(const CFX_WideString& script)
+ {
+ m_swJScript = script;
+ }
+
+ CFX_WideString GetJScript() const
+ {
+ return m_swJScript;
+ }
+
+ static void TimerProc(int idEvent)
+ {
+ if (CJS_Timer * pTimer = m_sTimeMap.GetAt(idEvent))
+ {
+ if (!pTimer->m_bProcessing)
+ {
+ pTimer->m_bProcessing = TRUE;
+ if (pTimer->m_pEmbedObj) pTimer->m_pEmbedObj->TimerProc(pTimer);
+ pTimer->m_bProcessing = FALSE;
+ }
+ else
+ {
+ // TRACE(L"BUSY!\n");
+ }
+ }
+ };
+
+private:
+ FX_UINT m_nTimerID;
+ CJS_EmbedObj* m_pEmbedObj;
+ FX_BOOL m_bProcessing;
+
+ //data
+ FX_DWORD m_dwStartTime;
+ FX_DWORD m_dwTimeOut;
+ FX_DWORD m_dwElapse;
+ CJS_Runtime* m_pRuntime;
+ CFX_WideString m_swJScript;
+ int m_nType; //0:Interval; 1:TimeOut
+
+ CPDFDoc_Environment* m_pApp;
+};
+#endif //_JS_OBJECT_H_
diff --git a/fpdfsdk/include/javascript/JS_Runtime.h b/fpdfsdk/include/javascript/JS_Runtime.h
index 32f845755f..0a195f132c 100644
--- a/fpdfsdk/include/javascript/JS_Runtime.h
+++ b/fpdfsdk/include/javascript/JS_Runtime.h
@@ -1,70 +1,70 @@
-// 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 _JS_RUNTIME_H_
-#define _JS_RUNTIME_H_
-
-class CJS_FieldEvent
-{
-public:
- CFX_WideString sTargetName;
- JS_EVENT_T eEventType;
- CJS_FieldEvent* pNext;
-};
-
-class CJS_Runtime : public IFXJS_Runtime
-{
-public:
- CJS_Runtime(CPDFDoc_Environment * pApp);
- virtual ~CJS_Runtime();
-
- virtual IFXJS_Context * NewContext();
- virtual void ReleaseContext(IFXJS_Context * pContext);
- virtual IFXJS_Context* GetCurrentContext();
-
- virtual void SetReaderDocument(CPDFSDK_Document *pReaderDoc);
- virtual CPDFSDK_Document * GetReaderDocument(){return m_pDocument;}
-
- virtual void GetObjectNames(CFX_WideStringArray& array);
- virtual void GetObjectConsts(const CFX_WideString& swObjName, CFX_WideStringArray& array);
- virtual void GetObjectProps(const CFX_WideString& swObjName, CFX_WideStringArray& array);
- virtual void GetObjectMethods(const CFX_WideString& swObjName, CFX_WideStringArray& array);
-
- virtual void Exit();
- virtual void Enter();
- virtual FX_BOOL IsEntered();
-
- CPDFDoc_Environment * GetReaderApp(){return m_pApp;}
-
- FX_BOOL InitJSObjects();
-
- FX_BOOL AddEventToLoop(const CFX_WideString& sTargetName, JS_EVENT_T eEventType);
- void RemoveEventInLoop(const CFX_WideString& sTargetName, JS_EVENT_T eEventType);
- void RemoveEventsInLoop(CJS_FieldEvent* pStart);
-
- void BeginBlock(){m_bBlocking = TRUE;}
- void EndBlock(){m_bBlocking = FALSE;}
- FX_BOOL IsBlocking(){return m_bBlocking;}
-
- operator IJS_Runtime*() {return (IJS_Runtime*)m_isolate;}
- v8::Isolate* GetIsolate(){return m_isolate;};
- void SetIsolate(v8::Isolate* isolate){m_isolate = isolate;}
-
- v8::Handle<v8::Context> NewJSContext();
-protected:
- CFX_ArrayTemplate<CJS_Context *> m_ContextArray;
- CPDFDoc_Environment * m_pApp;
- CPDFSDK_Document * m_pDocument;
- FX_BOOL m_bBlocking;
- CJS_FieldEvent* m_pFieldEventPath;
-
- v8::Isolate* m_isolate;
- v8::Persistent<v8::Context> m_context;
- FX_BOOL m_bRegistered;
-};
-
-#endif //_JS_RUNTIME_H_
-
+// 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 _JS_RUNTIME_H_
+#define _JS_RUNTIME_H_
+
+class CJS_FieldEvent
+{
+public:
+ CFX_WideString sTargetName;
+ JS_EVENT_T eEventType;
+ CJS_FieldEvent* pNext;
+};
+
+class CJS_Runtime : public IFXJS_Runtime
+{
+public:
+ CJS_Runtime(CPDFDoc_Environment * pApp);
+ virtual ~CJS_Runtime();
+
+ virtual IFXJS_Context * NewContext();
+ virtual void ReleaseContext(IFXJS_Context * pContext);
+ virtual IFXJS_Context* GetCurrentContext();
+
+ virtual void SetReaderDocument(CPDFSDK_Document *pReaderDoc);
+ virtual CPDFSDK_Document * GetReaderDocument(){return m_pDocument;}
+
+ virtual void GetObjectNames(CFX_WideStringArray& array);
+ virtual void GetObjectConsts(const CFX_WideString& swObjName, CFX_WideStringArray& array);
+ virtual void GetObjectProps(const CFX_WideString& swObjName, CFX_WideStringArray& array);
+ virtual void GetObjectMethods(const CFX_WideString& swObjName, CFX_WideStringArray& array);
+
+ virtual void Exit();
+ virtual void Enter();
+ virtual FX_BOOL IsEntered();
+
+ CPDFDoc_Environment * GetReaderApp(){return m_pApp;}
+
+ FX_BOOL InitJSObjects();
+
+ FX_BOOL AddEventToLoop(const CFX_WideString& sTargetName, JS_EVENT_T eEventType);
+ void RemoveEventInLoop(const CFX_WideString& sTargetName, JS_EVENT_T eEventType);
+ void RemoveEventsInLoop(CJS_FieldEvent* pStart);
+
+ void BeginBlock(){m_bBlocking = TRUE;}
+ void EndBlock(){m_bBlocking = FALSE;}
+ FX_BOOL IsBlocking(){return m_bBlocking;}
+
+ operator IJS_Runtime*() {return (IJS_Runtime*)m_isolate;}
+ v8::Isolate* GetIsolate(){return m_isolate;};
+ void SetIsolate(v8::Isolate* isolate){m_isolate = isolate;}
+
+ v8::Handle<v8::Context> NewJSContext();
+protected:
+ CFX_ArrayTemplate<CJS_Context *> m_ContextArray;
+ CPDFDoc_Environment * m_pApp;
+ CPDFSDK_Document * m_pDocument;
+ FX_BOOL m_bBlocking;
+ CJS_FieldEvent* m_pFieldEventPath;
+
+ v8::Isolate* m_isolate;
+ v8::Persistent<v8::Context> m_context;
+ FX_BOOL m_bRegistered;
+};
+
+#endif //_JS_RUNTIME_H_
+
diff --git a/fpdfsdk/include/javascript/JS_Value.h b/fpdfsdk/include/javascript/JS_Value.h
index f87f9e1d43..030cdd5cf9 100644
--- a/fpdfsdk/include/javascript/JS_Value.h
+++ b/fpdfsdk/include/javascript/JS_Value.h
@@ -1,186 +1,186 @@
-// 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 _JS_VALUE_H_
-#define _JS_VALUE_H_
-
-class CJS_Array;
-class CJS_Date;
-
-class CJS_Value
-{
-public:
- CJS_Value(v8::Isolate* isolate);
- CJS_Value(v8::Isolate* isolate, v8::Handle<v8::Value> pValue,FXJSVALUETYPE t);
- CJS_Value(v8::Isolate* isolate, const int &iValue);
- CJS_Value(v8::Isolate* isolate, const double &dValue);
- CJS_Value(v8::Isolate* isolate, const float &fValue);
- CJS_Value(v8::Isolate* isolate, const bool &bValue);
- CJS_Value(v8::Isolate* isolate, JSFXObject);
- CJS_Value(v8::Isolate* isolate, CJS_Object *);
- CJS_Value(v8::Isolate* isolate, FX_LPCSTR pStr);
- CJS_Value(v8::Isolate* isolate, FX_LPCWSTR pWstr);
- CJS_Value(v8::Isolate* isolate, CJS_Array& array);
-
- ~CJS_Value();
-
- void SetNull();
- void Attach(v8::Handle<v8::Value> pValue,FXJSVALUETYPE t);
- void Attach(CJS_Value *pValue);
- void Detach();
-
-
- operator int() const;
- operator bool() const;
- operator double() const;
- operator float() const;
- operator CJS_Object *() const;
- //operator JSFXObject *() const;
- operator v8::Handle<v8::Object>() const;
- operator v8::Handle<v8::Array>() const;
- operator CFX_WideString() const;
- //operator FX_WCHAR *() const;
- operator CFX_ByteString() const;
- v8::Handle<v8::Value> ToJSValue();
-
- void operator = (int iValue);
- void operator = (bool bValue);
- void operator = (double);
- void operator = (float);
- void operator = (CJS_Object *);
- void operator = (v8::Handle<v8::Object>);
-// void operator = (JSObject *);
- void operator = (CJS_Array &);
- void operator = (CJS_Date &);
- void operator = (FX_LPCWSTR pWstr);
- void operator = (FX_LPCSTR pStr);
- void operator = (CJS_Value value);
-
- FX_BOOL IsArrayObject() const;
- FX_BOOL IsDateObject() const;
- FXJSVALUETYPE GetType() const;
-
- FX_BOOL ConvertToArray(CJS_Array &) const;
- FX_BOOL ConvertToDate(CJS_Date &) const;
-
- v8::Isolate* GetIsolate() {return m_isolate;}
-protected:
- v8::Handle<v8::Value> m_pValue;
- FXJSVALUETYPE m_eType;
- v8::Isolate* m_isolate;
-};
-
-template<class TYPE> class CJS_ParametersTmpl : public CFX_ArrayTemplate<TYPE>
-{
-public:
- void push_back(TYPE newElement){CFX_ArrayTemplate<TYPE>::Add(newElement);}
- int size() const{return CFX_ArrayTemplate<TYPE>::GetSize();}
-};
-typedef CJS_ParametersTmpl<CJS_Value> CJS_Parameters;
-
-class CJS_PropValue: public CJS_Value
-{
-public:
- CJS_PropValue(const CJS_Value &);
- CJS_PropValue(v8::Isolate* isolate);
- ~CJS_PropValue();
-public:
- FX_BOOL IsSetting();
- FX_BOOL IsGetting();
- void operator<<(int );
- void operator>>(int &) const;
- void operator<<(bool);
- void operator>>(bool &) const;
- void operator<<(double );
- void operator>>(double &) const;
- void operator<<(CJS_Object *pObj);
- void operator>>(CJS_Object *&ppObj) const;
- void operator<<(CFX_ByteString);
- void operator>>(CFX_ByteString &) const;
- void operator<<(CFX_WideString);
- void operator>>(CFX_WideString &) const;
- void operator<<(FX_LPCWSTR c_string);
-
- void operator<<(JSFXObject);
- void operator>>(JSFXObject &) const;
-
- void operator>>(CJS_Array &array) const;
- void operator<<(CJS_Array &array);
-
- void operator<<(CJS_Date &date);
- void operator>>(CJS_Date &date) const;
-
- operator v8::Handle<v8::Value>() const;
-
- void StartSetting();
- void StartGetting();
-private:
- FX_BOOL m_bIsSetting;
-};
-
-class CJS_Array
-{
-public:
- CJS_Array(v8::Isolate* isolate);
- virtual ~CJS_Array();
-
- void Attach(v8::Handle<v8::Array> pArray);
- void GetElement(unsigned index,CJS_Value &value);
- void SetElement(unsigned index,CJS_Value value);
- int GetLength();
- FX_BOOL IsAttached();
- operator v8::Handle<v8::Array>();
-
- v8::Isolate* GetIsolate() {return m_isolate;}
-private:
- v8::Handle<v8::Array> m_pArray;
- v8::Isolate* m_isolate;
-};
-
-class CJS_Date
-{
-friend class CJS_Value;
-public:
- CJS_Date(v8::Isolate* isolate);
- CJS_Date(v8::Isolate* isolate,double dMsec_time);
- CJS_Date(v8::Isolate* isolate,int year, int mon, int day,int hour, int min, int sec);
- virtual ~CJS_Date();
- void Attach(v8::Handle<v8::Value> pDate);
-
- int GetYear();
- void SetYear(int iYear);
-
- int GetMonth();
- void SetMonth(int iMonth);
-
- int GetDay();
- void SetDay(int iDay);
-
- int GetHours();
- void SetHours(int iHours);
-
- int GetMinutes();
- void SetMinutes(int minutes);
-
- int GetSeconds();
- void SetSeconds(int seconds);
-
- operator v8::Handle<v8::Value>();
- operator double() const;
-
- CFX_WideString ToString() const;
-
- static double MakeDate(int year, int mon, int mday,int hour, int min, int sec,int ms);
-
- FX_BOOL IsValidDate();
-
-protected:
- v8::Handle<v8::Value> m_pDate;
- v8::Isolate* m_isolate;
-};
-
-#endif //_JS_VALUE_H_
-
+// 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 _JS_VALUE_H_
+#define _JS_VALUE_H_
+
+class CJS_Array;
+class CJS_Date;
+
+class CJS_Value
+{
+public:
+ CJS_Value(v8::Isolate* isolate);
+ CJS_Value(v8::Isolate* isolate, v8::Handle<v8::Value> pValue,FXJSVALUETYPE t);
+ CJS_Value(v8::Isolate* isolate, const int &iValue);
+ CJS_Value(v8::Isolate* isolate, const double &dValue);
+ CJS_Value(v8::Isolate* isolate, const float &fValue);
+ CJS_Value(v8::Isolate* isolate, const bool &bValue);
+ CJS_Value(v8::Isolate* isolate, JSFXObject);
+ CJS_Value(v8::Isolate* isolate, CJS_Object *);
+ CJS_Value(v8::Isolate* isolate, FX_LPCSTR pStr);
+ CJS_Value(v8::Isolate* isolate, FX_LPCWSTR pWstr);
+ CJS_Value(v8::Isolate* isolate, CJS_Array& array);
+
+ ~CJS_Value();
+
+ void SetNull();
+ void Attach(v8::Handle<v8::Value> pValue,FXJSVALUETYPE t);
+ void Attach(CJS_Value *pValue);
+ void Detach();
+
+
+ operator int() const;
+ operator bool() const;
+ operator double() const;
+ operator float() const;
+ operator CJS_Object *() const;
+ //operator JSFXObject *() const;
+ operator v8::Handle<v8::Object>() const;
+ operator v8::Handle<v8::Array>() const;
+ operator CFX_WideString() const;
+ //operator FX_WCHAR *() const;
+ operator CFX_ByteString() const;
+ v8::Handle<v8::Value> ToJSValue();
+
+ void operator = (int iValue);
+ void operator = (bool bValue);
+ void operator = (double);
+ void operator = (float);
+ void operator = (CJS_Object *);
+ void operator = (v8::Handle<v8::Object>);
+// void operator = (JSObject *);
+ void operator = (CJS_Array &);
+ void operator = (CJS_Date &);
+ void operator = (FX_LPCWSTR pWstr);
+ void operator = (FX_LPCSTR pStr);
+ void operator = (CJS_Value value);
+
+ FX_BOOL IsArrayObject() const;
+ FX_BOOL IsDateObject() const;
+ FXJSVALUETYPE GetType() const;
+
+ FX_BOOL ConvertToArray(CJS_Array &) const;
+ FX_BOOL ConvertToDate(CJS_Date &) const;
+
+ v8::Isolate* GetIsolate() {return m_isolate;}
+protected:
+ v8::Handle<v8::Value> m_pValue;
+ FXJSVALUETYPE m_eType;
+ v8::Isolate* m_isolate;
+};
+
+template<class TYPE> class CJS_ParametersTmpl : public CFX_ArrayTemplate<TYPE>
+{
+public:
+ void push_back(TYPE newElement){CFX_ArrayTemplate<TYPE>::Add(newElement);}
+ int size() const{return CFX_ArrayTemplate<TYPE>::GetSize();}
+};
+typedef CJS_ParametersTmpl<CJS_Value> CJS_Parameters;
+
+class CJS_PropValue: public CJS_Value
+{
+public:
+ CJS_PropValue(const CJS_Value &);
+ CJS_PropValue(v8::Isolate* isolate);
+ ~CJS_PropValue();
+public:
+ FX_BOOL IsSetting();
+ FX_BOOL IsGetting();
+ void operator<<(int );
+ void operator>>(int &) const;
+ void operator<<(bool);
+ void operator>>(bool &) const;
+ void operator<<(double );
+ void operator>>(double &) const;
+ void operator<<(CJS_Object *pObj);
+ void operator>>(CJS_Object *&ppObj) const;
+ void operator<<(CFX_ByteString);
+ void operator>>(CFX_ByteString &) const;
+ void operator<<(CFX_WideString);
+ void operator>>(CFX_WideString &) const;
+ void operator<<(FX_LPCWSTR c_string);
+
+ void operator<<(JSFXObject);
+ void operator>>(JSFXObject &) const;
+
+ void operator>>(CJS_Array &array) const;
+ void operator<<(CJS_Array &array);
+
+ void operator<<(CJS_Date &date);
+ void operator>>(CJS_Date &date) const;
+
+ operator v8::Handle<v8::Value>() const;
+
+ void StartSetting();
+ void StartGetting();
+private:
+ FX_BOOL m_bIsSetting;
+};
+
+class CJS_Array
+{
+public:
+ CJS_Array(v8::Isolate* isolate);
+ virtual ~CJS_Array();
+
+ void Attach(v8::Handle<v8::Array> pArray);
+ void GetElement(unsigned index,CJS_Value &value);
+ void SetElement(unsigned index,CJS_Value value);
+ int GetLength();
+ FX_BOOL IsAttached();
+ operator v8::Handle<v8::Array>();
+
+ v8::Isolate* GetIsolate() {return m_isolate;}
+private:
+ v8::Handle<v8::Array> m_pArray;
+ v8::Isolate* m_isolate;
+};
+
+class CJS_Date
+{
+friend class CJS_Value;
+public:
+ CJS_Date(v8::Isolate* isolate);
+ CJS_Date(v8::Isolate* isolate,double dMsec_time);
+ CJS_Date(v8::Isolate* isolate,int year, int mon, int day,int hour, int min, int sec);
+ virtual ~CJS_Date();
+ void Attach(v8::Handle<v8::Value> pDate);
+
+ int GetYear();
+ void SetYear(int iYear);
+
+ int GetMonth();
+ void SetMonth(int iMonth);
+
+ int GetDay();
+ void SetDay(int iDay);
+
+ int GetHours();
+ void SetHours(int iHours);
+
+ int GetMinutes();
+ void SetMinutes(int minutes);
+
+ int GetSeconds();
+ void SetSeconds(int seconds);
+
+ operator v8::Handle<v8::Value>();
+ operator double() const;
+
+ CFX_WideString ToString() const;
+
+ static double MakeDate(int year, int mon, int mday,int hour, int min, int sec,int ms);
+
+ FX_BOOL IsValidDate();
+
+protected:
+ v8::Handle<v8::Value> m_pDate;
+ v8::Isolate* m_isolate;
+};
+
+#endif //_JS_VALUE_H_
+
diff --git a/fpdfsdk/include/javascript/JavaScript.h b/fpdfsdk/include/javascript/JavaScript.h
index d1375cc2f4..166472b61e 100644
--- a/fpdfsdk/include/javascript/JavaScript.h
+++ b/fpdfsdk/include/javascript/JavaScript.h
@@ -1,39 +1,39 @@
-// 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 _JAVASCRIPT_H_
-#define _JAVASCRIPT_H_
-
-
-#ifndef _INC_PDFAPI
- #define _INC_PDFAPI
-
- #include "../../../core/include/fpdfapi/fpdf_module.h"
- #include "../../../core/include/fpdfdoc/fpdf_doc.h"
- #include "../../../core/include/fpdfdoc/fpdf_vt.h"
- #include "../../../core/include/fxcrt/fx_xml.h"
- #include "../../../core/include/fdrm/fx_crypt.h"
- #include "../../../core/include/fpdfapi/fpdf_pageobj.h"
- #include "../../../core/include/fpdfapi/fpdf_serial.h"
-
-
- #include "../../include/fx_systemhandler.h"
-#endif
-
-
-#include "../jsapi/fxjs_v8.h"
-#include "../fxedit/fx_edit.h"
-#include "../pdfwindow/IPDFWindow.h"
-#include "../fsdk_mgr.h"
-
-
-#include <string>
-//#pragma warning( disable : 4786)
-#include <vector>
-
-
-#endif //_JAVASCRIPT_H_
-
+// 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 _JAVASCRIPT_H_
+#define _JAVASCRIPT_H_
+
+
+#ifndef _INC_PDFAPI
+ #define _INC_PDFAPI
+
+ #include "../../../core/include/fpdfapi/fpdf_module.h"
+ #include "../../../core/include/fpdfdoc/fpdf_doc.h"
+ #include "../../../core/include/fpdfdoc/fpdf_vt.h"
+ #include "../../../core/include/fxcrt/fx_xml.h"
+ #include "../../../core/include/fdrm/fx_crypt.h"
+ #include "../../../core/include/fpdfapi/fpdf_pageobj.h"
+ #include "../../../core/include/fpdfapi/fpdf_serial.h"
+
+
+ #include "../../include/fx_systemhandler.h"
+#endif
+
+
+#include "../jsapi/fxjs_v8.h"
+#include "../fxedit/fx_edit.h"
+#include "../pdfwindow/IPDFWindow.h"
+#include "../fsdk_mgr.h"
+
+
+#include <string>
+//#pragma warning( disable : 4786)
+#include <vector>
+
+
+#endif //_JAVASCRIPT_H_
+
diff --git a/fpdfsdk/include/javascript/PublicMethods.h b/fpdfsdk/include/javascript/PublicMethods.h
index a485a9a31a..8d4e68392f 100644
--- a/fpdfsdk/include/javascript/PublicMethods.h
+++ b/fpdfsdk/include/javascript/PublicMethods.h
@@ -1,101 +1,101 @@
-// 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 _PUBLICMETHODS_H_
-#define _PUBLICMETHODS_H_
-
-class CJS_PublicMethods : public CJS_Object
-{
-public:
- CJS_PublicMethods(JSFXObject pObject) : CJS_Object(pObject) {};
- virtual ~CJS_PublicMethods(void){};
-
-public:
- static FX_BOOL AFNumber_Format(OBJ_METHOD_PARAMS);
- static FX_BOOL AFNumber_Keystroke(OBJ_METHOD_PARAMS);
- static FX_BOOL AFPercent_Format(OBJ_METHOD_PARAMS);
- static FX_BOOL AFPercent_Keystroke(OBJ_METHOD_PARAMS);
- static FX_BOOL AFDate_FormatEx(OBJ_METHOD_PARAMS);
- static FX_BOOL AFDate_KeystrokeEx(OBJ_METHOD_PARAMS);
- static FX_BOOL AFDate_Format(OBJ_METHOD_PARAMS);
- static FX_BOOL AFDate_Keystroke(OBJ_METHOD_PARAMS);
- static FX_BOOL AFTime_FormatEx(OBJ_METHOD_PARAMS); //
- static FX_BOOL AFTime_KeystrokeEx(OBJ_METHOD_PARAMS);
- static FX_BOOL AFTime_Format(OBJ_METHOD_PARAMS);
- static FX_BOOL AFTime_Keystroke(OBJ_METHOD_PARAMS);
- static FX_BOOL AFSpecial_Format(OBJ_METHOD_PARAMS);
- static FX_BOOL AFSpecial_Keystroke(OBJ_METHOD_PARAMS);
- static FX_BOOL AFSpecial_KeystrokeEx(OBJ_METHOD_PARAMS);//
- static FX_BOOL AFSimple(OBJ_METHOD_PARAMS);
- static FX_BOOL AFMakeNumber(OBJ_METHOD_PARAMS);
- static FX_BOOL AFSimple_Calculate(OBJ_METHOD_PARAMS);
- static FX_BOOL AFRange_Validate(OBJ_METHOD_PARAMS);
- static FX_BOOL AFMergeChange(OBJ_METHOD_PARAMS);
- static FX_BOOL AFParseDateEx(OBJ_METHOD_PARAMS);
- static FX_BOOL AFExtractNums(OBJ_METHOD_PARAMS);
-
-public:
- JS_STATIC_GLOBAL_FUN(AFNumber_Format);
- JS_STATIC_GLOBAL_FUN(AFNumber_Keystroke);
- JS_STATIC_GLOBAL_FUN(AFPercent_Format);
- JS_STATIC_GLOBAL_FUN(AFPercent_Keystroke);
- JS_STATIC_GLOBAL_FUN(AFDate_FormatEx);
- JS_STATIC_GLOBAL_FUN(AFDate_KeystrokeEx);
- JS_STATIC_GLOBAL_FUN(AFDate_Format);
- JS_STATIC_GLOBAL_FUN(AFDate_Keystroke);
- JS_STATIC_GLOBAL_FUN(AFTime_FormatEx);
- JS_STATIC_GLOBAL_FUN(AFTime_KeystrokeEx);
- JS_STATIC_GLOBAL_FUN(AFTime_Format);
- JS_STATIC_GLOBAL_FUN(AFTime_Keystroke);
- JS_STATIC_GLOBAL_FUN(AFSpecial_Format);
- JS_STATIC_GLOBAL_FUN(AFSpecial_Keystroke);
- JS_STATIC_GLOBAL_FUN(AFSpecial_KeystrokeEx);
- JS_STATIC_GLOBAL_FUN(AFSimple);
- JS_STATIC_GLOBAL_FUN(AFMakeNumber);
- JS_STATIC_GLOBAL_FUN(AFSimple_Calculate);
- JS_STATIC_GLOBAL_FUN(AFRange_Validate);
- JS_STATIC_GLOBAL_FUN(AFMergeChange);
- JS_STATIC_GLOBAL_FUN(AFParseDateEx);
- JS_STATIC_GLOBAL_FUN(AFExtractNums);
-
- JS_STATIC_DECLARE_GLOBAL_FUN();
-
-public:
- static int ParseStringInteger(const CFX_WideString & string,int nStart,int & nSkip, int nMaxStep);
- static CFX_WideString ParseStringString(const CFX_WideString& string, int nStart, int& nSkip);
- static double MakeRegularDate(const CFX_WideString & value,const CFX_WideString & format, FX_BOOL& bWrongFormat);
- static CFX_WideString MakeFormatDate(double dDate,const CFX_WideString & format);
- static FX_BOOL ConvertStringToNumber(FX_LPCWSTR swSource, double & dRet, FX_BOOL & bDot);
- static double ParseStringToNumber(FX_LPCWSTR swSource);
- static double ParseNormalDate(const CFX_WideString & value, FX_BOOL& bWrongFormat);
- static double MakeInterDate(CFX_WideString strValue);
- static double ParseNumber(FX_LPCWSTR swSource, FX_BOOL& bAllDigits, FX_BOOL& bDot, FX_BOOL& bSign, FX_BOOL& bKXJS);
-
-public:
- static CFX_WideString StrLTrim(FX_LPCWSTR pStr);
- static CFX_WideString StrRTrim(FX_LPCWSTR pStr);
- static CFX_WideString StrTrim(FX_LPCWSTR pStr);
-
- static CFX_ByteString StrLTrim(FX_LPCSTR pStr);
- static CFX_ByteString StrRTrim(FX_LPCSTR pStr);
- static CFX_ByteString StrTrim(FX_LPCSTR pStr);
-
- static FX_BOOL IsNumber(FX_LPCSTR string);
- static FX_BOOL IsNumber(FX_LPCWSTR string);
-
- static FX_BOOL IsDigit(char ch);
- static FX_BOOL IsDigit(wchar_t ch);
- static FX_BOOL IsAlphabetic(wchar_t ch);
- static FX_BOOL IsAlphaNumeric(wchar_t ch);
-
- static FX_BOOL maskSatisfied(wchar_t c_Change,wchar_t c_Mask);
- static FX_BOOL isReservedMaskChar(wchar_t ch);
-
- static double AF_Simple(FX_LPCWSTR sFuction, double dValue1, double dValue2);
- static CJS_Array AF_MakeArrayFromList(v8::Isolate* isolate, CJS_Value val);
-};
-
-#endif //_PUBLICMETHODS_H_
+// 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 _PUBLICMETHODS_H_
+#define _PUBLICMETHODS_H_
+
+class CJS_PublicMethods : public CJS_Object
+{
+public:
+ CJS_PublicMethods(JSFXObject pObject) : CJS_Object(pObject) {};
+ virtual ~CJS_PublicMethods(void){};
+
+public:
+ static FX_BOOL AFNumber_Format(OBJ_METHOD_PARAMS);
+ static FX_BOOL AFNumber_Keystroke(OBJ_METHOD_PARAMS);
+ static FX_BOOL AFPercent_Format(OBJ_METHOD_PARAMS);
+ static FX_BOOL AFPercent_Keystroke(OBJ_METHOD_PARAMS);
+ static FX_BOOL AFDate_FormatEx(OBJ_METHOD_PARAMS);
+ static FX_BOOL AFDate_KeystrokeEx(OBJ_METHOD_PARAMS);
+ static FX_BOOL AFDate_Format(OBJ_METHOD_PARAMS);
+ static FX_BOOL AFDate_Keystroke(OBJ_METHOD_PARAMS);
+ static FX_BOOL AFTime_FormatEx(OBJ_METHOD_PARAMS); //
+ static FX_BOOL AFTime_KeystrokeEx(OBJ_METHOD_PARAMS);
+ static FX_BOOL AFTime_Format(OBJ_METHOD_PARAMS);
+ static FX_BOOL AFTime_Keystroke(OBJ_METHOD_PARAMS);
+ static FX_BOOL AFSpecial_Format(OBJ_METHOD_PARAMS);
+ static FX_BOOL AFSpecial_Keystroke(OBJ_METHOD_PARAMS);
+ static FX_BOOL AFSpecial_KeystrokeEx(OBJ_METHOD_PARAMS);//
+ static FX_BOOL AFSimple(OBJ_METHOD_PARAMS);
+ static FX_BOOL AFMakeNumber(OBJ_METHOD_PARAMS);
+ static FX_BOOL AFSimple_Calculate(OBJ_METHOD_PARAMS);
+ static FX_BOOL AFRange_Validate(OBJ_METHOD_PARAMS);
+ static FX_BOOL AFMergeChange(OBJ_METHOD_PARAMS);
+ static FX_BOOL AFParseDateEx(OBJ_METHOD_PARAMS);
+ static FX_BOOL AFExtractNums(OBJ_METHOD_PARAMS);
+
+public:
+ JS_STATIC_GLOBAL_FUN(AFNumber_Format);
+ JS_STATIC_GLOBAL_FUN(AFNumber_Keystroke);
+ JS_STATIC_GLOBAL_FUN(AFPercent_Format);
+ JS_STATIC_GLOBAL_FUN(AFPercent_Keystroke);
+ JS_STATIC_GLOBAL_FUN(AFDate_FormatEx);
+ JS_STATIC_GLOBAL_FUN(AFDate_KeystrokeEx);
+ JS_STATIC_GLOBAL_FUN(AFDate_Format);
+ JS_STATIC_GLOBAL_FUN(AFDate_Keystroke);
+ JS_STATIC_GLOBAL_FUN(AFTime_FormatEx);
+ JS_STATIC_GLOBAL_FUN(AFTime_KeystrokeEx);
+ JS_STATIC_GLOBAL_FUN(AFTime_Format);
+ JS_STATIC_GLOBAL_FUN(AFTime_Keystroke);
+ JS_STATIC_GLOBAL_FUN(AFSpecial_Format);
+ JS_STATIC_GLOBAL_FUN(AFSpecial_Keystroke);
+ JS_STATIC_GLOBAL_FUN(AFSpecial_KeystrokeEx);
+ JS_STATIC_GLOBAL_FUN(AFSimple);
+ JS_STATIC_GLOBAL_FUN(AFMakeNumber);
+ JS_STATIC_GLOBAL_FUN(AFSimple_Calculate);
+ JS_STATIC_GLOBAL_FUN(AFRange_Validate);
+ JS_STATIC_GLOBAL_FUN(AFMergeChange);
+ JS_STATIC_GLOBAL_FUN(AFParseDateEx);
+ JS_STATIC_GLOBAL_FUN(AFExtractNums);
+
+ JS_STATIC_DECLARE_GLOBAL_FUN();
+
+public:
+ static int ParseStringInteger(const CFX_WideString & string,int nStart,int & nSkip, int nMaxStep);
+ static CFX_WideString ParseStringString(const CFX_WideString& string, int nStart, int& nSkip);
+ static double MakeRegularDate(const CFX_WideString & value,const CFX_WideString & format, FX_BOOL& bWrongFormat);
+ static CFX_WideString MakeFormatDate(double dDate,const CFX_WideString & format);
+ static FX_BOOL ConvertStringToNumber(FX_LPCWSTR swSource, double & dRet, FX_BOOL & bDot);
+ static double ParseStringToNumber(FX_LPCWSTR swSource);
+ static double ParseNormalDate(const CFX_WideString & value, FX_BOOL& bWrongFormat);
+ static double MakeInterDate(CFX_WideString strValue);
+ static double ParseNumber(FX_LPCWSTR swSource, FX_BOOL& bAllDigits, FX_BOOL& bDot, FX_BOOL& bSign, FX_BOOL& bKXJS);
+
+public:
+ static CFX_WideString StrLTrim(FX_LPCWSTR pStr);
+ static CFX_WideString StrRTrim(FX_LPCWSTR pStr);
+ static CFX_WideString StrTrim(FX_LPCWSTR pStr);
+
+ static CFX_ByteString StrLTrim(FX_LPCSTR pStr);
+ static CFX_ByteString StrRTrim(FX_LPCSTR pStr);
+ static CFX_ByteString StrTrim(FX_LPCSTR pStr);
+
+ static FX_BOOL IsNumber(FX_LPCSTR string);
+ static FX_BOOL IsNumber(FX_LPCWSTR string);
+
+ static FX_BOOL IsDigit(char ch);
+ static FX_BOOL IsDigit(wchar_t ch);
+ static FX_BOOL IsAlphabetic(wchar_t ch);
+ static FX_BOOL IsAlphaNumeric(wchar_t ch);
+
+ static FX_BOOL maskSatisfied(wchar_t c_Change,wchar_t c_Mask);
+ static FX_BOOL isReservedMaskChar(wchar_t ch);
+
+ static double AF_Simple(FX_LPCWSTR sFuction, double dValue1, double dValue2);
+ static CJS_Array AF_MakeArrayFromList(v8::Isolate* isolate, CJS_Value val);
+};
+
+#endif //_PUBLICMETHODS_H_
diff --git a/fpdfsdk/include/javascript/app.h b/fpdfsdk/include/javascript/app.h
index 35ee401058..6273a7d4c0 100644
--- a/fpdfsdk/include/javascript/app.h
+++ b/fpdfsdk/include/javascript/app.h
@@ -1,225 +1,225 @@
-// 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 _APP_H_
-#define _APP_H_
-
-class CJS_Runtime;
-
-/* ---------------------------- TimerObj ---------------------------- */
-
-class CJS_Timer;
-
-class TimerObj : public CJS_EmbedObj
-{
-public:
- TimerObj(CJS_Object* pJSObject);
- virtual ~TimerObj();
-
-public:
- void SetTimer(CJS_Timer* pTimer);
- CJS_Timer* GetTimer() const;
-
-private:
- CJS_Timer* m_pTimer;
-};
-
-class CJS_TimerObj : public CJS_Object
-{
-public:
- CJS_TimerObj(JSFXObject pObject) : CJS_Object(pObject) {}
- virtual ~CJS_TimerObj(){}
-
- DECLARE_JS_CLASS(CJS_TimerObj);
-};
-
-
-// struct APP_MENUITEM_ARRAY;
-//
-// struct APP_MENUITEM
-// {
-// APP_MENUITEM() : oSubMenu(NULL), cName(L""), cReturn(L""), bMarked(false), bEnabled(true)
-// {
-// }
-// CFX_WideString cName;
-// CFX_WideString cReturn;
-// APP_MENUITEM_ARRAY* oSubMenu;
-// bool bMarked;
-// bool bEnabled;
-// };
-
-// struct APP_MENUITEM_ARRAY
-// {
-// APP_MENUITEM_ARRAY() : m_hMenu(NULL), pContents(NULL), nSize(0)
-// {
-//
-// }
-// APP_MENUITEM * pContents;
-// HMENU m_hMenu;
-// int nSize;
-// };
-
-// struct APP_MENU;
-// struct APP_MENU_ARRAY
-// {
-// APP_MENU_ARRAY():
-// pContent(NULL)
-// {
-// }
-//
-// APP_MENU* pContent;
-// };
-
-// struct APP_MENU
-// {
-// APP_MENU():bSubMenu(false),
-// SubMenuItems(NULL),
-// cwMenuItemName(L""),
-// hMenu(NULL),
-// iSize(0)
-// {
-//
-// }
-//
-// APP_MENU(CFX_WideString &cwName):
-// cwMenuItemName(cwName),
-// bSubMenu(false),
-// SubMenuItems(NULL),
-// hMenu(NULL),
-// iSize(0)
-// {
-//
-// }
-//
-// CFX_WideString cwMenuItemName;
-// bool bSubMenu;
-// APP_MENU_ARRAY* SubMenuItems;
-// int iSize;
-// HMENU hMenu;
-// };
-
-class app : public CJS_EmbedObj
-{
-public:
- app(CJS_Object * pJSObject);
- virtual ~app();
-
-public:
- FX_BOOL activeDocs(OBJ_PROP_PARAMS);
- FX_BOOL calculate(OBJ_PROP_PARAMS);
- FX_BOOL formsVersion(OBJ_PROP_PARAMS);
- FX_BOOL fs(OBJ_PROP_PARAMS);
- FX_BOOL fullscreen(OBJ_PROP_PARAMS);
- FX_BOOL language(OBJ_PROP_PARAMS);
- FX_BOOL media(OBJ_PROP_PARAMS);
- FX_BOOL platform(OBJ_PROP_PARAMS);
- FX_BOOL runtimeHighlight(OBJ_PROP_PARAMS);
- FX_BOOL viewerType(OBJ_PROP_PARAMS);
- FX_BOOL viewerVariation(OBJ_PROP_PARAMS);
- FX_BOOL viewerVersion(OBJ_PROP_PARAMS);
-
-
- FX_BOOL alert(OBJ_METHOD_PARAMS);
- FX_BOOL beep(OBJ_METHOD_PARAMS);
- FX_BOOL browseForDoc(OBJ_METHOD_PARAMS);
- FX_BOOL clearInterval(OBJ_METHOD_PARAMS);
- FX_BOOL clearTimeOut(OBJ_METHOD_PARAMS);
- FX_BOOL execDialog(OBJ_METHOD_PARAMS);
- FX_BOOL execMenuItem(OBJ_METHOD_PARAMS);
- FX_BOOL findComponent(OBJ_METHOD_PARAMS);
- FX_BOOL goBack(OBJ_METHOD_PARAMS);
- FX_BOOL goForward(OBJ_METHOD_PARAMS);
- FX_BOOL launchURL(OBJ_METHOD_PARAMS);
- FX_BOOL mailMsg(OBJ_METHOD_PARAMS);
- FX_BOOL newFDF(OBJ_METHOD_PARAMS);
- FX_BOOL newDoc(OBJ_METHOD_PARAMS);
- FX_BOOL openDoc(OBJ_METHOD_PARAMS);
- FX_BOOL openFDF(OBJ_METHOD_PARAMS);
- FX_BOOL popUpMenuEx(OBJ_METHOD_PARAMS);
- FX_BOOL popUpMenu(OBJ_METHOD_PARAMS);
- FX_BOOL response(OBJ_METHOD_PARAMS);
- FX_BOOL setInterval(OBJ_METHOD_PARAMS);
- FX_BOOL setTimeOut(OBJ_METHOD_PARAMS);
-
-private:
-// FX_DWORD AppGetTickCount();
- void TimerProc(CJS_Timer* pTimer);
- void RunJsScript(CJS_Runtime * pRuntime,const CFX_WideString & wsScript);
-// void ParsePopupMenuObj(APP_MENUITEM * ppMenuItem,JSObject * pObj);
-// void DeleteMenuItems(APP_MENUITEM_ARRAY * pMenuItems);
-// void AddMenuItem(APP_MENUITEM_ARRAY * pMenuItems, HMENU hMenu, MENUITEMINFO MenuItemInfo);
-// void InitMenuItemInfo(MENUITEMINFO& MenuItemInfo);
-// void DestroyPopUpMenu();
-
-// void ParserMenuItem(APP_MENU* pHead, const CJS_Parameters&params);
-// void AddItemToMenu(APP_MENU* pHead, HMENU hMenu, MENUITEMINFO MenuItemInfo);
-// void DestroyMenuItems(APP_MENU* pHead);
-
-public:
- static CFX_WideString SysPathToPDFPath(const CFX_WideString& sOldPath);
- static CFX_WideString PDFPathToSysPath(const CFX_WideString& sOldPath);
- static CFX_WideString RelativePathToSysPath(const CFX_WideString& sOldPath, const CFX_WideString& sFilePath);
-
-
-private:
-
- bool m_bCalculate;
- CJS_Runtime* m_pRuntime;
- bool m_bRuntimeHighLight;
-
- CFX_ArrayTemplate<CJS_Timer*> m_aTimer;
-// APP_MENU* m_pMenuHead;
-
-public:
-// static CReader_App* s_App;
-};
-
-class CJS_App : public CJS_Object
-{
-public:
- CJS_App(JSFXObject pObject) : CJS_Object(pObject) {};
- virtual ~CJS_App(void){};
-
- DECLARE_JS_CLASS(CJS_App);
-
- JS_STATIC_PROP(activeDocs, app);
- JS_STATIC_PROP(calculate, app);
- JS_STATIC_PROP(formsVersion, app);
- JS_STATIC_PROP(fs, app);
- JS_STATIC_PROP(fullscreen, app);
- JS_STATIC_PROP(language, app);
- JS_STATIC_PROP(media, app);
- JS_STATIC_PROP(platform, app);
- JS_STATIC_PROP(runtimeHighlight, app);
- JS_STATIC_PROP(viewerType, app);
- JS_STATIC_PROP(viewerVariation, app);
- JS_STATIC_PROP(viewerVersion, app);
-
- JS_STATIC_METHOD(alert, app);
- JS_STATIC_METHOD(beep, app);
- JS_STATIC_METHOD(browseForDoc, app);
- JS_STATIC_METHOD(clearInterval, app);
- JS_STATIC_METHOD(clearTimeOut, app);
- JS_STATIC_METHOD(execDialog, app);
- JS_STATIC_METHOD(execMenuItem, app);
- JS_STATIC_METHOD(findComponent, app);
- JS_STATIC_METHOD(goBack, app);
- JS_STATIC_METHOD(goForward, app);
- JS_STATIC_METHOD(launchURL, app);
- JS_STATIC_METHOD(mailMsg, app);
- JS_STATIC_METHOD(newFDF, app);
- JS_STATIC_METHOD(newDoc, app);
- JS_STATIC_METHOD(openDoc, app);
- JS_STATIC_METHOD(openFDF, app);
- JS_STATIC_METHOD(popUpMenuEx, app);
- JS_STATIC_METHOD(popUpMenu, app);
- JS_STATIC_METHOD(response, app);
- JS_STATIC_METHOD(setInterval, app);
- JS_STATIC_METHOD(setTimeOut, app);
-
-};
-
-#endif //_APP_H_
+// 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 _APP_H_
+#define _APP_H_
+
+class CJS_Runtime;
+
+/* ---------------------------- TimerObj ---------------------------- */
+
+class CJS_Timer;
+
+class TimerObj : public CJS_EmbedObj
+{
+public:
+ TimerObj(CJS_Object* pJSObject);
+ virtual ~TimerObj();
+
+public:
+ void SetTimer(CJS_Timer* pTimer);
+ CJS_Timer* GetTimer() const;
+
+private:
+ CJS_Timer* m_pTimer;
+};
+
+class CJS_TimerObj : public CJS_Object
+{
+public:
+ CJS_TimerObj(JSFXObject pObject) : CJS_Object(pObject) {}
+ virtual ~CJS_TimerObj(){}
+
+ DECLARE_JS_CLASS(CJS_TimerObj);
+};
+
+
+// struct APP_MENUITEM_ARRAY;
+//
+// struct APP_MENUITEM
+// {
+// APP_MENUITEM() : oSubMenu(NULL), cName(L""), cReturn(L""), bMarked(false), bEnabled(true)
+// {
+// }
+// CFX_WideString cName;
+// CFX_WideString cReturn;
+// APP_MENUITEM_ARRAY* oSubMenu;
+// bool bMarked;
+// bool bEnabled;
+// };
+
+// struct APP_MENUITEM_ARRAY
+// {
+// APP_MENUITEM_ARRAY() : m_hMenu(NULL), pContents(NULL), nSize(0)
+// {
+//
+// }
+// APP_MENUITEM * pContents;
+// HMENU m_hMenu;
+// int nSize;
+// };
+
+// struct APP_MENU;
+// struct APP_MENU_ARRAY
+// {
+// APP_MENU_ARRAY():
+// pContent(NULL)
+// {
+// }
+//
+// APP_MENU* pContent;
+// };
+
+// struct APP_MENU
+// {
+// APP_MENU():bSubMenu(false),
+// SubMenuItems(NULL),
+// cwMenuItemName(L""),
+// hMenu(NULL),
+// iSize(0)
+// {
+//
+// }
+//
+// APP_MENU(CFX_WideString &cwName):
+// cwMenuItemName(cwName),
+// bSubMenu(false),
+// SubMenuItems(NULL),
+// hMenu(NULL),
+// iSize(0)
+// {
+//
+// }
+//
+// CFX_WideString cwMenuItemName;
+// bool bSubMenu;
+// APP_MENU_ARRAY* SubMenuItems;
+// int iSize;
+// HMENU hMenu;
+// };
+
+class app : public CJS_EmbedObj
+{
+public:
+ app(CJS_Object * pJSObject);
+ virtual ~app();
+
+public:
+ FX_BOOL activeDocs(OBJ_PROP_PARAMS);
+ FX_BOOL calculate(OBJ_PROP_PARAMS);
+ FX_BOOL formsVersion(OBJ_PROP_PARAMS);
+ FX_BOOL fs(OBJ_PROP_PARAMS);
+ FX_BOOL fullscreen(OBJ_PROP_PARAMS);
+ FX_BOOL language(OBJ_PROP_PARAMS);
+ FX_BOOL media(OBJ_PROP_PARAMS);
+ FX_BOOL platform(OBJ_PROP_PARAMS);
+ FX_BOOL runtimeHighlight(OBJ_PROP_PARAMS);
+ FX_BOOL viewerType(OBJ_PROP_PARAMS);
+ FX_BOOL viewerVariation(OBJ_PROP_PARAMS);
+ FX_BOOL viewerVersion(OBJ_PROP_PARAMS);
+
+
+ FX_BOOL alert(OBJ_METHOD_PARAMS);
+ FX_BOOL beep(OBJ_METHOD_PARAMS);
+ FX_BOOL browseForDoc(OBJ_METHOD_PARAMS);
+ FX_BOOL clearInterval(OBJ_METHOD_PARAMS);
+ FX_BOOL clearTimeOut(OBJ_METHOD_PARAMS);
+ FX_BOOL execDialog(OBJ_METHOD_PARAMS);
+ FX_BOOL execMenuItem(OBJ_METHOD_PARAMS);
+ FX_BOOL findComponent(OBJ_METHOD_PARAMS);
+ FX_BOOL goBack(OBJ_METHOD_PARAMS);
+ FX_BOOL goForward(OBJ_METHOD_PARAMS);
+ FX_BOOL launchURL(OBJ_METHOD_PARAMS);
+ FX_BOOL mailMsg(OBJ_METHOD_PARAMS);
+ FX_BOOL newFDF(OBJ_METHOD_PARAMS);
+ FX_BOOL newDoc(OBJ_METHOD_PARAMS);
+ FX_BOOL openDoc(OBJ_METHOD_PARAMS);
+ FX_BOOL openFDF(OBJ_METHOD_PARAMS);
+ FX_BOOL popUpMenuEx(OBJ_METHOD_PARAMS);
+ FX_BOOL popUpMenu(OBJ_METHOD_PARAMS);
+ FX_BOOL response(OBJ_METHOD_PARAMS);
+ FX_BOOL setInterval(OBJ_METHOD_PARAMS);
+ FX_BOOL setTimeOut(OBJ_METHOD_PARAMS);
+
+private:
+// FX_DWORD AppGetTickCount();
+ void TimerProc(CJS_Timer* pTimer);
+ void RunJsScript(CJS_Runtime * pRuntime,const CFX_WideString & wsScript);
+// void ParsePopupMenuObj(APP_MENUITEM * ppMenuItem,JSObject * pObj);
+// void DeleteMenuItems(APP_MENUITEM_ARRAY * pMenuItems);
+// void AddMenuItem(APP_MENUITEM_ARRAY * pMenuItems, HMENU hMenu, MENUITEMINFO MenuItemInfo);
+// void InitMenuItemInfo(MENUITEMINFO& MenuItemInfo);
+// void DestroyPopUpMenu();
+
+// void ParserMenuItem(APP_MENU* pHead, const CJS_Parameters&params);
+// void AddItemToMenu(APP_MENU* pHead, HMENU hMenu, MENUITEMINFO MenuItemInfo);
+// void DestroyMenuItems(APP_MENU* pHead);
+
+public:
+ static CFX_WideString SysPathToPDFPath(const CFX_WideString& sOldPath);
+ static CFX_WideString PDFPathToSysPath(const CFX_WideString& sOldPath);
+ static CFX_WideString RelativePathToSysPath(const CFX_WideString& sOldPath, const CFX_WideString& sFilePath);
+
+
+private:
+
+ bool m_bCalculate;
+ CJS_Runtime* m_pRuntime;
+ bool m_bRuntimeHighLight;
+
+ CFX_ArrayTemplate<CJS_Timer*> m_aTimer;
+// APP_MENU* m_pMenuHead;
+
+public:
+// static CReader_App* s_App;
+};
+
+class CJS_App : public CJS_Object
+{
+public:
+ CJS_App(JSFXObject pObject) : CJS_Object(pObject) {};
+ virtual ~CJS_App(void){};
+
+ DECLARE_JS_CLASS(CJS_App);
+
+ JS_STATIC_PROP(activeDocs, app);
+ JS_STATIC_PROP(calculate, app);
+ JS_STATIC_PROP(formsVersion, app);
+ JS_STATIC_PROP(fs, app);
+ JS_STATIC_PROP(fullscreen, app);
+ JS_STATIC_PROP(language, app);
+ JS_STATIC_PROP(media, app);
+ JS_STATIC_PROP(platform, app);
+ JS_STATIC_PROP(runtimeHighlight, app);
+ JS_STATIC_PROP(viewerType, app);
+ JS_STATIC_PROP(viewerVariation, app);
+ JS_STATIC_PROP(viewerVersion, app);
+
+ JS_STATIC_METHOD(alert, app);
+ JS_STATIC_METHOD(beep, app);
+ JS_STATIC_METHOD(browseForDoc, app);
+ JS_STATIC_METHOD(clearInterval, app);
+ JS_STATIC_METHOD(clearTimeOut, app);
+ JS_STATIC_METHOD(execDialog, app);
+ JS_STATIC_METHOD(execMenuItem, app);
+ JS_STATIC_METHOD(findComponent, app);
+ JS_STATIC_METHOD(goBack, app);
+ JS_STATIC_METHOD(goForward, app);
+ JS_STATIC_METHOD(launchURL, app);
+ JS_STATIC_METHOD(mailMsg, app);
+ JS_STATIC_METHOD(newFDF, app);
+ JS_STATIC_METHOD(newDoc, app);
+ JS_STATIC_METHOD(openDoc, app);
+ JS_STATIC_METHOD(openFDF, app);
+ JS_STATIC_METHOD(popUpMenuEx, app);
+ JS_STATIC_METHOD(popUpMenu, app);
+ JS_STATIC_METHOD(response, app);
+ JS_STATIC_METHOD(setInterval, app);
+ JS_STATIC_METHOD(setTimeOut, app);
+
+};
+
+#endif //_APP_H_
diff --git a/fpdfsdk/include/javascript/color.h b/fpdfsdk/include/javascript/color.h
index 1910e16955..d0aa72f8d3 100644
--- a/fpdfsdk/include/javascript/color.h
+++ b/fpdfsdk/include/javascript/color.h
@@ -1,78 +1,78 @@
-// 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 _COLOR_H_
-#define _COLOR_H_
-
-class color : public CJS_EmbedObj
-{
-public:
- color(CJS_Object* pJSObject);
- virtual ~color(void);
-
- FX_BOOL black(OBJ_PROP_PARAMS);
- FX_BOOL blue(OBJ_PROP_PARAMS);
- FX_BOOL cyan(OBJ_PROP_PARAMS);
- FX_BOOL dkGray(OBJ_PROP_PARAMS);
- FX_BOOL gray(OBJ_PROP_PARAMS);
- FX_BOOL green(OBJ_PROP_PARAMS);
- FX_BOOL ltGray(OBJ_PROP_PARAMS);
- FX_BOOL magenta(OBJ_PROP_PARAMS);
- FX_BOOL red(OBJ_PROP_PARAMS);
- FX_BOOL transparent(OBJ_PROP_PARAMS);
- FX_BOOL white(OBJ_PROP_PARAMS);
- FX_BOOL yellow(OBJ_PROP_PARAMS);
-
- FX_BOOL convert(OBJ_METHOD_PARAMS);
- FX_BOOL equal(OBJ_METHOD_PARAMS);
-
-public:
- static void ConvertPWLColorToArray(const CPWL_Color& color, CJS_Array& array);
- static void ConvertArrayToPWLColor(CJS_Array& array, CPWL_Color& color);
-
-private:
- CPWL_Color m_crTransparent;
- CPWL_Color m_crBlack;
- CPWL_Color m_crWhite;
- CPWL_Color m_crRed;
- CPWL_Color m_crGreen;
- CPWL_Color m_crBlue;
- CPWL_Color m_crCyan;
- CPWL_Color m_crMagenta;
- CPWL_Color m_crYellow;
- CPWL_Color m_crDKGray;
- CPWL_Color m_crGray;
- CPWL_Color m_crLTGray;
-};
-
-class CJS_Color : public CJS_Object
-{
-public:
- CJS_Color(JSFXObject pObject) : CJS_Object(pObject) {};
- virtual ~CJS_Color(void){};
-
- DECLARE_JS_CLASS(CJS_Color);
-
- JS_STATIC_PROP(black, color);
- JS_STATIC_PROP(blue, color);
- JS_STATIC_PROP(cyan, color);
- JS_STATIC_PROP(dkGray, color);
- JS_STATIC_PROP(gray, color);
- JS_STATIC_PROP(green, color);
- JS_STATIC_PROP(ltGray, color);
- JS_STATIC_PROP(magenta, color);
- JS_STATIC_PROP(red, color);
- JS_STATIC_PROP(transparent, color);
- JS_STATIC_PROP(white, color);
- JS_STATIC_PROP(yellow, color);
-
- JS_STATIC_METHOD(convert,color);
- JS_STATIC_METHOD(equal,color);
-
-};
-
-#endif //_COLOR_H_
-
+// 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 _COLOR_H_
+#define _COLOR_H_
+
+class color : public CJS_EmbedObj
+{
+public:
+ color(CJS_Object* pJSObject);
+ virtual ~color(void);
+
+ FX_BOOL black(OBJ_PROP_PARAMS);
+ FX_BOOL blue(OBJ_PROP_PARAMS);
+ FX_BOOL cyan(OBJ_PROP_PARAMS);
+ FX_BOOL dkGray(OBJ_PROP_PARAMS);
+ FX_BOOL gray(OBJ_PROP_PARAMS);
+ FX_BOOL green(OBJ_PROP_PARAMS);
+ FX_BOOL ltGray(OBJ_PROP_PARAMS);
+ FX_BOOL magenta(OBJ_PROP_PARAMS);
+ FX_BOOL red(OBJ_PROP_PARAMS);
+ FX_BOOL transparent(OBJ_PROP_PARAMS);
+ FX_BOOL white(OBJ_PROP_PARAMS);
+ FX_BOOL yellow(OBJ_PROP_PARAMS);
+
+ FX_BOOL convert(OBJ_METHOD_PARAMS);
+ FX_BOOL equal(OBJ_METHOD_PARAMS);
+
+public:
+ static void ConvertPWLColorToArray(const CPWL_Color& color, CJS_Array& array);
+ static void ConvertArrayToPWLColor(CJS_Array& array, CPWL_Color& color);
+
+private:
+ CPWL_Color m_crTransparent;
+ CPWL_Color m_crBlack;
+ CPWL_Color m_crWhite;
+ CPWL_Color m_crRed;
+ CPWL_Color m_crGreen;
+ CPWL_Color m_crBlue;
+ CPWL_Color m_crCyan;
+ CPWL_Color m_crMagenta;
+ CPWL_Color m_crYellow;
+ CPWL_Color m_crDKGray;
+ CPWL_Color m_crGray;
+ CPWL_Color m_crLTGray;
+};
+
+class CJS_Color : public CJS_Object
+{
+public:
+ CJS_Color(JSFXObject pObject) : CJS_Object(pObject) {};
+ virtual ~CJS_Color(void){};
+
+ DECLARE_JS_CLASS(CJS_Color);
+
+ JS_STATIC_PROP(black, color);
+ JS_STATIC_PROP(blue, color);
+ JS_STATIC_PROP(cyan, color);
+ JS_STATIC_PROP(dkGray, color);
+ JS_STATIC_PROP(gray, color);
+ JS_STATIC_PROP(green, color);
+ JS_STATIC_PROP(ltGray, color);
+ JS_STATIC_PROP(magenta, color);
+ JS_STATIC_PROP(red, color);
+ JS_STATIC_PROP(transparent, color);
+ JS_STATIC_PROP(white, color);
+ JS_STATIC_PROP(yellow, color);
+
+ JS_STATIC_METHOD(convert,color);
+ JS_STATIC_METHOD(equal,color);
+
+};
+
+#endif //_COLOR_H_
+
diff --git a/fpdfsdk/include/javascript/console.h b/fpdfsdk/include/javascript/console.h
index 98a329367e..70d993b820 100644
--- a/fpdfsdk/include/javascript/console.h
+++ b/fpdfsdk/include/javascript/console.h
@@ -1,38 +1,38 @@
-// 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 _CONSOLE_H_
-#define _CONSOLE_H_
-
-class console : public CJS_EmbedObj
-{
-public:
- console(CJS_Object* pJSObject);
- virtual ~console(void);
-
-public:
- FX_BOOL clear(OBJ_METHOD_PARAMS);
- FX_BOOL hide(OBJ_METHOD_PARAMS);
- FX_BOOL println(OBJ_METHOD_PARAMS);
- FX_BOOL show(OBJ_METHOD_PARAMS);
-};
-
-class CJS_Console : public CJS_Object
-{
-public:
- CJS_Console(JSFXObject pObject) : CJS_Object(pObject) {};
- virtual ~CJS_Console(void){};
-
- DECLARE_JS_CLASS(CJS_Console);
-
- JS_STATIC_METHOD(clear, console);
- JS_STATIC_METHOD(hide, console);
- JS_STATIC_METHOD(println, console);
- JS_STATIC_METHOD(show, console);
-};
-
-#endif //_CONSOLE_H_
-
+// 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 _CONSOLE_H_
+#define _CONSOLE_H_
+
+class console : public CJS_EmbedObj
+{
+public:
+ console(CJS_Object* pJSObject);
+ virtual ~console(void);
+
+public:
+ FX_BOOL clear(OBJ_METHOD_PARAMS);
+ FX_BOOL hide(OBJ_METHOD_PARAMS);
+ FX_BOOL println(OBJ_METHOD_PARAMS);
+ FX_BOOL show(OBJ_METHOD_PARAMS);
+};
+
+class CJS_Console : public CJS_Object
+{
+public:
+ CJS_Console(JSFXObject pObject) : CJS_Object(pObject) {};
+ virtual ~CJS_Console(void){};
+
+ DECLARE_JS_CLASS(CJS_Console);
+
+ JS_STATIC_METHOD(clear, console);
+ JS_STATIC_METHOD(hide, console);
+ JS_STATIC_METHOD(println, console);
+ JS_STATIC_METHOD(show, console);
+};
+
+#endif //_CONSOLE_H_
+
diff --git a/fpdfsdk/include/javascript/event.h b/fpdfsdk/include/javascript/event.h
index 91f2c65a21..040a9333a3 100644
--- a/fpdfsdk/include/javascript/event.h
+++ b/fpdfsdk/include/javascript/event.h
@@ -1,70 +1,70 @@
-// 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 _EVENT_H_
-#define _EVENT_H_
-
-class event : public CJS_EmbedObj
-{
-public:
- event(CJS_Object * pJSObject);
- virtual ~event(void);
-
-public:
- FX_BOOL change(OBJ_PROP_PARAMS);
- FX_BOOL changeEx(OBJ_PROP_PARAMS);
- FX_BOOL commitKey(OBJ_PROP_PARAMS);
- FX_BOOL fieldFull(OBJ_PROP_PARAMS);
- FX_BOOL keyDown(OBJ_PROP_PARAMS);
- FX_BOOL modifier(OBJ_PROP_PARAMS);
- FX_BOOL name(OBJ_PROP_PARAMS);
- FX_BOOL rc(OBJ_PROP_PARAMS);
- FX_BOOL richChange(OBJ_PROP_PARAMS);
- FX_BOOL richChangeEx(OBJ_PROP_PARAMS);
- FX_BOOL richValue(OBJ_PROP_PARAMS);
- FX_BOOL selEnd(OBJ_PROP_PARAMS);
- FX_BOOL selStart(OBJ_PROP_PARAMS);
- FX_BOOL shift(OBJ_PROP_PARAMS);
- FX_BOOL source(OBJ_PROP_PARAMS);
- FX_BOOL target(OBJ_PROP_PARAMS);
- FX_BOOL targetName(OBJ_PROP_PARAMS);
- FX_BOOL type(OBJ_PROP_PARAMS);
- FX_BOOL value(OBJ_PROP_PARAMS);
- FX_BOOL willCommit(OBJ_PROP_PARAMS);
-
-};
-
-class CJS_Event : public CJS_Object
-{
-public:
- CJS_Event(JSFXObject pObject) : CJS_Object(pObject) {};
- virtual ~CJS_Event(void){};
-
- DECLARE_JS_CLASS(CJS_Event);
-
- JS_STATIC_PROP(change, event);
- JS_STATIC_PROP(changeEx, event);
- JS_STATIC_PROP(commitKey, event);
- JS_STATIC_PROP(fieldFull, event);
- JS_STATIC_PROP(keyDown, event);
- JS_STATIC_PROP(modifier, event);
- JS_STATIC_PROP(name, event);
- JS_STATIC_PROP(rc, event);
- JS_STATIC_PROP(richChange, event);
- JS_STATIC_PROP(richChangeEx, event);
- JS_STATIC_PROP(richValue, event);
- JS_STATIC_PROP(selEnd, event);
- JS_STATIC_PROP(selStart, event);
- JS_STATIC_PROP(shift, event);
- JS_STATIC_PROP(source, event);
- JS_STATIC_PROP(target, event);
- JS_STATIC_PROP(targetName, event);
- JS_STATIC_PROP(type, event);
- JS_STATIC_PROP(value, event);
- JS_STATIC_PROP(willCommit, event);
-};
-
-#endif //_EVENT_H_
+// 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 _EVENT_H_
+#define _EVENT_H_
+
+class event : public CJS_EmbedObj
+{
+public:
+ event(CJS_Object * pJSObject);
+ virtual ~event(void);
+
+public:
+ FX_BOOL change(OBJ_PROP_PARAMS);
+ FX_BOOL changeEx(OBJ_PROP_PARAMS);
+ FX_BOOL commitKey(OBJ_PROP_PARAMS);
+ FX_BOOL fieldFull(OBJ_PROP_PARAMS);
+ FX_BOOL keyDown(OBJ_PROP_PARAMS);
+ FX_BOOL modifier(OBJ_PROP_PARAMS);
+ FX_BOOL name(OBJ_PROP_PARAMS);
+ FX_BOOL rc(OBJ_PROP_PARAMS);
+ FX_BOOL richChange(OBJ_PROP_PARAMS);
+ FX_BOOL richChangeEx(OBJ_PROP_PARAMS);
+ FX_BOOL richValue(OBJ_PROP_PARAMS);
+ FX_BOOL selEnd(OBJ_PROP_PARAMS);
+ FX_BOOL selStart(OBJ_PROP_PARAMS);
+ FX_BOOL shift(OBJ_PROP_PARAMS);
+ FX_BOOL source(OBJ_PROP_PARAMS);
+ FX_BOOL target(OBJ_PROP_PARAMS);
+ FX_BOOL targetName(OBJ_PROP_PARAMS);
+ FX_BOOL type(OBJ_PROP_PARAMS);
+ FX_BOOL value(OBJ_PROP_PARAMS);
+ FX_BOOL willCommit(OBJ_PROP_PARAMS);
+
+};
+
+class CJS_Event : public CJS_Object
+{
+public:
+ CJS_Event(JSFXObject pObject) : CJS_Object(pObject) {};
+ virtual ~CJS_Event(void){};
+
+ DECLARE_JS_CLASS(CJS_Event);
+
+ JS_STATIC_PROP(change, event);
+ JS_STATIC_PROP(changeEx, event);
+ JS_STATIC_PROP(commitKey, event);
+ JS_STATIC_PROP(fieldFull, event);
+ JS_STATIC_PROP(keyDown, event);
+ JS_STATIC_PROP(modifier, event);
+ JS_STATIC_PROP(name, event);
+ JS_STATIC_PROP(rc, event);
+ JS_STATIC_PROP(richChange, event);
+ JS_STATIC_PROP(richChangeEx, event);
+ JS_STATIC_PROP(richValue, event);
+ JS_STATIC_PROP(selEnd, event);
+ JS_STATIC_PROP(selStart, event);
+ JS_STATIC_PROP(shift, event);
+ JS_STATIC_PROP(source, event);
+ JS_STATIC_PROP(target, event);
+ JS_STATIC_PROP(targetName, event);
+ JS_STATIC_PROP(type, event);
+ JS_STATIC_PROP(value, event);
+ JS_STATIC_PROP(willCommit, event);
+};
+
+#endif //_EVENT_H_
diff --git a/fpdfsdk/include/javascript/global.h b/fpdfsdk/include/javascript/global.h
index 7effd574a0..f5867c50f8 100644
--- a/fpdfsdk/include/javascript/global.h
+++ b/fpdfsdk/include/javascript/global.h
@@ -1,85 +1,85 @@
-// 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 _GLOBAL_H_
-#define _GLOBAL_H_
-
-class CJS_GlobalData;
-
-struct js_global_data
-{
- js_global_data()
- {
- nType = 0;
- dData = 0;
- bData = FALSE;
- sData = "";
- bPersistent = FALSE;
- bDeleted = FALSE;
- }
-
- ~js_global_data()
- {
- pData.Reset();
- }
- int nType; //0:int 1:bool 2:string 3:obj
- double dData;
- bool bData;
- CFX_ByteString sData;
- v8::Persistent<v8::Object> pData;
- bool bPersistent;
- bool bDeleted;
-};
-
-class global_alternate : public CJS_EmbedObj
-{
-public:
- global_alternate(CJS_Object* pJSObject);
- virtual ~global_alternate();
-
-public:
- FX_BOOL setPersistent(OBJ_METHOD_PARAMS);
-
-public:
- FX_BOOL QueryProperty(FX_LPCWSTR propname);
- FX_BOOL DoProperty(IFXJS_Context* cc, FX_LPCWSTR propname, CJS_PropValue & vp, JS_ErrorString & sError);
- FX_BOOL DelProperty(IFXJS_Context* cc, FX_LPCWSTR propname, JS_ErrorString & sError);
-
- void Initial(CPDFDoc_Environment* pApp);
-
-private:
- void UpdateGlobalPersistentVariables();
- void CommitGlobalPersisitentVariables();
- void DestroyGlobalPersisitentVariables();
- FX_BOOL SetGlobalVariables(FX_LPCSTR propname, int nType,
- double dData, bool bData, const CFX_ByteString& sData, JSObject pData, bool bDefaultPersistent);
-
- void ObjectToArray(v8::Handle<v8::Object> pObj, CJS_GlobalVariableArray& array);
- void PutObjectProperty(v8::Handle<v8::Object> obj, CJS_KeyValue* pData);
-
-private:
- CFX_MapByteStringToPtr m_mapGlobal;
- CFX_WideString m_sFilePath;
- CJS_GlobalData* m_pGlobalData;
- CPDFDoc_Environment* m_pApp;
-};
-
-
-class CJS_Global : public CJS_Object
-{
-public:
- CJS_Global(JSFXObject pObject) : CJS_Object(pObject) {};
- virtual ~CJS_Global(void){};
-
- virtual FX_BOOL InitInstance(IFXJS_Context* cc);
-
- DECLARE_SPECIAL_JS_CLASS(CJS_Global);
-
- JS_SPECIAL_STATIC_METHOD(setPersistent, global_alternate, global);
-
-};
-
-#endif //_GLOBAL_H_
+// 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 _GLOBAL_H_
+#define _GLOBAL_H_
+
+class CJS_GlobalData;
+
+struct js_global_data
+{
+ js_global_data()
+ {
+ nType = 0;
+ dData = 0;
+ bData = FALSE;
+ sData = "";
+ bPersistent = FALSE;
+ bDeleted = FALSE;
+ }
+
+ ~js_global_data()
+ {
+ pData.Reset();
+ }
+ int nType; //0:int 1:bool 2:string 3:obj
+ double dData;
+ bool bData;
+ CFX_ByteString sData;
+ v8::Persistent<v8::Object> pData;
+ bool bPersistent;
+ bool bDeleted;
+};
+
+class global_alternate : public CJS_EmbedObj
+{
+public:
+ global_alternate(CJS_Object* pJSObject);
+ virtual ~global_alternate();
+
+public:
+ FX_BOOL setPersistent(OBJ_METHOD_PARAMS);
+
+public:
+ FX_BOOL QueryProperty(FX_LPCWSTR propname);
+ FX_BOOL DoProperty(IFXJS_Context* cc, FX_LPCWSTR propname, CJS_PropValue & vp, JS_ErrorString & sError);
+ FX_BOOL DelProperty(IFXJS_Context* cc, FX_LPCWSTR propname, JS_ErrorString & sError);
+
+ void Initial(CPDFDoc_Environment* pApp);
+
+private:
+ void UpdateGlobalPersistentVariables();
+ void CommitGlobalPersisitentVariables();
+ void DestroyGlobalPersisitentVariables();
+ FX_BOOL SetGlobalVariables(FX_LPCSTR propname, int nType,
+ double dData, bool bData, const CFX_ByteString& sData, JSObject pData, bool bDefaultPersistent);
+
+ void ObjectToArray(v8::Handle<v8::Object> pObj, CJS_GlobalVariableArray& array);
+ void PutObjectProperty(v8::Handle<v8::Object> obj, CJS_KeyValue* pData);
+
+private:
+ CFX_MapByteStringToPtr m_mapGlobal;
+ CFX_WideString m_sFilePath;
+ CJS_GlobalData* m_pGlobalData;
+ CPDFDoc_Environment* m_pApp;
+};
+
+
+class CJS_Global : public CJS_Object
+{
+public:
+ CJS_Global(JSFXObject pObject) : CJS_Object(pObject) {};
+ virtual ~CJS_Global(void){};
+
+ virtual FX_BOOL InitInstance(IFXJS_Context* cc);
+
+ DECLARE_SPECIAL_JS_CLASS(CJS_Global);
+
+ JS_SPECIAL_STATIC_METHOD(setPersistent, global_alternate, global);
+
+};
+
+#endif //_GLOBAL_H_
diff --git a/fpdfsdk/include/javascript/report.h b/fpdfsdk/include/javascript/report.h
index 8a4084dac1..fb5adf3994 100644
--- a/fpdfsdk/include/javascript/report.h
+++ b/fpdfsdk/include/javascript/report.h
@@ -1,35 +1,35 @@
-// 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 _REPORT_H_
-#define _REPORT_H_
-
-class Report : public CJS_EmbedObj
-{
-public:
- Report(CJS_Object * pJSObject);
- virtual ~Report();
-
-public:
- FX_BOOL save(OBJ_METHOD_PARAMS);
- FX_BOOL writeText(OBJ_METHOD_PARAMS);
-};
-
-class CJS_Report : public CJS_Object
-{
-public:
- CJS_Report(JSFXObject pObject) : CJS_Object(pObject){};
- virtual ~CJS_Report(){};
-
-public:
- DECLARE_JS_CLASS(CJS_Report);
-
- JS_STATIC_METHOD(save, Report)
- JS_STATIC_METHOD(writeText, Report);
-};
-
-#endif //_REPORT_H_
-
+// 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 _REPORT_H_
+#define _REPORT_H_
+
+class Report : public CJS_EmbedObj
+{
+public:
+ Report(CJS_Object * pJSObject);
+ virtual ~Report();
+
+public:
+ FX_BOOL save(OBJ_METHOD_PARAMS);
+ FX_BOOL writeText(OBJ_METHOD_PARAMS);
+};
+
+class CJS_Report : public CJS_Object
+{
+public:
+ CJS_Report(JSFXObject pObject) : CJS_Object(pObject){};
+ virtual ~CJS_Report(){};
+
+public:
+ DECLARE_JS_CLASS(CJS_Report);
+
+ JS_STATIC_METHOD(save, Report)
+ JS_STATIC_METHOD(writeText, Report);
+};
+
+#endif //_REPORT_H_
+
diff --git a/fpdfsdk/include/javascript/resource.h b/fpdfsdk/include/javascript/resource.h
index 0b7668e908..710cc50754 100644
--- a/fpdfsdk/include/javascript/resource.h
+++ b/fpdfsdk/include/javascript/resource.h
@@ -1,110 +1,110 @@
-// 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
-
-#define IDD_JS_MSGBOX 25600
-#define IDD_RESPONSE 25601
-#define IDC_JS_MSG_TEXT 25602
-#define ID_JS_MSG_OK 25603
-#define ID_JS_MSG_CANCEL 25604
-#define IDC_JS_MSG_ICON 25605
-#define ID_JS_MSG_YES 25606
-#define ID_JS_MSG_NO 25607
-#define IDC_JS_QUESTION 25608
-#define ID_JS_OK 25609
-#define ID_JS_CANCEL 25610
-#define IDC_JS_ANSWER 25611
-#define IDC_JS_EDIT 25612
-#define IDS_STRING_JSALERT 25613
-#define IDS_STRING_JSPARAMERROR 25614
-#define IDS_STRING_JSAFNUMBER_KEYSTROKE 25615
-#define IDS_STRING_JSINPUTERROR 25616
-#define IDS_STRING_JSPARAM_TOOLONG 25617
-#define IDS_STRING_JSPARSEDATE 25618
-#define IDS_STRING_JSRANGE1 25619
-#define IDS_STRING_JSRANGE2 25620
-#define IDS_STRING_JSRANGE3 25621
-#define IDS_STRING_JSRANGE4 25622
-#define IDS_STRING_FILEOPENFAIL 25623
-#define IDS_STRING_JSATTENTION 25624
-#define IDS_STRING_JSSUBMITS 25625
-#define IDS_STRING_JSSUBMITF 25626
-#define IDS_STRING_NOTSUPPORT 25627
-#define IDS_STRING_JSBUSY 25628
-#define IDS_STRING_JSEVENT 25629
-#define IDS_STRING_RUN 25630
-#define IDS_STRING_UNHANDLED 25631
-#define IDS_STRING_JSPRINT1 25632
-#define IDS_STRING_JSPRINT2 25633
-#define IDS_STRING_LAUNCHURL 25634
-#define IDS_JSPARAM_INCORRECT 25635
-#define IDD_JS_CONSOLE 25636
-#define IDS_STRING_SAFEMODEL 25636
-#define IDC_EDTSCRIPT 25637
-#define IDC_BTNCLEAR 25638
-#define IDC_EDTOUTPUT 25639
-#define IDC_CHECK_TIPS 25640
-#define IDC_BTNRUN 25641
-
-
-
-static CFX_WideString JSGetStringFromID(CJS_Context* pContext, FX_UINT ID)
-{
- switch(ID)
- {
- case IDS_STRING_JSALERT:
- return L"Alert";
- case IDS_STRING_JSPARAMERROR:
- return L"The amount of parameters is not correct !";
- case IDS_STRING_JSAFNUMBER_KEYSTROKE:
- return L"The input value is invalid.";
- case IDS_STRING_JSINPUTERROR:
- return L"Input error !";
- case IDS_STRING_JSPARAM_TOOLONG:
- return L"The value you are going to input is too long.";
- case IDS_STRING_JSPARSEDATE:
- return L"The input string can't be parsed to a valid date time (%s).";
- case IDS_STRING_JSRANGE1:
- return L"Invalid value: must be greater or equal to %s and less than or equal to %s.";
- case IDS_STRING_JSRANGE2:
- return L"Invalid value: must be greater or equal to %s.";
- case IDS_STRING_JSRANGE3:
- return L"Invalid value: must be less than or equal to %s.";
- case IDS_STRING_JSRANGE4:
- return L"Range Error";
- case IDS_STRING_FILEOPENFAIL:
- return L"Opening file failed.";
- case IDS_STRING_JSATTENTION:
- return L"Attention";
- case IDS_STRING_JSSUBMITS:
- return L"Submit form successfully!";
- case IDS_STRING_JSSUBMITF:
- return L"Submit form failed!";
- case IDS_STRING_NOTSUPPORT:
- return L"Not supported.";
- case IDS_STRING_JSBUSY:
- return L"System is busy!";
- case IDS_STRING_JSEVENT:
- return L"The event of the formfield exists!";
- case IDS_STRING_RUN:
- return L"It runs successfully.";
- case IDS_STRING_UNHANDLED:
- return L"An unhandled error!";
- case IDS_STRING_JSPRINT1:
- return L"The second parameter can't convert to Date!";
- case IDS_STRING_JSPRINT2:
- return L"The second parameter isn't a valid Date!";
- case IDS_STRING_LAUNCHURL:
- return L"The Document is trying to connect to \r\n%s\r\nIf you trust the site, choose OK. If you don't trust the site, choose Cancel.";
- case IDS_JSPARAM_INCORRECT:
- return L"The parameter you inputted is incorrect!";
- case IDS_STRING_SAFEMODEL:
- return L"Secure reading mode";
- default:
- return L"";
-
- }
-}
-
+// 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
+
+#define IDD_JS_MSGBOX 25600
+#define IDD_RESPONSE 25601
+#define IDC_JS_MSG_TEXT 25602
+#define ID_JS_MSG_OK 25603
+#define ID_JS_MSG_CANCEL 25604
+#define IDC_JS_MSG_ICON 25605
+#define ID_JS_MSG_YES 25606
+#define ID_JS_MSG_NO 25607
+#define IDC_JS_QUESTION 25608
+#define ID_JS_OK 25609
+#define ID_JS_CANCEL 25610
+#define IDC_JS_ANSWER 25611
+#define IDC_JS_EDIT 25612
+#define IDS_STRING_JSALERT 25613
+#define IDS_STRING_JSPARAMERROR 25614
+#define IDS_STRING_JSAFNUMBER_KEYSTROKE 25615
+#define IDS_STRING_JSINPUTERROR 25616
+#define IDS_STRING_JSPARAM_TOOLONG 25617
+#define IDS_STRING_JSPARSEDATE 25618
+#define IDS_STRING_JSRANGE1 25619
+#define IDS_STRING_JSRANGE2 25620
+#define IDS_STRING_JSRANGE3 25621
+#define IDS_STRING_JSRANGE4 25622
+#define IDS_STRING_FILEOPENFAIL 25623
+#define IDS_STRING_JSATTENTION 25624
+#define IDS_STRING_JSSUBMITS 25625
+#define IDS_STRING_JSSUBMITF 25626
+#define IDS_STRING_NOTSUPPORT 25627
+#define IDS_STRING_JSBUSY 25628
+#define IDS_STRING_JSEVENT 25629
+#define IDS_STRING_RUN 25630
+#define IDS_STRING_UNHANDLED 25631
+#define IDS_STRING_JSPRINT1 25632
+#define IDS_STRING_JSPRINT2 25633
+#define IDS_STRING_LAUNCHURL 25634
+#define IDS_JSPARAM_INCORRECT 25635
+#define IDD_JS_CONSOLE 25636
+#define IDS_STRING_SAFEMODEL 25636
+#define IDC_EDTSCRIPT 25637
+#define IDC_BTNCLEAR 25638
+#define IDC_EDTOUTPUT 25639
+#define IDC_CHECK_TIPS 25640
+#define IDC_BTNRUN 25641
+
+
+
+static CFX_WideString JSGetStringFromID(CJS_Context* pContext, FX_UINT ID)
+{
+ switch(ID)
+ {
+ case IDS_STRING_JSALERT:
+ return L"Alert";
+ case IDS_STRING_JSPARAMERROR:
+ return L"The amount of parameters is not correct !";
+ case IDS_STRING_JSAFNUMBER_KEYSTROKE:
+ return L"The input value is invalid.";
+ case IDS_STRING_JSINPUTERROR:
+ return L"Input error !";
+ case IDS_STRING_JSPARAM_TOOLONG:
+ return L"The value you are going to input is too long.";
+ case IDS_STRING_JSPARSEDATE:
+ return L"The input string can't be parsed to a valid date time (%s).";
+ case IDS_STRING_JSRANGE1:
+ return L"Invalid value: must be greater or equal to %s and less than or equal to %s.";
+ case IDS_STRING_JSRANGE2:
+ return L"Invalid value: must be greater or equal to %s.";
+ case IDS_STRING_JSRANGE3:
+ return L"Invalid value: must be less than or equal to %s.";
+ case IDS_STRING_JSRANGE4:
+ return L"Range Error";
+ case IDS_STRING_FILEOPENFAIL:
+ return L"Opening file failed.";
+ case IDS_STRING_JSATTENTION:
+ return L"Attention";
+ case IDS_STRING_JSSUBMITS:
+ return L"Submit form successfully!";
+ case IDS_STRING_JSSUBMITF:
+ return L"Submit form failed!";
+ case IDS_STRING_NOTSUPPORT:
+ return L"Not supported.";
+ case IDS_STRING_JSBUSY:
+ return L"System is busy!";
+ case IDS_STRING_JSEVENT:
+ return L"The event of the formfield exists!";
+ case IDS_STRING_RUN:
+ return L"It runs successfully.";
+ case IDS_STRING_UNHANDLED:
+ return L"An unhandled error!";
+ case IDS_STRING_JSPRINT1:
+ return L"The second parameter can't convert to Date!";
+ case IDS_STRING_JSPRINT2:
+ return L"The second parameter isn't a valid Date!";
+ case IDS_STRING_LAUNCHURL:
+ return L"The Document is trying to connect to \r\n%s\r\nIf you trust the site, choose OK. If you don't trust the site, choose Cancel.";
+ case IDS_JSPARAM_INCORRECT:
+ return L"The parameter you inputted is incorrect!";
+ case IDS_STRING_SAFEMODEL:
+ return L"Secure reading mode";
+ default:
+ return L"";
+
+ }
+}
+
diff --git a/fpdfsdk/include/javascript/util.h b/fpdfsdk/include/javascript/util.h
index 9f4efc3525..14857c97cb 100644
--- a/fpdfsdk/include/javascript/util.h
+++ b/fpdfsdk/include/javascript/util.h
@@ -1,45 +1,45 @@
-// 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 _UTIL_H_
-#define _UTIL_H_
-
-class util : public CJS_EmbedObj
-{
-public:
- util(CJS_Object * pJSObject);
- virtual ~util(void);
-
-public:
- FX_BOOL printd(OBJ_METHOD_PARAMS);
- FX_BOOL printf(OBJ_METHOD_PARAMS);
- FX_BOOL printx(OBJ_METHOD_PARAMS);
- FX_BOOL scand(OBJ_METHOD_PARAMS);
- FX_BOOL byteToChar(OBJ_METHOD_PARAMS);
-
-public:
- static void printd(const std::wstring &cFormat,CJS_Date Date,bool bXFAPicture, std::wstring &cPurpose);
- static void printx(const std::string &cFormat,const std::string &cSource, std::string &cPurpose);
- static int ParstDataType(std::wstring* sFormat);
-};
-
-class CJS_Util : public CJS_Object
-{
-public:
- CJS_Util(JSFXObject pObject) : CJS_Object(pObject) {};
- virtual ~CJS_Util(void){};
-
- DECLARE_JS_CLASS(CJS_Util);
-
- JS_STATIC_METHOD(printd, util);
- JS_STATIC_METHOD(printf, util);
- JS_STATIC_METHOD(printx, util);
- JS_STATIC_METHOD(scand, util);
- JS_STATIC_METHOD(byteToChar, util);
-};
-
-FX_INT64 FX_atoi64(const char *nptr);
-#endif //_UTIL_H_
+// 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 _UTIL_H_
+#define _UTIL_H_
+
+class util : public CJS_EmbedObj
+{
+public:
+ util(CJS_Object * pJSObject);
+ virtual ~util(void);
+
+public:
+ FX_BOOL printd(OBJ_METHOD_PARAMS);
+ FX_BOOL printf(OBJ_METHOD_PARAMS);
+ FX_BOOL printx(OBJ_METHOD_PARAMS);
+ FX_BOOL scand(OBJ_METHOD_PARAMS);
+ FX_BOOL byteToChar(OBJ_METHOD_PARAMS);
+
+public:
+ static void printd(const std::wstring &cFormat,CJS_Date Date,bool bXFAPicture, std::wstring &cPurpose);
+ static void printx(const std::string &cFormat,const std::string &cSource, std::string &cPurpose);
+ static int ParstDataType(std::wstring* sFormat);
+};
+
+class CJS_Util : public CJS_Object
+{
+public:
+ CJS_Util(JSFXObject pObject) : CJS_Object(pObject) {};
+ virtual ~CJS_Util(void){};
+
+ DECLARE_JS_CLASS(CJS_Util);
+
+ JS_STATIC_METHOD(printd, util);
+ JS_STATIC_METHOD(printf, util);
+ JS_STATIC_METHOD(printx, util);
+ JS_STATIC_METHOD(scand, util);
+ JS_STATIC_METHOD(byteToChar, util);
+};
+
+FX_INT64 FX_atoi64(const char *nptr);
+#endif //_UTIL_H_
diff --git a/fpdfsdk/include/pdfwindow/IPDFWindow.h b/fpdfsdk/include/pdfwindow/IPDFWindow.h
index 53b96a64fd..22f023d8c0 100644
--- a/fpdfsdk/include/pdfwindow/IPDFWindow.h
+++ b/fpdfsdk/include/pdfwindow/IPDFWindow.h
@@ -1,28 +1,28 @@
-// 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 _IPDFWINDOW_H_
-#define _IPDFWINDOW_H_
-
-#include "PWL_Wnd.h"
-#include "PWL_EditCtrl.h"
-#include "PWL_Edit.h"
-#include "PWL_ListBox.h"
-#include "PWL_ComboBox.h"
-#include "PWL_Button.h"
-#include "PWL_SpecialButton.h"
-#include "PWL_Icon.h"
-#include "PWL_Label.h"
-#include "PWL_ListCtrl.h"
-#include "PWL_Caret.h"
-#include "PWL_ScrollBar.h"
-#include "PWL_Note.h"
-#include "PWL_IconList.h"
-#include "PWL_FontMap.h"
-#include "PWL_Signature.h"
-#include "PWL_Utils.h"
-
-#endif //_IPDFWINDOW_H_
+// 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 _IPDFWINDOW_H_
+#define _IPDFWINDOW_H_
+
+#include "PWL_Wnd.h"
+#include "PWL_EditCtrl.h"
+#include "PWL_Edit.h"
+#include "PWL_ListBox.h"
+#include "PWL_ComboBox.h"
+#include "PWL_Button.h"
+#include "PWL_SpecialButton.h"
+#include "PWL_Icon.h"
+#include "PWL_Label.h"
+#include "PWL_ListCtrl.h"
+#include "PWL_Caret.h"
+#include "PWL_ScrollBar.h"
+#include "PWL_Note.h"
+#include "PWL_IconList.h"
+#include "PWL_FontMap.h"
+#include "PWL_Signature.h"
+#include "PWL_Utils.h"
+
+#endif //_IPDFWINDOW_H_
diff --git a/fpdfsdk/include/pdfwindow/PDFWindow.h b/fpdfsdk/include/pdfwindow/PDFWindow.h
index 22703e1f01..a83be41349 100644
--- a/fpdfsdk/include/pdfwindow/PDFWindow.h
+++ b/fpdfsdk/include/pdfwindow/PDFWindow.h
@@ -1,28 +1,28 @@
-// 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 _PDFWINDOW_H_
-#define _PDFWINDOW_H_
-
-// #define VC_EXTRALEAN
-// #include <afxext.h>
-// #include <afxcmn.h>
-
-#ifndef _INC_PDFAPI
- #define _INC_PDFAPI
-
- #include "../../../core/include/fpdfapi/fpdf_module.h"
- #include "../../../core/include/fpdfdoc/fpdf_doc.h"
- #include "../../../core/include/fpdfdoc/fpdf_vt.h"
- #include "../../../core/include/fxcrt/fx_xml.h"
-
- #include "../fpdf_fwlevent.h"
- #include "../fx_systemhandler.h"
-#endif
-
-#include "../fxedit/fx_edit.h"
-#endif
-
+// 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 _PDFWINDOW_H_
+#define _PDFWINDOW_H_
+
+// #define VC_EXTRALEAN
+// #include <afxext.h>
+// #include <afxcmn.h>
+
+#ifndef _INC_PDFAPI
+ #define _INC_PDFAPI
+
+ #include "../../../core/include/fpdfapi/fpdf_module.h"
+ #include "../../../core/include/fpdfdoc/fpdf_doc.h"
+ #include "../../../core/include/fpdfdoc/fpdf_vt.h"
+ #include "../../../core/include/fxcrt/fx_xml.h"
+
+ #include "../fpdf_fwlevent.h"
+ #include "../fx_systemhandler.h"
+#endif
+
+#include "../fxedit/fx_edit.h"
+#endif
+
diff --git a/fpdfsdk/include/pdfwindow/PWL_Button.h b/fpdfsdk/include/pdfwindow/PWL_Button.h
index 202a0d1152..8416c4de34 100644
--- a/fpdfsdk/include/pdfwindow/PWL_Button.h
+++ b/fpdfsdk/include/pdfwindow/PWL_Button.h
@@ -1,28 +1,28 @@
-// 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 _PWL_BUTTON_H_
-#define _PWL_BUTTON_H_
-
-class PWL_CLASS CPWL_Button : public CPWL_Wnd
-{
-public:
- CPWL_Button();
- virtual ~CPWL_Button();
-
-public:
- virtual CFX_ByteString GetClassName() const;
- virtual void OnCreate(PWL_CREATEPARAM & cp);
-
- virtual FX_BOOL OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag);
- virtual FX_BOOL OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
-
-protected:
- FX_BOOL m_bMouseDown;
-};
-
-#endif // !defined(AFX_PWL_BUTTON_H__5A6080AA_33C5_4FC9_91FC_D9644C41120A__INCLUDED_)
-
+// 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 _PWL_BUTTON_H_
+#define _PWL_BUTTON_H_
+
+class PWL_CLASS CPWL_Button : public CPWL_Wnd
+{
+public:
+ CPWL_Button();
+ virtual ~CPWL_Button();
+
+public:
+ virtual CFX_ByteString GetClassName() const;
+ virtual void OnCreate(PWL_CREATEPARAM & cp);
+
+ virtual FX_BOOL OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
+
+protected:
+ FX_BOOL m_bMouseDown;
+};
+
+#endif // !defined(AFX_PWL_BUTTON_H__5A6080AA_33C5_4FC9_91FC_D9644C41120A__INCLUDED_)
+
diff --git a/fpdfsdk/include/pdfwindow/PWL_Caret.h b/fpdfsdk/include/pdfwindow/PWL_Caret.h
index 4586d471ad..600e5096a8 100644
--- a/fpdfsdk/include/pdfwindow/PWL_Caret.h
+++ b/fpdfsdk/include/pdfwindow/PWL_Caret.h
@@ -1,58 +1,58 @@
-// 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 _PWL_CARET_H_
-#define _PWL_CARET_H_
-
-struct PWL_CARET_INFO
-{
-public:
- PWL_CARET_INFO() : bVisible(FALSE), ptHead(0,0), ptFoot(0,0)
- {
- }
-
- FX_BOOL bVisible;
- CPDF_Point ptHead;
- CPDF_Point ptFoot;
-};
-
-
-class CPWL_Caret : public CPWL_Wnd
-{
-public:
- CPWL_Caret();
- virtual ~CPWL_Caret();
-public:
- virtual CFX_ByteString GetClassName() const;
- virtual void GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream);
- virtual void DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device);
- virtual void InvalidateRect(CPDF_Rect * pRect = NULL);
-
- virtual void SetVisible(FX_BOOL bVisible) {}
-
- virtual void TimerProc();
-
- void SetCaret(FX_BOOL bVisible, const CPDF_Point & ptHead, const CPDF_Point & ptFoot);
- CFX_ByteString GetCaretAppearanceStream(const CPDF_Point & ptOffset);
-
-private:
- void GetCaretApp(CFX_ByteTextBuf & sAppStream,const CPDF_Point & ptOffset);
- CPDF_Rect GetCaretRect() const;
-
- FX_BOOL m_bFlash;
- CPDF_Point m_ptHead;
- CPDF_Point m_ptFoot;
- FX_FLOAT m_fWidth;
- FX_INT32 m_nDelay;
-
-public:
- void SetInvalidRect(CPDF_Rect rc) {m_rcInvalid = rc;}
-private:
- CPDF_Rect m_rcInvalid;
-};
-
-#endif // !defined(AFX_PWL_CARET_H__6A729612_4173_4B65_BCAB_7C6C850ECA47__INCLUDED_)
-
+// 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 _PWL_CARET_H_
+#define _PWL_CARET_H_
+
+struct PWL_CARET_INFO
+{
+public:
+ PWL_CARET_INFO() : bVisible(FALSE), ptHead(0,0), ptFoot(0,0)
+ {
+ }
+
+ FX_BOOL bVisible;
+ CPDF_Point ptHead;
+ CPDF_Point ptFoot;
+};
+
+
+class CPWL_Caret : public CPWL_Wnd
+{
+public:
+ CPWL_Caret();
+ virtual ~CPWL_Caret();
+public:
+ virtual CFX_ByteString GetClassName() const;
+ virtual void GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream);
+ virtual void DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device);
+ virtual void InvalidateRect(CPDF_Rect * pRect = NULL);
+
+ virtual void SetVisible(FX_BOOL bVisible) {}
+
+ virtual void TimerProc();
+
+ void SetCaret(FX_BOOL bVisible, const CPDF_Point & ptHead, const CPDF_Point & ptFoot);
+ CFX_ByteString GetCaretAppearanceStream(const CPDF_Point & ptOffset);
+
+private:
+ void GetCaretApp(CFX_ByteTextBuf & sAppStream,const CPDF_Point & ptOffset);
+ CPDF_Rect GetCaretRect() const;
+
+ FX_BOOL m_bFlash;
+ CPDF_Point m_ptHead;
+ CPDF_Point m_ptFoot;
+ FX_FLOAT m_fWidth;
+ FX_INT32 m_nDelay;
+
+public:
+ void SetInvalidRect(CPDF_Rect rc) {m_rcInvalid = rc;}
+private:
+ CPDF_Rect m_rcInvalid;
+};
+
+#endif // !defined(AFX_PWL_CARET_H__6A729612_4173_4B65_BCAB_7C6C850ECA47__INCLUDED_)
+
diff --git a/fpdfsdk/include/pdfwindow/PWL_ComboBox.h b/fpdfsdk/include/pdfwindow/PWL_ComboBox.h
index f64b636c44..5b91fe4a71 100644
--- a/fpdfsdk/include/pdfwindow/PWL_ComboBox.h
+++ b/fpdfsdk/include/pdfwindow/PWL_ComboBox.h
@@ -1,115 +1,115 @@
-// 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 _PWL_COMBOBOX_H_
-#define _PWL_COMBOBOX_H_
-
-class CPWL_CBEdit : public CPWL_Edit
-{
-public:
- CPWL_CBEdit(){};
- virtual ~CPWL_CBEdit(){};
-};
-
-class PWL_CLASS CPWL_CBListBox : public CPWL_ListBox
-{
-public:
- CPWL_CBListBox(){};
- virtual ~CPWL_CBListBox(){};
-
-public:
- virtual FX_BOOL OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
-
- virtual FX_BOOL OnKeyDown(FX_WORD nChar, FX_BOOL & bExit, FX_DWORD nFlag);
- virtual FX_BOOL OnChar(FX_WORD nChar, FX_BOOL & bExit, FX_DWORD nFlag);
-};
-
-#define PWL_COMBOBOX_BUTTON_WIDTH 13
-
-class CPWL_CBButton : public CPWL_Wnd
-{
-public:
- CPWL_CBButton(){};
- virtual ~CPWL_CBButton(){};
-
-public:
- virtual void GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream);
- virtual void DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device);
-
- virtual FX_BOOL OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag);
- virtual FX_BOOL OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
-
-};
-
-class PWL_CLASS CPWL_ComboBox : public CPWL_Wnd
-{
-public:
- CPWL_ComboBox();
- operator CPWL_Edit* () {return m_pEdit;}
-
-public:
- virtual CFX_ByteString GetClassName() const;
- virtual void OnCreate(PWL_CREATEPARAM & cp);
-
- virtual FX_BOOL OnKeyDown(FX_WORD nChar, FX_DWORD nFlag);
- virtual FX_BOOL OnChar(FX_WORD nChar, FX_DWORD nFlag);
-
- virtual void OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam = 0, FX_INTPTR lParam = 0);
-
- virtual void CreateChildWnd(const PWL_CREATEPARAM & cp);
- virtual void RePosChildWnd();
-
- virtual CPDF_Rect GetFocusRect() const;
-
- virtual void SetFocus();
- virtual void KillFocus();
-
- FX_BOOL IsModified() const;
-
-public:
- void SetFillerNotify(IPWL_Filler_Notify* pNotify);
-
- CFX_WideString GetText() const;
- void SetText(FX_LPCWSTR text);
-
- void AddString(FX_LPCWSTR string);
- FX_INT32 GetSelect() const;
- void SetSelect(FX_INT32 nItemIndex);
-
- void SetEditSel(FX_INT32 nStartChar,FX_INT32 nEndChar);
- void GetEditSel(FX_INT32 & nStartChar, FX_INT32 & nEndChar ) const;
- void Clear();
- void SelectAll();
- FX_BOOL IsPopup() const;
-
- void SetSelectText();
-
-private:
- void CreateEdit(const PWL_CREATEPARAM & cp);
- void CreateButton(const PWL_CREATEPARAM & cp);
- void CreateListBox(const PWL_CREATEPARAM & cp);
-
- void SetPopup(FX_BOOL bPopup);
-
-private:
- CPWL_CBEdit* m_pEdit;
- CPWL_CBButton* m_pButton;
- CPWL_CBListBox* m_pList;
-
- FX_BOOL m_bPopup;
- CPDF_Rect m_rcOldWindow;
- FX_INT32 m_nPopupWhere;
- FX_INT32 m_nSelectItem;
- IPWL_Filler_Notify* m_pFillerNotify;
-
-public:
- void AttachFFLData(void* pData) {m_pFormFiller = pData;}
-private:
- void* m_pFormFiller;
-};
-
-#endif // !defined(AFX_PWL_COMBOBOX_H__9D6645F8_64AA_4806_94E8_95FDEDD39C17__INCLUDED_)
-
+// 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 _PWL_COMBOBOX_H_
+#define _PWL_COMBOBOX_H_
+
+class CPWL_CBEdit : public CPWL_Edit
+{
+public:
+ CPWL_CBEdit(){};
+ virtual ~CPWL_CBEdit(){};
+};
+
+class PWL_CLASS CPWL_CBListBox : public CPWL_ListBox
+{
+public:
+ CPWL_CBListBox(){};
+ virtual ~CPWL_CBListBox(){};
+
+public:
+ virtual FX_BOOL OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
+
+ virtual FX_BOOL OnKeyDown(FX_WORD nChar, FX_BOOL & bExit, FX_DWORD nFlag);
+ virtual FX_BOOL OnChar(FX_WORD nChar, FX_BOOL & bExit, FX_DWORD nFlag);
+};
+
+#define PWL_COMBOBOX_BUTTON_WIDTH 13
+
+class CPWL_CBButton : public CPWL_Wnd
+{
+public:
+ CPWL_CBButton(){};
+ virtual ~CPWL_CBButton(){};
+
+public:
+ virtual void GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream);
+ virtual void DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device);
+
+ virtual FX_BOOL OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
+
+};
+
+class PWL_CLASS CPWL_ComboBox : public CPWL_Wnd
+{
+public:
+ CPWL_ComboBox();
+ operator CPWL_Edit* () {return m_pEdit;}
+
+public:
+ virtual CFX_ByteString GetClassName() const;
+ virtual void OnCreate(PWL_CREATEPARAM & cp);
+
+ virtual FX_BOOL OnKeyDown(FX_WORD nChar, FX_DWORD nFlag);
+ virtual FX_BOOL OnChar(FX_WORD nChar, FX_DWORD nFlag);
+
+ virtual void OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam = 0, FX_INTPTR lParam = 0);
+
+ virtual void CreateChildWnd(const PWL_CREATEPARAM & cp);
+ virtual void RePosChildWnd();
+
+ virtual CPDF_Rect GetFocusRect() const;
+
+ virtual void SetFocus();
+ virtual void KillFocus();
+
+ FX_BOOL IsModified() const;
+
+public:
+ void SetFillerNotify(IPWL_Filler_Notify* pNotify);
+
+ CFX_WideString GetText() const;
+ void SetText(FX_LPCWSTR text);
+
+ void AddString(FX_LPCWSTR string);
+ FX_INT32 GetSelect() const;
+ void SetSelect(FX_INT32 nItemIndex);
+
+ void SetEditSel(FX_INT32 nStartChar,FX_INT32 nEndChar);
+ void GetEditSel(FX_INT32 & nStartChar, FX_INT32 & nEndChar ) const;
+ void Clear();
+ void SelectAll();
+ FX_BOOL IsPopup() const;
+
+ void SetSelectText();
+
+private:
+ void CreateEdit(const PWL_CREATEPARAM & cp);
+ void CreateButton(const PWL_CREATEPARAM & cp);
+ void CreateListBox(const PWL_CREATEPARAM & cp);
+
+ void SetPopup(FX_BOOL bPopup);
+
+private:
+ CPWL_CBEdit* m_pEdit;
+ CPWL_CBButton* m_pButton;
+ CPWL_CBListBox* m_pList;
+
+ FX_BOOL m_bPopup;
+ CPDF_Rect m_rcOldWindow;
+ FX_INT32 m_nPopupWhere;
+ FX_INT32 m_nSelectItem;
+ IPWL_Filler_Notify* m_pFillerNotify;
+
+public:
+ void AttachFFLData(void* pData) {m_pFormFiller = pData;}
+private:
+ void* m_pFormFiller;
+};
+
+#endif // !defined(AFX_PWL_COMBOBOX_H__9D6645F8_64AA_4806_94E8_95FDEDD39C17__INCLUDED_)
+
diff --git a/fpdfsdk/include/pdfwindow/PWL_Edit.h b/fpdfsdk/include/pdfwindow/PWL_Edit.h
index 71f675600d..d86cb77d2c 100644
--- a/fpdfsdk/include/pdfwindow/PWL_Edit.h
+++ b/fpdfsdk/include/pdfwindow/PWL_Edit.h
@@ -1,138 +1,138 @@
-// 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 _PWL_EDIT_H_
-#define _PWL_EDIT_H_
-
-class IPWL_Filler_Notify;
-class CPWL_Edit;
-class IPWL_SpellCheck;
-
-class IPWL_Filler_Notify
-{
-public:
- virtual void QueryWherePopup(void* pPrivateData, FX_FLOAT fPopupMin,FX_FLOAT fPopupMax,
- FX_INT32 & nRet, FX_FLOAT & fPopupRet) = 0; //nRet: (0:bottom 1:top)
- virtual void OnBeforeKeyStroke(FX_BOOL bEditOrList, void* pPrivateData, FX_INT32 nKeyCode,
- CFX_WideString & strChange, const CFX_WideString& strChangeEx,
- int nSelStart, int nSelEnd,
- FX_BOOL bKeyDown, FX_BOOL & bRC, FX_BOOL & bExit, FX_DWORD nFlag) = 0;
- virtual void OnAfterKeyStroke(FX_BOOL bEditOrList, void* pPrivateData, FX_BOOL & bExit, FX_DWORD nFlag) = 0;
-};
-
-class PWL_CLASS CPWL_Edit : public CPWL_EditCtrl, public IFX_Edit_OprNotify
-{
-public:
- CPWL_Edit();
- virtual ~CPWL_Edit();
-
-public:
- virtual CFX_ByteString GetClassName() const;
- virtual void OnDestroy();
- virtual void OnCreated();
- virtual void RePosChildWnd();
- virtual CPDF_Rect GetClientRect() const;
-
- virtual void GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream);
- virtual void DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device);
-
- virtual FX_BOOL OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag);
- virtual FX_BOOL OnLButtonDblClk(const CPDF_Point & point, FX_DWORD nFlag);
- virtual FX_BOOL OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
- virtual FX_BOOL OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag);
-
- virtual FX_BOOL OnKeyDown(FX_WORD nChar, FX_DWORD nFlag);
- virtual FX_BOOL OnChar(FX_WORD nChar, FX_DWORD nFlag);
-
- virtual CPDF_Rect GetFocusRect() const;
-
-public:
- void SetAlignFormatH(PWL_EDIT_ALIGNFORMAT_H nFormat = PEAH_LEFT, FX_BOOL bPaint = TRUE); //0:left 1:right 2:middle
- void SetAlignFormatV(PWL_EDIT_ALIGNFORMAT_V nFormat = PEAV_TOP, FX_BOOL bPaint = TRUE); //0:top 1:bottom 2:center
-
- void SetCharArray(FX_INT32 nCharArray);
- void SetLimitChar(FX_INT32 nLimitChar);
-
- void SetHorzScale(FX_INT32 nHorzScale, FX_BOOL bPaint = TRUE);
- void SetCharSpace(FX_FLOAT fCharSpace, FX_BOOL bPaint = TRUE);
-
- void SetLineLeading(FX_FLOAT fLineLeading, FX_BOOL bPaint = TRUE);
-
- void EnableSpellCheck(FX_BOOL bEnabled);
-
- FX_BOOL CanSelectAll() const;
- FX_BOOL CanClear() const;
- FX_BOOL CanCopy() const;
- FX_BOOL CanCut() const;
- FX_BOOL CanPaste() const;
-
- virtual void CopyText();
- virtual void PasteText();
- virtual void CutText();
-
- virtual void SetText(FX_LPCWSTR csText);
- void ReplaceSel(FX_LPCWSTR csText);
-
- CFX_ByteString GetTextAppearanceStream(const CPDF_Point & ptOffset) const;
- CFX_ByteString GetCaretAppearanceStream(const CPDF_Point & ptOffset) const;
- CFX_ByteString GetSelectAppearanceStream(const CPDF_Point & ptOffset) const;
-
- FX_BOOL IsTextFull() const;
-
- static FX_FLOAT GetCharArrayAutoFontSize(CPDF_Font* pFont, const CPDF_Rect& rcPlate, FX_INT32 nCharArray);
-
- void SetFillerNotify(IPWL_Filler_Notify* pNotify) {m_pFillerNotify = pNotify;}
-
- void GeneratePageObjects(CPDF_PageObjects* pPageObjects,
- const CPDF_Point& ptOffset, CFX_ArrayTemplate<CPDF_TextObject*>& ObjArray);
- void GeneratePageObjects(CPDF_PageObjects* pPageObjects,
- const CPDF_Point& ptOffset);
-
-protected:
- virtual void OnSetFocus();
- virtual void OnKillFocus();
-
-protected:
- virtual void OnInsertWord(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace);
- virtual void OnInsertReturn(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace);
- virtual void OnBackSpace(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace);
- virtual void OnDelete(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace);
- virtual void OnClear(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace);
- virtual void OnSetText(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace);
- virtual void OnInsertText(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace);
- virtual void OnAddUndo(IFX_Edit_UndoItem* pUndoItem);
-
-private:
- CPVT_WordRange GetSelectWordRange() const;
- virtual void ShowVScrollBar(FX_BOOL bShow);
- FX_BOOL IsVScrollBarVisible() const;
- void SetParamByFlag();
-
- FX_FLOAT GetCharArrayAutoFontSize(FX_INT32 nCharArray);
- CPDF_Point GetWordRightBottomPoint(const CPVT_WordPlace& wpWord);
-
- CPVT_WordRange CombineWordRange(const CPVT_WordRange& wr1, const CPVT_WordRange& wr2);
- CPVT_WordRange GetLatinWordsRange(const CPDF_Point & point) const;
- CPVT_WordRange GetLatinWordsRange(const CPVT_WordPlace & place) const;
- CPVT_WordRange GetArabicWordsRange(const CPVT_WordPlace & place) const;
- CPVT_WordRange GetSameWordsRange(const CPVT_WordPlace & place, FX_BOOL bLatin, FX_BOOL bArabic) const;
-
- void AjustArabicWords(const CPVT_WordRange& wr);
-public:
- FX_BOOL IsProceedtoOnChar(FX_WORD nKeyCode, FX_DWORD nFlag);
-private:
- IPWL_Filler_Notify* m_pFillerNotify;
- IPWL_SpellCheck* m_pSpellCheck;
- FX_BOOL m_bFocus;
- CPDF_Rect m_rcOldWindow;
-public:
- void AttachFFLData(void* pData) {m_pFormFiller = pData;}
-private:
- void* m_pFormFiller;
-};
-
-#endif
-
+// 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 _PWL_EDIT_H_
+#define _PWL_EDIT_H_
+
+class IPWL_Filler_Notify;
+class CPWL_Edit;
+class IPWL_SpellCheck;
+
+class IPWL_Filler_Notify
+{
+public:
+ virtual void QueryWherePopup(void* pPrivateData, FX_FLOAT fPopupMin,FX_FLOAT fPopupMax,
+ FX_INT32 & nRet, FX_FLOAT & fPopupRet) = 0; //nRet: (0:bottom 1:top)
+ virtual void OnBeforeKeyStroke(FX_BOOL bEditOrList, void* pPrivateData, FX_INT32 nKeyCode,
+ CFX_WideString & strChange, const CFX_WideString& strChangeEx,
+ int nSelStart, int nSelEnd,
+ FX_BOOL bKeyDown, FX_BOOL & bRC, FX_BOOL & bExit, FX_DWORD nFlag) = 0;
+ virtual void OnAfterKeyStroke(FX_BOOL bEditOrList, void* pPrivateData, FX_BOOL & bExit, FX_DWORD nFlag) = 0;
+};
+
+class PWL_CLASS CPWL_Edit : public CPWL_EditCtrl, public IFX_Edit_OprNotify
+{
+public:
+ CPWL_Edit();
+ virtual ~CPWL_Edit();
+
+public:
+ virtual CFX_ByteString GetClassName() const;
+ virtual void OnDestroy();
+ virtual void OnCreated();
+ virtual void RePosChildWnd();
+ virtual CPDF_Rect GetClientRect() const;
+
+ virtual void GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream);
+ virtual void DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device);
+
+ virtual FX_BOOL OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnLButtonDblClk(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag);
+
+ virtual FX_BOOL OnKeyDown(FX_WORD nChar, FX_DWORD nFlag);
+ virtual FX_BOOL OnChar(FX_WORD nChar, FX_DWORD nFlag);
+
+ virtual CPDF_Rect GetFocusRect() const;
+
+public:
+ void SetAlignFormatH(PWL_EDIT_ALIGNFORMAT_H nFormat = PEAH_LEFT, FX_BOOL bPaint = TRUE); //0:left 1:right 2:middle
+ void SetAlignFormatV(PWL_EDIT_ALIGNFORMAT_V nFormat = PEAV_TOP, FX_BOOL bPaint = TRUE); //0:top 1:bottom 2:center
+
+ void SetCharArray(FX_INT32 nCharArray);
+ void SetLimitChar(FX_INT32 nLimitChar);
+
+ void SetHorzScale(FX_INT32 nHorzScale, FX_BOOL bPaint = TRUE);
+ void SetCharSpace(FX_FLOAT fCharSpace, FX_BOOL bPaint = TRUE);
+
+ void SetLineLeading(FX_FLOAT fLineLeading, FX_BOOL bPaint = TRUE);
+
+ void EnableSpellCheck(FX_BOOL bEnabled);
+
+ FX_BOOL CanSelectAll() const;
+ FX_BOOL CanClear() const;
+ FX_BOOL CanCopy() const;
+ FX_BOOL CanCut() const;
+ FX_BOOL CanPaste() const;
+
+ virtual void CopyText();
+ virtual void PasteText();
+ virtual void CutText();
+
+ virtual void SetText(FX_LPCWSTR csText);
+ void ReplaceSel(FX_LPCWSTR csText);
+
+ CFX_ByteString GetTextAppearanceStream(const CPDF_Point & ptOffset) const;
+ CFX_ByteString GetCaretAppearanceStream(const CPDF_Point & ptOffset) const;
+ CFX_ByteString GetSelectAppearanceStream(const CPDF_Point & ptOffset) const;
+
+ FX_BOOL IsTextFull() const;
+
+ static FX_FLOAT GetCharArrayAutoFontSize(CPDF_Font* pFont, const CPDF_Rect& rcPlate, FX_INT32 nCharArray);
+
+ void SetFillerNotify(IPWL_Filler_Notify* pNotify) {m_pFillerNotify = pNotify;}
+
+ void GeneratePageObjects(CPDF_PageObjects* pPageObjects,
+ const CPDF_Point& ptOffset, CFX_ArrayTemplate<CPDF_TextObject*>& ObjArray);
+ void GeneratePageObjects(CPDF_PageObjects* pPageObjects,
+ const CPDF_Point& ptOffset);
+
+protected:
+ virtual void OnSetFocus();
+ virtual void OnKillFocus();
+
+protected:
+ virtual void OnInsertWord(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace);
+ virtual void OnInsertReturn(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace);
+ virtual void OnBackSpace(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace);
+ virtual void OnDelete(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace);
+ virtual void OnClear(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace);
+ virtual void OnSetText(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace);
+ virtual void OnInsertText(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace);
+ virtual void OnAddUndo(IFX_Edit_UndoItem* pUndoItem);
+
+private:
+ CPVT_WordRange GetSelectWordRange() const;
+ virtual void ShowVScrollBar(FX_BOOL bShow);
+ FX_BOOL IsVScrollBarVisible() const;
+ void SetParamByFlag();
+
+ FX_FLOAT GetCharArrayAutoFontSize(FX_INT32 nCharArray);
+ CPDF_Point GetWordRightBottomPoint(const CPVT_WordPlace& wpWord);
+
+ CPVT_WordRange CombineWordRange(const CPVT_WordRange& wr1, const CPVT_WordRange& wr2);
+ CPVT_WordRange GetLatinWordsRange(const CPDF_Point & point) const;
+ CPVT_WordRange GetLatinWordsRange(const CPVT_WordPlace & place) const;
+ CPVT_WordRange GetArabicWordsRange(const CPVT_WordPlace & place) const;
+ CPVT_WordRange GetSameWordsRange(const CPVT_WordPlace & place, FX_BOOL bLatin, FX_BOOL bArabic) const;
+
+ void AjustArabicWords(const CPVT_WordRange& wr);
+public:
+ FX_BOOL IsProceedtoOnChar(FX_WORD nKeyCode, FX_DWORD nFlag);
+private:
+ IPWL_Filler_Notify* m_pFillerNotify;
+ IPWL_SpellCheck* m_pSpellCheck;
+ FX_BOOL m_bFocus;
+ CPDF_Rect m_rcOldWindow;
+public:
+ void AttachFFLData(void* pData) {m_pFormFiller = pData;}
+private:
+ void* m_pFormFiller;
+};
+
+#endif
+
diff --git a/fpdfsdk/include/pdfwindow/PWL_EditCtrl.h b/fpdfsdk/include/pdfwindow/PWL_EditCtrl.h
index 3df0f4c23f..b13d5e1e79 100644
--- a/fpdfsdk/include/pdfwindow/PWL_EditCtrl.h
+++ b/fpdfsdk/include/pdfwindow/PWL_EditCtrl.h
@@ -1,171 +1,171 @@
-// 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 _PWL_EDITCTRL_H_
-#define _PWL_EDITCTRL_H_
-
-enum PWL_EDIT_ALIGNFORMAT_H
-{
- PEAH_LEFT = 0,
- PEAH_MIDDLE,
- PEAH_RIGHT
-};
-
-enum PWL_EDIT_ALIGNFORMAT_V
-{
- PEAV_TOP = 0,
- PEAV_CENTER,
- PEAV_BOTTOM
-};
-
-class IPWL_Edit_Notify;
-class CPWL_EditCtrl;
-class CPWL_Caret;
-class IFX_Edit;
-class CPWL_Edit;
-
-class IPWL_Edit_Notify
-{
-public:
- //when the position of caret is changed in edit
- virtual void OnCaretMove(FX_INT32 x1, FX_INT32 y1, FX_INT32 x2, FX_INT32 y2) {}
- virtual void OnContentChange(const CPDF_Rect& rcContent){}
- //OprType: 0 InsertWord
- //1 InsertReturn
- //2 BackSpace
- //3 Delete
- //4 Clear
- //5 InsertText
- //6 SetText
- virtual void OnInsertWord(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace){}
- virtual void OnInsertReturn(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace){}
- virtual void OnBackSpace(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace){}
- virtual void OnDelete(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace){}
- virtual void OnClear(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace){}
- virtual void OnInsertText(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace){}
- virtual void OnSetText(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace){}
- virtual void OnAddUndo(CPWL_Edit* pEdit) {}
-};
-
-class PWL_CLASS CPWL_EditCtrl : public CPWL_Wnd, public IFX_Edit_Notify
-{
- friend class CPWL_Edit_Notify;
-
-public:
- CPWL_EditCtrl();
- virtual ~CPWL_EditCtrl();
-
-public:
- virtual void OnCreate(PWL_CREATEPARAM & cp);
- virtual void OnCreated();
-
- virtual FX_BOOL OnKeyDown(FX_WORD nChar, FX_DWORD nFlag);
- virtual FX_BOOL OnChar(FX_WORD nChar, FX_DWORD nFlag);
- virtual FX_BOOL OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag);
- virtual FX_BOOL OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
- virtual FX_BOOL OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag);
- virtual void OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam = 0, FX_INTPTR lParam = 0);
-
- virtual void CreateChildWnd(const PWL_CREATEPARAM & cp);
- virtual void RePosChildWnd();
- virtual void SetFontSize(FX_FLOAT fFontSize);
- virtual FX_FLOAT GetFontSize() const;
-
-public:
- virtual void SetText(FX_LPCWSTR csText);
-
- virtual void CopyText();
- virtual void PasteText();
- virtual void CutText();
-
- CPDF_Rect GetContentRect() const;
- void GetCaretPos(FX_INT32& x, FX_INT32& y) const;
- FX_BOOL IsModified() const;
-
- CFX_WideString GetText() const;
- void SetSel(FX_INT32 nStartChar,FX_INT32 nEndChar);
- void GetSel(FX_INT32 & nStartChar, FX_INT32 & nEndChar ) const;
- void GetTextRange(const CPDF_Rect& rect, FX_INT32 & nStartChar, FX_INT32 & nEndChar) const;
- CFX_WideString GetText(FX_INT32 & nStartChar, FX_INT32 & nEndChar) const;
- void Clear();
- void SelectAll();
-
- FX_INT32 GetCaret() const;
- void SetCaret(FX_INT32 nPos);
- FX_INT32 GetTotalWords() const;
-
- void Paint();
-
- void EnableRefresh(FX_BOOL bRefresh);
- CPDF_Point GetScrollPos() const;
- void SetScrollPos(const CPDF_Point& point);
-
- void SetEditNotify(IPWL_Edit_Notify* pNotify) {m_pEditNotify = pNotify;}
-
- void SetCharSet(FX_BYTE nCharSet){m_nCharSet = nCharSet;}
- FX_INT32 GetCharSet() const;
-
- void SetCodePage(FX_INT32 nCodePage){m_nCodePage = nCodePage;}
- FX_INT32 GetCodePage() const {return m_nCodePage;}
-
- CPDF_Font * GetCaretFont() const;
- FX_FLOAT GetCaretFontSize() const;
-
- FX_BOOL CanUndo() const;
- FX_BOOL CanRedo() const;
- void Redo();
- void Undo();
-
- void SetReadyToInput();
-protected:
- virtual void ShowVScrollBar(FX_BOOL bShow);
-
- virtual void InsertWord(FX_WORD word, FX_INT32 nCharset);
- virtual void InsertReturn();
- virtual void InsertText(FX_LPCWSTR csText);
-
- virtual void SetCursor();
- FX_BOOL IsWndHorV();
-
- void Delete();
- void Backspace();
-
-protected:
- void GetCaretInfo(CPDF_Point & ptHead, CPDF_Point & ptFoot) const;
- void SetCaret(FX_BOOL bVisible, const CPDF_Point & ptHead, const CPDF_Point & ptFoot);
-
- void SetEditCaret(FX_BOOL bVisible);
-
-protected:
- virtual void IOnSetScrollInfoX(FX_FLOAT fPlateMin, FX_FLOAT fPlateMax,
- FX_FLOAT fContentMin, FX_FLOAT fContentMax,
- FX_FLOAT fSmallStep, FX_FLOAT fBigStep){}
- virtual void IOnSetScrollInfoY(FX_FLOAT fPlateMin, FX_FLOAT fPlateMax,
- FX_FLOAT fContentMin, FX_FLOAT fContentMax,
- FX_FLOAT fSmallStep, FX_FLOAT fBigStep);
- virtual void IOnSetScrollPosX(FX_FLOAT fx){}
- virtual void IOnSetScrollPosY(FX_FLOAT fy);
- virtual void IOnSetCaret(FX_BOOL bVisible,const CPDF_Point & ptHead,const CPDF_Point & ptFoot, const CPVT_WordPlace& place);
- virtual void IOnCaretChange(const CPVT_SecProps & secProps, const CPVT_WordProps & wordProps);
- virtual void IOnContentChange(const CPDF_Rect& rcContent);
- virtual void IOnInvalidateRect(CPDF_Rect * pRect);
-
-private:
- void CreateEditCaret(const PWL_CREATEPARAM & cp);
-
-protected:
- IFX_Edit* m_pEdit;
- CPWL_Caret* m_pEditCaret;
- FX_BOOL m_bMouseDown;
- IPWL_Edit_Notify* m_pEditNotify;
-
-private:
- FX_INT32 m_nCharSet;
- FX_INT32 m_nCodePage;
-};
-
-#endif
-
+// 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 _PWL_EDITCTRL_H_
+#define _PWL_EDITCTRL_H_
+
+enum PWL_EDIT_ALIGNFORMAT_H
+{
+ PEAH_LEFT = 0,
+ PEAH_MIDDLE,
+ PEAH_RIGHT
+};
+
+enum PWL_EDIT_ALIGNFORMAT_V
+{
+ PEAV_TOP = 0,
+ PEAV_CENTER,
+ PEAV_BOTTOM
+};
+
+class IPWL_Edit_Notify;
+class CPWL_EditCtrl;
+class CPWL_Caret;
+class IFX_Edit;
+class CPWL_Edit;
+
+class IPWL_Edit_Notify
+{
+public:
+ //when the position of caret is changed in edit
+ virtual void OnCaretMove(FX_INT32 x1, FX_INT32 y1, FX_INT32 x2, FX_INT32 y2) {}
+ virtual void OnContentChange(const CPDF_Rect& rcContent){}
+ //OprType: 0 InsertWord
+ //1 InsertReturn
+ //2 BackSpace
+ //3 Delete
+ //4 Clear
+ //5 InsertText
+ //6 SetText
+ virtual void OnInsertWord(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace){}
+ virtual void OnInsertReturn(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace){}
+ virtual void OnBackSpace(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace){}
+ virtual void OnDelete(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace){}
+ virtual void OnClear(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace){}
+ virtual void OnInsertText(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace){}
+ virtual void OnSetText(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace){}
+ virtual void OnAddUndo(CPWL_Edit* pEdit) {}
+};
+
+class PWL_CLASS CPWL_EditCtrl : public CPWL_Wnd, public IFX_Edit_Notify
+{
+ friend class CPWL_Edit_Notify;
+
+public:
+ CPWL_EditCtrl();
+ virtual ~CPWL_EditCtrl();
+
+public:
+ virtual void OnCreate(PWL_CREATEPARAM & cp);
+ virtual void OnCreated();
+
+ virtual FX_BOOL OnKeyDown(FX_WORD nChar, FX_DWORD nFlag);
+ virtual FX_BOOL OnChar(FX_WORD nChar, FX_DWORD nFlag);
+ virtual FX_BOOL OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual void OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam = 0, FX_INTPTR lParam = 0);
+
+ virtual void CreateChildWnd(const PWL_CREATEPARAM & cp);
+ virtual void RePosChildWnd();
+ virtual void SetFontSize(FX_FLOAT fFontSize);
+ virtual FX_FLOAT GetFontSize() const;
+
+public:
+ virtual void SetText(FX_LPCWSTR csText);
+
+ virtual void CopyText();
+ virtual void PasteText();
+ virtual void CutText();
+
+ CPDF_Rect GetContentRect() const;
+ void GetCaretPos(FX_INT32& x, FX_INT32& y) const;
+ FX_BOOL IsModified() const;
+
+ CFX_WideString GetText() const;
+ void SetSel(FX_INT32 nStartChar,FX_INT32 nEndChar);
+ void GetSel(FX_INT32 & nStartChar, FX_INT32 & nEndChar ) const;
+ void GetTextRange(const CPDF_Rect& rect, FX_INT32 & nStartChar, FX_INT32 & nEndChar) const;
+ CFX_WideString GetText(FX_INT32 & nStartChar, FX_INT32 & nEndChar) const;
+ void Clear();
+ void SelectAll();
+
+ FX_INT32 GetCaret() const;
+ void SetCaret(FX_INT32 nPos);
+ FX_INT32 GetTotalWords() const;
+
+ void Paint();
+
+ void EnableRefresh(FX_BOOL bRefresh);
+ CPDF_Point GetScrollPos() const;
+ void SetScrollPos(const CPDF_Point& point);
+
+ void SetEditNotify(IPWL_Edit_Notify* pNotify) {m_pEditNotify = pNotify;}
+
+ void SetCharSet(FX_BYTE nCharSet){m_nCharSet = nCharSet;}
+ FX_INT32 GetCharSet() const;
+
+ void SetCodePage(FX_INT32 nCodePage){m_nCodePage = nCodePage;}
+ FX_INT32 GetCodePage() const {return m_nCodePage;}
+
+ CPDF_Font * GetCaretFont() const;
+ FX_FLOAT GetCaretFontSize() const;
+
+ FX_BOOL CanUndo() const;
+ FX_BOOL CanRedo() const;
+ void Redo();
+ void Undo();
+
+ void SetReadyToInput();
+protected:
+ virtual void ShowVScrollBar(FX_BOOL bShow);
+
+ virtual void InsertWord(FX_WORD word, FX_INT32 nCharset);
+ virtual void InsertReturn();
+ virtual void InsertText(FX_LPCWSTR csText);
+
+ virtual void SetCursor();
+ FX_BOOL IsWndHorV();
+
+ void Delete();
+ void Backspace();
+
+protected:
+ void GetCaretInfo(CPDF_Point & ptHead, CPDF_Point & ptFoot) const;
+ void SetCaret(FX_BOOL bVisible, const CPDF_Point & ptHead, const CPDF_Point & ptFoot);
+
+ void SetEditCaret(FX_BOOL bVisible);
+
+protected:
+ virtual void IOnSetScrollInfoX(FX_FLOAT fPlateMin, FX_FLOAT fPlateMax,
+ FX_FLOAT fContentMin, FX_FLOAT fContentMax,
+ FX_FLOAT fSmallStep, FX_FLOAT fBigStep){}
+ virtual void IOnSetScrollInfoY(FX_FLOAT fPlateMin, FX_FLOAT fPlateMax,
+ FX_FLOAT fContentMin, FX_FLOAT fContentMax,
+ FX_FLOAT fSmallStep, FX_FLOAT fBigStep);
+ virtual void IOnSetScrollPosX(FX_FLOAT fx){}
+ virtual void IOnSetScrollPosY(FX_FLOAT fy);
+ virtual void IOnSetCaret(FX_BOOL bVisible,const CPDF_Point & ptHead,const CPDF_Point & ptFoot, const CPVT_WordPlace& place);
+ virtual void IOnCaretChange(const CPVT_SecProps & secProps, const CPVT_WordProps & wordProps);
+ virtual void IOnContentChange(const CPDF_Rect& rcContent);
+ virtual void IOnInvalidateRect(CPDF_Rect * pRect);
+
+private:
+ void CreateEditCaret(const PWL_CREATEPARAM & cp);
+
+protected:
+ IFX_Edit* m_pEdit;
+ CPWL_Caret* m_pEditCaret;
+ FX_BOOL m_bMouseDown;
+ IPWL_Edit_Notify* m_pEditNotify;
+
+private:
+ FX_INT32 m_nCharSet;
+ FX_INT32 m_nCodePage;
+};
+
+#endif
+
diff --git a/fpdfsdk/include/pdfwindow/PWL_FontMap.h b/fpdfsdk/include/pdfwindow/PWL_FontMap.h
index 858bb2a398..b3da533b3e 100644
--- a/fpdfsdk/include/pdfwindow/PWL_FontMap.h
+++ b/fpdfsdk/include/pdfwindow/PWL_FontMap.h
@@ -1,137 +1,137 @@
-// 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 _PWL_FONTMAP_H_
-#define _PWL_FONTMAP_H_
-
-struct CPWL_FontMap_Data
-{
- CPDF_Font* pFont;
- FX_INT32 nCharset;
- CFX_ByteString sFontName;
-};
-
-struct CPWL_FontMap_Native
-{
- FX_INT32 nCharset;
- CFX_ByteString sFontName;
-};
-
-#ifndef ANSI_CHARSET
-
-#define ANSI_CHARSET 0
-#define DEFAULT_CHARSET 1
-#define SYMBOL_CHARSET 2
-#define SHIFTJIS_CHARSET 128
-#define HANGEUL_CHARSET 129
-#define HANGUL_CHARSET 129
-#define GB2312_CHARSET 134
-#define CHINESEBIG5_CHARSET 136
-#define OEM_CHARSET 255
-#define JOHAB_CHARSET 130
-#define HEBREW_CHARSET 177
-#define ARABIC_CHARSET 178
-#define GREEK_CHARSET 161
-#define TURKISH_CHARSET 162
-#define VIETNAMESE_CHARSET 163
-#define THAI_CHARSET 222
-#define EASTEUROPE_CHARSET 238
-#define RUSSIAN_CHARSET 204
-#define BALTIC_CHARSET 186
-
-#endif
-
-#ifndef PWL_CLASS
-
- #ifdef FX_READER_DLL
- #define PWL_CLASS __declspec(dllexport)
- #else
- #define PWL_CLASS
- #endif
-#endif
-
-class IFX_SystemHandler;
-class PWL_CLASS CPWL_FontMap : public IFX_Edit_FontMap
-{
-public:
- CPWL_FontMap(IFX_SystemHandler* pSystemHandler);
- virtual ~CPWL_FontMap();
-
- virtual CPDF_Font* GetPDFFont(FX_INT32 nFontIndex);
- virtual CFX_ByteString GetPDFFontAlias(FX_INT32 nFontIndex);
- virtual FX_INT32 GetWordFontIndex(FX_WORD word, FX_INT32 nCharset, FX_INT32 nFontIndex);
- virtual FX_INT32 CharCodeFromUnicode(FX_INT32 nFontIndex, FX_WORD word);
- virtual FX_INT32 CharSetFromUnicode(FX_WORD word, FX_INT32 nOldCharset);
-
-public:
- virtual void Initial(FX_LPCSTR fontname = NULL);
- void SetSystemHandler(IFX_SystemHandler* pSystemHandler);
-
- FX_INT32 GetFontMapCount() const;
- const CPWL_FontMap_Data* GetFontMapData(FX_INT32 nIndex) const;
-
-public:
- static FX_INT32 GetNativeCharset();
- CFX_ByteString GetNativeFontName(FX_INT32 nCharset);
-
- static CFX_ByteString GetDefaultFontByCharset(FX_INT32 nCharset);
-
- CPDF_Font* AddFontToDocument(CPDF_Document* pDoc, CFX_ByteString& sFontName, FX_BYTE nCharset);
- static FX_BOOL IsStandardFont(const CFX_ByteString& sFontName);
- CPDF_Font* AddStandardFont(CPDF_Document* pDoc, CFX_ByteString& sFontName);
- CPDF_Font* AddSystemFont(CPDF_Document* pDoc, CFX_ByteString& sFontName,
- FX_BYTE nCharset);
-
-protected:
- virtual CPDF_Font* FindFontSameCharset(CFX_ByteString& sFontAlias, FX_INT32 nCharset);
- virtual void AddedFont(CPDF_Font* pFont, const CFX_ByteString& sFontAlias);
- FX_BOOL KnowWord(FX_INT32 nFontIndex, FX_WORD word);
-
- virtual CPDF_Document* GetDocument();
-
- void Empty();
- FX_INT32 GetFontIndex(const CFX_ByteString& sFontName, FX_INT32 nCharset, FX_BOOL bFind);
- FX_INT32 GetPWLFontIndex(FX_WORD word, FX_INT32 nCharset);
- FX_INT32 AddFontData(CPDF_Font* pFont, const CFX_ByteString& sFontAlias, FX_INT32 nCharset = DEFAULT_CHARSET);
-
- CFX_ByteString EncodeFontAlias(const CFX_ByteString& sFontName, FX_INT32 nCharset);
- CFX_ByteString EncodeFontAlias(const CFX_ByteString& sFontName);
-
-private:
- CFX_ByteString GetFontName(FX_INT32 nFontIndex);
- FX_INT32 FindFont(const CFX_ByteString& sFontName, FX_INT32 nCharset = DEFAULT_CHARSET);
-
- CFX_ByteString GetNativeFont(FX_INT32 nCharset);
-
-public:
- struct CharsetFontMap {
- FX_INT32 charset;
- const char* fontname;
- };
- static const CharsetFontMap defaultTTFMap[];
-
-protected:
- CFX_ArrayTemplate<CPWL_FontMap_Data*> m_aData;
- CFX_ArrayTemplate<CPWL_FontMap_Native*> m_aNativeFont;
-
-private:
- CPDF_Document* m_pPDFDoc;
- IFX_SystemHandler* m_pSystemHandler;
-};
-
-class PWL_CLASS CPWL_DocFontMap : public CPWL_FontMap
-{
-public:
- CPWL_DocFontMap(IFX_SystemHandler* pSystemHandler, CPDF_Document* pAttachedDoc);
- virtual ~CPWL_DocFontMap();
-
- virtual CPDF_Document* GetDocument();
-
-private:
- CPDF_Document* m_pAttachedDoc;
-};
-
-#endif
+// 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 _PWL_FONTMAP_H_
+#define _PWL_FONTMAP_H_
+
+struct CPWL_FontMap_Data
+{
+ CPDF_Font* pFont;
+ FX_INT32 nCharset;
+ CFX_ByteString sFontName;
+};
+
+struct CPWL_FontMap_Native
+{
+ FX_INT32 nCharset;
+ CFX_ByteString sFontName;
+};
+
+#ifndef ANSI_CHARSET
+
+#define ANSI_CHARSET 0
+#define DEFAULT_CHARSET 1
+#define SYMBOL_CHARSET 2
+#define SHIFTJIS_CHARSET 128
+#define HANGEUL_CHARSET 129
+#define HANGUL_CHARSET 129
+#define GB2312_CHARSET 134
+#define CHINESEBIG5_CHARSET 136
+#define OEM_CHARSET 255
+#define JOHAB_CHARSET 130
+#define HEBREW_CHARSET 177
+#define ARABIC_CHARSET 178
+#define GREEK_CHARSET 161
+#define TURKISH_CHARSET 162
+#define VIETNAMESE_CHARSET 163
+#define THAI_CHARSET 222
+#define EASTEUROPE_CHARSET 238
+#define RUSSIAN_CHARSET 204
+#define BALTIC_CHARSET 186
+
+#endif
+
+#ifndef PWL_CLASS
+
+ #ifdef FX_READER_DLL
+ #define PWL_CLASS __declspec(dllexport)
+ #else
+ #define PWL_CLASS
+ #endif
+#endif
+
+class IFX_SystemHandler;
+class PWL_CLASS CPWL_FontMap : public IFX_Edit_FontMap
+{
+public:
+ CPWL_FontMap(IFX_SystemHandler* pSystemHandler);
+ virtual ~CPWL_FontMap();
+
+ virtual CPDF_Font* GetPDFFont(FX_INT32 nFontIndex);
+ virtual CFX_ByteString GetPDFFontAlias(FX_INT32 nFontIndex);
+ virtual FX_INT32 GetWordFontIndex(FX_WORD word, FX_INT32 nCharset, FX_INT32 nFontIndex);
+ virtual FX_INT32 CharCodeFromUnicode(FX_INT32 nFontIndex, FX_WORD word);
+ virtual FX_INT32 CharSetFromUnicode(FX_WORD word, FX_INT32 nOldCharset);
+
+public:
+ virtual void Initial(FX_LPCSTR fontname = NULL);
+ void SetSystemHandler(IFX_SystemHandler* pSystemHandler);
+
+ FX_INT32 GetFontMapCount() const;
+ const CPWL_FontMap_Data* GetFontMapData(FX_INT32 nIndex) const;
+
+public:
+ static FX_INT32 GetNativeCharset();
+ CFX_ByteString GetNativeFontName(FX_INT32 nCharset);
+
+ static CFX_ByteString GetDefaultFontByCharset(FX_INT32 nCharset);
+
+ CPDF_Font* AddFontToDocument(CPDF_Document* pDoc, CFX_ByteString& sFontName, FX_BYTE nCharset);
+ static FX_BOOL IsStandardFont(const CFX_ByteString& sFontName);
+ CPDF_Font* AddStandardFont(CPDF_Document* pDoc, CFX_ByteString& sFontName);
+ CPDF_Font* AddSystemFont(CPDF_Document* pDoc, CFX_ByteString& sFontName,
+ FX_BYTE nCharset);
+
+protected:
+ virtual CPDF_Font* FindFontSameCharset(CFX_ByteString& sFontAlias, FX_INT32 nCharset);
+ virtual void AddedFont(CPDF_Font* pFont, const CFX_ByteString& sFontAlias);
+ FX_BOOL KnowWord(FX_INT32 nFontIndex, FX_WORD word);
+
+ virtual CPDF_Document* GetDocument();
+
+ void Empty();
+ FX_INT32 GetFontIndex(const CFX_ByteString& sFontName, FX_INT32 nCharset, FX_BOOL bFind);
+ FX_INT32 GetPWLFontIndex(FX_WORD word, FX_INT32 nCharset);
+ FX_INT32 AddFontData(CPDF_Font* pFont, const CFX_ByteString& sFontAlias, FX_INT32 nCharset = DEFAULT_CHARSET);
+
+ CFX_ByteString EncodeFontAlias(const CFX_ByteString& sFontName, FX_INT32 nCharset);
+ CFX_ByteString EncodeFontAlias(const CFX_ByteString& sFontName);
+
+private:
+ CFX_ByteString GetFontName(FX_INT32 nFontIndex);
+ FX_INT32 FindFont(const CFX_ByteString& sFontName, FX_INT32 nCharset = DEFAULT_CHARSET);
+
+ CFX_ByteString GetNativeFont(FX_INT32 nCharset);
+
+public:
+ struct CharsetFontMap {
+ FX_INT32 charset;
+ const char* fontname;
+ };
+ static const CharsetFontMap defaultTTFMap[];
+
+protected:
+ CFX_ArrayTemplate<CPWL_FontMap_Data*> m_aData;
+ CFX_ArrayTemplate<CPWL_FontMap_Native*> m_aNativeFont;
+
+private:
+ CPDF_Document* m_pPDFDoc;
+ IFX_SystemHandler* m_pSystemHandler;
+};
+
+class PWL_CLASS CPWL_DocFontMap : public CPWL_FontMap
+{
+public:
+ CPWL_DocFontMap(IFX_SystemHandler* pSystemHandler, CPDF_Document* pAttachedDoc);
+ virtual ~CPWL_DocFontMap();
+
+ virtual CPDF_Document* GetDocument();
+
+private:
+ CPDF_Document* m_pAttachedDoc;
+};
+
+#endif
diff --git a/fpdfsdk/include/pdfwindow/PWL_Icon.h b/fpdfsdk/include/pdfwindow/PWL_Icon.h
index d6b121e800..4a084fd541 100644
--- a/fpdfsdk/include/pdfwindow/PWL_Icon.h
+++ b/fpdfsdk/include/pdfwindow/PWL_Icon.h
@@ -1,59 +1,59 @@
-// 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 _PWL_ICON_H_
-#define _PWL_ICON_H_
-
-class PWL_CLASS CPWL_Image : public CPWL_Wnd
-{
-public:
- CPWL_Image();
- virtual ~CPWL_Image();
-
- virtual CFX_ByteString GetImageAppStream();
-
- virtual void GetScale(FX_FLOAT & fHScale,FX_FLOAT & fVScale);
- virtual void GetImageOffset(FX_FLOAT & x,FX_FLOAT & y);
- virtual CPDF_Stream * GetPDFStream();
-
-public:
- void SetPDFStream(CPDF_Stream* pStream);
- void GetImageSize(FX_FLOAT & fWidth,FX_FLOAT & fHeight);
- CPDF_Matrix GetImageMatrix();
- CFX_ByteString GetImageAlias();
- void SetImageAlias(FX_LPCSTR sImageAlias);
-
-protected:
- CPDF_Stream* m_pPDFStream;
- CFX_ByteString m_sImageAlias;
-};
-
-class PWL_CLASS CPWL_Icon : public CPWL_Image
-{
-public:
- CPWL_Icon();
- virtual ~CPWL_Icon();
-
- virtual CPDF_IconFit * GetIconFit(){return m_pIconFit;};
-
- virtual void GetScale(FX_FLOAT & fHScale,FX_FLOAT & fVScale);
- virtual void GetImageOffset(FX_FLOAT & x,FX_FLOAT & y);
-
- FX_INT32 GetScaleMethod();
- FX_BOOL IsProportionalScale();
- void GetIconPosition(FX_FLOAT & fLeft, FX_FLOAT & fBottom);
- FX_BOOL GetFittingBounds();
-
- void SetIconFit(CPDF_IconFit * pIconFit){m_pIconFit = pIconFit;};
-
-private:
- CPDF_IconFit * m_pIconFit;
-};
-
-
-#endif // !defined(AFX_PWL_BUTTON_H__5A6080AA_33C5_4FC9_91FC_D9644C41120A__INCLUDED_)
-
-
+// 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 _PWL_ICON_H_
+#define _PWL_ICON_H_
+
+class PWL_CLASS CPWL_Image : public CPWL_Wnd
+{
+public:
+ CPWL_Image();
+ virtual ~CPWL_Image();
+
+ virtual CFX_ByteString GetImageAppStream();
+
+ virtual void GetScale(FX_FLOAT & fHScale,FX_FLOAT & fVScale);
+ virtual void GetImageOffset(FX_FLOAT & x,FX_FLOAT & y);
+ virtual CPDF_Stream * GetPDFStream();
+
+public:
+ void SetPDFStream(CPDF_Stream* pStream);
+ void GetImageSize(FX_FLOAT & fWidth,FX_FLOAT & fHeight);
+ CPDF_Matrix GetImageMatrix();
+ CFX_ByteString GetImageAlias();
+ void SetImageAlias(FX_LPCSTR sImageAlias);
+
+protected:
+ CPDF_Stream* m_pPDFStream;
+ CFX_ByteString m_sImageAlias;
+};
+
+class PWL_CLASS CPWL_Icon : public CPWL_Image
+{
+public:
+ CPWL_Icon();
+ virtual ~CPWL_Icon();
+
+ virtual CPDF_IconFit * GetIconFit(){return m_pIconFit;};
+
+ virtual void GetScale(FX_FLOAT & fHScale,FX_FLOAT & fVScale);
+ virtual void GetImageOffset(FX_FLOAT & x,FX_FLOAT & y);
+
+ FX_INT32 GetScaleMethod();
+ FX_BOOL IsProportionalScale();
+ void GetIconPosition(FX_FLOAT & fLeft, FX_FLOAT & fBottom);
+ FX_BOOL GetFittingBounds();
+
+ void SetIconFit(CPDF_IconFit * pIconFit){m_pIconFit = pIconFit;};
+
+private:
+ CPDF_IconFit * m_pIconFit;
+};
+
+
+#endif // !defined(AFX_PWL_BUTTON_H__5A6080AA_33C5_4FC9_91FC_D9644C41120A__INCLUDED_)
+
+
diff --git a/fpdfsdk/include/pdfwindow/PWL_IconList.h b/fpdfsdk/include/pdfwindow/PWL_IconList.h
index e5192901e8..f0844485ee 100644
--- a/fpdfsdk/include/pdfwindow/PWL_IconList.h
+++ b/fpdfsdk/include/pdfwindow/PWL_IconList.h
@@ -1,125 +1,125 @@
-// 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 _PWL_IconList_H_
-#define _PWL_IconList_H_
-
-class IPWL_IconList_Notify;
-class CPWL_IconList_Item;
-class CPWL_IconList_Content;
-class CPWL_IconList;
-class CPWL_Label;
-
-class IPWL_IconList_Notify
-{
-public:
- virtual void OnNoteListSelChanged(FX_INT32 nItemIndex) = 0;
-};
-
-class CPWL_IconList_Item : public CPWL_Wnd
-{
-public:
- CPWL_IconList_Item();
- virtual ~CPWL_IconList_Item();
-
- virtual CFX_ByteString GetClassName() const;
- virtual void CreateChildWnd(const PWL_CREATEPARAM & cp);
- virtual void RePosChildWnd();
-
- void SetSelect(FX_BOOL bSelected);
- FX_BOOL IsSelected() const;
- void SetData(void* pData);
- void SetIcon(FX_INT32 nIconIndex);
- void SetText(const CFX_WideString& str);
- void SetIconFillColor(const CPWL_Color& color);
- CFX_WideString GetText() const;
-
-protected:
- virtual FX_FLOAT GetItemHeight(FX_FLOAT fLimitWidth);
- virtual void DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device);
-
- virtual void OnEnabled();
- virtual void OnDisabled();
-
-private:
- FX_INT32 m_nIconIndex;
- void* m_pData;
- FX_BOOL m_bSelected;
- CPWL_Label* m_pText;
- CPWL_Color m_crIcon;
-};
-
-class CPWL_IconList_Content : public CPWL_ListCtrl
-{
-public:
- CPWL_IconList_Content(FX_INT32 nListCount);
- virtual ~CPWL_IconList_Content();
-
- void SetSelect(FX_INT32 nIndex);
- FX_INT32 GetSelect() const;
- void SetNotify(IPWL_IconList_Notify* pNotify);
- void EnableNotify(FX_BOOL bNotify);
- void SetListData(FX_INT32 nItemIndex, void* pData);
- void SetListIcon(FX_INT32 nItemIndex, FX_INT32 nIconIndex);
- void SetListString(FX_INT32 nItemIndex, const CFX_WideString& str);
- void SetIconFillColor(const CPWL_Color& color);
- CFX_WideString GetListString(FX_INT32 nItemIndex) const;
- IPWL_IconList_Notify* GetNotify() const;
- void ScrollToItem(FX_INT32 nItemIndex);
-
-protected:
- virtual void CreateChildWnd(const PWL_CREATEPARAM & cp);
- virtual FX_BOOL OnLButtonDown(const CPDF_Point & point);
- virtual FX_BOOL OnLButtonUp(const CPDF_Point & point);
- virtual FX_BOOL OnMouseMove(const CPDF_Point & point);
- virtual FX_BOOL OnKeyDown(FX_WORD nChar);
-
-private:
- CPWL_IconList_Item* GetListItem(FX_INT32 nItemIndex) const;
- void SelectItem(FX_INT32 nItemIndex, FX_BOOL bSelect);
- FX_INT32 FindItemIndex(const CPDF_Point& point);
-
- FX_BOOL m_nSelectIndex;
- IPWL_IconList_Notify* m_pNotify;
- FX_BOOL m_bEnableNotify;
- FX_BOOL m_bMouseDown;
- FX_INT32 m_nListCount;
-};
-
-class PWL_CLASS CPWL_IconList : public CPWL_Wnd
-{
-public:
- CPWL_IconList(FX_INT32 nListCount);
- virtual ~CPWL_IconList();
-
- virtual FX_BOOL OnMouseWheel(short zDelta, const CPDF_Point & point);
-
- void SetSelect(FX_INT32 nIndex);
- void SetTopItem(FX_INT32 nIndex);
- FX_INT32 GetSelect() const;
- void SetNotify(IPWL_IconList_Notify* pNotify);
- void EnableNotify(FX_BOOL bNotify);
- void SetListData(FX_INT32 nItemIndex, void* pData);
- void SetListIcon(FX_INT32 nItemIndex, FX_INT32 nIconIndex);
- void SetListString(FX_INT32 nItemIndex, const CFX_WideString& str);
- void SetIconFillColor(const CPWL_Color& color);
- CFX_WideString GetListString(FX_INT32 nItemIndex) const;
-
-protected:
- virtual void OnCreated();
- virtual void RePosChildWnd();
- virtual void CreateChildWnd(const PWL_CREATEPARAM & cp);
-
- virtual void OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam = 0, FX_INTPTR lParam = 0);
-
-private:
- CPWL_IconList_Content* m_pListContent;
- FX_INT32 m_nListCount;
-};
-
-#endif //_PWL_IconList_H_
-
-
+// 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 _PWL_IconList_H_
+#define _PWL_IconList_H_
+
+class IPWL_IconList_Notify;
+class CPWL_IconList_Item;
+class CPWL_IconList_Content;
+class CPWL_IconList;
+class CPWL_Label;
+
+class IPWL_IconList_Notify
+{
+public:
+ virtual void OnNoteListSelChanged(FX_INT32 nItemIndex) = 0;
+};
+
+class CPWL_IconList_Item : public CPWL_Wnd
+{
+public:
+ CPWL_IconList_Item();
+ virtual ~CPWL_IconList_Item();
+
+ virtual CFX_ByteString GetClassName() const;
+ virtual void CreateChildWnd(const PWL_CREATEPARAM & cp);
+ virtual void RePosChildWnd();
+
+ void SetSelect(FX_BOOL bSelected);
+ FX_BOOL IsSelected() const;
+ void SetData(void* pData);
+ void SetIcon(FX_INT32 nIconIndex);
+ void SetText(const CFX_WideString& str);
+ void SetIconFillColor(const CPWL_Color& color);
+ CFX_WideString GetText() const;
+
+protected:
+ virtual FX_FLOAT GetItemHeight(FX_FLOAT fLimitWidth);
+ virtual void DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device);
+
+ virtual void OnEnabled();
+ virtual void OnDisabled();
+
+private:
+ FX_INT32 m_nIconIndex;
+ void* m_pData;
+ FX_BOOL m_bSelected;
+ CPWL_Label* m_pText;
+ CPWL_Color m_crIcon;
+};
+
+class CPWL_IconList_Content : public CPWL_ListCtrl
+{
+public:
+ CPWL_IconList_Content(FX_INT32 nListCount);
+ virtual ~CPWL_IconList_Content();
+
+ void SetSelect(FX_INT32 nIndex);
+ FX_INT32 GetSelect() const;
+ void SetNotify(IPWL_IconList_Notify* pNotify);
+ void EnableNotify(FX_BOOL bNotify);
+ void SetListData(FX_INT32 nItemIndex, void* pData);
+ void SetListIcon(FX_INT32 nItemIndex, FX_INT32 nIconIndex);
+ void SetListString(FX_INT32 nItemIndex, const CFX_WideString& str);
+ void SetIconFillColor(const CPWL_Color& color);
+ CFX_WideString GetListString(FX_INT32 nItemIndex) const;
+ IPWL_IconList_Notify* GetNotify() const;
+ void ScrollToItem(FX_INT32 nItemIndex);
+
+protected:
+ virtual void CreateChildWnd(const PWL_CREATEPARAM & cp);
+ virtual FX_BOOL OnLButtonDown(const CPDF_Point & point);
+ virtual FX_BOOL OnLButtonUp(const CPDF_Point & point);
+ virtual FX_BOOL OnMouseMove(const CPDF_Point & point);
+ virtual FX_BOOL OnKeyDown(FX_WORD nChar);
+
+private:
+ CPWL_IconList_Item* GetListItem(FX_INT32 nItemIndex) const;
+ void SelectItem(FX_INT32 nItemIndex, FX_BOOL bSelect);
+ FX_INT32 FindItemIndex(const CPDF_Point& point);
+
+ FX_BOOL m_nSelectIndex;
+ IPWL_IconList_Notify* m_pNotify;
+ FX_BOOL m_bEnableNotify;
+ FX_BOOL m_bMouseDown;
+ FX_INT32 m_nListCount;
+};
+
+class PWL_CLASS CPWL_IconList : public CPWL_Wnd
+{
+public:
+ CPWL_IconList(FX_INT32 nListCount);
+ virtual ~CPWL_IconList();
+
+ virtual FX_BOOL OnMouseWheel(short zDelta, const CPDF_Point & point);
+
+ void SetSelect(FX_INT32 nIndex);
+ void SetTopItem(FX_INT32 nIndex);
+ FX_INT32 GetSelect() const;
+ void SetNotify(IPWL_IconList_Notify* pNotify);
+ void EnableNotify(FX_BOOL bNotify);
+ void SetListData(FX_INT32 nItemIndex, void* pData);
+ void SetListIcon(FX_INT32 nItemIndex, FX_INT32 nIconIndex);
+ void SetListString(FX_INT32 nItemIndex, const CFX_WideString& str);
+ void SetIconFillColor(const CPWL_Color& color);
+ CFX_WideString GetListString(FX_INT32 nItemIndex) const;
+
+protected:
+ virtual void OnCreated();
+ virtual void RePosChildWnd();
+ virtual void CreateChildWnd(const PWL_CREATEPARAM & cp);
+
+ virtual void OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam = 0, FX_INTPTR lParam = 0);
+
+private:
+ CPWL_IconList_Content* m_pListContent;
+ FX_INT32 m_nListCount;
+};
+
+#endif //_PWL_IconList_H_
+
+
diff --git a/fpdfsdk/include/pdfwindow/PWL_Label.h b/fpdfsdk/include/pdfwindow/PWL_Label.h
index 16bd1ae39a..29ea51325a 100644
--- a/fpdfsdk/include/pdfwindow/PWL_Label.h
+++ b/fpdfsdk/include/pdfwindow/PWL_Label.h
@@ -1,51 +1,51 @@
-// 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 _PWL_LABEL_H_
-#define _PWL_LABEL_H_
-
-class IFX_Edit;
-
-class PWL_CLASS CPWL_Label : public CPWL_Wnd
-{
-public:
- CPWL_Label();
- virtual ~CPWL_Label();
-
-public:
- virtual CFX_ByteString GetClassName() const;
- virtual void SetFontSize(FX_FLOAT fFontSize);
- virtual FX_FLOAT GetFontSize() const;
-
-public:
- void SetText(FX_LPCWSTR csText);
- CFX_WideString GetText() const;
-
- void SetLimitChar(FX_INT32 nLimitChar);
- void SetHorzScale(FX_INT32 nHorzScale);
- void SetCharSpace(FX_FLOAT fCharSpace);
-
- CPDF_Rect GetContentRect() const;
- FX_INT32 GetTotalWords();
-
- CFX_ByteString GetTextAppearanceStream(const CPDF_Point & ptOffset) const;
-
-protected:
- virtual void OnCreated();
- virtual void DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device);
- virtual void GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream);
- virtual void RePosChildWnd();
-
-private:
- void SetParamByFlag();
-
-private:
- IFX_Edit* m_pEdit;
-};
-
-#endif
-
-
+// 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 _PWL_LABEL_H_
+#define _PWL_LABEL_H_
+
+class IFX_Edit;
+
+class PWL_CLASS CPWL_Label : public CPWL_Wnd
+{
+public:
+ CPWL_Label();
+ virtual ~CPWL_Label();
+
+public:
+ virtual CFX_ByteString GetClassName() const;
+ virtual void SetFontSize(FX_FLOAT fFontSize);
+ virtual FX_FLOAT GetFontSize() const;
+
+public:
+ void SetText(FX_LPCWSTR csText);
+ CFX_WideString GetText() const;
+
+ void SetLimitChar(FX_INT32 nLimitChar);
+ void SetHorzScale(FX_INT32 nHorzScale);
+ void SetCharSpace(FX_FLOAT fCharSpace);
+
+ CPDF_Rect GetContentRect() const;
+ FX_INT32 GetTotalWords();
+
+ CFX_ByteString GetTextAppearanceStream(const CPDF_Point & ptOffset) const;
+
+protected:
+ virtual void OnCreated();
+ virtual void DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device);
+ virtual void GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream);
+ virtual void RePosChildWnd();
+
+private:
+ void SetParamByFlag();
+
+private:
+ IFX_Edit* m_pEdit;
+};
+
+#endif
+
+
diff --git a/fpdfsdk/include/pdfwindow/PWL_ListBox.h b/fpdfsdk/include/pdfwindow/PWL_ListBox.h
index 6ef82c82c6..7961579004 100644
--- a/fpdfsdk/include/pdfwindow/PWL_ListBox.h
+++ b/fpdfsdk/include/pdfwindow/PWL_ListBox.h
@@ -1,103 +1,103 @@
-// 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 _PWL_LISTBOX_H_
-#define _PWL_LISTBOX_H_
-
-class CPDF_ListCtrl;
-class CPWL_List_Notify;
-class CPWL_ListBox;
-class IPWL_Filler_Notify;
-
-class CPWL_List_Notify : public IFX_List_Notify
-{
-public:
- CPWL_List_Notify(CPWL_ListBox * pList);
- virtual ~CPWL_List_Notify();
-
- void IOnSetScrollInfoX(FX_FLOAT fPlateMin, FX_FLOAT fPlateMax,
- FX_FLOAT fContentMin, FX_FLOAT fContentMax,
- FX_FLOAT fSmallStep, FX_FLOAT fBigStep){}
- void IOnSetScrollInfoY(FX_FLOAT fPlateMin, FX_FLOAT fPlateMax,
- FX_FLOAT fContentMin, FX_FLOAT fContentMax,
- FX_FLOAT fSmallStep, FX_FLOAT fBigStep);
- void IOnSetScrollPosX(FX_FLOAT fx){}
- void IOnSetScrollPosY(FX_FLOAT fy);
- void IOnSetCaret(FX_BOOL bVisible,const CPDF_Point & ptHead,const CPDF_Point & ptFoot, const CPVT_WordPlace& place);
- void IOnCaretChange(const CPVT_SecProps & secProps, const CPVT_WordProps & wordProps);
- void IOnInvalidateRect(CPDF_Rect * pRect);
-
-private:
- CPWL_ListBox* m_pList;
-};
-
-class PWL_CLASS CPWL_ListBox : public CPWL_Wnd
-{
-public:
- CPWL_ListBox();
- virtual ~CPWL_ListBox();
-
- virtual CFX_ByteString GetClassName() const;
- virtual void OnCreated();
- virtual void OnDestroy();
- virtual void GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream);
- virtual void DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device);
-
- virtual FX_BOOL OnKeyDown(FX_WORD nChar, FX_DWORD nFlag);
- virtual FX_BOOL OnChar(FX_WORD nChar, FX_DWORD nFlag);
- virtual FX_BOOL OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag);
- virtual FX_BOOL OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
- virtual FX_BOOL OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag);
- virtual FX_BOOL OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag);
- virtual void KillFocus();
-
- virtual void OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam = 0, FX_INTPTR lParam = 0);
- virtual void RePosChildWnd();
- virtual void SetText(FX_LPCWSTR csText,FX_BOOL bRefresh = TRUE);
- virtual CFX_WideString GetText() const;
- virtual CPDF_Rect GetFocusRect() const;
- virtual void SetFontSize(FX_FLOAT fFontSize);
- virtual FX_FLOAT GetFontSize() const;
-
- void OnNotifySelChanged(FX_BOOL bKeyDown, FX_BOOL & bExit , FX_DWORD nFlag);
-
- void AddString(FX_LPCWSTR string);
- void SetTopVisibleIndex(FX_INT32 nItemIndex);
- void ScrollToListItem(FX_INT32 nItemIndex);
- void ResetContent();
- void Reset();
- void Select(FX_INT32 nItemIndex);
- void SetCaret(FX_INT32 nItemIndex);
- void SetHoverSel(FX_BOOL bHoverSel);
-
- FX_INT32 GetCount() const;
- FX_BOOL IsMultipleSel() const;
- FX_INT32 GetCaretIndex() const;
- FX_INT32 GetCurSel() const;
- FX_BOOL IsItemSelected(FX_INT32 nItemIndex) const;
- FX_INT32 GetTopVisibleIndex() const;
- FX_INT32 FindNext(FX_INT32 nIndex,FX_WCHAR nChar) const;
- CPDF_Rect GetContentRect() const;
- FX_FLOAT GetFirstHeight() const;
- CPDF_Rect GetListRect() const;
-
- void SetFillerNotify(IPWL_Filler_Notify* pNotify) {m_pFillerNotify = pNotify;}
-
-protected:
- IFX_List* m_pList;
- CPWL_List_Notify* m_pListNotify;
- FX_BOOL m_bMouseDown;
- FX_BOOL m_bHoverSel;
- IPWL_Filler_Notify* m_pFillerNotify;
-public:
- void AttachFFLData(void* pData) {m_pFormFiller = pData;}
-private:
- void* m_pFormFiller;
-};
-
-#endif // !defined(AFX_PWL_LISTBOX_H__F8C0DD72_CC3C_4806_86FB_E9D02B04A34B__INCLUDED_)
-
-
+// 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 _PWL_LISTBOX_H_
+#define _PWL_LISTBOX_H_
+
+class CPDF_ListCtrl;
+class CPWL_List_Notify;
+class CPWL_ListBox;
+class IPWL_Filler_Notify;
+
+class CPWL_List_Notify : public IFX_List_Notify
+{
+public:
+ CPWL_List_Notify(CPWL_ListBox * pList);
+ virtual ~CPWL_List_Notify();
+
+ void IOnSetScrollInfoX(FX_FLOAT fPlateMin, FX_FLOAT fPlateMax,
+ FX_FLOAT fContentMin, FX_FLOAT fContentMax,
+ FX_FLOAT fSmallStep, FX_FLOAT fBigStep){}
+ void IOnSetScrollInfoY(FX_FLOAT fPlateMin, FX_FLOAT fPlateMax,
+ FX_FLOAT fContentMin, FX_FLOAT fContentMax,
+ FX_FLOAT fSmallStep, FX_FLOAT fBigStep);
+ void IOnSetScrollPosX(FX_FLOAT fx){}
+ void IOnSetScrollPosY(FX_FLOAT fy);
+ void IOnSetCaret(FX_BOOL bVisible,const CPDF_Point & ptHead,const CPDF_Point & ptFoot, const CPVT_WordPlace& place);
+ void IOnCaretChange(const CPVT_SecProps & secProps, const CPVT_WordProps & wordProps);
+ void IOnInvalidateRect(CPDF_Rect * pRect);
+
+private:
+ CPWL_ListBox* m_pList;
+};
+
+class PWL_CLASS CPWL_ListBox : public CPWL_Wnd
+{
+public:
+ CPWL_ListBox();
+ virtual ~CPWL_ListBox();
+
+ virtual CFX_ByteString GetClassName() const;
+ virtual void OnCreated();
+ virtual void OnDestroy();
+ virtual void GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream);
+ virtual void DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device);
+
+ virtual FX_BOOL OnKeyDown(FX_WORD nChar, FX_DWORD nFlag);
+ virtual FX_BOOL OnChar(FX_WORD nChar, FX_DWORD nFlag);
+ virtual FX_BOOL OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag);
+ virtual void KillFocus();
+
+ virtual void OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam = 0, FX_INTPTR lParam = 0);
+ virtual void RePosChildWnd();
+ virtual void SetText(FX_LPCWSTR csText,FX_BOOL bRefresh = TRUE);
+ virtual CFX_WideString GetText() const;
+ virtual CPDF_Rect GetFocusRect() const;
+ virtual void SetFontSize(FX_FLOAT fFontSize);
+ virtual FX_FLOAT GetFontSize() const;
+
+ void OnNotifySelChanged(FX_BOOL bKeyDown, FX_BOOL & bExit , FX_DWORD nFlag);
+
+ void AddString(FX_LPCWSTR string);
+ void SetTopVisibleIndex(FX_INT32 nItemIndex);
+ void ScrollToListItem(FX_INT32 nItemIndex);
+ void ResetContent();
+ void Reset();
+ void Select(FX_INT32 nItemIndex);
+ void SetCaret(FX_INT32 nItemIndex);
+ void SetHoverSel(FX_BOOL bHoverSel);
+
+ FX_INT32 GetCount() const;
+ FX_BOOL IsMultipleSel() const;
+ FX_INT32 GetCaretIndex() const;
+ FX_INT32 GetCurSel() const;
+ FX_BOOL IsItemSelected(FX_INT32 nItemIndex) const;
+ FX_INT32 GetTopVisibleIndex() const;
+ FX_INT32 FindNext(FX_INT32 nIndex,FX_WCHAR nChar) const;
+ CPDF_Rect GetContentRect() const;
+ FX_FLOAT GetFirstHeight() const;
+ CPDF_Rect GetListRect() const;
+
+ void SetFillerNotify(IPWL_Filler_Notify* pNotify) {m_pFillerNotify = pNotify;}
+
+protected:
+ IFX_List* m_pList;
+ CPWL_List_Notify* m_pListNotify;
+ FX_BOOL m_bMouseDown;
+ FX_BOOL m_bHoverSel;
+ IPWL_Filler_Notify* m_pFillerNotify;
+public:
+ void AttachFFLData(void* pData) {m_pFormFiller = pData;}
+private:
+ void* m_pFormFiller;
+};
+
+#endif // !defined(AFX_PWL_LISTBOX_H__F8C0DD72_CC3C_4806_86FB_E9D02B04A34B__INCLUDED_)
+
+
diff --git a/fpdfsdk/include/pdfwindow/PWL_ListCtrl.h b/fpdfsdk/include/pdfwindow/PWL_ListCtrl.h
index 3a3b922e68..8997296f95 100644
--- a/fpdfsdk/include/pdfwindow/PWL_ListCtrl.h
+++ b/fpdfsdk/include/pdfwindow/PWL_ListCtrl.h
@@ -1,53 +1,53 @@
-// 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 _PWL_LISTCTRL_H_
-#define _PWL_LISTCTRL_H_
-
-class CPWL_ListCtrl;
-
-class CPWL_ListCtrl : public CPWL_Wnd
-{
-public:
- CPWL_ListCtrl();
- virtual ~CPWL_ListCtrl();
-
-public:
- void SetScrollPos(const CPDF_Point& point);
- CPDF_Point GetScrollPos() const;
- CPDF_Rect GetScrollArea() const;
-
- void SetItemSpace(FX_FLOAT fSpace);
- void SetTopSpace(FX_FLOAT fSpace);
- void SetBottomSpace(FX_FLOAT fSpace);
- void ResetFace();
- void ResetContent(FX_INT32 nStart);
- FX_INT32 GetItemIndex(CPWL_Wnd* pItem);
- FX_FLOAT GetContentsHeight(FX_FLOAT fLimitWidth);
-
-protected:
- virtual void RePosChildWnd();
- virtual void DrawChildAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device);
-
-public:
- CPDF_Point InToOut(const CPDF_Point& point) const;
- CPDF_Point OutToIn(const CPDF_Point& point) const;
- CPDF_Rect InToOut(const CPDF_Rect& rect) const;
- CPDF_Rect OutToIn(const CPDF_Rect& rect) const;
-
-private:
- void ResetAll(FX_BOOL bMove,FX_INT32 nStart);
-
-private:
- CPDF_Rect m_rcContent;
- CPDF_Point m_ptScroll;
- FX_FLOAT m_fItemSpace;
- FX_FLOAT m_fTopSpace;
- FX_FLOAT m_fBottomSpace;
-};
-
-#endif
-
+// 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 _PWL_LISTCTRL_H_
+#define _PWL_LISTCTRL_H_
+
+class CPWL_ListCtrl;
+
+class CPWL_ListCtrl : public CPWL_Wnd
+{
+public:
+ CPWL_ListCtrl();
+ virtual ~CPWL_ListCtrl();
+
+public:
+ void SetScrollPos(const CPDF_Point& point);
+ CPDF_Point GetScrollPos() const;
+ CPDF_Rect GetScrollArea() const;
+
+ void SetItemSpace(FX_FLOAT fSpace);
+ void SetTopSpace(FX_FLOAT fSpace);
+ void SetBottomSpace(FX_FLOAT fSpace);
+ void ResetFace();
+ void ResetContent(FX_INT32 nStart);
+ FX_INT32 GetItemIndex(CPWL_Wnd* pItem);
+ FX_FLOAT GetContentsHeight(FX_FLOAT fLimitWidth);
+
+protected:
+ virtual void RePosChildWnd();
+ virtual void DrawChildAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device);
+
+public:
+ CPDF_Point InToOut(const CPDF_Point& point) const;
+ CPDF_Point OutToIn(const CPDF_Point& point) const;
+ CPDF_Rect InToOut(const CPDF_Rect& rect) const;
+ CPDF_Rect OutToIn(const CPDF_Rect& rect) const;
+
+private:
+ void ResetAll(FX_BOOL bMove,FX_INT32 nStart);
+
+private:
+ CPDF_Rect m_rcContent;
+ CPDF_Point m_ptScroll;
+ FX_FLOAT m_fItemSpace;
+ FX_FLOAT m_fTopSpace;
+ FX_FLOAT m_fBottomSpace;
+};
+
+#endif
+
diff --git a/fpdfsdk/include/pdfwindow/PWL_Note.h b/fpdfsdk/include/pdfwindow/PWL_Note.h
index 89308e63e4..7cc9e04ba9 100644
--- a/fpdfsdk/include/pdfwindow/PWL_Note.h
+++ b/fpdfsdk/include/pdfwindow/PWL_Note.h
@@ -1,355 +1,355 @@
-// 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 _PWL_NOTE_H_
-#define _PWL_NOTE_H_
-
-class IPWL_NoteNotify;
-class IPWL_NoteHandler;
-class IPWL_NoteItem;
-class CPWL_NoteItem;
-class CPWL_Note;
-class CPWL_Label;
-class CPWL_Edit;
-class CPWL_Note_Icon;
-class CPWL_Note_CloseBox;
-class CPWL_Note_LBBox;
-class CPWL_Note_RBBox;
-class CPWL_Note_Edit;
-class CPWL_Note_Options;
-class CPWL_Note_Contents;
-class IPopup_Note;
-
-
-class IPWL_NoteNotify
-{
-public:
- virtual void OnNoteMove(const FX_RECT& rtWin) = 0;
- virtual void OnNoteShow(FX_BOOL bShow) = 0;
- virtual void OnNoteActivate(FX_BOOL bActive) = 0;
- virtual void OnNoteClose() = 0;
- virtual void OnItemCreate(IPWL_NoteItem* pItem) = 0;
- virtual void OnItemDelete(IPWL_NoteItem* pItem) = 0;
- virtual void OnSetAuthorName(IPWL_NoteItem* pItem) = 0;
- virtual void OnSetBkColor(IPWL_NoteItem* pItem) = 0;
- virtual void OnSetContents(IPWL_NoteItem* pItem) = 0;
- virtual void OnSetDateTime(IPWL_NoteItem* pItem) = 0;
- virtual void OnSetSubjectName(IPWL_NoteItem* pItem) = 0;
- virtual void OnPopupMenu(FX_INT32 x, FX_INT32 y) = 0;
- virtual void OnPopupMenu(IPWL_NoteItem* pItem, FX_INT32 x, FX_INT32 y) = 0;
-};
-
-class IPWL_NoteHandler
-{
-public:
- virtual void OnNoteColorChanged(const CPWL_Color& color) = 0;
-};
-
-class IPWL_NoteItem
-{
-public:
- virtual void SetPrivateData(void* pData) = 0;
- virtual void SetBkColor(const CPWL_Color& color) = 0;
- virtual void SetSubjectName(const CFX_WideString& sName) = 0;
- virtual void SetAuthorName(const CFX_WideString& sName) = 0;
- virtual void SetDateTime(FX_SYSTEMTIME time) = 0;
- virtual void SetContents(const CFX_WideString& sContents) = 0;
-
- virtual IPWL_NoteItem* CreateSubItem() = 0;
- virtual FX_INT32 CountSubItems() const = 0;
- virtual IPWL_NoteItem* GetSubItems(FX_INT32 index) const = 0;
- virtual void DeleteSubItem(IPWL_NoteItem* pNoteItem) = 0;
- virtual void SetFocus() = 0;
-
- virtual IPWL_NoteItem* GetParentItem() const = 0;
- virtual void* GetPrivateData() const = 0;
- virtual CFX_WideString GetAuthorName() const = 0;
- virtual CPWL_Color GetBkColor() const = 0;
- virtual CFX_WideString GetContents() const = 0;
- virtual FX_SYSTEMTIME GetDateTime() const = 0;
- virtual CFX_WideString GetSubjectName() const = 0;
-
- virtual CPWL_Edit* GetEdit() const = 0;
-};
-
-class PWL_CLASS CPWL_Note_Icon : public CPWL_Wnd
-{
-public:
- CPWL_Note_Icon();
- virtual ~CPWL_Note_Icon();
-
- void SetIconType(FX_INT32 nType);
-
-public:
-
-protected:
- virtual void DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device);
-
-private:
- FX_INT32 m_nType;
-};
-
-class CPWL_Note_CloseBox : public CPWL_Button
-{
-public:
- CPWL_Note_CloseBox();
- virtual ~CPWL_Note_CloseBox();
-
-protected:
- virtual void DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device);
- virtual FX_BOOL OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag);
- virtual FX_BOOL OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
-
-private:
- FX_BOOL m_bMouseDown;
-};
-
-class CPWL_Note_LBBox : public CPWL_Wnd
-{
-public:
- CPWL_Note_LBBox();
- virtual ~CPWL_Note_LBBox();
-
-protected:
- virtual void DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device);
-};
-
-class CPWL_Note_RBBox : public CPWL_Wnd
-{
-public:
- CPWL_Note_RBBox();
- virtual ~CPWL_Note_RBBox();
-
-protected:
- virtual void DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device);
-};
-
-class CPWL_Note_Edit : public CPWL_Edit
-{
-public:
- CPWL_Note_Edit();
- virtual ~CPWL_Note_Edit();
-
- void EnableNotify(FX_BOOL bEnable) {m_bEnableNotify = bEnable;}
- virtual FX_FLOAT GetItemHeight(FX_FLOAT fLimitWidth);
- FX_FLOAT GetItemLeftMargin();
- FX_FLOAT GetItemRightMargin();
-
- virtual void SetText(FX_LPCWSTR csText);
-
-protected:
- virtual void OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam = 0, FX_INTPTR lParam = 0);
- virtual void RePosChildWnd();
- virtual void OnSetFocus();
- virtual void OnKillFocus();
-
-private:
- FX_BOOL m_bEnableNotify;
- FX_FLOAT m_fOldItemHeight;
- FX_BOOL m_bSizeChanged;
- FX_FLOAT m_fOldMin;
- FX_FLOAT m_fOldMax;
-};
-
-class CPWL_Note_Options : public CPWL_Wnd
-{
-public:
- CPWL_Note_Options();
- virtual ~CPWL_Note_Options();
-
- CPDF_Rect GetContentRect() const;
- virtual void SetTextColor(const CPWL_Color & color);
- void SetText(const CFX_WideString& sText);
-
-protected:
- virtual void RePosChildWnd();
- virtual void CreateChildWnd(const PWL_CREATEPARAM & cp);
- virtual void DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device);
-
-private:
- CPWL_Label* m_pText;
-};
-
-class CPWL_Note_Contents : public CPWL_ListCtrl
-{
-public:
- CPWL_Note_Contents();
- virtual ~CPWL_Note_Contents();
-
- virtual CFX_ByteString GetClassName() const;
- virtual void OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam = 0, FX_INTPTR lParam = 0);
- virtual FX_BOOL OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag);
-
- void SetEditFocus(FX_BOOL bLast);
- CPWL_Edit* GetEdit() const;
-
-public:
- void SetText(const CFX_WideString& sText);
- CFX_WideString GetText() const;
-
- CPWL_NoteItem* CreateSubItem();
- void DeleteSubItem(IPWL_NoteItem* pNoteItem);
- FX_INT32 CountSubItems() const;
- IPWL_NoteItem* GetSubItems(FX_INT32 index) const;
-
- virtual IPWL_NoteItem* GetHitNoteItem(const CPDF_Point& point);
- void EnableRead(FX_BOOL bEnabled);
- void EnableModify(FX_BOOL bEnabled);
-
-protected:
- virtual void CreateChildWnd(const PWL_CREATEPARAM & cp);
-
-private:
- CPWL_Note_Edit* m_pEdit;
-};
-
-class PWL_CLASS CPWL_NoteItem : public CPWL_Wnd, public IPWL_NoteItem
-{
-public:
- CPWL_NoteItem();
- virtual ~CPWL_NoteItem();
-
-public:
- virtual void SetPrivateData(void* pData);
- virtual void SetBkColor(const CPWL_Color& color);
- virtual void SetSubjectName(const CFX_WideString& sName);
- virtual void SetAuthorName(const CFX_WideString& sName);
- virtual void SetDateTime(FX_SYSTEMTIME time);
- virtual void SetContents(const CFX_WideString& sContents);
-
- virtual IPWL_NoteItem* CreateSubItem();
- virtual FX_INT32 CountSubItems() const;
- virtual IPWL_NoteItem* GetSubItems(FX_INT32 index) const;
- virtual void DeleteSubItem(IPWL_NoteItem* pNoteItem);
- virtual void SetFocus(){SetNoteFocus(FALSE);}
-
- virtual IPWL_NoteItem* GetParentItem() const;
- virtual void* GetPrivateData() const;
- virtual CFX_WideString GetAuthorName() const;
- virtual CPWL_Color GetBkColor() const;
- virtual CFX_WideString GetContents() const;
- virtual FX_SYSTEMTIME GetDateTime() const;
- virtual CFX_WideString GetSubjectName() const;
- virtual FX_BOOL IsTopItem() const { return FALSE;}
- virtual CPWL_Edit* GetEdit() const;
-
-public:
- virtual FX_BOOL OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag);
- virtual FX_BOOL OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
- virtual CFX_ByteString GetClassName() const;
- virtual IPWL_NoteItem* GetHitNoteItem(const CPDF_Point& point);
- virtual IPWL_NoteItem* GetFocusedNoteItem() const;
-
- virtual void ResetSubjectName(FX_INT32 nItemIndex);
- void EnableRead(FX_BOOL bEnabled);
- void EnableModify(FX_BOOL bEnabled);
-
-protected:
- virtual void RePosChildWnd();
- virtual void CreateChildWnd(const PWL_CREATEPARAM & cp);
-
- virtual void OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam = 0, FX_INTPTR lParam = 0);
-
-public:
- virtual FX_FLOAT GetItemHeight(FX_FLOAT fLimitWidth);
- virtual FX_FLOAT GetItemLeftMargin();
- virtual FX_FLOAT GetItemRightMargin();
- CPWL_NoteItem* CreateNoteItem();
- CPWL_NoteItem* GetParentNoteItem() const;
-
- void SetNoteFocus(FX_BOOL bLast);
- void OnContentsValidate();
-
- void OnCreateNoteItem();
-
-protected:
- void PopupNoteItemMenu(const CPDF_Point& point);
-
- virtual const CPWL_Note* GetNote() const;
- virtual IPWL_NoteNotify* GetNoteNotify() const;
-
-protected:
- CPWL_Label* m_pSubject;
- CPWL_Label* m_pDateTime;
- CPWL_Note_Contents* m_pContents;
-
-private:
- void* m_pPrivateData;
- FX_SYSTEMTIME m_dtNote;
- CFX_WideString m_sAuthor;
-
- FX_FLOAT m_fOldItemHeight;
- FX_BOOL m_bSizeChanged;
- FX_BOOL m_bAllowModify;
-};
-
-class PWL_CLASS CPWL_Note : public CPWL_NoteItem
-{
-public:
- CPWL_Note(IPopup_Note* pPopupNote, IPWL_NoteNotify* pNoteNotify, IPWL_NoteHandler* pNoteHandler);
- virtual ~CPWL_Note();
-
-public:
- virtual void SetSubjectName(const CFX_WideString& sName);
- virtual void SetAuthorName(const CFX_WideString& sName);
- virtual CFX_WideString GetAuthorName() const;
- virtual void SetBkColor(const CPWL_Color& color);
- virtual void ResetSubjectName(FX_INT32 nItemIndex){}
- virtual FX_BOOL IsTopItem() const {return TRUE;}
- virtual const CPWL_Note* GetNote() const;
- virtual IPWL_NoteNotify* GetNoteNotify() const;
-
-public:
- IPWL_NoteItem* Reply();
- void EnableNotify(FX_BOOL bEnabled);
- void SetIconType(FX_INT32 nType);
- void SetOptionsText(const CFX_WideString& sText);
- void EnableRead(FX_BOOL bEnabled);
- void EnableModify(FX_BOOL bEnabled);
-
- CFX_WideString GetReplyString() const;
- void SetReplyString(const CFX_WideString& string);
-
- //0-normal / 1-caption / 2-leftbottom corner / 3-rightbottom corner / 4-close / 5-options
- FX_INT32 NoteHitTest(const CPDF_Point& point) const;
- CPDF_Rect GetCaptionRect() const {return m_rcCaption;}
- IPopup_Note* GetPopupNote() const {return m_pPopupNote;}
-
-public:
- virtual FX_BOOL OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag);
- virtual FX_BOOL OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
- virtual FX_BOOL OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag);
-
-protected:
- virtual void RePosChildWnd();
- virtual void CreateChildWnd(const PWL_CREATEPARAM & cp);
-
- virtual void OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam = 0, FX_INTPTR lParam = 0);
-
- FX_BOOL ResetScrollBar();
- void RePosNoteChildren();
- FX_BOOL ScrollBarShouldVisible();
-
-private:
- CPWL_Label* m_pAuthor;
- CPWL_Note_Icon* m_pIcon;
- CPWL_Note_CloseBox* m_pCloseBox;
- CPWL_Note_LBBox* m_pLBBox;
- CPWL_Note_RBBox* m_pRBBox;
- CPWL_ScrollBar* m_pContentsBar;
- CPWL_Note_Options* m_pOptions;
- IPWL_NoteNotify* m_pNoteNotify;
- FX_BOOL m_bResizing;
- PWL_SCROLL_INFO m_OldScrollInfo;
- CPDF_Rect m_rcCaption;
- FX_BOOL m_bEnalbleNotify;
- IPopup_Note* m_pPopupNote;
- IPWL_NoteHandler* m_pNoteHandler;
- CFX_WideString m_sReplyString;
-};
-
-#endif
-
+// 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 _PWL_NOTE_H_
+#define _PWL_NOTE_H_
+
+class IPWL_NoteNotify;
+class IPWL_NoteHandler;
+class IPWL_NoteItem;
+class CPWL_NoteItem;
+class CPWL_Note;
+class CPWL_Label;
+class CPWL_Edit;
+class CPWL_Note_Icon;
+class CPWL_Note_CloseBox;
+class CPWL_Note_LBBox;
+class CPWL_Note_RBBox;
+class CPWL_Note_Edit;
+class CPWL_Note_Options;
+class CPWL_Note_Contents;
+class IPopup_Note;
+
+
+class IPWL_NoteNotify
+{
+public:
+ virtual void OnNoteMove(const FX_RECT& rtWin) = 0;
+ virtual void OnNoteShow(FX_BOOL bShow) = 0;
+ virtual void OnNoteActivate(FX_BOOL bActive) = 0;
+ virtual void OnNoteClose() = 0;
+ virtual void OnItemCreate(IPWL_NoteItem* pItem) = 0;
+ virtual void OnItemDelete(IPWL_NoteItem* pItem) = 0;
+ virtual void OnSetAuthorName(IPWL_NoteItem* pItem) = 0;
+ virtual void OnSetBkColor(IPWL_NoteItem* pItem) = 0;
+ virtual void OnSetContents(IPWL_NoteItem* pItem) = 0;
+ virtual void OnSetDateTime(IPWL_NoteItem* pItem) = 0;
+ virtual void OnSetSubjectName(IPWL_NoteItem* pItem) = 0;
+ virtual void OnPopupMenu(FX_INT32 x, FX_INT32 y) = 0;
+ virtual void OnPopupMenu(IPWL_NoteItem* pItem, FX_INT32 x, FX_INT32 y) = 0;
+};
+
+class IPWL_NoteHandler
+{
+public:
+ virtual void OnNoteColorChanged(const CPWL_Color& color) = 0;
+};
+
+class IPWL_NoteItem
+{
+public:
+ virtual void SetPrivateData(void* pData) = 0;
+ virtual void SetBkColor(const CPWL_Color& color) = 0;
+ virtual void SetSubjectName(const CFX_WideString& sName) = 0;
+ virtual void SetAuthorName(const CFX_WideString& sName) = 0;
+ virtual void SetDateTime(FX_SYSTEMTIME time) = 0;
+ virtual void SetContents(const CFX_WideString& sContents) = 0;
+
+ virtual IPWL_NoteItem* CreateSubItem() = 0;
+ virtual FX_INT32 CountSubItems() const = 0;
+ virtual IPWL_NoteItem* GetSubItems(FX_INT32 index) const = 0;
+ virtual void DeleteSubItem(IPWL_NoteItem* pNoteItem) = 0;
+ virtual void SetFocus() = 0;
+
+ virtual IPWL_NoteItem* GetParentItem() const = 0;
+ virtual void* GetPrivateData() const = 0;
+ virtual CFX_WideString GetAuthorName() const = 0;
+ virtual CPWL_Color GetBkColor() const = 0;
+ virtual CFX_WideString GetContents() const = 0;
+ virtual FX_SYSTEMTIME GetDateTime() const = 0;
+ virtual CFX_WideString GetSubjectName() const = 0;
+
+ virtual CPWL_Edit* GetEdit() const = 0;
+};
+
+class PWL_CLASS CPWL_Note_Icon : public CPWL_Wnd
+{
+public:
+ CPWL_Note_Icon();
+ virtual ~CPWL_Note_Icon();
+
+ void SetIconType(FX_INT32 nType);
+
+public:
+
+protected:
+ virtual void DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device);
+
+private:
+ FX_INT32 m_nType;
+};
+
+class CPWL_Note_CloseBox : public CPWL_Button
+{
+public:
+ CPWL_Note_CloseBox();
+ virtual ~CPWL_Note_CloseBox();
+
+protected:
+ virtual void DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device);
+ virtual FX_BOOL OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
+
+private:
+ FX_BOOL m_bMouseDown;
+};
+
+class CPWL_Note_LBBox : public CPWL_Wnd
+{
+public:
+ CPWL_Note_LBBox();
+ virtual ~CPWL_Note_LBBox();
+
+protected:
+ virtual void DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device);
+};
+
+class CPWL_Note_RBBox : public CPWL_Wnd
+{
+public:
+ CPWL_Note_RBBox();
+ virtual ~CPWL_Note_RBBox();
+
+protected:
+ virtual void DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device);
+};
+
+class CPWL_Note_Edit : public CPWL_Edit
+{
+public:
+ CPWL_Note_Edit();
+ virtual ~CPWL_Note_Edit();
+
+ void EnableNotify(FX_BOOL bEnable) {m_bEnableNotify = bEnable;}
+ virtual FX_FLOAT GetItemHeight(FX_FLOAT fLimitWidth);
+ FX_FLOAT GetItemLeftMargin();
+ FX_FLOAT GetItemRightMargin();
+
+ virtual void SetText(FX_LPCWSTR csText);
+
+protected:
+ virtual void OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam = 0, FX_INTPTR lParam = 0);
+ virtual void RePosChildWnd();
+ virtual void OnSetFocus();
+ virtual void OnKillFocus();
+
+private:
+ FX_BOOL m_bEnableNotify;
+ FX_FLOAT m_fOldItemHeight;
+ FX_BOOL m_bSizeChanged;
+ FX_FLOAT m_fOldMin;
+ FX_FLOAT m_fOldMax;
+};
+
+class CPWL_Note_Options : public CPWL_Wnd
+{
+public:
+ CPWL_Note_Options();
+ virtual ~CPWL_Note_Options();
+
+ CPDF_Rect GetContentRect() const;
+ virtual void SetTextColor(const CPWL_Color & color);
+ void SetText(const CFX_WideString& sText);
+
+protected:
+ virtual void RePosChildWnd();
+ virtual void CreateChildWnd(const PWL_CREATEPARAM & cp);
+ virtual void DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device);
+
+private:
+ CPWL_Label* m_pText;
+};
+
+class CPWL_Note_Contents : public CPWL_ListCtrl
+{
+public:
+ CPWL_Note_Contents();
+ virtual ~CPWL_Note_Contents();
+
+ virtual CFX_ByteString GetClassName() const;
+ virtual void OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam = 0, FX_INTPTR lParam = 0);
+ virtual FX_BOOL OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag);
+
+ void SetEditFocus(FX_BOOL bLast);
+ CPWL_Edit* GetEdit() const;
+
+public:
+ void SetText(const CFX_WideString& sText);
+ CFX_WideString GetText() const;
+
+ CPWL_NoteItem* CreateSubItem();
+ void DeleteSubItem(IPWL_NoteItem* pNoteItem);
+ FX_INT32 CountSubItems() const;
+ IPWL_NoteItem* GetSubItems(FX_INT32 index) const;
+
+ virtual IPWL_NoteItem* GetHitNoteItem(const CPDF_Point& point);
+ void EnableRead(FX_BOOL bEnabled);
+ void EnableModify(FX_BOOL bEnabled);
+
+protected:
+ virtual void CreateChildWnd(const PWL_CREATEPARAM & cp);
+
+private:
+ CPWL_Note_Edit* m_pEdit;
+};
+
+class PWL_CLASS CPWL_NoteItem : public CPWL_Wnd, public IPWL_NoteItem
+{
+public:
+ CPWL_NoteItem();
+ virtual ~CPWL_NoteItem();
+
+public:
+ virtual void SetPrivateData(void* pData);
+ virtual void SetBkColor(const CPWL_Color& color);
+ virtual void SetSubjectName(const CFX_WideString& sName);
+ virtual void SetAuthorName(const CFX_WideString& sName);
+ virtual void SetDateTime(FX_SYSTEMTIME time);
+ virtual void SetContents(const CFX_WideString& sContents);
+
+ virtual IPWL_NoteItem* CreateSubItem();
+ virtual FX_INT32 CountSubItems() const;
+ virtual IPWL_NoteItem* GetSubItems(FX_INT32 index) const;
+ virtual void DeleteSubItem(IPWL_NoteItem* pNoteItem);
+ virtual void SetFocus(){SetNoteFocus(FALSE);}
+
+ virtual IPWL_NoteItem* GetParentItem() const;
+ virtual void* GetPrivateData() const;
+ virtual CFX_WideString GetAuthorName() const;
+ virtual CPWL_Color GetBkColor() const;
+ virtual CFX_WideString GetContents() const;
+ virtual FX_SYSTEMTIME GetDateTime() const;
+ virtual CFX_WideString GetSubjectName() const;
+ virtual FX_BOOL IsTopItem() const { return FALSE;}
+ virtual CPWL_Edit* GetEdit() const;
+
+public:
+ virtual FX_BOOL OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag);
+ virtual FX_BOOL OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual CFX_ByteString GetClassName() const;
+ virtual IPWL_NoteItem* GetHitNoteItem(const CPDF_Point& point);
+ virtual IPWL_NoteItem* GetFocusedNoteItem() const;
+
+ virtual void ResetSubjectName(FX_INT32 nItemIndex);
+ void EnableRead(FX_BOOL bEnabled);
+ void EnableModify(FX_BOOL bEnabled);
+
+protected:
+ virtual void RePosChildWnd();
+ virtual void CreateChildWnd(const PWL_CREATEPARAM & cp);
+
+ virtual void OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam = 0, FX_INTPTR lParam = 0);
+
+public:
+ virtual FX_FLOAT GetItemHeight(FX_FLOAT fLimitWidth);
+ virtual FX_FLOAT GetItemLeftMargin();
+ virtual FX_FLOAT GetItemRightMargin();
+ CPWL_NoteItem* CreateNoteItem();
+ CPWL_NoteItem* GetParentNoteItem() const;
+
+ void SetNoteFocus(FX_BOOL bLast);
+ void OnContentsValidate();
+
+ void OnCreateNoteItem();
+
+protected:
+ void PopupNoteItemMenu(const CPDF_Point& point);
+
+ virtual const CPWL_Note* GetNote() const;
+ virtual IPWL_NoteNotify* GetNoteNotify() const;
+
+protected:
+ CPWL_Label* m_pSubject;
+ CPWL_Label* m_pDateTime;
+ CPWL_Note_Contents* m_pContents;
+
+private:
+ void* m_pPrivateData;
+ FX_SYSTEMTIME m_dtNote;
+ CFX_WideString m_sAuthor;
+
+ FX_FLOAT m_fOldItemHeight;
+ FX_BOOL m_bSizeChanged;
+ FX_BOOL m_bAllowModify;
+};
+
+class PWL_CLASS CPWL_Note : public CPWL_NoteItem
+{
+public:
+ CPWL_Note(IPopup_Note* pPopupNote, IPWL_NoteNotify* pNoteNotify, IPWL_NoteHandler* pNoteHandler);
+ virtual ~CPWL_Note();
+
+public:
+ virtual void SetSubjectName(const CFX_WideString& sName);
+ virtual void SetAuthorName(const CFX_WideString& sName);
+ virtual CFX_WideString GetAuthorName() const;
+ virtual void SetBkColor(const CPWL_Color& color);
+ virtual void ResetSubjectName(FX_INT32 nItemIndex){}
+ virtual FX_BOOL IsTopItem() const {return TRUE;}
+ virtual const CPWL_Note* GetNote() const;
+ virtual IPWL_NoteNotify* GetNoteNotify() const;
+
+public:
+ IPWL_NoteItem* Reply();
+ void EnableNotify(FX_BOOL bEnabled);
+ void SetIconType(FX_INT32 nType);
+ void SetOptionsText(const CFX_WideString& sText);
+ void EnableRead(FX_BOOL bEnabled);
+ void EnableModify(FX_BOOL bEnabled);
+
+ CFX_WideString GetReplyString() const;
+ void SetReplyString(const CFX_WideString& string);
+
+ //0-normal / 1-caption / 2-leftbottom corner / 3-rightbottom corner / 4-close / 5-options
+ FX_INT32 NoteHitTest(const CPDF_Point& point) const;
+ CPDF_Rect GetCaptionRect() const {return m_rcCaption;}
+ IPopup_Note* GetPopupNote() const {return m_pPopupNote;}
+
+public:
+ virtual FX_BOOL OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag);
+
+protected:
+ virtual void RePosChildWnd();
+ virtual void CreateChildWnd(const PWL_CREATEPARAM & cp);
+
+ virtual void OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam = 0, FX_INTPTR lParam = 0);
+
+ FX_BOOL ResetScrollBar();
+ void RePosNoteChildren();
+ FX_BOOL ScrollBarShouldVisible();
+
+private:
+ CPWL_Label* m_pAuthor;
+ CPWL_Note_Icon* m_pIcon;
+ CPWL_Note_CloseBox* m_pCloseBox;
+ CPWL_Note_LBBox* m_pLBBox;
+ CPWL_Note_RBBox* m_pRBBox;
+ CPWL_ScrollBar* m_pContentsBar;
+ CPWL_Note_Options* m_pOptions;
+ IPWL_NoteNotify* m_pNoteNotify;
+ FX_BOOL m_bResizing;
+ PWL_SCROLL_INFO m_OldScrollInfo;
+ CPDF_Rect m_rcCaption;
+ FX_BOOL m_bEnalbleNotify;
+ IPopup_Note* m_pPopupNote;
+ IPWL_NoteHandler* m_pNoteHandler;
+ CFX_WideString m_sReplyString;
+};
+
+#endif
+
diff --git a/fpdfsdk/include/pdfwindow/PWL_ScrollBar.h b/fpdfsdk/include/pdfwindow/PWL_ScrollBar.h
index 3196b2209e..d256542b0e 100644
--- a/fpdfsdk/include/pdfwindow/PWL_ScrollBar.h
+++ b/fpdfsdk/include/pdfwindow/PWL_ScrollBar.h
@@ -1,166 +1,166 @@
-// 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 _PWL_SCROLLBAR_H_
-#define _PWL_SCROLLBAR_H_
-
-class CPWL_SBButton;
-class CPWL_ScrollBar;
-
-struct PWL_SCROLL_INFO
-{
-public:
- PWL_SCROLL_INFO() : fContentMin(0.0f), fContentMax(0.0f), fPlateWidth(0.0f), fBigStep(0.0f), fSmallStep(0.0f)
- {
- }
- FX_FLOAT fContentMin;
- FX_FLOAT fContentMax;
- FX_FLOAT fPlateWidth;
- FX_FLOAT fBigStep;
- FX_FLOAT fSmallStep;
-};
-
-enum PWL_SCROLLBAR_TYPE
-{
- SBT_HSCROLL,
- SBT_VSCROLL
-};
-
-enum PWL_SBBUTTON_TYPE
-{
- PSBT_MIN,
- PSBT_MAX,
- PSBT_POS
-};
-
-class CPWL_SBButton : public CPWL_Wnd
-{
-public:
- CPWL_SBButton(PWL_SCROLLBAR_TYPE eScrollBarType,PWL_SBBUTTON_TYPE eButtonType);
- virtual ~CPWL_SBButton();
-
-public:
- virtual CFX_ByteString GetClassName() const;
- virtual void OnCreate(PWL_CREATEPARAM & cp);
- virtual void GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream);
- virtual void DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device);
- virtual FX_BOOL OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag);
- virtual FX_BOOL OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
- virtual FX_BOOL OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag);
-
-protected:
- PWL_SCROLLBAR_TYPE m_eScrollBarType;
- PWL_SBBUTTON_TYPE m_eSBButtonType;
-
- FX_BOOL m_bMouseDown;
-};
-
-struct PWL_FLOATRANGE
-{
-public:
- PWL_FLOATRANGE();
- PWL_FLOATRANGE(FX_FLOAT min,FX_FLOAT max);
- void Default();
- void Set(FX_FLOAT min,FX_FLOAT max);
- FX_BOOL In(FX_FLOAT x) const;
- FX_FLOAT GetWidth() const;
-
- FX_FLOAT fMin,fMax;
-};
-
-struct PWL_SCROLL_PRIVATEDATA
-{
-public:
- PWL_SCROLL_PRIVATEDATA();
-
- void Default();
- void SetScrollRange(FX_FLOAT min,FX_FLOAT max);
- void SetClientWidth(FX_FLOAT width);
- void SetSmallStep(FX_FLOAT step);
- void SetBigStep(FX_FLOAT step);
- FX_BOOL SetPos(FX_FLOAT pos);
-
- void AddSmall();
- void SubSmall();
- void AddBig();
- void SubBig();
-
- PWL_FLOATRANGE ScrollRange;
- FX_FLOAT fClientWidth;
- FX_FLOAT fScrollPos;
- FX_FLOAT fBigStep;
- FX_FLOAT fSmallStep;
-};
-
-class CPWL_ScrollBar : public CPWL_Wnd
-{
-public:
- CPWL_ScrollBar(PWL_SCROLLBAR_TYPE sbType = SBT_HSCROLL);
- virtual ~CPWL_ScrollBar();
-
-public:
- virtual CFX_ByteString GetClassName() const;
- virtual void OnCreate(PWL_CREATEPARAM & cp);
- virtual void RePosChildWnd();
- virtual void GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream);
- virtual void DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device);
-
- virtual FX_BOOL OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag);
- virtual FX_BOOL OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
- virtual void OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam = 0, FX_INTPTR lParam = 0);
-
- virtual void CreateChildWnd(const PWL_CREATEPARAM & cp);
-
- FX_FLOAT GetScrollBarWidth() const;
- PWL_SCROLLBAR_TYPE GetScrollBarType() const {return m_sbType;};
-
- void SetNotifyForever(FX_BOOL bForever) {m_bNotifyForever = bForever;}
-
-protected:
- void SetScrollRange(FX_FLOAT fMin,FX_FLOAT fMax,FX_FLOAT fClientWidth);
- void SetScrollPos(FX_FLOAT fPos);
- void MovePosButton(FX_BOOL bRefresh);
- void SetScrollStep(FX_FLOAT fBigStep,FX_FLOAT fSmallStep);
- void NotifyScrollWindow();
- CPDF_Rect GetScrollArea() const;
-
-private:
- void CreateButtons(const PWL_CREATEPARAM & cp);
-
- void OnMinButtonLBDown(const CPDF_Point & point);
- void OnMinButtonLBUp(const CPDF_Point & point);
- void OnMinButtonMouseMove(const CPDF_Point & point);
-
- void OnMaxButtonLBDown(const CPDF_Point & point);
- void OnMaxButtonLBUp(const CPDF_Point & point);
- void OnMaxButtonMouseMove(const CPDF_Point & point);
-
- void OnPosButtonLBDown(const CPDF_Point & point);
- void OnPosButtonLBUp(const CPDF_Point & point);
- void OnPosButtonMouseMove(const CPDF_Point & point);
-
- FX_FLOAT TrueToFace(FX_FLOAT);
- FX_FLOAT FaceToTrue(FX_FLOAT);
-
- virtual void TimerProc();
-
-private:
- PWL_SCROLLBAR_TYPE m_sbType;
- PWL_SCROLL_INFO m_OriginInfo;
- CPWL_SBButton* m_pMinButton;
- CPWL_SBButton* m_pMaxButton;
- CPWL_SBButton* m_pPosButton;
- PWL_SCROLL_PRIVATEDATA m_sData;
- FX_BOOL m_bMouseDown;
- FX_BOOL m_bMinOrMax;
- FX_BOOL m_bNotifyForever;
- FX_FLOAT m_nOldPos;
- FX_FLOAT m_fOldPosButton;
-};
-
-#endif // !defined(AFX_PWL_SCROLLBAR_H__DCFEC082_2651_48A4_B8F3_63F1B3CC5E10__INCLUDED_)
-
-
+// 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 _PWL_SCROLLBAR_H_
+#define _PWL_SCROLLBAR_H_
+
+class CPWL_SBButton;
+class CPWL_ScrollBar;
+
+struct PWL_SCROLL_INFO
+{
+public:
+ PWL_SCROLL_INFO() : fContentMin(0.0f), fContentMax(0.0f), fPlateWidth(0.0f), fBigStep(0.0f), fSmallStep(0.0f)
+ {
+ }
+ FX_FLOAT fContentMin;
+ FX_FLOAT fContentMax;
+ FX_FLOAT fPlateWidth;
+ FX_FLOAT fBigStep;
+ FX_FLOAT fSmallStep;
+};
+
+enum PWL_SCROLLBAR_TYPE
+{
+ SBT_HSCROLL,
+ SBT_VSCROLL
+};
+
+enum PWL_SBBUTTON_TYPE
+{
+ PSBT_MIN,
+ PSBT_MAX,
+ PSBT_POS
+};
+
+class CPWL_SBButton : public CPWL_Wnd
+{
+public:
+ CPWL_SBButton(PWL_SCROLLBAR_TYPE eScrollBarType,PWL_SBBUTTON_TYPE eButtonType);
+ virtual ~CPWL_SBButton();
+
+public:
+ virtual CFX_ByteString GetClassName() const;
+ virtual void OnCreate(PWL_CREATEPARAM & cp);
+ virtual void GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream);
+ virtual void DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device);
+ virtual FX_BOOL OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag);
+
+protected:
+ PWL_SCROLLBAR_TYPE m_eScrollBarType;
+ PWL_SBBUTTON_TYPE m_eSBButtonType;
+
+ FX_BOOL m_bMouseDown;
+};
+
+struct PWL_FLOATRANGE
+{
+public:
+ PWL_FLOATRANGE();
+ PWL_FLOATRANGE(FX_FLOAT min,FX_FLOAT max);
+ void Default();
+ void Set(FX_FLOAT min,FX_FLOAT max);
+ FX_BOOL In(FX_FLOAT x) const;
+ FX_FLOAT GetWidth() const;
+
+ FX_FLOAT fMin,fMax;
+};
+
+struct PWL_SCROLL_PRIVATEDATA
+{
+public:
+ PWL_SCROLL_PRIVATEDATA();
+
+ void Default();
+ void SetScrollRange(FX_FLOAT min,FX_FLOAT max);
+ void SetClientWidth(FX_FLOAT width);
+ void SetSmallStep(FX_FLOAT step);
+ void SetBigStep(FX_FLOAT step);
+ FX_BOOL SetPos(FX_FLOAT pos);
+
+ void AddSmall();
+ void SubSmall();
+ void AddBig();
+ void SubBig();
+
+ PWL_FLOATRANGE ScrollRange;
+ FX_FLOAT fClientWidth;
+ FX_FLOAT fScrollPos;
+ FX_FLOAT fBigStep;
+ FX_FLOAT fSmallStep;
+};
+
+class CPWL_ScrollBar : public CPWL_Wnd
+{
+public:
+ CPWL_ScrollBar(PWL_SCROLLBAR_TYPE sbType = SBT_HSCROLL);
+ virtual ~CPWL_ScrollBar();
+
+public:
+ virtual CFX_ByteString GetClassName() const;
+ virtual void OnCreate(PWL_CREATEPARAM & cp);
+ virtual void RePosChildWnd();
+ virtual void GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream);
+ virtual void DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device);
+
+ virtual FX_BOOL OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual void OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam = 0, FX_INTPTR lParam = 0);
+
+ virtual void CreateChildWnd(const PWL_CREATEPARAM & cp);
+
+ FX_FLOAT GetScrollBarWidth() const;
+ PWL_SCROLLBAR_TYPE GetScrollBarType() const {return m_sbType;};
+
+ void SetNotifyForever(FX_BOOL bForever) {m_bNotifyForever = bForever;}
+
+protected:
+ void SetScrollRange(FX_FLOAT fMin,FX_FLOAT fMax,FX_FLOAT fClientWidth);
+ void SetScrollPos(FX_FLOAT fPos);
+ void MovePosButton(FX_BOOL bRefresh);
+ void SetScrollStep(FX_FLOAT fBigStep,FX_FLOAT fSmallStep);
+ void NotifyScrollWindow();
+ CPDF_Rect GetScrollArea() const;
+
+private:
+ void CreateButtons(const PWL_CREATEPARAM & cp);
+
+ void OnMinButtonLBDown(const CPDF_Point & point);
+ void OnMinButtonLBUp(const CPDF_Point & point);
+ void OnMinButtonMouseMove(const CPDF_Point & point);
+
+ void OnMaxButtonLBDown(const CPDF_Point & point);
+ void OnMaxButtonLBUp(const CPDF_Point & point);
+ void OnMaxButtonMouseMove(const CPDF_Point & point);
+
+ void OnPosButtonLBDown(const CPDF_Point & point);
+ void OnPosButtonLBUp(const CPDF_Point & point);
+ void OnPosButtonMouseMove(const CPDF_Point & point);
+
+ FX_FLOAT TrueToFace(FX_FLOAT);
+ FX_FLOAT FaceToTrue(FX_FLOAT);
+
+ virtual void TimerProc();
+
+private:
+ PWL_SCROLLBAR_TYPE m_sbType;
+ PWL_SCROLL_INFO m_OriginInfo;
+ CPWL_SBButton* m_pMinButton;
+ CPWL_SBButton* m_pMaxButton;
+ CPWL_SBButton* m_pPosButton;
+ PWL_SCROLL_PRIVATEDATA m_sData;
+ FX_BOOL m_bMouseDown;
+ FX_BOOL m_bMinOrMax;
+ FX_BOOL m_bNotifyForever;
+ FX_FLOAT m_nOldPos;
+ FX_FLOAT m_fOldPosButton;
+};
+
+#endif // !defined(AFX_PWL_SCROLLBAR_H__DCFEC082_2651_48A4_B8F3_63F1B3CC5E10__INCLUDED_)
+
+
diff --git a/fpdfsdk/include/pdfwindow/PWL_Signature.h b/fpdfsdk/include/pdfwindow/PWL_Signature.h
index 712f7408ea..ec4479bbd3 100644
--- a/fpdfsdk/include/pdfwindow/PWL_Signature.h
+++ b/fpdfsdk/include/pdfwindow/PWL_Signature.h
@@ -1,67 +1,67 @@
-// 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 _PWL_SIGNATURE_H_
-#define _PWL_SIGNATURE_H_
-
-class CPWL_Signature;
-class CPWL_Label;
-class CPWL_Signature_Image;
-
-class CPWL_Signature_Image : public CPWL_Image
-{
-public:
- CPWL_Signature_Image();
- virtual ~CPWL_Signature_Image();
-
- void SetImage(CFX_DIBSource* pImage);
- CFX_DIBSource* GetImage();
-
-protected:
- virtual void DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device);
- virtual void GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream);
-
- virtual void GetScale(FX_FLOAT & fHScale,FX_FLOAT & fVScale);
-
-private:
- CFX_DIBSource* m_pImage;
-};
-
-class PWL_CLASS CPWL_Signature : public CPWL_Wnd
-{
-public:
- CPWL_Signature();
- virtual ~CPWL_Signature();
-
- void SetText(FX_LPCWSTR sText);
- void SetDescription(FX_LPCWSTR string);
- void SetImage(CFX_DIBSource* pImage);
- void SetImageStream(CPDF_Stream * pStream, FX_LPCSTR sImageAlias);
-
- void SetTextFlag(FX_BOOL bTextExist);
- void SetImageFlag(FX_BOOL bImageExist);
- void SetFoxitFlag(FX_BOOL bFlagExist);
-
-protected:
- virtual void RePosChildWnd();
- virtual void CreateChildWnd(const PWL_CREATEPARAM & cp);
-
- virtual void DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device);
- virtual void GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream);
-
-private:
- CPWL_Label* m_pText;
- CPWL_Label* m_pDescription;
- CPWL_Signature_Image* m_pImage;
-
- FX_BOOL m_bTextExist;
- FX_BOOL m_bImageExist;
- FX_BOOL m_bFlagExist;
-};
-
-#endif // _PWL_SIGNATURE_H_
-
-
+// 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 _PWL_SIGNATURE_H_
+#define _PWL_SIGNATURE_H_
+
+class CPWL_Signature;
+class CPWL_Label;
+class CPWL_Signature_Image;
+
+class CPWL_Signature_Image : public CPWL_Image
+{
+public:
+ CPWL_Signature_Image();
+ virtual ~CPWL_Signature_Image();
+
+ void SetImage(CFX_DIBSource* pImage);
+ CFX_DIBSource* GetImage();
+
+protected:
+ virtual void DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device);
+ virtual void GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream);
+
+ virtual void GetScale(FX_FLOAT & fHScale,FX_FLOAT & fVScale);
+
+private:
+ CFX_DIBSource* m_pImage;
+};
+
+class PWL_CLASS CPWL_Signature : public CPWL_Wnd
+{
+public:
+ CPWL_Signature();
+ virtual ~CPWL_Signature();
+
+ void SetText(FX_LPCWSTR sText);
+ void SetDescription(FX_LPCWSTR string);
+ void SetImage(CFX_DIBSource* pImage);
+ void SetImageStream(CPDF_Stream * pStream, FX_LPCSTR sImageAlias);
+
+ void SetTextFlag(FX_BOOL bTextExist);
+ void SetImageFlag(FX_BOOL bImageExist);
+ void SetFoxitFlag(FX_BOOL bFlagExist);
+
+protected:
+ virtual void RePosChildWnd();
+ virtual void CreateChildWnd(const PWL_CREATEPARAM & cp);
+
+ virtual void DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device);
+ virtual void GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream);
+
+private:
+ CPWL_Label* m_pText;
+ CPWL_Label* m_pDescription;
+ CPWL_Signature_Image* m_pImage;
+
+ FX_BOOL m_bTextExist;
+ FX_BOOL m_bImageExist;
+ FX_BOOL m_bFlagExist;
+};
+
+#endif // _PWL_SIGNATURE_H_
+
+
diff --git a/fpdfsdk/include/pdfwindow/PWL_SpecialButton.h b/fpdfsdk/include/pdfwindow/PWL_SpecialButton.h
index 55613014a0..ae882ea564 100644
--- a/fpdfsdk/include/pdfwindow/PWL_SpecialButton.h
+++ b/fpdfsdk/include/pdfwindow/PWL_SpecialButton.h
@@ -1,63 +1,63 @@
-// 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 _PWL_SPECIALBUTTON_H_
-#define _PWL_SPECIALBUTTON_H_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-class PWL_CLASS CPWL_PushButton : public CPWL_Button
-{
-public:
- CPWL_PushButton();
- virtual ~CPWL_PushButton();
-
-public:
- virtual CFX_ByteString GetClassName() const;
- virtual CPDF_Rect GetFocusRect() const;
-};
-
-class PWL_CLASS CPWL_CheckBox : public CPWL_Button
-{
-public:
- CPWL_CheckBox();
- virtual ~CPWL_CheckBox();
-
-public:
- virtual CFX_ByteString GetClassName() const;
- virtual FX_BOOL OnLButtonUp(const CPDF_Point & point);
- virtual FX_BOOL OnChar(FX_WORD nChar);
-
- void SetCheck(FX_BOOL bCheck);
- FX_BOOL IsChecked() const;
-
-private:
- FX_BOOL m_bChecked;
-};
-
-class PWL_CLASS CPWL_RadioButton : public CPWL_Button
-{
-public:
- CPWL_RadioButton();
- virtual ~CPWL_RadioButton();
-
-public:
- virtual CFX_ByteString GetClassName() const;
- virtual FX_BOOL OnLButtonUp(const CPDF_Point & point);
- virtual FX_BOOL OnChar(FX_WORD nChar);
-
- void SetCheck(FX_BOOL bCheck);
- FX_BOOL IsChecked() const;
-
-private:
- FX_BOOL m_bChecked;
-};
-
-#endif
-
-
+// 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 _PWL_SPECIALBUTTON_H_
+#define _PWL_SPECIALBUTTON_H_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+class PWL_CLASS CPWL_PushButton : public CPWL_Button
+{
+public:
+ CPWL_PushButton();
+ virtual ~CPWL_PushButton();
+
+public:
+ virtual CFX_ByteString GetClassName() const;
+ virtual CPDF_Rect GetFocusRect() const;
+};
+
+class PWL_CLASS CPWL_CheckBox : public CPWL_Button
+{
+public:
+ CPWL_CheckBox();
+ virtual ~CPWL_CheckBox();
+
+public:
+ virtual CFX_ByteString GetClassName() const;
+ virtual FX_BOOL OnLButtonUp(const CPDF_Point & point);
+ virtual FX_BOOL OnChar(FX_WORD nChar);
+
+ void SetCheck(FX_BOOL bCheck);
+ FX_BOOL IsChecked() const;
+
+private:
+ FX_BOOL m_bChecked;
+};
+
+class PWL_CLASS CPWL_RadioButton : public CPWL_Button
+{
+public:
+ CPWL_RadioButton();
+ virtual ~CPWL_RadioButton();
+
+public:
+ virtual CFX_ByteString GetClassName() const;
+ virtual FX_BOOL OnLButtonUp(const CPDF_Point & point);
+ virtual FX_BOOL OnChar(FX_WORD nChar);
+
+ void SetCheck(FX_BOOL bCheck);
+ FX_BOOL IsChecked() const;
+
+private:
+ FX_BOOL m_bChecked;
+};
+
+#endif
+
+
diff --git a/fpdfsdk/include/pdfwindow/PWL_Utils.h b/fpdfsdk/include/pdfwindow/PWL_Utils.h
index 2eccc363fd..489eb4a747 100644
--- a/fpdfsdk/include/pdfwindow/PWL_Utils.h
+++ b/fpdfsdk/include/pdfwindow/PWL_Utils.h
@@ -1,237 +1,237 @@
-// 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 _PWL_UTILS_H_
-#define _PWL_UTILS_H_
-
-template<class T> T PWL_MIN (const T & i, const T & j) { return ((i < j) ? i : j); }
-template<class T> T PWL_MAX (const T & i, const T & j) { return ((i > j) ? i : j); }
-
-#define PWL_PDF2WIN(color) (FX_BYTE(color*255))
-#define PWL_WIN2PDF(color) ((FX_FLOAT)((FX_FLOAT)color/255.0f))
-
-#define PWL_MAKEDWORD(low,high) ((FX_DWORD)((FX_WORD)(low) | (FX_DWORD)(((FX_WORD)(high))<<16)))
-#define PWL_GETLOWWORD(dword) ((FX_WORD)(dword))
-#define PWL_GETHIGHWORD(dword) ((FX_WORD)(dword>>16))
-
-#define PWL_ICONTYPE_CHECKMARK 0
-#define PWL_ICONTYPE_CIRCLE 1
-#define PWL_ICONTYPE_COMMENT 2
-#define PWL_ICONTYPE_CROSS 3
-#define PWL_ICONTYPE_HELP 4
-#define PWL_ICONTYPE_INSERTTEXT 5
-#define PWL_ICONTYPE_KEY 6
-#define PWL_ICONTYPE_NEWPARAGRAPH 7
-#define PWL_ICONTYPE_TEXTNOTE 8
-#define PWL_ICONTYPE_PARAGRAPH 9
-#define PWL_ICONTYPE_RIGHTARROW 10
-#define PWL_ICONTYPE_RIGHTPOINTER 11
-#define PWL_ICONTYPE_STAR 12
-#define PWL_ICONTYPE_UPARROW 13
-#define PWL_ICONTYPE_UPLEFTARROW 14
-
-#define PWL_ICONTYPE_GRAPH 15
-#define PWL_ICONTYPE_PAPERCLIP 16
-#define PWL_ICONTYPE_ATTACHMENT 17
-#define PWL_ICONTYPE_TAG 18
-
-#define PWL_ICONTYPE_FOXIT 19
-
-#define PWL_ICONTYPE_UNKNOWN -1
-
-//checkbox & radiobutton style
-#define PCS_CHECK 0
-#define PCS_CIRCLE 1
-#define PCS_CROSS 2
-#define PCS_DIAMOND 3
-#define PCS_SQUARE 4
-#define PCS_STAR 5
-
-#define PWL_PI 3.14159265358979f
-#define PWL_BEZIER 0.5522847498308f
-
-//pushbutton layout style
-#define PPBL_LABEL 0
-#define PPBL_ICON 1
-#define PPBL_ICONTOPLABELBOTTOM 2
-#define PPBL_LABELTOPICONBOTTOM 3
-#define PPBL_ICONLEFTLABELRIGHT 4
-#define PPBL_LABELLEFTICONRIGHT 5
-#define PPBL_LABELOVERICON 6
-
-class CPWL_Point : public CPDF_Point
-{
-public:
- CPWL_Point() : CPDF_Point(0.0f,0.0f){}
- CPWL_Point(FX_FLOAT fx, FX_FLOAT fy) : CPDF_Point(fx,fy) {}
- CPWL_Point(const CPWL_Point& point) : CPDF_Point(point.x, point.y) {}
-};
-
-enum PWL_PATHDATA_TYPE
-{
- PWLPT_MOVETO,
- PWLPT_LINETO,
- PWLPT_BEZIERTO,
- PWLPT_UNKNOWN
-};
-
-enum PWL_PATH_TYPE
-{
- PWLPT_PATHDATA,
- PWLPT_STREAM
-};
-
-class CPWL_PathData
-{
-public:
- CPWL_PathData() : point(), type(PWLPT_UNKNOWN){}
- CPWL_PathData(const CPWL_Point& pt, PWL_PATHDATA_TYPE tp) : point(pt), type(tp) {}
-
- CPWL_Point point;
- PWL_PATHDATA_TYPE type;
-};
-
-class IPWL_SpellCheck;
-
-class PWL_CLASS CPWL_Utils
-{
-public:
- static CPDF_Rect InflateRect(const CPDF_Rect& rcRect, FX_FLOAT fSize);
- static CPDF_Rect DeflateRect(const CPDF_Rect& rcRect, FX_FLOAT fSize);
- static FX_BOOL IntersectRect(const CPDF_Rect& rect1, const CPDF_Rect& rect2);
- static FX_BOOL ContainsRect(const CPDF_Rect& rcParent, const CPDF_Rect& rcChild);
- static CPDF_Rect ScaleRect(const CPDF_Rect& rcRect,FX_FLOAT fScale);
- static CPVT_WordRange OverlapWordRange(const CPVT_WordRange& wr1, const CPVT_WordRange& wr2);
- static CPDF_Rect GetCenterSquare(const CPDF_Rect & rect);
- static CPWL_Color SubstractColor(const CPWL_Color & sColor,FX_FLOAT fColorSub);
- static CPWL_Color DevideColor(const CPWL_Color & sColor,FX_FLOAT fColorDevide);
- static CPDF_Rect MaxRect(const CPDF_Rect & rect1,const CPDF_Rect & rect2);
- static CPDF_Rect OffsetRect(const CPDF_Rect & rect,FX_FLOAT x,FX_FLOAT y);
- static CPDF_Point OffsetPoint(const CPDF_Point & point,FX_FLOAT x,FX_FLOAT y);
- static FX_COLORREF PWLColorToFXColor(const CPWL_Color& color, FX_INT32 nTransparancy = 255);
- static FX_BOOL IsBlackOrWhite(const CPWL_Color& color);
- static CPWL_Color GetReverseColor(const CPWL_Color& color);
-
- static CFX_ByteString GetColorAppStream(const CPWL_Color & color,const FX_BOOL & bFillOrStroke = TRUE);
- static CFX_ByteString GetBorderAppStream(const CPDF_Rect & rect, FX_FLOAT fWidth,
- const CPWL_Color & color, const CPWL_Color & crLeftTop, const CPWL_Color & crRightBottom,
- FX_INT32 nStyle, const CPWL_Dash & dash);
- static CFX_ByteString GetCircleBorderAppStream(const CPDF_Rect & rect, FX_FLOAT fWidth,
- const CPWL_Color & color, const CPWL_Color & crLeftTop, const CPWL_Color & crRightBottom,
- FX_INT32 nStyle, const CPWL_Dash & dash);
- static CFX_ByteString GetRectFillAppStream(const CPDF_Rect & rect,const CPWL_Color & color);
- static CFX_ByteString GetCircleFillAppStream(const CPDF_Rect & rect,const CPWL_Color & color);
-
- static CFX_ByteString GetPushButtonAppStream(const CPDF_Rect & rcBBox,
- IFX_Edit_FontMap * pFontMap,
- CPDF_Stream * pIconStream,
- CPDF_IconFit & IconFit,
- const CFX_WideString & sLabel,
- const CPWL_Color & crText,
- FX_FLOAT fFontSize,
- FX_INT32 nLayOut);
- static CFX_ByteString GetCheckBoxAppStream(const CPDF_Rect & rcBBox,
- FX_INT32 nStyle,
- const CPWL_Color & crText);
- static CFX_ByteString GetRadioButtonAppStream(const CPDF_Rect & rcBBox,
- FX_INT32 nStyle,
- const CPWL_Color & crText);
-
- static CFX_ByteString GetEditAppStream(IFX_Edit* pEdit, const CPDF_Point & ptOffset, const CPVT_WordRange * pRange = NULL,
- FX_BOOL bContinuous = TRUE, FX_WORD SubWord = 0);
- static CFX_ByteString GetEditSelAppStream(IFX_Edit* pEdit, const CPDF_Point & ptOffset,
- const CPVT_WordRange * pRange = NULL);
- static CFX_ByteString GetSpellCheckAppStream(IFX_Edit* pEdit, IPWL_SpellCheck* pSpellCheck,
- const CPDF_Point & ptOffset,
- const CPVT_WordRange * pRange = NULL);
- static CFX_ByteString GetTextAppStream(const CPDF_Rect & rcBBox,IFX_Edit_FontMap * pFontMap,
- const CFX_WideString & sText, FX_INT32 nAlignmentH, FX_INT32 nAlignmentV,
- FX_FLOAT fFontSize, FX_BOOL bMultiLine, FX_BOOL bAutoReturn, const CPWL_Color & crText);
- static CFX_ByteString GetDropButtonAppStream(const CPDF_Rect & rcBBox);
-
- static void DrawFillRect(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,const CPDF_Rect & rect,
- const CPWL_Color & color, FX_INT32 nTransparancy);
- static void DrawFillRect(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
- const CPDF_Rect & rect,const FX_COLORREF & color);
- static void DrawStrokeRect(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,const CPDF_Rect & rect,
- const FX_COLORREF & color, FX_FLOAT fWidth);
- static void DrawStrokeLine(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
- const CPDF_Point & ptMoveTo, const CPDF_Point & ptLineTo, const FX_COLORREF & color, FX_FLOAT fWidth);
- static void DrawBorder(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
- const CPDF_Rect & rect, FX_FLOAT fWidth,
- const CPWL_Color & color, const CPWL_Color & crLeftTop, const CPWL_Color & crRightBottom,
- FX_INT32 nStyle, const CPWL_Dash & dash, FX_INT32 nTransparancy);
- static void DrawFillArea(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
- const CPDF_Point* pPts, FX_INT32 nCount, const FX_COLORREF& color);
- static void DrawShadow(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
- FX_BOOL bVertical, FX_BOOL bHorizontal, CPDF_Rect rect,
- FX_INT32 nTransparancy, FX_INT32 nStartGray, FX_INT32 nEndGray);
- static void DrawEditSpellCheck(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, IFX_Edit* pEdit,
- const CPDF_Rect& rcClip, const CPDF_Point& ptOffset, const CPVT_WordRange* pRange,
- IPWL_SpellCheck* pSpellCheck);
-public:
- static void ConvertCMYK2RGB(FX_FLOAT dC,FX_FLOAT dM,FX_FLOAT dY,FX_FLOAT dK,FX_FLOAT &dR,FX_FLOAT &dG,FX_FLOAT &dB);
- static void ConvertRGB2CMYK(FX_FLOAT dR,FX_FLOAT dG,FX_FLOAT dB,FX_FLOAT &dC,FX_FLOAT &dM,FX_FLOAT &dY,FX_FLOAT &dK);
-
- static void ConvertRGB2GRAY(FX_FLOAT dR,FX_FLOAT dG,FX_FLOAT dB,FX_FLOAT &dGray);
- static void ConvertGRAY2RGB(FX_FLOAT dGray,FX_FLOAT &dR,FX_FLOAT &dG,FX_FLOAT &dB);
-
- static void ConvertCMYK2GRAY(FX_FLOAT dC,FX_FLOAT dM,FX_FLOAT dY,FX_FLOAT dK,FX_FLOAT &dGray);
- static void ConvertGRAY2CMYK(FX_FLOAT dGray,FX_FLOAT &dC,FX_FLOAT &dM,FX_FLOAT &dY,FX_FLOAT &dK);
-
- static void PWLColorToARGB(const CPWL_Color& color, FX_INT32& alpha, FX_FLOAT& red, FX_FLOAT& green, FX_FLOAT& blue);
-
-public:
- static CFX_ByteString GetIconAppStream(FX_INT32 nType, const CPDF_Rect& rect, const CPWL_Color& crFill,
- const CPWL_Color& crStroke = PWL_DEFAULT_BLACKCOLOR);
- static void DrawIconAppStream(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
- FX_INT32 nType, const CPDF_Rect & rect, const CPWL_Color& crFill,
- const CPWL_Color& crStroke, const FX_INT32 nTransparancy);
-
-private:
- static CFX_ByteString GetAppStreamFromArray(const CPWL_PathData* pPathData, FX_INT32 nCount);
- static void GetPathDataFromArray(CFX_PathData& path, const CPWL_PathData* pPathData, FX_INT32 nCount);
-
- static CFX_ByteString GetAppStream_Check(const CPDF_Rect & rcBBox, const CPWL_Color & crText);
- static CFX_ByteString GetAppStream_Circle(const CPDF_Rect & rcBBox, const CPWL_Color & crText);
- static CFX_ByteString GetAppStream_Cross(const CPDF_Rect & rcBBox, const CPWL_Color & crText);
- static CFX_ByteString GetAppStream_Diamond(const CPDF_Rect & rcBBox, const CPWL_Color & crText);
- static CFX_ByteString GetAppStream_Square(const CPDF_Rect & rcBBox, const CPWL_Color & crText);
- static CFX_ByteString GetAppStream_Star(const CPDF_Rect & rcBBox, const CPWL_Color & crText);
-
- static CFX_ByteString GetAP_Check(const CPDF_Rect & crBBox);
- static CFX_ByteString GetAP_Circle(const CPDF_Rect & crBBox);
- static CFX_ByteString GetAP_Cross(const CPDF_Rect & crBBox);
- static CFX_ByteString GetAP_Diamond(const CPDF_Rect & crBBox);
- static CFX_ByteString GetAP_Square(const CPDF_Rect & crBBox);
- static CFX_ByteString GetAP_Star(const CPDF_Rect & crBBox);
- static CFX_ByteString GetAP_HalfCircle(const CPDF_Rect & crBBox,FX_FLOAT fRotate);
-
- static void GetGraphics_Checkmark(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type);
- static void GetGraphics_Circle(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type);
- static void GetGraphics_Comment(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type);
- static void GetGraphics_Cross(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type);
- static void GetGraphics_Help(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type);
- static void GetGraphics_InsertText(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type);
- static void GetGraphics_Key(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type);
- static void GetGraphics_NewParagraph(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type);
- static void GetGraphics_TextNote(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type);
- static void GetGraphics_Paragraph(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type);
- static void GetGraphics_RightArrow(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type);
- static void GetGraphics_RightPointer(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type);
- static void GetGraphics_Star(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type);
- static void GetGraphics_UpArrow(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type);
- static void GetGraphics_UpLeftArrow(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type);
- static void GetGraphics_Graph(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type);
- static void GetGraphics_Paperclip(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type);
- static void GetGraphics_Attachment(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type);
- static void GetGraphics_Tag(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type);
- static void GetGraphics_Foxit(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type);
-};
-
-#endif // !defined(AFX_PWL_UTILS_H__D32812AD_A875_4E08_9D3C_0A57020987C6__INCLUDED_)
-
-
+// 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 _PWL_UTILS_H_
+#define _PWL_UTILS_H_
+
+template<class T> T PWL_MIN (const T & i, const T & j) { return ((i < j) ? i : j); }
+template<class T> T PWL_MAX (const T & i, const T & j) { return ((i > j) ? i : j); }
+
+#define PWL_PDF2WIN(color) (FX_BYTE(color*255))
+#define PWL_WIN2PDF(color) ((FX_FLOAT)((FX_FLOAT)color/255.0f))
+
+#define PWL_MAKEDWORD(low,high) ((FX_DWORD)((FX_WORD)(low) | (FX_DWORD)(((FX_WORD)(high))<<16)))
+#define PWL_GETLOWWORD(dword) ((FX_WORD)(dword))
+#define PWL_GETHIGHWORD(dword) ((FX_WORD)(dword>>16))
+
+#define PWL_ICONTYPE_CHECKMARK 0
+#define PWL_ICONTYPE_CIRCLE 1
+#define PWL_ICONTYPE_COMMENT 2
+#define PWL_ICONTYPE_CROSS 3
+#define PWL_ICONTYPE_HELP 4
+#define PWL_ICONTYPE_INSERTTEXT 5
+#define PWL_ICONTYPE_KEY 6
+#define PWL_ICONTYPE_NEWPARAGRAPH 7
+#define PWL_ICONTYPE_TEXTNOTE 8
+#define PWL_ICONTYPE_PARAGRAPH 9
+#define PWL_ICONTYPE_RIGHTARROW 10
+#define PWL_ICONTYPE_RIGHTPOINTER 11
+#define PWL_ICONTYPE_STAR 12
+#define PWL_ICONTYPE_UPARROW 13
+#define PWL_ICONTYPE_UPLEFTARROW 14
+
+#define PWL_ICONTYPE_GRAPH 15
+#define PWL_ICONTYPE_PAPERCLIP 16
+#define PWL_ICONTYPE_ATTACHMENT 17
+#define PWL_ICONTYPE_TAG 18
+
+#define PWL_ICONTYPE_FOXIT 19
+
+#define PWL_ICONTYPE_UNKNOWN -1
+
+//checkbox & radiobutton style
+#define PCS_CHECK 0
+#define PCS_CIRCLE 1
+#define PCS_CROSS 2
+#define PCS_DIAMOND 3
+#define PCS_SQUARE 4
+#define PCS_STAR 5
+
+#define PWL_PI 3.14159265358979f
+#define PWL_BEZIER 0.5522847498308f
+
+//pushbutton layout style
+#define PPBL_LABEL 0
+#define PPBL_ICON 1
+#define PPBL_ICONTOPLABELBOTTOM 2
+#define PPBL_LABELTOPICONBOTTOM 3
+#define PPBL_ICONLEFTLABELRIGHT 4
+#define PPBL_LABELLEFTICONRIGHT 5
+#define PPBL_LABELOVERICON 6
+
+class CPWL_Point : public CPDF_Point
+{
+public:
+ CPWL_Point() : CPDF_Point(0.0f,0.0f){}
+ CPWL_Point(FX_FLOAT fx, FX_FLOAT fy) : CPDF_Point(fx,fy) {}
+ CPWL_Point(const CPWL_Point& point) : CPDF_Point(point.x, point.y) {}
+};
+
+enum PWL_PATHDATA_TYPE
+{
+ PWLPT_MOVETO,
+ PWLPT_LINETO,
+ PWLPT_BEZIERTO,
+ PWLPT_UNKNOWN
+};
+
+enum PWL_PATH_TYPE
+{
+ PWLPT_PATHDATA,
+ PWLPT_STREAM
+};
+
+class CPWL_PathData
+{
+public:
+ CPWL_PathData() : point(), type(PWLPT_UNKNOWN){}
+ CPWL_PathData(const CPWL_Point& pt, PWL_PATHDATA_TYPE tp) : point(pt), type(tp) {}
+
+ CPWL_Point point;
+ PWL_PATHDATA_TYPE type;
+};
+
+class IPWL_SpellCheck;
+
+class PWL_CLASS CPWL_Utils
+{
+public:
+ static CPDF_Rect InflateRect(const CPDF_Rect& rcRect, FX_FLOAT fSize);
+ static CPDF_Rect DeflateRect(const CPDF_Rect& rcRect, FX_FLOAT fSize);
+ static FX_BOOL IntersectRect(const CPDF_Rect& rect1, const CPDF_Rect& rect2);
+ static FX_BOOL ContainsRect(const CPDF_Rect& rcParent, const CPDF_Rect& rcChild);
+ static CPDF_Rect ScaleRect(const CPDF_Rect& rcRect,FX_FLOAT fScale);
+ static CPVT_WordRange OverlapWordRange(const CPVT_WordRange& wr1, const CPVT_WordRange& wr2);
+ static CPDF_Rect GetCenterSquare(const CPDF_Rect & rect);
+ static CPWL_Color SubstractColor(const CPWL_Color & sColor,FX_FLOAT fColorSub);
+ static CPWL_Color DevideColor(const CPWL_Color & sColor,FX_FLOAT fColorDevide);
+ static CPDF_Rect MaxRect(const CPDF_Rect & rect1,const CPDF_Rect & rect2);
+ static CPDF_Rect OffsetRect(const CPDF_Rect & rect,FX_FLOAT x,FX_FLOAT y);
+ static CPDF_Point OffsetPoint(const CPDF_Point & point,FX_FLOAT x,FX_FLOAT y);
+ static FX_COLORREF PWLColorToFXColor(const CPWL_Color& color, FX_INT32 nTransparancy = 255);
+ static FX_BOOL IsBlackOrWhite(const CPWL_Color& color);
+ static CPWL_Color GetReverseColor(const CPWL_Color& color);
+
+ static CFX_ByteString GetColorAppStream(const CPWL_Color & color,const FX_BOOL & bFillOrStroke = TRUE);
+ static CFX_ByteString GetBorderAppStream(const CPDF_Rect & rect, FX_FLOAT fWidth,
+ const CPWL_Color & color, const CPWL_Color & crLeftTop, const CPWL_Color & crRightBottom,
+ FX_INT32 nStyle, const CPWL_Dash & dash);
+ static CFX_ByteString GetCircleBorderAppStream(const CPDF_Rect & rect, FX_FLOAT fWidth,
+ const CPWL_Color & color, const CPWL_Color & crLeftTop, const CPWL_Color & crRightBottom,
+ FX_INT32 nStyle, const CPWL_Dash & dash);
+ static CFX_ByteString GetRectFillAppStream(const CPDF_Rect & rect,const CPWL_Color & color);
+ static CFX_ByteString GetCircleFillAppStream(const CPDF_Rect & rect,const CPWL_Color & color);
+
+ static CFX_ByteString GetPushButtonAppStream(const CPDF_Rect & rcBBox,
+ IFX_Edit_FontMap * pFontMap,
+ CPDF_Stream * pIconStream,
+ CPDF_IconFit & IconFit,
+ const CFX_WideString & sLabel,
+ const CPWL_Color & crText,
+ FX_FLOAT fFontSize,
+ FX_INT32 nLayOut);
+ static CFX_ByteString GetCheckBoxAppStream(const CPDF_Rect & rcBBox,
+ FX_INT32 nStyle,
+ const CPWL_Color & crText);
+ static CFX_ByteString GetRadioButtonAppStream(const CPDF_Rect & rcBBox,
+ FX_INT32 nStyle,
+ const CPWL_Color & crText);
+
+ static CFX_ByteString GetEditAppStream(IFX_Edit* pEdit, const CPDF_Point & ptOffset, const CPVT_WordRange * pRange = NULL,
+ FX_BOOL bContinuous = TRUE, FX_WORD SubWord = 0);
+ static CFX_ByteString GetEditSelAppStream(IFX_Edit* pEdit, const CPDF_Point & ptOffset,
+ const CPVT_WordRange * pRange = NULL);
+ static CFX_ByteString GetSpellCheckAppStream(IFX_Edit* pEdit, IPWL_SpellCheck* pSpellCheck,
+ const CPDF_Point & ptOffset,
+ const CPVT_WordRange * pRange = NULL);
+ static CFX_ByteString GetTextAppStream(const CPDF_Rect & rcBBox,IFX_Edit_FontMap * pFontMap,
+ const CFX_WideString & sText, FX_INT32 nAlignmentH, FX_INT32 nAlignmentV,
+ FX_FLOAT fFontSize, FX_BOOL bMultiLine, FX_BOOL bAutoReturn, const CPWL_Color & crText);
+ static CFX_ByteString GetDropButtonAppStream(const CPDF_Rect & rcBBox);
+
+ static void DrawFillRect(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,const CPDF_Rect & rect,
+ const CPWL_Color & color, FX_INT32 nTransparancy);
+ static void DrawFillRect(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
+ const CPDF_Rect & rect,const FX_COLORREF & color);
+ static void DrawStrokeRect(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,const CPDF_Rect & rect,
+ const FX_COLORREF & color, FX_FLOAT fWidth);
+ static void DrawStrokeLine(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
+ const CPDF_Point & ptMoveTo, const CPDF_Point & ptLineTo, const FX_COLORREF & color, FX_FLOAT fWidth);
+ static void DrawBorder(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
+ const CPDF_Rect & rect, FX_FLOAT fWidth,
+ const CPWL_Color & color, const CPWL_Color & crLeftTop, const CPWL_Color & crRightBottom,
+ FX_INT32 nStyle, const CPWL_Dash & dash, FX_INT32 nTransparancy);
+ static void DrawFillArea(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
+ const CPDF_Point* pPts, FX_INT32 nCount, const FX_COLORREF& color);
+ static void DrawShadow(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
+ FX_BOOL bVertical, FX_BOOL bHorizontal, CPDF_Rect rect,
+ FX_INT32 nTransparancy, FX_INT32 nStartGray, FX_INT32 nEndGray);
+ static void DrawEditSpellCheck(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, IFX_Edit* pEdit,
+ const CPDF_Rect& rcClip, const CPDF_Point& ptOffset, const CPVT_WordRange* pRange,
+ IPWL_SpellCheck* pSpellCheck);
+public:
+ static void ConvertCMYK2RGB(FX_FLOAT dC,FX_FLOAT dM,FX_FLOAT dY,FX_FLOAT dK,FX_FLOAT &dR,FX_FLOAT &dG,FX_FLOAT &dB);
+ static void ConvertRGB2CMYK(FX_FLOAT dR,FX_FLOAT dG,FX_FLOAT dB,FX_FLOAT &dC,FX_FLOAT &dM,FX_FLOAT &dY,FX_FLOAT &dK);
+
+ static void ConvertRGB2GRAY(FX_FLOAT dR,FX_FLOAT dG,FX_FLOAT dB,FX_FLOAT &dGray);
+ static void ConvertGRAY2RGB(FX_FLOAT dGray,FX_FLOAT &dR,FX_FLOAT &dG,FX_FLOAT &dB);
+
+ static void ConvertCMYK2GRAY(FX_FLOAT dC,FX_FLOAT dM,FX_FLOAT dY,FX_FLOAT dK,FX_FLOAT &dGray);
+ static void ConvertGRAY2CMYK(FX_FLOAT dGray,FX_FLOAT &dC,FX_FLOAT &dM,FX_FLOAT &dY,FX_FLOAT &dK);
+
+ static void PWLColorToARGB(const CPWL_Color& color, FX_INT32& alpha, FX_FLOAT& red, FX_FLOAT& green, FX_FLOAT& blue);
+
+public:
+ static CFX_ByteString GetIconAppStream(FX_INT32 nType, const CPDF_Rect& rect, const CPWL_Color& crFill,
+ const CPWL_Color& crStroke = PWL_DEFAULT_BLACKCOLOR);
+ static void DrawIconAppStream(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
+ FX_INT32 nType, const CPDF_Rect & rect, const CPWL_Color& crFill,
+ const CPWL_Color& crStroke, const FX_INT32 nTransparancy);
+
+private:
+ static CFX_ByteString GetAppStreamFromArray(const CPWL_PathData* pPathData, FX_INT32 nCount);
+ static void GetPathDataFromArray(CFX_PathData& path, const CPWL_PathData* pPathData, FX_INT32 nCount);
+
+ static CFX_ByteString GetAppStream_Check(const CPDF_Rect & rcBBox, const CPWL_Color & crText);
+ static CFX_ByteString GetAppStream_Circle(const CPDF_Rect & rcBBox, const CPWL_Color & crText);
+ static CFX_ByteString GetAppStream_Cross(const CPDF_Rect & rcBBox, const CPWL_Color & crText);
+ static CFX_ByteString GetAppStream_Diamond(const CPDF_Rect & rcBBox, const CPWL_Color & crText);
+ static CFX_ByteString GetAppStream_Square(const CPDF_Rect & rcBBox, const CPWL_Color & crText);
+ static CFX_ByteString GetAppStream_Star(const CPDF_Rect & rcBBox, const CPWL_Color & crText);
+
+ static CFX_ByteString GetAP_Check(const CPDF_Rect & crBBox);
+ static CFX_ByteString GetAP_Circle(const CPDF_Rect & crBBox);
+ static CFX_ByteString GetAP_Cross(const CPDF_Rect & crBBox);
+ static CFX_ByteString GetAP_Diamond(const CPDF_Rect & crBBox);
+ static CFX_ByteString GetAP_Square(const CPDF_Rect & crBBox);
+ static CFX_ByteString GetAP_Star(const CPDF_Rect & crBBox);
+ static CFX_ByteString GetAP_HalfCircle(const CPDF_Rect & crBBox,FX_FLOAT fRotate);
+
+ static void GetGraphics_Checkmark(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type);
+ static void GetGraphics_Circle(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type);
+ static void GetGraphics_Comment(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type);
+ static void GetGraphics_Cross(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type);
+ static void GetGraphics_Help(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type);
+ static void GetGraphics_InsertText(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type);
+ static void GetGraphics_Key(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type);
+ static void GetGraphics_NewParagraph(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type);
+ static void GetGraphics_TextNote(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type);
+ static void GetGraphics_Paragraph(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type);
+ static void GetGraphics_RightArrow(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type);
+ static void GetGraphics_RightPointer(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type);
+ static void GetGraphics_Star(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type);
+ static void GetGraphics_UpArrow(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type);
+ static void GetGraphics_UpLeftArrow(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type);
+ static void GetGraphics_Graph(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type);
+ static void GetGraphics_Paperclip(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type);
+ static void GetGraphics_Attachment(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type);
+ static void GetGraphics_Tag(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type);
+ static void GetGraphics_Foxit(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type);
+};
+
+#endif // !defined(AFX_PWL_UTILS_H__D32812AD_A875_4E08_9D3C_0A57020987C6__INCLUDED_)
+
+
diff --git a/fpdfsdk/include/pdfwindow/PWL_Wnd.h b/fpdfsdk/include/pdfwindow/PWL_Wnd.h
index 7e9e25d07a..c3dd9b7a70 100644
--- a/fpdfsdk/include/pdfwindow/PWL_Wnd.h
+++ b/fpdfsdk/include/pdfwindow/PWL_Wnd.h
@@ -1,493 +1,493 @@
-// 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 _PWL_WND_H_
-#define _PWL_WND_H_
-
-class IPWL_Provider;
-class CPWL_Wnd;
-class CPWL_MsgControl;
-class CPWL_Wnd;
-class CPWL_ScrollBar;
-class CPWL_Timer;
-class CPWL_TimerHandler;
-class IPWL_SpellCheck;
-class IFX_SystemHandler;
-
-#ifdef FX_READER_DLL
- #ifdef PWL_EXPORT
- #define PWL_CLASS __declspec(dllexport)
- #define PWL_FUNCTION PWL_CLASS
- #else
- #define PWL_CLASS
- #define PWL_FUNCTION
- #endif
-#else
- #define PWL_CLASS
- #define PWL_FUNCTION
-#endif
-
-//window styles
-#define PWS_CHILD 0x80000000L
-#define PWS_BORDER 0x40000000L
-#define PWS_BACKGROUND 0x20000000L
-#define PWS_HSCROLL 0x10000000L
-#define PWS_VSCROLL 0x08000000L
-#define PWS_VISIBLE 0x04000000L
-#define PWS_DISABLE 0x02000000L
-#define PWS_READONLY 0x01000000L
-#define PWS_AUTOFONTSIZE 0x00800000L
-#define PWS_AUTOTRANSPARENT 0x00400000L
-#define PWS_NOREFRESHCLIP 0x00200000L
-
-//edit and label styles
-#define PES_MULTILINE 0x0001L
-#define PES_PASSWORD 0x0002L
-#define PES_LEFT 0x0004L
-#define PES_RIGHT 0x0008L
-#define PES_MIDDLE 0x0010L
-#define PES_TOP 0x0020L
-#define PES_BOTTOM 0x0040L
-#define PES_CENTER 0x0080L
-#define PES_CHARARRAY 0x0100L
-#define PES_AUTOSCROLL 0x0200L
-#define PES_AUTORETURN 0x0400L
-#define PES_UNDO 0x0800L
-#define PES_RICH 0x1000L
-#define PES_SPELLCHECK 0x2000L
-#define PES_TEXTOVERFLOW 0x4000L
-#define PES_NOREAD 0x8000L
-
-//listbox styles
-#define PLBS_MULTIPLESEL 0x0001L
-#define PLBS_HOVERSEL 0x0008L
-
-//combobox styles
-#define PCBS_ALLOWCUSTOMTEXT 0x0001L
-
-//richedit styles
-#define PRES_MULTILINE 0x0001L
-#define PRES_AUTORETURN 0x0002L
-#define PRES_AUTOSCROLL 0x0004L
-#define PRES_SPELLCHECK 0x0008L
-#define PRES_UNDO 0x0100L
-#define PRES_MULTIPAGES 0x0200L
-#define PRES_TEXTOVERFLOW 0x0400L
-
-//border style
-#define PBS_SOLID 0
-#define PBS_DASH 1
-#define PBS_BEVELED 2
-#define PBS_INSET 3
-#define PBS_UNDERLINED 4
-#define PBS_SHADOW 5
-
-//notification messages
-#define PNM_ADDCHILD 0x00000000L
-#define PNM_REMOVECHILD 0x00000001L
-#define PNM_SETSCROLLINFO 0x00000002L
-#define PNM_SETSCROLLPOS 0x00000003L
-#define PNM_SCROLLWINDOW 0x00000004L
-#define PNM_LBUTTONDOWN 0x00000005L
-#define PNM_LBUTTONUP 0x00000006L
-#define PNM_MOUSEMOVE 0x00000007L
-#define PNM_NOTERESET 0x00000008L
-#define PNM_SETCARETINFO 0x00000009L
-#define PNM_SELCHANGED 0x0000000AL
-#define PNM_NOTEEDITCHANGED 0x0000000BL
-
-#define PWL_CLASSNAME_EDIT "CPWL_Edit"
-
-struct CPWL_Dash
-{
- CPWL_Dash(FX_INT32 dash, FX_INT32 gap, FX_INT32 phase) : nDash(dash), nGap(gap), nPhase(phase)
- {}
-
- FX_INT32 nDash;
- FX_INT32 nGap;
- FX_INT32 nPhase;
-};
-
-struct PWL_CLASS CPWL_Color
-{
- CPWL_Color(FX_INT32 type = COLORTYPE_TRANSPARENT, FX_FLOAT color1 = 0.0f, FX_FLOAT color2 = 0.0f, FX_FLOAT color3 = 0.0f, FX_FLOAT color4 = 0.0f)
- : nColorType(type), fColor1(color1), fColor2(color2), fColor3(color3), fColor4(color4)
- {}
-
- CPWL_Color(FX_INT32 r, FX_INT32 g, FX_INT32 b) :
- nColorType(COLORTYPE_RGB), fColor1(r/255.0f), fColor2(g/255.0f), fColor3(b/255.0f), fColor4(0)
- {}
-
- void ConvertColorType(FX_INT32 nColorType);
-
- /*
- COLORTYPE_TRANSPARENT
- COLORTYPE_RGB
- COLORTYPE_CMYK
- COLORTYPE_GRAY
- */
- FX_INT32 nColorType;
- FX_FLOAT fColor1,fColor2,fColor3,fColor4;
-};
-
-inline FX_BOOL operator == (const CPWL_Color &c1, const CPWL_Color &c2)
-{
- return c1.nColorType == c2.nColorType &&
- c1.fColor1 - c2.fColor1 < 0.0001 && c1.fColor1 - c2.fColor1 > -0.0001 &&
- c1.fColor2 - c2.fColor2 < 0.0001 && c1.fColor2 - c2.fColor2 > -0.0001 &&
- c1.fColor3 - c2.fColor3 < 0.0001 && c1.fColor3 - c2.fColor3 > -0.0001 &&
- c1.fColor4 - c2.fColor4 < 0.0001 && c1.fColor4 - c2.fColor4 > -0.0001;
-}
-
-inline FX_BOOL operator != (const CPWL_Color &c1, const CPWL_Color &c2)
-{
- return !operator == (c1, c2);
-}
-
-#define PWL_SCROLLBAR_WIDTH 12.0f
-#define PWL_SCROLLBAR_BUTTON_WIDTH 9.0f
-#define PWL_SCROLLBAR_POSBUTTON_MINWIDTH 2.0f
-#define PWL_SCROLLBAR_TRANSPARANCY 150
-#define PWL_SCROLLBAR_BKCOLOR CPWL_Color(COLORTYPE_RGB,220.0f/255.0f,220.0f/255.0f,220.0f/255.0f)
-#define PWL_DEFAULT_SELTEXTCOLOR CPWL_Color(COLORTYPE_RGB,1,1,1)
-#define PWL_DEFAULT_SELBACKCOLOR CPWL_Color(COLORTYPE_RGB,0,51.0f/255.0f,113.0f/255.0f)
-#define PWL_DEFAULT_BACKCOLOR PWL_DEFAULT_SELTEXTCOLOR
-#define PWL_DEFAULT_TEXTCOLOR CPWL_Color(COLORTYPE_RGB,0,0,0)
-#define PWL_DEFAULT_FONTSIZE 9.0f
-#define PWL_DEFAULT_BLACKCOLOR CPWL_Color(COLORTYPE_GRAY,0)
-#define PWL_DEFAULT_WHITECOLOR CPWL_Color(COLORTYPE_GRAY,1)
-#define PWL_DEFAULT_HEAVYGRAYCOLOR CPWL_Color(COLORTYPE_GRAY,0.50)
-#define PWL_DEFAULT_LIGHTGRAYCOLOR CPWL_Color(COLORTYPE_GRAY,0.75)
-#define PWL_TRIANGLE_HALFLEN 2.0f
-#define PWL_CBBUTTON_TRIANGLE_HALFLEN 3.0f
-#define PWL_INVALIDATE_INFLATE 2
-
-class IPWL_SpellCheck
-{
-public:
- virtual FX_BOOL CheckWord(FX_LPCSTR sWord) = 0;
- virtual void SuggestWords(FX_LPCSTR sWord, CFX_ByteStringArray & sSuggest) = 0;
-};
-
-class IPWL_Provider
-{
-public:
- //get a matrix which map user space to CWnd client space
- virtual CPDF_Matrix GetWindowMatrix(void* pAttachedData) = 0;
-
- /*
- 0 L"&Undo\tCtrl+Z"
- 1 L"&Redo\tCtrl+Shift+Z"
- 2 L"Cu&t\tCtrl+X"
- 3 L"&Copy\tCtrl+C"
- 4 L"&Paste\tCtrl+V"
- 5 L"&Delete"
- 6 L"&Select All\tCtrl+A"
- */
- virtual CFX_WideString LoadPopupMenuString(FX_INT32 nIndex) = 0;
-};
-
-class IPWL_FocusHandler
-{
-public:
- virtual void OnSetFocus(CPWL_Wnd* pWnd) = 0;
- virtual void OnKillFocus(CPWL_Wnd* pWnd) = 0;
-};
-
-struct PWL_CREATEPARAM
-{
-public:
- PWL_CREATEPARAM() : rcRectWnd(0,0,0,0),
- pSystemHandler(NULL),
- pFontMap(NULL),
- pProvider(NULL),
- pFocusHandler(NULL),
- dwFlags(0),
- sBackgroundColor(),
- hAttachedWnd(NULL),
- pSpellCheck(NULL),
- nBorderStyle(PBS_SOLID),
- dwBorderWidth(1),
- sBorderColor(),
- sTextColor(),
- sTextStrokeColor(),
- nTransparency(255),
- fFontSize(PWL_DEFAULT_FONTSIZE),
- sDash(3,0,0),
- pAttachedData(NULL),
- pParentWnd(NULL),
- pMsgControl(NULL),
- eCursorType(FXCT_ARROW),
- mtChild(1,0,0,1,0,0)
- {
- }
-
- CPDF_Rect rcRectWnd; //required
- IFX_SystemHandler* pSystemHandler; //required
- IFX_Edit_FontMap* pFontMap; //required for text window
- IPWL_Provider* pProvider; //required for self coordinate
- IPWL_FocusHandler* pFocusHandler; //optional
- FX_DWORD dwFlags; //optional
- CPWL_Color sBackgroundColor; //optional
- FX_HWND hAttachedWnd; //required for no-reader framework
- IPWL_SpellCheck* pSpellCheck; //required for spellchecking
- FX_INT32 nBorderStyle; //optional
- FX_INT32 dwBorderWidth; //optional
- CPWL_Color sBorderColor; //optional
- CPWL_Color sTextColor; //optional
- CPWL_Color sTextStrokeColor; //optional
- FX_INT32 nTransparency; //optional
- FX_FLOAT fFontSize; //optional
- CPWL_Dash sDash; //optional
- void* pAttachedData; //optional
- CPWL_Wnd* pParentWnd; //ignore
- CPWL_MsgControl* pMsgControl; //ignore
- FX_INT32 eCursorType; //ignore
- CPDF_Matrix mtChild; //ignore
-};
-
-class CPWL_Timer
-{
-public:
- CPWL_Timer(CPWL_TimerHandler* pAttached, IFX_SystemHandler* pSystemHandler);
- virtual ~CPWL_Timer();
-
- FX_INT32 SetPWLTimer(FX_INT32 nElapse);
- void KillPWLTimer();
- static void TimerProc(FX_INT32 idEvent);
-
-private:
- FX_INT32 m_nTimerID;
- CPWL_TimerHandler* m_pAttached;
- IFX_SystemHandler* m_pSystemHandler;
-};
-
-class PWL_CLASS CPWL_TimerHandler
-{
-public:
- CPWL_TimerHandler();
- virtual ~CPWL_TimerHandler();
-
- void BeginTimer(FX_INT32 nElapse);
- void EndTimer();
- virtual void TimerProc();
- virtual IFX_SystemHandler* GetSystemHandler() const = 0;
-
-private:
- CPWL_Timer* m_pTimer;
-};
-
-class PWL_CLASS CPWL_Wnd : public CPWL_TimerHandler
-{
- friend class CPWL_MsgControl;
-public:
- CPWL_Wnd();
- virtual ~CPWL_Wnd();
-
- void Create(const PWL_CREATEPARAM & cp);
- virtual CFX_ByteString GetClassName() const;
- void Destroy();
- void Move(const CPDF_Rect & rcNew,FX_BOOL bReset,FX_BOOL bRefresh);
- virtual void InvalidateRect(CPDF_Rect* pRect = NULL);
-
- void GetAppearanceStream(CFX_ByteString & sAppStream);
- void DrawAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device);
-
- virtual FX_BOOL OnKeyDown(FX_WORD nChar, FX_DWORD nFlag);
- virtual FX_BOOL OnKeyUp(FX_WORD nChar, FX_DWORD nFlag);
- virtual FX_BOOL OnChar(FX_WORD nChar, FX_DWORD nFlag);
- virtual FX_BOOL OnLButtonDblClk(const CPDF_Point & point, FX_DWORD nFlag);
- virtual FX_BOOL OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag);
- virtual FX_BOOL OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
- virtual FX_BOOL OnMButtonDblClk(const CPDF_Point & point, FX_DWORD nFlag);
- virtual FX_BOOL OnMButtonDown(const CPDF_Point & point, FX_DWORD nFlag);
- virtual FX_BOOL OnMButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
- virtual FX_BOOL OnRButtonDblClk(const CPDF_Point & point, FX_DWORD nFlag);
- virtual FX_BOOL OnRButtonDown(const CPDF_Point & point, FX_DWORD nFlag);
- virtual FX_BOOL OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
- virtual FX_BOOL OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag);
- virtual FX_BOOL OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag);
-
- virtual void SetFocus();
- virtual void KillFocus();
- void SetCapture();
- void ReleaseCapture();
-
- virtual void OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam = 0, FX_INTPTR lParam = 0);
- virtual void SetTextColor(const CPWL_Color & color);
- virtual void SetTextStrokeColor(const CPWL_Color & color);
- virtual void SetVisible(FX_BOOL bVisible);
-
- virtual CPDF_Rect GetFocusRect() const;
- virtual CPWL_Color GetBackgroundColor() const;
- virtual CPWL_Color GetBorderColor() const;
- virtual CPWL_Color GetTextColor() const;
- virtual CPWL_Color GetTextStrokeColor() const;
- virtual FX_FLOAT GetFontSize() const;
- virtual FX_INT32 GetInnerBorderWidth() const;
- virtual CPWL_Color GetBorderLeftTopColor(FX_INT32 nBorderStyle) const;
- virtual CPWL_Color GetBorderRightBottomColor(FX_INT32 nBorderStyle) const;
-
- virtual FX_BOOL IsModified() const {return FALSE;}
-
- virtual void SetFontSize(FX_FLOAT fFontSize);
-
- void SetBackgroundColor(const CPWL_Color & color);
- void SetBorderColor(const CPWL_Color & color);
- void SetBorderWidth(FX_INT32 nBorderWidth);
- void SetClipRect(const CPDF_Rect & rect);
- void SetBorderStyle(FX_INT32 eBorderStyle);
- void SetBorderDash(const CPWL_Dash & sDash);
-
- CPDF_Rect GetOriginWindowRect() const;
- virtual CPDF_Rect GetWindowRect() const;
- virtual CPDF_Rect GetClientRect() const;
- CPDF_Point GetCenterPoint() const;
- CPDF_Rect GetClientCenterSquare() const;
- CPDF_Rect GetWindowCenterSquare() const;
- FX_INT32 GetBorderWidth() const;
- FX_BOOL IsVisible() const {return m_bVisible;}
- FX_BOOL HasFlag(FX_DWORD dwFlags) const;
- void AddFlag(FX_DWORD dwFlags);
- void RemoveFlag(FX_DWORD dwFlags);
- CPDF_Rect GetClipRect() const;
- CPWL_Wnd* GetParentWindow() const;
- FX_INT32 GetBorderStyle() const;
- CPWL_Dash GetBorderDash() const;
- void* GetAttachedData() const;
-
- FX_BOOL WndHitTest(const CPDF_Point & point) const;
- FX_BOOL ClientHitTest(const CPDF_Point & point) const;
- FX_BOOL IsCaptureMouse() const;
-
- const CPWL_Wnd* GetFocused() const;
- FX_BOOL IsFocused() const;
- FX_BOOL IsReadOnly() const;
- CPWL_ScrollBar* GetVScrollBar() const;
-
- IFX_Edit_FontMap* GetFontMap() const;
- IPWL_Provider* GetProvider() const;
- virtual IFX_SystemHandler* GetSystemHandler() const;
- IPWL_FocusHandler* GetFocusHandler() const;
-
- FX_INT32 GetTransparency();
- void SetTransparency(FX_INT32 nTransparency);
-
- CPDF_Matrix GetChildToRoot() const;
- CPDF_Matrix GetChildMatrix() const;
- void SetChildMatrix(const CPDF_Matrix& mt);
- CPDF_Matrix GetWindowMatrix() const;
-
- virtual CPDF_Point ChildToParent(const CPDF_Point& point) const;
- virtual CPDF_Rect ChildToParent(const CPDF_Rect& rect) const;
- virtual CPDF_Point ParentToChild(const CPDF_Point& point) const;
- virtual CPDF_Rect ParentToChild(const CPDF_Rect& rect) const;
-
- //those methods only implemented by listctrl item
- virtual FX_FLOAT GetItemHeight(FX_FLOAT fLimitWidth) {return 0;}
- virtual FX_FLOAT GetItemLeftMargin() {return 0;}
- virtual FX_FLOAT GetItemRightMargin() {return 0;}
-
- void EnableWindow(FX_BOOL bEnable);
- FX_BOOL IsEnabled();
- virtual void SetCursor();
-
-protected:
- virtual void CreateChildWnd(const PWL_CREATEPARAM & cp);
- virtual void RePosChildWnd();
- void GetAppearanceStream(CFX_ByteTextBuf & sAppStream);
- virtual void GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream);
- virtual void GetChildAppearanceStream(CFX_ByteTextBuf & sAppStream);
-
- virtual void DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device);
- virtual void DrawChildAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device);
-
- virtual void OnCreate(PWL_CREATEPARAM & cp);
- virtual void OnCreated();
- virtual void OnDestroy();
-
- virtual void OnSetFocus();
- virtual void OnKillFocus();
-
- virtual void OnEnabled();
- virtual void OnDisabled();
-
- void SetNotifyFlag(FX_BOOL bNotifying = TRUE){m_bNotifying = bNotifying;};
-
- FX_BOOL IsValid() const;
- PWL_CREATEPARAM GetCreationParam() const;
- FX_BOOL IsNotifying() const {return m_bNotifying;}
-
- void InvalidateRectMove(const CPDF_Rect & rcOld, const CPDF_Rect & rcNew);
-
- void PWLtoWnd(const CPDF_Point & point, FX_INT32& x, FX_INT32& y) const;
- FX_RECT PWLtoWnd(const CPDF_Rect & rect) const;
- FX_HWND GetAttachedHWnd() const;
-
- FX_BOOL IsWndCaptureMouse(const CPWL_Wnd * pWnd) const;
- FX_BOOL IsWndCaptureKeyboard(const CPWL_Wnd * pWnd) const;
- const CPWL_Wnd* GetRootWnd() const;
-
- FX_BOOL IsCTRLpressed(FX_DWORD nFlag) const;
- FX_BOOL IsSHIFTpressed(FX_DWORD nFlag) const;
- FX_BOOL IsALTpressed(FX_DWORD nFlag) const;
- FX_BOOL IsINSERTpressed(FX_DWORD nFlag) const;
-
-private:
- void AddChild(CPWL_Wnd * pWnd);
- void RemoveChild(CPWL_Wnd * pWnd);
-
- void CreateScrollBar(const PWL_CREATEPARAM & cp);
- void CreateVScrollBar(const PWL_CREATEPARAM & cp);
-
- void AjustStyle();
- void CreateMsgControl();
- void DestroyMsgControl();
-
- CPWL_MsgControl* GetMsgControl() const;
-
-protected:
- CFX_ArrayTemplate<CPWL_Wnd*> m_aChildren;
-
-private:
- PWL_CREATEPARAM m_sPrivateParam;
-
- CPWL_ScrollBar* m_pVScrollBar;
-
- CPDF_Rect m_rcWindow;
- CPDF_Rect m_rcClip;
-
- FX_BOOL m_bCreated;
- FX_BOOL m_bVisible;
- FX_BOOL m_bNotifying;
- FX_BOOL m_bEnabled;
-};
-
-// #ifndef VK_END
-//
-// #define VK_END 0x23
-// #define VK_HOME 0x24
-// #define VK_LEFT 0x25
-// #define VK_UP 0x26
-// #define VK_RIGHT 0x27
-// #define VK_DOWN 0x28
-// #define VK_INSERT 0x2D
-// #define VK_DELETE 0x2E
-//
-// #define VK_BACK 0x08
-// #define VK_TAB 0x09
-//
-// #define VK_CLEAR 0x0C
-// #define VK_RETURN 0x0D
-// #define VK_ESCAPE 0x1B
-// #define VK_SPACE 0x20
-// #endif
-//
-// #define VK_NONE 0
-
-#endif // !defined(AFX_PWL_WND_H__D32812AD_A875_4E08_9D3C_0A57020987C6__INCLUDED_)
-
-
+// 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 _PWL_WND_H_
+#define _PWL_WND_H_
+
+class IPWL_Provider;
+class CPWL_Wnd;
+class CPWL_MsgControl;
+class CPWL_Wnd;
+class CPWL_ScrollBar;
+class CPWL_Timer;
+class CPWL_TimerHandler;
+class IPWL_SpellCheck;
+class IFX_SystemHandler;
+
+#ifdef FX_READER_DLL
+ #ifdef PWL_EXPORT
+ #define PWL_CLASS __declspec(dllexport)
+ #define PWL_FUNCTION PWL_CLASS
+ #else
+ #define PWL_CLASS
+ #define PWL_FUNCTION
+ #endif
+#else
+ #define PWL_CLASS
+ #define PWL_FUNCTION
+#endif
+
+//window styles
+#define PWS_CHILD 0x80000000L
+#define PWS_BORDER 0x40000000L
+#define PWS_BACKGROUND 0x20000000L
+#define PWS_HSCROLL 0x10000000L
+#define PWS_VSCROLL 0x08000000L
+#define PWS_VISIBLE 0x04000000L
+#define PWS_DISABLE 0x02000000L
+#define PWS_READONLY 0x01000000L
+#define PWS_AUTOFONTSIZE 0x00800000L
+#define PWS_AUTOTRANSPARENT 0x00400000L
+#define PWS_NOREFRESHCLIP 0x00200000L
+
+//edit and label styles
+#define PES_MULTILINE 0x0001L
+#define PES_PASSWORD 0x0002L
+#define PES_LEFT 0x0004L
+#define PES_RIGHT 0x0008L
+#define PES_MIDDLE 0x0010L
+#define PES_TOP 0x0020L
+#define PES_BOTTOM 0x0040L
+#define PES_CENTER 0x0080L
+#define PES_CHARARRAY 0x0100L
+#define PES_AUTOSCROLL 0x0200L
+#define PES_AUTORETURN 0x0400L
+#define PES_UNDO 0x0800L
+#define PES_RICH 0x1000L
+#define PES_SPELLCHECK 0x2000L
+#define PES_TEXTOVERFLOW 0x4000L
+#define PES_NOREAD 0x8000L
+
+//listbox styles
+#define PLBS_MULTIPLESEL 0x0001L
+#define PLBS_HOVERSEL 0x0008L
+
+//combobox styles
+#define PCBS_ALLOWCUSTOMTEXT 0x0001L
+
+//richedit styles
+#define PRES_MULTILINE 0x0001L
+#define PRES_AUTORETURN 0x0002L
+#define PRES_AUTOSCROLL 0x0004L
+#define PRES_SPELLCHECK 0x0008L
+#define PRES_UNDO 0x0100L
+#define PRES_MULTIPAGES 0x0200L
+#define PRES_TEXTOVERFLOW 0x0400L
+
+//border style
+#define PBS_SOLID 0
+#define PBS_DASH 1
+#define PBS_BEVELED 2
+#define PBS_INSET 3
+#define PBS_UNDERLINED 4
+#define PBS_SHADOW 5
+
+//notification messages
+#define PNM_ADDCHILD 0x00000000L
+#define PNM_REMOVECHILD 0x00000001L
+#define PNM_SETSCROLLINFO 0x00000002L
+#define PNM_SETSCROLLPOS 0x00000003L
+#define PNM_SCROLLWINDOW 0x00000004L
+#define PNM_LBUTTONDOWN 0x00000005L
+#define PNM_LBUTTONUP 0x00000006L
+#define PNM_MOUSEMOVE 0x00000007L
+#define PNM_NOTERESET 0x00000008L
+#define PNM_SETCARETINFO 0x00000009L
+#define PNM_SELCHANGED 0x0000000AL
+#define PNM_NOTEEDITCHANGED 0x0000000BL
+
+#define PWL_CLASSNAME_EDIT "CPWL_Edit"
+
+struct CPWL_Dash
+{
+ CPWL_Dash(FX_INT32 dash, FX_INT32 gap, FX_INT32 phase) : nDash(dash), nGap(gap), nPhase(phase)
+ {}
+
+ FX_INT32 nDash;
+ FX_INT32 nGap;
+ FX_INT32 nPhase;
+};
+
+struct PWL_CLASS CPWL_Color
+{
+ CPWL_Color(FX_INT32 type = COLORTYPE_TRANSPARENT, FX_FLOAT color1 = 0.0f, FX_FLOAT color2 = 0.0f, FX_FLOAT color3 = 0.0f, FX_FLOAT color4 = 0.0f)
+ : nColorType(type), fColor1(color1), fColor2(color2), fColor3(color3), fColor4(color4)
+ {}
+
+ CPWL_Color(FX_INT32 r, FX_INT32 g, FX_INT32 b) :
+ nColorType(COLORTYPE_RGB), fColor1(r/255.0f), fColor2(g/255.0f), fColor3(b/255.0f), fColor4(0)
+ {}
+
+ void ConvertColorType(FX_INT32 nColorType);
+
+ /*
+ COLORTYPE_TRANSPARENT
+ COLORTYPE_RGB
+ COLORTYPE_CMYK
+ COLORTYPE_GRAY
+ */
+ FX_INT32 nColorType;
+ FX_FLOAT fColor1,fColor2,fColor3,fColor4;
+};
+
+inline FX_BOOL operator == (const CPWL_Color &c1, const CPWL_Color &c2)
+{
+ return c1.nColorType == c2.nColorType &&
+ c1.fColor1 - c2.fColor1 < 0.0001 && c1.fColor1 - c2.fColor1 > -0.0001 &&
+ c1.fColor2 - c2.fColor2 < 0.0001 && c1.fColor2 - c2.fColor2 > -0.0001 &&
+ c1.fColor3 - c2.fColor3 < 0.0001 && c1.fColor3 - c2.fColor3 > -0.0001 &&
+ c1.fColor4 - c2.fColor4 < 0.0001 && c1.fColor4 - c2.fColor4 > -0.0001;
+}
+
+inline FX_BOOL operator != (const CPWL_Color &c1, const CPWL_Color &c2)
+{
+ return !operator == (c1, c2);
+}
+
+#define PWL_SCROLLBAR_WIDTH 12.0f
+#define PWL_SCROLLBAR_BUTTON_WIDTH 9.0f
+#define PWL_SCROLLBAR_POSBUTTON_MINWIDTH 2.0f
+#define PWL_SCROLLBAR_TRANSPARANCY 150
+#define PWL_SCROLLBAR_BKCOLOR CPWL_Color(COLORTYPE_RGB,220.0f/255.0f,220.0f/255.0f,220.0f/255.0f)
+#define PWL_DEFAULT_SELTEXTCOLOR CPWL_Color(COLORTYPE_RGB,1,1,1)
+#define PWL_DEFAULT_SELBACKCOLOR CPWL_Color(COLORTYPE_RGB,0,51.0f/255.0f,113.0f/255.0f)
+#define PWL_DEFAULT_BACKCOLOR PWL_DEFAULT_SELTEXTCOLOR
+#define PWL_DEFAULT_TEXTCOLOR CPWL_Color(COLORTYPE_RGB,0,0,0)
+#define PWL_DEFAULT_FONTSIZE 9.0f
+#define PWL_DEFAULT_BLACKCOLOR CPWL_Color(COLORTYPE_GRAY,0)
+#define PWL_DEFAULT_WHITECOLOR CPWL_Color(COLORTYPE_GRAY,1)
+#define PWL_DEFAULT_HEAVYGRAYCOLOR CPWL_Color(COLORTYPE_GRAY,0.50)
+#define PWL_DEFAULT_LIGHTGRAYCOLOR CPWL_Color(COLORTYPE_GRAY,0.75)
+#define PWL_TRIANGLE_HALFLEN 2.0f
+#define PWL_CBBUTTON_TRIANGLE_HALFLEN 3.0f
+#define PWL_INVALIDATE_INFLATE 2
+
+class IPWL_SpellCheck
+{
+public:
+ virtual FX_BOOL CheckWord(FX_LPCSTR sWord) = 0;
+ virtual void SuggestWords(FX_LPCSTR sWord, CFX_ByteStringArray & sSuggest) = 0;
+};
+
+class IPWL_Provider
+{
+public:
+ //get a matrix which map user space to CWnd client space
+ virtual CPDF_Matrix GetWindowMatrix(void* pAttachedData) = 0;
+
+ /*
+ 0 L"&Undo\tCtrl+Z"
+ 1 L"&Redo\tCtrl+Shift+Z"
+ 2 L"Cu&t\tCtrl+X"
+ 3 L"&Copy\tCtrl+C"
+ 4 L"&Paste\tCtrl+V"
+ 5 L"&Delete"
+ 6 L"&Select All\tCtrl+A"
+ */
+ virtual CFX_WideString LoadPopupMenuString(FX_INT32 nIndex) = 0;
+};
+
+class IPWL_FocusHandler
+{
+public:
+ virtual void OnSetFocus(CPWL_Wnd* pWnd) = 0;
+ virtual void OnKillFocus(CPWL_Wnd* pWnd) = 0;
+};
+
+struct PWL_CREATEPARAM
+{
+public:
+ PWL_CREATEPARAM() : rcRectWnd(0,0,0,0),
+ pSystemHandler(NULL),
+ pFontMap(NULL),
+ pProvider(NULL),
+ pFocusHandler(NULL),
+ dwFlags(0),
+ sBackgroundColor(),
+ hAttachedWnd(NULL),
+ pSpellCheck(NULL),
+ nBorderStyle(PBS_SOLID),
+ dwBorderWidth(1),
+ sBorderColor(),
+ sTextColor(),
+ sTextStrokeColor(),
+ nTransparency(255),
+ fFontSize(PWL_DEFAULT_FONTSIZE),
+ sDash(3,0,0),
+ pAttachedData(NULL),
+ pParentWnd(NULL),
+ pMsgControl(NULL),
+ eCursorType(FXCT_ARROW),
+ mtChild(1,0,0,1,0,0)
+ {
+ }
+
+ CPDF_Rect rcRectWnd; //required
+ IFX_SystemHandler* pSystemHandler; //required
+ IFX_Edit_FontMap* pFontMap; //required for text window
+ IPWL_Provider* pProvider; //required for self coordinate
+ IPWL_FocusHandler* pFocusHandler; //optional
+ FX_DWORD dwFlags; //optional
+ CPWL_Color sBackgroundColor; //optional
+ FX_HWND hAttachedWnd; //required for no-reader framework
+ IPWL_SpellCheck* pSpellCheck; //required for spellchecking
+ FX_INT32 nBorderStyle; //optional
+ FX_INT32 dwBorderWidth; //optional
+ CPWL_Color sBorderColor; //optional
+ CPWL_Color sTextColor; //optional
+ CPWL_Color sTextStrokeColor; //optional
+ FX_INT32 nTransparency; //optional
+ FX_FLOAT fFontSize; //optional
+ CPWL_Dash sDash; //optional
+ void* pAttachedData; //optional
+ CPWL_Wnd* pParentWnd; //ignore
+ CPWL_MsgControl* pMsgControl; //ignore
+ FX_INT32 eCursorType; //ignore
+ CPDF_Matrix mtChild; //ignore
+};
+
+class CPWL_Timer
+{
+public:
+ CPWL_Timer(CPWL_TimerHandler* pAttached, IFX_SystemHandler* pSystemHandler);
+ virtual ~CPWL_Timer();
+
+ FX_INT32 SetPWLTimer(FX_INT32 nElapse);
+ void KillPWLTimer();
+ static void TimerProc(FX_INT32 idEvent);
+
+private:
+ FX_INT32 m_nTimerID;
+ CPWL_TimerHandler* m_pAttached;
+ IFX_SystemHandler* m_pSystemHandler;
+};
+
+class PWL_CLASS CPWL_TimerHandler
+{
+public:
+ CPWL_TimerHandler();
+ virtual ~CPWL_TimerHandler();
+
+ void BeginTimer(FX_INT32 nElapse);
+ void EndTimer();
+ virtual void TimerProc();
+ virtual IFX_SystemHandler* GetSystemHandler() const = 0;
+
+private:
+ CPWL_Timer* m_pTimer;
+};
+
+class PWL_CLASS CPWL_Wnd : public CPWL_TimerHandler
+{
+ friend class CPWL_MsgControl;
+public:
+ CPWL_Wnd();
+ virtual ~CPWL_Wnd();
+
+ void Create(const PWL_CREATEPARAM & cp);
+ virtual CFX_ByteString GetClassName() const;
+ void Destroy();
+ void Move(const CPDF_Rect & rcNew,FX_BOOL bReset,FX_BOOL bRefresh);
+ virtual void InvalidateRect(CPDF_Rect* pRect = NULL);
+
+ void GetAppearanceStream(CFX_ByteString & sAppStream);
+ void DrawAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device);
+
+ virtual FX_BOOL OnKeyDown(FX_WORD nChar, FX_DWORD nFlag);
+ virtual FX_BOOL OnKeyUp(FX_WORD nChar, FX_DWORD nFlag);
+ virtual FX_BOOL OnChar(FX_WORD nChar, FX_DWORD nFlag);
+ virtual FX_BOOL OnLButtonDblClk(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnMButtonDblClk(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnMButtonDown(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnMButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnRButtonDblClk(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnRButtonDown(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag);
+ virtual FX_BOOL OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag);
+
+ virtual void SetFocus();
+ virtual void KillFocus();
+ void SetCapture();
+ void ReleaseCapture();
+
+ virtual void OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam = 0, FX_INTPTR lParam = 0);
+ virtual void SetTextColor(const CPWL_Color & color);
+ virtual void SetTextStrokeColor(const CPWL_Color & color);
+ virtual void SetVisible(FX_BOOL bVisible);
+
+ virtual CPDF_Rect GetFocusRect() const;
+ virtual CPWL_Color GetBackgroundColor() const;
+ virtual CPWL_Color GetBorderColor() const;
+ virtual CPWL_Color GetTextColor() const;
+ virtual CPWL_Color GetTextStrokeColor() const;
+ virtual FX_FLOAT GetFontSize() const;
+ virtual FX_INT32 GetInnerBorderWidth() const;
+ virtual CPWL_Color GetBorderLeftTopColor(FX_INT32 nBorderStyle) const;
+ virtual CPWL_Color GetBorderRightBottomColor(FX_INT32 nBorderStyle) const;
+
+ virtual FX_BOOL IsModified() const {return FALSE;}
+
+ virtual void SetFontSize(FX_FLOAT fFontSize);
+
+ void SetBackgroundColor(const CPWL_Color & color);
+ void SetBorderColor(const CPWL_Color & color);
+ void SetBorderWidth(FX_INT32 nBorderWidth);
+ void SetClipRect(const CPDF_Rect & rect);
+ void SetBorderStyle(FX_INT32 eBorderStyle);
+ void SetBorderDash(const CPWL_Dash & sDash);
+
+ CPDF_Rect GetOriginWindowRect() const;
+ virtual CPDF_Rect GetWindowRect() const;
+ virtual CPDF_Rect GetClientRect() const;
+ CPDF_Point GetCenterPoint() const;
+ CPDF_Rect GetClientCenterSquare() const;
+ CPDF_Rect GetWindowCenterSquare() const;
+ FX_INT32 GetBorderWidth() const;
+ FX_BOOL IsVisible() const {return m_bVisible;}
+ FX_BOOL HasFlag(FX_DWORD dwFlags) const;
+ void AddFlag(FX_DWORD dwFlags);
+ void RemoveFlag(FX_DWORD dwFlags);
+ CPDF_Rect GetClipRect() const;
+ CPWL_Wnd* GetParentWindow() const;
+ FX_INT32 GetBorderStyle() const;
+ CPWL_Dash GetBorderDash() const;
+ void* GetAttachedData() const;
+
+ FX_BOOL WndHitTest(const CPDF_Point & point) const;
+ FX_BOOL ClientHitTest(const CPDF_Point & point) const;
+ FX_BOOL IsCaptureMouse() const;
+
+ const CPWL_Wnd* GetFocused() const;
+ FX_BOOL IsFocused() const;
+ FX_BOOL IsReadOnly() const;
+ CPWL_ScrollBar* GetVScrollBar() const;
+
+ IFX_Edit_FontMap* GetFontMap() const;
+ IPWL_Provider* GetProvider() const;
+ virtual IFX_SystemHandler* GetSystemHandler() const;
+ IPWL_FocusHandler* GetFocusHandler() const;
+
+ FX_INT32 GetTransparency();
+ void SetTransparency(FX_INT32 nTransparency);
+
+ CPDF_Matrix GetChildToRoot() const;
+ CPDF_Matrix GetChildMatrix() const;
+ void SetChildMatrix(const CPDF_Matrix& mt);
+ CPDF_Matrix GetWindowMatrix() const;
+
+ virtual CPDF_Point ChildToParent(const CPDF_Point& point) const;
+ virtual CPDF_Rect ChildToParent(const CPDF_Rect& rect) const;
+ virtual CPDF_Point ParentToChild(const CPDF_Point& point) const;
+ virtual CPDF_Rect ParentToChild(const CPDF_Rect& rect) const;
+
+ //those methods only implemented by listctrl item
+ virtual FX_FLOAT GetItemHeight(FX_FLOAT fLimitWidth) {return 0;}
+ virtual FX_FLOAT GetItemLeftMargin() {return 0;}
+ virtual FX_FLOAT GetItemRightMargin() {return 0;}
+
+ void EnableWindow(FX_BOOL bEnable);
+ FX_BOOL IsEnabled();
+ virtual void SetCursor();
+
+protected:
+ virtual void CreateChildWnd(const PWL_CREATEPARAM & cp);
+ virtual void RePosChildWnd();
+ void GetAppearanceStream(CFX_ByteTextBuf & sAppStream);
+ virtual void GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream);
+ virtual void GetChildAppearanceStream(CFX_ByteTextBuf & sAppStream);
+
+ virtual void DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device);
+ virtual void DrawChildAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device);
+
+ virtual void OnCreate(PWL_CREATEPARAM & cp);
+ virtual void OnCreated();
+ virtual void OnDestroy();
+
+ virtual void OnSetFocus();
+ virtual void OnKillFocus();
+
+ virtual void OnEnabled();
+ virtual void OnDisabled();
+
+ void SetNotifyFlag(FX_BOOL bNotifying = TRUE){m_bNotifying = bNotifying;};
+
+ FX_BOOL IsValid() const;
+ PWL_CREATEPARAM GetCreationParam() const;
+ FX_BOOL IsNotifying() const {return m_bNotifying;}
+
+ void InvalidateRectMove(const CPDF_Rect & rcOld, const CPDF_Rect & rcNew);
+
+ void PWLtoWnd(const CPDF_Point & point, FX_INT32& x, FX_INT32& y) const;
+ FX_RECT PWLtoWnd(const CPDF_Rect & rect) const;
+ FX_HWND GetAttachedHWnd() const;
+
+ FX_BOOL IsWndCaptureMouse(const CPWL_Wnd * pWnd) const;
+ FX_BOOL IsWndCaptureKeyboard(const CPWL_Wnd * pWnd) const;
+ const CPWL_Wnd* GetRootWnd() const;
+
+ FX_BOOL IsCTRLpressed(FX_DWORD nFlag) const;
+ FX_BOOL IsSHIFTpressed(FX_DWORD nFlag) const;
+ FX_BOOL IsALTpressed(FX_DWORD nFlag) const;
+ FX_BOOL IsINSERTpressed(FX_DWORD nFlag) const;
+
+private:
+ void AddChild(CPWL_Wnd * pWnd);
+ void RemoveChild(CPWL_Wnd * pWnd);
+
+ void CreateScrollBar(const PWL_CREATEPARAM & cp);
+ void CreateVScrollBar(const PWL_CREATEPARAM & cp);
+
+ void AjustStyle();
+ void CreateMsgControl();
+ void DestroyMsgControl();
+
+ CPWL_MsgControl* GetMsgControl() const;
+
+protected:
+ CFX_ArrayTemplate<CPWL_Wnd*> m_aChildren;
+
+private:
+ PWL_CREATEPARAM m_sPrivateParam;
+
+ CPWL_ScrollBar* m_pVScrollBar;
+
+ CPDF_Rect m_rcWindow;
+ CPDF_Rect m_rcClip;
+
+ FX_BOOL m_bCreated;
+ FX_BOOL m_bVisible;
+ FX_BOOL m_bNotifying;
+ FX_BOOL m_bEnabled;
+};
+
+// #ifndef VK_END
+//
+// #define VK_END 0x23
+// #define VK_HOME 0x24
+// #define VK_LEFT 0x25
+// #define VK_UP 0x26
+// #define VK_RIGHT 0x27
+// #define VK_DOWN 0x28
+// #define VK_INSERT 0x2D
+// #define VK_DELETE 0x2E
+//
+// #define VK_BACK 0x08
+// #define VK_TAB 0x09
+//
+// #define VK_CLEAR 0x0C
+// #define VK_RETURN 0x0D
+// #define VK_ESCAPE 0x1B
+// #define VK_SPACE 0x20
+// #endif
+//
+// #define VK_NONE 0
+
+#endif // !defined(AFX_PWL_WND_H__D32812AD_A875_4E08_9D3C_0A57020987C6__INCLUDED_)
+
+
diff --git a/fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp b/fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp
index 59617ac09a..0c7cd48553 100644
--- a/fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp
+++ b/fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp
@@ -1,300 +1,300 @@
-// 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
-
-#include "../../include/formfiller/FormFiller.h"
-#include "../../include/formfiller/FFL_CBA_Fontmap.h"
-
-CBA_FontMap::CBA_FontMap(CPDFSDK_Annot* pAnnot, IFX_SystemHandler* pSystemHandler) :
- CPWL_FontMap(pSystemHandler),
- m_pDocument(NULL),
- m_pAnnotDict(NULL),
- m_pDefaultFont(NULL),
- m_sAPType("N")
-{
- ASSERT(pAnnot != NULL);
-
- CPDF_Page* pPage = pAnnot->GetPDFPage();
-
- m_pDocument = pPage->m_pDocument;
- m_pAnnotDict = pAnnot->GetPDFAnnot()->m_pAnnotDict;
-}
-
-CBA_FontMap::CBA_FontMap(CPDF_Document* pDocument, CPDF_Dictionary* pAnnotDict,
- IFX_SystemHandler* pSystemHandler) :
- CPWL_FontMap(pSystemHandler),
- m_pDocument(pDocument),
- m_pAnnotDict(pAnnotDict),
- m_pDefaultFont(NULL),
- m_sAPType("N")
-{
-}
-
-CBA_FontMap::~CBA_FontMap()
-{
-}
-
-void CBA_FontMap::Reset()
-{
- Empty();
- m_pDefaultFont = NULL;
- m_sDefaultFontName = "";
-}
-
-void CBA_FontMap::Initial(FX_LPCSTR fontname)
-{
- FX_INT32 nCharset = DEFAULT_CHARSET;
-
- if (!m_pDefaultFont)
- {
- m_pDefaultFont = GetAnnotDefaultFont(m_sDefaultFontName);
- if (m_pDefaultFont)
- {
- if (const CFX_SubstFont* pSubstFont = m_pDefaultFont->GetSubstFont())
- nCharset = pSubstFont->m_Charset;
- else
- {
- if (m_sDefaultFontName == "Wingdings" || m_sDefaultFontName == "Wingdings2" ||
- m_sDefaultFontName == "Wingdings3" || m_sDefaultFontName == "Webdings")
- nCharset = SYMBOL_CHARSET;
- else
- nCharset = ANSI_CHARSET;
- }
- AddFontData(m_pDefaultFont, m_sDefaultFontName, nCharset);
- AddFontToAnnotDict(m_pDefaultFont, m_sDefaultFontName);
- }
- }
-
- if (nCharset != ANSI_CHARSET)
- CPWL_FontMap::Initial(fontname);
-}
-
-void CBA_FontMap::SetDefaultFont(CPDF_Font * pFont, const CFX_ByteString & sFontName)
-{
- ASSERT(pFont != NULL);
-
- if (m_pDefaultFont) return;
-
- m_pDefaultFont = pFont;
- m_sDefaultFontName = sFontName;
-
-// if (m_sDefaultFontName.IsEmpty())
-// m_sDefaultFontName = pFont->GetFontTypeName();
-
- FX_INT32 nCharset = DEFAULT_CHARSET;
- if (const CFX_SubstFont* pSubstFont = m_pDefaultFont->GetSubstFont())
- nCharset = pSubstFont->m_Charset;
- AddFontData(m_pDefaultFont, m_sDefaultFontName, nCharset);
-}
-
-CPDF_Font* CBA_FontMap::FindFontSameCharset(CFX_ByteString& sFontAlias, FX_INT32 nCharset)
-{
- ASSERT(m_pAnnotDict != NULL);
-
- if (m_pAnnotDict->GetString("Subtype") == "Widget")
- {
- CPDF_Document* pDocument = GetDocument();
- ASSERT(pDocument != NULL);
-
- CPDF_Dictionary * pRootDict = pDocument->GetRoot();
- if (!pRootDict) return NULL;
-
- CPDF_Dictionary* pAcroFormDict = pRootDict->GetDict("AcroForm");
- if (!pAcroFormDict) return NULL;
-
- CPDF_Dictionary * pDRDict = pAcroFormDict->GetDict("DR");
- if (!pDRDict) return NULL;
-
- return FindResFontSameCharset(pDRDict, sFontAlias, nCharset);
- }
-
- return NULL;
-}
-
-CPDF_Document* CBA_FontMap::GetDocument()
-{
- return m_pDocument;
-}
-
-CPDF_Font* CBA_FontMap::FindResFontSameCharset(CPDF_Dictionary* pResDict, CFX_ByteString& sFontAlias,
- FX_INT32 nCharset)
-{
- if (!pResDict) return NULL;
-
- CPDF_Document* pDocument = GetDocument();
- ASSERT(pDocument != NULL);
-
- CPDF_Dictionary* pFonts = pResDict->GetDict("Font");
- if (pFonts == NULL) return NULL;
-
- CPDF_Font* pFind = NULL;
-
- FX_POSITION pos = pFonts->GetStartPos();
- while (pos)
- {
- CPDF_Object* pObj = NULL;
- CFX_ByteString csKey;
- pObj = pFonts->GetNextElement(pos, csKey);
- if (pObj == NULL) continue;
-
- CPDF_Object* pDirect = pObj->GetDirect();
- if (pDirect == NULL || pDirect->GetType() != PDFOBJ_DICTIONARY) continue;
-
- CPDF_Dictionary* pElement = (CPDF_Dictionary*)pDirect;
- if (pElement->GetString("Type") != "Font") continue;
-
- CPDF_Font* pFont = pDocument->LoadFont(pElement);
- if (pFont == NULL) continue;
- const CFX_SubstFont* pSubst = pFont->GetSubstFont();
- if (pSubst == NULL) continue;
- if (pSubst->m_Charset == nCharset)
- {
- sFontAlias = csKey;
- pFind = pFont;
- }
- }
- return pFind;
-}
-
-void CBA_FontMap::AddedFont(CPDF_Font* pFont, const CFX_ByteString& sFontAlias)
-{
- AddFontToAnnotDict(pFont, sFontAlias);
-}
-
-void CBA_FontMap::AddFontToAnnotDict(CPDF_Font* pFont, const CFX_ByteString& sAlias)
-{
- if (!pFont) return;
-
- ASSERT(m_pAnnotDict != NULL);
- ASSERT(m_pDocument != NULL);
-
- CPDF_Dictionary* pAPDict = m_pAnnotDict->GetDict("AP");
-
- if (pAPDict == NULL)
- {
- pAPDict = FX_NEW CPDF_Dictionary;
- m_pAnnotDict->SetAt("AP", pAPDict);
- }
-
- //to avoid checkbox and radiobutton
- CPDF_Object* pObject = pAPDict->GetElement(m_sAPType);
- if (pObject && pObject->GetType() == PDFOBJ_DICTIONARY)
- return;
-
- CPDF_Stream* pStream = pAPDict->GetStream(m_sAPType);
- if (pStream == NULL)
- {
- pStream = FX_NEW CPDF_Stream(NULL, 0, NULL);
- FX_INT32 objnum = m_pDocument->AddIndirectObject(pStream);
- pAPDict->SetAtReference(m_sAPType, m_pDocument, objnum);
- }
-
- CPDF_Dictionary * pStreamDict = pStream->GetDict();
-
- if (!pStreamDict)
- {
- pStreamDict = FX_NEW CPDF_Dictionary;
- pStream->InitStream(NULL, 0, pStreamDict);
- }
-
- if (pStreamDict)
- {
- CPDF_Dictionary* pStreamResList = pStreamDict->GetDict("Resources");
- if (!pStreamResList)
- {
- pStreamResList = FX_NEW CPDF_Dictionary();
- pStreamDict->SetAt("Resources", pStreamResList);
- }
-
- if (pStreamResList)
- {
- CPDF_Dictionary* pStreamResFontList = pStreamResList->GetDict("Font");
- if (!pStreamResFontList)
- {
- pStreamResFontList = FX_NEW CPDF_Dictionary;
- FX_INT32 objnum = m_pDocument->AddIndirectObject(pStreamResFontList);
- pStreamResList->SetAtReference("Font", m_pDocument, objnum);
- }
- if (!pStreamResFontList->KeyExist(sAlias))
- pStreamResFontList->SetAtReference(sAlias, m_pDocument, pFont->GetFontDict());
- }
- }
-}
-
-CPDF_Font* CBA_FontMap::GetAnnotDefaultFont(CFX_ByteString &sAlias)
-{
- ASSERT(m_pAnnotDict != NULL);
- ASSERT(m_pDocument != NULL);
-
- CPDF_Dictionary* pAcroFormDict = NULL;
-
- FX_BOOL bWidget = (m_pAnnotDict->GetString("Subtype") == "Widget");
-
- if (bWidget)
- {
- if (CPDF_Dictionary * pRootDict = m_pDocument->GetRoot())
- pAcroFormDict = pRootDict->GetDict("AcroForm");
- }
-
- CFX_ByteString sDA;
-
- sDA = FPDF_GetFieldAttr(m_pAnnotDict, "DA")->GetString();
-
- if (bWidget)
- {
- if (sDA.IsEmpty())
- {
- sDA = FPDF_GetFieldAttr(pAcroFormDict, "DA")->GetString();
- }
- }
-
- CPDF_Dictionary * pFontDict = NULL;
-
- if (!sDA.IsEmpty())
- {
- CPDF_SimpleParser syntax(sDA);
- syntax.FindTagParam("Tf", 2);
- CFX_ByteString sFontName = syntax.GetWord();
- sAlias = PDF_NameDecode(sFontName).Mid(1);
-
- if (CPDF_Dictionary * pDRDict = m_pAnnotDict->GetDict("DR"))
- if (CPDF_Dictionary* pDRFontDict = pDRDict->GetDict("Font"))
- pFontDict = pDRFontDict->GetDict(sAlias);
-
- if (!pFontDict)
- if (CPDF_Dictionary* pAPDict = m_pAnnotDict->GetDict("AP"))
- if (CPDF_Dictionary* pNormalDict = pAPDict->GetDict("N"))
- if (CPDF_Dictionary* pNormalResDict = pNormalDict->GetDict("Resources"))
- if (CPDF_Dictionary* pResFontDict = pNormalResDict->GetDict("Font"))
- pFontDict = pResFontDict->GetDict(sAlias);
-
- if (bWidget)
- {
- if (!pFontDict)
- {
- if (pAcroFormDict)
- {
- if (CPDF_Dictionary * pDRDict = pAcroFormDict->GetDict("DR"))
- if (CPDF_Dictionary* pDRFontDict = pDRDict->GetDict("Font"))
- pFontDict = pDRFontDict->GetDict(sAlias);
- }
- }
- }
- }
-
- if (pFontDict)
- return m_pDocument->LoadFont(pFontDict);
- else
- return NULL;
-}
-
-void CBA_FontMap::SetAPType(const CFX_ByteString& sAPType)
-{
- m_sAPType = sAPType;
-
- Reset();
- Initial();
-}
-
+// 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
+
+#include "../../include/formfiller/FormFiller.h"
+#include "../../include/formfiller/FFL_CBA_Fontmap.h"
+
+CBA_FontMap::CBA_FontMap(CPDFSDK_Annot* pAnnot, IFX_SystemHandler* pSystemHandler) :
+ CPWL_FontMap(pSystemHandler),
+ m_pDocument(NULL),
+ m_pAnnotDict(NULL),
+ m_pDefaultFont(NULL),
+ m_sAPType("N")
+{
+ ASSERT(pAnnot != NULL);
+
+ CPDF_Page* pPage = pAnnot->GetPDFPage();
+
+ m_pDocument = pPage->m_pDocument;
+ m_pAnnotDict = pAnnot->GetPDFAnnot()->m_pAnnotDict;
+}
+
+CBA_FontMap::CBA_FontMap(CPDF_Document* pDocument, CPDF_Dictionary* pAnnotDict,
+ IFX_SystemHandler* pSystemHandler) :
+ CPWL_FontMap(pSystemHandler),
+ m_pDocument(pDocument),
+ m_pAnnotDict(pAnnotDict),
+ m_pDefaultFont(NULL),
+ m_sAPType("N")
+{
+}
+
+CBA_FontMap::~CBA_FontMap()
+{
+}
+
+void CBA_FontMap::Reset()
+{
+ Empty();
+ m_pDefaultFont = NULL;
+ m_sDefaultFontName = "";
+}
+
+void CBA_FontMap::Initial(FX_LPCSTR fontname)
+{
+ FX_INT32 nCharset = DEFAULT_CHARSET;
+
+ if (!m_pDefaultFont)
+ {
+ m_pDefaultFont = GetAnnotDefaultFont(m_sDefaultFontName);
+ if (m_pDefaultFont)
+ {
+ if (const CFX_SubstFont* pSubstFont = m_pDefaultFont->GetSubstFont())
+ nCharset = pSubstFont->m_Charset;
+ else
+ {
+ if (m_sDefaultFontName == "Wingdings" || m_sDefaultFontName == "Wingdings2" ||
+ m_sDefaultFontName == "Wingdings3" || m_sDefaultFontName == "Webdings")
+ nCharset = SYMBOL_CHARSET;
+ else
+ nCharset = ANSI_CHARSET;
+ }
+ AddFontData(m_pDefaultFont, m_sDefaultFontName, nCharset);
+ AddFontToAnnotDict(m_pDefaultFont, m_sDefaultFontName);
+ }
+ }
+
+ if (nCharset != ANSI_CHARSET)
+ CPWL_FontMap::Initial(fontname);
+}
+
+void CBA_FontMap::SetDefaultFont(CPDF_Font * pFont, const CFX_ByteString & sFontName)
+{
+ ASSERT(pFont != NULL);
+
+ if (m_pDefaultFont) return;
+
+ m_pDefaultFont = pFont;
+ m_sDefaultFontName = sFontName;
+
+// if (m_sDefaultFontName.IsEmpty())
+// m_sDefaultFontName = pFont->GetFontTypeName();
+
+ FX_INT32 nCharset = DEFAULT_CHARSET;
+ if (const CFX_SubstFont* pSubstFont = m_pDefaultFont->GetSubstFont())
+ nCharset = pSubstFont->m_Charset;
+ AddFontData(m_pDefaultFont, m_sDefaultFontName, nCharset);
+}
+
+CPDF_Font* CBA_FontMap::FindFontSameCharset(CFX_ByteString& sFontAlias, FX_INT32 nCharset)
+{
+ ASSERT(m_pAnnotDict != NULL);
+
+ if (m_pAnnotDict->GetString("Subtype") == "Widget")
+ {
+ CPDF_Document* pDocument = GetDocument();
+ ASSERT(pDocument != NULL);
+
+ CPDF_Dictionary * pRootDict = pDocument->GetRoot();
+ if (!pRootDict) return NULL;
+
+ CPDF_Dictionary* pAcroFormDict = pRootDict->GetDict("AcroForm");
+ if (!pAcroFormDict) return NULL;
+
+ CPDF_Dictionary * pDRDict = pAcroFormDict->GetDict("DR");
+ if (!pDRDict) return NULL;
+
+ return FindResFontSameCharset(pDRDict, sFontAlias, nCharset);
+ }
+
+ return NULL;
+}
+
+CPDF_Document* CBA_FontMap::GetDocument()
+{
+ return m_pDocument;
+}
+
+CPDF_Font* CBA_FontMap::FindResFontSameCharset(CPDF_Dictionary* pResDict, CFX_ByteString& sFontAlias,
+ FX_INT32 nCharset)
+{
+ if (!pResDict) return NULL;
+
+ CPDF_Document* pDocument = GetDocument();
+ ASSERT(pDocument != NULL);
+
+ CPDF_Dictionary* pFonts = pResDict->GetDict("Font");
+ if (pFonts == NULL) return NULL;
+
+ CPDF_Font* pFind = NULL;
+
+ FX_POSITION pos = pFonts->GetStartPos();
+ while (pos)
+ {
+ CPDF_Object* pObj = NULL;
+ CFX_ByteString csKey;
+ pObj = pFonts->GetNextElement(pos, csKey);
+ if (pObj == NULL) continue;
+
+ CPDF_Object* pDirect = pObj->GetDirect();
+ if (pDirect == NULL || pDirect->GetType() != PDFOBJ_DICTIONARY) continue;
+
+ CPDF_Dictionary* pElement = (CPDF_Dictionary*)pDirect;
+ if (pElement->GetString("Type") != "Font") continue;
+
+ CPDF_Font* pFont = pDocument->LoadFont(pElement);
+ if (pFont == NULL) continue;
+ const CFX_SubstFont* pSubst = pFont->GetSubstFont();
+ if (pSubst == NULL) continue;
+ if (pSubst->m_Charset == nCharset)
+ {
+ sFontAlias = csKey;
+ pFind = pFont;
+ }
+ }
+ return pFind;
+}
+
+void CBA_FontMap::AddedFont(CPDF_Font* pFont, const CFX_ByteString& sFontAlias)
+{
+ AddFontToAnnotDict(pFont, sFontAlias);
+}
+
+void CBA_FontMap::AddFontToAnnotDict(CPDF_Font* pFont, const CFX_ByteString& sAlias)
+{
+ if (!pFont) return;
+
+ ASSERT(m_pAnnotDict != NULL);
+ ASSERT(m_pDocument != NULL);
+
+ CPDF_Dictionary* pAPDict = m_pAnnotDict->GetDict("AP");
+
+ if (pAPDict == NULL)
+ {
+ pAPDict = FX_NEW CPDF_Dictionary;
+ m_pAnnotDict->SetAt("AP", pAPDict);
+ }
+
+ //to avoid checkbox and radiobutton
+ CPDF_Object* pObject = pAPDict->GetElement(m_sAPType);
+ if (pObject && pObject->GetType() == PDFOBJ_DICTIONARY)
+ return;
+
+ CPDF_Stream* pStream = pAPDict->GetStream(m_sAPType);
+ if (pStream == NULL)
+ {
+ pStream = FX_NEW CPDF_Stream(NULL, 0, NULL);
+ FX_INT32 objnum = m_pDocument->AddIndirectObject(pStream);
+ pAPDict->SetAtReference(m_sAPType, m_pDocument, objnum);
+ }
+
+ CPDF_Dictionary * pStreamDict = pStream->GetDict();
+
+ if (!pStreamDict)
+ {
+ pStreamDict = FX_NEW CPDF_Dictionary;
+ pStream->InitStream(NULL, 0, pStreamDict);
+ }
+
+ if (pStreamDict)
+ {
+ CPDF_Dictionary* pStreamResList = pStreamDict->GetDict("Resources");
+ if (!pStreamResList)
+ {
+ pStreamResList = FX_NEW CPDF_Dictionary();
+ pStreamDict->SetAt("Resources", pStreamResList);
+ }
+
+ if (pStreamResList)
+ {
+ CPDF_Dictionary* pStreamResFontList = pStreamResList->GetDict("Font");
+ if (!pStreamResFontList)
+ {
+ pStreamResFontList = FX_NEW CPDF_Dictionary;
+ FX_INT32 objnum = m_pDocument->AddIndirectObject(pStreamResFontList);
+ pStreamResList->SetAtReference("Font", m_pDocument, objnum);
+ }
+ if (!pStreamResFontList->KeyExist(sAlias))
+ pStreamResFontList->SetAtReference(sAlias, m_pDocument, pFont->GetFontDict());
+ }
+ }
+}
+
+CPDF_Font* CBA_FontMap::GetAnnotDefaultFont(CFX_ByteString &sAlias)
+{
+ ASSERT(m_pAnnotDict != NULL);
+ ASSERT(m_pDocument != NULL);
+
+ CPDF_Dictionary* pAcroFormDict = NULL;
+
+ FX_BOOL bWidget = (m_pAnnotDict->GetString("Subtype") == "Widget");
+
+ if (bWidget)
+ {
+ if (CPDF_Dictionary * pRootDict = m_pDocument->GetRoot())
+ pAcroFormDict = pRootDict->GetDict("AcroForm");
+ }
+
+ CFX_ByteString sDA;
+
+ sDA = FPDF_GetFieldAttr(m_pAnnotDict, "DA")->GetString();
+
+ if (bWidget)
+ {
+ if (sDA.IsEmpty())
+ {
+ sDA = FPDF_GetFieldAttr(pAcroFormDict, "DA")->GetString();
+ }
+ }
+
+ CPDF_Dictionary * pFontDict = NULL;
+
+ if (!sDA.IsEmpty())
+ {
+ CPDF_SimpleParser syntax(sDA);
+ syntax.FindTagParam("Tf", 2);
+ CFX_ByteString sFontName = syntax.GetWord();
+ sAlias = PDF_NameDecode(sFontName).Mid(1);
+
+ if (CPDF_Dictionary * pDRDict = m_pAnnotDict->GetDict("DR"))
+ if (CPDF_Dictionary* pDRFontDict = pDRDict->GetDict("Font"))
+ pFontDict = pDRFontDict->GetDict(sAlias);
+
+ if (!pFontDict)
+ if (CPDF_Dictionary* pAPDict = m_pAnnotDict->GetDict("AP"))
+ if (CPDF_Dictionary* pNormalDict = pAPDict->GetDict("N"))
+ if (CPDF_Dictionary* pNormalResDict = pNormalDict->GetDict("Resources"))
+ if (CPDF_Dictionary* pResFontDict = pNormalResDict->GetDict("Font"))
+ pFontDict = pResFontDict->GetDict(sAlias);
+
+ if (bWidget)
+ {
+ if (!pFontDict)
+ {
+ if (pAcroFormDict)
+ {
+ if (CPDF_Dictionary * pDRDict = pAcroFormDict->GetDict("DR"))
+ if (CPDF_Dictionary* pDRFontDict = pDRDict->GetDict("Font"))
+ pFontDict = pDRFontDict->GetDict(sAlias);
+ }
+ }
+ }
+ }
+
+ if (pFontDict)
+ return m_pDocument->LoadFont(pFontDict);
+ else
+ return NULL;
+}
+
+void CBA_FontMap::SetAPType(const CFX_ByteString& sAPType)
+{
+ m_sAPType = sAPType;
+
+ Reset();
+ Initial();
+}
+
diff --git a/fpdfsdk/src/formfiller/FFL_CheckBox.cpp b/fpdfsdk/src/formfiller/FFL_CheckBox.cpp
index db79926733..f8035c7ec9 100644
--- a/fpdfsdk/src/formfiller/FFL_CheckBox.cpp
+++ b/fpdfsdk/src/formfiller/FFL_CheckBox.cpp
@@ -1,144 +1,144 @@
-// 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
-
-#include "../../include/formfiller/FormFiller.h"
-#include "../../include/formfiller/FFL_FormFiller.h"
-#include "../../include/formfiller/FFL_CheckBox.h"
-
-
-/* ------------------------------- CFFL_CheckBox ------------------------------- */
-
-CFFL_CheckBox::CFFL_CheckBox(CPDFDoc_Environment* pApp, CPDFSDK_Widget* pWidget) :
- CFFL_Button(pApp, pWidget)
-{
-}
-
-CFFL_CheckBox::~CFFL_CheckBox()
-{
-}
-
-CPWL_Wnd* CFFL_CheckBox::NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageView* pPageView)
-{
- CPWL_CheckBox* pWnd = new CPWL_CheckBox();
- pWnd->Create(cp);
-
- ASSERT(m_pWidget != NULL);
- pWnd->SetCheck(m_pWidget->IsChecked());
-
- return pWnd;
-}
-
-FX_BOOL CFFL_CheckBox::OnKeyDown(CPDFSDK_Annot* pAnnot, FX_UINT nKeyCode, FX_UINT nFlags)
-{
- switch (nKeyCode)
- {
- case FWL_VKEY_Return:
- case FWL_VKEY_Space:
- return TRUE;
- default:
- return CFFL_FormFiller::OnKeyDown(pAnnot, nKeyCode, nFlags);
- }
-}
-FX_BOOL CFFL_CheckBox::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags)
-{
- switch (nChar)
- {
- case FWL_VKEY_Return:
- case FWL_VKEY_Space:
- {
- CFFL_IFormFiller* pIFormFiller = m_pApp->GetIFormFiller();
- ASSERT(pIFormFiller != NULL);
-
- CPDFSDK_PageView* pPageView = pAnnot->GetPageView();
- ASSERT(pPageView != NULL);
-
- FX_BOOL bReset = FALSE;
- FX_BOOL bExit = FALSE;
-
- pIFormFiller->OnButtonUp(m_pWidget, pPageView, bReset, bExit,nFlags);
-
- if (bReset) return TRUE;
- if (bExit) return TRUE;
-
- CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags);
-
- if (CPWL_CheckBox * pWnd = (CPWL_CheckBox*)GetPDFWindow(pPageView, TRUE))
- pWnd->SetCheck(!pWnd->IsChecked());
-
- CommitData(pPageView,nFlags);
- return TRUE;
- }
- default:
- return CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags);
- }
-}
-
-FX_BOOL CFFL_CheckBox::OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
-{
- CFFL_Button::OnLButtonUp(pPageView, pAnnot, nFlags, point);
-
- if (IsValid())
- {
- if (CPWL_CheckBox * pWnd = (CPWL_CheckBox*)GetPDFWindow(pPageView, TRUE))
- {
- CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
- pWnd->SetCheck(!pWidget->IsChecked());
- // pWnd->SetCheck(!pWnd->IsChecked());
- }
-
- if (!CommitData(pPageView, nFlags)) return FALSE;
- }
-
- return TRUE;
-}
-
-FX_BOOL CFFL_CheckBox::IsDataChanged(CPDFSDK_PageView* pPageView)
-{
-
- ASSERT(m_pWidget != NULL);
-
- if (CPWL_CheckBox* pWnd = (CPWL_CheckBox*)GetPDFWindow(pPageView, FALSE))
- {
- return pWnd->IsChecked() != m_pWidget->IsChecked();
- }
-
- return FALSE;
-}
-
-void CFFL_CheckBox::SaveData(CPDFSDK_PageView* pPageView)
-{
-
- ASSERT(m_pWidget != NULL);
-
- if (CPWL_CheckBox* pWnd = (CPWL_CheckBox*)GetPDFWindow(pPageView, FALSE))
- {
-
- FX_BOOL bNewChecked = pWnd->IsChecked();
-
-
- if (bNewChecked)
- {
- CPDF_FormField* pField = m_pWidget->GetFormField();
- ASSERT(pField != NULL);
-
- for (FX_INT32 i=0,sz=pField->CountControls(); i<sz; i++)
- {
- if (CPDF_FormControl* pCtrl = pField->GetControl(i))
- {
- if (pCtrl->IsChecked())
- {
- break;
- }
- }
- }
- }
-
- m_pWidget->SetCheck(bNewChecked, FALSE);
- m_pWidget->UpdateField();
- SetChangeMark();
- }
-
-}
+// 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
+
+#include "../../include/formfiller/FormFiller.h"
+#include "../../include/formfiller/FFL_FormFiller.h"
+#include "../../include/formfiller/FFL_CheckBox.h"
+
+
+/* ------------------------------- CFFL_CheckBox ------------------------------- */
+
+CFFL_CheckBox::CFFL_CheckBox(CPDFDoc_Environment* pApp, CPDFSDK_Widget* pWidget) :
+ CFFL_Button(pApp, pWidget)
+{
+}
+
+CFFL_CheckBox::~CFFL_CheckBox()
+{
+}
+
+CPWL_Wnd* CFFL_CheckBox::NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageView* pPageView)
+{
+ CPWL_CheckBox* pWnd = new CPWL_CheckBox();
+ pWnd->Create(cp);
+
+ ASSERT(m_pWidget != NULL);
+ pWnd->SetCheck(m_pWidget->IsChecked());
+
+ return pWnd;
+}
+
+FX_BOOL CFFL_CheckBox::OnKeyDown(CPDFSDK_Annot* pAnnot, FX_UINT nKeyCode, FX_UINT nFlags)
+{
+ switch (nKeyCode)
+ {
+ case FWL_VKEY_Return:
+ case FWL_VKEY_Space:
+ return TRUE;
+ default:
+ return CFFL_FormFiller::OnKeyDown(pAnnot, nKeyCode, nFlags);
+ }
+}
+FX_BOOL CFFL_CheckBox::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags)
+{
+ switch (nChar)
+ {
+ case FWL_VKEY_Return:
+ case FWL_VKEY_Space:
+ {
+ CFFL_IFormFiller* pIFormFiller = m_pApp->GetIFormFiller();
+ ASSERT(pIFormFiller != NULL);
+
+ CPDFSDK_PageView* pPageView = pAnnot->GetPageView();
+ ASSERT(pPageView != NULL);
+
+ FX_BOOL bReset = FALSE;
+ FX_BOOL bExit = FALSE;
+
+ pIFormFiller->OnButtonUp(m_pWidget, pPageView, bReset, bExit,nFlags);
+
+ if (bReset) return TRUE;
+ if (bExit) return TRUE;
+
+ CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags);
+
+ if (CPWL_CheckBox * pWnd = (CPWL_CheckBox*)GetPDFWindow(pPageView, TRUE))
+ pWnd->SetCheck(!pWnd->IsChecked());
+
+ CommitData(pPageView,nFlags);
+ return TRUE;
+ }
+ default:
+ return CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags);
+ }
+}
+
+FX_BOOL CFFL_CheckBox::OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
+{
+ CFFL_Button::OnLButtonUp(pPageView, pAnnot, nFlags, point);
+
+ if (IsValid())
+ {
+ if (CPWL_CheckBox * pWnd = (CPWL_CheckBox*)GetPDFWindow(pPageView, TRUE))
+ {
+ CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
+ pWnd->SetCheck(!pWidget->IsChecked());
+ // pWnd->SetCheck(!pWnd->IsChecked());
+ }
+
+ if (!CommitData(pPageView, nFlags)) return FALSE;
+ }
+
+ return TRUE;
+}
+
+FX_BOOL CFFL_CheckBox::IsDataChanged(CPDFSDK_PageView* pPageView)
+{
+
+ ASSERT(m_pWidget != NULL);
+
+ if (CPWL_CheckBox* pWnd = (CPWL_CheckBox*)GetPDFWindow(pPageView, FALSE))
+ {
+ return pWnd->IsChecked() != m_pWidget->IsChecked();
+ }
+
+ return FALSE;
+}
+
+void CFFL_CheckBox::SaveData(CPDFSDK_PageView* pPageView)
+{
+
+ ASSERT(m_pWidget != NULL);
+
+ if (CPWL_CheckBox* pWnd = (CPWL_CheckBox*)GetPDFWindow(pPageView, FALSE))
+ {
+
+ FX_BOOL bNewChecked = pWnd->IsChecked();
+
+
+ if (bNewChecked)
+ {
+ CPDF_FormField* pField = m_pWidget->GetFormField();
+ ASSERT(pField != NULL);
+
+ for (FX_INT32 i=0,sz=pField->CountControls(); i<sz; i++)
+ {
+ if (CPDF_FormControl* pCtrl = pField->GetControl(i))
+ {
+ if (pCtrl->IsChecked())
+ {
+ break;
+ }
+ }
+ }
+ }
+
+ m_pWidget->SetCheck(bNewChecked, FALSE);
+ m_pWidget->UpdateField();
+ SetChangeMark();
+ }
+
+}
diff --git a/fpdfsdk/src/formfiller/FFL_ComboBox.cpp b/fpdfsdk/src/formfiller/FFL_ComboBox.cpp
index 3f2c453e5d..ee6b7bd83a 100644
--- a/fpdfsdk/src/formfiller/FFL_ComboBox.cpp
+++ b/fpdfsdk/src/formfiller/FFL_ComboBox.cpp
@@ -1,442 +1,442 @@
-// 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
-
-#include "../../include/formfiller/FormFiller.h"
-#include "../../include/formfiller/FFL_FormFiller.h"
-#include "../../include/formfiller/FFL_IFormFiller.h"
-#include "../../include/formfiller/FFL_CBA_Fontmap.h"
-#include "../../include/formfiller/FFL_ComboBox.h"
-
-
-/* ------------------------------- CFFL_ComboBox ------------------------------- */
-
-CFFL_ComboBox::CFFL_ComboBox(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pAnnot) :
- CFFL_FormFiller(pApp, pAnnot), m_pFontMap( NULL )
-{
- //m_pFontMap = new CBA_FontMap( pAnnot, GetSystemHandler() );
- m_State.nIndex = 0;
- m_State.nStart = 0;
- m_State.nEnd = 0;
-}
-
-CFFL_ComboBox::~CFFL_ComboBox()
-{
- if (m_pFontMap)
- {
- delete m_pFontMap;
- m_pFontMap = NULL;
- }
-
-// for (int i=0,sz=m_IMBox.GetSize(); i<sz; i++)
-// {
-// delete m_IMBox.GetAt(i);
-// }
-//
-// m_IMBox.RemoveAll();
-}
-
-PWL_CREATEPARAM CFFL_ComboBox::GetCreateParam()
-{
- PWL_CREATEPARAM cp = CFFL_FormFiller::GetCreateParam();
-
- ASSERT(m_pWidget != NULL);
-
- int nFlags = m_pWidget->GetFieldFlags();
-
- if (nFlags & FIELDFLAG_EDIT)
- {
- cp.dwFlags |= PCBS_ALLOWCUSTOMTEXT;
- }
-
- /*
- if (nFlags & FIELDFLAG_COMMITONSELCHANGE)
- {
- m_bCommitOnSelectChange = TRUE;
- }
- */
-
- if (!m_pFontMap)
- {
- ASSERT(this->m_pApp != NULL);
- m_pFontMap = new CBA_FontMap(m_pWidget, GetSystemHandler());
- m_pFontMap->Initial();
- }
-
- cp.pFontMap = m_pFontMap;
- cp.pFocusHandler = this;
-
- return cp;
-}
-
-CPWL_Wnd* CFFL_ComboBox::NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageView* pPageView)
-{
- CPWL_ComboBox * pWnd = new CPWL_ComboBox();
- pWnd->AttachFFLData(this);
- pWnd->Create(cp);
-
- ASSERT(m_pApp != NULL);
- CFFL_IFormFiller* pFormFiller = m_pApp->GetIFormFiller();
- pWnd->SetFillerNotify(pFormFiller);
-
- ASSERT(m_pWidget != NULL);
- FX_INT32 nCurSel = m_pWidget->GetSelectedIndex(0);
-
- CFX_WideString swText;
-
- if (nCurSel < 0)
- swText = m_pWidget->GetValue();
- else
- swText = m_pWidget->GetOptionLabel(nCurSel);
-
- for (FX_INT32 i=0,sz=m_pWidget->CountOptions(); i<sz; i++)
- {
- pWnd->AddString(m_pWidget->GetOptionLabel(i));
- }
-
- pWnd->SetSelect(nCurSel);
- pWnd->SetText(swText);
-
- return pWnd;
-}
-
-
-FX_BOOL CFFL_ComboBox::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags)
-{
- return CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags);
-}
-
-FX_BOOL CFFL_ComboBox::IsDataChanged(CPDFSDK_PageView* pPageView)
-{
- if (CPWL_ComboBox * pWnd = (CPWL_ComboBox*)GetPDFWindow(pPageView, FALSE))
- {
- FX_INT32 nCurSel = pWnd->GetSelect();
-
- ASSERT(m_pWidget != NULL);
-
- if (m_pWidget->GetFieldFlags() & FIELDFLAG_EDIT)
- {
- if (nCurSel >= 0)
- {
- return nCurSel != m_pWidget->GetSelectedIndex(0);
- }
- else
- {
- return pWnd->GetText() != m_pWidget->GetValue();
- }
- }
- else
- {
- return nCurSel != m_pWidget->GetSelectedIndex(0);
- }
- }
-
- return FALSE;
-}
-
-void CFFL_ComboBox::SaveData(CPDFSDK_PageView* pPageView)
-{
- ASSERT(m_pWidget != NULL);
-
- if (CPWL_ComboBox* pWnd = (CPWL_ComboBox*)GetPDFWindow(pPageView, FALSE))
- {
- CFX_WideString swText = pWnd->GetText();
- FX_INT32 nCurSel = pWnd->GetSelect();
-
- //mantis:0004157
- FX_BOOL bSetValue = TRUE;
-
- if (m_pWidget->GetFieldFlags() & FIELDFLAG_EDIT)
- {
- if (nCurSel >= 0)
- {
- if (swText != m_pWidget->GetOptionLabel(nCurSel))
- bSetValue = TRUE;
- else
- bSetValue = FALSE;
- }
- else
- bSetValue = TRUE;
- }
- else
- bSetValue = FALSE;
-
- CFX_WideString sOldValue;
-
-
- if (bSetValue)
- {
- sOldValue = m_pWidget->GetValue();
- m_pWidget->SetValue(swText, FALSE);
- }
- else
- {
- m_pWidget->GetSelectedIndex(0);
- m_pWidget->SetOptionSelection(nCurSel, TRUE, FALSE);
- }
-
- m_pWidget->ResetFieldAppearance(TRUE);
- m_pWidget->UpdateField();
- SetChangeMark();
-
- m_pWidget->GetPDFPage();
-
-
- }
-}
-
- void CFFL_ComboBox::GetActionData( CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type, PDFSDK_FieldAction& fa)
-{
- switch (type)
- {
- case CPDF_AAction::KeyStroke:
- if (CPWL_ComboBox* pComboBox = (CPWL_ComboBox*)GetPDFWindow(pPageView, FALSE))
- {
- if (CPWL_Edit* pEdit = (CPWL_Edit*)*pComboBox)
- {
- fa.bFieldFull = pEdit->IsTextFull();
- int nSelStart = 0;
- int nSelEnd = 0;
- pEdit->GetSel(nSelStart, nSelEnd);
- fa.nSelEnd = nSelEnd;
- fa.nSelStart = nSelStart;
- fa.sValue = pEdit->GetText();
- fa.sChangeEx = GetSelectExportText();
-
- if (fa.bFieldFull)
- {
- fa.sChange = L"";
- fa.sChangeEx = L"";
- }
- }
- }
- break;
- case CPDF_AAction::Validate:
- if (CPWL_ComboBox* pComboBox = (CPWL_ComboBox*)GetPDFWindow(pPageView, FALSE))
- {
- if (CPWL_Edit* pEdit = (CPWL_Edit*)*pComboBox)
- {
- fa.sValue = pEdit->GetText();
- }
- }
- break;
- case CPDF_AAction::LoseFocus:
- case CPDF_AAction::GetFocus:
- ASSERT(m_pWidget != NULL);
- fa.sValue = m_pWidget->GetValue();
- break;
- default:
- break;
- }
-}
-
-
-
-void CFFL_ComboBox::SetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type,
- const PDFSDK_FieldAction& fa)
-{
- switch (type)
- {
- case CPDF_AAction::KeyStroke:
- if (CPWL_ComboBox* pComboBox = (CPWL_ComboBox*)GetPDFWindow(pPageView, FALSE))
- {
- if (CPWL_Edit* pEdit = (CPWL_Edit*)*pComboBox)
- {
- pEdit->SetSel(fa.nSelStart, fa.nSelEnd);
- pEdit->ReplaceSel(fa.sChange);
- }
- }
- break;
- default:
- break;
- }
-}
-
-FX_BOOL CFFL_ComboBox::IsActionDataChanged(CPDF_AAction::AActionType type, const PDFSDK_FieldAction& faOld,
- const PDFSDK_FieldAction& faNew)
-{
- switch (type)
- {
- case CPDF_AAction::KeyStroke:
- return (!faOld.bFieldFull && faOld.nSelEnd != faNew.nSelEnd) || faOld.nSelStart != faNew.nSelStart ||
- faOld.sChange != faNew.sChange;
- default:
- break;
- }
-
- return FALSE;
-}
-
-void CFFL_ComboBox::SaveState(CPDFSDK_PageView* pPageView)
-{
- ASSERT(pPageView != NULL);
-
- if (CPWL_ComboBox* pComboBox = (CPWL_ComboBox*)GetPDFWindow(pPageView, FALSE))
- {
- m_State.nIndex = pComboBox->GetSelect();
-
- if (CPWL_Edit* pEdit = (CPWL_Edit*)*pComboBox)
- {
- pEdit->GetSel(m_State.nStart, m_State.nEnd);
- m_State.sValue = pEdit->GetText();
- }
- }
-}
-
-void CFFL_ComboBox::RestoreState(CPDFSDK_PageView* pPageView)
-{
- ASSERT(pPageView != NULL);
-
- if (CPWL_ComboBox* pComboBox = (CPWL_ComboBox*)GetPDFWindow(pPageView, TRUE))
- {
- if (m_State.nIndex >= 0)
- pComboBox->SetSelect(m_State.nIndex);
- else
- {
- if (CPWL_Edit* pEdit = (CPWL_Edit*)*pComboBox)
- {
- pEdit->SetText(m_State.sValue);
- pEdit->SetSel(m_State.nStart, m_State.nEnd);
- }
- }
- }
-}
-
-CPWL_Wnd* CFFL_ComboBox::ResetPDFWindow(CPDFSDK_PageView* pPageView, FX_BOOL bRestoreValue)
-{
- if (bRestoreValue)
- SaveState(pPageView);
-
- DestroyPDFWindow(pPageView);
-
- CPWL_Wnd* pRet = NULL;
-
- if (bRestoreValue)
- {
- RestoreState(pPageView);
- pRet = this->GetPDFWindow(pPageView, FALSE);
- }
- else
- pRet = this->GetPDFWindow(pPageView, TRUE);
-
- m_pWidget->UpdateField();
-
- return pRet;
-}
-
-void CFFL_ComboBox::OnKeyStroke(FX_BOOL bKeyDown, FX_UINT nFlag)
-{
- ASSERT(m_pWidget != NULL);
-
- int nFlags = m_pWidget->GetFieldFlags();
-
- if (nFlags & FIELDFLAG_COMMITONSELCHANGE)
- {
- if (m_bValid)
- {
- CPDFSDK_PageView* pPageView = this->GetCurPageView();
- ASSERT(pPageView != NULL);
-
- if (CommitData(pPageView, nFlag))
- {
- DestroyPDFWindow(pPageView);
- m_bValid = FALSE;
- }
- }
- }
-}
-
-void CFFL_ComboBox::OnSetFocus(CPWL_Wnd* pWnd)
-{
- ASSERT(m_pApp != NULL);
-
- ASSERT(pWnd != NULL);
-
- if (pWnd->GetClassName() == PWL_CLASSNAME_EDIT)
- {
- CPWL_Edit* pEdit = (CPWL_Edit*)pWnd;
- pEdit->SetCharSet(134);
- pEdit->SetCodePage(936);
-
- pEdit->SetReadyToInput();
- CFX_WideString wsText = pEdit->GetText();
- int nCharacters = wsText.GetLength();
- CFX_ByteString bsUTFText = wsText.UTF16LE_Encode();
- unsigned short* pBuffer = (unsigned short*)(FX_LPCSTR)bsUTFText;
- m_pApp->FFI_OnSetFieldInputFocus(m_pWidget->GetFormField(), pBuffer, nCharacters, TRUE);
-
- pEdit->SetEditNotify(this);
- }
-}
-
-void CFFL_ComboBox::OnKillFocus(CPWL_Wnd* pWnd)
-{
- ASSERT(m_pApp != NULL);
-}
-
-FX_BOOL CFFL_ComboBox::CanCopy(CPDFSDK_Document* pDocument)
-{
- ASSERT(pDocument != NULL);
-
- return FALSE;
-}
-
-FX_BOOL CFFL_ComboBox::CanCut(CPDFSDK_Document* pDocument)
-{
- ASSERT(pDocument != NULL);
-
- return FALSE;
-}
-
-FX_BOOL CFFL_ComboBox::CanPaste(CPDFSDK_Document* pDocument)
-{
- ASSERT(pDocument != NULL);
-
- return FALSE;
-}
-
-void CFFL_ComboBox::DoCopy(CPDFSDK_Document* pDocument)
-{
- ASSERT(pDocument != NULL);
-}
-
-void CFFL_ComboBox::DoCut(CPDFSDK_Document* pDocument)
-{
- ASSERT(pDocument != NULL);
-}
-
-void CFFL_ComboBox::DoPaste(CPDFSDK_Document* pDocument)
-{
- ASSERT(pDocument != NULL);
-}
-
-void CFFL_ComboBox::OnAddUndo(CPWL_Edit* pEdit)
-{
- ASSERT(pEdit != NULL);
-}
-
-CFX_WideString CFFL_ComboBox::GetSelectExportText()
-{
- CFX_WideString swRet;
-
- int nExport = -1;
- CPDFSDK_PageView *pPageView = GetCurPageView();
- if (CPWL_ComboBox * pComboBox = (CPWL_ComboBox*)GetPDFWindow(pPageView, FALSE))
- {
- nExport = pComboBox->GetSelect();
- }
-
- if (nExport >= 0)
- {
- if (CPDF_FormField * pFormField = m_pWidget->GetFormField())
- {
- swRet = pFormField->GetOptionValue(nExport);
- if (swRet.IsEmpty())
- swRet = pFormField->GetOptionLabel(nExport);
- }
- }
-
- return swRet;
-}
+// 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
+
+#include "../../include/formfiller/FormFiller.h"
+#include "../../include/formfiller/FFL_FormFiller.h"
+#include "../../include/formfiller/FFL_IFormFiller.h"
+#include "../../include/formfiller/FFL_CBA_Fontmap.h"
+#include "../../include/formfiller/FFL_ComboBox.h"
+
+
+/* ------------------------------- CFFL_ComboBox ------------------------------- */
+
+CFFL_ComboBox::CFFL_ComboBox(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pAnnot) :
+ CFFL_FormFiller(pApp, pAnnot), m_pFontMap( NULL )
+{
+ //m_pFontMap = new CBA_FontMap( pAnnot, GetSystemHandler() );
+ m_State.nIndex = 0;
+ m_State.nStart = 0;
+ m_State.nEnd = 0;
+}
+
+CFFL_ComboBox::~CFFL_ComboBox()
+{
+ if (m_pFontMap)
+ {
+ delete m_pFontMap;
+ m_pFontMap = NULL;
+ }
+
+// for (int i=0,sz=m_IMBox.GetSize(); i<sz; i++)
+// {
+// delete m_IMBox.GetAt(i);
+// }
+//
+// m_IMBox.RemoveAll();
+}
+
+PWL_CREATEPARAM CFFL_ComboBox::GetCreateParam()
+{
+ PWL_CREATEPARAM cp = CFFL_FormFiller::GetCreateParam();
+
+ ASSERT(m_pWidget != NULL);
+
+ int nFlags = m_pWidget->GetFieldFlags();
+
+ if (nFlags & FIELDFLAG_EDIT)
+ {
+ cp.dwFlags |= PCBS_ALLOWCUSTOMTEXT;
+ }
+
+ /*
+ if (nFlags & FIELDFLAG_COMMITONSELCHANGE)
+ {
+ m_bCommitOnSelectChange = TRUE;
+ }
+ */
+
+ if (!m_pFontMap)
+ {
+ ASSERT(this->m_pApp != NULL);
+ m_pFontMap = new CBA_FontMap(m_pWidget, GetSystemHandler());
+ m_pFontMap->Initial();
+ }
+
+ cp.pFontMap = m_pFontMap;
+ cp.pFocusHandler = this;
+
+ return cp;
+}
+
+CPWL_Wnd* CFFL_ComboBox::NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageView* pPageView)
+{
+ CPWL_ComboBox * pWnd = new CPWL_ComboBox();
+ pWnd->AttachFFLData(this);
+ pWnd->Create(cp);
+
+ ASSERT(m_pApp != NULL);
+ CFFL_IFormFiller* pFormFiller = m_pApp->GetIFormFiller();
+ pWnd->SetFillerNotify(pFormFiller);
+
+ ASSERT(m_pWidget != NULL);
+ FX_INT32 nCurSel = m_pWidget->GetSelectedIndex(0);
+
+ CFX_WideString swText;
+
+ if (nCurSel < 0)
+ swText = m_pWidget->GetValue();
+ else
+ swText = m_pWidget->GetOptionLabel(nCurSel);
+
+ for (FX_INT32 i=0,sz=m_pWidget->CountOptions(); i<sz; i++)
+ {
+ pWnd->AddString(m_pWidget->GetOptionLabel(i));
+ }
+
+ pWnd->SetSelect(nCurSel);
+ pWnd->SetText(swText);
+
+ return pWnd;
+}
+
+
+FX_BOOL CFFL_ComboBox::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags)
+{
+ return CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags);
+}
+
+FX_BOOL CFFL_ComboBox::IsDataChanged(CPDFSDK_PageView* pPageView)
+{
+ if (CPWL_ComboBox * pWnd = (CPWL_ComboBox*)GetPDFWindow(pPageView, FALSE))
+ {
+ FX_INT32 nCurSel = pWnd->GetSelect();
+
+ ASSERT(m_pWidget != NULL);
+
+ if (m_pWidget->GetFieldFlags() & FIELDFLAG_EDIT)
+ {
+ if (nCurSel >= 0)
+ {
+ return nCurSel != m_pWidget->GetSelectedIndex(0);
+ }
+ else
+ {
+ return pWnd->GetText() != m_pWidget->GetValue();
+ }
+ }
+ else
+ {
+ return nCurSel != m_pWidget->GetSelectedIndex(0);
+ }
+ }
+
+ return FALSE;
+}
+
+void CFFL_ComboBox::SaveData(CPDFSDK_PageView* pPageView)
+{
+ ASSERT(m_pWidget != NULL);
+
+ if (CPWL_ComboBox* pWnd = (CPWL_ComboBox*)GetPDFWindow(pPageView, FALSE))
+ {
+ CFX_WideString swText = pWnd->GetText();
+ FX_INT32 nCurSel = pWnd->GetSelect();
+
+ //mantis:0004157
+ FX_BOOL bSetValue = TRUE;
+
+ if (m_pWidget->GetFieldFlags() & FIELDFLAG_EDIT)
+ {
+ if (nCurSel >= 0)
+ {
+ if (swText != m_pWidget->GetOptionLabel(nCurSel))
+ bSetValue = TRUE;
+ else
+ bSetValue = FALSE;
+ }
+ else
+ bSetValue = TRUE;
+ }
+ else
+ bSetValue = FALSE;
+
+ CFX_WideString sOldValue;
+
+
+ if (bSetValue)
+ {
+ sOldValue = m_pWidget->GetValue();
+ m_pWidget->SetValue(swText, FALSE);
+ }
+ else
+ {
+ m_pWidget->GetSelectedIndex(0);
+ m_pWidget->SetOptionSelection(nCurSel, TRUE, FALSE);
+ }
+
+ m_pWidget->ResetFieldAppearance(TRUE);
+ m_pWidget->UpdateField();
+ SetChangeMark();
+
+ m_pWidget->GetPDFPage();
+
+
+ }
+}
+
+ void CFFL_ComboBox::GetActionData( CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type, PDFSDK_FieldAction& fa)
+{
+ switch (type)
+ {
+ case CPDF_AAction::KeyStroke:
+ if (CPWL_ComboBox* pComboBox = (CPWL_ComboBox*)GetPDFWindow(pPageView, FALSE))
+ {
+ if (CPWL_Edit* pEdit = (CPWL_Edit*)*pComboBox)
+ {
+ fa.bFieldFull = pEdit->IsTextFull();
+ int nSelStart = 0;
+ int nSelEnd = 0;
+ pEdit->GetSel(nSelStart, nSelEnd);
+ fa.nSelEnd = nSelEnd;
+ fa.nSelStart = nSelStart;
+ fa.sValue = pEdit->GetText();
+ fa.sChangeEx = GetSelectExportText();
+
+ if (fa.bFieldFull)
+ {
+ fa.sChange = L"";
+ fa.sChangeEx = L"";
+ }
+ }
+ }
+ break;
+ case CPDF_AAction::Validate:
+ if (CPWL_ComboBox* pComboBox = (CPWL_ComboBox*)GetPDFWindow(pPageView, FALSE))
+ {
+ if (CPWL_Edit* pEdit = (CPWL_Edit*)*pComboBox)
+ {
+ fa.sValue = pEdit->GetText();
+ }
+ }
+ break;
+ case CPDF_AAction::LoseFocus:
+ case CPDF_AAction::GetFocus:
+ ASSERT(m_pWidget != NULL);
+ fa.sValue = m_pWidget->GetValue();
+ break;
+ default:
+ break;
+ }
+}
+
+
+
+void CFFL_ComboBox::SetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type,
+ const PDFSDK_FieldAction& fa)
+{
+ switch (type)
+ {
+ case CPDF_AAction::KeyStroke:
+ if (CPWL_ComboBox* pComboBox = (CPWL_ComboBox*)GetPDFWindow(pPageView, FALSE))
+ {
+ if (CPWL_Edit* pEdit = (CPWL_Edit*)*pComboBox)
+ {
+ pEdit->SetSel(fa.nSelStart, fa.nSelEnd);
+ pEdit->ReplaceSel(fa.sChange);
+ }
+ }
+ break;
+ default:
+ break;
+ }
+}
+
+FX_BOOL CFFL_ComboBox::IsActionDataChanged(CPDF_AAction::AActionType type, const PDFSDK_FieldAction& faOld,
+ const PDFSDK_FieldAction& faNew)
+{
+ switch (type)
+ {
+ case CPDF_AAction::KeyStroke:
+ return (!faOld.bFieldFull && faOld.nSelEnd != faNew.nSelEnd) || faOld.nSelStart != faNew.nSelStart ||
+ faOld.sChange != faNew.sChange;
+ default:
+ break;
+ }
+
+ return FALSE;
+}
+
+void CFFL_ComboBox::SaveState(CPDFSDK_PageView* pPageView)
+{
+ ASSERT(pPageView != NULL);
+
+ if (CPWL_ComboBox* pComboBox = (CPWL_ComboBox*)GetPDFWindow(pPageView, FALSE))
+ {
+ m_State.nIndex = pComboBox->GetSelect();
+
+ if (CPWL_Edit* pEdit = (CPWL_Edit*)*pComboBox)
+ {
+ pEdit->GetSel(m_State.nStart, m_State.nEnd);
+ m_State.sValue = pEdit->GetText();
+ }
+ }
+}
+
+void CFFL_ComboBox::RestoreState(CPDFSDK_PageView* pPageView)
+{
+ ASSERT(pPageView != NULL);
+
+ if (CPWL_ComboBox* pComboBox = (CPWL_ComboBox*)GetPDFWindow(pPageView, TRUE))
+ {
+ if (m_State.nIndex >= 0)
+ pComboBox->SetSelect(m_State.nIndex);
+ else
+ {
+ if (CPWL_Edit* pEdit = (CPWL_Edit*)*pComboBox)
+ {
+ pEdit->SetText(m_State.sValue);
+ pEdit->SetSel(m_State.nStart, m_State.nEnd);
+ }
+ }
+ }
+}
+
+CPWL_Wnd* CFFL_ComboBox::ResetPDFWindow(CPDFSDK_PageView* pPageView, FX_BOOL bRestoreValue)
+{
+ if (bRestoreValue)
+ SaveState(pPageView);
+
+ DestroyPDFWindow(pPageView);
+
+ CPWL_Wnd* pRet = NULL;
+
+ if (bRestoreValue)
+ {
+ RestoreState(pPageView);
+ pRet = this->GetPDFWindow(pPageView, FALSE);
+ }
+ else
+ pRet = this->GetPDFWindow(pPageView, TRUE);
+
+ m_pWidget->UpdateField();
+
+ return pRet;
+}
+
+void CFFL_ComboBox::OnKeyStroke(FX_BOOL bKeyDown, FX_UINT nFlag)
+{
+ ASSERT(m_pWidget != NULL);
+
+ int nFlags = m_pWidget->GetFieldFlags();
+
+ if (nFlags & FIELDFLAG_COMMITONSELCHANGE)
+ {
+ if (m_bValid)
+ {
+ CPDFSDK_PageView* pPageView = this->GetCurPageView();
+ ASSERT(pPageView != NULL);
+
+ if (CommitData(pPageView, nFlag))
+ {
+ DestroyPDFWindow(pPageView);
+ m_bValid = FALSE;
+ }
+ }
+ }
+}
+
+void CFFL_ComboBox::OnSetFocus(CPWL_Wnd* pWnd)
+{
+ ASSERT(m_pApp != NULL);
+
+ ASSERT(pWnd != NULL);
+
+ if (pWnd->GetClassName() == PWL_CLASSNAME_EDIT)
+ {
+ CPWL_Edit* pEdit = (CPWL_Edit*)pWnd;
+ pEdit->SetCharSet(134);
+ pEdit->SetCodePage(936);
+
+ pEdit->SetReadyToInput();
+ CFX_WideString wsText = pEdit->GetText();
+ int nCharacters = wsText.GetLength();
+ CFX_ByteString bsUTFText = wsText.UTF16LE_Encode();
+ unsigned short* pBuffer = (unsigned short*)(FX_LPCSTR)bsUTFText;
+ m_pApp->FFI_OnSetFieldInputFocus(m_pWidget->GetFormField(), pBuffer, nCharacters, TRUE);
+
+ pEdit->SetEditNotify(this);
+ }
+}
+
+void CFFL_ComboBox::OnKillFocus(CPWL_Wnd* pWnd)
+{
+ ASSERT(m_pApp != NULL);
+}
+
+FX_BOOL CFFL_ComboBox::CanCopy(CPDFSDK_Document* pDocument)
+{
+ ASSERT(pDocument != NULL);
+
+ return FALSE;
+}
+
+FX_BOOL CFFL_ComboBox::CanCut(CPDFSDK_Document* pDocument)
+{
+ ASSERT(pDocument != NULL);
+
+ return FALSE;
+}
+
+FX_BOOL CFFL_ComboBox::CanPaste(CPDFSDK_Document* pDocument)
+{
+ ASSERT(pDocument != NULL);
+
+ return FALSE;
+}
+
+void CFFL_ComboBox::DoCopy(CPDFSDK_Document* pDocument)
+{
+ ASSERT(pDocument != NULL);
+}
+
+void CFFL_ComboBox::DoCut(CPDFSDK_Document* pDocument)
+{
+ ASSERT(pDocument != NULL);
+}
+
+void CFFL_ComboBox::DoPaste(CPDFSDK_Document* pDocument)
+{
+ ASSERT(pDocument != NULL);
+}
+
+void CFFL_ComboBox::OnAddUndo(CPWL_Edit* pEdit)
+{
+ ASSERT(pEdit != NULL);
+}
+
+CFX_WideString CFFL_ComboBox::GetSelectExportText()
+{
+ CFX_WideString swRet;
+
+ int nExport = -1;
+ CPDFSDK_PageView *pPageView = GetCurPageView();
+ if (CPWL_ComboBox * pComboBox = (CPWL_ComboBox*)GetPDFWindow(pPageView, FALSE))
+ {
+ nExport = pComboBox->GetSelect();
+ }
+
+ if (nExport >= 0)
+ {
+ if (CPDF_FormField * pFormField = m_pWidget->GetFormField())
+ {
+ swRet = pFormField->GetOptionValue(nExport);
+ if (swRet.IsEmpty())
+ swRet = pFormField->GetOptionLabel(nExport);
+ }
+ }
+
+ return swRet;
+}
diff --git a/fpdfsdk/src/formfiller/FFL_FormFiller.cpp b/fpdfsdk/src/formfiller/FFL_FormFiller.cpp
index f514bf29d5..530b80ce6f 100644
--- a/fpdfsdk/src/formfiller/FFL_FormFiller.cpp
+++ b/fpdfsdk/src/formfiller/FFL_FormFiller.cpp
@@ -1,925 +1,925 @@
-// 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
-
-
-#include "../../include/formfiller/FFL_FormFiller.h"
-#include "../../include/formfiller/FFL_Notify.h"
-#include "../../include/formfiller/FFL_CBA_Fontmap.h"
-
-#define GetRed(rgb) ((FX_BYTE)(rgb))
-#define GetGreen(rgb) ((FX_BYTE)(((FX_WORD)(rgb)) >> 8))
-#define GetBlue(rgb) ((FX_BYTE)((rgb)>>16))
-
-#define FFL_HINT_ELAPSE 800
-
-/* ------------------------- CFFL_FormFiller ------------------------- */
-
-CFFL_FormFiller::CFFL_FormFiller(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pAnnot)
- :m_pApp(pApp),
- m_pAnnot(pAnnot),
- m_bValid(FALSE),
- m_ptOldPos(0,0)
-{
- m_pWidget = (CPDFSDK_Widget*) pAnnot;
-}
-
-CFFL_FormFiller::~CFFL_FormFiller()
-{
- FX_POSITION pos = m_Maps.GetStartPosition();
- while (pos)
- {
- CPDFSDK_PageView * pPageView = NULL;
- CPWL_Wnd* pWnd = NULL;
- m_Maps.GetNextAssoc(pos, pPageView, pWnd);
-
- if (pWnd)
- {
- CFFL_PrivateData* pData = (CFFL_PrivateData*)pWnd->GetAttachedData();
- pWnd->Destroy();
- delete pWnd;
- delete pData;
- }
- }
- m_Maps.RemoveAll();
-
-}
-
-void CFFL_FormFiller::SetWindowRect(CPDFSDK_PageView* pPageView, const CPDF_Rect& rcWindow)
-{
- if (CPWL_Wnd* pWnd = this->GetPDFWindow(pPageView, FALSE))
- {
- pWnd->Move(CPDF_Rect(rcWindow), TRUE, FALSE);
- }
-}
-
-CPDF_Rect CFFL_FormFiller::GetWindowRect(CPDFSDK_PageView* pPageView)
-{
- if (CPWL_Wnd* pWnd = this->GetPDFWindow(pPageView, FALSE))
- {
- return pWnd->GetWindowRect();
- }
-
- return CPDF_Rect(0,0,0,0);
-}
-
-FX_RECT CFFL_FormFiller::GetViewBBox(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot)
-{
- ASSERT(pPageView != NULL);
- ASSERT(pAnnot != NULL);
-
- CPDF_Rect rcAnnot = m_pWidget->GetRect();
-
- if (CPWL_Wnd* pWnd = this->GetPDFWindow(pPageView, FALSE))
- {
- CPDF_Rect rcWindow = pWnd->GetWindowRect();
- rcAnnot = PWLtoFFL(rcWindow);
- }
-
- CPDF_Rect rcWin = rcAnnot;
-// pPageView->DocToWindow(rcAnnot, rcWin);
-
- CPDF_Rect rcFocus = this->GetFocusBox(pPageView);
- if (!rcFocus.IsEmpty())
- rcWin.Union(rcFocus);
-
- CPDF_Rect rect = CPWL_Utils::InflateRect(rcWin,1);
-
- return rect.GetOutterRect();
-}
-
-void CFFL_FormFiller::OnDraw(CPDFSDK_PageView *pPageView, /*HDC hDC,*/ CPDFSDK_Annot* pAnnot,
- CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
- /*const CRect& rcWindow,*/ FX_DWORD dwFlags)
-{
- ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
-
- if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, FALSE))
- {
- CPDF_Matrix mt = this->GetCurMatrix();
- mt.Concat(*pUser2Device);
- pWnd->DrawAppearance(pDevice,&mt);
- }
- else
- {
- CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
- if (CFFL_IFormFiller::IsVisible(pWidget))
- pWidget->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, NULL);
- }
-}
-
-void CFFL_FormFiller::OnDrawDeactive(CPDFSDK_PageView *pPageView, /*HDC hDC,*/ CPDFSDK_Annot* pAnnot,
- CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
- /*const CRect& rcWindow,*/ FX_DWORD dwFlags)
-{
- ASSERT(pAnnot != NULL);
-
- CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
-
- pWidget->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, NULL);
-}
-
-
-void CFFL_FormFiller::OnCreate(CPDFSDK_Annot* pAnnot)
-{
-}
-
-void CFFL_FormFiller::OnLoad(CPDFSDK_Annot* pAnnot)
-{
-}
-
-void CFFL_FormFiller::OnDelete(CPDFSDK_Annot* pAnnot)
-{
-}
-
-void CFFL_FormFiller::OnMouseEnter(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot)
-{
-}
-
-void CFFL_FormFiller::OnMouseExit(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot)
-{
- EndTimer();
- ASSERT(m_pWidget != NULL);
-}
-
-FX_BOOL CFFL_FormFiller::OnLButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
-{
- if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, TRUE))
- {
- m_bValid = TRUE;
- FX_RECT rect = this->GetViewBBox(pPageView,pAnnot);
- this->InvalidateRect(rect.left, rect.top, rect.right, rect.bottom);
-
- if(!rect.Contains((int)point.x, (int)point.y))
- return FALSE;
-
- return pWnd->OnLButtonDown(WndtoPWL(pPageView, point),nFlags);
- }
-
- return FALSE;
-}
-
-FX_BOOL CFFL_FormFiller::OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
-{
- if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, FALSE))
- {
- FX_RECT rcFFL = this->GetViewBBox(pPageView, pAnnot);
- this->InvalidateRect(rcFFL.left, rcFFL.top, rcFFL.right, rcFFL.bottom);
- pWnd->OnLButtonUp(WndtoPWL(pPageView, point),nFlags);
- return TRUE;
- }
-
- return FALSE;
-}
-
-FX_BOOL CFFL_FormFiller::OnLButtonDblClk(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
-{
- if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, FALSE))
- {
- pWnd->OnLButtonDblClk(WndtoPWL(pPageView, point),nFlags);
- return TRUE;
- }
-
- return FALSE;
-}
-
-FX_BOOL CFFL_FormFiller::OnMouseMove(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
-{
- if ((m_ptOldPos.x != point.x) || (m_ptOldPos.y != point.y))
- {
- m_ptOldPos = point;
- }
-
- if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, FALSE))
- {
- pWnd->OnMouseMove(WndtoPWL(pPageView, point),nFlags);
- return TRUE;
- }
-
- return FALSE;
-}
-
-FX_BOOL CFFL_FormFiller::OnMouseWheel(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, short zDelta, const CPDF_Point& point)
-{
- if (!IsValid()) return FALSE;
-
- if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, TRUE))
- {
- return pWnd->OnMouseWheel(zDelta, WndtoPWL(pPageView, point),nFlags);
- }
-
- return FALSE;
-}
-
-FX_BOOL CFFL_FormFiller::OnRButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
-{
- if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, TRUE))
- {
- pWnd->OnRButtonDown(WndtoPWL(pPageView, point),nFlags);
- return TRUE;
- }
-
- return FALSE;
-}
-
-FX_BOOL CFFL_FormFiller::OnRButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
-{
- if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, FALSE))
- {
- pWnd->OnRButtonUp(WndtoPWL(pPageView, point),nFlags);
- return TRUE;
- }
-
- return FALSE;
-}
-
-FX_BOOL CFFL_FormFiller::OnRButtonDblClk(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
-{
- if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, FALSE))
- {
- pWnd->OnRButtonDblClk(WndtoPWL(pPageView, point),nFlags);
- return TRUE;
- }
-
- return FALSE;
-}
-
-FX_BOOL CFFL_FormFiller::OnKeyDown(CPDFSDK_Annot* pAnnot, FX_UINT nKeyCode, FX_UINT nFlags)
-{
- if (IsValid())
- {
- CPDFSDK_PageView* pPageView = this->GetCurPageView();
- ASSERT(pPageView != NULL);
-
- if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, FALSE))
- {
- return pWnd->OnKeyDown(nKeyCode,nFlags);
- }
- }
-
- return FALSE;
-}
-
-FX_BOOL CFFL_FormFiller::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags)
-{
- if (IsValid())
- {
- CPDFSDK_PageView* pPageView = this->GetCurPageView();
- ASSERT(pPageView != NULL);
-
- if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, FALSE))
- {
- return pWnd->OnChar(nChar,nFlags);
- }
- }
-
- return FALSE;
-}
-
-void CFFL_FormFiller::OnDeSelected(CPDFSDK_Annot* pAnnot)
-{
- ASSERT(FALSE);
-}
-
-void CFFL_FormFiller::OnSelected(CPDFSDK_Annot* pAnnot)
-{
- ASSERT(FALSE);
-}
-
-FX_BOOL CFFL_FormFiller::OnSetFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag)
-{
- CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
-
- CPDF_Page * pPage = pWidget->GetPDFPage();
- CPDFSDK_Document * pDoc = m_pApp->GetCurrentDoc();
- CPDFSDK_PageView* pPageView = pDoc->GetPageView(pPage);
- ASSERT(pPageView != NULL);
-
-
-
- CPWL_Wnd * pWnd = NULL;
- if ( (pWnd = GetPDFWindow(pPageView, TRUE)))
- {
- pWnd->SetFocus();
- }
-
- m_bValid = TRUE;
-
-
-
-
- m_bValid = TRUE;
- FX_RECT rcRect = this->GetViewBBox(pPageView,pAnnot);
- this->InvalidateRect(rcRect.left, rcRect.top, rcRect.right, rcRect.bottom);
-
- return TRUE;
-}
-
-FX_BOOL CFFL_FormFiller::OnKillFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag)
-{
- if (IsValid())
- {
- CPDFSDK_PageView* pPageView = this->GetCurPageView();
- ASSERT(pPageView != NULL);
-
- CommitData(pPageView, nFlag);
-
- if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE))
- {
- pWnd->KillFocus();
- }
-
- switch (m_pWidget->GetFieldType())
- {
- case FIELDTYPE_PUSHBUTTON:
- case FIELDTYPE_CHECKBOX:
- case FIELDTYPE_RADIOBUTTON:
- EscapeFiller(pPageView, TRUE);
- break;
- default:
- EscapeFiller(pPageView, FALSE);
- break;
- }
- }
-
- return TRUE;
-}
-
-FX_BOOL CFFL_FormFiller::IsValid() const
-{
- return m_bValid;
-}
-
-PWL_CREATEPARAM CFFL_FormFiller::GetCreateParam()
-{
- ASSERT(m_pApp != NULL);
-
- PWL_CREATEPARAM cp;
-
- cp.pParentWnd = NULL;
- cp.pProvider = this;
- cp.rcRectWnd = GetPDFWindowRect();
-
- FX_DWORD dwCreateFlags = PWS_BORDER | PWS_BACKGROUND | PWS_VISIBLE;
-
- ASSERT(m_pWidget != NULL);
-
-
- FX_DWORD dwFieldFlag = m_pWidget->GetFieldFlags();
-
- if (dwFieldFlag & FIELDFLAG_READONLY)
- {
- dwCreateFlags |= PWS_READONLY;
- }
-
- FX_COLORREF color;
- if (m_pWidget->GetFillColor(color))
- {
- cp.sBackgroundColor = CPWL_Color(GetRed(color), GetGreen(color), GetBlue(color));
- }
-
- if (m_pWidget->GetBorderColor(color))
- {
- cp.sBorderColor = CPWL_Color(GetRed(color), GetGreen(color), GetBlue(color));
- }
-
- cp.sTextColor = CPWL_Color(COLORTYPE_GRAY,0);
-
- if (m_pWidget->GetTextColor(color))
- {
- cp.sTextColor = CPWL_Color(GetRed(color), GetGreen(color), GetBlue(color));
- }
-
- cp.fFontSize = m_pWidget->GetFontSize();
- cp.dwBorderWidth = m_pWidget->GetBorderWidth();
-
- int nBorderStyle = m_pWidget->GetBorderStyle();
-
- switch (nBorderStyle)
- {
- case BBS_SOLID:
- cp.nBorderStyle = PBS_SOLID;
- break;
- case BBS_DASH:
- cp.nBorderStyle = PBS_DASH;
- cp.sDash = CPWL_Dash(3,3,0);
- break;
- case BBS_BEVELED:
- cp.nBorderStyle = PBS_BEVELED;
- cp.dwBorderWidth *= 2;
- break;
- case BBS_INSET:
- cp.nBorderStyle = PBS_INSET;
- cp.dwBorderWidth *= 2;
- break;
- case BBS_UNDERLINE:
- cp.nBorderStyle = PBS_UNDERLINED;
- break;
- }
-
- if (cp.fFontSize <= 0)
- {
- dwCreateFlags |= PWS_AUTOFONTSIZE;
- }
-
- cp.dwFlags = dwCreateFlags;
- cp.pSystemHandler = m_pApp->GetSysHandler();
- return cp;
-}
-
-CPWL_Wnd* CFFL_FormFiller::GetPDFWindow(CPDFSDK_PageView* pPageView, FX_BOOL bNew)
-{
- ASSERT(pPageView != NULL);
- ASSERT(m_pWidget != NULL);
-
- CPWL_Wnd* pWnd = NULL;
- m_Maps.Lookup(pPageView, pWnd);
-
- if (bNew)
- {
- if (pWnd)
- {
- CFFL_PrivateData* pPrivateData = (CFFL_PrivateData*)pWnd->GetAttachedData();
- ASSERT(pPrivateData != NULL);
-
- if (pPrivateData->nWidgetAge != m_pWidget->GetAppearanceAge())
- {
- return this->ResetPDFWindow(pPageView, m_pWidget->GetValueAge() == pPrivateData->nValueAge);
- }
- }
- else
- {
- PWL_CREATEPARAM cp = GetCreateParam();
- cp.hAttachedWnd = (FX_HWND)m_pWidget;
-
- CFFL_PrivateData* pPrivateData = new CFFL_PrivateData;
- pPrivateData->pWidget = m_pWidget;
- pPrivateData->pPageView = pPageView;
- pPrivateData->nWidgetAge = m_pWidget->GetAppearanceAge();
- pPrivateData->nValueAge = 0;
-
- cp.pAttachedData = pPrivateData;
-
- pWnd = NewPDFWindow(cp, pPageView);
-
- if (pWnd)
- {
- m_Maps.SetAt(pPageView, pWnd);
- }
- }
- }
-
- return pWnd;
-}
-
-void CFFL_FormFiller::DestroyPDFWindow(CPDFSDK_PageView* pPageView)
-{
- CPWL_Wnd* pWnd = NULL;
- m_Maps.Lookup(pPageView, pWnd);
-
- if (pWnd)
- {
- CFFL_PrivateData* pData = (CFFL_PrivateData*)pWnd->GetAttachedData();
- pData->pPageView = NULL;
- pWnd->Destroy();
- delete pWnd;
- delete pData;
- }
-
- m_Maps.RemoveKey(pPageView);
-}
-
-CPDF_Matrix CFFL_FormFiller::GetWindowMatrix(void* pAttachedData)
-{
- if (CFFL_PrivateData* pPrivateData = (CFFL_PrivateData*)pAttachedData)
- {
- if (pPrivateData->pPageView)
- {
- CPDF_Matrix mtPageView;
- pPrivateData->pPageView->GetCurrentMatrix(mtPageView);
- CPDF_Matrix mt = GetCurMatrix();
- mt.Concat(mtPageView);
-
- return mt;
- }
- }
- return CPDF_Matrix(1,0,0,1,0,0);
-}
-
-CPDF_Matrix CFFL_FormFiller::GetCurMatrix()
-{
- CPDF_Matrix mt;
-
- ASSERT(m_pWidget != NULL);
-
- CPDF_Rect rcDA ;
- m_pWidget->GetPDFAnnot()->GetRect(rcDA);
-
-
- switch (m_pWidget->GetRotate())
- {
- default:
- case 0:
- mt = CPDF_Matrix(1,0,0,1,0,0);
- break;
- case 90:
- mt = CPDF_Matrix(0,1,-1,0,rcDA.right - rcDA.left,0);
- break;
- case 180:
- mt = CPDF_Matrix(-1,0,0,-1,rcDA.right - rcDA.left,rcDA.top - rcDA.bottom);
- break;
- case 270:
- mt = CPDF_Matrix(0,-1,1,0,0,rcDA.top - rcDA.bottom);
- break;
- }
- mt.e += rcDA.left;
- mt.f += rcDA.bottom;
-
- return mt;
-}
-
-CFX_WideString CFFL_FormFiller::LoadPopupMenuString(int nIndex)
-{
- ASSERT(m_pApp != NULL);
-
- return L"";
-}
-
-CPDF_Rect CFFL_FormFiller::GetPDFWindowRect() const
-{
- ASSERT(m_pWidget != NULL);
-
- CPDF_Rect rectAnnot;
- m_pWidget->GetPDFAnnot()->GetRect(rectAnnot);
-
- FX_FLOAT fWidth = rectAnnot.right - rectAnnot.left;
- FX_FLOAT fHeight = rectAnnot.top - rectAnnot.bottom;
-
-
- if ((m_pWidget->GetRotate() / 90) & 0x01)
- return CPDF_Rect(0,0,fHeight,fWidth);
- else
- return CPDF_Rect(0,0,fWidth,fHeight);
-}
-
-CPDFSDK_PageView* CFFL_FormFiller::GetCurPageView()
-{
-
- CPDF_Page* pPage = m_pAnnot->GetPDFPage();
- CPDFSDK_Document* pSDKDoc = m_pApp->GetCurrentDoc();
- if(pSDKDoc)
- {
- return pSDKDoc->GetPageView(pPage);
- }
- return NULL;
-}
-
-CPDF_Rect CFFL_FormFiller::GetFocusBox(CPDFSDK_PageView* pPageView)
-{
- if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, FALSE))
- {
- CPDF_Rect rcFocus = FFLtoWnd(pPageView, PWLtoFFL(pWnd->GetFocusRect()));
- ASSERT(pPageView);
- CPDF_Rect rcPage = pPageView->GetPDFPage()->GetPageBBox();
- if(rcPage.Contains(rcFocus))
- return rcFocus;
- else
- return CPDF_Rect(0,0,0,0);
- }
- return CPDF_Rect(0,0,0,0);
-}
-
-CPDF_Rect CFFL_FormFiller::FFLtoPWL(const CPDF_Rect& rect)
-{
- CPDF_Matrix mt;
- mt.SetReverse(GetCurMatrix());
-
- CPDF_Rect temp = rect;
- mt.TransformRect(temp);
-
- return temp;
-}
-
-CPDF_Rect CFFL_FormFiller::PWLtoFFL(const CPDF_Rect& rect)
-{
- CPDF_Matrix mt = GetCurMatrix();
-
- CPDF_Rect temp = rect;
- mt.TransformRect(temp);
-
- return temp;
-}
-
-CPDF_Point CFFL_FormFiller::FFLtoPWL(const CPDF_Point& point)
-{
- CPDF_Matrix mt;
- mt.SetReverse(GetCurMatrix());
-
- CPDF_Point pt = point;
- mt.Transform(pt.x,pt.y);
-
- return pt;
-}
-
-CPDF_Point CFFL_FormFiller::PWLtoFFL(const CPDF_Point & point)
-{
- CPDF_Matrix mt = GetCurMatrix();
-
- CPDF_Point pt = point;
- mt.Transform(pt.x,pt.y);
-
- return pt;
-}
-
-CPDF_Point CFFL_FormFiller::WndtoPWL(CPDFSDK_PageView* pPageView, const CPDF_Point& pt)
-{
-// ASSERT(pPageView != NULL);
-//
-// CPDF_Point point(0.0f, 0.0f);
-// pPageView->WindowToDoc(pt.x, pt.y, point.x, point.y);
-//
- return FFLtoPWL(pt);
-// return CPDF_Point(0, 0);
-}
-
-CPDF_Rect CFFL_FormFiller::FFLtoWnd(CPDFSDK_PageView* pPageView, const CPDF_Rect & rect)
-{
-// FX_RECT rcRet(0,0,0,0);
-//
-// ASSERT(pPageView != NULL);
-// pPageView->DocToWindow(rect, rcRet);
-//
- return rect;
-
-}
-
-void CFFL_FormFiller::FFL_FreeData(void* pData)
-{
- ASSERT(pData != NULL);
-
- delete (CFFL_PrivateData*)pData;
-}
-
-FX_BOOL CFFL_FormFiller::CommitData(CPDFSDK_PageView* pPageView, FX_UINT nFlag)
-{
- if (IsDataChanged(pPageView))
- {
- //CFFL_IFormFiller* pIFormFiller = CFFL_Module::GetFormFiller(m_pApp);
- CFFL_IFormFiller* pIFormFiller = m_pApp->GetIFormFiller();//NULL;
- ASSERT(pIFormFiller != NULL);
-
- FX_BOOL bRC = TRUE;
- FX_BOOL bExit = FALSE;
-
- pIFormFiller->OnKeyStrokeCommit(m_pWidget, pPageView, bRC, bExit, nFlag);
- if (bExit) return TRUE;
- if (!bRC)
- {
- this->ResetPDFWindow(pPageView, FALSE);
- return TRUE;
- }
-
- pIFormFiller->OnValidate(m_pWidget, pPageView, bRC, bExit, nFlag);
- if (bExit) return TRUE;
- if (!bRC)
- {
- this->ResetPDFWindow(pPageView, FALSE);
- return TRUE;
- }
-
- SaveData(pPageView);
-
- pIFormFiller->OnCalculate(m_pWidget, pPageView, bExit,nFlag);
- if (bExit) return TRUE;
-
- pIFormFiller->OnFormat(m_pWidget, pPageView, bExit,nFlag);
- }
-
- return TRUE;
-}
-
-FX_BOOL CFFL_FormFiller::IsDataChanged(CPDFSDK_PageView* pPageView)
-{
- return FALSE;
-}
-
-void CFFL_FormFiller::SaveData(CPDFSDK_PageView* pPageView)
-{
-}
-
-void CFFL_FormFiller::GetKeyStrokeData(CPDFSDK_PageView* pPageView, FFL_KeyStrokeData& data)
-{
-}
-
-void CFFL_FormFiller::SetChangeMark()
-{
- m_pApp->FFI_OnChange();
-}
-
-void CFFL_FormFiller::GetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type,
- PDFSDK_FieldAction& fa)
-{
- fa.sValue = m_pWidget->GetValue();
-}
-
-void CFFL_FormFiller::SetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type,
- const PDFSDK_FieldAction& fa)
-{
-}
-
-FX_BOOL CFFL_FormFiller::IsActionDataChanged(CPDF_AAction::AActionType type, const PDFSDK_FieldAction& faOld,
- const PDFSDK_FieldAction& faNew)
-{
- return FALSE;
-}
-
-void CFFL_FormFiller::SaveState(CPDFSDK_PageView* pPageView)
-{
-}
-
-void CFFL_FormFiller::RestoreState(CPDFSDK_PageView* pPageView)
-{
-}
-
-CPWL_Wnd* CFFL_FormFiller::ResetPDFWindow(CPDFSDK_PageView* pPageView, FX_BOOL bRestoreValue)
-{
- return GetPDFWindow(pPageView, FALSE);
-}
-
-void CFFL_FormFiller::TimerProc()
-{
-
-}
-
-IFX_SystemHandler* CFFL_FormFiller::GetSystemHandler() const
-{
- return m_pApp->GetSysHandler();
-// return NULL;
-}
-
-void CFFL_FormFiller::OnKeyStroke(FX_BOOL bKeyDown)
-{
-}
-
-void CFFL_FormFiller::EscapeFiller(CPDFSDK_PageView* pPageView, FX_BOOL bDestroyPDFWindow)
-{
- m_bValid = FALSE;
-
- FX_RECT rcRect = this->GetViewBBox(pPageView, m_pWidget);
- this->InvalidateRect(rcRect.left, rcRect.top, rcRect.right, rcRect.bottom);
-
- if(bDestroyPDFWindow)
- DestroyPDFWindow(pPageView);
-}
-
-FX_BOOL CFFL_FormFiller::CanCopy(CPDFSDK_Document* pDocument)
-{
- return FALSE;
-}
-
-FX_BOOL CFFL_FormFiller::CanCut(CPDFSDK_Document* pDocument)
-{
- return FALSE;
-}
-
-FX_BOOL CFFL_FormFiller::CanPaste(CPDFSDK_Document* pDocument)
-{
- return FALSE;
-}
-
-void CFFL_FormFiller::DoCopy(CPDFSDK_Document* pDocument)
-{
-}
-
-void CFFL_FormFiller::DoCut(CPDFSDK_Document* pDocument)
-{
-}
-
-void CFFL_FormFiller::DoPaste(CPDFSDK_Document* pDocument)
-{
-}
-
-void CFFL_FormFiller::InvalidateRect(double left, double top, double right, double bottom)
-{
- CPDF_Page * pPage = m_pWidget->GetPDFPage();
- m_pApp->FFI_Invalidate(pPage, left, top, right, bottom);
-}
-
-/* ------------------------- CFFL_Button ------------------------- */
-
-CFFL_Button::CFFL_Button(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pWidget) :
- CFFL_FormFiller(pApp, pWidget),
- m_bMouseIn(FALSE),
- m_bMouseDown(FALSE)
-{
-}
-
-CFFL_Button::~CFFL_Button()
-{
-}
-
-void CFFL_Button::OnMouseEnter(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot)
-{
- m_bMouseIn = TRUE;
- FX_RECT rect = this->GetViewBBox(pPageView,pAnnot);
- this->InvalidateRect(rect.left, rect.top, rect.right, rect.bottom);
-// ::InvalidateRect(pPageView->GetPageViewWnd(), &this->GetViewBBox(pPageView, pAnnot), TRUE);
-}
-
-void CFFL_Button::OnMouseExit(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot)
-{
- m_bMouseIn = FALSE;
-
- FX_RECT rect = this->GetViewBBox(pPageView,pAnnot);
- this->InvalidateRect(rect.left, rect.top, rect.right, rect.bottom);
-// ::InvalidateRect(pPageView->GetPageViewWnd(), &this->GetViewBBox(pPageView, pAnnot), TRUE);
- EndTimer();
- ASSERT(m_pWidget != NULL);
-// m_pWidget->HideHint();
-}
-
-FX_BOOL CFFL_Button::OnLButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
-{
- CPDF_Rect rcAnnot = pAnnot->GetRect();
- if(!rcAnnot.Contains(point.x, point.y))
- return FALSE;
-
- m_bMouseDown = TRUE;
- m_bValid = TRUE;
- FX_RECT rect = this->GetViewBBox(pPageView, pAnnot);
- this->InvalidateRect(rect.left, rect.top, rect.right, rect.bottom);
-// ::InvalidateRect(pPageView->GetPageViewWnd(), &this->GetViewBBox(pPageView, pAnnot), TRUE);
- return TRUE;
-}
-
-FX_BOOL CFFL_Button::OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
-{
- CPDF_Rect rcAnnot = pAnnot->GetRect();
- if(!rcAnnot.Contains(point.x, point.y))
- return FALSE;
-
- m_bMouseDown = FALSE;
- m_pWidget->GetPDFPage();
-
-
- FX_RECT rect = this->GetViewBBox(pPageView, pAnnot);
- this->InvalidateRect(rect.left, rect.top, rect.right, rect.bottom);
-// ::InvalidateRect(pPageView->GetPageViewWnd(), &this->GetViewBBox(pPageView, pAnnot), TRUE);
- return TRUE;
-}
-
-FX_BOOL CFFL_Button::OnMouseMove(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
-{
- ASSERT(m_pApp != NULL);
-
- return TRUE;
-}
-
-void CFFL_Button::OnDraw(CPDFSDK_PageView *pPageView, /*HDC hDC,*/ CPDFSDK_Annot* pAnnot,
- CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
- /*const CRect& rcWindow,*/ FX_DWORD dwFlags)
-{
- ASSERT(pPageView != NULL);
- ASSERT(pAnnot != NULL);
-
- CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
-
- CPDF_FormControl* pCtrl = pWidget->GetFormControl();
- ASSERT(pCtrl != NULL);
-
- CPDF_FormControl::HighlightingMode eHM = pCtrl->GetHighlightingMode();
-
- if (eHM == CPDF_FormControl::Push)
- {
- if (m_bMouseDown)
- {
- if (pWidget->IsWidgetAppearanceValid(CPDF_Annot::Down))
- pWidget->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Down, NULL);
- else
- pWidget->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, NULL);
- }
- else if (m_bMouseIn)
- {
- if (pWidget->IsWidgetAppearanceValid(CPDF_Annot::Rollover))
- pWidget->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Rollover, NULL);
- else
- pWidget->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, NULL);
- }
- else
- {
- pWidget->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, NULL);
- }
- }
- else
- pWidget->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, NULL);
-}
-
-
-void CFFL_Button::OnDrawDeactive(CPDFSDK_PageView *pPageView, /*HDC hDC,*/ CPDFSDK_Annot* pAnnot,
- CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
- /*const CRect& rcWindow, */FX_DWORD dwFlags)
-{
- OnDraw(pPageView, pAnnot, pDevice, pUser2Device, dwFlags);
-}
+// 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
+
+
+#include "../../include/formfiller/FFL_FormFiller.h"
+#include "../../include/formfiller/FFL_Notify.h"
+#include "../../include/formfiller/FFL_CBA_Fontmap.h"
+
+#define GetRed(rgb) ((FX_BYTE)(rgb))
+#define GetGreen(rgb) ((FX_BYTE)(((FX_WORD)(rgb)) >> 8))
+#define GetBlue(rgb) ((FX_BYTE)((rgb)>>16))
+
+#define FFL_HINT_ELAPSE 800
+
+/* ------------------------- CFFL_FormFiller ------------------------- */
+
+CFFL_FormFiller::CFFL_FormFiller(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pAnnot)
+ :m_pApp(pApp),
+ m_pAnnot(pAnnot),
+ m_bValid(FALSE),
+ m_ptOldPos(0,0)
+{
+ m_pWidget = (CPDFSDK_Widget*) pAnnot;
+}
+
+CFFL_FormFiller::~CFFL_FormFiller()
+{
+ FX_POSITION pos = m_Maps.GetStartPosition();
+ while (pos)
+ {
+ CPDFSDK_PageView * pPageView = NULL;
+ CPWL_Wnd* pWnd = NULL;
+ m_Maps.GetNextAssoc(pos, pPageView, pWnd);
+
+ if (pWnd)
+ {
+ CFFL_PrivateData* pData = (CFFL_PrivateData*)pWnd->GetAttachedData();
+ pWnd->Destroy();
+ delete pWnd;
+ delete pData;
+ }
+ }
+ m_Maps.RemoveAll();
+
+}
+
+void CFFL_FormFiller::SetWindowRect(CPDFSDK_PageView* pPageView, const CPDF_Rect& rcWindow)
+{
+ if (CPWL_Wnd* pWnd = this->GetPDFWindow(pPageView, FALSE))
+ {
+ pWnd->Move(CPDF_Rect(rcWindow), TRUE, FALSE);
+ }
+}
+
+CPDF_Rect CFFL_FormFiller::GetWindowRect(CPDFSDK_PageView* pPageView)
+{
+ if (CPWL_Wnd* pWnd = this->GetPDFWindow(pPageView, FALSE))
+ {
+ return pWnd->GetWindowRect();
+ }
+
+ return CPDF_Rect(0,0,0,0);
+}
+
+FX_RECT CFFL_FormFiller::GetViewBBox(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot)
+{
+ ASSERT(pPageView != NULL);
+ ASSERT(pAnnot != NULL);
+
+ CPDF_Rect rcAnnot = m_pWidget->GetRect();
+
+ if (CPWL_Wnd* pWnd = this->GetPDFWindow(pPageView, FALSE))
+ {
+ CPDF_Rect rcWindow = pWnd->GetWindowRect();
+ rcAnnot = PWLtoFFL(rcWindow);
+ }
+
+ CPDF_Rect rcWin = rcAnnot;
+// pPageView->DocToWindow(rcAnnot, rcWin);
+
+ CPDF_Rect rcFocus = this->GetFocusBox(pPageView);
+ if (!rcFocus.IsEmpty())
+ rcWin.Union(rcFocus);
+
+ CPDF_Rect rect = CPWL_Utils::InflateRect(rcWin,1);
+
+ return rect.GetOutterRect();
+}
+
+void CFFL_FormFiller::OnDraw(CPDFSDK_PageView *pPageView, /*HDC hDC,*/ CPDFSDK_Annot* pAnnot,
+ CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
+ /*const CRect& rcWindow,*/ FX_DWORD dwFlags)
+{
+ ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
+
+ if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, FALSE))
+ {
+ CPDF_Matrix mt = this->GetCurMatrix();
+ mt.Concat(*pUser2Device);
+ pWnd->DrawAppearance(pDevice,&mt);
+ }
+ else
+ {
+ CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
+ if (CFFL_IFormFiller::IsVisible(pWidget))
+ pWidget->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, NULL);
+ }
+}
+
+void CFFL_FormFiller::OnDrawDeactive(CPDFSDK_PageView *pPageView, /*HDC hDC,*/ CPDFSDK_Annot* pAnnot,
+ CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
+ /*const CRect& rcWindow,*/ FX_DWORD dwFlags)
+{
+ ASSERT(pAnnot != NULL);
+
+ CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
+
+ pWidget->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, NULL);
+}
+
+
+void CFFL_FormFiller::OnCreate(CPDFSDK_Annot* pAnnot)
+{
+}
+
+void CFFL_FormFiller::OnLoad(CPDFSDK_Annot* pAnnot)
+{
+}
+
+void CFFL_FormFiller::OnDelete(CPDFSDK_Annot* pAnnot)
+{
+}
+
+void CFFL_FormFiller::OnMouseEnter(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot)
+{
+}
+
+void CFFL_FormFiller::OnMouseExit(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot)
+{
+ EndTimer();
+ ASSERT(m_pWidget != NULL);
+}
+
+FX_BOOL CFFL_FormFiller::OnLButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
+{
+ if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, TRUE))
+ {
+ m_bValid = TRUE;
+ FX_RECT rect = this->GetViewBBox(pPageView,pAnnot);
+ this->InvalidateRect(rect.left, rect.top, rect.right, rect.bottom);
+
+ if(!rect.Contains((int)point.x, (int)point.y))
+ return FALSE;
+
+ return pWnd->OnLButtonDown(WndtoPWL(pPageView, point),nFlags);
+ }
+
+ return FALSE;
+}
+
+FX_BOOL CFFL_FormFiller::OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
+{
+ if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, FALSE))
+ {
+ FX_RECT rcFFL = this->GetViewBBox(pPageView, pAnnot);
+ this->InvalidateRect(rcFFL.left, rcFFL.top, rcFFL.right, rcFFL.bottom);
+ pWnd->OnLButtonUp(WndtoPWL(pPageView, point),nFlags);
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+FX_BOOL CFFL_FormFiller::OnLButtonDblClk(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
+{
+ if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, FALSE))
+ {
+ pWnd->OnLButtonDblClk(WndtoPWL(pPageView, point),nFlags);
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+FX_BOOL CFFL_FormFiller::OnMouseMove(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
+{
+ if ((m_ptOldPos.x != point.x) || (m_ptOldPos.y != point.y))
+ {
+ m_ptOldPos = point;
+ }
+
+ if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, FALSE))
+ {
+ pWnd->OnMouseMove(WndtoPWL(pPageView, point),nFlags);
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+FX_BOOL CFFL_FormFiller::OnMouseWheel(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, short zDelta, const CPDF_Point& point)
+{
+ if (!IsValid()) return FALSE;
+
+ if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, TRUE))
+ {
+ return pWnd->OnMouseWheel(zDelta, WndtoPWL(pPageView, point),nFlags);
+ }
+
+ return FALSE;
+}
+
+FX_BOOL CFFL_FormFiller::OnRButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
+{
+ if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, TRUE))
+ {
+ pWnd->OnRButtonDown(WndtoPWL(pPageView, point),nFlags);
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+FX_BOOL CFFL_FormFiller::OnRButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
+{
+ if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, FALSE))
+ {
+ pWnd->OnRButtonUp(WndtoPWL(pPageView, point),nFlags);
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+FX_BOOL CFFL_FormFiller::OnRButtonDblClk(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
+{
+ if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, FALSE))
+ {
+ pWnd->OnRButtonDblClk(WndtoPWL(pPageView, point),nFlags);
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+FX_BOOL CFFL_FormFiller::OnKeyDown(CPDFSDK_Annot* pAnnot, FX_UINT nKeyCode, FX_UINT nFlags)
+{
+ if (IsValid())
+ {
+ CPDFSDK_PageView* pPageView = this->GetCurPageView();
+ ASSERT(pPageView != NULL);
+
+ if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, FALSE))
+ {
+ return pWnd->OnKeyDown(nKeyCode,nFlags);
+ }
+ }
+
+ return FALSE;
+}
+
+FX_BOOL CFFL_FormFiller::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags)
+{
+ if (IsValid())
+ {
+ CPDFSDK_PageView* pPageView = this->GetCurPageView();
+ ASSERT(pPageView != NULL);
+
+ if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, FALSE))
+ {
+ return pWnd->OnChar(nChar,nFlags);
+ }
+ }
+
+ return FALSE;
+}
+
+void CFFL_FormFiller::OnDeSelected(CPDFSDK_Annot* pAnnot)
+{
+ ASSERT(FALSE);
+}
+
+void CFFL_FormFiller::OnSelected(CPDFSDK_Annot* pAnnot)
+{
+ ASSERT(FALSE);
+}
+
+FX_BOOL CFFL_FormFiller::OnSetFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag)
+{
+ CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
+
+ CPDF_Page * pPage = pWidget->GetPDFPage();
+ CPDFSDK_Document * pDoc = m_pApp->GetCurrentDoc();
+ CPDFSDK_PageView* pPageView = pDoc->GetPageView(pPage);
+ ASSERT(pPageView != NULL);
+
+
+
+ CPWL_Wnd * pWnd = NULL;
+ if ( (pWnd = GetPDFWindow(pPageView, TRUE)))
+ {
+ pWnd->SetFocus();
+ }
+
+ m_bValid = TRUE;
+
+
+
+
+ m_bValid = TRUE;
+ FX_RECT rcRect = this->GetViewBBox(pPageView,pAnnot);
+ this->InvalidateRect(rcRect.left, rcRect.top, rcRect.right, rcRect.bottom);
+
+ return TRUE;
+}
+
+FX_BOOL CFFL_FormFiller::OnKillFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag)
+{
+ if (IsValid())
+ {
+ CPDFSDK_PageView* pPageView = this->GetCurPageView();
+ ASSERT(pPageView != NULL);
+
+ CommitData(pPageView, nFlag);
+
+ if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE))
+ {
+ pWnd->KillFocus();
+ }
+
+ switch (m_pWidget->GetFieldType())
+ {
+ case FIELDTYPE_PUSHBUTTON:
+ case FIELDTYPE_CHECKBOX:
+ case FIELDTYPE_RADIOBUTTON:
+ EscapeFiller(pPageView, TRUE);
+ break;
+ default:
+ EscapeFiller(pPageView, FALSE);
+ break;
+ }
+ }
+
+ return TRUE;
+}
+
+FX_BOOL CFFL_FormFiller::IsValid() const
+{
+ return m_bValid;
+}
+
+PWL_CREATEPARAM CFFL_FormFiller::GetCreateParam()
+{
+ ASSERT(m_pApp != NULL);
+
+ PWL_CREATEPARAM cp;
+
+ cp.pParentWnd = NULL;
+ cp.pProvider = this;
+ cp.rcRectWnd = GetPDFWindowRect();
+
+ FX_DWORD dwCreateFlags = PWS_BORDER | PWS_BACKGROUND | PWS_VISIBLE;
+
+ ASSERT(m_pWidget != NULL);
+
+
+ FX_DWORD dwFieldFlag = m_pWidget->GetFieldFlags();
+
+ if (dwFieldFlag & FIELDFLAG_READONLY)
+ {
+ dwCreateFlags |= PWS_READONLY;
+ }
+
+ FX_COLORREF color;
+ if (m_pWidget->GetFillColor(color))
+ {
+ cp.sBackgroundColor = CPWL_Color(GetRed(color), GetGreen(color), GetBlue(color));
+ }
+
+ if (m_pWidget->GetBorderColor(color))
+ {
+ cp.sBorderColor = CPWL_Color(GetRed(color), GetGreen(color), GetBlue(color));
+ }
+
+ cp.sTextColor = CPWL_Color(COLORTYPE_GRAY,0);
+
+ if (m_pWidget->GetTextColor(color))
+ {
+ cp.sTextColor = CPWL_Color(GetRed(color), GetGreen(color), GetBlue(color));
+ }
+
+ cp.fFontSize = m_pWidget->GetFontSize();
+ cp.dwBorderWidth = m_pWidget->GetBorderWidth();
+
+ int nBorderStyle = m_pWidget->GetBorderStyle();
+
+ switch (nBorderStyle)
+ {
+ case BBS_SOLID:
+ cp.nBorderStyle = PBS_SOLID;
+ break;
+ case BBS_DASH:
+ cp.nBorderStyle = PBS_DASH;
+ cp.sDash = CPWL_Dash(3,3,0);
+ break;
+ case BBS_BEVELED:
+ cp.nBorderStyle = PBS_BEVELED;
+ cp.dwBorderWidth *= 2;
+ break;
+ case BBS_INSET:
+ cp.nBorderStyle = PBS_INSET;
+ cp.dwBorderWidth *= 2;
+ break;
+ case BBS_UNDERLINE:
+ cp.nBorderStyle = PBS_UNDERLINED;
+ break;
+ }
+
+ if (cp.fFontSize <= 0)
+ {
+ dwCreateFlags |= PWS_AUTOFONTSIZE;
+ }
+
+ cp.dwFlags = dwCreateFlags;
+ cp.pSystemHandler = m_pApp->GetSysHandler();
+ return cp;
+}
+
+CPWL_Wnd* CFFL_FormFiller::GetPDFWindow(CPDFSDK_PageView* pPageView, FX_BOOL bNew)
+{
+ ASSERT(pPageView != NULL);
+ ASSERT(m_pWidget != NULL);
+
+ CPWL_Wnd* pWnd = NULL;
+ m_Maps.Lookup(pPageView, pWnd);
+
+ if (bNew)
+ {
+ if (pWnd)
+ {
+ CFFL_PrivateData* pPrivateData = (CFFL_PrivateData*)pWnd->GetAttachedData();
+ ASSERT(pPrivateData != NULL);
+
+ if (pPrivateData->nWidgetAge != m_pWidget->GetAppearanceAge())
+ {
+ return this->ResetPDFWindow(pPageView, m_pWidget->GetValueAge() == pPrivateData->nValueAge);
+ }
+ }
+ else
+ {
+ PWL_CREATEPARAM cp = GetCreateParam();
+ cp.hAttachedWnd = (FX_HWND)m_pWidget;
+
+ CFFL_PrivateData* pPrivateData = new CFFL_PrivateData;
+ pPrivateData->pWidget = m_pWidget;
+ pPrivateData->pPageView = pPageView;
+ pPrivateData->nWidgetAge = m_pWidget->GetAppearanceAge();
+ pPrivateData->nValueAge = 0;
+
+ cp.pAttachedData = pPrivateData;
+
+ pWnd = NewPDFWindow(cp, pPageView);
+
+ if (pWnd)
+ {
+ m_Maps.SetAt(pPageView, pWnd);
+ }
+ }
+ }
+
+ return pWnd;
+}
+
+void CFFL_FormFiller::DestroyPDFWindow(CPDFSDK_PageView* pPageView)
+{
+ CPWL_Wnd* pWnd = NULL;
+ m_Maps.Lookup(pPageView, pWnd);
+
+ if (pWnd)
+ {
+ CFFL_PrivateData* pData = (CFFL_PrivateData*)pWnd->GetAttachedData();
+ pData->pPageView = NULL;
+ pWnd->Destroy();
+ delete pWnd;
+ delete pData;
+ }
+
+ m_Maps.RemoveKey(pPageView);
+}
+
+CPDF_Matrix CFFL_FormFiller::GetWindowMatrix(void* pAttachedData)
+{
+ if (CFFL_PrivateData* pPrivateData = (CFFL_PrivateData*)pAttachedData)
+ {
+ if (pPrivateData->pPageView)
+ {
+ CPDF_Matrix mtPageView;
+ pPrivateData->pPageView->GetCurrentMatrix(mtPageView);
+ CPDF_Matrix mt = GetCurMatrix();
+ mt.Concat(mtPageView);
+
+ return mt;
+ }
+ }
+ return CPDF_Matrix(1,0,0,1,0,0);
+}
+
+CPDF_Matrix CFFL_FormFiller::GetCurMatrix()
+{
+ CPDF_Matrix mt;
+
+ ASSERT(m_pWidget != NULL);
+
+ CPDF_Rect rcDA ;
+ m_pWidget->GetPDFAnnot()->GetRect(rcDA);
+
+
+ switch (m_pWidget->GetRotate())
+ {
+ default:
+ case 0:
+ mt = CPDF_Matrix(1,0,0,1,0,0);
+ break;
+ case 90:
+ mt = CPDF_Matrix(0,1,-1,0,rcDA.right - rcDA.left,0);
+ break;
+ case 180:
+ mt = CPDF_Matrix(-1,0,0,-1,rcDA.right - rcDA.left,rcDA.top - rcDA.bottom);
+ break;
+ case 270:
+ mt = CPDF_Matrix(0,-1,1,0,0,rcDA.top - rcDA.bottom);
+ break;
+ }
+ mt.e += rcDA.left;
+ mt.f += rcDA.bottom;
+
+ return mt;
+}
+
+CFX_WideString CFFL_FormFiller::LoadPopupMenuString(int nIndex)
+{
+ ASSERT(m_pApp != NULL);
+
+ return L"";
+}
+
+CPDF_Rect CFFL_FormFiller::GetPDFWindowRect() const
+{
+ ASSERT(m_pWidget != NULL);
+
+ CPDF_Rect rectAnnot;
+ m_pWidget->GetPDFAnnot()->GetRect(rectAnnot);
+
+ FX_FLOAT fWidth = rectAnnot.right - rectAnnot.left;
+ FX_FLOAT fHeight = rectAnnot.top - rectAnnot.bottom;
+
+
+ if ((m_pWidget->GetRotate() / 90) & 0x01)
+ return CPDF_Rect(0,0,fHeight,fWidth);
+ else
+ return CPDF_Rect(0,0,fWidth,fHeight);
+}
+
+CPDFSDK_PageView* CFFL_FormFiller::GetCurPageView()
+{
+
+ CPDF_Page* pPage = m_pAnnot->GetPDFPage();
+ CPDFSDK_Document* pSDKDoc = m_pApp->GetCurrentDoc();
+ if(pSDKDoc)
+ {
+ return pSDKDoc->GetPageView(pPage);
+ }
+ return NULL;
+}
+
+CPDF_Rect CFFL_FormFiller::GetFocusBox(CPDFSDK_PageView* pPageView)
+{
+ if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, FALSE))
+ {
+ CPDF_Rect rcFocus = FFLtoWnd(pPageView, PWLtoFFL(pWnd->GetFocusRect()));
+ ASSERT(pPageView);
+ CPDF_Rect rcPage = pPageView->GetPDFPage()->GetPageBBox();
+ if(rcPage.Contains(rcFocus))
+ return rcFocus;
+ else
+ return CPDF_Rect(0,0,0,0);
+ }
+ return CPDF_Rect(0,0,0,0);
+}
+
+CPDF_Rect CFFL_FormFiller::FFLtoPWL(const CPDF_Rect& rect)
+{
+ CPDF_Matrix mt;
+ mt.SetReverse(GetCurMatrix());
+
+ CPDF_Rect temp = rect;
+ mt.TransformRect(temp);
+
+ return temp;
+}
+
+CPDF_Rect CFFL_FormFiller::PWLtoFFL(const CPDF_Rect& rect)
+{
+ CPDF_Matrix mt = GetCurMatrix();
+
+ CPDF_Rect temp = rect;
+ mt.TransformRect(temp);
+
+ return temp;
+}
+
+CPDF_Point CFFL_FormFiller::FFLtoPWL(const CPDF_Point& point)
+{
+ CPDF_Matrix mt;
+ mt.SetReverse(GetCurMatrix());
+
+ CPDF_Point pt = point;
+ mt.Transform(pt.x,pt.y);
+
+ return pt;
+}
+
+CPDF_Point CFFL_FormFiller::PWLtoFFL(const CPDF_Point & point)
+{
+ CPDF_Matrix mt = GetCurMatrix();
+
+ CPDF_Point pt = point;
+ mt.Transform(pt.x,pt.y);
+
+ return pt;
+}
+
+CPDF_Point CFFL_FormFiller::WndtoPWL(CPDFSDK_PageView* pPageView, const CPDF_Point& pt)
+{
+// ASSERT(pPageView != NULL);
+//
+// CPDF_Point point(0.0f, 0.0f);
+// pPageView->WindowToDoc(pt.x, pt.y, point.x, point.y);
+//
+ return FFLtoPWL(pt);
+// return CPDF_Point(0, 0);
+}
+
+CPDF_Rect CFFL_FormFiller::FFLtoWnd(CPDFSDK_PageView* pPageView, const CPDF_Rect & rect)
+{
+// FX_RECT rcRet(0,0,0,0);
+//
+// ASSERT(pPageView != NULL);
+// pPageView->DocToWindow(rect, rcRet);
+//
+ return rect;
+
+}
+
+void CFFL_FormFiller::FFL_FreeData(void* pData)
+{
+ ASSERT(pData != NULL);
+
+ delete (CFFL_PrivateData*)pData;
+}
+
+FX_BOOL CFFL_FormFiller::CommitData(CPDFSDK_PageView* pPageView, FX_UINT nFlag)
+{
+ if (IsDataChanged(pPageView))
+ {
+ //CFFL_IFormFiller* pIFormFiller = CFFL_Module::GetFormFiller(m_pApp);
+ CFFL_IFormFiller* pIFormFiller = m_pApp->GetIFormFiller();//NULL;
+ ASSERT(pIFormFiller != NULL);
+
+ FX_BOOL bRC = TRUE;
+ FX_BOOL bExit = FALSE;
+
+ pIFormFiller->OnKeyStrokeCommit(m_pWidget, pPageView, bRC, bExit, nFlag);
+ if (bExit) return TRUE;
+ if (!bRC)
+ {
+ this->ResetPDFWindow(pPageView, FALSE);
+ return TRUE;
+ }
+
+ pIFormFiller->OnValidate(m_pWidget, pPageView, bRC, bExit, nFlag);
+ if (bExit) return TRUE;
+ if (!bRC)
+ {
+ this->ResetPDFWindow(pPageView, FALSE);
+ return TRUE;
+ }
+
+ SaveData(pPageView);
+
+ pIFormFiller->OnCalculate(m_pWidget, pPageView, bExit,nFlag);
+ if (bExit) return TRUE;
+
+ pIFormFiller->OnFormat(m_pWidget, pPageView, bExit,nFlag);
+ }
+
+ return TRUE;
+}
+
+FX_BOOL CFFL_FormFiller::IsDataChanged(CPDFSDK_PageView* pPageView)
+{
+ return FALSE;
+}
+
+void CFFL_FormFiller::SaveData(CPDFSDK_PageView* pPageView)
+{
+}
+
+void CFFL_FormFiller::GetKeyStrokeData(CPDFSDK_PageView* pPageView, FFL_KeyStrokeData& data)
+{
+}
+
+void CFFL_FormFiller::SetChangeMark()
+{
+ m_pApp->FFI_OnChange();
+}
+
+void CFFL_FormFiller::GetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type,
+ PDFSDK_FieldAction& fa)
+{
+ fa.sValue = m_pWidget->GetValue();
+}
+
+void CFFL_FormFiller::SetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type,
+ const PDFSDK_FieldAction& fa)
+{
+}
+
+FX_BOOL CFFL_FormFiller::IsActionDataChanged(CPDF_AAction::AActionType type, const PDFSDK_FieldAction& faOld,
+ const PDFSDK_FieldAction& faNew)
+{
+ return FALSE;
+}
+
+void CFFL_FormFiller::SaveState(CPDFSDK_PageView* pPageView)
+{
+}
+
+void CFFL_FormFiller::RestoreState(CPDFSDK_PageView* pPageView)
+{
+}
+
+CPWL_Wnd* CFFL_FormFiller::ResetPDFWindow(CPDFSDK_PageView* pPageView, FX_BOOL bRestoreValue)
+{
+ return GetPDFWindow(pPageView, FALSE);
+}
+
+void CFFL_FormFiller::TimerProc()
+{
+
+}
+
+IFX_SystemHandler* CFFL_FormFiller::GetSystemHandler() const
+{
+ return m_pApp->GetSysHandler();
+// return NULL;
+}
+
+void CFFL_FormFiller::OnKeyStroke(FX_BOOL bKeyDown)
+{
+}
+
+void CFFL_FormFiller::EscapeFiller(CPDFSDK_PageView* pPageView, FX_BOOL bDestroyPDFWindow)
+{
+ m_bValid = FALSE;
+
+ FX_RECT rcRect = this->GetViewBBox(pPageView, m_pWidget);
+ this->InvalidateRect(rcRect.left, rcRect.top, rcRect.right, rcRect.bottom);
+
+ if(bDestroyPDFWindow)
+ DestroyPDFWindow(pPageView);
+}
+
+FX_BOOL CFFL_FormFiller::CanCopy(CPDFSDK_Document* pDocument)
+{
+ return FALSE;
+}
+
+FX_BOOL CFFL_FormFiller::CanCut(CPDFSDK_Document* pDocument)
+{
+ return FALSE;
+}
+
+FX_BOOL CFFL_FormFiller::CanPaste(CPDFSDK_Document* pDocument)
+{
+ return FALSE;
+}
+
+void CFFL_FormFiller::DoCopy(CPDFSDK_Document* pDocument)
+{
+}
+
+void CFFL_FormFiller::DoCut(CPDFSDK_Document* pDocument)
+{
+}
+
+void CFFL_FormFiller::DoPaste(CPDFSDK_Document* pDocument)
+{
+}
+
+void CFFL_FormFiller::InvalidateRect(double left, double top, double right, double bottom)
+{
+ CPDF_Page * pPage = m_pWidget->GetPDFPage();
+ m_pApp->FFI_Invalidate(pPage, left, top, right, bottom);
+}
+
+/* ------------------------- CFFL_Button ------------------------- */
+
+CFFL_Button::CFFL_Button(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pWidget) :
+ CFFL_FormFiller(pApp, pWidget),
+ m_bMouseIn(FALSE),
+ m_bMouseDown(FALSE)
+{
+}
+
+CFFL_Button::~CFFL_Button()
+{
+}
+
+void CFFL_Button::OnMouseEnter(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot)
+{
+ m_bMouseIn = TRUE;
+ FX_RECT rect = this->GetViewBBox(pPageView,pAnnot);
+ this->InvalidateRect(rect.left, rect.top, rect.right, rect.bottom);
+// ::InvalidateRect(pPageView->GetPageViewWnd(), &this->GetViewBBox(pPageView, pAnnot), TRUE);
+}
+
+void CFFL_Button::OnMouseExit(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot)
+{
+ m_bMouseIn = FALSE;
+
+ FX_RECT rect = this->GetViewBBox(pPageView,pAnnot);
+ this->InvalidateRect(rect.left, rect.top, rect.right, rect.bottom);
+// ::InvalidateRect(pPageView->GetPageViewWnd(), &this->GetViewBBox(pPageView, pAnnot), TRUE);
+ EndTimer();
+ ASSERT(m_pWidget != NULL);
+// m_pWidget->HideHint();
+}
+
+FX_BOOL CFFL_Button::OnLButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
+{
+ CPDF_Rect rcAnnot = pAnnot->GetRect();
+ if(!rcAnnot.Contains(point.x, point.y))
+ return FALSE;
+
+ m_bMouseDown = TRUE;
+ m_bValid = TRUE;
+ FX_RECT rect = this->GetViewBBox(pPageView, pAnnot);
+ this->InvalidateRect(rect.left, rect.top, rect.right, rect.bottom);
+// ::InvalidateRect(pPageView->GetPageViewWnd(), &this->GetViewBBox(pPageView, pAnnot), TRUE);
+ return TRUE;
+}
+
+FX_BOOL CFFL_Button::OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
+{
+ CPDF_Rect rcAnnot = pAnnot->GetRect();
+ if(!rcAnnot.Contains(point.x, point.y))
+ return FALSE;
+
+ m_bMouseDown = FALSE;
+ m_pWidget->GetPDFPage();
+
+
+ FX_RECT rect = this->GetViewBBox(pPageView, pAnnot);
+ this->InvalidateRect(rect.left, rect.top, rect.right, rect.bottom);
+// ::InvalidateRect(pPageView->GetPageViewWnd(), &this->GetViewBBox(pPageView, pAnnot), TRUE);
+ return TRUE;
+}
+
+FX_BOOL CFFL_Button::OnMouseMove(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
+{
+ ASSERT(m_pApp != NULL);
+
+ return TRUE;
+}
+
+void CFFL_Button::OnDraw(CPDFSDK_PageView *pPageView, /*HDC hDC,*/ CPDFSDK_Annot* pAnnot,
+ CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
+ /*const CRect& rcWindow,*/ FX_DWORD dwFlags)
+{
+ ASSERT(pPageView != NULL);
+ ASSERT(pAnnot != NULL);
+
+ CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
+
+ CPDF_FormControl* pCtrl = pWidget->GetFormControl();
+ ASSERT(pCtrl != NULL);
+
+ CPDF_FormControl::HighlightingMode eHM = pCtrl->GetHighlightingMode();
+
+ if (eHM == CPDF_FormControl::Push)
+ {
+ if (m_bMouseDown)
+ {
+ if (pWidget->IsWidgetAppearanceValid(CPDF_Annot::Down))
+ pWidget->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Down, NULL);
+ else
+ pWidget->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, NULL);
+ }
+ else if (m_bMouseIn)
+ {
+ if (pWidget->IsWidgetAppearanceValid(CPDF_Annot::Rollover))
+ pWidget->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Rollover, NULL);
+ else
+ pWidget->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, NULL);
+ }
+ else
+ {
+ pWidget->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, NULL);
+ }
+ }
+ else
+ pWidget->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, NULL);
+}
+
+
+void CFFL_Button::OnDrawDeactive(CPDFSDK_PageView *pPageView, /*HDC hDC,*/ CPDFSDK_Annot* pAnnot,
+ CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
+ /*const CRect& rcWindow, */FX_DWORD dwFlags)
+{
+ OnDraw(pPageView, pAnnot, pDevice, pUser2Device, dwFlags);
+}
diff --git a/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp b/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp
index 686b38c557..2b21e13cfc 100644
--- a/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp
+++ b/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp
@@ -1,1197 +1,1197 @@
-// 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
-
-#include "../../include/formfiller/FFL_FormFiller.h"
-#include "../../include/formfiller/FFL_IFormFiller.h"
-#include "../../include/formfiller/FFL_CheckBox.h"
-#include "../../include/formfiller/FFL_ComboBox.h"
-#include "../../include/formfiller/FFL_ListBox.h"
-#include "../../include/formfiller/FFL_PushButton.h"
-#include "../../include/formfiller/FFL_RadioButton.h"
-#include "../../include/formfiller/FFL_TextField.h"
-
-#define FFL_MAXLISTBOXHEIGHT 140.0f
-
-// HHOOK CFFL_IFormFiller::m_hookSheet = NULL;
-// MSG CFFL_IFormFiller::g_Msg;
-
-/* ----------------------------- CFFL_IFormFiller ----------------------------- */
-
-CFFL_IFormFiller::CFFL_IFormFiller(CPDFDoc_Environment* pApp) :
- m_pApp(pApp),
- m_bNotifying(FALSE)
-{
-}
-
-CFFL_IFormFiller::~CFFL_IFormFiller()
-{
- FX_POSITION pos = m_Maps.GetStartPosition();
- while (pos)
- {
- CPDFSDK_Annot * pAnnot = NULL;
- CFFL_FormFiller * pFormFiller = NULL;
- m_Maps.GetNextAssoc(pos,pAnnot,pFormFiller);
- delete pFormFiller;
- }
- m_Maps.RemoveAll();
-}
-
-FX_BOOL CFFL_IFormFiller::Annot_HitTest(CPDFSDK_PageView* pPageView,CPDFSDK_Annot* pAnnot, CPDF_Point point)
-{
- CPDF_Rect rc = pAnnot->GetRect();
- if(rc.Contains(point.x, point.y))
- return TRUE;
- return FALSE;
-}
-
-FX_RECT CFFL_IFormFiller::GetViewBBox(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot)
-{
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
- {
- return pFormFiller->GetViewBBox(pPageView, pAnnot);
- }
- else
- {
- ASSERT(pPageView != NULL);
- ASSERT(pAnnot != NULL);
-
- CPDF_Annot* pPDFAnnot = pAnnot->GetPDFAnnot();
- ASSERT(pPDFAnnot != NULL);
-
- CPDF_Rect rcAnnot;
- pPDFAnnot->GetRect(rcAnnot);
-
-// CRect rcWin;
-// pPageView->DocToWindow(rcAnnot, rcWin);
- CPDF_Rect rcWin = CPWL_Utils::InflateRect(rcAnnot,1);
-// rcWin.InflateRect(1, 1);
-
- return rcWin.GetOutterRect();
- }
-}
-
-void CFFL_IFormFiller::OnDraw(CPDFSDK_PageView* pPageView, /*HDC hDC,*/ CPDFSDK_Annot* pAnnot,
- CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
- /*const CRect& rcWindow,*/ FX_DWORD dwFlags)
-{
- ASSERT(pPageView != NULL);
- CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
-
- if (IsVisible(pWidget))
- {
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
- {
- if (pFormFiller->IsValid())
- {
- pFormFiller->OnDraw(pPageView, pAnnot, pDevice, pUser2Device, dwFlags);
-
- pAnnot->GetPDFPage();
-
-
- CPDFSDK_Document* pDocument = m_pApp->GetCurrentDoc();
- ASSERT(pDocument != NULL);
-
- if (pDocument->GetFocusAnnot() == pAnnot)
- {
- CPDF_Rect rcFocus = pFormFiller->GetFocusBox(pPageView);
- if (!rcFocus.IsEmpty())
- {
- CFX_PathData path;
-
- path.SetPointCount(5);
- path.SetPoint(0, rcFocus.left, rcFocus.top, FXPT_MOVETO);
- path.SetPoint(1, rcFocus.left, rcFocus.bottom, FXPT_LINETO);
- path.SetPoint(2, rcFocus.right, rcFocus.bottom, FXPT_LINETO);
- path.SetPoint(3, rcFocus.right, rcFocus.top, FXPT_LINETO);
- path.SetPoint(4, rcFocus.left, rcFocus.top, FXPT_LINETO);
-
- CFX_GraphStateData gsd;
- gsd.SetDashCount(1);
- gsd.m_DashArray[0] = 1.0f;
- gsd.m_DashPhase = 0;
-
- gsd.m_LineWidth = 1.0f;
- pDevice->DrawPath(&path, pUser2Device, &gsd, 0, ArgbEncode(255,0,0,0), FXFILL_ALTERNATE);
-
- // ::DrawFocusRect(hDC, &rcFocus);
- }
- }
-
- return;
- }
- }
-
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
- pFormFiller->OnDrawDeactive(pPageView, pAnnot, pDevice, pUser2Device, dwFlags);
- else
- pWidget->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, NULL);
-
- if (!IsReadOnly(pWidget) && IsFillingAllowed(pWidget))
- {
- pWidget->DrawShadow(pDevice, pPageView);
- }
-
- }
-}
-
-void CFFL_IFormFiller::OnCreate(CPDFSDK_Annot* pAnnot)
-{
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
- {
- pFormFiller->OnCreate(pAnnot);
- }
-}
-
-void CFFL_IFormFiller::OnLoad(CPDFSDK_Annot* pAnnot)
-{
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
- {
- pFormFiller->OnLoad(pAnnot);
- }
-}
-
-void CFFL_IFormFiller::OnDelete(CPDFSDK_Annot* pAnnot)
-{
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
- {
- pFormFiller->OnDelete(pAnnot);
- }
-
- UnRegisterFormFiller(pAnnot);
-}
-
-void CFFL_IFormFiller::OnMouseEnter(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlag)
-{
- ASSERT(pAnnot != NULL);
- ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
-
- if (!m_bNotifying)
- {
- CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
- if (pWidget->GetAAction(CPDF_AAction::CursorEnter))
- {
- m_bNotifying = TRUE;
-
- int nValueAge = pWidget->GetValueAge();
-
- pWidget->ClearAppModified();
-
- ASSERT(pPageView != NULL);
-
-
-
- PDFSDK_FieldAction fa;
- fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag);
- fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag);
- pWidget->OnAAction(CPDF_AAction::CursorEnter, fa, pPageView );
- m_bNotifying = FALSE;
-
- //if ( !IsValidAnnot(pPageView, pAnnot) ) return;
-
- if (pWidget->IsAppModified())
- {
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE))
- {
- pFormFiller->ResetPDFWindow(pPageView, pWidget->GetValueAge() == nValueAge);
- }
- }
- }
- }
-
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, TRUE))
- {
- pFormFiller->OnMouseEnter(pPageView, pAnnot);
- }
-}
-
-void CFFL_IFormFiller::OnMouseExit(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlag)
-{
- ASSERT(pAnnot != NULL);
- ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
-
- if (!m_bNotifying)
- {
- CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
- if (pWidget->GetAAction(CPDF_AAction::CursorExit))
- {
- m_bNotifying = TRUE;
- pWidget->GetAppearanceAge();
- int nValueAge = pWidget->GetValueAge();
- pWidget->ClearAppModified();
-
- ASSERT(pPageView != NULL);
-
-
-
- PDFSDK_FieldAction fa;
- fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag);
- fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag);
-
- pWidget->OnAAction(CPDF_AAction::CursorExit, fa, pPageView);
- m_bNotifying = FALSE;
-
- //if (!IsValidAnnot(pPageView, pAnnot)) return;
-
- if (pWidget->IsAppModified())
- {
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE))
- {
- pFormFiller->ResetPDFWindow(pPageView, nValueAge == pWidget->GetValueAge());
- }
- }
- }
- }
-
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
- {
- pFormFiller->OnMouseExit(pPageView, pAnnot);
- }
-}
-
-FX_BOOL CFFL_IFormFiller::OnLButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
-{
- ASSERT(pAnnot != NULL);
- ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
-
- if (!m_bNotifying)
- {
- CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
- if (Annot_HitTest(pPageView, pAnnot, point) && pWidget->GetAAction(CPDF_AAction::ButtonDown))
- {
- m_bNotifying = TRUE;
- pWidget->GetAppearanceAge();
- int nValueAge = pWidget->GetValueAge();
- pWidget->ClearAppModified();
-
- ASSERT(pPageView != NULL);
-
-
-
- PDFSDK_FieldAction fa;
- fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlags);
- fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlags);
- pWidget->OnAAction(CPDF_AAction::ButtonDown, fa, pPageView);
- m_bNotifying = FALSE;
-
- if (!IsValidAnnot(pPageView, pAnnot)) return TRUE;
-
- if (pWidget->IsAppModified())
- {
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE))
- {
- pFormFiller->ResetPDFWindow(pPageView, nValueAge == pWidget->GetValueAge());
- }
- }
- }
- }
-
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
- {
- return pFormFiller->OnLButtonDown(pPageView, pAnnot, nFlags, point);
- }
-
- return FALSE;
-}
-
-FX_BOOL CFFL_IFormFiller::OnLButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
-{
- ASSERT(pAnnot != NULL);
- ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
-
- CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
- // CReader_Page* pPage = pAnnot->GetPage();
- // ASSERT(pPage != NULL);
- CPDFSDK_Document* pDocument = m_pApp->GetCurrentDoc();
- ASSERT(pDocument != NULL);
-
- switch (pWidget->GetFieldType())
- {
- case FIELDTYPE_PUSHBUTTON:
- case FIELDTYPE_CHECKBOX:
- case FIELDTYPE_RADIOBUTTON:
- if (GetViewBBox(pPageView, pAnnot).Contains((int)point.x, (int)point.y))
- {
- pDocument->SetFocusAnnot(pAnnot);
- }
- break;
- default:
- pDocument->SetFocusAnnot(pAnnot);
- break;
- }
-
- FX_BOOL bRet = FALSE;
-
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
- {
- bRet = pFormFiller->OnLButtonUp(pPageView, pAnnot, nFlags, point);
- }
-
- if (pDocument->GetFocusAnnot() == pAnnot)
- {
- FX_BOOL bExit = FALSE;
- FX_BOOL bReset = FALSE;
- OnButtonUp(pWidget, pPageView, bReset, bExit,nFlags);
- if (bExit) return TRUE;
- }
- return bRet;
-}
-
-void CFFL_IFormFiller::OnButtonUp(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPageView, FX_BOOL& bReset, FX_BOOL& bExit,FX_UINT nFlag)
-{
- ASSERT(pWidget != NULL);
-
- if (!m_bNotifying)
- {
- if (pWidget->GetAAction(CPDF_AAction::ButtonUp))
- {
- m_bNotifying = TRUE;
- int nAge = pWidget->GetAppearanceAge();
- int nValueAge = pWidget->GetValueAge();
-
- ASSERT(pPageView != NULL);
-// CReader_DocView* pDocView = pPageView->GetDocView();
-// ASSERT(pDocView != NULL);
-
-
-
- PDFSDK_FieldAction fa;
- fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag);
- fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag);
-
- pWidget->OnAAction(CPDF_AAction::ButtonUp, fa, pPageView);
- m_bNotifying = FALSE;
-
- if (!IsValidAnnot(pPageView, pWidget))
- {
- bExit = TRUE;
- return;
- }
-
- if (nAge != pWidget->GetAppearanceAge())
- {
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE))
- {
- pFormFiller->ResetPDFWindow(pPageView, nValueAge == pWidget->GetValueAge());
- }
-
- bReset = TRUE;
- }
- }
- }
-}
-
-FX_BOOL CFFL_IFormFiller::OnLButtonDblClk(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
-{
- ASSERT(pAnnot != NULL);
- ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
-
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
- {
- return pFormFiller->OnLButtonDblClk(pPageView, pAnnot, nFlags, point);
- }
-
- return FALSE;
-}
-
-FX_BOOL CFFL_IFormFiller::OnMouseMove(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
-{
- ASSERT(pAnnot != NULL);
- ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
-
- //change cursor
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, TRUE))
- {
- return pFormFiller->OnMouseMove(pPageView, pAnnot, nFlags, point);
- }
-
- return FALSE;
-}
-
-FX_BOOL CFFL_IFormFiller::OnMouseWheel(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, short zDelta, const CPDF_Point& point)
-{
- ASSERT(pAnnot != NULL);
- ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
-
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
- {
- return pFormFiller->OnMouseWheel(pPageView, pAnnot, nFlags, zDelta, point);
- }
-
- return FALSE;
-}
-
-FX_BOOL CFFL_IFormFiller::OnRButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
-{
- ASSERT(pAnnot != NULL);
- ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
-
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
- {
- return pFormFiller->OnRButtonDown(pPageView, pAnnot, nFlags, point);
- }
-
- return FALSE;
-}
-
-FX_BOOL CFFL_IFormFiller::OnRButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
-{
- ASSERT(pAnnot != NULL);
- ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
-
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
- {
- return pFormFiller->OnRButtonUp(pPageView, pAnnot, nFlags, point);
- }
-
- return FALSE;
-}
-
-FX_BOOL CFFL_IFormFiller::OnRButtonDblClk(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
-{
- ASSERT(pAnnot != NULL);
- ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
-
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
- {
- return pFormFiller->OnRButtonDblClk(pPageView, pAnnot, nFlags, point);
- }
-
- return FALSE;
-}
-
-FX_BOOL CFFL_IFormFiller::OnKeyDown(CPDFSDK_Annot* pAnnot, FX_UINT nKeyCode, FX_UINT nFlags)
-{
- ASSERT(pAnnot != NULL);
- ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
-
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
- {
- return pFormFiller->OnKeyDown(pAnnot, nKeyCode, nFlags);
- }
-
- return FALSE;
-}
-
-FX_BOOL CFFL_IFormFiller::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags)
-{
- ASSERT(pAnnot != NULL);
- ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
-
- if (nChar == FWL_VKEY_Tab) return TRUE;
-
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
- {
- return pFormFiller->OnChar(pAnnot, nChar, nFlags);
- }
-
- return FALSE;
-}
-
-void CFFL_IFormFiller::OnDeSelected(CPDFSDK_Annot* pAnnot)
-{
- ASSERT(pAnnot != NULL);
- ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
-
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
- {
- pFormFiller->OnDeSelected(pAnnot);
- }
-}
-
-void CFFL_IFormFiller::OnSelected(CPDFSDK_Annot* pAnnot)
-{
- ASSERT(pAnnot != NULL);
- ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
-
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
- {
- pFormFiller->OnSelected(pAnnot);
- }
-}
-
-FX_BOOL CFFL_IFormFiller::OnSetFocus(CPDFSDK_Annot* pAnnot,FX_UINT nFlag)
-{
- if(!pAnnot) return FALSE;
- ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
-
- if (!m_bNotifying)
- {
- CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
- if (pWidget->GetAAction(CPDF_AAction::GetFocus))
- {
- m_bNotifying = TRUE;
- pWidget->GetAppearanceAge();
- int nValueAge = pWidget->GetValueAge();
- pWidget->ClearAppModified();
-
-
- CPDFSDK_PageView* pPageView = pAnnot->GetPageView();
- ASSERT(pPageView != NULL);
-
- PDFSDK_FieldAction fa;
- fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag);
- fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag);
-
-
- CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, TRUE);
- if(!pFormFiller) return FALSE;
- pFormFiller->GetActionData(pPageView, CPDF_AAction::GetFocus, fa);
-
- pWidget->OnAAction(CPDF_AAction::GetFocus, fa, pPageView);
- m_bNotifying = FALSE;
-
- // if (!IsValidAnnot(m_pApp, pDocument, pDocView, pPageView, pAnnot)) return FALSE;
-
- if (pWidget->IsAppModified())
- {
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE))
- {
- pFormFiller->ResetPDFWindow(pPageView, nValueAge == pWidget->GetValueAge());
- }
- }
- }
- }
-
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, TRUE))
- {
- if (pFormFiller->OnSetFocus(pAnnot, nFlag))
- {
- return TRUE;
- }
- else
- return FALSE;
- }
-
- return TRUE;
-}
-
-FX_BOOL CFFL_IFormFiller::OnKillFocus(CPDFSDK_Annot* pAnnot,FX_UINT nFlag)
-{
- if(!pAnnot) return FALSE;
- ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
-
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
- {
- if (pFormFiller->OnKillFocus(pAnnot, nFlag))
- {
- if (!m_bNotifying)
- {
- CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
- if (pWidget->GetAAction(CPDF_AAction::LoseFocus))
- {
- m_bNotifying = TRUE;
- pWidget->ClearAppModified();
-
- CPDFSDK_PageView* pPageView = pWidget->GetPageView();
- ASSERT(pPageView != NULL);
-
- PDFSDK_FieldAction fa;
- fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag);
- fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag);
-
- pFormFiller->GetActionData(pPageView, CPDF_AAction::LoseFocus, fa);
-
- pWidget->OnAAction(CPDF_AAction::LoseFocus, fa, pPageView);
- m_bNotifying = FALSE;
-
- }
- }
- }
- else
- return FALSE;
- }
-
- return TRUE;
-}
-
-FX_BOOL CFFL_IFormFiller::IsVisible(CPDFSDK_Widget* pWidget)
-{
- return pWidget->IsVisible();
-}
-
-FX_BOOL CFFL_IFormFiller::IsReadOnly(CPDFSDK_Widget* pWidget)
-{
- ASSERT(pWidget != NULL);
-
- int nFieldFlags = pWidget->GetFieldFlags();
-
- return (nFieldFlags & FIELDFLAG_READONLY) == FIELDFLAG_READONLY;
-}
-
-FX_BOOL CFFL_IFormFiller::IsFillingAllowed(CPDFSDK_Widget* pWidget)
-{
- ASSERT(pWidget != NULL);
-
- if (pWidget->GetFieldType() == FIELDTYPE_PUSHBUTTON)
- return TRUE;
- else
- {
- CPDF_Page* pPage = pWidget->GetPDFPage();
- ASSERT(pPage != NULL);
-
- CPDF_Document* pDocument = pPage->m_pDocument;
- ASSERT(pDocument != NULL);
-
- FX_DWORD dwPermissions = pDocument->GetUserPermissions();
- return (dwPermissions&FPDFPERM_FILL_FORM) ||
- (dwPermissions&FPDFPERM_ANNOT_FORM) ||
- (dwPermissions&FPDFPERM_MODIFY);
- }
- return TRUE;
-}
-
-CFFL_FormFiller* CFFL_IFormFiller::GetFormFiller(CPDFSDK_Annot* pAnnot, FX_BOOL bRegister)
-{
-// ASSERT(pAnnot != NULL);
-// ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
-
- CFFL_FormFiller * pFormFiller = NULL;
- m_Maps.Lookup(pAnnot, pFormFiller);
-
- if (pFormFiller)
- return pFormFiller;
-
- if (bRegister)
- {
- CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
-
- int nFieldType = pWidget->GetFieldType();
- switch(nFieldType)
- {
- case FIELDTYPE_PUSHBUTTON:
- pFormFiller = new CFFL_PushButton(m_pApp, pWidget);
- break;
- case FIELDTYPE_CHECKBOX:
- pFormFiller = new CFFL_CheckBox(m_pApp, pWidget);
- break;
- case FIELDTYPE_RADIOBUTTON:
- pFormFiller = new CFFL_RadioButton(m_pApp, pWidget);
- break;
- case FIELDTYPE_TEXTFIELD:
- pFormFiller = new CFFL_TextField(m_pApp, pWidget);
- break;
- case FIELDTYPE_LISTBOX:
- pFormFiller = new CFFL_ListBox(m_pApp, pWidget);
- break;
- case FIELDTYPE_COMBOBOX:
- pFormFiller = new CFFL_ComboBox(m_pApp, pWidget);
- break;
- case FIELDTYPE_UNKNOWN:
- default:
- pFormFiller = NULL;
- break;
- }
-
- if (pFormFiller)
- {
- m_Maps.SetAt(pAnnot, pFormFiller);
- }
- }
-
- return pFormFiller;
-}
-
-void CFFL_IFormFiller::RemoveFormFiller(CPDFSDK_Annot* pAnnot)
-{
- if ( pAnnot != NULL )
- {
- UnRegisterFormFiller( pAnnot );
- }
-}
-
-void CFFL_IFormFiller::UnRegisterFormFiller(CPDFSDK_Annot* pAnnot)
-{
- CFFL_FormFiller * pFormFiller = NULL;
-
- if (m_Maps.Lookup(pAnnot,pFormFiller))
- {
- if (pFormFiller)
- delete pFormFiller;
- m_Maps.RemoveKey(pAnnot);
- }
-}
-
-void CFFL_IFormFiller::SetFocusAnnotTab(CPDFSDK_Annot* pWidget, FX_BOOL bSameField, FX_BOOL bNext)
-{
-
-}
-
-void CFFL_IFormFiller::QueryWherePopup(void* pPrivateData, FX_FLOAT fPopupMin,FX_FLOAT fPopupMax, FX_INT32 & nRet, FX_FLOAT & fPopupRet)
-{
- ASSERT(pPrivateData != NULL);
-
- CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData;
-
-
-
-
- CPDF_Rect rcPageView(0,0,0,0);
- rcPageView.right = pData->pWidget->GetPDFPage()->GetPageWidth();
- rcPageView.bottom = pData->pWidget->GetPDFPage()->GetPageHeight();
- rcPageView.Normalize();
-
-
- ASSERT(pData->pWidget != NULL);
- CPDF_Rect rcAnnot = pData->pWidget->GetRect();
-
- FX_FLOAT fTop = 0.0f;
- FX_FLOAT fBottom = 0.0f;
-
- CPDFSDK_Widget * pWidget = (CPDFSDK_Widget*)pData->pWidget;
- switch (pWidget->GetRotate() / 90)
- {
- default:
- case 0:
- fTop = rcPageView.top - rcAnnot.top;
- fBottom = rcAnnot.bottom - rcPageView.bottom;
- break;
- case 1:
- fTop = rcAnnot.left - rcPageView.left;
- fBottom = rcPageView.right - rcAnnot.right;
- break;
- case 2:
- fTop = rcAnnot.bottom - rcPageView.bottom;
- fBottom = rcPageView.top - rcAnnot.top;
- break;
- case 3:
- fTop = rcPageView.right - rcAnnot.right;
- fBottom = rcAnnot.left - rcPageView.left;
- break;
- }
-
- FX_FLOAT fFactHeight = 0;
- FX_BOOL bBottom = TRUE;
- FX_FLOAT fMaxListBoxHeight = 0;
- if (fPopupMax > FFL_MAXLISTBOXHEIGHT)
- {
- if (fPopupMin > FFL_MAXLISTBOXHEIGHT)
- {
- fMaxListBoxHeight = fPopupMin;
- }
- else
- {
- fMaxListBoxHeight = FFL_MAXLISTBOXHEIGHT;
- }
- }
- else
- fMaxListBoxHeight = fPopupMax;
-
- if (fBottom > fMaxListBoxHeight)
- {
- fFactHeight = fMaxListBoxHeight;
- bBottom = TRUE;
- }
- else
- {
- if (fTop > fMaxListBoxHeight)
- {
- fFactHeight = fMaxListBoxHeight;
- bBottom = FALSE;
- }
- else
- {
- if (fTop > fBottom)
- {
- fFactHeight = fTop;
- bBottom = FALSE;
- }
- else
- {
- fFactHeight = fBottom;
- bBottom = TRUE;
- }
- }
- }
-
- nRet = bBottom ? 0 : 1;
- fPopupRet = fFactHeight;
-}
-
-void CFFL_IFormFiller::OnSetWindowRect(void* pPrivateData, const CPDF_Rect & rcWindow)
-{
- ASSERT(pPrivateData != NULL);
-
- CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData;
-
- if (CFFL_FormFiller* pFormFiller = GetFormFiller(pData->pWidget, TRUE))
- {
-
- CPDF_Rect rcOld = pFormFiller->PWLtoFFL(pFormFiller->GetWindowRect(pData->pPageView));
- CPDF_Rect rcNew = pFormFiller->PWLtoFFL(rcWindow);
- pFormFiller->SetWindowRect(pData->pPageView, rcWindow);
-
- CPDF_Rect unRect = rcOld;
- unRect.Union(rcNew);
- //FX_RECT rcRect = unRect.GetOutterRect();
- unRect.left = (FX_FLOAT)(unRect.left - 0.5);
- unRect.right = (FX_FLOAT)(unRect.right + 0.5);
- unRect.top = (FX_FLOAT)(unRect.top + 0.5);
- unRect.bottom = (FX_FLOAT)(unRect.bottom -0.5);
- m_pApp->FFI_Invalidate(pData->pWidget->GetPDFPage(), unRect.left, unRect.top, unRect.right, unRect.bottom);
- }
-}
-
-void CFFL_IFormFiller::OnKeyStroke(FX_BOOL bEditOrList, void* pPrivateData, FX_INT32 nKeyCode, CFX_WideString& strChange,
- const CFX_WideString& strChangeEx, FX_BOOL bKeyDown,
- FX_BOOL & bRC, FX_BOOL & bExit)
-{
- ASSERT(pPrivateData != NULL);
- CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData;
- ASSERT(pData->pWidget != NULL);
-
- CFFL_FormFiller* pFormFiller = GetFormFiller(pData->pWidget, FALSE);
- ASSERT(pFormFiller != NULL);
-
- pFormFiller->OnKeyStroke(bKeyDown);
-}
-
-void CFFL_IFormFiller::OnKeyStrokeCommit(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPageView, FX_BOOL& bRC, FX_BOOL& bExit, FX_DWORD nFlag)
-{
- if (!m_bNotifying)
- {
- ASSERT(pWidget != NULL);
- if (pWidget->GetAAction(CPDF_AAction::KeyStroke))
- {
- m_bNotifying = TRUE;
- pWidget->ClearAppModified();
-
- ASSERT(pPageView != NULL);
-// CReader_DocView* pDocView = pPageView->GetDocView();
-// ASSERT(pDocView != NULL);
-
-
-
- PDFSDK_FieldAction fa;
- fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag);
- fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag);
- fa.bWillCommit = TRUE;
- fa.nCommitKey = GetCommitKey();
- fa.bKeyDown = GetKeyDown();
- fa.bRC = TRUE;
-
- CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE);
- ASSERT(pFormFiller != NULL);
-
- pFormFiller->GetActionData(pPageView, CPDF_AAction::KeyStroke, fa);
- pFormFiller->SaveState(pPageView);
-
- PDFSDK_FieldAction faOld = fa;
- pWidget->OnAAction(CPDF_AAction::KeyStroke, fa, pPageView);
-
- bRC = fa.bRC;
-// bExit = !IsValidAnnot(m_pApp, pDocument, pDocView, pPageView, pWidget);
-
- m_bNotifying = FALSE;
- }
- }
-}
-
-void CFFL_IFormFiller::OnValidate(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPageView, FX_BOOL& bRC, FX_BOOL& bExit, FX_DWORD nFlag)
-{
- if (!m_bNotifying)
- {
- ASSERT(pWidget != NULL);
- if (pWidget->GetAAction(CPDF_AAction::Validate))
- {
- m_bNotifying = TRUE;
- pWidget->ClearAppModified();
-
- ASSERT(pPageView != NULL);
-// CReader_DocView* pDocView = pPageView->GetDocView();
-// ASSERT(pDocView != NULL);
-
-
-
- PDFSDK_FieldAction fa;
- fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag);
- fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag);
- fa.bKeyDown = GetKeyDown();
- fa.bRC = TRUE;
-
- CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE);
- ASSERT(pFormFiller != NULL);
-
- pFormFiller->GetActionData(pPageView, CPDF_AAction::Validate, fa);
- pFormFiller->SaveState(pPageView);
-
- PDFSDK_FieldAction faOld = fa;
- pWidget->OnAAction(CPDF_AAction::Validate, fa, pPageView);
-
- bRC = fa.bRC;
-// bExit = !IsValidAnnot(m_pApp, pDocument, pDocView, pPageView, pWidget);
-
- m_bNotifying = FALSE;
- }
- }
-}
-
-void CFFL_IFormFiller::OnCalculate(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPageView, FX_BOOL& bExit, FX_DWORD nFlag)
-{
- if (!m_bNotifying)
- {
- ASSERT(pWidget != NULL);
- ASSERT(pPageView != NULL);
-// CReader_DocView* pDocView = pPageView->GetDocView();
-// ASSERT(pDocView != NULL);
- CPDFSDK_Document* pDocument = pPageView->GetSDKDocument();
- ASSERT(pDocument != NULL);
-
- CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pDocument->GetInterForm();
- ASSERT(pInterForm != NULL);
-
- pInterForm->OnCalculate(pWidget->GetFormField());
-
-// bExit = !IsValidAnnot(m_pApp, pDocument, pDocView, pPageView, pWidget);
-
- m_bNotifying = FALSE;
- }
-}
-
-void CFFL_IFormFiller::OnFormat(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPageView, FX_BOOL& bExit, FX_DWORD nFlag)
-{
- if (!m_bNotifying)
- {
- ASSERT(pWidget != NULL);
- ASSERT(pPageView != NULL);
-// CReader_DocView* pDocView = pPageView->GetDocView();
-// ASSERT(pDocView != NULL);
- CPDFSDK_Document* pDocument = pPageView->GetSDKDocument();
- ASSERT(pDocument != NULL);
-
- CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pDocument->GetInterForm();
- ASSERT(pInterForm != NULL);
-
- FX_BOOL bFormated = FALSE;
- CFX_WideString sValue = pInterForm->OnFormat(pWidget->GetFormField(), GetCommitKey(), bFormated);
-
-// bExit = !IsValidAnnot(m_pApp, pDocument, pDocView, pPageView, pWidget);
-
- if (bExit) return;
-
- if (bFormated)
- {
- pInterForm->ResetFieldAppearance(pWidget->GetFormField(), sValue, TRUE);
- pInterForm->UpdateField(pWidget->GetFormField());
- }
-
- m_bNotifying = FALSE;
- }
-}
-
-// LRESULT CALLBACK CFFL_IFormFiller::FFL_WndProc(
-// int code, // hook code
-// WPARAM wParam, // virtual-key code
-// LPARAM lParam // keystroke-message information
-// )
-// {
-// if (code != HC_ACTION)
-// {
-// return CallNextHookEx (m_hookSheet, code, wParam, lParam);
-// }
-//
-// FXSYS_memcpy(&g_Msg, (void*)lParam, sizeof(MSG));
-//
-// return 0;
-// }
-
-// MSG CFFL_IFormFiller::GetLastMessage()
-// {
-// return g_Msg;
-// }
-
-int CFFL_IFormFiller::GetCommitKey()
-{
-// MSG msg = CFFL_IFormFiller::GetLastMessage();
-
- int nCommitKey = 0;
-// switch (msg.message)
-// {
-// case WM_LBUTTONDOWN:
-// case WM_LBUTTONUP:
-// nCommitKey = 1;
-// break;
-// case WM_KEYDOWN:
-// switch (msg.wParam)
-// {
-// case VK_RETURN:
-// nCommitKey = 2;
-// break;
-// case VK_TAB:
-// nCommitKey = 3;
-// break;
-// }
-// break;
-// }
-
- return nCommitKey;
-}
-
-FX_BOOL CFFL_IFormFiller::GetKeyDown()
-{
- return TRUE;
-// MSG msg = CFFL_IFormFiller::GetLastMessage();
-//
-// return msg.message == WM_KEYDOWN || msg.message == WM_CHAR;
-}
-
-FX_BOOL CFFL_IFormFiller::IsValidAnnot(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot)
-{
-
- ASSERT(pPageView != NULL);
- ASSERT(pAnnot != NULL);
-
- if(pPageView)
- return pPageView->IsValidAnnot(pAnnot->GetPDFAnnot());
- else
- return FALSE;
-}
-
-void CFFL_IFormFiller::BeforeUndo(CPDFSDK_Document* pDocument)
-{
-
-}
-
-void CFFL_IFormFiller::BeforeRedo(CPDFSDK_Document* pDocument)
-{
- BeforeUndo(pDocument);
-}
-
-void CFFL_IFormFiller::AfterUndo(CPDFSDK_Document* pDocument)
-{
-}
-
-void CFFL_IFormFiller::AfterRedo(CPDFSDK_Document* pDocument)
-{
-}
-
-FX_BOOL CFFL_IFormFiller::CanCopy(CPDFSDK_Document* pDocument)
-{
-
- return FALSE;
-}
-
-FX_BOOL CFFL_IFormFiller::CanCut(CPDFSDK_Document* pDocument)
-{
-
- return FALSE;
-}
-
-FX_BOOL CFFL_IFormFiller::CanPaste(CPDFSDK_Document* pDocument)
-{
-
- return FALSE;
-}
-
-void CFFL_IFormFiller::DoCopy(CPDFSDK_Document* pDocument)
-{
-}
-
-void CFFL_IFormFiller::DoCut(CPDFSDK_Document* pDocument)
-{
-}
-
-void CFFL_IFormFiller::DoPaste(CPDFSDK_Document* pDocument)
-{
-
-}
-void CFFL_IFormFiller::OnBeforeKeyStroke(FX_BOOL bEditOrList, void* pPrivateData, FX_INT32 nKeyCode,
- CFX_WideString & strChange, const CFX_WideString& strChangeEx,
- int nSelStart, int nSelEnd,
- FX_BOOL bKeyDown, FX_BOOL & bRC, FX_BOOL & bExit, FX_DWORD nFlag)
-{
- ASSERT(pPrivateData != NULL);
- CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData;
- ASSERT(pData->pWidget != NULL);
-
- CFFL_FormFiller* pFormFiller = GetFormFiller(pData->pWidget, FALSE);
- ASSERT(pFormFiller != NULL);
-
- if (!m_bNotifying)
- {
- if (pData->pWidget->GetAAction(CPDF_AAction::KeyStroke))
- {
- m_bNotifying = TRUE;
- int nAge = pData->pWidget->GetAppearanceAge();
- int nValueAge = pData->pWidget->GetValueAge();
-
- ASSERT(pData->pPageView != NULL);
- CPDFSDK_Document* pDocument = pData->pPageView->GetSDKDocument();
-
- PDFSDK_FieldAction fa;
- fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag);
- fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag);
- fa.sChange = strChange;
- fa.sChangeEx = strChangeEx;
- fa.bKeyDown = bKeyDown;
- fa.bWillCommit = FALSE;
- fa.bRC = TRUE;
- fa.nSelStart = nSelStart;
- fa.nSelEnd = nSelEnd;
-
-
- pFormFiller->GetActionData(pData->pPageView, CPDF_AAction::KeyStroke, fa);
- pFormFiller->SaveState(pData->pPageView);
-
- if (pData->pWidget->OnAAction(CPDF_AAction::KeyStroke, fa, pData->pPageView))
- {
- if (!IsValidAnnot(pData->pPageView, pData->pWidget))
- {
- bExit = TRUE;
- m_bNotifying = FALSE;
- return;
- }
-
- if (nAge != pData->pWidget->GetAppearanceAge())
- {
- CPWL_Wnd* pWnd = pFormFiller->ResetPDFWindow(pData->pPageView, nValueAge == pData->pWidget->GetValueAge());
- pData = (CFFL_PrivateData*)pWnd->GetAttachedData();
- bExit = TRUE;
- }
-
- if (fa.bRC)
- {
- pFormFiller->SetActionData(pData->pPageView, CPDF_AAction::KeyStroke, fa);
- bRC = FALSE;
- }
- else
- {
- pFormFiller->RestoreState(pData->pPageView);
- bRC = FALSE;
- }
-
- if (pDocument->GetFocusAnnot() != pData->pWidget)
- {
- pFormFiller->CommitData(pData->pPageView,nFlag);
- bExit = TRUE;
- }
- }
- else
- {
- if (!IsValidAnnot(pData->pPageView, pData->pWidget))
- {
- bExit = TRUE;
- m_bNotifying = FALSE;
- return;
- }
- }
-
- m_bNotifying = FALSE;
- }
- }
-}
-
-void CFFL_IFormFiller::OnAfterKeyStroke(FX_BOOL bEditOrList, void* pPrivateData, FX_BOOL & bExit,FX_DWORD nFlag)
-{
- ASSERT(pPrivateData != NULL);
- CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData;
- ASSERT(pData->pWidget != NULL);
-
- CFFL_FormFiller* pFormFiller = GetFormFiller(pData->pWidget, FALSE);
- ASSERT(pFormFiller != NULL);
-
- if (!bEditOrList)
- pFormFiller->OnKeyStroke(bExit);
-}
+// 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
+
+#include "../../include/formfiller/FFL_FormFiller.h"
+#include "../../include/formfiller/FFL_IFormFiller.h"
+#include "../../include/formfiller/FFL_CheckBox.h"
+#include "../../include/formfiller/FFL_ComboBox.h"
+#include "../../include/formfiller/FFL_ListBox.h"
+#include "../../include/formfiller/FFL_PushButton.h"
+#include "../../include/formfiller/FFL_RadioButton.h"
+#include "../../include/formfiller/FFL_TextField.h"
+
+#define FFL_MAXLISTBOXHEIGHT 140.0f
+
+// HHOOK CFFL_IFormFiller::m_hookSheet = NULL;
+// MSG CFFL_IFormFiller::g_Msg;
+
+/* ----------------------------- CFFL_IFormFiller ----------------------------- */
+
+CFFL_IFormFiller::CFFL_IFormFiller(CPDFDoc_Environment* pApp) :
+ m_pApp(pApp),
+ m_bNotifying(FALSE)
+{
+}
+
+CFFL_IFormFiller::~CFFL_IFormFiller()
+{
+ FX_POSITION pos = m_Maps.GetStartPosition();
+ while (pos)
+ {
+ CPDFSDK_Annot * pAnnot = NULL;
+ CFFL_FormFiller * pFormFiller = NULL;
+ m_Maps.GetNextAssoc(pos,pAnnot,pFormFiller);
+ delete pFormFiller;
+ }
+ m_Maps.RemoveAll();
+}
+
+FX_BOOL CFFL_IFormFiller::Annot_HitTest(CPDFSDK_PageView* pPageView,CPDFSDK_Annot* pAnnot, CPDF_Point point)
+{
+ CPDF_Rect rc = pAnnot->GetRect();
+ if(rc.Contains(point.x, point.y))
+ return TRUE;
+ return FALSE;
+}
+
+FX_RECT CFFL_IFormFiller::GetViewBBox(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot)
+{
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
+ {
+ return pFormFiller->GetViewBBox(pPageView, pAnnot);
+ }
+ else
+ {
+ ASSERT(pPageView != NULL);
+ ASSERT(pAnnot != NULL);
+
+ CPDF_Annot* pPDFAnnot = pAnnot->GetPDFAnnot();
+ ASSERT(pPDFAnnot != NULL);
+
+ CPDF_Rect rcAnnot;
+ pPDFAnnot->GetRect(rcAnnot);
+
+// CRect rcWin;
+// pPageView->DocToWindow(rcAnnot, rcWin);
+ CPDF_Rect rcWin = CPWL_Utils::InflateRect(rcAnnot,1);
+// rcWin.InflateRect(1, 1);
+
+ return rcWin.GetOutterRect();
+ }
+}
+
+void CFFL_IFormFiller::OnDraw(CPDFSDK_PageView* pPageView, /*HDC hDC,*/ CPDFSDK_Annot* pAnnot,
+ CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
+ /*const CRect& rcWindow,*/ FX_DWORD dwFlags)
+{
+ ASSERT(pPageView != NULL);
+ CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
+
+ if (IsVisible(pWidget))
+ {
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
+ {
+ if (pFormFiller->IsValid())
+ {
+ pFormFiller->OnDraw(pPageView, pAnnot, pDevice, pUser2Device, dwFlags);
+
+ pAnnot->GetPDFPage();
+
+
+ CPDFSDK_Document* pDocument = m_pApp->GetCurrentDoc();
+ ASSERT(pDocument != NULL);
+
+ if (pDocument->GetFocusAnnot() == pAnnot)
+ {
+ CPDF_Rect rcFocus = pFormFiller->GetFocusBox(pPageView);
+ if (!rcFocus.IsEmpty())
+ {
+ CFX_PathData path;
+
+ path.SetPointCount(5);
+ path.SetPoint(0, rcFocus.left, rcFocus.top, FXPT_MOVETO);
+ path.SetPoint(1, rcFocus.left, rcFocus.bottom, FXPT_LINETO);
+ path.SetPoint(2, rcFocus.right, rcFocus.bottom, FXPT_LINETO);
+ path.SetPoint(3, rcFocus.right, rcFocus.top, FXPT_LINETO);
+ path.SetPoint(4, rcFocus.left, rcFocus.top, FXPT_LINETO);
+
+ CFX_GraphStateData gsd;
+ gsd.SetDashCount(1);
+ gsd.m_DashArray[0] = 1.0f;
+ gsd.m_DashPhase = 0;
+
+ gsd.m_LineWidth = 1.0f;
+ pDevice->DrawPath(&path, pUser2Device, &gsd, 0, ArgbEncode(255,0,0,0), FXFILL_ALTERNATE);
+
+ // ::DrawFocusRect(hDC, &rcFocus);
+ }
+ }
+
+ return;
+ }
+ }
+
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
+ pFormFiller->OnDrawDeactive(pPageView, pAnnot, pDevice, pUser2Device, dwFlags);
+ else
+ pWidget->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, NULL);
+
+ if (!IsReadOnly(pWidget) && IsFillingAllowed(pWidget))
+ {
+ pWidget->DrawShadow(pDevice, pPageView);
+ }
+
+ }
+}
+
+void CFFL_IFormFiller::OnCreate(CPDFSDK_Annot* pAnnot)
+{
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
+ {
+ pFormFiller->OnCreate(pAnnot);
+ }
+}
+
+void CFFL_IFormFiller::OnLoad(CPDFSDK_Annot* pAnnot)
+{
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
+ {
+ pFormFiller->OnLoad(pAnnot);
+ }
+}
+
+void CFFL_IFormFiller::OnDelete(CPDFSDK_Annot* pAnnot)
+{
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
+ {
+ pFormFiller->OnDelete(pAnnot);
+ }
+
+ UnRegisterFormFiller(pAnnot);
+}
+
+void CFFL_IFormFiller::OnMouseEnter(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlag)
+{
+ ASSERT(pAnnot != NULL);
+ ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
+
+ if (!m_bNotifying)
+ {
+ CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
+ if (pWidget->GetAAction(CPDF_AAction::CursorEnter))
+ {
+ m_bNotifying = TRUE;
+
+ int nValueAge = pWidget->GetValueAge();
+
+ pWidget->ClearAppModified();
+
+ ASSERT(pPageView != NULL);
+
+
+
+ PDFSDK_FieldAction fa;
+ fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag);
+ fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag);
+ pWidget->OnAAction(CPDF_AAction::CursorEnter, fa, pPageView );
+ m_bNotifying = FALSE;
+
+ //if ( !IsValidAnnot(pPageView, pAnnot) ) return;
+
+ if (pWidget->IsAppModified())
+ {
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE))
+ {
+ pFormFiller->ResetPDFWindow(pPageView, pWidget->GetValueAge() == nValueAge);
+ }
+ }
+ }
+ }
+
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, TRUE))
+ {
+ pFormFiller->OnMouseEnter(pPageView, pAnnot);
+ }
+}
+
+void CFFL_IFormFiller::OnMouseExit(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlag)
+{
+ ASSERT(pAnnot != NULL);
+ ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
+
+ if (!m_bNotifying)
+ {
+ CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
+ if (pWidget->GetAAction(CPDF_AAction::CursorExit))
+ {
+ m_bNotifying = TRUE;
+ pWidget->GetAppearanceAge();
+ int nValueAge = pWidget->GetValueAge();
+ pWidget->ClearAppModified();
+
+ ASSERT(pPageView != NULL);
+
+
+
+ PDFSDK_FieldAction fa;
+ fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag);
+ fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag);
+
+ pWidget->OnAAction(CPDF_AAction::CursorExit, fa, pPageView);
+ m_bNotifying = FALSE;
+
+ //if (!IsValidAnnot(pPageView, pAnnot)) return;
+
+ if (pWidget->IsAppModified())
+ {
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE))
+ {
+ pFormFiller->ResetPDFWindow(pPageView, nValueAge == pWidget->GetValueAge());
+ }
+ }
+ }
+ }
+
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
+ {
+ pFormFiller->OnMouseExit(pPageView, pAnnot);
+ }
+}
+
+FX_BOOL CFFL_IFormFiller::OnLButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
+{
+ ASSERT(pAnnot != NULL);
+ ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
+
+ if (!m_bNotifying)
+ {
+ CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
+ if (Annot_HitTest(pPageView, pAnnot, point) && pWidget->GetAAction(CPDF_AAction::ButtonDown))
+ {
+ m_bNotifying = TRUE;
+ pWidget->GetAppearanceAge();
+ int nValueAge = pWidget->GetValueAge();
+ pWidget->ClearAppModified();
+
+ ASSERT(pPageView != NULL);
+
+
+
+ PDFSDK_FieldAction fa;
+ fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlags);
+ fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlags);
+ pWidget->OnAAction(CPDF_AAction::ButtonDown, fa, pPageView);
+ m_bNotifying = FALSE;
+
+ if (!IsValidAnnot(pPageView, pAnnot)) return TRUE;
+
+ if (pWidget->IsAppModified())
+ {
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE))
+ {
+ pFormFiller->ResetPDFWindow(pPageView, nValueAge == pWidget->GetValueAge());
+ }
+ }
+ }
+ }
+
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
+ {
+ return pFormFiller->OnLButtonDown(pPageView, pAnnot, nFlags, point);
+ }
+
+ return FALSE;
+}
+
+FX_BOOL CFFL_IFormFiller::OnLButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
+{
+ ASSERT(pAnnot != NULL);
+ ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
+
+ CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
+ // CReader_Page* pPage = pAnnot->GetPage();
+ // ASSERT(pPage != NULL);
+ CPDFSDK_Document* pDocument = m_pApp->GetCurrentDoc();
+ ASSERT(pDocument != NULL);
+
+ switch (pWidget->GetFieldType())
+ {
+ case FIELDTYPE_PUSHBUTTON:
+ case FIELDTYPE_CHECKBOX:
+ case FIELDTYPE_RADIOBUTTON:
+ if (GetViewBBox(pPageView, pAnnot).Contains((int)point.x, (int)point.y))
+ {
+ pDocument->SetFocusAnnot(pAnnot);
+ }
+ break;
+ default:
+ pDocument->SetFocusAnnot(pAnnot);
+ break;
+ }
+
+ FX_BOOL bRet = FALSE;
+
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
+ {
+ bRet = pFormFiller->OnLButtonUp(pPageView, pAnnot, nFlags, point);
+ }
+
+ if (pDocument->GetFocusAnnot() == pAnnot)
+ {
+ FX_BOOL bExit = FALSE;
+ FX_BOOL bReset = FALSE;
+ OnButtonUp(pWidget, pPageView, bReset, bExit,nFlags);
+ if (bExit) return TRUE;
+ }
+ return bRet;
+}
+
+void CFFL_IFormFiller::OnButtonUp(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPageView, FX_BOOL& bReset, FX_BOOL& bExit,FX_UINT nFlag)
+{
+ ASSERT(pWidget != NULL);
+
+ if (!m_bNotifying)
+ {
+ if (pWidget->GetAAction(CPDF_AAction::ButtonUp))
+ {
+ m_bNotifying = TRUE;
+ int nAge = pWidget->GetAppearanceAge();
+ int nValueAge = pWidget->GetValueAge();
+
+ ASSERT(pPageView != NULL);
+// CReader_DocView* pDocView = pPageView->GetDocView();
+// ASSERT(pDocView != NULL);
+
+
+
+ PDFSDK_FieldAction fa;
+ fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag);
+ fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag);
+
+ pWidget->OnAAction(CPDF_AAction::ButtonUp, fa, pPageView);
+ m_bNotifying = FALSE;
+
+ if (!IsValidAnnot(pPageView, pWidget))
+ {
+ bExit = TRUE;
+ return;
+ }
+
+ if (nAge != pWidget->GetAppearanceAge())
+ {
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE))
+ {
+ pFormFiller->ResetPDFWindow(pPageView, nValueAge == pWidget->GetValueAge());
+ }
+
+ bReset = TRUE;
+ }
+ }
+ }
+}
+
+FX_BOOL CFFL_IFormFiller::OnLButtonDblClk(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
+{
+ ASSERT(pAnnot != NULL);
+ ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
+
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
+ {
+ return pFormFiller->OnLButtonDblClk(pPageView, pAnnot, nFlags, point);
+ }
+
+ return FALSE;
+}
+
+FX_BOOL CFFL_IFormFiller::OnMouseMove(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
+{
+ ASSERT(pAnnot != NULL);
+ ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
+
+ //change cursor
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, TRUE))
+ {
+ return pFormFiller->OnMouseMove(pPageView, pAnnot, nFlags, point);
+ }
+
+ return FALSE;
+}
+
+FX_BOOL CFFL_IFormFiller::OnMouseWheel(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, short zDelta, const CPDF_Point& point)
+{
+ ASSERT(pAnnot != NULL);
+ ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
+
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
+ {
+ return pFormFiller->OnMouseWheel(pPageView, pAnnot, nFlags, zDelta, point);
+ }
+
+ return FALSE;
+}
+
+FX_BOOL CFFL_IFormFiller::OnRButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
+{
+ ASSERT(pAnnot != NULL);
+ ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
+
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
+ {
+ return pFormFiller->OnRButtonDown(pPageView, pAnnot, nFlags, point);
+ }
+
+ return FALSE;
+}
+
+FX_BOOL CFFL_IFormFiller::OnRButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
+{
+ ASSERT(pAnnot != NULL);
+ ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
+
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
+ {
+ return pFormFiller->OnRButtonUp(pPageView, pAnnot, nFlags, point);
+ }
+
+ return FALSE;
+}
+
+FX_BOOL CFFL_IFormFiller::OnRButtonDblClk(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
+{
+ ASSERT(pAnnot != NULL);
+ ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
+
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
+ {
+ return pFormFiller->OnRButtonDblClk(pPageView, pAnnot, nFlags, point);
+ }
+
+ return FALSE;
+}
+
+FX_BOOL CFFL_IFormFiller::OnKeyDown(CPDFSDK_Annot* pAnnot, FX_UINT nKeyCode, FX_UINT nFlags)
+{
+ ASSERT(pAnnot != NULL);
+ ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
+
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
+ {
+ return pFormFiller->OnKeyDown(pAnnot, nKeyCode, nFlags);
+ }
+
+ return FALSE;
+}
+
+FX_BOOL CFFL_IFormFiller::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags)
+{
+ ASSERT(pAnnot != NULL);
+ ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
+
+ if (nChar == FWL_VKEY_Tab) return TRUE;
+
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
+ {
+ return pFormFiller->OnChar(pAnnot, nChar, nFlags);
+ }
+
+ return FALSE;
+}
+
+void CFFL_IFormFiller::OnDeSelected(CPDFSDK_Annot* pAnnot)
+{
+ ASSERT(pAnnot != NULL);
+ ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
+
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
+ {
+ pFormFiller->OnDeSelected(pAnnot);
+ }
+}
+
+void CFFL_IFormFiller::OnSelected(CPDFSDK_Annot* pAnnot)
+{
+ ASSERT(pAnnot != NULL);
+ ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
+
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
+ {
+ pFormFiller->OnSelected(pAnnot);
+ }
+}
+
+FX_BOOL CFFL_IFormFiller::OnSetFocus(CPDFSDK_Annot* pAnnot,FX_UINT nFlag)
+{
+ if(!pAnnot) return FALSE;
+ ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
+
+ if (!m_bNotifying)
+ {
+ CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
+ if (pWidget->GetAAction(CPDF_AAction::GetFocus))
+ {
+ m_bNotifying = TRUE;
+ pWidget->GetAppearanceAge();
+ int nValueAge = pWidget->GetValueAge();
+ pWidget->ClearAppModified();
+
+
+ CPDFSDK_PageView* pPageView = pAnnot->GetPageView();
+ ASSERT(pPageView != NULL);
+
+ PDFSDK_FieldAction fa;
+ fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag);
+ fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag);
+
+
+ CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, TRUE);
+ if(!pFormFiller) return FALSE;
+ pFormFiller->GetActionData(pPageView, CPDF_AAction::GetFocus, fa);
+
+ pWidget->OnAAction(CPDF_AAction::GetFocus, fa, pPageView);
+ m_bNotifying = FALSE;
+
+ // if (!IsValidAnnot(m_pApp, pDocument, pDocView, pPageView, pAnnot)) return FALSE;
+
+ if (pWidget->IsAppModified())
+ {
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE))
+ {
+ pFormFiller->ResetPDFWindow(pPageView, nValueAge == pWidget->GetValueAge());
+ }
+ }
+ }
+ }
+
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, TRUE))
+ {
+ if (pFormFiller->OnSetFocus(pAnnot, nFlag))
+ {
+ return TRUE;
+ }
+ else
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+FX_BOOL CFFL_IFormFiller::OnKillFocus(CPDFSDK_Annot* pAnnot,FX_UINT nFlag)
+{
+ if(!pAnnot) return FALSE;
+ ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
+
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
+ {
+ if (pFormFiller->OnKillFocus(pAnnot, nFlag))
+ {
+ if (!m_bNotifying)
+ {
+ CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
+ if (pWidget->GetAAction(CPDF_AAction::LoseFocus))
+ {
+ m_bNotifying = TRUE;
+ pWidget->ClearAppModified();
+
+ CPDFSDK_PageView* pPageView = pWidget->GetPageView();
+ ASSERT(pPageView != NULL);
+
+ PDFSDK_FieldAction fa;
+ fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag);
+ fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag);
+
+ pFormFiller->GetActionData(pPageView, CPDF_AAction::LoseFocus, fa);
+
+ pWidget->OnAAction(CPDF_AAction::LoseFocus, fa, pPageView);
+ m_bNotifying = FALSE;
+
+ }
+ }
+ }
+ else
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+FX_BOOL CFFL_IFormFiller::IsVisible(CPDFSDK_Widget* pWidget)
+{
+ return pWidget->IsVisible();
+}
+
+FX_BOOL CFFL_IFormFiller::IsReadOnly(CPDFSDK_Widget* pWidget)
+{
+ ASSERT(pWidget != NULL);
+
+ int nFieldFlags = pWidget->GetFieldFlags();
+
+ return (nFieldFlags & FIELDFLAG_READONLY) == FIELDFLAG_READONLY;
+}
+
+FX_BOOL CFFL_IFormFiller::IsFillingAllowed(CPDFSDK_Widget* pWidget)
+{
+ ASSERT(pWidget != NULL);
+
+ if (pWidget->GetFieldType() == FIELDTYPE_PUSHBUTTON)
+ return TRUE;
+ else
+ {
+ CPDF_Page* pPage = pWidget->GetPDFPage();
+ ASSERT(pPage != NULL);
+
+ CPDF_Document* pDocument = pPage->m_pDocument;
+ ASSERT(pDocument != NULL);
+
+ FX_DWORD dwPermissions = pDocument->GetUserPermissions();
+ return (dwPermissions&FPDFPERM_FILL_FORM) ||
+ (dwPermissions&FPDFPERM_ANNOT_FORM) ||
+ (dwPermissions&FPDFPERM_MODIFY);
+ }
+ return TRUE;
+}
+
+CFFL_FormFiller* CFFL_IFormFiller::GetFormFiller(CPDFSDK_Annot* pAnnot, FX_BOOL bRegister)
+{
+// ASSERT(pAnnot != NULL);
+// ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
+
+ CFFL_FormFiller * pFormFiller = NULL;
+ m_Maps.Lookup(pAnnot, pFormFiller);
+
+ if (pFormFiller)
+ return pFormFiller;
+
+ if (bRegister)
+ {
+ CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
+
+ int nFieldType = pWidget->GetFieldType();
+ switch(nFieldType)
+ {
+ case FIELDTYPE_PUSHBUTTON:
+ pFormFiller = new CFFL_PushButton(m_pApp, pWidget);
+ break;
+ case FIELDTYPE_CHECKBOX:
+ pFormFiller = new CFFL_CheckBox(m_pApp, pWidget);
+ break;
+ case FIELDTYPE_RADIOBUTTON:
+ pFormFiller = new CFFL_RadioButton(m_pApp, pWidget);
+ break;
+ case FIELDTYPE_TEXTFIELD:
+ pFormFiller = new CFFL_TextField(m_pApp, pWidget);
+ break;
+ case FIELDTYPE_LISTBOX:
+ pFormFiller = new CFFL_ListBox(m_pApp, pWidget);
+ break;
+ case FIELDTYPE_COMBOBOX:
+ pFormFiller = new CFFL_ComboBox(m_pApp, pWidget);
+ break;
+ case FIELDTYPE_UNKNOWN:
+ default:
+ pFormFiller = NULL;
+ break;
+ }
+
+ if (pFormFiller)
+ {
+ m_Maps.SetAt(pAnnot, pFormFiller);
+ }
+ }
+
+ return pFormFiller;
+}
+
+void CFFL_IFormFiller::RemoveFormFiller(CPDFSDK_Annot* pAnnot)
+{
+ if ( pAnnot != NULL )
+ {
+ UnRegisterFormFiller( pAnnot );
+ }
+}
+
+void CFFL_IFormFiller::UnRegisterFormFiller(CPDFSDK_Annot* pAnnot)
+{
+ CFFL_FormFiller * pFormFiller = NULL;
+
+ if (m_Maps.Lookup(pAnnot,pFormFiller))
+ {
+ if (pFormFiller)
+ delete pFormFiller;
+ m_Maps.RemoveKey(pAnnot);
+ }
+}
+
+void CFFL_IFormFiller::SetFocusAnnotTab(CPDFSDK_Annot* pWidget, FX_BOOL bSameField, FX_BOOL bNext)
+{
+
+}
+
+void CFFL_IFormFiller::QueryWherePopup(void* pPrivateData, FX_FLOAT fPopupMin,FX_FLOAT fPopupMax, FX_INT32 & nRet, FX_FLOAT & fPopupRet)
+{
+ ASSERT(pPrivateData != NULL);
+
+ CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData;
+
+
+
+
+ CPDF_Rect rcPageView(0,0,0,0);
+ rcPageView.right = pData->pWidget->GetPDFPage()->GetPageWidth();
+ rcPageView.bottom = pData->pWidget->GetPDFPage()->GetPageHeight();
+ rcPageView.Normalize();
+
+
+ ASSERT(pData->pWidget != NULL);
+ CPDF_Rect rcAnnot = pData->pWidget->GetRect();
+
+ FX_FLOAT fTop = 0.0f;
+ FX_FLOAT fBottom = 0.0f;
+
+ CPDFSDK_Widget * pWidget = (CPDFSDK_Widget*)pData->pWidget;
+ switch (pWidget->GetRotate() / 90)
+ {
+ default:
+ case 0:
+ fTop = rcPageView.top - rcAnnot.top;
+ fBottom = rcAnnot.bottom - rcPageView.bottom;
+ break;
+ case 1:
+ fTop = rcAnnot.left - rcPageView.left;
+ fBottom = rcPageView.right - rcAnnot.right;
+ break;
+ case 2:
+ fTop = rcAnnot.bottom - rcPageView.bottom;
+ fBottom = rcPageView.top - rcAnnot.top;
+ break;
+ case 3:
+ fTop = rcPageView.right - rcAnnot.right;
+ fBottom = rcAnnot.left - rcPageView.left;
+ break;
+ }
+
+ FX_FLOAT fFactHeight = 0;
+ FX_BOOL bBottom = TRUE;
+ FX_FLOAT fMaxListBoxHeight = 0;
+ if (fPopupMax > FFL_MAXLISTBOXHEIGHT)
+ {
+ if (fPopupMin > FFL_MAXLISTBOXHEIGHT)
+ {
+ fMaxListBoxHeight = fPopupMin;
+ }
+ else
+ {
+ fMaxListBoxHeight = FFL_MAXLISTBOXHEIGHT;
+ }
+ }
+ else
+ fMaxListBoxHeight = fPopupMax;
+
+ if (fBottom > fMaxListBoxHeight)
+ {
+ fFactHeight = fMaxListBoxHeight;
+ bBottom = TRUE;
+ }
+ else
+ {
+ if (fTop > fMaxListBoxHeight)
+ {
+ fFactHeight = fMaxListBoxHeight;
+ bBottom = FALSE;
+ }
+ else
+ {
+ if (fTop > fBottom)
+ {
+ fFactHeight = fTop;
+ bBottom = FALSE;
+ }
+ else
+ {
+ fFactHeight = fBottom;
+ bBottom = TRUE;
+ }
+ }
+ }
+
+ nRet = bBottom ? 0 : 1;
+ fPopupRet = fFactHeight;
+}
+
+void CFFL_IFormFiller::OnSetWindowRect(void* pPrivateData, const CPDF_Rect & rcWindow)
+{
+ ASSERT(pPrivateData != NULL);
+
+ CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData;
+
+ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pData->pWidget, TRUE))
+ {
+
+ CPDF_Rect rcOld = pFormFiller->PWLtoFFL(pFormFiller->GetWindowRect(pData->pPageView));
+ CPDF_Rect rcNew = pFormFiller->PWLtoFFL(rcWindow);
+ pFormFiller->SetWindowRect(pData->pPageView, rcWindow);
+
+ CPDF_Rect unRect = rcOld;
+ unRect.Union(rcNew);
+ //FX_RECT rcRect = unRect.GetOutterRect();
+ unRect.left = (FX_FLOAT)(unRect.left - 0.5);
+ unRect.right = (FX_FLOAT)(unRect.right + 0.5);
+ unRect.top = (FX_FLOAT)(unRect.top + 0.5);
+ unRect.bottom = (FX_FLOAT)(unRect.bottom -0.5);
+ m_pApp->FFI_Invalidate(pData->pWidget->GetPDFPage(), unRect.left, unRect.top, unRect.right, unRect.bottom);
+ }
+}
+
+void CFFL_IFormFiller::OnKeyStroke(FX_BOOL bEditOrList, void* pPrivateData, FX_INT32 nKeyCode, CFX_WideString& strChange,
+ const CFX_WideString& strChangeEx, FX_BOOL bKeyDown,
+ FX_BOOL & bRC, FX_BOOL & bExit)
+{
+ ASSERT(pPrivateData != NULL);
+ CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData;
+ ASSERT(pData->pWidget != NULL);
+
+ CFFL_FormFiller* pFormFiller = GetFormFiller(pData->pWidget, FALSE);
+ ASSERT(pFormFiller != NULL);
+
+ pFormFiller->OnKeyStroke(bKeyDown);
+}
+
+void CFFL_IFormFiller::OnKeyStrokeCommit(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPageView, FX_BOOL& bRC, FX_BOOL& bExit, FX_DWORD nFlag)
+{
+ if (!m_bNotifying)
+ {
+ ASSERT(pWidget != NULL);
+ if (pWidget->GetAAction(CPDF_AAction::KeyStroke))
+ {
+ m_bNotifying = TRUE;
+ pWidget->ClearAppModified();
+
+ ASSERT(pPageView != NULL);
+// CReader_DocView* pDocView = pPageView->GetDocView();
+// ASSERT(pDocView != NULL);
+
+
+
+ PDFSDK_FieldAction fa;
+ fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag);
+ fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag);
+ fa.bWillCommit = TRUE;
+ fa.nCommitKey = GetCommitKey();
+ fa.bKeyDown = GetKeyDown();
+ fa.bRC = TRUE;
+
+ CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE);
+ ASSERT(pFormFiller != NULL);
+
+ pFormFiller->GetActionData(pPageView, CPDF_AAction::KeyStroke, fa);
+ pFormFiller->SaveState(pPageView);
+
+ PDFSDK_FieldAction faOld = fa;
+ pWidget->OnAAction(CPDF_AAction::KeyStroke, fa, pPageView);
+
+ bRC = fa.bRC;
+// bExit = !IsValidAnnot(m_pApp, pDocument, pDocView, pPageView, pWidget);
+
+ m_bNotifying = FALSE;
+ }
+ }
+}
+
+void CFFL_IFormFiller::OnValidate(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPageView, FX_BOOL& bRC, FX_BOOL& bExit, FX_DWORD nFlag)
+{
+ if (!m_bNotifying)
+ {
+ ASSERT(pWidget != NULL);
+ if (pWidget->GetAAction(CPDF_AAction::Validate))
+ {
+ m_bNotifying = TRUE;
+ pWidget->ClearAppModified();
+
+ ASSERT(pPageView != NULL);
+// CReader_DocView* pDocView = pPageView->GetDocView();
+// ASSERT(pDocView != NULL);
+
+
+
+ PDFSDK_FieldAction fa;
+ fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag);
+ fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag);
+ fa.bKeyDown = GetKeyDown();
+ fa.bRC = TRUE;
+
+ CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE);
+ ASSERT(pFormFiller != NULL);
+
+ pFormFiller->GetActionData(pPageView, CPDF_AAction::Validate, fa);
+ pFormFiller->SaveState(pPageView);
+
+ PDFSDK_FieldAction faOld = fa;
+ pWidget->OnAAction(CPDF_AAction::Validate, fa, pPageView);
+
+ bRC = fa.bRC;
+// bExit = !IsValidAnnot(m_pApp, pDocument, pDocView, pPageView, pWidget);
+
+ m_bNotifying = FALSE;
+ }
+ }
+}
+
+void CFFL_IFormFiller::OnCalculate(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPageView, FX_BOOL& bExit, FX_DWORD nFlag)
+{
+ if (!m_bNotifying)
+ {
+ ASSERT(pWidget != NULL);
+ ASSERT(pPageView != NULL);
+// CReader_DocView* pDocView = pPageView->GetDocView();
+// ASSERT(pDocView != NULL);
+ CPDFSDK_Document* pDocument = pPageView->GetSDKDocument();
+ ASSERT(pDocument != NULL);
+
+ CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pDocument->GetInterForm();
+ ASSERT(pInterForm != NULL);
+
+ pInterForm->OnCalculate(pWidget->GetFormField());
+
+// bExit = !IsValidAnnot(m_pApp, pDocument, pDocView, pPageView, pWidget);
+
+ m_bNotifying = FALSE;
+ }
+}
+
+void CFFL_IFormFiller::OnFormat(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPageView, FX_BOOL& bExit, FX_DWORD nFlag)
+{
+ if (!m_bNotifying)
+ {
+ ASSERT(pWidget != NULL);
+ ASSERT(pPageView != NULL);
+// CReader_DocView* pDocView = pPageView->GetDocView();
+// ASSERT(pDocView != NULL);
+ CPDFSDK_Document* pDocument = pPageView->GetSDKDocument();
+ ASSERT(pDocument != NULL);
+
+ CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pDocument->GetInterForm();
+ ASSERT(pInterForm != NULL);
+
+ FX_BOOL bFormated = FALSE;
+ CFX_WideString sValue = pInterForm->OnFormat(pWidget->GetFormField(), GetCommitKey(), bFormated);
+
+// bExit = !IsValidAnnot(m_pApp, pDocument, pDocView, pPageView, pWidget);
+
+ if (bExit) return;
+
+ if (bFormated)
+ {
+ pInterForm->ResetFieldAppearance(pWidget->GetFormField(), sValue, TRUE);
+ pInterForm->UpdateField(pWidget->GetFormField());
+ }
+
+ m_bNotifying = FALSE;
+ }
+}
+
+// LRESULT CALLBACK CFFL_IFormFiller::FFL_WndProc(
+// int code, // hook code
+// WPARAM wParam, // virtual-key code
+// LPARAM lParam // keystroke-message information
+// )
+// {
+// if (code != HC_ACTION)
+// {
+// return CallNextHookEx (m_hookSheet, code, wParam, lParam);
+// }
+//
+// FXSYS_memcpy(&g_Msg, (void*)lParam, sizeof(MSG));
+//
+// return 0;
+// }
+
+// MSG CFFL_IFormFiller::GetLastMessage()
+// {
+// return g_Msg;
+// }
+
+int CFFL_IFormFiller::GetCommitKey()
+{
+// MSG msg = CFFL_IFormFiller::GetLastMessage();
+
+ int nCommitKey = 0;
+// switch (msg.message)
+// {
+// case WM_LBUTTONDOWN:
+// case WM_LBUTTONUP:
+// nCommitKey = 1;
+// break;
+// case WM_KEYDOWN:
+// switch (msg.wParam)
+// {
+// case VK_RETURN:
+// nCommitKey = 2;
+// break;
+// case VK_TAB:
+// nCommitKey = 3;
+// break;
+// }
+// break;
+// }
+
+ return nCommitKey;
+}
+
+FX_BOOL CFFL_IFormFiller::GetKeyDown()
+{
+ return TRUE;
+// MSG msg = CFFL_IFormFiller::GetLastMessage();
+//
+// return msg.message == WM_KEYDOWN || msg.message == WM_CHAR;
+}
+
+FX_BOOL CFFL_IFormFiller::IsValidAnnot(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot)
+{
+
+ ASSERT(pPageView != NULL);
+ ASSERT(pAnnot != NULL);
+
+ if(pPageView)
+ return pPageView->IsValidAnnot(pAnnot->GetPDFAnnot());
+ else
+ return FALSE;
+}
+
+void CFFL_IFormFiller::BeforeUndo(CPDFSDK_Document* pDocument)
+{
+
+}
+
+void CFFL_IFormFiller::BeforeRedo(CPDFSDK_Document* pDocument)
+{
+ BeforeUndo(pDocument);
+}
+
+void CFFL_IFormFiller::AfterUndo(CPDFSDK_Document* pDocument)
+{
+}
+
+void CFFL_IFormFiller::AfterRedo(CPDFSDK_Document* pDocument)
+{
+}
+
+FX_BOOL CFFL_IFormFiller::CanCopy(CPDFSDK_Document* pDocument)
+{
+
+ return FALSE;
+}
+
+FX_BOOL CFFL_IFormFiller::CanCut(CPDFSDK_Document* pDocument)
+{
+
+ return FALSE;
+}
+
+FX_BOOL CFFL_IFormFiller::CanPaste(CPDFSDK_Document* pDocument)
+{
+
+ return FALSE;
+}
+
+void CFFL_IFormFiller::DoCopy(CPDFSDK_Document* pDocument)
+{
+}
+
+void CFFL_IFormFiller::DoCut(CPDFSDK_Document* pDocument)
+{
+}
+
+void CFFL_IFormFiller::DoPaste(CPDFSDK_Document* pDocument)
+{
+
+}
+void CFFL_IFormFiller::OnBeforeKeyStroke(FX_BOOL bEditOrList, void* pPrivateData, FX_INT32 nKeyCode,
+ CFX_WideString & strChange, const CFX_WideString& strChangeEx,
+ int nSelStart, int nSelEnd,
+ FX_BOOL bKeyDown, FX_BOOL & bRC, FX_BOOL & bExit, FX_DWORD nFlag)
+{
+ ASSERT(pPrivateData != NULL);
+ CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData;
+ ASSERT(pData->pWidget != NULL);
+
+ CFFL_FormFiller* pFormFiller = GetFormFiller(pData->pWidget, FALSE);
+ ASSERT(pFormFiller != NULL);
+
+ if (!m_bNotifying)
+ {
+ if (pData->pWidget->GetAAction(CPDF_AAction::KeyStroke))
+ {
+ m_bNotifying = TRUE;
+ int nAge = pData->pWidget->GetAppearanceAge();
+ int nValueAge = pData->pWidget->GetValueAge();
+
+ ASSERT(pData->pPageView != NULL);
+ CPDFSDK_Document* pDocument = pData->pPageView->GetSDKDocument();
+
+ PDFSDK_FieldAction fa;
+ fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag);
+ fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag);
+ fa.sChange = strChange;
+ fa.sChangeEx = strChangeEx;
+ fa.bKeyDown = bKeyDown;
+ fa.bWillCommit = FALSE;
+ fa.bRC = TRUE;
+ fa.nSelStart = nSelStart;
+ fa.nSelEnd = nSelEnd;
+
+
+ pFormFiller->GetActionData(pData->pPageView, CPDF_AAction::KeyStroke, fa);
+ pFormFiller->SaveState(pData->pPageView);
+
+ if (pData->pWidget->OnAAction(CPDF_AAction::KeyStroke, fa, pData->pPageView))
+ {
+ if (!IsValidAnnot(pData->pPageView, pData->pWidget))
+ {
+ bExit = TRUE;
+ m_bNotifying = FALSE;
+ return;
+ }
+
+ if (nAge != pData->pWidget->GetAppearanceAge())
+ {
+ CPWL_Wnd* pWnd = pFormFiller->ResetPDFWindow(pData->pPageView, nValueAge == pData->pWidget->GetValueAge());
+ pData = (CFFL_PrivateData*)pWnd->GetAttachedData();
+ bExit = TRUE;
+ }
+
+ if (fa.bRC)
+ {
+ pFormFiller->SetActionData(pData->pPageView, CPDF_AAction::KeyStroke, fa);
+ bRC = FALSE;
+ }
+ else
+ {
+ pFormFiller->RestoreState(pData->pPageView);
+ bRC = FALSE;
+ }
+
+ if (pDocument->GetFocusAnnot() != pData->pWidget)
+ {
+ pFormFiller->CommitData(pData->pPageView,nFlag);
+ bExit = TRUE;
+ }
+ }
+ else
+ {
+ if (!IsValidAnnot(pData->pPageView, pData->pWidget))
+ {
+ bExit = TRUE;
+ m_bNotifying = FALSE;
+ return;
+ }
+ }
+
+ m_bNotifying = FALSE;
+ }
+ }
+}
+
+void CFFL_IFormFiller::OnAfterKeyStroke(FX_BOOL bEditOrList, void* pPrivateData, FX_BOOL & bExit,FX_DWORD nFlag)
+{
+ ASSERT(pPrivateData != NULL);
+ CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData;
+ ASSERT(pData->pWidget != NULL);
+
+ CFFL_FormFiller* pFormFiller = GetFormFiller(pData->pWidget, FALSE);
+ ASSERT(pFormFiller != NULL);
+
+ if (!bEditOrList)
+ pFormFiller->OnKeyStroke(bExit);
+}
diff --git a/fpdfsdk/src/formfiller/FFL_ListBox.cpp b/fpdfsdk/src/formfiller/FFL_ListBox.cpp
index 9ddb6a00d9..87ae552a66 100644
--- a/fpdfsdk/src/formfiller/FFL_ListBox.cpp
+++ b/fpdfsdk/src/formfiller/FFL_ListBox.cpp
@@ -1,319 +1,319 @@
-// 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
-
-#include "../../include/formfiller/FormFiller.h"
-#include "../../include/formfiller/FFL_FormFiller.h"
-#include "../../include/formfiller/FFL_ListBox.h"
-//#include "../../include/formfiller/FFL_Module.h"
-#include "../../include/formfiller/FFL_IFormFiller.h"
-//#include "../../include/formfiller/FFL_Undo.h"
-#include "../../include/formfiller/FFL_CBA_Fontmap.h"
-
-
-#define FFL_DEFAULTLISTBOXFONTSIZE 12.0f
-
-
-/* ------------------------------- CFFL_ListBox ------------------------------- */
-
-CFFL_ListBox::CFFL_ListBox(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pWidget) :
- CFFL_FormFiller(pApp, pWidget),
- m_pFontMap(NULL)
-{
-}
-
-CFFL_ListBox::~CFFL_ListBox()
-{
- if (m_pFontMap)
- {
- delete m_pFontMap;
- m_pFontMap = NULL;
- }
-}
-
-PWL_CREATEPARAM CFFL_ListBox::GetCreateParam()
-{
- PWL_CREATEPARAM cp = CFFL_FormFiller::GetCreateParam();
-
- ASSERT(m_pWidget != NULL);
- FX_DWORD dwFieldFlag = m_pWidget->GetFieldFlags();
-
- if (dwFieldFlag & FIELDFLAG_MULTISELECT)
- {
- cp.dwFlags |= PLBS_MULTIPLESEL;
- }
-
- if (dwFieldFlag & FIELDFLAG_COMMITONSELCHANGE)
- {
- //cp.dwFlags |= PLBS_COMMITSELECTEDVALUE;
- }
-
- cp.dwFlags |= PWS_VSCROLL;
-
- if (cp.dwFlags & PWS_AUTOFONTSIZE)
- cp.fFontSize = FFL_DEFAULTLISTBOXFONTSIZE;
-
- if (!m_pFontMap)
- {
- ASSERT(this->m_pApp != NULL);
- m_pFontMap = new CBA_FontMap(m_pWidget,m_pApp->GetSysHandler());//, ISystemHandle::GetSystemHandler(m_pApp));
- m_pFontMap->Initial();
- }
- cp.pFontMap = m_pFontMap;
-
- return cp;
-}
-
-CPWL_Wnd* CFFL_ListBox::NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageView* pPageView)
-{
- CPWL_ListBox* pWnd = new CPWL_ListBox();
- pWnd->AttachFFLData(this);
- pWnd->Create(cp);
-
- ASSERT(m_pApp != NULL);
- CFFL_IFormFiller* pIFormFiller = m_pApp->GetIFormFiller();
- pWnd->SetFillerNotify(pIFormFiller);
-
- ASSERT(m_pWidget != NULL);
-
- for (FX_INT32 i=0,sz=m_pWidget->CountOptions(); i<sz; i++)
- pWnd->AddString(m_pWidget->GetOptionLabel(i));
-
- if (pWnd->HasFlag(PLBS_MULTIPLESEL))
- {
- m_OriginSelections.RemoveAll();
-
- FX_BOOL bSetCaret = FALSE;
- for (FX_INT32 i=0,sz=m_pWidget->CountOptions(); i<sz; i++)
- {
- if (m_pWidget->IsOptionSelected(i))
- {
- if (!bSetCaret)
- {
- pWnd->SetCaret(i);
- bSetCaret = TRUE;
- }
- pWnd->Select(i);
- m_OriginSelections.SetAt(i, NULL);
- }
- }
- }
- else
- {
- for (int i=0,sz=m_pWidget->CountOptions(); i<sz; i++)
- {
- if (m_pWidget->IsOptionSelected(i))
- {
- pWnd->Select(i);
- break;
- }
- }
- }
-
- pWnd->SetTopVisibleIndex(m_pWidget->GetTopVisibleIndex());
-
- return pWnd;
-}
-
-
-FX_BOOL CFFL_ListBox::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags)
-{
- return CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags);
-}
-
-FX_BOOL CFFL_ListBox::IsDataChanged(CPDFSDK_PageView* pPageView)
-{
- ASSERT(m_pWidget != NULL);
-
- if (CPWL_ListBox* pListBox = (CPWL_ListBox*)GetPDFWindow(pPageView, FALSE))
- {
- if (m_pWidget->GetFieldFlags() & FIELDFLAG_MULTISELECT)
- {
- int nSelCount = 0;
- for (FX_INT32 i=0,sz=pListBox->GetCount(); i<sz; i++)
- {
- if (pListBox->IsItemSelected(i))
- {
- void* p = NULL;
- if (!m_OriginSelections.Lookup(i, p))
- return TRUE;
-
- nSelCount++;
- }
- }
-
- return nSelCount != m_OriginSelections.GetCount();
- }
- else
- {
- return pListBox->GetCurSel() != m_pWidget->GetSelectedIndex(0);
- }
- }
-
- return FALSE;
-}
-
-void CFFL_ListBox::SaveData(CPDFSDK_PageView* pPageView)
-{
- ASSERT(m_pWidget != NULL);
-
- if (CPWL_ListBox* pListBox = (CPWL_ListBox*)GetPDFWindow(pPageView, FALSE))
- {
- CFX_IntArray aOldSelect, aNewSelect;
-
- {
- for (int i=0,sz=m_pWidget->CountOptions(); i<sz; i++)
- {
- if (m_pWidget->IsOptionSelected(i))
- {
- aOldSelect.Add(i);
- }
- }
- }
-
-
- FX_INT32 nNewTopIndex = pListBox->GetTopVisibleIndex();
-
- m_pWidget->ClearSelection(FALSE);
-
- if (m_pWidget->GetFieldFlags() & FIELDFLAG_MULTISELECT)
- {
- for (FX_INT32 i=0,sz=pListBox->GetCount(); i<sz; i++)
- {
- if (pListBox->IsItemSelected(i))
- {
- m_pWidget->SetOptionSelection(i, TRUE, FALSE);
- aNewSelect.Add(i);
- }
- }
- }
- else
- {
- m_pWidget->SetOptionSelection(pListBox->GetCurSel(), TRUE, FALSE);
- aNewSelect.Add(pListBox->GetCurSel());
- }
-
- m_pWidget->SetTopVisibleIndex(nNewTopIndex);
- m_pWidget->ResetFieldAppearance(TRUE);
- m_pWidget->UpdateField();
- SetChangeMark();
- }
-}
-
-void CFFL_ListBox::GetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type,
- PDFSDK_FieldAction& fa)
-{
- switch (type)
- {
- case CPDF_AAction::Validate:
- if (m_pWidget->GetFieldFlags() & FIELDFLAG_MULTISELECT)
- {
- fa.sValue = L"";
- }
- else
- {
- if (CPWL_ListBox* pListBox = (CPWL_ListBox*)GetPDFWindow(pPageView, FALSE))
- {
- ASSERT(m_pWidget != NULL);
- FX_INT32 nCurSel = pListBox->GetCurSel();
- if (nCurSel >= 0)
- fa.sValue = m_pWidget->GetOptionLabel(nCurSel);
- }
- }
- break;
- case CPDF_AAction::LoseFocus:
- case CPDF_AAction::GetFocus:
- if (m_pWidget->GetFieldFlags() & FIELDFLAG_MULTISELECT)
- {
- fa.sValue = L"";
- }
- else
- {
- ASSERT(m_pWidget != NULL);
- FX_INT32 nCurSel = m_pWidget->GetSelectedIndex(0);
- if (nCurSel >= 0)
- fa.sValue = m_pWidget->GetOptionLabel(nCurSel);
- }
- break;
- default:
- break;
- }
-}
-
-
-void CFFL_ListBox::SetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type,
- const PDFSDK_FieldAction& fa)
-{
-}
-
-void CFFL_ListBox::SaveState(CPDFSDK_PageView* pPageView)
-{
- ASSERT(pPageView != NULL);
-
- if (CPWL_ListBox* pListBox = (CPWL_ListBox*)GetPDFWindow(pPageView, FALSE))
- {
- for (FX_INT32 i=0,sz=pListBox->GetCount(); i<sz; i++)
- {
- if (pListBox->IsItemSelected(i))
- {
- m_State.Add(i);
- }
- }
- }
-}
-
-void CFFL_ListBox::RestoreState(CPDFSDK_PageView* pPageView)
-{
- if (CPWL_ListBox* pListBox = (CPWL_ListBox*)GetPDFWindow(pPageView, FALSE))
- {
- for (int i=0,sz=m_State.GetSize(); i<sz; i++)
- pListBox->Select(m_State[i]);
- }
-}
-
-CPWL_Wnd* CFFL_ListBox::ResetPDFWindow(CPDFSDK_PageView* pPageView, FX_BOOL bRestoreValue)
-{
- if (bRestoreValue)
- SaveState(pPageView);
-
- DestroyPDFWindow(pPageView);
-
- CPWL_Wnd* pRet = NULL;
-
- if (bRestoreValue)
- {
- RestoreState(pPageView);
- pRet = this->GetPDFWindow(pPageView, FALSE);
- }
- else
- pRet = this->GetPDFWindow(pPageView, TRUE);
-
- m_pWidget->UpdateField();
-
- return pRet;
-}
-
-void CFFL_ListBox::OnKeyStroke(FX_BOOL bKeyDown, FX_DWORD nFlag)
-{
- ASSERT(m_pWidget != NULL);
-
- int nFlags = m_pWidget->GetFieldFlags();
-
- if (nFlags & FIELDFLAG_COMMITONSELCHANGE)
- {
- if (m_bValid)
- {
- CPDFSDK_PageView* pPageView = this->GetCurPageView();
- ASSERT(pPageView != NULL);
-
- if (CommitData(pPageView, nFlag))
- {
- DestroyPDFWindow(pPageView);
- m_bValid = FALSE;
- }
- }
- }
-}
-
+// 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
+
+#include "../../include/formfiller/FormFiller.h"
+#include "../../include/formfiller/FFL_FormFiller.h"
+#include "../../include/formfiller/FFL_ListBox.h"
+//#include "../../include/formfiller/FFL_Module.h"
+#include "../../include/formfiller/FFL_IFormFiller.h"
+//#include "../../include/formfiller/FFL_Undo.h"
+#include "../../include/formfiller/FFL_CBA_Fontmap.h"
+
+
+#define FFL_DEFAULTLISTBOXFONTSIZE 12.0f
+
+
+/* ------------------------------- CFFL_ListBox ------------------------------- */
+
+CFFL_ListBox::CFFL_ListBox(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pWidget) :
+ CFFL_FormFiller(pApp, pWidget),
+ m_pFontMap(NULL)
+{
+}
+
+CFFL_ListBox::~CFFL_ListBox()
+{
+ if (m_pFontMap)
+ {
+ delete m_pFontMap;
+ m_pFontMap = NULL;
+ }
+}
+
+PWL_CREATEPARAM CFFL_ListBox::GetCreateParam()
+{
+ PWL_CREATEPARAM cp = CFFL_FormFiller::GetCreateParam();
+
+ ASSERT(m_pWidget != NULL);
+ FX_DWORD dwFieldFlag = m_pWidget->GetFieldFlags();
+
+ if (dwFieldFlag & FIELDFLAG_MULTISELECT)
+ {
+ cp.dwFlags |= PLBS_MULTIPLESEL;
+ }
+
+ if (dwFieldFlag & FIELDFLAG_COMMITONSELCHANGE)
+ {
+ //cp.dwFlags |= PLBS_COMMITSELECTEDVALUE;
+ }
+
+ cp.dwFlags |= PWS_VSCROLL;
+
+ if (cp.dwFlags & PWS_AUTOFONTSIZE)
+ cp.fFontSize = FFL_DEFAULTLISTBOXFONTSIZE;
+
+ if (!m_pFontMap)
+ {
+ ASSERT(this->m_pApp != NULL);
+ m_pFontMap = new CBA_FontMap(m_pWidget,m_pApp->GetSysHandler());//, ISystemHandle::GetSystemHandler(m_pApp));
+ m_pFontMap->Initial();
+ }
+ cp.pFontMap = m_pFontMap;
+
+ return cp;
+}
+
+CPWL_Wnd* CFFL_ListBox::NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageView* pPageView)
+{
+ CPWL_ListBox* pWnd = new CPWL_ListBox();
+ pWnd->AttachFFLData(this);
+ pWnd->Create(cp);
+
+ ASSERT(m_pApp != NULL);
+ CFFL_IFormFiller* pIFormFiller = m_pApp->GetIFormFiller();
+ pWnd->SetFillerNotify(pIFormFiller);
+
+ ASSERT(m_pWidget != NULL);
+
+ for (FX_INT32 i=0,sz=m_pWidget->CountOptions(); i<sz; i++)
+ pWnd->AddString(m_pWidget->GetOptionLabel(i));
+
+ if (pWnd->HasFlag(PLBS_MULTIPLESEL))
+ {
+ m_OriginSelections.RemoveAll();
+
+ FX_BOOL bSetCaret = FALSE;
+ for (FX_INT32 i=0,sz=m_pWidget->CountOptions(); i<sz; i++)
+ {
+ if (m_pWidget->IsOptionSelected(i))
+ {
+ if (!bSetCaret)
+ {
+ pWnd->SetCaret(i);
+ bSetCaret = TRUE;
+ }
+ pWnd->Select(i);
+ m_OriginSelections.SetAt(i, NULL);
+ }
+ }
+ }
+ else
+ {
+ for (int i=0,sz=m_pWidget->CountOptions(); i<sz; i++)
+ {
+ if (m_pWidget->IsOptionSelected(i))
+ {
+ pWnd->Select(i);
+ break;
+ }
+ }
+ }
+
+ pWnd->SetTopVisibleIndex(m_pWidget->GetTopVisibleIndex());
+
+ return pWnd;
+}
+
+
+FX_BOOL CFFL_ListBox::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags)
+{
+ return CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags);
+}
+
+FX_BOOL CFFL_ListBox::IsDataChanged(CPDFSDK_PageView* pPageView)
+{
+ ASSERT(m_pWidget != NULL);
+
+ if (CPWL_ListBox* pListBox = (CPWL_ListBox*)GetPDFWindow(pPageView, FALSE))
+ {
+ if (m_pWidget->GetFieldFlags() & FIELDFLAG_MULTISELECT)
+ {
+ int nSelCount = 0;
+ for (FX_INT32 i=0,sz=pListBox->GetCount(); i<sz; i++)
+ {
+ if (pListBox->IsItemSelected(i))
+ {
+ void* p = NULL;
+ if (!m_OriginSelections.Lookup(i, p))
+ return TRUE;
+
+ nSelCount++;
+ }
+ }
+
+ return nSelCount != m_OriginSelections.GetCount();
+ }
+ else
+ {
+ return pListBox->GetCurSel() != m_pWidget->GetSelectedIndex(0);
+ }
+ }
+
+ return FALSE;
+}
+
+void CFFL_ListBox::SaveData(CPDFSDK_PageView* pPageView)
+{
+ ASSERT(m_pWidget != NULL);
+
+ if (CPWL_ListBox* pListBox = (CPWL_ListBox*)GetPDFWindow(pPageView, FALSE))
+ {
+ CFX_IntArray aOldSelect, aNewSelect;
+
+ {
+ for (int i=0,sz=m_pWidget->CountOptions(); i<sz; i++)
+ {
+ if (m_pWidget->IsOptionSelected(i))
+ {
+ aOldSelect.Add(i);
+ }
+ }
+ }
+
+
+ FX_INT32 nNewTopIndex = pListBox->GetTopVisibleIndex();
+
+ m_pWidget->ClearSelection(FALSE);
+
+ if (m_pWidget->GetFieldFlags() & FIELDFLAG_MULTISELECT)
+ {
+ for (FX_INT32 i=0,sz=pListBox->GetCount(); i<sz; i++)
+ {
+ if (pListBox->IsItemSelected(i))
+ {
+ m_pWidget->SetOptionSelection(i, TRUE, FALSE);
+ aNewSelect.Add(i);
+ }
+ }
+ }
+ else
+ {
+ m_pWidget->SetOptionSelection(pListBox->GetCurSel(), TRUE, FALSE);
+ aNewSelect.Add(pListBox->GetCurSel());
+ }
+
+ m_pWidget->SetTopVisibleIndex(nNewTopIndex);
+ m_pWidget->ResetFieldAppearance(TRUE);
+ m_pWidget->UpdateField();
+ SetChangeMark();
+ }
+}
+
+void CFFL_ListBox::GetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type,
+ PDFSDK_FieldAction& fa)
+{
+ switch (type)
+ {
+ case CPDF_AAction::Validate:
+ if (m_pWidget->GetFieldFlags() & FIELDFLAG_MULTISELECT)
+ {
+ fa.sValue = L"";
+ }
+ else
+ {
+ if (CPWL_ListBox* pListBox = (CPWL_ListBox*)GetPDFWindow(pPageView, FALSE))
+ {
+ ASSERT(m_pWidget != NULL);
+ FX_INT32 nCurSel = pListBox->GetCurSel();
+ if (nCurSel >= 0)
+ fa.sValue = m_pWidget->GetOptionLabel(nCurSel);
+ }
+ }
+ break;
+ case CPDF_AAction::LoseFocus:
+ case CPDF_AAction::GetFocus:
+ if (m_pWidget->GetFieldFlags() & FIELDFLAG_MULTISELECT)
+ {
+ fa.sValue = L"";
+ }
+ else
+ {
+ ASSERT(m_pWidget != NULL);
+ FX_INT32 nCurSel = m_pWidget->GetSelectedIndex(0);
+ if (nCurSel >= 0)
+ fa.sValue = m_pWidget->GetOptionLabel(nCurSel);
+ }
+ break;
+ default:
+ break;
+ }
+}
+
+
+void CFFL_ListBox::SetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type,
+ const PDFSDK_FieldAction& fa)
+{
+}
+
+void CFFL_ListBox::SaveState(CPDFSDK_PageView* pPageView)
+{
+ ASSERT(pPageView != NULL);
+
+ if (CPWL_ListBox* pListBox = (CPWL_ListBox*)GetPDFWindow(pPageView, FALSE))
+ {
+ for (FX_INT32 i=0,sz=pListBox->GetCount(); i<sz; i++)
+ {
+ if (pListBox->IsItemSelected(i))
+ {
+ m_State.Add(i);
+ }
+ }
+ }
+}
+
+void CFFL_ListBox::RestoreState(CPDFSDK_PageView* pPageView)
+{
+ if (CPWL_ListBox* pListBox = (CPWL_ListBox*)GetPDFWindow(pPageView, FALSE))
+ {
+ for (int i=0,sz=m_State.GetSize(); i<sz; i++)
+ pListBox->Select(m_State[i]);
+ }
+}
+
+CPWL_Wnd* CFFL_ListBox::ResetPDFWindow(CPDFSDK_PageView* pPageView, FX_BOOL bRestoreValue)
+{
+ if (bRestoreValue)
+ SaveState(pPageView);
+
+ DestroyPDFWindow(pPageView);
+
+ CPWL_Wnd* pRet = NULL;
+
+ if (bRestoreValue)
+ {
+ RestoreState(pPageView);
+ pRet = this->GetPDFWindow(pPageView, FALSE);
+ }
+ else
+ pRet = this->GetPDFWindow(pPageView, TRUE);
+
+ m_pWidget->UpdateField();
+
+ return pRet;
+}
+
+void CFFL_ListBox::OnKeyStroke(FX_BOOL bKeyDown, FX_DWORD nFlag)
+{
+ ASSERT(m_pWidget != NULL);
+
+ int nFlags = m_pWidget->GetFieldFlags();
+
+ if (nFlags & FIELDFLAG_COMMITONSELCHANGE)
+ {
+ if (m_bValid)
+ {
+ CPDFSDK_PageView* pPageView = this->GetCurPageView();
+ ASSERT(pPageView != NULL);
+
+ if (CommitData(pPageView, nFlag))
+ {
+ DestroyPDFWindow(pPageView);
+ m_bValid = FALSE;
+ }
+ }
+ }
+}
+
diff --git a/fpdfsdk/src/formfiller/FFL_Notify.cpp b/fpdfsdk/src/formfiller/FFL_Notify.cpp
index f18ed51875..f6a2feb4a1 100644
--- a/fpdfsdk/src/formfiller/FFL_Notify.cpp
+++ b/fpdfsdk/src/formfiller/FFL_Notify.cpp
@@ -1,172 +1,172 @@
-// 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
-
-// #include "../../include/formfiller/FormFiller.h"
-#include "../../include/formfiller/FFL_FormFiller.h"
-#include "../../include/formfiller/FFL_Notify.h"
-// #include "../../include/formfiller/FFL_ComboBox.h"
-// #include "../../include/formfiller/FFL_Module.h"
-
-/* -------------------------------- CFFL_Notify ------------------------------ */
-
-//#pragma warning(disable: 4800)
-
-CFFL_Notify::CFFL_Notify(CFFL_FormFiller * pFormFiller) :
- m_pFormFiller(pFormFiller),
- m_bDoActioning(FALSE),
- m_nNotifyFlag(0)
-{
- ASSERT(m_pFormFiller != NULL);
-}
-
-CFFL_Notify::~CFFL_Notify()
-{
-}
-
-void CFFL_Notify::BeforeNotify()
-{
- m_nNotifyFlag ++;
-}
-
-
-void CFFL_Notify::AfterNotify()
-{
- m_nNotifyFlag --;
-}
-
-FX_BOOL CFFL_Notify::OnMouseUp(FX_BOOL & bExit)
-{
- BeforeNotify();
- FX_BOOL bRet = FALSE;//DoAAction(CPDF_AAction::AActionType::ButtonUp, bExit);
- AfterNotify();
- return bRet;
-}
-
-FX_BOOL CFFL_Notify::OnMouseDown(FX_BOOL & bExit)
-{
- BeforeNotify();
- FX_BOOL bRet = FALSE;//DoAAction(CPDF_AAction::AActionType::ButtonDown, bExit);
- AfterNotify();
- return bRet;
-}
-
-FX_BOOL CFFL_Notify::OnMouseEnter(FX_BOOL & bExit)
-{
- BeforeNotify();
- FX_BOOL bRet = FALSE;//DoAAction(CPDF_AAction::AActionType::CursorEnter, bExit);
- AfterNotify();
- return bRet;
-}
-
-FX_BOOL CFFL_Notify::OnMouseExit(FX_BOOL & bExit)
-{
- BeforeNotify();
- FX_BOOL bRet = FALSE;//DoAAction(CPDF_AAction::AActionType::CursorExit, bExit);
- AfterNotify();
- return bRet;
-}
-
-FX_BOOL CFFL_Notify::OnSetFocus(FX_BOOL & bExit)
-{
- BeforeNotify();
- FX_BOOL bRet = FALSE;//DoAAction(CPDF_AAction::AActionType::GetFocus, bExit);
- AfterNotify();
- return bRet;
-}
-
-FX_BOOL CFFL_Notify::OnKillFocus(FX_BOOL & bExit)
-{
- BeforeNotify();
- FX_BOOL bRet = FALSE;//DoAAction(CPDF_AAction::AActionType::LoseFocus, bExit);
- AfterNotify();
- return bRet;
-}
-
-FX_BOOL CFFL_Notify::OnCalculate()
-{
- return TRUE;
-}
-
-FX_BOOL CFFL_Notify::OnFormat(int iCommitKey)
-{
- return TRUE;
-}
-
-FX_BOOL CFFL_Notify::OnKeyStroke(CPDF_FormField* pFormField, int nCommitKey, CFX_WideString& strValue, CFX_WideString& strChange,
- const CFX_WideString& strChangeEx, FX_BOOL bKeyDown, FX_BOOL bModifier,
- FX_BOOL bShift, FX_BOOL bWillCommit, FX_BOOL bFieldFull,
- int& nSelStart, int& nSelEnd, FX_BOOL& bRC)
-{
- return TRUE;
-}
-
-FX_BOOL CFFL_Notify::OnValidate(CPDF_FormField* pFormField, CFX_WideString& strValue, CFX_WideString & strChange,
- const CFX_WideString& strChangeEx, FX_BOOL bKeyDown, FX_BOOL bModifier,
- FX_BOOL bShift, FX_BOOL & bRC)
-{
- return TRUE;
-}
-
-FX_BOOL CFFL_Notify::DoAAction(CPDF_AAction::AActionType eAAT, FX_BOOL & bExit)
-{
- if (this->m_bDoActioning) return FALSE;
-
- CPDF_Action action;
- if (!FindAAction(eAAT,action)) return FALSE;
-
- this->m_bDoActioning = TRUE;
- ExecuteActionTree(eAAT,action,bExit);
- this->m_bDoActioning = FALSE;
- return TRUE;
-}
-
-FX_BOOL CFFL_Notify::ExecuteActionTree(CPDF_AAction::AActionType eAAT,CPDF_Action & action, FX_BOOL& bExit)
-{
- if (!ExecuteAction(eAAT,action,bExit)) return FALSE;
- if (bExit) return TRUE;
-
- for (FX_INT32 i=0,sz=action.GetSubActionsCount(); i<sz; i++)
- {
- CPDF_Action subaction = action.GetSubAction(i);
- if (!ExecuteActionTree(eAAT,subaction,bExit)) return FALSE;
- if (bExit) break;
- }
-
- return TRUE;
-}
-
-
-FX_BOOL CFFL_Notify::FindAAction(CPDF_AAction::AActionType eAAT,CPDF_Action & action)
-{
- return FALSE;
-}
-
-FX_BOOL CFFL_Notify::FindAAction(CPDF_AAction aaction,CPDF_AAction::AActionType eAAT,CPDF_Action & action)
-{
- CPDF_Action MyAction;
-
- if (aaction.ActionExist(eAAT))
- {
- MyAction = aaction.GetAction(eAAT);
- }
- else
- return FALSE;
-
-
- if (MyAction.GetType() == CPDF_Action::Unknown)
- return FALSE;
-
- action = MyAction;
-
- return TRUE;
-}
-
-FX_BOOL CFFL_Notify::ExecuteAction(CPDF_AAction::AActionType eAAT,CPDF_Action & action,FX_BOOL& bExit)
-{
- return FALSE;
-}
-//#pragma warning(default: 4800)
-
+// 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
+
+// #include "../../include/formfiller/FormFiller.h"
+#include "../../include/formfiller/FFL_FormFiller.h"
+#include "../../include/formfiller/FFL_Notify.h"
+// #include "../../include/formfiller/FFL_ComboBox.h"
+// #include "../../include/formfiller/FFL_Module.h"
+
+/* -------------------------------- CFFL_Notify ------------------------------ */
+
+//#pragma warning(disable: 4800)
+
+CFFL_Notify::CFFL_Notify(CFFL_FormFiller * pFormFiller) :
+ m_pFormFiller(pFormFiller),
+ m_bDoActioning(FALSE),
+ m_nNotifyFlag(0)
+{
+ ASSERT(m_pFormFiller != NULL);
+}
+
+CFFL_Notify::~CFFL_Notify()
+{
+}
+
+void CFFL_Notify::BeforeNotify()
+{
+ m_nNotifyFlag ++;
+}
+
+
+void CFFL_Notify::AfterNotify()
+{
+ m_nNotifyFlag --;
+}
+
+FX_BOOL CFFL_Notify::OnMouseUp(FX_BOOL & bExit)
+{
+ BeforeNotify();
+ FX_BOOL bRet = FALSE;//DoAAction(CPDF_AAction::AActionType::ButtonUp, bExit);
+ AfterNotify();
+ return bRet;
+}
+
+FX_BOOL CFFL_Notify::OnMouseDown(FX_BOOL & bExit)
+{
+ BeforeNotify();
+ FX_BOOL bRet = FALSE;//DoAAction(CPDF_AAction::AActionType::ButtonDown, bExit);
+ AfterNotify();
+ return bRet;
+}
+
+FX_BOOL CFFL_Notify::OnMouseEnter(FX_BOOL & bExit)
+{
+ BeforeNotify();
+ FX_BOOL bRet = FALSE;//DoAAction(CPDF_AAction::AActionType::CursorEnter, bExit);
+ AfterNotify();
+ return bRet;
+}
+
+FX_BOOL CFFL_Notify::OnMouseExit(FX_BOOL & bExit)
+{
+ BeforeNotify();
+ FX_BOOL bRet = FALSE;//DoAAction(CPDF_AAction::AActionType::CursorExit, bExit);
+ AfterNotify();
+ return bRet;
+}
+
+FX_BOOL CFFL_Notify::OnSetFocus(FX_BOOL & bExit)
+{
+ BeforeNotify();
+ FX_BOOL bRet = FALSE;//DoAAction(CPDF_AAction::AActionType::GetFocus, bExit);
+ AfterNotify();
+ return bRet;
+}
+
+FX_BOOL CFFL_Notify::OnKillFocus(FX_BOOL & bExit)
+{
+ BeforeNotify();
+ FX_BOOL bRet = FALSE;//DoAAction(CPDF_AAction::AActionType::LoseFocus, bExit);
+ AfterNotify();
+ return bRet;
+}
+
+FX_BOOL CFFL_Notify::OnCalculate()
+{
+ return TRUE;
+}
+
+FX_BOOL CFFL_Notify::OnFormat(int iCommitKey)
+{
+ return TRUE;
+}
+
+FX_BOOL CFFL_Notify::OnKeyStroke(CPDF_FormField* pFormField, int nCommitKey, CFX_WideString& strValue, CFX_WideString& strChange,
+ const CFX_WideString& strChangeEx, FX_BOOL bKeyDown, FX_BOOL bModifier,
+ FX_BOOL bShift, FX_BOOL bWillCommit, FX_BOOL bFieldFull,
+ int& nSelStart, int& nSelEnd, FX_BOOL& bRC)
+{
+ return TRUE;
+}
+
+FX_BOOL CFFL_Notify::OnValidate(CPDF_FormField* pFormField, CFX_WideString& strValue, CFX_WideString & strChange,
+ const CFX_WideString& strChangeEx, FX_BOOL bKeyDown, FX_BOOL bModifier,
+ FX_BOOL bShift, FX_BOOL & bRC)
+{
+ return TRUE;
+}
+
+FX_BOOL CFFL_Notify::DoAAction(CPDF_AAction::AActionType eAAT, FX_BOOL & bExit)
+{
+ if (this->m_bDoActioning) return FALSE;
+
+ CPDF_Action action;
+ if (!FindAAction(eAAT,action)) return FALSE;
+
+ this->m_bDoActioning = TRUE;
+ ExecuteActionTree(eAAT,action,bExit);
+ this->m_bDoActioning = FALSE;
+ return TRUE;
+}
+
+FX_BOOL CFFL_Notify::ExecuteActionTree(CPDF_AAction::AActionType eAAT,CPDF_Action & action, FX_BOOL& bExit)
+{
+ if (!ExecuteAction(eAAT,action,bExit)) return FALSE;
+ if (bExit) return TRUE;
+
+ for (FX_INT32 i=0,sz=action.GetSubActionsCount(); i<sz; i++)
+ {
+ CPDF_Action subaction = action.GetSubAction(i);
+ if (!ExecuteActionTree(eAAT,subaction,bExit)) return FALSE;
+ if (bExit) break;
+ }
+
+ return TRUE;
+}
+
+
+FX_BOOL CFFL_Notify::FindAAction(CPDF_AAction::AActionType eAAT,CPDF_Action & action)
+{
+ return FALSE;
+}
+
+FX_BOOL CFFL_Notify::FindAAction(CPDF_AAction aaction,CPDF_AAction::AActionType eAAT,CPDF_Action & action)
+{
+ CPDF_Action MyAction;
+
+ if (aaction.ActionExist(eAAT))
+ {
+ MyAction = aaction.GetAction(eAAT);
+ }
+ else
+ return FALSE;
+
+
+ if (MyAction.GetType() == CPDF_Action::Unknown)
+ return FALSE;
+
+ action = MyAction;
+
+ return TRUE;
+}
+
+FX_BOOL CFFL_Notify::ExecuteAction(CPDF_AAction::AActionType eAAT,CPDF_Action & action,FX_BOOL& bExit)
+{
+ return FALSE;
+}
+//#pragma warning(default: 4800)
+
diff --git a/fpdfsdk/src/formfiller/FFL_PushButton.cpp b/fpdfsdk/src/formfiller/FFL_PushButton.cpp
index 1afbe8b84e..b8a07fb548 100644
--- a/fpdfsdk/src/formfiller/FFL_PushButton.cpp
+++ b/fpdfsdk/src/formfiller/FFL_PushButton.cpp
@@ -1,43 +1,43 @@
-// 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
-
-#include "../../include/formfiller/FormFiller.h"
-#include "../../include/formfiller/FFL_FormFiller.h"
-#include "../../include/formfiller/FFL_PushButton.h"
-
-/* ------------------------------- CFFL_PushButton ------------------------------- */
-
-CFFL_PushButton::CFFL_PushButton(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pAnnot):
- CFFL_Button( pApp, pAnnot)
-{
-}
-
-CFFL_PushButton::~CFFL_PushButton()
-{
-}
-
-CPWL_Wnd* CFFL_PushButton::NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageView* pPageView)
-{
- CPWL_PushButton* pWnd = new CPWL_PushButton();
- pWnd->Create(cp);
-
- return pWnd;
-}
-
-
-FX_BOOL CFFL_PushButton::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags)
-{
- return CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags);
-}
-
-void CFFL_PushButton::OnDraw(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot,
- CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
- FX_DWORD dwFlags)
-{
- CFFL_Button::OnDraw(pPageView, pAnnot, pDevice, pUser2Device, dwFlags);
-}
-
-
+// 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
+
+#include "../../include/formfiller/FormFiller.h"
+#include "../../include/formfiller/FFL_FormFiller.h"
+#include "../../include/formfiller/FFL_PushButton.h"
+
+/* ------------------------------- CFFL_PushButton ------------------------------- */
+
+CFFL_PushButton::CFFL_PushButton(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pAnnot):
+ CFFL_Button( pApp, pAnnot)
+{
+}
+
+CFFL_PushButton::~CFFL_PushButton()
+{
+}
+
+CPWL_Wnd* CFFL_PushButton::NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageView* pPageView)
+{
+ CPWL_PushButton* pWnd = new CPWL_PushButton();
+ pWnd->Create(cp);
+
+ return pWnd;
+}
+
+
+FX_BOOL CFFL_PushButton::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags)
+{
+ return CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags);
+}
+
+void CFFL_PushButton::OnDraw(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot,
+ CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
+ FX_DWORD dwFlags)
+{
+ CFFL_Button::OnDraw(pPageView, pAnnot, pDevice, pUser2Device, dwFlags);
+}
+
+
diff --git a/fpdfsdk/src/formfiller/FFL_RadioButton.cpp b/fpdfsdk/src/formfiller/FFL_RadioButton.cpp
index 462c05ede2..aacb7d81e9 100644
--- a/fpdfsdk/src/formfiller/FFL_RadioButton.cpp
+++ b/fpdfsdk/src/formfiller/FFL_RadioButton.cpp
@@ -1,137 +1,137 @@
-// 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
-
-#include "../../include/formfiller/FormFiller.h"
-#include "../../include/formfiller/FFL_FormFiller.h"
-#include "../../include/formfiller/FFL_RadioButton.h"
-//#include "../include/FFL_Undo.h"
-
-/* ------------------------------- CFFL_RadioButton ------------------------------- */
-
-CFFL_RadioButton::CFFL_RadioButton(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pWidget) :
- CFFL_Button(pApp, pWidget)
-{
-}
-
-CFFL_RadioButton::~CFFL_RadioButton()
-{
-}
-
-CPWL_Wnd* CFFL_RadioButton::NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageView* pPageView)
-{
- CPWL_RadioButton* pWnd = new CPWL_RadioButton();
- pWnd->Create(cp);
-
- ASSERT(m_pWidget != NULL);
- pWnd->SetCheck(m_pWidget->IsChecked());
-
- return pWnd;
-}
-
-FX_BOOL CFFL_RadioButton::OnKeyDown(CPDFSDK_Annot* pAnnot, FX_UINT nKeyCode, FX_UINT nFlags)
-{
- switch (nKeyCode)
- {
- case FWL_VKEY_Return:
- case FWL_VKEY_Space:
- return TRUE;
- default:
- return CFFL_FormFiller::OnKeyDown(pAnnot, nKeyCode, nFlags);
- }
-}
-
-FX_BOOL CFFL_RadioButton::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags)
-{
- switch (nChar)
- {
- case FWL_VKEY_Return:
- case FWL_VKEY_Space:
- {
- CFFL_IFormFiller* pIFormFiller = m_pApp->GetIFormFiller();
- ASSERT(pIFormFiller != NULL);
-
- CPDFSDK_PageView* pPageView = pAnnot->GetPageView();
- ASSERT(pPageView != NULL);
-
- FX_BOOL bReset = FALSE;
- FX_BOOL bExit = FALSE;
-
- pIFormFiller->OnButtonUp(m_pWidget, pPageView, bReset, bExit,nFlags);
-
- if (bReset) return TRUE;
- if (bExit) return TRUE;
-
- CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags);
-
- if (CPWL_RadioButton * pWnd = (CPWL_RadioButton*)GetPDFWindow(pPageView, TRUE))
- pWnd->SetCheck(TRUE);
- CommitData(pPageView,nFlags);
- return TRUE;
- }
- default:
- return CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags);
- }
-}
-
-FX_BOOL CFFL_RadioButton::OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
-{
- CFFL_Button::OnLButtonUp(pPageView, pAnnot, nFlags, point);
-
- if (IsValid())
- {
- if (CPWL_RadioButton * pWnd = (CPWL_RadioButton*)GetPDFWindow(pPageView, TRUE))
- pWnd->SetCheck(TRUE);
-
- if (!CommitData(pPageView,nFlags)) return FALSE;
- }
-
- return TRUE;
-}
-
-FX_BOOL CFFL_RadioButton::IsDataChanged(CPDFSDK_PageView* pPageView)
-{
- ASSERT(m_pWidget != NULL);
-
- if (CPWL_RadioButton* pWnd = (CPWL_RadioButton*)GetPDFWindow(pPageView, FALSE))
- {
- return pWnd->IsChecked() != m_pWidget->IsChecked();
- }
-
- return FALSE;
-}
-
-void CFFL_RadioButton::SaveData(CPDFSDK_PageView* pPageView)
-{
- ASSERT(m_pWidget != NULL);
-
- if (CPWL_RadioButton* pWnd = (CPWL_RadioButton*)GetPDFWindow(pPageView, FALSE))
- {
-
- FX_BOOL bNewChecked = pWnd->IsChecked();
-
- if (bNewChecked)
- {
- CPDF_FormField* pField = m_pWidget->GetFormField();
- ASSERT(pField != NULL);
-
- for (FX_INT32 i=0,sz=pField->CountControls(); i<sz; i++)
- {
- if (CPDF_FormControl* pCtrl = pField->GetControl(i))
- {
- if (pCtrl->IsChecked())
- {
- break;
- }
- }
- }
- }
-
- m_pWidget->SetCheck(bNewChecked, FALSE);
- m_pWidget->UpdateField();
- SetChangeMark();
- }
-}
-
+// 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
+
+#include "../../include/formfiller/FormFiller.h"
+#include "../../include/formfiller/FFL_FormFiller.h"
+#include "../../include/formfiller/FFL_RadioButton.h"
+//#include "../include/FFL_Undo.h"
+
+/* ------------------------------- CFFL_RadioButton ------------------------------- */
+
+CFFL_RadioButton::CFFL_RadioButton(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pWidget) :
+ CFFL_Button(pApp, pWidget)
+{
+}
+
+CFFL_RadioButton::~CFFL_RadioButton()
+{
+}
+
+CPWL_Wnd* CFFL_RadioButton::NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageView* pPageView)
+{
+ CPWL_RadioButton* pWnd = new CPWL_RadioButton();
+ pWnd->Create(cp);
+
+ ASSERT(m_pWidget != NULL);
+ pWnd->SetCheck(m_pWidget->IsChecked());
+
+ return pWnd;
+}
+
+FX_BOOL CFFL_RadioButton::OnKeyDown(CPDFSDK_Annot* pAnnot, FX_UINT nKeyCode, FX_UINT nFlags)
+{
+ switch (nKeyCode)
+ {
+ case FWL_VKEY_Return:
+ case FWL_VKEY_Space:
+ return TRUE;
+ default:
+ return CFFL_FormFiller::OnKeyDown(pAnnot, nKeyCode, nFlags);
+ }
+}
+
+FX_BOOL CFFL_RadioButton::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags)
+{
+ switch (nChar)
+ {
+ case FWL_VKEY_Return:
+ case FWL_VKEY_Space:
+ {
+ CFFL_IFormFiller* pIFormFiller = m_pApp->GetIFormFiller();
+ ASSERT(pIFormFiller != NULL);
+
+ CPDFSDK_PageView* pPageView = pAnnot->GetPageView();
+ ASSERT(pPageView != NULL);
+
+ FX_BOOL bReset = FALSE;
+ FX_BOOL bExit = FALSE;
+
+ pIFormFiller->OnButtonUp(m_pWidget, pPageView, bReset, bExit,nFlags);
+
+ if (bReset) return TRUE;
+ if (bExit) return TRUE;
+
+ CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags);
+
+ if (CPWL_RadioButton * pWnd = (CPWL_RadioButton*)GetPDFWindow(pPageView, TRUE))
+ pWnd->SetCheck(TRUE);
+ CommitData(pPageView,nFlags);
+ return TRUE;
+ }
+ default:
+ return CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags);
+ }
+}
+
+FX_BOOL CFFL_RadioButton::OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
+{
+ CFFL_Button::OnLButtonUp(pPageView, pAnnot, nFlags, point);
+
+ if (IsValid())
+ {
+ if (CPWL_RadioButton * pWnd = (CPWL_RadioButton*)GetPDFWindow(pPageView, TRUE))
+ pWnd->SetCheck(TRUE);
+
+ if (!CommitData(pPageView,nFlags)) return FALSE;
+ }
+
+ return TRUE;
+}
+
+FX_BOOL CFFL_RadioButton::IsDataChanged(CPDFSDK_PageView* pPageView)
+{
+ ASSERT(m_pWidget != NULL);
+
+ if (CPWL_RadioButton* pWnd = (CPWL_RadioButton*)GetPDFWindow(pPageView, FALSE))
+ {
+ return pWnd->IsChecked() != m_pWidget->IsChecked();
+ }
+
+ return FALSE;
+}
+
+void CFFL_RadioButton::SaveData(CPDFSDK_PageView* pPageView)
+{
+ ASSERT(m_pWidget != NULL);
+
+ if (CPWL_RadioButton* pWnd = (CPWL_RadioButton*)GetPDFWindow(pPageView, FALSE))
+ {
+
+ FX_BOOL bNewChecked = pWnd->IsChecked();
+
+ if (bNewChecked)
+ {
+ CPDF_FormField* pField = m_pWidget->GetFormField();
+ ASSERT(pField != NULL);
+
+ for (FX_INT32 i=0,sz=pField->CountControls(); i<sz; i++)
+ {
+ if (CPDF_FormControl* pCtrl = pField->GetControl(i))
+ {
+ if (pCtrl->IsChecked())
+ {
+ break;
+ }
+ }
+ }
+ }
+
+ m_pWidget->SetCheck(bNewChecked, FALSE);
+ m_pWidget->UpdateField();
+ SetChangeMark();
+ }
+}
+
diff --git a/fpdfsdk/src/formfiller/FFL_TextField.cpp b/fpdfsdk/src/formfiller/FFL_TextField.cpp
index 7644d4bc60..8cd62fa025 100644
--- a/fpdfsdk/src/formfiller/FFL_TextField.cpp
+++ b/fpdfsdk/src/formfiller/FFL_TextField.cpp
@@ -1,412 +1,412 @@
-// 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
-
-//#include "../include/FormFiller.h"
-//#include "../include/FFL_FormFiller.h"
-#include "../../include/formfiller/FFL_TextField.h"
-#include "../../include/formfiller/FFL_CBA_Fontmap.h"
-//#include "../include/FFL_Notify.h"
-
-CFFL_EditUndoItem::CFFL_EditUndoItem(CPWL_Edit* pEdit) : m_pEdit(pEdit)
-{
-}
-
-CFFL_EditUndoItem::~CFFL_EditUndoItem()
-{
-}
-
-void CFFL_EditUndoItem::Undo()
-{
-}
-
-void CFFL_EditUndoItem::Redo()
-{
-}
-
-CFX_WideString CFFL_EditUndoItem::GetDescr()
-{
- return L"Input";
-}
-
-void CFFL_EditUndoItem::Release()
-{
- delete this;
-}
-
-/* ------------------------------- CFFL_TextField ------------------------------- */
-
-CFFL_TextField::CFFL_TextField(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pAnnot) :
- CFFL_FormFiller(pApp, pAnnot),
- m_pFontMap(NULL)//,
- //m_pSpellCheck(NULL)
-{
- m_State.nStart = m_State.nEnd = 0;
-}
-
-CFFL_TextField::~CFFL_TextField()
-{
- if (m_pFontMap)
- {
- delete m_pFontMap;
- m_pFontMap = NULL;
- }
-
-}
-
-PWL_CREATEPARAM CFFL_TextField::GetCreateParam()
-{
- PWL_CREATEPARAM cp = CFFL_FormFiller::GetCreateParam();
-
- ASSERT(m_pWidget != NULL);
- int nFlags = m_pWidget->GetFieldFlags();
-
-
- if (nFlags & FIELDFLAG_PASSWORD)
- {
- cp.dwFlags |= PES_PASSWORD;
- }
-
- if (!(nFlags & FIELDFLAG_DONOTSPELLCHECK))
- {
- }
-
- if (nFlags & FIELDFLAG_MULTILINE)
- {
- cp.dwFlags |= PES_MULTILINE | PES_AUTORETURN | PES_TOP;
-
- if (!(nFlags & FIELDFLAG_DONOTSCROLL))
- {
- cp.dwFlags |= PWS_VSCROLL | PES_AUTOSCROLL;
- }
- }
- else
- {
- cp.dwFlags |= PES_CENTER;
-
- if (!(nFlags & FIELDFLAG_DONOTSCROLL))
- {
- cp.dwFlags |= PES_AUTOSCROLL;
- }
- }
-
- if (nFlags & FIELDFLAG_COMB)
- {
- cp.dwFlags |= PES_CHARARRAY;
- }
-
- if (nFlags & FIELDFLAG_RICHTEXT)
- {
- cp.dwFlags |= PES_RICH;
- }
-
- cp.dwFlags |= PES_UNDO;
-
- switch (m_pWidget->GetAlignment())
- {
- default:
- case BF_ALIGN_LEFT:
- cp.dwFlags |= PES_LEFT;
- break;
- case BF_ALIGN_MIDDLE:
- cp.dwFlags |= PES_MIDDLE;
- break;
- case BF_ALIGN_RIGHT:
- cp.dwFlags |= PES_RIGHT;
- break;
- }
-
- if (!m_pFontMap)
- {
- ASSERT(this->m_pApp != NULL);
- m_pFontMap = new CBA_FontMap(m_pWidget, /*ISystemHandle::GetSystemHandler(m_pApp)*/m_pApp->GetSysHandler());
- m_pFontMap->Initial();
- }
- cp.pFontMap = m_pFontMap;
- cp.pFocusHandler = this;
-
- return cp;
-}
-
-CPWL_Wnd* CFFL_TextField::NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageView* pPageView)
-{
- CPWL_Edit * pWnd = new CPWL_Edit();
- pWnd->AttachFFLData(this);
- pWnd->Create(cp);
-
-
-
- ASSERT(m_pApp != NULL);
- CFFL_IFormFiller* pIFormFiller = m_pApp->GetIFormFiller();
- pWnd->SetFillerNotify(pIFormFiller);
-
- ASSERT(m_pWidget != NULL);
- FX_INT32 nMaxLen = m_pWidget->GetMaxLen();
- CFX_WideString swValue = m_pWidget->GetValue();
-
- if (nMaxLen > 0)
- {
- if (pWnd->HasFlag(PES_CHARARRAY))
- {
- pWnd->SetCharArray(nMaxLen);
- pWnd->SetAlignFormatV(PEAV_CENTER);
- }
- else
- {
- pWnd->SetLimitChar(nMaxLen);
- }
- }
-
- pWnd->SetText(swValue);
-
- return pWnd;
-}
-
-
-FX_BOOL CFFL_TextField::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags)
-{
- switch (nChar)
- {
- case FWL_VKEY_Return:
- if (!(m_pWidget->GetFieldFlags() & FIELDFLAG_MULTILINE))
- {
- CPDFSDK_PageView* pPageView = this->GetCurPageView();
- ASSERT(pPageView != NULL);
- m_bValid = !m_bValid;
- CPDF_Rect rcAnnot = pAnnot->GetRect();
- m_pApp->FFI_Invalidate(pAnnot->GetPDFPage(), rcAnnot.left, rcAnnot.top, rcAnnot.right, rcAnnot.bottom);
-
- if (m_bValid)
- {
- if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, TRUE))
- pWnd->SetFocus();
- }
- else
- {
- if (CommitData(pPageView, nFlags))
- {
- DestroyPDFWindow(pPageView);
- return TRUE;
- }
- else
- {
- return FALSE;
- }
- }
- }
- break;
- case FWL_VKEY_Escape:
- {
- CPDFSDK_PageView* pPageView = this->GetCurPageView();
- ASSERT(pPageView != NULL);
- EscapeFiller(pPageView,TRUE);
- return TRUE;
- }
- }
-
- return CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags);
-}
-
-FX_BOOL CFFL_TextField::IsDataChanged(CPDFSDK_PageView* pPageView)
-{
- ASSERT(m_pWidget != NULL);
-
- if (CPWL_Edit * pEdit = (CPWL_Edit*)GetPDFWindow(pPageView, FALSE))
- return pEdit->GetText() != m_pWidget->GetValue();
-
- return FALSE;
-}
-
-void CFFL_TextField::SaveData(CPDFSDK_PageView* pPageView)
-{
- ASSERT(m_pWidget != NULL);
-
- if (CPWL_Edit* pWnd = (CPWL_Edit*)GetPDFWindow(pPageView, FALSE))
- {
- CFX_WideString sOldValue = m_pWidget->GetValue();
- CFX_WideString sNewValue = pWnd->GetText();
-
- m_pWidget->SetValue(sNewValue, FALSE);
- m_pWidget->ResetFieldAppearance(TRUE);
- m_pWidget->UpdateField();
- SetChangeMark();
- }
-}
-
-void CFFL_TextField::GetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type,
- PDFSDK_FieldAction& fa)
-{
- switch (type)
- {
- case CPDF_AAction::KeyStroke:
- if (CPWL_Edit* pWnd = (CPWL_Edit*)GetPDFWindow(pPageView, FALSE))
- {
- fa.bFieldFull = pWnd->IsTextFull();
-
- fa.sValue = pWnd->GetText();
-
- if (fa.bFieldFull)
- {
- fa.sChange = L"";
- fa.sChangeEx = L"";
- }
- }
- break;
- case CPDF_AAction::Validate:
- if (CPWL_Edit* pWnd = (CPWL_Edit*)GetPDFWindow(pPageView, FALSE))
- {
- fa.sValue = pWnd->GetText();
- }
- break;
- case CPDF_AAction::LoseFocus:
- case CPDF_AAction::GetFocus:
- ASSERT(m_pWidget != NULL);
- fa.sValue = m_pWidget->GetValue();
- break;
- default:
- break;
- }
-}
-
-void CFFL_TextField::SetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type,
- const PDFSDK_FieldAction& fa)
-{
- switch (type)
- {
- case CPDF_AAction::KeyStroke:
- if (CPWL_Edit * pEdit = (CPWL_Edit*)GetPDFWindow(pPageView, FALSE))
- {
- pEdit->SetFocus();
- pEdit->SetSel(fa.nSelStart, fa.nSelEnd);
- pEdit->ReplaceSel(fa.sChange);
- }
- break;
- default:
- break;
- }
-}
-
-
-FX_BOOL CFFL_TextField::IsActionDataChanged(CPDF_AAction::AActionType type, const PDFSDK_FieldAction& faOld,
- const PDFSDK_FieldAction& faNew)
-{
- switch (type)
- {
- case CPDF_AAction::KeyStroke:
- return (!faOld.bFieldFull && faOld.nSelEnd != faNew.nSelEnd) || faOld.nSelStart != faNew.nSelStart ||
- faOld.sChange != faNew.sChange;
- default:
- break;
- }
-
- return FALSE;
-}
-
-void CFFL_TextField::SaveState(CPDFSDK_PageView* pPageView)
-{
- ASSERT(pPageView != NULL);
-
- if (CPWL_Edit* pWnd = (CPWL_Edit*)GetPDFWindow(pPageView, FALSE))
- {
- pWnd->GetSel(m_State.nStart, m_State.nEnd);
- m_State.sValue = pWnd->GetText();
- }
-}
-
-void CFFL_TextField::RestoreState(CPDFSDK_PageView* pPageView)
-{
- ASSERT(pPageView != NULL);
-
- if (CPWL_Edit* pWnd = (CPWL_Edit*)GetPDFWindow(pPageView, TRUE))
- {
- pWnd->SetText(m_State.sValue);
- pWnd->SetSel(m_State.nStart, m_State.nEnd);
- }
-}
-
-CPWL_Wnd* CFFL_TextField::ResetPDFWindow(CPDFSDK_PageView* pPageView, FX_BOOL bRestoreValue)
-{
- if (bRestoreValue)
- SaveState(pPageView);
-
- DestroyPDFWindow(pPageView);
-
- CPWL_Wnd* pRet = NULL;
-
- if (bRestoreValue)
- {
- RestoreState(pPageView);
- pRet = this->GetPDFWindow(pPageView, FALSE);
- }
- else
- pRet = this->GetPDFWindow(pPageView, TRUE);
-
- m_pWidget->UpdateField();
-
- return pRet;
-}
-
-void CFFL_TextField::OnSetFocus(CPWL_Wnd* pWnd)
-{
- ASSERT(m_pApp != NULL);
-
- ASSERT(pWnd != NULL);
-
- if (pWnd->GetClassName() == PWL_CLASSNAME_EDIT)
- {
- CPWL_Edit* pEdit = (CPWL_Edit*)pWnd;
- pEdit->SetCharSet(134);
- pEdit->SetCodePage(936);
-
- pEdit->SetReadyToInput();
- CFX_WideString wsText = pEdit->GetText();
- int nCharacters = wsText.GetLength();
- CFX_ByteString bsUTFText = wsText.UTF16LE_Encode();
- unsigned short* pBuffer = (unsigned short*)(FX_LPCSTR)bsUTFText;
- m_pApp->FFI_OnSetFieldInputFocus(m_pWidget->GetFormField(), pBuffer, nCharacters, TRUE);
-
- pEdit->SetEditNotify(this);
- //pUndo->BeginEdit(pDocument);
- }
-}
-
-void CFFL_TextField::OnKillFocus(CPWL_Wnd* pWnd)
-{
-
-}
-
-FX_BOOL CFFL_TextField::CanCopy(CPDFSDK_Document* pDocument)
-{
- return FALSE;
-}
-
-FX_BOOL CFFL_TextField::CanCut(CPDFSDK_Document* pDocument)
-{
- return FALSE;
-}
-
-FX_BOOL CFFL_TextField::CanPaste(CPDFSDK_Document* pDocument)
-{
- return FALSE;
-}
-
-void CFFL_TextField::DoCopy(CPDFSDK_Document* pDocument)
-{
-
-}
-
-void CFFL_TextField::DoCut(CPDFSDK_Document* pDocument)
-{
-}
-
-void CFFL_TextField::DoPaste(CPDFSDK_Document* pDocument)
-{
-
-}
-
-void CFFL_TextField::OnAddUndo(CPWL_Edit* pEdit)
-{
-}
-
+// 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
+
+//#include "../include/FormFiller.h"
+//#include "../include/FFL_FormFiller.h"
+#include "../../include/formfiller/FFL_TextField.h"
+#include "../../include/formfiller/FFL_CBA_Fontmap.h"
+//#include "../include/FFL_Notify.h"
+
+CFFL_EditUndoItem::CFFL_EditUndoItem(CPWL_Edit* pEdit) : m_pEdit(pEdit)
+{
+}
+
+CFFL_EditUndoItem::~CFFL_EditUndoItem()
+{
+}
+
+void CFFL_EditUndoItem::Undo()
+{
+}
+
+void CFFL_EditUndoItem::Redo()
+{
+}
+
+CFX_WideString CFFL_EditUndoItem::GetDescr()
+{
+ return L"Input";
+}
+
+void CFFL_EditUndoItem::Release()
+{
+ delete this;
+}
+
+/* ------------------------------- CFFL_TextField ------------------------------- */
+
+CFFL_TextField::CFFL_TextField(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pAnnot) :
+ CFFL_FormFiller(pApp, pAnnot),
+ m_pFontMap(NULL)//,
+ //m_pSpellCheck(NULL)
+{
+ m_State.nStart = m_State.nEnd = 0;
+}
+
+CFFL_TextField::~CFFL_TextField()
+{
+ if (m_pFontMap)
+ {
+ delete m_pFontMap;
+ m_pFontMap = NULL;
+ }
+
+}
+
+PWL_CREATEPARAM CFFL_TextField::GetCreateParam()
+{
+ PWL_CREATEPARAM cp = CFFL_FormFiller::GetCreateParam();
+
+ ASSERT(m_pWidget != NULL);
+ int nFlags = m_pWidget->GetFieldFlags();
+
+
+ if (nFlags & FIELDFLAG_PASSWORD)
+ {
+ cp.dwFlags |= PES_PASSWORD;
+ }
+
+ if (!(nFlags & FIELDFLAG_DONOTSPELLCHECK))
+ {
+ }
+
+ if (nFlags & FIELDFLAG_MULTILINE)
+ {
+ cp.dwFlags |= PES_MULTILINE | PES_AUTORETURN | PES_TOP;
+
+ if (!(nFlags & FIELDFLAG_DONOTSCROLL))
+ {
+ cp.dwFlags |= PWS_VSCROLL | PES_AUTOSCROLL;
+ }
+ }
+ else
+ {
+ cp.dwFlags |= PES_CENTER;
+
+ if (!(nFlags & FIELDFLAG_DONOTSCROLL))
+ {
+ cp.dwFlags |= PES_AUTOSCROLL;
+ }
+ }
+
+ if (nFlags & FIELDFLAG_COMB)
+ {
+ cp.dwFlags |= PES_CHARARRAY;
+ }
+
+ if (nFlags & FIELDFLAG_RICHTEXT)
+ {
+ cp.dwFlags |= PES_RICH;
+ }
+
+ cp.dwFlags |= PES_UNDO;
+
+ switch (m_pWidget->GetAlignment())
+ {
+ default:
+ case BF_ALIGN_LEFT:
+ cp.dwFlags |= PES_LEFT;
+ break;
+ case BF_ALIGN_MIDDLE:
+ cp.dwFlags |= PES_MIDDLE;
+ break;
+ case BF_ALIGN_RIGHT:
+ cp.dwFlags |= PES_RIGHT;
+ break;
+ }
+
+ if (!m_pFontMap)
+ {
+ ASSERT(this->m_pApp != NULL);
+ m_pFontMap = new CBA_FontMap(m_pWidget, /*ISystemHandle::GetSystemHandler(m_pApp)*/m_pApp->GetSysHandler());
+ m_pFontMap->Initial();
+ }
+ cp.pFontMap = m_pFontMap;
+ cp.pFocusHandler = this;
+
+ return cp;
+}
+
+CPWL_Wnd* CFFL_TextField::NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageView* pPageView)
+{
+ CPWL_Edit * pWnd = new CPWL_Edit();
+ pWnd->AttachFFLData(this);
+ pWnd->Create(cp);
+
+
+
+ ASSERT(m_pApp != NULL);
+ CFFL_IFormFiller* pIFormFiller = m_pApp->GetIFormFiller();
+ pWnd->SetFillerNotify(pIFormFiller);
+
+ ASSERT(m_pWidget != NULL);
+ FX_INT32 nMaxLen = m_pWidget->GetMaxLen();
+ CFX_WideString swValue = m_pWidget->GetValue();
+
+ if (nMaxLen > 0)
+ {
+ if (pWnd->HasFlag(PES_CHARARRAY))
+ {
+ pWnd->SetCharArray(nMaxLen);
+ pWnd->SetAlignFormatV(PEAV_CENTER);
+ }
+ else
+ {
+ pWnd->SetLimitChar(nMaxLen);
+ }
+ }
+
+ pWnd->SetText(swValue);
+
+ return pWnd;
+}
+
+
+FX_BOOL CFFL_TextField::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags)
+{
+ switch (nChar)
+ {
+ case FWL_VKEY_Return:
+ if (!(m_pWidget->GetFieldFlags() & FIELDFLAG_MULTILINE))
+ {
+ CPDFSDK_PageView* pPageView = this->GetCurPageView();
+ ASSERT(pPageView != NULL);
+ m_bValid = !m_bValid;
+ CPDF_Rect rcAnnot = pAnnot->GetRect();
+ m_pApp->FFI_Invalidate(pAnnot->GetPDFPage(), rcAnnot.left, rcAnnot.top, rcAnnot.right, rcAnnot.bottom);
+
+ if (m_bValid)
+ {
+ if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, TRUE))
+ pWnd->SetFocus();
+ }
+ else
+ {
+ if (CommitData(pPageView, nFlags))
+ {
+ DestroyPDFWindow(pPageView);
+ return TRUE;
+ }
+ else
+ {
+ return FALSE;
+ }
+ }
+ }
+ break;
+ case FWL_VKEY_Escape:
+ {
+ CPDFSDK_PageView* pPageView = this->GetCurPageView();
+ ASSERT(pPageView != NULL);
+ EscapeFiller(pPageView,TRUE);
+ return TRUE;
+ }
+ }
+
+ return CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags);
+}
+
+FX_BOOL CFFL_TextField::IsDataChanged(CPDFSDK_PageView* pPageView)
+{
+ ASSERT(m_pWidget != NULL);
+
+ if (CPWL_Edit * pEdit = (CPWL_Edit*)GetPDFWindow(pPageView, FALSE))
+ return pEdit->GetText() != m_pWidget->GetValue();
+
+ return FALSE;
+}
+
+void CFFL_TextField::SaveData(CPDFSDK_PageView* pPageView)
+{
+ ASSERT(m_pWidget != NULL);
+
+ if (CPWL_Edit* pWnd = (CPWL_Edit*)GetPDFWindow(pPageView, FALSE))
+ {
+ CFX_WideString sOldValue = m_pWidget->GetValue();
+ CFX_WideString sNewValue = pWnd->GetText();
+
+ m_pWidget->SetValue(sNewValue, FALSE);
+ m_pWidget->ResetFieldAppearance(TRUE);
+ m_pWidget->UpdateField();
+ SetChangeMark();
+ }
+}
+
+void CFFL_TextField::GetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type,
+ PDFSDK_FieldAction& fa)
+{
+ switch (type)
+ {
+ case CPDF_AAction::KeyStroke:
+ if (CPWL_Edit* pWnd = (CPWL_Edit*)GetPDFWindow(pPageView, FALSE))
+ {
+ fa.bFieldFull = pWnd->IsTextFull();
+
+ fa.sValue = pWnd->GetText();
+
+ if (fa.bFieldFull)
+ {
+ fa.sChange = L"";
+ fa.sChangeEx = L"";
+ }
+ }
+ break;
+ case CPDF_AAction::Validate:
+ if (CPWL_Edit* pWnd = (CPWL_Edit*)GetPDFWindow(pPageView, FALSE))
+ {
+ fa.sValue = pWnd->GetText();
+ }
+ break;
+ case CPDF_AAction::LoseFocus:
+ case CPDF_AAction::GetFocus:
+ ASSERT(m_pWidget != NULL);
+ fa.sValue = m_pWidget->GetValue();
+ break;
+ default:
+ break;
+ }
+}
+
+void CFFL_TextField::SetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type,
+ const PDFSDK_FieldAction& fa)
+{
+ switch (type)
+ {
+ case CPDF_AAction::KeyStroke:
+ if (CPWL_Edit * pEdit = (CPWL_Edit*)GetPDFWindow(pPageView, FALSE))
+ {
+ pEdit->SetFocus();
+ pEdit->SetSel(fa.nSelStart, fa.nSelEnd);
+ pEdit->ReplaceSel(fa.sChange);
+ }
+ break;
+ default:
+ break;
+ }
+}
+
+
+FX_BOOL CFFL_TextField::IsActionDataChanged(CPDF_AAction::AActionType type, const PDFSDK_FieldAction& faOld,
+ const PDFSDK_FieldAction& faNew)
+{
+ switch (type)
+ {
+ case CPDF_AAction::KeyStroke:
+ return (!faOld.bFieldFull && faOld.nSelEnd != faNew.nSelEnd) || faOld.nSelStart != faNew.nSelStart ||
+ faOld.sChange != faNew.sChange;
+ default:
+ break;
+ }
+
+ return FALSE;
+}
+
+void CFFL_TextField::SaveState(CPDFSDK_PageView* pPageView)
+{
+ ASSERT(pPageView != NULL);
+
+ if (CPWL_Edit* pWnd = (CPWL_Edit*)GetPDFWindow(pPageView, FALSE))
+ {
+ pWnd->GetSel(m_State.nStart, m_State.nEnd);
+ m_State.sValue = pWnd->GetText();
+ }
+}
+
+void CFFL_TextField::RestoreState(CPDFSDK_PageView* pPageView)
+{
+ ASSERT(pPageView != NULL);
+
+ if (CPWL_Edit* pWnd = (CPWL_Edit*)GetPDFWindow(pPageView, TRUE))
+ {
+ pWnd->SetText(m_State.sValue);
+ pWnd->SetSel(m_State.nStart, m_State.nEnd);
+ }
+}
+
+CPWL_Wnd* CFFL_TextField::ResetPDFWindow(CPDFSDK_PageView* pPageView, FX_BOOL bRestoreValue)
+{
+ if (bRestoreValue)
+ SaveState(pPageView);
+
+ DestroyPDFWindow(pPageView);
+
+ CPWL_Wnd* pRet = NULL;
+
+ if (bRestoreValue)
+ {
+ RestoreState(pPageView);
+ pRet = this->GetPDFWindow(pPageView, FALSE);
+ }
+ else
+ pRet = this->GetPDFWindow(pPageView, TRUE);
+
+ m_pWidget->UpdateField();
+
+ return pRet;
+}
+
+void CFFL_TextField::OnSetFocus(CPWL_Wnd* pWnd)
+{
+ ASSERT(m_pApp != NULL);
+
+ ASSERT(pWnd != NULL);
+
+ if (pWnd->GetClassName() == PWL_CLASSNAME_EDIT)
+ {
+ CPWL_Edit* pEdit = (CPWL_Edit*)pWnd;
+ pEdit->SetCharSet(134);
+ pEdit->SetCodePage(936);
+
+ pEdit->SetReadyToInput();
+ CFX_WideString wsText = pEdit->GetText();
+ int nCharacters = wsText.GetLength();
+ CFX_ByteString bsUTFText = wsText.UTF16LE_Encode();
+ unsigned short* pBuffer = (unsigned short*)(FX_LPCSTR)bsUTFText;
+ m_pApp->FFI_OnSetFieldInputFocus(m_pWidget->GetFormField(), pBuffer, nCharacters, TRUE);
+
+ pEdit->SetEditNotify(this);
+ //pUndo->BeginEdit(pDocument);
+ }
+}
+
+void CFFL_TextField::OnKillFocus(CPWL_Wnd* pWnd)
+{
+
+}
+
+FX_BOOL CFFL_TextField::CanCopy(CPDFSDK_Document* pDocument)
+{
+ return FALSE;
+}
+
+FX_BOOL CFFL_TextField::CanCut(CPDFSDK_Document* pDocument)
+{
+ return FALSE;
+}
+
+FX_BOOL CFFL_TextField::CanPaste(CPDFSDK_Document* pDocument)
+{
+ return FALSE;
+}
+
+void CFFL_TextField::DoCopy(CPDFSDK_Document* pDocument)
+{
+
+}
+
+void CFFL_TextField::DoCut(CPDFSDK_Document* pDocument)
+{
+}
+
+void CFFL_TextField::DoPaste(CPDFSDK_Document* pDocument)
+{
+
+}
+
+void CFFL_TextField::OnAddUndo(CPWL_Edit* pEdit)
+{
+}
+
diff --git a/fpdfsdk/src/formfiller/FFL_Utils.cpp b/fpdfsdk/src/formfiller/FFL_Utils.cpp
index 2e908108b8..3ea78918be 100644
--- a/fpdfsdk/src/formfiller/FFL_Utils.cpp
+++ b/fpdfsdk/src/formfiller/FFL_Utils.cpp
@@ -1,133 +1,133 @@
-// 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
-
-#include "../../include/formfiller/FormFiller.h"
-#include "../../include/formfiller/FFL_Utils.h"
-
-CPDF_Rect CFFL_Utils::MaxRect(const CPDF_Rect & rect1,const CPDF_Rect & rect2)
-{
- CPDF_Rect rcRet;
-
- rcRet.left = FFL_MIN(rect1.left,rect2.left);
- rcRet.bottom = FFL_MIN(rect1.bottom,rect2.bottom);
- rcRet.right = FFL_MAX(rect1.right,rect2.right);
- rcRet.top = FFL_MAX(rect1.top,rect2.top);
-
- return rcRet;
-}
-
-CPDF_Rect CFFL_Utils::InflateRect(const CPDF_Rect & crRect,const FX_FLOAT & fSize)
-{
- CPDF_Rect crNew(crRect.left - fSize,
- crRect.bottom - fSize,
- crRect.right + fSize,
- crRect.top + fSize);
- crNew.Normalize();
- return crNew;
-}
-
-CPDF_Rect CFFL_Utils::DeflateRect(const CPDF_Rect & crRect,const FX_FLOAT & fSize)
-{
- CPDF_Rect crNew(crRect.left + fSize,
- crRect.bottom + fSize,
- crRect.right - fSize,
- crRect.top - fSize);
- crNew.Normalize();
- return crNew;
-}
-
-/*
-FX_BOOL CFFL_Utils::RectContainsRect(const CPDF_Rect & father,const CPDF_Rect & son)
-{
- return (father.left <= son.left && father.right >= son.right &&
- father.bottom <= son.bottom && father.top >= son.top);
-
-}
-
-FX_BOOL CFFL_Utils::RectContainsPoint(const CPDF_Rect & father,const CPDF_Point & son)
-{
- return (father.left <= son.x && father.right >= son.x &&
- father.bottom <= son.y && father.top >= son.y);
-}
-
-FX_BOOL CFFL_Utils::RectContainsXY(const CPDF_Rect & father,FX_FLOAT x,FX_FLOAT y)
-{
- return (father.left <= x && father.right >= x &&
- father.bottom <= y && father.top >= y);
-}
-*/
-
-FX_BOOL CFFL_Utils::TraceObject(CPDF_Object* pObj)
-{
- if (!pObj) return FALSE;
-
- FX_DWORD dwObjNum = pObj->GetObjNum();
- switch (pObj->GetType())
- {
- case PDFOBJ_ARRAY:
- {
- CPDF_Array* pArray = (CPDF_Array*)pObj;
- for (FX_DWORD i = 0; i < pArray->GetCount(); i ++)
- {
- CPDF_Object* pElement = pArray->GetElementValue(i);
- TraceObject(pElement);
- }
- }
- break;
-
- case PDFOBJ_DICTIONARY:
- {
- CPDF_Dictionary* pDict = (CPDF_Dictionary*)pObj;
-
- FX_POSITION fPos = pDict->GetStartPos();
- CFX_ByteString csKey;
- do
- {
- CPDF_Object* pElement = pDict->GetNextElement(fPos, csKey);
- //TRACE(csKey + "\n");
- if (!pElement) break;
- TraceObject(pElement);
- }while (TRUE);
- }
- break;
-
- case PDFOBJ_STREAM:
- {
- CPDF_Stream* pStream = (CPDF_Stream*)pObj;
- CPDF_Dictionary* pDict = pStream->GetDict();
- TraceObject(pDict);
- }
- break;
-
- case PDFOBJ_REFERENCE:
- {
- CPDF_Object* pDirectObj = pObj->GetDirect();
- TraceObject(pDirectObj);
- }
- break;
-
- case PDFOBJ_BOOLEAN:
- break;
- case PDFOBJ_NUMBER:
- //TRACE("%d\n",(FX_INT32)pObj);
- break;
- case PDFOBJ_STRING:
- //TRACE(((CPDF_String*)pObj)->GetString() + "\n");
- break;
- case PDFOBJ_NAME:
- //TRACE(((CPDF_Name*)pObj)->GetString() + "\n");
- break;
- case PDFOBJ_NULL:
-// case PDFOBJ_KEYWORD:
-// case PDFOBJ_EOF:
- default:
- break;
- }
- if (dwObjNum == 0) return FALSE;
-
- return TRUE;
-}
-
+// 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
+
+#include "../../include/formfiller/FormFiller.h"
+#include "../../include/formfiller/FFL_Utils.h"
+
+CPDF_Rect CFFL_Utils::MaxRect(const CPDF_Rect & rect1,const CPDF_Rect & rect2)
+{
+ CPDF_Rect rcRet;
+
+ rcRet.left = FFL_MIN(rect1.left,rect2.left);
+ rcRet.bottom = FFL_MIN(rect1.bottom,rect2.bottom);
+ rcRet.right = FFL_MAX(rect1.right,rect2.right);
+ rcRet.top = FFL_MAX(rect1.top,rect2.top);
+
+ return rcRet;
+}
+
+CPDF_Rect CFFL_Utils::InflateRect(const CPDF_Rect & crRect,const FX_FLOAT & fSize)
+{
+ CPDF_Rect crNew(crRect.left - fSize,
+ crRect.bottom - fSize,
+ crRect.right + fSize,
+ crRect.top + fSize);
+ crNew.Normalize();
+ return crNew;
+}
+
+CPDF_Rect CFFL_Utils::DeflateRect(const CPDF_Rect & crRect,const FX_FLOAT & fSize)
+{
+ CPDF_Rect crNew(crRect.left + fSize,
+ crRect.bottom + fSize,
+ crRect.right - fSize,
+ crRect.top - fSize);
+ crNew.Normalize();
+ return crNew;
+}
+
+/*
+FX_BOOL CFFL_Utils::RectContainsRect(const CPDF_Rect & father,const CPDF_Rect & son)
+{
+ return (father.left <= son.left && father.right >= son.right &&
+ father.bottom <= son.bottom && father.top >= son.top);
+
+}
+
+FX_BOOL CFFL_Utils::RectContainsPoint(const CPDF_Rect & father,const CPDF_Point & son)
+{
+ return (father.left <= son.x && father.right >= son.x &&
+ father.bottom <= son.y && father.top >= son.y);
+}
+
+FX_BOOL CFFL_Utils::RectContainsXY(const CPDF_Rect & father,FX_FLOAT x,FX_FLOAT y)
+{
+ return (father.left <= x && father.right >= x &&
+ father.bottom <= y && father.top >= y);
+}
+*/
+
+FX_BOOL CFFL_Utils::TraceObject(CPDF_Object* pObj)
+{
+ if (!pObj) return FALSE;
+
+ FX_DWORD dwObjNum = pObj->GetObjNum();
+ switch (pObj->GetType())
+ {
+ case PDFOBJ_ARRAY:
+ {
+ CPDF_Array* pArray = (CPDF_Array*)pObj;
+ for (FX_DWORD i = 0; i < pArray->GetCount(); i ++)
+ {
+ CPDF_Object* pElement = pArray->GetElementValue(i);
+ TraceObject(pElement);
+ }
+ }
+ break;
+
+ case PDFOBJ_DICTIONARY:
+ {
+ CPDF_Dictionary* pDict = (CPDF_Dictionary*)pObj;
+
+ FX_POSITION fPos = pDict->GetStartPos();
+ CFX_ByteString csKey;
+ do
+ {
+ CPDF_Object* pElement = pDict->GetNextElement(fPos, csKey);
+ //TRACE(csKey + "\n");
+ if (!pElement) break;
+ TraceObject(pElement);
+ }while (TRUE);
+ }
+ break;
+
+ case PDFOBJ_STREAM:
+ {
+ CPDF_Stream* pStream = (CPDF_Stream*)pObj;
+ CPDF_Dictionary* pDict = pStream->GetDict();
+ TraceObject(pDict);
+ }
+ break;
+
+ case PDFOBJ_REFERENCE:
+ {
+ CPDF_Object* pDirectObj = pObj->GetDirect();
+ TraceObject(pDirectObj);
+ }
+ break;
+
+ case PDFOBJ_BOOLEAN:
+ break;
+ case PDFOBJ_NUMBER:
+ //TRACE("%d\n",(FX_INT32)pObj);
+ break;
+ case PDFOBJ_STRING:
+ //TRACE(((CPDF_String*)pObj)->GetString() + "\n");
+ break;
+ case PDFOBJ_NAME:
+ //TRACE(((CPDF_Name*)pObj)->GetString() + "\n");
+ break;
+ case PDFOBJ_NULL:
+// case PDFOBJ_KEYWORD:
+// case PDFOBJ_EOF:
+ default:
+ break;
+ }
+ if (dwObjNum == 0) return FALSE;
+
+ return TRUE;
+}
+
diff --git a/fpdfsdk/src/fpdf_dataavail.cpp b/fpdfsdk/src/fpdf_dataavail.cpp
index 9e56c2e0c8..b5483f9c39 100644
--- a/fpdfsdk/src/fpdf_dataavail.cpp
+++ b/fpdfsdk/src/fpdf_dataavail.cpp
@@ -1,165 +1,165 @@
-// 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
-
-#include "../include/fsdk_define.h"
-#include "../include/fpdf_dataavail.h"
-
-extern void ProcessParseError(FX_DWORD err_code);
-class CFPDF_FileAvailWrap : public IFX_FileAvail
-{
-public:
- CFPDF_FileAvailWrap()
- {
- m_pfileAvail = NULL;
- }
-
- void Set(FX_FILEAVAIL* pfileAvail)
- {
- m_pfileAvail = pfileAvail;
- }
-
- virtual FX_BOOL IsDataAvail( FX_FILESIZE offset, FX_DWORD size)
- {
- return m_pfileAvail->IsDataAvail(m_pfileAvail, offset, size);
- }
-
-private:
- FX_FILEAVAIL* m_pfileAvail;
-};
-
-class CFPDF_FileAccessWrap : public IFX_FileRead
-{
-public:
- CFPDF_FileAccessWrap()
- {
- m_pFileAccess = NULL;
- }
-
- void Set(FPDF_FILEACCESS* pFile)
- {
- m_pFileAccess = pFile;
- }
-
- virtual FX_FILESIZE GetSize()
- {
- return m_pFileAccess->m_FileLen;
- }
-
- virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size)
- {
- return m_pFileAccess->m_GetBlock(m_pFileAccess->m_Param, offset, (FX_LPBYTE)buffer, size);
- }
-
- virtual void Release()
- {
- }
-
-private:
- FPDF_FILEACCESS* m_pFileAccess;
-};
-
-class CFPDF_DownloadHintsWrap : public IFX_DownloadHints
-{
-public:
- CFPDF_DownloadHintsWrap(FX_DOWNLOADHINTS* pDownloadHints)
- {
- m_pDownloadHints = pDownloadHints;
- }
-public:
- virtual void AddSegment(FX_FILESIZE offset, FX_DWORD size)
- {
- m_pDownloadHints->AddSegment(m_pDownloadHints, offset, size);
- }
-private:
- FX_DOWNLOADHINTS* m_pDownloadHints;
-};
-
-class CFPDF_DataAvail : public CFX_Object
-{
-public:
- CFPDF_DataAvail()
- {
- m_pDataAvail = NULL;
- }
-
- ~CFPDF_DataAvail()
- {
- if (m_pDataAvail) delete m_pDataAvail;
- }
-
- CPDF_DataAvail* m_pDataAvail;
- CFPDF_FileAvailWrap m_FileAvail;
- CFPDF_FileAccessWrap m_FileRead;
-};
-
-DLLEXPORT FPDF_AVAIL STDCALL FPDFAvail_Create(FX_FILEAVAIL* file_avail, FPDF_FILEACCESS* file)
-{
- CFPDF_DataAvail* pAvail = FX_NEW CFPDF_DataAvail;
- pAvail->m_FileAvail.Set(file_avail);
- pAvail->m_FileRead.Set(file);
- pAvail->m_pDataAvail = FX_NEW CPDF_DataAvail(&pAvail->m_FileAvail, &pAvail->m_FileRead);
- return pAvail;
-}
-
-DLLEXPORT void STDCALL FPDFAvail_Destroy(FPDF_AVAIL avail)
-{
- if (avail == NULL) return;
- delete (CFPDF_DataAvail*)avail;
-}
-
-DLLEXPORT int STDCALL FPDFAvail_IsDocAvail(FPDF_AVAIL avail, FX_DOWNLOADHINTS* hints)
-{
- if (avail == NULL || hints == NULL) return 0;
- CFPDF_DownloadHintsWrap hints_wrap(hints);
- return ((CFPDF_DataAvail*)avail)->m_pDataAvail->IsDocAvail(&hints_wrap);
-}
-
-extern void CheckUnSupportError(CPDF_Document * pDoc, FX_DWORD err_code);
-
-DLLEXPORT FPDF_DOCUMENT STDCALL FPDFAvail_GetDocument(FPDF_AVAIL avail, FPDF_BYTESTRING password)
-{
- if (avail == NULL) return NULL;
- CPDF_Parser* pParser = FX_NEW CPDF_Parser;
- pParser->SetPassword(password);
-
- FX_DWORD err_code = pParser->StartAsynParse(((CFPDF_DataAvail*)avail)->m_pDataAvail->GetFileRead());
- if (err_code) {
- delete pParser;
- ProcessParseError(err_code);
- return NULL;
- }
- ((CFPDF_DataAvail*)avail)->m_pDataAvail->SetDocument(pParser->GetDocument());
- CheckUnSupportError(pParser->GetDocument(), FPDF_ERR_SUCCESS);
- return pParser->GetDocument();
-}
-
-DLLEXPORT int STDCALL FPDFAvail_GetFirstPageNum(FPDF_DOCUMENT doc)
-{
- if (doc == NULL) return 0;
- CPDF_Document* pDoc = (CPDF_Document*)doc;
- return ((CPDF_Parser*)pDoc->GetParser())->GetFirstPageNo();
-}
-
-DLLEXPORT int STDCALL FPDFAvail_IsPageAvail(FPDF_AVAIL avail, int page_index, FX_DOWNLOADHINTS* hints)
-{
- if (avail == NULL || hints == NULL) return 0;
- CFPDF_DownloadHintsWrap hints_wrap(hints);
- return ((CFPDF_DataAvail*)avail)->m_pDataAvail->IsPageAvail(page_index, &hints_wrap);
-}
-
-DLLEXPORT int STDCALL FPDFAvail_IsFormAvail(FPDF_AVAIL avail, FX_DOWNLOADHINTS* hints)
-{
- if (avail == NULL || hints == NULL) return -1;
- CFPDF_DownloadHintsWrap hints_wrap(hints);
- return ((CFPDF_DataAvail*)avail)->m_pDataAvail->IsFormAvail(&hints_wrap);
-}
-
-DLLEXPORT FPDF_BOOL STDCALL FPDFAvail_IsLinearized(FPDF_AVAIL avail)
-{
- if (avail == NULL) return -1;
- return ((CFPDF_DataAvail*)avail)->m_pDataAvail->IsLinearizedPDF();
-
-}
+// 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
+
+#include "../include/fsdk_define.h"
+#include "../include/fpdf_dataavail.h"
+
+extern void ProcessParseError(FX_DWORD err_code);
+class CFPDF_FileAvailWrap : public IFX_FileAvail
+{
+public:
+ CFPDF_FileAvailWrap()
+ {
+ m_pfileAvail = NULL;
+ }
+
+ void Set(FX_FILEAVAIL* pfileAvail)
+ {
+ m_pfileAvail = pfileAvail;
+ }
+
+ virtual FX_BOOL IsDataAvail( FX_FILESIZE offset, FX_DWORD size)
+ {
+ return m_pfileAvail->IsDataAvail(m_pfileAvail, offset, size);
+ }
+
+private:
+ FX_FILEAVAIL* m_pfileAvail;
+};
+
+class CFPDF_FileAccessWrap : public IFX_FileRead
+{
+public:
+ CFPDF_FileAccessWrap()
+ {
+ m_pFileAccess = NULL;
+ }
+
+ void Set(FPDF_FILEACCESS* pFile)
+ {
+ m_pFileAccess = pFile;
+ }
+
+ virtual FX_FILESIZE GetSize()
+ {
+ return m_pFileAccess->m_FileLen;
+ }
+
+ virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size)
+ {
+ return m_pFileAccess->m_GetBlock(m_pFileAccess->m_Param, offset, (FX_LPBYTE)buffer, size);
+ }
+
+ virtual void Release()
+ {
+ }
+
+private:
+ FPDF_FILEACCESS* m_pFileAccess;
+};
+
+class CFPDF_DownloadHintsWrap : public IFX_DownloadHints
+{
+public:
+ CFPDF_DownloadHintsWrap(FX_DOWNLOADHINTS* pDownloadHints)
+ {
+ m_pDownloadHints = pDownloadHints;
+ }
+public:
+ virtual void AddSegment(FX_FILESIZE offset, FX_DWORD size)
+ {
+ m_pDownloadHints->AddSegment(m_pDownloadHints, offset, size);
+ }
+private:
+ FX_DOWNLOADHINTS* m_pDownloadHints;
+};
+
+class CFPDF_DataAvail : public CFX_Object
+{
+public:
+ CFPDF_DataAvail()
+ {
+ m_pDataAvail = NULL;
+ }
+
+ ~CFPDF_DataAvail()
+ {
+ if (m_pDataAvail) delete m_pDataAvail;
+ }
+
+ CPDF_DataAvail* m_pDataAvail;
+ CFPDF_FileAvailWrap m_FileAvail;
+ CFPDF_FileAccessWrap m_FileRead;
+};
+
+DLLEXPORT FPDF_AVAIL STDCALL FPDFAvail_Create(FX_FILEAVAIL* file_avail, FPDF_FILEACCESS* file)
+{
+ CFPDF_DataAvail* pAvail = FX_NEW CFPDF_DataAvail;
+ pAvail->m_FileAvail.Set(file_avail);
+ pAvail->m_FileRead.Set(file);
+ pAvail->m_pDataAvail = FX_NEW CPDF_DataAvail(&pAvail->m_FileAvail, &pAvail->m_FileRead);
+ return pAvail;
+}
+
+DLLEXPORT void STDCALL FPDFAvail_Destroy(FPDF_AVAIL avail)
+{
+ if (avail == NULL) return;
+ delete (CFPDF_DataAvail*)avail;
+}
+
+DLLEXPORT int STDCALL FPDFAvail_IsDocAvail(FPDF_AVAIL avail, FX_DOWNLOADHINTS* hints)
+{
+ if (avail == NULL || hints == NULL) return 0;
+ CFPDF_DownloadHintsWrap hints_wrap(hints);
+ return ((CFPDF_DataAvail*)avail)->m_pDataAvail->IsDocAvail(&hints_wrap);
+}
+
+extern void CheckUnSupportError(CPDF_Document * pDoc, FX_DWORD err_code);
+
+DLLEXPORT FPDF_DOCUMENT STDCALL FPDFAvail_GetDocument(FPDF_AVAIL avail, FPDF_BYTESTRING password)
+{
+ if (avail == NULL) return NULL;
+ CPDF_Parser* pParser = FX_NEW CPDF_Parser;
+ pParser->SetPassword(password);
+
+ FX_DWORD err_code = pParser->StartAsynParse(((CFPDF_DataAvail*)avail)->m_pDataAvail->GetFileRead());
+ if (err_code) {
+ delete pParser;
+ ProcessParseError(err_code);
+ return NULL;
+ }
+ ((CFPDF_DataAvail*)avail)->m_pDataAvail->SetDocument(pParser->GetDocument());
+ CheckUnSupportError(pParser->GetDocument(), FPDF_ERR_SUCCESS);
+ return pParser->GetDocument();
+}
+
+DLLEXPORT int STDCALL FPDFAvail_GetFirstPageNum(FPDF_DOCUMENT doc)
+{
+ if (doc == NULL) return 0;
+ CPDF_Document* pDoc = (CPDF_Document*)doc;
+ return ((CPDF_Parser*)pDoc->GetParser())->GetFirstPageNo();
+}
+
+DLLEXPORT int STDCALL FPDFAvail_IsPageAvail(FPDF_AVAIL avail, int page_index, FX_DOWNLOADHINTS* hints)
+{
+ if (avail == NULL || hints == NULL) return 0;
+ CFPDF_DownloadHintsWrap hints_wrap(hints);
+ return ((CFPDF_DataAvail*)avail)->m_pDataAvail->IsPageAvail(page_index, &hints_wrap);
+}
+
+DLLEXPORT int STDCALL FPDFAvail_IsFormAvail(FPDF_AVAIL avail, FX_DOWNLOADHINTS* hints)
+{
+ if (avail == NULL || hints == NULL) return -1;
+ CFPDF_DownloadHintsWrap hints_wrap(hints);
+ return ((CFPDF_DataAvail*)avail)->m_pDataAvail->IsFormAvail(&hints_wrap);
+}
+
+DLLEXPORT FPDF_BOOL STDCALL FPDFAvail_IsLinearized(FPDF_AVAIL avail)
+{
+ if (avail == NULL) return -1;
+ return ((CFPDF_DataAvail*)avail)->m_pDataAvail->IsLinearizedPDF();
+
+}
diff --git a/fpdfsdk/src/fpdf_ext.cpp b/fpdfsdk/src/fpdf_ext.cpp
index e2e2d84995..2d9e5ae74c 100644
--- a/fpdfsdk/src/fpdf_ext.cpp
+++ b/fpdfsdk/src/fpdf_ext.cpp
@@ -1,245 +1,245 @@
-// 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
-
-#include "../include/fsdk_define.h"
-#include "../include/fpdf_ext.h"
-
-#define FPDFSDK_UNSUPPORT_CALL 100
-
-class CFSDK_UnsupportInfo_Adapter
-{
-public:
- CFSDK_UnsupportInfo_Adapter(UNSUPPORT_INFO* unsp_info){ m_unsp_info = unsp_info;}
-// FX_BOOL NeedToPauseNow();
- void ReportError(int nErrorType);
-
-private:
- UNSUPPORT_INFO* m_unsp_info;
-};
-
-void CFSDK_UnsupportInfo_Adapter::ReportError(int nErrorType)
-{
- if(m_unsp_info && m_unsp_info->FSDK_UnSupport_Handler)
- {
- m_unsp_info->FSDK_UnSupport_Handler(m_unsp_info,nErrorType);
- }
-}
-
-void FreeUnsupportInfo(FX_LPVOID pData)
-{
- CFSDK_UnsupportInfo_Adapter * pAdapter = (CFSDK_UnsupportInfo_Adapter *)pData;
- delete pAdapter;
-}
-
-FX_BOOL FPDF_UnSupportError(int nError)
-{
- CFSDK_UnsupportInfo_Adapter * pAdapter = (CFSDK_UnsupportInfo_Adapter *)CPDF_ModuleMgr::Get()->GetPrivateData((void *)FPDFSDK_UNSUPPORT_CALL);
-
- if(!pAdapter)
- return FALSE;
- pAdapter->ReportError(nError);
- return TRUE;
-}
-
-DLLEXPORT FPDF_BOOL STDCALL FSDK_SetUnSpObjProcessHandler(UNSUPPORT_INFO* unsp_info)
-{
- if (!unsp_info || unsp_info->version!=1)
- return FALSE;
- CFSDK_UnsupportInfo_Adapter * pAdapter = new CFSDK_UnsupportInfo_Adapter(unsp_info);
-
- CPDF_ModuleMgr::Get()->SetPrivateData((void *)FPDFSDK_UNSUPPORT_CALL,pAdapter, &FreeUnsupportInfo);
-
- return TRUE;
-}
-
-void CheckUnSupportAnnot(CPDF_Document * pDoc, CPDF_Annot* pPDFAnnot)
-{
- CFX_ByteString cbSubType = pPDFAnnot->GetSubType();
- if(cbSubType.Compare("3D") == 0)
- {
- FPDF_UnSupportError(FPDF_UNSP_ANNOT_3DANNOT);
- }
- else if(cbSubType.Compare("Screen") ==0)
- {
- CPDF_Dictionary* pAnnotDict = pPDFAnnot->m_pAnnotDict;
- CFX_ByteString cbString;
- if(pAnnotDict->KeyExist("IT"))
- cbString = pAnnotDict->GetString("IT");
- if(cbString.Compare("Img") != 0)
- FPDF_UnSupportError(FPDF_UNSP_ANNOT_SCREEN_MEDIA);
- }
- else if(cbSubType.Compare("Movie") ==0)
- {
- FPDF_UnSupportError(FPDF_UNSP_ANNOT_MOVIE);
- }
- else if(cbSubType.Compare("Sound") ==0)
- {
- FPDF_UnSupportError(FPDF_UNSP_ANNOT_SOUND);
- }
- else if(cbSubType.Compare("RichMedia") ==0)
- {
- FPDF_UnSupportError(FPDF_UNSP_ANNOT_SCREEN_RICHMEDIA);
- }
- else if(cbSubType.Compare("FileAttachment") ==0)
- {
- FPDF_UnSupportError(FPDF_UNSP_ANNOT_ATTACHMENT);
- }
- else if(cbSubType.Compare("Widget") ==0)
- {
- CPDF_Dictionary* pAnnotDict = pPDFAnnot->m_pAnnotDict;
- CFX_ByteString cbString;
- if(pAnnotDict->KeyExist("FT"))
- {
- cbString = pAnnotDict->GetString("FT");
- }
- if(cbString.Compare("Sig") == 0)
- {
- FPDF_UnSupportError(FPDF_UNSP_ANNOT_SIG);
- }
- }
-
-}
-
-FX_BOOL CheckSharedForm(CXML_Element * pElement, CFX_ByteString cbName)
-{
- int count = pElement->CountAttrs();
- int i=0;
- for (i = 0; i < count; i++)
- {
- CFX_ByteString space, name;
- CFX_WideString value;
- pElement->GetAttrByIndex(i, space, name, value);
- if (space == FX_BSTRC("xmlns") && name == FX_BSTRC("adhocwf") && value == L"http://ns.adobe.com/AcrobatAdhocWorkflow/1.0/")
- {
- CXML_Element *pVersion = pElement->GetElement("adhocwf",cbName);
- if (!pVersion)
- continue;
- CFX_WideString wsContent = pVersion->GetContent(0); // == 1.1
- int nType = wsContent.GetInteger();
- switch(nType)
- {
- case 1:
- FPDF_UnSupportError(FPDF_UNSP_DOC_SHAREDFORM_ACROBAT);
- break;
- case 2:
- FPDF_UnSupportError(FPDF_UNSP_DOC_SHAREDFORM_FILESYSTEM);
- break;
- case 0:
- FPDF_UnSupportError(FPDF_UNSP_DOC_SHAREDFORM_EMAIL);
- break;
- }
- }
- }
-
- FX_DWORD nCount = pElement->CountChildren();
- for(i=0; i<(int)nCount; i++)
- {
- CXML_Element::ChildType childType = pElement->GetChildType(i);
- if(childType == CXML_Element::Element)
- {
- CXML_Element * pChild = pElement->GetElement(i);
- if(CheckSharedForm(pChild, cbName))
- return TRUE;
- }
- }
- return FALSE;
-}
-
-void CheckUnSupportError(CPDF_Document * pDoc, FX_DWORD err_code)
-{
- // Security
- if(err_code == FPDF_ERR_SECURITY)
- {
- FPDF_UnSupportError(FPDF_UNSP_DOC_SECURITY);
- return ;
- }
- if(!pDoc)
- return ;
-
- // Portfolios and Packages
- CPDF_Dictionary * pRootDict = pDoc->GetRoot();
- if(pRootDict)
- {
- CFX_ByteString cbString;
- if(pRootDict->KeyExist("Collection"))
- {
- FPDF_UnSupportError(FPDF_UNSP_DOC_PORTABLECOLLECTION);
- return ;
- }
- if(pRootDict->KeyExist("Names"))
- {
- CPDF_Dictionary* pNameDict = pRootDict->GetDict("Names");
- if(pNameDict->KeyExist("EmbeddedFiles"))
- {
- FPDF_UnSupportError(FPDF_UNSP_DOC_ATTACHMENT);
- return;
- }
- else if(pNameDict->KeyExist("JavaScript"))
- {
- CPDF_Dictionary* pJSDict = pNameDict->GetDict("JavaScript");
- CPDF_Array * pArray = pJSDict->GetArray("Names");
- if (pArray) {
- int nCount = pArray->GetCount();
- for(int i=0; i<nCount; i++)
- {
- CFX_ByteString cbStr = pArray->GetString(i);
- if(cbStr.Compare("com.adobe.acrobat.SharedReview.Register") == 0)
- {
- FPDF_UnSupportError(FPDF_UNSP_DOC_SHAREDREVIEW);
- return;
- }
- }
- }
- }
- }
- }
-
- // SharedForm
- CPDF_Metadata metaData;
- metaData.LoadDoc(pDoc);
- CXML_Element * pElement = metaData.GetRoot();
- if(pElement)
- CheckSharedForm(pElement, "workflowType");
-
-
- // XFA Forms
- CPDF_InterForm * pInterForm = FX_NEW CPDF_InterForm(pDoc,FALSE);
- if (pInterForm)
- {
- if(pInterForm->HasXFAForm())
- {
- FPDF_UnSupportError(FPDF_UNSP_DOC_XFAFORM);
- }
- delete pInterForm;
- }
-}
-
-DLLEXPORT int FPDFDoc_GetPageMode(FPDF_DOCUMENT document)
-{
- if (!document) return PAGEMODE_UNKONOWN;
- CPDF_Dictionary *pRoot = ((CPDF_Document*)document)->GetRoot();
- if (!pRoot)
- return PAGEMODE_UNKONOWN;
- CPDF_Object* pName = pRoot->GetElement("PageMode");
- if (!pName)
- return PAGEMODE_USENONE;
- CFX_ByteString strPageMode = pName->GetString();
-
- if (strPageMode.IsEmpty()||strPageMode.EqualNoCase(FX_BSTR("UseNone")))
- return PAGEMODE_USENONE;
- else if (strPageMode.EqualNoCase(FX_BSTR("UseOutlines")))
- return PAGEMODE_USEOUTLINES;
- else if (strPageMode.EqualNoCase(FX_BSTR("UseThumbs")))
- return PAGEMODE_USETHUMBS;
- else if (strPageMode.EqualNoCase(FX_BSTR("FullScreen")))
- return PAGEMODE_FULLSCREEN;
- else if (strPageMode.EqualNoCase(FX_BSTR("UseOC")))
- return PAGEMODE_USEOC;
- else if (strPageMode.EqualNoCase(FX_BSTR("UseAttachments")))
- return PAGEMODE_USEATTACHMENTS;
-
- return PAGEMODE_UNKONOWN;
-}
+// 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
+
+#include "../include/fsdk_define.h"
+#include "../include/fpdf_ext.h"
+
+#define FPDFSDK_UNSUPPORT_CALL 100
+
+class CFSDK_UnsupportInfo_Adapter
+{
+public:
+ CFSDK_UnsupportInfo_Adapter(UNSUPPORT_INFO* unsp_info){ m_unsp_info = unsp_info;}
+// FX_BOOL NeedToPauseNow();
+ void ReportError(int nErrorType);
+
+private:
+ UNSUPPORT_INFO* m_unsp_info;
+};
+
+void CFSDK_UnsupportInfo_Adapter::ReportError(int nErrorType)
+{
+ if(m_unsp_info && m_unsp_info->FSDK_UnSupport_Handler)
+ {
+ m_unsp_info->FSDK_UnSupport_Handler(m_unsp_info,nErrorType);
+ }
+}
+
+void FreeUnsupportInfo(FX_LPVOID pData)
+{
+ CFSDK_UnsupportInfo_Adapter * pAdapter = (CFSDK_UnsupportInfo_Adapter *)pData;
+ delete pAdapter;
+}
+
+FX_BOOL FPDF_UnSupportError(int nError)
+{
+ CFSDK_UnsupportInfo_Adapter * pAdapter = (CFSDK_UnsupportInfo_Adapter *)CPDF_ModuleMgr::Get()->GetPrivateData((void *)FPDFSDK_UNSUPPORT_CALL);
+
+ if(!pAdapter)
+ return FALSE;
+ pAdapter->ReportError(nError);
+ return TRUE;
+}
+
+DLLEXPORT FPDF_BOOL STDCALL FSDK_SetUnSpObjProcessHandler(UNSUPPORT_INFO* unsp_info)
+{
+ if (!unsp_info || unsp_info->version!=1)
+ return FALSE;
+ CFSDK_UnsupportInfo_Adapter * pAdapter = new CFSDK_UnsupportInfo_Adapter(unsp_info);
+
+ CPDF_ModuleMgr::Get()->SetPrivateData((void *)FPDFSDK_UNSUPPORT_CALL,pAdapter, &FreeUnsupportInfo);
+
+ return TRUE;
+}
+
+void CheckUnSupportAnnot(CPDF_Document * pDoc, CPDF_Annot* pPDFAnnot)
+{
+ CFX_ByteString cbSubType = pPDFAnnot->GetSubType();
+ if(cbSubType.Compare("3D") == 0)
+ {
+ FPDF_UnSupportError(FPDF_UNSP_ANNOT_3DANNOT);
+ }
+ else if(cbSubType.Compare("Screen") ==0)
+ {
+ CPDF_Dictionary* pAnnotDict = pPDFAnnot->m_pAnnotDict;
+ CFX_ByteString cbString;
+ if(pAnnotDict->KeyExist("IT"))
+ cbString = pAnnotDict->GetString("IT");
+ if(cbString.Compare("Img") != 0)
+ FPDF_UnSupportError(FPDF_UNSP_ANNOT_SCREEN_MEDIA);
+ }
+ else if(cbSubType.Compare("Movie") ==0)
+ {
+ FPDF_UnSupportError(FPDF_UNSP_ANNOT_MOVIE);
+ }
+ else if(cbSubType.Compare("Sound") ==0)
+ {
+ FPDF_UnSupportError(FPDF_UNSP_ANNOT_SOUND);
+ }
+ else if(cbSubType.Compare("RichMedia") ==0)
+ {
+ FPDF_UnSupportError(FPDF_UNSP_ANNOT_SCREEN_RICHMEDIA);
+ }
+ else if(cbSubType.Compare("FileAttachment") ==0)
+ {
+ FPDF_UnSupportError(FPDF_UNSP_ANNOT_ATTACHMENT);
+ }
+ else if(cbSubType.Compare("Widget") ==0)
+ {
+ CPDF_Dictionary* pAnnotDict = pPDFAnnot->m_pAnnotDict;
+ CFX_ByteString cbString;
+ if(pAnnotDict->KeyExist("FT"))
+ {
+ cbString = pAnnotDict->GetString("FT");
+ }
+ if(cbString.Compare("Sig") == 0)
+ {
+ FPDF_UnSupportError(FPDF_UNSP_ANNOT_SIG);
+ }
+ }
+
+}
+
+FX_BOOL CheckSharedForm(CXML_Element * pElement, CFX_ByteString cbName)
+{
+ int count = pElement->CountAttrs();
+ int i=0;
+ for (i = 0; i < count; i++)
+ {
+ CFX_ByteString space, name;
+ CFX_WideString value;
+ pElement->GetAttrByIndex(i, space, name, value);
+ if (space == FX_BSTRC("xmlns") && name == FX_BSTRC("adhocwf") && value == L"http://ns.adobe.com/AcrobatAdhocWorkflow/1.0/")
+ {
+ CXML_Element *pVersion = pElement->GetElement("adhocwf",cbName);
+ if (!pVersion)
+ continue;
+ CFX_WideString wsContent = pVersion->GetContent(0); // == 1.1
+ int nType = wsContent.GetInteger();
+ switch(nType)
+ {
+ case 1:
+ FPDF_UnSupportError(FPDF_UNSP_DOC_SHAREDFORM_ACROBAT);
+ break;
+ case 2:
+ FPDF_UnSupportError(FPDF_UNSP_DOC_SHAREDFORM_FILESYSTEM);
+ break;
+ case 0:
+ FPDF_UnSupportError(FPDF_UNSP_DOC_SHAREDFORM_EMAIL);
+ break;
+ }
+ }
+ }
+
+ FX_DWORD nCount = pElement->CountChildren();
+ for(i=0; i<(int)nCount; i++)
+ {
+ CXML_Element::ChildType childType = pElement->GetChildType(i);
+ if(childType == CXML_Element::Element)
+ {
+ CXML_Element * pChild = pElement->GetElement(i);
+ if(CheckSharedForm(pChild, cbName))
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
+void CheckUnSupportError(CPDF_Document * pDoc, FX_DWORD err_code)
+{
+ // Security
+ if(err_code == FPDF_ERR_SECURITY)
+ {
+ FPDF_UnSupportError(FPDF_UNSP_DOC_SECURITY);
+ return ;
+ }
+ if(!pDoc)
+ return ;
+
+ // Portfolios and Packages
+ CPDF_Dictionary * pRootDict = pDoc->GetRoot();
+ if(pRootDict)
+ {
+ CFX_ByteString cbString;
+ if(pRootDict->KeyExist("Collection"))
+ {
+ FPDF_UnSupportError(FPDF_UNSP_DOC_PORTABLECOLLECTION);
+ return ;
+ }
+ if(pRootDict->KeyExist("Names"))
+ {
+ CPDF_Dictionary* pNameDict = pRootDict->GetDict("Names");
+ if(pNameDict->KeyExist("EmbeddedFiles"))
+ {
+ FPDF_UnSupportError(FPDF_UNSP_DOC_ATTACHMENT);
+ return;
+ }
+ else if(pNameDict->KeyExist("JavaScript"))
+ {
+ CPDF_Dictionary* pJSDict = pNameDict->GetDict("JavaScript");
+ CPDF_Array * pArray = pJSDict->GetArray("Names");
+ if (pArray) {
+ int nCount = pArray->GetCount();
+ for(int i=0; i<nCount; i++)
+ {
+ CFX_ByteString cbStr = pArray->GetString(i);
+ if(cbStr.Compare("com.adobe.acrobat.SharedReview.Register") == 0)
+ {
+ FPDF_UnSupportError(FPDF_UNSP_DOC_SHAREDREVIEW);
+ return;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ // SharedForm
+ CPDF_Metadata metaData;
+ metaData.LoadDoc(pDoc);
+ CXML_Element * pElement = metaData.GetRoot();
+ if(pElement)
+ CheckSharedForm(pElement, "workflowType");
+
+
+ // XFA Forms
+ CPDF_InterForm * pInterForm = FX_NEW CPDF_InterForm(pDoc,FALSE);
+ if (pInterForm)
+ {
+ if(pInterForm->HasXFAForm())
+ {
+ FPDF_UnSupportError(FPDF_UNSP_DOC_XFAFORM);
+ }
+ delete pInterForm;
+ }
+}
+
+DLLEXPORT int FPDFDoc_GetPageMode(FPDF_DOCUMENT document)
+{
+ if (!document) return PAGEMODE_UNKONOWN;
+ CPDF_Dictionary *pRoot = ((CPDF_Document*)document)->GetRoot();
+ if (!pRoot)
+ return PAGEMODE_UNKONOWN;
+ CPDF_Object* pName = pRoot->GetElement("PageMode");
+ if (!pName)
+ return PAGEMODE_USENONE;
+ CFX_ByteString strPageMode = pName->GetString();
+
+ if (strPageMode.IsEmpty()||strPageMode.EqualNoCase(FX_BSTR("UseNone")))
+ return PAGEMODE_USENONE;
+ else if (strPageMode.EqualNoCase(FX_BSTR("UseOutlines")))
+ return PAGEMODE_USEOUTLINES;
+ else if (strPageMode.EqualNoCase(FX_BSTR("UseThumbs")))
+ return PAGEMODE_USETHUMBS;
+ else if (strPageMode.EqualNoCase(FX_BSTR("FullScreen")))
+ return PAGEMODE_FULLSCREEN;
+ else if (strPageMode.EqualNoCase(FX_BSTR("UseOC")))
+ return PAGEMODE_USEOC;
+ else if (strPageMode.EqualNoCase(FX_BSTR("UseAttachments")))
+ return PAGEMODE_USEATTACHMENTS;
+
+ return PAGEMODE_UNKONOWN;
+}
diff --git a/fpdfsdk/src/fpdf_flatten.cpp b/fpdfsdk/src/fpdf_flatten.cpp
index f04100f95a..6d3440f556 100644
--- a/fpdfsdk/src/fpdf_flatten.cpp
+++ b/fpdfsdk/src/fpdf_flatten.cpp
@@ -1,561 +1,561 @@
-// 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
-
-#include "../include/fsdk_define.h"
-#include "../include/fpdf_flatten.h"
-
-typedef CFX_ArrayTemplate<CPDF_Dictionary*> CPDF_ObjectArray;
-typedef CFX_ArrayTemplate<CPDF_Rect> CPDF_RectArray;
-
-enum FPDF_TYPE { MAX, MIN };
-enum FPDF_VALUE { TOP, LEFT, RIGHT, BOTTOM };
-
-FX_BOOL IsValiableRect(CPDF_Rect rect, CPDF_Rect rcPage)
-{
- if ( rect.left - rect.right > 0.000001f ||
- rect.bottom - rect.top > 0.000001f)
- return FALSE;
-
- if (rect.left == 0.0f &&
- rect.top == 0.0f &&
- rect.right == 0.0f &&
- rect.bottom == 0.0f)
- return FALSE;
-
- if (!rcPage.IsEmpty())
- {
- if (rect.left - rcPage.left < -10.000001f ||
- rect.right - rcPage.right > 10.000001f ||
- rect.top - rcPage.top > 10.000001f ||
- rect.bottom - rcPage.bottom < -10.000001f)
- return FALSE;
- }
-
- return TRUE;
-}
-
-
-FX_BOOL GetContentsRect( CPDF_Document * pDoc, CPDF_Dictionary* pDict, CPDF_RectArray * pRectArray )
-{
- CPDF_Page* pPDFPage = FX_NEW CPDF_Page;
- pPDFPage->Load( pDoc, pDict, FALSE );
- pPDFPage->ParseContent();
-
- FX_POSITION pos = pPDFPage->GetFirstObjectPosition();
-
- while (pos)
- {
- CPDF_PageObject* pPageObject = pPDFPage->GetNextObject(pos);
- if (!pPageObject)continue;
-
- CPDF_Rect rc;
- rc.left = pPageObject->m_Left;
- rc.right = pPageObject->m_Right;
- rc.bottom = pPageObject->m_Bottom;
- rc.top = pPageObject->m_Top;
-
- if (IsValiableRect(rc, pDict->GetRect("MediaBox")))
- {
- pRectArray->Add(rc);
- }
- }
-
- delete pPDFPage;
- return TRUE;
-}
-
-
-void ParserStream( CPDF_Dictionary * pPageDic, CPDF_Dictionary* pStream, CPDF_RectArray * pRectArray, CPDF_ObjectArray * pObjectArray )
-{
- if (!pStream)return;
- CPDF_Rect rect;
- if (pStream->KeyExist("Rect"))
- rect = pStream->GetRect("Rect");
- else if (pStream->KeyExist("BBox"))
- rect = pStream->GetRect("BBox");
-
- if (IsValiableRect(rect, pPageDic->GetRect("MediaBox")))
- pRectArray->Add(rect);
-
- pObjectArray->Add(pStream);
-}
-
-
-int ParserAnnots( CPDF_Document* pSourceDoc, CPDF_Dictionary * pPageDic, CPDF_RectArray * pRectArray, CPDF_ObjectArray * pObjectArray, int nUsage)
-{
- if (!pSourceDoc || !pPageDic) return FLATTEN_FAIL;
-
- GetContentsRect( pSourceDoc, pPageDic, pRectArray );
- CPDF_Array* pAnnots = pPageDic->GetArray("Annots");
- if (pAnnots)
- {
- FX_DWORD dwSize = pAnnots->GetCount();
-
- for (int i = 0; i < (int)dwSize; i++)
- {
- CPDF_Object* pObj = pAnnots->GetElementValue(i);
-
- if (!pObj)continue;
-
- if (pObj->GetType() == PDFOBJ_DICTIONARY)
- {
- CPDF_Dictionary* pAnnotDic = (CPDF_Dictionary*)pObj;
- CFX_ByteString sSubtype = pAnnotDic->GetString("Subtype");
- if (sSubtype == "Popup")continue;
-
- int nAnnotFlag = pAnnotDic->GetInteger("F");
-
- if(nAnnotFlag & ANNOTFLAG_HIDDEN)
- continue;
- if(nUsage == FLAT_NORMALDISPLAY)
- {
- if(nAnnotFlag & ANNOTFLAG_INVISIBLE)
- continue;
- ParserStream( pPageDic, pAnnotDic, pRectArray, pObjectArray );
- }
- else
- {
- if(nAnnotFlag & ANNOTFLAG_PRINT)
- ParserStream( pPageDic, pAnnotDic, pRectArray, pObjectArray );
- }
- }
- }
- return FLATTEN_SUCCESS;
- }else{
- return FLATTEN_NOTINGTODO;
- }
-}
-
-
-FX_FLOAT GetMinMaxValue( CPDF_RectArray& array, FPDF_TYPE type, FPDF_VALUE value)
-{
- int nRects = array.GetSize();
- FX_FLOAT fRet = 0.0f;
-
- if (nRects <= 0)return 0.0f;
-
- FX_FLOAT* pArray = new FX_FLOAT[nRects];
- switch(value)
- {
- case LEFT:
- {
- for (int i = 0; i < nRects; i++)
- pArray[i] = CPDF_Rect(array.GetAt(i)).left;
-
- break;
- }
- case TOP:
- {
- for (int i = 0; i < nRects; i++)
- pArray[i] = CPDF_Rect(array.GetAt(i)).top;
-
- break;
- }
- case RIGHT:
- {
- for (int i = 0; i < nRects; i++)
- pArray[i] = CPDF_Rect(array.GetAt(i)).right;
-
- break;
- }
- case BOTTOM:
- {
- for (int i = 0; i < nRects; i++)
- pArray[i] = CPDF_Rect(array.GetAt(i)).bottom;
-
- break;
- }
- default:
- break;
- }
- fRet = pArray[0];
- if (type == MAX)
- {
- for (int i = 1; i < nRects; i++)
- if (fRet <= pArray[i])
- fRet = pArray[i];
- }
- else
- {
- for (int i = 1; i < nRects; i++)
- if (fRet >= pArray[i])
- fRet = pArray[i];
- }
- delete[] pArray;
- return fRet;
-}
-
-CPDF_Rect CalculateRect( CPDF_RectArray * pRectArray )
-{
-
- CPDF_Rect rcRet;
-
- rcRet.left = GetMinMaxValue(*pRectArray, MIN, LEFT);
- rcRet.top = GetMinMaxValue(*pRectArray, MAX, TOP);
- rcRet.right = GetMinMaxValue(*pRectArray, MAX, RIGHT);
- rcRet.bottom = GetMinMaxValue(*pRectArray, MIN, BOTTOM);
-
- return rcRet;
-}
-
-
-void SetPageContents(CFX_ByteString key, CPDF_Dictionary* pPage, CPDF_Document* pDocument)
-{
- CPDF_Object* pContentsObj = pPage->GetStream("Contents");
- if (!pContentsObj)
- {
- pContentsObj = pPage->GetArray("Contents");
- }
-
- if (!pContentsObj)
- {
- //Create a new contents dictionary
- if (!key.IsEmpty())
- {
- CPDF_Stream* pNewContents = FX_NEW CPDF_Stream(NULL, 0, FX_NEW CPDF_Dictionary);
- if (!pNewContents)return;
- pPage->SetAtReference("Contents", pDocument, pDocument->AddIndirectObject(pNewContents));
-
- CFX_ByteString sStream;
- sStream.Format("q 1 0 0 1 0 0 cm /%s Do Q", (FX_LPCSTR)key);
- pNewContents->SetData((FX_LPCBYTE)sStream, sStream.GetLength(), FALSE, FALSE);
- }
- return;
- }
-
- int iType = pContentsObj->GetType();
- CPDF_Array* pContentsArray = NULL;
-
- switch(iType)
- {
- case PDFOBJ_STREAM:
- {
- pContentsArray = FX_NEW CPDF_Array;
- CPDF_Stream* pContents = (CPDF_Stream*)pContentsObj;
- FX_DWORD dwObjNum = pDocument->AddIndirectObject(pContents);
- CPDF_StreamAcc acc;
- acc.LoadAllData(pContents);
- CFX_ByteString sStream = "q\n";
- CFX_ByteString sBody = CFX_ByteString((FX_LPCSTR)acc.GetData(), acc.GetSize());
- sStream = sStream + sBody + "\nQ";
- pContents->SetData((FX_LPCBYTE)sStream, sStream.GetLength(), FALSE, FALSE);
- pContentsArray->AddReference(pDocument, dwObjNum);
- break;
- }
-
- case PDFOBJ_ARRAY:
- {
- pContentsArray = (CPDF_Array*)pContentsObj;
- break;
- }
- default:
- break;
- }
-
- if (!pContentsArray)return;
-
- FX_DWORD dwObjNum = pDocument->AddIndirectObject(pContentsArray);
- pPage->SetAtReference("Contents", pDocument, dwObjNum);
-
- if (!key.IsEmpty())
- {
- CPDF_Stream* pNewContents = FX_NEW CPDF_Stream(NULL, 0, FX_NEW CPDF_Dictionary);
- dwObjNum = pDocument->AddIndirectObject(pNewContents);
- pContentsArray->AddReference(pDocument, dwObjNum);
-
- CFX_ByteString sStream;
- sStream.Format("q 1 0 0 1 0 0 cm /%s Do Q", (FX_LPCSTR)key);
- pNewContents->SetData((FX_LPCBYTE)sStream, sStream.GetLength(), FALSE, FALSE);
- }
-}
-
-CFX_AffineMatrix GetMatrix(CPDF_Rect rcAnnot, CPDF_Rect rcStream, CFX_AffineMatrix matrix)
-{
- if(rcStream.IsEmpty())
- return CFX_AffineMatrix();
-
- matrix.TransformRect(rcStream);
- rcStream.Normalize();
-
- FX_FLOAT a = rcAnnot.Width()/rcStream.Width();
- FX_FLOAT d = rcAnnot.Height()/rcStream.Height();
-
- FX_FLOAT e = rcAnnot.left - rcStream.left * a;
- FX_FLOAT f = rcAnnot.bottom - rcStream.bottom * d;
- return CFX_AffineMatrix(a, 0, 0, d, e, f);
-}
-
-void GetOffset(FX_FLOAT& fa, FX_FLOAT& fd, FX_FLOAT& fe, FX_FLOAT& ff, CPDF_Rect rcAnnot, CPDF_Rect rcStream, CFX_AffineMatrix matrix)
-{
- FX_FLOAT fStreamWidth = 0.0f;
- FX_FLOAT fStreamHeight = 0.0f;
-
-
-
- if (matrix.a != 0 && matrix.d != 0)
- {
- fStreamWidth = rcStream.right - rcStream.left;
- fStreamHeight = rcStream.top - rcStream.bottom;
- }
- else
- {
- fStreamWidth = rcStream.top - rcStream.bottom;
- fStreamHeight = rcStream.right - rcStream.left;
- }
-
- FX_FLOAT x1 = matrix.a * rcStream.left + matrix.c * rcStream.bottom + matrix.e;
- FX_FLOAT y1 = matrix.b * rcStream.left + matrix.d * rcStream.bottom + matrix.f;
- FX_FLOAT x2 = matrix.a * rcStream.left + matrix.c * rcStream.top + matrix.e;
- FX_FLOAT y2 = matrix.b * rcStream.left + matrix.d * rcStream.top + matrix.f;
- FX_FLOAT x3 = matrix.a * rcStream.right + matrix.c * rcStream.bottom + matrix.e;
- FX_FLOAT y3 = matrix.b * rcStream.right + matrix.d * rcStream.bottom + matrix.f;
- FX_FLOAT x4 = matrix.a * rcStream.right + matrix.c * rcStream.top + matrix.e;
- FX_FLOAT y4 = matrix.b * rcStream.right + matrix.d * rcStream.top + matrix.f;
-
- FX_FLOAT left = FX_MIN(FX_MIN(x1, x2), FX_MIN(x3, x4));
- FX_FLOAT bottom = FX_MIN(FX_MIN(y1, y2), FX_MIN(y3, y4));
-
- fa = (rcAnnot.right - rcAnnot.left)/fStreamWidth;
- fd = (rcAnnot.top - rcAnnot.bottom)/fStreamHeight;
- fe = rcAnnot.left - left * fa;
- ff = rcAnnot.bottom - bottom * fd;
-}
-
-
-DLLEXPORT int STDCALL FPDFPage_Flatten( FPDF_PAGE page, int nFlag)
-{
- if (!page)
- {
- return FLATTEN_FAIL;
- }
-
- CPDF_Page * pPage = (CPDF_Page*)( page );
- CPDF_Document * pDocument = pPage->m_pDocument;
- CPDF_Dictionary * pPageDict = pPage->m_pFormDict;
-
- if ( !pDocument || !pPageDict )
- {
- return FLATTEN_FAIL;
- }
-
- CPDF_ObjectArray ObjectArray;
- CPDF_RectArray RectArray;
-
- int iRet = FLATTEN_FAIL;
- iRet = ParserAnnots( pDocument, pPageDict, &RectArray, &ObjectArray, nFlag);
- if (iRet == FLATTEN_NOTINGTODO)
- {
- return FLATTEN_NOTINGTODO;
- }else if (iRet == FLATTEN_FAIL)
- {
- return FLATTEN_FAIL;
- }
-
- CPDF_Rect rcOriginalCB;
- CPDF_Rect rcMerger = CalculateRect( &RectArray );
- CPDF_Rect rcOriginalMB = pPageDict->GetRect("MediaBox");
-
- if (pPageDict->KeyExist("CropBox"))
- rcOriginalMB = pPageDict->GetRect("CropBox");
-
- if (rcOriginalMB.IsEmpty())
- {
- rcOriginalMB = CPDF_Rect(0.0f, 0.0f, 612.0f, 792.0f);
- }
-
- rcMerger.left = rcMerger.left < rcOriginalMB.left? rcOriginalMB.left : rcMerger.left;
- rcMerger.right = rcMerger.right > rcOriginalMB.right? rcOriginalMB.right : rcMerger.right;
- rcMerger.top = rcMerger.top > rcOriginalMB.top? rcOriginalMB.top : rcMerger.top;
- rcMerger.bottom = rcMerger.bottom < rcOriginalMB.bottom? rcOriginalMB.bottom : rcMerger.bottom;
-
- if (pPageDict->KeyExist("ArtBox"))
- rcOriginalCB = pPageDict->GetRect("ArtBox");
- else
- rcOriginalCB = rcOriginalMB;
-
- if (!rcOriginalMB.IsEmpty())
- {
- CPDF_Array* pMediaBox = FX_NEW CPDF_Array();
-
- pMediaBox->Add(FX_NEW CPDF_Number(rcOriginalMB.left));
- pMediaBox->Add(FX_NEW CPDF_Number(rcOriginalMB.bottom));
- pMediaBox->Add(FX_NEW CPDF_Number(rcOriginalMB.right));
- pMediaBox->Add(FX_NEW CPDF_Number(rcOriginalMB.top));
-
- pPageDict->SetAt("MediaBox",pMediaBox);
- }
-
- if (!rcOriginalCB.IsEmpty())
- {
- CPDF_Array* pCropBox = FX_NEW CPDF_Array();
- pCropBox->Add(FX_NEW CPDF_Number(rcOriginalCB.left));
- pCropBox->Add(FX_NEW CPDF_Number(rcOriginalCB.bottom));
- pCropBox->Add(FX_NEW CPDF_Number(rcOriginalCB.right));
- pCropBox->Add(FX_NEW CPDF_Number(rcOriginalCB.top));
- pPageDict->SetAt("ArtBox", pCropBox);
- }
-
- CPDF_Dictionary* pRes = NULL;
- pRes = pPageDict->GetDict("Resources");
- if (!pRes)
- {
- pRes = FX_NEW CPDF_Dictionary;
- pPageDict->SetAt( "Resources", pRes );
- }
-
- CPDF_Stream* pNewXObject = FX_NEW CPDF_Stream(NULL, 0, FX_NEW CPDF_Dictionary);
- FX_DWORD dwObjNum = pDocument->AddIndirectObject(pNewXObject);
- CPDF_Dictionary* pPageXObject = pRes->GetDict("XObject");
- if (!pPageXObject)
- {
- pPageXObject = FX_NEW CPDF_Dictionary;
- pRes->SetAt("XObject", pPageXObject);
- }
-
- CFX_ByteString key = "";
- int nStreams = ObjectArray.GetSize();
-
- if (nStreams > 0)
- {
- for (int iKey = 0; /*iKey < 100*/; iKey++)
- {
- char sExtend[5] = {0};
- FXSYS_itoa(iKey, sExtend, 10);
- key = CFX_ByteString("FFT") + CFX_ByteString(sExtend);
-
- if (!pPageXObject->KeyExist(key))
- break;
- }
- }
-
- SetPageContents(key, pPageDict, pDocument);
-
- CPDF_Dictionary* pNewXORes = NULL;
-
- if (!key.IsEmpty())
- {
- pPageXObject->SetAtReference(key, pDocument, dwObjNum);
- CPDF_Dictionary* pNewOXbjectDic = pNewXObject->GetDict();
- pNewXORes = FX_NEW CPDF_Dictionary;
- pNewOXbjectDic->SetAt("Resources", pNewXORes);
- pNewOXbjectDic->SetAtName("Type", "XObject");
- pNewOXbjectDic->SetAtName("Subtype", "Form");
- pNewOXbjectDic->SetAtInteger("FormType", 1);
- pNewOXbjectDic->SetAtName("Name", "FRM");
- CPDF_Rect rcBBox = pPageDict->GetRect("ArtBox");
- pNewOXbjectDic->SetAtRect("BBox", rcBBox);
- }
-
- for (int i = 0; i < nStreams; i++)
- {
- CPDF_Dictionary* pAnnotDic = ObjectArray.GetAt(i);
- if (!pAnnotDic)continue;
-
- CPDF_Rect rcAnnot = pAnnotDic->GetRect("Rect");
- rcAnnot.Normalize();
-
- CFX_ByteString sAnnotState = pAnnotDic->GetString("AS");
- CPDF_Dictionary* pAnnotAP = pAnnotDic->GetDict("AP");
- if (!pAnnotAP)continue;
-
- CPDF_Stream* pAPStream = pAnnotAP->GetStream("N");
- if (!pAPStream)
- {
- CPDF_Dictionary* pAPDic = pAnnotAP->GetDict("N");
- if (!pAPDic)continue;
-
- if (!sAnnotState.IsEmpty())
- {
- pAPStream = pAPDic->GetStream(sAnnotState);
- }
- else
- {
- FX_POSITION pos = pAPDic->GetStartPos();
- if (pos)
- {
- CFX_ByteString sKey;
- CPDF_Object* pFirstObj = pAPDic->GetNextElement(pos, sKey);
- if (pFirstObj)
- {
- if (pFirstObj->GetType() == PDFOBJ_REFERENCE)
- pFirstObj = pFirstObj->GetDirect();
-
- if (pFirstObj->GetType() != PDFOBJ_STREAM)
- continue;
-
- pAPStream = (CPDF_Stream*)pFirstObj;
- }
- }
- }
- }
-
- if (!pAPStream)continue;
-
- CPDF_Dictionary* pAPDic = pAPStream->GetDict();
- CFX_AffineMatrix matrix = pAPDic->GetMatrix("Matrix");
-
- CPDF_Rect rcStream;
- if (pAPDic->KeyExist("Rect"))
- rcStream = pAPDic->GetRect("Rect");
- else if (pAPDic->KeyExist("BBox"))
- rcStream = pAPDic->GetRect("BBox");
-
- if (rcStream.IsEmpty())continue;
-
- CPDF_Object* pObj = pAPStream;
-
- if (pObj)
- {
- CPDF_Dictionary* pObjDic = pObj->GetDict();
- if (pObjDic)
- {
- pObjDic->SetAtName("Type", "XObject");
- pObjDic->SetAtName("Subtype", "Form");
- }
- }
-
- CPDF_Dictionary* pXObject = pNewXORes->GetDict("XObject");
- if (!pXObject)
- {
- pXObject = FX_NEW CPDF_Dictionary;
- pNewXORes->SetAt("XObject", pXObject);
- }
-
- CFX_ByteString sFormName;
- sFormName.Format("F%d", i);
- FX_DWORD dwObjNum = pDocument->AddIndirectObject(pObj);
- pXObject->SetAtReference(sFormName, pDocument, dwObjNum);
-
- CPDF_StreamAcc acc;
- acc.LoadAllData(pNewXObject);
-
- FX_LPCBYTE pData = acc.GetData();
- CFX_ByteString sStream(pData, acc.GetSize());
- CFX_ByteString sTemp;
-
- if (matrix.IsIdentity())
- {
- matrix.a = 1.0f;
- matrix.b = 0.0f;
- matrix.c = 0.0f;
- matrix.d = 1.0f;
- matrix.e = 0.0f;
- matrix.f = 0.0f;
- }
-
- CFX_AffineMatrix m = GetMatrix(rcAnnot, rcStream, matrix);
- sTemp.Format("q %f 0 0 %f %f %f cm /%s Do Q\n", m.a, m.d, m.e, m.f, (FX_LPCSTR)sFormName);
- sStream += sTemp;
-
- pNewXObject->SetData((FX_LPCBYTE)sStream, sStream.GetLength(), FALSE, FALSE);
- }
- pPageDict->RemoveAt( "Annots" );
-
- ObjectArray.RemoveAll();
- RectArray.RemoveAll();
-
- return FLATTEN_SUCCESS;
-}
+// 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
+
+#include "../include/fsdk_define.h"
+#include "../include/fpdf_flatten.h"
+
+typedef CFX_ArrayTemplate<CPDF_Dictionary*> CPDF_ObjectArray;
+typedef CFX_ArrayTemplate<CPDF_Rect> CPDF_RectArray;
+
+enum FPDF_TYPE { MAX, MIN };
+enum FPDF_VALUE { TOP, LEFT, RIGHT, BOTTOM };
+
+FX_BOOL IsValiableRect(CPDF_Rect rect, CPDF_Rect rcPage)
+{
+ if ( rect.left - rect.right > 0.000001f ||
+ rect.bottom - rect.top > 0.000001f)
+ return FALSE;
+
+ if (rect.left == 0.0f &&
+ rect.top == 0.0f &&
+ rect.right == 0.0f &&
+ rect.bottom == 0.0f)
+ return FALSE;
+
+ if (!rcPage.IsEmpty())
+ {
+ if (rect.left - rcPage.left < -10.000001f ||
+ rect.right - rcPage.right > 10.000001f ||
+ rect.top - rcPage.top > 10.000001f ||
+ rect.bottom - rcPage.bottom < -10.000001f)
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+
+FX_BOOL GetContentsRect( CPDF_Document * pDoc, CPDF_Dictionary* pDict, CPDF_RectArray * pRectArray )
+{
+ CPDF_Page* pPDFPage = FX_NEW CPDF_Page;
+ pPDFPage->Load( pDoc, pDict, FALSE );
+ pPDFPage->ParseContent();
+
+ FX_POSITION pos = pPDFPage->GetFirstObjectPosition();
+
+ while (pos)
+ {
+ CPDF_PageObject* pPageObject = pPDFPage->GetNextObject(pos);
+ if (!pPageObject)continue;
+
+ CPDF_Rect rc;
+ rc.left = pPageObject->m_Left;
+ rc.right = pPageObject->m_Right;
+ rc.bottom = pPageObject->m_Bottom;
+ rc.top = pPageObject->m_Top;
+
+ if (IsValiableRect(rc, pDict->GetRect("MediaBox")))
+ {
+ pRectArray->Add(rc);
+ }
+ }
+
+ delete pPDFPage;
+ return TRUE;
+}
+
+
+void ParserStream( CPDF_Dictionary * pPageDic, CPDF_Dictionary* pStream, CPDF_RectArray * pRectArray, CPDF_ObjectArray * pObjectArray )
+{
+ if (!pStream)return;
+ CPDF_Rect rect;
+ if (pStream->KeyExist("Rect"))
+ rect = pStream->GetRect("Rect");
+ else if (pStream->KeyExist("BBox"))
+ rect = pStream->GetRect("BBox");
+
+ if (IsValiableRect(rect, pPageDic->GetRect("MediaBox")))
+ pRectArray->Add(rect);
+
+ pObjectArray->Add(pStream);
+}
+
+
+int ParserAnnots( CPDF_Document* pSourceDoc, CPDF_Dictionary * pPageDic, CPDF_RectArray * pRectArray, CPDF_ObjectArray * pObjectArray, int nUsage)
+{
+ if (!pSourceDoc || !pPageDic) return FLATTEN_FAIL;
+
+ GetContentsRect( pSourceDoc, pPageDic, pRectArray );
+ CPDF_Array* pAnnots = pPageDic->GetArray("Annots");
+ if (pAnnots)
+ {
+ FX_DWORD dwSize = pAnnots->GetCount();
+
+ for (int i = 0; i < (int)dwSize; i++)
+ {
+ CPDF_Object* pObj = pAnnots->GetElementValue(i);
+
+ if (!pObj)continue;
+
+ if (pObj->GetType() == PDFOBJ_DICTIONARY)
+ {
+ CPDF_Dictionary* pAnnotDic = (CPDF_Dictionary*)pObj;
+ CFX_ByteString sSubtype = pAnnotDic->GetString("Subtype");
+ if (sSubtype == "Popup")continue;
+
+ int nAnnotFlag = pAnnotDic->GetInteger("F");
+
+ if(nAnnotFlag & ANNOTFLAG_HIDDEN)
+ continue;
+ if(nUsage == FLAT_NORMALDISPLAY)
+ {
+ if(nAnnotFlag & ANNOTFLAG_INVISIBLE)
+ continue;
+ ParserStream( pPageDic, pAnnotDic, pRectArray, pObjectArray );
+ }
+ else
+ {
+ if(nAnnotFlag & ANNOTFLAG_PRINT)
+ ParserStream( pPageDic, pAnnotDic, pRectArray, pObjectArray );
+ }
+ }
+ }
+ return FLATTEN_SUCCESS;
+ }else{
+ return FLATTEN_NOTINGTODO;
+ }
+}
+
+
+FX_FLOAT GetMinMaxValue( CPDF_RectArray& array, FPDF_TYPE type, FPDF_VALUE value)
+{
+ int nRects = array.GetSize();
+ FX_FLOAT fRet = 0.0f;
+
+ if (nRects <= 0)return 0.0f;
+
+ FX_FLOAT* pArray = new FX_FLOAT[nRects];
+ switch(value)
+ {
+ case LEFT:
+ {
+ for (int i = 0; i < nRects; i++)
+ pArray[i] = CPDF_Rect(array.GetAt(i)).left;
+
+ break;
+ }
+ case TOP:
+ {
+ for (int i = 0; i < nRects; i++)
+ pArray[i] = CPDF_Rect(array.GetAt(i)).top;
+
+ break;
+ }
+ case RIGHT:
+ {
+ for (int i = 0; i < nRects; i++)
+ pArray[i] = CPDF_Rect(array.GetAt(i)).right;
+
+ break;
+ }
+ case BOTTOM:
+ {
+ for (int i = 0; i < nRects; i++)
+ pArray[i] = CPDF_Rect(array.GetAt(i)).bottom;
+
+ break;
+ }
+ default:
+ break;
+ }
+ fRet = pArray[0];
+ if (type == MAX)
+ {
+ for (int i = 1; i < nRects; i++)
+ if (fRet <= pArray[i])
+ fRet = pArray[i];
+ }
+ else
+ {
+ for (int i = 1; i < nRects; i++)
+ if (fRet >= pArray[i])
+ fRet = pArray[i];
+ }
+ delete[] pArray;
+ return fRet;
+}
+
+CPDF_Rect CalculateRect( CPDF_RectArray * pRectArray )
+{
+
+ CPDF_Rect rcRet;
+
+ rcRet.left = GetMinMaxValue(*pRectArray, MIN, LEFT);
+ rcRet.top = GetMinMaxValue(*pRectArray, MAX, TOP);
+ rcRet.right = GetMinMaxValue(*pRectArray, MAX, RIGHT);
+ rcRet.bottom = GetMinMaxValue(*pRectArray, MIN, BOTTOM);
+
+ return rcRet;
+}
+
+
+void SetPageContents(CFX_ByteString key, CPDF_Dictionary* pPage, CPDF_Document* pDocument)
+{
+ CPDF_Object* pContentsObj = pPage->GetStream("Contents");
+ if (!pContentsObj)
+ {
+ pContentsObj = pPage->GetArray("Contents");
+ }
+
+ if (!pContentsObj)
+ {
+ //Create a new contents dictionary
+ if (!key.IsEmpty())
+ {
+ CPDF_Stream* pNewContents = FX_NEW CPDF_Stream(NULL, 0, FX_NEW CPDF_Dictionary);
+ if (!pNewContents)return;
+ pPage->SetAtReference("Contents", pDocument, pDocument->AddIndirectObject(pNewContents));
+
+ CFX_ByteString sStream;
+ sStream.Format("q 1 0 0 1 0 0 cm /%s Do Q", (FX_LPCSTR)key);
+ pNewContents->SetData((FX_LPCBYTE)sStream, sStream.GetLength(), FALSE, FALSE);
+ }
+ return;
+ }
+
+ int iType = pContentsObj->GetType();
+ CPDF_Array* pContentsArray = NULL;
+
+ switch(iType)
+ {
+ case PDFOBJ_STREAM:
+ {
+ pContentsArray = FX_NEW CPDF_Array;
+ CPDF_Stream* pContents = (CPDF_Stream*)pContentsObj;
+ FX_DWORD dwObjNum = pDocument->AddIndirectObject(pContents);
+ CPDF_StreamAcc acc;
+ acc.LoadAllData(pContents);
+ CFX_ByteString sStream = "q\n";
+ CFX_ByteString sBody = CFX_ByteString((FX_LPCSTR)acc.GetData(), acc.GetSize());
+ sStream = sStream + sBody + "\nQ";
+ pContents->SetData((FX_LPCBYTE)sStream, sStream.GetLength(), FALSE, FALSE);
+ pContentsArray->AddReference(pDocument, dwObjNum);
+ break;
+ }
+
+ case PDFOBJ_ARRAY:
+ {
+ pContentsArray = (CPDF_Array*)pContentsObj;
+ break;
+ }
+ default:
+ break;
+ }
+
+ if (!pContentsArray)return;
+
+ FX_DWORD dwObjNum = pDocument->AddIndirectObject(pContentsArray);
+ pPage->SetAtReference("Contents", pDocument, dwObjNum);
+
+ if (!key.IsEmpty())
+ {
+ CPDF_Stream* pNewContents = FX_NEW CPDF_Stream(NULL, 0, FX_NEW CPDF_Dictionary);
+ dwObjNum = pDocument->AddIndirectObject(pNewContents);
+ pContentsArray->AddReference(pDocument, dwObjNum);
+
+ CFX_ByteString sStream;
+ sStream.Format("q 1 0 0 1 0 0 cm /%s Do Q", (FX_LPCSTR)key);
+ pNewContents->SetData((FX_LPCBYTE)sStream, sStream.GetLength(), FALSE, FALSE);
+ }
+}
+
+CFX_AffineMatrix GetMatrix(CPDF_Rect rcAnnot, CPDF_Rect rcStream, CFX_AffineMatrix matrix)
+{
+ if(rcStream.IsEmpty())
+ return CFX_AffineMatrix();
+
+ matrix.TransformRect(rcStream);
+ rcStream.Normalize();
+
+ FX_FLOAT a = rcAnnot.Width()/rcStream.Width();
+ FX_FLOAT d = rcAnnot.Height()/rcStream.Height();
+
+ FX_FLOAT e = rcAnnot.left - rcStream.left * a;
+ FX_FLOAT f = rcAnnot.bottom - rcStream.bottom * d;
+ return CFX_AffineMatrix(a, 0, 0, d, e, f);
+}
+
+void GetOffset(FX_FLOAT& fa, FX_FLOAT& fd, FX_FLOAT& fe, FX_FLOAT& ff, CPDF_Rect rcAnnot, CPDF_Rect rcStream, CFX_AffineMatrix matrix)
+{
+ FX_FLOAT fStreamWidth = 0.0f;
+ FX_FLOAT fStreamHeight = 0.0f;
+
+
+
+ if (matrix.a != 0 && matrix.d != 0)
+ {
+ fStreamWidth = rcStream.right - rcStream.left;
+ fStreamHeight = rcStream.top - rcStream.bottom;
+ }
+ else
+ {
+ fStreamWidth = rcStream.top - rcStream.bottom;
+ fStreamHeight = rcStream.right - rcStream.left;
+ }
+
+ FX_FLOAT x1 = matrix.a * rcStream.left + matrix.c * rcStream.bottom + matrix.e;
+ FX_FLOAT y1 = matrix.b * rcStream.left + matrix.d * rcStream.bottom + matrix.f;
+ FX_FLOAT x2 = matrix.a * rcStream.left + matrix.c * rcStream.top + matrix.e;
+ FX_FLOAT y2 = matrix.b * rcStream.left + matrix.d * rcStream.top + matrix.f;
+ FX_FLOAT x3 = matrix.a * rcStream.right + matrix.c * rcStream.bottom + matrix.e;
+ FX_FLOAT y3 = matrix.b * rcStream.right + matrix.d * rcStream.bottom + matrix.f;
+ FX_FLOAT x4 = matrix.a * rcStream.right + matrix.c * rcStream.top + matrix.e;
+ FX_FLOAT y4 = matrix.b * rcStream.right + matrix.d * rcStream.top + matrix.f;
+
+ FX_FLOAT left = FX_MIN(FX_MIN(x1, x2), FX_MIN(x3, x4));
+ FX_FLOAT bottom = FX_MIN(FX_MIN(y1, y2), FX_MIN(y3, y4));
+
+ fa = (rcAnnot.right - rcAnnot.left)/fStreamWidth;
+ fd = (rcAnnot.top - rcAnnot.bottom)/fStreamHeight;
+ fe = rcAnnot.left - left * fa;
+ ff = rcAnnot.bottom - bottom * fd;
+}
+
+
+DLLEXPORT int STDCALL FPDFPage_Flatten( FPDF_PAGE page, int nFlag)
+{
+ if (!page)
+ {
+ return FLATTEN_FAIL;
+ }
+
+ CPDF_Page * pPage = (CPDF_Page*)( page );
+ CPDF_Document * pDocument = pPage->m_pDocument;
+ CPDF_Dictionary * pPageDict = pPage->m_pFormDict;
+
+ if ( !pDocument || !pPageDict )
+ {
+ return FLATTEN_FAIL;
+ }
+
+ CPDF_ObjectArray ObjectArray;
+ CPDF_RectArray RectArray;
+
+ int iRet = FLATTEN_FAIL;
+ iRet = ParserAnnots( pDocument, pPageDict, &RectArray, &ObjectArray, nFlag);
+ if (iRet == FLATTEN_NOTINGTODO)
+ {
+ return FLATTEN_NOTINGTODO;
+ }else if (iRet == FLATTEN_FAIL)
+ {
+ return FLATTEN_FAIL;
+ }
+
+ CPDF_Rect rcOriginalCB;
+ CPDF_Rect rcMerger = CalculateRect( &RectArray );
+ CPDF_Rect rcOriginalMB = pPageDict->GetRect("MediaBox");
+
+ if (pPageDict->KeyExist("CropBox"))
+ rcOriginalMB = pPageDict->GetRect("CropBox");
+
+ if (rcOriginalMB.IsEmpty())
+ {
+ rcOriginalMB = CPDF_Rect(0.0f, 0.0f, 612.0f, 792.0f);
+ }
+
+ rcMerger.left = rcMerger.left < rcOriginalMB.left? rcOriginalMB.left : rcMerger.left;
+ rcMerger.right = rcMerger.right > rcOriginalMB.right? rcOriginalMB.right : rcMerger.right;
+ rcMerger.top = rcMerger.top > rcOriginalMB.top? rcOriginalMB.top : rcMerger.top;
+ rcMerger.bottom = rcMerger.bottom < rcOriginalMB.bottom? rcOriginalMB.bottom : rcMerger.bottom;
+
+ if (pPageDict->KeyExist("ArtBox"))
+ rcOriginalCB = pPageDict->GetRect("ArtBox");
+ else
+ rcOriginalCB = rcOriginalMB;
+
+ if (!rcOriginalMB.IsEmpty())
+ {
+ CPDF_Array* pMediaBox = FX_NEW CPDF_Array();
+
+ pMediaBox->Add(FX_NEW CPDF_Number(rcOriginalMB.left));
+ pMediaBox->Add(FX_NEW CPDF_Number(rcOriginalMB.bottom));
+ pMediaBox->Add(FX_NEW CPDF_Number(rcOriginalMB.right));
+ pMediaBox->Add(FX_NEW CPDF_Number(rcOriginalMB.top));
+
+ pPageDict->SetAt("MediaBox",pMediaBox);
+ }
+
+ if (!rcOriginalCB.IsEmpty())
+ {
+ CPDF_Array* pCropBox = FX_NEW CPDF_Array();
+ pCropBox->Add(FX_NEW CPDF_Number(rcOriginalCB.left));
+ pCropBox->Add(FX_NEW CPDF_Number(rcOriginalCB.bottom));
+ pCropBox->Add(FX_NEW CPDF_Number(rcOriginalCB.right));
+ pCropBox->Add(FX_NEW CPDF_Number(rcOriginalCB.top));
+ pPageDict->SetAt("ArtBox", pCropBox);
+ }
+
+ CPDF_Dictionary* pRes = NULL;
+ pRes = pPageDict->GetDict("Resources");
+ if (!pRes)
+ {
+ pRes = FX_NEW CPDF_Dictionary;
+ pPageDict->SetAt( "Resources", pRes );
+ }
+
+ CPDF_Stream* pNewXObject = FX_NEW CPDF_Stream(NULL, 0, FX_NEW CPDF_Dictionary);
+ FX_DWORD dwObjNum = pDocument->AddIndirectObject(pNewXObject);
+ CPDF_Dictionary* pPageXObject = pRes->GetDict("XObject");
+ if (!pPageXObject)
+ {
+ pPageXObject = FX_NEW CPDF_Dictionary;
+ pRes->SetAt("XObject", pPageXObject);
+ }
+
+ CFX_ByteString key = "";
+ int nStreams = ObjectArray.GetSize();
+
+ if (nStreams > 0)
+ {
+ for (int iKey = 0; /*iKey < 100*/; iKey++)
+ {
+ char sExtend[5] = {0};
+ FXSYS_itoa(iKey, sExtend, 10);
+ key = CFX_ByteString("FFT") + CFX_ByteString(sExtend);
+
+ if (!pPageXObject->KeyExist(key))
+ break;
+ }
+ }
+
+ SetPageContents(key, pPageDict, pDocument);
+
+ CPDF_Dictionary* pNewXORes = NULL;
+
+ if (!key.IsEmpty())
+ {
+ pPageXObject->SetAtReference(key, pDocument, dwObjNum);
+ CPDF_Dictionary* pNewOXbjectDic = pNewXObject->GetDict();
+ pNewXORes = FX_NEW CPDF_Dictionary;
+ pNewOXbjectDic->SetAt("Resources", pNewXORes);
+ pNewOXbjectDic->SetAtName("Type", "XObject");
+ pNewOXbjectDic->SetAtName("Subtype", "Form");
+ pNewOXbjectDic->SetAtInteger("FormType", 1);
+ pNewOXbjectDic->SetAtName("Name", "FRM");
+ CPDF_Rect rcBBox = pPageDict->GetRect("ArtBox");
+ pNewOXbjectDic->SetAtRect("BBox", rcBBox);
+ }
+
+ for (int i = 0; i < nStreams; i++)
+ {
+ CPDF_Dictionary* pAnnotDic = ObjectArray.GetAt(i);
+ if (!pAnnotDic)continue;
+
+ CPDF_Rect rcAnnot = pAnnotDic->GetRect("Rect");
+ rcAnnot.Normalize();
+
+ CFX_ByteString sAnnotState = pAnnotDic->GetString("AS");
+ CPDF_Dictionary* pAnnotAP = pAnnotDic->GetDict("AP");
+ if (!pAnnotAP)continue;
+
+ CPDF_Stream* pAPStream = pAnnotAP->GetStream("N");
+ if (!pAPStream)
+ {
+ CPDF_Dictionary* pAPDic = pAnnotAP->GetDict("N");
+ if (!pAPDic)continue;
+
+ if (!sAnnotState.IsEmpty())
+ {
+ pAPStream = pAPDic->GetStream(sAnnotState);
+ }
+ else
+ {
+ FX_POSITION pos = pAPDic->GetStartPos();
+ if (pos)
+ {
+ CFX_ByteString sKey;
+ CPDF_Object* pFirstObj = pAPDic->GetNextElement(pos, sKey);
+ if (pFirstObj)
+ {
+ if (pFirstObj->GetType() == PDFOBJ_REFERENCE)
+ pFirstObj = pFirstObj->GetDirect();
+
+ if (pFirstObj->GetType() != PDFOBJ_STREAM)
+ continue;
+
+ pAPStream = (CPDF_Stream*)pFirstObj;
+ }
+ }
+ }
+ }
+
+ if (!pAPStream)continue;
+
+ CPDF_Dictionary* pAPDic = pAPStream->GetDict();
+ CFX_AffineMatrix matrix = pAPDic->GetMatrix("Matrix");
+
+ CPDF_Rect rcStream;
+ if (pAPDic->KeyExist("Rect"))
+ rcStream = pAPDic->GetRect("Rect");
+ else if (pAPDic->KeyExist("BBox"))
+ rcStream = pAPDic->GetRect("BBox");
+
+ if (rcStream.IsEmpty())continue;
+
+ CPDF_Object* pObj = pAPStream;
+
+ if (pObj)
+ {
+ CPDF_Dictionary* pObjDic = pObj->GetDict();
+ if (pObjDic)
+ {
+ pObjDic->SetAtName("Type", "XObject");
+ pObjDic->SetAtName("Subtype", "Form");
+ }
+ }
+
+ CPDF_Dictionary* pXObject = pNewXORes->GetDict("XObject");
+ if (!pXObject)
+ {
+ pXObject = FX_NEW CPDF_Dictionary;
+ pNewXORes->SetAt("XObject", pXObject);
+ }
+
+ CFX_ByteString sFormName;
+ sFormName.Format("F%d", i);
+ FX_DWORD dwObjNum = pDocument->AddIndirectObject(pObj);
+ pXObject->SetAtReference(sFormName, pDocument, dwObjNum);
+
+ CPDF_StreamAcc acc;
+ acc.LoadAllData(pNewXObject);
+
+ FX_LPCBYTE pData = acc.GetData();
+ CFX_ByteString sStream(pData, acc.GetSize());
+ CFX_ByteString sTemp;
+
+ if (matrix.IsIdentity())
+ {
+ matrix.a = 1.0f;
+ matrix.b = 0.0f;
+ matrix.c = 0.0f;
+ matrix.d = 1.0f;
+ matrix.e = 0.0f;
+ matrix.f = 0.0f;
+ }
+
+ CFX_AffineMatrix m = GetMatrix(rcAnnot, rcStream, matrix);
+ sTemp.Format("q %f 0 0 %f %f %f cm /%s Do Q\n", m.a, m.d, m.e, m.f, (FX_LPCSTR)sFormName);
+ sStream += sTemp;
+
+ pNewXObject->SetData((FX_LPCBYTE)sStream, sStream.GetLength(), FALSE, FALSE);
+ }
+ pPageDict->RemoveAt( "Annots" );
+
+ ObjectArray.RemoveAll();
+ RectArray.RemoveAll();
+
+ return FLATTEN_SUCCESS;
+}
diff --git a/fpdfsdk/src/fpdf_progressive.cpp b/fpdfsdk/src/fpdf_progressive.cpp
index 29496e05dc..b6691af82d 100644
--- a/fpdfsdk/src/fpdf_progressive.cpp
+++ b/fpdfsdk/src/fpdf_progressive.cpp
@@ -1,114 +1,114 @@
-// 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
-
-#include "../include/fpdf_progressive.h"
-#include "../include/fsdk_define.h"
-#include "../include/fpdfview.h"
-#include "../include/fsdk_rendercontext.h"
-
-extern void (*Func_RenderPage)( CRenderContext*, FPDF_PAGE page, int start_x, int start_y, int size_x, int size_y,
- int rotate, int flags,FX_BOOL bNeedToRestore, IFSDK_PAUSE_Adapter * pause );
-
-extern void DropContext(void* data);
-
-DLLEXPORT int STDCALL FPDF_RenderPageBitmap_Start( FPDF_BITMAP bitmap, FPDF_PAGE page,
- int start_x, int start_y, int size_x,
- int size_y, int rotate, int flags,
- IFSDK_PAUSE * pause )
-{
- if (bitmap == NULL || page == NULL)
- return FPDF_RENDER_FAILED;
-
- if (!pause)
- return FPDF_RENDER_FAILED;
-
- if (pause->version !=1)
- return FPDF_RENDER_FAILED;
-
- CPDF_Page* pPage = (CPDF_Page*)page;
-
-// FXMT_CSLOCK_OBJ(&pPage->m_PageLock);
-
- CRenderContext* pContext = FX_NEW CRenderContext;
- pPage->SetPrivateData((void*)1, pContext, DropContext );
-#ifdef _SKIA_SUPPORT_
- pContext->m_pDevice = FX_NEW CFX_SkiaDevice;
- if (flags & FPDF_REVERSE_BYTE_ORDER)
- ((CFX_SkiaDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bitmap,0,TRUE);
- else
- ((CFX_SkiaDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bitmap);
-#else
- pContext->m_pDevice = FX_NEW CFX_FxgeDevice;
- if (flags & FPDF_REVERSE_BYTE_ORDER)
- ((CFX_FxgeDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bitmap,0,TRUE);
- else
- ((CFX_FxgeDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bitmap);
-#endif
- IFSDK_PAUSE_Adapter IPauseAdapter(pause);
-
- if (flags & FPDF_NO_CATCH)
- Func_RenderPage(pContext, page, start_x, start_y, size_x, size_y, rotate, flags,FALSE, &IPauseAdapter);
- else {
- try {
- Func_RenderPage(pContext, page, start_x, start_y, size_x, size_y, rotate, flags,FALSE, &IPauseAdapter);
- }
- catch (...){}
- }
-
- if ( pContext->m_pRenderer )
- {
- CPDF_ProgressiveRenderer::RenderStatus status = CPDF_ProgressiveRenderer::Failed;
- status = pContext->m_pRenderer->GetStatus();
- return status;
- }
- return FPDF_RENDER_FAILED;
-}
-
-DLLEXPORT int STDCALL FPDF_RenderPage_Continue(FPDF_PAGE page,IFSDK_PAUSE * pause)
-{
- if (page == NULL)
- return FPDF_RENDER_FAILED;
-
- if (!pause)
- return FPDF_RENDER_FAILED;
-
- if (pause->version !=1)
- return FPDF_RENDER_FAILED;
-
- CPDF_Page* pPage = (CPDF_Page*)page;
-
-// FXMT_CSLOCK_OBJ(&pPage->m_PageLock);
-
- CRenderContext * pContext = (CRenderContext*)pPage->GetPrivateData((void*)1);
- if (pContext && pContext->m_pRenderer)
- {
- IFSDK_PAUSE_Adapter IPauseAdapter(pause);
- pContext->m_pRenderer->Continue(&IPauseAdapter);
-
- CPDF_ProgressiveRenderer::RenderStatus status = CPDF_ProgressiveRenderer::Failed;
- status = pContext->m_pRenderer->GetStatus();
- return status;
- }
- return FPDF_RENDER_FAILED;
-}
-
-
-DLLEXPORT void STDCALL FPDF_RenderPage_Close(FPDF_PAGE page)
-{
- if (page == NULL) return;
- CPDF_Page* pPage = (CPDF_Page*)page;
-
-// FXMT_CSLOCK_OBJ(&pPage->m_PageLock);
-
- CRenderContext * pContext = (CRenderContext*)pPage->GetPrivateData((void*)1);
- if (pContext)
- {
- pContext->m_pDevice->RestoreState();
- delete pContext;
- pPage->RemovePrivateData((void*)1);
- }
-}
-
+// 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
+
+#include "../include/fpdf_progressive.h"
+#include "../include/fsdk_define.h"
+#include "../include/fpdfview.h"
+#include "../include/fsdk_rendercontext.h"
+
+extern void (*Func_RenderPage)( CRenderContext*, FPDF_PAGE page, int start_x, int start_y, int size_x, int size_y,
+ int rotate, int flags,FX_BOOL bNeedToRestore, IFSDK_PAUSE_Adapter * pause );
+
+extern void DropContext(void* data);
+
+DLLEXPORT int STDCALL FPDF_RenderPageBitmap_Start( FPDF_BITMAP bitmap, FPDF_PAGE page,
+ int start_x, int start_y, int size_x,
+ int size_y, int rotate, int flags,
+ IFSDK_PAUSE * pause )
+{
+ if (bitmap == NULL || page == NULL)
+ return FPDF_RENDER_FAILED;
+
+ if (!pause)
+ return FPDF_RENDER_FAILED;
+
+ if (pause->version !=1)
+ return FPDF_RENDER_FAILED;
+
+ CPDF_Page* pPage = (CPDF_Page*)page;
+
+// FXMT_CSLOCK_OBJ(&pPage->m_PageLock);
+
+ CRenderContext* pContext = FX_NEW CRenderContext;
+ pPage->SetPrivateData((void*)1, pContext, DropContext );
+#ifdef _SKIA_SUPPORT_
+ pContext->m_pDevice = FX_NEW CFX_SkiaDevice;
+ if (flags & FPDF_REVERSE_BYTE_ORDER)
+ ((CFX_SkiaDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bitmap,0,TRUE);
+ else
+ ((CFX_SkiaDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bitmap);
+#else
+ pContext->m_pDevice = FX_NEW CFX_FxgeDevice;
+ if (flags & FPDF_REVERSE_BYTE_ORDER)
+ ((CFX_FxgeDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bitmap,0,TRUE);
+ else
+ ((CFX_FxgeDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bitmap);
+#endif
+ IFSDK_PAUSE_Adapter IPauseAdapter(pause);
+
+ if (flags & FPDF_NO_CATCH)
+ Func_RenderPage(pContext, page, start_x, start_y, size_x, size_y, rotate, flags,FALSE, &IPauseAdapter);
+ else {
+ try {
+ Func_RenderPage(pContext, page, start_x, start_y, size_x, size_y, rotate, flags,FALSE, &IPauseAdapter);
+ }
+ catch (...){}
+ }
+
+ if ( pContext->m_pRenderer )
+ {
+ CPDF_ProgressiveRenderer::RenderStatus status = CPDF_ProgressiveRenderer::Failed;
+ status = pContext->m_pRenderer->GetStatus();
+ return status;
+ }
+ return FPDF_RENDER_FAILED;
+}
+
+DLLEXPORT int STDCALL FPDF_RenderPage_Continue(FPDF_PAGE page,IFSDK_PAUSE * pause)
+{
+ if (page == NULL)
+ return FPDF_RENDER_FAILED;
+
+ if (!pause)
+ return FPDF_RENDER_FAILED;
+
+ if (pause->version !=1)
+ return FPDF_RENDER_FAILED;
+
+ CPDF_Page* pPage = (CPDF_Page*)page;
+
+// FXMT_CSLOCK_OBJ(&pPage->m_PageLock);
+
+ CRenderContext * pContext = (CRenderContext*)pPage->GetPrivateData((void*)1);
+ if (pContext && pContext->m_pRenderer)
+ {
+ IFSDK_PAUSE_Adapter IPauseAdapter(pause);
+ pContext->m_pRenderer->Continue(&IPauseAdapter);
+
+ CPDF_ProgressiveRenderer::RenderStatus status = CPDF_ProgressiveRenderer::Failed;
+ status = pContext->m_pRenderer->GetStatus();
+ return status;
+ }
+ return FPDF_RENDER_FAILED;
+}
+
+
+DLLEXPORT void STDCALL FPDF_RenderPage_Close(FPDF_PAGE page)
+{
+ if (page == NULL) return;
+ CPDF_Page* pPage = (CPDF_Page*)page;
+
+// FXMT_CSLOCK_OBJ(&pPage->m_PageLock);
+
+ CRenderContext * pContext = (CRenderContext*)pPage->GetPrivateData((void*)1);
+ if (pContext)
+ {
+ pContext->m_pDevice->RestoreState();
+ delete pContext;
+ pPage->RemovePrivateData((void*)1);
+ }
+}
+
diff --git a/fpdfsdk/src/fpdf_searchex.cpp b/fpdfsdk/src/fpdf_searchex.cpp
index 540cd552fa..21831a3e3d 100644
--- a/fpdfsdk/src/fpdf_searchex.cpp
+++ b/fpdfsdk/src/fpdf_searchex.cpp
@@ -1,15 +1,15 @@
-// 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
-
-#include "../include/fsdk_define.h"
-#include "../include/fpdf_searchex.h"
-
-
-DLLEXPORT int STDCALL FPDFText_GetCharIndexFromTextIndex(FPDF_TEXTPAGE text_page, int nTextIndex)
-{
- if(!text_page) return -1;
- return ((IPDF_TextPage*)text_page)->CharIndexFromTextIndex(nTextIndex);
-}
+// 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
+
+#include "../include/fsdk_define.h"
+#include "../include/fpdf_searchex.h"
+
+
+DLLEXPORT int STDCALL FPDFText_GetCharIndexFromTextIndex(FPDF_TEXTPAGE text_page, int nTextIndex)
+{
+ if(!text_page) return -1;
+ return ((IPDF_TextPage*)text_page)->CharIndexFromTextIndex(nTextIndex);
+}
diff --git a/fpdfsdk/src/fpdf_transformpage.cpp b/fpdfsdk/src/fpdf_transformpage.cpp
index f171c5e526..729b1cd9bb 100644
--- a/fpdfsdk/src/fpdf_transformpage.cpp
+++ b/fpdfsdk/src/fpdf_transformpage.cpp
@@ -1,325 +1,325 @@
-// 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
-
-#include "../include/fsdk_define.h"
-#include "../include/fpdf_transformpage.h"
-
-DLLEXPORT void STDCALL FPDFPage_SetMediaBox(FPDF_PAGE page, float left, float bottom, float right, float top)
-{
- if(!page)
- return;
- CPDF_Page* pPage = (CPDF_Page*)page;
- CPDF_Dictionary* pPageDict = pPage->m_pFormDict;
- CPDF_Array* pMediaBoxArray = FX_NEW CPDF_Array;
- pMediaBoxArray->Add(FX_NEW CPDF_Number(left));
- pMediaBoxArray->Add(FX_NEW CPDF_Number(bottom));
- pMediaBoxArray->Add(FX_NEW CPDF_Number(FX_FLOAT(right)));
- pMediaBoxArray->Add(FX_NEW CPDF_Number(FX_FLOAT(top)));
-
- pPageDict->SetAt("MediaBox", pMediaBoxArray);
-}
-
-
-DLLEXPORT void STDCALL FPDFPage_SetCropBox(FPDF_PAGE page, float left, float bottom, float right, float top)
-{
- if(!page)
- return;
- CPDF_Page* pPage = (CPDF_Page*)page;
- CPDF_Dictionary* pPageDict = pPage->m_pFormDict;
- CPDF_Array* pCropBoxArray = FX_NEW CPDF_Array;
- pCropBoxArray->Add(FX_NEW CPDF_Number(left));
- pCropBoxArray->Add(FX_NEW CPDF_Number(bottom));
- pCropBoxArray->Add(FX_NEW CPDF_Number(FX_FLOAT(right)));
- pCropBoxArray->Add(FX_NEW CPDF_Number(FX_FLOAT(top)));
-
-
- pPageDict->SetAt("CropBox", pCropBoxArray);
-}
-
-
-DLLEXPORT FX_BOOL STDCALL FPDFPage_GetMediaBox(FPDF_PAGE page, float* left, float* bottom, float* right, float* top)
-{
- if(!page)
- return FALSE;
- CPDF_Page* pPage = (CPDF_Page*)page;
- CPDF_Dictionary* pPageDict = pPage->m_pFormDict;
- CPDF_Array* pArray = pPageDict->GetArray("MediaBox");
- if(pArray)
- {
- *left = pArray->GetFloat(0);
- *bottom = pArray->GetFloat(1);
- *right = pArray->GetFloat(2);
- *top = pArray->GetFloat(3);
- return TRUE;
- }
- return FALSE;
-}
-
-DLLEXPORT FPDF_BOOL STDCALL FPDFPage_GetCropBox(FPDF_PAGE page, float* left, float* bottom, float* right, float* top)
-{
- if(!page)
- return FALSE;
- CPDF_Page* pPage = (CPDF_Page*)page;
- CPDF_Dictionary* pPageDict = pPage->m_pFormDict;
- CPDF_Array* pArray = pPageDict->GetArray("CropBox");
- if(pArray)
- {
- *left = pArray->GetFloat(0);
- *bottom = pArray->GetFloat(1);
- *right = pArray->GetFloat(2);
- *top = pArray->GetFloat(3);
- return TRUE;
- }
- return FALSE;
-}
-
-DLLEXPORT FPDF_BOOL STDCALL FPDFPage_TransFormWithClip(FPDF_PAGE page, FS_MATRIX* matrix, FS_RECTF* clipRect)
-{
- if(!page)
- return FALSE;
-
- CFX_ByteTextBuf textBuf;
- textBuf<<"q ";
- CFX_FloatRect rect(clipRect->left, clipRect->bottom, clipRect->right, clipRect->top);
- rect.Normalize();
- CFX_ByteString bsClipping;
- bsClipping.Format("%f %f %f %f re W* n ", rect.left, rect.bottom, rect.Width(), rect.Height());
- textBuf<<bsClipping;
-
- CFX_ByteString bsMatix;
- bsMatix.Format("%f %f %f %f %f %f cm ", matrix->a, matrix->b,matrix->c,matrix->d,matrix->e,matrix->f);
- textBuf<<bsMatix;
-
-
- CPDF_Page* pPage = (CPDF_Page*)page;
- CPDF_Dictionary* pPageDic = pPage->m_pFormDict;
- CPDF_Object* pContentObj = pPageDic->GetElement("Contents");
- if(!pContentObj)
- pContentObj = pPageDic->GetArray("Contents");
- if(!pContentObj)
- return FALSE;
-
- CPDF_Dictionary* pDic = FX_NEW CPDF_Dictionary;
- CPDF_Stream* pStream = FX_NEW CPDF_Stream(NULL,0, pDic);
- pStream->SetData(textBuf.GetBuffer(), textBuf.GetSize(), FALSE, FALSE);
- CPDF_Document* pDoc = pPage->m_pDocument;
- if(!pDoc)
- return FALSE;
- pDoc->AddIndirectObject(pStream);
-
- pDic = FX_NEW CPDF_Dictionary;
- CPDF_Stream* pEndStream = FX_NEW CPDF_Stream(NULL,0, pDic);
- pEndStream->SetData((FX_LPCBYTE)" Q", 2, FALSE, FALSE);
- pDoc->AddIndirectObject(pEndStream);
-
- CPDF_Array* pContentArray = NULL;
- if (pContentObj && pContentObj->GetType() == PDFOBJ_ARRAY)
- {
- pContentArray = (CPDF_Array*)pContentObj;
- CPDF_Reference* pRef = FX_NEW CPDF_Reference(pDoc, pStream->GetObjNum());
- pContentArray->InsertAt(0, pRef);
- pContentArray->AddReference(pDoc,pEndStream);
-
- }
- else if(pContentObj && pContentObj->GetType() == PDFOBJ_REFERENCE)
- {
- CPDF_Reference* pReference = (CPDF_Reference*)pContentObj;
- CPDF_Object* pDirectObj = pReference->GetDirect();
- if(pDirectObj != NULL)
- {
- if(pDirectObj->GetType() == PDFOBJ_ARRAY)
- {
- pContentArray = (CPDF_Array*)pDirectObj;
- CPDF_Reference* pRef = FX_NEW CPDF_Reference(pDoc, pStream->GetObjNum());
- pContentArray->InsertAt(0, pRef);
- pContentArray->AddReference(pDoc,pEndStream);
-
- }
- else if(pDirectObj->GetType() == PDFOBJ_STREAM)
- {
- pContentArray = FX_NEW CPDF_Array();
- pContentArray->AddReference(pDoc,pStream->GetObjNum());
- pContentArray->AddReference(pDoc,pDirectObj->GetObjNum());
- pContentArray->AddReference(pDoc, pEndStream);
- pPageDic->SetAtReference("Contents", pDoc, pDoc->AddIndirectObject(pContentArray));
- }
- }
- }
-
- //Need to transform the patterns as well.
- CPDF_Dictionary* pRes = pPageDic->GetDict(FX_BSTRC("Resources"));
- if(pRes)
- {
- CPDF_Dictionary* pPattenDict = pRes->GetDict(FX_BSTRC("Pattern"));
- if(pPattenDict)
- {
- FX_POSITION pos = pPattenDict->GetStartPos();
- while(pos)
- {
- CPDF_Dictionary* pDict = NULL;
- CFX_ByteString key;
- CPDF_Object* pObj = pPattenDict->GetNextElement(pos, key);
- if(pObj->GetType() == PDFOBJ_REFERENCE)
- pObj = pObj->GetDirect();
- if(pObj->GetType() == PDFOBJ_DICTIONARY)
- {
- pDict = (CPDF_Dictionary*)pObj;
- }
- else if(pObj->GetType() == PDFOBJ_STREAM)
- {
- pDict = ((CPDF_Stream*)pObj)->GetDict();
- }
- else
- continue;
-
- CFX_AffineMatrix m = pDict->GetMatrix(FX_BSTRC("Matrix"));
- CFX_AffineMatrix t = *(CFX_AffineMatrix*)matrix;
- m.Concat(t);
- pDict->SetAtMatrix(FX_BSTRC("Matrix"), m);
- }
- }
- }
-
- return TRUE;
-}
-
-DLLEXPORT void STDCALL FPDFPageObj_TransformClipPath(FPDF_PAGEOBJECT page_object,double a, double b, double c, double d, double e, double f)
-{
- CPDF_PageObject* pPageObj = (CPDF_PageObject*)page_object;
- if(pPageObj == NULL)
- return;
- CFX_AffineMatrix matrix((FX_FLOAT)a,(FX_FLOAT)b,(FX_FLOAT)c,(FX_FLOAT)d,(FX_FLOAT)e,(FX_FLOAT)f);
-
- //Special treatment to shading object, because the ClipPath for shading object is already transformed.
- if(pPageObj->m_Type != PDFPAGE_SHADING)
- pPageObj->TransformClipPath(matrix);
- pPageObj->TransformGeneralState(matrix);
-}
-
-
-DLLEXPORT FPDF_CLIPPATH STDCALL FPDF_CreateClipPath(float left, float bottom, float right, float top)
-{
- CPDF_ClipPath* pNewClipPath = FX_NEW CPDF_ClipPath();
- pNewClipPath->GetModify();
- CPDF_Path Path;
- Path.GetModify();
- Path.AppendRect(left, bottom, right, top);
- pNewClipPath->AppendPath(Path, FXFILL_ALTERNATE, FALSE);
- return pNewClipPath;
-}
-
-DLLEXPORT void STDCALL FPDF_DestroyClipPath(FPDF_CLIPPATH clipPath)
-{
- if(clipPath)
- delete (CPDF_ClipPath*)clipPath;
-}
-
-void OutputPath(CFX_ByteTextBuf& buf, CPDF_Path path)
-{
- const CFX_PathData* pPathData = path;
- if (pPathData == NULL) return;
-
- FX_PATHPOINT* pPoints = pPathData->GetPoints();
-
- if (path.IsRect()) {
- buf << (pPoints[0].m_PointX) << " " << (pPoints[0].m_PointY) << " "
- << (pPoints[2].m_PointX - pPoints[0].m_PointX) << " "
- << (pPoints[2].m_PointY - pPoints[0].m_PointY) << " re\n";
- return;
- }
-
- CFX_ByteString temp;
- for (int i = 0; i < pPathData->GetPointCount(); i ++) {
- buf << (pPoints[i].m_PointX) << " " << (pPoints[i].m_PointY);
- int point_type = pPoints[i].m_Flag & FXPT_TYPE;
- if (point_type == FXPT_MOVETO)
- buf << " m\n";
- else if (point_type == FXPT_BEZIERTO) {
- buf << " " << (pPoints[i+1].m_PointX) << " " << (pPoints[i+1].m_PointY) << " " <<
- (pPoints[i+2].m_PointX) << " " << (pPoints[i+2].m_PointY);
- if (pPoints[i+2].m_Flag & FXPT_CLOSEFIGURE)
- buf << " c h\n";
- else
- buf << " c\n";
- i += 2;
- } else if (point_type == FXPT_LINETO) {
- if (pPoints[i].m_Flag & FXPT_CLOSEFIGURE)
- buf << " l h\n";
- else
- buf << " l\n";
- }
- }
-}
-
-DLLEXPORT void STDCALL FPDFPage_InsertClipPath(FPDF_PAGE page,FPDF_CLIPPATH clipPath)
-{
- if(!page)
- return;
- CPDF_Page* pPage = (CPDF_Page*)page;
- CPDF_Dictionary* pPageDic = pPage->m_pFormDict;
- CPDF_Object* pContentObj = pPageDic->GetElement("Contents");
- if(!pContentObj)
- pContentObj = pPageDic->GetArray("Contents");
- if(!pContentObj)
- return;
-
- CFX_ByteTextBuf strClip;
- CPDF_ClipPath* pClipPath = (CPDF_ClipPath*)clipPath;
- FX_DWORD i;
- for (i = 0; i < pClipPath->GetPathCount(); i ++) {
- CPDF_Path path = pClipPath->GetPath(i);
- int iClipType = pClipPath->GetClipType(i);
- if (path.GetPointCount() == 0) {
- // Empty clipping (totally clipped out)
- strClip << "0 0 m W n ";
- } else {
- OutputPath(strClip, path);
- if (iClipType == FXFILL_WINDING)
- strClip << "W n\n";
- else
- strClip << "W* n\n";
- }
- }
- CPDF_Dictionary* pDic = FX_NEW CPDF_Dictionary;
- CPDF_Stream* pStream = FX_NEW CPDF_Stream(NULL,0, pDic);
- pStream->SetData(strClip.GetBuffer(), strClip.GetSize(), FALSE, FALSE);
- CPDF_Document* pDoc = pPage->m_pDocument;
- if(!pDoc)
- return;
- pDoc->AddIndirectObject(pStream);
-
- CPDF_Array* pContentArray = NULL;
- if (pContentObj && pContentObj->GetType() == PDFOBJ_ARRAY)
- {
- pContentArray = (CPDF_Array*)pContentObj;
- CPDF_Reference* pRef = FX_NEW CPDF_Reference(pDoc, pStream->GetObjNum());
- pContentArray->InsertAt(0, pRef);
-
- }
- else if(pContentObj && pContentObj->GetType() == PDFOBJ_REFERENCE)
- {
- CPDF_Reference* pReference = (CPDF_Reference*)pContentObj;
- CPDF_Object* pDirectObj = pReference->GetDirect();
- if(pDirectObj != NULL)
- {
- if(pDirectObj->GetType() == PDFOBJ_ARRAY)
- {
- pContentArray = (CPDF_Array*)pDirectObj;
- CPDF_Reference* pRef = FX_NEW CPDF_Reference(pDoc, pStream->GetObjNum());
- pContentArray->InsertAt(0, pRef);
-
- }
- else if(pDirectObj->GetType() == PDFOBJ_STREAM)
- {
- pContentArray = FX_NEW CPDF_Array();
- pContentArray->AddReference(pDoc,pStream->GetObjNum());
- pContentArray->AddReference(pDoc,pDirectObj->GetObjNum());
- pPageDic->SetAtReference("Contents", pDoc, pDoc->AddIndirectObject(pContentArray));
- }
- }
- }
-}
-
+// 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
+
+#include "../include/fsdk_define.h"
+#include "../include/fpdf_transformpage.h"
+
+DLLEXPORT void STDCALL FPDFPage_SetMediaBox(FPDF_PAGE page, float left, float bottom, float right, float top)
+{
+ if(!page)
+ return;
+ CPDF_Page* pPage = (CPDF_Page*)page;
+ CPDF_Dictionary* pPageDict = pPage->m_pFormDict;
+ CPDF_Array* pMediaBoxArray = FX_NEW CPDF_Array;
+ pMediaBoxArray->Add(FX_NEW CPDF_Number(left));
+ pMediaBoxArray->Add(FX_NEW CPDF_Number(bottom));
+ pMediaBoxArray->Add(FX_NEW CPDF_Number(FX_FLOAT(right)));
+ pMediaBoxArray->Add(FX_NEW CPDF_Number(FX_FLOAT(top)));
+
+ pPageDict->SetAt("MediaBox", pMediaBoxArray);
+}
+
+
+DLLEXPORT void STDCALL FPDFPage_SetCropBox(FPDF_PAGE page, float left, float bottom, float right, float top)
+{
+ if(!page)
+ return;
+ CPDF_Page* pPage = (CPDF_Page*)page;
+ CPDF_Dictionary* pPageDict = pPage->m_pFormDict;
+ CPDF_Array* pCropBoxArray = FX_NEW CPDF_Array;
+ pCropBoxArray->Add(FX_NEW CPDF_Number(left));
+ pCropBoxArray->Add(FX_NEW CPDF_Number(bottom));
+ pCropBoxArray->Add(FX_NEW CPDF_Number(FX_FLOAT(right)));
+ pCropBoxArray->Add(FX_NEW CPDF_Number(FX_FLOAT(top)));
+
+
+ pPageDict->SetAt("CropBox", pCropBoxArray);
+}
+
+
+DLLEXPORT FX_BOOL STDCALL FPDFPage_GetMediaBox(FPDF_PAGE page, float* left, float* bottom, float* right, float* top)
+{
+ if(!page)
+ return FALSE;
+ CPDF_Page* pPage = (CPDF_Page*)page;
+ CPDF_Dictionary* pPageDict = pPage->m_pFormDict;
+ CPDF_Array* pArray = pPageDict->GetArray("MediaBox");
+ if(pArray)
+ {
+ *left = pArray->GetFloat(0);
+ *bottom = pArray->GetFloat(1);
+ *right = pArray->GetFloat(2);
+ *top = pArray->GetFloat(3);
+ return TRUE;
+ }
+ return FALSE;
+}
+
+DLLEXPORT FPDF_BOOL STDCALL FPDFPage_GetCropBox(FPDF_PAGE page, float* left, float* bottom, float* right, float* top)
+{
+ if(!page)
+ return FALSE;
+ CPDF_Page* pPage = (CPDF_Page*)page;
+ CPDF_Dictionary* pPageDict = pPage->m_pFormDict;
+ CPDF_Array* pArray = pPageDict->GetArray("CropBox");
+ if(pArray)
+ {
+ *left = pArray->GetFloat(0);
+ *bottom = pArray->GetFloat(1);
+ *right = pArray->GetFloat(2);
+ *top = pArray->GetFloat(3);
+ return TRUE;
+ }
+ return FALSE;
+}
+
+DLLEXPORT FPDF_BOOL STDCALL FPDFPage_TransFormWithClip(FPDF_PAGE page, FS_MATRIX* matrix, FS_RECTF* clipRect)
+{
+ if(!page)
+ return FALSE;
+
+ CFX_ByteTextBuf textBuf;
+ textBuf<<"q ";
+ CFX_FloatRect rect(clipRect->left, clipRect->bottom, clipRect->right, clipRect->top);
+ rect.Normalize();
+ CFX_ByteString bsClipping;
+ bsClipping.Format("%f %f %f %f re W* n ", rect.left, rect.bottom, rect.Width(), rect.Height());
+ textBuf<<bsClipping;
+
+ CFX_ByteString bsMatix;
+ bsMatix.Format("%f %f %f %f %f %f cm ", matrix->a, matrix->b,matrix->c,matrix->d,matrix->e,matrix->f);
+ textBuf<<bsMatix;
+
+
+ CPDF_Page* pPage = (CPDF_Page*)page;
+ CPDF_Dictionary* pPageDic = pPage->m_pFormDict;
+ CPDF_Object* pContentObj = pPageDic->GetElement("Contents");
+ if(!pContentObj)
+ pContentObj = pPageDic->GetArray("Contents");
+ if(!pContentObj)
+ return FALSE;
+
+ CPDF_Dictionary* pDic = FX_NEW CPDF_Dictionary;
+ CPDF_Stream* pStream = FX_NEW CPDF_Stream(NULL,0, pDic);
+ pStream->SetData(textBuf.GetBuffer(), textBuf.GetSize(), FALSE, FALSE);
+ CPDF_Document* pDoc = pPage->m_pDocument;
+ if(!pDoc)
+ return FALSE;
+ pDoc->AddIndirectObject(pStream);
+
+ pDic = FX_NEW CPDF_Dictionary;
+ CPDF_Stream* pEndStream = FX_NEW CPDF_Stream(NULL,0, pDic);
+ pEndStream->SetData((FX_LPCBYTE)" Q", 2, FALSE, FALSE);
+ pDoc->AddIndirectObject(pEndStream);
+
+ CPDF_Array* pContentArray = NULL;
+ if (pContentObj && pContentObj->GetType() == PDFOBJ_ARRAY)
+ {
+ pContentArray = (CPDF_Array*)pContentObj;
+ CPDF_Reference* pRef = FX_NEW CPDF_Reference(pDoc, pStream->GetObjNum());
+ pContentArray->InsertAt(0, pRef);
+ pContentArray->AddReference(pDoc,pEndStream);
+
+ }
+ else if(pContentObj && pContentObj->GetType() == PDFOBJ_REFERENCE)
+ {
+ CPDF_Reference* pReference = (CPDF_Reference*)pContentObj;
+ CPDF_Object* pDirectObj = pReference->GetDirect();
+ if(pDirectObj != NULL)
+ {
+ if(pDirectObj->GetType() == PDFOBJ_ARRAY)
+ {
+ pContentArray = (CPDF_Array*)pDirectObj;
+ CPDF_Reference* pRef = FX_NEW CPDF_Reference(pDoc, pStream->GetObjNum());
+ pContentArray->InsertAt(0, pRef);
+ pContentArray->AddReference(pDoc,pEndStream);
+
+ }
+ else if(pDirectObj->GetType() == PDFOBJ_STREAM)
+ {
+ pContentArray = FX_NEW CPDF_Array();
+ pContentArray->AddReference(pDoc,pStream->GetObjNum());
+ pContentArray->AddReference(pDoc,pDirectObj->GetObjNum());
+ pContentArray->AddReference(pDoc, pEndStream);
+ pPageDic->SetAtReference("Contents", pDoc, pDoc->AddIndirectObject(pContentArray));
+ }
+ }
+ }
+
+ //Need to transform the patterns as well.
+ CPDF_Dictionary* pRes = pPageDic->GetDict(FX_BSTRC("Resources"));
+ if(pRes)
+ {
+ CPDF_Dictionary* pPattenDict = pRes->GetDict(FX_BSTRC("Pattern"));
+ if(pPattenDict)
+ {
+ FX_POSITION pos = pPattenDict->GetStartPos();
+ while(pos)
+ {
+ CPDF_Dictionary* pDict = NULL;
+ CFX_ByteString key;
+ CPDF_Object* pObj = pPattenDict->GetNextElement(pos, key);
+ if(pObj->GetType() == PDFOBJ_REFERENCE)
+ pObj = pObj->GetDirect();
+ if(pObj->GetType() == PDFOBJ_DICTIONARY)
+ {
+ pDict = (CPDF_Dictionary*)pObj;
+ }
+ else if(pObj->GetType() == PDFOBJ_STREAM)
+ {
+ pDict = ((CPDF_Stream*)pObj)->GetDict();
+ }
+ else
+ continue;
+
+ CFX_AffineMatrix m = pDict->GetMatrix(FX_BSTRC("Matrix"));
+ CFX_AffineMatrix t = *(CFX_AffineMatrix*)matrix;
+ m.Concat(t);
+ pDict->SetAtMatrix(FX_BSTRC("Matrix"), m);
+ }
+ }
+ }
+
+ return TRUE;
+}
+
+DLLEXPORT void STDCALL FPDFPageObj_TransformClipPath(FPDF_PAGEOBJECT page_object,double a, double b, double c, double d, double e, double f)
+{
+ CPDF_PageObject* pPageObj = (CPDF_PageObject*)page_object;
+ if(pPageObj == NULL)
+ return;
+ CFX_AffineMatrix matrix((FX_FLOAT)a,(FX_FLOAT)b,(FX_FLOAT)c,(FX_FLOAT)d,(FX_FLOAT)e,(FX_FLOAT)f);
+
+ //Special treatment to shading object, because the ClipPath for shading object is already transformed.
+ if(pPageObj->m_Type != PDFPAGE_SHADING)
+ pPageObj->TransformClipPath(matrix);
+ pPageObj->TransformGeneralState(matrix);
+}
+
+
+DLLEXPORT FPDF_CLIPPATH STDCALL FPDF_CreateClipPath(float left, float bottom, float right, float top)
+{
+ CPDF_ClipPath* pNewClipPath = FX_NEW CPDF_ClipPath();
+ pNewClipPath->GetModify();
+ CPDF_Path Path;
+ Path.GetModify();
+ Path.AppendRect(left, bottom, right, top);
+ pNewClipPath->AppendPath(Path, FXFILL_ALTERNATE, FALSE);
+ return pNewClipPath;
+}
+
+DLLEXPORT void STDCALL FPDF_DestroyClipPath(FPDF_CLIPPATH clipPath)
+{
+ if(clipPath)
+ delete (CPDF_ClipPath*)clipPath;
+}
+
+void OutputPath(CFX_ByteTextBuf& buf, CPDF_Path path)
+{
+ const CFX_PathData* pPathData = path;
+ if (pPathData == NULL) return;
+
+ FX_PATHPOINT* pPoints = pPathData->GetPoints();
+
+ if (path.IsRect()) {
+ buf << (pPoints[0].m_PointX) << " " << (pPoints[0].m_PointY) << " "
+ << (pPoints[2].m_PointX - pPoints[0].m_PointX) << " "
+ << (pPoints[2].m_PointY - pPoints[0].m_PointY) << " re\n";
+ return;
+ }
+
+ CFX_ByteString temp;
+ for (int i = 0; i < pPathData->GetPointCount(); i ++) {
+ buf << (pPoints[i].m_PointX) << " " << (pPoints[i].m_PointY);
+ int point_type = pPoints[i].m_Flag & FXPT_TYPE;
+ if (point_type == FXPT_MOVETO)
+ buf << " m\n";
+ else if (point_type == FXPT_BEZIERTO) {
+ buf << " " << (pPoints[i+1].m_PointX) << " " << (pPoints[i+1].m_PointY) << " " <<
+ (pPoints[i+2].m_PointX) << " " << (pPoints[i+2].m_PointY);
+ if (pPoints[i+2].m_Flag & FXPT_CLOSEFIGURE)
+ buf << " c h\n";
+ else
+ buf << " c\n";
+ i += 2;
+ } else if (point_type == FXPT_LINETO) {
+ if (pPoints[i].m_Flag & FXPT_CLOSEFIGURE)
+ buf << " l h\n";
+ else
+ buf << " l\n";
+ }
+ }
+}
+
+DLLEXPORT void STDCALL FPDFPage_InsertClipPath(FPDF_PAGE page,FPDF_CLIPPATH clipPath)
+{
+ if(!page)
+ return;
+ CPDF_Page* pPage = (CPDF_Page*)page;
+ CPDF_Dictionary* pPageDic = pPage->m_pFormDict;
+ CPDF_Object* pContentObj = pPageDic->GetElement("Contents");
+ if(!pContentObj)
+ pContentObj = pPageDic->GetArray("Contents");
+ if(!pContentObj)
+ return;
+
+ CFX_ByteTextBuf strClip;
+ CPDF_ClipPath* pClipPath = (CPDF_ClipPath*)clipPath;
+ FX_DWORD i;
+ for (i = 0; i < pClipPath->GetPathCount(); i ++) {
+ CPDF_Path path = pClipPath->GetPath(i);
+ int iClipType = pClipPath->GetClipType(i);
+ if (path.GetPointCount() == 0) {
+ // Empty clipping (totally clipped out)
+ strClip << "0 0 m W n ";
+ } else {
+ OutputPath(strClip, path);
+ if (iClipType == FXFILL_WINDING)
+ strClip << "W n\n";
+ else
+ strClip << "W* n\n";
+ }
+ }
+ CPDF_Dictionary* pDic = FX_NEW CPDF_Dictionary;
+ CPDF_Stream* pStream = FX_NEW CPDF_Stream(NULL,0, pDic);
+ pStream->SetData(strClip.GetBuffer(), strClip.GetSize(), FALSE, FALSE);
+ CPDF_Document* pDoc = pPage->m_pDocument;
+ if(!pDoc)
+ return;
+ pDoc->AddIndirectObject(pStream);
+
+ CPDF_Array* pContentArray = NULL;
+ if (pContentObj && pContentObj->GetType() == PDFOBJ_ARRAY)
+ {
+ pContentArray = (CPDF_Array*)pContentObj;
+ CPDF_Reference* pRef = FX_NEW CPDF_Reference(pDoc, pStream->GetObjNum());
+ pContentArray->InsertAt(0, pRef);
+
+ }
+ else if(pContentObj && pContentObj->GetType() == PDFOBJ_REFERENCE)
+ {
+ CPDF_Reference* pReference = (CPDF_Reference*)pContentObj;
+ CPDF_Object* pDirectObj = pReference->GetDirect();
+ if(pDirectObj != NULL)
+ {
+ if(pDirectObj->GetType() == PDFOBJ_ARRAY)
+ {
+ pContentArray = (CPDF_Array*)pDirectObj;
+ CPDF_Reference* pRef = FX_NEW CPDF_Reference(pDoc, pStream->GetObjNum());
+ pContentArray->InsertAt(0, pRef);
+
+ }
+ else if(pDirectObj->GetType() == PDFOBJ_STREAM)
+ {
+ pContentArray = FX_NEW CPDF_Array();
+ pContentArray->AddReference(pDoc,pStream->GetObjNum());
+ pContentArray->AddReference(pDoc,pDirectObj->GetObjNum());
+ pPageDic->SetAtReference("Contents", pDoc, pDoc->AddIndirectObject(pContentArray));
+ }
+ }
+ }
+}
+
diff --git a/fpdfsdk/src/fpdfdoc.cpp b/fpdfsdk/src/fpdfdoc.cpp
index d5d9000bd2..4fa6ba2197 100644
--- a/fpdfsdk/src/fpdfdoc.cpp
+++ b/fpdfsdk/src/fpdfdoc.cpp
@@ -1,259 +1,259 @@
-// 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
-
-#include "../include/fsdk_define.h"
-#include "../include/fpdfdoc.h"
-
-static int this_module = 0;
-
-static CPDF_Bookmark FindBookmark(CPDF_BookmarkTree& tree, CPDF_Bookmark This, const CFX_WideString& title)
-{
- if (This != NULL) {
- // First check this item
- CFX_WideString this_title = This.GetTitle();
- if (this_title.CompareNoCase(title) == 0)
- return This;
- }
- // go into children items
- CPDF_Bookmark Child = tree.GetFirstChild(This);
- while (Child != NULL) {
- // check if this item
- CPDF_Bookmark Found = FindBookmark(tree, Child, title);
- if (Found) return Found;
- Child = tree.GetNextSibling(Child);
- }
- return NULL;
-}
-
-DLLEXPORT FPDF_BOOKMARK STDCALL FPDFBookmark_Find(FPDF_DOCUMENT document, FPDF_WIDESTRING title)
-{
- if (document == NULL) return NULL;
- if (title == NULL || title[0] == 0) return NULL;
-
- CPDF_Document* pDoc = (CPDF_Document*)document;
- CPDF_BookmarkTree tree(pDoc);
-
- CFX_WideString wstr = CFX_WideString::FromUTF16LE(title);
- return FindBookmark(tree, NULL, wstr);
-}
-
-DLLEXPORT FPDF_DEST STDCALL FPDFBookmark_GetDest(FPDF_DOCUMENT document, FPDF_BOOKMARK bookmark)
-{
- if (document == NULL) return NULL;
- if (bookmark == NULL) return NULL;
-
- CPDF_Bookmark Bookmark = (CPDF_Dictionary*)bookmark;
- CPDF_Document* pDoc = (CPDF_Document*)document;
- CPDF_Dest dest = Bookmark.GetDest(pDoc);
- if (dest != NULL) return dest;
-
- // If this bookmark is not directly associated with a dest, we try to get action
- CPDF_Action Action = Bookmark.GetAction();
- if (Action == NULL) return NULL;
- return Action.GetDest(pDoc);
-}
-
-DLLEXPORT FPDF_ACTION STDCALL FPDFBookmark_GetAction(FPDF_BOOKMARK bookmark)
-{
- if (bookmark == NULL) return NULL;
-
- CPDF_Bookmark Bookmark = (CPDF_Dictionary*)bookmark;
- return Bookmark.GetAction();
-}
-
-DLLEXPORT unsigned long STDCALL FPDFAction_GetType(FPDF_ACTION action)
-{
- if (action == NULL) return 0;
-
- CPDF_Action Action = (CPDF_Dictionary*)action;
- CPDF_Action::ActionType type = Action.GetType();
- switch (type) {
- case CPDF_Action::GoTo:
- return PDFACTION_GOTO;
- case CPDF_Action::GoToR:
- return PDFACTION_REMOTEGOTO;
- case CPDF_Action::URI:
- return PDFACTION_URI;
- case CPDF_Action::Launch:
- return PDFACTION_LAUNCH;
- default:
- return PDFACTION_UNSUPPORTED;
- }
- return PDFACTION_UNSUPPORTED;
-}
-
-DLLEXPORT FPDF_DEST STDCALL FPDFAction_GetDest(FPDF_DOCUMENT document, FPDF_ACTION action)
-{
- if (document == NULL) return NULL;
- if (action == NULL) return NULL;
- CPDF_Document* pDoc = (CPDF_Document*)document;
- CPDF_Action Action = (CPDF_Dictionary*)action;
-
- return Action.GetDest(pDoc);
-}
-
-DLLEXPORT unsigned long STDCALL FPDFAction_GetURIPath(FPDF_DOCUMENT document, FPDF_ACTION action,
- void* buffer, unsigned long buflen)
-{
- if (document == NULL) return 0;
- if (action == NULL) return 0;
- CPDF_Document* pDoc = (CPDF_Document*)document;
- CPDF_Action Action = (CPDF_Dictionary*)action;
-
- CFX_ByteString path = Action.GetURI(pDoc);
- unsigned long len = path.GetLength() + 1;
- if (buffer != NULL && buflen >= len)
- FXSYS_memcpy(buffer, (FX_LPCSTR)path, len);
- return len;
-}
-
-DLLEXPORT unsigned long STDCALL FPDFDest_GetPageIndex(FPDF_DOCUMENT document, FPDF_DEST dest)
-{
- if (document == NULL) return 0;
- if (dest == NULL) return 0;
- CPDF_Document* pDoc = (CPDF_Document*)document;
- CPDF_Dest Dest = (CPDF_Array*)dest;
-
- return Dest.GetPageIndex(pDoc);
-}
-
-static void ReleaseLinkList(FX_LPVOID data)
-{
- delete (CPDF_LinkList*)data;
-}
-
-DLLEXPORT FPDF_LINK STDCALL FPDFLink_GetLinkAtPoint(FPDF_PAGE page, double x, double y)
-{
- if (page == NULL) return NULL;
- CPDF_Page* pPage = (CPDF_Page*)page;
-
- // Link list is stored with the document
- CPDF_Document* pDoc = pPage->m_pDocument;
- CPDF_LinkList* pLinkList = (CPDF_LinkList*)pDoc->GetPrivateData(&this_module);
- if (pLinkList == NULL) {
- pLinkList = FX_NEW CPDF_LinkList(pDoc);
- pDoc->SetPrivateData(&this_module, pLinkList, ReleaseLinkList);
- }
-
- return pLinkList->GetLinkAtPoint(pPage, (FX_FLOAT)x, (FX_FLOAT)y);
-}
-
-DLLEXPORT FPDF_DEST STDCALL FPDFLink_GetDest(FPDF_DOCUMENT document, FPDF_LINK link)
-{
- if (document == NULL) return NULL;
- CPDF_Document* pDoc = (CPDF_Document*)document;
- if (link == NULL) return NULL;
- CPDF_Link Link = (CPDF_Dictionary*)link;
-
- FPDF_DEST dest = Link.GetDest(pDoc);
- if (dest) return dest;
-
- // If this link is not directly associated with a dest, we try to get action
- CPDF_Action Action = Link.GetAction();
- if (Action == NULL) return NULL;
- return Action.GetDest(pDoc);
-}
-
-DLLEXPORT FPDF_ACTION STDCALL FPDFLink_GetAction(FPDF_LINK link)
-{
- if (link == NULL) return NULL;
- CPDF_Link Link = (CPDF_Dictionary*)link;
-
- return Link.GetAction();
-}
-
-DLLEXPORT FPDF_BOOL STDCALL FPDFLink_Enumerate(FPDF_PAGE page, int* startPos, FPDF_LINK* linkAnnot)
-{
- if(!page || !startPos || !linkAnnot)
- return FALSE;
- CPDF_Page* pPage = (CPDF_Page*)page;
- if(!pPage->m_pFormDict) return FALSE;
- CPDF_Array* pAnnots = pPage->m_pFormDict->GetArray("Annots");
- if(!pAnnots) return FALSE;
- for (int i = *startPos; i < (int)pAnnots->GetCount(); i ++) {
- CPDF_Dictionary* pDict = (CPDF_Dictionary*)pAnnots->GetElementValue(i);
- if (pDict == NULL || pDict->GetType() != PDFOBJ_DICTIONARY) continue;
- if(pDict->GetString(FX_BSTRC("Subtype")).Equal(FX_BSTRC("Link")))
- {
- *startPos = i+1;
- *linkAnnot = (FPDF_LINK)pDict;
- return TRUE;
- }
- }
- return FALSE;
-}
-
-DLLEXPORT FPDF_BOOL STDCALL FPDFLink_GetAnnotRect(FPDF_LINK linkAnnot, FS_RECTF* rect)
-{
- if(!linkAnnot || !rect)
- return FALSE;
- CPDF_Dictionary* pAnnotDict = (CPDF_Dictionary*)linkAnnot;
- CPDF_Rect rt = pAnnotDict->GetRect(FX_BSTRC("Rect"));
- rect->left = rt.left;
- rect->bottom = rt.bottom;
- rect->right = rt.right;
- rect->top = rt.top;
- return TRUE;
-}
-
-DLLEXPORT int STDCALL FPDFLink_CountQuadPoints(FPDF_LINK linkAnnot)
-{
- if(!linkAnnot)
- return 0;
- CPDF_Dictionary* pAnnotDict = (CPDF_Dictionary*)linkAnnot;
- CPDF_Array* pArray = pAnnotDict->GetArray(FX_BSTRC("QuadPoints"));
- if (pArray == NULL)
- return 0;
- else
- return pArray->GetCount() / 8;
-}
-
-DLLEXPORT FPDF_BOOL STDCALL FPDFLink_GetQuadPoints(FPDF_LINK linkAnnot, int quadIndex, FS_QUADPOINTSF* quadPoints)
-{
- if(!linkAnnot || !quadPoints)
- return FALSE;
- CPDF_Dictionary* pAnnotDict = (CPDF_Dictionary*)linkAnnot;
- CPDF_Array* pArray = pAnnotDict->GetArray(FX_BSTRC("QuadPoints"));
- if (pArray) {
- if (0 > quadIndex || quadIndex >= (int)pArray->GetCount()/8 ||
- ((quadIndex*8+7) >= (int)pArray->GetCount())) return FALSE;
- quadPoints->x1 = pArray->GetNumber(quadIndex*8);
- quadPoints->y1 = pArray->GetNumber(quadIndex*8+1);
- quadPoints->x2 = pArray->GetNumber(quadIndex*8+2);
- quadPoints->y2 = pArray->GetNumber(quadIndex*8+3);
- quadPoints->x3 = pArray->GetNumber(quadIndex*8+4);
- quadPoints->y3 = pArray->GetNumber(quadIndex*8+5);
- quadPoints->x4 = pArray->GetNumber(quadIndex*8+6);
- quadPoints->y4 = pArray->GetNumber(quadIndex*8+7);
- return TRUE;
- }
- return FALSE;
-}
-
-
-DLLEXPORT unsigned long STDCALL FPDF_GetMetaText(FPDF_DOCUMENT doc, FPDF_BYTESTRING tag,
- void* buffer, unsigned long buflen)
-{
- if (doc == NULL || tag == NULL) return 0;
-
- CPDF_Document* pDoc = (CPDF_Document*)doc;
- // Get info dictionary
- CPDF_Dictionary* pInfo = pDoc->GetInfo();
- if (pInfo == NULL) return 0;
-
- CFX_WideString text = pInfo->GetUnicodeText(tag);
-
- // Use UTF-16LE encoding
- CFX_ByteString bstr = text.UTF16LE_Encode();
- unsigned long len = bstr.GetLength();
- if (buffer != NULL || buflen >= len+2) {
- FXSYS_memcpy(buffer, (FX_LPCSTR)bstr, len);
- // use double zero as trailer
- ((FX_BYTE*)buffer)[len] = ((FX_BYTE*)buffer)[len+1] = 0;
- }
- return len+2;
-}
-
+// 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
+
+#include "../include/fsdk_define.h"
+#include "../include/fpdfdoc.h"
+
+static int this_module = 0;
+
+static CPDF_Bookmark FindBookmark(CPDF_BookmarkTree& tree, CPDF_Bookmark This, const CFX_WideString& title)
+{
+ if (This != NULL) {
+ // First check this item
+ CFX_WideString this_title = This.GetTitle();
+ if (this_title.CompareNoCase(title) == 0)
+ return This;
+ }
+ // go into children items
+ CPDF_Bookmark Child = tree.GetFirstChild(This);
+ while (Child != NULL) {
+ // check if this item
+ CPDF_Bookmark Found = FindBookmark(tree, Child, title);
+ if (Found) return Found;
+ Child = tree.GetNextSibling(Child);
+ }
+ return NULL;
+}
+
+DLLEXPORT FPDF_BOOKMARK STDCALL FPDFBookmark_Find(FPDF_DOCUMENT document, FPDF_WIDESTRING title)
+{
+ if (document == NULL) return NULL;
+ if (title == NULL || title[0] == 0) return NULL;
+
+ CPDF_Document* pDoc = (CPDF_Document*)document;
+ CPDF_BookmarkTree tree(pDoc);
+
+ CFX_WideString wstr = CFX_WideString::FromUTF16LE(title);
+ return FindBookmark(tree, NULL, wstr);
+}
+
+DLLEXPORT FPDF_DEST STDCALL FPDFBookmark_GetDest(FPDF_DOCUMENT document, FPDF_BOOKMARK bookmark)
+{
+ if (document == NULL) return NULL;
+ if (bookmark == NULL) return NULL;
+
+ CPDF_Bookmark Bookmark = (CPDF_Dictionary*)bookmark;
+ CPDF_Document* pDoc = (CPDF_Document*)document;
+ CPDF_Dest dest = Bookmark.GetDest(pDoc);
+ if (dest != NULL) return dest;
+
+ // If this bookmark is not directly associated with a dest, we try to get action
+ CPDF_Action Action = Bookmark.GetAction();
+ if (Action == NULL) return NULL;
+ return Action.GetDest(pDoc);
+}
+
+DLLEXPORT FPDF_ACTION STDCALL FPDFBookmark_GetAction(FPDF_BOOKMARK bookmark)
+{
+ if (bookmark == NULL) return NULL;
+
+ CPDF_Bookmark Bookmark = (CPDF_Dictionary*)bookmark;
+ return Bookmark.GetAction();
+}
+
+DLLEXPORT unsigned long STDCALL FPDFAction_GetType(FPDF_ACTION action)
+{
+ if (action == NULL) return 0;
+
+ CPDF_Action Action = (CPDF_Dictionary*)action;
+ CPDF_Action::ActionType type = Action.GetType();
+ switch (type) {
+ case CPDF_Action::GoTo:
+ return PDFACTION_GOTO;
+ case CPDF_Action::GoToR:
+ return PDFACTION_REMOTEGOTO;
+ case CPDF_Action::URI:
+ return PDFACTION_URI;
+ case CPDF_Action::Launch:
+ return PDFACTION_LAUNCH;
+ default:
+ return PDFACTION_UNSUPPORTED;
+ }
+ return PDFACTION_UNSUPPORTED;
+}
+
+DLLEXPORT FPDF_DEST STDCALL FPDFAction_GetDest(FPDF_DOCUMENT document, FPDF_ACTION action)
+{
+ if (document == NULL) return NULL;
+ if (action == NULL) return NULL;
+ CPDF_Document* pDoc = (CPDF_Document*)document;
+ CPDF_Action Action = (CPDF_Dictionary*)action;
+
+ return Action.GetDest(pDoc);
+}
+
+DLLEXPORT unsigned long STDCALL FPDFAction_GetURIPath(FPDF_DOCUMENT document, FPDF_ACTION action,
+ void* buffer, unsigned long buflen)
+{
+ if (document == NULL) return 0;
+ if (action == NULL) return 0;
+ CPDF_Document* pDoc = (CPDF_Document*)document;
+ CPDF_Action Action = (CPDF_Dictionary*)action;
+
+ CFX_ByteString path = Action.GetURI(pDoc);
+ unsigned long len = path.GetLength() + 1;
+ if (buffer != NULL && buflen >= len)
+ FXSYS_memcpy(buffer, (FX_LPCSTR)path, len);
+ return len;
+}
+
+DLLEXPORT unsigned long STDCALL FPDFDest_GetPageIndex(FPDF_DOCUMENT document, FPDF_DEST dest)
+{
+ if (document == NULL) return 0;
+ if (dest == NULL) return 0;
+ CPDF_Document* pDoc = (CPDF_Document*)document;
+ CPDF_Dest Dest = (CPDF_Array*)dest;
+
+ return Dest.GetPageIndex(pDoc);
+}
+
+static void ReleaseLinkList(FX_LPVOID data)
+{
+ delete (CPDF_LinkList*)data;
+}
+
+DLLEXPORT FPDF_LINK STDCALL FPDFLink_GetLinkAtPoint(FPDF_PAGE page, double x, double y)
+{
+ if (page == NULL) return NULL;
+ CPDF_Page* pPage = (CPDF_Page*)page;
+
+ // Link list is stored with the document
+ CPDF_Document* pDoc = pPage->m_pDocument;
+ CPDF_LinkList* pLinkList = (CPDF_LinkList*)pDoc->GetPrivateData(&this_module);
+ if (pLinkList == NULL) {
+ pLinkList = FX_NEW CPDF_LinkList(pDoc);
+ pDoc->SetPrivateData(&this_module, pLinkList, ReleaseLinkList);
+ }
+
+ return pLinkList->GetLinkAtPoint(pPage, (FX_FLOAT)x, (FX_FLOAT)y);
+}
+
+DLLEXPORT FPDF_DEST STDCALL FPDFLink_GetDest(FPDF_DOCUMENT document, FPDF_LINK link)
+{
+ if (document == NULL) return NULL;
+ CPDF_Document* pDoc = (CPDF_Document*)document;
+ if (link == NULL) return NULL;
+ CPDF_Link Link = (CPDF_Dictionary*)link;
+
+ FPDF_DEST dest = Link.GetDest(pDoc);
+ if (dest) return dest;
+
+ // If this link is not directly associated with a dest, we try to get action
+ CPDF_Action Action = Link.GetAction();
+ if (Action == NULL) return NULL;
+ return Action.GetDest(pDoc);
+}
+
+DLLEXPORT FPDF_ACTION STDCALL FPDFLink_GetAction(FPDF_LINK link)
+{
+ if (link == NULL) return NULL;
+ CPDF_Link Link = (CPDF_Dictionary*)link;
+
+ return Link.GetAction();
+}
+
+DLLEXPORT FPDF_BOOL STDCALL FPDFLink_Enumerate(FPDF_PAGE page, int* startPos, FPDF_LINK* linkAnnot)
+{
+ if(!page || !startPos || !linkAnnot)
+ return FALSE;
+ CPDF_Page* pPage = (CPDF_Page*)page;
+ if(!pPage->m_pFormDict) return FALSE;
+ CPDF_Array* pAnnots = pPage->m_pFormDict->GetArray("Annots");
+ if(!pAnnots) return FALSE;
+ for (int i = *startPos; i < (int)pAnnots->GetCount(); i ++) {
+ CPDF_Dictionary* pDict = (CPDF_Dictionary*)pAnnots->GetElementValue(i);
+ if (pDict == NULL || pDict->GetType() != PDFOBJ_DICTIONARY) continue;
+ if(pDict->GetString(FX_BSTRC("Subtype")).Equal(FX_BSTRC("Link")))
+ {
+ *startPos = i+1;
+ *linkAnnot = (FPDF_LINK)pDict;
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
+DLLEXPORT FPDF_BOOL STDCALL FPDFLink_GetAnnotRect(FPDF_LINK linkAnnot, FS_RECTF* rect)
+{
+ if(!linkAnnot || !rect)
+ return FALSE;
+ CPDF_Dictionary* pAnnotDict = (CPDF_Dictionary*)linkAnnot;
+ CPDF_Rect rt = pAnnotDict->GetRect(FX_BSTRC("Rect"));
+ rect->left = rt.left;
+ rect->bottom = rt.bottom;
+ rect->right = rt.right;
+ rect->top = rt.top;
+ return TRUE;
+}
+
+DLLEXPORT int STDCALL FPDFLink_CountQuadPoints(FPDF_LINK linkAnnot)
+{
+ if(!linkAnnot)
+ return 0;
+ CPDF_Dictionary* pAnnotDict = (CPDF_Dictionary*)linkAnnot;
+ CPDF_Array* pArray = pAnnotDict->GetArray(FX_BSTRC("QuadPoints"));
+ if (pArray == NULL)
+ return 0;
+ else
+ return pArray->GetCount() / 8;
+}
+
+DLLEXPORT FPDF_BOOL STDCALL FPDFLink_GetQuadPoints(FPDF_LINK linkAnnot, int quadIndex, FS_QUADPOINTSF* quadPoints)
+{
+ if(!linkAnnot || !quadPoints)
+ return FALSE;
+ CPDF_Dictionary* pAnnotDict = (CPDF_Dictionary*)linkAnnot;
+ CPDF_Array* pArray = pAnnotDict->GetArray(FX_BSTRC("QuadPoints"));
+ if (pArray) {
+ if (0 > quadIndex || quadIndex >= (int)pArray->GetCount()/8 ||
+ ((quadIndex*8+7) >= (int)pArray->GetCount())) return FALSE;
+ quadPoints->x1 = pArray->GetNumber(quadIndex*8);
+ quadPoints->y1 = pArray->GetNumber(quadIndex*8+1);
+ quadPoints->x2 = pArray->GetNumber(quadIndex*8+2);
+ quadPoints->y2 = pArray->GetNumber(quadIndex*8+3);
+ quadPoints->x3 = pArray->GetNumber(quadIndex*8+4);
+ quadPoints->y3 = pArray->GetNumber(quadIndex*8+5);
+ quadPoints->x4 = pArray->GetNumber(quadIndex*8+6);
+ quadPoints->y4 = pArray->GetNumber(quadIndex*8+7);
+ return TRUE;
+ }
+ return FALSE;
+}
+
+
+DLLEXPORT unsigned long STDCALL FPDF_GetMetaText(FPDF_DOCUMENT doc, FPDF_BYTESTRING tag,
+ void* buffer, unsigned long buflen)
+{
+ if (doc == NULL || tag == NULL) return 0;
+
+ CPDF_Document* pDoc = (CPDF_Document*)doc;
+ // Get info dictionary
+ CPDF_Dictionary* pInfo = pDoc->GetInfo();
+ if (pInfo == NULL) return 0;
+
+ CFX_WideString text = pInfo->GetUnicodeText(tag);
+
+ // Use UTF-16LE encoding
+ CFX_ByteString bstr = text.UTF16LE_Encode();
+ unsigned long len = bstr.GetLength();
+ if (buffer != NULL || buflen >= len+2) {
+ FXSYS_memcpy(buffer, (FX_LPCSTR)bstr, len);
+ // use double zero as trailer
+ ((FX_BYTE*)buffer)[len] = ((FX_BYTE*)buffer)[len+1] = 0;
+ }
+ return len+2;
+}
+
diff --git a/fpdfsdk/src/fpdfeditimg.cpp b/fpdfsdk/src/fpdfeditimg.cpp
index ea81203cad..c29d2b74f8 100644
--- a/fpdfsdk/src/fpdfeditimg.cpp
+++ b/fpdfsdk/src/fpdfeditimg.cpp
@@ -1,74 +1,74 @@
-// 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
-
-#include "../include/fsdk_define.h"
-#include "../include/fpdfedit.h"
-
-
-DLLEXPORT FPDF_PAGEOBJECT STDCALL FPDFPageObj_NewImgeObj(FPDF_DOCUMENT document)
-{
- if (!document)
- return NULL;
- CPDF_ImageObject* pImageObj = FX_NEW CPDF_ImageObject;
- CPDF_Image* pImg = FX_NEW CPDF_Image((CPDF_Document *)document);
- pImageObj->m_pImage = pImg;
- return pImageObj;
-}
-
-DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_LoadJpegFile(FPDF_PAGE* pages, int nCount,FPDF_PAGEOBJECT image_object, FPDF_FILEACCESS* fileAccess)
-{
- if (!image_object || !fileAccess)
- return FALSE;
-
- IFX_FileRead* pFile = FX_NEW CPDF_CustomAccess(fileAccess);
-
- CPDF_ImageObject* pImgObj = (CPDF_ImageObject*)image_object;
- pImgObj->m_GeneralState.GetModify();
- for (int index=0;index<nCount;index++)
- {
- CPDF_Page* pPage = (CPDF_Page*)pages[index];
- pImgObj->m_pImage->ResetCache(pPage,NULL);
- }
- pImgObj->m_pImage->SetJpegImage(pFile);
-
- return TRUE;
-}
-
-
-DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_SetMatrix (FPDF_PAGEOBJECT image_object,
- double a, double b, double c, double d, double e, double f)
-{
- if (!image_object)
- return FALSE;
- CPDF_ImageObject* pImgObj = (CPDF_ImageObject*)image_object;
- pImgObj->m_Matrix.a = (FX_FLOAT)a;
- pImgObj->m_Matrix.b = (FX_FLOAT)b;
- pImgObj->m_Matrix.c = (FX_FLOAT)c;
- pImgObj->m_Matrix.d = (FX_FLOAT)d;
- pImgObj->m_Matrix.e = (FX_FLOAT)e;
- pImgObj->m_Matrix.f = (FX_FLOAT)f;
- pImgObj->CalcBoundingBox();
- return TRUE;
-}
-
-DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_SetBitmap(FPDF_PAGE* pages,int nCount,FPDF_PAGEOBJECT image_object,FPDF_BITMAP bitmap)
-{
- if (!image_object || !bitmap)
- return FALSE;
- CFX_DIBitmap* pBmp = NULL;
- pBmp = (CFX_DIBitmap*)bitmap;
- CPDF_ImageObject* pImgObj = (CPDF_ImageObject*)image_object;
- pImgObj->m_GeneralState.GetModify();
- for (int index=0;index<nCount;index++)
- {
- CPDF_Page* pPage = (CPDF_Page*)pages[index];
- pImgObj->m_pImage->ResetCache(pPage,NULL);
- }
- pImgObj->m_pImage->SetImage(pBmp,FALSE);
- pImgObj->CalcBoundingBox();
- return TRUE;
-}
-
+// 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
+
+#include "../include/fsdk_define.h"
+#include "../include/fpdfedit.h"
+
+
+DLLEXPORT FPDF_PAGEOBJECT STDCALL FPDFPageObj_NewImgeObj(FPDF_DOCUMENT document)
+{
+ if (!document)
+ return NULL;
+ CPDF_ImageObject* pImageObj = FX_NEW CPDF_ImageObject;
+ CPDF_Image* pImg = FX_NEW CPDF_Image((CPDF_Document *)document);
+ pImageObj->m_pImage = pImg;
+ return pImageObj;
+}
+
+DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_LoadJpegFile(FPDF_PAGE* pages, int nCount,FPDF_PAGEOBJECT image_object, FPDF_FILEACCESS* fileAccess)
+{
+ if (!image_object || !fileAccess)
+ return FALSE;
+
+ IFX_FileRead* pFile = FX_NEW CPDF_CustomAccess(fileAccess);
+
+ CPDF_ImageObject* pImgObj = (CPDF_ImageObject*)image_object;
+ pImgObj->m_GeneralState.GetModify();
+ for (int index=0;index<nCount;index++)
+ {
+ CPDF_Page* pPage = (CPDF_Page*)pages[index];
+ pImgObj->m_pImage->ResetCache(pPage,NULL);
+ }
+ pImgObj->m_pImage->SetJpegImage(pFile);
+
+ return TRUE;
+}
+
+
+DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_SetMatrix (FPDF_PAGEOBJECT image_object,
+ double a, double b, double c, double d, double e, double f)
+{
+ if (!image_object)
+ return FALSE;
+ CPDF_ImageObject* pImgObj = (CPDF_ImageObject*)image_object;
+ pImgObj->m_Matrix.a = (FX_FLOAT)a;
+ pImgObj->m_Matrix.b = (FX_FLOAT)b;
+ pImgObj->m_Matrix.c = (FX_FLOAT)c;
+ pImgObj->m_Matrix.d = (FX_FLOAT)d;
+ pImgObj->m_Matrix.e = (FX_FLOAT)e;
+ pImgObj->m_Matrix.f = (FX_FLOAT)f;
+ pImgObj->CalcBoundingBox();
+ return TRUE;
+}
+
+DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_SetBitmap(FPDF_PAGE* pages,int nCount,FPDF_PAGEOBJECT image_object,FPDF_BITMAP bitmap)
+{
+ if (!image_object || !bitmap)
+ return FALSE;
+ CFX_DIBitmap* pBmp = NULL;
+ pBmp = (CFX_DIBitmap*)bitmap;
+ CPDF_ImageObject* pImgObj = (CPDF_ImageObject*)image_object;
+ pImgObj->m_GeneralState.GetModify();
+ for (int index=0;index<nCount;index++)
+ {
+ CPDF_Page* pPage = (CPDF_Page*)pages[index];
+ pImgObj->m_pImage->ResetCache(pPage,NULL);
+ }
+ pImgObj->m_pImage->SetImage(pBmp,FALSE);
+ pImgObj->CalcBoundingBox();
+ return TRUE;
+}
+
diff --git a/fpdfsdk/src/fpdfeditpage.cpp b/fpdfsdk/src/fpdfeditpage.cpp
index d9cbbe4733..3f22b56b48 100644
--- a/fpdfsdk/src/fpdfeditpage.cpp
+++ b/fpdfsdk/src/fpdfeditpage.cpp
@@ -1,316 +1,316 @@
-// 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
-
-// #include "x:/pdf/fpdfapi5/include/fpdfapi.h"
-#include "../include/fsdk_define.h"
-#include "../include/fpdfedit.h"
-
-
-#if _FX_OS_ == _FX_ANDROID_
-#include "time.h"
-#else
-#include <ctime>
-#endif
-
-DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_CreateNewDocument()
-{
- CPDF_Document* pDoc = FX_NEW CPDF_Document;
- if (!pDoc)
- return NULL;
- pDoc->CreateNewDoc();
- time_t currentTime;
-
- CFX_ByteString DateStr;
-
- if(FSDK_IsSandBoxPolicyEnabled(FPDF_POLICY_MACHINETIME_ACCESS))
- {
- if ( -1 != time( &currentTime ) )
- {
- tm * pTM = localtime( &currentTime );
- if ( pTM )
- {
- DateStr.Format( "D:%04d%02d%02d%02d%02d%02d", pTM->tm_year+1900, pTM->tm_mon+1,
- pTM->tm_mday, pTM->tm_hour, pTM->tm_min, pTM->tm_sec );
- }
- }
- }
-
- CPDF_Dictionary* pInfoDict = NULL;
- pInfoDict = pDoc->GetInfo();
- if (pInfoDict)
- {
- if(FSDK_IsSandBoxPolicyEnabled(FPDF_POLICY_MACHINETIME_ACCESS))
- pInfoDict->SetAt("CreationDate", new CPDF_String(DateStr));
-#ifdef FOXIT_CHROME_BUILD
- pInfoDict->SetAt("Creator",FX_NEW CPDF_String(L"Google"));
-#else
- pInfoDict->SetAt("Creator",FX_NEW CPDF_String(L"Foxit PDF SDK DLL 2.0 - Foxit Software"));
-#endif
- }
-
- return pDoc;
-}
-
-DLLEXPORT void STDCALL FPDFPage_Delete(FPDF_DOCUMENT document, int page_index)
-{
- CPDF_Document* pDoc = (CPDF_Document*)document;
- if (pDoc == NULL)
- return;
- if (page_index < 0 || page_index >= pDoc->GetPageCount())
- return;
-
- pDoc->DeletePage(page_index);
-}
-
-DLLEXPORT FPDF_PAGE STDCALL FPDFPage_New(FPDF_DOCUMENT document, int page_index, double width, double height)
-{
- if (!document)
- return NULL;
-
-// CPDF_Parser* pParser = (CPDF_Parser*)document;
- CPDF_Document* pDoc = (CPDF_Document*)document;
- if(page_index < 0)
- page_index = 0;
- if(pDoc->GetPageCount()<page_index)
- page_index = pDoc->GetPageCount();
-// if (page_index < 0 || page_index >= pDoc->GetPageCount())
-// return NULL;
-
- CPDF_Dictionary* pPageDict = pDoc->CreateNewPage(page_index);
- if(!pPageDict)
- return NULL;
- CPDF_Array* pMediaBoxArray = FX_NEW CPDF_Array;
- pMediaBoxArray->Add(FX_NEW CPDF_Number(0));
- pMediaBoxArray->Add(FX_NEW CPDF_Number(0));
- pMediaBoxArray->Add(FX_NEW CPDF_Number(FX_FLOAT(width)));
- pMediaBoxArray->Add(FX_NEW CPDF_Number(FX_FLOAT(height)));
-
- pPageDict->SetAt("MediaBox", pMediaBoxArray);
- pPageDict->SetAt("Rotate", FX_NEW CPDF_Number(0));
- pPageDict->SetAt("Resources", FX_NEW CPDF_Dictionary);
-
- CPDF_Page* pPage = FX_NEW CPDF_Page;
- pPage->Load(pDoc,pPageDict);
- pPage->ParseContent();
-
- return pPage;
-}
-
-DLLEXPORT int STDCALL FPDFPage_GetRotation(FPDF_PAGE page)
-{
- CPDF_Page* pPage = (CPDF_Page*)page;
- if (!pPage || !pPage->m_pFormDict || !pPage->m_pFormDict->KeyExist("Type")
- || pPage->m_pFormDict->GetElement("Type")->GetDirect()->GetString().Compare("Page"))
- {
- return -1;
- }
- CPDF_Dictionary* pDict = pPage->m_pFormDict;
-
- int rotate = 0;
- if(pDict != NULL)
- {
- if(pDict->KeyExist("Rotate"))
- rotate = pDict->GetElement("Rotate")->GetDirect()->GetInteger() / 90;
- else
- {
- if(pDict->KeyExist("Parent"))
- {
- CPDF_Dictionary* pPages = (CPDF_Dictionary*)pDict->GetElement("Parent")->GetDirect();
- while(pPages)
- {
- if(pPages->KeyExist("Rotate"))
- {
- rotate = pPages->GetElement("Rotate")->GetDirect()->GetInteger() / 90;
- break;
- }
- else if(pPages->KeyExist("Parent"))
- pPages = (CPDF_Dictionary*)pPages->GetElement("Parent")->GetDirect();
- else break;
- }
- }
- }
- }
- else
- {
- return -1;
- }
-
- return rotate;
-}
-
-DLLEXPORT void STDCALL FPDFPage_InsertObject(FPDF_PAGE page, FPDF_PAGEOBJECT page_obj)
-{
- CPDF_Page* pPage = (CPDF_Page*)page;
- if (!pPage || !pPage->m_pFormDict || !pPage->m_pFormDict->KeyExist("Type")
- || pPage->m_pFormDict->GetElement("Type")->GetDirect()->GetString().Compare("Page"))
- {
- return;
- }
- CPDF_PageObject* pPageObj = (CPDF_PageObject*)page_obj;
- if(pPageObj == NULL)
- return;
- FX_POSITION LastPersition = pPage->GetLastObjectPosition();
-
- pPage->InsertObject(LastPersition, pPageObj);
- switch(pPageObj->m_Type)
- {
- case FPDF_PAGEOBJ_PATH:
- {
- CPDF_PathObject* pPathObj = (CPDF_PathObject*)pPageObj;
- pPathObj->CalcBoundingBox();
- break;
- }
- case FPDF_PAGEOBJ_TEXT:
- {
- // CPDF_PathObject* pPathObj = (CPDF_PathObject*)pPageObj;
- // pPathObj->CalcBoundingBox();
- break;
- }
- case FPDF_PAGEOBJ_IMAGE:
- {
- CPDF_ImageObject* pImageObj = (CPDF_ImageObject*)pPageObj;
- pImageObj->CalcBoundingBox();
- break;
- }
- case FPDF_PAGEOBJ_SHADING:
- {
- CPDF_ShadingObject* pShadingObj = (CPDF_ShadingObject*)pPageObj;
- pShadingObj->CalcBoundingBox();
- break;
- }
- case FPDF_PAGEOBJ_FORM:
- {
- CPDF_FormObject* pFormObj = (CPDF_FormObject*)pPageObj;
- pFormObj->CalcBoundingBox();
- break;
- }
- default:
- break;
- }
-
- // pPage->ParseContent();
- //pPage->GenerateContent();
-
-}
-
-DLLEXPORT int STDCALL FPDFPage_CountObject(FPDF_PAGE page)
-{
- CPDF_Page* pPage = (CPDF_Page*)page;
- if (!pPage || !pPage->m_pFormDict || !pPage->m_pFormDict->KeyExist("Type")
- || pPage->m_pFormDict->GetElement("Type")->GetDirect()->GetString().Compare("Page"))
- {
- return -1;
- }
- return pPage->CountObjects();
-// return 0;
-}
-
-DLLEXPORT FPDF_PAGEOBJECT STDCALL FPDFPage_GetObject(FPDF_PAGE page, int index)
-{
- CPDF_Page* pPage = (CPDF_Page*)page;
- if (!pPage || !pPage->m_pFormDict || !pPage->m_pFormDict->KeyExist("Type")
- || pPage->m_pFormDict->GetElement("Type")->GetDirect()->GetString().Compare("Page"))
- {
- return NULL;
- }
- return pPage->GetObjectByIndex(index);
-// return NULL;
-}
-
-DLLEXPORT FPDF_BOOL STDCALL FPDFPage_HasTransparency(FPDF_PAGE page)
-{
- if(!page) return FALSE;
- CPDF_Page* pPage = (CPDF_Page*)page;
-
- return pPage->BackgroundAlphaNeeded();
-}
-
-DLLEXPORT FPDF_BOOL STDCALL FPDFPageObj_HasTransparency(FPDF_PAGEOBJECT pageObject)
-{
- if(!pageObject) return FALSE;
- CPDF_PageObject* pPageObj = (CPDF_PageObject*)pageObject;
-
- const CPDF_GeneralStateData* pGeneralState = pPageObj->m_GeneralState;
- int blend_type = pGeneralState ? pGeneralState->m_BlendType : FXDIB_BLEND_NORMAL;
- if (blend_type != FXDIB_BLEND_NORMAL) return TRUE;
-
- CPDF_Dictionary* pSMaskDict = pGeneralState ? (CPDF_Dictionary*)pGeneralState->m_pSoftMask : NULL;
- if(pSMaskDict) return TRUE;
-
- if(pGeneralState && pGeneralState->m_FillAlpha != 1.0f)
- return TRUE;
-
- if(pPageObj->m_Type == PDFPAGE_PATH)
- {
- if(pGeneralState && pGeneralState->m_StrokeAlpha != 1.0f)
- return TRUE;
- }
-
- if(pPageObj->m_Type == PDFPAGE_FORM)
- {
- CPDF_FormObject* pFormObj = (CPDF_FormObject*)pPageObj;
- if(pFormObj->m_pForm && (pFormObj->m_pForm->m_Transparency & PDFTRANS_ISOLATED))
- return TRUE;
- if(pFormObj->m_pForm && (!(pFormObj->m_pForm->m_Transparency & PDFTRANS_ISOLATED) && (pFormObj->m_pForm->m_Transparency & PDFTRANS_GROUP)))
- return TRUE;
- }
- return FALSE;
-}
-
-DLLEXPORT FPDF_BOOL STDCALL FPDFPage_GenerateContent(FPDF_PAGE page)
-{
- CPDF_Page* pPage = (CPDF_Page*)page;
- if (!pPage || !pPage->m_pFormDict || !pPage->m_pFormDict->KeyExist("Type")
- || pPage->m_pFormDict->GetElement("Type")->GetDirect()->GetString().Compare("Page"))
- {
- return FALSE;
- }
- CPDF_PageContentGenerate CG(pPage);
- CG.GenerateContent();
-
- return TRUE;
-}
-
-DLLEXPORT void STDCALL FPDFPageObj_Transform(FPDF_PAGEOBJECT page_object,
- double a, double b, double c, double d, double e, double f)
-{
- CPDF_PageObject* pPageObj = (CPDF_PageObject*)page_object;
- if(pPageObj == NULL)
- return;
-//PDF_ImageObject* pImageObj = FX_NEW CPDF_ImageObject;
- CFX_AffineMatrix matrix((FX_FLOAT)a,(FX_FLOAT)b,(FX_FLOAT)c,(FX_FLOAT)d,(FX_FLOAT)e,(FX_FLOAT)f);
- pPageObj->Transform(matrix);
-}
-DLLEXPORT void STDCALL FPDFPage_TransformAnnots(FPDF_PAGE page,
- double a, double b, double c, double d, double e, double f)
-{
- if(page == NULL)
- return;
- CPDF_Page* pPage = (CPDF_Page*)page;
- CPDF_AnnotList AnnotList(pPage);
- for (int i=0; i<AnnotList.Count();i++)
- {
- CPDF_Annot* pAnnot = AnnotList.GetAt(i);
- // transformAnnots Rectangle
- CPDF_Rect rect;
- pAnnot->GetRect(rect);
- CFX_AffineMatrix matrix((FX_FLOAT)a,(FX_FLOAT)b,(FX_FLOAT)c,(FX_FLOAT)d,(FX_FLOAT)e,(FX_FLOAT)f);
- rect.Transform(&matrix);
- CPDF_Array *pRectArray = NULL;
- pRectArray = pAnnot->m_pAnnotDict->GetArray("Rect");
- if (!pRectArray) pRectArray=CPDF_Array::Create();
- pRectArray->SetAt(0,FX_NEW CPDF_Number(rect.left));
- pRectArray->SetAt(1,FX_NEW CPDF_Number(rect.bottom));
- pRectArray->SetAt(2,FX_NEW CPDF_Number(rect.right));
- pRectArray->SetAt(3,FX_NEW CPDF_Number(rect.top));
- pAnnot->m_pAnnotDict->SetAt("Rect",pRectArray);
-
- //Transform AP's rectangle
- //To Do
-
- }
-
-}
+// 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
+
+// #include "x:/pdf/fpdfapi5/include/fpdfapi.h"
+#include "../include/fsdk_define.h"
+#include "../include/fpdfedit.h"
+
+
+#if _FX_OS_ == _FX_ANDROID_
+#include "time.h"
+#else
+#include <ctime>
+#endif
+
+DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_CreateNewDocument()
+{
+ CPDF_Document* pDoc = FX_NEW CPDF_Document;
+ if (!pDoc)
+ return NULL;
+ pDoc->CreateNewDoc();
+ time_t currentTime;
+
+ CFX_ByteString DateStr;
+
+ if(FSDK_IsSandBoxPolicyEnabled(FPDF_POLICY_MACHINETIME_ACCESS))
+ {
+ if ( -1 != time( &currentTime ) )
+ {
+ tm * pTM = localtime( &currentTime );
+ if ( pTM )
+ {
+ DateStr.Format( "D:%04d%02d%02d%02d%02d%02d", pTM->tm_year+1900, pTM->tm_mon+1,
+ pTM->tm_mday, pTM->tm_hour, pTM->tm_min, pTM->tm_sec );
+ }
+ }
+ }
+
+ CPDF_Dictionary* pInfoDict = NULL;
+ pInfoDict = pDoc->GetInfo();
+ if (pInfoDict)
+ {
+ if(FSDK_IsSandBoxPolicyEnabled(FPDF_POLICY_MACHINETIME_ACCESS))
+ pInfoDict->SetAt("CreationDate", new CPDF_String(DateStr));
+#ifdef FOXIT_CHROME_BUILD
+ pInfoDict->SetAt("Creator",FX_NEW CPDF_String(L"Google"));
+#else
+ pInfoDict->SetAt("Creator",FX_NEW CPDF_String(L"Foxit PDF SDK DLL 2.0 - Foxit Software"));
+#endif
+ }
+
+ return pDoc;
+}
+
+DLLEXPORT void STDCALL FPDFPage_Delete(FPDF_DOCUMENT document, int page_index)
+{
+ CPDF_Document* pDoc = (CPDF_Document*)document;
+ if (pDoc == NULL)
+ return;
+ if (page_index < 0 || page_index >= pDoc->GetPageCount())
+ return;
+
+ pDoc->DeletePage(page_index);
+}
+
+DLLEXPORT FPDF_PAGE STDCALL FPDFPage_New(FPDF_DOCUMENT document, int page_index, double width, double height)
+{
+ if (!document)
+ return NULL;
+
+// CPDF_Parser* pParser = (CPDF_Parser*)document;
+ CPDF_Document* pDoc = (CPDF_Document*)document;
+ if(page_index < 0)
+ page_index = 0;
+ if(pDoc->GetPageCount()<page_index)
+ page_index = pDoc->GetPageCount();
+// if (page_index < 0 || page_index >= pDoc->GetPageCount())
+// return NULL;
+
+ CPDF_Dictionary* pPageDict = pDoc->CreateNewPage(page_index);
+ if(!pPageDict)
+ return NULL;
+ CPDF_Array* pMediaBoxArray = FX_NEW CPDF_Array;
+ pMediaBoxArray->Add(FX_NEW CPDF_Number(0));
+ pMediaBoxArray->Add(FX_NEW CPDF_Number(0));
+ pMediaBoxArray->Add(FX_NEW CPDF_Number(FX_FLOAT(width)));
+ pMediaBoxArray->Add(FX_NEW CPDF_Number(FX_FLOAT(height)));
+
+ pPageDict->SetAt("MediaBox", pMediaBoxArray);
+ pPageDict->SetAt("Rotate", FX_NEW CPDF_Number(0));
+ pPageDict->SetAt("Resources", FX_NEW CPDF_Dictionary);
+
+ CPDF_Page* pPage = FX_NEW CPDF_Page;
+ pPage->Load(pDoc,pPageDict);
+ pPage->ParseContent();
+
+ return pPage;
+}
+
+DLLEXPORT int STDCALL FPDFPage_GetRotation(FPDF_PAGE page)
+{
+ CPDF_Page* pPage = (CPDF_Page*)page;
+ if (!pPage || !pPage->m_pFormDict || !pPage->m_pFormDict->KeyExist("Type")
+ || pPage->m_pFormDict->GetElement("Type")->GetDirect()->GetString().Compare("Page"))
+ {
+ return -1;
+ }
+ CPDF_Dictionary* pDict = pPage->m_pFormDict;
+
+ int rotate = 0;
+ if(pDict != NULL)
+ {
+ if(pDict->KeyExist("Rotate"))
+ rotate = pDict->GetElement("Rotate")->GetDirect()->GetInteger() / 90;
+ else
+ {
+ if(pDict->KeyExist("Parent"))
+ {
+ CPDF_Dictionary* pPages = (CPDF_Dictionary*)pDict->GetElement("Parent")->GetDirect();
+ while(pPages)
+ {
+ if(pPages->KeyExist("Rotate"))
+ {
+ rotate = pPages->GetElement("Rotate")->GetDirect()->GetInteger() / 90;
+ break;
+ }
+ else if(pPages->KeyExist("Parent"))
+ pPages = (CPDF_Dictionary*)pPages->GetElement("Parent")->GetDirect();
+ else break;
+ }
+ }
+ }
+ }
+ else
+ {
+ return -1;
+ }
+
+ return rotate;
+}
+
+DLLEXPORT void STDCALL FPDFPage_InsertObject(FPDF_PAGE page, FPDF_PAGEOBJECT page_obj)
+{
+ CPDF_Page* pPage = (CPDF_Page*)page;
+ if (!pPage || !pPage->m_pFormDict || !pPage->m_pFormDict->KeyExist("Type")
+ || pPage->m_pFormDict->GetElement("Type")->GetDirect()->GetString().Compare("Page"))
+ {
+ return;
+ }
+ CPDF_PageObject* pPageObj = (CPDF_PageObject*)page_obj;
+ if(pPageObj == NULL)
+ return;
+ FX_POSITION LastPersition = pPage->GetLastObjectPosition();
+
+ pPage->InsertObject(LastPersition, pPageObj);
+ switch(pPageObj->m_Type)
+ {
+ case FPDF_PAGEOBJ_PATH:
+ {
+ CPDF_PathObject* pPathObj = (CPDF_PathObject*)pPageObj;
+ pPathObj->CalcBoundingBox();
+ break;
+ }
+ case FPDF_PAGEOBJ_TEXT:
+ {
+ // CPDF_PathObject* pPathObj = (CPDF_PathObject*)pPageObj;
+ // pPathObj->CalcBoundingBox();
+ break;
+ }
+ case FPDF_PAGEOBJ_IMAGE:
+ {
+ CPDF_ImageObject* pImageObj = (CPDF_ImageObject*)pPageObj;
+ pImageObj->CalcBoundingBox();
+ break;
+ }
+ case FPDF_PAGEOBJ_SHADING:
+ {
+ CPDF_ShadingObject* pShadingObj = (CPDF_ShadingObject*)pPageObj;
+ pShadingObj->CalcBoundingBox();
+ break;
+ }
+ case FPDF_PAGEOBJ_FORM:
+ {
+ CPDF_FormObject* pFormObj = (CPDF_FormObject*)pPageObj;
+ pFormObj->CalcBoundingBox();
+ break;
+ }
+ default:
+ break;
+ }
+
+ // pPage->ParseContent();
+ //pPage->GenerateContent();
+
+}
+
+DLLEXPORT int STDCALL FPDFPage_CountObject(FPDF_PAGE page)
+{
+ CPDF_Page* pPage = (CPDF_Page*)page;
+ if (!pPage || !pPage->m_pFormDict || !pPage->m_pFormDict->KeyExist("Type")
+ || pPage->m_pFormDict->GetElement("Type")->GetDirect()->GetString().Compare("Page"))
+ {
+ return -1;
+ }
+ return pPage->CountObjects();
+// return 0;
+}
+
+DLLEXPORT FPDF_PAGEOBJECT STDCALL FPDFPage_GetObject(FPDF_PAGE page, int index)
+{
+ CPDF_Page* pPage = (CPDF_Page*)page;
+ if (!pPage || !pPage->m_pFormDict || !pPage->m_pFormDict->KeyExist("Type")
+ || pPage->m_pFormDict->GetElement("Type")->GetDirect()->GetString().Compare("Page"))
+ {
+ return NULL;
+ }
+ return pPage->GetObjectByIndex(index);
+// return NULL;
+}
+
+DLLEXPORT FPDF_BOOL STDCALL FPDFPage_HasTransparency(FPDF_PAGE page)
+{
+ if(!page) return FALSE;
+ CPDF_Page* pPage = (CPDF_Page*)page;
+
+ return pPage->BackgroundAlphaNeeded();
+}
+
+DLLEXPORT FPDF_BOOL STDCALL FPDFPageObj_HasTransparency(FPDF_PAGEOBJECT pageObject)
+{
+ if(!pageObject) return FALSE;
+ CPDF_PageObject* pPageObj = (CPDF_PageObject*)pageObject;
+
+ const CPDF_GeneralStateData* pGeneralState = pPageObj->m_GeneralState;
+ int blend_type = pGeneralState ? pGeneralState->m_BlendType : FXDIB_BLEND_NORMAL;
+ if (blend_type != FXDIB_BLEND_NORMAL) return TRUE;
+
+ CPDF_Dictionary* pSMaskDict = pGeneralState ? (CPDF_Dictionary*)pGeneralState->m_pSoftMask : NULL;
+ if(pSMaskDict) return TRUE;
+
+ if(pGeneralState && pGeneralState->m_FillAlpha != 1.0f)
+ return TRUE;
+
+ if(pPageObj->m_Type == PDFPAGE_PATH)
+ {
+ if(pGeneralState && pGeneralState->m_StrokeAlpha != 1.0f)
+ return TRUE;
+ }
+
+ if(pPageObj->m_Type == PDFPAGE_FORM)
+ {
+ CPDF_FormObject* pFormObj = (CPDF_FormObject*)pPageObj;
+ if(pFormObj->m_pForm && (pFormObj->m_pForm->m_Transparency & PDFTRANS_ISOLATED))
+ return TRUE;
+ if(pFormObj->m_pForm && (!(pFormObj->m_pForm->m_Transparency & PDFTRANS_ISOLATED) && (pFormObj->m_pForm->m_Transparency & PDFTRANS_GROUP)))
+ return TRUE;
+ }
+ return FALSE;
+}
+
+DLLEXPORT FPDF_BOOL STDCALL FPDFPage_GenerateContent(FPDF_PAGE page)
+{
+ CPDF_Page* pPage = (CPDF_Page*)page;
+ if (!pPage || !pPage->m_pFormDict || !pPage->m_pFormDict->KeyExist("Type")
+ || pPage->m_pFormDict->GetElement("Type")->GetDirect()->GetString().Compare("Page"))
+ {
+ return FALSE;
+ }
+ CPDF_PageContentGenerate CG(pPage);
+ CG.GenerateContent();
+
+ return TRUE;
+}
+
+DLLEXPORT void STDCALL FPDFPageObj_Transform(FPDF_PAGEOBJECT page_object,
+ double a, double b, double c, double d, double e, double f)
+{
+ CPDF_PageObject* pPageObj = (CPDF_PageObject*)page_object;
+ if(pPageObj == NULL)
+ return;
+//PDF_ImageObject* pImageObj = FX_NEW CPDF_ImageObject;
+ CFX_AffineMatrix matrix((FX_FLOAT)a,(FX_FLOAT)b,(FX_FLOAT)c,(FX_FLOAT)d,(FX_FLOAT)e,(FX_FLOAT)f);
+ pPageObj->Transform(matrix);
+}
+DLLEXPORT void STDCALL FPDFPage_TransformAnnots(FPDF_PAGE page,
+ double a, double b, double c, double d, double e, double f)
+{
+ if(page == NULL)
+ return;
+ CPDF_Page* pPage = (CPDF_Page*)page;
+ CPDF_AnnotList AnnotList(pPage);
+ for (int i=0; i<AnnotList.Count();i++)
+ {
+ CPDF_Annot* pAnnot = AnnotList.GetAt(i);
+ // transformAnnots Rectangle
+ CPDF_Rect rect;
+ pAnnot->GetRect(rect);
+ CFX_AffineMatrix matrix((FX_FLOAT)a,(FX_FLOAT)b,(FX_FLOAT)c,(FX_FLOAT)d,(FX_FLOAT)e,(FX_FLOAT)f);
+ rect.Transform(&matrix);
+ CPDF_Array *pRectArray = NULL;
+ pRectArray = pAnnot->m_pAnnotDict->GetArray("Rect");
+ if (!pRectArray) pRectArray=CPDF_Array::Create();
+ pRectArray->SetAt(0,FX_NEW CPDF_Number(rect.left));
+ pRectArray->SetAt(1,FX_NEW CPDF_Number(rect.bottom));
+ pRectArray->SetAt(2,FX_NEW CPDF_Number(rect.right));
+ pRectArray->SetAt(3,FX_NEW CPDF_Number(rect.top));
+ pAnnot->m_pAnnotDict->SetAt("Rect",pRectArray);
+
+ //Transform AP's rectangle
+ //To Do
+
+ }
+
+}
diff --git a/fpdfsdk/src/fpdfformfill.cpp b/fpdfsdk/src/fpdfformfill.cpp
index 101146b099..2de76033fe 100644
--- a/fpdfsdk/src/fpdfformfill.cpp
+++ b/fpdfsdk/src/fpdfformfill.cpp
@@ -1,441 +1,441 @@
-// 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
-
-#include "../include/fpdfview.h"
-#include "../include/fpdfformfill.h"
-#include "../include/fsdk_define.h"
-#include "../include/fsdk_mgr.h"
-
-
-#include "../include/javascript/IJavaScript.h"
-
-
-DLLEXPORT int STDCALL FPDPage_HasFormFieldAtPoint(FPDF_FORMHANDLE hHandle, FPDF_PAGE page,double page_x, double page_y)
-{
- if(!page || !hHandle)
- return -1;
- CPDF_Page * pPage = (CPDF_Page*) page;
-
- CPDF_InterForm * pInterForm = NULL;
- pInterForm = new CPDF_InterForm(pPage->m_pDocument,FALSE);
- if (!pInterForm)
- return -1;
- CPDF_FormControl* pFormCtrl = pInterForm->GetControlAtPoint(pPage, (FX_FLOAT)page_x, (FX_FLOAT)page_y);
- if(!pFormCtrl)
- {
- delete pInterForm;
- return -1;
- }
- CPDF_FormField* pFormField = pFormCtrl->GetField();
- if(!pFormField)
- {
- delete pInterForm;
- return -1;
- }
-
- int nType = pFormField->GetFieldType();
- delete pInterForm;
- return nType;
-}
-
-DLLEXPORT FPDF_FORMHANDLE STDCALL FPDFDOC_InitFormFillEnviroument(FPDF_DOCUMENT document, FPDF_FORMFILLINFO* formInfo)
-{
- if(!document || !formInfo || formInfo->version!=1)
- return NULL;
- CPDF_Document * pDocument = (CPDF_Document*) document;
- CPDFDoc_Environment * pEnv = NULL;
- pEnv = new CPDFDoc_Environment(pDocument);
- if (!pEnv)
- return NULL;
- pEnv->RegAppHandle(formInfo);
-
- if(pEnv->GetPDFDocument())
- {
- CPDFSDK_Document* pSDKDoc = new CPDFSDK_Document(pEnv->GetPDFDocument(), pEnv);
- if(pSDKDoc)
- pEnv->SetCurrentDoc(pSDKDoc);
- }
- return pEnv;
-}
-
-DLLEXPORT void STDCALL FPDFDOC_ExitFormFillEnviroument(FPDF_FORMHANDLE hHandle)
-{
- if(!hHandle)
- return;
- CPDFSDK_Document* pSDKDoc = ((CPDFDoc_Environment*)hHandle)->GetCurrentDoc();
- if(pSDKDoc)
- {
- ((CPDFDoc_Environment*)hHandle)->SetCurrentDoc(NULL);
- delete pSDKDoc;
- }
- delete (CPDFDoc_Environment*)hHandle;
- hHandle = NULL;
-}
-
-DLLEXPORT FPDF_BOOL STDCALL FORM_OnMouseMove(FPDF_FORMHANDLE hHandle, FPDF_PAGE page, int modifier, double page_x, double page_y)
-{
- if (!hHandle || !page)
- return FALSE;
-// CPDF_Page * pPage = (CPDF_Page*) page;
-// CPDF_Document * pDoc = pPage->m_pDocument;
-// CPDFDoc_Environment* pEnv = (CPDFDoc_Environment*)hHandle;
- CPDFSDK_Document* pFXDoc = ((CPDFDoc_Environment*)hHandle)->GetCurrentDoc();
- if(!pFXDoc)
- return FALSE;
- CPDFSDK_PageView* pPageView = pFXDoc->GetPageView((CPDF_Page*)page);
- if(!pPageView)
- return FALSE;
-
-// double page_x = 0;
-// double page_y = 0;
-// pEnv->FFI_DeviceToPage(page, point_x, point_y, &page_x, &page_y);
- CPDF_Point pt((FX_FLOAT)page_x, (FX_FLOAT)page_y);
- return pPageView->OnMouseMove(pt, modifier);
-}
-
-DLLEXPORT FPDF_BOOL STDCALL FORM_OnLButtonDown(FPDF_FORMHANDLE hHandle, FPDF_PAGE page, int modifier, double page_x, double page_y)
-{
- if (!hHandle || !page)
- return FALSE;
- CPDFSDK_Document* pFXDoc = ((CPDFDoc_Environment*)hHandle)->GetCurrentDoc();
- if(!pFXDoc)
- return FALSE;
- CPDFSDK_PageView* pPageView = pFXDoc->GetPageView((CPDF_Page*)page);
- if(!pPageView)
- return FALSE;
-// double page_x = 0;
-// double page_y = 0;
-// pEnv->FFI_DeviceToPage(page, point_x, point_y, &page_x, &page_y);
- CPDF_Point pt((FX_FLOAT)page_x, (FX_FLOAT)page_y);
- return pPageView->OnLButtonDown(pt, modifier);
-}
-
-DLLEXPORT FPDF_BOOL STDCALL FORM_OnLButtonUp(FPDF_FORMHANDLE hHandle, FPDF_PAGE page, int modifier, double page_x, double page_y)
-{
- if (!hHandle || !page)
- return FALSE;
- CPDFSDK_Document* pFXDoc = ((CPDFDoc_Environment*)hHandle)->GetCurrentDoc();
- if(!pFXDoc)
- return FALSE;
- CPDFSDK_PageView* pPageView = pFXDoc->GetPageView((CPDF_Page*)page);
- if(!pPageView)
- return FALSE;
-// double page_x = 0;
-// double page_y = 0;
-// pEnv->FFI_DeviceToPage(page, point_x, point_y, &page_x, &page_y);
- CPDF_Point pt((FX_FLOAT)page_x, (FX_FLOAT)page_y);
- return pPageView->OnLButtonUp(pt, modifier);
-}
-
-DLLEXPORT FPDF_BOOL STDCALL FORM_OnKeyDown(FPDF_FORMHANDLE hHandle, FPDF_PAGE page, int nKeyCode, int modifier)
-{
- if (!hHandle || !page)
- return FALSE;
- CPDFSDK_Document* pFXDoc = ((CPDFDoc_Environment*)hHandle)->GetCurrentDoc();
- if(!pFXDoc)
- return FALSE;
- CPDFSDK_PageView* pPageView = pFXDoc->GetPageView((CPDF_Page*)page);
- if(!pPageView)
- return FALSE;
-
-
- return pPageView->OnKeyDown(nKeyCode, modifier);
-}
-
-DLLEXPORT FPDF_BOOL STDCALL FORM_OnKeyUp(FPDF_FORMHANDLE hHandle, FPDF_PAGE page, int nKeyCode, int modifier)
-{
- if (!hHandle || !page)
- return FALSE;
- CPDFSDK_Document* pFXDoc = ((CPDFDoc_Environment*)hHandle)->GetCurrentDoc();
- if(!pFXDoc)
- return FALSE;
- CPDFSDK_PageView* pPageView = pFXDoc->GetPageView((CPDF_Page*)page);
- if(!pPageView)
- return FALSE;
-
-
- return pPageView->OnKeyUp(nKeyCode, modifier);
-}
-
-
-DLLEXPORT FPDF_BOOL STDCALL FORM_OnChar(FPDF_FORMHANDLE hHandle, FPDF_PAGE page, int nChar, int modifier)
-{
- if (!hHandle || !page)
- return FALSE;
- CPDFSDK_Document* pFXDoc = ((CPDFDoc_Environment*)hHandle)->GetCurrentDoc();
- if(!pFXDoc)
- return FALSE;
- CPDFSDK_PageView* pPageView = pFXDoc->GetPageView((CPDF_Page*)page);
- if(!pPageView)
- return FALSE;
- return pPageView->OnChar(nChar, modifier);
-
-}
-
-DLLEXPORT FPDF_BOOL STDCALL FORM_ForceToKillFocus(FPDF_FORMHANDLE hHandle)
-{
- if(!hHandle)
- return FALSE;
- CPDFSDK_Document* pSDKDoc = ((CPDFDoc_Environment*)hHandle)->GetCurrentDoc();
- if(!pSDKDoc)
- return FALSE;
- //Kill the current focus.
- return pSDKDoc->KillFocusAnnot(0);
-}
-
-DLLEXPORT void STDCALL FPDF_FFLDraw(FPDF_FORMHANDLE hHandle, FPDF_BITMAP bitmap, FPDF_PAGE page, int start_x, int start_y,
- int size_x, int size_y, int rotate, int flags)
-{
- if (!hHandle || !page)
- return ;
- CPDF_Page* pPage = (CPDF_Page*)page;
-
- CPDF_RenderOptions options;
- if (flags & FPDF_LCD_TEXT)
- options.m_Flags |= RENDER_CLEARTYPE;
- else
- options.m_Flags &= ~RENDER_CLEARTYPE;
-
- //Grayscale output
- if (flags & FPDF_GRAYSCALE)
- {
- options.m_ColorMode = RENDER_COLOR_GRAY;
- options.m_ForeColor = 0;
- options.m_BackColor = 0xffffff;
- }
-
- options.m_AddFlags = flags >> 8;
-
- options.m_pOCContext = FX_NEW CPDF_OCContext(pPage->m_pDocument);
-
- //FXMT_CSLOCK_OBJ(&pPage->m_PageLock);
-
- CFX_AffineMatrix matrix;
- pPage->GetDisplayMatrix(matrix, start_x, start_y, size_x, size_y, rotate);
-
- FX_RECT clip;
- clip.left = start_x;
- clip.right = start_x + size_x;
- clip.top = start_y;
- clip.bottom = start_y + size_y;
-
-#ifdef _SKIA_SUPPORT_
- CFX_SkiaDevice* pDevice = FX_NEW CFX_SkiaDevice;
-#else
- CFX_FxgeDevice* pDevice = NULL;
- pDevice = FX_NEW CFX_FxgeDevice;
-#endif
-
- if (!pDevice)
- return;
- pDevice->Attach((CFX_DIBitmap*)bitmap);
- pDevice->SaveState();
- pDevice->SetClip_Rect(&clip);
-
-
- CPDF_RenderContext* pContext = NULL;
- pContext = FX_NEW CPDF_RenderContext;
- if (!pContext)
- {
- delete pDevice;
- pDevice = NULL;
- return;
- }
-
-
-// CPDF_Document* pDoc = pPage->m_pDocument;
- CPDFDoc_Environment* pEnv = (CPDFDoc_Environment*)hHandle;
- CPDFSDK_Document* pFXDoc = pEnv->GetCurrentDoc();
- if(!pFXDoc)
- {
- delete pContext;
- delete pDevice;
- pContext = NULL;
- pDevice = NULL;
- return;
- }
- if(CPDFSDK_PageView* pPageView = pFXDoc->GetPageView(pPage))
- {
- pPageView->PageView_OnDraw(pDevice, &matrix, &options);
- }
- pDevice->RestoreState();
-
- if(options.m_pOCContext)
- {
- delete options.m_pOCContext;
- options.m_pOCContext = NULL;
- }
- if(pContext)
- {
- delete pContext;
- pContext = NULL;
- }
- if(pDevice)
- {
- delete pDevice;
- pDevice = NULL;
- }
-
-}
-
-DLLEXPORT void STDCALL FPDF_SetFormFieldHighlightColor(FPDF_FORMHANDLE hHandle, int fieldType, unsigned long color)
-{
- if (!hHandle)
- return;
-// CPDFDoc_Environment* pEnv = (CPDFDoc_Environment* )hHandle;
- CPDFSDK_Document* pSDKDoc = ((CPDFDoc_Environment*)hHandle)->GetCurrentDoc();
- if(pSDKDoc)
- {
- if(CPDFSDK_InterForm* pInterForm = pSDKDoc->GetInterForm())
- {
- pInterForm->SetHighlightColor(color, fieldType);
- }
-
- }
-
-}
-
-DLLEXPORT void STDCALL FPDF_SetFormFieldHighlightAlpha(FPDF_FORMHANDLE hHandle, unsigned char alpha)
-{
- if (!hHandle)
- return;
- CPDFSDK_Document* pSDKDoc = ((CPDFDoc_Environment*)hHandle)->GetCurrentDoc();
- if(pSDKDoc)
- {
- if(CPDFSDK_InterForm* pInterForm = pSDKDoc->GetInterForm())
- pInterForm->SetHighlightAlpha(alpha);
- }
-}
-
-DLLEXPORT void STDCALL FPDF_RemoveFormFieldHighlight(FPDF_FORMHANDLE hHandle)
-{
- if (!hHandle)
- return;
- CPDFSDK_Document* pSDKDoc = ((CPDFDoc_Environment*)hHandle)->GetCurrentDoc();
- if(pSDKDoc)
- {
- if(CPDFSDK_InterForm* pInterForm = pSDKDoc->GetInterForm())
- pInterForm->RemoveAllHighLight();
- }
-}
-
-DLLEXPORT void STDCALL FORM_OnAfterLoadPage(FPDF_PAGE page, FPDF_FORMHANDLE hHandle)
-{
- if(!hHandle || !page)
- return;
- CPDFSDK_Document* pSDKDoc = ((CPDFDoc_Environment*)hHandle)->GetCurrentDoc();
- if(!pSDKDoc)
- return;
- CPDF_Page* pPage = (CPDF_Page*)page;
- CPDFSDK_PageView* pPageView = pSDKDoc->GetPageView(pPage, TRUE);
- if(pPageView)
- {
- pPageView->SetValid(TRUE);
- }
-}
-
-DLLEXPORT void STDCALL FORM_OnBeforeClosePage(FPDF_PAGE page, FPDF_FORMHANDLE hHandle)
-{
- if(!hHandle || !page)
- return;
- CPDFSDK_Document* pSDKDoc = ((CPDFDoc_Environment*)hHandle)->GetCurrentDoc();
- CPDF_Page* pPage = (CPDF_Page*)page;
- CPDFSDK_PageView* pPageView = pSDKDoc->GetPageView(pPage, FALSE);
- if(pPageView)
- {
- pPageView->SetValid(FALSE);
- // ReMovePageView() takes care of the delete for us.
- pSDKDoc->ReMovePageView(pPage);
- }
-}
-DLLEXPORT void STDCALL FORM_DoDocumentJSAction(FPDF_FORMHANDLE hHandle)
-{
- if(!hHandle)
- return;
- if( CPDFSDK_Document* pSDKDoc = ((CPDFDoc_Environment*)hHandle)->GetCurrentDoc())
- {
- pSDKDoc->InitPageView();
- if(((CPDFDoc_Environment*)hHandle)->IsJSInitiated())
- pSDKDoc->ProcJavascriptFun();
- }
-}
-
-DLLEXPORT void STDCALL FORM_DoDocumentOpenAction(FPDF_FORMHANDLE hHandle)
-{
- if(!hHandle)
- return;
- if( CPDFSDK_Document* pSDKDoc = ((CPDFDoc_Environment*)hHandle)->GetCurrentDoc())
- {
- if(((CPDFDoc_Environment*)hHandle)->IsJSInitiated())
- pSDKDoc->ProcOpenAction();
- }
-}
-DLLEXPORT void STDCALL FORM_DoDocumentAAction(FPDF_FORMHANDLE hHandle, int aaType)
-{
- if(!hHandle)
- return;
- CPDFSDK_Document* pSDKDoc = ((CPDFDoc_Environment*)hHandle)->GetCurrentDoc();
- if(pSDKDoc)
- {
- CPDF_Document* pDoc = pSDKDoc->GetDocument();
- CPDF_Dictionary* pDic = pDoc->GetRoot();
- if (!pDic)
- return;
- CPDF_AAction aa = pDic->GetDict(FX_BSTRC("AA"));
-
- if(aa.ActionExist((CPDF_AAction::AActionType)aaType))
- {
- CPDF_Action action = aa.GetAction((CPDF_AAction::AActionType)aaType);
- CPDFSDK_ActionHandler *pActionHandler = ((CPDFDoc_Environment*)hHandle)->GetActionHander();
- ASSERT(pActionHandler != NULL);
- pActionHandler->DoAction_Document(action, (CPDF_AAction::AActionType)aaType, pSDKDoc);
- }
- }
-}
-DLLEXPORT void STDCALL FORM_DoPageAAction(FPDF_PAGE page, FPDF_FORMHANDLE hHandle, int aaType)
-{
- if(!hHandle || !page)
- return;
- CPDFSDK_Document* pSDKDoc = ((CPDFDoc_Environment*)hHandle)->GetCurrentDoc();
- CPDF_Page* pPage = (CPDF_Page*)page;
- CPDFSDK_PageView* pPageView = pSDKDoc->GetPageView(pPage, FALSE);
- if(pPageView)
- {
- CPDFDoc_Environment *pEnv = pSDKDoc->GetEnv();
- ASSERT(pEnv != NULL);
-
- CPDFSDK_ActionHandler *pActionHandler = pEnv->GetActionHander();
- ASSERT(pActionHandler != NULL);
-
- CPDF_Dictionary *pPageDict = pPage->m_pFormDict;
- ASSERT(pPageDict != NULL);
-
- CPDF_AAction aa = pPageDict->GetDict(FX_BSTRC("AA"));
-
- FX_BOOL bExistOAAction = FALSE;
- FX_BOOL bExistCAAction = FALSE;
- if (FPDFPAGE_AACTION_OPEN == aaType)
- {
- bExistOAAction = aa.ActionExist(CPDF_AAction::OpenPage);
- if (bExistOAAction)
- {
- CPDF_Action action = aa.GetAction(CPDF_AAction::OpenPage);
- pActionHandler->DoAction_Page(action, CPDF_AAction::OpenPage, pSDKDoc);
- }
- }
- else
- {
- bExistCAAction = aa.ActionExist(CPDF_AAction::ClosePage);
- if (bExistCAAction)
- {
- CPDF_Action action = aa.GetAction(CPDF_AAction::ClosePage);
- pActionHandler->DoAction_Page(action, CPDF_AAction::ClosePage, pSDKDoc);
- }
- }
- }
-}
-
-
+// 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
+
+#include "../include/fpdfview.h"
+#include "../include/fpdfformfill.h"
+#include "../include/fsdk_define.h"
+#include "../include/fsdk_mgr.h"
+
+
+#include "../include/javascript/IJavaScript.h"
+
+
+DLLEXPORT int STDCALL FPDPage_HasFormFieldAtPoint(FPDF_FORMHANDLE hHandle, FPDF_PAGE page,double page_x, double page_y)
+{
+ if(!page || !hHandle)
+ return -1;
+ CPDF_Page * pPage = (CPDF_Page*) page;
+
+ CPDF_InterForm * pInterForm = NULL;
+ pInterForm = new CPDF_InterForm(pPage->m_pDocument,FALSE);
+ if (!pInterForm)
+ return -1;
+ CPDF_FormControl* pFormCtrl = pInterForm->GetControlAtPoint(pPage, (FX_FLOAT)page_x, (FX_FLOAT)page_y);
+ if(!pFormCtrl)
+ {
+ delete pInterForm;
+ return -1;
+ }
+ CPDF_FormField* pFormField = pFormCtrl->GetField();
+ if(!pFormField)
+ {
+ delete pInterForm;
+ return -1;
+ }
+
+ int nType = pFormField->GetFieldType();
+ delete pInterForm;
+ return nType;
+}
+
+DLLEXPORT FPDF_FORMHANDLE STDCALL FPDFDOC_InitFormFillEnviroument(FPDF_DOCUMENT document, FPDF_FORMFILLINFO* formInfo)
+{
+ if(!document || !formInfo || formInfo->version!=1)
+ return NULL;
+ CPDF_Document * pDocument = (CPDF_Document*) document;
+ CPDFDoc_Environment * pEnv = NULL;
+ pEnv = new CPDFDoc_Environment(pDocument);
+ if (!pEnv)
+ return NULL;
+ pEnv->RegAppHandle(formInfo);
+
+ if(pEnv->GetPDFDocument())
+ {
+ CPDFSDK_Document* pSDKDoc = new CPDFSDK_Document(pEnv->GetPDFDocument(), pEnv);
+ if(pSDKDoc)
+ pEnv->SetCurrentDoc(pSDKDoc);
+ }
+ return pEnv;
+}
+
+DLLEXPORT void STDCALL FPDFDOC_ExitFormFillEnviroument(FPDF_FORMHANDLE hHandle)
+{
+ if(!hHandle)
+ return;
+ CPDFSDK_Document* pSDKDoc = ((CPDFDoc_Environment*)hHandle)->GetCurrentDoc();
+ if(pSDKDoc)
+ {
+ ((CPDFDoc_Environment*)hHandle)->SetCurrentDoc(NULL);
+ delete pSDKDoc;
+ }
+ delete (CPDFDoc_Environment*)hHandle;
+ hHandle = NULL;
+}
+
+DLLEXPORT FPDF_BOOL STDCALL FORM_OnMouseMove(FPDF_FORMHANDLE hHandle, FPDF_PAGE page, int modifier, double page_x, double page_y)
+{
+ if (!hHandle || !page)
+ return FALSE;
+// CPDF_Page * pPage = (CPDF_Page*) page;
+// CPDF_Document * pDoc = pPage->m_pDocument;
+// CPDFDoc_Environment* pEnv = (CPDFDoc_Environment*)hHandle;
+ CPDFSDK_Document* pFXDoc = ((CPDFDoc_Environment*)hHandle)->GetCurrentDoc();
+ if(!pFXDoc)
+ return FALSE;
+ CPDFSDK_PageView* pPageView = pFXDoc->GetPageView((CPDF_Page*)page);
+ if(!pPageView)
+ return FALSE;
+
+// double page_x = 0;
+// double page_y = 0;
+// pEnv->FFI_DeviceToPage(page, point_x, point_y, &page_x, &page_y);
+ CPDF_Point pt((FX_FLOAT)page_x, (FX_FLOAT)page_y);
+ return pPageView->OnMouseMove(pt, modifier);
+}
+
+DLLEXPORT FPDF_BOOL STDCALL FORM_OnLButtonDown(FPDF_FORMHANDLE hHandle, FPDF_PAGE page, int modifier, double page_x, double page_y)
+{
+ if (!hHandle || !page)
+ return FALSE;
+ CPDFSDK_Document* pFXDoc = ((CPDFDoc_Environment*)hHandle)->GetCurrentDoc();
+ if(!pFXDoc)
+ return FALSE;
+ CPDFSDK_PageView* pPageView = pFXDoc->GetPageView((CPDF_Page*)page);
+ if(!pPageView)
+ return FALSE;
+// double page_x = 0;
+// double page_y = 0;
+// pEnv->FFI_DeviceToPage(page, point_x, point_y, &page_x, &page_y);
+ CPDF_Point pt((FX_FLOAT)page_x, (FX_FLOAT)page_y);
+ return pPageView->OnLButtonDown(pt, modifier);
+}
+
+DLLEXPORT FPDF_BOOL STDCALL FORM_OnLButtonUp(FPDF_FORMHANDLE hHandle, FPDF_PAGE page, int modifier, double page_x, double page_y)
+{
+ if (!hHandle || !page)
+ return FALSE;
+ CPDFSDK_Document* pFXDoc = ((CPDFDoc_Environment*)hHandle)->GetCurrentDoc();
+ if(!pFXDoc)
+ return FALSE;
+ CPDFSDK_PageView* pPageView = pFXDoc->GetPageView((CPDF_Page*)page);
+ if(!pPageView)
+ return FALSE;
+// double page_x = 0;
+// double page_y = 0;
+// pEnv->FFI_DeviceToPage(page, point_x, point_y, &page_x, &page_y);
+ CPDF_Point pt((FX_FLOAT)page_x, (FX_FLOAT)page_y);
+ return pPageView->OnLButtonUp(pt, modifier);
+}
+
+DLLEXPORT FPDF_BOOL STDCALL FORM_OnKeyDown(FPDF_FORMHANDLE hHandle, FPDF_PAGE page, int nKeyCode, int modifier)
+{
+ if (!hHandle || !page)
+ return FALSE;
+ CPDFSDK_Document* pFXDoc = ((CPDFDoc_Environment*)hHandle)->GetCurrentDoc();
+ if(!pFXDoc)
+ return FALSE;
+ CPDFSDK_PageView* pPageView = pFXDoc->GetPageView((CPDF_Page*)page);
+ if(!pPageView)
+ return FALSE;
+
+
+ return pPageView->OnKeyDown(nKeyCode, modifier);
+}
+
+DLLEXPORT FPDF_BOOL STDCALL FORM_OnKeyUp(FPDF_FORMHANDLE hHandle, FPDF_PAGE page, int nKeyCode, int modifier)
+{
+ if (!hHandle || !page)
+ return FALSE;
+ CPDFSDK_Document* pFXDoc = ((CPDFDoc_Environment*)hHandle)->GetCurrentDoc();
+ if(!pFXDoc)
+ return FALSE;
+ CPDFSDK_PageView* pPageView = pFXDoc->GetPageView((CPDF_Page*)page);
+ if(!pPageView)
+ return FALSE;
+
+
+ return pPageView->OnKeyUp(nKeyCode, modifier);
+}
+
+
+DLLEXPORT FPDF_BOOL STDCALL FORM_OnChar(FPDF_FORMHANDLE hHandle, FPDF_PAGE page, int nChar, int modifier)
+{
+ if (!hHandle || !page)
+ return FALSE;
+ CPDFSDK_Document* pFXDoc = ((CPDFDoc_Environment*)hHandle)->GetCurrentDoc();
+ if(!pFXDoc)
+ return FALSE;
+ CPDFSDK_PageView* pPageView = pFXDoc->GetPageView((CPDF_Page*)page);
+ if(!pPageView)
+ return FALSE;
+ return pPageView->OnChar(nChar, modifier);
+
+}
+
+DLLEXPORT FPDF_BOOL STDCALL FORM_ForceToKillFocus(FPDF_FORMHANDLE hHandle)
+{
+ if(!hHandle)
+ return FALSE;
+ CPDFSDK_Document* pSDKDoc = ((CPDFDoc_Environment*)hHandle)->GetCurrentDoc();
+ if(!pSDKDoc)
+ return FALSE;
+ //Kill the current focus.
+ return pSDKDoc->KillFocusAnnot(0);
+}
+
+DLLEXPORT void STDCALL FPDF_FFLDraw(FPDF_FORMHANDLE hHandle, FPDF_BITMAP bitmap, FPDF_PAGE page, int start_x, int start_y,
+ int size_x, int size_y, int rotate, int flags)
+{
+ if (!hHandle || !page)
+ return ;
+ CPDF_Page* pPage = (CPDF_Page*)page;
+
+ CPDF_RenderOptions options;
+ if (flags & FPDF_LCD_TEXT)
+ options.m_Flags |= RENDER_CLEARTYPE;
+ else
+ options.m_Flags &= ~RENDER_CLEARTYPE;
+
+ //Grayscale output
+ if (flags & FPDF_GRAYSCALE)
+ {
+ options.m_ColorMode = RENDER_COLOR_GRAY;
+ options.m_ForeColor = 0;
+ options.m_BackColor = 0xffffff;
+ }
+
+ options.m_AddFlags = flags >> 8;
+
+ options.m_pOCContext = FX_NEW CPDF_OCContext(pPage->m_pDocument);
+
+ //FXMT_CSLOCK_OBJ(&pPage->m_PageLock);
+
+ CFX_AffineMatrix matrix;
+ pPage->GetDisplayMatrix(matrix, start_x, start_y, size_x, size_y, rotate);
+
+ FX_RECT clip;
+ clip.left = start_x;
+ clip.right = start_x + size_x;
+ clip.top = start_y;
+ clip.bottom = start_y + size_y;
+
+#ifdef _SKIA_SUPPORT_
+ CFX_SkiaDevice* pDevice = FX_NEW CFX_SkiaDevice;
+#else
+ CFX_FxgeDevice* pDevice = NULL;
+ pDevice = FX_NEW CFX_FxgeDevice;
+#endif
+
+ if (!pDevice)
+ return;
+ pDevice->Attach((CFX_DIBitmap*)bitmap);
+ pDevice->SaveState();
+ pDevice->SetClip_Rect(&clip);
+
+
+ CPDF_RenderContext* pContext = NULL;
+ pContext = FX_NEW CPDF_RenderContext;
+ if (!pContext)
+ {
+ delete pDevice;
+ pDevice = NULL;
+ return;
+ }
+
+
+// CPDF_Document* pDoc = pPage->m_pDocument;
+ CPDFDoc_Environment* pEnv = (CPDFDoc_Environment*)hHandle;
+ CPDFSDK_Document* pFXDoc = pEnv->GetCurrentDoc();
+ if(!pFXDoc)
+ {
+ delete pContext;
+ delete pDevice;
+ pContext = NULL;
+ pDevice = NULL;
+ return;
+ }
+ if(CPDFSDK_PageView* pPageView = pFXDoc->GetPageView(pPage))
+ {
+ pPageView->PageView_OnDraw(pDevice, &matrix, &options);
+ }
+ pDevice->RestoreState();
+
+ if(options.m_pOCContext)
+ {
+ delete options.m_pOCContext;
+ options.m_pOCContext = NULL;
+ }
+ if(pContext)
+ {
+ delete pContext;
+ pContext = NULL;
+ }
+ if(pDevice)
+ {
+ delete pDevice;
+ pDevice = NULL;
+ }
+
+}
+
+DLLEXPORT void STDCALL FPDF_SetFormFieldHighlightColor(FPDF_FORMHANDLE hHandle, int fieldType, unsigned long color)
+{
+ if (!hHandle)
+ return;
+// CPDFDoc_Environment* pEnv = (CPDFDoc_Environment* )hHandle;
+ CPDFSDK_Document* pSDKDoc = ((CPDFDoc_Environment*)hHandle)->GetCurrentDoc();
+ if(pSDKDoc)
+ {
+ if(CPDFSDK_InterForm* pInterForm = pSDKDoc->GetInterForm())
+ {
+ pInterForm->SetHighlightColor(color, fieldType);
+ }
+
+ }
+
+}
+
+DLLEXPORT void STDCALL FPDF_SetFormFieldHighlightAlpha(FPDF_FORMHANDLE hHandle, unsigned char alpha)
+{
+ if (!hHandle)
+ return;
+ CPDFSDK_Document* pSDKDoc = ((CPDFDoc_Environment*)hHandle)->GetCurrentDoc();
+ if(pSDKDoc)
+ {
+ if(CPDFSDK_InterForm* pInterForm = pSDKDoc->GetInterForm())
+ pInterForm->SetHighlightAlpha(alpha);
+ }
+}
+
+DLLEXPORT void STDCALL FPDF_RemoveFormFieldHighlight(FPDF_FORMHANDLE hHandle)
+{
+ if (!hHandle)
+ return;
+ CPDFSDK_Document* pSDKDoc = ((CPDFDoc_Environment*)hHandle)->GetCurrentDoc();
+ if(pSDKDoc)
+ {
+ if(CPDFSDK_InterForm* pInterForm = pSDKDoc->GetInterForm())
+ pInterForm->RemoveAllHighLight();
+ }
+}
+
+DLLEXPORT void STDCALL FORM_OnAfterLoadPage(FPDF_PAGE page, FPDF_FORMHANDLE hHandle)
+{
+ if(!hHandle || !page)
+ return;
+ CPDFSDK_Document* pSDKDoc = ((CPDFDoc_Environment*)hHandle)->GetCurrentDoc();
+ if(!pSDKDoc)
+ return;
+ CPDF_Page* pPage = (CPDF_Page*)page;
+ CPDFSDK_PageView* pPageView = pSDKDoc->GetPageView(pPage, TRUE);
+ if(pPageView)
+ {
+ pPageView->SetValid(TRUE);
+ }
+}
+
+DLLEXPORT void STDCALL FORM_OnBeforeClosePage(FPDF_PAGE page, FPDF_FORMHANDLE hHandle)
+{
+ if(!hHandle || !page)
+ return;
+ CPDFSDK_Document* pSDKDoc = ((CPDFDoc_Environment*)hHandle)->GetCurrentDoc();
+ CPDF_Page* pPage = (CPDF_Page*)page;
+ CPDFSDK_PageView* pPageView = pSDKDoc->GetPageView(pPage, FALSE);
+ if(pPageView)
+ {
+ pPageView->SetValid(FALSE);
+ // ReMovePageView() takes care of the delete for us.
+ pSDKDoc->ReMovePageView(pPage);
+ }
+}
+DLLEXPORT void STDCALL FORM_DoDocumentJSAction(FPDF_FORMHANDLE hHandle)
+{
+ if(!hHandle)
+ return;
+ if( CPDFSDK_Document* pSDKDoc = ((CPDFDoc_Environment*)hHandle)->GetCurrentDoc())
+ {
+ pSDKDoc->InitPageView();
+ if(((CPDFDoc_Environment*)hHandle)->IsJSInitiated())
+ pSDKDoc->ProcJavascriptFun();
+ }
+}
+
+DLLEXPORT void STDCALL FORM_DoDocumentOpenAction(FPDF_FORMHANDLE hHandle)
+{
+ if(!hHandle)
+ return;
+ if( CPDFSDK_Document* pSDKDoc = ((CPDFDoc_Environment*)hHandle)->GetCurrentDoc())
+ {
+ if(((CPDFDoc_Environment*)hHandle)->IsJSInitiated())
+ pSDKDoc->ProcOpenAction();
+ }
+}
+DLLEXPORT void STDCALL FORM_DoDocumentAAction(FPDF_FORMHANDLE hHandle, int aaType)
+{
+ if(!hHandle)
+ return;
+ CPDFSDK_Document* pSDKDoc = ((CPDFDoc_Environment*)hHandle)->GetCurrentDoc();
+ if(pSDKDoc)
+ {
+ CPDF_Document* pDoc = pSDKDoc->GetDocument();
+ CPDF_Dictionary* pDic = pDoc->GetRoot();
+ if (!pDic)
+ return;
+ CPDF_AAction aa = pDic->GetDict(FX_BSTRC("AA"));
+
+ if(aa.ActionExist((CPDF_AAction::AActionType)aaType))
+ {
+ CPDF_Action action = aa.GetAction((CPDF_AAction::AActionType)aaType);
+ CPDFSDK_ActionHandler *pActionHandler = ((CPDFDoc_Environment*)hHandle)->GetActionHander();
+ ASSERT(pActionHandler != NULL);
+ pActionHandler->DoAction_Document(action, (CPDF_AAction::AActionType)aaType, pSDKDoc);
+ }
+ }
+}
+DLLEXPORT void STDCALL FORM_DoPageAAction(FPDF_PAGE page, FPDF_FORMHANDLE hHandle, int aaType)
+{
+ if(!hHandle || !page)
+ return;
+ CPDFSDK_Document* pSDKDoc = ((CPDFDoc_Environment*)hHandle)->GetCurrentDoc();
+ CPDF_Page* pPage = (CPDF_Page*)page;
+ CPDFSDK_PageView* pPageView = pSDKDoc->GetPageView(pPage, FALSE);
+ if(pPageView)
+ {
+ CPDFDoc_Environment *pEnv = pSDKDoc->GetEnv();
+ ASSERT(pEnv != NULL);
+
+ CPDFSDK_ActionHandler *pActionHandler = pEnv->GetActionHander();
+ ASSERT(pActionHandler != NULL);
+
+ CPDF_Dictionary *pPageDict = pPage->m_pFormDict;
+ ASSERT(pPageDict != NULL);
+
+ CPDF_AAction aa = pPageDict->GetDict(FX_BSTRC("AA"));
+
+ FX_BOOL bExistOAAction = FALSE;
+ FX_BOOL bExistCAAction = FALSE;
+ if (FPDFPAGE_AACTION_OPEN == aaType)
+ {
+ bExistOAAction = aa.ActionExist(CPDF_AAction::OpenPage);
+ if (bExistOAAction)
+ {
+ CPDF_Action action = aa.GetAction(CPDF_AAction::OpenPage);
+ pActionHandler->DoAction_Page(action, CPDF_AAction::OpenPage, pSDKDoc);
+ }
+ }
+ else
+ {
+ bExistCAAction = aa.ActionExist(CPDF_AAction::ClosePage);
+ if (bExistCAAction)
+ {
+ CPDF_Action action = aa.GetAction(CPDF_AAction::ClosePage);
+ pActionHandler->DoAction_Page(action, CPDF_AAction::ClosePage, pSDKDoc);
+ }
+ }
+ }
+}
+
+
diff --git a/fpdfsdk/src/fpdfoom.cpp b/fpdfsdk/src/fpdfoom.cpp
index fb67a5a1fe..9ba983b942 100644
--- a/fpdfsdk/src/fpdfoom.cpp
+++ b/fpdfsdk/src/fpdfoom.cpp
@@ -1,27 +1,27 @@
-// 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
-
-#include "../include/fsdk_define.h"
-#include "../include/fpdfoom.h"
-
-void OOM_Handler(FXMEM_FoxitMgr* pFoxitMgr, void* param)
-{
- if (!param) return;
- ((OOM_INFO*)param)->FSDK_OOM_Handler((OOM_INFO*)param);
-}
-
-
-DLLEXPORT FX_BOOL STDCALL FSDK_SetOOMHandler(OOM_INFO* oomInfo)
-{
-#ifndef _FXSDK_OPENSOURCE_
- if (!oomInfo || oomInfo->version!=1)
- return FALSE;
- FXMEM_SetOOMHandler(FXMEM_GetDefaultMgr(),OOM_Handler,oomInfo);
- return TRUE;
-#else
- return TRUE;
-#endif
-}
+// 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
+
+#include "../include/fsdk_define.h"
+#include "../include/fpdfoom.h"
+
+void OOM_Handler(FXMEM_FoxitMgr* pFoxitMgr, void* param)
+{
+ if (!param) return;
+ ((OOM_INFO*)param)->FSDK_OOM_Handler((OOM_INFO*)param);
+}
+
+
+DLLEXPORT FX_BOOL STDCALL FSDK_SetOOMHandler(OOM_INFO* oomInfo)
+{
+#ifndef _FXSDK_OPENSOURCE_
+ if (!oomInfo || oomInfo->version!=1)
+ return FALSE;
+ FXMEM_SetOOMHandler(FXMEM_GetDefaultMgr(),OOM_Handler,oomInfo);
+ return TRUE;
+#else
+ return TRUE;
+#endif
+}
diff --git a/fpdfsdk/src/fpdfppo.cpp b/fpdfsdk/src/fpdfppo.cpp
index e605484cb3..a803454cc0 100644
--- a/fpdfsdk/src/fpdfppo.cpp
+++ b/fpdfsdk/src/fpdfppo.cpp
@@ -1,460 +1,460 @@
-// 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
-
-#include "../include/fpdfppo.h"
-#include "../include/fsdk_define.h"
-
-class CPDF_PageOrganizer
-{
-public:
- CPDF_PageOrganizer();
- ~CPDF_PageOrganizer();
-
-public:
- FX_BOOL PDFDocInit(CPDF_Document *pDestPDFDoc, CPDF_Document *pSrcPDFDoc);
- FX_BOOL ExportPage(CPDF_Document *pSrcPDFDoc, CFX_WordArray* nPageNum, CPDF_Document *pDestPDFDoc, int nIndex);
- CPDF_Object* PageDictGetInheritableTag(CPDF_Dictionary *pDict, CFX_ByteString nSrctag);
- FX_BOOL UpdateReference(CPDF_Object *pObj, CPDF_Document *pDoc, CFX_MapPtrToPtr* pMapPtrToPtr);
- int GetNewObjId(CPDF_Document *pDoc, CFX_MapPtrToPtr* pMapPtrToPtr, CPDF_Reference *pRef);
-
-};
-
-
-CPDF_PageOrganizer::CPDF_PageOrganizer()
-{
-
-}
-
-CPDF_PageOrganizer::~CPDF_PageOrganizer()
-{
-
-}
-
-FX_BOOL CPDF_PageOrganizer::PDFDocInit(CPDF_Document *pDestPDFDoc, CPDF_Document *pSrcPDFDoc)
-{
- if(!pDestPDFDoc || !pSrcPDFDoc)
- return false;
-
- CPDF_Dictionary* pNewRoot = pDestPDFDoc->GetRoot();
- if(!pNewRoot) return FALSE;
-
- //Set the document information////////////////////////////////////////////
-
- CPDF_Dictionary* DInfoDict = pDestPDFDoc->GetInfo();
-
- if(!DInfoDict)
- return FALSE;
-
- CFX_ByteString producerstr;
-
-#ifdef FOXIT_CHROME_BUILD
- producerstr.Format("Google");
-#else
- producerstr.Format("Foxit PDF SDK %s - Foxit Corporation", "2.0");
-#endif
- DInfoDict->SetAt("Producer", new CPDF_String(producerstr));
-
- //Set type////////////////////////////////////////////////////////////////
- CFX_ByteString cbRootType = pNewRoot->GetString("Type","");
- if( cbRootType.Equal("") )
- {
- pNewRoot->SetAt("Type", new CPDF_Name("Catalog"));
- }
-
- CPDF_Dictionary* pNewPages = (CPDF_Dictionary*)pNewRoot->GetElement("Pages")->GetDirect();
- if(!pNewPages)
- {
- pNewPages = new CPDF_Dictionary;
- FX_DWORD NewPagesON = pDestPDFDoc->AddIndirectObject(pNewPages);
- pNewRoot->SetAt("Pages", new CPDF_Reference(pDestPDFDoc, NewPagesON));
- }
-
- CFX_ByteString cbPageType = pNewPages->GetString("Type","");
- if(cbPageType.Equal(""))
- {
- pNewPages->SetAt("Type", new CPDF_Name("Pages"));
- }
-
- CPDF_Array* pKeysArray = pNewPages->GetArray("Kids");
- if(pKeysArray == NULL)
- {
- CPDF_Array* pNewKids = new CPDF_Array;
- FX_DWORD Kidsobjnum = -1;
- Kidsobjnum = pDestPDFDoc->AddIndirectObject(pNewKids);//, Kidsobjnum, Kidsgennum);
-
- pNewPages->SetAt("Kids", new CPDF_Reference(pDestPDFDoc, Kidsobjnum));//, Kidsgennum));
- pNewPages->SetAt("Count", new CPDF_Number(0));
- }
-
- return true;
-}
-
-FX_BOOL CPDF_PageOrganizer::ExportPage(CPDF_Document *pSrcPDFDoc, CFX_WordArray* nPageNum,
- CPDF_Document *pDestPDFDoc,int nIndex)
-{
- int curpage =nIndex;
-
- CFX_MapPtrToPtr* pMapPtrToPtr = new CFX_MapPtrToPtr;
- pMapPtrToPtr->InitHashTable(1001);
-
- for(int i=0; i<nPageNum->GetSize(); i++)
- {
-
- CPDF_Dictionary* pCurPageDict = pDestPDFDoc->CreateNewPage(curpage);
- CPDF_Dictionary* pSrcPageDict = pSrcPDFDoc->GetPage(nPageNum->GetAt(i)-1);
- if(!pSrcPageDict || !pCurPageDict)
- {
- delete pMapPtrToPtr;
- return FALSE;
- }
-
- // Clone the page dictionary///////////
- FX_POSITION SrcPos = pSrcPageDict->GetStartPos();
- while (SrcPos)
- {
- CFX_ByteString cbSrcKeyStr;
- CPDF_Object* pObj = pSrcPageDict->GetNextElement(SrcPos, cbSrcKeyStr);
- if(cbSrcKeyStr.Compare(("Type")) && cbSrcKeyStr.Compare(("Parent")))
- {
- if(pCurPageDict->KeyExist(cbSrcKeyStr))
- pCurPageDict->RemoveAt(cbSrcKeyStr);
- pCurPageDict->SetAt(cbSrcKeyStr, pObj->Clone());
- }
- }
-
- //inheritable item///////////////////////
- CPDF_Object* pInheritable = NULL;
- //1 MediaBox //required
- if(!pCurPageDict->KeyExist("MediaBox"))
- {
-
- pInheritable = PageDictGetInheritableTag(pSrcPageDict, "MediaBox");
- if(!pInheritable)
- {
- //Search the "CropBox" from source page dictionary, if not exists,we take the letter size.
- pInheritable = PageDictGetInheritableTag(pSrcPageDict, "CropBox");
- if(pInheritable)
- pCurPageDict->SetAt("MediaBox", pInheritable->Clone());
- else
- {
- //Make the default size to be letter size (8.5'x11')
- CPDF_Array* pArray = new CPDF_Array;
- pArray->AddNumber(0);
- pArray->AddNumber(0);
- pArray->AddNumber(612);
- pArray->AddNumber(792);
- pCurPageDict->SetAt("MediaBox", pArray);
- }
- }
- else
- pCurPageDict->SetAt("MediaBox", pInheritable->Clone());
- }
- //2 Resources //required
- if(!pCurPageDict->KeyExist("Resources"))
- {
- pInheritable = PageDictGetInheritableTag(pSrcPageDict, "Resources");
- if(!pInheritable)
- {
- delete pMapPtrToPtr;
- return FALSE;
- }
- pCurPageDict->SetAt("Resources", pInheritable->Clone());
- }
- //3 CropBox //Optional
- if(!pCurPageDict->KeyExist("CropBox"))
- {
- pInheritable = PageDictGetInheritableTag(pSrcPageDict, "CropBox");
- if(pInheritable)
- pCurPageDict->SetAt("CropBox", pInheritable->Clone());
- }
- //4 Rotate //Optional
- if(!pCurPageDict->KeyExist("Rotate"))
- {
- pInheritable = PageDictGetInheritableTag(pSrcPageDict, "Rotate");
- if(pInheritable)
- pCurPageDict->SetAt("Rotate", pInheritable->Clone());
- }
-
- /////////////////////////////////////////////
- //Update the reference
- FX_DWORD dwOldPageObj = pSrcPageDict->GetObjNum();
- FX_DWORD dwNewPageObj = pCurPageDict->GetObjNum();
-
- pMapPtrToPtr->SetAt((FX_LPVOID)(FX_UINTPTR)dwOldPageObj, (FX_LPVOID)(FX_UINTPTR)dwNewPageObj);
-
- this->UpdateReference(pCurPageDict, pDestPDFDoc, pMapPtrToPtr);
- curpage++;
- }
-
- delete pMapPtrToPtr;
- return TRUE;
-}
-
-CPDF_Object* CPDF_PageOrganizer::PageDictGetInheritableTag(CPDF_Dictionary *pDict, CFX_ByteString nSrctag)
-{
- if(!pDict || !pDict->KeyExist("Type") || nSrctag.IsEmpty())
- return NULL;
-
- CPDF_Object* pType = pDict->GetElement("Type")->GetDirect();
- if(!pType || pType->GetType() != PDFOBJ_NAME) return NULL;
-
- if(pType->GetString().Compare("Page")) return NULL;
-
- if(!pDict->KeyExist("Parent")) return NULL;
- CPDF_Object* pParent = pDict->GetElement("Parent")->GetDirect();
- if(!pParent || pParent->GetType() != PDFOBJ_DICTIONARY) return NULL;
-
- CPDF_Dictionary* pp = (CPDF_Dictionary*)pParent;
-
- if(pDict->KeyExist((const char*)nSrctag))
- return pDict->GetElement((const char*)nSrctag);
- while (pp)
- {
- if(pp->KeyExist((const char*)nSrctag))
- return pp->GetElement((const char*)nSrctag);
- else if(pp->KeyExist("Parent"))
- pp = (CPDF_Dictionary*)pp->GetElement("Parent")->GetDirect();
- else break;
- }
-
- return NULL;
-}
-
-FX_BOOL CPDF_PageOrganizer::UpdateReference(CPDF_Object *pObj, CPDF_Document *pDoc,
- CFX_MapPtrToPtr* pMapPtrToPtr)
-{
- switch (pObj->GetType())
- {
- case PDFOBJ_REFERENCE:
- {
- CPDF_Reference* pReference = (CPDF_Reference*)pObj;
- int newobjnum = GetNewObjId(pDoc, pMapPtrToPtr, pReference);
- if (newobjnum == 0) return FALSE;
- pReference->SetRef(pDoc, newobjnum);//, 0);
- break;
- }
- case PDFOBJ_DICTIONARY:
- {
- CPDF_Dictionary* pDict = (CPDF_Dictionary*)pObj;
-
- FX_POSITION pos = pDict->GetStartPos();
- while(pos)
- {
- CFX_ByteString key("");
- CPDF_Object* pNextObj = pDict->GetNextElement(pos, key);
- if (!FXSYS_strcmp(key, "Parent") || !FXSYS_strcmp(key, "Prev") || !FXSYS_strcmp(key, "First"))
- continue;
- if(pNextObj)
- {
- if(!UpdateReference(pNextObj, pDoc, pMapPtrToPtr))
- pDict->RemoveAt(key);
- }
- else
- return FALSE;
- }
- break;
- }
- case PDFOBJ_ARRAY:
- {
- CPDF_Array* pArray = (CPDF_Array*)pObj;
- FX_DWORD count = pArray->GetCount();
- for(FX_DWORD i = 0; i < count; i ++)
- {
- CPDF_Object* pNextObj = pArray->GetElement(i);
- if(pNextObj)
- {
- if(!UpdateReference(pNextObj, pDoc, pMapPtrToPtr))
- return FALSE;
- }
- else
- return FALSE;
- }
- break;
- }
- case PDFOBJ_STREAM:
- {
- CPDF_Stream* pStream = (CPDF_Stream*)pObj;
- CPDF_Dictionary* pDict = pStream->GetDict();
- if(pDict)
- {
- if(!UpdateReference(pDict, pDoc, pMapPtrToPtr))
- return FALSE;
- }
- else
- return FALSE;
- break;
- }
- default: break;
- }
-
- return TRUE;
-}
-
-int CPDF_PageOrganizer::GetNewObjId(CPDF_Document *pDoc, CFX_MapPtrToPtr* pMapPtrToPtr,
- CPDF_Reference *pRef)
-{
- size_t dwObjnum = 0;
- if(!pRef)
- return 0;
- dwObjnum = pRef->GetRefObjNum();
-
- size_t dwNewObjNum = 0;
-
- pMapPtrToPtr->Lookup((FX_LPVOID)dwObjnum, (FX_LPVOID&)dwNewObjNum);
- if(dwNewObjNum)
- {
- return (int)dwNewObjNum;
- }
- else
- {
- CPDF_Object* pClone = pRef->GetDirect()->Clone();
- if(!pClone) return 0;
-
- if(pClone->GetType() == PDFOBJ_DICTIONARY)
- {
- CPDF_Dictionary* pDictClone = (CPDF_Dictionary*)pClone;
- if(pDictClone->KeyExist("Type"))
- {
- CFX_ByteString strType = pDictClone->GetString("Type");
- if(!FXSYS_stricmp(strType, "Pages"))
- {
- pDictClone->Release();
- return 4;
- }
- else if(!FXSYS_stricmp(strType, "Page"))
- {
- pDictClone->Release();
- return 0;
- }
- }
- }
- dwNewObjNum = pDoc->AddIndirectObject(pClone);//, onum, gnum);
- pMapPtrToPtr->SetAt((FX_LPVOID)dwObjnum, (FX_LPVOID)dwNewObjNum);
-
- if(!UpdateReference(pClone, pDoc, pMapPtrToPtr))
- {
- pClone->Release();
- return 0;
- }
- return (int)dwNewObjNum;
- }
- return 0;
-}
-
-FPDF_BOOL ParserPageRangeString(CFX_ByteString rangstring, CFX_WordArray* pageArray,int nCount)
-{
-
- if(rangstring.GetLength() != 0)
- {
- rangstring.Remove(' ');
- int nLength = rangstring.GetLength();
- CFX_ByteString cbCompareString("0123456789-,");
- for(int i=0; i<nLength; i++)
- {
- if(cbCompareString.Find(rangstring[i]) == -1)
- return FALSE;
- }
- CFX_ByteString cbMidRange;
- int nStringFrom = 0;
- int nStringTo=0;
- while(nStringTo < nLength)
- {
- nStringTo = rangstring.Find(',',nStringFrom);
- if(nStringTo == -1)
- {
- nStringTo = nLength;
- }
- cbMidRange = rangstring.Mid(nStringFrom,nStringTo-nStringFrom);
-
- int nMid = cbMidRange.Find('-');
- if(nMid == -1)
- {
- long lPageNum = atol(cbMidRange);
- if(lPageNum <= 0 || lPageNum > nCount)
- return FALSE;
- pageArray->Add((FX_WORD)lPageNum);
- }
- else
- {
- int nStartPageNum = atol(cbMidRange.Mid(0,nMid));
- if (nStartPageNum ==0)
- {
- return FALSE;
- }
-
-
- nMid = nMid+1;
- int nEnd = cbMidRange.GetLength()-nMid;
-
- if(nEnd ==0)return FALSE;
-
- // int nEndPageNum = (nEnd == 0)?nCount:atol(cbMidRange.Mid(nMid,nEnd));
- int nEndPageNum = atol(cbMidRange.Mid(nMid,nEnd));
-
- if(nStartPageNum < 0 ||nStartPageNum >nEndPageNum|| nEndPageNum > nCount)
- {
- return FALSE;
- }
- else
- {
- for(int nIndex=nStartPageNum; nIndex <= nEndPageNum; nIndex ++)
- pageArray->Add(nIndex);
- }
- }
- nStringFrom = nStringTo +1;
- }
- }
- return TRUE;
-}
-
-DLLEXPORT FPDF_BOOL STDCALL FPDF_ImportPages(FPDF_DOCUMENT dest_doc,FPDF_DOCUMENT src_doc,
- FPDF_BYTESTRING pagerange, int index)
-{
- if(dest_doc == NULL || src_doc == NULL )
- return FALSE;
- CFX_WordArray pageArray;
- CPDF_Document* pSrcDoc = (CPDF_Document*)src_doc;
- int nCount = pSrcDoc->GetPageCount();
- if(pagerange)
- {
- if(ParserPageRangeString(pagerange,&pageArray,nCount) == FALSE)
- return FALSE;
- }
- else
- {
- for(int i=1; i<=nCount; i++)
- {
- pageArray.Add(i);
- }
- }
-
- CPDF_Document* pDestDoc = (CPDF_Document*)dest_doc;
- CPDF_PageOrganizer pageOrg;
-
- pageOrg.PDFDocInit(pDestDoc,pSrcDoc);
-
- if(pageOrg.ExportPage(pSrcDoc,&pageArray,pDestDoc,index))
- return TRUE;
- return FALSE;
-}
-
-DLLEXPORT FPDF_BOOL STDCALL FPDF_CopyViewerPreferences(FPDF_DOCUMENT dest_doc, FPDF_DOCUMENT src_doc)
-{
- if(src_doc == NULL || dest_doc == NULL)
- return false;
- CPDF_Document* pSrcDoc = (CPDF_Document*)src_doc;
- CPDF_Dictionary* pSrcDict = pSrcDoc->GetRoot();
- pSrcDict = pSrcDict->GetDict(FX_BSTRC("ViewerPreferences"));;
- if(!pSrcDict)
- return FALSE;
- CPDF_Document* pDstDoc = (CPDF_Document*)dest_doc;
- CPDF_Dictionary* pDstDict = pDstDoc->GetRoot();
- if(!pDstDict)
- return FALSE;
- pDstDict->SetAt(FX_BSTRC("ViewerPreferences"), pSrcDict->Clone(TRUE));
- return TRUE;
-}
-
+// 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
+
+#include "../include/fpdfppo.h"
+#include "../include/fsdk_define.h"
+
+class CPDF_PageOrganizer
+{
+public:
+ CPDF_PageOrganizer();
+ ~CPDF_PageOrganizer();
+
+public:
+ FX_BOOL PDFDocInit(CPDF_Document *pDestPDFDoc, CPDF_Document *pSrcPDFDoc);
+ FX_BOOL ExportPage(CPDF_Document *pSrcPDFDoc, CFX_WordArray* nPageNum, CPDF_Document *pDestPDFDoc, int nIndex);
+ CPDF_Object* PageDictGetInheritableTag(CPDF_Dictionary *pDict, CFX_ByteString nSrctag);
+ FX_BOOL UpdateReference(CPDF_Object *pObj, CPDF_Document *pDoc, CFX_MapPtrToPtr* pMapPtrToPtr);
+ int GetNewObjId(CPDF_Document *pDoc, CFX_MapPtrToPtr* pMapPtrToPtr, CPDF_Reference *pRef);
+
+};
+
+
+CPDF_PageOrganizer::CPDF_PageOrganizer()
+{
+
+}
+
+CPDF_PageOrganizer::~CPDF_PageOrganizer()
+{
+
+}
+
+FX_BOOL CPDF_PageOrganizer::PDFDocInit(CPDF_Document *pDestPDFDoc, CPDF_Document *pSrcPDFDoc)
+{
+ if(!pDestPDFDoc || !pSrcPDFDoc)
+ return false;
+
+ CPDF_Dictionary* pNewRoot = pDestPDFDoc->GetRoot();
+ if(!pNewRoot) return FALSE;
+
+ //Set the document information////////////////////////////////////////////
+
+ CPDF_Dictionary* DInfoDict = pDestPDFDoc->GetInfo();
+
+ if(!DInfoDict)
+ return FALSE;
+
+ CFX_ByteString producerstr;
+
+#ifdef FOXIT_CHROME_BUILD
+ producerstr.Format("Google");
+#else
+ producerstr.Format("Foxit PDF SDK %s - Foxit Corporation", "2.0");
+#endif
+ DInfoDict->SetAt("Producer", new CPDF_String(producerstr));
+
+ //Set type////////////////////////////////////////////////////////////////
+ CFX_ByteString cbRootType = pNewRoot->GetString("Type","");
+ if( cbRootType.Equal("") )
+ {
+ pNewRoot->SetAt("Type", new CPDF_Name("Catalog"));
+ }
+
+ CPDF_Dictionary* pNewPages = (CPDF_Dictionary*)pNewRoot->GetElement("Pages")->GetDirect();
+ if(!pNewPages)
+ {
+ pNewPages = new CPDF_Dictionary;
+ FX_DWORD NewPagesON = pDestPDFDoc->AddIndirectObject(pNewPages);
+ pNewRoot->SetAt("Pages", new CPDF_Reference(pDestPDFDoc, NewPagesON));
+ }
+
+ CFX_ByteString cbPageType = pNewPages->GetString("Type","");
+ if(cbPageType.Equal(""))
+ {
+ pNewPages->SetAt("Type", new CPDF_Name("Pages"));
+ }
+
+ CPDF_Array* pKeysArray = pNewPages->GetArray("Kids");
+ if(pKeysArray == NULL)
+ {
+ CPDF_Array* pNewKids = new CPDF_Array;
+ FX_DWORD Kidsobjnum = -1;
+ Kidsobjnum = pDestPDFDoc->AddIndirectObject(pNewKids);//, Kidsobjnum, Kidsgennum);
+
+ pNewPages->SetAt("Kids", new CPDF_Reference(pDestPDFDoc, Kidsobjnum));//, Kidsgennum));
+ pNewPages->SetAt("Count", new CPDF_Number(0));
+ }
+
+ return true;
+}
+
+FX_BOOL CPDF_PageOrganizer::ExportPage(CPDF_Document *pSrcPDFDoc, CFX_WordArray* nPageNum,
+ CPDF_Document *pDestPDFDoc,int nIndex)
+{
+ int curpage =nIndex;
+
+ CFX_MapPtrToPtr* pMapPtrToPtr = new CFX_MapPtrToPtr;
+ pMapPtrToPtr->InitHashTable(1001);
+
+ for(int i=0; i<nPageNum->GetSize(); i++)
+ {
+
+ CPDF_Dictionary* pCurPageDict = pDestPDFDoc->CreateNewPage(curpage);
+ CPDF_Dictionary* pSrcPageDict = pSrcPDFDoc->GetPage(nPageNum->GetAt(i)-1);
+ if(!pSrcPageDict || !pCurPageDict)
+ {
+ delete pMapPtrToPtr;
+ return FALSE;
+ }
+
+ // Clone the page dictionary///////////
+ FX_POSITION SrcPos = pSrcPageDict->GetStartPos();
+ while (SrcPos)
+ {
+ CFX_ByteString cbSrcKeyStr;
+ CPDF_Object* pObj = pSrcPageDict->GetNextElement(SrcPos, cbSrcKeyStr);
+ if(cbSrcKeyStr.Compare(("Type")) && cbSrcKeyStr.Compare(("Parent")))
+ {
+ if(pCurPageDict->KeyExist(cbSrcKeyStr))
+ pCurPageDict->RemoveAt(cbSrcKeyStr);
+ pCurPageDict->SetAt(cbSrcKeyStr, pObj->Clone());
+ }
+ }
+
+ //inheritable item///////////////////////
+ CPDF_Object* pInheritable = NULL;
+ //1 MediaBox //required
+ if(!pCurPageDict->KeyExist("MediaBox"))
+ {
+
+ pInheritable = PageDictGetInheritableTag(pSrcPageDict, "MediaBox");
+ if(!pInheritable)
+ {
+ //Search the "CropBox" from source page dictionary, if not exists,we take the letter size.
+ pInheritable = PageDictGetInheritableTag(pSrcPageDict, "CropBox");
+ if(pInheritable)
+ pCurPageDict->SetAt("MediaBox", pInheritable->Clone());
+ else
+ {
+ //Make the default size to be letter size (8.5'x11')
+ CPDF_Array* pArray = new CPDF_Array;
+ pArray->AddNumber(0);
+ pArray->AddNumber(0);
+ pArray->AddNumber(612);
+ pArray->AddNumber(792);
+ pCurPageDict->SetAt("MediaBox", pArray);
+ }
+ }
+ else
+ pCurPageDict->SetAt("MediaBox", pInheritable->Clone());
+ }
+ //2 Resources //required
+ if(!pCurPageDict->KeyExist("Resources"))
+ {
+ pInheritable = PageDictGetInheritableTag(pSrcPageDict, "Resources");
+ if(!pInheritable)
+ {
+ delete pMapPtrToPtr;
+ return FALSE;
+ }
+ pCurPageDict->SetAt("Resources", pInheritable->Clone());
+ }
+ //3 CropBox //Optional
+ if(!pCurPageDict->KeyExist("CropBox"))
+ {
+ pInheritable = PageDictGetInheritableTag(pSrcPageDict, "CropBox");
+ if(pInheritable)
+ pCurPageDict->SetAt("CropBox", pInheritable->Clone());
+ }
+ //4 Rotate //Optional
+ if(!pCurPageDict->KeyExist("Rotate"))
+ {
+ pInheritable = PageDictGetInheritableTag(pSrcPageDict, "Rotate");
+ if(pInheritable)
+ pCurPageDict->SetAt("Rotate", pInheritable->Clone());
+ }
+
+ /////////////////////////////////////////////
+ //Update the reference
+ FX_DWORD dwOldPageObj = pSrcPageDict->GetObjNum();
+ FX_DWORD dwNewPageObj = pCurPageDict->GetObjNum();
+
+ pMapPtrToPtr->SetAt((FX_LPVOID)(FX_UINTPTR)dwOldPageObj, (FX_LPVOID)(FX_UINTPTR)dwNewPageObj);
+
+ this->UpdateReference(pCurPageDict, pDestPDFDoc, pMapPtrToPtr);
+ curpage++;
+ }
+
+ delete pMapPtrToPtr;
+ return TRUE;
+}
+
+CPDF_Object* CPDF_PageOrganizer::PageDictGetInheritableTag(CPDF_Dictionary *pDict, CFX_ByteString nSrctag)
+{
+ if(!pDict || !pDict->KeyExist("Type") || nSrctag.IsEmpty())
+ return NULL;
+
+ CPDF_Object* pType = pDict->GetElement("Type")->GetDirect();
+ if(!pType || pType->GetType() != PDFOBJ_NAME) return NULL;
+
+ if(pType->GetString().Compare("Page")) return NULL;
+
+ if(!pDict->KeyExist("Parent")) return NULL;
+ CPDF_Object* pParent = pDict->GetElement("Parent")->GetDirect();
+ if(!pParent || pParent->GetType() != PDFOBJ_DICTIONARY) return NULL;
+
+ CPDF_Dictionary* pp = (CPDF_Dictionary*)pParent;
+
+ if(pDict->KeyExist((const char*)nSrctag))
+ return pDict->GetElement((const char*)nSrctag);
+ while (pp)
+ {
+ if(pp->KeyExist((const char*)nSrctag))
+ return pp->GetElement((const char*)nSrctag);
+ else if(pp->KeyExist("Parent"))
+ pp = (CPDF_Dictionary*)pp->GetElement("Parent")->GetDirect();
+ else break;
+ }
+
+ return NULL;
+}
+
+FX_BOOL CPDF_PageOrganizer::UpdateReference(CPDF_Object *pObj, CPDF_Document *pDoc,
+ CFX_MapPtrToPtr* pMapPtrToPtr)
+{
+ switch (pObj->GetType())
+ {
+ case PDFOBJ_REFERENCE:
+ {
+ CPDF_Reference* pReference = (CPDF_Reference*)pObj;
+ int newobjnum = GetNewObjId(pDoc, pMapPtrToPtr, pReference);
+ if (newobjnum == 0) return FALSE;
+ pReference->SetRef(pDoc, newobjnum);//, 0);
+ break;
+ }
+ case PDFOBJ_DICTIONARY:
+ {
+ CPDF_Dictionary* pDict = (CPDF_Dictionary*)pObj;
+
+ FX_POSITION pos = pDict->GetStartPos();
+ while(pos)
+ {
+ CFX_ByteString key("");
+ CPDF_Object* pNextObj = pDict->GetNextElement(pos, key);
+ if (!FXSYS_strcmp(key, "Parent") || !FXSYS_strcmp(key, "Prev") || !FXSYS_strcmp(key, "First"))
+ continue;
+ if(pNextObj)
+ {
+ if(!UpdateReference(pNextObj, pDoc, pMapPtrToPtr))
+ pDict->RemoveAt(key);
+ }
+ else
+ return FALSE;
+ }
+ break;
+ }
+ case PDFOBJ_ARRAY:
+ {
+ CPDF_Array* pArray = (CPDF_Array*)pObj;
+ FX_DWORD count = pArray->GetCount();
+ for(FX_DWORD i = 0; i < count; i ++)
+ {
+ CPDF_Object* pNextObj = pArray->GetElement(i);
+ if(pNextObj)
+ {
+ if(!UpdateReference(pNextObj, pDoc, pMapPtrToPtr))
+ return FALSE;
+ }
+ else
+ return FALSE;
+ }
+ break;
+ }
+ case PDFOBJ_STREAM:
+ {
+ CPDF_Stream* pStream = (CPDF_Stream*)pObj;
+ CPDF_Dictionary* pDict = pStream->GetDict();
+ if(pDict)
+ {
+ if(!UpdateReference(pDict, pDoc, pMapPtrToPtr))
+ return FALSE;
+ }
+ else
+ return FALSE;
+ break;
+ }
+ default: break;
+ }
+
+ return TRUE;
+}
+
+int CPDF_PageOrganizer::GetNewObjId(CPDF_Document *pDoc, CFX_MapPtrToPtr* pMapPtrToPtr,
+ CPDF_Reference *pRef)
+{
+ size_t dwObjnum = 0;
+ if(!pRef)
+ return 0;
+ dwObjnum = pRef->GetRefObjNum();
+
+ size_t dwNewObjNum = 0;
+
+ pMapPtrToPtr->Lookup((FX_LPVOID)dwObjnum, (FX_LPVOID&)dwNewObjNum);
+ if(dwNewObjNum)
+ {
+ return (int)dwNewObjNum;
+ }
+ else
+ {
+ CPDF_Object* pClone = pRef->GetDirect()->Clone();
+ if(!pClone) return 0;
+
+ if(pClone->GetType() == PDFOBJ_DICTIONARY)
+ {
+ CPDF_Dictionary* pDictClone = (CPDF_Dictionary*)pClone;
+ if(pDictClone->KeyExist("Type"))
+ {
+ CFX_ByteString strType = pDictClone->GetString("Type");
+ if(!FXSYS_stricmp(strType, "Pages"))
+ {
+ pDictClone->Release();
+ return 4;
+ }
+ else if(!FXSYS_stricmp(strType, "Page"))
+ {
+ pDictClone->Release();
+ return 0;
+ }
+ }
+ }
+ dwNewObjNum = pDoc->AddIndirectObject(pClone);//, onum, gnum);
+ pMapPtrToPtr->SetAt((FX_LPVOID)dwObjnum, (FX_LPVOID)dwNewObjNum);
+
+ if(!UpdateReference(pClone, pDoc, pMapPtrToPtr))
+ {
+ pClone->Release();
+ return 0;
+ }
+ return (int)dwNewObjNum;
+ }
+ return 0;
+}
+
+FPDF_BOOL ParserPageRangeString(CFX_ByteString rangstring, CFX_WordArray* pageArray,int nCount)
+{
+
+ if(rangstring.GetLength() != 0)
+ {
+ rangstring.Remove(' ');
+ int nLength = rangstring.GetLength();
+ CFX_ByteString cbCompareString("0123456789-,");
+ for(int i=0; i<nLength; i++)
+ {
+ if(cbCompareString.Find(rangstring[i]) == -1)
+ return FALSE;
+ }
+ CFX_ByteString cbMidRange;
+ int nStringFrom = 0;
+ int nStringTo=0;
+ while(nStringTo < nLength)
+ {
+ nStringTo = rangstring.Find(',',nStringFrom);
+ if(nStringTo == -1)
+ {
+ nStringTo = nLength;
+ }
+ cbMidRange = rangstring.Mid(nStringFrom,nStringTo-nStringFrom);
+
+ int nMid = cbMidRange.Find('-');
+ if(nMid == -1)
+ {
+ long lPageNum = atol(cbMidRange);
+ if(lPageNum <= 0 || lPageNum > nCount)
+ return FALSE;
+ pageArray->Add((FX_WORD)lPageNum);
+ }
+ else
+ {
+ int nStartPageNum = atol(cbMidRange.Mid(0,nMid));
+ if (nStartPageNum ==0)
+ {
+ return FALSE;
+ }
+
+
+ nMid = nMid+1;
+ int nEnd = cbMidRange.GetLength()-nMid;
+
+ if(nEnd ==0)return FALSE;
+
+ // int nEndPageNum = (nEnd == 0)?nCount:atol(cbMidRange.Mid(nMid,nEnd));
+ int nEndPageNum = atol(cbMidRange.Mid(nMid,nEnd));
+
+ if(nStartPageNum < 0 ||nStartPageNum >nEndPageNum|| nEndPageNum > nCount)
+ {
+ return FALSE;
+ }
+ else
+ {
+ for(int nIndex=nStartPageNum; nIndex <= nEndPageNum; nIndex ++)
+ pageArray->Add(nIndex);
+ }
+ }
+ nStringFrom = nStringTo +1;
+ }
+ }
+ return TRUE;
+}
+
+DLLEXPORT FPDF_BOOL STDCALL FPDF_ImportPages(FPDF_DOCUMENT dest_doc,FPDF_DOCUMENT src_doc,
+ FPDF_BYTESTRING pagerange, int index)
+{
+ if(dest_doc == NULL || src_doc == NULL )
+ return FALSE;
+ CFX_WordArray pageArray;
+ CPDF_Document* pSrcDoc = (CPDF_Document*)src_doc;
+ int nCount = pSrcDoc->GetPageCount();
+ if(pagerange)
+ {
+ if(ParserPageRangeString(pagerange,&pageArray,nCount) == FALSE)
+ return FALSE;
+ }
+ else
+ {
+ for(int i=1; i<=nCount; i++)
+ {
+ pageArray.Add(i);
+ }
+ }
+
+ CPDF_Document* pDestDoc = (CPDF_Document*)dest_doc;
+ CPDF_PageOrganizer pageOrg;
+
+ pageOrg.PDFDocInit(pDestDoc,pSrcDoc);
+
+ if(pageOrg.ExportPage(pSrcDoc,&pageArray,pDestDoc,index))
+ return TRUE;
+ return FALSE;
+}
+
+DLLEXPORT FPDF_BOOL STDCALL FPDF_CopyViewerPreferences(FPDF_DOCUMENT dest_doc, FPDF_DOCUMENT src_doc)
+{
+ if(src_doc == NULL || dest_doc == NULL)
+ return false;
+ CPDF_Document* pSrcDoc = (CPDF_Document*)src_doc;
+ CPDF_Dictionary* pSrcDict = pSrcDoc->GetRoot();
+ pSrcDict = pSrcDict->GetDict(FX_BSTRC("ViewerPreferences"));;
+ if(!pSrcDict)
+ return FALSE;
+ CPDF_Document* pDstDoc = (CPDF_Document*)dest_doc;
+ CPDF_Dictionary* pDstDict = pDstDoc->GetRoot();
+ if(!pDstDict)
+ return FALSE;
+ pDstDict->SetAt(FX_BSTRC("ViewerPreferences"), pSrcDict->Clone(TRUE));
+ return TRUE;
+}
+
diff --git a/fpdfsdk/src/fpdfsave.cpp b/fpdfsdk/src/fpdfsave.cpp
index 8272eb0fee..0c7acc8c47 100644
--- a/fpdfsdk/src/fpdfsave.cpp
+++ b/fpdfsdk/src/fpdfsave.cpp
@@ -1,91 +1,91 @@
-// 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
-
-#include "../include/fsdk_define.h"
-#include "../include/fpdfsave.h"
-#include "../include/fpdfedit.h"
-#if _FX_OS_ == _FX_ANDROID_
-#include "time.h"
-#else
-#include <ctime>
-#endif
-
-class CFX_IFileWrite:public IFX_StreamWrite
-{
-
-public:
- CFX_IFileWrite();
- FX_BOOL Init( FPDF_FILEWRITE * pFileWriteStruct );
- virtual FX_BOOL WriteBlock(const void* pData, size_t size);
- virtual void Release(){};
-
-protected:
- FPDF_FILEWRITE* m_pFileWriteStruct;
-};
-
-CFX_IFileWrite::CFX_IFileWrite()
-{
- m_pFileWriteStruct = NULL;
-}
-
-FX_BOOL CFX_IFileWrite::Init( FPDF_FILEWRITE * pFileWriteStruct )
-{
- if (!pFileWriteStruct)
- return FALSE;
- else
- {
- m_pFileWriteStruct = pFileWriteStruct;
- }
- return TRUE;
-}
-
-FX_BOOL CFX_IFileWrite::WriteBlock(const void* pData, size_t size)
-{
- if (m_pFileWriteStruct)
- {
- m_pFileWriteStruct->WriteBlock( m_pFileWriteStruct, pData, size );
- return TRUE;
- }
- else
- return FALSE;
-}
-
-FPDF_BOOL _FPDF_Doc_Save(FPDF_DOCUMENT document,FPDF_FILEWRITE * pFileWrite,FPDF_DWORD flags, FPDF_BOOL bSetVersion,
- int fileVerion)
-{
- CPDF_Document* pDoc = (CPDF_Document*)document;
- if (!pDoc)
- return 0;
-
- if ( flags < 1 || flags > 2 )
- {
- flags = 0;
- }
-
- CPDF_Creator FileMaker(pDoc);
- if(bSetVersion)
- FileMaker.SetFileVersion(fileVerion);
- CFX_IFileWrite* pStreamWrite = NULL;
- FX_BOOL bRet;
- pStreamWrite = new CFX_IFileWrite;
- pStreamWrite->Init( pFileWrite );
- bRet = FileMaker.Create(pStreamWrite, flags);
- delete pStreamWrite;
- return bRet;
-}
-
-DLLEXPORT FPDF_BOOL STDCALL FPDF_SaveAsCopy( FPDF_DOCUMENT document,FPDF_FILEWRITE * pFileWrite,
- FPDF_DWORD flags )
-{
- return _FPDF_Doc_Save(document, pFileWrite, flags, FALSE , 0);
-}
-
-
-DLLEXPORT FPDF_BOOL STDCALL FPDF_SaveWithVersion( FPDF_DOCUMENT document,FPDF_FILEWRITE * pFileWrite,
- FPDF_DWORD flags, int fileVersion)
-{
- return _FPDF_Doc_Save(document, pFileWrite, flags, TRUE , fileVersion);
-}
+// 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
+
+#include "../include/fsdk_define.h"
+#include "../include/fpdfsave.h"
+#include "../include/fpdfedit.h"
+#if _FX_OS_ == _FX_ANDROID_
+#include "time.h"
+#else
+#include <ctime>
+#endif
+
+class CFX_IFileWrite:public IFX_StreamWrite
+{
+
+public:
+ CFX_IFileWrite();
+ FX_BOOL Init( FPDF_FILEWRITE * pFileWriteStruct );
+ virtual FX_BOOL WriteBlock(const void* pData, size_t size);
+ virtual void Release(){};
+
+protected:
+ FPDF_FILEWRITE* m_pFileWriteStruct;
+};
+
+CFX_IFileWrite::CFX_IFileWrite()
+{
+ m_pFileWriteStruct = NULL;
+}
+
+FX_BOOL CFX_IFileWrite::Init( FPDF_FILEWRITE * pFileWriteStruct )
+{
+ if (!pFileWriteStruct)
+ return FALSE;
+ else
+ {
+ m_pFileWriteStruct = pFileWriteStruct;
+ }
+ return TRUE;
+}
+
+FX_BOOL CFX_IFileWrite::WriteBlock(const void* pData, size_t size)
+{
+ if (m_pFileWriteStruct)
+ {
+ m_pFileWriteStruct->WriteBlock( m_pFileWriteStruct, pData, size );
+ return TRUE;
+ }
+ else
+ return FALSE;
+}
+
+FPDF_BOOL _FPDF_Doc_Save(FPDF_DOCUMENT document,FPDF_FILEWRITE * pFileWrite,FPDF_DWORD flags, FPDF_BOOL bSetVersion,
+ int fileVerion)
+{
+ CPDF_Document* pDoc = (CPDF_Document*)document;
+ if (!pDoc)
+ return 0;
+
+ if ( flags < 1 || flags > 2 )
+ {
+ flags = 0;
+ }
+
+ CPDF_Creator FileMaker(pDoc);
+ if(bSetVersion)
+ FileMaker.SetFileVersion(fileVerion);
+ CFX_IFileWrite* pStreamWrite = NULL;
+ FX_BOOL bRet;
+ pStreamWrite = new CFX_IFileWrite;
+ pStreamWrite->Init( pFileWrite );
+ bRet = FileMaker.Create(pStreamWrite, flags);
+ delete pStreamWrite;
+ return bRet;
+}
+
+DLLEXPORT FPDF_BOOL STDCALL FPDF_SaveAsCopy( FPDF_DOCUMENT document,FPDF_FILEWRITE * pFileWrite,
+ FPDF_DWORD flags )
+{
+ return _FPDF_Doc_Save(document, pFileWrite, flags, FALSE , 0);
+}
+
+
+DLLEXPORT FPDF_BOOL STDCALL FPDF_SaveWithVersion( FPDF_DOCUMENT document,FPDF_FILEWRITE * pFileWrite,
+ FPDF_DWORD flags, int fileVersion)
+{
+ return _FPDF_Doc_Save(document, pFileWrite, flags, TRUE , fileVersion);
+}
diff --git a/fpdfsdk/src/fpdfsdkdll.rc b/fpdfsdk/src/fpdfsdkdll.rc
index ee12049847..f203f2e5be 100644
--- a/fpdfsdk/src/fpdfsdkdll.rc
+++ b/fpdfsdk/src/fpdfsdkdll.rc
@@ -1,109 +1,109 @@
-//Microsoft Developer Studio generated resource script.
-//
-#include "resource.h"
-
-#define APSTUDIO_READONLY_SYMBOLS
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 2 resource.
-//
-#include "afxres.h"
-
-/////////////////////////////////////////////////////////////////////////////
-#undef APSTUDIO_READONLY_SYMBOLS
-
-/////////////////////////////////////////////////////////////////////////////
-// Chinese (P.R.C.) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS)
-#ifdef _WIN32
-LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED
-#pragma code_page(936)
-#endif //_WIN32
-
-#ifndef _MAC
-/////////////////////////////////////////////////////////////////////////////
-//
-// Version
-//
-
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION 2,0,0,1705
- PRODUCTVERSION 2,0,0,1705
- FILEFLAGSMASK 0x3fL
-#ifdef _DEBUG
- FILEFLAGS 0x1L
-#else
- FILEFLAGS 0x0L
-#endif
- FILEOS 0x40004L
- FILETYPE 0x2L
- FILESUBTYPE 0x0L
-BEGIN
- BLOCK "StringFileInfo"
- BEGIN
- BLOCK "080904b0"
- BEGIN
- VALUE "Comments", "Foxit Corporation\0"
- VALUE "CompanyName", "Foxit Corporation\0"
- VALUE "FileDescription", "fpdfsdk\0"
- VALUE "FileVersion", "2, 0, 0, 1705\0"
- VALUE "InternalName", "fpdfsdk\0"
- VALUE "LegalCopyright", "Copyright (C) 2004-2009 Foxit Corporation\0"
- VALUE "LegalTrademarks", "\0"
- VALUE "OriginalFilename", "fpdfsdk.dll\0"
- VALUE "PrivateBuild", "\0"
- VALUE "ProductName", "Foxit PDF SDK DLL\0"
- VALUE "ProductVersion", "2, 0, 0, 1705\0"
- VALUE "SpecialBuild", "\0"
- END
- END
- BLOCK "VarFileInfo"
- BEGIN
- VALUE "Translation", 0x809, 1200
- END
-END
-
-#endif // !_MAC
-
-
-#ifdef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// TEXTINCLUDE
-//
-
-1 TEXTINCLUDE MOVEABLE PURE
-BEGIN
- "resource.h\0"
-END
-
-2 TEXTINCLUDE MOVEABLE PURE
-BEGIN
- "#include ""afxres.h""\r\n"
- "\0"
-END
-
-3 TEXTINCLUDE MOVEABLE PURE
-BEGIN
- "\r\n"
- "\0"
-END
-
-#endif // APSTUDIO_INVOKED
-
-#endif // Chinese (P.R.C.) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-
-#ifndef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 3 resource.
-//
-
-
-/////////////////////////////////////////////////////////////////////////////
-#endif // not APSTUDIO_INVOKED
-
+//Microsoft Developer Studio generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// Chinese (P.R.C.) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS)
+#ifdef _WIN32
+LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED
+#pragma code_page(936)
+#endif //_WIN32
+
+#ifndef _MAC
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 2,0,0,1705
+ PRODUCTVERSION 2,0,0,1705
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x40004L
+ FILETYPE 0x2L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "080904b0"
+ BEGIN
+ VALUE "Comments", "Foxit Corporation\0"
+ VALUE "CompanyName", "Foxit Corporation\0"
+ VALUE "FileDescription", "fpdfsdk\0"
+ VALUE "FileVersion", "2, 0, 0, 1705\0"
+ VALUE "InternalName", "fpdfsdk\0"
+ VALUE "LegalCopyright", "Copyright (C) 2004-2009 Foxit Corporation\0"
+ VALUE "LegalTrademarks", "\0"
+ VALUE "OriginalFilename", "fpdfsdk.dll\0"
+ VALUE "PrivateBuild", "\0"
+ VALUE "ProductName", "Foxit PDF SDK DLL\0"
+ VALUE "ProductVersion", "2, 0, 0, 1705\0"
+ VALUE "SpecialBuild", "\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x809, 1200
+ END
+END
+
+#endif // !_MAC
+
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE MOVEABLE PURE
+BEGIN
+ "resource.h\0"
+END
+
+2 TEXTINCLUDE MOVEABLE PURE
+BEGIN
+ "#include ""afxres.h""\r\n"
+ "\0"
+END
+
+3 TEXTINCLUDE MOVEABLE PURE
+BEGIN
+ "\r\n"
+ "\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+#endif // Chinese (P.R.C.) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+
diff --git a/fpdfsdk/src/fpdftext.cpp b/fpdfsdk/src/fpdftext.cpp
index 6042fcc7b1..1aa0542124 100644
--- a/fpdfsdk/src/fpdftext.cpp
+++ b/fpdfsdk/src/fpdftext.cpp
@@ -1,278 +1,278 @@
-// 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
-
-#include "../include/fsdk_define.h"
-#include "../include/fpdftext.h"
-
-#ifdef _WIN32
-#include <tchar.h>
-#endif
-
- // jabdelmalek: commented out to build on Linux. Not used.
- // extern HANDLE g_hModule;
-
-DLLEXPORT FPDF_TEXTPAGE STDCALL FPDFText_LoadPage(FPDF_PAGE page)
-{
- if (!page) return NULL;
- IPDF_TextPage* textpage=NULL;
- try
- {
- CPDF_ViewerPreferences viewRef(((CPDF_Page*)page)->m_pDocument);
- textpage=IPDF_TextPage::CreateTextPage((CPDF_Page*)page,viewRef.IsDirectionR2L());
- textpage->ParseTextPage();
- }
- catch (...)
- {
- if (textpage)
- delete textpage;
- return NULL;
- }
- return textpage;
-}
-DLLEXPORT void STDCALL FPDFText_ClosePage(FPDF_TEXTPAGE text_page)
-{
- if (text_page){
- IPDF_TextPage* textpage=(IPDF_TextPage*)text_page;
- delete textpage;
- text_page=NULL;
- }
-}
-DLLEXPORT int STDCALL FPDFText_CountChars(FPDF_TEXTPAGE text_page)
-{
- if (!text_page) return -1;
- IPDF_TextPage* textpage=(IPDF_TextPage*)text_page;
- return textpage->CountChars();
-}
-DLLEXPORT unsigned int STDCALL FPDFText_GetUnicode(FPDF_TEXTPAGE text_page, int index)
-{
- if (!text_page) return -1;
- IPDF_TextPage* textpage=(IPDF_TextPage*)text_page;
-
- if (index<0 || index>=textpage->CountChars()) return 0;
-
- FPDF_CHAR_INFO charinfo;
- textpage->GetCharInfo(index,charinfo);
- return charinfo.m_Unicode;
-}
-DLLEXPORT double STDCALL FPDFText_GetFontSize(FPDF_TEXTPAGE text_page, int index)
-{
- if (!text_page) return 0;
- IPDF_TextPage* textpage=(IPDF_TextPage*)text_page;
-
- if (index<0 || index>=textpage->CountChars()) return 0;
-
- FPDF_CHAR_INFO charinfo;
- textpage->GetCharInfo(index,charinfo);
- return charinfo.m_FontSize;
-}
-
-DLLEXPORT void STDCALL FPDFText_GetCharBox(FPDF_TEXTPAGE text_page, int index,double* left,
- double* right, double* bottom, double* top)
-{
- if (!text_page) return;
- IPDF_TextPage* textpage=(IPDF_TextPage*)text_page;
-
- if (index<0 || index>=textpage->CountChars()) return ;
- FPDF_CHAR_INFO charinfo;
- textpage->GetCharInfo(index,charinfo);
- *left=charinfo.m_CharBox.left;
- *right=charinfo.m_CharBox.right;
- *bottom=charinfo.m_CharBox.bottom;
- *top=charinfo.m_CharBox.top;
-}
-
-//select
-DLLEXPORT int STDCALL FPDFText_GetCharIndexAtPos(FPDF_TEXTPAGE text_page,double x,double y,double xTorelance,double yTorelance)
-{
- if (!text_page) return -3;
- IPDF_TextPage* textpage=(IPDF_TextPage*)text_page;
- return textpage->GetIndexAtPos((FX_FLOAT)x,(FX_FLOAT)y,(FX_FLOAT)xTorelance,(FX_FLOAT)yTorelance);
-}
-
-DLLEXPORT int STDCALL FPDFText_GetText(FPDF_TEXTPAGE text_page,int start,int count,unsigned short* result)
-{
- if (!text_page) return 0;
- IPDF_TextPage* textpage=(IPDF_TextPage*)text_page;
-
- if (start>=textpage->CountChars()) return 0;
-
- CFX_WideString str=textpage->GetPageText(start,count);
- if(str.GetLength()>count)
- str = str.Left(count);
-
- CFX_ByteString cbUTF16str = str.UTF16LE_Encode();
- FXSYS_memcpy(result,cbUTF16str.GetBuffer(cbUTF16str.GetLength()),cbUTF16str.GetLength());
- cbUTF16str.ReleaseBuffer(cbUTF16str.GetLength());
-
- return cbUTF16str.GetLength()/sizeof(unsigned short);
-}
-
-DLLEXPORT int STDCALL FPDFText_CountRects(FPDF_TEXTPAGE text_page,int start,int count)
-{
- if (!text_page) return 0;
- IPDF_TextPage* textpage=(IPDF_TextPage*)text_page;
- return textpage->CountRects(start,count);
-
-}
-DLLEXPORT void STDCALL FPDFText_GetRect(FPDF_TEXTPAGE text_page,int rect_index, double* left,double* top,
- double* right, double* bottom)
-{
- if (!text_page) return;
- IPDF_TextPage* textpage=(IPDF_TextPage*)text_page;
- CFX_FloatRect rect;
- textpage->GetRect(rect_index,rect.left,rect.top,rect.right,rect.bottom);
- *left=rect.left;
- *top=rect.top;
- *right=rect.right;
- *bottom=rect.bottom;
-}
-
-DLLEXPORT int STDCALL FPDFText_GetBoundedText(FPDF_TEXTPAGE text_page,double left, double top,
- double right, double bottom,unsigned short* buffer,int buflen)
-{
- if (!text_page) return 0;
- IPDF_TextPage* textpage=(IPDF_TextPage*)text_page;
- CFX_FloatRect rect((FX_FLOAT)left,(FX_FLOAT)bottom,(FX_FLOAT)right,(FX_FLOAT)top);
- CFX_WideString str=textpage->GetTextByRect(rect);
-
- if (buflen<=0 || buffer==NULL)
- {
- return str.GetLength();
- }
-
- CFX_ByteString cbUTF16Str = str.UTF16LE_Encode();
- int len = cbUTF16Str.GetLength()/sizeof(unsigned short);
- int size = buflen > len ? len : buflen;
- FXSYS_memcpy(buffer,cbUTF16Str.GetBuffer(size*sizeof(unsigned short)),size*sizeof(unsigned short));
- cbUTF16Str.ReleaseBuffer(size*sizeof(unsigned short));
-
- return size;
-
-}
-
-//Search
-//-1 for end
-DLLEXPORT FPDF_SCHHANDLE STDCALL FPDFText_FindStart(FPDF_TEXTPAGE text_page,FPDF_WIDESTRING findwhat,unsigned long flags,int start_index)
-{
- if (!text_page) return NULL;
- IPDF_TextPageFind* textpageFind=NULL;
- try
- {
- textpageFind=IPDF_TextPageFind::CreatePageFind((IPDF_TextPage*)text_page);
- textpageFind->FindFirst(CFX_WideString::FromUTF16LE(findwhat),flags,start_index);
- }
- catch (...)
- {
- if (textpageFind)
- delete textpageFind;
- return NULL;
- }
- return textpageFind;
-}
-DLLEXPORT FPDF_BOOL STDCALL FPDFText_FindNext(FPDF_SCHHANDLE handle)
-{
- if (!handle) return FALSE;
- IPDF_TextPageFind* textpageFind=(IPDF_TextPageFind*)handle;
- return textpageFind->FindNext();
-}
-DLLEXPORT FPDF_BOOL STDCALL FPDFText_FindPrev(FPDF_SCHHANDLE handle)
-{
- if (!handle) return FALSE;
- IPDF_TextPageFind* textpageFind=(IPDF_TextPageFind*)handle;
- return textpageFind->FindPrev();
-}
-DLLEXPORT int STDCALL FPDFText_GetSchResultIndex(FPDF_SCHHANDLE handle)
-{
- if (!handle) return 0;
- IPDF_TextPageFind* textpageFind=(IPDF_TextPageFind*)handle;
- return textpageFind->GetCurOrder();
-}
-DLLEXPORT int STDCALL FPDFText_GetSchCount(FPDF_SCHHANDLE handle)
-{
- if (!handle) return 0;
- IPDF_TextPageFind* textpageFind=(IPDF_TextPageFind*)handle;
- return textpageFind->GetMatchedCount();
-}
-DLLEXPORT void STDCALL FPDFText_FindClose(FPDF_SCHHANDLE handle)
-{
- if (!handle) return;
- IPDF_TextPageFind* textpageFind=(IPDF_TextPageFind*)handle;
- delete textpageFind;
- handle=NULL;
-}
-
-//web link
-DLLEXPORT FPDF_PAGELINK STDCALL FPDFLink_LoadWebLinks(FPDF_TEXTPAGE text_page)
-{
- if (!text_page) return NULL;
- IPDF_LinkExtract* pageLink=NULL;
- try
- {
- pageLink=IPDF_LinkExtract::CreateLinkExtract();
- pageLink->ExtractLinks((IPDF_TextPage*)text_page);
- }
- catch (...)
- {
- if (pageLink)
- delete pageLink;
- return NULL;
- }
- return pageLink;
-}
-DLLEXPORT int STDCALL FPDFLink_CountWebLinks(FPDF_PAGELINK link_page)
-{
- if (!link_page) return 0;
- IPDF_LinkExtract* pageLink=(IPDF_LinkExtract*)link_page;
- return pageLink->CountLinks();
-}
-DLLEXPORT int STDCALL FPDFLink_GetURL(FPDF_PAGELINK link_page,int link_index, unsigned short* buffer,int buflen)
-{
- if (!link_page) return 0;
- IPDF_LinkExtract* pageLink=(IPDF_LinkExtract*)link_page;
- CFX_WideString url=pageLink->GetURL(link_index);
-
- CFX_ByteString cbUTF16URL = url.UTF16LE_Encode();
- int len= cbUTF16URL.GetLength()/sizeof(unsigned short);
- if (buffer==NULL || buflen<=0)
- return len;
- int size=len<buflen ? len :buflen;
- if (size>0)
- {
- FXSYS_memcpy(buffer,cbUTF16URL.GetBuffer(size*sizeof(unsigned short)),size*sizeof(unsigned short));
- cbUTF16URL.ReleaseBuffer(size*sizeof(unsigned short));
- }
- return size;
-}
-DLLEXPORT int STDCALL FPDFLink_CountRects(FPDF_PAGELINK link_page,int link_index)
-{
- if (!link_page) return 0;
- IPDF_LinkExtract* pageLink=(IPDF_LinkExtract*)link_page;
- CFX_RectArray rectArray;
- pageLink->GetRects(link_index,rectArray);
- return rectArray.GetSize();
-}
-DLLEXPORT void STDCALL FPDFLink_GetRect(FPDF_PAGELINK link_page,int link_index, int rect_index, double* left,
- double* top,double* right, double* bottom)
-{
- if (!link_page) return;
- IPDF_LinkExtract* pageLink=(IPDF_LinkExtract*)link_page;
- CFX_RectArray rectArray;
- pageLink->GetRects(link_index,rectArray);
- CFX_FloatRect rect;
- rect=rectArray.GetAt(rect_index);
- *left=rect.left;
- *right=rect.right;
- *top=rect.top;
- *bottom=rect.bottom;
-}
-DLLEXPORT void STDCALL FPDFLink_CloseWebLinks(FPDF_PAGELINK link_page)
-{
- if (!link_page) return;
- IPDF_LinkExtract* pageLink=(IPDF_LinkExtract*)link_page;
- delete pageLink;
- pageLink =NULL;
-}
-
+// 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
+
+#include "../include/fsdk_define.h"
+#include "../include/fpdftext.h"
+
+#ifdef _WIN32
+#include <tchar.h>
+#endif
+
+ // jabdelmalek: commented out to build on Linux. Not used.
+ // extern HANDLE g_hModule;
+
+DLLEXPORT FPDF_TEXTPAGE STDCALL FPDFText_LoadPage(FPDF_PAGE page)
+{
+ if (!page) return NULL;
+ IPDF_TextPage* textpage=NULL;
+ try
+ {
+ CPDF_ViewerPreferences viewRef(((CPDF_Page*)page)->m_pDocument);
+ textpage=IPDF_TextPage::CreateTextPage((CPDF_Page*)page,viewRef.IsDirectionR2L());
+ textpage->ParseTextPage();
+ }
+ catch (...)
+ {
+ if (textpage)
+ delete textpage;
+ return NULL;
+ }
+ return textpage;
+}
+DLLEXPORT void STDCALL FPDFText_ClosePage(FPDF_TEXTPAGE text_page)
+{
+ if (text_page){
+ IPDF_TextPage* textpage=(IPDF_TextPage*)text_page;
+ delete textpage;
+ text_page=NULL;
+ }
+}
+DLLEXPORT int STDCALL FPDFText_CountChars(FPDF_TEXTPAGE text_page)
+{
+ if (!text_page) return -1;
+ IPDF_TextPage* textpage=(IPDF_TextPage*)text_page;
+ return textpage->CountChars();
+}
+DLLEXPORT unsigned int STDCALL FPDFText_GetUnicode(FPDF_TEXTPAGE text_page, int index)
+{
+ if (!text_page) return -1;
+ IPDF_TextPage* textpage=(IPDF_TextPage*)text_page;
+
+ if (index<0 || index>=textpage->CountChars()) return 0;
+
+ FPDF_CHAR_INFO charinfo;
+ textpage->GetCharInfo(index,charinfo);
+ return charinfo.m_Unicode;
+}
+DLLEXPORT double STDCALL FPDFText_GetFontSize(FPDF_TEXTPAGE text_page, int index)
+{
+ if (!text_page) return 0;
+ IPDF_TextPage* textpage=(IPDF_TextPage*)text_page;
+
+ if (index<0 || index>=textpage->CountChars()) return 0;
+
+ FPDF_CHAR_INFO charinfo;
+ textpage->GetCharInfo(index,charinfo);
+ return charinfo.m_FontSize;
+}
+
+DLLEXPORT void STDCALL FPDFText_GetCharBox(FPDF_TEXTPAGE text_page, int index,double* left,
+ double* right, double* bottom, double* top)
+{
+ if (!text_page) return;
+ IPDF_TextPage* textpage=(IPDF_TextPage*)text_page;
+
+ if (index<0 || index>=textpage->CountChars()) return ;
+ FPDF_CHAR_INFO charinfo;
+ textpage->GetCharInfo(index,charinfo);
+ *left=charinfo.m_CharBox.left;
+ *right=charinfo.m_CharBox.right;
+ *bottom=charinfo.m_CharBox.bottom;
+ *top=charinfo.m_CharBox.top;
+}
+
+//select
+DLLEXPORT int STDCALL FPDFText_GetCharIndexAtPos(FPDF_TEXTPAGE text_page,double x,double y,double xTorelance,double yTorelance)
+{
+ if (!text_page) return -3;
+ IPDF_TextPage* textpage=(IPDF_TextPage*)text_page;
+ return textpage->GetIndexAtPos((FX_FLOAT)x,(FX_FLOAT)y,(FX_FLOAT)xTorelance,(FX_FLOAT)yTorelance);
+}
+
+DLLEXPORT int STDCALL FPDFText_GetText(FPDF_TEXTPAGE text_page,int start,int count,unsigned short* result)
+{
+ if (!text_page) return 0;
+ IPDF_TextPage* textpage=(IPDF_TextPage*)text_page;
+
+ if (start>=textpage->CountChars()) return 0;
+
+ CFX_WideString str=textpage->GetPageText(start,count);
+ if(str.GetLength()>count)
+ str = str.Left(count);
+
+ CFX_ByteString cbUTF16str = str.UTF16LE_Encode();
+ FXSYS_memcpy(result,cbUTF16str.GetBuffer(cbUTF16str.GetLength()),cbUTF16str.GetLength());
+ cbUTF16str.ReleaseBuffer(cbUTF16str.GetLength());
+
+ return cbUTF16str.GetLength()/sizeof(unsigned short);
+}
+
+DLLEXPORT int STDCALL FPDFText_CountRects(FPDF_TEXTPAGE text_page,int start,int count)
+{
+ if (!text_page) return 0;
+ IPDF_TextPage* textpage=(IPDF_TextPage*)text_page;
+ return textpage->CountRects(start,count);
+
+}
+DLLEXPORT void STDCALL FPDFText_GetRect(FPDF_TEXTPAGE text_page,int rect_index, double* left,double* top,
+ double* right, double* bottom)
+{
+ if (!text_page) return;
+ IPDF_TextPage* textpage=(IPDF_TextPage*)text_page;
+ CFX_FloatRect rect;
+ textpage->GetRect(rect_index,rect.left,rect.top,rect.right,rect.bottom);
+ *left=rect.left;
+ *top=rect.top;
+ *right=rect.right;
+ *bottom=rect.bottom;
+}
+
+DLLEXPORT int STDCALL FPDFText_GetBoundedText(FPDF_TEXTPAGE text_page,double left, double top,
+ double right, double bottom,unsigned short* buffer,int buflen)
+{
+ if (!text_page) return 0;
+ IPDF_TextPage* textpage=(IPDF_TextPage*)text_page;
+ CFX_FloatRect rect((FX_FLOAT)left,(FX_FLOAT)bottom,(FX_FLOAT)right,(FX_FLOAT)top);
+ CFX_WideString str=textpage->GetTextByRect(rect);
+
+ if (buflen<=0 || buffer==NULL)
+ {
+ return str.GetLength();
+ }
+
+ CFX_ByteString cbUTF16Str = str.UTF16LE_Encode();
+ int len = cbUTF16Str.GetLength()/sizeof(unsigned short);
+ int size = buflen > len ? len : buflen;
+ FXSYS_memcpy(buffer,cbUTF16Str.GetBuffer(size*sizeof(unsigned short)),size*sizeof(unsigned short));
+ cbUTF16Str.ReleaseBuffer(size*sizeof(unsigned short));
+
+ return size;
+
+}
+
+//Search
+//-1 for end
+DLLEXPORT FPDF_SCHHANDLE STDCALL FPDFText_FindStart(FPDF_TEXTPAGE text_page,FPDF_WIDESTRING findwhat,unsigned long flags,int start_index)
+{
+ if (!text_page) return NULL;
+ IPDF_TextPageFind* textpageFind=NULL;
+ try
+ {
+ textpageFind=IPDF_TextPageFind::CreatePageFind((IPDF_TextPage*)text_page);
+ textpageFind->FindFirst(CFX_WideString::FromUTF16LE(findwhat),flags,start_index);
+ }
+ catch (...)
+ {
+ if (textpageFind)
+ delete textpageFind;
+ return NULL;
+ }
+ return textpageFind;
+}
+DLLEXPORT FPDF_BOOL STDCALL FPDFText_FindNext(FPDF_SCHHANDLE handle)
+{
+ if (!handle) return FALSE;
+ IPDF_TextPageFind* textpageFind=(IPDF_TextPageFind*)handle;
+ return textpageFind->FindNext();
+}
+DLLEXPORT FPDF_BOOL STDCALL FPDFText_FindPrev(FPDF_SCHHANDLE handle)
+{
+ if (!handle) return FALSE;
+ IPDF_TextPageFind* textpageFind=(IPDF_TextPageFind*)handle;
+ return textpageFind->FindPrev();
+}
+DLLEXPORT int STDCALL FPDFText_GetSchResultIndex(FPDF_SCHHANDLE handle)
+{
+ if (!handle) return 0;
+ IPDF_TextPageFind* textpageFind=(IPDF_TextPageFind*)handle;
+ return textpageFind->GetCurOrder();
+}
+DLLEXPORT int STDCALL FPDFText_GetSchCount(FPDF_SCHHANDLE handle)
+{
+ if (!handle) return 0;
+ IPDF_TextPageFind* textpageFind=(IPDF_TextPageFind*)handle;
+ return textpageFind->GetMatchedCount();
+}
+DLLEXPORT void STDCALL FPDFText_FindClose(FPDF_SCHHANDLE handle)
+{
+ if (!handle) return;
+ IPDF_TextPageFind* textpageFind=(IPDF_TextPageFind*)handle;
+ delete textpageFind;
+ handle=NULL;
+}
+
+//web link
+DLLEXPORT FPDF_PAGELINK STDCALL FPDFLink_LoadWebLinks(FPDF_TEXTPAGE text_page)
+{
+ if (!text_page) return NULL;
+ IPDF_LinkExtract* pageLink=NULL;
+ try
+ {
+ pageLink=IPDF_LinkExtract::CreateLinkExtract();
+ pageLink->ExtractLinks((IPDF_TextPage*)text_page);
+ }
+ catch (...)
+ {
+ if (pageLink)
+ delete pageLink;
+ return NULL;
+ }
+ return pageLink;
+}
+DLLEXPORT int STDCALL FPDFLink_CountWebLinks(FPDF_PAGELINK link_page)
+{
+ if (!link_page) return 0;
+ IPDF_LinkExtract* pageLink=(IPDF_LinkExtract*)link_page;
+ return pageLink->CountLinks();
+}
+DLLEXPORT int STDCALL FPDFLink_GetURL(FPDF_PAGELINK link_page,int link_index, unsigned short* buffer,int buflen)
+{
+ if (!link_page) return 0;
+ IPDF_LinkExtract* pageLink=(IPDF_LinkExtract*)link_page;
+ CFX_WideString url=pageLink->GetURL(link_index);
+
+ CFX_ByteString cbUTF16URL = url.UTF16LE_Encode();
+ int len= cbUTF16URL.GetLength()/sizeof(unsigned short);
+ if (buffer==NULL || buflen<=0)
+ return len;
+ int size=len<buflen ? len :buflen;
+ if (size>0)
+ {
+ FXSYS_memcpy(buffer,cbUTF16URL.GetBuffer(size*sizeof(unsigned short)),size*sizeof(unsigned short));
+ cbUTF16URL.ReleaseBuffer(size*sizeof(unsigned short));
+ }
+ return size;
+}
+DLLEXPORT int STDCALL FPDFLink_CountRects(FPDF_PAGELINK link_page,int link_index)
+{
+ if (!link_page) return 0;
+ IPDF_LinkExtract* pageLink=(IPDF_LinkExtract*)link_page;
+ CFX_RectArray rectArray;
+ pageLink->GetRects(link_index,rectArray);
+ return rectArray.GetSize();
+}
+DLLEXPORT void STDCALL FPDFLink_GetRect(FPDF_PAGELINK link_page,int link_index, int rect_index, double* left,
+ double* top,double* right, double* bottom)
+{
+ if (!link_page) return;
+ IPDF_LinkExtract* pageLink=(IPDF_LinkExtract*)link_page;
+ CFX_RectArray rectArray;
+ pageLink->GetRects(link_index,rectArray);
+ CFX_FloatRect rect;
+ rect=rectArray.GetAt(rect_index);
+ *left=rect.left;
+ *right=rect.right;
+ *top=rect.top;
+ *bottom=rect.bottom;
+}
+DLLEXPORT void STDCALL FPDFLink_CloseWebLinks(FPDF_PAGELINK link_page)
+{
+ if (!link_page) return;
+ IPDF_LinkExtract* pageLink=(IPDF_LinkExtract*)link_page;
+ delete pageLink;
+ pageLink =NULL;
+}
+
diff --git a/fpdfsdk/src/fpdfview.cpp b/fpdfsdk/src/fpdfview.cpp
index e72e5ab0db..a5ba796158 100644
--- a/fpdfsdk/src/fpdfview.cpp
+++ b/fpdfsdk/src/fpdfview.cpp
@@ -1,879 +1,879 @@
-// 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
-
-#include "../include/fsdk_define.h"
-#include "../include/fpdfview.h"
-#include "../include/fsdk_rendercontext.h"
-#include "../include/fpdf_progressive.h"
-#include "../include/fpdf_ext.h"
-
-
-CPDF_CustomAccess::CPDF_CustomAccess(FPDF_FILEACCESS* pFileAccess)
-{
- m_FileAccess = *pFileAccess;
- m_BufferOffset = (FX_DWORD)-1;
-}
-
-FX_BOOL CPDF_CustomAccess::GetByte(FX_DWORD pos, FX_BYTE& ch)
-{
- if (pos >= m_FileAccess.m_FileLen) return FALSE;
- if (m_BufferOffset == (FX_DWORD)-1 || pos < m_BufferOffset || pos >= m_BufferOffset + 512) {
- // Need to read from file access
- m_BufferOffset = pos;
- int size = 512;
- if (pos + 512 > m_FileAccess.m_FileLen)
- size = m_FileAccess.m_FileLen - pos;
- if (!m_FileAccess.m_GetBlock(m_FileAccess.m_Param, m_BufferOffset, m_Buffer, size))
- return FALSE;
- }
- ch = m_Buffer[pos - m_BufferOffset];
- return TRUE;
-}
-
-FX_BOOL CPDF_CustomAccess::GetBlock(FX_DWORD pos, FX_LPBYTE pBuf, FX_DWORD size)
-{
- if (pos + size > m_FileAccess.m_FileLen) return FALSE;
- return m_FileAccess.m_GetBlock(m_FileAccess.m_Param, pos, pBuf, size);
-}
-
-FX_BOOL CPDF_CustomAccess::ReadBlock(void* buffer, FX_FILESIZE offset, size_t size)
-{
- // m_FileAccess = *pFileAccess;
- // m_BufferOffset = (FX_DWORD)-1;
- if (offset + size > m_FileAccess.m_FileLen) return FALSE;
- return m_FileAccess.m_GetBlock(m_FileAccess.m_Param, offset,(FX_LPBYTE) buffer, size);
-
- // return FALSE;
-}
-
-//0 bit: FPDF_POLICY_MACHINETIME_ACCESS
-static FX_DWORD foxit_sandbox_policy = 0xFFFFFFFF;
-
-void FSDK_SetSandBoxPolicy(FPDF_DWORD policy, FPDF_BOOL enable)
-{
- switch(policy)
- {
- case FPDF_POLICY_MACHINETIME_ACCESS:
- {
- if(enable)
- foxit_sandbox_policy |= 0x01;
- else
- foxit_sandbox_policy &= 0xFFFFFFFE;
- }
- break;
- default:
- break;
- }
-}
-
-FPDF_BOOL FSDK_IsSandBoxPolicyEnabled(FPDF_DWORD policy)
-{
- switch(policy)
- {
- case FPDF_POLICY_MACHINETIME_ACCESS:
- {
- if(foxit_sandbox_policy&0x01)
- return TRUE;
- else
- return FALSE;
- }
- break;
- default:
- break;
- }
- return FALSE;
-}
-
-
-#ifndef _T
-#define _T(x) x
-#endif
-
-#ifdef API5
- CPDF_ModuleMgr* g_pModuleMgr = NULL;
-#else
- CCodec_ModuleMgr* g_pCodecModule = NULL;
-#ifdef _FXSDK_OPENSOURCE_
- FXMEM_FoxitMgr* g_pFoxitMgr = NULL;
-#endif
-#endif
-
-//extern CPDFSDK_FormFillApp* g_pFormFillApp;
-
-#if _FX_OS_ == _FX_LINUX_EMBEDDED_
-class CFontMapper : public IPDF_FontMapper
-{
-public:
- CFontMapper();
- virtual ~CFontMapper();
-
- virtual FT_Face FindSubstFont(
- CPDF_Document* pDoc, // [IN] The PDF document
- const CFX_ByteString& face_name, // [IN] Original name
- FX_BOOL bTrueType, // [IN] TrueType or Type1
- FX_DWORD flags, // [IN] PDF font flags (see PDF Reference section 5.7.1)
- int font_weight, // [IN] original font weight. 0 for not specified
- int CharsetCP, // [IN] code page for charset (see Win32 GetACP())
- FX_BOOL bVertical,
- CPDF_SubstFont* pSubstFont // [OUT] Subst font data
- );
-
- FT_Face m_SysFace;
-};
-
-CFontMapper* g_pFontMapper = NULL;
-#endif // #if _FX_OS_ == _FX_LINUX_EMBEDDED_
-
-DLLEXPORT void STDCALL FPDF_InitLibrary(FX_LPVOID hInstance)
-{
-#ifdef API5
- CPDF_ModuleMgr::Create();
- g_pModuleMgr = CPDF_ModuleMgr::Get();
- #if _FX_OS_ == _FX_WIN32_MOBILE_ || _FX_OS_ == _FX_LINUX_EMBEDDED_
- g_pModuleMgr->InitEmbedded();
- #ifdef _GB1_CMAPS_
- g_pModuleMgr->LoadEmbeddedGB1CMaps();
- #endif
- #ifdef _GB1_CMAPS_4_
- g_pModuleMgr->LoadEmbeddedGB1CMaps_4();
- #endif
- #ifdef _CNS1_CMAPS_
- g_pModuleMgr->LoadEmbeddedCNS1CMaps();
- #endif
- #ifdef _JAPAN1_CMAPS_
- g_pModuleMgr->LoadEmbeddedJapan1CMaps();
- #endif
- #ifdef _JAPAN1_CMAPS_6_
- g_pModuleMgr->LoadEmbeddedJapan1CMaps_6();
- #endif
- #ifdef _KOREA1_CMAPS_
- g_pModuleMgr->LoadEmbeddedKorea1CMaps();
- #endif
- #ifdef _JPX_DECODER_
- g_pModuleMgr->InitJpxModule();
- g_pModuleMgr->InitJbig2Module();
- // g_pModuleMgr->InitIccModule();
- #endif
- #else
- g_pModuleMgr->InitDesktop();
- #endif
-#else
-#ifdef _FXSDK_OPENSOURCE_
- g_pFoxitMgr = FXMEM_CreateMemoryMgr(1024 * 1024 * 32, TRUE);
-#endif
- g_pCodecModule = CCodec_ModuleMgr::Create();
-
- CFX_GEModule::Create();
- CFX_GEModule::Get()->SetCodecModule(g_pCodecModule);
-
- CPDF_ModuleMgr::Create();
- CPDF_ModuleMgr::Get()->SetCodecModule(g_pCodecModule);
- CPDF_ModuleMgr::Get()->InitPageModule();
- CPDF_ModuleMgr::Get()->InitRenderModule();
-#ifdef FOXIT_CHROME_BUILD
- CPDF_ModuleMgr * pModuleMgr = CPDF_ModuleMgr::Get();
- if ( pModuleMgr )
- {
- pModuleMgr->LoadEmbeddedGB1CMaps();
- pModuleMgr->LoadEmbeddedJapan1CMaps();
- pModuleMgr->LoadEmbeddedCNS1CMaps();
- pModuleMgr->LoadEmbeddedKorea1CMaps();
- }
-#endif
-#endif
-
-#ifdef _WIN32
- // Get module path
- TCHAR app_path[MAX_PATH];
- ::GetModuleFileName((HINSTANCE)hInstance, app_path, MAX_PATH);
- size_t len = _tcslen(app_path);
- for (size_t i = len; i >= 0; i --)
- if (app_path[i] == '\\') {
- app_path[i] = 0;
- break;
- }
-
-#ifdef _UNICODE
- #ifndef _FXSDK_OPENSOURCE_
- CPDF_ModuleMgr::Get()->SetModulePath(NULL, CFX_ByteString::FromUnicode(app_path));
- #endif
-#else
-#ifndef _FXSDK_OPENSOURCE_
- CPDF_ModuleMgr::Get()->SetModulePath(NULL, app_path);
-#endif
-#endif
-#endif
-}
-
-
-DLLEXPORT void STDCALL FPDF_DestroyLibrary()
-{
-
-#if _FX_OS_ == _FX_LINUX_EMBEDDED_
- if (g_pFontMapper) delete g_pFontMapper;
-#endif
-#ifdef API5
- g_pModuleMgr->Destroy();
-#else
- CPDF_ModuleMgr::Destroy();
- CFX_GEModule::Destroy();
- g_pCodecModule->Destroy();
-#endif
-#ifndef _FXSDK_OPENSOURCE_
- FXMEM_CollectAll(FXMEM_GetDefaultMgr());
-#else
- FXMEM_DestroyFoxitMgr(g_pFoxitMgr);
-#endif
-}
-
-#ifndef _WIN32
-int g_LastError;
-void SetLastError(int err)
-{
- g_LastError = err;
-}
-
-int GetLastError()
-{
- return g_LastError;
-}
-#endif
-
-void ProcessParseError(FX_DWORD err_code)
-{
- // Translate FPDFAPI error code to FPDFVIEW error code
- switch (err_code) {
- case PDFPARSE_ERROR_FILE:
- err_code = FPDF_ERR_FILE;
- break;
- case PDFPARSE_ERROR_FORMAT:
- err_code = FPDF_ERR_FORMAT;
- break;
- case PDFPARSE_ERROR_PASSWORD:
- err_code = FPDF_ERR_PASSWORD;
- break;
- case PDFPARSE_ERROR_HANDLER:
- err_code = FPDF_ERR_SECURITY;
- break;
- }
- SetLastError(err_code);
-}
-
-DLLEXPORT void STDCALL FPDF_SetSandBoxPolicy(FPDF_DWORD policy, FPDF_BOOL enable)
-{
- return FSDK_SetSandBoxPolicy(policy, enable);
-}
-
-DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadDocument(FPDF_STRING file_path, FPDF_BYTESTRING password)
-{
- CPDF_Parser* pParser = FX_NEW CPDF_Parser;
- pParser->SetPassword(password);
- try {
- FX_DWORD err_code = pParser->StartParse((FX_LPCSTR)file_path);
- if (err_code) {
- delete pParser;
- ProcessParseError(err_code);
- return NULL;
- }
- }
- catch (...) {
- delete pParser;
- SetLastError(FPDF_ERR_UNKNOWN);
- return NULL;
- }
- return pParser->GetDocument();
-}
-
-extern void CheckUnSupportError(CPDF_Document * pDoc, FX_DWORD err_code);
-
-class CMemFile: public IFX_FileRead, public CFX_Object
-{
-public:
- CMemFile(FX_BYTE* pBuf, FX_FILESIZE size):m_pBuf(pBuf),m_size(size) {}
-
- virtual void Release() {delete this;}
- virtual FX_FILESIZE GetSize() {return m_size;}
- virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size)
- {
- if(offset+size > (FX_DWORD)m_size) return FALSE;
- FXSYS_memcpy(buffer, m_pBuf+offset, size);
- return TRUE;
- }
-private:
- FX_BYTE* m_pBuf;
- FX_FILESIZE m_size;
-};
-DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadMemDocument(const void* data_buf, int size, FPDF_BYTESTRING password)
-{
- CPDF_Parser* pParser = FX_NEW CPDF_Parser;
- pParser->SetPassword(password);
- try {
- CMemFile* pMemFile = FX_NEW CMemFile((FX_BYTE*)data_buf, size);
- FX_DWORD err_code = pParser->StartParse(pMemFile);
- if (err_code) {
- delete pParser;
- ProcessParseError(err_code);
- return NULL;
- }
- CPDF_Document * pDoc = NULL;
- pDoc = pParser?pParser->GetDocument():NULL;
- CheckUnSupportError(pDoc, err_code);
- }
- catch (...) {
- delete pParser;
- SetLastError(FPDF_ERR_UNKNOWN);
- return NULL;
- }
- return pParser->GetDocument();
-}
-
-DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadCustomDocument(FPDF_FILEACCESS* pFileAccess, FPDF_BYTESTRING password)
-{
- CPDF_Parser* pParser = FX_NEW CPDF_Parser;
- pParser->SetPassword(password);
- CPDF_CustomAccess* pFile = FX_NEW CPDF_CustomAccess(pFileAccess);
- try {
- FX_DWORD err_code = pParser->StartParse(pFile);
- if (err_code) {
- delete pParser;
- ProcessParseError(err_code);
- return NULL;
- }
- CPDF_Document * pDoc = NULL;
- pDoc = pParser?pParser->GetDocument():NULL;
- CheckUnSupportError(pDoc, err_code);
- }
- catch (...) {
- delete pParser;
- SetLastError(FPDF_ERR_UNKNOWN);
- return NULL;
- }
- return pParser->GetDocument();
-}
-
-DLLEXPORT FPDF_BOOL STDCALL FPDF_GetFileVersion(FPDF_DOCUMENT doc, int* fileVersion)
-{
- if(!doc||!fileVersion) return FALSE;
- *fileVersion = 0;
- CPDF_Document* pDoc = (CPDF_Document*)doc;
- CPDF_Parser* pParser = (CPDF_Parser*)pDoc->GetParser();
- if(!pParser)
- return FALSE;
- *fileVersion = pParser->GetFileVersion();
- return TRUE;
-}
-
-// jabdelmalek: changed return type from FX_DWORD to build on Linux (and match header).
-DLLEXPORT unsigned long STDCALL FPDF_GetDocPermissions(FPDF_DOCUMENT document)
-{
- if (document == NULL) return 0;
- CPDF_Document*pDoc = (CPDF_Document*)document;
- CPDF_Parser* pParser = (CPDF_Parser*)pDoc->GetParser();
- CPDF_Dictionary* pDict = pParser->GetEncryptDict();
- if (pDict == NULL) return (FX_DWORD)-1;
-
- return pDict->GetInteger("P");
-}
-
-DLLEXPORT int STDCALL FPDF_GetPageCount(FPDF_DOCUMENT document)
-{
- if (document == NULL) return 0;
- return ((CPDF_Document*)document)->GetPageCount();
-}
-
-DLLEXPORT FPDF_PAGE STDCALL FPDF_LoadPage(FPDF_DOCUMENT document, int page_index)
-{
- if (document == NULL) return NULL;
- if (page_index < 0 || page_index >= FPDF_GetPageCount(document)) return NULL;
-// CPDF_Parser* pParser = (CPDF_Parser*)document;
- CPDF_Document* pDoc = (CPDF_Document*)document;
- if (pDoc == NULL) return NULL;
- CPDF_Dictionary* pDict = pDoc->GetPage(page_index);
- if (pDict == NULL) return NULL;
- CPDF_Page* pPage = FX_NEW CPDF_Page;
- pPage->Load(pDoc, pDict);
- try {
- pPage->ParseContent();
- }
- catch (...) {
- delete pPage;
- return NULL;
- }
-
-// CheckUnSupportError(pDoc, 0);
-
- return pPage;
-}
-
-DLLEXPORT double STDCALL FPDF_GetPageWidth(FPDF_PAGE page)
-{
- if (!page)
- return 0.0;
- return ((CPDF_Page*)page)->GetPageWidth();
-}
-
-DLLEXPORT double STDCALL FPDF_GetPageHeight(FPDF_PAGE page)
-{
- if (!page) return 0.0;
- return ((CPDF_Page*)page)->GetPageHeight();
-}
-
-void DropContext(void* data)
-{
- delete (CRenderContext*)data;
-}
-
-void FPDF_RenderPage_Retail(CRenderContext* pContext, FPDF_PAGE page, int start_x, int start_y, int size_x, int size_y,
- int rotate, int flags,FX_BOOL bNeedToRestore, IFSDK_PAUSE_Adapter * pause );
-void (*Func_RenderPage)(CRenderContext*, FPDF_PAGE page, int start_x, int start_y, int size_x, int size_y,
- int rotate, int flags,FX_BOOL bNeedToRestore, IFSDK_PAUSE_Adapter * pause ) = FPDF_RenderPage_Retail;
-
-#if defined(_DEBUG) || defined(DEBUG)
-#define DEBUG_TRACE
-#endif
-
-#if defined(_WIN32)
-DLLEXPORT void STDCALL FPDF_RenderPage(HDC dc, FPDF_PAGE page, int start_x, int start_y, int size_x, int size_y,
- int rotate, int flags)
-{
- if (page==NULL) return;
- CPDF_Page* pPage = (CPDF_Page*)page;
-
- CRenderContext* pContext = FX_NEW CRenderContext;
- pPage->SetPrivateData((void*)1, pContext, DropContext);
-
-#ifndef _WIN32_WCE
- CFX_DIBitmap* pBitmap = NULL;
- FX_BOOL bBackgroundAlphaNeeded=FALSE;
- bBackgroundAlphaNeeded = pPage->BackgroundAlphaNeeded();
- if (bBackgroundAlphaNeeded)
- {
-
- pBitmap = FX_NEW CFX_DIBitmap;
- pBitmap->Create(size_x, size_y, FXDIB_Argb);
- pBitmap->Clear(0x00ffffff);
-#ifdef _SKIA_SUPPORT_
- pContext->m_pDevice = FX_NEW CFX_SkiaDevice;
- ((CFX_SkiaDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)pBitmap);
-#else
- pContext->m_pDevice = FX_NEW CFX_FxgeDevice;
- ((CFX_FxgeDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)pBitmap);
-#endif
- }
- else
- pContext->m_pDevice = FX_NEW CFX_WindowsDevice(dc);
- if (flags & FPDF_NO_CATCH)
- Func_RenderPage(pContext, page, start_x, start_y, size_x, size_y, rotate, flags,TRUE,NULL);
- else {
- try {
- Func_RenderPage(pContext, page, start_x, start_y, size_x, size_y, rotate, flags,TRUE,NULL);
- } catch (...) {
- }
- }
- if (bBackgroundAlphaNeeded)
- {
- if (pBitmap)
- {
- CFX_WindowsDevice WinDC(dc);
-
- if (WinDC.GetDeviceCaps(FXDC_DEVICE_CLASS) == FXDC_PRINTER)
- {
- CFX_DIBitmap* pDst = FX_NEW CFX_DIBitmap;
- pDst->Create(pBitmap->GetWidth(), pBitmap->GetHeight(),FXDIB_Rgb32);
- FXSYS_memcpy(pDst->GetBuffer(), pBitmap->GetBuffer(), pBitmap->GetPitch()*pBitmap->GetHeight());
-// WinDC.SetDIBits(pDst,0,0);
- WinDC.StretchDIBits(pDst,0,0,size_x*2,size_y*2);
- delete pDst;
- }
- else
- WinDC.SetDIBits(pBitmap,0,0);
-
- }
- }
-#else
- // get clip region
- RECT rect, cliprect;
- rect.left = start_x;
- rect.top = start_y;
- rect.right = start_x + size_x;
- rect.bottom = start_y + size_y;
- GetClipBox(dc, &cliprect);
- IntersectRect(&rect, &rect, &cliprect);
- int width = rect.right - rect.left;
- int height = rect.bottom - rect.top;
-
-#ifdef DEBUG_TRACE
- {
- char str[128];
- sprintf(str, "Rendering DIB %d x %d", width, height);
- CPDF_ModuleMgr::Get()->ReportError(999, str);
- }
-#endif
-
- // Create a DIB section
- LPVOID pBuffer;
- BITMAPINFOHEADER bmih;
- FXSYS_memset(&bmih, 0, sizeof bmih);
- bmih.biSize = sizeof bmih;
- bmih.biBitCount = 24;
- bmih.biHeight = -height;
- bmih.biPlanes = 1;
- bmih.biWidth = width;
- pContext->m_hBitmap = CreateDIBSection(dc, (BITMAPINFO*)&bmih, DIB_RGB_COLORS, &pBuffer, NULL, 0);
- if (pContext->m_hBitmap == NULL) {
-#if defined(DEBUG) || defined(_DEBUG)
- char str[128];
- sprintf(str, "Error CreateDIBSection: %d x %d, error code = %d", width, height, GetLastError());
- CPDF_ModuleMgr::Get()->ReportError(FPDFERR_OUT_OF_MEMORY, str);
-#else
- CPDF_ModuleMgr::Get()->ReportError(FPDFERR_OUT_OF_MEMORY, NULL);
-#endif
- }
- FXSYS_memset(pBuffer, 0xff, height*((width*3+3)/4*4));
-
-#ifdef DEBUG_TRACE
- {
- CPDF_ModuleMgr::Get()->ReportError(999, "DIBSection created");
- }
-#endif
-
- // Create a device with this external buffer
- pContext->m_pBitmap = FX_NEW CFX_DIBitmap;
- pContext->m_pBitmap->Create(width, height, FXDIB_Rgb, (FX_LPBYTE)pBuffer);
- pContext->m_pDevice = FX_NEW CPDF_FxgeDevice;
- ((CPDF_FxgeDevice*)pContext->m_pDevice)->Attach(pContext->m_pBitmap);
-
-#ifdef DEBUG_TRACE
- CPDF_ModuleMgr::Get()->ReportError(999, "Ready for PDF rendering");
-#endif
-
- // output to bitmap device
- if (flags & FPDF_NO_CATCH)
- Func_RenderPage(pContext, page, start_x - rect.left, start_y - rect.top, size_x, size_y, rotate, flags);
- else {
- try {
- Func_RenderPage(pContext, page, start_x - rect.left, start_y - rect.top, size_x, size_y, rotate, flags);
- } catch (...) {
- }
- }
-
-#ifdef DEBUG_TRACE
- CPDF_ModuleMgr::Get()->ReportError(999, "Finished PDF rendering");
-#endif
-
- // Now output to real device
- HDC hMemDC = CreateCompatibleDC(dc);
- if (hMemDC == NULL) {
-#if defined(DEBUG) || defined(_DEBUG)
- char str[128];
- sprintf(str, "Error CreateCompatibleDC. Error code = %d", GetLastError());
- CPDF_ModuleMgr::Get()->ReportError(FPDFERR_OUT_OF_MEMORY, str);
-#else
- CPDF_ModuleMgr::Get()->ReportError(FPDFERR_OUT_OF_MEMORY, NULL);
-#endif
- }
-
- HGDIOBJ hOldBitmap = SelectObject(hMemDC, pContext->m_hBitmap);
-
-#ifdef DEBUG_TRACE
- CPDF_ModuleMgr::Get()->ReportError(999, "Ready for screen rendering");
-#endif
-
- BitBlt(dc, rect.left, rect.top, width, height, hMemDC, 0, 0, SRCCOPY);
- SelectObject(hMemDC, hOldBitmap);
- DeleteDC(hMemDC);
-
-#ifdef DEBUG_TRACE
- CPDF_ModuleMgr::Get()->ReportError(999, "Finished screen rendering");
-#endif
-
-#endif
- if (bBackgroundAlphaNeeded)
- {
- if (pBitmap)
- delete pBitmap;
- pBitmap = NULL;
- }
- delete pContext;
- pPage->RemovePrivateData((void*)1);
-}
-#endif
-
-DLLEXPORT void STDCALL FPDF_RenderPageBitmap(FPDF_BITMAP bitmap, FPDF_PAGE page, int start_x, int start_y,
- int size_x, int size_y, int rotate, int flags)
-{
- if (bitmap == NULL || page == NULL) return;
- CPDF_Page* pPage = (CPDF_Page*)page;
-
-
- CRenderContext* pContext = FX_NEW CRenderContext;
- pPage->SetPrivateData((void*)1, pContext, DropContext);
-#ifdef _SKIA_SUPPORT_
- pContext->m_pDevice = FX_NEW CFX_SkiaDevice;
-
- if (flags & FPDF_REVERSE_BYTE_ORDER)
- ((CFX_SkiaDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bitmap,0,TRUE);
- else
- ((CFX_SkiaDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bitmap);
-#else
- pContext->m_pDevice = FX_NEW CFX_FxgeDevice;
-
- if (flags & FPDF_REVERSE_BYTE_ORDER)
- ((CFX_FxgeDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bitmap,0,TRUE);
- else
- ((CFX_FxgeDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bitmap);
-#endif
- if (flags & FPDF_NO_CATCH)
- Func_RenderPage(pContext, page, start_x, start_y, size_x, size_y, rotate, flags,TRUE,NULL);
- else {
- try {
- Func_RenderPage(pContext, page, start_x, start_y, size_x, size_y, rotate, flags,TRUE,NULL);
- } catch (...) {
- }
- }
-
- delete pContext;
- pPage->RemovePrivateData((void*)1);
-}
-
-DLLEXPORT void STDCALL FPDF_ClosePage(FPDF_PAGE page)
-{
- if (!page) return;
- delete (CPDF_Page*)page;
-
-}
-
-DLLEXPORT void STDCALL FPDF_CloseDocument(FPDF_DOCUMENT document)
-{
- if (!document)
- return;
- CPDF_Document* pDoc = (CPDF_Document*)document;
- CPDF_Parser* pParser = (CPDF_Parser*)pDoc->GetParser();
- if (pParser == NULL)
- {
- delete pDoc;
- return;
- }
- delete pParser;
-// delete pDoc;
-}
-
-DLLEXPORT unsigned long STDCALL FPDF_GetLastError()
-{
- return GetLastError();
-}
-
-DLLEXPORT void STDCALL FPDF_DeviceToPage(FPDF_PAGE page, int start_x, int start_y, int size_x, int size_y,
- int rotate, int device_x, int device_y, double* page_x, double* page_y)
-{
- if (page == NULL || page_x == NULL || page_y == NULL) return;
- CPDF_Page* pPage = (CPDF_Page*)page;
-
- CPDF_Matrix page2device;
- pPage->GetDisplayMatrix(page2device, start_x, start_y, size_x, size_y, rotate);
- CPDF_Matrix device2page;
- device2page.SetReverse(page2device);
-
- FX_FLOAT page_x_f, page_y_f;
- device2page.Transform((FX_FLOAT)(device_x), (FX_FLOAT)(device_y), page_x_f, page_y_f);
-
- *page_x = (page_x_f);
- *page_y = (page_y_f);
-}
-
-DLLEXPORT void STDCALL FPDF_PageToDevice(FPDF_PAGE page, int start_x, int start_y, int size_x, int size_y,
- int rotate, double page_x, double page_y, int* device_x, int* device_y)
-{
- if (page == NULL || device_x == NULL || device_y == NULL) return;
- CPDF_Page* pPage = (CPDF_Page*)page;
-
- CPDF_Matrix page2device;
- pPage->GetDisplayMatrix(page2device, start_x, start_y, size_x, size_y, rotate);
-
- FX_FLOAT device_x_f, device_y_f;
- page2device.Transform(((FX_FLOAT)page_x), ((FX_FLOAT)page_y), device_x_f, device_y_f);
-
- *device_x = FXSYS_round(device_x_f);
- *device_y = FXSYS_round(device_y_f);
-}
-
-DLLEXPORT FPDF_BITMAP STDCALL FPDFBitmap_Create(int width, int height, int alpha)
-{
- CFX_DIBitmap* pBitmap = FX_NEW CFX_DIBitmap;
- pBitmap->Create(width, height, alpha ? FXDIB_Argb : FXDIB_Rgb32);
- return pBitmap;
-}
-
-DLLEXPORT FPDF_BITMAP STDCALL FPDFBitmap_CreateEx(int width, int height, int format, void* first_scan, int stride)
-{
- FXDIB_Format fx_format;
- switch (format) {
- case FPDFBitmap_Gray:
- fx_format = FXDIB_8bppRgb;
- break;
- case FPDFBitmap_BGR:
- fx_format = FXDIB_Rgb;
- break;
- case FPDFBitmap_BGRx:
- fx_format = FXDIB_Rgb32;
- break;
- case FPDFBitmap_BGRA:
- fx_format = FXDIB_Argb;
- break;
- default:
- return NULL;
- }
- CFX_DIBitmap* pBitmap = FX_NEW CFX_DIBitmap;
- pBitmap->Create(width, height, fx_format, (FX_LPBYTE)first_scan, stride);
- return pBitmap;
-}
-
-DLLEXPORT void STDCALL FPDFBitmap_FillRect(FPDF_BITMAP bitmap, int left, int top, int width, int height,
- int red, int green, int blue, int alpha)
-{
- if (bitmap == NULL) return;
-#ifdef _SKIA_SUPPORT_
- CFX_SkiaDevice device;
-#else
- CFX_FxgeDevice device;
-#endif
- device.Attach((CFX_DIBitmap*)bitmap);
- if (!((CFX_DIBitmap*)bitmap)->HasAlpha()) alpha = 255;
- FX_RECT rect(left, top, left+width, top+height);
- device.FillRect(&rect, FXARGB_MAKE(alpha, red, green, blue));
-}
-
-DLLEXPORT void* STDCALL FPDFBitmap_GetBuffer(FPDF_BITMAP bitmap)
-{
- if (bitmap == NULL) return NULL;
- return ((CFX_DIBitmap*)bitmap)->GetBuffer();
-}
-
-DLLEXPORT int STDCALL FPDFBitmap_GetWidth(FPDF_BITMAP bitmap)
-{
- if (bitmap == NULL) return 0;
- return ((CFX_DIBitmap*)bitmap)->GetWidth();
-}
-
-DLLEXPORT int STDCALL FPDFBitmap_GetHeight(FPDF_BITMAP bitmap)
-{
- if (bitmap == NULL) return 0;
- return ((CFX_DIBitmap*)bitmap)->GetHeight();
-}
-
-DLLEXPORT int STDCALL FPDFBitmap_GetStride(FPDF_BITMAP bitmap)
-{
- if (bitmap == NULL) return 0;
- return ((CFX_DIBitmap*)bitmap)->GetPitch();
-}
-
-DLLEXPORT void STDCALL FPDFBitmap_Destroy(FPDF_BITMAP bitmap)
-{
- if (bitmap == NULL) return;
- delete (CFX_DIBitmap*)bitmap;
-}
-
-void FPDF_RenderPage_Retail(CRenderContext* pContext, FPDF_PAGE page, int start_x, int start_y, int size_x, int size_y,
- int rotate, int flags,FX_BOOL bNeedToRestore, IFSDK_PAUSE_Adapter * pause )
-{
-//#ifdef _LICENSED_BUILD_
- CPDF_Page* pPage = (CPDF_Page*)page;
- if (pPage == NULL) return;
-
- if (!pContext->m_pOptions)
- pContext->m_pOptions = new CPDF_RenderOptions;
-// CPDF_RenderOptions options;
- if (flags & FPDF_LCD_TEXT)
- pContext->m_pOptions->m_Flags |= RENDER_CLEARTYPE;
- else
- pContext->m_pOptions->m_Flags &= ~RENDER_CLEARTYPE;
- if (flags & FPDF_NO_NATIVETEXT)
- pContext->m_pOptions->m_Flags |= RENDER_NO_NATIVETEXT;
- if (flags & FPDF_RENDER_LIMITEDIMAGECACHE)
- pContext->m_pOptions->m_Flags |= RENDER_LIMITEDIMAGECACHE;
- if (flags & FPDF_RENDER_FORCEHALFTONE)
- pContext->m_pOptions->m_Flags |= RENDER_FORCE_HALFTONE;
- //Grayscale output
- if (flags & FPDF_GRAYSCALE)
- {
- pContext->m_pOptions->m_ColorMode = RENDER_COLOR_GRAY;
- pContext->m_pOptions->m_ForeColor = 0;
- pContext->m_pOptions->m_BackColor = 0xffffff;
- }
- const CPDF_OCContext::UsageType usage = (flags & FPDF_PRINTING) ? CPDF_OCContext::Print : CPDF_OCContext::View;
-
- pContext->m_pOptions->m_AddFlags = flags >> 8;
-
- pContext->m_pOptions->m_pOCContext = new CPDF_OCContext(pPage->m_pDocument, usage);
-
-
- CFX_AffineMatrix matrix;
- pPage->GetDisplayMatrix(matrix, start_x, start_y, size_x, size_y, rotate);
-
- FX_RECT clip;
- clip.left = start_x;
- clip.right = start_x + size_x;
- clip.top = start_y;
- clip.bottom = start_y + size_y;
- pContext->m_pDevice->SaveState();
- pContext->m_pDevice->SetClip_Rect(&clip);
-
- pContext->m_pContext = FX_NEW CPDF_RenderContext;
- pContext->m_pContext->Create(pPage);
- pContext->m_pContext->AppendObjectList(pPage, &matrix);
-
- if (flags & FPDF_ANNOT) {
- pContext->m_pAnnots = FX_NEW CPDF_AnnotList(pPage);
- FX_BOOL bPrinting = pContext->m_pDevice->GetDeviceClass() != FXDC_DISPLAY;
- pContext->m_pAnnots->DisplayAnnots(pPage, pContext->m_pContext, bPrinting, &matrix, TRUE, NULL);
- }
-
- pContext->m_pRenderer = FX_NEW CPDF_ProgressiveRenderer;
- pContext->m_pRenderer->Start(pContext->m_pContext, pContext->m_pDevice, pContext->m_pOptions, pause);
- if (bNeedToRestore)
- {
- pContext->m_pDevice->RestoreState();
- }
-
-//#endif
-}
-
-DLLEXPORT int STDCALL FPDF_GetPageSizeByIndex(FPDF_DOCUMENT document, int page_index, double* width, double* height)
-{
- CPDF_Document* pDoc = (CPDF_Document*)document;
- if(pDoc == NULL)
- return FALSE;
-
- CPDF_Dictionary* pDict = pDoc->GetPage(page_index);
- if (pDict == NULL) return FALSE;
-
- CPDF_Page page;
- page.Load(pDoc, pDict);
- *width = page.GetPageWidth();
- *height = page.GetPageHeight();
-
- return TRUE;
-}
-
-DLLEXPORT FPDF_BOOL STDCALL FPDF_VIEWERREF_GetPrintScaling(FPDF_DOCUMENT document)
-{
- CPDF_Document* pDoc = (CPDF_Document*)document;
- if (!pDoc) return TRUE;
- CPDF_ViewerPreferences viewRef(pDoc);
- return viewRef.PrintScaling();
-}
-
-DLLEXPORT FPDF_DEST STDCALL FPDF_GetNamedDestByName(FPDF_DOCUMENT document,FPDF_BYTESTRING name)
-{
- if (document == NULL)
- return NULL;
- if (name == NULL || name[0] == 0)
- return NULL;
-
- CPDF_Document* pDoc = (CPDF_Document*)document;
- CPDF_NameTree name_tree(pDoc, FX_BSTRC("Dests"));
- return name_tree.LookupNamedDest(pDoc, name);
-}
+// 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
+
+#include "../include/fsdk_define.h"
+#include "../include/fpdfview.h"
+#include "../include/fsdk_rendercontext.h"
+#include "../include/fpdf_progressive.h"
+#include "../include/fpdf_ext.h"
+
+
+CPDF_CustomAccess::CPDF_CustomAccess(FPDF_FILEACCESS* pFileAccess)
+{
+ m_FileAccess = *pFileAccess;
+ m_BufferOffset = (FX_DWORD)-1;
+}
+
+FX_BOOL CPDF_CustomAccess::GetByte(FX_DWORD pos, FX_BYTE& ch)
+{
+ if (pos >= m_FileAccess.m_FileLen) return FALSE;
+ if (m_BufferOffset == (FX_DWORD)-1 || pos < m_BufferOffset || pos >= m_BufferOffset + 512) {
+ // Need to read from file access
+ m_BufferOffset = pos;
+ int size = 512;
+ if (pos + 512 > m_FileAccess.m_FileLen)
+ size = m_FileAccess.m_FileLen - pos;
+ if (!m_FileAccess.m_GetBlock(m_FileAccess.m_Param, m_BufferOffset, m_Buffer, size))
+ return FALSE;
+ }
+ ch = m_Buffer[pos - m_BufferOffset];
+ return TRUE;
+}
+
+FX_BOOL CPDF_CustomAccess::GetBlock(FX_DWORD pos, FX_LPBYTE pBuf, FX_DWORD size)
+{
+ if (pos + size > m_FileAccess.m_FileLen) return FALSE;
+ return m_FileAccess.m_GetBlock(m_FileAccess.m_Param, pos, pBuf, size);
+}
+
+FX_BOOL CPDF_CustomAccess::ReadBlock(void* buffer, FX_FILESIZE offset, size_t size)
+{
+ // m_FileAccess = *pFileAccess;
+ // m_BufferOffset = (FX_DWORD)-1;
+ if (offset + size > m_FileAccess.m_FileLen) return FALSE;
+ return m_FileAccess.m_GetBlock(m_FileAccess.m_Param, offset,(FX_LPBYTE) buffer, size);
+
+ // return FALSE;
+}
+
+//0 bit: FPDF_POLICY_MACHINETIME_ACCESS
+static FX_DWORD foxit_sandbox_policy = 0xFFFFFFFF;
+
+void FSDK_SetSandBoxPolicy(FPDF_DWORD policy, FPDF_BOOL enable)
+{
+ switch(policy)
+ {
+ case FPDF_POLICY_MACHINETIME_ACCESS:
+ {
+ if(enable)
+ foxit_sandbox_policy |= 0x01;
+ else
+ foxit_sandbox_policy &= 0xFFFFFFFE;
+ }
+ break;
+ default:
+ break;
+ }
+}
+
+FPDF_BOOL FSDK_IsSandBoxPolicyEnabled(FPDF_DWORD policy)
+{
+ switch(policy)
+ {
+ case FPDF_POLICY_MACHINETIME_ACCESS:
+ {
+ if(foxit_sandbox_policy&0x01)
+ return TRUE;
+ else
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ return FALSE;
+}
+
+
+#ifndef _T
+#define _T(x) x
+#endif
+
+#ifdef API5
+ CPDF_ModuleMgr* g_pModuleMgr = NULL;
+#else
+ CCodec_ModuleMgr* g_pCodecModule = NULL;
+#ifdef _FXSDK_OPENSOURCE_
+ FXMEM_FoxitMgr* g_pFoxitMgr = NULL;
+#endif
+#endif
+
+//extern CPDFSDK_FormFillApp* g_pFormFillApp;
+
+#if _FX_OS_ == _FX_LINUX_EMBEDDED_
+class CFontMapper : public IPDF_FontMapper
+{
+public:
+ CFontMapper();
+ virtual ~CFontMapper();
+
+ virtual FT_Face FindSubstFont(
+ CPDF_Document* pDoc, // [IN] The PDF document
+ const CFX_ByteString& face_name, // [IN] Original name
+ FX_BOOL bTrueType, // [IN] TrueType or Type1
+ FX_DWORD flags, // [IN] PDF font flags (see PDF Reference section 5.7.1)
+ int font_weight, // [IN] original font weight. 0 for not specified
+ int CharsetCP, // [IN] code page for charset (see Win32 GetACP())
+ FX_BOOL bVertical,
+ CPDF_SubstFont* pSubstFont // [OUT] Subst font data
+ );
+
+ FT_Face m_SysFace;
+};
+
+CFontMapper* g_pFontMapper = NULL;
+#endif // #if _FX_OS_ == _FX_LINUX_EMBEDDED_
+
+DLLEXPORT void STDCALL FPDF_InitLibrary(FX_LPVOID hInstance)
+{
+#ifdef API5
+ CPDF_ModuleMgr::Create();
+ g_pModuleMgr = CPDF_ModuleMgr::Get();
+ #if _FX_OS_ == _FX_WIN32_MOBILE_ || _FX_OS_ == _FX_LINUX_EMBEDDED_
+ g_pModuleMgr->InitEmbedded();
+ #ifdef _GB1_CMAPS_
+ g_pModuleMgr->LoadEmbeddedGB1CMaps();
+ #endif
+ #ifdef _GB1_CMAPS_4_
+ g_pModuleMgr->LoadEmbeddedGB1CMaps_4();
+ #endif
+ #ifdef _CNS1_CMAPS_
+ g_pModuleMgr->LoadEmbeddedCNS1CMaps();
+ #endif
+ #ifdef _JAPAN1_CMAPS_
+ g_pModuleMgr->LoadEmbeddedJapan1CMaps();
+ #endif
+ #ifdef _JAPAN1_CMAPS_6_
+ g_pModuleMgr->LoadEmbeddedJapan1CMaps_6();
+ #endif
+ #ifdef _KOREA1_CMAPS_
+ g_pModuleMgr->LoadEmbeddedKorea1CMaps();
+ #endif
+ #ifdef _JPX_DECODER_
+ g_pModuleMgr->InitJpxModule();
+ g_pModuleMgr->InitJbig2Module();
+ // g_pModuleMgr->InitIccModule();
+ #endif
+ #else
+ g_pModuleMgr->InitDesktop();
+ #endif
+#else
+#ifdef _FXSDK_OPENSOURCE_
+ g_pFoxitMgr = FXMEM_CreateMemoryMgr(1024 * 1024 * 32, TRUE);
+#endif
+ g_pCodecModule = CCodec_ModuleMgr::Create();
+
+ CFX_GEModule::Create();
+ CFX_GEModule::Get()->SetCodecModule(g_pCodecModule);
+
+ CPDF_ModuleMgr::Create();
+ CPDF_ModuleMgr::Get()->SetCodecModule(g_pCodecModule);
+ CPDF_ModuleMgr::Get()->InitPageModule();
+ CPDF_ModuleMgr::Get()->InitRenderModule();
+#ifdef FOXIT_CHROME_BUILD
+ CPDF_ModuleMgr * pModuleMgr = CPDF_ModuleMgr::Get();
+ if ( pModuleMgr )
+ {
+ pModuleMgr->LoadEmbeddedGB1CMaps();
+ pModuleMgr->LoadEmbeddedJapan1CMaps();
+ pModuleMgr->LoadEmbeddedCNS1CMaps();
+ pModuleMgr->LoadEmbeddedKorea1CMaps();
+ }
+#endif
+#endif
+
+#ifdef _WIN32
+ // Get module path
+ TCHAR app_path[MAX_PATH];
+ ::GetModuleFileName((HINSTANCE)hInstance, app_path, MAX_PATH);
+ size_t len = _tcslen(app_path);
+ for (size_t i = len; i >= 0; i --)
+ if (app_path[i] == '\\') {
+ app_path[i] = 0;
+ break;
+ }
+
+#ifdef _UNICODE
+ #ifndef _FXSDK_OPENSOURCE_
+ CPDF_ModuleMgr::Get()->SetModulePath(NULL, CFX_ByteString::FromUnicode(app_path));
+ #endif
+#else
+#ifndef _FXSDK_OPENSOURCE_
+ CPDF_ModuleMgr::Get()->SetModulePath(NULL, app_path);
+#endif
+#endif
+#endif
+}
+
+
+DLLEXPORT void STDCALL FPDF_DestroyLibrary()
+{
+
+#if _FX_OS_ == _FX_LINUX_EMBEDDED_
+ if (g_pFontMapper) delete g_pFontMapper;
+#endif
+#ifdef API5
+ g_pModuleMgr->Destroy();
+#else
+ CPDF_ModuleMgr::Destroy();
+ CFX_GEModule::Destroy();
+ g_pCodecModule->Destroy();
+#endif
+#ifndef _FXSDK_OPENSOURCE_
+ FXMEM_CollectAll(FXMEM_GetDefaultMgr());
+#else
+ FXMEM_DestroyFoxitMgr(g_pFoxitMgr);
+#endif
+}
+
+#ifndef _WIN32
+int g_LastError;
+void SetLastError(int err)
+{
+ g_LastError = err;
+}
+
+int GetLastError()
+{
+ return g_LastError;
+}
+#endif
+
+void ProcessParseError(FX_DWORD err_code)
+{
+ // Translate FPDFAPI error code to FPDFVIEW error code
+ switch (err_code) {
+ case PDFPARSE_ERROR_FILE:
+ err_code = FPDF_ERR_FILE;
+ break;
+ case PDFPARSE_ERROR_FORMAT:
+ err_code = FPDF_ERR_FORMAT;
+ break;
+ case PDFPARSE_ERROR_PASSWORD:
+ err_code = FPDF_ERR_PASSWORD;
+ break;
+ case PDFPARSE_ERROR_HANDLER:
+ err_code = FPDF_ERR_SECURITY;
+ break;
+ }
+ SetLastError(err_code);
+}
+
+DLLEXPORT void STDCALL FPDF_SetSandBoxPolicy(FPDF_DWORD policy, FPDF_BOOL enable)
+{
+ return FSDK_SetSandBoxPolicy(policy, enable);
+}
+
+DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadDocument(FPDF_STRING file_path, FPDF_BYTESTRING password)
+{
+ CPDF_Parser* pParser = FX_NEW CPDF_Parser;
+ pParser->SetPassword(password);
+ try {
+ FX_DWORD err_code = pParser->StartParse((FX_LPCSTR)file_path);
+ if (err_code) {
+ delete pParser;
+ ProcessParseError(err_code);
+ return NULL;
+ }
+ }
+ catch (...) {
+ delete pParser;
+ SetLastError(FPDF_ERR_UNKNOWN);
+ return NULL;
+ }
+ return pParser->GetDocument();
+}
+
+extern void CheckUnSupportError(CPDF_Document * pDoc, FX_DWORD err_code);
+
+class CMemFile: public IFX_FileRead, public CFX_Object
+{
+public:
+ CMemFile(FX_BYTE* pBuf, FX_FILESIZE size):m_pBuf(pBuf),m_size(size) {}
+
+ virtual void Release() {delete this;}
+ virtual FX_FILESIZE GetSize() {return m_size;}
+ virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size)
+ {
+ if(offset+size > (FX_DWORD)m_size) return FALSE;
+ FXSYS_memcpy(buffer, m_pBuf+offset, size);
+ return TRUE;
+ }
+private:
+ FX_BYTE* m_pBuf;
+ FX_FILESIZE m_size;
+};
+DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadMemDocument(const void* data_buf, int size, FPDF_BYTESTRING password)
+{
+ CPDF_Parser* pParser = FX_NEW CPDF_Parser;
+ pParser->SetPassword(password);
+ try {
+ CMemFile* pMemFile = FX_NEW CMemFile((FX_BYTE*)data_buf, size);
+ FX_DWORD err_code = pParser->StartParse(pMemFile);
+ if (err_code) {
+ delete pParser;
+ ProcessParseError(err_code);
+ return NULL;
+ }
+ CPDF_Document * pDoc = NULL;
+ pDoc = pParser?pParser->GetDocument():NULL;
+ CheckUnSupportError(pDoc, err_code);
+ }
+ catch (...) {
+ delete pParser;
+ SetLastError(FPDF_ERR_UNKNOWN);
+ return NULL;
+ }
+ return pParser->GetDocument();
+}
+
+DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadCustomDocument(FPDF_FILEACCESS* pFileAccess, FPDF_BYTESTRING password)
+{
+ CPDF_Parser* pParser = FX_NEW CPDF_Parser;
+ pParser->SetPassword(password);
+ CPDF_CustomAccess* pFile = FX_NEW CPDF_CustomAccess(pFileAccess);
+ try {
+ FX_DWORD err_code = pParser->StartParse(pFile);
+ if (err_code) {
+ delete pParser;
+ ProcessParseError(err_code);
+ return NULL;
+ }
+ CPDF_Document * pDoc = NULL;
+ pDoc = pParser?pParser->GetDocument():NULL;
+ CheckUnSupportError(pDoc, err_code);
+ }
+ catch (...) {
+ delete pParser;
+ SetLastError(FPDF_ERR_UNKNOWN);
+ return NULL;
+ }
+ return pParser->GetDocument();
+}
+
+DLLEXPORT FPDF_BOOL STDCALL FPDF_GetFileVersion(FPDF_DOCUMENT doc, int* fileVersion)
+{
+ if(!doc||!fileVersion) return FALSE;
+ *fileVersion = 0;
+ CPDF_Document* pDoc = (CPDF_Document*)doc;
+ CPDF_Parser* pParser = (CPDF_Parser*)pDoc->GetParser();
+ if(!pParser)
+ return FALSE;
+ *fileVersion = pParser->GetFileVersion();
+ return TRUE;
+}
+
+// jabdelmalek: changed return type from FX_DWORD to build on Linux (and match header).
+DLLEXPORT unsigned long STDCALL FPDF_GetDocPermissions(FPDF_DOCUMENT document)
+{
+ if (document == NULL) return 0;
+ CPDF_Document*pDoc = (CPDF_Document*)document;
+ CPDF_Parser* pParser = (CPDF_Parser*)pDoc->GetParser();
+ CPDF_Dictionary* pDict = pParser->GetEncryptDict();
+ if (pDict == NULL) return (FX_DWORD)-1;
+
+ return pDict->GetInteger("P");
+}
+
+DLLEXPORT int STDCALL FPDF_GetPageCount(FPDF_DOCUMENT document)
+{
+ if (document == NULL) return 0;
+ return ((CPDF_Document*)document)->GetPageCount();
+}
+
+DLLEXPORT FPDF_PAGE STDCALL FPDF_LoadPage(FPDF_DOCUMENT document, int page_index)
+{
+ if (document == NULL) return NULL;
+ if (page_index < 0 || page_index >= FPDF_GetPageCount(document)) return NULL;
+// CPDF_Parser* pParser = (CPDF_Parser*)document;
+ CPDF_Document* pDoc = (CPDF_Document*)document;
+ if (pDoc == NULL) return NULL;
+ CPDF_Dictionary* pDict = pDoc->GetPage(page_index);
+ if (pDict == NULL) return NULL;
+ CPDF_Page* pPage = FX_NEW CPDF_Page;
+ pPage->Load(pDoc, pDict);
+ try {
+ pPage->ParseContent();
+ }
+ catch (...) {
+ delete pPage;
+ return NULL;
+ }
+
+// CheckUnSupportError(pDoc, 0);
+
+ return pPage;
+}
+
+DLLEXPORT double STDCALL FPDF_GetPageWidth(FPDF_PAGE page)
+{
+ if (!page)
+ return 0.0;
+ return ((CPDF_Page*)page)->GetPageWidth();
+}
+
+DLLEXPORT double STDCALL FPDF_GetPageHeight(FPDF_PAGE page)
+{
+ if (!page) return 0.0;
+ return ((CPDF_Page*)page)->GetPageHeight();
+}
+
+void DropContext(void* data)
+{
+ delete (CRenderContext*)data;
+}
+
+void FPDF_RenderPage_Retail(CRenderContext* pContext, FPDF_PAGE page, int start_x, int start_y, int size_x, int size_y,
+ int rotate, int flags,FX_BOOL bNeedToRestore, IFSDK_PAUSE_Adapter * pause );
+void (*Func_RenderPage)(CRenderContext*, FPDF_PAGE page, int start_x, int start_y, int size_x, int size_y,
+ int rotate, int flags,FX_BOOL bNeedToRestore, IFSDK_PAUSE_Adapter * pause ) = FPDF_RenderPage_Retail;
+
+#if defined(_DEBUG) || defined(DEBUG)
+#define DEBUG_TRACE
+#endif
+
+#if defined(_WIN32)
+DLLEXPORT void STDCALL FPDF_RenderPage(HDC dc, FPDF_PAGE page, int start_x, int start_y, int size_x, int size_y,
+ int rotate, int flags)
+{
+ if (page==NULL) return;
+ CPDF_Page* pPage = (CPDF_Page*)page;
+
+ CRenderContext* pContext = FX_NEW CRenderContext;
+ pPage->SetPrivateData((void*)1, pContext, DropContext);
+
+#ifndef _WIN32_WCE
+ CFX_DIBitmap* pBitmap = NULL;
+ FX_BOOL bBackgroundAlphaNeeded=FALSE;
+ bBackgroundAlphaNeeded = pPage->BackgroundAlphaNeeded();
+ if (bBackgroundAlphaNeeded)
+ {
+
+ pBitmap = FX_NEW CFX_DIBitmap;
+ pBitmap->Create(size_x, size_y, FXDIB_Argb);
+ pBitmap->Clear(0x00ffffff);
+#ifdef _SKIA_SUPPORT_
+ pContext->m_pDevice = FX_NEW CFX_SkiaDevice;
+ ((CFX_SkiaDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)pBitmap);
+#else
+ pContext->m_pDevice = FX_NEW CFX_FxgeDevice;
+ ((CFX_FxgeDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)pBitmap);
+#endif
+ }
+ else
+ pContext->m_pDevice = FX_NEW CFX_WindowsDevice(dc);
+ if (flags & FPDF_NO_CATCH)
+ Func_RenderPage(pContext, page, start_x, start_y, size_x, size_y, rotate, flags,TRUE,NULL);
+ else {
+ try {
+ Func_RenderPage(pContext, page, start_x, start_y, size_x, size_y, rotate, flags,TRUE,NULL);
+ } catch (...) {
+ }
+ }
+ if (bBackgroundAlphaNeeded)
+ {
+ if (pBitmap)
+ {
+ CFX_WindowsDevice WinDC(dc);
+
+ if (WinDC.GetDeviceCaps(FXDC_DEVICE_CLASS) == FXDC_PRINTER)
+ {
+ CFX_DIBitmap* pDst = FX_NEW CFX_DIBitmap;
+ pDst->Create(pBitmap->GetWidth(), pBitmap->GetHeight(),FXDIB_Rgb32);
+ FXSYS_memcpy(pDst->GetBuffer(), pBitmap->GetBuffer(), pBitmap->GetPitch()*pBitmap->GetHeight());
+// WinDC.SetDIBits(pDst,0,0);
+ WinDC.StretchDIBits(pDst,0,0,size_x*2,size_y*2);
+ delete pDst;
+ }
+ else
+ WinDC.SetDIBits(pBitmap,0,0);
+
+ }
+ }
+#else
+ // get clip region
+ RECT rect, cliprect;
+ rect.left = start_x;
+ rect.top = start_y;
+ rect.right = start_x + size_x;
+ rect.bottom = start_y + size_y;
+ GetClipBox(dc, &cliprect);
+ IntersectRect(&rect, &rect, &cliprect);
+ int width = rect.right - rect.left;
+ int height = rect.bottom - rect.top;
+
+#ifdef DEBUG_TRACE
+ {
+ char str[128];
+ sprintf(str, "Rendering DIB %d x %d", width, height);
+ CPDF_ModuleMgr::Get()->ReportError(999, str);
+ }
+#endif
+
+ // Create a DIB section
+ LPVOID pBuffer;
+ BITMAPINFOHEADER bmih;
+ FXSYS_memset(&bmih, 0, sizeof bmih);
+ bmih.biSize = sizeof bmih;
+ bmih.biBitCount = 24;
+ bmih.biHeight = -height;
+ bmih.biPlanes = 1;
+ bmih.biWidth = width;
+ pContext->m_hBitmap = CreateDIBSection(dc, (BITMAPINFO*)&bmih, DIB_RGB_COLORS, &pBuffer, NULL, 0);
+ if (pContext->m_hBitmap == NULL) {
+#if defined(DEBUG) || defined(_DEBUG)
+ char str[128];
+ sprintf(str, "Error CreateDIBSection: %d x %d, error code = %d", width, height, GetLastError());
+ CPDF_ModuleMgr::Get()->ReportError(FPDFERR_OUT_OF_MEMORY, str);
+#else
+ CPDF_ModuleMgr::Get()->ReportError(FPDFERR_OUT_OF_MEMORY, NULL);
+#endif
+ }
+ FXSYS_memset(pBuffer, 0xff, height*((width*3+3)/4*4));
+
+#ifdef DEBUG_TRACE
+ {
+ CPDF_ModuleMgr::Get()->ReportError(999, "DIBSection created");
+ }
+#endif
+
+ // Create a device with this external buffer
+ pContext->m_pBitmap = FX_NEW CFX_DIBitmap;
+ pContext->m_pBitmap->Create(width, height, FXDIB_Rgb, (FX_LPBYTE)pBuffer);
+ pContext->m_pDevice = FX_NEW CPDF_FxgeDevice;
+ ((CPDF_FxgeDevice*)pContext->m_pDevice)->Attach(pContext->m_pBitmap);
+
+#ifdef DEBUG_TRACE
+ CPDF_ModuleMgr::Get()->ReportError(999, "Ready for PDF rendering");
+#endif
+
+ // output to bitmap device
+ if (flags & FPDF_NO_CATCH)
+ Func_RenderPage(pContext, page, start_x - rect.left, start_y - rect.top, size_x, size_y, rotate, flags);
+ else {
+ try {
+ Func_RenderPage(pContext, page, start_x - rect.left, start_y - rect.top, size_x, size_y, rotate, flags);
+ } catch (...) {
+ }
+ }
+
+#ifdef DEBUG_TRACE
+ CPDF_ModuleMgr::Get()->ReportError(999, "Finished PDF rendering");
+#endif
+
+ // Now output to real device
+ HDC hMemDC = CreateCompatibleDC(dc);
+ if (hMemDC == NULL) {
+#if defined(DEBUG) || defined(_DEBUG)
+ char str[128];
+ sprintf(str, "Error CreateCompatibleDC. Error code = %d", GetLastError());
+ CPDF_ModuleMgr::Get()->ReportError(FPDFERR_OUT_OF_MEMORY, str);
+#else
+ CPDF_ModuleMgr::Get()->ReportError(FPDFERR_OUT_OF_MEMORY, NULL);
+#endif
+ }
+
+ HGDIOBJ hOldBitmap = SelectObject(hMemDC, pContext->m_hBitmap);
+
+#ifdef DEBUG_TRACE
+ CPDF_ModuleMgr::Get()->ReportError(999, "Ready for screen rendering");
+#endif
+
+ BitBlt(dc, rect.left, rect.top, width, height, hMemDC, 0, 0, SRCCOPY);
+ SelectObject(hMemDC, hOldBitmap);
+ DeleteDC(hMemDC);
+
+#ifdef DEBUG_TRACE
+ CPDF_ModuleMgr::Get()->ReportError(999, "Finished screen rendering");
+#endif
+
+#endif
+ if (bBackgroundAlphaNeeded)
+ {
+ if (pBitmap)
+ delete pBitmap;
+ pBitmap = NULL;
+ }
+ delete pContext;
+ pPage->RemovePrivateData((void*)1);
+}
+#endif
+
+DLLEXPORT void STDCALL FPDF_RenderPageBitmap(FPDF_BITMAP bitmap, FPDF_PAGE page, int start_x, int start_y,
+ int size_x, int size_y, int rotate, int flags)
+{
+ if (bitmap == NULL || page == NULL) return;
+ CPDF_Page* pPage = (CPDF_Page*)page;
+
+
+ CRenderContext* pContext = FX_NEW CRenderContext;
+ pPage->SetPrivateData((void*)1, pContext, DropContext);
+#ifdef _SKIA_SUPPORT_
+ pContext->m_pDevice = FX_NEW CFX_SkiaDevice;
+
+ if (flags & FPDF_REVERSE_BYTE_ORDER)
+ ((CFX_SkiaDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bitmap,0,TRUE);
+ else
+ ((CFX_SkiaDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bitmap);
+#else
+ pContext->m_pDevice = FX_NEW CFX_FxgeDevice;
+
+ if (flags & FPDF_REVERSE_BYTE_ORDER)
+ ((CFX_FxgeDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bitmap,0,TRUE);
+ else
+ ((CFX_FxgeDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bitmap);
+#endif
+ if (flags & FPDF_NO_CATCH)
+ Func_RenderPage(pContext, page, start_x, start_y, size_x, size_y, rotate, flags,TRUE,NULL);
+ else {
+ try {
+ Func_RenderPage(pContext, page, start_x, start_y, size_x, size_y, rotate, flags,TRUE,NULL);
+ } catch (...) {
+ }
+ }
+
+ delete pContext;
+ pPage->RemovePrivateData((void*)1);
+}
+
+DLLEXPORT void STDCALL FPDF_ClosePage(FPDF_PAGE page)
+{
+ if (!page) return;
+ delete (CPDF_Page*)page;
+
+}
+
+DLLEXPORT void STDCALL FPDF_CloseDocument(FPDF_DOCUMENT document)
+{
+ if (!document)
+ return;
+ CPDF_Document* pDoc = (CPDF_Document*)document;
+ CPDF_Parser* pParser = (CPDF_Parser*)pDoc->GetParser();
+ if (pParser == NULL)
+ {
+ delete pDoc;
+ return;
+ }
+ delete pParser;
+// delete pDoc;
+}
+
+DLLEXPORT unsigned long STDCALL FPDF_GetLastError()
+{
+ return GetLastError();
+}
+
+DLLEXPORT void STDCALL FPDF_DeviceToPage(FPDF_PAGE page, int start_x, int start_y, int size_x, int size_y,
+ int rotate, int device_x, int device_y, double* page_x, double* page_y)
+{
+ if (page == NULL || page_x == NULL || page_y == NULL) return;
+ CPDF_Page* pPage = (CPDF_Page*)page;
+
+ CPDF_Matrix page2device;
+ pPage->GetDisplayMatrix(page2device, start_x, start_y, size_x, size_y, rotate);
+ CPDF_Matrix device2page;
+ device2page.SetReverse(page2device);
+
+ FX_FLOAT page_x_f, page_y_f;
+ device2page.Transform((FX_FLOAT)(device_x), (FX_FLOAT)(device_y), page_x_f, page_y_f);
+
+ *page_x = (page_x_f);
+ *page_y = (page_y_f);
+}
+
+DLLEXPORT void STDCALL FPDF_PageToDevice(FPDF_PAGE page, int start_x, int start_y, int size_x, int size_y,
+ int rotate, double page_x, double page_y, int* device_x, int* device_y)
+{
+ if (page == NULL || device_x == NULL || device_y == NULL) return;
+ CPDF_Page* pPage = (CPDF_Page*)page;
+
+ CPDF_Matrix page2device;
+ pPage->GetDisplayMatrix(page2device, start_x, start_y, size_x, size_y, rotate);
+
+ FX_FLOAT device_x_f, device_y_f;
+ page2device.Transform(((FX_FLOAT)page_x), ((FX_FLOAT)page_y), device_x_f, device_y_f);
+
+ *device_x = FXSYS_round(device_x_f);
+ *device_y = FXSYS_round(device_y_f);
+}
+
+DLLEXPORT FPDF_BITMAP STDCALL FPDFBitmap_Create(int width, int height, int alpha)
+{
+ CFX_DIBitmap* pBitmap = FX_NEW CFX_DIBitmap;
+ pBitmap->Create(width, height, alpha ? FXDIB_Argb : FXDIB_Rgb32);
+ return pBitmap;
+}
+
+DLLEXPORT FPDF_BITMAP STDCALL FPDFBitmap_CreateEx(int width, int height, int format, void* first_scan, int stride)
+{
+ FXDIB_Format fx_format;
+ switch (format) {
+ case FPDFBitmap_Gray:
+ fx_format = FXDIB_8bppRgb;
+ break;
+ case FPDFBitmap_BGR:
+ fx_format = FXDIB_Rgb;
+ break;
+ case FPDFBitmap_BGRx:
+ fx_format = FXDIB_Rgb32;
+ break;
+ case FPDFBitmap_BGRA:
+ fx_format = FXDIB_Argb;
+ break;
+ default:
+ return NULL;
+ }
+ CFX_DIBitmap* pBitmap = FX_NEW CFX_DIBitmap;
+ pBitmap->Create(width, height, fx_format, (FX_LPBYTE)first_scan, stride);
+ return pBitmap;
+}
+
+DLLEXPORT void STDCALL FPDFBitmap_FillRect(FPDF_BITMAP bitmap, int left, int top, int width, int height,
+ int red, int green, int blue, int alpha)
+{
+ if (bitmap == NULL) return;
+#ifdef _SKIA_SUPPORT_
+ CFX_SkiaDevice device;
+#else
+ CFX_FxgeDevice device;
+#endif
+ device.Attach((CFX_DIBitmap*)bitmap);
+ if (!((CFX_DIBitmap*)bitmap)->HasAlpha()) alpha = 255;
+ FX_RECT rect(left, top, left+width, top+height);
+ device.FillRect(&rect, FXARGB_MAKE(alpha, red, green, blue));
+}
+
+DLLEXPORT void* STDCALL FPDFBitmap_GetBuffer(FPDF_BITMAP bitmap)
+{
+ if (bitmap == NULL) return NULL;
+ return ((CFX_DIBitmap*)bitmap)->GetBuffer();
+}
+
+DLLEXPORT int STDCALL FPDFBitmap_GetWidth(FPDF_BITMAP bitmap)
+{
+ if (bitmap == NULL) return 0;
+ return ((CFX_DIBitmap*)bitmap)->GetWidth();
+}
+
+DLLEXPORT int STDCALL FPDFBitmap_GetHeight(FPDF_BITMAP bitmap)
+{
+ if (bitmap == NULL) return 0;
+ return ((CFX_DIBitmap*)bitmap)->GetHeight();
+}
+
+DLLEXPORT int STDCALL FPDFBitmap_GetStride(FPDF_BITMAP bitmap)
+{
+ if (bitmap == NULL) return 0;
+ return ((CFX_DIBitmap*)bitmap)->GetPitch();
+}
+
+DLLEXPORT void STDCALL FPDFBitmap_Destroy(FPDF_BITMAP bitmap)
+{
+ if (bitmap == NULL) return;
+ delete (CFX_DIBitmap*)bitmap;
+}
+
+void FPDF_RenderPage_Retail(CRenderContext* pContext, FPDF_PAGE page, int start_x, int start_y, int size_x, int size_y,
+ int rotate, int flags,FX_BOOL bNeedToRestore, IFSDK_PAUSE_Adapter * pause )
+{
+//#ifdef _LICENSED_BUILD_
+ CPDF_Page* pPage = (CPDF_Page*)page;
+ if (pPage == NULL) return;
+
+ if (!pContext->m_pOptions)
+ pContext->m_pOptions = new CPDF_RenderOptions;
+// CPDF_RenderOptions options;
+ if (flags & FPDF_LCD_TEXT)
+ pContext->m_pOptions->m_Flags |= RENDER_CLEARTYPE;
+ else
+ pContext->m_pOptions->m_Flags &= ~RENDER_CLEARTYPE;
+ if (flags & FPDF_NO_NATIVETEXT)
+ pContext->m_pOptions->m_Flags |= RENDER_NO_NATIVETEXT;
+ if (flags & FPDF_RENDER_LIMITEDIMAGECACHE)
+ pContext->m_pOptions->m_Flags |= RENDER_LIMITEDIMAGECACHE;
+ if (flags & FPDF_RENDER_FORCEHALFTONE)
+ pContext->m_pOptions->m_Flags |= RENDER_FORCE_HALFTONE;
+ //Grayscale output
+ if (flags & FPDF_GRAYSCALE)
+ {
+ pContext->m_pOptions->m_ColorMode = RENDER_COLOR_GRAY;
+ pContext->m_pOptions->m_ForeColor = 0;
+ pContext->m_pOptions->m_BackColor = 0xffffff;
+ }
+ const CPDF_OCContext::UsageType usage = (flags & FPDF_PRINTING) ? CPDF_OCContext::Print : CPDF_OCContext::View;
+
+ pContext->m_pOptions->m_AddFlags = flags >> 8;
+
+ pContext->m_pOptions->m_pOCContext = new CPDF_OCContext(pPage->m_pDocument, usage);
+
+
+ CFX_AffineMatrix matrix;
+ pPage->GetDisplayMatrix(matrix, start_x, start_y, size_x, size_y, rotate);
+
+ FX_RECT clip;
+ clip.left = start_x;
+ clip.right = start_x + size_x;
+ clip.top = start_y;
+ clip.bottom = start_y + size_y;
+ pContext->m_pDevice->SaveState();
+ pContext->m_pDevice->SetClip_Rect(&clip);
+
+ pContext->m_pContext = FX_NEW CPDF_RenderContext;
+ pContext->m_pContext->Create(pPage);
+ pContext->m_pContext->AppendObjectList(pPage, &matrix);
+
+ if (flags & FPDF_ANNOT) {
+ pContext->m_pAnnots = FX_NEW CPDF_AnnotList(pPage);
+ FX_BOOL bPrinting = pContext->m_pDevice->GetDeviceClass() != FXDC_DISPLAY;
+ pContext->m_pAnnots->DisplayAnnots(pPage, pContext->m_pContext, bPrinting, &matrix, TRUE, NULL);
+ }
+
+ pContext->m_pRenderer = FX_NEW CPDF_ProgressiveRenderer;
+ pContext->m_pRenderer->Start(pContext->m_pContext, pContext->m_pDevice, pContext->m_pOptions, pause);
+ if (bNeedToRestore)
+ {
+ pContext->m_pDevice->RestoreState();
+ }
+
+//#endif
+}
+
+DLLEXPORT int STDCALL FPDF_GetPageSizeByIndex(FPDF_DOCUMENT document, int page_index, double* width, double* height)
+{
+ CPDF_Document* pDoc = (CPDF_Document*)document;
+ if(pDoc == NULL)
+ return FALSE;
+
+ CPDF_Dictionary* pDict = pDoc->GetPage(page_index);
+ if (pDict == NULL) return FALSE;
+
+ CPDF_Page page;
+ page.Load(pDoc, pDict);
+ *width = page.GetPageWidth();
+ *height = page.GetPageHeight();
+
+ return TRUE;
+}
+
+DLLEXPORT FPDF_BOOL STDCALL FPDF_VIEWERREF_GetPrintScaling(FPDF_DOCUMENT document)
+{
+ CPDF_Document* pDoc = (CPDF_Document*)document;
+ if (!pDoc) return TRUE;
+ CPDF_ViewerPreferences viewRef(pDoc);
+ return viewRef.PrintScaling();
+}
+
+DLLEXPORT FPDF_DEST STDCALL FPDF_GetNamedDestByName(FPDF_DOCUMENT document,FPDF_BYTESTRING name)
+{
+ if (document == NULL)
+ return NULL;
+ if (name == NULL || name[0] == 0)
+ return NULL;
+
+ CPDF_Document* pDoc = (CPDF_Document*)document;
+ CPDF_NameTree name_tree(pDoc, FX_BSTRC("Dests"));
+ return name_tree.LookupNamedDest(pDoc, name);
+}
diff --git a/fpdfsdk/src/fsdk_actionhandler.cpp b/fpdfsdk/src/fsdk_actionhandler.cpp
index 2a3898cd9b..5ded984c63 100644
--- a/fpdfsdk/src/fsdk_actionhandler.cpp
+++ b/fpdfsdk/src/fsdk_actionhandler.cpp
@@ -1,850 +1,850 @@
-// 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
-
-#include "../include/fsdk_define.h"
-#include "../include/fsdk_mgr.h"
-#include "../include/fsdk_actionhandler.h"
-#include "../include/javascript/IJavaScript.h"
-
-/* -------------------------- CBA_ActionHandler -------------------------- */
-
-CPDFSDK_ActionHandler::CPDFSDK_ActionHandler(CPDFDoc_Environment* pEvi) :
- m_pEvi(pEvi),
- m_pFormActionHandler(NULL),
- m_pMediaActionHandler(NULL)
-{
- m_pFormActionHandler = new CPDFSDK_FormActionHandler;
-}
-
-CPDFSDK_ActionHandler::~CPDFSDK_ActionHandler()
-{
- if(m_pFormActionHandler)
- {
- delete m_pFormActionHandler;
- m_pFormActionHandler = NULL;
- }
-}
-
-void CPDFSDK_ActionHandler::SetFormActionHandler(CPDFSDK_FormActionHandler* pHandler)
-{
- ASSERT(pHandler != NULL);
- ASSERT(m_pFormActionHandler == NULL);
- m_pFormActionHandler = pHandler;
-}
-
-void CPDFSDK_ActionHandler::SetMediaActionHandler(CPDFSDK_MediaActionHandler* pHandler)
-{
- ASSERT(pHandler != NULL);
- ASSERT(m_pMediaActionHandler == NULL);
- m_pMediaActionHandler = pHandler;
-}
-
-void CPDFSDK_ActionHandler::Destroy()
-{
- delete this;
-}
-
-//document open
-FX_BOOL CPDFSDK_ActionHandler::DoAction_DocOpen(const CPDF_Action& action, CPDFSDK_Document* pDocument
- /*CReader_Document* pDocument, CReader_DocView *pDocView*/)
-{
- CFX_PtrList list;
- return ExecuteDocumentOpenAction(action, pDocument, /*pDocView, */list);
-}
-
-//document open
-FX_BOOL CPDFSDK_ActionHandler::DoAction_JavaScript(const CPDF_Action& JsAction,CFX_WideString csJSName,
- CPDFSDK_Document* pDocument/*, CReader_DocView *pDocView*/)
-{
- if (JsAction.GetType() == CPDF_Action::JavaScript)
- {
- CFX_WideString swJS = JsAction.GetJavaScript();
- if (!swJS.IsEmpty())
- {
- RunDocumentOpenJavaScript(pDocument, csJSName, swJS);
- return TRUE;
- }
- }
-
- return FALSE;
-}
-
-FX_BOOL CPDFSDK_ActionHandler::DoAction_FieldJavaScript(const CPDF_Action& JsAction, CPDF_AAction::AActionType type,
- CPDFSDK_Document* pDocument, CPDF_FormField* pFormField,
- PDFSDK_FieldAction& data)
-{
- CPDFDoc_Environment* pEnv = pDocument->GetEnv();
- ASSERT(pEnv);
- if (pEnv->IsJSInitiated() && JsAction.GetType() == CPDF_Action::JavaScript)
- {
- CFX_WideString swJS = JsAction.GetJavaScript();
- if (!swJS.IsEmpty())
- {
- RunFieldJavaScript(pDocument, pFormField, type, data, swJS);
- return TRUE;
- }
- }
- return FALSE;
-}
-
-FX_BOOL CPDFSDK_ActionHandler::DoAction_Page(const CPDF_Action& action, enum CPDF_AAction::AActionType eType,
- CPDFSDK_Document* pDocument/*, CReader_DocView *pDocView*/)
-{
- CFX_PtrList list;
- return ExecuteDocumentPageAction(action, eType, pDocument,/* pDocView,*/ list);
-}
-
-FX_BOOL CPDFSDK_ActionHandler::DoAction_Document(const CPDF_Action& action, enum CPDF_AAction::AActionType eType,
- CPDFSDK_Document* pDocument/*, CReader_DocView *pDocView*/)
-{
- CFX_PtrList list;
- return ExecuteDocumentPageAction(action, eType, pDocument,/* pDocView,*/ list);
-}
-
-FX_BOOL CPDFSDK_ActionHandler::DoAction_BookMark(CPDF_Bookmark *pBookMark, const CPDF_Action& action, CPDF_AAction::AActionType type,
- CPDFSDK_Document* pDocument/*, CReader_DocView *pDocView*/)
-{
- CFX_PtrList list;
- return this->ExecuteBookMark(action, pDocument,/* pDocView,*/ pBookMark, list);
-}
-
-FX_BOOL CPDFSDK_ActionHandler::DoAction_Screen(const CPDF_Action& action, CPDF_AAction::AActionType type,
- CPDFSDK_Document* pDocument,/* CReader_DocView *pDocView,*/ CPDFSDK_Annot* pScreen)
-{
- CFX_PtrList list;
- return this->ExecuteScreenAction(action, type, pDocument,/* pDocView,*/ pScreen, list);
-}
-
-FX_BOOL CPDFSDK_ActionHandler::DoAction_Link(const CPDF_Action& action,
- CPDFSDK_Document* pDocument/*, CReader_DocView *pDocView*/)
-{
- CFX_PtrList list;
- return ExecuteLinkAction(action, pDocument,/* pDocView,*/ list);
-}
-
-FX_BOOL CPDFSDK_ActionHandler::DoAction_Field(const CPDF_Action& action, CPDF_AAction::AActionType type,
- CPDFSDK_Document* pDocument,/* CReader_DocView *pDocView,*/
- CPDF_FormField* pFormField, PDFSDK_FieldAction& data)
-{
- CFX_PtrList list;
- return ExecuteFieldAction(action, type, pDocument,/* pDocView,*/ pFormField, data, list);
-}
-
-FX_BOOL CPDFSDK_ActionHandler::ExecuteDocumentOpenAction(const CPDF_Action& action, CPDFSDK_Document* pDocument,
- /*CReader_DocView *pDocView,*/ CFX_PtrList& list)
-{
- ASSERT(pDocument != NULL);
-
- if (list.Find((CPDF_Dictionary*)action))
- return FALSE;
- list.AddTail((CPDF_Dictionary*)action);
-
- CPDFDoc_Environment* pEnv = pDocument->GetEnv();
- ASSERT(pEnv);
- if (action.GetType() == CPDF_Action::JavaScript)
- {
- if(pEnv->IsJSInitiated())
- {
- CFX_WideString swJS = action.GetJavaScript();
- if (!swJS.IsEmpty())
- {
- RunDocumentOpenJavaScript(pDocument, L"", swJS);
- }
- }
- }
- else
- {
- DoAction_NoJs(action, pDocument/*, pDocView*/);
- }
-
-// if (!IsValidDocView(pDocument, pDocView))
-// return FALSE;
-
- for (FX_INT32 i=0,sz=action.GetSubActionsCount(); i<sz; i++)
- {
- CPDF_Action subaction = action.GetSubAction(i);
- if (!ExecuteDocumentOpenAction(subaction, pDocument,/* pDocView,*/ list)) return FALSE;
- }
-
- return TRUE;
-}
-
-FX_BOOL CPDFSDK_ActionHandler::ExecuteLinkAction(const CPDF_Action& action, CPDFSDK_Document* pDocument,
- /*CReader_DocView* pDocView,*/ CFX_PtrList& list)
-{
- ASSERT(pDocument != NULL);
-
- if (list.Find((CPDF_Dictionary*)action))
- return FALSE;
- list.AddTail((CPDF_Dictionary*)action);
-
- CPDFDoc_Environment* pEnv = pDocument->GetEnv();
- ASSERT(pEnv);
- if (action.GetType() == CPDF_Action::JavaScript)
- {
- if(pEnv->IsJSInitiated())
- {
- CFX_WideString swJS = action.GetJavaScript();
- if (!swJS.IsEmpty())
- {
- IFXJS_Runtime* pRuntime = pDocument->GetJsRuntime(); //????
- ASSERT(pRuntime != NULL);
-
- pRuntime->SetReaderDocument(pDocument);
-
- IFXJS_Context* pContext = pRuntime->NewContext();
- ASSERT(pContext != NULL);
-
- pContext->OnLink_MouseUp(pDocument);
-
- CFX_WideString csInfo;
- FX_BOOL bRet = pContext->RunScript(swJS, csInfo);
- if (!bRet)
- {
- //CBCL_FormNotify::MsgBoxJSError(pPageView->GetPageViewWnd(), csInfo);
- }
-
- pRuntime->ReleaseContext(pContext);
- }
- }
- }
- else
- {
- DoAction_NoJs(action, pDocument/*, pDocView*/);
- }
-
-// if (!IsValidDocView(pDocument, pDocView))
-// return FALSE;
-
- for (FX_INT32 i=0,sz=action.GetSubActionsCount(); i<sz; i++)
- {
- CPDF_Action subaction = action.GetSubAction(i);
- if (!ExecuteLinkAction(subaction, pDocument,/* pDocView,*/ list)) return FALSE;
- }
-
- return TRUE;
-}
-
-FX_BOOL CPDFSDK_ActionHandler::ExecuteDocumentPageAction(const CPDF_Action& action, CPDF_AAction::AActionType type,
- CPDFSDK_Document* pDocument,/* CReader_DocView* pDocView,*/ CFX_PtrList& list)
-{
- ASSERT(pDocument != NULL);
-
- if (list.Find((CPDF_Dictionary*)action))
- return FALSE;
- list.AddTail((CPDF_Dictionary*)action);
-
- CPDFDoc_Environment* pEnv = pDocument->GetEnv();
- ASSERT(pEnv);
- if (action.GetType() == CPDF_Action::JavaScript)
- {
- if(pEnv->IsJSInitiated())
- {
- CFX_WideString swJS = action.GetJavaScript();
- if (!swJS.IsEmpty())
- {
- RunDocumentPageJavaScript(pDocument, type, swJS);
- }
- }
- }
- else
- {
- DoAction_NoJs(action, pDocument/*, pDocView*/);
- }
-
- if (!IsValidDocView(pDocument/*, pDocView*/))
- return FALSE;
-
- for (FX_INT32 i=0,sz=action.GetSubActionsCount(); i<sz; i++)
- {
- CPDF_Action subaction = action.GetSubAction(i);
- if (!ExecuteDocumentPageAction(subaction, type, pDocument,/* pDocView,*/ list)) return FALSE;
- }
-
- return TRUE;
-}
-
-FX_BOOL CPDFSDK_ActionHandler::IsValidField(CPDFSDK_Document* pDocument, CPDF_Dictionary* pFieldDict)
-{
- ASSERT(m_pEvi != NULL);
- ASSERT(pDocument != NULL);
- ASSERT(pFieldDict != NULL);
-
- if (1/*m_pApp->IsValidDocument(pDocument)*/)
- {
- CPDFSDK_InterForm* pInterForm = pDocument->GetInterForm();
- ASSERT(pInterForm != NULL);
-
- CPDF_InterForm* pPDFInterForm = pInterForm->GetInterForm();
- ASSERT(pPDFInterForm != NULL);
-
- return pPDFInterForm->GetFieldByDict(pFieldDict) != NULL;
- }
-
- return FALSE;
-}
-
-FX_BOOL CPDFSDK_ActionHandler::ExecuteFieldAction(const CPDF_Action& action, CPDF_AAction::AActionType type,
- CPDFSDK_Document* pDocument,/* CReader_DocView* pDocView,*/ CPDF_FormField* pFormField,
- PDFSDK_FieldAction& data, CFX_PtrList& list)
-{
- ASSERT(pDocument != NULL);
-
- if (list.Find((CPDF_Dictionary*)action))
- return FALSE;
- list.AddTail((CPDF_Dictionary*)action);
-
- CPDFDoc_Environment* pEnv = pDocument->GetEnv();
- ASSERT(pEnv);
- if (action.GetType() == CPDF_Action::JavaScript)
- {
- if(pEnv->IsJSInitiated())
- {
- CFX_WideString swJS = action.GetJavaScript();
- if (!swJS.IsEmpty())
- {
- RunFieldJavaScript(pDocument, pFormField, type, data, swJS);
- if (!IsValidField(pDocument, pFormField->GetFieldDict()))
- return FALSE;
- }
- }
- }
- else
- {
- DoAction_NoJs(action, pDocument/*, pDocView*/);
-// if (!IsValidDocView(pDocument, pDocView))
-// return FALSE;
- }
-
- for (FX_INT32 i=0,sz=action.GetSubActionsCount(); i<sz; i++)
- {
- CPDF_Action subaction = action.GetSubAction(i);
- if (!ExecuteFieldAction(subaction, type, pDocument,/* pDocView,*/ pFormField, data, list)) return FALSE;
- }
-
- return TRUE;
-}
-
-FX_BOOL CPDFSDK_ActionHandler::ExecuteScreenAction(const CPDF_Action& action, CPDF_AAction::AActionType type,
- CPDFSDK_Document* pDocument,/* CReader_DocView* pDocView,*/ CPDFSDK_Annot* pScreen, CFX_PtrList& list)
-{
- ASSERT(pDocument != NULL);
-
- if (list.Find((CPDF_Dictionary*)action))
- return FALSE;
- list.AddTail((CPDF_Dictionary*)action);
-
- CPDFDoc_Environment* pEnv = pDocument->GetEnv();
- ASSERT(pEnv);
- if (action.GetType() == CPDF_Action::JavaScript)
- {
- if(pEnv->IsJSInitiated())
- {
- CFX_WideString swJS = action.GetJavaScript();
- if (!swJS.IsEmpty())
- {
- IFXJS_Runtime* pRuntime = pDocument->GetJsRuntime();
- ASSERT(pRuntime != NULL);
-
- pRuntime->SetReaderDocument(pDocument);
-
- IFXJS_Context* pContext = pRuntime->NewContext();
- ASSERT(pContext != NULL);
-
- // switch (type)
- // {
- // case CPDF_AAction::CursorEnter:
- // pContext->OnScreen_MouseEnter(IsCTRLpressed(), IsSHIFTpressed(), pScreen);
- // break;
- // case CPDF_AAction::CursorExit:
- // pContext->OnScreen_MouseExit(IsCTRLpressed(), IsSHIFTpressed(), pScreen);
- // break;
- // case CPDF_AAction::ButtonDown:
- // pContext->OnScreen_MouseDown(IsCTRLpressed(), IsSHIFTpressed(), pScreen);
- // break;
- // case CPDF_AAction::ButtonUp:
- // pContext->OnScreen_MouseUp(IsCTRLpressed(), IsSHIFTpressed(), pScreen);
- // break;
- // case CPDF_AAction::GetFocus:
- // pContext->OnScreen_Focus(IsCTRLpressed(), IsSHIFTpressed(), pScreen);
- // break;
- // case CPDF_AAction::LoseFocus:
- // pContext->OnScreen_Blur(IsCTRLpressed(), IsSHIFTpressed(), pScreen);
- // break;
- // case CPDF_AAction::PageOpen:
- // pContext->OnScreen_Open(IsCTRLpressed(), IsSHIFTpressed(), pScreen);
- // break;
- // case CPDF_AAction::PageClose:
- // pContext->OnScreen_Close(IsCTRLpressed(), IsSHIFTpressed(), pScreen);
- // break;
- // case CPDF_AAction::PageVisible:
- // pContext->OnScreen_InView(IsCTRLpressed(), IsSHIFTpressed(), pScreen);
- // break;
- // case CPDF_AAction::PageInvisible:
- // pContext->OnScreen_OutView(IsCTRLpressed(), IsSHIFTpressed(), pScreen);
- // break;
- // default:
- // ASSERT(FALSE);
- // break;
- // }
-
- CFX_WideString csInfo;
- FX_BOOL bRet = pContext->RunScript(swJS, csInfo);
- if (!bRet)
- {
- //CBCL_FormNotify::MsgBoxJSError(pPageView->GetPageViewWnd(), csInfo);
- }
-
- pRuntime->ReleaseContext(pContext);
- }
- }
- }
- else
- {
- DoAction_NoJs(action, pDocument/*, pDocView*/);
- }
-
-// if (!IsValidDocView(pDocument, pDocView))
-// return FALSE;
-
- for (FX_INT32 i=0,sz=action.GetSubActionsCount(); i<sz; i++)
- {
- CPDF_Action subaction = action.GetSubAction(i);
- if (!ExecuteScreenAction(subaction, type, pDocument,/* pDocView,*/ pScreen, list)) return FALSE;
- }
-
- return TRUE;
-}
-
-FX_BOOL CPDFSDK_ActionHandler::ExecuteBookMark(const CPDF_Action& action, CPDFSDK_Document* pDocument,
- /*CReader_DocView* pDocView,*/ CPDF_Bookmark* pBookmark, CFX_PtrList& list)
-{
- ASSERT(pDocument != NULL);
-
- if (list.Find((CPDF_Dictionary*)action))
- return FALSE;
- list.AddTail((CPDF_Dictionary*)action);
-
- CPDFDoc_Environment* pEnv = pDocument->GetEnv();
- ASSERT(pEnv);
- if (action.GetType() == CPDF_Action::JavaScript)
- {
- if(pEnv->IsJSInitiated())
- {
- CFX_WideString swJS = action.GetJavaScript();
- if (!swJS.IsEmpty())
- {
- IFXJS_Runtime* pRuntime = pDocument->GetJsRuntime();
- ASSERT(pRuntime != NULL);
-
- pRuntime->SetReaderDocument(pDocument);
-
- IFXJS_Context* pContext = pRuntime->NewContext();
- ASSERT(pContext != NULL);
-
- pContext->OnBookmark_MouseUp(pBookmark);
-
- CFX_WideString csInfo;
- FX_BOOL bRet = pContext->RunScript(swJS, csInfo);
- if (!bRet)
- {
- //CBCL_FormNotify::MsgBoxJSError(pPageView->GetPageViewWnd(), csInfo);
- }
-
- pRuntime->ReleaseContext(pContext);
- }
- }
- }
- else
- {
- DoAction_NoJs(action, pDocument/*, pDocView*/);
- }
-
-// if (!IsValidDocView(pDocument, pDocView))
-// return FALSE;
-
- for (FX_INT32 i=0,sz=action.GetSubActionsCount(); i<sz; i++)
- {
- CPDF_Action subaction = action.GetSubAction(i);
- if (!ExecuteBookMark(subaction, pDocument,/* pDocView,*/ pBookmark, list)) return FALSE;
- }
-
- return TRUE;
-}
-
-void CPDFSDK_ActionHandler::DoAction_NoJs(const CPDF_Action& action, CPDFSDK_Document* pDocument/*, CReader_DocView* pDocView*/)
-{
- ASSERT(pDocument != NULL);
-
- switch (action.GetType())
- {
- case CPDF_Action::GoTo:
- DoAction_GoTo(pDocument,/* pDocView,*/ action);
- break;
- case CPDF_Action::GoToR:
- DoAction_GoToR(pDocument, action);
- break;
- case CPDF_Action::GoToE:
- break;
- case CPDF_Action::Launch:
- DoAction_Launch(pDocument, action);
- break;
- case CPDF_Action::Thread:
- break;
- case CPDF_Action::URI:
- DoAction_URI(pDocument, action);
- break;
- case CPDF_Action::Sound:
- if (m_pMediaActionHandler)
- {
- m_pMediaActionHandler->DoAction_Sound(action, pDocument/*, pDocView*/);
- }
- break;
- case CPDF_Action::Movie:
- if (m_pMediaActionHandler)
- {
- m_pMediaActionHandler->DoAction_Movie(action, pDocument/*, pDocView*/);
- }
- break;
- case CPDF_Action::Hide:
- if (m_pFormActionHandler)
- {
- m_pFormActionHandler->DoAction_Hide(action, pDocument);
- }
- break;
- case CPDF_Action::Named:
- DoAction_Named(pDocument, action);
- break;
- case CPDF_Action::SubmitForm:
- if (m_pFormActionHandler)
- {
- m_pFormActionHandler->DoAction_SubmitForm(action, pDocument/*, pDocView*/);
- }
- break;
- case CPDF_Action::ResetForm:
- if (m_pFormActionHandler)
- {
- m_pFormActionHandler->DoAction_ResetForm(action, pDocument);
- }
- break;
- case CPDF_Action::ImportData:
- if (m_pFormActionHandler)
- {
- m_pFormActionHandler->DoAction_ImportData(action, pDocument/*, pDocView*/);
- }
- break;
- case CPDF_Action::JavaScript:
- ASSERT(FALSE);
- break;
- case CPDF_Action::SetOCGState:
- DoAction_SetOCGState(pDocument, /*pDocView,*/ action);
- break;
- case CPDF_Action::Rendition:
- if (m_pMediaActionHandler)
- {
- m_pMediaActionHandler->DoAction_Rendition(action, pDocument/*, pDocView*/);
- }
- break;
- case CPDF_Action::Trans:
- break;
- case CPDF_Action::GoTo3DView:
- break;
- default:
- break;
- }
-}
-
-FX_BOOL CPDFSDK_ActionHandler::IsValidDocView(CPDFSDK_Document* pDocument/*, CReader_DocView* pDocView*/)
-{
- ASSERT(pDocument != NULL);
- //ASSERT(pDocView != NULL);
-
- //return pDocument->IsValidDocView(pDocView);
- return TRUE;
-}
-
-void CPDFSDK_ActionHandler::DoAction_GoTo(CPDFSDK_Document* pDocument, /*CReader_DocView* pDocView,*/
- const CPDF_Action& action)
-{
- ASSERT(pDocument != NULL);
-// ASSERT(pDocView != NULL);
- ASSERT(action != NULL);
-
- CPDF_Document* pPDFDocument = pDocument->GetDocument();
- ASSERT(pPDFDocument != NULL);
- CPDFDoc_Environment* pApp = pDocument->GetEnv();
- ASSERT(pApp != NULL);
-
- CPDF_Dest MyDest = action.GetDest(pPDFDocument);
- int nPageIndex = MyDest.GetPageIndex(pPDFDocument);
- int nFitType = MyDest.GetZoomMode();
- const CPDF_Array * pMyArray = (CPDF_Array*)MyDest.m_pObj;
- float* pPosAry = NULL;
- int sizeOfAry = 0;
- if (pMyArray != NULL)
- {
- pPosAry = new float[pMyArray->GetCount()];
- int j = 0;
- for (int i = 2; i < (int)pMyArray->GetCount(); i++)
- {
- pPosAry[j++] = pMyArray->GetFloat(i);
- }
- sizeOfAry = j;
- }
- pApp->FFI_DoGoToAction(nPageIndex, nFitType, pPosAry, sizeOfAry);
- if(pPosAry)
- delete[] pPosAry;
-}
-
-void CPDFSDK_ActionHandler::DoAction_GoToR(CPDFSDK_Document* pDocument, const CPDF_Action& action)
-{
-
-}
-
-void CPDFSDK_ActionHandler::DoAction_Launch(CPDFSDK_Document* pDocument, const CPDF_Action& action)
-{
-
-}
-
-void CPDFSDK_ActionHandler::DoAction_URI(CPDFSDK_Document* pDocument, const CPDF_Action& action)
-{
- ASSERT(pDocument != NULL);
- ASSERT(action != NULL);
-
- CPDFDoc_Environment* pApp = pDocument->GetEnv();
- ASSERT(pApp != NULL);
-
- CFX_ByteString sURI = action.GetURI(pDocument->GetDocument());
- pApp->FFI_DoURIAction(FX_LPCSTR(sURI));
-}
-
-void CPDFSDK_ActionHandler::DoAction_Named(CPDFSDK_Document* pDocument, const CPDF_Action& action)
-{
- ASSERT(pDocument != NULL);
- ASSERT(action != NULL);
-
- CFX_ByteString csName = action.GetNamedAction();
- pDocument->GetEnv()->FFI_ExecuteNamedAction(csName);
-}
-
-
-void CPDFSDK_ActionHandler::DoAction_SetOCGState(CPDFSDK_Document* pDocument,/* CReader_DocView* pDocView,*/ const CPDF_Action& action)
-{
-}
-
-void CPDFSDK_ActionHandler::RunFieldJavaScript(CPDFSDK_Document* pDocument, CPDF_FormField* pFormField, CPDF_AAction::AActionType type,
- PDFSDK_FieldAction& data, const CFX_WideString& script)
-{
- ASSERT(type != CPDF_AAction::Calculate);
- ASSERT(type != CPDF_AAction::Format);
-
- ASSERT(pDocument != NULL);
-
- IFXJS_Runtime* pRuntime = pDocument->GetJsRuntime();
- ASSERT(pRuntime != NULL);
-
- pRuntime->SetReaderDocument(pDocument);
-
- IFXJS_Context* pContext = pRuntime->NewContext();
- ASSERT(pContext != NULL);
-
- switch (type)
- {
- case CPDF_AAction::CursorEnter:
- pContext->OnField_MouseEnter(data.bModifier, data.bShift, pFormField);
- break;
- case CPDF_AAction::CursorExit:
- pContext->OnField_MouseExit(data.bModifier, data.bShift, pFormField);
- break;
- case CPDF_AAction::ButtonDown:
- pContext->OnField_MouseDown(data.bModifier, data.bShift, pFormField);
- break;
- case CPDF_AAction::ButtonUp:
- pContext->OnField_MouseUp(data.bModifier, data.bShift, pFormField);
- break;
- case CPDF_AAction::GetFocus:
- pContext->OnField_Focus(data.bModifier, data.bShift, pFormField, data.sValue);
- break;
- case CPDF_AAction::LoseFocus:
- pContext->OnField_Blur(data.bModifier, data.bShift, pFormField, data.sValue);
- break;
- case CPDF_AAction::KeyStroke:
- pContext->OnField_Keystroke(data.nCommitKey, data.sChange, data.sChangeEx, data.bKeyDown,
- data.bModifier, data.nSelEnd, data.nSelStart, data.bShift, pFormField, data.sValue,
- data.bWillCommit, data.bFieldFull, data.bRC);
- break;
- case CPDF_AAction::Validate:
- pContext->OnField_Validate(data.sChange, data.sChangeEx, data.bKeyDown, data.bModifier,
- data.bShift, pFormField, data.sValue, data.bRC);
- break;
- default:
- ASSERT(FALSE);
- break;
- }
-
- CFX_WideString csInfo;
- FX_BOOL bRet = pContext->RunScript(script, csInfo);
- if (!bRet)
- {
- //CBCL_FormNotify::MsgBoxJSError(pPageView->GetPageViewWnd(), csInfo);
- }
-
- pRuntime->ReleaseContext(pContext);
-}
-
-void CPDFSDK_ActionHandler::RunDocumentOpenJavaScript(CPDFSDK_Document* pDocument, const CFX_WideString& sScriptName, const CFX_WideString& script)
-{
- ASSERT(pDocument != NULL);
-
- IFXJS_Runtime* pRuntime = pDocument->GetJsRuntime();
- ASSERT(pRuntime != NULL);
-
- pRuntime->SetReaderDocument(pDocument);
-
- IFXJS_Context* pContext = pRuntime->NewContext();
- ASSERT(pContext != NULL);
-
- pContext->OnDoc_Open(pDocument, sScriptName);
-
- CFX_WideString csInfo;
- FX_BOOL bRet = pContext->RunScript(script, csInfo);
- if (!bRet)
- {
- //CBCL_FormNotify::MsgBoxJSError(pPageView->GetPageViewWnd(), csInfo);
- }
-
- pRuntime->ReleaseContext(pContext);
-}
-
-void CPDFSDK_ActionHandler::RunDocumentPageJavaScript(CPDFSDK_Document* pDocument, CPDF_AAction::AActionType type, const CFX_WideString& script)
-{
- ASSERT(pDocument != NULL);
-
- IFXJS_Runtime* pRuntime = pDocument->GetJsRuntime();
- ASSERT(pRuntime != NULL);
-
- pRuntime->SetReaderDocument(pDocument);
-
- IFXJS_Context* pContext = pRuntime->NewContext();
- ASSERT(pContext != NULL);
-
- switch (type)
- {
- case CPDF_AAction::OpenPage:
- pContext->OnPage_Open(pDocument);
- break;
- case CPDF_AAction::ClosePage:
- pContext->OnPage_Close(pDocument);
- break;
- case CPDF_AAction::CloseDocument:
- pContext->OnDoc_WillClose(pDocument);
- break;
- case CPDF_AAction::SaveDocument:
- pContext->OnDoc_WillSave(pDocument);
- break;
- case CPDF_AAction::DocumentSaved:
- pContext->OnDoc_DidSave(pDocument);
- break;
- case CPDF_AAction::PrintDocument:
- pContext->OnDoc_WillPrint(pDocument);
- break;
- case CPDF_AAction::DocumentPrinted:
- pContext->OnDoc_DidPrint(pDocument);
- break;
- case CPDF_AAction::PageVisible:
- pContext->OnPage_InView(pDocument);
- break;
- case CPDF_AAction::PageInvisible:
- pContext->OnPage_OutView(pDocument);
- break;
- default:
- ASSERT(FALSE);
- break;
- }
-
- CFX_WideString csInfo;
- FX_BOOL bRet = pContext->RunScript(script, csInfo);
- if (!bRet)
- {
- //CBCL_FormNotify::MsgBoxJSError(pPageView->GetPageViewWnd(), csInfo);
- }
-
- pRuntime->ReleaseContext(pContext);
-}
-
-
-FX_BOOL CPDFSDK_FormActionHandler::DoAction_Hide(const CPDF_Action& action, CPDFSDK_Document* pDocument)
-{
- ASSERT(pDocument != NULL);
-
- CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pDocument->GetInterForm();
- ASSERT(pInterForm != NULL);
-
- if (pInterForm->DoAction_Hide(action))
- {
- pDocument->SetChangeMark();
- return TRUE;
- }
-
- return FALSE;
-}
-
-FX_BOOL CPDFSDK_FormActionHandler::DoAction_SubmitForm(const CPDF_Action& action, CPDFSDK_Document* pDocument)
-{
- ASSERT(pDocument != NULL);
-
- CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pDocument->GetInterForm();
- ASSERT(pInterForm != NULL);
-
- return pInterForm->DoAction_SubmitForm(action);
-}
-
-FX_BOOL CPDFSDK_FormActionHandler::DoAction_ResetForm(const CPDF_Action& action, CPDFSDK_Document* pDocument)
-{
- ASSERT(pDocument != NULL);
-
- CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pDocument->GetInterForm();
- ASSERT(pInterForm != NULL);
-
- if (pInterForm->DoAction_ResetForm(action))
- {
- return TRUE;
- }
-
- return FALSE;
-}
-
-FX_BOOL CPDFSDK_FormActionHandler::DoAction_ImportData(const CPDF_Action& action, CPDFSDK_Document* pDocument)
-{
- ASSERT(pDocument != NULL);
-
- CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pDocument->GetInterForm();
- ASSERT(pInterForm != NULL);
-
- if (pInterForm->DoAction_ImportData(action))
- {
- pDocument->SetChangeMark();
- return TRUE;
- }
-
- return FALSE;
-}
-
-FX_BOOL CPDFSDK_MediaActionHandler::DoAction_Rendition(const CPDF_Action& action, CPDFSDK_Document* pDocument)
-{
- return FALSE;
-}
-
-FX_BOOL CPDFSDK_MediaActionHandler::DoAction_Sound(const CPDF_Action& action, CPDFSDK_Document* pDocument)
-{
- return FALSE;
-}
-
-FX_BOOL CPDFSDK_MediaActionHandler::DoAction_Movie(const CPDF_Action& action, CPDFSDK_Document* pDocument)
-{
- return FALSE;
-}
-
+// 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
+
+#include "../include/fsdk_define.h"
+#include "../include/fsdk_mgr.h"
+#include "../include/fsdk_actionhandler.h"
+#include "../include/javascript/IJavaScript.h"
+
+/* -------------------------- CBA_ActionHandler -------------------------- */
+
+CPDFSDK_ActionHandler::CPDFSDK_ActionHandler(CPDFDoc_Environment* pEvi) :
+ m_pEvi(pEvi),
+ m_pFormActionHandler(NULL),
+ m_pMediaActionHandler(NULL)
+{
+ m_pFormActionHandler = new CPDFSDK_FormActionHandler;
+}
+
+CPDFSDK_ActionHandler::~CPDFSDK_ActionHandler()
+{
+ if(m_pFormActionHandler)
+ {
+ delete m_pFormActionHandler;
+ m_pFormActionHandler = NULL;
+ }
+}
+
+void CPDFSDK_ActionHandler::SetFormActionHandler(CPDFSDK_FormActionHandler* pHandler)
+{
+ ASSERT(pHandler != NULL);
+ ASSERT(m_pFormActionHandler == NULL);
+ m_pFormActionHandler = pHandler;
+}
+
+void CPDFSDK_ActionHandler::SetMediaActionHandler(CPDFSDK_MediaActionHandler* pHandler)
+{
+ ASSERT(pHandler != NULL);
+ ASSERT(m_pMediaActionHandler == NULL);
+ m_pMediaActionHandler = pHandler;
+}
+
+void CPDFSDK_ActionHandler::Destroy()
+{
+ delete this;
+}
+
+//document open
+FX_BOOL CPDFSDK_ActionHandler::DoAction_DocOpen(const CPDF_Action& action, CPDFSDK_Document* pDocument
+ /*CReader_Document* pDocument, CReader_DocView *pDocView*/)
+{
+ CFX_PtrList list;
+ return ExecuteDocumentOpenAction(action, pDocument, /*pDocView, */list);
+}
+
+//document open
+FX_BOOL CPDFSDK_ActionHandler::DoAction_JavaScript(const CPDF_Action& JsAction,CFX_WideString csJSName,
+ CPDFSDK_Document* pDocument/*, CReader_DocView *pDocView*/)
+{
+ if (JsAction.GetType() == CPDF_Action::JavaScript)
+ {
+ CFX_WideString swJS = JsAction.GetJavaScript();
+ if (!swJS.IsEmpty())
+ {
+ RunDocumentOpenJavaScript(pDocument, csJSName, swJS);
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
+FX_BOOL CPDFSDK_ActionHandler::DoAction_FieldJavaScript(const CPDF_Action& JsAction, CPDF_AAction::AActionType type,
+ CPDFSDK_Document* pDocument, CPDF_FormField* pFormField,
+ PDFSDK_FieldAction& data)
+{
+ CPDFDoc_Environment* pEnv = pDocument->GetEnv();
+ ASSERT(pEnv);
+ if (pEnv->IsJSInitiated() && JsAction.GetType() == CPDF_Action::JavaScript)
+ {
+ CFX_WideString swJS = JsAction.GetJavaScript();
+ if (!swJS.IsEmpty())
+ {
+ RunFieldJavaScript(pDocument, pFormField, type, data, swJS);
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
+FX_BOOL CPDFSDK_ActionHandler::DoAction_Page(const CPDF_Action& action, enum CPDF_AAction::AActionType eType,
+ CPDFSDK_Document* pDocument/*, CReader_DocView *pDocView*/)
+{
+ CFX_PtrList list;
+ return ExecuteDocumentPageAction(action, eType, pDocument,/* pDocView,*/ list);
+}
+
+FX_BOOL CPDFSDK_ActionHandler::DoAction_Document(const CPDF_Action& action, enum CPDF_AAction::AActionType eType,
+ CPDFSDK_Document* pDocument/*, CReader_DocView *pDocView*/)
+{
+ CFX_PtrList list;
+ return ExecuteDocumentPageAction(action, eType, pDocument,/* pDocView,*/ list);
+}
+
+FX_BOOL CPDFSDK_ActionHandler::DoAction_BookMark(CPDF_Bookmark *pBookMark, const CPDF_Action& action, CPDF_AAction::AActionType type,
+ CPDFSDK_Document* pDocument/*, CReader_DocView *pDocView*/)
+{
+ CFX_PtrList list;
+ return this->ExecuteBookMark(action, pDocument,/* pDocView,*/ pBookMark, list);
+}
+
+FX_BOOL CPDFSDK_ActionHandler::DoAction_Screen(const CPDF_Action& action, CPDF_AAction::AActionType type,
+ CPDFSDK_Document* pDocument,/* CReader_DocView *pDocView,*/ CPDFSDK_Annot* pScreen)
+{
+ CFX_PtrList list;
+ return this->ExecuteScreenAction(action, type, pDocument,/* pDocView,*/ pScreen, list);
+}
+
+FX_BOOL CPDFSDK_ActionHandler::DoAction_Link(const CPDF_Action& action,
+ CPDFSDK_Document* pDocument/*, CReader_DocView *pDocView*/)
+{
+ CFX_PtrList list;
+ return ExecuteLinkAction(action, pDocument,/* pDocView,*/ list);
+}
+
+FX_BOOL CPDFSDK_ActionHandler::DoAction_Field(const CPDF_Action& action, CPDF_AAction::AActionType type,
+ CPDFSDK_Document* pDocument,/* CReader_DocView *pDocView,*/
+ CPDF_FormField* pFormField, PDFSDK_FieldAction& data)
+{
+ CFX_PtrList list;
+ return ExecuteFieldAction(action, type, pDocument,/* pDocView,*/ pFormField, data, list);
+}
+
+FX_BOOL CPDFSDK_ActionHandler::ExecuteDocumentOpenAction(const CPDF_Action& action, CPDFSDK_Document* pDocument,
+ /*CReader_DocView *pDocView,*/ CFX_PtrList& list)
+{
+ ASSERT(pDocument != NULL);
+
+ if (list.Find((CPDF_Dictionary*)action))
+ return FALSE;
+ list.AddTail((CPDF_Dictionary*)action);
+
+ CPDFDoc_Environment* pEnv = pDocument->GetEnv();
+ ASSERT(pEnv);
+ if (action.GetType() == CPDF_Action::JavaScript)
+ {
+ if(pEnv->IsJSInitiated())
+ {
+ CFX_WideString swJS = action.GetJavaScript();
+ if (!swJS.IsEmpty())
+ {
+ RunDocumentOpenJavaScript(pDocument, L"", swJS);
+ }
+ }
+ }
+ else
+ {
+ DoAction_NoJs(action, pDocument/*, pDocView*/);
+ }
+
+// if (!IsValidDocView(pDocument, pDocView))
+// return FALSE;
+
+ for (FX_INT32 i=0,sz=action.GetSubActionsCount(); i<sz; i++)
+ {
+ CPDF_Action subaction = action.GetSubAction(i);
+ if (!ExecuteDocumentOpenAction(subaction, pDocument,/* pDocView,*/ list)) return FALSE;
+ }
+
+ return TRUE;
+}
+
+FX_BOOL CPDFSDK_ActionHandler::ExecuteLinkAction(const CPDF_Action& action, CPDFSDK_Document* pDocument,
+ /*CReader_DocView* pDocView,*/ CFX_PtrList& list)
+{
+ ASSERT(pDocument != NULL);
+
+ if (list.Find((CPDF_Dictionary*)action))
+ return FALSE;
+ list.AddTail((CPDF_Dictionary*)action);
+
+ CPDFDoc_Environment* pEnv = pDocument->GetEnv();
+ ASSERT(pEnv);
+ if (action.GetType() == CPDF_Action::JavaScript)
+ {
+ if(pEnv->IsJSInitiated())
+ {
+ CFX_WideString swJS = action.GetJavaScript();
+ if (!swJS.IsEmpty())
+ {
+ IFXJS_Runtime* pRuntime = pDocument->GetJsRuntime(); //????
+ ASSERT(pRuntime != NULL);
+
+ pRuntime->SetReaderDocument(pDocument);
+
+ IFXJS_Context* pContext = pRuntime->NewContext();
+ ASSERT(pContext != NULL);
+
+ pContext->OnLink_MouseUp(pDocument);
+
+ CFX_WideString csInfo;
+ FX_BOOL bRet = pContext->RunScript(swJS, csInfo);
+ if (!bRet)
+ {
+ //CBCL_FormNotify::MsgBoxJSError(pPageView->GetPageViewWnd(), csInfo);
+ }
+
+ pRuntime->ReleaseContext(pContext);
+ }
+ }
+ }
+ else
+ {
+ DoAction_NoJs(action, pDocument/*, pDocView*/);
+ }
+
+// if (!IsValidDocView(pDocument, pDocView))
+// return FALSE;
+
+ for (FX_INT32 i=0,sz=action.GetSubActionsCount(); i<sz; i++)
+ {
+ CPDF_Action subaction = action.GetSubAction(i);
+ if (!ExecuteLinkAction(subaction, pDocument,/* pDocView,*/ list)) return FALSE;
+ }
+
+ return TRUE;
+}
+
+FX_BOOL CPDFSDK_ActionHandler::ExecuteDocumentPageAction(const CPDF_Action& action, CPDF_AAction::AActionType type,
+ CPDFSDK_Document* pDocument,/* CReader_DocView* pDocView,*/ CFX_PtrList& list)
+{
+ ASSERT(pDocument != NULL);
+
+ if (list.Find((CPDF_Dictionary*)action))
+ return FALSE;
+ list.AddTail((CPDF_Dictionary*)action);
+
+ CPDFDoc_Environment* pEnv = pDocument->GetEnv();
+ ASSERT(pEnv);
+ if (action.GetType() == CPDF_Action::JavaScript)
+ {
+ if(pEnv->IsJSInitiated())
+ {
+ CFX_WideString swJS = action.GetJavaScript();
+ if (!swJS.IsEmpty())
+ {
+ RunDocumentPageJavaScript(pDocument, type, swJS);
+ }
+ }
+ }
+ else
+ {
+ DoAction_NoJs(action, pDocument/*, pDocView*/);
+ }
+
+ if (!IsValidDocView(pDocument/*, pDocView*/))
+ return FALSE;
+
+ for (FX_INT32 i=0,sz=action.GetSubActionsCount(); i<sz; i++)
+ {
+ CPDF_Action subaction = action.GetSubAction(i);
+ if (!ExecuteDocumentPageAction(subaction, type, pDocument,/* pDocView,*/ list)) return FALSE;
+ }
+
+ return TRUE;
+}
+
+FX_BOOL CPDFSDK_ActionHandler::IsValidField(CPDFSDK_Document* pDocument, CPDF_Dictionary* pFieldDict)
+{
+ ASSERT(m_pEvi != NULL);
+ ASSERT(pDocument != NULL);
+ ASSERT(pFieldDict != NULL);
+
+ if (1/*m_pApp->IsValidDocument(pDocument)*/)
+ {
+ CPDFSDK_InterForm* pInterForm = pDocument->GetInterForm();
+ ASSERT(pInterForm != NULL);
+
+ CPDF_InterForm* pPDFInterForm = pInterForm->GetInterForm();
+ ASSERT(pPDFInterForm != NULL);
+
+ return pPDFInterForm->GetFieldByDict(pFieldDict) != NULL;
+ }
+
+ return FALSE;
+}
+
+FX_BOOL CPDFSDK_ActionHandler::ExecuteFieldAction(const CPDF_Action& action, CPDF_AAction::AActionType type,
+ CPDFSDK_Document* pDocument,/* CReader_DocView* pDocView,*/ CPDF_FormField* pFormField,
+ PDFSDK_FieldAction& data, CFX_PtrList& list)
+{
+ ASSERT(pDocument != NULL);
+
+ if (list.Find((CPDF_Dictionary*)action))
+ return FALSE;
+ list.AddTail((CPDF_Dictionary*)action);
+
+ CPDFDoc_Environment* pEnv = pDocument->GetEnv();
+ ASSERT(pEnv);
+ if (action.GetType() == CPDF_Action::JavaScript)
+ {
+ if(pEnv->IsJSInitiated())
+ {
+ CFX_WideString swJS = action.GetJavaScript();
+ if (!swJS.IsEmpty())
+ {
+ RunFieldJavaScript(pDocument, pFormField, type, data, swJS);
+ if (!IsValidField(pDocument, pFormField->GetFieldDict()))
+ return FALSE;
+ }
+ }
+ }
+ else
+ {
+ DoAction_NoJs(action, pDocument/*, pDocView*/);
+// if (!IsValidDocView(pDocument, pDocView))
+// return FALSE;
+ }
+
+ for (FX_INT32 i=0,sz=action.GetSubActionsCount(); i<sz; i++)
+ {
+ CPDF_Action subaction = action.GetSubAction(i);
+ if (!ExecuteFieldAction(subaction, type, pDocument,/* pDocView,*/ pFormField, data, list)) return FALSE;
+ }
+
+ return TRUE;
+}
+
+FX_BOOL CPDFSDK_ActionHandler::ExecuteScreenAction(const CPDF_Action& action, CPDF_AAction::AActionType type,
+ CPDFSDK_Document* pDocument,/* CReader_DocView* pDocView,*/ CPDFSDK_Annot* pScreen, CFX_PtrList& list)
+{
+ ASSERT(pDocument != NULL);
+
+ if (list.Find((CPDF_Dictionary*)action))
+ return FALSE;
+ list.AddTail((CPDF_Dictionary*)action);
+
+ CPDFDoc_Environment* pEnv = pDocument->GetEnv();
+ ASSERT(pEnv);
+ if (action.GetType() == CPDF_Action::JavaScript)
+ {
+ if(pEnv->IsJSInitiated())
+ {
+ CFX_WideString swJS = action.GetJavaScript();
+ if (!swJS.IsEmpty())
+ {
+ IFXJS_Runtime* pRuntime = pDocument->GetJsRuntime();
+ ASSERT(pRuntime != NULL);
+
+ pRuntime->SetReaderDocument(pDocument);
+
+ IFXJS_Context* pContext = pRuntime->NewContext();
+ ASSERT(pContext != NULL);
+
+ // switch (type)
+ // {
+ // case CPDF_AAction::CursorEnter:
+ // pContext->OnScreen_MouseEnter(IsCTRLpressed(), IsSHIFTpressed(), pScreen);
+ // break;
+ // case CPDF_AAction::CursorExit:
+ // pContext->OnScreen_MouseExit(IsCTRLpressed(), IsSHIFTpressed(), pScreen);
+ // break;
+ // case CPDF_AAction::ButtonDown:
+ // pContext->OnScreen_MouseDown(IsCTRLpressed(), IsSHIFTpressed(), pScreen);
+ // break;
+ // case CPDF_AAction::ButtonUp:
+ // pContext->OnScreen_MouseUp(IsCTRLpressed(), IsSHIFTpressed(), pScreen);
+ // break;
+ // case CPDF_AAction::GetFocus:
+ // pContext->OnScreen_Focus(IsCTRLpressed(), IsSHIFTpressed(), pScreen);
+ // break;
+ // case CPDF_AAction::LoseFocus:
+ // pContext->OnScreen_Blur(IsCTRLpressed(), IsSHIFTpressed(), pScreen);
+ // break;
+ // case CPDF_AAction::PageOpen:
+ // pContext->OnScreen_Open(IsCTRLpressed(), IsSHIFTpressed(), pScreen);
+ // break;
+ // case CPDF_AAction::PageClose:
+ // pContext->OnScreen_Close(IsCTRLpressed(), IsSHIFTpressed(), pScreen);
+ // break;
+ // case CPDF_AAction::PageVisible:
+ // pContext->OnScreen_InView(IsCTRLpressed(), IsSHIFTpressed(), pScreen);
+ // break;
+ // case CPDF_AAction::PageInvisible:
+ // pContext->OnScreen_OutView(IsCTRLpressed(), IsSHIFTpressed(), pScreen);
+ // break;
+ // default:
+ // ASSERT(FALSE);
+ // break;
+ // }
+
+ CFX_WideString csInfo;
+ FX_BOOL bRet = pContext->RunScript(swJS, csInfo);
+ if (!bRet)
+ {
+ //CBCL_FormNotify::MsgBoxJSError(pPageView->GetPageViewWnd(), csInfo);
+ }
+
+ pRuntime->ReleaseContext(pContext);
+ }
+ }
+ }
+ else
+ {
+ DoAction_NoJs(action, pDocument/*, pDocView*/);
+ }
+
+// if (!IsValidDocView(pDocument, pDocView))
+// return FALSE;
+
+ for (FX_INT32 i=0,sz=action.GetSubActionsCount(); i<sz; i++)
+ {
+ CPDF_Action subaction = action.GetSubAction(i);
+ if (!ExecuteScreenAction(subaction, type, pDocument,/* pDocView,*/ pScreen, list)) return FALSE;
+ }
+
+ return TRUE;
+}
+
+FX_BOOL CPDFSDK_ActionHandler::ExecuteBookMark(const CPDF_Action& action, CPDFSDK_Document* pDocument,
+ /*CReader_DocView* pDocView,*/ CPDF_Bookmark* pBookmark, CFX_PtrList& list)
+{
+ ASSERT(pDocument != NULL);
+
+ if (list.Find((CPDF_Dictionary*)action))
+ return FALSE;
+ list.AddTail((CPDF_Dictionary*)action);
+
+ CPDFDoc_Environment* pEnv = pDocument->GetEnv();
+ ASSERT(pEnv);
+ if (action.GetType() == CPDF_Action::JavaScript)
+ {
+ if(pEnv->IsJSInitiated())
+ {
+ CFX_WideString swJS = action.GetJavaScript();
+ if (!swJS.IsEmpty())
+ {
+ IFXJS_Runtime* pRuntime = pDocument->GetJsRuntime();
+ ASSERT(pRuntime != NULL);
+
+ pRuntime->SetReaderDocument(pDocument);
+
+ IFXJS_Context* pContext = pRuntime->NewContext();
+ ASSERT(pContext != NULL);
+
+ pContext->OnBookmark_MouseUp(pBookmark);
+
+ CFX_WideString csInfo;
+ FX_BOOL bRet = pContext->RunScript(swJS, csInfo);
+ if (!bRet)
+ {
+ //CBCL_FormNotify::MsgBoxJSError(pPageView->GetPageViewWnd(), csInfo);
+ }
+
+ pRuntime->ReleaseContext(pContext);
+ }
+ }
+ }
+ else
+ {
+ DoAction_NoJs(action, pDocument/*, pDocView*/);
+ }
+
+// if (!IsValidDocView(pDocument, pDocView))
+// return FALSE;
+
+ for (FX_INT32 i=0,sz=action.GetSubActionsCount(); i<sz; i++)
+ {
+ CPDF_Action subaction = action.GetSubAction(i);
+ if (!ExecuteBookMark(subaction, pDocument,/* pDocView,*/ pBookmark, list)) return FALSE;
+ }
+
+ return TRUE;
+}
+
+void CPDFSDK_ActionHandler::DoAction_NoJs(const CPDF_Action& action, CPDFSDK_Document* pDocument/*, CReader_DocView* pDocView*/)
+{
+ ASSERT(pDocument != NULL);
+
+ switch (action.GetType())
+ {
+ case CPDF_Action::GoTo:
+ DoAction_GoTo(pDocument,/* pDocView,*/ action);
+ break;
+ case CPDF_Action::GoToR:
+ DoAction_GoToR(pDocument, action);
+ break;
+ case CPDF_Action::GoToE:
+ break;
+ case CPDF_Action::Launch:
+ DoAction_Launch(pDocument, action);
+ break;
+ case CPDF_Action::Thread:
+ break;
+ case CPDF_Action::URI:
+ DoAction_URI(pDocument, action);
+ break;
+ case CPDF_Action::Sound:
+ if (m_pMediaActionHandler)
+ {
+ m_pMediaActionHandler->DoAction_Sound(action, pDocument/*, pDocView*/);
+ }
+ break;
+ case CPDF_Action::Movie:
+ if (m_pMediaActionHandler)
+ {
+ m_pMediaActionHandler->DoAction_Movie(action, pDocument/*, pDocView*/);
+ }
+ break;
+ case CPDF_Action::Hide:
+ if (m_pFormActionHandler)
+ {
+ m_pFormActionHandler->DoAction_Hide(action, pDocument);
+ }
+ break;
+ case CPDF_Action::Named:
+ DoAction_Named(pDocument, action);
+ break;
+ case CPDF_Action::SubmitForm:
+ if (m_pFormActionHandler)
+ {
+ m_pFormActionHandler->DoAction_SubmitForm(action, pDocument/*, pDocView*/);
+ }
+ break;
+ case CPDF_Action::ResetForm:
+ if (m_pFormActionHandler)
+ {
+ m_pFormActionHandler->DoAction_ResetForm(action, pDocument);
+ }
+ break;
+ case CPDF_Action::ImportData:
+ if (m_pFormActionHandler)
+ {
+ m_pFormActionHandler->DoAction_ImportData(action, pDocument/*, pDocView*/);
+ }
+ break;
+ case CPDF_Action::JavaScript:
+ ASSERT(FALSE);
+ break;
+ case CPDF_Action::SetOCGState:
+ DoAction_SetOCGState(pDocument, /*pDocView,*/ action);
+ break;
+ case CPDF_Action::Rendition:
+ if (m_pMediaActionHandler)
+ {
+ m_pMediaActionHandler->DoAction_Rendition(action, pDocument/*, pDocView*/);
+ }
+ break;
+ case CPDF_Action::Trans:
+ break;
+ case CPDF_Action::GoTo3DView:
+ break;
+ default:
+ break;
+ }
+}
+
+FX_BOOL CPDFSDK_ActionHandler::IsValidDocView(CPDFSDK_Document* pDocument/*, CReader_DocView* pDocView*/)
+{
+ ASSERT(pDocument != NULL);
+ //ASSERT(pDocView != NULL);
+
+ //return pDocument->IsValidDocView(pDocView);
+ return TRUE;
+}
+
+void CPDFSDK_ActionHandler::DoAction_GoTo(CPDFSDK_Document* pDocument, /*CReader_DocView* pDocView,*/
+ const CPDF_Action& action)
+{
+ ASSERT(pDocument != NULL);
+// ASSERT(pDocView != NULL);
+ ASSERT(action != NULL);
+
+ CPDF_Document* pPDFDocument = pDocument->GetDocument();
+ ASSERT(pPDFDocument != NULL);
+ CPDFDoc_Environment* pApp = pDocument->GetEnv();
+ ASSERT(pApp != NULL);
+
+ CPDF_Dest MyDest = action.GetDest(pPDFDocument);
+ int nPageIndex = MyDest.GetPageIndex(pPDFDocument);
+ int nFitType = MyDest.GetZoomMode();
+ const CPDF_Array * pMyArray = (CPDF_Array*)MyDest.m_pObj;
+ float* pPosAry = NULL;
+ int sizeOfAry = 0;
+ if (pMyArray != NULL)
+ {
+ pPosAry = new float[pMyArray->GetCount()];
+ int j = 0;
+ for (int i = 2; i < (int)pMyArray->GetCount(); i++)
+ {
+ pPosAry[j++] = pMyArray->GetFloat(i);
+ }
+ sizeOfAry = j;
+ }
+ pApp->FFI_DoGoToAction(nPageIndex, nFitType, pPosAry, sizeOfAry);
+ if(pPosAry)
+ delete[] pPosAry;
+}
+
+void CPDFSDK_ActionHandler::DoAction_GoToR(CPDFSDK_Document* pDocument, const CPDF_Action& action)
+{
+
+}
+
+void CPDFSDK_ActionHandler::DoAction_Launch(CPDFSDK_Document* pDocument, const CPDF_Action& action)
+{
+
+}
+
+void CPDFSDK_ActionHandler::DoAction_URI(CPDFSDK_Document* pDocument, const CPDF_Action& action)
+{
+ ASSERT(pDocument != NULL);
+ ASSERT(action != NULL);
+
+ CPDFDoc_Environment* pApp = pDocument->GetEnv();
+ ASSERT(pApp != NULL);
+
+ CFX_ByteString sURI = action.GetURI(pDocument->GetDocument());
+ pApp->FFI_DoURIAction(FX_LPCSTR(sURI));
+}
+
+void CPDFSDK_ActionHandler::DoAction_Named(CPDFSDK_Document* pDocument, const CPDF_Action& action)
+{
+ ASSERT(pDocument != NULL);
+ ASSERT(action != NULL);
+
+ CFX_ByteString csName = action.GetNamedAction();
+ pDocument->GetEnv()->FFI_ExecuteNamedAction(csName);
+}
+
+
+void CPDFSDK_ActionHandler::DoAction_SetOCGState(CPDFSDK_Document* pDocument,/* CReader_DocView* pDocView,*/ const CPDF_Action& action)
+{
+}
+
+void CPDFSDK_ActionHandler::RunFieldJavaScript(CPDFSDK_Document* pDocument, CPDF_FormField* pFormField, CPDF_AAction::AActionType type,
+ PDFSDK_FieldAction& data, const CFX_WideString& script)
+{
+ ASSERT(type != CPDF_AAction::Calculate);
+ ASSERT(type != CPDF_AAction::Format);
+
+ ASSERT(pDocument != NULL);
+
+ IFXJS_Runtime* pRuntime = pDocument->GetJsRuntime();
+ ASSERT(pRuntime != NULL);
+
+ pRuntime->SetReaderDocument(pDocument);
+
+ IFXJS_Context* pContext = pRuntime->NewContext();
+ ASSERT(pContext != NULL);
+
+ switch (type)
+ {
+ case CPDF_AAction::CursorEnter:
+ pContext->OnField_MouseEnter(data.bModifier, data.bShift, pFormField);
+ break;
+ case CPDF_AAction::CursorExit:
+ pContext->OnField_MouseExit(data.bModifier, data.bShift, pFormField);
+ break;
+ case CPDF_AAction::ButtonDown:
+ pContext->OnField_MouseDown(data.bModifier, data.bShift, pFormField);
+ break;
+ case CPDF_AAction::ButtonUp:
+ pContext->OnField_MouseUp(data.bModifier, data.bShift, pFormField);
+ break;
+ case CPDF_AAction::GetFocus:
+ pContext->OnField_Focus(data.bModifier, data.bShift, pFormField, data.sValue);
+ break;
+ case CPDF_AAction::LoseFocus:
+ pContext->OnField_Blur(data.bModifier, data.bShift, pFormField, data.sValue);
+ break;
+ case CPDF_AAction::KeyStroke:
+ pContext->OnField_Keystroke(data.nCommitKey, data.sChange, data.sChangeEx, data.bKeyDown,
+ data.bModifier, data.nSelEnd, data.nSelStart, data.bShift, pFormField, data.sValue,
+ data.bWillCommit, data.bFieldFull, data.bRC);
+ break;
+ case CPDF_AAction::Validate:
+ pContext->OnField_Validate(data.sChange, data.sChangeEx, data.bKeyDown, data.bModifier,
+ data.bShift, pFormField, data.sValue, data.bRC);
+ break;
+ default:
+ ASSERT(FALSE);
+ break;
+ }
+
+ CFX_WideString csInfo;
+ FX_BOOL bRet = pContext->RunScript(script, csInfo);
+ if (!bRet)
+ {
+ //CBCL_FormNotify::MsgBoxJSError(pPageView->GetPageViewWnd(), csInfo);
+ }
+
+ pRuntime->ReleaseContext(pContext);
+}
+
+void CPDFSDK_ActionHandler::RunDocumentOpenJavaScript(CPDFSDK_Document* pDocument, const CFX_WideString& sScriptName, const CFX_WideString& script)
+{
+ ASSERT(pDocument != NULL);
+
+ IFXJS_Runtime* pRuntime = pDocument->GetJsRuntime();
+ ASSERT(pRuntime != NULL);
+
+ pRuntime->SetReaderDocument(pDocument);
+
+ IFXJS_Context* pContext = pRuntime->NewContext();
+ ASSERT(pContext != NULL);
+
+ pContext->OnDoc_Open(pDocument, sScriptName);
+
+ CFX_WideString csInfo;
+ FX_BOOL bRet = pContext->RunScript(script, csInfo);
+ if (!bRet)
+ {
+ //CBCL_FormNotify::MsgBoxJSError(pPageView->GetPageViewWnd(), csInfo);
+ }
+
+ pRuntime->ReleaseContext(pContext);
+}
+
+void CPDFSDK_ActionHandler::RunDocumentPageJavaScript(CPDFSDK_Document* pDocument, CPDF_AAction::AActionType type, const CFX_WideString& script)
+{
+ ASSERT(pDocument != NULL);
+
+ IFXJS_Runtime* pRuntime = pDocument->GetJsRuntime();
+ ASSERT(pRuntime != NULL);
+
+ pRuntime->SetReaderDocument(pDocument);
+
+ IFXJS_Context* pContext = pRuntime->NewContext();
+ ASSERT(pContext != NULL);
+
+ switch (type)
+ {
+ case CPDF_AAction::OpenPage:
+ pContext->OnPage_Open(pDocument);
+ break;
+ case CPDF_AAction::ClosePage:
+ pContext->OnPage_Close(pDocument);
+ break;
+ case CPDF_AAction::CloseDocument:
+ pContext->OnDoc_WillClose(pDocument);
+ break;
+ case CPDF_AAction::SaveDocument:
+ pContext->OnDoc_WillSave(pDocument);
+ break;
+ case CPDF_AAction::DocumentSaved:
+ pContext->OnDoc_DidSave(pDocument);
+ break;
+ case CPDF_AAction::PrintDocument:
+ pContext->OnDoc_WillPrint(pDocument);
+ break;
+ case CPDF_AAction::DocumentPrinted:
+ pContext->OnDoc_DidPrint(pDocument);
+ break;
+ case CPDF_AAction::PageVisible:
+ pContext->OnPage_InView(pDocument);
+ break;
+ case CPDF_AAction::PageInvisible:
+ pContext->OnPage_OutView(pDocument);
+ break;
+ default:
+ ASSERT(FALSE);
+ break;
+ }
+
+ CFX_WideString csInfo;
+ FX_BOOL bRet = pContext->RunScript(script, csInfo);
+ if (!bRet)
+ {
+ //CBCL_FormNotify::MsgBoxJSError(pPageView->GetPageViewWnd(), csInfo);
+ }
+
+ pRuntime->ReleaseContext(pContext);
+}
+
+
+FX_BOOL CPDFSDK_FormActionHandler::DoAction_Hide(const CPDF_Action& action, CPDFSDK_Document* pDocument)
+{
+ ASSERT(pDocument != NULL);
+
+ CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pDocument->GetInterForm();
+ ASSERT(pInterForm != NULL);
+
+ if (pInterForm->DoAction_Hide(action))
+ {
+ pDocument->SetChangeMark();
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+FX_BOOL CPDFSDK_FormActionHandler::DoAction_SubmitForm(const CPDF_Action& action, CPDFSDK_Document* pDocument)
+{
+ ASSERT(pDocument != NULL);
+
+ CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pDocument->GetInterForm();
+ ASSERT(pInterForm != NULL);
+
+ return pInterForm->DoAction_SubmitForm(action);
+}
+
+FX_BOOL CPDFSDK_FormActionHandler::DoAction_ResetForm(const CPDF_Action& action, CPDFSDK_Document* pDocument)
+{
+ ASSERT(pDocument != NULL);
+
+ CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pDocument->GetInterForm();
+ ASSERT(pInterForm != NULL);
+
+ if (pInterForm->DoAction_ResetForm(action))
+ {
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+FX_BOOL CPDFSDK_FormActionHandler::DoAction_ImportData(const CPDF_Action& action, CPDFSDK_Document* pDocument)
+{
+ ASSERT(pDocument != NULL);
+
+ CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pDocument->GetInterForm();
+ ASSERT(pInterForm != NULL);
+
+ if (pInterForm->DoAction_ImportData(action))
+ {
+ pDocument->SetChangeMark();
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+FX_BOOL CPDFSDK_MediaActionHandler::DoAction_Rendition(const CPDF_Action& action, CPDFSDK_Document* pDocument)
+{
+ return FALSE;
+}
+
+FX_BOOL CPDFSDK_MediaActionHandler::DoAction_Sound(const CPDF_Action& action, CPDFSDK_Document* pDocument)
+{
+ return FALSE;
+}
+
+FX_BOOL CPDFSDK_MediaActionHandler::DoAction_Movie(const CPDF_Action& action, CPDFSDK_Document* pDocument)
+{
+ return FALSE;
+}
+
diff --git a/fpdfsdk/src/fsdk_annothandler.cpp b/fpdfsdk/src/fsdk_annothandler.cpp
index b2a24a8dde..9f208d34e2 100644
--- a/fpdfsdk/src/fsdk_annothandler.cpp
+++ b/fpdfsdk/src/fsdk_annothandler.cpp
@@ -1,945 +1,945 @@
-// 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
-
-#include "../include/fsdk_define.h"
-#include "../include/fsdk_mgr.h"
-#include "../include/formfiller/FFL_FormFiller.h"
-#include "../include/fsdk_annothandler.h"
-
-
-CPDFSDK_AnnotHandlerMgr::CPDFSDK_AnnotHandlerMgr(CPDFDoc_Environment* pApp)
-{
- m_pApp = pApp;
-
- CPDFSDK_BFAnnotHandler* pHandler = new CPDFSDK_BFAnnotHandler(m_pApp);
- pHandler->SetFormFiller(m_pApp->GetIFormFiller());
- RegisterAnnotHandler(pHandler);
-}
-
-CPDFSDK_AnnotHandlerMgr::~CPDFSDK_AnnotHandlerMgr()
-{
- for(int i=0; i<m_Handlers.GetSize(); i++)
- {
- IPDFSDK_AnnotHandler* pHandler = m_Handlers.GetAt(i);
- delete pHandler;
- }
- m_Handlers.RemoveAll();
- m_mapType2Handler.RemoveAll();
-}
-
-void CPDFSDK_AnnotHandlerMgr::RegisterAnnotHandler(IPDFSDK_AnnotHandler* pAnnotHandler)
-{
- ASSERT(pAnnotHandler != NULL);
-
- ASSERT(GetAnnotHandler(pAnnotHandler->GetType()) == NULL);
-
- m_Handlers.Add(pAnnotHandler);
- m_mapType2Handler.SetAt(pAnnotHandler->GetType(), (void*)pAnnotHandler);
-}
-
-void CPDFSDK_AnnotHandlerMgr::UnRegisterAnnotHandler(IPDFSDK_AnnotHandler* pAnnotHandler)
-{
- ASSERT(pAnnotHandler != NULL);
-
- m_mapType2Handler.RemoveKey(pAnnotHandler->GetType());
-
- for (int i=0, sz=m_Handlers.GetSize(); i<sz; i++)
- {
- if (m_Handlers.GetAt(i) == pAnnotHandler)
- {
- m_Handlers.RemoveAt(i);
- break;
- }
- }
-}
-
-CPDFSDK_Annot* CPDFSDK_AnnotHandlerMgr::NewAnnot(CPDF_Annot * pAnnot, CPDFSDK_PageView *pPageView)
-{
- ASSERT(pAnnot != NULL);
- ASSERT(pPageView != NULL);
-
- if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot->GetSubType()))
- {
- return pAnnotHandler->NewAnnot(pAnnot, pPageView);
- }
-
- return new CPDFSDK_Annot(pAnnot, pPageView);
-}
-
-void CPDFSDK_AnnotHandlerMgr::ReleaseAnnot(CPDFSDK_Annot* pAnnot)
-{
- ASSERT(pAnnot != NULL);
-
- pAnnot->GetPDFPage();
-
- if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot))
- {
- pAnnotHandler->OnRelease(pAnnot);
- pAnnotHandler->ReleaseAnnot(pAnnot);
- }
- else
- {
- delete (CPDFSDK_Annot*)pAnnot;
- }
-}
-
-void CPDFSDK_AnnotHandlerMgr::Annot_OnCreate(CPDFSDK_Annot* pAnnot)
-{
- ASSERT(pAnnot != NULL);
-
- CPDF_Annot* pPDFAnnot = pAnnot->GetPDFAnnot();
- ASSERT(pPDFAnnot != NULL);
- ASSERT(pPDFAnnot->m_pAnnotDict != NULL);
-
- CPDFSDK_DateTime curTime;
- pPDFAnnot->m_pAnnotDict->SetAtString("M", curTime.ToPDFDateTimeString());
- pPDFAnnot->m_pAnnotDict->SetAtNumber("F", (int)0);
-
- if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot))
- {
- pAnnotHandler->OnCreate(pAnnot);
- }
-}
-
-void CPDFSDK_AnnotHandlerMgr::Annot_OnLoad(CPDFSDK_Annot* pAnnot)
-{
- ASSERT(pAnnot != NULL);
-
- if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot))
- {
- pAnnotHandler->OnLoad(pAnnot);
- }
-}
-
-IPDFSDK_AnnotHandler* CPDFSDK_AnnotHandlerMgr::GetAnnotHandler(CPDFSDK_Annot* pAnnot) const
-{
- ASSERT(pAnnot != NULL);
-
- CPDF_Annot* pPDFAnnot = pAnnot->GetPDFAnnot();
- ASSERT(pPDFAnnot != NULL);
-
- return GetAnnotHandler(pPDFAnnot->GetSubType());
-}
-
-IPDFSDK_AnnotHandler* CPDFSDK_AnnotHandlerMgr::GetAnnotHandler(const CFX_ByteString& sType) const
-{
- void* pRet = NULL;
- m_mapType2Handler.Lookup(sType, pRet);
- return (IPDFSDK_AnnotHandler*)pRet;
-}
-
-void CPDFSDK_AnnotHandlerMgr::Annot_OnDraw(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,FX_DWORD dwFlags)
-{
- ASSERT(pAnnot != NULL);
-
- if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot))
- {
- pAnnotHandler->OnDraw(pPageView, pAnnot, pDevice, pUser2Device, dwFlags);
- }
- else
- {
- pAnnot->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, NULL);
- }
-}
-
-
-FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnLButtonDown(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
-{
- ASSERT(pAnnot != NULL);
-
- if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot))
- {
- return pAnnotHandler->OnLButtonDown(pPageView, pAnnot, nFlags, point);
- }
- return FALSE;
-}
-FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnLButtonUp(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
- {
- ASSERT(pAnnot != NULL);
-
- if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot))
- {
- return pAnnotHandler->OnLButtonUp(pPageView, pAnnot, nFlags, point);
- }
- return FALSE;
- }
-FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnLButtonDblClk(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
-{
- ASSERT(pAnnot != NULL);
-
- if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot))
- {
- return pAnnotHandler->OnLButtonDblClk(pPageView, pAnnot, nFlags, point);
- }
- return FALSE;
-}
-FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnMouseMove(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
-{
- ASSERT(pAnnot != NULL);
-
- if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot))
- {
- return pAnnotHandler->OnMouseMove(pPageView, pAnnot, nFlags, point);
- }
- return FALSE;
-}
-FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnMouseWheel(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, short zDelta, const CPDF_Point& point)
-{
- ASSERT(pAnnot != NULL);
-
- if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot))
- {
- return pAnnotHandler->OnMouseWheel(pPageView, pAnnot,nFlags,zDelta, point);
- }
- return FALSE;
-}
-FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnRButtonDown(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
-{
- ASSERT(pAnnot != NULL);
-
- if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot))
- {
- return pAnnotHandler->OnRButtonDown(pPageView, pAnnot, nFlags, point);
- }
- return FALSE;
-}
-FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnRButtonUp(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
-{
- ASSERT(pAnnot != NULL);
-
- if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot))
- {
- return pAnnotHandler->OnRButtonUp(pPageView, pAnnot, nFlags, point);
- }
- return FALSE;
-}
-
-void CPDFSDK_AnnotHandlerMgr::Annot_OnMouseEnter(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlag)
-{
- ASSERT(pAnnot != NULL);
-
- if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot))
- {
- pAnnotHandler->OnMouseEnter(pPageView, pAnnot, nFlag);
- }
- return ;
-}
-
-void CPDFSDK_AnnotHandlerMgr::Annot_OnMouseExit(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlag)
-{
- ASSERT(pAnnot != NULL);
-
- if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot))
- {
- pAnnotHandler->OnMouseExit(pPageView, pAnnot, nFlag);
- }
- return;
-}
-
-FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnChar(CPDFSDK_Annot* pAnnot, FX_DWORD nChar, FX_DWORD nFlags)
-{
-
- if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot))
- {
- return pAnnotHandler->OnChar(pAnnot,nChar, nFlags);
- }
- return FALSE;
-
-}
-
-FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnKeyDown(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag)
-{
-
- if (!m_pApp->FFI_IsCTRLKeyDown(nFlag) && !m_pApp->FFI_IsALTKeyDown(nFlag))
- {
- CPDFSDK_PageView* pPage = pAnnot->GetPageView();
- CPDFSDK_Annot* pFocusAnnot = pPage->GetFocusAnnot();
- if (pFocusAnnot && (nKeyCode == FWL_VKEY_Tab))
- {
- CPDFSDK_Annot* pNext = GetNextAnnot(pFocusAnnot, !m_pApp->FFI_IsSHIFTKeyDown(nFlag));
-
- if(pNext && pNext != pFocusAnnot)
- {
- CPDFSDK_Document* pDocument = pPage->GetSDKDocument();
- pDocument->SetFocusAnnot(pNext);
- return TRUE;
- }
- }
- }
-
- if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot))
- {
- return pAnnotHandler->OnKeyDown(pAnnot,nKeyCode, nFlag);
- }
- return FALSE;
-}
-FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnKeyUp(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag)
-{
- return FALSE;
-}
-
-FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnSetFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag)
-{
- ASSERT(pAnnot != NULL);
-
- if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot))
- {
- if (pAnnotHandler->OnSetFocus(pAnnot, nFlag))
- {
- CPDFSDK_PageView* pPage = pAnnot->GetPageView();
- ASSERT(pPage != NULL);
-
- pPage->GetSDKDocument();
- // pDocument->SetTopmostAnnot(pAnnot);
-
- return TRUE;
- }
- else
- {
- return FALSE;
- }
- }
-
- return FALSE;
-}
-
-FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnKillFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag)
-{
- ASSERT(pAnnot != NULL);
-
- if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot))
- {
- if (pAnnotHandler->OnKillFocus(pAnnot, nFlag))
- {
- return TRUE;
- }
- else
- return FALSE;
- }
-
- return FALSE;
-}
-
-CPDF_Rect CPDFSDK_AnnotHandlerMgr::Annot_OnGetViewBBox(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot)
-{
- ASSERT(pAnnot);
- if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot))
- {
- return pAnnotHandler->GetViewBBox(pPageView, pAnnot);
- }
- return pAnnot->GetRect();
-}
-
-FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnHitTest(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, const CPDF_Point& point)
-{
- ASSERT(pAnnot);
- if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot))
- {
- if(pAnnotHandler->CanAnswer(pAnnot))
- return pAnnotHandler->HitTest(pPageView, pAnnot, point);
- }
- return FALSE;
-}
-
-CPDFSDK_Annot* CPDFSDK_AnnotHandlerMgr::GetNextAnnot(CPDFSDK_Annot* pSDKAnnot,FX_BOOL bNext)
-{
- CBA_AnnotIterator ai(pSDKAnnot->GetPageView(), "Widget", "");
-
- CPDFSDK_Annot* pNext = bNext ?
- ai.GetNextAnnot(pSDKAnnot) :
- ai.GetPrevAnnot(pSDKAnnot);
-
- return pNext;
-}
-
-FX_BOOL CPDFSDK_BFAnnotHandler::CanAnswer(CPDFSDK_Annot* pAnnot)
-{
- ASSERT(pAnnot);
- ASSERT(pAnnot->GetType() == "Widget");
- CFX_ByteString sSubType = pAnnot->GetSubType();
-
- if (sSubType == BFFT_SIGNATURE)
- {
- }
- else
- {
- CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
- if (!pWidget->IsVisible()) return FALSE;
-
- int nFieldFlags = pWidget->GetFieldFlags();
- if ((nFieldFlags & FIELDFLAG_READONLY) == FIELDFLAG_READONLY) return FALSE;
- if (pWidget->GetFieldType() == FIELDTYPE_PUSHBUTTON)
- return TRUE;
- else
- {
- CPDF_Page* pPage = pWidget->GetPDFPage();
- ASSERT(pPage != NULL);
-
- CPDF_Document* pDocument = pPage->m_pDocument;
- ASSERT(pDocument != NULL);
-
- FX_DWORD dwPermissions = pDocument->GetUserPermissions();
- return (dwPermissions&FPDFPERM_FILL_FORM) ||
- (dwPermissions&FPDFPERM_ANNOT_FORM) ||
- (dwPermissions&FPDFPERM_ANNOT_FORM);
- }
- }
-
- return FALSE;
-}
-
-CPDFSDK_Annot* CPDFSDK_BFAnnotHandler::NewAnnot(CPDF_Annot* pAnnot, CPDFSDK_PageView* pPage)
-{
- ASSERT(pPage != NULL);
- pPage->GetPDFDocument();
-
- CPDFSDK_Document* pSDKDoc = m_pApp->GetCurrentDoc();
- ASSERT(pSDKDoc);
- CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pSDKDoc->GetInterForm();
- ASSERT(pInterForm != NULL);
-
- CPDFSDK_Widget* pWidget = NULL;
- if (CPDF_FormControl* pCtrl = CPDFSDK_Widget::GetFormControl(pInterForm->GetInterForm(), pAnnot->m_pAnnotDict))
- {
- pWidget = new CPDFSDK_Widget(pAnnot, pPage, pInterForm);
- pInterForm->AddMap(pCtrl, pWidget);
- CPDF_InterForm* pPDFInterForm = pInterForm->GetInterForm();
- if(pPDFInterForm && pPDFInterForm->NeedConstructAP())
- pWidget->ResetAppearance(NULL,FALSE);
- }
-
- return pWidget;
-}
-
-void CPDFSDK_BFAnnotHandler::ReleaseAnnot(CPDFSDK_Annot* pAnnot)
-{
- ASSERT(pAnnot != NULL);
-
- if (m_pFormFiller)
- m_pFormFiller->OnDelete(pAnnot);
-
- CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
- CPDFSDK_InterForm* pInterForm = pWidget->GetInterForm();
- ASSERT(pInterForm != NULL);
-
- CPDF_FormControl* pCtrol = pWidget->GetFormControl();
- pInterForm->RemoveMap(pCtrol);
-
-
- delete pWidget;
-}
-
-
-void CPDFSDK_BFAnnotHandler::OnDraw(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, FX_DWORD dwFlags)
-{
- ASSERT(pAnnot != NULL);
- CFX_ByteString sSubType = pAnnot->GetSubType();
-
- if (sSubType == BFFT_SIGNATURE)
- {
- pAnnot->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, NULL);
- }
- else
- {
- if (m_pFormFiller)
- {
- m_pFormFiller->OnDraw(pPageView, pAnnot, pDevice, pUser2Device, dwFlags);
- }
- }
-}
-
-void CPDFSDK_BFAnnotHandler::OnMouseEnter(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlag)
-{
- ASSERT(pAnnot != NULL);
- CFX_ByteString sSubType = pAnnot->GetSubType();
-
- if (sSubType == BFFT_SIGNATURE)
- {
- }
- else
- {
- if (m_pFormFiller)
- m_pFormFiller->OnMouseEnter(pPageView, pAnnot, nFlag);
- }
-
-
-}
-void CPDFSDK_BFAnnotHandler::OnMouseExit(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlag)
-{
- ASSERT(pAnnot != NULL);
- CFX_ByteString sSubType = pAnnot->GetSubType();
-
- if (sSubType == BFFT_SIGNATURE)
- {
- }
- else
- {
- if (m_pFormFiller)
- m_pFormFiller->OnMouseExit(pPageView, pAnnot, nFlag);
- }
-
-}
-FX_BOOL CPDFSDK_BFAnnotHandler::OnLButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
-{
- ASSERT(pAnnot != NULL);
- CFX_ByteString sSubType = pAnnot->GetSubType();
-
- if (sSubType == BFFT_SIGNATURE)
- {
- }
- else
- {
- if (m_pFormFiller)
- return m_pFormFiller->OnLButtonDown(pPageView, pAnnot, nFlags, point);
- }
-
- return FALSE;
-}
-
-FX_BOOL CPDFSDK_BFAnnotHandler::OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
-{
- ASSERT(pAnnot != NULL);
- CFX_ByteString sSubType = pAnnot->GetSubType();
-
- if (sSubType == BFFT_SIGNATURE)
- {
- }
- else
- {
- if (m_pFormFiller)
- return m_pFormFiller->OnLButtonUp(pPageView, pAnnot, nFlags, point);
- }
-
- return FALSE;
-}
-
-FX_BOOL CPDFSDK_BFAnnotHandler::OnLButtonDblClk(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
-{
- ASSERT(pAnnot != NULL);
- CFX_ByteString sSubType = pAnnot->GetSubType();
-
- if (sSubType == BFFT_SIGNATURE)
- {
- }
- else
- {
- if (m_pFormFiller)
- return m_pFormFiller->OnLButtonDblClk(pPageView, pAnnot, nFlags, point);
- }
-
- return FALSE;
-}
-
-FX_BOOL CPDFSDK_BFAnnotHandler::OnMouseMove(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
-{
- ASSERT(pAnnot != NULL);
- CFX_ByteString sSubType = pAnnot->GetSubType();
-
- if (sSubType == BFFT_SIGNATURE)
- {
- }
- else
- {
- if (m_pFormFiller)
- return m_pFormFiller->OnMouseMove(pPageView, pAnnot, nFlags, point);
- }
-
- return FALSE;
-
-}
-
-
-FX_BOOL CPDFSDK_BFAnnotHandler::OnMouseWheel(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, short zDelta, const CPDF_Point& point)
-{
- ASSERT(pAnnot != NULL);
- CFX_ByteString sSubType = pAnnot->GetSubType();
-
- if (sSubType == BFFT_SIGNATURE)
- {
- }
- else
- {
- if (m_pFormFiller)
- return m_pFormFiller->OnMouseWheel(pPageView, pAnnot, nFlags, zDelta,point);
- }
-
- return FALSE;
-}
-
-FX_BOOL CPDFSDK_BFAnnotHandler::OnRButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
-{
- ASSERT(pAnnot != NULL);
- CFX_ByteString sSubType = pAnnot->GetSubType();
-
- if (sSubType == BFFT_SIGNATURE)
- {
- }
- else
- {
- if (m_pFormFiller)
- return m_pFormFiller->OnRButtonDown(pPageView, pAnnot, nFlags, point);
- }
-
- return FALSE;
-}
-FX_BOOL CPDFSDK_BFAnnotHandler::OnRButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
-{
- ASSERT(pAnnot != NULL);
- CFX_ByteString sSubType = pAnnot->GetSubType();
-
- if (sSubType == BFFT_SIGNATURE)
- {
- }
- else
- {
- if (m_pFormFiller)
- return m_pFormFiller->OnRButtonUp(pPageView, pAnnot, nFlags, point);
- }
-
- return FALSE;
-}
-
-FX_BOOL CPDFSDK_BFAnnotHandler::OnChar(CPDFSDK_Annot* pAnnot, FX_DWORD nChar, FX_DWORD nFlags)
-{
- ASSERT(pAnnot != NULL);
- CFX_ByteString sSubType = pAnnot->GetSubType();
-
- if (sSubType == BFFT_SIGNATURE)
- {
- }
- else
- {
- if (m_pFormFiller)
- return m_pFormFiller->OnChar(pAnnot,nChar, nFlags);
- }
-
- return FALSE;
-}
-
-FX_BOOL CPDFSDK_BFAnnotHandler::OnKeyDown(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag)
-{
- ASSERT(pAnnot != NULL);
- CFX_ByteString sSubType = pAnnot->GetSubType();
-
- if (sSubType == BFFT_SIGNATURE)
- {
- }
- else
- {
- if (m_pFormFiller)
- return m_pFormFiller->OnKeyDown(pAnnot,nKeyCode, nFlag);
- }
-
- return FALSE;
-}
-
-FX_BOOL CPDFSDK_BFAnnotHandler::OnKeyUp(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag)
-{
-
- return FALSE;
-}
-void CPDFSDK_BFAnnotHandler::OnCreate(CPDFSDK_Annot* pAnnot)
-{
- ASSERT(pAnnot != NULL);
- CFX_ByteString sSubType = pAnnot->GetSubType();
-
- if (sSubType == BFFT_SIGNATURE)
- {
- }
- else
- {
- if (m_pFormFiller)
- m_pFormFiller->OnCreate(pAnnot);
- }
-}
-
-void CPDFSDK_BFAnnotHandler::OnLoad(CPDFSDK_Annot* pAnnot)
-{
- ASSERT(pAnnot != NULL);
-
- CFX_ByteString sSubType = pAnnot->GetSubType();
-
- if (sSubType == BFFT_SIGNATURE)
- {
- }
- else
- {
- CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
-
- if (!pWidget->IsAppearanceValid())
- pWidget->ResetAppearance(NULL, FALSE);
-
- int nFieldType = pWidget->GetFieldType();
-
- if (nFieldType == FIELDTYPE_TEXTFIELD || nFieldType == FIELDTYPE_COMBOBOX)
- {
- FX_BOOL bFormated = FALSE;
- CFX_WideString sValue = pWidget->OnFormat(0, bFormated);
-
- if (bFormated && nFieldType == FIELDTYPE_COMBOBOX)
- {
- pWidget->ResetAppearance(sValue, FALSE);
- }
- }
-
-
- if (m_pFormFiller)
- m_pFormFiller->OnLoad(pAnnot);
-
- }
-}
-
-FX_BOOL CPDFSDK_BFAnnotHandler::OnSetFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag)
-{
- ASSERT(pAnnot != NULL);
- CFX_ByteString sSubType = pAnnot->GetSubType();
-
- if (sSubType == BFFT_SIGNATURE)
- {
- }
- else
- {
- if (m_pFormFiller)
- return m_pFormFiller->OnSetFocus(pAnnot,nFlag);
- }
-
- return TRUE;
-}
-FX_BOOL CPDFSDK_BFAnnotHandler::OnKillFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag)
-{
- ASSERT(pAnnot != NULL);
- CFX_ByteString sSubType = pAnnot->GetSubType();
-
- if (sSubType == BFFT_SIGNATURE)
- {
- }
- else
- {
- if (m_pFormFiller)
- return m_pFormFiller->OnKillFocus(pAnnot,nFlag);
- }
-
- return TRUE;
-}
-
-CPDF_Rect CPDFSDK_BFAnnotHandler::GetViewBBox(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot)
-{
- ASSERT(pAnnot != NULL);
- CFX_ByteString sSubType = pAnnot->GetSubType();
-
- if (sSubType == BFFT_SIGNATURE)
- {
- }
- else
- {
- if (m_pFormFiller)
- return m_pFormFiller->GetViewBBox(pPageView, pAnnot);
-
- }
-
- return CPDF_Rect(0,0,0,0);
-}
-
-FX_BOOL CPDFSDK_BFAnnotHandler::HitTest(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, const CPDF_Point& point)
-{
- ASSERT(pPageView);
- ASSERT(pAnnot);
-
- CPDF_Rect rect = GetViewBBox(pPageView, pAnnot);
- return rect.Contains(point.x, point.y);
-}
-
-//CReader_AnnotIteratorEx
-
-CPDFSDK_AnnotIterator::CPDFSDK_AnnotIterator(CPDFSDK_PageView * pPageView,FX_BOOL bReverse,
- FX_BOOL bIgnoreTopmost/*=FALSE*/,
- FX_BOOL bCircle/*=FALSE*/,
- CFX_PtrArray *pList/*=NULL*/)
-{
- ASSERT(pPageView);
- m_bReverse=bReverse;
- m_bIgnoreTopmost= bIgnoreTopmost;
- m_bCircle=bCircle;
- m_pIteratorAnnotList.RemoveAll();
- InitIteratorAnnotList(pPageView,pList);
-}
-
-CPDFSDK_Annot* CPDFSDK_AnnotIterator::NextAnnot (const CPDFSDK_Annot* pCurrent)
-{
-
- int index=-1;
- int nCount=this->m_pIteratorAnnotList.GetSize();
- if(pCurrent){
- for(int i=0;i<nCount;i++){
- CPDFSDK_Annot * pReaderAnnot= (CPDFSDK_Annot *)m_pIteratorAnnotList.GetAt(i);
- if(pReaderAnnot ==pCurrent){
- index=i;
- break;
- }
- }
- }
- return NextAnnot(index);
-}
-CPDFSDK_Annot* CPDFSDK_AnnotIterator::PrevAnnot (const CPDFSDK_Annot*pCurrent)
-{
-
- int index=-1;
- int nCount=this->m_pIteratorAnnotList.GetSize();
- if(pCurrent){
- for(int i=0;i<nCount;i++){
- CPDFSDK_Annot * pReaderAnnot= (CPDFSDK_Annot*)m_pIteratorAnnotList.GetAt(i);
- if(pReaderAnnot ==pCurrent){
- index=i;
- break;
- }
- }
- }
- return PrevAnnot(index);
-}
-CPDFSDK_Annot* CPDFSDK_AnnotIterator::NextAnnot (int& index)
-{
-
- int nCount=m_pIteratorAnnotList.GetSize();
- if(nCount<=0) index=-1;
- else{
- if(index<0){
- index=0;
- }
- else{
- if(m_bCircle){
- index=( index <nCount-1) ? (index+1) :0;
- }
- else{
- index=( index <nCount-1) ? (index+1) :-1;
- }
-
- }
- }
- return (index <0) ? NULL : (CPDFSDK_Annot*)m_pIteratorAnnotList.GetAt(index);
-}
-
-
-CPDFSDK_Annot* CPDFSDK_AnnotIterator::PrevAnnot (int& index)
-{
-
- int nCount=m_pIteratorAnnotList.GetSize();
- if(nCount<=0) index=-1;
- else{
- if(index<0){
- index=nCount-1;
- }
- else{
- if(m_bCircle){
- index = ( index >0) ? (index-1) :nCount-1;
- }
- else{
- index = ( index >0) ? (index-1) :-1;
- }
- }
- }
- return (index <0) ? NULL : (CPDFSDK_Annot*)m_pIteratorAnnotList.GetAt(index);
-}
-
-
-CPDFSDK_Annot*CPDFSDK_AnnotIterator::Next(const CPDFSDK_Annot* pCurrent)
-{
-
- return (m_bReverse) ? PrevAnnot(pCurrent):NextAnnot(pCurrent);
-
-}
-
-CPDFSDK_Annot* CPDFSDK_AnnotIterator::Prev(const CPDFSDK_Annot* pCurrent)
-{
-
- return (m_bReverse) ? NextAnnot(pCurrent):PrevAnnot(pCurrent);
-}
-
-CPDFSDK_Annot*CPDFSDK_AnnotIterator::Next(int& index )
-{
-
- return (m_bReverse) ? PrevAnnot(index):NextAnnot(index);
-
-}
-
-CPDFSDK_Annot* CPDFSDK_AnnotIterator::Prev(int& index )
-{
-
- return (m_bReverse) ? NextAnnot(index):PrevAnnot(index);
-}
-
-
-void CPDFSDK_AnnotIterator::InsertSort(CFX_PtrArray &arrayList, AI_COMPARE pCompare)
-{
- for (int i = 1; i < arrayList.GetSize(); i++)
- {
- if (pCompare((CPDFSDK_Annot*)(arrayList[i]) , (CPDFSDK_Annot*)(arrayList[i-1])) < 0)
- {
- int j = i-1;
- CPDFSDK_Annot* pTemp = (CPDFSDK_Annot*)arrayList[i];
-
- do
- {
- arrayList[j + 1] = arrayList[j];
- } while (--j >= 0 && pCompare(pTemp, (CPDFSDK_Annot*)arrayList[j]) < 0);
-
- arrayList[j+1] = pTemp;
- }
- }
-}
-
-int LyOrderCompare(CPDFSDK_Annot* p1, CPDFSDK_Annot* p2)
-{
- if(p1->GetLayoutOrder() < p2->GetLayoutOrder())
- return -1;
- else if (p1->GetLayoutOrder() == p2->GetLayoutOrder())
- return 0;
- else
- return 1;
-}
-
-FX_BOOL CPDFSDK_AnnotIterator::InitIteratorAnnotList(CPDFSDK_PageView* pPageView,CFX_PtrArray * pAnnotList)
-{
- ASSERT(pPageView);
-
-
-
- if(pAnnotList==NULL){
- pAnnotList=pPageView->GetAnnotList();
- }
-
- this->m_pIteratorAnnotList.RemoveAll();
- if(!pAnnotList) return FALSE;
-
- CPDFSDK_Annot * pTopMostAnnot= (m_bIgnoreTopmost) ? NULL : pPageView->GetFocusAnnot();
-
-
- int nCount =pAnnotList->GetSize();
-
- for(int i = nCount- 1 ;i >= 0;i--)
- {
- CPDFSDK_Annot * pReaderAnnot= (CPDFSDK_Annot*)pAnnotList->GetAt(i);
- m_pIteratorAnnotList.Add(pReaderAnnot);
- }
-
- InsertSort(m_pIteratorAnnotList,&LyOrderCompare);
-
- if(pTopMostAnnot)
- {
- for(int i=0 ;i<nCount;i++)
- {
- CPDFSDK_Annot * pReaderAnnot = (CPDFSDK_Annot*)m_pIteratorAnnotList.GetAt(i);
- if(pReaderAnnot == pTopMostAnnot)
- {
- m_pIteratorAnnotList.RemoveAt(i);
- m_pIteratorAnnotList.InsertAt(0, pReaderAnnot);
- break;
- }
- }
- }
-
- return TRUE;
-}
-
+// 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
+
+#include "../include/fsdk_define.h"
+#include "../include/fsdk_mgr.h"
+#include "../include/formfiller/FFL_FormFiller.h"
+#include "../include/fsdk_annothandler.h"
+
+
+CPDFSDK_AnnotHandlerMgr::CPDFSDK_AnnotHandlerMgr(CPDFDoc_Environment* pApp)
+{
+ m_pApp = pApp;
+
+ CPDFSDK_BFAnnotHandler* pHandler = new CPDFSDK_BFAnnotHandler(m_pApp);
+ pHandler->SetFormFiller(m_pApp->GetIFormFiller());
+ RegisterAnnotHandler(pHandler);
+}
+
+CPDFSDK_AnnotHandlerMgr::~CPDFSDK_AnnotHandlerMgr()
+{
+ for(int i=0; i<m_Handlers.GetSize(); i++)
+ {
+ IPDFSDK_AnnotHandler* pHandler = m_Handlers.GetAt(i);
+ delete pHandler;
+ }
+ m_Handlers.RemoveAll();
+ m_mapType2Handler.RemoveAll();
+}
+
+void CPDFSDK_AnnotHandlerMgr::RegisterAnnotHandler(IPDFSDK_AnnotHandler* pAnnotHandler)
+{
+ ASSERT(pAnnotHandler != NULL);
+
+ ASSERT(GetAnnotHandler(pAnnotHandler->GetType()) == NULL);
+
+ m_Handlers.Add(pAnnotHandler);
+ m_mapType2Handler.SetAt(pAnnotHandler->GetType(), (void*)pAnnotHandler);
+}
+
+void CPDFSDK_AnnotHandlerMgr::UnRegisterAnnotHandler(IPDFSDK_AnnotHandler* pAnnotHandler)
+{
+ ASSERT(pAnnotHandler != NULL);
+
+ m_mapType2Handler.RemoveKey(pAnnotHandler->GetType());
+
+ for (int i=0, sz=m_Handlers.GetSize(); i<sz; i++)
+ {
+ if (m_Handlers.GetAt(i) == pAnnotHandler)
+ {
+ m_Handlers.RemoveAt(i);
+ break;
+ }
+ }
+}
+
+CPDFSDK_Annot* CPDFSDK_AnnotHandlerMgr::NewAnnot(CPDF_Annot * pAnnot, CPDFSDK_PageView *pPageView)
+{
+ ASSERT(pAnnot != NULL);
+ ASSERT(pPageView != NULL);
+
+ if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot->GetSubType()))
+ {
+ return pAnnotHandler->NewAnnot(pAnnot, pPageView);
+ }
+
+ return new CPDFSDK_Annot(pAnnot, pPageView);
+}
+
+void CPDFSDK_AnnotHandlerMgr::ReleaseAnnot(CPDFSDK_Annot* pAnnot)
+{
+ ASSERT(pAnnot != NULL);
+
+ pAnnot->GetPDFPage();
+
+ if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot))
+ {
+ pAnnotHandler->OnRelease(pAnnot);
+ pAnnotHandler->ReleaseAnnot(pAnnot);
+ }
+ else
+ {
+ delete (CPDFSDK_Annot*)pAnnot;
+ }
+}
+
+void CPDFSDK_AnnotHandlerMgr::Annot_OnCreate(CPDFSDK_Annot* pAnnot)
+{
+ ASSERT(pAnnot != NULL);
+
+ CPDF_Annot* pPDFAnnot = pAnnot->GetPDFAnnot();
+ ASSERT(pPDFAnnot != NULL);
+ ASSERT(pPDFAnnot->m_pAnnotDict != NULL);
+
+ CPDFSDK_DateTime curTime;
+ pPDFAnnot->m_pAnnotDict->SetAtString("M", curTime.ToPDFDateTimeString());
+ pPDFAnnot->m_pAnnotDict->SetAtNumber("F", (int)0);
+
+ if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot))
+ {
+ pAnnotHandler->OnCreate(pAnnot);
+ }
+}
+
+void CPDFSDK_AnnotHandlerMgr::Annot_OnLoad(CPDFSDK_Annot* pAnnot)
+{
+ ASSERT(pAnnot != NULL);
+
+ if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot))
+ {
+ pAnnotHandler->OnLoad(pAnnot);
+ }
+}
+
+IPDFSDK_AnnotHandler* CPDFSDK_AnnotHandlerMgr::GetAnnotHandler(CPDFSDK_Annot* pAnnot) const
+{
+ ASSERT(pAnnot != NULL);
+
+ CPDF_Annot* pPDFAnnot = pAnnot->GetPDFAnnot();
+ ASSERT(pPDFAnnot != NULL);
+
+ return GetAnnotHandler(pPDFAnnot->GetSubType());
+}
+
+IPDFSDK_AnnotHandler* CPDFSDK_AnnotHandlerMgr::GetAnnotHandler(const CFX_ByteString& sType) const
+{
+ void* pRet = NULL;
+ m_mapType2Handler.Lookup(sType, pRet);
+ return (IPDFSDK_AnnotHandler*)pRet;
+}
+
+void CPDFSDK_AnnotHandlerMgr::Annot_OnDraw(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,FX_DWORD dwFlags)
+{
+ ASSERT(pAnnot != NULL);
+
+ if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot))
+ {
+ pAnnotHandler->OnDraw(pPageView, pAnnot, pDevice, pUser2Device, dwFlags);
+ }
+ else
+ {
+ pAnnot->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, NULL);
+ }
+}
+
+
+FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnLButtonDown(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
+{
+ ASSERT(pAnnot != NULL);
+
+ if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot))
+ {
+ return pAnnotHandler->OnLButtonDown(pPageView, pAnnot, nFlags, point);
+ }
+ return FALSE;
+}
+FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnLButtonUp(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
+ {
+ ASSERT(pAnnot != NULL);
+
+ if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot))
+ {
+ return pAnnotHandler->OnLButtonUp(pPageView, pAnnot, nFlags, point);
+ }
+ return FALSE;
+ }
+FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnLButtonDblClk(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
+{
+ ASSERT(pAnnot != NULL);
+
+ if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot))
+ {
+ return pAnnotHandler->OnLButtonDblClk(pPageView, pAnnot, nFlags, point);
+ }
+ return FALSE;
+}
+FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnMouseMove(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
+{
+ ASSERT(pAnnot != NULL);
+
+ if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot))
+ {
+ return pAnnotHandler->OnMouseMove(pPageView, pAnnot, nFlags, point);
+ }
+ return FALSE;
+}
+FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnMouseWheel(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, short zDelta, const CPDF_Point& point)
+{
+ ASSERT(pAnnot != NULL);
+
+ if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot))
+ {
+ return pAnnotHandler->OnMouseWheel(pPageView, pAnnot,nFlags,zDelta, point);
+ }
+ return FALSE;
+}
+FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnRButtonDown(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
+{
+ ASSERT(pAnnot != NULL);
+
+ if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot))
+ {
+ return pAnnotHandler->OnRButtonDown(pPageView, pAnnot, nFlags, point);
+ }
+ return FALSE;
+}
+FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnRButtonUp(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
+{
+ ASSERT(pAnnot != NULL);
+
+ if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot))
+ {
+ return pAnnotHandler->OnRButtonUp(pPageView, pAnnot, nFlags, point);
+ }
+ return FALSE;
+}
+
+void CPDFSDK_AnnotHandlerMgr::Annot_OnMouseEnter(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlag)
+{
+ ASSERT(pAnnot != NULL);
+
+ if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot))
+ {
+ pAnnotHandler->OnMouseEnter(pPageView, pAnnot, nFlag);
+ }
+ return ;
+}
+
+void CPDFSDK_AnnotHandlerMgr::Annot_OnMouseExit(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlag)
+{
+ ASSERT(pAnnot != NULL);
+
+ if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot))
+ {
+ pAnnotHandler->OnMouseExit(pPageView, pAnnot, nFlag);
+ }
+ return;
+}
+
+FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnChar(CPDFSDK_Annot* pAnnot, FX_DWORD nChar, FX_DWORD nFlags)
+{
+
+ if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot))
+ {
+ return pAnnotHandler->OnChar(pAnnot,nChar, nFlags);
+ }
+ return FALSE;
+
+}
+
+FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnKeyDown(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag)
+{
+
+ if (!m_pApp->FFI_IsCTRLKeyDown(nFlag) && !m_pApp->FFI_IsALTKeyDown(nFlag))
+ {
+ CPDFSDK_PageView* pPage = pAnnot->GetPageView();
+ CPDFSDK_Annot* pFocusAnnot = pPage->GetFocusAnnot();
+ if (pFocusAnnot && (nKeyCode == FWL_VKEY_Tab))
+ {
+ CPDFSDK_Annot* pNext = GetNextAnnot(pFocusAnnot, !m_pApp->FFI_IsSHIFTKeyDown(nFlag));
+
+ if(pNext && pNext != pFocusAnnot)
+ {
+ CPDFSDK_Document* pDocument = pPage->GetSDKDocument();
+ pDocument->SetFocusAnnot(pNext);
+ return TRUE;
+ }
+ }
+ }
+
+ if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot))
+ {
+ return pAnnotHandler->OnKeyDown(pAnnot,nKeyCode, nFlag);
+ }
+ return FALSE;
+}
+FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnKeyUp(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag)
+{
+ return FALSE;
+}
+
+FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnSetFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag)
+{
+ ASSERT(pAnnot != NULL);
+
+ if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot))
+ {
+ if (pAnnotHandler->OnSetFocus(pAnnot, nFlag))
+ {
+ CPDFSDK_PageView* pPage = pAnnot->GetPageView();
+ ASSERT(pPage != NULL);
+
+ pPage->GetSDKDocument();
+ // pDocument->SetTopmostAnnot(pAnnot);
+
+ return TRUE;
+ }
+ else
+ {
+ return FALSE;
+ }
+ }
+
+ return FALSE;
+}
+
+FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnKillFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag)
+{
+ ASSERT(pAnnot != NULL);
+
+ if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot))
+ {
+ if (pAnnotHandler->OnKillFocus(pAnnot, nFlag))
+ {
+ return TRUE;
+ }
+ else
+ return FALSE;
+ }
+
+ return FALSE;
+}
+
+CPDF_Rect CPDFSDK_AnnotHandlerMgr::Annot_OnGetViewBBox(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot)
+{
+ ASSERT(pAnnot);
+ if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot))
+ {
+ return pAnnotHandler->GetViewBBox(pPageView, pAnnot);
+ }
+ return pAnnot->GetRect();
+}
+
+FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnHitTest(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, const CPDF_Point& point)
+{
+ ASSERT(pAnnot);
+ if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot))
+ {
+ if(pAnnotHandler->CanAnswer(pAnnot))
+ return pAnnotHandler->HitTest(pPageView, pAnnot, point);
+ }
+ return FALSE;
+}
+
+CPDFSDK_Annot* CPDFSDK_AnnotHandlerMgr::GetNextAnnot(CPDFSDK_Annot* pSDKAnnot,FX_BOOL bNext)
+{
+ CBA_AnnotIterator ai(pSDKAnnot->GetPageView(), "Widget", "");
+
+ CPDFSDK_Annot* pNext = bNext ?
+ ai.GetNextAnnot(pSDKAnnot) :
+ ai.GetPrevAnnot(pSDKAnnot);
+
+ return pNext;
+}
+
+FX_BOOL CPDFSDK_BFAnnotHandler::CanAnswer(CPDFSDK_Annot* pAnnot)
+{
+ ASSERT(pAnnot);
+ ASSERT(pAnnot->GetType() == "Widget");
+ CFX_ByteString sSubType = pAnnot->GetSubType();
+
+ if (sSubType == BFFT_SIGNATURE)
+ {
+ }
+ else
+ {
+ CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
+ if (!pWidget->IsVisible()) return FALSE;
+
+ int nFieldFlags = pWidget->GetFieldFlags();
+ if ((nFieldFlags & FIELDFLAG_READONLY) == FIELDFLAG_READONLY) return FALSE;
+ if (pWidget->GetFieldType() == FIELDTYPE_PUSHBUTTON)
+ return TRUE;
+ else
+ {
+ CPDF_Page* pPage = pWidget->GetPDFPage();
+ ASSERT(pPage != NULL);
+
+ CPDF_Document* pDocument = pPage->m_pDocument;
+ ASSERT(pDocument != NULL);
+
+ FX_DWORD dwPermissions = pDocument->GetUserPermissions();
+ return (dwPermissions&FPDFPERM_FILL_FORM) ||
+ (dwPermissions&FPDFPERM_ANNOT_FORM) ||
+ (dwPermissions&FPDFPERM_ANNOT_FORM);
+ }
+ }
+
+ return FALSE;
+}
+
+CPDFSDK_Annot* CPDFSDK_BFAnnotHandler::NewAnnot(CPDF_Annot* pAnnot, CPDFSDK_PageView* pPage)
+{
+ ASSERT(pPage != NULL);
+ pPage->GetPDFDocument();
+
+ CPDFSDK_Document* pSDKDoc = m_pApp->GetCurrentDoc();
+ ASSERT(pSDKDoc);
+ CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pSDKDoc->GetInterForm();
+ ASSERT(pInterForm != NULL);
+
+ CPDFSDK_Widget* pWidget = NULL;
+ if (CPDF_FormControl* pCtrl = CPDFSDK_Widget::GetFormControl(pInterForm->GetInterForm(), pAnnot->m_pAnnotDict))
+ {
+ pWidget = new CPDFSDK_Widget(pAnnot, pPage, pInterForm);
+ pInterForm->AddMap(pCtrl, pWidget);
+ CPDF_InterForm* pPDFInterForm = pInterForm->GetInterForm();
+ if(pPDFInterForm && pPDFInterForm->NeedConstructAP())
+ pWidget->ResetAppearance(NULL,FALSE);
+ }
+
+ return pWidget;
+}
+
+void CPDFSDK_BFAnnotHandler::ReleaseAnnot(CPDFSDK_Annot* pAnnot)
+{
+ ASSERT(pAnnot != NULL);
+
+ if (m_pFormFiller)
+ m_pFormFiller->OnDelete(pAnnot);
+
+ CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
+ CPDFSDK_InterForm* pInterForm = pWidget->GetInterForm();
+ ASSERT(pInterForm != NULL);
+
+ CPDF_FormControl* pCtrol = pWidget->GetFormControl();
+ pInterForm->RemoveMap(pCtrol);
+
+
+ delete pWidget;
+}
+
+
+void CPDFSDK_BFAnnotHandler::OnDraw(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, FX_DWORD dwFlags)
+{
+ ASSERT(pAnnot != NULL);
+ CFX_ByteString sSubType = pAnnot->GetSubType();
+
+ if (sSubType == BFFT_SIGNATURE)
+ {
+ pAnnot->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, NULL);
+ }
+ else
+ {
+ if (m_pFormFiller)
+ {
+ m_pFormFiller->OnDraw(pPageView, pAnnot, pDevice, pUser2Device, dwFlags);
+ }
+ }
+}
+
+void CPDFSDK_BFAnnotHandler::OnMouseEnter(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlag)
+{
+ ASSERT(pAnnot != NULL);
+ CFX_ByteString sSubType = pAnnot->GetSubType();
+
+ if (sSubType == BFFT_SIGNATURE)
+ {
+ }
+ else
+ {
+ if (m_pFormFiller)
+ m_pFormFiller->OnMouseEnter(pPageView, pAnnot, nFlag);
+ }
+
+
+}
+void CPDFSDK_BFAnnotHandler::OnMouseExit(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlag)
+{
+ ASSERT(pAnnot != NULL);
+ CFX_ByteString sSubType = pAnnot->GetSubType();
+
+ if (sSubType == BFFT_SIGNATURE)
+ {
+ }
+ else
+ {
+ if (m_pFormFiller)
+ m_pFormFiller->OnMouseExit(pPageView, pAnnot, nFlag);
+ }
+
+}
+FX_BOOL CPDFSDK_BFAnnotHandler::OnLButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
+{
+ ASSERT(pAnnot != NULL);
+ CFX_ByteString sSubType = pAnnot->GetSubType();
+
+ if (sSubType == BFFT_SIGNATURE)
+ {
+ }
+ else
+ {
+ if (m_pFormFiller)
+ return m_pFormFiller->OnLButtonDown(pPageView, pAnnot, nFlags, point);
+ }
+
+ return FALSE;
+}
+
+FX_BOOL CPDFSDK_BFAnnotHandler::OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
+{
+ ASSERT(pAnnot != NULL);
+ CFX_ByteString sSubType = pAnnot->GetSubType();
+
+ if (sSubType == BFFT_SIGNATURE)
+ {
+ }
+ else
+ {
+ if (m_pFormFiller)
+ return m_pFormFiller->OnLButtonUp(pPageView, pAnnot, nFlags, point);
+ }
+
+ return FALSE;
+}
+
+FX_BOOL CPDFSDK_BFAnnotHandler::OnLButtonDblClk(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
+{
+ ASSERT(pAnnot != NULL);
+ CFX_ByteString sSubType = pAnnot->GetSubType();
+
+ if (sSubType == BFFT_SIGNATURE)
+ {
+ }
+ else
+ {
+ if (m_pFormFiller)
+ return m_pFormFiller->OnLButtonDblClk(pPageView, pAnnot, nFlags, point);
+ }
+
+ return FALSE;
+}
+
+FX_BOOL CPDFSDK_BFAnnotHandler::OnMouseMove(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
+{
+ ASSERT(pAnnot != NULL);
+ CFX_ByteString sSubType = pAnnot->GetSubType();
+
+ if (sSubType == BFFT_SIGNATURE)
+ {
+ }
+ else
+ {
+ if (m_pFormFiller)
+ return m_pFormFiller->OnMouseMove(pPageView, pAnnot, nFlags, point);
+ }
+
+ return FALSE;
+
+}
+
+
+FX_BOOL CPDFSDK_BFAnnotHandler::OnMouseWheel(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, short zDelta, const CPDF_Point& point)
+{
+ ASSERT(pAnnot != NULL);
+ CFX_ByteString sSubType = pAnnot->GetSubType();
+
+ if (sSubType == BFFT_SIGNATURE)
+ {
+ }
+ else
+ {
+ if (m_pFormFiller)
+ return m_pFormFiller->OnMouseWheel(pPageView, pAnnot, nFlags, zDelta,point);
+ }
+
+ return FALSE;
+}
+
+FX_BOOL CPDFSDK_BFAnnotHandler::OnRButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
+{
+ ASSERT(pAnnot != NULL);
+ CFX_ByteString sSubType = pAnnot->GetSubType();
+
+ if (sSubType == BFFT_SIGNATURE)
+ {
+ }
+ else
+ {
+ if (m_pFormFiller)
+ return m_pFormFiller->OnRButtonDown(pPageView, pAnnot, nFlags, point);
+ }
+
+ return FALSE;
+}
+FX_BOOL CPDFSDK_BFAnnotHandler::OnRButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point)
+{
+ ASSERT(pAnnot != NULL);
+ CFX_ByteString sSubType = pAnnot->GetSubType();
+
+ if (sSubType == BFFT_SIGNATURE)
+ {
+ }
+ else
+ {
+ if (m_pFormFiller)
+ return m_pFormFiller->OnRButtonUp(pPageView, pAnnot, nFlags, point);
+ }
+
+ return FALSE;
+}
+
+FX_BOOL CPDFSDK_BFAnnotHandler::OnChar(CPDFSDK_Annot* pAnnot, FX_DWORD nChar, FX_DWORD nFlags)
+{
+ ASSERT(pAnnot != NULL);
+ CFX_ByteString sSubType = pAnnot->GetSubType();
+
+ if (sSubType == BFFT_SIGNATURE)
+ {
+ }
+ else
+ {
+ if (m_pFormFiller)
+ return m_pFormFiller->OnChar(pAnnot,nChar, nFlags);
+ }
+
+ return FALSE;
+}
+
+FX_BOOL CPDFSDK_BFAnnotHandler::OnKeyDown(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag)
+{
+ ASSERT(pAnnot != NULL);
+ CFX_ByteString sSubType = pAnnot->GetSubType();
+
+ if (sSubType == BFFT_SIGNATURE)
+ {
+ }
+ else
+ {
+ if (m_pFormFiller)
+ return m_pFormFiller->OnKeyDown(pAnnot,nKeyCode, nFlag);
+ }
+
+ return FALSE;
+}
+
+FX_BOOL CPDFSDK_BFAnnotHandler::OnKeyUp(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag)
+{
+
+ return FALSE;
+}
+void CPDFSDK_BFAnnotHandler::OnCreate(CPDFSDK_Annot* pAnnot)
+{
+ ASSERT(pAnnot != NULL);
+ CFX_ByteString sSubType = pAnnot->GetSubType();
+
+ if (sSubType == BFFT_SIGNATURE)
+ {
+ }
+ else
+ {
+ if (m_pFormFiller)
+ m_pFormFiller->OnCreate(pAnnot);
+ }
+}
+
+void CPDFSDK_BFAnnotHandler::OnLoad(CPDFSDK_Annot* pAnnot)
+{
+ ASSERT(pAnnot != NULL);
+
+ CFX_ByteString sSubType = pAnnot->GetSubType();
+
+ if (sSubType == BFFT_SIGNATURE)
+ {
+ }
+ else
+ {
+ CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
+
+ if (!pWidget->IsAppearanceValid())
+ pWidget->ResetAppearance(NULL, FALSE);
+
+ int nFieldType = pWidget->GetFieldType();
+
+ if (nFieldType == FIELDTYPE_TEXTFIELD || nFieldType == FIELDTYPE_COMBOBOX)
+ {
+ FX_BOOL bFormated = FALSE;
+ CFX_WideString sValue = pWidget->OnFormat(0, bFormated);
+
+ if (bFormated && nFieldType == FIELDTYPE_COMBOBOX)
+ {
+ pWidget->ResetAppearance(sValue, FALSE);
+ }
+ }
+
+
+ if (m_pFormFiller)
+ m_pFormFiller->OnLoad(pAnnot);
+
+ }
+}
+
+FX_BOOL CPDFSDK_BFAnnotHandler::OnSetFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag)
+{
+ ASSERT(pAnnot != NULL);
+ CFX_ByteString sSubType = pAnnot->GetSubType();
+
+ if (sSubType == BFFT_SIGNATURE)
+ {
+ }
+ else
+ {
+ if (m_pFormFiller)
+ return m_pFormFiller->OnSetFocus(pAnnot,nFlag);
+ }
+
+ return TRUE;
+}
+FX_BOOL CPDFSDK_BFAnnotHandler::OnKillFocus(CPDFSDK_Annot* pAnnot, FX_DWORD nFlag)
+{
+ ASSERT(pAnnot != NULL);
+ CFX_ByteString sSubType = pAnnot->GetSubType();
+
+ if (sSubType == BFFT_SIGNATURE)
+ {
+ }
+ else
+ {
+ if (m_pFormFiller)
+ return m_pFormFiller->OnKillFocus(pAnnot,nFlag);
+ }
+
+ return TRUE;
+}
+
+CPDF_Rect CPDFSDK_BFAnnotHandler::GetViewBBox(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot)
+{
+ ASSERT(pAnnot != NULL);
+ CFX_ByteString sSubType = pAnnot->GetSubType();
+
+ if (sSubType == BFFT_SIGNATURE)
+ {
+ }
+ else
+ {
+ if (m_pFormFiller)
+ return m_pFormFiller->GetViewBBox(pPageView, pAnnot);
+
+ }
+
+ return CPDF_Rect(0,0,0,0);
+}
+
+FX_BOOL CPDFSDK_BFAnnotHandler::HitTest(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, const CPDF_Point& point)
+{
+ ASSERT(pPageView);
+ ASSERT(pAnnot);
+
+ CPDF_Rect rect = GetViewBBox(pPageView, pAnnot);
+ return rect.Contains(point.x, point.y);
+}
+
+//CReader_AnnotIteratorEx
+
+CPDFSDK_AnnotIterator::CPDFSDK_AnnotIterator(CPDFSDK_PageView * pPageView,FX_BOOL bReverse,
+ FX_BOOL bIgnoreTopmost/*=FALSE*/,
+ FX_BOOL bCircle/*=FALSE*/,
+ CFX_PtrArray *pList/*=NULL*/)
+{
+ ASSERT(pPageView);
+ m_bReverse=bReverse;
+ m_bIgnoreTopmost= bIgnoreTopmost;
+ m_bCircle=bCircle;
+ m_pIteratorAnnotList.RemoveAll();
+ InitIteratorAnnotList(pPageView,pList);
+}
+
+CPDFSDK_Annot* CPDFSDK_AnnotIterator::NextAnnot (const CPDFSDK_Annot* pCurrent)
+{
+
+ int index=-1;
+ int nCount=this->m_pIteratorAnnotList.GetSize();
+ if(pCurrent){
+ for(int i=0;i<nCount;i++){
+ CPDFSDK_Annot * pReaderAnnot= (CPDFSDK_Annot *)m_pIteratorAnnotList.GetAt(i);
+ if(pReaderAnnot ==pCurrent){
+ index=i;
+ break;
+ }
+ }
+ }
+ return NextAnnot(index);
+}
+CPDFSDK_Annot* CPDFSDK_AnnotIterator::PrevAnnot (const CPDFSDK_Annot*pCurrent)
+{
+
+ int index=-1;
+ int nCount=this->m_pIteratorAnnotList.GetSize();
+ if(pCurrent){
+ for(int i=0;i<nCount;i++){
+ CPDFSDK_Annot * pReaderAnnot= (CPDFSDK_Annot*)m_pIteratorAnnotList.GetAt(i);
+ if(pReaderAnnot ==pCurrent){
+ index=i;
+ break;
+ }
+ }
+ }
+ return PrevAnnot(index);
+}
+CPDFSDK_Annot* CPDFSDK_AnnotIterator::NextAnnot (int& index)
+{
+
+ int nCount=m_pIteratorAnnotList.GetSize();
+ if(nCount<=0) index=-1;
+ else{
+ if(index<0){
+ index=0;
+ }
+ else{
+ if(m_bCircle){
+ index=( index <nCount-1) ? (index+1) :0;
+ }
+ else{
+ index=( index <nCount-1) ? (index+1) :-1;
+ }
+
+ }
+ }
+ return (index <0) ? NULL : (CPDFSDK_Annot*)m_pIteratorAnnotList.GetAt(index);
+}
+
+
+CPDFSDK_Annot* CPDFSDK_AnnotIterator::PrevAnnot (int& index)
+{
+
+ int nCount=m_pIteratorAnnotList.GetSize();
+ if(nCount<=0) index=-1;
+ else{
+ if(index<0){
+ index=nCount-1;
+ }
+ else{
+ if(m_bCircle){
+ index = ( index >0) ? (index-1) :nCount-1;
+ }
+ else{
+ index = ( index >0) ? (index-1) :-1;
+ }
+ }
+ }
+ return (index <0) ? NULL : (CPDFSDK_Annot*)m_pIteratorAnnotList.GetAt(index);
+}
+
+
+CPDFSDK_Annot*CPDFSDK_AnnotIterator::Next(const CPDFSDK_Annot* pCurrent)
+{
+
+ return (m_bReverse) ? PrevAnnot(pCurrent):NextAnnot(pCurrent);
+
+}
+
+CPDFSDK_Annot* CPDFSDK_AnnotIterator::Prev(const CPDFSDK_Annot* pCurrent)
+{
+
+ return (m_bReverse) ? NextAnnot(pCurrent):PrevAnnot(pCurrent);
+}
+
+CPDFSDK_Annot*CPDFSDK_AnnotIterator::Next(int& index )
+{
+
+ return (m_bReverse) ? PrevAnnot(index):NextAnnot(index);
+
+}
+
+CPDFSDK_Annot* CPDFSDK_AnnotIterator::Prev(int& index )
+{
+
+ return (m_bReverse) ? NextAnnot(index):PrevAnnot(index);
+}
+
+
+void CPDFSDK_AnnotIterator::InsertSort(CFX_PtrArray &arrayList, AI_COMPARE pCompare)
+{
+ for (int i = 1; i < arrayList.GetSize(); i++)
+ {
+ if (pCompare((CPDFSDK_Annot*)(arrayList[i]) , (CPDFSDK_Annot*)(arrayList[i-1])) < 0)
+ {
+ int j = i-1;
+ CPDFSDK_Annot* pTemp = (CPDFSDK_Annot*)arrayList[i];
+
+ do
+ {
+ arrayList[j + 1] = arrayList[j];
+ } while (--j >= 0 && pCompare(pTemp, (CPDFSDK_Annot*)arrayList[j]) < 0);
+
+ arrayList[j+1] = pTemp;
+ }
+ }
+}
+
+int LyOrderCompare(CPDFSDK_Annot* p1, CPDFSDK_Annot* p2)
+{
+ if(p1->GetLayoutOrder() < p2->GetLayoutOrder())
+ return -1;
+ else if (p1->GetLayoutOrder() == p2->GetLayoutOrder())
+ return 0;
+ else
+ return 1;
+}
+
+FX_BOOL CPDFSDK_AnnotIterator::InitIteratorAnnotList(CPDFSDK_PageView* pPageView,CFX_PtrArray * pAnnotList)
+{
+ ASSERT(pPageView);
+
+
+
+ if(pAnnotList==NULL){
+ pAnnotList=pPageView->GetAnnotList();
+ }
+
+ this->m_pIteratorAnnotList.RemoveAll();
+ if(!pAnnotList) return FALSE;
+
+ CPDFSDK_Annot * pTopMostAnnot= (m_bIgnoreTopmost) ? NULL : pPageView->GetFocusAnnot();
+
+
+ int nCount =pAnnotList->GetSize();
+
+ for(int i = nCount- 1 ;i >= 0;i--)
+ {
+ CPDFSDK_Annot * pReaderAnnot= (CPDFSDK_Annot*)pAnnotList->GetAt(i);
+ m_pIteratorAnnotList.Add(pReaderAnnot);
+ }
+
+ InsertSort(m_pIteratorAnnotList,&LyOrderCompare);
+
+ if(pTopMostAnnot)
+ {
+ for(int i=0 ;i<nCount;i++)
+ {
+ CPDFSDK_Annot * pReaderAnnot = (CPDFSDK_Annot*)m_pIteratorAnnotList.GetAt(i);
+ if(pReaderAnnot == pTopMostAnnot)
+ {
+ m_pIteratorAnnotList.RemoveAt(i);
+ m_pIteratorAnnotList.InsertAt(0, pReaderAnnot);
+ break;
+ }
+ }
+ }
+
+ return TRUE;
+}
+
diff --git a/fpdfsdk/src/fsdk_baseannot.cpp b/fpdfsdk/src/fsdk_baseannot.cpp
index ac36e3c3a6..c8e07358ba 100644
--- a/fpdfsdk/src/fsdk_baseannot.cpp
+++ b/fpdfsdk/src/fsdk_baseannot.cpp
@@ -1,1187 +1,1187 @@
-// 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
-
-#include "../include/fsdk_define.h"
-#include "../include/fsdk_mgr.h"
-#include "../include/fsdk_baseannot.h"
-
-
-//---------------------------------------------------------------------------
-// CPDFSDK_DateTime
-//---------------------------------------------------------------------------
-int _gAfxGetTimeZoneInSeconds(FX_CHAR tzhour, FX_BYTE tzminute)
-{
- return (int)tzhour * 3600 + (int)tzminute * (tzhour >= 0 ? 60 : -60);
-}
-
-FX_BOOL _gAfxIsLeapYear(FX_SHORT year)
-{
- return ((year % 400 == 0) || ((year % 4 == 0) && (year % 100 != 0)));
-}
-
-FX_WORD _gAfxGetYearDays(FX_SHORT year)
-{
- return (_gAfxIsLeapYear(year) == TRUE ? 366 : 365);
-}
-
-FX_BYTE _gAfxGetMonthDays(FX_SHORT year, FX_BYTE month)
-{
- FX_BYTE mDays;
- switch (month)
- {
- case 1:
- case 3:
- case 5:
- case 7:
- case 8:
- case 10:
- case 12:
- mDays = 31;
- break;
-
- case 4:
- case 6:
- case 9:
- case 11:
- mDays = 30;
- break;
-
- case 2:
- if (_gAfxIsLeapYear(year) == TRUE)
- mDays = 29;
- else
- mDays = 28;
- break;
-
- default:
- mDays = 0;
- break;
- }
-
- return mDays;
-}
-
-CPDFSDK_DateTime::CPDFSDK_DateTime()
-{
- ResetDateTime();
-}
-
-CPDFSDK_DateTime::CPDFSDK_DateTime(const CFX_ByteString& dtStr)
-{
- ResetDateTime();
-
- FromPDFDateTimeString(dtStr);
-}
-
-CPDFSDK_DateTime::CPDFSDK_DateTime(const CPDFSDK_DateTime& datetime)
-{
- operator = (datetime);
-}
-
-CPDFSDK_DateTime::CPDFSDK_DateTime(const FX_SYSTEMTIME& st)
-{
- operator = (st) ;
-}
-
-
-void CPDFSDK_DateTime::ResetDateTime()
-{
- tzset();
-
- time_t curTime;
- time(&curTime);
- struct tm* newtime;
- //newtime = gmtime(&curTime);
- newtime = localtime(&curTime);
-
- dt.year = newtime->tm_year + 1900;
- dt.month = newtime->tm_mon + 1;
- dt.day = newtime->tm_mday;
- dt.hour = newtime->tm_hour;
- dt.minute = newtime->tm_min;
- dt.second = newtime->tm_sec;
-// dt.tzHour = _timezone / 3600 * -1;
-// dt.tzMinute = (abs(_timezone) % 3600) / 60;
-}
-
-CPDFSDK_DateTime& CPDFSDK_DateTime::operator = (const CPDFSDK_DateTime& datetime)
-{
- FXSYS_memcpy(&dt, &datetime.dt, sizeof(FX_DATETIME));
- return *this;
-}
-
-CPDFSDK_DateTime& CPDFSDK_DateTime::operator = (const FX_SYSTEMTIME& st)
-{
- tzset();
-
- dt.year = (FX_SHORT)st.wYear;
- dt.month = (FX_BYTE)st.wMonth;
- dt.day = (FX_BYTE)st.wDay;
- dt.hour = (FX_BYTE)st.wHour;
- dt.minute = (FX_BYTE)st.wMinute;
- dt.second = (FX_BYTE)st.wSecond;
-// dt.tzHour = _timezone / 3600 * -1;
-// dt.tzMinute = (abs(_timezone) % 3600) / 60;
- return *this;
-}
-
-FX_BOOL CPDFSDK_DateTime::operator == (CPDFSDK_DateTime& datetime)
-{
- return (FXSYS_memcmp(&dt, &datetime.dt, sizeof(FX_DATETIME)) == 0);
-}
-
-FX_BOOL CPDFSDK_DateTime::operator != (CPDFSDK_DateTime& datetime)
-{
- return (FXSYS_memcmp(&dt, &datetime.dt, sizeof(FX_DATETIME)) != 0);
-}
-
-FX_BOOL CPDFSDK_DateTime::operator > (CPDFSDK_DateTime& datetime)
-{
- CPDFSDK_DateTime dt1 = ToGMT();
- CPDFSDK_DateTime dt2 = datetime.ToGMT();
- int d1 = (((int)dt1.dt.year) << 16) | (((int)dt1.dt.month) << 8) | (int)dt1.dt.day;
- int d2 = (((int)dt1.dt.hour) << 16) | (((int)dt1.dt.minute) << 8) | (int)dt1.dt.second;
- int d3 = (((int)dt2.dt.year) << 16) | (((int)dt2.dt.month) << 8) | (int)dt2.dt.day;
- int d4 = (((int)dt2.dt.hour) << 16) | (((int)dt2.dt.minute) << 8) | (int)dt2.dt.second;
-
- if (d1 > d3) return TRUE;
- if (d2 > d4) return TRUE;
- return FALSE;
-}
-
-FX_BOOL CPDFSDK_DateTime::operator >= (CPDFSDK_DateTime& datetime)
-{
- CPDFSDK_DateTime dt1 = ToGMT();
- CPDFSDK_DateTime dt2 = datetime.ToGMT();
- int d1 = (((int)dt1.dt.year) << 16) | (((int)dt1.dt.month) << 8) | (int)dt1.dt.day;
- int d2 = (((int)dt1.dt.hour) << 16) | (((int)dt1.dt.minute) << 8) | (int)dt1.dt.second;
- int d3 = (((int)dt2.dt.year) << 16) | (((int)dt2.dt.month) << 8) | (int)dt2.dt.day;
- int d4 = (((int)dt2.dt.hour) << 16) | (((int)dt2.dt.minute) << 8) | (int)dt2.dt.second;
-
- if (d1 >= d3) return TRUE;
- if (d2 >= d4) return TRUE;
- return FALSE;
-}
-
-FX_BOOL CPDFSDK_DateTime::operator < (CPDFSDK_DateTime& datetime)
-{
- CPDFSDK_DateTime dt1 = ToGMT();
- CPDFSDK_DateTime dt2 = datetime.ToGMT();
- int d1 = (((int)dt1.dt.year) << 16) | (((int)dt1.dt.month) << 8) | (int)dt1.dt.day;
- int d2 = (((int)dt1.dt.hour) << 16) | (((int)dt1.dt.minute) << 8) | (int)dt1.dt.second;
- int d3 = (((int)dt2.dt.year) << 16) | (((int)dt2.dt.month) << 8) | (int)dt2.dt.day;
- int d4 = (((int)dt2.dt.hour) << 16) | (((int)dt2.dt.minute) << 8) | (int)dt2.dt.second;
-
- if (d1 < d3) return TRUE;
- if (d2 < d4) return TRUE;
- return FALSE;
-}
-
-FX_BOOL CPDFSDK_DateTime::operator <= (CPDFSDK_DateTime& datetime)
-{
- CPDFSDK_DateTime dt1 = ToGMT();
- CPDFSDK_DateTime dt2 = datetime.ToGMT();
- int d1 = (((int)dt1.dt.year) << 16) | (((int)dt1.dt.month) << 8) | (int)dt1.dt.day;
- int d2 = (((int)dt1.dt.hour) << 16) | (((int)dt1.dt.minute) << 8) | (int)dt1.dt.second;
- int d3 = (((int)dt2.dt.year) << 16) | (((int)dt2.dt.month) << 8) | (int)dt2.dt.day;
- int d4 = (((int)dt2.dt.hour) << 16) | (((int)dt2.dt.minute) << 8) | (int)dt2.dt.second;
-
- if (d1 <= d3) return TRUE;
- if (d2 <= d4) return TRUE;
- return FALSE;
-}
-
-CPDFSDK_DateTime::operator time_t()
-{
- struct tm newtime;
-
- newtime.tm_year = dt.year - 1900;
- newtime.tm_mon = dt.month - 1;
- newtime.tm_mday = dt.day;
- newtime.tm_hour = dt.hour;
- newtime.tm_min = dt.minute;
- newtime.tm_sec = dt.second;
-
- return mktime(&newtime);
-}
-
-CPDFSDK_DateTime& CPDFSDK_DateTime::FromPDFDateTimeString(const CFX_ByteString& dtStr)
-{
- int strLength = dtStr.GetLength();
- if (strLength > 0)
- {
- int i = 0;
- int j, k;
- FX_CHAR ch;
- while (i < strLength)
- {
- ch = dtStr[i];
- if (ch >= '0' && ch <= '9') break;
- i ++;
- }
- if (i >= strLength) return *this;
-
- j = 0;
- k = 0;
- while (i < strLength && j < 4)
- {
- ch = dtStr[i];
- k = k * 10 + ch - '0';
- j ++;
- if (ch < '0' || ch > '9') break;
- i ++;
- }
- dt.year = (FX_SHORT)k;
- if (i >= strLength || j < 4) return *this;
-
- j = 0;
- k = 0;
- while (i < strLength && j < 2)
- {
- ch = dtStr[i];
- k = k * 10 + ch - '0';
- j ++;
- if (ch < '0' || ch > '9') break;
- i ++;
- }
- dt.month = (FX_BYTE)k;
- if (i >= strLength || j < 2) return *this;
-
- j = 0;
- k = 0;
- while (i < strLength && j < 2)
- {
- ch = dtStr[i];
- k = k * 10 + ch - '0';
- j ++;
- if (ch < '0' || ch > '9') break;
- i ++;
- }
- dt.day = (FX_BYTE)k;
- if (i >= strLength || j < 2) return *this;
-
- j = 0;
- k = 0;
- while (i < strLength && j < 2)
- {
- ch = dtStr[i];
- k = k * 10 + ch - '0';
- j ++;
- if (ch < '0' || ch > '9') break;
- i ++;
- }
- dt.hour = (FX_BYTE)k;
- if (i >= strLength || j < 2) return *this;
-
- j = 0;
- k = 0;
- while (i < strLength && j < 2)
- {
- ch = dtStr[i];
- k = k * 10 + ch - '0';
- j ++;
- if (ch < '0' || ch > '9') break;
- i ++;
- }
- dt.minute = (FX_BYTE)k;
- if (i >= strLength || j < 2) return *this;
-
- j = 0;
- k = 0;
- while (i < strLength && j < 2)
- {
- ch = dtStr[i];
- k = k * 10 + ch - '0';
- j ++;
- if (ch < '0' || ch > '9') break;
- i ++;
- }
- dt.second = (FX_BYTE)k;
- if (i >= strLength || j < 2) return *this;
-
- ch = dtStr[i ++];
- if (ch != '-' && ch != '+') return *this;
- if (ch == '-')
- dt.tzHour = -1;
- else
- dt.tzHour = 1;
- j = 0;
- k = 0;
- while (i < strLength && j < 2)
- {
- ch = dtStr[i];
- k = k * 10 + ch - '0';
- j ++;
- if (ch < '0' || ch > '9') break;
- i ++;
- }
- dt.tzHour *= (FX_CHAR)k;
- if (i >= strLength || j < 2) return *this;
-
- ch = dtStr[i ++];
- if (ch != '\'') return *this;
- j = 0;
- k = 0;
- while (i < strLength && j < 2)
- {
- ch = dtStr[i];
- k = k * 10 + ch - '0';
- j ++;
- if (ch < '0' || ch > '9') break;
- i ++;
- }
- dt.tzMinute = (FX_BYTE)k;
- if (i >= strLength || j < 2) return *this;
- }
-
- return *this;
-}
-
-CFX_ByteString CPDFSDK_DateTime::ToCommonDateTimeString()
-{
- CFX_ByteString str1;
- str1.Format("%04d-%02d-%02d %02d:%02d:%02d ", dt.year, dt.month, dt.day, dt.hour, dt.minute, dt.second);
- if (dt.tzHour < 0)
- str1 += "-";
- else
- str1 += "+";
- CFX_ByteString str2;
- str2.Format("%02d:%02d", abs(dt.tzHour), dt.tzMinute);
- return str1 + str2;
-}
-
-CFX_ByteString CPDFSDK_DateTime::ToPDFDateTimeString()
-{
- CFX_ByteString dtStr;
- char tempStr[32];
- sprintf(tempStr, "D:%04d%02d%02d%02d%02d%02d", dt.year, dt.month, dt.day, dt.hour, dt.minute, dt.second);
- dtStr = CFX_ByteString(tempStr);
- if (dt.tzHour < 0)
- dtStr += CFX_ByteString("-");
- else
- dtStr += CFX_ByteString("+");
- sprintf(tempStr, "%02d'%02d'", abs(dt.tzHour), dt.tzMinute);
- dtStr += CFX_ByteString(tempStr);
- return dtStr;
-}
-
-void CPDFSDK_DateTime::ToSystemTime(FX_SYSTEMTIME& st)
-{
- CPDFSDK_DateTime dt = *this;
- time_t t = (time_t)dt;
- struct tm* pTime = localtime(&t);
- if(pTime){
- st.wYear = (FX_WORD)pTime->tm_year + 1900;
- st.wMonth = (FX_WORD)pTime->tm_mon + 1;
- st.wDay = (FX_WORD)pTime->tm_mday;
- st.wDayOfWeek = (FX_WORD)pTime->tm_wday;
- st.wHour = (FX_WORD)pTime->tm_hour;
- st.wMinute = (FX_WORD)pTime->tm_min;
- st.wSecond = (FX_WORD)pTime->tm_sec;
- st.wMilliseconds = 0;
- }
-}
-
-CPDFSDK_DateTime CPDFSDK_DateTime::ToGMT()
-{
- CPDFSDK_DateTime dt = *this;
- dt.AddSeconds(-_gAfxGetTimeZoneInSeconds(dt.dt.tzHour, dt.dt.tzMinute));
- dt.dt.tzHour = 0;
- dt.dt.tzMinute = 0;
- return dt;
-}
-
-CPDFSDK_DateTime& CPDFSDK_DateTime::AddDays(short days)
-{
- if (days == 0) return *this;
-
- FX_SHORT y = dt.year, yy;
- FX_BYTE m = dt.month;
- FX_BYTE d = dt.day;
- int mdays, ydays, ldays;
-
- ldays = days;
- if (ldays > 0)
- {
- yy = y;
- if (((FX_WORD)m * 100 + d) > 300) yy ++;
- ydays = _gAfxGetYearDays(yy);
- while (ldays >= ydays)
- {
- y ++;
- ldays -= ydays;
- yy ++;
- mdays = _gAfxGetMonthDays(y, m);
- if (d > mdays)
- {
- m ++;
- d -= mdays;
- }
- ydays = _gAfxGetYearDays(yy);
- }
- mdays = _gAfxGetMonthDays(y, m) - d + 1;
- while (ldays >= mdays)
- {
- ldays -= mdays;
- m ++;
- d = 1;
- mdays = _gAfxGetMonthDays(y, m);
- }
- d += ldays;
- }
- else
- {
- ldays *= -1;
- yy = y;
- if (((FX_WORD)m * 100 + d) < 300) yy --;
- ydays = _gAfxGetYearDays(yy);
- while (ldays >= ydays)
- {
- y --;
- ldays -= ydays;
- yy --;
- mdays = _gAfxGetMonthDays(y, m);
- if (d > mdays)
- {
- m ++;
- d -= mdays;
- }
- ydays = _gAfxGetYearDays(yy);
- }
- while (ldays >= d)
- {
- ldays -= d;
- m --;
- mdays = _gAfxGetMonthDays(y, m);
- d = mdays;
- }
- d -= ldays;
- }
-
- dt.year = y;
- dt.month = m;
- dt.day = d;
-
- return *this;
-}
-
-CPDFSDK_DateTime& CPDFSDK_DateTime::AddSeconds(int seconds)
-{
- if (seconds == 0) return *this;
-
- int n;
- int days;
-
- n = dt.hour * 3600 + dt.minute * 60 + dt.second + seconds;
- if (n < 0)
- {
- days = (n - 86399) / 86400;
- n -= days * 86400;
- }
- else
- {
- days = n / 86400;
- n %= 86400;
- }
- dt.hour = (FX_BYTE)(n / 3600);
- dt.hour %= 24;
- n %= 3600;
- dt.minute = (FX_BYTE)(n / 60);
- dt.second = (FX_BYTE)(n % 60);
- if (days != 0) AddDays(days);
-
- return *this;
-}
-
-
-//---------------------------------------------------------------------------
-// CPDFSDK_Annot
-//---------------------------------------------------------------------------
-CPDFSDK_Annot::CPDFSDK_Annot(CPDF_Annot* pAnnot, CPDFSDK_PageView* pPageView) :
-m_pAnnot(pAnnot),
-m_pPageView(pPageView),
-m_bSelected(FALSE),
-m_nTabOrder(-1)
-{
-}
-
-CPDFSDK_Annot::~CPDFSDK_Annot()
-{
- m_pAnnot = NULL;
- m_pPageView = NULL;
-}
-
-CPDF_Annot* CPDFSDK_Annot::GetPDFAnnot()
-{
- return m_pAnnot;
-}
-
-FX_DWORD CPDFSDK_Annot::GetFlags()
-{
- ASSERT(m_pAnnot != NULL);
-
- return m_pAnnot->GetFlags();
-}
-
-void CPDFSDK_Annot::SetPage(CPDFSDK_PageView* pPageView)
-{
- m_pPageView = pPageView;
-}
-
-CPDFSDK_PageView* CPDFSDK_Annot::GetPageView()
-{
- return m_pPageView;
-}
-
-FX_BOOL CPDFSDK_Annot::IsSelected()
-{
- return m_bSelected;
-}
-
-void CPDFSDK_Annot::SetSelected(FX_BOOL bSelected)
-{
- m_bSelected = bSelected;
-}
-
-// Tab Order
-int CPDFSDK_Annot::GetTabOrder()
-{
- return m_nTabOrder;
-}
-
-void CPDFSDK_Annot::SetTabOrder(int iTabOrder)
-{
- m_nTabOrder = iTabOrder;
-}
-
-CPDF_Dictionary* CPDFSDK_Annot::GetAnnotDict() const
-{
- ASSERT(m_pAnnot != NULL);
-
- return m_pAnnot->m_pAnnotDict;
-}
-
-void CPDFSDK_Annot::SetRect(const CPDF_Rect& rect)
-{
- ASSERT(m_pAnnot != NULL);
- ASSERT(m_pAnnot->m_pAnnotDict != NULL);
- ASSERT(rect.right - rect.left >= GetMinWidth());
- ASSERT(rect.top - rect.bottom >= GetMinHeight());
-
- m_pAnnot->m_pAnnotDict->SetAtRect("Rect", rect);
-}
-
-CPDF_Rect CPDFSDK_Annot::GetRect() const
-{
- ASSERT(m_pAnnot != NULL);
-
- CPDF_Rect rect;
- m_pAnnot->GetRect(rect);
-
- return rect;
-}
-
-CFX_ByteString CPDFSDK_Annot::GetType() const
-{
- ASSERT(m_pAnnot != NULL);
-
- return m_pAnnot->GetSubType();
-}
-
-CFX_ByteString CPDFSDK_Annot::GetSubType() const
-{
- return "";
-}
-
-void CPDFSDK_Annot::ResetAppearance()
-{
- ASSERT(FALSE);
-}
-
-void CPDFSDK_Annot::DrawAppearance(CFX_RenderDevice* pDevice, const CPDF_Matrix* pUser2Device,
- CPDF_Annot::AppearanceMode mode, const CPDF_RenderOptions* pOptions)
-{
- ASSERT(m_pPageView != NULL);
- ASSERT(m_pAnnot != NULL);
-
- m_pAnnot->DrawAppearance(m_pPageView->GetPDFPage(), pDevice, pUser2Device, mode, pOptions);
-}
-
-FX_BOOL CPDFSDK_Annot::IsAppearanceValid()
-{
- ASSERT(m_pAnnot != NULL);
- ASSERT(m_pAnnot->m_pAnnotDict != NULL);
-
- return m_pAnnot->m_pAnnotDict->GetDict("AP") != NULL;
-}
-
-FX_BOOL CPDFSDK_Annot::IsAppearanceValid(CPDF_Annot::AppearanceMode mode)
-{
- ASSERT(m_pAnnot != NULL);
- ASSERT(m_pAnnot->m_pAnnotDict != NULL);
-
- CPDF_Dictionary* pAP = m_pAnnot->m_pAnnotDict->GetDict("AP");
- if (pAP == NULL) return FALSE;
-
- // Choose the right sub-ap
- const FX_CHAR* ap_entry = "N";
- if (mode == CPDF_Annot::Down)
- ap_entry = "D";
- else if (mode == CPDF_Annot::Rollover)
- ap_entry = "R";
- if (!pAP->KeyExist(ap_entry))
- ap_entry = "N";
-
- // Get the AP stream or subdirectory
- CPDF_Object* psub = pAP->GetElementValue(ap_entry);
- if (psub == NULL) return FALSE;
-
- return TRUE;
-}
-
-void CPDFSDK_Annot::DrawBorder(CFX_RenderDevice* pDevice, const CPDF_Matrix* pUser2Device,
- const CPDF_RenderOptions* pOptions)
-{
- ASSERT(m_pAnnot != NULL);
- m_pAnnot->DrawBorder(pDevice, pUser2Device, pOptions);
-}
-
-void CPDFSDK_Annot::ClearCachedAP()
-{
- ASSERT(m_pAnnot != NULL);
- m_pAnnot->ClearCachedAP();
-}
-
-void CPDFSDK_Annot::SetContents(const CFX_WideString& sContents)
-{
- ASSERT(m_pAnnot != NULL);
- ASSERT(m_pAnnot->m_pAnnotDict != NULL);
-
- if (sContents.IsEmpty())
- m_pAnnot->m_pAnnotDict->RemoveAt("Contents");
- else
- m_pAnnot->m_pAnnotDict->SetAtString("Contents", PDF_EncodeText(sContents));
-}
-
-CFX_WideString CPDFSDK_Annot::GetContents() const
-{
- ASSERT(m_pAnnot != NULL);
- ASSERT(m_pAnnot->m_pAnnotDict != NULL);
-
- return m_pAnnot->m_pAnnotDict->GetUnicodeText("Contents");
-}
-
-void CPDFSDK_Annot::SetAnnotName(const CFX_WideString& sName)
-{
- ASSERT(m_pAnnot != NULL);
- ASSERT(m_pAnnot->m_pAnnotDict != NULL);
-
- if (sName.IsEmpty())
- m_pAnnot->m_pAnnotDict->RemoveAt("NM");
- else
- m_pAnnot->m_pAnnotDict->SetAtString("NM", PDF_EncodeText(sName));
-}
-
-CFX_WideString CPDFSDK_Annot::GetAnnotName() const
-{
- ASSERT(m_pAnnot != NULL);
- ASSERT(m_pAnnot->m_pAnnotDict != NULL);
-
- return m_pAnnot->m_pAnnotDict->GetUnicodeText("NM");
-}
-
-void CPDFSDK_Annot::SetModifiedDate(const FX_SYSTEMTIME& st)
-{
- ASSERT(m_pAnnot != NULL);
- ASSERT(m_pAnnot->m_pAnnotDict != NULL);
-
- CPDFSDK_DateTime dt(st);
- CFX_ByteString str = dt.ToPDFDateTimeString();
-
- if (str.IsEmpty())
- m_pAnnot->m_pAnnotDict->RemoveAt("M");
- else
- m_pAnnot->m_pAnnotDict->SetAtString("M", str);
-}
-
-FX_SYSTEMTIME CPDFSDK_Annot::GetModifiedDate() const
-{
- ASSERT(m_pAnnot != NULL);
- ASSERT(m_pAnnot->m_pAnnotDict != NULL);
-
- FX_SYSTEMTIME systime;
- CFX_ByteString str = m_pAnnot->m_pAnnotDict->GetString("M");
-
- CPDFSDK_DateTime dt(str);
- dt.ToSystemTime(systime);
-
- return systime;
-}
-
-void CPDFSDK_Annot::SetFlags(int nFlags)
-{
- ASSERT(m_pAnnot != NULL);
- ASSERT(m_pAnnot->m_pAnnotDict != NULL);
-
- m_pAnnot->m_pAnnotDict->SetAtInteger("F", nFlags);
-}
-
-int CPDFSDK_Annot::GetFlags() const
-{
- ASSERT(m_pAnnot != NULL);
- ASSERT(m_pAnnot->m_pAnnotDict != NULL);
-
- return m_pAnnot->m_pAnnotDict->GetInteger("F");
-}
-
-void CPDFSDK_Annot::SetAppState(const CFX_ByteString& str)
-{
- ASSERT(m_pAnnot != NULL);
- ASSERT(m_pAnnot->m_pAnnotDict != NULL);
-
- if (str.IsEmpty())
- m_pAnnot->m_pAnnotDict->RemoveAt("AS");
- else
- m_pAnnot->m_pAnnotDict->SetAtString("AS", str);
-}
-
-CFX_ByteString CPDFSDK_Annot::GetAppState() const
-{
- ASSERT(m_pAnnot != NULL);
- ASSERT(m_pAnnot->m_pAnnotDict != NULL);
-
- return m_pAnnot->m_pAnnotDict->GetString("AS");
-}
-
-void CPDFSDK_Annot::SetStructParent(int key)
-{
- ASSERT(m_pAnnot != NULL);
- ASSERT(m_pAnnot->m_pAnnotDict != NULL);
-
- m_pAnnot->m_pAnnotDict->SetAtInteger("StructParent", key);
-}
-
-int CPDFSDK_Annot::GetStructParent() const
-{
- ASSERT(m_pAnnot != NULL);
- ASSERT(m_pAnnot->m_pAnnotDict != NULL);
-
- return m_pAnnot->m_pAnnotDict->GetInteger("StructParent");
-}
-
-//border
-void CPDFSDK_Annot::SetBorderWidth(int nWidth)
-{
- ASSERT(m_pAnnot != NULL);
- ASSERT(m_pAnnot->m_pAnnotDict != NULL);
-
- CPDF_Array* pBorder = m_pAnnot->m_pAnnotDict->GetArray("Border");
-
- if (pBorder)
- {
- pBorder->SetAt(2, FX_NEW CPDF_Number(nWidth));
- }
- else
- {
- CPDF_Dictionary* pBSDict = m_pAnnot->m_pAnnotDict->GetDict("BS");
-
- if (!pBSDict)
- {
- pBSDict = FX_NEW CPDF_Dictionary;
- m_pAnnot->m_pAnnotDict->SetAt("BS", pBSDict);
- }
-
- pBSDict->SetAtInteger("W", nWidth);
- }
-}
-
-int CPDFSDK_Annot::GetBorderWidth() const
-{
- ASSERT(m_pAnnot != NULL);
- ASSERT(m_pAnnot->m_pAnnotDict != NULL);
-
- CPDF_Array* pBorder = m_pAnnot->m_pAnnotDict->GetArray("Border");
-
- if (pBorder)
- {
- return pBorder->GetInteger(2);
- }
- else
- {
- CPDF_Dictionary* pBSDict = m_pAnnot->m_pAnnotDict->GetDict("BS");
-
- if (pBSDict)
- {
- return pBSDict->GetInteger("W", 1);
- }
- }
- return 1;
-}
-
-void CPDFSDK_Annot::SetBorderStyle(int nStyle)
-{
- ASSERT(m_pAnnot != NULL);
- ASSERT(m_pAnnot->m_pAnnotDict != NULL);
-
- CPDF_Dictionary* pBSDict = m_pAnnot->m_pAnnotDict->GetDict("BS");
- if (!pBSDict)
- {
- pBSDict = FX_NEW CPDF_Dictionary;
- m_pAnnot->m_pAnnotDict->SetAt("BS", pBSDict);
- }
-
- switch (nStyle)
- {
- case BBS_SOLID:
- pBSDict->SetAtName("S", "S");
- break;
- case BBS_DASH:
- pBSDict->SetAtName("S", "D");
- break;
- case BBS_BEVELED:
- pBSDict->SetAtName("S", "B");
- break;
- case BBS_INSET:
- pBSDict->SetAtName("S", "I");
- break;
- case BBS_UNDERLINE:
- pBSDict->SetAtName("S", "U");
- break;
- }
-}
-
-int CPDFSDK_Annot::GetBorderStyle() const
-{
- ASSERT(m_pAnnot != NULL);
- ASSERT(m_pAnnot->m_pAnnotDict != NULL);
-
- CPDF_Dictionary* pBSDict = m_pAnnot->m_pAnnotDict->GetDict("BS");
- if (pBSDict)
- {
- CFX_ByteString sBorderStyle = pBSDict->GetString("S", "S");
- if (sBorderStyle == "S") return BBS_SOLID;
- if (sBorderStyle == "D") return BBS_DASH;
- if (sBorderStyle == "B") return BBS_BEVELED;
- if (sBorderStyle == "I") return BBS_INSET;
- if (sBorderStyle == "U") return BBS_UNDERLINE;
- }
-
- CPDF_Array* pBorder = m_pAnnot->m_pAnnotDict->GetArray("Border");
- if (pBorder)
- {
- if (pBorder->GetCount() >= 4)
- {
- CPDF_Array *pDP = pBorder->GetArray(3);
- if (pDP && pDP->GetCount() > 0)
- return BBS_DASH;
- }
- }
-
- return BBS_SOLID;
-}
-
-void CPDFSDK_Annot::SetBorderDash(const CFX_IntArray& array)
-{
- ASSERT(m_pAnnot != NULL);
- ASSERT(m_pAnnot->m_pAnnotDict != NULL);
-
- CPDF_Dictionary* pBSDict = m_pAnnot->m_pAnnotDict->GetDict("BS");
- if (!pBSDict)
- {
- pBSDict = FX_NEW CPDF_Dictionary;
- m_pAnnot->m_pAnnotDict->SetAt("BS", pBSDict);
- }
-
- CPDF_Array* pArray = FX_NEW CPDF_Array;
- for (int i=0,sz=array.GetSize(); i<sz; i++)
- {
- pArray->AddInteger(array[i]);
- }
-
- pBSDict->SetAt("D", pArray);
-}
-
-void CPDFSDK_Annot::GetBorderDash(CFX_IntArray& array) const
-{
- ASSERT(m_pAnnot != NULL);
- ASSERT(m_pAnnot->m_pAnnotDict != NULL);
-
- CPDF_Array* pDash = NULL;
-
- CPDF_Array* pBorder = m_pAnnot->m_pAnnotDict->GetArray("Border");
- if (pBorder)
- {
- pDash = pBorder->GetArray(3);
- }
- else
- {
- CPDF_Dictionary* pBSDict = m_pAnnot->m_pAnnotDict->GetDict("BS");
- if (pBSDict)
- {
- pDash = pBSDict->GetArray("D");
- }
- }
-
- if (pDash)
- {
- for (int i=0,sz=pDash->GetCount(); i<sz; i++)
- {
- array.Add(pDash->GetInteger(i));
- }
- }
-}
-
-void CPDFSDK_Annot::SetColor(FX_COLORREF color)
-{
- ASSERT(m_pAnnot != NULL);
- ASSERT(m_pAnnot->m_pAnnotDict != NULL);
-
- CPDF_Array* pArray = FX_NEW CPDF_Array;
- pArray->AddNumber((FX_FLOAT)FXSYS_GetRValue(color) / 255.0f);
- pArray->AddNumber((FX_FLOAT)FXSYS_GetGValue(color) / 255.0f);
- pArray->AddNumber((FX_FLOAT)FXSYS_GetBValue(color) / 255.0f);
- m_pAnnot->m_pAnnotDict->SetAt("C", pArray);
-}
-
-void CPDFSDK_Annot::RemoveColor()
-{
- ASSERT(m_pAnnot != NULL);
- ASSERT(m_pAnnot->m_pAnnotDict != NULL);
-
- m_pAnnot->m_pAnnotDict->RemoveAt("C") ;
-}
-
-FX_BOOL CPDFSDK_Annot::GetColor(FX_COLORREF& color) const
-{
- ASSERT(m_pAnnot != NULL);
- ASSERT(m_pAnnot->m_pAnnotDict != NULL);
-
- if (CPDF_Array* pEntry = m_pAnnot->m_pAnnotDict->GetArray("C"))
- {
- int nCount = pEntry->GetCount();
- if (nCount == 1)
- {
- FX_FLOAT g = pEntry->GetNumber(0) * 255;
-
- color = FXSYS_RGB((int)g, (int)g, (int)g);
-
- return TRUE;
- }
- else if (nCount == 3)
- {
- FX_FLOAT r = pEntry->GetNumber(0) * 255;
- FX_FLOAT g = pEntry->GetNumber(1) * 255;
- FX_FLOAT b = pEntry->GetNumber(2) * 255;
-
- color = FXSYS_RGB((int)r, (int)g, (int)b);
-
- return TRUE;
- }
- else if (nCount == 4)
- {
- FX_FLOAT c = pEntry->GetNumber(0);
- FX_FLOAT m = pEntry->GetNumber(1);
- FX_FLOAT y = pEntry->GetNumber(2);
- FX_FLOAT k = pEntry->GetNumber(3);
-
- FX_FLOAT r = 1.0f - FX_MIN(1.0f, c + k);
- FX_FLOAT g = 1.0f - FX_MIN(1.0f, m + k);
- FX_FLOAT b = 1.0f - FX_MIN(1.0f, y + k);
-
- color = FXSYS_RGB((int)(r * 255), (int)(g * 255), (int)(b * 255));
-
- return TRUE;
- }
- }
-
- return FALSE;
-}
-
-
-void CPDFSDK_Annot::WriteAppearance(const CFX_ByteString& sAPType, const CPDF_Rect& rcBBox,
- const CPDF_Matrix& matrix, const CFX_ByteString& sContents,
- const CFX_ByteString& sAPState)
-{
- ASSERT(m_pAnnot != NULL);
- ASSERT(m_pAnnot->m_pAnnotDict != NULL);
-
- CPDF_Dictionary* pAPDict = m_pAnnot->m_pAnnotDict->GetDict("AP");
-
- if (!pAPDict)
- {
- pAPDict = FX_NEW CPDF_Dictionary;
- m_pAnnot->m_pAnnotDict->SetAt("AP", pAPDict);
- }
-
- CPDF_Stream* pStream = NULL;
- CPDF_Dictionary* pParentDict = NULL;
-
- if (sAPState.IsEmpty())
- {
- pParentDict = pAPDict;
- pStream = pAPDict->GetStream(sAPType);
- }
- else
- {
- CPDF_Dictionary* pAPTypeDict = pAPDict->GetDict(sAPType);
- if (!pAPTypeDict)
- {
- pAPTypeDict = FX_NEW CPDF_Dictionary;
- pAPDict->SetAt(sAPType, pAPTypeDict);
- }
-
- pParentDict = pAPTypeDict;
- pStream = pAPTypeDict->GetStream(sAPState);
- }
-
- if (!pStream)
- {
- ASSERT(m_pPageView != NULL);
- CPDF_Document* pDoc = m_pPageView->GetPDFDocument();
- ASSERT(pDoc != NULL);
-
- pStream = FX_NEW CPDF_Stream(NULL, 0, NULL);
- FX_INT32 objnum = pDoc->AddIndirectObject(pStream);
- //pAPDict->SetAtReference(sAPType, pDoc, objnum);
- ASSERT(pParentDict != NULL);
- pParentDict->SetAtReference(sAPType, pDoc, objnum);
- }
-
- CPDF_Dictionary * pStreamDict = pStream->GetDict();
-
- if (!pStreamDict)
- {
- pStreamDict = FX_NEW CPDF_Dictionary;
- pStreamDict->SetAtName("Type", "XObject");
- pStreamDict->SetAtName("Subtype", "Form");
- pStreamDict->SetAtInteger("FormType", 1);
- pStream->InitStream(NULL,0,pStreamDict);
- }
-
- if (pStreamDict)
- {
- pStreamDict->SetAtMatrix("Matrix",matrix);
- pStreamDict->SetAtRect("BBox", rcBBox);
- }
-
- pStream->SetData((FX_BYTE*)(FX_LPCSTR)sContents, sContents.GetLength(), FALSE, FALSE);
-}
-
-#define BA_ANNOT_MINWIDTH 1
-#define BA_ANNOT_MINHEIGHT 1
-
-FX_FLOAT CPDFSDK_Annot::GetMinWidth() const
-{
- return BA_ANNOT_MINWIDTH;
-}
-
-FX_FLOAT CPDFSDK_Annot::GetMinHeight() const
-{
- return BA_ANNOT_MINHEIGHT;
-}
-
-FX_BOOL CPDFSDK_Annot::CreateFormFiller()
-{
- return TRUE;
-}
-FX_BOOL CPDFSDK_Annot::IsVisible() const
-{
- int nFlags = GetFlags();
- return !((nFlags & ANNOTFLAG_INVISIBLE) || (nFlags & ANNOTFLAG_HIDDEN) || (nFlags & ANNOTFLAG_NOVIEW));
-}
-
-CPDF_Action CPDFSDK_Annot::GetAction() const
-{
- ASSERT(m_pAnnot != NULL);
- ASSERT(m_pAnnot->m_pAnnotDict != NULL);
-
- return m_pAnnot->m_pAnnotDict->GetDict("A");
-}
-
-void CPDFSDK_Annot::SetAction(const CPDF_Action& action)
-{
- ASSERT(m_pAnnot != NULL);
- ASSERT(m_pAnnot->m_pAnnotDict != NULL);
-
- ASSERT(action != NULL);
-
- if ((CPDF_Action&)action != m_pAnnot->m_pAnnotDict->GetDict("A"))
- {
- CPDF_Document* pDoc = m_pPageView->GetPDFDocument();
- ASSERT(pDoc != NULL);
-
- if (action.m_pDict && (action.m_pDict->GetObjNum() == 0))
- pDoc->AddIndirectObject(action.m_pDict);
- m_pAnnot->m_pAnnotDict->SetAtReference("A", pDoc, action.m_pDict->GetObjNum());
- }
-}
-
-void CPDFSDK_Annot::RemoveAction()
-{
- ASSERT(m_pAnnot != NULL);
- ASSERT(m_pAnnot->m_pAnnotDict != NULL);
-
- m_pAnnot->m_pAnnotDict->RemoveAt("A");
-}
-
-CPDF_AAction CPDFSDK_Annot::GetAAction() const
-{
- ASSERT(m_pAnnot != NULL);
- ASSERT(m_pAnnot->m_pAnnotDict != NULL);
-
- return m_pAnnot->m_pAnnotDict->GetDict("AA");
-}
-
-void CPDFSDK_Annot::SetAAction(const CPDF_AAction& aa)
-{
- ASSERT(m_pAnnot != NULL);
- ASSERT(m_pAnnot->m_pAnnotDict != NULL);
- ASSERT(aa != NULL);
-
- if ((CPDF_AAction&)aa != m_pAnnot->m_pAnnotDict->GetDict("AA"))
- m_pAnnot->m_pAnnotDict->SetAt("AA", (CPDF_AAction&)aa);
-}
-
-void CPDFSDK_Annot::RemoveAAction()
-{
- ASSERT(m_pAnnot != NULL);
- ASSERT(m_pAnnot->m_pAnnotDict != NULL);
-
- m_pAnnot->m_pAnnotDict->RemoveAt("AA");
-}
-
-CPDF_Action CPDFSDK_Annot::GetAAction(CPDF_AAction::AActionType eAAT)
-{
- CPDF_AAction AAction = GetAAction();
-
- if (AAction.ActionExist(eAAT))
- {
- return AAction.GetAction(eAAT);
- }
- else if (eAAT == CPDF_AAction::ButtonUp)
- {
- return GetAction();
- }
-
- return NULL;
-}
-
-void CPDFSDK_Annot::Annot_OnDraw(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, CPDF_RenderOptions* pOptions)
-{
-
- m_pAnnot->GetAPForm(m_pPageView->GetPDFPage(), CPDF_Annot::Normal);
- m_pAnnot->DrawAppearance(m_pPageView->GetPDFPage(), pDevice, pUser2Device, CPDF_Annot::Normal, NULL);
-
- return ;
-}
-
-CPDF_Page* CPDFSDK_Annot::GetPDFPage()
-{
- if(m_pPageView)
- return m_pPageView->GetPDFPage();
- return NULL;
-}
-
+// 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
+
+#include "../include/fsdk_define.h"
+#include "../include/fsdk_mgr.h"
+#include "../include/fsdk_baseannot.h"
+
+
+//---------------------------------------------------------------------------
+// CPDFSDK_DateTime
+//---------------------------------------------------------------------------
+int _gAfxGetTimeZoneInSeconds(FX_CHAR tzhour, FX_BYTE tzminute)
+{
+ return (int)tzhour * 3600 + (int)tzminute * (tzhour >= 0 ? 60 : -60);
+}
+
+FX_BOOL _gAfxIsLeapYear(FX_SHORT year)
+{
+ return ((year % 400 == 0) || ((year % 4 == 0) && (year % 100 != 0)));
+}
+
+FX_WORD _gAfxGetYearDays(FX_SHORT year)
+{
+ return (_gAfxIsLeapYear(year) == TRUE ? 366 : 365);
+}
+
+FX_BYTE _gAfxGetMonthDays(FX_SHORT year, FX_BYTE month)
+{
+ FX_BYTE mDays;
+ switch (month)
+ {
+ case 1:
+ case 3:
+ case 5:
+ case 7:
+ case 8:
+ case 10:
+ case 12:
+ mDays = 31;
+ break;
+
+ case 4:
+ case 6:
+ case 9:
+ case 11:
+ mDays = 30;
+ break;
+
+ case 2:
+ if (_gAfxIsLeapYear(year) == TRUE)
+ mDays = 29;
+ else
+ mDays = 28;
+ break;
+
+ default:
+ mDays = 0;
+ break;
+ }
+
+ return mDays;
+}
+
+CPDFSDK_DateTime::CPDFSDK_DateTime()
+{
+ ResetDateTime();
+}
+
+CPDFSDK_DateTime::CPDFSDK_DateTime(const CFX_ByteString& dtStr)
+{
+ ResetDateTime();
+
+ FromPDFDateTimeString(dtStr);
+}
+
+CPDFSDK_DateTime::CPDFSDK_DateTime(const CPDFSDK_DateTime& datetime)
+{
+ operator = (datetime);
+}
+
+CPDFSDK_DateTime::CPDFSDK_DateTime(const FX_SYSTEMTIME& st)
+{
+ operator = (st) ;
+}
+
+
+void CPDFSDK_DateTime::ResetDateTime()
+{
+ tzset();
+
+ time_t curTime;
+ time(&curTime);
+ struct tm* newtime;
+ //newtime = gmtime(&curTime);
+ newtime = localtime(&curTime);
+
+ dt.year = newtime->tm_year + 1900;
+ dt.month = newtime->tm_mon + 1;
+ dt.day = newtime->tm_mday;
+ dt.hour = newtime->tm_hour;
+ dt.minute = newtime->tm_min;
+ dt.second = newtime->tm_sec;
+// dt.tzHour = _timezone / 3600 * -1;
+// dt.tzMinute = (abs(_timezone) % 3600) / 60;
+}
+
+CPDFSDK_DateTime& CPDFSDK_DateTime::operator = (const CPDFSDK_DateTime& datetime)
+{
+ FXSYS_memcpy(&dt, &datetime.dt, sizeof(FX_DATETIME));
+ return *this;
+}
+
+CPDFSDK_DateTime& CPDFSDK_DateTime::operator = (const FX_SYSTEMTIME& st)
+{
+ tzset();
+
+ dt.year = (FX_SHORT)st.wYear;
+ dt.month = (FX_BYTE)st.wMonth;
+ dt.day = (FX_BYTE)st.wDay;
+ dt.hour = (FX_BYTE)st.wHour;
+ dt.minute = (FX_BYTE)st.wMinute;
+ dt.second = (FX_BYTE)st.wSecond;
+// dt.tzHour = _timezone / 3600 * -1;
+// dt.tzMinute = (abs(_timezone) % 3600) / 60;
+ return *this;
+}
+
+FX_BOOL CPDFSDK_DateTime::operator == (CPDFSDK_DateTime& datetime)
+{
+ return (FXSYS_memcmp(&dt, &datetime.dt, sizeof(FX_DATETIME)) == 0);
+}
+
+FX_BOOL CPDFSDK_DateTime::operator != (CPDFSDK_DateTime& datetime)
+{
+ return (FXSYS_memcmp(&dt, &datetime.dt, sizeof(FX_DATETIME)) != 0);
+}
+
+FX_BOOL CPDFSDK_DateTime::operator > (CPDFSDK_DateTime& datetime)
+{
+ CPDFSDK_DateTime dt1 = ToGMT();
+ CPDFSDK_DateTime dt2 = datetime.ToGMT();
+ int d1 = (((int)dt1.dt.year) << 16) | (((int)dt1.dt.month) << 8) | (int)dt1.dt.day;
+ int d2 = (((int)dt1.dt.hour) << 16) | (((int)dt1.dt.minute) << 8) | (int)dt1.dt.second;
+ int d3 = (((int)dt2.dt.year) << 16) | (((int)dt2.dt.month) << 8) | (int)dt2.dt.day;
+ int d4 = (((int)dt2.dt.hour) << 16) | (((int)dt2.dt.minute) << 8) | (int)dt2.dt.second;
+
+ if (d1 > d3) return TRUE;
+ if (d2 > d4) return TRUE;
+ return FALSE;
+}
+
+FX_BOOL CPDFSDK_DateTime::operator >= (CPDFSDK_DateTime& datetime)
+{
+ CPDFSDK_DateTime dt1 = ToGMT();
+ CPDFSDK_DateTime dt2 = datetime.ToGMT();
+ int d1 = (((int)dt1.dt.year) << 16) | (((int)dt1.dt.month) << 8) | (int)dt1.dt.day;
+ int d2 = (((int)dt1.dt.hour) << 16) | (((int)dt1.dt.minute) << 8) | (int)dt1.dt.second;
+ int d3 = (((int)dt2.dt.year) << 16) | (((int)dt2.dt.month) << 8) | (int)dt2.dt.day;
+ int d4 = (((int)dt2.dt.hour) << 16) | (((int)dt2.dt.minute) << 8) | (int)dt2.dt.second;
+
+ if (d1 >= d3) return TRUE;
+ if (d2 >= d4) return TRUE;
+ return FALSE;
+}
+
+FX_BOOL CPDFSDK_DateTime::operator < (CPDFSDK_DateTime& datetime)
+{
+ CPDFSDK_DateTime dt1 = ToGMT();
+ CPDFSDK_DateTime dt2 = datetime.ToGMT();
+ int d1 = (((int)dt1.dt.year) << 16) | (((int)dt1.dt.month) << 8) | (int)dt1.dt.day;
+ int d2 = (((int)dt1.dt.hour) << 16) | (((int)dt1.dt.minute) << 8) | (int)dt1.dt.second;
+ int d3 = (((int)dt2.dt.year) << 16) | (((int)dt2.dt.month) << 8) | (int)dt2.dt.day;
+ int d4 = (((int)dt2.dt.hour) << 16) | (((int)dt2.dt.minute) << 8) | (int)dt2.dt.second;
+
+ if (d1 < d3) return TRUE;
+ if (d2 < d4) return TRUE;
+ return FALSE;
+}
+
+FX_BOOL CPDFSDK_DateTime::operator <= (CPDFSDK_DateTime& datetime)
+{
+ CPDFSDK_DateTime dt1 = ToGMT();
+ CPDFSDK_DateTime dt2 = datetime.ToGMT();
+ int d1 = (((int)dt1.dt.year) << 16) | (((int)dt1.dt.month) << 8) | (int)dt1.dt.day;
+ int d2 = (((int)dt1.dt.hour) << 16) | (((int)dt1.dt.minute) << 8) | (int)dt1.dt.second;
+ int d3 = (((int)dt2.dt.year) << 16) | (((int)dt2.dt.month) << 8) | (int)dt2.dt.day;
+ int d4 = (((int)dt2.dt.hour) << 16) | (((int)dt2.dt.minute) << 8) | (int)dt2.dt.second;
+
+ if (d1 <= d3) return TRUE;
+ if (d2 <= d4) return TRUE;
+ return FALSE;
+}
+
+CPDFSDK_DateTime::operator time_t()
+{
+ struct tm newtime;
+
+ newtime.tm_year = dt.year - 1900;
+ newtime.tm_mon = dt.month - 1;
+ newtime.tm_mday = dt.day;
+ newtime.tm_hour = dt.hour;
+ newtime.tm_min = dt.minute;
+ newtime.tm_sec = dt.second;
+
+ return mktime(&newtime);
+}
+
+CPDFSDK_DateTime& CPDFSDK_DateTime::FromPDFDateTimeString(const CFX_ByteString& dtStr)
+{
+ int strLength = dtStr.GetLength();
+ if (strLength > 0)
+ {
+ int i = 0;
+ int j, k;
+ FX_CHAR ch;
+ while (i < strLength)
+ {
+ ch = dtStr[i];
+ if (ch >= '0' && ch <= '9') break;
+ i ++;
+ }
+ if (i >= strLength) return *this;
+
+ j = 0;
+ k = 0;
+ while (i < strLength && j < 4)
+ {
+ ch = dtStr[i];
+ k = k * 10 + ch - '0';
+ j ++;
+ if (ch < '0' || ch > '9') break;
+ i ++;
+ }
+ dt.year = (FX_SHORT)k;
+ if (i >= strLength || j < 4) return *this;
+
+ j = 0;
+ k = 0;
+ while (i < strLength && j < 2)
+ {
+ ch = dtStr[i];
+ k = k * 10 + ch - '0';
+ j ++;
+ if (ch < '0' || ch > '9') break;
+ i ++;
+ }
+ dt.month = (FX_BYTE)k;
+ if (i >= strLength || j < 2) return *this;
+
+ j = 0;
+ k = 0;
+ while (i < strLength && j < 2)
+ {
+ ch = dtStr[i];
+ k = k * 10 + ch - '0';
+ j ++;
+ if (ch < '0' || ch > '9') break;
+ i ++;
+ }
+ dt.day = (FX_BYTE)k;
+ if (i >= strLength || j < 2) return *this;
+
+ j = 0;
+ k = 0;
+ while (i < strLength && j < 2)
+ {
+ ch = dtStr[i];
+ k = k * 10 + ch - '0';
+ j ++;
+ if (ch < '0' || ch > '9') break;
+ i ++;
+ }
+ dt.hour = (FX_BYTE)k;
+ if (i >= strLength || j < 2) return *this;
+
+ j = 0;
+ k = 0;
+ while (i < strLength && j < 2)
+ {
+ ch = dtStr[i];
+ k = k * 10 + ch - '0';
+ j ++;
+ if (ch < '0' || ch > '9') break;
+ i ++;
+ }
+ dt.minute = (FX_BYTE)k;
+ if (i >= strLength || j < 2) return *this;
+
+ j = 0;
+ k = 0;
+ while (i < strLength && j < 2)
+ {
+ ch = dtStr[i];
+ k = k * 10 + ch - '0';
+ j ++;
+ if (ch < '0' || ch > '9') break;
+ i ++;
+ }
+ dt.second = (FX_BYTE)k;
+ if (i >= strLength || j < 2) return *this;
+
+ ch = dtStr[i ++];
+ if (ch != '-' && ch != '+') return *this;
+ if (ch == '-')
+ dt.tzHour = -1;
+ else
+ dt.tzHour = 1;
+ j = 0;
+ k = 0;
+ while (i < strLength && j < 2)
+ {
+ ch = dtStr[i];
+ k = k * 10 + ch - '0';
+ j ++;
+ if (ch < '0' || ch > '9') break;
+ i ++;
+ }
+ dt.tzHour *= (FX_CHAR)k;
+ if (i >= strLength || j < 2) return *this;
+
+ ch = dtStr[i ++];
+ if (ch != '\'') return *this;
+ j = 0;
+ k = 0;
+ while (i < strLength && j < 2)
+ {
+ ch = dtStr[i];
+ k = k * 10 + ch - '0';
+ j ++;
+ if (ch < '0' || ch > '9') break;
+ i ++;
+ }
+ dt.tzMinute = (FX_BYTE)k;
+ if (i >= strLength || j < 2) return *this;
+ }
+
+ return *this;
+}
+
+CFX_ByteString CPDFSDK_DateTime::ToCommonDateTimeString()
+{
+ CFX_ByteString str1;
+ str1.Format("%04d-%02d-%02d %02d:%02d:%02d ", dt.year, dt.month, dt.day, dt.hour, dt.minute, dt.second);
+ if (dt.tzHour < 0)
+ str1 += "-";
+ else
+ str1 += "+";
+ CFX_ByteString str2;
+ str2.Format("%02d:%02d", abs(dt.tzHour), dt.tzMinute);
+ return str1 + str2;
+}
+
+CFX_ByteString CPDFSDK_DateTime::ToPDFDateTimeString()
+{
+ CFX_ByteString dtStr;
+ char tempStr[32];
+ sprintf(tempStr, "D:%04d%02d%02d%02d%02d%02d", dt.year, dt.month, dt.day, dt.hour, dt.minute, dt.second);
+ dtStr = CFX_ByteString(tempStr);
+ if (dt.tzHour < 0)
+ dtStr += CFX_ByteString("-");
+ else
+ dtStr += CFX_ByteString("+");
+ sprintf(tempStr, "%02d'%02d'", abs(dt.tzHour), dt.tzMinute);
+ dtStr += CFX_ByteString(tempStr);
+ return dtStr;
+}
+
+void CPDFSDK_DateTime::ToSystemTime(FX_SYSTEMTIME& st)
+{
+ CPDFSDK_DateTime dt = *this;
+ time_t t = (time_t)dt;
+ struct tm* pTime = localtime(&t);
+ if(pTime){
+ st.wYear = (FX_WORD)pTime->tm_year + 1900;
+ st.wMonth = (FX_WORD)pTime->tm_mon + 1;
+ st.wDay = (FX_WORD)pTime->tm_mday;
+ st.wDayOfWeek = (FX_WORD)pTime->tm_wday;
+ st.wHour = (FX_WORD)pTime->tm_hour;
+ st.wMinute = (FX_WORD)pTime->tm_min;
+ st.wSecond = (FX_WORD)pTime->tm_sec;
+ st.wMilliseconds = 0;
+ }
+}
+
+CPDFSDK_DateTime CPDFSDK_DateTime::ToGMT()
+{
+ CPDFSDK_DateTime dt = *this;
+ dt.AddSeconds(-_gAfxGetTimeZoneInSeconds(dt.dt.tzHour, dt.dt.tzMinute));
+ dt.dt.tzHour = 0;
+ dt.dt.tzMinute = 0;
+ return dt;
+}
+
+CPDFSDK_DateTime& CPDFSDK_DateTime::AddDays(short days)
+{
+ if (days == 0) return *this;
+
+ FX_SHORT y = dt.year, yy;
+ FX_BYTE m = dt.month;
+ FX_BYTE d = dt.day;
+ int mdays, ydays, ldays;
+
+ ldays = days;
+ if (ldays > 0)
+ {
+ yy = y;
+ if (((FX_WORD)m * 100 + d) > 300) yy ++;
+ ydays = _gAfxGetYearDays(yy);
+ while (ldays >= ydays)
+ {
+ y ++;
+ ldays -= ydays;
+ yy ++;
+ mdays = _gAfxGetMonthDays(y, m);
+ if (d > mdays)
+ {
+ m ++;
+ d -= mdays;
+ }
+ ydays = _gAfxGetYearDays(yy);
+ }
+ mdays = _gAfxGetMonthDays(y, m) - d + 1;
+ while (ldays >= mdays)
+ {
+ ldays -= mdays;
+ m ++;
+ d = 1;
+ mdays = _gAfxGetMonthDays(y, m);
+ }
+ d += ldays;
+ }
+ else
+ {
+ ldays *= -1;
+ yy = y;
+ if (((FX_WORD)m * 100 + d) < 300) yy --;
+ ydays = _gAfxGetYearDays(yy);
+ while (ldays >= ydays)
+ {
+ y --;
+ ldays -= ydays;
+ yy --;
+ mdays = _gAfxGetMonthDays(y, m);
+ if (d > mdays)
+ {
+ m ++;
+ d -= mdays;
+ }
+ ydays = _gAfxGetYearDays(yy);
+ }
+ while (ldays >= d)
+ {
+ ldays -= d;
+ m --;
+ mdays = _gAfxGetMonthDays(y, m);
+ d = mdays;
+ }
+ d -= ldays;
+ }
+
+ dt.year = y;
+ dt.month = m;
+ dt.day = d;
+
+ return *this;
+}
+
+CPDFSDK_DateTime& CPDFSDK_DateTime::AddSeconds(int seconds)
+{
+ if (seconds == 0) return *this;
+
+ int n;
+ int days;
+
+ n = dt.hour * 3600 + dt.minute * 60 + dt.second + seconds;
+ if (n < 0)
+ {
+ days = (n - 86399) / 86400;
+ n -= days * 86400;
+ }
+ else
+ {
+ days = n / 86400;
+ n %= 86400;
+ }
+ dt.hour = (FX_BYTE)(n / 3600);
+ dt.hour %= 24;
+ n %= 3600;
+ dt.minute = (FX_BYTE)(n / 60);
+ dt.second = (FX_BYTE)(n % 60);
+ if (days != 0) AddDays(days);
+
+ return *this;
+}
+
+
+//---------------------------------------------------------------------------
+// CPDFSDK_Annot
+//---------------------------------------------------------------------------
+CPDFSDK_Annot::CPDFSDK_Annot(CPDF_Annot* pAnnot, CPDFSDK_PageView* pPageView) :
+m_pAnnot(pAnnot),
+m_pPageView(pPageView),
+m_bSelected(FALSE),
+m_nTabOrder(-1)
+{
+}
+
+CPDFSDK_Annot::~CPDFSDK_Annot()
+{
+ m_pAnnot = NULL;
+ m_pPageView = NULL;
+}
+
+CPDF_Annot* CPDFSDK_Annot::GetPDFAnnot()
+{
+ return m_pAnnot;
+}
+
+FX_DWORD CPDFSDK_Annot::GetFlags()
+{
+ ASSERT(m_pAnnot != NULL);
+
+ return m_pAnnot->GetFlags();
+}
+
+void CPDFSDK_Annot::SetPage(CPDFSDK_PageView* pPageView)
+{
+ m_pPageView = pPageView;
+}
+
+CPDFSDK_PageView* CPDFSDK_Annot::GetPageView()
+{
+ return m_pPageView;
+}
+
+FX_BOOL CPDFSDK_Annot::IsSelected()
+{
+ return m_bSelected;
+}
+
+void CPDFSDK_Annot::SetSelected(FX_BOOL bSelected)
+{
+ m_bSelected = bSelected;
+}
+
+// Tab Order
+int CPDFSDK_Annot::GetTabOrder()
+{
+ return m_nTabOrder;
+}
+
+void CPDFSDK_Annot::SetTabOrder(int iTabOrder)
+{
+ m_nTabOrder = iTabOrder;
+}
+
+CPDF_Dictionary* CPDFSDK_Annot::GetAnnotDict() const
+{
+ ASSERT(m_pAnnot != NULL);
+
+ return m_pAnnot->m_pAnnotDict;
+}
+
+void CPDFSDK_Annot::SetRect(const CPDF_Rect& rect)
+{
+ ASSERT(m_pAnnot != NULL);
+ ASSERT(m_pAnnot->m_pAnnotDict != NULL);
+ ASSERT(rect.right - rect.left >= GetMinWidth());
+ ASSERT(rect.top - rect.bottom >= GetMinHeight());
+
+ m_pAnnot->m_pAnnotDict->SetAtRect("Rect", rect);
+}
+
+CPDF_Rect CPDFSDK_Annot::GetRect() const
+{
+ ASSERT(m_pAnnot != NULL);
+
+ CPDF_Rect rect;
+ m_pAnnot->GetRect(rect);
+
+ return rect;
+}
+
+CFX_ByteString CPDFSDK_Annot::GetType() const
+{
+ ASSERT(m_pAnnot != NULL);
+
+ return m_pAnnot->GetSubType();
+}
+
+CFX_ByteString CPDFSDK_Annot::GetSubType() const
+{
+ return "";
+}
+
+void CPDFSDK_Annot::ResetAppearance()
+{
+ ASSERT(FALSE);
+}
+
+void CPDFSDK_Annot::DrawAppearance(CFX_RenderDevice* pDevice, const CPDF_Matrix* pUser2Device,
+ CPDF_Annot::AppearanceMode mode, const CPDF_RenderOptions* pOptions)
+{
+ ASSERT(m_pPageView != NULL);
+ ASSERT(m_pAnnot != NULL);
+
+ m_pAnnot->DrawAppearance(m_pPageView->GetPDFPage(), pDevice, pUser2Device, mode, pOptions);
+}
+
+FX_BOOL CPDFSDK_Annot::IsAppearanceValid()
+{
+ ASSERT(m_pAnnot != NULL);
+ ASSERT(m_pAnnot->m_pAnnotDict != NULL);
+
+ return m_pAnnot->m_pAnnotDict->GetDict("AP") != NULL;
+}
+
+FX_BOOL CPDFSDK_Annot::IsAppearanceValid(CPDF_Annot::AppearanceMode mode)
+{
+ ASSERT(m_pAnnot != NULL);
+ ASSERT(m_pAnnot->m_pAnnotDict != NULL);
+
+ CPDF_Dictionary* pAP = m_pAnnot->m_pAnnotDict->GetDict("AP");
+ if (pAP == NULL) return FALSE;
+
+ // Choose the right sub-ap
+ const FX_CHAR* ap_entry = "N";
+ if (mode == CPDF_Annot::Down)
+ ap_entry = "D";
+ else if (mode == CPDF_Annot::Rollover)
+ ap_entry = "R";
+ if (!pAP->KeyExist(ap_entry))
+ ap_entry = "N";
+
+ // Get the AP stream or subdirectory
+ CPDF_Object* psub = pAP->GetElementValue(ap_entry);
+ if (psub == NULL) return FALSE;
+
+ return TRUE;
+}
+
+void CPDFSDK_Annot::DrawBorder(CFX_RenderDevice* pDevice, const CPDF_Matrix* pUser2Device,
+ const CPDF_RenderOptions* pOptions)
+{
+ ASSERT(m_pAnnot != NULL);
+ m_pAnnot->DrawBorder(pDevice, pUser2Device, pOptions);
+}
+
+void CPDFSDK_Annot::ClearCachedAP()
+{
+ ASSERT(m_pAnnot != NULL);
+ m_pAnnot->ClearCachedAP();
+}
+
+void CPDFSDK_Annot::SetContents(const CFX_WideString& sContents)
+{
+ ASSERT(m_pAnnot != NULL);
+ ASSERT(m_pAnnot->m_pAnnotDict != NULL);
+
+ if (sContents.IsEmpty())
+ m_pAnnot->m_pAnnotDict->RemoveAt("Contents");
+ else
+ m_pAnnot->m_pAnnotDict->SetAtString("Contents", PDF_EncodeText(sContents));
+}
+
+CFX_WideString CPDFSDK_Annot::GetContents() const
+{
+ ASSERT(m_pAnnot != NULL);
+ ASSERT(m_pAnnot->m_pAnnotDict != NULL);
+
+ return m_pAnnot->m_pAnnotDict->GetUnicodeText("Contents");
+}
+
+void CPDFSDK_Annot::SetAnnotName(const CFX_WideString& sName)
+{
+ ASSERT(m_pAnnot != NULL);
+ ASSERT(m_pAnnot->m_pAnnotDict != NULL);
+
+ if (sName.IsEmpty())
+ m_pAnnot->m_pAnnotDict->RemoveAt("NM");
+ else
+ m_pAnnot->m_pAnnotDict->SetAtString("NM", PDF_EncodeText(sName));
+}
+
+CFX_WideString CPDFSDK_Annot::GetAnnotName() const
+{
+ ASSERT(m_pAnnot != NULL);
+ ASSERT(m_pAnnot->m_pAnnotDict != NULL);
+
+ return m_pAnnot->m_pAnnotDict->GetUnicodeText("NM");
+}
+
+void CPDFSDK_Annot::SetModifiedDate(const FX_SYSTEMTIME& st)
+{
+ ASSERT(m_pAnnot != NULL);
+ ASSERT(m_pAnnot->m_pAnnotDict != NULL);
+
+ CPDFSDK_DateTime dt(st);
+ CFX_ByteString str = dt.ToPDFDateTimeString();
+
+ if (str.IsEmpty())
+ m_pAnnot->m_pAnnotDict->RemoveAt("M");
+ else
+ m_pAnnot->m_pAnnotDict->SetAtString("M", str);
+}
+
+FX_SYSTEMTIME CPDFSDK_Annot::GetModifiedDate() const
+{
+ ASSERT(m_pAnnot != NULL);
+ ASSERT(m_pAnnot->m_pAnnotDict != NULL);
+
+ FX_SYSTEMTIME systime;
+ CFX_ByteString str = m_pAnnot->m_pAnnotDict->GetString("M");
+
+ CPDFSDK_DateTime dt(str);
+ dt.ToSystemTime(systime);
+
+ return systime;
+}
+
+void CPDFSDK_Annot::SetFlags(int nFlags)
+{
+ ASSERT(m_pAnnot != NULL);
+ ASSERT(m_pAnnot->m_pAnnotDict != NULL);
+
+ m_pAnnot->m_pAnnotDict->SetAtInteger("F", nFlags);
+}
+
+int CPDFSDK_Annot::GetFlags() const
+{
+ ASSERT(m_pAnnot != NULL);
+ ASSERT(m_pAnnot->m_pAnnotDict != NULL);
+
+ return m_pAnnot->m_pAnnotDict->GetInteger("F");
+}
+
+void CPDFSDK_Annot::SetAppState(const CFX_ByteString& str)
+{
+ ASSERT(m_pAnnot != NULL);
+ ASSERT(m_pAnnot->m_pAnnotDict != NULL);
+
+ if (str.IsEmpty())
+ m_pAnnot->m_pAnnotDict->RemoveAt("AS");
+ else
+ m_pAnnot->m_pAnnotDict->SetAtString("AS", str);
+}
+
+CFX_ByteString CPDFSDK_Annot::GetAppState() const
+{
+ ASSERT(m_pAnnot != NULL);
+ ASSERT(m_pAnnot->m_pAnnotDict != NULL);
+
+ return m_pAnnot->m_pAnnotDict->GetString("AS");
+}
+
+void CPDFSDK_Annot::SetStructParent(int key)
+{
+ ASSERT(m_pAnnot != NULL);
+ ASSERT(m_pAnnot->m_pAnnotDict != NULL);
+
+ m_pAnnot->m_pAnnotDict->SetAtInteger("StructParent", key);
+}
+
+int CPDFSDK_Annot::GetStructParent() const
+{
+ ASSERT(m_pAnnot != NULL);
+ ASSERT(m_pAnnot->m_pAnnotDict != NULL);
+
+ return m_pAnnot->m_pAnnotDict->GetInteger("StructParent");
+}
+
+//border
+void CPDFSDK_Annot::SetBorderWidth(int nWidth)
+{
+ ASSERT(m_pAnnot != NULL);
+ ASSERT(m_pAnnot->m_pAnnotDict != NULL);
+
+ CPDF_Array* pBorder = m_pAnnot->m_pAnnotDict->GetArray("Border");
+
+ if (pBorder)
+ {
+ pBorder->SetAt(2, FX_NEW CPDF_Number(nWidth));
+ }
+ else
+ {
+ CPDF_Dictionary* pBSDict = m_pAnnot->m_pAnnotDict->GetDict("BS");
+
+ if (!pBSDict)
+ {
+ pBSDict = FX_NEW CPDF_Dictionary;
+ m_pAnnot->m_pAnnotDict->SetAt("BS", pBSDict);
+ }
+
+ pBSDict->SetAtInteger("W", nWidth);
+ }
+}
+
+int CPDFSDK_Annot::GetBorderWidth() const
+{
+ ASSERT(m_pAnnot != NULL);
+ ASSERT(m_pAnnot->m_pAnnotDict != NULL);
+
+ CPDF_Array* pBorder = m_pAnnot->m_pAnnotDict->GetArray("Border");
+
+ if (pBorder)
+ {
+ return pBorder->GetInteger(2);
+ }
+ else
+ {
+ CPDF_Dictionary* pBSDict = m_pAnnot->m_pAnnotDict->GetDict("BS");
+
+ if (pBSDict)
+ {
+ return pBSDict->GetInteger("W", 1);
+ }
+ }
+ return 1;
+}
+
+void CPDFSDK_Annot::SetBorderStyle(int nStyle)
+{
+ ASSERT(m_pAnnot != NULL);
+ ASSERT(m_pAnnot->m_pAnnotDict != NULL);
+
+ CPDF_Dictionary* pBSDict = m_pAnnot->m_pAnnotDict->GetDict("BS");
+ if (!pBSDict)
+ {
+ pBSDict = FX_NEW CPDF_Dictionary;
+ m_pAnnot->m_pAnnotDict->SetAt("BS", pBSDict);
+ }
+
+ switch (nStyle)
+ {
+ case BBS_SOLID:
+ pBSDict->SetAtName("S", "S");
+ break;
+ case BBS_DASH:
+ pBSDict->SetAtName("S", "D");
+ break;
+ case BBS_BEVELED:
+ pBSDict->SetAtName("S", "B");
+ break;
+ case BBS_INSET:
+ pBSDict->SetAtName("S", "I");
+ break;
+ case BBS_UNDERLINE:
+ pBSDict->SetAtName("S", "U");
+ break;
+ }
+}
+
+int CPDFSDK_Annot::GetBorderStyle() const
+{
+ ASSERT(m_pAnnot != NULL);
+ ASSERT(m_pAnnot->m_pAnnotDict != NULL);
+
+ CPDF_Dictionary* pBSDict = m_pAnnot->m_pAnnotDict->GetDict("BS");
+ if (pBSDict)
+ {
+ CFX_ByteString sBorderStyle = pBSDict->GetString("S", "S");
+ if (sBorderStyle == "S") return BBS_SOLID;
+ if (sBorderStyle == "D") return BBS_DASH;
+ if (sBorderStyle == "B") return BBS_BEVELED;
+ if (sBorderStyle == "I") return BBS_INSET;
+ if (sBorderStyle == "U") return BBS_UNDERLINE;
+ }
+
+ CPDF_Array* pBorder = m_pAnnot->m_pAnnotDict->GetArray("Border");
+ if (pBorder)
+ {
+ if (pBorder->GetCount() >= 4)
+ {
+ CPDF_Array *pDP = pBorder->GetArray(3);
+ if (pDP && pDP->GetCount() > 0)
+ return BBS_DASH;
+ }
+ }
+
+ return BBS_SOLID;
+}
+
+void CPDFSDK_Annot::SetBorderDash(const CFX_IntArray& array)
+{
+ ASSERT(m_pAnnot != NULL);
+ ASSERT(m_pAnnot->m_pAnnotDict != NULL);
+
+ CPDF_Dictionary* pBSDict = m_pAnnot->m_pAnnotDict->GetDict("BS");
+ if (!pBSDict)
+ {
+ pBSDict = FX_NEW CPDF_Dictionary;
+ m_pAnnot->m_pAnnotDict->SetAt("BS", pBSDict);
+ }
+
+ CPDF_Array* pArray = FX_NEW CPDF_Array;
+ for (int i=0,sz=array.GetSize(); i<sz; i++)
+ {
+ pArray->AddInteger(array[i]);
+ }
+
+ pBSDict->SetAt("D", pArray);
+}
+
+void CPDFSDK_Annot::GetBorderDash(CFX_IntArray& array) const
+{
+ ASSERT(m_pAnnot != NULL);
+ ASSERT(m_pAnnot->m_pAnnotDict != NULL);
+
+ CPDF_Array* pDash = NULL;
+
+ CPDF_Array* pBorder = m_pAnnot->m_pAnnotDict->GetArray("Border");
+ if (pBorder)
+ {
+ pDash = pBorder->GetArray(3);
+ }
+ else
+ {
+ CPDF_Dictionary* pBSDict = m_pAnnot->m_pAnnotDict->GetDict("BS");
+ if (pBSDict)
+ {
+ pDash = pBSDict->GetArray("D");
+ }
+ }
+
+ if (pDash)
+ {
+ for (int i=0,sz=pDash->GetCount(); i<sz; i++)
+ {
+ array.Add(pDash->GetInteger(i));
+ }
+ }
+}
+
+void CPDFSDK_Annot::SetColor(FX_COLORREF color)
+{
+ ASSERT(m_pAnnot != NULL);
+ ASSERT(m_pAnnot->m_pAnnotDict != NULL);
+
+ CPDF_Array* pArray = FX_NEW CPDF_Array;
+ pArray->AddNumber((FX_FLOAT)FXSYS_GetRValue(color) / 255.0f);
+ pArray->AddNumber((FX_FLOAT)FXSYS_GetGValue(color) / 255.0f);
+ pArray->AddNumber((FX_FLOAT)FXSYS_GetBValue(color) / 255.0f);
+ m_pAnnot->m_pAnnotDict->SetAt("C", pArray);
+}
+
+void CPDFSDK_Annot::RemoveColor()
+{
+ ASSERT(m_pAnnot != NULL);
+ ASSERT(m_pAnnot->m_pAnnotDict != NULL);
+
+ m_pAnnot->m_pAnnotDict->RemoveAt("C") ;
+}
+
+FX_BOOL CPDFSDK_Annot::GetColor(FX_COLORREF& color) const
+{
+ ASSERT(m_pAnnot != NULL);
+ ASSERT(m_pAnnot->m_pAnnotDict != NULL);
+
+ if (CPDF_Array* pEntry = m_pAnnot->m_pAnnotDict->GetArray("C"))
+ {
+ int nCount = pEntry->GetCount();
+ if (nCount == 1)
+ {
+ FX_FLOAT g = pEntry->GetNumber(0) * 255;
+
+ color = FXSYS_RGB((int)g, (int)g, (int)g);
+
+ return TRUE;
+ }
+ else if (nCount == 3)
+ {
+ FX_FLOAT r = pEntry->GetNumber(0) * 255;
+ FX_FLOAT g = pEntry->GetNumber(1) * 255;
+ FX_FLOAT b = pEntry->GetNumber(2) * 255;
+
+ color = FXSYS_RGB((int)r, (int)g, (int)b);
+
+ return TRUE;
+ }
+ else if (nCount == 4)
+ {
+ FX_FLOAT c = pEntry->GetNumber(0);
+ FX_FLOAT m = pEntry->GetNumber(1);
+ FX_FLOAT y = pEntry->GetNumber(2);
+ FX_FLOAT k = pEntry->GetNumber(3);
+
+ FX_FLOAT r = 1.0f - FX_MIN(1.0f, c + k);
+ FX_FLOAT g = 1.0f - FX_MIN(1.0f, m + k);
+ FX_FLOAT b = 1.0f - FX_MIN(1.0f, y + k);
+
+ color = FXSYS_RGB((int)(r * 255), (int)(g * 255), (int)(b * 255));
+
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
+
+void CPDFSDK_Annot::WriteAppearance(const CFX_ByteString& sAPType, const CPDF_Rect& rcBBox,
+ const CPDF_Matrix& matrix, const CFX_ByteString& sContents,
+ const CFX_ByteString& sAPState)
+{
+ ASSERT(m_pAnnot != NULL);
+ ASSERT(m_pAnnot->m_pAnnotDict != NULL);
+
+ CPDF_Dictionary* pAPDict = m_pAnnot->m_pAnnotDict->GetDict("AP");
+
+ if (!pAPDict)
+ {
+ pAPDict = FX_NEW CPDF_Dictionary;
+ m_pAnnot->m_pAnnotDict->SetAt("AP", pAPDict);
+ }
+
+ CPDF_Stream* pStream = NULL;
+ CPDF_Dictionary* pParentDict = NULL;
+
+ if (sAPState.IsEmpty())
+ {
+ pParentDict = pAPDict;
+ pStream = pAPDict->GetStream(sAPType);
+ }
+ else
+ {
+ CPDF_Dictionary* pAPTypeDict = pAPDict->GetDict(sAPType);
+ if (!pAPTypeDict)
+ {
+ pAPTypeDict = FX_NEW CPDF_Dictionary;
+ pAPDict->SetAt(sAPType, pAPTypeDict);
+ }
+
+ pParentDict = pAPTypeDict;
+ pStream = pAPTypeDict->GetStream(sAPState);
+ }
+
+ if (!pStream)
+ {
+ ASSERT(m_pPageView != NULL);
+ CPDF_Document* pDoc = m_pPageView->GetPDFDocument();
+ ASSERT(pDoc != NULL);
+
+ pStream = FX_NEW CPDF_Stream(NULL, 0, NULL);
+ FX_INT32 objnum = pDoc->AddIndirectObject(pStream);
+ //pAPDict->SetAtReference(sAPType, pDoc, objnum);
+ ASSERT(pParentDict != NULL);
+ pParentDict->SetAtReference(sAPType, pDoc, objnum);
+ }
+
+ CPDF_Dictionary * pStreamDict = pStream->GetDict();
+
+ if (!pStreamDict)
+ {
+ pStreamDict = FX_NEW CPDF_Dictionary;
+ pStreamDict->SetAtName("Type", "XObject");
+ pStreamDict->SetAtName("Subtype", "Form");
+ pStreamDict->SetAtInteger("FormType", 1);
+ pStream->InitStream(NULL,0,pStreamDict);
+ }
+
+ if (pStreamDict)
+ {
+ pStreamDict->SetAtMatrix("Matrix",matrix);
+ pStreamDict->SetAtRect("BBox", rcBBox);
+ }
+
+ pStream->SetData((FX_BYTE*)(FX_LPCSTR)sContents, sContents.GetLength(), FALSE, FALSE);
+}
+
+#define BA_ANNOT_MINWIDTH 1
+#define BA_ANNOT_MINHEIGHT 1
+
+FX_FLOAT CPDFSDK_Annot::GetMinWidth() const
+{
+ return BA_ANNOT_MINWIDTH;
+}
+
+FX_FLOAT CPDFSDK_Annot::GetMinHeight() const
+{
+ return BA_ANNOT_MINHEIGHT;
+}
+
+FX_BOOL CPDFSDK_Annot::CreateFormFiller()
+{
+ return TRUE;
+}
+FX_BOOL CPDFSDK_Annot::IsVisible() const
+{
+ int nFlags = GetFlags();
+ return !((nFlags & ANNOTFLAG_INVISIBLE) || (nFlags & ANNOTFLAG_HIDDEN) || (nFlags & ANNOTFLAG_NOVIEW));
+}
+
+CPDF_Action CPDFSDK_Annot::GetAction() const
+{
+ ASSERT(m_pAnnot != NULL);
+ ASSERT(m_pAnnot->m_pAnnotDict != NULL);
+
+ return m_pAnnot->m_pAnnotDict->GetDict("A");
+}
+
+void CPDFSDK_Annot::SetAction(const CPDF_Action& action)
+{
+ ASSERT(m_pAnnot != NULL);
+ ASSERT(m_pAnnot->m_pAnnotDict != NULL);
+
+ ASSERT(action != NULL);
+
+ if ((CPDF_Action&)action != m_pAnnot->m_pAnnotDict->GetDict("A"))
+ {
+ CPDF_Document* pDoc = m_pPageView->GetPDFDocument();
+ ASSERT(pDoc != NULL);
+
+ if (action.m_pDict && (action.m_pDict->GetObjNum() == 0))
+ pDoc->AddIndirectObject(action.m_pDict);
+ m_pAnnot->m_pAnnotDict->SetAtReference("A", pDoc, action.m_pDict->GetObjNum());
+ }
+}
+
+void CPDFSDK_Annot::RemoveAction()
+{
+ ASSERT(m_pAnnot != NULL);
+ ASSERT(m_pAnnot->m_pAnnotDict != NULL);
+
+ m_pAnnot->m_pAnnotDict->RemoveAt("A");
+}
+
+CPDF_AAction CPDFSDK_Annot::GetAAction() const
+{
+ ASSERT(m_pAnnot != NULL);
+ ASSERT(m_pAnnot->m_pAnnotDict != NULL);
+
+ return m_pAnnot->m_pAnnotDict->GetDict("AA");
+}
+
+void CPDFSDK_Annot::SetAAction(const CPDF_AAction& aa)
+{
+ ASSERT(m_pAnnot != NULL);
+ ASSERT(m_pAnnot->m_pAnnotDict != NULL);
+ ASSERT(aa != NULL);
+
+ if ((CPDF_AAction&)aa != m_pAnnot->m_pAnnotDict->GetDict("AA"))
+ m_pAnnot->m_pAnnotDict->SetAt("AA", (CPDF_AAction&)aa);
+}
+
+void CPDFSDK_Annot::RemoveAAction()
+{
+ ASSERT(m_pAnnot != NULL);
+ ASSERT(m_pAnnot->m_pAnnotDict != NULL);
+
+ m_pAnnot->m_pAnnotDict->RemoveAt("AA");
+}
+
+CPDF_Action CPDFSDK_Annot::GetAAction(CPDF_AAction::AActionType eAAT)
+{
+ CPDF_AAction AAction = GetAAction();
+
+ if (AAction.ActionExist(eAAT))
+ {
+ return AAction.GetAction(eAAT);
+ }
+ else if (eAAT == CPDF_AAction::ButtonUp)
+ {
+ return GetAction();
+ }
+
+ return NULL;
+}
+
+void CPDFSDK_Annot::Annot_OnDraw(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, CPDF_RenderOptions* pOptions)
+{
+
+ m_pAnnot->GetAPForm(m_pPageView->GetPDFPage(), CPDF_Annot::Normal);
+ m_pAnnot->DrawAppearance(m_pPageView->GetPDFPage(), pDevice, pUser2Device, CPDF_Annot::Normal, NULL);
+
+ return ;
+}
+
+CPDF_Page* CPDFSDK_Annot::GetPDFPage()
+{
+ if(m_pPageView)
+ return m_pPageView->GetPDFPage();
+ return NULL;
+}
+
diff --git a/fpdfsdk/src/fsdk_baseform.cpp b/fpdfsdk/src/fsdk_baseform.cpp
index 23d9ec9c47..ae3b6364d3 100644
--- a/fpdfsdk/src/fsdk_baseform.cpp
+++ b/fpdfsdk/src/fsdk_baseform.cpp
@@ -1,3111 +1,3111 @@
-// 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
-
-#include "../include/fsdk_define.h"
-#include "../include/fsdk_mgr.h"
-#include "../include/fsdk_baseannot.h"
-#include "../include/fsdk_baseform.h"
-#include "../include/formfiller/FFL_FormFiller.h"
-#include "../include/fsdk_actionhandler.h"
-
-#include "../include/javascript/IJavaScript.h"
-
-//------------------------------------------------------------------------------------
-//* CPDFSDK_Widget
-//------------------------------------------------------------------------------------
-
-#define IsFloatZero(f) ((f) < 0.01 && (f) > -0.01)
-#define IsFloatBigger(fa,fb) ((fa) > (fb) && !IsFloatZero((fa) - (fb)))
-#define IsFloatSmaller(fa,fb) ((fa) < (fb) && !IsFloatZero((fa) - (fb)))
-#define IsFloatEqual(fa,fb) IsFloatZero((fa)-(fb))
-
-CPDFSDK_Widget::CPDFSDK_Widget(CPDF_Annot* pAnnot, CPDFSDK_PageView* pPageView, CPDFSDK_InterForm* pInterForm) :
- CPDFSDK_Annot(pAnnot, pPageView),
- m_pInterForm(pInterForm),
- m_nAppAge(0),
- m_nValueAge(0)
-{
- ASSERT(m_pInterForm != NULL);
-}
-
-CPDFSDK_Widget::~CPDFSDK_Widget()
-{
-
-}
-
-FX_BOOL CPDFSDK_Widget::IsWidgetAppearanceValid(CPDF_Annot::AppearanceMode mode)
-{
- ASSERT(m_pAnnot != NULL);
- ASSERT(m_pAnnot->m_pAnnotDict != NULL);
-
- CPDF_Dictionary* pAP = m_pAnnot->m_pAnnotDict->GetDict("AP");
- if (pAP == NULL) return FALSE;
-
- // Choose the right sub-ap
- const FX_CHAR* ap_entry = "N";
- if (mode == CPDF_Annot::Down)
- ap_entry = "D";
- else if (mode == CPDF_Annot::Rollover)
- ap_entry = "R";
- if (!pAP->KeyExist(ap_entry))
- ap_entry = "N";
-
- // Get the AP stream or subdirectory
- CPDF_Object* psub = pAP->GetElementValue(ap_entry);
- if (psub == NULL) return FALSE;
-
- int nFieldType = GetFieldType();
- switch (nFieldType)
- {
- case FIELDTYPE_PUSHBUTTON:
- case FIELDTYPE_COMBOBOX:
- case FIELDTYPE_LISTBOX:
- case FIELDTYPE_TEXTFIELD:
- case FIELDTYPE_SIGNATURE:
- return psub->GetType() == PDFOBJ_STREAM;
- case FIELDTYPE_CHECKBOX:
- case FIELDTYPE_RADIOBUTTON:
- if (psub->GetType() == PDFOBJ_DICTIONARY)
- {
- CPDF_Dictionary* pSubDict = (CPDF_Dictionary*)psub;
-
- return pSubDict->GetStream(this->GetAppState()) != NULL;
- }
- else
- return FALSE;
- break;
- }
-
- return TRUE;
-}
-
-int CPDFSDK_Widget::GetFieldType() const
-{
- CPDF_FormField* pField = GetFormField();
- ASSERT(pField != NULL);
-
- return pField->GetFieldType();
-}
-
-int CPDFSDK_Widget::GetFieldFlags() const
-{
- CPDF_InterForm* pPDFInterForm = m_pInterForm->GetInterForm();
- ASSERT(pPDFInterForm != NULL);
-
- CPDF_FormControl* pFormControl = pPDFInterForm->GetControlByDict(m_pAnnot->m_pAnnotDict);
- CPDF_FormField* pFormField = pFormControl->GetField();
- return pFormField->GetFieldFlags();
-}
-
-CFX_ByteString CPDFSDK_Widget::GetSubType() const
-{
- int nType = GetFieldType();
-
- if (nType == FIELDTYPE_SIGNATURE)
- return BFFT_SIGNATURE;
- return CPDFSDK_Annot::GetSubType();
-}
-
-CPDF_FormField* CPDFSDK_Widget::GetFormField() const
-{
- ASSERT(m_pInterForm != NULL);
-
- CPDF_FormControl* pCtrl = GetFormControl();
- ASSERT(pCtrl != NULL);
-
- return pCtrl->GetField();
-}
-
-CPDF_FormControl* CPDFSDK_Widget::GetFormControl() const
-{
- ASSERT(m_pInterForm != NULL);
-
- CPDF_InterForm* pPDFInterForm = m_pInterForm->GetInterForm();
- ASSERT(pPDFInterForm != NULL);
-
- return pPDFInterForm->GetControlByDict(GetAnnotDict());
-}
-static CPDF_Dictionary* BF_GetField(CPDF_Dictionary* pFieldDict, const FX_CHAR* name)
-{
- if (pFieldDict == NULL) return NULL;
- // First check the dictionary itself
- CPDF_Object* pAttr = pFieldDict->GetElementValue(name);
- if (pAttr) return pFieldDict;
-
- // Now we need to search from parents
- CPDF_Dictionary* pParent = pFieldDict->GetDict("Parent");
- if (pParent == NULL) return NULL;
-
- return BF_GetField(pParent, name);
-}
-
-CPDF_FormControl* CPDFSDK_Widget::GetFormControl(CPDF_InterForm* pInterForm, CPDF_Dictionary* pAnnotDict)
-{
- ASSERT(pInterForm != NULL);
- ASSERT(pAnnotDict != NULL);
-
- CPDF_FormControl* pControl = pInterForm->GetControlByDict(pAnnotDict);
-
- return pControl;
-}
-
-int CPDFSDK_Widget::GetRotate() const
-{
- CPDF_FormControl* pCtrl = this->GetFormControl();
- ASSERT(pCtrl != NULL);
-
- return pCtrl->GetRotation() % 360;
-}
-
-FX_BOOL CPDFSDK_Widget::GetFillColor(FX_COLORREF& color) const
-{
- CPDF_FormControl* pFormCtrl = GetFormControl();
- ASSERT(pFormCtrl != NULL);
-
- int iColorType = 0;
- color = FX_ARGBTOCOLORREF(pFormCtrl->GetBackgroundColor(iColorType));
-
- return iColorType != COLORTYPE_TRANSPARENT;
-}
-
-FX_BOOL CPDFSDK_Widget::GetBorderColor(FX_COLORREF& color) const
-{
- CPDF_FormControl* pFormCtrl = GetFormControl();
- ASSERT(pFormCtrl != NULL);
-
- int iColorType = 0;
- color = FX_ARGBTOCOLORREF(pFormCtrl->GetBorderColor(iColorType));
-
- return iColorType != COLORTYPE_TRANSPARENT;
-}
-
-FX_BOOL CPDFSDK_Widget::GetTextColor(FX_COLORREF& color) const
-{
- CPDF_FormControl* pFormCtrl = GetFormControl();
- ASSERT(pFormCtrl != NULL);
-
- CPDF_DefaultAppearance da = pFormCtrl->GetDefaultAppearance();
- if (da.HasColor())
- {
- FX_ARGB argb;
- int iColorType = COLORTYPE_TRANSPARENT;
- da.GetColor(argb, iColorType);
- color = FX_ARGBTOCOLORREF(argb);
-
- return iColorType != COLORTYPE_TRANSPARENT;
- }
-
- return FALSE;
-}
-
-FX_FLOAT CPDFSDK_Widget::GetFontSize() const
-{
- CPDF_FormControl* pFormCtrl = GetFormControl();
- ASSERT(pFormCtrl != NULL);
-
- CPDF_DefaultAppearance pDa = pFormCtrl->GetDefaultAppearance();
- CFX_ByteString csFont = "";
- FX_FLOAT fFontSize = 0.0f;
- pDa.GetFont(csFont, fFontSize);
-
- return fFontSize;
-}
-
-int CPDFSDK_Widget::GetSelectedIndex(int nIndex) const
-{
- CPDF_FormField* pFormField = GetFormField();
- ASSERT(pFormField != NULL);
-
- return pFormField->GetSelectedIndex(nIndex);
-}
-
-CFX_WideString CPDFSDK_Widget::GetValue() const
-{
- CPDF_FormField* pFormField = GetFormField();
- ASSERT(pFormField != NULL);
-
- return pFormField->GetValue();
-}
-
-CFX_WideString CPDFSDK_Widget::GetDefaultValue() const
-{
- CPDF_FormField* pFormField = GetFormField();
- ASSERT(pFormField != NULL);
-
- return pFormField->GetDefaultValue();
-}
-
-CFX_WideString CPDFSDK_Widget::GetOptionLabel(int nIndex) const
-{
- CPDF_FormField* pFormField = GetFormField();
- ASSERT(pFormField != NULL);
-
- return pFormField->GetOptionLabel(nIndex);
-}
-
-int CPDFSDK_Widget::CountOptions() const
-{
- CPDF_FormField* pFormField = GetFormField();
- ASSERT(pFormField != NULL);
-
- return pFormField->CountOptions();
-}
-
-FX_BOOL CPDFSDK_Widget::IsOptionSelected(int nIndex) const
-{
- CPDF_FormField* pFormField = GetFormField();
- ASSERT(pFormField != NULL);
-
- return pFormField->IsItemSelected(nIndex);
-}
-
-int CPDFSDK_Widget::GetTopVisibleIndex() const
-{
- CPDF_FormField* pFormField = GetFormField();
- ASSERT(pFormField != NULL);
-
- return pFormField->GetTopVisibleIndex();
-}
-
-FX_BOOL CPDFSDK_Widget::IsChecked() const
-{
- CPDF_FormControl* pFormCtrl = GetFormControl();
- ASSERT(pFormCtrl != NULL);
-
- return pFormCtrl->IsChecked();
-}
-
-int CPDFSDK_Widget::GetAlignment() const
-{
- CPDF_FormControl* pFormCtrl = GetFormControl();
- ASSERT(pFormCtrl != NULL);
-
- return pFormCtrl->GetControlAlignment();
-}
-
-int CPDFSDK_Widget::GetMaxLen() const
-{
- CPDF_FormField* pFormField = GetFormField();
- ASSERT(pFormField != NULL);
-
- return pFormField->GetMaxLen();
-}
-
-void CPDFSDK_Widget::SetCheck(FX_BOOL bChecked, FX_BOOL bNotify)
-{
- CPDF_FormControl* pFormCtrl = GetFormControl();
- ASSERT(pFormCtrl != NULL);
-
- CPDF_FormField* pFormField = pFormCtrl->GetField();
- ASSERT(pFormField != NULL);
-
- pFormField->CheckControl(pFormField->GetControlIndex(pFormCtrl), bChecked, bNotify);
-}
-
-void CPDFSDK_Widget::SetValue(const CFX_WideString& sValue, FX_BOOL bNotify)
-{
- CPDF_FormField* pFormField = GetFormField();
- ASSERT(pFormField != NULL);
-
- pFormField->SetValue(sValue, bNotify);
-}
-
-void CPDFSDK_Widget::SetDefaultValue(const CFX_WideString& sValue)
-{
-}
-void CPDFSDK_Widget::SetOptionSelection(int index, FX_BOOL bSelected, FX_BOOL bNotify)
-{
- CPDF_FormField* pFormField = GetFormField();
- ASSERT(pFormField != NULL);
-
- pFormField->SetItemSelection(index, bSelected, bNotify);
-}
-
-void CPDFSDK_Widget::ClearSelection(FX_BOOL bNotify)
-{
- CPDF_FormField* pFormField = GetFormField();
- ASSERT(pFormField != NULL);
-
- pFormField->ClearSelection(bNotify);
-}
-
-void CPDFSDK_Widget::SetTopVisibleIndex(int index)
-{
-}
-
-void CPDFSDK_Widget::SetAppModified()
-{
- m_bAppModified = TRUE;
-}
-
-void CPDFSDK_Widget::ClearAppModified()
-{
- m_bAppModified = FALSE;
-}
-
-FX_BOOL CPDFSDK_Widget::IsAppModified() const
-{
- return m_bAppModified;
-}
-
-void CPDFSDK_Widget::ResetAppearance(FX_LPCWSTR sValue, FX_BOOL bValueChanged)
-{
- SetAppModified();
-
- m_nAppAge++;
- if (m_nAppAge > 999999)
- m_nAppAge = 0;
- if (bValueChanged)
- m_nValueAge++;
-
- int nFieldType = GetFieldType();
-
- switch (nFieldType)
- {
- case FIELDTYPE_PUSHBUTTON:
- ResetAppearance_PushButton();
- break;
- case FIELDTYPE_CHECKBOX:
- ResetAppearance_CheckBox();
- break;
- case FIELDTYPE_RADIOBUTTON:
- ResetAppearance_RadioButton();
- break;
- case FIELDTYPE_COMBOBOX:
- ResetAppearance_ComboBox(sValue);
- break;
- case FIELDTYPE_LISTBOX:
- ResetAppearance_ListBox();
- break;
- case FIELDTYPE_TEXTFIELD:
- ResetAppearance_TextField(sValue);
- break;
- }
-
- ASSERT(m_pAnnot != NULL);
- m_pAnnot->ClearCachedAP();
-}
-
-CFX_WideString CPDFSDK_Widget::OnFormat(int nCommitKey, FX_BOOL& bFormated)
-{
- CPDF_FormField* pFormField = GetFormField();
- ASSERT(pFormField != NULL);
-
- ASSERT(m_pInterForm != NULL);
-
- return m_pInterForm->OnFormat(pFormField, nCommitKey, bFormated);
-
-}
-
-void CPDFSDK_Widget::ResetFieldAppearance(FX_BOOL bValueChanged)
-{
- CPDF_FormField* pFormField = GetFormField();
- ASSERT(pFormField != NULL);
-
- ASSERT(m_pInterForm != NULL);
-
- m_pInterForm->ResetFieldAppearance(pFormField, NULL, bValueChanged);
-}
-
-void CPDFSDK_Widget::DrawAppearance(CFX_RenderDevice* pDevice, const CPDF_Matrix* pUser2Device,
- CPDF_Annot::AppearanceMode mode, const CPDF_RenderOptions* pOptions)
-{
- int nFieldType = GetFieldType();
-
- if ((nFieldType == FIELDTYPE_CHECKBOX || nFieldType == FIELDTYPE_RADIOBUTTON) &&
- mode == CPDF_Annot::Normal &&
- !this->IsWidgetAppearanceValid(CPDF_Annot::Normal))
- {
- CFX_PathData pathData;
-
- CPDF_Rect rcAnnot = this->GetRect();
-
- pathData.AppendRect(rcAnnot.left, rcAnnot.bottom,
- rcAnnot.right, rcAnnot.top);
-
- CFX_GraphStateData gsd;
- gsd.m_LineWidth = 0.0f;
-
- pDevice->DrawPath(&pathData, pUser2Device, &gsd, 0, 0xFFAAAAAA, FXFILL_ALTERNATE);
- }
- else
- {
- CPDFSDK_Annot::DrawAppearance(pDevice, pUser2Device, mode, pOptions);
- }
-}
-
-void CPDFSDK_Widget::UpdateField()
-{
- CPDF_FormField* pFormField = GetFormField();
- ASSERT(pFormField != NULL);
-
- ASSERT(m_pInterForm != NULL);
- m_pInterForm->UpdateField(pFormField);
-}
-
-void CPDFSDK_Widget::DrawShadow(CFX_RenderDevice* pDevice, CPDFSDK_PageView* pPageView)
-{
- ASSERT(m_pInterForm != NULL);
-
- int nFieldType = GetFieldType();
- if (m_pInterForm->IsNeedHighLight(nFieldType))
- {
-
-// if (nFieldType != FIELDTYPE_PUSHBUTTON)
-// {
- CPDF_Rect rc = GetRect();
- FX_COLORREF color = m_pInterForm->GetHighlightColor(nFieldType);
- FX_BYTE alpha = m_pInterForm->GetHighlightAlpha();
-
- CFX_FloatRect rcDevice;
- ASSERT(m_pInterForm->GetDocument());
- CPDFDoc_Environment* pEnv = m_pInterForm->GetDocument()->GetEnv();
- if(!pEnv)
- return;
- CFX_AffineMatrix page2device;
- pPageView->GetCurrentMatrix(page2device);
- page2device.Transform(((FX_FLOAT)rc.left), ((FX_FLOAT)rc.bottom), rcDevice.left, rcDevice.bottom);
-// pEnv->FFI_PageToDevice(m_pPageView->GetPDFPage(), rc.left, rc.bottom, &rcDevice.left, &rcDevice.bottom);
-// pEnv->FFI_PageToDevice(m_pPageView->GetPDFPage(), rc.right, rc.top, &rcDevice.right, &rcDevice.top);
- page2device.Transform(((FX_FLOAT)rc.right), ((FX_FLOAT)rc.top), rcDevice.right, rcDevice.top);
-
- rcDevice.Normalize();
-
- FX_ARGB argb = ArgbEncode((int)alpha, color);
- FX_RECT rcDev((int)rcDevice.left,(int)rcDevice.top,(int)rcDevice.right,(int)rcDevice.bottom);
- pDevice->FillRect(&rcDev, argb);
- /* }*/
- }
-}
-
-void CPDFSDK_Widget::ResetAppearance_PushButton()
-{
- CPDF_FormControl* pControl = GetFormControl();
- ASSERT(pControl != NULL);
-
-
-
- CPDF_Rect rcWindow = GetRotatedRect();
-
- FX_INT32 nLayout = 0;
-
- switch (pControl->GetTextPosition())
- {
- case TEXTPOS_ICON:
- nLayout = PPBL_ICON;
- break;
- case TEXTPOS_BELOW:
- nLayout = PPBL_ICONTOPLABELBOTTOM;
- break;
- case TEXTPOS_ABOVE:
- nLayout = PPBL_LABELTOPICONBOTTOM;
- break;
- case TEXTPOS_RIGHT:
- nLayout = PPBL_ICONLEFTLABELRIGHT;
- break;
- case TEXTPOS_LEFT:
- nLayout = PPBL_LABELLEFTICONRIGHT;
- break;
- case TEXTPOS_OVERLAID:
- nLayout = PPBL_LABELOVERICON;
- break;
- default:
- nLayout = PPBL_LABEL;
- break;
- }
-
- CPWL_Color crBackground, crBorder;
-
- int iColorType;
- FX_FLOAT fc[4];
-
- pControl->GetOriginalBackgroundColor(iColorType, fc);
- if (iColorType > 0)
- crBackground = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]);
-
- pControl->GetOriginalBorderColor(iColorType, fc);
- if (iColorType > 0)
- crBorder = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]);
-
- FX_FLOAT fBorderWidth = (FX_FLOAT)GetBorderWidth();
- FX_INT32 nBorderStyle = 0;
- CPWL_Dash dsBorder(3,0,0);
- CPWL_Color crLeftTop,crRightBottom;
-
- switch (GetBorderStyle())
- {
- case BBS_DASH:
- nBorderStyle = PBS_DASH;
- dsBorder = CPWL_Dash(3, 3, 0);
- break;
- case BBS_BEVELED:
- nBorderStyle = PBS_BEVELED;
- fBorderWidth *= 2;
- crLeftTop = CPWL_Color(COLORTYPE_GRAY,1);
- crRightBottom = CPWL_Utils::DevideColor(crBackground,2);
- break;
- case BBS_INSET:
- nBorderStyle = PBS_INSET;
- fBorderWidth *= 2;
- crLeftTop = CPWL_Color(COLORTYPE_GRAY,0.5);
- crRightBottom = CPWL_Color(COLORTYPE_GRAY,0.75);
- break;
- case BBS_UNDERLINE:
- nBorderStyle = PBS_UNDERLINED;
- break;
- default:
- nBorderStyle = PBS_SOLID;
- break;
- }
-
- CPDF_Rect rcClient = CPWL_Utils::DeflateRect(rcWindow,fBorderWidth);
-
- CPWL_Color crText(COLORTYPE_GRAY,0);
-
- FX_FLOAT fFontSize = 12.0f;
- CFX_ByteString csNameTag;
-
- CPDF_DefaultAppearance da = pControl->GetDefaultAppearance();
- if (da.HasColor())
- {
- da.GetColor(iColorType, fc);
- crText = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]);
- }
-
- if (da.HasFont())
- da.GetFont(csNameTag, fFontSize);
-
- CFX_WideString csWCaption;
- CFX_WideString csNormalCaption, csRolloverCaption, csDownCaption;
-
- if (pControl->HasMKEntry("CA"))
- {
- csNormalCaption = pControl->GetNormalCaption();
- }
- if (pControl->HasMKEntry("RC"))
- {
- csRolloverCaption = pControl->GetRolloverCaption();
- }
- if (pControl->HasMKEntry("AC"))
- {
- csDownCaption = pControl->GetDownCaption();
- }
-
- CPDF_Stream* pNormalIcon = NULL;
- CPDF_Stream* pRolloverIcon = NULL;
- CPDF_Stream* pDownIcon = NULL;
-
- if (pControl->HasMKEntry("I"))
- {
- pNormalIcon = pControl->GetNormalIcon();
- }
- if (pControl->HasMKEntry("RI"))
- {
- pRolloverIcon = pControl->GetRolloverIcon();
- }
- if (pControl->HasMKEntry("IX"))
- {
- pDownIcon = pControl->GetDownIcon();
- }
-
- if (pNormalIcon)
- {
- if (CPDF_Dictionary* pImageDict = pNormalIcon->GetDict())
- {
- if (pImageDict->GetString("Name").IsEmpty())
- pImageDict->SetAtString("Name", "ImgA");
- }
- }
-
- if (pRolloverIcon)
- {
- if (CPDF_Dictionary* pImageDict = pRolloverIcon->GetDict())
- {
- if (pImageDict->GetString("Name").IsEmpty())
- pImageDict->SetAtString("Name", "ImgB");
- }
- }
-
- if (pDownIcon)
- {
- if (CPDF_Dictionary* pImageDict = pDownIcon->GetDict())
- {
- if (pImageDict->GetString("Name").IsEmpty())
- pImageDict->SetAtString("Name", "ImgC");
- }
- }
-
- CPDF_IconFit iconFit = pControl->GetIconFit();
-
-// ASSERT(this->m_pBaseForm != NULL);
- ASSERT(this->m_pInterForm != NULL);
- CPDFSDK_Document* pDoc = m_pInterForm->GetDocument();
- ASSERT(pDoc != NULL);
- CPDFDoc_Environment* pEnv = pDoc->GetEnv();
-
- CBA_FontMap FontMap(this,pEnv->GetSysHandler());//, ISystemHandle::GetSystemHandler(m_pBaseForm->GetEnv()));
- FontMap.Initial();
-
- FontMap.SetAPType("N");
-
- CFX_ByteString csAP = CPWL_Utils::GetRectFillAppStream(rcWindow, crBackground) +
- CPWL_Utils::GetBorderAppStream(rcWindow, fBorderWidth, crBorder, crLeftTop, crRightBottom, nBorderStyle, dsBorder) +
- CPWL_Utils::GetPushButtonAppStream(iconFit.GetFittingBounds() ? rcWindow : rcClient, &FontMap, pNormalIcon, iconFit, csNormalCaption, crText, fFontSize, nLayout);
-
- WriteAppearance("N", GetRotatedRect(), GetMatrix(), csAP);
- if (pNormalIcon)
- AddImageToAppearance("N", pNormalIcon);
-
- CPDF_FormControl::HighlightingMode eHLM = pControl->GetHighlightingMode();
- if (eHLM == CPDF_FormControl::Push || eHLM == CPDF_FormControl::Toggle)
- {
- if (csRolloverCaption.IsEmpty() && !pRolloverIcon)
- {
- csRolloverCaption = csNormalCaption;
- pRolloverIcon = pNormalIcon;
- }
-
- FontMap.SetAPType("R");
-
- csAP = CPWL_Utils::GetRectFillAppStream(rcWindow, crBackground) +
- CPWL_Utils::GetBorderAppStream(rcWindow, fBorderWidth, crBorder, crLeftTop, crRightBottom, nBorderStyle, dsBorder) +
- CPWL_Utils::GetPushButtonAppStream(iconFit.GetFittingBounds() ? rcWindow : rcClient, &FontMap, pRolloverIcon, iconFit, csRolloverCaption, crText, fFontSize, nLayout);
-
- WriteAppearance("R", GetRotatedRect(), GetMatrix(), csAP);
- if (pRolloverIcon)
- AddImageToAppearance("R", pRolloverIcon);
-
- if (csDownCaption.IsEmpty() && !pDownIcon)
- {
- csDownCaption = csNormalCaption;
- pDownIcon = pNormalIcon;
- }
-
- switch (nBorderStyle)
- {
- case PBS_BEVELED:
- {
- CPWL_Color crTemp = crLeftTop;
- crLeftTop = crRightBottom;
- crRightBottom = crTemp;
- }
- break;
- case PBS_INSET:
- crLeftTop = CPWL_Color(COLORTYPE_GRAY,0);
- crRightBottom = CPWL_Color(COLORTYPE_GRAY,1);
- break;
- }
-
- FontMap.SetAPType("D");
-
- csAP = CPWL_Utils::GetRectFillAppStream(rcWindow, CPWL_Utils::SubstractColor(crBackground,0.25f)) +
- CPWL_Utils::GetBorderAppStream(rcWindow, fBorderWidth, crBorder, crLeftTop, crRightBottom, nBorderStyle, dsBorder) +
- CPWL_Utils::GetPushButtonAppStream(iconFit.GetFittingBounds() ? rcWindow : rcClient, &FontMap, pDownIcon, iconFit, csDownCaption, crText, fFontSize, nLayout);
-
- WriteAppearance("D", GetRotatedRect(), GetMatrix(), csAP);
- if (pDownIcon)
- AddImageToAppearance("D", pDownIcon);
- }
- else
- {
- RemoveAppearance("D");
- RemoveAppearance("R");
- }
-}
-
-void CPDFSDK_Widget::ResetAppearance_CheckBox()
-{
- CPDF_FormControl* pControl = GetFormControl();
- ASSERT(pControl != NULL);
-
-
-
- CPWL_Color crBackground, crBorder, crText;
-
- int iColorType;
- FX_FLOAT fc[4];
-
- pControl->GetOriginalBackgroundColor(iColorType, fc);
- if (iColorType > 0)
- crBackground = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]);
-
- pControl->GetOriginalBorderColor(iColorType, fc);
- if (iColorType > 0)
- crBorder = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]);
-
- FX_FLOAT fBorderWidth = (FX_FLOAT)GetBorderWidth();
- FX_INT32 nBorderStyle = 0;
- CPWL_Dash dsBorder(3,0,0);
- CPWL_Color crLeftTop,crRightBottom;
-
- switch (GetBorderStyle())
- {
- case BBS_DASH:
- nBorderStyle = PBS_DASH;
- dsBorder = CPWL_Dash(3, 3, 0);
- break;
- case BBS_BEVELED:
- nBorderStyle = PBS_BEVELED;
- fBorderWidth *= 2;
- crLeftTop = CPWL_Color(COLORTYPE_GRAY,1);
- crRightBottom = CPWL_Utils::DevideColor(crBackground,2);
- break;
- case BBS_INSET:
- nBorderStyle = PBS_INSET;
- fBorderWidth *= 2;
- crLeftTop = CPWL_Color(COLORTYPE_GRAY,0.5);
- crRightBottom = CPWL_Color(COLORTYPE_GRAY,0.75);
- break;
- case BBS_UNDERLINE:
- nBorderStyle = PBS_UNDERLINED;
- break;
- default:
- nBorderStyle = PBS_SOLID;
- break;
- }
-
- CPDF_Rect rcWindow = GetRotatedRect();
- CPDF_Rect rcClient = CPWL_Utils::DeflateRect(rcWindow,fBorderWidth);
-
- CPDF_DefaultAppearance da = pControl->GetDefaultAppearance();
- if (da.HasColor())
- {
- da.GetColor(iColorType, fc);
- crText = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]);
- }
-
- FX_INT32 nStyle = 0;
-
- CFX_WideString csWCaption = pControl->GetNormalCaption();
- if (csWCaption.GetLength() > 0)
- {
- switch (csWCaption[0])
- {
- case L'l':
- nStyle = PCS_CIRCLE;
- break;
- case L'8':
- nStyle = PCS_CROSS;
- break;
- case L'u':
- nStyle = PCS_DIAMOND;
- break;
- case L'n':
- nStyle = PCS_SQUARE;
- break;
- case L'H':
- nStyle = PCS_STAR;
- break;
- default: //L'4'
- nStyle = PCS_CHECK;
- break;
- }
- }
- else
- {
- nStyle = PCS_CHECK;
- }
-
- CFX_ByteString csAP_N_ON = CPWL_Utils::GetRectFillAppStream(rcWindow,crBackground) +
- CPWL_Utils::GetBorderAppStream(rcWindow,fBorderWidth,crBorder,crLeftTop,crRightBottom,nBorderStyle,dsBorder);
-
- CFX_ByteString csAP_N_OFF = csAP_N_ON;
-
- switch (nBorderStyle)
- {
- case PBS_BEVELED:
- {
- CPWL_Color crTemp = crLeftTop;
- crLeftTop = crRightBottom;
- crRightBottom = crTemp;
- }
- break;
- case PBS_INSET:
- crLeftTop = CPWL_Color(COLORTYPE_GRAY,0);
- crRightBottom = CPWL_Color(COLORTYPE_GRAY,1);
- break;
- }
-
- CFX_ByteString csAP_D_ON = CPWL_Utils::GetRectFillAppStream(rcWindow,CPWL_Utils::SubstractColor(crBackground,0.25f)) +
- CPWL_Utils::GetBorderAppStream(rcWindow,fBorderWidth,crBorder,crLeftTop,crRightBottom,nBorderStyle,dsBorder);
-
- CFX_ByteString csAP_D_OFF = csAP_D_ON;
-
- csAP_N_ON += CPWL_Utils::GetCheckBoxAppStream(rcClient,nStyle,crText);
- csAP_D_ON += CPWL_Utils::GetCheckBoxAppStream(rcClient,nStyle,crText);
-
- WriteAppearance("N", GetRotatedRect(), GetMatrix(), csAP_N_ON, pControl->GetCheckedAPState());
- WriteAppearance("N", GetRotatedRect(), GetMatrix(), csAP_N_OFF, "Off");
-
- WriteAppearance("D", GetRotatedRect(), GetMatrix(), csAP_D_ON, pControl->GetCheckedAPState());
- WriteAppearance("D", GetRotatedRect(), GetMatrix(), csAP_D_OFF, "Off");
-
- CFX_ByteString csAS = GetAppState();
- if (csAS.IsEmpty())
- SetAppState("Off");
-}
-
-void CPDFSDK_Widget::ResetAppearance_RadioButton()
-{
- CPDF_FormControl* pControl = GetFormControl();
- ASSERT(pControl != NULL);
-
-
-
- CPWL_Color crBackground, crBorder, crText;
-
- int iColorType;
- FX_FLOAT fc[4];
-
- pControl->GetOriginalBackgroundColor(iColorType, fc);
- if (iColorType > 0)
- crBackground = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]);
-
- pControl->GetOriginalBorderColor(iColorType, fc);
- if (iColorType > 0)
- crBorder = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]);
-
- FX_FLOAT fBorderWidth = (FX_FLOAT)GetBorderWidth();
- FX_INT32 nBorderStyle = 0;
- CPWL_Dash dsBorder(3,0,0);
- CPWL_Color crLeftTop,crRightBottom;
-
- switch (GetBorderStyle())
- {
- case BBS_DASH:
- nBorderStyle = PBS_DASH;
- dsBorder = CPWL_Dash(3, 3, 0);
- break;
- case BBS_BEVELED:
- nBorderStyle = PBS_BEVELED;
- fBorderWidth *= 2;
- crLeftTop = CPWL_Color(COLORTYPE_GRAY,1);
- crRightBottom = CPWL_Utils::DevideColor(crBackground,2);
- break;
- case BBS_INSET:
- nBorderStyle = PBS_INSET;
- fBorderWidth *= 2;
- crLeftTop = CPWL_Color(COLORTYPE_GRAY,0.5);
- crRightBottom = CPWL_Color(COLORTYPE_GRAY,0.75);
- break;
- case BBS_UNDERLINE:
- nBorderStyle = PBS_UNDERLINED;
- break;
- default:
- nBorderStyle = PBS_SOLID;
- break;
- }
-
- CPDF_Rect rcWindow = GetRotatedRect();
- CPDF_Rect rcClient = CPWL_Utils::DeflateRect(rcWindow, fBorderWidth);
-
- CPDF_DefaultAppearance da = pControl->GetDefaultAppearance();
- if (da.HasColor())
- {
- da.GetColor(iColorType, fc);
- crText = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]);
- }
-
- FX_INT32 nStyle = 0;
-
- CFX_WideString csWCaption = pControl->GetNormalCaption();
- if (csWCaption.GetLength() > 0)
- {
- switch (csWCaption[0])
- {
- default: //L'l':
- nStyle = PCS_CIRCLE;
- break;
- case L'8':
- nStyle = PCS_CROSS;
- break;
- case L'u':
- nStyle = PCS_DIAMOND;
- break;
- case L'n':
- nStyle = PCS_SQUARE;
- break;
- case L'H':
- nStyle = PCS_STAR;
- break;
- case L'4':
- nStyle = PCS_CHECK;
- break;
- }
- }
- else
- {
- nStyle = PCS_CIRCLE;
- }
-
- CFX_ByteString csAP_N_ON;
-
- CPDF_Rect rcCenter = CPWL_Utils::DeflateRect(CPWL_Utils::GetCenterSquare(rcWindow), 1.0f);
-
- if (nStyle == PCS_CIRCLE)
- {
- if (nBorderStyle == PBS_BEVELED)
- {
- crLeftTop = CPWL_Color(COLORTYPE_GRAY, 1);
- crRightBottom = CPWL_Utils::SubstractColor(crBackground,0.25f);
- }
- else if (nBorderStyle == PBS_INSET)
- {
- crLeftTop = CPWL_Color(COLORTYPE_GRAY,0.5f);
- crRightBottom = CPWL_Color(COLORTYPE_GRAY,0.75f);
- }
-
- csAP_N_ON = CPWL_Utils::GetCircleFillAppStream(rcCenter,crBackground) +
- CPWL_Utils::GetCircleBorderAppStream(rcCenter,fBorderWidth,crBorder,crLeftTop,crRightBottom,nBorderStyle,dsBorder);
- }
- else
- {
- csAP_N_ON = CPWL_Utils::GetRectFillAppStream(rcWindow,crBackground) +
- CPWL_Utils::GetBorderAppStream(rcWindow,fBorderWidth,crBorder,crLeftTop,crRightBottom,nBorderStyle,dsBorder);
- }
-
- CFX_ByteString csAP_N_OFF = csAP_N_ON;
-
- switch (nBorderStyle)
- {
- case PBS_BEVELED:
- {
- CPWL_Color crTemp = crLeftTop;
- crLeftTop = crRightBottom;
- crRightBottom = crTemp;
- }
- break;
- case PBS_INSET:
- crLeftTop = CPWL_Color(COLORTYPE_GRAY,0);
- crRightBottom = CPWL_Color(COLORTYPE_GRAY,1);
- break;
- }
-
- CFX_ByteString csAP_D_ON;
-
- if (nStyle == PCS_CIRCLE)
- {
- CPWL_Color crBK = CPWL_Utils::SubstractColor(crBackground,0.25f);
- if (nBorderStyle == PBS_BEVELED)
- {
- crLeftTop = CPWL_Utils::SubstractColor(crBackground,0.25f);
- crRightBottom = CPWL_Color(COLORTYPE_GRAY, 1);
- crBK = crBackground;
- }
- else if (nBorderStyle == PBS_INSET)
- {
- crLeftTop = CPWL_Color(COLORTYPE_GRAY,0);
- crRightBottom = CPWL_Color(COLORTYPE_GRAY,1);
- }
-
- csAP_D_ON = CPWL_Utils::GetCircleFillAppStream(rcCenter,crBK)
- + CPWL_Utils::GetCircleBorderAppStream(rcCenter,fBorderWidth,crBorder,crLeftTop,crRightBottom,nBorderStyle,dsBorder);
- }
- else
- {
- csAP_D_ON = CPWL_Utils::GetRectFillAppStream(rcWindow,CPWL_Utils::SubstractColor(crBackground,0.25f)) +
- CPWL_Utils::GetBorderAppStream(rcWindow,fBorderWidth,crBorder,crLeftTop,crRightBottom,nBorderStyle,dsBorder);
- }
-
- CFX_ByteString csAP_D_OFF = csAP_D_ON;
-
- csAP_N_ON += CPWL_Utils::GetRadioButtonAppStream(rcClient,nStyle,crText);
- csAP_D_ON += CPWL_Utils::GetRadioButtonAppStream(rcClient,nStyle,crText);
-
- WriteAppearance("N", GetRotatedRect(), GetMatrix(), csAP_N_ON, pControl->GetCheckedAPState());
- WriteAppearance("N", GetRotatedRect(), GetMatrix(), csAP_N_OFF, "Off");
-
- WriteAppearance("D", GetRotatedRect(), GetMatrix(), csAP_D_ON, pControl->GetCheckedAPState());
- WriteAppearance("D", GetRotatedRect(), GetMatrix(), csAP_D_OFF, "Off");
-
- CFX_ByteString csAS = GetAppState();
- if (csAS.IsEmpty())
- SetAppState("Off");
-}
-
-void CPDFSDK_Widget::ResetAppearance_ComboBox(FX_LPCWSTR sValue)
-{
- CPDF_FormControl* pControl = GetFormControl();
- ASSERT(pControl != NULL);
- CPDF_FormField* pField = pControl->GetField();
- ASSERT(pField != NULL);
-
- CFX_ByteTextBuf sBody, sLines;
-
- CPDF_Rect rcClient = GetClientRect();
- CPDF_Rect rcButton = rcClient;
- rcButton.left = rcButton.right - 13;
- rcButton.Normalize();
-
- if (IFX_Edit * pEdit = IFX_Edit::NewEdit())
- {
- pEdit->EnableRefresh(FALSE);
-
- ASSERT(this->m_pInterForm != NULL);
- CPDFSDK_Document* pDoc = m_pInterForm->GetDocument();
- ASSERT(pDoc != NULL);
- CPDFDoc_Environment* pEnv = pDoc->GetEnv();
- CBA_FontMap FontMap(this,pEnv->GetSysHandler());
- FontMap.Initial();
- pEdit->SetFontMap(&FontMap);
-
- CPDF_Rect rcEdit = rcClient;
- rcEdit.right = rcButton.left;
- rcEdit.Normalize();
-
- pEdit->SetPlateRect(rcEdit);
- pEdit->SetAlignmentV(1);
-
- FX_FLOAT fFontSize = this->GetFontSize();
- if (IsFloatZero(fFontSize))
- pEdit->SetAutoFontSize(TRUE);
- else
- pEdit->SetFontSize(fFontSize);
-
- pEdit->Initialize();
-
- if (sValue)
- pEdit->SetText(sValue);
- else
- {
- FX_INT32 nCurSel = pField->GetSelectedIndex(0);
-
- if (nCurSel < 0)
- pEdit->SetText((FX_LPCWSTR)pField->GetValue());
- else
- pEdit->SetText((FX_LPCWSTR)pField->GetOptionLabel(nCurSel));
- }
-
- CPDF_Rect rcContent = pEdit->GetContentRect();
-
- CFX_ByteString sEdit = CPWL_Utils::GetEditAppStream(pEdit,CPDF_Point(0.0f,0.0f));
- if (sEdit.GetLength() > 0)
- {
- sBody << "/Tx BMC\n" << "q\n";
- if (rcContent.Width() > rcEdit.Width() ||
- rcContent.Height() > rcEdit.Height())
- {
- sBody << rcEdit.left << " " << rcEdit.bottom << " "
- << rcEdit.Width() << " " << rcEdit.Height() << " re\nW\nn\n";
- }
-
- CPWL_Color crText = GetTextPWLColor();
- sBody << "BT\n" << CPWL_Utils::GetColorAppStream(crText) << sEdit << "ET\n" << "Q\nEMC\n";
- }
-
- IFX_Edit::DelEdit(pEdit);
- }
-
- sBody << CPWL_Utils::GetDropButtonAppStream(rcButton);
-
- CFX_ByteString sAP = GetBackgroundAppStream() + GetBorderAppStream() + sLines.GetByteString() + sBody.GetByteString();
-
- WriteAppearance("N", GetRotatedRect(), GetMatrix(), sAP);
-}
-
-void CPDFSDK_Widget::ResetAppearance_ListBox()
-{
- CPDF_FormControl* pControl = GetFormControl();
- ASSERT(pControl != NULL);
- CPDF_FormField* pField = pControl->GetField();
- ASSERT(pField != NULL);
-
- CPDF_Rect rcClient = GetClientRect();
-
- CFX_ByteTextBuf sBody, sLines;
-
- if (IFX_Edit * pEdit = IFX_Edit::NewEdit())
- {
- pEdit->EnableRefresh(FALSE);
-
-// ASSERT(this->m_pBaseForm != NULL);
- ASSERT(this->m_pInterForm != NULL);
- CPDFSDK_Document* pDoc = m_pInterForm->GetDocument();
- ASSERT(pDoc != NULL);
- CPDFDoc_Environment* pEnv = pDoc->GetEnv();
-
- CBA_FontMap FontMap(this,pEnv->GetSysHandler());
- FontMap.Initial();
- pEdit->SetFontMap(&FontMap);
-
- pEdit->SetPlateRect(CPDF_Rect(rcClient.left,0.0f,rcClient.right,0.0f));
-
- FX_FLOAT fFontSize = GetFontSize();
-
- if (IsFloatZero(fFontSize))
- pEdit->SetFontSize(12.0f);
- else
- pEdit->SetFontSize(fFontSize);
-
- pEdit->Initialize();
-
- CFX_ByteTextBuf sList;
- FX_FLOAT fy = rcClient.top;
-
- FX_INT32 nTop = pField->GetTopVisibleIndex();
- FX_INT32 nCount = pField->CountOptions();
- FX_INT32 nSelCount = pField->CountSelectedItems();
-
- for (FX_INT32 i=nTop; i<nCount; i++)
- {
- FX_BOOL bSelected = FALSE;
- for (FX_INT32 j=0; j<nSelCount; j++)
- {
- if (pField->GetSelectedIndex(j) == i)
- {
- bSelected = TRUE;
- break;
- }
- }
-
- pEdit->SetText((FX_LPCWSTR)pField->GetOptionLabel(i));
-
- CPDF_Rect rcContent = pEdit->GetContentRect();
- FX_FLOAT fItemHeight = rcContent.Height();
-
- if (bSelected)
- {
- CPDF_Rect rcItem = CPDF_Rect(rcClient.left,fy-fItemHeight,rcClient.right,fy);
- sList << "q\n" << CPWL_Utils::GetColorAppStream(CPWL_Color(COLORTYPE_RGB,0,51.0f/255.0f,113.0f/255.0f),TRUE)
- << rcItem.left << " " << rcItem.bottom << " " << rcItem.Width() << " " << rcItem.Height() << " re f\n" << "Q\n";
-
- sList << "BT\n" << CPWL_Utils::GetColorAppStream(CPWL_Color(COLORTYPE_GRAY,1),TRUE) <<
- CPWL_Utils::GetEditAppStream(pEdit,CPDF_Point(0.0f,fy)) << "ET\n";
- }
- else
- {
- CPWL_Color crText = GetTextPWLColor();
- sList << "BT\n" << CPWL_Utils::GetColorAppStream(crText,TRUE) <<
- CPWL_Utils::GetEditAppStream(pEdit,CPDF_Point(0.0f,fy)) << "ET\n";
- }
-
- fy -= fItemHeight;
- }
-
- if (sList.GetSize() > 0)
- {
- sBody << "/Tx BMC\n" << "q\n" << rcClient.left << " " << rcClient.bottom << " "
- << rcClient.Width() << " " << rcClient.Height() << " re\nW\nn\n";
- sBody << sList << "Q\nEMC\n";
- }
-
- IFX_Edit::DelEdit(pEdit);
- }
-
- CFX_ByteString sAP = GetBackgroundAppStream() + GetBorderAppStream() + sLines.GetByteString() + sBody.GetByteString();
-
- WriteAppearance("N", GetRotatedRect(), GetMatrix(), sAP);
-}
-
-void CPDFSDK_Widget::ResetAppearance_TextField(FX_LPCWSTR sValue)
-{
- CPDF_FormControl* pControl = GetFormControl();
- ASSERT(pControl != NULL);
- CPDF_FormField* pField = pControl->GetField();
- ASSERT(pField != NULL);
-
- CFX_ByteTextBuf sBody, sLines;
-
- if (IFX_Edit * pEdit = IFX_Edit::NewEdit())
- {
- pEdit->EnableRefresh(FALSE);
-
-// ASSERT(this->m_pBaseForm != NULL);
- ASSERT(this->m_pInterForm != NULL);
- CPDFSDK_Document* pDoc = m_pInterForm->GetDocument();
- ASSERT(pDoc != NULL);
- CPDFDoc_Environment* pEnv = pDoc->GetEnv();
-
- CBA_FontMap FontMap(this,pEnv->GetSysHandler());//, ISystemHandle::GetSystemHandler(m_pBaseForm->GetEnv()));
- FontMap.Initial();
- pEdit->SetFontMap(&FontMap);
-
- CPDF_Rect rcClient = GetClientRect();
- pEdit->SetPlateRect(rcClient);
- pEdit->SetAlignmentH(pControl->GetControlAlignment());
-
- FX_DWORD dwFieldFlags = pField->GetFieldFlags();
- FX_BOOL bMultiLine = (dwFieldFlags >> 12) & 1;
-
- if (bMultiLine)
- {
- pEdit->SetMultiLine(TRUE);
- pEdit->SetAutoReturn(TRUE);
- }
- else
- {
- pEdit->SetAlignmentV(1);
- }
-
- FX_WORD subWord = 0;
- if ((dwFieldFlags >> 13) & 1)
- {
- subWord = '*';
- pEdit->SetPasswordChar(subWord);
- }
-
- int nMaxLen = pField->GetMaxLen();
- FX_BOOL bCharArray = (dwFieldFlags >> 24) & 1;
- FX_FLOAT fFontSize = GetFontSize();
-
- if (nMaxLen > 0)
- {
- if (bCharArray)
- {
- pEdit->SetCharArray(nMaxLen);
-
- if (IsFloatZero(fFontSize))
- {
- fFontSize = CPWL_Edit::GetCharArrayAutoFontSize(FontMap.GetPDFFont(0),rcClient,nMaxLen);
- }
- }
- else
- {
- if (sValue)
- nMaxLen = wcslen((const wchar_t*)sValue);
- pEdit->SetLimitChar(nMaxLen);
- }
- }
-
- if (IsFloatZero(fFontSize))
- pEdit->SetAutoFontSize(TRUE);
- else
- pEdit->SetFontSize(fFontSize);
-
- pEdit->Initialize();
-
- if (sValue)
- pEdit->SetText(sValue);
- else
- pEdit->SetText((FX_LPCWSTR)pField->GetValue());
-
- CPDF_Rect rcContent = pEdit->GetContentRect();
-
- CFX_ByteString sEdit = CPWL_Utils::GetEditAppStream(pEdit,CPDF_Point(0.0f,0.0f),
- NULL,!bCharArray,subWord);
-
- if (sEdit.GetLength() > 0)
- {
- sBody << "/Tx BMC\n" << "q\n";
- if (rcContent.Width() > rcClient.Width() ||
- rcContent.Height() > rcClient.Height())
- {
- sBody << rcClient.left << " " << rcClient.bottom << " "
- << rcClient.Width() << " " << rcClient.Height() << " re\nW\nn\n";
- }
- CPWL_Color crText = GetTextPWLColor();
- sBody << "BT\n" << CPWL_Utils::GetColorAppStream(crText) << sEdit << "ET\n" << "Q\nEMC\n";
- }
-
- if (bCharArray)
- {
- switch (GetBorderStyle())
- {
- case BBS_SOLID:
- {
- CFX_ByteString sColor = CPWL_Utils::GetColorAppStream(GetBorderPWLColor(),FALSE);
- if (sColor.GetLength() > 0)
- {
- sLines << "q\n" << GetBorderWidth() << " w\n"
- << CPWL_Utils::GetColorAppStream(GetBorderPWLColor(),FALSE) << " 2 J 0 j\n";
-
- for (FX_INT32 i=1;i<nMaxLen;i++)
- {
- sLines << rcClient.left + ((rcClient.right - rcClient.left)/nMaxLen)*i << " "
- << rcClient.bottom << " m\n"
- << rcClient.left + ((rcClient.right - rcClient.left)/nMaxLen)*i << " "
- << rcClient.top << " l S\n";
- }
-
- sLines << "Q\n";
- }
- }
- break;
- case BBS_DASH:
- {
- CFX_ByteString sColor = CPWL_Utils::GetColorAppStream(GetBorderPWLColor(),FALSE);
- if (sColor.GetLength() > 0)
- {
- CPWL_Dash dsBorder = CPWL_Dash(3, 3, 0);
-
- sLines << "q\n" << GetBorderWidth() << " w\n"
- << CPWL_Utils::GetColorAppStream(GetBorderPWLColor(),FALSE)
- << "[" << dsBorder.nDash << " "
- << dsBorder.nGap << "] "
- << dsBorder.nPhase << " d\n";
-
- for (FX_INT32 i=1;i<nMaxLen;i++)
- {
- sLines << rcClient.left + ((rcClient.right - rcClient.left)/nMaxLen)*i << " "
- << rcClient.bottom << " m\n"
- << rcClient.left + ((rcClient.right - rcClient.left)/nMaxLen)*i << " "
- << rcClient.top << " l S\n";
- }
-
- sLines << "Q\n";
- }
- }
- break;
- }
- }
-
- IFX_Edit::DelEdit(pEdit);
- }
-
- CFX_ByteString sAP = GetBackgroundAppStream() + GetBorderAppStream() + sLines.GetByteString() + sBody.GetByteString();
- WriteAppearance("N", GetRotatedRect(), GetMatrix(), sAP);
-}
-
-CPDF_Rect CPDFSDK_Widget::GetClientRect() const
-{
- CPDF_Rect rcWindow = GetRotatedRect();
- FX_FLOAT fBorderWidth = (FX_FLOAT)GetBorderWidth();
- switch (GetBorderStyle())
- {
- case BBS_BEVELED:
- case BBS_INSET:
- fBorderWidth *= 2.0f;
- break;
- }
-
- return CPWL_Utils::DeflateRect(rcWindow, fBorderWidth);
-}
-
-CPDF_Rect CPDFSDK_Widget::GetRotatedRect() const
-{
- CPDF_Rect rectAnnot = GetRect();
- FX_FLOAT fWidth = rectAnnot.right - rectAnnot.left;
- FX_FLOAT fHeight = rectAnnot.top - rectAnnot.bottom;
-
- CPDF_FormControl* pControl = GetFormControl();
- ASSERT(pControl != NULL);
-
- CPDF_Rect rcPDFWindow;
- switch(abs(pControl->GetRotation() % 360))
- {
- case 0:
- case 180:
- default:
- rcPDFWindow = CPDF_Rect(0, 0, fWidth, fHeight);
- break;
- case 90:
- case 270:
- rcPDFWindow = CPDF_Rect(0, 0, fHeight, fWidth);
- break;
- }
-
- return rcPDFWindow;
-}
-
-CFX_ByteString CPDFSDK_Widget::GetBackgroundAppStream() const
-{
- CPWL_Color crBackground = GetFillPWLColor();
- if (crBackground.nColorType != COLORTYPE_TRANSPARENT)
- return CPWL_Utils::GetRectFillAppStream(GetRotatedRect(), crBackground);
- else
- return "";
-}
-
-CFX_ByteString CPDFSDK_Widget::GetBorderAppStream() const
-{
- CPDF_Rect rcWindow = GetRotatedRect();
- CPWL_Color crBorder = GetBorderPWLColor();
- CPWL_Color crBackground = GetFillPWLColor();
- CPWL_Color crLeftTop, crRightBottom;
-
- FX_FLOAT fBorderWidth = (FX_FLOAT)GetBorderWidth();
- FX_INT32 nBorderStyle = 0;
- CPWL_Dash dsBorder(3,0,0);
-
- switch (GetBorderStyle())
- {
- case BBS_DASH:
- nBorderStyle = PBS_DASH;
- dsBorder = CPWL_Dash(3, 3, 0);
- break;
- case BBS_BEVELED:
- nBorderStyle = PBS_BEVELED;
- fBorderWidth *= 2;
- crLeftTop = CPWL_Color(COLORTYPE_GRAY, 1);
- crRightBottom = CPWL_Utils::DevideColor(crBackground, 2);
- break;
- case BBS_INSET:
- nBorderStyle = PBS_INSET;
- fBorderWidth *= 2;
- crLeftTop = CPWL_Color(COLORTYPE_GRAY, 0.5);
- crRightBottom = CPWL_Color(COLORTYPE_GRAY, 0.75);
- break;
- case BBS_UNDERLINE:
- nBorderStyle = PBS_UNDERLINED;
- break;
- default:
- nBorderStyle = PBS_SOLID;
- break;
- }
-
- return CPWL_Utils::GetBorderAppStream(rcWindow, fBorderWidth, crBorder, crLeftTop,
- crRightBottom, nBorderStyle, dsBorder);
-}
-
-CPDF_Matrix CPDFSDK_Widget::GetMatrix() const
-{
- CPDF_Matrix mt;
- CPDF_FormControl* pControl = GetFormControl();
- ASSERT(pControl != NULL);
-
- CPDF_Rect rcAnnot = GetRect();
- FX_FLOAT fWidth = rcAnnot.right - rcAnnot.left;
- FX_FLOAT fHeight = rcAnnot.top - rcAnnot.bottom;
-
-
-
- switch (abs(pControl->GetRotation() % 360))
- {
- case 0:
- default:
- mt = CPDF_Matrix(1, 0, 0, 1, 0, 0);
- break;
- case 90:
- mt = CPDF_Matrix(0, 1, -1, 0, fWidth, 0);
- break;
- case 180:
- mt = CPDF_Matrix(-1, 0, 0, -1, fWidth, fHeight);
- break;
- case 270:
- mt = CPDF_Matrix(0, -1, 1, 0, 0, fHeight);
- break;
- }
-
- return mt;
-}
-
-CPWL_Color CPDFSDK_Widget::GetTextPWLColor() const
-{
- CPWL_Color crText = CPWL_Color(COLORTYPE_GRAY, 0);
-
- CPDF_FormControl* pFormCtrl = GetFormControl();
- ASSERT(pFormCtrl != NULL);
-
- CPDF_DefaultAppearance da = pFormCtrl->GetDefaultAppearance();
- if (da.HasColor())
- {
- FX_INT32 iColorType;
- FX_FLOAT fc[4];
- da.GetColor(iColorType, fc);
- crText = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]);
- }
-
- return crText;
-}
-
-CPWL_Color CPDFSDK_Widget::GetBorderPWLColor() const
-{
- CPWL_Color crBorder;
-
- CPDF_FormControl* pFormCtrl = GetFormControl();
- ASSERT(pFormCtrl != NULL);
-
- FX_INT32 iColorType;
- FX_FLOAT fc[4];
- pFormCtrl->GetOriginalBorderColor(iColorType, fc);
- if (iColorType > 0)
- crBorder = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]);
-
- return crBorder;
-}
-
-CPWL_Color CPDFSDK_Widget::GetFillPWLColor() const
-{
- CPWL_Color crFill;
-
- CPDF_FormControl* pFormCtrl = GetFormControl();
- ASSERT(pFormCtrl != NULL);
-
- FX_INT32 iColorType;
- FX_FLOAT fc[4];
- pFormCtrl->GetOriginalBackgroundColor(iColorType, fc);
- if (iColorType > 0)
- crFill = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]);
-
- return crFill;
-}
-
-void CPDFSDK_Widget::AddImageToAppearance(const CFX_ByteString& sAPType, CPDF_Stream* pImage)
-{
- ASSERT(pImage != NULL);
-
- ASSERT(m_pAnnot != NULL);
- ASSERT(m_pAnnot->m_pAnnotDict != NULL);
-
- CPDF_Document* pDoc = m_pPageView->GetPDFDocument();//pDocument->GetDocument();
- ASSERT(pDoc != NULL);
-
- CPDF_Dictionary* pAPDict = m_pAnnot->m_pAnnotDict->GetDict("AP");
- ASSERT(pAPDict != NULL);
-
- CPDF_Stream* pStream = pAPDict->GetStream(sAPType);
- ASSERT(pStream != NULL);
-
- CPDF_Dictionary* pStreamDict = pStream->GetDict();
- ASSERT(pStreamDict != NULL);
-
- CFX_ByteString sImageAlias = "IMG";
-
- if (CPDF_Dictionary* pImageDict = pImage->GetDict())
- {
- sImageAlias = pImageDict->GetString("Name");
- if (sImageAlias.IsEmpty())
- sImageAlias = "IMG";
- }
-
- CPDF_Dictionary* pStreamResList = pStreamDict->GetDict("Resources");
- if (!pStreamResList)
- {
- pStreamResList = FX_NEW CPDF_Dictionary();
- pStreamDict->SetAt("Resources", pStreamResList);
- }
-
- if (pStreamResList)
- {
- CPDF_Dictionary* pXObject = FX_NEW CPDF_Dictionary;
- pXObject->SetAtReference(sImageAlias, pDoc, pImage);
- pStreamResList->SetAt("XObject", pXObject);
- }
-}
-
-void CPDFSDK_Widget::RemoveAppearance(const CFX_ByteString& sAPType)
-{
- ASSERT(m_pAnnot != NULL);
- ASSERT(m_pAnnot->m_pAnnotDict != NULL);
-
- if (CPDF_Dictionary* pAPDict = m_pAnnot->m_pAnnotDict->GetDict("AP"))
- {
- pAPDict->RemoveAt(sAPType);
- }
-}
-
-FX_BOOL CPDFSDK_Widget::OnAAction(CPDF_AAction::AActionType type, PDFSDK_FieldAction& data, CPDFSDK_PageView* pPageView)
-{
- CPDF_Action action = GetAAction(type);
-
- if (action && action.GetType() != CPDF_Action::Unknown)
- {
- CPDFSDK_Document* pDocument = pPageView->GetSDKDocument();
- ASSERT(pDocument != NULL);
-
- CPDFDoc_Environment* pEnv = pDocument->GetEnv();
- ASSERT(pEnv != NULL);
-
- CPDFSDK_ActionHandler* pActionHandler = pEnv->GetActionHander();/*(CPDFSDK_ActionHandler*)pApp->GetActionHandler();*/
- ASSERT(pActionHandler != NULL);
-
- return pActionHandler->DoAction_Field(action, type, pDocument, GetFormField(), data);
- }
-
- return FALSE;
-}
-
-CPDF_Action CPDFSDK_Widget::GetAAction(CPDF_AAction::AActionType eAAT)
-{
- switch (eAAT)
- {
- case CPDF_AAction::CursorEnter:
- case CPDF_AAction::CursorExit:
- case CPDF_AAction::ButtonDown:
- case CPDF_AAction::ButtonUp:
- case CPDF_AAction::GetFocus:
- case CPDF_AAction::LoseFocus:
- case CPDF_AAction::PageOpen:
- case CPDF_AAction::PageClose:
- case CPDF_AAction::PageVisible:
- case CPDF_AAction::PageInvisible:
- return CPDFSDK_Annot::GetAAction(eAAT);
- case CPDF_AAction::KeyStroke:
- case CPDF_AAction::Format:
- case CPDF_AAction::Validate:
- case CPDF_AAction::Calculate:
- {
- CPDF_FormField* pField = this->GetFormField();
- ASSERT(pField != NULL);
-
- if (CPDF_AAction aa = pField->GetAdditionalAction())
- return aa.GetAction(eAAT);
- else
- return CPDFSDK_Annot::GetAAction(eAAT);
- }
- default:
- return NULL;
- }
-
- return NULL;
-}
-
-
-CFX_WideString CPDFSDK_Widget::GetAlternateName() const
-{
- CPDF_FormField* pFormField = GetFormField();
- ASSERT(pFormField != NULL);
-
- return pFormField->GetAlternateName();
-}
-
-FX_INT32 CPDFSDK_Widget::GetAppearanceAge() const
-{
- return m_nAppAge;
-}
-
-FX_INT32 CPDFSDK_Widget::GetValueAge() const
-{
- return m_nValueAge;
-}
-
-
-FX_BOOL CPDFSDK_Widget::HitTest(FX_FLOAT pageX, FX_FLOAT pageY)
-{
- CPDF_Annot* pAnnot = GetPDFAnnot();
- CFX_FloatRect annotRect;
- pAnnot->GetRect(annotRect);
- if(annotRect.Contains(pageX, pageY))
- {
- if (!IsVisible()) return FALSE;
-
- int nFieldFlags = GetFieldFlags();
- if ((nFieldFlags & FIELDFLAG_READONLY) == FIELDFLAG_READONLY)
- return FALSE;
-
- return TRUE;
- }
- return FALSE;
-}
-
-CPDFSDK_InterForm::CPDFSDK_InterForm(CPDFSDK_Document* pDocument)
- :m_pDocument(pDocument),
- m_pInterForm(NULL),
- m_bCalculate(TRUE),
- m_bBusy(FALSE)
-{
- ASSERT(m_pDocument != NULL);
- m_pInterForm = new CPDF_InterForm(m_pDocument->GetDocument(), FALSE);
- ASSERT(m_pInterForm != NULL);
- m_pInterForm->SetFormNotify(this);
-
- for(int i=0; i<6; i++)
- m_bNeedHightlight[i] = FALSE;
- m_iHighlightAlpha = 0;
-}
-
-CPDFSDK_InterForm::~CPDFSDK_InterForm()
-{
- ASSERT(m_pInterForm != NULL);
- delete m_pInterForm;
- m_pInterForm = NULL;
-
- m_Map.RemoveAll();
-}
-
-void CPDFSDK_InterForm::Destroy()
-{
- delete this;
-}
-
-CPDF_InterForm* CPDFSDK_InterForm::GetInterForm()
-{
- return m_pInterForm;
-}
-
-CPDFSDK_Document* CPDFSDK_InterForm::GetDocument()
-{
- return m_pDocument;
-}
-
-FX_BOOL CPDFSDK_InterForm::HighlightWidgets()
-{
- return FALSE;
-}
-
-CPDFSDK_Widget* CPDFSDK_InterForm::GetSibling(CPDFSDK_Widget* pWidget, FX_BOOL bNext) const
-{
- ASSERT(pWidget != NULL);
-
- CBA_AnnotIterator* pIterator = new CBA_AnnotIterator(pWidget->GetPageView(), "Widget", "");
- ASSERT(pIterator != NULL);
-
- CPDFSDK_Widget* pRet = NULL;
-
- if (bNext)
- pRet = (CPDFSDK_Widget*)pIterator->GetNextAnnot(pWidget);
- else
- pRet = (CPDFSDK_Widget*)pIterator->GetPrevAnnot(pWidget);
-
- pIterator->Release();
-
- return pRet;
-
-}
-
-CPDFSDK_Widget* CPDFSDK_InterForm::GetWidget(CPDF_FormControl* pControl) const
-{
- if(!pControl || !m_pInterForm) return NULL;
-
- CPDFSDK_Widget* pWidget = NULL;
- m_Map.Lookup(pControl, pWidget);
-
- if (pWidget) return pWidget;
-
- CPDF_Dictionary* pControlDict = pControl->GetWidget();
- ASSERT(pControlDict != NULL);
-
- ASSERT(m_pDocument != NULL);
- CPDF_Document* pDocument = m_pDocument->GetDocument();
-
- CPDFSDK_PageView* pPage = NULL;
-
- if (CPDF_Dictionary* pPageDict = pControlDict->GetDict("P"))
- {
- int nPageIndex = pDocument->GetPageIndex(pPageDict->GetObjNum());
- if (nPageIndex >= 0)
- {
- pPage = m_pDocument->GetPageView(nPageIndex);
- }
- }
-
- if (!pPage)
- {
- int nPageIndex = GetPageIndexByAnnotDict(pDocument, pControlDict);
- if (nPageIndex >= 0)
- {
- pPage = m_pDocument->GetPageView(nPageIndex);
- }
- }
-
- if (pPage)
- return (CPDFSDK_Widget*)pPage->GetAnnotByDict(pControlDict);
-
- return NULL;
-}
-
-void CPDFSDK_InterForm::GetWidgets(const CFX_WideString& sFieldName, CFX_PtrArray& widgets)
-{
- ASSERT(m_pInterForm != NULL);
-
- for (int i=0,sz=m_pInterForm->CountFields(sFieldName); i<sz; i++)
- {
- CPDF_FormField* pFormField = m_pInterForm->GetField(i, sFieldName);
- ASSERT(pFormField != NULL);
-
- GetWidgets(pFormField, widgets);
- }
-}
-
-void CPDFSDK_InterForm::GetWidgets(CPDF_FormField* pField, CFX_PtrArray& widgets)
-{
- ASSERT(pField != NULL);
-
- for (int i=0,isz=pField->CountControls(); i<isz; i++)
- {
- CPDF_FormControl* pFormCtrl = pField->GetControl(i);
- ASSERT(pFormCtrl != NULL);
-
- CPDFSDK_Widget* pWidget = GetWidget(pFormCtrl);
-
- if (pWidget)
- widgets.Add(pWidget);
- }
-}
-
-int CPDFSDK_InterForm::GetPageIndexByAnnotDict(CPDF_Document* pDocument, CPDF_Dictionary* pAnnotDict) const
-{
- ASSERT(pDocument != NULL);
- ASSERT(pAnnotDict != NULL);
-
- for (int i=0,sz=pDocument->GetPageCount(); i<sz; i++)
- {
- if (CPDF_Dictionary* pPageDict = pDocument->GetPage(i))
- {
- if (CPDF_Array* pAnnots = pPageDict->GetArray("Annots"))
- {
- for (int j=0,jsz=pAnnots->GetCount(); j<jsz; j++)
- {
- CPDF_Object* pDict = pAnnots->GetElementValue(j);
- if (pAnnotDict == pDict)
- {
- return i;
- }
- }
- }
- }
- }
-
- return -1;
-}
-
-void CPDFSDK_InterForm::AddMap(CPDF_FormControl* pControl, CPDFSDK_Widget* pWidget)
-{
- m_Map.SetAt(pControl, pWidget);
-}
-
-void CPDFSDK_InterForm::RemoveMap(CPDF_FormControl* pControl)
-{
- m_Map.RemoveKey(pControl);
-}
-
-void CPDFSDK_InterForm::EnableCalculate(FX_BOOL bEnabled)
-{
- m_bCalculate = bEnabled;
-}
-
-FX_BOOL CPDFSDK_InterForm::IsCalculateEnabled() const
-{
- return m_bCalculate;
-}
-
-#ifdef _WIN32
-CPDF_Stream* CPDFSDK_InterForm::LoadImageFromFile(const CFX_WideString& sFile)
-{
- ASSERT(m_pDocument != NULL);
- CPDF_Document* pDocument = m_pDocument->GetDocument();
- ASSERT(pDocument != NULL);
-
- CPDF_Stream* pRetStream = NULL;
-
- if (CFX_DIBitmap* pBmp = CFX_WindowsDIB::LoadFromFile(sFile))
- {
- int nWidth = pBmp->GetWidth();
- int nHeight = pBmp->GetHeight();
-
- CPDF_Image Image(pDocument);
- Image.SetImage(pBmp, FALSE);
- CPDF_Stream* pImageStream = Image.GetStream();
- if (pImageStream)
- {
- if (pImageStream->GetObjNum() == 0)
- pDocument->AddIndirectObject(pImageStream);
-
- CPDF_Dictionary* pStreamDict = new CPDF_Dictionary();
- pStreamDict->SetAtName("Subtype", "Form");
- pStreamDict->SetAtName("Name", "IMG");
- CPDF_Array* pMatrix = new CPDF_Array();
- pStreamDict->SetAt("Matrix", pMatrix);
- pMatrix->AddInteger(1);
- pMatrix->AddInteger(0);
- pMatrix->AddInteger(0);
- pMatrix->AddInteger(1);
- pMatrix->AddInteger(-nWidth / 2);
- pMatrix->AddInteger(-nHeight / 2);
- CPDF_Dictionary* pResource = new CPDF_Dictionary();
- pStreamDict->SetAt("Resources", pResource);
- CPDF_Dictionary* pXObject = new CPDF_Dictionary();
- pResource->SetAt("XObject", pXObject);
- pXObject->SetAtReference("Img", pDocument, pImageStream);
- CPDF_Array* pProcSet = new CPDF_Array();
- pResource->SetAt("ProcSet", pProcSet);
- pProcSet->AddName("PDF");
- pProcSet->AddName("ImageC");
- pStreamDict->SetAtName("Type", "XObject");
- CPDF_Array* pBBox = new CPDF_Array();
- pStreamDict->SetAt("BBox", pBBox);
- pBBox->AddInteger(0);
- pBBox->AddInteger(0);
- pBBox->AddInteger(nWidth);
- pBBox->AddInteger(nHeight);
- pStreamDict->SetAtInteger("FormType", 1);
-
- pRetStream = new CPDF_Stream(NULL, 0, NULL);
- CFX_ByteString csStream;
- csStream.Format("q\n%d 0 0 %d 0 0 cm\n/Img Do\nQ", nWidth, nHeight);
- pRetStream->InitStream((FX_BYTE*)(FX_LPCSTR)csStream, csStream.GetLength(), pStreamDict);
- pDocument->AddIndirectObject(pRetStream);
- }
-
- delete pBmp;
- }
-
- return pRetStream;
-}
-#endif
-
-void CPDFSDK_InterForm::OnCalculate(CPDF_FormField* pFormField)
-{
- ASSERT(m_pDocument != NULL);
- CPDFDoc_Environment* pEnv = m_pDocument->GetEnv();
- ASSERT(pEnv);
- if(!pEnv->IsJSInitiated())
- return;
-
- if (m_bBusy) return;
-
- m_bBusy = TRUE;
-
- if (this->IsCalculateEnabled())
- {
- IFXJS_Runtime* pRuntime = m_pDocument->GetJsRuntime();
- ASSERT(pRuntime != NULL);
-
- pRuntime->SetReaderDocument(m_pDocument);
-
- int nSize = m_pInterForm->CountFieldsInCalculationOrder();
- for (int i=0; i<nSize; i++)
- {
- if(CPDF_FormField* pField = m_pInterForm->GetFieldInCalculationOrder(i))
- {
-// ASSERT(pField != NULL);
- int nType = pField->GetFieldType();
- if (nType == FIELDTYPE_COMBOBOX || nType == FIELDTYPE_TEXTFIELD)
- {
- CPDF_AAction aAction = pField->GetAdditionalAction();
- if (aAction && aAction.ActionExist(CPDF_AAction::Calculate))
- {
- CPDF_Action action = aAction.GetAction(CPDF_AAction::Calculate);
- if (action)
- {
- CFX_WideString csJS = action.GetJavaScript();
- if (!csJS.IsEmpty())
- {
- IFXJS_Context* pContext = pRuntime->NewContext();
- ASSERT(pContext != NULL);
-
- CFX_WideString sOldValue = pField->GetValue();
- CFX_WideString sValue = sOldValue;
- FX_BOOL bRC = TRUE;
- pContext->OnField_Calculate(pFormField, pField, sValue, bRC);
-
- CFX_WideString sInfo;
- FX_BOOL bRet = pContext->RunScript(csJS, sInfo);
- pRuntime->ReleaseContext(pContext);
-
- if (bRet)
- {
- if (bRC)
- {
- if (sValue.Compare(sOldValue) != 0)
- pField->SetValue(sValue, TRUE);
- }
- }
- }
- }
- }
- }
- }
- }
-
-
- }
-
- m_bBusy = FALSE;
-}
-
-CFX_WideString CPDFSDK_InterForm::OnFormat(CPDF_FormField* pFormField, int nCommitKey, FX_BOOL& bFormated)
-{
- ASSERT(m_pDocument != NULL);
- ASSERT(pFormField != NULL);
-
- CFX_WideString sValue = pFormField->GetValue();
- CPDFDoc_Environment* pEnv = m_pDocument->GetEnv();
- ASSERT(pEnv);
- if(!pEnv->IsJSInitiated())
- {
- bFormated = FALSE;
- return sValue;
- }
-
- IFXJS_Runtime* pRuntime = m_pDocument->GetJsRuntime();
- ASSERT(pRuntime != NULL);
-
- pRuntime->SetReaderDocument(m_pDocument);
-
- if (pFormField->GetFieldType() == FIELDTYPE_COMBOBOX)
- {
- if (pFormField->CountSelectedItems() > 0)
- {
- int index = pFormField->GetSelectedIndex(0);
- if (index >= 0)
- sValue = pFormField->GetOptionLabel(index);
- }
- }
-
- bFormated = FALSE;
-
- CPDF_AAction aAction = pFormField->GetAdditionalAction();
- if (aAction != NULL && aAction.ActionExist(CPDF_AAction::Format))
- {
- CPDF_Action action = aAction.GetAction(CPDF_AAction::Format);
- if (action)
- {
- CFX_WideString script = action.GetJavaScript();
- if (!script.IsEmpty())
- {
- CFX_WideString Value = sValue;
-
- IFXJS_Context* pContext = pRuntime->NewContext();
- ASSERT(pContext != NULL);
-
- pContext->OnField_Format(nCommitKey, pFormField, Value, TRUE);
-
- CFX_WideString sInfo;
- FX_BOOL bRet = pContext->RunScript(script, sInfo);
- pRuntime->ReleaseContext(pContext);
-
- if (bRet)
- {
- sValue = Value;
- bFormated = TRUE;
- }
- }
- }
- }
-
- return sValue;
-}
-
-void CPDFSDK_InterForm::ResetFieldAppearance(CPDF_FormField* pFormField, FX_LPCWSTR sValue, FX_BOOL bValueChanged)
-{
- ASSERT(pFormField != NULL);
-
- for (int i=0,sz=pFormField->CountControls(); i<sz; i++)
- {
- CPDF_FormControl* pFormCtrl = pFormField->GetControl(i);
- ASSERT(pFormCtrl != NULL);
-
- ASSERT(m_pInterForm != NULL);
- if(CPDFSDK_Widget* pWidget = GetWidget(pFormCtrl))
- pWidget->ResetAppearance(sValue, bValueChanged);
- }
-}
-
-void CPDFSDK_InterForm::UpdateField(CPDF_FormField* pFormField)
-{
- ASSERT(pFormField != NULL);
-
- for (int i=0,sz=pFormField->CountControls(); i<sz; i++)
- {
- CPDF_FormControl* pFormCtrl = pFormField->GetControl(i);
- ASSERT(pFormCtrl != NULL);
-
- if(CPDFSDK_Widget* pWidget = GetWidget(pFormCtrl))
- {
- CPDFDoc_Environment * pEnv = m_pDocument->GetEnv();
- CFFL_IFormFiller* pIFormFiller = pEnv->GetIFormFiller();
-
- CPDF_Page * pPage = pWidget->GetPDFPage();
- CPDFSDK_PageView * pPageView = m_pDocument->GetPageView(pPage,FALSE);
-
- FX_RECT rcBBox = pIFormFiller->GetViewBBox(pPageView, pWidget);
-
- pEnv->FFI_Invalidate(pPage,rcBBox.left, rcBBox.top, rcBBox.right, rcBBox.bottom);
- }
- }
-}
-
-void CPDFSDK_InterForm::OnKeyStrokeCommit(CPDF_FormField* pFormField, CFX_WideString& csValue, FX_BOOL& bRC)
-{
- ASSERT(pFormField != NULL);
-
- CPDF_AAction aAction = pFormField->GetAdditionalAction();
- if (aAction != NULL && aAction.ActionExist(CPDF_AAction::KeyStroke))
- {
- CPDF_Action action = aAction.GetAction(CPDF_AAction::KeyStroke);
- if (action)
- {
- ASSERT(m_pDocument != NULL);
- CPDFDoc_Environment* pEnv = m_pDocument->GetEnv();
- ASSERT(pEnv != NULL);
-
- CPDFSDK_ActionHandler* pActionHandler = pEnv->GetActionHander();
- ASSERT(pActionHandler != NULL);
-
- PDFSDK_FieldAction fa;
- fa.bModifier = pEnv->FFI_IsCTRLKeyDown(0);
- fa.bShift = pEnv->FFI_IsSHIFTKeyDown(0);
- fa.sValue = csValue;
-
- pActionHandler->DoAction_FieldJavaScript(action, CPDF_AAction::KeyStroke,
- m_pDocument, pFormField, fa);
- bRC = fa.bRC;
- }
- }
-}
-
-void CPDFSDK_InterForm::OnValidate(CPDF_FormField* pFormField, CFX_WideString& csValue, FX_BOOL& bRC)
-{
- ASSERT(pFormField != NULL);
-
- CPDF_AAction aAction = pFormField->GetAdditionalAction();
- if (aAction != NULL && aAction.ActionExist(CPDF_AAction::Validate))
- {
- CPDF_Action action = aAction.GetAction(CPDF_AAction::Validate);
- if (action)
- {
- ASSERT(m_pDocument != NULL);
- CPDFDoc_Environment* pEnv = m_pDocument->GetEnv();
- ASSERT(pEnv != NULL);
-
- CPDFSDK_ActionHandler* pActionHandler = pEnv->GetActionHander();
- ASSERT(pActionHandler != NULL);
-
- PDFSDK_FieldAction fa;
- fa.bModifier = pEnv->FFI_IsCTRLKeyDown(0);
- fa.bShift = pEnv->FFI_IsSHIFTKeyDown(0);
- fa.sValue = csValue;
-
- pActionHandler->DoAction_FieldJavaScript(action, CPDF_AAction::Validate, m_pDocument, pFormField, fa);
- bRC = fa.bRC;
-
- }
- }
-}
-
-/* ----------------------------- action ----------------------------- */
-
-FX_BOOL CPDFSDK_InterForm::DoAction_Hide(const CPDF_Action& action)
-{
- ASSERT(action != NULL);
-
- CPDF_ActionFields af = action.GetWidgets();
- CFX_PtrArray fieldObjects;
- af.GetAllFields(fieldObjects);
- CFX_PtrArray widgetArray;
- CFX_PtrArray fields;
- GetFieldFromObjects(fieldObjects, fields);
-
- FX_BOOL bHide = action.GetHideStatus();
-
- FX_BOOL bChanged = FALSE;
-
- for (int i=0, sz=fields.GetSize(); i<sz; i++)
- {
- CPDF_FormField* pField = (CPDF_FormField*)fields[i];
- ASSERT(pField != NULL);
-
-
- for (int j=0,jsz=pField->CountControls(); j<jsz; j++)
- {
- CPDF_FormControl* pControl = pField->GetControl(j);
- ASSERT(pControl != NULL);
-
- if (CPDFSDK_Widget* pWidget = GetWidget(pControl))
- {
- int nFlags = pWidget->GetFlags();
- if (bHide)
- {
- nFlags &= (~ANNOTFLAG_INVISIBLE);
- nFlags &= (~ANNOTFLAG_NOVIEW);
- nFlags |= (ANNOTFLAG_HIDDEN);
- }
- else
- {
- nFlags &= (~ANNOTFLAG_INVISIBLE);
- nFlags &= (~ANNOTFLAG_HIDDEN);
- nFlags &= (~ANNOTFLAG_NOVIEW);
- }
- pWidget->SetFlags(nFlags);
-
- CPDFSDK_PageView* pPageView = pWidget->GetPageView();
- ASSERT(pPageView != NULL);
-
- pPageView->UpdateView(pWidget);
-
- bChanged = TRUE;
- }
- }
- }
-
- return bChanged;
-}
-
-FX_BOOL CPDFSDK_InterForm::DoAction_SubmitForm(const CPDF_Action& action)
-{
- ASSERT(action != NULL);
- ASSERT(m_pInterForm != NULL);
-
- CFX_WideString sDestination = action.GetFilePath();
- if (sDestination.IsEmpty()) return FALSE;
-
- CPDF_Dictionary* pActionDict = action;
- if (pActionDict->KeyExist("Fields"))
- {
- CPDF_ActionFields af = action.GetWidgets();
- FX_DWORD dwFlags = action.GetFlags();
-
- CFX_PtrArray fieldObjects;
- af.GetAllFields(fieldObjects);
- CFX_PtrArray fields;
- GetFieldFromObjects(fieldObjects, fields);
-
- if (fields.GetSize() != 0)
- {
- FX_BOOL bIncludeOrExclude = !(dwFlags & 0x01);
- if (m_pInterForm->CheckRequiredFields(&fields, bIncludeOrExclude))
- {
- return FALSE;
- }
- return SubmitFields(sDestination, fields, bIncludeOrExclude, FALSE);
- }
- else
- {
- if ( m_pInterForm->CheckRequiredFields())
- {
- return FALSE;
- }
-
- return SubmitForm(sDestination, FALSE);
- }
- }
- else
- {
- if ( m_pInterForm->CheckRequiredFields())
- {
- return FALSE;
- }
-
- return SubmitForm(sDestination, FALSE);
- }
-}
-
-FX_BOOL CPDFSDK_InterForm::SubmitFields(const CFX_WideString& csDestination, const CFX_PtrArray& fields,
- FX_BOOL bIncludeOrExclude, FX_BOOL bUrlEncoded)
-{
- CPDFDoc_Environment* pEnv = m_pDocument->GetEnv();
- ASSERT(pEnv != NULL);
-
- CFX_ByteTextBuf textBuf;
- ExportFieldsToFDFTextBuf(fields, bIncludeOrExclude, textBuf);
-
- FX_LPBYTE pBuffer = textBuf.GetBuffer();
- FX_STRSIZE nBufSize = textBuf.GetLength();
-
- if (bUrlEncoded)
- {
- if(!FDFToURLEncodedData(pBuffer, nBufSize))
- return FALSE;
- }
-
- pEnv->JS_docSubmitForm(pBuffer, nBufSize, (FX_LPCWSTR)csDestination);
-
- if (bUrlEncoded && pBuffer)
- {
- FX_Free(pBuffer);
- pBuffer = NULL;
- }
-
- return TRUE;
-}
-
-void CPDFSDK_InterForm::DoFDFBuffer(CFX_ByteString sBuffer)
-{
- ASSERT(m_pDocument != NULL);
-
- if (CFDF_Document *pFDFDocument = CFDF_Document::ParseMemory((const unsigned char *)sBuffer.GetBuffer(sBuffer.GetLength()), sBuffer.GetLength()))
- {
- CPDF_Dictionary* pRootDic = pFDFDocument->GetRoot();
- if(pRootDic)
- {
- CPDF_Dictionary * pFDFDict=pRootDic->GetDict("FDF");
- if(pFDFDict)
- {
- CPDF_Dictionary * pJSDict = pFDFDict->GetDict("JavaScript");
- if(pJSDict)
- {
- CFX_WideString csJS;
-
- CPDF_Object* pJS = pJSDict->GetElementValue("Before");
- if (pJS != NULL)
- {
- int iType = pJS->GetType();
- if (iType == PDFOBJ_STRING)
- csJS = pJSDict->GetUnicodeText("Before");
- else if (iType == PDFOBJ_STREAM)
- csJS = pJS->GetUnicodeText();
- }
-
- }
- }
- }
- delete pFDFDocument;
- }
-
- sBuffer.ReleaseBuffer();
-}
-
-FX_BOOL CPDFSDK_InterForm::FDFToURLEncodedData(CFX_WideString csFDFFile, CFX_WideString csTxtFile)
-{
- return TRUE;
-}
-
-FX_BOOL CPDFSDK_InterForm::FDFToURLEncodedData(FX_LPBYTE& pBuf, FX_STRSIZE& nBufSize)
-{
- CFDF_Document* pFDF = CFDF_Document::ParseMemory(pBuf, nBufSize);
- if (pFDF)
- {
- CPDF_Dictionary* pMainDict = pFDF->GetRoot()->GetDict("FDF");
- if (pMainDict == NULL) return FALSE;
-
- // Get fields
- CPDF_Array* pFields = pMainDict->GetArray("Fields");
- if (pFields == NULL) return FALSE;
-
- CFX_ByteTextBuf fdfEncodedData;
-
- for (FX_DWORD i = 0; i < pFields->GetCount(); i ++)
- {
- CPDF_Dictionary* pField = pFields->GetDict(i);
- if (pField == NULL) continue;
- CFX_WideString name;
- name = pField->GetUnicodeText("T");
- CFX_ByteString name_b = CFX_ByteString::FromUnicode(name);
- CFX_ByteString csBValue = pField->GetString("V");
- CFX_WideString csWValue = PDF_DecodeText(csBValue);
- CFX_ByteString csValue_b = CFX_ByteString::FromUnicode(csWValue);
-
- fdfEncodedData = fdfEncodedData<<name_b.GetBuffer(name_b.GetLength());
- name_b.ReleaseBuffer();
- fdfEncodedData = fdfEncodedData<<"=";
- fdfEncodedData = fdfEncodedData<<csValue_b.GetBuffer(csValue_b.GetLength());
- csValue_b.ReleaseBuffer();
- if(i != pFields->GetCount()-1)
- fdfEncodedData = fdfEncodedData<<"&";
- }
-
- nBufSize = fdfEncodedData.GetLength();
- pBuf = FX_Alloc(FX_BYTE, nBufSize);
- if(!pBuf)
- return FALSE;
- FXSYS_memcpy(pBuf, fdfEncodedData.GetBuffer(), nBufSize);
-
- }
- return TRUE;
-}
-
-FX_BOOL CPDFSDK_InterForm::ExportFieldsToFDFFile(const CFX_WideString& sFDFFileName,
- const CFX_PtrArray& fields, FX_BOOL bIncludeOrExclude)
-{
- if (sFDFFileName.IsEmpty()) return FALSE;
- ASSERT(m_pDocument != NULL);
- ASSERT(m_pInterForm != NULL);
-
- CFDF_Document* pFDF = m_pInterForm->ExportToFDF(m_pDocument->GetPath(),(CFX_PtrArray&)fields, bIncludeOrExclude);
- if (!pFDF) return FALSE;
- FX_BOOL bRet = pFDF->WriteFile(sFDFFileName.UTF8Encode()); // = FALSE;//
- delete pFDF;
-
- return bRet;
-}
-FX_BOOL CPDFSDK_InterForm::ExportFieldsToFDFTextBuf(const CFX_PtrArray& fields,FX_BOOL bIncludeOrExclude, CFX_ByteTextBuf& textBuf)
-{
- ASSERT(m_pDocument != NULL);
- ASSERT(m_pInterForm != NULL);
-
- CFDF_Document* pFDF = m_pInterForm->ExportToFDF(m_pDocument->GetPath(),(CFX_PtrArray&)fields, bIncludeOrExclude);
- if (!pFDF) return FALSE;
- FX_BOOL bRet = pFDF->WriteBuf(textBuf); // = FALSE;//
- delete pFDF;
-
- return bRet;
-}
-
-CFX_WideString CPDFSDK_InterForm::GetTemporaryFileName(const CFX_WideString& sFileExt)
-{
- CFX_WideString sFileName;
- return L"";
-}
-
-FX_BOOL CPDFSDK_InterForm::SubmitForm(const CFX_WideString& sDestination, FX_BOOL bUrlEncoded)
-{
- if (sDestination.IsEmpty()) return FALSE;
-
- CPDFDoc_Environment* pEnv = m_pDocument->GetEnv();
- ASSERT(pEnv != NULL);
-
- if(NULL == m_pDocument) return FALSE;
- CFX_WideString wsPDFFilePath = m_pDocument->GetPath();
-
- if(NULL == m_pInterForm) return FALSE;
- CFDF_Document* pFDFDoc = m_pInterForm->ExportToFDF(wsPDFFilePath);
- if (NULL == pFDFDoc) return FALSE;
-
- CFX_ByteTextBuf FdfBuffer;
- FX_BOOL bRet = pFDFDoc->WriteBuf(FdfBuffer);
- delete pFDFDoc;
- if (!bRet) return FALSE;
-
- FX_LPBYTE pBuffer = FdfBuffer.GetBuffer();
- FX_STRSIZE nBufSize = FdfBuffer.GetLength();
-
- if (bUrlEncoded)
- {
- if(!FDFToURLEncodedData(pBuffer, nBufSize))
- return FALSE;
- }
-
- pEnv->JS_docSubmitForm(pBuffer, nBufSize, (FX_LPCWSTR)sDestination);
-
- if (bUrlEncoded && pBuffer)
- {
- FX_Free(pBuffer);
- pBuffer = NULL;
- }
-
- return TRUE;
-}
-
-FX_BOOL CPDFSDK_InterForm::ExportFormToFDFFile(const CFX_WideString& sFDFFileName)
-{
- if (sFDFFileName.IsEmpty()) return FALSE;
-
- ASSERT(m_pInterForm != NULL);
- ASSERT(m_pDocument != NULL);
-
- CFDF_Document* pFDF = m_pInterForm->ExportToFDF(m_pDocument->GetPath());
- if (!pFDF) return FALSE;
-
- FX_BOOL bRet = pFDF->WriteFile(sFDFFileName.UTF8Encode());
- delete pFDF;
-
- return bRet;
-}
-
-FX_BOOL CPDFSDK_InterForm::ExportFormToFDFTextBuf(CFX_ByteTextBuf& textBuf)
-{
-
- ASSERT(m_pInterForm != NULL);
- ASSERT(m_pDocument != NULL);
-
- CFDF_Document* pFDF = m_pInterForm->ExportToFDF(m_pDocument->GetPath());
- if (!pFDF) return FALSE;
-
- FX_BOOL bRet = pFDF->WriteBuf(textBuf);
- delete pFDF;
-
- return bRet;
-}
-
-FX_BOOL CPDFSDK_InterForm::ExportFormToTxtFile(const CFX_WideString& sTxtFileName)
-{
- ASSERT(m_pInterForm != NULL);
-
- CFX_WideString sFieldNames;
- CFX_WideString sFieldValues;
-
- int nSize = m_pInterForm->CountFields();
-
- if (nSize > 0)
- {
- for (int i=0; i<nSize; i++)
- {
- CPDF_FormField* pField = m_pInterForm->GetField(i);
- ASSERT(pField != NULL);
-
- if (i != 0)
- {
- sFieldNames += L"\t";
- sFieldValues += L"\t";
- }
- sFieldNames += pField->GetFullName();
- sFieldValues += pField->GetValue();
- }
-
- return TRUE;
- }
-
- return FALSE;
-}
-
-FX_BOOL CPDFSDK_InterForm::ImportFormFromTxtFile(const CFX_WideString& sTxtFileName)
-{
- ASSERT(m_pInterForm != NULL);
-
- return TRUE;
-}
-
-FX_BOOL CPDFSDK_InterForm::DoAction_ResetForm(const CPDF_Action& action)
-{
- ASSERT(action != NULL);
-
- CPDF_Dictionary* pActionDict = action;
-
- if (pActionDict->KeyExist("Fields"))
- {
- CPDF_ActionFields af = action.GetWidgets();
- FX_DWORD dwFlags = action.GetFlags();
-
- CFX_PtrArray fieldObjects;
- af.GetAllFields(fieldObjects);
- CFX_PtrArray fields;
- GetFieldFromObjects(fieldObjects, fields);
-
- ASSERT(m_pInterForm != NULL);
-
- return m_pInterForm->ResetForm(fields, !(dwFlags & 0x01), TRUE);
- }
- else
- {
- ASSERT(m_pInterForm != NULL);
- return m_pInterForm->ResetForm(TRUE);
- }
-}
-
-FX_BOOL CPDFSDK_InterForm::DoAction_ImportData(const CPDF_Action& action)
-{
- ASSERT(action != NULL);
-
- CFX_WideString sFilePath = action.GetFilePath();
- if (sFilePath.IsEmpty())
- return FALSE;
-
- if (!ImportFormFromFDFFile(sFilePath, TRUE))
- {
- return FALSE;
- }
-
- return TRUE;
-}
-
-FX_BOOL CPDFSDK_InterForm::ImportFormFromFDFFile(const CFX_WideString& csFDFFileName,
- FX_BOOL bNotify)
-{
- return FALSE;
-}
-
-void CPDFSDK_InterForm::GetFieldFromObjects(const CFX_PtrArray& objects, CFX_PtrArray& fields)
-{
- ASSERT(m_pInterForm != NULL);
-
- int iCount = objects.GetSize();
- for (int i = 0; i < iCount; i ++)
- {
- CPDF_Object* pObject = (CPDF_Object*)objects[i];
- if (pObject == NULL) continue;
-
- int iType = pObject->GetType();
- if (iType == PDFOBJ_STRING)
- {
- CFX_WideString csName = pObject->GetUnicodeText();
- CPDF_FormField* pField = m_pInterForm->GetField(0, csName);
- if (pField != NULL)
- fields.Add(pField);
- }
- else if (iType == PDFOBJ_DICTIONARY)
- {
- if (m_pInterForm->IsValidFormField(pObject))
- fields.Add(pObject);
- }
- }
-}
-
-/* ----------------------------- CPDF_FormNotify ----------------------------- */
-
-int CPDFSDK_InterForm::BeforeValueChange(const CPDF_FormField* pField, CFX_WideString& csValue)
-{
- ASSERT(pField != NULL);
-
- CPDF_FormField* pFormField = (CPDF_FormField*)pField;
-
- int nType = pFormField->GetFieldType();
- if (nType == FIELDTYPE_COMBOBOX || nType == FIELDTYPE_TEXTFIELD)
- {
- FX_BOOL bRC = TRUE;
- OnKeyStrokeCommit(pFormField, csValue, bRC);
- if (bRC)
- {
- OnValidate(pFormField, csValue, bRC);
- if (bRC)
- return 1;
- else
- return -1;
- }
- else
- return -1;
- }
- else
- return 0;
-}
-
-int CPDFSDK_InterForm::AfterValueChange(const CPDF_FormField* pField)
-{
- ASSERT(pField != NULL);
-
- CPDF_FormField* pFormField = (CPDF_FormField*)pField;
- int nType = pFormField->GetFieldType();
-
- if (nType == FIELDTYPE_COMBOBOX || nType == FIELDTYPE_TEXTFIELD)
- {
- this->OnCalculate(pFormField);
- FX_BOOL bFormated = FALSE;
- CFX_WideString sValue = this->OnFormat(pFormField, 0, bFormated);
- if (bFormated)
- this->ResetFieldAppearance(pFormField, sValue, TRUE);
- else
- this->ResetFieldAppearance(pFormField, NULL, TRUE);
- this->UpdateField(pFormField);
- }
-
- return 0;
-}
-
-int CPDFSDK_InterForm::BeforeSelectionChange(const CPDF_FormField* pField, CFX_WideString& csValue)
-{
- ASSERT(pField != NULL);
-
- CPDF_FormField* pFormField = (CPDF_FormField*)pField;
-
- int nType = pFormField->GetFieldType();
- if (nType == FIELDTYPE_LISTBOX)
- {
- FX_BOOL bRC = TRUE;
- OnKeyStrokeCommit(pFormField, csValue, bRC);
- if (bRC)
- {
- OnValidate(pFormField, csValue, bRC);
- if (bRC)
- return 1;
- else
- return -1;
- }
- else
- return -1;
- }
- else
- return 0;
-}
-
-int CPDFSDK_InterForm::AfterSelectionChange(const CPDF_FormField* pField)
-{
- ASSERT(pField != NULL);
-
- CPDF_FormField* pFormField = (CPDF_FormField*)pField;
- int nType = pFormField->GetFieldType();
-
- if (nType == FIELDTYPE_LISTBOX)
- {
- this->OnCalculate(pFormField);
- this->ResetFieldAppearance(pFormField, NULL, TRUE);
- this->UpdateField(pFormField);
- }
-
- return 0;
-}
-
-int CPDFSDK_InterForm::AfterCheckedStatusChange(const CPDF_FormField* pField, const CFX_ByteArray& statusArray)
-{
- ASSERT(pField != NULL);
-
- CPDF_FormField* pFormField = (CPDF_FormField*)pField;
- int nType = pFormField->GetFieldType();
-
- if (nType == FIELDTYPE_CHECKBOX || nType == FIELDTYPE_RADIOBUTTON)
- {
- this->OnCalculate(pFormField);
- //this->ResetFieldAppearance(pFormField, NULL);
- this->UpdateField(pFormField);
- }
-
- return 0;
-}
-
-int CPDFSDK_InterForm::BeforeFormReset(const CPDF_InterForm* pForm)
-{
- return 0;
-}
-
-int CPDFSDK_InterForm::AfterFormReset(const CPDF_InterForm* pForm)
-{
- this->OnCalculate(NULL);
-
- return 0;
-}
-
-int CPDFSDK_InterForm::BeforeFormImportData(const CPDF_InterForm* pForm)
-{
- return 0;
-}
-
-int CPDFSDK_InterForm::AfterFormImportData(const CPDF_InterForm* pForm)
-{
- this->OnCalculate(NULL);
-
- return 0;
-}
-
-FX_BOOL CPDFSDK_InterForm::IsNeedHighLight(int nFieldType)
-{
- if(nFieldType <1 || nFieldType > 6)
- return FALSE;
- return m_bNeedHightlight[nFieldType-1];
-}
-
-void CPDFSDK_InterForm::RemoveAllHighLight()
-{
- memset((void*)m_bNeedHightlight, 0, 6*sizeof(FX_BOOL));
-}
-void CPDFSDK_InterForm::SetHighlightColor(FX_COLORREF clr, int nFieldType)
-{
- if(nFieldType <0 || nFieldType > 6) return;
- switch(nFieldType)
- {
- case 0:
- {
- for(int i=0; i<6; i++)
- {
- m_aHighlightColor[i] = clr;
- m_bNeedHightlight[i] = TRUE;
- }
- break;
- }
- default:
- {
- m_aHighlightColor[nFieldType-1] = clr;
- m_bNeedHightlight[nFieldType-1] = TRUE;
- break;
- }
- }
-
-}
-
-FX_COLORREF CPDFSDK_InterForm::GetHighlightColor(int nFieldType)
-{
- if(nFieldType <0 || nFieldType >6) return FXSYS_RGB(255,255,255);
- if(nFieldType == 0)
- return m_aHighlightColor[0];
- else
- return m_aHighlightColor[nFieldType-1];
-}
-
-/* ------------------------- CBA_AnnotIterator ------------------------- */
-
-CBA_AnnotIterator::CBA_AnnotIterator(CPDFSDK_PageView* pPageView, const CFX_ByteString& sType, const CFX_ByteString& sSubType)
- :m_pPageView(pPageView),
- m_sType(sType),
- m_sSubType(sSubType),
- m_nTabs(BAI_STRUCTURE)
-{
- ASSERT(m_pPageView != NULL);
-
- CPDF_Page* pPDFPage = m_pPageView->GetPDFPage();
- ASSERT(pPDFPage != NULL);
- ASSERT(pPDFPage->m_pFormDict != NULL);
-
- CFX_ByteString sTabs = pPDFPage->m_pFormDict->GetString("Tabs");
-
- if (sTabs == "R")
- {
- m_nTabs = BAI_ROW;
- }
- else if (sTabs == "C")
- {
- m_nTabs = BAI_COLUMN;
- }
- else
- {
- m_nTabs = BAI_STRUCTURE;
- }
-
- GenerateResults();
-}
-
-CBA_AnnotIterator::~CBA_AnnotIterator()
-{
- m_Annots.RemoveAll();
-}
-
-CPDFSDK_Annot* CBA_AnnotIterator::GetFirstAnnot()
-{
- if (m_Annots.GetSize() > 0)
- return m_Annots[0];
-
- return NULL;
-}
-
-CPDFSDK_Annot* CBA_AnnotIterator::GetLastAnnot()
-{
- if (m_Annots.GetSize() > 0)
- return m_Annots[m_Annots.GetSize() - 1];
-
- return NULL;
-}
-
-CPDFSDK_Annot* CBA_AnnotIterator::GetNextAnnot(CPDFSDK_Annot* pAnnot)
-{
- for (int i=0,sz=m_Annots.GetSize(); i<sz; i++)
- {
- if (m_Annots[i] == pAnnot)
- {
- if (i+1 < sz)
- return m_Annots[i+1];
- else
- return m_Annots[0];
- }
- }
-
- return NULL;
-}
-
-CPDFSDK_Annot* CBA_AnnotIterator::GetPrevAnnot(CPDFSDK_Annot* pAnnot)
-{
- for (int i=0,sz=m_Annots.GetSize(); i<sz; i++)
- {
- if (m_Annots[i] == pAnnot)
- {
- if (i-1 >= 0)
- return m_Annots[i-1];
- else
- return m_Annots[sz-1];
- }
- }
-
- return NULL;
-}
-
-int CBA_AnnotIterator::CompareByLeft(CPDFSDK_Annot* p1, CPDFSDK_Annot* p2)
-{
- ASSERT(p1 != NULL);
- ASSERT(p2 != NULL);
-
- CPDF_Rect rcAnnot1 = GetAnnotRect(p1);
- CPDF_Rect rcAnnot2 = GetAnnotRect(p2);
-
- if (rcAnnot1.left < rcAnnot2.left)
- return -1;
- if (rcAnnot1.left > rcAnnot2.left)
- return 1;
- return 0;
-}
-
-
-int CBA_AnnotIterator::CompareByTop(CPDFSDK_Annot* p1, CPDFSDK_Annot* p2)
-{
- ASSERT(p1 != NULL);
- ASSERT(p2 != NULL);
-
- CPDF_Rect rcAnnot1 = GetAnnotRect(p1);
- CPDF_Rect rcAnnot2 = GetAnnotRect(p2);
-
- if (rcAnnot1.top < rcAnnot2.top)
- return -1;
- if (rcAnnot1.top > rcAnnot2.top)
- return 1;
- return 0;
-}
-
-void CBA_AnnotIterator::GenerateResults()
-{
- ASSERT(m_pPageView != NULL);
-
- switch (m_nTabs)
- {
- case BAI_STRUCTURE:
- {
- for (int i=0,sz=m_pPageView->CountAnnots(); i<sz; i++)
- {
- CPDFSDK_Annot* pAnnot = m_pPageView->GetAnnot(i);
- ASSERT(pAnnot != NULL);
-
- if (pAnnot->GetType() == m_sType
- && pAnnot->GetSubType() == m_sSubType)
- m_Annots.Add(pAnnot);
- }
- }
- break;
- case BAI_ROW:
- {
- CPDFSDK_SortAnnots sa;
-
- {
-
- for (int i=0,sz=m_pPageView->CountAnnots(); i<sz; i++)
- {
- CPDFSDK_Annot* pAnnot = m_pPageView->GetAnnot(i);
- ASSERT(pAnnot != NULL);
-
- if (pAnnot->GetType() == m_sType
- && pAnnot->GetSubType() == m_sSubType)
- sa.Add(pAnnot);
- }
- }
-
- if (sa.GetSize() > 0)
- {
- sa.Sort(CBA_AnnotIterator::CompareByLeft);
- }
-
- while (sa.GetSize() > 0)
- {
- int nLeftTopIndex = -1;
-
- {
- FX_FLOAT fTop = 0.0f;
-
- for (int i=sa.GetSize()-1; i>=0; i--)
- {
- CPDFSDK_Annot* pAnnot = sa.GetAt(i);
- ASSERT(pAnnot != NULL);
-
- CPDF_Rect rcAnnot = GetAnnotRect(pAnnot);
-
- if (rcAnnot.top > fTop)
- {
- nLeftTopIndex = i;
- fTop = rcAnnot.top;
- }
- }
- }
-
- if (nLeftTopIndex >= 0)
- {
- CPDFSDK_Annot* pLeftTopAnnot = sa.GetAt(nLeftTopIndex);
- ASSERT(pLeftTopAnnot != NULL);
-
- CPDF_Rect rcLeftTop = GetAnnotRect(pLeftTopAnnot);
-
- m_Annots.Add(pLeftTopAnnot);
- sa.RemoveAt(nLeftTopIndex);
-
- CFX_ArrayTemplate<int> aSelect;
-
- {
- for (int i=0,sz=sa.GetSize(); i<sz; i++)
- {
- CPDFSDK_Annot* pAnnot = sa.GetAt(i);
- ASSERT(pAnnot != NULL);
-
- CPDF_Rect rcAnnot = GetAnnotRect(pAnnot);
-
- FX_FLOAT fCenterY = (rcAnnot.top + rcAnnot.bottom) / 2.0f;
-
- if (fCenterY > rcLeftTop.bottom && fCenterY < rcLeftTop.top)
- aSelect.Add(i);
- }
- }
-
- {
- for (int i=0,sz=aSelect.GetSize(); i<sz; i++)
- {
- m_Annots.Add(sa[aSelect[i]]);
- }
- }
-
- {
- for (int i=aSelect.GetSize()-1; i>=0; i--)
- {
- sa.RemoveAt(aSelect[i]);
- }
- }
-
- aSelect.RemoveAll();
- }
- }
- sa.RemoveAll();
- }
- break;
- case BAI_COLUMN:
- {
- CPDFSDK_SortAnnots sa;
-
- {
- for (int i=0,sz=m_pPageView->CountAnnots(); i<sz; i++)
- {
- CPDFSDK_Annot* pAnnot = m_pPageView->GetAnnot(i);
- ASSERT(pAnnot != NULL);
-
- if (pAnnot->GetType() == m_sType
- && pAnnot->GetSubType() == m_sSubType)
- sa.Add(pAnnot);
- }
- }
-
- if (sa.GetSize() > 0)
- {
- sa.Sort(CBA_AnnotIterator::CompareByTop, FALSE);
- }
-
- while (sa.GetSize() > 0)
- {
- int nLeftTopIndex = -1;
-
- {
- FX_FLOAT fLeft = -1.0f;
-
- for (int i=sa.GetSize()-1; i>=0; i--)
- {
- CPDFSDK_Annot* pAnnot = sa.GetAt(i);
- ASSERT(pAnnot != NULL);
-
- CPDF_Rect rcAnnot = GetAnnotRect(pAnnot);
-
- if (fLeft < 0)
- {
- nLeftTopIndex = 0;
- fLeft = rcAnnot.left;
- }
- else if (rcAnnot.left < fLeft)
- {
- nLeftTopIndex = i;
- fLeft = rcAnnot.left;
- }
- }
- }
-
- if (nLeftTopIndex >= 0)
- {
- CPDFSDK_Annot* pLeftTopAnnot = sa.GetAt(nLeftTopIndex);
- ASSERT(pLeftTopAnnot != NULL);
-
- CPDF_Rect rcLeftTop = GetAnnotRect(pLeftTopAnnot);
-
- m_Annots.Add(pLeftTopAnnot);
- sa.RemoveAt(nLeftTopIndex);
-
- CFX_ArrayTemplate<int> aSelect;
-
- {
- for (int i=0,sz=sa.GetSize(); i<sz; i++)
- {
- CPDFSDK_Annot* pAnnot = sa.GetAt(i);
- ASSERT(pAnnot != NULL);
-
- CPDF_Rect rcAnnot = GetAnnotRect(pAnnot);
-
- FX_FLOAT fCenterX = (rcAnnot.left + rcAnnot.right) / 2.0f;
-
- if (fCenterX > rcLeftTop.left && fCenterX < rcLeftTop.right)
- aSelect.Add(i);
- }
- }
-
- {
- for (int i=0,sz=aSelect.GetSize(); i<sz; i++)
- {
- m_Annots.Add(sa[aSelect[i]]);
- }
- }
-
- {
- for (int i=aSelect.GetSize()-1; i>=0; i--)
- {
- sa.RemoveAt(aSelect[i]);
- }
- }
-
- aSelect.RemoveAll();
- }
- }
- sa.RemoveAll();
- }
- break;
- }
-}
-
-CPDF_Rect CBA_AnnotIterator::GetAnnotRect(CPDFSDK_Annot* pAnnot)
-{
- ASSERT(pAnnot != NULL);
-
- CPDF_Annot* pPDFAnnot = pAnnot->GetPDFAnnot();
- ASSERT(pPDFAnnot != NULL);
-
- CPDF_Rect rcAnnot;
- pPDFAnnot->GetRect(rcAnnot);
-
- return rcAnnot;
-}
-
+// 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
+
+#include "../include/fsdk_define.h"
+#include "../include/fsdk_mgr.h"
+#include "../include/fsdk_baseannot.h"
+#include "../include/fsdk_baseform.h"
+#include "../include/formfiller/FFL_FormFiller.h"
+#include "../include/fsdk_actionhandler.h"
+
+#include "../include/javascript/IJavaScript.h"
+
+//------------------------------------------------------------------------------------
+//* CPDFSDK_Widget
+//------------------------------------------------------------------------------------
+
+#define IsFloatZero(f) ((f) < 0.01 && (f) > -0.01)
+#define IsFloatBigger(fa,fb) ((fa) > (fb) && !IsFloatZero((fa) - (fb)))
+#define IsFloatSmaller(fa,fb) ((fa) < (fb) && !IsFloatZero((fa) - (fb)))
+#define IsFloatEqual(fa,fb) IsFloatZero((fa)-(fb))
+
+CPDFSDK_Widget::CPDFSDK_Widget(CPDF_Annot* pAnnot, CPDFSDK_PageView* pPageView, CPDFSDK_InterForm* pInterForm) :
+ CPDFSDK_Annot(pAnnot, pPageView),
+ m_pInterForm(pInterForm),
+ m_nAppAge(0),
+ m_nValueAge(0)
+{
+ ASSERT(m_pInterForm != NULL);
+}
+
+CPDFSDK_Widget::~CPDFSDK_Widget()
+{
+
+}
+
+FX_BOOL CPDFSDK_Widget::IsWidgetAppearanceValid(CPDF_Annot::AppearanceMode mode)
+{
+ ASSERT(m_pAnnot != NULL);
+ ASSERT(m_pAnnot->m_pAnnotDict != NULL);
+
+ CPDF_Dictionary* pAP = m_pAnnot->m_pAnnotDict->GetDict("AP");
+ if (pAP == NULL) return FALSE;
+
+ // Choose the right sub-ap
+ const FX_CHAR* ap_entry = "N";
+ if (mode == CPDF_Annot::Down)
+ ap_entry = "D";
+ else if (mode == CPDF_Annot::Rollover)
+ ap_entry = "R";
+ if (!pAP->KeyExist(ap_entry))
+ ap_entry = "N";
+
+ // Get the AP stream or subdirectory
+ CPDF_Object* psub = pAP->GetElementValue(ap_entry);
+ if (psub == NULL) return FALSE;
+
+ int nFieldType = GetFieldType();
+ switch (nFieldType)
+ {
+ case FIELDTYPE_PUSHBUTTON:
+ case FIELDTYPE_COMBOBOX:
+ case FIELDTYPE_LISTBOX:
+ case FIELDTYPE_TEXTFIELD:
+ case FIELDTYPE_SIGNATURE:
+ return psub->GetType() == PDFOBJ_STREAM;
+ case FIELDTYPE_CHECKBOX:
+ case FIELDTYPE_RADIOBUTTON:
+ if (psub->GetType() == PDFOBJ_DICTIONARY)
+ {
+ CPDF_Dictionary* pSubDict = (CPDF_Dictionary*)psub;
+
+ return pSubDict->GetStream(this->GetAppState()) != NULL;
+ }
+ else
+ return FALSE;
+ break;
+ }
+
+ return TRUE;
+}
+
+int CPDFSDK_Widget::GetFieldType() const
+{
+ CPDF_FormField* pField = GetFormField();
+ ASSERT(pField != NULL);
+
+ return pField->GetFieldType();
+}
+
+int CPDFSDK_Widget::GetFieldFlags() const
+{
+ CPDF_InterForm* pPDFInterForm = m_pInterForm->GetInterForm();
+ ASSERT(pPDFInterForm != NULL);
+
+ CPDF_FormControl* pFormControl = pPDFInterForm->GetControlByDict(m_pAnnot->m_pAnnotDict);
+ CPDF_FormField* pFormField = pFormControl->GetField();
+ return pFormField->GetFieldFlags();
+}
+
+CFX_ByteString CPDFSDK_Widget::GetSubType() const
+{
+ int nType = GetFieldType();
+
+ if (nType == FIELDTYPE_SIGNATURE)
+ return BFFT_SIGNATURE;
+ return CPDFSDK_Annot::GetSubType();
+}
+
+CPDF_FormField* CPDFSDK_Widget::GetFormField() const
+{
+ ASSERT(m_pInterForm != NULL);
+
+ CPDF_FormControl* pCtrl = GetFormControl();
+ ASSERT(pCtrl != NULL);
+
+ return pCtrl->GetField();
+}
+
+CPDF_FormControl* CPDFSDK_Widget::GetFormControl() const
+{
+ ASSERT(m_pInterForm != NULL);
+
+ CPDF_InterForm* pPDFInterForm = m_pInterForm->GetInterForm();
+ ASSERT(pPDFInterForm != NULL);
+
+ return pPDFInterForm->GetControlByDict(GetAnnotDict());
+}
+static CPDF_Dictionary* BF_GetField(CPDF_Dictionary* pFieldDict, const FX_CHAR* name)
+{
+ if (pFieldDict == NULL) return NULL;
+ // First check the dictionary itself
+ CPDF_Object* pAttr = pFieldDict->GetElementValue(name);
+ if (pAttr) return pFieldDict;
+
+ // Now we need to search from parents
+ CPDF_Dictionary* pParent = pFieldDict->GetDict("Parent");
+ if (pParent == NULL) return NULL;
+
+ return BF_GetField(pParent, name);
+}
+
+CPDF_FormControl* CPDFSDK_Widget::GetFormControl(CPDF_InterForm* pInterForm, CPDF_Dictionary* pAnnotDict)
+{
+ ASSERT(pInterForm != NULL);
+ ASSERT(pAnnotDict != NULL);
+
+ CPDF_FormControl* pControl = pInterForm->GetControlByDict(pAnnotDict);
+
+ return pControl;
+}
+
+int CPDFSDK_Widget::GetRotate() const
+{
+ CPDF_FormControl* pCtrl = this->GetFormControl();
+ ASSERT(pCtrl != NULL);
+
+ return pCtrl->GetRotation() % 360;
+}
+
+FX_BOOL CPDFSDK_Widget::GetFillColor(FX_COLORREF& color) const
+{
+ CPDF_FormControl* pFormCtrl = GetFormControl();
+ ASSERT(pFormCtrl != NULL);
+
+ int iColorType = 0;
+ color = FX_ARGBTOCOLORREF(pFormCtrl->GetBackgroundColor(iColorType));
+
+ return iColorType != COLORTYPE_TRANSPARENT;
+}
+
+FX_BOOL CPDFSDK_Widget::GetBorderColor(FX_COLORREF& color) const
+{
+ CPDF_FormControl* pFormCtrl = GetFormControl();
+ ASSERT(pFormCtrl != NULL);
+
+ int iColorType = 0;
+ color = FX_ARGBTOCOLORREF(pFormCtrl->GetBorderColor(iColorType));
+
+ return iColorType != COLORTYPE_TRANSPARENT;
+}
+
+FX_BOOL CPDFSDK_Widget::GetTextColor(FX_COLORREF& color) const
+{
+ CPDF_FormControl* pFormCtrl = GetFormControl();
+ ASSERT(pFormCtrl != NULL);
+
+ CPDF_DefaultAppearance da = pFormCtrl->GetDefaultAppearance();
+ if (da.HasColor())
+ {
+ FX_ARGB argb;
+ int iColorType = COLORTYPE_TRANSPARENT;
+ da.GetColor(argb, iColorType);
+ color = FX_ARGBTOCOLORREF(argb);
+
+ return iColorType != COLORTYPE_TRANSPARENT;
+ }
+
+ return FALSE;
+}
+
+FX_FLOAT CPDFSDK_Widget::GetFontSize() const
+{
+ CPDF_FormControl* pFormCtrl = GetFormControl();
+ ASSERT(pFormCtrl != NULL);
+
+ CPDF_DefaultAppearance pDa = pFormCtrl->GetDefaultAppearance();
+ CFX_ByteString csFont = "";
+ FX_FLOAT fFontSize = 0.0f;
+ pDa.GetFont(csFont, fFontSize);
+
+ return fFontSize;
+}
+
+int CPDFSDK_Widget::GetSelectedIndex(int nIndex) const
+{
+ CPDF_FormField* pFormField = GetFormField();
+ ASSERT(pFormField != NULL);
+
+ return pFormField->GetSelectedIndex(nIndex);
+}
+
+CFX_WideString CPDFSDK_Widget::GetValue() const
+{
+ CPDF_FormField* pFormField = GetFormField();
+ ASSERT(pFormField != NULL);
+
+ return pFormField->GetValue();
+}
+
+CFX_WideString CPDFSDK_Widget::GetDefaultValue() const
+{
+ CPDF_FormField* pFormField = GetFormField();
+ ASSERT(pFormField != NULL);
+
+ return pFormField->GetDefaultValue();
+}
+
+CFX_WideString CPDFSDK_Widget::GetOptionLabel(int nIndex) const
+{
+ CPDF_FormField* pFormField = GetFormField();
+ ASSERT(pFormField != NULL);
+
+ return pFormField->GetOptionLabel(nIndex);
+}
+
+int CPDFSDK_Widget::CountOptions() const
+{
+ CPDF_FormField* pFormField = GetFormField();
+ ASSERT(pFormField != NULL);
+
+ return pFormField->CountOptions();
+}
+
+FX_BOOL CPDFSDK_Widget::IsOptionSelected(int nIndex) const
+{
+ CPDF_FormField* pFormField = GetFormField();
+ ASSERT(pFormField != NULL);
+
+ return pFormField->IsItemSelected(nIndex);
+}
+
+int CPDFSDK_Widget::GetTopVisibleIndex() const
+{
+ CPDF_FormField* pFormField = GetFormField();
+ ASSERT(pFormField != NULL);
+
+ return pFormField->GetTopVisibleIndex();
+}
+
+FX_BOOL CPDFSDK_Widget::IsChecked() const
+{
+ CPDF_FormControl* pFormCtrl = GetFormControl();
+ ASSERT(pFormCtrl != NULL);
+
+ return pFormCtrl->IsChecked();
+}
+
+int CPDFSDK_Widget::GetAlignment() const
+{
+ CPDF_FormControl* pFormCtrl = GetFormControl();
+ ASSERT(pFormCtrl != NULL);
+
+ return pFormCtrl->GetControlAlignment();
+}
+
+int CPDFSDK_Widget::GetMaxLen() const
+{
+ CPDF_FormField* pFormField = GetFormField();
+ ASSERT(pFormField != NULL);
+
+ return pFormField->GetMaxLen();
+}
+
+void CPDFSDK_Widget::SetCheck(FX_BOOL bChecked, FX_BOOL bNotify)
+{
+ CPDF_FormControl* pFormCtrl = GetFormControl();
+ ASSERT(pFormCtrl != NULL);
+
+ CPDF_FormField* pFormField = pFormCtrl->GetField();
+ ASSERT(pFormField != NULL);
+
+ pFormField->CheckControl(pFormField->GetControlIndex(pFormCtrl), bChecked, bNotify);
+}
+
+void CPDFSDK_Widget::SetValue(const CFX_WideString& sValue, FX_BOOL bNotify)
+{
+ CPDF_FormField* pFormField = GetFormField();
+ ASSERT(pFormField != NULL);
+
+ pFormField->SetValue(sValue, bNotify);
+}
+
+void CPDFSDK_Widget::SetDefaultValue(const CFX_WideString& sValue)
+{
+}
+void CPDFSDK_Widget::SetOptionSelection(int index, FX_BOOL bSelected, FX_BOOL bNotify)
+{
+ CPDF_FormField* pFormField = GetFormField();
+ ASSERT(pFormField != NULL);
+
+ pFormField->SetItemSelection(index, bSelected, bNotify);
+}
+
+void CPDFSDK_Widget::ClearSelection(FX_BOOL bNotify)
+{
+ CPDF_FormField* pFormField = GetFormField();
+ ASSERT(pFormField != NULL);
+
+ pFormField->ClearSelection(bNotify);
+}
+
+void CPDFSDK_Widget::SetTopVisibleIndex(int index)
+{
+}
+
+void CPDFSDK_Widget::SetAppModified()
+{
+ m_bAppModified = TRUE;
+}
+
+void CPDFSDK_Widget::ClearAppModified()
+{
+ m_bAppModified = FALSE;
+}
+
+FX_BOOL CPDFSDK_Widget::IsAppModified() const
+{
+ return m_bAppModified;
+}
+
+void CPDFSDK_Widget::ResetAppearance(FX_LPCWSTR sValue, FX_BOOL bValueChanged)
+{
+ SetAppModified();
+
+ m_nAppAge++;
+ if (m_nAppAge > 999999)
+ m_nAppAge = 0;
+ if (bValueChanged)
+ m_nValueAge++;
+
+ int nFieldType = GetFieldType();
+
+ switch (nFieldType)
+ {
+ case FIELDTYPE_PUSHBUTTON:
+ ResetAppearance_PushButton();
+ break;
+ case FIELDTYPE_CHECKBOX:
+ ResetAppearance_CheckBox();
+ break;
+ case FIELDTYPE_RADIOBUTTON:
+ ResetAppearance_RadioButton();
+ break;
+ case FIELDTYPE_COMBOBOX:
+ ResetAppearance_ComboBox(sValue);
+ break;
+ case FIELDTYPE_LISTBOX:
+ ResetAppearance_ListBox();
+ break;
+ case FIELDTYPE_TEXTFIELD:
+ ResetAppearance_TextField(sValue);
+ break;
+ }
+
+ ASSERT(m_pAnnot != NULL);
+ m_pAnnot->ClearCachedAP();
+}
+
+CFX_WideString CPDFSDK_Widget::OnFormat(int nCommitKey, FX_BOOL& bFormated)
+{
+ CPDF_FormField* pFormField = GetFormField();
+ ASSERT(pFormField != NULL);
+
+ ASSERT(m_pInterForm != NULL);
+
+ return m_pInterForm->OnFormat(pFormField, nCommitKey, bFormated);
+
+}
+
+void CPDFSDK_Widget::ResetFieldAppearance(FX_BOOL bValueChanged)
+{
+ CPDF_FormField* pFormField = GetFormField();
+ ASSERT(pFormField != NULL);
+
+ ASSERT(m_pInterForm != NULL);
+
+ m_pInterForm->ResetFieldAppearance(pFormField, NULL, bValueChanged);
+}
+
+void CPDFSDK_Widget::DrawAppearance(CFX_RenderDevice* pDevice, const CPDF_Matrix* pUser2Device,
+ CPDF_Annot::AppearanceMode mode, const CPDF_RenderOptions* pOptions)
+{
+ int nFieldType = GetFieldType();
+
+ if ((nFieldType == FIELDTYPE_CHECKBOX || nFieldType == FIELDTYPE_RADIOBUTTON) &&
+ mode == CPDF_Annot::Normal &&
+ !this->IsWidgetAppearanceValid(CPDF_Annot::Normal))
+ {
+ CFX_PathData pathData;
+
+ CPDF_Rect rcAnnot = this->GetRect();
+
+ pathData.AppendRect(rcAnnot.left, rcAnnot.bottom,
+ rcAnnot.right, rcAnnot.top);
+
+ CFX_GraphStateData gsd;
+ gsd.m_LineWidth = 0.0f;
+
+ pDevice->DrawPath(&pathData, pUser2Device, &gsd, 0, 0xFFAAAAAA, FXFILL_ALTERNATE);
+ }
+ else
+ {
+ CPDFSDK_Annot::DrawAppearance(pDevice, pUser2Device, mode, pOptions);
+ }
+}
+
+void CPDFSDK_Widget::UpdateField()
+{
+ CPDF_FormField* pFormField = GetFormField();
+ ASSERT(pFormField != NULL);
+
+ ASSERT(m_pInterForm != NULL);
+ m_pInterForm->UpdateField(pFormField);
+}
+
+void CPDFSDK_Widget::DrawShadow(CFX_RenderDevice* pDevice, CPDFSDK_PageView* pPageView)
+{
+ ASSERT(m_pInterForm != NULL);
+
+ int nFieldType = GetFieldType();
+ if (m_pInterForm->IsNeedHighLight(nFieldType))
+ {
+
+// if (nFieldType != FIELDTYPE_PUSHBUTTON)
+// {
+ CPDF_Rect rc = GetRect();
+ FX_COLORREF color = m_pInterForm->GetHighlightColor(nFieldType);
+ FX_BYTE alpha = m_pInterForm->GetHighlightAlpha();
+
+ CFX_FloatRect rcDevice;
+ ASSERT(m_pInterForm->GetDocument());
+ CPDFDoc_Environment* pEnv = m_pInterForm->GetDocument()->GetEnv();
+ if(!pEnv)
+ return;
+ CFX_AffineMatrix page2device;
+ pPageView->GetCurrentMatrix(page2device);
+ page2device.Transform(((FX_FLOAT)rc.left), ((FX_FLOAT)rc.bottom), rcDevice.left, rcDevice.bottom);
+// pEnv->FFI_PageToDevice(m_pPageView->GetPDFPage(), rc.left, rc.bottom, &rcDevice.left, &rcDevice.bottom);
+// pEnv->FFI_PageToDevice(m_pPageView->GetPDFPage(), rc.right, rc.top, &rcDevice.right, &rcDevice.top);
+ page2device.Transform(((FX_FLOAT)rc.right), ((FX_FLOAT)rc.top), rcDevice.right, rcDevice.top);
+
+ rcDevice.Normalize();
+
+ FX_ARGB argb = ArgbEncode((int)alpha, color);
+ FX_RECT rcDev((int)rcDevice.left,(int)rcDevice.top,(int)rcDevice.right,(int)rcDevice.bottom);
+ pDevice->FillRect(&rcDev, argb);
+ /* }*/
+ }
+}
+
+void CPDFSDK_Widget::ResetAppearance_PushButton()
+{
+ CPDF_FormControl* pControl = GetFormControl();
+ ASSERT(pControl != NULL);
+
+
+
+ CPDF_Rect rcWindow = GetRotatedRect();
+
+ FX_INT32 nLayout = 0;
+
+ switch (pControl->GetTextPosition())
+ {
+ case TEXTPOS_ICON:
+ nLayout = PPBL_ICON;
+ break;
+ case TEXTPOS_BELOW:
+ nLayout = PPBL_ICONTOPLABELBOTTOM;
+ break;
+ case TEXTPOS_ABOVE:
+ nLayout = PPBL_LABELTOPICONBOTTOM;
+ break;
+ case TEXTPOS_RIGHT:
+ nLayout = PPBL_ICONLEFTLABELRIGHT;
+ break;
+ case TEXTPOS_LEFT:
+ nLayout = PPBL_LABELLEFTICONRIGHT;
+ break;
+ case TEXTPOS_OVERLAID:
+ nLayout = PPBL_LABELOVERICON;
+ break;
+ default:
+ nLayout = PPBL_LABEL;
+ break;
+ }
+
+ CPWL_Color crBackground, crBorder;
+
+ int iColorType;
+ FX_FLOAT fc[4];
+
+ pControl->GetOriginalBackgroundColor(iColorType, fc);
+ if (iColorType > 0)
+ crBackground = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]);
+
+ pControl->GetOriginalBorderColor(iColorType, fc);
+ if (iColorType > 0)
+ crBorder = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]);
+
+ FX_FLOAT fBorderWidth = (FX_FLOAT)GetBorderWidth();
+ FX_INT32 nBorderStyle = 0;
+ CPWL_Dash dsBorder(3,0,0);
+ CPWL_Color crLeftTop,crRightBottom;
+
+ switch (GetBorderStyle())
+ {
+ case BBS_DASH:
+ nBorderStyle = PBS_DASH;
+ dsBorder = CPWL_Dash(3, 3, 0);
+ break;
+ case BBS_BEVELED:
+ nBorderStyle = PBS_BEVELED;
+ fBorderWidth *= 2;
+ crLeftTop = CPWL_Color(COLORTYPE_GRAY,1);
+ crRightBottom = CPWL_Utils::DevideColor(crBackground,2);
+ break;
+ case BBS_INSET:
+ nBorderStyle = PBS_INSET;
+ fBorderWidth *= 2;
+ crLeftTop = CPWL_Color(COLORTYPE_GRAY,0.5);
+ crRightBottom = CPWL_Color(COLORTYPE_GRAY,0.75);
+ break;
+ case BBS_UNDERLINE:
+ nBorderStyle = PBS_UNDERLINED;
+ break;
+ default:
+ nBorderStyle = PBS_SOLID;
+ break;
+ }
+
+ CPDF_Rect rcClient = CPWL_Utils::DeflateRect(rcWindow,fBorderWidth);
+
+ CPWL_Color crText(COLORTYPE_GRAY,0);
+
+ FX_FLOAT fFontSize = 12.0f;
+ CFX_ByteString csNameTag;
+
+ CPDF_DefaultAppearance da = pControl->GetDefaultAppearance();
+ if (da.HasColor())
+ {
+ da.GetColor(iColorType, fc);
+ crText = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]);
+ }
+
+ if (da.HasFont())
+ da.GetFont(csNameTag, fFontSize);
+
+ CFX_WideString csWCaption;
+ CFX_WideString csNormalCaption, csRolloverCaption, csDownCaption;
+
+ if (pControl->HasMKEntry("CA"))
+ {
+ csNormalCaption = pControl->GetNormalCaption();
+ }
+ if (pControl->HasMKEntry("RC"))
+ {
+ csRolloverCaption = pControl->GetRolloverCaption();
+ }
+ if (pControl->HasMKEntry("AC"))
+ {
+ csDownCaption = pControl->GetDownCaption();
+ }
+
+ CPDF_Stream* pNormalIcon = NULL;
+ CPDF_Stream* pRolloverIcon = NULL;
+ CPDF_Stream* pDownIcon = NULL;
+
+ if (pControl->HasMKEntry("I"))
+ {
+ pNormalIcon = pControl->GetNormalIcon();
+ }
+ if (pControl->HasMKEntry("RI"))
+ {
+ pRolloverIcon = pControl->GetRolloverIcon();
+ }
+ if (pControl->HasMKEntry("IX"))
+ {
+ pDownIcon = pControl->GetDownIcon();
+ }
+
+ if (pNormalIcon)
+ {
+ if (CPDF_Dictionary* pImageDict = pNormalIcon->GetDict())
+ {
+ if (pImageDict->GetString("Name").IsEmpty())
+ pImageDict->SetAtString("Name", "ImgA");
+ }
+ }
+
+ if (pRolloverIcon)
+ {
+ if (CPDF_Dictionary* pImageDict = pRolloverIcon->GetDict())
+ {
+ if (pImageDict->GetString("Name").IsEmpty())
+ pImageDict->SetAtString("Name", "ImgB");
+ }
+ }
+
+ if (pDownIcon)
+ {
+ if (CPDF_Dictionary* pImageDict = pDownIcon->GetDict())
+ {
+ if (pImageDict->GetString("Name").IsEmpty())
+ pImageDict->SetAtString("Name", "ImgC");
+ }
+ }
+
+ CPDF_IconFit iconFit = pControl->GetIconFit();
+
+// ASSERT(this->m_pBaseForm != NULL);
+ ASSERT(this->m_pInterForm != NULL);
+ CPDFSDK_Document* pDoc = m_pInterForm->GetDocument();
+ ASSERT(pDoc != NULL);
+ CPDFDoc_Environment* pEnv = pDoc->GetEnv();
+
+ CBA_FontMap FontMap(this,pEnv->GetSysHandler());//, ISystemHandle::GetSystemHandler(m_pBaseForm->GetEnv()));
+ FontMap.Initial();
+
+ FontMap.SetAPType("N");
+
+ CFX_ByteString csAP = CPWL_Utils::GetRectFillAppStream(rcWindow, crBackground) +
+ CPWL_Utils::GetBorderAppStream(rcWindow, fBorderWidth, crBorder, crLeftTop, crRightBottom, nBorderStyle, dsBorder) +
+ CPWL_Utils::GetPushButtonAppStream(iconFit.GetFittingBounds() ? rcWindow : rcClient, &FontMap, pNormalIcon, iconFit, csNormalCaption, crText, fFontSize, nLayout);
+
+ WriteAppearance("N", GetRotatedRect(), GetMatrix(), csAP);
+ if (pNormalIcon)
+ AddImageToAppearance("N", pNormalIcon);
+
+ CPDF_FormControl::HighlightingMode eHLM = pControl->GetHighlightingMode();
+ if (eHLM == CPDF_FormControl::Push || eHLM == CPDF_FormControl::Toggle)
+ {
+ if (csRolloverCaption.IsEmpty() && !pRolloverIcon)
+ {
+ csRolloverCaption = csNormalCaption;
+ pRolloverIcon = pNormalIcon;
+ }
+
+ FontMap.SetAPType("R");
+
+ csAP = CPWL_Utils::GetRectFillAppStream(rcWindow, crBackground) +
+ CPWL_Utils::GetBorderAppStream(rcWindow, fBorderWidth, crBorder, crLeftTop, crRightBottom, nBorderStyle, dsBorder) +
+ CPWL_Utils::GetPushButtonAppStream(iconFit.GetFittingBounds() ? rcWindow : rcClient, &FontMap, pRolloverIcon, iconFit, csRolloverCaption, crText, fFontSize, nLayout);
+
+ WriteAppearance("R", GetRotatedRect(), GetMatrix(), csAP);
+ if (pRolloverIcon)
+ AddImageToAppearance("R", pRolloverIcon);
+
+ if (csDownCaption.IsEmpty() && !pDownIcon)
+ {
+ csDownCaption = csNormalCaption;
+ pDownIcon = pNormalIcon;
+ }
+
+ switch (nBorderStyle)
+ {
+ case PBS_BEVELED:
+ {
+ CPWL_Color crTemp = crLeftTop;
+ crLeftTop = crRightBottom;
+ crRightBottom = crTemp;
+ }
+ break;
+ case PBS_INSET:
+ crLeftTop = CPWL_Color(COLORTYPE_GRAY,0);
+ crRightBottom = CPWL_Color(COLORTYPE_GRAY,1);
+ break;
+ }
+
+ FontMap.SetAPType("D");
+
+ csAP = CPWL_Utils::GetRectFillAppStream(rcWindow, CPWL_Utils::SubstractColor(crBackground,0.25f)) +
+ CPWL_Utils::GetBorderAppStream(rcWindow, fBorderWidth, crBorder, crLeftTop, crRightBottom, nBorderStyle, dsBorder) +
+ CPWL_Utils::GetPushButtonAppStream(iconFit.GetFittingBounds() ? rcWindow : rcClient, &FontMap, pDownIcon, iconFit, csDownCaption, crText, fFontSize, nLayout);
+
+ WriteAppearance("D", GetRotatedRect(), GetMatrix(), csAP);
+ if (pDownIcon)
+ AddImageToAppearance("D", pDownIcon);
+ }
+ else
+ {
+ RemoveAppearance("D");
+ RemoveAppearance("R");
+ }
+}
+
+void CPDFSDK_Widget::ResetAppearance_CheckBox()
+{
+ CPDF_FormControl* pControl = GetFormControl();
+ ASSERT(pControl != NULL);
+
+
+
+ CPWL_Color crBackground, crBorder, crText;
+
+ int iColorType;
+ FX_FLOAT fc[4];
+
+ pControl->GetOriginalBackgroundColor(iColorType, fc);
+ if (iColorType > 0)
+ crBackground = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]);
+
+ pControl->GetOriginalBorderColor(iColorType, fc);
+ if (iColorType > 0)
+ crBorder = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]);
+
+ FX_FLOAT fBorderWidth = (FX_FLOAT)GetBorderWidth();
+ FX_INT32 nBorderStyle = 0;
+ CPWL_Dash dsBorder(3,0,0);
+ CPWL_Color crLeftTop,crRightBottom;
+
+ switch (GetBorderStyle())
+ {
+ case BBS_DASH:
+ nBorderStyle = PBS_DASH;
+ dsBorder = CPWL_Dash(3, 3, 0);
+ break;
+ case BBS_BEVELED:
+ nBorderStyle = PBS_BEVELED;
+ fBorderWidth *= 2;
+ crLeftTop = CPWL_Color(COLORTYPE_GRAY,1);
+ crRightBottom = CPWL_Utils::DevideColor(crBackground,2);
+ break;
+ case BBS_INSET:
+ nBorderStyle = PBS_INSET;
+ fBorderWidth *= 2;
+ crLeftTop = CPWL_Color(COLORTYPE_GRAY,0.5);
+ crRightBottom = CPWL_Color(COLORTYPE_GRAY,0.75);
+ break;
+ case BBS_UNDERLINE:
+ nBorderStyle = PBS_UNDERLINED;
+ break;
+ default:
+ nBorderStyle = PBS_SOLID;
+ break;
+ }
+
+ CPDF_Rect rcWindow = GetRotatedRect();
+ CPDF_Rect rcClient = CPWL_Utils::DeflateRect(rcWindow,fBorderWidth);
+
+ CPDF_DefaultAppearance da = pControl->GetDefaultAppearance();
+ if (da.HasColor())
+ {
+ da.GetColor(iColorType, fc);
+ crText = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]);
+ }
+
+ FX_INT32 nStyle = 0;
+
+ CFX_WideString csWCaption = pControl->GetNormalCaption();
+ if (csWCaption.GetLength() > 0)
+ {
+ switch (csWCaption[0])
+ {
+ case L'l':
+ nStyle = PCS_CIRCLE;
+ break;
+ case L'8':
+ nStyle = PCS_CROSS;
+ break;
+ case L'u':
+ nStyle = PCS_DIAMOND;
+ break;
+ case L'n':
+ nStyle = PCS_SQUARE;
+ break;
+ case L'H':
+ nStyle = PCS_STAR;
+ break;
+ default: //L'4'
+ nStyle = PCS_CHECK;
+ break;
+ }
+ }
+ else
+ {
+ nStyle = PCS_CHECK;
+ }
+
+ CFX_ByteString csAP_N_ON = CPWL_Utils::GetRectFillAppStream(rcWindow,crBackground) +
+ CPWL_Utils::GetBorderAppStream(rcWindow,fBorderWidth,crBorder,crLeftTop,crRightBottom,nBorderStyle,dsBorder);
+
+ CFX_ByteString csAP_N_OFF = csAP_N_ON;
+
+ switch (nBorderStyle)
+ {
+ case PBS_BEVELED:
+ {
+ CPWL_Color crTemp = crLeftTop;
+ crLeftTop = crRightBottom;
+ crRightBottom = crTemp;
+ }
+ break;
+ case PBS_INSET:
+ crLeftTop = CPWL_Color(COLORTYPE_GRAY,0);
+ crRightBottom = CPWL_Color(COLORTYPE_GRAY,1);
+ break;
+ }
+
+ CFX_ByteString csAP_D_ON = CPWL_Utils::GetRectFillAppStream(rcWindow,CPWL_Utils::SubstractColor(crBackground,0.25f)) +
+ CPWL_Utils::GetBorderAppStream(rcWindow,fBorderWidth,crBorder,crLeftTop,crRightBottom,nBorderStyle,dsBorder);
+
+ CFX_ByteString csAP_D_OFF = csAP_D_ON;
+
+ csAP_N_ON += CPWL_Utils::GetCheckBoxAppStream(rcClient,nStyle,crText);
+ csAP_D_ON += CPWL_Utils::GetCheckBoxAppStream(rcClient,nStyle,crText);
+
+ WriteAppearance("N", GetRotatedRect(), GetMatrix(), csAP_N_ON, pControl->GetCheckedAPState());
+ WriteAppearance("N", GetRotatedRect(), GetMatrix(), csAP_N_OFF, "Off");
+
+ WriteAppearance("D", GetRotatedRect(), GetMatrix(), csAP_D_ON, pControl->GetCheckedAPState());
+ WriteAppearance("D", GetRotatedRect(), GetMatrix(), csAP_D_OFF, "Off");
+
+ CFX_ByteString csAS = GetAppState();
+ if (csAS.IsEmpty())
+ SetAppState("Off");
+}
+
+void CPDFSDK_Widget::ResetAppearance_RadioButton()
+{
+ CPDF_FormControl* pControl = GetFormControl();
+ ASSERT(pControl != NULL);
+
+
+
+ CPWL_Color crBackground, crBorder, crText;
+
+ int iColorType;
+ FX_FLOAT fc[4];
+
+ pControl->GetOriginalBackgroundColor(iColorType, fc);
+ if (iColorType > 0)
+ crBackground = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]);
+
+ pControl->GetOriginalBorderColor(iColorType, fc);
+ if (iColorType > 0)
+ crBorder = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]);
+
+ FX_FLOAT fBorderWidth = (FX_FLOAT)GetBorderWidth();
+ FX_INT32 nBorderStyle = 0;
+ CPWL_Dash dsBorder(3,0,0);
+ CPWL_Color crLeftTop,crRightBottom;
+
+ switch (GetBorderStyle())
+ {
+ case BBS_DASH:
+ nBorderStyle = PBS_DASH;
+ dsBorder = CPWL_Dash(3, 3, 0);
+ break;
+ case BBS_BEVELED:
+ nBorderStyle = PBS_BEVELED;
+ fBorderWidth *= 2;
+ crLeftTop = CPWL_Color(COLORTYPE_GRAY,1);
+ crRightBottom = CPWL_Utils::DevideColor(crBackground,2);
+ break;
+ case BBS_INSET:
+ nBorderStyle = PBS_INSET;
+ fBorderWidth *= 2;
+ crLeftTop = CPWL_Color(COLORTYPE_GRAY,0.5);
+ crRightBottom = CPWL_Color(COLORTYPE_GRAY,0.75);
+ break;
+ case BBS_UNDERLINE:
+ nBorderStyle = PBS_UNDERLINED;
+ break;
+ default:
+ nBorderStyle = PBS_SOLID;
+ break;
+ }
+
+ CPDF_Rect rcWindow = GetRotatedRect();
+ CPDF_Rect rcClient = CPWL_Utils::DeflateRect(rcWindow, fBorderWidth);
+
+ CPDF_DefaultAppearance da = pControl->GetDefaultAppearance();
+ if (da.HasColor())
+ {
+ da.GetColor(iColorType, fc);
+ crText = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]);
+ }
+
+ FX_INT32 nStyle = 0;
+
+ CFX_WideString csWCaption = pControl->GetNormalCaption();
+ if (csWCaption.GetLength() > 0)
+ {
+ switch (csWCaption[0])
+ {
+ default: //L'l':
+ nStyle = PCS_CIRCLE;
+ break;
+ case L'8':
+ nStyle = PCS_CROSS;
+ break;
+ case L'u':
+ nStyle = PCS_DIAMOND;
+ break;
+ case L'n':
+ nStyle = PCS_SQUARE;
+ break;
+ case L'H':
+ nStyle = PCS_STAR;
+ break;
+ case L'4':
+ nStyle = PCS_CHECK;
+ break;
+ }
+ }
+ else
+ {
+ nStyle = PCS_CIRCLE;
+ }
+
+ CFX_ByteString csAP_N_ON;
+
+ CPDF_Rect rcCenter = CPWL_Utils::DeflateRect(CPWL_Utils::GetCenterSquare(rcWindow), 1.0f);
+
+ if (nStyle == PCS_CIRCLE)
+ {
+ if (nBorderStyle == PBS_BEVELED)
+ {
+ crLeftTop = CPWL_Color(COLORTYPE_GRAY, 1);
+ crRightBottom = CPWL_Utils::SubstractColor(crBackground,0.25f);
+ }
+ else if (nBorderStyle == PBS_INSET)
+ {
+ crLeftTop = CPWL_Color(COLORTYPE_GRAY,0.5f);
+ crRightBottom = CPWL_Color(COLORTYPE_GRAY,0.75f);
+ }
+
+ csAP_N_ON = CPWL_Utils::GetCircleFillAppStream(rcCenter,crBackground) +
+ CPWL_Utils::GetCircleBorderAppStream(rcCenter,fBorderWidth,crBorder,crLeftTop,crRightBottom,nBorderStyle,dsBorder);
+ }
+ else
+ {
+ csAP_N_ON = CPWL_Utils::GetRectFillAppStream(rcWindow,crBackground) +
+ CPWL_Utils::GetBorderAppStream(rcWindow,fBorderWidth,crBorder,crLeftTop,crRightBottom,nBorderStyle,dsBorder);
+ }
+
+ CFX_ByteString csAP_N_OFF = csAP_N_ON;
+
+ switch (nBorderStyle)
+ {
+ case PBS_BEVELED:
+ {
+ CPWL_Color crTemp = crLeftTop;
+ crLeftTop = crRightBottom;
+ crRightBottom = crTemp;
+ }
+ break;
+ case PBS_INSET:
+ crLeftTop = CPWL_Color(COLORTYPE_GRAY,0);
+ crRightBottom = CPWL_Color(COLORTYPE_GRAY,1);
+ break;
+ }
+
+ CFX_ByteString csAP_D_ON;
+
+ if (nStyle == PCS_CIRCLE)
+ {
+ CPWL_Color crBK = CPWL_Utils::SubstractColor(crBackground,0.25f);
+ if (nBorderStyle == PBS_BEVELED)
+ {
+ crLeftTop = CPWL_Utils::SubstractColor(crBackground,0.25f);
+ crRightBottom = CPWL_Color(COLORTYPE_GRAY, 1);
+ crBK = crBackground;
+ }
+ else if (nBorderStyle == PBS_INSET)
+ {
+ crLeftTop = CPWL_Color(COLORTYPE_GRAY,0);
+ crRightBottom = CPWL_Color(COLORTYPE_GRAY,1);
+ }
+
+ csAP_D_ON = CPWL_Utils::GetCircleFillAppStream(rcCenter,crBK)
+ + CPWL_Utils::GetCircleBorderAppStream(rcCenter,fBorderWidth,crBorder,crLeftTop,crRightBottom,nBorderStyle,dsBorder);
+ }
+ else
+ {
+ csAP_D_ON = CPWL_Utils::GetRectFillAppStream(rcWindow,CPWL_Utils::SubstractColor(crBackground,0.25f)) +
+ CPWL_Utils::GetBorderAppStream(rcWindow,fBorderWidth,crBorder,crLeftTop,crRightBottom,nBorderStyle,dsBorder);
+ }
+
+ CFX_ByteString csAP_D_OFF = csAP_D_ON;
+
+ csAP_N_ON += CPWL_Utils::GetRadioButtonAppStream(rcClient,nStyle,crText);
+ csAP_D_ON += CPWL_Utils::GetRadioButtonAppStream(rcClient,nStyle,crText);
+
+ WriteAppearance("N", GetRotatedRect(), GetMatrix(), csAP_N_ON, pControl->GetCheckedAPState());
+ WriteAppearance("N", GetRotatedRect(), GetMatrix(), csAP_N_OFF, "Off");
+
+ WriteAppearance("D", GetRotatedRect(), GetMatrix(), csAP_D_ON, pControl->GetCheckedAPState());
+ WriteAppearance("D", GetRotatedRect(), GetMatrix(), csAP_D_OFF, "Off");
+
+ CFX_ByteString csAS = GetAppState();
+ if (csAS.IsEmpty())
+ SetAppState("Off");
+}
+
+void CPDFSDK_Widget::ResetAppearance_ComboBox(FX_LPCWSTR sValue)
+{
+ CPDF_FormControl* pControl = GetFormControl();
+ ASSERT(pControl != NULL);
+ CPDF_FormField* pField = pControl->GetField();
+ ASSERT(pField != NULL);
+
+ CFX_ByteTextBuf sBody, sLines;
+
+ CPDF_Rect rcClient = GetClientRect();
+ CPDF_Rect rcButton = rcClient;
+ rcButton.left = rcButton.right - 13;
+ rcButton.Normalize();
+
+ if (IFX_Edit * pEdit = IFX_Edit::NewEdit())
+ {
+ pEdit->EnableRefresh(FALSE);
+
+ ASSERT(this->m_pInterForm != NULL);
+ CPDFSDK_Document* pDoc = m_pInterForm->GetDocument();
+ ASSERT(pDoc != NULL);
+ CPDFDoc_Environment* pEnv = pDoc->GetEnv();
+ CBA_FontMap FontMap(this,pEnv->GetSysHandler());
+ FontMap.Initial();
+ pEdit->SetFontMap(&FontMap);
+
+ CPDF_Rect rcEdit = rcClient;
+ rcEdit.right = rcButton.left;
+ rcEdit.Normalize();
+
+ pEdit->SetPlateRect(rcEdit);
+ pEdit->SetAlignmentV(1);
+
+ FX_FLOAT fFontSize = this->GetFontSize();
+ if (IsFloatZero(fFontSize))
+ pEdit->SetAutoFontSize(TRUE);
+ else
+ pEdit->SetFontSize(fFontSize);
+
+ pEdit->Initialize();
+
+ if (sValue)
+ pEdit->SetText(sValue);
+ else
+ {
+ FX_INT32 nCurSel = pField->GetSelectedIndex(0);
+
+ if (nCurSel < 0)
+ pEdit->SetText((FX_LPCWSTR)pField->GetValue());
+ else
+ pEdit->SetText((FX_LPCWSTR)pField->GetOptionLabel(nCurSel));
+ }
+
+ CPDF_Rect rcContent = pEdit->GetContentRect();
+
+ CFX_ByteString sEdit = CPWL_Utils::GetEditAppStream(pEdit,CPDF_Point(0.0f,0.0f));
+ if (sEdit.GetLength() > 0)
+ {
+ sBody << "/Tx BMC\n" << "q\n";
+ if (rcContent.Width() > rcEdit.Width() ||
+ rcContent.Height() > rcEdit.Height())
+ {
+ sBody << rcEdit.left << " " << rcEdit.bottom << " "
+ << rcEdit.Width() << " " << rcEdit.Height() << " re\nW\nn\n";
+ }
+
+ CPWL_Color crText = GetTextPWLColor();
+ sBody << "BT\n" << CPWL_Utils::GetColorAppStream(crText) << sEdit << "ET\n" << "Q\nEMC\n";
+ }
+
+ IFX_Edit::DelEdit(pEdit);
+ }
+
+ sBody << CPWL_Utils::GetDropButtonAppStream(rcButton);
+
+ CFX_ByteString sAP = GetBackgroundAppStream() + GetBorderAppStream() + sLines.GetByteString() + sBody.GetByteString();
+
+ WriteAppearance("N", GetRotatedRect(), GetMatrix(), sAP);
+}
+
+void CPDFSDK_Widget::ResetAppearance_ListBox()
+{
+ CPDF_FormControl* pControl = GetFormControl();
+ ASSERT(pControl != NULL);
+ CPDF_FormField* pField = pControl->GetField();
+ ASSERT(pField != NULL);
+
+ CPDF_Rect rcClient = GetClientRect();
+
+ CFX_ByteTextBuf sBody, sLines;
+
+ if (IFX_Edit * pEdit = IFX_Edit::NewEdit())
+ {
+ pEdit->EnableRefresh(FALSE);
+
+// ASSERT(this->m_pBaseForm != NULL);
+ ASSERT(this->m_pInterForm != NULL);
+ CPDFSDK_Document* pDoc = m_pInterForm->GetDocument();
+ ASSERT(pDoc != NULL);
+ CPDFDoc_Environment* pEnv = pDoc->GetEnv();
+
+ CBA_FontMap FontMap(this,pEnv->GetSysHandler());
+ FontMap.Initial();
+ pEdit->SetFontMap(&FontMap);
+
+ pEdit->SetPlateRect(CPDF_Rect(rcClient.left,0.0f,rcClient.right,0.0f));
+
+ FX_FLOAT fFontSize = GetFontSize();
+
+ if (IsFloatZero(fFontSize))
+ pEdit->SetFontSize(12.0f);
+ else
+ pEdit->SetFontSize(fFontSize);
+
+ pEdit->Initialize();
+
+ CFX_ByteTextBuf sList;
+ FX_FLOAT fy = rcClient.top;
+
+ FX_INT32 nTop = pField->GetTopVisibleIndex();
+ FX_INT32 nCount = pField->CountOptions();
+ FX_INT32 nSelCount = pField->CountSelectedItems();
+
+ for (FX_INT32 i=nTop; i<nCount; i++)
+ {
+ FX_BOOL bSelected = FALSE;
+ for (FX_INT32 j=0; j<nSelCount; j++)
+ {
+ if (pField->GetSelectedIndex(j) == i)
+ {
+ bSelected = TRUE;
+ break;
+ }
+ }
+
+ pEdit->SetText((FX_LPCWSTR)pField->GetOptionLabel(i));
+
+ CPDF_Rect rcContent = pEdit->GetContentRect();
+ FX_FLOAT fItemHeight = rcContent.Height();
+
+ if (bSelected)
+ {
+ CPDF_Rect rcItem = CPDF_Rect(rcClient.left,fy-fItemHeight,rcClient.right,fy);
+ sList << "q\n" << CPWL_Utils::GetColorAppStream(CPWL_Color(COLORTYPE_RGB,0,51.0f/255.0f,113.0f/255.0f),TRUE)
+ << rcItem.left << " " << rcItem.bottom << " " << rcItem.Width() << " " << rcItem.Height() << " re f\n" << "Q\n";
+
+ sList << "BT\n" << CPWL_Utils::GetColorAppStream(CPWL_Color(COLORTYPE_GRAY,1),TRUE) <<
+ CPWL_Utils::GetEditAppStream(pEdit,CPDF_Point(0.0f,fy)) << "ET\n";
+ }
+ else
+ {
+ CPWL_Color crText = GetTextPWLColor();
+ sList << "BT\n" << CPWL_Utils::GetColorAppStream(crText,TRUE) <<
+ CPWL_Utils::GetEditAppStream(pEdit,CPDF_Point(0.0f,fy)) << "ET\n";
+ }
+
+ fy -= fItemHeight;
+ }
+
+ if (sList.GetSize() > 0)
+ {
+ sBody << "/Tx BMC\n" << "q\n" << rcClient.left << " " << rcClient.bottom << " "
+ << rcClient.Width() << " " << rcClient.Height() << " re\nW\nn\n";
+ sBody << sList << "Q\nEMC\n";
+ }
+
+ IFX_Edit::DelEdit(pEdit);
+ }
+
+ CFX_ByteString sAP = GetBackgroundAppStream() + GetBorderAppStream() + sLines.GetByteString() + sBody.GetByteString();
+
+ WriteAppearance("N", GetRotatedRect(), GetMatrix(), sAP);
+}
+
+void CPDFSDK_Widget::ResetAppearance_TextField(FX_LPCWSTR sValue)
+{
+ CPDF_FormControl* pControl = GetFormControl();
+ ASSERT(pControl != NULL);
+ CPDF_FormField* pField = pControl->GetField();
+ ASSERT(pField != NULL);
+
+ CFX_ByteTextBuf sBody, sLines;
+
+ if (IFX_Edit * pEdit = IFX_Edit::NewEdit())
+ {
+ pEdit->EnableRefresh(FALSE);
+
+// ASSERT(this->m_pBaseForm != NULL);
+ ASSERT(this->m_pInterForm != NULL);
+ CPDFSDK_Document* pDoc = m_pInterForm->GetDocument();
+ ASSERT(pDoc != NULL);
+ CPDFDoc_Environment* pEnv = pDoc->GetEnv();
+
+ CBA_FontMap FontMap(this,pEnv->GetSysHandler());//, ISystemHandle::GetSystemHandler(m_pBaseForm->GetEnv()));
+ FontMap.Initial();
+ pEdit->SetFontMap(&FontMap);
+
+ CPDF_Rect rcClient = GetClientRect();
+ pEdit->SetPlateRect(rcClient);
+ pEdit->SetAlignmentH(pControl->GetControlAlignment());
+
+ FX_DWORD dwFieldFlags = pField->GetFieldFlags();
+ FX_BOOL bMultiLine = (dwFieldFlags >> 12) & 1;
+
+ if (bMultiLine)
+ {
+ pEdit->SetMultiLine(TRUE);
+ pEdit->SetAutoReturn(TRUE);
+ }
+ else
+ {
+ pEdit->SetAlignmentV(1);
+ }
+
+ FX_WORD subWord = 0;
+ if ((dwFieldFlags >> 13) & 1)
+ {
+ subWord = '*';
+ pEdit->SetPasswordChar(subWord);
+ }
+
+ int nMaxLen = pField->GetMaxLen();
+ FX_BOOL bCharArray = (dwFieldFlags >> 24) & 1;
+ FX_FLOAT fFontSize = GetFontSize();
+
+ if (nMaxLen > 0)
+ {
+ if (bCharArray)
+ {
+ pEdit->SetCharArray(nMaxLen);
+
+ if (IsFloatZero(fFontSize))
+ {
+ fFontSize = CPWL_Edit::GetCharArrayAutoFontSize(FontMap.GetPDFFont(0),rcClient,nMaxLen);
+ }
+ }
+ else
+ {
+ if (sValue)
+ nMaxLen = wcslen((const wchar_t*)sValue);
+ pEdit->SetLimitChar(nMaxLen);
+ }
+ }
+
+ if (IsFloatZero(fFontSize))
+ pEdit->SetAutoFontSize(TRUE);
+ else
+ pEdit->SetFontSize(fFontSize);
+
+ pEdit->Initialize();
+
+ if (sValue)
+ pEdit->SetText(sValue);
+ else
+ pEdit->SetText((FX_LPCWSTR)pField->GetValue());
+
+ CPDF_Rect rcContent = pEdit->GetContentRect();
+
+ CFX_ByteString sEdit = CPWL_Utils::GetEditAppStream(pEdit,CPDF_Point(0.0f,0.0f),
+ NULL,!bCharArray,subWord);
+
+ if (sEdit.GetLength() > 0)
+ {
+ sBody << "/Tx BMC\n" << "q\n";
+ if (rcContent.Width() > rcClient.Width() ||
+ rcContent.Height() > rcClient.Height())
+ {
+ sBody << rcClient.left << " " << rcClient.bottom << " "
+ << rcClient.Width() << " " << rcClient.Height() << " re\nW\nn\n";
+ }
+ CPWL_Color crText = GetTextPWLColor();
+ sBody << "BT\n" << CPWL_Utils::GetColorAppStream(crText) << sEdit << "ET\n" << "Q\nEMC\n";
+ }
+
+ if (bCharArray)
+ {
+ switch (GetBorderStyle())
+ {
+ case BBS_SOLID:
+ {
+ CFX_ByteString sColor = CPWL_Utils::GetColorAppStream(GetBorderPWLColor(),FALSE);
+ if (sColor.GetLength() > 0)
+ {
+ sLines << "q\n" << GetBorderWidth() << " w\n"
+ << CPWL_Utils::GetColorAppStream(GetBorderPWLColor(),FALSE) << " 2 J 0 j\n";
+
+ for (FX_INT32 i=1;i<nMaxLen;i++)
+ {
+ sLines << rcClient.left + ((rcClient.right - rcClient.left)/nMaxLen)*i << " "
+ << rcClient.bottom << " m\n"
+ << rcClient.left + ((rcClient.right - rcClient.left)/nMaxLen)*i << " "
+ << rcClient.top << " l S\n";
+ }
+
+ sLines << "Q\n";
+ }
+ }
+ break;
+ case BBS_DASH:
+ {
+ CFX_ByteString sColor = CPWL_Utils::GetColorAppStream(GetBorderPWLColor(),FALSE);
+ if (sColor.GetLength() > 0)
+ {
+ CPWL_Dash dsBorder = CPWL_Dash(3, 3, 0);
+
+ sLines << "q\n" << GetBorderWidth() << " w\n"
+ << CPWL_Utils::GetColorAppStream(GetBorderPWLColor(),FALSE)
+ << "[" << dsBorder.nDash << " "
+ << dsBorder.nGap << "] "
+ << dsBorder.nPhase << " d\n";
+
+ for (FX_INT32 i=1;i<nMaxLen;i++)
+ {
+ sLines << rcClient.left + ((rcClient.right - rcClient.left)/nMaxLen)*i << " "
+ << rcClient.bottom << " m\n"
+ << rcClient.left + ((rcClient.right - rcClient.left)/nMaxLen)*i << " "
+ << rcClient.top << " l S\n";
+ }
+
+ sLines << "Q\n";
+ }
+ }
+ break;
+ }
+ }
+
+ IFX_Edit::DelEdit(pEdit);
+ }
+
+ CFX_ByteString sAP = GetBackgroundAppStream() + GetBorderAppStream() + sLines.GetByteString() + sBody.GetByteString();
+ WriteAppearance("N", GetRotatedRect(), GetMatrix(), sAP);
+}
+
+CPDF_Rect CPDFSDK_Widget::GetClientRect() const
+{
+ CPDF_Rect rcWindow = GetRotatedRect();
+ FX_FLOAT fBorderWidth = (FX_FLOAT)GetBorderWidth();
+ switch (GetBorderStyle())
+ {
+ case BBS_BEVELED:
+ case BBS_INSET:
+ fBorderWidth *= 2.0f;
+ break;
+ }
+
+ return CPWL_Utils::DeflateRect(rcWindow, fBorderWidth);
+}
+
+CPDF_Rect CPDFSDK_Widget::GetRotatedRect() const
+{
+ CPDF_Rect rectAnnot = GetRect();
+ FX_FLOAT fWidth = rectAnnot.right - rectAnnot.left;
+ FX_FLOAT fHeight = rectAnnot.top - rectAnnot.bottom;
+
+ CPDF_FormControl* pControl = GetFormControl();
+ ASSERT(pControl != NULL);
+
+ CPDF_Rect rcPDFWindow;
+ switch(abs(pControl->GetRotation() % 360))
+ {
+ case 0:
+ case 180:
+ default:
+ rcPDFWindow = CPDF_Rect(0, 0, fWidth, fHeight);
+ break;
+ case 90:
+ case 270:
+ rcPDFWindow = CPDF_Rect(0, 0, fHeight, fWidth);
+ break;
+ }
+
+ return rcPDFWindow;
+}
+
+CFX_ByteString CPDFSDK_Widget::GetBackgroundAppStream() const
+{
+ CPWL_Color crBackground = GetFillPWLColor();
+ if (crBackground.nColorType != COLORTYPE_TRANSPARENT)
+ return CPWL_Utils::GetRectFillAppStream(GetRotatedRect(), crBackground);
+ else
+ return "";
+}
+
+CFX_ByteString CPDFSDK_Widget::GetBorderAppStream() const
+{
+ CPDF_Rect rcWindow = GetRotatedRect();
+ CPWL_Color crBorder = GetBorderPWLColor();
+ CPWL_Color crBackground = GetFillPWLColor();
+ CPWL_Color crLeftTop, crRightBottom;
+
+ FX_FLOAT fBorderWidth = (FX_FLOAT)GetBorderWidth();
+ FX_INT32 nBorderStyle = 0;
+ CPWL_Dash dsBorder(3,0,0);
+
+ switch (GetBorderStyle())
+ {
+ case BBS_DASH:
+ nBorderStyle = PBS_DASH;
+ dsBorder = CPWL_Dash(3, 3, 0);
+ break;
+ case BBS_BEVELED:
+ nBorderStyle = PBS_BEVELED;
+ fBorderWidth *= 2;
+ crLeftTop = CPWL_Color(COLORTYPE_GRAY, 1);
+ crRightBottom = CPWL_Utils::DevideColor(crBackground, 2);
+ break;
+ case BBS_INSET:
+ nBorderStyle = PBS_INSET;
+ fBorderWidth *= 2;
+ crLeftTop = CPWL_Color(COLORTYPE_GRAY, 0.5);
+ crRightBottom = CPWL_Color(COLORTYPE_GRAY, 0.75);
+ break;
+ case BBS_UNDERLINE:
+ nBorderStyle = PBS_UNDERLINED;
+ break;
+ default:
+ nBorderStyle = PBS_SOLID;
+ break;
+ }
+
+ return CPWL_Utils::GetBorderAppStream(rcWindow, fBorderWidth, crBorder, crLeftTop,
+ crRightBottom, nBorderStyle, dsBorder);
+}
+
+CPDF_Matrix CPDFSDK_Widget::GetMatrix() const
+{
+ CPDF_Matrix mt;
+ CPDF_FormControl* pControl = GetFormControl();
+ ASSERT(pControl != NULL);
+
+ CPDF_Rect rcAnnot = GetRect();
+ FX_FLOAT fWidth = rcAnnot.right - rcAnnot.left;
+ FX_FLOAT fHeight = rcAnnot.top - rcAnnot.bottom;
+
+
+
+ switch (abs(pControl->GetRotation() % 360))
+ {
+ case 0:
+ default:
+ mt = CPDF_Matrix(1, 0, 0, 1, 0, 0);
+ break;
+ case 90:
+ mt = CPDF_Matrix(0, 1, -1, 0, fWidth, 0);
+ break;
+ case 180:
+ mt = CPDF_Matrix(-1, 0, 0, -1, fWidth, fHeight);
+ break;
+ case 270:
+ mt = CPDF_Matrix(0, -1, 1, 0, 0, fHeight);
+ break;
+ }
+
+ return mt;
+}
+
+CPWL_Color CPDFSDK_Widget::GetTextPWLColor() const
+{
+ CPWL_Color crText = CPWL_Color(COLORTYPE_GRAY, 0);
+
+ CPDF_FormControl* pFormCtrl = GetFormControl();
+ ASSERT(pFormCtrl != NULL);
+
+ CPDF_DefaultAppearance da = pFormCtrl->GetDefaultAppearance();
+ if (da.HasColor())
+ {
+ FX_INT32 iColorType;
+ FX_FLOAT fc[4];
+ da.GetColor(iColorType, fc);
+ crText = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]);
+ }
+
+ return crText;
+}
+
+CPWL_Color CPDFSDK_Widget::GetBorderPWLColor() const
+{
+ CPWL_Color crBorder;
+
+ CPDF_FormControl* pFormCtrl = GetFormControl();
+ ASSERT(pFormCtrl != NULL);
+
+ FX_INT32 iColorType;
+ FX_FLOAT fc[4];
+ pFormCtrl->GetOriginalBorderColor(iColorType, fc);
+ if (iColorType > 0)
+ crBorder = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]);
+
+ return crBorder;
+}
+
+CPWL_Color CPDFSDK_Widget::GetFillPWLColor() const
+{
+ CPWL_Color crFill;
+
+ CPDF_FormControl* pFormCtrl = GetFormControl();
+ ASSERT(pFormCtrl != NULL);
+
+ FX_INT32 iColorType;
+ FX_FLOAT fc[4];
+ pFormCtrl->GetOriginalBackgroundColor(iColorType, fc);
+ if (iColorType > 0)
+ crFill = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]);
+
+ return crFill;
+}
+
+void CPDFSDK_Widget::AddImageToAppearance(const CFX_ByteString& sAPType, CPDF_Stream* pImage)
+{
+ ASSERT(pImage != NULL);
+
+ ASSERT(m_pAnnot != NULL);
+ ASSERT(m_pAnnot->m_pAnnotDict != NULL);
+
+ CPDF_Document* pDoc = m_pPageView->GetPDFDocument();//pDocument->GetDocument();
+ ASSERT(pDoc != NULL);
+
+ CPDF_Dictionary* pAPDict = m_pAnnot->m_pAnnotDict->GetDict("AP");
+ ASSERT(pAPDict != NULL);
+
+ CPDF_Stream* pStream = pAPDict->GetStream(sAPType);
+ ASSERT(pStream != NULL);
+
+ CPDF_Dictionary* pStreamDict = pStream->GetDict();
+ ASSERT(pStreamDict != NULL);
+
+ CFX_ByteString sImageAlias = "IMG";
+
+ if (CPDF_Dictionary* pImageDict = pImage->GetDict())
+ {
+ sImageAlias = pImageDict->GetString("Name");
+ if (sImageAlias.IsEmpty())
+ sImageAlias = "IMG";
+ }
+
+ CPDF_Dictionary* pStreamResList = pStreamDict->GetDict("Resources");
+ if (!pStreamResList)
+ {
+ pStreamResList = FX_NEW CPDF_Dictionary();
+ pStreamDict->SetAt("Resources", pStreamResList);
+ }
+
+ if (pStreamResList)
+ {
+ CPDF_Dictionary* pXObject = FX_NEW CPDF_Dictionary;
+ pXObject->SetAtReference(sImageAlias, pDoc, pImage);
+ pStreamResList->SetAt("XObject", pXObject);
+ }
+}
+
+void CPDFSDK_Widget::RemoveAppearance(const CFX_ByteString& sAPType)
+{
+ ASSERT(m_pAnnot != NULL);
+ ASSERT(m_pAnnot->m_pAnnotDict != NULL);
+
+ if (CPDF_Dictionary* pAPDict = m_pAnnot->m_pAnnotDict->GetDict("AP"))
+ {
+ pAPDict->RemoveAt(sAPType);
+ }
+}
+
+FX_BOOL CPDFSDK_Widget::OnAAction(CPDF_AAction::AActionType type, PDFSDK_FieldAction& data, CPDFSDK_PageView* pPageView)
+{
+ CPDF_Action action = GetAAction(type);
+
+ if (action && action.GetType() != CPDF_Action::Unknown)
+ {
+ CPDFSDK_Document* pDocument = pPageView->GetSDKDocument();
+ ASSERT(pDocument != NULL);
+
+ CPDFDoc_Environment* pEnv = pDocument->GetEnv();
+ ASSERT(pEnv != NULL);
+
+ CPDFSDK_ActionHandler* pActionHandler = pEnv->GetActionHander();/*(CPDFSDK_ActionHandler*)pApp->GetActionHandler();*/
+ ASSERT(pActionHandler != NULL);
+
+ return pActionHandler->DoAction_Field(action, type, pDocument, GetFormField(), data);
+ }
+
+ return FALSE;
+}
+
+CPDF_Action CPDFSDK_Widget::GetAAction(CPDF_AAction::AActionType eAAT)
+{
+ switch (eAAT)
+ {
+ case CPDF_AAction::CursorEnter:
+ case CPDF_AAction::CursorExit:
+ case CPDF_AAction::ButtonDown:
+ case CPDF_AAction::ButtonUp:
+ case CPDF_AAction::GetFocus:
+ case CPDF_AAction::LoseFocus:
+ case CPDF_AAction::PageOpen:
+ case CPDF_AAction::PageClose:
+ case CPDF_AAction::PageVisible:
+ case CPDF_AAction::PageInvisible:
+ return CPDFSDK_Annot::GetAAction(eAAT);
+ case CPDF_AAction::KeyStroke:
+ case CPDF_AAction::Format:
+ case CPDF_AAction::Validate:
+ case CPDF_AAction::Calculate:
+ {
+ CPDF_FormField* pField = this->GetFormField();
+ ASSERT(pField != NULL);
+
+ if (CPDF_AAction aa = pField->GetAdditionalAction())
+ return aa.GetAction(eAAT);
+ else
+ return CPDFSDK_Annot::GetAAction(eAAT);
+ }
+ default:
+ return NULL;
+ }
+
+ return NULL;
+}
+
+
+CFX_WideString CPDFSDK_Widget::GetAlternateName() const
+{
+ CPDF_FormField* pFormField = GetFormField();
+ ASSERT(pFormField != NULL);
+
+ return pFormField->GetAlternateName();
+}
+
+FX_INT32 CPDFSDK_Widget::GetAppearanceAge() const
+{
+ return m_nAppAge;
+}
+
+FX_INT32 CPDFSDK_Widget::GetValueAge() const
+{
+ return m_nValueAge;
+}
+
+
+FX_BOOL CPDFSDK_Widget::HitTest(FX_FLOAT pageX, FX_FLOAT pageY)
+{
+ CPDF_Annot* pAnnot = GetPDFAnnot();
+ CFX_FloatRect annotRect;
+ pAnnot->GetRect(annotRect);
+ if(annotRect.Contains(pageX, pageY))
+ {
+ if (!IsVisible()) return FALSE;
+
+ int nFieldFlags = GetFieldFlags();
+ if ((nFieldFlags & FIELDFLAG_READONLY) == FIELDFLAG_READONLY)
+ return FALSE;
+
+ return TRUE;
+ }
+ return FALSE;
+}
+
+CPDFSDK_InterForm::CPDFSDK_InterForm(CPDFSDK_Document* pDocument)
+ :m_pDocument(pDocument),
+ m_pInterForm(NULL),
+ m_bCalculate(TRUE),
+ m_bBusy(FALSE)
+{
+ ASSERT(m_pDocument != NULL);
+ m_pInterForm = new CPDF_InterForm(m_pDocument->GetDocument(), FALSE);
+ ASSERT(m_pInterForm != NULL);
+ m_pInterForm->SetFormNotify(this);
+
+ for(int i=0; i<6; i++)
+ m_bNeedHightlight[i] = FALSE;
+ m_iHighlightAlpha = 0;
+}
+
+CPDFSDK_InterForm::~CPDFSDK_InterForm()
+{
+ ASSERT(m_pInterForm != NULL);
+ delete m_pInterForm;
+ m_pInterForm = NULL;
+
+ m_Map.RemoveAll();
+}
+
+void CPDFSDK_InterForm::Destroy()
+{
+ delete this;
+}
+
+CPDF_InterForm* CPDFSDK_InterForm::GetInterForm()
+{
+ return m_pInterForm;
+}
+
+CPDFSDK_Document* CPDFSDK_InterForm::GetDocument()
+{
+ return m_pDocument;
+}
+
+FX_BOOL CPDFSDK_InterForm::HighlightWidgets()
+{
+ return FALSE;
+}
+
+CPDFSDK_Widget* CPDFSDK_InterForm::GetSibling(CPDFSDK_Widget* pWidget, FX_BOOL bNext) const
+{
+ ASSERT(pWidget != NULL);
+
+ CBA_AnnotIterator* pIterator = new CBA_AnnotIterator(pWidget->GetPageView(), "Widget", "");
+ ASSERT(pIterator != NULL);
+
+ CPDFSDK_Widget* pRet = NULL;
+
+ if (bNext)
+ pRet = (CPDFSDK_Widget*)pIterator->GetNextAnnot(pWidget);
+ else
+ pRet = (CPDFSDK_Widget*)pIterator->GetPrevAnnot(pWidget);
+
+ pIterator->Release();
+
+ return pRet;
+
+}
+
+CPDFSDK_Widget* CPDFSDK_InterForm::GetWidget(CPDF_FormControl* pControl) const
+{
+ if(!pControl || !m_pInterForm) return NULL;
+
+ CPDFSDK_Widget* pWidget = NULL;
+ m_Map.Lookup(pControl, pWidget);
+
+ if (pWidget) return pWidget;
+
+ CPDF_Dictionary* pControlDict = pControl->GetWidget();
+ ASSERT(pControlDict != NULL);
+
+ ASSERT(m_pDocument != NULL);
+ CPDF_Document* pDocument = m_pDocument->GetDocument();
+
+ CPDFSDK_PageView* pPage = NULL;
+
+ if (CPDF_Dictionary* pPageDict = pControlDict->GetDict("P"))
+ {
+ int nPageIndex = pDocument->GetPageIndex(pPageDict->GetObjNum());
+ if (nPageIndex >= 0)
+ {
+ pPage = m_pDocument->GetPageView(nPageIndex);
+ }
+ }
+
+ if (!pPage)
+ {
+ int nPageIndex = GetPageIndexByAnnotDict(pDocument, pControlDict);
+ if (nPageIndex >= 0)
+ {
+ pPage = m_pDocument->GetPageView(nPageIndex);
+ }
+ }
+
+ if (pPage)
+ return (CPDFSDK_Widget*)pPage->GetAnnotByDict(pControlDict);
+
+ return NULL;
+}
+
+void CPDFSDK_InterForm::GetWidgets(const CFX_WideString& sFieldName, CFX_PtrArray& widgets)
+{
+ ASSERT(m_pInterForm != NULL);
+
+ for (int i=0,sz=m_pInterForm->CountFields(sFieldName); i<sz; i++)
+ {
+ CPDF_FormField* pFormField = m_pInterForm->GetField(i, sFieldName);
+ ASSERT(pFormField != NULL);
+
+ GetWidgets(pFormField, widgets);
+ }
+}
+
+void CPDFSDK_InterForm::GetWidgets(CPDF_FormField* pField, CFX_PtrArray& widgets)
+{
+ ASSERT(pField != NULL);
+
+ for (int i=0,isz=pField->CountControls(); i<isz; i++)
+ {
+ CPDF_FormControl* pFormCtrl = pField->GetControl(i);
+ ASSERT(pFormCtrl != NULL);
+
+ CPDFSDK_Widget* pWidget = GetWidget(pFormCtrl);
+
+ if (pWidget)
+ widgets.Add(pWidget);
+ }
+}
+
+int CPDFSDK_InterForm::GetPageIndexByAnnotDict(CPDF_Document* pDocument, CPDF_Dictionary* pAnnotDict) const
+{
+ ASSERT(pDocument != NULL);
+ ASSERT(pAnnotDict != NULL);
+
+ for (int i=0,sz=pDocument->GetPageCount(); i<sz; i++)
+ {
+ if (CPDF_Dictionary* pPageDict = pDocument->GetPage(i))
+ {
+ if (CPDF_Array* pAnnots = pPageDict->GetArray("Annots"))
+ {
+ for (int j=0,jsz=pAnnots->GetCount(); j<jsz; j++)
+ {
+ CPDF_Object* pDict = pAnnots->GetElementValue(j);
+ if (pAnnotDict == pDict)
+ {
+ return i;
+ }
+ }
+ }
+ }
+ }
+
+ return -1;
+}
+
+void CPDFSDK_InterForm::AddMap(CPDF_FormControl* pControl, CPDFSDK_Widget* pWidget)
+{
+ m_Map.SetAt(pControl, pWidget);
+}
+
+void CPDFSDK_InterForm::RemoveMap(CPDF_FormControl* pControl)
+{
+ m_Map.RemoveKey(pControl);
+}
+
+void CPDFSDK_InterForm::EnableCalculate(FX_BOOL bEnabled)
+{
+ m_bCalculate = bEnabled;
+}
+
+FX_BOOL CPDFSDK_InterForm::IsCalculateEnabled() const
+{
+ return m_bCalculate;
+}
+
+#ifdef _WIN32
+CPDF_Stream* CPDFSDK_InterForm::LoadImageFromFile(const CFX_WideString& sFile)
+{
+ ASSERT(m_pDocument != NULL);
+ CPDF_Document* pDocument = m_pDocument->GetDocument();
+ ASSERT(pDocument != NULL);
+
+ CPDF_Stream* pRetStream = NULL;
+
+ if (CFX_DIBitmap* pBmp = CFX_WindowsDIB::LoadFromFile(sFile))
+ {
+ int nWidth = pBmp->GetWidth();
+ int nHeight = pBmp->GetHeight();
+
+ CPDF_Image Image(pDocument);
+ Image.SetImage(pBmp, FALSE);
+ CPDF_Stream* pImageStream = Image.GetStream();
+ if (pImageStream)
+ {
+ if (pImageStream->GetObjNum() == 0)
+ pDocument->AddIndirectObject(pImageStream);
+
+ CPDF_Dictionary* pStreamDict = new CPDF_Dictionary();
+ pStreamDict->SetAtName("Subtype", "Form");
+ pStreamDict->SetAtName("Name", "IMG");
+ CPDF_Array* pMatrix = new CPDF_Array();
+ pStreamDict->SetAt("Matrix", pMatrix);
+ pMatrix->AddInteger(1);
+ pMatrix->AddInteger(0);
+ pMatrix->AddInteger(0);
+ pMatrix->AddInteger(1);
+ pMatrix->AddInteger(-nWidth / 2);
+ pMatrix->AddInteger(-nHeight / 2);
+ CPDF_Dictionary* pResource = new CPDF_Dictionary();
+ pStreamDict->SetAt("Resources", pResource);
+ CPDF_Dictionary* pXObject = new CPDF_Dictionary();
+ pResource->SetAt("XObject", pXObject);
+ pXObject->SetAtReference("Img", pDocument, pImageStream);
+ CPDF_Array* pProcSet = new CPDF_Array();
+ pResource->SetAt("ProcSet", pProcSet);
+ pProcSet->AddName("PDF");
+ pProcSet->AddName("ImageC");
+ pStreamDict->SetAtName("Type", "XObject");
+ CPDF_Array* pBBox = new CPDF_Array();
+ pStreamDict->SetAt("BBox", pBBox);
+ pBBox->AddInteger(0);
+ pBBox->AddInteger(0);
+ pBBox->AddInteger(nWidth);
+ pBBox->AddInteger(nHeight);
+ pStreamDict->SetAtInteger("FormType", 1);
+
+ pRetStream = new CPDF_Stream(NULL, 0, NULL);
+ CFX_ByteString csStream;
+ csStream.Format("q\n%d 0 0 %d 0 0 cm\n/Img Do\nQ", nWidth, nHeight);
+ pRetStream->InitStream((FX_BYTE*)(FX_LPCSTR)csStream, csStream.GetLength(), pStreamDict);
+ pDocument->AddIndirectObject(pRetStream);
+ }
+
+ delete pBmp;
+ }
+
+ return pRetStream;
+}
+#endif
+
+void CPDFSDK_InterForm::OnCalculate(CPDF_FormField* pFormField)
+{
+ ASSERT(m_pDocument != NULL);
+ CPDFDoc_Environment* pEnv = m_pDocument->GetEnv();
+ ASSERT(pEnv);
+ if(!pEnv->IsJSInitiated())
+ return;
+
+ if (m_bBusy) return;
+
+ m_bBusy = TRUE;
+
+ if (this->IsCalculateEnabled())
+ {
+ IFXJS_Runtime* pRuntime = m_pDocument->GetJsRuntime();
+ ASSERT(pRuntime != NULL);
+
+ pRuntime->SetReaderDocument(m_pDocument);
+
+ int nSize = m_pInterForm->CountFieldsInCalculationOrder();
+ for (int i=0; i<nSize; i++)
+ {
+ if(CPDF_FormField* pField = m_pInterForm->GetFieldInCalculationOrder(i))
+ {
+// ASSERT(pField != NULL);
+ int nType = pField->GetFieldType();
+ if (nType == FIELDTYPE_COMBOBOX || nType == FIELDTYPE_TEXTFIELD)
+ {
+ CPDF_AAction aAction = pField->GetAdditionalAction();
+ if (aAction && aAction.ActionExist(CPDF_AAction::Calculate))
+ {
+ CPDF_Action action = aAction.GetAction(CPDF_AAction::Calculate);
+ if (action)
+ {
+ CFX_WideString csJS = action.GetJavaScript();
+ if (!csJS.IsEmpty())
+ {
+ IFXJS_Context* pContext = pRuntime->NewContext();
+ ASSERT(pContext != NULL);
+
+ CFX_WideString sOldValue = pField->GetValue();
+ CFX_WideString sValue = sOldValue;
+ FX_BOOL bRC = TRUE;
+ pContext->OnField_Calculate(pFormField, pField, sValue, bRC);
+
+ CFX_WideString sInfo;
+ FX_BOOL bRet = pContext->RunScript(csJS, sInfo);
+ pRuntime->ReleaseContext(pContext);
+
+ if (bRet)
+ {
+ if (bRC)
+ {
+ if (sValue.Compare(sOldValue) != 0)
+ pField->SetValue(sValue, TRUE);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+
+ }
+
+ m_bBusy = FALSE;
+}
+
+CFX_WideString CPDFSDK_InterForm::OnFormat(CPDF_FormField* pFormField, int nCommitKey, FX_BOOL& bFormated)
+{
+ ASSERT(m_pDocument != NULL);
+ ASSERT(pFormField != NULL);
+
+ CFX_WideString sValue = pFormField->GetValue();
+ CPDFDoc_Environment* pEnv = m_pDocument->GetEnv();
+ ASSERT(pEnv);
+ if(!pEnv->IsJSInitiated())
+ {
+ bFormated = FALSE;
+ return sValue;
+ }
+
+ IFXJS_Runtime* pRuntime = m_pDocument->GetJsRuntime();
+ ASSERT(pRuntime != NULL);
+
+ pRuntime->SetReaderDocument(m_pDocument);
+
+ if (pFormField->GetFieldType() == FIELDTYPE_COMBOBOX)
+ {
+ if (pFormField->CountSelectedItems() > 0)
+ {
+ int index = pFormField->GetSelectedIndex(0);
+ if (index >= 0)
+ sValue = pFormField->GetOptionLabel(index);
+ }
+ }
+
+ bFormated = FALSE;
+
+ CPDF_AAction aAction = pFormField->GetAdditionalAction();
+ if (aAction != NULL && aAction.ActionExist(CPDF_AAction::Format))
+ {
+ CPDF_Action action = aAction.GetAction(CPDF_AAction::Format);
+ if (action)
+ {
+ CFX_WideString script = action.GetJavaScript();
+ if (!script.IsEmpty())
+ {
+ CFX_WideString Value = sValue;
+
+ IFXJS_Context* pContext = pRuntime->NewContext();
+ ASSERT(pContext != NULL);
+
+ pContext->OnField_Format(nCommitKey, pFormField, Value, TRUE);
+
+ CFX_WideString sInfo;
+ FX_BOOL bRet = pContext->RunScript(script, sInfo);
+ pRuntime->ReleaseContext(pContext);
+
+ if (bRet)
+ {
+ sValue = Value;
+ bFormated = TRUE;
+ }
+ }
+ }
+ }
+
+ return sValue;
+}
+
+void CPDFSDK_InterForm::ResetFieldAppearance(CPDF_FormField* pFormField, FX_LPCWSTR sValue, FX_BOOL bValueChanged)
+{
+ ASSERT(pFormField != NULL);
+
+ for (int i=0,sz=pFormField->CountControls(); i<sz; i++)
+ {
+ CPDF_FormControl* pFormCtrl = pFormField->GetControl(i);
+ ASSERT(pFormCtrl != NULL);
+
+ ASSERT(m_pInterForm != NULL);
+ if(CPDFSDK_Widget* pWidget = GetWidget(pFormCtrl))
+ pWidget->ResetAppearance(sValue, bValueChanged);
+ }
+}
+
+void CPDFSDK_InterForm::UpdateField(CPDF_FormField* pFormField)
+{
+ ASSERT(pFormField != NULL);
+
+ for (int i=0,sz=pFormField->CountControls(); i<sz; i++)
+ {
+ CPDF_FormControl* pFormCtrl = pFormField->GetControl(i);
+ ASSERT(pFormCtrl != NULL);
+
+ if(CPDFSDK_Widget* pWidget = GetWidget(pFormCtrl))
+ {
+ CPDFDoc_Environment * pEnv = m_pDocument->GetEnv();
+ CFFL_IFormFiller* pIFormFiller = pEnv->GetIFormFiller();
+
+ CPDF_Page * pPage = pWidget->GetPDFPage();
+ CPDFSDK_PageView * pPageView = m_pDocument->GetPageView(pPage,FALSE);
+
+ FX_RECT rcBBox = pIFormFiller->GetViewBBox(pPageView, pWidget);
+
+ pEnv->FFI_Invalidate(pPage,rcBBox.left, rcBBox.top, rcBBox.right, rcBBox.bottom);
+ }
+ }
+}
+
+void CPDFSDK_InterForm::OnKeyStrokeCommit(CPDF_FormField* pFormField, CFX_WideString& csValue, FX_BOOL& bRC)
+{
+ ASSERT(pFormField != NULL);
+
+ CPDF_AAction aAction = pFormField->GetAdditionalAction();
+ if (aAction != NULL && aAction.ActionExist(CPDF_AAction::KeyStroke))
+ {
+ CPDF_Action action = aAction.GetAction(CPDF_AAction::KeyStroke);
+ if (action)
+ {
+ ASSERT(m_pDocument != NULL);
+ CPDFDoc_Environment* pEnv = m_pDocument->GetEnv();
+ ASSERT(pEnv != NULL);
+
+ CPDFSDK_ActionHandler* pActionHandler = pEnv->GetActionHander();
+ ASSERT(pActionHandler != NULL);
+
+ PDFSDK_FieldAction fa;
+ fa.bModifier = pEnv->FFI_IsCTRLKeyDown(0);
+ fa.bShift = pEnv->FFI_IsSHIFTKeyDown(0);
+ fa.sValue = csValue;
+
+ pActionHandler->DoAction_FieldJavaScript(action, CPDF_AAction::KeyStroke,
+ m_pDocument, pFormField, fa);
+ bRC = fa.bRC;
+ }
+ }
+}
+
+void CPDFSDK_InterForm::OnValidate(CPDF_FormField* pFormField, CFX_WideString& csValue, FX_BOOL& bRC)
+{
+ ASSERT(pFormField != NULL);
+
+ CPDF_AAction aAction = pFormField->GetAdditionalAction();
+ if (aAction != NULL && aAction.ActionExist(CPDF_AAction::Validate))
+ {
+ CPDF_Action action = aAction.GetAction(CPDF_AAction::Validate);
+ if (action)
+ {
+ ASSERT(m_pDocument != NULL);
+ CPDFDoc_Environment* pEnv = m_pDocument->GetEnv();
+ ASSERT(pEnv != NULL);
+
+ CPDFSDK_ActionHandler* pActionHandler = pEnv->GetActionHander();
+ ASSERT(pActionHandler != NULL);
+
+ PDFSDK_FieldAction fa;
+ fa.bModifier = pEnv->FFI_IsCTRLKeyDown(0);
+ fa.bShift = pEnv->FFI_IsSHIFTKeyDown(0);
+ fa.sValue = csValue;
+
+ pActionHandler->DoAction_FieldJavaScript(action, CPDF_AAction::Validate, m_pDocument, pFormField, fa);
+ bRC = fa.bRC;
+
+ }
+ }
+}
+
+/* ----------------------------- action ----------------------------- */
+
+FX_BOOL CPDFSDK_InterForm::DoAction_Hide(const CPDF_Action& action)
+{
+ ASSERT(action != NULL);
+
+ CPDF_ActionFields af = action.GetWidgets();
+ CFX_PtrArray fieldObjects;
+ af.GetAllFields(fieldObjects);
+ CFX_PtrArray widgetArray;
+ CFX_PtrArray fields;
+ GetFieldFromObjects(fieldObjects, fields);
+
+ FX_BOOL bHide = action.GetHideStatus();
+
+ FX_BOOL bChanged = FALSE;
+
+ for (int i=0, sz=fields.GetSize(); i<sz; i++)
+ {
+ CPDF_FormField* pField = (CPDF_FormField*)fields[i];
+ ASSERT(pField != NULL);
+
+
+ for (int j=0,jsz=pField->CountControls(); j<jsz; j++)
+ {
+ CPDF_FormControl* pControl = pField->GetControl(j);
+ ASSERT(pControl != NULL);
+
+ if (CPDFSDK_Widget* pWidget = GetWidget(pControl))
+ {
+ int nFlags = pWidget->GetFlags();
+ if (bHide)
+ {
+ nFlags &= (~ANNOTFLAG_INVISIBLE);
+ nFlags &= (~ANNOTFLAG_NOVIEW);
+ nFlags |= (ANNOTFLAG_HIDDEN);
+ }
+ else
+ {
+ nFlags &= (~ANNOTFLAG_INVISIBLE);
+ nFlags &= (~ANNOTFLAG_HIDDEN);
+ nFlags &= (~ANNOTFLAG_NOVIEW);
+ }
+ pWidget->SetFlags(nFlags);
+
+ CPDFSDK_PageView* pPageView = pWidget->GetPageView();
+ ASSERT(pPageView != NULL);
+
+ pPageView->UpdateView(pWidget);
+
+ bChanged = TRUE;
+ }
+ }
+ }
+
+ return bChanged;
+}
+
+FX_BOOL CPDFSDK_InterForm::DoAction_SubmitForm(const CPDF_Action& action)
+{
+ ASSERT(action != NULL);
+ ASSERT(m_pInterForm != NULL);
+
+ CFX_WideString sDestination = action.GetFilePath();
+ if (sDestination.IsEmpty()) return FALSE;
+
+ CPDF_Dictionary* pActionDict = action;
+ if (pActionDict->KeyExist("Fields"))
+ {
+ CPDF_ActionFields af = action.GetWidgets();
+ FX_DWORD dwFlags = action.GetFlags();
+
+ CFX_PtrArray fieldObjects;
+ af.GetAllFields(fieldObjects);
+ CFX_PtrArray fields;
+ GetFieldFromObjects(fieldObjects, fields);
+
+ if (fields.GetSize() != 0)
+ {
+ FX_BOOL bIncludeOrExclude = !(dwFlags & 0x01);
+ if (m_pInterForm->CheckRequiredFields(&fields, bIncludeOrExclude))
+ {
+ return FALSE;
+ }
+ return SubmitFields(sDestination, fields, bIncludeOrExclude, FALSE);
+ }
+ else
+ {
+ if ( m_pInterForm->CheckRequiredFields())
+ {
+ return FALSE;
+ }
+
+ return SubmitForm(sDestination, FALSE);
+ }
+ }
+ else
+ {
+ if ( m_pInterForm->CheckRequiredFields())
+ {
+ return FALSE;
+ }
+
+ return SubmitForm(sDestination, FALSE);
+ }
+}
+
+FX_BOOL CPDFSDK_InterForm::SubmitFields(const CFX_WideString& csDestination, const CFX_PtrArray& fields,
+ FX_BOOL bIncludeOrExclude, FX_BOOL bUrlEncoded)
+{
+ CPDFDoc_Environment* pEnv = m_pDocument->GetEnv();
+ ASSERT(pEnv != NULL);
+
+ CFX_ByteTextBuf textBuf;
+ ExportFieldsToFDFTextBuf(fields, bIncludeOrExclude, textBuf);
+
+ FX_LPBYTE pBuffer = textBuf.GetBuffer();
+ FX_STRSIZE nBufSize = textBuf.GetLength();
+
+ if (bUrlEncoded)
+ {
+ if(!FDFToURLEncodedData(pBuffer, nBufSize))
+ return FALSE;
+ }
+
+ pEnv->JS_docSubmitForm(pBuffer, nBufSize, (FX_LPCWSTR)csDestination);
+
+ if (bUrlEncoded && pBuffer)
+ {
+ FX_Free(pBuffer);
+ pBuffer = NULL;
+ }
+
+ return TRUE;
+}
+
+void CPDFSDK_InterForm::DoFDFBuffer(CFX_ByteString sBuffer)
+{
+ ASSERT(m_pDocument != NULL);
+
+ if (CFDF_Document *pFDFDocument = CFDF_Document::ParseMemory((const unsigned char *)sBuffer.GetBuffer(sBuffer.GetLength()), sBuffer.GetLength()))
+ {
+ CPDF_Dictionary* pRootDic = pFDFDocument->GetRoot();
+ if(pRootDic)
+ {
+ CPDF_Dictionary * pFDFDict=pRootDic->GetDict("FDF");
+ if(pFDFDict)
+ {
+ CPDF_Dictionary * pJSDict = pFDFDict->GetDict("JavaScript");
+ if(pJSDict)
+ {
+ CFX_WideString csJS;
+
+ CPDF_Object* pJS = pJSDict->GetElementValue("Before");
+ if (pJS != NULL)
+ {
+ int iType = pJS->GetType();
+ if (iType == PDFOBJ_STRING)
+ csJS = pJSDict->GetUnicodeText("Before");
+ else if (iType == PDFOBJ_STREAM)
+ csJS = pJS->GetUnicodeText();
+ }
+
+ }
+ }
+ }
+ delete pFDFDocument;
+ }
+
+ sBuffer.ReleaseBuffer();
+}
+
+FX_BOOL CPDFSDK_InterForm::FDFToURLEncodedData(CFX_WideString csFDFFile, CFX_WideString csTxtFile)
+{
+ return TRUE;
+}
+
+FX_BOOL CPDFSDK_InterForm::FDFToURLEncodedData(FX_LPBYTE& pBuf, FX_STRSIZE& nBufSize)
+{
+ CFDF_Document* pFDF = CFDF_Document::ParseMemory(pBuf, nBufSize);
+ if (pFDF)
+ {
+ CPDF_Dictionary* pMainDict = pFDF->GetRoot()->GetDict("FDF");
+ if (pMainDict == NULL) return FALSE;
+
+ // Get fields
+ CPDF_Array* pFields = pMainDict->GetArray("Fields");
+ if (pFields == NULL) return FALSE;
+
+ CFX_ByteTextBuf fdfEncodedData;
+
+ for (FX_DWORD i = 0; i < pFields->GetCount(); i ++)
+ {
+ CPDF_Dictionary* pField = pFields->GetDict(i);
+ if (pField == NULL) continue;
+ CFX_WideString name;
+ name = pField->GetUnicodeText("T");
+ CFX_ByteString name_b = CFX_ByteString::FromUnicode(name);
+ CFX_ByteString csBValue = pField->GetString("V");
+ CFX_WideString csWValue = PDF_DecodeText(csBValue);
+ CFX_ByteString csValue_b = CFX_ByteString::FromUnicode(csWValue);
+
+ fdfEncodedData = fdfEncodedData<<name_b.GetBuffer(name_b.GetLength());
+ name_b.ReleaseBuffer();
+ fdfEncodedData = fdfEncodedData<<"=";
+ fdfEncodedData = fdfEncodedData<<csValue_b.GetBuffer(csValue_b.GetLength());
+ csValue_b.ReleaseBuffer();
+ if(i != pFields->GetCount()-1)
+ fdfEncodedData = fdfEncodedData<<"&";
+ }
+
+ nBufSize = fdfEncodedData.GetLength();
+ pBuf = FX_Alloc(FX_BYTE, nBufSize);
+ if(!pBuf)
+ return FALSE;
+ FXSYS_memcpy(pBuf, fdfEncodedData.GetBuffer(), nBufSize);
+
+ }
+ return TRUE;
+}
+
+FX_BOOL CPDFSDK_InterForm::ExportFieldsToFDFFile(const CFX_WideString& sFDFFileName,
+ const CFX_PtrArray& fields, FX_BOOL bIncludeOrExclude)
+{
+ if (sFDFFileName.IsEmpty()) return FALSE;
+ ASSERT(m_pDocument != NULL);
+ ASSERT(m_pInterForm != NULL);
+
+ CFDF_Document* pFDF = m_pInterForm->ExportToFDF(m_pDocument->GetPath(),(CFX_PtrArray&)fields, bIncludeOrExclude);
+ if (!pFDF) return FALSE;
+ FX_BOOL bRet = pFDF->WriteFile(sFDFFileName.UTF8Encode()); // = FALSE;//
+ delete pFDF;
+
+ return bRet;
+}
+FX_BOOL CPDFSDK_InterForm::ExportFieldsToFDFTextBuf(const CFX_PtrArray& fields,FX_BOOL bIncludeOrExclude, CFX_ByteTextBuf& textBuf)
+{
+ ASSERT(m_pDocument != NULL);
+ ASSERT(m_pInterForm != NULL);
+
+ CFDF_Document* pFDF = m_pInterForm->ExportToFDF(m_pDocument->GetPath(),(CFX_PtrArray&)fields, bIncludeOrExclude);
+ if (!pFDF) return FALSE;
+ FX_BOOL bRet = pFDF->WriteBuf(textBuf); // = FALSE;//
+ delete pFDF;
+
+ return bRet;
+}
+
+CFX_WideString CPDFSDK_InterForm::GetTemporaryFileName(const CFX_WideString& sFileExt)
+{
+ CFX_WideString sFileName;
+ return L"";
+}
+
+FX_BOOL CPDFSDK_InterForm::SubmitForm(const CFX_WideString& sDestination, FX_BOOL bUrlEncoded)
+{
+ if (sDestination.IsEmpty()) return FALSE;
+
+ CPDFDoc_Environment* pEnv = m_pDocument->GetEnv();
+ ASSERT(pEnv != NULL);
+
+ if(NULL == m_pDocument) return FALSE;
+ CFX_WideString wsPDFFilePath = m_pDocument->GetPath();
+
+ if(NULL == m_pInterForm) return FALSE;
+ CFDF_Document* pFDFDoc = m_pInterForm->ExportToFDF(wsPDFFilePath);
+ if (NULL == pFDFDoc) return FALSE;
+
+ CFX_ByteTextBuf FdfBuffer;
+ FX_BOOL bRet = pFDFDoc->WriteBuf(FdfBuffer);
+ delete pFDFDoc;
+ if (!bRet) return FALSE;
+
+ FX_LPBYTE pBuffer = FdfBuffer.GetBuffer();
+ FX_STRSIZE nBufSize = FdfBuffer.GetLength();
+
+ if (bUrlEncoded)
+ {
+ if(!FDFToURLEncodedData(pBuffer, nBufSize))
+ return FALSE;
+ }
+
+ pEnv->JS_docSubmitForm(pBuffer, nBufSize, (FX_LPCWSTR)sDestination);
+
+ if (bUrlEncoded && pBuffer)
+ {
+ FX_Free(pBuffer);
+ pBuffer = NULL;
+ }
+
+ return TRUE;
+}
+
+FX_BOOL CPDFSDK_InterForm::ExportFormToFDFFile(const CFX_WideString& sFDFFileName)
+{
+ if (sFDFFileName.IsEmpty()) return FALSE;
+
+ ASSERT(m_pInterForm != NULL);
+ ASSERT(m_pDocument != NULL);
+
+ CFDF_Document* pFDF = m_pInterForm->ExportToFDF(m_pDocument->GetPath());
+ if (!pFDF) return FALSE;
+
+ FX_BOOL bRet = pFDF->WriteFile(sFDFFileName.UTF8Encode());
+ delete pFDF;
+
+ return bRet;
+}
+
+FX_BOOL CPDFSDK_InterForm::ExportFormToFDFTextBuf(CFX_ByteTextBuf& textBuf)
+{
+
+ ASSERT(m_pInterForm != NULL);
+ ASSERT(m_pDocument != NULL);
+
+ CFDF_Document* pFDF = m_pInterForm->ExportToFDF(m_pDocument->GetPath());
+ if (!pFDF) return FALSE;
+
+ FX_BOOL bRet = pFDF->WriteBuf(textBuf);
+ delete pFDF;
+
+ return bRet;
+}
+
+FX_BOOL CPDFSDK_InterForm::ExportFormToTxtFile(const CFX_WideString& sTxtFileName)
+{
+ ASSERT(m_pInterForm != NULL);
+
+ CFX_WideString sFieldNames;
+ CFX_WideString sFieldValues;
+
+ int nSize = m_pInterForm->CountFields();
+
+ if (nSize > 0)
+ {
+ for (int i=0; i<nSize; i++)
+ {
+ CPDF_FormField* pField = m_pInterForm->GetField(i);
+ ASSERT(pField != NULL);
+
+ if (i != 0)
+ {
+ sFieldNames += L"\t";
+ sFieldValues += L"\t";
+ }
+ sFieldNames += pField->GetFullName();
+ sFieldValues += pField->GetValue();
+ }
+
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+FX_BOOL CPDFSDK_InterForm::ImportFormFromTxtFile(const CFX_WideString& sTxtFileName)
+{
+ ASSERT(m_pInterForm != NULL);
+
+ return TRUE;
+}
+
+FX_BOOL CPDFSDK_InterForm::DoAction_ResetForm(const CPDF_Action& action)
+{
+ ASSERT(action != NULL);
+
+ CPDF_Dictionary* pActionDict = action;
+
+ if (pActionDict->KeyExist("Fields"))
+ {
+ CPDF_ActionFields af = action.GetWidgets();
+ FX_DWORD dwFlags = action.GetFlags();
+
+ CFX_PtrArray fieldObjects;
+ af.GetAllFields(fieldObjects);
+ CFX_PtrArray fields;
+ GetFieldFromObjects(fieldObjects, fields);
+
+ ASSERT(m_pInterForm != NULL);
+
+ return m_pInterForm->ResetForm(fields, !(dwFlags & 0x01), TRUE);
+ }
+ else
+ {
+ ASSERT(m_pInterForm != NULL);
+ return m_pInterForm->ResetForm(TRUE);
+ }
+}
+
+FX_BOOL CPDFSDK_InterForm::DoAction_ImportData(const CPDF_Action& action)
+{
+ ASSERT(action != NULL);
+
+ CFX_WideString sFilePath = action.GetFilePath();
+ if (sFilePath.IsEmpty())
+ return FALSE;
+
+ if (!ImportFormFromFDFFile(sFilePath, TRUE))
+ {
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+FX_BOOL CPDFSDK_InterForm::ImportFormFromFDFFile(const CFX_WideString& csFDFFileName,
+ FX_BOOL bNotify)
+{
+ return FALSE;
+}
+
+void CPDFSDK_InterForm::GetFieldFromObjects(const CFX_PtrArray& objects, CFX_PtrArray& fields)
+{
+ ASSERT(m_pInterForm != NULL);
+
+ int iCount = objects.GetSize();
+ for (int i = 0; i < iCount; i ++)
+ {
+ CPDF_Object* pObject = (CPDF_Object*)objects[i];
+ if (pObject == NULL) continue;
+
+ int iType = pObject->GetType();
+ if (iType == PDFOBJ_STRING)
+ {
+ CFX_WideString csName = pObject->GetUnicodeText();
+ CPDF_FormField* pField = m_pInterForm->GetField(0, csName);
+ if (pField != NULL)
+ fields.Add(pField);
+ }
+ else if (iType == PDFOBJ_DICTIONARY)
+ {
+ if (m_pInterForm->IsValidFormField(pObject))
+ fields.Add(pObject);
+ }
+ }
+}
+
+/* ----------------------------- CPDF_FormNotify ----------------------------- */
+
+int CPDFSDK_InterForm::BeforeValueChange(const CPDF_FormField* pField, CFX_WideString& csValue)
+{
+ ASSERT(pField != NULL);
+
+ CPDF_FormField* pFormField = (CPDF_FormField*)pField;
+
+ int nType = pFormField->GetFieldType();
+ if (nType == FIELDTYPE_COMBOBOX || nType == FIELDTYPE_TEXTFIELD)
+ {
+ FX_BOOL bRC = TRUE;
+ OnKeyStrokeCommit(pFormField, csValue, bRC);
+ if (bRC)
+ {
+ OnValidate(pFormField, csValue, bRC);
+ if (bRC)
+ return 1;
+ else
+ return -1;
+ }
+ else
+ return -1;
+ }
+ else
+ return 0;
+}
+
+int CPDFSDK_InterForm::AfterValueChange(const CPDF_FormField* pField)
+{
+ ASSERT(pField != NULL);
+
+ CPDF_FormField* pFormField = (CPDF_FormField*)pField;
+ int nType = pFormField->GetFieldType();
+
+ if (nType == FIELDTYPE_COMBOBOX || nType == FIELDTYPE_TEXTFIELD)
+ {
+ this->OnCalculate(pFormField);
+ FX_BOOL bFormated = FALSE;
+ CFX_WideString sValue = this->OnFormat(pFormField, 0, bFormated);
+ if (bFormated)
+ this->ResetFieldAppearance(pFormField, sValue, TRUE);
+ else
+ this->ResetFieldAppearance(pFormField, NULL, TRUE);
+ this->UpdateField(pFormField);
+ }
+
+ return 0;
+}
+
+int CPDFSDK_InterForm::BeforeSelectionChange(const CPDF_FormField* pField, CFX_WideString& csValue)
+{
+ ASSERT(pField != NULL);
+
+ CPDF_FormField* pFormField = (CPDF_FormField*)pField;
+
+ int nType = pFormField->GetFieldType();
+ if (nType == FIELDTYPE_LISTBOX)
+ {
+ FX_BOOL bRC = TRUE;
+ OnKeyStrokeCommit(pFormField, csValue, bRC);
+ if (bRC)
+ {
+ OnValidate(pFormField, csValue, bRC);
+ if (bRC)
+ return 1;
+ else
+ return -1;
+ }
+ else
+ return -1;
+ }
+ else
+ return 0;
+}
+
+int CPDFSDK_InterForm::AfterSelectionChange(const CPDF_FormField* pField)
+{
+ ASSERT(pField != NULL);
+
+ CPDF_FormField* pFormField = (CPDF_FormField*)pField;
+ int nType = pFormField->GetFieldType();
+
+ if (nType == FIELDTYPE_LISTBOX)
+ {
+ this->OnCalculate(pFormField);
+ this->ResetFieldAppearance(pFormField, NULL, TRUE);
+ this->UpdateField(pFormField);
+ }
+
+ return 0;
+}
+
+int CPDFSDK_InterForm::AfterCheckedStatusChange(const CPDF_FormField* pField, const CFX_ByteArray& statusArray)
+{
+ ASSERT(pField != NULL);
+
+ CPDF_FormField* pFormField = (CPDF_FormField*)pField;
+ int nType = pFormField->GetFieldType();
+
+ if (nType == FIELDTYPE_CHECKBOX || nType == FIELDTYPE_RADIOBUTTON)
+ {
+ this->OnCalculate(pFormField);
+ //this->ResetFieldAppearance(pFormField, NULL);
+ this->UpdateField(pFormField);
+ }
+
+ return 0;
+}
+
+int CPDFSDK_InterForm::BeforeFormReset(const CPDF_InterForm* pForm)
+{
+ return 0;
+}
+
+int CPDFSDK_InterForm::AfterFormReset(const CPDF_InterForm* pForm)
+{
+ this->OnCalculate(NULL);
+
+ return 0;
+}
+
+int CPDFSDK_InterForm::BeforeFormImportData(const CPDF_InterForm* pForm)
+{
+ return 0;
+}
+
+int CPDFSDK_InterForm::AfterFormImportData(const CPDF_InterForm* pForm)
+{
+ this->OnCalculate(NULL);
+
+ return 0;
+}
+
+FX_BOOL CPDFSDK_InterForm::IsNeedHighLight(int nFieldType)
+{
+ if(nFieldType <1 || nFieldType > 6)
+ return FALSE;
+ return m_bNeedHightlight[nFieldType-1];
+}
+
+void CPDFSDK_InterForm::RemoveAllHighLight()
+{
+ memset((void*)m_bNeedHightlight, 0, 6*sizeof(FX_BOOL));
+}
+void CPDFSDK_InterForm::SetHighlightColor(FX_COLORREF clr, int nFieldType)
+{
+ if(nFieldType <0 || nFieldType > 6) return;
+ switch(nFieldType)
+ {
+ case 0:
+ {
+ for(int i=0; i<6; i++)
+ {
+ m_aHighlightColor[i] = clr;
+ m_bNeedHightlight[i] = TRUE;
+ }
+ break;
+ }
+ default:
+ {
+ m_aHighlightColor[nFieldType-1] = clr;
+ m_bNeedHightlight[nFieldType-1] = TRUE;
+ break;
+ }
+ }
+
+}
+
+FX_COLORREF CPDFSDK_InterForm::GetHighlightColor(int nFieldType)
+{
+ if(nFieldType <0 || nFieldType >6) return FXSYS_RGB(255,255,255);
+ if(nFieldType == 0)
+ return m_aHighlightColor[0];
+ else
+ return m_aHighlightColor[nFieldType-1];
+}
+
+/* ------------------------- CBA_AnnotIterator ------------------------- */
+
+CBA_AnnotIterator::CBA_AnnotIterator(CPDFSDK_PageView* pPageView, const CFX_ByteString& sType, const CFX_ByteString& sSubType)
+ :m_pPageView(pPageView),
+ m_sType(sType),
+ m_sSubType(sSubType),
+ m_nTabs(BAI_STRUCTURE)
+{
+ ASSERT(m_pPageView != NULL);
+
+ CPDF_Page* pPDFPage = m_pPageView->GetPDFPage();
+ ASSERT(pPDFPage != NULL);
+ ASSERT(pPDFPage->m_pFormDict != NULL);
+
+ CFX_ByteString sTabs = pPDFPage->m_pFormDict->GetString("Tabs");
+
+ if (sTabs == "R")
+ {
+ m_nTabs = BAI_ROW;
+ }
+ else if (sTabs == "C")
+ {
+ m_nTabs = BAI_COLUMN;
+ }
+ else
+ {
+ m_nTabs = BAI_STRUCTURE;
+ }
+
+ GenerateResults();
+}
+
+CBA_AnnotIterator::~CBA_AnnotIterator()
+{
+ m_Annots.RemoveAll();
+}
+
+CPDFSDK_Annot* CBA_AnnotIterator::GetFirstAnnot()
+{
+ if (m_Annots.GetSize() > 0)
+ return m_Annots[0];
+
+ return NULL;
+}
+
+CPDFSDK_Annot* CBA_AnnotIterator::GetLastAnnot()
+{
+ if (m_Annots.GetSize() > 0)
+ return m_Annots[m_Annots.GetSize() - 1];
+
+ return NULL;
+}
+
+CPDFSDK_Annot* CBA_AnnotIterator::GetNextAnnot(CPDFSDK_Annot* pAnnot)
+{
+ for (int i=0,sz=m_Annots.GetSize(); i<sz; i++)
+ {
+ if (m_Annots[i] == pAnnot)
+ {
+ if (i+1 < sz)
+ return m_Annots[i+1];
+ else
+ return m_Annots[0];
+ }
+ }
+
+ return NULL;
+}
+
+CPDFSDK_Annot* CBA_AnnotIterator::GetPrevAnnot(CPDFSDK_Annot* pAnnot)
+{
+ for (int i=0,sz=m_Annots.GetSize(); i<sz; i++)
+ {
+ if (m_Annots[i] == pAnnot)
+ {
+ if (i-1 >= 0)
+ return m_Annots[i-1];
+ else
+ return m_Annots[sz-1];
+ }
+ }
+
+ return NULL;
+}
+
+int CBA_AnnotIterator::CompareByLeft(CPDFSDK_Annot* p1, CPDFSDK_Annot* p2)
+{
+ ASSERT(p1 != NULL);
+ ASSERT(p2 != NULL);
+
+ CPDF_Rect rcAnnot1 = GetAnnotRect(p1);
+ CPDF_Rect rcAnnot2 = GetAnnotRect(p2);
+
+ if (rcAnnot1.left < rcAnnot2.left)
+ return -1;
+ if (rcAnnot1.left > rcAnnot2.left)
+ return 1;
+ return 0;
+}
+
+
+int CBA_AnnotIterator::CompareByTop(CPDFSDK_Annot* p1, CPDFSDK_Annot* p2)
+{
+ ASSERT(p1 != NULL);
+ ASSERT(p2 != NULL);
+
+ CPDF_Rect rcAnnot1 = GetAnnotRect(p1);
+ CPDF_Rect rcAnnot2 = GetAnnotRect(p2);
+
+ if (rcAnnot1.top < rcAnnot2.top)
+ return -1;
+ if (rcAnnot1.top > rcAnnot2.top)
+ return 1;
+ return 0;
+}
+
+void CBA_AnnotIterator::GenerateResults()
+{
+ ASSERT(m_pPageView != NULL);
+
+ switch (m_nTabs)
+ {
+ case BAI_STRUCTURE:
+ {
+ for (int i=0,sz=m_pPageView->CountAnnots(); i<sz; i++)
+ {
+ CPDFSDK_Annot* pAnnot = m_pPageView->GetAnnot(i);
+ ASSERT(pAnnot != NULL);
+
+ if (pAnnot->GetType() == m_sType
+ && pAnnot->GetSubType() == m_sSubType)
+ m_Annots.Add(pAnnot);
+ }
+ }
+ break;
+ case BAI_ROW:
+ {
+ CPDFSDK_SortAnnots sa;
+
+ {
+
+ for (int i=0,sz=m_pPageView->CountAnnots(); i<sz; i++)
+ {
+ CPDFSDK_Annot* pAnnot = m_pPageView->GetAnnot(i);
+ ASSERT(pAnnot != NULL);
+
+ if (pAnnot->GetType() == m_sType
+ && pAnnot->GetSubType() == m_sSubType)
+ sa.Add(pAnnot);
+ }
+ }
+
+ if (sa.GetSize() > 0)
+ {
+ sa.Sort(CBA_AnnotIterator::CompareByLeft);
+ }
+
+ while (sa.GetSize() > 0)
+ {
+ int nLeftTopIndex = -1;
+
+ {
+ FX_FLOAT fTop = 0.0f;
+
+ for (int i=sa.GetSize()-1; i>=0; i--)
+ {
+ CPDFSDK_Annot* pAnnot = sa.GetAt(i);
+ ASSERT(pAnnot != NULL);
+
+ CPDF_Rect rcAnnot = GetAnnotRect(pAnnot);
+
+ if (rcAnnot.top > fTop)
+ {
+ nLeftTopIndex = i;
+ fTop = rcAnnot.top;
+ }
+ }
+ }
+
+ if (nLeftTopIndex >= 0)
+ {
+ CPDFSDK_Annot* pLeftTopAnnot = sa.GetAt(nLeftTopIndex);
+ ASSERT(pLeftTopAnnot != NULL);
+
+ CPDF_Rect rcLeftTop = GetAnnotRect(pLeftTopAnnot);
+
+ m_Annots.Add(pLeftTopAnnot);
+ sa.RemoveAt(nLeftTopIndex);
+
+ CFX_ArrayTemplate<int> aSelect;
+
+ {
+ for (int i=0,sz=sa.GetSize(); i<sz; i++)
+ {
+ CPDFSDK_Annot* pAnnot = sa.GetAt(i);
+ ASSERT(pAnnot != NULL);
+
+ CPDF_Rect rcAnnot = GetAnnotRect(pAnnot);
+
+ FX_FLOAT fCenterY = (rcAnnot.top + rcAnnot.bottom) / 2.0f;
+
+ if (fCenterY > rcLeftTop.bottom && fCenterY < rcLeftTop.top)
+ aSelect.Add(i);
+ }
+ }
+
+ {
+ for (int i=0,sz=aSelect.GetSize(); i<sz; i++)
+ {
+ m_Annots.Add(sa[aSelect[i]]);
+ }
+ }
+
+ {
+ for (int i=aSelect.GetSize()-1; i>=0; i--)
+ {
+ sa.RemoveAt(aSelect[i]);
+ }
+ }
+
+ aSelect.RemoveAll();
+ }
+ }
+ sa.RemoveAll();
+ }
+ break;
+ case BAI_COLUMN:
+ {
+ CPDFSDK_SortAnnots sa;
+
+ {
+ for (int i=0,sz=m_pPageView->CountAnnots(); i<sz; i++)
+ {
+ CPDFSDK_Annot* pAnnot = m_pPageView->GetAnnot(i);
+ ASSERT(pAnnot != NULL);
+
+ if (pAnnot->GetType() == m_sType
+ && pAnnot->GetSubType() == m_sSubType)
+ sa.Add(pAnnot);
+ }
+ }
+
+ if (sa.GetSize() > 0)
+ {
+ sa.Sort(CBA_AnnotIterator::CompareByTop, FALSE);
+ }
+
+ while (sa.GetSize() > 0)
+ {
+ int nLeftTopIndex = -1;
+
+ {
+ FX_FLOAT fLeft = -1.0f;
+
+ for (int i=sa.GetSize()-1; i>=0; i--)
+ {
+ CPDFSDK_Annot* pAnnot = sa.GetAt(i);
+ ASSERT(pAnnot != NULL);
+
+ CPDF_Rect rcAnnot = GetAnnotRect(pAnnot);
+
+ if (fLeft < 0)
+ {
+ nLeftTopIndex = 0;
+ fLeft = rcAnnot.left;
+ }
+ else if (rcAnnot.left < fLeft)
+ {
+ nLeftTopIndex = i;
+ fLeft = rcAnnot.left;
+ }
+ }
+ }
+
+ if (nLeftTopIndex >= 0)
+ {
+ CPDFSDK_Annot* pLeftTopAnnot = sa.GetAt(nLeftTopIndex);
+ ASSERT(pLeftTopAnnot != NULL);
+
+ CPDF_Rect rcLeftTop = GetAnnotRect(pLeftTopAnnot);
+
+ m_Annots.Add(pLeftTopAnnot);
+ sa.RemoveAt(nLeftTopIndex);
+
+ CFX_ArrayTemplate<int> aSelect;
+
+ {
+ for (int i=0,sz=sa.GetSize(); i<sz; i++)
+ {
+ CPDFSDK_Annot* pAnnot = sa.GetAt(i);
+ ASSERT(pAnnot != NULL);
+
+ CPDF_Rect rcAnnot = GetAnnotRect(pAnnot);
+
+ FX_FLOAT fCenterX = (rcAnnot.left + rcAnnot.right) / 2.0f;
+
+ if (fCenterX > rcLeftTop.left && fCenterX < rcLeftTop.right)
+ aSelect.Add(i);
+ }
+ }
+
+ {
+ for (int i=0,sz=aSelect.GetSize(); i<sz; i++)
+ {
+ m_Annots.Add(sa[aSelect[i]]);
+ }
+ }
+
+ {
+ for (int i=aSelect.GetSize()-1; i>=0; i--)
+ {
+ sa.RemoveAt(aSelect[i]);
+ }
+ }
+
+ aSelect.RemoveAll();
+ }
+ }
+ sa.RemoveAll();
+ }
+ break;
+ }
+}
+
+CPDF_Rect CBA_AnnotIterator::GetAnnotRect(CPDFSDK_Annot* pAnnot)
+{
+ ASSERT(pAnnot != NULL);
+
+ CPDF_Annot* pPDFAnnot = pAnnot->GetPDFAnnot();
+ ASSERT(pPDFAnnot != NULL);
+
+ CPDF_Rect rcAnnot;
+ pPDFAnnot->GetRect(rcAnnot);
+
+ return rcAnnot;
+}
+
diff --git a/fpdfsdk/src/fsdk_mgr.cpp b/fpdfsdk/src/fsdk_mgr.cpp
index 9a11927fab..9052c37d02 100644
--- a/fpdfsdk/src/fsdk_mgr.cpp
+++ b/fpdfsdk/src/fsdk_mgr.cpp
@@ -1,1055 +1,1055 @@
-// 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
-
-#include "../include/fsdk_define.h"
-#include "../include/fsdk_mgr.h"
-#include "../include/fpdf_ext.h"
-#include "../include/formfiller/FFL_FormFiller.h"
-#include "../include/javascript/IJavaScript.h"
-
-#if _FX_OS_ == _FX_ANDROID_
-#include "time.h"
-#else
-#include <ctime>
-#endif
-
-//extern CPDFDoc_Environment* g_pFormFillApp;
-class CFX_SystemHandler:public IFX_SystemHandler
-{
-public:
- CFX_SystemHandler(CPDFDoc_Environment* pEnv):m_pEnv(pEnv),m_nCharSet(-1) {}
-public:
- virtual void InvalidateRect(FX_HWND hWnd, FX_RECT rect) ;
- virtual void OutputSelectedRect(void* pFormFiller, CPDF_Rect& rect);
-
- virtual FX_BOOL IsSelectionImplemented();
-
- virtual CFX_WideString GetClipboardText(FX_HWND hWnd){return L"";}
- virtual FX_BOOL SetClipboardText(FX_HWND hWnd, CFX_WideString string) {return FALSE;}
-
- virtual void ClientToScreen(FX_HWND hWnd, FX_INT32& x, FX_INT32& y) {}
- virtual void ScreenToClient(FX_HWND hWnd, FX_INT32& x, FX_INT32& y) {}
-
- /*cursor style
- FXCT_ARROW
- FXCT_NESW
- FXCT_NWSE
- FXCT_VBEAM
- FXCT_HBEAM
- FXCT_HAND
- */
- virtual void SetCursor(FX_INT32 nCursorType);
-
- virtual FX_HMENU CreatePopupMenu() {return NULL;}
- virtual FX_BOOL AppendMenuItem(FX_HMENU hMenu, FX_INT32 nIDNewItem, CFX_WideString string) {return FALSE;}
- virtual FX_BOOL EnableMenuItem(FX_HMENU hMenu, FX_INT32 nIDItem, FX_BOOL bEnabled) {return FALSE;}
- virtual FX_INT32 TrackPopupMenu(FX_HMENU hMenu, FX_INT32 x, FX_INT32 y, FX_HWND hParent) {return -1;}
- virtual void DestroyMenu(FX_HMENU hMenu) {}
-
- virtual CFX_ByteString GetNativeTrueTypeFont(FX_INT32 nCharset);
- virtual FX_BOOL FindNativeTrueTypeFont(FX_INT32 nCharset, CFX_ByteString sFontFaceName);
- virtual CPDF_Font* AddNativeTrueTypeFontToPDF(CPDF_Document* pDoc, CFX_ByteString sFontFaceName, FX_BYTE nCharset);
-
- virtual FX_INT32 SetTimer(FX_INT32 uElapse, TimerCallback lpTimerFunc) ;
- virtual void KillTimer(FX_INT32 nID) ;
-
-
- virtual FX_BOOL IsSHIFTKeyDown(FX_DWORD nFlag) {return m_pEnv->FFI_IsSHIFTKeyDown(nFlag);}
- virtual FX_BOOL IsCTRLKeyDown(FX_DWORD nFlag) {return m_pEnv->FFI_IsCTRLKeyDown(nFlag);}
- virtual FX_BOOL IsALTKeyDown(FX_DWORD nFlag) {return m_pEnv->FFI_IsALTKeyDown(nFlag);}
- virtual FX_BOOL IsINSERTKeyDown(FX_DWORD nFlag) {return m_pEnv->FFI_IsINSERTKeyDown(nFlag);}
-
- virtual FX_SYSTEMTIME GetLocalTime();
-
- virtual FX_INT32 GetCharSet() {return m_nCharSet;}
- virtual void SetCharSet(FX_INT32 nCharSet) {m_nCharSet = nCharSet;}
-private:
- CPDFDoc_Environment* m_pEnv;
- int m_nCharSet;
-};
-
-void CFX_SystemHandler::SetCursor(FX_INT32 nCursorType)
-{
-
- m_pEnv->FFI_SetCursor(nCursorType);
-}
-
-void CFX_SystemHandler::InvalidateRect(FX_HWND hWnd, FX_RECT rect)
-{
- //g_pFormFillApp->FFI_Invalidate();
- CPDFSDK_Annot* pSDKAnnot = (CPDFSDK_Annot*)hWnd;
- CPDF_Page* pPage = NULL;
- CPDFSDK_PageView* pPageView = NULL;
- pPageView = pSDKAnnot->GetPageView();
- pPage = pSDKAnnot->GetPDFPage();
- if(!pPage || !pPageView)
- return;
- CPDF_Matrix page2device;
- pPageView->GetCurrentMatrix(page2device);
- CPDF_Matrix device2page;
- device2page.SetReverse(page2device);
- FX_FLOAT left, top, right,bottom;
- device2page.Transform((FX_FLOAT)rect.left, (FX_FLOAT)rect.top, left, top);
- device2page.Transform((FX_FLOAT)rect.right, (FX_FLOAT)rect.bottom, right, bottom);
-// m_pEnv->FFI_DeviceToPage(pPage, rect.left, rect.top, (double*)&left, (double*)&top);
-// m_pEnv->FFI_DeviceToPage(pPage, rect.right, rect.bottom, (double*)&right, (double*)&bottom);
- CPDF_Rect rcPDF(left, bottom, right, top);
- rcPDF.Normalize();
-
- m_pEnv->FFI_Invalidate(pPage, rcPDF.left, rcPDF.top, rcPDF.right, rcPDF.bottom);
-}
-void CFX_SystemHandler::OutputSelectedRect(void* pFormFiller, CPDF_Rect& rect)
-{
- CFFL_FormFiller* pFFL = (CFFL_FormFiller*)pFormFiller;
- if(pFFL)
- {
- CPDF_Point leftbottom = CPDF_Point(rect.left, rect.bottom);
- CPDF_Point righttop = CPDF_Point(rect.right, rect.top);
- CPDF_Point ptA = pFFL->PWLtoFFL(leftbottom);
- CPDF_Point ptB = pFFL->PWLtoFFL(righttop);
-
-
- CPDFSDK_Annot* pAnnot = pFFL->GetSDKAnnot();
- ASSERT(pAnnot);
- CPDF_Page* pPage = pAnnot->GetPDFPage();
- ASSERT(pPage);
- m_pEnv->FFI_OutputSelectedRect(pPage, ptA.x, ptB.y, ptB.x, ptA.y);
- }
-
-}
-
-FX_BOOL CFX_SystemHandler::IsSelectionImplemented()
-{
- if(m_pEnv)
- {
- FPDF_FORMFILLINFO* pInfo = m_pEnv->GetFormFillInfo();
- if(pInfo && pInfo->FFI_OutputSelectedRect)
- return TRUE;
- }
- return FALSE;
-}
-
-CFX_ByteString CFX_SystemHandler::GetNativeTrueTypeFont(FX_INT32 nCharset)
-{
- return "";
-}
-
-FX_BOOL CFX_SystemHandler::FindNativeTrueTypeFont(FX_INT32 nCharset, CFX_ByteString sFontFaceName)
-{
- CFX_FontMgr* pFontMgr = CFX_GEModule::Get()->GetFontMgr();
-// FXFT_Face nFace = pFontMgr->FindSubstFont(sFontFaceName,TRUE,0,0,0,0,NULL);
-// FXFT_Face nFace = pFontMgr->m_pBuiltinMapper->FindSubstFont(sFontFaceName,TRUE,0,0,0,0,NULL);
-
- if(pFontMgr)
- {
- CFX_FontMapper* pFontMapper = pFontMgr->m_pBuiltinMapper;
- if(pFontMapper)
- {
- int nSize = pFontMapper->m_InstalledTTFonts.GetSize();
- if(nSize ==0)
- {
- pFontMapper->LoadInstalledFonts();
- nSize = pFontMapper->m_InstalledTTFonts.GetSize();
- }
-
- for(int i=0; i<nSize; i++)
- {
- if(pFontMapper->m_InstalledTTFonts[i].Compare(sFontFaceName))
- return TRUE;
- }
- }
-
- }
-
- return FALSE;
-// pFontMgr->m_FaceMap.Lookup(sFontFaceName,pFont);
-// return (pFont!=NULL);
-}
-
-static int CharSet2CP(int charset)
-{
- if(charset == 128)
- return 932;
- else if(charset == 134)
- return 936;
- else if(charset == 129)
- return 949;
- else if(charset == 136)
- return 950;
- return 0;
-}
-CPDF_Font* CFX_SystemHandler::AddNativeTrueTypeFontToPDF(CPDF_Document* pDoc, CFX_ByteString sFontFaceName,
- FX_BYTE nCharset)
-{
- if(pDoc)
- {
- CFX_Font* pFXFont = new CFX_Font();
- pFXFont->LoadSubst(sFontFaceName,TRUE,0,0,0,CharSet2CP(nCharset),FALSE);
- CPDF_Font* pFont = pDoc->AddFont(pFXFont,nCharset,FALSE);
- delete pFXFont;
- return pFont;
- }
-
- return NULL;
-}
-
-
-FX_INT32 CFX_SystemHandler::SetTimer(FX_INT32 uElapse, TimerCallback lpTimerFunc)
-{
- return m_pEnv->FFI_SetTimer(uElapse, lpTimerFunc);
-}
-void CFX_SystemHandler::KillTimer(FX_INT32 nID)
-{
- m_pEnv->FFI_KillTimer(nID);
-}
-
-FX_SYSTEMTIME CFX_SystemHandler::GetLocalTime()
-{
- return m_pEnv->FFI_GetLocalTime();
-}
-
-
-CJS_RuntimeFactory* GetJSRuntimeFactory()
-{
- static CJS_RuntimeFactory s_JSRuntimeFactory;
- return &s_JSRuntimeFactory;
-}
-
-CPDFDoc_Environment::CPDFDoc_Environment(CPDF_Document * pDoc):m_pInfo(NULL),m_pIFormFiller(NULL),
- m_pAnnotHandlerMgr(NULL),m_pActionHandler(NULL),m_pJSRuntime(NULL),
- m_pSDKDoc(NULL), m_pPDFDoc(pDoc)
-{
-
- m_pSysHandler = NULL;
- m_pSysHandler = new CFX_SystemHandler(this);
-
-
- m_pJSRuntimeFactory = NULL;
- m_pJSRuntimeFactory = GetJSRuntimeFactory();
- m_pJSRuntimeFactory->AddRef();
-}
-
-CPDFDoc_Environment::~CPDFDoc_Environment()
-{
-
- if ( m_pIFormFiller )
- {
- delete m_pIFormFiller;
- m_pIFormFiller = NULL;
- }
- if(m_pJSRuntime && m_pJSRuntimeFactory)
- m_pJSRuntimeFactory->DeleteJSRuntime(m_pJSRuntime);
- m_pJSRuntimeFactory->Release();
-
- if(m_pSysHandler)
- {
- delete m_pSysHandler;
- m_pSysHandler = NULL;
- }
-
- if(m_pAnnotHandlerMgr)
- {
- delete m_pAnnotHandlerMgr;
- m_pAnnotHandlerMgr = NULL;
- }
- if(m_pActionHandler)
- {
- delete m_pActionHandler;
- m_pActionHandler = NULL;
- }
-
-
-}
-
-
-IFXJS_Runtime* CPDFDoc_Environment::GetJSRuntime()
-{
- if(!IsJSInitiated())
- return NULL;
- assert(m_pJSRuntimeFactory);
- if(!m_pJSRuntime)
- m_pJSRuntime = m_pJSRuntimeFactory->NewJSRuntime(this);
- return m_pJSRuntime;
-}
-
-CPDFSDK_AnnotHandlerMgr* CPDFDoc_Environment::GetAnnotHandlerMgr()
-{
- if(!m_pAnnotHandlerMgr)
- m_pAnnotHandlerMgr = new CPDFSDK_AnnotHandlerMgr(this);
- return m_pAnnotHandlerMgr;
-}
-
-CPDFSDK_ActionHandler* CPDFDoc_Environment::GetActionHander()
-{
- if(!m_pActionHandler)
- m_pActionHandler = new CPDFSDK_ActionHandler(this);
- return m_pActionHandler;
-}
-
-int CPDFDoc_Environment::RegAppHandle(FPDF_FORMFILLINFO* pFFinfo)
-{
- m_pInfo = pFFinfo;
- return TRUE;
-}
-
-CPDFSDK_Document* CPDFDoc_Environment::GetCurrentDoc()
-{
- return m_pSDKDoc;
-}
-
-CFFL_IFormFiller* CPDFDoc_Environment::GetIFormFiller()
-{
- if(!m_pIFormFiller)
- m_pIFormFiller = new CFFL_IFormFiller(this);
- return m_pIFormFiller;
-}
-
-FX_BOOL CPDFDoc_Environment::IsJSInitiated()
-{
- if(m_pInfo)
- {
- if(m_pInfo->m_pJsPlatform)
- return TRUE;
- else
- return FALSE;
- }
- return FALSE;
-}
-
-CPDFSDK_Document::CPDFSDK_Document(CPDF_Document* pDoc,CPDFDoc_Environment* pEnv):m_pDoc(pDoc),
- m_pInterForm(NULL),m_pEnv(pEnv),m_pOccontent(NULL),m_bChangeMask(FALSE)
-{
- m_pFocusAnnot = NULL;
-}
-
-CPDFSDK_Document::~CPDFSDK_Document()
-{
- m_pageMap.RemoveAll();
- if(m_pInterForm)
- {
- m_pInterForm->Destroy();
- m_pInterForm = NULL;
- }
- if(m_pOccontent)
- {
- delete m_pOccontent;
- m_pOccontent = NULL;
- }
-}
-
-void CPDFSDK_Document::InitPageView()
-{
- int nCount = m_pDoc->GetPageCount();
- for(int i=0; i<nCount; i++)
- {
- // To do
-// CPDF_Dictionary* pDic = m_pDoc->GetPage(i);
-// m_pageMap.SetAt(pDic, pPageView);
- }
-}
-
-void CPDFSDK_Document::AddPageView(CPDF_Page* pPDFPage, CPDFSDK_PageView* pPageView)
-{
- m_pageMap.SetAt(pPDFPage, pPageView);
-}
-
-CPDFSDK_PageView* CPDFSDK_Document::GetPageView(CPDF_Page* pPDFPage, FX_BOOL ReNew)
-{
- CPDFSDK_PageView* pPageView = (CPDFSDK_PageView*)m_pageMap.GetValueAt(pPDFPage);
- if(pPageView != NULL)
- return pPageView;
- if(ReNew)
- {
- pPageView = new CPDFSDK_PageView(this,pPDFPage);
- m_pageMap.SetAt(pPDFPage, pPageView);
- //Delay to load all the annotations, to avoid endless loop.
- pPageView->LoadFXAnnots();
- }
- return pPageView;
-
-}
-
-CPDFSDK_PageView* CPDFSDK_Document::GetCurrentView()
-{
- CPDF_Page * pPage = (CPDF_Page *)m_pEnv->FFI_GetCurrentPage(m_pDoc);
- if(pPage)
- return this->GetPageView(pPage, TRUE);
- return NULL;
-}
-
-CPDFSDK_PageView* CPDFSDK_Document::GetPageView(int nIndex)
-{
- CPDFSDK_PageView * pTempPageView = NULL;
- CPDF_Page * pTempPage = (CPDF_Page*)m_pEnv->FFI_GetPage(m_pDoc,nIndex);
- if(!pTempPage)
- return NULL;
-
- m_pageMap.Lookup(pTempPage, pTempPageView);
-
- ASSERT(pTempPageView != NULL);
-
- return pTempPageView;
-}
-
-void CPDFSDK_Document:: ProcJavascriptFun()
-{
- CPDF_Document* pPDFDoc = this->GetDocument();
- CPDF_DocJSActions docJS(pPDFDoc);
- int iCount = docJS.CountJSActions();
- if (iCount < 1) return;
- for (int i = 0; i < iCount; i ++)
- {
- CFX_ByteString csJSName;
- CPDF_Action jsAction = docJS.GetJSAction(i, csJSName);
- if(m_pEnv->GetActionHander())
- m_pEnv->GetActionHander()->DoAction_JavaScript(jsAction,CFX_WideString::FromLocal(csJSName),this);
- }
-
-}
-
-FX_BOOL CPDFSDK_Document::ProcOpenAction()
-{
- if(!m_pDoc) return FALSE;
-
- CPDF_Dictionary* pRoot = m_pDoc->GetRoot();
- if (!pRoot) return FALSE;
- CPDF_Object* pOpenAction = pRoot->GetDict("OpenAction");//
- if(!pOpenAction) pOpenAction = pRoot->GetArray("OpenAction");//
- if(!pOpenAction) return FALSE;
-
- if(pOpenAction->GetType()==PDFOBJ_ARRAY)
- {
- }
- else if(pOpenAction->GetType()==PDFOBJ_DICTIONARY)
- {
- CPDF_Dictionary * pDict=(CPDF_Dictionary*)pOpenAction;
- CPDF_Action Action = pDict;
-
- if(m_pEnv->GetActionHander())
- m_pEnv->GetActionHander()->DoAction_DocOpen(Action,this);
- }
- else
- {
- return FALSE;
- }
- return TRUE;
-}
-
-CPDF_OCContext* CPDFSDK_Document::GetOCContext()
-{
- if(!m_pOccontent)
- m_pOccontent = new CPDF_OCContext(m_pDoc);
- return m_pOccontent;
-}
-
-void CPDFSDK_Document::ReMovePageView(CPDF_Page* pPDFPage)
-{
- CPDFSDK_PageView* pPageView = (CPDFSDK_PageView*)m_pageMap.GetValueAt(pPDFPage);
- if(pPageView)
- {
- delete pPageView;
- m_pageMap.RemoveKey(pPDFPage);
- }
-}
-
-CPDF_Page * CPDFSDK_Document::GetPage(int nIndex)
-{
- CPDF_Page * pTempPage = (CPDF_Page*)m_pEnv->FFI_GetPage(m_pDoc,nIndex);
- if(!pTempPage)
- return NULL;
- return pTempPage;
-}
-
-CPDFSDK_InterForm* CPDFSDK_Document::GetInterForm()
-{
- if(!m_pInterForm)
- m_pInterForm = new CPDFSDK_InterForm(this);
- return m_pInterForm;
-}
-
-void CPDFSDK_Document::UpdateAllViews(CPDFSDK_PageView* pSender, CPDFSDK_Annot* pAnnot)
-{
-
- FX_POSITION pos = m_pageMap.GetStartPosition();
- CPDF_Page * pPage = NULL;
- CPDFSDK_PageView * pPageView = NULL;
- while(pos)
- {
- m_pageMap.GetNextAssoc(pos, pPage, pPageView);
-
- if(pPageView != pSender)
- {
- pPageView->UpdateView(pAnnot);
- }
- }
-}
-
-CPDFSDK_Annot* CPDFSDK_Document::GetFocusAnnot()
-{
- return this->m_pFocusAnnot;
-}
-
-FX_BOOL CPDFSDK_Document::SetFocusAnnot(CPDFSDK_Annot* pAnnot,FX_UINT nFlag)
-{
-
- if(m_pFocusAnnot==pAnnot) return TRUE;
-
- if(m_pFocusAnnot)
- {
- if(!this->KillFocusAnnot(nFlag) ) return FALSE;
- }
- CPDFSDK_PageView* pPageView = pAnnot->GetPageView();
- if(pAnnot && pPageView->IsValid())
- {
- CPDFSDK_AnnotHandlerMgr *pAnnotHandler=m_pEnv->GetAnnotHandlerMgr();
-
- if(pAnnotHandler&&!m_pFocusAnnot)
- {
- if (!pAnnotHandler->Annot_OnSetFocus(pAnnot,nFlag))
- return FALSE;
- if(!m_pFocusAnnot)
- {
- this->m_pFocusAnnot=pAnnot;
- return TRUE;
- }
- }
- }
- return FALSE;
-}
-
-FX_BOOL CPDFSDK_Document::KillFocusAnnot(FX_UINT nFlag)
-{
- if(m_pFocusAnnot)
- {
- CPDFSDK_AnnotHandlerMgr *pAnnotHandler=m_pEnv->GetAnnotHandlerMgr();
- if(pAnnotHandler)
- {
- CPDFSDK_Annot* pFocusAnnot = m_pFocusAnnot;
- m_pFocusAnnot = NULL;
- if(pAnnotHandler->Annot_OnKillFocus(pFocusAnnot, nFlag))
- {
-
- if(pFocusAnnot->GetType() == FX_BSTRC("Widget"))
- {
- CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pFocusAnnot;
- int nFieldType = pWidget->GetFieldType();
- if(FIELDTYPE_TEXTFIELD == nFieldType || FIELDTYPE_COMBOBOX == nFieldType)
- m_pEnv->FFI_OnSetFieldInputFocus(NULL, NULL, 0, FALSE);
- }
-
- if(!m_pFocusAnnot)
- return TRUE;
- }
- else
- {
- m_pFocusAnnot = pFocusAnnot;
- }
- }
- }
- return FALSE;
-}
-
-FX_BOOL CPDFSDK_Document::DeletePages(int nStart, int nCount)
-{
- if ( nStart < 0 || nStart >= GetPageCount() || nCount <= 0 )
- {
- return FALSE;
- }
-
- CPDF_Page * pTempPage = NULL;
- for ( int i = nCount-1; i >= 0; i-- )
- {
- pTempPage = GetPage(nStart+i);
- if ( pTempPage != NULL )
- {
- ReMovePageView(pTempPage);
- }
- }
- return TRUE;
-}
-
-void CPDFSDK_Document::OnCloseDocument()
-{
- KillFocusAnnot();
-}
-
-FX_BOOL CPDFSDK_Document::GetPermissions(int nFlag)
-{
- FX_DWORD dwPermissions = m_pDoc->GetUserPermissions();
- return dwPermissions&nFlag;
-}
-
-IFXJS_Runtime * CPDFSDK_Document::GetJsRuntime()
-{
- ASSERT(m_pEnv!=NULL);
- return m_pEnv->GetJSRuntime();
-}
-
-CFX_WideString CPDFSDK_Document::GetPath()
-{
- ASSERT(m_pEnv != NULL);
- return m_pEnv->JS_docGetFilePath();
-}
-
-
-CPDFSDK_PageView::CPDFSDK_PageView(CPDFSDK_Document* pSDKDoc,CPDF_Page* page):m_pSDKDoc(pSDKDoc),m_page(page)
-{
- CPDFSDK_InterForm* pInterForm = pSDKDoc->GetInterForm();
- if(pInterForm)
- {
- CPDF_InterForm* pPDFInterForm = pInterForm->GetInterForm();
- pPDFInterForm->FixPageFields(page);
- }
-
- m_fxAnnotArray.RemoveAll();
-
- m_bEnterWidget = FALSE;
- m_bExitWidget = FALSE;
- m_bOnWidget = FALSE;
- m_CaptureWidget = NULL;
- m_bValid = FALSE;
-}
-
-CPDFSDK_PageView::~CPDFSDK_PageView()
-{
- CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
- int nAnnotCount = m_fxAnnotArray.GetSize();
- for (int i=0; i<nAnnotCount; i++)
- {
- CPDFSDK_Annot* pAnnot = (CPDFSDK_Annot*)m_fxAnnotArray.GetAt(i);
- //if there is a focused annot on the page, we should kill the focus first.
- if(pAnnot == m_pSDKDoc->GetFocusAnnot())
- KillFocusAnnot();
- CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr();
- ASSERT(pAnnotHandlerMgr);
- pAnnotHandlerMgr->ReleaseAnnot(pAnnot);
- }
- m_fxAnnotArray.RemoveAll();
- if(m_pAnnotList)
- {
- delete m_pAnnotList;
- m_pAnnotList = NULL;
- }
-}
-
-void CPDFSDK_PageView::PageView_OnDraw(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,CPDF_RenderOptions* pOptions)
-{
- m_curMatrix = *pUser2Device;
-
- // m_pAnnotList->DisplayAnnots(m_page, pDevice, pUser2Device, FALSE, pOptions);
- CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
- CPDFSDK_AnnotIterator annotIterator(this, TRUE);
- CPDFSDK_Annot * pSDKAnnot=NULL;
- int index=-1;
- while((pSDKAnnot = annotIterator.Next(index)))
- {
- CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr();
- ASSERT(pAnnotHandlerMgr);
- pAnnotHandlerMgr->Annot_OnDraw(this, pSDKAnnot, pDevice, pUser2Device, 0);
- }
-
-}
-
-CPDF_Annot* CPDFSDK_PageView::GetPDFAnnotAtPoint(FX_FLOAT pageX, FX_FLOAT pageY)
-{
-
- int nCount = m_pAnnotList->Count();
- for(int i = 0 ; i<nCount; i++)
- {
- CPDF_Annot* pAnnot = m_pAnnotList->GetAt(i);
- CFX_FloatRect annotRect;
- pAnnot->GetRect(annotRect);
- if(annotRect.Contains(pageX, pageY))
- return pAnnot;
- }
- return NULL;
-}
-
-CPDF_Annot* CPDFSDK_PageView::GetPDFWidgetAtPoint(FX_FLOAT pageX, FX_FLOAT pageY)
-{
-
- int nCount = m_pAnnotList->Count();
- for(int i = 0 ; i<nCount; i++)
- {
- CPDF_Annot* pAnnot = m_pAnnotList->GetAt(i);
- if(pAnnot->GetSubType() == "Widget")
- {
- CFX_FloatRect annotRect;
- pAnnot->GetRect(annotRect);
- if(annotRect.Contains(pageX, pageY))
- return pAnnot;
- }
- }
- return NULL;
-}
-
-CPDFSDK_Annot* CPDFSDK_PageView::GetFXAnnotAtPoint(FX_FLOAT pageX, FX_FLOAT pageY)
-{
-
- CPDFSDK_AnnotIterator annotIterator(this, FALSE);
- CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
- CPDFSDK_AnnotHandlerMgr* pAnnotMgr = pEnv->GetAnnotHandlerMgr();
- CPDFSDK_Annot* pSDKAnnot = NULL;
- int index = -1;
- while((pSDKAnnot = annotIterator.Next(index)))
- {
- CPDF_Rect rc = pAnnotMgr->Annot_OnGetViewBBox(this, pSDKAnnot);
- if(rc.Contains(pageX, pageY))
- return pSDKAnnot;
- }
-
- return NULL;
-}
-
-CPDFSDK_Annot* CPDFSDK_PageView::GetFXWidgetAtPoint(FX_FLOAT pageX, FX_FLOAT pageY)
-{
-
- CPDFSDK_AnnotIterator annotIterator(this, FALSE);
- CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
- CPDFSDK_AnnotHandlerMgr* pAnnotMgr = pEnv->GetAnnotHandlerMgr();
- CPDFSDK_Annot* pSDKAnnot = NULL;
- int index = -1;
- while((pSDKAnnot = annotIterator.Next(index)))
- {
- if(pSDKAnnot->GetType() == "Widget")
- {
- pAnnotMgr->Annot_OnGetViewBBox(this, pSDKAnnot);
- CPDF_Point point(pageX, pageY);
- if (pAnnotMgr->Annot_OnHitTest(this, pSDKAnnot, point))
-// if(rc.Contains(pageX, pageY))
- return pSDKAnnot;
- }
- }
-
- return NULL;
-}
-
-
-FX_BOOL CPDFSDK_PageView::Annot_HasAppearance(CPDF_Annot* pAnnot)
-{
- CPDF_Dictionary* pAnnotDic = pAnnot->m_pAnnotDict;
- if(pAnnotDic)
- return pAnnotDic->KeyExist("AS");
- return FALSE;
-}
-
-CPDFSDK_Annot* CPDFSDK_PageView::AddAnnot(CPDF_Annot * pPDFAnnot)
-{
- CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
- ASSERT(pEnv);
- CPDFSDK_AnnotHandlerMgr * pAnnotHandler= pEnv->GetAnnotHandlerMgr();
-
- CPDFSDK_Annot* pSDKAnnot =NULL;
-
- if(pAnnotHandler)
- {
- pSDKAnnot = pAnnotHandler->NewAnnot(pPDFAnnot, this);
- }
- if(!pSDKAnnot)
- return NULL;
-
- m_fxAnnotArray.Add(pSDKAnnot);
-
- if(pAnnotHandler)
- {
- pAnnotHandler->Annot_OnCreate(pSDKAnnot);
-
- }
-
- return pSDKAnnot;
-}
-
-CPDFSDK_Annot* CPDFSDK_PageView::AddAnnot(CPDF_Dictionary * pDict)
-{
- if(pDict)
- return this->AddAnnot(pDict->GetString("Subtype"),pDict);
- return NULL;
-}
-
-CPDFSDK_Annot* CPDFSDK_PageView::AddAnnot(FX_LPCSTR lpSubType,CPDF_Dictionary * pDict)
-{
- return NULL;
-}
-
-FX_BOOL CPDFSDK_PageView::DeleteAnnot(CPDFSDK_Annot* pAnnot)
-{
- return FALSE;
-}
-
-CPDF_Document* CPDFSDK_PageView::GetPDFDocument()
-{
- if(m_page)
- {
- return m_page->m_pDocument;
- }
- return NULL;
-}
-
-int CPDFSDK_PageView::CountAnnots()
-{
- return m_pAnnotList->Count();
-}
-
-CPDFSDK_Annot* CPDFSDK_PageView::GetAnnot(int nIndex)
-{
- int nCount = m_fxAnnotArray.GetSize();
- if ( nIndex < 0 || nIndex >= nCount )
- {
- return NULL;
- }
-
- return (CPDFSDK_Annot*)m_fxAnnotArray.GetAt(nIndex);
-}
-
-CPDFSDK_Annot* CPDFSDK_PageView::GetAnnotByDict(CPDF_Dictionary * pDict)
-{
- int nCount = m_fxAnnotArray.GetSize();
- for(int i=0; i<nCount; i++)
- {
- CPDFSDK_Annot* pAnnot = (CPDFSDK_Annot*)m_fxAnnotArray.GetAt(i);
- if(pDict==pAnnot->GetPDFAnnot()->m_pAnnotDict)
- return pAnnot;
- }
- return NULL;
-}
-
-FX_BOOL CPDFSDK_PageView::OnLButtonDown(const CPDF_Point & point, FX_UINT nFlag)
-{
- CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
- ASSERT(pEnv);
- CPDFSDK_Annot* pFXAnnot = GetFXWidgetAtPoint(point.x, point.y);
- if(!pFXAnnot)
- {
- KillFocusAnnot(nFlag);
- }
- else
- {
- CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr();
- ASSERT(pAnnotHandlerMgr);
-
- FX_BOOL bRet = pAnnotHandlerMgr->Annot_OnLButtonDown(this, pFXAnnot, nFlag,point);
- if(bRet)
- {
- SetFocusAnnot(pFXAnnot);
- }
- return bRet;
- }
- return FALSE;
-}
-
-
-FX_BOOL CPDFSDK_PageView::OnLButtonUp(const CPDF_Point & point, FX_UINT nFlag)
-{
- CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
- ASSERT(pEnv);
- CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr();
- ASSERT(pAnnotHandlerMgr);
- CPDFSDK_Annot* pFXAnnot = GetFXWidgetAtPoint(point.x, point.y);
- CPDFSDK_Annot* pFocusAnnot = GetFocusAnnot();
- FX_BOOL bRet = FALSE;
- if(pFocusAnnot && pFocusAnnot != pFXAnnot)
- {
- //Last focus Annot gets a chance to handle the event.
- bRet = pAnnotHandlerMgr->Annot_OnLButtonUp(this, pFocusAnnot, nFlag,point);
- }
- if(pFXAnnot && !bRet)
- {
- bRet = pAnnotHandlerMgr->Annot_OnLButtonUp(this, pFXAnnot, nFlag,point);
- return bRet;
- }
- return bRet;
-}
-
-FX_BOOL CPDFSDK_PageView::OnMouseMove(const CPDF_Point & point, int nFlag)
-{
-
- CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
- CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr();
- ASSERT(pAnnotHandlerMgr);
- if(CPDFSDK_Annot* pFXAnnot = GetFXWidgetAtPoint(point.x, point.y))
- {
- if(m_CaptureWidget && m_CaptureWidget != pFXAnnot)
- {
- m_bExitWidget = TRUE;
- m_bEnterWidget = FALSE;
- pAnnotHandlerMgr->Annot_OnMouseExit(this, m_CaptureWidget, nFlag);
- }
- m_CaptureWidget = (CPDFSDK_Widget*)pFXAnnot;
- m_bOnWidget = TRUE;
- if(!m_bEnterWidget)
- {
- m_bEnterWidget = TRUE;
- m_bExitWidget = FALSE;
- pAnnotHandlerMgr->Annot_OnMouseEnter(this, pFXAnnot,nFlag);
- }
- pAnnotHandlerMgr->Annot_OnMouseMove(this, pFXAnnot, nFlag, point);
- return TRUE;
- }
- else
- {
- if(m_bOnWidget)
- {
- m_bOnWidget = FALSE;
- m_bExitWidget = TRUE;
- m_bEnterWidget = FALSE;
- if(m_CaptureWidget)
- {
- pAnnotHandlerMgr->Annot_OnMouseExit(this, m_CaptureWidget, nFlag);
- m_CaptureWidget = NULL;
- }
- }
- return FALSE;
- }
-
- return FALSE;;
-}
-
-FX_BOOL CPDFSDK_PageView::OnMouseWheel(double deltaX, double deltaY,const CPDF_Point& point, int nFlag)
-{
- if(CPDFSDK_Annot* pAnnot = GetFXWidgetAtPoint(point.x, point.y))
- {
- CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
- CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr();
- ASSERT(pAnnotHandlerMgr);
- return pAnnotHandlerMgr->Annot_OnMouseWheel(this, pAnnot, nFlag, (int)deltaY, point);
- }
- return FALSE;
-
-}
-
-FX_BOOL CPDFSDK_PageView::OnChar(int nChar, FX_UINT nFlag)
-{
- if(CPDFSDK_Annot* pAnnot = GetFocusAnnot())
- {
- CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
- CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr();
- ASSERT(pAnnotHandlerMgr);
- return pAnnotHandlerMgr->Annot_OnChar(pAnnot, nChar, nFlag);
- }
-
- return FALSE;
-}
-
-FX_BOOL CPDFSDK_PageView::OnKeyDown(int nKeyCode, int nFlag)
-{
- if(CPDFSDK_Annot* pAnnot = GetFocusAnnot())
- {
- CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
- CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr();
- ASSERT(pAnnotHandlerMgr);
- return pAnnotHandlerMgr->Annot_OnKeyDown(pAnnot, nKeyCode, nFlag);
- }
- return FALSE;
-}
-
-FX_BOOL CPDFSDK_PageView::OnKeyUp(int nKeyCode, int nFlag)
-{
-// if(CPDFSDK_Annot* pAnnot = GetFocusAnnot())
-// {
-// CFFL_IFormFiller* pIFormFiller = g_pFormFillApp->GetIFormFiller();
-// return pIFormFiller->OnKeyUp(pAnnot, nKeyCode, nFlag);
-// }
- return FALSE;
-}
-
-extern void CheckUnSupportAnnot(CPDF_Document * pDoc, CPDF_Annot* pPDFAnnot);
-
-void CPDFSDK_PageView::LoadFXAnnots()
-{
- CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
-
- FX_BOOL enableAPUpdate = CPDF_InterForm::UpdatingAPEnabled();
- //Disable the default AP construction.
- CPDF_InterForm::EnableUpdateAP(FALSE);
- m_pAnnotList = new CPDF_AnnotList(m_page);
- CPDF_InterForm::EnableUpdateAP(enableAPUpdate);
- int nCount = m_pAnnotList->Count();
- for(int i=0; i<nCount; i++)
- {
- CPDF_Annot* pPDFAnnot = m_pAnnotList->GetAt(i);
- CPDF_Document * pDoc = this->GetPDFDocument();
-
- CheckUnSupportAnnot(pDoc, pPDFAnnot);
-
- CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr();
- ASSERT(pAnnotHandlerMgr != NULL);
- if(pAnnotHandlerMgr)
- {
- CPDFSDK_Annot* pAnnot = pAnnotHandlerMgr->NewAnnot(pPDFAnnot, this);
- if(!pAnnot)
- continue;
- m_fxAnnotArray.Add(pAnnot);
-
- pAnnotHandlerMgr->Annot_OnLoad(pAnnot);
- }
-
- }
-}
-
-void CPDFSDK_PageView::UpdateRects(CFX_RectArray& rects)
-{
- for(int i=0; i<rects.GetSize(); i++)
- {
- CPDF_Rect rc = rects.GetAt(i);
- CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
- pEnv->FFI_Invalidate(m_page, rc.left, rc.top, rc.right, rc.bottom);
- }
-}
-
-void CPDFSDK_PageView::UpdateView(CPDFSDK_Annot* pAnnot)
-{
- CPDF_Rect rcWindow;
-
- CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
-// CPDFSDK_AnnotHandlerMgr* pAnnotHandler = pEnv->GetAnnotHandlerMgr();
-
- rcWindow = pAnnot->GetRect();//pAnnotHandler->Annot_OnGetViewBBox(this,pAnnot);
- pEnv->FFI_Invalidate(m_page, rcWindow.left, rcWindow.top, rcWindow.right, rcWindow.bottom);
-
-}
-
-int CPDFSDK_PageView::GetPageIndex()
-{
- if(m_page)
- {
- CPDF_Dictionary* pDic = m_page->m_pFormDict;
- CPDF_Document* pDoc = m_pSDKDoc->GetDocument();
- if(pDoc && pDic)
- {
- return pDoc->GetPageIndex(pDic->GetObjNum());
- }
- }
- return -1;
-}
-
-FX_BOOL CPDFSDK_PageView::IsValidAnnot(FX_LPVOID p)
-{
- if (p == NULL) return FALSE;
- int iCount = m_pAnnotList->Count();
- for (int i = 0; i < iCount; i++)
- {
- if (m_pAnnotList->GetAt(i) == p)
- return TRUE;
- }
- return FALSE;
-}
-
-
-CPDFSDK_Annot* CPDFSDK_PageView::GetFocusAnnot()
-{
- CPDFSDK_Annot* pFocusAnnot = m_pSDKDoc->GetFocusAnnot();
- if(!pFocusAnnot)
- return NULL;
-
- for(int i=0; i<m_fxAnnotArray.GetSize(); i++)
- {
- CPDFSDK_Annot* pAnnot = (CPDFSDK_Annot*)m_fxAnnotArray.GetAt(i);
- if(pAnnot == pFocusAnnot)
- return pAnnot;
- }
- return NULL;
-}
-
+// 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
+
+#include "../include/fsdk_define.h"
+#include "../include/fsdk_mgr.h"
+#include "../include/fpdf_ext.h"
+#include "../include/formfiller/FFL_FormFiller.h"
+#include "../include/javascript/IJavaScript.h"
+
+#if _FX_OS_ == _FX_ANDROID_
+#include "time.h"
+#else
+#include <ctime>
+#endif
+
+//extern CPDFDoc_Environment* g_pFormFillApp;
+class CFX_SystemHandler:public IFX_SystemHandler
+{
+public:
+ CFX_SystemHandler(CPDFDoc_Environment* pEnv):m_pEnv(pEnv),m_nCharSet(-1) {}
+public:
+ virtual void InvalidateRect(FX_HWND hWnd, FX_RECT rect) ;
+ virtual void OutputSelectedRect(void* pFormFiller, CPDF_Rect& rect);
+
+ virtual FX_BOOL IsSelectionImplemented();
+
+ virtual CFX_WideString GetClipboardText(FX_HWND hWnd){return L"";}
+ virtual FX_BOOL SetClipboardText(FX_HWND hWnd, CFX_WideString string) {return FALSE;}
+
+ virtual void ClientToScreen(FX_HWND hWnd, FX_INT32& x, FX_INT32& y) {}
+ virtual void ScreenToClient(FX_HWND hWnd, FX_INT32& x, FX_INT32& y) {}
+
+ /*cursor style
+ FXCT_ARROW
+ FXCT_NESW
+ FXCT_NWSE
+ FXCT_VBEAM
+ FXCT_HBEAM
+ FXCT_HAND
+ */
+ virtual void SetCursor(FX_INT32 nCursorType);
+
+ virtual FX_HMENU CreatePopupMenu() {return NULL;}
+ virtual FX_BOOL AppendMenuItem(FX_HMENU hMenu, FX_INT32 nIDNewItem, CFX_WideString string) {return FALSE;}
+ virtual FX_BOOL EnableMenuItem(FX_HMENU hMenu, FX_INT32 nIDItem, FX_BOOL bEnabled) {return FALSE;}
+ virtual FX_INT32 TrackPopupMenu(FX_HMENU hMenu, FX_INT32 x, FX_INT32 y, FX_HWND hParent) {return -1;}
+ virtual void DestroyMenu(FX_HMENU hMenu) {}
+
+ virtual CFX_ByteString GetNativeTrueTypeFont(FX_INT32 nCharset);
+ virtual FX_BOOL FindNativeTrueTypeFont(FX_INT32 nCharset, CFX_ByteString sFontFaceName);
+ virtual CPDF_Font* AddNativeTrueTypeFontToPDF(CPDF_Document* pDoc, CFX_ByteString sFontFaceName, FX_BYTE nCharset);
+
+ virtual FX_INT32 SetTimer(FX_INT32 uElapse, TimerCallback lpTimerFunc) ;
+ virtual void KillTimer(FX_INT32 nID) ;
+
+
+ virtual FX_BOOL IsSHIFTKeyDown(FX_DWORD nFlag) {return m_pEnv->FFI_IsSHIFTKeyDown(nFlag);}
+ virtual FX_BOOL IsCTRLKeyDown(FX_DWORD nFlag) {return m_pEnv->FFI_IsCTRLKeyDown(nFlag);}
+ virtual FX_BOOL IsALTKeyDown(FX_DWORD nFlag) {return m_pEnv->FFI_IsALTKeyDown(nFlag);}
+ virtual FX_BOOL IsINSERTKeyDown(FX_DWORD nFlag) {return m_pEnv->FFI_IsINSERTKeyDown(nFlag);}
+
+ virtual FX_SYSTEMTIME GetLocalTime();
+
+ virtual FX_INT32 GetCharSet() {return m_nCharSet;}
+ virtual void SetCharSet(FX_INT32 nCharSet) {m_nCharSet = nCharSet;}
+private:
+ CPDFDoc_Environment* m_pEnv;
+ int m_nCharSet;
+};
+
+void CFX_SystemHandler::SetCursor(FX_INT32 nCursorType)
+{
+
+ m_pEnv->FFI_SetCursor(nCursorType);
+}
+
+void CFX_SystemHandler::InvalidateRect(FX_HWND hWnd, FX_RECT rect)
+{
+ //g_pFormFillApp->FFI_Invalidate();
+ CPDFSDK_Annot* pSDKAnnot = (CPDFSDK_Annot*)hWnd;
+ CPDF_Page* pPage = NULL;
+ CPDFSDK_PageView* pPageView = NULL;
+ pPageView = pSDKAnnot->GetPageView();
+ pPage = pSDKAnnot->GetPDFPage();
+ if(!pPage || !pPageView)
+ return;
+ CPDF_Matrix page2device;
+ pPageView->GetCurrentMatrix(page2device);
+ CPDF_Matrix device2page;
+ device2page.SetReverse(page2device);
+ FX_FLOAT left, top, right,bottom;
+ device2page.Transform((FX_FLOAT)rect.left, (FX_FLOAT)rect.top, left, top);
+ device2page.Transform((FX_FLOAT)rect.right, (FX_FLOAT)rect.bottom, right, bottom);
+// m_pEnv->FFI_DeviceToPage(pPage, rect.left, rect.top, (double*)&left, (double*)&top);
+// m_pEnv->FFI_DeviceToPage(pPage, rect.right, rect.bottom, (double*)&right, (double*)&bottom);
+ CPDF_Rect rcPDF(left, bottom, right, top);
+ rcPDF.Normalize();
+
+ m_pEnv->FFI_Invalidate(pPage, rcPDF.left, rcPDF.top, rcPDF.right, rcPDF.bottom);
+}
+void CFX_SystemHandler::OutputSelectedRect(void* pFormFiller, CPDF_Rect& rect)
+{
+ CFFL_FormFiller* pFFL = (CFFL_FormFiller*)pFormFiller;
+ if(pFFL)
+ {
+ CPDF_Point leftbottom = CPDF_Point(rect.left, rect.bottom);
+ CPDF_Point righttop = CPDF_Point(rect.right, rect.top);
+ CPDF_Point ptA = pFFL->PWLtoFFL(leftbottom);
+ CPDF_Point ptB = pFFL->PWLtoFFL(righttop);
+
+
+ CPDFSDK_Annot* pAnnot = pFFL->GetSDKAnnot();
+ ASSERT(pAnnot);
+ CPDF_Page* pPage = pAnnot->GetPDFPage();
+ ASSERT(pPage);
+ m_pEnv->FFI_OutputSelectedRect(pPage, ptA.x, ptB.y, ptB.x, ptA.y);
+ }
+
+}
+
+FX_BOOL CFX_SystemHandler::IsSelectionImplemented()
+{
+ if(m_pEnv)
+ {
+ FPDF_FORMFILLINFO* pInfo = m_pEnv->GetFormFillInfo();
+ if(pInfo && pInfo->FFI_OutputSelectedRect)
+ return TRUE;
+ }
+ return FALSE;
+}
+
+CFX_ByteString CFX_SystemHandler::GetNativeTrueTypeFont(FX_INT32 nCharset)
+{
+ return "";
+}
+
+FX_BOOL CFX_SystemHandler::FindNativeTrueTypeFont(FX_INT32 nCharset, CFX_ByteString sFontFaceName)
+{
+ CFX_FontMgr* pFontMgr = CFX_GEModule::Get()->GetFontMgr();
+// FXFT_Face nFace = pFontMgr->FindSubstFont(sFontFaceName,TRUE,0,0,0,0,NULL);
+// FXFT_Face nFace = pFontMgr->m_pBuiltinMapper->FindSubstFont(sFontFaceName,TRUE,0,0,0,0,NULL);
+
+ if(pFontMgr)
+ {
+ CFX_FontMapper* pFontMapper = pFontMgr->m_pBuiltinMapper;
+ if(pFontMapper)
+ {
+ int nSize = pFontMapper->m_InstalledTTFonts.GetSize();
+ if(nSize ==0)
+ {
+ pFontMapper->LoadInstalledFonts();
+ nSize = pFontMapper->m_InstalledTTFonts.GetSize();
+ }
+
+ for(int i=0; i<nSize; i++)
+ {
+ if(pFontMapper->m_InstalledTTFonts[i].Compare(sFontFaceName))
+ return TRUE;
+ }
+ }
+
+ }
+
+ return FALSE;
+// pFontMgr->m_FaceMap.Lookup(sFontFaceName,pFont);
+// return (pFont!=NULL);
+}
+
+static int CharSet2CP(int charset)
+{
+ if(charset == 128)
+ return 932;
+ else if(charset == 134)
+ return 936;
+ else if(charset == 129)
+ return 949;
+ else if(charset == 136)
+ return 950;
+ return 0;
+}
+CPDF_Font* CFX_SystemHandler::AddNativeTrueTypeFontToPDF(CPDF_Document* pDoc, CFX_ByteString sFontFaceName,
+ FX_BYTE nCharset)
+{
+ if(pDoc)
+ {
+ CFX_Font* pFXFont = new CFX_Font();
+ pFXFont->LoadSubst(sFontFaceName,TRUE,0,0,0,CharSet2CP(nCharset),FALSE);
+ CPDF_Font* pFont = pDoc->AddFont(pFXFont,nCharset,FALSE);
+ delete pFXFont;
+ return pFont;
+ }
+
+ return NULL;
+}
+
+
+FX_INT32 CFX_SystemHandler::SetTimer(FX_INT32 uElapse, TimerCallback lpTimerFunc)
+{
+ return m_pEnv->FFI_SetTimer(uElapse, lpTimerFunc);
+}
+void CFX_SystemHandler::KillTimer(FX_INT32 nID)
+{
+ m_pEnv->FFI_KillTimer(nID);
+}
+
+FX_SYSTEMTIME CFX_SystemHandler::GetLocalTime()
+{
+ return m_pEnv->FFI_GetLocalTime();
+}
+
+
+CJS_RuntimeFactory* GetJSRuntimeFactory()
+{
+ static CJS_RuntimeFactory s_JSRuntimeFactory;
+ return &s_JSRuntimeFactory;
+}
+
+CPDFDoc_Environment::CPDFDoc_Environment(CPDF_Document * pDoc):m_pInfo(NULL),m_pIFormFiller(NULL),
+ m_pAnnotHandlerMgr(NULL),m_pActionHandler(NULL),m_pJSRuntime(NULL),
+ m_pSDKDoc(NULL), m_pPDFDoc(pDoc)
+{
+
+ m_pSysHandler = NULL;
+ m_pSysHandler = new CFX_SystemHandler(this);
+
+
+ m_pJSRuntimeFactory = NULL;
+ m_pJSRuntimeFactory = GetJSRuntimeFactory();
+ m_pJSRuntimeFactory->AddRef();
+}
+
+CPDFDoc_Environment::~CPDFDoc_Environment()
+{
+
+ if ( m_pIFormFiller )
+ {
+ delete m_pIFormFiller;
+ m_pIFormFiller = NULL;
+ }
+ if(m_pJSRuntime && m_pJSRuntimeFactory)
+ m_pJSRuntimeFactory->DeleteJSRuntime(m_pJSRuntime);
+ m_pJSRuntimeFactory->Release();
+
+ if(m_pSysHandler)
+ {
+ delete m_pSysHandler;
+ m_pSysHandler = NULL;
+ }
+
+ if(m_pAnnotHandlerMgr)
+ {
+ delete m_pAnnotHandlerMgr;
+ m_pAnnotHandlerMgr = NULL;
+ }
+ if(m_pActionHandler)
+ {
+ delete m_pActionHandler;
+ m_pActionHandler = NULL;
+ }
+
+
+}
+
+
+IFXJS_Runtime* CPDFDoc_Environment::GetJSRuntime()
+{
+ if(!IsJSInitiated())
+ return NULL;
+ assert(m_pJSRuntimeFactory);
+ if(!m_pJSRuntime)
+ m_pJSRuntime = m_pJSRuntimeFactory->NewJSRuntime(this);
+ return m_pJSRuntime;
+}
+
+CPDFSDK_AnnotHandlerMgr* CPDFDoc_Environment::GetAnnotHandlerMgr()
+{
+ if(!m_pAnnotHandlerMgr)
+ m_pAnnotHandlerMgr = new CPDFSDK_AnnotHandlerMgr(this);
+ return m_pAnnotHandlerMgr;
+}
+
+CPDFSDK_ActionHandler* CPDFDoc_Environment::GetActionHander()
+{
+ if(!m_pActionHandler)
+ m_pActionHandler = new CPDFSDK_ActionHandler(this);
+ return m_pActionHandler;
+}
+
+int CPDFDoc_Environment::RegAppHandle(FPDF_FORMFILLINFO* pFFinfo)
+{
+ m_pInfo = pFFinfo;
+ return TRUE;
+}
+
+CPDFSDK_Document* CPDFDoc_Environment::GetCurrentDoc()
+{
+ return m_pSDKDoc;
+}
+
+CFFL_IFormFiller* CPDFDoc_Environment::GetIFormFiller()
+{
+ if(!m_pIFormFiller)
+ m_pIFormFiller = new CFFL_IFormFiller(this);
+ return m_pIFormFiller;
+}
+
+FX_BOOL CPDFDoc_Environment::IsJSInitiated()
+{
+ if(m_pInfo)
+ {
+ if(m_pInfo->m_pJsPlatform)
+ return TRUE;
+ else
+ return FALSE;
+ }
+ return FALSE;
+}
+
+CPDFSDK_Document::CPDFSDK_Document(CPDF_Document* pDoc,CPDFDoc_Environment* pEnv):m_pDoc(pDoc),
+ m_pInterForm(NULL),m_pEnv(pEnv),m_pOccontent(NULL),m_bChangeMask(FALSE)
+{
+ m_pFocusAnnot = NULL;
+}
+
+CPDFSDK_Document::~CPDFSDK_Document()
+{
+ m_pageMap.RemoveAll();
+ if(m_pInterForm)
+ {
+ m_pInterForm->Destroy();
+ m_pInterForm = NULL;
+ }
+ if(m_pOccontent)
+ {
+ delete m_pOccontent;
+ m_pOccontent = NULL;
+ }
+}
+
+void CPDFSDK_Document::InitPageView()
+{
+ int nCount = m_pDoc->GetPageCount();
+ for(int i=0; i<nCount; i++)
+ {
+ // To do
+// CPDF_Dictionary* pDic = m_pDoc->GetPage(i);
+// m_pageMap.SetAt(pDic, pPageView);
+ }
+}
+
+void CPDFSDK_Document::AddPageView(CPDF_Page* pPDFPage, CPDFSDK_PageView* pPageView)
+{
+ m_pageMap.SetAt(pPDFPage, pPageView);
+}
+
+CPDFSDK_PageView* CPDFSDK_Document::GetPageView(CPDF_Page* pPDFPage, FX_BOOL ReNew)
+{
+ CPDFSDK_PageView* pPageView = (CPDFSDK_PageView*)m_pageMap.GetValueAt(pPDFPage);
+ if(pPageView != NULL)
+ return pPageView;
+ if(ReNew)
+ {
+ pPageView = new CPDFSDK_PageView(this,pPDFPage);
+ m_pageMap.SetAt(pPDFPage, pPageView);
+ //Delay to load all the annotations, to avoid endless loop.
+ pPageView->LoadFXAnnots();
+ }
+ return pPageView;
+
+}
+
+CPDFSDK_PageView* CPDFSDK_Document::GetCurrentView()
+{
+ CPDF_Page * pPage = (CPDF_Page *)m_pEnv->FFI_GetCurrentPage(m_pDoc);
+ if(pPage)
+ return this->GetPageView(pPage, TRUE);
+ return NULL;
+}
+
+CPDFSDK_PageView* CPDFSDK_Document::GetPageView(int nIndex)
+{
+ CPDFSDK_PageView * pTempPageView = NULL;
+ CPDF_Page * pTempPage = (CPDF_Page*)m_pEnv->FFI_GetPage(m_pDoc,nIndex);
+ if(!pTempPage)
+ return NULL;
+
+ m_pageMap.Lookup(pTempPage, pTempPageView);
+
+ ASSERT(pTempPageView != NULL);
+
+ return pTempPageView;
+}
+
+void CPDFSDK_Document:: ProcJavascriptFun()
+{
+ CPDF_Document* pPDFDoc = this->GetDocument();
+ CPDF_DocJSActions docJS(pPDFDoc);
+ int iCount = docJS.CountJSActions();
+ if (iCount < 1) return;
+ for (int i = 0; i < iCount; i ++)
+ {
+ CFX_ByteString csJSName;
+ CPDF_Action jsAction = docJS.GetJSAction(i, csJSName);
+ if(m_pEnv->GetActionHander())
+ m_pEnv->GetActionHander()->DoAction_JavaScript(jsAction,CFX_WideString::FromLocal(csJSName),this);
+ }
+
+}
+
+FX_BOOL CPDFSDK_Document::ProcOpenAction()
+{
+ if(!m_pDoc) return FALSE;
+
+ CPDF_Dictionary* pRoot = m_pDoc->GetRoot();
+ if (!pRoot) return FALSE;
+ CPDF_Object* pOpenAction = pRoot->GetDict("OpenAction");//
+ if(!pOpenAction) pOpenAction = pRoot->GetArray("OpenAction");//
+ if(!pOpenAction) return FALSE;
+
+ if(pOpenAction->GetType()==PDFOBJ_ARRAY)
+ {
+ }
+ else if(pOpenAction->GetType()==PDFOBJ_DICTIONARY)
+ {
+ CPDF_Dictionary * pDict=(CPDF_Dictionary*)pOpenAction;
+ CPDF_Action Action = pDict;
+
+ if(m_pEnv->GetActionHander())
+ m_pEnv->GetActionHander()->DoAction_DocOpen(Action,this);
+ }
+ else
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+CPDF_OCContext* CPDFSDK_Document::GetOCContext()
+{
+ if(!m_pOccontent)
+ m_pOccontent = new CPDF_OCContext(m_pDoc);
+ return m_pOccontent;
+}
+
+void CPDFSDK_Document::ReMovePageView(CPDF_Page* pPDFPage)
+{
+ CPDFSDK_PageView* pPageView = (CPDFSDK_PageView*)m_pageMap.GetValueAt(pPDFPage);
+ if(pPageView)
+ {
+ delete pPageView;
+ m_pageMap.RemoveKey(pPDFPage);
+ }
+}
+
+CPDF_Page * CPDFSDK_Document::GetPage(int nIndex)
+{
+ CPDF_Page * pTempPage = (CPDF_Page*)m_pEnv->FFI_GetPage(m_pDoc,nIndex);
+ if(!pTempPage)
+ return NULL;
+ return pTempPage;
+}
+
+CPDFSDK_InterForm* CPDFSDK_Document::GetInterForm()
+{
+ if(!m_pInterForm)
+ m_pInterForm = new CPDFSDK_InterForm(this);
+ return m_pInterForm;
+}
+
+void CPDFSDK_Document::UpdateAllViews(CPDFSDK_PageView* pSender, CPDFSDK_Annot* pAnnot)
+{
+
+ FX_POSITION pos = m_pageMap.GetStartPosition();
+ CPDF_Page * pPage = NULL;
+ CPDFSDK_PageView * pPageView = NULL;
+ while(pos)
+ {
+ m_pageMap.GetNextAssoc(pos, pPage, pPageView);
+
+ if(pPageView != pSender)
+ {
+ pPageView->UpdateView(pAnnot);
+ }
+ }
+}
+
+CPDFSDK_Annot* CPDFSDK_Document::GetFocusAnnot()
+{
+ return this->m_pFocusAnnot;
+}
+
+FX_BOOL CPDFSDK_Document::SetFocusAnnot(CPDFSDK_Annot* pAnnot,FX_UINT nFlag)
+{
+
+ if(m_pFocusAnnot==pAnnot) return TRUE;
+
+ if(m_pFocusAnnot)
+ {
+ if(!this->KillFocusAnnot(nFlag) ) return FALSE;
+ }
+ CPDFSDK_PageView* pPageView = pAnnot->GetPageView();
+ if(pAnnot && pPageView->IsValid())
+ {
+ CPDFSDK_AnnotHandlerMgr *pAnnotHandler=m_pEnv->GetAnnotHandlerMgr();
+
+ if(pAnnotHandler&&!m_pFocusAnnot)
+ {
+ if (!pAnnotHandler->Annot_OnSetFocus(pAnnot,nFlag))
+ return FALSE;
+ if(!m_pFocusAnnot)
+ {
+ this->m_pFocusAnnot=pAnnot;
+ return TRUE;
+ }
+ }
+ }
+ return FALSE;
+}
+
+FX_BOOL CPDFSDK_Document::KillFocusAnnot(FX_UINT nFlag)
+{
+ if(m_pFocusAnnot)
+ {
+ CPDFSDK_AnnotHandlerMgr *pAnnotHandler=m_pEnv->GetAnnotHandlerMgr();
+ if(pAnnotHandler)
+ {
+ CPDFSDK_Annot* pFocusAnnot = m_pFocusAnnot;
+ m_pFocusAnnot = NULL;
+ if(pAnnotHandler->Annot_OnKillFocus(pFocusAnnot, nFlag))
+ {
+
+ if(pFocusAnnot->GetType() == FX_BSTRC("Widget"))
+ {
+ CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pFocusAnnot;
+ int nFieldType = pWidget->GetFieldType();
+ if(FIELDTYPE_TEXTFIELD == nFieldType || FIELDTYPE_COMBOBOX == nFieldType)
+ m_pEnv->FFI_OnSetFieldInputFocus(NULL, NULL, 0, FALSE);
+ }
+
+ if(!m_pFocusAnnot)
+ return TRUE;
+ }
+ else
+ {
+ m_pFocusAnnot = pFocusAnnot;
+ }
+ }
+ }
+ return FALSE;
+}
+
+FX_BOOL CPDFSDK_Document::DeletePages(int nStart, int nCount)
+{
+ if ( nStart < 0 || nStart >= GetPageCount() || nCount <= 0 )
+ {
+ return FALSE;
+ }
+
+ CPDF_Page * pTempPage = NULL;
+ for ( int i = nCount-1; i >= 0; i-- )
+ {
+ pTempPage = GetPage(nStart+i);
+ if ( pTempPage != NULL )
+ {
+ ReMovePageView(pTempPage);
+ }
+ }
+ return TRUE;
+}
+
+void CPDFSDK_Document::OnCloseDocument()
+{
+ KillFocusAnnot();
+}
+
+FX_BOOL CPDFSDK_Document::GetPermissions(int nFlag)
+{
+ FX_DWORD dwPermissions = m_pDoc->GetUserPermissions();
+ return dwPermissions&nFlag;
+}
+
+IFXJS_Runtime * CPDFSDK_Document::GetJsRuntime()
+{
+ ASSERT(m_pEnv!=NULL);
+ return m_pEnv->GetJSRuntime();
+}
+
+CFX_WideString CPDFSDK_Document::GetPath()
+{
+ ASSERT(m_pEnv != NULL);
+ return m_pEnv->JS_docGetFilePath();
+}
+
+
+CPDFSDK_PageView::CPDFSDK_PageView(CPDFSDK_Document* pSDKDoc,CPDF_Page* page):m_pSDKDoc(pSDKDoc),m_page(page)
+{
+ CPDFSDK_InterForm* pInterForm = pSDKDoc->GetInterForm();
+ if(pInterForm)
+ {
+ CPDF_InterForm* pPDFInterForm = pInterForm->GetInterForm();
+ pPDFInterForm->FixPageFields(page);
+ }
+
+ m_fxAnnotArray.RemoveAll();
+
+ m_bEnterWidget = FALSE;
+ m_bExitWidget = FALSE;
+ m_bOnWidget = FALSE;
+ m_CaptureWidget = NULL;
+ m_bValid = FALSE;
+}
+
+CPDFSDK_PageView::~CPDFSDK_PageView()
+{
+ CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
+ int nAnnotCount = m_fxAnnotArray.GetSize();
+ for (int i=0; i<nAnnotCount; i++)
+ {
+ CPDFSDK_Annot* pAnnot = (CPDFSDK_Annot*)m_fxAnnotArray.GetAt(i);
+ //if there is a focused annot on the page, we should kill the focus first.
+ if(pAnnot == m_pSDKDoc->GetFocusAnnot())
+ KillFocusAnnot();
+ CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr();
+ ASSERT(pAnnotHandlerMgr);
+ pAnnotHandlerMgr->ReleaseAnnot(pAnnot);
+ }
+ m_fxAnnotArray.RemoveAll();
+ if(m_pAnnotList)
+ {
+ delete m_pAnnotList;
+ m_pAnnotList = NULL;
+ }
+}
+
+void CPDFSDK_PageView::PageView_OnDraw(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,CPDF_RenderOptions* pOptions)
+{
+ m_curMatrix = *pUser2Device;
+
+ // m_pAnnotList->DisplayAnnots(m_page, pDevice, pUser2Device, FALSE, pOptions);
+ CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
+ CPDFSDK_AnnotIterator annotIterator(this, TRUE);
+ CPDFSDK_Annot * pSDKAnnot=NULL;
+ int index=-1;
+ while((pSDKAnnot = annotIterator.Next(index)))
+ {
+ CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr();
+ ASSERT(pAnnotHandlerMgr);
+ pAnnotHandlerMgr->Annot_OnDraw(this, pSDKAnnot, pDevice, pUser2Device, 0);
+ }
+
+}
+
+CPDF_Annot* CPDFSDK_PageView::GetPDFAnnotAtPoint(FX_FLOAT pageX, FX_FLOAT pageY)
+{
+
+ int nCount = m_pAnnotList->Count();
+ for(int i = 0 ; i<nCount; i++)
+ {
+ CPDF_Annot* pAnnot = m_pAnnotList->GetAt(i);
+ CFX_FloatRect annotRect;
+ pAnnot->GetRect(annotRect);
+ if(annotRect.Contains(pageX, pageY))
+ return pAnnot;
+ }
+ return NULL;
+}
+
+CPDF_Annot* CPDFSDK_PageView::GetPDFWidgetAtPoint(FX_FLOAT pageX, FX_FLOAT pageY)
+{
+
+ int nCount = m_pAnnotList->Count();
+ for(int i = 0 ; i<nCount; i++)
+ {
+ CPDF_Annot* pAnnot = m_pAnnotList->GetAt(i);
+ if(pAnnot->GetSubType() == "Widget")
+ {
+ CFX_FloatRect annotRect;
+ pAnnot->GetRect(annotRect);
+ if(annotRect.Contains(pageX, pageY))
+ return pAnnot;
+ }
+ }
+ return NULL;
+}
+
+CPDFSDK_Annot* CPDFSDK_PageView::GetFXAnnotAtPoint(FX_FLOAT pageX, FX_FLOAT pageY)
+{
+
+ CPDFSDK_AnnotIterator annotIterator(this, FALSE);
+ CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
+ CPDFSDK_AnnotHandlerMgr* pAnnotMgr = pEnv->GetAnnotHandlerMgr();
+ CPDFSDK_Annot* pSDKAnnot = NULL;
+ int index = -1;
+ while((pSDKAnnot = annotIterator.Next(index)))
+ {
+ CPDF_Rect rc = pAnnotMgr->Annot_OnGetViewBBox(this, pSDKAnnot);
+ if(rc.Contains(pageX, pageY))
+ return pSDKAnnot;
+ }
+
+ return NULL;
+}
+
+CPDFSDK_Annot* CPDFSDK_PageView::GetFXWidgetAtPoint(FX_FLOAT pageX, FX_FLOAT pageY)
+{
+
+ CPDFSDK_AnnotIterator annotIterator(this, FALSE);
+ CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
+ CPDFSDK_AnnotHandlerMgr* pAnnotMgr = pEnv->GetAnnotHandlerMgr();
+ CPDFSDK_Annot* pSDKAnnot = NULL;
+ int index = -1;
+ while((pSDKAnnot = annotIterator.Next(index)))
+ {
+ if(pSDKAnnot->GetType() == "Widget")
+ {
+ pAnnotMgr->Annot_OnGetViewBBox(this, pSDKAnnot);
+ CPDF_Point point(pageX, pageY);
+ if (pAnnotMgr->Annot_OnHitTest(this, pSDKAnnot, point))
+// if(rc.Contains(pageX, pageY))
+ return pSDKAnnot;
+ }
+ }
+
+ return NULL;
+}
+
+
+FX_BOOL CPDFSDK_PageView::Annot_HasAppearance(CPDF_Annot* pAnnot)
+{
+ CPDF_Dictionary* pAnnotDic = pAnnot->m_pAnnotDict;
+ if(pAnnotDic)
+ return pAnnotDic->KeyExist("AS");
+ return FALSE;
+}
+
+CPDFSDK_Annot* CPDFSDK_PageView::AddAnnot(CPDF_Annot * pPDFAnnot)
+{
+ CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
+ ASSERT(pEnv);
+ CPDFSDK_AnnotHandlerMgr * pAnnotHandler= pEnv->GetAnnotHandlerMgr();
+
+ CPDFSDK_Annot* pSDKAnnot =NULL;
+
+ if(pAnnotHandler)
+ {
+ pSDKAnnot = pAnnotHandler->NewAnnot(pPDFAnnot, this);
+ }
+ if(!pSDKAnnot)
+ return NULL;
+
+ m_fxAnnotArray.Add(pSDKAnnot);
+
+ if(pAnnotHandler)
+ {
+ pAnnotHandler->Annot_OnCreate(pSDKAnnot);
+
+ }
+
+ return pSDKAnnot;
+}
+
+CPDFSDK_Annot* CPDFSDK_PageView::AddAnnot(CPDF_Dictionary * pDict)
+{
+ if(pDict)
+ return this->AddAnnot(pDict->GetString("Subtype"),pDict);
+ return NULL;
+}
+
+CPDFSDK_Annot* CPDFSDK_PageView::AddAnnot(FX_LPCSTR lpSubType,CPDF_Dictionary * pDict)
+{
+ return NULL;
+}
+
+FX_BOOL CPDFSDK_PageView::DeleteAnnot(CPDFSDK_Annot* pAnnot)
+{
+ return FALSE;
+}
+
+CPDF_Document* CPDFSDK_PageView::GetPDFDocument()
+{
+ if(m_page)
+ {
+ return m_page->m_pDocument;
+ }
+ return NULL;
+}
+
+int CPDFSDK_PageView::CountAnnots()
+{
+ return m_pAnnotList->Count();
+}
+
+CPDFSDK_Annot* CPDFSDK_PageView::GetAnnot(int nIndex)
+{
+ int nCount = m_fxAnnotArray.GetSize();
+ if ( nIndex < 0 || nIndex >= nCount )
+ {
+ return NULL;
+ }
+
+ return (CPDFSDK_Annot*)m_fxAnnotArray.GetAt(nIndex);
+}
+
+CPDFSDK_Annot* CPDFSDK_PageView::GetAnnotByDict(CPDF_Dictionary * pDict)
+{
+ int nCount = m_fxAnnotArray.GetSize();
+ for(int i=0; i<nCount; i++)
+ {
+ CPDFSDK_Annot* pAnnot = (CPDFSDK_Annot*)m_fxAnnotArray.GetAt(i);
+ if(pDict==pAnnot->GetPDFAnnot()->m_pAnnotDict)
+ return pAnnot;
+ }
+ return NULL;
+}
+
+FX_BOOL CPDFSDK_PageView::OnLButtonDown(const CPDF_Point & point, FX_UINT nFlag)
+{
+ CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
+ ASSERT(pEnv);
+ CPDFSDK_Annot* pFXAnnot = GetFXWidgetAtPoint(point.x, point.y);
+ if(!pFXAnnot)
+ {
+ KillFocusAnnot(nFlag);
+ }
+ else
+ {
+ CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr();
+ ASSERT(pAnnotHandlerMgr);
+
+ FX_BOOL bRet = pAnnotHandlerMgr->Annot_OnLButtonDown(this, pFXAnnot, nFlag,point);
+ if(bRet)
+ {
+ SetFocusAnnot(pFXAnnot);
+ }
+ return bRet;
+ }
+ return FALSE;
+}
+
+
+FX_BOOL CPDFSDK_PageView::OnLButtonUp(const CPDF_Point & point, FX_UINT nFlag)
+{
+ CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
+ ASSERT(pEnv);
+ CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr();
+ ASSERT(pAnnotHandlerMgr);
+ CPDFSDK_Annot* pFXAnnot = GetFXWidgetAtPoint(point.x, point.y);
+ CPDFSDK_Annot* pFocusAnnot = GetFocusAnnot();
+ FX_BOOL bRet = FALSE;
+ if(pFocusAnnot && pFocusAnnot != pFXAnnot)
+ {
+ //Last focus Annot gets a chance to handle the event.
+ bRet = pAnnotHandlerMgr->Annot_OnLButtonUp(this, pFocusAnnot, nFlag,point);
+ }
+ if(pFXAnnot && !bRet)
+ {
+ bRet = pAnnotHandlerMgr->Annot_OnLButtonUp(this, pFXAnnot, nFlag,point);
+ return bRet;
+ }
+ return bRet;
+}
+
+FX_BOOL CPDFSDK_PageView::OnMouseMove(const CPDF_Point & point, int nFlag)
+{
+
+ CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
+ CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr();
+ ASSERT(pAnnotHandlerMgr);
+ if(CPDFSDK_Annot* pFXAnnot = GetFXWidgetAtPoint(point.x, point.y))
+ {
+ if(m_CaptureWidget && m_CaptureWidget != pFXAnnot)
+ {
+ m_bExitWidget = TRUE;
+ m_bEnterWidget = FALSE;
+ pAnnotHandlerMgr->Annot_OnMouseExit(this, m_CaptureWidget, nFlag);
+ }
+ m_CaptureWidget = (CPDFSDK_Widget*)pFXAnnot;
+ m_bOnWidget = TRUE;
+ if(!m_bEnterWidget)
+ {
+ m_bEnterWidget = TRUE;
+ m_bExitWidget = FALSE;
+ pAnnotHandlerMgr->Annot_OnMouseEnter(this, pFXAnnot,nFlag);
+ }
+ pAnnotHandlerMgr->Annot_OnMouseMove(this, pFXAnnot, nFlag, point);
+ return TRUE;
+ }
+ else
+ {
+ if(m_bOnWidget)
+ {
+ m_bOnWidget = FALSE;
+ m_bExitWidget = TRUE;
+ m_bEnterWidget = FALSE;
+ if(m_CaptureWidget)
+ {
+ pAnnotHandlerMgr->Annot_OnMouseExit(this, m_CaptureWidget, nFlag);
+ m_CaptureWidget = NULL;
+ }
+ }
+ return FALSE;
+ }
+
+ return FALSE;;
+}
+
+FX_BOOL CPDFSDK_PageView::OnMouseWheel(double deltaX, double deltaY,const CPDF_Point& point, int nFlag)
+{
+ if(CPDFSDK_Annot* pAnnot = GetFXWidgetAtPoint(point.x, point.y))
+ {
+ CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
+ CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr();
+ ASSERT(pAnnotHandlerMgr);
+ return pAnnotHandlerMgr->Annot_OnMouseWheel(this, pAnnot, nFlag, (int)deltaY, point);
+ }
+ return FALSE;
+
+}
+
+FX_BOOL CPDFSDK_PageView::OnChar(int nChar, FX_UINT nFlag)
+{
+ if(CPDFSDK_Annot* pAnnot = GetFocusAnnot())
+ {
+ CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
+ CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr();
+ ASSERT(pAnnotHandlerMgr);
+ return pAnnotHandlerMgr->Annot_OnChar(pAnnot, nChar, nFlag);
+ }
+
+ return FALSE;
+}
+
+FX_BOOL CPDFSDK_PageView::OnKeyDown(int nKeyCode, int nFlag)
+{
+ if(CPDFSDK_Annot* pAnnot = GetFocusAnnot())
+ {
+ CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
+ CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr();
+ ASSERT(pAnnotHandlerMgr);
+ return pAnnotHandlerMgr->Annot_OnKeyDown(pAnnot, nKeyCode, nFlag);
+ }
+ return FALSE;
+}
+
+FX_BOOL CPDFSDK_PageView::OnKeyUp(int nKeyCode, int nFlag)
+{
+// if(CPDFSDK_Annot* pAnnot = GetFocusAnnot())
+// {
+// CFFL_IFormFiller* pIFormFiller = g_pFormFillApp->GetIFormFiller();
+// return pIFormFiller->OnKeyUp(pAnnot, nKeyCode, nFlag);
+// }
+ return FALSE;
+}
+
+extern void CheckUnSupportAnnot(CPDF_Document * pDoc, CPDF_Annot* pPDFAnnot);
+
+void CPDFSDK_PageView::LoadFXAnnots()
+{
+ CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
+
+ FX_BOOL enableAPUpdate = CPDF_InterForm::UpdatingAPEnabled();
+ //Disable the default AP construction.
+ CPDF_InterForm::EnableUpdateAP(FALSE);
+ m_pAnnotList = new CPDF_AnnotList(m_page);
+ CPDF_InterForm::EnableUpdateAP(enableAPUpdate);
+ int nCount = m_pAnnotList->Count();
+ for(int i=0; i<nCount; i++)
+ {
+ CPDF_Annot* pPDFAnnot = m_pAnnotList->GetAt(i);
+ CPDF_Document * pDoc = this->GetPDFDocument();
+
+ CheckUnSupportAnnot(pDoc, pPDFAnnot);
+
+ CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr();
+ ASSERT(pAnnotHandlerMgr != NULL);
+ if(pAnnotHandlerMgr)
+ {
+ CPDFSDK_Annot* pAnnot = pAnnotHandlerMgr->NewAnnot(pPDFAnnot, this);
+ if(!pAnnot)
+ continue;
+ m_fxAnnotArray.Add(pAnnot);
+
+ pAnnotHandlerMgr->Annot_OnLoad(pAnnot);
+ }
+
+ }
+}
+
+void CPDFSDK_PageView::UpdateRects(CFX_RectArray& rects)
+{
+ for(int i=0; i<rects.GetSize(); i++)
+ {
+ CPDF_Rect rc = rects.GetAt(i);
+ CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
+ pEnv->FFI_Invalidate(m_page, rc.left, rc.top, rc.right, rc.bottom);
+ }
+}
+
+void CPDFSDK_PageView::UpdateView(CPDFSDK_Annot* pAnnot)
+{
+ CPDF_Rect rcWindow;
+
+ CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
+// CPDFSDK_AnnotHandlerMgr* pAnnotHandler = pEnv->GetAnnotHandlerMgr();
+
+ rcWindow = pAnnot->GetRect();//pAnnotHandler->Annot_OnGetViewBBox(this,pAnnot);
+ pEnv->FFI_Invalidate(m_page, rcWindow.left, rcWindow.top, rcWindow.right, rcWindow.bottom);
+
+}
+
+int CPDFSDK_PageView::GetPageIndex()
+{
+ if(m_page)
+ {
+ CPDF_Dictionary* pDic = m_page->m_pFormDict;
+ CPDF_Document* pDoc = m_pSDKDoc->GetDocument();
+ if(pDoc && pDic)
+ {
+ return pDoc->GetPageIndex(pDic->GetObjNum());
+ }
+ }
+ return -1;
+}
+
+FX_BOOL CPDFSDK_PageView::IsValidAnnot(FX_LPVOID p)
+{
+ if (p == NULL) return FALSE;
+ int iCount = m_pAnnotList->Count();
+ for (int i = 0; i < iCount; i++)
+ {
+ if (m_pAnnotList->GetAt(i) == p)
+ return TRUE;
+ }
+ return FALSE;
+}
+
+
+CPDFSDK_Annot* CPDFSDK_PageView::GetFocusAnnot()
+{
+ CPDFSDK_Annot* pFocusAnnot = m_pSDKDoc->GetFocusAnnot();
+ if(!pFocusAnnot)
+ return NULL;
+
+ for(int i=0; i<m_fxAnnotArray.GetSize(); i++)
+ {
+ CPDFSDK_Annot* pAnnot = (CPDFSDK_Annot*)m_fxAnnotArray.GetAt(i);
+ if(pAnnot == pFocusAnnot)
+ return pAnnot;
+ }
+ return NULL;
+}
+
diff --git a/fpdfsdk/src/fsdk_rendercontext.cpp b/fpdfsdk/src/fsdk_rendercontext.cpp
index 55382e160e..89c6179254 100644
--- a/fpdfsdk/src/fsdk_rendercontext.cpp
+++ b/fpdfsdk/src/fsdk_rendercontext.cpp
@@ -1,49 +1,49 @@
-// 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
-
-#include "../include/fsdk_rendercontext.h"
-
-void CRenderContext::Clear()
-{
- m_pDevice = NULL;
- m_pContext = NULL;
- m_pRenderer = NULL;
- m_pAnnots = NULL;
- m_pOptions = NULL;
-#ifdef _WIN32_WCE
- m_pBitmap = NULL;
- m_hBitmap = NULL;
-#endif
-}
-
-CRenderContext::~CRenderContext()
-{
- if (m_pRenderer) delete m_pRenderer;
- if (m_pContext) delete m_pContext;
- if (m_pDevice) delete m_pDevice;
- if (m_pAnnots) delete m_pAnnots;
- if (m_pOptions->m_pOCContext) delete m_pOptions->m_pOCContext;
- if (m_pOptions) delete m_pOptions;
-#ifdef _WIN32_WCE
- if (m_pBitmap) delete m_pBitmap;
- if (m_hBitmap) DeleteObject(m_hBitmap);
-#endif
-}
-
-IFSDK_PAUSE_Adapter::IFSDK_PAUSE_Adapter(IFSDK_PAUSE* IPause )
-{
- m_IPause = IPause;
-}
-
-FX_BOOL IFSDK_PAUSE_Adapter::NeedToPauseNow()
-{
- if (m_IPause->NeedToPauseNow)
- {
- return m_IPause->NeedToPauseNow(m_IPause);
- }else{
- return FALSE;
- }
-}
+// 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
+
+#include "../include/fsdk_rendercontext.h"
+
+void CRenderContext::Clear()
+{
+ m_pDevice = NULL;
+ m_pContext = NULL;
+ m_pRenderer = NULL;
+ m_pAnnots = NULL;
+ m_pOptions = NULL;
+#ifdef _WIN32_WCE
+ m_pBitmap = NULL;
+ m_hBitmap = NULL;
+#endif
+}
+
+CRenderContext::~CRenderContext()
+{
+ if (m_pRenderer) delete m_pRenderer;
+ if (m_pContext) delete m_pContext;
+ if (m_pDevice) delete m_pDevice;
+ if (m_pAnnots) delete m_pAnnots;
+ if (m_pOptions->m_pOCContext) delete m_pOptions->m_pOCContext;
+ if (m_pOptions) delete m_pOptions;
+#ifdef _WIN32_WCE
+ if (m_pBitmap) delete m_pBitmap;
+ if (m_hBitmap) DeleteObject(m_hBitmap);
+#endif
+}
+
+IFSDK_PAUSE_Adapter::IFSDK_PAUSE_Adapter(IFSDK_PAUSE* IPause )
+{
+ m_IPause = IPause;
+}
+
+FX_BOOL IFSDK_PAUSE_Adapter::NeedToPauseNow()
+{
+ if (m_IPause->NeedToPauseNow)
+ {
+ return m_IPause->NeedToPauseNow(m_IPause);
+ }else{
+ return FALSE;
+ }
+}
diff --git a/fpdfsdk/src/fxedit/fxet_ap.cpp b/fpdfsdk/src/fxedit/fxet_ap.cpp
index 9730d37a45..92e5bfc1dd 100644
--- a/fpdfsdk/src/fxedit/fxet_ap.cpp
+++ b/fpdfsdk/src/fxedit/fxet_ap.cpp
@@ -1,225 +1,225 @@
-// 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
-
-#include "../../include/fxedit/fxet_stub.h"
-#include "../../include/fxedit/fx_edit.h"
-#include "../../include/fxedit/fxet_edit.h"
-
-CFX_ByteString GetPDFWordString(IFX_Edit_FontMap * pFontMap, FX_INT32 nFontIndex, FX_WORD Word, FX_WORD SubWord)
-{
- ASSERT (pFontMap != NULL);
-
- CFX_ByteString sWord;
-
- if (CPDF_Font * pPDFFont = pFontMap->GetPDFFont(nFontIndex))
- {
- if (SubWord > 0)
- {
- Word = SubWord;
- }
- else
- {
- FX_DWORD dwCharCode = -1;
-
- if (pPDFFont->IsUnicodeCompatible())
- dwCharCode = pPDFFont->CharCodeFromUnicode(Word);
- else
- dwCharCode = pFontMap->CharCodeFromUnicode(nFontIndex, Word);
-
- if (dwCharCode > 0 )
- {
- pPDFFont->AppendChar(sWord, dwCharCode);
- return sWord;
- }
- }
-
- pPDFFont->AppendChar(sWord, Word);
- }
-
- return sWord;
-}
-
-static CFX_ByteString GetWordRenderString(const CFX_ByteString & strWords)
-{
- if (strWords.GetLength() > 0)
- return PDF_EncodeString(strWords) + " Tj\n";
-
- return "";
-}
-
-static CFX_ByteString GetFontSetString(IFX_Edit_FontMap * pFontMap, FX_INT32 nFontIndex, FX_FLOAT fFontSize)
-{
- CFX_ByteTextBuf sRet;
-
- if (pFontMap)
- {
- CFX_ByteString sFontAlias = pFontMap->GetPDFFontAlias(nFontIndex);
-
- if (sFontAlias.GetLength() > 0 && fFontSize > 0 )
- sRet << "/" << sFontAlias << " " << fFontSize << " Tf\n";
- }
-
- return sRet.GetByteString();
-}
-
-CFX_ByteString IFX_Edit::GetEditAppearanceStream(IFX_Edit* pEdit, const CPDF_Point & ptOffset,
- const CPVT_WordRange * pRange /* = NULL*/, FX_BOOL bContinuous/* = TRUE*/, FX_WORD SubWord/* = 0*/)
-{
- CFX_ByteTextBuf sEditStream, sWords;
-
- CPDF_Point ptOld(0.0f,0.0f),ptNew(0.0f,0.0f);
- FX_INT32 nCurFontIndex = -1;
-
- if (IFX_Edit_Iterator* pIterator = pEdit->GetIterator())
- {
- if (pRange)
- pIterator->SetAt(pRange->BeginPos);
- else
- pIterator->SetAt(0);
-
- CPVT_WordPlace oldplace;
-
- while (pIterator->NextWord())
- {
- CPVT_WordPlace place = pIterator->GetAt();
-
- if (pRange && place.WordCmp(pRange->EndPos) > 0) break;
-
- if (bContinuous)
- {
- if (place.LineCmp(oldplace) != 0)
- {
- if (sWords.GetSize() > 0)
- {
- sEditStream << GetWordRenderString(sWords.GetByteString());
- sWords.Clear();
- }
-
- CPVT_Word word;
- if (pIterator->GetWord(word))
- {
- ptNew = CPDF_Point(word.ptWord.x + ptOffset.x, word.ptWord.y + ptOffset.y);
- }
- else
- {
- CPVT_Line line;
- pIterator->GetLine(line);
- ptNew = CPDF_Point(line.ptLine.x + ptOffset.x, line.ptLine.y + ptOffset.y);
- }
-
- if (ptNew.x != ptOld.x || ptNew.y != ptOld.y)
- {
- sEditStream << ptNew.x - ptOld.x << " " << ptNew.y - ptOld.y << " Td\n";
-
- ptOld = ptNew;
- }
- }
-
- CPVT_Word word;
- if (pIterator->GetWord(word))
- {
- if (word.nFontIndex != nCurFontIndex)
- {
- if (sWords.GetSize() > 0)
- {
- sEditStream << GetWordRenderString(sWords.GetByteString());
- sWords.Clear();
- }
- sEditStream << GetFontSetString(pEdit->GetFontMap(),word.nFontIndex,word.fFontSize);
- nCurFontIndex = word.nFontIndex;
- }
-
- sWords << GetPDFWordString(pEdit->GetFontMap(),nCurFontIndex,word.Word,SubWord);
- }
-
- oldplace = place;
- }
- else
- {
- CPVT_Word word;
- if (pIterator->GetWord(word))
- {
- ptNew = CPDF_Point(word.ptWord.x + ptOffset.x, word.ptWord.y + ptOffset.y);
-
- if (ptNew.x != ptOld.x || ptNew.y != ptOld.y)
- {
- sEditStream << ptNew.x - ptOld.x << " " << ptNew.y - ptOld.y << " Td\n";
- ptOld = ptNew;
- }
-
- if (word.nFontIndex != nCurFontIndex)
- {
- sEditStream << GetFontSetString(pEdit->GetFontMap(),word.nFontIndex,word.fFontSize);
- nCurFontIndex = word.nFontIndex;
- }
-
- sEditStream << GetWordRenderString(GetPDFWordString(pEdit->GetFontMap(),nCurFontIndex,word.Word,SubWord));
- }
- }
- }
-
- if (sWords.GetSize() > 0)
- {
- sEditStream << GetWordRenderString(sWords.GetByteString());
- sWords.Clear();
- }
- }
-
- CFX_ByteTextBuf sAppStream;
- if (sEditStream.GetSize() > 0)
- {
- FX_INT32 nHorzScale = pEdit->GetHorzScale();
- if (nHorzScale != 100)
- {
- sAppStream << nHorzScale << " Tz\n";
- }
-
- FX_FLOAT fCharSpace = pEdit->GetCharSpace();
- if (!FX_EDIT_IsFloatZero(fCharSpace))
- {
- sAppStream << fCharSpace << " Tc\n";
- }
-
- sAppStream << sEditStream;
- }
-
- return sAppStream.GetByteString();
-}
-
-CFX_ByteString IFX_Edit::GetSelectAppearanceStream(IFX_Edit* pEdit, const CPDF_Point & ptOffset,
- const CPVT_WordRange * pRange /*= NULL*/)
-{
- CFX_ByteTextBuf sRet;
-
- if (pRange && pRange->IsExist())
- {
- if (IFX_Edit_Iterator* pIterator = pEdit->GetIterator())
- {
- pIterator->SetAt(pRange->BeginPos);
-
- while (pIterator->NextWord())
- {
- CPVT_WordPlace place = pIterator->GetAt();
-
- if (pRange && place.WordCmp(pRange->EndPos) > 0) break;
-
- CPVT_Word word;
- CPVT_Line line;
- if (pIterator->GetWord(word) && pIterator->GetLine(line))
- {
- //CPDF_Rect rcWordSel = CPDF_Rect(word.ptWord.x,line.ptLine.y + line.fLineDescent,
- // word.ptWord.x+word.fWidth,line.ptLine.y + line.fLineAscent);
-
- sRet << word.ptWord.x + ptOffset.x << " " << line.ptLine.y + line.fLineDescent
- << " " << word.fWidth << " " << line.fLineAscent - line.fLineDescent << " re\nf\n";
- }
- }
- }
- }
-
- return sRet.GetByteString();
-}
-
+// 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
+
+#include "../../include/fxedit/fxet_stub.h"
+#include "../../include/fxedit/fx_edit.h"
+#include "../../include/fxedit/fxet_edit.h"
+
+CFX_ByteString GetPDFWordString(IFX_Edit_FontMap * pFontMap, FX_INT32 nFontIndex, FX_WORD Word, FX_WORD SubWord)
+{
+ ASSERT (pFontMap != NULL);
+
+ CFX_ByteString sWord;
+
+ if (CPDF_Font * pPDFFont = pFontMap->GetPDFFont(nFontIndex))
+ {
+ if (SubWord > 0)
+ {
+ Word = SubWord;
+ }
+ else
+ {
+ FX_DWORD dwCharCode = -1;
+
+ if (pPDFFont->IsUnicodeCompatible())
+ dwCharCode = pPDFFont->CharCodeFromUnicode(Word);
+ else
+ dwCharCode = pFontMap->CharCodeFromUnicode(nFontIndex, Word);
+
+ if (dwCharCode > 0 )
+ {
+ pPDFFont->AppendChar(sWord, dwCharCode);
+ return sWord;
+ }
+ }
+
+ pPDFFont->AppendChar(sWord, Word);
+ }
+
+ return sWord;
+}
+
+static CFX_ByteString GetWordRenderString(const CFX_ByteString & strWords)
+{
+ if (strWords.GetLength() > 0)
+ return PDF_EncodeString(strWords) + " Tj\n";
+
+ return "";
+}
+
+static CFX_ByteString GetFontSetString(IFX_Edit_FontMap * pFontMap, FX_INT32 nFontIndex, FX_FLOAT fFontSize)
+{
+ CFX_ByteTextBuf sRet;
+
+ if (pFontMap)
+ {
+ CFX_ByteString sFontAlias = pFontMap->GetPDFFontAlias(nFontIndex);
+
+ if (sFontAlias.GetLength() > 0 && fFontSize > 0 )
+ sRet << "/" << sFontAlias << " " << fFontSize << " Tf\n";
+ }
+
+ return sRet.GetByteString();
+}
+
+CFX_ByteString IFX_Edit::GetEditAppearanceStream(IFX_Edit* pEdit, const CPDF_Point & ptOffset,
+ const CPVT_WordRange * pRange /* = NULL*/, FX_BOOL bContinuous/* = TRUE*/, FX_WORD SubWord/* = 0*/)
+{
+ CFX_ByteTextBuf sEditStream, sWords;
+
+ CPDF_Point ptOld(0.0f,0.0f),ptNew(0.0f,0.0f);
+ FX_INT32 nCurFontIndex = -1;
+
+ if (IFX_Edit_Iterator* pIterator = pEdit->GetIterator())
+ {
+ if (pRange)
+ pIterator->SetAt(pRange->BeginPos);
+ else
+ pIterator->SetAt(0);
+
+ CPVT_WordPlace oldplace;
+
+ while (pIterator->NextWord())
+ {
+ CPVT_WordPlace place = pIterator->GetAt();
+
+ if (pRange && place.WordCmp(pRange->EndPos) > 0) break;
+
+ if (bContinuous)
+ {
+ if (place.LineCmp(oldplace) != 0)
+ {
+ if (sWords.GetSize() > 0)
+ {
+ sEditStream << GetWordRenderString(sWords.GetByteString());
+ sWords.Clear();
+ }
+
+ CPVT_Word word;
+ if (pIterator->GetWord(word))
+ {
+ ptNew = CPDF_Point(word.ptWord.x + ptOffset.x, word.ptWord.y + ptOffset.y);
+ }
+ else
+ {
+ CPVT_Line line;
+ pIterator->GetLine(line);
+ ptNew = CPDF_Point(line.ptLine.x + ptOffset.x, line.ptLine.y + ptOffset.y);
+ }
+
+ if (ptNew.x != ptOld.x || ptNew.y != ptOld.y)
+ {
+ sEditStream << ptNew.x - ptOld.x << " " << ptNew.y - ptOld.y << " Td\n";
+
+ ptOld = ptNew;
+ }
+ }
+
+ CPVT_Word word;
+ if (pIterator->GetWord(word))
+ {
+ if (word.nFontIndex != nCurFontIndex)
+ {
+ if (sWords.GetSize() > 0)
+ {
+ sEditStream << GetWordRenderString(sWords.GetByteString());
+ sWords.Clear();
+ }
+ sEditStream << GetFontSetString(pEdit->GetFontMap(),word.nFontIndex,word.fFontSize);
+ nCurFontIndex = word.nFontIndex;
+ }
+
+ sWords << GetPDFWordString(pEdit->GetFontMap(),nCurFontIndex,word.Word,SubWord);
+ }
+
+ oldplace = place;
+ }
+ else
+ {
+ CPVT_Word word;
+ if (pIterator->GetWord(word))
+ {
+ ptNew = CPDF_Point(word.ptWord.x + ptOffset.x, word.ptWord.y + ptOffset.y);
+
+ if (ptNew.x != ptOld.x || ptNew.y != ptOld.y)
+ {
+ sEditStream << ptNew.x - ptOld.x << " " << ptNew.y - ptOld.y << " Td\n";
+ ptOld = ptNew;
+ }
+
+ if (word.nFontIndex != nCurFontIndex)
+ {
+ sEditStream << GetFontSetString(pEdit->GetFontMap(),word.nFontIndex,word.fFontSize);
+ nCurFontIndex = word.nFontIndex;
+ }
+
+ sEditStream << GetWordRenderString(GetPDFWordString(pEdit->GetFontMap(),nCurFontIndex,word.Word,SubWord));
+ }
+ }
+ }
+
+ if (sWords.GetSize() > 0)
+ {
+ sEditStream << GetWordRenderString(sWords.GetByteString());
+ sWords.Clear();
+ }
+ }
+
+ CFX_ByteTextBuf sAppStream;
+ if (sEditStream.GetSize() > 0)
+ {
+ FX_INT32 nHorzScale = pEdit->GetHorzScale();
+ if (nHorzScale != 100)
+ {
+ sAppStream << nHorzScale << " Tz\n";
+ }
+
+ FX_FLOAT fCharSpace = pEdit->GetCharSpace();
+ if (!FX_EDIT_IsFloatZero(fCharSpace))
+ {
+ sAppStream << fCharSpace << " Tc\n";
+ }
+
+ sAppStream << sEditStream;
+ }
+
+ return sAppStream.GetByteString();
+}
+
+CFX_ByteString IFX_Edit::GetSelectAppearanceStream(IFX_Edit* pEdit, const CPDF_Point & ptOffset,
+ const CPVT_WordRange * pRange /*= NULL*/)
+{
+ CFX_ByteTextBuf sRet;
+
+ if (pRange && pRange->IsExist())
+ {
+ if (IFX_Edit_Iterator* pIterator = pEdit->GetIterator())
+ {
+ pIterator->SetAt(pRange->BeginPos);
+
+ while (pIterator->NextWord())
+ {
+ CPVT_WordPlace place = pIterator->GetAt();
+
+ if (pRange && place.WordCmp(pRange->EndPos) > 0) break;
+
+ CPVT_Word word;
+ CPVT_Line line;
+ if (pIterator->GetWord(word) && pIterator->GetLine(line))
+ {
+ //CPDF_Rect rcWordSel = CPDF_Rect(word.ptWord.x,line.ptLine.y + line.fLineDescent,
+ // word.ptWord.x+word.fWidth,line.ptLine.y + line.fLineAscent);
+
+ sRet << word.ptWord.x + ptOffset.x << " " << line.ptLine.y + line.fLineDescent
+ << " " << word.fWidth << " " << line.fLineAscent - line.fLineDescent << " re\nf\n";
+ }
+ }
+ }
+ }
+
+ return sRet.GetByteString();
+}
+
diff --git a/fpdfsdk/src/fxedit/fxet_edit.cpp b/fpdfsdk/src/fxedit/fxet_edit.cpp
index 5a6d4d804e..efc7acdca5 100644
--- a/fpdfsdk/src/fxedit/fxet_edit.cpp
+++ b/fpdfsdk/src/fxedit/fxet_edit.cpp
@@ -1,3610 +1,3610 @@
-// 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
-
-#include "../../include/fxedit/fxet_stub.h"
-#include "../../include/fxedit/fxet_edit.h"
-
-#define FX_EDIT_UNDO_MAXITEM 10000
-
-/* ---------------------------- CFX_Edit_Iterator ---------------------------- */
-
-CFX_Edit_Iterator::CFX_Edit_Iterator(CFX_Edit * pEdit,IPDF_VariableText_Iterator * pVTIterator) :
- m_pEdit(pEdit),
- m_pVTIterator(pVTIterator)
-{
-}
-
-CFX_Edit_Iterator::~CFX_Edit_Iterator()
-{
-}
-
-FX_BOOL CFX_Edit_Iterator::NextWord()
-{
- ASSERT(m_pVTIterator != NULL);
-
- return m_pVTIterator->NextWord();
-}
-
-FX_BOOL CFX_Edit_Iterator::NextLine()
-{
- ASSERT(m_pVTIterator != NULL);
-
- return m_pVTIterator->NextLine();
-}
-
-FX_BOOL CFX_Edit_Iterator::NextSection()
-{
- ASSERT(m_pVTIterator != NULL);
-
- return m_pVTIterator->NextSection();
-}
-
-FX_BOOL CFX_Edit_Iterator::PrevWord()
-{
- ASSERT(m_pVTIterator != NULL);
-
- return m_pVTIterator->PrevWord();
-}
-
-FX_BOOL CFX_Edit_Iterator::PrevLine()
-{
- ASSERT(m_pVTIterator != NULL);
-
- return m_pVTIterator->PrevLine();
-}
-
-FX_BOOL CFX_Edit_Iterator::PrevSection()
-{
- ASSERT(m_pVTIterator != NULL);
-
- return m_pVTIterator->PrevSection();
-}
-
-FX_BOOL CFX_Edit_Iterator::GetWord(CPVT_Word & word) const
-{
- ASSERT(m_pEdit != NULL);
- ASSERT(m_pVTIterator != NULL);
-
- if (m_pVTIterator->GetWord(word))
- {
- word.ptWord = m_pEdit->VTToEdit(word.ptWord);
- return TRUE;
- }
-
- return FALSE;
-}
-
-FX_BOOL CFX_Edit_Iterator::GetLine(CPVT_Line & line) const
-{
- ASSERT(m_pEdit != NULL);
- ASSERT(m_pVTIterator != NULL);
-
- if (m_pVTIterator->GetLine(line))
- {
- line.ptLine = m_pEdit->VTToEdit(line.ptLine);
- return TRUE;
- }
-
- return FALSE;
-}
-
-FX_BOOL CFX_Edit_Iterator::GetSection(CPVT_Section & section) const
-{
- ASSERT(m_pEdit != NULL);
- ASSERT(m_pVTIterator != NULL);
-
- if (m_pVTIterator->GetSection(section))
- {
- section.rcSection = m_pEdit->VTToEdit(section.rcSection);
- return TRUE;
- }
-
- return FALSE;
-}
-
-void CFX_Edit_Iterator::SetAt(FX_INT32 nWordIndex)
-{
- ASSERT(m_pVTIterator != NULL);
-
- m_pVTIterator->SetAt(nWordIndex);
-}
-
-void CFX_Edit_Iterator::SetAt(const CPVT_WordPlace & place)
-{
- ASSERT(m_pVTIterator != NULL);
-
- m_pVTIterator->SetAt(place);
-}
-
-const CPVT_WordPlace & CFX_Edit_Iterator::GetAt() const
-{
- ASSERT(m_pVTIterator != NULL);
-
- return m_pVTIterator->GetAt();
-}
-
-IFX_Edit* CFX_Edit_Iterator::GetEdit() const
-{
- return m_pEdit;
-}
-
-/* --------------------------- CFX_Edit_Provider ------------------------------- */
-
-CFX_Edit_Provider::CFX_Edit_Provider(IFX_Edit_FontMap * pFontMap) : m_pFontMap(pFontMap)
-{
- ASSERT(m_pFontMap != NULL);
-}
-
-CFX_Edit_Provider::~CFX_Edit_Provider()
-{
-}
-
-IFX_Edit_FontMap* CFX_Edit_Provider::GetFontMap()
-{
- return m_pFontMap;
-}
-
-FX_INT32 CFX_Edit_Provider::GetCharWidth(FX_INT32 nFontIndex, FX_WORD word, FX_INT32 nWordStyle)
-{
- if (CPDF_Font* pPDFFont = m_pFontMap->GetPDFFont(nFontIndex))
- {
- FX_DWORD charcode = word;
-
- if (pPDFFont->IsUnicodeCompatible())
- charcode = pPDFFont->CharCodeFromUnicode(word);
- else
- charcode = m_pFontMap->CharCodeFromUnicode(nFontIndex, word);
-
- if (charcode != -1)
- return pPDFFont->GetCharWidthF(charcode);
- }
-
- return 0;
-}
-
-FX_INT32 CFX_Edit_Provider::GetTypeAscent(FX_INT32 nFontIndex)
-{
- if (CPDF_Font* pPDFFont = m_pFontMap->GetPDFFont(nFontIndex))
- return pPDFFont->GetTypeAscent();
-
- return 0;
-}
-
-FX_INT32 CFX_Edit_Provider::GetTypeDescent(FX_INT32 nFontIndex)
-{
- if (CPDF_Font* pPDFFont = m_pFontMap->GetPDFFont(nFontIndex))
- return pPDFFont->GetTypeDescent();
-
- return 0;
-}
-
-FX_INT32 CFX_Edit_Provider::GetWordFontIndex(FX_WORD word, FX_INT32 charset, FX_INT32 nFontIndex)
-{
- return m_pFontMap->GetWordFontIndex(word,charset,nFontIndex);
-}
-
-FX_INT32 CFX_Edit_Provider::GetDefaultFontIndex()
-{
- return 0;
-}
-
-FX_BOOL CFX_Edit_Provider::IsLatinWord(FX_WORD word)
-{
- return FX_EDIT_ISLATINWORD(word);
-}
-
-/* --------------------------------- CFX_Edit_Refresh --------------------------------- */
-
-CFX_Edit_Refresh::CFX_Edit_Refresh()
-{
-}
-
-CFX_Edit_Refresh::~CFX_Edit_Refresh()
-{
-}
-
-void CFX_Edit_Refresh::BeginRefresh()
-{
- m_RefreshRects.Empty();
- m_OldLineRects = m_NewLineRects;
-}
-
-void CFX_Edit_Refresh::Push(const CPVT_WordRange & linerange,const CPDF_Rect & rect)
-{
- m_NewLineRects.Add(linerange,rect);
-}
-
-void CFX_Edit_Refresh::NoAnalyse()
-{
- {
- for (FX_INT32 i = 0, sz = m_OldLineRects.GetSize(); i < sz; i++)
- if (CFX_Edit_LineRect * pOldRect = m_OldLineRects.GetAt(i))
- m_RefreshRects.Add(pOldRect->m_rcLine);
- }
-
- {
- for (FX_INT32 i = 0, sz = m_NewLineRects.GetSize(); i < sz; i++)
- if (CFX_Edit_LineRect * pNewRect = m_NewLineRects.GetAt(i))
- m_RefreshRects.Add(pNewRect->m_rcLine);
- }
-}
-
-void CFX_Edit_Refresh::Analyse(FX_INT32 nAlignment)
-{
- FX_BOOL bLineTopChanged = FALSE;
- CPDF_Rect rcResult;
- FX_FLOAT fWidthDiff;
-
- FX_INT32 szMax = FX_EDIT_MAX(m_OldLineRects.GetSize(),m_NewLineRects.GetSize());
- FX_INT32 i = 0;
-
- while (i < szMax)
- {
- CFX_Edit_LineRect * pOldRect = m_OldLineRects.GetAt(i);
- CFX_Edit_LineRect * pNewRect = m_NewLineRects.GetAt(i);
-
- if (pOldRect)
- {
- if (pNewRect)
- {
- if (bLineTopChanged)
- {
- rcResult = pOldRect->m_rcLine;
- rcResult.Union(pNewRect->m_rcLine);
- m_RefreshRects.Add(rcResult);
- }
- else
- {
- if (*pNewRect != *pOldRect)
- {
- if (!pNewRect->IsSameTop(*pOldRect) || !pNewRect->IsSameHeight(*pOldRect))
- {
- bLineTopChanged = TRUE;
- continue;
- }
-
- if (nAlignment == 0)
- {
- if (pNewRect->m_wrLine.BeginPos != pOldRect->m_wrLine.BeginPos)
- {
- rcResult = pOldRect->m_rcLine;
- rcResult.Union(pNewRect->m_rcLine);
- m_RefreshRects.Add(rcResult);
- }
- else
- {
- if (!pNewRect->IsSameLeft(*pOldRect))
- {
- rcResult = pOldRect->m_rcLine;
- rcResult.Union(pNewRect->m_rcLine);
- }
- else
- {
- fWidthDiff = pNewRect->m_rcLine.Width() - pOldRect->m_rcLine.Width();
- rcResult = pNewRect->m_rcLine;
- if (fWidthDiff > 0.0f)
- rcResult.left = rcResult.right - fWidthDiff;
- else
- {
- rcResult.left = rcResult.right;
- rcResult.right += (-fWidthDiff);
- }
- }
- m_RefreshRects.Add(rcResult);
- }
- }
- else
- {
- rcResult = pOldRect->m_rcLine;
- rcResult.Union(pNewRect->m_rcLine);
- m_RefreshRects.Add(rcResult);
- }
- }
- else
- {
- //don't need to do anything
- }
- }
- }
- else
- {
- m_RefreshRects.Add(pOldRect->m_rcLine);
- }
- }
- else
- {
- if (pNewRect)
- {
- m_RefreshRects.Add(pNewRect->m_rcLine);
- }
- else
- {
- //error
- }
- }
- i++;
- }
-}
-
-void CFX_Edit_Refresh::AddRefresh(const CPDF_Rect & rect)
-{
- m_RefreshRects.Add(rect);
-}
-
-const CFX_Edit_RectArray * CFX_Edit_Refresh::GetRefreshRects() const
-{
- return &m_RefreshRects;
-}
-
-void CFX_Edit_Refresh::EndRefresh()
-{
- m_RefreshRects.Empty();
-}
-
-/* ------------------------------------- CFX_Edit_Undo ------------------------------------- */
-
-CFX_Edit_Undo::CFX_Edit_Undo(FX_INT32 nBufsize) : m_nCurUndoPos(0),
- m_nBufSize(nBufsize),
- m_bModified(FALSE),
- m_bVirgin(TRUE),
- m_bWorking(FALSE)
-{
-}
-
-CFX_Edit_Undo::~CFX_Edit_Undo()
-{
- Reset();
-}
-
-FX_BOOL CFX_Edit_Undo::CanUndo() const
-{
- return m_nCurUndoPos > 0;
-}
-
-void CFX_Edit_Undo::Undo()
-{
- m_bWorking = TRUE;
-
- if (m_nCurUndoPos > 0)
- {
- IFX_Edit_UndoItem * pItem = m_UndoItemStack.GetAt(m_nCurUndoPos-1);
- ASSERT(pItem != NULL);
-
- pItem->Undo();
-
- m_nCurUndoPos--;
- m_bModified = (m_nCurUndoPos != 0);
- }
-
- m_bWorking = FALSE;
-}
-
-FX_BOOL CFX_Edit_Undo::CanRedo() const
-{
- return m_nCurUndoPos < m_UndoItemStack.GetSize();
-}
-
-void CFX_Edit_Undo::Redo()
-{
- m_bWorking = TRUE;
-
- FX_INT32 nStackSize = m_UndoItemStack.GetSize();
-
- if (m_nCurUndoPos < nStackSize)
- {
- IFX_Edit_UndoItem * pItem = m_UndoItemStack.GetAt(m_nCurUndoPos);
- ASSERT(pItem != NULL);
-
- pItem->Redo();
-
- m_nCurUndoPos++;
- m_bModified = (m_nCurUndoPos != 0);
- }
-
- m_bWorking = FALSE;
-}
-
-FX_BOOL CFX_Edit_Undo::IsWorking() const
-{
- return m_bWorking;
-}
-
-void CFX_Edit_Undo::AddItem(IFX_Edit_UndoItem* pItem)
-{
- ASSERT(!m_bWorking);
- ASSERT(pItem != NULL);
- ASSERT(m_nBufSize > 1);
-
- if (m_nCurUndoPos < m_UndoItemStack.GetSize())
- RemoveTails();
-
- if (m_UndoItemStack.GetSize() >= m_nBufSize)
- {
- RemoveHeads();
- m_bVirgin = FALSE;
- }
-
- m_UndoItemStack.Add(pItem);
- m_nCurUndoPos = m_UndoItemStack.GetSize();
-
- m_bModified = (m_nCurUndoPos != 0);
-}
-
-FX_BOOL CFX_Edit_Undo::IsModified() const
-{
- if (m_bVirgin)
- return m_bModified;
- else
- return TRUE;
-}
-
-IFX_Edit_UndoItem* CFX_Edit_Undo::GetItem(FX_INT32 nIndex)
-{
- if (nIndex>=0 && nIndex < m_UndoItemStack.GetSize())
- return m_UndoItemStack.GetAt(nIndex);
-
- return NULL;
-}
-
-void CFX_Edit_Undo::RemoveHeads()
-{
- ASSERT(m_UndoItemStack.GetSize() > 1);
-
- IFX_Edit_UndoItem* pItem = m_UndoItemStack.GetAt(0);
- ASSERT(pItem != NULL);
-
- pItem->Release();
- m_UndoItemStack.RemoveAt(0);
-}
-
-void CFX_Edit_Undo::RemoveTails()
-{
- for (FX_INT32 i = m_UndoItemStack.GetSize()-1; i >= m_nCurUndoPos; i--)
- {
- IFX_Edit_UndoItem* pItem = m_UndoItemStack.GetAt(i);
- ASSERT(pItem != NULL);
-
- pItem->Release();
- m_UndoItemStack.RemoveAt(i);
- }
-}
-
-void CFX_Edit_Undo::Reset()
-{
- for (FX_INT32 i=0, sz=m_UndoItemStack.GetSize(); i < sz; i++)
- {
- IFX_Edit_UndoItem * pItem = m_UndoItemStack.GetAt(i);
- ASSERT(pItem != NULL);
-
- pItem->Release();
- }
- m_nCurUndoPos = 0;
- m_UndoItemStack.RemoveAll();
-}
-
-/* -------------------------------- CFX_Edit_GroupUndoItem -------------------------------- */
-
-CFX_Edit_GroupUndoItem::CFX_Edit_GroupUndoItem(const CFX_WideString& sTitle) : m_sTitle(sTitle)
-{
-}
-
-CFX_Edit_GroupUndoItem::~CFX_Edit_GroupUndoItem()
-{
- for (int i=0,sz=m_Items.GetSize(); i<sz; i++)
- {
- CFX_Edit_UndoItem* pUndoItem = m_Items[i];
- ASSERT(pUndoItem != NULL);
-
- pUndoItem->Release();
- }
-
- m_Items.RemoveAll();
-}
-
-void CFX_Edit_GroupUndoItem::AddUndoItem(CFX_Edit_UndoItem* pUndoItem)
-{
- ASSERT(pUndoItem != NULL);
-
- pUndoItem->SetFirst(FALSE);
- pUndoItem->SetLast(FALSE);
-
- m_Items.Add(pUndoItem);
-
- if (m_sTitle.IsEmpty())
- m_sTitle = pUndoItem->GetUndoTitle();
-}
-
-void CFX_Edit_GroupUndoItem::UpdateItems()
-{
- if (m_Items.GetSize() > 0)
- {
- CFX_Edit_UndoItem* pFirstItem = m_Items[0];
- ASSERT(pFirstItem != NULL);
- pFirstItem->SetFirst(TRUE);
-
- CFX_Edit_UndoItem* pLastItem = m_Items[m_Items.GetSize() - 1];
- ASSERT(pLastItem != NULL);
- pLastItem->SetLast(TRUE);
- }
-}
-
-void CFX_Edit_GroupUndoItem::Undo()
-{
- for (int i=m_Items.GetSize()-1; i>=0; i--)
- {
- CFX_Edit_UndoItem* pUndoItem = m_Items[i];
- ASSERT(pUndoItem != NULL);
-
- pUndoItem->Undo();
- }
-}
-
-void CFX_Edit_GroupUndoItem::Redo()
-{
- for (int i=0,sz=m_Items.GetSize(); i<sz; i++)
- {
- CFX_Edit_UndoItem* pUndoItem = m_Items[i];
- ASSERT(pUndoItem != NULL);
-
- pUndoItem->Redo();
- }
-}
-
-CFX_WideString CFX_Edit_GroupUndoItem::GetUndoTitle()
-{
- return m_sTitle;
-}
-
-void CFX_Edit_GroupUndoItem::Release()
-{
- delete this;
-}
-
-/* ------------------------------------- CFX_Edit_UndoItem derived classes ------------------------------------- */
-
-CFXEU_InsertWord::CFXEU_InsertWord(CFX_Edit * pEdit, const CPVT_WordPlace & wpOldPlace, const CPVT_WordPlace & wpNewPlace,
- FX_WORD word, FX_INT32 charset, const CPVT_WordProps * pWordProps)
- : m_pEdit(pEdit), m_wpOld(wpOldPlace), m_wpNew(wpNewPlace), m_Word(word), m_nCharset(charset), m_WordProps()
-{
- if (pWordProps)
- m_WordProps = *pWordProps;
-}
-
-CFXEU_InsertWord::~CFXEU_InsertWord()
-{
-}
-
-void CFXEU_InsertWord::Redo()
-{
- if (m_pEdit)
- {
- m_pEdit->SelectNone();
- m_pEdit->SetCaret(m_wpOld);
- m_pEdit->InsertWord(m_Word,m_nCharset,&m_WordProps,FALSE,TRUE);
- }
-}
-
-void CFXEU_InsertWord::Undo()
-{
- if (m_pEdit)
- {
- m_pEdit->SelectNone();
- m_pEdit->SetCaret(m_wpNew);
- m_pEdit->Backspace(FALSE,TRUE);
- }
-}
-
-/* -------------------------------------------------------------------------- */
-
-CFXEU_InsertReturn::CFXEU_InsertReturn(CFX_Edit * pEdit, const CPVT_WordPlace & wpOldPlace, const CPVT_WordPlace & wpNewPlace,
- const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordProps) :
- m_pEdit(pEdit),
- m_wpOld(wpOldPlace),
- m_wpNew(wpNewPlace),
- m_SecProps(),
- m_WordProps()
-{
- if (pSecProps)
- m_SecProps = *pSecProps;
- if (pWordProps)
- m_WordProps = *pWordProps;
-}
-
-CFXEU_InsertReturn::~CFXEU_InsertReturn()
-{
-}
-
-void CFXEU_InsertReturn::Redo()
-{
- if (m_pEdit)
- {
- m_pEdit->SelectNone();
- m_pEdit->SetCaret(m_wpOld);
- m_pEdit->InsertReturn(&m_SecProps,&m_WordProps,FALSE,TRUE);
- }
-}
-
-void CFXEU_InsertReturn::Undo()
-{
- if (m_pEdit)
- {
- m_pEdit->SelectNone();
- m_pEdit->SetCaret(m_wpNew);
- m_pEdit->Backspace(FALSE,TRUE);
- }
-}
-
-/* -------------------------------------------------------------------------- */
-//CFXEU_Backspace
-
-CFXEU_Backspace::CFXEU_Backspace(CFX_Edit * pEdit, const CPVT_WordPlace & wpOldPlace, const CPVT_WordPlace & wpNewPlace,
- FX_WORD word, FX_INT32 charset,
- const CPVT_SecProps & SecProps, const CPVT_WordProps & WordProps) :
- m_pEdit(pEdit),
- m_wpOld(wpOldPlace),
- m_wpNew(wpNewPlace),
- m_Word(word),
- m_nCharset(charset),
- m_SecProps(SecProps),
- m_WordProps(WordProps)
-{
-}
-
-CFXEU_Backspace::~CFXEU_Backspace()
-{
-}
-
-void CFXEU_Backspace::Redo()
-{
- if (m_pEdit)
- {
- m_pEdit->SelectNone();
- m_pEdit->SetCaret(m_wpOld);
- m_pEdit->Backspace(FALSE,TRUE);
- }
-}
-
-void CFXEU_Backspace::Undo()
-{
- if (m_pEdit)
- {
- m_pEdit->SelectNone();
- m_pEdit->SetCaret(m_wpNew);
- if (m_wpNew.SecCmp(m_wpOld) != 0)
- {
- m_pEdit->InsertReturn(&m_SecProps,&m_WordProps,FALSE,TRUE);
- }
- else
- {
- m_pEdit->InsertWord(m_Word,m_nCharset,&m_WordProps,FALSE,TRUE);
- }
- }
-}
-
-/* -------------------------------------------------------------------------- */
-//CFXEU_Delete
-
-CFXEU_Delete::CFXEU_Delete(CFX_Edit * pEdit, const CPVT_WordPlace & wpOldPlace, const CPVT_WordPlace & wpNewPlace,
- FX_WORD word, FX_INT32 charset,
- const CPVT_SecProps & SecProps, const CPVT_WordProps & WordProps, FX_BOOL bSecEnd) :
- m_pEdit(pEdit),
- m_wpOld(wpOldPlace),
- m_wpNew(wpNewPlace),
- m_Word(word),
- m_nCharset(charset),
- m_SecProps(SecProps),
- m_WordProps(WordProps),
- m_bSecEnd(bSecEnd)
-{
-}
-
-CFXEU_Delete::~CFXEU_Delete()
-{
-}
-
-void CFXEU_Delete::Redo()
-{
- if (m_pEdit)
- {
- m_pEdit->SelectNone();
- m_pEdit->SetCaret(m_wpOld);
- m_pEdit->Delete(FALSE,TRUE);
- }
-}
-
-void CFXEU_Delete::Undo()
-{
- if (m_pEdit)
- {
- m_pEdit->SelectNone();
- m_pEdit->SetCaret(m_wpNew);
- if (m_bSecEnd)
- {
- m_pEdit->InsertReturn(&m_SecProps,&m_WordProps,FALSE,TRUE);
- }
- else
- {
- m_pEdit->InsertWord(m_Word,m_nCharset,&m_WordProps,FALSE,TRUE);
- }
- }
-}
-
-/* -------------------------------------------------------------------------- */
-//CFXEU_Clear
-
-CFXEU_Clear::CFXEU_Clear(CFX_Edit * pEdit, const CPVT_WordRange & wrSel, const CFX_WideString & swText) :
- m_pEdit(pEdit),
- m_wrSel(wrSel),
- m_swText(swText)
-{
-}
-
-CFXEU_Clear::~CFXEU_Clear()
-{
-}
-
-void CFXEU_Clear::Redo()
-{
- if (m_pEdit)
- {
- m_pEdit->SelectNone();
- m_pEdit->SetSel(m_wrSel.BeginPos,m_wrSel.EndPos);
- m_pEdit->Clear(FALSE,TRUE);
- }
-}
-
-void CFXEU_Clear::Undo()
-{
- if (m_pEdit)
- {
- m_pEdit->SelectNone();
- m_pEdit->SetCaret(m_wrSel.BeginPos);
- m_pEdit->InsertText(m_swText, DEFAULT_CHARSET, NULL,NULL,FALSE,TRUE);
- m_pEdit->SetSel(m_wrSel.BeginPos,m_wrSel.EndPos);
- }
-}
-
-/* -------------------------------------------------------------------------- */
-//CFXEU_ClearRich
-
-CFXEU_ClearRich::CFXEU_ClearRich(CFX_Edit * pEdit, const CPVT_WordPlace & wpOldPlace, const CPVT_WordPlace & wpNewPlace,
- const CPVT_WordRange & wrSel, FX_WORD word, FX_INT32 charset,
- const CPVT_SecProps & SecProps, const CPVT_WordProps & WordProps) :
- m_pEdit(pEdit),
- m_wpOld(wpOldPlace),
- m_wpNew(wpNewPlace),
- m_wrSel(wrSel),
- m_Word(word),
- m_nCharset(charset),
- m_SecProps(SecProps),
- m_WordProps(WordProps)
-{
-}
-
-CFXEU_ClearRich::~CFXEU_ClearRich()
-{
-}
-
-void CFXEU_ClearRich::Redo()
-{
- if (m_pEdit && IsLast())
- {
- m_pEdit->SelectNone();
- m_pEdit->SetSel(m_wrSel.BeginPos,m_wrSel.EndPos);
- m_pEdit->Clear(FALSE,TRUE);
- }
-}
-
-void CFXEU_ClearRich::Undo()
-{
- if (m_pEdit)
- {
- m_pEdit->SelectNone();
- m_pEdit->SetCaret(m_wpOld);
- if (m_wpNew.SecCmp(m_wpOld) != 0)
- {
- m_pEdit->InsertReturn(&m_SecProps,&m_WordProps,FALSE,FALSE);
- }
- else
- {
- m_pEdit->InsertWord(m_Word,m_nCharset,&m_WordProps,FALSE,FALSE);
- }
-
- if (IsFirst())
- {
- m_pEdit->PaintInsertText(m_wrSel.BeginPos,m_wrSel.EndPos);
- m_pEdit->SetSel(m_wrSel.BeginPos,m_wrSel.EndPos);
- }
- }
-}
-/* -------------------------------------------------------------------------- */
-//CFXEU_InsertText
-
-CFXEU_InsertText::CFXEU_InsertText(CFX_Edit * pEdit, const CPVT_WordPlace & wpOldPlace, const CPVT_WordPlace & wpNewPlace,
- const CFX_WideString & swText, FX_INT32 charset,
- const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordProps) :
- m_pEdit(pEdit),
- m_wpOld(wpOldPlace),
- m_wpNew(wpNewPlace),
- m_swText(swText),
- m_nCharset(charset),
- m_SecProps(),
- m_WordProps()
-{
- if (pSecProps)
- m_SecProps = *pSecProps;
- if (pWordProps)
- m_WordProps = *pWordProps;
-}
-
-CFXEU_InsertText::~CFXEU_InsertText()
-{
-}
-
-void CFXEU_InsertText::Redo()
-{
- if (m_pEdit && IsLast())
- {
- m_pEdit->SelectNone();
- m_pEdit->SetCaret(m_wpOld);
- m_pEdit->InsertText(m_swText, m_nCharset,&m_SecProps, &m_WordProps,FALSE,TRUE);
- }
-}
-
-void CFXEU_InsertText::Undo()
-{
- if (m_pEdit)
- {
- m_pEdit->SelectNone();
- m_pEdit->SetSel(m_wpOld,m_wpNew);
- m_pEdit->Clear(FALSE,TRUE);
- }
-}
-
-/* -------------------------------------------------------------------------- */
-
-CFXEU_SetSecProps::CFXEU_SetSecProps(CFX_Edit * pEdit, const CPVT_WordPlace & place, EDIT_PROPS_E ep,
- const CPVT_SecProps & oldsecprops, const CPVT_WordProps & oldwordprops,
- const CPVT_SecProps & newsecprops, const CPVT_WordProps & newwordprops, const CPVT_WordRange & range)
- : m_pEdit(pEdit),
- m_wpPlace(place),
- m_eProps(ep),
- m_OldSecProps(oldsecprops),
- m_NewSecProps(newsecprops),
- m_OldWordProps(oldwordprops),
- m_NewWordProps(newwordprops),
- m_wrPlace(range)
-{
-}
-
-CFXEU_SetSecProps::~CFXEU_SetSecProps()
-{
-}
-
-void CFXEU_SetSecProps::Redo()
-{
- if (m_pEdit)
- {
- m_pEdit->SetSecProps(m_eProps,m_wpPlace,&m_NewSecProps,&m_NewWordProps,m_wrPlace,FALSE);
- if (IsLast())
- {
- m_pEdit->SelectNone();
- m_pEdit->PaintSetProps(m_eProps,m_wrPlace);
- m_pEdit->SetSel(m_wrPlace.BeginPos,m_wrPlace.EndPos);
- }
- }
-}
-
-void CFXEU_SetSecProps::Undo()
-{
- if (m_pEdit)
- {
- m_pEdit->SetSecProps(m_eProps,m_wpPlace,&m_OldSecProps,&m_OldWordProps,m_wrPlace,FALSE);
- if (IsFirst())
- {
- m_pEdit->SelectNone();
- m_pEdit->PaintSetProps(m_eProps,m_wrPlace);
- m_pEdit->SetSel(m_wrPlace.BeginPos,m_wrPlace.EndPos);
- }
- }
-}
-
-/* -------------------------------------------------------------------------- */
-
-CFXEU_SetWordProps::CFXEU_SetWordProps(CFX_Edit * pEdit, const CPVT_WordPlace & place, EDIT_PROPS_E ep,
- const CPVT_WordProps & oldprops, const CPVT_WordProps & newprops, const CPVT_WordRange & range)
- : m_pEdit(pEdit),
- m_wpPlace(place),
- m_eProps(ep),
- m_OldWordProps(oldprops),
- m_NewWordProps(newprops),
- m_wrPlace(range)
-{
-}
-
-CFXEU_SetWordProps::~CFXEU_SetWordProps()
-{
-}
-
-void CFXEU_SetWordProps::Redo()
-{
- if (m_pEdit)
- {
- m_pEdit->SetWordProps(m_eProps,m_wpPlace,&m_NewWordProps,m_wrPlace,FALSE);
- if (IsLast())
- {
- m_pEdit->SelectNone();
- m_pEdit->PaintSetProps(m_eProps,m_wrPlace);
- m_pEdit->SetSel(m_wrPlace.BeginPos,m_wrPlace.EndPos);
- }
- }
-}
-
-void CFXEU_SetWordProps::Undo()
-{
- if (m_pEdit)
- {
- m_pEdit->SetWordProps(m_eProps,m_wpPlace,&m_OldWordProps,m_wrPlace,FALSE);
- if (IsFirst())
- {
- m_pEdit->SelectNone();
- m_pEdit->PaintSetProps(m_eProps,m_wrPlace);
- m_pEdit->SetSel(m_wrPlace.BeginPos,m_wrPlace.EndPos);
- }
- }
-}
-
-/* ------------------------------------- CFX_Edit ------------------------------------- */
-
-CFX_Edit::CFX_Edit(IPDF_VariableText * pVT) :
- m_pVT(pVT),
- m_pNotify(NULL),
- m_pOprNotify(NULL),
- m_wpCaret(-1,-1,-1),
- m_wpOldCaret(-1,-1,-1),
- m_ptScrollPos(0,0),
- m_ptRefreshScrollPos(0,0),
- m_bEnableScroll(FALSE),
- m_bEnableOverflow(FALSE),
- m_pVTProvide(NULL),
- m_pIterator(NULL),
- m_SelState(),
- m_ptCaret(0.0f,0.0f),
- m_Undo(FX_EDIT_UNDO_MAXITEM),
- m_nAlignment(0),
- m_bNotifyFlag(FALSE),
- m_bEnableRefresh(TRUE),
- m_rcOldContent(0.0f,0.0f,0.0f,0.0f),
- m_bEnableUndo(TRUE),
- m_bNotify(TRUE),
- m_bOprNotify(FALSE),
- m_pGroupUndoItem(NULL)
-{
- ASSERT(pVT != NULL);
-}
-
-CFX_Edit::~CFX_Edit()
-{
- if (m_pVTProvide)
- {
- delete m_pVTProvide;
- m_pVTProvide = NULL;
- }
-
- if (m_pIterator)
- {
- delete m_pIterator;
- m_pIterator = NULL;
- }
-
- ASSERT(m_pGroupUndoItem == NULL);
-}
-
-// public methods
-
-void CFX_Edit::Initialize()
-{
- m_pVT->Initialize();
- SetCaret(m_pVT->GetBeginWordPlace());
- SetCaretOrigin();
-}
-
-void CFX_Edit::SetFontMap(IFX_Edit_FontMap * pFontMap)
-{
- if (m_pVTProvide)
- delete m_pVTProvide;
-
- m_pVT->SetProvider(m_pVTProvide = new CFX_Edit_Provider(pFontMap));
-}
-
-void CFX_Edit::SetVTProvider(IPDF_VariableText_Provider* pProvider)
-{
- m_pVT->SetProvider(pProvider);
-}
-
-void CFX_Edit::SetNotify(IFX_Edit_Notify* pNotify)
-{
- m_pNotify = pNotify;
-}
-
-void CFX_Edit::SetOprNotify(IFX_Edit_OprNotify* pOprNotify)
-{
- m_pOprNotify = pOprNotify;
-}
-
-IFX_Edit_Iterator * CFX_Edit::GetIterator()
-{
- if (!m_pIterator)
- m_pIterator = new CFX_Edit_Iterator(this,m_pVT->GetIterator());
-
- return m_pIterator;
-}
-
-IPDF_VariableText * CFX_Edit::GetVariableText()
-{
- return m_pVT;
-}
-
-IFX_Edit_FontMap* CFX_Edit::GetFontMap()
-{
- if (m_pVTProvide)
- return m_pVTProvide->GetFontMap();
-
- return NULL;
-}
-
-void CFX_Edit::SetPlateRect(const CPDF_Rect & rect, FX_BOOL bPaint/* = TRUE*/)
-{
- m_pVT->SetPlateRect(rect);
- m_ptScrollPos = CPDF_Point(rect.left,rect.top);
- if (bPaint) Paint();
-}
-
-void CFX_Edit::SetAlignmentH(FX_INT32 nFormat/* =0 */, FX_BOOL bPaint/* = TRUE*/)
-{
- m_pVT->SetAlignment(nFormat);
- if (bPaint) Paint();
-}
-
-void CFX_Edit::SetAlignmentV(FX_INT32 nFormat/* =0 */, FX_BOOL bPaint/* = TRUE*/)
-{
- m_nAlignment = nFormat;
- if (bPaint) Paint();
-}
-
-void CFX_Edit::SetPasswordChar(FX_WORD wSubWord/* ='*' */, FX_BOOL bPaint/* = TRUE*/)
-{
- m_pVT->SetPasswordChar(wSubWord);
- if (bPaint) Paint();
-}
-
-void CFX_Edit::SetLimitChar(FX_INT32 nLimitChar/* =0 */, FX_BOOL bPaint/* = TRUE*/)
-{
- m_pVT->SetLimitChar(nLimitChar);
- if (bPaint) Paint();
-}
-
-void CFX_Edit::SetCharArray(FX_INT32 nCharArray/* =0 */, FX_BOOL bPaint/* = TRUE*/)
-{
- m_pVT->SetCharArray(nCharArray);
- if (bPaint) Paint();
-}
-
-void CFX_Edit::SetCharSpace(FX_FLOAT fCharSpace/* =0.0f */, FX_BOOL bPaint/* = TRUE*/)
-{
- m_pVT->SetCharSpace(fCharSpace);
- if (bPaint) Paint();
-}
-
-void CFX_Edit::SetHorzScale(FX_INT32 nHorzScale/* =100 */, FX_BOOL bPaint/* = TRUE*/)
-{
- m_pVT->SetHorzScale(nHorzScale);
- if (bPaint) Paint();
-}
-
-void CFX_Edit::SetMultiLine(FX_BOOL bMultiLine/* =TRUE */, FX_BOOL bPaint/* = TRUE*/)
-{
- m_pVT->SetMultiLine(bMultiLine);
- if (bPaint) Paint();
-}
-
-void CFX_Edit::SetAutoReturn(FX_BOOL bAuto/* =TRUE */, FX_BOOL bPaint/* = TRUE*/)
-{
- m_pVT->SetAutoReturn(bAuto);
- if (bPaint) Paint();
-}
-
-void CFX_Edit::SetLineLeading(FX_FLOAT fLineLeading/* =TRUE */, FX_BOOL bPaint/* = TRUE*/)
-{
- m_pVT->SetLineLeading(fLineLeading);
- if (bPaint) Paint();
-}
-
-void CFX_Edit::SetAutoFontSize(FX_BOOL bAuto/* =TRUE */, FX_BOOL bPaint/* = TRUE*/)
-{
- m_pVT->SetAutoFontSize(bAuto);
- if (bPaint) Paint();
-}
-
-void CFX_Edit::SetFontSize(FX_FLOAT fFontSize, FX_BOOL bPaint/* = TRUE*/)
-{
- m_pVT->SetFontSize(fFontSize);
- if (bPaint) Paint();
-}
-
-void CFX_Edit::SetAutoScroll(FX_BOOL bAuto/* =TRUE */, FX_BOOL bPaint/* = TRUE*/)
-{
- m_bEnableScroll = bAuto;
- if (bPaint) Paint();
-}
-
-void CFX_Edit::SetTextOverflow(FX_BOOL bAllowed /*= FALSE*/, FX_BOOL bPaint/* = TRUE*/)
-{
- m_bEnableOverflow = bAllowed;
- if (bPaint) Paint();
-}
-
-void CFX_Edit::SetSel(FX_INT32 nStartChar,FX_INT32 nEndChar)
-{
- if (m_pVT->IsValid())
- {
- if (nStartChar == 0 && nEndChar < 0)
- {
- SelectAll();
- }
- else if (nStartChar < 0)
- {
- this->SelectNone();
- }
- else
- {
- if (nStartChar < nEndChar)
- {
- SetSel(m_pVT->WordIndexToWordPlace(nStartChar),m_pVT->WordIndexToWordPlace(nEndChar));
- }
- else
- {
- SetSel(m_pVT->WordIndexToWordPlace(nEndChar),m_pVT->WordIndexToWordPlace(nStartChar));
- }
- }
- }
-}
-
-void CFX_Edit::SetSel(const CPVT_WordPlace & begin,const CPVT_WordPlace & end)
-{
- if (m_pVT->IsValid())
- {
- SelectNone();
-
- m_SelState.Set(begin,end);
-
- SetCaret(m_SelState.EndPos);
-
- if (m_SelState.IsExist())
- {
- ScrollToCaret();
- CPVT_WordRange wr(m_SelState.BeginPos,m_SelState.EndPos);
- Refresh(RP_OPTIONAL,&wr);
- SetCaretInfo();
- }
- else
- {
- ScrollToCaret();
- SetCaretInfo();
- }
- }
-}
-
-void CFX_Edit::GetSel(FX_INT32 & nStartChar, FX_INT32 & nEndChar) const
-{
- nStartChar = -1;
- nEndChar = -1;
-
- if (m_pVT->IsValid())
- {
- if (m_SelState.IsExist())
- {
- if (m_SelState.BeginPos.WordCmp(m_SelState.EndPos)<0)
- {
- nStartChar = m_pVT->WordPlaceToWordIndex(m_SelState.BeginPos);
- nEndChar = m_pVT->WordPlaceToWordIndex(m_SelState.EndPos);
- }
- else
- {
- nStartChar = m_pVT->WordPlaceToWordIndex(m_SelState.EndPos);
- nEndChar = m_pVT->WordPlaceToWordIndex(m_SelState.BeginPos);
- }
- }
- else
- {
- nStartChar = m_pVT->WordPlaceToWordIndex(m_wpCaret);
- nEndChar = m_pVT->WordPlaceToWordIndex(m_wpCaret);
- }
- }
-}
-
-FX_INT32 CFX_Edit::GetCaret() const
-{
- if (m_pVT->IsValid())
- return m_pVT->WordPlaceToWordIndex(m_wpCaret);
-
- return -1;
-}
-
-CPVT_WordPlace CFX_Edit::GetCaretWordPlace() const
-{
- return m_wpCaret;
-}
-
-CFX_WideString CFX_Edit::GetText() const
-{
- CFX_WideString swRet;
-
- if (m_pVT->IsValid())
- {
- if (IPDF_VariableText_Iterator * pIterator = m_pVT->GetIterator())
- {
- FX_BOOL bRich = m_pVT->IsRichText();
-
- pIterator->SetAt(0);
-
- CPVT_Word wordinfo;
- CPVT_WordPlace oldplace = pIterator->GetAt();
- while (pIterator->NextWord())
- {
- CPVT_WordPlace place = pIterator->GetAt();
-
- if (pIterator->GetWord(wordinfo))
- {
- if (bRich)
- {
- swRet += wordinfo.Word;
- }
- else
- {
- swRet += wordinfo.Word;
- }
- }
-
- if (oldplace.SecCmp(place) != 0)
- {
- swRet += 0x0D;
- swRet += 0x0A;
- }
-
- oldplace = place;
- }
- }
- }
-
- return swRet;
-}
-
-CFX_WideString CFX_Edit::GetRangeText(const CPVT_WordRange & range) const
-{
- CFX_WideString swRet;
-
- if (m_pVT->IsValid())
- {
- FX_BOOL bRich = m_pVT->IsRichText();
-
- if (IPDF_VariableText_Iterator * pIterator = m_pVT->GetIterator())
- {
- CPVT_WordRange wrTemp = range;
- m_pVT->UpdateWordPlace(wrTemp.BeginPos);
- m_pVT->UpdateWordPlace(wrTemp.EndPos);
- pIterator->SetAt(wrTemp.BeginPos);
-
- CPVT_Word wordinfo;
- CPVT_WordPlace oldplace = wrTemp.BeginPos;
- while (pIterator->NextWord())
- {
- CPVT_WordPlace place = pIterator->GetAt();
- if (place.WordCmp(wrTemp.EndPos) > 0)break;
-
- if (pIterator->GetWord(wordinfo))
- {
- if (bRich)
- {
- swRet += wordinfo.Word;
- }
- else
- {
- swRet += wordinfo.Word;
- }
- }
-
- if (oldplace.SecCmp(place) != 0)
- {
- swRet += 0x0D;
- swRet += 0x0A;
- }
-
- oldplace = place;
- }
- }
- }
-
- return swRet;
-}
-
-CFX_WideString CFX_Edit::GetSelText() const
-{
- return GetRangeText(m_SelState.ConvertToWordRange());
-}
-
-FX_INT32 CFX_Edit::GetTotalWords() const
-{
- return m_pVT->GetTotalWords();
-}
-
-FX_INT32 CFX_Edit::GetTotalLines() const
-{
- FX_INT32 nLines = 0;
-
- if (IPDF_VariableText_Iterator * pIterator = m_pVT->GetIterator())
- {
- pIterator->SetAt(0);
- while (pIterator->NextLine())
- nLines++;
- }
-
- return nLines+1;
-}
-
-CPVT_WordRange CFX_Edit::GetSelectWordRange() const
-{
- return m_SelState.ConvertToWordRange();
-}
-
-CPVT_WordRange CFX_Edit::CombineWordRange(const CPVT_WordRange & wr1, const CPVT_WordRange & wr2)
-{
- CPVT_WordRange wrRet;
-
- if (wr1.BeginPos.WordCmp(wr2.BeginPos) < 0)
- {
- wrRet.BeginPos = wr1.BeginPos;
- }
- else
- {
- wrRet.BeginPos = wr2.BeginPos;
- }
-
- if (wr1.EndPos.WordCmp(wr2.EndPos) < 0)
- {
- wrRet.EndPos = wr2.EndPos;
- }
- else
- {
- wrRet.EndPos = wr1.EndPos;
- }
-
- return wrRet;
-}
-
-FX_BOOL CFX_Edit::IsRichText() const
-{
- return m_pVT->IsRichText();
-}
-
-void CFX_Edit::SetRichText(FX_BOOL bRichText/* =TRUE */, FX_BOOL bPaint/* = TRUE*/)
-{
- m_pVT->SetRichText(bRichText);
- if (bPaint) Paint();
-}
-
-FX_BOOL CFX_Edit::SetRichFontIndex(FX_INT32 nFontIndex)
-{
- CPVT_WordProps WordProps;
- WordProps.nFontIndex = nFontIndex;
- return SetRichTextProps(EP_FONTINDEX,NULL,&WordProps);
-}
-
-FX_BOOL CFX_Edit::SetRichFontSize(FX_FLOAT fFontSize)
-{
- CPVT_WordProps WordProps;
- WordProps.fFontSize = fFontSize;
- return SetRichTextProps(EP_FONTSIZE,NULL,&WordProps);
-}
-
-FX_BOOL CFX_Edit::SetRichTextColor(FX_COLORREF dwColor)
-{
- CPVT_WordProps WordProps;
- WordProps.dwWordColor = dwColor;
- return SetRichTextProps(EP_WORDCOLOR,NULL,&WordProps);
-}
-
-FX_BOOL CFX_Edit::SetRichTextScript(FX_INT32 nScriptType)
-{
- CPVT_WordProps WordProps;
- WordProps.nScriptType = nScriptType;
- return SetRichTextProps(EP_SCRIPTTYPE,NULL,&WordProps);
-}
-
-FX_BOOL CFX_Edit::SetRichTextBold(FX_BOOL bBold)
-{
- CPVT_WordProps WordProps;
- if (bBold)
- WordProps.nWordStyle |= PVTWORD_STYLE_BOLD;
- return SetRichTextProps(EP_BOLD,NULL,&WordProps);
-}
-
-FX_BOOL CFX_Edit::SetRichTextItalic(FX_BOOL bItalic)
-{
- CPVT_WordProps WordProps;
- if (bItalic)
- WordProps.nWordStyle |= PVTWORD_STYLE_ITALIC;
- return SetRichTextProps(EP_ITALIC,NULL,&WordProps);
-}
-
-FX_BOOL CFX_Edit::SetRichTextUnderline(FX_BOOL bUnderline)
-{
- CPVT_WordProps WordProps;
- if (bUnderline)
- WordProps.nWordStyle |= PVTWORD_STYLE_UNDERLINE;
- return SetRichTextProps(EP_UNDERLINE,NULL,&WordProps);
-}
-
-FX_BOOL CFX_Edit::SetRichTextCrossout(FX_BOOL bCrossout)
-{
- CPVT_WordProps WordProps;
- if (bCrossout)
- WordProps.nWordStyle |= PVTWORD_STYLE_CROSSOUT;
- return SetRichTextProps(EP_CROSSOUT,NULL,&WordProps);
-}
-
-FX_BOOL CFX_Edit::SetRichTextCharSpace(FX_FLOAT fCharSpace)
-{
- CPVT_WordProps WordProps;
- WordProps.fCharSpace = fCharSpace;
- return SetRichTextProps(EP_CHARSPACE,NULL,&WordProps);
-}
-
-FX_BOOL CFX_Edit::SetRichTextHorzScale(FX_INT32 nHorzScale /*= 100*/)
-{
- CPVT_WordProps WordProps;
- WordProps.nHorzScale = nHorzScale;
- return SetRichTextProps(EP_HORZSCALE,NULL,&WordProps);
-}
-
-FX_BOOL CFX_Edit::SetRichTextLineLeading(FX_FLOAT fLineLeading)
-{
- CPVT_SecProps SecProps;
- SecProps.fLineLeading = fLineLeading;
- return SetRichTextProps(EP_LINELEADING,&SecProps,NULL);
-}
-
-FX_BOOL CFX_Edit::SetRichTextLineIndent(FX_FLOAT fLineIndent)
-{
- CPVT_SecProps SecProps;
- SecProps.fLineIndent = fLineIndent;
- return SetRichTextProps(EP_LINEINDENT,&SecProps,NULL);
-}
-
-FX_BOOL CFX_Edit::SetRichTextAlignment(FX_INT32 nAlignment)
-{
- CPVT_SecProps SecProps;
- SecProps.nAlignment = nAlignment;
- return SetRichTextProps(EP_ALIGNMENT,&SecProps,NULL);
-}
-
-FX_BOOL CFX_Edit::SetRichTextProps(EDIT_PROPS_E eProps, const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordProps)
-{
- FX_BOOL bSet = FALSE;
- FX_BOOL bSet1,bSet2;
- if (m_pVT->IsValid() && m_pVT->IsRichText())
- {
- if (IPDF_VariableText_Iterator * pIterator = m_pVT->GetIterator())
- {
- CPVT_WordRange wrTemp = m_SelState.ConvertToWordRange();
-
- m_pVT->UpdateWordPlace(wrTemp.BeginPos);
- m_pVT->UpdateWordPlace(wrTemp.EndPos);
- pIterator->SetAt(wrTemp.BeginPos);
-
- BeginGroupUndo(L"");;
-
- bSet = SetSecProps(eProps,wrTemp.BeginPos,pSecProps,pWordProps,wrTemp,TRUE);
-
- while (pIterator->NextWord())
- {
- CPVT_WordPlace place = pIterator->GetAt();
- if (place.WordCmp(wrTemp.EndPos) > 0) break;
- bSet1 = SetSecProps(eProps,place,pSecProps,pWordProps,wrTemp,TRUE);
- bSet2 = SetWordProps(eProps,place,pWordProps,wrTemp,TRUE);
-
- if (!bSet)
- bSet = (bSet1 || bSet2);
- }
-
- EndGroupUndo();
-
- if (bSet)
- {
- PaintSetProps(eProps,wrTemp);
- }
- }
- }
-
- return bSet;
-}
-
-void CFX_Edit::PaintSetProps(EDIT_PROPS_E eProps, const CPVT_WordRange & wr)
-{
- switch(eProps)
- {
- case EP_LINELEADING:
- case EP_LINEINDENT:
- case EP_ALIGNMENT:
- RearrangePart(wr);
- ScrollToCaret();
- Refresh(RP_ANALYSE);
- SetCaretOrigin();
- SetCaretInfo();
- break;
- case EP_WORDCOLOR:
- case EP_UNDERLINE:
- case EP_CROSSOUT:
- Refresh(RP_OPTIONAL,&wr);
- break;
- case EP_FONTINDEX:
- case EP_FONTSIZE:
- case EP_SCRIPTTYPE:
- case EP_CHARSPACE:
- case EP_HORZSCALE:
- case EP_BOLD:
- case EP_ITALIC:
- RearrangePart(wr);
- ScrollToCaret();
-
- CPVT_WordRange wrRefresh(m_pVT->GetSectionBeginPlace(wr.BeginPos),
- m_pVT->GetSectionEndPlace(wr.EndPos));
- Refresh(RP_ANALYSE,&wrRefresh);
-
- SetCaretOrigin();
- SetCaretInfo();
- break;
- }
-}
-
-FX_BOOL CFX_Edit::SetSecProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place,
- const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordProps,
- const CPVT_WordRange & wr, FX_BOOL bAddUndo)
-{
- if (m_pVT->IsValid() && m_pVT->IsRichText())
- {
- if (IPDF_VariableText_Iterator * pIterator = m_pVT->GetIterator())
- {
- FX_BOOL bSet = FALSE;
- CPVT_Section secinfo;
- CPVT_Section OldSecinfo;
-
- CPVT_WordPlace oldplace = pIterator->GetAt();
-
- if (eProps == EP_LINELEADING || eProps == EP_LINEINDENT || eProps == EP_ALIGNMENT)
- {
- if (pSecProps)
- {
- pIterator->SetAt(place);
- if (pIterator->GetSection(secinfo))
- {
- if (bAddUndo) OldSecinfo = secinfo;
-
- switch(eProps)
- {
- case EP_LINELEADING:
- if (!FX_EDIT_IsFloatEqual(secinfo.SecProps.fLineLeading,pSecProps->fLineLeading))
- {
- secinfo.SecProps.fLineLeading = pSecProps->fLineLeading;
- bSet = TRUE;
- }
- break;
- case EP_LINEINDENT:
- if (!FX_EDIT_IsFloatEqual(secinfo.SecProps.fLineIndent,pSecProps->fLineIndent))
- {
- secinfo.SecProps.fLineIndent = pSecProps->fLineIndent;
- bSet = TRUE;
- }
- break;
- case EP_ALIGNMENT:
- if (secinfo.SecProps.nAlignment != pSecProps->nAlignment)
- {
- secinfo.SecProps.nAlignment = pSecProps->nAlignment;
- bSet = TRUE;
- }
- break;
- default:
- break;
- }
- }
- }
- }
- else
- {
- if (pWordProps && place == m_pVT->GetSectionBeginPlace(place))
- {
- pIterator->SetAt(place);
- if (pIterator->GetSection(secinfo))
- {
- if (bAddUndo) OldSecinfo = secinfo;
-
- switch(eProps)
- {
- case EP_FONTINDEX:
- if (secinfo.WordProps.nFontIndex != pWordProps->nFontIndex)
- {
- secinfo.WordProps.nFontIndex = pWordProps->nFontIndex;
- bSet = TRUE;
- }
- break;
- case EP_FONTSIZE:
- if (!FX_EDIT_IsFloatEqual(secinfo.WordProps.fFontSize,pWordProps->fFontSize))
- {
- secinfo.WordProps.fFontSize = pWordProps->fFontSize;
- bSet = TRUE;
- }
- break;
- case EP_WORDCOLOR:
- if (secinfo.WordProps.dwWordColor != pWordProps->dwWordColor)
- {
- secinfo.WordProps.dwWordColor = pWordProps->dwWordColor;
- bSet = TRUE;
- }
- break;
- case EP_SCRIPTTYPE:
- if (secinfo.WordProps.nScriptType != pWordProps->nScriptType)
- {
- secinfo.WordProps.nScriptType = pWordProps->nScriptType;
- bSet = TRUE;
- }
- break;
- case EP_CHARSPACE:
- if (!FX_EDIT_IsFloatEqual(secinfo.WordProps.fCharSpace,pWordProps->fCharSpace))
- {
- secinfo.WordProps.fCharSpace = pWordProps->fCharSpace;
- bSet = TRUE;
- }
- break;
- case EP_HORZSCALE:
- if (secinfo.WordProps.nHorzScale != pWordProps->nHorzScale)
- {
- secinfo.WordProps.nHorzScale = pWordProps->nHorzScale;
- bSet = TRUE;
- }
- break;
- case EP_UNDERLINE:
- if (pWordProps->nWordStyle & PVTWORD_STYLE_UNDERLINE)
- {
- if ((secinfo.WordProps.nWordStyle & PVTWORD_STYLE_UNDERLINE) == 0)
- {
- secinfo.WordProps.nWordStyle |= PVTWORD_STYLE_UNDERLINE;
- bSet = TRUE;
- }
- }
- else
- {
- if ((secinfo.WordProps.nWordStyle & PVTWORD_STYLE_UNDERLINE) != 0)
- {
- secinfo.WordProps.nWordStyle &= ~PVTWORD_STYLE_UNDERLINE;
- bSet = TRUE;
- }
- }
- break;
- case EP_CROSSOUT:
- if (pWordProps->nWordStyle & PVTWORD_STYLE_CROSSOUT)
- {
- if ((secinfo.WordProps.nWordStyle & PVTWORD_STYLE_CROSSOUT) == 0)
- {
- secinfo.WordProps.nWordStyle |= PVTWORD_STYLE_CROSSOUT;
- bSet = TRUE;
- }
- }
- else
- {
- if ((secinfo.WordProps.nWordStyle & PVTWORD_STYLE_CROSSOUT) != 0)
- {
- secinfo.WordProps.nWordStyle &= ~PVTWORD_STYLE_CROSSOUT;
- bSet = TRUE;
- }
- }
- break;
- case EP_BOLD:
- if (pWordProps->nWordStyle & PVTWORD_STYLE_BOLD)
- {
- if ((secinfo.WordProps.nWordStyle & PVTWORD_STYLE_BOLD) == 0)
- {
- secinfo.WordProps.nWordStyle |= PVTWORD_STYLE_BOLD;
- bSet = TRUE;
- }
- }
- else
- {
- if ((secinfo.WordProps.nWordStyle & PVTWORD_STYLE_BOLD) != 0)
- {
- secinfo.WordProps.nWordStyle &= ~PVTWORD_STYLE_BOLD;
- bSet = TRUE;
- }
- }
- break;
- case EP_ITALIC:
- if (pWordProps->nWordStyle & PVTWORD_STYLE_ITALIC)
- {
- if ((secinfo.WordProps.nWordStyle & PVTWORD_STYLE_ITALIC) == 0)
- {
- secinfo.WordProps.nWordStyle |= PVTWORD_STYLE_ITALIC;
- bSet = TRUE;
- }
- }
- else
- {
- if ((secinfo.WordProps.nWordStyle & PVTWORD_STYLE_ITALIC) != 0)
- {
- secinfo.WordProps.nWordStyle &= ~PVTWORD_STYLE_ITALIC;
- bSet = TRUE;
- }
- }
- break;
- default:
- break;
- }
- }
- }
- }
-
- if (bSet)
- {
- pIterator->SetSection(secinfo);
-
- if (bAddUndo && m_bEnableUndo)
- {
- AddEditUndoItem(new CFXEU_SetSecProps
- (this,place,eProps,OldSecinfo.SecProps,OldSecinfo.WordProps,secinfo.SecProps,secinfo.WordProps,wr));
- }
- }
-
- pIterator->SetAt(oldplace);
-
- return bSet;
- }
- }
-
- return FALSE;
-}
-
-FX_BOOL CFX_Edit::SetWordProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place,
- const CPVT_WordProps * pWordProps, const CPVT_WordRange & wr, FX_BOOL bAddUndo)
-{
- if (m_pVT->IsValid() && m_pVT->IsRichText())
- {
- if (IPDF_VariableText_Iterator * pIterator = m_pVT->GetIterator())
- {
- FX_BOOL bSet = FALSE;
- CPVT_Word wordinfo;
- CPVT_Word OldWordinfo;
-
- CPVT_WordPlace oldplace = pIterator->GetAt();
-
- if (pWordProps)
- {
- pIterator->SetAt(place);
- if (pIterator->GetWord(wordinfo))
- {
- if (bAddUndo) OldWordinfo = wordinfo;
-
- switch(eProps)
- {
- case EP_FONTINDEX:
- if (wordinfo.WordProps.nFontIndex != pWordProps->nFontIndex)
- {
- if (IFX_Edit_FontMap* pFontMap = this->GetFontMap())
- {
- wordinfo.WordProps.nFontIndex = pFontMap->GetWordFontIndex(wordinfo.Word,wordinfo.nCharset,pWordProps->nFontIndex);
- }
- bSet = TRUE;
- }
- break;
- case EP_FONTSIZE:
- if (!FX_EDIT_IsFloatEqual(wordinfo.WordProps.fFontSize,pWordProps->fFontSize))
- {
- wordinfo.WordProps.fFontSize = pWordProps->fFontSize;
- bSet = TRUE;
- }
- break;
- case EP_WORDCOLOR:
- if (wordinfo.WordProps.dwWordColor != pWordProps->dwWordColor)
- {
- wordinfo.WordProps.dwWordColor = pWordProps->dwWordColor;
- bSet = TRUE;
- }
- break;
- case EP_SCRIPTTYPE:
- if (wordinfo.WordProps.nScriptType != pWordProps->nScriptType)
- {
- wordinfo.WordProps.nScriptType = pWordProps->nScriptType;
- bSet = TRUE;
- }
- break;
- case EP_CHARSPACE:
- if (!FX_EDIT_IsFloatEqual(wordinfo.WordProps.fCharSpace,pWordProps->fCharSpace))
- {
- wordinfo.WordProps.fCharSpace = pWordProps->fCharSpace;
- bSet = TRUE;
- }
- break;
- case EP_HORZSCALE:
- if (wordinfo.WordProps.nHorzScale != pWordProps->nHorzScale)
- {
- wordinfo.WordProps.nHorzScale = pWordProps->nHorzScale;
- bSet = TRUE;
- }
- break;
- case EP_UNDERLINE:
- if (pWordProps->nWordStyle & PVTWORD_STYLE_UNDERLINE)
- {
- if ((wordinfo.WordProps.nWordStyle & PVTWORD_STYLE_UNDERLINE) == 0)
- {
- wordinfo.WordProps.nWordStyle |= PVTWORD_STYLE_UNDERLINE;
- bSet = TRUE;
- }
- }
- else
- {
- if ((wordinfo.WordProps.nWordStyle & PVTWORD_STYLE_UNDERLINE) != 0)
- {
- wordinfo.WordProps.nWordStyle &= ~PVTWORD_STYLE_UNDERLINE;
- bSet = TRUE;
- }
- }
- break;
- case EP_CROSSOUT:
- if (pWordProps->nWordStyle & PVTWORD_STYLE_CROSSOUT)
- {
- if ((wordinfo.WordProps.nWordStyle & PVTWORD_STYLE_CROSSOUT) == 0)
- {
- wordinfo.WordProps.nWordStyle |= PVTWORD_STYLE_CROSSOUT;
- bSet = TRUE;
- }
- }
- else
- {
- if ((wordinfo.WordProps.nWordStyle & PVTWORD_STYLE_CROSSOUT) != 0)
- {
- wordinfo.WordProps.nWordStyle &= ~PVTWORD_STYLE_CROSSOUT;
- bSet = TRUE;
- }
- }
- break;
- case EP_BOLD:
- if (pWordProps->nWordStyle & PVTWORD_STYLE_BOLD)
- {
- if ((wordinfo.WordProps.nWordStyle & PVTWORD_STYLE_BOLD) == 0)
- {
- wordinfo.WordProps.nWordStyle |= PVTWORD_STYLE_BOLD;
- bSet = TRUE;
- }
- }
- else
- {
- if ((wordinfo.WordProps.nWordStyle & PVTWORD_STYLE_BOLD) != 0)
- {
- wordinfo.WordProps.nWordStyle &= ~PVTWORD_STYLE_BOLD;
- bSet = TRUE;
- }
- }
- break;
- case EP_ITALIC:
- if (pWordProps->nWordStyle & PVTWORD_STYLE_ITALIC)
- {
- if ((wordinfo.WordProps.nWordStyle & PVTWORD_STYLE_ITALIC) == 0)
- {
- wordinfo.WordProps.nWordStyle |= PVTWORD_STYLE_ITALIC;
- bSet = TRUE;
- }
- }
- else
- {
- if ((wordinfo.WordProps.nWordStyle & PVTWORD_STYLE_ITALIC) != 0)
- {
- wordinfo.WordProps.nWordStyle &= ~PVTWORD_STYLE_ITALIC;
- bSet = TRUE;
- }
- }
- break;
- default:
- break;
- }
- }
- }
-
- if (bSet)
- {
- pIterator->SetWord(wordinfo);
-
- if (bAddUndo && m_bEnableUndo)
- {
- AddEditUndoItem(new CFXEU_SetWordProps
- (this,place,eProps,OldWordinfo.WordProps,wordinfo.WordProps,wr));
- }
- }
-
- pIterator->SetAt(oldplace);
- return bSet;
- }
- }
-
- return FALSE;
-}
-
-void CFX_Edit::SetText(FX_LPCWSTR text,FX_INT32 charset /*= DEFAULT_CHARSET*/,
- const CPVT_SecProps * pSecProps /*= NULL*/,const CPVT_WordProps * pWordProps /*= NULL*/)
-{
- SetText(text,charset,pSecProps,pWordProps,TRUE,TRUE);
-}
-
-FX_BOOL CFX_Edit::InsertWord(FX_WORD word, FX_INT32 charset /*= DEFAULT_CHARSET*/, const CPVT_WordProps * pWordProps /*= NULL*/)
-{
- return InsertWord(word,charset,pWordProps,TRUE,TRUE);
-}
-
-FX_BOOL CFX_Edit::InsertReturn(const CPVT_SecProps * pSecProps /*= NULL*/,const CPVT_WordProps * pWordProps /*= NULL*/)
-{
- return InsertReturn(pSecProps,pWordProps,TRUE,TRUE);
-}
-
-FX_BOOL CFX_Edit::Backspace()
-{
- return Backspace(TRUE,TRUE);
-}
-
-FX_BOOL CFX_Edit::Delete()
-{
- return Delete(TRUE,TRUE);
-}
-
-FX_BOOL CFX_Edit::Clear()
-{
- return Clear(TRUE,TRUE);
-}
-
-FX_BOOL CFX_Edit::InsertText(FX_LPCWSTR text, FX_INT32 charset /*= DEFAULT_CHARSET*/,
- const CPVT_SecProps * pSecProps /*= NULL*/,const CPVT_WordProps * pWordProps /*= NULL*/)
-{
- return InsertText(text,charset,pSecProps,pWordProps,TRUE,TRUE);
-}
-
-FX_FLOAT CFX_Edit::GetFontSize() const
-{
- return m_pVT->GetFontSize();
-}
-
-FX_WORD CFX_Edit::GetPasswordChar() const
-{
- return m_pVT->GetPasswordChar();
-}
-
-FX_INT32 CFX_Edit::GetCharArray() const
-{
- return m_pVT->GetCharArray();
-}
-
-CPDF_Rect CFX_Edit::GetPlateRect() const
-{
- return m_pVT->GetPlateRect();
-}
-
-CPDF_Rect CFX_Edit::GetContentRect() const
-{
- return VTToEdit(m_pVT->GetContentRect());
-}
-
-FX_INT32 CFX_Edit::GetHorzScale() const
-{
- return m_pVT->GetHorzScale();
-}
-
-FX_FLOAT CFX_Edit::GetCharSpace() const
-{
- return m_pVT->GetCharSpace();
-}
-
-// inner methods
-
-CPVT_WordRange CFX_Edit::GetWholeWordRange() const
-{
- if (m_pVT->IsValid())
- return CPVT_WordRange(m_pVT->GetBeginWordPlace(),m_pVT->GetEndWordPlace());
-
- return CPVT_WordRange();
-}
-
-CPVT_WordRange CFX_Edit::GetVisibleWordRange() const
-{
- if (m_bEnableOverflow) return GetWholeWordRange();
-
- if (m_pVT->IsValid())
- {
- CPDF_Rect rcPlate = m_pVT->GetPlateRect();
-
- CPVT_WordPlace place1 = m_pVT->SearchWordPlace(EditToVT(CPDF_Point(rcPlate.left,rcPlate.top)));
- CPVT_WordPlace place2 = m_pVT->SearchWordPlace(EditToVT(CPDF_Point(rcPlate.right,rcPlate.bottom)));
-
- return CPVT_WordRange(place1,place2);
- }
-
- return CPVT_WordRange();
-}
-
-CPVT_WordPlace CFX_Edit::SearchWordPlace(const CPDF_Point& point) const
-{
- if (m_pVT->IsValid())
- {
- return m_pVT->SearchWordPlace(EditToVT(point));
- }
-
- return CPVT_WordPlace();
-}
-
-void CFX_Edit::Paint()
-{
- if (m_pVT->IsValid())
- {
- RearrangeAll();
- ScrollToCaret();
- Refresh(RP_NOANALYSE);
- SetCaretOrigin();
- SetCaretInfo();
- }
-}
-
-void CFX_Edit::RearrangeAll()
-{
- if (m_pVT->IsValid())
- {
- m_pVT->UpdateWordPlace(m_wpCaret);
- m_pVT->RearrangeAll();
- m_pVT->UpdateWordPlace(m_wpCaret);
- SetScrollInfo();
- SetContentChanged();
- }
-}
-
-void CFX_Edit::RearrangePart(const CPVT_WordRange & range)
-{
- if (m_pVT->IsValid())
- {
- m_pVT->UpdateWordPlace(m_wpCaret);
- m_pVT->RearrangePart(range);
- m_pVT->UpdateWordPlace(m_wpCaret);
- SetScrollInfo();
- SetContentChanged();
- }
-}
-
-void CFX_Edit::SetContentChanged()
-{
- if (m_bNotify && m_pNotify)
- {
- CPDF_Rect rcContent = m_pVT->GetContentRect();
- if (rcContent.Width() != m_rcOldContent.Width() ||
- rcContent.Height() != m_rcOldContent.Height())
- {
- if (!m_bNotifyFlag)
- {
- m_bNotifyFlag = TRUE;
- m_pNotify->IOnContentChange(rcContent);
- m_bNotifyFlag = FALSE;
- }
- m_rcOldContent = rcContent;
- }
- }
-}
-
-void CFX_Edit::SelectAll()
-{
- if (m_pVT->IsValid())
- {
- m_SelState = GetWholeWordRange();
- SetCaret(m_SelState.EndPos);
-
- ScrollToCaret();
- CPVT_WordRange wrVisible = GetVisibleWordRange();
- Refresh(RP_OPTIONAL,&wrVisible);
- SetCaretInfo();
- }
-}
-
-void CFX_Edit::SelectNone()
-{
- if (m_pVT->IsValid())
- {
- if (m_SelState.IsExist())
- {
- CPVT_WordRange wrTemp = m_SelState.ConvertToWordRange();
- m_SelState.Default();
- Refresh(RP_OPTIONAL,&wrTemp);
- }
- }
-}
-
-FX_BOOL CFX_Edit::IsSelected() const
-{
- return m_SelState.IsExist();
-}
-
-CPDF_Point CFX_Edit::VTToEdit(const CPDF_Point & point) const
-{
- CPDF_Rect rcContent = m_pVT->GetContentRect();
- CPDF_Rect rcPlate = m_pVT->GetPlateRect();
-
- FX_FLOAT fPadding = 0.0f;
-
- switch (m_nAlignment)
- {
- case 0:
- fPadding = 0.0f;
- break;
- case 1:
- fPadding = (rcPlate.Height() - rcContent.Height()) * 0.5f;
- break;
- case 2:
- fPadding = rcPlate.Height() - rcContent.Height();
- break;
- }
-
- return CPDF_Point(point.x - (m_ptScrollPos.x - rcPlate.left),
- point.y - (m_ptScrollPos.y + fPadding - rcPlate.top));
-}
-
-CPDF_Point CFX_Edit::EditToVT(const CPDF_Point & point) const
-{
- CPDF_Rect rcContent = m_pVT->GetContentRect();
- CPDF_Rect rcPlate = m_pVT->GetPlateRect();
-
- FX_FLOAT fPadding = 0.0f;
-
- switch (m_nAlignment)
- {
- case 0:
- fPadding = 0.0f;
- break;
- case 1:
- fPadding = (rcPlate.Height() - rcContent.Height()) * 0.5f;
- break;
- case 2:
- fPadding = rcPlate.Height() - rcContent.Height();
- break;
- }
-
- return CPDF_Point(point.x + (m_ptScrollPos.x - rcPlate.left),
- point.y + (m_ptScrollPos.y + fPadding - rcPlate.top));
-}
-
-CPDF_Rect CFX_Edit::VTToEdit(const CPDF_Rect & rect) const
-{
- CPDF_Point ptLeftBottom = VTToEdit(CPDF_Point(rect.left,rect.bottom));
- CPDF_Point ptRightTop = VTToEdit(CPDF_Point(rect.right,rect.top));
-
- return CPDF_Rect(ptLeftBottom.x,ptLeftBottom.y,ptRightTop.x,ptRightTop.y);
-}
-
-CPDF_Rect CFX_Edit::EditToVT(const CPDF_Rect & rect) const
-{
- CPDF_Point ptLeftBottom = EditToVT(CPDF_Point(rect.left,rect.bottom));
- CPDF_Point ptRightTop = EditToVT(CPDF_Point(rect.right,rect.top));
-
- return CPDF_Rect(ptLeftBottom.x,ptLeftBottom.y,ptRightTop.x,ptRightTop.y);
-}
-
-void CFX_Edit::SetScrollInfo()
-{
- if (m_bNotify && m_pNotify)
- {
- CPDF_Rect rcPlate = m_pVT->GetPlateRect();
- CPDF_Rect rcContent = m_pVT->GetContentRect();
-
- if (!m_bNotifyFlag)
- {
- m_bNotifyFlag = TRUE;
- m_pNotify->IOnSetScrollInfoX(rcPlate.left, rcPlate.right,
- rcContent.left, rcContent.right, rcPlate.Width() / 3, rcPlate.Width());
-
- m_pNotify->IOnSetScrollInfoY(rcPlate.bottom, rcPlate.top,
- rcContent.bottom, rcContent.top, rcPlate.Height() / 3, rcPlate.Height());
- m_bNotifyFlag = FALSE;
- }
- }
-}
-
-void CFX_Edit::SetScrollPosX(FX_FLOAT fx)
-{
- if (!m_bEnableScroll) return;
-
- if (m_pVT->IsValid())
- {
- if (!FX_EDIT_IsFloatEqual(m_ptScrollPos.x,fx))
- {
- m_ptScrollPos.x = fx;
- Refresh(RP_NOANALYSE);
-
- if (m_bNotify && m_pNotify)
- {
- if (!m_bNotifyFlag)
- {
- m_bNotifyFlag = TRUE;
- m_pNotify->IOnSetScrollPosX(fx);
- m_bNotifyFlag = FALSE;
- }
- }
- }
- }
-}
-
-void CFX_Edit::SetScrollPosY(FX_FLOAT fy)
-{
- if (!m_bEnableScroll) return;
-
- if (m_pVT->IsValid())
- {
- if (!FX_EDIT_IsFloatEqual(m_ptScrollPos.y,fy))
- {
- m_ptScrollPos.y = fy;
- Refresh(RP_NOANALYSE);
-
- if (m_bNotify && m_pNotify)
- {
- if (!m_bNotifyFlag)
- {
- m_bNotifyFlag = TRUE;
- m_pNotify->IOnSetScrollPosY(fy);
- m_bNotifyFlag = FALSE;
- }
- }
- }
- }
-}
-
-void CFX_Edit::SetScrollPos(const CPDF_Point & point)
-{
- SetScrollPosX(point.x);
- SetScrollPosY(point.y);
- SetScrollLimit();
- SetCaretInfo();
-}
-
-CPDF_Point CFX_Edit::GetScrollPos() const
-{
- return m_ptScrollPos;
-}
-
-void CFX_Edit::SetScrollLimit()
-{
- if (m_pVT->IsValid())
- {
- CPDF_Rect rcContent = m_pVT->GetContentRect();
- CPDF_Rect rcPlate = m_pVT->GetPlateRect();
-
- if (rcPlate.Width() > rcContent.Width())
- {
- SetScrollPosX(rcPlate.left);
- }
- else
- {
- if (FX_EDIT_IsFloatSmaller(m_ptScrollPos.x, rcContent.left))
- {
- SetScrollPosX(rcContent.left);
- }
- else if (FX_EDIT_IsFloatBigger(m_ptScrollPos.x, rcContent.right - rcPlate.Width()))
- {
- SetScrollPosX(rcContent.right - rcPlate.Width());
- }
- }
-
- if (rcPlate.Height() > rcContent.Height())
- {
- SetScrollPosY(rcPlate.top);
- }
- else
- {
- if (FX_EDIT_IsFloatSmaller(m_ptScrollPos.y, rcContent.bottom + rcPlate.Height()))
- {
- SetScrollPosY(rcContent.bottom + rcPlate.Height());
- }
- else if (FX_EDIT_IsFloatBigger(m_ptScrollPos.y, rcContent.top))
- {
- SetScrollPosY(rcContent.top);
- }
- }
- }
-}
-
-void CFX_Edit::ScrollToCaret()
-{
- SetScrollLimit();
-
- if (m_pVT->IsValid())
- {
- CPDF_Point ptHead(0,0);
- CPDF_Point ptFoot(0,0);
-
- if (IPDF_VariableText_Iterator * pIterator = m_pVT->GetIterator())
- {
- pIterator->SetAt(m_wpCaret);
-
- CPVT_Word word;
- CPVT_Line line;
- if (pIterator->GetWord(word))
- {
- ptHead.x = word.ptWord.x + word.fWidth;
- ptHead.y = word.ptWord.y + word.fAscent;
- ptFoot.x = word.ptWord.x + word.fWidth;
- ptFoot.y = word.ptWord.y + word.fDescent;
- }
- else if (pIterator->GetLine(line))
- {
- ptHead.x = line.ptLine.x;
- ptHead.y = line.ptLine.y + line.fLineAscent;
- ptFoot.x = line.ptLine.x;
- ptFoot.y = line.ptLine.y + line.fLineDescent;
- }
- }
-
- CPDF_Point ptHeadEdit = VTToEdit(ptHead);
- CPDF_Point ptFootEdit = VTToEdit(ptFoot);
-
- CPDF_Rect rcPlate = m_pVT->GetPlateRect();
-
- if (!FX_EDIT_IsFloatEqual(rcPlate.left,rcPlate.right))
- {
- if (FX_EDIT_IsFloatSmaller(ptHeadEdit.x, rcPlate.left) ||
- FX_EDIT_IsFloatEqual(ptHeadEdit.x, rcPlate.left))
- {
- SetScrollPosX(ptHead.x);
- }
- else if (FX_EDIT_IsFloatBigger(ptHeadEdit.x, rcPlate.right))
- {
- SetScrollPosX(ptHead.x - rcPlate.Width());
- }
- }
-
- if (!FX_EDIT_IsFloatEqual(rcPlate.top,rcPlate.bottom))
- {
- if (FX_EDIT_IsFloatSmaller(ptFootEdit.y, rcPlate.bottom) ||
- FX_EDIT_IsFloatEqual(ptFootEdit.y, rcPlate.bottom))
- {
- if (FX_EDIT_IsFloatSmaller(ptHeadEdit.y, rcPlate.top))
- {
- SetScrollPosY(ptFoot.y + rcPlate.Height());
- }
- }
- else if (FX_EDIT_IsFloatBigger(ptHeadEdit.y, rcPlate.top))
- {
- if (FX_EDIT_IsFloatBigger(ptFootEdit.y, rcPlate.bottom))
- {
- SetScrollPosY(ptHead.y);
- }
- }
- }
- }
-}
-
-void CFX_Edit::Refresh(REFRESH_PLAN_E ePlan,const CPVT_WordRange * pRange1,const CPVT_WordRange * pRange2)
-{
- if (m_bEnableRefresh && m_pVT->IsValid())
- {
- m_Refresh.BeginRefresh();
- RefreshPushLineRects(GetVisibleWordRange());
-
-// if (!FX_EDIT_IsFloatEqual(m_ptRefreshScrollPos.x,m_ptScrollPos.x) ||
-// !FX_EDIT_IsFloatEqual(m_ptRefreshScrollPos.y,m_ptScrollPos.y))
-// {
- m_Refresh.NoAnalyse();
- m_ptRefreshScrollPos = m_ptScrollPos;
-// }
-// else
-// {
-// switch (ePlan)
-// {
-// case RP_ANALYSE:
-// m_Refresh.Analyse(m_pVT->GetAlignment());
-//
-// if (pRange1) RefreshPushRandomRects(*pRange1);
-// if (pRange2) RefreshPushRandomRects(*pRange2);
-// break;
-// case RP_NOANALYSE:
-// m_Refresh.NoAnalyse();
-// break;
-// case RP_OPTIONAL:
-// if (pRange1) RefreshPushRandomRects(*pRange1);
-// if (pRange2) RefreshPushRandomRects(*pRange2);
-// break;
-// }
-// }
-
- if (m_bNotify && m_pNotify)
- {
- if (!m_bNotifyFlag)
- {
- m_bNotifyFlag = TRUE;
- if (const CFX_Edit_RectArray * pRects = m_Refresh.GetRefreshRects())
- {
- for (FX_INT32 i = 0, sz = pRects->GetSize(); i < sz; i++)
- m_pNotify->IOnInvalidateRect(pRects->GetAt(i));
- }
- m_bNotifyFlag = FALSE;
- }
- }
-
- m_Refresh.EndRefresh();
- }
-}
-
-void CFX_Edit::RefreshPushLineRects(const CPVT_WordRange & wr)
-{
- if (m_pVT->IsValid())
- {
- if (IPDF_VariableText_Iterator * pIterator = m_pVT->GetIterator())
- {
- CPVT_WordPlace wpBegin = wr.BeginPos;
- m_pVT->UpdateWordPlace(wpBegin);
- CPVT_WordPlace wpEnd = wr.EndPos;
- m_pVT->UpdateWordPlace(wpEnd);
- pIterator->SetAt(wpBegin);
-
- CPVT_Line lineinfo;
- do
- {
- if (!pIterator->GetLine(lineinfo))break;
- if (lineinfo.lineplace.LineCmp(wpEnd) > 0)break;
-
- CPDF_Rect rcLine(lineinfo.ptLine.x,
- lineinfo.ptLine.y + lineinfo.fLineDescent,
- lineinfo.ptLine.x + lineinfo.fLineWidth,
- lineinfo.ptLine.y + lineinfo.fLineAscent);
-
- m_Refresh.Push(CPVT_WordRange(lineinfo.lineplace,lineinfo.lineEnd),VTToEdit(rcLine));
-
- }while (pIterator->NextLine());
- }
- }
-}
-
-void CFX_Edit::RefreshPushRandomRects(const CPVT_WordRange & wr)
-{
- if (m_pVT->IsValid())
- {
- if (IPDF_VariableText_Iterator * pIterator = m_pVT->GetIterator())
- {
- CPVT_WordRange wrTemp = wr;
-
- m_pVT->UpdateWordPlace(wrTemp.BeginPos);
- m_pVT->UpdateWordPlace(wrTemp.EndPos);
- pIterator->SetAt(wrTemp.BeginPos);
-
- CPVT_Word wordinfo;
- CPVT_Line lineinfo;
- CPVT_WordPlace place;
-
- while (pIterator->NextWord())
- {
- place = pIterator->GetAt();
- if (place.WordCmp(wrTemp.EndPos) > 0) break;
-
- pIterator->GetWord(wordinfo);
- pIterator->GetLine(lineinfo);
-
- if (place.LineCmp(wrTemp.BeginPos) == 0 || place.LineCmp(wrTemp.EndPos) == 0)
- {
- CPDF_Rect rcWord(wordinfo.ptWord.x,
- lineinfo.ptLine.y + lineinfo.fLineDescent,
- wordinfo.ptWord.x + wordinfo.fWidth,
- lineinfo.ptLine.y + lineinfo.fLineAscent);
-
- m_Refresh.AddRefresh(VTToEdit(rcWord));
- }
- else
- {
- CPDF_Rect rcLine(lineinfo.ptLine.x,
- lineinfo.ptLine.y + lineinfo.fLineDescent,
- lineinfo.ptLine.x + lineinfo.fLineWidth,
- lineinfo.ptLine.y + lineinfo.fLineAscent);
-
- m_Refresh.AddRefresh(VTToEdit(rcLine));
-
- pIterator->NextLine();
- }
- }
- }
- }
-}
-
-void CFX_Edit::RefreshWordRange(const CPVT_WordRange& wr)
-{
- if (IPDF_VariableText_Iterator * pIterator = m_pVT->GetIterator())
- {
- CPVT_WordRange wrTemp = wr;
-
- m_pVT->UpdateWordPlace(wrTemp.BeginPos);
- m_pVT->UpdateWordPlace(wrTemp.EndPos);
- pIterator->SetAt(wrTemp.BeginPos);
-
- CPVT_Word wordinfo;
- CPVT_Line lineinfo;
- CPVT_WordPlace place;
-
- while (pIterator->NextWord())
- {
- place = pIterator->GetAt();
- if (place.WordCmp(wrTemp.EndPos) > 0) break;
-
- pIterator->GetWord(wordinfo);
- pIterator->GetLine(lineinfo);
-
- if (place.LineCmp(wrTemp.BeginPos) == 0 || place.LineCmp(wrTemp.EndPos) == 0)
- {
- CPDF_Rect rcWord(wordinfo.ptWord.x,
- lineinfo.ptLine.y + lineinfo.fLineDescent,
- wordinfo.ptWord.x + wordinfo.fWidth,
- lineinfo.ptLine.y + lineinfo.fLineAscent);
-
- if (m_bNotify && m_pNotify)
- {
- if (!m_bNotifyFlag)
- {
- m_bNotifyFlag = TRUE;
- CPDF_Rect rcRefresh = VTToEdit(rcWord);
- m_pNotify->IOnInvalidateRect(&rcRefresh);
- m_bNotifyFlag = FALSE;
- }
- }
- }
- else
- {
- CPDF_Rect rcLine(lineinfo.ptLine.x,
- lineinfo.ptLine.y + lineinfo.fLineDescent,
- lineinfo.ptLine.x + lineinfo.fLineWidth,
- lineinfo.ptLine.y + lineinfo.fLineAscent);
-
- if (m_bNotify && m_pNotify)
- {
- if (!m_bNotifyFlag)
- {
- m_bNotifyFlag = TRUE;
- CPDF_Rect rcRefresh = VTToEdit(rcLine);
- m_pNotify->IOnInvalidateRect(&rcRefresh);
- m_bNotifyFlag = FALSE;
- }
- }
-
- pIterator->NextLine();
- }
- }
- }
-}
-
-void CFX_Edit::SetCaret(const CPVT_WordPlace & place)
-{
- m_wpOldCaret = m_wpCaret;
- m_wpCaret = place;
-}
-
-void CFX_Edit::SetCaretInfo()
-{
- if (m_bNotify && m_pNotify)
- {
- if (!m_bNotifyFlag)
- {
- CPDF_Point ptHead(0.0f,0.0f),ptFoot(0.0f,0.0f);
-
- if (IPDF_VariableText_Iterator * pIterator = m_pVT->GetIterator())
- {
- pIterator->SetAt(m_wpCaret);
- CPVT_Word word;
- CPVT_Line line;
- if (pIterator->GetWord(word))
- {
- ptHead.x = word.ptWord.x + word.fWidth;
- ptHead.y = word.ptWord.y + word.fAscent;
- ptFoot.x = word.ptWord.x + word.fWidth;
- ptFoot.y = word.ptWord.y + word.fDescent;
- }
- else if (pIterator->GetLine(line))
- {
- ptHead.x = line.ptLine.x;
- ptHead.y = line.ptLine.y + line.fLineAscent;
- ptFoot.x = line.ptLine.x;
- ptFoot.y = line.ptLine.y + line.fLineDescent;
- }
- }
-
- m_bNotifyFlag = TRUE;
- m_pNotify->IOnSetCaret(!m_SelState.IsExist(),VTToEdit(ptHead),VTToEdit(ptFoot), m_wpCaret);
- m_bNotifyFlag = FALSE;
- }
- }
-
- SetCaretChange();
-}
-
-void CFX_Edit::SetCaretChange()
-{
- if (this->m_wpCaret == this->m_wpOldCaret) return;
-
- if (m_bNotify && m_pVT->IsRichText() && m_pNotify)
- {
- CPVT_SecProps SecProps;
- CPVT_WordProps WordProps;
-
- if (IPDF_VariableText_Iterator * pIterator = m_pVT->GetIterator())
- {
- pIterator->SetAt(m_wpCaret);
- CPVT_Word word;
- CPVT_Section section;
-
- if (pIterator->GetSection(section))
- {
- SecProps = section.SecProps;
- WordProps = section.WordProps;
- }
-
- if (pIterator->GetWord(word))
- {
- WordProps = word.WordProps;
- }
- }
-
- if (!m_bNotifyFlag)
- {
- m_bNotifyFlag = TRUE;
- m_pNotify->IOnCaretChange(SecProps,WordProps);
- m_bNotifyFlag = FALSE;
- }
- }
-}
-
-void CFX_Edit::SetCaret(FX_INT32 nPos)
-{
- if (m_pVT->IsValid())
- {
- SelectNone();
- SetCaret(m_pVT->WordIndexToWordPlace(nPos));
- m_SelState.Set(m_wpCaret,m_wpCaret);
-
- ScrollToCaret();
- SetCaretOrigin();
- SetCaretInfo();
- }
-}
-
-void CFX_Edit::OnMouseDown(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl)
-{
- if (m_pVT->IsValid())
- {
- SelectNone();
- SetCaret(m_pVT->SearchWordPlace(EditToVT(point)));
- m_SelState.Set(m_wpCaret,m_wpCaret);
-
- ScrollToCaret();
- SetCaretOrigin();
- SetCaretInfo();
- }
-}
-
-void CFX_Edit::OnMouseMove(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl)
-{
- if (m_pVT->IsValid())
- {
- SetCaret(m_pVT->SearchWordPlace(EditToVT(point)));
-
- if (m_wpCaret != m_wpOldCaret)
- {
- m_SelState.SetEndPos(m_wpCaret);
-
- ScrollToCaret();
- CPVT_WordRange wr(m_wpOldCaret,m_wpCaret);
- Refresh(RP_OPTIONAL,&wr);
- SetCaretOrigin();
- SetCaretInfo();
- }
- }
-}
-
-void CFX_Edit::OnVK_UP(FX_BOOL bShift,FX_BOOL bCtrl)
-{
- if (m_pVT->IsValid())
- {
- SetCaret(m_pVT->GetUpWordPlace(m_wpCaret,m_ptCaret));
-
- if (bShift)
- {
- if (m_SelState.IsExist())
- m_SelState.SetEndPos(m_wpCaret);
- else
- m_SelState.Set(m_wpOldCaret,m_wpCaret);
-
- if (m_wpOldCaret != m_wpCaret)
- {
- ScrollToCaret();
- CPVT_WordRange wr(m_wpOldCaret, m_wpCaret);
- Refresh(RP_OPTIONAL, &wr);
- SetCaretInfo();
- }
- }
- else
- {
- SelectNone();
-
- ScrollToCaret();
- SetCaretInfo();
- }
- }
-}
-
-void CFX_Edit::OnVK_DOWN(FX_BOOL bShift,FX_BOOL bCtrl)
-{
- if (m_pVT->IsValid())
- {
- SetCaret(m_pVT->GetDownWordPlace(m_wpCaret,m_ptCaret));
-
- if (bShift)
- {
- if (m_SelState.IsExist())
- m_SelState.SetEndPos(m_wpCaret);
- else
- m_SelState.Set(m_wpOldCaret,m_wpCaret);
-
- if (m_wpOldCaret != m_wpCaret)
- {
- ScrollToCaret();
- CPVT_WordRange wr(m_wpOldCaret,m_wpCaret);
- Refresh(RP_OPTIONAL, &wr);
- SetCaretInfo();
- }
- }
- else
- {
- SelectNone();
-
- ScrollToCaret();
- SetCaretInfo();
- }
- }
-}
-
-void CFX_Edit::OnVK_LEFT(FX_BOOL bShift,FX_BOOL bCtrl)
-{
- if (m_pVT->IsValid())
- {
- if (bShift)
- {
- if (m_wpCaret == m_pVT->GetLineBeginPlace(m_wpCaret) &&
- m_wpCaret != m_pVT->GetSectionBeginPlace(m_wpCaret))
- SetCaret(m_pVT->GetPrevWordPlace(m_wpCaret));
-
- SetCaret(m_pVT->GetPrevWordPlace(m_wpCaret));
-
- if (m_SelState.IsExist())
- m_SelState.SetEndPos(m_wpCaret);
- else
- m_SelState.Set(m_wpOldCaret, m_wpCaret);
-
- if (m_wpOldCaret != m_wpCaret)
- {
- ScrollToCaret();
- CPVT_WordRange wr(m_wpOldCaret,m_wpCaret);
- Refresh(RP_OPTIONAL,&wr);
- SetCaretInfo();
- }
- }
- else
- {
- if (m_SelState.IsExist())
- {
- if (m_SelState.BeginPos.WordCmp(m_SelState.EndPos)<0)
- SetCaret(m_SelState.BeginPos);
- else
- SetCaret(m_SelState.EndPos);
-
- SelectNone();
- ScrollToCaret();
- SetCaretInfo();
- }
- else
- {
- if (m_wpCaret == m_pVT->GetLineBeginPlace(m_wpCaret) &&
- m_wpCaret != m_pVT->GetSectionBeginPlace(m_wpCaret))
- SetCaret(m_pVT->GetPrevWordPlace(m_wpCaret));
-
- SetCaret(m_pVT->GetPrevWordPlace(m_wpCaret));
-
- ScrollToCaret();
- SetCaretOrigin();
- SetCaretInfo();
- }
- }
- }
-}
-
-void CFX_Edit::OnVK_RIGHT(FX_BOOL bShift,FX_BOOL bCtrl)
-{
- if (m_pVT->IsValid())
- {
- if (bShift)
- {
- SetCaret(m_pVT->GetNextWordPlace(m_wpCaret));
-
- if (m_wpCaret == m_pVT->GetLineEndPlace(m_wpCaret) &&
- m_wpCaret != m_pVT->GetSectionEndPlace(m_wpCaret))
- SetCaret(m_pVT->GetNextWordPlace(m_wpCaret));
-
- if (m_SelState.IsExist())
- m_SelState.SetEndPos(m_wpCaret);
- else
- m_SelState.Set(m_wpOldCaret,m_wpCaret);
-
- if (m_wpOldCaret != m_wpCaret)
- {
- ScrollToCaret();
- CPVT_WordRange wr(m_wpOldCaret,m_wpCaret);
- Refresh(RP_OPTIONAL,&wr);
- SetCaretInfo();
- }
- }
- else
- {
- if (m_SelState.IsExist())
- {
- if (m_SelState.BeginPos.WordCmp(m_SelState.EndPos)>0)
- SetCaret(m_SelState.BeginPos);
- else
- SetCaret(m_SelState.EndPos);
-
- SelectNone();
- ScrollToCaret();
- SetCaretInfo();
- }
- else
- {
- SetCaret(m_pVT->GetNextWordPlace(m_wpCaret));
-
- if (m_wpCaret == m_pVT->GetLineEndPlace(m_wpCaret) &&
- m_wpCaret != m_pVT->GetSectionEndPlace(m_wpCaret))
- SetCaret(m_pVT->GetNextWordPlace(m_wpCaret));
-
- ScrollToCaret();
- SetCaretOrigin();
- SetCaretInfo();
- }
- }
- }
-}
-
-void CFX_Edit::OnVK_HOME(FX_BOOL bShift,FX_BOOL bCtrl)
-{
- if (m_pVT->IsValid())
- {
- if (bShift)
- {
- if (bCtrl)
- SetCaret(m_pVT->GetBeginWordPlace());
- else
- SetCaret(m_pVT->GetLineBeginPlace(m_wpCaret));
-
- if (m_SelState.IsExist())
- m_SelState.SetEndPos(m_wpCaret);
- else
- m_SelState.Set(m_wpOldCaret,m_wpCaret);
-
- ScrollToCaret();
- CPVT_WordRange wr(m_wpOldCaret, m_wpCaret);
- Refresh(RP_OPTIONAL, &wr);
- SetCaretInfo();
- }
- else
- {
- if (m_SelState.IsExist())
- {
- if (m_SelState.BeginPos.WordCmp(m_SelState.EndPos)<0)
- SetCaret(m_SelState.BeginPos);
- else
- SetCaret(m_SelState.EndPos);
-
- SelectNone();
- ScrollToCaret();
- SetCaretInfo();
- }
- else
- {
- if (bCtrl)
- SetCaret(m_pVT->GetBeginWordPlace());
- else
- SetCaret(m_pVT->GetLineBeginPlace(m_wpCaret));
-
- ScrollToCaret();
- SetCaretOrigin();
- SetCaretInfo();
- }
- }
- }
-}
-
-void CFX_Edit::OnVK_END(FX_BOOL bShift,FX_BOOL bCtrl)
-{
- if (m_pVT->IsValid())
- {
- if (bShift)
- {
- if (bCtrl)
- SetCaret(m_pVT->GetEndWordPlace());
- else
- SetCaret(m_pVT->GetLineEndPlace(m_wpCaret));
-
- if (m_SelState.IsExist())
- m_SelState.SetEndPos(m_wpCaret);
- else
- m_SelState.Set(m_wpOldCaret, m_wpCaret);
-
- ScrollToCaret();
- CPVT_WordRange wr(m_wpOldCaret, m_wpCaret);
- Refresh(RP_OPTIONAL, &wr);
- SetCaretInfo();
- }
- else
- {
- if (m_SelState.IsExist())
- {
- if (m_SelState.BeginPos.WordCmp(m_SelState.EndPos)>0)
- SetCaret(m_SelState.BeginPos);
- else
- SetCaret(m_SelState.EndPos);
-
- SelectNone();
- ScrollToCaret();
- SetCaretInfo();
- }
- else
- {
- if (bCtrl)
- SetCaret(m_pVT->GetEndWordPlace());
- else
- SetCaret(m_pVT->GetLineEndPlace(m_wpCaret));
-
- ScrollToCaret();
- SetCaretOrigin();
- SetCaretInfo();
- }
- }
- }
-}
-
-void CFX_Edit::SetText(FX_LPCWSTR text,FX_INT32 charset,
- const CPVT_SecProps * pSecProps,const CPVT_WordProps * pWordProps, FX_BOOL bAddUndo, FX_BOOL bPaint)
-{
- Empty();
- DoInsertText(CPVT_WordPlace(0,0,-1), text, charset, pSecProps, pWordProps);
- if (bPaint) Paint();
- if (m_bOprNotify && m_pOprNotify)
- m_pOprNotify->OnSetText(m_wpCaret, m_wpOldCaret);
- //if (bAddUndo)
-}
-
-FX_BOOL CFX_Edit::InsertWord(FX_WORD word, FX_INT32 charset, const CPVT_WordProps * pWordProps, FX_BOOL bAddUndo, FX_BOOL bPaint)
-{
- if (IsTextOverflow()) return FALSE;
-
- if (m_pVT->IsValid())
- {
- m_pVT->UpdateWordPlace(m_wpCaret);
-
- SetCaret(m_pVT->InsertWord(m_wpCaret,word,GetCharSetFromUnicode(word, charset),pWordProps));
- m_SelState.Set(m_wpCaret,m_wpCaret);
-
- if (m_wpCaret != m_wpOldCaret)
- {
- if (bAddUndo && m_bEnableUndo)
- {
- AddEditUndoItem(new CFXEU_InsertWord(this,m_wpOldCaret,m_wpCaret,word,charset,pWordProps));
- }
-
- if (bPaint)
- PaintInsertText(m_wpOldCaret, m_wpCaret);
-
- if (m_bOprNotify && m_pOprNotify)
- m_pOprNotify->OnInsertWord(m_wpCaret, m_wpOldCaret);
-
- return TRUE;
- }
- }
-
- return FALSE;
-}
-
-FX_BOOL CFX_Edit::InsertReturn(const CPVT_SecProps * pSecProps,const CPVT_WordProps * pWordProps,
- FX_BOOL bAddUndo, FX_BOOL bPaint)
-{
- if (IsTextOverflow()) return FALSE;
-
- if (m_pVT->IsValid())
- {
- m_pVT->UpdateWordPlace(m_wpCaret);
- SetCaret(m_pVT->InsertSection(m_wpCaret,pSecProps,pWordProps));
- m_SelState.Set(m_wpCaret,m_wpCaret);
-
- if (m_wpCaret != m_wpOldCaret)
- {
- if (bAddUndo && m_bEnableUndo)
- {
- AddEditUndoItem(new CFXEU_InsertReturn(this,m_wpOldCaret,m_wpCaret,pSecProps,pWordProps));
- }
-
- if (bPaint)
- {
- RearrangePart(CPVT_WordRange(m_wpOldCaret, m_wpCaret));
- ScrollToCaret();
- CPVT_WordRange wr(m_wpOldCaret, GetVisibleWordRange().EndPos);
- Refresh(RP_ANALYSE, &wr);
- SetCaretOrigin();
- SetCaretInfo();
- }
-
- if (m_bOprNotify && m_pOprNotify)
- m_pOprNotify->OnInsertReturn(m_wpCaret, m_wpOldCaret);
-
- return TRUE;
- }
- }
-
- return FALSE;
-}
-
-FX_BOOL CFX_Edit::Backspace(FX_BOOL bAddUndo, FX_BOOL bPaint)
-{
- if (m_pVT->IsValid())
- {
- if (m_wpCaret == m_pVT->GetBeginWordPlace()) return FALSE;
-
- CPVT_Section section;
- CPVT_Word word;
-
- if (bAddUndo)
- {
- if (IPDF_VariableText_Iterator * pIterator = m_pVT->GetIterator())
- {
- pIterator->SetAt(m_wpCaret);
- pIterator->GetSection(section);
- pIterator->GetWord(word);
- }
- }
-
- m_pVT->UpdateWordPlace(m_wpCaret);
- SetCaret(m_pVT->BackSpaceWord(m_wpCaret));
- m_SelState.Set(m_wpCaret,m_wpCaret);
-
- if (m_wpCaret != m_wpOldCaret)
- {
- if (bAddUndo && m_bEnableUndo)
- {
- if (m_wpCaret.SecCmp(m_wpOldCaret) != 0)
- AddEditUndoItem(new CFXEU_Backspace(this,m_wpOldCaret,m_wpCaret,word.Word,word.nCharset,
- section.SecProps,section.WordProps));
- else
- AddEditUndoItem(new CFXEU_Backspace(this,m_wpOldCaret,m_wpCaret,word.Word,word.nCharset,
- section.SecProps,word.WordProps));
- }
-
- if (bPaint)
- {
- RearrangePart(CPVT_WordRange(m_wpCaret,m_wpOldCaret));
- ScrollToCaret();
-
- CPVT_WordRange wr;
- if (m_wpCaret.SecCmp(m_wpOldCaret) !=0)
- wr = CPVT_WordRange(m_pVT->GetPrevWordPlace(m_wpCaret),GetVisibleWordRange().EndPos);
- else if (m_wpCaret.LineCmp(m_wpOldCaret) !=0)
- wr = CPVT_WordRange(m_pVT->GetLineBeginPlace(m_wpCaret),m_pVT->GetSectionEndPlace(m_wpCaret));
- else
- wr = CPVT_WordRange(m_pVT->GetPrevWordPlace(m_wpCaret),m_pVT->GetSectionEndPlace(m_wpCaret));
-
- Refresh(RP_ANALYSE, &wr);
-
- SetCaretOrigin();
- SetCaretInfo();
- }
-
- if (m_bOprNotify && m_pOprNotify)
- m_pOprNotify->OnBackSpace(m_wpCaret, m_wpOldCaret);
-
- return TRUE;
- }
- }
-
- return FALSE;
-}
-
-FX_BOOL CFX_Edit::Delete(FX_BOOL bAddUndo, FX_BOOL bPaint)
-{
- if (m_pVT->IsValid())
- {
- if (m_wpCaret == m_pVT->GetEndWordPlace()) return FALSE;
-
- CPVT_Section section;
- CPVT_Word word;
-
- if (bAddUndo)
- {
- if (IPDF_VariableText_Iterator * pIterator = m_pVT->GetIterator())
- {
- pIterator->SetAt(m_pVT->GetNextWordPlace(m_wpCaret));
- pIterator->GetSection(section);
- pIterator->GetWord(word);
- }
- }
-
- m_pVT->UpdateWordPlace(m_wpCaret);
- FX_BOOL bSecEnd = (m_wpCaret == m_pVT->GetSectionEndPlace(m_wpCaret));
-
- SetCaret(m_pVT->DeleteWord(m_wpCaret));
- m_SelState.Set(m_wpCaret,m_wpCaret);
-
- if (bAddUndo && m_bEnableUndo)
- {
- if (bSecEnd)
- AddEditUndoItem(new CFXEU_Delete(this,m_wpOldCaret,m_wpCaret,word.Word,word.nCharset,
- section.SecProps,section.WordProps,bSecEnd));
- else
- AddEditUndoItem(new CFXEU_Delete(this,m_wpOldCaret,m_wpCaret,word.Word,word.nCharset,
- section.SecProps,word.WordProps,bSecEnd));
- }
-
- if (bPaint)
- {
- RearrangePart(CPVT_WordRange(m_wpOldCaret,m_wpCaret));
- ScrollToCaret();
-
- CPVT_WordRange wr;
- if (bSecEnd)
- wr = CPVT_WordRange(m_pVT->GetPrevWordPlace(m_wpOldCaret),GetVisibleWordRange().EndPos);
- else if (m_wpCaret.LineCmp(m_wpOldCaret) !=0)
- wr = CPVT_WordRange(m_pVT->GetLineBeginPlace(m_wpCaret),m_pVT->GetSectionEndPlace(m_wpCaret));
- else
- wr = CPVT_WordRange(m_pVT->GetPrevWordPlace(m_wpOldCaret),m_pVT->GetSectionEndPlace(m_wpCaret));
-
- Refresh(RP_ANALYSE, &wr);
-
- SetCaretOrigin();
- SetCaretInfo();
- }
-
- if (m_bOprNotify && m_pOprNotify)
- m_pOprNotify->OnDelete(m_wpCaret, m_wpOldCaret);
-
- return TRUE;
- }
-
- return FALSE;
-}
-
-FX_BOOL CFX_Edit::Empty()
-{
- if (m_pVT->IsValid())
- {
- m_pVT->DeleteWords(GetWholeWordRange());
- SetCaret(m_pVT->GetBeginWordPlace());
-
- return TRUE;
- }
-
- return FALSE;
-}
-
-FX_BOOL CFX_Edit::Clear(FX_BOOL bAddUndo, FX_BOOL bPaint)
-{
- if (m_pVT->IsValid())
- {
- if (m_SelState.IsExist())
- {
- CPVT_WordRange range = m_SelState.ConvertToWordRange();
-
- if (bAddUndo && m_bEnableUndo)
- {
- if (m_pVT->IsRichText())
- {
- BeginGroupUndo(L"");
-
- if (IPDF_VariableText_Iterator * pIterator = m_pVT->GetIterator())
- {
- pIterator->SetAt(range.EndPos);
-
- CPVT_Word wordinfo;
- CPVT_Section secinfo;
- do
- {
- CPVT_WordPlace place = pIterator->GetAt();
- if (place.WordCmp(range.BeginPos) <= 0)break;
-
- CPVT_WordPlace oldplace = m_pVT->GetPrevWordPlace(place);
-
- if (oldplace.SecCmp(place) != 0)
- {
- if (pIterator->GetSection(secinfo))
- {
- AddEditUndoItem(new CFXEU_ClearRich(this,oldplace,place,range,wordinfo.Word,
- wordinfo.nCharset,secinfo.SecProps,secinfo.WordProps));
- }
- }
- else
- {
- if (pIterator->GetWord(wordinfo))
- {
- oldplace = m_pVT->AjustLineHeader(oldplace,TRUE);
- place = m_pVT->AjustLineHeader(place,TRUE);
-
- AddEditUndoItem(new CFXEU_ClearRich(this,oldplace,place,range,wordinfo.Word,
- wordinfo.nCharset,secinfo.SecProps,wordinfo.WordProps));
- }
- }
- }while (pIterator->PrevWord());
- }
- EndGroupUndo();
- }
- else
- {
- AddEditUndoItem(new CFXEU_Clear(this,range,GetSelText()));
- }
- }
-
- SelectNone();
- SetCaret(m_pVT->DeleteWords(range));
- m_SelState.Set(m_wpCaret,m_wpCaret);
-
- if (bPaint)
- {
- RearrangePart(range);
- ScrollToCaret();
-
- CPVT_WordRange wr(m_wpOldCaret, GetVisibleWordRange().EndPos);
- Refresh(RP_ANALYSE, &wr);
-
- SetCaretOrigin();
- SetCaretInfo();
- }
-
- if (m_bOprNotify && m_pOprNotify)
- m_pOprNotify->OnClear(m_wpCaret, m_wpOldCaret);
-
- return TRUE;
- }
- }
-
- return FALSE;
-}
-
-FX_BOOL CFX_Edit::InsertText(FX_LPCWSTR text, FX_INT32 charset,
- const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordProps, FX_BOOL bAddUndo, FX_BOOL bPaint)
-{
- if (IsTextOverflow()) return FALSE;
-
- m_pVT->UpdateWordPlace(m_wpCaret);
- SetCaret(DoInsertText(m_wpCaret, text, charset, pSecProps, pWordProps));
- m_SelState.Set(m_wpCaret,m_wpCaret);
-
- if (m_wpCaret != m_wpOldCaret)
- {
- if (bAddUndo && m_bEnableUndo)
- {
- AddEditUndoItem(new CFXEU_InsertText(this,m_wpOldCaret,m_wpCaret,text,charset,pSecProps,pWordProps));
- }
-
- if (bPaint)
- PaintInsertText(m_wpOldCaret, m_wpCaret);
-
- if (m_bOprNotify && m_pOprNotify)
- m_pOprNotify->OnInsertText(m_wpCaret, m_wpOldCaret);
-
- return TRUE;
- }
- return FALSE;
-}
-
-void CFX_Edit::PaintInsertText(const CPVT_WordPlace & wpOld, const CPVT_WordPlace & wpNew)
-{
- if (m_pVT->IsValid())
- {
- RearrangePart(CPVT_WordRange(wpOld,wpNew));
- ScrollToCaret();
-
- CPVT_WordRange wr;
- if (m_wpCaret.LineCmp(wpOld) !=0)
- wr = CPVT_WordRange(m_pVT->GetLineBeginPlace(wpOld),m_pVT->GetSectionEndPlace(wpNew));
- else
- wr = CPVT_WordRange(wpOld,m_pVT->GetSectionEndPlace(wpNew));
- Refresh(RP_ANALYSE, &wr);
- SetCaretOrigin();
- SetCaretInfo();
- }
-}
-
-FX_BOOL CFX_Edit::Redo()
-{
- if (m_bEnableUndo)
- {
- if (m_Undo.CanRedo())
- {
- m_Undo.Redo();
- return TRUE;
- }
- }
-
- return FALSE;
-}
-
-FX_BOOL CFX_Edit::Undo()
-{
- if (m_bEnableUndo)
- {
- if (m_Undo.CanUndo())
- {
- m_Undo.Undo();
- return TRUE;
- }
- }
-
- return FALSE;
-}
-
-void CFX_Edit::SetCaretOrigin()
-{
- if (m_pVT->IsValid())
- {
- if (IPDF_VariableText_Iterator * pIterator = m_pVT->GetIterator())
- {
- pIterator->SetAt(m_wpCaret);
- CPVT_Word word;
- CPVT_Line line;
- if (pIterator->GetWord(word))
- {
- m_ptCaret.x = word.ptWord.x + word.fWidth;
- m_ptCaret.y = word.ptWord.y;
- }
- else if (pIterator->GetLine(line))
- {
- m_ptCaret.x = line.ptLine.x;
- m_ptCaret.y = line.ptLine.y;
- }
- }
- }
-}
-
-FX_INT32 CFX_Edit::WordPlaceToWordIndex(const CPVT_WordPlace & place) const
-{
- if (m_pVT->IsValid())
- return m_pVT->WordPlaceToWordIndex(place);
-
- return -1;
-}
-
-CPVT_WordPlace CFX_Edit::WordIndexToWordPlace(FX_INT32 index) const
-{
- if (m_pVT->IsValid())
- return m_pVT->WordIndexToWordPlace(index);
-
- return CPVT_WordPlace();
-}
-
-FX_BOOL CFX_Edit::IsTextFull() const
-{
- FX_INT32 nTotalWords = m_pVT->GetTotalWords();
- FX_INT32 nLimitChar = m_pVT->GetLimitChar();
- FX_INT32 nCharArray = m_pVT->GetCharArray();
-
- return IsTextOverflow() || (nLimitChar>0 && nTotalWords >= nLimitChar)
- || (nCharArray>0 && nTotalWords >= nCharArray);
-}
-
-FX_BOOL CFX_Edit::IsTextOverflow() const
-{
- if (!m_bEnableScroll && !m_bEnableOverflow)
- {
- CPDF_Rect rcPlate = m_pVT->GetPlateRect();
- CPDF_Rect rcContent = m_pVT->GetContentRect();
-
- if (m_pVT->IsMultiLine() && GetTotalLines() > 1)
- {
- if (FX_EDIT_IsFloatBigger(rcContent.Height(),rcPlate.Height())) return TRUE;
- }
-
- if (FX_EDIT_IsFloatBigger(rcContent.Width(),rcPlate.Width())) return TRUE;
- }
-
- return FALSE;
-}
-
-CPVT_WordPlace CFX_Edit::GetLineBeginPlace(const CPVT_WordPlace & place) const
-{
- return m_pVT->GetLineBeginPlace(place);
-}
-
-CPVT_WordPlace CFX_Edit::GetLineEndPlace(const CPVT_WordPlace & place) const
-{
- return m_pVT->GetLineEndPlace(place);
-}
-
-CPVT_WordPlace CFX_Edit::GetSectionBeginPlace(const CPVT_WordPlace & place) const
-{
- return m_pVT->GetSectionBeginPlace(place);
-}
-
-CPVT_WordPlace CFX_Edit::GetSectionEndPlace(const CPVT_WordPlace & place) const
-{
- return m_pVT->GetSectionEndPlace(place);
-}
-
-FX_BOOL CFX_Edit::CanUndo() const
-{
- if (m_bEnableUndo)
- {
- return m_Undo.CanUndo();
- }
-
- return FALSE;
-}
-
-FX_BOOL CFX_Edit::CanRedo() const
-{
- if (m_bEnableUndo)
- {
- return m_Undo.CanRedo();
- }
-
- return FALSE;
-}
-
-FX_BOOL CFX_Edit::IsModified() const
-{
- if (m_bEnableUndo)
- {
- return m_Undo.IsModified();
- }
-
- return FALSE;
-}
-
-void CFX_Edit::EnableRefresh(FX_BOOL bRefresh)
-{
- m_bEnableRefresh = bRefresh;
-}
-
-void CFX_Edit::EnableUndo(FX_BOOL bUndo)
-{
- this->m_bEnableUndo = bUndo;
-}
-
-void CFX_Edit::EnableNotify(FX_BOOL bNotify)
-{
- this->m_bNotify = bNotify;
-}
-
-void CFX_Edit::EnableOprNotify(FX_BOOL bNotify)
-{
- this->m_bOprNotify = bNotify;
-}
-
-FX_FLOAT CFX_Edit::GetLineTop(const CPVT_WordPlace& place) const
-{
- if (IPDF_VariableText_Iterator* pIterator = m_pVT->GetIterator())
- {
- CPVT_WordPlace wpOld = pIterator->GetAt();
-
- pIterator->SetAt(place);
- CPVT_Line line;
- pIterator->GetLine(line);
-
- pIterator->SetAt(wpOld);
-
- return line.ptLine.y + line.fLineAscent;
- }
-
- return 0.0f;
-}
-
-FX_FLOAT CFX_Edit::GetLineBottom(const CPVT_WordPlace& place) const
-{
- if (IPDF_VariableText_Iterator* pIterator = m_pVT->GetIterator())
- {
- CPVT_WordPlace wpOld = pIterator->GetAt();
-
- pIterator->SetAt(place);
- CPVT_Line line;
- pIterator->GetLine(line);
-
- pIterator->SetAt(wpOld);
-
- return line.ptLine.y + line.fLineDescent;
- }
-
- return 0.0f;
-}
-
-CPVT_WordPlace CFX_Edit::DoInsertText(const CPVT_WordPlace& place, FX_LPCWSTR text, FX_INT32 charset,
- const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordProps)
-{
- CPVT_WordPlace wp = place;
-
- if (m_pVT->IsValid())
- {
- CFX_WideString sText = text;
-
- for (FX_INT32 i = 0, sz = sText.GetLength(); i < sz; i++)
- {
- FX_WORD word = sText[i];
- switch (word)
- {
- case 0x0D:
- wp = m_pVT->InsertSection(wp,pSecProps,pWordProps);
- if (sText[i+1] == 0x0A)
- i++;
- break;
- case 0x0A:
- wp = m_pVT->InsertSection(wp,pSecProps,pWordProps);
- if (sText[i+1] == 0x0D)
- i++;
- break;
- case 0x09:
- word = 0x20;
- default:
- wp = m_pVT->InsertWord(wp,word,GetCharSetFromUnicode(word, charset),pWordProps);
- break;
- }
- }
- }
-
- return wp;
-}
-
-FX_INT32 CFX_Edit::GetCharSetFromUnicode(FX_WORD word, FX_INT32 nOldCharset)
-{
- if (IFX_Edit_FontMap* pFontMap = this->GetFontMap())
- return pFontMap->CharSetFromUnicode(word, nOldCharset);
- else
- return nOldCharset;
-}
-
-void CFX_Edit::BeginGroupUndo(const CFX_WideString& sTitle)
-{
- ASSERT(m_pGroupUndoItem == NULL);
-
- m_pGroupUndoItem = new CFX_Edit_GroupUndoItem(sTitle);
-}
-
-void CFX_Edit::EndGroupUndo()
-{
- ASSERT(m_pGroupUndoItem != NULL);
-
- m_pGroupUndoItem->UpdateItems();
- m_Undo.AddItem(m_pGroupUndoItem);
- if (m_bOprNotify && m_pOprNotify)
- m_pOprNotify->OnAddUndo(m_pGroupUndoItem);
- m_pGroupUndoItem = NULL;
-}
-
-void CFX_Edit::AddEditUndoItem(CFX_Edit_UndoItem* pEditUndoItem)
-{
- if (m_pGroupUndoItem)
- m_pGroupUndoItem->AddUndoItem(pEditUndoItem);
- else
- {
- m_Undo.AddItem(pEditUndoItem);
- if (m_bOprNotify && m_pOprNotify)
- m_pOprNotify->OnAddUndo(pEditUndoItem);
- }
-}
-
-void CFX_Edit::AddUndoItem(IFX_Edit_UndoItem* pUndoItem)
-{
- m_Undo.AddItem(pUndoItem);
- if (m_bOprNotify && m_pOprNotify)
- m_pOprNotify->OnAddUndo(pUndoItem);
-}
-
+// 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
+
+#include "../../include/fxedit/fxet_stub.h"
+#include "../../include/fxedit/fxet_edit.h"
+
+#define FX_EDIT_UNDO_MAXITEM 10000
+
+/* ---------------------------- CFX_Edit_Iterator ---------------------------- */
+
+CFX_Edit_Iterator::CFX_Edit_Iterator(CFX_Edit * pEdit,IPDF_VariableText_Iterator * pVTIterator) :
+ m_pEdit(pEdit),
+ m_pVTIterator(pVTIterator)
+{
+}
+
+CFX_Edit_Iterator::~CFX_Edit_Iterator()
+{
+}
+
+FX_BOOL CFX_Edit_Iterator::NextWord()
+{
+ ASSERT(m_pVTIterator != NULL);
+
+ return m_pVTIterator->NextWord();
+}
+
+FX_BOOL CFX_Edit_Iterator::NextLine()
+{
+ ASSERT(m_pVTIterator != NULL);
+
+ return m_pVTIterator->NextLine();
+}
+
+FX_BOOL CFX_Edit_Iterator::NextSection()
+{
+ ASSERT(m_pVTIterator != NULL);
+
+ return m_pVTIterator->NextSection();
+}
+
+FX_BOOL CFX_Edit_Iterator::PrevWord()
+{
+ ASSERT(m_pVTIterator != NULL);
+
+ return m_pVTIterator->PrevWord();
+}
+
+FX_BOOL CFX_Edit_Iterator::PrevLine()
+{
+ ASSERT(m_pVTIterator != NULL);
+
+ return m_pVTIterator->PrevLine();
+}
+
+FX_BOOL CFX_Edit_Iterator::PrevSection()
+{
+ ASSERT(m_pVTIterator != NULL);
+
+ return m_pVTIterator->PrevSection();
+}
+
+FX_BOOL CFX_Edit_Iterator::GetWord(CPVT_Word & word) const
+{
+ ASSERT(m_pEdit != NULL);
+ ASSERT(m_pVTIterator != NULL);
+
+ if (m_pVTIterator->GetWord(word))
+ {
+ word.ptWord = m_pEdit->VTToEdit(word.ptWord);
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+FX_BOOL CFX_Edit_Iterator::GetLine(CPVT_Line & line) const
+{
+ ASSERT(m_pEdit != NULL);
+ ASSERT(m_pVTIterator != NULL);
+
+ if (m_pVTIterator->GetLine(line))
+ {
+ line.ptLine = m_pEdit->VTToEdit(line.ptLine);
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+FX_BOOL CFX_Edit_Iterator::GetSection(CPVT_Section & section) const
+{
+ ASSERT(m_pEdit != NULL);
+ ASSERT(m_pVTIterator != NULL);
+
+ if (m_pVTIterator->GetSection(section))
+ {
+ section.rcSection = m_pEdit->VTToEdit(section.rcSection);
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+void CFX_Edit_Iterator::SetAt(FX_INT32 nWordIndex)
+{
+ ASSERT(m_pVTIterator != NULL);
+
+ m_pVTIterator->SetAt(nWordIndex);
+}
+
+void CFX_Edit_Iterator::SetAt(const CPVT_WordPlace & place)
+{
+ ASSERT(m_pVTIterator != NULL);
+
+ m_pVTIterator->SetAt(place);
+}
+
+const CPVT_WordPlace & CFX_Edit_Iterator::GetAt() const
+{
+ ASSERT(m_pVTIterator != NULL);
+
+ return m_pVTIterator->GetAt();
+}
+
+IFX_Edit* CFX_Edit_Iterator::GetEdit() const
+{
+ return m_pEdit;
+}
+
+/* --------------------------- CFX_Edit_Provider ------------------------------- */
+
+CFX_Edit_Provider::CFX_Edit_Provider(IFX_Edit_FontMap * pFontMap) : m_pFontMap(pFontMap)
+{
+ ASSERT(m_pFontMap != NULL);
+}
+
+CFX_Edit_Provider::~CFX_Edit_Provider()
+{
+}
+
+IFX_Edit_FontMap* CFX_Edit_Provider::GetFontMap()
+{
+ return m_pFontMap;
+}
+
+FX_INT32 CFX_Edit_Provider::GetCharWidth(FX_INT32 nFontIndex, FX_WORD word, FX_INT32 nWordStyle)
+{
+ if (CPDF_Font* pPDFFont = m_pFontMap->GetPDFFont(nFontIndex))
+ {
+ FX_DWORD charcode = word;
+
+ if (pPDFFont->IsUnicodeCompatible())
+ charcode = pPDFFont->CharCodeFromUnicode(word);
+ else
+ charcode = m_pFontMap->CharCodeFromUnicode(nFontIndex, word);
+
+ if (charcode != -1)
+ return pPDFFont->GetCharWidthF(charcode);
+ }
+
+ return 0;
+}
+
+FX_INT32 CFX_Edit_Provider::GetTypeAscent(FX_INT32 nFontIndex)
+{
+ if (CPDF_Font* pPDFFont = m_pFontMap->GetPDFFont(nFontIndex))
+ return pPDFFont->GetTypeAscent();
+
+ return 0;
+}
+
+FX_INT32 CFX_Edit_Provider::GetTypeDescent(FX_INT32 nFontIndex)
+{
+ if (CPDF_Font* pPDFFont = m_pFontMap->GetPDFFont(nFontIndex))
+ return pPDFFont->GetTypeDescent();
+
+ return 0;
+}
+
+FX_INT32 CFX_Edit_Provider::GetWordFontIndex(FX_WORD word, FX_INT32 charset, FX_INT32 nFontIndex)
+{
+ return m_pFontMap->GetWordFontIndex(word,charset,nFontIndex);
+}
+
+FX_INT32 CFX_Edit_Provider::GetDefaultFontIndex()
+{
+ return 0;
+}
+
+FX_BOOL CFX_Edit_Provider::IsLatinWord(FX_WORD word)
+{
+ return FX_EDIT_ISLATINWORD(word);
+}
+
+/* --------------------------------- CFX_Edit_Refresh --------------------------------- */
+
+CFX_Edit_Refresh::CFX_Edit_Refresh()
+{
+}
+
+CFX_Edit_Refresh::~CFX_Edit_Refresh()
+{
+}
+
+void CFX_Edit_Refresh::BeginRefresh()
+{
+ m_RefreshRects.Empty();
+ m_OldLineRects = m_NewLineRects;
+}
+
+void CFX_Edit_Refresh::Push(const CPVT_WordRange & linerange,const CPDF_Rect & rect)
+{
+ m_NewLineRects.Add(linerange,rect);
+}
+
+void CFX_Edit_Refresh::NoAnalyse()
+{
+ {
+ for (FX_INT32 i = 0, sz = m_OldLineRects.GetSize(); i < sz; i++)
+ if (CFX_Edit_LineRect * pOldRect = m_OldLineRects.GetAt(i))
+ m_RefreshRects.Add(pOldRect->m_rcLine);
+ }
+
+ {
+ for (FX_INT32 i = 0, sz = m_NewLineRects.GetSize(); i < sz; i++)
+ if (CFX_Edit_LineRect * pNewRect = m_NewLineRects.GetAt(i))
+ m_RefreshRects.Add(pNewRect->m_rcLine);
+ }
+}
+
+void CFX_Edit_Refresh::Analyse(FX_INT32 nAlignment)
+{
+ FX_BOOL bLineTopChanged = FALSE;
+ CPDF_Rect rcResult;
+ FX_FLOAT fWidthDiff;
+
+ FX_INT32 szMax = FX_EDIT_MAX(m_OldLineRects.GetSize(),m_NewLineRects.GetSize());
+ FX_INT32 i = 0;
+
+ while (i < szMax)
+ {
+ CFX_Edit_LineRect * pOldRect = m_OldLineRects.GetAt(i);
+ CFX_Edit_LineRect * pNewRect = m_NewLineRects.GetAt(i);
+
+ if (pOldRect)
+ {
+ if (pNewRect)
+ {
+ if (bLineTopChanged)
+ {
+ rcResult = pOldRect->m_rcLine;
+ rcResult.Union(pNewRect->m_rcLine);
+ m_RefreshRects.Add(rcResult);
+ }
+ else
+ {
+ if (*pNewRect != *pOldRect)
+ {
+ if (!pNewRect->IsSameTop(*pOldRect) || !pNewRect->IsSameHeight(*pOldRect))
+ {
+ bLineTopChanged = TRUE;
+ continue;
+ }
+
+ if (nAlignment == 0)
+ {
+ if (pNewRect->m_wrLine.BeginPos != pOldRect->m_wrLine.BeginPos)
+ {
+ rcResult = pOldRect->m_rcLine;
+ rcResult.Union(pNewRect->m_rcLine);
+ m_RefreshRects.Add(rcResult);
+ }
+ else
+ {
+ if (!pNewRect->IsSameLeft(*pOldRect))
+ {
+ rcResult = pOldRect->m_rcLine;
+ rcResult.Union(pNewRect->m_rcLine);
+ }
+ else
+ {
+ fWidthDiff = pNewRect->m_rcLine.Width() - pOldRect->m_rcLine.Width();
+ rcResult = pNewRect->m_rcLine;
+ if (fWidthDiff > 0.0f)
+ rcResult.left = rcResult.right - fWidthDiff;
+ else
+ {
+ rcResult.left = rcResult.right;
+ rcResult.right += (-fWidthDiff);
+ }
+ }
+ m_RefreshRects.Add(rcResult);
+ }
+ }
+ else
+ {
+ rcResult = pOldRect->m_rcLine;
+ rcResult.Union(pNewRect->m_rcLine);
+ m_RefreshRects.Add(rcResult);
+ }
+ }
+ else
+ {
+ //don't need to do anything
+ }
+ }
+ }
+ else
+ {
+ m_RefreshRects.Add(pOldRect->m_rcLine);
+ }
+ }
+ else
+ {
+ if (pNewRect)
+ {
+ m_RefreshRects.Add(pNewRect->m_rcLine);
+ }
+ else
+ {
+ //error
+ }
+ }
+ i++;
+ }
+}
+
+void CFX_Edit_Refresh::AddRefresh(const CPDF_Rect & rect)
+{
+ m_RefreshRects.Add(rect);
+}
+
+const CFX_Edit_RectArray * CFX_Edit_Refresh::GetRefreshRects() const
+{
+ return &m_RefreshRects;
+}
+
+void CFX_Edit_Refresh::EndRefresh()
+{
+ m_RefreshRects.Empty();
+}
+
+/* ------------------------------------- CFX_Edit_Undo ------------------------------------- */
+
+CFX_Edit_Undo::CFX_Edit_Undo(FX_INT32 nBufsize) : m_nCurUndoPos(0),
+ m_nBufSize(nBufsize),
+ m_bModified(FALSE),
+ m_bVirgin(TRUE),
+ m_bWorking(FALSE)
+{
+}
+
+CFX_Edit_Undo::~CFX_Edit_Undo()
+{
+ Reset();
+}
+
+FX_BOOL CFX_Edit_Undo::CanUndo() const
+{
+ return m_nCurUndoPos > 0;
+}
+
+void CFX_Edit_Undo::Undo()
+{
+ m_bWorking = TRUE;
+
+ if (m_nCurUndoPos > 0)
+ {
+ IFX_Edit_UndoItem * pItem = m_UndoItemStack.GetAt(m_nCurUndoPos-1);
+ ASSERT(pItem != NULL);
+
+ pItem->Undo();
+
+ m_nCurUndoPos--;
+ m_bModified = (m_nCurUndoPos != 0);
+ }
+
+ m_bWorking = FALSE;
+}
+
+FX_BOOL CFX_Edit_Undo::CanRedo() const
+{
+ return m_nCurUndoPos < m_UndoItemStack.GetSize();
+}
+
+void CFX_Edit_Undo::Redo()
+{
+ m_bWorking = TRUE;
+
+ FX_INT32 nStackSize = m_UndoItemStack.GetSize();
+
+ if (m_nCurUndoPos < nStackSize)
+ {
+ IFX_Edit_UndoItem * pItem = m_UndoItemStack.GetAt(m_nCurUndoPos);
+ ASSERT(pItem != NULL);
+
+ pItem->Redo();
+
+ m_nCurUndoPos++;
+ m_bModified = (m_nCurUndoPos != 0);
+ }
+
+ m_bWorking = FALSE;
+}
+
+FX_BOOL CFX_Edit_Undo::IsWorking() const
+{
+ return m_bWorking;
+}
+
+void CFX_Edit_Undo::AddItem(IFX_Edit_UndoItem* pItem)
+{
+ ASSERT(!m_bWorking);
+ ASSERT(pItem != NULL);
+ ASSERT(m_nBufSize > 1);
+
+ if (m_nCurUndoPos < m_UndoItemStack.GetSize())
+ RemoveTails();
+
+ if (m_UndoItemStack.GetSize() >= m_nBufSize)
+ {
+ RemoveHeads();
+ m_bVirgin = FALSE;
+ }
+
+ m_UndoItemStack.Add(pItem);
+ m_nCurUndoPos = m_UndoItemStack.GetSize();
+
+ m_bModified = (m_nCurUndoPos != 0);
+}
+
+FX_BOOL CFX_Edit_Undo::IsModified() const
+{
+ if (m_bVirgin)
+ return m_bModified;
+ else
+ return TRUE;
+}
+
+IFX_Edit_UndoItem* CFX_Edit_Undo::GetItem(FX_INT32 nIndex)
+{
+ if (nIndex>=0 && nIndex < m_UndoItemStack.GetSize())
+ return m_UndoItemStack.GetAt(nIndex);
+
+ return NULL;
+}
+
+void CFX_Edit_Undo::RemoveHeads()
+{
+ ASSERT(m_UndoItemStack.GetSize() > 1);
+
+ IFX_Edit_UndoItem* pItem = m_UndoItemStack.GetAt(0);
+ ASSERT(pItem != NULL);
+
+ pItem->Release();
+ m_UndoItemStack.RemoveAt(0);
+}
+
+void CFX_Edit_Undo::RemoveTails()
+{
+ for (FX_INT32 i = m_UndoItemStack.GetSize()-1; i >= m_nCurUndoPos; i--)
+ {
+ IFX_Edit_UndoItem* pItem = m_UndoItemStack.GetAt(i);
+ ASSERT(pItem != NULL);
+
+ pItem->Release();
+ m_UndoItemStack.RemoveAt(i);
+ }
+}
+
+void CFX_Edit_Undo::Reset()
+{
+ for (FX_INT32 i=0, sz=m_UndoItemStack.GetSize(); i < sz; i++)
+ {
+ IFX_Edit_UndoItem * pItem = m_UndoItemStack.GetAt(i);
+ ASSERT(pItem != NULL);
+
+ pItem->Release();
+ }
+ m_nCurUndoPos = 0;
+ m_UndoItemStack.RemoveAll();
+}
+
+/* -------------------------------- CFX_Edit_GroupUndoItem -------------------------------- */
+
+CFX_Edit_GroupUndoItem::CFX_Edit_GroupUndoItem(const CFX_WideString& sTitle) : m_sTitle(sTitle)
+{
+}
+
+CFX_Edit_GroupUndoItem::~CFX_Edit_GroupUndoItem()
+{
+ for (int i=0,sz=m_Items.GetSize(); i<sz; i++)
+ {
+ CFX_Edit_UndoItem* pUndoItem = m_Items[i];
+ ASSERT(pUndoItem != NULL);
+
+ pUndoItem->Release();
+ }
+
+ m_Items.RemoveAll();
+}
+
+void CFX_Edit_GroupUndoItem::AddUndoItem(CFX_Edit_UndoItem* pUndoItem)
+{
+ ASSERT(pUndoItem != NULL);
+
+ pUndoItem->SetFirst(FALSE);
+ pUndoItem->SetLast(FALSE);
+
+ m_Items.Add(pUndoItem);
+
+ if (m_sTitle.IsEmpty())
+ m_sTitle = pUndoItem->GetUndoTitle();
+}
+
+void CFX_Edit_GroupUndoItem::UpdateItems()
+{
+ if (m_Items.GetSize() > 0)
+ {
+ CFX_Edit_UndoItem* pFirstItem = m_Items[0];
+ ASSERT(pFirstItem != NULL);
+ pFirstItem->SetFirst(TRUE);
+
+ CFX_Edit_UndoItem* pLastItem = m_Items[m_Items.GetSize() - 1];
+ ASSERT(pLastItem != NULL);
+ pLastItem->SetLast(TRUE);
+ }
+}
+
+void CFX_Edit_GroupUndoItem::Undo()
+{
+ for (int i=m_Items.GetSize()-1; i>=0; i--)
+ {
+ CFX_Edit_UndoItem* pUndoItem = m_Items[i];
+ ASSERT(pUndoItem != NULL);
+
+ pUndoItem->Undo();
+ }
+}
+
+void CFX_Edit_GroupUndoItem::Redo()
+{
+ for (int i=0,sz=m_Items.GetSize(); i<sz; i++)
+ {
+ CFX_Edit_UndoItem* pUndoItem = m_Items[i];
+ ASSERT(pUndoItem != NULL);
+
+ pUndoItem->Redo();
+ }
+}
+
+CFX_WideString CFX_Edit_GroupUndoItem::GetUndoTitle()
+{
+ return m_sTitle;
+}
+
+void CFX_Edit_GroupUndoItem::Release()
+{
+ delete this;
+}
+
+/* ------------------------------------- CFX_Edit_UndoItem derived classes ------------------------------------- */
+
+CFXEU_InsertWord::CFXEU_InsertWord(CFX_Edit * pEdit, const CPVT_WordPlace & wpOldPlace, const CPVT_WordPlace & wpNewPlace,
+ FX_WORD word, FX_INT32 charset, const CPVT_WordProps * pWordProps)
+ : m_pEdit(pEdit), m_wpOld(wpOldPlace), m_wpNew(wpNewPlace), m_Word(word), m_nCharset(charset), m_WordProps()
+{
+ if (pWordProps)
+ m_WordProps = *pWordProps;
+}
+
+CFXEU_InsertWord::~CFXEU_InsertWord()
+{
+}
+
+void CFXEU_InsertWord::Redo()
+{
+ if (m_pEdit)
+ {
+ m_pEdit->SelectNone();
+ m_pEdit->SetCaret(m_wpOld);
+ m_pEdit->InsertWord(m_Word,m_nCharset,&m_WordProps,FALSE,TRUE);
+ }
+}
+
+void CFXEU_InsertWord::Undo()
+{
+ if (m_pEdit)
+ {
+ m_pEdit->SelectNone();
+ m_pEdit->SetCaret(m_wpNew);
+ m_pEdit->Backspace(FALSE,TRUE);
+ }
+}
+
+/* -------------------------------------------------------------------------- */
+
+CFXEU_InsertReturn::CFXEU_InsertReturn(CFX_Edit * pEdit, const CPVT_WordPlace & wpOldPlace, const CPVT_WordPlace & wpNewPlace,
+ const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordProps) :
+ m_pEdit(pEdit),
+ m_wpOld(wpOldPlace),
+ m_wpNew(wpNewPlace),
+ m_SecProps(),
+ m_WordProps()
+{
+ if (pSecProps)
+ m_SecProps = *pSecProps;
+ if (pWordProps)
+ m_WordProps = *pWordProps;
+}
+
+CFXEU_InsertReturn::~CFXEU_InsertReturn()
+{
+}
+
+void CFXEU_InsertReturn::Redo()
+{
+ if (m_pEdit)
+ {
+ m_pEdit->SelectNone();
+ m_pEdit->SetCaret(m_wpOld);
+ m_pEdit->InsertReturn(&m_SecProps,&m_WordProps,FALSE,TRUE);
+ }
+}
+
+void CFXEU_InsertReturn::Undo()
+{
+ if (m_pEdit)
+ {
+ m_pEdit->SelectNone();
+ m_pEdit->SetCaret(m_wpNew);
+ m_pEdit->Backspace(FALSE,TRUE);
+ }
+}
+
+/* -------------------------------------------------------------------------- */
+//CFXEU_Backspace
+
+CFXEU_Backspace::CFXEU_Backspace(CFX_Edit * pEdit, const CPVT_WordPlace & wpOldPlace, const CPVT_WordPlace & wpNewPlace,
+ FX_WORD word, FX_INT32 charset,
+ const CPVT_SecProps & SecProps, const CPVT_WordProps & WordProps) :
+ m_pEdit(pEdit),
+ m_wpOld(wpOldPlace),
+ m_wpNew(wpNewPlace),
+ m_Word(word),
+ m_nCharset(charset),
+ m_SecProps(SecProps),
+ m_WordProps(WordProps)
+{
+}
+
+CFXEU_Backspace::~CFXEU_Backspace()
+{
+}
+
+void CFXEU_Backspace::Redo()
+{
+ if (m_pEdit)
+ {
+ m_pEdit->SelectNone();
+ m_pEdit->SetCaret(m_wpOld);
+ m_pEdit->Backspace(FALSE,TRUE);
+ }
+}
+
+void CFXEU_Backspace::Undo()
+{
+ if (m_pEdit)
+ {
+ m_pEdit->SelectNone();
+ m_pEdit->SetCaret(m_wpNew);
+ if (m_wpNew.SecCmp(m_wpOld) != 0)
+ {
+ m_pEdit->InsertReturn(&m_SecProps,&m_WordProps,FALSE,TRUE);
+ }
+ else
+ {
+ m_pEdit->InsertWord(m_Word,m_nCharset,&m_WordProps,FALSE,TRUE);
+ }
+ }
+}
+
+/* -------------------------------------------------------------------------- */
+//CFXEU_Delete
+
+CFXEU_Delete::CFXEU_Delete(CFX_Edit * pEdit, const CPVT_WordPlace & wpOldPlace, const CPVT_WordPlace & wpNewPlace,
+ FX_WORD word, FX_INT32 charset,
+ const CPVT_SecProps & SecProps, const CPVT_WordProps & WordProps, FX_BOOL bSecEnd) :
+ m_pEdit(pEdit),
+ m_wpOld(wpOldPlace),
+ m_wpNew(wpNewPlace),
+ m_Word(word),
+ m_nCharset(charset),
+ m_SecProps(SecProps),
+ m_WordProps(WordProps),
+ m_bSecEnd(bSecEnd)
+{
+}
+
+CFXEU_Delete::~CFXEU_Delete()
+{
+}
+
+void CFXEU_Delete::Redo()
+{
+ if (m_pEdit)
+ {
+ m_pEdit->SelectNone();
+ m_pEdit->SetCaret(m_wpOld);
+ m_pEdit->Delete(FALSE,TRUE);
+ }
+}
+
+void CFXEU_Delete::Undo()
+{
+ if (m_pEdit)
+ {
+ m_pEdit->SelectNone();
+ m_pEdit->SetCaret(m_wpNew);
+ if (m_bSecEnd)
+ {
+ m_pEdit->InsertReturn(&m_SecProps,&m_WordProps,FALSE,TRUE);
+ }
+ else
+ {
+ m_pEdit->InsertWord(m_Word,m_nCharset,&m_WordProps,FALSE,TRUE);
+ }
+ }
+}
+
+/* -------------------------------------------------------------------------- */
+//CFXEU_Clear
+
+CFXEU_Clear::CFXEU_Clear(CFX_Edit * pEdit, const CPVT_WordRange & wrSel, const CFX_WideString & swText) :
+ m_pEdit(pEdit),
+ m_wrSel(wrSel),
+ m_swText(swText)
+{
+}
+
+CFXEU_Clear::~CFXEU_Clear()
+{
+}
+
+void CFXEU_Clear::Redo()
+{
+ if (m_pEdit)
+ {
+ m_pEdit->SelectNone();
+ m_pEdit->SetSel(m_wrSel.BeginPos,m_wrSel.EndPos);
+ m_pEdit->Clear(FALSE,TRUE);
+ }
+}
+
+void CFXEU_Clear::Undo()
+{
+ if (m_pEdit)
+ {
+ m_pEdit->SelectNone();
+ m_pEdit->SetCaret(m_wrSel.BeginPos);
+ m_pEdit->InsertText(m_swText, DEFAULT_CHARSET, NULL,NULL,FALSE,TRUE);
+ m_pEdit->SetSel(m_wrSel.BeginPos,m_wrSel.EndPos);
+ }
+}
+
+/* -------------------------------------------------------------------------- */
+//CFXEU_ClearRich
+
+CFXEU_ClearRich::CFXEU_ClearRich(CFX_Edit * pEdit, const CPVT_WordPlace & wpOldPlace, const CPVT_WordPlace & wpNewPlace,
+ const CPVT_WordRange & wrSel, FX_WORD word, FX_INT32 charset,
+ const CPVT_SecProps & SecProps, const CPVT_WordProps & WordProps) :
+ m_pEdit(pEdit),
+ m_wpOld(wpOldPlace),
+ m_wpNew(wpNewPlace),
+ m_wrSel(wrSel),
+ m_Word(word),
+ m_nCharset(charset),
+ m_SecProps(SecProps),
+ m_WordProps(WordProps)
+{
+}
+
+CFXEU_ClearRich::~CFXEU_ClearRich()
+{
+}
+
+void CFXEU_ClearRich::Redo()
+{
+ if (m_pEdit && IsLast())
+ {
+ m_pEdit->SelectNone();
+ m_pEdit->SetSel(m_wrSel.BeginPos,m_wrSel.EndPos);
+ m_pEdit->Clear(FALSE,TRUE);
+ }
+}
+
+void CFXEU_ClearRich::Undo()
+{
+ if (m_pEdit)
+ {
+ m_pEdit->SelectNone();
+ m_pEdit->SetCaret(m_wpOld);
+ if (m_wpNew.SecCmp(m_wpOld) != 0)
+ {
+ m_pEdit->InsertReturn(&m_SecProps,&m_WordProps,FALSE,FALSE);
+ }
+ else
+ {
+ m_pEdit->InsertWord(m_Word,m_nCharset,&m_WordProps,FALSE,FALSE);
+ }
+
+ if (IsFirst())
+ {
+ m_pEdit->PaintInsertText(m_wrSel.BeginPos,m_wrSel.EndPos);
+ m_pEdit->SetSel(m_wrSel.BeginPos,m_wrSel.EndPos);
+ }
+ }
+}
+/* -------------------------------------------------------------------------- */
+//CFXEU_InsertText
+
+CFXEU_InsertText::CFXEU_InsertText(CFX_Edit * pEdit, const CPVT_WordPlace & wpOldPlace, const CPVT_WordPlace & wpNewPlace,
+ const CFX_WideString & swText, FX_INT32 charset,
+ const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordProps) :
+ m_pEdit(pEdit),
+ m_wpOld(wpOldPlace),
+ m_wpNew(wpNewPlace),
+ m_swText(swText),
+ m_nCharset(charset),
+ m_SecProps(),
+ m_WordProps()
+{
+ if (pSecProps)
+ m_SecProps = *pSecProps;
+ if (pWordProps)
+ m_WordProps = *pWordProps;
+}
+
+CFXEU_InsertText::~CFXEU_InsertText()
+{
+}
+
+void CFXEU_InsertText::Redo()
+{
+ if (m_pEdit && IsLast())
+ {
+ m_pEdit->SelectNone();
+ m_pEdit->SetCaret(m_wpOld);
+ m_pEdit->InsertText(m_swText, m_nCharset,&m_SecProps, &m_WordProps,FALSE,TRUE);
+ }
+}
+
+void CFXEU_InsertText::Undo()
+{
+ if (m_pEdit)
+ {
+ m_pEdit->SelectNone();
+ m_pEdit->SetSel(m_wpOld,m_wpNew);
+ m_pEdit->Clear(FALSE,TRUE);
+ }
+}
+
+/* -------------------------------------------------------------------------- */
+
+CFXEU_SetSecProps::CFXEU_SetSecProps(CFX_Edit * pEdit, const CPVT_WordPlace & place, EDIT_PROPS_E ep,
+ const CPVT_SecProps & oldsecprops, const CPVT_WordProps & oldwordprops,
+ const CPVT_SecProps & newsecprops, const CPVT_WordProps & newwordprops, const CPVT_WordRange & range)
+ : m_pEdit(pEdit),
+ m_wpPlace(place),
+ m_eProps(ep),
+ m_OldSecProps(oldsecprops),
+ m_NewSecProps(newsecprops),
+ m_OldWordProps(oldwordprops),
+ m_NewWordProps(newwordprops),
+ m_wrPlace(range)
+{
+}
+
+CFXEU_SetSecProps::~CFXEU_SetSecProps()
+{
+}
+
+void CFXEU_SetSecProps::Redo()
+{
+ if (m_pEdit)
+ {
+ m_pEdit->SetSecProps(m_eProps,m_wpPlace,&m_NewSecProps,&m_NewWordProps,m_wrPlace,FALSE);
+ if (IsLast())
+ {
+ m_pEdit->SelectNone();
+ m_pEdit->PaintSetProps(m_eProps,m_wrPlace);
+ m_pEdit->SetSel(m_wrPlace.BeginPos,m_wrPlace.EndPos);
+ }
+ }
+}
+
+void CFXEU_SetSecProps::Undo()
+{
+ if (m_pEdit)
+ {
+ m_pEdit->SetSecProps(m_eProps,m_wpPlace,&m_OldSecProps,&m_OldWordProps,m_wrPlace,FALSE);
+ if (IsFirst())
+ {
+ m_pEdit->SelectNone();
+ m_pEdit->PaintSetProps(m_eProps,m_wrPlace);
+ m_pEdit->SetSel(m_wrPlace.BeginPos,m_wrPlace.EndPos);
+ }
+ }
+}
+
+/* -------------------------------------------------------------------------- */
+
+CFXEU_SetWordProps::CFXEU_SetWordProps(CFX_Edit * pEdit, const CPVT_WordPlace & place, EDIT_PROPS_E ep,
+ const CPVT_WordProps & oldprops, const CPVT_WordProps & newprops, const CPVT_WordRange & range)
+ : m_pEdit(pEdit),
+ m_wpPlace(place),
+ m_eProps(ep),
+ m_OldWordProps(oldprops),
+ m_NewWordProps(newprops),
+ m_wrPlace(range)
+{
+}
+
+CFXEU_SetWordProps::~CFXEU_SetWordProps()
+{
+}
+
+void CFXEU_SetWordProps::Redo()
+{
+ if (m_pEdit)
+ {
+ m_pEdit->SetWordProps(m_eProps,m_wpPlace,&m_NewWordProps,m_wrPlace,FALSE);
+ if (IsLast())
+ {
+ m_pEdit->SelectNone();
+ m_pEdit->PaintSetProps(m_eProps,m_wrPlace);
+ m_pEdit->SetSel(m_wrPlace.BeginPos,m_wrPlace.EndPos);
+ }
+ }
+}
+
+void CFXEU_SetWordProps::Undo()
+{
+ if (m_pEdit)
+ {
+ m_pEdit->SetWordProps(m_eProps,m_wpPlace,&m_OldWordProps,m_wrPlace,FALSE);
+ if (IsFirst())
+ {
+ m_pEdit->SelectNone();
+ m_pEdit->PaintSetProps(m_eProps,m_wrPlace);
+ m_pEdit->SetSel(m_wrPlace.BeginPos,m_wrPlace.EndPos);
+ }
+ }
+}
+
+/* ------------------------------------- CFX_Edit ------------------------------------- */
+
+CFX_Edit::CFX_Edit(IPDF_VariableText * pVT) :
+ m_pVT(pVT),
+ m_pNotify(NULL),
+ m_pOprNotify(NULL),
+ m_wpCaret(-1,-1,-1),
+ m_wpOldCaret(-1,-1,-1),
+ m_ptScrollPos(0,0),
+ m_ptRefreshScrollPos(0,0),
+ m_bEnableScroll(FALSE),
+ m_bEnableOverflow(FALSE),
+ m_pVTProvide(NULL),
+ m_pIterator(NULL),
+ m_SelState(),
+ m_ptCaret(0.0f,0.0f),
+ m_Undo(FX_EDIT_UNDO_MAXITEM),
+ m_nAlignment(0),
+ m_bNotifyFlag(FALSE),
+ m_bEnableRefresh(TRUE),
+ m_rcOldContent(0.0f,0.0f,0.0f,0.0f),
+ m_bEnableUndo(TRUE),
+ m_bNotify(TRUE),
+ m_bOprNotify(FALSE),
+ m_pGroupUndoItem(NULL)
+{
+ ASSERT(pVT != NULL);
+}
+
+CFX_Edit::~CFX_Edit()
+{
+ if (m_pVTProvide)
+ {
+ delete m_pVTProvide;
+ m_pVTProvide = NULL;
+ }
+
+ if (m_pIterator)
+ {
+ delete m_pIterator;
+ m_pIterator = NULL;
+ }
+
+ ASSERT(m_pGroupUndoItem == NULL);
+}
+
+// public methods
+
+void CFX_Edit::Initialize()
+{
+ m_pVT->Initialize();
+ SetCaret(m_pVT->GetBeginWordPlace());
+ SetCaretOrigin();
+}
+
+void CFX_Edit::SetFontMap(IFX_Edit_FontMap * pFontMap)
+{
+ if (m_pVTProvide)
+ delete m_pVTProvide;
+
+ m_pVT->SetProvider(m_pVTProvide = new CFX_Edit_Provider(pFontMap));
+}
+
+void CFX_Edit::SetVTProvider(IPDF_VariableText_Provider* pProvider)
+{
+ m_pVT->SetProvider(pProvider);
+}
+
+void CFX_Edit::SetNotify(IFX_Edit_Notify* pNotify)
+{
+ m_pNotify = pNotify;
+}
+
+void CFX_Edit::SetOprNotify(IFX_Edit_OprNotify* pOprNotify)
+{
+ m_pOprNotify = pOprNotify;
+}
+
+IFX_Edit_Iterator * CFX_Edit::GetIterator()
+{
+ if (!m_pIterator)
+ m_pIterator = new CFX_Edit_Iterator(this,m_pVT->GetIterator());
+
+ return m_pIterator;
+}
+
+IPDF_VariableText * CFX_Edit::GetVariableText()
+{
+ return m_pVT;
+}
+
+IFX_Edit_FontMap* CFX_Edit::GetFontMap()
+{
+ if (m_pVTProvide)
+ return m_pVTProvide->GetFontMap();
+
+ return NULL;
+}
+
+void CFX_Edit::SetPlateRect(const CPDF_Rect & rect, FX_BOOL bPaint/* = TRUE*/)
+{
+ m_pVT->SetPlateRect(rect);
+ m_ptScrollPos = CPDF_Point(rect.left,rect.top);
+ if (bPaint) Paint();
+}
+
+void CFX_Edit::SetAlignmentH(FX_INT32 nFormat/* =0 */, FX_BOOL bPaint/* = TRUE*/)
+{
+ m_pVT->SetAlignment(nFormat);
+ if (bPaint) Paint();
+}
+
+void CFX_Edit::SetAlignmentV(FX_INT32 nFormat/* =0 */, FX_BOOL bPaint/* = TRUE*/)
+{
+ m_nAlignment = nFormat;
+ if (bPaint) Paint();
+}
+
+void CFX_Edit::SetPasswordChar(FX_WORD wSubWord/* ='*' */, FX_BOOL bPaint/* = TRUE*/)
+{
+ m_pVT->SetPasswordChar(wSubWord);
+ if (bPaint) Paint();
+}
+
+void CFX_Edit::SetLimitChar(FX_INT32 nLimitChar/* =0 */, FX_BOOL bPaint/* = TRUE*/)
+{
+ m_pVT->SetLimitChar(nLimitChar);
+ if (bPaint) Paint();
+}
+
+void CFX_Edit::SetCharArray(FX_INT32 nCharArray/* =0 */, FX_BOOL bPaint/* = TRUE*/)
+{
+ m_pVT->SetCharArray(nCharArray);
+ if (bPaint) Paint();
+}
+
+void CFX_Edit::SetCharSpace(FX_FLOAT fCharSpace/* =0.0f */, FX_BOOL bPaint/* = TRUE*/)
+{
+ m_pVT->SetCharSpace(fCharSpace);
+ if (bPaint) Paint();
+}
+
+void CFX_Edit::SetHorzScale(FX_INT32 nHorzScale/* =100 */, FX_BOOL bPaint/* = TRUE*/)
+{
+ m_pVT->SetHorzScale(nHorzScale);
+ if (bPaint) Paint();
+}
+
+void CFX_Edit::SetMultiLine(FX_BOOL bMultiLine/* =TRUE */, FX_BOOL bPaint/* = TRUE*/)
+{
+ m_pVT->SetMultiLine(bMultiLine);
+ if (bPaint) Paint();
+}
+
+void CFX_Edit::SetAutoReturn(FX_BOOL bAuto/* =TRUE */, FX_BOOL bPaint/* = TRUE*/)
+{
+ m_pVT->SetAutoReturn(bAuto);
+ if (bPaint) Paint();
+}
+
+void CFX_Edit::SetLineLeading(FX_FLOAT fLineLeading/* =TRUE */, FX_BOOL bPaint/* = TRUE*/)
+{
+ m_pVT->SetLineLeading(fLineLeading);
+ if (bPaint) Paint();
+}
+
+void CFX_Edit::SetAutoFontSize(FX_BOOL bAuto/* =TRUE */, FX_BOOL bPaint/* = TRUE*/)
+{
+ m_pVT->SetAutoFontSize(bAuto);
+ if (bPaint) Paint();
+}
+
+void CFX_Edit::SetFontSize(FX_FLOAT fFontSize, FX_BOOL bPaint/* = TRUE*/)
+{
+ m_pVT->SetFontSize(fFontSize);
+ if (bPaint) Paint();
+}
+
+void CFX_Edit::SetAutoScroll(FX_BOOL bAuto/* =TRUE */, FX_BOOL bPaint/* = TRUE*/)
+{
+ m_bEnableScroll = bAuto;
+ if (bPaint) Paint();
+}
+
+void CFX_Edit::SetTextOverflow(FX_BOOL bAllowed /*= FALSE*/, FX_BOOL bPaint/* = TRUE*/)
+{
+ m_bEnableOverflow = bAllowed;
+ if (bPaint) Paint();
+}
+
+void CFX_Edit::SetSel(FX_INT32 nStartChar,FX_INT32 nEndChar)
+{
+ if (m_pVT->IsValid())
+ {
+ if (nStartChar == 0 && nEndChar < 0)
+ {
+ SelectAll();
+ }
+ else if (nStartChar < 0)
+ {
+ this->SelectNone();
+ }
+ else
+ {
+ if (nStartChar < nEndChar)
+ {
+ SetSel(m_pVT->WordIndexToWordPlace(nStartChar),m_pVT->WordIndexToWordPlace(nEndChar));
+ }
+ else
+ {
+ SetSel(m_pVT->WordIndexToWordPlace(nEndChar),m_pVT->WordIndexToWordPlace(nStartChar));
+ }
+ }
+ }
+}
+
+void CFX_Edit::SetSel(const CPVT_WordPlace & begin,const CPVT_WordPlace & end)
+{
+ if (m_pVT->IsValid())
+ {
+ SelectNone();
+
+ m_SelState.Set(begin,end);
+
+ SetCaret(m_SelState.EndPos);
+
+ if (m_SelState.IsExist())
+ {
+ ScrollToCaret();
+ CPVT_WordRange wr(m_SelState.BeginPos,m_SelState.EndPos);
+ Refresh(RP_OPTIONAL,&wr);
+ SetCaretInfo();
+ }
+ else
+ {
+ ScrollToCaret();
+ SetCaretInfo();
+ }
+ }
+}
+
+void CFX_Edit::GetSel(FX_INT32 & nStartChar, FX_INT32 & nEndChar) const
+{
+ nStartChar = -1;
+ nEndChar = -1;
+
+ if (m_pVT->IsValid())
+ {
+ if (m_SelState.IsExist())
+ {
+ if (m_SelState.BeginPos.WordCmp(m_SelState.EndPos)<0)
+ {
+ nStartChar = m_pVT->WordPlaceToWordIndex(m_SelState.BeginPos);
+ nEndChar = m_pVT->WordPlaceToWordIndex(m_SelState.EndPos);
+ }
+ else
+ {
+ nStartChar = m_pVT->WordPlaceToWordIndex(m_SelState.EndPos);
+ nEndChar = m_pVT->WordPlaceToWordIndex(m_SelState.BeginPos);
+ }
+ }
+ else
+ {
+ nStartChar = m_pVT->WordPlaceToWordIndex(m_wpCaret);
+ nEndChar = m_pVT->WordPlaceToWordIndex(m_wpCaret);
+ }
+ }
+}
+
+FX_INT32 CFX_Edit::GetCaret() const
+{
+ if (m_pVT->IsValid())
+ return m_pVT->WordPlaceToWordIndex(m_wpCaret);
+
+ return -1;
+}
+
+CPVT_WordPlace CFX_Edit::GetCaretWordPlace() const
+{
+ return m_wpCaret;
+}
+
+CFX_WideString CFX_Edit::GetText() const
+{
+ CFX_WideString swRet;
+
+ if (m_pVT->IsValid())
+ {
+ if (IPDF_VariableText_Iterator * pIterator = m_pVT->GetIterator())
+ {
+ FX_BOOL bRich = m_pVT->IsRichText();
+
+ pIterator->SetAt(0);
+
+ CPVT_Word wordinfo;
+ CPVT_WordPlace oldplace = pIterator->GetAt();
+ while (pIterator->NextWord())
+ {
+ CPVT_WordPlace place = pIterator->GetAt();
+
+ if (pIterator->GetWord(wordinfo))
+ {
+ if (bRich)
+ {
+ swRet += wordinfo.Word;
+ }
+ else
+ {
+ swRet += wordinfo.Word;
+ }
+ }
+
+ if (oldplace.SecCmp(place) != 0)
+ {
+ swRet += 0x0D;
+ swRet += 0x0A;
+ }
+
+ oldplace = place;
+ }
+ }
+ }
+
+ return swRet;
+}
+
+CFX_WideString CFX_Edit::GetRangeText(const CPVT_WordRange & range) const
+{
+ CFX_WideString swRet;
+
+ if (m_pVT->IsValid())
+ {
+ FX_BOOL bRich = m_pVT->IsRichText();
+
+ if (IPDF_VariableText_Iterator * pIterator = m_pVT->GetIterator())
+ {
+ CPVT_WordRange wrTemp = range;
+ m_pVT->UpdateWordPlace(wrTemp.BeginPos);
+ m_pVT->UpdateWordPlace(wrTemp.EndPos);
+ pIterator->SetAt(wrTemp.BeginPos);
+
+ CPVT_Word wordinfo;
+ CPVT_WordPlace oldplace = wrTemp.BeginPos;
+ while (pIterator->NextWord())
+ {
+ CPVT_WordPlace place = pIterator->GetAt();
+ if (place.WordCmp(wrTemp.EndPos) > 0)break;
+
+ if (pIterator->GetWord(wordinfo))
+ {
+ if (bRich)
+ {
+ swRet += wordinfo.Word;
+ }
+ else
+ {
+ swRet += wordinfo.Word;
+ }
+ }
+
+ if (oldplace.SecCmp(place) != 0)
+ {
+ swRet += 0x0D;
+ swRet += 0x0A;
+ }
+
+ oldplace = place;
+ }
+ }
+ }
+
+ return swRet;
+}
+
+CFX_WideString CFX_Edit::GetSelText() const
+{
+ return GetRangeText(m_SelState.ConvertToWordRange());
+}
+
+FX_INT32 CFX_Edit::GetTotalWords() const
+{
+ return m_pVT->GetTotalWords();
+}
+
+FX_INT32 CFX_Edit::GetTotalLines() const
+{
+ FX_INT32 nLines = 0;
+
+ if (IPDF_VariableText_Iterator * pIterator = m_pVT->GetIterator())
+ {
+ pIterator->SetAt(0);
+ while (pIterator->NextLine())
+ nLines++;
+ }
+
+ return nLines+1;
+}
+
+CPVT_WordRange CFX_Edit::GetSelectWordRange() const
+{
+ return m_SelState.ConvertToWordRange();
+}
+
+CPVT_WordRange CFX_Edit::CombineWordRange(const CPVT_WordRange & wr1, const CPVT_WordRange & wr2)
+{
+ CPVT_WordRange wrRet;
+
+ if (wr1.BeginPos.WordCmp(wr2.BeginPos) < 0)
+ {
+ wrRet.BeginPos = wr1.BeginPos;
+ }
+ else
+ {
+ wrRet.BeginPos = wr2.BeginPos;
+ }
+
+ if (wr1.EndPos.WordCmp(wr2.EndPos) < 0)
+ {
+ wrRet.EndPos = wr2.EndPos;
+ }
+ else
+ {
+ wrRet.EndPos = wr1.EndPos;
+ }
+
+ return wrRet;
+}
+
+FX_BOOL CFX_Edit::IsRichText() const
+{
+ return m_pVT->IsRichText();
+}
+
+void CFX_Edit::SetRichText(FX_BOOL bRichText/* =TRUE */, FX_BOOL bPaint/* = TRUE*/)
+{
+ m_pVT->SetRichText(bRichText);
+ if (bPaint) Paint();
+}
+
+FX_BOOL CFX_Edit::SetRichFontIndex(FX_INT32 nFontIndex)
+{
+ CPVT_WordProps WordProps;
+ WordProps.nFontIndex = nFontIndex;
+ return SetRichTextProps(EP_FONTINDEX,NULL,&WordProps);
+}
+
+FX_BOOL CFX_Edit::SetRichFontSize(FX_FLOAT fFontSize)
+{
+ CPVT_WordProps WordProps;
+ WordProps.fFontSize = fFontSize;
+ return SetRichTextProps(EP_FONTSIZE,NULL,&WordProps);
+}
+
+FX_BOOL CFX_Edit::SetRichTextColor(FX_COLORREF dwColor)
+{
+ CPVT_WordProps WordProps;
+ WordProps.dwWordColor = dwColor;
+ return SetRichTextProps(EP_WORDCOLOR,NULL,&WordProps);
+}
+
+FX_BOOL CFX_Edit::SetRichTextScript(FX_INT32 nScriptType)
+{
+ CPVT_WordProps WordProps;
+ WordProps.nScriptType = nScriptType;
+ return SetRichTextProps(EP_SCRIPTTYPE,NULL,&WordProps);
+}
+
+FX_BOOL CFX_Edit::SetRichTextBold(FX_BOOL bBold)
+{
+ CPVT_WordProps WordProps;
+ if (bBold)
+ WordProps.nWordStyle |= PVTWORD_STYLE_BOLD;
+ return SetRichTextProps(EP_BOLD,NULL,&WordProps);
+}
+
+FX_BOOL CFX_Edit::SetRichTextItalic(FX_BOOL bItalic)
+{
+ CPVT_WordProps WordProps;
+ if (bItalic)
+ WordProps.nWordStyle |= PVTWORD_STYLE_ITALIC;
+ return SetRichTextProps(EP_ITALIC,NULL,&WordProps);
+}
+
+FX_BOOL CFX_Edit::SetRichTextUnderline(FX_BOOL bUnderline)
+{
+ CPVT_WordProps WordProps;
+ if (bUnderline)
+ WordProps.nWordStyle |= PVTWORD_STYLE_UNDERLINE;
+ return SetRichTextProps(EP_UNDERLINE,NULL,&WordProps);
+}
+
+FX_BOOL CFX_Edit::SetRichTextCrossout(FX_BOOL bCrossout)
+{
+ CPVT_WordProps WordProps;
+ if (bCrossout)
+ WordProps.nWordStyle |= PVTWORD_STYLE_CROSSOUT;
+ return SetRichTextProps(EP_CROSSOUT,NULL,&WordProps);
+}
+
+FX_BOOL CFX_Edit::SetRichTextCharSpace(FX_FLOAT fCharSpace)
+{
+ CPVT_WordProps WordProps;
+ WordProps.fCharSpace = fCharSpace;
+ return SetRichTextProps(EP_CHARSPACE,NULL,&WordProps);
+}
+
+FX_BOOL CFX_Edit::SetRichTextHorzScale(FX_INT32 nHorzScale /*= 100*/)
+{
+ CPVT_WordProps WordProps;
+ WordProps.nHorzScale = nHorzScale;
+ return SetRichTextProps(EP_HORZSCALE,NULL,&WordProps);
+}
+
+FX_BOOL CFX_Edit::SetRichTextLineLeading(FX_FLOAT fLineLeading)
+{
+ CPVT_SecProps SecProps;
+ SecProps.fLineLeading = fLineLeading;
+ return SetRichTextProps(EP_LINELEADING,&SecProps,NULL);
+}
+
+FX_BOOL CFX_Edit::SetRichTextLineIndent(FX_FLOAT fLineIndent)
+{
+ CPVT_SecProps SecProps;
+ SecProps.fLineIndent = fLineIndent;
+ return SetRichTextProps(EP_LINEINDENT,&SecProps,NULL);
+}
+
+FX_BOOL CFX_Edit::SetRichTextAlignment(FX_INT32 nAlignment)
+{
+ CPVT_SecProps SecProps;
+ SecProps.nAlignment = nAlignment;
+ return SetRichTextProps(EP_ALIGNMENT,&SecProps,NULL);
+}
+
+FX_BOOL CFX_Edit::SetRichTextProps(EDIT_PROPS_E eProps, const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordProps)
+{
+ FX_BOOL bSet = FALSE;
+ FX_BOOL bSet1,bSet2;
+ if (m_pVT->IsValid() && m_pVT->IsRichText())
+ {
+ if (IPDF_VariableText_Iterator * pIterator = m_pVT->GetIterator())
+ {
+ CPVT_WordRange wrTemp = m_SelState.ConvertToWordRange();
+
+ m_pVT->UpdateWordPlace(wrTemp.BeginPos);
+ m_pVT->UpdateWordPlace(wrTemp.EndPos);
+ pIterator->SetAt(wrTemp.BeginPos);
+
+ BeginGroupUndo(L"");;
+
+ bSet = SetSecProps(eProps,wrTemp.BeginPos,pSecProps,pWordProps,wrTemp,TRUE);
+
+ while (pIterator->NextWord())
+ {
+ CPVT_WordPlace place = pIterator->GetAt();
+ if (place.WordCmp(wrTemp.EndPos) > 0) break;
+ bSet1 = SetSecProps(eProps,place,pSecProps,pWordProps,wrTemp,TRUE);
+ bSet2 = SetWordProps(eProps,place,pWordProps,wrTemp,TRUE);
+
+ if (!bSet)
+ bSet = (bSet1 || bSet2);
+ }
+
+ EndGroupUndo();
+
+ if (bSet)
+ {
+ PaintSetProps(eProps,wrTemp);
+ }
+ }
+ }
+
+ return bSet;
+}
+
+void CFX_Edit::PaintSetProps(EDIT_PROPS_E eProps, const CPVT_WordRange & wr)
+{
+ switch(eProps)
+ {
+ case EP_LINELEADING:
+ case EP_LINEINDENT:
+ case EP_ALIGNMENT:
+ RearrangePart(wr);
+ ScrollToCaret();
+ Refresh(RP_ANALYSE);
+ SetCaretOrigin();
+ SetCaretInfo();
+ break;
+ case EP_WORDCOLOR:
+ case EP_UNDERLINE:
+ case EP_CROSSOUT:
+ Refresh(RP_OPTIONAL,&wr);
+ break;
+ case EP_FONTINDEX:
+ case EP_FONTSIZE:
+ case EP_SCRIPTTYPE:
+ case EP_CHARSPACE:
+ case EP_HORZSCALE:
+ case EP_BOLD:
+ case EP_ITALIC:
+ RearrangePart(wr);
+ ScrollToCaret();
+
+ CPVT_WordRange wrRefresh(m_pVT->GetSectionBeginPlace(wr.BeginPos),
+ m_pVT->GetSectionEndPlace(wr.EndPos));
+ Refresh(RP_ANALYSE,&wrRefresh);
+
+ SetCaretOrigin();
+ SetCaretInfo();
+ break;
+ }
+}
+
+FX_BOOL CFX_Edit::SetSecProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place,
+ const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordProps,
+ const CPVT_WordRange & wr, FX_BOOL bAddUndo)
+{
+ if (m_pVT->IsValid() && m_pVT->IsRichText())
+ {
+ if (IPDF_VariableText_Iterator * pIterator = m_pVT->GetIterator())
+ {
+ FX_BOOL bSet = FALSE;
+ CPVT_Section secinfo;
+ CPVT_Section OldSecinfo;
+
+ CPVT_WordPlace oldplace = pIterator->GetAt();
+
+ if (eProps == EP_LINELEADING || eProps == EP_LINEINDENT || eProps == EP_ALIGNMENT)
+ {
+ if (pSecProps)
+ {
+ pIterator->SetAt(place);
+ if (pIterator->GetSection(secinfo))
+ {
+ if (bAddUndo) OldSecinfo = secinfo;
+
+ switch(eProps)
+ {
+ case EP_LINELEADING:
+ if (!FX_EDIT_IsFloatEqual(secinfo.SecProps.fLineLeading,pSecProps->fLineLeading))
+ {
+ secinfo.SecProps.fLineLeading = pSecProps->fLineLeading;
+ bSet = TRUE;
+ }
+ break;
+ case EP_LINEINDENT:
+ if (!FX_EDIT_IsFloatEqual(secinfo.SecProps.fLineIndent,pSecProps->fLineIndent))
+ {
+ secinfo.SecProps.fLineIndent = pSecProps->fLineIndent;
+ bSet = TRUE;
+ }
+ break;
+ case EP_ALIGNMENT:
+ if (secinfo.SecProps.nAlignment != pSecProps->nAlignment)
+ {
+ secinfo.SecProps.nAlignment = pSecProps->nAlignment;
+ bSet = TRUE;
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ }
+ else
+ {
+ if (pWordProps && place == m_pVT->GetSectionBeginPlace(place))
+ {
+ pIterator->SetAt(place);
+ if (pIterator->GetSection(secinfo))
+ {
+ if (bAddUndo) OldSecinfo = secinfo;
+
+ switch(eProps)
+ {
+ case EP_FONTINDEX:
+ if (secinfo.WordProps.nFontIndex != pWordProps->nFontIndex)
+ {
+ secinfo.WordProps.nFontIndex = pWordProps->nFontIndex;
+ bSet = TRUE;
+ }
+ break;
+ case EP_FONTSIZE:
+ if (!FX_EDIT_IsFloatEqual(secinfo.WordProps.fFontSize,pWordProps->fFontSize))
+ {
+ secinfo.WordProps.fFontSize = pWordProps->fFontSize;
+ bSet = TRUE;
+ }
+ break;
+ case EP_WORDCOLOR:
+ if (secinfo.WordProps.dwWordColor != pWordProps->dwWordColor)
+ {
+ secinfo.WordProps.dwWordColor = pWordProps->dwWordColor;
+ bSet = TRUE;
+ }
+ break;
+ case EP_SCRIPTTYPE:
+ if (secinfo.WordProps.nScriptType != pWordProps->nScriptType)
+ {
+ secinfo.WordProps.nScriptType = pWordProps->nScriptType;
+ bSet = TRUE;
+ }
+ break;
+ case EP_CHARSPACE:
+ if (!FX_EDIT_IsFloatEqual(secinfo.WordProps.fCharSpace,pWordProps->fCharSpace))
+ {
+ secinfo.WordProps.fCharSpace = pWordProps->fCharSpace;
+ bSet = TRUE;
+ }
+ break;
+ case EP_HORZSCALE:
+ if (secinfo.WordProps.nHorzScale != pWordProps->nHorzScale)
+ {
+ secinfo.WordProps.nHorzScale = pWordProps->nHorzScale;
+ bSet = TRUE;
+ }
+ break;
+ case EP_UNDERLINE:
+ if (pWordProps->nWordStyle & PVTWORD_STYLE_UNDERLINE)
+ {
+ if ((secinfo.WordProps.nWordStyle & PVTWORD_STYLE_UNDERLINE) == 0)
+ {
+ secinfo.WordProps.nWordStyle |= PVTWORD_STYLE_UNDERLINE;
+ bSet = TRUE;
+ }
+ }
+ else
+ {
+ if ((secinfo.WordProps.nWordStyle & PVTWORD_STYLE_UNDERLINE) != 0)
+ {
+ secinfo.WordProps.nWordStyle &= ~PVTWORD_STYLE_UNDERLINE;
+ bSet = TRUE;
+ }
+ }
+ break;
+ case EP_CROSSOUT:
+ if (pWordProps->nWordStyle & PVTWORD_STYLE_CROSSOUT)
+ {
+ if ((secinfo.WordProps.nWordStyle & PVTWORD_STYLE_CROSSOUT) == 0)
+ {
+ secinfo.WordProps.nWordStyle |= PVTWORD_STYLE_CROSSOUT;
+ bSet = TRUE;
+ }
+ }
+ else
+ {
+ if ((secinfo.WordProps.nWordStyle & PVTWORD_STYLE_CROSSOUT) != 0)
+ {
+ secinfo.WordProps.nWordStyle &= ~PVTWORD_STYLE_CROSSOUT;
+ bSet = TRUE;
+ }
+ }
+ break;
+ case EP_BOLD:
+ if (pWordProps->nWordStyle & PVTWORD_STYLE_BOLD)
+ {
+ if ((secinfo.WordProps.nWordStyle & PVTWORD_STYLE_BOLD) == 0)
+ {
+ secinfo.WordProps.nWordStyle |= PVTWORD_STYLE_BOLD;
+ bSet = TRUE;
+ }
+ }
+ else
+ {
+ if ((secinfo.WordProps.nWordStyle & PVTWORD_STYLE_BOLD) != 0)
+ {
+ secinfo.WordProps.nWordStyle &= ~PVTWORD_STYLE_BOLD;
+ bSet = TRUE;
+ }
+ }
+ break;
+ case EP_ITALIC:
+ if (pWordProps->nWordStyle & PVTWORD_STYLE_ITALIC)
+ {
+ if ((secinfo.WordProps.nWordStyle & PVTWORD_STYLE_ITALIC) == 0)
+ {
+ secinfo.WordProps.nWordStyle |= PVTWORD_STYLE_ITALIC;
+ bSet = TRUE;
+ }
+ }
+ else
+ {
+ if ((secinfo.WordProps.nWordStyle & PVTWORD_STYLE_ITALIC) != 0)
+ {
+ secinfo.WordProps.nWordStyle &= ~PVTWORD_STYLE_ITALIC;
+ bSet = TRUE;
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ }
+
+ if (bSet)
+ {
+ pIterator->SetSection(secinfo);
+
+ if (bAddUndo && m_bEnableUndo)
+ {
+ AddEditUndoItem(new CFXEU_SetSecProps
+ (this,place,eProps,OldSecinfo.SecProps,OldSecinfo.WordProps,secinfo.SecProps,secinfo.WordProps,wr));
+ }
+ }
+
+ pIterator->SetAt(oldplace);
+
+ return bSet;
+ }
+ }
+
+ return FALSE;
+}
+
+FX_BOOL CFX_Edit::SetWordProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place,
+ const CPVT_WordProps * pWordProps, const CPVT_WordRange & wr, FX_BOOL bAddUndo)
+{
+ if (m_pVT->IsValid() && m_pVT->IsRichText())
+ {
+ if (IPDF_VariableText_Iterator * pIterator = m_pVT->GetIterator())
+ {
+ FX_BOOL bSet = FALSE;
+ CPVT_Word wordinfo;
+ CPVT_Word OldWordinfo;
+
+ CPVT_WordPlace oldplace = pIterator->GetAt();
+
+ if (pWordProps)
+ {
+ pIterator->SetAt(place);
+ if (pIterator->GetWord(wordinfo))
+ {
+ if (bAddUndo) OldWordinfo = wordinfo;
+
+ switch(eProps)
+ {
+ case EP_FONTINDEX:
+ if (wordinfo.WordProps.nFontIndex != pWordProps->nFontIndex)
+ {
+ if (IFX_Edit_FontMap* pFontMap = this->GetFontMap())
+ {
+ wordinfo.WordProps.nFontIndex = pFontMap->GetWordFontIndex(wordinfo.Word,wordinfo.nCharset,pWordProps->nFontIndex);
+ }
+ bSet = TRUE;
+ }
+ break;
+ case EP_FONTSIZE:
+ if (!FX_EDIT_IsFloatEqual(wordinfo.WordProps.fFontSize,pWordProps->fFontSize))
+ {
+ wordinfo.WordProps.fFontSize = pWordProps->fFontSize;
+ bSet = TRUE;
+ }
+ break;
+ case EP_WORDCOLOR:
+ if (wordinfo.WordProps.dwWordColor != pWordProps->dwWordColor)
+ {
+ wordinfo.WordProps.dwWordColor = pWordProps->dwWordColor;
+ bSet = TRUE;
+ }
+ break;
+ case EP_SCRIPTTYPE:
+ if (wordinfo.WordProps.nScriptType != pWordProps->nScriptType)
+ {
+ wordinfo.WordProps.nScriptType = pWordProps->nScriptType;
+ bSet = TRUE;
+ }
+ break;
+ case EP_CHARSPACE:
+ if (!FX_EDIT_IsFloatEqual(wordinfo.WordProps.fCharSpace,pWordProps->fCharSpace))
+ {
+ wordinfo.WordProps.fCharSpace = pWordProps->fCharSpace;
+ bSet = TRUE;
+ }
+ break;
+ case EP_HORZSCALE:
+ if (wordinfo.WordProps.nHorzScale != pWordProps->nHorzScale)
+ {
+ wordinfo.WordProps.nHorzScale = pWordProps->nHorzScale;
+ bSet = TRUE;
+ }
+ break;
+ case EP_UNDERLINE:
+ if (pWordProps->nWordStyle & PVTWORD_STYLE_UNDERLINE)
+ {
+ if ((wordinfo.WordProps.nWordStyle & PVTWORD_STYLE_UNDERLINE) == 0)
+ {
+ wordinfo.WordProps.nWordStyle |= PVTWORD_STYLE_UNDERLINE;
+ bSet = TRUE;
+ }
+ }
+ else
+ {
+ if ((wordinfo.WordProps.nWordStyle & PVTWORD_STYLE_UNDERLINE) != 0)
+ {
+ wordinfo.WordProps.nWordStyle &= ~PVTWORD_STYLE_UNDERLINE;
+ bSet = TRUE;
+ }
+ }
+ break;
+ case EP_CROSSOUT:
+ if (pWordProps->nWordStyle & PVTWORD_STYLE_CROSSOUT)
+ {
+ if ((wordinfo.WordProps.nWordStyle & PVTWORD_STYLE_CROSSOUT) == 0)
+ {
+ wordinfo.WordProps.nWordStyle |= PVTWORD_STYLE_CROSSOUT;
+ bSet = TRUE;
+ }
+ }
+ else
+ {
+ if ((wordinfo.WordProps.nWordStyle & PVTWORD_STYLE_CROSSOUT) != 0)
+ {
+ wordinfo.WordProps.nWordStyle &= ~PVTWORD_STYLE_CROSSOUT;
+ bSet = TRUE;
+ }
+ }
+ break;
+ case EP_BOLD:
+ if (pWordProps->nWordStyle & PVTWORD_STYLE_BOLD)
+ {
+ if ((wordinfo.WordProps.nWordStyle & PVTWORD_STYLE_BOLD) == 0)
+ {
+ wordinfo.WordProps.nWordStyle |= PVTWORD_STYLE_BOLD;
+ bSet = TRUE;
+ }
+ }
+ else
+ {
+ if ((wordinfo.WordProps.nWordStyle & PVTWORD_STYLE_BOLD) != 0)
+ {
+ wordinfo.WordProps.nWordStyle &= ~PVTWORD_STYLE_BOLD;
+ bSet = TRUE;
+ }
+ }
+ break;
+ case EP_ITALIC:
+ if (pWordProps->nWordStyle & PVTWORD_STYLE_ITALIC)
+ {
+ if ((wordinfo.WordProps.nWordStyle & PVTWORD_STYLE_ITALIC) == 0)
+ {
+ wordinfo.WordProps.nWordStyle |= PVTWORD_STYLE_ITALIC;
+ bSet = TRUE;
+ }
+ }
+ else
+ {
+ if ((wordinfo.WordProps.nWordStyle & PVTWORD_STYLE_ITALIC) != 0)
+ {
+ wordinfo.WordProps.nWordStyle &= ~PVTWORD_STYLE_ITALIC;
+ bSet = TRUE;
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ }
+
+ if (bSet)
+ {
+ pIterator->SetWord(wordinfo);
+
+ if (bAddUndo && m_bEnableUndo)
+ {
+ AddEditUndoItem(new CFXEU_SetWordProps
+ (this,place,eProps,OldWordinfo.WordProps,wordinfo.WordProps,wr));
+ }
+ }
+
+ pIterator->SetAt(oldplace);
+ return bSet;
+ }
+ }
+
+ return FALSE;
+}
+
+void CFX_Edit::SetText(FX_LPCWSTR text,FX_INT32 charset /*= DEFAULT_CHARSET*/,
+ const CPVT_SecProps * pSecProps /*= NULL*/,const CPVT_WordProps * pWordProps /*= NULL*/)
+{
+ SetText(text,charset,pSecProps,pWordProps,TRUE,TRUE);
+}
+
+FX_BOOL CFX_Edit::InsertWord(FX_WORD word, FX_INT32 charset /*= DEFAULT_CHARSET*/, const CPVT_WordProps * pWordProps /*= NULL*/)
+{
+ return InsertWord(word,charset,pWordProps,TRUE,TRUE);
+}
+
+FX_BOOL CFX_Edit::InsertReturn(const CPVT_SecProps * pSecProps /*= NULL*/,const CPVT_WordProps * pWordProps /*= NULL*/)
+{
+ return InsertReturn(pSecProps,pWordProps,TRUE,TRUE);
+}
+
+FX_BOOL CFX_Edit::Backspace()
+{
+ return Backspace(TRUE,TRUE);
+}
+
+FX_BOOL CFX_Edit::Delete()
+{
+ return Delete(TRUE,TRUE);
+}
+
+FX_BOOL CFX_Edit::Clear()
+{
+ return Clear(TRUE,TRUE);
+}
+
+FX_BOOL CFX_Edit::InsertText(FX_LPCWSTR text, FX_INT32 charset /*= DEFAULT_CHARSET*/,
+ const CPVT_SecProps * pSecProps /*= NULL*/,const CPVT_WordProps * pWordProps /*= NULL*/)
+{
+ return InsertText(text,charset,pSecProps,pWordProps,TRUE,TRUE);
+}
+
+FX_FLOAT CFX_Edit::GetFontSize() const
+{
+ return m_pVT->GetFontSize();
+}
+
+FX_WORD CFX_Edit::GetPasswordChar() const
+{
+ return m_pVT->GetPasswordChar();
+}
+
+FX_INT32 CFX_Edit::GetCharArray() const
+{
+ return m_pVT->GetCharArray();
+}
+
+CPDF_Rect CFX_Edit::GetPlateRect() const
+{
+ return m_pVT->GetPlateRect();
+}
+
+CPDF_Rect CFX_Edit::GetContentRect() const
+{
+ return VTToEdit(m_pVT->GetContentRect());
+}
+
+FX_INT32 CFX_Edit::GetHorzScale() const
+{
+ return m_pVT->GetHorzScale();
+}
+
+FX_FLOAT CFX_Edit::GetCharSpace() const
+{
+ return m_pVT->GetCharSpace();
+}
+
+// inner methods
+
+CPVT_WordRange CFX_Edit::GetWholeWordRange() const
+{
+ if (m_pVT->IsValid())
+ return CPVT_WordRange(m_pVT->GetBeginWordPlace(),m_pVT->GetEndWordPlace());
+
+ return CPVT_WordRange();
+}
+
+CPVT_WordRange CFX_Edit::GetVisibleWordRange() const
+{
+ if (m_bEnableOverflow) return GetWholeWordRange();
+
+ if (m_pVT->IsValid())
+ {
+ CPDF_Rect rcPlate = m_pVT->GetPlateRect();
+
+ CPVT_WordPlace place1 = m_pVT->SearchWordPlace(EditToVT(CPDF_Point(rcPlate.left,rcPlate.top)));
+ CPVT_WordPlace place2 = m_pVT->SearchWordPlace(EditToVT(CPDF_Point(rcPlate.right,rcPlate.bottom)));
+
+ return CPVT_WordRange(place1,place2);
+ }
+
+ return CPVT_WordRange();
+}
+
+CPVT_WordPlace CFX_Edit::SearchWordPlace(const CPDF_Point& point) const
+{
+ if (m_pVT->IsValid())
+ {
+ return m_pVT->SearchWordPlace(EditToVT(point));
+ }
+
+ return CPVT_WordPlace();
+}
+
+void CFX_Edit::Paint()
+{
+ if (m_pVT->IsValid())
+ {
+ RearrangeAll();
+ ScrollToCaret();
+ Refresh(RP_NOANALYSE);
+ SetCaretOrigin();
+ SetCaretInfo();
+ }
+}
+
+void CFX_Edit::RearrangeAll()
+{
+ if (m_pVT->IsValid())
+ {
+ m_pVT->UpdateWordPlace(m_wpCaret);
+ m_pVT->RearrangeAll();
+ m_pVT->UpdateWordPlace(m_wpCaret);
+ SetScrollInfo();
+ SetContentChanged();
+ }
+}
+
+void CFX_Edit::RearrangePart(const CPVT_WordRange & range)
+{
+ if (m_pVT->IsValid())
+ {
+ m_pVT->UpdateWordPlace(m_wpCaret);
+ m_pVT->RearrangePart(range);
+ m_pVT->UpdateWordPlace(m_wpCaret);
+ SetScrollInfo();
+ SetContentChanged();
+ }
+}
+
+void CFX_Edit::SetContentChanged()
+{
+ if (m_bNotify && m_pNotify)
+ {
+ CPDF_Rect rcContent = m_pVT->GetContentRect();
+ if (rcContent.Width() != m_rcOldContent.Width() ||
+ rcContent.Height() != m_rcOldContent.Height())
+ {
+ if (!m_bNotifyFlag)
+ {
+ m_bNotifyFlag = TRUE;
+ m_pNotify->IOnContentChange(rcContent);
+ m_bNotifyFlag = FALSE;
+ }
+ m_rcOldContent = rcContent;
+ }
+ }
+}
+
+void CFX_Edit::SelectAll()
+{
+ if (m_pVT->IsValid())
+ {
+ m_SelState = GetWholeWordRange();
+ SetCaret(m_SelState.EndPos);
+
+ ScrollToCaret();
+ CPVT_WordRange wrVisible = GetVisibleWordRange();
+ Refresh(RP_OPTIONAL,&wrVisible);
+ SetCaretInfo();
+ }
+}
+
+void CFX_Edit::SelectNone()
+{
+ if (m_pVT->IsValid())
+ {
+ if (m_SelState.IsExist())
+ {
+ CPVT_WordRange wrTemp = m_SelState.ConvertToWordRange();
+ m_SelState.Default();
+ Refresh(RP_OPTIONAL,&wrTemp);
+ }
+ }
+}
+
+FX_BOOL CFX_Edit::IsSelected() const
+{
+ return m_SelState.IsExist();
+}
+
+CPDF_Point CFX_Edit::VTToEdit(const CPDF_Point & point) const
+{
+ CPDF_Rect rcContent = m_pVT->GetContentRect();
+ CPDF_Rect rcPlate = m_pVT->GetPlateRect();
+
+ FX_FLOAT fPadding = 0.0f;
+
+ switch (m_nAlignment)
+ {
+ case 0:
+ fPadding = 0.0f;
+ break;
+ case 1:
+ fPadding = (rcPlate.Height() - rcContent.Height()) * 0.5f;
+ break;
+ case 2:
+ fPadding = rcPlate.Height() - rcContent.Height();
+ break;
+ }
+
+ return CPDF_Point(point.x - (m_ptScrollPos.x - rcPlate.left),
+ point.y - (m_ptScrollPos.y + fPadding - rcPlate.top));
+}
+
+CPDF_Point CFX_Edit::EditToVT(const CPDF_Point & point) const
+{
+ CPDF_Rect rcContent = m_pVT->GetContentRect();
+ CPDF_Rect rcPlate = m_pVT->GetPlateRect();
+
+ FX_FLOAT fPadding = 0.0f;
+
+ switch (m_nAlignment)
+ {
+ case 0:
+ fPadding = 0.0f;
+ break;
+ case 1:
+ fPadding = (rcPlate.Height() - rcContent.Height()) * 0.5f;
+ break;
+ case 2:
+ fPadding = rcPlate.Height() - rcContent.Height();
+ break;
+ }
+
+ return CPDF_Point(point.x + (m_ptScrollPos.x - rcPlate.left),
+ point.y + (m_ptScrollPos.y + fPadding - rcPlate.top));
+}
+
+CPDF_Rect CFX_Edit::VTToEdit(const CPDF_Rect & rect) const
+{
+ CPDF_Point ptLeftBottom = VTToEdit(CPDF_Point(rect.left,rect.bottom));
+ CPDF_Point ptRightTop = VTToEdit(CPDF_Point(rect.right,rect.top));
+
+ return CPDF_Rect(ptLeftBottom.x,ptLeftBottom.y,ptRightTop.x,ptRightTop.y);
+}
+
+CPDF_Rect CFX_Edit::EditToVT(const CPDF_Rect & rect) const
+{
+ CPDF_Point ptLeftBottom = EditToVT(CPDF_Point(rect.left,rect.bottom));
+ CPDF_Point ptRightTop = EditToVT(CPDF_Point(rect.right,rect.top));
+
+ return CPDF_Rect(ptLeftBottom.x,ptLeftBottom.y,ptRightTop.x,ptRightTop.y);
+}
+
+void CFX_Edit::SetScrollInfo()
+{
+ if (m_bNotify && m_pNotify)
+ {
+ CPDF_Rect rcPlate = m_pVT->GetPlateRect();
+ CPDF_Rect rcContent = m_pVT->GetContentRect();
+
+ if (!m_bNotifyFlag)
+ {
+ m_bNotifyFlag = TRUE;
+ m_pNotify->IOnSetScrollInfoX(rcPlate.left, rcPlate.right,
+ rcContent.left, rcContent.right, rcPlate.Width() / 3, rcPlate.Width());
+
+ m_pNotify->IOnSetScrollInfoY(rcPlate.bottom, rcPlate.top,
+ rcContent.bottom, rcContent.top, rcPlate.Height() / 3, rcPlate.Height());
+ m_bNotifyFlag = FALSE;
+ }
+ }
+}
+
+void CFX_Edit::SetScrollPosX(FX_FLOAT fx)
+{
+ if (!m_bEnableScroll) return;
+
+ if (m_pVT->IsValid())
+ {
+ if (!FX_EDIT_IsFloatEqual(m_ptScrollPos.x,fx))
+ {
+ m_ptScrollPos.x = fx;
+ Refresh(RP_NOANALYSE);
+
+ if (m_bNotify && m_pNotify)
+ {
+ if (!m_bNotifyFlag)
+ {
+ m_bNotifyFlag = TRUE;
+ m_pNotify->IOnSetScrollPosX(fx);
+ m_bNotifyFlag = FALSE;
+ }
+ }
+ }
+ }
+}
+
+void CFX_Edit::SetScrollPosY(FX_FLOAT fy)
+{
+ if (!m_bEnableScroll) return;
+
+ if (m_pVT->IsValid())
+ {
+ if (!FX_EDIT_IsFloatEqual(m_ptScrollPos.y,fy))
+ {
+ m_ptScrollPos.y = fy;
+ Refresh(RP_NOANALYSE);
+
+ if (m_bNotify && m_pNotify)
+ {
+ if (!m_bNotifyFlag)
+ {
+ m_bNotifyFlag = TRUE;
+ m_pNotify->IOnSetScrollPosY(fy);
+ m_bNotifyFlag = FALSE;
+ }
+ }
+ }
+ }
+}
+
+void CFX_Edit::SetScrollPos(const CPDF_Point & point)
+{
+ SetScrollPosX(point.x);
+ SetScrollPosY(point.y);
+ SetScrollLimit();
+ SetCaretInfo();
+}
+
+CPDF_Point CFX_Edit::GetScrollPos() const
+{
+ return m_ptScrollPos;
+}
+
+void CFX_Edit::SetScrollLimit()
+{
+ if (m_pVT->IsValid())
+ {
+ CPDF_Rect rcContent = m_pVT->GetContentRect();
+ CPDF_Rect rcPlate = m_pVT->GetPlateRect();
+
+ if (rcPlate.Width() > rcContent.Width())
+ {
+ SetScrollPosX(rcPlate.left);
+ }
+ else
+ {
+ if (FX_EDIT_IsFloatSmaller(m_ptScrollPos.x, rcContent.left))
+ {
+ SetScrollPosX(rcContent.left);
+ }
+ else if (FX_EDIT_IsFloatBigger(m_ptScrollPos.x, rcContent.right - rcPlate.Width()))
+ {
+ SetScrollPosX(rcContent.right - rcPlate.Width());
+ }
+ }
+
+ if (rcPlate.Height() > rcContent.Height())
+ {
+ SetScrollPosY(rcPlate.top);
+ }
+ else
+ {
+ if (FX_EDIT_IsFloatSmaller(m_ptScrollPos.y, rcContent.bottom + rcPlate.Height()))
+ {
+ SetScrollPosY(rcContent.bottom + rcPlate.Height());
+ }
+ else if (FX_EDIT_IsFloatBigger(m_ptScrollPos.y, rcContent.top))
+ {
+ SetScrollPosY(rcContent.top);
+ }
+ }
+ }
+}
+
+void CFX_Edit::ScrollToCaret()
+{
+ SetScrollLimit();
+
+ if (m_pVT->IsValid())
+ {
+ CPDF_Point ptHead(0,0);
+ CPDF_Point ptFoot(0,0);
+
+ if (IPDF_VariableText_Iterator * pIterator = m_pVT->GetIterator())
+ {
+ pIterator->SetAt(m_wpCaret);
+
+ CPVT_Word word;
+ CPVT_Line line;
+ if (pIterator->GetWord(word))
+ {
+ ptHead.x = word.ptWord.x + word.fWidth;
+ ptHead.y = word.ptWord.y + word.fAscent;
+ ptFoot.x = word.ptWord.x + word.fWidth;
+ ptFoot.y = word.ptWord.y + word.fDescent;
+ }
+ else if (pIterator->GetLine(line))
+ {
+ ptHead.x = line.ptLine.x;
+ ptHead.y = line.ptLine.y + line.fLineAscent;
+ ptFoot.x = line.ptLine.x;
+ ptFoot.y = line.ptLine.y + line.fLineDescent;
+ }
+ }
+
+ CPDF_Point ptHeadEdit = VTToEdit(ptHead);
+ CPDF_Point ptFootEdit = VTToEdit(ptFoot);
+
+ CPDF_Rect rcPlate = m_pVT->GetPlateRect();
+
+ if (!FX_EDIT_IsFloatEqual(rcPlate.left,rcPlate.right))
+ {
+ if (FX_EDIT_IsFloatSmaller(ptHeadEdit.x, rcPlate.left) ||
+ FX_EDIT_IsFloatEqual(ptHeadEdit.x, rcPlate.left))
+ {
+ SetScrollPosX(ptHead.x);
+ }
+ else if (FX_EDIT_IsFloatBigger(ptHeadEdit.x, rcPlate.right))
+ {
+ SetScrollPosX(ptHead.x - rcPlate.Width());
+ }
+ }
+
+ if (!FX_EDIT_IsFloatEqual(rcPlate.top,rcPlate.bottom))
+ {
+ if (FX_EDIT_IsFloatSmaller(ptFootEdit.y, rcPlate.bottom) ||
+ FX_EDIT_IsFloatEqual(ptFootEdit.y, rcPlate.bottom))
+ {
+ if (FX_EDIT_IsFloatSmaller(ptHeadEdit.y, rcPlate.top))
+ {
+ SetScrollPosY(ptFoot.y + rcPlate.Height());
+ }
+ }
+ else if (FX_EDIT_IsFloatBigger(ptHeadEdit.y, rcPlate.top))
+ {
+ if (FX_EDIT_IsFloatBigger(ptFootEdit.y, rcPlate.bottom))
+ {
+ SetScrollPosY(ptHead.y);
+ }
+ }
+ }
+ }
+}
+
+void CFX_Edit::Refresh(REFRESH_PLAN_E ePlan,const CPVT_WordRange * pRange1,const CPVT_WordRange * pRange2)
+{
+ if (m_bEnableRefresh && m_pVT->IsValid())
+ {
+ m_Refresh.BeginRefresh();
+ RefreshPushLineRects(GetVisibleWordRange());
+
+// if (!FX_EDIT_IsFloatEqual(m_ptRefreshScrollPos.x,m_ptScrollPos.x) ||
+// !FX_EDIT_IsFloatEqual(m_ptRefreshScrollPos.y,m_ptScrollPos.y))
+// {
+ m_Refresh.NoAnalyse();
+ m_ptRefreshScrollPos = m_ptScrollPos;
+// }
+// else
+// {
+// switch (ePlan)
+// {
+// case RP_ANALYSE:
+// m_Refresh.Analyse(m_pVT->GetAlignment());
+//
+// if (pRange1) RefreshPushRandomRects(*pRange1);
+// if (pRange2) RefreshPushRandomRects(*pRange2);
+// break;
+// case RP_NOANALYSE:
+// m_Refresh.NoAnalyse();
+// break;
+// case RP_OPTIONAL:
+// if (pRange1) RefreshPushRandomRects(*pRange1);
+// if (pRange2) RefreshPushRandomRects(*pRange2);
+// break;
+// }
+// }
+
+ if (m_bNotify && m_pNotify)
+ {
+ if (!m_bNotifyFlag)
+ {
+ m_bNotifyFlag = TRUE;
+ if (const CFX_Edit_RectArray * pRects = m_Refresh.GetRefreshRects())
+ {
+ for (FX_INT32 i = 0, sz = pRects->GetSize(); i < sz; i++)
+ m_pNotify->IOnInvalidateRect(pRects->GetAt(i));
+ }
+ m_bNotifyFlag = FALSE;
+ }
+ }
+
+ m_Refresh.EndRefresh();
+ }
+}
+
+void CFX_Edit::RefreshPushLineRects(const CPVT_WordRange & wr)
+{
+ if (m_pVT->IsValid())
+ {
+ if (IPDF_VariableText_Iterator * pIterator = m_pVT->GetIterator())
+ {
+ CPVT_WordPlace wpBegin = wr.BeginPos;
+ m_pVT->UpdateWordPlace(wpBegin);
+ CPVT_WordPlace wpEnd = wr.EndPos;
+ m_pVT->UpdateWordPlace(wpEnd);
+ pIterator->SetAt(wpBegin);
+
+ CPVT_Line lineinfo;
+ do
+ {
+ if (!pIterator->GetLine(lineinfo))break;
+ if (lineinfo.lineplace.LineCmp(wpEnd) > 0)break;
+
+ CPDF_Rect rcLine(lineinfo.ptLine.x,
+ lineinfo.ptLine.y + lineinfo.fLineDescent,
+ lineinfo.ptLine.x + lineinfo.fLineWidth,
+ lineinfo.ptLine.y + lineinfo.fLineAscent);
+
+ m_Refresh.Push(CPVT_WordRange(lineinfo.lineplace,lineinfo.lineEnd),VTToEdit(rcLine));
+
+ }while (pIterator->NextLine());
+ }
+ }
+}
+
+void CFX_Edit::RefreshPushRandomRects(const CPVT_WordRange & wr)
+{
+ if (m_pVT->IsValid())
+ {
+ if (IPDF_VariableText_Iterator * pIterator = m_pVT->GetIterator())
+ {
+ CPVT_WordRange wrTemp = wr;
+
+ m_pVT->UpdateWordPlace(wrTemp.BeginPos);
+ m_pVT->UpdateWordPlace(wrTemp.EndPos);
+ pIterator->SetAt(wrTemp.BeginPos);
+
+ CPVT_Word wordinfo;
+ CPVT_Line lineinfo;
+ CPVT_WordPlace place;
+
+ while (pIterator->NextWord())
+ {
+ place = pIterator->GetAt();
+ if (place.WordCmp(wrTemp.EndPos) > 0) break;
+
+ pIterator->GetWord(wordinfo);
+ pIterator->GetLine(lineinfo);
+
+ if (place.LineCmp(wrTemp.BeginPos) == 0 || place.LineCmp(wrTemp.EndPos) == 0)
+ {
+ CPDF_Rect rcWord(wordinfo.ptWord.x,
+ lineinfo.ptLine.y + lineinfo.fLineDescent,
+ wordinfo.ptWord.x + wordinfo.fWidth,
+ lineinfo.ptLine.y + lineinfo.fLineAscent);
+
+ m_Refresh.AddRefresh(VTToEdit(rcWord));
+ }
+ else
+ {
+ CPDF_Rect rcLine(lineinfo.ptLine.x,
+ lineinfo.ptLine.y + lineinfo.fLineDescent,
+ lineinfo.ptLine.x + lineinfo.fLineWidth,
+ lineinfo.ptLine.y + lineinfo.fLineAscent);
+
+ m_Refresh.AddRefresh(VTToEdit(rcLine));
+
+ pIterator->NextLine();
+ }
+ }
+ }
+ }
+}
+
+void CFX_Edit::RefreshWordRange(const CPVT_WordRange& wr)
+{
+ if (IPDF_VariableText_Iterator * pIterator = m_pVT->GetIterator())
+ {
+ CPVT_WordRange wrTemp = wr;
+
+ m_pVT->UpdateWordPlace(wrTemp.BeginPos);
+ m_pVT->UpdateWordPlace(wrTemp.EndPos);
+ pIterator->SetAt(wrTemp.BeginPos);
+
+ CPVT_Word wordinfo;
+ CPVT_Line lineinfo;
+ CPVT_WordPlace place;
+
+ while (pIterator->NextWord())
+ {
+ place = pIterator->GetAt();
+ if (place.WordCmp(wrTemp.EndPos) > 0) break;
+
+ pIterator->GetWord(wordinfo);
+ pIterator->GetLine(lineinfo);
+
+ if (place.LineCmp(wrTemp.BeginPos) == 0 || place.LineCmp(wrTemp.EndPos) == 0)
+ {
+ CPDF_Rect rcWord(wordinfo.ptWord.x,
+ lineinfo.ptLine.y + lineinfo.fLineDescent,
+ wordinfo.ptWord.x + wordinfo.fWidth,
+ lineinfo.ptLine.y + lineinfo.fLineAscent);
+
+ if (m_bNotify && m_pNotify)
+ {
+ if (!m_bNotifyFlag)
+ {
+ m_bNotifyFlag = TRUE;
+ CPDF_Rect rcRefresh = VTToEdit(rcWord);
+ m_pNotify->IOnInvalidateRect(&rcRefresh);
+ m_bNotifyFlag = FALSE;
+ }
+ }
+ }
+ else
+ {
+ CPDF_Rect rcLine(lineinfo.ptLine.x,
+ lineinfo.ptLine.y + lineinfo.fLineDescent,
+ lineinfo.ptLine.x + lineinfo.fLineWidth,
+ lineinfo.ptLine.y + lineinfo.fLineAscent);
+
+ if (m_bNotify && m_pNotify)
+ {
+ if (!m_bNotifyFlag)
+ {
+ m_bNotifyFlag = TRUE;
+ CPDF_Rect rcRefresh = VTToEdit(rcLine);
+ m_pNotify->IOnInvalidateRect(&rcRefresh);
+ m_bNotifyFlag = FALSE;
+ }
+ }
+
+ pIterator->NextLine();
+ }
+ }
+ }
+}
+
+void CFX_Edit::SetCaret(const CPVT_WordPlace & place)
+{
+ m_wpOldCaret = m_wpCaret;
+ m_wpCaret = place;
+}
+
+void CFX_Edit::SetCaretInfo()
+{
+ if (m_bNotify && m_pNotify)
+ {
+ if (!m_bNotifyFlag)
+ {
+ CPDF_Point ptHead(0.0f,0.0f),ptFoot(0.0f,0.0f);
+
+ if (IPDF_VariableText_Iterator * pIterator = m_pVT->GetIterator())
+ {
+ pIterator->SetAt(m_wpCaret);
+ CPVT_Word word;
+ CPVT_Line line;
+ if (pIterator->GetWord(word))
+ {
+ ptHead.x = word.ptWord.x + word.fWidth;
+ ptHead.y = word.ptWord.y + word.fAscent;
+ ptFoot.x = word.ptWord.x + word.fWidth;
+ ptFoot.y = word.ptWord.y + word.fDescent;
+ }
+ else if (pIterator->GetLine(line))
+ {
+ ptHead.x = line.ptLine.x;
+ ptHead.y = line.ptLine.y + line.fLineAscent;
+ ptFoot.x = line.ptLine.x;
+ ptFoot.y = line.ptLine.y + line.fLineDescent;
+ }
+ }
+
+ m_bNotifyFlag = TRUE;
+ m_pNotify->IOnSetCaret(!m_SelState.IsExist(),VTToEdit(ptHead),VTToEdit(ptFoot), m_wpCaret);
+ m_bNotifyFlag = FALSE;
+ }
+ }
+
+ SetCaretChange();
+}
+
+void CFX_Edit::SetCaretChange()
+{
+ if (this->m_wpCaret == this->m_wpOldCaret) return;
+
+ if (m_bNotify && m_pVT->IsRichText() && m_pNotify)
+ {
+ CPVT_SecProps SecProps;
+ CPVT_WordProps WordProps;
+
+ if (IPDF_VariableText_Iterator * pIterator = m_pVT->GetIterator())
+ {
+ pIterator->SetAt(m_wpCaret);
+ CPVT_Word word;
+ CPVT_Section section;
+
+ if (pIterator->GetSection(section))
+ {
+ SecProps = section.SecProps;
+ WordProps = section.WordProps;
+ }
+
+ if (pIterator->GetWord(word))
+ {
+ WordProps = word.WordProps;
+ }
+ }
+
+ if (!m_bNotifyFlag)
+ {
+ m_bNotifyFlag = TRUE;
+ m_pNotify->IOnCaretChange(SecProps,WordProps);
+ m_bNotifyFlag = FALSE;
+ }
+ }
+}
+
+void CFX_Edit::SetCaret(FX_INT32 nPos)
+{
+ if (m_pVT->IsValid())
+ {
+ SelectNone();
+ SetCaret(m_pVT->WordIndexToWordPlace(nPos));
+ m_SelState.Set(m_wpCaret,m_wpCaret);
+
+ ScrollToCaret();
+ SetCaretOrigin();
+ SetCaretInfo();
+ }
+}
+
+void CFX_Edit::OnMouseDown(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl)
+{
+ if (m_pVT->IsValid())
+ {
+ SelectNone();
+ SetCaret(m_pVT->SearchWordPlace(EditToVT(point)));
+ m_SelState.Set(m_wpCaret,m_wpCaret);
+
+ ScrollToCaret();
+ SetCaretOrigin();
+ SetCaretInfo();
+ }
+}
+
+void CFX_Edit::OnMouseMove(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl)
+{
+ if (m_pVT->IsValid())
+ {
+ SetCaret(m_pVT->SearchWordPlace(EditToVT(point)));
+
+ if (m_wpCaret != m_wpOldCaret)
+ {
+ m_SelState.SetEndPos(m_wpCaret);
+
+ ScrollToCaret();
+ CPVT_WordRange wr(m_wpOldCaret,m_wpCaret);
+ Refresh(RP_OPTIONAL,&wr);
+ SetCaretOrigin();
+ SetCaretInfo();
+ }
+ }
+}
+
+void CFX_Edit::OnVK_UP(FX_BOOL bShift,FX_BOOL bCtrl)
+{
+ if (m_pVT->IsValid())
+ {
+ SetCaret(m_pVT->GetUpWordPlace(m_wpCaret,m_ptCaret));
+
+ if (bShift)
+ {
+ if (m_SelState.IsExist())
+ m_SelState.SetEndPos(m_wpCaret);
+ else
+ m_SelState.Set(m_wpOldCaret,m_wpCaret);
+
+ if (m_wpOldCaret != m_wpCaret)
+ {
+ ScrollToCaret();
+ CPVT_WordRange wr(m_wpOldCaret, m_wpCaret);
+ Refresh(RP_OPTIONAL, &wr);
+ SetCaretInfo();
+ }
+ }
+ else
+ {
+ SelectNone();
+
+ ScrollToCaret();
+ SetCaretInfo();
+ }
+ }
+}
+
+void CFX_Edit::OnVK_DOWN(FX_BOOL bShift,FX_BOOL bCtrl)
+{
+ if (m_pVT->IsValid())
+ {
+ SetCaret(m_pVT->GetDownWordPlace(m_wpCaret,m_ptCaret));
+
+ if (bShift)
+ {
+ if (m_SelState.IsExist())
+ m_SelState.SetEndPos(m_wpCaret);
+ else
+ m_SelState.Set(m_wpOldCaret,m_wpCaret);
+
+ if (m_wpOldCaret != m_wpCaret)
+ {
+ ScrollToCaret();
+ CPVT_WordRange wr(m_wpOldCaret,m_wpCaret);
+ Refresh(RP_OPTIONAL, &wr);
+ SetCaretInfo();
+ }
+ }
+ else
+ {
+ SelectNone();
+
+ ScrollToCaret();
+ SetCaretInfo();
+ }
+ }
+}
+
+void CFX_Edit::OnVK_LEFT(FX_BOOL bShift,FX_BOOL bCtrl)
+{
+ if (m_pVT->IsValid())
+ {
+ if (bShift)
+ {
+ if (m_wpCaret == m_pVT->GetLineBeginPlace(m_wpCaret) &&
+ m_wpCaret != m_pVT->GetSectionBeginPlace(m_wpCaret))
+ SetCaret(m_pVT->GetPrevWordPlace(m_wpCaret));
+
+ SetCaret(m_pVT->GetPrevWordPlace(m_wpCaret));
+
+ if (m_SelState.IsExist())
+ m_SelState.SetEndPos(m_wpCaret);
+ else
+ m_SelState.Set(m_wpOldCaret, m_wpCaret);
+
+ if (m_wpOldCaret != m_wpCaret)
+ {
+ ScrollToCaret();
+ CPVT_WordRange wr(m_wpOldCaret,m_wpCaret);
+ Refresh(RP_OPTIONAL,&wr);
+ SetCaretInfo();
+ }
+ }
+ else
+ {
+ if (m_SelState.IsExist())
+ {
+ if (m_SelState.BeginPos.WordCmp(m_SelState.EndPos)<0)
+ SetCaret(m_SelState.BeginPos);
+ else
+ SetCaret(m_SelState.EndPos);
+
+ SelectNone();
+ ScrollToCaret();
+ SetCaretInfo();
+ }
+ else
+ {
+ if (m_wpCaret == m_pVT->GetLineBeginPlace(m_wpCaret) &&
+ m_wpCaret != m_pVT->GetSectionBeginPlace(m_wpCaret))
+ SetCaret(m_pVT->GetPrevWordPlace(m_wpCaret));
+
+ SetCaret(m_pVT->GetPrevWordPlace(m_wpCaret));
+
+ ScrollToCaret();
+ SetCaretOrigin();
+ SetCaretInfo();
+ }
+ }
+ }
+}
+
+void CFX_Edit::OnVK_RIGHT(FX_BOOL bShift,FX_BOOL bCtrl)
+{
+ if (m_pVT->IsValid())
+ {
+ if (bShift)
+ {
+ SetCaret(m_pVT->GetNextWordPlace(m_wpCaret));
+
+ if (m_wpCaret == m_pVT->GetLineEndPlace(m_wpCaret) &&
+ m_wpCaret != m_pVT->GetSectionEndPlace(m_wpCaret))
+ SetCaret(m_pVT->GetNextWordPlace(m_wpCaret));
+
+ if (m_SelState.IsExist())
+ m_SelState.SetEndPos(m_wpCaret);
+ else
+ m_SelState.Set(m_wpOldCaret,m_wpCaret);
+
+ if (m_wpOldCaret != m_wpCaret)
+ {
+ ScrollToCaret();
+ CPVT_WordRange wr(m_wpOldCaret,m_wpCaret);
+ Refresh(RP_OPTIONAL,&wr);
+ SetCaretInfo();
+ }
+ }
+ else
+ {
+ if (m_SelState.IsExist())
+ {
+ if (m_SelState.BeginPos.WordCmp(m_SelState.EndPos)>0)
+ SetCaret(m_SelState.BeginPos);
+ else
+ SetCaret(m_SelState.EndPos);
+
+ SelectNone();
+ ScrollToCaret();
+ SetCaretInfo();
+ }
+ else
+ {
+ SetCaret(m_pVT->GetNextWordPlace(m_wpCaret));
+
+ if (m_wpCaret == m_pVT->GetLineEndPlace(m_wpCaret) &&
+ m_wpCaret != m_pVT->GetSectionEndPlace(m_wpCaret))
+ SetCaret(m_pVT->GetNextWordPlace(m_wpCaret));
+
+ ScrollToCaret();
+ SetCaretOrigin();
+ SetCaretInfo();
+ }
+ }
+ }
+}
+
+void CFX_Edit::OnVK_HOME(FX_BOOL bShift,FX_BOOL bCtrl)
+{
+ if (m_pVT->IsValid())
+ {
+ if (bShift)
+ {
+ if (bCtrl)
+ SetCaret(m_pVT->GetBeginWordPlace());
+ else
+ SetCaret(m_pVT->GetLineBeginPlace(m_wpCaret));
+
+ if (m_SelState.IsExist())
+ m_SelState.SetEndPos(m_wpCaret);
+ else
+ m_SelState.Set(m_wpOldCaret,m_wpCaret);
+
+ ScrollToCaret();
+ CPVT_WordRange wr(m_wpOldCaret, m_wpCaret);
+ Refresh(RP_OPTIONAL, &wr);
+ SetCaretInfo();
+ }
+ else
+ {
+ if (m_SelState.IsExist())
+ {
+ if (m_SelState.BeginPos.WordCmp(m_SelState.EndPos)<0)
+ SetCaret(m_SelState.BeginPos);
+ else
+ SetCaret(m_SelState.EndPos);
+
+ SelectNone();
+ ScrollToCaret();
+ SetCaretInfo();
+ }
+ else
+ {
+ if (bCtrl)
+ SetCaret(m_pVT->GetBeginWordPlace());
+ else
+ SetCaret(m_pVT->GetLineBeginPlace(m_wpCaret));
+
+ ScrollToCaret();
+ SetCaretOrigin();
+ SetCaretInfo();
+ }
+ }
+ }
+}
+
+void CFX_Edit::OnVK_END(FX_BOOL bShift,FX_BOOL bCtrl)
+{
+ if (m_pVT->IsValid())
+ {
+ if (bShift)
+ {
+ if (bCtrl)
+ SetCaret(m_pVT->GetEndWordPlace());
+ else
+ SetCaret(m_pVT->GetLineEndPlace(m_wpCaret));
+
+ if (m_SelState.IsExist())
+ m_SelState.SetEndPos(m_wpCaret);
+ else
+ m_SelState.Set(m_wpOldCaret, m_wpCaret);
+
+ ScrollToCaret();
+ CPVT_WordRange wr(m_wpOldCaret, m_wpCaret);
+ Refresh(RP_OPTIONAL, &wr);
+ SetCaretInfo();
+ }
+ else
+ {
+ if (m_SelState.IsExist())
+ {
+ if (m_SelState.BeginPos.WordCmp(m_SelState.EndPos)>0)
+ SetCaret(m_SelState.BeginPos);
+ else
+ SetCaret(m_SelState.EndPos);
+
+ SelectNone();
+ ScrollToCaret();
+ SetCaretInfo();
+ }
+ else
+ {
+ if (bCtrl)
+ SetCaret(m_pVT->GetEndWordPlace());
+ else
+ SetCaret(m_pVT->GetLineEndPlace(m_wpCaret));
+
+ ScrollToCaret();
+ SetCaretOrigin();
+ SetCaretInfo();
+ }
+ }
+ }
+}
+
+void CFX_Edit::SetText(FX_LPCWSTR text,FX_INT32 charset,
+ const CPVT_SecProps * pSecProps,const CPVT_WordProps * pWordProps, FX_BOOL bAddUndo, FX_BOOL bPaint)
+{
+ Empty();
+ DoInsertText(CPVT_WordPlace(0,0,-1), text, charset, pSecProps, pWordProps);
+ if (bPaint) Paint();
+ if (m_bOprNotify && m_pOprNotify)
+ m_pOprNotify->OnSetText(m_wpCaret, m_wpOldCaret);
+ //if (bAddUndo)
+}
+
+FX_BOOL CFX_Edit::InsertWord(FX_WORD word, FX_INT32 charset, const CPVT_WordProps * pWordProps, FX_BOOL bAddUndo, FX_BOOL bPaint)
+{
+ if (IsTextOverflow()) return FALSE;
+
+ if (m_pVT->IsValid())
+ {
+ m_pVT->UpdateWordPlace(m_wpCaret);
+
+ SetCaret(m_pVT->InsertWord(m_wpCaret,word,GetCharSetFromUnicode(word, charset),pWordProps));
+ m_SelState.Set(m_wpCaret,m_wpCaret);
+
+ if (m_wpCaret != m_wpOldCaret)
+ {
+ if (bAddUndo && m_bEnableUndo)
+ {
+ AddEditUndoItem(new CFXEU_InsertWord(this,m_wpOldCaret,m_wpCaret,word,charset,pWordProps));
+ }
+
+ if (bPaint)
+ PaintInsertText(m_wpOldCaret, m_wpCaret);
+
+ if (m_bOprNotify && m_pOprNotify)
+ m_pOprNotify->OnInsertWord(m_wpCaret, m_wpOldCaret);
+
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
+FX_BOOL CFX_Edit::InsertReturn(const CPVT_SecProps * pSecProps,const CPVT_WordProps * pWordProps,
+ FX_BOOL bAddUndo, FX_BOOL bPaint)
+{
+ if (IsTextOverflow()) return FALSE;
+
+ if (m_pVT->IsValid())
+ {
+ m_pVT->UpdateWordPlace(m_wpCaret);
+ SetCaret(m_pVT->InsertSection(m_wpCaret,pSecProps,pWordProps));
+ m_SelState.Set(m_wpCaret,m_wpCaret);
+
+ if (m_wpCaret != m_wpOldCaret)
+ {
+ if (bAddUndo && m_bEnableUndo)
+ {
+ AddEditUndoItem(new CFXEU_InsertReturn(this,m_wpOldCaret,m_wpCaret,pSecProps,pWordProps));
+ }
+
+ if (bPaint)
+ {
+ RearrangePart(CPVT_WordRange(m_wpOldCaret, m_wpCaret));
+ ScrollToCaret();
+ CPVT_WordRange wr(m_wpOldCaret, GetVisibleWordRange().EndPos);
+ Refresh(RP_ANALYSE, &wr);
+ SetCaretOrigin();
+ SetCaretInfo();
+ }
+
+ if (m_bOprNotify && m_pOprNotify)
+ m_pOprNotify->OnInsertReturn(m_wpCaret, m_wpOldCaret);
+
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
+FX_BOOL CFX_Edit::Backspace(FX_BOOL bAddUndo, FX_BOOL bPaint)
+{
+ if (m_pVT->IsValid())
+ {
+ if (m_wpCaret == m_pVT->GetBeginWordPlace()) return FALSE;
+
+ CPVT_Section section;
+ CPVT_Word word;
+
+ if (bAddUndo)
+ {
+ if (IPDF_VariableText_Iterator * pIterator = m_pVT->GetIterator())
+ {
+ pIterator->SetAt(m_wpCaret);
+ pIterator->GetSection(section);
+ pIterator->GetWord(word);
+ }
+ }
+
+ m_pVT->UpdateWordPlace(m_wpCaret);
+ SetCaret(m_pVT->BackSpaceWord(m_wpCaret));
+ m_SelState.Set(m_wpCaret,m_wpCaret);
+
+ if (m_wpCaret != m_wpOldCaret)
+ {
+ if (bAddUndo && m_bEnableUndo)
+ {
+ if (m_wpCaret.SecCmp(m_wpOldCaret) != 0)
+ AddEditUndoItem(new CFXEU_Backspace(this,m_wpOldCaret,m_wpCaret,word.Word,word.nCharset,
+ section.SecProps,section.WordProps));
+ else
+ AddEditUndoItem(new CFXEU_Backspace(this,m_wpOldCaret,m_wpCaret,word.Word,word.nCharset,
+ section.SecProps,word.WordProps));
+ }
+
+ if (bPaint)
+ {
+ RearrangePart(CPVT_WordRange(m_wpCaret,m_wpOldCaret));
+ ScrollToCaret();
+
+ CPVT_WordRange wr;
+ if (m_wpCaret.SecCmp(m_wpOldCaret) !=0)
+ wr = CPVT_WordRange(m_pVT->GetPrevWordPlace(m_wpCaret),GetVisibleWordRange().EndPos);
+ else if (m_wpCaret.LineCmp(m_wpOldCaret) !=0)
+ wr = CPVT_WordRange(m_pVT->GetLineBeginPlace(m_wpCaret),m_pVT->GetSectionEndPlace(m_wpCaret));
+ else
+ wr = CPVT_WordRange(m_pVT->GetPrevWordPlace(m_wpCaret),m_pVT->GetSectionEndPlace(m_wpCaret));
+
+ Refresh(RP_ANALYSE, &wr);
+
+ SetCaretOrigin();
+ SetCaretInfo();
+ }
+
+ if (m_bOprNotify && m_pOprNotify)
+ m_pOprNotify->OnBackSpace(m_wpCaret, m_wpOldCaret);
+
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
+FX_BOOL CFX_Edit::Delete(FX_BOOL bAddUndo, FX_BOOL bPaint)
+{
+ if (m_pVT->IsValid())
+ {
+ if (m_wpCaret == m_pVT->GetEndWordPlace()) return FALSE;
+
+ CPVT_Section section;
+ CPVT_Word word;
+
+ if (bAddUndo)
+ {
+ if (IPDF_VariableText_Iterator * pIterator = m_pVT->GetIterator())
+ {
+ pIterator->SetAt(m_pVT->GetNextWordPlace(m_wpCaret));
+ pIterator->GetSection(section);
+ pIterator->GetWord(word);
+ }
+ }
+
+ m_pVT->UpdateWordPlace(m_wpCaret);
+ FX_BOOL bSecEnd = (m_wpCaret == m_pVT->GetSectionEndPlace(m_wpCaret));
+
+ SetCaret(m_pVT->DeleteWord(m_wpCaret));
+ m_SelState.Set(m_wpCaret,m_wpCaret);
+
+ if (bAddUndo && m_bEnableUndo)
+ {
+ if (bSecEnd)
+ AddEditUndoItem(new CFXEU_Delete(this,m_wpOldCaret,m_wpCaret,word.Word,word.nCharset,
+ section.SecProps,section.WordProps,bSecEnd));
+ else
+ AddEditUndoItem(new CFXEU_Delete(this,m_wpOldCaret,m_wpCaret,word.Word,word.nCharset,
+ section.SecProps,word.WordProps,bSecEnd));
+ }
+
+ if (bPaint)
+ {
+ RearrangePart(CPVT_WordRange(m_wpOldCaret,m_wpCaret));
+ ScrollToCaret();
+
+ CPVT_WordRange wr;
+ if (bSecEnd)
+ wr = CPVT_WordRange(m_pVT->GetPrevWordPlace(m_wpOldCaret),GetVisibleWordRange().EndPos);
+ else if (m_wpCaret.LineCmp(m_wpOldCaret) !=0)
+ wr = CPVT_WordRange(m_pVT->GetLineBeginPlace(m_wpCaret),m_pVT->GetSectionEndPlace(m_wpCaret));
+ else
+ wr = CPVT_WordRange(m_pVT->GetPrevWordPlace(m_wpOldCaret),m_pVT->GetSectionEndPlace(m_wpCaret));
+
+ Refresh(RP_ANALYSE, &wr);
+
+ SetCaretOrigin();
+ SetCaretInfo();
+ }
+
+ if (m_bOprNotify && m_pOprNotify)
+ m_pOprNotify->OnDelete(m_wpCaret, m_wpOldCaret);
+
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+FX_BOOL CFX_Edit::Empty()
+{
+ if (m_pVT->IsValid())
+ {
+ m_pVT->DeleteWords(GetWholeWordRange());
+ SetCaret(m_pVT->GetBeginWordPlace());
+
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+FX_BOOL CFX_Edit::Clear(FX_BOOL bAddUndo, FX_BOOL bPaint)
+{
+ if (m_pVT->IsValid())
+ {
+ if (m_SelState.IsExist())
+ {
+ CPVT_WordRange range = m_SelState.ConvertToWordRange();
+
+ if (bAddUndo && m_bEnableUndo)
+ {
+ if (m_pVT->IsRichText())
+ {
+ BeginGroupUndo(L"");
+
+ if (IPDF_VariableText_Iterator * pIterator = m_pVT->GetIterator())
+ {
+ pIterator->SetAt(range.EndPos);
+
+ CPVT_Word wordinfo;
+ CPVT_Section secinfo;
+ do
+ {
+ CPVT_WordPlace place = pIterator->GetAt();
+ if (place.WordCmp(range.BeginPos) <= 0)break;
+
+ CPVT_WordPlace oldplace = m_pVT->GetPrevWordPlace(place);
+
+ if (oldplace.SecCmp(place) != 0)
+ {
+ if (pIterator->GetSection(secinfo))
+ {
+ AddEditUndoItem(new CFXEU_ClearRich(this,oldplace,place,range,wordinfo.Word,
+ wordinfo.nCharset,secinfo.SecProps,secinfo.WordProps));
+ }
+ }
+ else
+ {
+ if (pIterator->GetWord(wordinfo))
+ {
+ oldplace = m_pVT->AjustLineHeader(oldplace,TRUE);
+ place = m_pVT->AjustLineHeader(place,TRUE);
+
+ AddEditUndoItem(new CFXEU_ClearRich(this,oldplace,place,range,wordinfo.Word,
+ wordinfo.nCharset,secinfo.SecProps,wordinfo.WordProps));
+ }
+ }
+ }while (pIterator->PrevWord());
+ }
+ EndGroupUndo();
+ }
+ else
+ {
+ AddEditUndoItem(new CFXEU_Clear(this,range,GetSelText()));
+ }
+ }
+
+ SelectNone();
+ SetCaret(m_pVT->DeleteWords(range));
+ m_SelState.Set(m_wpCaret,m_wpCaret);
+
+ if (bPaint)
+ {
+ RearrangePart(range);
+ ScrollToCaret();
+
+ CPVT_WordRange wr(m_wpOldCaret, GetVisibleWordRange().EndPos);
+ Refresh(RP_ANALYSE, &wr);
+
+ SetCaretOrigin();
+ SetCaretInfo();
+ }
+
+ if (m_bOprNotify && m_pOprNotify)
+ m_pOprNotify->OnClear(m_wpCaret, m_wpOldCaret);
+
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
+FX_BOOL CFX_Edit::InsertText(FX_LPCWSTR text, FX_INT32 charset,
+ const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordProps, FX_BOOL bAddUndo, FX_BOOL bPaint)
+{
+ if (IsTextOverflow()) return FALSE;
+
+ m_pVT->UpdateWordPlace(m_wpCaret);
+ SetCaret(DoInsertText(m_wpCaret, text, charset, pSecProps, pWordProps));
+ m_SelState.Set(m_wpCaret,m_wpCaret);
+
+ if (m_wpCaret != m_wpOldCaret)
+ {
+ if (bAddUndo && m_bEnableUndo)
+ {
+ AddEditUndoItem(new CFXEU_InsertText(this,m_wpOldCaret,m_wpCaret,text,charset,pSecProps,pWordProps));
+ }
+
+ if (bPaint)
+ PaintInsertText(m_wpOldCaret, m_wpCaret);
+
+ if (m_bOprNotify && m_pOprNotify)
+ m_pOprNotify->OnInsertText(m_wpCaret, m_wpOldCaret);
+
+ return TRUE;
+ }
+ return FALSE;
+}
+
+void CFX_Edit::PaintInsertText(const CPVT_WordPlace & wpOld, const CPVT_WordPlace & wpNew)
+{
+ if (m_pVT->IsValid())
+ {
+ RearrangePart(CPVT_WordRange(wpOld,wpNew));
+ ScrollToCaret();
+
+ CPVT_WordRange wr;
+ if (m_wpCaret.LineCmp(wpOld) !=0)
+ wr = CPVT_WordRange(m_pVT->GetLineBeginPlace(wpOld),m_pVT->GetSectionEndPlace(wpNew));
+ else
+ wr = CPVT_WordRange(wpOld,m_pVT->GetSectionEndPlace(wpNew));
+ Refresh(RP_ANALYSE, &wr);
+ SetCaretOrigin();
+ SetCaretInfo();
+ }
+}
+
+FX_BOOL CFX_Edit::Redo()
+{
+ if (m_bEnableUndo)
+ {
+ if (m_Undo.CanRedo())
+ {
+ m_Undo.Redo();
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
+FX_BOOL CFX_Edit::Undo()
+{
+ if (m_bEnableUndo)
+ {
+ if (m_Undo.CanUndo())
+ {
+ m_Undo.Undo();
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
+void CFX_Edit::SetCaretOrigin()
+{
+ if (m_pVT->IsValid())
+ {
+ if (IPDF_VariableText_Iterator * pIterator = m_pVT->GetIterator())
+ {
+ pIterator->SetAt(m_wpCaret);
+ CPVT_Word word;
+ CPVT_Line line;
+ if (pIterator->GetWord(word))
+ {
+ m_ptCaret.x = word.ptWord.x + word.fWidth;
+ m_ptCaret.y = word.ptWord.y;
+ }
+ else if (pIterator->GetLine(line))
+ {
+ m_ptCaret.x = line.ptLine.x;
+ m_ptCaret.y = line.ptLine.y;
+ }
+ }
+ }
+}
+
+FX_INT32 CFX_Edit::WordPlaceToWordIndex(const CPVT_WordPlace & place) const
+{
+ if (m_pVT->IsValid())
+ return m_pVT->WordPlaceToWordIndex(place);
+
+ return -1;
+}
+
+CPVT_WordPlace CFX_Edit::WordIndexToWordPlace(FX_INT32 index) const
+{
+ if (m_pVT->IsValid())
+ return m_pVT->WordIndexToWordPlace(index);
+
+ return CPVT_WordPlace();
+}
+
+FX_BOOL CFX_Edit::IsTextFull() const
+{
+ FX_INT32 nTotalWords = m_pVT->GetTotalWords();
+ FX_INT32 nLimitChar = m_pVT->GetLimitChar();
+ FX_INT32 nCharArray = m_pVT->GetCharArray();
+
+ return IsTextOverflow() || (nLimitChar>0 && nTotalWords >= nLimitChar)
+ || (nCharArray>0 && nTotalWords >= nCharArray);
+}
+
+FX_BOOL CFX_Edit::IsTextOverflow() const
+{
+ if (!m_bEnableScroll && !m_bEnableOverflow)
+ {
+ CPDF_Rect rcPlate = m_pVT->GetPlateRect();
+ CPDF_Rect rcContent = m_pVT->GetContentRect();
+
+ if (m_pVT->IsMultiLine() && GetTotalLines() > 1)
+ {
+ if (FX_EDIT_IsFloatBigger(rcContent.Height(),rcPlate.Height())) return TRUE;
+ }
+
+ if (FX_EDIT_IsFloatBigger(rcContent.Width(),rcPlate.Width())) return TRUE;
+ }
+
+ return FALSE;
+}
+
+CPVT_WordPlace CFX_Edit::GetLineBeginPlace(const CPVT_WordPlace & place) const
+{
+ return m_pVT->GetLineBeginPlace(place);
+}
+
+CPVT_WordPlace CFX_Edit::GetLineEndPlace(const CPVT_WordPlace & place) const
+{
+ return m_pVT->GetLineEndPlace(place);
+}
+
+CPVT_WordPlace CFX_Edit::GetSectionBeginPlace(const CPVT_WordPlace & place) const
+{
+ return m_pVT->GetSectionBeginPlace(place);
+}
+
+CPVT_WordPlace CFX_Edit::GetSectionEndPlace(const CPVT_WordPlace & place) const
+{
+ return m_pVT->GetSectionEndPlace(place);
+}
+
+FX_BOOL CFX_Edit::CanUndo() const
+{
+ if (m_bEnableUndo)
+ {
+ return m_Undo.CanUndo();
+ }
+
+ return FALSE;
+}
+
+FX_BOOL CFX_Edit::CanRedo() const
+{
+ if (m_bEnableUndo)
+ {
+ return m_Undo.CanRedo();
+ }
+
+ return FALSE;
+}
+
+FX_BOOL CFX_Edit::IsModified() const
+{
+ if (m_bEnableUndo)
+ {
+ return m_Undo.IsModified();
+ }
+
+ return FALSE;
+}
+
+void CFX_Edit::EnableRefresh(FX_BOOL bRefresh)
+{
+ m_bEnableRefresh = bRefresh;
+}
+
+void CFX_Edit::EnableUndo(FX_BOOL bUndo)
+{
+ this->m_bEnableUndo = bUndo;
+}
+
+void CFX_Edit::EnableNotify(FX_BOOL bNotify)
+{
+ this->m_bNotify = bNotify;
+}
+
+void CFX_Edit::EnableOprNotify(FX_BOOL bNotify)
+{
+ this->m_bOprNotify = bNotify;
+}
+
+FX_FLOAT CFX_Edit::GetLineTop(const CPVT_WordPlace& place) const
+{
+ if (IPDF_VariableText_Iterator* pIterator = m_pVT->GetIterator())
+ {
+ CPVT_WordPlace wpOld = pIterator->GetAt();
+
+ pIterator->SetAt(place);
+ CPVT_Line line;
+ pIterator->GetLine(line);
+
+ pIterator->SetAt(wpOld);
+
+ return line.ptLine.y + line.fLineAscent;
+ }
+
+ return 0.0f;
+}
+
+FX_FLOAT CFX_Edit::GetLineBottom(const CPVT_WordPlace& place) const
+{
+ if (IPDF_VariableText_Iterator* pIterator = m_pVT->GetIterator())
+ {
+ CPVT_WordPlace wpOld = pIterator->GetAt();
+
+ pIterator->SetAt(place);
+ CPVT_Line line;
+ pIterator->GetLine(line);
+
+ pIterator->SetAt(wpOld);
+
+ return line.ptLine.y + line.fLineDescent;
+ }
+
+ return 0.0f;
+}
+
+CPVT_WordPlace CFX_Edit::DoInsertText(const CPVT_WordPlace& place, FX_LPCWSTR text, FX_INT32 charset,
+ const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordProps)
+{
+ CPVT_WordPlace wp = place;
+
+ if (m_pVT->IsValid())
+ {
+ CFX_WideString sText = text;
+
+ for (FX_INT32 i = 0, sz = sText.GetLength(); i < sz; i++)
+ {
+ FX_WORD word = sText[i];
+ switch (word)
+ {
+ case 0x0D:
+ wp = m_pVT->InsertSection(wp,pSecProps,pWordProps);
+ if (sText[i+1] == 0x0A)
+ i++;
+ break;
+ case 0x0A:
+ wp = m_pVT->InsertSection(wp,pSecProps,pWordProps);
+ if (sText[i+1] == 0x0D)
+ i++;
+ break;
+ case 0x09:
+ word = 0x20;
+ default:
+ wp = m_pVT->InsertWord(wp,word,GetCharSetFromUnicode(word, charset),pWordProps);
+ break;
+ }
+ }
+ }
+
+ return wp;
+}
+
+FX_INT32 CFX_Edit::GetCharSetFromUnicode(FX_WORD word, FX_INT32 nOldCharset)
+{
+ if (IFX_Edit_FontMap* pFontMap = this->GetFontMap())
+ return pFontMap->CharSetFromUnicode(word, nOldCharset);
+ else
+ return nOldCharset;
+}
+
+void CFX_Edit::BeginGroupUndo(const CFX_WideString& sTitle)
+{
+ ASSERT(m_pGroupUndoItem == NULL);
+
+ m_pGroupUndoItem = new CFX_Edit_GroupUndoItem(sTitle);
+}
+
+void CFX_Edit::EndGroupUndo()
+{
+ ASSERT(m_pGroupUndoItem != NULL);
+
+ m_pGroupUndoItem->UpdateItems();
+ m_Undo.AddItem(m_pGroupUndoItem);
+ if (m_bOprNotify && m_pOprNotify)
+ m_pOprNotify->OnAddUndo(m_pGroupUndoItem);
+ m_pGroupUndoItem = NULL;
+}
+
+void CFX_Edit::AddEditUndoItem(CFX_Edit_UndoItem* pEditUndoItem)
+{
+ if (m_pGroupUndoItem)
+ m_pGroupUndoItem->AddUndoItem(pEditUndoItem);
+ else
+ {
+ m_Undo.AddItem(pEditUndoItem);
+ if (m_bOprNotify && m_pOprNotify)
+ m_pOprNotify->OnAddUndo(pEditUndoItem);
+ }
+}
+
+void CFX_Edit::AddUndoItem(IFX_Edit_UndoItem* pUndoItem)
+{
+ m_Undo.AddItem(pUndoItem);
+ if (m_bOprNotify && m_pOprNotify)
+ m_pOprNotify->OnAddUndo(pUndoItem);
+}
+
diff --git a/fpdfsdk/src/fxedit/fxet_list.cpp b/fpdfsdk/src/fxedit/fxet_list.cpp
index dd70e0c7d4..63aee1b253 100644
--- a/fpdfsdk/src/fxedit/fxet_list.cpp
+++ b/fpdfsdk/src/fxedit/fxet_list.cpp
@@ -1,1012 +1,1012 @@
-// 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
-
-#include "../../include/fxedit/fxet_stub.h"
-#include "../../include/fxedit/fxet_edit.h"
-#include "../../include/fxedit/fxet_list.h"
-
-/* ------------------------------- CFX_ListItem ---------------------------------- */
-
-CFX_ListItem::CFX_ListItem() : m_pEdit(NULL),
- m_bSelected(FALSE),
- m_bCaret(FALSE),
- m_rcListItem(0.0f,0.0f,0.0f,0.0f)
-{
- m_pEdit = IFX_Edit::NewEdit();
- ASSERT(m_pEdit != NULL);
-
- m_pEdit->SetAlignmentV(1);
- m_pEdit->Initialize();
-}
-
-CFX_ListItem::~CFX_ListItem()
-{
- IFX_Edit::DelEdit(m_pEdit);
-}
-
-void CFX_ListItem::SetFontMap(IFX_Edit_FontMap * pFontMap)
-{
- if (m_pEdit)
- m_pEdit->SetFontMap(pFontMap);
-}
-
-IFX_Edit* CFX_ListItem::GetEdit() const
-{
- return m_pEdit;
-}
-
-IFX_Edit_Iterator* CFX_ListItem::GetIterator() const
-{
- if (m_pEdit)
- return m_pEdit->GetIterator();
-
- return NULL;
-}
-
-void CFX_ListItem::SetRect(const CLST_Rect & rect)
-{
- m_rcListItem = rect;
-}
-
-CLST_Rect CFX_ListItem::GetRect() const
-{
- return m_rcListItem;
-}
-
-FX_BOOL CFX_ListItem::IsSelected() const
-{
- return m_bSelected;
-}
-
-void CFX_ListItem::SetSelect(FX_BOOL bSelected)
-{
- m_bSelected = bSelected;
-}
-
-FX_BOOL CFX_ListItem::IsCaret() const
-{
- return m_bCaret;
-}
-
-void CFX_ListItem::SetCaret(FX_BOOL bCaret)
-{
- m_bCaret = bCaret;
-}
-
-void CFX_ListItem::SetText(FX_LPCWSTR text)
-{
- if (m_pEdit)
- m_pEdit->SetText(text);
-}
-
-void CFX_ListItem::SetFontSize(FX_FLOAT fFontSize)
-{
- if (m_pEdit)
- m_pEdit->SetFontSize(fFontSize);
-}
-
-FX_FLOAT CFX_ListItem::GetItemHeight() const
-{
- if (m_pEdit)
- return m_pEdit->GetContentRect().Height();
-
- return 0.0f;
-}
-
-FX_WORD CFX_ListItem::GetFirstChar() const
-{
- CPVT_Word word;
-
- if (IFX_Edit_Iterator* pIterator = GetIterator())
- {
- pIterator->SetAt(1);
- pIterator->GetWord(word);
- }
-
- return word.Word;
-}
-
-CFX_WideString CFX_ListItem::GetText() const
-{
- if (m_pEdit)
- return m_pEdit->GetText();
-
- return L"";
-}
-
-/* ------------------------------------ CFX_List --------------------------------- */
-
-CFX_List::CFX_List() : m_pFontMap(NULL), m_fFontSize(0.0f), m_bMultiple(FALSE)
-{
-}
-
-CFX_List::~CFX_List()
-{
- Empty();
-}
-
-void CFX_List::Empty()
-{
- for (FX_INT32 i=0,sz=m_aListItems.GetSize(); i<sz; i++)
- delete m_aListItems.GetAt(i);
-
- m_aListItems.RemoveAll();
-}
-
-void CFX_List::SetFontMap(IFX_Edit_FontMap * pFontMap)
-{
- m_pFontMap = pFontMap;
-}
-
-void CFX_List::SetFontSize(FX_FLOAT fFontSize)
-{
- m_fFontSize = fFontSize;
-}
-
-void CFX_List::AddItem(FX_LPCWSTR str)
-{
- if (CFX_ListItem * pListItem = new CFX_ListItem())
- {
- pListItem->SetFontMap(m_pFontMap);
- pListItem->SetFontSize(m_fFontSize);
- pListItem->SetText(str);
- m_aListItems.Add(pListItem);
- }
-}
-
-void CFX_List::ReArrange(FX_INT32 nItemIndex)
-{
- FX_FLOAT fPosY = 0.0f;
-
- if (CFX_ListItem * pPrevItem = m_aListItems.GetAt(nItemIndex - 1))
- fPosY = pPrevItem->GetRect().bottom;
-
- for (FX_INT32 i=nItemIndex,sz=m_aListItems.GetSize(); i<sz; i++)
- {
- if (CFX_ListItem * pListItem = m_aListItems.GetAt(i))
- {
- FX_FLOAT fListItemHeight = pListItem->GetItemHeight();
- pListItem->SetRect(CLST_Rect(0.0f,fPosY,0.0f,fPosY + fListItemHeight));
- fPosY += fListItemHeight;
- }
- }
-
- SetContentRect(CLST_Rect(0.0f,0.0f,0.0f,fPosY));
-}
-
-IFX_Edit * CFX_List::GetItemEdit(FX_INT32 nIndex) const
-{
- if (CFX_ListItem * pListItem = m_aListItems.GetAt(nIndex))
- {
- return pListItem->GetEdit();
- }
-
- return NULL;
-}
-
-FX_INT32 CFX_List::GetCount() const
-{
- return m_aListItems.GetSize();
-}
-
-CPDF_Rect CFX_List::GetPlateRect() const
-{
- return CFX_ListContainer::GetPlateRect();
-}
-
-CPDF_Rect CFX_List::GetContentRect() const
-{
- return InnerToOuter(CFX_ListContainer::GetContentRect());
-}
-
-FX_FLOAT CFX_List::GetFontSize() const
-{
- return m_fFontSize;
-}
-
-FX_INT32 CFX_List::GetItemIndex(const CPDF_Point & point) const
-{
- CPDF_Point pt = OuterToInner(point);
-
- FX_BOOL bFirst = TRUE;
- FX_BOOL bLast = TRUE;
-
- for (FX_INT32 i=0,sz=m_aListItems.GetSize(); i<sz; i++)
- {
- if (CFX_ListItem * pListItem = m_aListItems.GetAt(i))
- {
- CLST_Rect rcListItem = pListItem->GetRect();
-
- if (FX_EDIT_IsFloatBigger(pt.y, rcListItem.top))
- {
- bFirst = FALSE;
- }
-
- if (FX_EDIT_IsFloatSmaller(pt.y, rcListItem.bottom))
- {
- bLast = FALSE;
- }
-
- if (pt.y >= rcListItem.top && pt.y < rcListItem.bottom)
- {
- return i;
- }
- }
- }
-
- if (bFirst) return 0;
- if (bLast) return m_aListItems.GetSize()-1;
-
- return -1;
-}
-
-FX_FLOAT CFX_List::GetFirstHeight() const
-{
- if (CFX_ListItem * pListItem = m_aListItems.GetAt(0))
- {
- return pListItem->GetItemHeight();
- }
-
- return 1.0f;
-}
-
-FX_INT32 CFX_List::GetFirstSelected() const
-{
- for (FX_INT32 i=0,sz=m_aListItems.GetSize(); i<sz; i++)
- {
- if (CFX_ListItem * pListItem = m_aListItems.GetAt(i))
- {
- if (pListItem->IsSelected())
- return i;
- }
- }
- return -1;
-}
-
-FX_INT32 CFX_List::GetLastSelected() const
-{
- for (FX_INT32 i=m_aListItems.GetSize()-1; i>=0; i--)
- {
- if (CFX_ListItem * pListItem = m_aListItems.GetAt(i))
- {
- if (pListItem->IsSelected())
- return i;
- }
- }
- return -1;
-}
-
-FX_WCHAR CFX_List::Toupper(FX_WCHAR c) const
-{
- if ( (c >= 'a') && (c <= 'z') )
- c = c - ('a' - 'A');
- return c;
-}
-
-FX_INT32 CFX_List::FindNext(FX_INT32 nIndex,FX_WCHAR nChar) const
-{
- FX_INT32 nCircleIndex = nIndex;
-
- for (FX_INT32 i=0,sz=m_aListItems.GetSize(); i<sz; i++)
- {
- nCircleIndex ++;
- if (nCircleIndex >= sz) nCircleIndex = 0;
-
- if (CFX_ListItem * pListItem = m_aListItems.GetAt(nCircleIndex))
- {
- if (Toupper(pListItem->GetFirstChar()) == Toupper(nChar))
- return nCircleIndex;
- }
- }
-
- return nCircleIndex;
-}
-
-CPDF_Rect CFX_List::GetItemRect(FX_INT32 nIndex) const
-{
- if (CFX_ListItem * pListItem = m_aListItems.GetAt(nIndex))
- {
- CPDF_Rect rcItem = pListItem->GetRect();
- rcItem.left = 0.0f;
- rcItem.right = GetPlateRect().Width();
- return InnerToOuter(rcItem);
- }
-
- return CPDF_Rect();
-}
-
-FX_BOOL CFX_List::IsItemSelected(FX_INT32 nIndex) const
-{
- if (CFX_ListItem * pListItem = m_aListItems.GetAt(nIndex))
- {
- return pListItem->IsSelected();
- }
-
- return FALSE;
-}
-
-void CFX_List::SetItemSelect(FX_INT32 nItemIndex, FX_BOOL bSelected)
-{
- if (CFX_ListItem * pListItem = m_aListItems.GetAt(nItemIndex))
- {
- pListItem->SetSelect(bSelected);
- }
-}
-
-void CFX_List::SetItemCaret(FX_INT32 nItemIndex, FX_BOOL bCaret)
-{
- if (CFX_ListItem * pListItem = m_aListItems.GetAt(nItemIndex))
- {
- pListItem->SetCaret(bCaret);
- }
-}
-
-void CFX_List::SetMultipleSel(FX_BOOL bMultiple)
-{
- m_bMultiple = bMultiple;
-}
-
-FX_BOOL CFX_List::IsMultipleSel() const
-{
- return m_bMultiple;
-}
-
-FX_BOOL CFX_List::IsValid(FX_INT32 nItemIndex) const
-{
- return nItemIndex >= 0 && nItemIndex < m_aListItems.GetSize();
-}
-
-CFX_WideString CFX_List::GetItemText(FX_INT32 nIndex) const
-{
- if (CFX_ListItem * pListItem = m_aListItems.GetAt(nIndex))
- {
- return pListItem->GetText();
- }
-
- return L"";
-}
-
-/* ------------------------------------ CPLST_Select ---------------------------------- */
-
-CPLST_Select::CPLST_Select()
-{
-}
-
-CPLST_Select::~CPLST_Select()
-{
- for (FX_INT32 i=0,sz=m_aItems.GetSize(); i<sz; i++)
- delete m_aItems.GetAt(i);
-
- m_aItems.RemoveAll();
-}
-
-void CPLST_Select::Add(FX_INT32 nItemIndex)
-{
- FX_INT32 nIndex = Find(nItemIndex);
-
- if (nIndex < 0)
- m_aItems.Add(new CPLST_Select_Item(nItemIndex,1));
- else
- {
- if (CPLST_Select_Item * pItem = m_aItems.GetAt(nIndex))
- {
- pItem->nState = 1;
- }
- }
-}
-
-void CPLST_Select::Add(FX_INT32 nBeginIndex, FX_INT32 nEndIndex)
-{
- if (nBeginIndex > nEndIndex)
- {
- FX_INT32 nTemp = nEndIndex;
- nEndIndex = nBeginIndex;
- nBeginIndex = nTemp;
- }
-
- for (FX_INT32 i=nBeginIndex; i<=nEndIndex; i++) Add(i);
-}
-
-void CPLST_Select::Sub(FX_INT32 nItemIndex)
-{
- for (FX_INT32 i=m_aItems.GetSize()-1; i>=0; i--)
- {
- if (CPLST_Select_Item * pItem = m_aItems.GetAt(i))
- if (pItem->nItemIndex == nItemIndex)
- pItem->nState = -1;
- }
-}
-
-void CPLST_Select::Sub(FX_INT32 nBeginIndex, FX_INT32 nEndIndex)
-{
- if (nBeginIndex > nEndIndex)
- {
- FX_INT32 nTemp = nEndIndex;
- nEndIndex = nBeginIndex;
- nBeginIndex = nTemp;
- }
-
- for (FX_INT32 i=nBeginIndex; i<=nEndIndex; i++) Sub(i);
-}
-
-FX_INT32 CPLST_Select::Find(FX_INT32 nItemIndex) const
-{
- for (FX_INT32 i=0,sz=m_aItems.GetSize(); i<sz; i++)
- {
- if (CPLST_Select_Item * pItem = m_aItems.GetAt(i))
- {
- if (pItem->nItemIndex == nItemIndex)
- return i;
- }
- }
-
- return -1;
-}
-
-FX_BOOL CPLST_Select::IsExist(FX_INT32 nItemIndex) const
-{
- return Find(nItemIndex) >= 0;
-}
-
-FX_INT32 CPLST_Select::GetCount() const
-{
- return m_aItems.GetSize();
-}
-
-FX_INT32 CPLST_Select::GetItemIndex(FX_INT32 nIndex) const
-{
- if (nIndex >= 0 && nIndex < m_aItems.GetSize())
- if (CPLST_Select_Item * pItem = m_aItems.GetAt(nIndex))
- return pItem->nItemIndex;
-
- return -1;
-}
-
-FX_INT32 CPLST_Select::GetState(FX_INT32 nIndex) const
-{
- if (nIndex >= 0 && nIndex < m_aItems.GetSize())
- if (CPLST_Select_Item * pItem = m_aItems.GetAt(nIndex))
- return pItem->nState;
-
- return 0;
-}
-
-void CPLST_Select::DeselectAll()
-{
- for (FX_INT32 i=0,sz=m_aItems.GetSize(); i<sz; i++)
- {
- if (CPLST_Select_Item * pItem = m_aItems.GetAt(i))
- {
- pItem->nState = -1;
- }
- }
-}
-
-void CPLST_Select::Done()
-{
- for (FX_INT32 i=m_aItems.GetSize()-1; i>=0; i--)
- {
- if (CPLST_Select_Item * pItem = m_aItems.GetAt(i))
- {
- if (pItem->nState == -1)
- {
- delete pItem;
- m_aItems.RemoveAt(i);
- }
- else
- {
- pItem->nState = 0;
- }
- }
- }
-}
-
-/* ------------------------------------ CFX_ListCtrl --------------------------------- */
-
-CFX_ListCtrl::CFX_ListCtrl() : m_pNotify(NULL),
- m_ptScrollPos(0.0f,0.0f),
- m_nSelItem(-1),
- m_nFootIndex(-1),
- m_bCtrlSel(FALSE),
- m_nCaretIndex(-1),
- m_bNotifyFlag(FALSE)
-{
-}
-
-CFX_ListCtrl::~CFX_ListCtrl()
-{
-}
-
-void CFX_ListCtrl::SetNotify(IFX_List_Notify * pNotify)
-{
- m_pNotify = pNotify;
-}
-
-CPDF_Point CFX_ListCtrl::InToOut(const CPDF_Point & point) const
-{
- CPDF_Rect rcPlate = GetPlateRect();
-
- return CPDF_Point(point.x - (m_ptScrollPos.x - rcPlate.left),
- point.y - (m_ptScrollPos.y - rcPlate.top));
-}
-
-CPDF_Point CFX_ListCtrl::OutToIn(const CPDF_Point & point) const
-{
- CPDF_Rect rcPlate = GetPlateRect();
-
- return CPDF_Point(point.x + (m_ptScrollPos.x - rcPlate.left),
- point.y + (m_ptScrollPos.y - rcPlate.top));
-}
-
-CPDF_Rect CFX_ListCtrl::InToOut(const CPDF_Rect & rect) const
-{
- CPDF_Point ptLeftBottom = InToOut(CPDF_Point(rect.left,rect.bottom));
- CPDF_Point ptRightTop = InToOut(CPDF_Point(rect.right,rect.top));
-
- return CPDF_Rect(ptLeftBottom.x,ptLeftBottom.y,ptRightTop.x,ptRightTop.y);
-}
-
-CPDF_Rect CFX_ListCtrl::OutToIn(const CPDF_Rect & rect) const
-{
- CPDF_Point ptLeftBottom = OutToIn(CPDF_Point(rect.left,rect.bottom));
- CPDF_Point ptRightTop = OutToIn(CPDF_Point(rect.right,rect.top));
-
- return CPDF_Rect(ptLeftBottom.x,ptLeftBottom.y,ptRightTop.x,ptRightTop.y);
-}
-
-void CFX_ListCtrl::OnMouseDown(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl)
-{
- FX_INT32 nHitIndex = this->GetItemIndex(point);
-
- if (IsMultipleSel())
- {
- if (bCtrl)
- {
- if (IsItemSelected(nHitIndex))
- {
- m_aSelItems.Sub(nHitIndex);
- SelectItems();
- m_bCtrlSel = FALSE;
- }
- else
- {
- m_aSelItems.Add(nHitIndex);
- SelectItems();
- m_bCtrlSel = TRUE;
- }
-
- m_nFootIndex = nHitIndex;
- }
- else if (bShift)
- {
- m_aSelItems.DeselectAll();
- m_aSelItems.Add(m_nFootIndex,nHitIndex);
- SelectItems();
- }
- else
- {
- m_aSelItems.DeselectAll();
- m_aSelItems.Add(nHitIndex);
- SelectItems();
-
- m_nFootIndex = nHitIndex;
- }
-
- SetCaret(nHitIndex);
- }
- else
- {
- SetSingleSelect(nHitIndex);
- }
-
- if (!this->IsItemVisible(nHitIndex))
- this->ScrollToListItem(nHitIndex);
-}
-
-void CFX_ListCtrl::OnMouseMove(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl)
-{
- FX_INT32 nHitIndex = this->GetItemIndex(point);
-
- if (IsMultipleSel())
- {
- if (bCtrl)
- {
- if (m_bCtrlSel)
- m_aSelItems.Add(m_nFootIndex,nHitIndex);
- else
- m_aSelItems.Sub(m_nFootIndex,nHitIndex);
-
- SelectItems();
- }
- else
- {
- m_aSelItems.DeselectAll();
- m_aSelItems.Add(m_nFootIndex,nHitIndex);
- SelectItems();
- }
-
- SetCaret(nHitIndex);
- }
- else
- {
- SetSingleSelect(nHitIndex);
- }
-
- if (!this->IsItemVisible(nHitIndex))
- this->ScrollToListItem(nHitIndex);
-}
-
-void CFX_ListCtrl::OnVK(FX_INT32 nItemIndex,FX_BOOL bShift,FX_BOOL bCtrl)
-{
- if (IsMultipleSel())
- {
- if (nItemIndex >= 0 && nItemIndex < GetCount())
- {
- if (bCtrl)
- {
- }
- else if (bShift)
- {
- m_aSelItems.DeselectAll();
- m_aSelItems.Add(m_nFootIndex,nItemIndex);
- SelectItems();
- }
- else
- {
- m_aSelItems.DeselectAll();
- m_aSelItems.Add(nItemIndex);
- SelectItems();
- m_nFootIndex = nItemIndex;
- }
-
- SetCaret(nItemIndex);
- }
- }
- else
- {
- SetSingleSelect(nItemIndex);
- }
-
- if (!this->IsItemVisible(nItemIndex))
- this->ScrollToListItem(nItemIndex);
-}
-
-void CFX_ListCtrl::OnVK_UP(FX_BOOL bShift,FX_BOOL bCtrl)
-{
- OnVK(IsMultipleSel() ? GetCaret()-1 : GetSelect()-1, bShift, bCtrl);
-}
-
-void CFX_ListCtrl::OnVK_DOWN(FX_BOOL bShift,FX_BOOL bCtrl)
-{
- OnVK(IsMultipleSel() ? GetCaret()+1 : GetSelect()+1, bShift, bCtrl);
-}
-
-void CFX_ListCtrl::OnVK_LEFT(FX_BOOL bShift,FX_BOOL bCtrl)
-{
- OnVK(0, bShift, bCtrl);
-}
-
-void CFX_ListCtrl::OnVK_RIGHT(FX_BOOL bShift,FX_BOOL bCtrl)
-{
- OnVK(GetCount()-1, bShift, bCtrl);
-}
-
-void CFX_ListCtrl::OnVK_HOME(FX_BOOL bShift,FX_BOOL bCtrl)
-{
- OnVK(0, bShift, bCtrl);
-}
-
-void CFX_ListCtrl::OnVK_END(FX_BOOL bShift,FX_BOOL bCtrl)
-{
- OnVK(GetCount()-1, bShift, bCtrl);
-}
-
-FX_BOOL CFX_ListCtrl::OnChar(FX_WORD nChar,FX_BOOL bShift,FX_BOOL bCtrl)
-{
- FX_INT32 nIndex = GetLastSelected();
- FX_INT32 nFindIndex = FindNext(nIndex,nChar);
-
- if (nFindIndex != nIndex)
- {
- OnVK(nFindIndex, bShift, bCtrl);
- return TRUE;
- }
- return FALSE;
-}
-
-/* -------- inner methods ------- */
-
-void CFX_ListCtrl::SetPlateRect(const CPDF_Rect & rect)
-{
- CFX_ListContainer::SetPlateRect(rect);
- m_ptScrollPos.x = rect.left;
- SetScrollPos(CPDF_Point(rect.left,rect.top));
- ReArrange(0);
- InvalidateItem(-1);
-}
-
-CPDF_Rect CFX_ListCtrl::GetItemRect(FX_INT32 nIndex) const
-{
- return InToOut(CFX_List::GetItemRect(nIndex));
-}
-
-void CFX_ListCtrl::AddString(FX_LPCWSTR string)
-{
- AddItem(string);
- ReArrange(GetCount() - 1);
-}
-
-void CFX_ListCtrl::SetMultipleSelect(FX_INT32 nItemIndex, FX_BOOL bSelected)
-{
- if (!IsValid(nItemIndex)) return;
-
- if (bSelected != this->IsItemSelected(nItemIndex))
- {
- if (bSelected)
- {
- SetItemSelect(nItemIndex,TRUE);
- InvalidateItem(nItemIndex);
- }
- else
- {
- SetItemSelect(nItemIndex,FALSE);
- InvalidateItem(nItemIndex);
- }
- }
-}
-
-void CFX_ListCtrl::SetSingleSelect(FX_INT32 nItemIndex)
-{
- if (!IsValid(nItemIndex)) return;
-
- if (m_nSelItem != nItemIndex)
- {
- if (m_nSelItem >= 0)
- {
- SetItemSelect(m_nSelItem,FALSE);
- InvalidateItem(m_nSelItem);
- }
-
- SetItemSelect(nItemIndex,TRUE);
- InvalidateItem(nItemIndex);
- m_nSelItem = nItemIndex;
- }
-}
-
-void CFX_ListCtrl::SetCaret(FX_INT32 nItemIndex)
-{
- if (!IsValid(nItemIndex)) return;
-
- if (this->IsMultipleSel())
- {
- FX_INT32 nOldIndex = m_nCaretIndex;
-
- if (nOldIndex != nItemIndex)
- {
- m_nCaretIndex = nItemIndex;
-
- SetItemCaret(nOldIndex, FALSE);
- SetItemCaret(nItemIndex,TRUE);
-
- InvalidateItem(nOldIndex);
- InvalidateItem(nItemIndex);
- }
- }
-}
-
-void CFX_ListCtrl::InvalidateItem(FX_INT32 nItemIndex)
-{
- if (m_pNotify)
- {
- if (nItemIndex == -1)
- {
- if (!m_bNotifyFlag)
- {
- m_bNotifyFlag = TRUE;
- CPDF_Rect rcRefresh = GetPlateRect();
- m_pNotify->IOnInvalidateRect(&rcRefresh);
- m_bNotifyFlag = FALSE;
- }
- }
- else
- {
- if (!m_bNotifyFlag)
- {
- m_bNotifyFlag = TRUE;
- CPDF_Rect rcRefresh = GetItemRect(nItemIndex);
- rcRefresh.left -= 1.0f;
- rcRefresh.right += 1.0f;
- rcRefresh.bottom -= 1.0f;
- rcRefresh.top += 1.0f;
-
- m_pNotify->IOnInvalidateRect(&rcRefresh);
- m_bNotifyFlag = FALSE;
- }
- }
- }
-}
-
-void CFX_ListCtrl::SelectItems()
-{
- for (FX_INT32 i=0,sz=m_aSelItems.GetCount(); i<sz; i++)
- {
- FX_INT32 nItemIndex = m_aSelItems.GetItemIndex(i);
- FX_INT32 nState = m_aSelItems.GetState(i);
-
- switch(nState)
- {
- case 1:
- SetMultipleSelect(nItemIndex, TRUE);
- break;
- case -1:
- SetMultipleSelect(nItemIndex, FALSE);
- break;
- }
- }
-
- m_aSelItems.Done();
-}
-
-void CFX_ListCtrl::Select(FX_INT32 nItemIndex)
-{
- if (!IsValid(nItemIndex)) return;
-
- if (this->IsMultipleSel())
- {
- m_aSelItems.Add(nItemIndex);
- SelectItems();
- }
- else
- SetSingleSelect(nItemIndex);
-}
-
-FX_BOOL CFX_ListCtrl::IsItemVisible(FX_INT32 nItemIndex) const
-{
- CPDF_Rect rcPlate = this->GetPlateRect();
- CPDF_Rect rcItem = this->GetItemRect(nItemIndex);
-
- return rcItem.bottom >= rcPlate.bottom && rcItem.top <= rcPlate.top;
-}
-
-void CFX_ListCtrl::ScrollToListItem(FX_INT32 nItemIndex)
-{
- if (!IsValid(nItemIndex)) return;
-
- CPDF_Rect rcPlate = this->GetPlateRect();
- CPDF_Rect rcItem = CFX_List::GetItemRect(nItemIndex);
- CPDF_Rect rcItemCtrl = GetItemRect(nItemIndex);
-
- if (FX_EDIT_IsFloatSmaller(rcItemCtrl.bottom, rcPlate.bottom))
- {
- if (FX_EDIT_IsFloatSmaller(rcItemCtrl.top, rcPlate.top))
- {
- SetScrollPosY(rcItem.bottom + rcPlate.Height());
- }
- }
- else if (FX_EDIT_IsFloatBigger(rcItemCtrl.top, rcPlate.top))
- {
- if (FX_EDIT_IsFloatBigger(rcItemCtrl.bottom, rcPlate.bottom))
- {
- SetScrollPosY(rcItem.top);
- }
- }
-}
-
-void CFX_ListCtrl::SetScrollInfo()
-{
- if (m_pNotify)
- {
- CPDF_Rect rcPlate = GetPlateRect();
- CPDF_Rect rcContent = CFX_List::GetContentRect();
-
- if (!m_bNotifyFlag)
- {
- m_bNotifyFlag = TRUE;
- m_pNotify->IOnSetScrollInfoY(rcPlate.bottom, rcPlate.top,
- rcContent.bottom, rcContent.top, GetFirstHeight(), rcPlate.Height());
- m_bNotifyFlag = FALSE;
- }
- }
-}
-
-void CFX_ListCtrl::SetScrollPos(const CPDF_Point & point)
-{
- SetScrollPosY(point.y);
-}
-
-void CFX_ListCtrl::SetScrollPosY(FX_FLOAT fy)
-{
- if (!FX_EDIT_IsFloatEqual(m_ptScrollPos.y,fy))
- {
- CPDF_Rect rcPlate = this->GetPlateRect();
- CPDF_Rect rcContent = CFX_List::GetContentRect();
-
- if (rcPlate.Height() > rcContent.Height())
- {
- fy = rcPlate.top;
- }
- else
- {
- if (FX_EDIT_IsFloatSmaller(fy - rcPlate.Height(), rcContent.bottom))
- {
- fy = rcContent.bottom + rcPlate.Height();
- }
- else if (FX_EDIT_IsFloatBigger(fy, rcContent.top))
- {
- fy = rcContent.top;
- }
- }
-
- m_ptScrollPos.y = fy;
- InvalidateItem(-1);
-
- if (m_pNotify)
- {
- if (!m_bNotifyFlag)
- {
- m_bNotifyFlag = TRUE;
- m_pNotify->IOnSetScrollPosY(fy);
- m_bNotifyFlag = FALSE;
- }
- }
- }
-}
-
-CPDF_Rect CFX_ListCtrl::GetContentRect() const
-{
- return InToOut(CFX_List::GetContentRect());
-}
-
-void CFX_ListCtrl::ReArrange(FX_INT32 nItemIndex)
-{
- CFX_List::ReArrange(nItemIndex);
- SetScrollInfo();
-}
-
-void CFX_ListCtrl::SetTopItem(FX_INT32 nIndex)
-{
- if (IsValid(nIndex))
- {
- this->GetPlateRect();
- CPDF_Rect rcItem = CFX_List::GetItemRect(nIndex);
- SetScrollPosY(rcItem.top);
- }
-}
-
-FX_INT32 CFX_ListCtrl::GetTopItem() const
-{
- FX_INT32 nItemIndex = this->GetItemIndex(this->GetBTPoint());
-
- if (!IsItemVisible(nItemIndex) && IsItemVisible(nItemIndex + 1))
- nItemIndex += 1;
-
- return nItemIndex;
-}
-
-void CFX_ListCtrl::Empty()
-{
- CFX_List::Empty();
- InvalidateItem(-1);
-}
-
-void CFX_ListCtrl::Cancel()
-{
- m_aSelItems.DeselectAll();
-}
-
-FX_INT32 CFX_ListCtrl::GetItemIndex(const CPDF_Point & point) const
-{
- return CFX_List::GetItemIndex(OutToIn(point));
-}
-
-CFX_WideString CFX_ListCtrl::GetText() const
-{
- if (this->IsMultipleSel())
- return this->GetItemText(this->m_nCaretIndex);
- else
- return this->GetItemText(this->m_nSelItem);
-}
-
+// 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
+
+#include "../../include/fxedit/fxet_stub.h"
+#include "../../include/fxedit/fxet_edit.h"
+#include "../../include/fxedit/fxet_list.h"
+
+/* ------------------------------- CFX_ListItem ---------------------------------- */
+
+CFX_ListItem::CFX_ListItem() : m_pEdit(NULL),
+ m_bSelected(FALSE),
+ m_bCaret(FALSE),
+ m_rcListItem(0.0f,0.0f,0.0f,0.0f)
+{
+ m_pEdit = IFX_Edit::NewEdit();
+ ASSERT(m_pEdit != NULL);
+
+ m_pEdit->SetAlignmentV(1);
+ m_pEdit->Initialize();
+}
+
+CFX_ListItem::~CFX_ListItem()
+{
+ IFX_Edit::DelEdit(m_pEdit);
+}
+
+void CFX_ListItem::SetFontMap(IFX_Edit_FontMap * pFontMap)
+{
+ if (m_pEdit)
+ m_pEdit->SetFontMap(pFontMap);
+}
+
+IFX_Edit* CFX_ListItem::GetEdit() const
+{
+ return m_pEdit;
+}
+
+IFX_Edit_Iterator* CFX_ListItem::GetIterator() const
+{
+ if (m_pEdit)
+ return m_pEdit->GetIterator();
+
+ return NULL;
+}
+
+void CFX_ListItem::SetRect(const CLST_Rect & rect)
+{
+ m_rcListItem = rect;
+}
+
+CLST_Rect CFX_ListItem::GetRect() const
+{
+ return m_rcListItem;
+}
+
+FX_BOOL CFX_ListItem::IsSelected() const
+{
+ return m_bSelected;
+}
+
+void CFX_ListItem::SetSelect(FX_BOOL bSelected)
+{
+ m_bSelected = bSelected;
+}
+
+FX_BOOL CFX_ListItem::IsCaret() const
+{
+ return m_bCaret;
+}
+
+void CFX_ListItem::SetCaret(FX_BOOL bCaret)
+{
+ m_bCaret = bCaret;
+}
+
+void CFX_ListItem::SetText(FX_LPCWSTR text)
+{
+ if (m_pEdit)
+ m_pEdit->SetText(text);
+}
+
+void CFX_ListItem::SetFontSize(FX_FLOAT fFontSize)
+{
+ if (m_pEdit)
+ m_pEdit->SetFontSize(fFontSize);
+}
+
+FX_FLOAT CFX_ListItem::GetItemHeight() const
+{
+ if (m_pEdit)
+ return m_pEdit->GetContentRect().Height();
+
+ return 0.0f;
+}
+
+FX_WORD CFX_ListItem::GetFirstChar() const
+{
+ CPVT_Word word;
+
+ if (IFX_Edit_Iterator* pIterator = GetIterator())
+ {
+ pIterator->SetAt(1);
+ pIterator->GetWord(word);
+ }
+
+ return word.Word;
+}
+
+CFX_WideString CFX_ListItem::GetText() const
+{
+ if (m_pEdit)
+ return m_pEdit->GetText();
+
+ return L"";
+}
+
+/* ------------------------------------ CFX_List --------------------------------- */
+
+CFX_List::CFX_List() : m_pFontMap(NULL), m_fFontSize(0.0f), m_bMultiple(FALSE)
+{
+}
+
+CFX_List::~CFX_List()
+{
+ Empty();
+}
+
+void CFX_List::Empty()
+{
+ for (FX_INT32 i=0,sz=m_aListItems.GetSize(); i<sz; i++)
+ delete m_aListItems.GetAt(i);
+
+ m_aListItems.RemoveAll();
+}
+
+void CFX_List::SetFontMap(IFX_Edit_FontMap * pFontMap)
+{
+ m_pFontMap = pFontMap;
+}
+
+void CFX_List::SetFontSize(FX_FLOAT fFontSize)
+{
+ m_fFontSize = fFontSize;
+}
+
+void CFX_List::AddItem(FX_LPCWSTR str)
+{
+ if (CFX_ListItem * pListItem = new CFX_ListItem())
+ {
+ pListItem->SetFontMap(m_pFontMap);
+ pListItem->SetFontSize(m_fFontSize);
+ pListItem->SetText(str);
+ m_aListItems.Add(pListItem);
+ }
+}
+
+void CFX_List::ReArrange(FX_INT32 nItemIndex)
+{
+ FX_FLOAT fPosY = 0.0f;
+
+ if (CFX_ListItem * pPrevItem = m_aListItems.GetAt(nItemIndex - 1))
+ fPosY = pPrevItem->GetRect().bottom;
+
+ for (FX_INT32 i=nItemIndex,sz=m_aListItems.GetSize(); i<sz; i++)
+ {
+ if (CFX_ListItem * pListItem = m_aListItems.GetAt(i))
+ {
+ FX_FLOAT fListItemHeight = pListItem->GetItemHeight();
+ pListItem->SetRect(CLST_Rect(0.0f,fPosY,0.0f,fPosY + fListItemHeight));
+ fPosY += fListItemHeight;
+ }
+ }
+
+ SetContentRect(CLST_Rect(0.0f,0.0f,0.0f,fPosY));
+}
+
+IFX_Edit * CFX_List::GetItemEdit(FX_INT32 nIndex) const
+{
+ if (CFX_ListItem * pListItem = m_aListItems.GetAt(nIndex))
+ {
+ return pListItem->GetEdit();
+ }
+
+ return NULL;
+}
+
+FX_INT32 CFX_List::GetCount() const
+{
+ return m_aListItems.GetSize();
+}
+
+CPDF_Rect CFX_List::GetPlateRect() const
+{
+ return CFX_ListContainer::GetPlateRect();
+}
+
+CPDF_Rect CFX_List::GetContentRect() const
+{
+ return InnerToOuter(CFX_ListContainer::GetContentRect());
+}
+
+FX_FLOAT CFX_List::GetFontSize() const
+{
+ return m_fFontSize;
+}
+
+FX_INT32 CFX_List::GetItemIndex(const CPDF_Point & point) const
+{
+ CPDF_Point pt = OuterToInner(point);
+
+ FX_BOOL bFirst = TRUE;
+ FX_BOOL bLast = TRUE;
+
+ for (FX_INT32 i=0,sz=m_aListItems.GetSize(); i<sz; i++)
+ {
+ if (CFX_ListItem * pListItem = m_aListItems.GetAt(i))
+ {
+ CLST_Rect rcListItem = pListItem->GetRect();
+
+ if (FX_EDIT_IsFloatBigger(pt.y, rcListItem.top))
+ {
+ bFirst = FALSE;
+ }
+
+ if (FX_EDIT_IsFloatSmaller(pt.y, rcListItem.bottom))
+ {
+ bLast = FALSE;
+ }
+
+ if (pt.y >= rcListItem.top && pt.y < rcListItem.bottom)
+ {
+ return i;
+ }
+ }
+ }
+
+ if (bFirst) return 0;
+ if (bLast) return m_aListItems.GetSize()-1;
+
+ return -1;
+}
+
+FX_FLOAT CFX_List::GetFirstHeight() const
+{
+ if (CFX_ListItem * pListItem = m_aListItems.GetAt(0))
+ {
+ return pListItem->GetItemHeight();
+ }
+
+ return 1.0f;
+}
+
+FX_INT32 CFX_List::GetFirstSelected() const
+{
+ for (FX_INT32 i=0,sz=m_aListItems.GetSize(); i<sz; i++)
+ {
+ if (CFX_ListItem * pListItem = m_aListItems.GetAt(i))
+ {
+ if (pListItem->IsSelected())
+ return i;
+ }
+ }
+ return -1;
+}
+
+FX_INT32 CFX_List::GetLastSelected() const
+{
+ for (FX_INT32 i=m_aListItems.GetSize()-1; i>=0; i--)
+ {
+ if (CFX_ListItem * pListItem = m_aListItems.GetAt(i))
+ {
+ if (pListItem->IsSelected())
+ return i;
+ }
+ }
+ return -1;
+}
+
+FX_WCHAR CFX_List::Toupper(FX_WCHAR c) const
+{
+ if ( (c >= 'a') && (c <= 'z') )
+ c = c - ('a' - 'A');
+ return c;
+}
+
+FX_INT32 CFX_List::FindNext(FX_INT32 nIndex,FX_WCHAR nChar) const
+{
+ FX_INT32 nCircleIndex = nIndex;
+
+ for (FX_INT32 i=0,sz=m_aListItems.GetSize(); i<sz; i++)
+ {
+ nCircleIndex ++;
+ if (nCircleIndex >= sz) nCircleIndex = 0;
+
+ if (CFX_ListItem * pListItem = m_aListItems.GetAt(nCircleIndex))
+ {
+ if (Toupper(pListItem->GetFirstChar()) == Toupper(nChar))
+ return nCircleIndex;
+ }
+ }
+
+ return nCircleIndex;
+}
+
+CPDF_Rect CFX_List::GetItemRect(FX_INT32 nIndex) const
+{
+ if (CFX_ListItem * pListItem = m_aListItems.GetAt(nIndex))
+ {
+ CPDF_Rect rcItem = pListItem->GetRect();
+ rcItem.left = 0.0f;
+ rcItem.right = GetPlateRect().Width();
+ return InnerToOuter(rcItem);
+ }
+
+ return CPDF_Rect();
+}
+
+FX_BOOL CFX_List::IsItemSelected(FX_INT32 nIndex) const
+{
+ if (CFX_ListItem * pListItem = m_aListItems.GetAt(nIndex))
+ {
+ return pListItem->IsSelected();
+ }
+
+ return FALSE;
+}
+
+void CFX_List::SetItemSelect(FX_INT32 nItemIndex, FX_BOOL bSelected)
+{
+ if (CFX_ListItem * pListItem = m_aListItems.GetAt(nItemIndex))
+ {
+ pListItem->SetSelect(bSelected);
+ }
+}
+
+void CFX_List::SetItemCaret(FX_INT32 nItemIndex, FX_BOOL bCaret)
+{
+ if (CFX_ListItem * pListItem = m_aListItems.GetAt(nItemIndex))
+ {
+ pListItem->SetCaret(bCaret);
+ }
+}
+
+void CFX_List::SetMultipleSel(FX_BOOL bMultiple)
+{
+ m_bMultiple = bMultiple;
+}
+
+FX_BOOL CFX_List::IsMultipleSel() const
+{
+ return m_bMultiple;
+}
+
+FX_BOOL CFX_List::IsValid(FX_INT32 nItemIndex) const
+{
+ return nItemIndex >= 0 && nItemIndex < m_aListItems.GetSize();
+}
+
+CFX_WideString CFX_List::GetItemText(FX_INT32 nIndex) const
+{
+ if (CFX_ListItem * pListItem = m_aListItems.GetAt(nIndex))
+ {
+ return pListItem->GetText();
+ }
+
+ return L"";
+}
+
+/* ------------------------------------ CPLST_Select ---------------------------------- */
+
+CPLST_Select::CPLST_Select()
+{
+}
+
+CPLST_Select::~CPLST_Select()
+{
+ for (FX_INT32 i=0,sz=m_aItems.GetSize(); i<sz; i++)
+ delete m_aItems.GetAt(i);
+
+ m_aItems.RemoveAll();
+}
+
+void CPLST_Select::Add(FX_INT32 nItemIndex)
+{
+ FX_INT32 nIndex = Find(nItemIndex);
+
+ if (nIndex < 0)
+ m_aItems.Add(new CPLST_Select_Item(nItemIndex,1));
+ else
+ {
+ if (CPLST_Select_Item * pItem = m_aItems.GetAt(nIndex))
+ {
+ pItem->nState = 1;
+ }
+ }
+}
+
+void CPLST_Select::Add(FX_INT32 nBeginIndex, FX_INT32 nEndIndex)
+{
+ if (nBeginIndex > nEndIndex)
+ {
+ FX_INT32 nTemp = nEndIndex;
+ nEndIndex = nBeginIndex;
+ nBeginIndex = nTemp;
+ }
+
+ for (FX_INT32 i=nBeginIndex; i<=nEndIndex; i++) Add(i);
+}
+
+void CPLST_Select::Sub(FX_INT32 nItemIndex)
+{
+ for (FX_INT32 i=m_aItems.GetSize()-1; i>=0; i--)
+ {
+ if (CPLST_Select_Item * pItem = m_aItems.GetAt(i))
+ if (pItem->nItemIndex == nItemIndex)
+ pItem->nState = -1;
+ }
+}
+
+void CPLST_Select::Sub(FX_INT32 nBeginIndex, FX_INT32 nEndIndex)
+{
+ if (nBeginIndex > nEndIndex)
+ {
+ FX_INT32 nTemp = nEndIndex;
+ nEndIndex = nBeginIndex;
+ nBeginIndex = nTemp;
+ }
+
+ for (FX_INT32 i=nBeginIndex; i<=nEndIndex; i++) Sub(i);
+}
+
+FX_INT32 CPLST_Select::Find(FX_INT32 nItemIndex) const
+{
+ for (FX_INT32 i=0,sz=m_aItems.GetSize(); i<sz; i++)
+ {
+ if (CPLST_Select_Item * pItem = m_aItems.GetAt(i))
+ {
+ if (pItem->nItemIndex == nItemIndex)
+ return i;
+ }
+ }
+
+ return -1;
+}
+
+FX_BOOL CPLST_Select::IsExist(FX_INT32 nItemIndex) const
+{
+ return Find(nItemIndex) >= 0;
+}
+
+FX_INT32 CPLST_Select::GetCount() const
+{
+ return m_aItems.GetSize();
+}
+
+FX_INT32 CPLST_Select::GetItemIndex(FX_INT32 nIndex) const
+{
+ if (nIndex >= 0 && nIndex < m_aItems.GetSize())
+ if (CPLST_Select_Item * pItem = m_aItems.GetAt(nIndex))
+ return pItem->nItemIndex;
+
+ return -1;
+}
+
+FX_INT32 CPLST_Select::GetState(FX_INT32 nIndex) const
+{
+ if (nIndex >= 0 && nIndex < m_aItems.GetSize())
+ if (CPLST_Select_Item * pItem = m_aItems.GetAt(nIndex))
+ return pItem->nState;
+
+ return 0;
+}
+
+void CPLST_Select::DeselectAll()
+{
+ for (FX_INT32 i=0,sz=m_aItems.GetSize(); i<sz; i++)
+ {
+ if (CPLST_Select_Item * pItem = m_aItems.GetAt(i))
+ {
+ pItem->nState = -1;
+ }
+ }
+}
+
+void CPLST_Select::Done()
+{
+ for (FX_INT32 i=m_aItems.GetSize()-1; i>=0; i--)
+ {
+ if (CPLST_Select_Item * pItem = m_aItems.GetAt(i))
+ {
+ if (pItem->nState == -1)
+ {
+ delete pItem;
+ m_aItems.RemoveAt(i);
+ }
+ else
+ {
+ pItem->nState = 0;
+ }
+ }
+ }
+}
+
+/* ------------------------------------ CFX_ListCtrl --------------------------------- */
+
+CFX_ListCtrl::CFX_ListCtrl() : m_pNotify(NULL),
+ m_ptScrollPos(0.0f,0.0f),
+ m_nSelItem(-1),
+ m_nFootIndex(-1),
+ m_bCtrlSel(FALSE),
+ m_nCaretIndex(-1),
+ m_bNotifyFlag(FALSE)
+{
+}
+
+CFX_ListCtrl::~CFX_ListCtrl()
+{
+}
+
+void CFX_ListCtrl::SetNotify(IFX_List_Notify * pNotify)
+{
+ m_pNotify = pNotify;
+}
+
+CPDF_Point CFX_ListCtrl::InToOut(const CPDF_Point & point) const
+{
+ CPDF_Rect rcPlate = GetPlateRect();
+
+ return CPDF_Point(point.x - (m_ptScrollPos.x - rcPlate.left),
+ point.y - (m_ptScrollPos.y - rcPlate.top));
+}
+
+CPDF_Point CFX_ListCtrl::OutToIn(const CPDF_Point & point) const
+{
+ CPDF_Rect rcPlate = GetPlateRect();
+
+ return CPDF_Point(point.x + (m_ptScrollPos.x - rcPlate.left),
+ point.y + (m_ptScrollPos.y - rcPlate.top));
+}
+
+CPDF_Rect CFX_ListCtrl::InToOut(const CPDF_Rect & rect) const
+{
+ CPDF_Point ptLeftBottom = InToOut(CPDF_Point(rect.left,rect.bottom));
+ CPDF_Point ptRightTop = InToOut(CPDF_Point(rect.right,rect.top));
+
+ return CPDF_Rect(ptLeftBottom.x,ptLeftBottom.y,ptRightTop.x,ptRightTop.y);
+}
+
+CPDF_Rect CFX_ListCtrl::OutToIn(const CPDF_Rect & rect) const
+{
+ CPDF_Point ptLeftBottom = OutToIn(CPDF_Point(rect.left,rect.bottom));
+ CPDF_Point ptRightTop = OutToIn(CPDF_Point(rect.right,rect.top));
+
+ return CPDF_Rect(ptLeftBottom.x,ptLeftBottom.y,ptRightTop.x,ptRightTop.y);
+}
+
+void CFX_ListCtrl::OnMouseDown(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl)
+{
+ FX_INT32 nHitIndex = this->GetItemIndex(point);
+
+ if (IsMultipleSel())
+ {
+ if (bCtrl)
+ {
+ if (IsItemSelected(nHitIndex))
+ {
+ m_aSelItems.Sub(nHitIndex);
+ SelectItems();
+ m_bCtrlSel = FALSE;
+ }
+ else
+ {
+ m_aSelItems.Add(nHitIndex);
+ SelectItems();
+ m_bCtrlSel = TRUE;
+ }
+
+ m_nFootIndex = nHitIndex;
+ }
+ else if (bShift)
+ {
+ m_aSelItems.DeselectAll();
+ m_aSelItems.Add(m_nFootIndex,nHitIndex);
+ SelectItems();
+ }
+ else
+ {
+ m_aSelItems.DeselectAll();
+ m_aSelItems.Add(nHitIndex);
+ SelectItems();
+
+ m_nFootIndex = nHitIndex;
+ }
+
+ SetCaret(nHitIndex);
+ }
+ else
+ {
+ SetSingleSelect(nHitIndex);
+ }
+
+ if (!this->IsItemVisible(nHitIndex))
+ this->ScrollToListItem(nHitIndex);
+}
+
+void CFX_ListCtrl::OnMouseMove(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl)
+{
+ FX_INT32 nHitIndex = this->GetItemIndex(point);
+
+ if (IsMultipleSel())
+ {
+ if (bCtrl)
+ {
+ if (m_bCtrlSel)
+ m_aSelItems.Add(m_nFootIndex,nHitIndex);
+ else
+ m_aSelItems.Sub(m_nFootIndex,nHitIndex);
+
+ SelectItems();
+ }
+ else
+ {
+ m_aSelItems.DeselectAll();
+ m_aSelItems.Add(m_nFootIndex,nHitIndex);
+ SelectItems();
+ }
+
+ SetCaret(nHitIndex);
+ }
+ else
+ {
+ SetSingleSelect(nHitIndex);
+ }
+
+ if (!this->IsItemVisible(nHitIndex))
+ this->ScrollToListItem(nHitIndex);
+}
+
+void CFX_ListCtrl::OnVK(FX_INT32 nItemIndex,FX_BOOL bShift,FX_BOOL bCtrl)
+{
+ if (IsMultipleSel())
+ {
+ if (nItemIndex >= 0 && nItemIndex < GetCount())
+ {
+ if (bCtrl)
+ {
+ }
+ else if (bShift)
+ {
+ m_aSelItems.DeselectAll();
+ m_aSelItems.Add(m_nFootIndex,nItemIndex);
+ SelectItems();
+ }
+ else
+ {
+ m_aSelItems.DeselectAll();
+ m_aSelItems.Add(nItemIndex);
+ SelectItems();
+ m_nFootIndex = nItemIndex;
+ }
+
+ SetCaret(nItemIndex);
+ }
+ }
+ else
+ {
+ SetSingleSelect(nItemIndex);
+ }
+
+ if (!this->IsItemVisible(nItemIndex))
+ this->ScrollToListItem(nItemIndex);
+}
+
+void CFX_ListCtrl::OnVK_UP(FX_BOOL bShift,FX_BOOL bCtrl)
+{
+ OnVK(IsMultipleSel() ? GetCaret()-1 : GetSelect()-1, bShift, bCtrl);
+}
+
+void CFX_ListCtrl::OnVK_DOWN(FX_BOOL bShift,FX_BOOL bCtrl)
+{
+ OnVK(IsMultipleSel() ? GetCaret()+1 : GetSelect()+1, bShift, bCtrl);
+}
+
+void CFX_ListCtrl::OnVK_LEFT(FX_BOOL bShift,FX_BOOL bCtrl)
+{
+ OnVK(0, bShift, bCtrl);
+}
+
+void CFX_ListCtrl::OnVK_RIGHT(FX_BOOL bShift,FX_BOOL bCtrl)
+{
+ OnVK(GetCount()-1, bShift, bCtrl);
+}
+
+void CFX_ListCtrl::OnVK_HOME(FX_BOOL bShift,FX_BOOL bCtrl)
+{
+ OnVK(0, bShift, bCtrl);
+}
+
+void CFX_ListCtrl::OnVK_END(FX_BOOL bShift,FX_BOOL bCtrl)
+{
+ OnVK(GetCount()-1, bShift, bCtrl);
+}
+
+FX_BOOL CFX_ListCtrl::OnChar(FX_WORD nChar,FX_BOOL bShift,FX_BOOL bCtrl)
+{
+ FX_INT32 nIndex = GetLastSelected();
+ FX_INT32 nFindIndex = FindNext(nIndex,nChar);
+
+ if (nFindIndex != nIndex)
+ {
+ OnVK(nFindIndex, bShift, bCtrl);
+ return TRUE;
+ }
+ return FALSE;
+}
+
+/* -------- inner methods ------- */
+
+void CFX_ListCtrl::SetPlateRect(const CPDF_Rect & rect)
+{
+ CFX_ListContainer::SetPlateRect(rect);
+ m_ptScrollPos.x = rect.left;
+ SetScrollPos(CPDF_Point(rect.left,rect.top));
+ ReArrange(0);
+ InvalidateItem(-1);
+}
+
+CPDF_Rect CFX_ListCtrl::GetItemRect(FX_INT32 nIndex) const
+{
+ return InToOut(CFX_List::GetItemRect(nIndex));
+}
+
+void CFX_ListCtrl::AddString(FX_LPCWSTR string)
+{
+ AddItem(string);
+ ReArrange(GetCount() - 1);
+}
+
+void CFX_ListCtrl::SetMultipleSelect(FX_INT32 nItemIndex, FX_BOOL bSelected)
+{
+ if (!IsValid(nItemIndex)) return;
+
+ if (bSelected != this->IsItemSelected(nItemIndex))
+ {
+ if (bSelected)
+ {
+ SetItemSelect(nItemIndex,TRUE);
+ InvalidateItem(nItemIndex);
+ }
+ else
+ {
+ SetItemSelect(nItemIndex,FALSE);
+ InvalidateItem(nItemIndex);
+ }
+ }
+}
+
+void CFX_ListCtrl::SetSingleSelect(FX_INT32 nItemIndex)
+{
+ if (!IsValid(nItemIndex)) return;
+
+ if (m_nSelItem != nItemIndex)
+ {
+ if (m_nSelItem >= 0)
+ {
+ SetItemSelect(m_nSelItem,FALSE);
+ InvalidateItem(m_nSelItem);
+ }
+
+ SetItemSelect(nItemIndex,TRUE);
+ InvalidateItem(nItemIndex);
+ m_nSelItem = nItemIndex;
+ }
+}
+
+void CFX_ListCtrl::SetCaret(FX_INT32 nItemIndex)
+{
+ if (!IsValid(nItemIndex)) return;
+
+ if (this->IsMultipleSel())
+ {
+ FX_INT32 nOldIndex = m_nCaretIndex;
+
+ if (nOldIndex != nItemIndex)
+ {
+ m_nCaretIndex = nItemIndex;
+
+ SetItemCaret(nOldIndex, FALSE);
+ SetItemCaret(nItemIndex,TRUE);
+
+ InvalidateItem(nOldIndex);
+ InvalidateItem(nItemIndex);
+ }
+ }
+}
+
+void CFX_ListCtrl::InvalidateItem(FX_INT32 nItemIndex)
+{
+ if (m_pNotify)
+ {
+ if (nItemIndex == -1)
+ {
+ if (!m_bNotifyFlag)
+ {
+ m_bNotifyFlag = TRUE;
+ CPDF_Rect rcRefresh = GetPlateRect();
+ m_pNotify->IOnInvalidateRect(&rcRefresh);
+ m_bNotifyFlag = FALSE;
+ }
+ }
+ else
+ {
+ if (!m_bNotifyFlag)
+ {
+ m_bNotifyFlag = TRUE;
+ CPDF_Rect rcRefresh = GetItemRect(nItemIndex);
+ rcRefresh.left -= 1.0f;
+ rcRefresh.right += 1.0f;
+ rcRefresh.bottom -= 1.0f;
+ rcRefresh.top += 1.0f;
+
+ m_pNotify->IOnInvalidateRect(&rcRefresh);
+ m_bNotifyFlag = FALSE;
+ }
+ }
+ }
+}
+
+void CFX_ListCtrl::SelectItems()
+{
+ for (FX_INT32 i=0,sz=m_aSelItems.GetCount(); i<sz; i++)
+ {
+ FX_INT32 nItemIndex = m_aSelItems.GetItemIndex(i);
+ FX_INT32 nState = m_aSelItems.GetState(i);
+
+ switch(nState)
+ {
+ case 1:
+ SetMultipleSelect(nItemIndex, TRUE);
+ break;
+ case -1:
+ SetMultipleSelect(nItemIndex, FALSE);
+ break;
+ }
+ }
+
+ m_aSelItems.Done();
+}
+
+void CFX_ListCtrl::Select(FX_INT32 nItemIndex)
+{
+ if (!IsValid(nItemIndex)) return;
+
+ if (this->IsMultipleSel())
+ {
+ m_aSelItems.Add(nItemIndex);
+ SelectItems();
+ }
+ else
+ SetSingleSelect(nItemIndex);
+}
+
+FX_BOOL CFX_ListCtrl::IsItemVisible(FX_INT32 nItemIndex) const
+{
+ CPDF_Rect rcPlate = this->GetPlateRect();
+ CPDF_Rect rcItem = this->GetItemRect(nItemIndex);
+
+ return rcItem.bottom >= rcPlate.bottom && rcItem.top <= rcPlate.top;
+}
+
+void CFX_ListCtrl::ScrollToListItem(FX_INT32 nItemIndex)
+{
+ if (!IsValid(nItemIndex)) return;
+
+ CPDF_Rect rcPlate = this->GetPlateRect();
+ CPDF_Rect rcItem = CFX_List::GetItemRect(nItemIndex);
+ CPDF_Rect rcItemCtrl = GetItemRect(nItemIndex);
+
+ if (FX_EDIT_IsFloatSmaller(rcItemCtrl.bottom, rcPlate.bottom))
+ {
+ if (FX_EDIT_IsFloatSmaller(rcItemCtrl.top, rcPlate.top))
+ {
+ SetScrollPosY(rcItem.bottom + rcPlate.Height());
+ }
+ }
+ else if (FX_EDIT_IsFloatBigger(rcItemCtrl.top, rcPlate.top))
+ {
+ if (FX_EDIT_IsFloatBigger(rcItemCtrl.bottom, rcPlate.bottom))
+ {
+ SetScrollPosY(rcItem.top);
+ }
+ }
+}
+
+void CFX_ListCtrl::SetScrollInfo()
+{
+ if (m_pNotify)
+ {
+ CPDF_Rect rcPlate = GetPlateRect();
+ CPDF_Rect rcContent = CFX_List::GetContentRect();
+
+ if (!m_bNotifyFlag)
+ {
+ m_bNotifyFlag = TRUE;
+ m_pNotify->IOnSetScrollInfoY(rcPlate.bottom, rcPlate.top,
+ rcContent.bottom, rcContent.top, GetFirstHeight(), rcPlate.Height());
+ m_bNotifyFlag = FALSE;
+ }
+ }
+}
+
+void CFX_ListCtrl::SetScrollPos(const CPDF_Point & point)
+{
+ SetScrollPosY(point.y);
+}
+
+void CFX_ListCtrl::SetScrollPosY(FX_FLOAT fy)
+{
+ if (!FX_EDIT_IsFloatEqual(m_ptScrollPos.y,fy))
+ {
+ CPDF_Rect rcPlate = this->GetPlateRect();
+ CPDF_Rect rcContent = CFX_List::GetContentRect();
+
+ if (rcPlate.Height() > rcContent.Height())
+ {
+ fy = rcPlate.top;
+ }
+ else
+ {
+ if (FX_EDIT_IsFloatSmaller(fy - rcPlate.Height(), rcContent.bottom))
+ {
+ fy = rcContent.bottom + rcPlate.Height();
+ }
+ else if (FX_EDIT_IsFloatBigger(fy, rcContent.top))
+ {
+ fy = rcContent.top;
+ }
+ }
+
+ m_ptScrollPos.y = fy;
+ InvalidateItem(-1);
+
+ if (m_pNotify)
+ {
+ if (!m_bNotifyFlag)
+ {
+ m_bNotifyFlag = TRUE;
+ m_pNotify->IOnSetScrollPosY(fy);
+ m_bNotifyFlag = FALSE;
+ }
+ }
+ }
+}
+
+CPDF_Rect CFX_ListCtrl::GetContentRect() const
+{
+ return InToOut(CFX_List::GetContentRect());
+}
+
+void CFX_ListCtrl::ReArrange(FX_INT32 nItemIndex)
+{
+ CFX_List::ReArrange(nItemIndex);
+ SetScrollInfo();
+}
+
+void CFX_ListCtrl::SetTopItem(FX_INT32 nIndex)
+{
+ if (IsValid(nIndex))
+ {
+ this->GetPlateRect();
+ CPDF_Rect rcItem = CFX_List::GetItemRect(nIndex);
+ SetScrollPosY(rcItem.top);
+ }
+}
+
+FX_INT32 CFX_ListCtrl::GetTopItem() const
+{
+ FX_INT32 nItemIndex = this->GetItemIndex(this->GetBTPoint());
+
+ if (!IsItemVisible(nItemIndex) && IsItemVisible(nItemIndex + 1))
+ nItemIndex += 1;
+
+ return nItemIndex;
+}
+
+void CFX_ListCtrl::Empty()
+{
+ CFX_List::Empty();
+ InvalidateItem(-1);
+}
+
+void CFX_ListCtrl::Cancel()
+{
+ m_aSelItems.DeselectAll();
+}
+
+FX_INT32 CFX_ListCtrl::GetItemIndex(const CPDF_Point & point) const
+{
+ return CFX_List::GetItemIndex(OutToIn(point));
+}
+
+CFX_WideString CFX_ListCtrl::GetText() const
+{
+ if (this->IsMultipleSel())
+ return this->GetItemText(this->m_nCaretIndex);
+ else
+ return this->GetItemText(this->m_nSelItem);
+}
+
diff --git a/fpdfsdk/src/fxedit/fxet_module.cpp b/fpdfsdk/src/fxedit/fxet_module.cpp
index b13af89833..9ca7f2eb32 100644
--- a/fpdfsdk/src/fxedit/fxet_module.cpp
+++ b/fpdfsdk/src/fxedit/fxet_module.cpp
@@ -1,46 +1,46 @@
-// 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
-
-#include "../../include/fxedit/fxet_stub.h"
-#include "../../include/fxedit/fxet_edit.h"
-#include "../../include/fxedit/fxet_list.h"
-
-/* ---------------------- IFX_Edit ---------------------- */
-
-IFX_Edit* IFX_Edit::NewEdit()
-{
- if (IPDF_VariableText * pVT = IPDF_VariableText::NewVariableText())
- {
- return new CFX_Edit(pVT);
- }
-
- return NULL;
-}
-
-void IFX_Edit::DelEdit(IFX_Edit* pEdit)
-{
- ASSERT(pEdit != NULL);
-
- IPDF_VariableText::DelVariableText(pEdit->GetVariableText());
-
- delete (CFX_Edit*)pEdit;
-}
-
-
-/* ---------------------- IFX_List ---------------------- */
-
-IFX_List* IFX_List::NewList()
-{
- return new CFX_ListCtrl();
-}
-
-void IFX_List::DelList(IFX_List* pList)
-{
- ASSERT(pList != NULL);
-
- delete (CFX_ListCtrl*)pList;
-}
-
+// 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
+
+#include "../../include/fxedit/fxet_stub.h"
+#include "../../include/fxedit/fxet_edit.h"
+#include "../../include/fxedit/fxet_list.h"
+
+/* ---------------------- IFX_Edit ---------------------- */
+
+IFX_Edit* IFX_Edit::NewEdit()
+{
+ if (IPDF_VariableText * pVT = IPDF_VariableText::NewVariableText())
+ {
+ return new CFX_Edit(pVT);
+ }
+
+ return NULL;
+}
+
+void IFX_Edit::DelEdit(IFX_Edit* pEdit)
+{
+ ASSERT(pEdit != NULL);
+
+ IPDF_VariableText::DelVariableText(pEdit->GetVariableText());
+
+ delete (CFX_Edit*)pEdit;
+}
+
+
+/* ---------------------- IFX_List ---------------------- */
+
+IFX_List* IFX_List::NewList()
+{
+ return new CFX_ListCtrl();
+}
+
+void IFX_List::DelList(IFX_List* pList)
+{
+ ASSERT(pList != NULL);
+
+ delete (CFX_ListCtrl*)pList;
+}
+
diff --git a/fpdfsdk/src/fxedit/fxet_pageobjs.cpp b/fpdfsdk/src/fxedit/fxet_pageobjs.cpp
index 99520619ad..33d57edc4e 100644
--- a/fpdfsdk/src/fxedit/fxet_pageobjs.cpp
+++ b/fpdfsdk/src/fxedit/fxet_pageobjs.cpp
@@ -1,687 +1,687 @@
-// 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
-
-#include "../../include/fxedit/fxet_stub.h"
-#include "../../include/fxedit/fx_edit.h"
-#include "../../include/fxedit/fxet_edit.h"
-
-#define FX_EDIT_UNDERLINEHALFWIDTH 0.5f
-#define FX_EDIT_CROSSOUTHALFWIDTH 0.5f
-
-extern CFX_ByteString GetPDFWordString(IFX_Edit_FontMap * pFontMap, FX_INT32 nFontIndex, FX_WORD Word, FX_WORD SubWord);
-
-CPDF_Rect GetUnderLineRect(const CPVT_Word& word)
-{
- return CPDF_Rect(word.ptWord.x, word.ptWord.y + word.fDescent * 0.5f,
- word.ptWord.x + word.fWidth, word.ptWord.y + word.fDescent * 0.25f);
-}
-
-CPDF_Rect GetCrossoutRect(const CPVT_Word& word)
-{
- return CPDF_Rect(word.ptWord.x, word.ptWord.y + (word.fAscent + word.fDescent) * 0.5f + word.fDescent * 0.25f,
- word.ptWord.x + word.fWidth, word.ptWord.y + (word.fAscent + word.fDescent) * 0.5f);
-}
-
-static void DrawTextString(CFX_RenderDevice* pDevice, const CPDF_Point& pt, CPDF_Font* pFont, FX_FLOAT fFontSize, CPDF_Matrix* pUser2Device,
- const CFX_ByteString& str, FX_ARGB crTextFill, FX_ARGB crTextStroke, FX_INT32 nHorzScale)
-{
- FX_FLOAT x = pt.x, y = pt.y;
- pUser2Device->Transform(x, y);
-
- if (pFont)
- {
- if (nHorzScale != 100)
- {
- CPDF_Matrix mt(nHorzScale/100.0f,0,0,1,0,0);
- mt.Concat(*pUser2Device);
-
- CPDF_RenderOptions ro;
- ro.m_Flags = RENDER_CLEARTYPE;
- ro.m_ColorMode = RENDER_COLOR_NORMAL;
-
- if (crTextStroke != 0)
- {
- CPDF_Point pt1(0,0), pt2(1,0);
- pUser2Device->Transform(pt1.x, pt1.y);
- pUser2Device->Transform(pt2.x, pt2.y);
- CFX_GraphStateData gsd;
- gsd.m_LineWidth = (FX_FLOAT)FXSYS_fabs((pt2.x + pt2.y) - (pt1.x + pt1.y));
-
- CPDF_TextRenderer::DrawTextString(pDevice,x, y, pFont, fFontSize, &mt, str, crTextFill, crTextStroke, &gsd, &ro);
- }
- else
- CPDF_TextRenderer::DrawTextString(pDevice,x, y, pFont, fFontSize, &mt, str, crTextFill, 0, NULL, &ro);
- }
- else
- {
- CPDF_RenderOptions ro;
- ro.m_Flags = RENDER_CLEARTYPE;
- ro.m_ColorMode = RENDER_COLOR_NORMAL;
-
- if (crTextStroke != 0)
- {
- CPDF_Point pt1(0,0), pt2(1,0);
- pUser2Device->Transform(pt1.x, pt1.y);
- pUser2Device->Transform(pt2.x, pt2.y);
- CFX_GraphStateData gsd;
- gsd.m_LineWidth = (FX_FLOAT)FXSYS_fabs((pt2.x + pt2.y) - (pt1.x + pt1.y));
-
- CPDF_TextRenderer::DrawTextString(pDevice,x, y, pFont, fFontSize, pUser2Device, str, crTextFill, crTextStroke, &gsd, &ro);
- }
- else
- CPDF_TextRenderer::DrawTextString(pDevice,x, y, pFont, fFontSize, pUser2Device, str, crTextFill, 0, NULL, &ro);
- }
- }
-}
-
-void IFX_Edit::DrawUnderline(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, IFX_Edit* pEdit, FX_COLORREF color,
- const CPDF_Rect& rcClip, const CPDF_Point& ptOffset, const CPVT_WordRange* pRange)
-{
- pDevice->SaveState();
-
- if (!rcClip.IsEmpty())
- {
- CPDF_Rect rcTemp = rcClip;
- pUser2Device->TransformRect(rcTemp);
- FX_RECT rcDevClip;
- rcDevClip.left = (FX_INT32)rcTemp.left;
- rcDevClip.right = (FX_INT32)rcTemp.right;
- rcDevClip.top = (FX_INT32)rcTemp.top;
- rcDevClip.bottom = (FX_INT32)rcTemp.bottom;
- pDevice->SetClip_Rect(&rcDevClip);
- }
-
- if (IFX_Edit_Iterator* pIterator = pEdit->GetIterator())
- {
- if (pEdit->GetFontMap())
- {
- if (pRange)
- pIterator->SetAt(pRange->BeginPos);
- else
- pIterator->SetAt(0);
-
- while (pIterator->NextWord())
- {
- CPVT_WordPlace place = pIterator->GetAt();
- if (pRange && place.WordCmp(pRange->EndPos) > 0) break;
-
- CPVT_Word word;
- if (pIterator->GetWord(word))
- {
- CFX_PathData pathUnderline;
- CPDF_Rect rcUnderline = GetUnderLineRect(word);
- rcUnderline.left += ptOffset.x;
- rcUnderline.right += ptOffset.x;
- rcUnderline.top += ptOffset.y;
- rcUnderline.bottom += ptOffset.y;
- pathUnderline.AppendRect(rcUnderline.left, rcUnderline.bottom, rcUnderline.right, rcUnderline.top);
-
- pDevice->DrawPath(&pathUnderline, pUser2Device, NULL, color, 0, FXFILL_WINDING);
- }
- }
- }
- }
-
- pDevice->RestoreState();
-}
-
-void IFX_Edit::DrawEdit(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, IFX_Edit* pEdit, FX_COLORREF crTextFill, FX_COLORREF crTextStroke,
- const CPDF_Rect& rcClip, const CPDF_Point& ptOffset, const CPVT_WordRange* pRange, IFX_SystemHandler* pSystemHandler, void* pFFLData)
-{
-
- FX_BOOL bContinuous = pEdit->GetCharArray() == 0;
- if (pEdit->GetCharSpace() > 0.0f)
- bContinuous = FALSE;
-
- FX_WORD SubWord = pEdit->GetPasswordChar();
- FX_FLOAT fFontSize = pEdit->GetFontSize();
- CPVT_WordRange wrSelect = pEdit->GetSelectWordRange();
- FX_INT32 nHorzScale = pEdit->GetHorzScale();
-
- FX_COLORREF crCurFill = crTextFill;
- FX_COLORREF crOldFill = crCurFill;
-
- FX_BOOL bSelect = FALSE;
- const FX_COLORREF crWhite = ArgbEncode(255,255,255,255);
- const FX_COLORREF crSelBK = ArgbEncode(255,0,51,113);
-
- CFX_ByteTextBuf sTextBuf;
- FX_INT32 nFontIndex = -1;
- CPDF_Point ptBT(0.0f,0.0f);
-
- pDevice->SaveState();
-
- if (!rcClip.IsEmpty())
- {
- CPDF_Rect rcTemp = rcClip;
- pUser2Device->TransformRect(rcTemp);
- FX_RECT rcDevClip;
- rcDevClip.left = (FX_INT32)rcTemp.left;
- rcDevClip.right = (FX_INT32)rcTemp.right;
- rcDevClip.top = (FX_INT32)rcTemp.top;
- rcDevClip.bottom = (FX_INT32)rcTemp.bottom;
- pDevice->SetClip_Rect(&rcDevClip);
- }
-
- if (IFX_Edit_Iterator* pIterator = pEdit->GetIterator())
- {
- if (IFX_Edit_FontMap* pFontMap = pEdit->GetFontMap())
- {
- if (pRange)
- pIterator->SetAt(pRange->BeginPos);
- else
- pIterator->SetAt(0);
-
- CPVT_WordPlace oldplace;
-
- while (pIterator->NextWord())
- {
- CPVT_WordPlace place = pIterator->GetAt();
- if (pRange && place.WordCmp(pRange->EndPos) > 0) break;
-
- if (wrSelect.IsExist())
- {
- bSelect = place.WordCmp(wrSelect.BeginPos) > 0 && place.WordCmp(wrSelect.EndPos) <= 0;
- if (bSelect)
- {
- crCurFill = crWhite;
- }
- else
- {
- crCurFill = crTextFill;
- }
- }
- if(pSystemHandler && pSystemHandler->IsSelectionImplemented())
- {
- crCurFill = crTextFill;
- crOldFill = crCurFill;
- }
- CPVT_Word word;
- if (pIterator->GetWord(word))
- {
-
- if (bSelect)
- {
-
- CPVT_Line line;
- pIterator->GetLine(line);
-
- if(pSystemHandler && pSystemHandler->IsSelectionImplemented())
- {
- CPDF_Rect rc(word.ptWord.x,line.ptLine.y + line.fLineDescent,
- word.ptWord.x+word.fWidth,line.ptLine.y + line.fLineAscent);
- rc.Intersect(rcClip);
- //CFX_Edit* pEt = (CFX_Edit*)pEdit;
- //CPDF_Rect rcEdit = pEt->VTToEdit(rc);
- pSystemHandler->OutputSelectedRect(pFFLData,rc);
- }
- else
- {
- CFX_PathData pathSelBK;
- pathSelBK.AppendRect(word.ptWord.x,line.ptLine.y + line.fLineDescent,
- word.ptWord.x+word.fWidth,line.ptLine.y + line.fLineAscent);
-
- pDevice->DrawPath(&pathSelBK, pUser2Device, NULL, crSelBK, 0, FXFILL_WINDING);
- }
- }
-
- if (bContinuous)
- {
- if (place.LineCmp(oldplace) != 0 || word.nFontIndex != nFontIndex ||
- crOldFill != crCurFill)
- {
- if (sTextBuf.GetLength() > 0)
- {
- DrawTextString(pDevice, CPDF_Point(ptBT.x+ptOffset.x, ptBT.y+ptOffset.y), pFontMap->GetPDFFont(nFontIndex),
- fFontSize, pUser2Device, sTextBuf.GetByteString(), crOldFill, crTextStroke, nHorzScale);
-
- sTextBuf.Clear();
- }
- nFontIndex = word.nFontIndex;
- ptBT = word.ptWord;
- crOldFill = crCurFill;
- }
-
- sTextBuf << GetPDFWordString(pFontMap, word.nFontIndex, word.Word, SubWord);
- }
- else
- {
- DrawTextString(pDevice,CPDF_Point(word.ptWord.x+ptOffset.x, word.ptWord.y+ptOffset.y), pFontMap->GetPDFFont(word.nFontIndex),
- fFontSize, pUser2Device, GetPDFWordString(pFontMap, word.nFontIndex, word.Word, SubWord), crCurFill, crTextStroke, nHorzScale);
-
- }
- oldplace = place;
-
-
- }
- }
-
- if (sTextBuf.GetLength() > 0)
- {
- DrawTextString(pDevice, CPDF_Point(ptBT.x+ptOffset.x, ptBT.y+ptOffset.y), pFontMap->GetPDFFont(nFontIndex),
- fFontSize, pUser2Device, sTextBuf.GetByteString(), crOldFill, crTextStroke, nHorzScale);
- }
- }
- }
-
- pDevice->RestoreState();
-}
-
-void IFX_Edit::DrawRichEdit(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, IFX_Edit* pEdit,
- const CPDF_Rect& rcClip, const CPDF_Point& ptOffset, const CPVT_WordRange* pRange)
-{
- //FX_FLOAT fFontSize = pEdit->GetFontSize();
- CPVT_WordRange wrSelect = pEdit->GetSelectWordRange();
-
- FX_COLORREF crCurText = ArgbEncode(255, 0,0,0);
- FX_COLORREF crOld = crCurText;
- FX_BOOL bSelect = FALSE;
- const FX_COLORREF crWhite = ArgbEncode(255,255,255,255);
- const FX_COLORREF crSelBK = ArgbEncode(255,0,51,113);
-
- CFX_ByteTextBuf sTextBuf;
- CPVT_WordProps wp;
- CPDF_Point ptBT(0.0f,0.0f);
-
- pDevice->SaveState();
-
- if (!rcClip.IsEmpty())
- {
- CPDF_Rect rcTemp = rcClip;
- pUser2Device->TransformRect(rcTemp);
- FX_RECT rcDevClip;
- rcDevClip.left = (FX_INT32)rcTemp.left;
- rcDevClip.right = (FX_INT32)rcTemp.right;
- rcDevClip.top = (FX_INT32)rcTemp.top;
- rcDevClip.bottom = (FX_INT32)rcTemp.bottom;
- pDevice->SetClip_Rect(&rcDevClip);
- }
-
- if (IFX_Edit_Iterator* pIterator = pEdit->GetIterator())
- {
- if (IFX_Edit_FontMap* pFontMap = pEdit->GetFontMap())
- {
- if (pRange)
- pIterator->SetAt(pRange->BeginPos);
- else
- pIterator->SetAt(0);
-
- CPVT_WordPlace oldplace;
-
- while (pIterator->NextWord())
- {
- CPVT_WordPlace place = pIterator->GetAt();
- if (pRange && place.WordCmp(pRange->EndPos) > 0) break;
-
- CPVT_Word word;
- if (pIterator->GetWord(word))
- {
- word.WordProps.fFontSize = word.fFontSize;
-
- crCurText = ArgbEncode(255,word.WordProps.dwWordColor);
-
- if (wrSelect.IsExist())
- {
- bSelect = place.WordCmp(wrSelect.BeginPos) > 0 && place.WordCmp(wrSelect.EndPos) <= 0;
- if (bSelect)
- {
- crCurText = crWhite;
- }
- }
-
- if (bSelect)
- {
- CPVT_Line line;
- pIterator->GetLine(line);
-
- CFX_PathData pathSelBK;
- pathSelBK.AppendRect(word.ptWord.x + ptOffset.x,
- line.ptLine.y + line.fLineDescent + ptOffset.y,
- word.ptWord.x+word.fWidth + ptOffset.x,
- line.ptLine.y + line.fLineAscent + ptOffset.y);
-
- pDevice->DrawPath(&pathSelBK, pUser2Device, NULL, crSelBK, 0, FXFILL_WINDING);
- }
-
- if (place.LineCmp(oldplace) != 0 || word.WordProps.fCharSpace > 0.0f || word.WordProps.nHorzScale != 100 ||
- FXSYS_memcmp(&word.WordProps, &wp, sizeof(CPVT_WordProps)) != 0 ||
- crOld != crCurText)
- {
- if (sTextBuf.GetLength() > 0)
- {
- DrawTextString(pDevice, CPDF_Point(ptBT.x+ptOffset.x, ptBT.y+ptOffset.y), pFontMap->GetPDFFont(wp.nFontIndex),
- wp.fFontSize, pUser2Device, sTextBuf.GetByteString(), crOld, 0, wp.nHorzScale);
-
- sTextBuf.Clear();
- }
- wp = word.WordProps;
- ptBT = word.ptWord;
- crOld = crCurText;
- }
-
- sTextBuf << GetPDFWordString(pFontMap, word.WordProps.nFontIndex, word.Word, 0);
-
- if (word.WordProps.nWordStyle & PVTWORD_STYLE_UNDERLINE)
- {
- CFX_PathData pathUnderline;
- CPDF_Rect rcUnderline = GetUnderLineRect(word);
- pathUnderline.AppendRect(rcUnderline.left, rcUnderline.bottom, rcUnderline.right, rcUnderline.top);
-
- pDevice->DrawPath(&pathUnderline, pUser2Device, NULL, crCurText, 0, FXFILL_WINDING);
- }
-
- if (word.WordProps.nWordStyle & PVTWORD_STYLE_CROSSOUT)
- {
- CFX_PathData pathCrossout;
- CPDF_Rect rcCrossout = GetCrossoutRect(word);
- pathCrossout.AppendRect(rcCrossout.left, rcCrossout.bottom, rcCrossout.right, rcCrossout.top);
-
- pDevice->DrawPath(&pathCrossout, pUser2Device, NULL, crCurText, 0, FXFILL_WINDING);
- }
-
- oldplace = place;
- }
- }
-
- if (sTextBuf.GetLength() > 0)
- {
- DrawTextString(pDevice, CPDF_Point(ptBT.x+ptOffset.x, ptBT.y+ptOffset.y), pFontMap->GetPDFFont(wp.nFontIndex),
- wp.fFontSize, pUser2Device, sTextBuf.GetByteString(), crOld, 0, wp.nHorzScale);
- }
- }
- }
-
- pDevice->RestoreState();
-}
-
-static void AddLineToPageObjects(CPDF_PageObjects* pPageObjs, FX_COLORREF crStroke,
- const CPDF_Point& pt1, const CPDF_Point& pt2)
-{
- CPDF_PathObject* pPathObj = new CPDF_PathObject;
- CPDF_PathData* pPathData = pPathObj->m_Path.GetModify();
-
- pPathData->SetPointCount(2);
- pPathData->SetPoint(0, pt1.x, pt1.y, FXPT_MOVETO);
- pPathData->SetPoint(1, pt2.x, pt2.y, FXPT_LINETO);
-
- FX_FLOAT rgb[3];
- rgb[0] = FXARGB_R(crStroke) / 255.0f;
- rgb[1] = FXARGB_G(crStroke) / 255.0f;
- rgb[2] = FXARGB_B(crStroke) / 255.0f;
- pPathObj->m_ColorState.SetStrokeColor(CPDF_ColorSpace::GetStockCS(PDFCS_DEVICERGB), rgb, 3);
-
- CFX_GraphStateData* pData = pPathObj->m_GraphState.GetModify();
- pData->m_LineWidth = 1;
-
- pPageObjs->InsertObject(pPageObjs->GetLastObjectPosition(),pPathObj);
-}
-
-static void AddRectToPageObjects(CPDF_PageObjects* pPageObjs, FX_COLORREF crFill, const CPDF_Rect& rcFill)
-{
- CPDF_PathObject* pPathObj = new CPDF_PathObject;
- CPDF_PathData* pPathData = pPathObj->m_Path.GetModify();
- pPathData->AppendRect(rcFill.left,rcFill.bottom,rcFill.right,rcFill.top);
-
- FX_FLOAT rgb[3];
- rgb[0] = FXARGB_R(crFill) / 255.0f ;
- rgb[1] = FXARGB_G(crFill) / 255.0f;
- rgb[2] = FXARGB_B(crFill) / 255.0f;
- pPathObj->m_ColorState.SetFillColor(CPDF_ColorSpace::GetStockCS(PDFCS_DEVICERGB), rgb, 3);
-
- pPathObj->m_FillType = FXFILL_ALTERNATE;
- pPathObj->m_bStroke = FALSE;
-
- pPageObjs->InsertObject(pPageObjs->GetLastObjectPosition(),pPathObj);
-}
-
-static CPDF_TextObject* AddTextObjToPageObjects(CPDF_PageObjects* pPageObjs, FX_COLORREF crText,
- CPDF_Font* pFont, FX_FLOAT fFontSize, FX_FLOAT fCharSpace, FX_INT32 nHorzScale,
- const CPDF_Point& point, const CFX_ByteString& text)
-{
- CPDF_TextObject* pTxtObj = new CPDF_TextObject;
-
- CPDF_TextStateData* pTextStateData = pTxtObj->m_TextState.GetModify();
- pTextStateData->m_pFont = pFont;
- pTextStateData->m_FontSize = fFontSize;
- pTextStateData->m_CharSpace = fCharSpace;
- pTextStateData->m_WordSpace = 0;
- pTextStateData->m_TextMode = 0;
- pTextStateData->m_Matrix[0] = nHorzScale / 100.0f;
- pTextStateData->m_Matrix[1] = 0;
- pTextStateData->m_Matrix[2] = 0;
- pTextStateData->m_Matrix[3] = 1;
-
- FX_FLOAT rgb[3];
- rgb[0] = FXARGB_R(crText) / 255.0f ;
- rgb[1] = FXARGB_G(crText) / 255.0f;
- rgb[2] = FXARGB_B(crText) / 255.0f;
- pTxtObj->m_ColorState.SetFillColor(CPDF_ColorSpace::GetStockCS(PDFCS_DEVICERGB),rgb, 3);
- pTxtObj->m_ColorState.SetStrokeColor(CPDF_ColorSpace::GetStockCS(PDFCS_DEVICERGB),rgb, 3);
-
- pTxtObj->SetPosition(point.x,point.y);
- pTxtObj->SetText(text);
-
- pPageObjs->InsertObject(pPageObjs->GetLastObjectPosition(),pTxtObj);
-
- return pTxtObj;
-}
-
-/*
-List of currently supported standard fonts:
-Courier, Courier-Bold, Courier-BoldOblique, Courier-Oblique
-Helvetica, Helvetica-Bold, Helvetica-BoldOblique, Helvetica-Oblique
-Times-Roman, Times-Bold, Times-Italic, Times-BoldItalic
-Symbol, ZapfDingbats
-*/
-
-const char* g_sFXEDITStandardFontName[] = {"Courier", "Courier-Bold", "Courier-BoldOblique", "Courier-Oblique",
- "Helvetica", "Helvetica-Bold", "Helvetica-BoldOblique", "Helvetica-Oblique",
- "Times-Roman", "Times-Bold", "Times-Italic", "Times-BoldItalic",
- "Symbol", "ZapfDingbats"};
-
-static FX_BOOL FX_EDIT_IsStandardFont(const CFX_ByteString& sFontName)
-{
- for (FX_INT32 i=0; i<14; i++)
- {
- if (sFontName == g_sFXEDITStandardFontName[i])
- return TRUE;
- }
-
- return FALSE;
-}
-
-void IFX_Edit::GeneratePageObjects(CPDF_PageObjects* pPageObjects, IFX_Edit* pEdit,
- const CPDF_Point& ptOffset, const CPVT_WordRange* pRange, FX_COLORREF crText, CFX_ArrayTemplate<CPDF_TextObject*>& ObjArray)
-{
- FX_FLOAT fFontSize = pEdit->GetFontSize();
-
- FX_INT32 nOldFontIndex = -1;
-
- CFX_ByteTextBuf sTextBuf;
- CPDF_Point ptBT(0.0f,0.0f);
-
- ObjArray.RemoveAll();
-
- if (IFX_Edit_Iterator* pIterator = pEdit->GetIterator())
- {
- if (IFX_Edit_FontMap* pFontMap = pEdit->GetFontMap())
- {
- if (pRange)
- pIterator->SetAt(pRange->BeginPos);
- else
- pIterator->SetAt(0);
-
- CPVT_WordPlace oldplace;
-
- while (pIterator->NextWord())
- {
- CPVT_WordPlace place = pIterator->GetAt();
- if (pRange && place.WordCmp(pRange->EndPos) > 0) break;
-
- CPVT_Word word;
- if (pIterator->GetWord(word))
- {
- if (place.LineCmp(oldplace) != 0 || nOldFontIndex != word.nFontIndex)
- {
- if (sTextBuf.GetLength() > 0)
- {
- ObjArray.Add(AddTextObjToPageObjects(pPageObjects, crText, pFontMap->GetPDFFont(nOldFontIndex), fFontSize, 0.0f, 100,
- CPDF_Point(ptBT.x+ptOffset.x, ptBT.y+ptOffset.y), sTextBuf.GetByteString()));
-
- sTextBuf.Clear();
- }
-
- ptBT = word.ptWord;
- nOldFontIndex = word.nFontIndex;
- }
-
- sTextBuf << GetPDFWordString(pFontMap, word.nFontIndex, word.Word, 0);
- oldplace = place;
- }
- }
-
- if (sTextBuf.GetLength() > 0)
- {
- ObjArray.Add(AddTextObjToPageObjects(pPageObjects, crText, pFontMap->GetPDFFont(nOldFontIndex), fFontSize, 0.0f, 100,
- CPDF_Point(ptBT.x+ptOffset.x, ptBT.y+ptOffset.y), sTextBuf.GetByteString()));
- }
- }
- }
-}
-
-void IFX_Edit::GenerateRichPageObjects(CPDF_PageObjects* pPageObjects, IFX_Edit* pEdit,
- const CPDF_Point& ptOffset, const CPVT_WordRange* pRange, CFX_ArrayTemplate<CPDF_TextObject*>& ObjArray)
-{
-
-
- FX_COLORREF crCurText = ArgbEncode(255, 0, 0, 0);
- FX_COLORREF crOld = crCurText;
-
-
- CFX_ByteTextBuf sTextBuf;
- CPVT_WordProps wp;
- CPDF_Point ptBT(0.0f,0.0f);
-
- ObjArray.RemoveAll();
-
- if (IFX_Edit_Iterator* pIterator = pEdit->GetIterator())
- {
- if (IFX_Edit_FontMap* pFontMap = pEdit->GetFontMap())
- {
- if (pRange)
- pIterator->SetAt(pRange->BeginPos);
- else
- pIterator->SetAt(0);
-
- CPVT_WordPlace oldplace;
-
- while (pIterator->NextWord())
- {
- CPVT_WordPlace place = pIterator->GetAt();
- if (pRange && place.WordCmp(pRange->EndPos) > 0) break;
-
- CPVT_Word word;
- if (pIterator->GetWord(word))
- {
- word.WordProps.fFontSize = word.fFontSize;
-
- crCurText = ArgbEncode(255,word.WordProps.dwWordColor);
-
- if (place.LineCmp(oldplace) != 0 || word.WordProps.fCharSpace > 0.0f || word.WordProps.nHorzScale != 100 ||
- FXSYS_memcmp(&word.WordProps, &wp, sizeof(CPVT_WordProps)) != 0 ||
- crOld != crCurText)
- {
- if (sTextBuf.GetLength() > 0)
- {
- ObjArray.Add(AddTextObjToPageObjects(pPageObjects, crOld, pFontMap->GetPDFFont(wp.nFontIndex), wp.fFontSize, wp.fCharSpace, wp.nHorzScale,
- CPDF_Point(ptBT.x+ptOffset.x, ptBT.y+ptOffset.y), sTextBuf.GetByteString()));
-
- sTextBuf.Clear();
- }
-
- wp = word.WordProps;
- ptBT = word.ptWord;
- crOld = crCurText;
-
- }
-
- sTextBuf << GetPDFWordString(pFontMap, word.WordProps.nFontIndex, word.Word, 0);
-
- if (word.WordProps.nWordStyle & PVTWORD_STYLE_UNDERLINE)
- {/*
- AddLineToPageObjects(pPageObjects, crCurText,
- CPDF_Point(word.ptWord.x, word.ptWord.y + word.fDescent * 0.4f),
- CPDF_Point(word.ptWord.x + word.fWidth, word.ptWord.y + word.fDescent * 0.4f));
-*/
- CPDF_Rect rcUnderline = GetUnderLineRect(word);
- rcUnderline.left += ptOffset.x;
- rcUnderline.right += ptOffset.x;
- rcUnderline.top += ptOffset.y;
- rcUnderline.bottom += ptOffset.y;
-
- AddRectToPageObjects(pPageObjects, crCurText, rcUnderline);
- }
-
- if (word.WordProps.nWordStyle & PVTWORD_STYLE_CROSSOUT)
- {
- CPDF_Rect rcCrossout = GetCrossoutRect(word);
- rcCrossout.left += ptOffset.x;
- rcCrossout.right += ptOffset.x;
- rcCrossout.top += ptOffset.y;
- rcCrossout.bottom += ptOffset.y;
-
- AddRectToPageObjects(pPageObjects, crCurText, rcCrossout);
- }
-
- oldplace = place;
- }
- }
-
- if (sTextBuf.GetLength() > 0)
- {
- ObjArray.Add(AddTextObjToPageObjects(pPageObjects, crOld, pFontMap->GetPDFFont(wp.nFontIndex), wp.fFontSize, wp.fCharSpace, wp.nHorzScale,
- CPDF_Point(ptBT.x+ptOffset.x, ptBT.y+ptOffset.y), sTextBuf.GetByteString()));
- }
- }
- }
-}
-
-void IFX_Edit::GenerateUnderlineObjects(CPDF_PageObjects* pPageObjects, IFX_Edit* pEdit,
- const CPDF_Point& ptOffset, const CPVT_WordRange* pRange, FX_COLORREF color)
-{
-
-
- if (IFX_Edit_Iterator* pIterator = pEdit->GetIterator())
- {
- if (pEdit->GetFontMap())
- {
- if (pRange)
- pIterator->SetAt(pRange->BeginPos);
- else
- pIterator->SetAt(0);
-
- CPVT_WordPlace oldplace;
-
- while (pIterator->NextWord())
- {
- CPVT_WordPlace place = pIterator->GetAt();
- if (pRange && place.WordCmp(pRange->EndPos) > 0) break;
-
- CPVT_Word word;
- if (pIterator->GetWord(word))
- {
- CPDF_Rect rcUnderline = GetUnderLineRect(word);
- rcUnderline.left += ptOffset.x;
- rcUnderline.right += ptOffset.x;
- rcUnderline.top += ptOffset.y;
- rcUnderline.bottom += ptOffset.y;
- AddRectToPageObjects(pPageObjects, color, rcUnderline);
- }
- }
- }
- }
-}
-
+// 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
+
+#include "../../include/fxedit/fxet_stub.h"
+#include "../../include/fxedit/fx_edit.h"
+#include "../../include/fxedit/fxet_edit.h"
+
+#define FX_EDIT_UNDERLINEHALFWIDTH 0.5f
+#define FX_EDIT_CROSSOUTHALFWIDTH 0.5f
+
+extern CFX_ByteString GetPDFWordString(IFX_Edit_FontMap * pFontMap, FX_INT32 nFontIndex, FX_WORD Word, FX_WORD SubWord);
+
+CPDF_Rect GetUnderLineRect(const CPVT_Word& word)
+{
+ return CPDF_Rect(word.ptWord.x, word.ptWord.y + word.fDescent * 0.5f,
+ word.ptWord.x + word.fWidth, word.ptWord.y + word.fDescent * 0.25f);
+}
+
+CPDF_Rect GetCrossoutRect(const CPVT_Word& word)
+{
+ return CPDF_Rect(word.ptWord.x, word.ptWord.y + (word.fAscent + word.fDescent) * 0.5f + word.fDescent * 0.25f,
+ word.ptWord.x + word.fWidth, word.ptWord.y + (word.fAscent + word.fDescent) * 0.5f);
+}
+
+static void DrawTextString(CFX_RenderDevice* pDevice, const CPDF_Point& pt, CPDF_Font* pFont, FX_FLOAT fFontSize, CPDF_Matrix* pUser2Device,
+ const CFX_ByteString& str, FX_ARGB crTextFill, FX_ARGB crTextStroke, FX_INT32 nHorzScale)
+{
+ FX_FLOAT x = pt.x, y = pt.y;
+ pUser2Device->Transform(x, y);
+
+ if (pFont)
+ {
+ if (nHorzScale != 100)
+ {
+ CPDF_Matrix mt(nHorzScale/100.0f,0,0,1,0,0);
+ mt.Concat(*pUser2Device);
+
+ CPDF_RenderOptions ro;
+ ro.m_Flags = RENDER_CLEARTYPE;
+ ro.m_ColorMode = RENDER_COLOR_NORMAL;
+
+ if (crTextStroke != 0)
+ {
+ CPDF_Point pt1(0,0), pt2(1,0);
+ pUser2Device->Transform(pt1.x, pt1.y);
+ pUser2Device->Transform(pt2.x, pt2.y);
+ CFX_GraphStateData gsd;
+ gsd.m_LineWidth = (FX_FLOAT)FXSYS_fabs((pt2.x + pt2.y) - (pt1.x + pt1.y));
+
+ CPDF_TextRenderer::DrawTextString(pDevice,x, y, pFont, fFontSize, &mt, str, crTextFill, crTextStroke, &gsd, &ro);
+ }
+ else
+ CPDF_TextRenderer::DrawTextString(pDevice,x, y, pFont, fFontSize, &mt, str, crTextFill, 0, NULL, &ro);
+ }
+ else
+ {
+ CPDF_RenderOptions ro;
+ ro.m_Flags = RENDER_CLEARTYPE;
+ ro.m_ColorMode = RENDER_COLOR_NORMAL;
+
+ if (crTextStroke != 0)
+ {
+ CPDF_Point pt1(0,0), pt2(1,0);
+ pUser2Device->Transform(pt1.x, pt1.y);
+ pUser2Device->Transform(pt2.x, pt2.y);
+ CFX_GraphStateData gsd;
+ gsd.m_LineWidth = (FX_FLOAT)FXSYS_fabs((pt2.x + pt2.y) - (pt1.x + pt1.y));
+
+ CPDF_TextRenderer::DrawTextString(pDevice,x, y, pFont, fFontSize, pUser2Device, str, crTextFill, crTextStroke, &gsd, &ro);
+ }
+ else
+ CPDF_TextRenderer::DrawTextString(pDevice,x, y, pFont, fFontSize, pUser2Device, str, crTextFill, 0, NULL, &ro);
+ }
+ }
+}
+
+void IFX_Edit::DrawUnderline(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, IFX_Edit* pEdit, FX_COLORREF color,
+ const CPDF_Rect& rcClip, const CPDF_Point& ptOffset, const CPVT_WordRange* pRange)
+{
+ pDevice->SaveState();
+
+ if (!rcClip.IsEmpty())
+ {
+ CPDF_Rect rcTemp = rcClip;
+ pUser2Device->TransformRect(rcTemp);
+ FX_RECT rcDevClip;
+ rcDevClip.left = (FX_INT32)rcTemp.left;
+ rcDevClip.right = (FX_INT32)rcTemp.right;
+ rcDevClip.top = (FX_INT32)rcTemp.top;
+ rcDevClip.bottom = (FX_INT32)rcTemp.bottom;
+ pDevice->SetClip_Rect(&rcDevClip);
+ }
+
+ if (IFX_Edit_Iterator* pIterator = pEdit->GetIterator())
+ {
+ if (pEdit->GetFontMap())
+ {
+ if (pRange)
+ pIterator->SetAt(pRange->BeginPos);
+ else
+ pIterator->SetAt(0);
+
+ while (pIterator->NextWord())
+ {
+ CPVT_WordPlace place = pIterator->GetAt();
+ if (pRange && place.WordCmp(pRange->EndPos) > 0) break;
+
+ CPVT_Word word;
+ if (pIterator->GetWord(word))
+ {
+ CFX_PathData pathUnderline;
+ CPDF_Rect rcUnderline = GetUnderLineRect(word);
+ rcUnderline.left += ptOffset.x;
+ rcUnderline.right += ptOffset.x;
+ rcUnderline.top += ptOffset.y;
+ rcUnderline.bottom += ptOffset.y;
+ pathUnderline.AppendRect(rcUnderline.left, rcUnderline.bottom, rcUnderline.right, rcUnderline.top);
+
+ pDevice->DrawPath(&pathUnderline, pUser2Device, NULL, color, 0, FXFILL_WINDING);
+ }
+ }
+ }
+ }
+
+ pDevice->RestoreState();
+}
+
+void IFX_Edit::DrawEdit(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, IFX_Edit* pEdit, FX_COLORREF crTextFill, FX_COLORREF crTextStroke,
+ const CPDF_Rect& rcClip, const CPDF_Point& ptOffset, const CPVT_WordRange* pRange, IFX_SystemHandler* pSystemHandler, void* pFFLData)
+{
+
+ FX_BOOL bContinuous = pEdit->GetCharArray() == 0;
+ if (pEdit->GetCharSpace() > 0.0f)
+ bContinuous = FALSE;
+
+ FX_WORD SubWord = pEdit->GetPasswordChar();
+ FX_FLOAT fFontSize = pEdit->GetFontSize();
+ CPVT_WordRange wrSelect = pEdit->GetSelectWordRange();
+ FX_INT32 nHorzScale = pEdit->GetHorzScale();
+
+ FX_COLORREF crCurFill = crTextFill;
+ FX_COLORREF crOldFill = crCurFill;
+
+ FX_BOOL bSelect = FALSE;
+ const FX_COLORREF crWhite = ArgbEncode(255,255,255,255);
+ const FX_COLORREF crSelBK = ArgbEncode(255,0,51,113);
+
+ CFX_ByteTextBuf sTextBuf;
+ FX_INT32 nFontIndex = -1;
+ CPDF_Point ptBT(0.0f,0.0f);
+
+ pDevice->SaveState();
+
+ if (!rcClip.IsEmpty())
+ {
+ CPDF_Rect rcTemp = rcClip;
+ pUser2Device->TransformRect(rcTemp);
+ FX_RECT rcDevClip;
+ rcDevClip.left = (FX_INT32)rcTemp.left;
+ rcDevClip.right = (FX_INT32)rcTemp.right;
+ rcDevClip.top = (FX_INT32)rcTemp.top;
+ rcDevClip.bottom = (FX_INT32)rcTemp.bottom;
+ pDevice->SetClip_Rect(&rcDevClip);
+ }
+
+ if (IFX_Edit_Iterator* pIterator = pEdit->GetIterator())
+ {
+ if (IFX_Edit_FontMap* pFontMap = pEdit->GetFontMap())
+ {
+ if (pRange)
+ pIterator->SetAt(pRange->BeginPos);
+ else
+ pIterator->SetAt(0);
+
+ CPVT_WordPlace oldplace;
+
+ while (pIterator->NextWord())
+ {
+ CPVT_WordPlace place = pIterator->GetAt();
+ if (pRange && place.WordCmp(pRange->EndPos) > 0) break;
+
+ if (wrSelect.IsExist())
+ {
+ bSelect = place.WordCmp(wrSelect.BeginPos) > 0 && place.WordCmp(wrSelect.EndPos) <= 0;
+ if (bSelect)
+ {
+ crCurFill = crWhite;
+ }
+ else
+ {
+ crCurFill = crTextFill;
+ }
+ }
+ if(pSystemHandler && pSystemHandler->IsSelectionImplemented())
+ {
+ crCurFill = crTextFill;
+ crOldFill = crCurFill;
+ }
+ CPVT_Word word;
+ if (pIterator->GetWord(word))
+ {
+
+ if (bSelect)
+ {
+
+ CPVT_Line line;
+ pIterator->GetLine(line);
+
+ if(pSystemHandler && pSystemHandler->IsSelectionImplemented())
+ {
+ CPDF_Rect rc(word.ptWord.x,line.ptLine.y + line.fLineDescent,
+ word.ptWord.x+word.fWidth,line.ptLine.y + line.fLineAscent);
+ rc.Intersect(rcClip);
+ //CFX_Edit* pEt = (CFX_Edit*)pEdit;
+ //CPDF_Rect rcEdit = pEt->VTToEdit(rc);
+ pSystemHandler->OutputSelectedRect(pFFLData,rc);
+ }
+ else
+ {
+ CFX_PathData pathSelBK;
+ pathSelBK.AppendRect(word.ptWord.x,line.ptLine.y + line.fLineDescent,
+ word.ptWord.x+word.fWidth,line.ptLine.y + line.fLineAscent);
+
+ pDevice->DrawPath(&pathSelBK, pUser2Device, NULL, crSelBK, 0, FXFILL_WINDING);
+ }
+ }
+
+ if (bContinuous)
+ {
+ if (place.LineCmp(oldplace) != 0 || word.nFontIndex != nFontIndex ||
+ crOldFill != crCurFill)
+ {
+ if (sTextBuf.GetLength() > 0)
+ {
+ DrawTextString(pDevice, CPDF_Point(ptBT.x+ptOffset.x, ptBT.y+ptOffset.y), pFontMap->GetPDFFont(nFontIndex),
+ fFontSize, pUser2Device, sTextBuf.GetByteString(), crOldFill, crTextStroke, nHorzScale);
+
+ sTextBuf.Clear();
+ }
+ nFontIndex = word.nFontIndex;
+ ptBT = word.ptWord;
+ crOldFill = crCurFill;
+ }
+
+ sTextBuf << GetPDFWordString(pFontMap, word.nFontIndex, word.Word, SubWord);
+ }
+ else
+ {
+ DrawTextString(pDevice,CPDF_Point(word.ptWord.x+ptOffset.x, word.ptWord.y+ptOffset.y), pFontMap->GetPDFFont(word.nFontIndex),
+ fFontSize, pUser2Device, GetPDFWordString(pFontMap, word.nFontIndex, word.Word, SubWord), crCurFill, crTextStroke, nHorzScale);
+
+ }
+ oldplace = place;
+
+
+ }
+ }
+
+ if (sTextBuf.GetLength() > 0)
+ {
+ DrawTextString(pDevice, CPDF_Point(ptBT.x+ptOffset.x, ptBT.y+ptOffset.y), pFontMap->GetPDFFont(nFontIndex),
+ fFontSize, pUser2Device, sTextBuf.GetByteString(), crOldFill, crTextStroke, nHorzScale);
+ }
+ }
+ }
+
+ pDevice->RestoreState();
+}
+
+void IFX_Edit::DrawRichEdit(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, IFX_Edit* pEdit,
+ const CPDF_Rect& rcClip, const CPDF_Point& ptOffset, const CPVT_WordRange* pRange)
+{
+ //FX_FLOAT fFontSize = pEdit->GetFontSize();
+ CPVT_WordRange wrSelect = pEdit->GetSelectWordRange();
+
+ FX_COLORREF crCurText = ArgbEncode(255, 0,0,0);
+ FX_COLORREF crOld = crCurText;
+ FX_BOOL bSelect = FALSE;
+ const FX_COLORREF crWhite = ArgbEncode(255,255,255,255);
+ const FX_COLORREF crSelBK = ArgbEncode(255,0,51,113);
+
+ CFX_ByteTextBuf sTextBuf;
+ CPVT_WordProps wp;
+ CPDF_Point ptBT(0.0f,0.0f);
+
+ pDevice->SaveState();
+
+ if (!rcClip.IsEmpty())
+ {
+ CPDF_Rect rcTemp = rcClip;
+ pUser2Device->TransformRect(rcTemp);
+ FX_RECT rcDevClip;
+ rcDevClip.left = (FX_INT32)rcTemp.left;
+ rcDevClip.right = (FX_INT32)rcTemp.right;
+ rcDevClip.top = (FX_INT32)rcTemp.top;
+ rcDevClip.bottom = (FX_INT32)rcTemp.bottom;
+ pDevice->SetClip_Rect(&rcDevClip);
+ }
+
+ if (IFX_Edit_Iterator* pIterator = pEdit->GetIterator())
+ {
+ if (IFX_Edit_FontMap* pFontMap = pEdit->GetFontMap())
+ {
+ if (pRange)
+ pIterator->SetAt(pRange->BeginPos);
+ else
+ pIterator->SetAt(0);
+
+ CPVT_WordPlace oldplace;
+
+ while (pIterator->NextWord())
+ {
+ CPVT_WordPlace place = pIterator->GetAt();
+ if (pRange && place.WordCmp(pRange->EndPos) > 0) break;
+
+ CPVT_Word word;
+ if (pIterator->GetWord(word))
+ {
+ word.WordProps.fFontSize = word.fFontSize;
+
+ crCurText = ArgbEncode(255,word.WordProps.dwWordColor);
+
+ if (wrSelect.IsExist())
+ {
+ bSelect = place.WordCmp(wrSelect.BeginPos) > 0 && place.WordCmp(wrSelect.EndPos) <= 0;
+ if (bSelect)
+ {
+ crCurText = crWhite;
+ }
+ }
+
+ if (bSelect)
+ {
+ CPVT_Line line;
+ pIterator->GetLine(line);
+
+ CFX_PathData pathSelBK;
+ pathSelBK.AppendRect(word.ptWord.x + ptOffset.x,
+ line.ptLine.y + line.fLineDescent + ptOffset.y,
+ word.ptWord.x+word.fWidth + ptOffset.x,
+ line.ptLine.y + line.fLineAscent + ptOffset.y);
+
+ pDevice->DrawPath(&pathSelBK, pUser2Device, NULL, crSelBK, 0, FXFILL_WINDING);
+ }
+
+ if (place.LineCmp(oldplace) != 0 || word.WordProps.fCharSpace > 0.0f || word.WordProps.nHorzScale != 100 ||
+ FXSYS_memcmp(&word.WordProps, &wp, sizeof(CPVT_WordProps)) != 0 ||
+ crOld != crCurText)
+ {
+ if (sTextBuf.GetLength() > 0)
+ {
+ DrawTextString(pDevice, CPDF_Point(ptBT.x+ptOffset.x, ptBT.y+ptOffset.y), pFontMap->GetPDFFont(wp.nFontIndex),
+ wp.fFontSize, pUser2Device, sTextBuf.GetByteString(), crOld, 0, wp.nHorzScale);
+
+ sTextBuf.Clear();
+ }
+ wp = word.WordProps;
+ ptBT = word.ptWord;
+ crOld = crCurText;
+ }
+
+ sTextBuf << GetPDFWordString(pFontMap, word.WordProps.nFontIndex, word.Word, 0);
+
+ if (word.WordProps.nWordStyle & PVTWORD_STYLE_UNDERLINE)
+ {
+ CFX_PathData pathUnderline;
+ CPDF_Rect rcUnderline = GetUnderLineRect(word);
+ pathUnderline.AppendRect(rcUnderline.left, rcUnderline.bottom, rcUnderline.right, rcUnderline.top);
+
+ pDevice->DrawPath(&pathUnderline, pUser2Device, NULL, crCurText, 0, FXFILL_WINDING);
+ }
+
+ if (word.WordProps.nWordStyle & PVTWORD_STYLE_CROSSOUT)
+ {
+ CFX_PathData pathCrossout;
+ CPDF_Rect rcCrossout = GetCrossoutRect(word);
+ pathCrossout.AppendRect(rcCrossout.left, rcCrossout.bottom, rcCrossout.right, rcCrossout.top);
+
+ pDevice->DrawPath(&pathCrossout, pUser2Device, NULL, crCurText, 0, FXFILL_WINDING);
+ }
+
+ oldplace = place;
+ }
+ }
+
+ if (sTextBuf.GetLength() > 0)
+ {
+ DrawTextString(pDevice, CPDF_Point(ptBT.x+ptOffset.x, ptBT.y+ptOffset.y), pFontMap->GetPDFFont(wp.nFontIndex),
+ wp.fFontSize, pUser2Device, sTextBuf.GetByteString(), crOld, 0, wp.nHorzScale);
+ }
+ }
+ }
+
+ pDevice->RestoreState();
+}
+
+static void AddLineToPageObjects(CPDF_PageObjects* pPageObjs, FX_COLORREF crStroke,
+ const CPDF_Point& pt1, const CPDF_Point& pt2)
+{
+ CPDF_PathObject* pPathObj = new CPDF_PathObject;
+ CPDF_PathData* pPathData = pPathObj->m_Path.GetModify();
+
+ pPathData->SetPointCount(2);
+ pPathData->SetPoint(0, pt1.x, pt1.y, FXPT_MOVETO);
+ pPathData->SetPoint(1, pt2.x, pt2.y, FXPT_LINETO);
+
+ FX_FLOAT rgb[3];
+ rgb[0] = FXARGB_R(crStroke) / 255.0f;
+ rgb[1] = FXARGB_G(crStroke) / 255.0f;
+ rgb[2] = FXARGB_B(crStroke) / 255.0f;
+ pPathObj->m_ColorState.SetStrokeColor(CPDF_ColorSpace::GetStockCS(PDFCS_DEVICERGB), rgb, 3);
+
+ CFX_GraphStateData* pData = pPathObj->m_GraphState.GetModify();
+ pData->m_LineWidth = 1;
+
+ pPageObjs->InsertObject(pPageObjs->GetLastObjectPosition(),pPathObj);
+}
+
+static void AddRectToPageObjects(CPDF_PageObjects* pPageObjs, FX_COLORREF crFill, const CPDF_Rect& rcFill)
+{
+ CPDF_PathObject* pPathObj = new CPDF_PathObject;
+ CPDF_PathData* pPathData = pPathObj->m_Path.GetModify();
+ pPathData->AppendRect(rcFill.left,rcFill.bottom,rcFill.right,rcFill.top);
+
+ FX_FLOAT rgb[3];
+ rgb[0] = FXARGB_R(crFill) / 255.0f ;
+ rgb[1] = FXARGB_G(crFill) / 255.0f;
+ rgb[2] = FXARGB_B(crFill) / 255.0f;
+ pPathObj->m_ColorState.SetFillColor(CPDF_ColorSpace::GetStockCS(PDFCS_DEVICERGB), rgb, 3);
+
+ pPathObj->m_FillType = FXFILL_ALTERNATE;
+ pPathObj->m_bStroke = FALSE;
+
+ pPageObjs->InsertObject(pPageObjs->GetLastObjectPosition(),pPathObj);
+}
+
+static CPDF_TextObject* AddTextObjToPageObjects(CPDF_PageObjects* pPageObjs, FX_COLORREF crText,
+ CPDF_Font* pFont, FX_FLOAT fFontSize, FX_FLOAT fCharSpace, FX_INT32 nHorzScale,
+ const CPDF_Point& point, const CFX_ByteString& text)
+{
+ CPDF_TextObject* pTxtObj = new CPDF_TextObject;
+
+ CPDF_TextStateData* pTextStateData = pTxtObj->m_TextState.GetModify();
+ pTextStateData->m_pFont = pFont;
+ pTextStateData->m_FontSize = fFontSize;
+ pTextStateData->m_CharSpace = fCharSpace;
+ pTextStateData->m_WordSpace = 0;
+ pTextStateData->m_TextMode = 0;
+ pTextStateData->m_Matrix[0] = nHorzScale / 100.0f;
+ pTextStateData->m_Matrix[1] = 0;
+ pTextStateData->m_Matrix[2] = 0;
+ pTextStateData->m_Matrix[3] = 1;
+
+ FX_FLOAT rgb[3];
+ rgb[0] = FXARGB_R(crText) / 255.0f ;
+ rgb[1] = FXARGB_G(crText) / 255.0f;
+ rgb[2] = FXARGB_B(crText) / 255.0f;
+ pTxtObj->m_ColorState.SetFillColor(CPDF_ColorSpace::GetStockCS(PDFCS_DEVICERGB),rgb, 3);
+ pTxtObj->m_ColorState.SetStrokeColor(CPDF_ColorSpace::GetStockCS(PDFCS_DEVICERGB),rgb, 3);
+
+ pTxtObj->SetPosition(point.x,point.y);
+ pTxtObj->SetText(text);
+
+ pPageObjs->InsertObject(pPageObjs->GetLastObjectPosition(),pTxtObj);
+
+ return pTxtObj;
+}
+
+/*
+List of currently supported standard fonts:
+Courier, Courier-Bold, Courier-BoldOblique, Courier-Oblique
+Helvetica, Helvetica-Bold, Helvetica-BoldOblique, Helvetica-Oblique
+Times-Roman, Times-Bold, Times-Italic, Times-BoldItalic
+Symbol, ZapfDingbats
+*/
+
+const char* g_sFXEDITStandardFontName[] = {"Courier", "Courier-Bold", "Courier-BoldOblique", "Courier-Oblique",
+ "Helvetica", "Helvetica-Bold", "Helvetica-BoldOblique", "Helvetica-Oblique",
+ "Times-Roman", "Times-Bold", "Times-Italic", "Times-BoldItalic",
+ "Symbol", "ZapfDingbats"};
+
+static FX_BOOL FX_EDIT_IsStandardFont(const CFX_ByteString& sFontName)
+{
+ for (FX_INT32 i=0; i<14; i++)
+ {
+ if (sFontName == g_sFXEDITStandardFontName[i])
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+void IFX_Edit::GeneratePageObjects(CPDF_PageObjects* pPageObjects, IFX_Edit* pEdit,
+ const CPDF_Point& ptOffset, const CPVT_WordRange* pRange, FX_COLORREF crText, CFX_ArrayTemplate<CPDF_TextObject*>& ObjArray)
+{
+ FX_FLOAT fFontSize = pEdit->GetFontSize();
+
+ FX_INT32 nOldFontIndex = -1;
+
+ CFX_ByteTextBuf sTextBuf;
+ CPDF_Point ptBT(0.0f,0.0f);
+
+ ObjArray.RemoveAll();
+
+ if (IFX_Edit_Iterator* pIterator = pEdit->GetIterator())
+ {
+ if (IFX_Edit_FontMap* pFontMap = pEdit->GetFontMap())
+ {
+ if (pRange)
+ pIterator->SetAt(pRange->BeginPos);
+ else
+ pIterator->SetAt(0);
+
+ CPVT_WordPlace oldplace;
+
+ while (pIterator->NextWord())
+ {
+ CPVT_WordPlace place = pIterator->GetAt();
+ if (pRange && place.WordCmp(pRange->EndPos) > 0) break;
+
+ CPVT_Word word;
+ if (pIterator->GetWord(word))
+ {
+ if (place.LineCmp(oldplace) != 0 || nOldFontIndex != word.nFontIndex)
+ {
+ if (sTextBuf.GetLength() > 0)
+ {
+ ObjArray.Add(AddTextObjToPageObjects(pPageObjects, crText, pFontMap->GetPDFFont(nOldFontIndex), fFontSize, 0.0f, 100,
+ CPDF_Point(ptBT.x+ptOffset.x, ptBT.y+ptOffset.y), sTextBuf.GetByteString()));
+
+ sTextBuf.Clear();
+ }
+
+ ptBT = word.ptWord;
+ nOldFontIndex = word.nFontIndex;
+ }
+
+ sTextBuf << GetPDFWordString(pFontMap, word.nFontIndex, word.Word, 0);
+ oldplace = place;
+ }
+ }
+
+ if (sTextBuf.GetLength() > 0)
+ {
+ ObjArray.Add(AddTextObjToPageObjects(pPageObjects, crText, pFontMap->GetPDFFont(nOldFontIndex), fFontSize, 0.0f, 100,
+ CPDF_Point(ptBT.x+ptOffset.x, ptBT.y+ptOffset.y), sTextBuf.GetByteString()));
+ }
+ }
+ }
+}
+
+void IFX_Edit::GenerateRichPageObjects(CPDF_PageObjects* pPageObjects, IFX_Edit* pEdit,
+ const CPDF_Point& ptOffset, const CPVT_WordRange* pRange, CFX_ArrayTemplate<CPDF_TextObject*>& ObjArray)
+{
+
+
+ FX_COLORREF crCurText = ArgbEncode(255, 0, 0, 0);
+ FX_COLORREF crOld = crCurText;
+
+
+ CFX_ByteTextBuf sTextBuf;
+ CPVT_WordProps wp;
+ CPDF_Point ptBT(0.0f,0.0f);
+
+ ObjArray.RemoveAll();
+
+ if (IFX_Edit_Iterator* pIterator = pEdit->GetIterator())
+ {
+ if (IFX_Edit_FontMap* pFontMap = pEdit->GetFontMap())
+ {
+ if (pRange)
+ pIterator->SetAt(pRange->BeginPos);
+ else
+ pIterator->SetAt(0);
+
+ CPVT_WordPlace oldplace;
+
+ while (pIterator->NextWord())
+ {
+ CPVT_WordPlace place = pIterator->GetAt();
+ if (pRange && place.WordCmp(pRange->EndPos) > 0) break;
+
+ CPVT_Word word;
+ if (pIterator->GetWord(word))
+ {
+ word.WordProps.fFontSize = word.fFontSize;
+
+ crCurText = ArgbEncode(255,word.WordProps.dwWordColor);
+
+ if (place.LineCmp(oldplace) != 0 || word.WordProps.fCharSpace > 0.0f || word.WordProps.nHorzScale != 100 ||
+ FXSYS_memcmp(&word.WordProps, &wp, sizeof(CPVT_WordProps)) != 0 ||
+ crOld != crCurText)
+ {
+ if (sTextBuf.GetLength() > 0)
+ {
+ ObjArray.Add(AddTextObjToPageObjects(pPageObjects, crOld, pFontMap->GetPDFFont(wp.nFontIndex), wp.fFontSize, wp.fCharSpace, wp.nHorzScale,
+ CPDF_Point(ptBT.x+ptOffset.x, ptBT.y+ptOffset.y), sTextBuf.GetByteString()));
+
+ sTextBuf.Clear();
+ }
+
+ wp = word.WordProps;
+ ptBT = word.ptWord;
+ crOld = crCurText;
+
+ }
+
+ sTextBuf << GetPDFWordString(pFontMap, word.WordProps.nFontIndex, word.Word, 0);
+
+ if (word.WordProps.nWordStyle & PVTWORD_STYLE_UNDERLINE)
+ {/*
+ AddLineToPageObjects(pPageObjects, crCurText,
+ CPDF_Point(word.ptWord.x, word.ptWord.y + word.fDescent * 0.4f),
+ CPDF_Point(word.ptWord.x + word.fWidth, word.ptWord.y + word.fDescent * 0.4f));
+*/
+ CPDF_Rect rcUnderline = GetUnderLineRect(word);
+ rcUnderline.left += ptOffset.x;
+ rcUnderline.right += ptOffset.x;
+ rcUnderline.top += ptOffset.y;
+ rcUnderline.bottom += ptOffset.y;
+
+ AddRectToPageObjects(pPageObjects, crCurText, rcUnderline);
+ }
+
+ if (word.WordProps.nWordStyle & PVTWORD_STYLE_CROSSOUT)
+ {
+ CPDF_Rect rcCrossout = GetCrossoutRect(word);
+ rcCrossout.left += ptOffset.x;
+ rcCrossout.right += ptOffset.x;
+ rcCrossout.top += ptOffset.y;
+ rcCrossout.bottom += ptOffset.y;
+
+ AddRectToPageObjects(pPageObjects, crCurText, rcCrossout);
+ }
+
+ oldplace = place;
+ }
+ }
+
+ if (sTextBuf.GetLength() > 0)
+ {
+ ObjArray.Add(AddTextObjToPageObjects(pPageObjects, crOld, pFontMap->GetPDFFont(wp.nFontIndex), wp.fFontSize, wp.fCharSpace, wp.nHorzScale,
+ CPDF_Point(ptBT.x+ptOffset.x, ptBT.y+ptOffset.y), sTextBuf.GetByteString()));
+ }
+ }
+ }
+}
+
+void IFX_Edit::GenerateUnderlineObjects(CPDF_PageObjects* pPageObjects, IFX_Edit* pEdit,
+ const CPDF_Point& ptOffset, const CPVT_WordRange* pRange, FX_COLORREF color)
+{
+
+
+ if (IFX_Edit_Iterator* pIterator = pEdit->GetIterator())
+ {
+ if (pEdit->GetFontMap())
+ {
+ if (pRange)
+ pIterator->SetAt(pRange->BeginPos);
+ else
+ pIterator->SetAt(0);
+
+ CPVT_WordPlace oldplace;
+
+ while (pIterator->NextWord())
+ {
+ CPVT_WordPlace place = pIterator->GetAt();
+ if (pRange && place.WordCmp(pRange->EndPos) > 0) break;
+
+ CPVT_Word word;
+ if (pIterator->GetWord(word))
+ {
+ CPDF_Rect rcUnderline = GetUnderLineRect(word);
+ rcUnderline.left += ptOffset.x;
+ rcUnderline.right += ptOffset.x;
+ rcUnderline.top += ptOffset.y;
+ rcUnderline.bottom += ptOffset.y;
+ AddRectToPageObjects(pPageObjects, color, rcUnderline);
+ }
+ }
+ }
+ }
+}
+
diff --git a/fpdfsdk/src/javascript/Consts.cpp b/fpdfsdk/src/javascript/Consts.cpp
index 09b8f8e1a0..278cd7eab8 100644
--- a/fpdfsdk/src/javascript/Consts.cpp
+++ b/fpdfsdk/src/javascript/Consts.cpp
@@ -1,247 +1,247 @@
-// 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
-
-#include "../../include/javascript/JavaScript.h"
-#include "../../include/javascript/IJavaScript.h"
-#include "../../include/javascript/JS_Define.h"
-#include "../../include/javascript/JS_Object.h"
-#include "../../include/javascript/JS_Value.h"
-#include "../../include/javascript/Consts.h"
-
-/* ------------------------------ border ------------------------------ */
-
-BEGIN_JS_STATIC_CONST(CJS_Border)
- JS_STATIC_CONST_ENTRY_STRING(s, solid)
- JS_STATIC_CONST_ENTRY_STRING(b, beveled)
- JS_STATIC_CONST_ENTRY_STRING(d, dashed)
- JS_STATIC_CONST_ENTRY_STRING(i, inset)
- JS_STATIC_CONST_ENTRY_STRING(u, underline)
-END_JS_STATIC_CONST()
-
-IMPLEMENT_JS_CLASS_CONST(CJS_Border,border)
-
-/* ------------------------------ display ------------------------------ */
-
-BEGIN_JS_STATIC_CONST(CJS_Display)
- JS_STATIC_CONST_ENTRY_NUMBER(visible, 0)
- JS_STATIC_CONST_ENTRY_NUMBER(hidden, 1)
- JS_STATIC_CONST_ENTRY_NUMBER(noPrint, 2)
- JS_STATIC_CONST_ENTRY_NUMBER(noView, 3)
-END_JS_STATIC_CONST()
-
-IMPLEMENT_JS_CLASS_CONST(CJS_Display,display)
-
-/* ------------------------------ font ------------------------------ */
-
-BEGIN_JS_STATIC_CONST(CJS_Font)
- JS_STATIC_CONST_ENTRY_STRING(Times, Times-Roman)
- JS_STATIC_CONST_ENTRY_STRING(TimesB, Times-Bold)
- JS_STATIC_CONST_ENTRY_STRING(TimesI, Times-Italic)
- JS_STATIC_CONST_ENTRY_STRING(TimesBI, Times-BoldItalic)
- JS_STATIC_CONST_ENTRY_STRING(Helv, Helvetica)
- JS_STATIC_CONST_ENTRY_STRING(HelvB, Helvetica-Bold)
- JS_STATIC_CONST_ENTRY_STRING(HelvI, Helvetica-Oblique)
- JS_STATIC_CONST_ENTRY_STRING(HelvBI, Helvetica-BoldOblique)
- JS_STATIC_CONST_ENTRY_STRING(Cour, Courier)
- JS_STATIC_CONST_ENTRY_STRING(CourB, Courier-Bold)
- JS_STATIC_CONST_ENTRY_STRING(CourI, Courier-Oblique)
- JS_STATIC_CONST_ENTRY_STRING(CourBI, Courier-BoldOblique)
- JS_STATIC_CONST_ENTRY_STRING(Symbol, Symbol)
- JS_STATIC_CONST_ENTRY_STRING(ZapfD, ZapfDingbats)
-END_JS_STATIC_CONST()
-
-IMPLEMENT_JS_CLASS_CONST(CJS_Font,font)
-
-/* ------------------------------ highlight ------------------------------ */
-
-BEGIN_JS_STATIC_CONST(CJS_Highlight)
- JS_STATIC_CONST_ENTRY_STRING(n, none)
- JS_STATIC_CONST_ENTRY_STRING(i, invert)
- JS_STATIC_CONST_ENTRY_STRING(p, push)
- JS_STATIC_CONST_ENTRY_STRING(o, outline)
-END_JS_STATIC_CONST()
-
-IMPLEMENT_JS_CLASS_CONST(CJS_Highlight,highlight)
-
-/* ------------------------------ position ------------------------------ */
-
-BEGIN_JS_STATIC_CONST(CJS_Position)
- JS_STATIC_CONST_ENTRY_NUMBER(textOnly, 0)
- JS_STATIC_CONST_ENTRY_NUMBER(iconOnly, 1)
- JS_STATIC_CONST_ENTRY_NUMBER(iconTextV, 2)
- JS_STATIC_CONST_ENTRY_NUMBER(textIconV, 3)
- JS_STATIC_CONST_ENTRY_NUMBER(iconTextH, 4)
- JS_STATIC_CONST_ENTRY_NUMBER(textIconH, 5)
- JS_STATIC_CONST_ENTRY_NUMBER(overlay, 6)
-END_JS_STATIC_CONST()
-
-IMPLEMENT_JS_CLASS_CONST(CJS_Position,position)
-
-/* ------------------------------ scaleHow ------------------------------ */
-
-BEGIN_JS_STATIC_CONST(CJS_ScaleHow)
- JS_STATIC_CONST_ENTRY_NUMBER(proportional, 0)
- JS_STATIC_CONST_ENTRY_NUMBER(anamorphic, 1)
-END_JS_STATIC_CONST()
-
-IMPLEMENT_JS_CLASS_CONST(CJS_ScaleHow,scaleHow)
-
-/* ------------------------------ scaleWhen ------------------------------ */
-
-BEGIN_JS_STATIC_CONST(CJS_ScaleWhen)
- JS_STATIC_CONST_ENTRY_NUMBER(always, 0)
- JS_STATIC_CONST_ENTRY_NUMBER(never, 1)
- JS_STATIC_CONST_ENTRY_NUMBER(tooBig, 2)
- JS_STATIC_CONST_ENTRY_NUMBER(tooSmall, 3)
-END_JS_STATIC_CONST()
-
-IMPLEMENT_JS_CLASS_CONST(CJS_ScaleWhen,scaleWhen)
-
-/* ------------------------------ style ------------------------------ */
-
-BEGIN_JS_STATIC_CONST(CJS_Style)
- JS_STATIC_CONST_ENTRY_STRING(ch, check)
- JS_STATIC_CONST_ENTRY_STRING(cr, cross)
- JS_STATIC_CONST_ENTRY_STRING(di, diamond)
- JS_STATIC_CONST_ENTRY_STRING(ci, circle)
- JS_STATIC_CONST_ENTRY_STRING(st, star)
- JS_STATIC_CONST_ENTRY_STRING(sq, square)
-END_JS_STATIC_CONST()
-
-IMPLEMENT_JS_CLASS_CONST(CJS_Style,style)
-
-
-/* ------------------------------ zoomtype ------------------------------ */
-
-BEGIN_JS_STATIC_CONST(CJS_Zoomtype)
- JS_STATIC_CONST_ENTRY_STRING(none, NoVary)
- JS_STATIC_CONST_ENTRY_STRING(fitP, FitPage)
- JS_STATIC_CONST_ENTRY_STRING(fitW, FitWidth)
- JS_STATIC_CONST_ENTRY_STRING(fitH, FitHeight)
- JS_STATIC_CONST_ENTRY_STRING(fitV, FitVisibleWidth)
- JS_STATIC_CONST_ENTRY_STRING(pref, Preferred)
- JS_STATIC_CONST_ENTRY_STRING(refW, ReflowWidth)
-END_JS_STATIC_CONST()
-
-IMPLEMENT_JS_CLASS_CONST(CJS_Zoomtype,zoomtype)
-
-/* ------------------------------ CJS_GlobalConsts ------------------------------ */
-
-int CJS_GlobalConsts::Init(IJS_Runtime* pRuntime)
-{
- DEFINE_GLOBAL_CONST(pRuntime, IDS_GREATER_THAN , Invalid value: must be greater than or equal to %s.);
- DEFINE_GLOBAL_CONST(pRuntime, IDS_GT_AND_LT,Invalid value: must be greater than or equal to %s and less than or equal to %s.);
- DEFINE_GLOBAL_CONST(pRuntime, IDS_LESS_THAN,Invalid value: must be less than or equal to %s.);
- DEFINE_GLOBAL_CONST(pRuntime, IDS_INVALID_MONTH,** Invalid **);
- DEFINE_GLOBAL_CONST(pRuntime, IDS_INVALID_DATE,Invalid date/time: please ensure that the date/time exists. Field);
- DEFINE_GLOBAL_CONST(pRuntime, IDS_INVALID_VALUE,The value entered does not match the format of the field);
- DEFINE_GLOBAL_CONST(pRuntime, IDS_AM,am);
- DEFINE_GLOBAL_CONST(pRuntime, IDS_PM,pm);
- DEFINE_GLOBAL_CONST(pRuntime, IDS_MONTH_INFO,January[1]February[2]March[3]April[4]May[5]June[6]July[7]August[8]September[9]October[10]November[11]December[12]Sept[9]Jan[1]Feb[2]Mar[3]Apr[4]Jun[6]Jul[7]Aug[8]Sep[9]Oct[10]Nov[11]Dec[12]);
- DEFINE_GLOBAL_CONST(pRuntime, IDS_STARTUP_CONSOLE_MSG, ** ^_^ **);
-
- return 0;
-}
-
-/* ------------------------------ CJS_GlobalArrays ------------------------------ */
-
-int CJS_GlobalArrays::Init(IJS_Runtime* pRuntime)
-{
- {
- FX_LPCWSTR ArrayName = (FX_LPCWSTR)L"RE_NUMBER_ENTRY_DOT_SEP";
- FX_LPCWSTR ArrayContent[] = {(FX_LPCWSTR)L"[+-]?\\d*\\.?\\d*"};
- DEFINE_GLOBAL_ARRAY(pRuntime);
- }
-
- {
- FX_LPCWSTR ArrayName = (FX_LPCWSTR)L"RE_NUMBER_COMMIT_DOT_SEP";
- FX_LPCWSTR ArrayContent[] = {(FX_LPCWSTR)L"[+-]?\\d+(\\.\\d+)?", /* -1.0 or -1 */
- (FX_LPCWSTR)L"[+-]?\\.\\d+", /* -.1 */
- (FX_LPCWSTR)L"[+-]?\\d+\\." /* -1. */
- };
- DEFINE_GLOBAL_ARRAY(pRuntime);
- }
-
- {
- FX_LPCWSTR ArrayName = (FX_LPCWSTR)L"RE_NUMBER_ENTRY_COMMA_SEP";
- FX_LPCWSTR ArrayContent[] = {(FX_LPCWSTR)L"[+-]?\\d*,?\\d*"};
-
- DEFINE_GLOBAL_ARRAY(pRuntime);
- }
-
- {
- FX_LPCWSTR ArrayName = (FX_LPCWSTR)L"RE_NUMBER_COMMIT_COMMA_SEP";
- FX_LPCWSTR ArrayContent[] = {(FX_LPCWSTR)L"[+-]?\\d+([.,]\\d+)?", /* -1,0 or -1 */
- (FX_LPCWSTR)L"[+-]?[.,]\\d+", /* -,1 */
- (FX_LPCWSTR)L"[+-]?\\d+[.,]" /* -1, */
- };
- DEFINE_GLOBAL_ARRAY(pRuntime);
- }
-
- {
- FX_LPCWSTR ArrayName = (FX_LPCWSTR)L"RE_ZIP_ENTRY";
- FX_LPCWSTR ArrayContent[] = {(FX_LPCWSTR)L"\\d{0,5}"};
- DEFINE_GLOBAL_ARRAY(pRuntime);
- }
-
- {
- FX_LPCWSTR ArrayName = (FX_LPCWSTR)L"RE_ZIP_COMMIT";
- FX_LPCWSTR ArrayContent[] = {(FX_LPCWSTR)L"\\d{5}"};
- DEFINE_GLOBAL_ARRAY(pRuntime);
- }
-
- {
- FX_LPCWSTR ArrayName = (FX_LPCWSTR)L"RE_ZIP4_ENTRY";
- FX_LPCWSTR ArrayContent[] = {(FX_LPCWSTR)L"\\d{0,5}(\\.|[- ])?\\d{0,4}"};
- DEFINE_GLOBAL_ARRAY(pRuntime);
- }
-
- {
- FX_LPCWSTR ArrayName = (FX_LPCWSTR)L"RE_ZIP4_COMMIT";
- FX_LPCWSTR ArrayContent[] = {(FX_LPCWSTR)L"\\d{5}(\\.|[- ])?\\d{4}"};
- DEFINE_GLOBAL_ARRAY(pRuntime);
- }
-
- {
- FX_LPCWSTR ArrayName = (FX_LPCWSTR)L"RE_PHONE_ENTRY";
- FX_LPCWSTR ArrayContent[] = {
- (FX_LPCWSTR)L"\\d{0,3}(\\.|[- ])?\\d{0,3}(\\.|[- ])?\\d{0,4}", /* 555-1234 or 408 555-1234 */
- (FX_LPCWSTR)L"\\(\\d{0,3}", /* (408 */
- (FX_LPCWSTR)L"\\(\\d{0,3}\\)(\\.|[- ])?\\d{0,3}(\\.|[- ])?\\d{0,4}", /* (408) 555-1234 */
- /* (allow the addition of parens as an afterthought) */
- (FX_LPCWSTR)L"\\(\\d{0,3}(\\.|[- ])?\\d{0,3}(\\.|[- ])?\\d{0,4}", /* (408 555-1234 */
- (FX_LPCWSTR)L"\\d{0,3}\\)(\\.|[- ])?\\d{0,3}(\\.|[- ])?\\d{0,4}", /* 408) 555-1234 */
- (FX_LPCWSTR)L"011(\\.|[- \\d])*" /* international */
- };
- DEFINE_GLOBAL_ARRAY(pRuntime);
- }
-
- {
- FX_LPCWSTR ArrayName = (FX_LPCWSTR)L"RE_PHONE_COMMIT";
- FX_LPCWSTR ArrayContent[] = {
- (FX_LPCWSTR)L"\\d{3}(\\.|[- ])?\\d{4}", /* 555-1234 */
- (FX_LPCWSTR)L"\\d{3}(\\.|[- ])?\\d{3}(\\.|[- ])?\\d{4}", /* 408 555-1234 */
- (FX_LPCWSTR)L"\\(\\d{3}\\)(\\.|[- ])?\\d{3}(\\.|[- ])?\\d{4}", /* (408) 555-1234 */
- (FX_LPCWSTR)L"011(\\.|[- \\d])*" /* international */
- };
- DEFINE_GLOBAL_ARRAY(pRuntime);
- }
-
- {
- FX_LPCWSTR ArrayName = (FX_LPCWSTR)L"RE_SSN_ENTRY";
- FX_LPCWSTR ArrayContent[] = {(FX_LPCWSTR)L"\\d{0,3}(\\.|[- ])?\\d{0,2}(\\.|[- ])?\\d{0,4}"};
- DEFINE_GLOBAL_ARRAY(pRuntime);
- }
-
- {
- FX_LPCWSTR ArrayName = (FX_LPCWSTR)L"RE_SSN_COMMIT";
- FX_LPCWSTR ArrayContent[] = {(FX_LPCWSTR)L"\\d{3}(\\.|[- ])?\\d{2}(\\.|[- ])?\\d{4}"};
- DEFINE_GLOBAL_ARRAY(pRuntime);
- }
-
- return 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
+
+#include "../../include/javascript/JavaScript.h"
+#include "../../include/javascript/IJavaScript.h"
+#include "../../include/javascript/JS_Define.h"
+#include "../../include/javascript/JS_Object.h"
+#include "../../include/javascript/JS_Value.h"
+#include "../../include/javascript/Consts.h"
+
+/* ------------------------------ border ------------------------------ */
+
+BEGIN_JS_STATIC_CONST(CJS_Border)
+ JS_STATIC_CONST_ENTRY_STRING(s, solid)
+ JS_STATIC_CONST_ENTRY_STRING(b, beveled)
+ JS_STATIC_CONST_ENTRY_STRING(d, dashed)
+ JS_STATIC_CONST_ENTRY_STRING(i, inset)
+ JS_STATIC_CONST_ENTRY_STRING(u, underline)
+END_JS_STATIC_CONST()
+
+IMPLEMENT_JS_CLASS_CONST(CJS_Border,border)
+
+/* ------------------------------ display ------------------------------ */
+
+BEGIN_JS_STATIC_CONST(CJS_Display)
+ JS_STATIC_CONST_ENTRY_NUMBER(visible, 0)
+ JS_STATIC_CONST_ENTRY_NUMBER(hidden, 1)
+ JS_STATIC_CONST_ENTRY_NUMBER(noPrint, 2)
+ JS_STATIC_CONST_ENTRY_NUMBER(noView, 3)
+END_JS_STATIC_CONST()
+
+IMPLEMENT_JS_CLASS_CONST(CJS_Display,display)
+
+/* ------------------------------ font ------------------------------ */
+
+BEGIN_JS_STATIC_CONST(CJS_Font)
+ JS_STATIC_CONST_ENTRY_STRING(Times, Times-Roman)
+ JS_STATIC_CONST_ENTRY_STRING(TimesB, Times-Bold)
+ JS_STATIC_CONST_ENTRY_STRING(TimesI, Times-Italic)
+ JS_STATIC_CONST_ENTRY_STRING(TimesBI, Times-BoldItalic)
+ JS_STATIC_CONST_ENTRY_STRING(Helv, Helvetica)
+ JS_STATIC_CONST_ENTRY_STRING(HelvB, Helvetica-Bold)
+ JS_STATIC_CONST_ENTRY_STRING(HelvI, Helvetica-Oblique)
+ JS_STATIC_CONST_ENTRY_STRING(HelvBI, Helvetica-BoldOblique)
+ JS_STATIC_CONST_ENTRY_STRING(Cour, Courier)
+ JS_STATIC_CONST_ENTRY_STRING(CourB, Courier-Bold)
+ JS_STATIC_CONST_ENTRY_STRING(CourI, Courier-Oblique)
+ JS_STATIC_CONST_ENTRY_STRING(CourBI, Courier-BoldOblique)
+ JS_STATIC_CONST_ENTRY_STRING(Symbol, Symbol)
+ JS_STATIC_CONST_ENTRY_STRING(ZapfD, ZapfDingbats)
+END_JS_STATIC_CONST()
+
+IMPLEMENT_JS_CLASS_CONST(CJS_Font,font)
+
+/* ------------------------------ highlight ------------------------------ */
+
+BEGIN_JS_STATIC_CONST(CJS_Highlight)
+ JS_STATIC_CONST_ENTRY_STRING(n, none)
+ JS_STATIC_CONST_ENTRY_STRING(i, invert)
+ JS_STATIC_CONST_ENTRY_STRING(p, push)
+ JS_STATIC_CONST_ENTRY_STRING(o, outline)
+END_JS_STATIC_CONST()
+
+IMPLEMENT_JS_CLASS_CONST(CJS_Highlight,highlight)
+
+/* ------------------------------ position ------------------------------ */
+
+BEGIN_JS_STATIC_CONST(CJS_Position)
+ JS_STATIC_CONST_ENTRY_NUMBER(textOnly, 0)
+ JS_STATIC_CONST_ENTRY_NUMBER(iconOnly, 1)
+ JS_STATIC_CONST_ENTRY_NUMBER(iconTextV, 2)
+ JS_STATIC_CONST_ENTRY_NUMBER(textIconV, 3)
+ JS_STATIC_CONST_ENTRY_NUMBER(iconTextH, 4)
+ JS_STATIC_CONST_ENTRY_NUMBER(textIconH, 5)
+ JS_STATIC_CONST_ENTRY_NUMBER(overlay, 6)
+END_JS_STATIC_CONST()
+
+IMPLEMENT_JS_CLASS_CONST(CJS_Position,position)
+
+/* ------------------------------ scaleHow ------------------------------ */
+
+BEGIN_JS_STATIC_CONST(CJS_ScaleHow)
+ JS_STATIC_CONST_ENTRY_NUMBER(proportional, 0)
+ JS_STATIC_CONST_ENTRY_NUMBER(anamorphic, 1)
+END_JS_STATIC_CONST()
+
+IMPLEMENT_JS_CLASS_CONST(CJS_ScaleHow,scaleHow)
+
+/* ------------------------------ scaleWhen ------------------------------ */
+
+BEGIN_JS_STATIC_CONST(CJS_ScaleWhen)
+ JS_STATIC_CONST_ENTRY_NUMBER(always, 0)
+ JS_STATIC_CONST_ENTRY_NUMBER(never, 1)
+ JS_STATIC_CONST_ENTRY_NUMBER(tooBig, 2)
+ JS_STATIC_CONST_ENTRY_NUMBER(tooSmall, 3)
+END_JS_STATIC_CONST()
+
+IMPLEMENT_JS_CLASS_CONST(CJS_ScaleWhen,scaleWhen)
+
+/* ------------------------------ style ------------------------------ */
+
+BEGIN_JS_STATIC_CONST(CJS_Style)
+ JS_STATIC_CONST_ENTRY_STRING(ch, check)
+ JS_STATIC_CONST_ENTRY_STRING(cr, cross)
+ JS_STATIC_CONST_ENTRY_STRING(di, diamond)
+ JS_STATIC_CONST_ENTRY_STRING(ci, circle)
+ JS_STATIC_CONST_ENTRY_STRING(st, star)
+ JS_STATIC_CONST_ENTRY_STRING(sq, square)
+END_JS_STATIC_CONST()
+
+IMPLEMENT_JS_CLASS_CONST(CJS_Style,style)
+
+
+/* ------------------------------ zoomtype ------------------------------ */
+
+BEGIN_JS_STATIC_CONST(CJS_Zoomtype)
+ JS_STATIC_CONST_ENTRY_STRING(none, NoVary)
+ JS_STATIC_CONST_ENTRY_STRING(fitP, FitPage)
+ JS_STATIC_CONST_ENTRY_STRING(fitW, FitWidth)
+ JS_STATIC_CONST_ENTRY_STRING(fitH, FitHeight)
+ JS_STATIC_CONST_ENTRY_STRING(fitV, FitVisibleWidth)
+ JS_STATIC_CONST_ENTRY_STRING(pref, Preferred)
+ JS_STATIC_CONST_ENTRY_STRING(refW, ReflowWidth)
+END_JS_STATIC_CONST()
+
+IMPLEMENT_JS_CLASS_CONST(CJS_Zoomtype,zoomtype)
+
+/* ------------------------------ CJS_GlobalConsts ------------------------------ */
+
+int CJS_GlobalConsts::Init(IJS_Runtime* pRuntime)
+{
+ DEFINE_GLOBAL_CONST(pRuntime, IDS_GREATER_THAN , Invalid value: must be greater than or equal to %s.);
+ DEFINE_GLOBAL_CONST(pRuntime, IDS_GT_AND_LT,Invalid value: must be greater than or equal to %s and less than or equal to %s.);
+ DEFINE_GLOBAL_CONST(pRuntime, IDS_LESS_THAN,Invalid value: must be less than or equal to %s.);
+ DEFINE_GLOBAL_CONST(pRuntime, IDS_INVALID_MONTH,** Invalid **);
+ DEFINE_GLOBAL_CONST(pRuntime, IDS_INVALID_DATE,Invalid date/time: please ensure that the date/time exists. Field);
+ DEFINE_GLOBAL_CONST(pRuntime, IDS_INVALID_VALUE,The value entered does not match the format of the field);
+ DEFINE_GLOBAL_CONST(pRuntime, IDS_AM,am);
+ DEFINE_GLOBAL_CONST(pRuntime, IDS_PM,pm);
+ DEFINE_GLOBAL_CONST(pRuntime, IDS_MONTH_INFO,January[1]February[2]March[3]April[4]May[5]June[6]July[7]August[8]September[9]October[10]November[11]December[12]Sept[9]Jan[1]Feb[2]Mar[3]Apr[4]Jun[6]Jul[7]Aug[8]Sep[9]Oct[10]Nov[11]Dec[12]);
+ DEFINE_GLOBAL_CONST(pRuntime, IDS_STARTUP_CONSOLE_MSG, ** ^_^ **);
+
+ return 0;
+}
+
+/* ------------------------------ CJS_GlobalArrays ------------------------------ */
+
+int CJS_GlobalArrays::Init(IJS_Runtime* pRuntime)
+{
+ {
+ FX_LPCWSTR ArrayName = (FX_LPCWSTR)L"RE_NUMBER_ENTRY_DOT_SEP";
+ FX_LPCWSTR ArrayContent[] = {(FX_LPCWSTR)L"[+-]?\\d*\\.?\\d*"};
+ DEFINE_GLOBAL_ARRAY(pRuntime);
+ }
+
+ {
+ FX_LPCWSTR ArrayName = (FX_LPCWSTR)L"RE_NUMBER_COMMIT_DOT_SEP";
+ FX_LPCWSTR ArrayContent[] = {(FX_LPCWSTR)L"[+-]?\\d+(\\.\\d+)?", /* -1.0 or -1 */
+ (FX_LPCWSTR)L"[+-]?\\.\\d+", /* -.1 */
+ (FX_LPCWSTR)L"[+-]?\\d+\\." /* -1. */
+ };
+ DEFINE_GLOBAL_ARRAY(pRuntime);
+ }
+
+ {
+ FX_LPCWSTR ArrayName = (FX_LPCWSTR)L"RE_NUMBER_ENTRY_COMMA_SEP";
+ FX_LPCWSTR ArrayContent[] = {(FX_LPCWSTR)L"[+-]?\\d*,?\\d*"};
+
+ DEFINE_GLOBAL_ARRAY(pRuntime);
+ }
+
+ {
+ FX_LPCWSTR ArrayName = (FX_LPCWSTR)L"RE_NUMBER_COMMIT_COMMA_SEP";
+ FX_LPCWSTR ArrayContent[] = {(FX_LPCWSTR)L"[+-]?\\d+([.,]\\d+)?", /* -1,0 or -1 */
+ (FX_LPCWSTR)L"[+-]?[.,]\\d+", /* -,1 */
+ (FX_LPCWSTR)L"[+-]?\\d+[.,]" /* -1, */
+ };
+ DEFINE_GLOBAL_ARRAY(pRuntime);
+ }
+
+ {
+ FX_LPCWSTR ArrayName = (FX_LPCWSTR)L"RE_ZIP_ENTRY";
+ FX_LPCWSTR ArrayContent[] = {(FX_LPCWSTR)L"\\d{0,5}"};
+ DEFINE_GLOBAL_ARRAY(pRuntime);
+ }
+
+ {
+ FX_LPCWSTR ArrayName = (FX_LPCWSTR)L"RE_ZIP_COMMIT";
+ FX_LPCWSTR ArrayContent[] = {(FX_LPCWSTR)L"\\d{5}"};
+ DEFINE_GLOBAL_ARRAY(pRuntime);
+ }
+
+ {
+ FX_LPCWSTR ArrayName = (FX_LPCWSTR)L"RE_ZIP4_ENTRY";
+ FX_LPCWSTR ArrayContent[] = {(FX_LPCWSTR)L"\\d{0,5}(\\.|[- ])?\\d{0,4}"};
+ DEFINE_GLOBAL_ARRAY(pRuntime);
+ }
+
+ {
+ FX_LPCWSTR ArrayName = (FX_LPCWSTR)L"RE_ZIP4_COMMIT";
+ FX_LPCWSTR ArrayContent[] = {(FX_LPCWSTR)L"\\d{5}(\\.|[- ])?\\d{4}"};
+ DEFINE_GLOBAL_ARRAY(pRuntime);
+ }
+
+ {
+ FX_LPCWSTR ArrayName = (FX_LPCWSTR)L"RE_PHONE_ENTRY";
+ FX_LPCWSTR ArrayContent[] = {
+ (FX_LPCWSTR)L"\\d{0,3}(\\.|[- ])?\\d{0,3}(\\.|[- ])?\\d{0,4}", /* 555-1234 or 408 555-1234 */
+ (FX_LPCWSTR)L"\\(\\d{0,3}", /* (408 */
+ (FX_LPCWSTR)L"\\(\\d{0,3}\\)(\\.|[- ])?\\d{0,3}(\\.|[- ])?\\d{0,4}", /* (408) 555-1234 */
+ /* (allow the addition of parens as an afterthought) */
+ (FX_LPCWSTR)L"\\(\\d{0,3}(\\.|[- ])?\\d{0,3}(\\.|[- ])?\\d{0,4}", /* (408 555-1234 */
+ (FX_LPCWSTR)L"\\d{0,3}\\)(\\.|[- ])?\\d{0,3}(\\.|[- ])?\\d{0,4}", /* 408) 555-1234 */
+ (FX_LPCWSTR)L"011(\\.|[- \\d])*" /* international */
+ };
+ DEFINE_GLOBAL_ARRAY(pRuntime);
+ }
+
+ {
+ FX_LPCWSTR ArrayName = (FX_LPCWSTR)L"RE_PHONE_COMMIT";
+ FX_LPCWSTR ArrayContent[] = {
+ (FX_LPCWSTR)L"\\d{3}(\\.|[- ])?\\d{4}", /* 555-1234 */
+ (FX_LPCWSTR)L"\\d{3}(\\.|[- ])?\\d{3}(\\.|[- ])?\\d{4}", /* 408 555-1234 */
+ (FX_LPCWSTR)L"\\(\\d{3}\\)(\\.|[- ])?\\d{3}(\\.|[- ])?\\d{4}", /* (408) 555-1234 */
+ (FX_LPCWSTR)L"011(\\.|[- \\d])*" /* international */
+ };
+ DEFINE_GLOBAL_ARRAY(pRuntime);
+ }
+
+ {
+ FX_LPCWSTR ArrayName = (FX_LPCWSTR)L"RE_SSN_ENTRY";
+ FX_LPCWSTR ArrayContent[] = {(FX_LPCWSTR)L"\\d{0,3}(\\.|[- ])?\\d{0,2}(\\.|[- ])?\\d{0,4}"};
+ DEFINE_GLOBAL_ARRAY(pRuntime);
+ }
+
+ {
+ FX_LPCWSTR ArrayName = (FX_LPCWSTR)L"RE_SSN_COMMIT";
+ FX_LPCWSTR ArrayContent[] = {(FX_LPCWSTR)L"\\d{3}(\\.|[- ])?\\d{2}(\\.|[- ])?\\d{4}"};
+ DEFINE_GLOBAL_ARRAY(pRuntime);
+ }
+
+ return 0;
+}
+
diff --git a/fpdfsdk/src/javascript/Document.cpp b/fpdfsdk/src/javascript/Document.cpp
index ec930b810d..0a6acfaea7 100644
--- a/fpdfsdk/src/javascript/Document.cpp
+++ b/fpdfsdk/src/javascript/Document.cpp
@@ -1,2527 +1,2527 @@
-// 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
-
-#include "../../include/javascript/JavaScript.h"
-#include "../../include/javascript/IJavaScript.h"
-#include "../../include/javascript/JS_Define.h"
-#include "../../include/javascript/JS_Object.h"
-#include "../../include/javascript/JS_Value.h"
-#include "../../include/javascript/Document.h"
-#include "../../include/javascript/JS_EventHandler.h"
-#include "../../include/javascript/JS_Context.h"
-#include "../../include/javascript/JS_Runtime.h"
-#include "../../include/javascript/app.h"
-#include "../../include/javascript/Field.h"
-#include "../../include/javascript/Icon.h"
-#include "../../include/javascript/Field.h"
-
-static v8::Isolate* GetIsolate(IFXJS_Context* cc)
-{
- CJS_Context* pContext = (CJS_Context *)cc;
- ASSERT(pContext != NULL);
-
- CJS_Runtime* pRuntime = pContext->GetJSRuntime();
- ASSERT(pRuntime != NULL);
-
- return pRuntime->GetIsolate();
-}
-
-BEGIN_JS_STATIC_CONST(CJS_PrintParamsObj)
-END_JS_STATIC_CONST()
-
-BEGIN_JS_STATIC_PROP(CJS_PrintParamsObj)
-END_JS_STATIC_PROP()
-
-BEGIN_JS_STATIC_METHOD(CJS_PrintParamsObj)
-END_JS_STATIC_METHOD()
-
-IMPLEMENT_JS_CLASS(CJS_PrintParamsObj, PrintParamsObj)
-
-PrintParamsObj::PrintParamsObj(CJS_Object* pJSObject)
-: CJS_EmbedObj(pJSObject)
-{
- bUI = TRUE;
- nStart = 0;
- nEnd = 0;
- bSilent = FALSE;
- bShrinkToFit = FALSE;
- bPrintAsImage = FALSE;
- bReverse = FALSE;
- bAnnotations = TRUE;
-}
-
-/* ---------------------- Document ---------------------- */
-
-#define MINWIDTH 5.0f
-#define MINHEIGHT 5.0f
-
-BEGIN_JS_STATIC_CONST(CJS_Document)
-END_JS_STATIC_CONST()
-
-BEGIN_JS_STATIC_PROP(CJS_Document)
- JS_STATIC_PROP_ENTRY(ADBE)
- JS_STATIC_PROP_ENTRY(author)
- JS_STATIC_PROP_ENTRY(baseURL)
- JS_STATIC_PROP_ENTRY(bookmarkRoot)
- JS_STATIC_PROP_ENTRY(calculate)
- JS_STATIC_PROP_ENTRY(Collab)
- JS_STATIC_PROP_ENTRY(creationDate)
- JS_STATIC_PROP_ENTRY(creator)
- JS_STATIC_PROP_ENTRY(delay)
- JS_STATIC_PROP_ENTRY(dirty)
- JS_STATIC_PROP_ENTRY(documentFileName)
- JS_STATIC_PROP_ENTRY(external)
- JS_STATIC_PROP_ENTRY(filesize)
- JS_STATIC_PROP_ENTRY(icons)
- JS_STATIC_PROP_ENTRY(info)
- JS_STATIC_PROP_ENTRY(keywords)
- JS_STATIC_PROP_ENTRY(layout)
- JS_STATIC_PROP_ENTRY(media)
- JS_STATIC_PROP_ENTRY(modDate)
- JS_STATIC_PROP_ENTRY(mouseX)
- JS_STATIC_PROP_ENTRY(mouseY)
- JS_STATIC_PROP_ENTRY(numFields)
- JS_STATIC_PROP_ENTRY(numPages)
- JS_STATIC_PROP_ENTRY(pageNum)
- JS_STATIC_PROP_ENTRY(pageWindowRect)
- JS_STATIC_PROP_ENTRY(path)
- JS_STATIC_PROP_ENTRY(producer)
- JS_STATIC_PROP_ENTRY(subject)
- JS_STATIC_PROP_ENTRY(title)
- JS_STATIC_PROP_ENTRY(zoom)
- JS_STATIC_PROP_ENTRY(zoomType)
-END_JS_STATIC_PROP()
-
-BEGIN_JS_STATIC_METHOD(CJS_Document)
- JS_STATIC_METHOD_ENTRY(addAnnot,0)
- JS_STATIC_METHOD_ENTRY(addField, 4)
- JS_STATIC_METHOD_ENTRY(addLink, 0)
- JS_STATIC_METHOD_ENTRY(addIcon, 0)
- JS_STATIC_METHOD_ENTRY(calculateNow, 0)
- JS_STATIC_METHOD_ENTRY(closeDoc, 0)
- JS_STATIC_METHOD_ENTRY(createDataObject, 0)
- JS_STATIC_METHOD_ENTRY(deletePages, 2)
- JS_STATIC_METHOD_ENTRY(exportAsText, 3)
- JS_STATIC_METHOD_ENTRY(exportAsFDF, 6)
- JS_STATIC_METHOD_ENTRY(exportAsXFDF, 5)
- JS_STATIC_METHOD_ENTRY(extractPages, 3)
- JS_STATIC_METHOD_ENTRY(getAnnot, 0)
- JS_STATIC_METHOD_ENTRY(getAnnots, 2)
- JS_STATIC_METHOD_ENTRY(getAnnot3D, 2)
- JS_STATIC_METHOD_ENTRY(getAnnots3D, 1)
- JS_STATIC_METHOD_ENTRY(getField, 1)
- JS_STATIC_METHOD_ENTRY(getIcon, 0)
- JS_STATIC_METHOD_ENTRY(getLinks, 0)
- JS_STATIC_METHOD_ENTRY(getNthFieldName, 1)
- JS_STATIC_METHOD_ENTRY(getOCGs, 0)
- JS_STATIC_METHOD_ENTRY(getPageBox, 0)
- JS_STATIC_METHOD_ENTRY(getPageNthWord, 3)
- JS_STATIC_METHOD_ENTRY(getPageNthWordQuads, 2)
- JS_STATIC_METHOD_ENTRY(getPageNumWords, 1)
- JS_STATIC_METHOD_ENTRY(getPrintParams, 0)
- JS_STATIC_METHOD_ENTRY(getURL, 2)
- JS_STATIC_METHOD_ENTRY(importAnFDF, 1)
- JS_STATIC_METHOD_ENTRY(importAnXFDF, 1)
- JS_STATIC_METHOD_ENTRY(importTextData, 2)
- JS_STATIC_METHOD_ENTRY(insertPages, 4)
- JS_STATIC_METHOD_ENTRY(mailForm, 6)
- JS_STATIC_METHOD_ENTRY(print, 9)
- JS_STATIC_METHOD_ENTRY(removeField, 1)
- JS_STATIC_METHOD_ENTRY(replacePages, 4)
- JS_STATIC_METHOD_ENTRY(resetForm, 1)
- JS_STATIC_METHOD_ENTRY(removeIcon, 0)
- JS_STATIC_METHOD_ENTRY(saveAs, 5)
- JS_STATIC_METHOD_ENTRY(submitForm, 23)
- JS_STATIC_METHOD_ENTRY(mailDoc, 0)
-END_JS_STATIC_METHOD()
-
-IMPLEMENT_JS_CLASS(CJS_Document, Document)
-
-FX_BOOL CJS_Document::InitInstance(IFXJS_Context* cc)
-{
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
-
- Document* pDoc = (Document*)GetEmbedObject();
- ASSERT(pDoc != NULL);
-
- pDoc->AttachDoc(pContext->GetReaderDocument());
- pDoc->SetIsolate(pContext->GetJSRuntime()->GetIsolate());
- return TRUE;
-};
-
-/* --------------------------------- Document --------------------------------- */
-
-Document::Document(CJS_Object* pJSObject) : CJS_EmbedObj(pJSObject),
- m_cwBaseURL(L""),
- m_pIconTree(NULL),
- m_pDocument(NULL),
- m_bDelay(FALSE),
- m_isolate(NULL)
-{
-}
-
-Document::~Document()
-{
- if (m_pIconTree)
- {
- m_pIconTree->DeleteIconTree();
- delete m_pIconTree;
- m_pIconTree = NULL;
- }
- for (int i=0; i<m_DelayData.GetSize(); i++)
- {
- if (CJS_DelayData* pData = m_DelayData.GetAt(i))
- {
- delete pData;
- pData = NULL;
- m_DelayData.SetAt(i, NULL);
-
- }
- }
-
- m_DelayData.RemoveAll();
- m_DelayAnnotData.RemoveAll();
-}
-
-//the total number of fileds in document.
-FX_BOOL Document::numFields(OBJ_PROP_PARAMS)
-{
- if (!vp.IsGetting()) return FALSE;
-
- ASSERT(m_pDocument != NULL);
-
- CPDFSDK_InterForm *pInterForm = m_pDocument->GetInterForm();
- ASSERT(pInterForm != NULL);
-
- CPDF_InterForm *pPDFForm = pInterForm->GetInterForm();
- ASSERT(pPDFForm != NULL);
-
- vp << (int)pPDFForm->CountFields();
-
- return TRUE;
-}
-
-FX_BOOL Document::dirty(OBJ_PROP_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- if (vp.IsGetting())
- {
- if (m_pDocument->GetChangeMark())
- vp << true;
- else
- vp << false;
- }
- else
- {
- bool bChanged = false;
-
- vp >> bChanged;
-
- if (bChanged)
- m_pDocument->SetChangeMark();
- else
- m_pDocument->ClearChangeMark();
- }
-
- return TRUE;
-}
-
-FX_BOOL Document::ADBE(OBJ_PROP_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- if (vp.IsGetting())
- {
- vp.SetNull();
- }
- else
- {
- }
-
- return TRUE;
-}
-
-FX_BOOL Document::pageNum(OBJ_PROP_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- if (vp.IsGetting())
- {
- if (CPDFSDK_PageView* pPageView = m_pDocument->GetCurrentView())
- {
- vp << pPageView->GetPageIndex();
- }
- }
- else
- {
- int iPageCount = m_pDocument->GetPageCount();
-
- int iPageNum = 0;
- vp >> iPageNum;
-
- CPDFDoc_Environment* pEnv = m_pDocument->GetEnv();
- if(!pEnv)
- return FALSE;
-
- if (iPageNum >= 0 && iPageNum < iPageCount)
- {
- pEnv->JS_docgotoPage(iPageNum);
- }
- else if (iPageNum >= iPageCount)
- {
- pEnv->JS_docgotoPage(iPageCount-1);
- }
- else if (iPageNum < 0)
- {
- pEnv->JS_docgotoPage(0);
- }
- }
-
- return TRUE;
-}
-
-FX_BOOL Document::ParserParams(JSObject* pObj,CJS_AnnotObj& annotobj)
-{
- return TRUE;
-}
-
-FX_BOOL Document::addAnnot(OBJ_METHOD_PARAMS)
-{
- return TRUE;
-}
-
-FX_BOOL Document::addField(OBJ_METHOD_PARAMS)
-{
- //Doesn't support.
- return TRUE;
-}
-
-//exports form fields as a tab-delimited text file to a local hard disk.
-//comment: need reader support
-//note : watch the third parameter:cPath, for what case it can be safely saved?
-//int CPDFSDK_InterForm::ExportAsText(FX_BOOL bNoPassword,StringArray aFields,String cPath);
-//return value, int the index of the parameters illegal, the index is based on 1.
-
-FX_BOOL Document::exportAsText(OBJ_METHOD_PARAMS)
-{
- if (IsSafeMode(cc)) return TRUE;
- return TRUE;
-}
-
-//exports form fields as a fdf file to the local hard drive
-//comment: need reader supports
-//note:the last parameter hasn't been confirmed.because the previous one blocks the way.
-//int CPDFSDK_Document::ExportAsFDF(FX_BOOL bAllFields,BOOL bNoPassword,StringArray aFields,FX_BOOL bFlags,String cPath,FX_BOOL bAnnotations);
-
-FX_BOOL Document::exportAsFDF(OBJ_METHOD_PARAMS)
-{
- v8::Isolate* isolate = GetIsolate(cc);
- if (IsSafeMode(cc)) return TRUE;
-
- ASSERT(m_pDocument != NULL);
-
- if (!m_pDocument->GetPermissions(FPDFPERM_EXTRACT_ACCESS)) return FALSE;
-
- FX_BOOL bAllFields = params.size() > 0 ? (FX_BOOL)params[0] : FALSE;
- FX_BOOL bNoPassWord = params.size() > 1 ? (FX_BOOL)params[1] : TRUE;
- FX_BOOL bWhole = params.size() > 2 ? (params[2].GetType() == VT_null) : TRUE;
- CJS_Array arrayFileds(isolate);
- if (!bWhole)
- arrayFileds.Attach(params[2]);
- //FX_BOOL bFlags = params.size() > 3 ? (FX_BOOL)params[3] : FALSE;
- CFX_WideString swFilePath = params.size() > 4 ? (FX_LPCWSTR)params[4].operator CFX_WideString() : (FX_LPCWSTR)L"";
-
- if (swFilePath.IsEmpty())
- {
- CPDFDoc_Environment* pEnv = m_pDocument->GetEnv();
- swFilePath = pEnv->JS_fieldBrowse();
- if(swFilePath.IsEmpty())
- return TRUE;
- }
- else
- {
- swFilePath = app::PDFPathToSysPath(swFilePath);
- }
-
- m_pDocument->SetFocusAnnot(NULL);
-
- CPDFSDK_InterForm* pInterForm= (CPDFSDK_InterForm*)m_pDocument->GetInterForm();
- ASSERT(pInterForm != NULL);
-
- CPDF_InterForm* pPDFForm = pInterForm->GetInterForm();
- ASSERT(pPDFForm != NULL);
-
- CFX_PtrArray aFields;
-
- if (bWhole)
- {
- for (int j=0,jsz=pPDFForm->CountFields(); j<jsz; j++)
- {
- aFields.Add(pPDFForm->GetField(j));
- }
- }
- else
- {
- for (int i=0,isz=arrayFileds.GetLength(); i<isz; i++)
- {
- CJS_Value valName(isolate);
- arrayFileds.GetElement(i,valName);
- CFX_WideString swName = valName.operator CFX_WideString();
-
- for (int j=0, jsz=pPDFForm->CountFields(swName); j<jsz; j++)
- {
- aFields.Add(pPDFForm->GetField(j, swName));
- }
- }
- }
-
- CFX_PtrArray fields;
-
- for (int i=0,sz=aFields.GetSize(); i<sz; i++)
- {
- CPDF_FormField* pField = (CPDF_FormField*)aFields[i];
-
- if (!bAllFields)
- if (pField->GetValue() == L"")
- continue;
-
- if (bNoPassWord)
- if (pField->GetFieldFlags() & 0x2000)
- continue;
-
- fields.Add((void*)pField);
- }
-
- return pInterForm->ExportFieldsToFDFFile(swFilePath, fields, TRUE);
-}
-
-//exports form fields an XFDF file to the local hard drive
-//comment: need reder supports
-//note:the last parameter can't be test
-//int CPDFSDK_Document::ExportAsXFDF(FX_BOOL bAllFields,FX_BOOL bNoPassWord,StringArray aFields,String cPath,FX_BOOL bAnnoatations);
-
-FX_BOOL Document::exportAsXFDF(OBJ_METHOD_PARAMS)
-{
- if (IsSafeMode(cc)) return TRUE;
- ASSERT(m_pDocument != NULL);
-
- if (!m_pDocument->GetPermissions(FPDFPERM_EXTRACT_ACCESS)) return FALSE;
-
- return TRUE;
-}
-
-//Maps a field object in PDF document to a JavaScript variable
-//comment:
-//note: the paremter cName, this is clue how to treat if the cName is not a valiable filed name in this document
-
-FX_BOOL Document::getField(OBJ_METHOD_PARAMS)
-{
- v8::Isolate* isolate = GetIsolate(cc);
- ASSERT(m_pDocument != NULL);
-
- if (params.size() < 1) return FALSE;
-
- CFX_WideString wideName = params[0].operator CFX_WideString();
-
- CPDFSDK_InterForm* pInterForm = m_pDocument->GetInterForm();
- ASSERT(pInterForm != NULL);
-
- CPDF_InterForm* pPDFForm = pInterForm->GetInterForm();
- ASSERT(pPDFForm != NULL);
-
- if (pPDFForm->CountFields(wideName) <= 0)
- {
- vRet.SetNull();
- return TRUE;
- }
-
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
- CJS_Runtime* pRuntime = pContext->GetJSRuntime();
- ASSERT(pRuntime != NULL);
-
- JSFXObject pFieldObj = JS_NewFxDynamicObj(*pRuntime, pContext, JS_GetObjDefnID(*pRuntime, L"Field"));
-
- CJS_Field * pJSField = (CJS_Field*)JS_GetPrivate(isolate,pFieldObj);
- ASSERT(pJSField != NULL);
-
- Field * pField = (Field *)pJSField->GetEmbedObject();
- ASSERT(pField != NULL);
-
- pField->AttachField(this, wideName);
- vRet = pJSField;
-
- return TRUE;
-}
-
-//Gets the name of the nth field in the document
-//comment:
-//note: the parameter nIndex, if it is not available
-
-FX_BOOL Document::getNthFieldName(OBJ_METHOD_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- int nIndex = params.size() > 0 ? (int)params[0] : -1;
- if (nIndex == -1) return FALSE;
-
- CPDFSDK_InterForm* pInterForm = m_pDocument->GetInterForm();
- ASSERT(pInterForm != NULL);
-
- CPDF_InterForm* pPDFForm = pInterForm->GetInterForm();
- ASSERT(pPDFForm != NULL);
-
- CPDF_FormField* pField = pPDFForm->GetField(nIndex);
- if (!pField)
- return FALSE;
-
- vRet = pField->GetFullName();
- return TRUE;
-}
-
-//imports the specified fdf file.
-//comments: need reader suppport
-//note:once the cpath is illigl then a file dialog box pops up in order to ask user to chooose the file
-//int CPDFSDK_Document::importAnFDF(String cPath);
-
-FX_BOOL Document::importAnFDF(OBJ_METHOD_PARAMS)
-{
- if (IsSafeMode(cc)) return TRUE;
- ASSERT(m_pDocument != NULL);
-
- if (!(m_pDocument->GetPermissions(FPDFPERM_MODIFY) ||
- m_pDocument->GetPermissions(FPDFPERM_ANNOT_FORM) ||
- m_pDocument->GetPermissions(FPDFPERM_FILL_FORM))) return FALSE;
-
-
- CFX_WideString swPath;
-
- if (params.size() > 0)
- swPath = params[0];
-
- if (swPath.IsEmpty())
- {
- CPDFDoc_Environment* pEnv = m_pDocument->GetEnv();
- swPath = pEnv->JS_fieldBrowse();
- if(swPath.IsEmpty())
- return TRUE;
- }
- else
- {
- swPath = app::PDFPathToSysPath(swPath);
- }
-
- m_pDocument->SetFocusAnnot(NULL);
-
- CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInterForm();
- ASSERT(pInterForm != NULL);
-
- if (!pInterForm->ImportFormFromFDFFile(swPath, TRUE))
- return FALSE;
-
- m_pDocument->SetChangeMark();
-// CPDFDoc_Environment* pEnv = m_pDocument->GetEnv();
-// ASSERT(pEnv != NULL);
-// IUndo* pUndo = IUndo::GetUndo(pEnv);
-// ASSERT(pUndo != NULL);
-// pUndo->Reset(m_pDocument);
-
- return TRUE;
-}
-
-//imports and specified XFDF file containing XML form data
-//comment: need reader supports
-//note: same as up
-//int CPDFSDK_Document::importAnFDF(String cPath)
-
-FX_BOOL Document::importAnXFDF(OBJ_METHOD_PARAMS)
-{
- if (IsSafeMode(cc)) return TRUE;
- ASSERT(m_pDocument != NULL);
-
- if (!(m_pDocument->GetPermissions(FPDFPERM_MODIFY) ||
- m_pDocument->GetPermissions(FPDFPERM_ANNOT_FORM) ||
- m_pDocument->GetPermissions(FPDFPERM_FILL_FORM))) return FALSE;
-
- return TRUE;
-}
-
-//imports and specified text file
-//commnet: need reader supports
-//note: same as up,when nRow is not rational,adobe is dumb for it.
-//int CPDFSDK_Document::importTextData(String cPath,int nRow);
-
-FX_BOOL Document::importTextData(OBJ_METHOD_PARAMS)
-{
- if (IsSafeMode(cc)) return TRUE;
- ASSERT(m_pDocument != NULL);
-
- if (!(m_pDocument->GetPermissions(FPDFPERM_MODIFY) ||
- m_pDocument->GetPermissions(FPDFPERM_ANNOT_FORM) ||
- m_pDocument->GetPermissions(FPDFPERM_FILL_FORM))) return FALSE;
-
- return TRUE;
-}
-
-//exports the form data and mails the resulting fdf file as an attachment to all recipients.
-//comment: need reader supports
-//note:
-//int CPDFSDK_Document::mailForm(FX_BOOL bUI,String cto,string ccc,string cbcc,string cSubject,string cms);
-
-FX_BOOL Document::mailForm(OBJ_METHOD_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- if (!m_pDocument->GetPermissions(FPDFPERM_EXTRACT_ACCESS)) return FALSE;
-
- int iLength = params.size();
-
- FX_BOOL bUI = iLength > 0 ? (FX_BOOL)params[0] : TRUE;
- CFX_WideString cTo = iLength > 1 ? (FX_LPCWSTR)params[1].operator CFX_WideString() : (FX_LPCWSTR)L"";
- CFX_WideString cCc = iLength > 2 ? (FX_LPCWSTR)params[2].operator CFX_WideString() : (FX_LPCWSTR)L"";
- CFX_WideString cBcc = iLength > 3 ? (FX_LPCWSTR)params[3].operator CFX_WideString() : (FX_LPCWSTR)L"";
- CFX_WideString cSubject = iLength > 4 ? (FX_LPCWSTR)params[4].operator CFX_WideString() : (FX_LPCWSTR)L"";
- CFX_WideString cMsg = iLength > 5 ? (FX_LPCWSTR)params[5].operator CFX_WideString() : (FX_LPCWSTR)L"";
-
- CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInterForm();
- ASSERT(pInterForm != NULL);
-
- CFX_ByteTextBuf textBuf;
- if (!pInterForm->ExportFormToFDFTextBuf(textBuf))
- return FALSE;
-
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
- CPDFDoc_Environment* pEnv = pContext->GetReaderApp();
- ASSERT(pEnv != NULL);
- CJS_Runtime* pRuntime = pContext->GetJSRuntime();
- ASSERT(pRuntime != NULL);
-
- pRuntime->BeginBlock();
- pEnv->JS_docmailForm(textBuf.GetBuffer(), textBuf.GetLength(), bUI, (FX_LPCWSTR)cTo, (FX_LPCWSTR)cSubject, (FX_LPCWSTR)cCc, (FX_LPCWSTR)cBcc, (FX_LPCWSTR)cMsg);
- pRuntime->EndBlock();
- return TRUE;
-}
-
-FX_BOOL Document::print(OBJ_METHOD_PARAMS)
-{
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
- CJS_Runtime* pRuntime = pContext->GetJSRuntime();
- ASSERT(pRuntime != NULL);
-
- FX_BOOL bUI = TRUE;
- int nStart = 0;
- int nEnd = 0;
- FX_BOOL bSilent = FALSE;
- FX_BOOL bShrinkToFit = FALSE;
- FX_BOOL bPrintAsImage = FALSE;
- FX_BOOL bReverse = FALSE;
- FX_BOOL bAnnotations = FALSE;
-
- int nlength = params.size();
- if(nlength ==9)
- {
- if (params[8].GetType() == VT_fxobject)
- {
- JSFXObject pObj = (JSFXObject)params[8];
- {
- if (JS_GetObjDefnID(pObj) == JS_GetObjDefnID(*pRuntime, L"PrintParamsObj"))
- {
- if (CJS_Object* pJSObj = (CJS_Object*)params[8])
- {
- if (PrintParamsObj* pprintparamsObj = (PrintParamsObj*)pJSObj->GetEmbedObject())
- {
- bUI = pprintparamsObj->bUI;
- nStart = pprintparamsObj->nStart;
- nEnd = pprintparamsObj->nEnd;
- bSilent = pprintparamsObj->bSilent;
- bShrinkToFit = pprintparamsObj->bShrinkToFit;
- bPrintAsImage = pprintparamsObj->bPrintAsImage;
- bReverse = pprintparamsObj->bReverse;
- bAnnotations = pprintparamsObj->bAnnotations;
- }
- }
- }
- }
- }
- }
- else
- {
- if(nlength >= 1)
- bUI = params[0];
- if(nlength >= 2)
- nStart = (int)params[1];
- if(nlength >= 3)
- nEnd = (int)params[2];
- if(nlength >= 4)
- bSilent = params[3];
- if(nlength >= 5)
- bShrinkToFit = params[4];
- if(nlength >= 6)
- bPrintAsImage = params[5];
- if(nlength >= 7)
- bReverse = params[6];
- if(nlength >= 8)
- bAnnotations = params[7];
- }
-
- ASSERT(m_pDocument != NULL);
-
- if (CPDFDoc_Environment* pEnv = m_pDocument->GetEnv())
- {
- pEnv->JS_docprint(bUI, nStart, nEnd, bSilent, bShrinkToFit, bPrintAsImage, bReverse, bAnnotations);
- return TRUE;
- }
- return FALSE;
-}
-
-//removes the specified field from the document.
-//comment:
-//note: if the filed name is not retional, adobe is dumb for it.
-
-FX_BOOL Document::removeField(OBJ_METHOD_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- if (!(m_pDocument->GetPermissions(FPDFPERM_MODIFY) ||
- m_pDocument->GetPermissions(FPDFPERM_ANNOT_FORM))) return FALSE;
-
- if (params.size() < 1)
- return TRUE;
-
- CFX_WideString sFieldName = params[0].operator CFX_WideString();
-
- CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInterForm();
- ASSERT(pInterForm != NULL);
-
- CFX_PtrArray widgets;
- pInterForm->GetWidgets(sFieldName, widgets);
-
- int nSize = widgets.GetSize();
-
- if (nSize > 0)
- {
- for (int i=0; i<nSize; i++)
- {
- CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)widgets[i];
- ASSERT(pWidget != NULL);
-
- CPDF_Rect rcAnnot = pWidget->GetRect();
- rcAnnot.left -= 1;
- rcAnnot.bottom -= 1;
- rcAnnot.right += 1;
- rcAnnot.top += 1;
-
- CFX_RectArray aRefresh;
- aRefresh.Add(rcAnnot);
-
- CPDF_Page* pPage = pWidget->GetPDFPage();
- ASSERT(pPage != NULL);
-
- CPDFSDK_PageView* pPageView = m_pDocument->GetPageView(pPage);
- pPageView->DeleteAnnot(pWidget);
-
- pPageView->UpdateRects(aRefresh);
- }
- m_pDocument->SetChangeMark();
- }
-
- return TRUE;
-}
-
-//reset filed values within a document.
-//comment:
-//note: if the fields names r not rational, aodbe is dumb for it.
-
-FX_BOOL Document::resetForm(OBJ_METHOD_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- if (!(m_pDocument->GetPermissions(FPDFPERM_MODIFY) ||
- m_pDocument->GetPermissions(FPDFPERM_ANNOT_FORM) ||
- m_pDocument->GetPermissions(FPDFPERM_FILL_FORM))) return FALSE;
-
- CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInterForm();
- ASSERT(pInterForm != NULL);
-
- CPDF_InterForm* pPDFForm = pInterForm->GetInterForm();
- ASSERT(pPDFForm != NULL);
-
- v8::Isolate* isolate = GetIsolate(cc);
- CJS_Array aName(isolate);
-
- if (params.size() > 0)
- {
- switch (params[0].GetType())
- {
- default:
- aName.Attach(params[0]);
- break;
- case VT_string:
- aName.SetElement(0,params[0]);
- break;
- }
-
- CFX_PtrArray aFields;
-
- for (int i=0,isz=aName.GetLength(); i<isz; i++)
- {
- CJS_Value valElement(isolate);
- aName.GetElement(i,valElement);
- CFX_WideString swVal = valElement.operator CFX_WideString();
-
- for (int j=0,jsz=pPDFForm->CountFields(swVal); j<jsz; j++)
- {
- aFields.Add((void*)pPDFForm->GetField(j,swVal));
- }
- }
-
- if (aFields.GetSize() > 0)
- {
- pPDFForm->ResetForm(aFields, TRUE, TRUE);
- m_pDocument->SetChangeMark();
-
- }
- }
- else
- {
- pPDFForm->ResetForm(TRUE);
- m_pDocument->SetChangeMark();
-
- }
-
- return TRUE;
-}
-
-
-FX_BOOL Document::saveAs(OBJ_METHOD_PARAMS)
-{
-
- if (IsSafeMode(cc)) return TRUE;
-
- ASSERT(m_pDocument != NULL);
-
-// m_pDocument->DoSaveAs();
-
- return TRUE;
-}
-
-
-FX_BOOL Document::submitForm(OBJ_METHOD_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
-// if (!m_pDocument->GetPermissions(FPDFPERM_EXTRACT_ACCESS)) return FALSE;
-
- int nSize = params.size();
- if (nSize < 1) return FALSE;
-
- CFX_WideString strURL;
- FX_BOOL bFDF = TRUE;
- FX_BOOL bEmpty = FALSE;
- v8::Isolate* isolate = GetIsolate(cc);
- CJS_Array aFields(isolate);
-
- CJS_Value v = params[0];
- if (v.GetType() == VT_string)
- {
- strURL = params[0].operator CFX_WideString();
- if (nSize > 1)
- bFDF = params[1];
- if (nSize > 2)
- bEmpty = params[2];
- if (nSize > 3)
- aFields.Attach(params[3]);
- }
- else if (v.GetType() == VT_object)
- {
- JSObject pObj = (JSObject)params[0];
- v8::Handle<v8::Value> pValue = JS_GetObjectElement(isolate,pObj, L"cURL");
- if (!pValue.IsEmpty())
- strURL = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue));
- pValue = JS_GetObjectElement(isolate,pObj, L"bFDF");
- bFDF = CJS_Value(isolate,pValue, GET_VALUE_TYPE(pValue));
- pValue = JS_GetObjectElement(isolate,pObj, L"bEmpty");
- bEmpty = CJS_Value(isolate,pValue, GET_VALUE_TYPE(pValue));
- pValue = JS_GetObjectElement(isolate,pObj,L"aFields");
- aFields.Attach(CJS_Value(isolate,pValue, GET_VALUE_TYPE(pValue)));
- }
-
- CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInterForm();
- ASSERT(pInterForm != NULL);
- CPDF_InterForm* pPDFInterForm = pInterForm->GetInterForm();
- ASSERT(pPDFInterForm != NULL);
-
- FX_BOOL bAll = (aFields.GetLength() == 0);
-
- if (bAll && bEmpty)
- {
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
- CJS_Runtime* pRuntime = pContext->GetJSRuntime();
- ASSERT(pRuntime != NULL);
-
-
- if (pPDFInterForm->CheckRequiredFields())
- {
- pRuntime->BeginBlock();
- pInterForm->SubmitForm(strURL, FALSE);
- pRuntime->EndBlock();
- }
-
- return TRUE;
- }
- else
- {
- CFX_PtrArray fieldObjects;
-
- for (int i=0,sz=aFields.GetLength(); i<sz; i++)
- {
- CJS_Value valName(isolate);
- aFields.GetElement(i, valName);
- CFX_WideString sName = valName.operator CFX_WideString();
-
- CPDF_InterForm* pPDFForm = pInterForm->GetInterForm();
- ASSERT(pPDFForm != NULL);
-
- for (int j=0, jsz=pPDFForm->CountFields(sName); j<jsz; j++)
- {
- CPDF_FormField* pField = pPDFForm->GetField(j, sName);
- if (!bEmpty && pField->GetValue().IsEmpty())
- continue;
-
- fieldObjects.Add(pField);
- }
- }
-
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
- CJS_Runtime* pRuntime = pContext->GetJSRuntime();
- ASSERT(pRuntime != NULL);
-
-
- if (pPDFInterForm->CheckRequiredFields(&fieldObjects, TRUE))
- {
- pRuntime->BeginBlock();
- pInterForm->SubmitFields(strURL, fieldObjects, TRUE, !bFDF);
- pRuntime->EndBlock();
- }
-
- return TRUE;
- }
-
-}
-
-//////////////////////////////////////////////////////////////////////////////////////////////
-
-void Document::AttachDoc(CPDFSDK_Document *pDoc)
-{
- m_pDocument = pDoc;
-}
-
-CPDFSDK_Document * Document::GetReaderDoc()
-{
- return m_pDocument;
-}
-
-FX_BOOL Document::ExtractFileName(CPDFSDK_Document *pDoc,CFX_ByteString &strFileName)
-{
- return FALSE;
-}
-
-FX_BOOL Document::ExtractFolderName(CPDFSDK_Document *pDoc,CFX_ByteString &strFolderName)
-{
- return FALSE;
-}
-
-FX_BOOL Document::bookmarkRoot(OBJ_PROP_PARAMS)
-{
- return TRUE;
-}
-
-FX_BOOL Document::mailDoc(OBJ_METHOD_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- FX_BOOL bUI = TRUE;
- CFX_WideString cTo = L"";
- CFX_WideString cCc = L"";
- CFX_WideString cBcc = L"";
- CFX_WideString cSubject = L"";
- CFX_WideString cMsg = L"";
-
-
- bUI = params.size()>=1?static_cast<FX_BOOL>(params[0]):TRUE;
- cTo = params.size()>=2?(const wchar_t*)params[1].operator CFX_WideString():L"";
- cCc = params.size()>=3?(const wchar_t*)params[2].operator CFX_WideString():L"";
- cBcc = params.size()>=4?(const wchar_t*)params[3].operator CFX_WideString():L"";
- cSubject = params.size()>=5?(const wchar_t*)params[4].operator CFX_WideString():L"";
- cMsg = params.size()>=6?(const wchar_t*)params[5].operator CFX_WideString():L"";
-
- v8::Isolate* isolate = GetIsolate(cc);
-
- if(params.size()>=1 && params[0].GetType() == VT_object)
- {
- JSObject pObj = (JSObject )params[0];
-
- v8::Handle<v8::Value> pValue = JS_GetObjectElement(isolate,pObj, L"bUI");
- bUI = (int)CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue));
-
- pValue = JS_GetObjectElement(isolate,pObj, L"cTo");
- cTo = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).operator CFX_WideString();
-
- pValue = JS_GetObjectElement(isolate,pObj, L"cCc");
- cCc = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).operator CFX_WideString();
-
- pValue = JS_GetObjectElement(isolate,pObj, L"cBcc");
- cBcc = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).operator CFX_WideString();
-
- pValue = JS_GetObjectElement(isolate,pObj, L"cSubject");
- cSubject = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).operator CFX_WideString();
-
- pValue = JS_GetObjectElement(isolate,pObj, L"cMsg");
- cMsg = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).operator CFX_WideString();
-
- }
-
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
- CJS_Runtime* pRuntime = pContext->GetJSRuntime();
- ASSERT(pRuntime != NULL);
-
- pRuntime->BeginBlock();
- CPDFDoc_Environment* pEnv = pRuntime->GetReaderApp();
- pEnv->JS_docmailForm(NULL, 0, bUI, (FX_LPCWSTR)cTo, (FX_LPCWSTR)cSubject, (FX_LPCWSTR)cCc, (FX_LPCWSTR)cBcc, (FX_LPCWSTR)cMsg);
- pRuntime->EndBlock();
-
- return TRUE;
-}
-
-FX_BOOL Document::author(OBJ_PROP_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo();
- if (!pDictionary)return FALSE;
-
- if (vp.IsGetting())
- {
- vp << pDictionary->GetUnicodeText("Author");
- return TRUE;
- }
- else
- {
- if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY)) return FALSE;
-
- CFX_WideString csAuthor;
- vp >> csAuthor;
- pDictionary->SetAtString("Author", PDF_EncodeText(csAuthor));
- m_pDocument->SetChangeMark();
- return TRUE;
- }
-}
-
-FX_BOOL Document::info(OBJ_PROP_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo();
- if (!pDictionary)return FALSE;
-
- CFX_WideString cwAuthor = pDictionary->GetUnicodeText("Author");
- CFX_WideString cwTitle = pDictionary->GetUnicodeText("Title");
- CFX_WideString cwSubject = pDictionary->GetUnicodeText("Subject");
- CFX_WideString cwKeywords = pDictionary->GetUnicodeText("Keywords");
- CFX_WideString cwCreator = pDictionary->GetUnicodeText("Creator");
- CFX_WideString cwProducer = pDictionary->GetUnicodeText("Producer");
- CFX_WideString cwCreationDate = pDictionary->GetUnicodeText("CreationDate");
- CFX_WideString cwModDate = pDictionary->GetUnicodeText("ModDate");
- CFX_WideString cwTrapped = pDictionary->GetUnicodeText("Trapped");
-
- v8::Isolate* isolate = GetIsolate(cc);
- if (!vp.IsSetting())
- {
- CJS_Context* pContext = (CJS_Context *)cc;
- CJS_Runtime* pRuntime = pContext->GetJSRuntime();
-
- JSFXObject pObj = JS_NewFxDynamicObj(*pRuntime, pContext, -1);
-
- JS_PutObjectString(isolate,pObj, L"Author", cwAuthor);
- JS_PutObjectString(isolate,pObj, L"Title", cwTitle);
- JS_PutObjectString(isolate,pObj, L"Subject", cwSubject);
- JS_PutObjectString(isolate,pObj, L"Keywords", cwKeywords);
- JS_PutObjectString(isolate,pObj, L"Creator", cwCreator);
- JS_PutObjectString(isolate,pObj, L"Producer", cwProducer);
- JS_PutObjectString(isolate,pObj, L"CreationDate", cwCreationDate);
- JS_PutObjectString(isolate,pObj, L"ModDate", cwModDate);
- JS_PutObjectString(isolate,pObj, L"Trapped", cwTrapped);
-
-// It's to be compatible to non-standard info dictionary.
- FX_POSITION pos = pDictionary->GetStartPos();
- while(pos)
- {
- CFX_ByteString bsKey;
- CPDF_Object* pValueObj = pDictionary->GetNextElement(pos, bsKey);
- CFX_WideString wsKey = CFX_WideString::FromUTF8(bsKey);
- if((pValueObj->GetType()==PDFOBJ_STRING) || (pValueObj->GetType()==PDFOBJ_NAME) )
- JS_PutObjectString(isolate,pObj, wsKey, pValueObj->GetUnicodeText());
- if(pValueObj->GetType()==PDFOBJ_NUMBER)
- JS_PutObjectNumber(isolate,pObj, wsKey, (float)pValueObj->GetNumber());
- if(pValueObj->GetType()==PDFOBJ_BOOLEAN)
- JS_PutObjectBoolean(isolate,pObj, wsKey, (bool)pValueObj->GetInteger());
- }
-
- vp << pObj;
- return TRUE;
- }
- else
- {
- return TRUE;
- }
-}
-
-FX_BOOL Document::creationDate(OBJ_PROP_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo();
- if (!pDictionary)return FALSE;
-
- if (vp.IsGetting())
- {
- vp << pDictionary->GetUnicodeText("CreationDate");
- return TRUE;
- }
- else
- {
- if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY)) return FALSE;
-
- CFX_WideString csCreationDate;
- vp >> csCreationDate;
- pDictionary->SetAtString("CreationDate", PDF_EncodeText(csCreationDate));
- m_pDocument->SetChangeMark();
-
- return TRUE;
- }
-}
-
-FX_BOOL Document::creator(OBJ_PROP_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo();
- if (!pDictionary)return FALSE;
-
- if (vp.IsGetting())
- {
- vp << pDictionary->GetUnicodeText("Creator");
- return TRUE;
- }
- else
- {
- if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY)) return FALSE;
-
- CFX_WideString csCreator;
- vp >> csCreator;
- pDictionary->SetAtString("Creator", PDF_EncodeText(csCreator));
- m_pDocument->SetChangeMark();
- return TRUE;
- }
-}
-
-FX_BOOL Document::delay(OBJ_PROP_PARAMS)
-{
- if (vp.IsGetting())
- {
- vp << m_bDelay;
- return TRUE;
- }
- else
- {
- ASSERT(m_pDocument != NULL);
-
- if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY)) return FALSE;
-
- bool b;
- vp >> b;
-
- m_bDelay = b;
-
- if (m_bDelay)
- {
- for (int i=0,sz=m_DelayData.GetSize(); i<sz; i++)
- delete m_DelayData.GetAt(i);
-
- m_DelayData.RemoveAll();
- }
- else
- {
- for (int i=0,sz=m_DelayData.GetSize(); i<sz; i++)
- {
- if (CJS_DelayData* pData = m_DelayData.GetAt(i))
- {
- Field::DoDelay(m_pDocument, pData);
- delete m_DelayData.GetAt(i);
- }
- }
- m_DelayData.RemoveAll();
- }
-
- return TRUE;
- }
-}
-
-FX_BOOL Document::keywords(OBJ_PROP_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo();
- if (!pDictionary)return FALSE;
-
- if (vp.IsGetting())
- {
- vp << pDictionary->GetUnicodeText("Keywords");
- return TRUE;
- }
- else
- {
- if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY)) return FALSE;
-
- CFX_WideString csKeywords;
- vp >> csKeywords;
- pDictionary->SetAtString("Keywords", PDF_EncodeText(csKeywords));
- m_pDocument->SetChangeMark();
- return TRUE;
- }
-}
-
-FX_BOOL Document::modDate(OBJ_PROP_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo();
- if (!pDictionary)return FALSE;
-
- if (vp.IsGetting())
- {
- vp << pDictionary->GetUnicodeText("ModDate");
- return TRUE;
- }
- else
- {
- if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY)) return FALSE;
-
- CFX_WideString csmodDate;
- vp >> csmodDate;
- pDictionary->SetAtString("ModDate", PDF_EncodeText(csmodDate));
- m_pDocument->SetChangeMark();
- return TRUE;
- }
-}
-
-FX_BOOL Document::producer(OBJ_PROP_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo();
- if (!pDictionary)return FALSE;
-
- if (vp.IsGetting())
- {
- vp << pDictionary->GetUnicodeText("Producer");
- return TRUE;
- }
- else
- {
- if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY)) return FALSE;
-
- CFX_WideString csproducer;
- vp >> csproducer;
- pDictionary->SetAtString("Producer", PDF_EncodeText(csproducer));
- m_pDocument->SetChangeMark();
- return TRUE;
- }
-}
-
-FX_BOOL Document::subject(OBJ_PROP_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo();
- if (!pDictionary)return FALSE;
-
- if (vp.IsGetting())
- {
- vp << pDictionary->GetUnicodeText("Subject");
- return TRUE;
- }
- else
- {
- if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY)) return FALSE;
-
- CFX_WideString cssubject;
- vp >> cssubject;
- pDictionary->SetAtString("Subject", PDF_EncodeText(cssubject));
- m_pDocument->SetChangeMark();
- return TRUE;
- }
-}
-
-FX_BOOL Document::title(OBJ_PROP_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- if (m_pDocument == NULL || m_pDocument->GetDocument() == NULL)
- return FALSE;
-
- CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo();
- if (!pDictionary)return FALSE;
-
- if (vp.IsGetting())
- {
- vp << pDictionary->GetUnicodeText("Title");
- return TRUE;
- }
- else
- {
- if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY)) return FALSE;
-
- CFX_WideString cstitle;
- vp >> cstitle;
- pDictionary->SetAtString("Title", PDF_EncodeText(cstitle));
- m_pDocument->SetChangeMark();
- return TRUE;
- }
-}
-
-FX_BOOL Document::numPages(OBJ_PROP_PARAMS)
-{
- if (vp.IsGetting())
- {
- ASSERT(m_pDocument != NULL);
- vp << m_pDocument->GetPageCount();
- return TRUE;
- }
- else
- {
- return FALSE;
- }
-}
-
-FX_BOOL Document::external(OBJ_PROP_PARAMS)
-{
- //In Chrome case,should always return true.
- vp << TRUE;
- return TRUE;
-}
-
-FX_BOOL Document::filesize(OBJ_PROP_PARAMS)
-{
- if (!vp.IsGetting())return FALSE;
-
- ASSERT(m_pDocument != NULL);
-
-// CFile file(m_pDocument->GetPath(), CFile::modeRead | CFile::typeBinary | CFile::shareDenyNone);
-// vp << (double)file.GetLength();
-// file.Close();
-
- if ( m_pDocument->GetPath().IsEmpty() == FALSE)
- {
- CFX_ByteString bsStr = CFX_ByteString::FromUnicode( m_pDocument->GetPath() );
- FILE * pFile = NULL;
- pFile = fopen( bsStr.GetBuffer( bsStr.GetLength() ), "rb" );
- if ( pFile )
- {
- fseek( pFile, 0, SEEK_END );
- long lSize = ftell( pFile );
- fclose( pFile );
- pFile = NULL;
-
- vp << (FX_INT32)(lSize);
- return TRUE;
- }
- }
-
- vp << 0;
- return TRUE;
-}
-
-FX_BOOL Document::mouseX(OBJ_PROP_PARAMS)
-{
- return TRUE;
-}
-
-FX_BOOL Document::mouseY(OBJ_PROP_PARAMS)
-{
- return TRUE;
-}
-
-FX_BOOL Document::baseURL(OBJ_PROP_PARAMS)
-{
- if (vp.IsGetting())
- {
- vp << m_cwBaseURL;
- return TRUE;
- }
- else
- {
- vp >> m_cwBaseURL;
- return TRUE;
- }
-}
-
-FX_BOOL Document::calculate(OBJ_PROP_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInterForm();
- ASSERT(pInterForm != NULL);
-
- if (vp.IsGetting())
- {
- if (pInterForm->IsCalculateEnabled())
- vp << true;
- else
- vp << false;
- }
- else
- {
- bool bCalculate;
- vp >> bCalculate;
-
- pInterForm->EnableCalculate(bCalculate);
- }
-
- return TRUE;
-}
-
-FX_BOOL Document::documentFileName(OBJ_PROP_PARAMS)
-{
- if (!vp.IsGetting())
- return FALSE;
-
- CFX_WideString wsFilePath = m_pDocument->GetPath();
-
- FX_INT32 i = wsFilePath.GetLength() - 1;
- for ( ; i >= 0; i-- )
- {
- if ( wsFilePath.GetAt( i ) == L'\\' || wsFilePath.GetAt( i ) == L'/' )
- break;
- }
- if ( i >= 0 && i < wsFilePath.GetLength() - 1 )
- {
- vp << ( wsFilePath.GetBuffer( wsFilePath.GetLength() ) + i + 1 );
- }else{
- vp << L"";
- }
- return TRUE;
-}
-
-CFX_WideString Document::ReversalStr(CFX_WideString cbFrom)
-{
- wchar_t* pFrom = NULL;
- int iLenth = cbFrom.GetLength();
- wchar_t* pResult = (wchar_t*)malloc((iLenth+1) * sizeof(wchar_t));
- memset(pResult, 0, (iLenth+1));
- pFrom = (wchar_t*)cbFrom.GetBuffer(iLenth);
-
- for (int i = 0; i < iLenth; i++)
- {
- pResult[i] = *(pFrom + iLenth - i - 1);
- }
-
- cbFrom.ReleaseBuffer();
- CFX_WideString cbRet = CFX_WideString(pResult);
- free(pResult);
- pResult = NULL;
- return cbRet;
-}
-
-CFX_WideString Document::CutString(CFX_WideString cbFrom)
-{
- wchar_t* pFrom = NULL;
- int iLenth = cbFrom.GetLength();
- wchar_t* pResult = (wchar_t*)malloc((iLenth+1) * sizeof(wchar_t));
- memset(pResult, 0, (iLenth+1));
- pFrom = (wchar_t*)cbFrom.GetBuffer(iLenth);
-
- for (int i = 0; i < iLenth; i++)
- {
- if (pFrom[i] == L'\\' || pFrom[i] == L'/')
- break;
- pResult[i] = pFrom[i];
- }
-
- cbFrom.ReleaseBuffer();
- CFX_WideString cbRet = CFX_WideString(pResult);
- free(pResult);
- pResult = NULL;
- return cbRet;
-}
-
-FX_BOOL Document::path(OBJ_PROP_PARAMS)
-{
- if (!vp.IsGetting()) return FALSE;
-
- vp << app::SysPathToPDFPath(m_pDocument->GetPath());
-
- return TRUE;
-}
-
-FX_BOOL Document::pageWindowRect(OBJ_PROP_PARAMS)
-{
- return TRUE;
-}
-
-FX_BOOL Document::layout(OBJ_PROP_PARAMS)
-{
- return TRUE;
-}
-
-FX_BOOL Document::addLink(OBJ_METHOD_PARAMS)
-{
- return TRUE;
-}
-
-FX_BOOL Document::closeDoc(OBJ_METHOD_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
-
-
-
-
- return TRUE;
-}
-
-FX_BOOL Document::getPageBox(OBJ_METHOD_PARAMS)
-{
- return TRUE;
-}
-
-
-FX_BOOL Document::getAnnot(OBJ_METHOD_PARAMS)
-{
- return TRUE;
-}
-
-FX_BOOL Document::getAnnots(OBJ_METHOD_PARAMS)
-{
- vRet.SetNull();
- return TRUE;
-}
-
-FX_BOOL Document::getAnnot3D(OBJ_METHOD_PARAMS)
-{
- vRet.SetNull();
- return TRUE;
-}
-
-FX_BOOL Document::getAnnots3D(OBJ_METHOD_PARAMS)
-{
- vRet = VT_undefined;
- return TRUE;
-}
-
-FX_BOOL Document::getOCGs(OBJ_METHOD_PARAMS)
-{
- return TRUE;
-}
-
-FX_BOOL Document::getLinks(OBJ_METHOD_PARAMS)
-{
- return TRUE;
-}
-
-bool Document::IsEnclosedInRect(CFX_FloatRect rect, CFX_FloatRect LinkRect)
-{
- if (rect.left <= LinkRect.left
- && rect.top <= LinkRect.top
- && rect.right >= LinkRect.right
- && rect.bottom >= LinkRect.bottom)
- return true;
- else
- return false;
-}
-
-void IconTree::InsertIconElement(IconElement* pNewIcon)
-{
- if (!pNewIcon)return;
-
- if (m_pHead == NULL && m_pEnd == NULL)
- {
- m_pHead = m_pEnd = pNewIcon;
- m_iLength++;
- }
- else
- {
- m_pEnd->NextIcon = pNewIcon;
- m_pEnd = pNewIcon;
- m_iLength++;
- }
-}
-
-void IconTree::DeleteIconTree()
-{
- if (!m_pHead || !m_pEnd)return;
-
- IconElement* pTemp = NULL;
- while(m_pEnd != m_pHead)
- {
- pTemp = m_pHead;
- m_pHead = m_pHead->NextIcon;
- delete pTemp;
- }
-
- delete m_pEnd;
- m_pHead = NULL;
- m_pEnd = NULL;
-}
-
-int IconTree::GetLength()
-{
- return m_iLength;
-}
-
-IconElement* IconTree::operator [](int iIndex)
-{
- if (iIndex >= 0 && iIndex <= m_iLength)
- {
- IconElement* pTemp = m_pHead;
- for (int i = 0; i < iIndex; i++)
- {
- pTemp = pTemp->NextIcon;
- }
- return pTemp;
- }
- else
- return NULL;
-}
-
-void IconTree::DeleteIconElement(CFX_WideString swIconName)
-{
- IconElement* pTemp = m_pHead;
- int iLoopCount = m_iLength;
- for (int i = 0; i < iLoopCount - 1; i++)
- {
- if (pTemp == m_pEnd)
- break;
-
- if (m_pHead->IconName == swIconName)
- {
- m_pHead = m_pHead->NextIcon;
- delete pTemp;
- m_iLength--;
- pTemp = m_pHead;
- }
- if (pTemp->NextIcon->IconName == swIconName)
- {
- if (pTemp->NextIcon == m_pEnd)
- {
- m_pEnd = pTemp;
- delete pTemp->NextIcon;
- m_iLength--;
- pTemp->NextIcon = NULL;
- }
- else
- {
- IconElement* pElement = pTemp->NextIcon;
- pTemp->NextIcon = pTemp->NextIcon->NextIcon;
- delete pElement;
- m_iLength--;
- pElement = NULL;
- }
-
- continue;
- }
-
- pTemp = pTemp->NextIcon;
- }
-}
-
-FX_BOOL Document::addIcon(OBJ_METHOD_PARAMS)
-{
- if (params.size() != 2)return FALSE;
-
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
- CJS_Runtime* pRuntime = pContext->GetJSRuntime();
- ASSERT(pRuntime != NULL);
-
- CFX_WideString swIconName = params[0].operator CFX_WideString();
-
- JSFXObject pJSIcon = (JSFXObject)params[1];
- if (JS_GetObjDefnID(pJSIcon) != JS_GetObjDefnID(*pRuntime, L"Icon")) return FALSE;
-
- CJS_EmbedObj* pEmbedObj = ((CJS_Object*)params[1])->GetEmbedObject();
- if (!pEmbedObj)return FALSE;
- Icon* pIcon = (Icon*)pEmbedObj;
-
- if (!m_pIconTree)
- m_pIconTree = new IconTree();
-
- IconElement* pNewIcon = new IconElement();
- pNewIcon->IconName = swIconName;
- pNewIcon->NextIcon = NULL;
- pNewIcon->IconStream = pIcon;
- m_pIconTree->InsertIconElement(pNewIcon);
- return TRUE;
-}
-
-FX_BOOL Document::icons(OBJ_PROP_PARAMS)
-{
- if (vp.IsSetting())
- return FALSE;
-
- if (!m_pIconTree)
- {
- vp.SetNull();
- return TRUE;
- }
-
- CJS_Array Icons(m_isolate);
- IconElement* pIconElement = NULL;
- int iIconTreeLength = m_pIconTree->GetLength();
-
- CJS_Context* pContext = (CJS_Context *)cc;
- CJS_Runtime* pRuntime = pContext->GetJSRuntime();
-
- for (int i = 0; i < iIconTreeLength; i++)
- {
- pIconElement = (*m_pIconTree)[i];
-
- JSFXObject pObj = JS_NewFxDynamicObj(*pRuntime, pContext, JS_GetObjDefnID(*pRuntime, L"Icon"));
- if (pObj.IsEmpty()) return FALSE;
-
- CJS_Icon * pJS_Icon = (CJS_Icon *)JS_GetPrivate(pObj);
- if (!pJS_Icon) return FALSE;
-
- Icon* pIcon = (Icon*)pJS_Icon->GetEmbedObject();
- if (!pIcon)return FALSE;
-
- pIcon->SetStream(pIconElement->IconStream->GetStream());
- pIcon->SetIconName(pIconElement->IconName);
- Icons.SetElement(i, CJS_Value(m_isolate,pJS_Icon));
- }
-
- vp << Icons;
- return TRUE;
-}
-
-FX_BOOL Document::getIcon(OBJ_METHOD_PARAMS)
-{
- if (params.size() != 1)return FALSE;
- if(!m_pIconTree)
- return FALSE;
- CFX_WideString swIconName = params[0].operator CFX_WideString();
- int iIconCounts = m_pIconTree->GetLength();
-
- CJS_Context* pContext = (CJS_Context *)cc;
- CJS_Runtime* pRuntime = pContext->GetJSRuntime();
-
- for (int i = 0; i < iIconCounts; i++)
- {
- if ((*m_pIconTree)[i]->IconName == swIconName)
- {
- Icon* pRetIcon = (*m_pIconTree)[i]->IconStream;
-
- JSFXObject pObj = JS_NewFxDynamicObj(*pRuntime, pContext, JS_GetObjDefnID(*pRuntime, L"Icon"));
- if (pObj.IsEmpty()) return FALSE;
-
- CJS_Icon * pJS_Icon = (CJS_Icon *)JS_GetPrivate(pObj);
- if (!pJS_Icon) return FALSE;
-
- Icon* pIcon = (Icon*)pJS_Icon->GetEmbedObject();
- if (!pIcon)return FALSE;
-
- pIcon->SetIconName(swIconName);
- pIcon->SetStream(pRetIcon->GetStream());
- vRet = pJS_Icon;
- return TRUE;
- }
- }
-
- return FALSE;
-}
-
-FX_BOOL Document::removeIcon(OBJ_METHOD_PARAMS)
-{
- if (params.size() != 1)return FALSE;
- if(!m_pIconTree)
- return FALSE;
- CFX_WideString swIconName = params[0].operator CFX_WideString();
-#ifndef FOXIT_CHROME_BUILD
- m_pIconTree->DeleteIconElement(swIconName);
-#endif
- return TRUE;
-}
-
-FX_BOOL Document::createDataObject(OBJ_METHOD_PARAMS)
-{
- if (IsSafeMode(cc)) return TRUE;
- ASSERT(m_pDocument != NULL);
-
- CFX_WideString swName = L"";
- CFX_ByteString sbName = "";
- CFX_WideString swValue = L"";
- CFX_WideString swMIMEType = L"";
- CFX_WideString swCryptFilter = L"";
- CFX_ByteString sbFileValue = "";
-
- int iParamSize = params.size();
- for (int i = 0; i < iParamSize; i++)
- {
- if (i == 0)
- swName = params[0];
- if (i == 1)
- swValue = params[1];
- if (i == 2)
- swMIMEType = params[2];
- if (i == 3)
- swCryptFilter = params[4];
- }
-
- FILE* pFile = NULL;
-
- //CFileStatus fileStatus;
- const int BUFSIZE = 17;
- FX_BYTE buf[BUFSIZE];
- FX_BYTE *pBuffer = NULL;
- char* pBuf = NULL;
- int nFileSize = 0;
- sbFileValue = CFX_ByteString::FromUnicode(swValue);
- sbName = CFX_ByteString::FromUnicode(swName);
- int iBufLength = sbFileValue.GetLength();
- pBuf = (char*)malloc(sizeof(char) * iBufLength);
- pBuf = sbFileValue.GetBuffer(iBufLength);
-
- if ( NULL == (pFile = FXSYS_fopen( sbName.GetBuffer(sbName.GetLength()), "wb+" )) )
- {
- return FALSE;
- }
-
- fwrite( pBuf, sizeof(char), iBufLength, pFile );
- fclose( pFile );
- pFile = NULL;
-
- pFile = FXSYS_fopen( sbName.GetBuffer(sbName.GetLength()), "rb+" );
- fseek( pFile, 0, SEEK_END );
- nFileSize = ftell( pFile );
-
- pBuffer = new FX_BYTE[nFileSize];
- fseek( pFile, 0, SEEK_SET );
- size_t s = fread( pBuffer, sizeof(char), nFileSize, pFile );
- if(s == 0)
- {
- delete[] pBuffer;
- return FALSE;
- }
-
- CRYPT_MD5Generate(pBuffer, nFileSize, buf);
- buf[BUFSIZE - 1] = 0;
- CFX_WideString csCheckSum((FX_LPCWSTR)buf, 16);
- delete[] pBuffer;
-
- return TRUE;
-}
-
-FX_BOOL Document::media(OBJ_PROP_PARAMS)
-{
- return TRUE;
-}
-
-FX_BOOL Document::calculateNow(OBJ_METHOD_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- if (!(m_pDocument->GetPermissions(FPDFPERM_MODIFY) ||
- m_pDocument->GetPermissions(FPDFPERM_ANNOT_FORM) ||
- m_pDocument->GetPermissions(FPDFPERM_FILL_FORM))) return FALSE;
-
- CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInterForm();
- ASSERT(pInterForm != NULL);
- pInterForm->OnCalculate();
- return TRUE;
-}
-
-FX_BOOL Document::Collab(OBJ_PROP_PARAMS)
-{
- return TRUE;
-}
-
-FX_BOOL Document::getPageNthWord(OBJ_METHOD_PARAMS)
-{
- //if (IsSafeMode(cc)) return TRUE;
-
- ASSERT(m_pDocument != NULL);
-
- if (!m_pDocument->GetPermissions(FPDFPERM_EXTRACT_ACCESS)) return FALSE;
-
- int nPageNo = params.GetSize() > 0 ? (int)params[0] : 0;
- int nWordNo = params.GetSize() > 1 ? (int)params[1] : 0;
- bool bStrip = params.GetSize() > 2 ? (bool)params[2] : true;
-
- CPDF_Document* pDocument = m_pDocument->GetDocument();
- if (!pDocument) return FALSE;
-
- if (nPageNo < 0 || nPageNo >= pDocument->GetPageCount())
- {
- //sError = JSGetStringFromID(IDS_STRING_JSPARAMERROR);
- return FALSE;
- }
-
- CPDF_Dictionary* pPageDict = pDocument->GetPage(nPageNo);
- if (!pPageDict) return FALSE;
-
- CPDF_Page page;
- page.Load(pDocument, pPageDict);
- page.StartParse();
- page.ParseContent();
-
- FX_POSITION pos = page.GetFirstObjectPosition();
-
- int nWords = 0;
-
- CFX_WideString swRet;
-
- while (pos)
- {
- if (CPDF_PageObject* pPageObj = page.GetNextObject(pos))
- {
- if (pPageObj->m_Type == PDFPAGE_TEXT)
- {
- int nObjWords = CountWords((CPDF_TextObject*)pPageObj);
-
- if (nWords + nObjWords >= nWordNo)
- {
- swRet = GetObjWordStr((CPDF_TextObject*)pPageObj, nWordNo - nWords);
- break;
- }
-
- nWords += nObjWords;
- }
- }
- }
-
- if (bStrip)
- {
- swRet.TrimLeft();
- swRet.TrimRight();
- }
-
- vRet = swRet;
- return TRUE;
-}
-
-FX_BOOL Document::getPageNthWordQuads(OBJ_METHOD_PARAMS)
-{
- //if (IsSafeMode(cc)) return TRUE;
-
- ASSERT(m_pDocument != NULL);
-
- if (!m_pDocument->GetPermissions(FPDFPERM_EXTRACT_ACCESS)) return FALSE;
-
- return FALSE;
-}
-
-FX_BOOL Document::getPageNumWords(OBJ_METHOD_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- if (!m_pDocument->GetPermissions(FPDFPERM_EXTRACT_ACCESS)) return FALSE;
-
- int nPageNo = params.GetSize() > 0 ? (int)params[0] : 0;
-
- CPDF_Document* pDocument = m_pDocument->GetDocument();
- ASSERT(pDocument != NULL);
-
- if (nPageNo < 0 || nPageNo >= pDocument->GetPageCount())
- {
- //sError = JSGetStringFromID(IDS_STRING_JSPARAMERROR);
- return FALSE;
- }
-
- CPDF_Dictionary* pPageDict = pDocument->GetPage(nPageNo);
- if (!pPageDict) return FALSE;
-
- CPDF_Page page;
- page.Load(pDocument, pPageDict);
- page.StartParse();
- page.ParseContent();
-
- FX_POSITION pos = page.GetFirstObjectPosition();
-
- int nWords = 0;
-
- while (pos)
- {
- if (CPDF_PageObject* pPageObj = page.GetNextObject(pos))
- {
- if (pPageObj->m_Type == PDFPAGE_TEXT)
- {
- CPDF_TextObject* pTextObj = (CPDF_TextObject*)pPageObj;
- nWords += CountWords(pTextObj);
- }
- }
- }
-
- vRet = nWords;
-
- return TRUE;
-}
-
-FX_BOOL Document::getPrintParams(OBJ_METHOD_PARAMS)
-{
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
- CJS_Runtime* pRuntime = pContext->GetJSRuntime();
- ASSERT(pRuntime != NULL);
- JSFXObject pRetObj = JS_NewFxDynamicObj(*pRuntime, pContext, JS_GetObjDefnID(*pRuntime, L"PrintParamsObj"));
- //not implemented yet.
- vRet = pRetObj;
-
- return TRUE;
-}
-
-#define ISLATINWORD(u) (u != 0x20 && u <= 0x28FF)
-
-int Document::CountWords(CPDF_TextObject* pTextObj)
-{
- if (!pTextObj) return 0;
-
- int nWords = 0;
-
- CPDF_Font* pFont = pTextObj->GetFont();
- if (!pFont) return 0;
-
- FX_BOOL bIsLatin = FALSE;
-
- for (int i=0, sz=pTextObj->CountChars(); i<sz; i++)
- {
- FX_DWORD charcode = -1;
- FX_FLOAT kerning;
-
- pTextObj->GetCharInfo(i, charcode, kerning);
- CFX_WideString swUnicode = pFont->UnicodeFromCharCode(charcode);
-
- FX_WORD unicode = 0;
- if (swUnicode.GetLength() > 0)
- unicode = swUnicode[0];
-
- if (ISLATINWORD(unicode) && bIsLatin)
- continue;
-
- bIsLatin = ISLATINWORD(unicode);
- if (unicode != 0x20)
- nWords++;
- }
-
- return nWords;
-}
-
-CFX_WideString Document::GetObjWordStr(CPDF_TextObject* pTextObj, int nWordIndex)
-{
- ASSERT(pTextObj != NULL);
-
- CFX_WideString swRet;
-
- CPDF_Font* pFont = pTextObj->GetFont();
- if (!pFont) return L"";
-
- int nWords = 0;
- FX_BOOL bIsLatin = FALSE;
-
- for (int i=0, sz=pTextObj->CountChars(); i<sz; i++)
- {
- FX_DWORD charcode = -1;
- FX_FLOAT kerning;
-
- pTextObj->GetCharInfo(i, charcode, kerning);
- CFX_WideString swUnicode = pFont->UnicodeFromCharCode(charcode);
-
- FX_WORD unicode = 0;
- if (swUnicode.GetLength() > 0)
- unicode = swUnicode[0];
-
- if (ISLATINWORD(unicode) && bIsLatin)
- {
- }
- else
- {
- bIsLatin = ISLATINWORD(unicode);
- if (unicode != 0x20)
- nWords++;
- }
-
- if (nWords-1 == nWordIndex)
- swRet += unicode;
- }
-
- return swRet;
-}
-
-FX_BOOL Document::zoom(OBJ_PROP_PARAMS)
-{
-
- return TRUE;
-}
-
-/**
-(none, NoVary)
-(fitP, FitPage)
-(fitW, FitWidth)
-(fitH, FitHeight)
-(fitV, FitVisibleWidth)
-(pref, Preferred)
-(refW, ReflowWidth)
-*/
-
-FX_BOOL Document::zoomType(OBJ_PROP_PARAMS)
-{
- return TRUE;
-}
-
-FX_BOOL Document::deletePages(OBJ_METHOD_PARAMS)
-{
-
-
-
-
-
-
- v8::Isolate* isolate = GetIsolate(cc);
-// if (pEnv->GetAppName().Compare(PHANTOM) != 0)
-// return TRUE;
-
- //if (IsSafeMode(cc)) return TRUE;
-
- ASSERT(m_pDocument != NULL);
-
- if (!(m_pDocument->GetPermissions(FPDFPERM_MODIFY) ||
- m_pDocument->GetPermissions(FPDFPERM_ASSEMBLE))) return FALSE;
-
- int iSize = params.size();
-
- int nStart = 0;
- int nEnd = 0;
-
- if (iSize < 1)
- {
- }
- else if (iSize == 1)
- {
- if (params[0].GetType() == VT_object)
- {
- JSObject pObj = (JSObject )params[0];
- v8::Handle<v8::Value> pValue = JS_GetObjectElement(isolate,pObj, L"nStart");
- nStart = (int)CJS_Value(m_isolate,pValue,GET_VALUE_TYPE(pValue));
-
- pValue = JS_GetObjectElement(isolate,pObj, L"nEnd");
- nEnd = (int)CJS_Value(m_isolate,pValue,GET_VALUE_TYPE(pValue));
- }
- else
- {
- nStart = (int)params[0];
- }
- }
- else
- {
- nStart = (int)params[0];
- nEnd = (int)params[1];
- }
-
- int nTotal = m_pDocument->GetPageCount();
-
- if (nStart < 0) nStart = 0;
- if (nStart >= nTotal) nStart = nTotal - 1;
-
- if (nEnd < 0) nEnd = 0;
- if (nEnd >= nTotal) nEnd = nTotal - 1;
-
- if (nEnd < nStart) nEnd = nStart;
-
-
-
-#ifndef FOXIT_CHROME_BUILD
- return m_pDocument->DeletePages(nStart, nEnd - nStart + 1);
-#else
- return TRUE;
-#endif
-}
-
-FX_BOOL Document::extractPages(OBJ_METHOD_PARAMS)
-{
-
-
-
-
-
-
- v8::Isolate* isolate = GetIsolate(cc);
-
- if (IsSafeMode(cc)) return TRUE;
-
- ASSERT(m_pDocument != NULL);
-
- if (!m_pDocument->GetPermissions(FPDFPERM_EXTRACT)) return FALSE;
-
- int iSize = params.size();
-
- int nTotal = m_pDocument->GetPageCount();
- int nStart = 0;
- int nEnd = nTotal - 1;
-
- CFX_WideString swFilePath;
-
- if (iSize < 1)
- {
- }
- else if (iSize == 1)
- {
- if (params[0].GetType() == VT_object)
- {
- JSObject pObj = (JSObject )params[0];
- v8::Handle<v8::Value> pValue = JS_GetObjectElement(isolate,pObj, L"nStart");
- nStart = (int)CJS_Value(m_isolate,pValue,GET_VALUE_TYPE(pValue));
-
- pValue = JS_GetObjectElement(isolate,pObj, L"nEnd");
- nEnd = (int)CJS_Value(m_isolate,pValue,GET_VALUE_TYPE(pValue));
-
- pValue = JS_GetObjectElement(isolate,pObj, L"cPath");
- swFilePath = CJS_Value(m_isolate,pValue,GET_VALUE_TYPE(pValue)).operator CFX_WideString();
- }
- else
- {
- nStart = (int)params[0];
- }
- }
- else if (iSize == 2)
- {
- nStart = (int)params[0];
- nEnd = (int)params[1];
- }
- else
- {
- nStart = (int)params[0];
- nEnd = (int)params[1];
- swFilePath = params[2].operator CFX_WideString();
- }
-
- if (nEnd < nStart)
- nEnd = nStart;
-
- CPDF_Document *pNewDoc = new CPDF_Document;
- pNewDoc->CreateNewDoc();
-
- CFX_WordArray array;
- for (int i=nStart; i<=nEnd; i++)
- array.Add(i);
-
-// m_pDocument->ExtractPages(array, pNewDoc);
-
- if (swFilePath.IsEmpty())
- {
-
- }
- else
- {
- swFilePath = app::PDFPathToSysPath(swFilePath);
- CPDF_Creator PDFCreater(pNewDoc);
- PDFCreater.Create(swFilePath);
- delete pNewDoc;
-// pEnv->OpenDocument(swFilePath);
- vRet.SetNull();
- }
-
- return TRUE;
-}
-
-FX_BOOL Document::insertPages(OBJ_METHOD_PARAMS)
-{
-
-
-
-
-
-
- v8::Isolate* isolate = GetIsolate(cc);
-
- if (IsSafeMode(cc)) return TRUE;
-
- ASSERT(m_pDocument != NULL);
-
- if (!(m_pDocument->GetPermissions(FPDFPERM_MODIFY) ||
- m_pDocument->GetPermissions(FPDFPERM_ASSEMBLE))) return FALSE;
-
- int iSize = params.size();
-
- int nStart = 0;
- int nEnd = 0;
- int nPage = 0;
-
- CFX_WideString swFilePath;
-
- if (iSize < 1)
- {
- }
- else if (iSize == 1)
- {
- if (params[0].GetType() == VT_object)
- {
- JSObject pObj = (JSObject )params[0];
-
- v8::Handle<v8::Value> pValue = JS_GetObjectElement(isolate,pObj, L"nPage");
- nPage = (int)CJS_Value(m_isolate,pValue,GET_VALUE_TYPE(pValue));
-
- pValue = JS_GetObjectElement(isolate,pObj, L"cPath");
- swFilePath = CJS_Value(m_isolate,pValue,GET_VALUE_TYPE(pValue)).operator CFX_WideString();
-
- pValue = JS_GetObjectElement(isolate,pObj, L"nStart");
- nStart = (int)CJS_Value(m_isolate,pValue,GET_VALUE_TYPE(pValue));
-
- pValue = JS_GetObjectElement(isolate,pObj, L"nEnd");
- nEnd = (int)CJS_Value(m_isolate,pValue,GET_VALUE_TYPE(pValue));
- }
- else
- {
- nPage = (int)params[0];
- }
- }
- else
- {
- nPage = (int)params[0];
-
- if (iSize >= 2)
- swFilePath = params[1].operator CFX_WideString();
-
- if (iSize >= 3)
- nStart = (int)params[2];
-
- if (iSize >= 4)
- nEnd = (int)params[3];
- }
-
- nPage++;
-
- if (nPage < 0)
- nPage = 0;
-
- if (nPage > m_pDocument->GetPageCount())
- nPage = m_pDocument->GetPageCount();
-
- if (swFilePath.IsEmpty()) return FALSE;
-
- swFilePath = app::PDFPathToSysPath(swFilePath);
-
- CPDF_Parser pdfParser;
- pdfParser.StartParse(swFilePath, FALSE);
- CPDF_Document* pSrcDoc = pdfParser.GetDocument();
-
- if (!pSrcDoc)
- {
- pdfParser.CloseParser();
- return FALSE;
- }
-
- int nTotal = pSrcDoc->GetPageCount();
-
- if (nStart < 0) nStart = 0;
- if (nStart >= nTotal) nStart = nTotal - 1;
-
- if (nEnd < 0) nEnd = 0;
- if (nEnd >= nTotal) nEnd = nTotal - 1;
-
- if (nEnd < nStart) nEnd = nStart;
-
- CFX_WordArray array;
- for (int i=nStart; i<=nEnd; i++)
- array.Add(i);
-
-// m_pDocument->InsertPages(nPage, pSrcDoc, array);
-
- pdfParser.CloseParser();
-
- return TRUE;
-}
-
-FX_BOOL Document::replacePages(OBJ_METHOD_PARAMS)
-{
-
-
-
-
-
-
- v8::Isolate* isolate = GetIsolate(cc);
-
- if (IsSafeMode(cc)) return TRUE;
-
- ASSERT(m_pDocument != NULL);
-
- if (!(m_pDocument->GetPermissions(FPDFPERM_MODIFY) ||
- m_pDocument->GetPermissions(FPDFPERM_ASSEMBLE))) return FALSE;
-
- int iSize = params.size();
-
- int nStart = -1;
- int nEnd = -1;
- int nPage = 0;
-
- CFX_WideString swFilePath;
-
- if (iSize < 1)
- {
- }
- else if (iSize == 1)
- {
- if (params[0].GetType() == VT_object)
- {
- JSObject pObj = (JSObject )params[0];
-
- v8::Handle<v8::Value> pValue = JS_GetObjectElement(isolate,pObj, L"nPage");
- nPage = (int)CJS_Value(m_isolate,pValue,GET_VALUE_TYPE(pValue));
-
- pValue = JS_GetObjectElement(isolate,pObj, L"cPath");
- swFilePath = CJS_Value(m_isolate,pValue,GET_VALUE_TYPE(pValue)).operator CFX_WideString();
-
- pValue = JS_GetObjectElement(isolate,pObj, L"nStart");
- nStart = (int)CJS_Value(m_isolate,pValue,GET_VALUE_TYPE(pValue));
-
- pValue = JS_GetObjectElement(isolate,pObj, L"nEnd");
- nEnd = (int)CJS_Value(m_isolate,pValue,GET_VALUE_TYPE(pValue));
- }
- else
- {
- nPage = (int)params[0];
- }
- }
- else
- {
- nPage = (int)params[0];
-
- if (iSize >= 2)
- swFilePath = params[1].operator CFX_WideString();
-
- if (iSize >= 3)
- nStart = (int)params[2];
-
- if (iSize >= 4)
- nEnd = (int)params[3];
- }
-
- if (nPage < 0)
- nPage = 0;
-
- if (nPage >= m_pDocument->GetPageCount())
- nPage = m_pDocument->GetPageCount() - 1;
-
- if (swFilePath.IsEmpty()) return FALSE;
-
- swFilePath = app::PDFPathToSysPath(swFilePath);
-
- CPDF_Parser pdfParser;
- pdfParser.StartParse(swFilePath, FALSE);
- CPDF_Document* pSrcDoc = pdfParser.GetDocument();
-
- if (!pSrcDoc)
- {
- pdfParser.CloseParser();
- return FALSE;
- }
-
- int nTotal = pSrcDoc->GetPageCount();
-
- if (nStart < 0)
- {
- if (nEnd < 0)
- {
- nStart = 0;
- nEnd = nTotal - 1;
- }
- else
- {
- nStart = 0;
- }
- }
- else
- {
- if (nEnd < 0)
- {
- nEnd = nStart;
- }
- else
- {
- if (nStart >= nTotal) nStart = nTotal - 1;
- if (nEnd >= nTotal) nEnd = nTotal - 1;
-
- if (nEnd < nStart) nEnd = nStart;
- }
- }
-
- CFX_WordArray array;
- for (int i=nStart; i<=nEnd; i++)
- array.Add(i);
-
-// m_pDocument->ReplacePages(nPage, pSrcDoc, array);
-
- pdfParser.CloseParser();
-
- return TRUE;
-}
-
-FX_BOOL Document::getURL(OBJ_METHOD_PARAMS)
-{
- if (IsSafeMode(cc)) return TRUE;
-
- return TRUE;
-}
-
-void Document::AddDelayData(CJS_DelayData* pData)
-{
- m_DelayData.Add(pData);
-}
-
-void Document::DoFieldDelay(const CFX_WideString& sFieldName, int nControlIndex)
-{
- CFX_DWordArray DelArray;
-
- for (int i=0,sz=m_DelayData.GetSize(); i<sz; i++)
- {
- if (CJS_DelayData* pData = m_DelayData.GetAt(i))
- {
- if (pData->sFieldName == sFieldName && pData->nControlIndex == nControlIndex)
- {
- Field::DoDelay(m_pDocument, pData);
- delete pData;
- m_DelayData.SetAt(i, NULL);
- DelArray.Add(i);
- }
- }
- }
-
- for (int j=DelArray.GetSize()-1; j>=0; j--)
- {
- m_DelayData.RemoveAt(DelArray[j]);
- }
-}
-
-void Document::AddDelayAnnotData(CJS_AnnotObj *pData)
-{
- m_DelayAnnotData.Add(pData);
-}
-
-void Document::DoAnnotDelay()
-{
- CFX_DWordArray DelArray;
-
- for (int j=DelArray.GetSize()-1; j>=0; j--)
- {
- m_DelayData.RemoveAt(DelArray[j]);
- }
-}
+// 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
+
+#include "../../include/javascript/JavaScript.h"
+#include "../../include/javascript/IJavaScript.h"
+#include "../../include/javascript/JS_Define.h"
+#include "../../include/javascript/JS_Object.h"
+#include "../../include/javascript/JS_Value.h"
+#include "../../include/javascript/Document.h"
+#include "../../include/javascript/JS_EventHandler.h"
+#include "../../include/javascript/JS_Context.h"
+#include "../../include/javascript/JS_Runtime.h"
+#include "../../include/javascript/app.h"
+#include "../../include/javascript/Field.h"
+#include "../../include/javascript/Icon.h"
+#include "../../include/javascript/Field.h"
+
+static v8::Isolate* GetIsolate(IFXJS_Context* cc)
+{
+ CJS_Context* pContext = (CJS_Context *)cc;
+ ASSERT(pContext != NULL);
+
+ CJS_Runtime* pRuntime = pContext->GetJSRuntime();
+ ASSERT(pRuntime != NULL);
+
+ return pRuntime->GetIsolate();
+}
+
+BEGIN_JS_STATIC_CONST(CJS_PrintParamsObj)
+END_JS_STATIC_CONST()
+
+BEGIN_JS_STATIC_PROP(CJS_PrintParamsObj)
+END_JS_STATIC_PROP()
+
+BEGIN_JS_STATIC_METHOD(CJS_PrintParamsObj)
+END_JS_STATIC_METHOD()
+
+IMPLEMENT_JS_CLASS(CJS_PrintParamsObj, PrintParamsObj)
+
+PrintParamsObj::PrintParamsObj(CJS_Object* pJSObject)
+: CJS_EmbedObj(pJSObject)
+{
+ bUI = TRUE;
+ nStart = 0;
+ nEnd = 0;
+ bSilent = FALSE;
+ bShrinkToFit = FALSE;
+ bPrintAsImage = FALSE;
+ bReverse = FALSE;
+ bAnnotations = TRUE;
+}
+
+/* ---------------------- Document ---------------------- */
+
+#define MINWIDTH 5.0f
+#define MINHEIGHT 5.0f
+
+BEGIN_JS_STATIC_CONST(CJS_Document)
+END_JS_STATIC_CONST()
+
+BEGIN_JS_STATIC_PROP(CJS_Document)
+ JS_STATIC_PROP_ENTRY(ADBE)
+ JS_STATIC_PROP_ENTRY(author)
+ JS_STATIC_PROP_ENTRY(baseURL)
+ JS_STATIC_PROP_ENTRY(bookmarkRoot)
+ JS_STATIC_PROP_ENTRY(calculate)
+ JS_STATIC_PROP_ENTRY(Collab)
+ JS_STATIC_PROP_ENTRY(creationDate)
+ JS_STATIC_PROP_ENTRY(creator)
+ JS_STATIC_PROP_ENTRY(delay)
+ JS_STATIC_PROP_ENTRY(dirty)
+ JS_STATIC_PROP_ENTRY(documentFileName)
+ JS_STATIC_PROP_ENTRY(external)
+ JS_STATIC_PROP_ENTRY(filesize)
+ JS_STATIC_PROP_ENTRY(icons)
+ JS_STATIC_PROP_ENTRY(info)
+ JS_STATIC_PROP_ENTRY(keywords)
+ JS_STATIC_PROP_ENTRY(layout)
+ JS_STATIC_PROP_ENTRY(media)
+ JS_STATIC_PROP_ENTRY(modDate)
+ JS_STATIC_PROP_ENTRY(mouseX)
+ JS_STATIC_PROP_ENTRY(mouseY)
+ JS_STATIC_PROP_ENTRY(numFields)
+ JS_STATIC_PROP_ENTRY(numPages)
+ JS_STATIC_PROP_ENTRY(pageNum)
+ JS_STATIC_PROP_ENTRY(pageWindowRect)
+ JS_STATIC_PROP_ENTRY(path)
+ JS_STATIC_PROP_ENTRY(producer)
+ JS_STATIC_PROP_ENTRY(subject)
+ JS_STATIC_PROP_ENTRY(title)
+ JS_STATIC_PROP_ENTRY(zoom)
+ JS_STATIC_PROP_ENTRY(zoomType)
+END_JS_STATIC_PROP()
+
+BEGIN_JS_STATIC_METHOD(CJS_Document)
+ JS_STATIC_METHOD_ENTRY(addAnnot,0)
+ JS_STATIC_METHOD_ENTRY(addField, 4)
+ JS_STATIC_METHOD_ENTRY(addLink, 0)
+ JS_STATIC_METHOD_ENTRY(addIcon, 0)
+ JS_STATIC_METHOD_ENTRY(calculateNow, 0)
+ JS_STATIC_METHOD_ENTRY(closeDoc, 0)
+ JS_STATIC_METHOD_ENTRY(createDataObject, 0)
+ JS_STATIC_METHOD_ENTRY(deletePages, 2)
+ JS_STATIC_METHOD_ENTRY(exportAsText, 3)
+ JS_STATIC_METHOD_ENTRY(exportAsFDF, 6)
+ JS_STATIC_METHOD_ENTRY(exportAsXFDF, 5)
+ JS_STATIC_METHOD_ENTRY(extractPages, 3)
+ JS_STATIC_METHOD_ENTRY(getAnnot, 0)
+ JS_STATIC_METHOD_ENTRY(getAnnots, 2)
+ JS_STATIC_METHOD_ENTRY(getAnnot3D, 2)
+ JS_STATIC_METHOD_ENTRY(getAnnots3D, 1)
+ JS_STATIC_METHOD_ENTRY(getField, 1)
+ JS_STATIC_METHOD_ENTRY(getIcon, 0)
+ JS_STATIC_METHOD_ENTRY(getLinks, 0)
+ JS_STATIC_METHOD_ENTRY(getNthFieldName, 1)
+ JS_STATIC_METHOD_ENTRY(getOCGs, 0)
+ JS_STATIC_METHOD_ENTRY(getPageBox, 0)
+ JS_STATIC_METHOD_ENTRY(getPageNthWord, 3)
+ JS_STATIC_METHOD_ENTRY(getPageNthWordQuads, 2)
+ JS_STATIC_METHOD_ENTRY(getPageNumWords, 1)
+ JS_STATIC_METHOD_ENTRY(getPrintParams, 0)
+ JS_STATIC_METHOD_ENTRY(getURL, 2)
+ JS_STATIC_METHOD_ENTRY(importAnFDF, 1)
+ JS_STATIC_METHOD_ENTRY(importAnXFDF, 1)
+ JS_STATIC_METHOD_ENTRY(importTextData, 2)
+ JS_STATIC_METHOD_ENTRY(insertPages, 4)
+ JS_STATIC_METHOD_ENTRY(mailForm, 6)
+ JS_STATIC_METHOD_ENTRY(print, 9)
+ JS_STATIC_METHOD_ENTRY(removeField, 1)
+ JS_STATIC_METHOD_ENTRY(replacePages, 4)
+ JS_STATIC_METHOD_ENTRY(resetForm, 1)
+ JS_STATIC_METHOD_ENTRY(removeIcon, 0)
+ JS_STATIC_METHOD_ENTRY(saveAs, 5)
+ JS_STATIC_METHOD_ENTRY(submitForm, 23)
+ JS_STATIC_METHOD_ENTRY(mailDoc, 0)
+END_JS_STATIC_METHOD()
+
+IMPLEMENT_JS_CLASS(CJS_Document, Document)
+
+FX_BOOL CJS_Document::InitInstance(IFXJS_Context* cc)
+{
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+
+ Document* pDoc = (Document*)GetEmbedObject();
+ ASSERT(pDoc != NULL);
+
+ pDoc->AttachDoc(pContext->GetReaderDocument());
+ pDoc->SetIsolate(pContext->GetJSRuntime()->GetIsolate());
+ return TRUE;
+};
+
+/* --------------------------------- Document --------------------------------- */
+
+Document::Document(CJS_Object* pJSObject) : CJS_EmbedObj(pJSObject),
+ m_cwBaseURL(L""),
+ m_pIconTree(NULL),
+ m_pDocument(NULL),
+ m_bDelay(FALSE),
+ m_isolate(NULL)
+{
+}
+
+Document::~Document()
+{
+ if (m_pIconTree)
+ {
+ m_pIconTree->DeleteIconTree();
+ delete m_pIconTree;
+ m_pIconTree = NULL;
+ }
+ for (int i=0; i<m_DelayData.GetSize(); i++)
+ {
+ if (CJS_DelayData* pData = m_DelayData.GetAt(i))
+ {
+ delete pData;
+ pData = NULL;
+ m_DelayData.SetAt(i, NULL);
+
+ }
+ }
+
+ m_DelayData.RemoveAll();
+ m_DelayAnnotData.RemoveAll();
+}
+
+//the total number of fileds in document.
+FX_BOOL Document::numFields(OBJ_PROP_PARAMS)
+{
+ if (!vp.IsGetting()) return FALSE;
+
+ ASSERT(m_pDocument != NULL);
+
+ CPDFSDK_InterForm *pInterForm = m_pDocument->GetInterForm();
+ ASSERT(pInterForm != NULL);
+
+ CPDF_InterForm *pPDFForm = pInterForm->GetInterForm();
+ ASSERT(pPDFForm != NULL);
+
+ vp << (int)pPDFForm->CountFields();
+
+ return TRUE;
+}
+
+FX_BOOL Document::dirty(OBJ_PROP_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ if (vp.IsGetting())
+ {
+ if (m_pDocument->GetChangeMark())
+ vp << true;
+ else
+ vp << false;
+ }
+ else
+ {
+ bool bChanged = false;
+
+ vp >> bChanged;
+
+ if (bChanged)
+ m_pDocument->SetChangeMark();
+ else
+ m_pDocument->ClearChangeMark();
+ }
+
+ return TRUE;
+}
+
+FX_BOOL Document::ADBE(OBJ_PROP_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ if (vp.IsGetting())
+ {
+ vp.SetNull();
+ }
+ else
+ {
+ }
+
+ return TRUE;
+}
+
+FX_BOOL Document::pageNum(OBJ_PROP_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ if (vp.IsGetting())
+ {
+ if (CPDFSDK_PageView* pPageView = m_pDocument->GetCurrentView())
+ {
+ vp << pPageView->GetPageIndex();
+ }
+ }
+ else
+ {
+ int iPageCount = m_pDocument->GetPageCount();
+
+ int iPageNum = 0;
+ vp >> iPageNum;
+
+ CPDFDoc_Environment* pEnv = m_pDocument->GetEnv();
+ if(!pEnv)
+ return FALSE;
+
+ if (iPageNum >= 0 && iPageNum < iPageCount)
+ {
+ pEnv->JS_docgotoPage(iPageNum);
+ }
+ else if (iPageNum >= iPageCount)
+ {
+ pEnv->JS_docgotoPage(iPageCount-1);
+ }
+ else if (iPageNum < 0)
+ {
+ pEnv->JS_docgotoPage(0);
+ }
+ }
+
+ return TRUE;
+}
+
+FX_BOOL Document::ParserParams(JSObject* pObj,CJS_AnnotObj& annotobj)
+{
+ return TRUE;
+}
+
+FX_BOOL Document::addAnnot(OBJ_METHOD_PARAMS)
+{
+ return TRUE;
+}
+
+FX_BOOL Document::addField(OBJ_METHOD_PARAMS)
+{
+ //Doesn't support.
+ return TRUE;
+}
+
+//exports form fields as a tab-delimited text file to a local hard disk.
+//comment: need reader support
+//note : watch the third parameter:cPath, for what case it can be safely saved?
+//int CPDFSDK_InterForm::ExportAsText(FX_BOOL bNoPassword,StringArray aFields,String cPath);
+//return value, int the index of the parameters illegal, the index is based on 1.
+
+FX_BOOL Document::exportAsText(OBJ_METHOD_PARAMS)
+{
+ if (IsSafeMode(cc)) return TRUE;
+ return TRUE;
+}
+
+//exports form fields as a fdf file to the local hard drive
+//comment: need reader supports
+//note:the last parameter hasn't been confirmed.because the previous one blocks the way.
+//int CPDFSDK_Document::ExportAsFDF(FX_BOOL bAllFields,BOOL bNoPassword,StringArray aFields,FX_BOOL bFlags,String cPath,FX_BOOL bAnnotations);
+
+FX_BOOL Document::exportAsFDF(OBJ_METHOD_PARAMS)
+{
+ v8::Isolate* isolate = GetIsolate(cc);
+ if (IsSafeMode(cc)) return TRUE;
+
+ ASSERT(m_pDocument != NULL);
+
+ if (!m_pDocument->GetPermissions(FPDFPERM_EXTRACT_ACCESS)) return FALSE;
+
+ FX_BOOL bAllFields = params.size() > 0 ? (FX_BOOL)params[0] : FALSE;
+ FX_BOOL bNoPassWord = params.size() > 1 ? (FX_BOOL)params[1] : TRUE;
+ FX_BOOL bWhole = params.size() > 2 ? (params[2].GetType() == VT_null) : TRUE;
+ CJS_Array arrayFileds(isolate);
+ if (!bWhole)
+ arrayFileds.Attach(params[2]);
+ //FX_BOOL bFlags = params.size() > 3 ? (FX_BOOL)params[3] : FALSE;
+ CFX_WideString swFilePath = params.size() > 4 ? (FX_LPCWSTR)params[4].operator CFX_WideString() : (FX_LPCWSTR)L"";
+
+ if (swFilePath.IsEmpty())
+ {
+ CPDFDoc_Environment* pEnv = m_pDocument->GetEnv();
+ swFilePath = pEnv->JS_fieldBrowse();
+ if(swFilePath.IsEmpty())
+ return TRUE;
+ }
+ else
+ {
+ swFilePath = app::PDFPathToSysPath(swFilePath);
+ }
+
+ m_pDocument->SetFocusAnnot(NULL);
+
+ CPDFSDK_InterForm* pInterForm= (CPDFSDK_InterForm*)m_pDocument->GetInterForm();
+ ASSERT(pInterForm != NULL);
+
+ CPDF_InterForm* pPDFForm = pInterForm->GetInterForm();
+ ASSERT(pPDFForm != NULL);
+
+ CFX_PtrArray aFields;
+
+ if (bWhole)
+ {
+ for (int j=0,jsz=pPDFForm->CountFields(); j<jsz; j++)
+ {
+ aFields.Add(pPDFForm->GetField(j));
+ }
+ }
+ else
+ {
+ for (int i=0,isz=arrayFileds.GetLength(); i<isz; i++)
+ {
+ CJS_Value valName(isolate);
+ arrayFileds.GetElement(i,valName);
+ CFX_WideString swName = valName.operator CFX_WideString();
+
+ for (int j=0, jsz=pPDFForm->CountFields(swName); j<jsz; j++)
+ {
+ aFields.Add(pPDFForm->GetField(j, swName));
+ }
+ }
+ }
+
+ CFX_PtrArray fields;
+
+ for (int i=0,sz=aFields.GetSize(); i<sz; i++)
+ {
+ CPDF_FormField* pField = (CPDF_FormField*)aFields[i];
+
+ if (!bAllFields)
+ if (pField->GetValue() == L"")
+ continue;
+
+ if (bNoPassWord)
+ if (pField->GetFieldFlags() & 0x2000)
+ continue;
+
+ fields.Add((void*)pField);
+ }
+
+ return pInterForm->ExportFieldsToFDFFile(swFilePath, fields, TRUE);
+}
+
+//exports form fields an XFDF file to the local hard drive
+//comment: need reder supports
+//note:the last parameter can't be test
+//int CPDFSDK_Document::ExportAsXFDF(FX_BOOL bAllFields,FX_BOOL bNoPassWord,StringArray aFields,String cPath,FX_BOOL bAnnoatations);
+
+FX_BOOL Document::exportAsXFDF(OBJ_METHOD_PARAMS)
+{
+ if (IsSafeMode(cc)) return TRUE;
+ ASSERT(m_pDocument != NULL);
+
+ if (!m_pDocument->GetPermissions(FPDFPERM_EXTRACT_ACCESS)) return FALSE;
+
+ return TRUE;
+}
+
+//Maps a field object in PDF document to a JavaScript variable
+//comment:
+//note: the paremter cName, this is clue how to treat if the cName is not a valiable filed name in this document
+
+FX_BOOL Document::getField(OBJ_METHOD_PARAMS)
+{
+ v8::Isolate* isolate = GetIsolate(cc);
+ ASSERT(m_pDocument != NULL);
+
+ if (params.size() < 1) return FALSE;
+
+ CFX_WideString wideName = params[0].operator CFX_WideString();
+
+ CPDFSDK_InterForm* pInterForm = m_pDocument->GetInterForm();
+ ASSERT(pInterForm != NULL);
+
+ CPDF_InterForm* pPDFForm = pInterForm->GetInterForm();
+ ASSERT(pPDFForm != NULL);
+
+ if (pPDFForm->CountFields(wideName) <= 0)
+ {
+ vRet.SetNull();
+ return TRUE;
+ }
+
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+ CJS_Runtime* pRuntime = pContext->GetJSRuntime();
+ ASSERT(pRuntime != NULL);
+
+ JSFXObject pFieldObj = JS_NewFxDynamicObj(*pRuntime, pContext, JS_GetObjDefnID(*pRuntime, L"Field"));
+
+ CJS_Field * pJSField = (CJS_Field*)JS_GetPrivate(isolate,pFieldObj);
+ ASSERT(pJSField != NULL);
+
+ Field * pField = (Field *)pJSField->GetEmbedObject();
+ ASSERT(pField != NULL);
+
+ pField->AttachField(this, wideName);
+ vRet = pJSField;
+
+ return TRUE;
+}
+
+//Gets the name of the nth field in the document
+//comment:
+//note: the parameter nIndex, if it is not available
+
+FX_BOOL Document::getNthFieldName(OBJ_METHOD_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ int nIndex = params.size() > 0 ? (int)params[0] : -1;
+ if (nIndex == -1) return FALSE;
+
+ CPDFSDK_InterForm* pInterForm = m_pDocument->GetInterForm();
+ ASSERT(pInterForm != NULL);
+
+ CPDF_InterForm* pPDFForm = pInterForm->GetInterForm();
+ ASSERT(pPDFForm != NULL);
+
+ CPDF_FormField* pField = pPDFForm->GetField(nIndex);
+ if (!pField)
+ return FALSE;
+
+ vRet = pField->GetFullName();
+ return TRUE;
+}
+
+//imports the specified fdf file.
+//comments: need reader suppport
+//note:once the cpath is illigl then a file dialog box pops up in order to ask user to chooose the file
+//int CPDFSDK_Document::importAnFDF(String cPath);
+
+FX_BOOL Document::importAnFDF(OBJ_METHOD_PARAMS)
+{
+ if (IsSafeMode(cc)) return TRUE;
+ ASSERT(m_pDocument != NULL);
+
+ if (!(m_pDocument->GetPermissions(FPDFPERM_MODIFY) ||
+ m_pDocument->GetPermissions(FPDFPERM_ANNOT_FORM) ||
+ m_pDocument->GetPermissions(FPDFPERM_FILL_FORM))) return FALSE;
+
+
+ CFX_WideString swPath;
+
+ if (params.size() > 0)
+ swPath = params[0];
+
+ if (swPath.IsEmpty())
+ {
+ CPDFDoc_Environment* pEnv = m_pDocument->GetEnv();
+ swPath = pEnv->JS_fieldBrowse();
+ if(swPath.IsEmpty())
+ return TRUE;
+ }
+ else
+ {
+ swPath = app::PDFPathToSysPath(swPath);
+ }
+
+ m_pDocument->SetFocusAnnot(NULL);
+
+ CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInterForm();
+ ASSERT(pInterForm != NULL);
+
+ if (!pInterForm->ImportFormFromFDFFile(swPath, TRUE))
+ return FALSE;
+
+ m_pDocument->SetChangeMark();
+// CPDFDoc_Environment* pEnv = m_pDocument->GetEnv();
+// ASSERT(pEnv != NULL);
+// IUndo* pUndo = IUndo::GetUndo(pEnv);
+// ASSERT(pUndo != NULL);
+// pUndo->Reset(m_pDocument);
+
+ return TRUE;
+}
+
+//imports and specified XFDF file containing XML form data
+//comment: need reader supports
+//note: same as up
+//int CPDFSDK_Document::importAnFDF(String cPath)
+
+FX_BOOL Document::importAnXFDF(OBJ_METHOD_PARAMS)
+{
+ if (IsSafeMode(cc)) return TRUE;
+ ASSERT(m_pDocument != NULL);
+
+ if (!(m_pDocument->GetPermissions(FPDFPERM_MODIFY) ||
+ m_pDocument->GetPermissions(FPDFPERM_ANNOT_FORM) ||
+ m_pDocument->GetPermissions(FPDFPERM_FILL_FORM))) return FALSE;
+
+ return TRUE;
+}
+
+//imports and specified text file
+//commnet: need reader supports
+//note: same as up,when nRow is not rational,adobe is dumb for it.
+//int CPDFSDK_Document::importTextData(String cPath,int nRow);
+
+FX_BOOL Document::importTextData(OBJ_METHOD_PARAMS)
+{
+ if (IsSafeMode(cc)) return TRUE;
+ ASSERT(m_pDocument != NULL);
+
+ if (!(m_pDocument->GetPermissions(FPDFPERM_MODIFY) ||
+ m_pDocument->GetPermissions(FPDFPERM_ANNOT_FORM) ||
+ m_pDocument->GetPermissions(FPDFPERM_FILL_FORM))) return FALSE;
+
+ return TRUE;
+}
+
+//exports the form data and mails the resulting fdf file as an attachment to all recipients.
+//comment: need reader supports
+//note:
+//int CPDFSDK_Document::mailForm(FX_BOOL bUI,String cto,string ccc,string cbcc,string cSubject,string cms);
+
+FX_BOOL Document::mailForm(OBJ_METHOD_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ if (!m_pDocument->GetPermissions(FPDFPERM_EXTRACT_ACCESS)) return FALSE;
+
+ int iLength = params.size();
+
+ FX_BOOL bUI = iLength > 0 ? (FX_BOOL)params[0] : TRUE;
+ CFX_WideString cTo = iLength > 1 ? (FX_LPCWSTR)params[1].operator CFX_WideString() : (FX_LPCWSTR)L"";
+ CFX_WideString cCc = iLength > 2 ? (FX_LPCWSTR)params[2].operator CFX_WideString() : (FX_LPCWSTR)L"";
+ CFX_WideString cBcc = iLength > 3 ? (FX_LPCWSTR)params[3].operator CFX_WideString() : (FX_LPCWSTR)L"";
+ CFX_WideString cSubject = iLength > 4 ? (FX_LPCWSTR)params[4].operator CFX_WideString() : (FX_LPCWSTR)L"";
+ CFX_WideString cMsg = iLength > 5 ? (FX_LPCWSTR)params[5].operator CFX_WideString() : (FX_LPCWSTR)L"";
+
+ CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInterForm();
+ ASSERT(pInterForm != NULL);
+
+ CFX_ByteTextBuf textBuf;
+ if (!pInterForm->ExportFormToFDFTextBuf(textBuf))
+ return FALSE;
+
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+ CPDFDoc_Environment* pEnv = pContext->GetReaderApp();
+ ASSERT(pEnv != NULL);
+ CJS_Runtime* pRuntime = pContext->GetJSRuntime();
+ ASSERT(pRuntime != NULL);
+
+ pRuntime->BeginBlock();
+ pEnv->JS_docmailForm(textBuf.GetBuffer(), textBuf.GetLength(), bUI, (FX_LPCWSTR)cTo, (FX_LPCWSTR)cSubject, (FX_LPCWSTR)cCc, (FX_LPCWSTR)cBcc, (FX_LPCWSTR)cMsg);
+ pRuntime->EndBlock();
+ return TRUE;
+}
+
+FX_BOOL Document::print(OBJ_METHOD_PARAMS)
+{
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+ CJS_Runtime* pRuntime = pContext->GetJSRuntime();
+ ASSERT(pRuntime != NULL);
+
+ FX_BOOL bUI = TRUE;
+ int nStart = 0;
+ int nEnd = 0;
+ FX_BOOL bSilent = FALSE;
+ FX_BOOL bShrinkToFit = FALSE;
+ FX_BOOL bPrintAsImage = FALSE;
+ FX_BOOL bReverse = FALSE;
+ FX_BOOL bAnnotations = FALSE;
+
+ int nlength = params.size();
+ if(nlength ==9)
+ {
+ if (params[8].GetType() == VT_fxobject)
+ {
+ JSFXObject pObj = (JSFXObject)params[8];
+ {
+ if (JS_GetObjDefnID(pObj) == JS_GetObjDefnID(*pRuntime, L"PrintParamsObj"))
+ {
+ if (CJS_Object* pJSObj = (CJS_Object*)params[8])
+ {
+ if (PrintParamsObj* pprintparamsObj = (PrintParamsObj*)pJSObj->GetEmbedObject())
+ {
+ bUI = pprintparamsObj->bUI;
+ nStart = pprintparamsObj->nStart;
+ nEnd = pprintparamsObj->nEnd;
+ bSilent = pprintparamsObj->bSilent;
+ bShrinkToFit = pprintparamsObj->bShrinkToFit;
+ bPrintAsImage = pprintparamsObj->bPrintAsImage;
+ bReverse = pprintparamsObj->bReverse;
+ bAnnotations = pprintparamsObj->bAnnotations;
+ }
+ }
+ }
+ }
+ }
+ }
+ else
+ {
+ if(nlength >= 1)
+ bUI = params[0];
+ if(nlength >= 2)
+ nStart = (int)params[1];
+ if(nlength >= 3)
+ nEnd = (int)params[2];
+ if(nlength >= 4)
+ bSilent = params[3];
+ if(nlength >= 5)
+ bShrinkToFit = params[4];
+ if(nlength >= 6)
+ bPrintAsImage = params[5];
+ if(nlength >= 7)
+ bReverse = params[6];
+ if(nlength >= 8)
+ bAnnotations = params[7];
+ }
+
+ ASSERT(m_pDocument != NULL);
+
+ if (CPDFDoc_Environment* pEnv = m_pDocument->GetEnv())
+ {
+ pEnv->JS_docprint(bUI, nStart, nEnd, bSilent, bShrinkToFit, bPrintAsImage, bReverse, bAnnotations);
+ return TRUE;
+ }
+ return FALSE;
+}
+
+//removes the specified field from the document.
+//comment:
+//note: if the filed name is not retional, adobe is dumb for it.
+
+FX_BOOL Document::removeField(OBJ_METHOD_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ if (!(m_pDocument->GetPermissions(FPDFPERM_MODIFY) ||
+ m_pDocument->GetPermissions(FPDFPERM_ANNOT_FORM))) return FALSE;
+
+ if (params.size() < 1)
+ return TRUE;
+
+ CFX_WideString sFieldName = params[0].operator CFX_WideString();
+
+ CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInterForm();
+ ASSERT(pInterForm != NULL);
+
+ CFX_PtrArray widgets;
+ pInterForm->GetWidgets(sFieldName, widgets);
+
+ int nSize = widgets.GetSize();
+
+ if (nSize > 0)
+ {
+ for (int i=0; i<nSize; i++)
+ {
+ CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)widgets[i];
+ ASSERT(pWidget != NULL);
+
+ CPDF_Rect rcAnnot = pWidget->GetRect();
+ rcAnnot.left -= 1;
+ rcAnnot.bottom -= 1;
+ rcAnnot.right += 1;
+ rcAnnot.top += 1;
+
+ CFX_RectArray aRefresh;
+ aRefresh.Add(rcAnnot);
+
+ CPDF_Page* pPage = pWidget->GetPDFPage();
+ ASSERT(pPage != NULL);
+
+ CPDFSDK_PageView* pPageView = m_pDocument->GetPageView(pPage);
+ pPageView->DeleteAnnot(pWidget);
+
+ pPageView->UpdateRects(aRefresh);
+ }
+ m_pDocument->SetChangeMark();
+ }
+
+ return TRUE;
+}
+
+//reset filed values within a document.
+//comment:
+//note: if the fields names r not rational, aodbe is dumb for it.
+
+FX_BOOL Document::resetForm(OBJ_METHOD_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ if (!(m_pDocument->GetPermissions(FPDFPERM_MODIFY) ||
+ m_pDocument->GetPermissions(FPDFPERM_ANNOT_FORM) ||
+ m_pDocument->GetPermissions(FPDFPERM_FILL_FORM))) return FALSE;
+
+ CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInterForm();
+ ASSERT(pInterForm != NULL);
+
+ CPDF_InterForm* pPDFForm = pInterForm->GetInterForm();
+ ASSERT(pPDFForm != NULL);
+
+ v8::Isolate* isolate = GetIsolate(cc);
+ CJS_Array aName(isolate);
+
+ if (params.size() > 0)
+ {
+ switch (params[0].GetType())
+ {
+ default:
+ aName.Attach(params[0]);
+ break;
+ case VT_string:
+ aName.SetElement(0,params[0]);
+ break;
+ }
+
+ CFX_PtrArray aFields;
+
+ for (int i=0,isz=aName.GetLength(); i<isz; i++)
+ {
+ CJS_Value valElement(isolate);
+ aName.GetElement(i,valElement);
+ CFX_WideString swVal = valElement.operator CFX_WideString();
+
+ for (int j=0,jsz=pPDFForm->CountFields(swVal); j<jsz; j++)
+ {
+ aFields.Add((void*)pPDFForm->GetField(j,swVal));
+ }
+ }
+
+ if (aFields.GetSize() > 0)
+ {
+ pPDFForm->ResetForm(aFields, TRUE, TRUE);
+ m_pDocument->SetChangeMark();
+
+ }
+ }
+ else
+ {
+ pPDFForm->ResetForm(TRUE);
+ m_pDocument->SetChangeMark();
+
+ }
+
+ return TRUE;
+}
+
+
+FX_BOOL Document::saveAs(OBJ_METHOD_PARAMS)
+{
+
+ if (IsSafeMode(cc)) return TRUE;
+
+ ASSERT(m_pDocument != NULL);
+
+// m_pDocument->DoSaveAs();
+
+ return TRUE;
+}
+
+
+FX_BOOL Document::submitForm(OBJ_METHOD_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+// if (!m_pDocument->GetPermissions(FPDFPERM_EXTRACT_ACCESS)) return FALSE;
+
+ int nSize = params.size();
+ if (nSize < 1) return FALSE;
+
+ CFX_WideString strURL;
+ FX_BOOL bFDF = TRUE;
+ FX_BOOL bEmpty = FALSE;
+ v8::Isolate* isolate = GetIsolate(cc);
+ CJS_Array aFields(isolate);
+
+ CJS_Value v = params[0];
+ if (v.GetType() == VT_string)
+ {
+ strURL = params[0].operator CFX_WideString();
+ if (nSize > 1)
+ bFDF = params[1];
+ if (nSize > 2)
+ bEmpty = params[2];
+ if (nSize > 3)
+ aFields.Attach(params[3]);
+ }
+ else if (v.GetType() == VT_object)
+ {
+ JSObject pObj = (JSObject)params[0];
+ v8::Handle<v8::Value> pValue = JS_GetObjectElement(isolate,pObj, L"cURL");
+ if (!pValue.IsEmpty())
+ strURL = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue));
+ pValue = JS_GetObjectElement(isolate,pObj, L"bFDF");
+ bFDF = CJS_Value(isolate,pValue, GET_VALUE_TYPE(pValue));
+ pValue = JS_GetObjectElement(isolate,pObj, L"bEmpty");
+ bEmpty = CJS_Value(isolate,pValue, GET_VALUE_TYPE(pValue));
+ pValue = JS_GetObjectElement(isolate,pObj,L"aFields");
+ aFields.Attach(CJS_Value(isolate,pValue, GET_VALUE_TYPE(pValue)));
+ }
+
+ CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInterForm();
+ ASSERT(pInterForm != NULL);
+ CPDF_InterForm* pPDFInterForm = pInterForm->GetInterForm();
+ ASSERT(pPDFInterForm != NULL);
+
+ FX_BOOL bAll = (aFields.GetLength() == 0);
+
+ if (bAll && bEmpty)
+ {
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+ CJS_Runtime* pRuntime = pContext->GetJSRuntime();
+ ASSERT(pRuntime != NULL);
+
+
+ if (pPDFInterForm->CheckRequiredFields())
+ {
+ pRuntime->BeginBlock();
+ pInterForm->SubmitForm(strURL, FALSE);
+ pRuntime->EndBlock();
+ }
+
+ return TRUE;
+ }
+ else
+ {
+ CFX_PtrArray fieldObjects;
+
+ for (int i=0,sz=aFields.GetLength(); i<sz; i++)
+ {
+ CJS_Value valName(isolate);
+ aFields.GetElement(i, valName);
+ CFX_WideString sName = valName.operator CFX_WideString();
+
+ CPDF_InterForm* pPDFForm = pInterForm->GetInterForm();
+ ASSERT(pPDFForm != NULL);
+
+ for (int j=0, jsz=pPDFForm->CountFields(sName); j<jsz; j++)
+ {
+ CPDF_FormField* pField = pPDFForm->GetField(j, sName);
+ if (!bEmpty && pField->GetValue().IsEmpty())
+ continue;
+
+ fieldObjects.Add(pField);
+ }
+ }
+
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+ CJS_Runtime* pRuntime = pContext->GetJSRuntime();
+ ASSERT(pRuntime != NULL);
+
+
+ if (pPDFInterForm->CheckRequiredFields(&fieldObjects, TRUE))
+ {
+ pRuntime->BeginBlock();
+ pInterForm->SubmitFields(strURL, fieldObjects, TRUE, !bFDF);
+ pRuntime->EndBlock();
+ }
+
+ return TRUE;
+ }
+
+}
+
+//////////////////////////////////////////////////////////////////////////////////////////////
+
+void Document::AttachDoc(CPDFSDK_Document *pDoc)
+{
+ m_pDocument = pDoc;
+}
+
+CPDFSDK_Document * Document::GetReaderDoc()
+{
+ return m_pDocument;
+}
+
+FX_BOOL Document::ExtractFileName(CPDFSDK_Document *pDoc,CFX_ByteString &strFileName)
+{
+ return FALSE;
+}
+
+FX_BOOL Document::ExtractFolderName(CPDFSDK_Document *pDoc,CFX_ByteString &strFolderName)
+{
+ return FALSE;
+}
+
+FX_BOOL Document::bookmarkRoot(OBJ_PROP_PARAMS)
+{
+ return TRUE;
+}
+
+FX_BOOL Document::mailDoc(OBJ_METHOD_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ FX_BOOL bUI = TRUE;
+ CFX_WideString cTo = L"";
+ CFX_WideString cCc = L"";
+ CFX_WideString cBcc = L"";
+ CFX_WideString cSubject = L"";
+ CFX_WideString cMsg = L"";
+
+
+ bUI = params.size()>=1?static_cast<FX_BOOL>(params[0]):TRUE;
+ cTo = params.size()>=2?(const wchar_t*)params[1].operator CFX_WideString():L"";
+ cCc = params.size()>=3?(const wchar_t*)params[2].operator CFX_WideString():L"";
+ cBcc = params.size()>=4?(const wchar_t*)params[3].operator CFX_WideString():L"";
+ cSubject = params.size()>=5?(const wchar_t*)params[4].operator CFX_WideString():L"";
+ cMsg = params.size()>=6?(const wchar_t*)params[5].operator CFX_WideString():L"";
+
+ v8::Isolate* isolate = GetIsolate(cc);
+
+ if(params.size()>=1 && params[0].GetType() == VT_object)
+ {
+ JSObject pObj = (JSObject )params[0];
+
+ v8::Handle<v8::Value> pValue = JS_GetObjectElement(isolate,pObj, L"bUI");
+ bUI = (int)CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue));
+
+ pValue = JS_GetObjectElement(isolate,pObj, L"cTo");
+ cTo = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).operator CFX_WideString();
+
+ pValue = JS_GetObjectElement(isolate,pObj, L"cCc");
+ cCc = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).operator CFX_WideString();
+
+ pValue = JS_GetObjectElement(isolate,pObj, L"cBcc");
+ cBcc = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).operator CFX_WideString();
+
+ pValue = JS_GetObjectElement(isolate,pObj, L"cSubject");
+ cSubject = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).operator CFX_WideString();
+
+ pValue = JS_GetObjectElement(isolate,pObj, L"cMsg");
+ cMsg = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).operator CFX_WideString();
+
+ }
+
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+ CJS_Runtime* pRuntime = pContext->GetJSRuntime();
+ ASSERT(pRuntime != NULL);
+
+ pRuntime->BeginBlock();
+ CPDFDoc_Environment* pEnv = pRuntime->GetReaderApp();
+ pEnv->JS_docmailForm(NULL, 0, bUI, (FX_LPCWSTR)cTo, (FX_LPCWSTR)cSubject, (FX_LPCWSTR)cCc, (FX_LPCWSTR)cBcc, (FX_LPCWSTR)cMsg);
+ pRuntime->EndBlock();
+
+ return TRUE;
+}
+
+FX_BOOL Document::author(OBJ_PROP_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo();
+ if (!pDictionary)return FALSE;
+
+ if (vp.IsGetting())
+ {
+ vp << pDictionary->GetUnicodeText("Author");
+ return TRUE;
+ }
+ else
+ {
+ if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY)) return FALSE;
+
+ CFX_WideString csAuthor;
+ vp >> csAuthor;
+ pDictionary->SetAtString("Author", PDF_EncodeText(csAuthor));
+ m_pDocument->SetChangeMark();
+ return TRUE;
+ }
+}
+
+FX_BOOL Document::info(OBJ_PROP_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo();
+ if (!pDictionary)return FALSE;
+
+ CFX_WideString cwAuthor = pDictionary->GetUnicodeText("Author");
+ CFX_WideString cwTitle = pDictionary->GetUnicodeText("Title");
+ CFX_WideString cwSubject = pDictionary->GetUnicodeText("Subject");
+ CFX_WideString cwKeywords = pDictionary->GetUnicodeText("Keywords");
+ CFX_WideString cwCreator = pDictionary->GetUnicodeText("Creator");
+ CFX_WideString cwProducer = pDictionary->GetUnicodeText("Producer");
+ CFX_WideString cwCreationDate = pDictionary->GetUnicodeText("CreationDate");
+ CFX_WideString cwModDate = pDictionary->GetUnicodeText("ModDate");
+ CFX_WideString cwTrapped = pDictionary->GetUnicodeText("Trapped");
+
+ v8::Isolate* isolate = GetIsolate(cc);
+ if (!vp.IsSetting())
+ {
+ CJS_Context* pContext = (CJS_Context *)cc;
+ CJS_Runtime* pRuntime = pContext->GetJSRuntime();
+
+ JSFXObject pObj = JS_NewFxDynamicObj(*pRuntime, pContext, -1);
+
+ JS_PutObjectString(isolate,pObj, L"Author", cwAuthor);
+ JS_PutObjectString(isolate,pObj, L"Title", cwTitle);
+ JS_PutObjectString(isolate,pObj, L"Subject", cwSubject);
+ JS_PutObjectString(isolate,pObj, L"Keywords", cwKeywords);
+ JS_PutObjectString(isolate,pObj, L"Creator", cwCreator);
+ JS_PutObjectString(isolate,pObj, L"Producer", cwProducer);
+ JS_PutObjectString(isolate,pObj, L"CreationDate", cwCreationDate);
+ JS_PutObjectString(isolate,pObj, L"ModDate", cwModDate);
+ JS_PutObjectString(isolate,pObj, L"Trapped", cwTrapped);
+
+// It's to be compatible to non-standard info dictionary.
+ FX_POSITION pos = pDictionary->GetStartPos();
+ while(pos)
+ {
+ CFX_ByteString bsKey;
+ CPDF_Object* pValueObj = pDictionary->GetNextElement(pos, bsKey);
+ CFX_WideString wsKey = CFX_WideString::FromUTF8(bsKey);
+ if((pValueObj->GetType()==PDFOBJ_STRING) || (pValueObj->GetType()==PDFOBJ_NAME) )
+ JS_PutObjectString(isolate,pObj, wsKey, pValueObj->GetUnicodeText());
+ if(pValueObj->GetType()==PDFOBJ_NUMBER)
+ JS_PutObjectNumber(isolate,pObj, wsKey, (float)pValueObj->GetNumber());
+ if(pValueObj->GetType()==PDFOBJ_BOOLEAN)
+ JS_PutObjectBoolean(isolate,pObj, wsKey, (bool)pValueObj->GetInteger());
+ }
+
+ vp << pObj;
+ return TRUE;
+ }
+ else
+ {
+ return TRUE;
+ }
+}
+
+FX_BOOL Document::creationDate(OBJ_PROP_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo();
+ if (!pDictionary)return FALSE;
+
+ if (vp.IsGetting())
+ {
+ vp << pDictionary->GetUnicodeText("CreationDate");
+ return TRUE;
+ }
+ else
+ {
+ if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY)) return FALSE;
+
+ CFX_WideString csCreationDate;
+ vp >> csCreationDate;
+ pDictionary->SetAtString("CreationDate", PDF_EncodeText(csCreationDate));
+ m_pDocument->SetChangeMark();
+
+ return TRUE;
+ }
+}
+
+FX_BOOL Document::creator(OBJ_PROP_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo();
+ if (!pDictionary)return FALSE;
+
+ if (vp.IsGetting())
+ {
+ vp << pDictionary->GetUnicodeText("Creator");
+ return TRUE;
+ }
+ else
+ {
+ if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY)) return FALSE;
+
+ CFX_WideString csCreator;
+ vp >> csCreator;
+ pDictionary->SetAtString("Creator", PDF_EncodeText(csCreator));
+ m_pDocument->SetChangeMark();
+ return TRUE;
+ }
+}
+
+FX_BOOL Document::delay(OBJ_PROP_PARAMS)
+{
+ if (vp.IsGetting())
+ {
+ vp << m_bDelay;
+ return TRUE;
+ }
+ else
+ {
+ ASSERT(m_pDocument != NULL);
+
+ if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY)) return FALSE;
+
+ bool b;
+ vp >> b;
+
+ m_bDelay = b;
+
+ if (m_bDelay)
+ {
+ for (int i=0,sz=m_DelayData.GetSize(); i<sz; i++)
+ delete m_DelayData.GetAt(i);
+
+ m_DelayData.RemoveAll();
+ }
+ else
+ {
+ for (int i=0,sz=m_DelayData.GetSize(); i<sz; i++)
+ {
+ if (CJS_DelayData* pData = m_DelayData.GetAt(i))
+ {
+ Field::DoDelay(m_pDocument, pData);
+ delete m_DelayData.GetAt(i);
+ }
+ }
+ m_DelayData.RemoveAll();
+ }
+
+ return TRUE;
+ }
+}
+
+FX_BOOL Document::keywords(OBJ_PROP_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo();
+ if (!pDictionary)return FALSE;
+
+ if (vp.IsGetting())
+ {
+ vp << pDictionary->GetUnicodeText("Keywords");
+ return TRUE;
+ }
+ else
+ {
+ if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY)) return FALSE;
+
+ CFX_WideString csKeywords;
+ vp >> csKeywords;
+ pDictionary->SetAtString("Keywords", PDF_EncodeText(csKeywords));
+ m_pDocument->SetChangeMark();
+ return TRUE;
+ }
+}
+
+FX_BOOL Document::modDate(OBJ_PROP_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo();
+ if (!pDictionary)return FALSE;
+
+ if (vp.IsGetting())
+ {
+ vp << pDictionary->GetUnicodeText("ModDate");
+ return TRUE;
+ }
+ else
+ {
+ if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY)) return FALSE;
+
+ CFX_WideString csmodDate;
+ vp >> csmodDate;
+ pDictionary->SetAtString("ModDate", PDF_EncodeText(csmodDate));
+ m_pDocument->SetChangeMark();
+ return TRUE;
+ }
+}
+
+FX_BOOL Document::producer(OBJ_PROP_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo();
+ if (!pDictionary)return FALSE;
+
+ if (vp.IsGetting())
+ {
+ vp << pDictionary->GetUnicodeText("Producer");
+ return TRUE;
+ }
+ else
+ {
+ if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY)) return FALSE;
+
+ CFX_WideString csproducer;
+ vp >> csproducer;
+ pDictionary->SetAtString("Producer", PDF_EncodeText(csproducer));
+ m_pDocument->SetChangeMark();
+ return TRUE;
+ }
+}
+
+FX_BOOL Document::subject(OBJ_PROP_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo();
+ if (!pDictionary)return FALSE;
+
+ if (vp.IsGetting())
+ {
+ vp << pDictionary->GetUnicodeText("Subject");
+ return TRUE;
+ }
+ else
+ {
+ if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY)) return FALSE;
+
+ CFX_WideString cssubject;
+ vp >> cssubject;
+ pDictionary->SetAtString("Subject", PDF_EncodeText(cssubject));
+ m_pDocument->SetChangeMark();
+ return TRUE;
+ }
+}
+
+FX_BOOL Document::title(OBJ_PROP_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ if (m_pDocument == NULL || m_pDocument->GetDocument() == NULL)
+ return FALSE;
+
+ CPDF_Dictionary* pDictionary = m_pDocument->GetDocument()->GetInfo();
+ if (!pDictionary)return FALSE;
+
+ if (vp.IsGetting())
+ {
+ vp << pDictionary->GetUnicodeText("Title");
+ return TRUE;
+ }
+ else
+ {
+ if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY)) return FALSE;
+
+ CFX_WideString cstitle;
+ vp >> cstitle;
+ pDictionary->SetAtString("Title", PDF_EncodeText(cstitle));
+ m_pDocument->SetChangeMark();
+ return TRUE;
+ }
+}
+
+FX_BOOL Document::numPages(OBJ_PROP_PARAMS)
+{
+ if (vp.IsGetting())
+ {
+ ASSERT(m_pDocument != NULL);
+ vp << m_pDocument->GetPageCount();
+ return TRUE;
+ }
+ else
+ {
+ return FALSE;
+ }
+}
+
+FX_BOOL Document::external(OBJ_PROP_PARAMS)
+{
+ //In Chrome case,should always return true.
+ vp << TRUE;
+ return TRUE;
+}
+
+FX_BOOL Document::filesize(OBJ_PROP_PARAMS)
+{
+ if (!vp.IsGetting())return FALSE;
+
+ ASSERT(m_pDocument != NULL);
+
+// CFile file(m_pDocument->GetPath(), CFile::modeRead | CFile::typeBinary | CFile::shareDenyNone);
+// vp << (double)file.GetLength();
+// file.Close();
+
+ if ( m_pDocument->GetPath().IsEmpty() == FALSE)
+ {
+ CFX_ByteString bsStr = CFX_ByteString::FromUnicode( m_pDocument->GetPath() );
+ FILE * pFile = NULL;
+ pFile = fopen( bsStr.GetBuffer( bsStr.GetLength() ), "rb" );
+ if ( pFile )
+ {
+ fseek( pFile, 0, SEEK_END );
+ long lSize = ftell( pFile );
+ fclose( pFile );
+ pFile = NULL;
+
+ vp << (FX_INT32)(lSize);
+ return TRUE;
+ }
+ }
+
+ vp << 0;
+ return TRUE;
+}
+
+FX_BOOL Document::mouseX(OBJ_PROP_PARAMS)
+{
+ return TRUE;
+}
+
+FX_BOOL Document::mouseY(OBJ_PROP_PARAMS)
+{
+ return TRUE;
+}
+
+FX_BOOL Document::baseURL(OBJ_PROP_PARAMS)
+{
+ if (vp.IsGetting())
+ {
+ vp << m_cwBaseURL;
+ return TRUE;
+ }
+ else
+ {
+ vp >> m_cwBaseURL;
+ return TRUE;
+ }
+}
+
+FX_BOOL Document::calculate(OBJ_PROP_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInterForm();
+ ASSERT(pInterForm != NULL);
+
+ if (vp.IsGetting())
+ {
+ if (pInterForm->IsCalculateEnabled())
+ vp << true;
+ else
+ vp << false;
+ }
+ else
+ {
+ bool bCalculate;
+ vp >> bCalculate;
+
+ pInterForm->EnableCalculate(bCalculate);
+ }
+
+ return TRUE;
+}
+
+FX_BOOL Document::documentFileName(OBJ_PROP_PARAMS)
+{
+ if (!vp.IsGetting())
+ return FALSE;
+
+ CFX_WideString wsFilePath = m_pDocument->GetPath();
+
+ FX_INT32 i = wsFilePath.GetLength() - 1;
+ for ( ; i >= 0; i-- )
+ {
+ if ( wsFilePath.GetAt( i ) == L'\\' || wsFilePath.GetAt( i ) == L'/' )
+ break;
+ }
+ if ( i >= 0 && i < wsFilePath.GetLength() - 1 )
+ {
+ vp << ( wsFilePath.GetBuffer( wsFilePath.GetLength() ) + i + 1 );
+ }else{
+ vp << L"";
+ }
+ return TRUE;
+}
+
+CFX_WideString Document::ReversalStr(CFX_WideString cbFrom)
+{
+ wchar_t* pFrom = NULL;
+ int iLenth = cbFrom.GetLength();
+ wchar_t* pResult = (wchar_t*)malloc((iLenth+1) * sizeof(wchar_t));
+ memset(pResult, 0, (iLenth+1));
+ pFrom = (wchar_t*)cbFrom.GetBuffer(iLenth);
+
+ for (int i = 0; i < iLenth; i++)
+ {
+ pResult[i] = *(pFrom + iLenth - i - 1);
+ }
+
+ cbFrom.ReleaseBuffer();
+ CFX_WideString cbRet = CFX_WideString(pResult);
+ free(pResult);
+ pResult = NULL;
+ return cbRet;
+}
+
+CFX_WideString Document::CutString(CFX_WideString cbFrom)
+{
+ wchar_t* pFrom = NULL;
+ int iLenth = cbFrom.GetLength();
+ wchar_t* pResult = (wchar_t*)malloc((iLenth+1) * sizeof(wchar_t));
+ memset(pResult, 0, (iLenth+1));
+ pFrom = (wchar_t*)cbFrom.GetBuffer(iLenth);
+
+ for (int i = 0; i < iLenth; i++)
+ {
+ if (pFrom[i] == L'\\' || pFrom[i] == L'/')
+ break;
+ pResult[i] = pFrom[i];
+ }
+
+ cbFrom.ReleaseBuffer();
+ CFX_WideString cbRet = CFX_WideString(pResult);
+ free(pResult);
+ pResult = NULL;
+ return cbRet;
+}
+
+FX_BOOL Document::path(OBJ_PROP_PARAMS)
+{
+ if (!vp.IsGetting()) return FALSE;
+
+ vp << app::SysPathToPDFPath(m_pDocument->GetPath());
+
+ return TRUE;
+}
+
+FX_BOOL Document::pageWindowRect(OBJ_PROP_PARAMS)
+{
+ return TRUE;
+}
+
+FX_BOOL Document::layout(OBJ_PROP_PARAMS)
+{
+ return TRUE;
+}
+
+FX_BOOL Document::addLink(OBJ_METHOD_PARAMS)
+{
+ return TRUE;
+}
+
+FX_BOOL Document::closeDoc(OBJ_METHOD_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+
+
+
+
+ return TRUE;
+}
+
+FX_BOOL Document::getPageBox(OBJ_METHOD_PARAMS)
+{
+ return TRUE;
+}
+
+
+FX_BOOL Document::getAnnot(OBJ_METHOD_PARAMS)
+{
+ return TRUE;
+}
+
+FX_BOOL Document::getAnnots(OBJ_METHOD_PARAMS)
+{
+ vRet.SetNull();
+ return TRUE;
+}
+
+FX_BOOL Document::getAnnot3D(OBJ_METHOD_PARAMS)
+{
+ vRet.SetNull();
+ return TRUE;
+}
+
+FX_BOOL Document::getAnnots3D(OBJ_METHOD_PARAMS)
+{
+ vRet = VT_undefined;
+ return TRUE;
+}
+
+FX_BOOL Document::getOCGs(OBJ_METHOD_PARAMS)
+{
+ return TRUE;
+}
+
+FX_BOOL Document::getLinks(OBJ_METHOD_PARAMS)
+{
+ return TRUE;
+}
+
+bool Document::IsEnclosedInRect(CFX_FloatRect rect, CFX_FloatRect LinkRect)
+{
+ if (rect.left <= LinkRect.left
+ && rect.top <= LinkRect.top
+ && rect.right >= LinkRect.right
+ && rect.bottom >= LinkRect.bottom)
+ return true;
+ else
+ return false;
+}
+
+void IconTree::InsertIconElement(IconElement* pNewIcon)
+{
+ if (!pNewIcon)return;
+
+ if (m_pHead == NULL && m_pEnd == NULL)
+ {
+ m_pHead = m_pEnd = pNewIcon;
+ m_iLength++;
+ }
+ else
+ {
+ m_pEnd->NextIcon = pNewIcon;
+ m_pEnd = pNewIcon;
+ m_iLength++;
+ }
+}
+
+void IconTree::DeleteIconTree()
+{
+ if (!m_pHead || !m_pEnd)return;
+
+ IconElement* pTemp = NULL;
+ while(m_pEnd != m_pHead)
+ {
+ pTemp = m_pHead;
+ m_pHead = m_pHead->NextIcon;
+ delete pTemp;
+ }
+
+ delete m_pEnd;
+ m_pHead = NULL;
+ m_pEnd = NULL;
+}
+
+int IconTree::GetLength()
+{
+ return m_iLength;
+}
+
+IconElement* IconTree::operator [](int iIndex)
+{
+ if (iIndex >= 0 && iIndex <= m_iLength)
+ {
+ IconElement* pTemp = m_pHead;
+ for (int i = 0; i < iIndex; i++)
+ {
+ pTemp = pTemp->NextIcon;
+ }
+ return pTemp;
+ }
+ else
+ return NULL;
+}
+
+void IconTree::DeleteIconElement(CFX_WideString swIconName)
+{
+ IconElement* pTemp = m_pHead;
+ int iLoopCount = m_iLength;
+ for (int i = 0; i < iLoopCount - 1; i++)
+ {
+ if (pTemp == m_pEnd)
+ break;
+
+ if (m_pHead->IconName == swIconName)
+ {
+ m_pHead = m_pHead->NextIcon;
+ delete pTemp;
+ m_iLength--;
+ pTemp = m_pHead;
+ }
+ if (pTemp->NextIcon->IconName == swIconName)
+ {
+ if (pTemp->NextIcon == m_pEnd)
+ {
+ m_pEnd = pTemp;
+ delete pTemp->NextIcon;
+ m_iLength--;
+ pTemp->NextIcon = NULL;
+ }
+ else
+ {
+ IconElement* pElement = pTemp->NextIcon;
+ pTemp->NextIcon = pTemp->NextIcon->NextIcon;
+ delete pElement;
+ m_iLength--;
+ pElement = NULL;
+ }
+
+ continue;
+ }
+
+ pTemp = pTemp->NextIcon;
+ }
+}
+
+FX_BOOL Document::addIcon(OBJ_METHOD_PARAMS)
+{
+ if (params.size() != 2)return FALSE;
+
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+ CJS_Runtime* pRuntime = pContext->GetJSRuntime();
+ ASSERT(pRuntime != NULL);
+
+ CFX_WideString swIconName = params[0].operator CFX_WideString();
+
+ JSFXObject pJSIcon = (JSFXObject)params[1];
+ if (JS_GetObjDefnID(pJSIcon) != JS_GetObjDefnID(*pRuntime, L"Icon")) return FALSE;
+
+ CJS_EmbedObj* pEmbedObj = ((CJS_Object*)params[1])->GetEmbedObject();
+ if (!pEmbedObj)return FALSE;
+ Icon* pIcon = (Icon*)pEmbedObj;
+
+ if (!m_pIconTree)
+ m_pIconTree = new IconTree();
+
+ IconElement* pNewIcon = new IconElement();
+ pNewIcon->IconName = swIconName;
+ pNewIcon->NextIcon = NULL;
+ pNewIcon->IconStream = pIcon;
+ m_pIconTree->InsertIconElement(pNewIcon);
+ return TRUE;
+}
+
+FX_BOOL Document::icons(OBJ_PROP_PARAMS)
+{
+ if (vp.IsSetting())
+ return FALSE;
+
+ if (!m_pIconTree)
+ {
+ vp.SetNull();
+ return TRUE;
+ }
+
+ CJS_Array Icons(m_isolate);
+ IconElement* pIconElement = NULL;
+ int iIconTreeLength = m_pIconTree->GetLength();
+
+ CJS_Context* pContext = (CJS_Context *)cc;
+ CJS_Runtime* pRuntime = pContext->GetJSRuntime();
+
+ for (int i = 0; i < iIconTreeLength; i++)
+ {
+ pIconElement = (*m_pIconTree)[i];
+
+ JSFXObject pObj = JS_NewFxDynamicObj(*pRuntime, pContext, JS_GetObjDefnID(*pRuntime, L"Icon"));
+ if (pObj.IsEmpty()) return FALSE;
+
+ CJS_Icon * pJS_Icon = (CJS_Icon *)JS_GetPrivate(pObj);
+ if (!pJS_Icon) return FALSE;
+
+ Icon* pIcon = (Icon*)pJS_Icon->GetEmbedObject();
+ if (!pIcon)return FALSE;
+
+ pIcon->SetStream(pIconElement->IconStream->GetStream());
+ pIcon->SetIconName(pIconElement->IconName);
+ Icons.SetElement(i, CJS_Value(m_isolate,pJS_Icon));
+ }
+
+ vp << Icons;
+ return TRUE;
+}
+
+FX_BOOL Document::getIcon(OBJ_METHOD_PARAMS)
+{
+ if (params.size() != 1)return FALSE;
+ if(!m_pIconTree)
+ return FALSE;
+ CFX_WideString swIconName = params[0].operator CFX_WideString();
+ int iIconCounts = m_pIconTree->GetLength();
+
+ CJS_Context* pContext = (CJS_Context *)cc;
+ CJS_Runtime* pRuntime = pContext->GetJSRuntime();
+
+ for (int i = 0; i < iIconCounts; i++)
+ {
+ if ((*m_pIconTree)[i]->IconName == swIconName)
+ {
+ Icon* pRetIcon = (*m_pIconTree)[i]->IconStream;
+
+ JSFXObject pObj = JS_NewFxDynamicObj(*pRuntime, pContext, JS_GetObjDefnID(*pRuntime, L"Icon"));
+ if (pObj.IsEmpty()) return FALSE;
+
+ CJS_Icon * pJS_Icon = (CJS_Icon *)JS_GetPrivate(pObj);
+ if (!pJS_Icon) return FALSE;
+
+ Icon* pIcon = (Icon*)pJS_Icon->GetEmbedObject();
+ if (!pIcon)return FALSE;
+
+ pIcon->SetIconName(swIconName);
+ pIcon->SetStream(pRetIcon->GetStream());
+ vRet = pJS_Icon;
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
+FX_BOOL Document::removeIcon(OBJ_METHOD_PARAMS)
+{
+ if (params.size() != 1)return FALSE;
+ if(!m_pIconTree)
+ return FALSE;
+ CFX_WideString swIconName = params[0].operator CFX_WideString();
+#ifndef FOXIT_CHROME_BUILD
+ m_pIconTree->DeleteIconElement(swIconName);
+#endif
+ return TRUE;
+}
+
+FX_BOOL Document::createDataObject(OBJ_METHOD_PARAMS)
+{
+ if (IsSafeMode(cc)) return TRUE;
+ ASSERT(m_pDocument != NULL);
+
+ CFX_WideString swName = L"";
+ CFX_ByteString sbName = "";
+ CFX_WideString swValue = L"";
+ CFX_WideString swMIMEType = L"";
+ CFX_WideString swCryptFilter = L"";
+ CFX_ByteString sbFileValue = "";
+
+ int iParamSize = params.size();
+ for (int i = 0; i < iParamSize; i++)
+ {
+ if (i == 0)
+ swName = params[0];
+ if (i == 1)
+ swValue = params[1];
+ if (i == 2)
+ swMIMEType = params[2];
+ if (i == 3)
+ swCryptFilter = params[4];
+ }
+
+ FILE* pFile = NULL;
+
+ //CFileStatus fileStatus;
+ const int BUFSIZE = 17;
+ FX_BYTE buf[BUFSIZE];
+ FX_BYTE *pBuffer = NULL;
+ char* pBuf = NULL;
+ int nFileSize = 0;
+ sbFileValue = CFX_ByteString::FromUnicode(swValue);
+ sbName = CFX_ByteString::FromUnicode(swName);
+ int iBufLength = sbFileValue.GetLength();
+ pBuf = (char*)malloc(sizeof(char) * iBufLength);
+ pBuf = sbFileValue.GetBuffer(iBufLength);
+
+ if ( NULL == (pFile = FXSYS_fopen( sbName.GetBuffer(sbName.GetLength()), "wb+" )) )
+ {
+ return FALSE;
+ }
+
+ fwrite( pBuf, sizeof(char), iBufLength, pFile );
+ fclose( pFile );
+ pFile = NULL;
+
+ pFile = FXSYS_fopen( sbName.GetBuffer(sbName.GetLength()), "rb+" );
+ fseek( pFile, 0, SEEK_END );
+ nFileSize = ftell( pFile );
+
+ pBuffer = new FX_BYTE[nFileSize];
+ fseek( pFile, 0, SEEK_SET );
+ size_t s = fread( pBuffer, sizeof(char), nFileSize, pFile );
+ if(s == 0)
+ {
+ delete[] pBuffer;
+ return FALSE;
+ }
+
+ CRYPT_MD5Generate(pBuffer, nFileSize, buf);
+ buf[BUFSIZE - 1] = 0;
+ CFX_WideString csCheckSum((FX_LPCWSTR)buf, 16);
+ delete[] pBuffer;
+
+ return TRUE;
+}
+
+FX_BOOL Document::media(OBJ_PROP_PARAMS)
+{
+ return TRUE;
+}
+
+FX_BOOL Document::calculateNow(OBJ_METHOD_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ if (!(m_pDocument->GetPermissions(FPDFPERM_MODIFY) ||
+ m_pDocument->GetPermissions(FPDFPERM_ANNOT_FORM) ||
+ m_pDocument->GetPermissions(FPDFPERM_FILL_FORM))) return FALSE;
+
+ CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInterForm();
+ ASSERT(pInterForm != NULL);
+ pInterForm->OnCalculate();
+ return TRUE;
+}
+
+FX_BOOL Document::Collab(OBJ_PROP_PARAMS)
+{
+ return TRUE;
+}
+
+FX_BOOL Document::getPageNthWord(OBJ_METHOD_PARAMS)
+{
+ //if (IsSafeMode(cc)) return TRUE;
+
+ ASSERT(m_pDocument != NULL);
+
+ if (!m_pDocument->GetPermissions(FPDFPERM_EXTRACT_ACCESS)) return FALSE;
+
+ int nPageNo = params.GetSize() > 0 ? (int)params[0] : 0;
+ int nWordNo = params.GetSize() > 1 ? (int)params[1] : 0;
+ bool bStrip = params.GetSize() > 2 ? (bool)params[2] : true;
+
+ CPDF_Document* pDocument = m_pDocument->GetDocument();
+ if (!pDocument) return FALSE;
+
+ if (nPageNo < 0 || nPageNo >= pDocument->GetPageCount())
+ {
+ //sError = JSGetStringFromID(IDS_STRING_JSPARAMERROR);
+ return FALSE;
+ }
+
+ CPDF_Dictionary* pPageDict = pDocument->GetPage(nPageNo);
+ if (!pPageDict) return FALSE;
+
+ CPDF_Page page;
+ page.Load(pDocument, pPageDict);
+ page.StartParse();
+ page.ParseContent();
+
+ FX_POSITION pos = page.GetFirstObjectPosition();
+
+ int nWords = 0;
+
+ CFX_WideString swRet;
+
+ while (pos)
+ {
+ if (CPDF_PageObject* pPageObj = page.GetNextObject(pos))
+ {
+ if (pPageObj->m_Type == PDFPAGE_TEXT)
+ {
+ int nObjWords = CountWords((CPDF_TextObject*)pPageObj);
+
+ if (nWords + nObjWords >= nWordNo)
+ {
+ swRet = GetObjWordStr((CPDF_TextObject*)pPageObj, nWordNo - nWords);
+ break;
+ }
+
+ nWords += nObjWords;
+ }
+ }
+ }
+
+ if (bStrip)
+ {
+ swRet.TrimLeft();
+ swRet.TrimRight();
+ }
+
+ vRet = swRet;
+ return TRUE;
+}
+
+FX_BOOL Document::getPageNthWordQuads(OBJ_METHOD_PARAMS)
+{
+ //if (IsSafeMode(cc)) return TRUE;
+
+ ASSERT(m_pDocument != NULL);
+
+ if (!m_pDocument->GetPermissions(FPDFPERM_EXTRACT_ACCESS)) return FALSE;
+
+ return FALSE;
+}
+
+FX_BOOL Document::getPageNumWords(OBJ_METHOD_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ if (!m_pDocument->GetPermissions(FPDFPERM_EXTRACT_ACCESS)) return FALSE;
+
+ int nPageNo = params.GetSize() > 0 ? (int)params[0] : 0;
+
+ CPDF_Document* pDocument = m_pDocument->GetDocument();
+ ASSERT(pDocument != NULL);
+
+ if (nPageNo < 0 || nPageNo >= pDocument->GetPageCount())
+ {
+ //sError = JSGetStringFromID(IDS_STRING_JSPARAMERROR);
+ return FALSE;
+ }
+
+ CPDF_Dictionary* pPageDict = pDocument->GetPage(nPageNo);
+ if (!pPageDict) return FALSE;
+
+ CPDF_Page page;
+ page.Load(pDocument, pPageDict);
+ page.StartParse();
+ page.ParseContent();
+
+ FX_POSITION pos = page.GetFirstObjectPosition();
+
+ int nWords = 0;
+
+ while (pos)
+ {
+ if (CPDF_PageObject* pPageObj = page.GetNextObject(pos))
+ {
+ if (pPageObj->m_Type == PDFPAGE_TEXT)
+ {
+ CPDF_TextObject* pTextObj = (CPDF_TextObject*)pPageObj;
+ nWords += CountWords(pTextObj);
+ }
+ }
+ }
+
+ vRet = nWords;
+
+ return TRUE;
+}
+
+FX_BOOL Document::getPrintParams(OBJ_METHOD_PARAMS)
+{
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+ CJS_Runtime* pRuntime = pContext->GetJSRuntime();
+ ASSERT(pRuntime != NULL);
+ JSFXObject pRetObj = JS_NewFxDynamicObj(*pRuntime, pContext, JS_GetObjDefnID(*pRuntime, L"PrintParamsObj"));
+ //not implemented yet.
+ vRet = pRetObj;
+
+ return TRUE;
+}
+
+#define ISLATINWORD(u) (u != 0x20 && u <= 0x28FF)
+
+int Document::CountWords(CPDF_TextObject* pTextObj)
+{
+ if (!pTextObj) return 0;
+
+ int nWords = 0;
+
+ CPDF_Font* pFont = pTextObj->GetFont();
+ if (!pFont) return 0;
+
+ FX_BOOL bIsLatin = FALSE;
+
+ for (int i=0, sz=pTextObj->CountChars(); i<sz; i++)
+ {
+ FX_DWORD charcode = -1;
+ FX_FLOAT kerning;
+
+ pTextObj->GetCharInfo(i, charcode, kerning);
+ CFX_WideString swUnicode = pFont->UnicodeFromCharCode(charcode);
+
+ FX_WORD unicode = 0;
+ if (swUnicode.GetLength() > 0)
+ unicode = swUnicode[0];
+
+ if (ISLATINWORD(unicode) && bIsLatin)
+ continue;
+
+ bIsLatin = ISLATINWORD(unicode);
+ if (unicode != 0x20)
+ nWords++;
+ }
+
+ return nWords;
+}
+
+CFX_WideString Document::GetObjWordStr(CPDF_TextObject* pTextObj, int nWordIndex)
+{
+ ASSERT(pTextObj != NULL);
+
+ CFX_WideString swRet;
+
+ CPDF_Font* pFont = pTextObj->GetFont();
+ if (!pFont) return L"";
+
+ int nWords = 0;
+ FX_BOOL bIsLatin = FALSE;
+
+ for (int i=0, sz=pTextObj->CountChars(); i<sz; i++)
+ {
+ FX_DWORD charcode = -1;
+ FX_FLOAT kerning;
+
+ pTextObj->GetCharInfo(i, charcode, kerning);
+ CFX_WideString swUnicode = pFont->UnicodeFromCharCode(charcode);
+
+ FX_WORD unicode = 0;
+ if (swUnicode.GetLength() > 0)
+ unicode = swUnicode[0];
+
+ if (ISLATINWORD(unicode) && bIsLatin)
+ {
+ }
+ else
+ {
+ bIsLatin = ISLATINWORD(unicode);
+ if (unicode != 0x20)
+ nWords++;
+ }
+
+ if (nWords-1 == nWordIndex)
+ swRet += unicode;
+ }
+
+ return swRet;
+}
+
+FX_BOOL Document::zoom(OBJ_PROP_PARAMS)
+{
+
+ return TRUE;
+}
+
+/**
+(none, NoVary)
+(fitP, FitPage)
+(fitW, FitWidth)
+(fitH, FitHeight)
+(fitV, FitVisibleWidth)
+(pref, Preferred)
+(refW, ReflowWidth)
+*/
+
+FX_BOOL Document::zoomType(OBJ_PROP_PARAMS)
+{
+ return TRUE;
+}
+
+FX_BOOL Document::deletePages(OBJ_METHOD_PARAMS)
+{
+
+
+
+
+
+
+ v8::Isolate* isolate = GetIsolate(cc);
+// if (pEnv->GetAppName().Compare(PHANTOM) != 0)
+// return TRUE;
+
+ //if (IsSafeMode(cc)) return TRUE;
+
+ ASSERT(m_pDocument != NULL);
+
+ if (!(m_pDocument->GetPermissions(FPDFPERM_MODIFY) ||
+ m_pDocument->GetPermissions(FPDFPERM_ASSEMBLE))) return FALSE;
+
+ int iSize = params.size();
+
+ int nStart = 0;
+ int nEnd = 0;
+
+ if (iSize < 1)
+ {
+ }
+ else if (iSize == 1)
+ {
+ if (params[0].GetType() == VT_object)
+ {
+ JSObject pObj = (JSObject )params[0];
+ v8::Handle<v8::Value> pValue = JS_GetObjectElement(isolate,pObj, L"nStart");
+ nStart = (int)CJS_Value(m_isolate,pValue,GET_VALUE_TYPE(pValue));
+
+ pValue = JS_GetObjectElement(isolate,pObj, L"nEnd");
+ nEnd = (int)CJS_Value(m_isolate,pValue,GET_VALUE_TYPE(pValue));
+ }
+ else
+ {
+ nStart = (int)params[0];
+ }
+ }
+ else
+ {
+ nStart = (int)params[0];
+ nEnd = (int)params[1];
+ }
+
+ int nTotal = m_pDocument->GetPageCount();
+
+ if (nStart < 0) nStart = 0;
+ if (nStart >= nTotal) nStart = nTotal - 1;
+
+ if (nEnd < 0) nEnd = 0;
+ if (nEnd >= nTotal) nEnd = nTotal - 1;
+
+ if (nEnd < nStart) nEnd = nStart;
+
+
+
+#ifndef FOXIT_CHROME_BUILD
+ return m_pDocument->DeletePages(nStart, nEnd - nStart + 1);
+#else
+ return TRUE;
+#endif
+}
+
+FX_BOOL Document::extractPages(OBJ_METHOD_PARAMS)
+{
+
+
+
+
+
+
+ v8::Isolate* isolate = GetIsolate(cc);
+
+ if (IsSafeMode(cc)) return TRUE;
+
+ ASSERT(m_pDocument != NULL);
+
+ if (!m_pDocument->GetPermissions(FPDFPERM_EXTRACT)) return FALSE;
+
+ int iSize = params.size();
+
+ int nTotal = m_pDocument->GetPageCount();
+ int nStart = 0;
+ int nEnd = nTotal - 1;
+
+ CFX_WideString swFilePath;
+
+ if (iSize < 1)
+ {
+ }
+ else if (iSize == 1)
+ {
+ if (params[0].GetType() == VT_object)
+ {
+ JSObject pObj = (JSObject )params[0];
+ v8::Handle<v8::Value> pValue = JS_GetObjectElement(isolate,pObj, L"nStart");
+ nStart = (int)CJS_Value(m_isolate,pValue,GET_VALUE_TYPE(pValue));
+
+ pValue = JS_GetObjectElement(isolate,pObj, L"nEnd");
+ nEnd = (int)CJS_Value(m_isolate,pValue,GET_VALUE_TYPE(pValue));
+
+ pValue = JS_GetObjectElement(isolate,pObj, L"cPath");
+ swFilePath = CJS_Value(m_isolate,pValue,GET_VALUE_TYPE(pValue)).operator CFX_WideString();
+ }
+ else
+ {
+ nStart = (int)params[0];
+ }
+ }
+ else if (iSize == 2)
+ {
+ nStart = (int)params[0];
+ nEnd = (int)params[1];
+ }
+ else
+ {
+ nStart = (int)params[0];
+ nEnd = (int)params[1];
+ swFilePath = params[2].operator CFX_WideString();
+ }
+
+ if (nEnd < nStart)
+ nEnd = nStart;
+
+ CPDF_Document *pNewDoc = new CPDF_Document;
+ pNewDoc->CreateNewDoc();
+
+ CFX_WordArray array;
+ for (int i=nStart; i<=nEnd; i++)
+ array.Add(i);
+
+// m_pDocument->ExtractPages(array, pNewDoc);
+
+ if (swFilePath.IsEmpty())
+ {
+
+ }
+ else
+ {
+ swFilePath = app::PDFPathToSysPath(swFilePath);
+ CPDF_Creator PDFCreater(pNewDoc);
+ PDFCreater.Create(swFilePath);
+ delete pNewDoc;
+// pEnv->OpenDocument(swFilePath);
+ vRet.SetNull();
+ }
+
+ return TRUE;
+}
+
+FX_BOOL Document::insertPages(OBJ_METHOD_PARAMS)
+{
+
+
+
+
+
+
+ v8::Isolate* isolate = GetIsolate(cc);
+
+ if (IsSafeMode(cc)) return TRUE;
+
+ ASSERT(m_pDocument != NULL);
+
+ if (!(m_pDocument->GetPermissions(FPDFPERM_MODIFY) ||
+ m_pDocument->GetPermissions(FPDFPERM_ASSEMBLE))) return FALSE;
+
+ int iSize = params.size();
+
+ int nStart = 0;
+ int nEnd = 0;
+ int nPage = 0;
+
+ CFX_WideString swFilePath;
+
+ if (iSize < 1)
+ {
+ }
+ else if (iSize == 1)
+ {
+ if (params[0].GetType() == VT_object)
+ {
+ JSObject pObj = (JSObject )params[0];
+
+ v8::Handle<v8::Value> pValue = JS_GetObjectElement(isolate,pObj, L"nPage");
+ nPage = (int)CJS_Value(m_isolate,pValue,GET_VALUE_TYPE(pValue));
+
+ pValue = JS_GetObjectElement(isolate,pObj, L"cPath");
+ swFilePath = CJS_Value(m_isolate,pValue,GET_VALUE_TYPE(pValue)).operator CFX_WideString();
+
+ pValue = JS_GetObjectElement(isolate,pObj, L"nStart");
+ nStart = (int)CJS_Value(m_isolate,pValue,GET_VALUE_TYPE(pValue));
+
+ pValue = JS_GetObjectElement(isolate,pObj, L"nEnd");
+ nEnd = (int)CJS_Value(m_isolate,pValue,GET_VALUE_TYPE(pValue));
+ }
+ else
+ {
+ nPage = (int)params[0];
+ }
+ }
+ else
+ {
+ nPage = (int)params[0];
+
+ if (iSize >= 2)
+ swFilePath = params[1].operator CFX_WideString();
+
+ if (iSize >= 3)
+ nStart = (int)params[2];
+
+ if (iSize >= 4)
+ nEnd = (int)params[3];
+ }
+
+ nPage++;
+
+ if (nPage < 0)
+ nPage = 0;
+
+ if (nPage > m_pDocument->GetPageCount())
+ nPage = m_pDocument->GetPageCount();
+
+ if (swFilePath.IsEmpty()) return FALSE;
+
+ swFilePath = app::PDFPathToSysPath(swFilePath);
+
+ CPDF_Parser pdfParser;
+ pdfParser.StartParse(swFilePath, FALSE);
+ CPDF_Document* pSrcDoc = pdfParser.GetDocument();
+
+ if (!pSrcDoc)
+ {
+ pdfParser.CloseParser();
+ return FALSE;
+ }
+
+ int nTotal = pSrcDoc->GetPageCount();
+
+ if (nStart < 0) nStart = 0;
+ if (nStart >= nTotal) nStart = nTotal - 1;
+
+ if (nEnd < 0) nEnd = 0;
+ if (nEnd >= nTotal) nEnd = nTotal - 1;
+
+ if (nEnd < nStart) nEnd = nStart;
+
+ CFX_WordArray array;
+ for (int i=nStart; i<=nEnd; i++)
+ array.Add(i);
+
+// m_pDocument->InsertPages(nPage, pSrcDoc, array);
+
+ pdfParser.CloseParser();
+
+ return TRUE;
+}
+
+FX_BOOL Document::replacePages(OBJ_METHOD_PARAMS)
+{
+
+
+
+
+
+
+ v8::Isolate* isolate = GetIsolate(cc);
+
+ if (IsSafeMode(cc)) return TRUE;
+
+ ASSERT(m_pDocument != NULL);
+
+ if (!(m_pDocument->GetPermissions(FPDFPERM_MODIFY) ||
+ m_pDocument->GetPermissions(FPDFPERM_ASSEMBLE))) return FALSE;
+
+ int iSize = params.size();
+
+ int nStart = -1;
+ int nEnd = -1;
+ int nPage = 0;
+
+ CFX_WideString swFilePath;
+
+ if (iSize < 1)
+ {
+ }
+ else if (iSize == 1)
+ {
+ if (params[0].GetType() == VT_object)
+ {
+ JSObject pObj = (JSObject )params[0];
+
+ v8::Handle<v8::Value> pValue = JS_GetObjectElement(isolate,pObj, L"nPage");
+ nPage = (int)CJS_Value(m_isolate,pValue,GET_VALUE_TYPE(pValue));
+
+ pValue = JS_GetObjectElement(isolate,pObj, L"cPath");
+ swFilePath = CJS_Value(m_isolate,pValue,GET_VALUE_TYPE(pValue)).operator CFX_WideString();
+
+ pValue = JS_GetObjectElement(isolate,pObj, L"nStart");
+ nStart = (int)CJS_Value(m_isolate,pValue,GET_VALUE_TYPE(pValue));
+
+ pValue = JS_GetObjectElement(isolate,pObj, L"nEnd");
+ nEnd = (int)CJS_Value(m_isolate,pValue,GET_VALUE_TYPE(pValue));
+ }
+ else
+ {
+ nPage = (int)params[0];
+ }
+ }
+ else
+ {
+ nPage = (int)params[0];
+
+ if (iSize >= 2)
+ swFilePath = params[1].operator CFX_WideString();
+
+ if (iSize >= 3)
+ nStart = (int)params[2];
+
+ if (iSize >= 4)
+ nEnd = (int)params[3];
+ }
+
+ if (nPage < 0)
+ nPage = 0;
+
+ if (nPage >= m_pDocument->GetPageCount())
+ nPage = m_pDocument->GetPageCount() - 1;
+
+ if (swFilePath.IsEmpty()) return FALSE;
+
+ swFilePath = app::PDFPathToSysPath(swFilePath);
+
+ CPDF_Parser pdfParser;
+ pdfParser.StartParse(swFilePath, FALSE);
+ CPDF_Document* pSrcDoc = pdfParser.GetDocument();
+
+ if (!pSrcDoc)
+ {
+ pdfParser.CloseParser();
+ return FALSE;
+ }
+
+ int nTotal = pSrcDoc->GetPageCount();
+
+ if (nStart < 0)
+ {
+ if (nEnd < 0)
+ {
+ nStart = 0;
+ nEnd = nTotal - 1;
+ }
+ else
+ {
+ nStart = 0;
+ }
+ }
+ else
+ {
+ if (nEnd < 0)
+ {
+ nEnd = nStart;
+ }
+ else
+ {
+ if (nStart >= nTotal) nStart = nTotal - 1;
+ if (nEnd >= nTotal) nEnd = nTotal - 1;
+
+ if (nEnd < nStart) nEnd = nStart;
+ }
+ }
+
+ CFX_WordArray array;
+ for (int i=nStart; i<=nEnd; i++)
+ array.Add(i);
+
+// m_pDocument->ReplacePages(nPage, pSrcDoc, array);
+
+ pdfParser.CloseParser();
+
+ return TRUE;
+}
+
+FX_BOOL Document::getURL(OBJ_METHOD_PARAMS)
+{
+ if (IsSafeMode(cc)) return TRUE;
+
+ return TRUE;
+}
+
+void Document::AddDelayData(CJS_DelayData* pData)
+{
+ m_DelayData.Add(pData);
+}
+
+void Document::DoFieldDelay(const CFX_WideString& sFieldName, int nControlIndex)
+{
+ CFX_DWordArray DelArray;
+
+ for (int i=0,sz=m_DelayData.GetSize(); i<sz; i++)
+ {
+ if (CJS_DelayData* pData = m_DelayData.GetAt(i))
+ {
+ if (pData->sFieldName == sFieldName && pData->nControlIndex == nControlIndex)
+ {
+ Field::DoDelay(m_pDocument, pData);
+ delete pData;
+ m_DelayData.SetAt(i, NULL);
+ DelArray.Add(i);
+ }
+ }
+ }
+
+ for (int j=DelArray.GetSize()-1; j>=0; j--)
+ {
+ m_DelayData.RemoveAt(DelArray[j]);
+ }
+}
+
+void Document::AddDelayAnnotData(CJS_AnnotObj *pData)
+{
+ m_DelayAnnotData.Add(pData);
+}
+
+void Document::DoAnnotDelay()
+{
+ CFX_DWordArray DelArray;
+
+ for (int j=DelArray.GetSize()-1; j>=0; j--)
+ {
+ m_DelayData.RemoveAt(DelArray[j]);
+ }
+}
diff --git a/fpdfsdk/src/javascript/Field.cpp b/fpdfsdk/src/javascript/Field.cpp
index 44a744f1d1..f5f9bf0539 100644
--- a/fpdfsdk/src/javascript/Field.cpp
+++ b/fpdfsdk/src/javascript/Field.cpp
@@ -1,4128 +1,4128 @@
-// 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
-
-#include "../../include/javascript/JavaScript.h"
-#include "../../include/javascript/IJavaScript.h"
-#include "../../include/javascript/JS_Define.h"
-#include "../../include/javascript/JS_Object.h"
-#include "../../include/javascript/JS_Value.h"
-#include "../../include/javascript/Field.h"
-#include "../../include/javascript/JS_EventHandler.h"
-//#include "../include/JS_ResMgr.h"
-#include "../../include/javascript/JS_Context.h"
-#include "../../include/javascript/JS_Runtime.h"
-#include "../../include/javascript/Document.h"
-#include "../../include/javascript/color.h"
-#include "../../include/javascript/PublicMethods.h"
-#include "../../include/javascript/Icon.h"
-
-
-/* ---------------------- Field ---------------------- */
-
-BEGIN_JS_STATIC_CONST(CJS_Field)
-END_JS_STATIC_CONST()
-
-BEGIN_JS_STATIC_PROP(CJS_Field)
- JS_STATIC_PROP_ENTRY(alignment)
- JS_STATIC_PROP_ENTRY(borderStyle)
- JS_STATIC_PROP_ENTRY(buttonAlignX)
- JS_STATIC_PROP_ENTRY(buttonAlignY)
- JS_STATIC_PROP_ENTRY(buttonFitBounds)
- JS_STATIC_PROP_ENTRY(buttonPosition)
- JS_STATIC_PROP_ENTRY(buttonScaleHow)
- JS_STATIC_PROP_ENTRY(buttonScaleWhen)
- JS_STATIC_PROP_ENTRY(calcOrderIndex)
- JS_STATIC_PROP_ENTRY(charLimit)
- JS_STATIC_PROP_ENTRY(comb)
- JS_STATIC_PROP_ENTRY(commitOnSelChange)
- JS_STATIC_PROP_ENTRY(currentValueIndices)
- JS_STATIC_PROP_ENTRY(defaultStyle)
- JS_STATIC_PROP_ENTRY(defaultValue)
- JS_STATIC_PROP_ENTRY(doNotScroll)
- JS_STATIC_PROP_ENTRY(doNotSpellCheck)
- JS_STATIC_PROP_ENTRY(delay)
- JS_STATIC_PROP_ENTRY(display)
- JS_STATIC_PROP_ENTRY(doc)
- JS_STATIC_PROP_ENTRY(editable)
- JS_STATIC_PROP_ENTRY(exportValues)
- JS_STATIC_PROP_ENTRY(hidden)
- JS_STATIC_PROP_ENTRY(fileSelect)
- JS_STATIC_PROP_ENTRY(fillColor)
- JS_STATIC_PROP_ENTRY(lineWidth)
- JS_STATIC_PROP_ENTRY(highlight)
- JS_STATIC_PROP_ENTRY(multiline)
- JS_STATIC_PROP_ENTRY(multipleSelection)
- JS_STATIC_PROP_ENTRY(name)
- JS_STATIC_PROP_ENTRY(numItems)
- JS_STATIC_PROP_ENTRY(page)
- JS_STATIC_PROP_ENTRY(password)
- JS_STATIC_PROP_ENTRY(print)
- JS_STATIC_PROP_ENTRY(radiosInUnison)
- JS_STATIC_PROP_ENTRY(readonly)
- JS_STATIC_PROP_ENTRY(rect)
- JS_STATIC_PROP_ENTRY(required)
- JS_STATIC_PROP_ENTRY(richText)
- JS_STATIC_PROP_ENTRY(richValue)
- JS_STATIC_PROP_ENTRY(rotation)
- JS_STATIC_PROP_ENTRY(strokeColor)
- JS_STATIC_PROP_ENTRY(style)
- JS_STATIC_PROP_ENTRY(submitName)
- JS_STATIC_PROP_ENTRY(textColor)
- JS_STATIC_PROP_ENTRY(textFont)
- JS_STATIC_PROP_ENTRY(textSize)
- JS_STATIC_PROP_ENTRY(type)
- JS_STATIC_PROP_ENTRY(userName)
- JS_STATIC_PROP_ENTRY(value)
- JS_STATIC_PROP_ENTRY(valueAsString)
- JS_STATIC_PROP_ENTRY(source)
-END_JS_STATIC_PROP()
-
-BEGIN_JS_STATIC_METHOD(CJS_Field)
- JS_STATIC_METHOD_ENTRY(browseForFileToSubmit, 0)
- JS_STATIC_METHOD_ENTRY(buttonGetCaption, 1)
- JS_STATIC_METHOD_ENTRY(buttonGetIcon, 1)
- JS_STATIC_METHOD_ENTRY(buttonImportIcon, 0)
- JS_STATIC_METHOD_ENTRY(buttonSetCaption, 2)
- JS_STATIC_METHOD_ENTRY(buttonSetIcon, 2)
- JS_STATIC_METHOD_ENTRY(checkThisBox, 2)
- JS_STATIC_METHOD_ENTRY(clearItems, 0)
- JS_STATIC_METHOD_ENTRY(defaultIsChecked, 2)
- JS_STATIC_METHOD_ENTRY(deleteItemAt, 1)
- JS_STATIC_METHOD_ENTRY(getArray , 0)
- JS_STATIC_METHOD_ENTRY(getItemAt, 0)
- JS_STATIC_METHOD_ENTRY(getLock, 0)
- JS_STATIC_METHOD_ENTRY(insertItemAt, 0)
- JS_STATIC_METHOD_ENTRY(isBoxChecked, 1)
- JS_STATIC_METHOD_ENTRY(isDefaultChecked, 1)
- JS_STATIC_METHOD_ENTRY(setAction, 2)
- JS_STATIC_METHOD_ENTRY(setFocus, 0)
- JS_STATIC_METHOD_ENTRY(setItems, 1)
- JS_STATIC_METHOD_ENTRY(setLock, 0)
- JS_STATIC_METHOD_ENTRY(signatureGetModifications, 0)
- JS_STATIC_METHOD_ENTRY(signatureGetSeedValue, 0)
- JS_STATIC_METHOD_ENTRY(signatureInfo, 0)
- JS_STATIC_METHOD_ENTRY(signatureSetSeedValue, 0)
- JS_STATIC_METHOD_ENTRY(signatureSign, 0)
- JS_STATIC_METHOD_ENTRY(signatureValidate, 0)
-END_JS_STATIC_METHOD()
-
-IMPLEMENT_JS_CLASS(CJS_Field, Field)
-
-FX_BOOL CJS_Field::InitInstance(IFXJS_Context* cc)
-{
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
-
- Field* pField = (Field*)GetEmbedObject();
- ASSERT(pField != NULL);
-
- pField->SetIsolate(pContext->GetJSRuntime()->GetIsolate());
-
- return TRUE;
-};
-
-Field::Field(CJS_Object* pJSObject): CJS_EmbedObj(pJSObject),
- m_pJSDoc(NULL),
- m_pDocument(NULL),
- m_nFormControlIndex(-1),
- m_bCanSet(FALSE),
- m_bDelay(FALSE),
- m_isolate(NULL)
-{
-}
-
-Field::~Field()
-{
-}
-
-//note: iControlNo = -1, means not a widget.
-void Field::ParseFieldName(const std::wstring &strFieldNameParsed,std::wstring &strFieldName,int & iControlNo)
-{
- int iStart = strFieldNameParsed.find_last_of(L'.');
- if (iStart == -1)
- {
- strFieldName = strFieldNameParsed;
- iControlNo = -1;
- return;
- }
- std::wstring suffixal = strFieldNameParsed.substr(iStart+1);
- iControlNo = FXSYS_wtoi((FX_LPCWSTR)suffixal.c_str());
- if (iControlNo == 0)
- {
- int iStart;
- while((iStart = suffixal.find_last_of(L" ")) != -1)
- {
- suffixal.erase(iStart,1);
- }
-
- if (suffixal.compare(L"0") != 0)
- {
- strFieldName = strFieldNameParsed;
- iControlNo = -1;
- return;
- }
-
- }
- strFieldName = strFieldNameParsed.substr(0,iStart);
-}
-
-FX_BOOL Field::AttachField(Document* pDocument, const CFX_WideString& csFieldName)
-{
- ASSERT(pDocument != NULL);
- m_pJSDoc = pDocument;
-
- m_pDocument = pDocument->GetReaderDoc();
- ASSERT(m_pDocument != NULL);
-
- m_bCanSet = m_pDocument->GetPermissions(FPDFPERM_FILL_FORM) ||
- m_pDocument->GetPermissions(FPDFPERM_ANNOT_FORM) ||
- m_pDocument->GetPermissions(FPDFPERM_MODIFY);
-
- CPDFSDK_InterForm* pRDInterForm = m_pDocument->GetInterForm();
- ASSERT(pRDInterForm != NULL);
-
- CPDF_InterForm* pInterForm = pRDInterForm->GetInterForm();
- ASSERT(pInterForm != NULL);
-
- CFX_WideString swFieldNameTemp = csFieldName;
- swFieldNameTemp.Replace((FX_LPCWSTR)L"..", (FX_LPCWSTR)L".");
-
- if (pInterForm->CountFields(swFieldNameTemp) <= 0)
- {
- std::wstring strFieldName;
- int iControlNo = -1;
- ParseFieldName((wchar_t*)(FX_LPCWSTR)swFieldNameTemp, strFieldName, iControlNo);
- if (iControlNo == -1) return FALSE;
-
- m_FieldName = strFieldName.c_str();
- m_nFormControlIndex = iControlNo;
- return TRUE;
- }
-
- m_FieldName = swFieldNameTemp;
- m_nFormControlIndex = -1;
-
- return TRUE;
-}
-
-void Field::GetFormFields(CPDFSDK_Document* pDocument, const CFX_WideString& csFieldName, CFX_PtrArray& FieldArray)
-{
- ASSERT(pDocument != NULL);
-
- CPDFSDK_InterForm* pReaderInterForm = pDocument->GetInterForm();
- ASSERT(pReaderInterForm != NULL);
-
- CPDF_InterForm* pInterForm = pReaderInterForm->GetInterForm();
- ASSERT(pInterForm != NULL);
-
- ASSERT(FieldArray.GetSize() == 0);
-
- for (int i=0,sz=pInterForm->CountFields(csFieldName); i<sz; i++)
- {
- if (CPDF_FormField* pFormField = pInterForm->GetField(i, csFieldName))
- FieldArray.Add((void*)pFormField);
- }
-}
-
-void Field::GetFormFields(const CFX_WideString& csFieldName, CFX_PtrArray& FieldArray)
-{
- ASSERT(m_pDocument != NULL);
-
- Field::GetFormFields(m_pDocument, csFieldName, FieldArray);
-}
-
-void Field::UpdateFormField(CPDFSDK_Document* pDocument, CPDF_FormField* pFormField,
- FX_BOOL bChangeMark, FX_BOOL bResetAP, FX_BOOL bRefresh)
-{
- ASSERT(pDocument != NULL);
- ASSERT(pFormField != NULL);
-
- CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pDocument->GetInterForm();
- ASSERT(pInterForm != NULL);
-
- CFX_PtrArray widgets;
- pInterForm->GetWidgets(pFormField, widgets);
-
- if (bResetAP)
- {
- int nFieldType = pFormField->GetFieldType();
- if (nFieldType == FIELDTYPE_COMBOBOX || nFieldType == FIELDTYPE_TEXTFIELD)
- {
- for (int i=0,sz=widgets.GetSize(); i<sz; i++)
- {
- CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)widgets.GetAt(i);
- ASSERT(pWidget != NULL);
-
- FX_BOOL bFormated = FALSE;
- CFX_WideString sValue = pWidget->OnFormat(0, bFormated);
- if (bFormated)
- pWidget->ResetAppearance(sValue, FALSE);
- else
- pWidget->ResetAppearance(NULL, FALSE);
- }
- }
- else
- {
- for (int i=0,sz=widgets.GetSize(); i<sz; i++)
- {
- CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)widgets.GetAt(i);
- ASSERT(pWidget != NULL);
-
- pWidget->ResetAppearance(NULL, FALSE);
- }
- }
- }
-
- if (bRefresh)
- {
- for (int i=0,sz=widgets.GetSize(); i<sz; i++)
- {
- CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)widgets.GetAt(i);
- ASSERT(pWidget != NULL);
-
- CPDFSDK_InterForm * pInterForm = pWidget->GetInterForm();
- CPDFSDK_Document* pDoc = pInterForm->GetDocument();
-// CReader_Page* pPage = pWidget->GetPage();
- ASSERT(pDoc != NULL);
- pDoc->UpdateAllViews(NULL, pWidget);
- }
- }
-
- if (bChangeMark)
- pDocument->SetChangeMark();
-}
-
-void Field::UpdateFormControl(CPDFSDK_Document* pDocument, CPDF_FormControl* pFormControl,
- FX_BOOL bChangeMark, FX_BOOL bResetAP, FX_BOOL bRefresh)
-{
- ASSERT(pDocument != NULL);
- ASSERT(pFormControl != NULL);
-
- CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pDocument->GetInterForm();
- ASSERT(pInterForm != NULL);
-
- CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormControl);
-
- if (pWidget)
- {
- if (bResetAP)
- {
- int nFieldType = pWidget->GetFieldType();
- if (nFieldType == FIELDTYPE_COMBOBOX || nFieldType == FIELDTYPE_TEXTFIELD)
- {
- FX_BOOL bFormated = FALSE;
- CFX_WideString sValue = pWidget->OnFormat(0, bFormated);
- if (bFormated)
- pWidget->ResetAppearance(sValue, FALSE);
- else
- pWidget->ResetAppearance(NULL, FALSE);
- }
- else
- {
- pWidget->ResetAppearance(NULL, FALSE);
- }
- }
-
- if (bRefresh)
- {
- CPDFSDK_InterForm * pInterForm = pWidget->GetInterForm();
- CPDFSDK_Document* pDoc = pInterForm->GetDocument();
- ASSERT(pDoc != NULL);
- pDoc->UpdateAllViews(NULL, pWidget);
- }
-
- }
-
- if (bChangeMark)
- pDocument->SetChangeMark();
-}
-
-CPDFSDK_Widget* Field::GetWidget(CPDFSDK_Document* pDocument, CPDF_FormControl* pFormControl)
-{
- ASSERT(pDocument != NULL);
- ASSERT(pFormControl != NULL);
-
- CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pDocument->GetInterForm();
- ASSERT(pInterForm != NULL);
-
- return pInterForm->GetWidget(pFormControl);
-}
-
-FX_BOOL Field::ValueIsOccur(CPDF_FormField* pFormField, CFX_WideString csOptLabel)
-{
- ASSERT(pFormField != NULL);
-
- for (int i=0,sz = pFormField->CountOptions(); i < sz; i++)
- {
- if (csOptLabel.Compare(pFormField->GetOptionLabel(i)) == 0)
- return TRUE;
- }
-
- return FALSE;
-}
-
-CPDF_FormControl* Field::GetSmartFieldControl(CPDF_FormField* pFormField)
-{
- ASSERT(pFormField != NULL);
- if(!pFormField->CountControls() || m_nFormControlIndex>=pFormField->CountControls()) return NULL;
-
- if (m_nFormControlIndex<0)
- return pFormField->GetControl(0);
- else
- return pFormField->GetControl(m_nFormControlIndex);
-}
-
-/* ---------------------------------------- property ---------------------------------------- */
-
-FX_BOOL Field::alignment(OBJ_PROP_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- if (vp.IsSetting())
- {
- if (!m_bCanSet) return FALSE;
-
- CFX_ByteString alignStr;
- vp >> alignStr;
-
- if (m_bDelay)
- {
- AddDelay_String(FP_ALIGNMENT, alignStr);
- }
- else
- {
- Field::SetAlignment(m_pDocument, m_FieldName, m_nFormControlIndex, alignStr);
- }
- }
- else
- {
- CFX_PtrArray FieldArray;
- GetFormFields(m_FieldName, FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
-
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
- ASSERT(pFormField != NULL);
-
- if (pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD)
- return FALSE;
-
- CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
- if (!pFormControl)return FALSE;
-
- switch (pFormControl->GetControlAlignment())
- {
- case 1:
- vp << (FX_LPCWSTR)L"center";
- break;
- case 0:
- vp << (FX_LPCWSTR)L"left";
- break;
- case 2:
- vp << (FX_LPCWSTR)L"right";
- break;
- default:
- vp << (FX_LPCWSTR)L"";
- }
- }
-
- return TRUE;
-}
-
-void Field::SetAlignment(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex,
- const CFX_ByteString& string)
-{
- //Not supported.
-}
-
-FX_BOOL Field::borderStyle(OBJ_PROP_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- if (vp.IsSetting())
- {
- if (!m_bCanSet) return FALSE;
-
- CFX_ByteString strType = "";
- vp >> strType;
-
- if (m_bDelay)
- {
- AddDelay_String(FP_BORDERSTYLE, strType);
- }
- else
- {
- Field::SetBorderStyle(m_pDocument, m_FieldName, m_nFormControlIndex, strType);
- }
- }
- else
- {
- CFX_PtrArray FieldArray;
- GetFormFields(m_FieldName, FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
-
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
- if (!pFormField) return FALSE;
-
- CPDFSDK_Widget* pWidget = GetWidget(m_pDocument, GetSmartFieldControl(pFormField));
- if (!pWidget) return FALSE;
-
- int nBorderstyle = pWidget->GetBorderStyle();
-
- switch (nBorderstyle)
- {
- case BBS_SOLID:
- vp << (FX_LPCWSTR)L"solid";
- break;
- case BBS_DASH:
- vp << (FX_LPCWSTR)L"dashed";
- break;
- case BBS_BEVELED:
- vp << (FX_LPCWSTR)L"beveled";
- break;
- case BBS_INSET:
- vp << (FX_LPCWSTR)L"inset";
- break;
- case BBS_UNDERLINE:
- vp << (FX_LPCWSTR)L"underline";
- break;
- default:
- vp << (FX_LPCWSTR)L"";
- break;
- }
- }
-
- return TRUE;
-}
-
-void Field::SetBorderStyle(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex,
- const CFX_ByteString& string)
-{
- ASSERT(pDocument != NULL);
-
- int nBorderStyle = 0;
-
- if (string == "solid")
- nBorderStyle = BBS_SOLID;
- else if (string == "beveled")
- nBorderStyle = BBS_BEVELED;
- else if (string == "dashed")
- nBorderStyle = BBS_DASH;
- else if (string == "inset")
- nBorderStyle = BBS_INSET;
- else if (string == "underline")
- nBorderStyle = BBS_UNDERLINE;
- else return;
-
- CFX_PtrArray FieldArray;
- GetFormFields(pDocument, swFieldName, FieldArray);
-
- for (int i=0,isz=FieldArray.GetSize(); i<isz; i++)
- {
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(i);
- ASSERT(pFormField != NULL);
-
- if (nControlIndex < 0)
- {
- FX_BOOL bSet = FALSE;
- for (int j=0,jsz = pFormField->CountControls(); j<jsz; j++)
- {
- if (CPDFSDK_Widget* pWidget = GetWidget(pDocument, pFormField->GetControl(j)))
- {
- if (pWidget->GetBorderStyle() != nBorderStyle)
- {
- pWidget->SetBorderStyle(nBorderStyle);
- bSet = TRUE;
- }
- }
- }
- if (bSet) UpdateFormField(pDocument, pFormField, TRUE, TRUE, TRUE);
- }
- else
- {
- if(nControlIndex >= pFormField->CountControls()) return;
- if (CPDF_FormControl* pFormControl = pFormField->GetControl(nControlIndex))
- {
- if (CPDFSDK_Widget* pWidget = GetWidget(pDocument, pFormControl))
- {
- if (pWidget->GetBorderStyle() != nBorderStyle)
- {
- pWidget->SetBorderStyle(nBorderStyle);
- UpdateFormControl(pDocument, pFormControl, TRUE, TRUE, TRUE);
- }
- }
- }
- }
- }
-}
-
-FX_BOOL Field::buttonAlignX(OBJ_PROP_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- if (vp.IsSetting())
- {
- if (!m_bCanSet) return FALSE;
-
- int nVP;
- vp >> nVP;
-
- if (m_bDelay)
- {
- AddDelay_Int(FP_BUTTONALIGNX, nVP);
- }
- else
- {
- Field::SetButtonAlignX(m_pDocument, m_FieldName, m_nFormControlIndex, nVP);
- }
- }
- else
- {
- CFX_PtrArray FieldArray;
- GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
-
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
- ASSERT(pFormField != NULL);
-
- if (pFormField->GetFieldType() != FIELDTYPE_PUSHBUTTON)
- return FALSE;
-
- CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
- if (!pFormControl)return FALSE;
-
- CPDF_IconFit IconFit = pFormControl->GetIconFit();
-
- FX_FLOAT fLeft,fBottom;
- IconFit.GetIconPosition(fLeft,fBottom);
-
- vp << (FX_INT32)fLeft;
- }
-
- return TRUE;
-}
-
-void Field::SetButtonAlignX(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number)
-{
- //Not supported.
-}
-
-FX_BOOL Field::buttonAlignY(OBJ_PROP_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- if (vp.IsSetting())
- {
- if (!m_bCanSet) return FALSE;
-
- int nVP;
- vp >> nVP;
-
- if (m_bDelay)
- {
- AddDelay_Int(FP_BUTTONALIGNY, nVP);
- }
- else
- {
- Field::SetButtonAlignY(m_pDocument, m_FieldName, m_nFormControlIndex, nVP);
- }
- }
- else
- {
- CFX_PtrArray FieldArray;
- GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
-
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
- ASSERT(pFormField != NULL);
-
- if (pFormField->GetFieldType() != FIELDTYPE_PUSHBUTTON)
- return FALSE;
-
- CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
- if (!pFormControl)return FALSE;
-
- CPDF_IconFit IconFit = pFormControl->GetIconFit();
-
- FX_FLOAT fLeft,fBottom;
- IconFit.GetIconPosition(fLeft,fBottom);
-
- vp << (FX_INT32)fBottom;
- }
-
- return TRUE;
-}
-
-void Field::SetButtonAlignY(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number)
-{
- //Not supported.
-}
-
-FX_BOOL Field::buttonFitBounds(OBJ_PROP_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- if (vp.IsSetting())
- {
- if (!m_bCanSet) return FALSE;
-
- bool bVP;
- vp >> bVP;
-
- if (m_bDelay)
- {
- AddDelay_Bool(FP_BUTTONFITBOUNDS, bVP);
- }
- else
- {
- Field::SetButtonFitBounds(m_pDocument, m_FieldName, m_nFormControlIndex, bVP);
- }
- }
- else
- {
- CFX_PtrArray FieldArray;
- GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
-
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
- ASSERT(pFormField != NULL);
-
- if (pFormField->GetFieldType() != FIELDTYPE_PUSHBUTTON)
- return FALSE;
-
- CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
- if (!pFormControl)return FALSE;
-
- CPDF_IconFit IconFit = pFormControl->GetIconFit();
- vp << IconFit.GetFittingBounds();
- }
-
- return TRUE;
-}
-
-void Field::SetButtonFitBounds(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b)
-{
- //Not supported.
-}
-
-FX_BOOL Field::buttonPosition(OBJ_PROP_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- if (vp.IsSetting())
- {
- if (!m_bCanSet) return FALSE;
-
- int nVP;
- vp >> nVP;
-
- if (m_bDelay)
- {
- AddDelay_Int(FP_BUTTONPOSITION, nVP);
- }
- else
- {
- Field::SetButtonPosition(m_pDocument, m_FieldName, m_nFormControlIndex, nVP);
- }
- }
- else
- {
- CFX_PtrArray FieldArray;
- GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
-
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
- ASSERT(pFormField != NULL);
-
- if (pFormField->GetFieldType() != FIELDTYPE_PUSHBUTTON)
- return FALSE;
-
- CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
- if (!pFormControl)return FALSE;
-
- vp << pFormControl->GetTextPosition();
- }
- return TRUE;
-}
-
-void Field::SetButtonPosition(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number)
-{
- //Not supported.
-}
-
-FX_BOOL Field::buttonScaleHow(OBJ_PROP_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- if (vp.IsSetting())
- {
- if (!m_bCanSet) return FALSE;
-
- int nVP;
- vp >> nVP;
-
- if (m_bDelay)
- {
- AddDelay_Int(FP_BUTTONSCALEHOW, nVP);
- }
- else
- {
- Field::SetButtonScaleHow(m_pDocument, m_FieldName, m_nFormControlIndex, nVP);
- }
- }
- else
- {
- CFX_PtrArray FieldArray;
- GetFormFields(m_FieldName, FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
-
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
- ASSERT(pFormField != NULL);
-
- if (pFormField->GetFieldType() != FIELDTYPE_PUSHBUTTON)
- return FALSE;
-
- CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
- if (!pFormControl)return FALSE;
-
- CPDF_IconFit IconFit = pFormControl->GetIconFit();
- if (IconFit.IsProportionalScale())
- vp << (FX_INT32)0;
- else
- vp << (FX_INT32)1;
- }
-
- return TRUE;
-}
-
-void Field::SetButtonScaleHow(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number)
-{
- //Not supported.
-}
-
-FX_BOOL Field::buttonScaleWhen(OBJ_PROP_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- if (vp.IsSetting())
- {
- if (!m_bCanSet) return FALSE;
-
- int nVP;
- vp >> nVP;
-
- if (m_bDelay)
- {
- AddDelay_Int(FP_BUTTONSCALEWHEN, nVP);
- }
- else
- {
- Field::SetButtonScaleWhen(m_pDocument, m_FieldName, m_nFormControlIndex, nVP);
- }
- }
- else
- {
- CFX_PtrArray FieldArray;
- GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
-
- CPDF_FormField* pFormField = (CPDF_FormField*) FieldArray.ElementAt(0);
- ASSERT(pFormField != NULL);
-
- if (pFormField->GetFieldType() != FIELDTYPE_PUSHBUTTON)
- return FALSE;
-
- CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
- if (!pFormControl) return FALSE;
-
- CPDF_IconFit IconFit = pFormControl->GetIconFit();
- int ScaleM = IconFit.GetScaleMethod();
- switch (ScaleM)
- {
- case CPDF_IconFit::Always :
- vp << (FX_INT32) CPDF_IconFit::Always;
- break;
- case CPDF_IconFit::Bigger :
- vp << (FX_INT32) CPDF_IconFit::Bigger;
- break;
- case CPDF_IconFit::Never :
- vp << (FX_INT32) CPDF_IconFit::Never;
- break;
- case CPDF_IconFit::Smaller :
- vp << (FX_INT32) CPDF_IconFit::Smaller;
- break;
- }
- }
-
- return TRUE;
-}
-
-void Field::SetButtonScaleWhen(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number)
-{
- //Not supported.
-}
-
-FX_BOOL Field::calcOrderIndex(OBJ_PROP_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- if (vp.IsSetting())
- {
- if (!m_bCanSet) return FALSE;
-
- int nVP;
- vp >> nVP;
-
- if (m_bDelay)
- {
- AddDelay_Int(FP_CALCORDERINDEX, nVP);
- }
- else
- {
- Field::SetCalcOrderIndex(m_pDocument, m_FieldName, m_nFormControlIndex, nVP);
- }
- }
- else
- {
- CFX_PtrArray FieldArray;
- GetFormFields(m_FieldName, FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
-
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
- ASSERT(pFormField != NULL);
-
- if (pFormField->GetFieldType() != FIELDTYPE_COMBOBOX && pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD)
- return FALSE;
-
- CPDFSDK_InterForm* pRDInterForm = m_pDocument->GetInterForm();
- ASSERT(pRDInterForm != NULL);
-
- CPDF_InterForm* pInterForm = pRDInterForm->GetInterForm();
- ASSERT(pInterForm != NULL);
-
- vp << (FX_INT32)pInterForm->FindFieldInCalculationOrder(pFormField);
- }
-
- return TRUE;
-}
-
-void Field::SetCalcOrderIndex(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number)
-{
- //Not supported.
-}
-
-FX_BOOL Field::charLimit(OBJ_PROP_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- if (vp.IsSetting())
- {
- if (!m_bCanSet) return FALSE;
-
- int nVP;
- vp >> nVP;
-
- if (m_bDelay)
- {
- AddDelay_Int(FP_CHARLIMIT, nVP);
- }
- else
- {
- Field::SetCharLimit(m_pDocument, m_FieldName, m_nFormControlIndex, nVP);
- }
- }
- else
- {
- CFX_PtrArray FieldArray;
- GetFormFields(m_FieldName, FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
-
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
- ASSERT(pFormField != NULL);
-
- if (pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD)
- return FALSE;
-
- vp << (FX_INT32)pFormField->GetMaxLen();
- }
- return TRUE;
-}
-
-void Field::SetCharLimit(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number)
-{
- //Not supported.
-}
-
-FX_BOOL Field::comb(OBJ_PROP_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- if (vp.IsSetting())
- {
- if (!m_bCanSet) return FALSE;
-
- bool bVP;
- vp >> bVP;
-
- if (m_bDelay)
- {
- AddDelay_Bool(FP_COMB, bVP);
- }
- else
- {
- Field::SetComb(m_pDocument, m_FieldName, m_nFormControlIndex, bVP);
- }
- }
- else
- {
- CFX_PtrArray FieldArray;
- GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
-
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
- ASSERT(pFormField != NULL);
-
- if (pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD)
- return FALSE;
-
- if (pFormField->GetFieldFlags() & FIELDFLAG_COMB)
- vp << true;
- else
- vp << false;
- }
-
- return TRUE;
-}
-
-void Field::SetComb(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b)
-{
- //Not supported.
-}
-
-FX_BOOL Field::commitOnSelChange(OBJ_PROP_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- if (vp.IsSetting())
- {
- if (!m_bCanSet) return FALSE;
-
- bool bVP;
- vp >> bVP;
-
- if (m_bDelay)
- {
- AddDelay_Bool(FP_COMMITONSELCHANGE, bVP);
- }
- else
- {
- Field::SetCommitOnSelChange(m_pDocument, m_FieldName, m_nFormControlIndex, bVP);
- }
- }
- else
- {
- CFX_PtrArray FieldArray;
- GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
-
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
- ASSERT(pFormField != NULL);
-
- if (pFormField->GetFieldType() != FIELDTYPE_COMBOBOX && pFormField->GetFieldType() != FIELDTYPE_LISTBOX)
- return FALSE;
-
- if (pFormField->GetFieldFlags() & FIELDFLAG_COMMITONSELCHANGE)
- vp << true;
- else
- vp << false;
- }
-
- return TRUE;
-}
-
-void Field::SetCommitOnSelChange(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b)
-{
- //Not supported.
-}
-
-FX_BOOL Field::currentValueIndices(OBJ_PROP_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- if (vp.IsSetting())
- {
- if (!m_bCanSet) return FALSE;
-
- CFX_DWordArray array;
-
- if (vp.GetType() == VT_number)
- {
- int iSelecting = 0;
- vp >> iSelecting;
- array.Add(iSelecting);
- }
- else if (vp.IsArrayObject())
- {
- CJS_Array SelArray(m_isolate);
- CJS_Value SelValue(m_isolate);
- int iSelecting;
- vp >> SelArray;
- for (int i=0,sz=SelArray.GetLength(); i<sz; i++)
- {
- SelArray.GetElement(i,SelValue);
- iSelecting = (FX_INT32)SelValue;
- array.Add(iSelecting);
- }
- }
-
- if (m_bDelay)
- {
- AddDelay_WordArray(FP_CURRENTVALUEINDICES, array);
- }
- else
- {
- Field::SetCurrentValueIndices(m_pDocument, m_FieldName, m_nFormControlIndex, array);
- }
- }
- else
- {
- CFX_PtrArray FieldArray;
- GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
-
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
- ASSERT(pFormField != NULL);
-
- if (pFormField->GetFieldType() != FIELDTYPE_COMBOBOX && pFormField->GetFieldType() != FIELDTYPE_LISTBOX)
- return FALSE;
-
- if (pFormField->CountSelectedItems() == 1)
- vp << pFormField->GetSelectedIndex(0);
- else if (pFormField->CountSelectedItems() > 1)
- {
- CJS_Array SelArray(m_isolate);
- for (int i=0,sz=pFormField->CountSelectedItems(); i<sz; i++)
- {
- SelArray.SetElement(i, CJS_Value(m_isolate,pFormField->GetSelectedIndex(i)));
- }
- vp << SelArray;
- }
- else
- vp << -1;
- }
-
- return TRUE;
-}
-
-void Field::SetCurrentValueIndices(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex,
- const CFX_DWordArray& array)
-{
- ASSERT(pDocument != NULL);
-
- CFX_PtrArray FieldArray;
- GetFormFields(pDocument, swFieldName, FieldArray);
-
- for (int i=0,isz=FieldArray.GetSize(); i<isz; i++)
- {
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(i);
- ASSERT(pFormField != NULL);
-
- int nFieldType = pFormField->GetFieldType();
- if (nFieldType == FIELDTYPE_COMBOBOX || nFieldType == FIELDTYPE_LISTBOX)
- {
- FX_DWORD dwFieldFlags = pFormField->GetFieldFlags();
- pFormField->ClearSelection(TRUE);
-
- for (int i=0,sz=array.GetSize(); i<sz; i++)
- {
- if (i>0 && !(dwFieldFlags & (1<<21)))
- {
- break;
- }
-
- int iSelecting = (FX_INT32)array.GetAt(i);
- if (iSelecting < pFormField->CountOptions() && !pFormField->IsItemSelected(iSelecting))
- pFormField->SetItemSelection(iSelecting, TRUE);
-
- }
- UpdateFormField(pDocument, pFormField, TRUE, TRUE, TRUE);
- }
- }
-}
-
-FX_BOOL Field::defaultStyle(OBJ_PROP_PARAMS)
-{
- // MQG sError = JSGetStringFromID(IDS_STRING_NOTSUPPORT);
- return FALSE;
-
- if (vp.IsSetting())
- {
- if (!m_bCanSet) return FALSE;
-
- ;
- }
- else
- {
- ;
- }
- return TRUE;
-}
-
-void Field::SetDefaultStyle(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex)
-{
- //Not supported.
-}
-
-FX_BOOL Field::defaultValue(OBJ_PROP_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- if (vp.IsSetting())
- {
- if (!m_bCanSet) return FALSE;
-
- CFX_WideString WideStr;
- vp >> WideStr;
-
- if (m_bDelay)
- {
- AddDelay_WideString(FP_DEFAULTVALUE, WideStr);
- }
- else
- {
- Field::SetDefaultValue(m_pDocument, m_FieldName, m_nFormControlIndex, WideStr);
- }
- }
- else
- {
- CFX_PtrArray FieldArray;
- GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
-
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
- ASSERT(pFormField != NULL);
-
- if (pFormField->GetFieldType() == FIELDTYPE_PUSHBUTTON ||
- pFormField->GetFieldType() == FIELDTYPE_SIGNATURE)
- return FALSE;
-
- vp << pFormField->GetDefaultValue();
- }
- return TRUE;
-}
-
-void Field::SetDefaultValue(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex,
- const CFX_WideString& string)
-{
- //Not supported.
-}
-
-FX_BOOL Field::doNotScroll(OBJ_PROP_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- if (vp.IsSetting())
- {
- if (!m_bCanSet) return FALSE;
-
- bool bVP;
- vp >> bVP;
-
- if (m_bDelay)
- {
- AddDelay_Bool(FP_DONOTSCROLL, bVP);
- }
- else
- {
- Field::SetDoNotScroll(m_pDocument, m_FieldName, m_nFormControlIndex, bVP);
- }
- }
- else
- {
- CFX_PtrArray FieldArray;
- GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
-
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
- ASSERT(pFormField != NULL);
-
- if (pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD)
- return FALSE;
-
- if (pFormField->GetFieldFlags() & FIELDFLAG_DONOTSCROLL)
- vp << true;
- else
- vp << false;
- }
-
- return TRUE;
-}
-
-void Field::SetDoNotScroll(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b)
-{
- //Not supported.
-}
-
-FX_BOOL Field::doNotSpellCheck(OBJ_PROP_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- if (vp.IsSetting())
- {
- if (!m_bCanSet) return FALSE;
-
- bool bVP;
- vp >> bVP;
- }
- else
- {
- CFX_PtrArray FieldArray;
- GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
-
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
- ASSERT(pFormField != NULL);
-
- if (pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD &&
- pFormField->GetFieldType() != FIELDTYPE_COMBOBOX)
- return FALSE;
-
- if (pFormField->GetFieldFlags() & FIELDFLAG_DONOTSPELLCHECK)
- vp << true;
- else
- vp << false;
- }
-
- return TRUE;
-}
-
-void Field::SetDelay(FX_BOOL bDelay)
-{
- m_bDelay = bDelay;
-
- if (!m_bDelay)
- {
- if (m_pJSDoc)
- m_pJSDoc->DoFieldDelay(m_FieldName, m_nFormControlIndex);
- }
-}
-
-FX_BOOL Field::delay(OBJ_PROP_PARAMS)
-{
- if (vp.IsSetting())
- {
- if (!m_bCanSet) return FALSE;
-
- bool bVP;
- vp >> bVP;
-
- SetDelay(bVP);
- }
- else
- {
- vp << m_bDelay;
- }
- return TRUE;
-}
-
-FX_BOOL Field::display(OBJ_PROP_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- if (vp.IsSetting())
- {
- if (!m_bCanSet) return FALSE;
-
- int nVP;
- vp >> nVP;
-
- if (m_bDelay)
- {
- AddDelay_Int(FP_DISPLAY, nVP);
- }
- else
- {
- Field::SetDisplay(m_pDocument, m_FieldName, m_nFormControlIndex, nVP);
- }
- }
- else
- {
- CFX_PtrArray FieldArray;
- GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
-
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
- ASSERT(pFormField != NULL);
-
- CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInterForm();
- ASSERT(pInterForm != NULL);
-
- CPDFSDK_Widget* pWidget = pInterForm->GetWidget(GetSmartFieldControl(pFormField));
- if (!pWidget)return FALSE;
-
- FX_DWORD dwFlag = pWidget->GetFlags();
-
- if (ANNOTFLAG_INVISIBLE & dwFlag || ANNOTFLAG_HIDDEN & dwFlag)
- {
- vp << (FX_INT32)1;
- }
- else
- {
- if (ANNOTFLAG_PRINT & dwFlag)
- {
- if (ANNOTFLAG_NOVIEW & dwFlag)
- {
- vp << (FX_INT32)3;
- }
- else
- {
- vp << (FX_INT32)0;
- }
- }
- else
- {
- vp << (FX_INT32)2;
- }
- }
- }
-
- return TRUE;
-}
-
-void Field::SetDisplay(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number)
-{
- ASSERT(pDocument != NULL);
-
- CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pDocument->GetInterForm();
- ASSERT(pInterForm != NULL);
-
- CFX_PtrArray FieldArray;
- GetFormFields(pDocument, swFieldName, FieldArray);
-
- for (int i=0,isz=FieldArray.GetSize(); i<isz; i++)
- {
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(i);
- ASSERT(pFormField != NULL);
-
- if (nControlIndex < 0)
- {
- FX_BOOL bSet = FALSE;
- for (int j=0,jsz = pFormField->CountControls(); j<jsz; j++)
- {
- CPDF_FormControl* pFormControl = pFormField->GetControl(j);
- ASSERT(pFormControl != NULL);
-
- if (CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormControl))
- {
- FX_DWORD dwFlag = pWidget->GetFlags();
- switch (number)
- {
- case 0:
- dwFlag &= (~ANNOTFLAG_INVISIBLE);
- dwFlag &= (~ANNOTFLAG_HIDDEN);
- dwFlag &= (~ANNOTFLAG_NOVIEW);
- dwFlag |= ANNOTFLAG_PRINT;
- break;
- case 1:
- dwFlag &= (~ANNOTFLAG_INVISIBLE);
- dwFlag &= (~ANNOTFLAG_NOVIEW);
- dwFlag |= (ANNOTFLAG_HIDDEN | ANNOTFLAG_PRINT);
- break;
- case 2:
- dwFlag &= (~ANNOTFLAG_INVISIBLE);
- dwFlag &= (~ANNOTFLAG_PRINT);
- dwFlag &= (~ANNOTFLAG_HIDDEN);
- dwFlag &= (~ANNOTFLAG_NOVIEW);
- break;
- case 3:
- dwFlag |= ANNOTFLAG_NOVIEW;
- dwFlag |= ANNOTFLAG_PRINT;
- dwFlag &= (~ANNOTFLAG_HIDDEN);
- break;
- }
-
- if (dwFlag != pWidget->GetFlags())
- {
- pWidget->SetFlags(dwFlag);
- bSet = TRUE;
- }
- }
- }
-
- if (bSet) UpdateFormField(pDocument, pFormField, TRUE, FALSE, TRUE);
- }
- else
- {
- if(nControlIndex >= pFormField->CountControls()) return;
- if (CPDF_FormControl* pFormControl = pFormField->GetControl(nControlIndex))
- {
- if (CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormControl))
- {
-
- FX_DWORD dwFlag = pWidget->GetFlags();
- switch (number)
- {
- case 0:
- dwFlag &= (~ANNOTFLAG_INVISIBLE);
- dwFlag &= (~ANNOTFLAG_HIDDEN);
- dwFlag &= (~ANNOTFLAG_NOVIEW);
- dwFlag |= ANNOTFLAG_PRINT;
- break;
- case 1:
- dwFlag &= (~ANNOTFLAG_INVISIBLE);
- dwFlag &= (~ANNOTFLAG_NOVIEW);
- dwFlag |= (ANNOTFLAG_HIDDEN | ANNOTFLAG_PRINT);
- break;
- case 2:
- dwFlag &= (~ANNOTFLAG_INVISIBLE);
- dwFlag &= (~ANNOTFLAG_PRINT);
- dwFlag &= (~ANNOTFLAG_HIDDEN);
- dwFlag &= (~ANNOTFLAG_NOVIEW);
- break;
- case 3:
- dwFlag |= ANNOTFLAG_NOVIEW;
- dwFlag |= ANNOTFLAG_PRINT;
- dwFlag &= (~ANNOTFLAG_HIDDEN);
- break;
- }
- if (dwFlag != pWidget->GetFlags())
- {
- pWidget->SetFlags(dwFlag);
- UpdateFormControl(pDocument, pFormControl, TRUE, FALSE, TRUE);
- }
- }
- }
- }
- }
-}
-
-FX_BOOL Field::doc(OBJ_PROP_PARAMS)
-{
- ASSERT(m_pJSDoc != NULL);
-
- if (!vp.IsGetting())return FALSE;
-
- vp << (CJS_Object*)(*m_pJSDoc);
-
- return TRUE;
-}
-
-FX_BOOL Field::editable(OBJ_PROP_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- if (vp.IsSetting())
- {
- if (!m_bCanSet) return FALSE;
-
- bool bVP;
- vp >> bVP;
-
- }
- else
- {
- CFX_PtrArray FieldArray;
- GetFormFields(m_FieldName, FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
-
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
- ASSERT(pFormField != NULL);
-
- if (pFormField->GetFieldType() != FIELDTYPE_COMBOBOX)
- return FALSE;
-
- if (pFormField->GetFieldFlags() & FIELDFLAG_EDIT)
- vp << true;
- else
- vp << false;
- }
-
- return TRUE;
-}
-
-FX_BOOL Field::exportValues(OBJ_PROP_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- CFX_PtrArray FieldArray;
- GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
-
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
- ASSERT(pFormField != NULL);
-
- if (pFormField->GetFieldType() != FIELDTYPE_CHECKBOX &&
- pFormField->GetFieldType() != FIELDTYPE_RADIOBUTTON)
- return FALSE;
-
- if (vp.IsSetting())
- {
- if (!m_bCanSet) return FALSE;
- if (!vp.IsArrayObject())return FALSE;
- }
- else
- {
- CJS_Array ExportValusArray(m_isolate);
-
- if (m_nFormControlIndex < 0)
- {
- for (int i=0,sz=pFormField->CountControls(); i<sz; i++)
- {
- CPDF_FormControl* pFormControl = pFormField->GetControl(i);
- ASSERT(pFormControl != NULL);
-
- ExportValusArray.SetElement(i, CJS_Value(m_isolate,(FX_LPCWSTR)pFormControl->GetExportValue()));
- }
- }
- else
- {
- if(m_nFormControlIndex >= pFormField->CountControls()) return FALSE;
- CPDF_FormControl* pFormControl = pFormField->GetControl(m_nFormControlIndex);
- if (!pFormControl) return FALSE;
-
- ExportValusArray.SetElement(0, CJS_Value(m_isolate,(FX_LPCWSTR)pFormControl->GetExportValue()));
- }
-
- vp << ExportValusArray;
- }
-
- return TRUE;
-}
-
-FX_BOOL Field::fileSelect(OBJ_PROP_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- CFX_PtrArray FieldArray;
- GetFormFields(m_FieldName, FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
-
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
- ASSERT(pFormField != NULL);
-
- if (pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD)
- return FALSE;
-
- if (vp.IsSetting())
- {
- if (!m_bCanSet) return FALSE;
-
- bool bVP;
- vp >> bVP;
-
- }
- else
- {
- if (pFormField->GetFieldFlags() & FIELDFLAG_FILESELECT)
- vp << true;
- else
- vp << false;
- }
-
- return TRUE;
-}
-
-FX_BOOL Field::fillColor(OBJ_PROP_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- CJS_Array crArray(m_isolate);
-
- CFX_PtrArray FieldArray;
- GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
-
- if (vp.IsSetting())
- {
- if (!m_bCanSet) return FALSE;
- if (!vp.IsArrayObject()) return FALSE;
-
- vp >> crArray;
-
- CPWL_Color color;
- color::ConvertArrayToPWLColor(crArray, color);
-
- if (m_bDelay)
- {
- AddDelay_Color(FP_FILLCOLOR, color);
- }
- else
- {
- Field::SetFillColor(m_pDocument, m_FieldName, m_nFormControlIndex, color);
- }
- }
- else
- {
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
- ASSERT(pFormField != NULL);
-
- CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
- if (!pFormControl)return FALSE;
-
- int iColorType;
- pFormControl->GetBackgroundColor(iColorType);
-
- CPWL_Color color;
-
- if (iColorType == COLORTYPE_TRANSPARENT)
- {
- color = CPWL_Color(COLORTYPE_TRANSPARENT);
- }
- else if (iColorType == COLORTYPE_GRAY)
- {
- color = CPWL_Color(COLORTYPE_GRAY, pFormControl->GetOriginalBackgroundColor(0));
- }
- else if (iColorType == COLORTYPE_RGB)
- {
- color = CPWL_Color(COLORTYPE_RGB, pFormControl->GetOriginalBackgroundColor(0),
- pFormControl->GetOriginalBackgroundColor(1),
- pFormControl->GetOriginalBackgroundColor(2));
- }
- else if (iColorType == COLORTYPE_CMYK)
- {
- color = CPWL_Color(COLORTYPE_CMYK, pFormControl->GetOriginalBackgroundColor(0),
- pFormControl->GetOriginalBackgroundColor(1),
- pFormControl->GetOriginalBackgroundColor(2),
- pFormControl->GetOriginalBackgroundColor(3));
- }
- else
- return FALSE;
-
- color::ConvertPWLColorToArray(color, crArray);
- vp << crArray;
- }
-
- return TRUE;
-}
-
-void Field::SetFillColor(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CPWL_Color& color)
-{
- //Not supported.
-}
-
-FX_BOOL Field::hidden(OBJ_PROP_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- if (vp.IsSetting())
- {
- if (!m_bCanSet) return FALSE;
-
- bool bVP;
- vp >> bVP;
-
- if (m_bDelay)
- {
- AddDelay_Bool(FP_HIDDEN, bVP);
- }
- else
- {
- Field::SetHidden(m_pDocument, m_FieldName, m_nFormControlIndex, bVP);
- }
- }
- else
- {
- CFX_PtrArray FieldArray;
- GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
-
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
- ASSERT(pFormField != NULL);
-
- CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInterForm();
- ASSERT(pInterForm != NULL);
-
- CPDFSDK_Widget* pWidget = pInterForm->GetWidget(GetSmartFieldControl(pFormField));
- if (!pWidget) return FALSE;
-
- FX_DWORD dwFlags = pWidget->GetFlags();
-
- if (ANNOTFLAG_INVISIBLE & dwFlags || ANNOTFLAG_HIDDEN & dwFlags)
- {
- vp << true;
- }
- else
- vp << false;
- }
-
- return TRUE;
-}
-
-void Field::SetHidden(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b)
-{
- ASSERT(pDocument != NULL);
-
- CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pDocument->GetInterForm();
- ASSERT(pInterForm != NULL);
-
- CFX_PtrArray FieldArray;
- GetFormFields(pDocument, swFieldName, FieldArray);
-
- for (int i=0,isz=FieldArray.GetSize(); i<isz; i++)
- {
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(i);
- ASSERT(pFormField != NULL);
-
- if (nControlIndex < 0)
- {
- FX_BOOL bSet = FALSE;
- for (int j=0,jsz = pFormField->CountControls(); j<jsz; j++)
- {
- if (CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormField->GetControl(j)))
- {
- FX_DWORD dwFlags = pWidget->GetFlags();
-
- if (b)
- {
- dwFlags &= (~ANNOTFLAG_INVISIBLE);
- dwFlags &= (~ANNOTFLAG_NOVIEW);
- dwFlags |= (ANNOTFLAG_HIDDEN | ANNOTFLAG_PRINT);
- }
- else
- {
- dwFlags &= (~ANNOTFLAG_INVISIBLE);
- dwFlags &= (~ANNOTFLAG_HIDDEN);
- dwFlags &= (~ANNOTFLAG_NOVIEW);
- dwFlags |= ANNOTFLAG_PRINT;
- }
-
- if (dwFlags != pWidget->GetFlags())
- {
- pWidget->SetFlags(dwFlags);
- bSet = TRUE;
- }
- }
- }
-
- if (bSet)
- UpdateFormField(pDocument, pFormField, TRUE, FALSE, TRUE);
- }
- else
- {
- if(nControlIndex >= pFormField->CountControls()) return;
- if (CPDF_FormControl* pFormControl = pFormField->GetControl(nControlIndex))
- {
- if (CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormControl))
- {
- FX_DWORD dwFlags = pWidget->GetFlags();
-
- if (b)
- {
- dwFlags &= (~ANNOTFLAG_INVISIBLE);
- dwFlags &= (~ANNOTFLAG_NOVIEW);
- dwFlags |= (ANNOTFLAG_HIDDEN | ANNOTFLAG_PRINT);
- }
- else
- {
- dwFlags &= (~ANNOTFLAG_INVISIBLE);
- dwFlags &= (~ANNOTFLAG_HIDDEN);
- dwFlags &= (~ANNOTFLAG_NOVIEW);
- dwFlags |= ANNOTFLAG_PRINT;
- }
-
- if (dwFlags != pWidget->GetFlags())
- {
- pWidget->SetFlags(dwFlags);
- UpdateFormControl(pDocument, pFormControl, TRUE, FALSE, TRUE);
- }
- }
- }
- }
- }
-}
-
-FX_BOOL Field::highlight(OBJ_PROP_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- if (vp.IsSetting())
- {
- if (!m_bCanSet) return FALSE;
-
- CFX_ByteString strMode;
- vp >> strMode;
-
- if (m_bDelay)
- {
- AddDelay_String(FP_HIGHLIGHT, strMode);
- }
- else
- {
- Field::SetHighlight(m_pDocument, m_FieldName, m_nFormControlIndex, strMode);
- }
- }
- else
- {
- CFX_PtrArray FieldArray;
- GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
-
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
- ASSERT(pFormField != NULL);
-
- if (pFormField->GetFieldType() != FIELDTYPE_PUSHBUTTON)
- return FALSE;
-
- CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
- if (!pFormControl) return FALSE;
-
- int eHM = pFormControl->GetHighlightingMode();
- switch (eHM)
- {
- case CPDF_FormControl::None:
- vp << (FX_LPCWSTR)L"none";
- break;
- case CPDF_FormControl::Push:
- vp << (FX_LPCWSTR)L"push";
- break;
- case CPDF_FormControl::Invert:
- vp << (FX_LPCWSTR)L"invert";
- break;
- case CPDF_FormControl::Outline:
- vp << (FX_LPCWSTR)L"outline";
- break;
- case CPDF_FormControl::Toggle:
- vp << (FX_LPCWSTR)L"toggle";
- break;
- }
- }
-
- return TRUE;
-}
-
-void Field::SetHighlight(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CFX_ByteString& string)
-{
- //Not supported.
-}
-
-FX_BOOL Field::lineWidth(OBJ_PROP_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- if (vp.IsSetting())
- {
- if (!m_bCanSet) return FALSE;
-
- int iWidth;
- vp >> iWidth;
-
- if (m_bDelay)
- {
- AddDelay_Int(FP_LINEWIDTH, iWidth);
- }
- else
- {
- Field::SetLineWidth(m_pDocument, m_FieldName, m_nFormControlIndex, iWidth);
- }
- }
- else
- {
- CFX_PtrArray FieldArray;
- GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
-
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
- ASSERT(pFormField != NULL);
-
- CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
- if (!pFormControl) return FALSE;
-
- CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInterForm();
- ASSERT(pInterForm != NULL);
-
- if(!pFormField->CountControls()) return FALSE;
-
- CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormField->GetControl(0));
- if (!pWidget) return FALSE;
-
- vp << (FX_INT32)pWidget->GetBorderWidth();
- }
-
- return TRUE;
-}
-
-void Field::SetLineWidth(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number)
-{
- ASSERT(pDocument != NULL);
-
- CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pDocument->GetInterForm();
- ASSERT(pInterForm != NULL);
-
- CFX_PtrArray FieldArray;
- GetFormFields(pDocument, swFieldName, FieldArray);
-
- for (int i=0,isz=FieldArray.GetSize(); i<isz; i++)
- {
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(i);
- ASSERT(pFormField != NULL);
-
- if (nControlIndex < 0)
- {
- FX_BOOL bSet = FALSE;
- for (int j=0,jsz=pFormField->CountControls(); j<jsz; j++)
- {
- CPDF_FormControl* pFormControl = pFormField->GetControl(j);
- ASSERT(pFormControl != NULL);
-
- if (CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormControl))
- {
- if (number != pWidget->GetBorderWidth())
- {
- pWidget->SetBorderWidth(number);
- bSet = TRUE;
- }
- }
- }
- if (bSet) UpdateFormField(pDocument, pFormField, TRUE, TRUE, TRUE);
- }
- else
- {
- if(nControlIndex >= pFormField->CountControls()) return;
- if (CPDF_FormControl* pFormControl = pFormField->GetControl(nControlIndex))
- {
- if (CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormControl))
- {
- if (number != pWidget->GetBorderWidth())
- {
- pWidget->SetBorderWidth(number);
- UpdateFormControl(pDocument, pFormControl, TRUE, TRUE, TRUE);
- }
- }
- }
- }
- }
-}
-
-FX_BOOL Field::multiline(OBJ_PROP_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- if (vp.IsSetting())
- {
- if (!m_bCanSet) return FALSE;
-
- bool bVP;
- vp >> bVP;
-
- if (m_bDelay)
- {
- AddDelay_Bool(FP_MULTILINE, bVP);
- }
- else
- {
- Field::SetMultiline(m_pDocument, m_FieldName, m_nFormControlIndex, bVP);
- }
- }
- else
- {
- CFX_PtrArray FieldArray;
- GetFormFields(m_FieldName, FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
-
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
- ASSERT(pFormField != NULL);
-
- if (pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD)
- return FALSE;
-
- if (pFormField->GetFieldFlags() & FIELDFLAG_MULTILINE)
- vp << true;
- else
- vp << false;
- }
-
- return TRUE;
-}
-
-void Field::SetMultiline(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b)
-{
- //Not supported.
-}
-
-FX_BOOL Field::multipleSelection(OBJ_PROP_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- if (vp.IsSetting())
- {
- if (!m_bCanSet) return FALSE;
-
- bool bVP;
- vp >> bVP;
-
- if (m_bDelay)
- {
- AddDelay_Bool(FP_MULTIPLESELECTION, bVP);
- }
- else
- {
- Field::SetMultipleSelection(m_pDocument, m_FieldName, m_nFormControlIndex, bVP);
- }
- }
- else
- {
- CFX_PtrArray FieldArray;
- GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
-
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
- ASSERT(pFormField != NULL);
-
- if (pFormField->GetFieldType() != FIELDTYPE_LISTBOX)
- return FALSE;
-
- if (pFormField->GetFieldFlags() & FIELDFLAG_MULTISELECT)
- vp << true;
- else
- vp << false;
- }
-
- return TRUE;
-}
-
-void Field::SetMultipleSelection(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b)
-{
- //Not supported.
-}
-
-FX_BOOL Field::name(OBJ_PROP_PARAMS)
-{
- if (!vp.IsGetting()) return FALSE;
-
- CFX_PtrArray FieldArray;
- GetFormFields(m_FieldName, FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
-
- vp << m_FieldName;
-
- return TRUE;
-}
-
-FX_BOOL Field::numItems(OBJ_PROP_PARAMS)
-{
- CFX_PtrArray FieldArray;
- GetFormFields(m_FieldName, FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
-
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
- ASSERT(pFormField != NULL);
-
- if (pFormField->GetFieldType() != FIELDTYPE_COMBOBOX &&
- pFormField->GetFieldType() != FIELDTYPE_LISTBOX)
- return FALSE;
-
- if (!vp.IsGetting()) return FALSE;
-
- vp << (FX_INT32)pFormField->CountOptions();
-
- return TRUE;
-}
-
-FX_BOOL Field::page(OBJ_PROP_PARAMS)
-{
- if (!vp.IsGetting()) return FALSE;
-
- CFX_PtrArray FieldArray;
- GetFormFields(m_FieldName, FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
-
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
- if (!pFormField) return FALSE;
-
- ASSERT(m_pDocument != NULL);
-
- CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInterForm();
- ASSERT(pInterForm != NULL);
-
- CFX_PtrArray widgetArray;
- pInterForm->GetWidgets(pFormField, widgetArray);
-
- if (widgetArray.GetSize() > 0)
- {
- CJS_Array PageArray(m_isolate);
-
- for (int i=0,sz=widgetArray.GetSize(); i<sz; i++)
- {
- CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)widgetArray.GetAt(i);
- ASSERT(pWidget != NULL);
-
- CPDFSDK_PageView* pPageView = pWidget->GetPageView();
- if(!pPageView)
- return FALSE;
-
- PageArray.SetElement(i, CJS_Value(m_isolate,(FX_INT32)pPageView->GetPageIndex()));
- }
-
- vp << PageArray;
- }
- else
- {
- vp << (FX_INT32) -1;
- }
-
- return TRUE;
-}
-
-FX_BOOL Field::password(OBJ_PROP_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- if (vp.IsSetting())
- {
- if (!m_bCanSet) return FALSE;
-
- bool bVP;
- vp >> bVP;
-
- if (m_bDelay)
- {
- AddDelay_Bool(FP_PASSWORD, bVP);
- }
- else
- {
- Field::SetPassword(m_pDocument, m_FieldName, m_nFormControlIndex, bVP);
- }
- }
- else
- {
- CFX_PtrArray FieldArray;
- GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
-
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
- ASSERT(pFormField != NULL);
-
- if (pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD)
- return FALSE;
-
- if (pFormField->GetFieldFlags() & FIELDFLAG_PASSWORD)
- vp << true;
- else
- vp << false;
- }
-
- return TRUE;
-}
-
-void Field::SetPassword(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b)
-{
- //Not supported.
-}
-
-FX_BOOL Field::print(OBJ_PROP_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInterForm();
- ASSERT(pInterForm != NULL);
-
- CFX_PtrArray FieldArray;
- GetFormFields(m_FieldName, FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
-
- if (vp.IsSetting())
- {
- if (!m_bCanSet) return FALSE;
-
- bool bVP;
- vp >> bVP;
-
- for (int i=0,isz=FieldArray.GetSize(); i<isz; i++)
- {
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(i);
- ASSERT(pFormField != NULL);
-
- if (m_nFormControlIndex < 0)
- {
- FX_BOOL bSet = FALSE;
- for (int j=0,jsz = pFormField->CountControls(); j<jsz; j++)
- {
- if (CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormField->GetControl(j)))
- {
- FX_DWORD dwFlags = pWidget->GetFlags();
- if (bVP)
- dwFlags |= ANNOTFLAG_PRINT;
- else
- dwFlags &= ~ANNOTFLAG_PRINT;
-
- if (dwFlags != pWidget->GetFlags())
- {
- pWidget->SetFlags(dwFlags);
- bSet = TRUE;
- }
- }
- }
-
- if (bSet)
- UpdateFormField(m_pDocument, pFormField, TRUE, FALSE, TRUE);
- }
- else
- {
- if(m_nFormControlIndex >= pFormField->CountControls()) return FALSE;
- if (CPDF_FormControl* pFormControl = pFormField->GetControl(m_nFormControlIndex))
- {
- if (CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormControl))
- {
- FX_DWORD dwFlags = pWidget->GetFlags();
- if (bVP)
- dwFlags |= ANNOTFLAG_PRINT;
- else
- dwFlags &= ~ANNOTFLAG_PRINT;
-
- if (dwFlags != pWidget->GetFlags())
- {
- pWidget->SetFlags(dwFlags);
- UpdateFormControl(m_pDocument, pFormField->GetControl(m_nFormControlIndex), TRUE, FALSE, TRUE);
- }
- }
- }
- }
- }
- }
- else
- {
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
- ASSERT(pFormField != NULL);
-
- CPDFSDK_Widget* pWidget = pInterForm->GetWidget(GetSmartFieldControl(pFormField));
- if (!pWidget) return FALSE;
-
- if (pWidget->GetFlags() & ANNOTFLAG_PRINT)
- vp << true;
- else
- vp << false;
- }
-
- return TRUE;
-}
-
-FX_BOOL Field::radiosInUnison(OBJ_PROP_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- CFX_PtrArray FieldArray;
- GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
-
- if (vp.IsSetting())
- {
- if (!m_bCanSet) return FALSE;
-
- bool bVP;
- vp >> bVP;
-
- }
- else
- {
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
- ASSERT(pFormField != NULL);
-
- if (pFormField->GetFieldType() != FIELDTYPE_RADIOBUTTON)
- return FALSE;
-
- if (pFormField->GetFieldFlags() & FIELDFLAG_RADIOSINUNISON)
- vp << true;
- else
- vp << false;
- }
-
- return TRUE;
-}
-
-FX_BOOL Field::readonly(OBJ_PROP_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- CFX_PtrArray FieldArray;
- GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
-
- if (vp.IsSetting())
- {
- if (!m_bCanSet) return FALSE;
-
- bool bVP;
- vp >> bVP;
-
- }
- else
- {
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
- ASSERT(pFormField != NULL);
-
- if (pFormField->GetFieldFlags() & FIELDFLAG_READONLY)
- vp << true;
- else
- vp << false;
- }
-
- return TRUE;
-}
-
-FX_BOOL Field::rect(OBJ_PROP_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- if (vp.IsSetting())
- {
- if (!m_bCanSet) return FALSE;
- if (!vp.IsArrayObject())return FALSE;
-
- CJS_Array rcArray(m_isolate);
- vp >> rcArray;
- CJS_Value Upper_Leftx(m_isolate), Upper_Lefty(m_isolate), Lower_Rightx(m_isolate), Lower_Righty(m_isolate);
- rcArray.GetElement(0, Upper_Leftx);
- rcArray.GetElement(1, Upper_Lefty);
- rcArray.GetElement(2, Lower_Rightx);
- rcArray.GetElement(3, Lower_Righty);
-
- FX_FLOAT pArray[4] = {0.0f,0.0f,0.0f,0.0f};
- pArray[0] = (FX_FLOAT)(FX_INT32)Upper_Leftx;
- pArray[1] = (FX_FLOAT)(FX_INT32)Lower_Righty;
- pArray[2] = (FX_FLOAT)(FX_INT32)Lower_Rightx;
- pArray[3] = (FX_FLOAT)(FX_INT32)Upper_Lefty;
-
- CPDF_Rect crRect(pArray);
-
- if (m_bDelay)
- {
- AddDelay_Rect(FP_RECT, crRect);
- }
- else
- {
- Field::SetRect(m_pDocument, m_FieldName, m_nFormControlIndex, crRect);
- }
- }
- else
- {
- CFX_PtrArray FieldArray;
- GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
-
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
- ASSERT(pFormField != NULL);
-
- CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInterForm();
- ASSERT(pInterForm != NULL);
-
- CPDFSDK_Widget* pWidget = pInterForm->GetWidget(GetSmartFieldControl(pFormField));
- if (!pWidget) return FALSE;
-
- CFX_FloatRect crRect = pWidget->GetRect();
- CJS_Value Upper_Leftx(m_isolate),Upper_Lefty(m_isolate),Lower_Rightx(m_isolate),Lower_Righty(m_isolate);
- Upper_Leftx = (FX_INT32)crRect.left;
- Upper_Lefty = (FX_INT32)crRect.top;
- Lower_Rightx = (FX_INT32)crRect.right;
- Lower_Righty = (FX_INT32)crRect.bottom;
-
- CJS_Array rcArray(m_isolate);
- rcArray.SetElement(0,Upper_Leftx);
- rcArray.SetElement(1,Upper_Lefty);
- rcArray.SetElement(2,Lower_Rightx);
- rcArray.SetElement(3,Lower_Righty);
-
- vp << rcArray;
- }
-
- return TRUE;
-}
-
-void Field::SetRect(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CPDF_Rect& rect)
-{
- ASSERT(pDocument != NULL);
-
- CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pDocument->GetInterForm();
- ASSERT(pInterForm != NULL);
-
- CFX_PtrArray FieldArray;
- GetFormFields(pDocument, swFieldName, FieldArray);
-
- for (int i=0,isz=FieldArray.GetSize(); i<isz; i++)
- {
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(i);
- ASSERT(pFormField != NULL);
-
- if (nControlIndex < 0)
- {
- FX_BOOL bSet = FALSE;
- for (int i=0, sz=pFormField->CountControls(); i<sz; i++)
- {
- CPDF_FormControl* pFormControl = pFormField->GetControl(i);
- ASSERT(pFormControl != NULL);
-
- if (CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormControl))
- {
- CPDF_Rect crRect = rect;
-
- CPDF_Page* pPDFPage = pWidget->GetPDFPage();
- ASSERT(pPDFPage != NULL);
-
-// CPDF_Page* pPDFPage = pPage->GetPage();
-// ASSERT(pPDFPage != NULL);
-
- crRect.Intersect(pPDFPage->GetPageBBox());
-
- if (!crRect.IsEmpty())
- {
- CPDF_Rect rcOld = pWidget->GetRect();
- if (crRect.left != rcOld.left ||
- crRect.right != rcOld.right ||
- crRect.top != rcOld.top ||
- crRect.bottom != rcOld.bottom)
- {
- pWidget->SetRect(crRect);
- bSet = TRUE;
- }
- }
- }
- }
-
- if (bSet) UpdateFormField(pDocument, pFormField, TRUE, TRUE, TRUE);
- }
- else
- {
- if(nControlIndex >= pFormField->CountControls()) return;
- if (CPDF_FormControl* pFormControl = pFormField->GetControl(nControlIndex))
- {
- if (CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormControl))
- {
- CPDF_Rect crRect = rect;
-
- CPDF_Page* pPDFPage = pWidget->GetPDFPage();
- ASSERT(pPDFPage != NULL);
-
-// CPDF_Page* pPDFPage = pPage->GetPage();
-// ASSERT(pPDFPage != NULL);
-
- crRect.Intersect(pPDFPage->GetPageBBox());
-
- if (!crRect.IsEmpty())
- {
- CPDF_Rect rcOld = pWidget->GetRect();
- if (crRect.left != rcOld.left ||
- crRect.right != rcOld.right ||
- crRect.top != rcOld.top ||
- crRect.bottom != rcOld.bottom)
- {
- pWidget->SetRect(crRect);
- UpdateFormControl(pDocument, pFormControl, TRUE, TRUE, TRUE);
- }
- }
- }
- }
- }
- }
-}
-
-FX_BOOL Field::required(OBJ_PROP_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- CFX_PtrArray FieldArray;
- GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
-
- if (vp.IsSetting())
- {
- if (!m_bCanSet) return FALSE;
-
-
- bool bVP;
- vp >> bVP;
-
- }
- else
- {
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
- ASSERT(pFormField != NULL);
-
- if (pFormField->GetFieldType() == FIELDTYPE_PUSHBUTTON)
- return FALSE;
-
- if (pFormField->GetFieldFlags() & FIELDFLAG_REQUIRED)
- vp << true;
- else
- vp << false;
- }
-
- return TRUE;
-}
-
-FX_BOOL Field::richText(OBJ_PROP_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- if (vp.IsSetting())
- {
- if (!m_bCanSet) return FALSE;
-
- bool bVP;
- vp >> bVP;
-
- if (m_bDelay)
- {
- AddDelay_Bool(FP_RICHTEXT, bVP);
- }
- else
- {
- Field::SetRichText(m_pDocument, m_FieldName, m_nFormControlIndex, bVP);
- }
- }
- else
- {
- CFX_PtrArray FieldArray;
- GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
-
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
- ASSERT(pFormField != NULL);
-
- if (pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD)
- return FALSE;
-
- if (pFormField->GetFieldFlags() & FIELDFLAG_RICHTEXT)
- vp << true;
- else
- vp << false;
- }
-
- return TRUE;
-}
-
-void Field::SetRichText(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b)
-{
- //Not supported.
-}
-
-FX_BOOL Field::richValue(OBJ_PROP_PARAMS)
-{
- return TRUE;
- if (vp.IsSetting())
- {
- if (!m_bCanSet) return FALSE;
- ;
- }
- else
- {
- ;
- }
- return TRUE;
-}
-
-void Field::SetRichValue(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex)
-{
- //Not supported.
-}
-
-FX_BOOL Field::rotation(OBJ_PROP_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- if (vp.IsSetting())
- {
- if (!m_bCanSet) return FALSE;
-
- int nVP;
- vp >> nVP;
-
- if (m_bDelay)
- {
- AddDelay_Int(FP_ROTATION, nVP);
- }
- else
- {
- Field::SetRotation(m_pDocument, m_FieldName, m_nFormControlIndex, nVP);
- }
- }
- else
- {
- CFX_PtrArray FieldArray;
- GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
-
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
- ASSERT(pFormField != NULL);
-
- CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
- if (!pFormControl)return FALSE;
-
- vp << (FX_INT32)pFormControl->GetRotation();
- }
-
- return TRUE;
-}
-
-void Field::SetRotation(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number)
-{
- //Not supported.
-}
-
-FX_BOOL Field::strokeColor(OBJ_PROP_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- if (vp.IsSetting())
- {
- if (!m_bCanSet) return FALSE;
-
- if (!vp.IsArrayObject())return FALSE;
-
- CJS_Array crArray(m_isolate);
- vp >> crArray;
-
- CPWL_Color color;
- color::ConvertArrayToPWLColor(crArray, color);
-
- if (m_bDelay)
- {
- AddDelay_Color(FP_STROKECOLOR, color);
- }
- else
- {
- Field::SetStrokeColor(m_pDocument, m_FieldName, m_nFormControlIndex, color);
- }
- }
- else
- {
- CFX_PtrArray FieldArray;
- GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
-
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
- ASSERT(pFormField != NULL);
-
- CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
- if (!pFormControl)return FALSE;
-
- int iColorType;
- pFormControl->GetBorderColor(iColorType);
-
- CPWL_Color color;
-
- if (iColorType == COLORTYPE_TRANSPARENT)
- {
- color = CPWL_Color(COLORTYPE_TRANSPARENT);
- }
- else if (iColorType == COLORTYPE_GRAY)
- {
- color = CPWL_Color(COLORTYPE_GRAY, pFormControl->GetOriginalBorderColor(0));
- }
- else if (iColorType == COLORTYPE_RGB)
- {
- color = CPWL_Color(COLORTYPE_RGB, pFormControl->GetOriginalBorderColor(0),
- pFormControl->GetOriginalBorderColor(1),
- pFormControl->GetOriginalBorderColor(2));
- }
- else if (iColorType == COLORTYPE_CMYK)
- {
- color = CPWL_Color(COLORTYPE_CMYK, pFormControl->GetOriginalBorderColor(0),
- pFormControl->GetOriginalBorderColor(1),
- pFormControl->GetOriginalBorderColor(2),
- pFormControl->GetOriginalBorderColor(3));
- }
- else
- return FALSE;
-
- CJS_Array crArray(m_isolate);
- color::ConvertPWLColorToArray(color, crArray);
- vp << crArray;
- }
-
- return TRUE;
-}
-
-void Field::SetStrokeColor(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CPWL_Color& color)
-{
- //Not supported.
-}
-
-FX_BOOL Field::style(OBJ_PROP_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- if (vp.IsSetting())
- {
- if (!m_bCanSet) return FALSE;
-
- CFX_ByteString csBCaption;
- vp >> csBCaption;
-
- if (m_bDelay)
- {
- AddDelay_String(FP_STYLE, csBCaption);
- }
- else
- {
- Field::SetStyle(m_pDocument, m_FieldName, m_nFormControlIndex, csBCaption);
- }
- }
- else
- {
- CFX_PtrArray FieldArray;
- GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
-
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
- ASSERT(pFormField != NULL);
-
- if (pFormField->GetFieldType() != FIELDTYPE_RADIOBUTTON &&
- pFormField->GetFieldType() != FIELDTYPE_CHECKBOX)
- return FALSE;
-
- CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
- if (!pFormControl) return FALSE;
-
- CFX_WideString csWCaption = pFormControl->GetNormalCaption();
- CFX_ByteString csBCaption;
-
- switch (csWCaption[0])
- {
- case L'l':
- csBCaption = "circle";
- break;
- case L'8':
- csBCaption = "cross";
- break;
- case L'u':
- csBCaption = "diamond";
- break;
- case L'n':
- csBCaption = "square";
- break;
- case L'H':
- csBCaption = "star";
- break;
- default: //L'4'
- csBCaption = "check";
- break;
- }
- vp << csBCaption;
- }
-
- return TRUE;
-}
-
-void Field::SetStyle(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex,
- const CFX_ByteString& string)
-{
- //Not supported.
-}
-
-FX_BOOL Field::submitName(OBJ_PROP_PARAMS)
-{
- return TRUE;
-}
-
-FX_BOOL Field::textColor(OBJ_PROP_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- if (vp.IsSetting())
- {
- if (!m_bCanSet) return FALSE;
-
- CJS_Array crArray(m_isolate);
- if (!vp.IsArrayObject())return FALSE;
- vp >> crArray;
-
- CPWL_Color color;
- color::ConvertArrayToPWLColor(crArray, color);
-
- if (m_bDelay)
- {
- AddDelay_Color(FP_TEXTCOLOR, color);
- }
- else
- {
- Field::SetTextColor(m_pDocument, m_FieldName, m_nFormControlIndex, color);
- }
- }
- else
- {
- CFX_PtrArray FieldArray;
- GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
-
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
- ASSERT(pFormField != NULL);
-
- CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
- if (!pFormControl)return FALSE;
-
- int iColorType;
- FX_ARGB color;
- CPDF_DefaultAppearance FieldAppearance = pFormControl->GetDefaultAppearance();
- FieldAppearance.GetColor(color, iColorType);
- FX_INT32 a,r,g,b;
- ArgbDecode(color, a, r, g, b);
-
- CPWL_Color crRet = CPWL_Color(COLORTYPE_RGB, r / 255.0f,
- g / 255.0f,
- b / 255.0f);
-
- if (iColorType == COLORTYPE_TRANSPARENT)
- crRet = CPWL_Color(COLORTYPE_TRANSPARENT);
-
- CJS_Array crArray(m_isolate);
- color::ConvertPWLColorToArray(crRet, crArray);
- vp << crArray;
- }
-
- return TRUE;
-}
-
-void Field::SetTextColor(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CPWL_Color& color)
-{
- //Not supported.
-}
-
-FX_BOOL Field::textFont(OBJ_PROP_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- if (vp.IsSetting())
- {
- if (!m_bCanSet) return FALSE;
-
- CFX_ByteString csFontName;
- vp >> csFontName;
- if (csFontName.IsEmpty()) return FALSE;
-
- if (m_bDelay)
- {
- AddDelay_String(FP_TEXTFONT, csFontName);
- }
- else
- {
- Field::SetTextFont(m_pDocument, m_FieldName, m_nFormControlIndex, csFontName);
- }
- }
- else
- {
- CFX_PtrArray FieldArray;
- GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
-
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
- ASSERT(pFormField != NULL);
-
- CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
- if (!pFormControl)return FALSE;
-
- int nFieldType = pFormField->GetFieldType();
-
- if (nFieldType == FIELDTYPE_PUSHBUTTON ||
- nFieldType == FIELDTYPE_COMBOBOX ||
- nFieldType == FIELDTYPE_LISTBOX ||
- nFieldType == FIELDTYPE_TEXTFIELD)
- {
- CPDF_Font * pFont = pFormControl->GetDefaultControlFont();
- if (!pFont) return FALSE;
-
- vp << pFont->GetBaseFont();
- }
- else
- return FALSE;
- }
-
- return TRUE;
-}
-
-void Field::SetTextFont(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CFX_ByteString& string)
-{
- //Not supported.
-}
-
-FX_BOOL Field::textSize(OBJ_PROP_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- if (vp.IsSetting())
- {
- if (!m_bCanSet) return FALSE;
-
- int nVP;
- vp >> nVP;
-
- if (m_bDelay)
- {
- AddDelay_Int(FP_TEXTSIZE, nVP);
- }
- else
- {
- Field::SetTextSize(m_pDocument, m_FieldName, m_nFormControlIndex, nVP);
- }
- }
- else
- {
- CFX_PtrArray FieldArray;
- GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
-
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
- ASSERT(pFormField != NULL);
-
- CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
- if (!pFormControl)return FALSE;
-
- CPDF_DefaultAppearance FieldAppearance = pFormControl->GetDefaultAppearance();
-
- CFX_ByteString csFontNameTag;
- FX_FLOAT fFontSize;
- FieldAppearance.GetFont(csFontNameTag,fFontSize);
-
- vp << (int)fFontSize;
- }
-
- return TRUE;
-}
-
-void Field::SetTextSize(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number)
-{
- //Not supported.
-}
-
-FX_BOOL Field::type(OBJ_PROP_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- if (!vp.IsGetting()) return FALSE;
-
- CFX_PtrArray FieldArray;
- GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
-
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
- ASSERT(pFormField != NULL);
-
- switch (pFormField->GetFieldType())
- {
- case FIELDTYPE_UNKNOWN:
- vp << (FX_LPCWSTR)L"unknown";
- break;
- case FIELDTYPE_PUSHBUTTON:
- vp << (FX_LPCWSTR)L"button";
- break;
- case FIELDTYPE_CHECKBOX:
- vp << (FX_LPCWSTR)L"checkbox";
- break;
- case FIELDTYPE_RADIOBUTTON:
- vp << (FX_LPCWSTR)L"radiobutton";
- break;
- case FIELDTYPE_COMBOBOX:
- vp << (FX_LPCWSTR)L"combobox";
- break;
- case FIELDTYPE_LISTBOX:
- vp << (FX_LPCWSTR)L"listbox";
- break;
- case FIELDTYPE_TEXTFIELD:
- vp << (FX_LPCWSTR)L"text";
- break;
- case FIELDTYPE_SIGNATURE:
- vp << (FX_LPCWSTR)L"signature";
- break;
- default :
- vp << (FX_LPCWSTR)L"unknown";
- break;
- }
-
- return TRUE;
-}
-
-FX_BOOL Field::userName(OBJ_PROP_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- if (vp.IsSetting())
- {
- if (!m_bCanSet) return FALSE;
-
- CFX_WideString swName;
- vp >> swName;
-
- if (m_bDelay)
- {
- AddDelay_WideString(FP_USERNAME, swName);
- }
- else
- {
- Field::SetUserName(m_pDocument, m_FieldName, m_nFormControlIndex, swName);
- }
- }
- else
- {
- CFX_PtrArray FieldArray;
- GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
-
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
- ASSERT(pFormField != NULL);
-
- vp << (CFX_WideString)pFormField->GetAlternateName();
- }
-
- return TRUE;
-}
-
-void Field::SetUserName(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CFX_WideString& string)
-{
- //Not supported.
-}
-
-FX_BOOL Field::value(OBJ_PROP_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- if (vp.IsSetting())
- {
- if (!m_bCanSet) return FALSE;
-
- CJS_WideStringArray strArray;
-
- if (vp.IsArrayObject())
- {
- CJS_Array ValueArray(m_isolate);
- vp.ConvertToArray(ValueArray);
- for (int i = 0,sz = ValueArray.GetLength(); i < sz; i++)
- {
- CJS_Value ElementValue(m_isolate);
- ValueArray.GetElement(i, ElementValue);
- strArray.Add(ElementValue.operator CFX_WideString());
- }
- }
- else
- {
- CFX_WideString swValue;
- vp >> swValue;
-
- strArray.Add(swValue);
- }
-
- if (m_bDelay)
- {
- AddDelay_WideStringArray(FP_VALUE, strArray);
- }
- else
- {
- Field::SetValue(m_pDocument, m_FieldName, m_nFormControlIndex, strArray);
- }
- }
- else
- {
- CFX_PtrArray FieldArray;
- GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
-
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
- ASSERT(pFormField != NULL);
-
-
-
- switch (pFormField->GetFieldType())
- {
- case FIELDTYPE_PUSHBUTTON:
- return FALSE;
- case FIELDTYPE_COMBOBOX:
- case FIELDTYPE_TEXTFIELD:
- {
- CFX_WideString swValue = pFormField->GetValue();
-
- double dRet;
- FX_BOOL bDot;
- if (CJS_PublicMethods::ConvertStringToNumber(swValue,dRet,bDot))
- {
- if (bDot)
- vp << dRet;
- else
- vp << dRet;
- }
- else
- vp << swValue;
- }
- break;
- case FIELDTYPE_LISTBOX:
- {
- if (pFormField->CountSelectedItems() > 1)
- {
- CJS_Array ValueArray(m_isolate);
- CJS_Value ElementValue(m_isolate);
- int iIndex;
- for (int i = 0, sz = pFormField->CountSelectedItems(); i < sz; i++)
- {
- iIndex = pFormField->GetSelectedIndex(i);
- ElementValue = pFormField->GetOptionValue(iIndex);
- if (FXSYS_wcslen((FX_LPCWSTR)ElementValue.operator CFX_WideString()) == 0)
- ElementValue = pFormField->GetOptionLabel(iIndex);
- ValueArray.SetElement(i, ElementValue);
- }
- vp << ValueArray;
- }
- else
- {
- CFX_WideString swValue = pFormField->GetValue();
-
- double dRet;
- FX_BOOL bDot;
- if (CJS_PublicMethods::ConvertStringToNumber(swValue,dRet,bDot))
- {
- if (bDot)
- vp << dRet;
- else
- vp << dRet;
- }
- else
- vp << swValue;
- }
- }
- break;
- case FIELDTYPE_CHECKBOX:
- case FIELDTYPE_RADIOBUTTON:
- {
- FX_BOOL bFind = FALSE;
- for (int i = 0 , sz = pFormField->CountControls(); i < sz; i++)
- {
- if (pFormField->GetControl(i)->IsChecked())
- {
- CFX_WideString swValue = pFormField->GetControl(i)->GetExportValue();
-
- double dRet;
- FX_BOOL bDot;
- if (CJS_PublicMethods::ConvertStringToNumber(swValue,dRet,bDot))
- {
- if (bDot)
- vp << dRet;
- else
- vp << dRet;
- }
- else
- vp << swValue;
-
- bFind = TRUE;
- break;
- }
- else
- continue;
- }
- if (!bFind)
- vp << (FX_LPCWSTR)L"Off";
- }
- break;
- default:
- vp << pFormField->GetValue();
- break;
- }
- }
-
- return TRUE;
-}
-
-void Field::SetValue(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName,
- int nControlIndex, const CJS_WideStringArray& strArray)
-{
- ASSERT(pDocument != NULL);
-
- if (strArray.GetSize() < 1) return;
-
- CFX_PtrArray FieldArray;
- GetFormFields(pDocument, swFieldName, FieldArray);
-
- for (int i=0,isz=FieldArray.GetSize(); i<isz; i++)
- {
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(i);
- ASSERT(pFormField != NULL);
-
- if (pFormField->GetFullName().Compare(swFieldName) != 0)
- continue;
-
- switch (pFormField->GetFieldType())
- {
- case FIELDTYPE_TEXTFIELD:
- case FIELDTYPE_COMBOBOX:
- if (pFormField->GetValue() != strArray.GetAt(0))
- {
- CFX_WideString WideString = strArray.GetAt(0);
- pFormField->SetValue(strArray.GetAt(0), TRUE);
- UpdateFormField(pDocument, pFormField, TRUE, FALSE, TRUE);
- }
- break;
- case FIELDTYPE_CHECKBOX: //mantis: 0004493
- case FIELDTYPE_RADIOBUTTON:
- {
- if (pFormField->GetValue() != strArray.GetAt(0))
- {
- pFormField->SetValue(strArray.GetAt(0), TRUE);
- UpdateFormField(pDocument, pFormField, TRUE, FALSE, TRUE);
- }
- }
- break;
- case FIELDTYPE_LISTBOX:
- {
- FX_BOOL bModified = FALSE;
-
- for (int i=0,sz=strArray.GetSize(); i<sz; i++)
- {
- int iIndex = pFormField->FindOption(strArray.GetAt(i));
-
- if (!pFormField->IsItemSelected(iIndex))
- {
- bModified = TRUE;
- break;
- }
- }
-
- if (bModified)
- {
- pFormField->ClearSelection(TRUE);
- for (int i=0,sz=strArray.GetSize(); i<sz; i++)
- {
- int iIndex = pFormField->FindOption(strArray.GetAt(i));
- pFormField->SetItemSelection(iIndex, TRUE, TRUE);
- }
-
- UpdateFormField(pDocument, pFormField, TRUE, FALSE, TRUE);
- }
- }
- break;
- default:
- break;
- }
- }
-}
-
-FX_BOOL Field::valueAsString(OBJ_PROP_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- if (!vp.IsGetting()) return FALSE;
-
- CFX_PtrArray FieldArray;
- GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
-
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
- ASSERT(pFormField != NULL);
-
- if (pFormField->GetFieldType() == FIELDTYPE_PUSHBUTTON)
- return FALSE;
-
- if (pFormField->GetFieldType() == FIELDTYPE_CHECKBOX)
- {
- if(!pFormField->CountControls()) return FALSE;
-
- if (pFormField->GetControl(0)->IsChecked())
- vp << (FX_LPCWSTR)L"Yes";
- else
- vp << (FX_LPCWSTR)L"Off";
- }
- else if (pFormField->GetFieldType() == FIELDTYPE_RADIOBUTTON && !(pFormField->GetFieldFlags() & FIELDFLAG_RADIOSINUNISON))
- {
- for (int i=0, sz=pFormField->CountControls(); i<sz; i++)
- {
- if (pFormField->GetControl(i)->IsChecked())
- {
- vp << (FX_LPCWSTR)pFormField->GetControl(i)->GetExportValue();
- break;
- }
- else
- vp << (FX_LPCWSTR)L"Off";
- }
- }
- else if (pFormField->GetFieldType() == FIELDTYPE_LISTBOX && (pFormField->CountSelectedItems() > 1))
- {
- vp << (FX_LPCWSTR)L"";
- }
- else
- vp << (FX_LPCWSTR)pFormField->GetValue();
-
- return TRUE;
-}
-
-/* --------------------------------- methods --------------------------------- */
-
-FX_BOOL Field::browseForFileToSubmit(OBJ_METHOD_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- CFX_PtrArray FieldArray;
- GetFormFields(m_FieldName, FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
-
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
- ASSERT(pFormField != NULL);
-
- CPDFDoc_Environment* pApp = m_pDocument->GetEnv();
- ASSERT(pApp != NULL);
-
- if ((pFormField->GetFieldFlags() & FIELDFLAG_FILESELECT) &&
- (pFormField->GetFieldType() == FIELDTYPE_TEXTFIELD))
- {
- CFX_WideString wsFileName = pApp->JS_fieldBrowse();
- if(!wsFileName.IsEmpty())
- {
- pFormField->SetValue(wsFileName);
- UpdateFormField(m_pDocument, pFormField, TRUE, TRUE, TRUE);
- }
- }
- else
- return FALSE;
-
- return TRUE;
-}
-
-
-FX_BOOL Field::buttonGetCaption(OBJ_METHOD_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- int nface = 0;
- int iSize = params.size();
- if ( iSize >= 1)
- nface = (FX_INT32) params[0];
-
- CFX_PtrArray FieldArray;
- GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
-
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
- ASSERT(pFormField != NULL);
-
- if (pFormField->GetFieldType() != FIELDTYPE_PUSHBUTTON)
- return FALSE;
-
- CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
- if (!pFormControl)return FALSE;
-
- if (nface == 0)
- vRet = pFormControl->GetNormalCaption();
- else if (nface == 1)
- vRet = pFormControl->GetDownCaption();
- else if (nface == 2)
- vRet = pFormControl->GetRolloverCaption();
- else
- return FALSE;
-
- return TRUE;
-}
-
-//#pragma warning(disable: 4800)
-
-FX_BOOL Field::buttonGetIcon(OBJ_METHOD_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- int nface = 0;
- int iSize = params.size();
- if ( iSize >= 1)
- nface = (FX_INT32) params[0];
-
- CFX_PtrArray FieldArray;
- GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
-
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
- ASSERT(pFormField != NULL);
-
- if (pFormField->GetFieldType() != FIELDTYPE_PUSHBUTTON)
- return FALSE;
-
- CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
- if (!pFormControl)return FALSE;
-
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
-
- CJS_Runtime* pRuntime = pContext->GetJSRuntime();
- ASSERT(pRuntime != NULL);
-
- JSFXObject pObj = JS_NewFxDynamicObj(*pRuntime, pContext, JS_GetObjDefnID(*pRuntime, L"Icon"));
- ASSERT(pObj.IsEmpty() == FALSE);
-
- CJS_Icon* pJS_Icon = (CJS_Icon*)JS_GetPrivate(pObj);
- ASSERT(pJS_Icon != NULL);
-
- Icon* pIcon = (Icon*)pJS_Icon->GetEmbedObject();
- ASSERT(pIcon != NULL);
-
- CPDF_Stream* pIconStream = NULL;
- if (nface == 0)
- pIconStream = pFormControl->GetNormalIcon();
- else if (nface == 1)
- pIconStream = pFormControl->GetDownIcon();
- else if (nface == 2)
- pIconStream = pFormControl->GetRolloverIcon();
- else
- return FALSE;
-
- pIcon->SetStream(pIconStream);
- vRet = pJS_Icon;
-
- return TRUE;
-}
-
-//#pragma warning(default: 4800)
-
-FX_BOOL Field::buttonImportIcon(OBJ_METHOD_PARAMS)
-{
-#if 0
- ASSERT(m_pDocument != NULL);
-
- CFX_PtrArray FieldArray;
- GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
-
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
- if (!pFormField)return FALSE;
-
- CPDFDoc_Environment* pEnv = m_pDocument->GetEnv();
- ASSERT(pEnv);
-
- CFX_WideString sIconFileName = pEnv->JS_fieldBrowse();
- if (sIconFileName.IsEmpty())
- {
- vRet = 1;
- return TRUE;
- }
-
- CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInterForm();
- ASSERT(pInterForm != NULL);
-
- CPDF_Stream* pStream = pInterForm->LoadImageFromFile(sIconFileName);
- if (!pStream)
- {
- vRet = -1;
- return TRUE;
- }
-
- CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
- if (!pFormControl)return FALSE;
-
- pFormControl->SetNormalIcon(pStream);
- UpdateFormControl(m_pDocument, pFormControl, TRUE, TRUE, TRUE);
-
- vRet = 0;
-#endif // 0
- return TRUE;
-}
-
-FX_BOOL Field::buttonSetCaption(OBJ_METHOD_PARAMS)
-{
- return FALSE;
-}
-
-FX_BOOL Field::buttonSetIcon(OBJ_METHOD_PARAMS)
-{
- return FALSE;
-}
-
-FX_BOOL Field::checkThisBox(OBJ_METHOD_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- if (!m_bCanSet) return FALSE;
-
- int iSize = params.size();
- int nWidget = -1;
- if ( iSize >= 1)
- nWidget= (FX_INT32) params[0];
- else
- return FALSE;
- FX_BOOL bCheckit = TRUE;
- if ( iSize >= 2)
- bCheckit = params[1];
-
-
- CFX_PtrArray FieldArray;
- GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
-
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
- ASSERT(pFormField != NULL);
-
- if (pFormField->GetFieldType() != FIELDTYPE_CHECKBOX && pFormField->GetFieldType() != FIELDTYPE_RADIOBUTTON)
- return FALSE;
- if(nWidget <0 || nWidget >= pFormField->CountControls())
- return FALSE;
- if (pFormField->GetFieldType() == FIELDTYPE_RADIOBUTTON)
- pFormField->CheckControl(nWidget, bCheckit, TRUE);
- else
- pFormField->CheckControl(nWidget, bCheckit, TRUE);
-
- UpdateFormField(m_pDocument, pFormField, TRUE, TRUE, TRUE);
-
- return TRUE;
-}
-
-FX_BOOL Field::clearItems(OBJ_METHOD_PARAMS)
-{
- return TRUE;
-}
-
-FX_BOOL Field::defaultIsChecked(OBJ_METHOD_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- if (!m_bCanSet) return FALSE;
-
- int iSize = params.size();
- int nWidget = -1;
- if ( iSize >= 1)
- nWidget= (FX_INT32) params[0];
- else
- return FALSE;
- //FX_BOOL bIsDefaultChecked = TRUE;
- //if ( iSize >= 2)
- // bIsDefaultChecked = params[1];
-
- CFX_PtrArray FieldArray;
- GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
-
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
- ASSERT(pFormField != NULL);
-
- if(nWidget <0 || nWidget >= pFormField->CountControls())
- {
- vRet = FALSE;
- return FALSE;
- }
- if ((pFormField->GetFieldType() == FIELDTYPE_CHECKBOX)
- || (pFormField->GetFieldType() == FIELDTYPE_RADIOBUTTON))
- {
-
- vRet = TRUE;
- }
- else
- vRet = FALSE;
-
- return TRUE;
-}
-
-FX_BOOL Field::deleteItemAt(OBJ_METHOD_PARAMS)
-{
- return TRUE;
-}
-
-int JS_COMPARESTRING(CFX_WideString* ps1, CFX_WideString* ps2)
-{
- ASSERT(ps1 != NULL);
- ASSERT(ps2 != NULL);
-
- return ps1->Compare(*ps2);
-}
-
-
-FX_BOOL Field::getArray(OBJ_METHOD_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- CFX_PtrArray FieldArray;
- GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
-
- CGW_ArrayTemplate<CFX_WideString*> swSort;
-
- for (int i=0,sz=FieldArray.GetSize(); i<sz; i++)
- {
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(i);
- ASSERT(pFormField != NULL);
-
- swSort.Add(new CFX_WideString(pFormField->GetFullName()));
-
- }
- swSort.Sort(JS_COMPARESTRING);
-
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
- CJS_Runtime* pRuntime = pContext->GetJSRuntime();
- ASSERT(pRuntime != NULL);
-
- CJS_Array FormFieldArray(m_isolate);
- for (int j=0,jsz = swSort.GetSize(); j<jsz; j++)
- {
- CFX_WideString* pStr = swSort.GetAt(j);
-
- JSFXObject pObj = JS_NewFxDynamicObj(*pRuntime, pContext, JS_GetObjDefnID(*pRuntime, L"Field"));
- ASSERT(pObj.IsEmpty() == FALSE);
-
- CJS_Field* pJSField = (CJS_Field*)JS_GetPrivate(pObj);
- ASSERT(pJSField != NULL);
-
- Field* pField = (Field*)pJSField->GetEmbedObject();
- ASSERT(pField != NULL);
-
- pField->AttachField(this->m_pJSDoc, *pStr);
-
- CJS_Value FormFieldValue(m_isolate);
- FormFieldValue = pJSField;
- FormFieldArray.SetElement(j, FormFieldValue);
-
- delete pStr;
- }
-
- vRet = FormFieldArray;
- swSort.RemoveAll();
- return TRUE;
-}
-
-FX_BOOL Field::getItemAt(OBJ_METHOD_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- int nIdx = -1;
- if (params.size() >=1)
- nIdx = (FX_INT32) params[0];
- FX_BOOL bExport = TRUE;
- int iSize = params.size();
- if ( iSize >= 2)
- {
- bExport =(FX_BOOL) params[1];
- }
-
- CFX_PtrArray FieldArray;
- GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
-
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
- ASSERT(pFormField != NULL);
-
- if ((pFormField->GetFieldType() == FIELDTYPE_LISTBOX)
- || (pFormField->GetFieldType() == FIELDTYPE_COMBOBOX))
- {
- if (nIdx == -1 || nIdx > pFormField->CountOptions())
- nIdx = pFormField->CountOptions() -1;
- if (bExport)
- {
- CFX_WideString strval = pFormField->GetOptionValue(nIdx);
- if (strval.IsEmpty())
- vRet = pFormField->GetOptionLabel(nIdx);
- else
- vRet = strval;
- }
- else
- vRet = pFormField->GetOptionLabel(nIdx);
- }
- else
- return FALSE;
-
- return TRUE;
-}
-
-FX_BOOL Field::getLock(OBJ_METHOD_PARAMS)
-{
- return FALSE;
-}
-
-FX_BOOL Field::insertItemAt(OBJ_METHOD_PARAMS)
-{
- return TRUE;
-}
-
-FX_BOOL Field::isBoxChecked(OBJ_METHOD_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- int nIndex = -1;
- if (params.size() >=1)
- nIndex = (FX_INT32) params[0];
-
- CFX_PtrArray FieldArray;
- GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
-
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
- ASSERT(pFormField != NULL);
-
- if(nIndex <0 || nIndex >= pFormField->CountControls())
- {
- vRet = FALSE;
- return FALSE;
- }
-
- if ((pFormField->GetFieldType() == FIELDTYPE_CHECKBOX)
- || (pFormField->GetFieldType() == FIELDTYPE_RADIOBUTTON))
- {
- if (pFormField->GetControl(nIndex)->IsChecked() !=0 )
- vRet = TRUE;
- else
- vRet = FALSE;
- }
- else
- vRet = FALSE;
-
- return TRUE;
-}
-
-FX_BOOL Field::isDefaultChecked(OBJ_METHOD_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- int nIndex = -1;
- if (params.size() >=1)
- nIndex = (FX_INT32) params[0];
-
- CFX_PtrArray FieldArray;
- GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
-
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
- ASSERT(pFormField != NULL);
-
- if(nIndex <0 || nIndex >= pFormField->CountControls())
- {
- vRet = FALSE;
- return FALSE;
- }
- if ((pFormField->GetFieldType() == FIELDTYPE_CHECKBOX)
- || (pFormField->GetFieldType() == FIELDTYPE_RADIOBUTTON))
- {
- if (pFormField->GetControl(nIndex)->IsDefaultChecked() != 0)
- vRet = TRUE;
- else
- vRet = FALSE;
- }
- else
- vRet = FALSE;
-
- return TRUE;
-}
-
-FX_BOOL Field::setAction(OBJ_METHOD_PARAMS)
-{
- return TRUE;
-}
-
-FX_BOOL Field::setFocus(OBJ_METHOD_PARAMS)
-{
- ASSERT(m_pDocument != NULL);
-
- CFX_PtrArray FieldArray;
- GetFormFields(m_FieldName,FieldArray);
- if (FieldArray.GetSize() <= 0) return FALSE;
-
- CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
- ASSERT(pFormField != NULL);
-
- FX_INT32 nCount = pFormField->CountControls();
-
- if (nCount < 1) return FALSE;
-
- CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInterForm();
- ASSERT(pInterForm != NULL);
-
- CPDFSDK_Widget* pWidget = NULL;
- if (nCount == 1)
- {
- pWidget = pInterForm->GetWidget(pFormField->GetControl(0));
- }
- else
- {
- CPDFDoc_Environment* pEnv = m_pDocument->GetEnv();
- ASSERT(pEnv);
- CPDF_Page* pPage = (CPDF_Page*)pEnv->FFI_GetCurrentPage(m_pDocument->GetDocument());
- if(!pPage)
- return FALSE;
- if (CPDFSDK_PageView* pCurPageView = m_pDocument->GetPageView(pPage))
- {
- for (FX_INT32 i=0; i<nCount; i++)
- {
- if (CPDFSDK_Widget* pTempWidget = pInterForm->GetWidget(pFormField->GetControl(i)))
- {
- if (pTempWidget->GetPDFPage() == pCurPageView->GetPDFPage())
- {
- pWidget = pTempWidget;
- break;
- }
- }
- }
- }
- }
-
- if (pWidget)
- {
- m_pDocument->SetFocusAnnot(pWidget);
- }
-
- return TRUE;
-}
-
-FX_BOOL Field::setItems(OBJ_METHOD_PARAMS)
-{
- return TRUE;
-}
-
-FX_BOOL Field::setLock(OBJ_METHOD_PARAMS)
-{
- return FALSE;
-}
-
-FX_BOOL Field::signatureGetModifications(OBJ_METHOD_PARAMS)
-{
- return FALSE;
-}
-
-FX_BOOL Field::signatureGetSeedValue(OBJ_METHOD_PARAMS)
-{
- return FALSE;
-}
-
-FX_BOOL Field::signatureInfo(OBJ_METHOD_PARAMS)
-{
- return FALSE;
-}
-
-FX_BOOL Field::signatureSetSeedValue(OBJ_METHOD_PARAMS)
-{
- return FALSE;
-}
-
-FX_BOOL Field::signatureSign(OBJ_METHOD_PARAMS)
-{
- return FALSE;
-}
-
-FX_BOOL Field::signatureValidate(OBJ_METHOD_PARAMS)
-{
- return FALSE;
-}
-
-FX_BOOL Field::source(OBJ_PROP_PARAMS)
-{
- if (vp.IsGetting())
- {
- vp << (CJS_Object*)NULL;
- }
-
- return TRUE;
-}
-
-/////////////////////////////////////////// delay /////////////////////////////////////////////
-
-void Field::AddDelay_Int(enum FIELD_PROP prop, FX_INT32 n)
-{
- ASSERT(m_pJSDoc != NULL);
-
- CJS_DelayData* pNewData = new CJS_DelayData;
- pNewData->sFieldName = m_FieldName;
- pNewData->nControlIndex = m_nFormControlIndex;
- pNewData->eProp = prop;
- pNewData->num = n;
-
- m_pJSDoc->AddDelayData(pNewData);
-}
-
-void Field::AddDelay_Bool(enum FIELD_PROP prop,bool b)
-{
- ASSERT(m_pJSDoc != NULL);
-
- CJS_DelayData* pNewData = new CJS_DelayData;
- pNewData->sFieldName = m_FieldName;
- pNewData->nControlIndex = m_nFormControlIndex;
- pNewData->eProp = prop;
- pNewData->b = b;
-
- m_pJSDoc->AddDelayData(pNewData);
-}
-
-void Field::AddDelay_String(enum FIELD_PROP prop, const CFX_ByteString& string)
-{
- ASSERT(m_pJSDoc != NULL);
-
- CJS_DelayData* pNewData = new CJS_DelayData;
- pNewData->sFieldName = m_FieldName;
- pNewData->nControlIndex = m_nFormControlIndex;
- pNewData->eProp = prop;
- pNewData->string = string;
-
- m_pJSDoc->AddDelayData(pNewData);
-}
-
-void Field::AddDelay_WideString(enum FIELD_PROP prop, const CFX_WideString& string)
-{
- ASSERT(m_pJSDoc != NULL);
-
- CJS_DelayData* pNewData = new CJS_DelayData;
- pNewData->sFieldName = m_FieldName;
- pNewData->nControlIndex = m_nFormControlIndex;
- pNewData->eProp = prop;
- pNewData->widestring = string;
-
- m_pJSDoc->AddDelayData(pNewData);
-}
-
-void Field::AddDelay_Rect(enum FIELD_PROP prop, const CPDF_Rect& rect)
-{
- ASSERT(m_pJSDoc != NULL);
-
- CJS_DelayData* pNewData = new CJS_DelayData;
- pNewData->sFieldName = m_FieldName;
- pNewData->nControlIndex = m_nFormControlIndex;
- pNewData->eProp = prop;
- pNewData->rect = rect;
-
- m_pJSDoc->AddDelayData(pNewData);
-}
-
-void Field::AddDelay_Color(enum FIELD_PROP prop, const CPWL_Color& color)
-{
- ASSERT(m_pJSDoc != NULL);
-
- CJS_DelayData* pNewData = new CJS_DelayData;
- pNewData->sFieldName = m_FieldName;
- pNewData->nControlIndex = m_nFormControlIndex;
- pNewData->eProp = prop;
- pNewData->color = color;
-
- m_pJSDoc->AddDelayData(pNewData);
-}
-
-void Field::AddDelay_WordArray(enum FIELD_PROP prop, const CFX_DWordArray& array)
-{
- ASSERT(m_pJSDoc != NULL);
-
- CJS_DelayData* pNewData = new CJS_DelayData;
- pNewData->sFieldName = m_FieldName;
- pNewData->nControlIndex = m_nFormControlIndex;
- pNewData->eProp = prop;
-
- for (int i=0,sz=array.GetSize(); i<sz; i++)
- pNewData->wordarray.Add(array.GetAt(i));
-
- m_pJSDoc->AddDelayData(pNewData);
-}
-
-void Field::AddDelay_WideStringArray(enum FIELD_PROP prop, const CJS_WideStringArray& array)
-{
- ASSERT(m_pJSDoc != NULL);
-
- CJS_DelayData* pNewData = new CJS_DelayData;
- pNewData->sFieldName = m_FieldName;
- pNewData->nControlIndex = m_nFormControlIndex;
- pNewData->eProp = prop;
- for (int i=0,sz=array.GetSize(); i<sz; i++)
- pNewData->widestringarray.Add(array.GetAt(i));
-
- m_pJSDoc->AddDelayData(pNewData);
-}
-
-void Field::DoDelay(CPDFSDK_Document* pDocument, CJS_DelayData* pData)
-{
- ASSERT(pDocument != NULL);
- ASSERT(pData != NULL);
-
- switch (pData->eProp)
- {
- case FP_ALIGNMENT:
- Field::SetAlignment(pDocument, pData->sFieldName, pData->nControlIndex, pData->string);
- break;
- case FP_BORDERSTYLE:
- Field::SetBorderStyle(pDocument, pData->sFieldName, pData->nControlIndex, pData->string);
- break;
- case FP_BUTTONALIGNX:
- Field::SetButtonAlignX(pDocument, pData->sFieldName, pData->nControlIndex, pData->num);
- break;
- case FP_BUTTONALIGNY:
- Field::SetButtonAlignY(pDocument, pData->sFieldName, pData->nControlIndex, pData->num);
- break;
- case FP_BUTTONFITBOUNDS:
- Field::SetButtonFitBounds(pDocument, pData->sFieldName, pData->nControlIndex, pData->b);
- break;
- case FP_BUTTONPOSITION:
- Field::SetButtonPosition(pDocument, pData->sFieldName, pData->nControlIndex, pData->num);
- break;
- case FP_BUTTONSCALEHOW:
- Field::SetButtonScaleHow(pDocument, pData->sFieldName, pData->nControlIndex, pData->num);
- break;
- case FP_BUTTONSCALEWHEN:
- Field::SetButtonScaleWhen(pDocument, pData->sFieldName, pData->nControlIndex, pData->num);
- break;
- case FP_CALCORDERINDEX:
- Field::SetCalcOrderIndex(pDocument, pData->sFieldName, pData->nControlIndex, pData->num);
- break;
- case FP_CHARLIMIT:
- Field::SetCharLimit(pDocument, pData->sFieldName, pData->nControlIndex, pData->num);
- break;
- case FP_COMB:
- Field::SetComb(pDocument, pData->sFieldName, pData->nControlIndex, pData->b);
- break;
- case FP_COMMITONSELCHANGE:
- Field::SetCommitOnSelChange(pDocument, pData->sFieldName, pData->nControlIndex, pData->b);
- break;
- case FP_CURRENTVALUEINDICES:
- Field::SetCurrentValueIndices(pDocument, pData->sFieldName, pData->nControlIndex, pData->wordarray);
- break;
- case FP_DEFAULTVALUE:
- Field::SetDefaultValue(pDocument, pData->sFieldName, pData->nControlIndex, pData->widestring);
- break;
- case FP_DONOTSCROLL:
- Field::SetDoNotScroll(pDocument, pData->sFieldName, pData->nControlIndex, pData->b);
- break;
- case FP_DISPLAY:
- Field::SetDisplay(pDocument, pData->sFieldName, pData->nControlIndex, pData->num);
- break;
- case FP_FILLCOLOR:
- Field::SetFillColor(pDocument, pData->sFieldName, pData->nControlIndex, pData->color);
- break;
- case FP_HIDDEN:
- Field::SetHidden(pDocument, pData->sFieldName, pData->nControlIndex, pData->b);
- break;
- case FP_HIGHLIGHT:
- Field::SetHighlight(pDocument, pData->sFieldName, pData->nControlIndex, pData->string);
- break;
- case FP_LINEWIDTH:
- Field::SetLineWidth(pDocument, pData->sFieldName, pData->nControlIndex, pData->num);
- break;
- case FP_MULTILINE:
- Field::SetMultiline(pDocument, pData->sFieldName, pData->nControlIndex, pData->b);
- break;
- case FP_MULTIPLESELECTION:
- Field::SetMultipleSelection(pDocument, pData->sFieldName, pData->nControlIndex, pData->b);
- break;
- case FP_PASSWORD:
- Field::SetPassword(pDocument, pData->sFieldName, pData->nControlIndex, pData->b);
- break;
- case FP_RECT:
- Field::SetRect(pDocument, pData->sFieldName, pData->nControlIndex, pData->rect);
- break;
- case FP_RICHTEXT:
- Field::SetRichText(pDocument, pData->sFieldName, pData->nControlIndex, pData->b);
- break;
- case FP_RICHVALUE:
- break;
- case FP_ROTATION:
- Field::SetRotation(pDocument, pData->sFieldName, pData->nControlIndex, pData->num);
- break;
- case FP_STROKECOLOR:
- Field::SetStrokeColor(pDocument, pData->sFieldName, pData->nControlIndex, pData->color);
- break;
- case FP_STYLE:
- Field::SetStyle(pDocument, pData->sFieldName, pData->nControlIndex, pData->string);
- break;
- case FP_TEXTCOLOR:
- Field::SetTextColor(pDocument, pData->sFieldName, pData->nControlIndex, pData->color);
- break;
- case FP_TEXTFONT:
- Field::SetTextFont(pDocument, pData->sFieldName, pData->nControlIndex, pData->string);
- break;
- case FP_TEXTSIZE:
- Field::SetTextSize(pDocument, pData->sFieldName, pData->nControlIndex, pData->num);
- break;
- case FP_USERNAME:
- Field::SetUserName(pDocument, pData->sFieldName, pData->nControlIndex, pData->widestring);
- break;
- case FP_VALUE:
- Field::SetValue(pDocument, pData->sFieldName, pData->nControlIndex, pData->widestringarray);
- break;
- }
-}
-
-#define JS_FIELD_MINWIDTH 1
-#define JS_FIELD_MINHEIGHT 1
-
-void Field::AddField(CPDFSDK_Document* pDocument, int nPageIndex, int nFieldType,
- const CFX_WideString& sName, const CPDF_Rect& rcCoords)
-{
- //Not supported.
-}
-
+// 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
+
+#include "../../include/javascript/JavaScript.h"
+#include "../../include/javascript/IJavaScript.h"
+#include "../../include/javascript/JS_Define.h"
+#include "../../include/javascript/JS_Object.h"
+#include "../../include/javascript/JS_Value.h"
+#include "../../include/javascript/Field.h"
+#include "../../include/javascript/JS_EventHandler.h"
+//#include "../include/JS_ResMgr.h"
+#include "../../include/javascript/JS_Context.h"
+#include "../../include/javascript/JS_Runtime.h"
+#include "../../include/javascript/Document.h"
+#include "../../include/javascript/color.h"
+#include "../../include/javascript/PublicMethods.h"
+#include "../../include/javascript/Icon.h"
+
+
+/* ---------------------- Field ---------------------- */
+
+BEGIN_JS_STATIC_CONST(CJS_Field)
+END_JS_STATIC_CONST()
+
+BEGIN_JS_STATIC_PROP(CJS_Field)
+ JS_STATIC_PROP_ENTRY(alignment)
+ JS_STATIC_PROP_ENTRY(borderStyle)
+ JS_STATIC_PROP_ENTRY(buttonAlignX)
+ JS_STATIC_PROP_ENTRY(buttonAlignY)
+ JS_STATIC_PROP_ENTRY(buttonFitBounds)
+ JS_STATIC_PROP_ENTRY(buttonPosition)
+ JS_STATIC_PROP_ENTRY(buttonScaleHow)
+ JS_STATIC_PROP_ENTRY(buttonScaleWhen)
+ JS_STATIC_PROP_ENTRY(calcOrderIndex)
+ JS_STATIC_PROP_ENTRY(charLimit)
+ JS_STATIC_PROP_ENTRY(comb)
+ JS_STATIC_PROP_ENTRY(commitOnSelChange)
+ JS_STATIC_PROP_ENTRY(currentValueIndices)
+ JS_STATIC_PROP_ENTRY(defaultStyle)
+ JS_STATIC_PROP_ENTRY(defaultValue)
+ JS_STATIC_PROP_ENTRY(doNotScroll)
+ JS_STATIC_PROP_ENTRY(doNotSpellCheck)
+ JS_STATIC_PROP_ENTRY(delay)
+ JS_STATIC_PROP_ENTRY(display)
+ JS_STATIC_PROP_ENTRY(doc)
+ JS_STATIC_PROP_ENTRY(editable)
+ JS_STATIC_PROP_ENTRY(exportValues)
+ JS_STATIC_PROP_ENTRY(hidden)
+ JS_STATIC_PROP_ENTRY(fileSelect)
+ JS_STATIC_PROP_ENTRY(fillColor)
+ JS_STATIC_PROP_ENTRY(lineWidth)
+ JS_STATIC_PROP_ENTRY(highlight)
+ JS_STATIC_PROP_ENTRY(multiline)
+ JS_STATIC_PROP_ENTRY(multipleSelection)
+ JS_STATIC_PROP_ENTRY(name)
+ JS_STATIC_PROP_ENTRY(numItems)
+ JS_STATIC_PROP_ENTRY(page)
+ JS_STATIC_PROP_ENTRY(password)
+ JS_STATIC_PROP_ENTRY(print)
+ JS_STATIC_PROP_ENTRY(radiosInUnison)
+ JS_STATIC_PROP_ENTRY(readonly)
+ JS_STATIC_PROP_ENTRY(rect)
+ JS_STATIC_PROP_ENTRY(required)
+ JS_STATIC_PROP_ENTRY(richText)
+ JS_STATIC_PROP_ENTRY(richValue)
+ JS_STATIC_PROP_ENTRY(rotation)
+ JS_STATIC_PROP_ENTRY(strokeColor)
+ JS_STATIC_PROP_ENTRY(style)
+ JS_STATIC_PROP_ENTRY(submitName)
+ JS_STATIC_PROP_ENTRY(textColor)
+ JS_STATIC_PROP_ENTRY(textFont)
+ JS_STATIC_PROP_ENTRY(textSize)
+ JS_STATIC_PROP_ENTRY(type)
+ JS_STATIC_PROP_ENTRY(userName)
+ JS_STATIC_PROP_ENTRY(value)
+ JS_STATIC_PROP_ENTRY(valueAsString)
+ JS_STATIC_PROP_ENTRY(source)
+END_JS_STATIC_PROP()
+
+BEGIN_JS_STATIC_METHOD(CJS_Field)
+ JS_STATIC_METHOD_ENTRY(browseForFileToSubmit, 0)
+ JS_STATIC_METHOD_ENTRY(buttonGetCaption, 1)
+ JS_STATIC_METHOD_ENTRY(buttonGetIcon, 1)
+ JS_STATIC_METHOD_ENTRY(buttonImportIcon, 0)
+ JS_STATIC_METHOD_ENTRY(buttonSetCaption, 2)
+ JS_STATIC_METHOD_ENTRY(buttonSetIcon, 2)
+ JS_STATIC_METHOD_ENTRY(checkThisBox, 2)
+ JS_STATIC_METHOD_ENTRY(clearItems, 0)
+ JS_STATIC_METHOD_ENTRY(defaultIsChecked, 2)
+ JS_STATIC_METHOD_ENTRY(deleteItemAt, 1)
+ JS_STATIC_METHOD_ENTRY(getArray , 0)
+ JS_STATIC_METHOD_ENTRY(getItemAt, 0)
+ JS_STATIC_METHOD_ENTRY(getLock, 0)
+ JS_STATIC_METHOD_ENTRY(insertItemAt, 0)
+ JS_STATIC_METHOD_ENTRY(isBoxChecked, 1)
+ JS_STATIC_METHOD_ENTRY(isDefaultChecked, 1)
+ JS_STATIC_METHOD_ENTRY(setAction, 2)
+ JS_STATIC_METHOD_ENTRY(setFocus, 0)
+ JS_STATIC_METHOD_ENTRY(setItems, 1)
+ JS_STATIC_METHOD_ENTRY(setLock, 0)
+ JS_STATIC_METHOD_ENTRY(signatureGetModifications, 0)
+ JS_STATIC_METHOD_ENTRY(signatureGetSeedValue, 0)
+ JS_STATIC_METHOD_ENTRY(signatureInfo, 0)
+ JS_STATIC_METHOD_ENTRY(signatureSetSeedValue, 0)
+ JS_STATIC_METHOD_ENTRY(signatureSign, 0)
+ JS_STATIC_METHOD_ENTRY(signatureValidate, 0)
+END_JS_STATIC_METHOD()
+
+IMPLEMENT_JS_CLASS(CJS_Field, Field)
+
+FX_BOOL CJS_Field::InitInstance(IFXJS_Context* cc)
+{
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+
+ Field* pField = (Field*)GetEmbedObject();
+ ASSERT(pField != NULL);
+
+ pField->SetIsolate(pContext->GetJSRuntime()->GetIsolate());
+
+ return TRUE;
+};
+
+Field::Field(CJS_Object* pJSObject): CJS_EmbedObj(pJSObject),
+ m_pJSDoc(NULL),
+ m_pDocument(NULL),
+ m_nFormControlIndex(-1),
+ m_bCanSet(FALSE),
+ m_bDelay(FALSE),
+ m_isolate(NULL)
+{
+}
+
+Field::~Field()
+{
+}
+
+//note: iControlNo = -1, means not a widget.
+void Field::ParseFieldName(const std::wstring &strFieldNameParsed,std::wstring &strFieldName,int & iControlNo)
+{
+ int iStart = strFieldNameParsed.find_last_of(L'.');
+ if (iStart == -1)
+ {
+ strFieldName = strFieldNameParsed;
+ iControlNo = -1;
+ return;
+ }
+ std::wstring suffixal = strFieldNameParsed.substr(iStart+1);
+ iControlNo = FXSYS_wtoi((FX_LPCWSTR)suffixal.c_str());
+ if (iControlNo == 0)
+ {
+ int iStart;
+ while((iStart = suffixal.find_last_of(L" ")) != -1)
+ {
+ suffixal.erase(iStart,1);
+ }
+
+ if (suffixal.compare(L"0") != 0)
+ {
+ strFieldName = strFieldNameParsed;
+ iControlNo = -1;
+ return;
+ }
+
+ }
+ strFieldName = strFieldNameParsed.substr(0,iStart);
+}
+
+FX_BOOL Field::AttachField(Document* pDocument, const CFX_WideString& csFieldName)
+{
+ ASSERT(pDocument != NULL);
+ m_pJSDoc = pDocument;
+
+ m_pDocument = pDocument->GetReaderDoc();
+ ASSERT(m_pDocument != NULL);
+
+ m_bCanSet = m_pDocument->GetPermissions(FPDFPERM_FILL_FORM) ||
+ m_pDocument->GetPermissions(FPDFPERM_ANNOT_FORM) ||
+ m_pDocument->GetPermissions(FPDFPERM_MODIFY);
+
+ CPDFSDK_InterForm* pRDInterForm = m_pDocument->GetInterForm();
+ ASSERT(pRDInterForm != NULL);
+
+ CPDF_InterForm* pInterForm = pRDInterForm->GetInterForm();
+ ASSERT(pInterForm != NULL);
+
+ CFX_WideString swFieldNameTemp = csFieldName;
+ swFieldNameTemp.Replace((FX_LPCWSTR)L"..", (FX_LPCWSTR)L".");
+
+ if (pInterForm->CountFields(swFieldNameTemp) <= 0)
+ {
+ std::wstring strFieldName;
+ int iControlNo = -1;
+ ParseFieldName((wchar_t*)(FX_LPCWSTR)swFieldNameTemp, strFieldName, iControlNo);
+ if (iControlNo == -1) return FALSE;
+
+ m_FieldName = strFieldName.c_str();
+ m_nFormControlIndex = iControlNo;
+ return TRUE;
+ }
+
+ m_FieldName = swFieldNameTemp;
+ m_nFormControlIndex = -1;
+
+ return TRUE;
+}
+
+void Field::GetFormFields(CPDFSDK_Document* pDocument, const CFX_WideString& csFieldName, CFX_PtrArray& FieldArray)
+{
+ ASSERT(pDocument != NULL);
+
+ CPDFSDK_InterForm* pReaderInterForm = pDocument->GetInterForm();
+ ASSERT(pReaderInterForm != NULL);
+
+ CPDF_InterForm* pInterForm = pReaderInterForm->GetInterForm();
+ ASSERT(pInterForm != NULL);
+
+ ASSERT(FieldArray.GetSize() == 0);
+
+ for (int i=0,sz=pInterForm->CountFields(csFieldName); i<sz; i++)
+ {
+ if (CPDF_FormField* pFormField = pInterForm->GetField(i, csFieldName))
+ FieldArray.Add((void*)pFormField);
+ }
+}
+
+void Field::GetFormFields(const CFX_WideString& csFieldName, CFX_PtrArray& FieldArray)
+{
+ ASSERT(m_pDocument != NULL);
+
+ Field::GetFormFields(m_pDocument, csFieldName, FieldArray);
+}
+
+void Field::UpdateFormField(CPDFSDK_Document* pDocument, CPDF_FormField* pFormField,
+ FX_BOOL bChangeMark, FX_BOOL bResetAP, FX_BOOL bRefresh)
+{
+ ASSERT(pDocument != NULL);
+ ASSERT(pFormField != NULL);
+
+ CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pDocument->GetInterForm();
+ ASSERT(pInterForm != NULL);
+
+ CFX_PtrArray widgets;
+ pInterForm->GetWidgets(pFormField, widgets);
+
+ if (bResetAP)
+ {
+ int nFieldType = pFormField->GetFieldType();
+ if (nFieldType == FIELDTYPE_COMBOBOX || nFieldType == FIELDTYPE_TEXTFIELD)
+ {
+ for (int i=0,sz=widgets.GetSize(); i<sz; i++)
+ {
+ CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)widgets.GetAt(i);
+ ASSERT(pWidget != NULL);
+
+ FX_BOOL bFormated = FALSE;
+ CFX_WideString sValue = pWidget->OnFormat(0, bFormated);
+ if (bFormated)
+ pWidget->ResetAppearance(sValue, FALSE);
+ else
+ pWidget->ResetAppearance(NULL, FALSE);
+ }
+ }
+ else
+ {
+ for (int i=0,sz=widgets.GetSize(); i<sz; i++)
+ {
+ CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)widgets.GetAt(i);
+ ASSERT(pWidget != NULL);
+
+ pWidget->ResetAppearance(NULL, FALSE);
+ }
+ }
+ }
+
+ if (bRefresh)
+ {
+ for (int i=0,sz=widgets.GetSize(); i<sz; i++)
+ {
+ CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)widgets.GetAt(i);
+ ASSERT(pWidget != NULL);
+
+ CPDFSDK_InterForm * pInterForm = pWidget->GetInterForm();
+ CPDFSDK_Document* pDoc = pInterForm->GetDocument();
+// CReader_Page* pPage = pWidget->GetPage();
+ ASSERT(pDoc != NULL);
+ pDoc->UpdateAllViews(NULL, pWidget);
+ }
+ }
+
+ if (bChangeMark)
+ pDocument->SetChangeMark();
+}
+
+void Field::UpdateFormControl(CPDFSDK_Document* pDocument, CPDF_FormControl* pFormControl,
+ FX_BOOL bChangeMark, FX_BOOL bResetAP, FX_BOOL bRefresh)
+{
+ ASSERT(pDocument != NULL);
+ ASSERT(pFormControl != NULL);
+
+ CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pDocument->GetInterForm();
+ ASSERT(pInterForm != NULL);
+
+ CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormControl);
+
+ if (pWidget)
+ {
+ if (bResetAP)
+ {
+ int nFieldType = pWidget->GetFieldType();
+ if (nFieldType == FIELDTYPE_COMBOBOX || nFieldType == FIELDTYPE_TEXTFIELD)
+ {
+ FX_BOOL bFormated = FALSE;
+ CFX_WideString sValue = pWidget->OnFormat(0, bFormated);
+ if (bFormated)
+ pWidget->ResetAppearance(sValue, FALSE);
+ else
+ pWidget->ResetAppearance(NULL, FALSE);
+ }
+ else
+ {
+ pWidget->ResetAppearance(NULL, FALSE);
+ }
+ }
+
+ if (bRefresh)
+ {
+ CPDFSDK_InterForm * pInterForm = pWidget->GetInterForm();
+ CPDFSDK_Document* pDoc = pInterForm->GetDocument();
+ ASSERT(pDoc != NULL);
+ pDoc->UpdateAllViews(NULL, pWidget);
+ }
+
+ }
+
+ if (bChangeMark)
+ pDocument->SetChangeMark();
+}
+
+CPDFSDK_Widget* Field::GetWidget(CPDFSDK_Document* pDocument, CPDF_FormControl* pFormControl)
+{
+ ASSERT(pDocument != NULL);
+ ASSERT(pFormControl != NULL);
+
+ CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pDocument->GetInterForm();
+ ASSERT(pInterForm != NULL);
+
+ return pInterForm->GetWidget(pFormControl);
+}
+
+FX_BOOL Field::ValueIsOccur(CPDF_FormField* pFormField, CFX_WideString csOptLabel)
+{
+ ASSERT(pFormField != NULL);
+
+ for (int i=0,sz = pFormField->CountOptions(); i < sz; i++)
+ {
+ if (csOptLabel.Compare(pFormField->GetOptionLabel(i)) == 0)
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+CPDF_FormControl* Field::GetSmartFieldControl(CPDF_FormField* pFormField)
+{
+ ASSERT(pFormField != NULL);
+ if(!pFormField->CountControls() || m_nFormControlIndex>=pFormField->CountControls()) return NULL;
+
+ if (m_nFormControlIndex<0)
+ return pFormField->GetControl(0);
+ else
+ return pFormField->GetControl(m_nFormControlIndex);
+}
+
+/* ---------------------------------------- property ---------------------------------------- */
+
+FX_BOOL Field::alignment(OBJ_PROP_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ if (vp.IsSetting())
+ {
+ if (!m_bCanSet) return FALSE;
+
+ CFX_ByteString alignStr;
+ vp >> alignStr;
+
+ if (m_bDelay)
+ {
+ AddDelay_String(FP_ALIGNMENT, alignStr);
+ }
+ else
+ {
+ Field::SetAlignment(m_pDocument, m_FieldName, m_nFormControlIndex, alignStr);
+ }
+ }
+ else
+ {
+ CFX_PtrArray FieldArray;
+ GetFormFields(m_FieldName, FieldArray);
+ if (FieldArray.GetSize() <= 0) return FALSE;
+
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
+ ASSERT(pFormField != NULL);
+
+ if (pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD)
+ return FALSE;
+
+ CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
+ if (!pFormControl)return FALSE;
+
+ switch (pFormControl->GetControlAlignment())
+ {
+ case 1:
+ vp << (FX_LPCWSTR)L"center";
+ break;
+ case 0:
+ vp << (FX_LPCWSTR)L"left";
+ break;
+ case 2:
+ vp << (FX_LPCWSTR)L"right";
+ break;
+ default:
+ vp << (FX_LPCWSTR)L"";
+ }
+ }
+
+ return TRUE;
+}
+
+void Field::SetAlignment(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex,
+ const CFX_ByteString& string)
+{
+ //Not supported.
+}
+
+FX_BOOL Field::borderStyle(OBJ_PROP_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ if (vp.IsSetting())
+ {
+ if (!m_bCanSet) return FALSE;
+
+ CFX_ByteString strType = "";
+ vp >> strType;
+
+ if (m_bDelay)
+ {
+ AddDelay_String(FP_BORDERSTYLE, strType);
+ }
+ else
+ {
+ Field::SetBorderStyle(m_pDocument, m_FieldName, m_nFormControlIndex, strType);
+ }
+ }
+ else
+ {
+ CFX_PtrArray FieldArray;
+ GetFormFields(m_FieldName, FieldArray);
+ if (FieldArray.GetSize() <= 0) return FALSE;
+
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
+ if (!pFormField) return FALSE;
+
+ CPDFSDK_Widget* pWidget = GetWidget(m_pDocument, GetSmartFieldControl(pFormField));
+ if (!pWidget) return FALSE;
+
+ int nBorderstyle = pWidget->GetBorderStyle();
+
+ switch (nBorderstyle)
+ {
+ case BBS_SOLID:
+ vp << (FX_LPCWSTR)L"solid";
+ break;
+ case BBS_DASH:
+ vp << (FX_LPCWSTR)L"dashed";
+ break;
+ case BBS_BEVELED:
+ vp << (FX_LPCWSTR)L"beveled";
+ break;
+ case BBS_INSET:
+ vp << (FX_LPCWSTR)L"inset";
+ break;
+ case BBS_UNDERLINE:
+ vp << (FX_LPCWSTR)L"underline";
+ break;
+ default:
+ vp << (FX_LPCWSTR)L"";
+ break;
+ }
+ }
+
+ return TRUE;
+}
+
+void Field::SetBorderStyle(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex,
+ const CFX_ByteString& string)
+{
+ ASSERT(pDocument != NULL);
+
+ int nBorderStyle = 0;
+
+ if (string == "solid")
+ nBorderStyle = BBS_SOLID;
+ else if (string == "beveled")
+ nBorderStyle = BBS_BEVELED;
+ else if (string == "dashed")
+ nBorderStyle = BBS_DASH;
+ else if (string == "inset")
+ nBorderStyle = BBS_INSET;
+ else if (string == "underline")
+ nBorderStyle = BBS_UNDERLINE;
+ else return;
+
+ CFX_PtrArray FieldArray;
+ GetFormFields(pDocument, swFieldName, FieldArray);
+
+ for (int i=0,isz=FieldArray.GetSize(); i<isz; i++)
+ {
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(i);
+ ASSERT(pFormField != NULL);
+
+ if (nControlIndex < 0)
+ {
+ FX_BOOL bSet = FALSE;
+ for (int j=0,jsz = pFormField->CountControls(); j<jsz; j++)
+ {
+ if (CPDFSDK_Widget* pWidget = GetWidget(pDocument, pFormField->GetControl(j)))
+ {
+ if (pWidget->GetBorderStyle() != nBorderStyle)
+ {
+ pWidget->SetBorderStyle(nBorderStyle);
+ bSet = TRUE;
+ }
+ }
+ }
+ if (bSet) UpdateFormField(pDocument, pFormField, TRUE, TRUE, TRUE);
+ }
+ else
+ {
+ if(nControlIndex >= pFormField->CountControls()) return;
+ if (CPDF_FormControl* pFormControl = pFormField->GetControl(nControlIndex))
+ {
+ if (CPDFSDK_Widget* pWidget = GetWidget(pDocument, pFormControl))
+ {
+ if (pWidget->GetBorderStyle() != nBorderStyle)
+ {
+ pWidget->SetBorderStyle(nBorderStyle);
+ UpdateFormControl(pDocument, pFormControl, TRUE, TRUE, TRUE);
+ }
+ }
+ }
+ }
+ }
+}
+
+FX_BOOL Field::buttonAlignX(OBJ_PROP_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ if (vp.IsSetting())
+ {
+ if (!m_bCanSet) return FALSE;
+
+ int nVP;
+ vp >> nVP;
+
+ if (m_bDelay)
+ {
+ AddDelay_Int(FP_BUTTONALIGNX, nVP);
+ }
+ else
+ {
+ Field::SetButtonAlignX(m_pDocument, m_FieldName, m_nFormControlIndex, nVP);
+ }
+ }
+ else
+ {
+ CFX_PtrArray FieldArray;
+ GetFormFields(m_FieldName,FieldArray);
+ if (FieldArray.GetSize() <= 0) return FALSE;
+
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
+ ASSERT(pFormField != NULL);
+
+ if (pFormField->GetFieldType() != FIELDTYPE_PUSHBUTTON)
+ return FALSE;
+
+ CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
+ if (!pFormControl)return FALSE;
+
+ CPDF_IconFit IconFit = pFormControl->GetIconFit();
+
+ FX_FLOAT fLeft,fBottom;
+ IconFit.GetIconPosition(fLeft,fBottom);
+
+ vp << (FX_INT32)fLeft;
+ }
+
+ return TRUE;
+}
+
+void Field::SetButtonAlignX(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number)
+{
+ //Not supported.
+}
+
+FX_BOOL Field::buttonAlignY(OBJ_PROP_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ if (vp.IsSetting())
+ {
+ if (!m_bCanSet) return FALSE;
+
+ int nVP;
+ vp >> nVP;
+
+ if (m_bDelay)
+ {
+ AddDelay_Int(FP_BUTTONALIGNY, nVP);
+ }
+ else
+ {
+ Field::SetButtonAlignY(m_pDocument, m_FieldName, m_nFormControlIndex, nVP);
+ }
+ }
+ else
+ {
+ CFX_PtrArray FieldArray;
+ GetFormFields(m_FieldName,FieldArray);
+ if (FieldArray.GetSize() <= 0) return FALSE;
+
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
+ ASSERT(pFormField != NULL);
+
+ if (pFormField->GetFieldType() != FIELDTYPE_PUSHBUTTON)
+ return FALSE;
+
+ CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
+ if (!pFormControl)return FALSE;
+
+ CPDF_IconFit IconFit = pFormControl->GetIconFit();
+
+ FX_FLOAT fLeft,fBottom;
+ IconFit.GetIconPosition(fLeft,fBottom);
+
+ vp << (FX_INT32)fBottom;
+ }
+
+ return TRUE;
+}
+
+void Field::SetButtonAlignY(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number)
+{
+ //Not supported.
+}
+
+FX_BOOL Field::buttonFitBounds(OBJ_PROP_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ if (vp.IsSetting())
+ {
+ if (!m_bCanSet) return FALSE;
+
+ bool bVP;
+ vp >> bVP;
+
+ if (m_bDelay)
+ {
+ AddDelay_Bool(FP_BUTTONFITBOUNDS, bVP);
+ }
+ else
+ {
+ Field::SetButtonFitBounds(m_pDocument, m_FieldName, m_nFormControlIndex, bVP);
+ }
+ }
+ else
+ {
+ CFX_PtrArray FieldArray;
+ GetFormFields(m_FieldName,FieldArray);
+ if (FieldArray.GetSize() <= 0) return FALSE;
+
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
+ ASSERT(pFormField != NULL);
+
+ if (pFormField->GetFieldType() != FIELDTYPE_PUSHBUTTON)
+ return FALSE;
+
+ CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
+ if (!pFormControl)return FALSE;
+
+ CPDF_IconFit IconFit = pFormControl->GetIconFit();
+ vp << IconFit.GetFittingBounds();
+ }
+
+ return TRUE;
+}
+
+void Field::SetButtonFitBounds(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b)
+{
+ //Not supported.
+}
+
+FX_BOOL Field::buttonPosition(OBJ_PROP_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ if (vp.IsSetting())
+ {
+ if (!m_bCanSet) return FALSE;
+
+ int nVP;
+ vp >> nVP;
+
+ if (m_bDelay)
+ {
+ AddDelay_Int(FP_BUTTONPOSITION, nVP);
+ }
+ else
+ {
+ Field::SetButtonPosition(m_pDocument, m_FieldName, m_nFormControlIndex, nVP);
+ }
+ }
+ else
+ {
+ CFX_PtrArray FieldArray;
+ GetFormFields(m_FieldName,FieldArray);
+ if (FieldArray.GetSize() <= 0) return FALSE;
+
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
+ ASSERT(pFormField != NULL);
+
+ if (pFormField->GetFieldType() != FIELDTYPE_PUSHBUTTON)
+ return FALSE;
+
+ CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
+ if (!pFormControl)return FALSE;
+
+ vp << pFormControl->GetTextPosition();
+ }
+ return TRUE;
+}
+
+void Field::SetButtonPosition(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number)
+{
+ //Not supported.
+}
+
+FX_BOOL Field::buttonScaleHow(OBJ_PROP_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ if (vp.IsSetting())
+ {
+ if (!m_bCanSet) return FALSE;
+
+ int nVP;
+ vp >> nVP;
+
+ if (m_bDelay)
+ {
+ AddDelay_Int(FP_BUTTONSCALEHOW, nVP);
+ }
+ else
+ {
+ Field::SetButtonScaleHow(m_pDocument, m_FieldName, m_nFormControlIndex, nVP);
+ }
+ }
+ else
+ {
+ CFX_PtrArray FieldArray;
+ GetFormFields(m_FieldName, FieldArray);
+ if (FieldArray.GetSize() <= 0) return FALSE;
+
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
+ ASSERT(pFormField != NULL);
+
+ if (pFormField->GetFieldType() != FIELDTYPE_PUSHBUTTON)
+ return FALSE;
+
+ CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
+ if (!pFormControl)return FALSE;
+
+ CPDF_IconFit IconFit = pFormControl->GetIconFit();
+ if (IconFit.IsProportionalScale())
+ vp << (FX_INT32)0;
+ else
+ vp << (FX_INT32)1;
+ }
+
+ return TRUE;
+}
+
+void Field::SetButtonScaleHow(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number)
+{
+ //Not supported.
+}
+
+FX_BOOL Field::buttonScaleWhen(OBJ_PROP_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ if (vp.IsSetting())
+ {
+ if (!m_bCanSet) return FALSE;
+
+ int nVP;
+ vp >> nVP;
+
+ if (m_bDelay)
+ {
+ AddDelay_Int(FP_BUTTONSCALEWHEN, nVP);
+ }
+ else
+ {
+ Field::SetButtonScaleWhen(m_pDocument, m_FieldName, m_nFormControlIndex, nVP);
+ }
+ }
+ else
+ {
+ CFX_PtrArray FieldArray;
+ GetFormFields(m_FieldName,FieldArray);
+ if (FieldArray.GetSize() <= 0) return FALSE;
+
+ CPDF_FormField* pFormField = (CPDF_FormField*) FieldArray.ElementAt(0);
+ ASSERT(pFormField != NULL);
+
+ if (pFormField->GetFieldType() != FIELDTYPE_PUSHBUTTON)
+ return FALSE;
+
+ CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
+ if (!pFormControl) return FALSE;
+
+ CPDF_IconFit IconFit = pFormControl->GetIconFit();
+ int ScaleM = IconFit.GetScaleMethod();
+ switch (ScaleM)
+ {
+ case CPDF_IconFit::Always :
+ vp << (FX_INT32) CPDF_IconFit::Always;
+ break;
+ case CPDF_IconFit::Bigger :
+ vp << (FX_INT32) CPDF_IconFit::Bigger;
+ break;
+ case CPDF_IconFit::Never :
+ vp << (FX_INT32) CPDF_IconFit::Never;
+ break;
+ case CPDF_IconFit::Smaller :
+ vp << (FX_INT32) CPDF_IconFit::Smaller;
+ break;
+ }
+ }
+
+ return TRUE;
+}
+
+void Field::SetButtonScaleWhen(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number)
+{
+ //Not supported.
+}
+
+FX_BOOL Field::calcOrderIndex(OBJ_PROP_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ if (vp.IsSetting())
+ {
+ if (!m_bCanSet) return FALSE;
+
+ int nVP;
+ vp >> nVP;
+
+ if (m_bDelay)
+ {
+ AddDelay_Int(FP_CALCORDERINDEX, nVP);
+ }
+ else
+ {
+ Field::SetCalcOrderIndex(m_pDocument, m_FieldName, m_nFormControlIndex, nVP);
+ }
+ }
+ else
+ {
+ CFX_PtrArray FieldArray;
+ GetFormFields(m_FieldName, FieldArray);
+ if (FieldArray.GetSize() <= 0) return FALSE;
+
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
+ ASSERT(pFormField != NULL);
+
+ if (pFormField->GetFieldType() != FIELDTYPE_COMBOBOX && pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD)
+ return FALSE;
+
+ CPDFSDK_InterForm* pRDInterForm = m_pDocument->GetInterForm();
+ ASSERT(pRDInterForm != NULL);
+
+ CPDF_InterForm* pInterForm = pRDInterForm->GetInterForm();
+ ASSERT(pInterForm != NULL);
+
+ vp << (FX_INT32)pInterForm->FindFieldInCalculationOrder(pFormField);
+ }
+
+ return TRUE;
+}
+
+void Field::SetCalcOrderIndex(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number)
+{
+ //Not supported.
+}
+
+FX_BOOL Field::charLimit(OBJ_PROP_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ if (vp.IsSetting())
+ {
+ if (!m_bCanSet) return FALSE;
+
+ int nVP;
+ vp >> nVP;
+
+ if (m_bDelay)
+ {
+ AddDelay_Int(FP_CHARLIMIT, nVP);
+ }
+ else
+ {
+ Field::SetCharLimit(m_pDocument, m_FieldName, m_nFormControlIndex, nVP);
+ }
+ }
+ else
+ {
+ CFX_PtrArray FieldArray;
+ GetFormFields(m_FieldName, FieldArray);
+ if (FieldArray.GetSize() <= 0) return FALSE;
+
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
+ ASSERT(pFormField != NULL);
+
+ if (pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD)
+ return FALSE;
+
+ vp << (FX_INT32)pFormField->GetMaxLen();
+ }
+ return TRUE;
+}
+
+void Field::SetCharLimit(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number)
+{
+ //Not supported.
+}
+
+FX_BOOL Field::comb(OBJ_PROP_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ if (vp.IsSetting())
+ {
+ if (!m_bCanSet) return FALSE;
+
+ bool bVP;
+ vp >> bVP;
+
+ if (m_bDelay)
+ {
+ AddDelay_Bool(FP_COMB, bVP);
+ }
+ else
+ {
+ Field::SetComb(m_pDocument, m_FieldName, m_nFormControlIndex, bVP);
+ }
+ }
+ else
+ {
+ CFX_PtrArray FieldArray;
+ GetFormFields(m_FieldName,FieldArray);
+ if (FieldArray.GetSize() <= 0) return FALSE;
+
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
+ ASSERT(pFormField != NULL);
+
+ if (pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD)
+ return FALSE;
+
+ if (pFormField->GetFieldFlags() & FIELDFLAG_COMB)
+ vp << true;
+ else
+ vp << false;
+ }
+
+ return TRUE;
+}
+
+void Field::SetComb(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b)
+{
+ //Not supported.
+}
+
+FX_BOOL Field::commitOnSelChange(OBJ_PROP_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ if (vp.IsSetting())
+ {
+ if (!m_bCanSet) return FALSE;
+
+ bool bVP;
+ vp >> bVP;
+
+ if (m_bDelay)
+ {
+ AddDelay_Bool(FP_COMMITONSELCHANGE, bVP);
+ }
+ else
+ {
+ Field::SetCommitOnSelChange(m_pDocument, m_FieldName, m_nFormControlIndex, bVP);
+ }
+ }
+ else
+ {
+ CFX_PtrArray FieldArray;
+ GetFormFields(m_FieldName,FieldArray);
+ if (FieldArray.GetSize() <= 0) return FALSE;
+
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
+ ASSERT(pFormField != NULL);
+
+ if (pFormField->GetFieldType() != FIELDTYPE_COMBOBOX && pFormField->GetFieldType() != FIELDTYPE_LISTBOX)
+ return FALSE;
+
+ if (pFormField->GetFieldFlags() & FIELDFLAG_COMMITONSELCHANGE)
+ vp << true;
+ else
+ vp << false;
+ }
+
+ return TRUE;
+}
+
+void Field::SetCommitOnSelChange(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b)
+{
+ //Not supported.
+}
+
+FX_BOOL Field::currentValueIndices(OBJ_PROP_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ if (vp.IsSetting())
+ {
+ if (!m_bCanSet) return FALSE;
+
+ CFX_DWordArray array;
+
+ if (vp.GetType() == VT_number)
+ {
+ int iSelecting = 0;
+ vp >> iSelecting;
+ array.Add(iSelecting);
+ }
+ else if (vp.IsArrayObject())
+ {
+ CJS_Array SelArray(m_isolate);
+ CJS_Value SelValue(m_isolate);
+ int iSelecting;
+ vp >> SelArray;
+ for (int i=0,sz=SelArray.GetLength(); i<sz; i++)
+ {
+ SelArray.GetElement(i,SelValue);
+ iSelecting = (FX_INT32)SelValue;
+ array.Add(iSelecting);
+ }
+ }
+
+ if (m_bDelay)
+ {
+ AddDelay_WordArray(FP_CURRENTVALUEINDICES, array);
+ }
+ else
+ {
+ Field::SetCurrentValueIndices(m_pDocument, m_FieldName, m_nFormControlIndex, array);
+ }
+ }
+ else
+ {
+ CFX_PtrArray FieldArray;
+ GetFormFields(m_FieldName,FieldArray);
+ if (FieldArray.GetSize() <= 0) return FALSE;
+
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
+ ASSERT(pFormField != NULL);
+
+ if (pFormField->GetFieldType() != FIELDTYPE_COMBOBOX && pFormField->GetFieldType() != FIELDTYPE_LISTBOX)
+ return FALSE;
+
+ if (pFormField->CountSelectedItems() == 1)
+ vp << pFormField->GetSelectedIndex(0);
+ else if (pFormField->CountSelectedItems() > 1)
+ {
+ CJS_Array SelArray(m_isolate);
+ for (int i=0,sz=pFormField->CountSelectedItems(); i<sz; i++)
+ {
+ SelArray.SetElement(i, CJS_Value(m_isolate,pFormField->GetSelectedIndex(i)));
+ }
+ vp << SelArray;
+ }
+ else
+ vp << -1;
+ }
+
+ return TRUE;
+}
+
+void Field::SetCurrentValueIndices(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex,
+ const CFX_DWordArray& array)
+{
+ ASSERT(pDocument != NULL);
+
+ CFX_PtrArray FieldArray;
+ GetFormFields(pDocument, swFieldName, FieldArray);
+
+ for (int i=0,isz=FieldArray.GetSize(); i<isz; i++)
+ {
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(i);
+ ASSERT(pFormField != NULL);
+
+ int nFieldType = pFormField->GetFieldType();
+ if (nFieldType == FIELDTYPE_COMBOBOX || nFieldType == FIELDTYPE_LISTBOX)
+ {
+ FX_DWORD dwFieldFlags = pFormField->GetFieldFlags();
+ pFormField->ClearSelection(TRUE);
+
+ for (int i=0,sz=array.GetSize(); i<sz; i++)
+ {
+ if (i>0 && !(dwFieldFlags & (1<<21)))
+ {
+ break;
+ }
+
+ int iSelecting = (FX_INT32)array.GetAt(i);
+ if (iSelecting < pFormField->CountOptions() && !pFormField->IsItemSelected(iSelecting))
+ pFormField->SetItemSelection(iSelecting, TRUE);
+
+ }
+ UpdateFormField(pDocument, pFormField, TRUE, TRUE, TRUE);
+ }
+ }
+}
+
+FX_BOOL Field::defaultStyle(OBJ_PROP_PARAMS)
+{
+ // MQG sError = JSGetStringFromID(IDS_STRING_NOTSUPPORT);
+ return FALSE;
+
+ if (vp.IsSetting())
+ {
+ if (!m_bCanSet) return FALSE;
+
+ ;
+ }
+ else
+ {
+ ;
+ }
+ return TRUE;
+}
+
+void Field::SetDefaultStyle(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex)
+{
+ //Not supported.
+}
+
+FX_BOOL Field::defaultValue(OBJ_PROP_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ if (vp.IsSetting())
+ {
+ if (!m_bCanSet) return FALSE;
+
+ CFX_WideString WideStr;
+ vp >> WideStr;
+
+ if (m_bDelay)
+ {
+ AddDelay_WideString(FP_DEFAULTVALUE, WideStr);
+ }
+ else
+ {
+ Field::SetDefaultValue(m_pDocument, m_FieldName, m_nFormControlIndex, WideStr);
+ }
+ }
+ else
+ {
+ CFX_PtrArray FieldArray;
+ GetFormFields(m_FieldName,FieldArray);
+ if (FieldArray.GetSize() <= 0) return FALSE;
+
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
+ ASSERT(pFormField != NULL);
+
+ if (pFormField->GetFieldType() == FIELDTYPE_PUSHBUTTON ||
+ pFormField->GetFieldType() == FIELDTYPE_SIGNATURE)
+ return FALSE;
+
+ vp << pFormField->GetDefaultValue();
+ }
+ return TRUE;
+}
+
+void Field::SetDefaultValue(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex,
+ const CFX_WideString& string)
+{
+ //Not supported.
+}
+
+FX_BOOL Field::doNotScroll(OBJ_PROP_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ if (vp.IsSetting())
+ {
+ if (!m_bCanSet) return FALSE;
+
+ bool bVP;
+ vp >> bVP;
+
+ if (m_bDelay)
+ {
+ AddDelay_Bool(FP_DONOTSCROLL, bVP);
+ }
+ else
+ {
+ Field::SetDoNotScroll(m_pDocument, m_FieldName, m_nFormControlIndex, bVP);
+ }
+ }
+ else
+ {
+ CFX_PtrArray FieldArray;
+ GetFormFields(m_FieldName,FieldArray);
+ if (FieldArray.GetSize() <= 0) return FALSE;
+
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
+ ASSERT(pFormField != NULL);
+
+ if (pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD)
+ return FALSE;
+
+ if (pFormField->GetFieldFlags() & FIELDFLAG_DONOTSCROLL)
+ vp << true;
+ else
+ vp << false;
+ }
+
+ return TRUE;
+}
+
+void Field::SetDoNotScroll(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b)
+{
+ //Not supported.
+}
+
+FX_BOOL Field::doNotSpellCheck(OBJ_PROP_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ if (vp.IsSetting())
+ {
+ if (!m_bCanSet) return FALSE;
+
+ bool bVP;
+ vp >> bVP;
+ }
+ else
+ {
+ CFX_PtrArray FieldArray;
+ GetFormFields(m_FieldName,FieldArray);
+ if (FieldArray.GetSize() <= 0) return FALSE;
+
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
+ ASSERT(pFormField != NULL);
+
+ if (pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD &&
+ pFormField->GetFieldType() != FIELDTYPE_COMBOBOX)
+ return FALSE;
+
+ if (pFormField->GetFieldFlags() & FIELDFLAG_DONOTSPELLCHECK)
+ vp << true;
+ else
+ vp << false;
+ }
+
+ return TRUE;
+}
+
+void Field::SetDelay(FX_BOOL bDelay)
+{
+ m_bDelay = bDelay;
+
+ if (!m_bDelay)
+ {
+ if (m_pJSDoc)
+ m_pJSDoc->DoFieldDelay(m_FieldName, m_nFormControlIndex);
+ }
+}
+
+FX_BOOL Field::delay(OBJ_PROP_PARAMS)
+{
+ if (vp.IsSetting())
+ {
+ if (!m_bCanSet) return FALSE;
+
+ bool bVP;
+ vp >> bVP;
+
+ SetDelay(bVP);
+ }
+ else
+ {
+ vp << m_bDelay;
+ }
+ return TRUE;
+}
+
+FX_BOOL Field::display(OBJ_PROP_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ if (vp.IsSetting())
+ {
+ if (!m_bCanSet) return FALSE;
+
+ int nVP;
+ vp >> nVP;
+
+ if (m_bDelay)
+ {
+ AddDelay_Int(FP_DISPLAY, nVP);
+ }
+ else
+ {
+ Field::SetDisplay(m_pDocument, m_FieldName, m_nFormControlIndex, nVP);
+ }
+ }
+ else
+ {
+ CFX_PtrArray FieldArray;
+ GetFormFields(m_FieldName,FieldArray);
+ if (FieldArray.GetSize() <= 0) return FALSE;
+
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
+ ASSERT(pFormField != NULL);
+
+ CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInterForm();
+ ASSERT(pInterForm != NULL);
+
+ CPDFSDK_Widget* pWidget = pInterForm->GetWidget(GetSmartFieldControl(pFormField));
+ if (!pWidget)return FALSE;
+
+ FX_DWORD dwFlag = pWidget->GetFlags();
+
+ if (ANNOTFLAG_INVISIBLE & dwFlag || ANNOTFLAG_HIDDEN & dwFlag)
+ {
+ vp << (FX_INT32)1;
+ }
+ else
+ {
+ if (ANNOTFLAG_PRINT & dwFlag)
+ {
+ if (ANNOTFLAG_NOVIEW & dwFlag)
+ {
+ vp << (FX_INT32)3;
+ }
+ else
+ {
+ vp << (FX_INT32)0;
+ }
+ }
+ else
+ {
+ vp << (FX_INT32)2;
+ }
+ }
+ }
+
+ return TRUE;
+}
+
+void Field::SetDisplay(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number)
+{
+ ASSERT(pDocument != NULL);
+
+ CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pDocument->GetInterForm();
+ ASSERT(pInterForm != NULL);
+
+ CFX_PtrArray FieldArray;
+ GetFormFields(pDocument, swFieldName, FieldArray);
+
+ for (int i=0,isz=FieldArray.GetSize(); i<isz; i++)
+ {
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(i);
+ ASSERT(pFormField != NULL);
+
+ if (nControlIndex < 0)
+ {
+ FX_BOOL bSet = FALSE;
+ for (int j=0,jsz = pFormField->CountControls(); j<jsz; j++)
+ {
+ CPDF_FormControl* pFormControl = pFormField->GetControl(j);
+ ASSERT(pFormControl != NULL);
+
+ if (CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormControl))
+ {
+ FX_DWORD dwFlag = pWidget->GetFlags();
+ switch (number)
+ {
+ case 0:
+ dwFlag &= (~ANNOTFLAG_INVISIBLE);
+ dwFlag &= (~ANNOTFLAG_HIDDEN);
+ dwFlag &= (~ANNOTFLAG_NOVIEW);
+ dwFlag |= ANNOTFLAG_PRINT;
+ break;
+ case 1:
+ dwFlag &= (~ANNOTFLAG_INVISIBLE);
+ dwFlag &= (~ANNOTFLAG_NOVIEW);
+ dwFlag |= (ANNOTFLAG_HIDDEN | ANNOTFLAG_PRINT);
+ break;
+ case 2:
+ dwFlag &= (~ANNOTFLAG_INVISIBLE);
+ dwFlag &= (~ANNOTFLAG_PRINT);
+ dwFlag &= (~ANNOTFLAG_HIDDEN);
+ dwFlag &= (~ANNOTFLAG_NOVIEW);
+ break;
+ case 3:
+ dwFlag |= ANNOTFLAG_NOVIEW;
+ dwFlag |= ANNOTFLAG_PRINT;
+ dwFlag &= (~ANNOTFLAG_HIDDEN);
+ break;
+ }
+
+ if (dwFlag != pWidget->GetFlags())
+ {
+ pWidget->SetFlags(dwFlag);
+ bSet = TRUE;
+ }
+ }
+ }
+
+ if (bSet) UpdateFormField(pDocument, pFormField, TRUE, FALSE, TRUE);
+ }
+ else
+ {
+ if(nControlIndex >= pFormField->CountControls()) return;
+ if (CPDF_FormControl* pFormControl = pFormField->GetControl(nControlIndex))
+ {
+ if (CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormControl))
+ {
+
+ FX_DWORD dwFlag = pWidget->GetFlags();
+ switch (number)
+ {
+ case 0:
+ dwFlag &= (~ANNOTFLAG_INVISIBLE);
+ dwFlag &= (~ANNOTFLAG_HIDDEN);
+ dwFlag &= (~ANNOTFLAG_NOVIEW);
+ dwFlag |= ANNOTFLAG_PRINT;
+ break;
+ case 1:
+ dwFlag &= (~ANNOTFLAG_INVISIBLE);
+ dwFlag &= (~ANNOTFLAG_NOVIEW);
+ dwFlag |= (ANNOTFLAG_HIDDEN | ANNOTFLAG_PRINT);
+ break;
+ case 2:
+ dwFlag &= (~ANNOTFLAG_INVISIBLE);
+ dwFlag &= (~ANNOTFLAG_PRINT);
+ dwFlag &= (~ANNOTFLAG_HIDDEN);
+ dwFlag &= (~ANNOTFLAG_NOVIEW);
+ break;
+ case 3:
+ dwFlag |= ANNOTFLAG_NOVIEW;
+ dwFlag |= ANNOTFLAG_PRINT;
+ dwFlag &= (~ANNOTFLAG_HIDDEN);
+ break;
+ }
+ if (dwFlag != pWidget->GetFlags())
+ {
+ pWidget->SetFlags(dwFlag);
+ UpdateFormControl(pDocument, pFormControl, TRUE, FALSE, TRUE);
+ }
+ }
+ }
+ }
+ }
+}
+
+FX_BOOL Field::doc(OBJ_PROP_PARAMS)
+{
+ ASSERT(m_pJSDoc != NULL);
+
+ if (!vp.IsGetting())return FALSE;
+
+ vp << (CJS_Object*)(*m_pJSDoc);
+
+ return TRUE;
+}
+
+FX_BOOL Field::editable(OBJ_PROP_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ if (vp.IsSetting())
+ {
+ if (!m_bCanSet) return FALSE;
+
+ bool bVP;
+ vp >> bVP;
+
+ }
+ else
+ {
+ CFX_PtrArray FieldArray;
+ GetFormFields(m_FieldName, FieldArray);
+ if (FieldArray.GetSize() <= 0) return FALSE;
+
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
+ ASSERT(pFormField != NULL);
+
+ if (pFormField->GetFieldType() != FIELDTYPE_COMBOBOX)
+ return FALSE;
+
+ if (pFormField->GetFieldFlags() & FIELDFLAG_EDIT)
+ vp << true;
+ else
+ vp << false;
+ }
+
+ return TRUE;
+}
+
+FX_BOOL Field::exportValues(OBJ_PROP_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ CFX_PtrArray FieldArray;
+ GetFormFields(m_FieldName,FieldArray);
+ if (FieldArray.GetSize() <= 0) return FALSE;
+
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
+ ASSERT(pFormField != NULL);
+
+ if (pFormField->GetFieldType() != FIELDTYPE_CHECKBOX &&
+ pFormField->GetFieldType() != FIELDTYPE_RADIOBUTTON)
+ return FALSE;
+
+ if (vp.IsSetting())
+ {
+ if (!m_bCanSet) return FALSE;
+ if (!vp.IsArrayObject())return FALSE;
+ }
+ else
+ {
+ CJS_Array ExportValusArray(m_isolate);
+
+ if (m_nFormControlIndex < 0)
+ {
+ for (int i=0,sz=pFormField->CountControls(); i<sz; i++)
+ {
+ CPDF_FormControl* pFormControl = pFormField->GetControl(i);
+ ASSERT(pFormControl != NULL);
+
+ ExportValusArray.SetElement(i, CJS_Value(m_isolate,(FX_LPCWSTR)pFormControl->GetExportValue()));
+ }
+ }
+ else
+ {
+ if(m_nFormControlIndex >= pFormField->CountControls()) return FALSE;
+ CPDF_FormControl* pFormControl = pFormField->GetControl(m_nFormControlIndex);
+ if (!pFormControl) return FALSE;
+
+ ExportValusArray.SetElement(0, CJS_Value(m_isolate,(FX_LPCWSTR)pFormControl->GetExportValue()));
+ }
+
+ vp << ExportValusArray;
+ }
+
+ return TRUE;
+}
+
+FX_BOOL Field::fileSelect(OBJ_PROP_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ CFX_PtrArray FieldArray;
+ GetFormFields(m_FieldName, FieldArray);
+ if (FieldArray.GetSize() <= 0) return FALSE;
+
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
+ ASSERT(pFormField != NULL);
+
+ if (pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD)
+ return FALSE;
+
+ if (vp.IsSetting())
+ {
+ if (!m_bCanSet) return FALSE;
+
+ bool bVP;
+ vp >> bVP;
+
+ }
+ else
+ {
+ if (pFormField->GetFieldFlags() & FIELDFLAG_FILESELECT)
+ vp << true;
+ else
+ vp << false;
+ }
+
+ return TRUE;
+}
+
+FX_BOOL Field::fillColor(OBJ_PROP_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ CJS_Array crArray(m_isolate);
+
+ CFX_PtrArray FieldArray;
+ GetFormFields(m_FieldName,FieldArray);
+ if (FieldArray.GetSize() <= 0) return FALSE;
+
+ if (vp.IsSetting())
+ {
+ if (!m_bCanSet) return FALSE;
+ if (!vp.IsArrayObject()) return FALSE;
+
+ vp >> crArray;
+
+ CPWL_Color color;
+ color::ConvertArrayToPWLColor(crArray, color);
+
+ if (m_bDelay)
+ {
+ AddDelay_Color(FP_FILLCOLOR, color);
+ }
+ else
+ {
+ Field::SetFillColor(m_pDocument, m_FieldName, m_nFormControlIndex, color);
+ }
+ }
+ else
+ {
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
+ ASSERT(pFormField != NULL);
+
+ CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
+ if (!pFormControl)return FALSE;
+
+ int iColorType;
+ pFormControl->GetBackgroundColor(iColorType);
+
+ CPWL_Color color;
+
+ if (iColorType == COLORTYPE_TRANSPARENT)
+ {
+ color = CPWL_Color(COLORTYPE_TRANSPARENT);
+ }
+ else if (iColorType == COLORTYPE_GRAY)
+ {
+ color = CPWL_Color(COLORTYPE_GRAY, pFormControl->GetOriginalBackgroundColor(0));
+ }
+ else if (iColorType == COLORTYPE_RGB)
+ {
+ color = CPWL_Color(COLORTYPE_RGB, pFormControl->GetOriginalBackgroundColor(0),
+ pFormControl->GetOriginalBackgroundColor(1),
+ pFormControl->GetOriginalBackgroundColor(2));
+ }
+ else if (iColorType == COLORTYPE_CMYK)
+ {
+ color = CPWL_Color(COLORTYPE_CMYK, pFormControl->GetOriginalBackgroundColor(0),
+ pFormControl->GetOriginalBackgroundColor(1),
+ pFormControl->GetOriginalBackgroundColor(2),
+ pFormControl->GetOriginalBackgroundColor(3));
+ }
+ else
+ return FALSE;
+
+ color::ConvertPWLColorToArray(color, crArray);
+ vp << crArray;
+ }
+
+ return TRUE;
+}
+
+void Field::SetFillColor(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CPWL_Color& color)
+{
+ //Not supported.
+}
+
+FX_BOOL Field::hidden(OBJ_PROP_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ if (vp.IsSetting())
+ {
+ if (!m_bCanSet) return FALSE;
+
+ bool bVP;
+ vp >> bVP;
+
+ if (m_bDelay)
+ {
+ AddDelay_Bool(FP_HIDDEN, bVP);
+ }
+ else
+ {
+ Field::SetHidden(m_pDocument, m_FieldName, m_nFormControlIndex, bVP);
+ }
+ }
+ else
+ {
+ CFX_PtrArray FieldArray;
+ GetFormFields(m_FieldName,FieldArray);
+ if (FieldArray.GetSize() <= 0) return FALSE;
+
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
+ ASSERT(pFormField != NULL);
+
+ CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInterForm();
+ ASSERT(pInterForm != NULL);
+
+ CPDFSDK_Widget* pWidget = pInterForm->GetWidget(GetSmartFieldControl(pFormField));
+ if (!pWidget) return FALSE;
+
+ FX_DWORD dwFlags = pWidget->GetFlags();
+
+ if (ANNOTFLAG_INVISIBLE & dwFlags || ANNOTFLAG_HIDDEN & dwFlags)
+ {
+ vp << true;
+ }
+ else
+ vp << false;
+ }
+
+ return TRUE;
+}
+
+void Field::SetHidden(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b)
+{
+ ASSERT(pDocument != NULL);
+
+ CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pDocument->GetInterForm();
+ ASSERT(pInterForm != NULL);
+
+ CFX_PtrArray FieldArray;
+ GetFormFields(pDocument, swFieldName, FieldArray);
+
+ for (int i=0,isz=FieldArray.GetSize(); i<isz; i++)
+ {
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(i);
+ ASSERT(pFormField != NULL);
+
+ if (nControlIndex < 0)
+ {
+ FX_BOOL bSet = FALSE;
+ for (int j=0,jsz = pFormField->CountControls(); j<jsz; j++)
+ {
+ if (CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormField->GetControl(j)))
+ {
+ FX_DWORD dwFlags = pWidget->GetFlags();
+
+ if (b)
+ {
+ dwFlags &= (~ANNOTFLAG_INVISIBLE);
+ dwFlags &= (~ANNOTFLAG_NOVIEW);
+ dwFlags |= (ANNOTFLAG_HIDDEN | ANNOTFLAG_PRINT);
+ }
+ else
+ {
+ dwFlags &= (~ANNOTFLAG_INVISIBLE);
+ dwFlags &= (~ANNOTFLAG_HIDDEN);
+ dwFlags &= (~ANNOTFLAG_NOVIEW);
+ dwFlags |= ANNOTFLAG_PRINT;
+ }
+
+ if (dwFlags != pWidget->GetFlags())
+ {
+ pWidget->SetFlags(dwFlags);
+ bSet = TRUE;
+ }
+ }
+ }
+
+ if (bSet)
+ UpdateFormField(pDocument, pFormField, TRUE, FALSE, TRUE);
+ }
+ else
+ {
+ if(nControlIndex >= pFormField->CountControls()) return;
+ if (CPDF_FormControl* pFormControl = pFormField->GetControl(nControlIndex))
+ {
+ if (CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormControl))
+ {
+ FX_DWORD dwFlags = pWidget->GetFlags();
+
+ if (b)
+ {
+ dwFlags &= (~ANNOTFLAG_INVISIBLE);
+ dwFlags &= (~ANNOTFLAG_NOVIEW);
+ dwFlags |= (ANNOTFLAG_HIDDEN | ANNOTFLAG_PRINT);
+ }
+ else
+ {
+ dwFlags &= (~ANNOTFLAG_INVISIBLE);
+ dwFlags &= (~ANNOTFLAG_HIDDEN);
+ dwFlags &= (~ANNOTFLAG_NOVIEW);
+ dwFlags |= ANNOTFLAG_PRINT;
+ }
+
+ if (dwFlags != pWidget->GetFlags())
+ {
+ pWidget->SetFlags(dwFlags);
+ UpdateFormControl(pDocument, pFormControl, TRUE, FALSE, TRUE);
+ }
+ }
+ }
+ }
+ }
+}
+
+FX_BOOL Field::highlight(OBJ_PROP_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ if (vp.IsSetting())
+ {
+ if (!m_bCanSet) return FALSE;
+
+ CFX_ByteString strMode;
+ vp >> strMode;
+
+ if (m_bDelay)
+ {
+ AddDelay_String(FP_HIGHLIGHT, strMode);
+ }
+ else
+ {
+ Field::SetHighlight(m_pDocument, m_FieldName, m_nFormControlIndex, strMode);
+ }
+ }
+ else
+ {
+ CFX_PtrArray FieldArray;
+ GetFormFields(m_FieldName,FieldArray);
+ if (FieldArray.GetSize() <= 0) return FALSE;
+
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
+ ASSERT(pFormField != NULL);
+
+ if (pFormField->GetFieldType() != FIELDTYPE_PUSHBUTTON)
+ return FALSE;
+
+ CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
+ if (!pFormControl) return FALSE;
+
+ int eHM = pFormControl->GetHighlightingMode();
+ switch (eHM)
+ {
+ case CPDF_FormControl::None:
+ vp << (FX_LPCWSTR)L"none";
+ break;
+ case CPDF_FormControl::Push:
+ vp << (FX_LPCWSTR)L"push";
+ break;
+ case CPDF_FormControl::Invert:
+ vp << (FX_LPCWSTR)L"invert";
+ break;
+ case CPDF_FormControl::Outline:
+ vp << (FX_LPCWSTR)L"outline";
+ break;
+ case CPDF_FormControl::Toggle:
+ vp << (FX_LPCWSTR)L"toggle";
+ break;
+ }
+ }
+
+ return TRUE;
+}
+
+void Field::SetHighlight(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CFX_ByteString& string)
+{
+ //Not supported.
+}
+
+FX_BOOL Field::lineWidth(OBJ_PROP_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ if (vp.IsSetting())
+ {
+ if (!m_bCanSet) return FALSE;
+
+ int iWidth;
+ vp >> iWidth;
+
+ if (m_bDelay)
+ {
+ AddDelay_Int(FP_LINEWIDTH, iWidth);
+ }
+ else
+ {
+ Field::SetLineWidth(m_pDocument, m_FieldName, m_nFormControlIndex, iWidth);
+ }
+ }
+ else
+ {
+ CFX_PtrArray FieldArray;
+ GetFormFields(m_FieldName,FieldArray);
+ if (FieldArray.GetSize() <= 0) return FALSE;
+
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
+ ASSERT(pFormField != NULL);
+
+ CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
+ if (!pFormControl) return FALSE;
+
+ CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInterForm();
+ ASSERT(pInterForm != NULL);
+
+ if(!pFormField->CountControls()) return FALSE;
+
+ CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormField->GetControl(0));
+ if (!pWidget) return FALSE;
+
+ vp << (FX_INT32)pWidget->GetBorderWidth();
+ }
+
+ return TRUE;
+}
+
+void Field::SetLineWidth(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number)
+{
+ ASSERT(pDocument != NULL);
+
+ CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pDocument->GetInterForm();
+ ASSERT(pInterForm != NULL);
+
+ CFX_PtrArray FieldArray;
+ GetFormFields(pDocument, swFieldName, FieldArray);
+
+ for (int i=0,isz=FieldArray.GetSize(); i<isz; i++)
+ {
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(i);
+ ASSERT(pFormField != NULL);
+
+ if (nControlIndex < 0)
+ {
+ FX_BOOL bSet = FALSE;
+ for (int j=0,jsz=pFormField->CountControls(); j<jsz; j++)
+ {
+ CPDF_FormControl* pFormControl = pFormField->GetControl(j);
+ ASSERT(pFormControl != NULL);
+
+ if (CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormControl))
+ {
+ if (number != pWidget->GetBorderWidth())
+ {
+ pWidget->SetBorderWidth(number);
+ bSet = TRUE;
+ }
+ }
+ }
+ if (bSet) UpdateFormField(pDocument, pFormField, TRUE, TRUE, TRUE);
+ }
+ else
+ {
+ if(nControlIndex >= pFormField->CountControls()) return;
+ if (CPDF_FormControl* pFormControl = pFormField->GetControl(nControlIndex))
+ {
+ if (CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormControl))
+ {
+ if (number != pWidget->GetBorderWidth())
+ {
+ pWidget->SetBorderWidth(number);
+ UpdateFormControl(pDocument, pFormControl, TRUE, TRUE, TRUE);
+ }
+ }
+ }
+ }
+ }
+}
+
+FX_BOOL Field::multiline(OBJ_PROP_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ if (vp.IsSetting())
+ {
+ if (!m_bCanSet) return FALSE;
+
+ bool bVP;
+ vp >> bVP;
+
+ if (m_bDelay)
+ {
+ AddDelay_Bool(FP_MULTILINE, bVP);
+ }
+ else
+ {
+ Field::SetMultiline(m_pDocument, m_FieldName, m_nFormControlIndex, bVP);
+ }
+ }
+ else
+ {
+ CFX_PtrArray FieldArray;
+ GetFormFields(m_FieldName, FieldArray);
+ if (FieldArray.GetSize() <= 0) return FALSE;
+
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
+ ASSERT(pFormField != NULL);
+
+ if (pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD)
+ return FALSE;
+
+ if (pFormField->GetFieldFlags() & FIELDFLAG_MULTILINE)
+ vp << true;
+ else
+ vp << false;
+ }
+
+ return TRUE;
+}
+
+void Field::SetMultiline(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b)
+{
+ //Not supported.
+}
+
+FX_BOOL Field::multipleSelection(OBJ_PROP_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ if (vp.IsSetting())
+ {
+ if (!m_bCanSet) return FALSE;
+
+ bool bVP;
+ vp >> bVP;
+
+ if (m_bDelay)
+ {
+ AddDelay_Bool(FP_MULTIPLESELECTION, bVP);
+ }
+ else
+ {
+ Field::SetMultipleSelection(m_pDocument, m_FieldName, m_nFormControlIndex, bVP);
+ }
+ }
+ else
+ {
+ CFX_PtrArray FieldArray;
+ GetFormFields(m_FieldName,FieldArray);
+ if (FieldArray.GetSize() <= 0) return FALSE;
+
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
+ ASSERT(pFormField != NULL);
+
+ if (pFormField->GetFieldType() != FIELDTYPE_LISTBOX)
+ return FALSE;
+
+ if (pFormField->GetFieldFlags() & FIELDFLAG_MULTISELECT)
+ vp << true;
+ else
+ vp << false;
+ }
+
+ return TRUE;
+}
+
+void Field::SetMultipleSelection(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b)
+{
+ //Not supported.
+}
+
+FX_BOOL Field::name(OBJ_PROP_PARAMS)
+{
+ if (!vp.IsGetting()) return FALSE;
+
+ CFX_PtrArray FieldArray;
+ GetFormFields(m_FieldName, FieldArray);
+ if (FieldArray.GetSize() <= 0) return FALSE;
+
+ vp << m_FieldName;
+
+ return TRUE;
+}
+
+FX_BOOL Field::numItems(OBJ_PROP_PARAMS)
+{
+ CFX_PtrArray FieldArray;
+ GetFormFields(m_FieldName, FieldArray);
+ if (FieldArray.GetSize() <= 0) return FALSE;
+
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
+ ASSERT(pFormField != NULL);
+
+ if (pFormField->GetFieldType() != FIELDTYPE_COMBOBOX &&
+ pFormField->GetFieldType() != FIELDTYPE_LISTBOX)
+ return FALSE;
+
+ if (!vp.IsGetting()) return FALSE;
+
+ vp << (FX_INT32)pFormField->CountOptions();
+
+ return TRUE;
+}
+
+FX_BOOL Field::page(OBJ_PROP_PARAMS)
+{
+ if (!vp.IsGetting()) return FALSE;
+
+ CFX_PtrArray FieldArray;
+ GetFormFields(m_FieldName, FieldArray);
+ if (FieldArray.GetSize() <= 0) return FALSE;
+
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
+ if (!pFormField) return FALSE;
+
+ ASSERT(m_pDocument != NULL);
+
+ CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInterForm();
+ ASSERT(pInterForm != NULL);
+
+ CFX_PtrArray widgetArray;
+ pInterForm->GetWidgets(pFormField, widgetArray);
+
+ if (widgetArray.GetSize() > 0)
+ {
+ CJS_Array PageArray(m_isolate);
+
+ for (int i=0,sz=widgetArray.GetSize(); i<sz; i++)
+ {
+ CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)widgetArray.GetAt(i);
+ ASSERT(pWidget != NULL);
+
+ CPDFSDK_PageView* pPageView = pWidget->GetPageView();
+ if(!pPageView)
+ return FALSE;
+
+ PageArray.SetElement(i, CJS_Value(m_isolate,(FX_INT32)pPageView->GetPageIndex()));
+ }
+
+ vp << PageArray;
+ }
+ else
+ {
+ vp << (FX_INT32) -1;
+ }
+
+ return TRUE;
+}
+
+FX_BOOL Field::password(OBJ_PROP_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ if (vp.IsSetting())
+ {
+ if (!m_bCanSet) return FALSE;
+
+ bool bVP;
+ vp >> bVP;
+
+ if (m_bDelay)
+ {
+ AddDelay_Bool(FP_PASSWORD, bVP);
+ }
+ else
+ {
+ Field::SetPassword(m_pDocument, m_FieldName, m_nFormControlIndex, bVP);
+ }
+ }
+ else
+ {
+ CFX_PtrArray FieldArray;
+ GetFormFields(m_FieldName,FieldArray);
+ if (FieldArray.GetSize() <= 0) return FALSE;
+
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
+ ASSERT(pFormField != NULL);
+
+ if (pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD)
+ return FALSE;
+
+ if (pFormField->GetFieldFlags() & FIELDFLAG_PASSWORD)
+ vp << true;
+ else
+ vp << false;
+ }
+
+ return TRUE;
+}
+
+void Field::SetPassword(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b)
+{
+ //Not supported.
+}
+
+FX_BOOL Field::print(OBJ_PROP_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInterForm();
+ ASSERT(pInterForm != NULL);
+
+ CFX_PtrArray FieldArray;
+ GetFormFields(m_FieldName, FieldArray);
+ if (FieldArray.GetSize() <= 0) return FALSE;
+
+ if (vp.IsSetting())
+ {
+ if (!m_bCanSet) return FALSE;
+
+ bool bVP;
+ vp >> bVP;
+
+ for (int i=0,isz=FieldArray.GetSize(); i<isz; i++)
+ {
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(i);
+ ASSERT(pFormField != NULL);
+
+ if (m_nFormControlIndex < 0)
+ {
+ FX_BOOL bSet = FALSE;
+ for (int j=0,jsz = pFormField->CountControls(); j<jsz; j++)
+ {
+ if (CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormField->GetControl(j)))
+ {
+ FX_DWORD dwFlags = pWidget->GetFlags();
+ if (bVP)
+ dwFlags |= ANNOTFLAG_PRINT;
+ else
+ dwFlags &= ~ANNOTFLAG_PRINT;
+
+ if (dwFlags != pWidget->GetFlags())
+ {
+ pWidget->SetFlags(dwFlags);
+ bSet = TRUE;
+ }
+ }
+ }
+
+ if (bSet)
+ UpdateFormField(m_pDocument, pFormField, TRUE, FALSE, TRUE);
+ }
+ else
+ {
+ if(m_nFormControlIndex >= pFormField->CountControls()) return FALSE;
+ if (CPDF_FormControl* pFormControl = pFormField->GetControl(m_nFormControlIndex))
+ {
+ if (CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormControl))
+ {
+ FX_DWORD dwFlags = pWidget->GetFlags();
+ if (bVP)
+ dwFlags |= ANNOTFLAG_PRINT;
+ else
+ dwFlags &= ~ANNOTFLAG_PRINT;
+
+ if (dwFlags != pWidget->GetFlags())
+ {
+ pWidget->SetFlags(dwFlags);
+ UpdateFormControl(m_pDocument, pFormField->GetControl(m_nFormControlIndex), TRUE, FALSE, TRUE);
+ }
+ }
+ }
+ }
+ }
+ }
+ else
+ {
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
+ ASSERT(pFormField != NULL);
+
+ CPDFSDK_Widget* pWidget = pInterForm->GetWidget(GetSmartFieldControl(pFormField));
+ if (!pWidget) return FALSE;
+
+ if (pWidget->GetFlags() & ANNOTFLAG_PRINT)
+ vp << true;
+ else
+ vp << false;
+ }
+
+ return TRUE;
+}
+
+FX_BOOL Field::radiosInUnison(OBJ_PROP_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ CFX_PtrArray FieldArray;
+ GetFormFields(m_FieldName,FieldArray);
+ if (FieldArray.GetSize() <= 0) return FALSE;
+
+ if (vp.IsSetting())
+ {
+ if (!m_bCanSet) return FALSE;
+
+ bool bVP;
+ vp >> bVP;
+
+ }
+ else
+ {
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
+ ASSERT(pFormField != NULL);
+
+ if (pFormField->GetFieldType() != FIELDTYPE_RADIOBUTTON)
+ return FALSE;
+
+ if (pFormField->GetFieldFlags() & FIELDFLAG_RADIOSINUNISON)
+ vp << true;
+ else
+ vp << false;
+ }
+
+ return TRUE;
+}
+
+FX_BOOL Field::readonly(OBJ_PROP_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ CFX_PtrArray FieldArray;
+ GetFormFields(m_FieldName,FieldArray);
+ if (FieldArray.GetSize() <= 0) return FALSE;
+
+ if (vp.IsSetting())
+ {
+ if (!m_bCanSet) return FALSE;
+
+ bool bVP;
+ vp >> bVP;
+
+ }
+ else
+ {
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
+ ASSERT(pFormField != NULL);
+
+ if (pFormField->GetFieldFlags() & FIELDFLAG_READONLY)
+ vp << true;
+ else
+ vp << false;
+ }
+
+ return TRUE;
+}
+
+FX_BOOL Field::rect(OBJ_PROP_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ if (vp.IsSetting())
+ {
+ if (!m_bCanSet) return FALSE;
+ if (!vp.IsArrayObject())return FALSE;
+
+ CJS_Array rcArray(m_isolate);
+ vp >> rcArray;
+ CJS_Value Upper_Leftx(m_isolate), Upper_Lefty(m_isolate), Lower_Rightx(m_isolate), Lower_Righty(m_isolate);
+ rcArray.GetElement(0, Upper_Leftx);
+ rcArray.GetElement(1, Upper_Lefty);
+ rcArray.GetElement(2, Lower_Rightx);
+ rcArray.GetElement(3, Lower_Righty);
+
+ FX_FLOAT pArray[4] = {0.0f,0.0f,0.0f,0.0f};
+ pArray[0] = (FX_FLOAT)(FX_INT32)Upper_Leftx;
+ pArray[1] = (FX_FLOAT)(FX_INT32)Lower_Righty;
+ pArray[2] = (FX_FLOAT)(FX_INT32)Lower_Rightx;
+ pArray[3] = (FX_FLOAT)(FX_INT32)Upper_Lefty;
+
+ CPDF_Rect crRect(pArray);
+
+ if (m_bDelay)
+ {
+ AddDelay_Rect(FP_RECT, crRect);
+ }
+ else
+ {
+ Field::SetRect(m_pDocument, m_FieldName, m_nFormControlIndex, crRect);
+ }
+ }
+ else
+ {
+ CFX_PtrArray FieldArray;
+ GetFormFields(m_FieldName,FieldArray);
+ if (FieldArray.GetSize() <= 0) return FALSE;
+
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
+ ASSERT(pFormField != NULL);
+
+ CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInterForm();
+ ASSERT(pInterForm != NULL);
+
+ CPDFSDK_Widget* pWidget = pInterForm->GetWidget(GetSmartFieldControl(pFormField));
+ if (!pWidget) return FALSE;
+
+ CFX_FloatRect crRect = pWidget->GetRect();
+ CJS_Value Upper_Leftx(m_isolate),Upper_Lefty(m_isolate),Lower_Rightx(m_isolate),Lower_Righty(m_isolate);
+ Upper_Leftx = (FX_INT32)crRect.left;
+ Upper_Lefty = (FX_INT32)crRect.top;
+ Lower_Rightx = (FX_INT32)crRect.right;
+ Lower_Righty = (FX_INT32)crRect.bottom;
+
+ CJS_Array rcArray(m_isolate);
+ rcArray.SetElement(0,Upper_Leftx);
+ rcArray.SetElement(1,Upper_Lefty);
+ rcArray.SetElement(2,Lower_Rightx);
+ rcArray.SetElement(3,Lower_Righty);
+
+ vp << rcArray;
+ }
+
+ return TRUE;
+}
+
+void Field::SetRect(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CPDF_Rect& rect)
+{
+ ASSERT(pDocument != NULL);
+
+ CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pDocument->GetInterForm();
+ ASSERT(pInterForm != NULL);
+
+ CFX_PtrArray FieldArray;
+ GetFormFields(pDocument, swFieldName, FieldArray);
+
+ for (int i=0,isz=FieldArray.GetSize(); i<isz; i++)
+ {
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(i);
+ ASSERT(pFormField != NULL);
+
+ if (nControlIndex < 0)
+ {
+ FX_BOOL bSet = FALSE;
+ for (int i=0, sz=pFormField->CountControls(); i<sz; i++)
+ {
+ CPDF_FormControl* pFormControl = pFormField->GetControl(i);
+ ASSERT(pFormControl != NULL);
+
+ if (CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormControl))
+ {
+ CPDF_Rect crRect = rect;
+
+ CPDF_Page* pPDFPage = pWidget->GetPDFPage();
+ ASSERT(pPDFPage != NULL);
+
+// CPDF_Page* pPDFPage = pPage->GetPage();
+// ASSERT(pPDFPage != NULL);
+
+ crRect.Intersect(pPDFPage->GetPageBBox());
+
+ if (!crRect.IsEmpty())
+ {
+ CPDF_Rect rcOld = pWidget->GetRect();
+ if (crRect.left != rcOld.left ||
+ crRect.right != rcOld.right ||
+ crRect.top != rcOld.top ||
+ crRect.bottom != rcOld.bottom)
+ {
+ pWidget->SetRect(crRect);
+ bSet = TRUE;
+ }
+ }
+ }
+ }
+
+ if (bSet) UpdateFormField(pDocument, pFormField, TRUE, TRUE, TRUE);
+ }
+ else
+ {
+ if(nControlIndex >= pFormField->CountControls()) return;
+ if (CPDF_FormControl* pFormControl = pFormField->GetControl(nControlIndex))
+ {
+ if (CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormControl))
+ {
+ CPDF_Rect crRect = rect;
+
+ CPDF_Page* pPDFPage = pWidget->GetPDFPage();
+ ASSERT(pPDFPage != NULL);
+
+// CPDF_Page* pPDFPage = pPage->GetPage();
+// ASSERT(pPDFPage != NULL);
+
+ crRect.Intersect(pPDFPage->GetPageBBox());
+
+ if (!crRect.IsEmpty())
+ {
+ CPDF_Rect rcOld = pWidget->GetRect();
+ if (crRect.left != rcOld.left ||
+ crRect.right != rcOld.right ||
+ crRect.top != rcOld.top ||
+ crRect.bottom != rcOld.bottom)
+ {
+ pWidget->SetRect(crRect);
+ UpdateFormControl(pDocument, pFormControl, TRUE, TRUE, TRUE);
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+FX_BOOL Field::required(OBJ_PROP_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ CFX_PtrArray FieldArray;
+ GetFormFields(m_FieldName,FieldArray);
+ if (FieldArray.GetSize() <= 0) return FALSE;
+
+ if (vp.IsSetting())
+ {
+ if (!m_bCanSet) return FALSE;
+
+
+ bool bVP;
+ vp >> bVP;
+
+ }
+ else
+ {
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
+ ASSERT(pFormField != NULL);
+
+ if (pFormField->GetFieldType() == FIELDTYPE_PUSHBUTTON)
+ return FALSE;
+
+ if (pFormField->GetFieldFlags() & FIELDFLAG_REQUIRED)
+ vp << true;
+ else
+ vp << false;
+ }
+
+ return TRUE;
+}
+
+FX_BOOL Field::richText(OBJ_PROP_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ if (vp.IsSetting())
+ {
+ if (!m_bCanSet) return FALSE;
+
+ bool bVP;
+ vp >> bVP;
+
+ if (m_bDelay)
+ {
+ AddDelay_Bool(FP_RICHTEXT, bVP);
+ }
+ else
+ {
+ Field::SetRichText(m_pDocument, m_FieldName, m_nFormControlIndex, bVP);
+ }
+ }
+ else
+ {
+ CFX_PtrArray FieldArray;
+ GetFormFields(m_FieldName,FieldArray);
+ if (FieldArray.GetSize() <= 0) return FALSE;
+
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
+ ASSERT(pFormField != NULL);
+
+ if (pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD)
+ return FALSE;
+
+ if (pFormField->GetFieldFlags() & FIELDFLAG_RICHTEXT)
+ vp << true;
+ else
+ vp << false;
+ }
+
+ return TRUE;
+}
+
+void Field::SetRichText(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, bool b)
+{
+ //Not supported.
+}
+
+FX_BOOL Field::richValue(OBJ_PROP_PARAMS)
+{
+ return TRUE;
+ if (vp.IsSetting())
+ {
+ if (!m_bCanSet) return FALSE;
+ ;
+ }
+ else
+ {
+ ;
+ }
+ return TRUE;
+}
+
+void Field::SetRichValue(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex)
+{
+ //Not supported.
+}
+
+FX_BOOL Field::rotation(OBJ_PROP_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ if (vp.IsSetting())
+ {
+ if (!m_bCanSet) return FALSE;
+
+ int nVP;
+ vp >> nVP;
+
+ if (m_bDelay)
+ {
+ AddDelay_Int(FP_ROTATION, nVP);
+ }
+ else
+ {
+ Field::SetRotation(m_pDocument, m_FieldName, m_nFormControlIndex, nVP);
+ }
+ }
+ else
+ {
+ CFX_PtrArray FieldArray;
+ GetFormFields(m_FieldName,FieldArray);
+ if (FieldArray.GetSize() <= 0) return FALSE;
+
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
+ ASSERT(pFormField != NULL);
+
+ CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
+ if (!pFormControl)return FALSE;
+
+ vp << (FX_INT32)pFormControl->GetRotation();
+ }
+
+ return TRUE;
+}
+
+void Field::SetRotation(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number)
+{
+ //Not supported.
+}
+
+FX_BOOL Field::strokeColor(OBJ_PROP_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ if (vp.IsSetting())
+ {
+ if (!m_bCanSet) return FALSE;
+
+ if (!vp.IsArrayObject())return FALSE;
+
+ CJS_Array crArray(m_isolate);
+ vp >> crArray;
+
+ CPWL_Color color;
+ color::ConvertArrayToPWLColor(crArray, color);
+
+ if (m_bDelay)
+ {
+ AddDelay_Color(FP_STROKECOLOR, color);
+ }
+ else
+ {
+ Field::SetStrokeColor(m_pDocument, m_FieldName, m_nFormControlIndex, color);
+ }
+ }
+ else
+ {
+ CFX_PtrArray FieldArray;
+ GetFormFields(m_FieldName,FieldArray);
+ if (FieldArray.GetSize() <= 0) return FALSE;
+
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
+ ASSERT(pFormField != NULL);
+
+ CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
+ if (!pFormControl)return FALSE;
+
+ int iColorType;
+ pFormControl->GetBorderColor(iColorType);
+
+ CPWL_Color color;
+
+ if (iColorType == COLORTYPE_TRANSPARENT)
+ {
+ color = CPWL_Color(COLORTYPE_TRANSPARENT);
+ }
+ else if (iColorType == COLORTYPE_GRAY)
+ {
+ color = CPWL_Color(COLORTYPE_GRAY, pFormControl->GetOriginalBorderColor(0));
+ }
+ else if (iColorType == COLORTYPE_RGB)
+ {
+ color = CPWL_Color(COLORTYPE_RGB, pFormControl->GetOriginalBorderColor(0),
+ pFormControl->GetOriginalBorderColor(1),
+ pFormControl->GetOriginalBorderColor(2));
+ }
+ else if (iColorType == COLORTYPE_CMYK)
+ {
+ color = CPWL_Color(COLORTYPE_CMYK, pFormControl->GetOriginalBorderColor(0),
+ pFormControl->GetOriginalBorderColor(1),
+ pFormControl->GetOriginalBorderColor(2),
+ pFormControl->GetOriginalBorderColor(3));
+ }
+ else
+ return FALSE;
+
+ CJS_Array crArray(m_isolate);
+ color::ConvertPWLColorToArray(color, crArray);
+ vp << crArray;
+ }
+
+ return TRUE;
+}
+
+void Field::SetStrokeColor(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CPWL_Color& color)
+{
+ //Not supported.
+}
+
+FX_BOOL Field::style(OBJ_PROP_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ if (vp.IsSetting())
+ {
+ if (!m_bCanSet) return FALSE;
+
+ CFX_ByteString csBCaption;
+ vp >> csBCaption;
+
+ if (m_bDelay)
+ {
+ AddDelay_String(FP_STYLE, csBCaption);
+ }
+ else
+ {
+ Field::SetStyle(m_pDocument, m_FieldName, m_nFormControlIndex, csBCaption);
+ }
+ }
+ else
+ {
+ CFX_PtrArray FieldArray;
+ GetFormFields(m_FieldName,FieldArray);
+ if (FieldArray.GetSize() <= 0) return FALSE;
+
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
+ ASSERT(pFormField != NULL);
+
+ if (pFormField->GetFieldType() != FIELDTYPE_RADIOBUTTON &&
+ pFormField->GetFieldType() != FIELDTYPE_CHECKBOX)
+ return FALSE;
+
+ CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
+ if (!pFormControl) return FALSE;
+
+ CFX_WideString csWCaption = pFormControl->GetNormalCaption();
+ CFX_ByteString csBCaption;
+
+ switch (csWCaption[0])
+ {
+ case L'l':
+ csBCaption = "circle";
+ break;
+ case L'8':
+ csBCaption = "cross";
+ break;
+ case L'u':
+ csBCaption = "diamond";
+ break;
+ case L'n':
+ csBCaption = "square";
+ break;
+ case L'H':
+ csBCaption = "star";
+ break;
+ default: //L'4'
+ csBCaption = "check";
+ break;
+ }
+ vp << csBCaption;
+ }
+
+ return TRUE;
+}
+
+void Field::SetStyle(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex,
+ const CFX_ByteString& string)
+{
+ //Not supported.
+}
+
+FX_BOOL Field::submitName(OBJ_PROP_PARAMS)
+{
+ return TRUE;
+}
+
+FX_BOOL Field::textColor(OBJ_PROP_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ if (vp.IsSetting())
+ {
+ if (!m_bCanSet) return FALSE;
+
+ CJS_Array crArray(m_isolate);
+ if (!vp.IsArrayObject())return FALSE;
+ vp >> crArray;
+
+ CPWL_Color color;
+ color::ConvertArrayToPWLColor(crArray, color);
+
+ if (m_bDelay)
+ {
+ AddDelay_Color(FP_TEXTCOLOR, color);
+ }
+ else
+ {
+ Field::SetTextColor(m_pDocument, m_FieldName, m_nFormControlIndex, color);
+ }
+ }
+ else
+ {
+ CFX_PtrArray FieldArray;
+ GetFormFields(m_FieldName,FieldArray);
+ if (FieldArray.GetSize() <= 0) return FALSE;
+
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
+ ASSERT(pFormField != NULL);
+
+ CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
+ if (!pFormControl)return FALSE;
+
+ int iColorType;
+ FX_ARGB color;
+ CPDF_DefaultAppearance FieldAppearance = pFormControl->GetDefaultAppearance();
+ FieldAppearance.GetColor(color, iColorType);
+ FX_INT32 a,r,g,b;
+ ArgbDecode(color, a, r, g, b);
+
+ CPWL_Color crRet = CPWL_Color(COLORTYPE_RGB, r / 255.0f,
+ g / 255.0f,
+ b / 255.0f);
+
+ if (iColorType == COLORTYPE_TRANSPARENT)
+ crRet = CPWL_Color(COLORTYPE_TRANSPARENT);
+
+ CJS_Array crArray(m_isolate);
+ color::ConvertPWLColorToArray(crRet, crArray);
+ vp << crArray;
+ }
+
+ return TRUE;
+}
+
+void Field::SetTextColor(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CPWL_Color& color)
+{
+ //Not supported.
+}
+
+FX_BOOL Field::textFont(OBJ_PROP_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ if (vp.IsSetting())
+ {
+ if (!m_bCanSet) return FALSE;
+
+ CFX_ByteString csFontName;
+ vp >> csFontName;
+ if (csFontName.IsEmpty()) return FALSE;
+
+ if (m_bDelay)
+ {
+ AddDelay_String(FP_TEXTFONT, csFontName);
+ }
+ else
+ {
+ Field::SetTextFont(m_pDocument, m_FieldName, m_nFormControlIndex, csFontName);
+ }
+ }
+ else
+ {
+ CFX_PtrArray FieldArray;
+ GetFormFields(m_FieldName,FieldArray);
+ if (FieldArray.GetSize() <= 0) return FALSE;
+
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
+ ASSERT(pFormField != NULL);
+
+ CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
+ if (!pFormControl)return FALSE;
+
+ int nFieldType = pFormField->GetFieldType();
+
+ if (nFieldType == FIELDTYPE_PUSHBUTTON ||
+ nFieldType == FIELDTYPE_COMBOBOX ||
+ nFieldType == FIELDTYPE_LISTBOX ||
+ nFieldType == FIELDTYPE_TEXTFIELD)
+ {
+ CPDF_Font * pFont = pFormControl->GetDefaultControlFont();
+ if (!pFont) return FALSE;
+
+ vp << pFont->GetBaseFont();
+ }
+ else
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+void Field::SetTextFont(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CFX_ByteString& string)
+{
+ //Not supported.
+}
+
+FX_BOOL Field::textSize(OBJ_PROP_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ if (vp.IsSetting())
+ {
+ if (!m_bCanSet) return FALSE;
+
+ int nVP;
+ vp >> nVP;
+
+ if (m_bDelay)
+ {
+ AddDelay_Int(FP_TEXTSIZE, nVP);
+ }
+ else
+ {
+ Field::SetTextSize(m_pDocument, m_FieldName, m_nFormControlIndex, nVP);
+ }
+ }
+ else
+ {
+ CFX_PtrArray FieldArray;
+ GetFormFields(m_FieldName,FieldArray);
+ if (FieldArray.GetSize() <= 0) return FALSE;
+
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
+ ASSERT(pFormField != NULL);
+
+ CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
+ if (!pFormControl)return FALSE;
+
+ CPDF_DefaultAppearance FieldAppearance = pFormControl->GetDefaultAppearance();
+
+ CFX_ByteString csFontNameTag;
+ FX_FLOAT fFontSize;
+ FieldAppearance.GetFont(csFontNameTag,fFontSize);
+
+ vp << (int)fFontSize;
+ }
+
+ return TRUE;
+}
+
+void Field::SetTextSize(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number)
+{
+ //Not supported.
+}
+
+FX_BOOL Field::type(OBJ_PROP_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ if (!vp.IsGetting()) return FALSE;
+
+ CFX_PtrArray FieldArray;
+ GetFormFields(m_FieldName,FieldArray);
+ if (FieldArray.GetSize() <= 0) return FALSE;
+
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
+ ASSERT(pFormField != NULL);
+
+ switch (pFormField->GetFieldType())
+ {
+ case FIELDTYPE_UNKNOWN:
+ vp << (FX_LPCWSTR)L"unknown";
+ break;
+ case FIELDTYPE_PUSHBUTTON:
+ vp << (FX_LPCWSTR)L"button";
+ break;
+ case FIELDTYPE_CHECKBOX:
+ vp << (FX_LPCWSTR)L"checkbox";
+ break;
+ case FIELDTYPE_RADIOBUTTON:
+ vp << (FX_LPCWSTR)L"radiobutton";
+ break;
+ case FIELDTYPE_COMBOBOX:
+ vp << (FX_LPCWSTR)L"combobox";
+ break;
+ case FIELDTYPE_LISTBOX:
+ vp << (FX_LPCWSTR)L"listbox";
+ break;
+ case FIELDTYPE_TEXTFIELD:
+ vp << (FX_LPCWSTR)L"text";
+ break;
+ case FIELDTYPE_SIGNATURE:
+ vp << (FX_LPCWSTR)L"signature";
+ break;
+ default :
+ vp << (FX_LPCWSTR)L"unknown";
+ break;
+ }
+
+ return TRUE;
+}
+
+FX_BOOL Field::userName(OBJ_PROP_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ if (vp.IsSetting())
+ {
+ if (!m_bCanSet) return FALSE;
+
+ CFX_WideString swName;
+ vp >> swName;
+
+ if (m_bDelay)
+ {
+ AddDelay_WideString(FP_USERNAME, swName);
+ }
+ else
+ {
+ Field::SetUserName(m_pDocument, m_FieldName, m_nFormControlIndex, swName);
+ }
+ }
+ else
+ {
+ CFX_PtrArray FieldArray;
+ GetFormFields(m_FieldName,FieldArray);
+ if (FieldArray.GetSize() <= 0) return FALSE;
+
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
+ ASSERT(pFormField != NULL);
+
+ vp << (CFX_WideString)pFormField->GetAlternateName();
+ }
+
+ return TRUE;
+}
+
+void Field::SetUserName(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CFX_WideString& string)
+{
+ //Not supported.
+}
+
+FX_BOOL Field::value(OBJ_PROP_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ if (vp.IsSetting())
+ {
+ if (!m_bCanSet) return FALSE;
+
+ CJS_WideStringArray strArray;
+
+ if (vp.IsArrayObject())
+ {
+ CJS_Array ValueArray(m_isolate);
+ vp.ConvertToArray(ValueArray);
+ for (int i = 0,sz = ValueArray.GetLength(); i < sz; i++)
+ {
+ CJS_Value ElementValue(m_isolate);
+ ValueArray.GetElement(i, ElementValue);
+ strArray.Add(ElementValue.operator CFX_WideString());
+ }
+ }
+ else
+ {
+ CFX_WideString swValue;
+ vp >> swValue;
+
+ strArray.Add(swValue);
+ }
+
+ if (m_bDelay)
+ {
+ AddDelay_WideStringArray(FP_VALUE, strArray);
+ }
+ else
+ {
+ Field::SetValue(m_pDocument, m_FieldName, m_nFormControlIndex, strArray);
+ }
+ }
+ else
+ {
+ CFX_PtrArray FieldArray;
+ GetFormFields(m_FieldName,FieldArray);
+ if (FieldArray.GetSize() <= 0) return FALSE;
+
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
+ ASSERT(pFormField != NULL);
+
+
+
+ switch (pFormField->GetFieldType())
+ {
+ case FIELDTYPE_PUSHBUTTON:
+ return FALSE;
+ case FIELDTYPE_COMBOBOX:
+ case FIELDTYPE_TEXTFIELD:
+ {
+ CFX_WideString swValue = pFormField->GetValue();
+
+ double dRet;
+ FX_BOOL bDot;
+ if (CJS_PublicMethods::ConvertStringToNumber(swValue,dRet,bDot))
+ {
+ if (bDot)
+ vp << dRet;
+ else
+ vp << dRet;
+ }
+ else
+ vp << swValue;
+ }
+ break;
+ case FIELDTYPE_LISTBOX:
+ {
+ if (pFormField->CountSelectedItems() > 1)
+ {
+ CJS_Array ValueArray(m_isolate);
+ CJS_Value ElementValue(m_isolate);
+ int iIndex;
+ for (int i = 0, sz = pFormField->CountSelectedItems(); i < sz; i++)
+ {
+ iIndex = pFormField->GetSelectedIndex(i);
+ ElementValue = pFormField->GetOptionValue(iIndex);
+ if (FXSYS_wcslen((FX_LPCWSTR)ElementValue.operator CFX_WideString()) == 0)
+ ElementValue = pFormField->GetOptionLabel(iIndex);
+ ValueArray.SetElement(i, ElementValue);
+ }
+ vp << ValueArray;
+ }
+ else
+ {
+ CFX_WideString swValue = pFormField->GetValue();
+
+ double dRet;
+ FX_BOOL bDot;
+ if (CJS_PublicMethods::ConvertStringToNumber(swValue,dRet,bDot))
+ {
+ if (bDot)
+ vp << dRet;
+ else
+ vp << dRet;
+ }
+ else
+ vp << swValue;
+ }
+ }
+ break;
+ case FIELDTYPE_CHECKBOX:
+ case FIELDTYPE_RADIOBUTTON:
+ {
+ FX_BOOL bFind = FALSE;
+ for (int i = 0 , sz = pFormField->CountControls(); i < sz; i++)
+ {
+ if (pFormField->GetControl(i)->IsChecked())
+ {
+ CFX_WideString swValue = pFormField->GetControl(i)->GetExportValue();
+
+ double dRet;
+ FX_BOOL bDot;
+ if (CJS_PublicMethods::ConvertStringToNumber(swValue,dRet,bDot))
+ {
+ if (bDot)
+ vp << dRet;
+ else
+ vp << dRet;
+ }
+ else
+ vp << swValue;
+
+ bFind = TRUE;
+ break;
+ }
+ else
+ continue;
+ }
+ if (!bFind)
+ vp << (FX_LPCWSTR)L"Off";
+ }
+ break;
+ default:
+ vp << pFormField->GetValue();
+ break;
+ }
+ }
+
+ return TRUE;
+}
+
+void Field::SetValue(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName,
+ int nControlIndex, const CJS_WideStringArray& strArray)
+{
+ ASSERT(pDocument != NULL);
+
+ if (strArray.GetSize() < 1) return;
+
+ CFX_PtrArray FieldArray;
+ GetFormFields(pDocument, swFieldName, FieldArray);
+
+ for (int i=0,isz=FieldArray.GetSize(); i<isz; i++)
+ {
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(i);
+ ASSERT(pFormField != NULL);
+
+ if (pFormField->GetFullName().Compare(swFieldName) != 0)
+ continue;
+
+ switch (pFormField->GetFieldType())
+ {
+ case FIELDTYPE_TEXTFIELD:
+ case FIELDTYPE_COMBOBOX:
+ if (pFormField->GetValue() != strArray.GetAt(0))
+ {
+ CFX_WideString WideString = strArray.GetAt(0);
+ pFormField->SetValue(strArray.GetAt(0), TRUE);
+ UpdateFormField(pDocument, pFormField, TRUE, FALSE, TRUE);
+ }
+ break;
+ case FIELDTYPE_CHECKBOX: //mantis: 0004493
+ case FIELDTYPE_RADIOBUTTON:
+ {
+ if (pFormField->GetValue() != strArray.GetAt(0))
+ {
+ pFormField->SetValue(strArray.GetAt(0), TRUE);
+ UpdateFormField(pDocument, pFormField, TRUE, FALSE, TRUE);
+ }
+ }
+ break;
+ case FIELDTYPE_LISTBOX:
+ {
+ FX_BOOL bModified = FALSE;
+
+ for (int i=0,sz=strArray.GetSize(); i<sz; i++)
+ {
+ int iIndex = pFormField->FindOption(strArray.GetAt(i));
+
+ if (!pFormField->IsItemSelected(iIndex))
+ {
+ bModified = TRUE;
+ break;
+ }
+ }
+
+ if (bModified)
+ {
+ pFormField->ClearSelection(TRUE);
+ for (int i=0,sz=strArray.GetSize(); i<sz; i++)
+ {
+ int iIndex = pFormField->FindOption(strArray.GetAt(i));
+ pFormField->SetItemSelection(iIndex, TRUE, TRUE);
+ }
+
+ UpdateFormField(pDocument, pFormField, TRUE, FALSE, TRUE);
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ }
+}
+
+FX_BOOL Field::valueAsString(OBJ_PROP_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ if (!vp.IsGetting()) return FALSE;
+
+ CFX_PtrArray FieldArray;
+ GetFormFields(m_FieldName,FieldArray);
+ if (FieldArray.GetSize() <= 0) return FALSE;
+
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
+ ASSERT(pFormField != NULL);
+
+ if (pFormField->GetFieldType() == FIELDTYPE_PUSHBUTTON)
+ return FALSE;
+
+ if (pFormField->GetFieldType() == FIELDTYPE_CHECKBOX)
+ {
+ if(!pFormField->CountControls()) return FALSE;
+
+ if (pFormField->GetControl(0)->IsChecked())
+ vp << (FX_LPCWSTR)L"Yes";
+ else
+ vp << (FX_LPCWSTR)L"Off";
+ }
+ else if (pFormField->GetFieldType() == FIELDTYPE_RADIOBUTTON && !(pFormField->GetFieldFlags() & FIELDFLAG_RADIOSINUNISON))
+ {
+ for (int i=0, sz=pFormField->CountControls(); i<sz; i++)
+ {
+ if (pFormField->GetControl(i)->IsChecked())
+ {
+ vp << (FX_LPCWSTR)pFormField->GetControl(i)->GetExportValue();
+ break;
+ }
+ else
+ vp << (FX_LPCWSTR)L"Off";
+ }
+ }
+ else if (pFormField->GetFieldType() == FIELDTYPE_LISTBOX && (pFormField->CountSelectedItems() > 1))
+ {
+ vp << (FX_LPCWSTR)L"";
+ }
+ else
+ vp << (FX_LPCWSTR)pFormField->GetValue();
+
+ return TRUE;
+}
+
+/* --------------------------------- methods --------------------------------- */
+
+FX_BOOL Field::browseForFileToSubmit(OBJ_METHOD_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ CFX_PtrArray FieldArray;
+ GetFormFields(m_FieldName, FieldArray);
+ if (FieldArray.GetSize() <= 0) return FALSE;
+
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
+ ASSERT(pFormField != NULL);
+
+ CPDFDoc_Environment* pApp = m_pDocument->GetEnv();
+ ASSERT(pApp != NULL);
+
+ if ((pFormField->GetFieldFlags() & FIELDFLAG_FILESELECT) &&
+ (pFormField->GetFieldType() == FIELDTYPE_TEXTFIELD))
+ {
+ CFX_WideString wsFileName = pApp->JS_fieldBrowse();
+ if(!wsFileName.IsEmpty())
+ {
+ pFormField->SetValue(wsFileName);
+ UpdateFormField(m_pDocument, pFormField, TRUE, TRUE, TRUE);
+ }
+ }
+ else
+ return FALSE;
+
+ return TRUE;
+}
+
+
+FX_BOOL Field::buttonGetCaption(OBJ_METHOD_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ int nface = 0;
+ int iSize = params.size();
+ if ( iSize >= 1)
+ nface = (FX_INT32) params[0];
+
+ CFX_PtrArray FieldArray;
+ GetFormFields(m_FieldName,FieldArray);
+ if (FieldArray.GetSize() <= 0) return FALSE;
+
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
+ ASSERT(pFormField != NULL);
+
+ if (pFormField->GetFieldType() != FIELDTYPE_PUSHBUTTON)
+ return FALSE;
+
+ CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
+ if (!pFormControl)return FALSE;
+
+ if (nface == 0)
+ vRet = pFormControl->GetNormalCaption();
+ else if (nface == 1)
+ vRet = pFormControl->GetDownCaption();
+ else if (nface == 2)
+ vRet = pFormControl->GetRolloverCaption();
+ else
+ return FALSE;
+
+ return TRUE;
+}
+
+//#pragma warning(disable: 4800)
+
+FX_BOOL Field::buttonGetIcon(OBJ_METHOD_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ int nface = 0;
+ int iSize = params.size();
+ if ( iSize >= 1)
+ nface = (FX_INT32) params[0];
+
+ CFX_PtrArray FieldArray;
+ GetFormFields(m_FieldName,FieldArray);
+ if (FieldArray.GetSize() <= 0) return FALSE;
+
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
+ ASSERT(pFormField != NULL);
+
+ if (pFormField->GetFieldType() != FIELDTYPE_PUSHBUTTON)
+ return FALSE;
+
+ CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
+ if (!pFormControl)return FALSE;
+
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+
+ CJS_Runtime* pRuntime = pContext->GetJSRuntime();
+ ASSERT(pRuntime != NULL);
+
+ JSFXObject pObj = JS_NewFxDynamicObj(*pRuntime, pContext, JS_GetObjDefnID(*pRuntime, L"Icon"));
+ ASSERT(pObj.IsEmpty() == FALSE);
+
+ CJS_Icon* pJS_Icon = (CJS_Icon*)JS_GetPrivate(pObj);
+ ASSERT(pJS_Icon != NULL);
+
+ Icon* pIcon = (Icon*)pJS_Icon->GetEmbedObject();
+ ASSERT(pIcon != NULL);
+
+ CPDF_Stream* pIconStream = NULL;
+ if (nface == 0)
+ pIconStream = pFormControl->GetNormalIcon();
+ else if (nface == 1)
+ pIconStream = pFormControl->GetDownIcon();
+ else if (nface == 2)
+ pIconStream = pFormControl->GetRolloverIcon();
+ else
+ return FALSE;
+
+ pIcon->SetStream(pIconStream);
+ vRet = pJS_Icon;
+
+ return TRUE;
+}
+
+//#pragma warning(default: 4800)
+
+FX_BOOL Field::buttonImportIcon(OBJ_METHOD_PARAMS)
+{
+#if 0
+ ASSERT(m_pDocument != NULL);
+
+ CFX_PtrArray FieldArray;
+ GetFormFields(m_FieldName,FieldArray);
+ if (FieldArray.GetSize() <= 0) return FALSE;
+
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
+ if (!pFormField)return FALSE;
+
+ CPDFDoc_Environment* pEnv = m_pDocument->GetEnv();
+ ASSERT(pEnv);
+
+ CFX_WideString sIconFileName = pEnv->JS_fieldBrowse();
+ if (sIconFileName.IsEmpty())
+ {
+ vRet = 1;
+ return TRUE;
+ }
+
+ CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInterForm();
+ ASSERT(pInterForm != NULL);
+
+ CPDF_Stream* pStream = pInterForm->LoadImageFromFile(sIconFileName);
+ if (!pStream)
+ {
+ vRet = -1;
+ return TRUE;
+ }
+
+ CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
+ if (!pFormControl)return FALSE;
+
+ pFormControl->SetNormalIcon(pStream);
+ UpdateFormControl(m_pDocument, pFormControl, TRUE, TRUE, TRUE);
+
+ vRet = 0;
+#endif // 0
+ return TRUE;
+}
+
+FX_BOOL Field::buttonSetCaption(OBJ_METHOD_PARAMS)
+{
+ return FALSE;
+}
+
+FX_BOOL Field::buttonSetIcon(OBJ_METHOD_PARAMS)
+{
+ return FALSE;
+}
+
+FX_BOOL Field::checkThisBox(OBJ_METHOD_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ if (!m_bCanSet) return FALSE;
+
+ int iSize = params.size();
+ int nWidget = -1;
+ if ( iSize >= 1)
+ nWidget= (FX_INT32) params[0];
+ else
+ return FALSE;
+ FX_BOOL bCheckit = TRUE;
+ if ( iSize >= 2)
+ bCheckit = params[1];
+
+
+ CFX_PtrArray FieldArray;
+ GetFormFields(m_FieldName,FieldArray);
+ if (FieldArray.GetSize() <= 0) return FALSE;
+
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
+ ASSERT(pFormField != NULL);
+
+ if (pFormField->GetFieldType() != FIELDTYPE_CHECKBOX && pFormField->GetFieldType() != FIELDTYPE_RADIOBUTTON)
+ return FALSE;
+ if(nWidget <0 || nWidget >= pFormField->CountControls())
+ return FALSE;
+ if (pFormField->GetFieldType() == FIELDTYPE_RADIOBUTTON)
+ pFormField->CheckControl(nWidget, bCheckit, TRUE);
+ else
+ pFormField->CheckControl(nWidget, bCheckit, TRUE);
+
+ UpdateFormField(m_pDocument, pFormField, TRUE, TRUE, TRUE);
+
+ return TRUE;
+}
+
+FX_BOOL Field::clearItems(OBJ_METHOD_PARAMS)
+{
+ return TRUE;
+}
+
+FX_BOOL Field::defaultIsChecked(OBJ_METHOD_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ if (!m_bCanSet) return FALSE;
+
+ int iSize = params.size();
+ int nWidget = -1;
+ if ( iSize >= 1)
+ nWidget= (FX_INT32) params[0];
+ else
+ return FALSE;
+ //FX_BOOL bIsDefaultChecked = TRUE;
+ //if ( iSize >= 2)
+ // bIsDefaultChecked = params[1];
+
+ CFX_PtrArray FieldArray;
+ GetFormFields(m_FieldName,FieldArray);
+ if (FieldArray.GetSize() <= 0) return FALSE;
+
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
+ ASSERT(pFormField != NULL);
+
+ if(nWidget <0 || nWidget >= pFormField->CountControls())
+ {
+ vRet = FALSE;
+ return FALSE;
+ }
+ if ((pFormField->GetFieldType() == FIELDTYPE_CHECKBOX)
+ || (pFormField->GetFieldType() == FIELDTYPE_RADIOBUTTON))
+ {
+
+ vRet = TRUE;
+ }
+ else
+ vRet = FALSE;
+
+ return TRUE;
+}
+
+FX_BOOL Field::deleteItemAt(OBJ_METHOD_PARAMS)
+{
+ return TRUE;
+}
+
+int JS_COMPARESTRING(CFX_WideString* ps1, CFX_WideString* ps2)
+{
+ ASSERT(ps1 != NULL);
+ ASSERT(ps2 != NULL);
+
+ return ps1->Compare(*ps2);
+}
+
+
+FX_BOOL Field::getArray(OBJ_METHOD_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ CFX_PtrArray FieldArray;
+ GetFormFields(m_FieldName,FieldArray);
+ if (FieldArray.GetSize() <= 0) return FALSE;
+
+ CGW_ArrayTemplate<CFX_WideString*> swSort;
+
+ for (int i=0,sz=FieldArray.GetSize(); i<sz; i++)
+ {
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(i);
+ ASSERT(pFormField != NULL);
+
+ swSort.Add(new CFX_WideString(pFormField->GetFullName()));
+
+ }
+ swSort.Sort(JS_COMPARESTRING);
+
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+ CJS_Runtime* pRuntime = pContext->GetJSRuntime();
+ ASSERT(pRuntime != NULL);
+
+ CJS_Array FormFieldArray(m_isolate);
+ for (int j=0,jsz = swSort.GetSize(); j<jsz; j++)
+ {
+ CFX_WideString* pStr = swSort.GetAt(j);
+
+ JSFXObject pObj = JS_NewFxDynamicObj(*pRuntime, pContext, JS_GetObjDefnID(*pRuntime, L"Field"));
+ ASSERT(pObj.IsEmpty() == FALSE);
+
+ CJS_Field* pJSField = (CJS_Field*)JS_GetPrivate(pObj);
+ ASSERT(pJSField != NULL);
+
+ Field* pField = (Field*)pJSField->GetEmbedObject();
+ ASSERT(pField != NULL);
+
+ pField->AttachField(this->m_pJSDoc, *pStr);
+
+ CJS_Value FormFieldValue(m_isolate);
+ FormFieldValue = pJSField;
+ FormFieldArray.SetElement(j, FormFieldValue);
+
+ delete pStr;
+ }
+
+ vRet = FormFieldArray;
+ swSort.RemoveAll();
+ return TRUE;
+}
+
+FX_BOOL Field::getItemAt(OBJ_METHOD_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ int nIdx = -1;
+ if (params.size() >=1)
+ nIdx = (FX_INT32) params[0];
+ FX_BOOL bExport = TRUE;
+ int iSize = params.size();
+ if ( iSize >= 2)
+ {
+ bExport =(FX_BOOL) params[1];
+ }
+
+ CFX_PtrArray FieldArray;
+ GetFormFields(m_FieldName,FieldArray);
+ if (FieldArray.GetSize() <= 0) return FALSE;
+
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
+ ASSERT(pFormField != NULL);
+
+ if ((pFormField->GetFieldType() == FIELDTYPE_LISTBOX)
+ || (pFormField->GetFieldType() == FIELDTYPE_COMBOBOX))
+ {
+ if (nIdx == -1 || nIdx > pFormField->CountOptions())
+ nIdx = pFormField->CountOptions() -1;
+ if (bExport)
+ {
+ CFX_WideString strval = pFormField->GetOptionValue(nIdx);
+ if (strval.IsEmpty())
+ vRet = pFormField->GetOptionLabel(nIdx);
+ else
+ vRet = strval;
+ }
+ else
+ vRet = pFormField->GetOptionLabel(nIdx);
+ }
+ else
+ return FALSE;
+
+ return TRUE;
+}
+
+FX_BOOL Field::getLock(OBJ_METHOD_PARAMS)
+{
+ return FALSE;
+}
+
+FX_BOOL Field::insertItemAt(OBJ_METHOD_PARAMS)
+{
+ return TRUE;
+}
+
+FX_BOOL Field::isBoxChecked(OBJ_METHOD_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ int nIndex = -1;
+ if (params.size() >=1)
+ nIndex = (FX_INT32) params[0];
+
+ CFX_PtrArray FieldArray;
+ GetFormFields(m_FieldName,FieldArray);
+ if (FieldArray.GetSize() <= 0) return FALSE;
+
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
+ ASSERT(pFormField != NULL);
+
+ if(nIndex <0 || nIndex >= pFormField->CountControls())
+ {
+ vRet = FALSE;
+ return FALSE;
+ }
+
+ if ((pFormField->GetFieldType() == FIELDTYPE_CHECKBOX)
+ || (pFormField->GetFieldType() == FIELDTYPE_RADIOBUTTON))
+ {
+ if (pFormField->GetControl(nIndex)->IsChecked() !=0 )
+ vRet = TRUE;
+ else
+ vRet = FALSE;
+ }
+ else
+ vRet = FALSE;
+
+ return TRUE;
+}
+
+FX_BOOL Field::isDefaultChecked(OBJ_METHOD_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ int nIndex = -1;
+ if (params.size() >=1)
+ nIndex = (FX_INT32) params[0];
+
+ CFX_PtrArray FieldArray;
+ GetFormFields(m_FieldName,FieldArray);
+ if (FieldArray.GetSize() <= 0) return FALSE;
+
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
+ ASSERT(pFormField != NULL);
+
+ if(nIndex <0 || nIndex >= pFormField->CountControls())
+ {
+ vRet = FALSE;
+ return FALSE;
+ }
+ if ((pFormField->GetFieldType() == FIELDTYPE_CHECKBOX)
+ || (pFormField->GetFieldType() == FIELDTYPE_RADIOBUTTON))
+ {
+ if (pFormField->GetControl(nIndex)->IsDefaultChecked() != 0)
+ vRet = TRUE;
+ else
+ vRet = FALSE;
+ }
+ else
+ vRet = FALSE;
+
+ return TRUE;
+}
+
+FX_BOOL Field::setAction(OBJ_METHOD_PARAMS)
+{
+ return TRUE;
+}
+
+FX_BOOL Field::setFocus(OBJ_METHOD_PARAMS)
+{
+ ASSERT(m_pDocument != NULL);
+
+ CFX_PtrArray FieldArray;
+ GetFormFields(m_FieldName,FieldArray);
+ if (FieldArray.GetSize() <= 0) return FALSE;
+
+ CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
+ ASSERT(pFormField != NULL);
+
+ FX_INT32 nCount = pFormField->CountControls();
+
+ if (nCount < 1) return FALSE;
+
+ CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInterForm();
+ ASSERT(pInterForm != NULL);
+
+ CPDFSDK_Widget* pWidget = NULL;
+ if (nCount == 1)
+ {
+ pWidget = pInterForm->GetWidget(pFormField->GetControl(0));
+ }
+ else
+ {
+ CPDFDoc_Environment* pEnv = m_pDocument->GetEnv();
+ ASSERT(pEnv);
+ CPDF_Page* pPage = (CPDF_Page*)pEnv->FFI_GetCurrentPage(m_pDocument->GetDocument());
+ if(!pPage)
+ return FALSE;
+ if (CPDFSDK_PageView* pCurPageView = m_pDocument->GetPageView(pPage))
+ {
+ for (FX_INT32 i=0; i<nCount; i++)
+ {
+ if (CPDFSDK_Widget* pTempWidget = pInterForm->GetWidget(pFormField->GetControl(i)))
+ {
+ if (pTempWidget->GetPDFPage() == pCurPageView->GetPDFPage())
+ {
+ pWidget = pTempWidget;
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ if (pWidget)
+ {
+ m_pDocument->SetFocusAnnot(pWidget);
+ }
+
+ return TRUE;
+}
+
+FX_BOOL Field::setItems(OBJ_METHOD_PARAMS)
+{
+ return TRUE;
+}
+
+FX_BOOL Field::setLock(OBJ_METHOD_PARAMS)
+{
+ return FALSE;
+}
+
+FX_BOOL Field::signatureGetModifications(OBJ_METHOD_PARAMS)
+{
+ return FALSE;
+}
+
+FX_BOOL Field::signatureGetSeedValue(OBJ_METHOD_PARAMS)
+{
+ return FALSE;
+}
+
+FX_BOOL Field::signatureInfo(OBJ_METHOD_PARAMS)
+{
+ return FALSE;
+}
+
+FX_BOOL Field::signatureSetSeedValue(OBJ_METHOD_PARAMS)
+{
+ return FALSE;
+}
+
+FX_BOOL Field::signatureSign(OBJ_METHOD_PARAMS)
+{
+ return FALSE;
+}
+
+FX_BOOL Field::signatureValidate(OBJ_METHOD_PARAMS)
+{
+ return FALSE;
+}
+
+FX_BOOL Field::source(OBJ_PROP_PARAMS)
+{
+ if (vp.IsGetting())
+ {
+ vp << (CJS_Object*)NULL;
+ }
+
+ return TRUE;
+}
+
+/////////////////////////////////////////// delay /////////////////////////////////////////////
+
+void Field::AddDelay_Int(enum FIELD_PROP prop, FX_INT32 n)
+{
+ ASSERT(m_pJSDoc != NULL);
+
+ CJS_DelayData* pNewData = new CJS_DelayData;
+ pNewData->sFieldName = m_FieldName;
+ pNewData->nControlIndex = m_nFormControlIndex;
+ pNewData->eProp = prop;
+ pNewData->num = n;
+
+ m_pJSDoc->AddDelayData(pNewData);
+}
+
+void Field::AddDelay_Bool(enum FIELD_PROP prop,bool b)
+{
+ ASSERT(m_pJSDoc != NULL);
+
+ CJS_DelayData* pNewData = new CJS_DelayData;
+ pNewData->sFieldName = m_FieldName;
+ pNewData->nControlIndex = m_nFormControlIndex;
+ pNewData->eProp = prop;
+ pNewData->b = b;
+
+ m_pJSDoc->AddDelayData(pNewData);
+}
+
+void Field::AddDelay_String(enum FIELD_PROP prop, const CFX_ByteString& string)
+{
+ ASSERT(m_pJSDoc != NULL);
+
+ CJS_DelayData* pNewData = new CJS_DelayData;
+ pNewData->sFieldName = m_FieldName;
+ pNewData->nControlIndex = m_nFormControlIndex;
+ pNewData->eProp = prop;
+ pNewData->string = string;
+
+ m_pJSDoc->AddDelayData(pNewData);
+}
+
+void Field::AddDelay_WideString(enum FIELD_PROP prop, const CFX_WideString& string)
+{
+ ASSERT(m_pJSDoc != NULL);
+
+ CJS_DelayData* pNewData = new CJS_DelayData;
+ pNewData->sFieldName = m_FieldName;
+ pNewData->nControlIndex = m_nFormControlIndex;
+ pNewData->eProp = prop;
+ pNewData->widestring = string;
+
+ m_pJSDoc->AddDelayData(pNewData);
+}
+
+void Field::AddDelay_Rect(enum FIELD_PROP prop, const CPDF_Rect& rect)
+{
+ ASSERT(m_pJSDoc != NULL);
+
+ CJS_DelayData* pNewData = new CJS_DelayData;
+ pNewData->sFieldName = m_FieldName;
+ pNewData->nControlIndex = m_nFormControlIndex;
+ pNewData->eProp = prop;
+ pNewData->rect = rect;
+
+ m_pJSDoc->AddDelayData(pNewData);
+}
+
+void Field::AddDelay_Color(enum FIELD_PROP prop, const CPWL_Color& color)
+{
+ ASSERT(m_pJSDoc != NULL);
+
+ CJS_DelayData* pNewData = new CJS_DelayData;
+ pNewData->sFieldName = m_FieldName;
+ pNewData->nControlIndex = m_nFormControlIndex;
+ pNewData->eProp = prop;
+ pNewData->color = color;
+
+ m_pJSDoc->AddDelayData(pNewData);
+}
+
+void Field::AddDelay_WordArray(enum FIELD_PROP prop, const CFX_DWordArray& array)
+{
+ ASSERT(m_pJSDoc != NULL);
+
+ CJS_DelayData* pNewData = new CJS_DelayData;
+ pNewData->sFieldName = m_FieldName;
+ pNewData->nControlIndex = m_nFormControlIndex;
+ pNewData->eProp = prop;
+
+ for (int i=0,sz=array.GetSize(); i<sz; i++)
+ pNewData->wordarray.Add(array.GetAt(i));
+
+ m_pJSDoc->AddDelayData(pNewData);
+}
+
+void Field::AddDelay_WideStringArray(enum FIELD_PROP prop, const CJS_WideStringArray& array)
+{
+ ASSERT(m_pJSDoc != NULL);
+
+ CJS_DelayData* pNewData = new CJS_DelayData;
+ pNewData->sFieldName = m_FieldName;
+ pNewData->nControlIndex = m_nFormControlIndex;
+ pNewData->eProp = prop;
+ for (int i=0,sz=array.GetSize(); i<sz; i++)
+ pNewData->widestringarray.Add(array.GetAt(i));
+
+ m_pJSDoc->AddDelayData(pNewData);
+}
+
+void Field::DoDelay(CPDFSDK_Document* pDocument, CJS_DelayData* pData)
+{
+ ASSERT(pDocument != NULL);
+ ASSERT(pData != NULL);
+
+ switch (pData->eProp)
+ {
+ case FP_ALIGNMENT:
+ Field::SetAlignment(pDocument, pData->sFieldName, pData->nControlIndex, pData->string);
+ break;
+ case FP_BORDERSTYLE:
+ Field::SetBorderStyle(pDocument, pData->sFieldName, pData->nControlIndex, pData->string);
+ break;
+ case FP_BUTTONALIGNX:
+ Field::SetButtonAlignX(pDocument, pData->sFieldName, pData->nControlIndex, pData->num);
+ break;
+ case FP_BUTTONALIGNY:
+ Field::SetButtonAlignY(pDocument, pData->sFieldName, pData->nControlIndex, pData->num);
+ break;
+ case FP_BUTTONFITBOUNDS:
+ Field::SetButtonFitBounds(pDocument, pData->sFieldName, pData->nControlIndex, pData->b);
+ break;
+ case FP_BUTTONPOSITION:
+ Field::SetButtonPosition(pDocument, pData->sFieldName, pData->nControlIndex, pData->num);
+ break;
+ case FP_BUTTONSCALEHOW:
+ Field::SetButtonScaleHow(pDocument, pData->sFieldName, pData->nControlIndex, pData->num);
+ break;
+ case FP_BUTTONSCALEWHEN:
+ Field::SetButtonScaleWhen(pDocument, pData->sFieldName, pData->nControlIndex, pData->num);
+ break;
+ case FP_CALCORDERINDEX:
+ Field::SetCalcOrderIndex(pDocument, pData->sFieldName, pData->nControlIndex, pData->num);
+ break;
+ case FP_CHARLIMIT:
+ Field::SetCharLimit(pDocument, pData->sFieldName, pData->nControlIndex, pData->num);
+ break;
+ case FP_COMB:
+ Field::SetComb(pDocument, pData->sFieldName, pData->nControlIndex, pData->b);
+ break;
+ case FP_COMMITONSELCHANGE:
+ Field::SetCommitOnSelChange(pDocument, pData->sFieldName, pData->nControlIndex, pData->b);
+ break;
+ case FP_CURRENTVALUEINDICES:
+ Field::SetCurrentValueIndices(pDocument, pData->sFieldName, pData->nControlIndex, pData->wordarray);
+ break;
+ case FP_DEFAULTVALUE:
+ Field::SetDefaultValue(pDocument, pData->sFieldName, pData->nControlIndex, pData->widestring);
+ break;
+ case FP_DONOTSCROLL:
+ Field::SetDoNotScroll(pDocument, pData->sFieldName, pData->nControlIndex, pData->b);
+ break;
+ case FP_DISPLAY:
+ Field::SetDisplay(pDocument, pData->sFieldName, pData->nControlIndex, pData->num);
+ break;
+ case FP_FILLCOLOR:
+ Field::SetFillColor(pDocument, pData->sFieldName, pData->nControlIndex, pData->color);
+ break;
+ case FP_HIDDEN:
+ Field::SetHidden(pDocument, pData->sFieldName, pData->nControlIndex, pData->b);
+ break;
+ case FP_HIGHLIGHT:
+ Field::SetHighlight(pDocument, pData->sFieldName, pData->nControlIndex, pData->string);
+ break;
+ case FP_LINEWIDTH:
+ Field::SetLineWidth(pDocument, pData->sFieldName, pData->nControlIndex, pData->num);
+ break;
+ case FP_MULTILINE:
+ Field::SetMultiline(pDocument, pData->sFieldName, pData->nControlIndex, pData->b);
+ break;
+ case FP_MULTIPLESELECTION:
+ Field::SetMultipleSelection(pDocument, pData->sFieldName, pData->nControlIndex, pData->b);
+ break;
+ case FP_PASSWORD:
+ Field::SetPassword(pDocument, pData->sFieldName, pData->nControlIndex, pData->b);
+ break;
+ case FP_RECT:
+ Field::SetRect(pDocument, pData->sFieldName, pData->nControlIndex, pData->rect);
+ break;
+ case FP_RICHTEXT:
+ Field::SetRichText(pDocument, pData->sFieldName, pData->nControlIndex, pData->b);
+ break;
+ case FP_RICHVALUE:
+ break;
+ case FP_ROTATION:
+ Field::SetRotation(pDocument, pData->sFieldName, pData->nControlIndex, pData->num);
+ break;
+ case FP_STROKECOLOR:
+ Field::SetStrokeColor(pDocument, pData->sFieldName, pData->nControlIndex, pData->color);
+ break;
+ case FP_STYLE:
+ Field::SetStyle(pDocument, pData->sFieldName, pData->nControlIndex, pData->string);
+ break;
+ case FP_TEXTCOLOR:
+ Field::SetTextColor(pDocument, pData->sFieldName, pData->nControlIndex, pData->color);
+ break;
+ case FP_TEXTFONT:
+ Field::SetTextFont(pDocument, pData->sFieldName, pData->nControlIndex, pData->string);
+ break;
+ case FP_TEXTSIZE:
+ Field::SetTextSize(pDocument, pData->sFieldName, pData->nControlIndex, pData->num);
+ break;
+ case FP_USERNAME:
+ Field::SetUserName(pDocument, pData->sFieldName, pData->nControlIndex, pData->widestring);
+ break;
+ case FP_VALUE:
+ Field::SetValue(pDocument, pData->sFieldName, pData->nControlIndex, pData->widestringarray);
+ break;
+ }
+}
+
+#define JS_FIELD_MINWIDTH 1
+#define JS_FIELD_MINHEIGHT 1
+
+void Field::AddField(CPDFSDK_Document* pDocument, int nPageIndex, int nFieldType,
+ const CFX_WideString& sName, const CPDF_Rect& rcCoords)
+{
+ //Not supported.
+}
+
diff --git a/fpdfsdk/src/javascript/Icon.cpp b/fpdfsdk/src/javascript/Icon.cpp
index 418fcd53d5..286980c205 100644
--- a/fpdfsdk/src/javascript/Icon.cpp
+++ b/fpdfsdk/src/javascript/Icon.cpp
@@ -1,67 +1,67 @@
-// 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
-
-#include "../../include/javascript/JavaScript.h"
-#include "../../include/javascript/IJavaScript.h"
-#include "../../include/javascript/JS_Define.h"
-#include "../../include/javascript/JS_Object.h"
-#include "../../include/javascript/JS_Value.h"
-#include "../../include/javascript/Icon.h"
-
-/* ---------------------- Icon ---------------------- */
-
-BEGIN_JS_STATIC_CONST(CJS_Icon)
-END_JS_STATIC_CONST()
-
-BEGIN_JS_STATIC_PROP(CJS_Icon)
- JS_STATIC_PROP_ENTRY(name)
-END_JS_STATIC_PROP()
-
-BEGIN_JS_STATIC_METHOD(CJS_Icon)
-END_JS_STATIC_METHOD()
-
-IMPLEMENT_JS_CLASS(CJS_Icon,Icon)
-
-Icon::Icon(CJS_Object* pJSObject) : CJS_EmbedObj(pJSObject),
- m_pIconStream(NULL),
- m_swIconName(L"")
-{
-}
-
-Icon::~Icon()
-{
-
-}
-
-void Icon::SetStream(CPDF_Stream* pIconStream)
-{
- if(pIconStream)
- m_pIconStream = pIconStream;
-}
-
-CPDF_Stream* Icon::GetStream()
-{
- return m_pIconStream;
-}
-
-void Icon::SetIconName(CFX_WideString name)
-{
- m_swIconName = name;
-}
-
-CFX_WideString Icon::GetIconName()
-{
- return m_swIconName;
-}
-
-FX_BOOL Icon::name(OBJ_PROP_PARAMS)
-{
- if(!vp.IsGetting())return FALSE;
-
- vp << m_swIconName;
- return TRUE;
-}
-
+// 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
+
+#include "../../include/javascript/JavaScript.h"
+#include "../../include/javascript/IJavaScript.h"
+#include "../../include/javascript/JS_Define.h"
+#include "../../include/javascript/JS_Object.h"
+#include "../../include/javascript/JS_Value.h"
+#include "../../include/javascript/Icon.h"
+
+/* ---------------------- Icon ---------------------- */
+
+BEGIN_JS_STATIC_CONST(CJS_Icon)
+END_JS_STATIC_CONST()
+
+BEGIN_JS_STATIC_PROP(CJS_Icon)
+ JS_STATIC_PROP_ENTRY(name)
+END_JS_STATIC_PROP()
+
+BEGIN_JS_STATIC_METHOD(CJS_Icon)
+END_JS_STATIC_METHOD()
+
+IMPLEMENT_JS_CLASS(CJS_Icon,Icon)
+
+Icon::Icon(CJS_Object* pJSObject) : CJS_EmbedObj(pJSObject),
+ m_pIconStream(NULL),
+ m_swIconName(L"")
+{
+}
+
+Icon::~Icon()
+{
+
+}
+
+void Icon::SetStream(CPDF_Stream* pIconStream)
+{
+ if(pIconStream)
+ m_pIconStream = pIconStream;
+}
+
+CPDF_Stream* Icon::GetStream()
+{
+ return m_pIconStream;
+}
+
+void Icon::SetIconName(CFX_WideString name)
+{
+ m_swIconName = name;
+}
+
+CFX_WideString Icon::GetIconName()
+{
+ return m_swIconName;
+}
+
+FX_BOOL Icon::name(OBJ_PROP_PARAMS)
+{
+ if(!vp.IsGetting())return FALSE;
+
+ vp << m_swIconName;
+ return TRUE;
+}
+
diff --git a/fpdfsdk/src/javascript/JS_Context.cpp b/fpdfsdk/src/javascript/JS_Context.cpp
index c0d4e0847e..e34ffb51ba 100644
--- a/fpdfsdk/src/javascript/JS_Context.cpp
+++ b/fpdfsdk/src/javascript/JS_Context.cpp
@@ -1,364 +1,364 @@
-// 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
-
-#include "../../include/javascript/JavaScript.h"
-#include "../../include/javascript/IJavaScript.h"
-//#include "../../include/javascript/JS_ResMgr.h"
-#include "../../include/javascript/JS_Context.h"
-#include "../../include/javascript/JS_EventHandler.h"
-#include "../../include/javascript/JS_Runtime.h"
-#include "../../include/javascript/resource.h"
-
-/* -------------------------- CJS_Context -------------------------- */
-
-CJS_Context::CJS_Context(CJS_Runtime* pRuntime) :
- m_pRuntime(pRuntime),
- m_bBusy(FALSE),
- m_bMsgBoxEnable(TRUE)
-{
- m_pEventHandler = new CJS_EventHandler(this);
-}
-
-CJS_Context::~CJS_Context(void)
-{
- if (m_pEventHandler)
- {
- delete m_pEventHandler;
- m_pEventHandler = NULL;
- }
-}
-
-CPDFSDK_Document* CJS_Context::GetReaderDocument()
-{
- ASSERT(m_pRuntime != NULL);
-
- return m_pRuntime->GetReaderDocument();
-}
-
-CPDFDoc_Environment* CJS_Context::GetReaderApp()
-{
- ASSERT(m_pRuntime != NULL);
-
- return m_pRuntime->GetReaderApp();
-}
-
-FX_BOOL CJS_Context::DoJob(int nMode, const CFX_WideString& script, CFX_WideString& info)
-{
- if (m_bBusy)
- {
- info = JSGetStringFromID(this, IDS_STRING_JSBUSY);
- return FALSE;
- }
-
- m_bBusy = TRUE;
-
- ASSERT(m_pRuntime != NULL);
- ASSERT(m_pEventHandler != NULL);
- ASSERT(m_pEventHandler->IsValid());
-
- if (!m_pRuntime->AddEventToLoop(m_pEventHandler->TargetName(), m_pEventHandler->EventType()))
- {
- info = JSGetStringFromID(this, IDS_STRING_JSEVENT);
- return FALSE;
- }
-
- FXJSErr error ={NULL,NULL, 0};
- int nRet = 0;
-
- try
- {
- if (script.GetLength() > 0)
- {
- if (nMode == 0)
- {
- nRet = JS_Execute(*m_pRuntime, this, script, script.GetLength(), &error);
- }
- else
- {
- nRet = JS_Parse(*m_pRuntime, this, script, script.GetLength(), &error);
- }
- }
-
- if (nRet < 0)
- {
- CFX_WideString sLine;
- sLine.Format((FX_LPCWSTR)L"[ Line: %05d { %s } ] : %s",error.linnum-1,error.srcline,error.message);
-
-// TRACE(L"/* -------------- JS Error -------------- */\n");
-// TRACE(sLine);
-// TRACE(L"\n");
- //CFX_ByteString sTemp = CFX_ByteString::FromUnicode(error.message);
- info += sLine;
- }
- else
- {
- info = JSGetStringFromID(this, IDS_STRING_RUN);
- }
-
- }
- catch (...)
- {
- info = JSGetStringFromID(this, IDS_STRING_UNHANDLED);
- nRet = -1;
- }
-
- m_pRuntime->RemoveEventInLoop(m_pEventHandler->TargetName(), m_pEventHandler->EventType());
-
- m_pEventHandler->Destroy();
- m_bBusy = FALSE;
-
- return nRet >= 0;
-}
-
-FX_BOOL CJS_Context::RunScript(const CFX_WideString& script, CFX_WideString& info)
-{
- v8::Isolate::Scope isolate_scope(m_pRuntime->GetIsolate());
- v8::HandleScope handle_scope(m_pRuntime->GetIsolate());
- v8::Local<v8::Context> context = m_pRuntime->NewJSContext();
- v8::Context::Scope context_scope(context);
-
- return DoJob(0, script, info);
-}
-
-FX_BOOL CJS_Context::Compile(const CFX_WideString& script, CFX_WideString& info)
-{
- v8::Isolate::Scope isolate_scope(m_pRuntime->GetIsolate());
- v8::HandleScope handle_scope(m_pRuntime->GetIsolate());
- v8::Local<v8::Context> context = m_pRuntime->NewJSContext();
- v8::Context::Scope context_scope(context);
-
- return DoJob(1, script, info);
-}
-
-void CJS_Context::OnApp_Init()
-{
- ASSERT(m_pEventHandler != NULL);
- m_pEventHandler->OnApp_Init();
-}
-
-void CJS_Context::OnDoc_Open(CPDFSDK_Document* pDoc, const CFX_WideString &strTargetName)
-{
- ASSERT(m_pEventHandler != NULL);
- m_pEventHandler->OnDoc_Open(pDoc,strTargetName);
-}
-
-void CJS_Context::OnDoc_WillPrint(CPDFSDK_Document* pDoc)
-{
- ASSERT(m_pEventHandler != NULL);
- m_pEventHandler->OnDoc_WillPrint(pDoc);
-}
-
-void CJS_Context::OnDoc_DidPrint(CPDFSDK_Document* pDoc)
-{
- ASSERT(m_pEventHandler != NULL);
- m_pEventHandler->OnDoc_DidPrint(pDoc);
-}
-
-void CJS_Context::OnDoc_WillSave(CPDFSDK_Document* pDoc)
-{
- ASSERT(m_pEventHandler != NULL);
- m_pEventHandler->OnDoc_WillSave(pDoc);
-}
-
-void CJS_Context::OnDoc_DidSave(CPDFSDK_Document* pDoc)
-{
- ASSERT(m_pEventHandler != NULL);
- m_pEventHandler->OnDoc_DidSave(pDoc);
-}
-
-void CJS_Context::OnDoc_WillClose(CPDFSDK_Document* pDoc)
-{
- ASSERT(m_pEventHandler != NULL);
- m_pEventHandler->OnDoc_WillClose(pDoc);
-}
-
-void CJS_Context::OnPage_Open(CPDFSDK_Document* pTarget)
-{
- ASSERT(m_pEventHandler != NULL);
- m_pEventHandler->OnPage_Open(pTarget);
-}
-
-void CJS_Context::OnPage_Close(CPDFSDK_Document* pTarget)
-{
- ASSERT(m_pEventHandler != NULL);
- m_pEventHandler->OnPage_Close(pTarget);
-}
-
-void CJS_Context::OnPage_InView(CPDFSDK_Document* pTarget)
-{
- ASSERT(m_pEventHandler != NULL);
- m_pEventHandler->OnPage_InView(pTarget);
-}
-
-void CJS_Context::OnPage_OutView(CPDFSDK_Document* pTarget)
-{
- ASSERT(m_pEventHandler != NULL);
- m_pEventHandler->OnPage_OutView(pTarget);
-}
-
-void CJS_Context::OnField_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField *pTarget)
-{
- ASSERT(m_pEventHandler != NULL);
- m_pEventHandler->OnField_MouseDown(bModifier, bShift, pTarget);
-}
-
-void CJS_Context::OnField_MouseEnter(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField *pTarget)
-{
- ASSERT(m_pEventHandler != NULL);
- m_pEventHandler->OnField_MouseEnter(bModifier, bShift, pTarget);
-}
-
-void CJS_Context::OnField_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField *pTarget)
-{
- ASSERT(m_pEventHandler != NULL);
- m_pEventHandler->OnField_MouseExit(bModifier, bShift, pTarget);
-}
-
-void CJS_Context::OnField_MouseUp(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField *pTarget)
-{
- ASSERT(m_pEventHandler != NULL);
- m_pEventHandler->OnField_MouseUp(bModifier, bShift, pTarget);
-}
-
-void CJS_Context::OnField_Focus(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget, const CFX_WideString& Value)
-{
- ASSERT(m_pEventHandler != NULL);
- m_pEventHandler->OnField_Focus(bModifier, bShift, pTarget, Value);
-}
-
-void CJS_Context::OnField_Blur(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget, const CFX_WideString& Value)
-{
- ASSERT(m_pEventHandler != NULL);
- m_pEventHandler->OnField_Blur(bModifier, bShift, pTarget, Value);
-}
-
-void CJS_Context::OnField_Calculate(CPDF_FormField* pSource, CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL& bRc)
-{
- ASSERT(m_pEventHandler != NULL);
- m_pEventHandler->OnField_Calculate(pSource, pTarget, Value, bRc);
-}
-
-void CJS_Context::OnField_Format(int nCommitKey, CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL bWillCommit)
-{
- ASSERT(m_pEventHandler != NULL);
- m_pEventHandler->OnField_Format(nCommitKey, pTarget, Value, bWillCommit);
-}
-
-
-void CJS_Context::OnField_Keystroke(int nCommitKey, CFX_WideString& strChange, const CFX_WideString& strChangeEx,
- FX_BOOL bKeyDown, FX_BOOL bModifier, int &nSelEnd,int &nSelStart,
- FX_BOOL bShift, CPDF_FormField* pTarget, CFX_WideString& Value,
- FX_BOOL bWillCommit, FX_BOOL bFieldFull, FX_BOOL& bRc)
-{
- ASSERT(m_pEventHandler != NULL);
- m_pEventHandler->OnField_Keystroke(nCommitKey, strChange, strChangeEx, bKeyDown,
- bModifier, nSelEnd, nSelStart, bShift, pTarget, Value, bWillCommit, bFieldFull, bRc);
-}
-
-void CJS_Context::OnField_Validate(CFX_WideString& strChange,const CFX_WideString& strChangeEx,
- FX_BOOL bKeyDown, FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget,
- CFX_WideString& Value, FX_BOOL& bRc)
-{
- ASSERT(m_pEventHandler != NULL);
- m_pEventHandler->OnField_Validate(strChange, strChangeEx, bKeyDown, bModifier, bShift, pTarget, Value, bRc);
-}
-
-void CJS_Context::OnScreen_Focus(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
-{
- ASSERT(m_pEventHandler != NULL);
- m_pEventHandler->OnScreen_Focus(bModifier, bShift, pScreen);
-}
-
-void CJS_Context::OnScreen_Blur(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
-{
- ASSERT(m_pEventHandler != NULL);
- m_pEventHandler->OnScreen_Blur(bModifier, bShift, pScreen);
-}
-
-void CJS_Context::OnScreen_Open(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
-{
- ASSERT(m_pEventHandler != NULL);
- m_pEventHandler->OnScreen_Open(bModifier, bShift, pScreen);
-}
-
-void CJS_Context::OnScreen_Close(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
-{
- ASSERT(m_pEventHandler != NULL);
- m_pEventHandler->OnScreen_Close(bModifier, bShift, pScreen);
-}
-
-void CJS_Context::OnScreen_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
-{
- ASSERT(m_pEventHandler != NULL);
- m_pEventHandler->OnScreen_MouseDown(bModifier, bShift, pScreen);
-}
-
-void CJS_Context::OnScreen_MouseUp(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
-{
- ASSERT(m_pEventHandler != NULL);
- m_pEventHandler->OnScreen_MouseUp(bModifier, bShift, pScreen);
-}
-
-void CJS_Context::OnScreen_MouseEnter(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
-{
- ASSERT(m_pEventHandler != NULL);
- m_pEventHandler->OnScreen_MouseEnter(bModifier, bShift, pScreen);
-}
-
-void CJS_Context::OnScreen_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
-{
- ASSERT(m_pEventHandler != NULL);
- m_pEventHandler->OnScreen_MouseExit(bModifier, bShift, pScreen);
-}
-
-void CJS_Context::OnScreen_InView(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
-{
- ASSERT(m_pEventHandler != NULL);
- m_pEventHandler->OnScreen_InView(bModifier, bShift, pScreen);
-}
-
-void CJS_Context::OnScreen_OutView(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
-{
- ASSERT(m_pEventHandler != NULL);
- m_pEventHandler->OnScreen_OutView(bModifier, bShift, pScreen);
-}
-
-void CJS_Context::OnBookmark_MouseUp(CPDF_Bookmark* pBookMark)
-{
- ASSERT(m_pEventHandler != NULL);
- m_pEventHandler->OnBookmark_MouseUp(pBookMark);
-}
-
-void CJS_Context::OnLink_MouseUp(CPDFSDK_Document* pTarget)
-{
- ASSERT(m_pEventHandler != NULL);
- m_pEventHandler->OnLink_MouseUp(pTarget);
-}
-
-void CJS_Context::OnConsole_Exec()
-{
- ASSERT(m_pEventHandler != NULL);
- m_pEventHandler->OnConsole_Exec();
-}
-
-void CJS_Context::OnExternal_Exec()
-{
- ASSERT(m_pEventHandler != NULL);
- m_pEventHandler->OnExternal_Exec();
-}
-
-void CJS_Context::OnBatchExec(CPDFSDK_Document* pTarget)
-{
- ASSERT(m_pEventHandler != NULL);
- m_pEventHandler->OnBatchExec(pTarget);
-}
-
-void CJS_Context::OnMenu_Exec(CPDFSDK_Document* pTarget,const CFX_WideString& strTargetName)
-{
- ASSERT(m_pEventHandler != NULL);
- m_pEventHandler->OnMenu_Exec(pTarget, strTargetName);
-}
-
+// 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
+
+#include "../../include/javascript/JavaScript.h"
+#include "../../include/javascript/IJavaScript.h"
+//#include "../../include/javascript/JS_ResMgr.h"
+#include "../../include/javascript/JS_Context.h"
+#include "../../include/javascript/JS_EventHandler.h"
+#include "../../include/javascript/JS_Runtime.h"
+#include "../../include/javascript/resource.h"
+
+/* -------------------------- CJS_Context -------------------------- */
+
+CJS_Context::CJS_Context(CJS_Runtime* pRuntime) :
+ m_pRuntime(pRuntime),
+ m_bBusy(FALSE),
+ m_bMsgBoxEnable(TRUE)
+{
+ m_pEventHandler = new CJS_EventHandler(this);
+}
+
+CJS_Context::~CJS_Context(void)
+{
+ if (m_pEventHandler)
+ {
+ delete m_pEventHandler;
+ m_pEventHandler = NULL;
+ }
+}
+
+CPDFSDK_Document* CJS_Context::GetReaderDocument()
+{
+ ASSERT(m_pRuntime != NULL);
+
+ return m_pRuntime->GetReaderDocument();
+}
+
+CPDFDoc_Environment* CJS_Context::GetReaderApp()
+{
+ ASSERT(m_pRuntime != NULL);
+
+ return m_pRuntime->GetReaderApp();
+}
+
+FX_BOOL CJS_Context::DoJob(int nMode, const CFX_WideString& script, CFX_WideString& info)
+{
+ if (m_bBusy)
+ {
+ info = JSGetStringFromID(this, IDS_STRING_JSBUSY);
+ return FALSE;
+ }
+
+ m_bBusy = TRUE;
+
+ ASSERT(m_pRuntime != NULL);
+ ASSERT(m_pEventHandler != NULL);
+ ASSERT(m_pEventHandler->IsValid());
+
+ if (!m_pRuntime->AddEventToLoop(m_pEventHandler->TargetName(), m_pEventHandler->EventType()))
+ {
+ info = JSGetStringFromID(this, IDS_STRING_JSEVENT);
+ return FALSE;
+ }
+
+ FXJSErr error ={NULL,NULL, 0};
+ int nRet = 0;
+
+ try
+ {
+ if (script.GetLength() > 0)
+ {
+ if (nMode == 0)
+ {
+ nRet = JS_Execute(*m_pRuntime, this, script, script.GetLength(), &error);
+ }
+ else
+ {
+ nRet = JS_Parse(*m_pRuntime, this, script, script.GetLength(), &error);
+ }
+ }
+
+ if (nRet < 0)
+ {
+ CFX_WideString sLine;
+ sLine.Format((FX_LPCWSTR)L"[ Line: %05d { %s } ] : %s",error.linnum-1,error.srcline,error.message);
+
+// TRACE(L"/* -------------- JS Error -------------- */\n");
+// TRACE(sLine);
+// TRACE(L"\n");
+ //CFX_ByteString sTemp = CFX_ByteString::FromUnicode(error.message);
+ info += sLine;
+ }
+ else
+ {
+ info = JSGetStringFromID(this, IDS_STRING_RUN);
+ }
+
+ }
+ catch (...)
+ {
+ info = JSGetStringFromID(this, IDS_STRING_UNHANDLED);
+ nRet = -1;
+ }
+
+ m_pRuntime->RemoveEventInLoop(m_pEventHandler->TargetName(), m_pEventHandler->EventType());
+
+ m_pEventHandler->Destroy();
+ m_bBusy = FALSE;
+
+ return nRet >= 0;
+}
+
+FX_BOOL CJS_Context::RunScript(const CFX_WideString& script, CFX_WideString& info)
+{
+ v8::Isolate::Scope isolate_scope(m_pRuntime->GetIsolate());
+ v8::HandleScope handle_scope(m_pRuntime->GetIsolate());
+ v8::Local<v8::Context> context = m_pRuntime->NewJSContext();
+ v8::Context::Scope context_scope(context);
+
+ return DoJob(0, script, info);
+}
+
+FX_BOOL CJS_Context::Compile(const CFX_WideString& script, CFX_WideString& info)
+{
+ v8::Isolate::Scope isolate_scope(m_pRuntime->GetIsolate());
+ v8::HandleScope handle_scope(m_pRuntime->GetIsolate());
+ v8::Local<v8::Context> context = m_pRuntime->NewJSContext();
+ v8::Context::Scope context_scope(context);
+
+ return DoJob(1, script, info);
+}
+
+void CJS_Context::OnApp_Init()
+{
+ ASSERT(m_pEventHandler != NULL);
+ m_pEventHandler->OnApp_Init();
+}
+
+void CJS_Context::OnDoc_Open(CPDFSDK_Document* pDoc, const CFX_WideString &strTargetName)
+{
+ ASSERT(m_pEventHandler != NULL);
+ m_pEventHandler->OnDoc_Open(pDoc,strTargetName);
+}
+
+void CJS_Context::OnDoc_WillPrint(CPDFSDK_Document* pDoc)
+{
+ ASSERT(m_pEventHandler != NULL);
+ m_pEventHandler->OnDoc_WillPrint(pDoc);
+}
+
+void CJS_Context::OnDoc_DidPrint(CPDFSDK_Document* pDoc)
+{
+ ASSERT(m_pEventHandler != NULL);
+ m_pEventHandler->OnDoc_DidPrint(pDoc);
+}
+
+void CJS_Context::OnDoc_WillSave(CPDFSDK_Document* pDoc)
+{
+ ASSERT(m_pEventHandler != NULL);
+ m_pEventHandler->OnDoc_WillSave(pDoc);
+}
+
+void CJS_Context::OnDoc_DidSave(CPDFSDK_Document* pDoc)
+{
+ ASSERT(m_pEventHandler != NULL);
+ m_pEventHandler->OnDoc_DidSave(pDoc);
+}
+
+void CJS_Context::OnDoc_WillClose(CPDFSDK_Document* pDoc)
+{
+ ASSERT(m_pEventHandler != NULL);
+ m_pEventHandler->OnDoc_WillClose(pDoc);
+}
+
+void CJS_Context::OnPage_Open(CPDFSDK_Document* pTarget)
+{
+ ASSERT(m_pEventHandler != NULL);
+ m_pEventHandler->OnPage_Open(pTarget);
+}
+
+void CJS_Context::OnPage_Close(CPDFSDK_Document* pTarget)
+{
+ ASSERT(m_pEventHandler != NULL);
+ m_pEventHandler->OnPage_Close(pTarget);
+}
+
+void CJS_Context::OnPage_InView(CPDFSDK_Document* pTarget)
+{
+ ASSERT(m_pEventHandler != NULL);
+ m_pEventHandler->OnPage_InView(pTarget);
+}
+
+void CJS_Context::OnPage_OutView(CPDFSDK_Document* pTarget)
+{
+ ASSERT(m_pEventHandler != NULL);
+ m_pEventHandler->OnPage_OutView(pTarget);
+}
+
+void CJS_Context::OnField_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField *pTarget)
+{
+ ASSERT(m_pEventHandler != NULL);
+ m_pEventHandler->OnField_MouseDown(bModifier, bShift, pTarget);
+}
+
+void CJS_Context::OnField_MouseEnter(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField *pTarget)
+{
+ ASSERT(m_pEventHandler != NULL);
+ m_pEventHandler->OnField_MouseEnter(bModifier, bShift, pTarget);
+}
+
+void CJS_Context::OnField_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField *pTarget)
+{
+ ASSERT(m_pEventHandler != NULL);
+ m_pEventHandler->OnField_MouseExit(bModifier, bShift, pTarget);
+}
+
+void CJS_Context::OnField_MouseUp(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField *pTarget)
+{
+ ASSERT(m_pEventHandler != NULL);
+ m_pEventHandler->OnField_MouseUp(bModifier, bShift, pTarget);
+}
+
+void CJS_Context::OnField_Focus(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget, const CFX_WideString& Value)
+{
+ ASSERT(m_pEventHandler != NULL);
+ m_pEventHandler->OnField_Focus(bModifier, bShift, pTarget, Value);
+}
+
+void CJS_Context::OnField_Blur(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget, const CFX_WideString& Value)
+{
+ ASSERT(m_pEventHandler != NULL);
+ m_pEventHandler->OnField_Blur(bModifier, bShift, pTarget, Value);
+}
+
+void CJS_Context::OnField_Calculate(CPDF_FormField* pSource, CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL& bRc)
+{
+ ASSERT(m_pEventHandler != NULL);
+ m_pEventHandler->OnField_Calculate(pSource, pTarget, Value, bRc);
+}
+
+void CJS_Context::OnField_Format(int nCommitKey, CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL bWillCommit)
+{
+ ASSERT(m_pEventHandler != NULL);
+ m_pEventHandler->OnField_Format(nCommitKey, pTarget, Value, bWillCommit);
+}
+
+
+void CJS_Context::OnField_Keystroke(int nCommitKey, CFX_WideString& strChange, const CFX_WideString& strChangeEx,
+ FX_BOOL bKeyDown, FX_BOOL bModifier, int &nSelEnd,int &nSelStart,
+ FX_BOOL bShift, CPDF_FormField* pTarget, CFX_WideString& Value,
+ FX_BOOL bWillCommit, FX_BOOL bFieldFull, FX_BOOL& bRc)
+{
+ ASSERT(m_pEventHandler != NULL);
+ m_pEventHandler->OnField_Keystroke(nCommitKey, strChange, strChangeEx, bKeyDown,
+ bModifier, nSelEnd, nSelStart, bShift, pTarget, Value, bWillCommit, bFieldFull, bRc);
+}
+
+void CJS_Context::OnField_Validate(CFX_WideString& strChange,const CFX_WideString& strChangeEx,
+ FX_BOOL bKeyDown, FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget,
+ CFX_WideString& Value, FX_BOOL& bRc)
+{
+ ASSERT(m_pEventHandler != NULL);
+ m_pEventHandler->OnField_Validate(strChange, strChangeEx, bKeyDown, bModifier, bShift, pTarget, Value, bRc);
+}
+
+void CJS_Context::OnScreen_Focus(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
+{
+ ASSERT(m_pEventHandler != NULL);
+ m_pEventHandler->OnScreen_Focus(bModifier, bShift, pScreen);
+}
+
+void CJS_Context::OnScreen_Blur(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
+{
+ ASSERT(m_pEventHandler != NULL);
+ m_pEventHandler->OnScreen_Blur(bModifier, bShift, pScreen);
+}
+
+void CJS_Context::OnScreen_Open(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
+{
+ ASSERT(m_pEventHandler != NULL);
+ m_pEventHandler->OnScreen_Open(bModifier, bShift, pScreen);
+}
+
+void CJS_Context::OnScreen_Close(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
+{
+ ASSERT(m_pEventHandler != NULL);
+ m_pEventHandler->OnScreen_Close(bModifier, bShift, pScreen);
+}
+
+void CJS_Context::OnScreen_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
+{
+ ASSERT(m_pEventHandler != NULL);
+ m_pEventHandler->OnScreen_MouseDown(bModifier, bShift, pScreen);
+}
+
+void CJS_Context::OnScreen_MouseUp(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
+{
+ ASSERT(m_pEventHandler != NULL);
+ m_pEventHandler->OnScreen_MouseUp(bModifier, bShift, pScreen);
+}
+
+void CJS_Context::OnScreen_MouseEnter(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
+{
+ ASSERT(m_pEventHandler != NULL);
+ m_pEventHandler->OnScreen_MouseEnter(bModifier, bShift, pScreen);
+}
+
+void CJS_Context::OnScreen_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
+{
+ ASSERT(m_pEventHandler != NULL);
+ m_pEventHandler->OnScreen_MouseExit(bModifier, bShift, pScreen);
+}
+
+void CJS_Context::OnScreen_InView(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
+{
+ ASSERT(m_pEventHandler != NULL);
+ m_pEventHandler->OnScreen_InView(bModifier, bShift, pScreen);
+}
+
+void CJS_Context::OnScreen_OutView(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
+{
+ ASSERT(m_pEventHandler != NULL);
+ m_pEventHandler->OnScreen_OutView(bModifier, bShift, pScreen);
+}
+
+void CJS_Context::OnBookmark_MouseUp(CPDF_Bookmark* pBookMark)
+{
+ ASSERT(m_pEventHandler != NULL);
+ m_pEventHandler->OnBookmark_MouseUp(pBookMark);
+}
+
+void CJS_Context::OnLink_MouseUp(CPDFSDK_Document* pTarget)
+{
+ ASSERT(m_pEventHandler != NULL);
+ m_pEventHandler->OnLink_MouseUp(pTarget);
+}
+
+void CJS_Context::OnConsole_Exec()
+{
+ ASSERT(m_pEventHandler != NULL);
+ m_pEventHandler->OnConsole_Exec();
+}
+
+void CJS_Context::OnExternal_Exec()
+{
+ ASSERT(m_pEventHandler != NULL);
+ m_pEventHandler->OnExternal_Exec();
+}
+
+void CJS_Context::OnBatchExec(CPDFSDK_Document* pTarget)
+{
+ ASSERT(m_pEventHandler != NULL);
+ m_pEventHandler->OnBatchExec(pTarget);
+}
+
+void CJS_Context::OnMenu_Exec(CPDFSDK_Document* pTarget,const CFX_WideString& strTargetName)
+{
+ ASSERT(m_pEventHandler != NULL);
+ m_pEventHandler->OnMenu_Exec(pTarget, strTargetName);
+}
+
diff --git a/fpdfsdk/src/javascript/JS_EventHandler.cpp b/fpdfsdk/src/javascript/JS_EventHandler.cpp
index ce69e6b9d2..76c6d37f03 100644
--- a/fpdfsdk/src/javascript/JS_EventHandler.cpp
+++ b/fpdfsdk/src/javascript/JS_EventHandler.cpp
@@ -1,676 +1,676 @@
-// 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
-
-#include "../../include/javascript/JavaScript.h"
-#include "../../include/javascript/IJavaScript.h"
-#include "../../include/javascript/JS_EventHandler.h"
-//#include "../../include/javascript/JS_ResMgr.h"
-#include "../../include/javascript/JS_Context.h"
-#include "../../include/javascript/JS_Runtime.h"
-#include "../../include/javascript/JS_Define.h"
-#include "../../include/javascript/JS_Object.h"
-#include "../../include/javascript/JS_Value.h"
-#include "../../include/javascript/Document.h"
-#include "../../include/javascript/Field.h"
-
-/* ---------------------------- CJS_EventHandler ---------------------------- */
-
-CJS_EventHandler::CJS_EventHandler(CJS_Context * pContext) :
- m_pJSContext(pContext),
- m_eEventType(JET_UNKNOWN),
- m_bValid(FALSE),
- m_pWideStrChange(NULL),
- m_nCommitKey(-1),
- m_bKeyDown(FALSE),
- m_bModifier(FALSE),
- m_bShift(FALSE),
- m_pISelEnd(NULL),
- m_nSelEndDu(0),
- m_pISelStart(NULL),
- m_nSelStartDu(0),
- m_bWillCommit(FALSE),
- m_pValue(NULL),
- m_bFieldFull(FALSE),
- m_pbRc(NULL),
- m_bRcDu(FALSE),
- m_pSourceDoc(NULL),
- m_pTargetBookMark(NULL),
- m_pTargetDoc(NULL),
- m_pTargetAnnot(NULL)
-{
-}
-
-CJS_EventHandler::~CJS_EventHandler()
-{
-}
-
-void CJS_EventHandler::OnApp_Init()
-{
- Initial(JET_APP_INIT);
-}
-
-void CJS_EventHandler::OnDoc_Open(CPDFSDK_Document* pDoc, const CFX_WideString& strTargetName)
-{
- Initial(JET_DOC_OPEN);
-
- m_pTargetDoc = pDoc;
- m_strTargetName = strTargetName;
-}
-
-void CJS_EventHandler::OnDoc_WillPrint(CPDFSDK_Document* pDoc)
-{
- Initial(JET_DOC_WILLPRINT);
-
- m_pTargetDoc = pDoc;
-}
-
-void CJS_EventHandler::OnDoc_DidPrint(CPDFSDK_Document* pDoc)
-{
- Initial(JET_DOC_DIDPRINT);
-
- m_pTargetDoc = pDoc;
-}
-
-void CJS_EventHandler::OnDoc_WillSave(CPDFSDK_Document* pDoc)
-{
- Initial(JET_DOC_WILLSAVE);
- m_pTargetDoc = pDoc;
-}
-
-void CJS_EventHandler::OnDoc_DidSave(CPDFSDK_Document* pDoc)
-{
- Initial(JET_DOC_DIDSAVE);
-
- m_pTargetDoc = pDoc;
-}
-
-void CJS_EventHandler::OnDoc_WillClose(CPDFSDK_Document* pDoc)
-{
- Initial(JET_DOC_WILLCLOSE);
-
- m_pTargetDoc = pDoc;
-}
-
-void CJS_EventHandler::OnPage_Open(CPDFSDK_Document* pDoc)
-{
- Initial(JET_PAGE_OPEN);
-
- m_pTargetDoc = pDoc;
-}
-
-void CJS_EventHandler::OnPage_Close(CPDFSDK_Document* pDoc)
-{
- Initial(JET_PAGE_CLOSE);
-
- m_pTargetDoc = pDoc;
-}
-
-void CJS_EventHandler::OnPage_InView(CPDFSDK_Document* pDoc)
-{
- Initial(JET_PAGE_INVIEW);
-
- m_pTargetDoc = pDoc;
-}
-
-void CJS_EventHandler::OnPage_OutView(CPDFSDK_Document* pDoc)
-{
- Initial(JET_PAGE_OUTVIEW);
-
- m_pTargetDoc = pDoc;
-}
-
-void CJS_EventHandler::OnField_MouseEnter(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget)
-{
- Initial(JET_FIELD_MOUSEENTER);
-
- m_bModifier = bModifier;
- m_bShift = bShift;
-
- ASSERT(pTarget != NULL);
- m_strTargetName = pTarget->GetFullName();
-}
-
-void CJS_EventHandler::OnField_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget)
-{
- Initial(JET_FIELD_MOUSEEXIT);
-
- m_bModifier = bModifier;
- m_bShift = bShift;
- ASSERT(pTarget != NULL);
- m_strTargetName = pTarget->GetFullName();
-}
-
-void CJS_EventHandler::OnField_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget)
-{
- Initial(JET_FIELD_MOUSEDOWN);
- m_eEventType = JET_FIELD_MOUSEDOWN;
-
- m_bModifier = bModifier;
- m_bShift = bShift;
- ASSERT(pTarget != NULL);
- m_strTargetName = pTarget->GetFullName();
-}
-
-void CJS_EventHandler::OnField_MouseUp(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget)
-{
- Initial(JET_FIELD_MOUSEUP);
-
- m_bModifier = bModifier;
- m_bShift = bShift;
- ASSERT(pTarget != NULL);
- m_strTargetName = pTarget->GetFullName();
-}
-
-void CJS_EventHandler::OnField_Focus(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget,
- const CFX_WideString& Value)
-{
- Initial(JET_FIELD_FOCUS);
-
- m_bModifier = bModifier;
- m_bShift = bShift;
- ASSERT(pTarget != NULL);
- m_strTargetName = pTarget->GetFullName();
- m_pValue = (CFX_WideString*)&Value;
-}
-
-void CJS_EventHandler::OnField_Blur(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget,
- const CFX_WideString& Value)
-{
- Initial(JET_FIELD_BLUR);
-
- m_bModifier = bModifier;
- m_bShift = bShift;
- ASSERT(pTarget != NULL);
- m_strTargetName = pTarget->GetFullName();
- m_pValue = (CFX_WideString*)&Value;
-}
-
-void CJS_EventHandler::OnField_Keystroke(int nCommitKey, CFX_WideString &strChange,
- const CFX_WideString& strChangeEx, FX_BOOL KeyDown,
- FX_BOOL bModifier, int& nSelEnd, int& nSelStart,
- FX_BOOL bShift, CPDF_FormField* pTarget,
- CFX_WideString& Value, FX_BOOL bWillCommit,
- FX_BOOL bFieldFull, FX_BOOL& bRc)
-{
- Initial(JET_FIELD_KEYSTROKE);
-
- m_nCommitKey = nCommitKey;
- m_pWideStrChange = &strChange;
- m_WideStrChangeEx = strChangeEx;
- m_bKeyDown = KeyDown;
- m_bModifier = bModifier;
- m_pISelEnd = &nSelEnd;
- m_pISelStart = &nSelStart;
- m_bShift = bShift;
- ASSERT(pTarget != NULL);
- m_strTargetName = pTarget->GetFullName();
- m_pValue = &Value;
- m_bWillCommit = bWillCommit;
- m_pbRc = &bRc;
- m_bFieldFull = bFieldFull;
-}
-
-void CJS_EventHandler::OnField_Validate(CFX_WideString& strChange, const CFX_WideString& strChangeEx,
- FX_BOOL bKeyDown, FX_BOOL bModifier, FX_BOOL bShift,
- CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL& bRc)
-{
- Initial(JET_FIELD_VALIDATE);
-
- m_pWideStrChange = &strChange;
- m_WideStrChangeEx = strChangeEx;
- m_bKeyDown = bKeyDown;
- m_bModifier = bModifier;
- m_bShift = bShift;
- ASSERT(pTarget != NULL);
- m_strTargetName = pTarget->GetFullName();
- m_pValue = &Value;
- m_pbRc = &bRc;
-}
-
-void CJS_EventHandler::OnField_Calculate(CPDF_FormField* pSource, CPDF_FormField* pTarget,
- CFX_WideString& Value, FX_BOOL& bRc)
-{
- Initial(JET_FIELD_CALCULATE);
-
- if (pSource)
- m_strSourceName = pSource->GetFullName();
- ASSERT(pTarget != NULL);
- m_strTargetName = pTarget->GetFullName();
- m_pValue = &Value;
- m_pbRc = &bRc;
-}
-
-void CJS_EventHandler::OnField_Format(int nCommitKey, CPDF_FormField* pTarget,
- CFX_WideString& Value, FX_BOOL bWillCommit)
-{
- Initial(JET_FIELD_FORMAT);
-
- m_nCommitKey = nCommitKey;
- ASSERT(pTarget != NULL);
- m_strTargetName = pTarget->GetFullName();
- m_pValue = &Value;
- m_bWillCommit = bWillCommit;
-}
-
-void CJS_EventHandler::OnScreen_Focus(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
-{
- Initial(JET_SCREEN_FOCUS);
-
- m_bModifier = bModifier;
- m_bShift = bShift;
- m_pTargetAnnot = pScreen;
-}
-
-void CJS_EventHandler::OnScreen_Blur(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
-{
- Initial(JET_SCREEN_BLUR);
-
- m_bModifier = bModifier;
- m_bShift = bShift;
- m_pTargetAnnot = pScreen;
-}
-
-void CJS_EventHandler::OnScreen_Open(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
-{
- Initial(JET_SCREEN_OPEN);
-
- m_bModifier = bModifier;
- m_bShift = bShift;
- m_pTargetAnnot = pScreen;
-}
-
-void CJS_EventHandler::OnScreen_Close(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
-{
- Initial(JET_SCREEN_CLOSE);
-
- m_bModifier = bModifier;
- m_bShift = bShift;
- m_pTargetAnnot = pScreen;
-}
-
-void CJS_EventHandler::OnScreen_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
-{
- Initial(JET_SCREEN_MOUSEDOWN);
-
- m_bModifier = bModifier;
- m_bShift = bShift;
- m_pTargetAnnot = pScreen;
-}
-
-void CJS_EventHandler::OnScreen_MouseUp(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
-{
- Initial(JET_SCREEN_MOUSEUP);
-
- m_bModifier = bModifier;
- m_bShift = bShift;
- m_pTargetAnnot = pScreen;
-}
-
-void CJS_EventHandler::OnScreen_MouseEnter(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
-{
- Initial(JET_SCREEN_MOUSEENTER);
-
- m_bModifier = bModifier;
- m_bShift = bShift;
- m_pTargetAnnot = pScreen;
-}
-
-void CJS_EventHandler::OnScreen_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
-{
- Initial(JET_SCREEN_MOUSEEXIT);
-
- m_bModifier = bModifier;
- m_bShift = bShift;
- m_pTargetAnnot = pScreen;
-}
-
-void CJS_EventHandler::OnScreen_InView(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
-{
- Initial(JET_SCREEN_INVIEW);
-
- m_bModifier = bModifier;
- m_bShift = bShift;
- m_pTargetAnnot = pScreen;
-}
-
-void CJS_EventHandler::OnScreen_OutView(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
-{
- Initial(JET_SCREEN_OUTVIEW);
-
- m_bModifier = bModifier;
- m_bShift = bShift;
- m_pTargetAnnot = pScreen;
-}
-
-void CJS_EventHandler::OnLink_MouseUp(CPDFSDK_Document* pTarget)
-{
- Initial(JET_LINK_MOUSEUP);
-
- m_pTargetDoc = pTarget;
-}
-
-void CJS_EventHandler::OnBookmark_MouseUp(CPDF_Bookmark* pBookMark)
-{
- Initial(JET_BOOKMARK_MOUSEUP);
-
- m_pTargetBookMark = pBookMark;
-}
-
-void CJS_EventHandler::OnMenu_Exec(CPDFSDK_Document* pTarget, const CFX_WideString& strTargetName)
-{
- Initial(JET_MENU_EXEC);
-
- m_pTargetDoc = pTarget;
- m_strTargetName = strTargetName;
-}
-
-void CJS_EventHandler::OnExternal_Exec()
-{
- Initial(JET_EXTERNAL_EXEC);
-}
-
-void CJS_EventHandler::OnBatchExec(CPDFSDK_Document* pTarget)
-{
- Initial(JET_BATCH_EXEC);
-
- m_pTargetDoc = pTarget;
-}
-
-void CJS_EventHandler::OnConsole_Exec()
-{
- Initial(JET_CONSOLE_EXEC);
-}
-
-
-void CJS_EventHandler::Initial(JS_EVENT_T type)
-{
- m_eEventType = type;
-
- m_strTargetName = L"";
- m_strSourceName = L"";
- m_pWideStrChange = NULL;
- m_WideStrChangeDu = L"";
- m_WideStrChangeEx = L"";
- m_nCommitKey = -1;
- m_bKeyDown = FALSE;
- m_bModifier = FALSE;
- m_bShift = FALSE;
- m_pISelEnd = NULL;
- m_nSelEndDu = 0;
- m_pISelStart = NULL;
- m_nSelStartDu = 0;
- m_bWillCommit = FALSE;
- m_pValue = NULL;
- m_bFieldFull = FALSE;
- m_pbRc = NULL;
- m_bRcDu = FALSE;
-
- m_pSourceDoc = NULL;
- m_pTargetBookMark = NULL;
- m_pTargetDoc = NULL;
- m_pTargetAnnot = NULL;
-
- m_bValid = TRUE;
-}
-
-void CJS_EventHandler::Destroy()
-{
- m_bValid = FALSE;
-}
-
-FX_BOOL CJS_EventHandler::IsValid()
-{
- return m_bValid;
-}
-
-CFX_WideString & CJS_EventHandler::Change()
-{
- if (m_pWideStrChange != NULL)
- return *m_pWideStrChange;
- else
- {
- return m_WideStrChangeDu;
- }
-}
-
-CFX_WideString CJS_EventHandler::ChangeEx()
-{
- return m_WideStrChangeEx;
-}
-
-int CJS_EventHandler::CommitKey()
-{
- return m_nCommitKey;
-}
-
-FX_BOOL CJS_EventHandler::FieldFull()
-{
- return m_bFieldFull;
-}
-
-FX_BOOL CJS_EventHandler::KeyDown()
-{
- return m_bKeyDown;
-}
-
-FX_BOOL CJS_EventHandler::Modifier()
-{
- return m_bModifier;
-}
-
-FX_LPCWSTR CJS_EventHandler::Name()
-{
- switch (m_eEventType)
- {
- case JET_APP_INIT: return (FX_LPCWSTR)L"Init";
- case JET_BATCH_EXEC: return (FX_LPCWSTR)L"Exec";
- case JET_BOOKMARK_MOUSEUP: return (FX_LPCWSTR)L"Mouse Up";
- case JET_CONSOLE_EXEC: return (FX_LPCWSTR)L"Exec";
- case JET_DOC_DIDPRINT: return (FX_LPCWSTR)L"DidPrint";
- case JET_DOC_DIDSAVE: return (FX_LPCWSTR)L"DidSave";
- case JET_DOC_OPEN: return (FX_LPCWSTR)L"Open";
- case JET_DOC_WILLCLOSE: return (FX_LPCWSTR)L"WillClose";
- case JET_DOC_WILLPRINT: return (FX_LPCWSTR)L"WillPrint";
- case JET_DOC_WILLSAVE: return (FX_LPCWSTR)L"WillSave";
- case JET_EXTERNAL_EXEC: return (FX_LPCWSTR)L"Exec";
- case JET_FIELD_FOCUS:
- case JET_SCREEN_FOCUS: return (FX_LPCWSTR)L"Focus";
- case JET_FIELD_BLUR:
- case JET_SCREEN_BLUR: return (FX_LPCWSTR)L"Blur";
- case JET_FIELD_MOUSEDOWN:
- case JET_SCREEN_MOUSEDOWN: return (FX_LPCWSTR)L"Mouse Down";
- case JET_FIELD_MOUSEUP:
- case JET_SCREEN_MOUSEUP: return (FX_LPCWSTR)L"Mouse Up";
- case JET_FIELD_MOUSEENTER:
- case JET_SCREEN_MOUSEENTER: return (FX_LPCWSTR)L"Mouse Enter";
- case JET_FIELD_MOUSEEXIT:
- case JET_SCREEN_MOUSEEXIT: return (FX_LPCWSTR)L"Mouse Exit";
- case JET_FIELD_CALCULATE: return (FX_LPCWSTR)L"Calculate";
- case JET_FIELD_FORMAT: return (FX_LPCWSTR)L"Format";
- case JET_FIELD_KEYSTROKE: return (FX_LPCWSTR)L"Keystroke";
- case JET_FIELD_VALIDATE: return (FX_LPCWSTR)L"Validate";
- case JET_LINK_MOUSEUP: return (FX_LPCWSTR)L"Mouse Up";
- case JET_MENU_EXEC: return (FX_LPCWSTR)L"Exec";
- case JET_PAGE_OPEN:
- case JET_SCREEN_OPEN: return (FX_LPCWSTR)L"Open";
- case JET_PAGE_CLOSE:
- case JET_SCREEN_CLOSE: return (FX_LPCWSTR)L"Close";
- case JET_SCREEN_INVIEW:
- case JET_PAGE_INVIEW: return (FX_LPCWSTR)L"InView";
- case JET_PAGE_OUTVIEW:
- case JET_SCREEN_OUTVIEW: return (FX_LPCWSTR)L"OutView";
- default:
- return (FX_LPCWSTR)L"";
- }
-
- return (FX_LPCWSTR)L"";
-}
-
-FX_LPCWSTR CJS_EventHandler::Type()
-{
- switch (m_eEventType)
- {
- case JET_APP_INIT: return (FX_LPCWSTR)L"App";
- case JET_BATCH_EXEC: return (FX_LPCWSTR)L"Batch";
- case JET_BOOKMARK_MOUSEUP: return (FX_LPCWSTR)L"BookMark";
- case JET_CONSOLE_EXEC: return (FX_LPCWSTR)L"Console";
- case JET_DOC_DIDPRINT:
- case JET_DOC_DIDSAVE:
- case JET_DOC_OPEN:
- case JET_DOC_WILLCLOSE:
- case JET_DOC_WILLPRINT:
- case JET_DOC_WILLSAVE: return (FX_LPCWSTR)L"Doc";
- case JET_EXTERNAL_EXEC: return (FX_LPCWSTR)L"External";
- case JET_FIELD_BLUR:
- case JET_FIELD_FOCUS:
- case JET_FIELD_MOUSEDOWN:
- case JET_FIELD_MOUSEENTER:
- case JET_FIELD_MOUSEEXIT:
- case JET_FIELD_MOUSEUP:
- case JET_FIELD_CALCULATE:
- case JET_FIELD_FORMAT:
- case JET_FIELD_KEYSTROKE:
- case JET_FIELD_VALIDATE: return (FX_LPCWSTR)L"Field";
- case JET_SCREEN_FOCUS:
- case JET_SCREEN_BLUR:
- case JET_SCREEN_OPEN:
- case JET_SCREEN_CLOSE:
- case JET_SCREEN_MOUSEDOWN:
- case JET_SCREEN_MOUSEUP:
- case JET_SCREEN_MOUSEENTER:
- case JET_SCREEN_MOUSEEXIT:
- case JET_SCREEN_INVIEW:
- case JET_SCREEN_OUTVIEW: return (FX_LPCWSTR)L"Screen";
- case JET_LINK_MOUSEUP: return (FX_LPCWSTR)L"Link";
- case JET_MENU_EXEC: return (FX_LPCWSTR)L"Menu";
- case JET_PAGE_OPEN:
- case JET_PAGE_CLOSE:
- case JET_PAGE_INVIEW:
- case JET_PAGE_OUTVIEW:return (FX_LPCWSTR)L"Page";
- default:
- return (FX_LPCWSTR)L"";
- }
-
- return (FX_LPCWSTR)L"";
-}
-
-FX_BOOL& CJS_EventHandler::Rc()
-{
- if (m_pbRc != NULL)
- return *m_pbRc;
- else
- {
- return m_bRcDu;
- }
-}
-
-int & CJS_EventHandler::SelEnd()
-{
- if (m_pISelEnd != NULL)
- {
- return *m_pISelEnd;
- }
- else
- {
- return m_nSelEndDu;
- }
-}
-
-int & CJS_EventHandler::SelStart()
-{
- if (m_pISelStart != NULL)
- return * m_pISelStart;
- else
- {
- return m_nSelStartDu;
- }
-}
-
-FX_BOOL CJS_EventHandler::Shift()
-{
- return m_bShift;
-}
-
-Field* CJS_EventHandler::Source()
-{
- ASSERT(m_pJSContext != NULL);
-
- CJS_Runtime* pRuntime = m_pJSContext->GetJSRuntime();
-
- JSFXObject pDocObj = JS_NewFxDynamicObj(*pRuntime, m_pJSContext, JS_GetObjDefnID(*pRuntime, L"Document"));
- ASSERT(pDocObj.IsEmpty() == FALSE);
- JSFXObject pFieldObj = JS_NewFxDynamicObj(*pRuntime, m_pJSContext, JS_GetObjDefnID(*pRuntime, L"Field"));
- ASSERT(pFieldObj.IsEmpty() == FALSE);
-
- CJS_Document* pJSDocument = (CJS_Document*)JS_GetPrivate(pDocObj);
- ASSERT(pJSDocument != NULL);
- Document* pDocument = (Document*)pJSDocument->GetEmbedObject();
- ASSERT(pDocument != NULL);
- if (m_pTargetDoc != NULL)
- pDocument->AttachDoc(m_pTargetDoc);
- else
- pDocument->AttachDoc(m_pJSContext->GetReaderDocument());
-
- //if (m_pSourceField == NULL)
- // return NULL;
- //CRAO_Widget *pWidget = IBCL_Widget::GetWidget(m_pSourceField);
- //CPDF_FormField* pFormField = pWidget->GetFormField();
- //ASSERT(pFormField);
- //CFX_WideString csFieldName = pFormField->GetFullName();
- CJS_Field * pJSField = (CJS_Field*)JS_GetPrivate(pFieldObj);
- ASSERT(pJSField != NULL);
- Field * pField = (Field *)pJSField->GetEmbedObject();
- ASSERT(pField != NULL);
- pField->AttachField(pDocument, m_strSourceName);
- return pField;
-}
-
-Field* CJS_EventHandler::Target_Field()
-{
- ASSERT(m_pJSContext != NULL);
-
- CJS_Runtime* pRuntime = m_pJSContext->GetJSRuntime();
-
- JSFXObject pDocObj = JS_NewFxDynamicObj(*pRuntime, m_pJSContext, JS_GetObjDefnID(*pRuntime, L"Document"));
- ASSERT(pDocObj.IsEmpty() == FALSE);
- JSFXObject pFieldObj = JS_NewFxDynamicObj(*pRuntime, m_pJSContext, JS_GetObjDefnID(*pRuntime, L"Field"));
- ASSERT(pFieldObj.IsEmpty() == FALSE);
-
- CJS_Document* pJSDocument = (CJS_Document*)JS_GetPrivate(pDocObj);
- ASSERT(pJSDocument != NULL);
- Document* pDocument = (Document*)pJSDocument->GetEmbedObject();
- ASSERT(pDocument != NULL);
- if (m_pTargetDoc != NULL)
- pDocument->AttachDoc(m_pTargetDoc);
- else
- pDocument->AttachDoc(m_pJSContext->GetReaderDocument());
-
- CJS_Field* pJSField = (CJS_Field*)JS_GetPrivate(pFieldObj);
- ASSERT(pJSField != NULL);
-
- Field* pField = (Field *)pJSField->GetEmbedObject();
- ASSERT(pField != NULL);
-
- pField->AttachField(pDocument, m_strTargetName);
- return pField;
-}
-
-CFX_WideString& CJS_EventHandler::Value()
-{
- return *m_pValue;
-}
-
-FX_BOOL CJS_EventHandler::WillCommit()
-{
- return m_bWillCommit;
-}
-
-CFX_WideString CJS_EventHandler::TargetName()
-{
- return m_strTargetName;
-}
-
-
+// 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
+
+#include "../../include/javascript/JavaScript.h"
+#include "../../include/javascript/IJavaScript.h"
+#include "../../include/javascript/JS_EventHandler.h"
+//#include "../../include/javascript/JS_ResMgr.h"
+#include "../../include/javascript/JS_Context.h"
+#include "../../include/javascript/JS_Runtime.h"
+#include "../../include/javascript/JS_Define.h"
+#include "../../include/javascript/JS_Object.h"
+#include "../../include/javascript/JS_Value.h"
+#include "../../include/javascript/Document.h"
+#include "../../include/javascript/Field.h"
+
+/* ---------------------------- CJS_EventHandler ---------------------------- */
+
+CJS_EventHandler::CJS_EventHandler(CJS_Context * pContext) :
+ m_pJSContext(pContext),
+ m_eEventType(JET_UNKNOWN),
+ m_bValid(FALSE),
+ m_pWideStrChange(NULL),
+ m_nCommitKey(-1),
+ m_bKeyDown(FALSE),
+ m_bModifier(FALSE),
+ m_bShift(FALSE),
+ m_pISelEnd(NULL),
+ m_nSelEndDu(0),
+ m_pISelStart(NULL),
+ m_nSelStartDu(0),
+ m_bWillCommit(FALSE),
+ m_pValue(NULL),
+ m_bFieldFull(FALSE),
+ m_pbRc(NULL),
+ m_bRcDu(FALSE),
+ m_pSourceDoc(NULL),
+ m_pTargetBookMark(NULL),
+ m_pTargetDoc(NULL),
+ m_pTargetAnnot(NULL)
+{
+}
+
+CJS_EventHandler::~CJS_EventHandler()
+{
+}
+
+void CJS_EventHandler::OnApp_Init()
+{
+ Initial(JET_APP_INIT);
+}
+
+void CJS_EventHandler::OnDoc_Open(CPDFSDK_Document* pDoc, const CFX_WideString& strTargetName)
+{
+ Initial(JET_DOC_OPEN);
+
+ m_pTargetDoc = pDoc;
+ m_strTargetName = strTargetName;
+}
+
+void CJS_EventHandler::OnDoc_WillPrint(CPDFSDK_Document* pDoc)
+{
+ Initial(JET_DOC_WILLPRINT);
+
+ m_pTargetDoc = pDoc;
+}
+
+void CJS_EventHandler::OnDoc_DidPrint(CPDFSDK_Document* pDoc)
+{
+ Initial(JET_DOC_DIDPRINT);
+
+ m_pTargetDoc = pDoc;
+}
+
+void CJS_EventHandler::OnDoc_WillSave(CPDFSDK_Document* pDoc)
+{
+ Initial(JET_DOC_WILLSAVE);
+ m_pTargetDoc = pDoc;
+}
+
+void CJS_EventHandler::OnDoc_DidSave(CPDFSDK_Document* pDoc)
+{
+ Initial(JET_DOC_DIDSAVE);
+
+ m_pTargetDoc = pDoc;
+}
+
+void CJS_EventHandler::OnDoc_WillClose(CPDFSDK_Document* pDoc)
+{
+ Initial(JET_DOC_WILLCLOSE);
+
+ m_pTargetDoc = pDoc;
+}
+
+void CJS_EventHandler::OnPage_Open(CPDFSDK_Document* pDoc)
+{
+ Initial(JET_PAGE_OPEN);
+
+ m_pTargetDoc = pDoc;
+}
+
+void CJS_EventHandler::OnPage_Close(CPDFSDK_Document* pDoc)
+{
+ Initial(JET_PAGE_CLOSE);
+
+ m_pTargetDoc = pDoc;
+}
+
+void CJS_EventHandler::OnPage_InView(CPDFSDK_Document* pDoc)
+{
+ Initial(JET_PAGE_INVIEW);
+
+ m_pTargetDoc = pDoc;
+}
+
+void CJS_EventHandler::OnPage_OutView(CPDFSDK_Document* pDoc)
+{
+ Initial(JET_PAGE_OUTVIEW);
+
+ m_pTargetDoc = pDoc;
+}
+
+void CJS_EventHandler::OnField_MouseEnter(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget)
+{
+ Initial(JET_FIELD_MOUSEENTER);
+
+ m_bModifier = bModifier;
+ m_bShift = bShift;
+
+ ASSERT(pTarget != NULL);
+ m_strTargetName = pTarget->GetFullName();
+}
+
+void CJS_EventHandler::OnField_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget)
+{
+ Initial(JET_FIELD_MOUSEEXIT);
+
+ m_bModifier = bModifier;
+ m_bShift = bShift;
+ ASSERT(pTarget != NULL);
+ m_strTargetName = pTarget->GetFullName();
+}
+
+void CJS_EventHandler::OnField_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget)
+{
+ Initial(JET_FIELD_MOUSEDOWN);
+ m_eEventType = JET_FIELD_MOUSEDOWN;
+
+ m_bModifier = bModifier;
+ m_bShift = bShift;
+ ASSERT(pTarget != NULL);
+ m_strTargetName = pTarget->GetFullName();
+}
+
+void CJS_EventHandler::OnField_MouseUp(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget)
+{
+ Initial(JET_FIELD_MOUSEUP);
+
+ m_bModifier = bModifier;
+ m_bShift = bShift;
+ ASSERT(pTarget != NULL);
+ m_strTargetName = pTarget->GetFullName();
+}
+
+void CJS_EventHandler::OnField_Focus(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget,
+ const CFX_WideString& Value)
+{
+ Initial(JET_FIELD_FOCUS);
+
+ m_bModifier = bModifier;
+ m_bShift = bShift;
+ ASSERT(pTarget != NULL);
+ m_strTargetName = pTarget->GetFullName();
+ m_pValue = (CFX_WideString*)&Value;
+}
+
+void CJS_EventHandler::OnField_Blur(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget,
+ const CFX_WideString& Value)
+{
+ Initial(JET_FIELD_BLUR);
+
+ m_bModifier = bModifier;
+ m_bShift = bShift;
+ ASSERT(pTarget != NULL);
+ m_strTargetName = pTarget->GetFullName();
+ m_pValue = (CFX_WideString*)&Value;
+}
+
+void CJS_EventHandler::OnField_Keystroke(int nCommitKey, CFX_WideString &strChange,
+ const CFX_WideString& strChangeEx, FX_BOOL KeyDown,
+ FX_BOOL bModifier, int& nSelEnd, int& nSelStart,
+ FX_BOOL bShift, CPDF_FormField* pTarget,
+ CFX_WideString& Value, FX_BOOL bWillCommit,
+ FX_BOOL bFieldFull, FX_BOOL& bRc)
+{
+ Initial(JET_FIELD_KEYSTROKE);
+
+ m_nCommitKey = nCommitKey;
+ m_pWideStrChange = &strChange;
+ m_WideStrChangeEx = strChangeEx;
+ m_bKeyDown = KeyDown;
+ m_bModifier = bModifier;
+ m_pISelEnd = &nSelEnd;
+ m_pISelStart = &nSelStart;
+ m_bShift = bShift;
+ ASSERT(pTarget != NULL);
+ m_strTargetName = pTarget->GetFullName();
+ m_pValue = &Value;
+ m_bWillCommit = bWillCommit;
+ m_pbRc = &bRc;
+ m_bFieldFull = bFieldFull;
+}
+
+void CJS_EventHandler::OnField_Validate(CFX_WideString& strChange, const CFX_WideString& strChangeEx,
+ FX_BOOL bKeyDown, FX_BOOL bModifier, FX_BOOL bShift,
+ CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL& bRc)
+{
+ Initial(JET_FIELD_VALIDATE);
+
+ m_pWideStrChange = &strChange;
+ m_WideStrChangeEx = strChangeEx;
+ m_bKeyDown = bKeyDown;
+ m_bModifier = bModifier;
+ m_bShift = bShift;
+ ASSERT(pTarget != NULL);
+ m_strTargetName = pTarget->GetFullName();
+ m_pValue = &Value;
+ m_pbRc = &bRc;
+}
+
+void CJS_EventHandler::OnField_Calculate(CPDF_FormField* pSource, CPDF_FormField* pTarget,
+ CFX_WideString& Value, FX_BOOL& bRc)
+{
+ Initial(JET_FIELD_CALCULATE);
+
+ if (pSource)
+ m_strSourceName = pSource->GetFullName();
+ ASSERT(pTarget != NULL);
+ m_strTargetName = pTarget->GetFullName();
+ m_pValue = &Value;
+ m_pbRc = &bRc;
+}
+
+void CJS_EventHandler::OnField_Format(int nCommitKey, CPDF_FormField* pTarget,
+ CFX_WideString& Value, FX_BOOL bWillCommit)
+{
+ Initial(JET_FIELD_FORMAT);
+
+ m_nCommitKey = nCommitKey;
+ ASSERT(pTarget != NULL);
+ m_strTargetName = pTarget->GetFullName();
+ m_pValue = &Value;
+ m_bWillCommit = bWillCommit;
+}
+
+void CJS_EventHandler::OnScreen_Focus(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
+{
+ Initial(JET_SCREEN_FOCUS);
+
+ m_bModifier = bModifier;
+ m_bShift = bShift;
+ m_pTargetAnnot = pScreen;
+}
+
+void CJS_EventHandler::OnScreen_Blur(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
+{
+ Initial(JET_SCREEN_BLUR);
+
+ m_bModifier = bModifier;
+ m_bShift = bShift;
+ m_pTargetAnnot = pScreen;
+}
+
+void CJS_EventHandler::OnScreen_Open(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
+{
+ Initial(JET_SCREEN_OPEN);
+
+ m_bModifier = bModifier;
+ m_bShift = bShift;
+ m_pTargetAnnot = pScreen;
+}
+
+void CJS_EventHandler::OnScreen_Close(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
+{
+ Initial(JET_SCREEN_CLOSE);
+
+ m_bModifier = bModifier;
+ m_bShift = bShift;
+ m_pTargetAnnot = pScreen;
+}
+
+void CJS_EventHandler::OnScreen_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
+{
+ Initial(JET_SCREEN_MOUSEDOWN);
+
+ m_bModifier = bModifier;
+ m_bShift = bShift;
+ m_pTargetAnnot = pScreen;
+}
+
+void CJS_EventHandler::OnScreen_MouseUp(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
+{
+ Initial(JET_SCREEN_MOUSEUP);
+
+ m_bModifier = bModifier;
+ m_bShift = bShift;
+ m_pTargetAnnot = pScreen;
+}
+
+void CJS_EventHandler::OnScreen_MouseEnter(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
+{
+ Initial(JET_SCREEN_MOUSEENTER);
+
+ m_bModifier = bModifier;
+ m_bShift = bShift;
+ m_pTargetAnnot = pScreen;
+}
+
+void CJS_EventHandler::OnScreen_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
+{
+ Initial(JET_SCREEN_MOUSEEXIT);
+
+ m_bModifier = bModifier;
+ m_bShift = bShift;
+ m_pTargetAnnot = pScreen;
+}
+
+void CJS_EventHandler::OnScreen_InView(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
+{
+ Initial(JET_SCREEN_INVIEW);
+
+ m_bModifier = bModifier;
+ m_bShift = bShift;
+ m_pTargetAnnot = pScreen;
+}
+
+void CJS_EventHandler::OnScreen_OutView(FX_BOOL bModifier, FX_BOOL bShift, CPDFSDK_Annot* pScreen)
+{
+ Initial(JET_SCREEN_OUTVIEW);
+
+ m_bModifier = bModifier;
+ m_bShift = bShift;
+ m_pTargetAnnot = pScreen;
+}
+
+void CJS_EventHandler::OnLink_MouseUp(CPDFSDK_Document* pTarget)
+{
+ Initial(JET_LINK_MOUSEUP);
+
+ m_pTargetDoc = pTarget;
+}
+
+void CJS_EventHandler::OnBookmark_MouseUp(CPDF_Bookmark* pBookMark)
+{
+ Initial(JET_BOOKMARK_MOUSEUP);
+
+ m_pTargetBookMark = pBookMark;
+}
+
+void CJS_EventHandler::OnMenu_Exec(CPDFSDK_Document* pTarget, const CFX_WideString& strTargetName)
+{
+ Initial(JET_MENU_EXEC);
+
+ m_pTargetDoc = pTarget;
+ m_strTargetName = strTargetName;
+}
+
+void CJS_EventHandler::OnExternal_Exec()
+{
+ Initial(JET_EXTERNAL_EXEC);
+}
+
+void CJS_EventHandler::OnBatchExec(CPDFSDK_Document* pTarget)
+{
+ Initial(JET_BATCH_EXEC);
+
+ m_pTargetDoc = pTarget;
+}
+
+void CJS_EventHandler::OnConsole_Exec()
+{
+ Initial(JET_CONSOLE_EXEC);
+}
+
+
+void CJS_EventHandler::Initial(JS_EVENT_T type)
+{
+ m_eEventType = type;
+
+ m_strTargetName = L"";
+ m_strSourceName = L"";
+ m_pWideStrChange = NULL;
+ m_WideStrChangeDu = L"";
+ m_WideStrChangeEx = L"";
+ m_nCommitKey = -1;
+ m_bKeyDown = FALSE;
+ m_bModifier = FALSE;
+ m_bShift = FALSE;
+ m_pISelEnd = NULL;
+ m_nSelEndDu = 0;
+ m_pISelStart = NULL;
+ m_nSelStartDu = 0;
+ m_bWillCommit = FALSE;
+ m_pValue = NULL;
+ m_bFieldFull = FALSE;
+ m_pbRc = NULL;
+ m_bRcDu = FALSE;
+
+ m_pSourceDoc = NULL;
+ m_pTargetBookMark = NULL;
+ m_pTargetDoc = NULL;
+ m_pTargetAnnot = NULL;
+
+ m_bValid = TRUE;
+}
+
+void CJS_EventHandler::Destroy()
+{
+ m_bValid = FALSE;
+}
+
+FX_BOOL CJS_EventHandler::IsValid()
+{
+ return m_bValid;
+}
+
+CFX_WideString & CJS_EventHandler::Change()
+{
+ if (m_pWideStrChange != NULL)
+ return *m_pWideStrChange;
+ else
+ {
+ return m_WideStrChangeDu;
+ }
+}
+
+CFX_WideString CJS_EventHandler::ChangeEx()
+{
+ return m_WideStrChangeEx;
+}
+
+int CJS_EventHandler::CommitKey()
+{
+ return m_nCommitKey;
+}
+
+FX_BOOL CJS_EventHandler::FieldFull()
+{
+ return m_bFieldFull;
+}
+
+FX_BOOL CJS_EventHandler::KeyDown()
+{
+ return m_bKeyDown;
+}
+
+FX_BOOL CJS_EventHandler::Modifier()
+{
+ return m_bModifier;
+}
+
+FX_LPCWSTR CJS_EventHandler::Name()
+{
+ switch (m_eEventType)
+ {
+ case JET_APP_INIT: return (FX_LPCWSTR)L"Init";
+ case JET_BATCH_EXEC: return (FX_LPCWSTR)L"Exec";
+ case JET_BOOKMARK_MOUSEUP: return (FX_LPCWSTR)L"Mouse Up";
+ case JET_CONSOLE_EXEC: return (FX_LPCWSTR)L"Exec";
+ case JET_DOC_DIDPRINT: return (FX_LPCWSTR)L"DidPrint";
+ case JET_DOC_DIDSAVE: return (FX_LPCWSTR)L"DidSave";
+ case JET_DOC_OPEN: return (FX_LPCWSTR)L"Open";
+ case JET_DOC_WILLCLOSE: return (FX_LPCWSTR)L"WillClose";
+ case JET_DOC_WILLPRINT: return (FX_LPCWSTR)L"WillPrint";
+ case JET_DOC_WILLSAVE: return (FX_LPCWSTR)L"WillSave";
+ case JET_EXTERNAL_EXEC: return (FX_LPCWSTR)L"Exec";
+ case JET_FIELD_FOCUS:
+ case JET_SCREEN_FOCUS: return (FX_LPCWSTR)L"Focus";
+ case JET_FIELD_BLUR:
+ case JET_SCREEN_BLUR: return (FX_LPCWSTR)L"Blur";
+ case JET_FIELD_MOUSEDOWN:
+ case JET_SCREEN_MOUSEDOWN: return (FX_LPCWSTR)L"Mouse Down";
+ case JET_FIELD_MOUSEUP:
+ case JET_SCREEN_MOUSEUP: return (FX_LPCWSTR)L"Mouse Up";
+ case JET_FIELD_MOUSEENTER:
+ case JET_SCREEN_MOUSEENTER: return (FX_LPCWSTR)L"Mouse Enter";
+ case JET_FIELD_MOUSEEXIT:
+ case JET_SCREEN_MOUSEEXIT: return (FX_LPCWSTR)L"Mouse Exit";
+ case JET_FIELD_CALCULATE: return (FX_LPCWSTR)L"Calculate";
+ case JET_FIELD_FORMAT: return (FX_LPCWSTR)L"Format";
+ case JET_FIELD_KEYSTROKE: return (FX_LPCWSTR)L"Keystroke";
+ case JET_FIELD_VALIDATE: return (FX_LPCWSTR)L"Validate";
+ case JET_LINK_MOUSEUP: return (FX_LPCWSTR)L"Mouse Up";
+ case JET_MENU_EXEC: return (FX_LPCWSTR)L"Exec";
+ case JET_PAGE_OPEN:
+ case JET_SCREEN_OPEN: return (FX_LPCWSTR)L"Open";
+ case JET_PAGE_CLOSE:
+ case JET_SCREEN_CLOSE: return (FX_LPCWSTR)L"Close";
+ case JET_SCREEN_INVIEW:
+ case JET_PAGE_INVIEW: return (FX_LPCWSTR)L"InView";
+ case JET_PAGE_OUTVIEW:
+ case JET_SCREEN_OUTVIEW: return (FX_LPCWSTR)L"OutView";
+ default:
+ return (FX_LPCWSTR)L"";
+ }
+
+ return (FX_LPCWSTR)L"";
+}
+
+FX_LPCWSTR CJS_EventHandler::Type()
+{
+ switch (m_eEventType)
+ {
+ case JET_APP_INIT: return (FX_LPCWSTR)L"App";
+ case JET_BATCH_EXEC: return (FX_LPCWSTR)L"Batch";
+ case JET_BOOKMARK_MOUSEUP: return (FX_LPCWSTR)L"BookMark";
+ case JET_CONSOLE_EXEC: return (FX_LPCWSTR)L"Console";
+ case JET_DOC_DIDPRINT:
+ case JET_DOC_DIDSAVE:
+ case JET_DOC_OPEN:
+ case JET_DOC_WILLCLOSE:
+ case JET_DOC_WILLPRINT:
+ case JET_DOC_WILLSAVE: return (FX_LPCWSTR)L"Doc";
+ case JET_EXTERNAL_EXEC: return (FX_LPCWSTR)L"External";
+ case JET_FIELD_BLUR:
+ case JET_FIELD_FOCUS:
+ case JET_FIELD_MOUSEDOWN:
+ case JET_FIELD_MOUSEENTER:
+ case JET_FIELD_MOUSEEXIT:
+ case JET_FIELD_MOUSEUP:
+ case JET_FIELD_CALCULATE:
+ case JET_FIELD_FORMAT:
+ case JET_FIELD_KEYSTROKE:
+ case JET_FIELD_VALIDATE: return (FX_LPCWSTR)L"Field";
+ case JET_SCREEN_FOCUS:
+ case JET_SCREEN_BLUR:
+ case JET_SCREEN_OPEN:
+ case JET_SCREEN_CLOSE:
+ case JET_SCREEN_MOUSEDOWN:
+ case JET_SCREEN_MOUSEUP:
+ case JET_SCREEN_MOUSEENTER:
+ case JET_SCREEN_MOUSEEXIT:
+ case JET_SCREEN_INVIEW:
+ case JET_SCREEN_OUTVIEW: return (FX_LPCWSTR)L"Screen";
+ case JET_LINK_MOUSEUP: return (FX_LPCWSTR)L"Link";
+ case JET_MENU_EXEC: return (FX_LPCWSTR)L"Menu";
+ case JET_PAGE_OPEN:
+ case JET_PAGE_CLOSE:
+ case JET_PAGE_INVIEW:
+ case JET_PAGE_OUTVIEW:return (FX_LPCWSTR)L"Page";
+ default:
+ return (FX_LPCWSTR)L"";
+ }
+
+ return (FX_LPCWSTR)L"";
+}
+
+FX_BOOL& CJS_EventHandler::Rc()
+{
+ if (m_pbRc != NULL)
+ return *m_pbRc;
+ else
+ {
+ return m_bRcDu;
+ }
+}
+
+int & CJS_EventHandler::SelEnd()
+{
+ if (m_pISelEnd != NULL)
+ {
+ return *m_pISelEnd;
+ }
+ else
+ {
+ return m_nSelEndDu;
+ }
+}
+
+int & CJS_EventHandler::SelStart()
+{
+ if (m_pISelStart != NULL)
+ return * m_pISelStart;
+ else
+ {
+ return m_nSelStartDu;
+ }
+}
+
+FX_BOOL CJS_EventHandler::Shift()
+{
+ return m_bShift;
+}
+
+Field* CJS_EventHandler::Source()
+{
+ ASSERT(m_pJSContext != NULL);
+
+ CJS_Runtime* pRuntime = m_pJSContext->GetJSRuntime();
+
+ JSFXObject pDocObj = JS_NewFxDynamicObj(*pRuntime, m_pJSContext, JS_GetObjDefnID(*pRuntime, L"Document"));
+ ASSERT(pDocObj.IsEmpty() == FALSE);
+ JSFXObject pFieldObj = JS_NewFxDynamicObj(*pRuntime, m_pJSContext, JS_GetObjDefnID(*pRuntime, L"Field"));
+ ASSERT(pFieldObj.IsEmpty() == FALSE);
+
+ CJS_Document* pJSDocument = (CJS_Document*)JS_GetPrivate(pDocObj);
+ ASSERT(pJSDocument != NULL);
+ Document* pDocument = (Document*)pJSDocument->GetEmbedObject();
+ ASSERT(pDocument != NULL);
+ if (m_pTargetDoc != NULL)
+ pDocument->AttachDoc(m_pTargetDoc);
+ else
+ pDocument->AttachDoc(m_pJSContext->GetReaderDocument());
+
+ //if (m_pSourceField == NULL)
+ // return NULL;
+ //CRAO_Widget *pWidget = IBCL_Widget::GetWidget(m_pSourceField);
+ //CPDF_FormField* pFormField = pWidget->GetFormField();
+ //ASSERT(pFormField);
+ //CFX_WideString csFieldName = pFormField->GetFullName();
+ CJS_Field * pJSField = (CJS_Field*)JS_GetPrivate(pFieldObj);
+ ASSERT(pJSField != NULL);
+ Field * pField = (Field *)pJSField->GetEmbedObject();
+ ASSERT(pField != NULL);
+ pField->AttachField(pDocument, m_strSourceName);
+ return pField;
+}
+
+Field* CJS_EventHandler::Target_Field()
+{
+ ASSERT(m_pJSContext != NULL);
+
+ CJS_Runtime* pRuntime = m_pJSContext->GetJSRuntime();
+
+ JSFXObject pDocObj = JS_NewFxDynamicObj(*pRuntime, m_pJSContext, JS_GetObjDefnID(*pRuntime, L"Document"));
+ ASSERT(pDocObj.IsEmpty() == FALSE);
+ JSFXObject pFieldObj = JS_NewFxDynamicObj(*pRuntime, m_pJSContext, JS_GetObjDefnID(*pRuntime, L"Field"));
+ ASSERT(pFieldObj.IsEmpty() == FALSE);
+
+ CJS_Document* pJSDocument = (CJS_Document*)JS_GetPrivate(pDocObj);
+ ASSERT(pJSDocument != NULL);
+ Document* pDocument = (Document*)pJSDocument->GetEmbedObject();
+ ASSERT(pDocument != NULL);
+ if (m_pTargetDoc != NULL)
+ pDocument->AttachDoc(m_pTargetDoc);
+ else
+ pDocument->AttachDoc(m_pJSContext->GetReaderDocument());
+
+ CJS_Field* pJSField = (CJS_Field*)JS_GetPrivate(pFieldObj);
+ ASSERT(pJSField != NULL);
+
+ Field* pField = (Field *)pJSField->GetEmbedObject();
+ ASSERT(pField != NULL);
+
+ pField->AttachField(pDocument, m_strTargetName);
+ return pField;
+}
+
+CFX_WideString& CJS_EventHandler::Value()
+{
+ return *m_pValue;
+}
+
+FX_BOOL CJS_EventHandler::WillCommit()
+{
+ return m_bWillCommit;
+}
+
+CFX_WideString CJS_EventHandler::TargetName()
+{
+ return m_strTargetName;
+}
+
+
diff --git a/fpdfsdk/src/javascript/JS_GlobalData.cpp b/fpdfsdk/src/javascript/JS_GlobalData.cpp
index 97bba8d243..2207726890 100644
--- a/fpdfsdk/src/javascript/JS_GlobalData.cpp
+++ b/fpdfsdk/src/javascript/JS_GlobalData.cpp
@@ -1,581 +1,581 @@
-// 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
-
-#include "../../include/javascript/JavaScript.h"
-#include "../../include/javascript/IJavaScript.h"
-#include "../../include/javascript/JS_GlobalData.h"
-
-#define JS_MAXGLOBALDATA (1024 * 4 - 8)
-
-/* --------------------- CJS_GlobalVariableArray --------------------- */
-
-CJS_GlobalVariableArray::CJS_GlobalVariableArray()
-{
-}
-
-CJS_GlobalVariableArray::~CJS_GlobalVariableArray()
-{
- Empty();
-}
-
-void CJS_GlobalVariableArray::Copy(const CJS_GlobalVariableArray& array)
-{
- Empty();
- for (int i=0,sz=array.Count(); i<sz; i++)
- {
- CJS_KeyValue* pOldObjData = array.GetAt(i);
- ASSERT(pOldObjData != NULL);
-
- switch (pOldObjData->nType)
- {
- case JS_GLOBALDATA_TYPE_NUMBER:
- {
- CJS_KeyValue* pNewObjData = new CJS_KeyValue;
- pNewObjData->sKey = pOldObjData->sKey;
- pNewObjData->nType = pOldObjData->nType;
- pNewObjData->dData = pOldObjData->dData;
- Add(pNewObjData);
- }
- break;
- case JS_GLOBALDATA_TYPE_BOOLEAN:
- {
- CJS_KeyValue* pNewObjData = new CJS_KeyValue;
- pNewObjData->sKey = pOldObjData->sKey;
- pNewObjData->nType = pOldObjData->nType;
- pNewObjData->bData = pOldObjData->bData;
- Add(pNewObjData);
- }
- break;
- case JS_GLOBALDATA_TYPE_STRING:
- {
- CJS_KeyValue* pNewObjData = new CJS_KeyValue;
- pNewObjData->sKey = pOldObjData->sKey;
- pNewObjData->nType = pOldObjData->nType;
- pNewObjData->sData = pOldObjData->sData;
- Add(pNewObjData);
- }
- break;
- case JS_GLOBALDATA_TYPE_OBJECT:
- {
- CJS_KeyValue* pNewObjData = new CJS_KeyValue;
- pNewObjData->sKey = pOldObjData->sKey;
- pNewObjData->nType = pOldObjData->nType;
- pNewObjData->objData.Copy(pOldObjData->objData);
- Add(pNewObjData);
- }
- case JS_GLOBALDATA_TYPE_NULL:
- {
- CJS_KeyValue* pNewObjData = new CJS_KeyValue;
- pNewObjData->sKey = pOldObjData->sKey;
- pNewObjData->nType = pOldObjData->nType;
- Add(pNewObjData);
- }
- }
- }
-}
-
-void CJS_GlobalVariableArray::Add(CJS_KeyValue* p)
-{
- array.Add(p);
-}
-
-int CJS_GlobalVariableArray::Count() const
-{
- return array.GetSize();
-}
-
-CJS_KeyValue* CJS_GlobalVariableArray::GetAt(int index) const
-{
- return array.GetAt(index);
-}
-
-void CJS_GlobalVariableArray::Empty()
-{
- for (int i=0,sz=array.GetSize(); i<sz; i++)
- delete array.GetAt(i);
- array.RemoveAll();
-}
-
-/* -------------------------- CJS_GlobalData -------------------------- */
-
-#define READER_JS_GLOBALDATA_FILENAME L"Reader_JsGlobal.Data"
-#define PHANTOM_JS_GLOBALDATA_FILENAME L"Phantom_JsGlobal.Data"
-#define SDK_JS_GLOBALDATA_FILENAME L"SDK_JsGlobal.Data"
-
-static const FX_BYTE JS_RC4KEY[] = {0x19,0xa8,0xe8,0x01,0xf6,0xa8,0xb6,0x4d,0x82,0x04,
- 0x45,0x6d,0xb4,0xcf,0xd7,0x77,0x67,0xf9,0x75,0x9f,
- 0xf0,0xe0,0x1e,0x51,0xee,0x46,0xfd,0x0b,0xc9,0x93,
- 0x25,0x55,0x4a,0xee,0xe0,0x16,0xd0,0xdf,0x8c,0xfa,
- 0x2a,0xa9,0x49,0xfd,0x97,0x1c,0x0e,0x22,0x13,0x28,
- 0x7c,0xaf,0xc4,0xfc,0x9c,0x12,0x65,0x8c,0x4e,0x5b,
- 0x04,0x75,0x89,0xc9,0xb1,0xed,0x50,0xca,0x96,0x6f,
- 0x1a,0x7a,0xfe,0x58,0x5d,0xec,0x19,0x4a,0xf6,0x35,
- 0x6a,0x97,0x14,0x00,0x0e,0xd0,0x6b,0xbb,0xd5,0x75,
- 0x55,0x8b,0x6e,0x6b,0x19,0xa0,0xf8,0x77,0xd5,0xa3
- };
-
-CJS_GlobalData::CJS_GlobalData(CPDFDoc_Environment* pApp) : m_pApp(pApp)
-{
-// IBaseAnnot* pBaseAnnot = IBaseAnnot::GetBaseAnnot(m_pApp);
-// ASSERT(pBaseAnnot != NULL);
-//
-// m_sFilePath = pBaseAnnot->GetUserPath();
- m_sFilePath += SDK_JS_GLOBALDATA_FILENAME;
-
- LoadGlobalPersistentVariables();
-}
-
-CJS_GlobalData::~CJS_GlobalData()
-{
- SaveGlobalPersisitentVariables();
-
- for (int i=0,sz=m_arrayGlobalData.GetSize(); i<sz; i++)
- delete m_arrayGlobalData.GetAt(i);
-
- m_arrayGlobalData.RemoveAll();
-}
-
-int CJS_GlobalData::FindGlobalVariable(FX_LPCSTR propname)
-{
- ASSERT(propname != NULL);
-
- int nRet = -1;
-
- for (int i=0,sz=m_arrayGlobalData.GetSize(); i<sz; i++)
- {
- CJS_GlobalData_Element* pTemp = m_arrayGlobalData.GetAt(i);
- if (pTemp->data.sKey[0] == *propname && pTemp->data.sKey == propname)
- {
- nRet = i;
- break;
- }
- }
-
- return nRet;
-}
-
-CJS_GlobalData_Element* CJS_GlobalData::GetGlobalVariable(FX_LPCSTR propname)
-{
- ASSERT(propname != NULL);
-
- int nFind = FindGlobalVariable(propname);
-
- if (nFind >= 0)
- return m_arrayGlobalData.GetAt(nFind);
- else
- return NULL;
-}
-
-void CJS_GlobalData::SetGlobalVariableNumber(FX_LPCSTR propname, double dData)
-{
- ASSERT(propname != NULL);
- CFX_ByteString sPropName = propname;
-
- sPropName.TrimLeft();
- sPropName.TrimRight();
-
- if (sPropName.GetLength() == 0) return;
-
- if (CJS_GlobalData_Element* pData = GetGlobalVariable(sPropName))
- {
- pData->data.nType = JS_GLOBALDATA_TYPE_NUMBER;
- pData->data.dData = dData;
- }
- else
- {
- CJS_GlobalData_Element* pNewData = new CJS_GlobalData_Element;
- pNewData->data.sKey = sPropName;
- pNewData->data.nType = JS_GLOBALDATA_TYPE_NUMBER;
- pNewData->data.dData = dData;
-
- m_arrayGlobalData.Add(pNewData);
- }
-}
-
-void CJS_GlobalData::SetGlobalVariableBoolean(FX_LPCSTR propname, bool bData)
-{
- ASSERT(propname != NULL);
- CFX_ByteString sPropName = propname;
-
- sPropName.TrimLeft();
- sPropName.TrimRight();
-
- if (sPropName.GetLength() == 0) return;
-
- if (CJS_GlobalData_Element* pData = GetGlobalVariable(sPropName))
- {
- pData->data.nType = JS_GLOBALDATA_TYPE_BOOLEAN;
- pData->data.bData = bData;
- }
- else
- {
- CJS_GlobalData_Element* pNewData = new CJS_GlobalData_Element;
- pNewData->data.sKey = sPropName;
- pNewData->data.nType = JS_GLOBALDATA_TYPE_BOOLEAN;
- pNewData->data.bData = bData;
-
- m_arrayGlobalData.Add(pNewData);
- }
-}
-
-void CJS_GlobalData::SetGlobalVariableString(FX_LPCSTR propname, const CFX_ByteString& sData)
-{
- ASSERT(propname != NULL);
- CFX_ByteString sPropName = propname;
-
- sPropName.TrimLeft();
- sPropName.TrimRight();
-
- if (sPropName.GetLength() == 0) return;
-
- if (CJS_GlobalData_Element* pData = GetGlobalVariable(sPropName))
- {
- pData->data.nType = JS_GLOBALDATA_TYPE_STRING;
- pData->data.sData = sData;
- }
- else
- {
- CJS_GlobalData_Element* pNewData = new CJS_GlobalData_Element;
- pNewData->data.sKey = sPropName;
- pNewData->data.nType = JS_GLOBALDATA_TYPE_STRING;
- pNewData->data.sData = sData;
-
- m_arrayGlobalData.Add(pNewData);
- }
-}
-
-void CJS_GlobalData::SetGlobalVariableObject(FX_LPCSTR propname, const CJS_GlobalVariableArray& array)
-{
- ASSERT(propname != NULL);
- CFX_ByteString sPropName = propname;
-
- sPropName.TrimLeft();
- sPropName.TrimRight();
-
- if (sPropName.GetLength() == 0) return;
-
- if (CJS_GlobalData_Element* pData = GetGlobalVariable(sPropName))
- {
- pData->data.nType = JS_GLOBALDATA_TYPE_OBJECT;
- pData->data.objData.Copy(array);
- }
- else
- {
- CJS_GlobalData_Element* pNewData = new CJS_GlobalData_Element;
- pNewData->data.sKey = sPropName;
- pNewData->data.nType = JS_GLOBALDATA_TYPE_OBJECT;
- pNewData->data.objData.Copy(array);
-
- m_arrayGlobalData.Add(pNewData);
- }
-}
-
-void CJS_GlobalData::SetGlobalVariableNull(FX_LPCSTR propname)
-{
- ASSERT(propname != NULL);
- CFX_ByteString sPropName = propname;
-
- sPropName.TrimLeft();
- sPropName.TrimRight();
-
- if (sPropName.GetLength() == 0) return;
-
- if (CJS_GlobalData_Element* pData = GetGlobalVariable(sPropName))
- {
- pData->data.nType = JS_GLOBALDATA_TYPE_NULL;
- }
- else
- {
- CJS_GlobalData_Element* pNewData = new CJS_GlobalData_Element;
- pNewData->data.sKey = sPropName;
- pNewData->data.nType = JS_GLOBALDATA_TYPE_NULL;
-
- m_arrayGlobalData.Add(pNewData);
- }
-}
-
-FX_BOOL CJS_GlobalData::SetGlobalVariablePersistent(FX_LPCSTR propname, FX_BOOL bPersistent)
-{
- ASSERT(propname != NULL);
- CFX_ByteString sPropName = propname;
-
- sPropName.TrimLeft();
- sPropName.TrimRight();
-
- if (sPropName.GetLength() == 0) return FALSE;
-
- if (CJS_GlobalData_Element* pData = GetGlobalVariable(sPropName))
- {
- pData->bPersistent = bPersistent;
- return TRUE;
- }
-
- return FALSE;
-}
-
-FX_BOOL CJS_GlobalData::DeleteGlobalVariable(FX_LPCSTR propname)
-{
- ASSERT(propname != NULL);
- CFX_ByteString sPropName = propname;
-
- sPropName.TrimLeft();
- sPropName.TrimRight();
-
- if (sPropName.GetLength() == 0) return FALSE;
-
- int nFind = FindGlobalVariable(sPropName);
-
- if (nFind >= 0)
- {
- delete m_arrayGlobalData.GetAt(nFind);
- m_arrayGlobalData.RemoveAt(nFind);
- return TRUE;
- }
-
- return FALSE;
-}
-
-FX_INT32 CJS_GlobalData::GetSize() const
-{
- return m_arrayGlobalData.GetSize();
-}
-
-CJS_GlobalData_Element* CJS_GlobalData::GetAt(int index) const
-{
- return m_arrayGlobalData.GetAt(index);
-}
-
-void CJS_GlobalData::LoadGlobalPersistentVariables()
-{
- FX_LPBYTE pBuffer = NULL;
- FX_INT32 nLength = 0;
-
- LoadFileBuffer(m_sFilePath, pBuffer, nLength);
-
- CRYPT_ArcFourCryptBlock(pBuffer, nLength, JS_RC4KEY, sizeof(JS_RC4KEY));
-
- if (pBuffer)
- {
- FX_LPBYTE p = pBuffer;
- FX_WORD wType = *((FX_WORD*)p);
- p += sizeof(FX_WORD);
-
- //FX_WORD wTemp = (FX_WORD)(('X' << 8) | 'F');
-
- if (wType == (FX_WORD)(('X' << 8) | 'F'))
- {
- FX_WORD wVersion = *((FX_WORD*)p);
- p += sizeof(FX_WORD);
-
- ASSERT(wVersion <= 2);
-
- FX_DWORD dwCount = *((FX_DWORD*)p);
- p += sizeof(FX_DWORD);
-
- FX_DWORD dwSize = *((FX_DWORD*)p);
- p += sizeof(FX_DWORD);
-
- if (dwSize == nLength - sizeof(FX_WORD) * 2 - sizeof(FX_DWORD)* 2)
- {
- for (FX_INT32 i=0,sz=dwCount; i<sz; i++)
- {
- if (p > pBuffer + nLength)
- break;
-
- FX_DWORD dwNameLen = *((FX_DWORD*)p);
- p += sizeof(FX_DWORD);
-
- if (p + dwNameLen > pBuffer + nLength)
- break;
-
- CFX_ByteString sEntry = CFX_ByteString(p, dwNameLen);
- p += sizeof(char) * dwNameLen;
-
- FX_WORD wDataType = *((FX_WORD*)p);
- p += sizeof(FX_WORD);
-
- switch (wDataType)
- {
- case JS_GLOBALDATA_TYPE_NUMBER:
- {
- double dData = 0;
- switch (wVersion)
- {
- case 1:
- {
- FX_DWORD dwData = *((FX_DWORD*)p);
- p += sizeof(FX_DWORD);
- dData = dwData;
- }
- break;
- case 2:
- {
- dData = *((double*)p);
- p += sizeof(double);
- }
- break;
- }
- SetGlobalVariableNumber(sEntry, dData);
- SetGlobalVariablePersistent(sEntry, TRUE);
- }
- break;
- case JS_GLOBALDATA_TYPE_BOOLEAN:
- {
- FX_WORD wData = *((FX_WORD*)p);
- p += sizeof(FX_WORD);
- SetGlobalVariableBoolean(sEntry, (bool)(wData == 1));
- SetGlobalVariablePersistent(sEntry, TRUE);
- }
- break;
- case JS_GLOBALDATA_TYPE_STRING:
- {
- FX_DWORD dwLength = *((FX_DWORD*)p);
- p += sizeof(FX_DWORD);
-
- if (p + dwLength > pBuffer + nLength)
- break;
-
- SetGlobalVariableString(sEntry, CFX_ByteString(p, dwLength));
- SetGlobalVariablePersistent(sEntry, TRUE);
- p += sizeof(char) * dwLength;
- }
- break;
- case JS_GLOBALDATA_TYPE_NULL:
- {
- SetGlobalVariableNull(sEntry);
- SetGlobalVariablePersistent(sEntry, TRUE);
- }
- }
- }
- }
- }
- FX_Free(pBuffer);
- }
-}
-
-/*
-struct js_global_datafile_header
-{
- FX_WORD type; //FX ('X' << 8) | 'F'
- FX_WORD version; //1.0
- FX_DWORD datacount;
-};
-struct js_global_datafile_data
-{
- FX_WORD type;
- FX_DWORD nData;
- FX_WORD bData;
- FX_DWORD nStrLen;
- char* pStr;
-};
-*/
-
-void CJS_GlobalData::SaveGlobalPersisitentVariables()
-{
- FX_DWORD nCount = 0;
- CFX_BinaryBuf sData;
-
- for (int i=0,sz=m_arrayGlobalData.GetSize(); i<sz; i++)
- {
- CJS_GlobalData_Element* pElement = m_arrayGlobalData.GetAt(i);
- ASSERT(pElement != NULL);
-
- if (pElement->bPersistent)
- {
- CFX_BinaryBuf sElement;
- MakeByteString(pElement->data.sKey, &pElement->data, sElement);
-
- if (sData.GetSize() + sElement.GetSize() > JS_MAXGLOBALDATA)
- break;
-
- sData.AppendBlock(sElement.GetBuffer(), sElement.GetSize());
- nCount++;
- }
- }
-
- CFX_BinaryBuf sFile;
-
- FX_WORD wType = (FX_WORD)(('X' << 8) | 'F');
- sFile.AppendBlock(&wType, sizeof(FX_WORD));
- FX_WORD wVersion = 2;
- sFile.AppendBlock(&wVersion, sizeof(FX_WORD));
- sFile.AppendBlock(&nCount, sizeof(FX_DWORD));
- FX_DWORD dwSize = sData.GetSize();
- sFile.AppendBlock(&dwSize, sizeof(FX_DWORD));
-
- sFile.AppendBlock(sData.GetBuffer(), sData.GetSize());
-
- CRYPT_ArcFourCryptBlock(sFile.GetBuffer(), sFile.GetSize(), JS_RC4KEY, sizeof(JS_RC4KEY));
- WriteFileBuffer(m_sFilePath, (FX_LPCSTR)sFile.GetBuffer(), sFile.GetSize());
-}
-
-void CJS_GlobalData::LoadFileBuffer(FX_LPCWSTR sFilePath, FX_LPBYTE& pBuffer, FX_INT32& nLength)
-{
-//UnSupport.
-}
-
-void CJS_GlobalData::WriteFileBuffer(FX_LPCWSTR sFilePath, FX_LPCSTR pBuffer, FX_INT32 nLength)
-{
-//UnSupport.
-}
-
-void CJS_GlobalData::MakeByteString(const CFX_ByteString& name, CJS_KeyValue* pData, CFX_BinaryBuf& sData)
-{
- ASSERT(pData != NULL);
-
- FX_WORD wType = (FX_WORD)pData->nType;
-
- switch (wType)
- {
- case JS_GLOBALDATA_TYPE_NUMBER:
- {
- FX_DWORD dwNameLen = (FX_DWORD)name.GetLength();
- sData.AppendBlock(&dwNameLen, sizeof(FX_DWORD));
- sData.AppendString(name);
-
- sData.AppendBlock(&wType, sizeof(FX_WORD));
- double dData = pData->dData;
- sData.AppendBlock(&dData, sizeof(double));
- }
- break;
- case JS_GLOBALDATA_TYPE_BOOLEAN:
- {
- FX_DWORD dwNameLen = (FX_DWORD)name.GetLength();
- sData.AppendBlock(&dwNameLen, sizeof(FX_DWORD));
- sData.AppendString(name);
-
- sData.AppendBlock(&wType, sizeof(FX_WORD));
- FX_WORD wData = (FX_WORD)pData->bData;
- sData.AppendBlock(&wData, sizeof(FX_WORD));
- }
- break;
- case JS_GLOBALDATA_TYPE_STRING:
- {
- FX_DWORD dwNameLen = (FX_DWORD)name.GetLength();
- sData.AppendBlock(&dwNameLen, sizeof(FX_DWORD));
- sData.AppendString(name);
-
- sData.AppendBlock(&wType, sizeof(FX_WORD));
-
- FX_DWORD dwDataLen = (FX_DWORD)pData->sData.GetLength();
- sData.AppendBlock(&dwDataLen, sizeof(FX_DWORD));
- sData.AppendString(pData->sData);
- }
- break;
- case JS_GLOBALDATA_TYPE_NULL:
- {
- FX_DWORD dwNameLen = (FX_DWORD)name.GetLength();
- sData.AppendBlock(&dwNameLen, sizeof(FX_DWORD));
- sData.AppendString(name);
-
- sData.AppendBlock(&wType, sizeof(FX_DWORD));
- }
- break;
- default:
- break;
- }
-}
-
+// 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
+
+#include "../../include/javascript/JavaScript.h"
+#include "../../include/javascript/IJavaScript.h"
+#include "../../include/javascript/JS_GlobalData.h"
+
+#define JS_MAXGLOBALDATA (1024 * 4 - 8)
+
+/* --------------------- CJS_GlobalVariableArray --------------------- */
+
+CJS_GlobalVariableArray::CJS_GlobalVariableArray()
+{
+}
+
+CJS_GlobalVariableArray::~CJS_GlobalVariableArray()
+{
+ Empty();
+}
+
+void CJS_GlobalVariableArray::Copy(const CJS_GlobalVariableArray& array)
+{
+ Empty();
+ for (int i=0,sz=array.Count(); i<sz; i++)
+ {
+ CJS_KeyValue* pOldObjData = array.GetAt(i);
+ ASSERT(pOldObjData != NULL);
+
+ switch (pOldObjData->nType)
+ {
+ case JS_GLOBALDATA_TYPE_NUMBER:
+ {
+ CJS_KeyValue* pNewObjData = new CJS_KeyValue;
+ pNewObjData->sKey = pOldObjData->sKey;
+ pNewObjData->nType = pOldObjData->nType;
+ pNewObjData->dData = pOldObjData->dData;
+ Add(pNewObjData);
+ }
+ break;
+ case JS_GLOBALDATA_TYPE_BOOLEAN:
+ {
+ CJS_KeyValue* pNewObjData = new CJS_KeyValue;
+ pNewObjData->sKey = pOldObjData->sKey;
+ pNewObjData->nType = pOldObjData->nType;
+ pNewObjData->bData = pOldObjData->bData;
+ Add(pNewObjData);
+ }
+ break;
+ case JS_GLOBALDATA_TYPE_STRING:
+ {
+ CJS_KeyValue* pNewObjData = new CJS_KeyValue;
+ pNewObjData->sKey = pOldObjData->sKey;
+ pNewObjData->nType = pOldObjData->nType;
+ pNewObjData->sData = pOldObjData->sData;
+ Add(pNewObjData);
+ }
+ break;
+ case JS_GLOBALDATA_TYPE_OBJECT:
+ {
+ CJS_KeyValue* pNewObjData = new CJS_KeyValue;
+ pNewObjData->sKey = pOldObjData->sKey;
+ pNewObjData->nType = pOldObjData->nType;
+ pNewObjData->objData.Copy(pOldObjData->objData);
+ Add(pNewObjData);
+ }
+ case JS_GLOBALDATA_TYPE_NULL:
+ {
+ CJS_KeyValue* pNewObjData = new CJS_KeyValue;
+ pNewObjData->sKey = pOldObjData->sKey;
+ pNewObjData->nType = pOldObjData->nType;
+ Add(pNewObjData);
+ }
+ }
+ }
+}
+
+void CJS_GlobalVariableArray::Add(CJS_KeyValue* p)
+{
+ array.Add(p);
+}
+
+int CJS_GlobalVariableArray::Count() const
+{
+ return array.GetSize();
+}
+
+CJS_KeyValue* CJS_GlobalVariableArray::GetAt(int index) const
+{
+ return array.GetAt(index);
+}
+
+void CJS_GlobalVariableArray::Empty()
+{
+ for (int i=0,sz=array.GetSize(); i<sz; i++)
+ delete array.GetAt(i);
+ array.RemoveAll();
+}
+
+/* -------------------------- CJS_GlobalData -------------------------- */
+
+#define READER_JS_GLOBALDATA_FILENAME L"Reader_JsGlobal.Data"
+#define PHANTOM_JS_GLOBALDATA_FILENAME L"Phantom_JsGlobal.Data"
+#define SDK_JS_GLOBALDATA_FILENAME L"SDK_JsGlobal.Data"
+
+static const FX_BYTE JS_RC4KEY[] = {0x19,0xa8,0xe8,0x01,0xf6,0xa8,0xb6,0x4d,0x82,0x04,
+ 0x45,0x6d,0xb4,0xcf,0xd7,0x77,0x67,0xf9,0x75,0x9f,
+ 0xf0,0xe0,0x1e,0x51,0xee,0x46,0xfd,0x0b,0xc9,0x93,
+ 0x25,0x55,0x4a,0xee,0xe0,0x16,0xd0,0xdf,0x8c,0xfa,
+ 0x2a,0xa9,0x49,0xfd,0x97,0x1c,0x0e,0x22,0x13,0x28,
+ 0x7c,0xaf,0xc4,0xfc,0x9c,0x12,0x65,0x8c,0x4e,0x5b,
+ 0x04,0x75,0x89,0xc9,0xb1,0xed,0x50,0xca,0x96,0x6f,
+ 0x1a,0x7a,0xfe,0x58,0x5d,0xec,0x19,0x4a,0xf6,0x35,
+ 0x6a,0x97,0x14,0x00,0x0e,0xd0,0x6b,0xbb,0xd5,0x75,
+ 0x55,0x8b,0x6e,0x6b,0x19,0xa0,0xf8,0x77,0xd5,0xa3
+ };
+
+CJS_GlobalData::CJS_GlobalData(CPDFDoc_Environment* pApp) : m_pApp(pApp)
+{
+// IBaseAnnot* pBaseAnnot = IBaseAnnot::GetBaseAnnot(m_pApp);
+// ASSERT(pBaseAnnot != NULL);
+//
+// m_sFilePath = pBaseAnnot->GetUserPath();
+ m_sFilePath += SDK_JS_GLOBALDATA_FILENAME;
+
+ LoadGlobalPersistentVariables();
+}
+
+CJS_GlobalData::~CJS_GlobalData()
+{
+ SaveGlobalPersisitentVariables();
+
+ for (int i=0,sz=m_arrayGlobalData.GetSize(); i<sz; i++)
+ delete m_arrayGlobalData.GetAt(i);
+
+ m_arrayGlobalData.RemoveAll();
+}
+
+int CJS_GlobalData::FindGlobalVariable(FX_LPCSTR propname)
+{
+ ASSERT(propname != NULL);
+
+ int nRet = -1;
+
+ for (int i=0,sz=m_arrayGlobalData.GetSize(); i<sz; i++)
+ {
+ CJS_GlobalData_Element* pTemp = m_arrayGlobalData.GetAt(i);
+ if (pTemp->data.sKey[0] == *propname && pTemp->data.sKey == propname)
+ {
+ nRet = i;
+ break;
+ }
+ }
+
+ return nRet;
+}
+
+CJS_GlobalData_Element* CJS_GlobalData::GetGlobalVariable(FX_LPCSTR propname)
+{
+ ASSERT(propname != NULL);
+
+ int nFind = FindGlobalVariable(propname);
+
+ if (nFind >= 0)
+ return m_arrayGlobalData.GetAt(nFind);
+ else
+ return NULL;
+}
+
+void CJS_GlobalData::SetGlobalVariableNumber(FX_LPCSTR propname, double dData)
+{
+ ASSERT(propname != NULL);
+ CFX_ByteString sPropName = propname;
+
+ sPropName.TrimLeft();
+ sPropName.TrimRight();
+
+ if (sPropName.GetLength() == 0) return;
+
+ if (CJS_GlobalData_Element* pData = GetGlobalVariable(sPropName))
+ {
+ pData->data.nType = JS_GLOBALDATA_TYPE_NUMBER;
+ pData->data.dData = dData;
+ }
+ else
+ {
+ CJS_GlobalData_Element* pNewData = new CJS_GlobalData_Element;
+ pNewData->data.sKey = sPropName;
+ pNewData->data.nType = JS_GLOBALDATA_TYPE_NUMBER;
+ pNewData->data.dData = dData;
+
+ m_arrayGlobalData.Add(pNewData);
+ }
+}
+
+void CJS_GlobalData::SetGlobalVariableBoolean(FX_LPCSTR propname, bool bData)
+{
+ ASSERT(propname != NULL);
+ CFX_ByteString sPropName = propname;
+
+ sPropName.TrimLeft();
+ sPropName.TrimRight();
+
+ if (sPropName.GetLength() == 0) return;
+
+ if (CJS_GlobalData_Element* pData = GetGlobalVariable(sPropName))
+ {
+ pData->data.nType = JS_GLOBALDATA_TYPE_BOOLEAN;
+ pData->data.bData = bData;
+ }
+ else
+ {
+ CJS_GlobalData_Element* pNewData = new CJS_GlobalData_Element;
+ pNewData->data.sKey = sPropName;
+ pNewData->data.nType = JS_GLOBALDATA_TYPE_BOOLEAN;
+ pNewData->data.bData = bData;
+
+ m_arrayGlobalData.Add(pNewData);
+ }
+}
+
+void CJS_GlobalData::SetGlobalVariableString(FX_LPCSTR propname, const CFX_ByteString& sData)
+{
+ ASSERT(propname != NULL);
+ CFX_ByteString sPropName = propname;
+
+ sPropName.TrimLeft();
+ sPropName.TrimRight();
+
+ if (sPropName.GetLength() == 0) return;
+
+ if (CJS_GlobalData_Element* pData = GetGlobalVariable(sPropName))
+ {
+ pData->data.nType = JS_GLOBALDATA_TYPE_STRING;
+ pData->data.sData = sData;
+ }
+ else
+ {
+ CJS_GlobalData_Element* pNewData = new CJS_GlobalData_Element;
+ pNewData->data.sKey = sPropName;
+ pNewData->data.nType = JS_GLOBALDATA_TYPE_STRING;
+ pNewData->data.sData = sData;
+
+ m_arrayGlobalData.Add(pNewData);
+ }
+}
+
+void CJS_GlobalData::SetGlobalVariableObject(FX_LPCSTR propname, const CJS_GlobalVariableArray& array)
+{
+ ASSERT(propname != NULL);
+ CFX_ByteString sPropName = propname;
+
+ sPropName.TrimLeft();
+ sPropName.TrimRight();
+
+ if (sPropName.GetLength() == 0) return;
+
+ if (CJS_GlobalData_Element* pData = GetGlobalVariable(sPropName))
+ {
+ pData->data.nType = JS_GLOBALDATA_TYPE_OBJECT;
+ pData->data.objData.Copy(array);
+ }
+ else
+ {
+ CJS_GlobalData_Element* pNewData = new CJS_GlobalData_Element;
+ pNewData->data.sKey = sPropName;
+ pNewData->data.nType = JS_GLOBALDATA_TYPE_OBJECT;
+ pNewData->data.objData.Copy(array);
+
+ m_arrayGlobalData.Add(pNewData);
+ }
+}
+
+void CJS_GlobalData::SetGlobalVariableNull(FX_LPCSTR propname)
+{
+ ASSERT(propname != NULL);
+ CFX_ByteString sPropName = propname;
+
+ sPropName.TrimLeft();
+ sPropName.TrimRight();
+
+ if (sPropName.GetLength() == 0) return;
+
+ if (CJS_GlobalData_Element* pData = GetGlobalVariable(sPropName))
+ {
+ pData->data.nType = JS_GLOBALDATA_TYPE_NULL;
+ }
+ else
+ {
+ CJS_GlobalData_Element* pNewData = new CJS_GlobalData_Element;
+ pNewData->data.sKey = sPropName;
+ pNewData->data.nType = JS_GLOBALDATA_TYPE_NULL;
+
+ m_arrayGlobalData.Add(pNewData);
+ }
+}
+
+FX_BOOL CJS_GlobalData::SetGlobalVariablePersistent(FX_LPCSTR propname, FX_BOOL bPersistent)
+{
+ ASSERT(propname != NULL);
+ CFX_ByteString sPropName = propname;
+
+ sPropName.TrimLeft();
+ sPropName.TrimRight();
+
+ if (sPropName.GetLength() == 0) return FALSE;
+
+ if (CJS_GlobalData_Element* pData = GetGlobalVariable(sPropName))
+ {
+ pData->bPersistent = bPersistent;
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+FX_BOOL CJS_GlobalData::DeleteGlobalVariable(FX_LPCSTR propname)
+{
+ ASSERT(propname != NULL);
+ CFX_ByteString sPropName = propname;
+
+ sPropName.TrimLeft();
+ sPropName.TrimRight();
+
+ if (sPropName.GetLength() == 0) return FALSE;
+
+ int nFind = FindGlobalVariable(sPropName);
+
+ if (nFind >= 0)
+ {
+ delete m_arrayGlobalData.GetAt(nFind);
+ m_arrayGlobalData.RemoveAt(nFind);
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+FX_INT32 CJS_GlobalData::GetSize() const
+{
+ return m_arrayGlobalData.GetSize();
+}
+
+CJS_GlobalData_Element* CJS_GlobalData::GetAt(int index) const
+{
+ return m_arrayGlobalData.GetAt(index);
+}
+
+void CJS_GlobalData::LoadGlobalPersistentVariables()
+{
+ FX_LPBYTE pBuffer = NULL;
+ FX_INT32 nLength = 0;
+
+ LoadFileBuffer(m_sFilePath, pBuffer, nLength);
+
+ CRYPT_ArcFourCryptBlock(pBuffer, nLength, JS_RC4KEY, sizeof(JS_RC4KEY));
+
+ if (pBuffer)
+ {
+ FX_LPBYTE p = pBuffer;
+ FX_WORD wType = *((FX_WORD*)p);
+ p += sizeof(FX_WORD);
+
+ //FX_WORD wTemp = (FX_WORD)(('X' << 8) | 'F');
+
+ if (wType == (FX_WORD)(('X' << 8) | 'F'))
+ {
+ FX_WORD wVersion = *((FX_WORD*)p);
+ p += sizeof(FX_WORD);
+
+ ASSERT(wVersion <= 2);
+
+ FX_DWORD dwCount = *((FX_DWORD*)p);
+ p += sizeof(FX_DWORD);
+
+ FX_DWORD dwSize = *((FX_DWORD*)p);
+ p += sizeof(FX_DWORD);
+
+ if (dwSize == nLength - sizeof(FX_WORD) * 2 - sizeof(FX_DWORD)* 2)
+ {
+ for (FX_INT32 i=0,sz=dwCount; i<sz; i++)
+ {
+ if (p > pBuffer + nLength)
+ break;
+
+ FX_DWORD dwNameLen = *((FX_DWORD*)p);
+ p += sizeof(FX_DWORD);
+
+ if (p + dwNameLen > pBuffer + nLength)
+ break;
+
+ CFX_ByteString sEntry = CFX_ByteString(p, dwNameLen);
+ p += sizeof(char) * dwNameLen;
+
+ FX_WORD wDataType = *((FX_WORD*)p);
+ p += sizeof(FX_WORD);
+
+ switch (wDataType)
+ {
+ case JS_GLOBALDATA_TYPE_NUMBER:
+ {
+ double dData = 0;
+ switch (wVersion)
+ {
+ case 1:
+ {
+ FX_DWORD dwData = *((FX_DWORD*)p);
+ p += sizeof(FX_DWORD);
+ dData = dwData;
+ }
+ break;
+ case 2:
+ {
+ dData = *((double*)p);
+ p += sizeof(double);
+ }
+ break;
+ }
+ SetGlobalVariableNumber(sEntry, dData);
+ SetGlobalVariablePersistent(sEntry, TRUE);
+ }
+ break;
+ case JS_GLOBALDATA_TYPE_BOOLEAN:
+ {
+ FX_WORD wData = *((FX_WORD*)p);
+ p += sizeof(FX_WORD);
+ SetGlobalVariableBoolean(sEntry, (bool)(wData == 1));
+ SetGlobalVariablePersistent(sEntry, TRUE);
+ }
+ break;
+ case JS_GLOBALDATA_TYPE_STRING:
+ {
+ FX_DWORD dwLength = *((FX_DWORD*)p);
+ p += sizeof(FX_DWORD);
+
+ if (p + dwLength > pBuffer + nLength)
+ break;
+
+ SetGlobalVariableString(sEntry, CFX_ByteString(p, dwLength));
+ SetGlobalVariablePersistent(sEntry, TRUE);
+ p += sizeof(char) * dwLength;
+ }
+ break;
+ case JS_GLOBALDATA_TYPE_NULL:
+ {
+ SetGlobalVariableNull(sEntry);
+ SetGlobalVariablePersistent(sEntry, TRUE);
+ }
+ }
+ }
+ }
+ }
+ FX_Free(pBuffer);
+ }
+}
+
+/*
+struct js_global_datafile_header
+{
+ FX_WORD type; //FX ('X' << 8) | 'F'
+ FX_WORD version; //1.0
+ FX_DWORD datacount;
+};
+struct js_global_datafile_data
+{
+ FX_WORD type;
+ FX_DWORD nData;
+ FX_WORD bData;
+ FX_DWORD nStrLen;
+ char* pStr;
+};
+*/
+
+void CJS_GlobalData::SaveGlobalPersisitentVariables()
+{
+ FX_DWORD nCount = 0;
+ CFX_BinaryBuf sData;
+
+ for (int i=0,sz=m_arrayGlobalData.GetSize(); i<sz; i++)
+ {
+ CJS_GlobalData_Element* pElement = m_arrayGlobalData.GetAt(i);
+ ASSERT(pElement != NULL);
+
+ if (pElement->bPersistent)
+ {
+ CFX_BinaryBuf sElement;
+ MakeByteString(pElement->data.sKey, &pElement->data, sElement);
+
+ if (sData.GetSize() + sElement.GetSize() > JS_MAXGLOBALDATA)
+ break;
+
+ sData.AppendBlock(sElement.GetBuffer(), sElement.GetSize());
+ nCount++;
+ }
+ }
+
+ CFX_BinaryBuf sFile;
+
+ FX_WORD wType = (FX_WORD)(('X' << 8) | 'F');
+ sFile.AppendBlock(&wType, sizeof(FX_WORD));
+ FX_WORD wVersion = 2;
+ sFile.AppendBlock(&wVersion, sizeof(FX_WORD));
+ sFile.AppendBlock(&nCount, sizeof(FX_DWORD));
+ FX_DWORD dwSize = sData.GetSize();
+ sFile.AppendBlock(&dwSize, sizeof(FX_DWORD));
+
+ sFile.AppendBlock(sData.GetBuffer(), sData.GetSize());
+
+ CRYPT_ArcFourCryptBlock(sFile.GetBuffer(), sFile.GetSize(), JS_RC4KEY, sizeof(JS_RC4KEY));
+ WriteFileBuffer(m_sFilePath, (FX_LPCSTR)sFile.GetBuffer(), sFile.GetSize());
+}
+
+void CJS_GlobalData::LoadFileBuffer(FX_LPCWSTR sFilePath, FX_LPBYTE& pBuffer, FX_INT32& nLength)
+{
+//UnSupport.
+}
+
+void CJS_GlobalData::WriteFileBuffer(FX_LPCWSTR sFilePath, FX_LPCSTR pBuffer, FX_INT32 nLength)
+{
+//UnSupport.
+}
+
+void CJS_GlobalData::MakeByteString(const CFX_ByteString& name, CJS_KeyValue* pData, CFX_BinaryBuf& sData)
+{
+ ASSERT(pData != NULL);
+
+ FX_WORD wType = (FX_WORD)pData->nType;
+
+ switch (wType)
+ {
+ case JS_GLOBALDATA_TYPE_NUMBER:
+ {
+ FX_DWORD dwNameLen = (FX_DWORD)name.GetLength();
+ sData.AppendBlock(&dwNameLen, sizeof(FX_DWORD));
+ sData.AppendString(name);
+
+ sData.AppendBlock(&wType, sizeof(FX_WORD));
+ double dData = pData->dData;
+ sData.AppendBlock(&dData, sizeof(double));
+ }
+ break;
+ case JS_GLOBALDATA_TYPE_BOOLEAN:
+ {
+ FX_DWORD dwNameLen = (FX_DWORD)name.GetLength();
+ sData.AppendBlock(&dwNameLen, sizeof(FX_DWORD));
+ sData.AppendString(name);
+
+ sData.AppendBlock(&wType, sizeof(FX_WORD));
+ FX_WORD wData = (FX_WORD)pData->bData;
+ sData.AppendBlock(&wData, sizeof(FX_WORD));
+ }
+ break;
+ case JS_GLOBALDATA_TYPE_STRING:
+ {
+ FX_DWORD dwNameLen = (FX_DWORD)name.GetLength();
+ sData.AppendBlock(&dwNameLen, sizeof(FX_DWORD));
+ sData.AppendString(name);
+
+ sData.AppendBlock(&wType, sizeof(FX_WORD));
+
+ FX_DWORD dwDataLen = (FX_DWORD)pData->sData.GetLength();
+ sData.AppendBlock(&dwDataLen, sizeof(FX_DWORD));
+ sData.AppendString(pData->sData);
+ }
+ break;
+ case JS_GLOBALDATA_TYPE_NULL:
+ {
+ FX_DWORD dwNameLen = (FX_DWORD)name.GetLength();
+ sData.AppendBlock(&dwNameLen, sizeof(FX_DWORD));
+ sData.AppendString(name);
+
+ sData.AppendBlock(&wType, sizeof(FX_DWORD));
+ }
+ break;
+ default:
+ break;
+ }
+}
+
diff --git a/fpdfsdk/src/javascript/JS_Object.cpp b/fpdfsdk/src/javascript/JS_Object.cpp
index 3830b2ac53..3b7774d4d8 100644
--- a/fpdfsdk/src/javascript/JS_Object.cpp
+++ b/fpdfsdk/src/javascript/JS_Object.cpp
@@ -1,145 +1,145 @@
-// 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
-
-#include "../../include/javascript/JavaScript.h"
-#include "../../include/javascript/IJavaScript.h"
-#include "../../include/javascript/JS_Define.h"
-#include "../../include/javascript/JS_Object.h"
-// #include "../../include/javascript/JS_MsgBox.h"
-// #include "../../include/javascript/JS_ResMgr.h"
-#include "../../include/javascript/JS_Context.h"
-
-int FXJS_MsgBox(CPDFDoc_Environment* pApp, CPDFSDK_PageView* pPageView, FX_LPCWSTR swMsg, FX_LPCWSTR swTitle, FX_UINT nType, FX_UINT nIcon)
-{
- int nRet = 0;
-
- if(pApp)
- {
- CPDFSDK_Document* pDoc = pApp->GetCurrentDoc();
- if(pDoc)
- pDoc->KillFocusAnnot();
- nRet = pApp->JS_appAlert(swMsg, swTitle, nType, nIcon);
- }
-
- return nRet;
-}
-
-CPDFSDK_PageView* FXJS_GetPageView(IFXJS_Context* cc)
-{
- if (CJS_Context* pContext = (CJS_Context *)cc)
- {
- if (pContext->GetReaderDocument())
- return NULL;
- }
- return NULL;
-}
-
-/* --------------------------------- CJS_EmbedObj --------------------------------- */
-
-CJS_EmbedObj::CJS_EmbedObj(CJS_Object* pJSObject) :
- m_pJSObject(pJSObject)
-{
-}
-
-CJS_EmbedObj::~CJS_EmbedObj()
-{
- m_pJSObject = NULL;
-
-}
-
-CPDFSDK_PageView* CJS_EmbedObj::JSGetPageView(IFXJS_Context* cc)
-{
- return FXJS_GetPageView(cc);
-}
-
-int CJS_EmbedObj::MsgBox(CPDFDoc_Environment* pApp, CPDFSDK_PageView* pPageView,FX_LPCWSTR swMsg,FX_LPCWSTR swTitle,FX_UINT nType,FX_UINT nIcon)
-{
- return FXJS_MsgBox(pApp, pPageView, swMsg, swTitle, nType, nIcon);
-}
-
-void CJS_EmbedObj::Alert(CJS_Context* pContext, FX_LPCWSTR swMsg)
-{
- CJS_Object::Alert(pContext, swMsg);
-}
-
-CJS_Timer* CJS_EmbedObj::BeginTimer(CPDFDoc_Environment * pApp,FX_UINT nElapse)
-{
- CJS_Timer* pTimer = new CJS_Timer(this,pApp);
- pTimer->SetJSTimer(nElapse);
-
- return pTimer;
-}
-
-void CJS_EmbedObj::EndTimer(CJS_Timer* pTimer)
-{
- ASSERT(pTimer != NULL);
- pTimer->KillJSTimer();
- delete pTimer;
-}
-
-FX_BOOL CJS_EmbedObj::IsSafeMode(IFXJS_Context* cc)
-{
- ASSERT(cc != NULL);
-
- return TRUE;
-}
-
-/* --------------------------------- CJS_Object --------------------------------- */
-void FreeObject(const v8::WeakCallbackData<v8::Object, CJS_Object>& data)
-{
- CJS_Object* pJSObj = data.GetParameter();
- if(pJSObj)
- {
- pJSObj->ExitInstance();
- delete pJSObj;
- }
- v8::Local<v8::Object> obj = data.GetValue();
- JS_FreePrivate(obj);
-}
-
-CJS_Object::CJS_Object(JSFXObject pObject) :m_pEmbedObj(NULL)
-{
- v8::Local<v8::Context> context = pObject->CreationContext();
- m_pIsolate = context->GetIsolate();
- m_pObject.Reset(m_pIsolate, pObject);
-};
-
-CJS_Object::~CJS_Object(void)
-{
- delete m_pEmbedObj;
- m_pEmbedObj = NULL;
-
- m_pObject.Reset();
-};
-
-void CJS_Object::MakeWeak()
-{
- m_pObject.SetWeak(this, FreeObject);
-}
-
-CPDFSDK_PageView* CJS_Object::JSGetPageView(IFXJS_Context* cc)
-{
- return FXJS_GetPageView(cc);
-}
-
-int CJS_Object::MsgBox(CPDFDoc_Environment* pApp, CPDFSDK_PageView* pPageView, FX_LPCWSTR swMsg, FX_LPCWSTR swTitle, FX_UINT nType, FX_UINT nIcon)
-{
- return FXJS_MsgBox(pApp, pPageView, swMsg, swTitle, nType, nIcon);
-}
-
-void CJS_Object::Alert(CJS_Context* pContext, FX_LPCWSTR swMsg)
-{
- ASSERT(pContext != NULL);
-
- if (pContext->IsMsgBoxEnabled())
- {
- CPDFDoc_Environment* pApp = pContext->GetReaderApp();
- if(pApp)
- pApp->JS_appAlert(swMsg, NULL, 0, 3);
- }
-}
-
-
+// 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
+
+#include "../../include/javascript/JavaScript.h"
+#include "../../include/javascript/IJavaScript.h"
+#include "../../include/javascript/JS_Define.h"
+#include "../../include/javascript/JS_Object.h"
+// #include "../../include/javascript/JS_MsgBox.h"
+// #include "../../include/javascript/JS_ResMgr.h"
+#include "../../include/javascript/JS_Context.h"
+
+int FXJS_MsgBox(CPDFDoc_Environment* pApp, CPDFSDK_PageView* pPageView, FX_LPCWSTR swMsg, FX_LPCWSTR swTitle, FX_UINT nType, FX_UINT nIcon)
+{
+ int nRet = 0;
+
+ if(pApp)
+ {
+ CPDFSDK_Document* pDoc = pApp->GetCurrentDoc();
+ if(pDoc)
+ pDoc->KillFocusAnnot();
+ nRet = pApp->JS_appAlert(swMsg, swTitle, nType, nIcon);
+ }
+
+ return nRet;
+}
+
+CPDFSDK_PageView* FXJS_GetPageView(IFXJS_Context* cc)
+{
+ if (CJS_Context* pContext = (CJS_Context *)cc)
+ {
+ if (pContext->GetReaderDocument())
+ return NULL;
+ }
+ return NULL;
+}
+
+/* --------------------------------- CJS_EmbedObj --------------------------------- */
+
+CJS_EmbedObj::CJS_EmbedObj(CJS_Object* pJSObject) :
+ m_pJSObject(pJSObject)
+{
+}
+
+CJS_EmbedObj::~CJS_EmbedObj()
+{
+ m_pJSObject = NULL;
+
+}
+
+CPDFSDK_PageView* CJS_EmbedObj::JSGetPageView(IFXJS_Context* cc)
+{
+ return FXJS_GetPageView(cc);
+}
+
+int CJS_EmbedObj::MsgBox(CPDFDoc_Environment* pApp, CPDFSDK_PageView* pPageView,FX_LPCWSTR swMsg,FX_LPCWSTR swTitle,FX_UINT nType,FX_UINT nIcon)
+{
+ return FXJS_MsgBox(pApp, pPageView, swMsg, swTitle, nType, nIcon);
+}
+
+void CJS_EmbedObj::Alert(CJS_Context* pContext, FX_LPCWSTR swMsg)
+{
+ CJS_Object::Alert(pContext, swMsg);
+}
+
+CJS_Timer* CJS_EmbedObj::BeginTimer(CPDFDoc_Environment * pApp,FX_UINT nElapse)
+{
+ CJS_Timer* pTimer = new CJS_Timer(this,pApp);
+ pTimer->SetJSTimer(nElapse);
+
+ return pTimer;
+}
+
+void CJS_EmbedObj::EndTimer(CJS_Timer* pTimer)
+{
+ ASSERT(pTimer != NULL);
+ pTimer->KillJSTimer();
+ delete pTimer;
+}
+
+FX_BOOL CJS_EmbedObj::IsSafeMode(IFXJS_Context* cc)
+{
+ ASSERT(cc != NULL);
+
+ return TRUE;
+}
+
+/* --------------------------------- CJS_Object --------------------------------- */
+void FreeObject(const v8::WeakCallbackData<v8::Object, CJS_Object>& data)
+{
+ CJS_Object* pJSObj = data.GetParameter();
+ if(pJSObj)
+ {
+ pJSObj->ExitInstance();
+ delete pJSObj;
+ }
+ v8::Local<v8::Object> obj = data.GetValue();
+ JS_FreePrivate(obj);
+}
+
+CJS_Object::CJS_Object(JSFXObject pObject) :m_pEmbedObj(NULL)
+{
+ v8::Local<v8::Context> context = pObject->CreationContext();
+ m_pIsolate = context->GetIsolate();
+ m_pObject.Reset(m_pIsolate, pObject);
+};
+
+CJS_Object::~CJS_Object(void)
+{
+ delete m_pEmbedObj;
+ m_pEmbedObj = NULL;
+
+ m_pObject.Reset();
+};
+
+void CJS_Object::MakeWeak()
+{
+ m_pObject.SetWeak(this, FreeObject);
+}
+
+CPDFSDK_PageView* CJS_Object::JSGetPageView(IFXJS_Context* cc)
+{
+ return FXJS_GetPageView(cc);
+}
+
+int CJS_Object::MsgBox(CPDFDoc_Environment* pApp, CPDFSDK_PageView* pPageView, FX_LPCWSTR swMsg, FX_LPCWSTR swTitle, FX_UINT nType, FX_UINT nIcon)
+{
+ return FXJS_MsgBox(pApp, pPageView, swMsg, swTitle, nType, nIcon);
+}
+
+void CJS_Object::Alert(CJS_Context* pContext, FX_LPCWSTR swMsg)
+{
+ ASSERT(pContext != NULL);
+
+ if (pContext->IsMsgBoxEnabled())
+ {
+ CPDFDoc_Environment* pApp = pContext->GetReaderApp();
+ if(pApp)
+ pApp->JS_appAlert(swMsg, NULL, 0, 3);
+ }
+}
+
+
diff --git a/fpdfsdk/src/javascript/JS_Runtime.cpp b/fpdfsdk/src/javascript/JS_Runtime.cpp
index 77796431d4..c7a92ebde2 100644
--- a/fpdfsdk/src/javascript/JS_Runtime.cpp
+++ b/fpdfsdk/src/javascript/JS_Runtime.cpp
@@ -1,470 +1,470 @@
-// 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
-
-#include "../../include/javascript/JavaScript.h"
-#include "../../include/javascript/IJavaScript.h"
-#include "../../include/javascript/JS_EventHandler.h"
-#include "../../include/javascript/JS_Runtime.h"
-#include "../../include/javascript/JS_Context.h"
-#include "../../include/javascript/JS_Define.h"
-#include "../../include/javascript/JS_Object.h"
-#include "../../include/javascript/JS_Value.h"
-#include "../../include/javascript/Document.h"
-#include "../../include/javascript/app.h"
-#include "../../include/javascript/color.h"
-#include "../../include/javascript/Consts.h"
-#include "../../include/javascript/Document.h"
-#include "../../include/javascript/event.h"
-#include "../../include/javascript/Field.h"
-#include "../../include/javascript/Icon.h"
-#include "../../include/javascript/PublicMethods.h"
-#include "../../include/javascript/report.h"
-#include "../../include/javascript/util.h"
-#include "../../include/javascript/JS_GlobalData.h"
-#include "../../include/javascript/global.h"
-#include "../../include/javascript/console.h"
-
-CJS_RuntimeFactory::~CJS_RuntimeFactory()
-{
-}
-
-IFXJS_Runtime* CJS_RuntimeFactory::NewJSRuntime(CPDFDoc_Environment* pApp)
-{
- if (!m_bInit)
- {
- JS_Initial();
-
- m_bInit = TRUE;
- }
- return new CJS_Runtime(pApp);
-}
-void CJS_RuntimeFactory::AddRef()
-{
- //to do.Should be implemented as atom manipulation.
- m_nRef++;
-}
-void CJS_RuntimeFactory::Release()
-{
- if(m_bInit)
- {
- //to do.Should be implemented as atom manipulation.
- if (--m_nRef == 0)
- {
- JS_Release();
- ReleaseGlobalData();
- m_bInit = FALSE;
- }
- }
-}
-
-void CJS_RuntimeFactory::DeleteJSRuntime(IFXJS_Runtime* pRuntime)
-{
- if(pRuntime)
- delete (CJS_Runtime*)pRuntime;
-}
-
-CJS_GlobalData* CJS_RuntimeFactory::NewGlobalData(CPDFDoc_Environment* pApp)
-{
- if (m_pGlobalData)
- {
- m_nGlobalDataCount++;
- return m_pGlobalData;
- }
- else
- {
- m_nGlobalDataCount = 1;
- m_pGlobalData = new CJS_GlobalData(pApp);
- return m_pGlobalData;
- }
-}
-
-void CJS_RuntimeFactory::ReleaseGlobalData()
-{
- m_nGlobalDataCount--;
-
- if (m_nGlobalDataCount <= 0)
- {
- delete m_pGlobalData;
- m_pGlobalData = NULL;
- }
-}
-
-/* ------------------------------ CJS_Runtime ------------------------------ */
-
-CJS_Runtime::CJS_Runtime(CPDFDoc_Environment * pApp) :
- m_pApp(pApp),
- m_pDocument(NULL),
- m_pFieldEventPath(NULL),
- m_bBlocking(FALSE),
- m_bRegistered(FALSE)
-{
- m_isolate = v8::Isolate::New();
- //m_isolate->Enter();
-
- InitJSObjects();
-
- CJS_Context * pContext = (CJS_Context*)NewContext();
- JS_InitialRuntime(*this, this, pContext, m_context);
- ReleaseContext(pContext);
-}
-
-CJS_Runtime::~CJS_Runtime()
-{
- for (int i=0, sz=m_ContextArray.GetSize(); i<sz; i++)
- delete m_ContextArray.GetAt(i);
-
- m_ContextArray.RemoveAll();
-
- JS_ReleaseRuntime(*this, m_context);
-
- RemoveEventsInLoop(m_pFieldEventPath);
-
- m_pApp = NULL;
- m_pDocument = NULL;
- m_pFieldEventPath = NULL;
- m_context.Reset();
-
- //m_isolate->Exit();
- m_isolate->Dispose();
-}
-
-FX_BOOL CJS_Runtime::InitJSObjects()
-{
- v8::Isolate::Scope isolate_scope(GetIsolate());
- v8::HandleScope handle_scope(GetIsolate());
- v8::Handle<v8::Context> context = v8::Context::New(GetIsolate());
- v8::Context::Scope context_scope(context);
- //0 - 8
- if (CJS_Border::Init(*this, JS_STATIC) < 0) return FALSE;
- if (CJS_Display::Init(*this, JS_STATIC) < 0) return FALSE;
- if (CJS_Font::Init(*this, JS_STATIC) < 0) return FALSE;
- if (CJS_Highlight::Init(*this, JS_STATIC) < 0) return FALSE;
- if (CJS_Position::Init(*this, JS_STATIC) < 0) return FALSE;
- if (CJS_ScaleHow::Init(*this, JS_STATIC) < 0) return FALSE;
- if (CJS_ScaleWhen::Init(*this, JS_STATIC) < 0) return FALSE;
- if (CJS_Style::Init(*this, JS_STATIC) < 0) return FALSE;
- if (CJS_Zoomtype::Init(*this, JS_STATIC) < 0) return FALSE;
-
- //9 - 11
- if (CJS_App::Init(*this, JS_STATIC) < 0) return FALSE;
- if (CJS_Color::Init(*this, JS_STATIC) < 0) return FALSE;
- if (CJS_Console::Init(*this, JS_STATIC) < 0) return FALSE;
-
- //12 - 14
- if (CJS_Document::Init(*this, JS_DYNAMIC) < 0) return FALSE;
- if (CJS_Event::Init(*this, JS_STATIC) < 0) return FALSE;
- if (CJS_Field::Init(*this, JS_DYNAMIC) < 0) return FALSE;
-
- //15 - 17
- if (CJS_Global::Init(*this, JS_STATIC) < 0) return FALSE;
- if (CJS_Icon::Init(*this, JS_DYNAMIC) < 0) return FALSE;
- if (CJS_Util::Init(*this, JS_STATIC) < 0) return FALSE;
-
- if (CJS_PublicMethods::Init(*this) < 0) return FALSE;
- if (CJS_GlobalConsts::Init(*this) < 0) return FALSE;
- if (CJS_GlobalArrays::Init(*this) < 0) return FALSE;
-
- if (CJS_TimerObj::Init(*this, JS_DYNAMIC) < 0) return FALSE;
- if (CJS_PrintParamsObj::Init(*this, JS_DYNAMIC) <0) return FALSE;
-
- return TRUE;
-}
-
-IFXJS_Context* CJS_Runtime::NewContext()
-{
- CJS_Context * p = new CJS_Context(this);
- m_ContextArray.Add(p);
- return p;
-}
-
-void CJS_Runtime::ReleaseContext(IFXJS_Context * pContext)
-{
- CJS_Context* pJSContext = (CJS_Context*)pContext;
-
- for (int i=0, sz=m_ContextArray.GetSize(); i<sz; i++)
- {
- if (pJSContext == m_ContextArray.GetAt(i))
- {
- delete pJSContext;
- m_ContextArray.RemoveAt(i);
- break;
- }
- }
-}
-
-IFXJS_Context* CJS_Runtime::GetCurrentContext()
-{
- if(!m_ContextArray.GetSize())
- return NULL;
- return m_ContextArray.GetAt(m_ContextArray.GetSize()-1);
-}
-
-void CJS_Runtime::SetReaderDocument(CPDFSDK_Document* pReaderDoc)
-{
- if (m_pDocument != pReaderDoc)
- {
- v8::Isolate::Scope isolate_scope(m_isolate);
- v8::HandleScope handle_scope(m_isolate);
- v8::Local<v8::Context> context =v8::Local<v8::Context>::New(m_isolate, m_context);
- v8::Context::Scope context_scope(context);
-
- m_pDocument = pReaderDoc;
-
- if (pReaderDoc)
- {
- JSObject pThis = JS_GetThisObj(*this);
- if(!pThis.IsEmpty())
- {
- if (JS_GetObjDefnID(pThis) == JS_GetObjDefnID(*this, L"Document"))
- {
- if (CJS_Document* pJSDocument = (CJS_Document*)JS_GetPrivate(pThis))
- {
- if (Document * pDocument = (Document*)pJSDocument->GetEmbedObject())
- pDocument->AttachDoc(pReaderDoc);
- }
- }
- }
- JS_SetThisObj(*this, JS_GetObjDefnID(*this, L"Document"));
- }
- else
- {
- JS_SetThisObj(*this, JS_GetObjDefnID(*this, L"app"));
- }
- }
-}
-
-FX_BOOL CJS_Runtime::AddEventToLoop(const CFX_WideString& sTargetName, JS_EVENT_T eEventType)
-{
- if (m_pFieldEventPath == NULL)
- {
- m_pFieldEventPath = new CJS_FieldEvent;
- m_pFieldEventPath->sTargetName = sTargetName;
- m_pFieldEventPath->eEventType = eEventType;
- m_pFieldEventPath->pNext = NULL;
-
- return TRUE;
- }
-
- //to search
- CJS_FieldEvent* p = m_pFieldEventPath;
- CJS_FieldEvent* pLast = m_pFieldEventPath;
- while (p)
- {
- if (p->eEventType == eEventType && p->sTargetName == sTargetName)
- return FALSE;
-
- pLast = p;
- p = p->pNext;
- }
-
- //to add
- CJS_FieldEvent* pNew = new CJS_FieldEvent;
- pNew->sTargetName = sTargetName;
- pNew->eEventType = eEventType;
- pNew->pNext = NULL;
-
- pLast->pNext = pNew;
-
- return TRUE;
-}
-
-void CJS_Runtime::RemoveEventInLoop(const CFX_WideString& sTargetName, JS_EVENT_T eEventType)
-{
- FX_BOOL bFind = FALSE;
-
- CJS_FieldEvent* p = m_pFieldEventPath;
- CJS_FieldEvent* pLast = NULL;
- while (p)
- {
- if (p->eEventType == eEventType && p->sTargetName == sTargetName)
- {
- bFind = TRUE;
- break;
- }
-
- pLast = p;
- p = p->pNext;
- }
-
- if (bFind)
- {
- RemoveEventsInLoop(p);
-
- if (p == m_pFieldEventPath)
- m_pFieldEventPath = NULL;
-
- if (pLast)
- pLast->pNext = NULL;
- }
-}
-
-void CJS_Runtime::RemoveEventsInLoop(CJS_FieldEvent* pStart)
-{
- CJS_FieldEvent* p = pStart;
-
- while (p)
- {
- CJS_FieldEvent* pOld = p;
- p = pOld->pNext;
-
- delete pOld;
- }
-}
-
-v8::Handle<v8::Context> CJS_Runtime::NewJSContext()
-{
- return v8::Local<v8::Context>::New(m_isolate, m_context);
-}
-
-CFX_WideString ChangeObjName(const CFX_WideString& str)
-{
- CFX_WideString sRet = str;
- sRet.Replace((FX_LPCWSTR)L"_", (FX_LPCWSTR)L".");
- return sRet;
-}
-
-void CJS_Runtime::GetObjectNames(CFX_WideStringArray& array)
-{
- array.RemoveAll();
-
- array.Add(CJS_Border::m_pClassName);
- array.Add(CJS_Display::m_pClassName);
- array.Add(CJS_Font::m_pClassName);
- array.Add(CJS_Highlight::m_pClassName);
- array.Add(CJS_Position::m_pClassName);
- array.Add(CJS_ScaleHow::m_pClassName);
- array.Add(CJS_ScaleWhen::m_pClassName);
- array.Add(CJS_Style::m_pClassName);
- array.Add(CJS_Zoomtype::m_pClassName);
-
- array.Add(CJS_App::m_pClassName);
- array.Add((FX_LPCWSTR)"this");
- array.Add(CJS_Event::m_pClassName);
-
- array.Add(CJS_Global::m_pClassName);
- array.Add(CJS_Util::m_pClassName);
-}
-
-void CJS_Runtime::GetObjectConsts(const CFX_WideString& sObjName, CFX_WideStringArray& array)
-{
- JSConstSpec* pConsts = NULL;
- int nSize = 0;
-
- if (sObjName == CJS_Border::m_pClassName)
- CJS_Border::GetConsts(pConsts, nSize);
- else if (sObjName == CJS_Display::m_pClassName)
- CJS_Display::GetConsts(pConsts, nSize);
- else if (sObjName == CJS_Font::m_pClassName)
- CJS_Font::GetConsts(pConsts, nSize);
- else if (sObjName == CJS_Highlight::m_pClassName)
- CJS_Highlight::GetConsts(pConsts, nSize);
- else if (sObjName == CJS_Position::m_pClassName)
- CJS_Position::GetConsts(pConsts, nSize);
- else if (sObjName == CJS_ScaleHow::m_pClassName)
- CJS_ScaleHow::GetConsts(pConsts, nSize);
- else if (sObjName == CJS_ScaleWhen::m_pClassName)
- CJS_ScaleWhen::GetConsts(pConsts, nSize);
- else if (sObjName == CJS_Style::m_pClassName)
- CJS_Style::GetConsts(pConsts, nSize);
- else if (sObjName == CJS_Zoomtype::m_pClassName)
- CJS_Zoomtype::GetConsts(pConsts, nSize);
-
- else if (sObjName == CJS_App::m_pClassName)
- CJS_App::GetConsts(pConsts, nSize);
- else if (sObjName == CJS_Color::m_pClassName)
- CJS_Color::GetConsts(pConsts, nSize);
-
- else if (sObjName == L"this")
- {
- if (GetReaderDocument())
- CJS_Document::GetConsts(pConsts, nSize);
- else
- CJS_App::GetConsts(pConsts, nSize);
- }
-
- if (sObjName == CJS_Event::m_pClassName)
- CJS_Event::GetConsts(pConsts, nSize);
- else if (sObjName == CJS_Field::m_pClassName)
- CJS_Field::GetConsts(pConsts, nSize);
- else if (sObjName == CJS_Global::m_pClassName)
- CJS_Global::GetConsts(pConsts, nSize);
- else if (sObjName == CJS_Util::m_pClassName)
- CJS_Util::GetConsts(pConsts, nSize);
-
- for (int i=0; i<nSize; i++)
- array.Add(pConsts[i].pName);
-}
-
-void CJS_Runtime::GetObjectProps(const CFX_WideString& sObjName, CFX_WideStringArray& array)
-{
- JSPropertySpec* pProperties = NULL;
- int nSize = 0;
-
- if (sObjName == CJS_App::m_pClassName)
- CJS_App::GetProperties(pProperties, nSize);
- else if (sObjName == CJS_Color::m_pClassName)
- CJS_Color::GetProperties(pProperties, nSize);
- else if (sObjName == L"this")
- {
- if (GetReaderDocument())
- CJS_Document::GetProperties(pProperties, nSize);
- else
- CJS_App::GetProperties(pProperties, nSize);
- }
- else if (sObjName == CJS_Event::m_pClassName)
- CJS_Event::GetProperties(pProperties, nSize);
- else if (sObjName == CJS_Field::m_pClassName)
- CJS_Field::GetProperties(pProperties, nSize);
- else if (sObjName == CJS_Global::m_pClassName)
- CJS_Global::GetProperties(pProperties, nSize);
- else if (sObjName == CJS_Util::m_pClassName)
- CJS_Util::GetProperties(pProperties, nSize);
-
- for (int i=0; i<nSize; i++)
- array.Add(pProperties[i].pName);
-}
-
-void CJS_Runtime::GetObjectMethods(const CFX_WideString& sObjName, CFX_WideStringArray& array)
-{
- JSMethodSpec* pMethods = NULL;
- int nSize = 0;
-
- if (sObjName == CJS_App::m_pClassName)
- CJS_App::GetMethods(pMethods, nSize);
- else if (sObjName == CJS_Color::m_pClassName)
- CJS_Color::GetMethods(pMethods, nSize);
- else if (sObjName == L"this")
- {
- if (GetReaderDocument())
- CJS_Document::GetMethods(pMethods, nSize);
- else
- CJS_App::GetMethods(pMethods, nSize);
- }
- else if (sObjName == CJS_Event::m_pClassName)
- CJS_Event::GetMethods(pMethods, nSize);
- else if (sObjName == CJS_Field::m_pClassName)
- CJS_Field::GetMethods(pMethods, nSize);
- else if (sObjName == CJS_Global::m_pClassName)
- CJS_Global::GetMethods(pMethods, nSize);
- else if (sObjName == CJS_Util::m_pClassName)
- CJS_Util::GetMethods(pMethods, nSize);
-
- for (int i=0; i<nSize; i++)
- array.Add(pMethods[i].pName);
-}
-
-FX_BOOL CJS_Runtime::IsEntered()
-{
- return v8::Isolate::GetCurrent() == m_isolate;
-}
-void CJS_Runtime::Exit()
-{
- if(m_isolate) m_isolate->Exit();
-}
-void CJS_Runtime::Enter()
-{
- if(m_isolate) m_isolate->Enter();
-}
+// 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
+
+#include "../../include/javascript/JavaScript.h"
+#include "../../include/javascript/IJavaScript.h"
+#include "../../include/javascript/JS_EventHandler.h"
+#include "../../include/javascript/JS_Runtime.h"
+#include "../../include/javascript/JS_Context.h"
+#include "../../include/javascript/JS_Define.h"
+#include "../../include/javascript/JS_Object.h"
+#include "../../include/javascript/JS_Value.h"
+#include "../../include/javascript/Document.h"
+#include "../../include/javascript/app.h"
+#include "../../include/javascript/color.h"
+#include "../../include/javascript/Consts.h"
+#include "../../include/javascript/Document.h"
+#include "../../include/javascript/event.h"
+#include "../../include/javascript/Field.h"
+#include "../../include/javascript/Icon.h"
+#include "../../include/javascript/PublicMethods.h"
+#include "../../include/javascript/report.h"
+#include "../../include/javascript/util.h"
+#include "../../include/javascript/JS_GlobalData.h"
+#include "../../include/javascript/global.h"
+#include "../../include/javascript/console.h"
+
+CJS_RuntimeFactory::~CJS_RuntimeFactory()
+{
+}
+
+IFXJS_Runtime* CJS_RuntimeFactory::NewJSRuntime(CPDFDoc_Environment* pApp)
+{
+ if (!m_bInit)
+ {
+ JS_Initial();
+
+ m_bInit = TRUE;
+ }
+ return new CJS_Runtime(pApp);
+}
+void CJS_RuntimeFactory::AddRef()
+{
+ //to do.Should be implemented as atom manipulation.
+ m_nRef++;
+}
+void CJS_RuntimeFactory::Release()
+{
+ if(m_bInit)
+ {
+ //to do.Should be implemented as atom manipulation.
+ if (--m_nRef == 0)
+ {
+ JS_Release();
+ ReleaseGlobalData();
+ m_bInit = FALSE;
+ }
+ }
+}
+
+void CJS_RuntimeFactory::DeleteJSRuntime(IFXJS_Runtime* pRuntime)
+{
+ if(pRuntime)
+ delete (CJS_Runtime*)pRuntime;
+}
+
+CJS_GlobalData* CJS_RuntimeFactory::NewGlobalData(CPDFDoc_Environment* pApp)
+{
+ if (m_pGlobalData)
+ {
+ m_nGlobalDataCount++;
+ return m_pGlobalData;
+ }
+ else
+ {
+ m_nGlobalDataCount = 1;
+ m_pGlobalData = new CJS_GlobalData(pApp);
+ return m_pGlobalData;
+ }
+}
+
+void CJS_RuntimeFactory::ReleaseGlobalData()
+{
+ m_nGlobalDataCount--;
+
+ if (m_nGlobalDataCount <= 0)
+ {
+ delete m_pGlobalData;
+ m_pGlobalData = NULL;
+ }
+}
+
+/* ------------------------------ CJS_Runtime ------------------------------ */
+
+CJS_Runtime::CJS_Runtime(CPDFDoc_Environment * pApp) :
+ m_pApp(pApp),
+ m_pDocument(NULL),
+ m_pFieldEventPath(NULL),
+ m_bBlocking(FALSE),
+ m_bRegistered(FALSE)
+{
+ m_isolate = v8::Isolate::New();
+ //m_isolate->Enter();
+
+ InitJSObjects();
+
+ CJS_Context * pContext = (CJS_Context*)NewContext();
+ JS_InitialRuntime(*this, this, pContext, m_context);
+ ReleaseContext(pContext);
+}
+
+CJS_Runtime::~CJS_Runtime()
+{
+ for (int i=0, sz=m_ContextArray.GetSize(); i<sz; i++)
+ delete m_ContextArray.GetAt(i);
+
+ m_ContextArray.RemoveAll();
+
+ JS_ReleaseRuntime(*this, m_context);
+
+ RemoveEventsInLoop(m_pFieldEventPath);
+
+ m_pApp = NULL;
+ m_pDocument = NULL;
+ m_pFieldEventPath = NULL;
+ m_context.Reset();
+
+ //m_isolate->Exit();
+ m_isolate->Dispose();
+}
+
+FX_BOOL CJS_Runtime::InitJSObjects()
+{
+ v8::Isolate::Scope isolate_scope(GetIsolate());
+ v8::HandleScope handle_scope(GetIsolate());
+ v8::Handle<v8::Context> context = v8::Context::New(GetIsolate());
+ v8::Context::Scope context_scope(context);
+ //0 - 8
+ if (CJS_Border::Init(*this, JS_STATIC) < 0) return FALSE;
+ if (CJS_Display::Init(*this, JS_STATIC) < 0) return FALSE;
+ if (CJS_Font::Init(*this, JS_STATIC) < 0) return FALSE;
+ if (CJS_Highlight::Init(*this, JS_STATIC) < 0) return FALSE;
+ if (CJS_Position::Init(*this, JS_STATIC) < 0) return FALSE;
+ if (CJS_ScaleHow::Init(*this, JS_STATIC) < 0) return FALSE;
+ if (CJS_ScaleWhen::Init(*this, JS_STATIC) < 0) return FALSE;
+ if (CJS_Style::Init(*this, JS_STATIC) < 0) return FALSE;
+ if (CJS_Zoomtype::Init(*this, JS_STATIC) < 0) return FALSE;
+
+ //9 - 11
+ if (CJS_App::Init(*this, JS_STATIC) < 0) return FALSE;
+ if (CJS_Color::Init(*this, JS_STATIC) < 0) return FALSE;
+ if (CJS_Console::Init(*this, JS_STATIC) < 0) return FALSE;
+
+ //12 - 14
+ if (CJS_Document::Init(*this, JS_DYNAMIC) < 0) return FALSE;
+ if (CJS_Event::Init(*this, JS_STATIC) < 0) return FALSE;
+ if (CJS_Field::Init(*this, JS_DYNAMIC) < 0) return FALSE;
+
+ //15 - 17
+ if (CJS_Global::Init(*this, JS_STATIC) < 0) return FALSE;
+ if (CJS_Icon::Init(*this, JS_DYNAMIC) < 0) return FALSE;
+ if (CJS_Util::Init(*this, JS_STATIC) < 0) return FALSE;
+
+ if (CJS_PublicMethods::Init(*this) < 0) return FALSE;
+ if (CJS_GlobalConsts::Init(*this) < 0) return FALSE;
+ if (CJS_GlobalArrays::Init(*this) < 0) return FALSE;
+
+ if (CJS_TimerObj::Init(*this, JS_DYNAMIC) < 0) return FALSE;
+ if (CJS_PrintParamsObj::Init(*this, JS_DYNAMIC) <0) return FALSE;
+
+ return TRUE;
+}
+
+IFXJS_Context* CJS_Runtime::NewContext()
+{
+ CJS_Context * p = new CJS_Context(this);
+ m_ContextArray.Add(p);
+ return p;
+}
+
+void CJS_Runtime::ReleaseContext(IFXJS_Context * pContext)
+{
+ CJS_Context* pJSContext = (CJS_Context*)pContext;
+
+ for (int i=0, sz=m_ContextArray.GetSize(); i<sz; i++)
+ {
+ if (pJSContext == m_ContextArray.GetAt(i))
+ {
+ delete pJSContext;
+ m_ContextArray.RemoveAt(i);
+ break;
+ }
+ }
+}
+
+IFXJS_Context* CJS_Runtime::GetCurrentContext()
+{
+ if(!m_ContextArray.GetSize())
+ return NULL;
+ return m_ContextArray.GetAt(m_ContextArray.GetSize()-1);
+}
+
+void CJS_Runtime::SetReaderDocument(CPDFSDK_Document* pReaderDoc)
+{
+ if (m_pDocument != pReaderDoc)
+ {
+ v8::Isolate::Scope isolate_scope(m_isolate);
+ v8::HandleScope handle_scope(m_isolate);
+ v8::Local<v8::Context> context =v8::Local<v8::Context>::New(m_isolate, m_context);
+ v8::Context::Scope context_scope(context);
+
+ m_pDocument = pReaderDoc;
+
+ if (pReaderDoc)
+ {
+ JSObject pThis = JS_GetThisObj(*this);
+ if(!pThis.IsEmpty())
+ {
+ if (JS_GetObjDefnID(pThis) == JS_GetObjDefnID(*this, L"Document"))
+ {
+ if (CJS_Document* pJSDocument = (CJS_Document*)JS_GetPrivate(pThis))
+ {
+ if (Document * pDocument = (Document*)pJSDocument->GetEmbedObject())
+ pDocument->AttachDoc(pReaderDoc);
+ }
+ }
+ }
+ JS_SetThisObj(*this, JS_GetObjDefnID(*this, L"Document"));
+ }
+ else
+ {
+ JS_SetThisObj(*this, JS_GetObjDefnID(*this, L"app"));
+ }
+ }
+}
+
+FX_BOOL CJS_Runtime::AddEventToLoop(const CFX_WideString& sTargetName, JS_EVENT_T eEventType)
+{
+ if (m_pFieldEventPath == NULL)
+ {
+ m_pFieldEventPath = new CJS_FieldEvent;
+ m_pFieldEventPath->sTargetName = sTargetName;
+ m_pFieldEventPath->eEventType = eEventType;
+ m_pFieldEventPath->pNext = NULL;
+
+ return TRUE;
+ }
+
+ //to search
+ CJS_FieldEvent* p = m_pFieldEventPath;
+ CJS_FieldEvent* pLast = m_pFieldEventPath;
+ while (p)
+ {
+ if (p->eEventType == eEventType && p->sTargetName == sTargetName)
+ return FALSE;
+
+ pLast = p;
+ p = p->pNext;
+ }
+
+ //to add
+ CJS_FieldEvent* pNew = new CJS_FieldEvent;
+ pNew->sTargetName = sTargetName;
+ pNew->eEventType = eEventType;
+ pNew->pNext = NULL;
+
+ pLast->pNext = pNew;
+
+ return TRUE;
+}
+
+void CJS_Runtime::RemoveEventInLoop(const CFX_WideString& sTargetName, JS_EVENT_T eEventType)
+{
+ FX_BOOL bFind = FALSE;
+
+ CJS_FieldEvent* p = m_pFieldEventPath;
+ CJS_FieldEvent* pLast = NULL;
+ while (p)
+ {
+ if (p->eEventType == eEventType && p->sTargetName == sTargetName)
+ {
+ bFind = TRUE;
+ break;
+ }
+
+ pLast = p;
+ p = p->pNext;
+ }
+
+ if (bFind)
+ {
+ RemoveEventsInLoop(p);
+
+ if (p == m_pFieldEventPath)
+ m_pFieldEventPath = NULL;
+
+ if (pLast)
+ pLast->pNext = NULL;
+ }
+}
+
+void CJS_Runtime::RemoveEventsInLoop(CJS_FieldEvent* pStart)
+{
+ CJS_FieldEvent* p = pStart;
+
+ while (p)
+ {
+ CJS_FieldEvent* pOld = p;
+ p = pOld->pNext;
+
+ delete pOld;
+ }
+}
+
+v8::Handle<v8::Context> CJS_Runtime::NewJSContext()
+{
+ return v8::Local<v8::Context>::New(m_isolate, m_context);
+}
+
+CFX_WideString ChangeObjName(const CFX_WideString& str)
+{
+ CFX_WideString sRet = str;
+ sRet.Replace((FX_LPCWSTR)L"_", (FX_LPCWSTR)L".");
+ return sRet;
+}
+
+void CJS_Runtime::GetObjectNames(CFX_WideStringArray& array)
+{
+ array.RemoveAll();
+
+ array.Add(CJS_Border::m_pClassName);
+ array.Add(CJS_Display::m_pClassName);
+ array.Add(CJS_Font::m_pClassName);
+ array.Add(CJS_Highlight::m_pClassName);
+ array.Add(CJS_Position::m_pClassName);
+ array.Add(CJS_ScaleHow::m_pClassName);
+ array.Add(CJS_ScaleWhen::m_pClassName);
+ array.Add(CJS_Style::m_pClassName);
+ array.Add(CJS_Zoomtype::m_pClassName);
+
+ array.Add(CJS_App::m_pClassName);
+ array.Add((FX_LPCWSTR)"this");
+ array.Add(CJS_Event::m_pClassName);
+
+ array.Add(CJS_Global::m_pClassName);
+ array.Add(CJS_Util::m_pClassName);
+}
+
+void CJS_Runtime::GetObjectConsts(const CFX_WideString& sObjName, CFX_WideStringArray& array)
+{
+ JSConstSpec* pConsts = NULL;
+ int nSize = 0;
+
+ if (sObjName == CJS_Border::m_pClassName)
+ CJS_Border::GetConsts(pConsts, nSize);
+ else if (sObjName == CJS_Display::m_pClassName)
+ CJS_Display::GetConsts(pConsts, nSize);
+ else if (sObjName == CJS_Font::m_pClassName)
+ CJS_Font::GetConsts(pConsts, nSize);
+ else if (sObjName == CJS_Highlight::m_pClassName)
+ CJS_Highlight::GetConsts(pConsts, nSize);
+ else if (sObjName == CJS_Position::m_pClassName)
+ CJS_Position::GetConsts(pConsts, nSize);
+ else if (sObjName == CJS_ScaleHow::m_pClassName)
+ CJS_ScaleHow::GetConsts(pConsts, nSize);
+ else if (sObjName == CJS_ScaleWhen::m_pClassName)
+ CJS_ScaleWhen::GetConsts(pConsts, nSize);
+ else if (sObjName == CJS_Style::m_pClassName)
+ CJS_Style::GetConsts(pConsts, nSize);
+ else if (sObjName == CJS_Zoomtype::m_pClassName)
+ CJS_Zoomtype::GetConsts(pConsts, nSize);
+
+ else if (sObjName == CJS_App::m_pClassName)
+ CJS_App::GetConsts(pConsts, nSize);
+ else if (sObjName == CJS_Color::m_pClassName)
+ CJS_Color::GetConsts(pConsts, nSize);
+
+ else if (sObjName == L"this")
+ {
+ if (GetReaderDocument())
+ CJS_Document::GetConsts(pConsts, nSize);
+ else
+ CJS_App::GetConsts(pConsts, nSize);
+ }
+
+ if (sObjName == CJS_Event::m_pClassName)
+ CJS_Event::GetConsts(pConsts, nSize);
+ else if (sObjName == CJS_Field::m_pClassName)
+ CJS_Field::GetConsts(pConsts, nSize);
+ else if (sObjName == CJS_Global::m_pClassName)
+ CJS_Global::GetConsts(pConsts, nSize);
+ else if (sObjName == CJS_Util::m_pClassName)
+ CJS_Util::GetConsts(pConsts, nSize);
+
+ for (int i=0; i<nSize; i++)
+ array.Add(pConsts[i].pName);
+}
+
+void CJS_Runtime::GetObjectProps(const CFX_WideString& sObjName, CFX_WideStringArray& array)
+{
+ JSPropertySpec* pProperties = NULL;
+ int nSize = 0;
+
+ if (sObjName == CJS_App::m_pClassName)
+ CJS_App::GetProperties(pProperties, nSize);
+ else if (sObjName == CJS_Color::m_pClassName)
+ CJS_Color::GetProperties(pProperties, nSize);
+ else if (sObjName == L"this")
+ {
+ if (GetReaderDocument())
+ CJS_Document::GetProperties(pProperties, nSize);
+ else
+ CJS_App::GetProperties(pProperties, nSize);
+ }
+ else if (sObjName == CJS_Event::m_pClassName)
+ CJS_Event::GetProperties(pProperties, nSize);
+ else if (sObjName == CJS_Field::m_pClassName)
+ CJS_Field::GetProperties(pProperties, nSize);
+ else if (sObjName == CJS_Global::m_pClassName)
+ CJS_Global::GetProperties(pProperties, nSize);
+ else if (sObjName == CJS_Util::m_pClassName)
+ CJS_Util::GetProperties(pProperties, nSize);
+
+ for (int i=0; i<nSize; i++)
+ array.Add(pProperties[i].pName);
+}
+
+void CJS_Runtime::GetObjectMethods(const CFX_WideString& sObjName, CFX_WideStringArray& array)
+{
+ JSMethodSpec* pMethods = NULL;
+ int nSize = 0;
+
+ if (sObjName == CJS_App::m_pClassName)
+ CJS_App::GetMethods(pMethods, nSize);
+ else if (sObjName == CJS_Color::m_pClassName)
+ CJS_Color::GetMethods(pMethods, nSize);
+ else if (sObjName == L"this")
+ {
+ if (GetReaderDocument())
+ CJS_Document::GetMethods(pMethods, nSize);
+ else
+ CJS_App::GetMethods(pMethods, nSize);
+ }
+ else if (sObjName == CJS_Event::m_pClassName)
+ CJS_Event::GetMethods(pMethods, nSize);
+ else if (sObjName == CJS_Field::m_pClassName)
+ CJS_Field::GetMethods(pMethods, nSize);
+ else if (sObjName == CJS_Global::m_pClassName)
+ CJS_Global::GetMethods(pMethods, nSize);
+ else if (sObjName == CJS_Util::m_pClassName)
+ CJS_Util::GetMethods(pMethods, nSize);
+
+ for (int i=0; i<nSize; i++)
+ array.Add(pMethods[i].pName);
+}
+
+FX_BOOL CJS_Runtime::IsEntered()
+{
+ return v8::Isolate::GetCurrent() == m_isolate;
+}
+void CJS_Runtime::Exit()
+{
+ if(m_isolate) m_isolate->Exit();
+}
+void CJS_Runtime::Enter()
+{
+ if(m_isolate) m_isolate->Enter();
+}
diff --git a/fpdfsdk/src/javascript/JS_Value.cpp b/fpdfsdk/src/javascript/JS_Value.cpp
index 037f6184ed..0217ea1374 100644
--- a/fpdfsdk/src/javascript/JS_Value.cpp
+++ b/fpdfsdk/src/javascript/JS_Value.cpp
@@ -1,643 +1,643 @@
-// 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
-
-#include "../../include/javascript/JavaScript.h"
-#include "../../include/javascript/JS_Define.h"
-#include "../../include/javascript/JS_Object.h"
-#include "../../include/javascript/JS_Value.h"
-
-/* ---------------------------- CJS_Value ---------------------------- */
-
-CJS_Value::CJS_Value(v8::Isolate* isolate) : m_isolate(isolate),m_eType(VT_unknown)
-{
-}
-CJS_Value::CJS_Value(v8::Isolate* isolate, v8::Handle<v8::Value> pValue,FXJSVALUETYPE t) :m_isolate(isolate), m_pValue(pValue) , m_eType(t)
-{
-}
-
-CJS_Value::CJS_Value(v8::Isolate* isolate, const int &iValue):m_isolate(isolate)
-{
- operator =(iValue);
-}
-
-CJS_Value::CJS_Value(v8::Isolate* isolate, const bool &bValue):m_isolate(isolate)
-{
- operator =(bValue);
-}
-
-CJS_Value::CJS_Value(v8::Isolate* isolate, const float &fValue):m_isolate(isolate)
-{
- operator =(fValue);
-}
-
-CJS_Value::CJS_Value(v8::Isolate* isolate, const double &dValue):m_isolate(isolate)
-{
- operator =(dValue);
-}
-
-CJS_Value::CJS_Value(v8::Isolate* isolate, JSFXObject pJsObj):m_isolate(isolate)
-{
- operator =(pJsObj);
-}
-
-CJS_Value::CJS_Value(v8::Isolate* isolate, CJS_Object * pJsObj):m_isolate(isolate)
-{
- operator =(pJsObj);
-}
-
-CJS_Value::CJS_Value(v8::Isolate* isolate, FX_LPCWSTR pWstr):m_isolate(isolate)
-{
- operator =(pWstr);
-}
-
-CJS_Value::CJS_Value(v8::Isolate* isolate, FX_LPCSTR pStr):m_isolate(isolate)
-{
- operator = (pStr);
-}
-
-CJS_Value::CJS_Value(v8::Isolate* isolate, CJS_Array& array):m_isolate(isolate)
-{
- operator = (array);
-}
-
-CJS_Value::~CJS_Value()
-{
-}
-
-void CJS_Value::Attach(v8::Handle<v8::Value> pValue,FXJSVALUETYPE t)
-{
- m_pValue = pValue;
- m_eType = t;
-}
-
-void CJS_Value::Attach(CJS_Value *pValue)
-{
- if (pValue)
- Attach(pValue->ToJSValue(),pValue->GetType());
-}
-
-void CJS_Value::Detach()
-{
- m_pValue = v8::Handle<v8::Value>();
- m_eType = VT_unknown;
-}
-
-/* ---------------------------------------------------------------------------------------- */
-
-CJS_Value::operator int() const
-{
-
- return JS_ToInt32(m_pValue);
-
-}
-
-CJS_Value::operator bool() const
-{
-
- return JS_ToBoolean(m_pValue);
-
-}
-
-CJS_Value::operator double() const
-{
-
- return JS_ToNumber(m_pValue);
-
-}
-
-CJS_Value::operator float() const
-{
-
- return (float)JS_ToNumber(m_pValue);
-
-}
-
-CJS_Value::operator CJS_Object *() const
-{
-
- v8::Handle<v8::Object> pObj = JS_ToObject(m_pValue);
- return (CJS_Object*)JS_GetPrivate(m_isolate, pObj);
-}
-
-CJS_Value::operator v8::Handle<v8::Object>() const
-{
- return JS_ToObject(m_pValue);
-}
-
-CJS_Value::operator CFX_WideString() const
-{
- return JS_ToString(m_pValue);
-}
-
-CJS_Value::operator CFX_ByteString() const
-{
- return CFX_ByteString::FromUnicode(operator CFX_WideString());
-}
-
-v8::Handle<v8::Value> CJS_Value::ToJSValue()
-{
- return m_pValue;
-}
-
-
-CJS_Value::operator v8::Handle<v8::Array>() const
-{
- if (IsArrayObject())
- return v8::Handle<v8::Array>::Cast(JS_ToObject(m_pValue));
- return v8::Handle<v8::Array>();
-}
-
-/* ---------------------------------------------------------------------------------------- */
-
-void CJS_Value::operator =(int iValue)
-{
- m_pValue = JS_NewNumber(m_isolate, iValue);
-
- m_eType = VT_number;
-}
-
-void CJS_Value::operator =(bool bValue)
-{
- m_pValue = JS_NewBoolean(m_isolate, bValue);
-
- m_eType = VT_boolean;
-}
-
-void CJS_Value::operator =(double dValue)
-{
- m_pValue = JS_NewNumber(m_isolate,dValue);
-
- m_eType = VT_number;
-}
-
-void CJS_Value::operator = (float fValue)
-{
- m_pValue = JS_NewNumber(m_isolate,fValue);
- m_eType = VT_number;
-}
-
-void CJS_Value::operator =(v8::Handle<v8::Object> pObj)
-{
-
- m_pValue = JS_NewObject(m_isolate,pObj);
-
- m_eType = VT_fxobject;
-}
-
-void CJS_Value::operator =(CJS_Object * pObj)
-{
- if (pObj)
- operator = ((JSFXObject)*pObj);
-}
-
-void CJS_Value::operator =(FX_LPCWSTR pWstr)
-{
- m_pValue = JS_NewString(m_isolate,(wchar_t *)pWstr);
-
- m_eType = VT_string;
-}
-
-void CJS_Value::SetNull()
-{
- m_pValue = JS_NewNull();
-
- m_eType = VT_null;
-}
-
-void CJS_Value::operator = (FX_LPCSTR pStr)
-{
- operator = (CFX_WideString::FromLocal(pStr));
-}
-
-void CJS_Value::operator = (CJS_Array & array)
-{
- m_pValue = JS_NewObject2(m_isolate,(v8::Handle<v8::Array>)array);
-
- m_eType = VT_object;
-}
-
-void CJS_Value::operator = (CJS_Date & date)
-{
- m_pValue = JS_NewDate(m_isolate, (double)date);
-
- m_eType = VT_date;
-}
-
-void CJS_Value::operator = (CJS_Value value)
-{
- m_pValue = value.ToJSValue();
-
- m_eType = value.m_eType;
-}
-
-/* ---------------------------------------------------------------------------------------- */
-
-FXJSVALUETYPE CJS_Value::GetType() const
-{
- if(m_pValue.IsEmpty()) return VT_unknown;
- if(m_pValue->IsString()) return VT_string;
- if(m_pValue->IsNumber()) return VT_number;
- if(m_pValue->IsBoolean()) return VT_boolean;
- if(m_pValue->IsDate()) return VT_date;
- if(m_pValue->IsObject()) return VT_object;
- if(m_pValue->IsNull()) return VT_null;
- if(m_pValue->IsUndefined()) return VT_undefined;
- return VT_unknown;
-}
-
-FX_BOOL CJS_Value::IsArrayObject() const
-{
- if(m_pValue.IsEmpty()) return FALSE;
- return m_pValue->IsArray();
-}
-
-FX_BOOL CJS_Value::IsDateObject() const
-{
- if(m_pValue.IsEmpty()) return FALSE;
- return m_pValue->IsDate();
-}
-
-//CJS_Value::operator CJS_Array()
-FX_BOOL CJS_Value::ConvertToArray(CJS_Array &array) const
-{
- if (IsArrayObject())
- {
- array.Attach(JS_ToArray(m_pValue));
- return TRUE;
- }
-
- return FALSE;
-}
-
-FX_BOOL CJS_Value::ConvertToDate(CJS_Date &date) const
-{
-// if (GetType() == VT_date)
-// {
-// date = (double)(*this);
-// return TRUE;
-// }
-
- if (IsDateObject())
- {
- date.Attach(m_pValue);
- return TRUE;
- }
-
- return FALSE;
-}
-
-/* ---------------------------- CJS_PropValue ---------------------------- */
-
-CJS_PropValue::CJS_PropValue(const CJS_Value &value) :
- CJS_Value(value),
- m_bIsSetting(0)
-{
-}
-
-CJS_PropValue::CJS_PropValue(v8::Isolate* isolate) : CJS_Value(isolate),
- m_bIsSetting(0)
-{
-}
-
-CJS_PropValue::~CJS_PropValue()
-{
-}
-
-FX_BOOL CJS_PropValue::IsSetting()
-{
- return m_bIsSetting;
-}
-
-FX_BOOL CJS_PropValue::IsGetting()
-{
- return !m_bIsSetting;
-}
-
-void CJS_PropValue::operator <<(int iValue)
-{
- ASSERT(!m_bIsSetting);
- CJS_Value::operator =(iValue);
-}
-
-void CJS_PropValue::operator >>(int & iValue) const
-{
- ASSERT(m_bIsSetting);
- iValue = CJS_Value::operator int();
-}
-
-
-void CJS_PropValue::operator <<(bool bValue)
-{
- ASSERT(!m_bIsSetting);
- CJS_Value::operator =(bValue);
-}
-
-void CJS_PropValue::operator >>(bool &bValue) const
-{
- ASSERT(m_bIsSetting);
- bValue = CJS_Value::operator bool();
-
-}
-
-void CJS_PropValue::operator <<(double dValue)
-{
- ASSERT(!m_bIsSetting);
- CJS_Value::operator =(dValue);
-}
-
-void CJS_PropValue::operator >>(double &dValue) const
-{
- ASSERT(m_bIsSetting);
- dValue = CJS_Value::operator double();
-}
-
-void CJS_PropValue::operator <<(CJS_Object *pObj)
-{
- ASSERT(!m_bIsSetting);
- CJS_Value::operator = (pObj);
-}
-
-void CJS_PropValue::operator >>(CJS_Object *&ppObj) const
-{
- ASSERT(m_bIsSetting);
- ppObj = CJS_Value::operator CJS_Object *();
-}
-
-void CJS_PropValue::operator<<(JSFXObject pObj)
-{
- ASSERT(!m_bIsSetting);
- CJS_Value::operator = (pObj);
-}
-
-void CJS_PropValue::operator>>(JSFXObject &ppObj) const
-{
- ASSERT(m_bIsSetting);
- ppObj = CJS_Value::operator JSFXObject ();
-}
-
-
-void CJS_PropValue::StartSetting()
-{
- m_bIsSetting = 1;
-}
-
-void CJS_PropValue::StartGetting()
-{
- m_bIsSetting = 0;
-}
-void CJS_PropValue::operator <<(CFX_ByteString string)
-{
- ASSERT(!m_bIsSetting);
- CJS_Value::operator =((FX_LPCSTR)string);
-}
-
-void CJS_PropValue::operator >>(CFX_ByteString &string) const
-{
- ASSERT(m_bIsSetting);
- string = CJS_Value::operator CFX_ByteString();
-}
-
-void CJS_PropValue::operator <<(FX_LPCWSTR c_string)
-{
- ASSERT(!m_bIsSetting);
- CJS_Value::operator =(c_string);
-}
-
-void CJS_PropValue::operator >>(CFX_WideString &wide_string) const
-{
- ASSERT(m_bIsSetting);
- wide_string = CJS_Value::operator CFX_WideString();
-}
-
-void CJS_PropValue::operator <<(CFX_WideString wide_string)
-{
- ASSERT(!m_bIsSetting);
- CJS_Value::operator = (wide_string);
-}
-
-void CJS_PropValue::operator >>(CJS_Array &array) const
-{
- ASSERT(m_bIsSetting);
- ConvertToArray(array);
-}
-
-void CJS_PropValue::operator <<(CJS_Array &array)
-{
- ASSERT(!m_bIsSetting);
- CJS_Value::operator=(array);
-}
-
-void CJS_PropValue::operator>>(CJS_Date &date) const
-{
- ASSERT(m_bIsSetting);
- ConvertToDate(date);
-}
-
-void CJS_PropValue::operator<<(CJS_Date &date)
-{
- ASSERT(!m_bIsSetting);
- CJS_Value::operator=(date);
-}
-
-CJS_PropValue::operator v8::Handle<v8::Value>() const
-{
- return m_pValue;
-}
-
-/* ======================================== CJS_Array ========================================= */
-CJS_Array::CJS_Array(v8::Isolate* isolate):m_isolate(isolate)
-{
-}
-
-CJS_Array::~CJS_Array()
-{
-}
-
-void CJS_Array::Attach(v8::Handle<v8::Array> pArray)
-{
- m_pArray = pArray;
-}
-
-FX_BOOL CJS_Array::IsAttached()
-{
- return FALSE;
-}
-
-void CJS_Array::GetElement(unsigned index,CJS_Value &value)
-{
- if (m_pArray.IsEmpty())
- return;
- v8::Handle<v8::Value> p = JS_GetArrayElemnet(m_pArray,index);
- value.Attach(p,VT_object);
-}
-
-void CJS_Array::SetElement(unsigned index,CJS_Value value)
-{
- if (m_pArray.IsEmpty())
- m_pArray = JS_NewArray(m_isolate);
-
- JS_PutArrayElement(m_pArray,index,value.ToJSValue(),value.GetType());
-}
-
-int CJS_Array::GetLength()
-{
- if (m_pArray.IsEmpty())
- return 0;
- return JS_GetArrayLength(m_pArray);
-}
-
-CJS_Array:: operator v8::Handle<v8::Array>()
-{
- if (m_pArray.IsEmpty())
- m_pArray = JS_NewArray(m_isolate);
-
- return m_pArray;
-}
-
-/* ======================================== CJS_Date ========================================= */
-
-CJS_Date::CJS_Date(v8::Isolate* isolate) :m_isolate(isolate)
-{
-}
-
-CJS_Date::CJS_Date(v8::Isolate* isolate,double dMsec_time)
-{
- m_isolate = isolate;
- m_pDate = JS_NewDate(isolate,dMsec_time);
-}
-
-CJS_Date::CJS_Date(v8::Isolate* isolate,int year, int mon, int day,int hour, int min, int sec)
-{
- m_isolate = isolate;
- m_pDate = JS_NewDate(isolate,MakeDate(year,mon,day,hour,min,sec,0));
-}
-
-double CJS_Date::MakeDate(int year, int mon, int day,int hour, int min, int sec,int ms)
-{
- return JS_MakeDate(JS_MakeDay(year,mon,day), JS_MakeTime(hour,min,sec,ms));
-}
-
-CJS_Date::~CJS_Date()
-{
-}
-
-FX_BOOL CJS_Date::IsValidDate()
-{
- if(m_pDate.IsEmpty()) return FALSE;
- return !JS_PortIsNan(JS_ToNumber(m_pDate));
-}
-
-void CJS_Date::Attach(v8::Handle<v8::Value> pDate)
-{
- m_pDate = pDate;
-}
-
-int CJS_Date::GetYear()
-{
- if (IsValidDate())
- return JS_GetYearFromTime(JS_LocalTime(JS_ToNumber(m_pDate)));
-
- return 0;
-}
-
-void CJS_Date::SetYear(int iYear)
-{
- double date = MakeDate(iYear,GetMonth(),GetDay(),GetHours(),GetMinutes(),GetSeconds(),0);
- JS_ValueCopy(m_pDate, JS_NewDate(m_isolate,date));
-}
-
-int CJS_Date::GetMonth()
-{
- if (IsValidDate())
- return JS_GetMonthFromTime(JS_LocalTime(JS_ToNumber(m_pDate)));
-
- return 0;
-}
-
-void CJS_Date::SetMonth(int iMonth)
-{
-
- double date = MakeDate(GetYear(),iMonth,GetDay(),GetHours(),GetMinutes(),GetSeconds(),0);
- JS_ValueCopy(m_pDate, JS_NewDate(m_isolate,date));
-
-}
-
-int CJS_Date::GetDay()
-{
- if (IsValidDate())
- return JS_GetDayFromTime(JS_LocalTime(JS_ToNumber(m_pDate)));
-
- return 0;
-}
-
-void CJS_Date::SetDay(int iDay)
-{
-
- double date = MakeDate(GetYear(),GetMonth(),iDay,GetHours(),GetMinutes(),GetSeconds(),0);
- JS_ValueCopy(m_pDate,JS_NewDate(m_isolate,date));
-
-}
-
-int CJS_Date::GetHours()
-{
- if (IsValidDate())
- return JS_GetHourFromTime(JS_LocalTime(JS_ToNumber(m_pDate)));
-
- return 0;
-}
-
-void CJS_Date::SetHours(int iHours)
-{
- double date = MakeDate(GetYear(),GetMonth(),GetDay(),iHours,GetMinutes(),GetSeconds(),0);
- JS_ValueCopy(m_pDate,JS_NewDate(m_isolate,date));
-}
-
-int CJS_Date::GetMinutes()
-{
- if (IsValidDate())
- return JS_GetMinFromTime(JS_LocalTime(JS_ToNumber(m_pDate)));
-
- return 0;
-}
-
-void CJS_Date::SetMinutes(int minutes)
-{
- double date = MakeDate(GetYear(),GetMonth(),GetDay(),GetHours(),minutes,GetSeconds(),0);
- JS_ValueCopy(m_pDate,JS_NewDate(m_isolate,date));
-}
-
-int CJS_Date::GetSeconds()
-{
- if (IsValidDate())
- return JS_GetSecFromTime(JS_LocalTime(JS_ToNumber(m_pDate)));
-
- return 0;
-}
-
-void CJS_Date::SetSeconds(int seconds)
-{
- double date = MakeDate(GetYear(),GetMonth(),GetDay(),GetHours(),GetMinutes(),seconds,0);
- JS_ValueCopy(m_pDate,JS_NewDate(m_isolate,date));
-}
-
-CJS_Date::operator v8::Handle<v8::Value>()
-{
- return m_pDate;
-}
-
-CJS_Date::operator double() const
-{
- if(m_pDate.IsEmpty())
- return 0.0;
- return JS_ToNumber(m_pDate);
-}
-
-CFX_WideString CJS_Date::ToString() const
-{
- if(m_pDate.IsEmpty())
- return L"";
- return JS_ToString(m_pDate);
-}
+// 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
+
+#include "../../include/javascript/JavaScript.h"
+#include "../../include/javascript/JS_Define.h"
+#include "../../include/javascript/JS_Object.h"
+#include "../../include/javascript/JS_Value.h"
+
+/* ---------------------------- CJS_Value ---------------------------- */
+
+CJS_Value::CJS_Value(v8::Isolate* isolate) : m_isolate(isolate),m_eType(VT_unknown)
+{
+}
+CJS_Value::CJS_Value(v8::Isolate* isolate, v8::Handle<v8::Value> pValue,FXJSVALUETYPE t) :m_isolate(isolate), m_pValue(pValue) , m_eType(t)
+{
+}
+
+CJS_Value::CJS_Value(v8::Isolate* isolate, const int &iValue):m_isolate(isolate)
+{
+ operator =(iValue);
+}
+
+CJS_Value::CJS_Value(v8::Isolate* isolate, const bool &bValue):m_isolate(isolate)
+{
+ operator =(bValue);
+}
+
+CJS_Value::CJS_Value(v8::Isolate* isolate, const float &fValue):m_isolate(isolate)
+{
+ operator =(fValue);
+}
+
+CJS_Value::CJS_Value(v8::Isolate* isolate, const double &dValue):m_isolate(isolate)
+{
+ operator =(dValue);
+}
+
+CJS_Value::CJS_Value(v8::Isolate* isolate, JSFXObject pJsObj):m_isolate(isolate)
+{
+ operator =(pJsObj);
+}
+
+CJS_Value::CJS_Value(v8::Isolate* isolate, CJS_Object * pJsObj):m_isolate(isolate)
+{
+ operator =(pJsObj);
+}
+
+CJS_Value::CJS_Value(v8::Isolate* isolate, FX_LPCWSTR pWstr):m_isolate(isolate)
+{
+ operator =(pWstr);
+}
+
+CJS_Value::CJS_Value(v8::Isolate* isolate, FX_LPCSTR pStr):m_isolate(isolate)
+{
+ operator = (pStr);
+}
+
+CJS_Value::CJS_Value(v8::Isolate* isolate, CJS_Array& array):m_isolate(isolate)
+{
+ operator = (array);
+}
+
+CJS_Value::~CJS_Value()
+{
+}
+
+void CJS_Value::Attach(v8::Handle<v8::Value> pValue,FXJSVALUETYPE t)
+{
+ m_pValue = pValue;
+ m_eType = t;
+}
+
+void CJS_Value::Attach(CJS_Value *pValue)
+{
+ if (pValue)
+ Attach(pValue->ToJSValue(),pValue->GetType());
+}
+
+void CJS_Value::Detach()
+{
+ m_pValue = v8::Handle<v8::Value>();
+ m_eType = VT_unknown;
+}
+
+/* ---------------------------------------------------------------------------------------- */
+
+CJS_Value::operator int() const
+{
+
+ return JS_ToInt32(m_pValue);
+
+}
+
+CJS_Value::operator bool() const
+{
+
+ return JS_ToBoolean(m_pValue);
+
+}
+
+CJS_Value::operator double() const
+{
+
+ return JS_ToNumber(m_pValue);
+
+}
+
+CJS_Value::operator float() const
+{
+
+ return (float)JS_ToNumber(m_pValue);
+
+}
+
+CJS_Value::operator CJS_Object *() const
+{
+
+ v8::Handle<v8::Object> pObj = JS_ToObject(m_pValue);
+ return (CJS_Object*)JS_GetPrivate(m_isolate, pObj);
+}
+
+CJS_Value::operator v8::Handle<v8::Object>() const
+{
+ return JS_ToObject(m_pValue);
+}
+
+CJS_Value::operator CFX_WideString() const
+{
+ return JS_ToString(m_pValue);
+}
+
+CJS_Value::operator CFX_ByteString() const
+{
+ return CFX_ByteString::FromUnicode(operator CFX_WideString());
+}
+
+v8::Handle<v8::Value> CJS_Value::ToJSValue()
+{
+ return m_pValue;
+}
+
+
+CJS_Value::operator v8::Handle<v8::Array>() const
+{
+ if (IsArrayObject())
+ return v8::Handle<v8::Array>::Cast(JS_ToObject(m_pValue));
+ return v8::Handle<v8::Array>();
+}
+
+/* ---------------------------------------------------------------------------------------- */
+
+void CJS_Value::operator =(int iValue)
+{
+ m_pValue = JS_NewNumber(m_isolate, iValue);
+
+ m_eType = VT_number;
+}
+
+void CJS_Value::operator =(bool bValue)
+{
+ m_pValue = JS_NewBoolean(m_isolate, bValue);
+
+ m_eType = VT_boolean;
+}
+
+void CJS_Value::operator =(double dValue)
+{
+ m_pValue = JS_NewNumber(m_isolate,dValue);
+
+ m_eType = VT_number;
+}
+
+void CJS_Value::operator = (float fValue)
+{
+ m_pValue = JS_NewNumber(m_isolate,fValue);
+ m_eType = VT_number;
+}
+
+void CJS_Value::operator =(v8::Handle<v8::Object> pObj)
+{
+
+ m_pValue = JS_NewObject(m_isolate,pObj);
+
+ m_eType = VT_fxobject;
+}
+
+void CJS_Value::operator =(CJS_Object * pObj)
+{
+ if (pObj)
+ operator = ((JSFXObject)*pObj);
+}
+
+void CJS_Value::operator =(FX_LPCWSTR pWstr)
+{
+ m_pValue = JS_NewString(m_isolate,(wchar_t *)pWstr);
+
+ m_eType = VT_string;
+}
+
+void CJS_Value::SetNull()
+{
+ m_pValue = JS_NewNull();
+
+ m_eType = VT_null;
+}
+
+void CJS_Value::operator = (FX_LPCSTR pStr)
+{
+ operator = (CFX_WideString::FromLocal(pStr));
+}
+
+void CJS_Value::operator = (CJS_Array & array)
+{
+ m_pValue = JS_NewObject2(m_isolate,(v8::Handle<v8::Array>)array);
+
+ m_eType = VT_object;
+}
+
+void CJS_Value::operator = (CJS_Date & date)
+{
+ m_pValue = JS_NewDate(m_isolate, (double)date);
+
+ m_eType = VT_date;
+}
+
+void CJS_Value::operator = (CJS_Value value)
+{
+ m_pValue = value.ToJSValue();
+
+ m_eType = value.m_eType;
+}
+
+/* ---------------------------------------------------------------------------------------- */
+
+FXJSVALUETYPE CJS_Value::GetType() const
+{
+ if(m_pValue.IsEmpty()) return VT_unknown;
+ if(m_pValue->IsString()) return VT_string;
+ if(m_pValue->IsNumber()) return VT_number;
+ if(m_pValue->IsBoolean()) return VT_boolean;
+ if(m_pValue->IsDate()) return VT_date;
+ if(m_pValue->IsObject()) return VT_object;
+ if(m_pValue->IsNull()) return VT_null;
+ if(m_pValue->IsUndefined()) return VT_undefined;
+ return VT_unknown;
+}
+
+FX_BOOL CJS_Value::IsArrayObject() const
+{
+ if(m_pValue.IsEmpty()) return FALSE;
+ return m_pValue->IsArray();
+}
+
+FX_BOOL CJS_Value::IsDateObject() const
+{
+ if(m_pValue.IsEmpty()) return FALSE;
+ return m_pValue->IsDate();
+}
+
+//CJS_Value::operator CJS_Array()
+FX_BOOL CJS_Value::ConvertToArray(CJS_Array &array) const
+{
+ if (IsArrayObject())
+ {
+ array.Attach(JS_ToArray(m_pValue));
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+FX_BOOL CJS_Value::ConvertToDate(CJS_Date &date) const
+{
+// if (GetType() == VT_date)
+// {
+// date = (double)(*this);
+// return TRUE;
+// }
+
+ if (IsDateObject())
+ {
+ date.Attach(m_pValue);
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+/* ---------------------------- CJS_PropValue ---------------------------- */
+
+CJS_PropValue::CJS_PropValue(const CJS_Value &value) :
+ CJS_Value(value),
+ m_bIsSetting(0)
+{
+}
+
+CJS_PropValue::CJS_PropValue(v8::Isolate* isolate) : CJS_Value(isolate),
+ m_bIsSetting(0)
+{
+}
+
+CJS_PropValue::~CJS_PropValue()
+{
+}
+
+FX_BOOL CJS_PropValue::IsSetting()
+{
+ return m_bIsSetting;
+}
+
+FX_BOOL CJS_PropValue::IsGetting()
+{
+ return !m_bIsSetting;
+}
+
+void CJS_PropValue::operator <<(int iValue)
+{
+ ASSERT(!m_bIsSetting);
+ CJS_Value::operator =(iValue);
+}
+
+void CJS_PropValue::operator >>(int & iValue) const
+{
+ ASSERT(m_bIsSetting);
+ iValue = CJS_Value::operator int();
+}
+
+
+void CJS_PropValue::operator <<(bool bValue)
+{
+ ASSERT(!m_bIsSetting);
+ CJS_Value::operator =(bValue);
+}
+
+void CJS_PropValue::operator >>(bool &bValue) const
+{
+ ASSERT(m_bIsSetting);
+ bValue = CJS_Value::operator bool();
+
+}
+
+void CJS_PropValue::operator <<(double dValue)
+{
+ ASSERT(!m_bIsSetting);
+ CJS_Value::operator =(dValue);
+}
+
+void CJS_PropValue::operator >>(double &dValue) const
+{
+ ASSERT(m_bIsSetting);
+ dValue = CJS_Value::operator double();
+}
+
+void CJS_PropValue::operator <<(CJS_Object *pObj)
+{
+ ASSERT(!m_bIsSetting);
+ CJS_Value::operator = (pObj);
+}
+
+void CJS_PropValue::operator >>(CJS_Object *&ppObj) const
+{
+ ASSERT(m_bIsSetting);
+ ppObj = CJS_Value::operator CJS_Object *();
+}
+
+void CJS_PropValue::operator<<(JSFXObject pObj)
+{
+ ASSERT(!m_bIsSetting);
+ CJS_Value::operator = (pObj);
+}
+
+void CJS_PropValue::operator>>(JSFXObject &ppObj) const
+{
+ ASSERT(m_bIsSetting);
+ ppObj = CJS_Value::operator JSFXObject ();
+}
+
+
+void CJS_PropValue::StartSetting()
+{
+ m_bIsSetting = 1;
+}
+
+void CJS_PropValue::StartGetting()
+{
+ m_bIsSetting = 0;
+}
+void CJS_PropValue::operator <<(CFX_ByteString string)
+{
+ ASSERT(!m_bIsSetting);
+ CJS_Value::operator =((FX_LPCSTR)string);
+}
+
+void CJS_PropValue::operator >>(CFX_ByteString &string) const
+{
+ ASSERT(m_bIsSetting);
+ string = CJS_Value::operator CFX_ByteString();
+}
+
+void CJS_PropValue::operator <<(FX_LPCWSTR c_string)
+{
+ ASSERT(!m_bIsSetting);
+ CJS_Value::operator =(c_string);
+}
+
+void CJS_PropValue::operator >>(CFX_WideString &wide_string) const
+{
+ ASSERT(m_bIsSetting);
+ wide_string = CJS_Value::operator CFX_WideString();
+}
+
+void CJS_PropValue::operator <<(CFX_WideString wide_string)
+{
+ ASSERT(!m_bIsSetting);
+ CJS_Value::operator = (wide_string);
+}
+
+void CJS_PropValue::operator >>(CJS_Array &array) const
+{
+ ASSERT(m_bIsSetting);
+ ConvertToArray(array);
+}
+
+void CJS_PropValue::operator <<(CJS_Array &array)
+{
+ ASSERT(!m_bIsSetting);
+ CJS_Value::operator=(array);
+}
+
+void CJS_PropValue::operator>>(CJS_Date &date) const
+{
+ ASSERT(m_bIsSetting);
+ ConvertToDate(date);
+}
+
+void CJS_PropValue::operator<<(CJS_Date &date)
+{
+ ASSERT(!m_bIsSetting);
+ CJS_Value::operator=(date);
+}
+
+CJS_PropValue::operator v8::Handle<v8::Value>() const
+{
+ return m_pValue;
+}
+
+/* ======================================== CJS_Array ========================================= */
+CJS_Array::CJS_Array(v8::Isolate* isolate):m_isolate(isolate)
+{
+}
+
+CJS_Array::~CJS_Array()
+{
+}
+
+void CJS_Array::Attach(v8::Handle<v8::Array> pArray)
+{
+ m_pArray = pArray;
+}
+
+FX_BOOL CJS_Array::IsAttached()
+{
+ return FALSE;
+}
+
+void CJS_Array::GetElement(unsigned index,CJS_Value &value)
+{
+ if (m_pArray.IsEmpty())
+ return;
+ v8::Handle<v8::Value> p = JS_GetArrayElemnet(m_pArray,index);
+ value.Attach(p,VT_object);
+}
+
+void CJS_Array::SetElement(unsigned index,CJS_Value value)
+{
+ if (m_pArray.IsEmpty())
+ m_pArray = JS_NewArray(m_isolate);
+
+ JS_PutArrayElement(m_pArray,index,value.ToJSValue(),value.GetType());
+}
+
+int CJS_Array::GetLength()
+{
+ if (m_pArray.IsEmpty())
+ return 0;
+ return JS_GetArrayLength(m_pArray);
+}
+
+CJS_Array:: operator v8::Handle<v8::Array>()
+{
+ if (m_pArray.IsEmpty())
+ m_pArray = JS_NewArray(m_isolate);
+
+ return m_pArray;
+}
+
+/* ======================================== CJS_Date ========================================= */
+
+CJS_Date::CJS_Date(v8::Isolate* isolate) :m_isolate(isolate)
+{
+}
+
+CJS_Date::CJS_Date(v8::Isolate* isolate,double dMsec_time)
+{
+ m_isolate = isolate;
+ m_pDate = JS_NewDate(isolate,dMsec_time);
+}
+
+CJS_Date::CJS_Date(v8::Isolate* isolate,int year, int mon, int day,int hour, int min, int sec)
+{
+ m_isolate = isolate;
+ m_pDate = JS_NewDate(isolate,MakeDate(year,mon,day,hour,min,sec,0));
+}
+
+double CJS_Date::MakeDate(int year, int mon, int day,int hour, int min, int sec,int ms)
+{
+ return JS_MakeDate(JS_MakeDay(year,mon,day), JS_MakeTime(hour,min,sec,ms));
+}
+
+CJS_Date::~CJS_Date()
+{
+}
+
+FX_BOOL CJS_Date::IsValidDate()
+{
+ if(m_pDate.IsEmpty()) return FALSE;
+ return !JS_PortIsNan(JS_ToNumber(m_pDate));
+}
+
+void CJS_Date::Attach(v8::Handle<v8::Value> pDate)
+{
+ m_pDate = pDate;
+}
+
+int CJS_Date::GetYear()
+{
+ if (IsValidDate())
+ return JS_GetYearFromTime(JS_LocalTime(JS_ToNumber(m_pDate)));
+
+ return 0;
+}
+
+void CJS_Date::SetYear(int iYear)
+{
+ double date = MakeDate(iYear,GetMonth(),GetDay(),GetHours(),GetMinutes(),GetSeconds(),0);
+ JS_ValueCopy(m_pDate, JS_NewDate(m_isolate,date));
+}
+
+int CJS_Date::GetMonth()
+{
+ if (IsValidDate())
+ return JS_GetMonthFromTime(JS_LocalTime(JS_ToNumber(m_pDate)));
+
+ return 0;
+}
+
+void CJS_Date::SetMonth(int iMonth)
+{
+
+ double date = MakeDate(GetYear(),iMonth,GetDay(),GetHours(),GetMinutes(),GetSeconds(),0);
+ JS_ValueCopy(m_pDate, JS_NewDate(m_isolate,date));
+
+}
+
+int CJS_Date::GetDay()
+{
+ if (IsValidDate())
+ return JS_GetDayFromTime(JS_LocalTime(JS_ToNumber(m_pDate)));
+
+ return 0;
+}
+
+void CJS_Date::SetDay(int iDay)
+{
+
+ double date = MakeDate(GetYear(),GetMonth(),iDay,GetHours(),GetMinutes(),GetSeconds(),0);
+ JS_ValueCopy(m_pDate,JS_NewDate(m_isolate,date));
+
+}
+
+int CJS_Date::GetHours()
+{
+ if (IsValidDate())
+ return JS_GetHourFromTime(JS_LocalTime(JS_ToNumber(m_pDate)));
+
+ return 0;
+}
+
+void CJS_Date::SetHours(int iHours)
+{
+ double date = MakeDate(GetYear(),GetMonth(),GetDay(),iHours,GetMinutes(),GetSeconds(),0);
+ JS_ValueCopy(m_pDate,JS_NewDate(m_isolate,date));
+}
+
+int CJS_Date::GetMinutes()
+{
+ if (IsValidDate())
+ return JS_GetMinFromTime(JS_LocalTime(JS_ToNumber(m_pDate)));
+
+ return 0;
+}
+
+void CJS_Date::SetMinutes(int minutes)
+{
+ double date = MakeDate(GetYear(),GetMonth(),GetDay(),GetHours(),minutes,GetSeconds(),0);
+ JS_ValueCopy(m_pDate,JS_NewDate(m_isolate,date));
+}
+
+int CJS_Date::GetSeconds()
+{
+ if (IsValidDate())
+ return JS_GetSecFromTime(JS_LocalTime(JS_ToNumber(m_pDate)));
+
+ return 0;
+}
+
+void CJS_Date::SetSeconds(int seconds)
+{
+ double date = MakeDate(GetYear(),GetMonth(),GetDay(),GetHours(),GetMinutes(),seconds,0);
+ JS_ValueCopy(m_pDate,JS_NewDate(m_isolate,date));
+}
+
+CJS_Date::operator v8::Handle<v8::Value>()
+{
+ return m_pDate;
+}
+
+CJS_Date::operator double() const
+{
+ if(m_pDate.IsEmpty())
+ return 0.0;
+ return JS_ToNumber(m_pDate);
+}
+
+CFX_WideString CJS_Date::ToString() const
+{
+ if(m_pDate.IsEmpty())
+ return L"";
+ return JS_ToString(m_pDate);
+}
diff --git a/fpdfsdk/src/javascript/PublicMethods.cpp b/fpdfsdk/src/javascript/PublicMethods.cpp
index c39c8a00dd..bd4acaef9a 100644
--- a/fpdfsdk/src/javascript/PublicMethods.cpp
+++ b/fpdfsdk/src/javascript/PublicMethods.cpp
@@ -1,2335 +1,2335 @@
-// 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
-
-#include "../../include/javascript/JavaScript.h"
-#include "../../include/javascript/IJavaScript.h"
-#include "../../include/javascript/JS_Define.h"
-#include "../../include/javascript/JS_Object.h"
-#include "../../include/javascript/JS_Value.h"
-#include "../../include/javascript/PublicMethods.h"
-#include "../../include/javascript/JS_EventHandler.h"
-#include "../../include/javascript/resource.h"
-#include "../../include/javascript/JS_Context.h"
-#include "../../include/javascript/JS_Value.h"
-#include "../../include/javascript/util.h"
-#include "../../include/javascript/Field.h"
-#include "../../include/javascript/color.h"
-#include "../../include/javascript/JS_Runtime.h"
-
-static v8::Isolate* GetIsolate(IFXJS_Context* cc)
-{
- CJS_Context* pContext = (CJS_Context *)cc;
- ASSERT(pContext != NULL);
-
- CJS_Runtime* pRuntime = pContext->GetJSRuntime();
- ASSERT(pRuntime != NULL);
-
- return pRuntime->GetIsolate();
-}
-
-
-/* -------------------------------- CJS_PublicMethods -------------------------------- */
-
-#define DOUBLE_CORRECT 0.000000000000001
-
-BEGIN_JS_STATIC_GLOBAL_FUN(CJS_PublicMethods)
- JS_STATIC_GLOBAL_FUN_ENTRY(AFNumber_Format,6)
- JS_STATIC_GLOBAL_FUN_ENTRY(AFNumber_Keystroke,6)
- JS_STATIC_GLOBAL_FUN_ENTRY(AFPercent_Format,2)
- JS_STATIC_GLOBAL_FUN_ENTRY(AFPercent_Keystroke,2)
- JS_STATIC_GLOBAL_FUN_ENTRY(AFDate_FormatEx,1)
- JS_STATIC_GLOBAL_FUN_ENTRY(AFDate_KeystrokeEx,1)
- JS_STATIC_GLOBAL_FUN_ENTRY(AFDate_Format,1)
- JS_STATIC_GLOBAL_FUN_ENTRY(AFDate_Keystroke,1)
- JS_STATIC_GLOBAL_FUN_ENTRY(AFTime_FormatEx,1)
- JS_STATIC_GLOBAL_FUN_ENTRY(AFTime_KeystrokeEx,1)
- JS_STATIC_GLOBAL_FUN_ENTRY(AFTime_Format,1)
- JS_STATIC_GLOBAL_FUN_ENTRY(AFTime_Keystroke,1)
- JS_STATIC_GLOBAL_FUN_ENTRY(AFSpecial_Format,1)
- JS_STATIC_GLOBAL_FUN_ENTRY(AFSpecial_Keystroke,1)
- JS_STATIC_GLOBAL_FUN_ENTRY(AFSpecial_KeystrokeEx,1)
- JS_STATIC_GLOBAL_FUN_ENTRY(AFSimple,3)
- JS_STATIC_GLOBAL_FUN_ENTRY(AFMakeNumber,1)
- JS_STATIC_GLOBAL_FUN_ENTRY(AFSimple_Calculate,2)
- JS_STATIC_GLOBAL_FUN_ENTRY(AFRange_Validate,4)
- JS_STATIC_GLOBAL_FUN_ENTRY(AFMergeChange,1)
- JS_STATIC_GLOBAL_FUN_ENTRY(AFParseDateEx,2)
- JS_STATIC_GLOBAL_FUN_ENTRY(AFExtractNums,1)
-END_JS_STATIC_GLOBAL_FUN()
-
-IMPLEMENT_JS_STATIC_GLOBAL_FUN(CJS_PublicMethods)
-
-struct stru_TbConvert
-{
- FX_LPCSTR lpszJSMark;
- FX_LPCSTR lpszCppMark;
-};
-
-static const stru_TbConvert fcTable[] = {"mmmm","%B",
- "mmm", "%b",
- "mm", "%m",
- //"m"
- "dddd","%A",
- "ddd", "%a",
- "dd", "%d",
- //"d", "%w",
- "yyyy","%Y",
- "yy", "%y",
- "HH", "%H",
- //"H"
- "hh", "%I",
- //"h"
- "MM", "%M",
- //"M"
- "ss", "%S",
- //"s
- "tt", "%p"
- //"t"
-};
-
-static FX_LPCWSTR months[] =
-{
- (FX_LPCWSTR)L"Jan", (FX_LPCWSTR)L"Feb", (FX_LPCWSTR)L"Mar", (FX_LPCWSTR)L"Apr", (FX_LPCWSTR)L"May", (FX_LPCWSTR)L"Jun", (FX_LPCWSTR)L"Jul", (FX_LPCWSTR)L"Aug", (FX_LPCWSTR)L"Sep", (FX_LPCWSTR)L"Oct", (FX_LPCWSTR)L"Nov", (FX_LPCWSTR)L"Dec"
-};
-
-static FX_LPCWSTR fullmonths[] =
-{
- (FX_LPCWSTR)L"January", (FX_LPCWSTR)L"February", (FX_LPCWSTR)L"March", (FX_LPCWSTR)L"April", (FX_LPCWSTR)L"May", (FX_LPCWSTR)L"June", (FX_LPCWSTR)L"July", (FX_LPCWSTR)L"August", (FX_LPCWSTR)L"September", (FX_LPCWSTR)L"October", (FX_LPCWSTR)L"November", (FX_LPCWSTR)L"December"
-};
-
-FX_BOOL CJS_PublicMethods::IsNumber(FX_LPCWSTR string)
-{
- CFX_WideString sTrim = StrTrim(string);
- FX_LPCWSTR pTrim = sTrim;
- FX_LPCWSTR p = pTrim;
-
-
- FX_BOOL bDot = FALSE;
- FX_BOOL bKXJS = FALSE;
-
- wchar_t c;
- while ((c = *p))
- {
- if (c == '.' || c == ',')
- {
- if (bDot) return FALSE;
- bDot = TRUE;
- }
- else if (c == '-' || c == '+')
- {
- if (p != pTrim)
- return FALSE;
- }
- else if (c == 'e' || c == 'E')
- {
- if (bKXJS) return FALSE;
-
- p++;
- c = *p;
- if (c == '+' || c == '-')
- {
- bKXJS = TRUE;
- }
- else
- {
- return FALSE;
- }
- }
- else if (!IsDigit(c))
- {
- return FALSE;
- }
- p++;
- }
-
- return TRUE;
-}
-
-FX_BOOL CJS_PublicMethods::IsDigit(wchar_t ch)
-{
- return (ch >= L'0' && ch <= L'9');
-}
-
-FX_BOOL CJS_PublicMethods::IsDigit(char ch)
-{
- return (ch >= '0' && ch <= '9');
-}
-
-FX_BOOL CJS_PublicMethods::IsAlphabetic(wchar_t ch)
-{
- return ((ch >= L'a' && ch <= L'z') || (ch >= L'A' && ch <= L'Z'));
-}
-
-FX_BOOL CJS_PublicMethods::IsAlphaNumeric(wchar_t ch)
-{
- return (IsDigit(ch) || IsAlphabetic(ch));
-}
-
-FX_BOOL CJS_PublicMethods::maskSatisfied(wchar_t c_Change,wchar_t c_Mask)
-{
- switch (c_Mask)
- {
- case L'9':
- return IsDigit(c_Change);
- case L'A':
- return IsAlphabetic(c_Change);
- case L'O':
- return IsAlphaNumeric(c_Change);
- case L'X':
- return TRUE;
- default:
- return (c_Change == c_Mask);
- }
-}
-
-FX_BOOL CJS_PublicMethods::isReservedMaskChar(wchar_t ch)
-{
- return ch == L'9' || ch == L'A' || ch == L'O' || ch == L'X';
-}
-
-double CJS_PublicMethods::AF_Simple(FX_LPCWSTR sFuction, double dValue1, double dValue2)
-{
- if (FXSYS_wcsicmp(sFuction,(FX_LPCWSTR)L"AVG") == 0 || FXSYS_wcsicmp(sFuction,(FX_LPCWSTR)L"SUM") == 0)
- {
- return dValue1 + dValue2;
- }
- else if (FXSYS_wcsicmp(sFuction, (FX_LPCWSTR)L"PRD") == 0)
- {
- return dValue1 * dValue2;
- }
- else if (FXSYS_wcsicmp(sFuction,(FX_LPCWSTR)L"MIN") == 0)
- {
- return FX_MIN(dValue1, dValue2);
- }
- else if (FXSYS_wcsicmp(sFuction,(FX_LPCWSTR)L"MAX") == 0)
- {
- return FX_MAX(dValue1, dValue2);
- }
-
- return dValue1;
-}
-
-CFX_WideString CJS_PublicMethods::StrLTrim(FX_LPCWSTR pStr)
-{
- while (*pStr && *pStr == L' ') pStr++;
-
- return pStr;
-}
-
-CFX_WideString CJS_PublicMethods::StrRTrim(FX_LPCWSTR pStr)
-{
- FX_LPCWSTR p = pStr;
-
- while (*p) p++;
- p--;
- if (p >= pStr)
- {
- while (*p && *p == L' ') p--;
- p++;
- return CFX_WideString(pStr,p-pStr);
- }
- return L"";
-}
-
-CFX_WideString CJS_PublicMethods::StrTrim(FX_LPCWSTR pStr)
-{
- return StrRTrim(StrLTrim(pStr));
-}
-
-CFX_ByteString CJS_PublicMethods::StrLTrim(FX_LPCSTR pStr)
-{
- while (*pStr && *pStr == ' ') pStr++;
-
- return pStr;
-}
-
-CFX_ByteString CJS_PublicMethods::StrRTrim(FX_LPCSTR pStr)
-{
- FX_LPCSTR p = pStr;
-
- while (*p) p++;
- p--;
- if (p >= pStr)
- {
- while (*p && *p == ' ') p--;
- p++;
- return CFX_ByteString(pStr,p-pStr);
- }
- return "";
-}
-
-CFX_ByteString CJS_PublicMethods::StrTrim(FX_LPCSTR pStr)
-{
- return StrRTrim(StrLTrim(pStr));
-}
-
-double CJS_PublicMethods::ParseNumber(FX_LPCWSTR swSource, FX_BOOL& bAllDigits, FX_BOOL& bDot, FX_BOOL& bSign, FX_BOOL& bKXJS)
-{
- bDot = FALSE;
- bSign = FALSE;
- bKXJS = FALSE;
-
- FX_BOOL bDigitExist = FALSE;
-
- FX_LPCWSTR p = swSource;
- wchar_t c;
-
- FX_LPCWSTR pStart = NULL;
- FX_LPCWSTR pEnd = NULL;
-
- while ((c = *p))
- {
- if (!pStart && c != L' ')
- {
- pStart = p;
- }
-
- pEnd = p;
- p++;
- }
-
- if (!pStart)
- {
- bAllDigits = FALSE;
- return 0;
- }
-
- while (pEnd != pStart)
- {
- if (*pEnd == L' ')
- pEnd --;
- else
- break;
- }
-
- double dRet = 0;
- p = pStart;
- bAllDigits = TRUE;
- CFX_WideString swDigits;
-
- while (p <= pEnd)
- {
- c = *p;
-
- if (IsDigit(c))
- {
- swDigits += c;
- bDigitExist = TRUE;
- }
- else
- {
- switch (c)
- {
- case L' ':
- bAllDigits = FALSE;
- break;
- case L'.':
- case L',':
- if (!bDot)
- {
- if (bDigitExist)
- {
- swDigits += L'.';
- }
- else
- {
- swDigits += L'0';
- swDigits += L'.';
- bDigitExist = TRUE;
- }
-
- bDot = TRUE;
- break;
- }
- case 'e':
- case 'E':
- if (!bKXJS)
- {
- p++;
- c = *p;
- if (c == '+' || c == '-')
- {
- bKXJS = TRUE;
- swDigits += 'e';
- swDigits += c;
- }
- break;
- }
- case L'-':
- if (!bDigitExist && !bSign)
- {
- swDigits += c;
- bSign = TRUE;
- break;
- }
- default:
- bAllDigits = FALSE;
-
- if (p != pStart && !bDot && bDigitExist)
- {
- swDigits += L'.';
- bDot = TRUE;
- }
- else
- {
- bDot = FALSE;
- bDigitExist = FALSE;
- swDigits = L"";
- }
- break;
- }
- }
-
- p++;
- }
-
- if (swDigits.GetLength() > 0 && swDigits.GetLength() < 17)
- {
- CFX_ByteString sDigits = swDigits.UTF8Encode();
-
- if (bKXJS)
- {
- dRet = atof(sDigits);
- }
- else
- {
- if (bDot)
- {
- char* pStopString;
- dRet = ::strtod(sDigits, &pStopString);
- }
- else
- {
- dRet = atol(sDigits);
- }
- }
-
- }
-
- return dRet;
-}
-
-double CJS_PublicMethods::ParseStringToNumber(FX_LPCWSTR swSource)
-{
- FX_BOOL bAllDigits = FALSE;
- FX_BOOL bDot = FALSE;
- FX_BOOL bSign = FALSE;
- FX_BOOL bKXJS = FALSE;
-
- return ParseNumber(swSource, bAllDigits, bDot, bSign, bKXJS);
-}
-
-FX_BOOL CJS_PublicMethods::ConvertStringToNumber(FX_LPCWSTR swSource, double & dRet, FX_BOOL & bDot)
-{
- FX_BOOL bAllDigits = FALSE;
- FX_BOOL bSign = FALSE;
- FX_BOOL bKXJS = FALSE;
-
- dRet = ParseNumber(swSource, bAllDigits, bDot, bSign, bKXJS);
-
- return bAllDigits;
-}
-
-CJS_Array CJS_PublicMethods::AF_MakeArrayFromList(v8::Isolate* isolate, CJS_Value val)
-{
- CJS_Array StrArray(isolate);
- if(val.IsArrayObject())
- {
- val.ConvertToArray(StrArray);
- return StrArray;
- }
- CFX_WideString wsStr = val.operator CFX_WideString();
- CFX_ByteString t = CFX_ByteString::FromUnicode(wsStr);
- const char * p = (const char *)t;
-
-
- int ch = ',' ;
- int nIndex = 0;
-
- while (*p)
- {
- const char * pTemp = strchr(p, ch);
- if (pTemp == NULL)
- {
- StrArray.SetElement(nIndex, CJS_Value(isolate,(FX_LPCSTR)StrTrim(p)));
- break;
- }
- else
- {
- char * pSub = new char[pTemp - p + 1];
- strncpy(pSub, p, pTemp - p);
- *(pSub + (pTemp - p)) = '\0';
-
- StrArray.SetElement(nIndex, CJS_Value(isolate,(FX_LPCSTR)StrTrim(pSub)));
- delete []pSub;
-
- nIndex ++;
- p = ++pTemp;
- }
-
- }
- return StrArray;
-}
-
-int CJS_PublicMethods::ParseStringInteger(const CFX_WideString& string,int nStart,int& nSkip, int nMaxStep)
-{
- int nRet = 0;
- nSkip = 0;
- for (int i=nStart, sz=string.GetLength(); i < sz; i++)
- {
- if (i-nStart > 10)
- break;
-
- FX_WCHAR c = string.GetAt(i);
- if (IsDigit((wchar_t)c))
- {
- nRet = nRet * 10 + (c - '0');
- nSkip = i - nStart + 1;
- if (nSkip >= nMaxStep)
- break;
- }
- else
- break;
- }
-
- return nRet;
-}
-
-CFX_WideString CJS_PublicMethods::ParseStringString(const CFX_WideString& string, int nStart, int& nSkip)
-{
- CFX_WideString swRet;
- nSkip = 0;
- for (int i=nStart, sz=string.GetLength(); i < sz; i++)
- {
- FX_WCHAR c = string.GetAt(i);
- if ((c >= L'a' && c <= L'z') || (c >= L'A' && c <= L'Z'))
- {
- swRet += c;
- nSkip = i - nStart + 1;
- }
- else
- break;
- }
-
- return swRet;
-}
-
-double CJS_PublicMethods::ParseNormalDate(const CFX_WideString & value, FX_BOOL& bWrongFormat)
-{
- double dt = JS_GetDateTime();
-
- int nYear = JS_GetYearFromTime(dt);
- int nMonth = JS_GetMonthFromTime(dt) + 1;
- int nDay = JS_GetDayFromTime(dt);
- int nHour = JS_GetHourFromTime(dt);
- int nMin = JS_GetMinFromTime(dt);
- int nSec = JS_GetSecFromTime(dt);
-
- int number[3];
-
- int nSkip = 0;
- int nLen = value.GetLength();
- int nIndex = 0;
- int i = 0;
- while (i < nLen)
- {
- if (nIndex > 2) break;
-
- FX_WCHAR c = value.GetAt(i);
- if (IsDigit((wchar_t)c))
- {
- number[nIndex++] = ParseStringInteger(value, i, nSkip, 4);
- i += nSkip;
- }
- else
- {
- i ++;
- }
- }
-
- if (nIndex == 2)
- {
- // case2: month/day
- // case3: day/month
- if ((number[0] >= 1 && number[0] <= 12) && (number[1] >= 1 && number[1] <= 31))
- {
- nMonth = number[0];
- nDay = number[1];
- }
- else if ((number[0] >= 1 && number[0] <= 31) && (number[1] >= 1 && number[1] <= 12))
- {
- nDay = number[0];
- nMonth = number[1];
- }
-
- bWrongFormat = FALSE;
- }
- else if (nIndex == 3)
- {
- // case1: year/month/day
- // case2: month/day/year
- // case3: day/month/year
-
- if (number[0] > 12 && (number[1] >= 1 && number[1] <= 12) && (number[2] >= 1 && number[2] <= 31))
- {
- nYear = number[0];
- nMonth = number[1];
- nDay = number[2];
- }
- else if ((number[0] >= 1 && number[0] <= 12) && (number[1] >= 1 && number[1] <= 31) && number[2] > 31)
- {
- nMonth = number[0];
- nDay = number[1];
- nYear = number[2];
- }
- else if ((number[0] >= 1 && number[0] <= 31) && (number[1] >= 1 && number[1] <= 12) && number[2] > 31)
- {
- nDay = number[0];
- nMonth = number[1];
- nYear = number[2];
- }
-
- bWrongFormat = FALSE;
- }
- else
- {
- bWrongFormat = TRUE;
- return dt;
- }
-
- CFX_WideString swTemp;
- swTemp.Format((FX_LPCWSTR)L"%d/%d/%d %d:%d:%d",nMonth,nDay,nYear,nHour,nMin,nSec);
- return JS_DateParse(swTemp);
-}
-
-double CJS_PublicMethods::MakeRegularDate(const CFX_WideString & value, const CFX_WideString & format, FX_BOOL& bWrongFormat)
-{
- double dt = JS_GetDateTime();
-
- if (format.IsEmpty() || value.IsEmpty())
- return dt;
-
- int nYear = JS_GetYearFromTime(dt);
- int nMonth = JS_GetMonthFromTime(dt) + 1;
- int nDay = JS_GetDayFromTime(dt);
- int nHour = JS_GetHourFromTime(dt);
- int nMin = JS_GetMinFromTime(dt);
- int nSec = JS_GetSecFromTime(dt);
-
- int nYearSub = 99; //nYear - 2000;
-
- FX_BOOL bPm = FALSE;
- FX_BOOL bExit = FALSE;
- bWrongFormat = FALSE;
-
- int i=0;
- int j=0;
-
- while (i < format.GetLength())
- {
- if (bExit) break;
-
- FX_WCHAR c = format.GetAt(i);
- switch (c)
- {
- case ':':
- case '.':
- case '-':
- case '\\':
- case '/':
- i++;
- j++;
- break;
-
- case 'y':
- case 'm':
- case 'd':
- case 'H':
- case 'h':
- case 'M':
- case 's':
- case 't':
- {
- int oldj = j;
- int nSkip = 0;
-
- if (format.GetAt(i+1) != c)
- {
- switch (c)
- {
- case 'y':
- i++;
- j++;
- break;
- case 'm':
- nMonth = ParseStringInteger(value, j, nSkip, 2);
- i++;
- j += nSkip;
- break;
- case 'd':
- nDay = ParseStringInteger(value, j, nSkip, 2);
- i++;
- j += nSkip;
- break;
- case 'H':
- nHour = ParseStringInteger(value, j, nSkip, 2);
- i++;
- j += nSkip;
- break;
- case 'h':
- nHour = ParseStringInteger(value, j, nSkip, 2);
- i++;
- j += nSkip;
- break;
- case 'M':
- nMin = ParseStringInteger(value, j, nSkip, 2);
- i++;
- j += nSkip;
- break;
- case 's':
- nSec = ParseStringInteger(value, j, nSkip, 2);
- i++;
- j += nSkip;
- break;
- case 't':
- bPm = value.GetAt(i) == 'p';
- i++;
- j++;
- break;
- }
- }
- else if (format.GetAt(i+1) == c && format.GetAt(i+2) != c)
- {
- switch (c)
- {
- case 'y':
- nYear = ParseStringInteger(value, j, nSkip, 4);
- i += 2;
- j += nSkip;
- break;
- case 'm':
- nMonth = ParseStringInteger(value, j, nSkip, 2);
- i += 2;
- j += nSkip;
- break;
- case 'd':
- nDay = ParseStringInteger(value, j, nSkip, 2);
- i += 2;
- j += nSkip;
- break;
- case 'H':
- nHour = ParseStringInteger(value, j, nSkip, 2);
- i += 2;
- j += nSkip;
- break;
- case 'h':
- nHour = ParseStringInteger(value, j, nSkip, 2);
- i += 2;
- j += nSkip;
- break;
- case 'M':
- nMin = ParseStringInteger(value, j, nSkip, 2);
- i += 2;
- j += nSkip;
- break;
- case 's':
- nSec = ParseStringInteger(value, j, nSkip, 2);
- i += 2;
- j += nSkip;
- break;
- case 't':
- bPm = (value.GetAt(j) == 'p' && value.GetAt(j+1) == 'm');
- i += 2;
- j += 2;
- break;
- }
- }
- else if (format.GetAt(i+1) == c && format.GetAt(i+2) == c && format.GetAt(i+3) != c)
- {
- switch (c)
- {
- case 'm':
- {
- CFX_WideString sMonth = ParseStringString(value, j, nSkip);
- FX_BOOL bFind = FALSE;
- for (int m = 0; m < 12; m++)
- {
- if (sMonth.CompareNoCase(months[m]) == 0)
- {
- nMonth = m + 1;
- i+=3;
- j+=nSkip;
- bFind = TRUE;
- break;
- }
- }
-
- if (!bFind)
- {
- nMonth = ParseStringInteger(value, j, nSkip, 3);
- i+=3;
- j += nSkip;
- }
- }
- break;
- case 'y':
- break;
- default:
- i+=3;
- j+=3;
- break;
- }
- }
- else if (format.GetAt(i+1) == c && format.GetAt(i+2) == c && format.GetAt(i+3) == c && format.GetAt(i+4) != c)
- {
- switch (c)
- {
-
-
- case 'y':
- nYear = ParseStringInteger(value, j, nSkip, 4);
- j += nSkip;
- i += 4;
- break;
- case 'm':
- {
- FX_BOOL bFind = FALSE;
-
- CFX_WideString sMonth = ParseStringString(value, j, nSkip);
- sMonth.MakeLower();
-
- for (int m = 0; m < 12; m++)
- {
- CFX_WideString sFullMonths = fullmonths[m];
- sFullMonths.MakeLower();
-
- if (sFullMonths.Find(sMonth, 0) != -1)
- {
- nMonth = m + 1;
- i += 4;
- j += nSkip;
- bFind = TRUE;
- break;
- }
- }
-
- if (!bFind)
- {
- nMonth = ParseStringInteger(value, j, nSkip, 4);
- i+=4;
- j += nSkip;
- }
- }
- break;
- default:
- i += 4;
- j += 4;
- break;
- }
- }
- else
- {
- if (format.GetAt(i) != value.GetAt(j))
- {
- bWrongFormat = TRUE;
- bExit = TRUE;
- }
- i++;
- j++;
- }
-
- if (oldj == j)
- {
- bWrongFormat = TRUE;
- bExit = TRUE;
- }
- }
-
- break;
- default:
- if (value.GetLength() <= j)
- {
- bExit = TRUE;
- }
- else if (format.GetAt(i) != value.GetAt(j))
- {
- bWrongFormat = TRUE;
- bExit = TRUE;
- }
-
- i++;
- j++;
- break;
- }
- }
-
- if (bPm) nHour += 12;
-
- if (nYear >= 0 && nYear <= nYearSub)
- nYear += 2000;
-
- if (nMonth < 1 || nMonth > 12)
- bWrongFormat = TRUE;
-
- if (nDay < 1 || nDay > 31)
- bWrongFormat = TRUE;
-
- if (nHour < 0 || nHour > 24)
- bWrongFormat = TRUE;
-
- if (nMin < 0 || nMin > 60)
- bWrongFormat = TRUE;
-
- if (nSec < 0 || nSec > 60)
- bWrongFormat = TRUE;
-
- double dRet = 0;
-
- if (bWrongFormat)
- {
- dRet = ParseNormalDate(value, bWrongFormat);
- }
- else
- {
- dRet = JS_MakeDate(JS_MakeDay(nYear,nMonth - 1,nDay),JS_MakeTime(nHour, nMin, nSec, 0));
-
- if (JS_PortIsNan(dRet))
- {
- dRet = JS_DateParse(value);
- }
- }
-
- if (JS_PortIsNan(dRet))
- {
- dRet = ParseNormalDate(value, bWrongFormat);
- }
-
- return dRet;
-
-}
-
-CFX_WideString CJS_PublicMethods::MakeFormatDate(double dDate, const CFX_WideString & format)
-{
- CFX_WideString sRet = L"",sPart = L"";
-
- int nYear = JS_GetYearFromTime(dDate);
- int nMonth = JS_GetMonthFromTime(dDate) + 1;
- int nDay = JS_GetDayFromTime(dDate);
- int nHour = JS_GetHourFromTime(dDate);
- int nMin = JS_GetMinFromTime(dDate);
- int nSec = JS_GetSecFromTime(dDate);
-
- int i = 0;
- FX_WCHAR c;
- while (i < format.GetLength())
- {
- c = format.GetAt(i);
- sPart = L"";
- switch (c)
- {
- case 'y':
- case 'm':
- case 'd':
- case 'H':
- case 'h':
- case 'M':
- case 's':
- case 't':
- if (format.GetAt(i+1) != c)
- {
- switch (c)
- {
- case 'y':
- sPart += c;
- break;
- case 'm':
- sPart.Format((FX_LPCWSTR)L"%d",nMonth);
- break;
- case 'd':
- sPart.Format((FX_LPCWSTR)L"%d",nDay);
- break;
- case 'H':
- sPart.Format((FX_LPCWSTR)L"%d",nHour);
- break;
- case 'h':
- sPart.Format((FX_LPCWSTR)L"%d",nHour>12?nHour - 12:nHour);
- break;
- case 'M':
- sPart.Format((FX_LPCWSTR)L"%d",nMin);
- break;
- case 's':
- sPart.Format((FX_LPCWSTR)L"%d",nSec);
- break;
- case 't':
- sPart += nHour>12?'p':'a';
- break;
- }
- i++;
- }
- else if (format.GetAt(i+1) == c && format.GetAt(i+2) != c)
- {
- switch (c)
- {
- case 'y':
- sPart.Format((FX_LPCWSTR)L"%02d",nYear - (nYear / 100) * 100);
- break;
- case 'm':
- sPart.Format((FX_LPCWSTR)L"%02d",nMonth);
- break;
- case 'd':
- sPart.Format((FX_LPCWSTR)L"%02d",nDay);
- break;
- case 'H':
- sPart.Format((FX_LPCWSTR)L"%02d",nHour);
- break;
- case 'h':
- sPart.Format((FX_LPCWSTR)L"%02d",nHour>12?nHour - 12:nHour);
- break;
- case 'M':
- sPart.Format((FX_LPCWSTR)L"%02d",nMin);
- break;
- case 's':
- sPart.Format((FX_LPCWSTR)L"%02d",nSec);
- break;
- case 't':
- sPart = nHour>12? (FX_LPCWSTR)L"pm": (FX_LPCWSTR)L"am";
- break;
- }
- i+=2;
- }
- else if (format.GetAt(i+1) == c && format.GetAt(i+2) == c && format.GetAt(i+3) != c)
- {
- switch (c)
- {
- case 'm':
- i+=3;
- if (nMonth > 0&&nMonth <= 12)
- sPart += months[nMonth - 1];
- break;
- default:
- i+=3;
- sPart += c;
- sPart += c;
- sPart += c;
- break;
- }
- }
- else if (format.GetAt(i+1) == c && format.GetAt(i+2) == c && format.GetAt(i+3) == c && format.GetAt(i+4) != c)
- {
- switch (c)
- {
- case 'y':
- sPart.Format((FX_LPCWSTR)L"%04d",nYear);
- i += 4;
- break;
- case 'm':
- i+=4;
- if (nMonth > 0&&nMonth <= 12)
- sPart += fullmonths[nMonth - 1];
- break;
- default:
- i += 4;
- sPart += c;
- sPart += c;
- sPart += c;
- sPart += c;
- break;
- }
- }
- else
- {
- i++;
- sPart += c;
- }
- break;
- default:
- i++;
- sPart += c;
- break;
- }
-
- sRet += sPart;
- }
-
- return sRet;
-}
-
-/* -------------------------------------------------------------------------- */
-
-//function AFNumber_Format(nDec, sepStyle, negStyle, currStyle, strCurrency, bCurrencyPrepend)
-FX_BOOL CJS_PublicMethods::AFNumber_Format(OBJ_METHOD_PARAMS)
-{
-#if _FX_OS_ != _FX_ANDROID_
- v8::Isolate* isolate = ::GetIsolate(cc);
- CJS_Context* pContext = (CJS_Context *)cc;
- ASSERT(pContext != NULL);
- CJS_EventHandler* pEvent = pContext->GetEventHandler();
- ASSERT(pEvent != NULL);
-
- if (params.size() != 6)
- {
- sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return FALSE;
- }
- if(!pEvent->m_pValue)
- return FALSE;
- CFX_WideString& Value = pEvent->Value();
- CFX_ByteString strValue = StrTrim(CFX_ByteString::FromUnicode(Value));
-
- if (strValue.IsEmpty()) return TRUE;
-
- int iDec = params[0];
- int iSepStyle = params[1];
- int iNegStyle = params[2];
- int icurrStyle = params[3]; //it's no use!
- std::wstring wstrCurrency(params[4].operator CFX_WideString());
- FX_BOOL bCurrencyPrepend = params[5];
-
- if (iDec < 0) iDec = -iDec;
-
- if (iSepStyle < 0 || iSepStyle > 3)
- iSepStyle = 0;
-
- if (iNegStyle < 0 || iNegStyle > 3)
- iNegStyle = 0;
-
-
- //////////////////////////////////////////////////////
- //for processing decimal places
- strValue.Replace(",", ".");
- double dValue = atof(strValue);
- if (iDec > 0)
- dValue += DOUBLE_CORRECT;//
-
- int iDec2;
- FX_BOOL bNagative = FALSE;
-
- strValue = fcvt(dValue,iDec,&iDec2,&bNagative);
- if (strValue.IsEmpty())
- {
- dValue = 0;
- strValue = fcvt(dValue,iDec,&iDec2,&bNagative);
- if (strValue.IsEmpty())
- {
- strValue = "0";
- iDec2 = 1;
- }
-
- }
-
- if (iDec2 < 0)
- {
- for (int iNum = 0;iNum < abs(iDec2);iNum++)
- {
- strValue = "0" + strValue;
- }
- iDec2 = 0;
-
- }
- int iMax = strValue.GetLength();
- if (iDec2 > iMax)
- {
- for (int iNum = 0;iNum <= iDec2 - iMax ;iNum++)
- {
- strValue += "0";
- }
- iMax = iDec2+1;
- }
- ///////////////////////////////////////////////////////
- //for processing seperator style
- if (iDec2 < iMax)
- {
- if (iSepStyle == 0 || iSepStyle == 1)
- {
- strValue.Insert(iDec2, '.');
- iMax++;
- }
- else if (iSepStyle == 2 || iSepStyle == 3)
- {
- strValue.Insert(iDec2, ',');
- iMax++;
- }
-
- if (iDec2 == 0)
- strValue.Insert(iDec2, '0');
- }
- if (iSepStyle == 0 || iSepStyle == 2)
- {
- char cSeperator;
- if (iSepStyle == 0)
- cSeperator = ',';
- else
- cSeperator = '.';
-
- int iDecPositive,iDecNagative;
- iDecPositive = iDec2;
- iDecNagative = iDec2;
-
- for (iDecPositive = iDec2 -3; iDecPositive > 0;iDecPositive -= 3)
- {
- strValue.Insert(iDecPositive, cSeperator);
- iMax++;
- }
- }
-
- //////////////////////////////////////////////////////////////////////
- //for processing currency string
-
- Value = CFX_WideString::FromLocal(strValue);
-
- std::wstring strValue2(Value);
-
- if (bCurrencyPrepend)
- strValue2 = wstrCurrency + strValue2;
- else
- strValue2 = strValue2 + wstrCurrency;
-
-
-
- /////////////////////////////////////////////////////////////////////////
- //for processing negative style
- if (bNagative)
- {
- if (iNegStyle == 0)
- {
- strValue2.insert(0,L"-");
- }
- if (iNegStyle == 2 || iNegStyle == 3)
- {
- strValue2.insert(0,L"(");
- strValue2.insert(strValue2.length(),L")");
- }
- if (iNegStyle == 1 || iNegStyle == 3)
- {
- if (Field * fTarget = pEvent->Target_Field())
- {
- CJS_Array arColor(isolate);
- CJS_Value vColElm(isolate);
- vColElm = L"RGB";
- arColor.SetElement(0,vColElm);
- vColElm = 1;
- arColor.SetElement(1,vColElm);
- vColElm = 0;
- arColor.SetElement(2,vColElm);
-
- arColor.SetElement(3,vColElm);
-
- CJS_PropValue vProp(isolate);
- vProp.StartGetting();
- vProp<<arColor;
- vProp.StartSetting();
- fTarget->textColor(cc,vProp,sError);// red
- }
- }
- }
- else
- {
- if (iNegStyle == 1 || iNegStyle == 3)
- {
- if (Field *fTarget = pEvent->Target_Field())
- {
- CJS_Array arColor(isolate);
- CJS_Value vColElm(isolate);
- vColElm = L"RGB";
- arColor.SetElement(0,vColElm);
- vColElm = 0;
- arColor.SetElement(1,vColElm);
- arColor.SetElement(2,vColElm);
- arColor.SetElement(3,vColElm);
-
- CJS_PropValue vProp(isolate);
- vProp.StartGetting();
- fTarget->textColor(cc,vProp,sError);
-
- CJS_Array aProp(isolate);
- vProp.ConvertToArray(aProp);
-
- CPWL_Color crProp;
- CPWL_Color crColor;
- color::ConvertArrayToPWLColor(aProp, crProp);
- color::ConvertArrayToPWLColor(arColor, crColor);
-
- if (crColor != crProp)
- {
- CJS_PropValue vProp2(isolate);
- vProp2.StartGetting();
- vProp2<<arColor;
- vProp2.StartSetting();
- fTarget->textColor(cc,vProp2,sError);
- }
- }
- }
- }
- Value = strValue2.c_str();
-#endif
- return TRUE;
-}
-
-//function AFNumber_Keystroke(nDec, sepStyle, negStyle, currStyle, strCurrency, bCurrencyPrepend)
-FX_BOOL CJS_PublicMethods::AFNumber_Keystroke(OBJ_METHOD_PARAMS)
-{
- CJS_Context* pContext = (CJS_Context *)cc;
- ASSERT(pContext != NULL);
- CJS_EventHandler* pEvent = pContext->GetEventHandler();
- ASSERT(pEvent != NULL);
-
- if(params.size() < 2)
- return FALSE;
- int iSepStyle = params[1];
-
- if (iSepStyle < 0 || iSepStyle > 3)
- iSepStyle = 0;
- if(!pEvent->m_pValue)
- return FALSE;
- CFX_WideString & val = pEvent->Value();
- CFX_WideString & w_strChange = pEvent->Change();
- CFX_WideString w_strValue = val;
-
- if (pEvent->WillCommit())
- {
- CFX_WideString wstrChange = w_strChange;
- CFX_WideString wstrValue = StrLTrim(w_strValue);
- if (wstrValue.IsEmpty())
- return TRUE;
-
- CFX_WideString swTemp = wstrValue;
- swTemp.Replace((FX_LPCWSTR)L",", (FX_LPCWSTR)L".");
- if (!IsNumber(swTemp)) //!(IsNumber(wstrChange) &&
- {
- pEvent->Rc() = FALSE;
- sError = JSGetStringFromID(pContext, IDS_STRING_JSAFNUMBER_KEYSTROKE);
- Alert(pContext, sError);
- return TRUE;
- }
- return TRUE; // it happens after the last keystroke and before validating,
- }
-
- std::wstring w_strValue2 (w_strValue);
- std::wstring w_strChange2(w_strChange);
-
- std::wstring w_strSelected;
- if(-1 != pEvent->SelStart())
- w_strSelected = w_strValue2.substr(pEvent->SelStart(),(pEvent->SelEnd() - pEvent->SelStart()));
- FX_BOOL bHasSign = (w_strValue2.find('-') != -1) && (w_strSelected.find('-') == -1);
- if (bHasSign)
- {
- //can't insert "change" in front to sign postion.
- if (pEvent->SelStart() == 0)
- {
- FX_BOOL &bRc = pEvent->Rc();
- bRc = FALSE;
- return TRUE;
- }
- }
-
- char cSep = L'.';
-
- switch (iSepStyle)
- {
- case 0:
- case 1:
- cSep = L'.';
- break;
- case 2:
- case 3:
- cSep = L',';
- break;
- }
-
- FX_BOOL bHasSep = (w_strValue2.find(cSep) != -1);
- for (std::wstring::iterator it = w_strChange2.begin(); it != w_strChange2.end(); it++)
- {
- if (*it == cSep)
- {
- if (bHasSep)
- {
- FX_BOOL &bRc = pEvent->Rc();
- bRc = FALSE;
- return TRUE;
- }
- else
- {
- bHasSep = TRUE;
- continue;
- }
- }
- if (*it == L'-')
- {
- if (bHasSign)
- {
- FX_BOOL &bRc = pEvent->Rc();
- bRc = FALSE;
- return TRUE;
- }
- else if (it != w_strChange2.begin()) //sign's position is not correct
- {
- FX_BOOL &bRc = pEvent->Rc();
- bRc = FALSE;
- return TRUE;
- }
- else if (pEvent->SelStart() != 0)
- {
- FX_BOOL &bRc = pEvent->Rc();
- bRc = FALSE;
- return TRUE;
- }
- bHasSign = TRUE;
- continue;
- }
-
- if (!IsDigit(*it))
- {
- FX_BOOL &bRc = pEvent->Rc();
- bRc = FALSE;
- return TRUE;
- }
- }
-
-
- std::wstring w_prefix = w_strValue2.substr(0,pEvent->SelStart());
- std::wstring w_postfix;
- if (pEvent->SelEnd()<(int)w_strValue2.length())
- w_postfix = w_strValue2.substr(pEvent->SelEnd());
- w_strValue2 = w_prefix + w_strChange2 + w_postfix;
- w_strValue = w_strValue2.c_str();
- val = w_strValue;
- return TRUE;
-
-}
-
-//function AFPercent_Format(nDec, sepStyle)
-FX_BOOL CJS_PublicMethods::AFPercent_Format(OBJ_METHOD_PARAMS)
-{
-#if _FX_OS_ != _FX_ANDROID_
- CJS_Context* pContext = (CJS_Context *)cc;
- ASSERT(pContext != NULL);
- CJS_EventHandler* pEvent = pContext->GetEventHandler();
- ASSERT(pEvent != NULL);
-
- if (params.size() != 2)
- {
- sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return FALSE;
- }
- if(!pEvent->m_pValue)
- return FALSE;
- CFX_WideString& Value = pEvent->Value();
-
-// HWND hMainFrame = NULL;
-//
-// CPDFSDK_FormFillApp *pApp = pContext->GetReaderApp();
-// ASSERT(pApp);
-// hMainFrame = pApp->GetMainFrameWnd();
-
- CFX_ByteString strValue = StrTrim(CFX_ByteString::FromUnicode(Value));
-
- if (strValue.IsEmpty())
- return TRUE;
-
- int iDec = params[0];
- int iSepStyle = params[1];
-
- //ASSERT(iDec > 0);
- if (iDec < 0)
- iDec = -iDec;
-
- if (iSepStyle < 0 || iSepStyle > 3)
- iSepStyle = 0;
-
-
- //////////////////////////////////////////////////////
- //for processing decimal places
- double dValue = atof(strValue);
- dValue *= 100;
- if (iDec > 0)
- dValue += DOUBLE_CORRECT;//УÕý
-
- int iDec2;
- FX_BOOL bNagative = FALSE;
- strValue = fcvt(dValue,iDec,&iDec2,&bNagative);
- if (strValue.IsEmpty())
- {
- dValue = 0;
- strValue = fcvt(dValue,iDec,&iDec2,&bNagative);
- }
-
- if (iDec2 < 0)
- {
- for (int iNum = 0; iNum < abs(iDec2); iNum++)
- {
- strValue = "0" + strValue;
- }
- iDec2 = 0;
-
- }
- int iMax = strValue.GetLength();
- if (iDec2 > iMax)
- {
- for (int iNum = 0; iNum <= iDec2 - iMax; iNum++)
- {
- strValue += "0";
- }
- iMax = iDec2+1;
- }
- ///////////////////////////////////////////////////////
- //for processing seperator style
- if (iDec2 < iMax)
- {
- if (iSepStyle == 0 || iSepStyle == 1)
- {
- strValue.Insert(iDec2, '.');
- iMax++;
- }
- else if (iSepStyle == 2 || iSepStyle == 3)
- {
- strValue.Insert(iDec2, ',');
- iMax++;
- }
-
- if (iDec2 == 0)
- strValue.Insert(iDec2, '0');
- }
- if (iSepStyle == 0 || iSepStyle == 2)
- {
- char cSeperator;
- if (iSepStyle == 0)
- cSeperator = ',';
- else
- cSeperator = '.';
-
- int iDecPositive,iDecNagative;
- iDecPositive = iDec2;
- iDecNagative = iDec2;
-
- for (iDecPositive = iDec2 -3; iDecPositive > 0; iDecPositive -= 3)
- {
- strValue.Insert(iDecPositive,cSeperator);
- iMax++;
- }
- }
- ////////////////////////////////////////////////////////////////////
- //nagative mark
- if(bNagative)
- strValue = "-" + strValue;
- strValue += "%";
- Value = CFX_WideString::FromLocal(strValue);
-#endif
- return TRUE;
-}
-//AFPercent_Keystroke(nDec, sepStyle)
-FX_BOOL CJS_PublicMethods::AFPercent_Keystroke(OBJ_METHOD_PARAMS)
-{
- return AFNumber_Keystroke(cc,params,vRet,sError);
-}
-
-//function AFDate_FormatEx(cFormat)
-FX_BOOL CJS_PublicMethods::AFDate_FormatEx(OBJ_METHOD_PARAMS)
-{
- CJS_Context* pContext = (CJS_Context *)cc;
- ASSERT(pContext != NULL);
- CJS_EventHandler* pEvent = pContext->GetEventHandler();
- ASSERT(pEvent != NULL);
-
- if (params.size() != 1)
- {
- sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return FALSE;
- }
- if(!pEvent->m_pValue)
- return FALSE;
- CFX_WideString& val = pEvent->Value();
-
- CFX_WideString strValue = val;
- if (strValue.IsEmpty()) return TRUE;
-
- CFX_WideString sFormat = params[0].operator CFX_WideString();
-
- FX_BOOL bWrongFormat = FALSE;
- double dDate = 0.0f;
-
- if(strValue.Find(L"GMT") != -1)
- {
- //for GMT format time
- //such as "Tue Aug 11 14:24:16 GMT+08002009"
- dDate = MakeInterDate(strValue);
- }
- else
- {
- dDate = MakeRegularDate(strValue,sFormat,bWrongFormat);
- }
-
- if (JS_PortIsNan(dDate))
- {
- CFX_WideString swMsg;
- swMsg.Format(JSGetStringFromID(pContext, IDS_STRING_JSPARSEDATE), (FX_LPCWSTR)sFormat);
- Alert(pContext, swMsg);
- return FALSE;
- }
-
- val = MakeFormatDate(dDate,sFormat);
-
- return TRUE;
-}
-
-double CJS_PublicMethods::MakeInterDate(CFX_WideString strValue)
-{
- int nHour;
- int nMin;
- int nSec;
- int nYear;
- int nMonth;
- int nDay;
-
- CFX_WideStringArray wsArray;
- CFX_WideString sMonth = L"";
- CFX_WideString sTemp = L"";
- int nSize = strValue.GetLength();
-
- for(int i = 0; i < nSize; i++)
- {
- FX_WCHAR c = strValue.GetAt(i);
- if(c == L' ' || c == L':')
- {
- wsArray.Add(sTemp);
- sTemp = L"";
- continue;
- }
-
- sTemp += c;
- }
-
- wsArray.Add(sTemp);
- if(wsArray.GetSize() != 8)return 0;
-
- sTemp = wsArray[1];
- if(sTemp.Compare(L"Jan") == 0) nMonth = 1;
- if(sTemp.Compare(L"Feb") == 0) nMonth = 2;
- if(sTemp.Compare(L"Mar") == 0) nMonth = 3;
- if(sTemp.Compare(L"Apr") == 0) nMonth = 4;
- if(sTemp.Compare(L"May") == 0) nMonth = 5;
- if(sTemp.Compare(L"Jun") == 0) nMonth = 6;
- if(sTemp.Compare(L"Jul") == 0) nMonth = 7;
- if(sTemp.Compare(L"Aug") == 0) nMonth = 8;
- if(sTemp.Compare(L"Sep") == 0) nMonth = 9;
- if(sTemp.Compare(L"Oct") == 0) nMonth = 10;
- if(sTemp.Compare(L"Nov") == 0) nMonth = 11;
- if(sTemp.Compare(L"Dec") == 0) nMonth = 12;
-
- nDay = (int)ParseStringToNumber(wsArray[2]);
- nHour = (int)ParseStringToNumber(wsArray[3]);
- nMin = (int)ParseStringToNumber(wsArray[4]);
- nSec = (int)ParseStringToNumber(wsArray[5]);
- nYear = (int)ParseStringToNumber(wsArray[7]);
-
- double dRet = JS_MakeDate(JS_MakeDay(nYear,nMonth - 1,nDay),JS_MakeTime(nHour, nMin, nSec, 0));
-
- if (JS_PortIsNan(dRet))
- {
- dRet = JS_DateParse(strValue);
- }
-
- return dRet;
-}
-
-//AFDate_KeystrokeEx(cFormat)
-FX_BOOL CJS_PublicMethods::AFDate_KeystrokeEx(OBJ_METHOD_PARAMS)
-{
- CJS_Context* pContext = (CJS_Context *)cc;
- ASSERT(pContext != NULL);
- CJS_EventHandler* pEvent = pContext->GetEventHandler();
- ASSERT(pEvent != NULL);
-
- if (params.size() != 1)
- {
- sError = L"AFDate_KeystrokeEx's parameters' size r not correct";
- return FALSE;
- }
-
- if (pEvent->WillCommit())
- {
- if(!pEvent->m_pValue)
- return FALSE;
- CFX_WideString strValue = pEvent->Value();
- if (strValue.IsEmpty()) return TRUE;
-
- CFX_WideString sFormat = params[0].operator CFX_WideString();
-
- FX_BOOL bWrongFormat = FALSE;
- double dRet = MakeRegularDate(strValue,sFormat,bWrongFormat);
- if (bWrongFormat || JS_PortIsNan(dRet))
- {
- CFX_WideString swMsg;
- swMsg.Format(JSGetStringFromID(pContext, IDS_STRING_JSPARSEDATE), (FX_LPCWSTR)sFormat);
- Alert(pContext, swMsg);
- pEvent->Rc() = FALSE;
- return TRUE;
- }
- }
- return TRUE;
-}
-
-FX_BOOL CJS_PublicMethods::AFDate_Format(OBJ_METHOD_PARAMS)
-{
- v8::Isolate* isolate = ::GetIsolate(cc);
-
- if (params.size() != 1)
- {
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
-
- sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return FALSE;
- }
-
- int iIndex = params[0];
- FX_LPCWSTR cFormats[] = {(FX_LPCWSTR)L"m/d", (FX_LPCWSTR)L"m/d/yy", (FX_LPCWSTR)L"mm/dd/yy", (FX_LPCWSTR)L"mm/yy", (FX_LPCWSTR)L"d-mmm", (FX_LPCWSTR)L"d-mmm-yy", (FX_LPCWSTR)L"dd-mmm-yy",
- (FX_LPCWSTR)L"yy-mm-dd", (FX_LPCWSTR)L"mmm-yy", (FX_LPCWSTR)L"mmmm-yy", (FX_LPCWSTR)L"mmm d, yyyy", (FX_LPCWSTR)L"mmmm d, yyyy",
- (FX_LPCWSTR)L"m/d/yy h:MM tt", (FX_LPCWSTR)L"m/d/yy HH:MM" };
-
- ASSERT(iIndex < sizeof(cFormats)/sizeof(FX_LPCWSTR));
-
- if (iIndex < 0)
- iIndex = 0;
- if (iIndex >= sizeof(cFormats)/sizeof(FX_LPCWSTR))
- iIndex = 0;
- CJS_Parameters newParams;
- CJS_Value val(isolate,cFormats[iIndex]);
- newParams.push_back(val);
- return AFDate_FormatEx(cc,newParams,vRet,sError);
-}
-
-//AFDate_KeystrokeEx(cFormat)
-FX_BOOL CJS_PublicMethods::AFDate_Keystroke(OBJ_METHOD_PARAMS)
-{
- v8::Isolate* isolate = ::GetIsolate(cc);
-
- if (params.size() != 1)
- {
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
-
- sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return FALSE;
- }
-
- int iIndex = params[0];
- FX_LPCWSTR cFormats[] = {(FX_LPCWSTR)L"m/d", (FX_LPCWSTR)L"m/d/yy", (FX_LPCWSTR)L"mm/dd/yy", (FX_LPCWSTR)L"mm/yy", (FX_LPCWSTR)L"d-mmm", (FX_LPCWSTR)L"d-mmm-yy", (FX_LPCWSTR)L"dd-mmm-yy",
- (FX_LPCWSTR)L"yy-mm-dd", (FX_LPCWSTR)L"mmm-yy", (FX_LPCWSTR)L"mmmm-yy", (FX_LPCWSTR)L"mmm d, yyyy", (FX_LPCWSTR)L"mmmm d, yyyy",
- (FX_LPCWSTR)L"m/d/yy h:MM tt", (FX_LPCWSTR)L"m/d/yy HH:MM" };
-
- ASSERT(iIndex<sizeof(cFormats)/sizeof(FX_LPCWSTR));
-
- if (iIndex < 0)
- iIndex = 0;
- if (iIndex >= sizeof(cFormats)/sizeof(FX_LPCWSTR))
- iIndex = 0;
- CJS_Parameters newParams;
- CJS_Value val(isolate,cFormats[iIndex]);
- newParams.push_back(val);
- return AFDate_KeystrokeEx(cc,newParams,vRet,sError);
-}
-
-//function AFTime_Format(ptf)
-FX_BOOL CJS_PublicMethods::AFTime_Format(OBJ_METHOD_PARAMS)
-{
- v8::Isolate* isolate = ::GetIsolate(cc);
-
- if (params.size() != 1)
- {
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
- sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return FALSE;
- }
-
- int iIndex = params[0];
- FX_LPCWSTR cFormats[] = {(FX_LPCWSTR)L"HH:MM", (FX_LPCWSTR)L"h:MM tt", (FX_LPCWSTR)L"HH:MM:ss", (FX_LPCWSTR)L"h:MM:ss tt"};
-
- ASSERT(iIndex<sizeof(cFormats)/sizeof(FX_LPCWSTR));
-
- if (iIndex < 0)
- iIndex = 0;
- if (iIndex >= sizeof(cFormats)/sizeof(FX_LPCWSTR))
- iIndex = 0;
- CJS_Parameters newParams;
- CJS_Value val(isolate,cFormats[iIndex]);
- newParams.push_back(val);
- return AFDate_FormatEx(cc,newParams,vRet,sError);
-}
-
-FX_BOOL CJS_PublicMethods::AFTime_Keystroke(OBJ_METHOD_PARAMS)
-{
- v8::Isolate* isolate = ::GetIsolate(cc);
- if (params.size() != 1)
- {
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
- sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return FALSE;
- }
-
- int iIndex = params[0];
- FX_LPCWSTR cFormats[] = {(FX_LPCWSTR)L"HH:MM", (FX_LPCWSTR)L"h:MM tt", (FX_LPCWSTR)L"HH:MM:ss", (FX_LPCWSTR)L"h:MM:ss tt"};
-
- ASSERT(iIndex<sizeof(cFormats)/sizeof(FX_LPCWSTR));
-
- if (iIndex < 0)
- iIndex = 0;
- if (iIndex >= sizeof(cFormats)/sizeof(FX_LPCWSTR))
- iIndex = 0;
- CJS_Parameters newParams;
- CJS_Value val(isolate,cFormats[iIndex]);
- newParams.push_back(val);
- return AFDate_KeystrokeEx(cc,newParams,vRet,sError);
-}
-
-FX_BOOL CJS_PublicMethods::AFTime_FormatEx(OBJ_METHOD_PARAMS)
-{
- return AFDate_FormatEx(cc,params,vRet,sError);
-}
-
-FX_BOOL CJS_PublicMethods::AFTime_KeystrokeEx(OBJ_METHOD_PARAMS)
-{
- return AFDate_KeystrokeEx(cc,params,vRet,sError);
-}
-
-//function AFSpecial_Format(psf)
-FX_BOOL CJS_PublicMethods::AFSpecial_Format(OBJ_METHOD_PARAMS)
-{
- CJS_Context* pContext = (CJS_Context *)cc;
- ASSERT(pContext != NULL);
-
- if (params.size() != 1)
- {
- sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return FALSE;
- }
-
- std::string cFormat;
- int iIndex = params[0];
-
- CJS_EventHandler* pEvent = pContext->GetEventHandler();
- ASSERT(pEvent != NULL);
-
- if(!pEvent->m_pValue)
- return FALSE;
- CFX_WideString& Value = pEvent->Value();
- std::string strSrc = (FX_LPCSTR)CFX_ByteString::FromUnicode(Value);
-
- switch (iIndex)
- {
- case 0:
- cFormat = "99999";
- break;
- case 1:
- cFormat = "99999-9999";
- break;
- case 2:
- {
- std::string NumberStr;
- util::printx("9999999999", strSrc,NumberStr);
- if (NumberStr.length() >= 10 )
- cFormat = "(999) 999-9999";
- else
- cFormat = "999-9999";
- break;
- }
- case 3:
- cFormat = "999-99-9999";
- break;
- }
-
- std::string strDes;
- util::printx(cFormat,strSrc,strDes);
- Value = CFX_WideString::FromLocal(strDes.c_str());
- return TRUE;
-}
-
-
-//function AFSpecial_KeystrokeEx(mask)
-FX_BOOL CJS_PublicMethods::AFSpecial_KeystrokeEx(OBJ_METHOD_PARAMS)
-{
- CJS_Context* pContext = (CJS_Context *)cc;
- ASSERT(pContext != NULL);
- CJS_EventHandler* pEvent = pContext->GetEventHandler();
-
- ASSERT(pEvent != NULL);
-
- if (params.size() < 1)
- {
- sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return FALSE;
- }
-
- if(!pEvent->m_pValue)
- return FALSE;
- CFX_WideString& valEvent = pEvent->Value();
-
- CFX_WideString wstrMask = params[0].operator CFX_WideString();
- if (wstrMask.IsEmpty()) return TRUE;
-
- std::wstring wstrValue(valEvent);
-
- if (pEvent->WillCommit())
- {
- if (wstrValue.empty())
- return TRUE;
- int iIndexMask = 0;
- for (std::wstring::iterator it = wstrValue.begin(); it != wstrValue.end(); it++)
- {
- wchar_t w_Value = *it;
- if (!maskSatisfied(w_Value,wstrMask[iIndexMask]))
- break;
- iIndexMask++;
- }
-
- if (iIndexMask != wstrMask.GetLength() || (iIndexMask != wstrValue.size() && wstrMask.GetLength() != 0))
- {
- Alert(pContext, JSGetStringFromID(pContext, IDS_STRING_JSAFNUMBER_KEYSTROKE));
- pEvent->Rc() = FALSE;
- }
- return TRUE;
- }
-
-
- CFX_WideString &wideChange = pEvent->Change();
- std::wstring wChange(wideChange);
-
- if (wChange.empty())
- return TRUE;
- int iIndexMask = pEvent->SelStart();
- //iIndexMask++;
-
-
- if (wstrValue.length() - (pEvent->SelEnd()-pEvent->SelStart()) + wChange.length() > (FX_DWORD)wstrMask.GetLength())
- {
- Alert(pContext, JSGetStringFromID(pContext, IDS_STRING_JSPARAM_TOOLONG));
- pEvent->Rc() = FALSE;
- return TRUE;
- }
-
-
- if (iIndexMask >= wstrMask.GetLength() && (!wChange.empty()))
- {
- Alert(pContext, JSGetStringFromID(pContext, IDS_STRING_JSPARAM_TOOLONG));
- pEvent->Rc() = FALSE;
- return TRUE;
- }
-
- for (std::wstring::iterator it = wChange.begin(); it != wChange.end(); it++)
- {
- if (iIndexMask >= wstrMask.GetLength())
- {
- Alert(pContext, JSGetStringFromID(pContext, IDS_STRING_JSPARAM_TOOLONG));
- pEvent->Rc() = FALSE;
- return TRUE;
- }
- wchar_t w_Mask = wstrMask[iIndexMask];
- if (!isReservedMaskChar(w_Mask))
- {
- //wChange.insert(it,w_Mask);
- *it = w_Mask;
- }
- wchar_t w_Change = *it;
-
- if (!maskSatisfied(w_Change,w_Mask))
- {
- pEvent->Rc() = FALSE;
- return TRUE;
- }
- iIndexMask++;
- }
-
- wideChange = wChange.c_str();
-
- return TRUE;
-}
-
-
-//function AFSpecial_Keystroke(psf)
-FX_BOOL CJS_PublicMethods::AFSpecial_Keystroke(OBJ_METHOD_PARAMS)
-{
- v8::Isolate* isolate = ::GetIsolate(cc);
-
- CJS_Context* pContext = (CJS_Context *)cc;
- ASSERT(pContext != NULL);
- CJS_EventHandler* pEvent = pContext->GetEventHandler();
- ASSERT(pEvent != NULL);
-
- if (params.size() != 1)
- {
- sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return FALSE;
- }
-
- std::string cFormat;
- int iIndex = (int)params[0];
-
- if(!pEvent->m_pValue)
- return FALSE;
- //CJS_Value val = pEvent->Value();
- CFX_WideString& val = pEvent->Value();
- std::string strSrc = (FX_LPCSTR)CFX_ByteString::FromUnicode(val);
- std::wstring wstrChange(pEvent->Change());
-
- switch (iIndex)
- {
- case 0:
- cFormat = "99999";
- break;
- case 1:
- //cFormat = "99999-9999";
- cFormat = "999999999";
- break;
- case 2:
- {
- std::string NumberStr;
- util::printx("9999999999", strSrc,NumberStr);
- if (strSrc.length() + wstrChange.length() > 7 )
- //cFormat = "(999) 999-9999";
- cFormat = "9999999999";
- else
- //cFormat = "999-9999";
- cFormat = "9999999";
- break;
- }
- case 3:
- //cFormat = "999-99-9999";
- cFormat = "999999999";
- break;
- }
-
- CJS_Parameters params2;
- CJS_Value vMask(isolate, cFormat.c_str());
- params2.push_back(vMask);
-
- return AFSpecial_KeystrokeEx(cc,params2,vRet,sError);
-}
-
-FX_BOOL CJS_PublicMethods::AFMergeChange(OBJ_METHOD_PARAMS)
-{
- CJS_Context* pContext = (CJS_Context *)cc;
- ASSERT(pContext != NULL);
- CJS_EventHandler* pEventHandler = pContext->GetEventHandler();
- ASSERT(pEventHandler != NULL);
-
- if (params.size() != 1)
- {
- sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return FALSE;
- }
-
- CFX_WideString swValue;
- if (pEventHandler->m_pValue != NULL)
- swValue = pEventHandler->Value();
-
- if (pEventHandler->WillCommit())
- {
- vRet = swValue;
- return TRUE;
- }
-
- CFX_WideString prefix,postfix;
-
- if (pEventHandler->SelStart() >= 0)
- prefix = swValue.Mid(0,pEventHandler->SelStart());
- else
- prefix = L"";
-
-
- if (pEventHandler->SelEnd() >= 0 && pEventHandler->SelEnd() <= swValue.GetLength())
- postfix = swValue.Mid(pEventHandler->SelEnd(), swValue.GetLength() - pEventHandler->SelEnd());
- else postfix = L"";
-
- vRet = prefix + pEventHandler->Change() + postfix;
-
- return TRUE;
-}
-
-FX_BOOL CJS_PublicMethods::AFParseDateEx(OBJ_METHOD_PARAMS)
-{
- CJS_Context* pContext = (CJS_Context *)cc;
- ASSERT(pContext != NULL);
-
- if (params.size() != 2)
- {
- sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return FALSE;
- }
-
- CFX_WideString sValue = params[0].operator CFX_WideString();
- CFX_WideString sFormat = params[1].operator CFX_WideString();
-
- FX_BOOL bWrongFormat = FALSE;
- double dDate = MakeRegularDate(sValue,sFormat,bWrongFormat);
-
- if (JS_PortIsNan(dDate))
- {
- CFX_WideString swMsg;
- swMsg.Format(JSGetStringFromID(pContext, IDS_STRING_JSPARSEDATE), (FX_LPCWSTR)sFormat);
- Alert((CJS_Context *)cc, swMsg);
- return FALSE;
- }
-
- vRet = dDate;
-
- return TRUE;
-}
-
-FX_BOOL CJS_PublicMethods::AFSimple(OBJ_METHOD_PARAMS)
-{
- if (params.size() != 3)
- {
- CJS_Context* pContext = (CJS_Context *)cc;
- ASSERT(pContext != NULL);
-
- sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return FALSE;
- }
-
- vRet = (double)AF_Simple(params[0].operator CFX_WideString(), (double)params[1], (double)params[2]);
- return TRUE;
-}
-
-FX_BOOL CJS_PublicMethods::AFMakeNumber(OBJ_METHOD_PARAMS)
-{
- if (params.size() != 1)
- {
- CJS_Context* pContext = (CJS_Context *)cc;
- ASSERT(pContext != NULL);
-
- sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return FALSE;
- }
- vRet = ParseStringToNumber(params[0].operator CFX_WideString());
- return TRUE;
-}
-
-FX_BOOL CJS_PublicMethods::AFSimple_Calculate(OBJ_METHOD_PARAMS)
-{
- v8::Isolate* isolate = ::GetIsolate(cc);
-
- CJS_Context* pContext = (CJS_Context *)cc;
- ASSERT(pContext != NULL);
-
- if (params.size() != 2)
- {
- sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return FALSE;
- }
-
- CJS_Value params1 = params[1];
-
- if (!params1.IsArrayObject() && params1.GetType() != VT_string)
- {
- sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return FALSE;
- }
-
- CPDFSDK_Document* pReaderDoc = pContext->GetReaderDocument();
- ASSERT(pReaderDoc != NULL);
-
- CPDFSDK_InterForm* pReaderInterForm = pReaderDoc->GetInterForm();
- ASSERT(pReaderInterForm != NULL);
-
- CPDF_InterForm* pInterForm = pReaderInterForm->GetInterForm();
- ASSERT(pInterForm != NULL);
-
- double dValue;
- CFX_WideString sFunction = params[0].operator CFX_WideString();
- if (wcscmp(sFunction, L"PRD") == 0)
- dValue = 1.0;
- else
- dValue = 0.0;
-
- CJS_Array FieldNameArray = AF_MakeArrayFromList(isolate,params1);
-
- int nFieldsCount = 0;
-
- for (int i=0,isz=FieldNameArray.GetLength(); i<isz; i++)
- {
- CJS_Value jsValue(isolate);
- FieldNameArray.GetElement(i,jsValue);
- CFX_WideString wsFieldName = jsValue.operator CFX_WideString();
-
- for (int j=0,jsz=pInterForm->CountFields(wsFieldName); j<jsz; j++)
- {
- if (CPDF_FormField* pFormField = pInterForm->GetField(j, wsFieldName))
- {
- double dTemp = 0.0;
-
- switch (pFormField->GetFieldType())
- {
- case FIELDTYPE_TEXTFIELD:
- case FIELDTYPE_COMBOBOX:
- {
- dTemp = ParseStringToNumber(pFormField->GetValue());
- break;
- }
- case FIELDTYPE_PUSHBUTTON:
- {
- dTemp = 0.0;
- break;
- }
- case FIELDTYPE_CHECKBOX:
- case FIELDTYPE_RADIOBUTTON:
- {
- dTemp = 0.0;
- for (int c=0,csz=pFormField->CountControls(); c<csz; c++)
- {
- if (CPDF_FormControl* pFormCtrl = pFormField->GetControl(c))
- {
- if (pFormCtrl->IsChecked())
- {
- dTemp += ParseStringToNumber(pFormCtrl->GetExportValue());
- break;
- }
- else
- continue;
- }
- }
- break;
- }
- case FIELDTYPE_LISTBOX:
- {
- dTemp = 0.0;
- if (pFormField->CountSelectedItems() > 1)
- break;
- else
- {
- dTemp = ParseStringToNumber(pFormField->GetValue());
- break;
- }
- }
- default:
- break;
- }
-
- if (i == 0 && j == 0 && (wcscmp(sFunction,L"MIN") == 0 || wcscmp(sFunction, L"MAX") == 0))
- dValue = dTemp;
-
- dValue = AF_Simple(sFunction, dValue, dTemp);
-
- nFieldsCount++;
- }
- }
- }
-
- if (wcscmp(sFunction, L"AVG") == 0 && nFieldsCount > 0)
- dValue /= nFieldsCount;
-
- dValue = (double)floor(dValue * FXSYS_pow((double)10,(double)6) + 0.49) / FXSYS_pow((double)10,(double)6);
- CJS_Value jsValue(isolate,dValue);
- if((CJS_EventHandler*)pContext->GetEventHandler()->m_pValue)
- ((CJS_EventHandler*)pContext->GetEventHandler())->Value() = jsValue;
-
- return TRUE;
-}
-
-/* This function validates the current event to ensure that its value is
-** within the specified range. */
-
-FX_BOOL CJS_PublicMethods::AFRange_Validate(OBJ_METHOD_PARAMS)
-{
- CJS_Context* pContext = (CJS_Context *)cc;
- ASSERT(pContext != NULL);
- CJS_EventHandler* pEvent = pContext->GetEventHandler();
- ASSERT(pEvent != NULL);
-
- if (params.size() != 4)
- {
- sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return FALSE;
- }
-
- if(!pEvent->m_pValue)
- return FALSE;
- if (pEvent->Value().IsEmpty() )
- return TRUE;
- double dEentValue = atof(CFX_ByteString::FromUnicode(pEvent->Value()));
- FX_BOOL bGreaterThan, bLessThan;
- double dGreaterThan, dLessThan;
- bGreaterThan = (FX_BOOL)params[0];
- CFX_WideString swMsg;
- dGreaterThan = (double)params[1];
- bLessThan = (FX_BOOL)params[2];
- dLessThan = (double)params[3];
-
- if (bGreaterThan && bLessThan)
- {
- if (dEentValue < dGreaterThan || dEentValue > dLessThan)
- swMsg.Format(JSGetStringFromID(pContext, IDS_STRING_JSRANGE1),(FX_LPCWSTR)params[1].operator CFX_WideString(), (FX_LPCWSTR)params[3].operator CFX_WideString());
- }
- else if (bGreaterThan)
- {
- if (dEentValue < dGreaterThan)
- swMsg.Format(JSGetStringFromID(pContext, IDS_STRING_JSRANGE2), (FX_LPCWSTR)params[1].operator CFX_WideString());
- }
- else if (bLessThan)
- {
- if (dEentValue > dLessThan)
- swMsg.Format(JSGetStringFromID(pContext, IDS_STRING_JSRANGE3), (FX_LPCWSTR)params[3].operator CFX_WideString());
- }
-
- if (!swMsg.IsEmpty())
- {
- Alert(pContext, swMsg);
- pEvent->Rc() = FALSE;
- }
- return TRUE;
-}
-
-FX_BOOL CJS_PublicMethods::AFExtractNums(OBJ_METHOD_PARAMS)
-{
- v8::Isolate* isolate = ::GetIsolate(cc);
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
-
- if (params.size() != 1)
- {
- sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
- return FALSE;
- }
-
- CJS_Array nums(isolate);
-
- CFX_WideString str = params[0].operator CFX_WideString();
- CFX_WideString sPart;
-
- if (str.GetAt(0) == L'.' || str.GetAt(0) == L',')
- str = L"0" + str;
-
- int nIndex = 0;
- for (int i=0, sz=str.GetLength(); i<sz; i++)
- {
- FX_WCHAR wc = str.GetAt(i);
- if (IsDigit((wchar_t)wc))
- {
- sPart += wc;
- }
- else
- {
- if (sPart.GetLength() > 0)
- {
- nums.SetElement(nIndex,CJS_Value(isolate,(FX_LPCWSTR)sPart));
- sPart = L"";
- nIndex ++;
- }
- }
- }
-
- if (sPart.GetLength() > 0)
- {
- nums.SetElement(nIndex,CJS_Value(isolate,(FX_LPCWSTR)sPart));
- }
-
- if (nums.GetLength() > 0)
- vRet = nums;
- else
- vRet.SetNull();
-
- return TRUE;
-}
+// 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
+
+#include "../../include/javascript/JavaScript.h"
+#include "../../include/javascript/IJavaScript.h"
+#include "../../include/javascript/JS_Define.h"
+#include "../../include/javascript/JS_Object.h"
+#include "../../include/javascript/JS_Value.h"
+#include "../../include/javascript/PublicMethods.h"
+#include "../../include/javascript/JS_EventHandler.h"
+#include "../../include/javascript/resource.h"
+#include "../../include/javascript/JS_Context.h"
+#include "../../include/javascript/JS_Value.h"
+#include "../../include/javascript/util.h"
+#include "../../include/javascript/Field.h"
+#include "../../include/javascript/color.h"
+#include "../../include/javascript/JS_Runtime.h"
+
+static v8::Isolate* GetIsolate(IFXJS_Context* cc)
+{
+ CJS_Context* pContext = (CJS_Context *)cc;
+ ASSERT(pContext != NULL);
+
+ CJS_Runtime* pRuntime = pContext->GetJSRuntime();
+ ASSERT(pRuntime != NULL);
+
+ return pRuntime->GetIsolate();
+}
+
+
+/* -------------------------------- CJS_PublicMethods -------------------------------- */
+
+#define DOUBLE_CORRECT 0.000000000000001
+
+BEGIN_JS_STATIC_GLOBAL_FUN(CJS_PublicMethods)
+ JS_STATIC_GLOBAL_FUN_ENTRY(AFNumber_Format,6)
+ JS_STATIC_GLOBAL_FUN_ENTRY(AFNumber_Keystroke,6)
+ JS_STATIC_GLOBAL_FUN_ENTRY(AFPercent_Format,2)
+ JS_STATIC_GLOBAL_FUN_ENTRY(AFPercent_Keystroke,2)
+ JS_STATIC_GLOBAL_FUN_ENTRY(AFDate_FormatEx,1)
+ JS_STATIC_GLOBAL_FUN_ENTRY(AFDate_KeystrokeEx,1)
+ JS_STATIC_GLOBAL_FUN_ENTRY(AFDate_Format,1)
+ JS_STATIC_GLOBAL_FUN_ENTRY(AFDate_Keystroke,1)
+ JS_STATIC_GLOBAL_FUN_ENTRY(AFTime_FormatEx,1)
+ JS_STATIC_GLOBAL_FUN_ENTRY(AFTime_KeystrokeEx,1)
+ JS_STATIC_GLOBAL_FUN_ENTRY(AFTime_Format,1)
+ JS_STATIC_GLOBAL_FUN_ENTRY(AFTime_Keystroke,1)
+ JS_STATIC_GLOBAL_FUN_ENTRY(AFSpecial_Format,1)
+ JS_STATIC_GLOBAL_FUN_ENTRY(AFSpecial_Keystroke,1)
+ JS_STATIC_GLOBAL_FUN_ENTRY(AFSpecial_KeystrokeEx,1)
+ JS_STATIC_GLOBAL_FUN_ENTRY(AFSimple,3)
+ JS_STATIC_GLOBAL_FUN_ENTRY(AFMakeNumber,1)
+ JS_STATIC_GLOBAL_FUN_ENTRY(AFSimple_Calculate,2)
+ JS_STATIC_GLOBAL_FUN_ENTRY(AFRange_Validate,4)
+ JS_STATIC_GLOBAL_FUN_ENTRY(AFMergeChange,1)
+ JS_STATIC_GLOBAL_FUN_ENTRY(AFParseDateEx,2)
+ JS_STATIC_GLOBAL_FUN_ENTRY(AFExtractNums,1)
+END_JS_STATIC_GLOBAL_FUN()
+
+IMPLEMENT_JS_STATIC_GLOBAL_FUN(CJS_PublicMethods)
+
+struct stru_TbConvert
+{
+ FX_LPCSTR lpszJSMark;
+ FX_LPCSTR lpszCppMark;
+};
+
+static const stru_TbConvert fcTable[] = {"mmmm","%B",
+ "mmm", "%b",
+ "mm", "%m",
+ //"m"
+ "dddd","%A",
+ "ddd", "%a",
+ "dd", "%d",
+ //"d", "%w",
+ "yyyy","%Y",
+ "yy", "%y",
+ "HH", "%H",
+ //"H"
+ "hh", "%I",
+ //"h"
+ "MM", "%M",
+ //"M"
+ "ss", "%S",
+ //"s
+ "tt", "%p"
+ //"t"
+};
+
+static FX_LPCWSTR months[] =
+{
+ (FX_LPCWSTR)L"Jan", (FX_LPCWSTR)L"Feb", (FX_LPCWSTR)L"Mar", (FX_LPCWSTR)L"Apr", (FX_LPCWSTR)L"May", (FX_LPCWSTR)L"Jun", (FX_LPCWSTR)L"Jul", (FX_LPCWSTR)L"Aug", (FX_LPCWSTR)L"Sep", (FX_LPCWSTR)L"Oct", (FX_LPCWSTR)L"Nov", (FX_LPCWSTR)L"Dec"
+};
+
+static FX_LPCWSTR fullmonths[] =
+{
+ (FX_LPCWSTR)L"January", (FX_LPCWSTR)L"February", (FX_LPCWSTR)L"March", (FX_LPCWSTR)L"April", (FX_LPCWSTR)L"May", (FX_LPCWSTR)L"June", (FX_LPCWSTR)L"July", (FX_LPCWSTR)L"August", (FX_LPCWSTR)L"September", (FX_LPCWSTR)L"October", (FX_LPCWSTR)L"November", (FX_LPCWSTR)L"December"
+};
+
+FX_BOOL CJS_PublicMethods::IsNumber(FX_LPCWSTR string)
+{
+ CFX_WideString sTrim = StrTrim(string);
+ FX_LPCWSTR pTrim = sTrim;
+ FX_LPCWSTR p = pTrim;
+
+
+ FX_BOOL bDot = FALSE;
+ FX_BOOL bKXJS = FALSE;
+
+ wchar_t c;
+ while ((c = *p))
+ {
+ if (c == '.' || c == ',')
+ {
+ if (bDot) return FALSE;
+ bDot = TRUE;
+ }
+ else if (c == '-' || c == '+')
+ {
+ if (p != pTrim)
+ return FALSE;
+ }
+ else if (c == 'e' || c == 'E')
+ {
+ if (bKXJS) return FALSE;
+
+ p++;
+ c = *p;
+ if (c == '+' || c == '-')
+ {
+ bKXJS = TRUE;
+ }
+ else
+ {
+ return FALSE;
+ }
+ }
+ else if (!IsDigit(c))
+ {
+ return FALSE;
+ }
+ p++;
+ }
+
+ return TRUE;
+}
+
+FX_BOOL CJS_PublicMethods::IsDigit(wchar_t ch)
+{
+ return (ch >= L'0' && ch <= L'9');
+}
+
+FX_BOOL CJS_PublicMethods::IsDigit(char ch)
+{
+ return (ch >= '0' && ch <= '9');
+}
+
+FX_BOOL CJS_PublicMethods::IsAlphabetic(wchar_t ch)
+{
+ return ((ch >= L'a' && ch <= L'z') || (ch >= L'A' && ch <= L'Z'));
+}
+
+FX_BOOL CJS_PublicMethods::IsAlphaNumeric(wchar_t ch)
+{
+ return (IsDigit(ch) || IsAlphabetic(ch));
+}
+
+FX_BOOL CJS_PublicMethods::maskSatisfied(wchar_t c_Change,wchar_t c_Mask)
+{
+ switch (c_Mask)
+ {
+ case L'9':
+ return IsDigit(c_Change);
+ case L'A':
+ return IsAlphabetic(c_Change);
+ case L'O':
+ return IsAlphaNumeric(c_Change);
+ case L'X':
+ return TRUE;
+ default:
+ return (c_Change == c_Mask);
+ }
+}
+
+FX_BOOL CJS_PublicMethods::isReservedMaskChar(wchar_t ch)
+{
+ return ch == L'9' || ch == L'A' || ch == L'O' || ch == L'X';
+}
+
+double CJS_PublicMethods::AF_Simple(FX_LPCWSTR sFuction, double dValue1, double dValue2)
+{
+ if (FXSYS_wcsicmp(sFuction,(FX_LPCWSTR)L"AVG") == 0 || FXSYS_wcsicmp(sFuction,(FX_LPCWSTR)L"SUM") == 0)
+ {
+ return dValue1 + dValue2;
+ }
+ else if (FXSYS_wcsicmp(sFuction, (FX_LPCWSTR)L"PRD") == 0)
+ {
+ return dValue1 * dValue2;
+ }
+ else if (FXSYS_wcsicmp(sFuction,(FX_LPCWSTR)L"MIN") == 0)
+ {
+ return FX_MIN(dValue1, dValue2);
+ }
+ else if (FXSYS_wcsicmp(sFuction,(FX_LPCWSTR)L"MAX") == 0)
+ {
+ return FX_MAX(dValue1, dValue2);
+ }
+
+ return dValue1;
+}
+
+CFX_WideString CJS_PublicMethods::StrLTrim(FX_LPCWSTR pStr)
+{
+ while (*pStr && *pStr == L' ') pStr++;
+
+ return pStr;
+}
+
+CFX_WideString CJS_PublicMethods::StrRTrim(FX_LPCWSTR pStr)
+{
+ FX_LPCWSTR p = pStr;
+
+ while (*p) p++;
+ p--;
+ if (p >= pStr)
+ {
+ while (*p && *p == L' ') p--;
+ p++;
+ return CFX_WideString(pStr,p-pStr);
+ }
+ return L"";
+}
+
+CFX_WideString CJS_PublicMethods::StrTrim(FX_LPCWSTR pStr)
+{
+ return StrRTrim(StrLTrim(pStr));
+}
+
+CFX_ByteString CJS_PublicMethods::StrLTrim(FX_LPCSTR pStr)
+{
+ while (*pStr && *pStr == ' ') pStr++;
+
+ return pStr;
+}
+
+CFX_ByteString CJS_PublicMethods::StrRTrim(FX_LPCSTR pStr)
+{
+ FX_LPCSTR p = pStr;
+
+ while (*p) p++;
+ p--;
+ if (p >= pStr)
+ {
+ while (*p && *p == ' ') p--;
+ p++;
+ return CFX_ByteString(pStr,p-pStr);
+ }
+ return "";
+}
+
+CFX_ByteString CJS_PublicMethods::StrTrim(FX_LPCSTR pStr)
+{
+ return StrRTrim(StrLTrim(pStr));
+}
+
+double CJS_PublicMethods::ParseNumber(FX_LPCWSTR swSource, FX_BOOL& bAllDigits, FX_BOOL& bDot, FX_BOOL& bSign, FX_BOOL& bKXJS)
+{
+ bDot = FALSE;
+ bSign = FALSE;
+ bKXJS = FALSE;
+
+ FX_BOOL bDigitExist = FALSE;
+
+ FX_LPCWSTR p = swSource;
+ wchar_t c;
+
+ FX_LPCWSTR pStart = NULL;
+ FX_LPCWSTR pEnd = NULL;
+
+ while ((c = *p))
+ {
+ if (!pStart && c != L' ')
+ {
+ pStart = p;
+ }
+
+ pEnd = p;
+ p++;
+ }
+
+ if (!pStart)
+ {
+ bAllDigits = FALSE;
+ return 0;
+ }
+
+ while (pEnd != pStart)
+ {
+ if (*pEnd == L' ')
+ pEnd --;
+ else
+ break;
+ }
+
+ double dRet = 0;
+ p = pStart;
+ bAllDigits = TRUE;
+ CFX_WideString swDigits;
+
+ while (p <= pEnd)
+ {
+ c = *p;
+
+ if (IsDigit(c))
+ {
+ swDigits += c;
+ bDigitExist = TRUE;
+ }
+ else
+ {
+ switch (c)
+ {
+ case L' ':
+ bAllDigits = FALSE;
+ break;
+ case L'.':
+ case L',':
+ if (!bDot)
+ {
+ if (bDigitExist)
+ {
+ swDigits += L'.';
+ }
+ else
+ {
+ swDigits += L'0';
+ swDigits += L'.';
+ bDigitExist = TRUE;
+ }
+
+ bDot = TRUE;
+ break;
+ }
+ case 'e':
+ case 'E':
+ if (!bKXJS)
+ {
+ p++;
+ c = *p;
+ if (c == '+' || c == '-')
+ {
+ bKXJS = TRUE;
+ swDigits += 'e';
+ swDigits += c;
+ }
+ break;
+ }
+ case L'-':
+ if (!bDigitExist && !bSign)
+ {
+ swDigits += c;
+ bSign = TRUE;
+ break;
+ }
+ default:
+ bAllDigits = FALSE;
+
+ if (p != pStart && !bDot && bDigitExist)
+ {
+ swDigits += L'.';
+ bDot = TRUE;
+ }
+ else
+ {
+ bDot = FALSE;
+ bDigitExist = FALSE;
+ swDigits = L"";
+ }
+ break;
+ }
+ }
+
+ p++;
+ }
+
+ if (swDigits.GetLength() > 0 && swDigits.GetLength() < 17)
+ {
+ CFX_ByteString sDigits = swDigits.UTF8Encode();
+
+ if (bKXJS)
+ {
+ dRet = atof(sDigits);
+ }
+ else
+ {
+ if (bDot)
+ {
+ char* pStopString;
+ dRet = ::strtod(sDigits, &pStopString);
+ }
+ else
+ {
+ dRet = atol(sDigits);
+ }
+ }
+
+ }
+
+ return dRet;
+}
+
+double CJS_PublicMethods::ParseStringToNumber(FX_LPCWSTR swSource)
+{
+ FX_BOOL bAllDigits = FALSE;
+ FX_BOOL bDot = FALSE;
+ FX_BOOL bSign = FALSE;
+ FX_BOOL bKXJS = FALSE;
+
+ return ParseNumber(swSource, bAllDigits, bDot, bSign, bKXJS);
+}
+
+FX_BOOL CJS_PublicMethods::ConvertStringToNumber(FX_LPCWSTR swSource, double & dRet, FX_BOOL & bDot)
+{
+ FX_BOOL bAllDigits = FALSE;
+ FX_BOOL bSign = FALSE;
+ FX_BOOL bKXJS = FALSE;
+
+ dRet = ParseNumber(swSource, bAllDigits, bDot, bSign, bKXJS);
+
+ return bAllDigits;
+}
+
+CJS_Array CJS_PublicMethods::AF_MakeArrayFromList(v8::Isolate* isolate, CJS_Value val)
+{
+ CJS_Array StrArray(isolate);
+ if(val.IsArrayObject())
+ {
+ val.ConvertToArray(StrArray);
+ return StrArray;
+ }
+ CFX_WideString wsStr = val.operator CFX_WideString();
+ CFX_ByteString t = CFX_ByteString::FromUnicode(wsStr);
+ const char * p = (const char *)t;
+
+
+ int ch = ',' ;
+ int nIndex = 0;
+
+ while (*p)
+ {
+ const char * pTemp = strchr(p, ch);
+ if (pTemp == NULL)
+ {
+ StrArray.SetElement(nIndex, CJS_Value(isolate,(FX_LPCSTR)StrTrim(p)));
+ break;
+ }
+ else
+ {
+ char * pSub = new char[pTemp - p + 1];
+ strncpy(pSub, p, pTemp - p);
+ *(pSub + (pTemp - p)) = '\0';
+
+ StrArray.SetElement(nIndex, CJS_Value(isolate,(FX_LPCSTR)StrTrim(pSub)));
+ delete []pSub;
+
+ nIndex ++;
+ p = ++pTemp;
+ }
+
+ }
+ return StrArray;
+}
+
+int CJS_PublicMethods::ParseStringInteger(const CFX_WideString& string,int nStart,int& nSkip, int nMaxStep)
+{
+ int nRet = 0;
+ nSkip = 0;
+ for (int i=nStart, sz=string.GetLength(); i < sz; i++)
+ {
+ if (i-nStart > 10)
+ break;
+
+ FX_WCHAR c = string.GetAt(i);
+ if (IsDigit((wchar_t)c))
+ {
+ nRet = nRet * 10 + (c - '0');
+ nSkip = i - nStart + 1;
+ if (nSkip >= nMaxStep)
+ break;
+ }
+ else
+ break;
+ }
+
+ return nRet;
+}
+
+CFX_WideString CJS_PublicMethods::ParseStringString(const CFX_WideString& string, int nStart, int& nSkip)
+{
+ CFX_WideString swRet;
+ nSkip = 0;
+ for (int i=nStart, sz=string.GetLength(); i < sz; i++)
+ {
+ FX_WCHAR c = string.GetAt(i);
+ if ((c >= L'a' && c <= L'z') || (c >= L'A' && c <= L'Z'))
+ {
+ swRet += c;
+ nSkip = i - nStart + 1;
+ }
+ else
+ break;
+ }
+
+ return swRet;
+}
+
+double CJS_PublicMethods::ParseNormalDate(const CFX_WideString & value, FX_BOOL& bWrongFormat)
+{
+ double dt = JS_GetDateTime();
+
+ int nYear = JS_GetYearFromTime(dt);
+ int nMonth = JS_GetMonthFromTime(dt) + 1;
+ int nDay = JS_GetDayFromTime(dt);
+ int nHour = JS_GetHourFromTime(dt);
+ int nMin = JS_GetMinFromTime(dt);
+ int nSec = JS_GetSecFromTime(dt);
+
+ int number[3];
+
+ int nSkip = 0;
+ int nLen = value.GetLength();
+ int nIndex = 0;
+ int i = 0;
+ while (i < nLen)
+ {
+ if (nIndex > 2) break;
+
+ FX_WCHAR c = value.GetAt(i);
+ if (IsDigit((wchar_t)c))
+ {
+ number[nIndex++] = ParseStringInteger(value, i, nSkip, 4);
+ i += nSkip;
+ }
+ else
+ {
+ i ++;
+ }
+ }
+
+ if (nIndex == 2)
+ {
+ // case2: month/day
+ // case3: day/month
+ if ((number[0] >= 1 && number[0] <= 12) && (number[1] >= 1 && number[1] <= 31))
+ {
+ nMonth = number[0];
+ nDay = number[1];
+ }
+ else if ((number[0] >= 1 && number[0] <= 31) && (number[1] >= 1 && number[1] <= 12))
+ {
+ nDay = number[0];
+ nMonth = number[1];
+ }
+
+ bWrongFormat = FALSE;
+ }
+ else if (nIndex == 3)
+ {
+ // case1: year/month/day
+ // case2: month/day/year
+ // case3: day/month/year
+
+ if (number[0] > 12 && (number[1] >= 1 && number[1] <= 12) && (number[2] >= 1 && number[2] <= 31))
+ {
+ nYear = number[0];
+ nMonth = number[1];
+ nDay = number[2];
+ }
+ else if ((number[0] >= 1 && number[0] <= 12) && (number[1] >= 1 && number[1] <= 31) && number[2] > 31)
+ {
+ nMonth = number[0];
+ nDay = number[1];
+ nYear = number[2];
+ }
+ else if ((number[0] >= 1 && number[0] <= 31) && (number[1] >= 1 && number[1] <= 12) && number[2] > 31)
+ {
+ nDay = number[0];
+ nMonth = number[1];
+ nYear = number[2];
+ }
+
+ bWrongFormat = FALSE;
+ }
+ else
+ {
+ bWrongFormat = TRUE;
+ return dt;
+ }
+
+ CFX_WideString swTemp;
+ swTemp.Format((FX_LPCWSTR)L"%d/%d/%d %d:%d:%d",nMonth,nDay,nYear,nHour,nMin,nSec);
+ return JS_DateParse(swTemp);
+}
+
+double CJS_PublicMethods::MakeRegularDate(const CFX_WideString & value, const CFX_WideString & format, FX_BOOL& bWrongFormat)
+{
+ double dt = JS_GetDateTime();
+
+ if (format.IsEmpty() || value.IsEmpty())
+ return dt;
+
+ int nYear = JS_GetYearFromTime(dt);
+ int nMonth = JS_GetMonthFromTime(dt) + 1;
+ int nDay = JS_GetDayFromTime(dt);
+ int nHour = JS_GetHourFromTime(dt);
+ int nMin = JS_GetMinFromTime(dt);
+ int nSec = JS_GetSecFromTime(dt);
+
+ int nYearSub = 99; //nYear - 2000;
+
+ FX_BOOL bPm = FALSE;
+ FX_BOOL bExit = FALSE;
+ bWrongFormat = FALSE;
+
+ int i=0;
+ int j=0;
+
+ while (i < format.GetLength())
+ {
+ if (bExit) break;
+
+ FX_WCHAR c = format.GetAt(i);
+ switch (c)
+ {
+ case ':':
+ case '.':
+ case '-':
+ case '\\':
+ case '/':
+ i++;
+ j++;
+ break;
+
+ case 'y':
+ case 'm':
+ case 'd':
+ case 'H':
+ case 'h':
+ case 'M':
+ case 's':
+ case 't':
+ {
+ int oldj = j;
+ int nSkip = 0;
+
+ if (format.GetAt(i+1) != c)
+ {
+ switch (c)
+ {
+ case 'y':
+ i++;
+ j++;
+ break;
+ case 'm':
+ nMonth = ParseStringInteger(value, j, nSkip, 2);
+ i++;
+ j += nSkip;
+ break;
+ case 'd':
+ nDay = ParseStringInteger(value, j, nSkip, 2);
+ i++;
+ j += nSkip;
+ break;
+ case 'H':
+ nHour = ParseStringInteger(value, j, nSkip, 2);
+ i++;
+ j += nSkip;
+ break;
+ case 'h':
+ nHour = ParseStringInteger(value, j, nSkip, 2);
+ i++;
+ j += nSkip;
+ break;
+ case 'M':
+ nMin = ParseStringInteger(value, j, nSkip, 2);
+ i++;
+ j += nSkip;
+ break;
+ case 's':
+ nSec = ParseStringInteger(value, j, nSkip, 2);
+ i++;
+ j += nSkip;
+ break;
+ case 't':
+ bPm = value.GetAt(i) == 'p';
+ i++;
+ j++;
+ break;
+ }
+ }
+ else if (format.GetAt(i+1) == c && format.GetAt(i+2) != c)
+ {
+ switch (c)
+ {
+ case 'y':
+ nYear = ParseStringInteger(value, j, nSkip, 4);
+ i += 2;
+ j += nSkip;
+ break;
+ case 'm':
+ nMonth = ParseStringInteger(value, j, nSkip, 2);
+ i += 2;
+ j += nSkip;
+ break;
+ case 'd':
+ nDay = ParseStringInteger(value, j, nSkip, 2);
+ i += 2;
+ j += nSkip;
+ break;
+ case 'H':
+ nHour = ParseStringInteger(value, j, nSkip, 2);
+ i += 2;
+ j += nSkip;
+ break;
+ case 'h':
+ nHour = ParseStringInteger(value, j, nSkip, 2);
+ i += 2;
+ j += nSkip;
+ break;
+ case 'M':
+ nMin = ParseStringInteger(value, j, nSkip, 2);
+ i += 2;
+ j += nSkip;
+ break;
+ case 's':
+ nSec = ParseStringInteger(value, j, nSkip, 2);
+ i += 2;
+ j += nSkip;
+ break;
+ case 't':
+ bPm = (value.GetAt(j) == 'p' && value.GetAt(j+1) == 'm');
+ i += 2;
+ j += 2;
+ break;
+ }
+ }
+ else if (format.GetAt(i+1) == c && format.GetAt(i+2) == c && format.GetAt(i+3) != c)
+ {
+ switch (c)
+ {
+ case 'm':
+ {
+ CFX_WideString sMonth = ParseStringString(value, j, nSkip);
+ FX_BOOL bFind = FALSE;
+ for (int m = 0; m < 12; m++)
+ {
+ if (sMonth.CompareNoCase(months[m]) == 0)
+ {
+ nMonth = m + 1;
+ i+=3;
+ j+=nSkip;
+ bFind = TRUE;
+ break;
+ }
+ }
+
+ if (!bFind)
+ {
+ nMonth = ParseStringInteger(value, j, nSkip, 3);
+ i+=3;
+ j += nSkip;
+ }
+ }
+ break;
+ case 'y':
+ break;
+ default:
+ i+=3;
+ j+=3;
+ break;
+ }
+ }
+ else if (format.GetAt(i+1) == c && format.GetAt(i+2) == c && format.GetAt(i+3) == c && format.GetAt(i+4) != c)
+ {
+ switch (c)
+ {
+
+
+ case 'y':
+ nYear = ParseStringInteger(value, j, nSkip, 4);
+ j += nSkip;
+ i += 4;
+ break;
+ case 'm':
+ {
+ FX_BOOL bFind = FALSE;
+
+ CFX_WideString sMonth = ParseStringString(value, j, nSkip);
+ sMonth.MakeLower();
+
+ for (int m = 0; m < 12; m++)
+ {
+ CFX_WideString sFullMonths = fullmonths[m];
+ sFullMonths.MakeLower();
+
+ if (sFullMonths.Find(sMonth, 0) != -1)
+ {
+ nMonth = m + 1;
+ i += 4;
+ j += nSkip;
+ bFind = TRUE;
+ break;
+ }
+ }
+
+ if (!bFind)
+ {
+ nMonth = ParseStringInteger(value, j, nSkip, 4);
+ i+=4;
+ j += nSkip;
+ }
+ }
+ break;
+ default:
+ i += 4;
+ j += 4;
+ break;
+ }
+ }
+ else
+ {
+ if (format.GetAt(i) != value.GetAt(j))
+ {
+ bWrongFormat = TRUE;
+ bExit = TRUE;
+ }
+ i++;
+ j++;
+ }
+
+ if (oldj == j)
+ {
+ bWrongFormat = TRUE;
+ bExit = TRUE;
+ }
+ }
+
+ break;
+ default:
+ if (value.GetLength() <= j)
+ {
+ bExit = TRUE;
+ }
+ else if (format.GetAt(i) != value.GetAt(j))
+ {
+ bWrongFormat = TRUE;
+ bExit = TRUE;
+ }
+
+ i++;
+ j++;
+ break;
+ }
+ }
+
+ if (bPm) nHour += 12;
+
+ if (nYear >= 0 && nYear <= nYearSub)
+ nYear += 2000;
+
+ if (nMonth < 1 || nMonth > 12)
+ bWrongFormat = TRUE;
+
+ if (nDay < 1 || nDay > 31)
+ bWrongFormat = TRUE;
+
+ if (nHour < 0 || nHour > 24)
+ bWrongFormat = TRUE;
+
+ if (nMin < 0 || nMin > 60)
+ bWrongFormat = TRUE;
+
+ if (nSec < 0 || nSec > 60)
+ bWrongFormat = TRUE;
+
+ double dRet = 0;
+
+ if (bWrongFormat)
+ {
+ dRet = ParseNormalDate(value, bWrongFormat);
+ }
+ else
+ {
+ dRet = JS_MakeDate(JS_MakeDay(nYear,nMonth - 1,nDay),JS_MakeTime(nHour, nMin, nSec, 0));
+
+ if (JS_PortIsNan(dRet))
+ {
+ dRet = JS_DateParse(value);
+ }
+ }
+
+ if (JS_PortIsNan(dRet))
+ {
+ dRet = ParseNormalDate(value, bWrongFormat);
+ }
+
+ return dRet;
+
+}
+
+CFX_WideString CJS_PublicMethods::MakeFormatDate(double dDate, const CFX_WideString & format)
+{
+ CFX_WideString sRet = L"",sPart = L"";
+
+ int nYear = JS_GetYearFromTime(dDate);
+ int nMonth = JS_GetMonthFromTime(dDate) + 1;
+ int nDay = JS_GetDayFromTime(dDate);
+ int nHour = JS_GetHourFromTime(dDate);
+ int nMin = JS_GetMinFromTime(dDate);
+ int nSec = JS_GetSecFromTime(dDate);
+
+ int i = 0;
+ FX_WCHAR c;
+ while (i < format.GetLength())
+ {
+ c = format.GetAt(i);
+ sPart = L"";
+ switch (c)
+ {
+ case 'y':
+ case 'm':
+ case 'd':
+ case 'H':
+ case 'h':
+ case 'M':
+ case 's':
+ case 't':
+ if (format.GetAt(i+1) != c)
+ {
+ switch (c)
+ {
+ case 'y':
+ sPart += c;
+ break;
+ case 'm':
+ sPart.Format((FX_LPCWSTR)L"%d",nMonth);
+ break;
+ case 'd':
+ sPart.Format((FX_LPCWSTR)L"%d",nDay);
+ break;
+ case 'H':
+ sPart.Format((FX_LPCWSTR)L"%d",nHour);
+ break;
+ case 'h':
+ sPart.Format((FX_LPCWSTR)L"%d",nHour>12?nHour - 12:nHour);
+ break;
+ case 'M':
+ sPart.Format((FX_LPCWSTR)L"%d",nMin);
+ break;
+ case 's':
+ sPart.Format((FX_LPCWSTR)L"%d",nSec);
+ break;
+ case 't':
+ sPart += nHour>12?'p':'a';
+ break;
+ }
+ i++;
+ }
+ else if (format.GetAt(i+1) == c && format.GetAt(i+2) != c)
+ {
+ switch (c)
+ {
+ case 'y':
+ sPart.Format((FX_LPCWSTR)L"%02d",nYear - (nYear / 100) * 100);
+ break;
+ case 'm':
+ sPart.Format((FX_LPCWSTR)L"%02d",nMonth);
+ break;
+ case 'd':
+ sPart.Format((FX_LPCWSTR)L"%02d",nDay);
+ break;
+ case 'H':
+ sPart.Format((FX_LPCWSTR)L"%02d",nHour);
+ break;
+ case 'h':
+ sPart.Format((FX_LPCWSTR)L"%02d",nHour>12?nHour - 12:nHour);
+ break;
+ case 'M':
+ sPart.Format((FX_LPCWSTR)L"%02d",nMin);
+ break;
+ case 's':
+ sPart.Format((FX_LPCWSTR)L"%02d",nSec);
+ break;
+ case 't':
+ sPart = nHour>12? (FX_LPCWSTR)L"pm": (FX_LPCWSTR)L"am";
+ break;
+ }
+ i+=2;
+ }
+ else if (format.GetAt(i+1) == c && format.GetAt(i+2) == c && format.GetAt(i+3) != c)
+ {
+ switch (c)
+ {
+ case 'm':
+ i+=3;
+ if (nMonth > 0&&nMonth <= 12)
+ sPart += months[nMonth - 1];
+ break;
+ default:
+ i+=3;
+ sPart += c;
+ sPart += c;
+ sPart += c;
+ break;
+ }
+ }
+ else if (format.GetAt(i+1) == c && format.GetAt(i+2) == c && format.GetAt(i+3) == c && format.GetAt(i+4) != c)
+ {
+ switch (c)
+ {
+ case 'y':
+ sPart.Format((FX_LPCWSTR)L"%04d",nYear);
+ i += 4;
+ break;
+ case 'm':
+ i+=4;
+ if (nMonth > 0&&nMonth <= 12)
+ sPart += fullmonths[nMonth - 1];
+ break;
+ default:
+ i += 4;
+ sPart += c;
+ sPart += c;
+ sPart += c;
+ sPart += c;
+ break;
+ }
+ }
+ else
+ {
+ i++;
+ sPart += c;
+ }
+ break;
+ default:
+ i++;
+ sPart += c;
+ break;
+ }
+
+ sRet += sPart;
+ }
+
+ return sRet;
+}
+
+/* -------------------------------------------------------------------------- */
+
+//function AFNumber_Format(nDec, sepStyle, negStyle, currStyle, strCurrency, bCurrencyPrepend)
+FX_BOOL CJS_PublicMethods::AFNumber_Format(OBJ_METHOD_PARAMS)
+{
+#if _FX_OS_ != _FX_ANDROID_
+ v8::Isolate* isolate = ::GetIsolate(cc);
+ CJS_Context* pContext = (CJS_Context *)cc;
+ ASSERT(pContext != NULL);
+ CJS_EventHandler* pEvent = pContext->GetEventHandler();
+ ASSERT(pEvent != NULL);
+
+ if (params.size() != 6)
+ {
+ sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
+ return FALSE;
+ }
+ if(!pEvent->m_pValue)
+ return FALSE;
+ CFX_WideString& Value = pEvent->Value();
+ CFX_ByteString strValue = StrTrim(CFX_ByteString::FromUnicode(Value));
+
+ if (strValue.IsEmpty()) return TRUE;
+
+ int iDec = params[0];
+ int iSepStyle = params[1];
+ int iNegStyle = params[2];
+ int icurrStyle = params[3]; //it's no use!
+ std::wstring wstrCurrency(params[4].operator CFX_WideString());
+ FX_BOOL bCurrencyPrepend = params[5];
+
+ if (iDec < 0) iDec = -iDec;
+
+ if (iSepStyle < 0 || iSepStyle > 3)
+ iSepStyle = 0;
+
+ if (iNegStyle < 0 || iNegStyle > 3)
+ iNegStyle = 0;
+
+
+ //////////////////////////////////////////////////////
+ //for processing decimal places
+ strValue.Replace(",", ".");
+ double dValue = atof(strValue);
+ if (iDec > 0)
+ dValue += DOUBLE_CORRECT;//
+
+ int iDec2;
+ FX_BOOL bNagative = FALSE;
+
+ strValue = fcvt(dValue,iDec,&iDec2,&bNagative);
+ if (strValue.IsEmpty())
+ {
+ dValue = 0;
+ strValue = fcvt(dValue,iDec,&iDec2,&bNagative);
+ if (strValue.IsEmpty())
+ {
+ strValue = "0";
+ iDec2 = 1;
+ }
+
+ }
+
+ if (iDec2 < 0)
+ {
+ for (int iNum = 0;iNum < abs(iDec2);iNum++)
+ {
+ strValue = "0" + strValue;
+ }
+ iDec2 = 0;
+
+ }
+ int iMax = strValue.GetLength();
+ if (iDec2 > iMax)
+ {
+ for (int iNum = 0;iNum <= iDec2 - iMax ;iNum++)
+ {
+ strValue += "0";
+ }
+ iMax = iDec2+1;
+ }
+ ///////////////////////////////////////////////////////
+ //for processing seperator style
+ if (iDec2 < iMax)
+ {
+ if (iSepStyle == 0 || iSepStyle == 1)
+ {
+ strValue.Insert(iDec2, '.');
+ iMax++;
+ }
+ else if (iSepStyle == 2 || iSepStyle == 3)
+ {
+ strValue.Insert(iDec2, ',');
+ iMax++;
+ }
+
+ if (iDec2 == 0)
+ strValue.Insert(iDec2, '0');
+ }
+ if (iSepStyle == 0 || iSepStyle == 2)
+ {
+ char cSeperator;
+ if (iSepStyle == 0)
+ cSeperator = ',';
+ else
+ cSeperator = '.';
+
+ int iDecPositive,iDecNagative;
+ iDecPositive = iDec2;
+ iDecNagative = iDec2;
+
+ for (iDecPositive = iDec2 -3; iDecPositive > 0;iDecPositive -= 3)
+ {
+ strValue.Insert(iDecPositive, cSeperator);
+ iMax++;
+ }
+ }
+
+ //////////////////////////////////////////////////////////////////////
+ //for processing currency string
+
+ Value = CFX_WideString::FromLocal(strValue);
+
+ std::wstring strValue2(Value);
+
+ if (bCurrencyPrepend)
+ strValue2 = wstrCurrency + strValue2;
+ else
+ strValue2 = strValue2 + wstrCurrency;
+
+
+
+ /////////////////////////////////////////////////////////////////////////
+ //for processing negative style
+ if (bNagative)
+ {
+ if (iNegStyle == 0)
+ {
+ strValue2.insert(0,L"-");
+ }
+ if (iNegStyle == 2 || iNegStyle == 3)
+ {
+ strValue2.insert(0,L"(");
+ strValue2.insert(strValue2.length(),L")");
+ }
+ if (iNegStyle == 1 || iNegStyle == 3)
+ {
+ if (Field * fTarget = pEvent->Target_Field())
+ {
+ CJS_Array arColor(isolate);
+ CJS_Value vColElm(isolate);
+ vColElm = L"RGB";
+ arColor.SetElement(0,vColElm);
+ vColElm = 1;
+ arColor.SetElement(1,vColElm);
+ vColElm = 0;
+ arColor.SetElement(2,vColElm);
+
+ arColor.SetElement(3,vColElm);
+
+ CJS_PropValue vProp(isolate);
+ vProp.StartGetting();
+ vProp<<arColor;
+ vProp.StartSetting();
+ fTarget->textColor(cc,vProp,sError);// red
+ }
+ }
+ }
+ else
+ {
+ if (iNegStyle == 1 || iNegStyle == 3)
+ {
+ if (Field *fTarget = pEvent->Target_Field())
+ {
+ CJS_Array arColor(isolate);
+ CJS_Value vColElm(isolate);
+ vColElm = L"RGB";
+ arColor.SetElement(0,vColElm);
+ vColElm = 0;
+ arColor.SetElement(1,vColElm);
+ arColor.SetElement(2,vColElm);
+ arColor.SetElement(3,vColElm);
+
+ CJS_PropValue vProp(isolate);
+ vProp.StartGetting();
+ fTarget->textColor(cc,vProp,sError);
+
+ CJS_Array aProp(isolate);
+ vProp.ConvertToArray(aProp);
+
+ CPWL_Color crProp;
+ CPWL_Color crColor;
+ color::ConvertArrayToPWLColor(aProp, crProp);
+ color::ConvertArrayToPWLColor(arColor, crColor);
+
+ if (crColor != crProp)
+ {
+ CJS_PropValue vProp2(isolate);
+ vProp2.StartGetting();
+ vProp2<<arColor;
+ vProp2.StartSetting();
+ fTarget->textColor(cc,vProp2,sError);
+ }
+ }
+ }
+ }
+ Value = strValue2.c_str();
+#endif
+ return TRUE;
+}
+
+//function AFNumber_Keystroke(nDec, sepStyle, negStyle, currStyle, strCurrency, bCurrencyPrepend)
+FX_BOOL CJS_PublicMethods::AFNumber_Keystroke(OBJ_METHOD_PARAMS)
+{
+ CJS_Context* pContext = (CJS_Context *)cc;
+ ASSERT(pContext != NULL);
+ CJS_EventHandler* pEvent = pContext->GetEventHandler();
+ ASSERT(pEvent != NULL);
+
+ if(params.size() < 2)
+ return FALSE;
+ int iSepStyle = params[1];
+
+ if (iSepStyle < 0 || iSepStyle > 3)
+ iSepStyle = 0;
+ if(!pEvent->m_pValue)
+ return FALSE;
+ CFX_WideString & val = pEvent->Value();
+ CFX_WideString & w_strChange = pEvent->Change();
+ CFX_WideString w_strValue = val;
+
+ if (pEvent->WillCommit())
+ {
+ CFX_WideString wstrChange = w_strChange;
+ CFX_WideString wstrValue = StrLTrim(w_strValue);
+ if (wstrValue.IsEmpty())
+ return TRUE;
+
+ CFX_WideString swTemp = wstrValue;
+ swTemp.Replace((FX_LPCWSTR)L",", (FX_LPCWSTR)L".");
+ if (!IsNumber(swTemp)) //!(IsNumber(wstrChange) &&
+ {
+ pEvent->Rc() = FALSE;
+ sError = JSGetStringFromID(pContext, IDS_STRING_JSAFNUMBER_KEYSTROKE);
+ Alert(pContext, sError);
+ return TRUE;
+ }
+ return TRUE; // it happens after the last keystroke and before validating,
+ }
+
+ std::wstring w_strValue2 (w_strValue);
+ std::wstring w_strChange2(w_strChange);
+
+ std::wstring w_strSelected;
+ if(-1 != pEvent->SelStart())
+ w_strSelected = w_strValue2.substr(pEvent->SelStart(),(pEvent->SelEnd() - pEvent->SelStart()));
+ FX_BOOL bHasSign = (w_strValue2.find('-') != -1) && (w_strSelected.find('-') == -1);
+ if (bHasSign)
+ {
+ //can't insert "change" in front to sign postion.
+ if (pEvent->SelStart() == 0)
+ {
+ FX_BOOL &bRc = pEvent->Rc();
+ bRc = FALSE;
+ return TRUE;
+ }
+ }
+
+ char cSep = L'.';
+
+ switch (iSepStyle)
+ {
+ case 0:
+ case 1:
+ cSep = L'.';
+ break;
+ case 2:
+ case 3:
+ cSep = L',';
+ break;
+ }
+
+ FX_BOOL bHasSep = (w_strValue2.find(cSep) != -1);
+ for (std::wstring::iterator it = w_strChange2.begin(); it != w_strChange2.end(); it++)
+ {
+ if (*it == cSep)
+ {
+ if (bHasSep)
+ {
+ FX_BOOL &bRc = pEvent->Rc();
+ bRc = FALSE;
+ return TRUE;
+ }
+ else
+ {
+ bHasSep = TRUE;
+ continue;
+ }
+ }
+ if (*it == L'-')
+ {
+ if (bHasSign)
+ {
+ FX_BOOL &bRc = pEvent->Rc();
+ bRc = FALSE;
+ return TRUE;
+ }
+ else if (it != w_strChange2.begin()) //sign's position is not correct
+ {
+ FX_BOOL &bRc = pEvent->Rc();
+ bRc = FALSE;
+ return TRUE;
+ }
+ else if (pEvent->SelStart() != 0)
+ {
+ FX_BOOL &bRc = pEvent->Rc();
+ bRc = FALSE;
+ return TRUE;
+ }
+ bHasSign = TRUE;
+ continue;
+ }
+
+ if (!IsDigit(*it))
+ {
+ FX_BOOL &bRc = pEvent->Rc();
+ bRc = FALSE;
+ return TRUE;
+ }
+ }
+
+
+ std::wstring w_prefix = w_strValue2.substr(0,pEvent->SelStart());
+ std::wstring w_postfix;
+ if (pEvent->SelEnd()<(int)w_strValue2.length())
+ w_postfix = w_strValue2.substr(pEvent->SelEnd());
+ w_strValue2 = w_prefix + w_strChange2 + w_postfix;
+ w_strValue = w_strValue2.c_str();
+ val = w_strValue;
+ return TRUE;
+
+}
+
+//function AFPercent_Format(nDec, sepStyle)
+FX_BOOL CJS_PublicMethods::AFPercent_Format(OBJ_METHOD_PARAMS)
+{
+#if _FX_OS_ != _FX_ANDROID_
+ CJS_Context* pContext = (CJS_Context *)cc;
+ ASSERT(pContext != NULL);
+ CJS_EventHandler* pEvent = pContext->GetEventHandler();
+ ASSERT(pEvent != NULL);
+
+ if (params.size() != 2)
+ {
+ sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
+ return FALSE;
+ }
+ if(!pEvent->m_pValue)
+ return FALSE;
+ CFX_WideString& Value = pEvent->Value();
+
+// HWND hMainFrame = NULL;
+//
+// CPDFSDK_FormFillApp *pApp = pContext->GetReaderApp();
+// ASSERT(pApp);
+// hMainFrame = pApp->GetMainFrameWnd();
+
+ CFX_ByteString strValue = StrTrim(CFX_ByteString::FromUnicode(Value));
+
+ if (strValue.IsEmpty())
+ return TRUE;
+
+ int iDec = params[0];
+ int iSepStyle = params[1];
+
+ //ASSERT(iDec > 0);
+ if (iDec < 0)
+ iDec = -iDec;
+
+ if (iSepStyle < 0 || iSepStyle > 3)
+ iSepStyle = 0;
+
+
+ //////////////////////////////////////////////////////
+ //for processing decimal places
+ double dValue = atof(strValue);
+ dValue *= 100;
+ if (iDec > 0)
+ dValue += DOUBLE_CORRECT;//УÕý
+
+ int iDec2;
+ FX_BOOL bNagative = FALSE;
+ strValue = fcvt(dValue,iDec,&iDec2,&bNagative);
+ if (strValue.IsEmpty())
+ {
+ dValue = 0;
+ strValue = fcvt(dValue,iDec,&iDec2,&bNagative);
+ }
+
+ if (iDec2 < 0)
+ {
+ for (int iNum = 0; iNum < abs(iDec2); iNum++)
+ {
+ strValue = "0" + strValue;
+ }
+ iDec2 = 0;
+
+ }
+ int iMax = strValue.GetLength();
+ if (iDec2 > iMax)
+ {
+ for (int iNum = 0; iNum <= iDec2 - iMax; iNum++)
+ {
+ strValue += "0";
+ }
+ iMax = iDec2+1;
+ }
+ ///////////////////////////////////////////////////////
+ //for processing seperator style
+ if (iDec2 < iMax)
+ {
+ if (iSepStyle == 0 || iSepStyle == 1)
+ {
+ strValue.Insert(iDec2, '.');
+ iMax++;
+ }
+ else if (iSepStyle == 2 || iSepStyle == 3)
+ {
+ strValue.Insert(iDec2, ',');
+ iMax++;
+ }
+
+ if (iDec2 == 0)
+ strValue.Insert(iDec2, '0');
+ }
+ if (iSepStyle == 0 || iSepStyle == 2)
+ {
+ char cSeperator;
+ if (iSepStyle == 0)
+ cSeperator = ',';
+ else
+ cSeperator = '.';
+
+ int iDecPositive,iDecNagative;
+ iDecPositive = iDec2;
+ iDecNagative = iDec2;
+
+ for (iDecPositive = iDec2 -3; iDecPositive > 0; iDecPositive -= 3)
+ {
+ strValue.Insert(iDecPositive,cSeperator);
+ iMax++;
+ }
+ }
+ ////////////////////////////////////////////////////////////////////
+ //nagative mark
+ if(bNagative)
+ strValue = "-" + strValue;
+ strValue += "%";
+ Value = CFX_WideString::FromLocal(strValue);
+#endif
+ return TRUE;
+}
+//AFPercent_Keystroke(nDec, sepStyle)
+FX_BOOL CJS_PublicMethods::AFPercent_Keystroke(OBJ_METHOD_PARAMS)
+{
+ return AFNumber_Keystroke(cc,params,vRet,sError);
+}
+
+//function AFDate_FormatEx(cFormat)
+FX_BOOL CJS_PublicMethods::AFDate_FormatEx(OBJ_METHOD_PARAMS)
+{
+ CJS_Context* pContext = (CJS_Context *)cc;
+ ASSERT(pContext != NULL);
+ CJS_EventHandler* pEvent = pContext->GetEventHandler();
+ ASSERT(pEvent != NULL);
+
+ if (params.size() != 1)
+ {
+ sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
+ return FALSE;
+ }
+ if(!pEvent->m_pValue)
+ return FALSE;
+ CFX_WideString& val = pEvent->Value();
+
+ CFX_WideString strValue = val;
+ if (strValue.IsEmpty()) return TRUE;
+
+ CFX_WideString sFormat = params[0].operator CFX_WideString();
+
+ FX_BOOL bWrongFormat = FALSE;
+ double dDate = 0.0f;
+
+ if(strValue.Find(L"GMT") != -1)
+ {
+ //for GMT format time
+ //such as "Tue Aug 11 14:24:16 GMT+08002009"
+ dDate = MakeInterDate(strValue);
+ }
+ else
+ {
+ dDate = MakeRegularDate(strValue,sFormat,bWrongFormat);
+ }
+
+ if (JS_PortIsNan(dDate))
+ {
+ CFX_WideString swMsg;
+ swMsg.Format(JSGetStringFromID(pContext, IDS_STRING_JSPARSEDATE), (FX_LPCWSTR)sFormat);
+ Alert(pContext, swMsg);
+ return FALSE;
+ }
+
+ val = MakeFormatDate(dDate,sFormat);
+
+ return TRUE;
+}
+
+double CJS_PublicMethods::MakeInterDate(CFX_WideString strValue)
+{
+ int nHour;
+ int nMin;
+ int nSec;
+ int nYear;
+ int nMonth;
+ int nDay;
+
+ CFX_WideStringArray wsArray;
+ CFX_WideString sMonth = L"";
+ CFX_WideString sTemp = L"";
+ int nSize = strValue.GetLength();
+
+ for(int i = 0; i < nSize; i++)
+ {
+ FX_WCHAR c = strValue.GetAt(i);
+ if(c == L' ' || c == L':')
+ {
+ wsArray.Add(sTemp);
+ sTemp = L"";
+ continue;
+ }
+
+ sTemp += c;
+ }
+
+ wsArray.Add(sTemp);
+ if(wsArray.GetSize() != 8)return 0;
+
+ sTemp = wsArray[1];
+ if(sTemp.Compare(L"Jan") == 0) nMonth = 1;
+ if(sTemp.Compare(L"Feb") == 0) nMonth = 2;
+ if(sTemp.Compare(L"Mar") == 0) nMonth = 3;
+ if(sTemp.Compare(L"Apr") == 0) nMonth = 4;
+ if(sTemp.Compare(L"May") == 0) nMonth = 5;
+ if(sTemp.Compare(L"Jun") == 0) nMonth = 6;
+ if(sTemp.Compare(L"Jul") == 0) nMonth = 7;
+ if(sTemp.Compare(L"Aug") == 0) nMonth = 8;
+ if(sTemp.Compare(L"Sep") == 0) nMonth = 9;
+ if(sTemp.Compare(L"Oct") == 0) nMonth = 10;
+ if(sTemp.Compare(L"Nov") == 0) nMonth = 11;
+ if(sTemp.Compare(L"Dec") == 0) nMonth = 12;
+
+ nDay = (int)ParseStringToNumber(wsArray[2]);
+ nHour = (int)ParseStringToNumber(wsArray[3]);
+ nMin = (int)ParseStringToNumber(wsArray[4]);
+ nSec = (int)ParseStringToNumber(wsArray[5]);
+ nYear = (int)ParseStringToNumber(wsArray[7]);
+
+ double dRet = JS_MakeDate(JS_MakeDay(nYear,nMonth - 1,nDay),JS_MakeTime(nHour, nMin, nSec, 0));
+
+ if (JS_PortIsNan(dRet))
+ {
+ dRet = JS_DateParse(strValue);
+ }
+
+ return dRet;
+}
+
+//AFDate_KeystrokeEx(cFormat)
+FX_BOOL CJS_PublicMethods::AFDate_KeystrokeEx(OBJ_METHOD_PARAMS)
+{
+ CJS_Context* pContext = (CJS_Context *)cc;
+ ASSERT(pContext != NULL);
+ CJS_EventHandler* pEvent = pContext->GetEventHandler();
+ ASSERT(pEvent != NULL);
+
+ if (params.size() != 1)
+ {
+ sError = L"AFDate_KeystrokeEx's parameters' size r not correct";
+ return FALSE;
+ }
+
+ if (pEvent->WillCommit())
+ {
+ if(!pEvent->m_pValue)
+ return FALSE;
+ CFX_WideString strValue = pEvent->Value();
+ if (strValue.IsEmpty()) return TRUE;
+
+ CFX_WideString sFormat = params[0].operator CFX_WideString();
+
+ FX_BOOL bWrongFormat = FALSE;
+ double dRet = MakeRegularDate(strValue,sFormat,bWrongFormat);
+ if (bWrongFormat || JS_PortIsNan(dRet))
+ {
+ CFX_WideString swMsg;
+ swMsg.Format(JSGetStringFromID(pContext, IDS_STRING_JSPARSEDATE), (FX_LPCWSTR)sFormat);
+ Alert(pContext, swMsg);
+ pEvent->Rc() = FALSE;
+ return TRUE;
+ }
+ }
+ return TRUE;
+}
+
+FX_BOOL CJS_PublicMethods::AFDate_Format(OBJ_METHOD_PARAMS)
+{
+ v8::Isolate* isolate = ::GetIsolate(cc);
+
+ if (params.size() != 1)
+ {
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+
+ sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
+ return FALSE;
+ }
+
+ int iIndex = params[0];
+ FX_LPCWSTR cFormats[] = {(FX_LPCWSTR)L"m/d", (FX_LPCWSTR)L"m/d/yy", (FX_LPCWSTR)L"mm/dd/yy", (FX_LPCWSTR)L"mm/yy", (FX_LPCWSTR)L"d-mmm", (FX_LPCWSTR)L"d-mmm-yy", (FX_LPCWSTR)L"dd-mmm-yy",
+ (FX_LPCWSTR)L"yy-mm-dd", (FX_LPCWSTR)L"mmm-yy", (FX_LPCWSTR)L"mmmm-yy", (FX_LPCWSTR)L"mmm d, yyyy", (FX_LPCWSTR)L"mmmm d, yyyy",
+ (FX_LPCWSTR)L"m/d/yy h:MM tt", (FX_LPCWSTR)L"m/d/yy HH:MM" };
+
+ ASSERT(iIndex < sizeof(cFormats)/sizeof(FX_LPCWSTR));
+
+ if (iIndex < 0)
+ iIndex = 0;
+ if (iIndex >= sizeof(cFormats)/sizeof(FX_LPCWSTR))
+ iIndex = 0;
+ CJS_Parameters newParams;
+ CJS_Value val(isolate,cFormats[iIndex]);
+ newParams.push_back(val);
+ return AFDate_FormatEx(cc,newParams,vRet,sError);
+}
+
+//AFDate_KeystrokeEx(cFormat)
+FX_BOOL CJS_PublicMethods::AFDate_Keystroke(OBJ_METHOD_PARAMS)
+{
+ v8::Isolate* isolate = ::GetIsolate(cc);
+
+ if (params.size() != 1)
+ {
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+
+ sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
+ return FALSE;
+ }
+
+ int iIndex = params[0];
+ FX_LPCWSTR cFormats[] = {(FX_LPCWSTR)L"m/d", (FX_LPCWSTR)L"m/d/yy", (FX_LPCWSTR)L"mm/dd/yy", (FX_LPCWSTR)L"mm/yy", (FX_LPCWSTR)L"d-mmm", (FX_LPCWSTR)L"d-mmm-yy", (FX_LPCWSTR)L"dd-mmm-yy",
+ (FX_LPCWSTR)L"yy-mm-dd", (FX_LPCWSTR)L"mmm-yy", (FX_LPCWSTR)L"mmmm-yy", (FX_LPCWSTR)L"mmm d, yyyy", (FX_LPCWSTR)L"mmmm d, yyyy",
+ (FX_LPCWSTR)L"m/d/yy h:MM tt", (FX_LPCWSTR)L"m/d/yy HH:MM" };
+
+ ASSERT(iIndex<sizeof(cFormats)/sizeof(FX_LPCWSTR));
+
+ if (iIndex < 0)
+ iIndex = 0;
+ if (iIndex >= sizeof(cFormats)/sizeof(FX_LPCWSTR))
+ iIndex = 0;
+ CJS_Parameters newParams;
+ CJS_Value val(isolate,cFormats[iIndex]);
+ newParams.push_back(val);
+ return AFDate_KeystrokeEx(cc,newParams,vRet,sError);
+}
+
+//function AFTime_Format(ptf)
+FX_BOOL CJS_PublicMethods::AFTime_Format(OBJ_METHOD_PARAMS)
+{
+ v8::Isolate* isolate = ::GetIsolate(cc);
+
+ if (params.size() != 1)
+ {
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+ sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
+ return FALSE;
+ }
+
+ int iIndex = params[0];
+ FX_LPCWSTR cFormats[] = {(FX_LPCWSTR)L"HH:MM", (FX_LPCWSTR)L"h:MM tt", (FX_LPCWSTR)L"HH:MM:ss", (FX_LPCWSTR)L"h:MM:ss tt"};
+
+ ASSERT(iIndex<sizeof(cFormats)/sizeof(FX_LPCWSTR));
+
+ if (iIndex < 0)
+ iIndex = 0;
+ if (iIndex >= sizeof(cFormats)/sizeof(FX_LPCWSTR))
+ iIndex = 0;
+ CJS_Parameters newParams;
+ CJS_Value val(isolate,cFormats[iIndex]);
+ newParams.push_back(val);
+ return AFDate_FormatEx(cc,newParams,vRet,sError);
+}
+
+FX_BOOL CJS_PublicMethods::AFTime_Keystroke(OBJ_METHOD_PARAMS)
+{
+ v8::Isolate* isolate = ::GetIsolate(cc);
+ if (params.size() != 1)
+ {
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+ sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
+ return FALSE;
+ }
+
+ int iIndex = params[0];
+ FX_LPCWSTR cFormats[] = {(FX_LPCWSTR)L"HH:MM", (FX_LPCWSTR)L"h:MM tt", (FX_LPCWSTR)L"HH:MM:ss", (FX_LPCWSTR)L"h:MM:ss tt"};
+
+ ASSERT(iIndex<sizeof(cFormats)/sizeof(FX_LPCWSTR));
+
+ if (iIndex < 0)
+ iIndex = 0;
+ if (iIndex >= sizeof(cFormats)/sizeof(FX_LPCWSTR))
+ iIndex = 0;
+ CJS_Parameters newParams;
+ CJS_Value val(isolate,cFormats[iIndex]);
+ newParams.push_back(val);
+ return AFDate_KeystrokeEx(cc,newParams,vRet,sError);
+}
+
+FX_BOOL CJS_PublicMethods::AFTime_FormatEx(OBJ_METHOD_PARAMS)
+{
+ return AFDate_FormatEx(cc,params,vRet,sError);
+}
+
+FX_BOOL CJS_PublicMethods::AFTime_KeystrokeEx(OBJ_METHOD_PARAMS)
+{
+ return AFDate_KeystrokeEx(cc,params,vRet,sError);
+}
+
+//function AFSpecial_Format(psf)
+FX_BOOL CJS_PublicMethods::AFSpecial_Format(OBJ_METHOD_PARAMS)
+{
+ CJS_Context* pContext = (CJS_Context *)cc;
+ ASSERT(pContext != NULL);
+
+ if (params.size() != 1)
+ {
+ sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
+ return FALSE;
+ }
+
+ std::string cFormat;
+ int iIndex = params[0];
+
+ CJS_EventHandler* pEvent = pContext->GetEventHandler();
+ ASSERT(pEvent != NULL);
+
+ if(!pEvent->m_pValue)
+ return FALSE;
+ CFX_WideString& Value = pEvent->Value();
+ std::string strSrc = (FX_LPCSTR)CFX_ByteString::FromUnicode(Value);
+
+ switch (iIndex)
+ {
+ case 0:
+ cFormat = "99999";
+ break;
+ case 1:
+ cFormat = "99999-9999";
+ break;
+ case 2:
+ {
+ std::string NumberStr;
+ util::printx("9999999999", strSrc,NumberStr);
+ if (NumberStr.length() >= 10 )
+ cFormat = "(999) 999-9999";
+ else
+ cFormat = "999-9999";
+ break;
+ }
+ case 3:
+ cFormat = "999-99-9999";
+ break;
+ }
+
+ std::string strDes;
+ util::printx(cFormat,strSrc,strDes);
+ Value = CFX_WideString::FromLocal(strDes.c_str());
+ return TRUE;
+}
+
+
+//function AFSpecial_KeystrokeEx(mask)
+FX_BOOL CJS_PublicMethods::AFSpecial_KeystrokeEx(OBJ_METHOD_PARAMS)
+{
+ CJS_Context* pContext = (CJS_Context *)cc;
+ ASSERT(pContext != NULL);
+ CJS_EventHandler* pEvent = pContext->GetEventHandler();
+
+ ASSERT(pEvent != NULL);
+
+ if (params.size() < 1)
+ {
+ sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
+ return FALSE;
+ }
+
+ if(!pEvent->m_pValue)
+ return FALSE;
+ CFX_WideString& valEvent = pEvent->Value();
+
+ CFX_WideString wstrMask = params[0].operator CFX_WideString();
+ if (wstrMask.IsEmpty()) return TRUE;
+
+ std::wstring wstrValue(valEvent);
+
+ if (pEvent->WillCommit())
+ {
+ if (wstrValue.empty())
+ return TRUE;
+ int iIndexMask = 0;
+ for (std::wstring::iterator it = wstrValue.begin(); it != wstrValue.end(); it++)
+ {
+ wchar_t w_Value = *it;
+ if (!maskSatisfied(w_Value,wstrMask[iIndexMask]))
+ break;
+ iIndexMask++;
+ }
+
+ if (iIndexMask != wstrMask.GetLength() || (iIndexMask != wstrValue.size() && wstrMask.GetLength() != 0))
+ {
+ Alert(pContext, JSGetStringFromID(pContext, IDS_STRING_JSAFNUMBER_KEYSTROKE));
+ pEvent->Rc() = FALSE;
+ }
+ return TRUE;
+ }
+
+
+ CFX_WideString &wideChange = pEvent->Change();
+ std::wstring wChange(wideChange);
+
+ if (wChange.empty())
+ return TRUE;
+ int iIndexMask = pEvent->SelStart();
+ //iIndexMask++;
+
+
+ if (wstrValue.length() - (pEvent->SelEnd()-pEvent->SelStart()) + wChange.length() > (FX_DWORD)wstrMask.GetLength())
+ {
+ Alert(pContext, JSGetStringFromID(pContext, IDS_STRING_JSPARAM_TOOLONG));
+ pEvent->Rc() = FALSE;
+ return TRUE;
+ }
+
+
+ if (iIndexMask >= wstrMask.GetLength() && (!wChange.empty()))
+ {
+ Alert(pContext, JSGetStringFromID(pContext, IDS_STRING_JSPARAM_TOOLONG));
+ pEvent->Rc() = FALSE;
+ return TRUE;
+ }
+
+ for (std::wstring::iterator it = wChange.begin(); it != wChange.end(); it++)
+ {
+ if (iIndexMask >= wstrMask.GetLength())
+ {
+ Alert(pContext, JSGetStringFromID(pContext, IDS_STRING_JSPARAM_TOOLONG));
+ pEvent->Rc() = FALSE;
+ return TRUE;
+ }
+ wchar_t w_Mask = wstrMask[iIndexMask];
+ if (!isReservedMaskChar(w_Mask))
+ {
+ //wChange.insert(it,w_Mask);
+ *it = w_Mask;
+ }
+ wchar_t w_Change = *it;
+
+ if (!maskSatisfied(w_Change,w_Mask))
+ {
+ pEvent->Rc() = FALSE;
+ return TRUE;
+ }
+ iIndexMask++;
+ }
+
+ wideChange = wChange.c_str();
+
+ return TRUE;
+}
+
+
+//function AFSpecial_Keystroke(psf)
+FX_BOOL CJS_PublicMethods::AFSpecial_Keystroke(OBJ_METHOD_PARAMS)
+{
+ v8::Isolate* isolate = ::GetIsolate(cc);
+
+ CJS_Context* pContext = (CJS_Context *)cc;
+ ASSERT(pContext != NULL);
+ CJS_EventHandler* pEvent = pContext->GetEventHandler();
+ ASSERT(pEvent != NULL);
+
+ if (params.size() != 1)
+ {
+ sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
+ return FALSE;
+ }
+
+ std::string cFormat;
+ int iIndex = (int)params[0];
+
+ if(!pEvent->m_pValue)
+ return FALSE;
+ //CJS_Value val = pEvent->Value();
+ CFX_WideString& val = pEvent->Value();
+ std::string strSrc = (FX_LPCSTR)CFX_ByteString::FromUnicode(val);
+ std::wstring wstrChange(pEvent->Change());
+
+ switch (iIndex)
+ {
+ case 0:
+ cFormat = "99999";
+ break;
+ case 1:
+ //cFormat = "99999-9999";
+ cFormat = "999999999";
+ break;
+ case 2:
+ {
+ std::string NumberStr;
+ util::printx("9999999999", strSrc,NumberStr);
+ if (strSrc.length() + wstrChange.length() > 7 )
+ //cFormat = "(999) 999-9999";
+ cFormat = "9999999999";
+ else
+ //cFormat = "999-9999";
+ cFormat = "9999999";
+ break;
+ }
+ case 3:
+ //cFormat = "999-99-9999";
+ cFormat = "999999999";
+ break;
+ }
+
+ CJS_Parameters params2;
+ CJS_Value vMask(isolate, cFormat.c_str());
+ params2.push_back(vMask);
+
+ return AFSpecial_KeystrokeEx(cc,params2,vRet,sError);
+}
+
+FX_BOOL CJS_PublicMethods::AFMergeChange(OBJ_METHOD_PARAMS)
+{
+ CJS_Context* pContext = (CJS_Context *)cc;
+ ASSERT(pContext != NULL);
+ CJS_EventHandler* pEventHandler = pContext->GetEventHandler();
+ ASSERT(pEventHandler != NULL);
+
+ if (params.size() != 1)
+ {
+ sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
+ return FALSE;
+ }
+
+ CFX_WideString swValue;
+ if (pEventHandler->m_pValue != NULL)
+ swValue = pEventHandler->Value();
+
+ if (pEventHandler->WillCommit())
+ {
+ vRet = swValue;
+ return TRUE;
+ }
+
+ CFX_WideString prefix,postfix;
+
+ if (pEventHandler->SelStart() >= 0)
+ prefix = swValue.Mid(0,pEventHandler->SelStart());
+ else
+ prefix = L"";
+
+
+ if (pEventHandler->SelEnd() >= 0 && pEventHandler->SelEnd() <= swValue.GetLength())
+ postfix = swValue.Mid(pEventHandler->SelEnd(), swValue.GetLength() - pEventHandler->SelEnd());
+ else postfix = L"";
+
+ vRet = prefix + pEventHandler->Change() + postfix;
+
+ return TRUE;
+}
+
+FX_BOOL CJS_PublicMethods::AFParseDateEx(OBJ_METHOD_PARAMS)
+{
+ CJS_Context* pContext = (CJS_Context *)cc;
+ ASSERT(pContext != NULL);
+
+ if (params.size() != 2)
+ {
+ sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
+ return FALSE;
+ }
+
+ CFX_WideString sValue = params[0].operator CFX_WideString();
+ CFX_WideString sFormat = params[1].operator CFX_WideString();
+
+ FX_BOOL bWrongFormat = FALSE;
+ double dDate = MakeRegularDate(sValue,sFormat,bWrongFormat);
+
+ if (JS_PortIsNan(dDate))
+ {
+ CFX_WideString swMsg;
+ swMsg.Format(JSGetStringFromID(pContext, IDS_STRING_JSPARSEDATE), (FX_LPCWSTR)sFormat);
+ Alert((CJS_Context *)cc, swMsg);
+ return FALSE;
+ }
+
+ vRet = dDate;
+
+ return TRUE;
+}
+
+FX_BOOL CJS_PublicMethods::AFSimple(OBJ_METHOD_PARAMS)
+{
+ if (params.size() != 3)
+ {
+ CJS_Context* pContext = (CJS_Context *)cc;
+ ASSERT(pContext != NULL);
+
+ sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
+ return FALSE;
+ }
+
+ vRet = (double)AF_Simple(params[0].operator CFX_WideString(), (double)params[1], (double)params[2]);
+ return TRUE;
+}
+
+FX_BOOL CJS_PublicMethods::AFMakeNumber(OBJ_METHOD_PARAMS)
+{
+ if (params.size() != 1)
+ {
+ CJS_Context* pContext = (CJS_Context *)cc;
+ ASSERT(pContext != NULL);
+
+ sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
+ return FALSE;
+ }
+ vRet = ParseStringToNumber(params[0].operator CFX_WideString());
+ return TRUE;
+}
+
+FX_BOOL CJS_PublicMethods::AFSimple_Calculate(OBJ_METHOD_PARAMS)
+{
+ v8::Isolate* isolate = ::GetIsolate(cc);
+
+ CJS_Context* pContext = (CJS_Context *)cc;
+ ASSERT(pContext != NULL);
+
+ if (params.size() != 2)
+ {
+ sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
+ return FALSE;
+ }
+
+ CJS_Value params1 = params[1];
+
+ if (!params1.IsArrayObject() && params1.GetType() != VT_string)
+ {
+ sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
+ return FALSE;
+ }
+
+ CPDFSDK_Document* pReaderDoc = pContext->GetReaderDocument();
+ ASSERT(pReaderDoc != NULL);
+
+ CPDFSDK_InterForm* pReaderInterForm = pReaderDoc->GetInterForm();
+ ASSERT(pReaderInterForm != NULL);
+
+ CPDF_InterForm* pInterForm = pReaderInterForm->GetInterForm();
+ ASSERT(pInterForm != NULL);
+
+ double dValue;
+ CFX_WideString sFunction = params[0].operator CFX_WideString();
+ if (wcscmp(sFunction, L"PRD") == 0)
+ dValue = 1.0;
+ else
+ dValue = 0.0;
+
+ CJS_Array FieldNameArray = AF_MakeArrayFromList(isolate,params1);
+
+ int nFieldsCount = 0;
+
+ for (int i=0,isz=FieldNameArray.GetLength(); i<isz; i++)
+ {
+ CJS_Value jsValue(isolate);
+ FieldNameArray.GetElement(i,jsValue);
+ CFX_WideString wsFieldName = jsValue.operator CFX_WideString();
+
+ for (int j=0,jsz=pInterForm->CountFields(wsFieldName); j<jsz; j++)
+ {
+ if (CPDF_FormField* pFormField = pInterForm->GetField(j, wsFieldName))
+ {
+ double dTemp = 0.0;
+
+ switch (pFormField->GetFieldType())
+ {
+ case FIELDTYPE_TEXTFIELD:
+ case FIELDTYPE_COMBOBOX:
+ {
+ dTemp = ParseStringToNumber(pFormField->GetValue());
+ break;
+ }
+ case FIELDTYPE_PUSHBUTTON:
+ {
+ dTemp = 0.0;
+ break;
+ }
+ case FIELDTYPE_CHECKBOX:
+ case FIELDTYPE_RADIOBUTTON:
+ {
+ dTemp = 0.0;
+ for (int c=0,csz=pFormField->CountControls(); c<csz; c++)
+ {
+ if (CPDF_FormControl* pFormCtrl = pFormField->GetControl(c))
+ {
+ if (pFormCtrl->IsChecked())
+ {
+ dTemp += ParseStringToNumber(pFormCtrl->GetExportValue());
+ break;
+ }
+ else
+ continue;
+ }
+ }
+ break;
+ }
+ case FIELDTYPE_LISTBOX:
+ {
+ dTemp = 0.0;
+ if (pFormField->CountSelectedItems() > 1)
+ break;
+ else
+ {
+ dTemp = ParseStringToNumber(pFormField->GetValue());
+ break;
+ }
+ }
+ default:
+ break;
+ }
+
+ if (i == 0 && j == 0 && (wcscmp(sFunction,L"MIN") == 0 || wcscmp(sFunction, L"MAX") == 0))
+ dValue = dTemp;
+
+ dValue = AF_Simple(sFunction, dValue, dTemp);
+
+ nFieldsCount++;
+ }
+ }
+ }
+
+ if (wcscmp(sFunction, L"AVG") == 0 && nFieldsCount > 0)
+ dValue /= nFieldsCount;
+
+ dValue = (double)floor(dValue * FXSYS_pow((double)10,(double)6) + 0.49) / FXSYS_pow((double)10,(double)6);
+ CJS_Value jsValue(isolate,dValue);
+ if((CJS_EventHandler*)pContext->GetEventHandler()->m_pValue)
+ ((CJS_EventHandler*)pContext->GetEventHandler())->Value() = jsValue;
+
+ return TRUE;
+}
+
+/* This function validates the current event to ensure that its value is
+** within the specified range. */
+
+FX_BOOL CJS_PublicMethods::AFRange_Validate(OBJ_METHOD_PARAMS)
+{
+ CJS_Context* pContext = (CJS_Context *)cc;
+ ASSERT(pContext != NULL);
+ CJS_EventHandler* pEvent = pContext->GetEventHandler();
+ ASSERT(pEvent != NULL);
+
+ if (params.size() != 4)
+ {
+ sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
+ return FALSE;
+ }
+
+ if(!pEvent->m_pValue)
+ return FALSE;
+ if (pEvent->Value().IsEmpty() )
+ return TRUE;
+ double dEentValue = atof(CFX_ByteString::FromUnicode(pEvent->Value()));
+ FX_BOOL bGreaterThan, bLessThan;
+ double dGreaterThan, dLessThan;
+ bGreaterThan = (FX_BOOL)params[0];
+ CFX_WideString swMsg;
+ dGreaterThan = (double)params[1];
+ bLessThan = (FX_BOOL)params[2];
+ dLessThan = (double)params[3];
+
+ if (bGreaterThan && bLessThan)
+ {
+ if (dEentValue < dGreaterThan || dEentValue > dLessThan)
+ swMsg.Format(JSGetStringFromID(pContext, IDS_STRING_JSRANGE1),(FX_LPCWSTR)params[1].operator CFX_WideString(), (FX_LPCWSTR)params[3].operator CFX_WideString());
+ }
+ else if (bGreaterThan)
+ {
+ if (dEentValue < dGreaterThan)
+ swMsg.Format(JSGetStringFromID(pContext, IDS_STRING_JSRANGE2), (FX_LPCWSTR)params[1].operator CFX_WideString());
+ }
+ else if (bLessThan)
+ {
+ if (dEentValue > dLessThan)
+ swMsg.Format(JSGetStringFromID(pContext, IDS_STRING_JSRANGE3), (FX_LPCWSTR)params[3].operator CFX_WideString());
+ }
+
+ if (!swMsg.IsEmpty())
+ {
+ Alert(pContext, swMsg);
+ pEvent->Rc() = FALSE;
+ }
+ return TRUE;
+}
+
+FX_BOOL CJS_PublicMethods::AFExtractNums(OBJ_METHOD_PARAMS)
+{
+ v8::Isolate* isolate = ::GetIsolate(cc);
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+
+ if (params.size() != 1)
+ {
+ sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
+ return FALSE;
+ }
+
+ CJS_Array nums(isolate);
+
+ CFX_WideString str = params[0].operator CFX_WideString();
+ CFX_WideString sPart;
+
+ if (str.GetAt(0) == L'.' || str.GetAt(0) == L',')
+ str = L"0" + str;
+
+ int nIndex = 0;
+ for (int i=0, sz=str.GetLength(); i<sz; i++)
+ {
+ FX_WCHAR wc = str.GetAt(i);
+ if (IsDigit((wchar_t)wc))
+ {
+ sPart += wc;
+ }
+ else
+ {
+ if (sPart.GetLength() > 0)
+ {
+ nums.SetElement(nIndex,CJS_Value(isolate,(FX_LPCWSTR)sPart));
+ sPart = L"";
+ nIndex ++;
+ }
+ }
+ }
+
+ if (sPart.GetLength() > 0)
+ {
+ nums.SetElement(nIndex,CJS_Value(isolate,(FX_LPCWSTR)sPart));
+ }
+
+ if (nums.GetLength() > 0)
+ vRet = nums;
+ else
+ vRet.SetNull();
+
+ return TRUE;
+}
diff --git a/fpdfsdk/src/javascript/app.cpp b/fpdfsdk/src/javascript/app.cpp
index c1ef76c3b8..a3e61c01ab 100644
--- a/fpdfsdk/src/javascript/app.cpp
+++ b/fpdfsdk/src/javascript/app.cpp
@@ -1,1134 +1,1134 @@
-// 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
-
-#include "../../include/javascript/JavaScript.h"
-#include "../../include/javascript/IJavaScript.h"
-#include "../../include/javascript/JS_Define.h"
-#include "../../include/javascript/JS_Object.h"
-#include "../../include/javascript/JS_Value.h"
-#include "../../include/javascript/app.h"
-#include "../../include/javascript/JS_EventHandler.h"
-#include "../../include/javascript/resource.h"
-#include "../../include/javascript/JS_Context.h"
-#include "../../include/javascript/JS_Runtime.h"
-#include "../../include/javascript/Document.h"
-
-
-static v8::Isolate* GetIsolate(IFXJS_Context* cc)
-{
- CJS_Context* pContext = (CJS_Context *)cc;
- ASSERT(pContext != NULL);
-
- CJS_Runtime* pRuntime = pContext->GetJSRuntime();
- ASSERT(pRuntime != NULL);
-
- return pRuntime->GetIsolate();
-}
-
-/* ---------------------------- TimerObj ---------------------------- */
-
-BEGIN_JS_STATIC_CONST(CJS_TimerObj)
-END_JS_STATIC_CONST()
-
-BEGIN_JS_STATIC_PROP(CJS_TimerObj)
-END_JS_STATIC_PROP()
-
-BEGIN_JS_STATIC_METHOD(CJS_TimerObj)
-END_JS_STATIC_METHOD()
-
-IMPLEMENT_JS_CLASS(CJS_TimerObj, TimerObj)
-
-TimerObj::TimerObj(CJS_Object* pJSObject)
-: CJS_EmbedObj(pJSObject),
-m_pTimer(NULL)
-{
-
-}
-
-TimerObj::~TimerObj()
-{
-}
-
-void TimerObj::SetTimer(CJS_Timer* pTimer)
-{
- m_pTimer = pTimer;
-}
-
-CJS_Timer* TimerObj::GetTimer() const
-{
- return m_pTimer;
-}
-
-#define JS_STR_VIEWERTYPE_READER L"Reader"
-#define JS_STR_VIEWERTYPE_STANDARD L"Exchange"
-#define JS_STR_VIEWERVARIATION L"Full"
-#define JS_STR_PLATFORM L"WIN"
-#define JS_STR_LANGUANGE L"ENU"
-#define JS_STR_VIEWERVERSION 8
-#define JS_NUM_FORMSVERSION 7
-
-#define JS_FILEPATH_MAXLEN 2000
-
-/* ---------------------------- app ---------------------------- */
-
-BEGIN_JS_STATIC_CONST(CJS_App)
-END_JS_STATIC_CONST()
-
-BEGIN_JS_STATIC_PROP(CJS_App)
- JS_STATIC_PROP_ENTRY(activeDocs)
- JS_STATIC_PROP_ENTRY(calculate)
- JS_STATIC_PROP_ENTRY(formsVersion)
- JS_STATIC_PROP_ENTRY(fs)
- JS_STATIC_PROP_ENTRY(fullscreen)
- JS_STATIC_PROP_ENTRY(language)
- JS_STATIC_PROP_ENTRY(media)
- JS_STATIC_PROP_ENTRY(platform)
- JS_STATIC_PROP_ENTRY(runtimeHighlight)
- JS_STATIC_PROP_ENTRY(viewerType)
- JS_STATIC_PROP_ENTRY(viewerVariation)
- JS_STATIC_PROP_ENTRY(viewerVersion)
-END_JS_STATIC_PROP()
-
-BEGIN_JS_STATIC_METHOD(CJS_App)
- JS_STATIC_METHOD_ENTRY(alert, 6)
- JS_STATIC_METHOD_ENTRY(beep, 1)
- JS_STATIC_METHOD_ENTRY(browseForDoc, 0)
- JS_STATIC_METHOD_ENTRY(clearInterval, 1)
- JS_STATIC_METHOD_ENTRY(clearTimeOut, 1)
- JS_STATIC_METHOD_ENTRY(execDialog, 3)
- JS_STATIC_METHOD_ENTRY(execMenuItem, 1)
- JS_STATIC_METHOD_ENTRY(findComponent, 1)
- JS_STATIC_METHOD_ENTRY(goBack, 0)
- JS_STATIC_METHOD_ENTRY(goForward, 0)
- JS_STATIC_METHOD_ENTRY(launchURL, 0)
- JS_STATIC_METHOD_ENTRY(mailMsg, 0)
- JS_STATIC_METHOD_ENTRY(newFDF, 0)
- JS_STATIC_METHOD_ENTRY(newDoc, 0)
- JS_STATIC_METHOD_ENTRY(openDoc, 0)
- JS_STATIC_METHOD_ENTRY(openFDF, 5)
- JS_STATIC_METHOD_ENTRY(popUpMenuEx, 0)
- JS_STATIC_METHOD_ENTRY(popUpMenu, 0)
- JS_STATIC_METHOD_ENTRY(response, 0)
- JS_STATIC_METHOD_ENTRY(setInterval, 2)
- JS_STATIC_METHOD_ENTRY(setTimeOut, 2)
-END_JS_STATIC_METHOD()
-
-IMPLEMENT_JS_CLASS(CJS_App,app)
-
-app::app(CJS_Object * pJSObject) : CJS_EmbedObj(pJSObject) ,
- m_bCalculate(true),
- m_pRuntime(NULL),
- m_bRuntimeHighLight(false)
-// m_pMenuHead(NULL)
-{
-}
-
-app::~app(void)
-{
- for (int i=0,sz=m_aTimer.GetSize(); i<sz; i++)
- delete m_aTimer[i];
-
- m_aTimer.RemoveAll();
-}
-
-FX_BOOL app::activeDocs(OBJ_PROP_PARAMS)
-{
- if (vp.IsGetting())
- {
-
- CJS_Context* pContext = (CJS_Context *)cc;
- ASSERT(pContext != NULL);
-
- CPDFDoc_Environment* pApp = pContext->GetReaderApp();
- ASSERT(pApp != NULL);
-
- CJS_Runtime* pRuntime = pContext->GetJSRuntime();
- ASSERT(pRuntime != NULL);
-
- CPDFSDK_Document* pCurDoc = pContext->GetReaderDocument();
-
- CJS_Array aDocs(pRuntime->GetIsolate());
-// int iNumDocs = pApp->CountDocuments();
-
-// for(int iIndex = 0; iIndex<iNumDocs; iIndex++)
-// {
- CPDFSDK_Document* pDoc = pApp->GetCurrentDoc();
- if (pDoc)
- {
- CJS_Document * pJSDocument = NULL;
-
- if (pDoc == pCurDoc)
- {
- JSFXObject pObj = JS_GetThisObj(*pRuntime);
-
- if (JS_GetObjDefnID(pObj) == JS_GetObjDefnID(*pRuntime, L"Document"))
- {
- pJSDocument = (CJS_Document*)JS_GetPrivate(pRuntime->GetIsolate(),pObj);
- }
- }
- else
- {
- JSFXObject pObj = JS_NewFxDynamicObj(*pRuntime, pContext, JS_GetObjDefnID(*pRuntime,L"Document"));
- pJSDocument = (CJS_Document*)JS_GetPrivate(pRuntime->GetIsolate(),pObj);
- ASSERT(pJSDocument != NULL);
-
-
- // pDocument->AttachDoc(pDoc);
- }
-
- aDocs.SetElement(0,CJS_Value(pRuntime->GetIsolate(),pJSDocument));
- }
- // }
-
- if (aDocs.GetLength() > 0)
- vp << aDocs;
- else
- vp.SetNull();
- return TRUE;
- }
- return FALSE;
-}
-
-FX_BOOL app::calculate(OBJ_PROP_PARAMS)
-{
- if (vp.IsSetting())
- {
- bool bVP;
- vp >> bVP;
- m_bCalculate = (FX_BOOL)bVP;
-
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
-
- CPDFDoc_Environment* pApp = pContext->GetReaderApp();
- ASSERT(pApp != NULL);
-
- CJS_Runtime* pRuntime = pContext->GetJSRuntime();
- ASSERT(pRuntime != NULL);
-
- CJS_Array aDocs(pRuntime->GetIsolate());
-// int iNumDocs = pApp->CountDocuments();
-//
-// for (int iIndex = 0;iIndex < iNumDocs; iIndex++)
-// {
- if (CPDFSDK_Document* pDoc = pApp->GetCurrentDoc())
- {
- CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pDoc->GetInterForm();
- ASSERT(pInterForm != NULL);
- pInterForm->EnableCalculate((FX_BOOL)m_bCalculate);
- }
-// }
- }
- else
- {
- vp << (bool)m_bCalculate;
- }
-
- return TRUE;
-}
-
-FX_BOOL app::formsVersion(OBJ_PROP_PARAMS)
-{
- if (vp.IsGetting())
- {
- vp << JS_NUM_FORMSVERSION;
- return TRUE;
- }
-
- return FALSE;
-}
-
-FX_BOOL app::viewerType(OBJ_PROP_PARAMS)
-{
-
-
-
-
-
-
- if (vp.IsGetting())
- {
-// if (pApp->GetAppName() == PHANTOM)
-// vp << JS_STR_VIEWERTYPE_STANDARD;
-// else
-// vp << JS_STR_VIEWERTYPE_READER;
- vp << L"unknown";
-
- //vp << pApp->GetAppTitle();
- return TRUE;
- }
-
- return FALSE;
-}
-
-FX_BOOL app::viewerVariation(OBJ_PROP_PARAMS)
-{
- if (vp.IsGetting())
- {
- vp << JS_STR_VIEWERVARIATION;
- return TRUE;
- }
-
- return FALSE;
-}
-
-FX_BOOL app::viewerVersion(OBJ_PROP_PARAMS)
-{
- if (vp.IsGetting())
- {
- vp << JS_STR_VIEWERVERSION;
- return TRUE;
- }
-
- return FALSE;
-}
-
-FX_BOOL app::platform(OBJ_PROP_PARAMS)
-{
- if (vp.IsGetting())
- {
- vp << JS_STR_PLATFORM;
- return TRUE;
- }
-
- return FALSE;
-}
-
-FX_BOOL app::language(OBJ_PROP_PARAMS)
-{
- if (vp.IsGetting())
- {
- vp << JS_STR_LANGUANGE;
- return TRUE;
- }
-
- return FALSE;
-}
-
-//creates a new fdf object that contains no data
-//comment: need reader support
-//note:
-//CFDF_Document * CPDFDoc_Environment::NewFDF();
-FX_BOOL app::newFDF(OBJ_METHOD_PARAMS)
-{
- return TRUE;
-}
-//opens a specified pdf document and returns its document object
-//comment:need reader support
-//note: as defined in js reference, the proto of this function's fourth parmeters, how old an fdf document while do not show it.
-//CFDF_Document * CPDFDoc_Environment::OpenFDF(string strPath,bool bUserConv);
-
-FX_BOOL app::openFDF(OBJ_METHOD_PARAMS)
-{
- return TRUE;
-}
-
-FX_BOOL app::alert(OBJ_METHOD_PARAMS)
-{
- int iSize = params.size();
- if (iSize < 1)
- return FALSE;
-
- CFX_WideString swMsg = L"";
- CFX_WideString swTitle = L"";
- int iIcon = 0;
- int iType = 0;
-
- v8::Isolate* isolate = GetIsolate(cc);
-
- if (iSize == 1)
- {
- if (params[0].GetType() == VT_object)
- {
- JSObject pObj = params[0];
- {
- v8::Handle<v8::Value> pValue = JS_GetObjectElement(isolate, pObj, L"cMsg");
- swMsg = CJS_Value(isolate,pValue,VT_unknown).operator CFX_WideString();
-
- pValue = JS_GetObjectElement(isolate,pObj,L"cTitle");
- swTitle = CJS_Value(isolate, pValue,VT_unknown).operator CFX_WideString();
-
- pValue = JS_GetObjectElement(isolate,pObj,L"nIcon");
- iIcon = (int)CJS_Value(isolate,pValue,VT_unknown);
-
- pValue = JS_GetObjectElement(isolate,pObj,L"nType");
- iType = (int)CJS_Value(isolate,pValue,VT_unknown);
- }
-
- if (swMsg == L"")
- {
- CJS_Array carray(isolate);
- if (params[0].ConvertToArray(carray))
- {
- int iLenth = carray.GetLength();
- CJS_Value* pValue = new CJS_Value(isolate);
-// if (iLenth == 1)
-// pValue = new CJS_Value(isolate);
-// else if (iLenth > 1)
-// pValue = new CJS_Value[iLenth];
-
- for(int i = 0; i < iLenth; i++)
- {
- carray.GetElement(i, *pValue);
- swMsg += (*pValue).operator CFX_WideString();
- if (i < iLenth - 1)
- swMsg += L", ";
- }
-
- if(pValue) delete pValue;
-// if ((iLenth > 1) && pValue)
-// {
-// delete[]pValue;
-// pValue = NULL;
-// }
-// else if ((iLenth == 1) && pValue)
-// {
-// delete pValue;
-// pValue = NULL;
-// }
- }
- }
-
- if (swTitle == L"")
- swTitle = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSALERT);
- }
- else if (params[0].GetType() == VT_boolean)
- {
- FX_BOOL bGet = (FX_BOOL)params[0];
- if (bGet)
- swMsg = L"true";
- else
- swMsg = L"false";
-
- swTitle = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSALERT);
- }
- else
- {
- swMsg = params[0];
- swTitle = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSALERT);
- }
- }
- else
- {
- if (params[0].GetType() == VT_boolean)
- {
- FX_BOOL bGet = (FX_BOOL)params[0];
- if (bGet)
- swMsg = L"true";
- else
- swMsg = L"false";
- }
- else
- {
- swMsg = params[0];
- }
- swTitle = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSALERT);
-
- for(int i = 1;i<iSize;i++)
- {
- if (i == 1)
- iIcon = int(params[i]);
- if (i == 2)
- iType = int(params[i]);
- if (i == 3)
- swTitle = params[i];
- }
- }
-
-
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
- CJS_Runtime* pRuntime = pContext->GetJSRuntime();
- ASSERT(pRuntime != NULL);
- pRuntime->BeginBlock();
- vRet = MsgBox(pRuntime->GetReaderApp(), JSGetPageView(cc),swMsg,swTitle,iType,iIcon);
- pRuntime->EndBlock();
-
- return TRUE;
-}
-
-
-FX_BOOL app::beep(OBJ_METHOD_PARAMS)
-{
- if (params.size() == 1)
- {
- CJS_Context* pContext = (CJS_Context*)cc;
- CJS_Runtime* pRuntime = pContext->GetJSRuntime();
- CPDFDoc_Environment * pEnv = pRuntime->GetReaderApp();
- pEnv->JS_appBeep((int)params[0]);
-
- return TRUE;
- }
- else
- {
- sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPARAMERROR);
- return FALSE;
- }
-}
-
-FX_BOOL app::findComponent(OBJ_METHOD_PARAMS)
-{
- return TRUE;
-}
-
-FX_BOOL app::popUpMenuEx(OBJ_METHOD_PARAMS)
-{
- return FALSE;
-}
-
-FX_BOOL app::fs(OBJ_PROP_PARAMS)
-{
-#ifdef FOXIT_CHROME_BUILD
- return FALSE;
-#else
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
- CJS_Runtime* pRuntime = pContext->GetJSRuntime();
- ASSERT(pRuntime != NULL);
-
- if (vp.IsGetting())
- {
- return TRUE;
- }
- else
- {
- return TRUE;
- }
-#endif
-}
-
-FX_BOOL app::setInterval(OBJ_METHOD_PARAMS)
-{
- if (params.size() > 2 || params.size() == 0)
- {
- sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPARAMERROR);
- return FALSE;
- }
-
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
- CJS_Runtime* pRuntime = pContext->GetJSRuntime();
- ASSERT(pRuntime != NULL);
-
- CFX_WideString script = params.size() > 0 ? (FX_LPCWSTR)(params[0].operator CFX_WideString()) : (FX_LPCWSTR)L"";
- if (script.IsEmpty())
- {
- sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSAFNUMBER_KEYSTROKE);
- return TRUE;
- }
-
- FX_DWORD dwInterval = params.size() > 1 ? (int)params[1] : 1000;
-
- CPDFDoc_Environment* pApp = pRuntime->GetReaderApp();
- ASSERT(pApp);
- CJS_Timer* pTimer = new CJS_Timer(this, pApp);
- m_aTimer.Add(pTimer);
-
- pTimer->SetType(0);
- pTimer->SetRuntime(pRuntime);
- pTimer->SetJScript(script);
- pTimer->SetTimeOut(0);
-// pTimer->SetStartTime(GetTickCount());
- pTimer->SetJSTimer(dwInterval);
-
- JSFXObject pRetObj = JS_NewFxDynamicObj(*pRuntime, pContext, JS_GetObjDefnID(*pRuntime, L"TimerObj"));
-
- CJS_TimerObj* pJS_TimerObj = (CJS_TimerObj*)JS_GetPrivate(pRuntime->GetIsolate(),pRetObj);
- ASSERT(pJS_TimerObj != NULL);
-
- TimerObj* pTimerObj = (TimerObj*)pJS_TimerObj->GetEmbedObject();
- ASSERT(pTimerObj != NULL);
-
- pTimerObj->SetTimer(pTimer);
-
- vRet = pRetObj;
-
- return TRUE;
-}
-
-FX_BOOL app::setTimeOut(OBJ_METHOD_PARAMS)
-{
- if (params.size() > 2 || params.size() == 0)
- {
- sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPARAMERROR);
- return FALSE;
- }
-
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
- CJS_Runtime* pRuntime = pContext->GetJSRuntime();
- ASSERT(pRuntime != NULL);
-
- CFX_WideString script = params.size() > 0 ? (FX_LPCWSTR)(params[0].operator CFX_WideString()) : (FX_LPCWSTR)L"";
- if (script.IsEmpty())
- {
- sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSAFNUMBER_KEYSTROKE);
- return TRUE;
- }
-
- FX_DWORD dwTimeOut = params.size() > 1 ? (int)params[1] : 1000;
-
- CPDFDoc_Environment* pApp = pRuntime->GetReaderApp();
- ASSERT(pApp);
- CJS_Timer* pTimer = new CJS_Timer(this, pApp);
- m_aTimer.Add(pTimer);
-
- pTimer->SetType(1);
- pTimer->SetRuntime(pRuntime);
- pTimer->SetJScript(script);
- pTimer->SetTimeOut(dwTimeOut);
-// pTimer->SetStartTime(GetTickCount());
-// pTimer->SetJSTimer(1000);
- pTimer->SetJSTimer(dwTimeOut);
-
- JSFXObject pRetObj = JS_NewFxDynamicObj(*pRuntime, pContext, JS_GetObjDefnID(*pRuntime, L"TimerObj"));
-// ASSERT(pRetObj != NULL);
-
- CJS_TimerObj* pJS_TimerObj = (CJS_TimerObj*)JS_GetPrivate(pRuntime->GetIsolate(),pRetObj);
- ASSERT(pJS_TimerObj != NULL);
-
- TimerObj* pTimerObj = (TimerObj*)pJS_TimerObj->GetEmbedObject();
- ASSERT(pTimerObj != NULL);
-
- pTimerObj->SetTimer(pTimer);
-
- vRet = pRetObj;
-
- return TRUE;
-}
-
-FX_BOOL app::clearTimeOut(OBJ_METHOD_PARAMS)
-{
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
- CJS_Runtime* pRuntime = pContext->GetJSRuntime();
- ASSERT(pRuntime != NULL);
-
- if (params.size() != 1)
- {
- sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPARAMERROR);
- return FALSE;
- }
-
- if (params[0].GetType() == VT_fxobject)
- {
- JSFXObject pObj = (JSFXObject)params[0];
- {
- if (JS_GetObjDefnID(pObj) == JS_GetObjDefnID(*pRuntime, L"TimerObj"))
- {
- if (CJS_Object* pJSObj = (CJS_Object*)params[0])
- {
- if (TimerObj* pTimerObj = (TimerObj*)pJSObj->GetEmbedObject())
- {
- if (CJS_Timer* pTimer = pTimerObj->GetTimer())
- {
- pTimer->KillJSTimer();
-
- for (int i=0,sz=m_aTimer.GetSize(); i<sz; i++)
- {
- if (m_aTimer[i] == pTimer)
- {
- m_aTimer.RemoveAt(i);
- break;
- }
- }
-
- delete pTimer;
- pTimerObj->SetTimer(NULL);
- }
- }
- }
- }
- }
- }
-
- return TRUE;
-}
-
-FX_BOOL app::clearInterval(OBJ_METHOD_PARAMS)
-{
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
- CJS_Runtime* pRuntime = pContext->GetJSRuntime();
- ASSERT(pRuntime != NULL);
-
- if (params.size() != 1)
- {
- sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPARAMERROR);
- return FALSE;
- }
-
- if (params[0].GetType() == VT_fxobject)
- {
- JSFXObject pObj = (JSFXObject)params[0];
- {
- if (JS_GetObjDefnID(pObj) == JS_GetObjDefnID(*pRuntime, L"TimerObj"))
- {
- if (CJS_Object* pJSObj = (CJS_Object*)params[0])
- {
- if (TimerObj* pTimerObj = (TimerObj*)pJSObj->GetEmbedObject())
- {
- if (CJS_Timer* pTimer = pTimerObj->GetTimer())
- {
- pTimer->KillJSTimer();
-
- for (int i=0,sz=m_aTimer.GetSize(); i<sz; i++)
- {
- if (m_aTimer[i] == pTimer)
- {
- m_aTimer.RemoveAt(i);
- break;
- }
- }
-
- delete pTimer;
- pTimerObj->SetTimer(NULL);
- }
- }
- }
- }
- }
- }
-
- return TRUE;
-}
-
-FX_BOOL app::execMenuItem(OBJ_METHOD_PARAMS)
-{
- return FALSE;
-}
-
-void app::TimerProc(CJS_Timer* pTimer)
-{
- ASSERT(pTimer != NULL);
-
- switch (pTimer->GetType())
- {
- case 0: //interval
- RunJsScript(pTimer->GetRuntime(), pTimer->GetJScript());
- break;
- case 1:
- if (pTimer->GetTimeOut() > 0)
- {
- RunJsScript(pTimer->GetRuntime(), pTimer->GetJScript());
- pTimer->KillJSTimer();
- }
- break;
- }
-
-}
-
-void app::RunJsScript(CJS_Runtime* pRuntime,const CFX_WideString& wsScript)
-{
- ASSERT(pRuntime != NULL);
-
- if (!pRuntime->IsBlocking())
- {
- IFXJS_Context* pContext = pRuntime->NewContext();
- ASSERT(pContext != NULL);
- pContext->OnExternal_Exec();
- CFX_WideString wtInfo;
- pContext->RunScript(wsScript,wtInfo);
- pRuntime->ReleaseContext(pContext);
- }
-}
-
-FX_BOOL app::goBack(OBJ_METHOD_PARAMS)
-{
-
-
-
-
-
-
- return TRUE;
-}
-
-FX_BOOL app::goForward(OBJ_METHOD_PARAMS)
-{
-
-
-
-
-
-
- return TRUE;
-}
-
-FX_BOOL app::mailMsg(OBJ_METHOD_PARAMS)
-{
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
-
- v8::Isolate* isolate = GetIsolate(cc);
-
- FX_BOOL bUI = TRUE;
- CFX_WideString cTo = L"";
- CFX_WideString cCc = L"";
- CFX_WideString cBcc = L"";
- CFX_WideString cSubject = L"";
- CFX_WideString cMsg = L"";
- if(params.size() < 2)
- return FALSE;
-
- bUI = params.size()>=1?(int)params[0]:TRUE;
- cTo = params.size()>=2?(const wchar_t*)(FX_LPCWSTR)params[1].operator CFX_WideString():L"";
- cCc = params.size()>=3?(const wchar_t*)(FX_LPCWSTR)params[2].operator CFX_WideString():L"";
- cBcc = params.size()>=4?(const wchar_t*)(FX_LPCWSTR)params[3].operator CFX_WideString():L"";
- cSubject = params.size()>=5?(const wchar_t*)(FX_LPCWSTR)params[4].operator CFX_WideString():L"";
- cMsg = params.size()>=6?(const wchar_t*)(FX_LPCWSTR)params[5].operator CFX_WideString():L"";
-
-
- if (params[0].GetType() == VT_object)
- {
- JSObject pObj = (JSObject)params[0];
-
- v8::Handle<v8::Value> pValue = JS_GetObjectElement(isolate,pObj, L"bUI");
- bUI = (int)CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue));
-
- pValue = JS_GetObjectElement(isolate, pObj, L"cTo");
- cTo = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).operator CFX_WideString();
-
- pValue = JS_GetObjectElement(isolate,pObj, L"cCc");
- cCc = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).operator CFX_WideString();
-
- pValue = JS_GetObjectElement(isolate,pObj, L"cBcc");
- cBcc = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).operator CFX_WideString();
-
- pValue = JS_GetObjectElement(isolate,pObj, L"cSubject");
- cSubject = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).operator CFX_WideString();
-
- pValue = JS_GetObjectElement(isolate,pObj, L"cMsg");
- cMsg = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).operator CFX_WideString();
- }
-
-
-
- CJS_Runtime* pRuntime = pContext->GetJSRuntime();
- ASSERT(pRuntime != NULL);
-
- CPDFDoc_Environment* pApp = pContext->GetReaderApp();
- ASSERT(pApp != NULL);
-
- pRuntime->BeginBlock();
- pApp->JS_docmailForm(NULL, 0, bUI, (FX_LPCWSTR)cTo, (FX_LPCWSTR)cSubject, (FX_LPCWSTR)cCc, (FX_LPCWSTR)cBcc, (FX_LPCWSTR)cMsg);
- ///////////////////////////////////////////////////////////////////////////////////////////////
- pRuntime->EndBlock();
-
- //return bRet;
- return FALSE;
-}
-
-FX_BOOL app::launchURL(OBJ_METHOD_PARAMS)
-{
- if (IsSafeMode(cc)) return TRUE;
-
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
-
-
-
-
- CFX_WideString swURL = params[0].operator CFX_WideString();
-
- CJS_Runtime* pRuntime = pContext->GetJSRuntime();
- ASSERT(pRuntime != NULL);
-
- pRuntime->BeginBlock();
-// FX_BOOL bRet = pApp->OpenURL(swURL);
- pRuntime->EndBlock();
-
-// return bRet;
- return FALSE;
-}
-
-FX_BOOL app::runtimeHighlight(OBJ_PROP_PARAMS)
-{
- if (vp.IsSetting())
- {
- vp>>m_bRuntimeHighLight;
- }
- else
- {
- vp<<m_bRuntimeHighLight;
- }
-
- return TRUE;
-}
-
-FX_BOOL app::fullscreen(OBJ_PROP_PARAMS)
-{
- return FALSE;
-}
-
-FX_BOOL app::popUpMenu(OBJ_METHOD_PARAMS)
-{
- return FALSE;
-}
-
-
-FX_BOOL app::browseForDoc(OBJ_METHOD_PARAMS)
-{
- //This method may trigger a "file save" dialog,while enable user to save contents of the document.
- //Such action is considered to be unsafe.
- if (IsSafeMode(cc)) return TRUE;
-
- v8::Isolate* isolate = GetIsolate(cc);
-
- bool bSave = false;
- CFX_ByteString cFilenameInit = CFX_ByteString();
- CFX_ByteString cFSInit = CFX_ByteString();
-
- if(params.size()>0 && (params[0].GetType() == VT_object))
- {
- JSObject pObj = (JSObject )params[0];
-
- v8::Handle<v8::Value> pValue = JS_GetObjectElement(isolate,pObj,L"bSave");
- bSave = (bool)CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue));
-
- pValue = JS_GetObjectElement(isolate, pObj,L"cFilenameInit");
- {
- CJS_Value t = CJS_Value(isolate, pValue, GET_VALUE_TYPE(pValue));
- cFilenameInit = t.operator CFX_ByteString();
- }
-
- pValue = JS_GetObjectElement(isolate,pObj,L"cFSInit");
- {
- CJS_Value t = CJS_Value(isolate, pValue, GET_VALUE_TYPE(pValue));
- cFSInit = t.operator CFX_ByteString();
- }
- }
- else
- {
- if(params.size() >= 1)
- {
- bSave = (bool)params[0];
- }
- if(params.size() >= 2)
- {
- CJS_Value t = params[1];
- cFilenameInit = t.operator CFX_ByteString();
- }
- if(params.size() >= 3)
- {
- CJS_Value t = params[2];
- cFSInit = t.operator CFX_ByteString();
- }
- }
- CJS_Context* pContext = (CJS_Context *)cc;
- ASSERT(pContext != NULL);
-
- CPDFDoc_Environment* pApp = pContext->GetReaderApp();
- ASSERT(pApp != NULL);
-
- CJS_Runtime* pRuntime = pContext->GetJSRuntime();
- ASSERT(pRuntime != NULL);
-
- CFX_WideString wsFileNameInit = CFX_WideString::FromLocal(cFilenameInit);
- CFX_WideString wsFSInit = CFX_WideString::FromLocal(cFSInit);
- CFX_WideString wsFilePath = pApp->JS_appbrowseForDoc(bSave, wsFileNameInit);
- if(wsFilePath.IsEmpty())
- return FALSE;
-
- JSFXObject pRetObj = JS_NewFxDynamicObj(*pRuntime, pContext, -1);
-
- JS_PutObjectString(isolate,pRetObj, L"cPath", SysPathToPDFPath(wsFilePath));
- JS_PutObjectString(isolate,pRetObj, L"cURL", SysPathToPDFPath(wsFilePath));
-
- if (!cFSInit.IsEmpty())
- {
- JS_PutObjectString(isolate,pRetObj, L"cFS", CFX_WideString::FromLocal(cFSInit.GetBuffer(cFSInit.GetLength())));
- }
- else
- {
- JS_PutObjectString(isolate,pRetObj, L"cFS", CFX_WideString::FromLocal("DOS"));
- }
-
- vRet = pRetObj;
-
- return TRUE;
-}
-
-CFX_WideString app::SysPathToPDFPath(const CFX_WideString& sOldPath)
-{
- CFX_WideString sRet = L"/";
-
- for (int i=0,sz=sOldPath.GetLength(); i<sz; i++)
- {
- wchar_t c = sOldPath.GetAt(i);
- if (c == L':')
- {
- }
- else
- {
- if (c == L'\\')
- {
- sRet += L"/";
- }
- else
- {
- sRet += c;
- }
- }
- }
-
- return sRet;
-}
-
-CFX_WideString app::PDFPathToSysPath(const CFX_WideString& sOldPath)
-{
- //strLPath = "D:\temporay.fdf";
- CFX_WideString strOPath = sOldPath;
- strOPath.TrimLeft();
- strOPath.TrimRight();
-
- if (strOPath.GetAt(0) == L'/' && strOPath.GetAt(2) == L'/')
- {
- wchar_t c_Drive = strOPath.GetAt(1);
- if ((c_Drive >= L'a' && c_Drive <= L'z' )||( c_Drive >= L'A' && c_Drive <= L'Z'))
- {
- strOPath.Replace((FX_LPCWSTR)L"/",(FX_LPCWSTR)L"\\");
- //strOPath.SetAt(0,'');
- strOPath.Insert(2,':');
- strOPath.Delete(0);
- }
- }
-
- return strOPath;
-}
-
-CFX_WideString app::RelativePathToSysPath(const CFX_WideString& sOldPath, const CFX_WideString& sFilePath)
-{
-// if (!PathIsRelative(sOldPath)) return sOldPath;
-
- int nSplit = 0;
- for (int i=sFilePath.GetLength()-1; i>=0; i--)
- {
- if (sFilePath[i] == '\\' || sFilePath[i] == '/')
- {
- nSplit = i;
- break;
- }
- }
-
- return sFilePath.Left(nSplit+1) + sOldPath;
-}
-
-FX_BOOL app::newDoc(OBJ_METHOD_PARAMS)
-{
- return FALSE;
-}
-
-FX_BOOL app::openDoc(OBJ_METHOD_PARAMS)
-{
- return FALSE;
-}
-
-FX_BOOL app::response(OBJ_METHOD_PARAMS)
-{
- CFX_WideString swQuestion = L"";
- CFX_WideString swLabel = L"";
-#ifndef FOXIT_CHROME_BUILD
- CFX_WideString swTitle = L"Foxit";
-#else
- CFX_WideString swTitle = L"PDF";
-#endif
- CFX_WideString swDefault = L"";
- CFX_WideString swResponse = L"";
- bool bPassWord = false;
-
- v8::Isolate* isolate = GetIsolate(cc);
-
- int iLength = params.size();
- if (iLength > 0 && params[0].GetType() == VT_object)
- {
-
- JSObject pObj = (JSObject )params[0];
- v8::Handle<v8::Value> pValue = JS_GetObjectElement(isolate,pObj,L"cQuestion");
- swQuestion = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).operator CFX_WideString();
-
- pValue = JS_GetObjectElement(isolate,pObj,L"cTitle");
- swTitle = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).operator CFX_WideString();
-
- pValue = JS_GetObjectElement(isolate,pObj,L"cDefault");
- swDefault = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).operator CFX_WideString();
-
- pValue = JS_GetObjectElement(isolate,pObj,L"cLabel");
- swLabel = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).operator CFX_WideString();
-
- pValue = JS_GetObjectElement(isolate,pObj,L"bPassword");
- bPassWord = (bool)CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue));
- }
- else
- {
- switch(iLength)
- {
- case 1:
- swQuestion = params[0];
- break;
- case 2:
- swQuestion = params[0];
- swTitle = params[1];
- break;
- case 3:
- swQuestion = params[0];
- swTitle = params[1];
- swDefault = params[2];
- break;
- case 4:
- swQuestion = params[0];
- swTitle = params[1];
- swDefault = params[2];
- bPassWord = params[3];
- break;
- case 5:
- swQuestion = params[0];
- swTitle = params[1];
- swDefault = params[2];
- bPassWord = params[3];
- swLabel = params[4];
- break;
- default:
- break;
- }
- }
-
- CJS_Context* pContext = (CJS_Context *)cc;
- ASSERT(pContext != NULL);
-
- CPDFDoc_Environment* pApp = pContext->GetReaderApp();
- ASSERT(pApp != NULL);
- int nLength = 2048;
- char* pBuff = new char[nLength];
- nLength = pApp->JS_appResponse(swQuestion, swTitle, swDefault, swLabel, bPassWord, pBuff, nLength);
- if(nLength<=0)
- {
- vRet.SetNull();
- return FALSE;
- }
- else
- {
- nLength = nLength>2046?2046:nLength;
- pBuff[nLength] = 0;
- pBuff[nLength+1] = 0;
- swResponse = CFX_WideString::FromUTF16LE((unsigned short*)pBuff, nLength);
- vRet = swResponse;
- }
- delete[] pBuff;
-
- return TRUE;
-}
-
-FX_BOOL app::media(OBJ_PROP_PARAMS)
-{
- return FALSE;
-}
-
-FX_BOOL app::execDialog(OBJ_METHOD_PARAMS)
-{
- return TRUE;
-}
-
+// 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
+
+#include "../../include/javascript/JavaScript.h"
+#include "../../include/javascript/IJavaScript.h"
+#include "../../include/javascript/JS_Define.h"
+#include "../../include/javascript/JS_Object.h"
+#include "../../include/javascript/JS_Value.h"
+#include "../../include/javascript/app.h"
+#include "../../include/javascript/JS_EventHandler.h"
+#include "../../include/javascript/resource.h"
+#include "../../include/javascript/JS_Context.h"
+#include "../../include/javascript/JS_Runtime.h"
+#include "../../include/javascript/Document.h"
+
+
+static v8::Isolate* GetIsolate(IFXJS_Context* cc)
+{
+ CJS_Context* pContext = (CJS_Context *)cc;
+ ASSERT(pContext != NULL);
+
+ CJS_Runtime* pRuntime = pContext->GetJSRuntime();
+ ASSERT(pRuntime != NULL);
+
+ return pRuntime->GetIsolate();
+}
+
+/* ---------------------------- TimerObj ---------------------------- */
+
+BEGIN_JS_STATIC_CONST(CJS_TimerObj)
+END_JS_STATIC_CONST()
+
+BEGIN_JS_STATIC_PROP(CJS_TimerObj)
+END_JS_STATIC_PROP()
+
+BEGIN_JS_STATIC_METHOD(CJS_TimerObj)
+END_JS_STATIC_METHOD()
+
+IMPLEMENT_JS_CLASS(CJS_TimerObj, TimerObj)
+
+TimerObj::TimerObj(CJS_Object* pJSObject)
+: CJS_EmbedObj(pJSObject),
+m_pTimer(NULL)
+{
+
+}
+
+TimerObj::~TimerObj()
+{
+}
+
+void TimerObj::SetTimer(CJS_Timer* pTimer)
+{
+ m_pTimer = pTimer;
+}
+
+CJS_Timer* TimerObj::GetTimer() const
+{
+ return m_pTimer;
+}
+
+#define JS_STR_VIEWERTYPE_READER L"Reader"
+#define JS_STR_VIEWERTYPE_STANDARD L"Exchange"
+#define JS_STR_VIEWERVARIATION L"Full"
+#define JS_STR_PLATFORM L"WIN"
+#define JS_STR_LANGUANGE L"ENU"
+#define JS_STR_VIEWERVERSION 8
+#define JS_NUM_FORMSVERSION 7
+
+#define JS_FILEPATH_MAXLEN 2000
+
+/* ---------------------------- app ---------------------------- */
+
+BEGIN_JS_STATIC_CONST(CJS_App)
+END_JS_STATIC_CONST()
+
+BEGIN_JS_STATIC_PROP(CJS_App)
+ JS_STATIC_PROP_ENTRY(activeDocs)
+ JS_STATIC_PROP_ENTRY(calculate)
+ JS_STATIC_PROP_ENTRY(formsVersion)
+ JS_STATIC_PROP_ENTRY(fs)
+ JS_STATIC_PROP_ENTRY(fullscreen)
+ JS_STATIC_PROP_ENTRY(language)
+ JS_STATIC_PROP_ENTRY(media)
+ JS_STATIC_PROP_ENTRY(platform)
+ JS_STATIC_PROP_ENTRY(runtimeHighlight)
+ JS_STATIC_PROP_ENTRY(viewerType)
+ JS_STATIC_PROP_ENTRY(viewerVariation)
+ JS_STATIC_PROP_ENTRY(viewerVersion)
+END_JS_STATIC_PROP()
+
+BEGIN_JS_STATIC_METHOD(CJS_App)
+ JS_STATIC_METHOD_ENTRY(alert, 6)
+ JS_STATIC_METHOD_ENTRY(beep, 1)
+ JS_STATIC_METHOD_ENTRY(browseForDoc, 0)
+ JS_STATIC_METHOD_ENTRY(clearInterval, 1)
+ JS_STATIC_METHOD_ENTRY(clearTimeOut, 1)
+ JS_STATIC_METHOD_ENTRY(execDialog, 3)
+ JS_STATIC_METHOD_ENTRY(execMenuItem, 1)
+ JS_STATIC_METHOD_ENTRY(findComponent, 1)
+ JS_STATIC_METHOD_ENTRY(goBack, 0)
+ JS_STATIC_METHOD_ENTRY(goForward, 0)
+ JS_STATIC_METHOD_ENTRY(launchURL, 0)
+ JS_STATIC_METHOD_ENTRY(mailMsg, 0)
+ JS_STATIC_METHOD_ENTRY(newFDF, 0)
+ JS_STATIC_METHOD_ENTRY(newDoc, 0)
+ JS_STATIC_METHOD_ENTRY(openDoc, 0)
+ JS_STATIC_METHOD_ENTRY(openFDF, 5)
+ JS_STATIC_METHOD_ENTRY(popUpMenuEx, 0)
+ JS_STATIC_METHOD_ENTRY(popUpMenu, 0)
+ JS_STATIC_METHOD_ENTRY(response, 0)
+ JS_STATIC_METHOD_ENTRY(setInterval, 2)
+ JS_STATIC_METHOD_ENTRY(setTimeOut, 2)
+END_JS_STATIC_METHOD()
+
+IMPLEMENT_JS_CLASS(CJS_App,app)
+
+app::app(CJS_Object * pJSObject) : CJS_EmbedObj(pJSObject) ,
+ m_bCalculate(true),
+ m_pRuntime(NULL),
+ m_bRuntimeHighLight(false)
+// m_pMenuHead(NULL)
+{
+}
+
+app::~app(void)
+{
+ for (int i=0,sz=m_aTimer.GetSize(); i<sz; i++)
+ delete m_aTimer[i];
+
+ m_aTimer.RemoveAll();
+}
+
+FX_BOOL app::activeDocs(OBJ_PROP_PARAMS)
+{
+ if (vp.IsGetting())
+ {
+
+ CJS_Context* pContext = (CJS_Context *)cc;
+ ASSERT(pContext != NULL);
+
+ CPDFDoc_Environment* pApp = pContext->GetReaderApp();
+ ASSERT(pApp != NULL);
+
+ CJS_Runtime* pRuntime = pContext->GetJSRuntime();
+ ASSERT(pRuntime != NULL);
+
+ CPDFSDK_Document* pCurDoc = pContext->GetReaderDocument();
+
+ CJS_Array aDocs(pRuntime->GetIsolate());
+// int iNumDocs = pApp->CountDocuments();
+
+// for(int iIndex = 0; iIndex<iNumDocs; iIndex++)
+// {
+ CPDFSDK_Document* pDoc = pApp->GetCurrentDoc();
+ if (pDoc)
+ {
+ CJS_Document * pJSDocument = NULL;
+
+ if (pDoc == pCurDoc)
+ {
+ JSFXObject pObj = JS_GetThisObj(*pRuntime);
+
+ if (JS_GetObjDefnID(pObj) == JS_GetObjDefnID(*pRuntime, L"Document"))
+ {
+ pJSDocument = (CJS_Document*)JS_GetPrivate(pRuntime->GetIsolate(),pObj);
+ }
+ }
+ else
+ {
+ JSFXObject pObj = JS_NewFxDynamicObj(*pRuntime, pContext, JS_GetObjDefnID(*pRuntime,L"Document"));
+ pJSDocument = (CJS_Document*)JS_GetPrivate(pRuntime->GetIsolate(),pObj);
+ ASSERT(pJSDocument != NULL);
+
+
+ // pDocument->AttachDoc(pDoc);
+ }
+
+ aDocs.SetElement(0,CJS_Value(pRuntime->GetIsolate(),pJSDocument));
+ }
+ // }
+
+ if (aDocs.GetLength() > 0)
+ vp << aDocs;
+ else
+ vp.SetNull();
+ return TRUE;
+ }
+ return FALSE;
+}
+
+FX_BOOL app::calculate(OBJ_PROP_PARAMS)
+{
+ if (vp.IsSetting())
+ {
+ bool bVP;
+ vp >> bVP;
+ m_bCalculate = (FX_BOOL)bVP;
+
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+
+ CPDFDoc_Environment* pApp = pContext->GetReaderApp();
+ ASSERT(pApp != NULL);
+
+ CJS_Runtime* pRuntime = pContext->GetJSRuntime();
+ ASSERT(pRuntime != NULL);
+
+ CJS_Array aDocs(pRuntime->GetIsolate());
+// int iNumDocs = pApp->CountDocuments();
+//
+// for (int iIndex = 0;iIndex < iNumDocs; iIndex++)
+// {
+ if (CPDFSDK_Document* pDoc = pApp->GetCurrentDoc())
+ {
+ CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pDoc->GetInterForm();
+ ASSERT(pInterForm != NULL);
+ pInterForm->EnableCalculate((FX_BOOL)m_bCalculate);
+ }
+// }
+ }
+ else
+ {
+ vp << (bool)m_bCalculate;
+ }
+
+ return TRUE;
+}
+
+FX_BOOL app::formsVersion(OBJ_PROP_PARAMS)
+{
+ if (vp.IsGetting())
+ {
+ vp << JS_NUM_FORMSVERSION;
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+FX_BOOL app::viewerType(OBJ_PROP_PARAMS)
+{
+
+
+
+
+
+
+ if (vp.IsGetting())
+ {
+// if (pApp->GetAppName() == PHANTOM)
+// vp << JS_STR_VIEWERTYPE_STANDARD;
+// else
+// vp << JS_STR_VIEWERTYPE_READER;
+ vp << L"unknown";
+
+ //vp << pApp->GetAppTitle();
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+FX_BOOL app::viewerVariation(OBJ_PROP_PARAMS)
+{
+ if (vp.IsGetting())
+ {
+ vp << JS_STR_VIEWERVARIATION;
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+FX_BOOL app::viewerVersion(OBJ_PROP_PARAMS)
+{
+ if (vp.IsGetting())
+ {
+ vp << JS_STR_VIEWERVERSION;
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+FX_BOOL app::platform(OBJ_PROP_PARAMS)
+{
+ if (vp.IsGetting())
+ {
+ vp << JS_STR_PLATFORM;
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+FX_BOOL app::language(OBJ_PROP_PARAMS)
+{
+ if (vp.IsGetting())
+ {
+ vp << JS_STR_LANGUANGE;
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+//creates a new fdf object that contains no data
+//comment: need reader support
+//note:
+//CFDF_Document * CPDFDoc_Environment::NewFDF();
+FX_BOOL app::newFDF(OBJ_METHOD_PARAMS)
+{
+ return TRUE;
+}
+//opens a specified pdf document and returns its document object
+//comment:need reader support
+//note: as defined in js reference, the proto of this function's fourth parmeters, how old an fdf document while do not show it.
+//CFDF_Document * CPDFDoc_Environment::OpenFDF(string strPath,bool bUserConv);
+
+FX_BOOL app::openFDF(OBJ_METHOD_PARAMS)
+{
+ return TRUE;
+}
+
+FX_BOOL app::alert(OBJ_METHOD_PARAMS)
+{
+ int iSize = params.size();
+ if (iSize < 1)
+ return FALSE;
+
+ CFX_WideString swMsg = L"";
+ CFX_WideString swTitle = L"";
+ int iIcon = 0;
+ int iType = 0;
+
+ v8::Isolate* isolate = GetIsolate(cc);
+
+ if (iSize == 1)
+ {
+ if (params[0].GetType() == VT_object)
+ {
+ JSObject pObj = params[0];
+ {
+ v8::Handle<v8::Value> pValue = JS_GetObjectElement(isolate, pObj, L"cMsg");
+ swMsg = CJS_Value(isolate,pValue,VT_unknown).operator CFX_WideString();
+
+ pValue = JS_GetObjectElement(isolate,pObj,L"cTitle");
+ swTitle = CJS_Value(isolate, pValue,VT_unknown).operator CFX_WideString();
+
+ pValue = JS_GetObjectElement(isolate,pObj,L"nIcon");
+ iIcon = (int)CJS_Value(isolate,pValue,VT_unknown);
+
+ pValue = JS_GetObjectElement(isolate,pObj,L"nType");
+ iType = (int)CJS_Value(isolate,pValue,VT_unknown);
+ }
+
+ if (swMsg == L"")
+ {
+ CJS_Array carray(isolate);
+ if (params[0].ConvertToArray(carray))
+ {
+ int iLenth = carray.GetLength();
+ CJS_Value* pValue = new CJS_Value(isolate);
+// if (iLenth == 1)
+// pValue = new CJS_Value(isolate);
+// else if (iLenth > 1)
+// pValue = new CJS_Value[iLenth];
+
+ for(int i = 0; i < iLenth; i++)
+ {
+ carray.GetElement(i, *pValue);
+ swMsg += (*pValue).operator CFX_WideString();
+ if (i < iLenth - 1)
+ swMsg += L", ";
+ }
+
+ if(pValue) delete pValue;
+// if ((iLenth > 1) && pValue)
+// {
+// delete[]pValue;
+// pValue = NULL;
+// }
+// else if ((iLenth == 1) && pValue)
+// {
+// delete pValue;
+// pValue = NULL;
+// }
+ }
+ }
+
+ if (swTitle == L"")
+ swTitle = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSALERT);
+ }
+ else if (params[0].GetType() == VT_boolean)
+ {
+ FX_BOOL bGet = (FX_BOOL)params[0];
+ if (bGet)
+ swMsg = L"true";
+ else
+ swMsg = L"false";
+
+ swTitle = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSALERT);
+ }
+ else
+ {
+ swMsg = params[0];
+ swTitle = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSALERT);
+ }
+ }
+ else
+ {
+ if (params[0].GetType() == VT_boolean)
+ {
+ FX_BOOL bGet = (FX_BOOL)params[0];
+ if (bGet)
+ swMsg = L"true";
+ else
+ swMsg = L"false";
+ }
+ else
+ {
+ swMsg = params[0];
+ }
+ swTitle = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSALERT);
+
+ for(int i = 1;i<iSize;i++)
+ {
+ if (i == 1)
+ iIcon = int(params[i]);
+ if (i == 2)
+ iType = int(params[i]);
+ if (i == 3)
+ swTitle = params[i];
+ }
+ }
+
+
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+ CJS_Runtime* pRuntime = pContext->GetJSRuntime();
+ ASSERT(pRuntime != NULL);
+ pRuntime->BeginBlock();
+ vRet = MsgBox(pRuntime->GetReaderApp(), JSGetPageView(cc),swMsg,swTitle,iType,iIcon);
+ pRuntime->EndBlock();
+
+ return TRUE;
+}
+
+
+FX_BOOL app::beep(OBJ_METHOD_PARAMS)
+{
+ if (params.size() == 1)
+ {
+ CJS_Context* pContext = (CJS_Context*)cc;
+ CJS_Runtime* pRuntime = pContext->GetJSRuntime();
+ CPDFDoc_Environment * pEnv = pRuntime->GetReaderApp();
+ pEnv->JS_appBeep((int)params[0]);
+
+ return TRUE;
+ }
+ else
+ {
+ sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPARAMERROR);
+ return FALSE;
+ }
+}
+
+FX_BOOL app::findComponent(OBJ_METHOD_PARAMS)
+{
+ return TRUE;
+}
+
+FX_BOOL app::popUpMenuEx(OBJ_METHOD_PARAMS)
+{
+ return FALSE;
+}
+
+FX_BOOL app::fs(OBJ_PROP_PARAMS)
+{
+#ifdef FOXIT_CHROME_BUILD
+ return FALSE;
+#else
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+ CJS_Runtime* pRuntime = pContext->GetJSRuntime();
+ ASSERT(pRuntime != NULL);
+
+ if (vp.IsGetting())
+ {
+ return TRUE;
+ }
+ else
+ {
+ return TRUE;
+ }
+#endif
+}
+
+FX_BOOL app::setInterval(OBJ_METHOD_PARAMS)
+{
+ if (params.size() > 2 || params.size() == 0)
+ {
+ sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPARAMERROR);
+ return FALSE;
+ }
+
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+ CJS_Runtime* pRuntime = pContext->GetJSRuntime();
+ ASSERT(pRuntime != NULL);
+
+ CFX_WideString script = params.size() > 0 ? (FX_LPCWSTR)(params[0].operator CFX_WideString()) : (FX_LPCWSTR)L"";
+ if (script.IsEmpty())
+ {
+ sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSAFNUMBER_KEYSTROKE);
+ return TRUE;
+ }
+
+ FX_DWORD dwInterval = params.size() > 1 ? (int)params[1] : 1000;
+
+ CPDFDoc_Environment* pApp = pRuntime->GetReaderApp();
+ ASSERT(pApp);
+ CJS_Timer* pTimer = new CJS_Timer(this, pApp);
+ m_aTimer.Add(pTimer);
+
+ pTimer->SetType(0);
+ pTimer->SetRuntime(pRuntime);
+ pTimer->SetJScript(script);
+ pTimer->SetTimeOut(0);
+// pTimer->SetStartTime(GetTickCount());
+ pTimer->SetJSTimer(dwInterval);
+
+ JSFXObject pRetObj = JS_NewFxDynamicObj(*pRuntime, pContext, JS_GetObjDefnID(*pRuntime, L"TimerObj"));
+
+ CJS_TimerObj* pJS_TimerObj = (CJS_TimerObj*)JS_GetPrivate(pRuntime->GetIsolate(),pRetObj);
+ ASSERT(pJS_TimerObj != NULL);
+
+ TimerObj* pTimerObj = (TimerObj*)pJS_TimerObj->GetEmbedObject();
+ ASSERT(pTimerObj != NULL);
+
+ pTimerObj->SetTimer(pTimer);
+
+ vRet = pRetObj;
+
+ return TRUE;
+}
+
+FX_BOOL app::setTimeOut(OBJ_METHOD_PARAMS)
+{
+ if (params.size() > 2 || params.size() == 0)
+ {
+ sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPARAMERROR);
+ return FALSE;
+ }
+
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+ CJS_Runtime* pRuntime = pContext->GetJSRuntime();
+ ASSERT(pRuntime != NULL);
+
+ CFX_WideString script = params.size() > 0 ? (FX_LPCWSTR)(params[0].operator CFX_WideString()) : (FX_LPCWSTR)L"";
+ if (script.IsEmpty())
+ {
+ sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSAFNUMBER_KEYSTROKE);
+ return TRUE;
+ }
+
+ FX_DWORD dwTimeOut = params.size() > 1 ? (int)params[1] : 1000;
+
+ CPDFDoc_Environment* pApp = pRuntime->GetReaderApp();
+ ASSERT(pApp);
+ CJS_Timer* pTimer = new CJS_Timer(this, pApp);
+ m_aTimer.Add(pTimer);
+
+ pTimer->SetType(1);
+ pTimer->SetRuntime(pRuntime);
+ pTimer->SetJScript(script);
+ pTimer->SetTimeOut(dwTimeOut);
+// pTimer->SetStartTime(GetTickCount());
+// pTimer->SetJSTimer(1000);
+ pTimer->SetJSTimer(dwTimeOut);
+
+ JSFXObject pRetObj = JS_NewFxDynamicObj(*pRuntime, pContext, JS_GetObjDefnID(*pRuntime, L"TimerObj"));
+// ASSERT(pRetObj != NULL);
+
+ CJS_TimerObj* pJS_TimerObj = (CJS_TimerObj*)JS_GetPrivate(pRuntime->GetIsolate(),pRetObj);
+ ASSERT(pJS_TimerObj != NULL);
+
+ TimerObj* pTimerObj = (TimerObj*)pJS_TimerObj->GetEmbedObject();
+ ASSERT(pTimerObj != NULL);
+
+ pTimerObj->SetTimer(pTimer);
+
+ vRet = pRetObj;
+
+ return TRUE;
+}
+
+FX_BOOL app::clearTimeOut(OBJ_METHOD_PARAMS)
+{
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+ CJS_Runtime* pRuntime = pContext->GetJSRuntime();
+ ASSERT(pRuntime != NULL);
+
+ if (params.size() != 1)
+ {
+ sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPARAMERROR);
+ return FALSE;
+ }
+
+ if (params[0].GetType() == VT_fxobject)
+ {
+ JSFXObject pObj = (JSFXObject)params[0];
+ {
+ if (JS_GetObjDefnID(pObj) == JS_GetObjDefnID(*pRuntime, L"TimerObj"))
+ {
+ if (CJS_Object* pJSObj = (CJS_Object*)params[0])
+ {
+ if (TimerObj* pTimerObj = (TimerObj*)pJSObj->GetEmbedObject())
+ {
+ if (CJS_Timer* pTimer = pTimerObj->GetTimer())
+ {
+ pTimer->KillJSTimer();
+
+ for (int i=0,sz=m_aTimer.GetSize(); i<sz; i++)
+ {
+ if (m_aTimer[i] == pTimer)
+ {
+ m_aTimer.RemoveAt(i);
+ break;
+ }
+ }
+
+ delete pTimer;
+ pTimerObj->SetTimer(NULL);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return TRUE;
+}
+
+FX_BOOL app::clearInterval(OBJ_METHOD_PARAMS)
+{
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+ CJS_Runtime* pRuntime = pContext->GetJSRuntime();
+ ASSERT(pRuntime != NULL);
+
+ if (params.size() != 1)
+ {
+ sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPARAMERROR);
+ return FALSE;
+ }
+
+ if (params[0].GetType() == VT_fxobject)
+ {
+ JSFXObject pObj = (JSFXObject)params[0];
+ {
+ if (JS_GetObjDefnID(pObj) == JS_GetObjDefnID(*pRuntime, L"TimerObj"))
+ {
+ if (CJS_Object* pJSObj = (CJS_Object*)params[0])
+ {
+ if (TimerObj* pTimerObj = (TimerObj*)pJSObj->GetEmbedObject())
+ {
+ if (CJS_Timer* pTimer = pTimerObj->GetTimer())
+ {
+ pTimer->KillJSTimer();
+
+ for (int i=0,sz=m_aTimer.GetSize(); i<sz; i++)
+ {
+ if (m_aTimer[i] == pTimer)
+ {
+ m_aTimer.RemoveAt(i);
+ break;
+ }
+ }
+
+ delete pTimer;
+ pTimerObj->SetTimer(NULL);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return TRUE;
+}
+
+FX_BOOL app::execMenuItem(OBJ_METHOD_PARAMS)
+{
+ return FALSE;
+}
+
+void app::TimerProc(CJS_Timer* pTimer)
+{
+ ASSERT(pTimer != NULL);
+
+ switch (pTimer->GetType())
+ {
+ case 0: //interval
+ RunJsScript(pTimer->GetRuntime(), pTimer->GetJScript());
+ break;
+ case 1:
+ if (pTimer->GetTimeOut() > 0)
+ {
+ RunJsScript(pTimer->GetRuntime(), pTimer->GetJScript());
+ pTimer->KillJSTimer();
+ }
+ break;
+ }
+
+}
+
+void app::RunJsScript(CJS_Runtime* pRuntime,const CFX_WideString& wsScript)
+{
+ ASSERT(pRuntime != NULL);
+
+ if (!pRuntime->IsBlocking())
+ {
+ IFXJS_Context* pContext = pRuntime->NewContext();
+ ASSERT(pContext != NULL);
+ pContext->OnExternal_Exec();
+ CFX_WideString wtInfo;
+ pContext->RunScript(wsScript,wtInfo);
+ pRuntime->ReleaseContext(pContext);
+ }
+}
+
+FX_BOOL app::goBack(OBJ_METHOD_PARAMS)
+{
+
+
+
+
+
+
+ return TRUE;
+}
+
+FX_BOOL app::goForward(OBJ_METHOD_PARAMS)
+{
+
+
+
+
+
+
+ return TRUE;
+}
+
+FX_BOOL app::mailMsg(OBJ_METHOD_PARAMS)
+{
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+
+ v8::Isolate* isolate = GetIsolate(cc);
+
+ FX_BOOL bUI = TRUE;
+ CFX_WideString cTo = L"";
+ CFX_WideString cCc = L"";
+ CFX_WideString cBcc = L"";
+ CFX_WideString cSubject = L"";
+ CFX_WideString cMsg = L"";
+ if(params.size() < 2)
+ return FALSE;
+
+ bUI = params.size()>=1?(int)params[0]:TRUE;
+ cTo = params.size()>=2?(const wchar_t*)(FX_LPCWSTR)params[1].operator CFX_WideString():L"";
+ cCc = params.size()>=3?(const wchar_t*)(FX_LPCWSTR)params[2].operator CFX_WideString():L"";
+ cBcc = params.size()>=4?(const wchar_t*)(FX_LPCWSTR)params[3].operator CFX_WideString():L"";
+ cSubject = params.size()>=5?(const wchar_t*)(FX_LPCWSTR)params[4].operator CFX_WideString():L"";
+ cMsg = params.size()>=6?(const wchar_t*)(FX_LPCWSTR)params[5].operator CFX_WideString():L"";
+
+
+ if (params[0].GetType() == VT_object)
+ {
+ JSObject pObj = (JSObject)params[0];
+
+ v8::Handle<v8::Value> pValue = JS_GetObjectElement(isolate,pObj, L"bUI");
+ bUI = (int)CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue));
+
+ pValue = JS_GetObjectElement(isolate, pObj, L"cTo");
+ cTo = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).operator CFX_WideString();
+
+ pValue = JS_GetObjectElement(isolate,pObj, L"cCc");
+ cCc = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).operator CFX_WideString();
+
+ pValue = JS_GetObjectElement(isolate,pObj, L"cBcc");
+ cBcc = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).operator CFX_WideString();
+
+ pValue = JS_GetObjectElement(isolate,pObj, L"cSubject");
+ cSubject = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).operator CFX_WideString();
+
+ pValue = JS_GetObjectElement(isolate,pObj, L"cMsg");
+ cMsg = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).operator CFX_WideString();
+ }
+
+
+
+ CJS_Runtime* pRuntime = pContext->GetJSRuntime();
+ ASSERT(pRuntime != NULL);
+
+ CPDFDoc_Environment* pApp = pContext->GetReaderApp();
+ ASSERT(pApp != NULL);
+
+ pRuntime->BeginBlock();
+ pApp->JS_docmailForm(NULL, 0, bUI, (FX_LPCWSTR)cTo, (FX_LPCWSTR)cSubject, (FX_LPCWSTR)cCc, (FX_LPCWSTR)cBcc, (FX_LPCWSTR)cMsg);
+ ///////////////////////////////////////////////////////////////////////////////////////////////
+ pRuntime->EndBlock();
+
+ //return bRet;
+ return FALSE;
+}
+
+FX_BOOL app::launchURL(OBJ_METHOD_PARAMS)
+{
+ if (IsSafeMode(cc)) return TRUE;
+
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+
+
+
+
+ CFX_WideString swURL = params[0].operator CFX_WideString();
+
+ CJS_Runtime* pRuntime = pContext->GetJSRuntime();
+ ASSERT(pRuntime != NULL);
+
+ pRuntime->BeginBlock();
+// FX_BOOL bRet = pApp->OpenURL(swURL);
+ pRuntime->EndBlock();
+
+// return bRet;
+ return FALSE;
+}
+
+FX_BOOL app::runtimeHighlight(OBJ_PROP_PARAMS)
+{
+ if (vp.IsSetting())
+ {
+ vp>>m_bRuntimeHighLight;
+ }
+ else
+ {
+ vp<<m_bRuntimeHighLight;
+ }
+
+ return TRUE;
+}
+
+FX_BOOL app::fullscreen(OBJ_PROP_PARAMS)
+{
+ return FALSE;
+}
+
+FX_BOOL app::popUpMenu(OBJ_METHOD_PARAMS)
+{
+ return FALSE;
+}
+
+
+FX_BOOL app::browseForDoc(OBJ_METHOD_PARAMS)
+{
+ //This method may trigger a "file save" dialog,while enable user to save contents of the document.
+ //Such action is considered to be unsafe.
+ if (IsSafeMode(cc)) return TRUE;
+
+ v8::Isolate* isolate = GetIsolate(cc);
+
+ bool bSave = false;
+ CFX_ByteString cFilenameInit = CFX_ByteString();
+ CFX_ByteString cFSInit = CFX_ByteString();
+
+ if(params.size()>0 && (params[0].GetType() == VT_object))
+ {
+ JSObject pObj = (JSObject )params[0];
+
+ v8::Handle<v8::Value> pValue = JS_GetObjectElement(isolate,pObj,L"bSave");
+ bSave = (bool)CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue));
+
+ pValue = JS_GetObjectElement(isolate, pObj,L"cFilenameInit");
+ {
+ CJS_Value t = CJS_Value(isolate, pValue, GET_VALUE_TYPE(pValue));
+ cFilenameInit = t.operator CFX_ByteString();
+ }
+
+ pValue = JS_GetObjectElement(isolate,pObj,L"cFSInit");
+ {
+ CJS_Value t = CJS_Value(isolate, pValue, GET_VALUE_TYPE(pValue));
+ cFSInit = t.operator CFX_ByteString();
+ }
+ }
+ else
+ {
+ if(params.size() >= 1)
+ {
+ bSave = (bool)params[0];
+ }
+ if(params.size() >= 2)
+ {
+ CJS_Value t = params[1];
+ cFilenameInit = t.operator CFX_ByteString();
+ }
+ if(params.size() >= 3)
+ {
+ CJS_Value t = params[2];
+ cFSInit = t.operator CFX_ByteString();
+ }
+ }
+ CJS_Context* pContext = (CJS_Context *)cc;
+ ASSERT(pContext != NULL);
+
+ CPDFDoc_Environment* pApp = pContext->GetReaderApp();
+ ASSERT(pApp != NULL);
+
+ CJS_Runtime* pRuntime = pContext->GetJSRuntime();
+ ASSERT(pRuntime != NULL);
+
+ CFX_WideString wsFileNameInit = CFX_WideString::FromLocal(cFilenameInit);
+ CFX_WideString wsFSInit = CFX_WideString::FromLocal(cFSInit);
+ CFX_WideString wsFilePath = pApp->JS_appbrowseForDoc(bSave, wsFileNameInit);
+ if(wsFilePath.IsEmpty())
+ return FALSE;
+
+ JSFXObject pRetObj = JS_NewFxDynamicObj(*pRuntime, pContext, -1);
+
+ JS_PutObjectString(isolate,pRetObj, L"cPath", SysPathToPDFPath(wsFilePath));
+ JS_PutObjectString(isolate,pRetObj, L"cURL", SysPathToPDFPath(wsFilePath));
+
+ if (!cFSInit.IsEmpty())
+ {
+ JS_PutObjectString(isolate,pRetObj, L"cFS", CFX_WideString::FromLocal(cFSInit.GetBuffer(cFSInit.GetLength())));
+ }
+ else
+ {
+ JS_PutObjectString(isolate,pRetObj, L"cFS", CFX_WideString::FromLocal("DOS"));
+ }
+
+ vRet = pRetObj;
+
+ return TRUE;
+}
+
+CFX_WideString app::SysPathToPDFPath(const CFX_WideString& sOldPath)
+{
+ CFX_WideString sRet = L"/";
+
+ for (int i=0,sz=sOldPath.GetLength(); i<sz; i++)
+ {
+ wchar_t c = sOldPath.GetAt(i);
+ if (c == L':')
+ {
+ }
+ else
+ {
+ if (c == L'\\')
+ {
+ sRet += L"/";
+ }
+ else
+ {
+ sRet += c;
+ }
+ }
+ }
+
+ return sRet;
+}
+
+CFX_WideString app::PDFPathToSysPath(const CFX_WideString& sOldPath)
+{
+ //strLPath = "D:\temporay.fdf";
+ CFX_WideString strOPath = sOldPath;
+ strOPath.TrimLeft();
+ strOPath.TrimRight();
+
+ if (strOPath.GetAt(0) == L'/' && strOPath.GetAt(2) == L'/')
+ {
+ wchar_t c_Drive = strOPath.GetAt(1);
+ if ((c_Drive >= L'a' && c_Drive <= L'z' )||( c_Drive >= L'A' && c_Drive <= L'Z'))
+ {
+ strOPath.Replace((FX_LPCWSTR)L"/",(FX_LPCWSTR)L"\\");
+ //strOPath.SetAt(0,'');
+ strOPath.Insert(2,':');
+ strOPath.Delete(0);
+ }
+ }
+
+ return strOPath;
+}
+
+CFX_WideString app::RelativePathToSysPath(const CFX_WideString& sOldPath, const CFX_WideString& sFilePath)
+{
+// if (!PathIsRelative(sOldPath)) return sOldPath;
+
+ int nSplit = 0;
+ for (int i=sFilePath.GetLength()-1; i>=0; i--)
+ {
+ if (sFilePath[i] == '\\' || sFilePath[i] == '/')
+ {
+ nSplit = i;
+ break;
+ }
+ }
+
+ return sFilePath.Left(nSplit+1) + sOldPath;
+}
+
+FX_BOOL app::newDoc(OBJ_METHOD_PARAMS)
+{
+ return FALSE;
+}
+
+FX_BOOL app::openDoc(OBJ_METHOD_PARAMS)
+{
+ return FALSE;
+}
+
+FX_BOOL app::response(OBJ_METHOD_PARAMS)
+{
+ CFX_WideString swQuestion = L"";
+ CFX_WideString swLabel = L"";
+#ifndef FOXIT_CHROME_BUILD
+ CFX_WideString swTitle = L"Foxit";
+#else
+ CFX_WideString swTitle = L"PDF";
+#endif
+ CFX_WideString swDefault = L"";
+ CFX_WideString swResponse = L"";
+ bool bPassWord = false;
+
+ v8::Isolate* isolate = GetIsolate(cc);
+
+ int iLength = params.size();
+ if (iLength > 0 && params[0].GetType() == VT_object)
+ {
+
+ JSObject pObj = (JSObject )params[0];
+ v8::Handle<v8::Value> pValue = JS_GetObjectElement(isolate,pObj,L"cQuestion");
+ swQuestion = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).operator CFX_WideString();
+
+ pValue = JS_GetObjectElement(isolate,pObj,L"cTitle");
+ swTitle = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).operator CFX_WideString();
+
+ pValue = JS_GetObjectElement(isolate,pObj,L"cDefault");
+ swDefault = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).operator CFX_WideString();
+
+ pValue = JS_GetObjectElement(isolate,pObj,L"cLabel");
+ swLabel = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).operator CFX_WideString();
+
+ pValue = JS_GetObjectElement(isolate,pObj,L"bPassword");
+ bPassWord = (bool)CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue));
+ }
+ else
+ {
+ switch(iLength)
+ {
+ case 1:
+ swQuestion = params[0];
+ break;
+ case 2:
+ swQuestion = params[0];
+ swTitle = params[1];
+ break;
+ case 3:
+ swQuestion = params[0];
+ swTitle = params[1];
+ swDefault = params[2];
+ break;
+ case 4:
+ swQuestion = params[0];
+ swTitle = params[1];
+ swDefault = params[2];
+ bPassWord = params[3];
+ break;
+ case 5:
+ swQuestion = params[0];
+ swTitle = params[1];
+ swDefault = params[2];
+ bPassWord = params[3];
+ swLabel = params[4];
+ break;
+ default:
+ break;
+ }
+ }
+
+ CJS_Context* pContext = (CJS_Context *)cc;
+ ASSERT(pContext != NULL);
+
+ CPDFDoc_Environment* pApp = pContext->GetReaderApp();
+ ASSERT(pApp != NULL);
+ int nLength = 2048;
+ char* pBuff = new char[nLength];
+ nLength = pApp->JS_appResponse(swQuestion, swTitle, swDefault, swLabel, bPassWord, pBuff, nLength);
+ if(nLength<=0)
+ {
+ vRet.SetNull();
+ return FALSE;
+ }
+ else
+ {
+ nLength = nLength>2046?2046:nLength;
+ pBuff[nLength] = 0;
+ pBuff[nLength+1] = 0;
+ swResponse = CFX_WideString::FromUTF16LE((unsigned short*)pBuff, nLength);
+ vRet = swResponse;
+ }
+ delete[] pBuff;
+
+ return TRUE;
+}
+
+FX_BOOL app::media(OBJ_PROP_PARAMS)
+{
+ return FALSE;
+}
+
+FX_BOOL app::execDialog(OBJ_METHOD_PARAMS)
+{
+ return TRUE;
+}
+
diff --git a/fpdfsdk/src/javascript/color.cpp b/fpdfsdk/src/javascript/color.cpp
index de5a53fc5f..3841706743 100644
--- a/fpdfsdk/src/javascript/color.cpp
+++ b/fpdfsdk/src/javascript/color.cpp
@@ -1,253 +1,253 @@
-// 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
-
-#include "../../include/javascript/JavaScript.h"
-#include "../../include/javascript/IJavaScript.h"
-#include "../../include/javascript/JS_Define.h"
-#include "../../include/javascript/JS_Object.h"
-#include "../../include/javascript/JS_Value.h"
-#include "../../include/javascript/color.h"
-#include "../../include/javascript/JS_EventHandler.h"
-#include "../../include/javascript/JS_Context.h"
-#include "../../include/javascript/JS_Runtime.h"
-
-static v8::Isolate* GetIsolate(IFXJS_Context* cc)
-{
- CJS_Context* pContext = (CJS_Context *)cc;
- ASSERT(pContext != NULL);
-
- CJS_Runtime* pRuntime = pContext->GetJSRuntime();
- ASSERT(pRuntime != NULL);
-
- return pRuntime->GetIsolate();
-}
-/* -------------------------- color -------------------------- */
-
-BEGIN_JS_STATIC_CONST(CJS_Color)
-END_JS_STATIC_CONST()
-
-BEGIN_JS_STATIC_PROP(CJS_Color)
- JS_STATIC_PROP_ENTRY(black)
- JS_STATIC_PROP_ENTRY(blue)
- JS_STATIC_PROP_ENTRY(cyan)
- JS_STATIC_PROP_ENTRY(dkGray)
- JS_STATIC_PROP_ENTRY(gray)
- JS_STATIC_PROP_ENTRY(green)
- JS_STATIC_PROP_ENTRY(ltGray)
- JS_STATIC_PROP_ENTRY(magenta)
- JS_STATIC_PROP_ENTRY(red)
- JS_STATIC_PROP_ENTRY(transparent)
- JS_STATIC_PROP_ENTRY(white)
- JS_STATIC_PROP_ENTRY(yellow)
-END_JS_STATIC_PROP()
-
-BEGIN_JS_STATIC_METHOD(CJS_Color)
- JS_STATIC_METHOD_ENTRY(convert, 2)
- JS_STATIC_METHOD_ENTRY(equal, 2)
-END_JS_STATIC_METHOD()
-
-IMPLEMENT_JS_CLASS(CJS_Color,color)
-
-color::color(CJS_Object* pJSObject): CJS_EmbedObj(pJSObject)
-{
- m_crTransparent = CPWL_Color(COLORTYPE_TRANSPARENT);
- m_crBlack = CPWL_Color(COLORTYPE_GRAY, 0);
- m_crWhite = CPWL_Color(COLORTYPE_GRAY, 1);
- m_crRed = CPWL_Color(COLORTYPE_RGB, 1, 0 ,0);
- m_crGreen = CPWL_Color(COLORTYPE_RGB, 0, 1 ,0);
- m_crBlue = CPWL_Color(COLORTYPE_RGB, 0, 0 ,1);
- m_crCyan = CPWL_Color(COLORTYPE_CMYK, 1, 0 ,0, 0);
- m_crMagenta = CPWL_Color(COLORTYPE_CMYK, 0, 1 ,0, 0);
- m_crYellow = CPWL_Color(COLORTYPE_CMYK, 0, 0 ,1, 0);
- m_crDKGray = CPWL_Color(COLORTYPE_GRAY, 0.25);
- m_crGray = CPWL_Color(COLORTYPE_GRAY, 0.5);
- m_crLTGray = CPWL_Color(COLORTYPE_GRAY, 0.75);
-}
-
-color::~color(void)
-{
-}
-
-void color::ConvertPWLColorToArray(const CPWL_Color& color, CJS_Array& array)
-{
- switch (color.nColorType)
- {
- case COLORTYPE_TRANSPARENT:
- array.SetElement(0, CJS_Value(array.GetIsolate(), "T"));
- break;
- case COLORTYPE_GRAY:
- array.SetElement(0, CJS_Value(array.GetIsolate(),"G"));
- array.SetElement(1, CJS_Value(array.GetIsolate(),color.fColor1));
- break;
- case COLORTYPE_RGB:
- array.SetElement(0, CJS_Value(array.GetIsolate(),"RGB"));
- array.SetElement(1, CJS_Value(array.GetIsolate(),color.fColor1));
- array.SetElement(2, CJS_Value(array.GetIsolate(),color.fColor2));
- array.SetElement(3, CJS_Value(array.GetIsolate(),color.fColor3));
- break;
- case COLORTYPE_CMYK:
- array.SetElement(0, CJS_Value(array.GetIsolate(),"CMYK"));
- array.SetElement(1, CJS_Value(array.GetIsolate(),color.fColor1));
- array.SetElement(2, CJS_Value(array.GetIsolate(),color.fColor2));
- array.SetElement(3, CJS_Value(array.GetIsolate(),color.fColor3));
- array.SetElement(4, CJS_Value(array.GetIsolate(),color.fColor4));
- break;
- }
-}
-
-void color::ConvertArrayToPWLColor(CJS_Array& array, CPWL_Color& color)
-{
- int nArrayLen = array.GetLength();
- if (nArrayLen < 1) return;
-
- CJS_Value value(array.GetIsolate());
- CFX_ByteString sSpace;
- array.GetElement(0, value);
- sSpace = value;
-
- double d1 = 0;
- double d2 = 0;
- double d3 = 0;
- double d4 = 0;
-
- if (nArrayLen > 1)
- {
- array.GetElement(1, value);
- d1 = value;
- }
-
- if (nArrayLen > 2)
- {
- array.GetElement(2, value);
- d2 = value;
- }
-
- if (nArrayLen > 3)
- {
- array.GetElement(3, value);
- d3 = value;
- }
-
- if (nArrayLen > 4)
- {
- array.GetElement(4, value);
- d4 = value;
- }
-
- if (sSpace == "T")
- {
- color = CPWL_Color(COLORTYPE_TRANSPARENT);
- }
- else if (sSpace == "G")
- {
- color = CPWL_Color(COLORTYPE_GRAY, (FX_FLOAT)d1);
- }
- else if (sSpace == "RGB")
- {
- color = CPWL_Color(COLORTYPE_RGB, (FX_FLOAT)d1, (FX_FLOAT)d2, (FX_FLOAT)d3);
- }
- else if (sSpace == "CMYK")
- {
- color = CPWL_Color(COLORTYPE_CMYK, (FX_FLOAT)d1, (FX_FLOAT)d2, (FX_FLOAT)d3, (FX_FLOAT)d4);
- }
-}
-
-#define JS_IMPLEMENT_COLORPROP(prop, var)\
-FX_BOOL color::prop(OBJ_PROP_PARAMS)\
-{\
- CJS_Context* pContext = (CJS_Context*)cc;\
- v8::Isolate* isolate = pContext->GetJSRuntime()->GetIsolate();\
- if (vp.IsGetting())\
- {\
- CJS_Array array(isolate);\
- ConvertPWLColorToArray(var, array);\
- vp << array;\
- }\
- else\
- {\
- CJS_Array array(isolate);\
- if (!vp.ConvertToArray(array)) return FALSE;\
- ConvertArrayToPWLColor(array, var);\
- }\
- return TRUE;\
-}
-
-JS_IMPLEMENT_COLORPROP(transparent, m_crTransparent)
-JS_IMPLEMENT_COLORPROP(black, m_crBlack)
-JS_IMPLEMENT_COLORPROP(white, m_crWhite)
-JS_IMPLEMENT_COLORPROP(red, m_crRed)
-JS_IMPLEMENT_COLORPROP(green, m_crGreen)
-JS_IMPLEMENT_COLORPROP(blue, m_crBlue)
-JS_IMPLEMENT_COLORPROP(cyan, m_crCyan)
-JS_IMPLEMENT_COLORPROP(magenta, m_crMagenta)
-JS_IMPLEMENT_COLORPROP(yellow, m_crYellow)
-JS_IMPLEMENT_COLORPROP(dkGray, m_crDKGray)
-JS_IMPLEMENT_COLORPROP(gray, m_crGray)
-JS_IMPLEMENT_COLORPROP(ltGray, m_crLTGray)
-
-FX_BOOL color::convert(OBJ_METHOD_PARAMS)
-{
- v8::Isolate* isolate = GetIsolate(cc);
- int iSize = params.size();
- if (iSize < 2) return FALSE;
- CJS_Array aSource(isolate);
- if (!params[0].ConvertToArray(aSource)) return FALSE;
-
- CPWL_Color crSource;
- ConvertArrayToPWLColor(aSource, crSource);
-
- CFX_ByteString sDestSpace = params[1];
-
- int nColorType = COLORTYPE_TRANSPARENT;
-
- if (sDestSpace == "T")
- {
- nColorType = COLORTYPE_TRANSPARENT;
- }
- else if (sDestSpace == "G")
- {
- nColorType = COLORTYPE_GRAY;
- }
- else if (sDestSpace == "RGB")
- {
- nColorType = COLORTYPE_RGB;
- }
- else if (sDestSpace == "CMYK")
- {
- nColorType = COLORTYPE_CMYK;
- }
-
- CJS_Array aDest(isolate);
- CPWL_Color crDest = crSource;
- crDest.ConvertColorType(nColorType);
- ConvertPWLColorToArray(crDest, aDest);
- vRet = aDest;
-
- return TRUE;
-}
-
-FX_BOOL color::equal(OBJ_METHOD_PARAMS)
-{
- v8::Isolate* isolate = GetIsolate(cc);
- if (params.size() < 2) return FALSE;
-
- CJS_Array array1(isolate), array2(isolate);
-
- if (!params[0].ConvertToArray(array1)) return FALSE;
- if (!params[1].ConvertToArray(array2)) return FALSE;
-
- CPWL_Color color1;
- CPWL_Color color2;
-
- ConvertArrayToPWLColor(array1, color1);
- ConvertArrayToPWLColor(array2, color2);
-
- color1.ConvertColorType(color2.nColorType);
-
- vRet = color1 == color2;
- return TRUE;
-}
-
+// 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
+
+#include "../../include/javascript/JavaScript.h"
+#include "../../include/javascript/IJavaScript.h"
+#include "../../include/javascript/JS_Define.h"
+#include "../../include/javascript/JS_Object.h"
+#include "../../include/javascript/JS_Value.h"
+#include "../../include/javascript/color.h"
+#include "../../include/javascript/JS_EventHandler.h"
+#include "../../include/javascript/JS_Context.h"
+#include "../../include/javascript/JS_Runtime.h"
+
+static v8::Isolate* GetIsolate(IFXJS_Context* cc)
+{
+ CJS_Context* pContext = (CJS_Context *)cc;
+ ASSERT(pContext != NULL);
+
+ CJS_Runtime* pRuntime = pContext->GetJSRuntime();
+ ASSERT(pRuntime != NULL);
+
+ return pRuntime->GetIsolate();
+}
+/* -------------------------- color -------------------------- */
+
+BEGIN_JS_STATIC_CONST(CJS_Color)
+END_JS_STATIC_CONST()
+
+BEGIN_JS_STATIC_PROP(CJS_Color)
+ JS_STATIC_PROP_ENTRY(black)
+ JS_STATIC_PROP_ENTRY(blue)
+ JS_STATIC_PROP_ENTRY(cyan)
+ JS_STATIC_PROP_ENTRY(dkGray)
+ JS_STATIC_PROP_ENTRY(gray)
+ JS_STATIC_PROP_ENTRY(green)
+ JS_STATIC_PROP_ENTRY(ltGray)
+ JS_STATIC_PROP_ENTRY(magenta)
+ JS_STATIC_PROP_ENTRY(red)
+ JS_STATIC_PROP_ENTRY(transparent)
+ JS_STATIC_PROP_ENTRY(white)
+ JS_STATIC_PROP_ENTRY(yellow)
+END_JS_STATIC_PROP()
+
+BEGIN_JS_STATIC_METHOD(CJS_Color)
+ JS_STATIC_METHOD_ENTRY(convert, 2)
+ JS_STATIC_METHOD_ENTRY(equal, 2)
+END_JS_STATIC_METHOD()
+
+IMPLEMENT_JS_CLASS(CJS_Color,color)
+
+color::color(CJS_Object* pJSObject): CJS_EmbedObj(pJSObject)
+{
+ m_crTransparent = CPWL_Color(COLORTYPE_TRANSPARENT);
+ m_crBlack = CPWL_Color(COLORTYPE_GRAY, 0);
+ m_crWhite = CPWL_Color(COLORTYPE_GRAY, 1);
+ m_crRed = CPWL_Color(COLORTYPE_RGB, 1, 0 ,0);
+ m_crGreen = CPWL_Color(COLORTYPE_RGB, 0, 1 ,0);
+ m_crBlue = CPWL_Color(COLORTYPE_RGB, 0, 0 ,1);
+ m_crCyan = CPWL_Color(COLORTYPE_CMYK, 1, 0 ,0, 0);
+ m_crMagenta = CPWL_Color(COLORTYPE_CMYK, 0, 1 ,0, 0);
+ m_crYellow = CPWL_Color(COLORTYPE_CMYK, 0, 0 ,1, 0);
+ m_crDKGray = CPWL_Color(COLORTYPE_GRAY, 0.25);
+ m_crGray = CPWL_Color(COLORTYPE_GRAY, 0.5);
+ m_crLTGray = CPWL_Color(COLORTYPE_GRAY, 0.75);
+}
+
+color::~color(void)
+{
+}
+
+void color::ConvertPWLColorToArray(const CPWL_Color& color, CJS_Array& array)
+{
+ switch (color.nColorType)
+ {
+ case COLORTYPE_TRANSPARENT:
+ array.SetElement(0, CJS_Value(array.GetIsolate(), "T"));
+ break;
+ case COLORTYPE_GRAY:
+ array.SetElement(0, CJS_Value(array.GetIsolate(),"G"));
+ array.SetElement(1, CJS_Value(array.GetIsolate(),color.fColor1));
+ break;
+ case COLORTYPE_RGB:
+ array.SetElement(0, CJS_Value(array.GetIsolate(),"RGB"));
+ array.SetElement(1, CJS_Value(array.GetIsolate(),color.fColor1));
+ array.SetElement(2, CJS_Value(array.GetIsolate(),color.fColor2));
+ array.SetElement(3, CJS_Value(array.GetIsolate(),color.fColor3));
+ break;
+ case COLORTYPE_CMYK:
+ array.SetElement(0, CJS_Value(array.GetIsolate(),"CMYK"));
+ array.SetElement(1, CJS_Value(array.GetIsolate(),color.fColor1));
+ array.SetElement(2, CJS_Value(array.GetIsolate(),color.fColor2));
+ array.SetElement(3, CJS_Value(array.GetIsolate(),color.fColor3));
+ array.SetElement(4, CJS_Value(array.GetIsolate(),color.fColor4));
+ break;
+ }
+}
+
+void color::ConvertArrayToPWLColor(CJS_Array& array, CPWL_Color& color)
+{
+ int nArrayLen = array.GetLength();
+ if (nArrayLen < 1) return;
+
+ CJS_Value value(array.GetIsolate());
+ CFX_ByteString sSpace;
+ array.GetElement(0, value);
+ sSpace = value;
+
+ double d1 = 0;
+ double d2 = 0;
+ double d3 = 0;
+ double d4 = 0;
+
+ if (nArrayLen > 1)
+ {
+ array.GetElement(1, value);
+ d1 = value;
+ }
+
+ if (nArrayLen > 2)
+ {
+ array.GetElement(2, value);
+ d2 = value;
+ }
+
+ if (nArrayLen > 3)
+ {
+ array.GetElement(3, value);
+ d3 = value;
+ }
+
+ if (nArrayLen > 4)
+ {
+ array.GetElement(4, value);
+ d4 = value;
+ }
+
+ if (sSpace == "T")
+ {
+ color = CPWL_Color(COLORTYPE_TRANSPARENT);
+ }
+ else if (sSpace == "G")
+ {
+ color = CPWL_Color(COLORTYPE_GRAY, (FX_FLOAT)d1);
+ }
+ else if (sSpace == "RGB")
+ {
+ color = CPWL_Color(COLORTYPE_RGB, (FX_FLOAT)d1, (FX_FLOAT)d2, (FX_FLOAT)d3);
+ }
+ else if (sSpace == "CMYK")
+ {
+ color = CPWL_Color(COLORTYPE_CMYK, (FX_FLOAT)d1, (FX_FLOAT)d2, (FX_FLOAT)d3, (FX_FLOAT)d4);
+ }
+}
+
+#define JS_IMPLEMENT_COLORPROP(prop, var)\
+FX_BOOL color::prop(OBJ_PROP_PARAMS)\
+{\
+ CJS_Context* pContext = (CJS_Context*)cc;\
+ v8::Isolate* isolate = pContext->GetJSRuntime()->GetIsolate();\
+ if (vp.IsGetting())\
+ {\
+ CJS_Array array(isolate);\
+ ConvertPWLColorToArray(var, array);\
+ vp << array;\
+ }\
+ else\
+ {\
+ CJS_Array array(isolate);\
+ if (!vp.ConvertToArray(array)) return FALSE;\
+ ConvertArrayToPWLColor(array, var);\
+ }\
+ return TRUE;\
+}
+
+JS_IMPLEMENT_COLORPROP(transparent, m_crTransparent)
+JS_IMPLEMENT_COLORPROP(black, m_crBlack)
+JS_IMPLEMENT_COLORPROP(white, m_crWhite)
+JS_IMPLEMENT_COLORPROP(red, m_crRed)
+JS_IMPLEMENT_COLORPROP(green, m_crGreen)
+JS_IMPLEMENT_COLORPROP(blue, m_crBlue)
+JS_IMPLEMENT_COLORPROP(cyan, m_crCyan)
+JS_IMPLEMENT_COLORPROP(magenta, m_crMagenta)
+JS_IMPLEMENT_COLORPROP(yellow, m_crYellow)
+JS_IMPLEMENT_COLORPROP(dkGray, m_crDKGray)
+JS_IMPLEMENT_COLORPROP(gray, m_crGray)
+JS_IMPLEMENT_COLORPROP(ltGray, m_crLTGray)
+
+FX_BOOL color::convert(OBJ_METHOD_PARAMS)
+{
+ v8::Isolate* isolate = GetIsolate(cc);
+ int iSize = params.size();
+ if (iSize < 2) return FALSE;
+ CJS_Array aSource(isolate);
+ if (!params[0].ConvertToArray(aSource)) return FALSE;
+
+ CPWL_Color crSource;
+ ConvertArrayToPWLColor(aSource, crSource);
+
+ CFX_ByteString sDestSpace = params[1];
+
+ int nColorType = COLORTYPE_TRANSPARENT;
+
+ if (sDestSpace == "T")
+ {
+ nColorType = COLORTYPE_TRANSPARENT;
+ }
+ else if (sDestSpace == "G")
+ {
+ nColorType = COLORTYPE_GRAY;
+ }
+ else if (sDestSpace == "RGB")
+ {
+ nColorType = COLORTYPE_RGB;
+ }
+ else if (sDestSpace == "CMYK")
+ {
+ nColorType = COLORTYPE_CMYK;
+ }
+
+ CJS_Array aDest(isolate);
+ CPWL_Color crDest = crSource;
+ crDest.ConvertColorType(nColorType);
+ ConvertPWLColorToArray(crDest, aDest);
+ vRet = aDest;
+
+ return TRUE;
+}
+
+FX_BOOL color::equal(OBJ_METHOD_PARAMS)
+{
+ v8::Isolate* isolate = GetIsolate(cc);
+ if (params.size() < 2) return FALSE;
+
+ CJS_Array array1(isolate), array2(isolate);
+
+ if (!params[0].ConvertToArray(array1)) return FALSE;
+ if (!params[1].ConvertToArray(array2)) return FALSE;
+
+ CPWL_Color color1;
+ CPWL_Color color2;
+
+ ConvertArrayToPWLColor(array1, color1);
+ ConvertArrayToPWLColor(array2, color2);
+
+ color1.ConvertColorType(color2.nColorType);
+
+ vRet = color1 == color2;
+ return TRUE;
+}
+
diff --git a/fpdfsdk/src/javascript/console.cpp b/fpdfsdk/src/javascript/console.cpp
index 25e5559a06..350b4e1dcc 100644
--- a/fpdfsdk/src/javascript/console.cpp
+++ b/fpdfsdk/src/javascript/console.cpp
@@ -1,78 +1,78 @@
-// 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
-
-#include "../../include/javascript/JavaScript.h"
-#include "../../include/javascript/IJavaScript.h"
-#include "../../include/javascript/JS_Define.h"
-#include "../../include/javascript/JS_Object.h"
-#include "../../include/javascript/JS_Value.h"
-#include "../../include/javascript/console.h"
-//#include "../../include/javascript/JS_Module.h"
-#include "../../include/javascript/JS_EventHandler.h"
-//#include "../../include/javascript/JS_ResMgr.h"
-#include "../../include/javascript/JS_Context.h"
-
-/* ------------------------ console ------------------------ */
-
-BEGIN_JS_STATIC_CONST(CJS_Console)
-END_JS_STATIC_CONST()
-
-BEGIN_JS_STATIC_PROP(CJS_Console)
-END_JS_STATIC_PROP()
-
-BEGIN_JS_STATIC_METHOD(CJS_Console)
- JS_STATIC_METHOD_ENTRY(clear, 0)
- JS_STATIC_METHOD_ENTRY(hide, 0)
- JS_STATIC_METHOD_ENTRY(println, 1)
- JS_STATIC_METHOD_ENTRY(show, 0)
-END_JS_STATIC_METHOD()
-
-IMPLEMENT_JS_CLASS(CJS_Console,console)
-
-#define MAXCONSOLECONTENTS 10000
-
-console::console(CJS_Object* pJSObject): CJS_EmbedObj(pJSObject)
-{
-}
-
-console::~console()
-{
-}
-
-FX_BOOL console::clear(OBJ_METHOD_PARAMS)
-{
-
-
-
- return TRUE;
-}
-
-FX_BOOL console::hide(OBJ_METHOD_PARAMS)
-{
-
-
-
-
- return TRUE;
-}
-
-FX_BOOL console::println(OBJ_METHOD_PARAMS)
-{
- if (params.size() < 1)
- {
- return FALSE;
- }
-
- return TRUE;
-}
-
-FX_BOOL console::show(OBJ_METHOD_PARAMS)
-{
- return TRUE;
-}
-
-
-
+// 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
+
+#include "../../include/javascript/JavaScript.h"
+#include "../../include/javascript/IJavaScript.h"
+#include "../../include/javascript/JS_Define.h"
+#include "../../include/javascript/JS_Object.h"
+#include "../../include/javascript/JS_Value.h"
+#include "../../include/javascript/console.h"
+//#include "../../include/javascript/JS_Module.h"
+#include "../../include/javascript/JS_EventHandler.h"
+//#include "../../include/javascript/JS_ResMgr.h"
+#include "../../include/javascript/JS_Context.h"
+
+/* ------------------------ console ------------------------ */
+
+BEGIN_JS_STATIC_CONST(CJS_Console)
+END_JS_STATIC_CONST()
+
+BEGIN_JS_STATIC_PROP(CJS_Console)
+END_JS_STATIC_PROP()
+
+BEGIN_JS_STATIC_METHOD(CJS_Console)
+ JS_STATIC_METHOD_ENTRY(clear, 0)
+ JS_STATIC_METHOD_ENTRY(hide, 0)
+ JS_STATIC_METHOD_ENTRY(println, 1)
+ JS_STATIC_METHOD_ENTRY(show, 0)
+END_JS_STATIC_METHOD()
+
+IMPLEMENT_JS_CLASS(CJS_Console,console)
+
+#define MAXCONSOLECONTENTS 10000
+
+console::console(CJS_Object* pJSObject): CJS_EmbedObj(pJSObject)
+{
+}
+
+console::~console()
+{
+}
+
+FX_BOOL console::clear(OBJ_METHOD_PARAMS)
+{
+
+
+
+ return TRUE;
+}
+
+FX_BOOL console::hide(OBJ_METHOD_PARAMS)
+{
+
+
+
+
+ return TRUE;
+}
+
+FX_BOOL console::println(OBJ_METHOD_PARAMS)
+{
+ if (params.size() < 1)
+ {
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+FX_BOOL console::show(OBJ_METHOD_PARAMS)
+{
+ return TRUE;
+}
+
+
+
diff --git a/fpdfsdk/src/javascript/event.cpp b/fpdfsdk/src/javascript/event.cpp
index 9168a2e0cf..5188765a04 100644
--- a/fpdfsdk/src/javascript/event.cpp
+++ b/fpdfsdk/src/javascript/event.cpp
@@ -1,379 +1,379 @@
-// 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
-
-#include "../../include/javascript/JavaScript.h"
-#include "../../include/javascript/IJavaScript.h"
-#include "../../include/javascript/JS_Define.h"
-#include "../../include/javascript/JS_Object.h"
-#include "../../include/javascript/JS_Value.h"
-#include "../../include/javascript/JS_EventHandler.h"
-//#include "../include/JS_ResMgr.h"
-#include "../../include/javascript/JS_Context.h"
-#include "../../include/javascript/event.h"
-#include "../../include/javascript/Field.h"
-
-/* -------------------------- event -------------------------- */
-
-BEGIN_JS_STATIC_CONST(CJS_Event)
-END_JS_STATIC_CONST()
-
-BEGIN_JS_STATIC_PROP(CJS_Event)
- JS_STATIC_PROP_ENTRY(change)
- JS_STATIC_PROP_ENTRY(changeEx)
- JS_STATIC_PROP_ENTRY(commitKey)
- JS_STATIC_PROP_ENTRY(fieldFull)
- JS_STATIC_PROP_ENTRY(keyDown)
- JS_STATIC_PROP_ENTRY(modifier)
- JS_STATIC_PROP_ENTRY(name)
- JS_STATIC_PROP_ENTRY(rc)
- JS_STATIC_PROP_ENTRY(richChange)
- JS_STATIC_PROP_ENTRY(richChangeEx)
- JS_STATIC_PROP_ENTRY(richValue)
- JS_STATIC_PROP_ENTRY(selEnd)
- JS_STATIC_PROP_ENTRY(selStart)
- JS_STATIC_PROP_ENTRY(shift)
- JS_STATIC_PROP_ENTRY(source)
- JS_STATIC_PROP_ENTRY(target)
- JS_STATIC_PROP_ENTRY(targetName)
- JS_STATIC_PROP_ENTRY(type)
- JS_STATIC_PROP_ENTRY(value)
- JS_STATIC_PROP_ENTRY(willCommit)
-END_JS_STATIC_PROP()
-
-BEGIN_JS_STATIC_METHOD(CJS_Event)
-END_JS_STATIC_METHOD()
-
-IMPLEMENT_JS_CLASS(CJS_Event,event)
-
-event::event(CJS_Object * pJsObject) : CJS_EmbedObj(pJsObject)
-{
-}
-
-event::~event(void)
-{
-}
-
-FX_BOOL event::change(OBJ_PROP_PARAMS)
-{
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
- CJS_EventHandler* pEvent = pContext->GetEventHandler();
- ASSERT(pEvent != NULL);
-
- CFX_WideString &wChange = pEvent->Change();
- if (vp.IsSetting())
- {
- if (vp.GetType() == VT_string)
- vp >> wChange;
- }
- else
- {
- vp << wChange;
- }
- return TRUE;
-}
-
-FX_BOOL event::changeEx(OBJ_PROP_PARAMS)
-{
- if (!vp.IsGetting())return FALSE;
-
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
- CJS_EventHandler* pEvent = pContext->GetEventHandler();
- ASSERT(pEvent != NULL);
-
- vp << pEvent->ChangeEx();
- return TRUE;
-}
-
-FX_BOOL event::commitKey(OBJ_PROP_PARAMS)
-{
- if (!vp.IsGetting())return FALSE;
-
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
- CJS_EventHandler* pEvent = pContext->GetEventHandler();
- ASSERT(pEvent != NULL);
-
- vp << pEvent->CommitKey();
- return TRUE;
-}
-
-FX_BOOL event::fieldFull(OBJ_PROP_PARAMS)
-{
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
- CJS_EventHandler* pEvent = pContext->GetEventHandler();
- ASSERT(pEvent != NULL);
-
- if (!vp.IsGetting() && wcscmp((const wchar_t*)pEvent->Name(),L"Keystroke") != 0)
- return FALSE;
-
- if (pEvent->FieldFull())
- vp << TRUE;
- else
- vp << FALSE;
- return TRUE;
-}
-
-FX_BOOL event::keyDown(OBJ_PROP_PARAMS)
-{
- if (!vp.IsGetting())return FALSE;
-
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
- CJS_EventHandler* pEvent = pContext->GetEventHandler();
- ASSERT(pEvent != NULL);
-
- if (pEvent->KeyDown())
- vp << TRUE;
- else
- vp << FALSE;
- return TRUE;
-}
-
-FX_BOOL event::modifier(OBJ_PROP_PARAMS)
-{
- if (!vp.IsGetting())return FALSE;
-
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
- CJS_EventHandler* pEvent = pContext->GetEventHandler();
- ASSERT(pEvent != NULL);
-
- if (pEvent->Modifier())
- vp << TRUE;
- else
- vp << FALSE;
- return TRUE;
-}
-
-FX_BOOL event::name(OBJ_PROP_PARAMS)
-{
- if (!vp.IsGetting())return FALSE;
-
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
- CJS_EventHandler* pEvent = pContext->GetEventHandler();
- ASSERT(pEvent != NULL);
-
- vp << pEvent->Name();
- return TRUE;
-}
-
-FX_BOOL event::rc(OBJ_PROP_PARAMS)
-{
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
- CJS_EventHandler* pEvent = pContext->GetEventHandler();
- ASSERT(pEvent != NULL);
-
- FX_BOOL &bRc = pEvent->Rc();
- if (vp.IsSetting())
- {
- vp>>bRc;
- }
- else
- {
- vp<<bRc;
- }
- return TRUE;
-}
-
-FX_BOOL event::richChange(OBJ_PROP_PARAMS)
-{
- return TRUE;
- if (vp.IsSetting())
- {
- }
- else
- {
- ;
- }
- return TRUE;
-}
-
-FX_BOOL event::richChangeEx(OBJ_PROP_PARAMS)
-{
- return TRUE;
- if (vp.IsSetting())
- {
- }
- else
- {
- ;
- }
- return TRUE;
-}
-
-
-FX_BOOL event::richValue(OBJ_PROP_PARAMS)
-{
- return TRUE;
- if (vp.IsSetting())
- {
- }
- else
- {
- ;
- }
- return TRUE;
-}
-
-FX_BOOL event::selEnd(OBJ_PROP_PARAMS)
-{
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
- CJS_EventHandler* pEvent = pContext->GetEventHandler();
- ASSERT(pEvent != NULL);
-
- if (wcscmp((const wchar_t*)pEvent->Name(),L"Keystroke") != 0)
- {
- return TRUE;
- }
-
- int &iSelEnd = pEvent->SelEnd();
- if (vp.IsSetting())
- {
- vp >> iSelEnd;
- }
- else
- {
- vp << iSelEnd;
- }
- return TRUE;
-}
-
-FX_BOOL event::selStart(OBJ_PROP_PARAMS)
-{
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
- CJS_EventHandler* pEvent = pContext->GetEventHandler();
- ASSERT(pEvent != NULL);
-
- if (wcscmp((const wchar_t*)pEvent->Name(),L"Keystroke") != 0)
- {
- return TRUE;
- }
- int &iSelStart = pEvent->SelStart();
- if (vp.IsSetting())
- {
- vp >> iSelStart;
- }
- else
- {
- vp << iSelStart;
- }
- return TRUE;
-}
-
-FX_BOOL event::shift(OBJ_PROP_PARAMS)
-{
- if (!vp.IsGetting())return FALSE;
-
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
- CJS_EventHandler* pEvent = pContext->GetEventHandler();
- ASSERT(pEvent != NULL);
-
- if (pEvent->Shift())
- vp << TRUE;
- else
- vp << FALSE;
- return TRUE;
-}
-
-FX_BOOL event::source(OBJ_PROP_PARAMS)
-{
- if (!vp.IsGetting())return FALSE;
-
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
- CJS_EventHandler* pEvent = pContext->GetEventHandler();
- ASSERT(pEvent != NULL);
-
- vp << pEvent->Source()->GetJSObject();
- return TRUE;
-}
-
-FX_BOOL event::target(OBJ_PROP_PARAMS)
-{
- if (!vp.IsGetting())return FALSE;
-
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
- CJS_EventHandler* pEvent = pContext->GetEventHandler();
- ASSERT(pEvent != NULL);
-
- vp<<pEvent->Target_Field()->GetJSObject();
- return TRUE;
-}
-
-FX_BOOL event::targetName(OBJ_PROP_PARAMS)
-{
- if (!vp.IsGetting())return FALSE;
-
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
- CJS_EventHandler* pEvent = pContext->GetEventHandler();
- ASSERT(pEvent != NULL);
-
- vp << pEvent->TargetName();
- return TRUE;
-}
-
-FX_BOOL event::type(OBJ_PROP_PARAMS)
-{
- if (!vp.IsGetting())return FALSE;
-
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
- CJS_EventHandler* pEvent = pContext->GetEventHandler();
- ASSERT(pEvent != NULL);
-
- vp << pEvent->Type();
- return TRUE;
-}
-
-FX_BOOL event::value(OBJ_PROP_PARAMS)
-{
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
- CJS_EventHandler* pEvent = pContext->GetEventHandler();
- ASSERT(pEvent != NULL);
-
- if (wcscmp((const wchar_t*)pEvent->Type(),L"Field") != 0)
- return FALSE;
- if(!pEvent->m_pValue)
- return FALSE;
- CFX_WideString & val = pEvent->Value();
- if (vp.IsSetting())
- {
- val = vp;
- }
- else
- {
- vp << val;
- }
- return TRUE;
-}
-
-FX_BOOL event::willCommit(OBJ_PROP_PARAMS)
-{
- if (!vp.IsGetting())return FALSE;
-
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
- CJS_EventHandler* pEvent = pContext->GetEventHandler();
- ASSERT(pEvent != NULL);
-
- if (pEvent->WillCommit())
- vp << TRUE;
- else
- vp << FALSE;
- return TRUE;
-}
-
+// 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
+
+#include "../../include/javascript/JavaScript.h"
+#include "../../include/javascript/IJavaScript.h"
+#include "../../include/javascript/JS_Define.h"
+#include "../../include/javascript/JS_Object.h"
+#include "../../include/javascript/JS_Value.h"
+#include "../../include/javascript/JS_EventHandler.h"
+//#include "../include/JS_ResMgr.h"
+#include "../../include/javascript/JS_Context.h"
+#include "../../include/javascript/event.h"
+#include "../../include/javascript/Field.h"
+
+/* -------------------------- event -------------------------- */
+
+BEGIN_JS_STATIC_CONST(CJS_Event)
+END_JS_STATIC_CONST()
+
+BEGIN_JS_STATIC_PROP(CJS_Event)
+ JS_STATIC_PROP_ENTRY(change)
+ JS_STATIC_PROP_ENTRY(changeEx)
+ JS_STATIC_PROP_ENTRY(commitKey)
+ JS_STATIC_PROP_ENTRY(fieldFull)
+ JS_STATIC_PROP_ENTRY(keyDown)
+ JS_STATIC_PROP_ENTRY(modifier)
+ JS_STATIC_PROP_ENTRY(name)
+ JS_STATIC_PROP_ENTRY(rc)
+ JS_STATIC_PROP_ENTRY(richChange)
+ JS_STATIC_PROP_ENTRY(richChangeEx)
+ JS_STATIC_PROP_ENTRY(richValue)
+ JS_STATIC_PROP_ENTRY(selEnd)
+ JS_STATIC_PROP_ENTRY(selStart)
+ JS_STATIC_PROP_ENTRY(shift)
+ JS_STATIC_PROP_ENTRY(source)
+ JS_STATIC_PROP_ENTRY(target)
+ JS_STATIC_PROP_ENTRY(targetName)
+ JS_STATIC_PROP_ENTRY(type)
+ JS_STATIC_PROP_ENTRY(value)
+ JS_STATIC_PROP_ENTRY(willCommit)
+END_JS_STATIC_PROP()
+
+BEGIN_JS_STATIC_METHOD(CJS_Event)
+END_JS_STATIC_METHOD()
+
+IMPLEMENT_JS_CLASS(CJS_Event,event)
+
+event::event(CJS_Object * pJsObject) : CJS_EmbedObj(pJsObject)
+{
+}
+
+event::~event(void)
+{
+}
+
+FX_BOOL event::change(OBJ_PROP_PARAMS)
+{
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+ CJS_EventHandler* pEvent = pContext->GetEventHandler();
+ ASSERT(pEvent != NULL);
+
+ CFX_WideString &wChange = pEvent->Change();
+ if (vp.IsSetting())
+ {
+ if (vp.GetType() == VT_string)
+ vp >> wChange;
+ }
+ else
+ {
+ vp << wChange;
+ }
+ return TRUE;
+}
+
+FX_BOOL event::changeEx(OBJ_PROP_PARAMS)
+{
+ if (!vp.IsGetting())return FALSE;
+
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+ CJS_EventHandler* pEvent = pContext->GetEventHandler();
+ ASSERT(pEvent != NULL);
+
+ vp << pEvent->ChangeEx();
+ return TRUE;
+}
+
+FX_BOOL event::commitKey(OBJ_PROP_PARAMS)
+{
+ if (!vp.IsGetting())return FALSE;
+
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+ CJS_EventHandler* pEvent = pContext->GetEventHandler();
+ ASSERT(pEvent != NULL);
+
+ vp << pEvent->CommitKey();
+ return TRUE;
+}
+
+FX_BOOL event::fieldFull(OBJ_PROP_PARAMS)
+{
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+ CJS_EventHandler* pEvent = pContext->GetEventHandler();
+ ASSERT(pEvent != NULL);
+
+ if (!vp.IsGetting() && wcscmp((const wchar_t*)pEvent->Name(),L"Keystroke") != 0)
+ return FALSE;
+
+ if (pEvent->FieldFull())
+ vp << TRUE;
+ else
+ vp << FALSE;
+ return TRUE;
+}
+
+FX_BOOL event::keyDown(OBJ_PROP_PARAMS)
+{
+ if (!vp.IsGetting())return FALSE;
+
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+ CJS_EventHandler* pEvent = pContext->GetEventHandler();
+ ASSERT(pEvent != NULL);
+
+ if (pEvent->KeyDown())
+ vp << TRUE;
+ else
+ vp << FALSE;
+ return TRUE;
+}
+
+FX_BOOL event::modifier(OBJ_PROP_PARAMS)
+{
+ if (!vp.IsGetting())return FALSE;
+
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+ CJS_EventHandler* pEvent = pContext->GetEventHandler();
+ ASSERT(pEvent != NULL);
+
+ if (pEvent->Modifier())
+ vp << TRUE;
+ else
+ vp << FALSE;
+ return TRUE;
+}
+
+FX_BOOL event::name(OBJ_PROP_PARAMS)
+{
+ if (!vp.IsGetting())return FALSE;
+
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+ CJS_EventHandler* pEvent = pContext->GetEventHandler();
+ ASSERT(pEvent != NULL);
+
+ vp << pEvent->Name();
+ return TRUE;
+}
+
+FX_BOOL event::rc(OBJ_PROP_PARAMS)
+{
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+ CJS_EventHandler* pEvent = pContext->GetEventHandler();
+ ASSERT(pEvent != NULL);
+
+ FX_BOOL &bRc = pEvent->Rc();
+ if (vp.IsSetting())
+ {
+ vp>>bRc;
+ }
+ else
+ {
+ vp<<bRc;
+ }
+ return TRUE;
+}
+
+FX_BOOL event::richChange(OBJ_PROP_PARAMS)
+{
+ return TRUE;
+ if (vp.IsSetting())
+ {
+ }
+ else
+ {
+ ;
+ }
+ return TRUE;
+}
+
+FX_BOOL event::richChangeEx(OBJ_PROP_PARAMS)
+{
+ return TRUE;
+ if (vp.IsSetting())
+ {
+ }
+ else
+ {
+ ;
+ }
+ return TRUE;
+}
+
+
+FX_BOOL event::richValue(OBJ_PROP_PARAMS)
+{
+ return TRUE;
+ if (vp.IsSetting())
+ {
+ }
+ else
+ {
+ ;
+ }
+ return TRUE;
+}
+
+FX_BOOL event::selEnd(OBJ_PROP_PARAMS)
+{
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+ CJS_EventHandler* pEvent = pContext->GetEventHandler();
+ ASSERT(pEvent != NULL);
+
+ if (wcscmp((const wchar_t*)pEvent->Name(),L"Keystroke") != 0)
+ {
+ return TRUE;
+ }
+
+ int &iSelEnd = pEvent->SelEnd();
+ if (vp.IsSetting())
+ {
+ vp >> iSelEnd;
+ }
+ else
+ {
+ vp << iSelEnd;
+ }
+ return TRUE;
+}
+
+FX_BOOL event::selStart(OBJ_PROP_PARAMS)
+{
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+ CJS_EventHandler* pEvent = pContext->GetEventHandler();
+ ASSERT(pEvent != NULL);
+
+ if (wcscmp((const wchar_t*)pEvent->Name(),L"Keystroke") != 0)
+ {
+ return TRUE;
+ }
+ int &iSelStart = pEvent->SelStart();
+ if (vp.IsSetting())
+ {
+ vp >> iSelStart;
+ }
+ else
+ {
+ vp << iSelStart;
+ }
+ return TRUE;
+}
+
+FX_BOOL event::shift(OBJ_PROP_PARAMS)
+{
+ if (!vp.IsGetting())return FALSE;
+
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+ CJS_EventHandler* pEvent = pContext->GetEventHandler();
+ ASSERT(pEvent != NULL);
+
+ if (pEvent->Shift())
+ vp << TRUE;
+ else
+ vp << FALSE;
+ return TRUE;
+}
+
+FX_BOOL event::source(OBJ_PROP_PARAMS)
+{
+ if (!vp.IsGetting())return FALSE;
+
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+ CJS_EventHandler* pEvent = pContext->GetEventHandler();
+ ASSERT(pEvent != NULL);
+
+ vp << pEvent->Source()->GetJSObject();
+ return TRUE;
+}
+
+FX_BOOL event::target(OBJ_PROP_PARAMS)
+{
+ if (!vp.IsGetting())return FALSE;
+
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+ CJS_EventHandler* pEvent = pContext->GetEventHandler();
+ ASSERT(pEvent != NULL);
+
+ vp<<pEvent->Target_Field()->GetJSObject();
+ return TRUE;
+}
+
+FX_BOOL event::targetName(OBJ_PROP_PARAMS)
+{
+ if (!vp.IsGetting())return FALSE;
+
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+ CJS_EventHandler* pEvent = pContext->GetEventHandler();
+ ASSERT(pEvent != NULL);
+
+ vp << pEvent->TargetName();
+ return TRUE;
+}
+
+FX_BOOL event::type(OBJ_PROP_PARAMS)
+{
+ if (!vp.IsGetting())return FALSE;
+
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+ CJS_EventHandler* pEvent = pContext->GetEventHandler();
+ ASSERT(pEvent != NULL);
+
+ vp << pEvent->Type();
+ return TRUE;
+}
+
+FX_BOOL event::value(OBJ_PROP_PARAMS)
+{
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+ CJS_EventHandler* pEvent = pContext->GetEventHandler();
+ ASSERT(pEvent != NULL);
+
+ if (wcscmp((const wchar_t*)pEvent->Type(),L"Field") != 0)
+ return FALSE;
+ if(!pEvent->m_pValue)
+ return FALSE;
+ CFX_WideString & val = pEvent->Value();
+ if (vp.IsSetting())
+ {
+ val = vp;
+ }
+ else
+ {
+ vp << val;
+ }
+ return TRUE;
+}
+
+FX_BOOL event::willCommit(OBJ_PROP_PARAMS)
+{
+ if (!vp.IsGetting())return FALSE;
+
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+ CJS_EventHandler* pEvent = pContext->GetEventHandler();
+ ASSERT(pEvent != NULL);
+
+ if (pEvent->WillCommit())
+ vp << TRUE;
+ else
+ vp << FALSE;
+ return TRUE;
+}
+
diff --git a/fpdfsdk/src/javascript/global.cpp b/fpdfsdk/src/javascript/global.cpp
index 984ba55cb4..295a8d49af 100644
--- a/fpdfsdk/src/javascript/global.cpp
+++ b/fpdfsdk/src/javascript/global.cpp
@@ -1,550 +1,550 @@
-// 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
-
-#include "../../include/javascript/JavaScript.h"
-#include "../../include/javascript/IJavaScript.h"
-#include "../../include/javascript/JS_Define.h"
-#include "../../include/javascript/JS_Object.h"
-#include "../../include/javascript/JS_Value.h"
-#include "../../include/javascript/JS_GlobalData.h"
-#include "../../include/javascript/global.h"
-#include "../../include/javascript/JS_EventHandler.h"
-#include "../../include/javascript/JS_Context.h"
-
-/* ---------------------------- global ---------------------------- */
-
-BEGIN_JS_STATIC_CONST(CJS_Global)
-END_JS_STATIC_CONST()
-
-BEGIN_JS_STATIC_PROP(CJS_Global)
-END_JS_STATIC_PROP()
-
-BEGIN_JS_STATIC_METHOD(CJS_Global)
- JS_STATIC_METHOD_ENTRY(setPersistent, 2)
-END_JS_STATIC_METHOD()
-
-IMPLEMENT_SPECIAL_JS_CLASS(CJS_Global, global_alternate, global);
-
-FX_BOOL CJS_Global::InitInstance(IFXJS_Context* cc)
-{
- CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
-
- global_alternate* pGlobal = (global_alternate*)GetEmbedObject();
- ASSERT(pGlobal != NULL);
-
- pGlobal->Initial(pContext->GetReaderApp());
-
- return TRUE;
-};
-
-global_alternate::global_alternate(CJS_Object* pJSObject)
- : CJS_EmbedObj(pJSObject),
- m_pApp(NULL)
-{
-}
-
-global_alternate::~global_alternate(void)
-{
- ASSERT(m_pApp != NULL);
-
-// CommitGlobalPersisitentVariables();
- DestroyGlobalPersisitentVariables();
-
- CJS_RuntimeFactory* pFactory = m_pApp->m_pJSRuntimeFactory;
- ASSERT(pFactory);
-
- pFactory->ReleaseGlobalData();
-}
-
-void global_alternate::Initial(CPDFDoc_Environment* pApp)
-{
- m_pApp = pApp;
-
- CJS_RuntimeFactory* pFactory = pApp->m_pJSRuntimeFactory;
- ASSERT(pFactory);
- m_pGlobalData = pFactory->NewGlobalData(pApp);
- UpdateGlobalPersistentVariables();
-}
-
-FX_BOOL global_alternate::QueryProperty(FX_LPCWSTR propname)
-{
- return CFX_WideString(propname) != L"setPersistent";
-}
-
-FX_BOOL global_alternate::DelProperty(IFXJS_Context* cc, FX_LPCWSTR propname, JS_ErrorString& sError)
-{
- js_global_data* pData = NULL;
- CFX_ByteString sPropName = CFX_ByteString::FromUnicode(propname);
-
- if (m_mapGlobal.Lookup(sPropName, (FX_LPVOID&)pData))
- {
- pData->bDeleted = TRUE;
- return TRUE;
- }
-
- return FALSE;
-}
-
-FX_BOOL global_alternate::DoProperty(IFXJS_Context* cc, FX_LPCWSTR propname, CJS_PropValue& vp, JS_ErrorString& sError)
-{
- if (vp.IsSetting())
- {
- CFX_ByteString sPropName = CFX_ByteString::FromUnicode(propname);
- switch (vp.GetType())
- {
- case VT_number:
- {
- double dData;
- vp >> dData;
- return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_NUMBER, dData, false, "", v8::Handle<v8::Object>(), FALSE);
- }
- case VT_boolean:
- {
- bool bData;
- vp >> bData;
- return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_BOOLEAN, 0, (bool)vp, "", v8::Handle<v8::Object>(), FALSE);
- }
- case VT_string:
- {
- CFX_ByteString sData;
- vp >> sData;
- return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_STRING, 0, false, sData, v8::Handle<v8::Object>(), FALSE);
- }
- case VT_object:
- {
- JSObject pData = (JSObject)vp;
- return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_OBJECT, 0, false, "", pData, FALSE);
-// else
-// {
-// if (vp.IsArrayObject())
-// {
-// CJS_Array array;
-// vp.ConvertToArray(array);
-// return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_OBJECT, 0, false, "",
-// (Dobject*)(Darray*)array, FALSE);
-// }
-// else
-// return FALSE;
-// }
- }
- case VT_null:
- {
- return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_NULL, 0, false, "", v8::Handle<v8::Object>(), FALSE);
- }
- case VT_undefined:
- {
- DelProperty(cc, propname, sError);
- return TRUE;
- }
- default:
- return FALSE;
- }
- }
- else
- {
- js_global_data* pData = NULL;
- CFX_ByteString sPropName = CFX_ByteString::FromUnicode(propname);
-
- if (m_mapGlobal.Lookup(sPropName, (FX_LPVOID&)pData))
- {
- if (pData)
- {
- if (!pData->bDeleted)
- {
- switch (pData->nType)
- {
- case JS_GLOBALDATA_TYPE_NUMBER:
- vp << pData->dData;
- break;
- case JS_GLOBALDATA_TYPE_BOOLEAN:
- vp << pData->bData;
- break;
- case JS_GLOBALDATA_TYPE_STRING:
- vp << pData->sData;
- break;
- case JS_GLOBALDATA_TYPE_OBJECT:
- {
- v8::Handle<v8::Object> obj = v8::Local<v8::Object>::New(vp.GetIsolate(),pData->pData);
- vp << obj;
- break;
- }
- case JS_GLOBALDATA_TYPE_NULL:
- vp.SetNull();
- break;
- default:
- return FALSE;
- }
- return TRUE;
- }
- else
- {
- return TRUE;
- }
- }
- else
- {
- vp.SetNull();
- return TRUE;
- }
- }
- else
- {
- vp.SetNull();
- return TRUE;
- }
- }
-
- return FALSE;
-}
-
-FX_BOOL global_alternate::setPersistent(OBJ_METHOD_PARAMS)
-{
- if (params.size() != 2)
- {
- //sError = JSGetStringFromID(IDS_STRING_JSPARAMERROR);
- return FALSE;
- }
-
- CFX_ByteString sName = params[0];
-
- js_global_data* pData = NULL;
- if (m_mapGlobal.Lookup(sName, (FX_LPVOID&)pData))
- {
- if (pData && !pData->bDeleted)
- {
- pData->bPersistent = (bool)params[1];
- return TRUE;
- }
- }
-
- //sError = JSGetStringFromID(IDS_JSPARAM_INCORRECT);
- return FALSE;
-}
-
-void global_alternate::UpdateGlobalPersistentVariables()
-{
- ASSERT(m_pGlobalData != NULL);
-
- for (int i=0,sz=m_pGlobalData->GetSize(); i<sz; i++)
- {
- CJS_GlobalData_Element* pData = m_pGlobalData->GetAt(i);
- ASSERT(pData != NULL);
-
- switch (pData->data.nType)
- {
- case JS_GLOBALDATA_TYPE_NUMBER:
- this->SetGlobalVariables(pData->data.sKey, JS_GLOBALDATA_TYPE_NUMBER, pData->data.dData, false, "", v8::Handle<v8::Object>(), pData->bPersistent == 1);
- JS_PutObjectNumber(NULL,(JSFXObject)(*m_pJSObject),
- pData->data.sKey.UTF8Decode(), pData->data.dData);
- break;
- case JS_GLOBALDATA_TYPE_BOOLEAN:
- this->SetGlobalVariables(pData->data.sKey, JS_GLOBALDATA_TYPE_BOOLEAN, 0, (bool)(pData->data.bData == 1), "", v8::Handle<v8::Object>(), pData->bPersistent == 1);
- JS_PutObjectBoolean(NULL,(JSFXObject)(*m_pJSObject),
- pData->data.sKey.UTF8Decode(), (bool)(pData->data.bData == 1));
- break;
- case JS_GLOBALDATA_TYPE_STRING:
- this->SetGlobalVariables(pData->data.sKey, JS_GLOBALDATA_TYPE_STRING, 0, false, pData->data.sData, v8::Handle<v8::Object>(), pData->bPersistent == 1);
- JS_PutObjectString(NULL,(JSFXObject)(*m_pJSObject),
- pData->data.sKey.UTF8Decode(),
- pData->data.sData.UTF8Decode());
- break;
- case JS_GLOBALDATA_TYPE_OBJECT:
- {
- IJS_Runtime* pRuntime = JS_GetRuntime((JSFXObject)(*m_pJSObject));
- v8::Handle<v8::Object> pObj = JS_NewFxDynamicObj(pRuntime, NULL, -1);
-
- PutObjectProperty(pObj, &pData->data);
-
- this->SetGlobalVariables(pData->data.sKey, JS_GLOBALDATA_TYPE_OBJECT, 0, false, "",
- (JSObject)pObj, pData->bPersistent == 1);
- JS_PutObjectObject(NULL,(JSFXObject)(*m_pJSObject),
- pData->data.sKey.UTF8Decode(), (JSObject)pObj);
- }
- break;
- case JS_GLOBALDATA_TYPE_NULL:
- this->SetGlobalVariables(pData->data.sKey, JS_GLOBALDATA_TYPE_NULL, 0, false, "", v8::Handle<v8::Object>(), pData->bPersistent == 1);
- JS_PutObjectNull(NULL,(JSFXObject)(*m_pJSObject),
- pData->data.sKey.UTF8Decode());
- break;
- }
- }
-}
-
-void global_alternate::CommitGlobalPersisitentVariables()
-{
- ASSERT(m_pGlobalData != NULL);
-
- FX_POSITION pos = m_mapGlobal.GetStartPosition();
- while (pos)
- {
- CFX_ByteString name;
- js_global_data* pData = NULL;
- m_mapGlobal.GetNextAssoc(pos, name, (FX_LPVOID&)pData);
-
- if (pData)
- {
- if (pData->bDeleted)
- {
- m_pGlobalData->DeleteGlobalVariable(name);
- }
- else
- {
- switch (pData->nType)
- {
- case JS_GLOBALDATA_TYPE_NUMBER:
- m_pGlobalData->SetGlobalVariableNumber(name, pData->dData);
- m_pGlobalData->SetGlobalVariablePersistent(name, pData->bPersistent);
- break;
- case JS_GLOBALDATA_TYPE_BOOLEAN:
- m_pGlobalData->SetGlobalVariableBoolean(name, pData->bData);
- m_pGlobalData->SetGlobalVariablePersistent(name, pData->bPersistent);
- break;
- case JS_GLOBALDATA_TYPE_STRING:
- m_pGlobalData->SetGlobalVariableString(name, pData->sData);
- m_pGlobalData->SetGlobalVariablePersistent(name, pData->bPersistent);
- break;
- case JS_GLOBALDATA_TYPE_OBJECT:
- //if (pData->pData)
- {
- CJS_GlobalVariableArray array;
- v8::Handle<v8::Object> obj = v8::Local<v8::Object>::New(GetJSObject()->GetIsolate(),pData->pData);
- ObjectToArray(obj, array);
- m_pGlobalData->SetGlobalVariableObject(name, array);
- m_pGlobalData->SetGlobalVariablePersistent(name, pData->bPersistent);
- }
- break;
- case JS_GLOBALDATA_TYPE_NULL:
- m_pGlobalData->SetGlobalVariableNull(name);
- m_pGlobalData->SetGlobalVariablePersistent(name, pData->bPersistent);
- break;
- }
- }
- }
- }
-}
-
-void global_alternate::ObjectToArray(v8::Handle<v8::Object> pObj, CJS_GlobalVariableArray& array)
-{
- v8::Handle<v8::Array> pKeyList = JS_GetObjectElementNames(pObj);
- int nObjElements = pKeyList->Length();
-
- v8::Local<v8::Context> context = pObj->CreationContext();
- v8::Isolate* isolate = context->GetIsolate();
-
- for (int i=0; i<nObjElements; i++)
- {
-
- CFX_WideString ws = JS_ToString(JS_GetArrayElemnet(pKeyList, i));
- CFX_ByteString sKey = ws.UTF8Encode();
-
- v8::Handle<v8::Value> v = JS_GetObjectElement(isolate, pObj, (const wchar_t*)(FX_LPCWSTR)ws);
- FXJSVALUETYPE vt = GET_VALUE_TYPE(v);
- switch (vt)
- {
- case VT_number:
- {
- CJS_KeyValue* pObjElement = new CJS_KeyValue;
- pObjElement->nType = JS_GLOBALDATA_TYPE_NUMBER;
- pObjElement->sKey = sKey;
- pObjElement->dData = JS_ToNumber(v);
- array.Add(pObjElement);
- }
- break;
- case VT_boolean:
- {
- CJS_KeyValue* pObjElement = new CJS_KeyValue;
- pObjElement->nType = JS_GLOBALDATA_TYPE_BOOLEAN;
- pObjElement->sKey = sKey;
- pObjElement->dData = JS_ToBoolean(v);
- array.Add(pObjElement);
- }
- break;
- case VT_string:
- {
- CFX_ByteString sValue = CJS_Value(isolate, v, VT_string);
- CJS_KeyValue* pObjElement = new CJS_KeyValue;
- pObjElement->nType = JS_GLOBALDATA_TYPE_STRING;
- pObjElement->sKey = sKey;
- pObjElement->sData = sValue;
- array.Add(pObjElement);
- }
- break;
- case VT_object:
- {
- CJS_KeyValue* pObjElement = new CJS_KeyValue;
- pObjElement->nType = JS_GLOBALDATA_TYPE_OBJECT;
- pObjElement->sKey = sKey;
- ObjectToArray(JS_ToObject(v), pObjElement->objData);
- array.Add(pObjElement);
- }
- break;
- case VT_null:
- {
- CJS_KeyValue* pObjElement = new CJS_KeyValue;
- pObjElement->nType = JS_GLOBALDATA_TYPE_NULL;
- pObjElement->sKey = sKey;
- array.Add(pObjElement);
- }
- break;
- default:
- break;
- }
- }
-}
-
-void global_alternate::PutObjectProperty(v8::Handle<v8::Object> pObj, CJS_KeyValue* pData)
-{
- ASSERT(pData != NULL);
-
- for (int i=0,sz=pData->objData.Count(); i<sz; i++)
- {
- CJS_KeyValue* pObjData = pData->objData.GetAt(i);
- ASSERT(pObjData != NULL);
-
- switch (pObjData->nType)
- {
- case JS_GLOBALDATA_TYPE_NUMBER:
- JS_PutObjectNumber(NULL,(JSObject)pObj, pObjData->sKey.UTF8Decode(), pObjData->dData);
- break;
- case JS_GLOBALDATA_TYPE_BOOLEAN:
- JS_PutObjectBoolean(NULL,(JSObject)pObj, pObjData->sKey.UTF8Decode(), (bool)(pObjData->bData == 1));
- break;
- case JS_GLOBALDATA_TYPE_STRING:
- JS_PutObjectString(NULL,(JSObject)pObj, pObjData->sKey.UTF8Decode(), pObjData->sData.UTF8Decode());
- break;
- case JS_GLOBALDATA_TYPE_OBJECT:
- {
- IJS_Runtime* pRuntime = JS_GetRuntime((JSFXObject)(*m_pJSObject));
- v8::Handle<v8::Object> pNewObj = JS_NewFxDynamicObj(pRuntime, NULL, -1);
- PutObjectProperty(pNewObj, pObjData);
- JS_PutObjectObject(NULL, (JSObject)pObj, pObjData->sKey.UTF8Decode(), (JSObject)pNewObj);
- }
- break;
- case JS_GLOBALDATA_TYPE_NULL:
- JS_PutObjectNull(NULL,(JSObject)pObj, pObjData->sKey.UTF8Decode());
- break;
- }
- }
-}
-
-void global_alternate::DestroyGlobalPersisitentVariables()
-{
- FX_POSITION pos = m_mapGlobal.GetStartPosition();
- while (pos)
- {
- CFX_ByteString name;
- js_global_data* pData = NULL;
- m_mapGlobal.GetNextAssoc(pos, name, (FX_LPVOID&)pData);
- delete pData;
- }
-
- m_mapGlobal.RemoveAll();
-}
-
-
-FX_BOOL global_alternate::SetGlobalVariables(FX_LPCSTR propname, int nType,
- double dData, bool bData, const CFX_ByteString& sData, JSObject pData, bool bDefaultPersistent)
-{
- if (propname == NULL) return FALSE;
-
- js_global_data* pTemp = NULL;
- m_mapGlobal.Lookup(propname, (FX_LPVOID&)pTemp);
-
- if (pTemp)
- {
- if (pTemp->bDeleted || pTemp->nType != nType)
- {
- pTemp->dData = 0;
- pTemp->bData = 0;
- pTemp->sData = "";
- pTemp->nType = nType;
- }
-
- pTemp->bDeleted = FALSE;
-
- switch (nType)
- {
- case JS_GLOBALDATA_TYPE_NUMBER:
- {
- pTemp->dData = dData;
- }
- break;
- case JS_GLOBALDATA_TYPE_BOOLEAN:
- {
- pTemp->bData = bData;
- }
- break;
- case JS_GLOBALDATA_TYPE_STRING:
- {
- pTemp->sData = sData;
- }
- break;
- case JS_GLOBALDATA_TYPE_OBJECT:
- {
- pTemp->pData.Reset(JS_GetRuntime(pData), pData);
- }
- break;
- case JS_GLOBALDATA_TYPE_NULL:
- break;
- default:
- return FALSE;
- }
-
- return TRUE;
- }
-
- js_global_data* pNewData = NULL;
-
- switch (nType)
- {
- case JS_GLOBALDATA_TYPE_NUMBER:
- {
- pNewData = new js_global_data;
- pNewData->nType = JS_GLOBALDATA_TYPE_NUMBER;
- pNewData->dData = dData;
- pNewData->bPersistent = bDefaultPersistent;
- }
- break;
- case JS_GLOBALDATA_TYPE_BOOLEAN:
- {
- pNewData = new js_global_data;
- pNewData->nType = JS_GLOBALDATA_TYPE_BOOLEAN;
- pNewData->bData = bData;
- pNewData->bPersistent = bDefaultPersistent;
- }
- break;
- case JS_GLOBALDATA_TYPE_STRING:
- {
- pNewData = new js_global_data;
- pNewData->nType = JS_GLOBALDATA_TYPE_STRING;
- pNewData->sData = sData;
- pNewData->bPersistent = bDefaultPersistent;
- }
- break;
- case JS_GLOBALDATA_TYPE_OBJECT:
- {
- pNewData = new js_global_data;
- pNewData->nType = JS_GLOBALDATA_TYPE_OBJECT;
- pNewData->pData.Reset(JS_GetRuntime(pData), pData);
- pNewData->bPersistent = bDefaultPersistent;
- }
- break;
- case JS_GLOBALDATA_TYPE_NULL:
- {
- pNewData = new js_global_data;
- pNewData->nType = JS_GLOBALDATA_TYPE_NULL;
- pNewData->bPersistent = bDefaultPersistent;
- }
- break;
- default:
- return FALSE;
- }
-
- m_mapGlobal.SetAt(propname, (FX_LPVOID)pNewData);
-
- return TRUE;
-}
+// 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
+
+#include "../../include/javascript/JavaScript.h"
+#include "../../include/javascript/IJavaScript.h"
+#include "../../include/javascript/JS_Define.h"
+#include "../../include/javascript/JS_Object.h"
+#include "../../include/javascript/JS_Value.h"
+#include "../../include/javascript/JS_GlobalData.h"
+#include "../../include/javascript/global.h"
+#include "../../include/javascript/JS_EventHandler.h"
+#include "../../include/javascript/JS_Context.h"
+
+/* ---------------------------- global ---------------------------- */
+
+BEGIN_JS_STATIC_CONST(CJS_Global)
+END_JS_STATIC_CONST()
+
+BEGIN_JS_STATIC_PROP(CJS_Global)
+END_JS_STATIC_PROP()
+
+BEGIN_JS_STATIC_METHOD(CJS_Global)
+ JS_STATIC_METHOD_ENTRY(setPersistent, 2)
+END_JS_STATIC_METHOD()
+
+IMPLEMENT_SPECIAL_JS_CLASS(CJS_Global, global_alternate, global);
+
+FX_BOOL CJS_Global::InitInstance(IFXJS_Context* cc)
+{
+ CJS_Context* pContext = (CJS_Context*)cc;
+ ASSERT(pContext != NULL);
+
+ global_alternate* pGlobal = (global_alternate*)GetEmbedObject();
+ ASSERT(pGlobal != NULL);
+
+ pGlobal->Initial(pContext->GetReaderApp());
+
+ return TRUE;
+};
+
+global_alternate::global_alternate(CJS_Object* pJSObject)
+ : CJS_EmbedObj(pJSObject),
+ m_pApp(NULL)
+{
+}
+
+global_alternate::~global_alternate(void)
+{
+ ASSERT(m_pApp != NULL);
+
+// CommitGlobalPersisitentVariables();
+ DestroyGlobalPersisitentVariables();
+
+ CJS_RuntimeFactory* pFactory = m_pApp->m_pJSRuntimeFactory;
+ ASSERT(pFactory);
+
+ pFactory->ReleaseGlobalData();
+}
+
+void global_alternate::Initial(CPDFDoc_Environment* pApp)
+{
+ m_pApp = pApp;
+
+ CJS_RuntimeFactory* pFactory = pApp->m_pJSRuntimeFactory;
+ ASSERT(pFactory);
+ m_pGlobalData = pFactory->NewGlobalData(pApp);
+ UpdateGlobalPersistentVariables();
+}
+
+FX_BOOL global_alternate::QueryProperty(FX_LPCWSTR propname)
+{
+ return CFX_WideString(propname) != L"setPersistent";
+}
+
+FX_BOOL global_alternate::DelProperty(IFXJS_Context* cc, FX_LPCWSTR propname, JS_ErrorString& sError)
+{
+ js_global_data* pData = NULL;
+ CFX_ByteString sPropName = CFX_ByteString::FromUnicode(propname);
+
+ if (m_mapGlobal.Lookup(sPropName, (FX_LPVOID&)pData))
+ {
+ pData->bDeleted = TRUE;
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+FX_BOOL global_alternate::DoProperty(IFXJS_Context* cc, FX_LPCWSTR propname, CJS_PropValue& vp, JS_ErrorString& sError)
+{
+ if (vp.IsSetting())
+ {
+ CFX_ByteString sPropName = CFX_ByteString::FromUnicode(propname);
+ switch (vp.GetType())
+ {
+ case VT_number:
+ {
+ double dData;
+ vp >> dData;
+ return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_NUMBER, dData, false, "", v8::Handle<v8::Object>(), FALSE);
+ }
+ case VT_boolean:
+ {
+ bool bData;
+ vp >> bData;
+ return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_BOOLEAN, 0, (bool)vp, "", v8::Handle<v8::Object>(), FALSE);
+ }
+ case VT_string:
+ {
+ CFX_ByteString sData;
+ vp >> sData;
+ return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_STRING, 0, false, sData, v8::Handle<v8::Object>(), FALSE);
+ }
+ case VT_object:
+ {
+ JSObject pData = (JSObject)vp;
+ return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_OBJECT, 0, false, "", pData, FALSE);
+// else
+// {
+// if (vp.IsArrayObject())
+// {
+// CJS_Array array;
+// vp.ConvertToArray(array);
+// return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_OBJECT, 0, false, "",
+// (Dobject*)(Darray*)array, FALSE);
+// }
+// else
+// return FALSE;
+// }
+ }
+ case VT_null:
+ {
+ return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_NULL, 0, false, "", v8::Handle<v8::Object>(), FALSE);
+ }
+ case VT_undefined:
+ {
+ DelProperty(cc, propname, sError);
+ return TRUE;
+ }
+ default:
+ return FALSE;
+ }
+ }
+ else
+ {
+ js_global_data* pData = NULL;
+ CFX_ByteString sPropName = CFX_ByteString::FromUnicode(propname);
+
+ if (m_mapGlobal.Lookup(sPropName, (FX_LPVOID&)pData))
+ {
+ if (pData)
+ {
+ if (!pData->bDeleted)
+ {
+ switch (pData->nType)
+ {
+ case JS_GLOBALDATA_TYPE_NUMBER:
+ vp << pData->dData;
+ break;
+ case JS_GLOBALDATA_TYPE_BOOLEAN:
+ vp << pData->bData;
+ break;
+ case JS_GLOBALDATA_TYPE_STRING:
+ vp << pData->sData;
+ break;
+ case JS_GLOBALDATA_TYPE_OBJECT:
+ {
+ v8::Handle<v8::Object> obj = v8::Local<v8::Object>::New(vp.GetIsolate(),pData->pData);
+ vp << obj;
+ break;
+ }
+ case JS_GLOBALDATA_TYPE_NULL:
+ vp.SetNull();
+ break;
+ default:
+ return FALSE;
+ }
+ return TRUE;
+ }
+ else
+ {
+ return TRUE;
+ }
+ }
+ else
+ {
+ vp.SetNull();
+ return TRUE;
+ }
+ }
+ else
+ {
+ vp.SetNull();
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
+FX_BOOL global_alternate::setPersistent(OBJ_METHOD_PARAMS)
+{
+ if (params.size() != 2)
+ {
+ //sError = JSGetStringFromID(IDS_STRING_JSPARAMERROR);
+ return FALSE;
+ }
+
+ CFX_ByteString sName = params[0];
+
+ js_global_data* pData = NULL;
+ if (m_mapGlobal.Lookup(sName, (FX_LPVOID&)pData))
+ {
+ if (pData && !pData->bDeleted)
+ {
+ pData->bPersistent = (bool)params[1];
+ return TRUE;
+ }
+ }
+
+ //sError = JSGetStringFromID(IDS_JSPARAM_INCORRECT);
+ return FALSE;
+}
+
+void global_alternate::UpdateGlobalPersistentVariables()
+{
+ ASSERT(m_pGlobalData != NULL);
+
+ for (int i=0,sz=m_pGlobalData->GetSize(); i<sz; i++)
+ {
+ CJS_GlobalData_Element* pData = m_pGlobalData->GetAt(i);
+ ASSERT(pData != NULL);
+
+ switch (pData->data.nType)
+ {
+ case JS_GLOBALDATA_TYPE_NUMBER:
+ this->SetGlobalVariables(pData->data.sKey, JS_GLOBALDATA_TYPE_NUMBER, pData->data.dData, false, "", v8::Handle<v8::Object>(), pData->bPersistent == 1);
+ JS_PutObjectNumber(NULL,(JSFXObject)(*m_pJSObject),
+ pData->data.sKey.UTF8Decode(), pData->data.dData);
+ break;
+ case JS_GLOBALDATA_TYPE_BOOLEAN:
+ this->SetGlobalVariables(pData->data.sKey, JS_GLOBALDATA_TYPE_BOOLEAN, 0, (bool)(pData->data.bData == 1), "", v8::Handle<v8::Object>(), pData->bPersistent == 1);
+ JS_PutObjectBoolean(NULL,(JSFXObject)(*m_pJSObject),
+ pData->data.sKey.UTF8Decode(), (bool)(pData->data.bData == 1));
+ break;
+ case JS_GLOBALDATA_TYPE_STRING:
+ this->SetGlobalVariables(pData->data.sKey, JS_GLOBALDATA_TYPE_STRING, 0, false, pData->data.sData, v8::Handle<v8::Object>(), pData->bPersistent == 1);
+ JS_PutObjectString(NULL,(JSFXObject)(*m_pJSObject),
+ pData->data.sKey.UTF8Decode(),
+ pData->data.sData.UTF8Decode());
+ break;
+ case JS_GLOBALDATA_TYPE_OBJECT:
+ {
+ IJS_Runtime* pRuntime = JS_GetRuntime((JSFXObject)(*m_pJSObject));
+ v8::Handle<v8::Object> pObj = JS_NewFxDynamicObj(pRuntime, NULL, -1);
+
+ PutObjectProperty(pObj, &pData->data);
+
+ this->SetGlobalVariables(pData->data.sKey, JS_GLOBALDATA_TYPE_OBJECT, 0, false, "",
+ (JSObject)pObj, pData->bPersistent == 1);
+ JS_PutObjectObject(NULL,(JSFXObject)(*m_pJSObject),
+ pData->data.sKey.UTF8Decode(), (JSObject)pObj);
+ }
+ break;
+ case JS_GLOBALDATA_TYPE_NULL:
+ this->SetGlobalVariables(pData->data.sKey, JS_GLOBALDATA_TYPE_NULL, 0, false, "", v8::Handle<v8::Object>(), pData->bPersistent == 1);
+ JS_PutObjectNull(NULL,(JSFXObject)(*m_pJSObject),
+ pData->data.sKey.UTF8Decode());
+ break;
+ }
+ }
+}
+
+void global_alternate::CommitGlobalPersisitentVariables()
+{
+ ASSERT(m_pGlobalData != NULL);
+
+ FX_POSITION pos = m_mapGlobal.GetStartPosition();
+ while (pos)
+ {
+ CFX_ByteString name;
+ js_global_data* pData = NULL;
+ m_mapGlobal.GetNextAssoc(pos, name, (FX_LPVOID&)pData);
+
+ if (pData)
+ {
+ if (pData->bDeleted)
+ {
+ m_pGlobalData->DeleteGlobalVariable(name);
+ }
+ else
+ {
+ switch (pData->nType)
+ {
+ case JS_GLOBALDATA_TYPE_NUMBER:
+ m_pGlobalData->SetGlobalVariableNumber(name, pData->dData);
+ m_pGlobalData->SetGlobalVariablePersistent(name, pData->bPersistent);
+ break;
+ case JS_GLOBALDATA_TYPE_BOOLEAN:
+ m_pGlobalData->SetGlobalVariableBoolean(name, pData->bData);
+ m_pGlobalData->SetGlobalVariablePersistent(name, pData->bPersistent);
+ break;
+ case JS_GLOBALDATA_TYPE_STRING:
+ m_pGlobalData->SetGlobalVariableString(name, pData->sData);
+ m_pGlobalData->SetGlobalVariablePersistent(name, pData->bPersistent);
+ break;
+ case JS_GLOBALDATA_TYPE_OBJECT:
+ //if (pData->pData)
+ {
+ CJS_GlobalVariableArray array;
+ v8::Handle<v8::Object> obj = v8::Local<v8::Object>::New(GetJSObject()->GetIsolate(),pData->pData);
+ ObjectToArray(obj, array);
+ m_pGlobalData->SetGlobalVariableObject(name, array);
+ m_pGlobalData->SetGlobalVariablePersistent(name, pData->bPersistent);
+ }
+ break;
+ case JS_GLOBALDATA_TYPE_NULL:
+ m_pGlobalData->SetGlobalVariableNull(name);
+ m_pGlobalData->SetGlobalVariablePersistent(name, pData->bPersistent);
+ break;
+ }
+ }
+ }
+ }
+}
+
+void global_alternate::ObjectToArray(v8::Handle<v8::Object> pObj, CJS_GlobalVariableArray& array)
+{
+ v8::Handle<v8::Array> pKeyList = JS_GetObjectElementNames(pObj);
+ int nObjElements = pKeyList->Length();
+
+ v8::Local<v8::Context> context = pObj->CreationContext();
+ v8::Isolate* isolate = context->GetIsolate();
+
+ for (int i=0; i<nObjElements; i++)
+ {
+
+ CFX_WideString ws = JS_ToString(JS_GetArrayElemnet(pKeyList, i));
+ CFX_ByteString sKey = ws.UTF8Encode();
+
+ v8::Handle<v8::Value> v = JS_GetObjectElement(isolate, pObj, (const wchar_t*)(FX_LPCWSTR)ws);
+ FXJSVALUETYPE vt = GET_VALUE_TYPE(v);
+ switch (vt)
+ {
+ case VT_number:
+ {
+ CJS_KeyValue* pObjElement = new CJS_KeyValue;
+ pObjElement->nType = JS_GLOBALDATA_TYPE_NUMBER;
+ pObjElement->sKey = sKey;
+ pObjElement->dData = JS_ToNumber(v);
+ array.Add(pObjElement);
+ }
+ break;
+ case VT_boolean:
+ {
+ CJS_KeyValue* pObjElement = new CJS_KeyValue;
+ pObjElement->nType = JS_GLOBALDATA_TYPE_BOOLEAN;
+ pObjElement->sKey = sKey;
+ pObjElement->dData = JS_ToBoolean(v);
+ array.Add(pObjElement);
+ }
+ break;
+ case VT_string:
+ {
+ CFX_ByteString sValue = CJS_Value(isolate, v, VT_string);
+ CJS_KeyValue* pObjElement = new CJS_KeyValue;
+ pObjElement->nType = JS_GLOBALDATA_TYPE_STRING;
+ pObjElement->sKey = sKey;
+ pObjElement->sData = sValue;
+ array.Add(pObjElement);
+ }
+ break;
+ case VT_object:
+ {
+ CJS_KeyValue* pObjElement = new CJS_KeyValue;
+ pObjElement->nType = JS_GLOBALDATA_TYPE_OBJECT;
+ pObjElement->sKey = sKey;
+ ObjectToArray(JS_ToObject(v), pObjElement->objData);
+ array.Add(pObjElement);
+ }
+ break;
+ case VT_null:
+ {
+ CJS_KeyValue* pObjElement = new CJS_KeyValue;
+ pObjElement->nType = JS_GLOBALDATA_TYPE_NULL;
+ pObjElement->sKey = sKey;
+ array.Add(pObjElement);
+ }
+ break;
+ default:
+ break;
+ }
+ }
+}
+
+void global_alternate::PutObjectProperty(v8::Handle<v8::Object> pObj, CJS_KeyValue* pData)
+{
+ ASSERT(pData != NULL);
+
+ for (int i=0,sz=pData->objData.Count(); i<sz; i++)
+ {
+ CJS_KeyValue* pObjData = pData->objData.GetAt(i);
+ ASSERT(pObjData != NULL);
+
+ switch (pObjData->nType)
+ {
+ case JS_GLOBALDATA_TYPE_NUMBER:
+ JS_PutObjectNumber(NULL,(JSObject)pObj, pObjData->sKey.UTF8Decode(), pObjData->dData);
+ break;
+ case JS_GLOBALDATA_TYPE_BOOLEAN:
+ JS_PutObjectBoolean(NULL,(JSObject)pObj, pObjData->sKey.UTF8Decode(), (bool)(pObjData->bData == 1));
+ break;
+ case JS_GLOBALDATA_TYPE_STRING:
+ JS_PutObjectString(NULL,(JSObject)pObj, pObjData->sKey.UTF8Decode(), pObjData->sData.UTF8Decode());
+ break;
+ case JS_GLOBALDATA_TYPE_OBJECT:
+ {
+ IJS_Runtime* pRuntime = JS_GetRuntime((JSFXObject)(*m_pJSObject));
+ v8::Handle<v8::Object> pNewObj = JS_NewFxDynamicObj(pRuntime, NULL, -1);
+ PutObjectProperty(pNewObj, pObjData);
+ JS_PutObjectObject(NULL, (JSObject)pObj, pObjData->sKey.UTF8Decode(), (JSObject)pNewObj);
+ }
+ break;
+ case JS_GLOBALDATA_TYPE_NULL:
+ JS_PutObjectNull(NULL,(JSObject)pObj, pObjData->sKey.UTF8Decode());
+ break;
+ }
+ }
+}
+
+void global_alternate::DestroyGlobalPersisitentVariables()
+{
+ FX_POSITION pos = m_mapGlobal.GetStartPosition();
+ while (pos)
+ {
+ CFX_ByteString name;
+ js_global_data* pData = NULL;
+ m_mapGlobal.GetNextAssoc(pos, name, (FX_LPVOID&)pData);
+ delete pData;
+ }
+
+ m_mapGlobal.RemoveAll();
+}
+
+
+FX_BOOL global_alternate::SetGlobalVariables(FX_LPCSTR propname, int nType,
+ double dData, bool bData, const CFX_ByteString& sData, JSObject pData, bool bDefaultPersistent)
+{
+ if (propname == NULL) return FALSE;
+
+ js_global_data* pTemp = NULL;
+ m_mapGlobal.Lookup(propname, (FX_LPVOID&)pTemp);
+
+ if (pTemp)
+ {
+ if (pTemp->bDeleted || pTemp->nType != nType)
+ {
+ pTemp->dData = 0;
+ pTemp->bData = 0;
+ pTemp->sData = "";
+ pTemp->nType = nType;
+ }
+
+ pTemp->bDeleted = FALSE;
+
+ switch (nType)
+ {
+ case JS_GLOBALDATA_TYPE_NUMBER:
+ {
+ pTemp->dData = dData;
+ }
+ break;
+ case JS_GLOBALDATA_TYPE_BOOLEAN:
+ {
+ pTemp->bData = bData;
+ }
+ break;
+ case JS_GLOBALDATA_TYPE_STRING:
+ {
+ pTemp->sData = sData;
+ }
+ break;
+ case JS_GLOBALDATA_TYPE_OBJECT:
+ {
+ pTemp->pData.Reset(JS_GetRuntime(pData), pData);
+ }
+ break;
+ case JS_GLOBALDATA_TYPE_NULL:
+ break;
+ default:
+ return FALSE;
+ }
+
+ return TRUE;
+ }
+
+ js_global_data* pNewData = NULL;
+
+ switch (nType)
+ {
+ case JS_GLOBALDATA_TYPE_NUMBER:
+ {
+ pNewData = new js_global_data;
+ pNewData->nType = JS_GLOBALDATA_TYPE_NUMBER;
+ pNewData->dData = dData;
+ pNewData->bPersistent = bDefaultPersistent;
+ }
+ break;
+ case JS_GLOBALDATA_TYPE_BOOLEAN:
+ {
+ pNewData = new js_global_data;
+ pNewData->nType = JS_GLOBALDATA_TYPE_BOOLEAN;
+ pNewData->bData = bData;
+ pNewData->bPersistent = bDefaultPersistent;
+ }
+ break;
+ case JS_GLOBALDATA_TYPE_STRING:
+ {
+ pNewData = new js_global_data;
+ pNewData->nType = JS_GLOBALDATA_TYPE_STRING;
+ pNewData->sData = sData;
+ pNewData->bPersistent = bDefaultPersistent;
+ }
+ break;
+ case JS_GLOBALDATA_TYPE_OBJECT:
+ {
+ pNewData = new js_global_data;
+ pNewData->nType = JS_GLOBALDATA_TYPE_OBJECT;
+ pNewData->pData.Reset(JS_GetRuntime(pData), pData);
+ pNewData->bPersistent = bDefaultPersistent;
+ }
+ break;
+ case JS_GLOBALDATA_TYPE_NULL:
+ {
+ pNewData = new js_global_data;
+ pNewData->nType = JS_GLOBALDATA_TYPE_NULL;
+ pNewData->bPersistent = bDefaultPersistent;
+ }
+ break;
+ default:
+ return FALSE;
+ }
+
+ m_mapGlobal.SetAt(propname, (FX_LPVOID)pNewData);
+
+ return TRUE;
+}
diff --git a/fpdfsdk/src/javascript/report.cpp b/fpdfsdk/src/javascript/report.cpp
index 5063c68e4c..9cb9da5051 100644
--- a/fpdfsdk/src/javascript/report.cpp
+++ b/fpdfsdk/src/javascript/report.cpp
@@ -1,50 +1,50 @@
-// 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
-
-#include "../../include/javascript/JavaScript.h"
-#include "../../include/javascript/IJavaScript.h"
-#include "../../include/javascript/JS_Define.h"
-#include "../../include/javascript/JS_Object.h"
-#include "../../include/javascript/JS_Value.h"
-#include "../../include/javascript/report.h"
-
-/* ---------------------- report ---------------------- */
-
-BEGIN_JS_STATIC_CONST(CJS_Report)
-END_JS_STATIC_CONST()
-
-BEGIN_JS_STATIC_PROP(CJS_Report)
-END_JS_STATIC_PROP()
-
-BEGIN_JS_STATIC_METHOD(CJS_Report)
- JS_STATIC_METHOD_ENTRY(save, 1)
- JS_STATIC_METHOD_ENTRY(writeText,1)
-END_JS_STATIC_METHOD()
-
-IMPLEMENT_JS_CLASS(CJS_Report, Report)
-
-Report::Report(CJS_Object* pJSObject) : CJS_EmbedObj(pJSObject)
-{
-
-}
-
-Report::~Report()
-{
-
-}
-
-FX_BOOL Report::writeText(OBJ_METHOD_PARAMS)
-{
- if (IsSafeMode(cc)) return TRUE;
- return TRUE;
-}
-
-FX_BOOL Report::save(OBJ_METHOD_PARAMS)
-{
- if (IsSafeMode(cc)) return TRUE;
- return TRUE;
-}
-
+// 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
+
+#include "../../include/javascript/JavaScript.h"
+#include "../../include/javascript/IJavaScript.h"
+#include "../../include/javascript/JS_Define.h"
+#include "../../include/javascript/JS_Object.h"
+#include "../../include/javascript/JS_Value.h"
+#include "../../include/javascript/report.h"
+
+/* ---------------------- report ---------------------- */
+
+BEGIN_JS_STATIC_CONST(CJS_Report)
+END_JS_STATIC_CONST()
+
+BEGIN_JS_STATIC_PROP(CJS_Report)
+END_JS_STATIC_PROP()
+
+BEGIN_JS_STATIC_METHOD(CJS_Report)
+ JS_STATIC_METHOD_ENTRY(save, 1)
+ JS_STATIC_METHOD_ENTRY(writeText,1)
+END_JS_STATIC_METHOD()
+
+IMPLEMENT_JS_CLASS(CJS_Report, Report)
+
+Report::Report(CJS_Object* pJSObject) : CJS_EmbedObj(pJSObject)
+{
+
+}
+
+Report::~Report()
+{
+
+}
+
+FX_BOOL Report::writeText(OBJ_METHOD_PARAMS)
+{
+ if (IsSafeMode(cc)) return TRUE;
+ return TRUE;
+}
+
+FX_BOOL Report::save(OBJ_METHOD_PARAMS)
+{
+ if (IsSafeMode(cc)) return TRUE;
+ return TRUE;
+}
+
diff --git a/fpdfsdk/src/javascript/util.cpp b/fpdfsdk/src/javascript/util.cpp
index b7303a7578..bafdb22da9 100644
--- a/fpdfsdk/src/javascript/util.cpp
+++ b/fpdfsdk/src/javascript/util.cpp
@@ -1,649 +1,649 @@
-// 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
-
-#include "../../include/javascript/JavaScript.h"
-#include "../../include/javascript/IJavaScript.h"
-#include "../../include/javascript/JS_Define.h"
-#include "../../include/javascript/JS_Object.h"
-#include "../../include/javascript/JS_Value.h"
-#include "../../include/javascript/util.h"
-#include "../../include/javascript/PublicMethods.h"
-#include "../../include/javascript/resource.h"
-#include "../../include/javascript/JS_Context.h"
-#include "../../include/javascript/JS_EventHandler.h"
-#include "../../include/javascript/JS_Runtime.h"
-
-#if _FX_OS_ == _FX_ANDROID_
-#include <ctype.h>
-#endif
-
-static v8::Isolate* GetIsolate(IFXJS_Context* cc)
-{
- CJS_Context* pContext = (CJS_Context *)cc;
- ASSERT(pContext != NULL);
-
- CJS_Runtime* pRuntime = pContext->GetJSRuntime();
- ASSERT(pRuntime != NULL);
-
- return pRuntime->GetIsolate();
-}
-
-BEGIN_JS_STATIC_CONST(CJS_Util)
-END_JS_STATIC_CONST()
-
-BEGIN_JS_STATIC_PROP(CJS_Util)
-END_JS_STATIC_PROP()
-
-BEGIN_JS_STATIC_METHOD(CJS_Util)
- JS_STATIC_METHOD_ENTRY(printd, 3)
- JS_STATIC_METHOD_ENTRY(printf, 20)
- JS_STATIC_METHOD_ENTRY(printx, 2)
- JS_STATIC_METHOD_ENTRY(scand, 2)
- JS_STATIC_METHOD_ENTRY(byteToChar, 1)
-END_JS_STATIC_METHOD()
-
-IMPLEMENT_JS_CLASS(CJS_Util,util)
-
-util::util(CJS_Object *pJSObject) : CJS_EmbedObj(pJSObject)
-{
-}
-
-util::~util(void)
-{
-}
-
-
-struct stru_TbConvert
-{
- FX_LPCWSTR lpszJSMark;
- FX_LPCWSTR lpszCppMark;
-};
-
-const stru_TbConvert fcTable[] = {
- (FX_LPCWSTR)L"mmmm", (FX_LPCWSTR)L"%B",
- (FX_LPCWSTR)L"mmm", (FX_LPCWSTR)L"%b",
- (FX_LPCWSTR)L"mm", (FX_LPCWSTR)L"%m",
- //"m"
- (FX_LPCWSTR)L"dddd", (FX_LPCWSTR)L"%A",
- (FX_LPCWSTR)L"ddd", (FX_LPCWSTR)L"%a",
- (FX_LPCWSTR)L"dd", (FX_LPCWSTR)L"%d",
- //"d", "%w",
- (FX_LPCWSTR)L"yyyy", (FX_LPCWSTR)L"%Y",
- (FX_LPCWSTR)L"yy", (FX_LPCWSTR)L"%y",
- (FX_LPCWSTR)L"HH", (FX_LPCWSTR)L"%H",
- //"H"
- (FX_LPCWSTR)L"hh", (FX_LPCWSTR)L"%I",
- //"h"
- (FX_LPCWSTR)L"MM", (FX_LPCWSTR)L"%M",
- //"M"
- (FX_LPCWSTR)L"ss", (FX_LPCWSTR)L"%S",
- //"s
- (FX_LPCWSTR)L"TT", (FX_LPCWSTR)L"%p",
- //"t"
-#if defined(_WIN32)
- (FX_LPCWSTR)L"tt", (FX_LPCWSTR)L"%p",
- (FX_LPCWSTR)L"h", (FX_LPCWSTR)L"%#I",
-#else
- (FX_LPCWSTR)L"tt", (FX_LPCWSTR)L"%P",
- (FX_LPCWSTR)L"h", (FX_LPCWSTR)L"%l",
-#endif
-};
-
-#define UTIL_INT 0
-#define UTIL_DOUBLE 1
-#define UTIL_STRING 2
-
-int util::ParstDataType(std::wstring* sFormat)
-{
- size_t i = 0;
- bool bPercent = FALSE;
- for (i=0; i<sFormat->length(); ++i)
- {
- wchar_t c = (*sFormat)[i];
- if (c == L'%')
- {
- bPercent = true;
- continue;
- }
-
- if (bPercent)
- {
- if (c == L'c' || c == L'C' || c == L'd' || c == L'i' || c == L'o' || c == L'u' || c == L'x' || c == L'X')
- {
- return UTIL_INT;
- }
- else if (c == L'e' || c == L'E' || c == L'f' || c == L'g' || c == L'G')
- {
- return UTIL_DOUBLE;
- }
- else if (c == L's' || c == L'S')
- {
- // Map s to S since we always deal internally
- // with wchar_t strings.
- (*sFormat)[i] = L'S';
- return UTIL_STRING;
- }
- else if (c == L'.' || c == L'+' || c == L'-' || c == L'#' || c == L' ' || CJS_PublicMethods::IsDigit(c))
- {
- continue;
- }
- else break;
- }
- }
-
- return -1;
-}
-
-FX_BOOL util::printf(OBJ_METHOD_PARAMS)
-{
- int iSize = params.size();
- if (iSize < 1)
- return FALSE;
- std::wstring c_ConvChar((const wchar_t*)(FX_LPCWSTR)params[0].operator CFX_WideString());
- std::vector<std::wstring> c_strConvers;
- int iOffset = 0;
- int iOffend = 0;
- c_ConvChar.insert(c_ConvChar.begin(),L'S');
- while(iOffset != -1)
- {
- iOffend = c_ConvChar.find(L"%",iOffset+1);
- std::wstring strSub;
- if (iOffend == -1)
- strSub = c_ConvChar.substr(iOffset);
- else
- strSub = c_ConvChar.substr(iOffset ,iOffend - iOffset);
- c_strConvers.push_back(strSub);
- iOffset = iOffend ;
- }
-
- std::wstring c_strResult;
-
- //for(int iIndex = 1;iIndex < params.size();iIndex++)
- std::wstring c_strFormat;
- for(int iIndex = 0;iIndex < (int)c_strConvers.size();iIndex++)
- {
- c_strFormat = c_strConvers[iIndex];
- if (iIndex == 0)
- {
- c_strResult = c_strFormat;
- continue;
- }
-
-
- CFX_WideString strSegment;
- if (iIndex >= iSize) {
- c_strResult += c_strFormat;
- continue;
- }
-
- switch (ParstDataType(&c_strFormat))
- {
- case UTIL_INT:
- strSegment.Format((FX_LPCWSTR)c_strFormat.c_str(),(int)params[iIndex]);
- break;
- case UTIL_DOUBLE:
- strSegment.Format((FX_LPCWSTR)c_strFormat.c_str(),(double)params[iIndex]);
- break;
- case UTIL_STRING:
- strSegment.Format((FX_LPCWSTR)c_strFormat.c_str(),(FX_LPCWSTR)params[iIndex].operator CFX_WideString());
- break;
- default:
- strSegment.Format((FX_LPCWSTR)L"%S", (FX_LPCWSTR)c_strFormat.c_str());
- break;
- }
- c_strResult += (wchar_t*)strSegment.GetBuffer(strSegment.GetLength()+1);
- }
-
- c_strResult.erase(c_strResult.begin());
- vRet = (FX_LPCWSTR)c_strResult.c_str();
- return TRUE;
-}
-
-FX_BOOL util::printd(OBJ_METHOD_PARAMS)
-{
- v8::Isolate* isolate = GetIsolate(cc);
-
- int iSize = params.size();
- if (iSize < 2)
- return FALSE;
-
- CJS_Value p1(isolate);
- p1 = params[0];
-
- CJS_Value p2 = params[1];
- CJS_Date jsDate(isolate);
- if (!p2.ConvertToDate(jsDate))
- {
- sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPRINT1);
- return FALSE;
- }
-
- if (!jsDate.IsValidDate())
- {
- sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPRINT2);
- return FALSE;
- }
-
- if (p1.GetType() == VT_number)
- {
- int nFormat = p1;
-
- CFX_WideString swResult;
-
- switch (nFormat)
- {
- case 0:
- swResult.Format((FX_LPCWSTR)L"D:%04d%02d%02d%02d%02d%02d",
- jsDate.GetYear(),
- jsDate.GetMonth() + 1,
- jsDate.GetDay(),
- jsDate.GetHours(),
- jsDate.GetMinutes(),
- jsDate.GetSeconds());
- break;
- case 1:
- swResult.Format((FX_LPCWSTR)L"%04d.%02d.%02d %02d:%02d:%02d",
- jsDate.GetYear(),
- jsDate.GetMonth() + 1,
- jsDate.GetDay(),
- jsDate.GetHours(),
- jsDate.GetMinutes(),
- jsDate.GetSeconds());
- break;
- case 2:
- swResult.Format((FX_LPCWSTR)L"%04d/%02d/%02d %02d:%02d:%02d",
- jsDate.GetYear(),
- jsDate.GetMonth() + 1,
- jsDate.GetDay(),
- jsDate.GetHours(),
- jsDate.GetMinutes(),
- jsDate.GetSeconds());
- break;
- default:
- return FALSE;
- }
-
- vRet = swResult;
- return TRUE;
- }
- else if (p1.GetType() == VT_string)
- {
- std::basic_string<wchar_t> cFormat = (wchar_t*)(FX_LPCWSTR)p1.operator CFX_WideString();
-
- bool bXFAPicture = false;
- if (iSize > 2)
- {
- //CJS_Value value;
- bXFAPicture = params[2];
- }
-
- if (bXFAPicture)
- {
- return FALSE; //currently, it doesn't support XFAPicture.
- }
-
- int iIndex;
- for(iIndex = 0;iIndex<sizeof(fcTable)/sizeof(stru_TbConvert);iIndex++)
- {
- int iStart = 0;
- int iEnd;
- while((iEnd = cFormat.find((CFX_WideString)fcTable[iIndex].lpszJSMark, iStart)) != -1)
- {
- cFormat.replace(iEnd, FXSYS_wcslen(fcTable[iIndex].lpszJSMark), (CFX_WideString)fcTable[iIndex].lpszCppMark);
- iStart = iEnd;
- }
- }
-
- int iYear,iMonth,iDay,iHour,iMin,iSec;
- iYear = jsDate.GetYear();
- iMonth = jsDate.GetMonth();
- iDay = jsDate.GetDay();
- iHour = jsDate.GetHours();
- iMin = jsDate.GetMinutes();
- iSec = jsDate.GetSeconds();
-
- struct tm time = {0};
- time.tm_year = iYear-1900;
- time.tm_mon = iMonth;
- time.tm_mday = iDay;
- time.tm_hour = iHour;
- time.tm_min = iMin;
- time.tm_sec = iSec;
- //COleDateTime cppTm(iYear,iMonth+1,iDay,iHour,iMin,iSec);
- //CString strFormat = cppTm.Format(cFormat.c_str());
-
- struct stru_TbConvertAd
- {
- FX_LPCWSTR lpszJSMark;
- int iValue;
- };
-
- stru_TbConvertAd cTableAd[] ={
- (FX_LPCWSTR)L"m", iMonth+1,
- (FX_LPCWSTR)L"d", iDay,
- (FX_LPCWSTR)L"H", iHour,
- (FX_LPCWSTR)L"h", iHour>12?iHour-12:iHour,
- (FX_LPCWSTR)L"M", iMin,
- (FX_LPCWSTR)L"s", iSec
- };
-
- //cFormat = strFormat.GetBuffer(strFormat.GetLength()+1);
- for(iIndex = 0;iIndex<sizeof(cTableAd)/sizeof(stru_TbConvertAd);iIndex++)
- {
- wchar_t tszValue[10];
- //_itot(cTableAd[iIndex].iValue,tszValue,10);
- CFX_WideString sValue;
- sValue.Format((FX_LPCWSTR)L"%d",cTableAd[iIndex].iValue);
- memcpy(tszValue, (wchar_t *)sValue.GetBuffer(sValue.GetLength()+1),
- (sValue.GetLength()+1)*sizeof(wchar_t));
-
- //strFormat.Replace(cTableAd[iIndex].lpszJSMark,"%d");
- //strFormat.Format(strFormat,cTableAd[iIndex].iValue);
- int iStart = 0;
- int iEnd;
- while((iEnd = cFormat.find((CFX_WideString)cTableAd[iIndex].lpszJSMark,iStart)) != -1)
- {
- if (iEnd > 0)
- {
- if (cFormat[iEnd-1] == L'%')
- {
- iStart = iEnd+1;
- continue;
- }
- }
- cFormat.replace(iEnd, FXSYS_wcslen(cTableAd[iIndex].lpszJSMark), tszValue);
- iStart = iEnd;
- }
- }
-
- CFX_WideString strFormat;
-// strFormat.Format((FX_LPCWSTR)L"%d,%d,%d,%d,%d,%d",iYear, iMonth, iDay, iHour, iMin, iSec);
-// CString strFormat = cppTm.Format(cFormat.c_str());
- wchar_t buf[64] = {0};
- strFormat = wcsftime(buf, 64, cFormat.c_str(), &time);
- cFormat = buf;
- vRet = (FX_LPCWSTR)cFormat.c_str();
- //rtRet = strFormat.GetBuffer(strFormat.GetLength()+1);
- return TRUE;
- }
- return FALSE;
-}
-
-void util::printd(const std::wstring &cFormat2, CJS_Date jsDate, bool bXFAPicture, std::wstring &cPurpose)
-{
- std::wstring cFormat = cFormat2;
-
- if (bXFAPicture)
- {
- return ; //currently, it doesn't support XFAPicture.
- }
-
- int iIndex;
- for(iIndex = 0;iIndex<sizeof(fcTable)/sizeof(stru_TbConvert);iIndex++)
- {
- int iStart = 0;
- int iEnd;
- while((iEnd = cFormat.find((CFX_WideString)fcTable[iIndex].lpszJSMark,iStart)) != -1)
- {
- cFormat.replace(iEnd,FXSYS_wcslen(fcTable[iIndex].lpszJSMark), (CFX_WideString)fcTable[iIndex].lpszCppMark);
- iStart = iEnd;
- }
- }
-
- int iYear,iMonth,iDay,iHour,iMin,iSec;
- iYear = jsDate.GetYear();
- iMonth = jsDate.GetMonth();
- iDay = jsDate.GetDay();
- iHour = jsDate.GetHours();
- iMin = jsDate.GetMinutes();
- iSec = jsDate.GetSeconds();
-
- struct tm time = {0};
- time.tm_year = iYear-1900;
- time.tm_mon = iMonth;
- time.tm_mday = iDay;
- time.tm_hour = iHour;
- time.tm_min = iMin;
- time.tm_sec = iSec;
-// COleDateTime cppTm(iYear,iMonth+1,iDay,iHour,iMin,iSec);
- //CString strFormat = cppTm.Format(cFormat.c_str());
-
- struct stru_TbConvertAd
- {
- FX_LPCWSTR lpszJSMark;
- int iValue;
- };
-
- stru_TbConvertAd cTableAd[] ={
- (FX_LPCWSTR)L"m", iMonth+1,
- (FX_LPCWSTR)L"d", iDay,
- (FX_LPCWSTR)L"H", iHour,
- (FX_LPCWSTR)L"h", iHour>12?iHour-12:iHour,
- (FX_LPCWSTR)L"M", iMin,
- (FX_LPCWSTR)L"s", iSec
- };
-
- //cFormat = strFormat.GetBuffer(strFormat.GetLength()+1);
- for(iIndex = 0;iIndex<sizeof(cTableAd)/sizeof(stru_TbConvertAd);iIndex++)
- {
- wchar_t tszValue[10];
- //_itot(cTableAd[iIndex].iValue,tszValue,10);
- CFX_WideString sValue;
- sValue.Format((FX_LPCWSTR)L"%d",cTableAd[iIndex].iValue);
- memcpy(tszValue, (wchar_t *)sValue.GetBuffer(sValue.GetLength()+1),sValue.GetLength()*sizeof(wchar_t));
-
-
- //strFormat.Replace(cTableAd[iIndex].lpszJSMark,"%d");
- //strFormat.Format(strFormat,cTableAd[iIndex].iValue);
- int iStart = 0;
- int iEnd;
- while((iEnd = cFormat.find((CFX_WideString)cTableAd[iIndex].lpszJSMark,iStart)) != -1)
- {
- if (iEnd > 0)
- {
- if (cFormat[iEnd-1] == L'%')
- {
- iStart = iEnd+1;
- continue;
- }
- }
- cFormat.replace(iEnd,FXSYS_wcslen(cTableAd[iIndex].lpszJSMark),tszValue);
- iStart = iEnd;
- }
- }
-
- CFX_WideString strFormat;
-// strFormat.Format((FX_LPCWSTR)L"%d,%d,%d,%d,%d,%d",iYear, iMonth, iDay, iHour, iMin, iSec);
-// CString strFormat = cppTm.Format(cFormat.c_str());
- wchar_t buf[64] = {0};
- strFormat = wcsftime(buf, 64, cFormat.c_str(), &time);
- cFormat = buf;
- cPurpose = cFormat;
-}
-
-FX_BOOL util::printx(OBJ_METHOD_PARAMS)
-{
- int iSize = params.size();
- if (iSize<2)
- return FALSE;
- CFX_WideString sFormat = params[0].operator CFX_WideString();
- CFX_WideString sSource = params[1].operator CFX_WideString();
- std::string cFormat = (FX_LPCSTR)CFX_ByteString::FromUnicode(sFormat);
- std::string cSource = (FX_LPCSTR)CFX_ByteString::FromUnicode(sSource);
- std::string cDest;
- printx(cFormat,cSource,cDest);
- vRet = cDest.c_str();
- return TRUE;
-}
-
-void util::printx(const std::string &cFormat,const std::string &cSource2,std::string &cPurpose)
-{
- std::string cSource(cSource2);
- if (!cPurpose.empty())
- //cPurpose.clear();
- cPurpose.erase();
- int itSource = 0;
- int iSize = cSource.size();
- for(int iIndex = 0; iIndex < (int)cFormat.size() && itSource<iSize; iIndex++)
- {
- char letter = cFormat[iIndex];
- switch(letter)
- {
- case '?':
- //cPurpose.push_back(cSource[itSource]);
- cPurpose += cSource[itSource];
- itSource++;
- break;
- case 'X':
- {
- while(itSource < iSize)
- {
- if ((cSource[itSource]>='0'&&cSource[itSource]<='9') || (cSource[itSource]>='a' && cSource[itSource]<='z') || (cSource[itSource]>='A' && cSource[itSource]<='Z'))
- {
- //cPurpose.push_back(cSource[itSource]);
- cPurpose += cSource[itSource];
- itSource++;
- break;
- }
- itSource++;
- }
- break;
- }
- break;
- case 'A':
- {
- while(itSource < iSize)
- {
- if ((cSource[itSource]>='a' && cSource[itSource]<='z') || (cSource[itSource]>='A' && cSource[itSource]<='Z'))
- {
- //cPurpose.push_back(cSource[itSource]);
- cPurpose += cSource[itSource];
- itSource++;
- break;
- }
- itSource++;
- }
- break;
- }
- break;
- case '9':
- {
- while(itSource < iSize)
- {
- if (cSource[itSource]>='0'&&cSource[itSource]<='9')
- {
- //cPurpose.push_back(cSource[itSource]);
- cPurpose += cSource[itSource];
- itSource++;
- break;
- }
- itSource++;
- }
- break;
- }
- case '*':
- {
- cPurpose.append(cSource,itSource,iSize-itSource);
- itSource = iSize-1;
- break;
- }
- case '\\':
- break;
- case '>':
- {
- for(std::string::iterator it = cSource.begin();it != cSource.end(); it++)
- {
- *it = toupper(*it);
- }
- break;
- }
- case '<':
- {
- for(std::string::iterator it = cSource.begin();it != cSource.end(); it++)
- {
- *it = tolower(*it);
- }
- break;
- }
- case '=':
- break;
- default:
- //cPurpose.push_back(letter);
- cPurpose += letter;
- break;
- }
- }
-}
-
-FX_BOOL util::scand(OBJ_METHOD_PARAMS)
-{
- v8::Isolate* isolate = GetIsolate(cc);
- int iSize = params.size();
- if (iSize < 2)
- return FALSE;
- CFX_WideString sFormat = params[0].operator CFX_WideString();
- CFX_WideString sDate = params[1].operator CFX_WideString();
-
- double dDate = JS_GetDateTime();
- if (sDate.GetLength() > 0)
- {
- FX_BOOL bWrongFormat = FALSE;
- dDate = CJS_PublicMethods::MakeRegularDate(sDate,sFormat,bWrongFormat);
- }
-
- if (!JS_PortIsNan(dDate))
- {
- CJS_Date date(isolate,dDate);
- vRet = date;
- }
- else
- {
- vRet.SetNull();
- }
-
- return TRUE;
-}
-
-FX_INT64 FX_atoi64(const char *nptr)
-{
- int c; /* current char */
- FX_INT64 total; /* current total */
- int sign; /* if '-', then negative, otherwise positive */
-
- /* skip whitespace */
- while ( isspace((int)(unsigned char)*nptr) )
- ++nptr;
-
- c = (int)(unsigned char)*nptr++;
- sign = c; /* save sign indication */
- if (c == '-' || c == '+')
- c = (int)(unsigned char)*nptr++; /* skip sign */
-
- total = 0;
-
- while (isdigit(c)) {
- total = 10 * total + (c - '0'); /* accumulate digit */
- c = (int)(unsigned char)*nptr++; /* get next char */
- }
-
- if (sign == '-')
- return -total;
- else
- return total; /* return result, negated if necessary */
-}
-
-FX_BOOL util::byteToChar(OBJ_METHOD_PARAMS)
-{
- int iSize = params.size();
- if (iSize == 0)
- return FALSE;
- int nByte = (int)params[0];
- unsigned char cByte = (unsigned char)nByte;
- CFX_WideString csValue;
- csValue.Format((FX_LPCWSTR)L"%c", cByte);
- vRet = csValue;
- return TRUE;
-}
+// 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
+
+#include "../../include/javascript/JavaScript.h"
+#include "../../include/javascript/IJavaScript.h"
+#include "../../include/javascript/JS_Define.h"
+#include "../../include/javascript/JS_Object.h"
+#include "../../include/javascript/JS_Value.h"
+#include "../../include/javascript/util.h"
+#include "../../include/javascript/PublicMethods.h"
+#include "../../include/javascript/resource.h"
+#include "../../include/javascript/JS_Context.h"
+#include "../../include/javascript/JS_EventHandler.h"
+#include "../../include/javascript/JS_Runtime.h"
+
+#if _FX_OS_ == _FX_ANDROID_
+#include <ctype.h>
+#endif
+
+static v8::Isolate* GetIsolate(IFXJS_Context* cc)
+{
+ CJS_Context* pContext = (CJS_Context *)cc;
+ ASSERT(pContext != NULL);
+
+ CJS_Runtime* pRuntime = pContext->GetJSRuntime();
+ ASSERT(pRuntime != NULL);
+
+ return pRuntime->GetIsolate();
+}
+
+BEGIN_JS_STATIC_CONST(CJS_Util)
+END_JS_STATIC_CONST()
+
+BEGIN_JS_STATIC_PROP(CJS_Util)
+END_JS_STATIC_PROP()
+
+BEGIN_JS_STATIC_METHOD(CJS_Util)
+ JS_STATIC_METHOD_ENTRY(printd, 3)
+ JS_STATIC_METHOD_ENTRY(printf, 20)
+ JS_STATIC_METHOD_ENTRY(printx, 2)
+ JS_STATIC_METHOD_ENTRY(scand, 2)
+ JS_STATIC_METHOD_ENTRY(byteToChar, 1)
+END_JS_STATIC_METHOD()
+
+IMPLEMENT_JS_CLASS(CJS_Util,util)
+
+util::util(CJS_Object *pJSObject) : CJS_EmbedObj(pJSObject)
+{
+}
+
+util::~util(void)
+{
+}
+
+
+struct stru_TbConvert
+{
+ FX_LPCWSTR lpszJSMark;
+ FX_LPCWSTR lpszCppMark;
+};
+
+const stru_TbConvert fcTable[] = {
+ (FX_LPCWSTR)L"mmmm", (FX_LPCWSTR)L"%B",
+ (FX_LPCWSTR)L"mmm", (FX_LPCWSTR)L"%b",
+ (FX_LPCWSTR)L"mm", (FX_LPCWSTR)L"%m",
+ //"m"
+ (FX_LPCWSTR)L"dddd", (FX_LPCWSTR)L"%A",
+ (FX_LPCWSTR)L"ddd", (FX_LPCWSTR)L"%a",
+ (FX_LPCWSTR)L"dd", (FX_LPCWSTR)L"%d",
+ //"d", "%w",
+ (FX_LPCWSTR)L"yyyy", (FX_LPCWSTR)L"%Y",
+ (FX_LPCWSTR)L"yy", (FX_LPCWSTR)L"%y",
+ (FX_LPCWSTR)L"HH", (FX_LPCWSTR)L"%H",
+ //"H"
+ (FX_LPCWSTR)L"hh", (FX_LPCWSTR)L"%I",
+ //"h"
+ (FX_LPCWSTR)L"MM", (FX_LPCWSTR)L"%M",
+ //"M"
+ (FX_LPCWSTR)L"ss", (FX_LPCWSTR)L"%S",
+ //"s
+ (FX_LPCWSTR)L"TT", (FX_LPCWSTR)L"%p",
+ //"t"
+#if defined(_WIN32)
+ (FX_LPCWSTR)L"tt", (FX_LPCWSTR)L"%p",
+ (FX_LPCWSTR)L"h", (FX_LPCWSTR)L"%#I",
+#else
+ (FX_LPCWSTR)L"tt", (FX_LPCWSTR)L"%P",
+ (FX_LPCWSTR)L"h", (FX_LPCWSTR)L"%l",
+#endif
+};
+
+#define UTIL_INT 0
+#define UTIL_DOUBLE 1
+#define UTIL_STRING 2
+
+int util::ParstDataType(std::wstring* sFormat)
+{
+ size_t i = 0;
+ bool bPercent = FALSE;
+ for (i=0; i<sFormat->length(); ++i)
+ {
+ wchar_t c = (*sFormat)[i];
+ if (c == L'%')
+ {
+ bPercent = true;
+ continue;
+ }
+
+ if (bPercent)
+ {
+ if (c == L'c' || c == L'C' || c == L'd' || c == L'i' || c == L'o' || c == L'u' || c == L'x' || c == L'X')
+ {
+ return UTIL_INT;
+ }
+ else if (c == L'e' || c == L'E' || c == L'f' || c == L'g' || c == L'G')
+ {
+ return UTIL_DOUBLE;
+ }
+ else if (c == L's' || c == L'S')
+ {
+ // Map s to S since we always deal internally
+ // with wchar_t strings.
+ (*sFormat)[i] = L'S';
+ return UTIL_STRING;
+ }
+ else if (c == L'.' || c == L'+' || c == L'-' || c == L'#' || c == L' ' || CJS_PublicMethods::IsDigit(c))
+ {
+ continue;
+ }
+ else break;
+ }
+ }
+
+ return -1;
+}
+
+FX_BOOL util::printf(OBJ_METHOD_PARAMS)
+{
+ int iSize = params.size();
+ if (iSize < 1)
+ return FALSE;
+ std::wstring c_ConvChar((const wchar_t*)(FX_LPCWSTR)params[0].operator CFX_WideString());
+ std::vector<std::wstring> c_strConvers;
+ int iOffset = 0;
+ int iOffend = 0;
+ c_ConvChar.insert(c_ConvChar.begin(),L'S');
+ while(iOffset != -1)
+ {
+ iOffend = c_ConvChar.find(L"%",iOffset+1);
+ std::wstring strSub;
+ if (iOffend == -1)
+ strSub = c_ConvChar.substr(iOffset);
+ else
+ strSub = c_ConvChar.substr(iOffset ,iOffend - iOffset);
+ c_strConvers.push_back(strSub);
+ iOffset = iOffend ;
+ }
+
+ std::wstring c_strResult;
+
+ //for(int iIndex = 1;iIndex < params.size();iIndex++)
+ std::wstring c_strFormat;
+ for(int iIndex = 0;iIndex < (int)c_strConvers.size();iIndex++)
+ {
+ c_strFormat = c_strConvers[iIndex];
+ if (iIndex == 0)
+ {
+ c_strResult = c_strFormat;
+ continue;
+ }
+
+
+ CFX_WideString strSegment;
+ if (iIndex >= iSize) {
+ c_strResult += c_strFormat;
+ continue;
+ }
+
+ switch (ParstDataType(&c_strFormat))
+ {
+ case UTIL_INT:
+ strSegment.Format((FX_LPCWSTR)c_strFormat.c_str(),(int)params[iIndex]);
+ break;
+ case UTIL_DOUBLE:
+ strSegment.Format((FX_LPCWSTR)c_strFormat.c_str(),(double)params[iIndex]);
+ break;
+ case UTIL_STRING:
+ strSegment.Format((FX_LPCWSTR)c_strFormat.c_str(),(FX_LPCWSTR)params[iIndex].operator CFX_WideString());
+ break;
+ default:
+ strSegment.Format((FX_LPCWSTR)L"%S", (FX_LPCWSTR)c_strFormat.c_str());
+ break;
+ }
+ c_strResult += (wchar_t*)strSegment.GetBuffer(strSegment.GetLength()+1);
+ }
+
+ c_strResult.erase(c_strResult.begin());
+ vRet = (FX_LPCWSTR)c_strResult.c_str();
+ return TRUE;
+}
+
+FX_BOOL util::printd(OBJ_METHOD_PARAMS)
+{
+ v8::Isolate* isolate = GetIsolate(cc);
+
+ int iSize = params.size();
+ if (iSize < 2)
+ return FALSE;
+
+ CJS_Value p1(isolate);
+ p1 = params[0];
+
+ CJS_Value p2 = params[1];
+ CJS_Date jsDate(isolate);
+ if (!p2.ConvertToDate(jsDate))
+ {
+ sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPRINT1);
+ return FALSE;
+ }
+
+ if (!jsDate.IsValidDate())
+ {
+ sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPRINT2);
+ return FALSE;
+ }
+
+ if (p1.GetType() == VT_number)
+ {
+ int nFormat = p1;
+
+ CFX_WideString swResult;
+
+ switch (nFormat)
+ {
+ case 0:
+ swResult.Format((FX_LPCWSTR)L"D:%04d%02d%02d%02d%02d%02d",
+ jsDate.GetYear(),
+ jsDate.GetMonth() + 1,
+ jsDate.GetDay(),
+ jsDate.GetHours(),
+ jsDate.GetMinutes(),
+ jsDate.GetSeconds());
+ break;
+ case 1:
+ swResult.Format((FX_LPCWSTR)L"%04d.%02d.%02d %02d:%02d:%02d",
+ jsDate.GetYear(),
+ jsDate.GetMonth() + 1,
+ jsDate.GetDay(),
+ jsDate.GetHours(),
+ jsDate.GetMinutes(),
+ jsDate.GetSeconds());
+ break;
+ case 2:
+ swResult.Format((FX_LPCWSTR)L"%04d/%02d/%02d %02d:%02d:%02d",
+ jsDate.GetYear(),
+ jsDate.GetMonth() + 1,
+ jsDate.GetDay(),
+ jsDate.GetHours(),
+ jsDate.GetMinutes(),
+ jsDate.GetSeconds());
+ break;
+ default:
+ return FALSE;
+ }
+
+ vRet = swResult;
+ return TRUE;
+ }
+ else if (p1.GetType() == VT_string)
+ {
+ std::basic_string<wchar_t> cFormat = (wchar_t*)(FX_LPCWSTR)p1.operator CFX_WideString();
+
+ bool bXFAPicture = false;
+ if (iSize > 2)
+ {
+ //CJS_Value value;
+ bXFAPicture = params[2];
+ }
+
+ if (bXFAPicture)
+ {
+ return FALSE; //currently, it doesn't support XFAPicture.
+ }
+
+ int iIndex;
+ for(iIndex = 0;iIndex<sizeof(fcTable)/sizeof(stru_TbConvert);iIndex++)
+ {
+ int iStart = 0;
+ int iEnd;
+ while((iEnd = cFormat.find((CFX_WideString)fcTable[iIndex].lpszJSMark, iStart)) != -1)
+ {
+ cFormat.replace(iEnd, FXSYS_wcslen(fcTable[iIndex].lpszJSMark), (CFX_WideString)fcTable[iIndex].lpszCppMark);
+ iStart = iEnd;
+ }
+ }
+
+ int iYear,iMonth,iDay,iHour,iMin,iSec;
+ iYear = jsDate.GetYear();
+ iMonth = jsDate.GetMonth();
+ iDay = jsDate.GetDay();
+ iHour = jsDate.GetHours();
+ iMin = jsDate.GetMinutes();
+ iSec = jsDate.GetSeconds();
+
+ struct tm time = {0};
+ time.tm_year = iYear-1900;
+ time.tm_mon = iMonth;
+ time.tm_mday = iDay;
+ time.tm_hour = iHour;
+ time.tm_min = iMin;
+ time.tm_sec = iSec;
+ //COleDateTime cppTm(iYear,iMonth+1,iDay,iHour,iMin,iSec);
+ //CString strFormat = cppTm.Format(cFormat.c_str());
+
+ struct stru_TbConvertAd
+ {
+ FX_LPCWSTR lpszJSMark;
+ int iValue;
+ };
+
+ stru_TbConvertAd cTableAd[] ={
+ (FX_LPCWSTR)L"m", iMonth+1,
+ (FX_LPCWSTR)L"d", iDay,
+ (FX_LPCWSTR)L"H", iHour,
+ (FX_LPCWSTR)L"h", iHour>12?iHour-12:iHour,
+ (FX_LPCWSTR)L"M", iMin,
+ (FX_LPCWSTR)L"s", iSec
+ };
+
+ //cFormat = strFormat.GetBuffer(strFormat.GetLength()+1);
+ for(iIndex = 0;iIndex<sizeof(cTableAd)/sizeof(stru_TbConvertAd);iIndex++)
+ {
+ wchar_t tszValue[10];
+ //_itot(cTableAd[iIndex].iValue,tszValue,10);
+ CFX_WideString sValue;
+ sValue.Format((FX_LPCWSTR)L"%d",cTableAd[iIndex].iValue);
+ memcpy(tszValue, (wchar_t *)sValue.GetBuffer(sValue.GetLength()+1),
+ (sValue.GetLength()+1)*sizeof(wchar_t));
+
+ //strFormat.Replace(cTableAd[iIndex].lpszJSMark,"%d");
+ //strFormat.Format(strFormat,cTableAd[iIndex].iValue);
+ int iStart = 0;
+ int iEnd;
+ while((iEnd = cFormat.find((CFX_WideString)cTableAd[iIndex].lpszJSMark,iStart)) != -1)
+ {
+ if (iEnd > 0)
+ {
+ if (cFormat[iEnd-1] == L'%')
+ {
+ iStart = iEnd+1;
+ continue;
+ }
+ }
+ cFormat.replace(iEnd, FXSYS_wcslen(cTableAd[iIndex].lpszJSMark), tszValue);
+ iStart = iEnd;
+ }
+ }
+
+ CFX_WideString strFormat;
+// strFormat.Format((FX_LPCWSTR)L"%d,%d,%d,%d,%d,%d",iYear, iMonth, iDay, iHour, iMin, iSec);
+// CString strFormat = cppTm.Format(cFormat.c_str());
+ wchar_t buf[64] = {0};
+ strFormat = wcsftime(buf, 64, cFormat.c_str(), &time);
+ cFormat = buf;
+ vRet = (FX_LPCWSTR)cFormat.c_str();
+ //rtRet = strFormat.GetBuffer(strFormat.GetLength()+1);
+ return TRUE;
+ }
+ return FALSE;
+}
+
+void util::printd(const std::wstring &cFormat2, CJS_Date jsDate, bool bXFAPicture, std::wstring &cPurpose)
+{
+ std::wstring cFormat = cFormat2;
+
+ if (bXFAPicture)
+ {
+ return ; //currently, it doesn't support XFAPicture.
+ }
+
+ int iIndex;
+ for(iIndex = 0;iIndex<sizeof(fcTable)/sizeof(stru_TbConvert);iIndex++)
+ {
+ int iStart = 0;
+ int iEnd;
+ while((iEnd = cFormat.find((CFX_WideString)fcTable[iIndex].lpszJSMark,iStart)) != -1)
+ {
+ cFormat.replace(iEnd,FXSYS_wcslen(fcTable[iIndex].lpszJSMark), (CFX_WideString)fcTable[iIndex].lpszCppMark);
+ iStart = iEnd;
+ }
+ }
+
+ int iYear,iMonth,iDay,iHour,iMin,iSec;
+ iYear = jsDate.GetYear();
+ iMonth = jsDate.GetMonth();
+ iDay = jsDate.GetDay();
+ iHour = jsDate.GetHours();
+ iMin = jsDate.GetMinutes();
+ iSec = jsDate.GetSeconds();
+
+ struct tm time = {0};
+ time.tm_year = iYear-1900;
+ time.tm_mon = iMonth;
+ time.tm_mday = iDay;
+ time.tm_hour = iHour;
+ time.tm_min = iMin;
+ time.tm_sec = iSec;
+// COleDateTime cppTm(iYear,iMonth+1,iDay,iHour,iMin,iSec);
+ //CString strFormat = cppTm.Format(cFormat.c_str());
+
+ struct stru_TbConvertAd
+ {
+ FX_LPCWSTR lpszJSMark;
+ int iValue;
+ };
+
+ stru_TbConvertAd cTableAd[] ={
+ (FX_LPCWSTR)L"m", iMonth+1,
+ (FX_LPCWSTR)L"d", iDay,
+ (FX_LPCWSTR)L"H", iHour,
+ (FX_LPCWSTR)L"h", iHour>12?iHour-12:iHour,
+ (FX_LPCWSTR)L"M", iMin,
+ (FX_LPCWSTR)L"s", iSec
+ };
+
+ //cFormat = strFormat.GetBuffer(strFormat.GetLength()+1);
+ for(iIndex = 0;iIndex<sizeof(cTableAd)/sizeof(stru_TbConvertAd);iIndex++)
+ {
+ wchar_t tszValue[10];
+ //_itot(cTableAd[iIndex].iValue,tszValue,10);
+ CFX_WideString sValue;
+ sValue.Format((FX_LPCWSTR)L"%d",cTableAd[iIndex].iValue);
+ memcpy(tszValue, (wchar_t *)sValue.GetBuffer(sValue.GetLength()+1),sValue.GetLength()*sizeof(wchar_t));
+
+
+ //strFormat.Replace(cTableAd[iIndex].lpszJSMark,"%d");
+ //strFormat.Format(strFormat,cTableAd[iIndex].iValue);
+ int iStart = 0;
+ int iEnd;
+ while((iEnd = cFormat.find((CFX_WideString)cTableAd[iIndex].lpszJSMark,iStart)) != -1)
+ {
+ if (iEnd > 0)
+ {
+ if (cFormat[iEnd-1] == L'%')
+ {
+ iStart = iEnd+1;
+ continue;
+ }
+ }
+ cFormat.replace(iEnd,FXSYS_wcslen(cTableAd[iIndex].lpszJSMark),tszValue);
+ iStart = iEnd;
+ }
+ }
+
+ CFX_WideString strFormat;
+// strFormat.Format((FX_LPCWSTR)L"%d,%d,%d,%d,%d,%d",iYear, iMonth, iDay, iHour, iMin, iSec);
+// CString strFormat = cppTm.Format(cFormat.c_str());
+ wchar_t buf[64] = {0};
+ strFormat = wcsftime(buf, 64, cFormat.c_str(), &time);
+ cFormat = buf;
+ cPurpose = cFormat;
+}
+
+FX_BOOL util::printx(OBJ_METHOD_PARAMS)
+{
+ int iSize = params.size();
+ if (iSize<2)
+ return FALSE;
+ CFX_WideString sFormat = params[0].operator CFX_WideString();
+ CFX_WideString sSource = params[1].operator CFX_WideString();
+ std::string cFormat = (FX_LPCSTR)CFX_ByteString::FromUnicode(sFormat);
+ std::string cSource = (FX_LPCSTR)CFX_ByteString::FromUnicode(sSource);
+ std::string cDest;
+ printx(cFormat,cSource,cDest);
+ vRet = cDest.c_str();
+ return TRUE;
+}
+
+void util::printx(const std::string &cFormat,const std::string &cSource2,std::string &cPurpose)
+{
+ std::string cSource(cSource2);
+ if (!cPurpose.empty())
+ //cPurpose.clear();
+ cPurpose.erase();
+ int itSource = 0;
+ int iSize = cSource.size();
+ for(int iIndex = 0; iIndex < (int)cFormat.size() && itSource<iSize; iIndex++)
+ {
+ char letter = cFormat[iIndex];
+ switch(letter)
+ {
+ case '?':
+ //cPurpose.push_back(cSource[itSource]);
+ cPurpose += cSource[itSource];
+ itSource++;
+ break;
+ case 'X':
+ {
+ while(itSource < iSize)
+ {
+ if ((cSource[itSource]>='0'&&cSource[itSource]<='9') || (cSource[itSource]>='a' && cSource[itSource]<='z') || (cSource[itSource]>='A' && cSource[itSource]<='Z'))
+ {
+ //cPurpose.push_back(cSource[itSource]);
+ cPurpose += cSource[itSource];
+ itSource++;
+ break;
+ }
+ itSource++;
+ }
+ break;
+ }
+ break;
+ case 'A':
+ {
+ while(itSource < iSize)
+ {
+ if ((cSource[itSource]>='a' && cSource[itSource]<='z') || (cSource[itSource]>='A' && cSource[itSource]<='Z'))
+ {
+ //cPurpose.push_back(cSource[itSource]);
+ cPurpose += cSource[itSource];
+ itSource++;
+ break;
+ }
+ itSource++;
+ }
+ break;
+ }
+ break;
+ case '9':
+ {
+ while(itSource < iSize)
+ {
+ if (cSource[itSource]>='0'&&cSource[itSource]<='9')
+ {
+ //cPurpose.push_back(cSource[itSource]);
+ cPurpose += cSource[itSource];
+ itSource++;
+ break;
+ }
+ itSource++;
+ }
+ break;
+ }
+ case '*':
+ {
+ cPurpose.append(cSource,itSource,iSize-itSource);
+ itSource = iSize-1;
+ break;
+ }
+ case '\\':
+ break;
+ case '>':
+ {
+ for(std::string::iterator it = cSource.begin();it != cSource.end(); it++)
+ {
+ *it = toupper(*it);
+ }
+ break;
+ }
+ case '<':
+ {
+ for(std::string::iterator it = cSource.begin();it != cSource.end(); it++)
+ {
+ *it = tolower(*it);
+ }
+ break;
+ }
+ case '=':
+ break;
+ default:
+ //cPurpose.push_back(letter);
+ cPurpose += letter;
+ break;
+ }
+ }
+}
+
+FX_BOOL util::scand(OBJ_METHOD_PARAMS)
+{
+ v8::Isolate* isolate = GetIsolate(cc);
+ int iSize = params.size();
+ if (iSize < 2)
+ return FALSE;
+ CFX_WideString sFormat = params[0].operator CFX_WideString();
+ CFX_WideString sDate = params[1].operator CFX_WideString();
+
+ double dDate = JS_GetDateTime();
+ if (sDate.GetLength() > 0)
+ {
+ FX_BOOL bWrongFormat = FALSE;
+ dDate = CJS_PublicMethods::MakeRegularDate(sDate,sFormat,bWrongFormat);
+ }
+
+ if (!JS_PortIsNan(dDate))
+ {
+ CJS_Date date(isolate,dDate);
+ vRet = date;
+ }
+ else
+ {
+ vRet.SetNull();
+ }
+
+ return TRUE;
+}
+
+FX_INT64 FX_atoi64(const char *nptr)
+{
+ int c; /* current char */
+ FX_INT64 total; /* current total */
+ int sign; /* if '-', then negative, otherwise positive */
+
+ /* skip whitespace */
+ while ( isspace((int)(unsigned char)*nptr) )
+ ++nptr;
+
+ c = (int)(unsigned char)*nptr++;
+ sign = c; /* save sign indication */
+ if (c == '-' || c == '+')
+ c = (int)(unsigned char)*nptr++; /* skip sign */
+
+ total = 0;
+
+ while (isdigit(c)) {
+ total = 10 * total + (c - '0'); /* accumulate digit */
+ c = (int)(unsigned char)*nptr++; /* get next char */
+ }
+
+ if (sign == '-')
+ return -total;
+ else
+ return total; /* return result, negated if necessary */
+}
+
+FX_BOOL util::byteToChar(OBJ_METHOD_PARAMS)
+{
+ int iSize = params.size();
+ if (iSize == 0)
+ return FALSE;
+ int nByte = (int)params[0];
+ unsigned char cByte = (unsigned char)nByte;
+ CFX_WideString csValue;
+ csValue.Format((FX_LPCWSTR)L"%c", cByte);
+ vRet = csValue;
+ return TRUE;
+}
diff --git a/fpdfsdk/src/pdfwindow/PWL_Button.cpp b/fpdfsdk/src/pdfwindow/PWL_Button.cpp
index c71e5cc8b4..f95469aa93 100644
--- a/fpdfsdk/src/pdfwindow/PWL_Button.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_Button.cpp
@@ -1,53 +1,53 @@
-// 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
-
-#include "../../include/pdfwindow/PDFWindow.h"
-#include "../../include/pdfwindow/PWL_Wnd.h"
-#include "../../include/pdfwindow/PWL_Button.h"
-#include "../../include/pdfwindow/PWL_Utils.h"
-
-/* ------------------------------- CPWL_Button ---------------------------------- */
-
-CPWL_Button::CPWL_Button() :
- m_bMouseDown(FALSE)
-{
-}
-
-CPWL_Button::~CPWL_Button()
-{
-// PWL_TRACE("~CPWL_Button\n");
-}
-
-CFX_ByteString CPWL_Button::GetClassName() const
-{
- return "CPWL_Button";
-}
-
-void CPWL_Button::OnCreate(PWL_CREATEPARAM & cp)
-{
- cp.eCursorType = FXCT_HAND;
-}
-
-FX_BOOL CPWL_Button::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
-{
- CPWL_Wnd::OnLButtonDown(point, nFlag);
-
- m_bMouseDown = TRUE;
- SetCapture();
-
- return TRUE;
-}
-
-FX_BOOL CPWL_Button::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
-{
- CPWL_Wnd::OnLButtonUp(point, nFlag);
-
- ReleaseCapture();
- m_bMouseDown = FALSE;
-
- return TRUE;
-}
-
+// 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
+
+#include "../../include/pdfwindow/PDFWindow.h"
+#include "../../include/pdfwindow/PWL_Wnd.h"
+#include "../../include/pdfwindow/PWL_Button.h"
+#include "../../include/pdfwindow/PWL_Utils.h"
+
+/* ------------------------------- CPWL_Button ---------------------------------- */
+
+CPWL_Button::CPWL_Button() :
+ m_bMouseDown(FALSE)
+{
+}
+
+CPWL_Button::~CPWL_Button()
+{
+// PWL_TRACE("~CPWL_Button\n");
+}
+
+CFX_ByteString CPWL_Button::GetClassName() const
+{
+ return "CPWL_Button";
+}
+
+void CPWL_Button::OnCreate(PWL_CREATEPARAM & cp)
+{
+ cp.eCursorType = FXCT_HAND;
+}
+
+FX_BOOL CPWL_Button::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
+{
+ CPWL_Wnd::OnLButtonDown(point, nFlag);
+
+ m_bMouseDown = TRUE;
+ SetCapture();
+
+ return TRUE;
+}
+
+FX_BOOL CPWL_Button::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
+{
+ CPWL_Wnd::OnLButtonUp(point, nFlag);
+
+ ReleaseCapture();
+ m_bMouseDown = FALSE;
+
+ return TRUE;
+}
+
diff --git a/fpdfsdk/src/pdfwindow/PWL_Caret.cpp b/fpdfsdk/src/pdfwindow/PWL_Caret.cpp
index e54538ea73..cdc7d57a9b 100644
--- a/fpdfsdk/src/pdfwindow/PWL_Caret.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_Caret.cpp
@@ -1,197 +1,197 @@
-// 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
-
-#include "../../include/pdfwindow/PDFWindow.h"
-#include "../../include/pdfwindow/PWL_Wnd.h"
-#include "../../include/pdfwindow/PWL_Caret.h"
-#include "../../include/pdfwindow/PWL_Utils.h"
-
-#define PWL_CARET_FLASHINTERVAL 500
-
-//////////////////////////////////////////////////////////////////////
-// Construction/Destruction
-//////////////////////////////////////////////////////////////////////
-
-CPWL_Caret::CPWL_Caret() :
- m_bFlash(FALSE),
- m_ptHead(0,0),
- m_ptFoot(0,0),
- m_fWidth(0.4f),
- m_nDelay(0)
-{
-}
-
-CPWL_Caret::~CPWL_Caret()
-{
-}
-
-CFX_ByteString CPWL_Caret::GetClassName() const
-{
- return "CPWL_Caret";
-}
-
-void CPWL_Caret::GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream)
-{
- GetCaretApp(sAppStream,CPDF_Point(0.0f,0.0f));
-}
-
-void CPWL_Caret::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device)
-{
- if (IsVisible() && m_bFlash)
- {
- CPDF_Rect rcRect = GetCaretRect();
- CPDF_Rect rcClip = GetClipRect();
-
- CFX_PathData path;
-
- path.SetPointCount(2);
-
- FX_FLOAT fCaretX = rcRect.left + m_fWidth * 0.5f;
- FX_FLOAT fCaretTop = rcRect.top;
- FX_FLOAT fCaretBottom = rcRect.bottom;
-
- if (!rcClip.IsEmpty())
- {
- rcRect.Intersect(rcClip);
- if (!rcRect.IsEmpty())
- {
- fCaretTop = rcRect.top;
- fCaretBottom = rcRect.bottom;
- path.SetPoint(0, fCaretX, fCaretBottom, FXPT_MOVETO);
- path.SetPoint(1, fCaretX, fCaretTop, FXPT_LINETO);
- }
- else
- {
- return;
- }
- }
- else
- {
- path.SetPoint(0, fCaretX, fCaretBottom, FXPT_MOVETO);
- path.SetPoint(1, fCaretX, fCaretTop, FXPT_LINETO);
- }
-
- CFX_GraphStateData gsd;
- gsd.m_LineWidth = m_fWidth;
-
- pDevice->DrawPath(&path, pUser2Device, &gsd,0, ArgbEncode(255,0,0,0), FXFILL_ALTERNATE);
- }
-}
-
-void CPWL_Caret::GetCaretApp(CFX_ByteTextBuf & sAppStream,const CPDF_Point & ptOffset)
-{
- if (IsVisible() && m_bFlash)
- {
- CFX_ByteTextBuf sCaret;
-
- CPDF_Rect rcRect = GetCaretRect();
- CPDF_Rect rcClip = GetClipRect();
-
- rcRect = CPWL_Utils::OffsetRect(rcRect,ptOffset.x,ptOffset.y);
- rcClip = CPWL_Utils::OffsetRect(rcClip,ptOffset.x,ptOffset.y);
-
- sCaret << "q\n";
- if (!rcClip.IsEmpty())
- {
- sCaret << rcClip.left << " " << rcClip.bottom + 2.5f << " "
- << rcClip.right - rcClip.left << " " << rcClip.top - rcClip.bottom - 4.5f << " re W n\n";
- }
- sCaret << m_fWidth << " w\n0 G\n";
- sCaret << rcRect.left + m_fWidth/2 << " " << rcRect.bottom << " m\n";
- sCaret << rcRect.left + m_fWidth/2 << " " << rcRect.top << " l S\nQ\n";
-
- sAppStream << sCaret;
- }
-}
-
-CFX_ByteString CPWL_Caret::GetCaretAppearanceStream(const CPDF_Point & ptOffset)
-{
- CFX_ByteTextBuf sCaret;
- GetCaretApp(sCaret,ptOffset);
- return sCaret.GetByteString();
-}
-
-void CPWL_Caret::TimerProc()
-{
- if (m_nDelay > 0)
- {
- m_nDelay--;
- }
- else
- {
- m_bFlash = !m_bFlash;
- InvalidateRect();
- }
-}
-
-CPDF_Rect CPWL_Caret::GetCaretRect() const
-{
- return CPDF_Rect(m_ptFoot.x,
- m_ptFoot.y,
- m_ptHead.x + this->m_fWidth,
- m_ptHead.y);
-}
-
-void CPWL_Caret::SetCaret(FX_BOOL bVisible, const CPDF_Point & ptHead, const CPDF_Point & ptFoot)
-{
- if (bVisible)
- {
- if (IsVisible())
- {
- if (m_ptHead.x != ptHead.x || m_ptHead.y != ptHead.y ||
- m_ptFoot.x != ptFoot.x || m_ptFoot.y != ptFoot.y)
- {
- this->m_ptHead = ptHead;
- this->m_ptFoot = ptFoot;
-
- m_bFlash = TRUE;
- //Move(GetCaretRect(),FALSE,TRUE);
- Move(m_rcInvalid, FALSE, TRUE);
- }
- }
- else
- {
- this->m_ptHead = ptHead;
- this->m_ptFoot = ptFoot;
-
- EndTimer();
- BeginTimer(PWL_CARET_FLASHINTERVAL);
-
- CPWL_Wnd::SetVisible(TRUE);
- m_bFlash = TRUE;
-
- //Move(GetCaretRect(),FALSE,TRUE);
- Move(m_rcInvalid, FALSE, TRUE);
- }
- }
- else
- {
- this->m_ptHead = CPDF_Point(0,0);
- this->m_ptFoot = CPDF_Point(0,0);
-
- m_bFlash = FALSE;
- if (IsVisible())
- {
- EndTimer();
- CPWL_Wnd::SetVisible(FALSE);
- }
- }
-}
-
-void CPWL_Caret::InvalidateRect(CPDF_Rect * pRect)
-{
- if (pRect)
- {
- CPDF_Rect rcRefresh = CPWL_Utils::InflateRect(*pRect,0.5f);
- rcRefresh.top += 1;
- rcRefresh.bottom -= 1;
-
- CPWL_Wnd::InvalidateRect(&rcRefresh);
- }
- else
- CPWL_Wnd::InvalidateRect(pRect);
-}
-
+// 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
+
+#include "../../include/pdfwindow/PDFWindow.h"
+#include "../../include/pdfwindow/PWL_Wnd.h"
+#include "../../include/pdfwindow/PWL_Caret.h"
+#include "../../include/pdfwindow/PWL_Utils.h"
+
+#define PWL_CARET_FLASHINTERVAL 500
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+
+CPWL_Caret::CPWL_Caret() :
+ m_bFlash(FALSE),
+ m_ptHead(0,0),
+ m_ptFoot(0,0),
+ m_fWidth(0.4f),
+ m_nDelay(0)
+{
+}
+
+CPWL_Caret::~CPWL_Caret()
+{
+}
+
+CFX_ByteString CPWL_Caret::GetClassName() const
+{
+ return "CPWL_Caret";
+}
+
+void CPWL_Caret::GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream)
+{
+ GetCaretApp(sAppStream,CPDF_Point(0.0f,0.0f));
+}
+
+void CPWL_Caret::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device)
+{
+ if (IsVisible() && m_bFlash)
+ {
+ CPDF_Rect rcRect = GetCaretRect();
+ CPDF_Rect rcClip = GetClipRect();
+
+ CFX_PathData path;
+
+ path.SetPointCount(2);
+
+ FX_FLOAT fCaretX = rcRect.left + m_fWidth * 0.5f;
+ FX_FLOAT fCaretTop = rcRect.top;
+ FX_FLOAT fCaretBottom = rcRect.bottom;
+
+ if (!rcClip.IsEmpty())
+ {
+ rcRect.Intersect(rcClip);
+ if (!rcRect.IsEmpty())
+ {
+ fCaretTop = rcRect.top;
+ fCaretBottom = rcRect.bottom;
+ path.SetPoint(0, fCaretX, fCaretBottom, FXPT_MOVETO);
+ path.SetPoint(1, fCaretX, fCaretTop, FXPT_LINETO);
+ }
+ else
+ {
+ return;
+ }
+ }
+ else
+ {
+ path.SetPoint(0, fCaretX, fCaretBottom, FXPT_MOVETO);
+ path.SetPoint(1, fCaretX, fCaretTop, FXPT_LINETO);
+ }
+
+ CFX_GraphStateData gsd;
+ gsd.m_LineWidth = m_fWidth;
+
+ pDevice->DrawPath(&path, pUser2Device, &gsd,0, ArgbEncode(255,0,0,0), FXFILL_ALTERNATE);
+ }
+}
+
+void CPWL_Caret::GetCaretApp(CFX_ByteTextBuf & sAppStream,const CPDF_Point & ptOffset)
+{
+ if (IsVisible() && m_bFlash)
+ {
+ CFX_ByteTextBuf sCaret;
+
+ CPDF_Rect rcRect = GetCaretRect();
+ CPDF_Rect rcClip = GetClipRect();
+
+ rcRect = CPWL_Utils::OffsetRect(rcRect,ptOffset.x,ptOffset.y);
+ rcClip = CPWL_Utils::OffsetRect(rcClip,ptOffset.x,ptOffset.y);
+
+ sCaret << "q\n";
+ if (!rcClip.IsEmpty())
+ {
+ sCaret << rcClip.left << " " << rcClip.bottom + 2.5f << " "
+ << rcClip.right - rcClip.left << " " << rcClip.top - rcClip.bottom - 4.5f << " re W n\n";
+ }
+ sCaret << m_fWidth << " w\n0 G\n";
+ sCaret << rcRect.left + m_fWidth/2 << " " << rcRect.bottom << " m\n";
+ sCaret << rcRect.left + m_fWidth/2 << " " << rcRect.top << " l S\nQ\n";
+
+ sAppStream << sCaret;
+ }
+}
+
+CFX_ByteString CPWL_Caret::GetCaretAppearanceStream(const CPDF_Point & ptOffset)
+{
+ CFX_ByteTextBuf sCaret;
+ GetCaretApp(sCaret,ptOffset);
+ return sCaret.GetByteString();
+}
+
+void CPWL_Caret::TimerProc()
+{
+ if (m_nDelay > 0)
+ {
+ m_nDelay--;
+ }
+ else
+ {
+ m_bFlash = !m_bFlash;
+ InvalidateRect();
+ }
+}
+
+CPDF_Rect CPWL_Caret::GetCaretRect() const
+{
+ return CPDF_Rect(m_ptFoot.x,
+ m_ptFoot.y,
+ m_ptHead.x + this->m_fWidth,
+ m_ptHead.y);
+}
+
+void CPWL_Caret::SetCaret(FX_BOOL bVisible, const CPDF_Point & ptHead, const CPDF_Point & ptFoot)
+{
+ if (bVisible)
+ {
+ if (IsVisible())
+ {
+ if (m_ptHead.x != ptHead.x || m_ptHead.y != ptHead.y ||
+ m_ptFoot.x != ptFoot.x || m_ptFoot.y != ptFoot.y)
+ {
+ this->m_ptHead = ptHead;
+ this->m_ptFoot = ptFoot;
+
+ m_bFlash = TRUE;
+ //Move(GetCaretRect(),FALSE,TRUE);
+ Move(m_rcInvalid, FALSE, TRUE);
+ }
+ }
+ else
+ {
+ this->m_ptHead = ptHead;
+ this->m_ptFoot = ptFoot;
+
+ EndTimer();
+ BeginTimer(PWL_CARET_FLASHINTERVAL);
+
+ CPWL_Wnd::SetVisible(TRUE);
+ m_bFlash = TRUE;
+
+ //Move(GetCaretRect(),FALSE,TRUE);
+ Move(m_rcInvalid, FALSE, TRUE);
+ }
+ }
+ else
+ {
+ this->m_ptHead = CPDF_Point(0,0);
+ this->m_ptFoot = CPDF_Point(0,0);
+
+ m_bFlash = FALSE;
+ if (IsVisible())
+ {
+ EndTimer();
+ CPWL_Wnd::SetVisible(FALSE);
+ }
+ }
+}
+
+void CPWL_Caret::InvalidateRect(CPDF_Rect * pRect)
+{
+ if (pRect)
+ {
+ CPDF_Rect rcRefresh = CPWL_Utils::InflateRect(*pRect,0.5f);
+ rcRefresh.top += 1;
+ rcRefresh.bottom -= 1;
+
+ CPWL_Wnd::InvalidateRect(&rcRefresh);
+ }
+ else
+ CPWL_Wnd::InvalidateRect(pRect);
+}
+
diff --git a/fpdfsdk/src/pdfwindow/PWL_ComboBox.cpp b/fpdfsdk/src/pdfwindow/PWL_ComboBox.cpp
index 7650a23e5b..020765aba5 100644
--- a/fpdfsdk/src/pdfwindow/PWL_ComboBox.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_ComboBox.cpp
@@ -1,662 +1,662 @@
-// 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
-
-#include "../../include/pdfwindow/PDFWindow.h"
-#include "../../include/pdfwindow/PWL_Wnd.h"
-#include "../../include/pdfwindow/PWL_EditCtrl.h"
-#include "../../include/pdfwindow/PWL_Edit.h"
-#include "../../include/pdfwindow/PWL_ListBox.h"
-#include "../../include/pdfwindow/PWL_ComboBox.h"
-#include "../../include/pdfwindow/PWL_Utils.h"
-
-#define PWLCB_DEFAULTFONTSIZE 12.0f
-
-#define IsFloatZero(f) ((f) < 0.0001 && (f) > -0.0001)
-#define IsFloatBigger(fa,fb) ((fa) > (fb) && !IsFloatZero((fa) - (fb)))
-#define IsFloatSmaller(fa,fb) ((fa) < (fb) && !IsFloatZero((fa) - (fb)))
-#define IsFloatEqual(fa,fb) IsFloatZero((fa)-(fb))
-
-
-/* ---------------------------- CPWL_CBListBox ---------------------------- */
-
-FX_BOOL CPWL_CBListBox::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
-{
- CPWL_Wnd::OnLButtonUp(point,nFlag);
-
- if (m_bMouseDown)
- {
- ReleaseCapture();
- m_bMouseDown = FALSE;
-
- if (this->ClientHitTest(point))
- {
- if (CPWL_Wnd * pParent = GetParentWindow())
- {
- pParent->OnNotify(this,PNM_LBUTTONUP,0,PWL_MAKEDWORD(point.x,point.y));
- }
-
- FX_BOOL bExit = FALSE;
- OnNotifySelChanged(FALSE,bExit, nFlag);
- if (bExit) return FALSE;
- }
- }
-
- return TRUE;
-}
-
-FX_BOOL CPWL_CBListBox::OnKeyDown(FX_WORD nChar, FX_BOOL & bExit, FX_DWORD nFlag)
-{
- if (!m_pList) return FALSE;
-
- switch (nChar)
- {
- default:
- return FALSE;
- case FWL_VKEY_Up:
- case FWL_VKEY_Down:
- case FWL_VKEY_Home:
- case FWL_VKEY_Left:
- case FWL_VKEY_End:
- case FWL_VKEY_Right:
- break;
- }
-
- switch (nChar)
- {
- case FWL_VKEY_Up:
- m_pList->OnVK_UP(IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
- break;
- case FWL_VKEY_Down:
- m_pList->OnVK_DOWN(IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
- break;
- case FWL_VKEY_Home:
- m_pList->OnVK_HOME(IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
- break;
- case FWL_VKEY_Left:
- m_pList->OnVK_LEFT(IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
- break;
- case FWL_VKEY_End:
- m_pList->OnVK_END(IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
- break;
- case FWL_VKEY_Right:
- m_pList->OnVK_RIGHT(IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
- break;
- case FWL_VKEY_Delete:
- break;
- }
-
- OnNotifySelChanged(TRUE,bExit, nFlag);
-
- return TRUE;
-}
-
-FX_BOOL CPWL_CBListBox::OnChar(FX_WORD nChar, FX_BOOL & bExit, FX_DWORD nFlag)
-{
- if (!m_pList) return FALSE;
-
- if (!m_pList->OnChar(nChar,IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag))) return FALSE;
-
- if (CPWL_ComboBox* pComboBox = (CPWL_ComboBox*)GetParentWindow())
- {
- pComboBox->SetSelectText();
- }
-
- OnNotifySelChanged(TRUE,bExit,nFlag);
-
- return TRUE;
-}
-
-/* ---------------------------- CPWL_CBButton ---------------------------- */
-
-void CPWL_CBButton::GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream)
-{
- CPWL_Wnd::GetThisAppearanceStream(sAppStream);
-
- CPDF_Rect rectWnd = CPWL_Wnd::GetWindowRect();
-
- if (IsVisible() && !rectWnd.IsEmpty())
- {
- CFX_ByteTextBuf sButton;
-
- CPDF_Point ptCenter = this->GetCenterPoint();
-
- CPDF_Point pt1(ptCenter.x - PWL_CBBUTTON_TRIANGLE_HALFLEN,ptCenter.y + PWL_CBBUTTON_TRIANGLE_HALFLEN * 0.5f);
- CPDF_Point pt2(ptCenter.x + PWL_CBBUTTON_TRIANGLE_HALFLEN,ptCenter.y + PWL_CBBUTTON_TRIANGLE_HALFLEN * 0.5f);
- CPDF_Point pt3(ptCenter.x,ptCenter.y - PWL_CBBUTTON_TRIANGLE_HALFLEN * 0.5f);
-
- if (IsFloatBigger(rectWnd.right - rectWnd.left,PWL_CBBUTTON_TRIANGLE_HALFLEN * 2)
- &&
- IsFloatBigger(rectWnd.top - rectWnd.bottom,PWL_CBBUTTON_TRIANGLE_HALFLEN)
- )
- {
- sButton << "0 g\n";
- sButton << pt1.x << " " << pt1.y << " m\n";
- sButton << pt2.x << " " << pt2.y << " l\n";
- sButton << pt3.x << " " << pt3.y << " l\n";
- sButton << pt1.x << " " << pt1.y << " l f\n";
-
- sAppStream << "q\n" << sButton << "Q\n";
- }
- }
-}
-
-void CPWL_CBButton::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device)
-{
- CPWL_Wnd::DrawThisAppearance(pDevice,pUser2Device);
-
- CPDF_Rect rectWnd = CPWL_Wnd::GetWindowRect();
-
- if (IsVisible() && !rectWnd.IsEmpty())
- {
- CPDF_Point ptCenter = this->GetCenterPoint();
-
- CPDF_Point pt1(ptCenter.x - PWL_CBBUTTON_TRIANGLE_HALFLEN,ptCenter.y + PWL_CBBUTTON_TRIANGLE_HALFLEN * 0.5f);
- CPDF_Point pt2(ptCenter.x + PWL_CBBUTTON_TRIANGLE_HALFLEN,ptCenter.y + PWL_CBBUTTON_TRIANGLE_HALFLEN * 0.5f);
- CPDF_Point pt3(ptCenter.x,ptCenter.y - PWL_CBBUTTON_TRIANGLE_HALFLEN * 0.5f);
-
- if (IsFloatBigger(rectWnd.right - rectWnd.left,PWL_CBBUTTON_TRIANGLE_HALFLEN * 2)
- &&
- IsFloatBigger(rectWnd.top - rectWnd.bottom,PWL_CBBUTTON_TRIANGLE_HALFLEN)
- )
- {
- CFX_PathData path;
-
- path.SetPointCount(4);
- path.SetPoint(0, pt1.x, pt1.y, FXPT_MOVETO);
- path.SetPoint(1, pt2.x, pt2.y, FXPT_LINETO);
- path.SetPoint(2, pt3.x, pt3.y, FXPT_LINETO);
- path.SetPoint(3, pt1.x, pt1.y, FXPT_LINETO);
-
- pDevice->DrawPath(&path, pUser2Device, NULL,
- CPWL_Utils::PWLColorToFXColor(PWL_DEFAULT_BLACKCOLOR,GetTransparency()),
- 0, FXFILL_ALTERNATE);
- }
- }
-}
-
-FX_BOOL CPWL_CBButton::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
-{
- CPWL_Wnd::OnLButtonDown(point,nFlag);
-
- SetCapture();
-
- if (CPWL_Wnd * pParent = GetParentWindow())
- {
- pParent->OnNotify(this,PNM_LBUTTONDOWN,0,PWL_MAKEDWORD(point.x,point.y));
- }
-
- return TRUE;
-}
-
-FX_BOOL CPWL_CBButton::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
-{
- CPWL_Wnd::OnLButtonUp(point, nFlag);
-
- ReleaseCapture();
-
- return TRUE;
-}
-
-/* ---------------------------- CPWL_ComboBox ---------------------------- */
-
-CPWL_ComboBox::CPWL_ComboBox() : m_pEdit(NULL),
- m_pButton(NULL),
- m_pList(NULL),
- m_bPopup(FALSE),
- m_nPopupWhere(0),
- m_nSelectItem(-1),
- m_pFillerNotify(NULL)
-{
-}
-
-CFX_ByteString CPWL_ComboBox::GetClassName() const
-{
- return "CPWL_ComboBox";
-}
-
-void CPWL_ComboBox::OnCreate(PWL_CREATEPARAM & cp)
-{
- cp.dwFlags &= ~PWS_HSCROLL;
- cp.dwFlags &= ~PWS_VSCROLL;
-}
-
-void CPWL_ComboBox::SetFocus()
-{
- if (m_pEdit)
- m_pEdit->SetFocus();
-}
-
-void CPWL_ComboBox::KillFocus()
-{
- SetPopup(FALSE);
- CPWL_Wnd::KillFocus();
-}
-
-CFX_WideString CPWL_ComboBox::GetText() const
-{
- if (m_pEdit)
- {
- return m_pEdit->GetText();
- }
- return CFX_WideString();
-}
-
-void CPWL_ComboBox::SetText(FX_LPCWSTR text)
-{
- if (m_pEdit)
- m_pEdit->SetText(text);
-}
-
-void CPWL_ComboBox::AddString(FX_LPCWSTR string)
-{
- if (m_pList)
- m_pList->AddString(string);
-}
-
-FX_INT32 CPWL_ComboBox::GetSelect() const
-{
- return m_nSelectItem;
-}
-
-void CPWL_ComboBox::SetSelect(FX_INT32 nItemIndex)
-{
- if (m_pList)
- m_pList->Select(nItemIndex);
-
- m_pEdit->SetText(m_pList->GetText());
-
- m_nSelectItem = nItemIndex;
-}
-
-void CPWL_ComboBox::SetEditSel(FX_INT32 nStartChar,FX_INT32 nEndChar)
-{
- if (m_pEdit)
- {
- m_pEdit->SetSel(nStartChar,nEndChar);
- }
-}
-
-void CPWL_ComboBox::GetEditSel(FX_INT32 & nStartChar, FX_INT32 & nEndChar) const
-{
- nStartChar = -1;
- nEndChar = -1;
-
- if (m_pEdit)
- {
- m_pEdit->GetSel(nStartChar,nEndChar);
- }
-}
-
-void CPWL_ComboBox::Clear()
-{
- if (m_pEdit)
- {
- m_pEdit->Clear();
- }
-}
-
-void CPWL_ComboBox::CreateChildWnd(const PWL_CREATEPARAM & cp)
-{
- CreateEdit(cp);
- CreateButton(cp);
- CreateListBox(cp);
-}
-
-void CPWL_ComboBox::CreateEdit(const PWL_CREATEPARAM & cp)
-{
- if (!m_pEdit)
- {
- m_pEdit = new CPWL_CBEdit;
- m_pEdit->AttachFFLData(m_pFormFiller);
-
- PWL_CREATEPARAM ecp = cp;
- ecp.pParentWnd = this;
- ecp.dwFlags = PWS_VISIBLE | PWS_CHILD | PWS_BORDER | PES_CENTER | PES_AUTOSCROLL | PES_UNDO;
-
- if (HasFlag(PWS_AUTOFONTSIZE))
- ecp.dwFlags |= PWS_AUTOFONTSIZE;
-
- if (!HasFlag(PCBS_ALLOWCUSTOMTEXT))
- ecp.dwFlags |= PWS_READONLY;
-
- ecp.rcRectWnd = CPDF_Rect(0,0,0,0);
- ecp.dwBorderWidth = 0;
- ecp.nBorderStyle = PBS_SOLID;
-
- m_pEdit->Create(ecp);
- }
-}
-
-void CPWL_ComboBox::CreateButton(const PWL_CREATEPARAM & cp)
-{
- if (!m_pButton)
- {
- m_pButton = new CPWL_CBButton;
-
- PWL_CREATEPARAM bcp = cp;
- bcp.pParentWnd = this;
- bcp.dwFlags = PWS_VISIBLE | PWS_CHILD | PWS_BORDER | PWS_BACKGROUND;
- bcp.sBackgroundColor = PWL_SCROLLBAR_BKCOLOR;
- bcp.sBorderColor = PWL_DEFAULT_BLACKCOLOR;
- bcp.dwBorderWidth = 2;
- bcp.nBorderStyle = PBS_BEVELED;
- bcp.eCursorType = FXCT_ARROW;
-
- m_pButton->Create(bcp);
- }
-}
-
-void CPWL_ComboBox::CreateListBox(const PWL_CREATEPARAM & cp)
-{
- if (!m_pList)
- {
- m_pList = new CPWL_CBListBox;
- m_pList->AttachFFLData(m_pFormFiller);
- PWL_CREATEPARAM lcp = cp;
- lcp.pParentWnd = this;
- lcp.dwFlags = PWS_CHILD | PWS_BORDER | PWS_BACKGROUND | PLBS_HOVERSEL | PWS_VSCROLL;
- lcp.nBorderStyle = PBS_SOLID;
- lcp.dwBorderWidth = 1;
- lcp.eCursorType = FXCT_ARROW;
- lcp.rcRectWnd = CPDF_Rect(0,0,0,0);
-
- if (cp.dwFlags & PWS_AUTOFONTSIZE)
- lcp.fFontSize = PWLCB_DEFAULTFONTSIZE;
- else
- lcp.fFontSize = cp.fFontSize;
-
- if (cp.sBorderColor.nColorType == COLORTYPE_TRANSPARENT)
- lcp.sBorderColor = PWL_DEFAULT_BLACKCOLOR;
-
- if (cp.sBackgroundColor.nColorType == COLORTYPE_TRANSPARENT)
- lcp.sBackgroundColor = PWL_DEFAULT_WHITECOLOR;
-
- m_pList->Create(lcp);
- }
-}
-
-void CPWL_ComboBox::RePosChildWnd()
-{
- CPDF_Rect rcClient = GetClientRect();
-
- if (m_bPopup)
- {
- CPDF_Rect rclient = GetClientRect();
- CPDF_Rect rcButton = rclient;
- CPDF_Rect rcEdit = rcClient;
- CPDF_Rect rcList = CPWL_Wnd::GetWindowRect();
-
- FX_FLOAT fOldWindowHeight = m_rcOldWindow.Height();
- FX_FLOAT fOldClientHeight = fOldWindowHeight - GetBorderWidth() * 2;
-
- switch (m_nPopupWhere)
- {
- case 0:
- rcButton.left = rcButton.right - PWL_COMBOBOX_BUTTON_WIDTH;
-
- if (rcButton.left < rclient.left)
- rcButton.left = rclient.left;
-
- rcButton.bottom = rcButton.top - fOldClientHeight;
-
- rcEdit.right = rcButton.left - 1.0f;
-
- if (rcEdit.left < rclient.left)
- rcEdit.left = rclient.left;
-
- if (rcEdit.right < rcEdit.left)
- rcEdit.right = rcEdit.left;
-
- rcEdit.bottom = rcEdit.top - fOldClientHeight;
-
- rcList.top -= fOldWindowHeight;
-
- break;
- case 1:
- rcButton.left = rcButton.right - PWL_COMBOBOX_BUTTON_WIDTH;
-
- if (rcButton.left < rclient.left)
- rcButton.left = rclient.left;
-
- rcButton.top = rcButton.bottom + fOldClientHeight;
-
- rcEdit.right = rcButton.left - 1.0f;
-
- if (rcEdit.left < rclient.left)
- rcEdit.left = rclient.left;
-
- if (rcEdit.right < rcEdit.left)
- rcEdit.right = rcEdit.left;
-
- rcEdit.top = rcEdit.bottom + fOldClientHeight;
-
- rcList.bottom += fOldWindowHeight;
-
- break;
- }
-
- if (m_pButton)
- m_pButton->Move(rcButton,TRUE,FALSE);
-
- if (m_pEdit)
- m_pEdit->Move(rcEdit,TRUE,FALSE);
-
- if (m_pList)
- {
- m_pList->SetVisible(TRUE);
- m_pList->Move(rcList,TRUE,FALSE);
- m_pList->ScrollToListItem(m_nSelectItem);
- }
- }
- else
- {
- CPDF_Rect rcButton = rcClient;
-
- rcButton.left = rcButton.right - PWL_COMBOBOX_BUTTON_WIDTH;
-
- if (rcButton.left < rcClient.left)
- rcButton.left = rcClient.left;
-
- if (m_pButton)
- m_pButton->Move(rcButton,TRUE,FALSE);
-
- CPDF_Rect rcEdit = rcClient;
- rcEdit.right = rcButton.left - 1.0f;
-
- if (rcEdit.left < rcClient.left)
- rcEdit.left = rcClient.left;
-
- if (rcEdit.right < rcEdit.left)
- rcEdit.right = rcEdit.left;
-
- if (m_pEdit)
- m_pEdit->Move(rcEdit,TRUE,FALSE);
-
- if (m_pList)
- m_pList->SetVisible(FALSE);
- }
-}
-
-void CPWL_ComboBox::SelectAll()
-{
- if (m_pEdit && HasFlag(PCBS_ALLOWCUSTOMTEXT))
- m_pEdit->SelectAll();
-}
-
-CPDF_Rect CPWL_ComboBox::GetFocusRect() const
-{
- return CPDF_Rect();
-}
-
-void CPWL_ComboBox::SetPopup(FX_BOOL bPopup)
-{
- if (!m_pList) return;
- if (bPopup == m_bPopup) return;
- FX_FLOAT fListHeight = m_pList->GetContentRect().Height();
- if (!IsFloatBigger(fListHeight,0.0f)) return;
-
- if (bPopup)
- {
- if (m_pFillerNotify)
- {
- FX_INT32 nWhere = 0;
- FX_FLOAT fPopupRet = 0.0f;
- FX_FLOAT fPopupMin = 0.0f;
- if (m_pList->GetCount() > 3)
- fPopupMin = m_pList->GetFirstHeight() * 3 + m_pList->GetBorderWidth() * 2;
- FX_FLOAT fPopupMax = fListHeight + m_pList->GetBorderWidth() * 2;
- m_pFillerNotify->QueryWherePopup(GetAttachedData(), fPopupMin,fPopupMax,nWhere,fPopupRet);
-
- if (IsFloatBigger(fPopupRet,0.0f))
- {
- m_bPopup = bPopup;
-
- CPDF_Rect rcWindow = CPWL_Wnd::GetWindowRect();
- m_rcOldWindow = rcWindow;
- switch (nWhere)
- {
- default:
- case 0:
- rcWindow.bottom -= fPopupRet;
- break;
- case 1:
- rcWindow.top += fPopupRet;
- break;
- }
-
- m_nPopupWhere = nWhere;
- Move(rcWindow, TRUE, TRUE);
- }
- }
- }
- else
- {
- m_bPopup = bPopup;
- Move(m_rcOldWindow, TRUE, TRUE);
- }
-}
-
-FX_BOOL CPWL_ComboBox::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
-{
- if (!m_pList) return FALSE;
- if (!m_pEdit) return FALSE;
-
- m_nSelectItem = -1;
-
- switch (nChar)
- {
- case FWL_VKEY_Up:
- if (m_pList->GetCurSel() > 0)
- {
- FX_BOOL bExit = FALSE;
- if (m_pList->OnKeyDown(nChar,bExit,nFlag))
- {
- if (bExit) return FALSE;
- SetSelectText();
- }
- }
- return TRUE;
- case FWL_VKEY_Down:
- if (m_pList->GetCurSel() < m_pList->GetCount() - 1)
- {
- FX_BOOL bExit = FALSE;
- if (m_pList->OnKeyDown(nChar,bExit,nFlag))
- {
- if (bExit) return FALSE;
- SetSelectText();
- }
- }
- return TRUE;
- }
-
- if (HasFlag(PCBS_ALLOWCUSTOMTEXT))
- return m_pEdit->OnKeyDown(nChar,nFlag);
- else
- return FALSE;
-}
-
-FX_BOOL CPWL_ComboBox::OnChar(FX_WORD nChar, FX_DWORD nFlag)
-{
- if (!m_pList) return FALSE;
- if (!m_pEdit) return FALSE;
-
- m_nSelectItem = -1;
- FX_BOOL bExit = FALSE;
-
- if (HasFlag(PCBS_ALLOWCUSTOMTEXT))
- {
- return m_pEdit->OnChar(nChar,nFlag);
- }
- else
- {
- if (m_pList->OnChar(nChar,bExit,nFlag))
- {
- return bExit;
- }
- else
- return FALSE;
- }
-}
-
-void CPWL_ComboBox::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam, FX_INTPTR lParam)
-{
- switch (msg)
- {
- case PNM_LBUTTONDOWN:
- if (pWnd == m_pButton)
- {
- SetPopup(!m_bPopup);
- return;
- }
- break;
- case PNM_LBUTTONUP:
- if (m_pEdit && m_pList)
- {
- if (pWnd == m_pList)
- {
- SetSelectText();
- SelectAll();
- m_pEdit->SetFocus();
- SetPopup(FALSE);
- return;
- }
- }
- }
-
- CPWL_Wnd::OnNotify(pWnd,msg,wParam,lParam);
-}
-
-FX_BOOL CPWL_ComboBox::IsPopup() const
-{
- return m_bPopup;
-}
-
-void CPWL_ComboBox::SetSelectText()
-{
- CFX_WideString swText = m_pList->GetText();
- m_pEdit->SelectAll();
- m_pEdit->ReplaceSel(m_pList->GetText());
- m_pEdit->SelectAll();
-
- m_nSelectItem = m_pList->GetCurSel();
-}
-
-FX_BOOL CPWL_ComboBox::IsModified() const
-{
- return m_pEdit->IsModified();
-}
-
-void CPWL_ComboBox::SetFillerNotify(IPWL_Filler_Notify* pNotify)
-{
- m_pFillerNotify = pNotify;
-
- if (m_pEdit)
- m_pEdit->SetFillerNotify(pNotify);
-
- if (m_pList)
- m_pList->SetFillerNotify(pNotify);
-}
-
+// 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
+
+#include "../../include/pdfwindow/PDFWindow.h"
+#include "../../include/pdfwindow/PWL_Wnd.h"
+#include "../../include/pdfwindow/PWL_EditCtrl.h"
+#include "../../include/pdfwindow/PWL_Edit.h"
+#include "../../include/pdfwindow/PWL_ListBox.h"
+#include "../../include/pdfwindow/PWL_ComboBox.h"
+#include "../../include/pdfwindow/PWL_Utils.h"
+
+#define PWLCB_DEFAULTFONTSIZE 12.0f
+
+#define IsFloatZero(f) ((f) < 0.0001 && (f) > -0.0001)
+#define IsFloatBigger(fa,fb) ((fa) > (fb) && !IsFloatZero((fa) - (fb)))
+#define IsFloatSmaller(fa,fb) ((fa) < (fb) && !IsFloatZero((fa) - (fb)))
+#define IsFloatEqual(fa,fb) IsFloatZero((fa)-(fb))
+
+
+/* ---------------------------- CPWL_CBListBox ---------------------------- */
+
+FX_BOOL CPWL_CBListBox::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
+{
+ CPWL_Wnd::OnLButtonUp(point,nFlag);
+
+ if (m_bMouseDown)
+ {
+ ReleaseCapture();
+ m_bMouseDown = FALSE;
+
+ if (this->ClientHitTest(point))
+ {
+ if (CPWL_Wnd * pParent = GetParentWindow())
+ {
+ pParent->OnNotify(this,PNM_LBUTTONUP,0,PWL_MAKEDWORD(point.x,point.y));
+ }
+
+ FX_BOOL bExit = FALSE;
+ OnNotifySelChanged(FALSE,bExit, nFlag);
+ if (bExit) return FALSE;
+ }
+ }
+
+ return TRUE;
+}
+
+FX_BOOL CPWL_CBListBox::OnKeyDown(FX_WORD nChar, FX_BOOL & bExit, FX_DWORD nFlag)
+{
+ if (!m_pList) return FALSE;
+
+ switch (nChar)
+ {
+ default:
+ return FALSE;
+ case FWL_VKEY_Up:
+ case FWL_VKEY_Down:
+ case FWL_VKEY_Home:
+ case FWL_VKEY_Left:
+ case FWL_VKEY_End:
+ case FWL_VKEY_Right:
+ break;
+ }
+
+ switch (nChar)
+ {
+ case FWL_VKEY_Up:
+ m_pList->OnVK_UP(IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
+ break;
+ case FWL_VKEY_Down:
+ m_pList->OnVK_DOWN(IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
+ break;
+ case FWL_VKEY_Home:
+ m_pList->OnVK_HOME(IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
+ break;
+ case FWL_VKEY_Left:
+ m_pList->OnVK_LEFT(IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
+ break;
+ case FWL_VKEY_End:
+ m_pList->OnVK_END(IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
+ break;
+ case FWL_VKEY_Right:
+ m_pList->OnVK_RIGHT(IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
+ break;
+ case FWL_VKEY_Delete:
+ break;
+ }
+
+ OnNotifySelChanged(TRUE,bExit, nFlag);
+
+ return TRUE;
+}
+
+FX_BOOL CPWL_CBListBox::OnChar(FX_WORD nChar, FX_BOOL & bExit, FX_DWORD nFlag)
+{
+ if (!m_pList) return FALSE;
+
+ if (!m_pList->OnChar(nChar,IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag))) return FALSE;
+
+ if (CPWL_ComboBox* pComboBox = (CPWL_ComboBox*)GetParentWindow())
+ {
+ pComboBox->SetSelectText();
+ }
+
+ OnNotifySelChanged(TRUE,bExit,nFlag);
+
+ return TRUE;
+}
+
+/* ---------------------------- CPWL_CBButton ---------------------------- */
+
+void CPWL_CBButton::GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream)
+{
+ CPWL_Wnd::GetThisAppearanceStream(sAppStream);
+
+ CPDF_Rect rectWnd = CPWL_Wnd::GetWindowRect();
+
+ if (IsVisible() && !rectWnd.IsEmpty())
+ {
+ CFX_ByteTextBuf sButton;
+
+ CPDF_Point ptCenter = this->GetCenterPoint();
+
+ CPDF_Point pt1(ptCenter.x - PWL_CBBUTTON_TRIANGLE_HALFLEN,ptCenter.y + PWL_CBBUTTON_TRIANGLE_HALFLEN * 0.5f);
+ CPDF_Point pt2(ptCenter.x + PWL_CBBUTTON_TRIANGLE_HALFLEN,ptCenter.y + PWL_CBBUTTON_TRIANGLE_HALFLEN * 0.5f);
+ CPDF_Point pt3(ptCenter.x,ptCenter.y - PWL_CBBUTTON_TRIANGLE_HALFLEN * 0.5f);
+
+ if (IsFloatBigger(rectWnd.right - rectWnd.left,PWL_CBBUTTON_TRIANGLE_HALFLEN * 2)
+ &&
+ IsFloatBigger(rectWnd.top - rectWnd.bottom,PWL_CBBUTTON_TRIANGLE_HALFLEN)
+ )
+ {
+ sButton << "0 g\n";
+ sButton << pt1.x << " " << pt1.y << " m\n";
+ sButton << pt2.x << " " << pt2.y << " l\n";
+ sButton << pt3.x << " " << pt3.y << " l\n";
+ sButton << pt1.x << " " << pt1.y << " l f\n";
+
+ sAppStream << "q\n" << sButton << "Q\n";
+ }
+ }
+}
+
+void CPWL_CBButton::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device)
+{
+ CPWL_Wnd::DrawThisAppearance(pDevice,pUser2Device);
+
+ CPDF_Rect rectWnd = CPWL_Wnd::GetWindowRect();
+
+ if (IsVisible() && !rectWnd.IsEmpty())
+ {
+ CPDF_Point ptCenter = this->GetCenterPoint();
+
+ CPDF_Point pt1(ptCenter.x - PWL_CBBUTTON_TRIANGLE_HALFLEN,ptCenter.y + PWL_CBBUTTON_TRIANGLE_HALFLEN * 0.5f);
+ CPDF_Point pt2(ptCenter.x + PWL_CBBUTTON_TRIANGLE_HALFLEN,ptCenter.y + PWL_CBBUTTON_TRIANGLE_HALFLEN * 0.5f);
+ CPDF_Point pt3(ptCenter.x,ptCenter.y - PWL_CBBUTTON_TRIANGLE_HALFLEN * 0.5f);
+
+ if (IsFloatBigger(rectWnd.right - rectWnd.left,PWL_CBBUTTON_TRIANGLE_HALFLEN * 2)
+ &&
+ IsFloatBigger(rectWnd.top - rectWnd.bottom,PWL_CBBUTTON_TRIANGLE_HALFLEN)
+ )
+ {
+ CFX_PathData path;
+
+ path.SetPointCount(4);
+ path.SetPoint(0, pt1.x, pt1.y, FXPT_MOVETO);
+ path.SetPoint(1, pt2.x, pt2.y, FXPT_LINETO);
+ path.SetPoint(2, pt3.x, pt3.y, FXPT_LINETO);
+ path.SetPoint(3, pt1.x, pt1.y, FXPT_LINETO);
+
+ pDevice->DrawPath(&path, pUser2Device, NULL,
+ CPWL_Utils::PWLColorToFXColor(PWL_DEFAULT_BLACKCOLOR,GetTransparency()),
+ 0, FXFILL_ALTERNATE);
+ }
+ }
+}
+
+FX_BOOL CPWL_CBButton::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
+{
+ CPWL_Wnd::OnLButtonDown(point,nFlag);
+
+ SetCapture();
+
+ if (CPWL_Wnd * pParent = GetParentWindow())
+ {
+ pParent->OnNotify(this,PNM_LBUTTONDOWN,0,PWL_MAKEDWORD(point.x,point.y));
+ }
+
+ return TRUE;
+}
+
+FX_BOOL CPWL_CBButton::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
+{
+ CPWL_Wnd::OnLButtonUp(point, nFlag);
+
+ ReleaseCapture();
+
+ return TRUE;
+}
+
+/* ---------------------------- CPWL_ComboBox ---------------------------- */
+
+CPWL_ComboBox::CPWL_ComboBox() : m_pEdit(NULL),
+ m_pButton(NULL),
+ m_pList(NULL),
+ m_bPopup(FALSE),
+ m_nPopupWhere(0),
+ m_nSelectItem(-1),
+ m_pFillerNotify(NULL)
+{
+}
+
+CFX_ByteString CPWL_ComboBox::GetClassName() const
+{
+ return "CPWL_ComboBox";
+}
+
+void CPWL_ComboBox::OnCreate(PWL_CREATEPARAM & cp)
+{
+ cp.dwFlags &= ~PWS_HSCROLL;
+ cp.dwFlags &= ~PWS_VSCROLL;
+}
+
+void CPWL_ComboBox::SetFocus()
+{
+ if (m_pEdit)
+ m_pEdit->SetFocus();
+}
+
+void CPWL_ComboBox::KillFocus()
+{
+ SetPopup(FALSE);
+ CPWL_Wnd::KillFocus();
+}
+
+CFX_WideString CPWL_ComboBox::GetText() const
+{
+ if (m_pEdit)
+ {
+ return m_pEdit->GetText();
+ }
+ return CFX_WideString();
+}
+
+void CPWL_ComboBox::SetText(FX_LPCWSTR text)
+{
+ if (m_pEdit)
+ m_pEdit->SetText(text);
+}
+
+void CPWL_ComboBox::AddString(FX_LPCWSTR string)
+{
+ if (m_pList)
+ m_pList->AddString(string);
+}
+
+FX_INT32 CPWL_ComboBox::GetSelect() const
+{
+ return m_nSelectItem;
+}
+
+void CPWL_ComboBox::SetSelect(FX_INT32 nItemIndex)
+{
+ if (m_pList)
+ m_pList->Select(nItemIndex);
+
+ m_pEdit->SetText(m_pList->GetText());
+
+ m_nSelectItem = nItemIndex;
+}
+
+void CPWL_ComboBox::SetEditSel(FX_INT32 nStartChar,FX_INT32 nEndChar)
+{
+ if (m_pEdit)
+ {
+ m_pEdit->SetSel(nStartChar,nEndChar);
+ }
+}
+
+void CPWL_ComboBox::GetEditSel(FX_INT32 & nStartChar, FX_INT32 & nEndChar) const
+{
+ nStartChar = -1;
+ nEndChar = -1;
+
+ if (m_pEdit)
+ {
+ m_pEdit->GetSel(nStartChar,nEndChar);
+ }
+}
+
+void CPWL_ComboBox::Clear()
+{
+ if (m_pEdit)
+ {
+ m_pEdit->Clear();
+ }
+}
+
+void CPWL_ComboBox::CreateChildWnd(const PWL_CREATEPARAM & cp)
+{
+ CreateEdit(cp);
+ CreateButton(cp);
+ CreateListBox(cp);
+}
+
+void CPWL_ComboBox::CreateEdit(const PWL_CREATEPARAM & cp)
+{
+ if (!m_pEdit)
+ {
+ m_pEdit = new CPWL_CBEdit;
+ m_pEdit->AttachFFLData(m_pFormFiller);
+
+ PWL_CREATEPARAM ecp = cp;
+ ecp.pParentWnd = this;
+ ecp.dwFlags = PWS_VISIBLE | PWS_CHILD | PWS_BORDER | PES_CENTER | PES_AUTOSCROLL | PES_UNDO;
+
+ if (HasFlag(PWS_AUTOFONTSIZE))
+ ecp.dwFlags |= PWS_AUTOFONTSIZE;
+
+ if (!HasFlag(PCBS_ALLOWCUSTOMTEXT))
+ ecp.dwFlags |= PWS_READONLY;
+
+ ecp.rcRectWnd = CPDF_Rect(0,0,0,0);
+ ecp.dwBorderWidth = 0;
+ ecp.nBorderStyle = PBS_SOLID;
+
+ m_pEdit->Create(ecp);
+ }
+}
+
+void CPWL_ComboBox::CreateButton(const PWL_CREATEPARAM & cp)
+{
+ if (!m_pButton)
+ {
+ m_pButton = new CPWL_CBButton;
+
+ PWL_CREATEPARAM bcp = cp;
+ bcp.pParentWnd = this;
+ bcp.dwFlags = PWS_VISIBLE | PWS_CHILD | PWS_BORDER | PWS_BACKGROUND;
+ bcp.sBackgroundColor = PWL_SCROLLBAR_BKCOLOR;
+ bcp.sBorderColor = PWL_DEFAULT_BLACKCOLOR;
+ bcp.dwBorderWidth = 2;
+ bcp.nBorderStyle = PBS_BEVELED;
+ bcp.eCursorType = FXCT_ARROW;
+
+ m_pButton->Create(bcp);
+ }
+}
+
+void CPWL_ComboBox::CreateListBox(const PWL_CREATEPARAM & cp)
+{
+ if (!m_pList)
+ {
+ m_pList = new CPWL_CBListBox;
+ m_pList->AttachFFLData(m_pFormFiller);
+ PWL_CREATEPARAM lcp = cp;
+ lcp.pParentWnd = this;
+ lcp.dwFlags = PWS_CHILD | PWS_BORDER | PWS_BACKGROUND | PLBS_HOVERSEL | PWS_VSCROLL;
+ lcp.nBorderStyle = PBS_SOLID;
+ lcp.dwBorderWidth = 1;
+ lcp.eCursorType = FXCT_ARROW;
+ lcp.rcRectWnd = CPDF_Rect(0,0,0,0);
+
+ if (cp.dwFlags & PWS_AUTOFONTSIZE)
+ lcp.fFontSize = PWLCB_DEFAULTFONTSIZE;
+ else
+ lcp.fFontSize = cp.fFontSize;
+
+ if (cp.sBorderColor.nColorType == COLORTYPE_TRANSPARENT)
+ lcp.sBorderColor = PWL_DEFAULT_BLACKCOLOR;
+
+ if (cp.sBackgroundColor.nColorType == COLORTYPE_TRANSPARENT)
+ lcp.sBackgroundColor = PWL_DEFAULT_WHITECOLOR;
+
+ m_pList->Create(lcp);
+ }
+}
+
+void CPWL_ComboBox::RePosChildWnd()
+{
+ CPDF_Rect rcClient = GetClientRect();
+
+ if (m_bPopup)
+ {
+ CPDF_Rect rclient = GetClientRect();
+ CPDF_Rect rcButton = rclient;
+ CPDF_Rect rcEdit = rcClient;
+ CPDF_Rect rcList = CPWL_Wnd::GetWindowRect();
+
+ FX_FLOAT fOldWindowHeight = m_rcOldWindow.Height();
+ FX_FLOAT fOldClientHeight = fOldWindowHeight - GetBorderWidth() * 2;
+
+ switch (m_nPopupWhere)
+ {
+ case 0:
+ rcButton.left = rcButton.right - PWL_COMBOBOX_BUTTON_WIDTH;
+
+ if (rcButton.left < rclient.left)
+ rcButton.left = rclient.left;
+
+ rcButton.bottom = rcButton.top - fOldClientHeight;
+
+ rcEdit.right = rcButton.left - 1.0f;
+
+ if (rcEdit.left < rclient.left)
+ rcEdit.left = rclient.left;
+
+ if (rcEdit.right < rcEdit.left)
+ rcEdit.right = rcEdit.left;
+
+ rcEdit.bottom = rcEdit.top - fOldClientHeight;
+
+ rcList.top -= fOldWindowHeight;
+
+ break;
+ case 1:
+ rcButton.left = rcButton.right - PWL_COMBOBOX_BUTTON_WIDTH;
+
+ if (rcButton.left < rclient.left)
+ rcButton.left = rclient.left;
+
+ rcButton.top = rcButton.bottom + fOldClientHeight;
+
+ rcEdit.right = rcButton.left - 1.0f;
+
+ if (rcEdit.left < rclient.left)
+ rcEdit.left = rclient.left;
+
+ if (rcEdit.right < rcEdit.left)
+ rcEdit.right = rcEdit.left;
+
+ rcEdit.top = rcEdit.bottom + fOldClientHeight;
+
+ rcList.bottom += fOldWindowHeight;
+
+ break;
+ }
+
+ if (m_pButton)
+ m_pButton->Move(rcButton,TRUE,FALSE);
+
+ if (m_pEdit)
+ m_pEdit->Move(rcEdit,TRUE,FALSE);
+
+ if (m_pList)
+ {
+ m_pList->SetVisible(TRUE);
+ m_pList->Move(rcList,TRUE,FALSE);
+ m_pList->ScrollToListItem(m_nSelectItem);
+ }
+ }
+ else
+ {
+ CPDF_Rect rcButton = rcClient;
+
+ rcButton.left = rcButton.right - PWL_COMBOBOX_BUTTON_WIDTH;
+
+ if (rcButton.left < rcClient.left)
+ rcButton.left = rcClient.left;
+
+ if (m_pButton)
+ m_pButton->Move(rcButton,TRUE,FALSE);
+
+ CPDF_Rect rcEdit = rcClient;
+ rcEdit.right = rcButton.left - 1.0f;
+
+ if (rcEdit.left < rcClient.left)
+ rcEdit.left = rcClient.left;
+
+ if (rcEdit.right < rcEdit.left)
+ rcEdit.right = rcEdit.left;
+
+ if (m_pEdit)
+ m_pEdit->Move(rcEdit,TRUE,FALSE);
+
+ if (m_pList)
+ m_pList->SetVisible(FALSE);
+ }
+}
+
+void CPWL_ComboBox::SelectAll()
+{
+ if (m_pEdit && HasFlag(PCBS_ALLOWCUSTOMTEXT))
+ m_pEdit->SelectAll();
+}
+
+CPDF_Rect CPWL_ComboBox::GetFocusRect() const
+{
+ return CPDF_Rect();
+}
+
+void CPWL_ComboBox::SetPopup(FX_BOOL bPopup)
+{
+ if (!m_pList) return;
+ if (bPopup == m_bPopup) return;
+ FX_FLOAT fListHeight = m_pList->GetContentRect().Height();
+ if (!IsFloatBigger(fListHeight,0.0f)) return;
+
+ if (bPopup)
+ {
+ if (m_pFillerNotify)
+ {
+ FX_INT32 nWhere = 0;
+ FX_FLOAT fPopupRet = 0.0f;
+ FX_FLOAT fPopupMin = 0.0f;
+ if (m_pList->GetCount() > 3)
+ fPopupMin = m_pList->GetFirstHeight() * 3 + m_pList->GetBorderWidth() * 2;
+ FX_FLOAT fPopupMax = fListHeight + m_pList->GetBorderWidth() * 2;
+ m_pFillerNotify->QueryWherePopup(GetAttachedData(), fPopupMin,fPopupMax,nWhere,fPopupRet);
+
+ if (IsFloatBigger(fPopupRet,0.0f))
+ {
+ m_bPopup = bPopup;
+
+ CPDF_Rect rcWindow = CPWL_Wnd::GetWindowRect();
+ m_rcOldWindow = rcWindow;
+ switch (nWhere)
+ {
+ default:
+ case 0:
+ rcWindow.bottom -= fPopupRet;
+ break;
+ case 1:
+ rcWindow.top += fPopupRet;
+ break;
+ }
+
+ m_nPopupWhere = nWhere;
+ Move(rcWindow, TRUE, TRUE);
+ }
+ }
+ }
+ else
+ {
+ m_bPopup = bPopup;
+ Move(m_rcOldWindow, TRUE, TRUE);
+ }
+}
+
+FX_BOOL CPWL_ComboBox::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
+{
+ if (!m_pList) return FALSE;
+ if (!m_pEdit) return FALSE;
+
+ m_nSelectItem = -1;
+
+ switch (nChar)
+ {
+ case FWL_VKEY_Up:
+ if (m_pList->GetCurSel() > 0)
+ {
+ FX_BOOL bExit = FALSE;
+ if (m_pList->OnKeyDown(nChar,bExit,nFlag))
+ {
+ if (bExit) return FALSE;
+ SetSelectText();
+ }
+ }
+ return TRUE;
+ case FWL_VKEY_Down:
+ if (m_pList->GetCurSel() < m_pList->GetCount() - 1)
+ {
+ FX_BOOL bExit = FALSE;
+ if (m_pList->OnKeyDown(nChar,bExit,nFlag))
+ {
+ if (bExit) return FALSE;
+ SetSelectText();
+ }
+ }
+ return TRUE;
+ }
+
+ if (HasFlag(PCBS_ALLOWCUSTOMTEXT))
+ return m_pEdit->OnKeyDown(nChar,nFlag);
+ else
+ return FALSE;
+}
+
+FX_BOOL CPWL_ComboBox::OnChar(FX_WORD nChar, FX_DWORD nFlag)
+{
+ if (!m_pList) return FALSE;
+ if (!m_pEdit) return FALSE;
+
+ m_nSelectItem = -1;
+ FX_BOOL bExit = FALSE;
+
+ if (HasFlag(PCBS_ALLOWCUSTOMTEXT))
+ {
+ return m_pEdit->OnChar(nChar,nFlag);
+ }
+ else
+ {
+ if (m_pList->OnChar(nChar,bExit,nFlag))
+ {
+ return bExit;
+ }
+ else
+ return FALSE;
+ }
+}
+
+void CPWL_ComboBox::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam, FX_INTPTR lParam)
+{
+ switch (msg)
+ {
+ case PNM_LBUTTONDOWN:
+ if (pWnd == m_pButton)
+ {
+ SetPopup(!m_bPopup);
+ return;
+ }
+ break;
+ case PNM_LBUTTONUP:
+ if (m_pEdit && m_pList)
+ {
+ if (pWnd == m_pList)
+ {
+ SetSelectText();
+ SelectAll();
+ m_pEdit->SetFocus();
+ SetPopup(FALSE);
+ return;
+ }
+ }
+ }
+
+ CPWL_Wnd::OnNotify(pWnd,msg,wParam,lParam);
+}
+
+FX_BOOL CPWL_ComboBox::IsPopup() const
+{
+ return m_bPopup;
+}
+
+void CPWL_ComboBox::SetSelectText()
+{
+ CFX_WideString swText = m_pList->GetText();
+ m_pEdit->SelectAll();
+ m_pEdit->ReplaceSel(m_pList->GetText());
+ m_pEdit->SelectAll();
+
+ m_nSelectItem = m_pList->GetCurSel();
+}
+
+FX_BOOL CPWL_ComboBox::IsModified() const
+{
+ return m_pEdit->IsModified();
+}
+
+void CPWL_ComboBox::SetFillerNotify(IPWL_Filler_Notify* pNotify)
+{
+ m_pFillerNotify = pNotify;
+
+ if (m_pEdit)
+ m_pEdit->SetFillerNotify(pNotify);
+
+ if (m_pList)
+ m_pList->SetFillerNotify(pNotify);
+}
+
diff --git a/fpdfsdk/src/pdfwindow/PWL_Edit.cpp b/fpdfsdk/src/pdfwindow/PWL_Edit.cpp
index 87ddd87fb0..df59c2ccc8 100644
--- a/fpdfsdk/src/pdfwindow/PWL_Edit.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_Edit.cpp
@@ -1,1316 +1,1316 @@
-// 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
-
-#include "../../include/pdfwindow/PDFWindow.h"
-#include "../../include/pdfwindow/PWL_Wnd.h"
-#include "../../include/pdfwindow/PWL_EditCtrl.h"
-#include "../../include/pdfwindow/PWL_Edit.h"
-#include "../../include/pdfwindow/PWL_ScrollBar.h"
-#include "../../include/pdfwindow/PWL_Utils.h"
-#include "../../include/pdfwindow/PWL_Caret.h"
-#include "../../include/pdfwindow/PWL_FontMap.h"
-
-/* ---------------------------- CPWL_Edit ------------------------------ */
-
-CPWL_Edit::CPWL_Edit() : m_pFillerNotify(NULL),
- m_pSpellCheck(NULL),
- m_bFocus(FALSE)
-{
- m_pFormFiller = NULL;
-}
-
-CPWL_Edit::~CPWL_Edit()
-{
- ASSERT(m_bFocus == FALSE);
-}
-
-CFX_ByteString CPWL_Edit::GetClassName() const
-{
- return PWL_CLASSNAME_EDIT;
-}
-
-void CPWL_Edit::OnDestroy()
-{
-}
-
-void CPWL_Edit::SetText(FX_LPCWSTR csText)
-{
- CFX_WideString swText = csText;
-
- if (HasFlag(PES_RICH))
- {
- CFX_ByteString sValue = CFX_ByteString::FromUnicode(swText);
-
- if (CXML_Element * pXML = CXML_Element::Parse((FX_LPCSTR)sValue,sValue.GetLength()))
- {
- FX_INT32 nCount = pXML->CountChildren();
- FX_BOOL bFirst = TRUE;
-
- swText.Empty();
-
- for (FX_INT32 i=0; i<nCount; i++)
- {
- if (CXML_Element * pSubElement = pXML->GetElement(i))
- {
- CFX_ByteString tag=pSubElement->GetTagName();
- if (tag.EqualNoCase("p"))
- {
- int nChild = pSubElement->CountChildren();
- CFX_WideString swSection;
- for(FX_INT32 j=0; j<nChild; j++)
- {
- swSection += pSubElement->GetContent(j);
- }
-
- if (bFirst)bFirst = FALSE;
- else
- swText += FWL_VKEY_Return;
- swText += swSection;
- }
- }
- }
-
- delete pXML;
- }
- }
-
- m_pEdit->SetText(swText);
-}
-
-void CPWL_Edit::RePosChildWnd()
-{
- if (CPWL_ScrollBar * pVSB = this->GetVScrollBar())
- {
- //if (pVSB->IsVisible())
- {
- CPDF_Rect rcWindow = m_rcOldWindow;
- CPDF_Rect rcVScroll = CPDF_Rect(rcWindow.right,
- rcWindow.bottom,
- rcWindow.right + PWL_SCROLLBAR_WIDTH,
- rcWindow.top);
- pVSB->Move(rcVScroll, TRUE, FALSE);
- }
- }
-
- if (m_pEditCaret && !HasFlag(PES_TEXTOVERFLOW))
- m_pEditCaret->SetClipRect(CPWL_Utils::InflateRect(GetClientRect(),1.0f)); //+1 for caret beside border
-
- CPWL_EditCtrl::RePosChildWnd();
-}
-
-CPDF_Rect CPWL_Edit::GetClientRect() const
-{
- CPDF_Rect rcClient = CPWL_Utils::DeflateRect(GetWindowRect(),(FX_FLOAT)(GetBorderWidth()+GetInnerBorderWidth()));
-
- if (CPWL_ScrollBar * pVSB = this->GetVScrollBar())
- {
- if (pVSB->IsVisible())
- {
- rcClient.right -= PWL_SCROLLBAR_WIDTH;
- }
- }
-
- return rcClient;
-}
-
-void CPWL_Edit::SetAlignFormatH(PWL_EDIT_ALIGNFORMAT_H nFormat, FX_BOOL bPaint/* = TRUE*/)
-{
- m_pEdit->SetAlignmentH((FX_INT32)nFormat, bPaint);
-}
-
-void CPWL_Edit::SetAlignFormatV(PWL_EDIT_ALIGNFORMAT_V nFormat, FX_BOOL bPaint/* = TRUE*/)
-{
- m_pEdit->SetAlignmentV((FX_INT32)nFormat, bPaint);
-}
-
-FX_BOOL CPWL_Edit::CanSelectAll() const
-{
- return GetSelectWordRange() != m_pEdit->GetWholeWordRange();
-}
-
-FX_BOOL CPWL_Edit::CanClear() const
-{
- return !IsReadOnly() && m_pEdit->IsSelected();
-}
-
-FX_BOOL CPWL_Edit::CanCopy() const
-{
- return !HasFlag(PES_PASSWORD) && !HasFlag(PES_NOREAD) && m_pEdit->IsSelected();
-}
-
-FX_BOOL CPWL_Edit::CanCut() const
-{
- return CanCopy() && !IsReadOnly();
-}
-
-FX_BOOL CPWL_Edit::CanPaste() const
-{
- if (IsReadOnly()) return FALSE;
-
- CFX_WideString swClipboard;
- if (IFX_SystemHandler* pSH = GetSystemHandler())
- swClipboard = pSH->GetClipboardText(GetAttachedHWnd());
-
- return !swClipboard.IsEmpty();
-}
-
-void CPWL_Edit::CopyText()
-{
- if (!CanCopy()) return;
-
- CFX_WideString str = m_pEdit->GetSelText();
-
- if (IFX_SystemHandler* pSH = GetSystemHandler())
- pSH->SetClipboardText(GetAttachedHWnd(), str);
-}
-
-void CPWL_Edit::PasteText()
-{
- if (!CanPaste()) return;
-
- CFX_WideString swClipboard;
- if (IFX_SystemHandler* pSH = GetSystemHandler())
- swClipboard = pSH->GetClipboardText(GetAttachedHWnd());
-
- if (m_pFillerNotify)
- {
- FX_BOOL bRC = TRUE;
- FX_BOOL bExit = FALSE;
- CFX_WideString strChangeEx;
- int nSelStart = 0;
- int nSelEnd = 0;
- GetSel(nSelStart, nSelEnd);
- m_pFillerNotify->OnBeforeKeyStroke(TRUE, GetAttachedData(), 0 , swClipboard, strChangeEx, nSelStart, nSelEnd, TRUE, bRC, bExit, 0);
- if (!bRC) return;
- if (bExit) return;
- }
-
- if (swClipboard.GetLength() > 0)
- {
- Clear();
- InsertText(swClipboard);
- }
-
- if (m_pFillerNotify)
- {
- FX_BOOL bExit = FALSE;
- m_pFillerNotify->OnAfterKeyStroke(TRUE, GetAttachedData(), bExit,0);
- if (bExit) return;
- }
-}
-
-void CPWL_Edit::CutText()
-{
- if (!CanCut()) return;
-
- CFX_WideString str = m_pEdit->GetSelText();
-
- if (IFX_SystemHandler* pSH = GetSystemHandler())
- pSH->SetClipboardText(GetAttachedHWnd(), str);
-
- m_pEdit->Clear();
-}
-
-void CPWL_Edit::OnCreated()
-{
- CPWL_EditCtrl::OnCreated();
-
- if (CPWL_ScrollBar * pScroll = GetVScrollBar())
- {
- pScroll->RemoveFlag(PWS_AUTOTRANSPARENT);
- pScroll->SetTransparency(255);
- }
-
- SetParamByFlag();
-
- m_rcOldWindow = GetWindowRect();
-
- m_pEdit->SetOprNotify(this);
- m_pEdit->EnableOprNotify(TRUE);
-}
-
-void CPWL_Edit::SetParamByFlag()
-{
- if (HasFlag(PES_RIGHT))
- {
- m_pEdit->SetAlignmentH(2, FALSE);
- }
- else if (HasFlag(PES_MIDDLE))
- {
- m_pEdit->SetAlignmentH(1, FALSE);
- }
- else
- {
- m_pEdit->SetAlignmentH(0, FALSE);
- }
-
- if (HasFlag(PES_BOTTOM))
- {
- m_pEdit->SetAlignmentV(2, FALSE);
- }
- else if (HasFlag(PES_CENTER))
- {
- m_pEdit->SetAlignmentV(1, FALSE);
- }
- else
- {
- m_pEdit->SetAlignmentV(0, FALSE);
- }
-
- if (HasFlag(PES_PASSWORD))
- {
- m_pEdit->SetPasswordChar('*', FALSE);
- }
-
- m_pEdit->SetMultiLine(HasFlag(PES_MULTILINE), FALSE);
- m_pEdit->SetAutoReturn(HasFlag(PES_AUTORETURN), FALSE);
- m_pEdit->SetAutoFontSize(HasFlag(PWS_AUTOFONTSIZE), FALSE);
- m_pEdit->SetAutoScroll(HasFlag(PES_AUTOSCROLL), FALSE);
- m_pEdit->EnableUndo(HasFlag(PES_UNDO));
-
- if (HasFlag(PES_TEXTOVERFLOW))
- {
- SetClipRect(CPDF_Rect(0.0f,0.0f,0.0f,0.0f));
- m_pEdit->SetTextOverflow(TRUE, FALSE);
- }
- else
- {
- if (m_pEditCaret)
- {
- m_pEditCaret->SetClipRect(CPWL_Utils::InflateRect(GetClientRect(),1.0f)); //+1 for caret beside border
- }
- }
-
- if (HasFlag(PES_SPELLCHECK))
- {
- m_pSpellCheck = GetCreationParam().pSpellCheck;
- }
-}
-
-void CPWL_Edit::GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream)
-{
- CPWL_Wnd::GetThisAppearanceStream(sAppStream);
-
- CPDF_Rect rcClient = GetClientRect();
- CFX_ByteTextBuf sLine;
-
- FX_INT32 nCharArray = m_pEdit->GetCharArray();
-
- if (nCharArray > 0)
- {
- switch (GetBorderStyle())
- {
- case PBS_SOLID:
- {
- sLine << "q\n" << GetBorderWidth() << " w\n"
- << CPWL_Utils::GetColorAppStream(GetBorderColor(),FALSE) << " 2 J 0 j\n";
-
- for (FX_INT32 i=1;i<nCharArray;i++)
- {
- sLine << rcClient.left + ((rcClient.right - rcClient.left)/nCharArray)*i << " "
- << rcClient.bottom << " m\n"
- << rcClient.left + ((rcClient.right - rcClient.left)/nCharArray)*i << " "
- << rcClient.top << " l S\n";
- }
-
- sLine << "Q\n";
- }
- break;
- case PBS_DASH:
- {
- sLine << "q\n" << GetBorderWidth() << " w\n"
- << CPWL_Utils::GetColorAppStream(GetBorderColor(),FALSE) << " 2 J 0 j\n"
- << "[" << GetBorderDash().nDash << " "
- << GetBorderDash().nGap << "] "
- << GetBorderDash().nPhase << " d\n";
-
- for (FX_INT32 i=1;i<nCharArray;i++)
- {
- sLine << rcClient.left + ((rcClient.right - rcClient.left)/nCharArray)*i << " "
- << rcClient.bottom << " m\n"
- << rcClient.left + ((rcClient.right - rcClient.left)/nCharArray)*i << " "
- << rcClient.top << " l S\n";
- }
-
- sLine << "Q\n";
- }
- break;
- }
- }
-
- sAppStream << sLine;
-
- CFX_ByteTextBuf sText;
-
- CPDF_Point ptOffset = CPDF_Point(0.0f,0.0f);
-
- CPVT_WordRange wrWhole = m_pEdit->GetWholeWordRange();
- CPVT_WordRange wrSelect = GetSelectWordRange();
- CPVT_WordRange wrVisible = (HasFlag(PES_TEXTOVERFLOW) ? wrWhole : m_pEdit->GetVisibleWordRange());
- CPVT_WordRange wrSelBefore(wrWhole.BeginPos,wrSelect.BeginPos);
- CPVT_WordRange wrSelAfter(wrSelect.EndPos,wrWhole.EndPos);
-
- CPVT_WordRange wrTemp = CPWL_Utils::OverlapWordRange(GetSelectWordRange(),wrVisible);
- CFX_ByteString sEditSel = CPWL_Utils::GetEditSelAppStream(m_pEdit, ptOffset,
- &wrTemp);
-
- if (sEditSel.GetLength() > 0)
- sText << CPWL_Utils::GetColorAppStream(PWL_DEFAULT_SELBACKCOLOR) << sEditSel ;
-
- wrTemp = CPWL_Utils::OverlapWordRange(wrVisible,wrSelBefore);
- CFX_ByteString sEditBefore = CPWL_Utils::GetEditAppStream(m_pEdit, ptOffset,
- &wrTemp, !HasFlag(PES_CHARARRAY), m_pEdit->GetPasswordChar());
-
- if (sEditBefore.GetLength() > 0)
- sText << "BT\n" << CPWL_Utils::GetColorAppStream(GetTextColor()) << sEditBefore << "ET\n";
-
- wrTemp = CPWL_Utils::OverlapWordRange(wrVisible,wrSelect);
- CFX_ByteString sEditMid = CPWL_Utils::GetEditAppStream(m_pEdit, ptOffset,
- &wrTemp, !HasFlag(PES_CHARARRAY), m_pEdit->GetPasswordChar());
-
- if (sEditMid.GetLength() > 0)
- sText << "BT\n" << CPWL_Utils::GetColorAppStream(CPWL_Color(COLORTYPE_GRAY,1)) << sEditMid << "ET\n";
-
- wrTemp = CPWL_Utils::OverlapWordRange(wrVisible,wrSelAfter);
- CFX_ByteString sEditAfter = CPWL_Utils::GetEditAppStream(m_pEdit, ptOffset,
- &wrTemp, !HasFlag(PES_CHARARRAY), m_pEdit->GetPasswordChar());
-
- if (sEditAfter.GetLength() > 0)
- sText << "BT\n" << CPWL_Utils::GetColorAppStream(GetTextColor()) << sEditAfter<< "ET\n";
-
- if (HasFlag(PES_SPELLCHECK))
- {
- CFX_ByteString sSpellCheck = CPWL_Utils::GetSpellCheckAppStream(m_pEdit, m_pSpellCheck, ptOffset, &wrVisible);
- if (sSpellCheck.GetLength() > 0)
- sText << CPWL_Utils::GetColorAppStream(CPWL_Color(COLORTYPE_RGB,1,0,0),FALSE) << sSpellCheck;
- }
-
- if (sText.GetLength() > 0)
- {
- CPDF_Rect rcClient = this->GetClientRect();
- sAppStream << "q\n/Tx BMC\n";
-
- if (!HasFlag(PES_TEXTOVERFLOW))
- sAppStream << rcClient.left << " " << rcClient.bottom << " "
- << rcClient.right - rcClient.left << " " << rcClient.top - rcClient.bottom << " re W n\n";
-
- sAppStream << sText;
-
- sAppStream << "EMC\nQ\n";
- }
-}
-
-void CPWL_Edit::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device)
-{
- CPWL_Wnd::DrawThisAppearance(pDevice,pUser2Device);
-
- CPDF_Rect rcClient = GetClientRect();
- CFX_ByteTextBuf sLine;
-
- FX_INT32 nCharArray = m_pEdit->GetCharArray();
-
- if (nCharArray > 0)
- {
- switch (GetBorderStyle())
- {
- case PBS_SOLID:
- {
- CFX_GraphStateData gsd;
- gsd.m_LineWidth = (FX_FLOAT)GetBorderWidth();
-
- CFX_PathData path;
- path.SetPointCount((nCharArray-1)*2);
-
- for (FX_INT32 i=0; i<nCharArray-1; i++)
- {
- path.SetPoint(i*2, rcClient.left + ((rcClient.right - rcClient.left)/nCharArray)*(i+1),
- rcClient.bottom, FXPT_MOVETO);
- path.SetPoint(i*2+1, rcClient.left + ((rcClient.right - rcClient.left)/nCharArray)*(i+1),
- rcClient.top, FXPT_LINETO);
- }
- if (path.GetPointCount() > 0)
- pDevice->DrawPath(&path, pUser2Device, &gsd,0,
- CPWL_Utils::PWLColorToFXColor(GetBorderColor(),255), FXFILL_ALTERNATE);
- }
- break;
- case PBS_DASH:
- {
- CFX_GraphStateData gsd;
- gsd.m_LineWidth = (FX_FLOAT)GetBorderWidth();
-
- gsd.SetDashCount(2);
- gsd.m_DashArray[0] = (FX_FLOAT)GetBorderDash().nDash;
- gsd.m_DashArray[1] = (FX_FLOAT)GetBorderDash().nGap;
- gsd.m_DashPhase = (FX_FLOAT)GetBorderDash().nPhase;
-
- CFX_PathData path;
- path.SetPointCount((nCharArray-1)*2);
-
- for (FX_INT32 i=0; i<nCharArray-1; i++)
- {
- path.SetPoint(i*2, rcClient.left + ((rcClient.right - rcClient.left)/nCharArray)*(i+1),
- rcClient.bottom, FXPT_MOVETO);
- path.SetPoint(i*2+1, rcClient.left + ((rcClient.right - rcClient.left)/nCharArray)*(i+1),
- rcClient.top, FXPT_LINETO);
- }
- if (path.GetPointCount() > 0)
- pDevice->DrawPath(&path, pUser2Device, &gsd,0,
- CPWL_Utils::PWLColorToFXColor(GetBorderColor(),255), FXFILL_ALTERNATE);
- }
- break;
- }
- }
-
- CPDF_Rect rcClip;
- CPVT_WordRange wrRange = m_pEdit->GetVisibleWordRange();
- CPVT_WordRange* pRange = NULL;
-
- if (!HasFlag(PES_TEXTOVERFLOW))
- {
- rcClip = GetClientRect();
- pRange = &wrRange;
- }
-IFX_SystemHandler* pSysHandler = GetSystemHandler();
- IFX_Edit::DrawEdit(pDevice,pUser2Device,m_pEdit,
- CPWL_Utils::PWLColorToFXColor(GetTextColor(),this->GetTransparency()),
- CPWL_Utils::PWLColorToFXColor(GetTextStrokeColor(),this->GetTransparency()),
- rcClip,CPDF_Point(0.0f,0.0f),pRange, pSysHandler, m_pFormFiller);
-
- if (HasFlag(PES_SPELLCHECK))
- {
- CPWL_Utils::DrawEditSpellCheck(pDevice,pUser2Device,m_pEdit,rcClip,
- CPDF_Point(0.0f,0.0f),pRange, this->GetCreationParam().pSpellCheck);
- }
-}
-
-FX_BOOL CPWL_Edit::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
-{
- CPWL_Wnd::OnLButtonDown(point,nFlag);
-
- if (HasFlag(PES_TEXTOVERFLOW) || ClientHitTest(point))
- {
- if (m_bMouseDown)
- this->InvalidateRect();
-
- m_bMouseDown = TRUE;
- SetCapture();
-
- m_pEdit->OnMouseDown(point,IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
- }
-
- return TRUE;
-}
-
-FX_BOOL CPWL_Edit::OnLButtonDblClk(const CPDF_Point & point, FX_DWORD nFlag)
-{
- CPWL_Wnd::OnLButtonDblClk(point, nFlag);
-
- if (HasFlag(PES_TEXTOVERFLOW) || ClientHitTest(point))
- {
- m_pEdit->SelectAll();
- }
-
- return TRUE;
-}
-
-#define WM_PWLEDIT_UNDO 0x01
-#define WM_PWLEDIT_REDO 0x02
-#define WM_PWLEDIT_CUT 0x03
-#define WM_PWLEDIT_COPY 0x04
-#define WM_PWLEDIT_PASTE 0x05
-#define WM_PWLEDIT_DELETE 0x06
-#define WM_PWLEDIT_SELECTALL 0x07
-#define WM_PWLEDIT_SUGGEST 0x08
-
-FX_BOOL CPWL_Edit::OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
-{
- if (m_bMouseDown) return FALSE;
-
- CPWL_Wnd::OnRButtonUp(point, nFlag);
-
- if (!HasFlag(PES_TEXTOVERFLOW) && !ClientHitTest(point)) return TRUE;
-
- IFX_SystemHandler* pSH = GetSystemHandler();
- if (!pSH) return FALSE;
-
- this->SetFocus();
-
- CPVT_WordRange wrLatin = GetLatinWordsRange(point);
- CFX_WideString swLatin = m_pEdit->GetRangeText(wrLatin);
-
- FX_HMENU hPopup = pSH->CreatePopupMenu();
- if (!hPopup) return FALSE;
-
- CFX_ByteStringArray sSuggestWords;
- CPDF_Point ptPopup = point;
-
- if (!IsReadOnly())
- {
- if (HasFlag(PES_SPELLCHECK) && !swLatin.IsEmpty())
- {
- if (m_pSpellCheck)
- {
- CFX_ByteString sLatin = CFX_ByteString::FromUnicode(swLatin);
-
- if (!m_pSpellCheck->CheckWord(sLatin))
- {
- m_pSpellCheck->SuggestWords(sLatin,sSuggestWords);
-
- FX_INT32 nSuggest = sSuggestWords.GetSize();
-
- for (FX_INT32 nWord=0; nWord<nSuggest; nWord++)
- {
- pSH->AppendMenuItem(hPopup, WM_PWLEDIT_SUGGEST+nWord, sSuggestWords[nWord].UTF8Decode());
- }
-
- if (nSuggest > 0)
- pSH->AppendMenuItem(hPopup, 0, L"");
-
- ptPopup = GetWordRightBottomPoint(wrLatin.EndPos);
- }
- }
- }
- }
-
- IPWL_Provider* pProvider = this->GetProvider();
-
- if (HasFlag(PES_UNDO))
- {
- pSH->AppendMenuItem(hPopup, WM_PWLEDIT_UNDO,
- pProvider ? pProvider->LoadPopupMenuString(0) : L"&Undo");
- pSH->AppendMenuItem(hPopup, WM_PWLEDIT_REDO,
- pProvider ? pProvider->LoadPopupMenuString(1) : L"&Redo");
- pSH->AppendMenuItem(hPopup, 0, L"");
-
- if (!m_pEdit->CanUndo())
- pSH->EnableMenuItem(hPopup, WM_PWLEDIT_UNDO, FALSE);
- if (!m_pEdit->CanRedo())
- pSH->EnableMenuItem(hPopup, WM_PWLEDIT_REDO, FALSE);
- }
-
- pSH->AppendMenuItem(hPopup, WM_PWLEDIT_CUT,
- pProvider ? pProvider->LoadPopupMenuString(2) : L"Cu&t");
- pSH->AppendMenuItem(hPopup, WM_PWLEDIT_COPY,
- pProvider ? pProvider->LoadPopupMenuString(3) : L"&Copy");
- pSH->AppendMenuItem(hPopup, WM_PWLEDIT_PASTE,
- pProvider ? pProvider->LoadPopupMenuString(4) : L"&Paste");
- pSH->AppendMenuItem(hPopup, WM_PWLEDIT_DELETE,
- pProvider ? pProvider->LoadPopupMenuString(5) : L"&Delete");
-
- CFX_WideString swText = pSH->GetClipboardText(this->GetAttachedHWnd());
- if (swText.IsEmpty())
- pSH->EnableMenuItem(hPopup, WM_PWLEDIT_PASTE, FALSE);
-
- if (!m_pEdit->IsSelected())
- {
- pSH->EnableMenuItem(hPopup, WM_PWLEDIT_CUT, FALSE);
- pSH->EnableMenuItem(hPopup, WM_PWLEDIT_COPY, FALSE);
- pSH->EnableMenuItem(hPopup, WM_PWLEDIT_DELETE, FALSE);
- }
-
- if (IsReadOnly())
- {
- pSH->EnableMenuItem(hPopup, WM_PWLEDIT_CUT, FALSE);
- pSH->EnableMenuItem(hPopup, WM_PWLEDIT_DELETE, FALSE);
- pSH->EnableMenuItem(hPopup, WM_PWLEDIT_PASTE, FALSE);
- }
-
- if (HasFlag(PES_PASSWORD))
- {
- pSH->EnableMenuItem(hPopup, WM_PWLEDIT_CUT, FALSE);
- pSH->EnableMenuItem(hPopup, WM_PWLEDIT_COPY, FALSE);
- }
-
- if (HasFlag(PES_NOREAD))
- {
- pSH->EnableMenuItem(hPopup, WM_PWLEDIT_CUT, FALSE);
- pSH->EnableMenuItem(hPopup, WM_PWLEDIT_COPY, FALSE);
- }
-
- pSH->AppendMenuItem(hPopup, 0, L"");
- pSH->AppendMenuItem(hPopup, WM_PWLEDIT_SELECTALL,
- pProvider ? pProvider->LoadPopupMenuString(6) : L"&Select All");
-
- if (m_pEdit->GetTotalWords() == 0)
- {
- pSH->EnableMenuItem(hPopup, WM_PWLEDIT_SELECTALL, FALSE);
- }
-
- FX_INT32 x, y;
- PWLtoWnd(ptPopup, x, y);
- pSH->ClientToScreen(GetAttachedHWnd(), x, y);
- pSH->SetCursor(FXCT_ARROW);
- FX_INT32 nCmd = pSH->TrackPopupMenu(hPopup,
- x,
- y,
- GetAttachedHWnd());
-
-
- switch (nCmd)
- {
- case WM_PWLEDIT_UNDO:
- Undo();
- break;
- case WM_PWLEDIT_REDO:
- Redo();
- break;
- case WM_PWLEDIT_CUT:
- this->CutText();
- break;
- case WM_PWLEDIT_COPY:
- this->CopyText();
- break;
- case WM_PWLEDIT_PASTE:
- this->PasteText();
- break;
- case WM_PWLEDIT_DELETE:
- this->Clear();
- break;
- case WM_PWLEDIT_SELECTALL:
- this->SelectAll();
- break;
- case WM_PWLEDIT_SUGGEST + 0:
- SetSel(m_pEdit->WordPlaceToWordIndex(wrLatin.BeginPos),m_pEdit->WordPlaceToWordIndex(wrLatin.EndPos));
- ReplaceSel(sSuggestWords[0].UTF8Decode());
- break;
- case WM_PWLEDIT_SUGGEST + 1:
- SetSel(m_pEdit->WordPlaceToWordIndex(wrLatin.BeginPos),m_pEdit->WordPlaceToWordIndex(wrLatin.EndPos));
- ReplaceSel(sSuggestWords[1].UTF8Decode());
- break;
- case WM_PWLEDIT_SUGGEST + 2:
- SetSel(m_pEdit->WordPlaceToWordIndex(wrLatin.BeginPos),m_pEdit->WordPlaceToWordIndex(wrLatin.EndPos));
- ReplaceSel(sSuggestWords[2].UTF8Decode());
- break;
- case WM_PWLEDIT_SUGGEST + 3:
- SetSel(m_pEdit->WordPlaceToWordIndex(wrLatin.BeginPos),m_pEdit->WordPlaceToWordIndex(wrLatin.EndPos));
- ReplaceSel(sSuggestWords[3].UTF8Decode());
- break;
- case WM_PWLEDIT_SUGGEST + 4:
- SetSel(m_pEdit->WordPlaceToWordIndex(wrLatin.BeginPos),m_pEdit->WordPlaceToWordIndex(wrLatin.EndPos));
- ReplaceSel(sSuggestWords[4].UTF8Decode());
- break;
- default:
- break;
- }
-
- pSH->DestroyMenu(hPopup);
-
- return TRUE;
-}
-
-void CPWL_Edit::OnSetFocus()
-{
- SetEditCaret(TRUE);
-
- if (!IsReadOnly())
- {
- if (IPWL_FocusHandler* pFocusHandler = GetFocusHandler())
- pFocusHandler->OnSetFocus(this);
- }
-
- m_bFocus = TRUE;
-}
-
-void CPWL_Edit::OnKillFocus()
-{
- ShowVScrollBar(FALSE);
-
- m_pEdit->SelectNone();
- SetCaret(FALSE, CPDF_Point(0.0f,0.0f), CPDF_Point(0.0f,0.0f));
-
- SetCharSet(0);
-
- if (!IsReadOnly())
- {
- if (IPWL_FocusHandler* pFocusHandler = GetFocusHandler())
- pFocusHandler->OnKillFocus(this);
- }
-
- m_bFocus = FALSE;
-}
-
-void CPWL_Edit::SetHorzScale(FX_INT32 nHorzScale, FX_BOOL bPaint/* = TRUE*/)
-{
- m_pEdit->SetHorzScale(nHorzScale, bPaint);
-}
-
-void CPWL_Edit::SetCharSpace(FX_FLOAT fCharSpace, FX_BOOL bPaint/* = TRUE*/)
-{
- m_pEdit->SetCharSpace(fCharSpace, bPaint);
-}
-
-void CPWL_Edit::SetLineLeading(FX_FLOAT fLineLeading, FX_BOOL bPaint/* = TRUE*/)
-{
- m_pEdit->SetLineLeading(fLineLeading, bPaint);
-}
-
-CFX_ByteString CPWL_Edit::GetSelectAppearanceStream(const CPDF_Point & ptOffset) const
-{
- CPVT_WordRange wr = GetSelectWordRange();
- return CPWL_Utils::GetEditSelAppStream(m_pEdit,ptOffset,&wr);
-}
-
-CPVT_WordRange CPWL_Edit::GetSelectWordRange() const
-{
- if (m_pEdit->IsSelected())
- {
- FX_INT32 nStart = -1;
- FX_INT32 nEnd = -1;
-
- m_pEdit->GetSel(nStart, nEnd);
-
- CPVT_WordPlace wpStart = m_pEdit->WordIndexToWordPlace(nStart);
- CPVT_WordPlace wpEnd = m_pEdit->WordIndexToWordPlace(nEnd);
-
- return CPVT_WordRange(wpStart,wpEnd);
- }
-
- return CPVT_WordRange();
-}
-
-CFX_ByteString CPWL_Edit::GetTextAppearanceStream(const CPDF_Point & ptOffset) const
-{
- CFX_ByteTextBuf sRet;
- CFX_ByteString sEdit = CPWL_Utils::GetEditAppStream(m_pEdit,ptOffset);
-
- if (sEdit.GetLength() > 0)
- {
- sRet << "BT\n" << CPWL_Utils::GetColorAppStream(GetTextColor()) << sEdit << "ET\n";
- }
-
- return sRet.GetByteString();
-}
-
-CFX_ByteString CPWL_Edit::GetCaretAppearanceStream(const CPDF_Point & ptOffset) const
-{
- if (m_pEditCaret)
- return m_pEditCaret->GetCaretAppearanceStream(ptOffset);
-
- return CFX_ByteString();
-}
-
-CPDF_Point CPWL_Edit::GetWordRightBottomPoint(const CPVT_WordPlace& wpWord)
-{
- CPDF_Point pt(0.0f, 0.0f);
-
- if (IFX_Edit_Iterator * pIterator = m_pEdit->GetIterator())
- {
- CPVT_WordPlace wpOld = pIterator->GetAt();
- pIterator->SetAt(wpWord);
- CPVT_Word word;
- if (pIterator->GetWord(word))
- {
- pt = CPDF_Point(word.ptWord.x + word.fWidth, word.ptWord.y + word.fDescent);
- }
-
- pIterator->SetAt(wpOld);
- }
-
- return pt;
-}
-
-FX_BOOL CPWL_Edit::IsTextFull() const
-{
- return m_pEdit->IsTextFull();
-}
-
-FX_FLOAT CPWL_Edit::GetCharArrayAutoFontSize(CPDF_Font* pFont, const CPDF_Rect& rcPlate, FX_INT32 nCharArray)
-{
- if (pFont && !pFont->IsStandardFont())
- {
- FX_RECT rcBBox;
- pFont->GetFontBBox(rcBBox);
-
- CPDF_Rect rcCell = rcPlate;
- FX_FLOAT xdiv = rcCell.Width() / nCharArray * 1000.0f / rcBBox.Width();
- FX_FLOAT ydiv = - rcCell.Height() * 1000.0f / rcBBox.Height();
-
- return xdiv < ydiv ? xdiv : ydiv;
- }
-
- return 0.0f;
-}
-
-void CPWL_Edit::SetCharArray(FX_INT32 nCharArray)
-{
- if (HasFlag(PES_CHARARRAY) && nCharArray > 0)
- {
- m_pEdit->SetCharArray(nCharArray);
- m_pEdit->SetTextOverflow(TRUE);
-
- if (HasFlag(PWS_AUTOFONTSIZE))
- {
- if (IFX_Edit_FontMap* pFontMap = this->GetFontMap())
- {
- FX_FLOAT fFontSize = GetCharArrayAutoFontSize(pFontMap->GetPDFFont(0), GetClientRect(), nCharArray);
- if (fFontSize > 0.0f)
- {
- m_pEdit->SetAutoFontSize(FALSE);
- m_pEdit->SetFontSize(fFontSize);
- }
- }
- }
- }
-}
-
-void CPWL_Edit::SetLimitChar(FX_INT32 nLimitChar)
-{
- m_pEdit->SetLimitChar(nLimitChar);
-}
-
-void CPWL_Edit::ReplaceSel(FX_LPCWSTR csText)
-{
- m_pEdit->Clear();
- m_pEdit->InsertText(csText);
-}
-
-CPDF_Rect CPWL_Edit::GetFocusRect() const
-{
- return CPDF_Rect();
-}
-
-void CPWL_Edit::ShowVScrollBar(FX_BOOL bShow)
-{
- if (CPWL_ScrollBar * pScroll = GetVScrollBar())
- {
- if (bShow)
- {
- if (!pScroll->IsVisible())
- {
- pScroll->SetVisible(TRUE);
- CPDF_Rect rcWindow = GetWindowRect();
- m_rcOldWindow = rcWindow;
- rcWindow.right += PWL_SCROLLBAR_WIDTH;
- Move(rcWindow, TRUE, TRUE);
- }
- }
- else
- {
- if (pScroll->IsVisible())
- {
- pScroll->SetVisible(FALSE);
- Move(m_rcOldWindow, TRUE, TRUE);
- }
- }
- }
-}
-
-FX_BOOL CPWL_Edit::IsVScrollBarVisible() const
-{
- if (CPWL_ScrollBar * pScroll = GetVScrollBar())
- {
- return pScroll->IsVisible();
- }
-
- return FALSE;
-}
-
-void CPWL_Edit::EnableSpellCheck(FX_BOOL bEnabled)
-{
- if (bEnabled)
- AddFlag(PES_SPELLCHECK);
- else
- RemoveFlag(PES_SPELLCHECK);
-}
-
-FX_BOOL CPWL_Edit::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
-{
- if (m_bMouseDown) return TRUE;
-
- if (nChar == FWL_VKEY_Delete)
- {
- if (m_pFillerNotify)
- {
- FX_BOOL bRC = TRUE;
- FX_BOOL bExit = FALSE;
- CFX_WideString strChange;
- CFX_WideString strChangeEx;
-
- int nSelStart = 0;
- int nSelEnd = 0;
- GetSel(nSelStart, nSelEnd);
-
- if (nSelStart == nSelEnd)
- nSelEnd = nSelStart + 1;
- m_pFillerNotify->OnBeforeKeyStroke(TRUE, GetAttachedData(), FWL_VKEY_Delete, strChange, strChangeEx, nSelStart, nSelEnd, TRUE, bRC, bExit, nFlag);
- if (!bRC) return FALSE;
- if (bExit) return FALSE;
- }
- }
-
- FX_BOOL bRet = CPWL_EditCtrl::OnKeyDown(nChar, nFlag);
-
- if (nChar == FWL_VKEY_Delete)
- {
- if (m_pFillerNotify)
- {
- FX_BOOL bExit = FALSE;
- m_pFillerNotify->OnAfterKeyStroke(TRUE, GetAttachedData(), bExit,nFlag);
- if (bExit) return FALSE;
- }
- }
-
- //In case of implementation swallow the OnKeyDown event.
- if(IsProceedtoOnChar(nChar, nFlag))
- return TRUE;
-
- return bRet;
-}
-
-/**
-*In case of implementation swallow the OnKeyDown event.
-*If the event is swallowed, implementation may do other unexpected things, which is not the control means to do.
-*/
-FX_BOOL CPWL_Edit::IsProceedtoOnChar(FX_WORD nKeyCode, FX_DWORD nFlag)
-{
-
- FX_BOOL bCtrl = IsCTRLpressed(nFlag);
- FX_BOOL bAlt = IsALTpressed(nFlag);
- if(bCtrl && !bAlt)
- {
- //hot keys for edit control.
- switch(nKeyCode)
- {
- case 'C':
- case 'V':
- case 'X':
- case 'A':
- case 'Z':
- return TRUE;
- default:
- break;
- }
- }
- //control characters.
- switch(nKeyCode)
- {
- case FWL_VKEY_Escape:
- case FWL_VKEY_Back:
- case FWL_VKEY_Return:
- case FWL_VKEY_Space:
- return TRUE;
- default:
- break;
- }
- return FALSE;
-
-}
-
-FX_BOOL CPWL_Edit::OnChar(FX_WORD nChar, FX_DWORD nFlag)
-{
- if (m_bMouseDown) return TRUE;
-
- FX_BOOL bRC = TRUE;
- FX_BOOL bExit = FALSE;
-
- FX_BOOL bCtrl = IsCTRLpressed(nFlag);
- if (!bCtrl)
- {
- if (m_pFillerNotify)
- {
- CFX_WideString swChange;
- FX_INT32 nKeyCode;
-
- int nSelStart = 0;
- int nSelEnd = 0;
- GetSel(nSelStart, nSelEnd);
-
- switch (nChar)
- {
- case FWL_VKEY_Back:
- nKeyCode = nChar;
- if (nSelStart == nSelEnd)
- nSelStart = nSelEnd - 1;
- break;
- case FWL_VKEY_Return:
- nKeyCode = nChar;
- break;
- default:
- nKeyCode = 0;
- swChange += nChar;
- break;
- }
-
- CFX_WideString strChangeEx;
- m_pFillerNotify->OnBeforeKeyStroke(TRUE, GetAttachedData(), nKeyCode, swChange, strChangeEx, nSelStart, nSelEnd, TRUE, bRC, bExit, nFlag);
- }
- }
-
- if (!bRC) return TRUE;
- if (bExit) return FALSE;
-
- if (IFX_Edit_FontMap * pFontMap = GetFontMap())
- {
- FX_INT32 nOldCharSet = GetCharSet();
- FX_INT32 nNewCharSet = pFontMap->CharSetFromUnicode(nChar, DEFAULT_CHARSET);
- if(nOldCharSet != nNewCharSet)
- {
- SetCharSet(nNewCharSet);
- }
- }
- FX_BOOL bRet = CPWL_EditCtrl::OnChar(nChar,nFlag);
-
- if (!bCtrl)
- {
- if (m_pFillerNotify)
- {
- m_pFillerNotify->OnAfterKeyStroke(TRUE, GetAttachedData(), bExit,nFlag);
- if (bExit) return FALSE;
- }
- }
-
- return bRet;
-}
-
-FX_BOOL CPWL_Edit::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag)
-{
- if (HasFlag(PES_MULTILINE))
- {
- CPDF_Point ptScroll = GetScrollPos();
-
- if (zDelta > 0)
- {
- ptScroll.y += this->GetFontSize();
- }
- else
- {
- ptScroll.y -= this->GetFontSize();
- }
- this->SetScrollPos(ptScroll);
-
- return TRUE;
- }
-
- return FALSE;
-}
-
-void CPWL_Edit::OnInsertReturn(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace)
-{
- if (HasFlag(PES_SPELLCHECK))
- {
- m_pEdit->RefreshWordRange(CombineWordRange(GetLatinWordsRange(oldplace),GetLatinWordsRange(place)));
- }
-
- if (m_pEditNotify)
- {
- m_pEditNotify->OnInsertReturn(place, oldplace);
- }
-}
-
-void CPWL_Edit::OnBackSpace(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace)
-{
- if (HasFlag(PES_SPELLCHECK))
- {
- m_pEdit->RefreshWordRange(CombineWordRange(GetLatinWordsRange(oldplace),GetLatinWordsRange(place)));
- }
-
- if (m_pEditNotify)
- {
- m_pEditNotify->OnBackSpace(place, oldplace);
- }
-}
-
-void CPWL_Edit::OnDelete(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace)
-{
- if (HasFlag(PES_SPELLCHECK))
- {
- m_pEdit->RefreshWordRange(CombineWordRange(GetLatinWordsRange(oldplace),GetLatinWordsRange(place)));
- }
-
- if (m_pEditNotify)
- {
- m_pEditNotify->OnDelete(place, oldplace);
- }
-}
-
-void CPWL_Edit::OnClear(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace)
-{
- if (HasFlag(PES_SPELLCHECK))
- {
- m_pEdit->RefreshWordRange(CombineWordRange(GetLatinWordsRange(oldplace),GetLatinWordsRange(place)));
- }
-
- if (m_pEditNotify)
- {
- m_pEditNotify->OnClear(place, oldplace);
- }
-}
-
-void CPWL_Edit::OnInsertWord(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace)
-{
- if (HasFlag(PES_SPELLCHECK))
- {
- m_pEdit->RefreshWordRange(CombineWordRange(GetLatinWordsRange(oldplace),GetLatinWordsRange(place)));
- }
-
- if (m_pEditNotify)
- {
- m_pEditNotify->OnInsertWord(place, oldplace);
- }
-}
-
-void CPWL_Edit::OnSetText(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace)
-{
-}
-
-void CPWL_Edit::OnInsertText(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace)
-{
- if (HasFlag(PES_SPELLCHECK))
- {
- m_pEdit->RefreshWordRange(CombineWordRange(GetLatinWordsRange(oldplace),GetLatinWordsRange(place)));
- }
-
- if (m_pEditNotify)
- {
- m_pEditNotify->OnInsertText(place, oldplace);
- }
-}
-
-void CPWL_Edit::OnAddUndo(IFX_Edit_UndoItem* pUndoItem)
-{
- if (m_pEditNotify)
- {
- m_pEditNotify->OnAddUndo(this);
- }
-}
-
-CPVT_WordRange CPWL_Edit::CombineWordRange(const CPVT_WordRange& wr1, const CPVT_WordRange& wr2)
-{
- CPVT_WordRange wrRet;
-
- if (wr1.BeginPos.WordCmp(wr2.BeginPos) < 0)
- {
- wrRet.BeginPos = wr1.BeginPos;
- }
- else
- {
- wrRet.BeginPos = wr2.BeginPos;
- }
-
- if (wr1.EndPos.WordCmp(wr2.EndPos) < 0)
- {
- wrRet.EndPos = wr2.EndPos;
- }
- else
- {
- wrRet.EndPos = wr1.EndPos;
- }
-
- return wrRet;
-}
-
-CPVT_WordRange CPWL_Edit::GetLatinWordsRange(const CPDF_Point& point) const
-{
- return GetSameWordsRange(m_pEdit->SearchWordPlace(point), TRUE, FALSE);
-}
-
-CPVT_WordRange CPWL_Edit::GetLatinWordsRange(const CPVT_WordPlace & place) const
-{
- return GetSameWordsRange(place, TRUE, FALSE);
-}
-
-CPVT_WordRange CPWL_Edit::GetArabicWordsRange(const CPVT_WordPlace & place) const
-{
- return GetSameWordsRange(place, FALSE, TRUE);
-}
-
-#define PWL_ISARABICWORD(word) ((word >= 0x0600 && word <= 0x06FF) || (word >= 0xFB50 && word <= 0xFEFC))
-
-CPVT_WordRange CPWL_Edit::GetSameWordsRange(const CPVT_WordPlace & place, FX_BOOL bLatin, FX_BOOL bArabic) const
-{
- CPVT_WordRange range;
-
- if (IFX_Edit_Iterator* pIterator = m_pEdit->GetIterator())
- {
- CPVT_Word wordinfo;
- CPVT_WordPlace wpStart(place),wpEnd(place);
- pIterator->SetAt(place);
-
- if (bLatin)
- {
- while (pIterator->NextWord())
- {
- if (pIterator->GetWord(wordinfo) && FX_EDIT_ISLATINWORD(wordinfo.Word))
- {
- wpEnd = pIterator->GetAt();
- continue;
- }
- else
- break;
- };
- }
- else if (bArabic)
- {
- while (pIterator->NextWord())
- {
- if (pIterator->GetWord(wordinfo) && PWL_ISARABICWORD(wordinfo.Word))
- {
- wpEnd = pIterator->GetAt();
- continue;
- }
- else
- break;
- };
- }
-
- pIterator->SetAt(place);
-
- if (bLatin)
- {
- do
- {
- if (pIterator->GetWord(wordinfo) && FX_EDIT_ISLATINWORD(wordinfo.Word))
- {
- continue;
- }
- else
- {
- wpStart = pIterator->GetAt();
- break;
- }
- }
- while (pIterator->PrevWord());
- }
- else if (bArabic)
- {
- do
- {
- if (pIterator->GetWord(wordinfo) && PWL_ISARABICWORD(wordinfo.Word))
- {
- continue;
- }
- else
- {
- wpStart = pIterator->GetAt();
- break;
- }
- }
- while (pIterator->PrevWord());
- }
-
- range.Set(wpStart,wpEnd);
- }
-
- return range;
-}
-
-void CPWL_Edit::AjustArabicWords(const CPVT_WordRange& wr)
-{
-}
-
-void CPWL_Edit::GeneratePageObjects(CPDF_PageObjects* pPageObjects,
- const CPDF_Point& ptOffset, CFX_ArrayTemplate<CPDF_TextObject*>& ObjArray)
-{
- IFX_Edit::GeneratePageObjects(pPageObjects, m_pEdit, ptOffset, NULL, CPWL_Utils::PWLColorToFXColor(GetTextColor(),GetTransparency()), ObjArray);
-}
-
-void CPWL_Edit::GeneratePageObjects(CPDF_PageObjects* pPageObjects,
- const CPDF_Point& ptOffset)
-{
- CFX_ArrayTemplate<CPDF_TextObject*> ObjArray;
- IFX_Edit::GeneratePageObjects(pPageObjects, m_pEdit, ptOffset, NULL, CPWL_Utils::PWLColorToFXColor(GetTextColor(),GetTransparency()), ObjArray);
-}
-
+// 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
+
+#include "../../include/pdfwindow/PDFWindow.h"
+#include "../../include/pdfwindow/PWL_Wnd.h"
+#include "../../include/pdfwindow/PWL_EditCtrl.h"
+#include "../../include/pdfwindow/PWL_Edit.h"
+#include "../../include/pdfwindow/PWL_ScrollBar.h"
+#include "../../include/pdfwindow/PWL_Utils.h"
+#include "../../include/pdfwindow/PWL_Caret.h"
+#include "../../include/pdfwindow/PWL_FontMap.h"
+
+/* ---------------------------- CPWL_Edit ------------------------------ */
+
+CPWL_Edit::CPWL_Edit() : m_pFillerNotify(NULL),
+ m_pSpellCheck(NULL),
+ m_bFocus(FALSE)
+{
+ m_pFormFiller = NULL;
+}
+
+CPWL_Edit::~CPWL_Edit()
+{
+ ASSERT(m_bFocus == FALSE);
+}
+
+CFX_ByteString CPWL_Edit::GetClassName() const
+{
+ return PWL_CLASSNAME_EDIT;
+}
+
+void CPWL_Edit::OnDestroy()
+{
+}
+
+void CPWL_Edit::SetText(FX_LPCWSTR csText)
+{
+ CFX_WideString swText = csText;
+
+ if (HasFlag(PES_RICH))
+ {
+ CFX_ByteString sValue = CFX_ByteString::FromUnicode(swText);
+
+ if (CXML_Element * pXML = CXML_Element::Parse((FX_LPCSTR)sValue,sValue.GetLength()))
+ {
+ FX_INT32 nCount = pXML->CountChildren();
+ FX_BOOL bFirst = TRUE;
+
+ swText.Empty();
+
+ for (FX_INT32 i=0; i<nCount; i++)
+ {
+ if (CXML_Element * pSubElement = pXML->GetElement(i))
+ {
+ CFX_ByteString tag=pSubElement->GetTagName();
+ if (tag.EqualNoCase("p"))
+ {
+ int nChild = pSubElement->CountChildren();
+ CFX_WideString swSection;
+ for(FX_INT32 j=0; j<nChild; j++)
+ {
+ swSection += pSubElement->GetContent(j);
+ }
+
+ if (bFirst)bFirst = FALSE;
+ else
+ swText += FWL_VKEY_Return;
+ swText += swSection;
+ }
+ }
+ }
+
+ delete pXML;
+ }
+ }
+
+ m_pEdit->SetText(swText);
+}
+
+void CPWL_Edit::RePosChildWnd()
+{
+ if (CPWL_ScrollBar * pVSB = this->GetVScrollBar())
+ {
+ //if (pVSB->IsVisible())
+ {
+ CPDF_Rect rcWindow = m_rcOldWindow;
+ CPDF_Rect rcVScroll = CPDF_Rect(rcWindow.right,
+ rcWindow.bottom,
+ rcWindow.right + PWL_SCROLLBAR_WIDTH,
+ rcWindow.top);
+ pVSB->Move(rcVScroll, TRUE, FALSE);
+ }
+ }
+
+ if (m_pEditCaret && !HasFlag(PES_TEXTOVERFLOW))
+ m_pEditCaret->SetClipRect(CPWL_Utils::InflateRect(GetClientRect(),1.0f)); //+1 for caret beside border
+
+ CPWL_EditCtrl::RePosChildWnd();
+}
+
+CPDF_Rect CPWL_Edit::GetClientRect() const
+{
+ CPDF_Rect rcClient = CPWL_Utils::DeflateRect(GetWindowRect(),(FX_FLOAT)(GetBorderWidth()+GetInnerBorderWidth()));
+
+ if (CPWL_ScrollBar * pVSB = this->GetVScrollBar())
+ {
+ if (pVSB->IsVisible())
+ {
+ rcClient.right -= PWL_SCROLLBAR_WIDTH;
+ }
+ }
+
+ return rcClient;
+}
+
+void CPWL_Edit::SetAlignFormatH(PWL_EDIT_ALIGNFORMAT_H nFormat, FX_BOOL bPaint/* = TRUE*/)
+{
+ m_pEdit->SetAlignmentH((FX_INT32)nFormat, bPaint);
+}
+
+void CPWL_Edit::SetAlignFormatV(PWL_EDIT_ALIGNFORMAT_V nFormat, FX_BOOL bPaint/* = TRUE*/)
+{
+ m_pEdit->SetAlignmentV((FX_INT32)nFormat, bPaint);
+}
+
+FX_BOOL CPWL_Edit::CanSelectAll() const
+{
+ return GetSelectWordRange() != m_pEdit->GetWholeWordRange();
+}
+
+FX_BOOL CPWL_Edit::CanClear() const
+{
+ return !IsReadOnly() && m_pEdit->IsSelected();
+}
+
+FX_BOOL CPWL_Edit::CanCopy() const
+{
+ return !HasFlag(PES_PASSWORD) && !HasFlag(PES_NOREAD) && m_pEdit->IsSelected();
+}
+
+FX_BOOL CPWL_Edit::CanCut() const
+{
+ return CanCopy() && !IsReadOnly();
+}
+
+FX_BOOL CPWL_Edit::CanPaste() const
+{
+ if (IsReadOnly()) return FALSE;
+
+ CFX_WideString swClipboard;
+ if (IFX_SystemHandler* pSH = GetSystemHandler())
+ swClipboard = pSH->GetClipboardText(GetAttachedHWnd());
+
+ return !swClipboard.IsEmpty();
+}
+
+void CPWL_Edit::CopyText()
+{
+ if (!CanCopy()) return;
+
+ CFX_WideString str = m_pEdit->GetSelText();
+
+ if (IFX_SystemHandler* pSH = GetSystemHandler())
+ pSH->SetClipboardText(GetAttachedHWnd(), str);
+}
+
+void CPWL_Edit::PasteText()
+{
+ if (!CanPaste()) return;
+
+ CFX_WideString swClipboard;
+ if (IFX_SystemHandler* pSH = GetSystemHandler())
+ swClipboard = pSH->GetClipboardText(GetAttachedHWnd());
+
+ if (m_pFillerNotify)
+ {
+ FX_BOOL bRC = TRUE;
+ FX_BOOL bExit = FALSE;
+ CFX_WideString strChangeEx;
+ int nSelStart = 0;
+ int nSelEnd = 0;
+ GetSel(nSelStart, nSelEnd);
+ m_pFillerNotify->OnBeforeKeyStroke(TRUE, GetAttachedData(), 0 , swClipboard, strChangeEx, nSelStart, nSelEnd, TRUE, bRC, bExit, 0);
+ if (!bRC) return;
+ if (bExit) return;
+ }
+
+ if (swClipboard.GetLength() > 0)
+ {
+ Clear();
+ InsertText(swClipboard);
+ }
+
+ if (m_pFillerNotify)
+ {
+ FX_BOOL bExit = FALSE;
+ m_pFillerNotify->OnAfterKeyStroke(TRUE, GetAttachedData(), bExit,0);
+ if (bExit) return;
+ }
+}
+
+void CPWL_Edit::CutText()
+{
+ if (!CanCut()) return;
+
+ CFX_WideString str = m_pEdit->GetSelText();
+
+ if (IFX_SystemHandler* pSH = GetSystemHandler())
+ pSH->SetClipboardText(GetAttachedHWnd(), str);
+
+ m_pEdit->Clear();
+}
+
+void CPWL_Edit::OnCreated()
+{
+ CPWL_EditCtrl::OnCreated();
+
+ if (CPWL_ScrollBar * pScroll = GetVScrollBar())
+ {
+ pScroll->RemoveFlag(PWS_AUTOTRANSPARENT);
+ pScroll->SetTransparency(255);
+ }
+
+ SetParamByFlag();
+
+ m_rcOldWindow = GetWindowRect();
+
+ m_pEdit->SetOprNotify(this);
+ m_pEdit->EnableOprNotify(TRUE);
+}
+
+void CPWL_Edit::SetParamByFlag()
+{
+ if (HasFlag(PES_RIGHT))
+ {
+ m_pEdit->SetAlignmentH(2, FALSE);
+ }
+ else if (HasFlag(PES_MIDDLE))
+ {
+ m_pEdit->SetAlignmentH(1, FALSE);
+ }
+ else
+ {
+ m_pEdit->SetAlignmentH(0, FALSE);
+ }
+
+ if (HasFlag(PES_BOTTOM))
+ {
+ m_pEdit->SetAlignmentV(2, FALSE);
+ }
+ else if (HasFlag(PES_CENTER))
+ {
+ m_pEdit->SetAlignmentV(1, FALSE);
+ }
+ else
+ {
+ m_pEdit->SetAlignmentV(0, FALSE);
+ }
+
+ if (HasFlag(PES_PASSWORD))
+ {
+ m_pEdit->SetPasswordChar('*', FALSE);
+ }
+
+ m_pEdit->SetMultiLine(HasFlag(PES_MULTILINE), FALSE);
+ m_pEdit->SetAutoReturn(HasFlag(PES_AUTORETURN), FALSE);
+ m_pEdit->SetAutoFontSize(HasFlag(PWS_AUTOFONTSIZE), FALSE);
+ m_pEdit->SetAutoScroll(HasFlag(PES_AUTOSCROLL), FALSE);
+ m_pEdit->EnableUndo(HasFlag(PES_UNDO));
+
+ if (HasFlag(PES_TEXTOVERFLOW))
+ {
+ SetClipRect(CPDF_Rect(0.0f,0.0f,0.0f,0.0f));
+ m_pEdit->SetTextOverflow(TRUE, FALSE);
+ }
+ else
+ {
+ if (m_pEditCaret)
+ {
+ m_pEditCaret->SetClipRect(CPWL_Utils::InflateRect(GetClientRect(),1.0f)); //+1 for caret beside border
+ }
+ }
+
+ if (HasFlag(PES_SPELLCHECK))
+ {
+ m_pSpellCheck = GetCreationParam().pSpellCheck;
+ }
+}
+
+void CPWL_Edit::GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream)
+{
+ CPWL_Wnd::GetThisAppearanceStream(sAppStream);
+
+ CPDF_Rect rcClient = GetClientRect();
+ CFX_ByteTextBuf sLine;
+
+ FX_INT32 nCharArray = m_pEdit->GetCharArray();
+
+ if (nCharArray > 0)
+ {
+ switch (GetBorderStyle())
+ {
+ case PBS_SOLID:
+ {
+ sLine << "q\n" << GetBorderWidth() << " w\n"
+ << CPWL_Utils::GetColorAppStream(GetBorderColor(),FALSE) << " 2 J 0 j\n";
+
+ for (FX_INT32 i=1;i<nCharArray;i++)
+ {
+ sLine << rcClient.left + ((rcClient.right - rcClient.left)/nCharArray)*i << " "
+ << rcClient.bottom << " m\n"
+ << rcClient.left + ((rcClient.right - rcClient.left)/nCharArray)*i << " "
+ << rcClient.top << " l S\n";
+ }
+
+ sLine << "Q\n";
+ }
+ break;
+ case PBS_DASH:
+ {
+ sLine << "q\n" << GetBorderWidth() << " w\n"
+ << CPWL_Utils::GetColorAppStream(GetBorderColor(),FALSE) << " 2 J 0 j\n"
+ << "[" << GetBorderDash().nDash << " "
+ << GetBorderDash().nGap << "] "
+ << GetBorderDash().nPhase << " d\n";
+
+ for (FX_INT32 i=1;i<nCharArray;i++)
+ {
+ sLine << rcClient.left + ((rcClient.right - rcClient.left)/nCharArray)*i << " "
+ << rcClient.bottom << " m\n"
+ << rcClient.left + ((rcClient.right - rcClient.left)/nCharArray)*i << " "
+ << rcClient.top << " l S\n";
+ }
+
+ sLine << "Q\n";
+ }
+ break;
+ }
+ }
+
+ sAppStream << sLine;
+
+ CFX_ByteTextBuf sText;
+
+ CPDF_Point ptOffset = CPDF_Point(0.0f,0.0f);
+
+ CPVT_WordRange wrWhole = m_pEdit->GetWholeWordRange();
+ CPVT_WordRange wrSelect = GetSelectWordRange();
+ CPVT_WordRange wrVisible = (HasFlag(PES_TEXTOVERFLOW) ? wrWhole : m_pEdit->GetVisibleWordRange());
+ CPVT_WordRange wrSelBefore(wrWhole.BeginPos,wrSelect.BeginPos);
+ CPVT_WordRange wrSelAfter(wrSelect.EndPos,wrWhole.EndPos);
+
+ CPVT_WordRange wrTemp = CPWL_Utils::OverlapWordRange(GetSelectWordRange(),wrVisible);
+ CFX_ByteString sEditSel = CPWL_Utils::GetEditSelAppStream(m_pEdit, ptOffset,
+ &wrTemp);
+
+ if (sEditSel.GetLength() > 0)
+ sText << CPWL_Utils::GetColorAppStream(PWL_DEFAULT_SELBACKCOLOR) << sEditSel ;
+
+ wrTemp = CPWL_Utils::OverlapWordRange(wrVisible,wrSelBefore);
+ CFX_ByteString sEditBefore = CPWL_Utils::GetEditAppStream(m_pEdit, ptOffset,
+ &wrTemp, !HasFlag(PES_CHARARRAY), m_pEdit->GetPasswordChar());
+
+ if (sEditBefore.GetLength() > 0)
+ sText << "BT\n" << CPWL_Utils::GetColorAppStream(GetTextColor()) << sEditBefore << "ET\n";
+
+ wrTemp = CPWL_Utils::OverlapWordRange(wrVisible,wrSelect);
+ CFX_ByteString sEditMid = CPWL_Utils::GetEditAppStream(m_pEdit, ptOffset,
+ &wrTemp, !HasFlag(PES_CHARARRAY), m_pEdit->GetPasswordChar());
+
+ if (sEditMid.GetLength() > 0)
+ sText << "BT\n" << CPWL_Utils::GetColorAppStream(CPWL_Color(COLORTYPE_GRAY,1)) << sEditMid << "ET\n";
+
+ wrTemp = CPWL_Utils::OverlapWordRange(wrVisible,wrSelAfter);
+ CFX_ByteString sEditAfter = CPWL_Utils::GetEditAppStream(m_pEdit, ptOffset,
+ &wrTemp, !HasFlag(PES_CHARARRAY), m_pEdit->GetPasswordChar());
+
+ if (sEditAfter.GetLength() > 0)
+ sText << "BT\n" << CPWL_Utils::GetColorAppStream(GetTextColor()) << sEditAfter<< "ET\n";
+
+ if (HasFlag(PES_SPELLCHECK))
+ {
+ CFX_ByteString sSpellCheck = CPWL_Utils::GetSpellCheckAppStream(m_pEdit, m_pSpellCheck, ptOffset, &wrVisible);
+ if (sSpellCheck.GetLength() > 0)
+ sText << CPWL_Utils::GetColorAppStream(CPWL_Color(COLORTYPE_RGB,1,0,0),FALSE) << sSpellCheck;
+ }
+
+ if (sText.GetLength() > 0)
+ {
+ CPDF_Rect rcClient = this->GetClientRect();
+ sAppStream << "q\n/Tx BMC\n";
+
+ if (!HasFlag(PES_TEXTOVERFLOW))
+ sAppStream << rcClient.left << " " << rcClient.bottom << " "
+ << rcClient.right - rcClient.left << " " << rcClient.top - rcClient.bottom << " re W n\n";
+
+ sAppStream << sText;
+
+ sAppStream << "EMC\nQ\n";
+ }
+}
+
+void CPWL_Edit::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device)
+{
+ CPWL_Wnd::DrawThisAppearance(pDevice,pUser2Device);
+
+ CPDF_Rect rcClient = GetClientRect();
+ CFX_ByteTextBuf sLine;
+
+ FX_INT32 nCharArray = m_pEdit->GetCharArray();
+
+ if (nCharArray > 0)
+ {
+ switch (GetBorderStyle())
+ {
+ case PBS_SOLID:
+ {
+ CFX_GraphStateData gsd;
+ gsd.m_LineWidth = (FX_FLOAT)GetBorderWidth();
+
+ CFX_PathData path;
+ path.SetPointCount((nCharArray-1)*2);
+
+ for (FX_INT32 i=0; i<nCharArray-1; i++)
+ {
+ path.SetPoint(i*2, rcClient.left + ((rcClient.right - rcClient.left)/nCharArray)*(i+1),
+ rcClient.bottom, FXPT_MOVETO);
+ path.SetPoint(i*2+1, rcClient.left + ((rcClient.right - rcClient.left)/nCharArray)*(i+1),
+ rcClient.top, FXPT_LINETO);
+ }
+ if (path.GetPointCount() > 0)
+ pDevice->DrawPath(&path, pUser2Device, &gsd,0,
+ CPWL_Utils::PWLColorToFXColor(GetBorderColor(),255), FXFILL_ALTERNATE);
+ }
+ break;
+ case PBS_DASH:
+ {
+ CFX_GraphStateData gsd;
+ gsd.m_LineWidth = (FX_FLOAT)GetBorderWidth();
+
+ gsd.SetDashCount(2);
+ gsd.m_DashArray[0] = (FX_FLOAT)GetBorderDash().nDash;
+ gsd.m_DashArray[1] = (FX_FLOAT)GetBorderDash().nGap;
+ gsd.m_DashPhase = (FX_FLOAT)GetBorderDash().nPhase;
+
+ CFX_PathData path;
+ path.SetPointCount((nCharArray-1)*2);
+
+ for (FX_INT32 i=0; i<nCharArray-1; i++)
+ {
+ path.SetPoint(i*2, rcClient.left + ((rcClient.right - rcClient.left)/nCharArray)*(i+1),
+ rcClient.bottom, FXPT_MOVETO);
+ path.SetPoint(i*2+1, rcClient.left + ((rcClient.right - rcClient.left)/nCharArray)*(i+1),
+ rcClient.top, FXPT_LINETO);
+ }
+ if (path.GetPointCount() > 0)
+ pDevice->DrawPath(&path, pUser2Device, &gsd,0,
+ CPWL_Utils::PWLColorToFXColor(GetBorderColor(),255), FXFILL_ALTERNATE);
+ }
+ break;
+ }
+ }
+
+ CPDF_Rect rcClip;
+ CPVT_WordRange wrRange = m_pEdit->GetVisibleWordRange();
+ CPVT_WordRange* pRange = NULL;
+
+ if (!HasFlag(PES_TEXTOVERFLOW))
+ {
+ rcClip = GetClientRect();
+ pRange = &wrRange;
+ }
+IFX_SystemHandler* pSysHandler = GetSystemHandler();
+ IFX_Edit::DrawEdit(pDevice,pUser2Device,m_pEdit,
+ CPWL_Utils::PWLColorToFXColor(GetTextColor(),this->GetTransparency()),
+ CPWL_Utils::PWLColorToFXColor(GetTextStrokeColor(),this->GetTransparency()),
+ rcClip,CPDF_Point(0.0f,0.0f),pRange, pSysHandler, m_pFormFiller);
+
+ if (HasFlag(PES_SPELLCHECK))
+ {
+ CPWL_Utils::DrawEditSpellCheck(pDevice,pUser2Device,m_pEdit,rcClip,
+ CPDF_Point(0.0f,0.0f),pRange, this->GetCreationParam().pSpellCheck);
+ }
+}
+
+FX_BOOL CPWL_Edit::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
+{
+ CPWL_Wnd::OnLButtonDown(point,nFlag);
+
+ if (HasFlag(PES_TEXTOVERFLOW) || ClientHitTest(point))
+ {
+ if (m_bMouseDown)
+ this->InvalidateRect();
+
+ m_bMouseDown = TRUE;
+ SetCapture();
+
+ m_pEdit->OnMouseDown(point,IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
+ }
+
+ return TRUE;
+}
+
+FX_BOOL CPWL_Edit::OnLButtonDblClk(const CPDF_Point & point, FX_DWORD nFlag)
+{
+ CPWL_Wnd::OnLButtonDblClk(point, nFlag);
+
+ if (HasFlag(PES_TEXTOVERFLOW) || ClientHitTest(point))
+ {
+ m_pEdit->SelectAll();
+ }
+
+ return TRUE;
+}
+
+#define WM_PWLEDIT_UNDO 0x01
+#define WM_PWLEDIT_REDO 0x02
+#define WM_PWLEDIT_CUT 0x03
+#define WM_PWLEDIT_COPY 0x04
+#define WM_PWLEDIT_PASTE 0x05
+#define WM_PWLEDIT_DELETE 0x06
+#define WM_PWLEDIT_SELECTALL 0x07
+#define WM_PWLEDIT_SUGGEST 0x08
+
+FX_BOOL CPWL_Edit::OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
+{
+ if (m_bMouseDown) return FALSE;
+
+ CPWL_Wnd::OnRButtonUp(point, nFlag);
+
+ if (!HasFlag(PES_TEXTOVERFLOW) && !ClientHitTest(point)) return TRUE;
+
+ IFX_SystemHandler* pSH = GetSystemHandler();
+ if (!pSH) return FALSE;
+
+ this->SetFocus();
+
+ CPVT_WordRange wrLatin = GetLatinWordsRange(point);
+ CFX_WideString swLatin = m_pEdit->GetRangeText(wrLatin);
+
+ FX_HMENU hPopup = pSH->CreatePopupMenu();
+ if (!hPopup) return FALSE;
+
+ CFX_ByteStringArray sSuggestWords;
+ CPDF_Point ptPopup = point;
+
+ if (!IsReadOnly())
+ {
+ if (HasFlag(PES_SPELLCHECK) && !swLatin.IsEmpty())
+ {
+ if (m_pSpellCheck)
+ {
+ CFX_ByteString sLatin = CFX_ByteString::FromUnicode(swLatin);
+
+ if (!m_pSpellCheck->CheckWord(sLatin))
+ {
+ m_pSpellCheck->SuggestWords(sLatin,sSuggestWords);
+
+ FX_INT32 nSuggest = sSuggestWords.GetSize();
+
+ for (FX_INT32 nWord=0; nWord<nSuggest; nWord++)
+ {
+ pSH->AppendMenuItem(hPopup, WM_PWLEDIT_SUGGEST+nWord, sSuggestWords[nWord].UTF8Decode());
+ }
+
+ if (nSuggest > 0)
+ pSH->AppendMenuItem(hPopup, 0, L"");
+
+ ptPopup = GetWordRightBottomPoint(wrLatin.EndPos);
+ }
+ }
+ }
+ }
+
+ IPWL_Provider* pProvider = this->GetProvider();
+
+ if (HasFlag(PES_UNDO))
+ {
+ pSH->AppendMenuItem(hPopup, WM_PWLEDIT_UNDO,
+ pProvider ? pProvider->LoadPopupMenuString(0) : L"&Undo");
+ pSH->AppendMenuItem(hPopup, WM_PWLEDIT_REDO,
+ pProvider ? pProvider->LoadPopupMenuString(1) : L"&Redo");
+ pSH->AppendMenuItem(hPopup, 0, L"");
+
+ if (!m_pEdit->CanUndo())
+ pSH->EnableMenuItem(hPopup, WM_PWLEDIT_UNDO, FALSE);
+ if (!m_pEdit->CanRedo())
+ pSH->EnableMenuItem(hPopup, WM_PWLEDIT_REDO, FALSE);
+ }
+
+ pSH->AppendMenuItem(hPopup, WM_PWLEDIT_CUT,
+ pProvider ? pProvider->LoadPopupMenuString(2) : L"Cu&t");
+ pSH->AppendMenuItem(hPopup, WM_PWLEDIT_COPY,
+ pProvider ? pProvider->LoadPopupMenuString(3) : L"&Copy");
+ pSH->AppendMenuItem(hPopup, WM_PWLEDIT_PASTE,
+ pProvider ? pProvider->LoadPopupMenuString(4) : L"&Paste");
+ pSH->AppendMenuItem(hPopup, WM_PWLEDIT_DELETE,
+ pProvider ? pProvider->LoadPopupMenuString(5) : L"&Delete");
+
+ CFX_WideString swText = pSH->GetClipboardText(this->GetAttachedHWnd());
+ if (swText.IsEmpty())
+ pSH->EnableMenuItem(hPopup, WM_PWLEDIT_PASTE, FALSE);
+
+ if (!m_pEdit->IsSelected())
+ {
+ pSH->EnableMenuItem(hPopup, WM_PWLEDIT_CUT, FALSE);
+ pSH->EnableMenuItem(hPopup, WM_PWLEDIT_COPY, FALSE);
+ pSH->EnableMenuItem(hPopup, WM_PWLEDIT_DELETE, FALSE);
+ }
+
+ if (IsReadOnly())
+ {
+ pSH->EnableMenuItem(hPopup, WM_PWLEDIT_CUT, FALSE);
+ pSH->EnableMenuItem(hPopup, WM_PWLEDIT_DELETE, FALSE);
+ pSH->EnableMenuItem(hPopup, WM_PWLEDIT_PASTE, FALSE);
+ }
+
+ if (HasFlag(PES_PASSWORD))
+ {
+ pSH->EnableMenuItem(hPopup, WM_PWLEDIT_CUT, FALSE);
+ pSH->EnableMenuItem(hPopup, WM_PWLEDIT_COPY, FALSE);
+ }
+
+ if (HasFlag(PES_NOREAD))
+ {
+ pSH->EnableMenuItem(hPopup, WM_PWLEDIT_CUT, FALSE);
+ pSH->EnableMenuItem(hPopup, WM_PWLEDIT_COPY, FALSE);
+ }
+
+ pSH->AppendMenuItem(hPopup, 0, L"");
+ pSH->AppendMenuItem(hPopup, WM_PWLEDIT_SELECTALL,
+ pProvider ? pProvider->LoadPopupMenuString(6) : L"&Select All");
+
+ if (m_pEdit->GetTotalWords() == 0)
+ {
+ pSH->EnableMenuItem(hPopup, WM_PWLEDIT_SELECTALL, FALSE);
+ }
+
+ FX_INT32 x, y;
+ PWLtoWnd(ptPopup, x, y);
+ pSH->ClientToScreen(GetAttachedHWnd(), x, y);
+ pSH->SetCursor(FXCT_ARROW);
+ FX_INT32 nCmd = pSH->TrackPopupMenu(hPopup,
+ x,
+ y,
+ GetAttachedHWnd());
+
+
+ switch (nCmd)
+ {
+ case WM_PWLEDIT_UNDO:
+ Undo();
+ break;
+ case WM_PWLEDIT_REDO:
+ Redo();
+ break;
+ case WM_PWLEDIT_CUT:
+ this->CutText();
+ break;
+ case WM_PWLEDIT_COPY:
+ this->CopyText();
+ break;
+ case WM_PWLEDIT_PASTE:
+ this->PasteText();
+ break;
+ case WM_PWLEDIT_DELETE:
+ this->Clear();
+ break;
+ case WM_PWLEDIT_SELECTALL:
+ this->SelectAll();
+ break;
+ case WM_PWLEDIT_SUGGEST + 0:
+ SetSel(m_pEdit->WordPlaceToWordIndex(wrLatin.BeginPos),m_pEdit->WordPlaceToWordIndex(wrLatin.EndPos));
+ ReplaceSel(sSuggestWords[0].UTF8Decode());
+ break;
+ case WM_PWLEDIT_SUGGEST + 1:
+ SetSel(m_pEdit->WordPlaceToWordIndex(wrLatin.BeginPos),m_pEdit->WordPlaceToWordIndex(wrLatin.EndPos));
+ ReplaceSel(sSuggestWords[1].UTF8Decode());
+ break;
+ case WM_PWLEDIT_SUGGEST + 2:
+ SetSel(m_pEdit->WordPlaceToWordIndex(wrLatin.BeginPos),m_pEdit->WordPlaceToWordIndex(wrLatin.EndPos));
+ ReplaceSel(sSuggestWords[2].UTF8Decode());
+ break;
+ case WM_PWLEDIT_SUGGEST + 3:
+ SetSel(m_pEdit->WordPlaceToWordIndex(wrLatin.BeginPos),m_pEdit->WordPlaceToWordIndex(wrLatin.EndPos));
+ ReplaceSel(sSuggestWords[3].UTF8Decode());
+ break;
+ case WM_PWLEDIT_SUGGEST + 4:
+ SetSel(m_pEdit->WordPlaceToWordIndex(wrLatin.BeginPos),m_pEdit->WordPlaceToWordIndex(wrLatin.EndPos));
+ ReplaceSel(sSuggestWords[4].UTF8Decode());
+ break;
+ default:
+ break;
+ }
+
+ pSH->DestroyMenu(hPopup);
+
+ return TRUE;
+}
+
+void CPWL_Edit::OnSetFocus()
+{
+ SetEditCaret(TRUE);
+
+ if (!IsReadOnly())
+ {
+ if (IPWL_FocusHandler* pFocusHandler = GetFocusHandler())
+ pFocusHandler->OnSetFocus(this);
+ }
+
+ m_bFocus = TRUE;
+}
+
+void CPWL_Edit::OnKillFocus()
+{
+ ShowVScrollBar(FALSE);
+
+ m_pEdit->SelectNone();
+ SetCaret(FALSE, CPDF_Point(0.0f,0.0f), CPDF_Point(0.0f,0.0f));
+
+ SetCharSet(0);
+
+ if (!IsReadOnly())
+ {
+ if (IPWL_FocusHandler* pFocusHandler = GetFocusHandler())
+ pFocusHandler->OnKillFocus(this);
+ }
+
+ m_bFocus = FALSE;
+}
+
+void CPWL_Edit::SetHorzScale(FX_INT32 nHorzScale, FX_BOOL bPaint/* = TRUE*/)
+{
+ m_pEdit->SetHorzScale(nHorzScale, bPaint);
+}
+
+void CPWL_Edit::SetCharSpace(FX_FLOAT fCharSpace, FX_BOOL bPaint/* = TRUE*/)
+{
+ m_pEdit->SetCharSpace(fCharSpace, bPaint);
+}
+
+void CPWL_Edit::SetLineLeading(FX_FLOAT fLineLeading, FX_BOOL bPaint/* = TRUE*/)
+{
+ m_pEdit->SetLineLeading(fLineLeading, bPaint);
+}
+
+CFX_ByteString CPWL_Edit::GetSelectAppearanceStream(const CPDF_Point & ptOffset) const
+{
+ CPVT_WordRange wr = GetSelectWordRange();
+ return CPWL_Utils::GetEditSelAppStream(m_pEdit,ptOffset,&wr);
+}
+
+CPVT_WordRange CPWL_Edit::GetSelectWordRange() const
+{
+ if (m_pEdit->IsSelected())
+ {
+ FX_INT32 nStart = -1;
+ FX_INT32 nEnd = -1;
+
+ m_pEdit->GetSel(nStart, nEnd);
+
+ CPVT_WordPlace wpStart = m_pEdit->WordIndexToWordPlace(nStart);
+ CPVT_WordPlace wpEnd = m_pEdit->WordIndexToWordPlace(nEnd);
+
+ return CPVT_WordRange(wpStart,wpEnd);
+ }
+
+ return CPVT_WordRange();
+}
+
+CFX_ByteString CPWL_Edit::GetTextAppearanceStream(const CPDF_Point & ptOffset) const
+{
+ CFX_ByteTextBuf sRet;
+ CFX_ByteString sEdit = CPWL_Utils::GetEditAppStream(m_pEdit,ptOffset);
+
+ if (sEdit.GetLength() > 0)
+ {
+ sRet << "BT\n" << CPWL_Utils::GetColorAppStream(GetTextColor()) << sEdit << "ET\n";
+ }
+
+ return sRet.GetByteString();
+}
+
+CFX_ByteString CPWL_Edit::GetCaretAppearanceStream(const CPDF_Point & ptOffset) const
+{
+ if (m_pEditCaret)
+ return m_pEditCaret->GetCaretAppearanceStream(ptOffset);
+
+ return CFX_ByteString();
+}
+
+CPDF_Point CPWL_Edit::GetWordRightBottomPoint(const CPVT_WordPlace& wpWord)
+{
+ CPDF_Point pt(0.0f, 0.0f);
+
+ if (IFX_Edit_Iterator * pIterator = m_pEdit->GetIterator())
+ {
+ CPVT_WordPlace wpOld = pIterator->GetAt();
+ pIterator->SetAt(wpWord);
+ CPVT_Word word;
+ if (pIterator->GetWord(word))
+ {
+ pt = CPDF_Point(word.ptWord.x + word.fWidth, word.ptWord.y + word.fDescent);
+ }
+
+ pIterator->SetAt(wpOld);
+ }
+
+ return pt;
+}
+
+FX_BOOL CPWL_Edit::IsTextFull() const
+{
+ return m_pEdit->IsTextFull();
+}
+
+FX_FLOAT CPWL_Edit::GetCharArrayAutoFontSize(CPDF_Font* pFont, const CPDF_Rect& rcPlate, FX_INT32 nCharArray)
+{
+ if (pFont && !pFont->IsStandardFont())
+ {
+ FX_RECT rcBBox;
+ pFont->GetFontBBox(rcBBox);
+
+ CPDF_Rect rcCell = rcPlate;
+ FX_FLOAT xdiv = rcCell.Width() / nCharArray * 1000.0f / rcBBox.Width();
+ FX_FLOAT ydiv = - rcCell.Height() * 1000.0f / rcBBox.Height();
+
+ return xdiv < ydiv ? xdiv : ydiv;
+ }
+
+ return 0.0f;
+}
+
+void CPWL_Edit::SetCharArray(FX_INT32 nCharArray)
+{
+ if (HasFlag(PES_CHARARRAY) && nCharArray > 0)
+ {
+ m_pEdit->SetCharArray(nCharArray);
+ m_pEdit->SetTextOverflow(TRUE);
+
+ if (HasFlag(PWS_AUTOFONTSIZE))
+ {
+ if (IFX_Edit_FontMap* pFontMap = this->GetFontMap())
+ {
+ FX_FLOAT fFontSize = GetCharArrayAutoFontSize(pFontMap->GetPDFFont(0), GetClientRect(), nCharArray);
+ if (fFontSize > 0.0f)
+ {
+ m_pEdit->SetAutoFontSize(FALSE);
+ m_pEdit->SetFontSize(fFontSize);
+ }
+ }
+ }
+ }
+}
+
+void CPWL_Edit::SetLimitChar(FX_INT32 nLimitChar)
+{
+ m_pEdit->SetLimitChar(nLimitChar);
+}
+
+void CPWL_Edit::ReplaceSel(FX_LPCWSTR csText)
+{
+ m_pEdit->Clear();
+ m_pEdit->InsertText(csText);
+}
+
+CPDF_Rect CPWL_Edit::GetFocusRect() const
+{
+ return CPDF_Rect();
+}
+
+void CPWL_Edit::ShowVScrollBar(FX_BOOL bShow)
+{
+ if (CPWL_ScrollBar * pScroll = GetVScrollBar())
+ {
+ if (bShow)
+ {
+ if (!pScroll->IsVisible())
+ {
+ pScroll->SetVisible(TRUE);
+ CPDF_Rect rcWindow = GetWindowRect();
+ m_rcOldWindow = rcWindow;
+ rcWindow.right += PWL_SCROLLBAR_WIDTH;
+ Move(rcWindow, TRUE, TRUE);
+ }
+ }
+ else
+ {
+ if (pScroll->IsVisible())
+ {
+ pScroll->SetVisible(FALSE);
+ Move(m_rcOldWindow, TRUE, TRUE);
+ }
+ }
+ }
+}
+
+FX_BOOL CPWL_Edit::IsVScrollBarVisible() const
+{
+ if (CPWL_ScrollBar * pScroll = GetVScrollBar())
+ {
+ return pScroll->IsVisible();
+ }
+
+ return FALSE;
+}
+
+void CPWL_Edit::EnableSpellCheck(FX_BOOL bEnabled)
+{
+ if (bEnabled)
+ AddFlag(PES_SPELLCHECK);
+ else
+ RemoveFlag(PES_SPELLCHECK);
+}
+
+FX_BOOL CPWL_Edit::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
+{
+ if (m_bMouseDown) return TRUE;
+
+ if (nChar == FWL_VKEY_Delete)
+ {
+ if (m_pFillerNotify)
+ {
+ FX_BOOL bRC = TRUE;
+ FX_BOOL bExit = FALSE;
+ CFX_WideString strChange;
+ CFX_WideString strChangeEx;
+
+ int nSelStart = 0;
+ int nSelEnd = 0;
+ GetSel(nSelStart, nSelEnd);
+
+ if (nSelStart == nSelEnd)
+ nSelEnd = nSelStart + 1;
+ m_pFillerNotify->OnBeforeKeyStroke(TRUE, GetAttachedData(), FWL_VKEY_Delete, strChange, strChangeEx, nSelStart, nSelEnd, TRUE, bRC, bExit, nFlag);
+ if (!bRC) return FALSE;
+ if (bExit) return FALSE;
+ }
+ }
+
+ FX_BOOL bRet = CPWL_EditCtrl::OnKeyDown(nChar, nFlag);
+
+ if (nChar == FWL_VKEY_Delete)
+ {
+ if (m_pFillerNotify)
+ {
+ FX_BOOL bExit = FALSE;
+ m_pFillerNotify->OnAfterKeyStroke(TRUE, GetAttachedData(), bExit,nFlag);
+ if (bExit) return FALSE;
+ }
+ }
+
+ //In case of implementation swallow the OnKeyDown event.
+ if(IsProceedtoOnChar(nChar, nFlag))
+ return TRUE;
+
+ return bRet;
+}
+
+/**
+*In case of implementation swallow the OnKeyDown event.
+*If the event is swallowed, implementation may do other unexpected things, which is not the control means to do.
+*/
+FX_BOOL CPWL_Edit::IsProceedtoOnChar(FX_WORD nKeyCode, FX_DWORD nFlag)
+{
+
+ FX_BOOL bCtrl = IsCTRLpressed(nFlag);
+ FX_BOOL bAlt = IsALTpressed(nFlag);
+ if(bCtrl && !bAlt)
+ {
+ //hot keys for edit control.
+ switch(nKeyCode)
+ {
+ case 'C':
+ case 'V':
+ case 'X':
+ case 'A':
+ case 'Z':
+ return TRUE;
+ default:
+ break;
+ }
+ }
+ //control characters.
+ switch(nKeyCode)
+ {
+ case FWL_VKEY_Escape:
+ case FWL_VKEY_Back:
+ case FWL_VKEY_Return:
+ case FWL_VKEY_Space:
+ return TRUE;
+ default:
+ break;
+ }
+ return FALSE;
+
+}
+
+FX_BOOL CPWL_Edit::OnChar(FX_WORD nChar, FX_DWORD nFlag)
+{
+ if (m_bMouseDown) return TRUE;
+
+ FX_BOOL bRC = TRUE;
+ FX_BOOL bExit = FALSE;
+
+ FX_BOOL bCtrl = IsCTRLpressed(nFlag);
+ if (!bCtrl)
+ {
+ if (m_pFillerNotify)
+ {
+ CFX_WideString swChange;
+ FX_INT32 nKeyCode;
+
+ int nSelStart = 0;
+ int nSelEnd = 0;
+ GetSel(nSelStart, nSelEnd);
+
+ switch (nChar)
+ {
+ case FWL_VKEY_Back:
+ nKeyCode = nChar;
+ if (nSelStart == nSelEnd)
+ nSelStart = nSelEnd - 1;
+ break;
+ case FWL_VKEY_Return:
+ nKeyCode = nChar;
+ break;
+ default:
+ nKeyCode = 0;
+ swChange += nChar;
+ break;
+ }
+
+ CFX_WideString strChangeEx;
+ m_pFillerNotify->OnBeforeKeyStroke(TRUE, GetAttachedData(), nKeyCode, swChange, strChangeEx, nSelStart, nSelEnd, TRUE, bRC, bExit, nFlag);
+ }
+ }
+
+ if (!bRC) return TRUE;
+ if (bExit) return FALSE;
+
+ if (IFX_Edit_FontMap * pFontMap = GetFontMap())
+ {
+ FX_INT32 nOldCharSet = GetCharSet();
+ FX_INT32 nNewCharSet = pFontMap->CharSetFromUnicode(nChar, DEFAULT_CHARSET);
+ if(nOldCharSet != nNewCharSet)
+ {
+ SetCharSet(nNewCharSet);
+ }
+ }
+ FX_BOOL bRet = CPWL_EditCtrl::OnChar(nChar,nFlag);
+
+ if (!bCtrl)
+ {
+ if (m_pFillerNotify)
+ {
+ m_pFillerNotify->OnAfterKeyStroke(TRUE, GetAttachedData(), bExit,nFlag);
+ if (bExit) return FALSE;
+ }
+ }
+
+ return bRet;
+}
+
+FX_BOOL CPWL_Edit::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag)
+{
+ if (HasFlag(PES_MULTILINE))
+ {
+ CPDF_Point ptScroll = GetScrollPos();
+
+ if (zDelta > 0)
+ {
+ ptScroll.y += this->GetFontSize();
+ }
+ else
+ {
+ ptScroll.y -= this->GetFontSize();
+ }
+ this->SetScrollPos(ptScroll);
+
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+void CPWL_Edit::OnInsertReturn(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace)
+{
+ if (HasFlag(PES_SPELLCHECK))
+ {
+ m_pEdit->RefreshWordRange(CombineWordRange(GetLatinWordsRange(oldplace),GetLatinWordsRange(place)));
+ }
+
+ if (m_pEditNotify)
+ {
+ m_pEditNotify->OnInsertReturn(place, oldplace);
+ }
+}
+
+void CPWL_Edit::OnBackSpace(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace)
+{
+ if (HasFlag(PES_SPELLCHECK))
+ {
+ m_pEdit->RefreshWordRange(CombineWordRange(GetLatinWordsRange(oldplace),GetLatinWordsRange(place)));
+ }
+
+ if (m_pEditNotify)
+ {
+ m_pEditNotify->OnBackSpace(place, oldplace);
+ }
+}
+
+void CPWL_Edit::OnDelete(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace)
+{
+ if (HasFlag(PES_SPELLCHECK))
+ {
+ m_pEdit->RefreshWordRange(CombineWordRange(GetLatinWordsRange(oldplace),GetLatinWordsRange(place)));
+ }
+
+ if (m_pEditNotify)
+ {
+ m_pEditNotify->OnDelete(place, oldplace);
+ }
+}
+
+void CPWL_Edit::OnClear(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace)
+{
+ if (HasFlag(PES_SPELLCHECK))
+ {
+ m_pEdit->RefreshWordRange(CombineWordRange(GetLatinWordsRange(oldplace),GetLatinWordsRange(place)));
+ }
+
+ if (m_pEditNotify)
+ {
+ m_pEditNotify->OnClear(place, oldplace);
+ }
+}
+
+void CPWL_Edit::OnInsertWord(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace)
+{
+ if (HasFlag(PES_SPELLCHECK))
+ {
+ m_pEdit->RefreshWordRange(CombineWordRange(GetLatinWordsRange(oldplace),GetLatinWordsRange(place)));
+ }
+
+ if (m_pEditNotify)
+ {
+ m_pEditNotify->OnInsertWord(place, oldplace);
+ }
+}
+
+void CPWL_Edit::OnSetText(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace)
+{
+}
+
+void CPWL_Edit::OnInsertText(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace)
+{
+ if (HasFlag(PES_SPELLCHECK))
+ {
+ m_pEdit->RefreshWordRange(CombineWordRange(GetLatinWordsRange(oldplace),GetLatinWordsRange(place)));
+ }
+
+ if (m_pEditNotify)
+ {
+ m_pEditNotify->OnInsertText(place, oldplace);
+ }
+}
+
+void CPWL_Edit::OnAddUndo(IFX_Edit_UndoItem* pUndoItem)
+{
+ if (m_pEditNotify)
+ {
+ m_pEditNotify->OnAddUndo(this);
+ }
+}
+
+CPVT_WordRange CPWL_Edit::CombineWordRange(const CPVT_WordRange& wr1, const CPVT_WordRange& wr2)
+{
+ CPVT_WordRange wrRet;
+
+ if (wr1.BeginPos.WordCmp(wr2.BeginPos) < 0)
+ {
+ wrRet.BeginPos = wr1.BeginPos;
+ }
+ else
+ {
+ wrRet.BeginPos = wr2.BeginPos;
+ }
+
+ if (wr1.EndPos.WordCmp(wr2.EndPos) < 0)
+ {
+ wrRet.EndPos = wr2.EndPos;
+ }
+ else
+ {
+ wrRet.EndPos = wr1.EndPos;
+ }
+
+ return wrRet;
+}
+
+CPVT_WordRange CPWL_Edit::GetLatinWordsRange(const CPDF_Point& point) const
+{
+ return GetSameWordsRange(m_pEdit->SearchWordPlace(point), TRUE, FALSE);
+}
+
+CPVT_WordRange CPWL_Edit::GetLatinWordsRange(const CPVT_WordPlace & place) const
+{
+ return GetSameWordsRange(place, TRUE, FALSE);
+}
+
+CPVT_WordRange CPWL_Edit::GetArabicWordsRange(const CPVT_WordPlace & place) const
+{
+ return GetSameWordsRange(place, FALSE, TRUE);
+}
+
+#define PWL_ISARABICWORD(word) ((word >= 0x0600 && word <= 0x06FF) || (word >= 0xFB50 && word <= 0xFEFC))
+
+CPVT_WordRange CPWL_Edit::GetSameWordsRange(const CPVT_WordPlace & place, FX_BOOL bLatin, FX_BOOL bArabic) const
+{
+ CPVT_WordRange range;
+
+ if (IFX_Edit_Iterator* pIterator = m_pEdit->GetIterator())
+ {
+ CPVT_Word wordinfo;
+ CPVT_WordPlace wpStart(place),wpEnd(place);
+ pIterator->SetAt(place);
+
+ if (bLatin)
+ {
+ while (pIterator->NextWord())
+ {
+ if (pIterator->GetWord(wordinfo) && FX_EDIT_ISLATINWORD(wordinfo.Word))
+ {
+ wpEnd = pIterator->GetAt();
+ continue;
+ }
+ else
+ break;
+ };
+ }
+ else if (bArabic)
+ {
+ while (pIterator->NextWord())
+ {
+ if (pIterator->GetWord(wordinfo) && PWL_ISARABICWORD(wordinfo.Word))
+ {
+ wpEnd = pIterator->GetAt();
+ continue;
+ }
+ else
+ break;
+ };
+ }
+
+ pIterator->SetAt(place);
+
+ if (bLatin)
+ {
+ do
+ {
+ if (pIterator->GetWord(wordinfo) && FX_EDIT_ISLATINWORD(wordinfo.Word))
+ {
+ continue;
+ }
+ else
+ {
+ wpStart = pIterator->GetAt();
+ break;
+ }
+ }
+ while (pIterator->PrevWord());
+ }
+ else if (bArabic)
+ {
+ do
+ {
+ if (pIterator->GetWord(wordinfo) && PWL_ISARABICWORD(wordinfo.Word))
+ {
+ continue;
+ }
+ else
+ {
+ wpStart = pIterator->GetAt();
+ break;
+ }
+ }
+ while (pIterator->PrevWord());
+ }
+
+ range.Set(wpStart,wpEnd);
+ }
+
+ return range;
+}
+
+void CPWL_Edit::AjustArabicWords(const CPVT_WordRange& wr)
+{
+}
+
+void CPWL_Edit::GeneratePageObjects(CPDF_PageObjects* pPageObjects,
+ const CPDF_Point& ptOffset, CFX_ArrayTemplate<CPDF_TextObject*>& ObjArray)
+{
+ IFX_Edit::GeneratePageObjects(pPageObjects, m_pEdit, ptOffset, NULL, CPWL_Utils::PWLColorToFXColor(GetTextColor(),GetTransparency()), ObjArray);
+}
+
+void CPWL_Edit::GeneratePageObjects(CPDF_PageObjects* pPageObjects,
+ const CPDF_Point& ptOffset)
+{
+ CFX_ArrayTemplate<CPDF_TextObject*> ObjArray;
+ IFX_Edit::GeneratePageObjects(pPageObjects, m_pEdit, ptOffset, NULL, CPWL_Utils::PWLColorToFXColor(GetTextColor(),GetTransparency()), ObjArray);
+}
+
diff --git a/fpdfsdk/src/pdfwindow/PWL_EditCtrl.cpp b/fpdfsdk/src/pdfwindow/PWL_EditCtrl.cpp
index 25628223ec..90a198a771 100644
--- a/fpdfsdk/src/pdfwindow/PWL_EditCtrl.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_EditCtrl.cpp
@@ -1,728 +1,728 @@
-// 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
-
-#include "../../include/pdfwindow/PDFWindow.h"
-#include "../../include/pdfwindow/PWL_Wnd.h"
-#include "../../include/pdfwindow/PWL_EditCtrl.h"
-#include "../../include/pdfwindow/PWL_ScrollBar.h"
-#include "../../include/pdfwindow/PWL_Utils.h"
-#include "../../include/pdfwindow/PWL_Caret.h"
-#include "../../include/pdfwindow/PWL_FontMap.h"
-
-#define IsFloatZero(f) ((f) < 0.0001 && (f) > -0.0001)
-#define IsFloatBigger(fa,fb) ((fa) > (fb) && !IsFloatZero((fa) - (fb)))
-#define IsFloatSmaller(fa,fb) ((fa) < (fb) && !IsFloatZero((fa) - (fb)))
-#define IsFloatEqual(fa,fb) IsFloatZero((fa)-(fb))
-
-/* ---------------------------- CPWL_EditCtrl ------------------------------ */
-
-CPWL_EditCtrl::CPWL_EditCtrl() :
- m_pEdit(NULL),
- m_pEditCaret(NULL),
- m_bMouseDown(FALSE),
- m_pEditNotify(NULL),
- m_nCharSet(DEFAULT_CHARSET),
- m_nCodePage(0)
-{
- m_pEdit = IFX_Edit::NewEdit();
- ASSERT(m_pEdit != NULL);
-}
-
-CPWL_EditCtrl::~CPWL_EditCtrl()
-{
- IFX_Edit::DelEdit(m_pEdit);
-}
-
-void CPWL_EditCtrl::OnCreate(PWL_CREATEPARAM & cp)
-{
- cp.eCursorType = FXCT_VBEAM;
-}
-
-void CPWL_EditCtrl::OnCreated()
-{
- SetFontSize(this->GetCreationParam().fFontSize);
-
- m_pEdit->SetFontMap(this->GetFontMap());
- m_pEdit->SetNotify(this);
- m_pEdit->Initialize();
-}
-
-FX_BOOL CPWL_EditCtrl::IsWndHorV()
-{
- CPDF_Matrix mt = GetWindowMatrix();
- CPDF_Point point1(0,1);
- CPDF_Point point2(1,1);
-
- mt.Transform(point1.x, point1.y);
- mt.Transform(point2.x, point2.y);
-
- return point2.y == point1.y;
-}
-
-void CPWL_EditCtrl::SetCursor()
-{
- if (IsValid())
- {
- if (IFX_SystemHandler* pSH = GetSystemHandler())
- {
- if (IsWndHorV())
- pSH->SetCursor(FXCT_VBEAM);
- else
- pSH->SetCursor(FXCT_HBEAM);
- }
- }
-}
-
-void CPWL_EditCtrl::RePosChildWnd()
-{
- m_pEdit->SetPlateRect(GetClientRect());
-}
-
-void CPWL_EditCtrl::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam, FX_INTPTR lParam)
-{
- CPWL_Wnd::OnNotify(pWnd,msg,wParam,lParam);
-
- switch (msg)
- {
- case PNM_SETSCROLLINFO:
- switch (wParam)
- {
- case SBT_VSCROLL:
- if (CPWL_Wnd * pChild = GetVScrollBar())
- {
- pChild->OnNotify(pWnd,PNM_SETSCROLLINFO,wParam,lParam);
- }
- break;
- }
- break;
- case PNM_SETSCROLLPOS:
- switch (wParam)
- {
- case SBT_VSCROLL:
- if (CPWL_Wnd * pChild = GetVScrollBar())
- {
- pChild->OnNotify(pWnd,PNM_SETSCROLLPOS,wParam,lParam);
- }
- break;
- }
- break;
- case PNM_SCROLLWINDOW:
- {
- FX_FLOAT fPos = *(FX_FLOAT*)lParam;
- switch (wParam)
- {
- case SBT_VSCROLL:
- m_pEdit->SetScrollPos(CPDF_Point(m_pEdit->GetScrollPos().x,fPos));
- break;
- }
- }
- break;
- case PNM_SETCARETINFO:
- {
- if (PWL_CARET_INFO * pCaretInfo = (PWL_CARET_INFO *)wParam)
- {
- this->SetCaret(pCaretInfo->bVisible,
- pCaretInfo->ptHead,
- pCaretInfo->ptFoot);
- }
- }
- break;
- }
-}
-
-void CPWL_EditCtrl::CreateChildWnd(const PWL_CREATEPARAM & cp)
-{
- if (!IsReadOnly())
- CreateEditCaret(cp);
-}
-
-void CPWL_EditCtrl::CreateEditCaret(const PWL_CREATEPARAM & cp)
-{
- if (!m_pEditCaret)
- {
- m_pEditCaret = new CPWL_Caret;
- m_pEditCaret->SetInvalidRect(GetClientRect());
-
- PWL_CREATEPARAM ecp = cp;
- ecp.pParentWnd = this;
- ecp.dwFlags = PWS_CHILD | PWS_NOREFRESHCLIP;
- ecp.dwBorderWidth = 0;
- ecp.nBorderStyle = PBS_SOLID;
- ecp.rcRectWnd = CPDF_Rect(0,0,0,0);
-
- m_pEditCaret->Create(ecp);
- }
-}
-
-void CPWL_EditCtrl::SetFontSize(FX_FLOAT fFontSize)
-{
- m_pEdit->SetFontSize(fFontSize);
-}
-
-FX_FLOAT CPWL_EditCtrl::GetFontSize() const
-{
- return m_pEdit->GetFontSize();
-}
-
-FX_BOOL CPWL_EditCtrl::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
-{
- if (m_bMouseDown) return TRUE;
-
- FX_BOOL bRet = CPWL_Wnd::OnKeyDown(nChar,nFlag);
-
- //FILTER
- switch (nChar)
- {
- default:
- return FALSE;
- case FWL_VKEY_Delete:
- case FWL_VKEY_Up:
- case FWL_VKEY_Down:
- case FWL_VKEY_Left:
- case FWL_VKEY_Right:
- case FWL_VKEY_Home:
- case FWL_VKEY_End:
- case FWL_VKEY_Insert:
- case 'C':
- case 'V':
- case 'X':
- case 'A':
- case 'Z':
- case 'c':
- case 'v':
- case 'x':
- case 'a':
- case 'z':
- break;
- }
-
- if (nChar == FWL_VKEY_Delete)
- {
- if (m_pEdit->IsSelected())
- nChar = FWL_VKEY_Unknown;
- }
-
- switch (nChar)
- {
- case FWL_VKEY_Delete:
- Delete();
- return TRUE;
- case FWL_VKEY_Insert:
- if (IsSHIFTpressed(nFlag))
- PasteText();
- return TRUE;
- case FWL_VKEY_Up:
- m_pEdit->OnVK_UP(IsSHIFTpressed(nFlag),FALSE);
- return TRUE;
- case FWL_VKEY_Down:
- m_pEdit->OnVK_DOWN(IsSHIFTpressed(nFlag),FALSE);
- return TRUE;
- case FWL_VKEY_Left:
- m_pEdit->OnVK_LEFT(IsSHIFTpressed(nFlag),FALSE);
- return TRUE;
- case FWL_VKEY_Right:
- m_pEdit->OnVK_RIGHT(IsSHIFTpressed(nFlag),FALSE);
- return TRUE;
- case FWL_VKEY_Home:
- m_pEdit->OnVK_HOME(IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
- return TRUE;
- case FWL_VKEY_End:
- m_pEdit->OnVK_END(IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
- return TRUE;
- case FWL_VKEY_Unknown:
- if (!IsSHIFTpressed(nFlag))
- Clear();
- else
- CutText();
- return TRUE;
- default:
- break;
- }
-
- return bRet;
-}
-
-FX_BOOL CPWL_EditCtrl::OnChar(FX_WORD nChar, FX_DWORD nFlag)
-{
- if (m_bMouseDown) return TRUE;
-
- CPWL_Wnd::OnChar(nChar,nFlag);
-
- //FILTER
- switch (nChar)
- {
- case 0x0A:
- case 0x1B:
- return FALSE;
- default:
- break;
- }
-
- FX_BOOL bCtrl = IsCTRLpressed(nFlag);
- FX_BOOL bAlt = IsALTpressed(nFlag);
- FX_BOOL bShift = IsSHIFTpressed(nFlag);
-
- FX_WORD word = nChar;
-
- if (bCtrl && !bAlt)
- {
- switch (nChar)
- {
- case 'C' - 'A' + 1:
- this->CopyText();
- return TRUE;
- case 'V' - 'A' + 1:
- this->PasteText();
- return TRUE;
- case 'X' - 'A' + 1:
- this->CutText();
- return TRUE;
- case 'A' - 'A' + 1:
- this->SelectAll();
- return TRUE;
- case 'Z' - 'A' + 1:
- if (bShift)
- Redo();
- else
- Undo();
- return TRUE;
- default:
- if (nChar < 32)
- return FALSE;
- }
- }
-
- if (IsReadOnly()) return TRUE;
-
- if (m_pEdit->IsSelected() && word == FWL_VKEY_Back)
- word = FWL_VKEY_Unknown;
-
- Clear();
-
- switch (word)
- {
- case FWL_VKEY_Back:
- Backspace();
- break;
- case FWL_VKEY_Return:
- InsertReturn();
- break;
- case FWL_VKEY_Unknown:
- break;
- default:
- if (IsINSERTpressed(nFlag))
- Delete();
- InsertWord(word, this->GetCharSet());
- break;
- }
-
- return TRUE;
-}
-
-FX_BOOL CPWL_EditCtrl::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
-{
- CPWL_Wnd::OnLButtonDown(point,nFlag);
-
- if (ClientHitTest(point))
- {
- if (m_bMouseDown)
- this->InvalidateRect();
-
- m_bMouseDown = TRUE;
- SetCapture();
-
- m_pEdit->OnMouseDown(point,IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
- }
-
- return TRUE;
-}
-
-FX_BOOL CPWL_EditCtrl::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
-{
- CPWL_Wnd::OnLButtonUp(point,nFlag);
-
- if (m_bMouseDown)
- {
- //can receive keybord message
- if (ClientHitTest(point) && !this->IsFocused())
- SetFocus();
-
- ReleaseCapture();
- m_bMouseDown = FALSE;
- }
-
- return TRUE;
-}
-
-FX_BOOL CPWL_EditCtrl::OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag)
-{
- CPWL_Wnd::OnMouseMove(point,nFlag);
-
- if (m_bMouseDown)
- m_pEdit->OnMouseMove(point,FALSE,FALSE);
-
- return TRUE;
-}
-
-CPDF_Rect CPWL_EditCtrl::GetContentRect() const
-{
- return m_pEdit->GetContentRect();
-}
-
-void CPWL_EditCtrl::SetEditCaret(FX_BOOL bVisible)
-{
- CPDF_Point ptHead(0,0),ptFoot(0,0);
-
- if (bVisible)
- {
- GetCaretInfo(ptHead,ptFoot);
- }
-
- CPVT_WordPlace wpTemp = m_pEdit->GetCaretWordPlace();
- this->IOnSetCaret(bVisible,ptHead,ptFoot,wpTemp);
-}
-
-void CPWL_EditCtrl::GetCaretInfo(CPDF_Point & ptHead, CPDF_Point & ptFoot) const
-{
- if (IFX_Edit_Iterator * pIterator = m_pEdit->GetIterator())
- {
- pIterator->SetAt(m_pEdit->GetCaret());
- CPVT_Word word;
- CPVT_Line line;
- if (pIterator->GetWord(word))
- {
- ptHead.x = word.ptWord.x + word.fWidth;
- ptHead.y = word.ptWord.y + word.fAscent;
- ptFoot.x = word.ptWord.x + word.fWidth;
- ptFoot.y = word.ptWord.y + word.fDescent;
- }
- else if (pIterator->GetLine(line))
- {
- ptHead.x = line.ptLine.x;
- ptHead.y = line.ptLine.y + line.fLineAscent;
- ptFoot.x = line.ptLine.x;
- ptFoot.y = line.ptLine.y + line.fLineDescent;
- }
- }
-}
-
-void CPWL_EditCtrl::GetCaretPos(FX_INT32& x, FX_INT32& y) const
-{
- CPDF_Point ptHead(0,0), ptFoot(0,0);
-
- GetCaretInfo(ptHead,ptFoot);
-
- PWLtoWnd(ptHead, x, y);
-}
-
-void CPWL_EditCtrl::SetCaret(FX_BOOL bVisible, const CPDF_Point & ptHead, const CPDF_Point & ptFoot)
-{
- if (m_pEditCaret)
- {
- if (!IsFocused() || m_pEdit->IsSelected())
- bVisible = FALSE;
-
- m_pEditCaret->SetCaret(bVisible, ptHead, ptFoot);
- }
-}
-
-FX_BOOL CPWL_EditCtrl::IsModified() const
-{
- return m_pEdit->IsModified();
-}
-
-CFX_WideString CPWL_EditCtrl::GetText() const
-{
- return m_pEdit->GetText();
-}
-
-void CPWL_EditCtrl::SetSel(FX_INT32 nStartChar,FX_INT32 nEndChar)
-{
- m_pEdit->SetSel(nStartChar, nEndChar);
-}
-
-void CPWL_EditCtrl::GetSel(FX_INT32 & nStartChar, FX_INT32 & nEndChar ) const
-{
- m_pEdit->GetSel(nStartChar, nEndChar);
-}
-
-void CPWL_EditCtrl::Clear()
-{
- if (!IsReadOnly())
- m_pEdit->Clear();
-}
-
-void CPWL_EditCtrl::SelectAll()
-{
- m_pEdit->SelectAll();
-}
-
-void CPWL_EditCtrl::Paint()
-{
- if (m_pEdit)
- m_pEdit->Paint();
-}
-
-void CPWL_EditCtrl::EnableRefresh(FX_BOOL bRefresh)
-{
- if (m_pEdit)
- m_pEdit->EnableRefresh(bRefresh);
-}
-
-FX_INT32 CPWL_EditCtrl::GetCaret() const
-{
- if (m_pEdit)
- return m_pEdit->GetCaret();
-
- return -1;
-}
-
-void CPWL_EditCtrl::SetCaret(FX_INT32 nPos)
-{
- if (m_pEdit)
- m_pEdit->SetCaret(nPos);
-}
-
-FX_INT32 CPWL_EditCtrl::GetTotalWords() const
-{
- if (m_pEdit)
- return m_pEdit->GetTotalWords();
-
- return 0;
-}
-
-void CPWL_EditCtrl::SetScrollPos(const CPDF_Point& point)
-{
- if (m_pEdit)
- m_pEdit->SetScrollPos(point);
-}
-
-CPDF_Point CPWL_EditCtrl::GetScrollPos() const
-{
- if (m_pEdit)
- return m_pEdit->GetScrollPos();
-
- return CPDF_Point(0.0f, 0.0f);
-}
-
-CPDF_Font * CPWL_EditCtrl::GetCaretFont() const
-{
- FX_INT32 nFontIndex = 0;
-
- if (IFX_Edit_Iterator * pIterator = m_pEdit->GetIterator())
- {
- pIterator->SetAt(m_pEdit->GetCaret());
- CPVT_Word word;
- CPVT_Section section;
- if (pIterator->GetWord(word))
- {
- nFontIndex = word.nFontIndex;
- }
- else if (HasFlag(PES_RICH))
- {
- if (pIterator->GetSection(section))
- {
- nFontIndex = section.WordProps.nFontIndex;
- }
- }
- }
-
- if (IFX_Edit_FontMap * pFontMap = GetFontMap())
- return pFontMap->GetPDFFont(nFontIndex);
- else
- return NULL;
-}
-
-FX_FLOAT CPWL_EditCtrl::GetCaretFontSize() const
-{
- FX_FLOAT fFontSize = GetFontSize();
-
- if (IFX_Edit_Iterator * pIterator = m_pEdit->GetIterator())
- {
- pIterator->SetAt(m_pEdit->GetCaret());
- CPVT_Word word;
- CPVT_Section section;
- if (pIterator->GetWord(word))
- {
- fFontSize = word.fFontSize;
- }
- else if (HasFlag(PES_RICH))
- {
- if (pIterator->GetSection(section))
- {
- fFontSize = section.WordProps.fFontSize;
- }
- }
- }
-
- return fFontSize;
-}
-
-void CPWL_EditCtrl::SetText(FX_LPCWSTR csText)
-{
- m_pEdit->SetText(csText);
-}
-
-void CPWL_EditCtrl::CopyText()
-{
-}
-
-void CPWL_EditCtrl::PasteText()
-{
-}
-
-void CPWL_EditCtrl::CutText()
-{
-}
-
-void CPWL_EditCtrl::ShowVScrollBar(FX_BOOL bShow)
-{
-}
-
-void CPWL_EditCtrl::InsertText(FX_LPCWSTR csText)
-{
- if (!IsReadOnly())
- m_pEdit->InsertText(csText);
-}
-
-void CPWL_EditCtrl::InsertWord(FX_WORD word, FX_INT32 nCharset)
-{
- if (!IsReadOnly())
- m_pEdit->InsertWord(word, nCharset);
-}
-
-void CPWL_EditCtrl::InsertReturn()
-{
- if (!IsReadOnly())
- m_pEdit->InsertReturn();
-}
-
-void CPWL_EditCtrl::Delete()
-{
- if (!IsReadOnly())
- m_pEdit->Delete();
-}
-
-void CPWL_EditCtrl::Backspace()
-{
- if (!IsReadOnly())
- m_pEdit->Backspace();
-}
-
-FX_BOOL CPWL_EditCtrl::CanUndo() const
-{
- return !IsReadOnly() && m_pEdit->CanUndo();
-}
-
-FX_BOOL CPWL_EditCtrl::CanRedo() const
-{
- return !IsReadOnly() && m_pEdit->CanRedo();
-}
-
-void CPWL_EditCtrl::Redo()
-{
- if (CanRedo())
- m_pEdit->Redo();
-}
-
-void CPWL_EditCtrl::Undo()
-{
- if (CanUndo())
- m_pEdit->Undo();
-}
-
-void CPWL_EditCtrl::IOnSetScrollInfoY(FX_FLOAT fPlateMin, FX_FLOAT fPlateMax,
- FX_FLOAT fContentMin, FX_FLOAT fContentMax,
- FX_FLOAT fSmallStep, FX_FLOAT fBigStep)
-{
- PWL_SCROLL_INFO Info;
-
- Info.fPlateWidth = fPlateMax - fPlateMin;
- Info.fContentMin = fContentMin;
- Info.fContentMax = fContentMax;
- Info.fSmallStep = fSmallStep;
- Info.fBigStep = fBigStep;
-
- this->OnNotify(this,PNM_SETSCROLLINFO,SBT_VSCROLL,(FX_INTPTR)&Info);
-
-// PWL_TRACE("set scroll info:%f\n",fContentMax - fContentMin);
-
- if (IsFloatBigger(Info.fPlateWidth,Info.fContentMax-Info.fContentMin)
- || IsFloatEqual(Info.fPlateWidth,Info.fContentMax-Info.fContentMin))
- {
- this->ShowVScrollBar(FALSE);
- }
- else
- {
- this->ShowVScrollBar(TRUE);
- }
-}
-
-void CPWL_EditCtrl::IOnSetScrollPosY(FX_FLOAT fy)
-{
-// PWL_TRACE("set scroll position:%f\n",fy);
- this->OnNotify(this,PNM_SETSCROLLPOS,SBT_VSCROLL,(FX_INTPTR)&fy);
-}
-
-void CPWL_EditCtrl::IOnSetCaret(FX_BOOL bVisible, const CPDF_Point & ptHead, const CPDF_Point & ptFoot, const CPVT_WordPlace& place)
-{
- PWL_CARET_INFO cInfo;
- cInfo.bVisible = bVisible;
- cInfo.ptHead = ptHead;
- cInfo.ptFoot = ptFoot;
-
- this->OnNotify(this,PNM_SETCARETINFO,(FX_INTPTR)&cInfo,(FX_INTPTR)NULL);
-}
-
-void CPWL_EditCtrl::IOnCaretChange(const CPVT_SecProps & secProps, const CPVT_WordProps & wordProps)
-{
-}
-
-void CPWL_EditCtrl::IOnContentChange(const CPDF_Rect& rcContent)
-{
- if (this->IsValid())
- {
- if (m_pEditNotify)
- {
- m_pEditNotify->OnContentChange(rcContent);
- }
- }
-}
-
-void CPWL_EditCtrl::IOnInvalidateRect(CPDF_Rect * pRect)
-{
- this->InvalidateRect(pRect);
-}
-
-FX_INT32 CPWL_EditCtrl::GetCharSet() const
-{
- if (m_nCharSet < 0)
- return DEFAULT_CHARSET;
- else
- return m_nCharSet;
-}
-
-void CPWL_EditCtrl::GetTextRange(const CPDF_Rect& rect, FX_INT32 & nStartChar, FX_INT32 & nEndChar) const
-{
- nStartChar = m_pEdit->WordPlaceToWordIndex(m_pEdit->SearchWordPlace(CPDF_Point(rect.left, rect.top)));
- nEndChar = m_pEdit->WordPlaceToWordIndex(m_pEdit->SearchWordPlace(CPDF_Point(rect.right, rect.bottom)));
-}
-
-CFX_WideString CPWL_EditCtrl::GetText(FX_INT32 & nStartChar, FX_INT32 & nEndChar) const
-{
- CPVT_WordPlace wpStart = m_pEdit->WordIndexToWordPlace(nStartChar);
- CPVT_WordPlace wpEnd = m_pEdit->WordIndexToWordPlace(nEndChar);
- return m_pEdit->GetRangeText(CPVT_WordRange(wpStart, wpEnd));
-}
-
-void CPWL_EditCtrl::SetReadyToInput()
-{
- if (m_bMouseDown)
- {
- ReleaseCapture();
- m_bMouseDown = FALSE;
- }
-}
+// 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
+
+#include "../../include/pdfwindow/PDFWindow.h"
+#include "../../include/pdfwindow/PWL_Wnd.h"
+#include "../../include/pdfwindow/PWL_EditCtrl.h"
+#include "../../include/pdfwindow/PWL_ScrollBar.h"
+#include "../../include/pdfwindow/PWL_Utils.h"
+#include "../../include/pdfwindow/PWL_Caret.h"
+#include "../../include/pdfwindow/PWL_FontMap.h"
+
+#define IsFloatZero(f) ((f) < 0.0001 && (f) > -0.0001)
+#define IsFloatBigger(fa,fb) ((fa) > (fb) && !IsFloatZero((fa) - (fb)))
+#define IsFloatSmaller(fa,fb) ((fa) < (fb) && !IsFloatZero((fa) - (fb)))
+#define IsFloatEqual(fa,fb) IsFloatZero((fa)-(fb))
+
+/* ---------------------------- CPWL_EditCtrl ------------------------------ */
+
+CPWL_EditCtrl::CPWL_EditCtrl() :
+ m_pEdit(NULL),
+ m_pEditCaret(NULL),
+ m_bMouseDown(FALSE),
+ m_pEditNotify(NULL),
+ m_nCharSet(DEFAULT_CHARSET),
+ m_nCodePage(0)
+{
+ m_pEdit = IFX_Edit::NewEdit();
+ ASSERT(m_pEdit != NULL);
+}
+
+CPWL_EditCtrl::~CPWL_EditCtrl()
+{
+ IFX_Edit::DelEdit(m_pEdit);
+}
+
+void CPWL_EditCtrl::OnCreate(PWL_CREATEPARAM & cp)
+{
+ cp.eCursorType = FXCT_VBEAM;
+}
+
+void CPWL_EditCtrl::OnCreated()
+{
+ SetFontSize(this->GetCreationParam().fFontSize);
+
+ m_pEdit->SetFontMap(this->GetFontMap());
+ m_pEdit->SetNotify(this);
+ m_pEdit->Initialize();
+}
+
+FX_BOOL CPWL_EditCtrl::IsWndHorV()
+{
+ CPDF_Matrix mt = GetWindowMatrix();
+ CPDF_Point point1(0,1);
+ CPDF_Point point2(1,1);
+
+ mt.Transform(point1.x, point1.y);
+ mt.Transform(point2.x, point2.y);
+
+ return point2.y == point1.y;
+}
+
+void CPWL_EditCtrl::SetCursor()
+{
+ if (IsValid())
+ {
+ if (IFX_SystemHandler* pSH = GetSystemHandler())
+ {
+ if (IsWndHorV())
+ pSH->SetCursor(FXCT_VBEAM);
+ else
+ pSH->SetCursor(FXCT_HBEAM);
+ }
+ }
+}
+
+void CPWL_EditCtrl::RePosChildWnd()
+{
+ m_pEdit->SetPlateRect(GetClientRect());
+}
+
+void CPWL_EditCtrl::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam, FX_INTPTR lParam)
+{
+ CPWL_Wnd::OnNotify(pWnd,msg,wParam,lParam);
+
+ switch (msg)
+ {
+ case PNM_SETSCROLLINFO:
+ switch (wParam)
+ {
+ case SBT_VSCROLL:
+ if (CPWL_Wnd * pChild = GetVScrollBar())
+ {
+ pChild->OnNotify(pWnd,PNM_SETSCROLLINFO,wParam,lParam);
+ }
+ break;
+ }
+ break;
+ case PNM_SETSCROLLPOS:
+ switch (wParam)
+ {
+ case SBT_VSCROLL:
+ if (CPWL_Wnd * pChild = GetVScrollBar())
+ {
+ pChild->OnNotify(pWnd,PNM_SETSCROLLPOS,wParam,lParam);
+ }
+ break;
+ }
+ break;
+ case PNM_SCROLLWINDOW:
+ {
+ FX_FLOAT fPos = *(FX_FLOAT*)lParam;
+ switch (wParam)
+ {
+ case SBT_VSCROLL:
+ m_pEdit->SetScrollPos(CPDF_Point(m_pEdit->GetScrollPos().x,fPos));
+ break;
+ }
+ }
+ break;
+ case PNM_SETCARETINFO:
+ {
+ if (PWL_CARET_INFO * pCaretInfo = (PWL_CARET_INFO *)wParam)
+ {
+ this->SetCaret(pCaretInfo->bVisible,
+ pCaretInfo->ptHead,
+ pCaretInfo->ptFoot);
+ }
+ }
+ break;
+ }
+}
+
+void CPWL_EditCtrl::CreateChildWnd(const PWL_CREATEPARAM & cp)
+{
+ if (!IsReadOnly())
+ CreateEditCaret(cp);
+}
+
+void CPWL_EditCtrl::CreateEditCaret(const PWL_CREATEPARAM & cp)
+{
+ if (!m_pEditCaret)
+ {
+ m_pEditCaret = new CPWL_Caret;
+ m_pEditCaret->SetInvalidRect(GetClientRect());
+
+ PWL_CREATEPARAM ecp = cp;
+ ecp.pParentWnd = this;
+ ecp.dwFlags = PWS_CHILD | PWS_NOREFRESHCLIP;
+ ecp.dwBorderWidth = 0;
+ ecp.nBorderStyle = PBS_SOLID;
+ ecp.rcRectWnd = CPDF_Rect(0,0,0,0);
+
+ m_pEditCaret->Create(ecp);
+ }
+}
+
+void CPWL_EditCtrl::SetFontSize(FX_FLOAT fFontSize)
+{
+ m_pEdit->SetFontSize(fFontSize);
+}
+
+FX_FLOAT CPWL_EditCtrl::GetFontSize() const
+{
+ return m_pEdit->GetFontSize();
+}
+
+FX_BOOL CPWL_EditCtrl::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
+{
+ if (m_bMouseDown) return TRUE;
+
+ FX_BOOL bRet = CPWL_Wnd::OnKeyDown(nChar,nFlag);
+
+ //FILTER
+ switch (nChar)
+ {
+ default:
+ return FALSE;
+ case FWL_VKEY_Delete:
+ case FWL_VKEY_Up:
+ case FWL_VKEY_Down:
+ case FWL_VKEY_Left:
+ case FWL_VKEY_Right:
+ case FWL_VKEY_Home:
+ case FWL_VKEY_End:
+ case FWL_VKEY_Insert:
+ case 'C':
+ case 'V':
+ case 'X':
+ case 'A':
+ case 'Z':
+ case 'c':
+ case 'v':
+ case 'x':
+ case 'a':
+ case 'z':
+ break;
+ }
+
+ if (nChar == FWL_VKEY_Delete)
+ {
+ if (m_pEdit->IsSelected())
+ nChar = FWL_VKEY_Unknown;
+ }
+
+ switch (nChar)
+ {
+ case FWL_VKEY_Delete:
+ Delete();
+ return TRUE;
+ case FWL_VKEY_Insert:
+ if (IsSHIFTpressed(nFlag))
+ PasteText();
+ return TRUE;
+ case FWL_VKEY_Up:
+ m_pEdit->OnVK_UP(IsSHIFTpressed(nFlag),FALSE);
+ return TRUE;
+ case FWL_VKEY_Down:
+ m_pEdit->OnVK_DOWN(IsSHIFTpressed(nFlag),FALSE);
+ return TRUE;
+ case FWL_VKEY_Left:
+ m_pEdit->OnVK_LEFT(IsSHIFTpressed(nFlag),FALSE);
+ return TRUE;
+ case FWL_VKEY_Right:
+ m_pEdit->OnVK_RIGHT(IsSHIFTpressed(nFlag),FALSE);
+ return TRUE;
+ case FWL_VKEY_Home:
+ m_pEdit->OnVK_HOME(IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
+ return TRUE;
+ case FWL_VKEY_End:
+ m_pEdit->OnVK_END(IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
+ return TRUE;
+ case FWL_VKEY_Unknown:
+ if (!IsSHIFTpressed(nFlag))
+ Clear();
+ else
+ CutText();
+ return TRUE;
+ default:
+ break;
+ }
+
+ return bRet;
+}
+
+FX_BOOL CPWL_EditCtrl::OnChar(FX_WORD nChar, FX_DWORD nFlag)
+{
+ if (m_bMouseDown) return TRUE;
+
+ CPWL_Wnd::OnChar(nChar,nFlag);
+
+ //FILTER
+ switch (nChar)
+ {
+ case 0x0A:
+ case 0x1B:
+ return FALSE;
+ default:
+ break;
+ }
+
+ FX_BOOL bCtrl = IsCTRLpressed(nFlag);
+ FX_BOOL bAlt = IsALTpressed(nFlag);
+ FX_BOOL bShift = IsSHIFTpressed(nFlag);
+
+ FX_WORD word = nChar;
+
+ if (bCtrl && !bAlt)
+ {
+ switch (nChar)
+ {
+ case 'C' - 'A' + 1:
+ this->CopyText();
+ return TRUE;
+ case 'V' - 'A' + 1:
+ this->PasteText();
+ return TRUE;
+ case 'X' - 'A' + 1:
+ this->CutText();
+ return TRUE;
+ case 'A' - 'A' + 1:
+ this->SelectAll();
+ return TRUE;
+ case 'Z' - 'A' + 1:
+ if (bShift)
+ Redo();
+ else
+ Undo();
+ return TRUE;
+ default:
+ if (nChar < 32)
+ return FALSE;
+ }
+ }
+
+ if (IsReadOnly()) return TRUE;
+
+ if (m_pEdit->IsSelected() && word == FWL_VKEY_Back)
+ word = FWL_VKEY_Unknown;
+
+ Clear();
+
+ switch (word)
+ {
+ case FWL_VKEY_Back:
+ Backspace();
+ break;
+ case FWL_VKEY_Return:
+ InsertReturn();
+ break;
+ case FWL_VKEY_Unknown:
+ break;
+ default:
+ if (IsINSERTpressed(nFlag))
+ Delete();
+ InsertWord(word, this->GetCharSet());
+ break;
+ }
+
+ return TRUE;
+}
+
+FX_BOOL CPWL_EditCtrl::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
+{
+ CPWL_Wnd::OnLButtonDown(point,nFlag);
+
+ if (ClientHitTest(point))
+ {
+ if (m_bMouseDown)
+ this->InvalidateRect();
+
+ m_bMouseDown = TRUE;
+ SetCapture();
+
+ m_pEdit->OnMouseDown(point,IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
+ }
+
+ return TRUE;
+}
+
+FX_BOOL CPWL_EditCtrl::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
+{
+ CPWL_Wnd::OnLButtonUp(point,nFlag);
+
+ if (m_bMouseDown)
+ {
+ //can receive keybord message
+ if (ClientHitTest(point) && !this->IsFocused())
+ SetFocus();
+
+ ReleaseCapture();
+ m_bMouseDown = FALSE;
+ }
+
+ return TRUE;
+}
+
+FX_BOOL CPWL_EditCtrl::OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag)
+{
+ CPWL_Wnd::OnMouseMove(point,nFlag);
+
+ if (m_bMouseDown)
+ m_pEdit->OnMouseMove(point,FALSE,FALSE);
+
+ return TRUE;
+}
+
+CPDF_Rect CPWL_EditCtrl::GetContentRect() const
+{
+ return m_pEdit->GetContentRect();
+}
+
+void CPWL_EditCtrl::SetEditCaret(FX_BOOL bVisible)
+{
+ CPDF_Point ptHead(0,0),ptFoot(0,0);
+
+ if (bVisible)
+ {
+ GetCaretInfo(ptHead,ptFoot);
+ }
+
+ CPVT_WordPlace wpTemp = m_pEdit->GetCaretWordPlace();
+ this->IOnSetCaret(bVisible,ptHead,ptFoot,wpTemp);
+}
+
+void CPWL_EditCtrl::GetCaretInfo(CPDF_Point & ptHead, CPDF_Point & ptFoot) const
+{
+ if (IFX_Edit_Iterator * pIterator = m_pEdit->GetIterator())
+ {
+ pIterator->SetAt(m_pEdit->GetCaret());
+ CPVT_Word word;
+ CPVT_Line line;
+ if (pIterator->GetWord(word))
+ {
+ ptHead.x = word.ptWord.x + word.fWidth;
+ ptHead.y = word.ptWord.y + word.fAscent;
+ ptFoot.x = word.ptWord.x + word.fWidth;
+ ptFoot.y = word.ptWord.y + word.fDescent;
+ }
+ else if (pIterator->GetLine(line))
+ {
+ ptHead.x = line.ptLine.x;
+ ptHead.y = line.ptLine.y + line.fLineAscent;
+ ptFoot.x = line.ptLine.x;
+ ptFoot.y = line.ptLine.y + line.fLineDescent;
+ }
+ }
+}
+
+void CPWL_EditCtrl::GetCaretPos(FX_INT32& x, FX_INT32& y) const
+{
+ CPDF_Point ptHead(0,0), ptFoot(0,0);
+
+ GetCaretInfo(ptHead,ptFoot);
+
+ PWLtoWnd(ptHead, x, y);
+}
+
+void CPWL_EditCtrl::SetCaret(FX_BOOL bVisible, const CPDF_Point & ptHead, const CPDF_Point & ptFoot)
+{
+ if (m_pEditCaret)
+ {
+ if (!IsFocused() || m_pEdit->IsSelected())
+ bVisible = FALSE;
+
+ m_pEditCaret->SetCaret(bVisible, ptHead, ptFoot);
+ }
+}
+
+FX_BOOL CPWL_EditCtrl::IsModified() const
+{
+ return m_pEdit->IsModified();
+}
+
+CFX_WideString CPWL_EditCtrl::GetText() const
+{
+ return m_pEdit->GetText();
+}
+
+void CPWL_EditCtrl::SetSel(FX_INT32 nStartChar,FX_INT32 nEndChar)
+{
+ m_pEdit->SetSel(nStartChar, nEndChar);
+}
+
+void CPWL_EditCtrl::GetSel(FX_INT32 & nStartChar, FX_INT32 & nEndChar ) const
+{
+ m_pEdit->GetSel(nStartChar, nEndChar);
+}
+
+void CPWL_EditCtrl::Clear()
+{
+ if (!IsReadOnly())
+ m_pEdit->Clear();
+}
+
+void CPWL_EditCtrl::SelectAll()
+{
+ m_pEdit->SelectAll();
+}
+
+void CPWL_EditCtrl::Paint()
+{
+ if (m_pEdit)
+ m_pEdit->Paint();
+}
+
+void CPWL_EditCtrl::EnableRefresh(FX_BOOL bRefresh)
+{
+ if (m_pEdit)
+ m_pEdit->EnableRefresh(bRefresh);
+}
+
+FX_INT32 CPWL_EditCtrl::GetCaret() const
+{
+ if (m_pEdit)
+ return m_pEdit->GetCaret();
+
+ return -1;
+}
+
+void CPWL_EditCtrl::SetCaret(FX_INT32 nPos)
+{
+ if (m_pEdit)
+ m_pEdit->SetCaret(nPos);
+}
+
+FX_INT32 CPWL_EditCtrl::GetTotalWords() const
+{
+ if (m_pEdit)
+ return m_pEdit->GetTotalWords();
+
+ return 0;
+}
+
+void CPWL_EditCtrl::SetScrollPos(const CPDF_Point& point)
+{
+ if (m_pEdit)
+ m_pEdit->SetScrollPos(point);
+}
+
+CPDF_Point CPWL_EditCtrl::GetScrollPos() const
+{
+ if (m_pEdit)
+ return m_pEdit->GetScrollPos();
+
+ return CPDF_Point(0.0f, 0.0f);
+}
+
+CPDF_Font * CPWL_EditCtrl::GetCaretFont() const
+{
+ FX_INT32 nFontIndex = 0;
+
+ if (IFX_Edit_Iterator * pIterator = m_pEdit->GetIterator())
+ {
+ pIterator->SetAt(m_pEdit->GetCaret());
+ CPVT_Word word;
+ CPVT_Section section;
+ if (pIterator->GetWord(word))
+ {
+ nFontIndex = word.nFontIndex;
+ }
+ else if (HasFlag(PES_RICH))
+ {
+ if (pIterator->GetSection(section))
+ {
+ nFontIndex = section.WordProps.nFontIndex;
+ }
+ }
+ }
+
+ if (IFX_Edit_FontMap * pFontMap = GetFontMap())
+ return pFontMap->GetPDFFont(nFontIndex);
+ else
+ return NULL;
+}
+
+FX_FLOAT CPWL_EditCtrl::GetCaretFontSize() const
+{
+ FX_FLOAT fFontSize = GetFontSize();
+
+ if (IFX_Edit_Iterator * pIterator = m_pEdit->GetIterator())
+ {
+ pIterator->SetAt(m_pEdit->GetCaret());
+ CPVT_Word word;
+ CPVT_Section section;
+ if (pIterator->GetWord(word))
+ {
+ fFontSize = word.fFontSize;
+ }
+ else if (HasFlag(PES_RICH))
+ {
+ if (pIterator->GetSection(section))
+ {
+ fFontSize = section.WordProps.fFontSize;
+ }
+ }
+ }
+
+ return fFontSize;
+}
+
+void CPWL_EditCtrl::SetText(FX_LPCWSTR csText)
+{
+ m_pEdit->SetText(csText);
+}
+
+void CPWL_EditCtrl::CopyText()
+{
+}
+
+void CPWL_EditCtrl::PasteText()
+{
+}
+
+void CPWL_EditCtrl::CutText()
+{
+}
+
+void CPWL_EditCtrl::ShowVScrollBar(FX_BOOL bShow)
+{
+}
+
+void CPWL_EditCtrl::InsertText(FX_LPCWSTR csText)
+{
+ if (!IsReadOnly())
+ m_pEdit->InsertText(csText);
+}
+
+void CPWL_EditCtrl::InsertWord(FX_WORD word, FX_INT32 nCharset)
+{
+ if (!IsReadOnly())
+ m_pEdit->InsertWord(word, nCharset);
+}
+
+void CPWL_EditCtrl::InsertReturn()
+{
+ if (!IsReadOnly())
+ m_pEdit->InsertReturn();
+}
+
+void CPWL_EditCtrl::Delete()
+{
+ if (!IsReadOnly())
+ m_pEdit->Delete();
+}
+
+void CPWL_EditCtrl::Backspace()
+{
+ if (!IsReadOnly())
+ m_pEdit->Backspace();
+}
+
+FX_BOOL CPWL_EditCtrl::CanUndo() const
+{
+ return !IsReadOnly() && m_pEdit->CanUndo();
+}
+
+FX_BOOL CPWL_EditCtrl::CanRedo() const
+{
+ return !IsReadOnly() && m_pEdit->CanRedo();
+}
+
+void CPWL_EditCtrl::Redo()
+{
+ if (CanRedo())
+ m_pEdit->Redo();
+}
+
+void CPWL_EditCtrl::Undo()
+{
+ if (CanUndo())
+ m_pEdit->Undo();
+}
+
+void CPWL_EditCtrl::IOnSetScrollInfoY(FX_FLOAT fPlateMin, FX_FLOAT fPlateMax,
+ FX_FLOAT fContentMin, FX_FLOAT fContentMax,
+ FX_FLOAT fSmallStep, FX_FLOAT fBigStep)
+{
+ PWL_SCROLL_INFO Info;
+
+ Info.fPlateWidth = fPlateMax - fPlateMin;
+ Info.fContentMin = fContentMin;
+ Info.fContentMax = fContentMax;
+ Info.fSmallStep = fSmallStep;
+ Info.fBigStep = fBigStep;
+
+ this->OnNotify(this,PNM_SETSCROLLINFO,SBT_VSCROLL,(FX_INTPTR)&Info);
+
+// PWL_TRACE("set scroll info:%f\n",fContentMax - fContentMin);
+
+ if (IsFloatBigger(Info.fPlateWidth,Info.fContentMax-Info.fContentMin)
+ || IsFloatEqual(Info.fPlateWidth,Info.fContentMax-Info.fContentMin))
+ {
+ this->ShowVScrollBar(FALSE);
+ }
+ else
+ {
+ this->ShowVScrollBar(TRUE);
+ }
+}
+
+void CPWL_EditCtrl::IOnSetScrollPosY(FX_FLOAT fy)
+{
+// PWL_TRACE("set scroll position:%f\n",fy);
+ this->OnNotify(this,PNM_SETSCROLLPOS,SBT_VSCROLL,(FX_INTPTR)&fy);
+}
+
+void CPWL_EditCtrl::IOnSetCaret(FX_BOOL bVisible, const CPDF_Point & ptHead, const CPDF_Point & ptFoot, const CPVT_WordPlace& place)
+{
+ PWL_CARET_INFO cInfo;
+ cInfo.bVisible = bVisible;
+ cInfo.ptHead = ptHead;
+ cInfo.ptFoot = ptFoot;
+
+ this->OnNotify(this,PNM_SETCARETINFO,(FX_INTPTR)&cInfo,(FX_INTPTR)NULL);
+}
+
+void CPWL_EditCtrl::IOnCaretChange(const CPVT_SecProps & secProps, const CPVT_WordProps & wordProps)
+{
+}
+
+void CPWL_EditCtrl::IOnContentChange(const CPDF_Rect& rcContent)
+{
+ if (this->IsValid())
+ {
+ if (m_pEditNotify)
+ {
+ m_pEditNotify->OnContentChange(rcContent);
+ }
+ }
+}
+
+void CPWL_EditCtrl::IOnInvalidateRect(CPDF_Rect * pRect)
+{
+ this->InvalidateRect(pRect);
+}
+
+FX_INT32 CPWL_EditCtrl::GetCharSet() const
+{
+ if (m_nCharSet < 0)
+ return DEFAULT_CHARSET;
+ else
+ return m_nCharSet;
+}
+
+void CPWL_EditCtrl::GetTextRange(const CPDF_Rect& rect, FX_INT32 & nStartChar, FX_INT32 & nEndChar) const
+{
+ nStartChar = m_pEdit->WordPlaceToWordIndex(m_pEdit->SearchWordPlace(CPDF_Point(rect.left, rect.top)));
+ nEndChar = m_pEdit->WordPlaceToWordIndex(m_pEdit->SearchWordPlace(CPDF_Point(rect.right, rect.bottom)));
+}
+
+CFX_WideString CPWL_EditCtrl::GetText(FX_INT32 & nStartChar, FX_INT32 & nEndChar) const
+{
+ CPVT_WordPlace wpStart = m_pEdit->WordIndexToWordPlace(nStartChar);
+ CPVT_WordPlace wpEnd = m_pEdit->WordIndexToWordPlace(nEndChar);
+ return m_pEdit->GetRangeText(CPVT_WordRange(wpStart, wpEnd));
+}
+
+void CPWL_EditCtrl::SetReadyToInput()
+{
+ if (m_bMouseDown)
+ {
+ ReleaseCapture();
+ m_bMouseDown = FALSE;
+ }
+}
diff --git a/fpdfsdk/src/pdfwindow/PWL_FontMap.cpp b/fpdfsdk/src/pdfwindow/PWL_FontMap.cpp
index 1e2259fe50..c656f0c15e 100644
--- a/fpdfsdk/src/pdfwindow/PWL_FontMap.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_FontMap.cpp
@@ -1,601 +1,601 @@
-// 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
-
-#include "../../include/pdfwindow/PDFWindow.h"
-#include "../../include/pdfwindow/PWL_Wnd.h"
-#include "../../include/pdfwindow/PWL_FontMap.h"
-
-#define DEFAULT_FONT_NAME "Helvetica"
-
-/* ------------------------------ CPWL_FontMap ------------------------------ */
-
-CPWL_FontMap::CPWL_FontMap(IFX_SystemHandler* pSystemHandler) :
- m_pPDFDoc(NULL),
- m_pSystemHandler(pSystemHandler)
-{
- ASSERT(m_pSystemHandler != NULL);
-}
-
-CPWL_FontMap::~CPWL_FontMap()
-{
- if (m_pPDFDoc)
- {
- delete m_pPDFDoc;
- m_pPDFDoc = NULL;
- }
-
- Empty();
-}
-
-void CPWL_FontMap::SetSystemHandler(IFX_SystemHandler* pSystemHandler)
-{
- m_pSystemHandler = pSystemHandler;
-}
-
-CPDF_Document* CPWL_FontMap::GetDocument()
-{
- if (!m_pPDFDoc)
- {
- if (CPDF_ModuleMgr::Get())
- {
- m_pPDFDoc = FX_NEW CPDF_Document;
- m_pPDFDoc->CreateNewDoc();
- }
- }
-
- return m_pPDFDoc;
-}
-
-CPDF_Font* CPWL_FontMap::GetPDFFont(FX_INT32 nFontIndex)
-{
- if (nFontIndex >=0 && nFontIndex < m_aData.GetSize())
- {
- if (CPWL_FontMap_Data* pData = m_aData.GetAt(nFontIndex))
- {
- return pData->pFont;
- }
- }
-
- return NULL;
-}
-
-CFX_ByteString CPWL_FontMap::GetPDFFontAlias(FX_INT32 nFontIndex)
-{
- if (nFontIndex >=0 && nFontIndex < m_aData.GetSize())
- {
- if (CPWL_FontMap_Data* pData = m_aData.GetAt(nFontIndex))
- {
- return pData->sFontName;
- }
- }
-
- return "";
-}
-
-FX_BOOL CPWL_FontMap::KnowWord(FX_INT32 nFontIndex, FX_WORD word)
-{
- if (nFontIndex >=0 && nFontIndex < m_aData.GetSize())
- {
- if (m_aData.GetAt(nFontIndex))
- {
- return CharCodeFromUnicode(nFontIndex, word) >= 0;
- }
- }
-
- return FALSE;
-}
-
-FX_INT32 CPWL_FontMap::GetWordFontIndex(FX_WORD word, FX_INT32 nCharset, FX_INT32 nFontIndex)
-{
- if (nFontIndex > 0)
- {
- if (KnowWord(nFontIndex, word))
- return nFontIndex;
- }
- else
- {
- if (const CPWL_FontMap_Data* pData = GetFontMapData(0))
- {
- if (nCharset == DEFAULT_CHARSET ||
- pData->nCharset == SYMBOL_CHARSET ||
- nCharset == pData->nCharset)
- {
- if (KnowWord(0, word))
- {
- return 0;
- }
- }
- }
- }
-
- FX_INT32 nNewFontIndex = -1;
-
- nNewFontIndex = this->GetFontIndex(GetNativeFontName(nCharset), nCharset, TRUE);
- if (nNewFontIndex >= 0)
- {
- if (KnowWord(nNewFontIndex, word))
- return nNewFontIndex;
- }
-
- nNewFontIndex = this->GetFontIndex("Arial Unicode MS", DEFAULT_CHARSET, FALSE);
- if (nNewFontIndex >= 0)
- {
- if (KnowWord(nNewFontIndex, word))
- return nNewFontIndex;
- }
-
- return -1;
-}
-
-FX_INT32 CPWL_FontMap::CharCodeFromUnicode(FX_INT32 nFontIndex, FX_WORD word)
-{
- if (CPWL_FontMap_Data* pData = m_aData.GetAt(nFontIndex))
- {
- if (pData->pFont)
- {
- if (pData->pFont->IsUnicodeCompatible())
- {
- int nCharCode = pData->pFont->CharCodeFromUnicode(word);
- pData->pFont->GlyphFromCharCode(nCharCode);
- return nCharCode;
- }
- else
- {
- if (word < 0xFF)
- return word;
- }
- }
- }
-
- return -1;
-}
-
-CFX_ByteString CPWL_FontMap::GetNativeFontName(FX_INT32 nCharset)
-{
- //searching native font is slow, so we must save time
- for (FX_INT32 i=0,sz=m_aNativeFont.GetSize(); i<sz; i++)
- {
- if (CPWL_FontMap_Native* pData = m_aNativeFont.GetAt(i))
- {
- if (pData->nCharset == nCharset)
- return pData->sFontName;
- }
- }
-
- CFX_ByteString sNew = GetNativeFont(nCharset);
-
- if (!sNew.IsEmpty())
- {
- CPWL_FontMap_Native* pNewData = new CPWL_FontMap_Native;
- pNewData->nCharset = nCharset;
- pNewData->sFontName = sNew;
-
- m_aNativeFont.Add(pNewData);
- }
-
- return sNew;
-}
-
-void CPWL_FontMap::Empty()
-{
- {
- for (FX_INT32 i=0, sz=m_aData.GetSize(); i<sz; i++)
- delete m_aData.GetAt(i);
-
- m_aData.RemoveAll();
- }
- {
- for (FX_INT32 i=0, sz=m_aNativeFont.GetSize(); i<sz; i++)
- delete m_aNativeFont.GetAt(i);
-
- m_aNativeFont.RemoveAll();
- }
-}
-
-void CPWL_FontMap::Initial(FX_LPCSTR fontname)
-{
- CFX_ByteString sFontName = fontname;
-
- if (sFontName.IsEmpty())
- sFontName = DEFAULT_FONT_NAME;
-
- GetFontIndex(sFontName, ANSI_CHARSET, FALSE);
-
- //GetFontIndex(this->GetNativeFontName(nCharset), nCharset);
-}
-
-
-/*
-List of currently supported standard fonts:
-Courier, Courier-Bold, Courier-BoldOblique, Courier-Oblique
-Helvetica, Helvetica-Bold, Helvetica-BoldOblique, Helvetica-Oblique
-Times-Roman, Times-Bold, Times-Italic, Times-BoldItalic
-Symbol, ZapfDingbats
-*/
-
-const char* g_sDEStandardFontName[] = {"Courier", "Courier-Bold", "Courier-BoldOblique", "Courier-Oblique",
- "Helvetica", "Helvetica-Bold", "Helvetica-BoldOblique", "Helvetica-Oblique",
- "Times-Roman", "Times-Bold", "Times-Italic", "Times-BoldItalic",
- "Symbol", "ZapfDingbats"};
-
-FX_BOOL CPWL_FontMap::IsStandardFont(const CFX_ByteString& sFontName)
-{
- for (FX_INT32 i=0; i<14; i++)
- {
- if (sFontName == g_sDEStandardFontName[i])
- return TRUE;
- }
-
- return FALSE;
-}
-
-FX_INT32 CPWL_FontMap::FindFont(const CFX_ByteString& sFontName, FX_INT32 nCharset)
-{
- for (FX_INT32 i=0,sz=m_aData.GetSize(); i<sz; i++)
- {
- if (CPWL_FontMap_Data* pData = m_aData.GetAt(i))
- {
- if (nCharset == DEFAULT_CHARSET || nCharset == pData->nCharset)
- {
- if (sFontName.IsEmpty() || pData->sFontName == sFontName)
- return i;
- }
- }
- }
-
- return -1;
-}
-
-FX_INT32 CPWL_FontMap::GetFontIndex(const CFX_ByteString& sFontName, FX_INT32 nCharset, FX_BOOL bFind)
-{
- FX_INT32 nFontIndex = FindFont(EncodeFontAlias(sFontName, nCharset), nCharset);
- if (nFontIndex >= 0) return nFontIndex;
-
-// nFontIndex = FindFont("", nCharset);
-// if (nFontIndex >= 0) return nFontIndex;
-
- CFX_ByteString sAlias;
- CPDF_Font* pFont = NULL;
-
- if (bFind)
- pFont = FindFontSameCharset(sAlias, nCharset);
-
- if (!pFont)
- {
- CFX_ByteString sTemp = sFontName;
- pFont = AddFontToDocument(GetDocument(), sTemp, nCharset);
-
- /*
- if (FindFont(sAlias))
- {
- sAlias = EncodeFontAlias(sTemp, nCharset);
- }
- else
- */
- {
- sAlias = EncodeFontAlias(sTemp, nCharset);
- }
- }
-
- AddedFont(pFont, sAlias);
-
- return AddFontData(pFont, sAlias, nCharset);
-}
-
-FX_INT32 CPWL_FontMap::GetPWLFontIndex(FX_WORD word, FX_INT32 nCharset)
-{
- FX_INT32 nFind = -1;
-
- for (FX_INT32 i=0,sz=m_aData.GetSize(); i<sz; i++)
- {
- if (CPWL_FontMap_Data* pData = m_aData.GetAt(i))
- {
- if (pData->nCharset == nCharset)
- {
- nFind = i;
- break;
- }
- }
- }
-
- CPDF_Font* pNewFont = GetPDFFont(nFind);
-
- if (!pNewFont) return -1;
-
- /*
- if (CPDF_Font* pFont = GetPDFFont(nFind))
- {
- PWLFont.AddWordToFontDict(pFontDict, word);
- }
- */
-
-#ifdef FOXIT_CHROME_BUILD
- CFX_ByteString sAlias = EncodeFontAlias("Arial_Chrome", nCharset);
-#else
- CFX_ByteString sAlias = EncodeFontAlias("Arial_Foxit", nCharset);
-#endif
- AddedFont(pNewFont, sAlias);
-
- return AddFontData(pNewFont, sAlias, nCharset);
-}
-
-CPDF_Font* CPWL_FontMap::FindFontSameCharset(CFX_ByteString& sFontAlias, FX_INT32 nCharset)
-{
- return NULL;
-}
-
-FX_INT32 CPWL_FontMap::AddFontData(CPDF_Font* pFont, const CFX_ByteString& sFontAlias, FX_INT32 nCharset)
-{
- CPWL_FontMap_Data* pNewData = new CPWL_FontMap_Data;
- pNewData->pFont = pFont;
- pNewData->sFontName = sFontAlias;
- pNewData->nCharset = nCharset;
-
- m_aData.Add(pNewData);
-
- return m_aData.GetSize() -1;
-}
-
-void CPWL_FontMap::AddedFont(CPDF_Font* pFont, const CFX_ByteString& sFontAlias)
-{
-}
-
-CFX_ByteString CPWL_FontMap::GetFontName(FX_INT32 nFontIndex)
-{
- if (nFontIndex >=0 && nFontIndex < m_aData.GetSize())
- {
- if (CPWL_FontMap_Data* pData = m_aData.GetAt(nFontIndex))
- {
- return pData->sFontName;
- }
- }
-
- return "";
-}
-
-CFX_ByteString CPWL_FontMap::GetNativeFont(FX_INT32 nCharset)
-{
- CFX_ByteString sFontName;
-
- if (nCharset == DEFAULT_CHARSET)
- nCharset = GetNativeCharset();
-
- sFontName = GetDefaultFontByCharset(nCharset);
-
- if (m_pSystemHandler)
- {
- if (m_pSystemHandler->FindNativeTrueTypeFont(nCharset, sFontName))
- return sFontName;
-
- sFontName = m_pSystemHandler->GetNativeTrueTypeFont(nCharset);
- }
-
- return sFontName;
-}
-
-CPDF_Font* CPWL_FontMap::AddFontToDocument(CPDF_Document* pDoc, CFX_ByteString& sFontName, FX_BYTE nCharset)
-{
- if (IsStandardFont(sFontName))
- return AddStandardFont(pDoc, sFontName);
- else
- return AddSystemFont(pDoc, sFontName, nCharset);
-}
-
-CPDF_Font* CPWL_FontMap::AddStandardFont(CPDF_Document* pDoc, CFX_ByteString& sFontName)
-{
- if (!pDoc) return NULL;
-
- CPDF_Font* pFont = NULL;
-
- if (sFontName == "ZapfDingbats")
- pFont = pDoc->AddStandardFont(sFontName, NULL);
- else
- {
- CPDF_FontEncoding fe(PDFFONT_ENCODING_WINANSI);
- pFont = pDoc->AddStandardFont(sFontName, &fe);
- }
-
- return pFont;
-}
-
-CPDF_Font* CPWL_FontMap::AddSystemFont(CPDF_Document* pDoc, CFX_ByteString& sFontName, FX_BYTE nCharset)
-{
- if (!pDoc) return NULL;
-
- if (sFontName.IsEmpty()) sFontName = GetNativeFont(nCharset);
- if (nCharset == DEFAULT_CHARSET) nCharset = GetNativeCharset();
-
- if (m_pSystemHandler)
- return m_pSystemHandler->AddNativeTrueTypeFontToPDF(pDoc, sFontName, nCharset);
-
- return NULL;
-}
-
-CFX_ByteString CPWL_FontMap::EncodeFontAlias(const CFX_ByteString& sFontName, FX_INT32 nCharset)
-{
- CFX_ByteString sPostfix;
- sPostfix.Format("_%02X", nCharset);
- return EncodeFontAlias(sFontName) + sPostfix;
-}
-
-CFX_ByteString CPWL_FontMap::EncodeFontAlias(const CFX_ByteString& sFontName)
-{
- CFX_ByteString sRet = sFontName;
- sRet.Remove(' ');
- return sRet;
-}
-
-FX_INT32 CPWL_FontMap::GetFontMapCount() const
-{
- return m_aData.GetSize();
-}
-
-const CPWL_FontMap_Data* CPWL_FontMap::GetFontMapData(FX_INT32 nIndex) const
-{
- if (nIndex >=0 && nIndex < m_aData.GetSize())
- {
- return m_aData.GetAt(nIndex);
- }
-
- return NULL;
-}
-
-FX_INT32 CPWL_FontMap::GetNativeCharset()
-{
- FX_BYTE nCharset = ANSI_CHARSET;
- FX_INT32 iCodePage = FXSYS_GetACP();
- switch (iCodePage)
- {
- case 932://Japan
- nCharset = SHIFTJIS_CHARSET;
- break;
- case 936://Chinese (PRC, Singapore)
- nCharset = GB2312_CHARSET;
- break;
- case 950://Chinese (Taiwan; Hong Kong SAR, PRC)
- nCharset = GB2312_CHARSET;
- break;
- case 1252://Windows 3.1 Latin 1 (US, Western Europe)
- nCharset = ANSI_CHARSET;
- break;
- case 874://Thai
- nCharset = THAI_CHARSET;
- break;
- case 949://Korean
- nCharset = HANGUL_CHARSET;
- break;
- case 1200://Unicode (BMP of ISO 10646)
- nCharset = ANSI_CHARSET;
- break;
- case 1250://Windows 3.1 Eastern European
- nCharset = EASTEUROPE_CHARSET;
- break;
- case 1251://Windows 3.1 Cyrillic
- nCharset = RUSSIAN_CHARSET;
- break;
- case 1253://Windows 3.1 Greek
- nCharset = GREEK_CHARSET;
- break;
- case 1254://Windows 3.1 Turkish
- nCharset = TURKISH_CHARSET;
- break;
- case 1255://Hebrew
- nCharset = HEBREW_CHARSET;
- break;
- case 1256://Arabic
- nCharset = ARABIC_CHARSET;
- break;
- case 1257://Baltic
- nCharset = BALTIC_CHARSET;
- break;
- case 1258://Vietnamese
- nCharset = VIETNAMESE_CHARSET;
- break;
- case 1361://Korean(Johab)
- nCharset = JOHAB_CHARSET;
- break;
- }
- return nCharset;
-}
-
-const CPWL_FontMap::CharsetFontMap CPWL_FontMap::defaultTTFMap[] = {
- { ANSI_CHARSET, "Helvetica" },
- { GB2312_CHARSET, "SimSun" },
- { CHINESEBIG5_CHARSET, "MingLiU" },
- { SHIFTJIS_CHARSET, "MS Gothic" },
- { HANGUL_CHARSET, "Batang" },
- { RUSSIAN_CHARSET, "Arial" },
- { EASTEUROPE_CHARSET, "Tahoma" },
- { ARABIC_CHARSET, "Arial" },
- { -1, NULL }
-};
-
-CFX_ByteString CPWL_FontMap::GetDefaultFontByCharset(FX_INT32 nCharset)
-{
- int i = 0;
- while (defaultTTFMap[i].charset != -1) {
- if (nCharset == defaultTTFMap[i].charset)
- return defaultTTFMap[i].fontname;
- ++i;
- }
- return "";
-}
-
-FX_INT32 CPWL_FontMap::CharSetFromUnicode(FX_WORD word, FX_INT32 nOldCharset)
-{
- if(m_pSystemHandler && (-1 != m_pSystemHandler->GetCharSet()))
- return m_pSystemHandler->GetCharSet();
- //to avoid CJK Font to show ASCII
- if (word < 0x7F) return ANSI_CHARSET;
- //follow the old charset
- if (nOldCharset != DEFAULT_CHARSET) return nOldCharset;
-
- //find new charset
- if ((word >= 0x4E00 && word <= 0x9FA5) ||
- (word >= 0xE7C7 && word <= 0xE7F3) ||
- (word >= 0x3000 && word <= 0x303F) || //£©"¡¶" "¡·" "¡£" "¡¢"
- (word >= 0x2000 && word <= 0x206F))
- {
- return GB2312_CHARSET;
- }
-
- if (((word >= 0x3040) && (word <= 0x309F)) ||
- ((word >= 0x30A0) && (word <= 0x30FF)) ||
- ((word >= 0x31F0) && (word <= 0x31FF)) ||
- ((word >= 0xFF00) && (word <= 0xFFEF)) )
- {
- return SHIFTJIS_CHARSET;
- }
-
- if (((word >= 0xAC00) && (word <= 0xD7AF)) ||
- ((word >= 0x1100) && (word <= 0x11FF)) ||
- ((word >= 0x3130) && (word <= 0x318F)))
- {
- return HANGUL_CHARSET;
- }
-
- if (word >= 0x0E00 && word <= 0x0E7F)
- return THAI_CHARSET;
-
- if ((word >= 0x0370 && word <= 0x03FF) ||
- (word >= 0x1F00 && word <= 0x1FFF))
- return GREEK_CHARSET;
-
- if ((word >= 0x0600 && word <= 0x06FF) ||
- (word >= 0xFB50 && word <= 0xFEFC))
- return ARABIC_CHARSET;
-
- if (word >= 0x0590 && word <= 0x05FF)
- return HEBREW_CHARSET;
-
- if (word >= 0x0400 && word <= 0x04FF)
- return RUSSIAN_CHARSET;
-
- if (word >= 0x0100 && word <= 0x024F)
- return EASTEUROPE_CHARSET;
-
- if (word >= 0x1E00 && word <= 0x1EFF)
- return VIETNAMESE_CHARSET;
-
- return ANSI_CHARSET;
-}
-
-/* ------------------------ CPWL_DocFontMap ------------------------ */
-
-CPWL_DocFontMap::CPWL_DocFontMap(IFX_SystemHandler* pSystemHandler, CPDF_Document* pAttachedDoc)
- : CPWL_FontMap(pSystemHandler),
- m_pAttachedDoc(pAttachedDoc)
-{
-}
-
-CPWL_DocFontMap::~CPWL_DocFontMap()
-{
-}
-
-CPDF_Document* CPWL_DocFontMap::GetDocument()
-{
- return m_pAttachedDoc;
-}
+// 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
+
+#include "../../include/pdfwindow/PDFWindow.h"
+#include "../../include/pdfwindow/PWL_Wnd.h"
+#include "../../include/pdfwindow/PWL_FontMap.h"
+
+#define DEFAULT_FONT_NAME "Helvetica"
+
+/* ------------------------------ CPWL_FontMap ------------------------------ */
+
+CPWL_FontMap::CPWL_FontMap(IFX_SystemHandler* pSystemHandler) :
+ m_pPDFDoc(NULL),
+ m_pSystemHandler(pSystemHandler)
+{
+ ASSERT(m_pSystemHandler != NULL);
+}
+
+CPWL_FontMap::~CPWL_FontMap()
+{
+ if (m_pPDFDoc)
+ {
+ delete m_pPDFDoc;
+ m_pPDFDoc = NULL;
+ }
+
+ Empty();
+}
+
+void CPWL_FontMap::SetSystemHandler(IFX_SystemHandler* pSystemHandler)
+{
+ m_pSystemHandler = pSystemHandler;
+}
+
+CPDF_Document* CPWL_FontMap::GetDocument()
+{
+ if (!m_pPDFDoc)
+ {
+ if (CPDF_ModuleMgr::Get())
+ {
+ m_pPDFDoc = FX_NEW CPDF_Document;
+ m_pPDFDoc->CreateNewDoc();
+ }
+ }
+
+ return m_pPDFDoc;
+}
+
+CPDF_Font* CPWL_FontMap::GetPDFFont(FX_INT32 nFontIndex)
+{
+ if (nFontIndex >=0 && nFontIndex < m_aData.GetSize())
+ {
+ if (CPWL_FontMap_Data* pData = m_aData.GetAt(nFontIndex))
+ {
+ return pData->pFont;
+ }
+ }
+
+ return NULL;
+}
+
+CFX_ByteString CPWL_FontMap::GetPDFFontAlias(FX_INT32 nFontIndex)
+{
+ if (nFontIndex >=0 && nFontIndex < m_aData.GetSize())
+ {
+ if (CPWL_FontMap_Data* pData = m_aData.GetAt(nFontIndex))
+ {
+ return pData->sFontName;
+ }
+ }
+
+ return "";
+}
+
+FX_BOOL CPWL_FontMap::KnowWord(FX_INT32 nFontIndex, FX_WORD word)
+{
+ if (nFontIndex >=0 && nFontIndex < m_aData.GetSize())
+ {
+ if (m_aData.GetAt(nFontIndex))
+ {
+ return CharCodeFromUnicode(nFontIndex, word) >= 0;
+ }
+ }
+
+ return FALSE;
+}
+
+FX_INT32 CPWL_FontMap::GetWordFontIndex(FX_WORD word, FX_INT32 nCharset, FX_INT32 nFontIndex)
+{
+ if (nFontIndex > 0)
+ {
+ if (KnowWord(nFontIndex, word))
+ return nFontIndex;
+ }
+ else
+ {
+ if (const CPWL_FontMap_Data* pData = GetFontMapData(0))
+ {
+ if (nCharset == DEFAULT_CHARSET ||
+ pData->nCharset == SYMBOL_CHARSET ||
+ nCharset == pData->nCharset)
+ {
+ if (KnowWord(0, word))
+ {
+ return 0;
+ }
+ }
+ }
+ }
+
+ FX_INT32 nNewFontIndex = -1;
+
+ nNewFontIndex = this->GetFontIndex(GetNativeFontName(nCharset), nCharset, TRUE);
+ if (nNewFontIndex >= 0)
+ {
+ if (KnowWord(nNewFontIndex, word))
+ return nNewFontIndex;
+ }
+
+ nNewFontIndex = this->GetFontIndex("Arial Unicode MS", DEFAULT_CHARSET, FALSE);
+ if (nNewFontIndex >= 0)
+ {
+ if (KnowWord(nNewFontIndex, word))
+ return nNewFontIndex;
+ }
+
+ return -1;
+}
+
+FX_INT32 CPWL_FontMap::CharCodeFromUnicode(FX_INT32 nFontIndex, FX_WORD word)
+{
+ if (CPWL_FontMap_Data* pData = m_aData.GetAt(nFontIndex))
+ {
+ if (pData->pFont)
+ {
+ if (pData->pFont->IsUnicodeCompatible())
+ {
+ int nCharCode = pData->pFont->CharCodeFromUnicode(word);
+ pData->pFont->GlyphFromCharCode(nCharCode);
+ return nCharCode;
+ }
+ else
+ {
+ if (word < 0xFF)
+ return word;
+ }
+ }
+ }
+
+ return -1;
+}
+
+CFX_ByteString CPWL_FontMap::GetNativeFontName(FX_INT32 nCharset)
+{
+ //searching native font is slow, so we must save time
+ for (FX_INT32 i=0,sz=m_aNativeFont.GetSize(); i<sz; i++)
+ {
+ if (CPWL_FontMap_Native* pData = m_aNativeFont.GetAt(i))
+ {
+ if (pData->nCharset == nCharset)
+ return pData->sFontName;
+ }
+ }
+
+ CFX_ByteString sNew = GetNativeFont(nCharset);
+
+ if (!sNew.IsEmpty())
+ {
+ CPWL_FontMap_Native* pNewData = new CPWL_FontMap_Native;
+ pNewData->nCharset = nCharset;
+ pNewData->sFontName = sNew;
+
+ m_aNativeFont.Add(pNewData);
+ }
+
+ return sNew;
+}
+
+void CPWL_FontMap::Empty()
+{
+ {
+ for (FX_INT32 i=0, sz=m_aData.GetSize(); i<sz; i++)
+ delete m_aData.GetAt(i);
+
+ m_aData.RemoveAll();
+ }
+ {
+ for (FX_INT32 i=0, sz=m_aNativeFont.GetSize(); i<sz; i++)
+ delete m_aNativeFont.GetAt(i);
+
+ m_aNativeFont.RemoveAll();
+ }
+}
+
+void CPWL_FontMap::Initial(FX_LPCSTR fontname)
+{
+ CFX_ByteString sFontName = fontname;
+
+ if (sFontName.IsEmpty())
+ sFontName = DEFAULT_FONT_NAME;
+
+ GetFontIndex(sFontName, ANSI_CHARSET, FALSE);
+
+ //GetFontIndex(this->GetNativeFontName(nCharset), nCharset);
+}
+
+
+/*
+List of currently supported standard fonts:
+Courier, Courier-Bold, Courier-BoldOblique, Courier-Oblique
+Helvetica, Helvetica-Bold, Helvetica-BoldOblique, Helvetica-Oblique
+Times-Roman, Times-Bold, Times-Italic, Times-BoldItalic
+Symbol, ZapfDingbats
+*/
+
+const char* g_sDEStandardFontName[] = {"Courier", "Courier-Bold", "Courier-BoldOblique", "Courier-Oblique",
+ "Helvetica", "Helvetica-Bold", "Helvetica-BoldOblique", "Helvetica-Oblique",
+ "Times-Roman", "Times-Bold", "Times-Italic", "Times-BoldItalic",
+ "Symbol", "ZapfDingbats"};
+
+FX_BOOL CPWL_FontMap::IsStandardFont(const CFX_ByteString& sFontName)
+{
+ for (FX_INT32 i=0; i<14; i++)
+ {
+ if (sFontName == g_sDEStandardFontName[i])
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+FX_INT32 CPWL_FontMap::FindFont(const CFX_ByteString& sFontName, FX_INT32 nCharset)
+{
+ for (FX_INT32 i=0,sz=m_aData.GetSize(); i<sz; i++)
+ {
+ if (CPWL_FontMap_Data* pData = m_aData.GetAt(i))
+ {
+ if (nCharset == DEFAULT_CHARSET || nCharset == pData->nCharset)
+ {
+ if (sFontName.IsEmpty() || pData->sFontName == sFontName)
+ return i;
+ }
+ }
+ }
+
+ return -1;
+}
+
+FX_INT32 CPWL_FontMap::GetFontIndex(const CFX_ByteString& sFontName, FX_INT32 nCharset, FX_BOOL bFind)
+{
+ FX_INT32 nFontIndex = FindFont(EncodeFontAlias(sFontName, nCharset), nCharset);
+ if (nFontIndex >= 0) return nFontIndex;
+
+// nFontIndex = FindFont("", nCharset);
+// if (nFontIndex >= 0) return nFontIndex;
+
+ CFX_ByteString sAlias;
+ CPDF_Font* pFont = NULL;
+
+ if (bFind)
+ pFont = FindFontSameCharset(sAlias, nCharset);
+
+ if (!pFont)
+ {
+ CFX_ByteString sTemp = sFontName;
+ pFont = AddFontToDocument(GetDocument(), sTemp, nCharset);
+
+ /*
+ if (FindFont(sAlias))
+ {
+ sAlias = EncodeFontAlias(sTemp, nCharset);
+ }
+ else
+ */
+ {
+ sAlias = EncodeFontAlias(sTemp, nCharset);
+ }
+ }
+
+ AddedFont(pFont, sAlias);
+
+ return AddFontData(pFont, sAlias, nCharset);
+}
+
+FX_INT32 CPWL_FontMap::GetPWLFontIndex(FX_WORD word, FX_INT32 nCharset)
+{
+ FX_INT32 nFind = -1;
+
+ for (FX_INT32 i=0,sz=m_aData.GetSize(); i<sz; i++)
+ {
+ if (CPWL_FontMap_Data* pData = m_aData.GetAt(i))
+ {
+ if (pData->nCharset == nCharset)
+ {
+ nFind = i;
+ break;
+ }
+ }
+ }
+
+ CPDF_Font* pNewFont = GetPDFFont(nFind);
+
+ if (!pNewFont) return -1;
+
+ /*
+ if (CPDF_Font* pFont = GetPDFFont(nFind))
+ {
+ PWLFont.AddWordToFontDict(pFontDict, word);
+ }
+ */
+
+#ifdef FOXIT_CHROME_BUILD
+ CFX_ByteString sAlias = EncodeFontAlias("Arial_Chrome", nCharset);
+#else
+ CFX_ByteString sAlias = EncodeFontAlias("Arial_Foxit", nCharset);
+#endif
+ AddedFont(pNewFont, sAlias);
+
+ return AddFontData(pNewFont, sAlias, nCharset);
+}
+
+CPDF_Font* CPWL_FontMap::FindFontSameCharset(CFX_ByteString& sFontAlias, FX_INT32 nCharset)
+{
+ return NULL;
+}
+
+FX_INT32 CPWL_FontMap::AddFontData(CPDF_Font* pFont, const CFX_ByteString& sFontAlias, FX_INT32 nCharset)
+{
+ CPWL_FontMap_Data* pNewData = new CPWL_FontMap_Data;
+ pNewData->pFont = pFont;
+ pNewData->sFontName = sFontAlias;
+ pNewData->nCharset = nCharset;
+
+ m_aData.Add(pNewData);
+
+ return m_aData.GetSize() -1;
+}
+
+void CPWL_FontMap::AddedFont(CPDF_Font* pFont, const CFX_ByteString& sFontAlias)
+{
+}
+
+CFX_ByteString CPWL_FontMap::GetFontName(FX_INT32 nFontIndex)
+{
+ if (nFontIndex >=0 && nFontIndex < m_aData.GetSize())
+ {
+ if (CPWL_FontMap_Data* pData = m_aData.GetAt(nFontIndex))
+ {
+ return pData->sFontName;
+ }
+ }
+
+ return "";
+}
+
+CFX_ByteString CPWL_FontMap::GetNativeFont(FX_INT32 nCharset)
+{
+ CFX_ByteString sFontName;
+
+ if (nCharset == DEFAULT_CHARSET)
+ nCharset = GetNativeCharset();
+
+ sFontName = GetDefaultFontByCharset(nCharset);
+
+ if (m_pSystemHandler)
+ {
+ if (m_pSystemHandler->FindNativeTrueTypeFont(nCharset, sFontName))
+ return sFontName;
+
+ sFontName = m_pSystemHandler->GetNativeTrueTypeFont(nCharset);
+ }
+
+ return sFontName;
+}
+
+CPDF_Font* CPWL_FontMap::AddFontToDocument(CPDF_Document* pDoc, CFX_ByteString& sFontName, FX_BYTE nCharset)
+{
+ if (IsStandardFont(sFontName))
+ return AddStandardFont(pDoc, sFontName);
+ else
+ return AddSystemFont(pDoc, sFontName, nCharset);
+}
+
+CPDF_Font* CPWL_FontMap::AddStandardFont(CPDF_Document* pDoc, CFX_ByteString& sFontName)
+{
+ if (!pDoc) return NULL;
+
+ CPDF_Font* pFont = NULL;
+
+ if (sFontName == "ZapfDingbats")
+ pFont = pDoc->AddStandardFont(sFontName, NULL);
+ else
+ {
+ CPDF_FontEncoding fe(PDFFONT_ENCODING_WINANSI);
+ pFont = pDoc->AddStandardFont(sFontName, &fe);
+ }
+
+ return pFont;
+}
+
+CPDF_Font* CPWL_FontMap::AddSystemFont(CPDF_Document* pDoc, CFX_ByteString& sFontName, FX_BYTE nCharset)
+{
+ if (!pDoc) return NULL;
+
+ if (sFontName.IsEmpty()) sFontName = GetNativeFont(nCharset);
+ if (nCharset == DEFAULT_CHARSET) nCharset = GetNativeCharset();
+
+ if (m_pSystemHandler)
+ return m_pSystemHandler->AddNativeTrueTypeFontToPDF(pDoc, sFontName, nCharset);
+
+ return NULL;
+}
+
+CFX_ByteString CPWL_FontMap::EncodeFontAlias(const CFX_ByteString& sFontName, FX_INT32 nCharset)
+{
+ CFX_ByteString sPostfix;
+ sPostfix.Format("_%02X", nCharset);
+ return EncodeFontAlias(sFontName) + sPostfix;
+}
+
+CFX_ByteString CPWL_FontMap::EncodeFontAlias(const CFX_ByteString& sFontName)
+{
+ CFX_ByteString sRet = sFontName;
+ sRet.Remove(' ');
+ return sRet;
+}
+
+FX_INT32 CPWL_FontMap::GetFontMapCount() const
+{
+ return m_aData.GetSize();
+}
+
+const CPWL_FontMap_Data* CPWL_FontMap::GetFontMapData(FX_INT32 nIndex) const
+{
+ if (nIndex >=0 && nIndex < m_aData.GetSize())
+ {
+ return m_aData.GetAt(nIndex);
+ }
+
+ return NULL;
+}
+
+FX_INT32 CPWL_FontMap::GetNativeCharset()
+{
+ FX_BYTE nCharset = ANSI_CHARSET;
+ FX_INT32 iCodePage = FXSYS_GetACP();
+ switch (iCodePage)
+ {
+ case 932://Japan
+ nCharset = SHIFTJIS_CHARSET;
+ break;
+ case 936://Chinese (PRC, Singapore)
+ nCharset = GB2312_CHARSET;
+ break;
+ case 950://Chinese (Taiwan; Hong Kong SAR, PRC)
+ nCharset = GB2312_CHARSET;
+ break;
+ case 1252://Windows 3.1 Latin 1 (US, Western Europe)
+ nCharset = ANSI_CHARSET;
+ break;
+ case 874://Thai
+ nCharset = THAI_CHARSET;
+ break;
+ case 949://Korean
+ nCharset = HANGUL_CHARSET;
+ break;
+ case 1200://Unicode (BMP of ISO 10646)
+ nCharset = ANSI_CHARSET;
+ break;
+ case 1250://Windows 3.1 Eastern European
+ nCharset = EASTEUROPE_CHARSET;
+ break;
+ case 1251://Windows 3.1 Cyrillic
+ nCharset = RUSSIAN_CHARSET;
+ break;
+ case 1253://Windows 3.1 Greek
+ nCharset = GREEK_CHARSET;
+ break;
+ case 1254://Windows 3.1 Turkish
+ nCharset = TURKISH_CHARSET;
+ break;
+ case 1255://Hebrew
+ nCharset = HEBREW_CHARSET;
+ break;
+ case 1256://Arabic
+ nCharset = ARABIC_CHARSET;
+ break;
+ case 1257://Baltic
+ nCharset = BALTIC_CHARSET;
+ break;
+ case 1258://Vietnamese
+ nCharset = VIETNAMESE_CHARSET;
+ break;
+ case 1361://Korean(Johab)
+ nCharset = JOHAB_CHARSET;
+ break;
+ }
+ return nCharset;
+}
+
+const CPWL_FontMap::CharsetFontMap CPWL_FontMap::defaultTTFMap[] = {
+ { ANSI_CHARSET, "Helvetica" },
+ { GB2312_CHARSET, "SimSun" },
+ { CHINESEBIG5_CHARSET, "MingLiU" },
+ { SHIFTJIS_CHARSET, "MS Gothic" },
+ { HANGUL_CHARSET, "Batang" },
+ { RUSSIAN_CHARSET, "Arial" },
+ { EASTEUROPE_CHARSET, "Tahoma" },
+ { ARABIC_CHARSET, "Arial" },
+ { -1, NULL }
+};
+
+CFX_ByteString CPWL_FontMap::GetDefaultFontByCharset(FX_INT32 nCharset)
+{
+ int i = 0;
+ while (defaultTTFMap[i].charset != -1) {
+ if (nCharset == defaultTTFMap[i].charset)
+ return defaultTTFMap[i].fontname;
+ ++i;
+ }
+ return "";
+}
+
+FX_INT32 CPWL_FontMap::CharSetFromUnicode(FX_WORD word, FX_INT32 nOldCharset)
+{
+ if(m_pSystemHandler && (-1 != m_pSystemHandler->GetCharSet()))
+ return m_pSystemHandler->GetCharSet();
+ //to avoid CJK Font to show ASCII
+ if (word < 0x7F) return ANSI_CHARSET;
+ //follow the old charset
+ if (nOldCharset != DEFAULT_CHARSET) return nOldCharset;
+
+ //find new charset
+ if ((word >= 0x4E00 && word <= 0x9FA5) ||
+ (word >= 0xE7C7 && word <= 0xE7F3) ||
+ (word >= 0x3000 && word <= 0x303F) || //£©"¡¶" "¡·" "¡£" "¡¢"
+ (word >= 0x2000 && word <= 0x206F))
+ {
+ return GB2312_CHARSET;
+ }
+
+ if (((word >= 0x3040) && (word <= 0x309F)) ||
+ ((word >= 0x30A0) && (word <= 0x30FF)) ||
+ ((word >= 0x31F0) && (word <= 0x31FF)) ||
+ ((word >= 0xFF00) && (word <= 0xFFEF)) )
+ {
+ return SHIFTJIS_CHARSET;
+ }
+
+ if (((word >= 0xAC00) && (word <= 0xD7AF)) ||
+ ((word >= 0x1100) && (word <= 0x11FF)) ||
+ ((word >= 0x3130) && (word <= 0x318F)))
+ {
+ return HANGUL_CHARSET;
+ }
+
+ if (word >= 0x0E00 && word <= 0x0E7F)
+ return THAI_CHARSET;
+
+ if ((word >= 0x0370 && word <= 0x03FF) ||
+ (word >= 0x1F00 && word <= 0x1FFF))
+ return GREEK_CHARSET;
+
+ if ((word >= 0x0600 && word <= 0x06FF) ||
+ (word >= 0xFB50 && word <= 0xFEFC))
+ return ARABIC_CHARSET;
+
+ if (word >= 0x0590 && word <= 0x05FF)
+ return HEBREW_CHARSET;
+
+ if (word >= 0x0400 && word <= 0x04FF)
+ return RUSSIAN_CHARSET;
+
+ if (word >= 0x0100 && word <= 0x024F)
+ return EASTEUROPE_CHARSET;
+
+ if (word >= 0x1E00 && word <= 0x1EFF)
+ return VIETNAMESE_CHARSET;
+
+ return ANSI_CHARSET;
+}
+
+/* ------------------------ CPWL_DocFontMap ------------------------ */
+
+CPWL_DocFontMap::CPWL_DocFontMap(IFX_SystemHandler* pSystemHandler, CPDF_Document* pAttachedDoc)
+ : CPWL_FontMap(pSystemHandler),
+ m_pAttachedDoc(pAttachedDoc)
+{
+}
+
+CPWL_DocFontMap::~CPWL_DocFontMap()
+{
+}
+
+CPDF_Document* CPWL_DocFontMap::GetDocument()
+{
+ return m_pAttachedDoc;
+}
diff --git a/fpdfsdk/src/pdfwindow/PWL_Icon.cpp b/fpdfsdk/src/pdfwindow/PWL_Icon.cpp
index a859a52de7..b85b845553 100644
--- a/fpdfsdk/src/pdfwindow/PWL_Icon.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_Icon.cpp
@@ -1,272 +1,272 @@
-// 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
-
-#include "../../include/pdfwindow/PDFWindow.h"
-#include "../../include/pdfwindow/PWL_Wnd.h"
-#include "../../include/pdfwindow/PWL_Icon.h"
-#include "../../include/pdfwindow/PWL_Utils.h"
-
-/* ------------------------------- CPWL_Image ---------------------------------- */
-
-CPWL_Image::CPWL_Image() : m_pPDFStream(NULL)
-{
-}
-
-CPWL_Image::~CPWL_Image()
-{
-}
-
-CFX_ByteString CPWL_Image::GetImageAppStream()
-{
- CFX_ByteTextBuf sAppStream;
-
- CFX_ByteString sAlias = this->GetImageAlias();
- CPDF_Rect rcPlate = GetClientRect();
- CPDF_Matrix mt;
- mt.SetReverse(GetImageMatrix());
-
- FX_FLOAT fHScale = 1.0f;
- FX_FLOAT fVScale = 1.0f;
- GetScale(fHScale,fVScale);
-
- FX_FLOAT fx = 0.0f;
- FX_FLOAT fy = 0.0f;
- GetImageOffset(fx,fy);
-
- if (m_pPDFStream && sAlias.GetLength()>0)
- {
- sAppStream << "q\n";
- sAppStream << rcPlate.left << " " << rcPlate.bottom << " "
- << rcPlate.right - rcPlate.left << " " << rcPlate.top - rcPlate.bottom << " re W n\n";
-
- sAppStream << fHScale << " 0 0 " << fVScale << " " << rcPlate.left + fx << " " << rcPlate.bottom + fy << " cm\n";
- sAppStream << mt.GetA() << " " << mt.GetB() << " " << mt.GetC() << " " << mt.GetD() << " " << mt.GetE() << " " << mt.GetF() << " cm\n";
-
- sAppStream << "0 g 0 G 1 w /" << sAlias << " Do\n" << "Q\n";
- }
-
- return sAppStream.GetByteString();
-}
-
-void CPWL_Image::SetPDFStream(CPDF_Stream * pStream)
-{
- m_pPDFStream = pStream;
-}
-
-CPDF_Stream * CPWL_Image::GetPDFStream()
-{
- return this->m_pPDFStream;
-}
-
-void CPWL_Image::GetImageSize(FX_FLOAT & fWidth,FX_FLOAT & fHeight)
-{
- fWidth = 0.0f;
- fHeight = 0.0f;
-
- if (m_pPDFStream)
- {
- if (CPDF_Dictionary * pDict = m_pPDFStream->GetDict())
- {
- CPDF_Rect rect = pDict->GetRect("BBox");
-
- fWidth = rect.right - rect.left;
- fHeight = rect.top - rect.bottom;
- }
- }
-}
-
-CPDF_Matrix CPWL_Image::GetImageMatrix()
-{
- if (m_pPDFStream)
- {
- if (CPDF_Dictionary * pDict = m_pPDFStream->GetDict())
- {
- return pDict->GetMatrix("Matrix");
- }
- }
-
- return CPDF_Matrix();
-}
-
-CFX_ByteString CPWL_Image::GetImageAlias()
-{
- if (m_sImageAlias.IsEmpty())
- {
- if (m_pPDFStream)
- {
- if (CPDF_Dictionary * pDict = m_pPDFStream->GetDict())
- {
- return pDict->GetString("Name");
- }
- }
- }
- else
- return m_sImageAlias;
-
- return CFX_ByteString();
-}
-
-void CPWL_Image::SetImageAlias(FX_LPCSTR sImageAlias)
-{
- m_sImageAlias = sImageAlias;
-}
-
-void CPWL_Image::GetScale(FX_FLOAT & fHScale,FX_FLOAT & fVScale)
-{
- fHScale = 1.0f;
- fVScale = 1.0f;
-}
-
-
-void CPWL_Image::GetImageOffset(FX_FLOAT & x,FX_FLOAT & y)
-{
- x = 0.0f;
- y = 0.0f;
-}
-
-/* ------------------------------- CPWL_Icon ---------------------------------- */
-
-CPWL_Icon::CPWL_Icon() : m_pIconFit(NULL)
-{
-}
-
-CPWL_Icon::~CPWL_Icon()
-{
-}
-
-FX_INT32 CPWL_Icon::GetScaleMethod()
-{
- if (m_pIconFit)
- return m_pIconFit->GetScaleMethod();
-
- return 0;
-}
-
-FX_BOOL CPWL_Icon::IsProportionalScale()
-{
- if (m_pIconFit)
- return m_pIconFit->IsProportionalScale();
-
- return FALSE;
-}
-
-void CPWL_Icon::GetIconPosition(FX_FLOAT & fLeft, FX_FLOAT & fBottom)
-{
- if (m_pIconFit)
- {
- //m_pIconFit->GetIconPosition(fLeft,fBottom);
- fLeft = 0.0f;
- fBottom = 0.0f;
- CPDF_Array* pA = m_pIconFit->m_pDict->GetArray("A");
- if (pA != NULL)
- {
- FX_DWORD dwCount = pA->GetCount();
- if (dwCount > 0) fLeft = pA->GetNumber(0);
- if (dwCount > 1) fBottom = pA->GetNumber(1);
- }
- }
- else
- {
- fLeft = 0.0f;
- fBottom = 0.0f;
- }
-}
-
-FX_BOOL CPWL_Icon::GetFittingBounds()
-{
- if (m_pIconFit)
- return m_pIconFit->GetFittingBounds();
-
- return FALSE;
-}
-
-void CPWL_Icon::GetScale(FX_FLOAT & fHScale,FX_FLOAT & fVScale)
-{
- fHScale = 1.0f;
- fVScale = 1.0f;
-
- if (m_pPDFStream)
- {
- FX_FLOAT fImageWidth,fImageHeight;
- FX_FLOAT fPlateWidth,fPlateHeight;
-
- CPDF_Rect rcPlate = this->GetClientRect();
- fPlateWidth = rcPlate.right - rcPlate.left;
- fPlateHeight = rcPlate.top - rcPlate.bottom;
-
- GetImageSize(fImageWidth,fImageHeight);
-
- FX_INT32 nScaleMethod = this->GetScaleMethod();
-
- /*
- enum ScaleMethod
- {
- Always = 0, //A, Always scale
- Bigger, //B, Scale only when the icon is bigger than the annotation rectangle
- Smaller, //S, Scale only when the icon is smaller then the annotation rectangle
- Never //N, Never scale
- };
- */
-
- switch (nScaleMethod)
- {
- default:
- case 0:
- fHScale = fPlateWidth / PWL_MAX(fImageWidth,1.0f);
- fVScale = fPlateHeight / PWL_MAX(fImageHeight,1.0f);
- break;
- case 1:
- if (fPlateWidth < fImageWidth)
- fHScale = fPlateWidth / PWL_MAX(fImageWidth,1.0f);
- if (fPlateHeight < fImageHeight)
- fVScale = fPlateHeight / PWL_MAX(fImageHeight,1.0f);
- break;
- case 2:
- if (fPlateWidth > fImageWidth)
- fHScale = fPlateWidth / PWL_MAX(fImageWidth,1.0f);
- if (fPlateHeight > fImageHeight)
- fVScale = fPlateHeight / PWL_MAX(fImageHeight,1.0f);
- break;
- case 3:
- break;
- }
-
- FX_FLOAT fMinScale;
- if (IsProportionalScale())
- {
- fMinScale = PWL_MIN(fHScale,fVScale);
- fHScale = fMinScale;
- fVScale = fMinScale;
- }
- }
-}
-
-void CPWL_Icon::GetImageOffset(FX_FLOAT & x,FX_FLOAT & y)
-{
- FX_FLOAT fLeft,fBottom;
-
- this->GetIconPosition(fLeft,fBottom);
- x = 0.0f;
- y = 0.0f;
-
- FX_FLOAT fImageWidth,fImageHeight;
- GetImageSize(fImageWidth,fImageHeight);
-
- FX_FLOAT fHScale,fVScale;
- GetScale(fHScale,fVScale);
-
- FX_FLOAT fImageFactWidth = fImageWidth * fHScale;
- FX_FLOAT fImageFactHeight = fImageHeight * fVScale;
-
- FX_FLOAT fPlateWidth,fPlateHeight;
- CPDF_Rect rcPlate = this->GetClientRect();
- fPlateWidth = rcPlate.right - rcPlate.left;
- fPlateHeight = rcPlate.top - rcPlate.bottom;
-
- x = (fPlateWidth - fImageFactWidth) * fLeft;
- y = (fPlateHeight - fImageFactHeight) * fBottom;
-}
-
+// 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
+
+#include "../../include/pdfwindow/PDFWindow.h"
+#include "../../include/pdfwindow/PWL_Wnd.h"
+#include "../../include/pdfwindow/PWL_Icon.h"
+#include "../../include/pdfwindow/PWL_Utils.h"
+
+/* ------------------------------- CPWL_Image ---------------------------------- */
+
+CPWL_Image::CPWL_Image() : m_pPDFStream(NULL)
+{
+}
+
+CPWL_Image::~CPWL_Image()
+{
+}
+
+CFX_ByteString CPWL_Image::GetImageAppStream()
+{
+ CFX_ByteTextBuf sAppStream;
+
+ CFX_ByteString sAlias = this->GetImageAlias();
+ CPDF_Rect rcPlate = GetClientRect();
+ CPDF_Matrix mt;
+ mt.SetReverse(GetImageMatrix());
+
+ FX_FLOAT fHScale = 1.0f;
+ FX_FLOAT fVScale = 1.0f;
+ GetScale(fHScale,fVScale);
+
+ FX_FLOAT fx = 0.0f;
+ FX_FLOAT fy = 0.0f;
+ GetImageOffset(fx,fy);
+
+ if (m_pPDFStream && sAlias.GetLength()>0)
+ {
+ sAppStream << "q\n";
+ sAppStream << rcPlate.left << " " << rcPlate.bottom << " "
+ << rcPlate.right - rcPlate.left << " " << rcPlate.top - rcPlate.bottom << " re W n\n";
+
+ sAppStream << fHScale << " 0 0 " << fVScale << " " << rcPlate.left + fx << " " << rcPlate.bottom + fy << " cm\n";
+ sAppStream << mt.GetA() << " " << mt.GetB() << " " << mt.GetC() << " " << mt.GetD() << " " << mt.GetE() << " " << mt.GetF() << " cm\n";
+
+ sAppStream << "0 g 0 G 1 w /" << sAlias << " Do\n" << "Q\n";
+ }
+
+ return sAppStream.GetByteString();
+}
+
+void CPWL_Image::SetPDFStream(CPDF_Stream * pStream)
+{
+ m_pPDFStream = pStream;
+}
+
+CPDF_Stream * CPWL_Image::GetPDFStream()
+{
+ return this->m_pPDFStream;
+}
+
+void CPWL_Image::GetImageSize(FX_FLOAT & fWidth,FX_FLOAT & fHeight)
+{
+ fWidth = 0.0f;
+ fHeight = 0.0f;
+
+ if (m_pPDFStream)
+ {
+ if (CPDF_Dictionary * pDict = m_pPDFStream->GetDict())
+ {
+ CPDF_Rect rect = pDict->GetRect("BBox");
+
+ fWidth = rect.right - rect.left;
+ fHeight = rect.top - rect.bottom;
+ }
+ }
+}
+
+CPDF_Matrix CPWL_Image::GetImageMatrix()
+{
+ if (m_pPDFStream)
+ {
+ if (CPDF_Dictionary * pDict = m_pPDFStream->GetDict())
+ {
+ return pDict->GetMatrix("Matrix");
+ }
+ }
+
+ return CPDF_Matrix();
+}
+
+CFX_ByteString CPWL_Image::GetImageAlias()
+{
+ if (m_sImageAlias.IsEmpty())
+ {
+ if (m_pPDFStream)
+ {
+ if (CPDF_Dictionary * pDict = m_pPDFStream->GetDict())
+ {
+ return pDict->GetString("Name");
+ }
+ }
+ }
+ else
+ return m_sImageAlias;
+
+ return CFX_ByteString();
+}
+
+void CPWL_Image::SetImageAlias(FX_LPCSTR sImageAlias)
+{
+ m_sImageAlias = sImageAlias;
+}
+
+void CPWL_Image::GetScale(FX_FLOAT & fHScale,FX_FLOAT & fVScale)
+{
+ fHScale = 1.0f;
+ fVScale = 1.0f;
+}
+
+
+void CPWL_Image::GetImageOffset(FX_FLOAT & x,FX_FLOAT & y)
+{
+ x = 0.0f;
+ y = 0.0f;
+}
+
+/* ------------------------------- CPWL_Icon ---------------------------------- */
+
+CPWL_Icon::CPWL_Icon() : m_pIconFit(NULL)
+{
+}
+
+CPWL_Icon::~CPWL_Icon()
+{
+}
+
+FX_INT32 CPWL_Icon::GetScaleMethod()
+{
+ if (m_pIconFit)
+ return m_pIconFit->GetScaleMethod();
+
+ return 0;
+}
+
+FX_BOOL CPWL_Icon::IsProportionalScale()
+{
+ if (m_pIconFit)
+ return m_pIconFit->IsProportionalScale();
+
+ return FALSE;
+}
+
+void CPWL_Icon::GetIconPosition(FX_FLOAT & fLeft, FX_FLOAT & fBottom)
+{
+ if (m_pIconFit)
+ {
+ //m_pIconFit->GetIconPosition(fLeft,fBottom);
+ fLeft = 0.0f;
+ fBottom = 0.0f;
+ CPDF_Array* pA = m_pIconFit->m_pDict->GetArray("A");
+ if (pA != NULL)
+ {
+ FX_DWORD dwCount = pA->GetCount();
+ if (dwCount > 0) fLeft = pA->GetNumber(0);
+ if (dwCount > 1) fBottom = pA->GetNumber(1);
+ }
+ }
+ else
+ {
+ fLeft = 0.0f;
+ fBottom = 0.0f;
+ }
+}
+
+FX_BOOL CPWL_Icon::GetFittingBounds()
+{
+ if (m_pIconFit)
+ return m_pIconFit->GetFittingBounds();
+
+ return FALSE;
+}
+
+void CPWL_Icon::GetScale(FX_FLOAT & fHScale,FX_FLOAT & fVScale)
+{
+ fHScale = 1.0f;
+ fVScale = 1.0f;
+
+ if (m_pPDFStream)
+ {
+ FX_FLOAT fImageWidth,fImageHeight;
+ FX_FLOAT fPlateWidth,fPlateHeight;
+
+ CPDF_Rect rcPlate = this->GetClientRect();
+ fPlateWidth = rcPlate.right - rcPlate.left;
+ fPlateHeight = rcPlate.top - rcPlate.bottom;
+
+ GetImageSize(fImageWidth,fImageHeight);
+
+ FX_INT32 nScaleMethod = this->GetScaleMethod();
+
+ /*
+ enum ScaleMethod
+ {
+ Always = 0, //A, Always scale
+ Bigger, //B, Scale only when the icon is bigger than the annotation rectangle
+ Smaller, //S, Scale only when the icon is smaller then the annotation rectangle
+ Never //N, Never scale
+ };
+ */
+
+ switch (nScaleMethod)
+ {
+ default:
+ case 0:
+ fHScale = fPlateWidth / PWL_MAX(fImageWidth,1.0f);
+ fVScale = fPlateHeight / PWL_MAX(fImageHeight,1.0f);
+ break;
+ case 1:
+ if (fPlateWidth < fImageWidth)
+ fHScale = fPlateWidth / PWL_MAX(fImageWidth,1.0f);
+ if (fPlateHeight < fImageHeight)
+ fVScale = fPlateHeight / PWL_MAX(fImageHeight,1.0f);
+ break;
+ case 2:
+ if (fPlateWidth > fImageWidth)
+ fHScale = fPlateWidth / PWL_MAX(fImageWidth,1.0f);
+ if (fPlateHeight > fImageHeight)
+ fVScale = fPlateHeight / PWL_MAX(fImageHeight,1.0f);
+ break;
+ case 3:
+ break;
+ }
+
+ FX_FLOAT fMinScale;
+ if (IsProportionalScale())
+ {
+ fMinScale = PWL_MIN(fHScale,fVScale);
+ fHScale = fMinScale;
+ fVScale = fMinScale;
+ }
+ }
+}
+
+void CPWL_Icon::GetImageOffset(FX_FLOAT & x,FX_FLOAT & y)
+{
+ FX_FLOAT fLeft,fBottom;
+
+ this->GetIconPosition(fLeft,fBottom);
+ x = 0.0f;
+ y = 0.0f;
+
+ FX_FLOAT fImageWidth,fImageHeight;
+ GetImageSize(fImageWidth,fImageHeight);
+
+ FX_FLOAT fHScale,fVScale;
+ GetScale(fHScale,fVScale);
+
+ FX_FLOAT fImageFactWidth = fImageWidth * fHScale;
+ FX_FLOAT fImageFactHeight = fImageHeight * fVScale;
+
+ FX_FLOAT fPlateWidth,fPlateHeight;
+ CPDF_Rect rcPlate = this->GetClientRect();
+ fPlateWidth = rcPlate.right - rcPlate.left;
+ fPlateHeight = rcPlate.top - rcPlate.bottom;
+
+ x = (fPlateWidth - fImageFactWidth) * fLeft;
+ y = (fPlateHeight - fImageFactHeight) * fBottom;
+}
+
diff --git a/fpdfsdk/src/pdfwindow/PWL_IconList.cpp b/fpdfsdk/src/pdfwindow/PWL_IconList.cpp
index 09b66786db..72317908bb 100644
--- a/fpdfsdk/src/pdfwindow/PWL_IconList.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_IconList.cpp
@@ -1,592 +1,592 @@
-// 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
-
-#include "../../include/pdfwindow/PDFWindow.h"
-#include "../../include/pdfwindow/PWL_Wnd.h"
-#include "../../include/pdfwindow/PWL_ListCtrl.h"
-#include "../../include/pdfwindow/PWL_IconList.h"
-#include "../../include/pdfwindow/PWL_Utils.h"
-#include "../../include/pdfwindow/PWL_ScrollBar.h"
-#include "../../include/pdfwindow/PWL_Label.h"
-
-#define PWL_IconList_ITEM_ICON_LEFTMARGIN 10.0f
-#define PWL_IconList_ITEM_WIDTH 20.0f
-#define PWL_IconList_ITEM_HEIGHT 20.0f
-#define PWL_IconList_ITEM_SPACE 4.0f
-
-/* ------------------ CPWL_IconList_Item ------------------- */
-
-CPWL_IconList_Item::CPWL_IconList_Item() :
- m_nIconIndex(-1),
- m_pData(NULL),
- m_bSelected(FALSE),
- m_pText(NULL)
-{
-}
-
-CPWL_IconList_Item::~CPWL_IconList_Item()
-{
-}
-
-CFX_ByteString CPWL_IconList_Item::GetClassName() const
-{
- return "CPWL_IconList_Item";
-}
-
-FX_FLOAT CPWL_IconList_Item::GetItemHeight(FX_FLOAT fLimitWidth)
-{
- return PWL_IconList_ITEM_HEIGHT;
-}
-
-void CPWL_IconList_Item::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device)
-{
- CPDF_Rect rcClient = GetClientRect();
-
- if (m_bSelected)
- {
- if (this->IsEnabled())
- {
- CPWL_Utils::DrawFillRect(pDevice, pUser2Device, rcClient,
- CPWL_Utils::PWLColorToFXColor(PWL_DEFAULT_SELBACKCOLOR,this->GetTransparency()));
- }
- else
- {
- CPWL_Utils::DrawFillRect(pDevice, pUser2Device, rcClient,
- CPWL_Utils::PWLColorToFXColor(PWL_DEFAULT_LIGHTGRAYCOLOR,this->GetTransparency()));
- }
- }
-
- CPDF_Rect rcIcon = rcClient;
- rcIcon.left += PWL_IconList_ITEM_ICON_LEFTMARGIN;
- rcIcon.right = rcIcon.left + PWL_IconList_ITEM_WIDTH;
-
- CPWL_Utils::DrawIconAppStream(pDevice, pUser2Device, m_nIconIndex, rcIcon,
- m_crIcon, m_pText->GetTextColor(), this->GetTransparency());
-}
-
-void CPWL_IconList_Item::SetSelect(FX_BOOL bSelected)
-{
- m_bSelected = bSelected;
-
- if (bSelected)
- m_pText->SetTextColor(PWL_DEFAULT_WHITECOLOR);
- else
- m_pText->SetTextColor(PWL_DEFAULT_BLACKCOLOR);
-
-}
-
-FX_BOOL CPWL_IconList_Item::IsSelected() const
-{
- return m_bSelected;
-}
-
-void CPWL_IconList_Item::CreateChildWnd(const PWL_CREATEPARAM & cp)
-{
- m_pText = new CPWL_Label;
-
- PWL_CREATEPARAM lcp = cp;
- lcp.pParentWnd = this;
- lcp.dwFlags = PWS_CHILD | PWS_VISIBLE | PES_LEFT | PES_CENTER;
- lcp.sTextColor = PWL_DEFAULT_BLACKCOLOR;
- lcp.fFontSize = 12;
- m_pText->Create(lcp);
-}
-
-void CPWL_IconList_Item::SetData(void* pData)
-{
- m_pData = pData;
-}
-
-void CPWL_IconList_Item::SetIcon(FX_INT32 nIconIndex)
-{
- m_nIconIndex = nIconIndex;
-}
-
-void CPWL_IconList_Item::SetText(const CFX_WideString& str)
-{
- m_pText->SetText(str);
-}
-
-CFX_WideString CPWL_IconList_Item::GetText() const
-{
- return m_pText->GetText();
-}
-
-void CPWL_IconList_Item::RePosChildWnd()
-{
- CPDF_Rect rcClient = GetClientRect();
-
- rcClient.left += (PWL_IconList_ITEM_ICON_LEFTMARGIN + PWL_IconList_ITEM_WIDTH + PWL_IconList_ITEM_ICON_LEFTMARGIN);
-
- m_pText->Move(rcClient, TRUE, FALSE);
-}
-
-void CPWL_IconList_Item::SetIconFillColor(const CPWL_Color& color)
-{
- m_crIcon = color;
-}
-
-void CPWL_IconList_Item::OnEnabled()
-{
- if (m_bSelected)
- m_pText->SetTextColor(PWL_DEFAULT_WHITECOLOR);
- else
- m_pText->SetTextColor(PWL_DEFAULT_BLACKCOLOR);
-
- this->InvalidateRect();
-}
-
-void CPWL_IconList_Item::OnDisabled()
-{
- m_pText->SetTextColor(PWL_DEFAULT_HEAVYGRAYCOLOR);
-
- this->InvalidateRect();
-}
-
-/* ----------------- CPWL_IconList_Content ----------------- */
-
-CPWL_IconList_Content::CPWL_IconList_Content(FX_INT32 nListCount) :
- m_nSelectIndex(-1),
- m_pNotify(NULL),
- m_bEnableNotify(TRUE),
- m_bMouseDown(FALSE),
- m_nListCount(nListCount)
-{
-}
-
-CPWL_IconList_Content::~CPWL_IconList_Content()
-{
-}
-
-void CPWL_IconList_Content::CreateChildWnd(const PWL_CREATEPARAM & cp)
-{
- for (FX_INT32 i=0; i<m_nListCount; i++)
- {
- CPWL_IconList_Item* pNewItem = new CPWL_IconList_Item();
-
- PWL_CREATEPARAM icp = cp;
- icp.pParentWnd = this;
- icp.dwFlags = PWS_CHILD | PWS_VISIBLE | PWS_NOREFRESHCLIP;
- pNewItem->Create(icp);
- }
-
- this->SetItemSpace(PWL_IconList_ITEM_SPACE);
- this->ResetContent(0);
-
- if (CPWL_Wnd * pParent = this->GetParentWindow())
- {
- CPDF_Rect rcScroll = this->GetScrollArea();
- this->GetScrollPos();
-
- PWL_SCROLL_INFO sInfo;
- sInfo.fContentMin = rcScroll.bottom;
- sInfo.fContentMax = rcScroll.top;
- sInfo.fPlateWidth = GetClientRect().Height();
- sInfo.fSmallStep = 13.0f;
- sInfo.fBigStep = sInfo.fPlateWidth;
-
- pParent->OnNotify(this, PNM_SETSCROLLINFO, SBT_VSCROLL, (FX_INTPTR)&sInfo);
- }
-}
-
-FX_BOOL CPWL_IconList_Content::OnLButtonDown(const CPDF_Point & point)
-{
- SetFocus();
-
- SetCapture();
- m_bMouseDown = TRUE;
-
- FX_INT32 nItemIndex = FindItemIndex(point);
- SetSelect(nItemIndex);
- ScrollToItem(nItemIndex);
-
- return TRUE;
-}
-
-FX_BOOL CPWL_IconList_Content::OnLButtonUp(const CPDF_Point & point)
-{
- m_bMouseDown = FALSE;
- ReleaseCapture();
-
- return TRUE;
-}
-
-FX_BOOL CPWL_IconList_Content::OnMouseMove(const CPDF_Point & point)
-{
- if (m_bMouseDown)
- {
- FX_INT32 nItemIndex = FindItemIndex(point);
- SetSelect(nItemIndex);
- ScrollToItem(nItemIndex);
- }
-
- return TRUE;
-}
-
-FX_BOOL CPWL_IconList_Content::OnKeyDown(FX_WORD nChar)
-{
- switch (nChar)
- {
- case FWL_VKEY_Up:
- if (m_nSelectIndex > 0)
- {
- FX_INT32 nItemIndex = m_nSelectIndex - 1;
- SetSelect(nItemIndex);
- ScrollToItem(nItemIndex);
- }
- return TRUE;
- case FWL_VKEY_Down:
- if (m_nSelectIndex < m_nListCount-1)
- {
- FX_INT32 nItemIndex = m_nSelectIndex + 1;
- SetSelect(nItemIndex);
- ScrollToItem(nItemIndex);
- }
- return TRUE;
- }
-
- return FALSE;
-}
-
-FX_INT32 CPWL_IconList_Content::FindItemIndex(const CPDF_Point& point)
-{
- FX_INT32 nIndex = 0;
- for (FX_INT32 i=0,sz=m_aChildren.GetSize(); i<sz; i++)
- {
- if (CPWL_Wnd * pChild = m_aChildren.GetAt(i))
- {
- CPDF_Rect rcWnd = pChild->ChildToParent(pChild->GetWindowRect());
-
- if (point.y < rcWnd.top)
- {
- nIndex = i;
- }
- }
- }
-
- return nIndex;
-}
-
-void CPWL_IconList_Content::ScrollToItem(FX_INT32 nItemIndex)
-{
- CPDF_Rect rcClient = GetClientRect();
-
- if (CPWL_IconList_Item* pItem = GetListItem(nItemIndex))
- {
- CPDF_Rect rcOrigin = pItem->GetWindowRect();
- CPDF_Rect rcWnd = pItem->ChildToParent(rcOrigin);
-
- if (!(rcWnd.bottom > rcClient.bottom && rcWnd.top < rcClient.top))
- {
- CPDF_Point ptScroll = GetScrollPos();
-
- if (rcWnd.top > rcClient.top)
- {
- ptScroll.y = rcOrigin.top;
- }
- else if (rcWnd.bottom < rcClient.bottom)
- {
- ptScroll.y = rcOrigin.bottom + rcClient.Height();
- }
-
- this->SetScrollPos(ptScroll);
- this->ResetFace();
- this->InvalidateRect();
- if (CPWL_Wnd* pParent = this->GetParentWindow())
- {
- pParent->OnNotify(this, PNM_SETSCROLLPOS, SBT_VSCROLL, (FX_INTPTR)&ptScroll.y);
- }
- }
- }
-}
-
-void CPWL_IconList_Content::SetSelect(FX_INT32 nIndex)
-{
- if (m_nSelectIndex != nIndex)
- {
- SelectItem(m_nSelectIndex, FALSE);
- SelectItem(nIndex, TRUE);
- m_nSelectIndex = nIndex;
-
- if (IPWL_IconList_Notify* pNotify = GetNotify())
- pNotify->OnNoteListSelChanged(nIndex);
- }
-}
-
-FX_INT32 CPWL_IconList_Content::GetSelect() const
-{
- return m_nSelectIndex;
-}
-
-IPWL_IconList_Notify* CPWL_IconList_Content::GetNotify() const
-{
- if (m_bEnableNotify)
- return m_pNotify;
- return NULL;
-}
-
-void CPWL_IconList_Content::SetNotify(IPWL_IconList_Notify* pNotify)
-{
- m_pNotify = pNotify;
-}
-
-void CPWL_IconList_Content::EnableNotify(FX_BOOL bNotify)
-{
- m_bEnableNotify = bNotify;
-}
-
-void CPWL_IconList_Content::SelectItem(FX_INT32 nItemIndex, FX_BOOL bSelect)
-{
- if (CPWL_IconList_Item* pItem = GetListItem(nItemIndex))
- {
- pItem->SetSelect(bSelect);
- pItem->InvalidateRect();
- }
-}
-
-CPWL_IconList_Item* CPWL_IconList_Content::GetListItem(FX_INT32 nItemIndex) const
-{
- if (nItemIndex >= 0 && nItemIndex<m_aChildren.GetSize())
- {
- if (CPWL_Wnd * pChild = m_aChildren.GetAt(nItemIndex))
- {
- if (pChild->GetClassName() == "CPWL_IconList_Item")
- {
- return (CPWL_IconList_Item*)pChild;
- }
- }
- }
-
- return NULL;
-}
-
-void CPWL_IconList_Content::SetListData(FX_INT32 nItemIndex, void* pData)
-{
- if (CPWL_IconList_Item* pItem = GetListItem(nItemIndex))
- pItem->SetData(pData);
-}
-
-void CPWL_IconList_Content::SetListIcon(FX_INT32 nItemIndex, FX_INT32 nIconIndex)
-{
- if (CPWL_IconList_Item* pItem = GetListItem(nItemIndex))
- pItem->SetIcon(nIconIndex);
-}
-
-void CPWL_IconList_Content::SetListString(FX_INT32 nItemIndex, const CFX_WideString& str)
-{
- if (CPWL_IconList_Item* pItem = GetListItem(nItemIndex))
- pItem->SetText(str);
-}
-
-CFX_WideString CPWL_IconList_Content::GetListString(FX_INT32 nItemIndex) const
-{
- if (CPWL_IconList_Item* pItem = GetListItem(nItemIndex))
- return pItem->GetText();
-
- return L"";
-}
-
-void CPWL_IconList_Content::SetIconFillColor(const CPWL_Color& color)
-{
- for (FX_INT32 i=0,sz=m_aChildren.GetSize(); i<sz; i++)
- {
- if (CPWL_Wnd * pChild = m_aChildren.GetAt(i))
- {
- if (pChild->GetClassName() == "CPWL_IconList_Item")
- {
- CPWL_IconList_Item* pItem = (CPWL_IconList_Item*)pChild;
- pItem->SetIconFillColor(color);
- pItem->InvalidateRect();
- }
- }
- }
-
-}
-
-/* -------------------- CPWL_IconList --------------------- */
-
-CPWL_IconList::CPWL_IconList(FX_INT32 nListCount) :
- m_pListContent(NULL),
- m_nListCount(nListCount)
-{
-}
-
-CPWL_IconList::~CPWL_IconList()
-{
-}
-
-void CPWL_IconList::RePosChildWnd()
-{
- CPWL_Wnd::RePosChildWnd();
-
- if (m_pListContent)
- m_pListContent->Move(GetClientRect(), TRUE, FALSE);
-}
-
-void CPWL_IconList::CreateChildWnd(const PWL_CREATEPARAM & cp)
-{
- m_pListContent = new CPWL_IconList_Content(m_nListCount);
-
- PWL_CREATEPARAM ccp = cp;
- ccp.pParentWnd = this;
- ccp.dwFlags = PWS_CHILD | PWS_VISIBLE;
- m_pListContent->Create(ccp);
-}
-
-void CPWL_IconList::OnCreated()
-{
- if (CPWL_ScrollBar* pScrollBar = this->GetVScrollBar())
- {
- pScrollBar->RemoveFlag(PWS_AUTOTRANSPARENT);
- pScrollBar->SetTransparency(255);
- pScrollBar->SetNotifyForever(TRUE);
- }
-}
-
-void CPWL_IconList::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam, FX_INTPTR lParam)
-{
- CPWL_Wnd::OnNotify(pWnd, msg, wParam, lParam);
-
- if (wParam == SBT_VSCROLL)
- {
- switch (msg)
- {
- case PNM_SETSCROLLINFO:
- if (PWL_SCROLL_INFO* pInfo = (PWL_SCROLL_INFO*)lParam)
- {
- if (CPWL_ScrollBar* pScrollBar = this->GetVScrollBar())
- {
- if (pInfo->fContentMax - pInfo->fContentMin > pInfo->fPlateWidth)
- {
- if (!pScrollBar->IsVisible())
- {
- pScrollBar->SetVisible(TRUE);
- RePosChildWnd();
- }
- else
- {
- }
- }
- else
- {
- if (pScrollBar->IsVisible())
- {
- pScrollBar->SetVisible(FALSE);
- RePosChildWnd();
- }
-
- if (m_pListContent)
- m_pListContent->SetScrollPos(CPDF_Point(0.0f,0.0f));
- }
-
- pScrollBar->OnNotify(pWnd,PNM_SETSCROLLINFO,wParam,lParam);
- }
- }
- return;
- case PNM_SCROLLWINDOW:
- if (m_pListContent)
- {
- m_pListContent->SetScrollPos(CPDF_Point(0.0f, *(FX_FLOAT*)lParam));
- m_pListContent->ResetFace();
- m_pListContent->InvalidateRect(NULL);
- }
- return;
- case PNM_SETSCROLLPOS:
- if (CPWL_ScrollBar* pScrollBar = this->GetVScrollBar())
- pScrollBar->OnNotify(pWnd,PNM_SETSCROLLPOS,wParam,lParam);
- return;
- }
- }
-}
-
-void CPWL_IconList::SetSelect(FX_INT32 nIndex)
-{
- m_pListContent->SetSelect(nIndex);
-}
-
-void CPWL_IconList::SetTopItem(FX_INT32 nIndex)
-{
- m_pListContent->ScrollToItem(nIndex);
-}
-
-FX_INT32 CPWL_IconList::GetSelect() const
-{
- return m_pListContent->GetSelect();
-}
-
-void CPWL_IconList::SetNotify(IPWL_IconList_Notify* pNotify)
-{
- m_pListContent->SetNotify(pNotify);
-}
-
-void CPWL_IconList::EnableNotify(FX_BOOL bNotify)
-{
- m_pListContent->EnableNotify(bNotify);
-}
-
-void CPWL_IconList::SetListData(FX_INT32 nItemIndex, void* pData)
-{
- m_pListContent->SetListData(nItemIndex, pData);
-}
-
-void CPWL_IconList::SetListIcon(FX_INT32 nItemIndex, FX_INT32 nIconIndex)
-{
- m_pListContent->SetListIcon(nItemIndex, nIconIndex);
-}
-
-void CPWL_IconList::SetListString(FX_INT32 nItemIndex, const CFX_WideString& str)
-{
- m_pListContent->SetListString(nItemIndex, str);
-}
-
-CFX_WideString CPWL_IconList::GetListString(FX_INT32 nItemIndex) const
-{
- return m_pListContent->GetListString(nItemIndex);
-}
-
-void CPWL_IconList::SetIconFillColor(const CPWL_Color& color)
-{
- m_pListContent->SetIconFillColor(color);
-}
-
-FX_BOOL CPWL_IconList::OnMouseWheel(short zDelta, const CPDF_Point & point)
-{
- CPDF_Point ptScroll = m_pListContent->GetScrollPos();
- CPDF_Rect rcScroll = m_pListContent->GetScrollArea();
- CPDF_Rect rcContents = m_pListContent->GetClientRect();
-
- if (rcScroll.top - rcScroll.bottom > rcContents.Height())
- {
- CPDF_Point ptNew = ptScroll;
-
- if (zDelta > 0)
- ptNew.y += 30;
- else
- ptNew.y -= 30;
-
- if (ptNew.y > rcScroll.top)
- ptNew.y = rcScroll.top;
- if (ptNew.y < rcScroll.bottom + rcContents.Height())
- ptNew.y = rcScroll.bottom + rcContents.Height();
- if (ptNew.y < rcScroll.bottom)
- ptNew.y = rcScroll.bottom;
-
- if (ptNew.y != ptScroll.y)
- {
- m_pListContent->SetScrollPos(ptNew);
- m_pListContent->ResetFace();
- m_pListContent->InvalidateRect(NULL);
-
- if (CPWL_ScrollBar* pScrollBar = this->GetVScrollBar())
- pScrollBar->OnNotify(this, PNM_SETSCROLLPOS, SBT_VSCROLL, (FX_INTPTR)&ptNew.y);
-
- return TRUE;
- }
- }
-
- return FALSE;
-}
-
+// 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
+
+#include "../../include/pdfwindow/PDFWindow.h"
+#include "../../include/pdfwindow/PWL_Wnd.h"
+#include "../../include/pdfwindow/PWL_ListCtrl.h"
+#include "../../include/pdfwindow/PWL_IconList.h"
+#include "../../include/pdfwindow/PWL_Utils.h"
+#include "../../include/pdfwindow/PWL_ScrollBar.h"
+#include "../../include/pdfwindow/PWL_Label.h"
+
+#define PWL_IconList_ITEM_ICON_LEFTMARGIN 10.0f
+#define PWL_IconList_ITEM_WIDTH 20.0f
+#define PWL_IconList_ITEM_HEIGHT 20.0f
+#define PWL_IconList_ITEM_SPACE 4.0f
+
+/* ------------------ CPWL_IconList_Item ------------------- */
+
+CPWL_IconList_Item::CPWL_IconList_Item() :
+ m_nIconIndex(-1),
+ m_pData(NULL),
+ m_bSelected(FALSE),
+ m_pText(NULL)
+{
+}
+
+CPWL_IconList_Item::~CPWL_IconList_Item()
+{
+}
+
+CFX_ByteString CPWL_IconList_Item::GetClassName() const
+{
+ return "CPWL_IconList_Item";
+}
+
+FX_FLOAT CPWL_IconList_Item::GetItemHeight(FX_FLOAT fLimitWidth)
+{
+ return PWL_IconList_ITEM_HEIGHT;
+}
+
+void CPWL_IconList_Item::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device)
+{
+ CPDF_Rect rcClient = GetClientRect();
+
+ if (m_bSelected)
+ {
+ if (this->IsEnabled())
+ {
+ CPWL_Utils::DrawFillRect(pDevice, pUser2Device, rcClient,
+ CPWL_Utils::PWLColorToFXColor(PWL_DEFAULT_SELBACKCOLOR,this->GetTransparency()));
+ }
+ else
+ {
+ CPWL_Utils::DrawFillRect(pDevice, pUser2Device, rcClient,
+ CPWL_Utils::PWLColorToFXColor(PWL_DEFAULT_LIGHTGRAYCOLOR,this->GetTransparency()));
+ }
+ }
+
+ CPDF_Rect rcIcon = rcClient;
+ rcIcon.left += PWL_IconList_ITEM_ICON_LEFTMARGIN;
+ rcIcon.right = rcIcon.left + PWL_IconList_ITEM_WIDTH;
+
+ CPWL_Utils::DrawIconAppStream(pDevice, pUser2Device, m_nIconIndex, rcIcon,
+ m_crIcon, m_pText->GetTextColor(), this->GetTransparency());
+}
+
+void CPWL_IconList_Item::SetSelect(FX_BOOL bSelected)
+{
+ m_bSelected = bSelected;
+
+ if (bSelected)
+ m_pText->SetTextColor(PWL_DEFAULT_WHITECOLOR);
+ else
+ m_pText->SetTextColor(PWL_DEFAULT_BLACKCOLOR);
+
+}
+
+FX_BOOL CPWL_IconList_Item::IsSelected() const
+{
+ return m_bSelected;
+}
+
+void CPWL_IconList_Item::CreateChildWnd(const PWL_CREATEPARAM & cp)
+{
+ m_pText = new CPWL_Label;
+
+ PWL_CREATEPARAM lcp = cp;
+ lcp.pParentWnd = this;
+ lcp.dwFlags = PWS_CHILD | PWS_VISIBLE | PES_LEFT | PES_CENTER;
+ lcp.sTextColor = PWL_DEFAULT_BLACKCOLOR;
+ lcp.fFontSize = 12;
+ m_pText->Create(lcp);
+}
+
+void CPWL_IconList_Item::SetData(void* pData)
+{
+ m_pData = pData;
+}
+
+void CPWL_IconList_Item::SetIcon(FX_INT32 nIconIndex)
+{
+ m_nIconIndex = nIconIndex;
+}
+
+void CPWL_IconList_Item::SetText(const CFX_WideString& str)
+{
+ m_pText->SetText(str);
+}
+
+CFX_WideString CPWL_IconList_Item::GetText() const
+{
+ return m_pText->GetText();
+}
+
+void CPWL_IconList_Item::RePosChildWnd()
+{
+ CPDF_Rect rcClient = GetClientRect();
+
+ rcClient.left += (PWL_IconList_ITEM_ICON_LEFTMARGIN + PWL_IconList_ITEM_WIDTH + PWL_IconList_ITEM_ICON_LEFTMARGIN);
+
+ m_pText->Move(rcClient, TRUE, FALSE);
+}
+
+void CPWL_IconList_Item::SetIconFillColor(const CPWL_Color& color)
+{
+ m_crIcon = color;
+}
+
+void CPWL_IconList_Item::OnEnabled()
+{
+ if (m_bSelected)
+ m_pText->SetTextColor(PWL_DEFAULT_WHITECOLOR);
+ else
+ m_pText->SetTextColor(PWL_DEFAULT_BLACKCOLOR);
+
+ this->InvalidateRect();
+}
+
+void CPWL_IconList_Item::OnDisabled()
+{
+ m_pText->SetTextColor(PWL_DEFAULT_HEAVYGRAYCOLOR);
+
+ this->InvalidateRect();
+}
+
+/* ----------------- CPWL_IconList_Content ----------------- */
+
+CPWL_IconList_Content::CPWL_IconList_Content(FX_INT32 nListCount) :
+ m_nSelectIndex(-1),
+ m_pNotify(NULL),
+ m_bEnableNotify(TRUE),
+ m_bMouseDown(FALSE),
+ m_nListCount(nListCount)
+{
+}
+
+CPWL_IconList_Content::~CPWL_IconList_Content()
+{
+}
+
+void CPWL_IconList_Content::CreateChildWnd(const PWL_CREATEPARAM & cp)
+{
+ for (FX_INT32 i=0; i<m_nListCount; i++)
+ {
+ CPWL_IconList_Item* pNewItem = new CPWL_IconList_Item();
+
+ PWL_CREATEPARAM icp = cp;
+ icp.pParentWnd = this;
+ icp.dwFlags = PWS_CHILD | PWS_VISIBLE | PWS_NOREFRESHCLIP;
+ pNewItem->Create(icp);
+ }
+
+ this->SetItemSpace(PWL_IconList_ITEM_SPACE);
+ this->ResetContent(0);
+
+ if (CPWL_Wnd * pParent = this->GetParentWindow())
+ {
+ CPDF_Rect rcScroll = this->GetScrollArea();
+ this->GetScrollPos();
+
+ PWL_SCROLL_INFO sInfo;
+ sInfo.fContentMin = rcScroll.bottom;
+ sInfo.fContentMax = rcScroll.top;
+ sInfo.fPlateWidth = GetClientRect().Height();
+ sInfo.fSmallStep = 13.0f;
+ sInfo.fBigStep = sInfo.fPlateWidth;
+
+ pParent->OnNotify(this, PNM_SETSCROLLINFO, SBT_VSCROLL, (FX_INTPTR)&sInfo);
+ }
+}
+
+FX_BOOL CPWL_IconList_Content::OnLButtonDown(const CPDF_Point & point)
+{
+ SetFocus();
+
+ SetCapture();
+ m_bMouseDown = TRUE;
+
+ FX_INT32 nItemIndex = FindItemIndex(point);
+ SetSelect(nItemIndex);
+ ScrollToItem(nItemIndex);
+
+ return TRUE;
+}
+
+FX_BOOL CPWL_IconList_Content::OnLButtonUp(const CPDF_Point & point)
+{
+ m_bMouseDown = FALSE;
+ ReleaseCapture();
+
+ return TRUE;
+}
+
+FX_BOOL CPWL_IconList_Content::OnMouseMove(const CPDF_Point & point)
+{
+ if (m_bMouseDown)
+ {
+ FX_INT32 nItemIndex = FindItemIndex(point);
+ SetSelect(nItemIndex);
+ ScrollToItem(nItemIndex);
+ }
+
+ return TRUE;
+}
+
+FX_BOOL CPWL_IconList_Content::OnKeyDown(FX_WORD nChar)
+{
+ switch (nChar)
+ {
+ case FWL_VKEY_Up:
+ if (m_nSelectIndex > 0)
+ {
+ FX_INT32 nItemIndex = m_nSelectIndex - 1;
+ SetSelect(nItemIndex);
+ ScrollToItem(nItemIndex);
+ }
+ return TRUE;
+ case FWL_VKEY_Down:
+ if (m_nSelectIndex < m_nListCount-1)
+ {
+ FX_INT32 nItemIndex = m_nSelectIndex + 1;
+ SetSelect(nItemIndex);
+ ScrollToItem(nItemIndex);
+ }
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+FX_INT32 CPWL_IconList_Content::FindItemIndex(const CPDF_Point& point)
+{
+ FX_INT32 nIndex = 0;
+ for (FX_INT32 i=0,sz=m_aChildren.GetSize(); i<sz; i++)
+ {
+ if (CPWL_Wnd * pChild = m_aChildren.GetAt(i))
+ {
+ CPDF_Rect rcWnd = pChild->ChildToParent(pChild->GetWindowRect());
+
+ if (point.y < rcWnd.top)
+ {
+ nIndex = i;
+ }
+ }
+ }
+
+ return nIndex;
+}
+
+void CPWL_IconList_Content::ScrollToItem(FX_INT32 nItemIndex)
+{
+ CPDF_Rect rcClient = GetClientRect();
+
+ if (CPWL_IconList_Item* pItem = GetListItem(nItemIndex))
+ {
+ CPDF_Rect rcOrigin = pItem->GetWindowRect();
+ CPDF_Rect rcWnd = pItem->ChildToParent(rcOrigin);
+
+ if (!(rcWnd.bottom > rcClient.bottom && rcWnd.top < rcClient.top))
+ {
+ CPDF_Point ptScroll = GetScrollPos();
+
+ if (rcWnd.top > rcClient.top)
+ {
+ ptScroll.y = rcOrigin.top;
+ }
+ else if (rcWnd.bottom < rcClient.bottom)
+ {
+ ptScroll.y = rcOrigin.bottom + rcClient.Height();
+ }
+
+ this->SetScrollPos(ptScroll);
+ this->ResetFace();
+ this->InvalidateRect();
+ if (CPWL_Wnd* pParent = this->GetParentWindow())
+ {
+ pParent->OnNotify(this, PNM_SETSCROLLPOS, SBT_VSCROLL, (FX_INTPTR)&ptScroll.y);
+ }
+ }
+ }
+}
+
+void CPWL_IconList_Content::SetSelect(FX_INT32 nIndex)
+{
+ if (m_nSelectIndex != nIndex)
+ {
+ SelectItem(m_nSelectIndex, FALSE);
+ SelectItem(nIndex, TRUE);
+ m_nSelectIndex = nIndex;
+
+ if (IPWL_IconList_Notify* pNotify = GetNotify())
+ pNotify->OnNoteListSelChanged(nIndex);
+ }
+}
+
+FX_INT32 CPWL_IconList_Content::GetSelect() const
+{
+ return m_nSelectIndex;
+}
+
+IPWL_IconList_Notify* CPWL_IconList_Content::GetNotify() const
+{
+ if (m_bEnableNotify)
+ return m_pNotify;
+ return NULL;
+}
+
+void CPWL_IconList_Content::SetNotify(IPWL_IconList_Notify* pNotify)
+{
+ m_pNotify = pNotify;
+}
+
+void CPWL_IconList_Content::EnableNotify(FX_BOOL bNotify)
+{
+ m_bEnableNotify = bNotify;
+}
+
+void CPWL_IconList_Content::SelectItem(FX_INT32 nItemIndex, FX_BOOL bSelect)
+{
+ if (CPWL_IconList_Item* pItem = GetListItem(nItemIndex))
+ {
+ pItem->SetSelect(bSelect);
+ pItem->InvalidateRect();
+ }
+}
+
+CPWL_IconList_Item* CPWL_IconList_Content::GetListItem(FX_INT32 nItemIndex) const
+{
+ if (nItemIndex >= 0 && nItemIndex<m_aChildren.GetSize())
+ {
+ if (CPWL_Wnd * pChild = m_aChildren.GetAt(nItemIndex))
+ {
+ if (pChild->GetClassName() == "CPWL_IconList_Item")
+ {
+ return (CPWL_IconList_Item*)pChild;
+ }
+ }
+ }
+
+ return NULL;
+}
+
+void CPWL_IconList_Content::SetListData(FX_INT32 nItemIndex, void* pData)
+{
+ if (CPWL_IconList_Item* pItem = GetListItem(nItemIndex))
+ pItem->SetData(pData);
+}
+
+void CPWL_IconList_Content::SetListIcon(FX_INT32 nItemIndex, FX_INT32 nIconIndex)
+{
+ if (CPWL_IconList_Item* pItem = GetListItem(nItemIndex))
+ pItem->SetIcon(nIconIndex);
+}
+
+void CPWL_IconList_Content::SetListString(FX_INT32 nItemIndex, const CFX_WideString& str)
+{
+ if (CPWL_IconList_Item* pItem = GetListItem(nItemIndex))
+ pItem->SetText(str);
+}
+
+CFX_WideString CPWL_IconList_Content::GetListString(FX_INT32 nItemIndex) const
+{
+ if (CPWL_IconList_Item* pItem = GetListItem(nItemIndex))
+ return pItem->GetText();
+
+ return L"";
+}
+
+void CPWL_IconList_Content::SetIconFillColor(const CPWL_Color& color)
+{
+ for (FX_INT32 i=0,sz=m_aChildren.GetSize(); i<sz; i++)
+ {
+ if (CPWL_Wnd * pChild = m_aChildren.GetAt(i))
+ {
+ if (pChild->GetClassName() == "CPWL_IconList_Item")
+ {
+ CPWL_IconList_Item* pItem = (CPWL_IconList_Item*)pChild;
+ pItem->SetIconFillColor(color);
+ pItem->InvalidateRect();
+ }
+ }
+ }
+
+}
+
+/* -------------------- CPWL_IconList --------------------- */
+
+CPWL_IconList::CPWL_IconList(FX_INT32 nListCount) :
+ m_pListContent(NULL),
+ m_nListCount(nListCount)
+{
+}
+
+CPWL_IconList::~CPWL_IconList()
+{
+}
+
+void CPWL_IconList::RePosChildWnd()
+{
+ CPWL_Wnd::RePosChildWnd();
+
+ if (m_pListContent)
+ m_pListContent->Move(GetClientRect(), TRUE, FALSE);
+}
+
+void CPWL_IconList::CreateChildWnd(const PWL_CREATEPARAM & cp)
+{
+ m_pListContent = new CPWL_IconList_Content(m_nListCount);
+
+ PWL_CREATEPARAM ccp = cp;
+ ccp.pParentWnd = this;
+ ccp.dwFlags = PWS_CHILD | PWS_VISIBLE;
+ m_pListContent->Create(ccp);
+}
+
+void CPWL_IconList::OnCreated()
+{
+ if (CPWL_ScrollBar* pScrollBar = this->GetVScrollBar())
+ {
+ pScrollBar->RemoveFlag(PWS_AUTOTRANSPARENT);
+ pScrollBar->SetTransparency(255);
+ pScrollBar->SetNotifyForever(TRUE);
+ }
+}
+
+void CPWL_IconList::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam, FX_INTPTR lParam)
+{
+ CPWL_Wnd::OnNotify(pWnd, msg, wParam, lParam);
+
+ if (wParam == SBT_VSCROLL)
+ {
+ switch (msg)
+ {
+ case PNM_SETSCROLLINFO:
+ if (PWL_SCROLL_INFO* pInfo = (PWL_SCROLL_INFO*)lParam)
+ {
+ if (CPWL_ScrollBar* pScrollBar = this->GetVScrollBar())
+ {
+ if (pInfo->fContentMax - pInfo->fContentMin > pInfo->fPlateWidth)
+ {
+ if (!pScrollBar->IsVisible())
+ {
+ pScrollBar->SetVisible(TRUE);
+ RePosChildWnd();
+ }
+ else
+ {
+ }
+ }
+ else
+ {
+ if (pScrollBar->IsVisible())
+ {
+ pScrollBar->SetVisible(FALSE);
+ RePosChildWnd();
+ }
+
+ if (m_pListContent)
+ m_pListContent->SetScrollPos(CPDF_Point(0.0f,0.0f));
+ }
+
+ pScrollBar->OnNotify(pWnd,PNM_SETSCROLLINFO,wParam,lParam);
+ }
+ }
+ return;
+ case PNM_SCROLLWINDOW:
+ if (m_pListContent)
+ {
+ m_pListContent->SetScrollPos(CPDF_Point(0.0f, *(FX_FLOAT*)lParam));
+ m_pListContent->ResetFace();
+ m_pListContent->InvalidateRect(NULL);
+ }
+ return;
+ case PNM_SETSCROLLPOS:
+ if (CPWL_ScrollBar* pScrollBar = this->GetVScrollBar())
+ pScrollBar->OnNotify(pWnd,PNM_SETSCROLLPOS,wParam,lParam);
+ return;
+ }
+ }
+}
+
+void CPWL_IconList::SetSelect(FX_INT32 nIndex)
+{
+ m_pListContent->SetSelect(nIndex);
+}
+
+void CPWL_IconList::SetTopItem(FX_INT32 nIndex)
+{
+ m_pListContent->ScrollToItem(nIndex);
+}
+
+FX_INT32 CPWL_IconList::GetSelect() const
+{
+ return m_pListContent->GetSelect();
+}
+
+void CPWL_IconList::SetNotify(IPWL_IconList_Notify* pNotify)
+{
+ m_pListContent->SetNotify(pNotify);
+}
+
+void CPWL_IconList::EnableNotify(FX_BOOL bNotify)
+{
+ m_pListContent->EnableNotify(bNotify);
+}
+
+void CPWL_IconList::SetListData(FX_INT32 nItemIndex, void* pData)
+{
+ m_pListContent->SetListData(nItemIndex, pData);
+}
+
+void CPWL_IconList::SetListIcon(FX_INT32 nItemIndex, FX_INT32 nIconIndex)
+{
+ m_pListContent->SetListIcon(nItemIndex, nIconIndex);
+}
+
+void CPWL_IconList::SetListString(FX_INT32 nItemIndex, const CFX_WideString& str)
+{
+ m_pListContent->SetListString(nItemIndex, str);
+}
+
+CFX_WideString CPWL_IconList::GetListString(FX_INT32 nItemIndex) const
+{
+ return m_pListContent->GetListString(nItemIndex);
+}
+
+void CPWL_IconList::SetIconFillColor(const CPWL_Color& color)
+{
+ m_pListContent->SetIconFillColor(color);
+}
+
+FX_BOOL CPWL_IconList::OnMouseWheel(short zDelta, const CPDF_Point & point)
+{
+ CPDF_Point ptScroll = m_pListContent->GetScrollPos();
+ CPDF_Rect rcScroll = m_pListContent->GetScrollArea();
+ CPDF_Rect rcContents = m_pListContent->GetClientRect();
+
+ if (rcScroll.top - rcScroll.bottom > rcContents.Height())
+ {
+ CPDF_Point ptNew = ptScroll;
+
+ if (zDelta > 0)
+ ptNew.y += 30;
+ else
+ ptNew.y -= 30;
+
+ if (ptNew.y > rcScroll.top)
+ ptNew.y = rcScroll.top;
+ if (ptNew.y < rcScroll.bottom + rcContents.Height())
+ ptNew.y = rcScroll.bottom + rcContents.Height();
+ if (ptNew.y < rcScroll.bottom)
+ ptNew.y = rcScroll.bottom;
+
+ if (ptNew.y != ptScroll.y)
+ {
+ m_pListContent->SetScrollPos(ptNew);
+ m_pListContent->ResetFace();
+ m_pListContent->InvalidateRect(NULL);
+
+ if (CPWL_ScrollBar* pScrollBar = this->GetVScrollBar())
+ pScrollBar->OnNotify(this, PNM_SETSCROLLPOS, SBT_VSCROLL, (FX_INTPTR)&ptNew.y);
+
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
diff --git a/fpdfsdk/src/pdfwindow/PWL_Label.cpp b/fpdfsdk/src/pdfwindow/PWL_Label.cpp
index e1b8522248..18580f3be7 100644
--- a/fpdfsdk/src/pdfwindow/PWL_Label.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_Label.cpp
@@ -1,187 +1,187 @@
-// 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
-
-#include "../../include/pdfwindow/PDFWindow.h"
-#include "../../include/pdfwindow/PWL_Wnd.h"
-#include "../../include/pdfwindow/PWL_Label.h"
-#include "../../include/pdfwindow/PWL_Utils.h"
-
-/* ---------------------------- CPWL_Label ------------------------------ */
-
-CPWL_Label::CPWL_Label() : m_pEdit(NULL)
-{
- m_pEdit = IFX_Edit::NewEdit();
-
- ASSERT(m_pEdit != NULL);
-}
-
-CPWL_Label::~CPWL_Label()
-{
- IFX_Edit::DelEdit(m_pEdit);
-}
-
-CFX_ByteString CPWL_Label::GetClassName() const
-{
- return "CPWL_Label";
-}
-
-void CPWL_Label::OnCreated()
-{
- SetParamByFlag();
- SetFontSize(this->GetCreationParam().fFontSize);
-
- m_pEdit->SetFontMap(this->GetFontMap());
- m_pEdit->Initialize();
-
- if (HasFlag(PES_TEXTOVERFLOW))
- {
- SetClipRect(CPDF_Rect(0.0f,0.0f,0.0f,0.0f));
- m_pEdit->SetTextOverflow(TRUE);
- }
-}
-
-void CPWL_Label::SetText(FX_LPCWSTR csText)
-{
- m_pEdit->SetText(csText);
-}
-
-void CPWL_Label::RePosChildWnd()
-{
- m_pEdit->SetPlateRect(GetClientRect());
-}
-
-void CPWL_Label::SetFontSize(FX_FLOAT fFontSize)
-{
- m_pEdit->SetFontSize(fFontSize);
-}
-
-FX_FLOAT CPWL_Label::GetFontSize() const
-{
- return m_pEdit->GetFontSize();
-}
-
-void CPWL_Label::SetParamByFlag()
-{
- if (HasFlag(PES_LEFT))
- {
- m_pEdit->SetAlignmentH(0);
- }
- else if (HasFlag(PES_MIDDLE))
- {
- m_pEdit->SetAlignmentH(1);
- }
- else if (HasFlag(PES_RIGHT))
- {
- m_pEdit->SetAlignmentH(2);
- }
- else
- {
- m_pEdit->SetAlignmentH(0);
- }
-
- if (HasFlag(PES_TOP))
- {
- m_pEdit->SetAlignmentV(0);
- }
- else if (HasFlag(PES_CENTER))
- {
- m_pEdit->SetAlignmentV(1);
- }
- else if (HasFlag(PES_BOTTOM))
- {
- m_pEdit->SetAlignmentV(2);
- }
- else
- {
- m_pEdit->SetAlignmentV(0);
- }
-
- if (HasFlag(PES_PASSWORD))
- {
- m_pEdit->SetPasswordChar('*');
- }
-
- m_pEdit->SetMultiLine(HasFlag(PES_MULTILINE));
- m_pEdit->SetAutoReturn(HasFlag(PES_AUTORETURN));
- m_pEdit->SetAutoFontSize(HasFlag(PWS_AUTOFONTSIZE));
- m_pEdit->SetAutoScroll(HasFlag(PES_AUTOSCROLL));
-}
-
-void CPWL_Label::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device)
-{
- CPWL_Wnd::DrawThisAppearance(pDevice,pUser2Device);
-
- GetClientRect();
-
- CPDF_Rect rcClip;
- CPVT_WordRange wrRange = m_pEdit->GetVisibleWordRange();
- CPVT_WordRange* pRange = NULL;
-
- if (!HasFlag(PES_TEXTOVERFLOW))
- {
- rcClip = GetClientRect();
- pRange = &wrRange;
- }
-IFX_SystemHandler* pSysHandler = GetSystemHandler();
- IFX_Edit::DrawEdit(pDevice, pUser2Device, m_pEdit,
- CPWL_Utils::PWLColorToFXColor(GetTextColor(), this->GetTransparency()),
- CPWL_Utils::PWLColorToFXColor(GetTextStrokeColor(), this->GetTransparency()),
- rcClip, CPDF_Point(0.0f,0.0f), pRange,pSysHandler, NULL);
-}
-
-void CPWL_Label::SetHorzScale(FX_INT32 nHorzScale)
-{
- m_pEdit->SetHorzScale(nHorzScale);
-}
-
-void CPWL_Label::SetCharSpace(FX_FLOAT fCharSpace)
-{
- m_pEdit->SetCharSpace(fCharSpace);
-}
-
-CPDF_Rect CPWL_Label::GetContentRect() const
-{
- return m_pEdit->GetContentRect();
-}
-
-void CPWL_Label::GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream)
-{
- CPWL_Wnd::GetThisAppearanceStream(sAppStream);
-
- sAppStream << GetTextAppearanceStream(CPDF_Point(0.0f, 0.0f));
-}
-
-CFX_ByteString CPWL_Label::GetTextAppearanceStream(const CPDF_Point & ptOffset) const
-{
- CFX_ByteTextBuf sRet;
- CFX_ByteString sEdit = CPWL_Utils::GetEditAppStream(m_pEdit,ptOffset);
-
- if (sEdit.GetLength() > 0)
- {
- sRet << "BT\n" << CPWL_Utils::GetColorAppStream(GetTextColor()) << sEdit << "ET\n";
- }
-
- return sRet.GetByteString();
-}
-
-CFX_WideString CPWL_Label::GetText() const
-{
- return m_pEdit->GetText();
-}
-
-void CPWL_Label::SetLimitChar(FX_INT32 nLimitChar)
-{
- m_pEdit->SetLimitChar(nLimitChar);
-}
-
-FX_INT32 CPWL_Label::GetTotalWords()
-{
- if (m_pEdit)
- return m_pEdit->GetTotalWords();
-
- return 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
+
+#include "../../include/pdfwindow/PDFWindow.h"
+#include "../../include/pdfwindow/PWL_Wnd.h"
+#include "../../include/pdfwindow/PWL_Label.h"
+#include "../../include/pdfwindow/PWL_Utils.h"
+
+/* ---------------------------- CPWL_Label ------------------------------ */
+
+CPWL_Label::CPWL_Label() : m_pEdit(NULL)
+{
+ m_pEdit = IFX_Edit::NewEdit();
+
+ ASSERT(m_pEdit != NULL);
+}
+
+CPWL_Label::~CPWL_Label()
+{
+ IFX_Edit::DelEdit(m_pEdit);
+}
+
+CFX_ByteString CPWL_Label::GetClassName() const
+{
+ return "CPWL_Label";
+}
+
+void CPWL_Label::OnCreated()
+{
+ SetParamByFlag();
+ SetFontSize(this->GetCreationParam().fFontSize);
+
+ m_pEdit->SetFontMap(this->GetFontMap());
+ m_pEdit->Initialize();
+
+ if (HasFlag(PES_TEXTOVERFLOW))
+ {
+ SetClipRect(CPDF_Rect(0.0f,0.0f,0.0f,0.0f));
+ m_pEdit->SetTextOverflow(TRUE);
+ }
+}
+
+void CPWL_Label::SetText(FX_LPCWSTR csText)
+{
+ m_pEdit->SetText(csText);
+}
+
+void CPWL_Label::RePosChildWnd()
+{
+ m_pEdit->SetPlateRect(GetClientRect());
+}
+
+void CPWL_Label::SetFontSize(FX_FLOAT fFontSize)
+{
+ m_pEdit->SetFontSize(fFontSize);
+}
+
+FX_FLOAT CPWL_Label::GetFontSize() const
+{
+ return m_pEdit->GetFontSize();
+}
+
+void CPWL_Label::SetParamByFlag()
+{
+ if (HasFlag(PES_LEFT))
+ {
+ m_pEdit->SetAlignmentH(0);
+ }
+ else if (HasFlag(PES_MIDDLE))
+ {
+ m_pEdit->SetAlignmentH(1);
+ }
+ else if (HasFlag(PES_RIGHT))
+ {
+ m_pEdit->SetAlignmentH(2);
+ }
+ else
+ {
+ m_pEdit->SetAlignmentH(0);
+ }
+
+ if (HasFlag(PES_TOP))
+ {
+ m_pEdit->SetAlignmentV(0);
+ }
+ else if (HasFlag(PES_CENTER))
+ {
+ m_pEdit->SetAlignmentV(1);
+ }
+ else if (HasFlag(PES_BOTTOM))
+ {
+ m_pEdit->SetAlignmentV(2);
+ }
+ else
+ {
+ m_pEdit->SetAlignmentV(0);
+ }
+
+ if (HasFlag(PES_PASSWORD))
+ {
+ m_pEdit->SetPasswordChar('*');
+ }
+
+ m_pEdit->SetMultiLine(HasFlag(PES_MULTILINE));
+ m_pEdit->SetAutoReturn(HasFlag(PES_AUTORETURN));
+ m_pEdit->SetAutoFontSize(HasFlag(PWS_AUTOFONTSIZE));
+ m_pEdit->SetAutoScroll(HasFlag(PES_AUTOSCROLL));
+}
+
+void CPWL_Label::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device)
+{
+ CPWL_Wnd::DrawThisAppearance(pDevice,pUser2Device);
+
+ GetClientRect();
+
+ CPDF_Rect rcClip;
+ CPVT_WordRange wrRange = m_pEdit->GetVisibleWordRange();
+ CPVT_WordRange* pRange = NULL;
+
+ if (!HasFlag(PES_TEXTOVERFLOW))
+ {
+ rcClip = GetClientRect();
+ pRange = &wrRange;
+ }
+IFX_SystemHandler* pSysHandler = GetSystemHandler();
+ IFX_Edit::DrawEdit(pDevice, pUser2Device, m_pEdit,
+ CPWL_Utils::PWLColorToFXColor(GetTextColor(), this->GetTransparency()),
+ CPWL_Utils::PWLColorToFXColor(GetTextStrokeColor(), this->GetTransparency()),
+ rcClip, CPDF_Point(0.0f,0.0f), pRange,pSysHandler, NULL);
+}
+
+void CPWL_Label::SetHorzScale(FX_INT32 nHorzScale)
+{
+ m_pEdit->SetHorzScale(nHorzScale);
+}
+
+void CPWL_Label::SetCharSpace(FX_FLOAT fCharSpace)
+{
+ m_pEdit->SetCharSpace(fCharSpace);
+}
+
+CPDF_Rect CPWL_Label::GetContentRect() const
+{
+ return m_pEdit->GetContentRect();
+}
+
+void CPWL_Label::GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream)
+{
+ CPWL_Wnd::GetThisAppearanceStream(sAppStream);
+
+ sAppStream << GetTextAppearanceStream(CPDF_Point(0.0f, 0.0f));
+}
+
+CFX_ByteString CPWL_Label::GetTextAppearanceStream(const CPDF_Point & ptOffset) const
+{
+ CFX_ByteTextBuf sRet;
+ CFX_ByteString sEdit = CPWL_Utils::GetEditAppStream(m_pEdit,ptOffset);
+
+ if (sEdit.GetLength() > 0)
+ {
+ sRet << "BT\n" << CPWL_Utils::GetColorAppStream(GetTextColor()) << sEdit << "ET\n";
+ }
+
+ return sRet.GetByteString();
+}
+
+CFX_WideString CPWL_Label::GetText() const
+{
+ return m_pEdit->GetText();
+}
+
+void CPWL_Label::SetLimitChar(FX_INT32 nLimitChar)
+{
+ m_pEdit->SetLimitChar(nLimitChar);
+}
+
+FX_INT32 CPWL_Label::GetTotalWords()
+{
+ if (m_pEdit)
+ return m_pEdit->GetTotalWords();
+
+ return 0;
+}
+
diff --git a/fpdfsdk/src/pdfwindow/PWL_ListBox.cpp b/fpdfsdk/src/pdfwindow/PWL_ListBox.cpp
index 951ed93f79..035d81959d 100644
--- a/fpdfsdk/src/pdfwindow/PWL_ListBox.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_ListBox.cpp
@@ -1,632 +1,632 @@
-// 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
-
-#include "../../include/pdfwindow/PDFWindow.h"
-#include "../../include/pdfwindow/PWL_Wnd.h"
-#include "../../include/pdfwindow/PWL_ListBox.h"
-#include "../../include/pdfwindow/PWL_Utils.h"
-#include "../../include/pdfwindow/PWL_ScrollBar.h"
-#include "../../include/pdfwindow/PWL_EditCtrl.h"
-#include "../../include/pdfwindow/PWL_Edit.h"
-
-#define IsFloatZero(f) ((f) < 0.0001 && (f) > -0.0001)
-#define IsFloatBigger(fa,fb) ((fa) > (fb) && !IsFloatZero((fa) - (fb)))
-#define IsFloatSmaller(fa,fb) ((fa) < (fb) && !IsFloatZero((fa) - (fb)))
-#define IsFloatEqual(fa,fb) IsFloatZero((fa)-(fb))
-
-/* ------------------------ CPWL_List_Notify ----------------------- */
-
-CPWL_List_Notify::CPWL_List_Notify(CPWL_ListBox* pList) : m_pList(pList)
-{
- ASSERT(m_pList != NULL);
-}
-
-CPWL_List_Notify::~CPWL_List_Notify()
-{
-}
-
-void CPWL_List_Notify::IOnSetScrollInfoY(FX_FLOAT fPlateMin, FX_FLOAT fPlateMax,
- FX_FLOAT fContentMin, FX_FLOAT fContentMax,
- FX_FLOAT fSmallStep, FX_FLOAT fBigStep)
-{
- PWL_SCROLL_INFO Info;
-
- Info.fPlateWidth = fPlateMax - fPlateMin;
- Info.fContentMin = fContentMin;
- Info.fContentMax = fContentMax;
- Info.fSmallStep = fSmallStep;
- Info.fBigStep = fBigStep;
-
- m_pList->OnNotify(m_pList,PNM_SETSCROLLINFO,SBT_VSCROLL,(FX_INTPTR)&Info);
-
- if (CPWL_ScrollBar * pScroll = m_pList->GetVScrollBar())
- {
- if (IsFloatBigger(Info.fPlateWidth,Info.fContentMax-Info.fContentMin)
- || IsFloatEqual(Info.fPlateWidth,Info.fContentMax-Info.fContentMin))
- {
- if (pScroll->IsVisible())
- {
- pScroll->SetVisible(FALSE);
- m_pList->RePosChildWnd();
- }
- }
- else
- {
- if (!pScroll->IsVisible())
- {
- pScroll->SetVisible(TRUE);
- m_pList->RePosChildWnd();
- }
- }
- }
-}
-
-void CPWL_List_Notify::IOnSetScrollPosY(FX_FLOAT fy)
-{
- m_pList->OnNotify(m_pList,PNM_SETSCROLLPOS,SBT_VSCROLL,(FX_INTPTR)&fy);
-}
-
-void CPWL_List_Notify::IOnInvalidateRect(CPDF_Rect * pRect)
-{
- m_pList->InvalidateRect(pRect);
-}
-
-/* --------------------------- CPWL_ListBox ---------------------------- */
-
-CPWL_ListBox::CPWL_ListBox() :
- m_pList(NULL),
- m_pListNotify(NULL),
- m_bMouseDown(FALSE),
- m_bHoverSel(FALSE),
- m_pFillerNotify(NULL)
-{
- m_pList = IFX_List::NewList();
-
- ASSERT(m_pList != NULL);
-}
-
-CPWL_ListBox::~CPWL_ListBox()
-{
- IFX_List::DelList(m_pList);
-
- if (m_pListNotify)
- {
- delete m_pListNotify;
- m_pListNotify = NULL;
- }
-}
-
-CFX_ByteString CPWL_ListBox::GetClassName() const
-{
- return "CPWL_ListBox";
-}
-
-void CPWL_ListBox::OnCreated()
-{
- if (m_pList)
- {
- if (m_pListNotify) delete m_pListNotify;
-
- m_pList->SetFontMap(GetFontMap());
- m_pList->SetNotify(m_pListNotify = new CPWL_List_Notify(this));
-
- SetHoverSel(HasFlag(PLBS_HOVERSEL));
- m_pList->SetMultipleSel(HasFlag(PLBS_MULTIPLESEL));
- m_pList->SetFontSize(this->GetCreationParam().fFontSize);
-
- m_bHoverSel = HasFlag(PLBS_HOVERSEL);
- }
-}
-
-void CPWL_ListBox::OnDestroy()
-{
- if (m_pListNotify)
- {
- delete m_pListNotify;
- m_pListNotify = NULL;
- }
-}
-
-void CPWL_ListBox::GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream)
-{
- CPWL_Wnd::GetThisAppearanceStream(sAppStream);
-
- CFX_ByteTextBuf sListItems;
-
- if (m_pList)
- {
- CPDF_Rect rcPlate = m_pList->GetPlateRect();
- for (FX_INT32 i=0,sz=m_pList->GetCount(); i<sz; i++)
- {
- CPDF_Rect rcItem = m_pList->GetItemRect(i);
-
- if (rcItem.bottom > rcPlate.top || rcItem.top < rcPlate.bottom) continue;
-
- CPDF_Point ptOffset(rcItem.left, (rcItem.top + rcItem.bottom) * 0.5f);
- if (m_pList->IsItemSelected(i))
- {
- sListItems << CPWL_Utils::GetRectFillAppStream(rcItem,PWL_DEFAULT_SELBACKCOLOR);
- CFX_ByteString sItem = CPWL_Utils::GetEditAppStream(m_pList->GetItemEdit(i), ptOffset);
- if (sItem.GetLength() > 0)
- {
- sListItems << "BT\n" << CPWL_Utils::GetColorAppStream(PWL_DEFAULT_SELTEXTCOLOR) << sItem << "ET\n";
- }
- }
- else
- {
- CFX_ByteString sItem = CPWL_Utils::GetEditAppStream(m_pList->GetItemEdit(i), ptOffset);
- if (sItem.GetLength() > 0)
- {
- sListItems << "BT\n" << CPWL_Utils::GetColorAppStream(GetTextColor()) << sItem << "ET\n";
- }
- }
- }
- }
-
- if (sListItems.GetLength() > 0)
- {
- CFX_ByteTextBuf sClip;
- CPDF_Rect rcClient = this->GetClientRect();
-
- sClip << "q\n";
- sClip << rcClient.left << " " << rcClient.bottom << " "
- << rcClient.right - rcClient.left << " " << rcClient.top - rcClient.bottom << " re W n\n";
-
- sClip << sListItems << "Q\n";
-
- sAppStream << "/Tx BMC\n" << sClip << "EMC\n";
- }
-}
-
-void CPWL_ListBox::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device)
-{
- CPWL_Wnd::DrawThisAppearance(pDevice,pUser2Device);
-
- if (m_pList)
- {
- CPDF_Rect rcPlate = m_pList->GetPlateRect();
- CPDF_Rect rcList = GetListRect();
- CPDF_Rect rcClient = GetClientRect();
-
- for (FX_INT32 i=0,sz=m_pList->GetCount(); i<sz; i++)
- {
- CPDF_Rect rcItem = m_pList->GetItemRect(i);
- if (rcItem.bottom > rcPlate.top || rcItem.top < rcPlate.bottom) continue;
-
- CPDF_Point ptOffset(rcItem.left, (rcItem.top + rcItem.bottom) * 0.5f);
- if (IFX_Edit* pEdit = m_pList->GetItemEdit(i))
- {
- CPDF_Rect rcContent = pEdit->GetContentRect();
- if (rcContent.Width() > rcClient.Width())
- rcItem.Intersect(rcList);
- else
- rcItem.Intersect(rcClient);
- }
-
- if (m_pList->IsItemSelected(i))
- {
- // CPWL_Utils::DrawFillRect(pDevice, pUser2Device, rcItem, ArgbEncode(255,0,51,113));
- IFX_SystemHandler* pSysHandler = GetSystemHandler();
- if(pSysHandler && pSysHandler->IsSelectionImplemented())
- {
- IFX_Edit::DrawEdit(pDevice, pUser2Device, m_pList->GetItemEdit(i), CPWL_Utils::PWLColorToFXColor(GetTextColor()), CPWL_Utils::PWLColorToFXColor(GetTextStrokeColor()),
- rcList, ptOffset, NULL,pSysHandler, m_pFormFiller);
- pSysHandler->OutputSelectedRect(m_pFormFiller, rcItem);
- }
- else
- {
- CPWL_Utils::DrawFillRect(pDevice, pUser2Device, rcItem, ArgbEncode(255,0,51,113));
- IFX_Edit::DrawEdit(pDevice, pUser2Device, m_pList->GetItemEdit(i), ArgbEncode(255,255,255,255), 0,
- rcList, ptOffset, NULL, pSysHandler, m_pFormFiller);
- }
- }
- else
- {
- IFX_SystemHandler* pSysHandler = GetSystemHandler();
- IFX_Edit::DrawEdit(pDevice, pUser2Device, m_pList->GetItemEdit(i),
- CPWL_Utils::PWLColorToFXColor(GetTextColor()),
- CPWL_Utils::PWLColorToFXColor(GetTextStrokeColor()),
- rcList, ptOffset, NULL,pSysHandler, NULL);
-
- }
- }
- }
-}
-
-FX_BOOL CPWL_ListBox::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
-{
- CPWL_Wnd::OnKeyDown(nChar, nFlag);
-
- if (!m_pList) return FALSE;
-
- switch (nChar)
- {
- default:
- return FALSE;
- case FWL_VKEY_Up:
- case FWL_VKEY_Down:
- case FWL_VKEY_Home:
- case FWL_VKEY_Left:
- case FWL_VKEY_End:
- case FWL_VKEY_Right:
- break;
- }
-
- switch (nChar)
- {
- case FWL_VKEY_Up:
- m_pList->OnVK_UP(IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
- break;
- case FWL_VKEY_Down:
- m_pList->OnVK_DOWN(IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
- break;
- case FWL_VKEY_Home:
- m_pList->OnVK_HOME(IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
- break;
- case FWL_VKEY_Left:
- m_pList->OnVK_LEFT(IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
- break;
- case FWL_VKEY_End:
- m_pList->OnVK_END(IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
- break;
- case FWL_VKEY_Right:
- m_pList->OnVK_RIGHT(IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
- break;
- case FWL_VKEY_Delete:
- break;
- }
-
- FX_BOOL bExit = FALSE;
- OnNotifySelChanged(TRUE,bExit,nFlag);
-
- return TRUE;
-}
-
-FX_BOOL CPWL_ListBox::OnChar(FX_WORD nChar, FX_DWORD nFlag)
-{
- CPWL_Wnd::OnChar(nChar,nFlag);
-
- if (!m_pList) return FALSE;
-
- if (!m_pList->OnChar(nChar,IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag))) return FALSE;
-
- FX_BOOL bExit = FALSE;
- OnNotifySelChanged(TRUE,bExit, nFlag);
-
- return TRUE;
-}
-
-FX_BOOL CPWL_ListBox::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
-{
- CPWL_Wnd::OnLButtonDown(point,nFlag);
-
- if (ClientHitTest(point))
- {
- m_bMouseDown = TRUE;
- SetFocus();
- SetCapture();
-
- if (m_pList)
- m_pList->OnMouseDown(point,IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
- }
-
- return TRUE;
-}
-
-FX_BOOL CPWL_ListBox::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
-{
- CPWL_Wnd::OnLButtonUp(point,nFlag);
-
- if (m_bMouseDown)
- {
- ReleaseCapture();
- m_bMouseDown = FALSE;
- }
-
- FX_BOOL bExit = FALSE;
- OnNotifySelChanged(FALSE,bExit,nFlag);
-
- return TRUE;
-}
-
-void CPWL_ListBox::SetHoverSel(FX_BOOL bHoverSel)
-{
- m_bHoverSel = bHoverSel;
-}
-
-FX_BOOL CPWL_ListBox::OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag)
-{
- CPWL_Wnd::OnMouseMove(point, nFlag);
-
- if (m_bHoverSel && !IsCaptureMouse() && ClientHitTest(point))
- {
- if (m_pList)
- m_pList->Select(m_pList->GetItemIndex(point));
- }
-
- if (m_bMouseDown)
- {
- if (m_pList)
- m_pList->OnMouseMove(point,IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
- }
-
- return TRUE;
-}
-
-void CPWL_ListBox::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam, FX_INTPTR lParam)
-{
- CPWL_Wnd::OnNotify(pWnd,msg,wParam,lParam);
-
- FX_FLOAT fPos;
-
- switch (msg)
- {
- case PNM_SETSCROLLINFO:
- switch (wParam)
- {
- case SBT_VSCROLL:
- if (CPWL_Wnd * pChild = GetVScrollBar())
- {
- pChild->OnNotify(pWnd,PNM_SETSCROLLINFO,wParam,lParam);
- }
- break;
- }
- break;
- case PNM_SETSCROLLPOS:
- switch (wParam)
- {
- case SBT_VSCROLL:
- if (CPWL_Wnd * pChild = GetVScrollBar())
- {
- pChild->OnNotify(pWnd,PNM_SETSCROLLPOS,wParam,lParam);
- }
- break;
- }
- break;
- case PNM_SCROLLWINDOW:
- fPos = *(FX_FLOAT*)lParam;
- switch (wParam)
- {
- case SBT_VSCROLL:
- if (m_pList)
- m_pList->SetScrollPos(CPDF_Point(0,fPos));
- break;
- }
- break;
- }
-}
-
-void CPWL_ListBox::KillFocus()
-{
- CPWL_Wnd::KillFocus();
-
- /*
- if (this->IsMultipleSel())
- {
- for(FX_INT32 i=0;i<this->GetCount();i++)
- {
- if (this->IsListItemSelected(i))
- {
- if (!IsListItemVisible(i))
- this->ScrollToListItem(i);
- break;
- }
- }
- }
- else
- {
- if (!IsListItemVisible(this->GetCurSel()))
- this->ScrollToListItem(this->GetCurSel());
- }
-
- SetListItemCaret(m_nCaretIndex,FALSE);
- */
-}
-
-void CPWL_ListBox::RePosChildWnd()
-{
- CPWL_Wnd::RePosChildWnd();
-
- if (m_pList)
- m_pList->SetPlateRect(GetListRect());
-}
-
-void CPWL_ListBox::OnNotifySelChanged(FX_BOOL bKeyDown, FX_BOOL & bExit, FX_DWORD nFlag)
-{
- if (m_pFillerNotify)
- {
- FX_BOOL bRC = TRUE;
- CFX_WideString swChange = GetText();
- CFX_WideString strChangeEx;
- int nSelStart = 0;
- int nSelEnd = swChange.GetLength();
- m_pFillerNotify->OnBeforeKeyStroke(FALSE, GetAttachedData(), 0, swChange, strChangeEx, nSelStart, nSelEnd, bKeyDown, bRC, bExit, nFlag);
- if (bExit) return;
-
- m_pFillerNotify->OnAfterKeyStroke(FALSE, GetAttachedData(), bExit,nFlag);
- }
-}
-
-CPDF_Rect CPWL_ListBox::GetFocusRect() const
-{
- if (m_pList && m_pList->IsMultipleSel())
- {
- CPDF_Rect rcCaret = m_pList->GetItemRect(m_pList->GetCaret());
- rcCaret.Intersect(GetClientRect());
- return rcCaret;
- }
-
- return CPWL_Wnd::GetFocusRect();
-}
-
-void CPWL_ListBox::AddString(FX_LPCWSTR string)
-{
- if (m_pList)
- {
- m_pList->AddString(string);
- }
-}
-
-void CPWL_ListBox::SetText(FX_LPCWSTR csText,FX_BOOL bRefresh)
-{
- //return CPDF_List::SetText(csText,bRefresh);
-}
-
-CFX_WideString CPWL_ListBox::GetText() const
-{
- if (m_pList)
- return m_pList->GetText();
-
- return L"";
-}
-
-void CPWL_ListBox::SetFontSize(FX_FLOAT fFontSize)
-{
- if (m_pList)
- m_pList->SetFontSize(fFontSize);
-}
-
-FX_FLOAT CPWL_ListBox::GetFontSize() const
-{
- if (m_pList)
- return m_pList->GetFontSize();
- return 0.0f;
-}
-
-void CPWL_ListBox::Select(FX_INT32 nItemIndex)
-{
- if (m_pList)
- m_pList->Select(nItemIndex);
-}
-
-void CPWL_ListBox::SetCaret(FX_INT32 nItemIndex)
-{
- if (m_pList)
- m_pList->SetCaret(nItemIndex);
-}
-
-void CPWL_ListBox::SetTopVisibleIndex(FX_INT32 nItemIndex)
-{
- if (m_pList)
- m_pList->SetTopItem(nItemIndex);
-}
-
-void CPWL_ListBox::ScrollToListItem(FX_INT32 nItemIndex)
-{
- if (m_pList)
- m_pList->ScrollToListItem(nItemIndex);
-}
-
-void CPWL_ListBox::ResetContent()
-{
- if (m_pList)
- m_pList->Empty();
-}
-
-void CPWL_ListBox::Reset()
-{
- if (m_pList)
- m_pList->Cancel();
-}
-
-FX_BOOL CPWL_ListBox::IsMultipleSel() const
-{
- if (m_pList)
- return m_pList->IsMultipleSel();
-
- return FALSE;
-}
-
-FX_INT32 CPWL_ListBox::GetCaretIndex() const
-{
- if (m_pList)
- return m_pList->GetCaret();
-
- return -1;
-}
-
-FX_INT32 CPWL_ListBox::GetCurSel() const
-{
- if (m_pList)
- return m_pList->GetSelect();
-
- return -1;
-}
-
-FX_BOOL CPWL_ListBox::IsItemSelected(FX_INT32 nItemIndex) const
-{
- if (m_pList)
- return m_pList->IsItemSelected(nItemIndex);
-
- return FALSE;
-}
-
-FX_INT32 CPWL_ListBox::GetTopVisibleIndex() const
-{
- if (m_pList)
- {
- m_pList->ScrollToListItem(m_pList->GetFirstSelected());
- return m_pList->GetTopItem();
- }
-
- return -1;
-}
-
-FX_INT32 CPWL_ListBox::GetCount() const
-{
- if (m_pList)
- return m_pList->GetCount();
-
- return 0;
-}
-
-FX_INT32 CPWL_ListBox::FindNext(FX_INT32 nIndex,FX_WCHAR nChar) const
-{
- if (m_pList)
- return m_pList->FindNext(nIndex,nChar);
-
- return nIndex;
-}
-
-CPDF_Rect CPWL_ListBox::GetContentRect() const
-{
- if (m_pList)
- return m_pList->GetContentRect();
-
- return CPDF_Rect();
-}
-
-FX_FLOAT CPWL_ListBox::GetFirstHeight() const
-{
- if (m_pList)
- return m_pList->GetFirstHeight();
-
- return 0.0f;
-}
-
-CPDF_Rect CPWL_ListBox::GetListRect() const
-{
- return CPWL_Utils::DeflateRect(GetWindowRect(),(FX_FLOAT)(GetBorderWidth()+GetInnerBorderWidth()));
-}
-
-FX_BOOL CPWL_ListBox::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag)
-{
- if (!m_pList) return FALSE;
-
- if (zDelta < 0)
- {
- m_pList->OnVK_DOWN(IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
- }
- else
- {
- m_pList->OnVK_UP(IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
- }
-
- FX_BOOL bExit = FALSE;
- OnNotifySelChanged(FALSE,bExit, nFlag);
- return TRUE;
-}
-
+// 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
+
+#include "../../include/pdfwindow/PDFWindow.h"
+#include "../../include/pdfwindow/PWL_Wnd.h"
+#include "../../include/pdfwindow/PWL_ListBox.h"
+#include "../../include/pdfwindow/PWL_Utils.h"
+#include "../../include/pdfwindow/PWL_ScrollBar.h"
+#include "../../include/pdfwindow/PWL_EditCtrl.h"
+#include "../../include/pdfwindow/PWL_Edit.h"
+
+#define IsFloatZero(f) ((f) < 0.0001 && (f) > -0.0001)
+#define IsFloatBigger(fa,fb) ((fa) > (fb) && !IsFloatZero((fa) - (fb)))
+#define IsFloatSmaller(fa,fb) ((fa) < (fb) && !IsFloatZero((fa) - (fb)))
+#define IsFloatEqual(fa,fb) IsFloatZero((fa)-(fb))
+
+/* ------------------------ CPWL_List_Notify ----------------------- */
+
+CPWL_List_Notify::CPWL_List_Notify(CPWL_ListBox* pList) : m_pList(pList)
+{
+ ASSERT(m_pList != NULL);
+}
+
+CPWL_List_Notify::~CPWL_List_Notify()
+{
+}
+
+void CPWL_List_Notify::IOnSetScrollInfoY(FX_FLOAT fPlateMin, FX_FLOAT fPlateMax,
+ FX_FLOAT fContentMin, FX_FLOAT fContentMax,
+ FX_FLOAT fSmallStep, FX_FLOAT fBigStep)
+{
+ PWL_SCROLL_INFO Info;
+
+ Info.fPlateWidth = fPlateMax - fPlateMin;
+ Info.fContentMin = fContentMin;
+ Info.fContentMax = fContentMax;
+ Info.fSmallStep = fSmallStep;
+ Info.fBigStep = fBigStep;
+
+ m_pList->OnNotify(m_pList,PNM_SETSCROLLINFO,SBT_VSCROLL,(FX_INTPTR)&Info);
+
+ if (CPWL_ScrollBar * pScroll = m_pList->GetVScrollBar())
+ {
+ if (IsFloatBigger(Info.fPlateWidth,Info.fContentMax-Info.fContentMin)
+ || IsFloatEqual(Info.fPlateWidth,Info.fContentMax-Info.fContentMin))
+ {
+ if (pScroll->IsVisible())
+ {
+ pScroll->SetVisible(FALSE);
+ m_pList->RePosChildWnd();
+ }
+ }
+ else
+ {
+ if (!pScroll->IsVisible())
+ {
+ pScroll->SetVisible(TRUE);
+ m_pList->RePosChildWnd();
+ }
+ }
+ }
+}
+
+void CPWL_List_Notify::IOnSetScrollPosY(FX_FLOAT fy)
+{
+ m_pList->OnNotify(m_pList,PNM_SETSCROLLPOS,SBT_VSCROLL,(FX_INTPTR)&fy);
+}
+
+void CPWL_List_Notify::IOnInvalidateRect(CPDF_Rect * pRect)
+{
+ m_pList->InvalidateRect(pRect);
+}
+
+/* --------------------------- CPWL_ListBox ---------------------------- */
+
+CPWL_ListBox::CPWL_ListBox() :
+ m_pList(NULL),
+ m_pListNotify(NULL),
+ m_bMouseDown(FALSE),
+ m_bHoverSel(FALSE),
+ m_pFillerNotify(NULL)
+{
+ m_pList = IFX_List::NewList();
+
+ ASSERT(m_pList != NULL);
+}
+
+CPWL_ListBox::~CPWL_ListBox()
+{
+ IFX_List::DelList(m_pList);
+
+ if (m_pListNotify)
+ {
+ delete m_pListNotify;
+ m_pListNotify = NULL;
+ }
+}
+
+CFX_ByteString CPWL_ListBox::GetClassName() const
+{
+ return "CPWL_ListBox";
+}
+
+void CPWL_ListBox::OnCreated()
+{
+ if (m_pList)
+ {
+ if (m_pListNotify) delete m_pListNotify;
+
+ m_pList->SetFontMap(GetFontMap());
+ m_pList->SetNotify(m_pListNotify = new CPWL_List_Notify(this));
+
+ SetHoverSel(HasFlag(PLBS_HOVERSEL));
+ m_pList->SetMultipleSel(HasFlag(PLBS_MULTIPLESEL));
+ m_pList->SetFontSize(this->GetCreationParam().fFontSize);
+
+ m_bHoverSel = HasFlag(PLBS_HOVERSEL);
+ }
+}
+
+void CPWL_ListBox::OnDestroy()
+{
+ if (m_pListNotify)
+ {
+ delete m_pListNotify;
+ m_pListNotify = NULL;
+ }
+}
+
+void CPWL_ListBox::GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream)
+{
+ CPWL_Wnd::GetThisAppearanceStream(sAppStream);
+
+ CFX_ByteTextBuf sListItems;
+
+ if (m_pList)
+ {
+ CPDF_Rect rcPlate = m_pList->GetPlateRect();
+ for (FX_INT32 i=0,sz=m_pList->GetCount(); i<sz; i++)
+ {
+ CPDF_Rect rcItem = m_pList->GetItemRect(i);
+
+ if (rcItem.bottom > rcPlate.top || rcItem.top < rcPlate.bottom) continue;
+
+ CPDF_Point ptOffset(rcItem.left, (rcItem.top + rcItem.bottom) * 0.5f);
+ if (m_pList->IsItemSelected(i))
+ {
+ sListItems << CPWL_Utils::GetRectFillAppStream(rcItem,PWL_DEFAULT_SELBACKCOLOR);
+ CFX_ByteString sItem = CPWL_Utils::GetEditAppStream(m_pList->GetItemEdit(i), ptOffset);
+ if (sItem.GetLength() > 0)
+ {
+ sListItems << "BT\n" << CPWL_Utils::GetColorAppStream(PWL_DEFAULT_SELTEXTCOLOR) << sItem << "ET\n";
+ }
+ }
+ else
+ {
+ CFX_ByteString sItem = CPWL_Utils::GetEditAppStream(m_pList->GetItemEdit(i), ptOffset);
+ if (sItem.GetLength() > 0)
+ {
+ sListItems << "BT\n" << CPWL_Utils::GetColorAppStream(GetTextColor()) << sItem << "ET\n";
+ }
+ }
+ }
+ }
+
+ if (sListItems.GetLength() > 0)
+ {
+ CFX_ByteTextBuf sClip;
+ CPDF_Rect rcClient = this->GetClientRect();
+
+ sClip << "q\n";
+ sClip << rcClient.left << " " << rcClient.bottom << " "
+ << rcClient.right - rcClient.left << " " << rcClient.top - rcClient.bottom << " re W n\n";
+
+ sClip << sListItems << "Q\n";
+
+ sAppStream << "/Tx BMC\n" << sClip << "EMC\n";
+ }
+}
+
+void CPWL_ListBox::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device)
+{
+ CPWL_Wnd::DrawThisAppearance(pDevice,pUser2Device);
+
+ if (m_pList)
+ {
+ CPDF_Rect rcPlate = m_pList->GetPlateRect();
+ CPDF_Rect rcList = GetListRect();
+ CPDF_Rect rcClient = GetClientRect();
+
+ for (FX_INT32 i=0,sz=m_pList->GetCount(); i<sz; i++)
+ {
+ CPDF_Rect rcItem = m_pList->GetItemRect(i);
+ if (rcItem.bottom > rcPlate.top || rcItem.top < rcPlate.bottom) continue;
+
+ CPDF_Point ptOffset(rcItem.left, (rcItem.top + rcItem.bottom) * 0.5f);
+ if (IFX_Edit* pEdit = m_pList->GetItemEdit(i))
+ {
+ CPDF_Rect rcContent = pEdit->GetContentRect();
+ if (rcContent.Width() > rcClient.Width())
+ rcItem.Intersect(rcList);
+ else
+ rcItem.Intersect(rcClient);
+ }
+
+ if (m_pList->IsItemSelected(i))
+ {
+ // CPWL_Utils::DrawFillRect(pDevice, pUser2Device, rcItem, ArgbEncode(255,0,51,113));
+ IFX_SystemHandler* pSysHandler = GetSystemHandler();
+ if(pSysHandler && pSysHandler->IsSelectionImplemented())
+ {
+ IFX_Edit::DrawEdit(pDevice, pUser2Device, m_pList->GetItemEdit(i), CPWL_Utils::PWLColorToFXColor(GetTextColor()), CPWL_Utils::PWLColorToFXColor(GetTextStrokeColor()),
+ rcList, ptOffset, NULL,pSysHandler, m_pFormFiller);
+ pSysHandler->OutputSelectedRect(m_pFormFiller, rcItem);
+ }
+ else
+ {
+ CPWL_Utils::DrawFillRect(pDevice, pUser2Device, rcItem, ArgbEncode(255,0,51,113));
+ IFX_Edit::DrawEdit(pDevice, pUser2Device, m_pList->GetItemEdit(i), ArgbEncode(255,255,255,255), 0,
+ rcList, ptOffset, NULL, pSysHandler, m_pFormFiller);
+ }
+ }
+ else
+ {
+ IFX_SystemHandler* pSysHandler = GetSystemHandler();
+ IFX_Edit::DrawEdit(pDevice, pUser2Device, m_pList->GetItemEdit(i),
+ CPWL_Utils::PWLColorToFXColor(GetTextColor()),
+ CPWL_Utils::PWLColorToFXColor(GetTextStrokeColor()),
+ rcList, ptOffset, NULL,pSysHandler, NULL);
+
+ }
+ }
+ }
+}
+
+FX_BOOL CPWL_ListBox::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
+{
+ CPWL_Wnd::OnKeyDown(nChar, nFlag);
+
+ if (!m_pList) return FALSE;
+
+ switch (nChar)
+ {
+ default:
+ return FALSE;
+ case FWL_VKEY_Up:
+ case FWL_VKEY_Down:
+ case FWL_VKEY_Home:
+ case FWL_VKEY_Left:
+ case FWL_VKEY_End:
+ case FWL_VKEY_Right:
+ break;
+ }
+
+ switch (nChar)
+ {
+ case FWL_VKEY_Up:
+ m_pList->OnVK_UP(IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
+ break;
+ case FWL_VKEY_Down:
+ m_pList->OnVK_DOWN(IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
+ break;
+ case FWL_VKEY_Home:
+ m_pList->OnVK_HOME(IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
+ break;
+ case FWL_VKEY_Left:
+ m_pList->OnVK_LEFT(IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
+ break;
+ case FWL_VKEY_End:
+ m_pList->OnVK_END(IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
+ break;
+ case FWL_VKEY_Right:
+ m_pList->OnVK_RIGHT(IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
+ break;
+ case FWL_VKEY_Delete:
+ break;
+ }
+
+ FX_BOOL bExit = FALSE;
+ OnNotifySelChanged(TRUE,bExit,nFlag);
+
+ return TRUE;
+}
+
+FX_BOOL CPWL_ListBox::OnChar(FX_WORD nChar, FX_DWORD nFlag)
+{
+ CPWL_Wnd::OnChar(nChar,nFlag);
+
+ if (!m_pList) return FALSE;
+
+ if (!m_pList->OnChar(nChar,IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag))) return FALSE;
+
+ FX_BOOL bExit = FALSE;
+ OnNotifySelChanged(TRUE,bExit, nFlag);
+
+ return TRUE;
+}
+
+FX_BOOL CPWL_ListBox::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
+{
+ CPWL_Wnd::OnLButtonDown(point,nFlag);
+
+ if (ClientHitTest(point))
+ {
+ m_bMouseDown = TRUE;
+ SetFocus();
+ SetCapture();
+
+ if (m_pList)
+ m_pList->OnMouseDown(point,IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
+ }
+
+ return TRUE;
+}
+
+FX_BOOL CPWL_ListBox::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
+{
+ CPWL_Wnd::OnLButtonUp(point,nFlag);
+
+ if (m_bMouseDown)
+ {
+ ReleaseCapture();
+ m_bMouseDown = FALSE;
+ }
+
+ FX_BOOL bExit = FALSE;
+ OnNotifySelChanged(FALSE,bExit,nFlag);
+
+ return TRUE;
+}
+
+void CPWL_ListBox::SetHoverSel(FX_BOOL bHoverSel)
+{
+ m_bHoverSel = bHoverSel;
+}
+
+FX_BOOL CPWL_ListBox::OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag)
+{
+ CPWL_Wnd::OnMouseMove(point, nFlag);
+
+ if (m_bHoverSel && !IsCaptureMouse() && ClientHitTest(point))
+ {
+ if (m_pList)
+ m_pList->Select(m_pList->GetItemIndex(point));
+ }
+
+ if (m_bMouseDown)
+ {
+ if (m_pList)
+ m_pList->OnMouseMove(point,IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
+ }
+
+ return TRUE;
+}
+
+void CPWL_ListBox::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam, FX_INTPTR lParam)
+{
+ CPWL_Wnd::OnNotify(pWnd,msg,wParam,lParam);
+
+ FX_FLOAT fPos;
+
+ switch (msg)
+ {
+ case PNM_SETSCROLLINFO:
+ switch (wParam)
+ {
+ case SBT_VSCROLL:
+ if (CPWL_Wnd * pChild = GetVScrollBar())
+ {
+ pChild->OnNotify(pWnd,PNM_SETSCROLLINFO,wParam,lParam);
+ }
+ break;
+ }
+ break;
+ case PNM_SETSCROLLPOS:
+ switch (wParam)
+ {
+ case SBT_VSCROLL:
+ if (CPWL_Wnd * pChild = GetVScrollBar())
+ {
+ pChild->OnNotify(pWnd,PNM_SETSCROLLPOS,wParam,lParam);
+ }
+ break;
+ }
+ break;
+ case PNM_SCROLLWINDOW:
+ fPos = *(FX_FLOAT*)lParam;
+ switch (wParam)
+ {
+ case SBT_VSCROLL:
+ if (m_pList)
+ m_pList->SetScrollPos(CPDF_Point(0,fPos));
+ break;
+ }
+ break;
+ }
+}
+
+void CPWL_ListBox::KillFocus()
+{
+ CPWL_Wnd::KillFocus();
+
+ /*
+ if (this->IsMultipleSel())
+ {
+ for(FX_INT32 i=0;i<this->GetCount();i++)
+ {
+ if (this->IsListItemSelected(i))
+ {
+ if (!IsListItemVisible(i))
+ this->ScrollToListItem(i);
+ break;
+ }
+ }
+ }
+ else
+ {
+ if (!IsListItemVisible(this->GetCurSel()))
+ this->ScrollToListItem(this->GetCurSel());
+ }
+
+ SetListItemCaret(m_nCaretIndex,FALSE);
+ */
+}
+
+void CPWL_ListBox::RePosChildWnd()
+{
+ CPWL_Wnd::RePosChildWnd();
+
+ if (m_pList)
+ m_pList->SetPlateRect(GetListRect());
+}
+
+void CPWL_ListBox::OnNotifySelChanged(FX_BOOL bKeyDown, FX_BOOL & bExit, FX_DWORD nFlag)
+{
+ if (m_pFillerNotify)
+ {
+ FX_BOOL bRC = TRUE;
+ CFX_WideString swChange = GetText();
+ CFX_WideString strChangeEx;
+ int nSelStart = 0;
+ int nSelEnd = swChange.GetLength();
+ m_pFillerNotify->OnBeforeKeyStroke(FALSE, GetAttachedData(), 0, swChange, strChangeEx, nSelStart, nSelEnd, bKeyDown, bRC, bExit, nFlag);
+ if (bExit) return;
+
+ m_pFillerNotify->OnAfterKeyStroke(FALSE, GetAttachedData(), bExit,nFlag);
+ }
+}
+
+CPDF_Rect CPWL_ListBox::GetFocusRect() const
+{
+ if (m_pList && m_pList->IsMultipleSel())
+ {
+ CPDF_Rect rcCaret = m_pList->GetItemRect(m_pList->GetCaret());
+ rcCaret.Intersect(GetClientRect());
+ return rcCaret;
+ }
+
+ return CPWL_Wnd::GetFocusRect();
+}
+
+void CPWL_ListBox::AddString(FX_LPCWSTR string)
+{
+ if (m_pList)
+ {
+ m_pList->AddString(string);
+ }
+}
+
+void CPWL_ListBox::SetText(FX_LPCWSTR csText,FX_BOOL bRefresh)
+{
+ //return CPDF_List::SetText(csText,bRefresh);
+}
+
+CFX_WideString CPWL_ListBox::GetText() const
+{
+ if (m_pList)
+ return m_pList->GetText();
+
+ return L"";
+}
+
+void CPWL_ListBox::SetFontSize(FX_FLOAT fFontSize)
+{
+ if (m_pList)
+ m_pList->SetFontSize(fFontSize);
+}
+
+FX_FLOAT CPWL_ListBox::GetFontSize() const
+{
+ if (m_pList)
+ return m_pList->GetFontSize();
+ return 0.0f;
+}
+
+void CPWL_ListBox::Select(FX_INT32 nItemIndex)
+{
+ if (m_pList)
+ m_pList->Select(nItemIndex);
+}
+
+void CPWL_ListBox::SetCaret(FX_INT32 nItemIndex)
+{
+ if (m_pList)
+ m_pList->SetCaret(nItemIndex);
+}
+
+void CPWL_ListBox::SetTopVisibleIndex(FX_INT32 nItemIndex)
+{
+ if (m_pList)
+ m_pList->SetTopItem(nItemIndex);
+}
+
+void CPWL_ListBox::ScrollToListItem(FX_INT32 nItemIndex)
+{
+ if (m_pList)
+ m_pList->ScrollToListItem(nItemIndex);
+}
+
+void CPWL_ListBox::ResetContent()
+{
+ if (m_pList)
+ m_pList->Empty();
+}
+
+void CPWL_ListBox::Reset()
+{
+ if (m_pList)
+ m_pList->Cancel();
+}
+
+FX_BOOL CPWL_ListBox::IsMultipleSel() const
+{
+ if (m_pList)
+ return m_pList->IsMultipleSel();
+
+ return FALSE;
+}
+
+FX_INT32 CPWL_ListBox::GetCaretIndex() const
+{
+ if (m_pList)
+ return m_pList->GetCaret();
+
+ return -1;
+}
+
+FX_INT32 CPWL_ListBox::GetCurSel() const
+{
+ if (m_pList)
+ return m_pList->GetSelect();
+
+ return -1;
+}
+
+FX_BOOL CPWL_ListBox::IsItemSelected(FX_INT32 nItemIndex) const
+{
+ if (m_pList)
+ return m_pList->IsItemSelected(nItemIndex);
+
+ return FALSE;
+}
+
+FX_INT32 CPWL_ListBox::GetTopVisibleIndex() const
+{
+ if (m_pList)
+ {
+ m_pList->ScrollToListItem(m_pList->GetFirstSelected());
+ return m_pList->GetTopItem();
+ }
+
+ return -1;
+}
+
+FX_INT32 CPWL_ListBox::GetCount() const
+{
+ if (m_pList)
+ return m_pList->GetCount();
+
+ return 0;
+}
+
+FX_INT32 CPWL_ListBox::FindNext(FX_INT32 nIndex,FX_WCHAR nChar) const
+{
+ if (m_pList)
+ return m_pList->FindNext(nIndex,nChar);
+
+ return nIndex;
+}
+
+CPDF_Rect CPWL_ListBox::GetContentRect() const
+{
+ if (m_pList)
+ return m_pList->GetContentRect();
+
+ return CPDF_Rect();
+}
+
+FX_FLOAT CPWL_ListBox::GetFirstHeight() const
+{
+ if (m_pList)
+ return m_pList->GetFirstHeight();
+
+ return 0.0f;
+}
+
+CPDF_Rect CPWL_ListBox::GetListRect() const
+{
+ return CPWL_Utils::DeflateRect(GetWindowRect(),(FX_FLOAT)(GetBorderWidth()+GetInnerBorderWidth()));
+}
+
+FX_BOOL CPWL_ListBox::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag)
+{
+ if (!m_pList) return FALSE;
+
+ if (zDelta < 0)
+ {
+ m_pList->OnVK_DOWN(IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
+ }
+ else
+ {
+ m_pList->OnVK_UP(IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
+ }
+
+ FX_BOOL bExit = FALSE;
+ OnNotifySelChanged(FALSE,bExit, nFlag);
+ return TRUE;
+}
+
diff --git a/fpdfsdk/src/pdfwindow/PWL_ListCtrl.cpp b/fpdfsdk/src/pdfwindow/PWL_ListCtrl.cpp
index 603bb4a139..9ac18fdc63 100644
--- a/fpdfsdk/src/pdfwindow/PWL_ListCtrl.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_ListCtrl.cpp
@@ -1,245 +1,245 @@
-// 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
-
-#include "../../include/pdfwindow/PDFWindow.h"
-#include "../../include/pdfwindow/PWL_Wnd.h"
-#include "../../include/pdfwindow/PWL_ListCtrl.h"
-
-/* ---------------------------- CPWL_ListCtrl ---------------------------- */
-
-CPWL_ListCtrl::CPWL_ListCtrl() :
- m_rcContent(0,0,0,0),
- m_ptScroll(0,0),
- m_fItemSpace(0.0f),
- m_fTopSpace(0.0f),
- m_fBottomSpace(0.0f)
-{
-}
-
-CPWL_ListCtrl::~CPWL_ListCtrl()
-{
-}
-
-void CPWL_ListCtrl::SetScrollPos(const CPDF_Point& point)
-{
- m_ptScroll = point;
-
- if (m_ptScroll.x < m_rcContent.left)
- m_ptScroll.x = m_rcContent.left;
-
- if (m_ptScroll.x > m_rcContent.right)
- m_ptScroll.x = m_rcContent.right;
-
- if (m_ptScroll.y > m_rcContent.top)
- m_ptScroll.y = m_rcContent.top;
-
- if (m_ptScroll.y < m_rcContent.bottom)
- m_ptScroll.y = m_rcContent.bottom;
-}
-
-CPDF_Point CPWL_ListCtrl::GetScrollPos() const
-{
- return m_ptScroll;
-}
-
-CPDF_Rect CPWL_ListCtrl::GetScrollArea() const
-{
- return m_rcContent;
-}
-
-void CPWL_ListCtrl::ResetFace()
-{
- ResetAll(FALSE, 0);
-}
-
-void CPWL_ListCtrl::ResetContent(FX_INT32 nStart)
-{
- if (nStart < 0)
- nStart = 0;
- if (nStart >= 0 && nStart < m_aChildren.GetSize())
- ResetAll(TRUE, nStart);
-}
-
-FX_FLOAT CPWL_ListCtrl::GetContentsHeight(FX_FLOAT fLimitWidth)
-{
- FX_FLOAT fRet = m_fTopSpace;
-
- FX_FLOAT fBorderWidth = (FX_FLOAT)this->GetBorderWidth();
-
- if (fLimitWidth > fBorderWidth* 2)
- {
- for (FX_INT32 i=0,sz=m_aChildren.GetSize(); i<sz; i++)
- {
- if (CPWL_Wnd* pChild = m_aChildren.GetAt(i))
- {
- FX_FLOAT fLeft = pChild->GetItemLeftMargin();
- FX_FLOAT fRight = pChild->GetItemRightMargin();
-
- fRet += pChild->GetItemHeight(fLimitWidth - fBorderWidth* 2 - fLeft - fRight);
- fRet += m_fItemSpace;
- }
- }
-
- fRet -= m_fItemSpace;
- }
-
- fRet += m_fBottomSpace;
-
- return fRet;
-}
-
-void CPWL_ListCtrl::ResetAll(FX_BOOL bMove, FX_INT32 nStart)
-{
- CPDF_Rect rcClient = GetClientRect();
-
- FX_FLOAT fWidth = rcClient.Width();
-
- FX_FLOAT fy = 0.0f - m_fTopSpace;
-
- if (nStart-1 >= 0 && nStart-1 < m_aChildren.GetSize())
- if (CPWL_Wnd* pChild = m_aChildren.GetAt(nStart-1))
- fy = pChild->GetWindowRect().bottom - m_fItemSpace;
-
- for (FX_INT32 i=nStart,sz=m_aChildren.GetSize(); i<sz; i++)
- {
- if (CPWL_Wnd* pChild = m_aChildren.GetAt(i))
- {
- FX_FLOAT fLeft = pChild->GetItemLeftMargin();
- FX_FLOAT fRight = pChild->GetItemRightMargin();
-
- pChild->SetChildMatrix(
- CPDF_Matrix(1,0,0,1,
- rcClient.left - m_ptScroll.x,
- rcClient.top - m_ptScroll.y)
- );
-
- if (bMove)
- {
- FX_FLOAT fItemHeight = pChild->GetItemHeight(fWidth - fLeft - fRight);
- pChild->Move(CPDF_Rect(fLeft, fy-fItemHeight, fWidth - fRight, fy), TRUE, FALSE);
- fy -= fItemHeight;
- fy -= m_fItemSpace;
- }
- }
- }
-
- fy += m_fItemSpace;
-
- fy -= m_fBottomSpace;
-
- if (bMove)
- {
- m_rcContent.left = 0;
- m_rcContent.top = 0;
- m_rcContent.right = fWidth;
- m_rcContent.bottom = fy;
- }
-}
-
-void CPWL_ListCtrl::SetItemSpace(FX_FLOAT fSpace)
-{
- m_fItemSpace = fSpace;
-}
-
-void CPWL_ListCtrl::SetTopSpace(FX_FLOAT fSpace)
-{
- m_fTopSpace = fSpace;
-}
-
-void CPWL_ListCtrl::SetBottomSpace(FX_FLOAT fSpace)
-{
- m_fBottomSpace = fSpace;
-}
-
-void CPWL_ListCtrl::RePosChildWnd()
-{
- ResetFace();
-}
-
-void CPWL_ListCtrl::DrawChildAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device)
-{
- pDevice->SaveState();
- CPDF_Rect rcClient = GetClientRect();
- CPDF_Rect rcTemp = rcClient;
- pUser2Device->TransformRect(rcTemp);
- FX_RECT rcClip((FX_INT32)rcTemp.left,
- (FX_INT32)rcTemp.bottom,
- (FX_INT32)rcTemp.right,
- (FX_INT32)rcTemp.top);
-
- pDevice->SetClip_Rect(&rcClip);
-
- for (FX_INT32 i=0,sz=m_aChildren.GetSize(); i<sz; i++)
- {
- if (CPWL_Wnd * pChild = m_aChildren.GetAt(i))
- {
- CPDF_Rect rcChild = pChild->ChildToParent(pChild->GetWindowRect());
- if (!(rcChild.top < rcClient.bottom || rcChild.bottom > rcClient.top))
- {
- CPDF_Matrix mt = pChild->GetChildMatrix();
- if (mt.IsIdentity())
- {
- pChild->DrawAppearance(pDevice,pUser2Device);
- }
- else
- {
- mt.Concat(*pUser2Device);
- pChild->DrawAppearance(pDevice,&mt);
- }
- }
- }
- }
-
- pDevice->RestoreState();
-}
-
-FX_INT32 CPWL_ListCtrl::GetItemIndex(CPWL_Wnd* pItem)
-{
- for (FX_INT32 i=0, sz=m_aChildren.GetSize(); i<sz; i++)
- {
- if (pItem == m_aChildren.GetAt(i))
- return i;
- }
-
- return -1;
-}
-
-CPDF_Point CPWL_ListCtrl::InToOut(const CPDF_Point& point) const
-{
- CPDF_Rect rcClient = GetClientRect();
-
- return CPDF_Point(point.x + rcClient.left - m_ptScroll.x,
- point.y + rcClient.top - m_ptScroll.y);
-}
-
-CPDF_Point CPWL_ListCtrl::OutToIn(const CPDF_Point& point) const
-{
- CPDF_Rect rcClient = GetClientRect();
-
- return CPDF_Point(point.x - rcClient.left + m_ptScroll.x,
- point.y - rcClient.top + m_ptScroll.y);
-}
-
-CPDF_Rect CPWL_ListCtrl::InToOut(const CPDF_Rect& rect) const
-{
- CPDF_Rect rcClient = GetClientRect();
-
- return CPDF_Rect(rect.left + rcClient.left - m_ptScroll.x,
- rect.bottom + rcClient.top - m_ptScroll.y,
- rect.right + rcClient.left - m_ptScroll.x,
- rect.top + rcClient.top - m_ptScroll.y);
-}
-
-CPDF_Rect CPWL_ListCtrl::OutToIn(const CPDF_Rect& rect) const
-{
- CPDF_Rect rcClient = GetClientRect();
-
- return CPDF_Rect(rect.left - rcClient.left + m_ptScroll.x,
- rect.bottom - rcClient.top + m_ptScroll.y,
- rect.right - rcClient.left + m_ptScroll.x,
- rect.top - rcClient.top + m_ptScroll.y);
-}
-
+// 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
+
+#include "../../include/pdfwindow/PDFWindow.h"
+#include "../../include/pdfwindow/PWL_Wnd.h"
+#include "../../include/pdfwindow/PWL_ListCtrl.h"
+
+/* ---------------------------- CPWL_ListCtrl ---------------------------- */
+
+CPWL_ListCtrl::CPWL_ListCtrl() :
+ m_rcContent(0,0,0,0),
+ m_ptScroll(0,0),
+ m_fItemSpace(0.0f),
+ m_fTopSpace(0.0f),
+ m_fBottomSpace(0.0f)
+{
+}
+
+CPWL_ListCtrl::~CPWL_ListCtrl()
+{
+}
+
+void CPWL_ListCtrl::SetScrollPos(const CPDF_Point& point)
+{
+ m_ptScroll = point;
+
+ if (m_ptScroll.x < m_rcContent.left)
+ m_ptScroll.x = m_rcContent.left;
+
+ if (m_ptScroll.x > m_rcContent.right)
+ m_ptScroll.x = m_rcContent.right;
+
+ if (m_ptScroll.y > m_rcContent.top)
+ m_ptScroll.y = m_rcContent.top;
+
+ if (m_ptScroll.y < m_rcContent.bottom)
+ m_ptScroll.y = m_rcContent.bottom;
+}
+
+CPDF_Point CPWL_ListCtrl::GetScrollPos() const
+{
+ return m_ptScroll;
+}
+
+CPDF_Rect CPWL_ListCtrl::GetScrollArea() const
+{
+ return m_rcContent;
+}
+
+void CPWL_ListCtrl::ResetFace()
+{
+ ResetAll(FALSE, 0);
+}
+
+void CPWL_ListCtrl::ResetContent(FX_INT32 nStart)
+{
+ if (nStart < 0)
+ nStart = 0;
+ if (nStart >= 0 && nStart < m_aChildren.GetSize())
+ ResetAll(TRUE, nStart);
+}
+
+FX_FLOAT CPWL_ListCtrl::GetContentsHeight(FX_FLOAT fLimitWidth)
+{
+ FX_FLOAT fRet = m_fTopSpace;
+
+ FX_FLOAT fBorderWidth = (FX_FLOAT)this->GetBorderWidth();
+
+ if (fLimitWidth > fBorderWidth* 2)
+ {
+ for (FX_INT32 i=0,sz=m_aChildren.GetSize(); i<sz; i++)
+ {
+ if (CPWL_Wnd* pChild = m_aChildren.GetAt(i))
+ {
+ FX_FLOAT fLeft = pChild->GetItemLeftMargin();
+ FX_FLOAT fRight = pChild->GetItemRightMargin();
+
+ fRet += pChild->GetItemHeight(fLimitWidth - fBorderWidth* 2 - fLeft - fRight);
+ fRet += m_fItemSpace;
+ }
+ }
+
+ fRet -= m_fItemSpace;
+ }
+
+ fRet += m_fBottomSpace;
+
+ return fRet;
+}
+
+void CPWL_ListCtrl::ResetAll(FX_BOOL bMove, FX_INT32 nStart)
+{
+ CPDF_Rect rcClient = GetClientRect();
+
+ FX_FLOAT fWidth = rcClient.Width();
+
+ FX_FLOAT fy = 0.0f - m_fTopSpace;
+
+ if (nStart-1 >= 0 && nStart-1 < m_aChildren.GetSize())
+ if (CPWL_Wnd* pChild = m_aChildren.GetAt(nStart-1))
+ fy = pChild->GetWindowRect().bottom - m_fItemSpace;
+
+ for (FX_INT32 i=nStart,sz=m_aChildren.GetSize(); i<sz; i++)
+ {
+ if (CPWL_Wnd* pChild = m_aChildren.GetAt(i))
+ {
+ FX_FLOAT fLeft = pChild->GetItemLeftMargin();
+ FX_FLOAT fRight = pChild->GetItemRightMargin();
+
+ pChild->SetChildMatrix(
+ CPDF_Matrix(1,0,0,1,
+ rcClient.left - m_ptScroll.x,
+ rcClient.top - m_ptScroll.y)
+ );
+
+ if (bMove)
+ {
+ FX_FLOAT fItemHeight = pChild->GetItemHeight(fWidth - fLeft - fRight);
+ pChild->Move(CPDF_Rect(fLeft, fy-fItemHeight, fWidth - fRight, fy), TRUE, FALSE);
+ fy -= fItemHeight;
+ fy -= m_fItemSpace;
+ }
+ }
+ }
+
+ fy += m_fItemSpace;
+
+ fy -= m_fBottomSpace;
+
+ if (bMove)
+ {
+ m_rcContent.left = 0;
+ m_rcContent.top = 0;
+ m_rcContent.right = fWidth;
+ m_rcContent.bottom = fy;
+ }
+}
+
+void CPWL_ListCtrl::SetItemSpace(FX_FLOAT fSpace)
+{
+ m_fItemSpace = fSpace;
+}
+
+void CPWL_ListCtrl::SetTopSpace(FX_FLOAT fSpace)
+{
+ m_fTopSpace = fSpace;
+}
+
+void CPWL_ListCtrl::SetBottomSpace(FX_FLOAT fSpace)
+{
+ m_fBottomSpace = fSpace;
+}
+
+void CPWL_ListCtrl::RePosChildWnd()
+{
+ ResetFace();
+}
+
+void CPWL_ListCtrl::DrawChildAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device)
+{
+ pDevice->SaveState();
+ CPDF_Rect rcClient = GetClientRect();
+ CPDF_Rect rcTemp = rcClient;
+ pUser2Device->TransformRect(rcTemp);
+ FX_RECT rcClip((FX_INT32)rcTemp.left,
+ (FX_INT32)rcTemp.bottom,
+ (FX_INT32)rcTemp.right,
+ (FX_INT32)rcTemp.top);
+
+ pDevice->SetClip_Rect(&rcClip);
+
+ for (FX_INT32 i=0,sz=m_aChildren.GetSize(); i<sz; i++)
+ {
+ if (CPWL_Wnd * pChild = m_aChildren.GetAt(i))
+ {
+ CPDF_Rect rcChild = pChild->ChildToParent(pChild->GetWindowRect());
+ if (!(rcChild.top < rcClient.bottom || rcChild.bottom > rcClient.top))
+ {
+ CPDF_Matrix mt = pChild->GetChildMatrix();
+ if (mt.IsIdentity())
+ {
+ pChild->DrawAppearance(pDevice,pUser2Device);
+ }
+ else
+ {
+ mt.Concat(*pUser2Device);
+ pChild->DrawAppearance(pDevice,&mt);
+ }
+ }
+ }
+ }
+
+ pDevice->RestoreState();
+}
+
+FX_INT32 CPWL_ListCtrl::GetItemIndex(CPWL_Wnd* pItem)
+{
+ for (FX_INT32 i=0, sz=m_aChildren.GetSize(); i<sz; i++)
+ {
+ if (pItem == m_aChildren.GetAt(i))
+ return i;
+ }
+
+ return -1;
+}
+
+CPDF_Point CPWL_ListCtrl::InToOut(const CPDF_Point& point) const
+{
+ CPDF_Rect rcClient = GetClientRect();
+
+ return CPDF_Point(point.x + rcClient.left - m_ptScroll.x,
+ point.y + rcClient.top - m_ptScroll.y);
+}
+
+CPDF_Point CPWL_ListCtrl::OutToIn(const CPDF_Point& point) const
+{
+ CPDF_Rect rcClient = GetClientRect();
+
+ return CPDF_Point(point.x - rcClient.left + m_ptScroll.x,
+ point.y - rcClient.top + m_ptScroll.y);
+}
+
+CPDF_Rect CPWL_ListCtrl::InToOut(const CPDF_Rect& rect) const
+{
+ CPDF_Rect rcClient = GetClientRect();
+
+ return CPDF_Rect(rect.left + rcClient.left - m_ptScroll.x,
+ rect.bottom + rcClient.top - m_ptScroll.y,
+ rect.right + rcClient.left - m_ptScroll.x,
+ rect.top + rcClient.top - m_ptScroll.y);
+}
+
+CPDF_Rect CPWL_ListCtrl::OutToIn(const CPDF_Rect& rect) const
+{
+ CPDF_Rect rcClient = GetClientRect();
+
+ return CPDF_Rect(rect.left - rcClient.left + m_ptScroll.x,
+ rect.bottom - rcClient.top + m_ptScroll.y,
+ rect.right - rcClient.left + m_ptScroll.x,
+ rect.top - rcClient.top + m_ptScroll.y);
+}
+
diff --git a/fpdfsdk/src/pdfwindow/PWL_Note.cpp b/fpdfsdk/src/pdfwindow/PWL_Note.cpp
index 3c6d8661c6..5929a357c9 100644
--- a/fpdfsdk/src/pdfwindow/PWL_Note.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_Note.cpp
@@ -1,1779 +1,1779 @@
-// 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
-
-#include "../../include/pdfwindow/PDFWindow.h"
-#include "../../include/pdfwindow/PWL_Wnd.h"
-#include "../../include/pdfwindow/PWL_Button.h"
-#include "../../include/pdfwindow/PWL_EditCtrl.h"
-#include "../../include/pdfwindow/PWL_Edit.h"
-#include "../../include/pdfwindow/PWL_ListCtrl.h"
-#include "../../include/pdfwindow/PWL_ScrollBar.h"
-#include "../../include/pdfwindow/PWL_Note.h"
-#include "../../include/pdfwindow/PWL_Label.h"
-#include "../../include/pdfwindow/PWL_Edit.h"
-#include "../../include/pdfwindow/PWL_ScrollBar.h"
-#include "../../include/pdfwindow/PWL_Utils.h"
-#include "../../include/pdfwindow/PWL_Caret.h"
-
-#define POPUP_ITEM_HEAD_BOTTOM 3.0f
-#define POPUP_ITEM_BOTTOMWIDTH 1.0f
-#define POPUP_ITEM_SIDEMARGIN 3.0f
-#define POPUP_ITEM_SPACE 4.0f
-#define POPUP_ITEM_TEXT_INDENT 2.0f
-#define POPUP_ITEM_BORDERCOLOR CPWL_Color(COLORTYPE_RGB, 80/255.0f, 80/255.0f, 80/255.0f)
-
-#define IsFloatZero(f) ((f) < 0.0001 && (f) > -0.0001)
-#define IsFloatBigger(fa,fb) ((fa) > (fb) && !IsFloatZero((fa) - (fb)))
-#define IsFloatSmaller(fa,fb) ((fa) < (fb) && !IsFloatZero((fa) - (fb)))
-#define IsFloatEqual(fa,fb) IsFloatZero((fa)-(fb))
-
-
-/* ------------------------------- CPWL_Note_Options ------------------------------- */
-
-CPWL_Note_Options::CPWL_Note_Options() : m_pText(NULL)
-{
-}
-
-CPWL_Note_Options::~CPWL_Note_Options()
-{
-}
-
-void CPWL_Note_Options::SetTextColor(const CPWL_Color & color)
-{
- CPWL_Wnd::SetTextColor(color);
-
- if (m_pText)
- m_pText->SetTextColor(color);
-}
-
-void CPWL_Note_Options::RePosChildWnd()
-{
- if (this->IsValid())
- {
- ASSERT(m_pText != NULL);
-
- CPDF_Rect rcClient = GetClientRect();
-
- if (rcClient.Width() > 15.0f)
- {
- rcClient.right -= 15.0f;
- m_pText->Move(rcClient, TRUE, FALSE);
- m_pText->SetVisible(TRUE);
- }
- else
- {
- m_pText->Move(CPDF_Rect(0,0,0,0), TRUE, FALSE);
- m_pText->SetVisible(FALSE);
- }
- }
-}
-
-void CPWL_Note_Options::CreateChildWnd(const PWL_CREATEPARAM & cp)
-{
- m_pText = new CPWL_Label;
- PWL_CREATEPARAM tcp = cp;
- tcp.pParentWnd = this;
- tcp.dwFlags = PWS_CHILD | PWS_VISIBLE;
- m_pText->Create(tcp);
-}
-
-void CPWL_Note_Options::SetText(const CFX_WideString& sText)
-{
- m_pText->SetText(sText);
-}
-
-void CPWL_Note_Options::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device)
-{
- CPWL_Wnd::DrawThisAppearance(pDevice, pUser2Device);
-
- CPDF_Rect rcClient = GetClientRect();
- rcClient.left = rcClient.right - 15.0f;
-
- CPDF_Point ptCenter = CPDF_Point((rcClient.left + rcClient.right) * 0.5f, (rcClient.top + rcClient.bottom) * 0.5f);
-
- CPDF_Point pt1(ptCenter.x - 2.0f, ptCenter.y + 2.0f * 0.5f);
- CPDF_Point pt2(ptCenter.x + 2.0f, ptCenter.y + 2.0f * 0.5f);
- CPDF_Point pt3(ptCenter.x, ptCenter.y - 3.0f * 0.5f);
-
- CFX_PathData path;
-
- path.SetPointCount(4);
- path.SetPoint(0, pt1.x, pt1.y, FXPT_MOVETO);
- path.SetPoint(1, pt2.x, pt2.y, FXPT_LINETO);
- path.SetPoint(2, pt3.x, pt3.y, FXPT_LINETO);
- path.SetPoint(3, pt1.x, pt1.y, FXPT_LINETO);
-
- pDevice->DrawPath(&path, pUser2Device, NULL,
- CPWL_Utils::PWLColorToFXColor(GetTextColor(),GetTransparency()),
- 0, FXFILL_ALTERNATE);
-}
-
-CPDF_Rect CPWL_Note_Options::GetContentRect() const
-{
- ASSERT(m_pText != NULL);
-
- CPDF_Rect rcText = m_pText->GetContentRect();
- rcText.right += 15.0f;
- return rcText;
-}
-
-/* ------------------------------- CPWL_Note_Edit ------------------------------ */
-
-CPWL_Note_Edit::CPWL_Note_Edit() : m_bEnableNotify(TRUE),
- m_fOldItemHeight(0.0f),
- m_bSizeChanged(FALSE),
- m_fOldMin(0.0f),
- m_fOldMax(0.0f)
-{
-}
-
-CPWL_Note_Edit::~CPWL_Note_Edit()
-{
-}
-
-void CPWL_Note_Edit::RePosChildWnd()
-{
- m_bEnableNotify = FALSE;
- CPWL_Edit::RePosChildWnd();
- m_bEnableNotify = TRUE;
-
- m_fOldItemHeight = this->GetContentRect().Height();
-}
-
-void CPWL_Note_Edit::SetText(FX_LPCWSTR csText)
-{
- m_bEnableNotify = FALSE;
- CPWL_Edit::SetText(csText);
- m_bEnableNotify = TRUE;
- m_fOldItemHeight = this->GetContentRect().Height();
-}
-
-void CPWL_Note_Edit::OnSetFocus()
-{
- m_bEnableNotify = FALSE;
- CPWL_Edit::OnSetFocus();
- m_bEnableNotify = TRUE;
-
- this->EnableSpellCheck(TRUE);
-}
-
-void CPWL_Note_Edit::OnKillFocus()
-{
- this->EnableSpellCheck(FALSE);
-
- if (CPWL_Wnd* pParent = this->GetParentWindow())
- {
- if (CPWL_Wnd* pGrand = pParent->GetParentWindow())
- {
- ASSERT(pGrand->GetClassName() == "CPWL_NoteItem");
-
- CPWL_NoteItem* pNoteItem = (CPWL_NoteItem*)pGrand;
-
- pNoteItem->OnContentsValidate();
- }
- }
-
- CPWL_Edit::OnKillFocus();
-}
-
-void CPWL_Note_Edit::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam, FX_INTPTR lParam)
-{
- if (m_bEnableNotify)
- {
- if (wParam == SBT_VSCROLL)
- {
- switch (msg)
- {
- case PNM_SETSCROLLINFO:
- if (PWL_SCROLL_INFO* pInfo = (PWL_SCROLL_INFO*)lParam)
- {
- if (!IsFloatEqual(pInfo->fContentMax, m_fOldMax) ||
- !IsFloatEqual(pInfo->fContentMin, m_fOldMin))
- {
- m_bSizeChanged = TRUE;
- if (CPWL_Wnd * pParent = this->GetParentWindow())
- {
- pParent->OnNotify(this, PNM_NOTEEDITCHANGED, 0, 0);
- }
-
- m_fOldMax = pInfo->fContentMax;
- m_fOldMin = pInfo->fContentMin;
- return;
- }
- }
- }
- }
- }
-
- CPWL_Edit::OnNotify(pWnd, msg, wParam, lParam);
-
- if (m_bEnableNotify)
- {
- switch (msg)
- {
- case PNM_SETCARETINFO:
- if (PWL_CARET_INFO * pInfo = (PWL_CARET_INFO*)wParam)
- {
- PWL_CARET_INFO newInfo = *pInfo;
- newInfo.bVisible = TRUE;
- newInfo.ptHead = this->ChildToParent(pInfo->ptHead);
- newInfo.ptFoot = this->ChildToParent(pInfo->ptFoot);
-
- if (CPWL_Wnd * pParent = this->GetParentWindow())
- {
- pParent->OnNotify(this, PNM_SETCARETINFO, (FX_INTPTR)&newInfo, 0);
- }
- }
- break;
- }
- }
-}
-
-FX_FLOAT CPWL_Note_Edit::GetItemHeight(FX_FLOAT fLimitWidth)
-{
- if (fLimitWidth > 0)
- {
- if (!m_bSizeChanged)
- return m_fOldItemHeight;
-
- m_bSizeChanged = FALSE;
-
- this->EnableNotify(FALSE);
- this->EnableRefresh(FALSE);
- m_pEdit->EnableNotify(FALSE);
-
- //CPDF_Rect rcOld = this->GetWindowRect();
-
- this->Move(CPDF_Rect(0,0,fLimitWidth,0), TRUE, FALSE);
- FX_FLOAT fRet = this->GetContentRect().Height();
-
- //this->Move(rcOld, TRUE, FALSE);
-
- m_pEdit->EnableNotify(TRUE);
- this->EnableNotify(TRUE);
- this->EnableRefresh(TRUE);
-
- return fRet;
- }
-
- return 0;
-}
-
-FX_FLOAT CPWL_Note_Edit::GetItemLeftMargin()
-{
- return POPUP_ITEM_TEXT_INDENT;
-}
-
-FX_FLOAT CPWL_Note_Edit::GetItemRightMargin()
-{
- return POPUP_ITEM_TEXT_INDENT;
-}
-
-/* -------------------------------- CPWL_Note_LBBox --------------------------------*/
-
-CPWL_Note_LBBox::CPWL_Note_LBBox()
-{
-}
-
-CPWL_Note_LBBox::~CPWL_Note_LBBox()
-{
-}
-
-void CPWL_Note_LBBox::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device)
-{
- CPDF_Rect rcClient = this->GetClientRect();
-
- CFX_GraphStateData gsd;
- gsd.m_LineWidth = 1.0f;
-
- CFX_PathData pathCross;
-
- pathCross.SetPointCount(4);
- pathCross.SetPoint(0, rcClient.left, rcClient.top, FXPT_MOVETO);
- pathCross.SetPoint(1, rcClient.right, rcClient.bottom, FXPT_LINETO);
- pathCross.SetPoint(2, rcClient.left, rcClient.bottom + rcClient.Height() * 0.5f, FXPT_MOVETO);
- pathCross.SetPoint(3, rcClient.left + rcClient.Width() * 0.5f, rcClient.bottom, FXPT_LINETO);
-
- pDevice->DrawPath(&pathCross, pUser2Device, &gsd,
- 0, CPWL_Utils::PWLColorToFXColor(GetTextColor(),this->GetTransparency()), FXFILL_ALTERNATE);
-}
-
-/* -------------------------------- CPWL_Note_RBBox --------------------------------*/
-
-CPWL_Note_RBBox::CPWL_Note_RBBox()
-{
-}
-
-CPWL_Note_RBBox::~CPWL_Note_RBBox()
-{
-}
-
-void CPWL_Note_RBBox::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device)
-{
- CPDF_Rect rcClient = this->GetClientRect();
-
- CFX_GraphStateData gsd;
- gsd.m_LineWidth = 1.0f;
-
- CFX_PathData pathCross;
-
- pathCross.SetPointCount(4);
- pathCross.SetPoint(0, rcClient.right, rcClient.top, FXPT_MOVETO);
- pathCross.SetPoint(1, rcClient.left, rcClient.bottom, FXPT_LINETO);
- pathCross.SetPoint(2, rcClient.right, rcClient.bottom + rcClient.Height() * 0.5f, FXPT_MOVETO);
- pathCross.SetPoint(3, rcClient.left + rcClient.Width() * 0.5f, rcClient.bottom, FXPT_LINETO);
-
- pDevice->DrawPath(&pathCross, pUser2Device, &gsd,
- 0, CPWL_Utils::PWLColorToFXColor(GetTextColor(),this->GetTransparency()), FXFILL_ALTERNATE);
-}
-
-/* --------------------------------- CPWL_Note_Icon ---------------------------------- */
-
-CPWL_Note_Icon::CPWL_Note_Icon() : m_nType(0)
-{
-}
-
-CPWL_Note_Icon::~CPWL_Note_Icon()
-{
-}
-
-void CPWL_Note_Icon::SetIconType(FX_INT32 nType)
-{
- m_nType = nType;
-}
-
-void CPWL_Note_Icon::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device)
-{
- CPWL_Utils::DrawIconAppStream(pDevice, pUser2Device, m_nType, GetClientRect(),
- this->GetBackgroundColor(), PWL_DEFAULT_BLACKCOLOR, this->GetTransparency());
-}
-
-/* --------------------------------- CPWL_Note_CloseBox ---------------------------------- */
-
-CPWL_Note_CloseBox::CPWL_Note_CloseBox() : m_bMouseDown(FALSE)
-{
-}
-
-CPWL_Note_CloseBox::~CPWL_Note_CloseBox()
-{
-}
-
-void CPWL_Note_CloseBox::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device)
-{
- CPWL_Button::DrawThisAppearance(pDevice, pUser2Device);
-
- CPDF_Rect rcClient = this->GetClientRect();
- rcClient = CPWL_Utils::DeflateRect(rcClient, 2.0f);
-
- CFX_GraphStateData gsd;
- gsd.m_LineWidth = 1.0f;
-
- CFX_PathData pathCross;
-
- if (m_bMouseDown)
- {
- rcClient.left += 0.5f;
- rcClient.right += 0.5f;
- rcClient.top -= 0.5f;
- rcClient.bottom -= 0.5f;
- }
-
- pathCross.SetPointCount(4);
- pathCross.SetPoint(0, rcClient.left, rcClient.bottom, FXPT_MOVETO);
- pathCross.SetPoint(1, rcClient.right, rcClient.top, FXPT_LINETO);
- pathCross.SetPoint(2, rcClient.left, rcClient.top, FXPT_MOVETO);
- pathCross.SetPoint(3, rcClient.right, rcClient.bottom, FXPT_LINETO);
-
- pDevice->DrawPath(&pathCross, pUser2Device, &gsd,
- 0, CPWL_Utils::PWLColorToFXColor(GetTextColor(),this->GetTransparency()), FXFILL_ALTERNATE);
-}
-
-FX_BOOL CPWL_Note_CloseBox::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
-{
- SetBorderStyle(PBS_INSET);
- InvalidateRect(NULL);
-
- m_bMouseDown = TRUE;
-
- return CPWL_Button::OnLButtonDown(point,nFlag);
-}
-
-FX_BOOL CPWL_Note_CloseBox::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
-{
- m_bMouseDown = FALSE;
-
- SetBorderStyle(PBS_BEVELED);
- InvalidateRect(NULL);
-
- return CPWL_Button::OnLButtonUp(point,nFlag);
-}
-
-/* ------------------------------ CPWL_Note_Contents ------------------------------- */
-
-CPWL_Note_Contents::CPWL_Note_Contents() : m_pEdit(NULL)
-{
-}
-
-CPWL_Note_Contents::~CPWL_Note_Contents()
-{
-}
-
-CFX_ByteString CPWL_Note_Contents::GetClassName() const
-{
- return "CPWL_Note_Contents";
-}
-
-void CPWL_Note_Contents::CreateChildWnd(const PWL_CREATEPARAM & cp)
-{
- m_pEdit = new CPWL_Note_Edit;
- PWL_CREATEPARAM ecp = cp;
- ecp.pParentWnd = this;
- ecp.dwFlags = PWS_VISIBLE | PWS_CHILD | PES_MULTILINE | PES_AUTORETURN | PES_TEXTOVERFLOW | PES_UNDO | PES_SPELLCHECK;
-
- m_pEdit->EnableNotify(FALSE);
- m_pEdit->Create(ecp);
- m_pEdit->EnableNotify(TRUE);
-}
-
-void CPWL_Note_Contents::SetText(const CFX_WideString& sText)
-{
- if (m_pEdit)
- {
- m_pEdit->EnableNotify(FALSE);
- m_pEdit->SetText(sText);
- m_pEdit->EnableNotify(TRUE);
- OnNotify(m_pEdit, PNM_NOTEEDITCHANGED, 0, 0);
- }
-}
-
-CFX_WideString CPWL_Note_Contents::GetText() const
-{
- if (m_pEdit)
- return m_pEdit->GetText();
-
- return L"";
-}
-
-CPWL_NoteItem* CPWL_Note_Contents::CreateSubItem()
-{
- CPWL_NoteItem* pNoteItem = new CPWL_NoteItem;
- PWL_CREATEPARAM icp = this->GetCreationParam();
- icp.pParentWnd = this;
- icp.dwFlags = PWS_CHILD | PWS_VISIBLE | PWS_BACKGROUND;
- pNoteItem->Create(icp);
-
- pNoteItem->OnCreateNoteItem();
-
- pNoteItem->ResetSubjectName(m_aChildren.GetSize() - 1);
-
- FX_SYSTEMTIME st;
- if (IFX_SystemHandler* pSH = this->GetSystemHandler())
- st = pSH->GetLocalTime();
- pNoteItem->SetDateTime(st);
-
- pNoteItem->SetContents(L"");
-
- this->OnNotify(pNoteItem, PNM_NOTEEDITCHANGED, 0, 0);
-
- return pNoteItem;
-}
-
-FX_INT32 CPWL_Note_Contents::CountSubItems() const
-{
- return m_aChildren.GetSize() - 1;
-}
-
-IPWL_NoteItem* CPWL_Note_Contents::GetSubItems(FX_INT32 index) const
-{
- FX_INT32 nIndex = index + 1;
-
- if (nIndex > 0 && nIndex < m_aChildren.GetSize())
- if (CPWL_Wnd* pChild = m_aChildren.GetAt(nIndex))
- {
- ASSERT(pChild->GetClassName() == "CPWL_NoteItem");
- CPWL_NoteItem* pItem = (CPWL_NoteItem*)pChild;
- return pItem;
- }
- return NULL;
-}
-
-void CPWL_Note_Contents::DeleteSubItem(IPWL_NoteItem* pNoteItem)
-{
- FX_INT32 nIndex = this->GetItemIndex((CPWL_NoteItem*)pNoteItem);
-
- if (nIndex > 0)
- {
- if (CPWL_NoteItem* pPWLNoteItem = (CPWL_NoteItem*)pNoteItem)
- {
- pPWLNoteItem->KillFocus();
- pPWLNoteItem->Destroy();
- delete pPWLNoteItem;
- }
-
- for (FX_INT32 i=nIndex,sz=m_aChildren.GetSize(); i<sz; i++)
- {
- if (CPWL_Wnd* pChild = m_aChildren.GetAt(i))
- {
- ASSERT(pChild->GetClassName() == "CPWL_NoteItem");
- CPWL_NoteItem* pItem = (CPWL_NoteItem*)pChild;
- pItem->ResetSubjectName(i);
- }
- }
-
- this->OnNotify(this, PNM_NOTEEDITCHANGED, 0, 0);
- }
-}
-
-IPWL_NoteItem* CPWL_Note_Contents::GetHitNoteItem(const CPDF_Point& point)
-{
- CPDF_Point pt = this->ParentToChild(point);
-
- for (FX_INT32 i=0,sz=m_aChildren.GetSize(); i<sz; i++)
- {
- if (CPWL_Wnd* pChild = m_aChildren.GetAt(i))
- {
- if (pChild->GetClassName() == "CPWL_NoteItem")
- {
- CPWL_NoteItem* pNoteItem = (CPWL_NoteItem*)pChild;
- if (IPWL_NoteItem* pRet = pNoteItem->GetHitNoteItem(pt))
- return pRet;
- }
- }
- }
- return NULL;
-}
-
-void CPWL_Note_Contents::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam, FX_INTPTR lParam)
-{
- switch (msg)
- {
- case PNM_NOTEEDITCHANGED:
- {
- FX_INT32 nIndex = this->GetItemIndex(pWnd);
- if (nIndex < 0) nIndex = 0;
-
- m_pEdit->EnableNotify(FALSE);
- this->ResetContent(nIndex);
- m_pEdit->EnableNotify(TRUE);
-
- for (FX_INT32 i=nIndex+1, sz=m_aChildren.GetSize(); i<sz; i++)
- {
- if (CPWL_Wnd* pChild = m_aChildren.GetAt(i))
- pChild->OnNotify(this, PNM_NOTERESET, 0, 0);
- }
-
- if (CPWL_Wnd * pParent = this->GetParentWindow())
- {
- pParent->OnNotify(this, PNM_NOTEEDITCHANGED, 0, 0);
- }
- }
- return;
- case PNM_SCROLLWINDOW:
- this->SetScrollPos(CPDF_Point(0.0f, *(FX_FLOAT*)lParam));
- this->ResetFace();
- InvalidateRect(NULL);
- return;
- case PNM_SETCARETINFO:
- if (PWL_CARET_INFO * pInfo = (PWL_CARET_INFO*)wParam)
- {
- PWL_CARET_INFO newInfo = *pInfo;
- newInfo.bVisible = TRUE;
- newInfo.ptHead = this->ChildToParent(pInfo->ptHead);
- newInfo.ptFoot = this->ChildToParent(pInfo->ptFoot);
-
- if (CPWL_Wnd * pParent = this->GetParentWindow())
- {
- pParent->OnNotify(this, PNM_SETCARETINFO, (FX_INTPTR)&newInfo, 0);
- }
- }
- return;
- case PNM_NOTERESET:
- {
- m_pEdit->EnableNotify(FALSE);
- this->ResetContent(0);
- m_pEdit->EnableNotify(TRUE);
-
- for (FX_INT32 i=1, sz=m_aChildren.GetSize(); i<sz; i++)
- {
- if (CPWL_Wnd* pChild = m_aChildren.GetAt(i))
- pChild->OnNotify(this, PNM_NOTERESET, 0, 0);
- }
-
- m_pEdit->EnableNotify(FALSE);
- this->ResetContent(0);
- m_pEdit->EnableNotify(TRUE);
- }
- return;
- }
-
- CPWL_Wnd::OnNotify(pWnd, msg, wParam, lParam);
-}
-
-FX_BOOL CPWL_Note_Contents::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
-{
- if (CPWL_Wnd::OnLButtonDown(point,nFlag)) return TRUE;
-
- if (!m_pEdit->IsFocused())
- {
- m_pEdit->SetFocus();
- }
-
- return TRUE;
-}
-
-void CPWL_Note_Contents::SetEditFocus(FX_BOOL bLast)
-{
- if (!m_pEdit->IsFocused())
- {
- m_pEdit->SetFocus();
- m_pEdit->SetCaret(bLast ? m_pEdit->GetTotalWords() : 0);
- }
-}
-
-CPWL_Edit* CPWL_Note_Contents::GetEdit() const
-{
- return m_pEdit;
-}
-
-void CPWL_Note_Contents::EnableModify(FX_BOOL bEnabled)
-{
- if (!bEnabled)
- m_pEdit->AddFlag(PWS_READONLY);
- else
- m_pEdit->RemoveFlag(PWS_READONLY);
-
- for (FX_INT32 i=0,sz=m_aChildren.GetSize(); i<sz; i++)
- {
- if (CPWL_Wnd* pChild = m_aChildren.GetAt(i))
- {
- if (pChild->GetClassName() == "CPWL_NoteItem")
- {
- CPWL_NoteItem* pNoteItem = (CPWL_NoteItem*)pChild;
- pNoteItem->EnableModify(bEnabled);
- }
- }
- }
-}
-
-void CPWL_Note_Contents::EnableRead(FX_BOOL bEnabled)
-{
- if (!bEnabled)
- m_pEdit->AddFlag(PES_NOREAD);
- else
- m_pEdit->RemoveFlag(PES_NOREAD);
-
- for (FX_INT32 i=0,sz=m_aChildren.GetSize(); i<sz; i++)
- {
- if (CPWL_Wnd* pChild = m_aChildren.GetAt(i))
- {
- if (pChild->GetClassName() == "CPWL_NoteItem")
- {
- CPWL_NoteItem* pNoteItem = (CPWL_NoteItem*)pChild;
- pNoteItem->EnableRead(bEnabled);
- }
- }
- }
-}
-
-/* ---------------------------------- CPWL_NoteItem ---------------------------------- */
-
-CPWL_NoteItem::CPWL_NoteItem() :
- m_pPrivateData(NULL),
- m_pSubject(NULL),
- m_pDateTime(NULL),
- m_pContents(NULL),
- m_sAuthor(L""),
- m_fOldItemHeight(0.0f),
- m_bSizeChanged(FALSE),
- m_bAllowModify(TRUE)
-{
-}
-
-CPWL_NoteItem::~CPWL_NoteItem()
-{
-}
-
-CFX_ByteString CPWL_NoteItem::GetClassName() const
-{
- return "CPWL_NoteItem";
-}
-
-void CPWL_NoteItem::CreateChildWnd(const PWL_CREATEPARAM & cp)
-{
- CPWL_Color sTextColor;
-
- if (CPWL_Utils::IsBlackOrWhite(this->GetBackgroundColor()))
- sTextColor = PWL_DEFAULT_WHITECOLOR;
- else
- sTextColor = PWL_DEFAULT_BLACKCOLOR;
-
- m_pSubject = new CPWL_Label;
- PWL_CREATEPARAM scp = cp;
- scp.pParentWnd = this;
- scp.dwFlags = PWS_VISIBLE | PWS_CHILD | PES_LEFT | PES_TOP;
- scp.sTextColor = sTextColor;
- m_pSubject->Create(scp);
-
- m_pDateTime = new CPWL_Label;
- PWL_CREATEPARAM dcp = cp;
- dcp.pParentWnd = this;
- dcp.dwFlags = PWS_VISIBLE | PWS_CHILD | PES_RIGHT | PES_TOP;
- dcp.sTextColor = sTextColor;
- m_pDateTime->Create(dcp);
-
- m_pContents = new CPWL_Note_Contents;
- PWL_CREATEPARAM ccp = cp;
- ccp.pParentWnd = this;
- //ccp.sBackgroundColor = PWL_DEFAULT_WHITECOLOR;
- ccp.sBackgroundColor = CPWL_Color(COLORTYPE_RGB, 240/255.0f, 240/255.0f, 240/255.0f);
- ccp.dwFlags = PWS_VISIBLE | PWS_CHILD | PWS_BACKGROUND;
- m_pContents->Create(ccp);
- m_pContents->SetItemSpace(POPUP_ITEM_SPACE);
- m_pContents->SetTopSpace(POPUP_ITEM_SPACE);
- m_pContents->SetBottomSpace(POPUP_ITEM_SPACE);
-}
-
-void CPWL_NoteItem::RePosChildWnd()
-{
- if (this->IsValid())
- {
- ASSERT(m_pSubject != NULL);
- ASSERT(m_pDateTime != NULL);
- ASSERT(m_pContents != NULL);
-
- CPDF_Rect rcClient = GetClientRect();
-
- CPDF_Rect rcSubject = rcClient;
- rcSubject.left += POPUP_ITEM_TEXT_INDENT;
- rcSubject.top = rcClient.top;
- rcSubject.right = PWL_MIN(rcSubject.left + m_pSubject->GetContentRect().Width() + 1.0f, rcClient.right);
- rcSubject.bottom = rcSubject.top - m_pSubject->GetContentRect().Height();
- rcSubject.Normalize();
- m_pSubject->Move(rcSubject, TRUE, FALSE);
- m_pSubject->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcSubject));
-
- CPDF_Rect rcDate = rcClient;
- rcDate.right -= POPUP_ITEM_TEXT_INDENT;
- rcDate.left = PWL_MAX(rcDate.right - m_pDateTime->GetContentRect().Width() - 1.0f, rcSubject.right);
- rcDate.bottom = rcDate.top - m_pDateTime->GetContentRect().Height();
- rcDate.Normalize();
- m_pDateTime->Move(rcDate, TRUE, FALSE);
- m_pDateTime->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcDate));
-
- CPDF_Rect rcContents = rcClient;
- rcContents.left += 1.0f;
- rcContents.right -= 1.0f;
- rcContents.top = rcDate.bottom - POPUP_ITEM_HEAD_BOTTOM;
- rcContents.bottom += POPUP_ITEM_BOTTOMWIDTH;
- rcContents.Normalize();
- m_pContents->Move(rcContents, TRUE, FALSE);
- m_pContents->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcContents));
- }
-
- SetClipRect(CPWL_Utils::InflateRect(GetWindowRect(),1.0f));
-}
-
-void CPWL_NoteItem::SetPrivateData(void* pData)
-{
- m_pPrivateData = pData;
-}
-
-void CPWL_NoteItem::SetBkColor(const CPWL_Color& color)
-{
- CPWL_Color sBK = color;
- this->SetBackgroundColor(sBK);
-
- CPWL_Color sTextColor;
-
- if (CPWL_Utils::IsBlackOrWhite(sBK))
- sTextColor = PWL_DEFAULT_WHITECOLOR;
- else
- sTextColor = PWL_DEFAULT_BLACKCOLOR;
-
- this->SetTextColor(sTextColor);
- if (m_pSubject)
- m_pSubject->SetTextColor(sTextColor);
- if (m_pDateTime)
- m_pDateTime->SetTextColor(sTextColor);
-
- this->InvalidateRect(NULL);
-
- if (IPWL_NoteNotify* pNotify = GetNoteNotify())
- {
- pNotify->OnSetBkColor(this);
- }
-}
-
-void CPWL_NoteItem::SetSubjectName(const CFX_WideString& sName)
-{
- if (m_pSubject)
- {
- m_pSubject->SetText(sName);
- }
-
- if (IPWL_NoteNotify* pNotify = GetNoteNotify())
- {
- pNotify->OnSetSubjectName(this);
- }
-}
-
-void CPWL_NoteItem::SetAuthorName(const CFX_WideString& sName)
-{
- m_sAuthor = sName;
- ResetSubjectName(-1);
-
- if (IPWL_NoteNotify* pNotify = GetNoteNotify())
- {
- pNotify->OnSetAuthorName(this);
- }
-}
-
-void CPWL_NoteItem::ResetSubjectName(FX_INT32 nItemIndex)
-{
- if (nItemIndex < 0)
- {
- if (CPWL_Wnd* pParent = this->GetParentWindow())
- {
- ASSERT(pParent->GetClassName() == "CPWL_Note_Contents");
-
- CPWL_Note_Contents* pContents = (CPWL_Note_Contents*)pParent;
- nItemIndex = pContents->GetItemIndex(this);
- }
- }
-
- const CPWL_Note* pNote = GetNote();
- ASSERT(pNote != NULL);
-
- CFX_WideString sSubject;
- sSubject.Format(pNote->GetReplyString(), nItemIndex);
-
- if (!m_sAuthor.IsEmpty())
- {
-
- sSubject += L" - ";
- sSubject += m_sAuthor;
- }
- this->SetSubjectName(sSubject);
- this->RePosChildWnd();
-}
-
-void CPWL_NoteItem::SetDateTime(FX_SYSTEMTIME time)
-{
- m_dtNote = time;
-
- CFX_WideString swTime;
- swTime.Format((FX_LPCWSTR)L"%04d-%02d-%02d %02d:%02d:%02d", time.wYear, time.wMonth, time.wDay, time.wHour, time.wMinute, time.wSecond);
- if (m_pDateTime)
- {
- m_pDateTime->SetText(swTime);
- }
-
- this->RePosChildWnd();
-
- if (IPWL_NoteNotify* pNotify = GetNoteNotify())
- {
- pNotify->OnSetDateTime(this);
- }
-}
-
-void CPWL_NoteItem::SetContents(const CFX_WideString& sContents)
-{
- if (m_pContents)
- {
- m_pContents->SetText(sContents);
- }
-
- if (IPWL_NoteNotify* pNotify = GetNoteNotify())
- {
- pNotify->OnSetContents(this);
- }
-}
-
-CPWL_NoteItem* CPWL_NoteItem::GetParentNoteItem() const
-{
- if (CPWL_Wnd* pParent = this->GetParentWindow())
- {
- if (CPWL_Wnd* pGrand = pParent->GetParentWindow())
- {
- ASSERT(pGrand->GetClassName() == "CPWL_NoteItem");
- return (CPWL_NoteItem*)pGrand;
- }
- }
-
- return NULL;
-}
-
-IPWL_NoteItem* CPWL_NoteItem::GetParentItem() const
-{
- return GetParentNoteItem();
-}
-
-CPWL_Edit* CPWL_NoteItem::GetEdit() const
-{
- if (m_pContents)
- return m_pContents->GetEdit();
- return NULL;
-}
-
-void* CPWL_NoteItem::GetPrivateData() const
-{
- return m_pPrivateData;
-}
-
-CFX_WideString CPWL_NoteItem::GetAuthorName() const
-{
- return m_sAuthor;
-}
-
-CPWL_Color CPWL_NoteItem::GetBkColor() const
-{
- return this->GetBackgroundColor();
-}
-
-CFX_WideString CPWL_NoteItem::GetContents() const
-{
- if (m_pContents)
- return m_pContents->GetText();
-
- return L"";
-}
-
-FX_SYSTEMTIME CPWL_NoteItem::GetDateTime() const
-{
- return m_dtNote;
-}
-
-CFX_WideString CPWL_NoteItem::GetSubjectName() const
-{
- if (m_pSubject)
- return m_pSubject->GetText();
-
- return L"";
-}
-
-CPWL_NoteItem* CPWL_NoteItem::CreateNoteItem()
-{
- if (m_pContents)
- return m_pContents->CreateSubItem();
-
- return NULL;
-}
-
-IPWL_NoteItem* CPWL_NoteItem::CreateSubItem()
-{
- return CreateNoteItem();
-}
-
-FX_INT32 CPWL_NoteItem::CountSubItems() const
-{
- if (m_pContents)
- return m_pContents->CountSubItems();
-
- return 0;
-}
-
-IPWL_NoteItem* CPWL_NoteItem::GetSubItems(FX_INT32 index) const
-{
- if (m_pContents)
- return m_pContents->GetSubItems(index);
-
- return NULL;
-}
-
-void CPWL_NoteItem::DeleteSubItem(IPWL_NoteItem* pNoteItem)
-{
- this->KillFocus();
-
- if (IPWL_NoteNotify* pNotify = GetNoteNotify())
- {
- pNotify->OnItemDelete(pNoteItem);
- }
-
- if (m_pContents)
- m_pContents->DeleteSubItem(pNoteItem);
-}
-
-IPWL_NoteItem* CPWL_NoteItem::GetHitNoteItem(const CPDF_Point& point)
-{
- CPDF_Point pt = this->ParentToChild(point);
-
- if (this->WndHitTest(pt))
- {
- if (m_pContents)
- {
- if (IPWL_NoteItem* pNoteItem = m_pContents->GetHitNoteItem(pt))
- return pNoteItem;
- }
-
- return this;
- }
-
- return NULL;
-}
-
-IPWL_NoteItem* CPWL_NoteItem::GetFocusedNoteItem() const
-{
- if (const CPWL_Wnd* pWnd = this->GetFocused())
- {
- if (pWnd->GetClassName() == "CPWL_Edit")
- {
- if (CPWL_Wnd* pParent = pWnd->GetParentWindow())
- {
- ASSERT(pParent->GetClassName() == "CPWL_Note_Contents");
-
- if (CPWL_Wnd* pGrand = pParent->GetParentWindow())
- {
- ASSERT(pGrand->GetClassName() == "CPWL_NoteItem");
- return (CPWL_NoteItem*)pGrand;
- }
- }
- }
- }
-
- return NULL;
-}
-
-FX_FLOAT CPWL_NoteItem::GetItemHeight(FX_FLOAT fLimitWidth)
-{
- if (fLimitWidth > 0)
- {
- if (!m_bSizeChanged)
- return m_fOldItemHeight;
-
- m_bSizeChanged = FALSE;
-
- ASSERT(m_pSubject != NULL);
- ASSERT(m_pDateTime != NULL);
- ASSERT(m_pContents != NULL);
-
- FX_FLOAT fRet = m_pDateTime->GetContentRect().Height();
- FX_FLOAT fBorderWidth = (FX_FLOAT)this->GetBorderWidth();
- if (fLimitWidth > fBorderWidth * 2)
- fRet += m_pContents->GetContentsHeight(fLimitWidth - fBorderWidth * 2);
- fRet += POPUP_ITEM_HEAD_BOTTOM + POPUP_ITEM_BOTTOMWIDTH + fBorderWidth * 2;
-
- return m_fOldItemHeight = fRet;
- }
-
- return 0;
-}
-
-FX_FLOAT CPWL_NoteItem::GetItemLeftMargin()
-{
- return POPUP_ITEM_SIDEMARGIN;
-}
-
-FX_FLOAT CPWL_NoteItem::GetItemRightMargin()
-{
- return POPUP_ITEM_SIDEMARGIN;
-}
-
-FX_BOOL CPWL_NoteItem::OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag)
-{
- if (!m_pContents->WndHitTest(m_pContents->ParentToChild(point)))
- {
- SetNoteFocus(FALSE);
- }
-
- CPWL_Wnd::OnLButtonDown(point,nFlag);
-
- return TRUE;
-}
-
-FX_BOOL CPWL_NoteItem::OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
-{
- if (!m_pContents->WndHitTest(m_pContents->ParentToChild(point)))
- {
- SetNoteFocus(FALSE);
- PopupNoteItemMenu(point);
-
- return TRUE;
- }
-
- return CPWL_Wnd::OnRButtonUp(point,nFlag);
-}
-
-void CPWL_NoteItem::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam, FX_INTPTR lParam)
-{
- switch (msg)
- {
- case PNM_NOTEEDITCHANGED:
- m_bSizeChanged = TRUE;
-
- if (CPWL_Wnd* pParent = this->GetParentWindow())
- {
- pParent->OnNotify(this, PNM_NOTEEDITCHANGED, 0, 0);
- }
- return;
- case PNM_SETCARETINFO:
- if (PWL_CARET_INFO * pInfo = (PWL_CARET_INFO*)wParam)
- {
- PWL_CARET_INFO newInfo = *pInfo;
- newInfo.bVisible = TRUE;
- newInfo.ptHead = this->ChildToParent(pInfo->ptHead);
- newInfo.ptFoot = this->ChildToParent(pInfo->ptFoot);
-
- if (CPWL_Wnd * pParent = this->GetParentWindow())
- {
- pParent->OnNotify(this, PNM_SETCARETINFO, (FX_INTPTR)&newInfo, 0);
- }
- }
- return;
- case PNM_NOTERESET:
- m_bSizeChanged = TRUE;
- m_pContents->OnNotify(this, PNM_NOTERESET, 0, 0);
-
- return;
- }
-
- CPWL_Wnd::OnNotify(pWnd, msg, wParam, lParam);
-}
-
-void CPWL_NoteItem::PopupNoteItemMenu(const CPDF_Point& point)
-{
- if (IPWL_NoteNotify* pNotify = GetNoteNotify())
- {
- FX_INT32 x,y;
- PWLtoWnd(point, x, y);
- if (IFX_SystemHandler* pSH = GetSystemHandler())
- pSH->ClientToScreen(GetAttachedHWnd(), x, y);
- pNotify->OnPopupMenu(this, x, y);
- }
-}
-
-const CPWL_Note* CPWL_NoteItem::GetNote() const
-{
- if (const CPWL_Wnd* pRoot = this->GetRootWnd())
- {
- ASSERT(pRoot->GetClassName() == "CPWL_NoteItem");
- CPWL_NoteItem* pNoteItem = (CPWL_NoteItem*)pRoot;
- if (pNoteItem->IsTopItem())
- {
- return (CPWL_Note*)pNoteItem;
- }
- }
-
- return NULL;
-}
-
-IPWL_NoteNotify* CPWL_NoteItem::GetNoteNotify() const
-{
- if (const CPWL_Note* pNote = GetNote())
- return pNote->GetNoteNotify();
-
- return NULL;
-}
-
-void CPWL_NoteItem::OnCreateNoteItem()
-{
- if (IPWL_NoteNotify* pNotify = GetNoteNotify())
- {
- pNotify->OnItemCreate(this);
- }
-}
-
-void CPWL_NoteItem::OnContentsValidate()
-{
- if (IPWL_NoteNotify* pNotify = GetNoteNotify())
- {
- pNotify->OnSetContents(this);
- }
-}
-
-void CPWL_NoteItem::SetNoteFocus(FX_BOOL bLast)
-{
- m_pContents->SetEditFocus(bLast);
-}
-
-void CPWL_NoteItem::EnableModify(FX_BOOL bEnabled)
-{
- m_pContents->EnableModify(bEnabled);
- m_bAllowModify = bEnabled;
-}
-
-void CPWL_NoteItem::EnableRead(FX_BOOL bEnabled)
-{
- m_pContents->EnableRead(bEnabled);
-}
-
-/* ---------------------------------- CPWL_Note ---------------------------------- */
-
-CPWL_Note::CPWL_Note(IPopup_Note* pPopupNote, IPWL_NoteNotify* pNoteNotify, IPWL_NoteHandler* pNoteHandler) :
- m_pAuthor(NULL),
- m_pIcon(NULL),
- m_pCloseBox(NULL),
- m_pContentsBar(NULL),
- m_pLBBox(NULL),
- m_pRBBox(NULL),
- m_pOptions(NULL),
- m_bResizing(FALSE),
- m_rcCaption(0,0,0,0),
- m_pNoteNotify(pNoteNotify),
- m_bEnalbleNotify(TRUE),
- m_pPopupNote(pPopupNote),
- m_pNoteHandler(pNoteHandler)
-{
-}
-
-CPWL_Note::~CPWL_Note()
-{
-}
-
-IPWL_NoteItem* CPWL_Note::Reply()
-{
- return CreateNoteItem();
-}
-
-void CPWL_Note::EnableNotify(FX_BOOL bEnabled)
-{
- m_bEnalbleNotify = bEnabled;
-}
-
-void CPWL_Note::RePosChildWnd()
-{
- RePosNoteChildren();
- m_pContents->OnNotify(this, PNM_NOTERESET, 0, 0);
- ResetScrollBar();
- m_pContents->OnNotify(this, PNM_NOTERESET, 0, 0);
- this->OnNotify(this, PNM_NOTEEDITCHANGED, 0, 0);
- //ͬ²½
- if (const CPWL_Wnd* pWnd = this->GetFocused())
- {
- if (pWnd->GetClassName() == "CPWL_Edit")
- {
- CPWL_Edit* pEdit = (CPWL_Edit*)pWnd;
- pEdit->SetCaret(pEdit->GetCaret());
- }
- }
- //CPDF_Point ptNew = m_pContents->GetScrollPos();
- //m_pContentsBar->OnNotify(this, PNM_SETSCROLLPOS, SBT_VSCROLL, (FX_INTPTR)&ptNew.y);
-}
-
-FX_BOOL CPWL_Note::ResetScrollBar()
-{
- FX_BOOL bScrollChanged = FALSE;
-
- if (ScrollBarShouldVisible())
- {
- if (!m_pContentsBar->IsVisible())
- {
- m_pContentsBar->SetVisible(TRUE);
- if (m_pContentsBar->IsVisible())
- {
- m_pContentsBar->InvalidateRect(NULL);
- bScrollChanged = TRUE;
- }
- }
- }
- else
- {
- if (m_pContentsBar->IsVisible())
- {
- m_pContentsBar->SetVisible(FALSE);
- m_pContentsBar->InvalidateRect(NULL);
-
- bScrollChanged = TRUE;
- }
- }
-
- if (bScrollChanged)
- {
- CPDF_Rect rcNote = this->GetClientRect();
- CPDF_Rect rcContents = m_pContents->GetWindowRect();
- rcContents.right = rcNote.right - 3.0f;
- if (m_pContentsBar->IsVisible())
- rcContents.right -= PWL_SCROLLBAR_WIDTH;
- m_pContents->Move(rcContents, TRUE, TRUE);
- m_pContents->SetScrollPos(CPDF_Point(0.0f,0.0f));
- m_pContents->InvalidateRect(NULL);
- }
-
- return bScrollChanged;
-}
-
-FX_BOOL CPWL_Note::ScrollBarShouldVisible()
-{
- CPDF_Rect rcContentsFact = m_pContents->GetScrollArea();
- CPDF_Rect rcContentsClient = m_pContents->GetClientRect();
-
- return rcContentsFact.Height() > rcContentsClient.Height();
-}
-
-void CPWL_Note::SetOptionsText(const CFX_WideString& sText)
-{
- if (m_pOptions)
- m_pOptions->SetText(sText);
-
- RePosNoteChildren();
-}
-
-void CPWL_Note::RePosNoteChildren()
-{
- if (m_bResizing) return;
-
- m_bResizing = TRUE;
-
- if (this->IsValid())
- {
- ASSERT(m_pSubject != NULL);
- ASSERT(m_pDateTime != NULL);
- ASSERT(m_pContents != NULL);
- ASSERT(m_pAuthor != NULL);
- ASSERT(m_pCloseBox != NULL);
- ASSERT(m_pIcon != NULL);
- ASSERT(m_pLBBox != NULL);
- ASSERT(m_pRBBox != NULL);
- ASSERT(m_pContentsBar != NULL);
- ASSERT(m_pOptions != NULL);
-
- CPDF_Rect rcClient = GetClientRect();
-
- CPDF_Rect rcIcon = rcClient;
- rcIcon.top -= 2.0f;
- rcIcon.right = rcIcon.left + 14.0f;
- rcIcon.bottom = rcIcon.top - 14.0f;
- rcIcon.Normalize();
- m_pIcon->Move(rcIcon, TRUE, FALSE);
- m_pIcon->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcIcon));
-
- CPDF_Rect rcCloseBox = rcClient;
- rcCloseBox.right -= 1.0f;
- rcCloseBox.top -= 1.0f;
- rcCloseBox.left = rcCloseBox.right - 14.0f;
- rcCloseBox.bottom = rcCloseBox.top - 14.0f;
- rcCloseBox.Normalize();
- m_pCloseBox->Move(rcCloseBox, TRUE, FALSE);
- m_pCloseBox->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcCloseBox));
-
- CPDF_Rect rcDate = rcClient;
- rcDate.right = rcCloseBox.left - POPUP_ITEM_TEXT_INDENT;
- rcDate.left = PWL_MAX(rcDate.right - m_pDateTime->GetContentRect().Width() - 1.0f, rcIcon.right + 1.0f);
- rcDate.top = rcClient.top - 2.0f;
- rcDate.bottom = rcDate.top - m_pDateTime->GetContentRect().Height();
- rcDate.Normalize();
- m_pDateTime->Move(rcDate, TRUE, FALSE);
- m_pDateTime->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcDate));
-
- CPDF_Rect rcSubject = rcClient;
- rcSubject.top = rcClient.top - 2.0f;
- rcSubject.left = rcIcon.right + POPUP_ITEM_TEXT_INDENT;
- rcSubject.right = PWL_MIN(rcSubject.left + m_pSubject->GetContentRect().Width() + 1.0f, rcDate.left - 1.0f);
- rcSubject.bottom = rcSubject.top - m_pSubject->GetContentRect().Height();
- rcSubject.Normalize();
- m_pSubject->Move(rcSubject, TRUE, FALSE);
- m_pSubject->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcSubject));
-
- CPDF_Rect rcOptions = rcClient;
- rcOptions.left = PWL_MAX(rcOptions.right - m_pOptions->GetContentRect().Width(), rcIcon.right + 1.0f);
- rcOptions.top = rcSubject.bottom - 4.0f;
- rcOptions.bottom = rcOptions.top - m_pOptions->GetContentRect().Height();
- rcOptions.Normalize();
- m_pOptions->Move(rcOptions, TRUE, FALSE);
- m_pOptions->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcOptions));
-
- CPDF_Rect rcAuthor = rcClient;
- rcAuthor.top = rcSubject.bottom - 4.0f;
- rcAuthor.left = rcSubject.left;
- rcAuthor.right = PWL_MIN(rcSubject.left + m_pAuthor->GetContentRect().Width() + 1.0f, rcOptions.left - 1.0f);
- rcAuthor.bottom = rcAuthor.top - m_pAuthor->GetContentRect().Height();
- rcAuthor.Normalize();
- m_pAuthor->Move(rcAuthor, TRUE, FALSE);
- m_pAuthor->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcAuthor));
-
- CPDF_Rect rcLBBox = rcClient;
- rcLBBox.top = rcLBBox.bottom + 7.0f;
- rcLBBox.right = rcLBBox.left + 7.0f;
- rcLBBox.Normalize();
- m_pLBBox->Move(rcLBBox, TRUE, FALSE);
- m_pLBBox->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcLBBox));
-
- CPDF_Rect rcRBBox = rcClient;
- rcRBBox.top = rcRBBox.bottom + 7.0f;
- rcRBBox.left = rcRBBox.right - 7.0f;
- rcRBBox.Normalize();
- m_pRBBox->Move(rcRBBox, TRUE, FALSE);
- m_pRBBox->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcRBBox));
-
- CPDF_Rect rcContents = rcClient;
- rcContents.top = rcAuthor.bottom - POPUP_ITEM_HEAD_BOTTOM;
- rcContents.left += 3.0f;
- rcContents.right -= 3.0f;
- if (m_pContentsBar->IsVisible())
- rcContents.right -= PWL_SCROLLBAR_WIDTH;
- rcContents.bottom += 14.0f;
- rcContents.Normalize();
- m_pContents->Move(rcContents, FALSE, FALSE);
- m_pContents->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcContents));
-
- CPDF_Rect rcContentsBar = rcContents;
- rcContentsBar.right = rcClient.right - 3.0f;
- rcContentsBar.left = rcContentsBar.right - PWL_SCROLLBAR_WIDTH;
- rcContentsBar.Normalize();
- m_pContentsBar->Move(rcContentsBar, TRUE, FALSE);
-
- m_rcCaption = rcClient;
- m_rcCaption.bottom = rcContents.top;
- }
-
- m_bResizing = FALSE;
-}
-
-//0-normal / 1-caption / 2-leftbottom corner / 3-rightbottom corner / 4-close / 5-options
-FX_INT32 CPWL_Note::NoteHitTest(const CPDF_Point& point) const
-{
- ASSERT(m_pSubject != NULL);
- ASSERT(m_pDateTime != NULL);
- ASSERT(m_pContents != NULL);
- ASSERT(m_pAuthor != NULL);
- ASSERT(m_pIcon != NULL);
- ASSERT(m_pContentsBar != NULL);
-
- ASSERT(m_pCloseBox != NULL);
- ASSERT(m_pLBBox != NULL);
- ASSERT(m_pRBBox != NULL);
- ASSERT(m_pOptions != NULL);
-
- GetClientRect();
-
- if (m_pSubject->WndHitTest(m_pSubject->ParentToChild(point))) return 1;
- if (m_pDateTime->WndHitTest(m_pDateTime->ParentToChild(point))) return 1;
- if (m_pAuthor->WndHitTest(m_pAuthor->ParentToChild(point))) return 1;
- if (m_pIcon->WndHitTest(m_pIcon->ParentToChild(point))) return 1;
-
- if (m_pContents->WndHitTest(m_pContents->ParentToChild(point))) return 0;
- if (m_pContentsBar->WndHitTest(m_pContentsBar->ParentToChild(point))) return 0;
-
- if (m_pCloseBox->WndHitTest(m_pCloseBox->ParentToChild(point))) return 4;
- if (m_pLBBox->WndHitTest(m_pLBBox->ParentToChild(point))) return 2;
- if (m_pRBBox->WndHitTest(m_pRBBox->ParentToChild(point))) return 3;
- if (m_pOptions->WndHitTest(m_pOptions->ParentToChild(point))) return 5;
-
- return 1;
-}
-
-void CPWL_Note::CreateChildWnd(const PWL_CREATEPARAM & cp)
-{
- CPWL_NoteItem::CreateChildWnd(cp);
-
- CPWL_Color sTextColor;
-
- if (CPWL_Utils::IsBlackOrWhite(this->GetBackgroundColor()))
- sTextColor = PWL_DEFAULT_WHITECOLOR;
- else
- sTextColor = PWL_DEFAULT_BLACKCOLOR;
-
- m_pAuthor = new CPWL_Label;
- PWL_CREATEPARAM acp = cp;
- acp.pParentWnd = this;
- acp.dwFlags = PWS_VISIBLE | PWS_CHILD | PES_LEFT | PES_TOP;
- acp.sTextColor = sTextColor;
- m_pAuthor->Create(acp);
-
- m_pCloseBox = new CPWL_Note_CloseBox;
- PWL_CREATEPARAM ccp = cp;
- ccp.pParentWnd = this;
- ccp.dwBorderWidth = 2;
- ccp.nBorderStyle = PBS_BEVELED;
- ccp.dwFlags = PWS_VISIBLE | PWS_CHILD | PWS_BORDER;
- ccp.sTextColor = sTextColor;
- m_pCloseBox->Create(ccp);
-
- m_pIcon = new CPWL_Note_Icon;
- PWL_CREATEPARAM icp = cp;
- icp.pParentWnd = this;
- icp.dwFlags = PWS_VISIBLE | PWS_CHILD;
- m_pIcon->Create(icp);
-
- m_pOptions = new CPWL_Note_Options;
- PWL_CREATEPARAM ocp = cp;
- ocp.pParentWnd = this;
- ocp.dwFlags = PWS_CHILD | PWS_VISIBLE;
- ocp.sTextColor = sTextColor;
- m_pOptions->Create(ocp);
-
- m_pLBBox = new CPWL_Note_LBBox;
- PWL_CREATEPARAM lcp = cp;
- lcp.pParentWnd = this;
- lcp.dwFlags = PWS_VISIBLE | PWS_CHILD;
- lcp.eCursorType = FXCT_NESW;
- lcp.sTextColor = sTextColor;
- m_pLBBox->Create(lcp);
-
- m_pRBBox = new CPWL_Note_RBBox;
- PWL_CREATEPARAM rcp = cp;
- rcp.pParentWnd = this;
- rcp.dwFlags = PWS_VISIBLE | PWS_CHILD;
- rcp.eCursorType = FXCT_NWSE;
- rcp.sTextColor = sTextColor;
- m_pRBBox->Create(rcp);
-
- m_pContentsBar = new CPWL_ScrollBar(SBT_VSCROLL);
- PWL_CREATEPARAM scp = cp;
- scp.pParentWnd = this;
- scp.sBackgroundColor = CPWL_Color(COLORTYPE_RGB, 240/255.0f, 240/255.0f, 240/255.0f);
- scp.dwFlags = PWS_CHILD | PWS_VISIBLE | PWS_BACKGROUND;
- m_pContentsBar->Create(scp);
- m_pContentsBar->SetNotifyForever(TRUE);
-}
-
-void CPWL_Note::SetSubjectName(const CFX_WideString& sName)
-{
- CPWL_NoteItem::SetSubjectName(sName);
- RePosChildWnd();
-}
-
-void CPWL_Note::SetAuthorName(const CFX_WideString& sName)
-{
- if (m_pAuthor)
- {
- m_pAuthor->SetText(sName);
- RePosChildWnd();
- }
-
- if (IPWL_NoteNotify* pNotify = GetNoteNotify())
- {
- pNotify->OnSetAuthorName(this);
- }
-}
-
-CFX_WideString CPWL_Note::GetAuthorName() const
-{
- if (m_pAuthor)
- return m_pAuthor->GetText();
-
- return L"";
-}
-
-FX_BOOL CPWL_Note::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag)
-{
- CPDF_Point ptScroll = m_pContents->GetScrollPos();
- CPDF_Rect rcScroll = m_pContents->GetScrollArea();
- CPDF_Rect rcContents = m_pContents->GetClientRect();
-
- if (rcScroll.top - rcScroll.bottom > rcContents.Height())
- {
- CPDF_Point ptNew = ptScroll;
-
- if (zDelta > 0)
- ptNew.y += 30;
- else
- ptNew.y -= 30;
-
- if (ptNew.y > rcScroll.top)
- ptNew.y = rcScroll.top;
- if (ptNew.y < rcScroll.bottom + rcContents.Height())
- ptNew.y = rcScroll.bottom + rcContents.Height();
- if (ptNew.y < rcScroll.bottom)
- ptNew.y = rcScroll.bottom;
-
- if (ptNew.y != ptScroll.y)
- {
- m_pContents->OnNotify(this, PNM_NOTERESET, 0, 0);
- m_pContents->OnNotify(this, PNM_SCROLLWINDOW, SBT_VSCROLL, (FX_INTPTR)&ptNew.y);
- m_pContentsBar->OnNotify(this, PNM_SETSCROLLPOS, SBT_VSCROLL, (FX_INTPTR)&ptNew.y);
-
- return TRUE;
- }
- }
-
- return FALSE;
-}
-
-void CPWL_Note::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam, FX_INTPTR lParam)
-{
- switch (msg)
- {
- case PNM_NOTEEDITCHANGED:
- {
- CPDF_Rect rcScroll = m_pContents->GetScrollArea();
-
-
- PWL_SCROLL_INFO sInfo;
- sInfo.fContentMin = rcScroll.bottom;
- sInfo.fContentMax = rcScroll.top;
- sInfo.fPlateWidth = m_pContents->GetClientRect().Height();
- sInfo.fSmallStep = 13.0f;
- sInfo.fBigStep = sInfo.fPlateWidth;
-
- if (FXSYS_memcmp(&m_OldScrollInfo, &sInfo, sizeof(PWL_SCROLL_INFO)) != 0)
- {
- FX_BOOL bScrollChanged = FALSE;
-
- if (lParam < 3) //·ÀÖ¹ËÀÑ­»· mantis:15759
- {
- bScrollChanged = ResetScrollBar();
- if (bScrollChanged)
- {
- lParam++;
- m_pContents->OnNotify(this, PNM_NOTERESET, 0, 0);
- this->OnNotify(this, PNM_NOTEEDITCHANGED, 0, lParam);
- }
- }
-
- if (!bScrollChanged)
- {
- if (m_pContentsBar->IsVisible())
- {
- m_pContentsBar->OnNotify(pWnd, PNM_SETSCROLLINFO, SBT_VSCROLL, (FX_INTPTR)&sInfo);
- m_OldScrollInfo = sInfo;
-
- CPDF_Point ptScroll = m_pContents->GetScrollPos();
- CPDF_Point ptOld = ptScroll;
-
- if (ptScroll.y > sInfo.fContentMax)
- ptScroll.y = sInfo.fContentMax;
- if (ptScroll.y < sInfo.fContentMin + sInfo.fPlateWidth)
- ptScroll.y = sInfo.fContentMin + sInfo.fPlateWidth;
- if (ptScroll.y < sInfo.fContentMin)
- ptScroll.y = sInfo.fContentMin;
-
- if (ptOld.y != ptScroll.y)
- {
- m_pContentsBar->OnNotify(this, PNM_SETSCROLLPOS, SBT_VSCROLL, (FX_INTPTR)&ptScroll.y);
- m_pContentsBar->InvalidateRect(NULL);
- m_pContents->OnNotify(this, PNM_SCROLLWINDOW, SBT_VSCROLL, (FX_INTPTR)&ptScroll.y);
- }
- }
- }
- }
- }
-
- m_pContents->InvalidateRect(NULL);
-
- return;
- case PNM_SCROLLWINDOW:
- if (m_pContents)
- m_pContents->OnNotify(pWnd, msg, wParam, lParam);
- return;
- case PNM_SETSCROLLPOS:
- if (m_pContentsBar)
- m_pContentsBar->OnNotify(pWnd,PNM_SETSCROLLPOS,wParam,lParam);
- return;
- }
-
- if (msg == PNM_SETCARETINFO && IsValid())
- {
- if (PWL_CARET_INFO * pInfo = (PWL_CARET_INFO*)wParam)
- {
- if (m_pContents)
- {
- CPDF_Rect rcClient = m_pContents->GetClientRect();
- if (pInfo->ptHead.y > rcClient.top)
- {
- CPDF_Point pt = m_pContents->OutToIn(pInfo->ptHead);
- m_pContents->OnNotify(this, PNM_SCROLLWINDOW, SBT_VSCROLL, (FX_INTPTR)&pt.y);
-
- CPDF_Point ptScroll = m_pContents->GetScrollPos();
- m_pContentsBar->OnNotify(this, PNM_SETSCROLLPOS, SBT_VSCROLL, (FX_INTPTR)&ptScroll.y);
-
- return;
- }
-
- if (pInfo->ptFoot.y < rcClient.bottom)
- {
- CPDF_Point pt = m_pContents->OutToIn(pInfo->ptFoot);
- pt.y += rcClient.Height();
- m_pContents->OnNotify(this, PNM_SCROLLWINDOW, SBT_VSCROLL, (FX_INTPTR)&pt.y);
-
- CPDF_Point ptScroll = m_pContents->GetScrollPos();
- m_pContentsBar->OnNotify(this, PNM_SETSCROLLPOS, SBT_VSCROLL, (FX_INTPTR)&ptScroll.y);
-
- return;
- }
- }
- }
- }
-
- CPWL_NoteItem::OnNotify(pWnd, msg, wParam, lParam);
-}
-
-void CPWL_Note::SetBkColor(const CPWL_Color& color)
-{
- CPWL_NoteItem::SetBkColor(color);
-
- CPWL_Color sBK = color;
- CPWL_Color sTextColor;
- if (CPWL_Utils::IsBlackOrWhite(sBK))
- sTextColor = PWL_DEFAULT_WHITECOLOR;
- else
- sTextColor = PWL_DEFAULT_BLACKCOLOR;
-
- if (m_pCloseBox)
- m_pCloseBox->SetTextColor(sTextColor);
- if (m_pAuthor)
- m_pAuthor->SetTextColor(sTextColor);
- if (m_pOptions)
- m_pOptions->SetTextColor(sTextColor);
- if (m_pLBBox)
- m_pLBBox->SetTextColor(sTextColor);
- if (m_pRBBox)
- m_pRBBox->SetTextColor(sTextColor);
-}
-
-FX_BOOL CPWL_Note::OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag)
-{
- if (m_pOptions->WndHitTest(m_pOptions->ParentToChild(point)))
- {
- if (IPWL_NoteNotify* pNotify = this->GetNoteNotify())
- {
- FX_INT32 x, y;
- PWLtoWnd(point, x, y);
- if (IFX_SystemHandler* pSH = GetSystemHandler())
- pSH->ClientToScreen(GetAttachedHWnd(), x, y);
- this->KillFocus();
- pNotify->OnPopupMenu(x, y);
-
- return TRUE;
- }
- }
-
- return CPWL_Wnd::OnLButtonDown(point,nFlag);
-}
-
-FX_BOOL CPWL_Note::OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
-{
- return CPWL_Wnd::OnRButtonUp(point,nFlag);
-}
-
-const CPWL_Note* CPWL_Note::GetNote() const
-{
- return this;
-}
-
-IPWL_NoteNotify* CPWL_Note::GetNoteNotify() const
-{
- if (m_bEnalbleNotify)
- return m_pNoteNotify;
-
- return NULL;
-}
-
-void CPWL_Note::SetIconType(FX_INT32 nType)
-{
- if (m_pIcon)
- m_pIcon->SetIconType(nType);
-}
-
-void CPWL_Note::EnableModify(FX_BOOL bEnabled)
-{
- m_pContents->EnableModify(bEnabled);
-}
-
-void CPWL_Note::EnableRead(FX_BOOL bEnabled)
-{
- m_pContents->EnableRead(bEnabled);
-}
-
-CFX_WideString CPWL_Note::GetReplyString() const
-{
- return m_sReplyString;
-}
-
-void CPWL_Note::SetReplyString(const CFX_WideString& string)
-{
- m_sReplyString = string;
-}
-
+// 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
+
+#include "../../include/pdfwindow/PDFWindow.h"
+#include "../../include/pdfwindow/PWL_Wnd.h"
+#include "../../include/pdfwindow/PWL_Button.h"
+#include "../../include/pdfwindow/PWL_EditCtrl.h"
+#include "../../include/pdfwindow/PWL_Edit.h"
+#include "../../include/pdfwindow/PWL_ListCtrl.h"
+#include "../../include/pdfwindow/PWL_ScrollBar.h"
+#include "../../include/pdfwindow/PWL_Note.h"
+#include "../../include/pdfwindow/PWL_Label.h"
+#include "../../include/pdfwindow/PWL_Edit.h"
+#include "../../include/pdfwindow/PWL_ScrollBar.h"
+#include "../../include/pdfwindow/PWL_Utils.h"
+#include "../../include/pdfwindow/PWL_Caret.h"
+
+#define POPUP_ITEM_HEAD_BOTTOM 3.0f
+#define POPUP_ITEM_BOTTOMWIDTH 1.0f
+#define POPUP_ITEM_SIDEMARGIN 3.0f
+#define POPUP_ITEM_SPACE 4.0f
+#define POPUP_ITEM_TEXT_INDENT 2.0f
+#define POPUP_ITEM_BORDERCOLOR CPWL_Color(COLORTYPE_RGB, 80/255.0f, 80/255.0f, 80/255.0f)
+
+#define IsFloatZero(f) ((f) < 0.0001 && (f) > -0.0001)
+#define IsFloatBigger(fa,fb) ((fa) > (fb) && !IsFloatZero((fa) - (fb)))
+#define IsFloatSmaller(fa,fb) ((fa) < (fb) && !IsFloatZero((fa) - (fb)))
+#define IsFloatEqual(fa,fb) IsFloatZero((fa)-(fb))
+
+
+/* ------------------------------- CPWL_Note_Options ------------------------------- */
+
+CPWL_Note_Options::CPWL_Note_Options() : m_pText(NULL)
+{
+}
+
+CPWL_Note_Options::~CPWL_Note_Options()
+{
+}
+
+void CPWL_Note_Options::SetTextColor(const CPWL_Color & color)
+{
+ CPWL_Wnd::SetTextColor(color);
+
+ if (m_pText)
+ m_pText->SetTextColor(color);
+}
+
+void CPWL_Note_Options::RePosChildWnd()
+{
+ if (this->IsValid())
+ {
+ ASSERT(m_pText != NULL);
+
+ CPDF_Rect rcClient = GetClientRect();
+
+ if (rcClient.Width() > 15.0f)
+ {
+ rcClient.right -= 15.0f;
+ m_pText->Move(rcClient, TRUE, FALSE);
+ m_pText->SetVisible(TRUE);
+ }
+ else
+ {
+ m_pText->Move(CPDF_Rect(0,0,0,0), TRUE, FALSE);
+ m_pText->SetVisible(FALSE);
+ }
+ }
+}
+
+void CPWL_Note_Options::CreateChildWnd(const PWL_CREATEPARAM & cp)
+{
+ m_pText = new CPWL_Label;
+ PWL_CREATEPARAM tcp = cp;
+ tcp.pParentWnd = this;
+ tcp.dwFlags = PWS_CHILD | PWS_VISIBLE;
+ m_pText->Create(tcp);
+}
+
+void CPWL_Note_Options::SetText(const CFX_WideString& sText)
+{
+ m_pText->SetText(sText);
+}
+
+void CPWL_Note_Options::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device)
+{
+ CPWL_Wnd::DrawThisAppearance(pDevice, pUser2Device);
+
+ CPDF_Rect rcClient = GetClientRect();
+ rcClient.left = rcClient.right - 15.0f;
+
+ CPDF_Point ptCenter = CPDF_Point((rcClient.left + rcClient.right) * 0.5f, (rcClient.top + rcClient.bottom) * 0.5f);
+
+ CPDF_Point pt1(ptCenter.x - 2.0f, ptCenter.y + 2.0f * 0.5f);
+ CPDF_Point pt2(ptCenter.x + 2.0f, ptCenter.y + 2.0f * 0.5f);
+ CPDF_Point pt3(ptCenter.x, ptCenter.y - 3.0f * 0.5f);
+
+ CFX_PathData path;
+
+ path.SetPointCount(4);
+ path.SetPoint(0, pt1.x, pt1.y, FXPT_MOVETO);
+ path.SetPoint(1, pt2.x, pt2.y, FXPT_LINETO);
+ path.SetPoint(2, pt3.x, pt3.y, FXPT_LINETO);
+ path.SetPoint(3, pt1.x, pt1.y, FXPT_LINETO);
+
+ pDevice->DrawPath(&path, pUser2Device, NULL,
+ CPWL_Utils::PWLColorToFXColor(GetTextColor(),GetTransparency()),
+ 0, FXFILL_ALTERNATE);
+}
+
+CPDF_Rect CPWL_Note_Options::GetContentRect() const
+{
+ ASSERT(m_pText != NULL);
+
+ CPDF_Rect rcText = m_pText->GetContentRect();
+ rcText.right += 15.0f;
+ return rcText;
+}
+
+/* ------------------------------- CPWL_Note_Edit ------------------------------ */
+
+CPWL_Note_Edit::CPWL_Note_Edit() : m_bEnableNotify(TRUE),
+ m_fOldItemHeight(0.0f),
+ m_bSizeChanged(FALSE),
+ m_fOldMin(0.0f),
+ m_fOldMax(0.0f)
+{
+}
+
+CPWL_Note_Edit::~CPWL_Note_Edit()
+{
+}
+
+void CPWL_Note_Edit::RePosChildWnd()
+{
+ m_bEnableNotify = FALSE;
+ CPWL_Edit::RePosChildWnd();
+ m_bEnableNotify = TRUE;
+
+ m_fOldItemHeight = this->GetContentRect().Height();
+}
+
+void CPWL_Note_Edit::SetText(FX_LPCWSTR csText)
+{
+ m_bEnableNotify = FALSE;
+ CPWL_Edit::SetText(csText);
+ m_bEnableNotify = TRUE;
+ m_fOldItemHeight = this->GetContentRect().Height();
+}
+
+void CPWL_Note_Edit::OnSetFocus()
+{
+ m_bEnableNotify = FALSE;
+ CPWL_Edit::OnSetFocus();
+ m_bEnableNotify = TRUE;
+
+ this->EnableSpellCheck(TRUE);
+}
+
+void CPWL_Note_Edit::OnKillFocus()
+{
+ this->EnableSpellCheck(FALSE);
+
+ if (CPWL_Wnd* pParent = this->GetParentWindow())
+ {
+ if (CPWL_Wnd* pGrand = pParent->GetParentWindow())
+ {
+ ASSERT(pGrand->GetClassName() == "CPWL_NoteItem");
+
+ CPWL_NoteItem* pNoteItem = (CPWL_NoteItem*)pGrand;
+
+ pNoteItem->OnContentsValidate();
+ }
+ }
+
+ CPWL_Edit::OnKillFocus();
+}
+
+void CPWL_Note_Edit::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam, FX_INTPTR lParam)
+{
+ if (m_bEnableNotify)
+ {
+ if (wParam == SBT_VSCROLL)
+ {
+ switch (msg)
+ {
+ case PNM_SETSCROLLINFO:
+ if (PWL_SCROLL_INFO* pInfo = (PWL_SCROLL_INFO*)lParam)
+ {
+ if (!IsFloatEqual(pInfo->fContentMax, m_fOldMax) ||
+ !IsFloatEqual(pInfo->fContentMin, m_fOldMin))
+ {
+ m_bSizeChanged = TRUE;
+ if (CPWL_Wnd * pParent = this->GetParentWindow())
+ {
+ pParent->OnNotify(this, PNM_NOTEEDITCHANGED, 0, 0);
+ }
+
+ m_fOldMax = pInfo->fContentMax;
+ m_fOldMin = pInfo->fContentMin;
+ return;
+ }
+ }
+ }
+ }
+ }
+
+ CPWL_Edit::OnNotify(pWnd, msg, wParam, lParam);
+
+ if (m_bEnableNotify)
+ {
+ switch (msg)
+ {
+ case PNM_SETCARETINFO:
+ if (PWL_CARET_INFO * pInfo = (PWL_CARET_INFO*)wParam)
+ {
+ PWL_CARET_INFO newInfo = *pInfo;
+ newInfo.bVisible = TRUE;
+ newInfo.ptHead = this->ChildToParent(pInfo->ptHead);
+ newInfo.ptFoot = this->ChildToParent(pInfo->ptFoot);
+
+ if (CPWL_Wnd * pParent = this->GetParentWindow())
+ {
+ pParent->OnNotify(this, PNM_SETCARETINFO, (FX_INTPTR)&newInfo, 0);
+ }
+ }
+ break;
+ }
+ }
+}
+
+FX_FLOAT CPWL_Note_Edit::GetItemHeight(FX_FLOAT fLimitWidth)
+{
+ if (fLimitWidth > 0)
+ {
+ if (!m_bSizeChanged)
+ return m_fOldItemHeight;
+
+ m_bSizeChanged = FALSE;
+
+ this->EnableNotify(FALSE);
+ this->EnableRefresh(FALSE);
+ m_pEdit->EnableNotify(FALSE);
+
+ //CPDF_Rect rcOld = this->GetWindowRect();
+
+ this->Move(CPDF_Rect(0,0,fLimitWidth,0), TRUE, FALSE);
+ FX_FLOAT fRet = this->GetContentRect().Height();
+
+ //this->Move(rcOld, TRUE, FALSE);
+
+ m_pEdit->EnableNotify(TRUE);
+ this->EnableNotify(TRUE);
+ this->EnableRefresh(TRUE);
+
+ return fRet;
+ }
+
+ return 0;
+}
+
+FX_FLOAT CPWL_Note_Edit::GetItemLeftMargin()
+{
+ return POPUP_ITEM_TEXT_INDENT;
+}
+
+FX_FLOAT CPWL_Note_Edit::GetItemRightMargin()
+{
+ return POPUP_ITEM_TEXT_INDENT;
+}
+
+/* -------------------------------- CPWL_Note_LBBox --------------------------------*/
+
+CPWL_Note_LBBox::CPWL_Note_LBBox()
+{
+}
+
+CPWL_Note_LBBox::~CPWL_Note_LBBox()
+{
+}
+
+void CPWL_Note_LBBox::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device)
+{
+ CPDF_Rect rcClient = this->GetClientRect();
+
+ CFX_GraphStateData gsd;
+ gsd.m_LineWidth = 1.0f;
+
+ CFX_PathData pathCross;
+
+ pathCross.SetPointCount(4);
+ pathCross.SetPoint(0, rcClient.left, rcClient.top, FXPT_MOVETO);
+ pathCross.SetPoint(1, rcClient.right, rcClient.bottom, FXPT_LINETO);
+ pathCross.SetPoint(2, rcClient.left, rcClient.bottom + rcClient.Height() * 0.5f, FXPT_MOVETO);
+ pathCross.SetPoint(3, rcClient.left + rcClient.Width() * 0.5f, rcClient.bottom, FXPT_LINETO);
+
+ pDevice->DrawPath(&pathCross, pUser2Device, &gsd,
+ 0, CPWL_Utils::PWLColorToFXColor(GetTextColor(),this->GetTransparency()), FXFILL_ALTERNATE);
+}
+
+/* -------------------------------- CPWL_Note_RBBox --------------------------------*/
+
+CPWL_Note_RBBox::CPWL_Note_RBBox()
+{
+}
+
+CPWL_Note_RBBox::~CPWL_Note_RBBox()
+{
+}
+
+void CPWL_Note_RBBox::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device)
+{
+ CPDF_Rect rcClient = this->GetClientRect();
+
+ CFX_GraphStateData gsd;
+ gsd.m_LineWidth = 1.0f;
+
+ CFX_PathData pathCross;
+
+ pathCross.SetPointCount(4);
+ pathCross.SetPoint(0, rcClient.right, rcClient.top, FXPT_MOVETO);
+ pathCross.SetPoint(1, rcClient.left, rcClient.bottom, FXPT_LINETO);
+ pathCross.SetPoint(2, rcClient.right, rcClient.bottom + rcClient.Height() * 0.5f, FXPT_MOVETO);
+ pathCross.SetPoint(3, rcClient.left + rcClient.Width() * 0.5f, rcClient.bottom, FXPT_LINETO);
+
+ pDevice->DrawPath(&pathCross, pUser2Device, &gsd,
+ 0, CPWL_Utils::PWLColorToFXColor(GetTextColor(),this->GetTransparency()), FXFILL_ALTERNATE);
+}
+
+/* --------------------------------- CPWL_Note_Icon ---------------------------------- */
+
+CPWL_Note_Icon::CPWL_Note_Icon() : m_nType(0)
+{
+}
+
+CPWL_Note_Icon::~CPWL_Note_Icon()
+{
+}
+
+void CPWL_Note_Icon::SetIconType(FX_INT32 nType)
+{
+ m_nType = nType;
+}
+
+void CPWL_Note_Icon::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device)
+{
+ CPWL_Utils::DrawIconAppStream(pDevice, pUser2Device, m_nType, GetClientRect(),
+ this->GetBackgroundColor(), PWL_DEFAULT_BLACKCOLOR, this->GetTransparency());
+}
+
+/* --------------------------------- CPWL_Note_CloseBox ---------------------------------- */
+
+CPWL_Note_CloseBox::CPWL_Note_CloseBox() : m_bMouseDown(FALSE)
+{
+}
+
+CPWL_Note_CloseBox::~CPWL_Note_CloseBox()
+{
+}
+
+void CPWL_Note_CloseBox::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device)
+{
+ CPWL_Button::DrawThisAppearance(pDevice, pUser2Device);
+
+ CPDF_Rect rcClient = this->GetClientRect();
+ rcClient = CPWL_Utils::DeflateRect(rcClient, 2.0f);
+
+ CFX_GraphStateData gsd;
+ gsd.m_LineWidth = 1.0f;
+
+ CFX_PathData pathCross;
+
+ if (m_bMouseDown)
+ {
+ rcClient.left += 0.5f;
+ rcClient.right += 0.5f;
+ rcClient.top -= 0.5f;
+ rcClient.bottom -= 0.5f;
+ }
+
+ pathCross.SetPointCount(4);
+ pathCross.SetPoint(0, rcClient.left, rcClient.bottom, FXPT_MOVETO);
+ pathCross.SetPoint(1, rcClient.right, rcClient.top, FXPT_LINETO);
+ pathCross.SetPoint(2, rcClient.left, rcClient.top, FXPT_MOVETO);
+ pathCross.SetPoint(3, rcClient.right, rcClient.bottom, FXPT_LINETO);
+
+ pDevice->DrawPath(&pathCross, pUser2Device, &gsd,
+ 0, CPWL_Utils::PWLColorToFXColor(GetTextColor(),this->GetTransparency()), FXFILL_ALTERNATE);
+}
+
+FX_BOOL CPWL_Note_CloseBox::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
+{
+ SetBorderStyle(PBS_INSET);
+ InvalidateRect(NULL);
+
+ m_bMouseDown = TRUE;
+
+ return CPWL_Button::OnLButtonDown(point,nFlag);
+}
+
+FX_BOOL CPWL_Note_CloseBox::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
+{
+ m_bMouseDown = FALSE;
+
+ SetBorderStyle(PBS_BEVELED);
+ InvalidateRect(NULL);
+
+ return CPWL_Button::OnLButtonUp(point,nFlag);
+}
+
+/* ------------------------------ CPWL_Note_Contents ------------------------------- */
+
+CPWL_Note_Contents::CPWL_Note_Contents() : m_pEdit(NULL)
+{
+}
+
+CPWL_Note_Contents::~CPWL_Note_Contents()
+{
+}
+
+CFX_ByteString CPWL_Note_Contents::GetClassName() const
+{
+ return "CPWL_Note_Contents";
+}
+
+void CPWL_Note_Contents::CreateChildWnd(const PWL_CREATEPARAM & cp)
+{
+ m_pEdit = new CPWL_Note_Edit;
+ PWL_CREATEPARAM ecp = cp;
+ ecp.pParentWnd = this;
+ ecp.dwFlags = PWS_VISIBLE | PWS_CHILD | PES_MULTILINE | PES_AUTORETURN | PES_TEXTOVERFLOW | PES_UNDO | PES_SPELLCHECK;
+
+ m_pEdit->EnableNotify(FALSE);
+ m_pEdit->Create(ecp);
+ m_pEdit->EnableNotify(TRUE);
+}
+
+void CPWL_Note_Contents::SetText(const CFX_WideString& sText)
+{
+ if (m_pEdit)
+ {
+ m_pEdit->EnableNotify(FALSE);
+ m_pEdit->SetText(sText);
+ m_pEdit->EnableNotify(TRUE);
+ OnNotify(m_pEdit, PNM_NOTEEDITCHANGED, 0, 0);
+ }
+}
+
+CFX_WideString CPWL_Note_Contents::GetText() const
+{
+ if (m_pEdit)
+ return m_pEdit->GetText();
+
+ return L"";
+}
+
+CPWL_NoteItem* CPWL_Note_Contents::CreateSubItem()
+{
+ CPWL_NoteItem* pNoteItem = new CPWL_NoteItem;
+ PWL_CREATEPARAM icp = this->GetCreationParam();
+ icp.pParentWnd = this;
+ icp.dwFlags = PWS_CHILD | PWS_VISIBLE | PWS_BACKGROUND;
+ pNoteItem->Create(icp);
+
+ pNoteItem->OnCreateNoteItem();
+
+ pNoteItem->ResetSubjectName(m_aChildren.GetSize() - 1);
+
+ FX_SYSTEMTIME st;
+ if (IFX_SystemHandler* pSH = this->GetSystemHandler())
+ st = pSH->GetLocalTime();
+ pNoteItem->SetDateTime(st);
+
+ pNoteItem->SetContents(L"");
+
+ this->OnNotify(pNoteItem, PNM_NOTEEDITCHANGED, 0, 0);
+
+ return pNoteItem;
+}
+
+FX_INT32 CPWL_Note_Contents::CountSubItems() const
+{
+ return m_aChildren.GetSize() - 1;
+}
+
+IPWL_NoteItem* CPWL_Note_Contents::GetSubItems(FX_INT32 index) const
+{
+ FX_INT32 nIndex = index + 1;
+
+ if (nIndex > 0 && nIndex < m_aChildren.GetSize())
+ if (CPWL_Wnd* pChild = m_aChildren.GetAt(nIndex))
+ {
+ ASSERT(pChild->GetClassName() == "CPWL_NoteItem");
+ CPWL_NoteItem* pItem = (CPWL_NoteItem*)pChild;
+ return pItem;
+ }
+ return NULL;
+}
+
+void CPWL_Note_Contents::DeleteSubItem(IPWL_NoteItem* pNoteItem)
+{
+ FX_INT32 nIndex = this->GetItemIndex((CPWL_NoteItem*)pNoteItem);
+
+ if (nIndex > 0)
+ {
+ if (CPWL_NoteItem* pPWLNoteItem = (CPWL_NoteItem*)pNoteItem)
+ {
+ pPWLNoteItem->KillFocus();
+ pPWLNoteItem->Destroy();
+ delete pPWLNoteItem;
+ }
+
+ for (FX_INT32 i=nIndex,sz=m_aChildren.GetSize(); i<sz; i++)
+ {
+ if (CPWL_Wnd* pChild = m_aChildren.GetAt(i))
+ {
+ ASSERT(pChild->GetClassName() == "CPWL_NoteItem");
+ CPWL_NoteItem* pItem = (CPWL_NoteItem*)pChild;
+ pItem->ResetSubjectName(i);
+ }
+ }
+
+ this->OnNotify(this, PNM_NOTEEDITCHANGED, 0, 0);
+ }
+}
+
+IPWL_NoteItem* CPWL_Note_Contents::GetHitNoteItem(const CPDF_Point& point)
+{
+ CPDF_Point pt = this->ParentToChild(point);
+
+ for (FX_INT32 i=0,sz=m_aChildren.GetSize(); i<sz; i++)
+ {
+ if (CPWL_Wnd* pChild = m_aChildren.GetAt(i))
+ {
+ if (pChild->GetClassName() == "CPWL_NoteItem")
+ {
+ CPWL_NoteItem* pNoteItem = (CPWL_NoteItem*)pChild;
+ if (IPWL_NoteItem* pRet = pNoteItem->GetHitNoteItem(pt))
+ return pRet;
+ }
+ }
+ }
+ return NULL;
+}
+
+void CPWL_Note_Contents::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam, FX_INTPTR lParam)
+{
+ switch (msg)
+ {
+ case PNM_NOTEEDITCHANGED:
+ {
+ FX_INT32 nIndex = this->GetItemIndex(pWnd);
+ if (nIndex < 0) nIndex = 0;
+
+ m_pEdit->EnableNotify(FALSE);
+ this->ResetContent(nIndex);
+ m_pEdit->EnableNotify(TRUE);
+
+ for (FX_INT32 i=nIndex+1, sz=m_aChildren.GetSize(); i<sz; i++)
+ {
+ if (CPWL_Wnd* pChild = m_aChildren.GetAt(i))
+ pChild->OnNotify(this, PNM_NOTERESET, 0, 0);
+ }
+
+ if (CPWL_Wnd * pParent = this->GetParentWindow())
+ {
+ pParent->OnNotify(this, PNM_NOTEEDITCHANGED, 0, 0);
+ }
+ }
+ return;
+ case PNM_SCROLLWINDOW:
+ this->SetScrollPos(CPDF_Point(0.0f, *(FX_FLOAT*)lParam));
+ this->ResetFace();
+ InvalidateRect(NULL);
+ return;
+ case PNM_SETCARETINFO:
+ if (PWL_CARET_INFO * pInfo = (PWL_CARET_INFO*)wParam)
+ {
+ PWL_CARET_INFO newInfo = *pInfo;
+ newInfo.bVisible = TRUE;
+ newInfo.ptHead = this->ChildToParent(pInfo->ptHead);
+ newInfo.ptFoot = this->ChildToParent(pInfo->ptFoot);
+
+ if (CPWL_Wnd * pParent = this->GetParentWindow())
+ {
+ pParent->OnNotify(this, PNM_SETCARETINFO, (FX_INTPTR)&newInfo, 0);
+ }
+ }
+ return;
+ case PNM_NOTERESET:
+ {
+ m_pEdit->EnableNotify(FALSE);
+ this->ResetContent(0);
+ m_pEdit->EnableNotify(TRUE);
+
+ for (FX_INT32 i=1, sz=m_aChildren.GetSize(); i<sz; i++)
+ {
+ if (CPWL_Wnd* pChild = m_aChildren.GetAt(i))
+ pChild->OnNotify(this, PNM_NOTERESET, 0, 0);
+ }
+
+ m_pEdit->EnableNotify(FALSE);
+ this->ResetContent(0);
+ m_pEdit->EnableNotify(TRUE);
+ }
+ return;
+ }
+
+ CPWL_Wnd::OnNotify(pWnd, msg, wParam, lParam);
+}
+
+FX_BOOL CPWL_Note_Contents::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
+{
+ if (CPWL_Wnd::OnLButtonDown(point,nFlag)) return TRUE;
+
+ if (!m_pEdit->IsFocused())
+ {
+ m_pEdit->SetFocus();
+ }
+
+ return TRUE;
+}
+
+void CPWL_Note_Contents::SetEditFocus(FX_BOOL bLast)
+{
+ if (!m_pEdit->IsFocused())
+ {
+ m_pEdit->SetFocus();
+ m_pEdit->SetCaret(bLast ? m_pEdit->GetTotalWords() : 0);
+ }
+}
+
+CPWL_Edit* CPWL_Note_Contents::GetEdit() const
+{
+ return m_pEdit;
+}
+
+void CPWL_Note_Contents::EnableModify(FX_BOOL bEnabled)
+{
+ if (!bEnabled)
+ m_pEdit->AddFlag(PWS_READONLY);
+ else
+ m_pEdit->RemoveFlag(PWS_READONLY);
+
+ for (FX_INT32 i=0,sz=m_aChildren.GetSize(); i<sz; i++)
+ {
+ if (CPWL_Wnd* pChild = m_aChildren.GetAt(i))
+ {
+ if (pChild->GetClassName() == "CPWL_NoteItem")
+ {
+ CPWL_NoteItem* pNoteItem = (CPWL_NoteItem*)pChild;
+ pNoteItem->EnableModify(bEnabled);
+ }
+ }
+ }
+}
+
+void CPWL_Note_Contents::EnableRead(FX_BOOL bEnabled)
+{
+ if (!bEnabled)
+ m_pEdit->AddFlag(PES_NOREAD);
+ else
+ m_pEdit->RemoveFlag(PES_NOREAD);
+
+ for (FX_INT32 i=0,sz=m_aChildren.GetSize(); i<sz; i++)
+ {
+ if (CPWL_Wnd* pChild = m_aChildren.GetAt(i))
+ {
+ if (pChild->GetClassName() == "CPWL_NoteItem")
+ {
+ CPWL_NoteItem* pNoteItem = (CPWL_NoteItem*)pChild;
+ pNoteItem->EnableRead(bEnabled);
+ }
+ }
+ }
+}
+
+/* ---------------------------------- CPWL_NoteItem ---------------------------------- */
+
+CPWL_NoteItem::CPWL_NoteItem() :
+ m_pPrivateData(NULL),
+ m_pSubject(NULL),
+ m_pDateTime(NULL),
+ m_pContents(NULL),
+ m_sAuthor(L""),
+ m_fOldItemHeight(0.0f),
+ m_bSizeChanged(FALSE),
+ m_bAllowModify(TRUE)
+{
+}
+
+CPWL_NoteItem::~CPWL_NoteItem()
+{
+}
+
+CFX_ByteString CPWL_NoteItem::GetClassName() const
+{
+ return "CPWL_NoteItem";
+}
+
+void CPWL_NoteItem::CreateChildWnd(const PWL_CREATEPARAM & cp)
+{
+ CPWL_Color sTextColor;
+
+ if (CPWL_Utils::IsBlackOrWhite(this->GetBackgroundColor()))
+ sTextColor = PWL_DEFAULT_WHITECOLOR;
+ else
+ sTextColor = PWL_DEFAULT_BLACKCOLOR;
+
+ m_pSubject = new CPWL_Label;
+ PWL_CREATEPARAM scp = cp;
+ scp.pParentWnd = this;
+ scp.dwFlags = PWS_VISIBLE | PWS_CHILD | PES_LEFT | PES_TOP;
+ scp.sTextColor = sTextColor;
+ m_pSubject->Create(scp);
+
+ m_pDateTime = new CPWL_Label;
+ PWL_CREATEPARAM dcp = cp;
+ dcp.pParentWnd = this;
+ dcp.dwFlags = PWS_VISIBLE | PWS_CHILD | PES_RIGHT | PES_TOP;
+ dcp.sTextColor = sTextColor;
+ m_pDateTime->Create(dcp);
+
+ m_pContents = new CPWL_Note_Contents;
+ PWL_CREATEPARAM ccp = cp;
+ ccp.pParentWnd = this;
+ //ccp.sBackgroundColor = PWL_DEFAULT_WHITECOLOR;
+ ccp.sBackgroundColor = CPWL_Color(COLORTYPE_RGB, 240/255.0f, 240/255.0f, 240/255.0f);
+ ccp.dwFlags = PWS_VISIBLE | PWS_CHILD | PWS_BACKGROUND;
+ m_pContents->Create(ccp);
+ m_pContents->SetItemSpace(POPUP_ITEM_SPACE);
+ m_pContents->SetTopSpace(POPUP_ITEM_SPACE);
+ m_pContents->SetBottomSpace(POPUP_ITEM_SPACE);
+}
+
+void CPWL_NoteItem::RePosChildWnd()
+{
+ if (this->IsValid())
+ {
+ ASSERT(m_pSubject != NULL);
+ ASSERT(m_pDateTime != NULL);
+ ASSERT(m_pContents != NULL);
+
+ CPDF_Rect rcClient = GetClientRect();
+
+ CPDF_Rect rcSubject = rcClient;
+ rcSubject.left += POPUP_ITEM_TEXT_INDENT;
+ rcSubject.top = rcClient.top;
+ rcSubject.right = PWL_MIN(rcSubject.left + m_pSubject->GetContentRect().Width() + 1.0f, rcClient.right);
+ rcSubject.bottom = rcSubject.top - m_pSubject->GetContentRect().Height();
+ rcSubject.Normalize();
+ m_pSubject->Move(rcSubject, TRUE, FALSE);
+ m_pSubject->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcSubject));
+
+ CPDF_Rect rcDate = rcClient;
+ rcDate.right -= POPUP_ITEM_TEXT_INDENT;
+ rcDate.left = PWL_MAX(rcDate.right - m_pDateTime->GetContentRect().Width() - 1.0f, rcSubject.right);
+ rcDate.bottom = rcDate.top - m_pDateTime->GetContentRect().Height();
+ rcDate.Normalize();
+ m_pDateTime->Move(rcDate, TRUE, FALSE);
+ m_pDateTime->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcDate));
+
+ CPDF_Rect rcContents = rcClient;
+ rcContents.left += 1.0f;
+ rcContents.right -= 1.0f;
+ rcContents.top = rcDate.bottom - POPUP_ITEM_HEAD_BOTTOM;
+ rcContents.bottom += POPUP_ITEM_BOTTOMWIDTH;
+ rcContents.Normalize();
+ m_pContents->Move(rcContents, TRUE, FALSE);
+ m_pContents->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcContents));
+ }
+
+ SetClipRect(CPWL_Utils::InflateRect(GetWindowRect(),1.0f));
+}
+
+void CPWL_NoteItem::SetPrivateData(void* pData)
+{
+ m_pPrivateData = pData;
+}
+
+void CPWL_NoteItem::SetBkColor(const CPWL_Color& color)
+{
+ CPWL_Color sBK = color;
+ this->SetBackgroundColor(sBK);
+
+ CPWL_Color sTextColor;
+
+ if (CPWL_Utils::IsBlackOrWhite(sBK))
+ sTextColor = PWL_DEFAULT_WHITECOLOR;
+ else
+ sTextColor = PWL_DEFAULT_BLACKCOLOR;
+
+ this->SetTextColor(sTextColor);
+ if (m_pSubject)
+ m_pSubject->SetTextColor(sTextColor);
+ if (m_pDateTime)
+ m_pDateTime->SetTextColor(sTextColor);
+
+ this->InvalidateRect(NULL);
+
+ if (IPWL_NoteNotify* pNotify = GetNoteNotify())
+ {
+ pNotify->OnSetBkColor(this);
+ }
+}
+
+void CPWL_NoteItem::SetSubjectName(const CFX_WideString& sName)
+{
+ if (m_pSubject)
+ {
+ m_pSubject->SetText(sName);
+ }
+
+ if (IPWL_NoteNotify* pNotify = GetNoteNotify())
+ {
+ pNotify->OnSetSubjectName(this);
+ }
+}
+
+void CPWL_NoteItem::SetAuthorName(const CFX_WideString& sName)
+{
+ m_sAuthor = sName;
+ ResetSubjectName(-1);
+
+ if (IPWL_NoteNotify* pNotify = GetNoteNotify())
+ {
+ pNotify->OnSetAuthorName(this);
+ }
+}
+
+void CPWL_NoteItem::ResetSubjectName(FX_INT32 nItemIndex)
+{
+ if (nItemIndex < 0)
+ {
+ if (CPWL_Wnd* pParent = this->GetParentWindow())
+ {
+ ASSERT(pParent->GetClassName() == "CPWL_Note_Contents");
+
+ CPWL_Note_Contents* pContents = (CPWL_Note_Contents*)pParent;
+ nItemIndex = pContents->GetItemIndex(this);
+ }
+ }
+
+ const CPWL_Note* pNote = GetNote();
+ ASSERT(pNote != NULL);
+
+ CFX_WideString sSubject;
+ sSubject.Format(pNote->GetReplyString(), nItemIndex);
+
+ if (!m_sAuthor.IsEmpty())
+ {
+
+ sSubject += L" - ";
+ sSubject += m_sAuthor;
+ }
+ this->SetSubjectName(sSubject);
+ this->RePosChildWnd();
+}
+
+void CPWL_NoteItem::SetDateTime(FX_SYSTEMTIME time)
+{
+ m_dtNote = time;
+
+ CFX_WideString swTime;
+ swTime.Format((FX_LPCWSTR)L"%04d-%02d-%02d %02d:%02d:%02d", time.wYear, time.wMonth, time.wDay, time.wHour, time.wMinute, time.wSecond);
+ if (m_pDateTime)
+ {
+ m_pDateTime->SetText(swTime);
+ }
+
+ this->RePosChildWnd();
+
+ if (IPWL_NoteNotify* pNotify = GetNoteNotify())
+ {
+ pNotify->OnSetDateTime(this);
+ }
+}
+
+void CPWL_NoteItem::SetContents(const CFX_WideString& sContents)
+{
+ if (m_pContents)
+ {
+ m_pContents->SetText(sContents);
+ }
+
+ if (IPWL_NoteNotify* pNotify = GetNoteNotify())
+ {
+ pNotify->OnSetContents(this);
+ }
+}
+
+CPWL_NoteItem* CPWL_NoteItem::GetParentNoteItem() const
+{
+ if (CPWL_Wnd* pParent = this->GetParentWindow())
+ {
+ if (CPWL_Wnd* pGrand = pParent->GetParentWindow())
+ {
+ ASSERT(pGrand->GetClassName() == "CPWL_NoteItem");
+ return (CPWL_NoteItem*)pGrand;
+ }
+ }
+
+ return NULL;
+}
+
+IPWL_NoteItem* CPWL_NoteItem::GetParentItem() const
+{
+ return GetParentNoteItem();
+}
+
+CPWL_Edit* CPWL_NoteItem::GetEdit() const
+{
+ if (m_pContents)
+ return m_pContents->GetEdit();
+ return NULL;
+}
+
+void* CPWL_NoteItem::GetPrivateData() const
+{
+ return m_pPrivateData;
+}
+
+CFX_WideString CPWL_NoteItem::GetAuthorName() const
+{
+ return m_sAuthor;
+}
+
+CPWL_Color CPWL_NoteItem::GetBkColor() const
+{
+ return this->GetBackgroundColor();
+}
+
+CFX_WideString CPWL_NoteItem::GetContents() const
+{
+ if (m_pContents)
+ return m_pContents->GetText();
+
+ return L"";
+}
+
+FX_SYSTEMTIME CPWL_NoteItem::GetDateTime() const
+{
+ return m_dtNote;
+}
+
+CFX_WideString CPWL_NoteItem::GetSubjectName() const
+{
+ if (m_pSubject)
+ return m_pSubject->GetText();
+
+ return L"";
+}
+
+CPWL_NoteItem* CPWL_NoteItem::CreateNoteItem()
+{
+ if (m_pContents)
+ return m_pContents->CreateSubItem();
+
+ return NULL;
+}
+
+IPWL_NoteItem* CPWL_NoteItem::CreateSubItem()
+{
+ return CreateNoteItem();
+}
+
+FX_INT32 CPWL_NoteItem::CountSubItems() const
+{
+ if (m_pContents)
+ return m_pContents->CountSubItems();
+
+ return 0;
+}
+
+IPWL_NoteItem* CPWL_NoteItem::GetSubItems(FX_INT32 index) const
+{
+ if (m_pContents)
+ return m_pContents->GetSubItems(index);
+
+ return NULL;
+}
+
+void CPWL_NoteItem::DeleteSubItem(IPWL_NoteItem* pNoteItem)
+{
+ this->KillFocus();
+
+ if (IPWL_NoteNotify* pNotify = GetNoteNotify())
+ {
+ pNotify->OnItemDelete(pNoteItem);
+ }
+
+ if (m_pContents)
+ m_pContents->DeleteSubItem(pNoteItem);
+}
+
+IPWL_NoteItem* CPWL_NoteItem::GetHitNoteItem(const CPDF_Point& point)
+{
+ CPDF_Point pt = this->ParentToChild(point);
+
+ if (this->WndHitTest(pt))
+ {
+ if (m_pContents)
+ {
+ if (IPWL_NoteItem* pNoteItem = m_pContents->GetHitNoteItem(pt))
+ return pNoteItem;
+ }
+
+ return this;
+ }
+
+ return NULL;
+}
+
+IPWL_NoteItem* CPWL_NoteItem::GetFocusedNoteItem() const
+{
+ if (const CPWL_Wnd* pWnd = this->GetFocused())
+ {
+ if (pWnd->GetClassName() == "CPWL_Edit")
+ {
+ if (CPWL_Wnd* pParent = pWnd->GetParentWindow())
+ {
+ ASSERT(pParent->GetClassName() == "CPWL_Note_Contents");
+
+ if (CPWL_Wnd* pGrand = pParent->GetParentWindow())
+ {
+ ASSERT(pGrand->GetClassName() == "CPWL_NoteItem");
+ return (CPWL_NoteItem*)pGrand;
+ }
+ }
+ }
+ }
+
+ return NULL;
+}
+
+FX_FLOAT CPWL_NoteItem::GetItemHeight(FX_FLOAT fLimitWidth)
+{
+ if (fLimitWidth > 0)
+ {
+ if (!m_bSizeChanged)
+ return m_fOldItemHeight;
+
+ m_bSizeChanged = FALSE;
+
+ ASSERT(m_pSubject != NULL);
+ ASSERT(m_pDateTime != NULL);
+ ASSERT(m_pContents != NULL);
+
+ FX_FLOAT fRet = m_pDateTime->GetContentRect().Height();
+ FX_FLOAT fBorderWidth = (FX_FLOAT)this->GetBorderWidth();
+ if (fLimitWidth > fBorderWidth * 2)
+ fRet += m_pContents->GetContentsHeight(fLimitWidth - fBorderWidth * 2);
+ fRet += POPUP_ITEM_HEAD_BOTTOM + POPUP_ITEM_BOTTOMWIDTH + fBorderWidth * 2;
+
+ return m_fOldItemHeight = fRet;
+ }
+
+ return 0;
+}
+
+FX_FLOAT CPWL_NoteItem::GetItemLeftMargin()
+{
+ return POPUP_ITEM_SIDEMARGIN;
+}
+
+FX_FLOAT CPWL_NoteItem::GetItemRightMargin()
+{
+ return POPUP_ITEM_SIDEMARGIN;
+}
+
+FX_BOOL CPWL_NoteItem::OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag)
+{
+ if (!m_pContents->WndHitTest(m_pContents->ParentToChild(point)))
+ {
+ SetNoteFocus(FALSE);
+ }
+
+ CPWL_Wnd::OnLButtonDown(point,nFlag);
+
+ return TRUE;
+}
+
+FX_BOOL CPWL_NoteItem::OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
+{
+ if (!m_pContents->WndHitTest(m_pContents->ParentToChild(point)))
+ {
+ SetNoteFocus(FALSE);
+ PopupNoteItemMenu(point);
+
+ return TRUE;
+ }
+
+ return CPWL_Wnd::OnRButtonUp(point,nFlag);
+}
+
+void CPWL_NoteItem::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam, FX_INTPTR lParam)
+{
+ switch (msg)
+ {
+ case PNM_NOTEEDITCHANGED:
+ m_bSizeChanged = TRUE;
+
+ if (CPWL_Wnd* pParent = this->GetParentWindow())
+ {
+ pParent->OnNotify(this, PNM_NOTEEDITCHANGED, 0, 0);
+ }
+ return;
+ case PNM_SETCARETINFO:
+ if (PWL_CARET_INFO * pInfo = (PWL_CARET_INFO*)wParam)
+ {
+ PWL_CARET_INFO newInfo = *pInfo;
+ newInfo.bVisible = TRUE;
+ newInfo.ptHead = this->ChildToParent(pInfo->ptHead);
+ newInfo.ptFoot = this->ChildToParent(pInfo->ptFoot);
+
+ if (CPWL_Wnd * pParent = this->GetParentWindow())
+ {
+ pParent->OnNotify(this, PNM_SETCARETINFO, (FX_INTPTR)&newInfo, 0);
+ }
+ }
+ return;
+ case PNM_NOTERESET:
+ m_bSizeChanged = TRUE;
+ m_pContents->OnNotify(this, PNM_NOTERESET, 0, 0);
+
+ return;
+ }
+
+ CPWL_Wnd::OnNotify(pWnd, msg, wParam, lParam);
+}
+
+void CPWL_NoteItem::PopupNoteItemMenu(const CPDF_Point& point)
+{
+ if (IPWL_NoteNotify* pNotify = GetNoteNotify())
+ {
+ FX_INT32 x,y;
+ PWLtoWnd(point, x, y);
+ if (IFX_SystemHandler* pSH = GetSystemHandler())
+ pSH->ClientToScreen(GetAttachedHWnd(), x, y);
+ pNotify->OnPopupMenu(this, x, y);
+ }
+}
+
+const CPWL_Note* CPWL_NoteItem::GetNote() const
+{
+ if (const CPWL_Wnd* pRoot = this->GetRootWnd())
+ {
+ ASSERT(pRoot->GetClassName() == "CPWL_NoteItem");
+ CPWL_NoteItem* pNoteItem = (CPWL_NoteItem*)pRoot;
+ if (pNoteItem->IsTopItem())
+ {
+ return (CPWL_Note*)pNoteItem;
+ }
+ }
+
+ return NULL;
+}
+
+IPWL_NoteNotify* CPWL_NoteItem::GetNoteNotify() const
+{
+ if (const CPWL_Note* pNote = GetNote())
+ return pNote->GetNoteNotify();
+
+ return NULL;
+}
+
+void CPWL_NoteItem::OnCreateNoteItem()
+{
+ if (IPWL_NoteNotify* pNotify = GetNoteNotify())
+ {
+ pNotify->OnItemCreate(this);
+ }
+}
+
+void CPWL_NoteItem::OnContentsValidate()
+{
+ if (IPWL_NoteNotify* pNotify = GetNoteNotify())
+ {
+ pNotify->OnSetContents(this);
+ }
+}
+
+void CPWL_NoteItem::SetNoteFocus(FX_BOOL bLast)
+{
+ m_pContents->SetEditFocus(bLast);
+}
+
+void CPWL_NoteItem::EnableModify(FX_BOOL bEnabled)
+{
+ m_pContents->EnableModify(bEnabled);
+ m_bAllowModify = bEnabled;
+}
+
+void CPWL_NoteItem::EnableRead(FX_BOOL bEnabled)
+{
+ m_pContents->EnableRead(bEnabled);
+}
+
+/* ---------------------------------- CPWL_Note ---------------------------------- */
+
+CPWL_Note::CPWL_Note(IPopup_Note* pPopupNote, IPWL_NoteNotify* pNoteNotify, IPWL_NoteHandler* pNoteHandler) :
+ m_pAuthor(NULL),
+ m_pIcon(NULL),
+ m_pCloseBox(NULL),
+ m_pContentsBar(NULL),
+ m_pLBBox(NULL),
+ m_pRBBox(NULL),
+ m_pOptions(NULL),
+ m_bResizing(FALSE),
+ m_rcCaption(0,0,0,0),
+ m_pNoteNotify(pNoteNotify),
+ m_bEnalbleNotify(TRUE),
+ m_pPopupNote(pPopupNote),
+ m_pNoteHandler(pNoteHandler)
+{
+}
+
+CPWL_Note::~CPWL_Note()
+{
+}
+
+IPWL_NoteItem* CPWL_Note::Reply()
+{
+ return CreateNoteItem();
+}
+
+void CPWL_Note::EnableNotify(FX_BOOL bEnabled)
+{
+ m_bEnalbleNotify = bEnabled;
+}
+
+void CPWL_Note::RePosChildWnd()
+{
+ RePosNoteChildren();
+ m_pContents->OnNotify(this, PNM_NOTERESET, 0, 0);
+ ResetScrollBar();
+ m_pContents->OnNotify(this, PNM_NOTERESET, 0, 0);
+ this->OnNotify(this, PNM_NOTEEDITCHANGED, 0, 0);
+ //ͬ²½
+ if (const CPWL_Wnd* pWnd = this->GetFocused())
+ {
+ if (pWnd->GetClassName() == "CPWL_Edit")
+ {
+ CPWL_Edit* pEdit = (CPWL_Edit*)pWnd;
+ pEdit->SetCaret(pEdit->GetCaret());
+ }
+ }
+ //CPDF_Point ptNew = m_pContents->GetScrollPos();
+ //m_pContentsBar->OnNotify(this, PNM_SETSCROLLPOS, SBT_VSCROLL, (FX_INTPTR)&ptNew.y);
+}
+
+FX_BOOL CPWL_Note::ResetScrollBar()
+{
+ FX_BOOL bScrollChanged = FALSE;
+
+ if (ScrollBarShouldVisible())
+ {
+ if (!m_pContentsBar->IsVisible())
+ {
+ m_pContentsBar->SetVisible(TRUE);
+ if (m_pContentsBar->IsVisible())
+ {
+ m_pContentsBar->InvalidateRect(NULL);
+ bScrollChanged = TRUE;
+ }
+ }
+ }
+ else
+ {
+ if (m_pContentsBar->IsVisible())
+ {
+ m_pContentsBar->SetVisible(FALSE);
+ m_pContentsBar->InvalidateRect(NULL);
+
+ bScrollChanged = TRUE;
+ }
+ }
+
+ if (bScrollChanged)
+ {
+ CPDF_Rect rcNote = this->GetClientRect();
+ CPDF_Rect rcContents = m_pContents->GetWindowRect();
+ rcContents.right = rcNote.right - 3.0f;
+ if (m_pContentsBar->IsVisible())
+ rcContents.right -= PWL_SCROLLBAR_WIDTH;
+ m_pContents->Move(rcContents, TRUE, TRUE);
+ m_pContents->SetScrollPos(CPDF_Point(0.0f,0.0f));
+ m_pContents->InvalidateRect(NULL);
+ }
+
+ return bScrollChanged;
+}
+
+FX_BOOL CPWL_Note::ScrollBarShouldVisible()
+{
+ CPDF_Rect rcContentsFact = m_pContents->GetScrollArea();
+ CPDF_Rect rcContentsClient = m_pContents->GetClientRect();
+
+ return rcContentsFact.Height() > rcContentsClient.Height();
+}
+
+void CPWL_Note::SetOptionsText(const CFX_WideString& sText)
+{
+ if (m_pOptions)
+ m_pOptions->SetText(sText);
+
+ RePosNoteChildren();
+}
+
+void CPWL_Note::RePosNoteChildren()
+{
+ if (m_bResizing) return;
+
+ m_bResizing = TRUE;
+
+ if (this->IsValid())
+ {
+ ASSERT(m_pSubject != NULL);
+ ASSERT(m_pDateTime != NULL);
+ ASSERT(m_pContents != NULL);
+ ASSERT(m_pAuthor != NULL);
+ ASSERT(m_pCloseBox != NULL);
+ ASSERT(m_pIcon != NULL);
+ ASSERT(m_pLBBox != NULL);
+ ASSERT(m_pRBBox != NULL);
+ ASSERT(m_pContentsBar != NULL);
+ ASSERT(m_pOptions != NULL);
+
+ CPDF_Rect rcClient = GetClientRect();
+
+ CPDF_Rect rcIcon = rcClient;
+ rcIcon.top -= 2.0f;
+ rcIcon.right = rcIcon.left + 14.0f;
+ rcIcon.bottom = rcIcon.top - 14.0f;
+ rcIcon.Normalize();
+ m_pIcon->Move(rcIcon, TRUE, FALSE);
+ m_pIcon->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcIcon));
+
+ CPDF_Rect rcCloseBox = rcClient;
+ rcCloseBox.right -= 1.0f;
+ rcCloseBox.top -= 1.0f;
+ rcCloseBox.left = rcCloseBox.right - 14.0f;
+ rcCloseBox.bottom = rcCloseBox.top - 14.0f;
+ rcCloseBox.Normalize();
+ m_pCloseBox->Move(rcCloseBox, TRUE, FALSE);
+ m_pCloseBox->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcCloseBox));
+
+ CPDF_Rect rcDate = rcClient;
+ rcDate.right = rcCloseBox.left - POPUP_ITEM_TEXT_INDENT;
+ rcDate.left = PWL_MAX(rcDate.right - m_pDateTime->GetContentRect().Width() - 1.0f, rcIcon.right + 1.0f);
+ rcDate.top = rcClient.top - 2.0f;
+ rcDate.bottom = rcDate.top - m_pDateTime->GetContentRect().Height();
+ rcDate.Normalize();
+ m_pDateTime->Move(rcDate, TRUE, FALSE);
+ m_pDateTime->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcDate));
+
+ CPDF_Rect rcSubject = rcClient;
+ rcSubject.top = rcClient.top - 2.0f;
+ rcSubject.left = rcIcon.right + POPUP_ITEM_TEXT_INDENT;
+ rcSubject.right = PWL_MIN(rcSubject.left + m_pSubject->GetContentRect().Width() + 1.0f, rcDate.left - 1.0f);
+ rcSubject.bottom = rcSubject.top - m_pSubject->GetContentRect().Height();
+ rcSubject.Normalize();
+ m_pSubject->Move(rcSubject, TRUE, FALSE);
+ m_pSubject->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcSubject));
+
+ CPDF_Rect rcOptions = rcClient;
+ rcOptions.left = PWL_MAX(rcOptions.right - m_pOptions->GetContentRect().Width(), rcIcon.right + 1.0f);
+ rcOptions.top = rcSubject.bottom - 4.0f;
+ rcOptions.bottom = rcOptions.top - m_pOptions->GetContentRect().Height();
+ rcOptions.Normalize();
+ m_pOptions->Move(rcOptions, TRUE, FALSE);
+ m_pOptions->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcOptions));
+
+ CPDF_Rect rcAuthor = rcClient;
+ rcAuthor.top = rcSubject.bottom - 4.0f;
+ rcAuthor.left = rcSubject.left;
+ rcAuthor.right = PWL_MIN(rcSubject.left + m_pAuthor->GetContentRect().Width() + 1.0f, rcOptions.left - 1.0f);
+ rcAuthor.bottom = rcAuthor.top - m_pAuthor->GetContentRect().Height();
+ rcAuthor.Normalize();
+ m_pAuthor->Move(rcAuthor, TRUE, FALSE);
+ m_pAuthor->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcAuthor));
+
+ CPDF_Rect rcLBBox = rcClient;
+ rcLBBox.top = rcLBBox.bottom + 7.0f;
+ rcLBBox.right = rcLBBox.left + 7.0f;
+ rcLBBox.Normalize();
+ m_pLBBox->Move(rcLBBox, TRUE, FALSE);
+ m_pLBBox->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcLBBox));
+
+ CPDF_Rect rcRBBox = rcClient;
+ rcRBBox.top = rcRBBox.bottom + 7.0f;
+ rcRBBox.left = rcRBBox.right - 7.0f;
+ rcRBBox.Normalize();
+ m_pRBBox->Move(rcRBBox, TRUE, FALSE);
+ m_pRBBox->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcRBBox));
+
+ CPDF_Rect rcContents = rcClient;
+ rcContents.top = rcAuthor.bottom - POPUP_ITEM_HEAD_BOTTOM;
+ rcContents.left += 3.0f;
+ rcContents.right -= 3.0f;
+ if (m_pContentsBar->IsVisible())
+ rcContents.right -= PWL_SCROLLBAR_WIDTH;
+ rcContents.bottom += 14.0f;
+ rcContents.Normalize();
+ m_pContents->Move(rcContents, FALSE, FALSE);
+ m_pContents->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcContents));
+
+ CPDF_Rect rcContentsBar = rcContents;
+ rcContentsBar.right = rcClient.right - 3.0f;
+ rcContentsBar.left = rcContentsBar.right - PWL_SCROLLBAR_WIDTH;
+ rcContentsBar.Normalize();
+ m_pContentsBar->Move(rcContentsBar, TRUE, FALSE);
+
+ m_rcCaption = rcClient;
+ m_rcCaption.bottom = rcContents.top;
+ }
+
+ m_bResizing = FALSE;
+}
+
+//0-normal / 1-caption / 2-leftbottom corner / 3-rightbottom corner / 4-close / 5-options
+FX_INT32 CPWL_Note::NoteHitTest(const CPDF_Point& point) const
+{
+ ASSERT(m_pSubject != NULL);
+ ASSERT(m_pDateTime != NULL);
+ ASSERT(m_pContents != NULL);
+ ASSERT(m_pAuthor != NULL);
+ ASSERT(m_pIcon != NULL);
+ ASSERT(m_pContentsBar != NULL);
+
+ ASSERT(m_pCloseBox != NULL);
+ ASSERT(m_pLBBox != NULL);
+ ASSERT(m_pRBBox != NULL);
+ ASSERT(m_pOptions != NULL);
+
+ GetClientRect();
+
+ if (m_pSubject->WndHitTest(m_pSubject->ParentToChild(point))) return 1;
+ if (m_pDateTime->WndHitTest(m_pDateTime->ParentToChild(point))) return 1;
+ if (m_pAuthor->WndHitTest(m_pAuthor->ParentToChild(point))) return 1;
+ if (m_pIcon->WndHitTest(m_pIcon->ParentToChild(point))) return 1;
+
+ if (m_pContents->WndHitTest(m_pContents->ParentToChild(point))) return 0;
+ if (m_pContentsBar->WndHitTest(m_pContentsBar->ParentToChild(point))) return 0;
+
+ if (m_pCloseBox->WndHitTest(m_pCloseBox->ParentToChild(point))) return 4;
+ if (m_pLBBox->WndHitTest(m_pLBBox->ParentToChild(point))) return 2;
+ if (m_pRBBox->WndHitTest(m_pRBBox->ParentToChild(point))) return 3;
+ if (m_pOptions->WndHitTest(m_pOptions->ParentToChild(point))) return 5;
+
+ return 1;
+}
+
+void CPWL_Note::CreateChildWnd(const PWL_CREATEPARAM & cp)
+{
+ CPWL_NoteItem::CreateChildWnd(cp);
+
+ CPWL_Color sTextColor;
+
+ if (CPWL_Utils::IsBlackOrWhite(this->GetBackgroundColor()))
+ sTextColor = PWL_DEFAULT_WHITECOLOR;
+ else
+ sTextColor = PWL_DEFAULT_BLACKCOLOR;
+
+ m_pAuthor = new CPWL_Label;
+ PWL_CREATEPARAM acp = cp;
+ acp.pParentWnd = this;
+ acp.dwFlags = PWS_VISIBLE | PWS_CHILD | PES_LEFT | PES_TOP;
+ acp.sTextColor = sTextColor;
+ m_pAuthor->Create(acp);
+
+ m_pCloseBox = new CPWL_Note_CloseBox;
+ PWL_CREATEPARAM ccp = cp;
+ ccp.pParentWnd = this;
+ ccp.dwBorderWidth = 2;
+ ccp.nBorderStyle = PBS_BEVELED;
+ ccp.dwFlags = PWS_VISIBLE | PWS_CHILD | PWS_BORDER;
+ ccp.sTextColor = sTextColor;
+ m_pCloseBox->Create(ccp);
+
+ m_pIcon = new CPWL_Note_Icon;
+ PWL_CREATEPARAM icp = cp;
+ icp.pParentWnd = this;
+ icp.dwFlags = PWS_VISIBLE | PWS_CHILD;
+ m_pIcon->Create(icp);
+
+ m_pOptions = new CPWL_Note_Options;
+ PWL_CREATEPARAM ocp = cp;
+ ocp.pParentWnd = this;
+ ocp.dwFlags = PWS_CHILD | PWS_VISIBLE;
+ ocp.sTextColor = sTextColor;
+ m_pOptions->Create(ocp);
+
+ m_pLBBox = new CPWL_Note_LBBox;
+ PWL_CREATEPARAM lcp = cp;
+ lcp.pParentWnd = this;
+ lcp.dwFlags = PWS_VISIBLE | PWS_CHILD;
+ lcp.eCursorType = FXCT_NESW;
+ lcp.sTextColor = sTextColor;
+ m_pLBBox->Create(lcp);
+
+ m_pRBBox = new CPWL_Note_RBBox;
+ PWL_CREATEPARAM rcp = cp;
+ rcp.pParentWnd = this;
+ rcp.dwFlags = PWS_VISIBLE | PWS_CHILD;
+ rcp.eCursorType = FXCT_NWSE;
+ rcp.sTextColor = sTextColor;
+ m_pRBBox->Create(rcp);
+
+ m_pContentsBar = new CPWL_ScrollBar(SBT_VSCROLL);
+ PWL_CREATEPARAM scp = cp;
+ scp.pParentWnd = this;
+ scp.sBackgroundColor = CPWL_Color(COLORTYPE_RGB, 240/255.0f, 240/255.0f, 240/255.0f);
+ scp.dwFlags = PWS_CHILD | PWS_VISIBLE | PWS_BACKGROUND;
+ m_pContentsBar->Create(scp);
+ m_pContentsBar->SetNotifyForever(TRUE);
+}
+
+void CPWL_Note::SetSubjectName(const CFX_WideString& sName)
+{
+ CPWL_NoteItem::SetSubjectName(sName);
+ RePosChildWnd();
+}
+
+void CPWL_Note::SetAuthorName(const CFX_WideString& sName)
+{
+ if (m_pAuthor)
+ {
+ m_pAuthor->SetText(sName);
+ RePosChildWnd();
+ }
+
+ if (IPWL_NoteNotify* pNotify = GetNoteNotify())
+ {
+ pNotify->OnSetAuthorName(this);
+ }
+}
+
+CFX_WideString CPWL_Note::GetAuthorName() const
+{
+ if (m_pAuthor)
+ return m_pAuthor->GetText();
+
+ return L"";
+}
+
+FX_BOOL CPWL_Note::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag)
+{
+ CPDF_Point ptScroll = m_pContents->GetScrollPos();
+ CPDF_Rect rcScroll = m_pContents->GetScrollArea();
+ CPDF_Rect rcContents = m_pContents->GetClientRect();
+
+ if (rcScroll.top - rcScroll.bottom > rcContents.Height())
+ {
+ CPDF_Point ptNew = ptScroll;
+
+ if (zDelta > 0)
+ ptNew.y += 30;
+ else
+ ptNew.y -= 30;
+
+ if (ptNew.y > rcScroll.top)
+ ptNew.y = rcScroll.top;
+ if (ptNew.y < rcScroll.bottom + rcContents.Height())
+ ptNew.y = rcScroll.bottom + rcContents.Height();
+ if (ptNew.y < rcScroll.bottom)
+ ptNew.y = rcScroll.bottom;
+
+ if (ptNew.y != ptScroll.y)
+ {
+ m_pContents->OnNotify(this, PNM_NOTERESET, 0, 0);
+ m_pContents->OnNotify(this, PNM_SCROLLWINDOW, SBT_VSCROLL, (FX_INTPTR)&ptNew.y);
+ m_pContentsBar->OnNotify(this, PNM_SETSCROLLPOS, SBT_VSCROLL, (FX_INTPTR)&ptNew.y);
+
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
+void CPWL_Note::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam, FX_INTPTR lParam)
+{
+ switch (msg)
+ {
+ case PNM_NOTEEDITCHANGED:
+ {
+ CPDF_Rect rcScroll = m_pContents->GetScrollArea();
+
+
+ PWL_SCROLL_INFO sInfo;
+ sInfo.fContentMin = rcScroll.bottom;
+ sInfo.fContentMax = rcScroll.top;
+ sInfo.fPlateWidth = m_pContents->GetClientRect().Height();
+ sInfo.fSmallStep = 13.0f;
+ sInfo.fBigStep = sInfo.fPlateWidth;
+
+ if (FXSYS_memcmp(&m_OldScrollInfo, &sInfo, sizeof(PWL_SCROLL_INFO)) != 0)
+ {
+ FX_BOOL bScrollChanged = FALSE;
+
+ if (lParam < 3) //·ÀÖ¹ËÀÑ­»· mantis:15759
+ {
+ bScrollChanged = ResetScrollBar();
+ if (bScrollChanged)
+ {
+ lParam++;
+ m_pContents->OnNotify(this, PNM_NOTERESET, 0, 0);
+ this->OnNotify(this, PNM_NOTEEDITCHANGED, 0, lParam);
+ }
+ }
+
+ if (!bScrollChanged)
+ {
+ if (m_pContentsBar->IsVisible())
+ {
+ m_pContentsBar->OnNotify(pWnd, PNM_SETSCROLLINFO, SBT_VSCROLL, (FX_INTPTR)&sInfo);
+ m_OldScrollInfo = sInfo;
+
+ CPDF_Point ptScroll = m_pContents->GetScrollPos();
+ CPDF_Point ptOld = ptScroll;
+
+ if (ptScroll.y > sInfo.fContentMax)
+ ptScroll.y = sInfo.fContentMax;
+ if (ptScroll.y < sInfo.fContentMin + sInfo.fPlateWidth)
+ ptScroll.y = sInfo.fContentMin + sInfo.fPlateWidth;
+ if (ptScroll.y < sInfo.fContentMin)
+ ptScroll.y = sInfo.fContentMin;
+
+ if (ptOld.y != ptScroll.y)
+ {
+ m_pContentsBar->OnNotify(this, PNM_SETSCROLLPOS, SBT_VSCROLL, (FX_INTPTR)&ptScroll.y);
+ m_pContentsBar->InvalidateRect(NULL);
+ m_pContents->OnNotify(this, PNM_SCROLLWINDOW, SBT_VSCROLL, (FX_INTPTR)&ptScroll.y);
+ }
+ }
+ }
+ }
+ }
+
+ m_pContents->InvalidateRect(NULL);
+
+ return;
+ case PNM_SCROLLWINDOW:
+ if (m_pContents)
+ m_pContents->OnNotify(pWnd, msg, wParam, lParam);
+ return;
+ case PNM_SETSCROLLPOS:
+ if (m_pContentsBar)
+ m_pContentsBar->OnNotify(pWnd,PNM_SETSCROLLPOS,wParam,lParam);
+ return;
+ }
+
+ if (msg == PNM_SETCARETINFO && IsValid())
+ {
+ if (PWL_CARET_INFO * pInfo = (PWL_CARET_INFO*)wParam)
+ {
+ if (m_pContents)
+ {
+ CPDF_Rect rcClient = m_pContents->GetClientRect();
+ if (pInfo->ptHead.y > rcClient.top)
+ {
+ CPDF_Point pt = m_pContents->OutToIn(pInfo->ptHead);
+ m_pContents->OnNotify(this, PNM_SCROLLWINDOW, SBT_VSCROLL, (FX_INTPTR)&pt.y);
+
+ CPDF_Point ptScroll = m_pContents->GetScrollPos();
+ m_pContentsBar->OnNotify(this, PNM_SETSCROLLPOS, SBT_VSCROLL, (FX_INTPTR)&ptScroll.y);
+
+ return;
+ }
+
+ if (pInfo->ptFoot.y < rcClient.bottom)
+ {
+ CPDF_Point pt = m_pContents->OutToIn(pInfo->ptFoot);
+ pt.y += rcClient.Height();
+ m_pContents->OnNotify(this, PNM_SCROLLWINDOW, SBT_VSCROLL, (FX_INTPTR)&pt.y);
+
+ CPDF_Point ptScroll = m_pContents->GetScrollPos();
+ m_pContentsBar->OnNotify(this, PNM_SETSCROLLPOS, SBT_VSCROLL, (FX_INTPTR)&ptScroll.y);
+
+ return;
+ }
+ }
+ }
+ }
+
+ CPWL_NoteItem::OnNotify(pWnd, msg, wParam, lParam);
+}
+
+void CPWL_Note::SetBkColor(const CPWL_Color& color)
+{
+ CPWL_NoteItem::SetBkColor(color);
+
+ CPWL_Color sBK = color;
+ CPWL_Color sTextColor;
+ if (CPWL_Utils::IsBlackOrWhite(sBK))
+ sTextColor = PWL_DEFAULT_WHITECOLOR;
+ else
+ sTextColor = PWL_DEFAULT_BLACKCOLOR;
+
+ if (m_pCloseBox)
+ m_pCloseBox->SetTextColor(sTextColor);
+ if (m_pAuthor)
+ m_pAuthor->SetTextColor(sTextColor);
+ if (m_pOptions)
+ m_pOptions->SetTextColor(sTextColor);
+ if (m_pLBBox)
+ m_pLBBox->SetTextColor(sTextColor);
+ if (m_pRBBox)
+ m_pRBBox->SetTextColor(sTextColor);
+}
+
+FX_BOOL CPWL_Note::OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag)
+{
+ if (m_pOptions->WndHitTest(m_pOptions->ParentToChild(point)))
+ {
+ if (IPWL_NoteNotify* pNotify = this->GetNoteNotify())
+ {
+ FX_INT32 x, y;
+ PWLtoWnd(point, x, y);
+ if (IFX_SystemHandler* pSH = GetSystemHandler())
+ pSH->ClientToScreen(GetAttachedHWnd(), x, y);
+ this->KillFocus();
+ pNotify->OnPopupMenu(x, y);
+
+ return TRUE;
+ }
+ }
+
+ return CPWL_Wnd::OnLButtonDown(point,nFlag);
+}
+
+FX_BOOL CPWL_Note::OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
+{
+ return CPWL_Wnd::OnRButtonUp(point,nFlag);
+}
+
+const CPWL_Note* CPWL_Note::GetNote() const
+{
+ return this;
+}
+
+IPWL_NoteNotify* CPWL_Note::GetNoteNotify() const
+{
+ if (m_bEnalbleNotify)
+ return m_pNoteNotify;
+
+ return NULL;
+}
+
+void CPWL_Note::SetIconType(FX_INT32 nType)
+{
+ if (m_pIcon)
+ m_pIcon->SetIconType(nType);
+}
+
+void CPWL_Note::EnableModify(FX_BOOL bEnabled)
+{
+ m_pContents->EnableModify(bEnabled);
+}
+
+void CPWL_Note::EnableRead(FX_BOOL bEnabled)
+{
+ m_pContents->EnableRead(bEnabled);
+}
+
+CFX_WideString CPWL_Note::GetReplyString() const
+{
+ return m_sReplyString;
+}
+
+void CPWL_Note::SetReplyString(const CFX_WideString& string)
+{
+ m_sReplyString = string;
+}
+
diff --git a/fpdfsdk/src/pdfwindow/PWL_ScrollBar.cpp b/fpdfsdk/src/pdfwindow/PWL_ScrollBar.cpp
index d51de4db75..772e184902 100644
--- a/fpdfsdk/src/pdfwindow/PWL_ScrollBar.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_ScrollBar.cpp
@@ -1,1353 +1,1353 @@
-// 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
-
-#include "../../include/pdfwindow/PDFWindow.h"
-#include "../../include/pdfwindow/PWL_Wnd.h"
-#include "../../include/pdfwindow/PWL_ScrollBar.h"
-#include "../../include/pdfwindow/PWL_Utils.h"
-
-#define IsFloatZero(f) ((f) < 0.0001 && (f) > -0.0001)
-#define IsFloatBigger(fa,fb) ((fa) > (fb) && !IsFloatZero((fa) - (fb)))
-#define IsFloatSmaller(fa,fb) ((fa) < (fb) && !IsFloatZero((fa) - (fb)))
-#define IsFloatEqual(fa,fb) IsFloatZero((fa)-(fb))
-
-
-/* ------------------------------- PWL_FLOATRANGE ------------------------------- */
-
-PWL_FLOATRANGE::PWL_FLOATRANGE()
-{
- Default();
-}
-
-PWL_FLOATRANGE::PWL_FLOATRANGE(FX_FLOAT min,FX_FLOAT max)
-{
- Set(min,max);
-}
-
-void PWL_FLOATRANGE::Default()
-{
- fMin = 0;
- fMax = 0;
-}
-
-void PWL_FLOATRANGE::Set(FX_FLOAT min,FX_FLOAT max)
-{
- if (min > max)
- {
- fMin = max;
- fMax = min;
- }
- else
- {
- fMin = min;
- fMax = max;
- }
-}
-
-FX_BOOL PWL_FLOATRANGE::In(FX_FLOAT x) const
-{
- return (IsFloatBigger(x,fMin) || IsFloatEqual(x, fMin)) &&
- (IsFloatSmaller(x, fMax) || IsFloatEqual(x, fMax));
-}
-
-FX_FLOAT PWL_FLOATRANGE::GetWidth() const
-{
- return fMax - fMin;
-}
-
-/* ------------------------------- PWL_SCROLL_PRIVATEDATA ------------------------------- */
-
-PWL_SCROLL_PRIVATEDATA::PWL_SCROLL_PRIVATEDATA()
-{
- Default();
-}
-
-void PWL_SCROLL_PRIVATEDATA::Default()
-{
- ScrollRange.Default();
- fScrollPos = ScrollRange.fMin;
- fClientWidth = 0;
- fBigStep = 10;
- fSmallStep = 1;
-}
-
-void PWL_SCROLL_PRIVATEDATA::SetScrollRange(FX_FLOAT min,FX_FLOAT max)
-{
- ScrollRange.Set(min,max);
-
- if (IsFloatSmaller(fScrollPos, ScrollRange.fMin))
- fScrollPos = ScrollRange.fMin;
- if (IsFloatBigger(fScrollPos, ScrollRange.fMax))
- fScrollPos = ScrollRange.fMax;
-}
-
-void PWL_SCROLL_PRIVATEDATA::SetClientWidth(FX_FLOAT width)
-{
- fClientWidth = width;
-}
-
-void PWL_SCROLL_PRIVATEDATA::SetSmallStep(FX_FLOAT step)
-{
- fSmallStep = step;
-}
-
-void PWL_SCROLL_PRIVATEDATA::SetBigStep(FX_FLOAT step)
-{
- fBigStep = step;
-}
-
-FX_BOOL PWL_SCROLL_PRIVATEDATA::SetPos(FX_FLOAT pos)
-{
- if (ScrollRange.In(pos))
- {
- fScrollPos = pos;
- return TRUE;
- }
- return FALSE;
-}
-
-void PWL_SCROLL_PRIVATEDATA::AddSmall()
-{
- if (!SetPos(fScrollPos + fSmallStep))
- SetPos(ScrollRange.fMax);
-}
-
-void PWL_SCROLL_PRIVATEDATA::SubSmall()
-{
- if (!SetPos(fScrollPos - fSmallStep))
- SetPos(ScrollRange.fMin);
-}
-
-void PWL_SCROLL_PRIVATEDATA::AddBig()
-{
- if (!SetPos(fScrollPos + fBigStep))
- SetPos(ScrollRange.fMax);
-}
-
-void PWL_SCROLL_PRIVATEDATA::SubBig()
-{
- if (!SetPos(fScrollPos - fBigStep))
- SetPos(ScrollRange.fMin);
-}
-
-/* ------------------------------- CPWL_SBButton ------------------------------- */
-
-CPWL_SBButton::CPWL_SBButton(PWL_SCROLLBAR_TYPE eScrollBarType,PWL_SBBUTTON_TYPE eButtonType)
-{
- m_eScrollBarType = eScrollBarType;
- m_eSBButtonType = eButtonType;
-
- m_bMouseDown = FALSE;
-}
-
-CPWL_SBButton::~CPWL_SBButton()
-{
-
-}
-
-CFX_ByteString CPWL_SBButton::GetClassName() const
-{
- return "CPWL_SBButton";
-}
-
-void CPWL_SBButton::OnCreate(PWL_CREATEPARAM & cp)
-{
- cp.eCursorType = FXCT_ARROW;
-}
-
-void CPWL_SBButton::GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream)
-{
- CPWL_Wnd::GetThisAppearanceStream(sAppStream);
-
- if (!IsVisible()) return;
-
- CFX_ByteTextBuf sButton;
-
- CPDF_Rect rectWnd = GetWindowRect();
-
- if (rectWnd.IsEmpty()) return;
-
- sAppStream << "q\n";
-
- CPDF_Point ptCenter = this->GetCenterPoint();
-
- switch (this->m_eScrollBarType)
- {
- case SBT_HSCROLL:
- switch (this->m_eSBButtonType)
- {
- case PSBT_MIN:
- {
- CPDF_Point pt1(ptCenter.x - PWL_TRIANGLE_HALFLEN * 0.5f,ptCenter.y);
- CPDF_Point pt2(ptCenter.x + PWL_TRIANGLE_HALFLEN * 0.5f,ptCenter.y + PWL_TRIANGLE_HALFLEN);
- CPDF_Point pt3(ptCenter.x + PWL_TRIANGLE_HALFLEN * 0.5f,ptCenter.y - PWL_TRIANGLE_HALFLEN);
-
- if (rectWnd.right - rectWnd.left > PWL_TRIANGLE_HALFLEN * 2 &&
- rectWnd.top - rectWnd.bottom > PWL_TRIANGLE_HALFLEN )
- {
- sButton << "0 g\n";
- sButton << pt1.x << " " << pt1.y << " m\n";
- sButton << pt2.x << " " << pt2.y << " l\n";
- sButton << pt3.x << " " << pt3.y << " l\n";
- sButton << pt1.x << " " << pt1.y << " l f\n";
-
- sAppStream << sButton;
- }
- }
- break;
- case PSBT_MAX:
- {
- CPDF_Point pt1(ptCenter.x + PWL_TRIANGLE_HALFLEN * 0.5f,ptCenter.y);
- CPDF_Point pt2(ptCenter.x - PWL_TRIANGLE_HALFLEN * 0.5f,ptCenter.y + PWL_TRIANGLE_HALFLEN);
- CPDF_Point pt3(ptCenter.x - PWL_TRIANGLE_HALFLEN * 0.5f,ptCenter.y - PWL_TRIANGLE_HALFLEN);
-
- if (rectWnd.right - rectWnd.left > PWL_TRIANGLE_HALFLEN * 2 &&
- rectWnd.top - rectWnd.bottom > PWL_TRIANGLE_HALFLEN )
- {
- sButton << "0 g\n";
- sButton << pt1.x << " " << pt1.y << " m\n";
- sButton << pt2.x << " " << pt2.y << " l\n";
- sButton << pt3.x << " " << pt3.y << " l\n";
- sButton << pt1.x << " " << pt1.y << " l f\n";
-
- sAppStream << sButton;
- }
- }
- break;
- default:
- break;
- }
- break;
- case SBT_VSCROLL:
- switch(this->m_eSBButtonType)
- {
- case PSBT_MIN:
- {
- CPDF_Point pt1(ptCenter.x - PWL_TRIANGLE_HALFLEN,ptCenter.y - PWL_TRIANGLE_HALFLEN * 0.5f);
- CPDF_Point pt2(ptCenter.x + PWL_TRIANGLE_HALFLEN,ptCenter.y - PWL_TRIANGLE_HALFLEN * 0.5f);
- CPDF_Point pt3(ptCenter.x,ptCenter.y + PWL_TRIANGLE_HALFLEN * 0.5f);
-
- if (rectWnd.right - rectWnd.left > PWL_TRIANGLE_HALFLEN * 2 &&
- rectWnd.top - rectWnd.bottom > PWL_TRIANGLE_HALFLEN )
- {
- sButton << "0 g\n";
- sButton << pt1.x << " " << pt1.y << " m\n";
- sButton << pt2.x << " " << pt2.y << " l\n";
- sButton << pt3.x << " " << pt3.y << " l\n";
- sButton << pt1.x << " " << pt1.y << " l f\n";
-
- sAppStream << sButton;
- }
- }
- break;
- case PSBT_MAX:
- {
- CPDF_Point pt1(ptCenter.x - PWL_TRIANGLE_HALFLEN,ptCenter.y + PWL_TRIANGLE_HALFLEN * 0.5f);
- CPDF_Point pt2(ptCenter.x + PWL_TRIANGLE_HALFLEN,ptCenter.y + PWL_TRIANGLE_HALFLEN * 0.5f);
- CPDF_Point pt3(ptCenter.x,ptCenter.y - PWL_TRIANGLE_HALFLEN * 0.5f);
-
- if (rectWnd.right - rectWnd.left > PWL_TRIANGLE_HALFLEN * 2 &&
- rectWnd.top - rectWnd.bottom > PWL_TRIANGLE_HALFLEN )
- {
- sButton << "0 g\n";
- sButton << pt1.x << " " << pt1.y << " m\n";
- sButton << pt2.x << " " << pt2.y << " l\n";
- sButton << pt3.x << " " << pt3.y << " l\n";
- sButton << pt1.x << " " << pt1.y << " l f\n";
-
- sAppStream << sButton;
- }
- }
- break;
- default:
- break;
- }
- break;
- default:
- break;
- }
-
- sAppStream << "Q\n";
-}
-
-void CPWL_SBButton::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device)
-{
- if (!IsVisible()) return;
-
- CPDF_Rect rectWnd = GetWindowRect();
- if (rectWnd.IsEmpty()) return;
-
- CPDF_Point ptCenter = this->GetCenterPoint();
- FX_INT32 nTransparancy = this->GetTransparency();
-
- switch (this->m_eScrollBarType)
- {
- case SBT_HSCROLL:
- CPWL_Wnd::DrawThisAppearance(pDevice,pUser2Device);
- switch (this->m_eSBButtonType)
- {
- case PSBT_MIN:
- {
- CPDF_Point pt1(ptCenter.x - PWL_TRIANGLE_HALFLEN * 0.5f,ptCenter.y);
- CPDF_Point pt2(ptCenter.x + PWL_TRIANGLE_HALFLEN * 0.5f,ptCenter.y + PWL_TRIANGLE_HALFLEN);
- CPDF_Point pt3(ptCenter.x + PWL_TRIANGLE_HALFLEN * 0.5f,ptCenter.y - PWL_TRIANGLE_HALFLEN);
-
- if (rectWnd.right - rectWnd.left > PWL_TRIANGLE_HALFLEN * 2 &&
- rectWnd.top - rectWnd.bottom > PWL_TRIANGLE_HALFLEN )
- {
- CFX_PathData path;
-
- path.SetPointCount(4);
- path.SetPoint(0, pt1.x, pt1.y, FXPT_MOVETO);
- path.SetPoint(1, pt2.x, pt2.y, FXPT_LINETO);
- path.SetPoint(2, pt3.x, pt3.y, FXPT_LINETO);
- path.SetPoint(3, pt1.x, pt1.y, FXPT_LINETO);
-
- pDevice->DrawPath(&path, pUser2Device, NULL,
- CPWL_Utils::PWLColorToFXColor(PWL_DEFAULT_BLACKCOLOR,nTransparancy),
- 0, FXFILL_ALTERNATE);
- }
- }
- break;
- case PSBT_MAX:
- {
- CPDF_Point pt1(ptCenter.x + PWL_TRIANGLE_HALFLEN * 0.5f,ptCenter.y);
- CPDF_Point pt2(ptCenter.x - PWL_TRIANGLE_HALFLEN * 0.5f,ptCenter.y + PWL_TRIANGLE_HALFLEN);
- CPDF_Point pt3(ptCenter.x - PWL_TRIANGLE_HALFLEN * 0.5f,ptCenter.y - PWL_TRIANGLE_HALFLEN);
-
- if (rectWnd.right - rectWnd.left > PWL_TRIANGLE_HALFLEN * 2 &&
- rectWnd.top - rectWnd.bottom > PWL_TRIANGLE_HALFLEN )
- {
- CFX_PathData path;
-
- path.SetPointCount(4);
- path.SetPoint(0, pt1.x, pt1.y, FXPT_MOVETO);
- path.SetPoint(1, pt2.x, pt2.y, FXPT_LINETO);
- path.SetPoint(2, pt3.x, pt3.y, FXPT_LINETO);
- path.SetPoint(3, pt1.x, pt1.y, FXPT_LINETO);
-
- pDevice->DrawPath(&path, pUser2Device, NULL,
- CPWL_Utils::PWLColorToFXColor(PWL_DEFAULT_BLACKCOLOR,nTransparancy),
- 0, FXFILL_ALTERNATE);
- }
- }
- break;
- default:
- break;
- }
- break;
- case SBT_VSCROLL:
- switch(this->m_eSBButtonType)
- {
- case PSBT_MIN:
- {
- //draw border
- CPDF_Rect rcDraw = rectWnd;
- CPWL_Utils::DrawStrokeRect(pDevice, pUser2Device, rcDraw,
- ArgbEncode(nTransparancy,100,100,100),0.0f);
-
- //draw inner border
- rcDraw = CPWL_Utils::DeflateRect(rectWnd,0.5f);
- CPWL_Utils::DrawStrokeRect(pDevice, pUser2Device, rcDraw,
- ArgbEncode(nTransparancy,255,255,255),1.0f);
-
- //draw background
-
- rcDraw = CPWL_Utils::DeflateRect(rectWnd,1.0f);
-
- if (this->IsEnabled())
- CPWL_Utils::DrawShadow(pDevice, pUser2Device, TRUE, FALSE, rcDraw, nTransparancy, 80, 220);
- else
- CPWL_Utils::DrawFillRect(pDevice, pUser2Device, rcDraw, ArgbEncode(255,255,255,255));
-
- //draw arrow
-
- if (rectWnd.top - rectWnd.bottom > 6.0f )
- {
- FX_FLOAT fX = rectWnd.left + 1.5f;
- FX_FLOAT fY = rectWnd.bottom;
- CPDF_Point pts[7] = {
- CPDF_Point(fX+2.5f, fY+4.0f),
- CPDF_Point(fX+2.5f, fY+3.0f),
- CPDF_Point(fX+4.5f, fY+5.0f),
- CPDF_Point(fX+6.5f, fY+3.0f),
- CPDF_Point(fX+6.5f, fY+4.0f),
- CPDF_Point(fX+4.5f, fY+6.0f),
- CPDF_Point(fX+2.5f, fY+4.0f)};
-
-
- if (this->IsEnabled())
- CPWL_Utils::DrawFillArea(pDevice, pUser2Device, pts, 7, ArgbEncode(nTransparancy,255,255,255));
- else
- CPWL_Utils::DrawFillArea(pDevice, pUser2Device, pts, 7,
- CPWL_Utils::PWLColorToFXColor(PWL_DEFAULT_HEAVYGRAYCOLOR,255));
- }
- }
- break;
- case PSBT_MAX:
- {
- //draw border
- CPDF_Rect rcDraw = rectWnd;
- CPWL_Utils::DrawStrokeRect(pDevice, pUser2Device, rcDraw,
- ArgbEncode(nTransparancy,100,100,100),0.0f);
-
- //draw inner border
- rcDraw = CPWL_Utils::DeflateRect(rectWnd,0.5f);
- CPWL_Utils::DrawStrokeRect(pDevice, pUser2Device, rcDraw,
- ArgbEncode(nTransparancy,255,255,255),1.0f);
-
- //draw background
- rcDraw = CPWL_Utils::DeflateRect(rectWnd,1.0f);
- if (this->IsEnabled())
- CPWL_Utils::DrawShadow(pDevice, pUser2Device, TRUE, FALSE, rcDraw, nTransparancy, 80, 220);
- else
- CPWL_Utils::DrawFillRect(pDevice, pUser2Device, rcDraw, ArgbEncode(255,255,255,255));
-
- //draw arrow
-
- if (rectWnd.top - rectWnd.bottom > 6.0f )
- {
- FX_FLOAT fX = rectWnd.left + 1.5f;
- FX_FLOAT fY = rectWnd.bottom;
-
- CPDF_Point pts[7] = {
- CPDF_Point(fX+2.5f, fY+5.0f),
- CPDF_Point(fX+2.5f, fY+6.0f),
- CPDF_Point(fX+4.5f, fY+4.0f),
- CPDF_Point(fX+6.5f, fY+6.0f),
- CPDF_Point(fX+6.5f, fY+5.0f),
- CPDF_Point(fX+4.5f, fY+3.0f),
- CPDF_Point(fX+2.5f, fY+5.0f)};
-
-
- if (this->IsEnabled())
- CPWL_Utils::DrawFillArea(pDevice, pUser2Device, pts, 7, ArgbEncode(nTransparancy,255,255,255));
- else
- CPWL_Utils::DrawFillArea(pDevice, pUser2Device, pts, 7,
- CPWL_Utils::PWLColorToFXColor(PWL_DEFAULT_HEAVYGRAYCOLOR,255));
- }
- }
- break;
- case PSBT_POS:
- {
- //CPWL_Wnd::DrawThisAppearance(pDevice,pUser2Device);
-
- //draw border
- CPDF_Rect rcDraw = rectWnd;
- CPWL_Utils::DrawStrokeRect(pDevice, pUser2Device, rcDraw,
- ArgbEncode(nTransparancy,100,100,100),0.0f);
-
- //draw inner border
- rcDraw = CPWL_Utils::DeflateRect(rectWnd,0.5f);
- CPWL_Utils::DrawStrokeRect(pDevice, pUser2Device, rcDraw,
- ArgbEncode(nTransparancy,255,255,255),1.0f);
-
- if (this->IsEnabled())
- {
- //draw shadow effect
-
- CPDF_Point ptTop = CPDF_Point(rectWnd.left,rectWnd.top-1.0f);
- CPDF_Point ptBottom = CPDF_Point(rectWnd.left,rectWnd.bottom+1.0f);
-
- ptTop.x += 1.5f;
- ptBottom.x += 1.5f;
-
- CPWL_Utils::DrawStrokeLine(pDevice, pUser2Device, ptTop, ptBottom,
- ArgbEncode(nTransparancy,210,210,210),1.0f);
-
- ptTop.x += 1.0f;
- ptBottom.x += 1.0f;
-
- CPWL_Utils::DrawStrokeLine(pDevice, pUser2Device, ptTop, ptBottom,
- ArgbEncode(nTransparancy,220,220,220),1.0f);
-
- ptTop.x += 1.0f;
- ptBottom.x += 1.0f;
-
- CPWL_Utils::DrawStrokeLine(pDevice, pUser2Device, ptTop, ptBottom,
- ArgbEncode(nTransparancy,240,240,240),1.0f);
-
- ptTop.x += 1.0f;
- ptBottom.x += 1.0f;
-
- CPWL_Utils::DrawStrokeLine(pDevice, pUser2Device, ptTop, ptBottom,
- ArgbEncode(nTransparancy,240,240,240),1.0f);
-
- ptTop.x += 1.0f;
- ptBottom.x += 1.0f;
-
- CPWL_Utils::DrawStrokeLine(pDevice, pUser2Device, ptTop, ptBottom,
- ArgbEncode(nTransparancy,210,210,210),1.0f);
-
- ptTop.x += 1.0f;
- ptBottom.x += 1.0f;
-
- CPWL_Utils::DrawStrokeLine(pDevice, pUser2Device, ptTop, ptBottom,
- ArgbEncode(nTransparancy,180,180,180),1.0f);
-
- ptTop.x += 1.0f;
- ptBottom.x += 1.0f;
-
- CPWL_Utils::DrawStrokeLine(pDevice, pUser2Device, ptTop, ptBottom,
- ArgbEncode(nTransparancy,150,150,150),1.0f);
-
- ptTop.x += 1.0f;
- ptBottom.x += 1.0f;
-
- CPWL_Utils::DrawStrokeLine(pDevice, pUser2Device, ptTop, ptBottom,
- ArgbEncode(nTransparancy,150,150,150),1.0f);
-
- ptTop.x += 1.0f;
- ptBottom.x += 1.0f;
-
- CPWL_Utils::DrawStrokeLine(pDevice, pUser2Device, ptTop, ptBottom,
- ArgbEncode(nTransparancy,180,180,180),1.0f);
-
- ptTop.x += 1.0f;
- ptBottom.x += 1.0f;
-
- CPWL_Utils::DrawStrokeLine(pDevice, pUser2Device, ptTop, ptBottom,
- ArgbEncode(nTransparancy,210,210,210),1.0f);
- }
- else
- {
- CPWL_Utils::DrawFillRect(pDevice, pUser2Device, rcDraw, ArgbEncode(255,255,255,255));
- }
-
- //draw friction
-
- if (rectWnd.Height() > 8.0f)
- {
- FX_COLORREF crStroke = ArgbEncode(nTransparancy,120,120,120);
- if (!this->IsEnabled())
- crStroke = CPWL_Utils::PWLColorToFXColor(PWL_DEFAULT_HEAVYGRAYCOLOR,255);
-
- FX_FLOAT nFrictionWidth = 5.0f;
- FX_FLOAT nFrictionHeight = 5.5f;
-
- CPDF_Point ptLeft = CPDF_Point(ptCenter.x - nFrictionWidth / 2.0f, ptCenter.y - nFrictionHeight / 2.0f + 0.5f);
- CPDF_Point ptRight = CPDF_Point(ptCenter.x + nFrictionWidth / 2.0f, ptCenter.y - nFrictionHeight / 2.0f + 0.5f);
-
- CPWL_Utils::DrawStrokeLine(pDevice, pUser2Device, ptLeft, ptRight,
- crStroke,1.0f);
-
- ptLeft.y += 2.0f;
- ptRight.y += 2.0f;
-
- CPWL_Utils::DrawStrokeLine(pDevice, pUser2Device, ptLeft, ptRight,
- crStroke,1.0f);
-
- ptLeft.y += 2.0f;
- ptRight.y += 2.0f;
-
- CPWL_Utils::DrawStrokeLine(pDevice, pUser2Device, ptLeft, ptRight,
- crStroke,1.0f);
-
- /*
- ptLeft.y += 1.5f;
- ptRight.y += 1.5f;
-
- CPWL_Utils::DrawStrokeLine(pDevice, pUser2Device, ptLeft, ptRight,
- ArgbEncode(nTransparancy,150,150,150),1.0f);
- */
- }
- }
- break;
- default:
- break;
- }
- break;
- default:
- break;
- }
-}
-
-FX_BOOL CPWL_SBButton::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
-{
- CPWL_Wnd::OnLButtonDown(point,nFlag);
-
- if (CPWL_Wnd * pParent = GetParentWindow())
- pParent->OnNotify(this,PNM_LBUTTONDOWN,0,(FX_INTPTR)&point);
-
- m_bMouseDown = TRUE;
- SetCapture();
-
- return TRUE;
-}
-
-FX_BOOL CPWL_SBButton::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
-{
- CPWL_Wnd::OnLButtonUp(point,nFlag);
-
- if (CPWL_Wnd * pParent = GetParentWindow())
- pParent->OnNotify(this,PNM_LBUTTONUP,0,(FX_INTPTR)&point);
-
- m_bMouseDown = FALSE;
- ReleaseCapture();
-
- return TRUE;
-}
-
-FX_BOOL CPWL_SBButton::OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag)
-{
- CPWL_Wnd::OnMouseMove(point,nFlag);
-
- if (CPWL_Wnd * pParent = GetParentWindow())
- {
- pParent->OnNotify(this,PNM_MOUSEMOVE,0,(FX_INTPTR)&point);
-
- /*
- if (m_bMouseDown && (m_eSBButtonType == PSBT_MIN || m_eSBButtonType == PSBT_MAX))
- {
- if (!pParent->OnNotify(this,PNM_LBUTTONDOWN,nFlags,(FX_INTPTR)&point))
- return FALSE;
- }
- */
- }
-
- return TRUE;
-}
-
-/* ------------------------------- CPWL_ScrollBar ---------------------------------- */
-
-CPWL_ScrollBar::CPWL_ScrollBar(PWL_SCROLLBAR_TYPE sbType):
- m_sbType(sbType),
- m_pMinButton(NULL),
- m_pMaxButton(NULL),
- m_pPosButton(NULL),
- m_bMouseDown(FALSE),
- m_bMinOrMax(FALSE),
- m_bNotifyForever(TRUE)
-{
-}
-
-CPWL_ScrollBar::~CPWL_ScrollBar()
-{
-}
-
-CFX_ByteString CPWL_ScrollBar::GetClassName() const
-{
- return "CPWL_ScrollBar";
-}
-
-void CPWL_ScrollBar::OnCreate(PWL_CREATEPARAM & cp)
-{
- cp.eCursorType = FXCT_ARROW;
-}
-
-void CPWL_ScrollBar::RePosChildWnd()
-{
- CPDF_Rect rcClient = this->GetClientRect();
-
-/*
- switch(m_sbType)
- {
- case SBT_HSCROLL:
- if (rcClient.right - rcClient.left < PWL_SCROLLBAR_WIDTH ||
- rcClient.top - rcClient.bottom < PWL_SCROLLBAR_WIDTH)
- {
- SetVisible(FALSE);
- }
- break;
- case SBT_VSCROLL:
- if (rcClient.right - rcClient.left < PWL_SCROLLBAR_WIDTH ||
- rcClient.top - rcClient.bottom < PWL_SCROLLBAR_WIDTH)
- {
- SetVisible(FALSE);
- }
- break;
- }
-*/
- CPDF_Rect rcMinButton,rcMaxButton;
-
- FX_FLOAT fBWidth = 0;
-
- switch (m_sbType)
- {
- case SBT_HSCROLL:
- if (rcClient.right - rcClient.left > PWL_SCROLLBAR_BUTTON_WIDTH * 2 + PWL_SCROLLBAR_POSBUTTON_MINWIDTH + 2)
- {
- rcMinButton = CPDF_Rect(rcClient.left,rcClient.bottom,
- rcClient.left + PWL_SCROLLBAR_BUTTON_WIDTH,rcClient.top);
- rcMaxButton = CPDF_Rect(rcClient.right - PWL_SCROLLBAR_BUTTON_WIDTH,rcClient.bottom,
- rcClient.right,rcClient.top);
- }
- else
- {
- fBWidth = (rcClient.right - rcClient.left - PWL_SCROLLBAR_POSBUTTON_MINWIDTH - 2) / 2;
-
- if (fBWidth > 0)
- {
- rcMinButton = CPDF_Rect(rcClient.left,rcClient.bottom,
- rcClient.left + fBWidth,rcClient.top);
- rcMaxButton = CPDF_Rect(rcClient.right - fBWidth,rcClient.bottom,
- rcClient.right,rcClient.top);
- }
- else SetVisible(FALSE);
- }
- break;
- case SBT_VSCROLL:
- if (IsFloatBigger(rcClient.top - rcClient.bottom, PWL_SCROLLBAR_BUTTON_WIDTH * 2 + PWL_SCROLLBAR_POSBUTTON_MINWIDTH + 2))
- {
- rcMinButton = CPDF_Rect(rcClient.left,rcClient.top - PWL_SCROLLBAR_BUTTON_WIDTH,
- rcClient.right,rcClient.top);
- rcMaxButton = CPDF_Rect(rcClient.left,rcClient.bottom,
- rcClient.right,rcClient.bottom + PWL_SCROLLBAR_BUTTON_WIDTH);
- }
- else
- {
- fBWidth = (rcClient.top - rcClient.bottom - PWL_SCROLLBAR_POSBUTTON_MINWIDTH - 2) / 2;
-
- if (IsFloatBigger(fBWidth, 0))
- {
- rcMinButton = CPDF_Rect(rcClient.left,rcClient.top - fBWidth,
- rcClient.right,rcClient.top);
- rcMaxButton = CPDF_Rect(rcClient.left,rcClient.bottom,
- rcClient.right,rcClient.bottom + fBWidth);
- }
- else SetVisible(FALSE);
- }
- break;
- }
-
-// if (IsVisible())
- {
- if (m_pMinButton)
- m_pMinButton->Move(rcMinButton,TRUE,FALSE);
-
- if (m_pMaxButton)
- m_pMaxButton->Move(rcMaxButton,TRUE,FALSE);
-
- MovePosButton(FALSE);
- }
-}
-
-void CPWL_ScrollBar::GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream)
-{
- CPDF_Rect rectWnd = GetWindowRect();
-
- if (IsVisible() && !rectWnd.IsEmpty())
- {
- CFX_ByteTextBuf sButton;
-
- sButton << "q\n";
- sButton << "0 w\n" << CPWL_Utils::GetColorAppStream(GetBackgroundColor(),TRUE);
- sButton << rectWnd.left << " " << rectWnd.bottom << " "
- << rectWnd.right - rectWnd.left << " " << rectWnd.top - rectWnd.bottom << " re b Q\n";
-
- sAppStream << sButton;
- }
-}
-
-void CPWL_ScrollBar::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device)
-{
-// CPWL_Wnd::DrawThisAppearance(pDevice,pUser2Device);
- CPDF_Rect rectWnd = GetWindowRect();
-
- if (IsVisible() && !rectWnd.IsEmpty())
- {
- CPWL_Utils::DrawFillRect(pDevice, pUser2Device, rectWnd, this->GetBackgroundColor(), GetTransparency());
-
- CPWL_Utils::DrawStrokeLine(pDevice, pUser2Device,
- CPDF_Point(rectWnd.left+2.0f,rectWnd.top-2.0f), CPDF_Point(rectWnd.left+2.0f,rectWnd.bottom+2.0f),
- ArgbEncode(this->GetTransparency(),100,100,100),1.0f);
-
- CPWL_Utils::DrawStrokeLine(pDevice, pUser2Device,
- CPDF_Point(rectWnd.right-2.0f,rectWnd.top-2.0f), CPDF_Point(rectWnd.right-2.0f,rectWnd.bottom+2.0f),
- ArgbEncode(this->GetTransparency(),100,100,100),1.0f);
- }
-}
-
-FX_BOOL CPWL_ScrollBar::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
-{
- CPWL_Wnd::OnLButtonDown(point,nFlag);
-
- //SetFocus();
-
- if (HasFlag(PWS_AUTOTRANSPARENT))
- {
- if (GetTransparency() != 255)
- {
- SetTransparency(255);
- InvalidateRect();
- }
- }
-
- CPDF_Rect rcMinArea,rcMaxArea;
-
- if (m_pPosButton && m_pPosButton->IsVisible())
- {
- CPDF_Rect rcClient = this->GetClientRect();
- CPDF_Rect rcPosButton = m_pPosButton->GetWindowRect();
-
- switch (m_sbType)
- {
- case SBT_HSCROLL:
- rcMinArea = CPDF_Rect(rcClient.left + PWL_SCROLLBAR_BUTTON_WIDTH,rcClient.bottom,
- rcPosButton.left,rcClient.top);
- rcMaxArea = CPDF_Rect(rcPosButton.right,rcClient.bottom,
- rcClient.right - PWL_SCROLLBAR_BUTTON_WIDTH,rcClient.top);
-
- break;
- case SBT_VSCROLL:
- rcMinArea = CPDF_Rect(rcClient.left,rcPosButton.top,
- rcClient.right,rcClient.top - PWL_SCROLLBAR_BUTTON_WIDTH);
- rcMaxArea = CPDF_Rect(rcClient.left,rcClient.bottom + PWL_SCROLLBAR_BUTTON_WIDTH,
- rcClient.right,rcPosButton.bottom);
- break;
- }
-
- rcMinArea.Normalize();
- rcMaxArea.Normalize();
-
- if (rcMinArea.Contains(point.x,point.y))
- {
- m_sData.SubBig();
- MovePosButton(TRUE);
- NotifyScrollWindow();
- }
-
- if (rcMaxArea.Contains(point.x,point.y))
- {
- m_sData.AddBig();
- MovePosButton(TRUE);
- NotifyScrollWindow();
- }
- }
-
- return TRUE;
-}
-
-FX_BOOL CPWL_ScrollBar::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
-{
- CPWL_Wnd::OnLButtonUp(point,nFlag);
-
- if (HasFlag(PWS_AUTOTRANSPARENT))
- {
- if (GetTransparency() != PWL_SCROLLBAR_TRANSPARANCY)
- {
- SetTransparency(PWL_SCROLLBAR_TRANSPARANCY);
- InvalidateRect();
- }
- }
-
- EndTimer();
- m_bMouseDown = FALSE;
-
- return TRUE;
-}
-
-void CPWL_ScrollBar::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam, FX_INTPTR lParam)
-{
- CPWL_Wnd::OnNotify(pWnd,msg,wParam,lParam);
-
- switch (msg)
- {
- case PNM_LBUTTONDOWN:
- if (pWnd == m_pMinButton)
- {
- OnMinButtonLBDown(*(CPDF_Point*)lParam);
- }
-
- if (pWnd == m_pMaxButton)
- {
- OnMaxButtonLBDown(*(CPDF_Point*)lParam);
- }
-
- if (pWnd == m_pPosButton)
- {
- OnPosButtonLBDown(*(CPDF_Point*)lParam);
- }
- break;
- case PNM_LBUTTONUP:
- if (pWnd == m_pMinButton)
- {
- OnMinButtonLBUp(*(CPDF_Point*)lParam);
- }
-
- if (pWnd == m_pMaxButton)
- {
- OnMaxButtonLBUp(*(CPDF_Point*)lParam);
- }
-
- if (pWnd == m_pPosButton)
- {
- OnPosButtonLBUp(*(CPDF_Point*)lParam);
- }
- break;
- case PNM_MOUSEMOVE:
- if (pWnd == m_pMinButton)
- {
- OnMinButtonMouseMove(*(CPDF_Point*)lParam);
- }
-
- if (pWnd == m_pMaxButton)
- {
- OnMaxButtonMouseMove(*(CPDF_Point*)lParam);
- }
-
- if (pWnd == m_pPosButton)
- {
- OnPosButtonMouseMove(*(CPDF_Point*)lParam);
- }
- break;
- case PNM_SETSCROLLINFO:
- {
- if (PWL_SCROLL_INFO * pInfo = (PWL_SCROLL_INFO*)lParam)
- {
- if (FXSYS_memcmp(&m_OriginInfo, pInfo, sizeof(PWL_SCROLL_INFO)) != 0)
- {
- m_OriginInfo = *pInfo;
- FX_FLOAT fMax = pInfo->fContentMax - pInfo->fContentMin - pInfo->fPlateWidth;
- fMax = fMax > 0.0f ? fMax : 0.0f;
- this->SetScrollRange(0,fMax, pInfo->fPlateWidth);
- this->SetScrollStep(pInfo->fBigStep,pInfo->fSmallStep);
- }
- }
- }
- break;
- case PNM_SETSCROLLPOS:
- {
- FX_FLOAT fPos = *(FX_FLOAT*)lParam;
- switch (this->m_sbType)
- {
- case SBT_HSCROLL:
- fPos = fPos - m_OriginInfo.fContentMin;
- break;
- case SBT_VSCROLL:
- fPos = m_OriginInfo.fContentMax - fPos;
- break;
- }
- this->SetScrollPos(fPos);
- }
- break;
- }
-}
-
-void CPWL_ScrollBar::CreateButtons(const PWL_CREATEPARAM & cp)
-{
- PWL_CREATEPARAM scp = cp;
- scp.pParentWnd = this;
- scp.dwBorderWidth = 2;
- scp.nBorderStyle = PBS_BEVELED;
-
- scp.dwFlags = PWS_VISIBLE | PWS_CHILD | PWS_BORDER | PWS_BACKGROUND | PWS_NOREFRESHCLIP;
-
- if (!m_pMinButton)
- {
- m_pMinButton = new CPWL_SBButton(m_sbType,PSBT_MIN);
- m_pMinButton->Create(scp);
- }
-
- if (!m_pMaxButton)
- {
- m_pMaxButton = new CPWL_SBButton(m_sbType,PSBT_MAX);
- m_pMaxButton->Create(scp);
- }
-
- if (!m_pPosButton)
- {
- m_pPosButton = new CPWL_SBButton(m_sbType,PSBT_POS);
- m_pPosButton->SetVisible(FALSE);
- m_pPosButton->Create(scp);
- }
-}
-
-FX_FLOAT CPWL_ScrollBar::GetScrollBarWidth() const
-{
- if (!IsVisible()) return 0;
-
- return PWL_SCROLLBAR_WIDTH;
-}
-
-void CPWL_ScrollBar::SetScrollRange(FX_FLOAT fMin,FX_FLOAT fMax,FX_FLOAT fClientWidth)
-{
- if (m_pPosButton)
- {
- m_sData.SetScrollRange(fMin,fMax);
- m_sData.SetClientWidth(fClientWidth);
-
- if (IsFloatSmaller(m_sData.ScrollRange.GetWidth(), 0.0f))
- {
- m_pPosButton->SetVisible(FALSE);
- }
- else
- {
- m_pPosButton->SetVisible(TRUE);
- MovePosButton(TRUE);
- }
- }
-}
-
-void CPWL_ScrollBar::SetScrollPos(FX_FLOAT fPos)
-{
- FX_FLOAT fOldPos = m_sData.fScrollPos;
-
- m_sData.SetPos(fPos);
-
- if (!IsFloatEqual(m_sData.fScrollPos, fOldPos))
- MovePosButton(TRUE);
-}
-
-void CPWL_ScrollBar::SetScrollStep(FX_FLOAT fBigStep,FX_FLOAT fSmallStep)
-{
- m_sData.SetBigStep(fBigStep);
- m_sData.SetSmallStep(fSmallStep);
-}
-
-void CPWL_ScrollBar::MovePosButton(FX_BOOL bRefresh)
-{
- ASSERT (m_pPosButton != NULL);
- ASSERT (m_pMinButton != NULL);
- ASSERT (m_pMaxButton != NULL);
-
- if (m_pPosButton->IsVisible())
- {
-
-
-
-
- CPDF_Rect rcClient;
- CPDF_Rect rcPosArea,rcPosButton;
-
- rcClient = this->GetClientRect();
- rcPosArea = GetScrollArea();
-
- FX_FLOAT fLeft,fRight,fTop,fBottom;
-
- switch (m_sbType)
- {
- case SBT_HSCROLL:
- fLeft = TrueToFace(m_sData.fScrollPos);
- fRight = TrueToFace(m_sData.fScrollPos + m_sData.fClientWidth);
-
- if (fRight - fLeft < PWL_SCROLLBAR_POSBUTTON_MINWIDTH)
- fRight = fLeft + PWL_SCROLLBAR_POSBUTTON_MINWIDTH;
-
- if (fRight > rcPosArea.right)
- {
- fRight = rcPosArea.right;
- fLeft = fRight - PWL_SCROLLBAR_POSBUTTON_MINWIDTH;
- }
-
- rcPosButton = CPDF_Rect(fLeft ,
- rcPosArea.bottom,
- fRight ,
- rcPosArea.top);
-
- break;
- case SBT_VSCROLL:
- fBottom = TrueToFace(m_sData.fScrollPos + m_sData.fClientWidth);
- fTop = TrueToFace(m_sData.fScrollPos);
-
- if (IsFloatSmaller(fTop - fBottom, PWL_SCROLLBAR_POSBUTTON_MINWIDTH))
- fBottom = fTop - PWL_SCROLLBAR_POSBUTTON_MINWIDTH;
-
- if (IsFloatSmaller(fBottom, rcPosArea.bottom))
- {
- fBottom = rcPosArea.bottom;
- fTop = fBottom + PWL_SCROLLBAR_POSBUTTON_MINWIDTH;
- }
-
- rcPosButton = CPDF_Rect(rcPosArea.left,
- fBottom,
- rcPosArea.right,
- fTop);
-
- break;
- }
-
- m_pPosButton->Move(rcPosButton,TRUE,bRefresh);
- }
-}
-
-void CPWL_ScrollBar::OnMinButtonLBDown(const CPDF_Point & point)
-{
- m_sData.SubSmall();
- MovePosButton(TRUE);
- NotifyScrollWindow();
-
- m_bMinOrMax = TRUE;
-
- EndTimer();
- BeginTimer(100);
-}
-
-void CPWL_ScrollBar::OnMinButtonLBUp(const CPDF_Point & point)
-{
-}
-
-void CPWL_ScrollBar::OnMinButtonMouseMove(const CPDF_Point & point)
-{
-}
-
-void CPWL_ScrollBar::OnMaxButtonLBDown(const CPDF_Point & point)
-{
- m_sData.AddSmall();
- MovePosButton(TRUE);
- NotifyScrollWindow();
-
- m_bMinOrMax = FALSE;
-
- EndTimer();
- BeginTimer(100);
-}
-
-void CPWL_ScrollBar::OnMaxButtonLBUp(const CPDF_Point & point)
-{
-}
-
-void CPWL_ScrollBar::OnMaxButtonMouseMove(const CPDF_Point & point)
-{
-}
-
-void CPWL_ScrollBar::OnPosButtonLBDown(const CPDF_Point & point)
-{
- m_bMouseDown = TRUE;
-
- if (m_pPosButton)
- {
- CPDF_Rect rcPosButton = m_pPosButton->GetWindowRect();
-
- switch(m_sbType)
- {
- case SBT_HSCROLL:
- m_nOldPos = point.x;
- m_fOldPosButton = rcPosButton.left;
- break;
- case SBT_VSCROLL:
- m_nOldPos = point.y;
- m_fOldPosButton = rcPosButton.top;
- break;
- }
- }
-}
-
-void CPWL_ScrollBar::OnPosButtonLBUp(const CPDF_Point & point)
-{
- if (m_bMouseDown)
- {
- if (!m_bNotifyForever)
- NotifyScrollWindow();
- }
- m_bMouseDown = FALSE;
-}
-
-void CPWL_ScrollBar::OnPosButtonMouseMove(const CPDF_Point & point)
-{
- FX_FLOAT fOldScrollPos = m_sData.fScrollPos;
-
- FX_FLOAT fNewPos = 0;
-
- switch (m_sbType)
- {
- case SBT_HSCROLL:
- if (FXSYS_fabs(point.x - m_nOldPos) < 1) return;
- fNewPos = FaceToTrue(m_fOldPosButton + point.x - m_nOldPos);
- break;
- case SBT_VSCROLL:
- if (FXSYS_fabs(point.y - m_nOldPos) < 1) return;
- fNewPos = FaceToTrue(m_fOldPosButton + point.y - m_nOldPos);
- break;
- }
-
- if (m_bMouseDown)
- {
- switch (m_sbType)
- {
- case SBT_HSCROLL:
-
- if (IsFloatSmaller(fNewPos, m_sData.ScrollRange.fMin))
- {
- fNewPos = m_sData.ScrollRange.fMin;
- }
-
- if (IsFloatBigger(fNewPos, m_sData.ScrollRange.fMax))
- {
- fNewPos = m_sData.ScrollRange.fMax;
- }
-
- m_sData.SetPos(fNewPos);
-
- break;
- case SBT_VSCROLL:
-
- if (IsFloatSmaller(fNewPos, m_sData.ScrollRange.fMin))
- {
- fNewPos = m_sData.ScrollRange.fMin;
- }
-
- if (IsFloatBigger(fNewPos, m_sData.ScrollRange.fMax))
- {
- fNewPos = m_sData.ScrollRange.fMax;
- }
-
- m_sData.SetPos(fNewPos);
-
- break;
- }
-
- if (!IsFloatEqual(fOldScrollPos, m_sData.fScrollPos))
- {
- MovePosButton(TRUE);
-
- if (m_bNotifyForever)
- NotifyScrollWindow();
- }
- }
-}
-
-void CPWL_ScrollBar::NotifyScrollWindow()
-{
- if (CPWL_Wnd * pParent = this->GetParentWindow())
- {
- FX_FLOAT fPos;
- switch (this->m_sbType)
- {
- case SBT_HSCROLL:
- fPos = m_OriginInfo.fContentMin + m_sData.fScrollPos;
- break;
- case SBT_VSCROLL:
- fPos = m_OriginInfo.fContentMax - m_sData.fScrollPos;
- break;
- }
- pParent->OnNotify(this,PNM_SCROLLWINDOW,(FX_INTPTR)m_sbType,(FX_INTPTR)&fPos);
- }
-}
-
-CPDF_Rect CPWL_ScrollBar::GetScrollArea() const
-{
- CPDF_Rect rcClient = GetClientRect();
- CPDF_Rect rcArea;
-
- if (!m_pMinButton || !m_pMaxButton)return rcClient;
-
- CPDF_Rect rcMin = m_pMinButton->GetWindowRect();
- CPDF_Rect rcMax = m_pMaxButton->GetWindowRect();
-
- FX_FLOAT fMinWidth = rcMin.right - rcMin.left;
- FX_FLOAT fMinHeight = rcMin.top - rcMin.bottom;
- FX_FLOAT fMaxWidth = rcMax.right - rcMax.left;
- FX_FLOAT fMaxHeight = rcMax.top - rcMax.bottom;
-
- switch(m_sbType)
- {
- case SBT_HSCROLL:
- if (rcClient.right - rcClient.left > fMinWidth + fMaxWidth + 2)
- {
- rcArea = CPDF_Rect(rcClient.left + fMinWidth + 1,rcClient.bottom,
- rcClient.right - fMaxWidth - 1,rcClient.top);
- }
- else
- {
- rcArea = CPDF_Rect(rcClient.left + fMinWidth + 1,rcClient.bottom,
- rcClient.left + fMinWidth + 1,rcClient.top);
- }
- break;
- case SBT_VSCROLL:
- if (rcClient.top - rcClient.bottom > fMinHeight + fMaxHeight + 2)
- {
- rcArea = CPDF_Rect(rcClient.left,rcClient.bottom + fMinHeight + 1,
- rcClient.right,rcClient.top - fMaxHeight - 1);
- }
- else
- {
- rcArea = CPDF_Rect(rcClient.left,rcClient.bottom + fMinHeight + 1,
- rcClient.right,rcClient.bottom + fMinHeight + 1);
- }
- break;
- }
-
- rcArea.Normalize();
-
- return rcArea;
-}
-
-FX_FLOAT CPWL_ScrollBar::TrueToFace(FX_FLOAT fTrue)
-{
- CPDF_Rect rcPosArea;
- rcPosArea = GetScrollArea();
-
- FX_FLOAT fFactWidth = m_sData.ScrollRange.GetWidth() + m_sData.fClientWidth;
- fFactWidth = fFactWidth == 0 ? 1 : fFactWidth;
-
- FX_FLOAT fFace = 0;
-
- switch(m_sbType)
- {
- case SBT_HSCROLL:
- fFace = rcPosArea.left + fTrue * (rcPosArea.right - rcPosArea.left) / fFactWidth;
- break;
- case SBT_VSCROLL:
- fFace = rcPosArea.top - fTrue * (rcPosArea.top - rcPosArea.bottom) / fFactWidth;
- break;
- }
-
- return fFace;
-}
-
-FX_FLOAT CPWL_ScrollBar::FaceToTrue(FX_FLOAT fFace)
-{
- CPDF_Rect rcPosArea;
- rcPosArea = GetScrollArea();
-
- FX_FLOAT fFactWidth = m_sData.ScrollRange.GetWidth() + m_sData.fClientWidth;
- fFactWidth = fFactWidth == 0 ? 1 : fFactWidth;
-
- FX_FLOAT fTrue = 0;
-
- switch(m_sbType)
- {
- case SBT_HSCROLL:
- fTrue = (fFace - rcPosArea.left) * fFactWidth / (rcPosArea.right - rcPosArea.left);
- break;
- case SBT_VSCROLL:
- fTrue = (rcPosArea.top - fFace) * fFactWidth / (rcPosArea.top - rcPosArea.bottom);
- break;
- }
-
- return fTrue;
-}
-
-void CPWL_ScrollBar::CreateChildWnd(const PWL_CREATEPARAM & cp)
-{
- CreateButtons(cp);
-}
-
-void CPWL_ScrollBar::TimerProc()
-{
- PWL_SCROLL_PRIVATEDATA sTemp = m_sData;
-
- if (m_bMinOrMax)m_sData.SubSmall();
- else m_sData.AddSmall();
-
- if (FXSYS_memcmp(&m_sData, &sTemp, sizeof(PWL_SCROLL_PRIVATEDATA)) != 0)
- {
- MovePosButton(TRUE);
- NotifyScrollWindow();
- }
-}
-
-/*
-void CPWL_ScrollBar::OnSetFocus()
-{
- if (GetTransparency() != 255)
- {
- SetTransparency(255);
- InvalidateRect();
- }
-}
-
-void CPWL_ScrollBar::OnKillFocus()
-{
- if (GetTransparency() != PWL_SCROLLBAR_TRANSPARANCY)
- {
- SetTransparency(PWL_SCROLLBAR_TRANSPARANCY);
- InvalidateRect();
- }
-}
-*/
-
+// 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
+
+#include "../../include/pdfwindow/PDFWindow.h"
+#include "../../include/pdfwindow/PWL_Wnd.h"
+#include "../../include/pdfwindow/PWL_ScrollBar.h"
+#include "../../include/pdfwindow/PWL_Utils.h"
+
+#define IsFloatZero(f) ((f) < 0.0001 && (f) > -0.0001)
+#define IsFloatBigger(fa,fb) ((fa) > (fb) && !IsFloatZero((fa) - (fb)))
+#define IsFloatSmaller(fa,fb) ((fa) < (fb) && !IsFloatZero((fa) - (fb)))
+#define IsFloatEqual(fa,fb) IsFloatZero((fa)-(fb))
+
+
+/* ------------------------------- PWL_FLOATRANGE ------------------------------- */
+
+PWL_FLOATRANGE::PWL_FLOATRANGE()
+{
+ Default();
+}
+
+PWL_FLOATRANGE::PWL_FLOATRANGE(FX_FLOAT min,FX_FLOAT max)
+{
+ Set(min,max);
+}
+
+void PWL_FLOATRANGE::Default()
+{
+ fMin = 0;
+ fMax = 0;
+}
+
+void PWL_FLOATRANGE::Set(FX_FLOAT min,FX_FLOAT max)
+{
+ if (min > max)
+ {
+ fMin = max;
+ fMax = min;
+ }
+ else
+ {
+ fMin = min;
+ fMax = max;
+ }
+}
+
+FX_BOOL PWL_FLOATRANGE::In(FX_FLOAT x) const
+{
+ return (IsFloatBigger(x,fMin) || IsFloatEqual(x, fMin)) &&
+ (IsFloatSmaller(x, fMax) || IsFloatEqual(x, fMax));
+}
+
+FX_FLOAT PWL_FLOATRANGE::GetWidth() const
+{
+ return fMax - fMin;
+}
+
+/* ------------------------------- PWL_SCROLL_PRIVATEDATA ------------------------------- */
+
+PWL_SCROLL_PRIVATEDATA::PWL_SCROLL_PRIVATEDATA()
+{
+ Default();
+}
+
+void PWL_SCROLL_PRIVATEDATA::Default()
+{
+ ScrollRange.Default();
+ fScrollPos = ScrollRange.fMin;
+ fClientWidth = 0;
+ fBigStep = 10;
+ fSmallStep = 1;
+}
+
+void PWL_SCROLL_PRIVATEDATA::SetScrollRange(FX_FLOAT min,FX_FLOAT max)
+{
+ ScrollRange.Set(min,max);
+
+ if (IsFloatSmaller(fScrollPos, ScrollRange.fMin))
+ fScrollPos = ScrollRange.fMin;
+ if (IsFloatBigger(fScrollPos, ScrollRange.fMax))
+ fScrollPos = ScrollRange.fMax;
+}
+
+void PWL_SCROLL_PRIVATEDATA::SetClientWidth(FX_FLOAT width)
+{
+ fClientWidth = width;
+}
+
+void PWL_SCROLL_PRIVATEDATA::SetSmallStep(FX_FLOAT step)
+{
+ fSmallStep = step;
+}
+
+void PWL_SCROLL_PRIVATEDATA::SetBigStep(FX_FLOAT step)
+{
+ fBigStep = step;
+}
+
+FX_BOOL PWL_SCROLL_PRIVATEDATA::SetPos(FX_FLOAT pos)
+{
+ if (ScrollRange.In(pos))
+ {
+ fScrollPos = pos;
+ return TRUE;
+ }
+ return FALSE;
+}
+
+void PWL_SCROLL_PRIVATEDATA::AddSmall()
+{
+ if (!SetPos(fScrollPos + fSmallStep))
+ SetPos(ScrollRange.fMax);
+}
+
+void PWL_SCROLL_PRIVATEDATA::SubSmall()
+{
+ if (!SetPos(fScrollPos - fSmallStep))
+ SetPos(ScrollRange.fMin);
+}
+
+void PWL_SCROLL_PRIVATEDATA::AddBig()
+{
+ if (!SetPos(fScrollPos + fBigStep))
+ SetPos(ScrollRange.fMax);
+}
+
+void PWL_SCROLL_PRIVATEDATA::SubBig()
+{
+ if (!SetPos(fScrollPos - fBigStep))
+ SetPos(ScrollRange.fMin);
+}
+
+/* ------------------------------- CPWL_SBButton ------------------------------- */
+
+CPWL_SBButton::CPWL_SBButton(PWL_SCROLLBAR_TYPE eScrollBarType,PWL_SBBUTTON_TYPE eButtonType)
+{
+ m_eScrollBarType = eScrollBarType;
+ m_eSBButtonType = eButtonType;
+
+ m_bMouseDown = FALSE;
+}
+
+CPWL_SBButton::~CPWL_SBButton()
+{
+
+}
+
+CFX_ByteString CPWL_SBButton::GetClassName() const
+{
+ return "CPWL_SBButton";
+}
+
+void CPWL_SBButton::OnCreate(PWL_CREATEPARAM & cp)
+{
+ cp.eCursorType = FXCT_ARROW;
+}
+
+void CPWL_SBButton::GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream)
+{
+ CPWL_Wnd::GetThisAppearanceStream(sAppStream);
+
+ if (!IsVisible()) return;
+
+ CFX_ByteTextBuf sButton;
+
+ CPDF_Rect rectWnd = GetWindowRect();
+
+ if (rectWnd.IsEmpty()) return;
+
+ sAppStream << "q\n";
+
+ CPDF_Point ptCenter = this->GetCenterPoint();
+
+ switch (this->m_eScrollBarType)
+ {
+ case SBT_HSCROLL:
+ switch (this->m_eSBButtonType)
+ {
+ case PSBT_MIN:
+ {
+ CPDF_Point pt1(ptCenter.x - PWL_TRIANGLE_HALFLEN * 0.5f,ptCenter.y);
+ CPDF_Point pt2(ptCenter.x + PWL_TRIANGLE_HALFLEN * 0.5f,ptCenter.y + PWL_TRIANGLE_HALFLEN);
+ CPDF_Point pt3(ptCenter.x + PWL_TRIANGLE_HALFLEN * 0.5f,ptCenter.y - PWL_TRIANGLE_HALFLEN);
+
+ if (rectWnd.right - rectWnd.left > PWL_TRIANGLE_HALFLEN * 2 &&
+ rectWnd.top - rectWnd.bottom > PWL_TRIANGLE_HALFLEN )
+ {
+ sButton << "0 g\n";
+ sButton << pt1.x << " " << pt1.y << " m\n";
+ sButton << pt2.x << " " << pt2.y << " l\n";
+ sButton << pt3.x << " " << pt3.y << " l\n";
+ sButton << pt1.x << " " << pt1.y << " l f\n";
+
+ sAppStream << sButton;
+ }
+ }
+ break;
+ case PSBT_MAX:
+ {
+ CPDF_Point pt1(ptCenter.x + PWL_TRIANGLE_HALFLEN * 0.5f,ptCenter.y);
+ CPDF_Point pt2(ptCenter.x - PWL_TRIANGLE_HALFLEN * 0.5f,ptCenter.y + PWL_TRIANGLE_HALFLEN);
+ CPDF_Point pt3(ptCenter.x - PWL_TRIANGLE_HALFLEN * 0.5f,ptCenter.y - PWL_TRIANGLE_HALFLEN);
+
+ if (rectWnd.right - rectWnd.left > PWL_TRIANGLE_HALFLEN * 2 &&
+ rectWnd.top - rectWnd.bottom > PWL_TRIANGLE_HALFLEN )
+ {
+ sButton << "0 g\n";
+ sButton << pt1.x << " " << pt1.y << " m\n";
+ sButton << pt2.x << " " << pt2.y << " l\n";
+ sButton << pt3.x << " " << pt3.y << " l\n";
+ sButton << pt1.x << " " << pt1.y << " l f\n";
+
+ sAppStream << sButton;
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ break;
+ case SBT_VSCROLL:
+ switch(this->m_eSBButtonType)
+ {
+ case PSBT_MIN:
+ {
+ CPDF_Point pt1(ptCenter.x - PWL_TRIANGLE_HALFLEN,ptCenter.y - PWL_TRIANGLE_HALFLEN * 0.5f);
+ CPDF_Point pt2(ptCenter.x + PWL_TRIANGLE_HALFLEN,ptCenter.y - PWL_TRIANGLE_HALFLEN * 0.5f);
+ CPDF_Point pt3(ptCenter.x,ptCenter.y + PWL_TRIANGLE_HALFLEN * 0.5f);
+
+ if (rectWnd.right - rectWnd.left > PWL_TRIANGLE_HALFLEN * 2 &&
+ rectWnd.top - rectWnd.bottom > PWL_TRIANGLE_HALFLEN )
+ {
+ sButton << "0 g\n";
+ sButton << pt1.x << " " << pt1.y << " m\n";
+ sButton << pt2.x << " " << pt2.y << " l\n";
+ sButton << pt3.x << " " << pt3.y << " l\n";
+ sButton << pt1.x << " " << pt1.y << " l f\n";
+
+ sAppStream << sButton;
+ }
+ }
+ break;
+ case PSBT_MAX:
+ {
+ CPDF_Point pt1(ptCenter.x - PWL_TRIANGLE_HALFLEN,ptCenter.y + PWL_TRIANGLE_HALFLEN * 0.5f);
+ CPDF_Point pt2(ptCenter.x + PWL_TRIANGLE_HALFLEN,ptCenter.y + PWL_TRIANGLE_HALFLEN * 0.5f);
+ CPDF_Point pt3(ptCenter.x,ptCenter.y - PWL_TRIANGLE_HALFLEN * 0.5f);
+
+ if (rectWnd.right - rectWnd.left > PWL_TRIANGLE_HALFLEN * 2 &&
+ rectWnd.top - rectWnd.bottom > PWL_TRIANGLE_HALFLEN )
+ {
+ sButton << "0 g\n";
+ sButton << pt1.x << " " << pt1.y << " m\n";
+ sButton << pt2.x << " " << pt2.y << " l\n";
+ sButton << pt3.x << " " << pt3.y << " l\n";
+ sButton << pt1.x << " " << pt1.y << " l f\n";
+
+ sAppStream << sButton;
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ break;
+ default:
+ break;
+ }
+
+ sAppStream << "Q\n";
+}
+
+void CPWL_SBButton::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device)
+{
+ if (!IsVisible()) return;
+
+ CPDF_Rect rectWnd = GetWindowRect();
+ if (rectWnd.IsEmpty()) return;
+
+ CPDF_Point ptCenter = this->GetCenterPoint();
+ FX_INT32 nTransparancy = this->GetTransparency();
+
+ switch (this->m_eScrollBarType)
+ {
+ case SBT_HSCROLL:
+ CPWL_Wnd::DrawThisAppearance(pDevice,pUser2Device);
+ switch (this->m_eSBButtonType)
+ {
+ case PSBT_MIN:
+ {
+ CPDF_Point pt1(ptCenter.x - PWL_TRIANGLE_HALFLEN * 0.5f,ptCenter.y);
+ CPDF_Point pt2(ptCenter.x + PWL_TRIANGLE_HALFLEN * 0.5f,ptCenter.y + PWL_TRIANGLE_HALFLEN);
+ CPDF_Point pt3(ptCenter.x + PWL_TRIANGLE_HALFLEN * 0.5f,ptCenter.y - PWL_TRIANGLE_HALFLEN);
+
+ if (rectWnd.right - rectWnd.left > PWL_TRIANGLE_HALFLEN * 2 &&
+ rectWnd.top - rectWnd.bottom > PWL_TRIANGLE_HALFLEN )
+ {
+ CFX_PathData path;
+
+ path.SetPointCount(4);
+ path.SetPoint(0, pt1.x, pt1.y, FXPT_MOVETO);
+ path.SetPoint(1, pt2.x, pt2.y, FXPT_LINETO);
+ path.SetPoint(2, pt3.x, pt3.y, FXPT_LINETO);
+ path.SetPoint(3, pt1.x, pt1.y, FXPT_LINETO);
+
+ pDevice->DrawPath(&path, pUser2Device, NULL,
+ CPWL_Utils::PWLColorToFXColor(PWL_DEFAULT_BLACKCOLOR,nTransparancy),
+ 0, FXFILL_ALTERNATE);
+ }
+ }
+ break;
+ case PSBT_MAX:
+ {
+ CPDF_Point pt1(ptCenter.x + PWL_TRIANGLE_HALFLEN * 0.5f,ptCenter.y);
+ CPDF_Point pt2(ptCenter.x - PWL_TRIANGLE_HALFLEN * 0.5f,ptCenter.y + PWL_TRIANGLE_HALFLEN);
+ CPDF_Point pt3(ptCenter.x - PWL_TRIANGLE_HALFLEN * 0.5f,ptCenter.y - PWL_TRIANGLE_HALFLEN);
+
+ if (rectWnd.right - rectWnd.left > PWL_TRIANGLE_HALFLEN * 2 &&
+ rectWnd.top - rectWnd.bottom > PWL_TRIANGLE_HALFLEN )
+ {
+ CFX_PathData path;
+
+ path.SetPointCount(4);
+ path.SetPoint(0, pt1.x, pt1.y, FXPT_MOVETO);
+ path.SetPoint(1, pt2.x, pt2.y, FXPT_LINETO);
+ path.SetPoint(2, pt3.x, pt3.y, FXPT_LINETO);
+ path.SetPoint(3, pt1.x, pt1.y, FXPT_LINETO);
+
+ pDevice->DrawPath(&path, pUser2Device, NULL,
+ CPWL_Utils::PWLColorToFXColor(PWL_DEFAULT_BLACKCOLOR,nTransparancy),
+ 0, FXFILL_ALTERNATE);
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ break;
+ case SBT_VSCROLL:
+ switch(this->m_eSBButtonType)
+ {
+ case PSBT_MIN:
+ {
+ //draw border
+ CPDF_Rect rcDraw = rectWnd;
+ CPWL_Utils::DrawStrokeRect(pDevice, pUser2Device, rcDraw,
+ ArgbEncode(nTransparancy,100,100,100),0.0f);
+
+ //draw inner border
+ rcDraw = CPWL_Utils::DeflateRect(rectWnd,0.5f);
+ CPWL_Utils::DrawStrokeRect(pDevice, pUser2Device, rcDraw,
+ ArgbEncode(nTransparancy,255,255,255),1.0f);
+
+ //draw background
+
+ rcDraw = CPWL_Utils::DeflateRect(rectWnd,1.0f);
+
+ if (this->IsEnabled())
+ CPWL_Utils::DrawShadow(pDevice, pUser2Device, TRUE, FALSE, rcDraw, nTransparancy, 80, 220);
+ else
+ CPWL_Utils::DrawFillRect(pDevice, pUser2Device, rcDraw, ArgbEncode(255,255,255,255));
+
+ //draw arrow
+
+ if (rectWnd.top - rectWnd.bottom > 6.0f )
+ {
+ FX_FLOAT fX = rectWnd.left + 1.5f;
+ FX_FLOAT fY = rectWnd.bottom;
+ CPDF_Point pts[7] = {
+ CPDF_Point(fX+2.5f, fY+4.0f),
+ CPDF_Point(fX+2.5f, fY+3.0f),
+ CPDF_Point(fX+4.5f, fY+5.0f),
+ CPDF_Point(fX+6.5f, fY+3.0f),
+ CPDF_Point(fX+6.5f, fY+4.0f),
+ CPDF_Point(fX+4.5f, fY+6.0f),
+ CPDF_Point(fX+2.5f, fY+4.0f)};
+
+
+ if (this->IsEnabled())
+ CPWL_Utils::DrawFillArea(pDevice, pUser2Device, pts, 7, ArgbEncode(nTransparancy,255,255,255));
+ else
+ CPWL_Utils::DrawFillArea(pDevice, pUser2Device, pts, 7,
+ CPWL_Utils::PWLColorToFXColor(PWL_DEFAULT_HEAVYGRAYCOLOR,255));
+ }
+ }
+ break;
+ case PSBT_MAX:
+ {
+ //draw border
+ CPDF_Rect rcDraw = rectWnd;
+ CPWL_Utils::DrawStrokeRect(pDevice, pUser2Device, rcDraw,
+ ArgbEncode(nTransparancy,100,100,100),0.0f);
+
+ //draw inner border
+ rcDraw = CPWL_Utils::DeflateRect(rectWnd,0.5f);
+ CPWL_Utils::DrawStrokeRect(pDevice, pUser2Device, rcDraw,
+ ArgbEncode(nTransparancy,255,255,255),1.0f);
+
+ //draw background
+ rcDraw = CPWL_Utils::DeflateRect(rectWnd,1.0f);
+ if (this->IsEnabled())
+ CPWL_Utils::DrawShadow(pDevice, pUser2Device, TRUE, FALSE, rcDraw, nTransparancy, 80, 220);
+ else
+ CPWL_Utils::DrawFillRect(pDevice, pUser2Device, rcDraw, ArgbEncode(255,255,255,255));
+
+ //draw arrow
+
+ if (rectWnd.top - rectWnd.bottom > 6.0f )
+ {
+ FX_FLOAT fX = rectWnd.left + 1.5f;
+ FX_FLOAT fY = rectWnd.bottom;
+
+ CPDF_Point pts[7] = {
+ CPDF_Point(fX+2.5f, fY+5.0f),
+ CPDF_Point(fX+2.5f, fY+6.0f),
+ CPDF_Point(fX+4.5f, fY+4.0f),
+ CPDF_Point(fX+6.5f, fY+6.0f),
+ CPDF_Point(fX+6.5f, fY+5.0f),
+ CPDF_Point(fX+4.5f, fY+3.0f),
+ CPDF_Point(fX+2.5f, fY+5.0f)};
+
+
+ if (this->IsEnabled())
+ CPWL_Utils::DrawFillArea(pDevice, pUser2Device, pts, 7, ArgbEncode(nTransparancy,255,255,255));
+ else
+ CPWL_Utils::DrawFillArea(pDevice, pUser2Device, pts, 7,
+ CPWL_Utils::PWLColorToFXColor(PWL_DEFAULT_HEAVYGRAYCOLOR,255));
+ }
+ }
+ break;
+ case PSBT_POS:
+ {
+ //CPWL_Wnd::DrawThisAppearance(pDevice,pUser2Device);
+
+ //draw border
+ CPDF_Rect rcDraw = rectWnd;
+ CPWL_Utils::DrawStrokeRect(pDevice, pUser2Device, rcDraw,
+ ArgbEncode(nTransparancy,100,100,100),0.0f);
+
+ //draw inner border
+ rcDraw = CPWL_Utils::DeflateRect(rectWnd,0.5f);
+ CPWL_Utils::DrawStrokeRect(pDevice, pUser2Device, rcDraw,
+ ArgbEncode(nTransparancy,255,255,255),1.0f);
+
+ if (this->IsEnabled())
+ {
+ //draw shadow effect
+
+ CPDF_Point ptTop = CPDF_Point(rectWnd.left,rectWnd.top-1.0f);
+ CPDF_Point ptBottom = CPDF_Point(rectWnd.left,rectWnd.bottom+1.0f);
+
+ ptTop.x += 1.5f;
+ ptBottom.x += 1.5f;
+
+ CPWL_Utils::DrawStrokeLine(pDevice, pUser2Device, ptTop, ptBottom,
+ ArgbEncode(nTransparancy,210,210,210),1.0f);
+
+ ptTop.x += 1.0f;
+ ptBottom.x += 1.0f;
+
+ CPWL_Utils::DrawStrokeLine(pDevice, pUser2Device, ptTop, ptBottom,
+ ArgbEncode(nTransparancy,220,220,220),1.0f);
+
+ ptTop.x += 1.0f;
+ ptBottom.x += 1.0f;
+
+ CPWL_Utils::DrawStrokeLine(pDevice, pUser2Device, ptTop, ptBottom,
+ ArgbEncode(nTransparancy,240,240,240),1.0f);
+
+ ptTop.x += 1.0f;
+ ptBottom.x += 1.0f;
+
+ CPWL_Utils::DrawStrokeLine(pDevice, pUser2Device, ptTop, ptBottom,
+ ArgbEncode(nTransparancy,240,240,240),1.0f);
+
+ ptTop.x += 1.0f;
+ ptBottom.x += 1.0f;
+
+ CPWL_Utils::DrawStrokeLine(pDevice, pUser2Device, ptTop, ptBottom,
+ ArgbEncode(nTransparancy,210,210,210),1.0f);
+
+ ptTop.x += 1.0f;
+ ptBottom.x += 1.0f;
+
+ CPWL_Utils::DrawStrokeLine(pDevice, pUser2Device, ptTop, ptBottom,
+ ArgbEncode(nTransparancy,180,180,180),1.0f);
+
+ ptTop.x += 1.0f;
+ ptBottom.x += 1.0f;
+
+ CPWL_Utils::DrawStrokeLine(pDevice, pUser2Device, ptTop, ptBottom,
+ ArgbEncode(nTransparancy,150,150,150),1.0f);
+
+ ptTop.x += 1.0f;
+ ptBottom.x += 1.0f;
+
+ CPWL_Utils::DrawStrokeLine(pDevice, pUser2Device, ptTop, ptBottom,
+ ArgbEncode(nTransparancy,150,150,150),1.0f);
+
+ ptTop.x += 1.0f;
+ ptBottom.x += 1.0f;
+
+ CPWL_Utils::DrawStrokeLine(pDevice, pUser2Device, ptTop, ptBottom,
+ ArgbEncode(nTransparancy,180,180,180),1.0f);
+
+ ptTop.x += 1.0f;
+ ptBottom.x += 1.0f;
+
+ CPWL_Utils::DrawStrokeLine(pDevice, pUser2Device, ptTop, ptBottom,
+ ArgbEncode(nTransparancy,210,210,210),1.0f);
+ }
+ else
+ {
+ CPWL_Utils::DrawFillRect(pDevice, pUser2Device, rcDraw, ArgbEncode(255,255,255,255));
+ }
+
+ //draw friction
+
+ if (rectWnd.Height() > 8.0f)
+ {
+ FX_COLORREF crStroke = ArgbEncode(nTransparancy,120,120,120);
+ if (!this->IsEnabled())
+ crStroke = CPWL_Utils::PWLColorToFXColor(PWL_DEFAULT_HEAVYGRAYCOLOR,255);
+
+ FX_FLOAT nFrictionWidth = 5.0f;
+ FX_FLOAT nFrictionHeight = 5.5f;
+
+ CPDF_Point ptLeft = CPDF_Point(ptCenter.x - nFrictionWidth / 2.0f, ptCenter.y - nFrictionHeight / 2.0f + 0.5f);
+ CPDF_Point ptRight = CPDF_Point(ptCenter.x + nFrictionWidth / 2.0f, ptCenter.y - nFrictionHeight / 2.0f + 0.5f);
+
+ CPWL_Utils::DrawStrokeLine(pDevice, pUser2Device, ptLeft, ptRight,
+ crStroke,1.0f);
+
+ ptLeft.y += 2.0f;
+ ptRight.y += 2.0f;
+
+ CPWL_Utils::DrawStrokeLine(pDevice, pUser2Device, ptLeft, ptRight,
+ crStroke,1.0f);
+
+ ptLeft.y += 2.0f;
+ ptRight.y += 2.0f;
+
+ CPWL_Utils::DrawStrokeLine(pDevice, pUser2Device, ptLeft, ptRight,
+ crStroke,1.0f);
+
+ /*
+ ptLeft.y += 1.5f;
+ ptRight.y += 1.5f;
+
+ CPWL_Utils::DrawStrokeLine(pDevice, pUser2Device, ptLeft, ptRight,
+ ArgbEncode(nTransparancy,150,150,150),1.0f);
+ */
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ break;
+ default:
+ break;
+ }
+}
+
+FX_BOOL CPWL_SBButton::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
+{
+ CPWL_Wnd::OnLButtonDown(point,nFlag);
+
+ if (CPWL_Wnd * pParent = GetParentWindow())
+ pParent->OnNotify(this,PNM_LBUTTONDOWN,0,(FX_INTPTR)&point);
+
+ m_bMouseDown = TRUE;
+ SetCapture();
+
+ return TRUE;
+}
+
+FX_BOOL CPWL_SBButton::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
+{
+ CPWL_Wnd::OnLButtonUp(point,nFlag);
+
+ if (CPWL_Wnd * pParent = GetParentWindow())
+ pParent->OnNotify(this,PNM_LBUTTONUP,0,(FX_INTPTR)&point);
+
+ m_bMouseDown = FALSE;
+ ReleaseCapture();
+
+ return TRUE;
+}
+
+FX_BOOL CPWL_SBButton::OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag)
+{
+ CPWL_Wnd::OnMouseMove(point,nFlag);
+
+ if (CPWL_Wnd * pParent = GetParentWindow())
+ {
+ pParent->OnNotify(this,PNM_MOUSEMOVE,0,(FX_INTPTR)&point);
+
+ /*
+ if (m_bMouseDown && (m_eSBButtonType == PSBT_MIN || m_eSBButtonType == PSBT_MAX))
+ {
+ if (!pParent->OnNotify(this,PNM_LBUTTONDOWN,nFlags,(FX_INTPTR)&point))
+ return FALSE;
+ }
+ */
+ }
+
+ return TRUE;
+}
+
+/* ------------------------------- CPWL_ScrollBar ---------------------------------- */
+
+CPWL_ScrollBar::CPWL_ScrollBar(PWL_SCROLLBAR_TYPE sbType):
+ m_sbType(sbType),
+ m_pMinButton(NULL),
+ m_pMaxButton(NULL),
+ m_pPosButton(NULL),
+ m_bMouseDown(FALSE),
+ m_bMinOrMax(FALSE),
+ m_bNotifyForever(TRUE)
+{
+}
+
+CPWL_ScrollBar::~CPWL_ScrollBar()
+{
+}
+
+CFX_ByteString CPWL_ScrollBar::GetClassName() const
+{
+ return "CPWL_ScrollBar";
+}
+
+void CPWL_ScrollBar::OnCreate(PWL_CREATEPARAM & cp)
+{
+ cp.eCursorType = FXCT_ARROW;
+}
+
+void CPWL_ScrollBar::RePosChildWnd()
+{
+ CPDF_Rect rcClient = this->GetClientRect();
+
+/*
+ switch(m_sbType)
+ {
+ case SBT_HSCROLL:
+ if (rcClient.right - rcClient.left < PWL_SCROLLBAR_WIDTH ||
+ rcClient.top - rcClient.bottom < PWL_SCROLLBAR_WIDTH)
+ {
+ SetVisible(FALSE);
+ }
+ break;
+ case SBT_VSCROLL:
+ if (rcClient.right - rcClient.left < PWL_SCROLLBAR_WIDTH ||
+ rcClient.top - rcClient.bottom < PWL_SCROLLBAR_WIDTH)
+ {
+ SetVisible(FALSE);
+ }
+ break;
+ }
+*/
+ CPDF_Rect rcMinButton,rcMaxButton;
+
+ FX_FLOAT fBWidth = 0;
+
+ switch (m_sbType)
+ {
+ case SBT_HSCROLL:
+ if (rcClient.right - rcClient.left > PWL_SCROLLBAR_BUTTON_WIDTH * 2 + PWL_SCROLLBAR_POSBUTTON_MINWIDTH + 2)
+ {
+ rcMinButton = CPDF_Rect(rcClient.left,rcClient.bottom,
+ rcClient.left + PWL_SCROLLBAR_BUTTON_WIDTH,rcClient.top);
+ rcMaxButton = CPDF_Rect(rcClient.right - PWL_SCROLLBAR_BUTTON_WIDTH,rcClient.bottom,
+ rcClient.right,rcClient.top);
+ }
+ else
+ {
+ fBWidth = (rcClient.right - rcClient.left - PWL_SCROLLBAR_POSBUTTON_MINWIDTH - 2) / 2;
+
+ if (fBWidth > 0)
+ {
+ rcMinButton = CPDF_Rect(rcClient.left,rcClient.bottom,
+ rcClient.left + fBWidth,rcClient.top);
+ rcMaxButton = CPDF_Rect(rcClient.right - fBWidth,rcClient.bottom,
+ rcClient.right,rcClient.top);
+ }
+ else SetVisible(FALSE);
+ }
+ break;
+ case SBT_VSCROLL:
+ if (IsFloatBigger(rcClient.top - rcClient.bottom, PWL_SCROLLBAR_BUTTON_WIDTH * 2 + PWL_SCROLLBAR_POSBUTTON_MINWIDTH + 2))
+ {
+ rcMinButton = CPDF_Rect(rcClient.left,rcClient.top - PWL_SCROLLBAR_BUTTON_WIDTH,
+ rcClient.right,rcClient.top);
+ rcMaxButton = CPDF_Rect(rcClient.left,rcClient.bottom,
+ rcClient.right,rcClient.bottom + PWL_SCROLLBAR_BUTTON_WIDTH);
+ }
+ else
+ {
+ fBWidth = (rcClient.top - rcClient.bottom - PWL_SCROLLBAR_POSBUTTON_MINWIDTH - 2) / 2;
+
+ if (IsFloatBigger(fBWidth, 0))
+ {
+ rcMinButton = CPDF_Rect(rcClient.left,rcClient.top - fBWidth,
+ rcClient.right,rcClient.top);
+ rcMaxButton = CPDF_Rect(rcClient.left,rcClient.bottom,
+ rcClient.right,rcClient.bottom + fBWidth);
+ }
+ else SetVisible(FALSE);
+ }
+ break;
+ }
+
+// if (IsVisible())
+ {
+ if (m_pMinButton)
+ m_pMinButton->Move(rcMinButton,TRUE,FALSE);
+
+ if (m_pMaxButton)
+ m_pMaxButton->Move(rcMaxButton,TRUE,FALSE);
+
+ MovePosButton(FALSE);
+ }
+}
+
+void CPWL_ScrollBar::GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream)
+{
+ CPDF_Rect rectWnd = GetWindowRect();
+
+ if (IsVisible() && !rectWnd.IsEmpty())
+ {
+ CFX_ByteTextBuf sButton;
+
+ sButton << "q\n";
+ sButton << "0 w\n" << CPWL_Utils::GetColorAppStream(GetBackgroundColor(),TRUE);
+ sButton << rectWnd.left << " " << rectWnd.bottom << " "
+ << rectWnd.right - rectWnd.left << " " << rectWnd.top - rectWnd.bottom << " re b Q\n";
+
+ sAppStream << sButton;
+ }
+}
+
+void CPWL_ScrollBar::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device)
+{
+// CPWL_Wnd::DrawThisAppearance(pDevice,pUser2Device);
+ CPDF_Rect rectWnd = GetWindowRect();
+
+ if (IsVisible() && !rectWnd.IsEmpty())
+ {
+ CPWL_Utils::DrawFillRect(pDevice, pUser2Device, rectWnd, this->GetBackgroundColor(), GetTransparency());
+
+ CPWL_Utils::DrawStrokeLine(pDevice, pUser2Device,
+ CPDF_Point(rectWnd.left+2.0f,rectWnd.top-2.0f), CPDF_Point(rectWnd.left+2.0f,rectWnd.bottom+2.0f),
+ ArgbEncode(this->GetTransparency(),100,100,100),1.0f);
+
+ CPWL_Utils::DrawStrokeLine(pDevice, pUser2Device,
+ CPDF_Point(rectWnd.right-2.0f,rectWnd.top-2.0f), CPDF_Point(rectWnd.right-2.0f,rectWnd.bottom+2.0f),
+ ArgbEncode(this->GetTransparency(),100,100,100),1.0f);
+ }
+}
+
+FX_BOOL CPWL_ScrollBar::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
+{
+ CPWL_Wnd::OnLButtonDown(point,nFlag);
+
+ //SetFocus();
+
+ if (HasFlag(PWS_AUTOTRANSPARENT))
+ {
+ if (GetTransparency() != 255)
+ {
+ SetTransparency(255);
+ InvalidateRect();
+ }
+ }
+
+ CPDF_Rect rcMinArea,rcMaxArea;
+
+ if (m_pPosButton && m_pPosButton->IsVisible())
+ {
+ CPDF_Rect rcClient = this->GetClientRect();
+ CPDF_Rect rcPosButton = m_pPosButton->GetWindowRect();
+
+ switch (m_sbType)
+ {
+ case SBT_HSCROLL:
+ rcMinArea = CPDF_Rect(rcClient.left + PWL_SCROLLBAR_BUTTON_WIDTH,rcClient.bottom,
+ rcPosButton.left,rcClient.top);
+ rcMaxArea = CPDF_Rect(rcPosButton.right,rcClient.bottom,
+ rcClient.right - PWL_SCROLLBAR_BUTTON_WIDTH,rcClient.top);
+
+ break;
+ case SBT_VSCROLL:
+ rcMinArea = CPDF_Rect(rcClient.left,rcPosButton.top,
+ rcClient.right,rcClient.top - PWL_SCROLLBAR_BUTTON_WIDTH);
+ rcMaxArea = CPDF_Rect(rcClient.left,rcClient.bottom + PWL_SCROLLBAR_BUTTON_WIDTH,
+ rcClient.right,rcPosButton.bottom);
+ break;
+ }
+
+ rcMinArea.Normalize();
+ rcMaxArea.Normalize();
+
+ if (rcMinArea.Contains(point.x,point.y))
+ {
+ m_sData.SubBig();
+ MovePosButton(TRUE);
+ NotifyScrollWindow();
+ }
+
+ if (rcMaxArea.Contains(point.x,point.y))
+ {
+ m_sData.AddBig();
+ MovePosButton(TRUE);
+ NotifyScrollWindow();
+ }
+ }
+
+ return TRUE;
+}
+
+FX_BOOL CPWL_ScrollBar::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
+{
+ CPWL_Wnd::OnLButtonUp(point,nFlag);
+
+ if (HasFlag(PWS_AUTOTRANSPARENT))
+ {
+ if (GetTransparency() != PWL_SCROLLBAR_TRANSPARANCY)
+ {
+ SetTransparency(PWL_SCROLLBAR_TRANSPARANCY);
+ InvalidateRect();
+ }
+ }
+
+ EndTimer();
+ m_bMouseDown = FALSE;
+
+ return TRUE;
+}
+
+void CPWL_ScrollBar::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam, FX_INTPTR lParam)
+{
+ CPWL_Wnd::OnNotify(pWnd,msg,wParam,lParam);
+
+ switch (msg)
+ {
+ case PNM_LBUTTONDOWN:
+ if (pWnd == m_pMinButton)
+ {
+ OnMinButtonLBDown(*(CPDF_Point*)lParam);
+ }
+
+ if (pWnd == m_pMaxButton)
+ {
+ OnMaxButtonLBDown(*(CPDF_Point*)lParam);
+ }
+
+ if (pWnd == m_pPosButton)
+ {
+ OnPosButtonLBDown(*(CPDF_Point*)lParam);
+ }
+ break;
+ case PNM_LBUTTONUP:
+ if (pWnd == m_pMinButton)
+ {
+ OnMinButtonLBUp(*(CPDF_Point*)lParam);
+ }
+
+ if (pWnd == m_pMaxButton)
+ {
+ OnMaxButtonLBUp(*(CPDF_Point*)lParam);
+ }
+
+ if (pWnd == m_pPosButton)
+ {
+ OnPosButtonLBUp(*(CPDF_Point*)lParam);
+ }
+ break;
+ case PNM_MOUSEMOVE:
+ if (pWnd == m_pMinButton)
+ {
+ OnMinButtonMouseMove(*(CPDF_Point*)lParam);
+ }
+
+ if (pWnd == m_pMaxButton)
+ {
+ OnMaxButtonMouseMove(*(CPDF_Point*)lParam);
+ }
+
+ if (pWnd == m_pPosButton)
+ {
+ OnPosButtonMouseMove(*(CPDF_Point*)lParam);
+ }
+ break;
+ case PNM_SETSCROLLINFO:
+ {
+ if (PWL_SCROLL_INFO * pInfo = (PWL_SCROLL_INFO*)lParam)
+ {
+ if (FXSYS_memcmp(&m_OriginInfo, pInfo, sizeof(PWL_SCROLL_INFO)) != 0)
+ {
+ m_OriginInfo = *pInfo;
+ FX_FLOAT fMax = pInfo->fContentMax - pInfo->fContentMin - pInfo->fPlateWidth;
+ fMax = fMax > 0.0f ? fMax : 0.0f;
+ this->SetScrollRange(0,fMax, pInfo->fPlateWidth);
+ this->SetScrollStep(pInfo->fBigStep,pInfo->fSmallStep);
+ }
+ }
+ }
+ break;
+ case PNM_SETSCROLLPOS:
+ {
+ FX_FLOAT fPos = *(FX_FLOAT*)lParam;
+ switch (this->m_sbType)
+ {
+ case SBT_HSCROLL:
+ fPos = fPos - m_OriginInfo.fContentMin;
+ break;
+ case SBT_VSCROLL:
+ fPos = m_OriginInfo.fContentMax - fPos;
+ break;
+ }
+ this->SetScrollPos(fPos);
+ }
+ break;
+ }
+}
+
+void CPWL_ScrollBar::CreateButtons(const PWL_CREATEPARAM & cp)
+{
+ PWL_CREATEPARAM scp = cp;
+ scp.pParentWnd = this;
+ scp.dwBorderWidth = 2;
+ scp.nBorderStyle = PBS_BEVELED;
+
+ scp.dwFlags = PWS_VISIBLE | PWS_CHILD | PWS_BORDER | PWS_BACKGROUND | PWS_NOREFRESHCLIP;
+
+ if (!m_pMinButton)
+ {
+ m_pMinButton = new CPWL_SBButton(m_sbType,PSBT_MIN);
+ m_pMinButton->Create(scp);
+ }
+
+ if (!m_pMaxButton)
+ {
+ m_pMaxButton = new CPWL_SBButton(m_sbType,PSBT_MAX);
+ m_pMaxButton->Create(scp);
+ }
+
+ if (!m_pPosButton)
+ {
+ m_pPosButton = new CPWL_SBButton(m_sbType,PSBT_POS);
+ m_pPosButton->SetVisible(FALSE);
+ m_pPosButton->Create(scp);
+ }
+}
+
+FX_FLOAT CPWL_ScrollBar::GetScrollBarWidth() const
+{
+ if (!IsVisible()) return 0;
+
+ return PWL_SCROLLBAR_WIDTH;
+}
+
+void CPWL_ScrollBar::SetScrollRange(FX_FLOAT fMin,FX_FLOAT fMax,FX_FLOAT fClientWidth)
+{
+ if (m_pPosButton)
+ {
+ m_sData.SetScrollRange(fMin,fMax);
+ m_sData.SetClientWidth(fClientWidth);
+
+ if (IsFloatSmaller(m_sData.ScrollRange.GetWidth(), 0.0f))
+ {
+ m_pPosButton->SetVisible(FALSE);
+ }
+ else
+ {
+ m_pPosButton->SetVisible(TRUE);
+ MovePosButton(TRUE);
+ }
+ }
+}
+
+void CPWL_ScrollBar::SetScrollPos(FX_FLOAT fPos)
+{
+ FX_FLOAT fOldPos = m_sData.fScrollPos;
+
+ m_sData.SetPos(fPos);
+
+ if (!IsFloatEqual(m_sData.fScrollPos, fOldPos))
+ MovePosButton(TRUE);
+}
+
+void CPWL_ScrollBar::SetScrollStep(FX_FLOAT fBigStep,FX_FLOAT fSmallStep)
+{
+ m_sData.SetBigStep(fBigStep);
+ m_sData.SetSmallStep(fSmallStep);
+}
+
+void CPWL_ScrollBar::MovePosButton(FX_BOOL bRefresh)
+{
+ ASSERT (m_pPosButton != NULL);
+ ASSERT (m_pMinButton != NULL);
+ ASSERT (m_pMaxButton != NULL);
+
+ if (m_pPosButton->IsVisible())
+ {
+
+
+
+
+ CPDF_Rect rcClient;
+ CPDF_Rect rcPosArea,rcPosButton;
+
+ rcClient = this->GetClientRect();
+ rcPosArea = GetScrollArea();
+
+ FX_FLOAT fLeft,fRight,fTop,fBottom;
+
+ switch (m_sbType)
+ {
+ case SBT_HSCROLL:
+ fLeft = TrueToFace(m_sData.fScrollPos);
+ fRight = TrueToFace(m_sData.fScrollPos + m_sData.fClientWidth);
+
+ if (fRight - fLeft < PWL_SCROLLBAR_POSBUTTON_MINWIDTH)
+ fRight = fLeft + PWL_SCROLLBAR_POSBUTTON_MINWIDTH;
+
+ if (fRight > rcPosArea.right)
+ {
+ fRight = rcPosArea.right;
+ fLeft = fRight - PWL_SCROLLBAR_POSBUTTON_MINWIDTH;
+ }
+
+ rcPosButton = CPDF_Rect(fLeft ,
+ rcPosArea.bottom,
+ fRight ,
+ rcPosArea.top);
+
+ break;
+ case SBT_VSCROLL:
+ fBottom = TrueToFace(m_sData.fScrollPos + m_sData.fClientWidth);
+ fTop = TrueToFace(m_sData.fScrollPos);
+
+ if (IsFloatSmaller(fTop - fBottom, PWL_SCROLLBAR_POSBUTTON_MINWIDTH))
+ fBottom = fTop - PWL_SCROLLBAR_POSBUTTON_MINWIDTH;
+
+ if (IsFloatSmaller(fBottom, rcPosArea.bottom))
+ {
+ fBottom = rcPosArea.bottom;
+ fTop = fBottom + PWL_SCROLLBAR_POSBUTTON_MINWIDTH;
+ }
+
+ rcPosButton = CPDF_Rect(rcPosArea.left,
+ fBottom,
+ rcPosArea.right,
+ fTop);
+
+ break;
+ }
+
+ m_pPosButton->Move(rcPosButton,TRUE,bRefresh);
+ }
+}
+
+void CPWL_ScrollBar::OnMinButtonLBDown(const CPDF_Point & point)
+{
+ m_sData.SubSmall();
+ MovePosButton(TRUE);
+ NotifyScrollWindow();
+
+ m_bMinOrMax = TRUE;
+
+ EndTimer();
+ BeginTimer(100);
+}
+
+void CPWL_ScrollBar::OnMinButtonLBUp(const CPDF_Point & point)
+{
+}
+
+void CPWL_ScrollBar::OnMinButtonMouseMove(const CPDF_Point & point)
+{
+}
+
+void CPWL_ScrollBar::OnMaxButtonLBDown(const CPDF_Point & point)
+{
+ m_sData.AddSmall();
+ MovePosButton(TRUE);
+ NotifyScrollWindow();
+
+ m_bMinOrMax = FALSE;
+
+ EndTimer();
+ BeginTimer(100);
+}
+
+void CPWL_ScrollBar::OnMaxButtonLBUp(const CPDF_Point & point)
+{
+}
+
+void CPWL_ScrollBar::OnMaxButtonMouseMove(const CPDF_Point & point)
+{
+}
+
+void CPWL_ScrollBar::OnPosButtonLBDown(const CPDF_Point & point)
+{
+ m_bMouseDown = TRUE;
+
+ if (m_pPosButton)
+ {
+ CPDF_Rect rcPosButton = m_pPosButton->GetWindowRect();
+
+ switch(m_sbType)
+ {
+ case SBT_HSCROLL:
+ m_nOldPos = point.x;
+ m_fOldPosButton = rcPosButton.left;
+ break;
+ case SBT_VSCROLL:
+ m_nOldPos = point.y;
+ m_fOldPosButton = rcPosButton.top;
+ break;
+ }
+ }
+}
+
+void CPWL_ScrollBar::OnPosButtonLBUp(const CPDF_Point & point)
+{
+ if (m_bMouseDown)
+ {
+ if (!m_bNotifyForever)
+ NotifyScrollWindow();
+ }
+ m_bMouseDown = FALSE;
+}
+
+void CPWL_ScrollBar::OnPosButtonMouseMove(const CPDF_Point & point)
+{
+ FX_FLOAT fOldScrollPos = m_sData.fScrollPos;
+
+ FX_FLOAT fNewPos = 0;
+
+ switch (m_sbType)
+ {
+ case SBT_HSCROLL:
+ if (FXSYS_fabs(point.x - m_nOldPos) < 1) return;
+ fNewPos = FaceToTrue(m_fOldPosButton + point.x - m_nOldPos);
+ break;
+ case SBT_VSCROLL:
+ if (FXSYS_fabs(point.y - m_nOldPos) < 1) return;
+ fNewPos = FaceToTrue(m_fOldPosButton + point.y - m_nOldPos);
+ break;
+ }
+
+ if (m_bMouseDown)
+ {
+ switch (m_sbType)
+ {
+ case SBT_HSCROLL:
+
+ if (IsFloatSmaller(fNewPos, m_sData.ScrollRange.fMin))
+ {
+ fNewPos = m_sData.ScrollRange.fMin;
+ }
+
+ if (IsFloatBigger(fNewPos, m_sData.ScrollRange.fMax))
+ {
+ fNewPos = m_sData.ScrollRange.fMax;
+ }
+
+ m_sData.SetPos(fNewPos);
+
+ break;
+ case SBT_VSCROLL:
+
+ if (IsFloatSmaller(fNewPos, m_sData.ScrollRange.fMin))
+ {
+ fNewPos = m_sData.ScrollRange.fMin;
+ }
+
+ if (IsFloatBigger(fNewPos, m_sData.ScrollRange.fMax))
+ {
+ fNewPos = m_sData.ScrollRange.fMax;
+ }
+
+ m_sData.SetPos(fNewPos);
+
+ break;
+ }
+
+ if (!IsFloatEqual(fOldScrollPos, m_sData.fScrollPos))
+ {
+ MovePosButton(TRUE);
+
+ if (m_bNotifyForever)
+ NotifyScrollWindow();
+ }
+ }
+}
+
+void CPWL_ScrollBar::NotifyScrollWindow()
+{
+ if (CPWL_Wnd * pParent = this->GetParentWindow())
+ {
+ FX_FLOAT fPos;
+ switch (this->m_sbType)
+ {
+ case SBT_HSCROLL:
+ fPos = m_OriginInfo.fContentMin + m_sData.fScrollPos;
+ break;
+ case SBT_VSCROLL:
+ fPos = m_OriginInfo.fContentMax - m_sData.fScrollPos;
+ break;
+ }
+ pParent->OnNotify(this,PNM_SCROLLWINDOW,(FX_INTPTR)m_sbType,(FX_INTPTR)&fPos);
+ }
+}
+
+CPDF_Rect CPWL_ScrollBar::GetScrollArea() const
+{
+ CPDF_Rect rcClient = GetClientRect();
+ CPDF_Rect rcArea;
+
+ if (!m_pMinButton || !m_pMaxButton)return rcClient;
+
+ CPDF_Rect rcMin = m_pMinButton->GetWindowRect();
+ CPDF_Rect rcMax = m_pMaxButton->GetWindowRect();
+
+ FX_FLOAT fMinWidth = rcMin.right - rcMin.left;
+ FX_FLOAT fMinHeight = rcMin.top - rcMin.bottom;
+ FX_FLOAT fMaxWidth = rcMax.right - rcMax.left;
+ FX_FLOAT fMaxHeight = rcMax.top - rcMax.bottom;
+
+ switch(m_sbType)
+ {
+ case SBT_HSCROLL:
+ if (rcClient.right - rcClient.left > fMinWidth + fMaxWidth + 2)
+ {
+ rcArea = CPDF_Rect(rcClient.left + fMinWidth + 1,rcClient.bottom,
+ rcClient.right - fMaxWidth - 1,rcClient.top);
+ }
+ else
+ {
+ rcArea = CPDF_Rect(rcClient.left + fMinWidth + 1,rcClient.bottom,
+ rcClient.left + fMinWidth + 1,rcClient.top);
+ }
+ break;
+ case SBT_VSCROLL:
+ if (rcClient.top - rcClient.bottom > fMinHeight + fMaxHeight + 2)
+ {
+ rcArea = CPDF_Rect(rcClient.left,rcClient.bottom + fMinHeight + 1,
+ rcClient.right,rcClient.top - fMaxHeight - 1);
+ }
+ else
+ {
+ rcArea = CPDF_Rect(rcClient.left,rcClient.bottom + fMinHeight + 1,
+ rcClient.right,rcClient.bottom + fMinHeight + 1);
+ }
+ break;
+ }
+
+ rcArea.Normalize();
+
+ return rcArea;
+}
+
+FX_FLOAT CPWL_ScrollBar::TrueToFace(FX_FLOAT fTrue)
+{
+ CPDF_Rect rcPosArea;
+ rcPosArea = GetScrollArea();
+
+ FX_FLOAT fFactWidth = m_sData.ScrollRange.GetWidth() + m_sData.fClientWidth;
+ fFactWidth = fFactWidth == 0 ? 1 : fFactWidth;
+
+ FX_FLOAT fFace = 0;
+
+ switch(m_sbType)
+ {
+ case SBT_HSCROLL:
+ fFace = rcPosArea.left + fTrue * (rcPosArea.right - rcPosArea.left) / fFactWidth;
+ break;
+ case SBT_VSCROLL:
+ fFace = rcPosArea.top - fTrue * (rcPosArea.top - rcPosArea.bottom) / fFactWidth;
+ break;
+ }
+
+ return fFace;
+}
+
+FX_FLOAT CPWL_ScrollBar::FaceToTrue(FX_FLOAT fFace)
+{
+ CPDF_Rect rcPosArea;
+ rcPosArea = GetScrollArea();
+
+ FX_FLOAT fFactWidth = m_sData.ScrollRange.GetWidth() + m_sData.fClientWidth;
+ fFactWidth = fFactWidth == 0 ? 1 : fFactWidth;
+
+ FX_FLOAT fTrue = 0;
+
+ switch(m_sbType)
+ {
+ case SBT_HSCROLL:
+ fTrue = (fFace - rcPosArea.left) * fFactWidth / (rcPosArea.right - rcPosArea.left);
+ break;
+ case SBT_VSCROLL:
+ fTrue = (rcPosArea.top - fFace) * fFactWidth / (rcPosArea.top - rcPosArea.bottom);
+ break;
+ }
+
+ return fTrue;
+}
+
+void CPWL_ScrollBar::CreateChildWnd(const PWL_CREATEPARAM & cp)
+{
+ CreateButtons(cp);
+}
+
+void CPWL_ScrollBar::TimerProc()
+{
+ PWL_SCROLL_PRIVATEDATA sTemp = m_sData;
+
+ if (m_bMinOrMax)m_sData.SubSmall();
+ else m_sData.AddSmall();
+
+ if (FXSYS_memcmp(&m_sData, &sTemp, sizeof(PWL_SCROLL_PRIVATEDATA)) != 0)
+ {
+ MovePosButton(TRUE);
+ NotifyScrollWindow();
+ }
+}
+
+/*
+void CPWL_ScrollBar::OnSetFocus()
+{
+ if (GetTransparency() != 255)
+ {
+ SetTransparency(255);
+ InvalidateRect();
+ }
+}
+
+void CPWL_ScrollBar::OnKillFocus()
+{
+ if (GetTransparency() != PWL_SCROLLBAR_TRANSPARANCY)
+ {
+ SetTransparency(PWL_SCROLLBAR_TRANSPARANCY);
+ InvalidateRect();
+ }
+}
+*/
+
diff --git a/fpdfsdk/src/pdfwindow/PWL_Signature.cpp b/fpdfsdk/src/pdfwindow/PWL_Signature.cpp
index 36297f3d92..5d79ce9cab 100644
--- a/fpdfsdk/src/pdfwindow/PWL_Signature.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_Signature.cpp
@@ -1,220 +1,220 @@
-// 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
-
-#include "../../include/pdfwindow/PDFWindow.h"
-#include "../../include/pdfwindow/PWL_Wnd.h"
-#include "../../include/pdfwindow/PWL_Icon.h"
-#include "../../include/pdfwindow/PWL_Signature.h"
-#include "../../include/pdfwindow/PWL_Label.h"
-#include "../../include/pdfwindow/PWL_Utils.h"
-
-/* --------------------------------- CPWL_Signature_Image --------------------------------- */
-
-CPWL_Signature_Image::CPWL_Signature_Image() : m_pImage(NULL)
-{
-}
-
-CPWL_Signature_Image::~CPWL_Signature_Image()
-{
-}
-
-void CPWL_Signature_Image::SetImage(CFX_DIBSource* pImage)
-{
- m_pImage = pImage;
-}
-
-CFX_DIBSource* CPWL_Signature_Image::GetImage()
-{
- return m_pImage;
-}
-
-void CPWL_Signature_Image::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device)
-{
- CPWL_Wnd::DrawThisAppearance(pDevice, pUser2Device);
-
- if (m_pImage)
- {
- CPDF_Rect rcClient = GetClientRect();
-
- FX_FLOAT x, y;
- pUser2Device->Transform(rcClient.left, rcClient.top, x, y);
-
- pDevice->StretchDIBits(m_pImage, (FX_INT32)x, (FX_INT32)y,
- (FX_INT32)rcClient.Width(), (FX_INT32)rcClient.Height());
- }
-}
-
-void CPWL_Signature_Image::GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream)
-{
- sAppStream << CPWL_Image::GetImageAppStream();
-}
-
-void CPWL_Signature_Image::GetScale(FX_FLOAT & fHScale,FX_FLOAT & fVScale)
-{
- FX_FLOAT fImageW, fImageH;
-
- GetImageSize(fImageW, fImageH);
-
- CPDF_Rect rcClient = GetClientRect();
-
- fHScale = rcClient.Width() / fImageW;
- fVScale = rcClient.Height() / fImageH;
-}
-
-/* --------------------------------- CPWL_Signature --------------------------------- */
-
-CPWL_Signature::CPWL_Signature() :
- m_pText(NULL),
- m_pDescription(NULL),
- m_pImage(NULL),
- m_bTextExist(TRUE),
- m_bImageExist(FALSE),
- m_bFlagExist(TRUE)
-{
-}
-
-CPWL_Signature::~CPWL_Signature()
-{
-}
-
-void CPWL_Signature::SetTextFlag(FX_BOOL bTextExist)
-{
- m_bTextExist = bTextExist;
-
- RePosChildWnd();
-}
-
-void CPWL_Signature::SetImageFlag(FX_BOOL bImageExist)
-{
- m_bImageExist = bImageExist;
-
- RePosChildWnd();
-}
-
-void CPWL_Signature::SetFoxitFlag(FX_BOOL bFlagExist)
-{
- m_bFlagExist = bFlagExist;
-}
-
-void CPWL_Signature::SetText(FX_LPCWSTR sText)
-{
- m_pText->SetText(sText);
-
- RePosChildWnd();
-}
-
-void CPWL_Signature::SetDescription(FX_LPCWSTR string)
-{
- m_pDescription->SetText(string);
-
- RePosChildWnd();
-}
-
-void CPWL_Signature::SetImage(CFX_DIBSource* pImage)
-{
- m_pImage->SetImage(pImage);
-
- RePosChildWnd();
-}
-
-void CPWL_Signature::SetImageStream(CPDF_Stream * pStream, FX_LPCSTR sImageAlias)
-{
- m_pImage->SetPDFStream(pStream);
- m_pImage->SetImageAlias(sImageAlias);
-
- RePosChildWnd();
-}
-
-void CPWL_Signature::RePosChildWnd()
-{
- CPDF_Rect rcClient = GetClientRect();
-
- CPDF_Rect rcText = rcClient;
- CPDF_Rect rcDescription = rcClient;
-
- FX_BOOL bTextVisible = m_bTextExist && m_pText->GetText().GetLength() > 0;
-
- if ((bTextVisible || m_bImageExist) &&
- m_pDescription->GetText().GetLength() > 0)
- {
- if (rcClient.Width() >= rcClient.Height())
- {
- rcText.right = rcText.left + rcClient.Width() / 2.0f;
- rcDescription.left = rcDescription.right - rcClient.Width() / 2.0f;
- }
- else
- {
- rcText.bottom = rcText.top - rcClient.Height() / 2.0f;
- rcDescription.top = rcDescription.bottom + rcClient.Height() / 2.0f;
- }
- }
-
- m_pText->SetVisible(bTextVisible);
- m_pImage->SetVisible(m_bImageExist);
-
- m_pText->Move(rcText, TRUE, FALSE);
- m_pImage->Move(rcText, TRUE, FALSE);
- m_pDescription->Move(rcDescription, TRUE, FALSE);
-}
-
-void CPWL_Signature::CreateChildWnd(const PWL_CREATEPARAM & cp)
-{
- m_pImage = new CPWL_Signature_Image;
- PWL_CREATEPARAM icp = cp;
- icp.pParentWnd = this;
- icp.dwFlags = PWS_CHILD | PWS_VISIBLE;
- icp.sTextColor = CPWL_Color(COLORTYPE_GRAY, 0);
- m_pImage->Create(icp);
-
- m_pText = new CPWL_Label;
- PWL_CREATEPARAM acp = cp;
- acp.pParentWnd = this;
- acp.dwFlags = PWS_CHILD | PWS_VISIBLE | PWS_AUTOFONTSIZE | PES_MULTILINE | PES_AUTORETURN | PES_MIDDLE | PES_CENTER;
- acp.sTextColor = CPWL_Color(COLORTYPE_GRAY, 0);
- m_pText->Create(acp);
-
- m_pDescription = new CPWL_Label;
- PWL_CREATEPARAM dcp = cp;
- dcp.pParentWnd = this;
- dcp.dwFlags = PWS_CHILD | PWS_VISIBLE | PWS_AUTOFONTSIZE | PES_MULTILINE | PES_AUTORETURN | PES_LEFT | PES_CENTER;
- dcp.sTextColor = CPWL_Color(COLORTYPE_GRAY, 0);
- m_pDescription->Create(dcp);
-}
-
-void CPWL_Signature::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device)
-{
- CPWL_Wnd::DrawThisAppearance(pDevice, pUser2Device);
-
- if (m_bFlagExist)
- CPWL_Utils::DrawIconAppStream(pDevice, pUser2Device, PWL_ICONTYPE_FOXIT, CPWL_Utils::GetCenterSquare(GetClientRect()),
- CPWL_Color(COLORTYPE_RGB,0.91f,0.855f,0.92f), CPWL_Color(COLORTYPE_TRANSPARENT), 255);
-
- /*
- CPDF_Rect rcClient = GetClientRect();
-
- CFX_PathData path;
-
- path.SetPointCount(2);
- path.SetPoint(0, rcClient.left, (rcClient.top + rcClient.bottom) * 0.5f, FXPT_MOVETO);
- path.SetPoint(1, rcClient.right, (rcClient.top + rcClient.bottom) * 0.5f, FXPT_LINETO);
-
- CFX_GraphStateData gsd;
- gsd.SetDashCount(2);
- gsd.m_DashArray[0] = 6.0f;
- gsd.m_DashArray[1] = 6.0f;
- gsd.m_DashPhase = 0;
-
- gsd.m_LineWidth = 10.0f;
- pDevice->DrawPath(&path, pUser2Device, &gsd, 0, ArgbEncode(255,255,0,0), FXFILL_ALTERNATE);
- */
-}
-
-void CPWL_Signature::GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream)
-{
- CPWL_Wnd::GetThisAppearanceStream(sAppStream);
-}
-
-
+// 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
+
+#include "../../include/pdfwindow/PDFWindow.h"
+#include "../../include/pdfwindow/PWL_Wnd.h"
+#include "../../include/pdfwindow/PWL_Icon.h"
+#include "../../include/pdfwindow/PWL_Signature.h"
+#include "../../include/pdfwindow/PWL_Label.h"
+#include "../../include/pdfwindow/PWL_Utils.h"
+
+/* --------------------------------- CPWL_Signature_Image --------------------------------- */
+
+CPWL_Signature_Image::CPWL_Signature_Image() : m_pImage(NULL)
+{
+}
+
+CPWL_Signature_Image::~CPWL_Signature_Image()
+{
+}
+
+void CPWL_Signature_Image::SetImage(CFX_DIBSource* pImage)
+{
+ m_pImage = pImage;
+}
+
+CFX_DIBSource* CPWL_Signature_Image::GetImage()
+{
+ return m_pImage;
+}
+
+void CPWL_Signature_Image::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device)
+{
+ CPWL_Wnd::DrawThisAppearance(pDevice, pUser2Device);
+
+ if (m_pImage)
+ {
+ CPDF_Rect rcClient = GetClientRect();
+
+ FX_FLOAT x, y;
+ pUser2Device->Transform(rcClient.left, rcClient.top, x, y);
+
+ pDevice->StretchDIBits(m_pImage, (FX_INT32)x, (FX_INT32)y,
+ (FX_INT32)rcClient.Width(), (FX_INT32)rcClient.Height());
+ }
+}
+
+void CPWL_Signature_Image::GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream)
+{
+ sAppStream << CPWL_Image::GetImageAppStream();
+}
+
+void CPWL_Signature_Image::GetScale(FX_FLOAT & fHScale,FX_FLOAT & fVScale)
+{
+ FX_FLOAT fImageW, fImageH;
+
+ GetImageSize(fImageW, fImageH);
+
+ CPDF_Rect rcClient = GetClientRect();
+
+ fHScale = rcClient.Width() / fImageW;
+ fVScale = rcClient.Height() / fImageH;
+}
+
+/* --------------------------------- CPWL_Signature --------------------------------- */
+
+CPWL_Signature::CPWL_Signature() :
+ m_pText(NULL),
+ m_pDescription(NULL),
+ m_pImage(NULL),
+ m_bTextExist(TRUE),
+ m_bImageExist(FALSE),
+ m_bFlagExist(TRUE)
+{
+}
+
+CPWL_Signature::~CPWL_Signature()
+{
+}
+
+void CPWL_Signature::SetTextFlag(FX_BOOL bTextExist)
+{
+ m_bTextExist = bTextExist;
+
+ RePosChildWnd();
+}
+
+void CPWL_Signature::SetImageFlag(FX_BOOL bImageExist)
+{
+ m_bImageExist = bImageExist;
+
+ RePosChildWnd();
+}
+
+void CPWL_Signature::SetFoxitFlag(FX_BOOL bFlagExist)
+{
+ m_bFlagExist = bFlagExist;
+}
+
+void CPWL_Signature::SetText(FX_LPCWSTR sText)
+{
+ m_pText->SetText(sText);
+
+ RePosChildWnd();
+}
+
+void CPWL_Signature::SetDescription(FX_LPCWSTR string)
+{
+ m_pDescription->SetText(string);
+
+ RePosChildWnd();
+}
+
+void CPWL_Signature::SetImage(CFX_DIBSource* pImage)
+{
+ m_pImage->SetImage(pImage);
+
+ RePosChildWnd();
+}
+
+void CPWL_Signature::SetImageStream(CPDF_Stream * pStream, FX_LPCSTR sImageAlias)
+{
+ m_pImage->SetPDFStream(pStream);
+ m_pImage->SetImageAlias(sImageAlias);
+
+ RePosChildWnd();
+}
+
+void CPWL_Signature::RePosChildWnd()
+{
+ CPDF_Rect rcClient = GetClientRect();
+
+ CPDF_Rect rcText = rcClient;
+ CPDF_Rect rcDescription = rcClient;
+
+ FX_BOOL bTextVisible = m_bTextExist && m_pText->GetText().GetLength() > 0;
+
+ if ((bTextVisible || m_bImageExist) &&
+ m_pDescription->GetText().GetLength() > 0)
+ {
+ if (rcClient.Width() >= rcClient.Height())
+ {
+ rcText.right = rcText.left + rcClient.Width() / 2.0f;
+ rcDescription.left = rcDescription.right - rcClient.Width() / 2.0f;
+ }
+ else
+ {
+ rcText.bottom = rcText.top - rcClient.Height() / 2.0f;
+ rcDescription.top = rcDescription.bottom + rcClient.Height() / 2.0f;
+ }
+ }
+
+ m_pText->SetVisible(bTextVisible);
+ m_pImage->SetVisible(m_bImageExist);
+
+ m_pText->Move(rcText, TRUE, FALSE);
+ m_pImage->Move(rcText, TRUE, FALSE);
+ m_pDescription->Move(rcDescription, TRUE, FALSE);
+}
+
+void CPWL_Signature::CreateChildWnd(const PWL_CREATEPARAM & cp)
+{
+ m_pImage = new CPWL_Signature_Image;
+ PWL_CREATEPARAM icp = cp;
+ icp.pParentWnd = this;
+ icp.dwFlags = PWS_CHILD | PWS_VISIBLE;
+ icp.sTextColor = CPWL_Color(COLORTYPE_GRAY, 0);
+ m_pImage->Create(icp);
+
+ m_pText = new CPWL_Label;
+ PWL_CREATEPARAM acp = cp;
+ acp.pParentWnd = this;
+ acp.dwFlags = PWS_CHILD | PWS_VISIBLE | PWS_AUTOFONTSIZE | PES_MULTILINE | PES_AUTORETURN | PES_MIDDLE | PES_CENTER;
+ acp.sTextColor = CPWL_Color(COLORTYPE_GRAY, 0);
+ m_pText->Create(acp);
+
+ m_pDescription = new CPWL_Label;
+ PWL_CREATEPARAM dcp = cp;
+ dcp.pParentWnd = this;
+ dcp.dwFlags = PWS_CHILD | PWS_VISIBLE | PWS_AUTOFONTSIZE | PES_MULTILINE | PES_AUTORETURN | PES_LEFT | PES_CENTER;
+ dcp.sTextColor = CPWL_Color(COLORTYPE_GRAY, 0);
+ m_pDescription->Create(dcp);
+}
+
+void CPWL_Signature::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device)
+{
+ CPWL_Wnd::DrawThisAppearance(pDevice, pUser2Device);
+
+ if (m_bFlagExist)
+ CPWL_Utils::DrawIconAppStream(pDevice, pUser2Device, PWL_ICONTYPE_FOXIT, CPWL_Utils::GetCenterSquare(GetClientRect()),
+ CPWL_Color(COLORTYPE_RGB,0.91f,0.855f,0.92f), CPWL_Color(COLORTYPE_TRANSPARENT), 255);
+
+ /*
+ CPDF_Rect rcClient = GetClientRect();
+
+ CFX_PathData path;
+
+ path.SetPointCount(2);
+ path.SetPoint(0, rcClient.left, (rcClient.top + rcClient.bottom) * 0.5f, FXPT_MOVETO);
+ path.SetPoint(1, rcClient.right, (rcClient.top + rcClient.bottom) * 0.5f, FXPT_LINETO);
+
+ CFX_GraphStateData gsd;
+ gsd.SetDashCount(2);
+ gsd.m_DashArray[0] = 6.0f;
+ gsd.m_DashArray[1] = 6.0f;
+ gsd.m_DashPhase = 0;
+
+ gsd.m_LineWidth = 10.0f;
+ pDevice->DrawPath(&path, pUser2Device, &gsd, 0, ArgbEncode(255,255,0,0), FXFILL_ALTERNATE);
+ */
+}
+
+void CPWL_Signature::GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream)
+{
+ CPWL_Wnd::GetThisAppearanceStream(sAppStream);
+}
+
+
diff --git a/fpdfsdk/src/pdfwindow/PWL_SpecialButton.cpp b/fpdfsdk/src/pdfwindow/PWL_SpecialButton.cpp
index aabf503f98..287fec1a55 100644
--- a/fpdfsdk/src/pdfwindow/PWL_SpecialButton.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_SpecialButton.cpp
@@ -1,110 +1,110 @@
-// 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
-
-#include "../../include/pdfwindow/PDFWindow.h"
-#include "../../include/pdfwindow/PWL_Wnd.h"
-#include "../../include/pdfwindow/PWL_Button.h"
-#include "../../include/pdfwindow/PWL_SpecialButton.h"
-#include "../../include/pdfwindow/PWL_Utils.h"
-
-/* --------------------------- CPWL_PushButton ---------------------------- */
-
-CPWL_PushButton::CPWL_PushButton()
-{
-}
-
-CPWL_PushButton::~CPWL_PushButton()
-{
-}
-
-CFX_ByteString CPWL_PushButton::GetClassName() const
-{
- return "CPWL_PushButton";
-}
-
-CPDF_Rect CPWL_PushButton::GetFocusRect() const
-{
- return CPWL_Utils::DeflateRect(this->GetWindowRect(),(FX_FLOAT)GetBorderWidth());
-}
-
-/* --------------------------- CPWL_CheckBox ---------------------------- */
-
-CPWL_CheckBox::CPWL_CheckBox() : m_bChecked(FALSE)
-{
-}
-
-CPWL_CheckBox::~CPWL_CheckBox()
-{
-}
-
-CFX_ByteString CPWL_CheckBox::GetClassName() const
-{
- return "CPWL_CheckBox";
-}
-
-void CPWL_CheckBox::SetCheck(FX_BOOL bCheck)
-{
- m_bChecked = bCheck;
-}
-
-FX_BOOL CPWL_CheckBox::IsChecked() const
-{
- return m_bChecked;
-}
-
-FX_BOOL CPWL_CheckBox::OnLButtonUp(const CPDF_Point & point)
-{
- if (IsReadOnly()) return FALSE;
-
- SetCheck(!IsChecked());
- return TRUE;
-}
-
-FX_BOOL CPWL_CheckBox::OnChar(FX_WORD nChar)
-{
- SetCheck(!IsChecked());
- return TRUE;
-}
-
-/* --------------------------- CPWL_RadioButton ---------------------------- */
-
-CPWL_RadioButton::CPWL_RadioButton() : m_bChecked(FALSE)
-{
-}
-
-CPWL_RadioButton::~CPWL_RadioButton()
-{
-}
-
-CFX_ByteString CPWL_RadioButton::GetClassName() const
-{
- return "CPWL_RadioButton";
-}
-
-FX_BOOL CPWL_RadioButton::OnLButtonUp(const CPDF_Point & point)
-{
- if (IsReadOnly()) return FALSE;
-
- SetCheck(TRUE);
- return TRUE;
-}
-
-void CPWL_RadioButton::SetCheck(FX_BOOL bCheck)
-{
- m_bChecked = bCheck;
-}
-
-FX_BOOL CPWL_RadioButton::IsChecked() const
-{
- return m_bChecked;
-}
-
-FX_BOOL CPWL_RadioButton::OnChar(FX_WORD nChar)
-{
- SetCheck(TRUE);
- return TRUE;
-}
-
+// 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
+
+#include "../../include/pdfwindow/PDFWindow.h"
+#include "../../include/pdfwindow/PWL_Wnd.h"
+#include "../../include/pdfwindow/PWL_Button.h"
+#include "../../include/pdfwindow/PWL_SpecialButton.h"
+#include "../../include/pdfwindow/PWL_Utils.h"
+
+/* --------------------------- CPWL_PushButton ---------------------------- */
+
+CPWL_PushButton::CPWL_PushButton()
+{
+}
+
+CPWL_PushButton::~CPWL_PushButton()
+{
+}
+
+CFX_ByteString CPWL_PushButton::GetClassName() const
+{
+ return "CPWL_PushButton";
+}
+
+CPDF_Rect CPWL_PushButton::GetFocusRect() const
+{
+ return CPWL_Utils::DeflateRect(this->GetWindowRect(),(FX_FLOAT)GetBorderWidth());
+}
+
+/* --------------------------- CPWL_CheckBox ---------------------------- */
+
+CPWL_CheckBox::CPWL_CheckBox() : m_bChecked(FALSE)
+{
+}
+
+CPWL_CheckBox::~CPWL_CheckBox()
+{
+}
+
+CFX_ByteString CPWL_CheckBox::GetClassName() const
+{
+ return "CPWL_CheckBox";
+}
+
+void CPWL_CheckBox::SetCheck(FX_BOOL bCheck)
+{
+ m_bChecked = bCheck;
+}
+
+FX_BOOL CPWL_CheckBox::IsChecked() const
+{
+ return m_bChecked;
+}
+
+FX_BOOL CPWL_CheckBox::OnLButtonUp(const CPDF_Point & point)
+{
+ if (IsReadOnly()) return FALSE;
+
+ SetCheck(!IsChecked());
+ return TRUE;
+}
+
+FX_BOOL CPWL_CheckBox::OnChar(FX_WORD nChar)
+{
+ SetCheck(!IsChecked());
+ return TRUE;
+}
+
+/* --------------------------- CPWL_RadioButton ---------------------------- */
+
+CPWL_RadioButton::CPWL_RadioButton() : m_bChecked(FALSE)
+{
+}
+
+CPWL_RadioButton::~CPWL_RadioButton()
+{
+}
+
+CFX_ByteString CPWL_RadioButton::GetClassName() const
+{
+ return "CPWL_RadioButton";
+}
+
+FX_BOOL CPWL_RadioButton::OnLButtonUp(const CPDF_Point & point)
+{
+ if (IsReadOnly()) return FALSE;
+
+ SetCheck(TRUE);
+ return TRUE;
+}
+
+void CPWL_RadioButton::SetCheck(FX_BOOL bCheck)
+{
+ m_bChecked = bCheck;
+}
+
+FX_BOOL CPWL_RadioButton::IsChecked() const
+{
+ return m_bChecked;
+}
+
+FX_BOOL CPWL_RadioButton::OnChar(FX_WORD nChar)
+{
+ SetCheck(TRUE);
+ return TRUE;
+}
+
diff --git a/fpdfsdk/src/pdfwindow/PWL_Utils.cpp b/fpdfsdk/src/pdfwindow/PWL_Utils.cpp
index aec1d4db45..1de6b56d5e 100644
--- a/fpdfsdk/src/pdfwindow/PWL_Utils.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_Utils.cpp
@@ -1,2844 +1,2844 @@
-// 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
-
-#include "../../include/pdfwindow/PDFWindow.h"
-#include "../../include/pdfwindow/PWL_Wnd.h"
-#include "../../include/pdfwindow/PWL_Utils.h"
-#include "../../include/pdfwindow/PWL_Icon.h"
-
-#define IsFloatZero(f) ((f) < 0.0001 && (f) > -0.0001)
-#define IsFloatBigger(fa,fb) ((fa) > (fb) && !IsFloatZero((fa) - (fb)))
-#define IsFloatSmaller(fa,fb) ((fa) < (fb) && !IsFloatZero((fa) - (fb)))
-#define IsFloatEqual(fa,fb) IsFloatZero((fa)-(fb))
-
-/* ---------------------------- CPWL_Utils ------------------------------ */
-
-CFX_ByteString CPWL_Utils::GetAppStreamFromArray(const CPWL_PathData* pPathData, FX_INT32 nCount)
-{
- CFX_ByteTextBuf csAP;
-
- for (FX_INT32 i=0; i<nCount; i++)
- {
- switch (pPathData[i].type)
- {
- case PWLPT_MOVETO:
- csAP << pPathData[i].point.x << " " << pPathData[i].point.y << " m\n";
- break;
- case PWLPT_LINETO:
- csAP << pPathData[i].point.x << " " << pPathData[i].point.y << " l\n";
- break;
- case PWLPT_BEZIERTO:
- csAP << pPathData[i].point.x << " " << pPathData[i].point.y << " "
- << pPathData[i+1].point.x << " " << pPathData[i+1].point.y << " "
- << pPathData[i+2].point.x << " " << pPathData[i+2].point.y << " c\n";
-
- i += 2;
- break;
- default:
- break;
- }
- }
-
- return csAP.GetByteString();
-}
-
-void CPWL_Utils::GetPathDataFromArray(CFX_PathData& path, const CPWL_PathData* pPathData, FX_INT32 nCount)
-{
- path.SetPointCount(nCount);
-
- for (FX_INT32 i=0; i<nCount; i++)
- {
- switch (pPathData[i].type)
- {
- case PWLPT_MOVETO:
- path.SetPoint(i, pPathData[i].point.x, pPathData[i].point.y, FXPT_MOVETO);
- break;
- case PWLPT_LINETO:
- path.SetPoint(i, pPathData[i].point.x, pPathData[i].point.y, FXPT_LINETO);
- break;
- case PWLPT_BEZIERTO:
- path.SetPoint(i, pPathData[i].point.x, pPathData[i].point.y, FXPT_BEZIERTO);
- break;
- default:
- break;
- }
- }
-}
-
-
-CPDF_Rect CPWL_Utils::MaxRect(const CPDF_Rect & rect1,const CPDF_Rect & rect2)
-{
- CPDF_Rect rcRet;
-
- rcRet.left = PWL_MIN(rect1.left,rect2.left);
- rcRet.bottom = PWL_MIN(rect1.bottom,rect2.bottom);
- rcRet.right = PWL_MAX(rect1.right,rect2.right);
- rcRet.top = PWL_MAX(rect1.top,rect2.top);
-
- return rcRet;
-}
-
-CPDF_Rect CPWL_Utils::OffsetRect(const CPDF_Rect & rect,FX_FLOAT x,FX_FLOAT y)
-{
- return CPDF_Rect(rect.left + x,rect.bottom + y,
- rect.right + x,rect.top + y);
-}
-
-FX_BOOL CPWL_Utils::ContainsRect(const CPDF_Rect& rcParent, const CPDF_Rect& rcChild)
-{
- return rcChild.left >= rcParent.left && rcChild.bottom >= rcParent.bottom &&
- rcChild.right <= rcParent.right && rcChild.top <= rcParent.top;
-}
-
-FX_BOOL CPWL_Utils::IntersectRect(const CPDF_Rect& rect1, const CPDF_Rect& rect2)
-{
- FX_FLOAT left = rect1.left > rect2.left ? rect1.left : rect2.left;
- FX_FLOAT right = rect1.right < rect2.right ? rect1.right : rect2.right;
- FX_FLOAT bottom = rect1.bottom > rect2.bottom ? rect1.bottom : rect2.bottom;
- FX_FLOAT top = rect1.top < rect2.top ? rect1.top : rect2.top;
-
- return left < right && bottom < top;
-}
-
-CPDF_Point CPWL_Utils::OffsetPoint(const CPDF_Point& point,FX_FLOAT x,FX_FLOAT y)
-{
- return CPDF_Point(point.x + x,point.y + y);
-}
-
-CPVT_WordRange CPWL_Utils::OverlapWordRange(const CPVT_WordRange & wr1, const CPVT_WordRange & wr2)
-{
- CPVT_WordRange wrRet;
-
- if (wr2.EndPos.WordCmp(wr1.BeginPos) < 0 || wr2.BeginPos.WordCmp(wr1.EndPos) > 0) return wrRet;
- if (wr1.EndPos.WordCmp(wr2.BeginPos) < 0 || wr1.BeginPos.WordCmp(wr2.EndPos) > 0) return wrRet;
-
- if (wr1.BeginPos.WordCmp(wr2.BeginPos) < 0)
- {
- wrRet.BeginPos = wr2.BeginPos;
- }
- else
- {
- wrRet.BeginPos = wr1.BeginPos;
- }
-
- if (wr1.EndPos.WordCmp(wr2.EndPos) < 0)
- {
- wrRet.EndPos = wr1.EndPos;
- }
- else
- {
- wrRet.EndPos = wr2.EndPos;
- }
-
- return wrRet;
-}
-
-CFX_ByteString CPWL_Utils::GetAP_Check(const CPDF_Rect & crBBox)
-{
- CFX_ByteTextBuf csAP;
-
- FX_FLOAT fWidth = crBBox.right - crBBox.left;
- FX_FLOAT fHeight = crBBox.top - crBBox.bottom;
-
- const FX_INT32 num = 8;
-
- CPWL_Point pts[num*3] =
- {
- //1
- CPWL_Point(0.28f, 0.52f),
- CPWL_Point(0.27f, 0.48f),
- CPWL_Point(0.29f, 0.40f),
-
- //2
- CPWL_Point(0.30f, 0.33f),
- CPWL_Point(0.31f, 0.29f),
- CPWL_Point(0.31f, 0.28f),
-
- //3
- CPWL_Point(0.39f, 0.28f),
- CPWL_Point(0.49f, 0.29f),
- CPWL_Point(0.77f, 0.67f),
-
- //4
- CPWL_Point(0.76f, 0.68f),
- CPWL_Point(0.78f, 0.69f),
- CPWL_Point(0.76f, 0.75f),
-
- //5
- CPWL_Point(0.76f, 0.75f),
- CPWL_Point(0.73f, 0.80f),
- CPWL_Point(0.68f, 0.75f),
-
- //6
- CPWL_Point(0.68f, 0.74f),
- CPWL_Point(0.68f, 0.74f),
- CPWL_Point(0.44f, 0.47f),
-
- //7
- CPWL_Point(0.43f, 0.47f),
- CPWL_Point(0.40f, 0.47f),
- CPWL_Point(0.41f, 0.58f),
-
- //8
- CPWL_Point(0.40f, 0.60f),
- CPWL_Point(0.28f, 0.66f),
- CPWL_Point(0.30f, 0.56f)
- };
-
- for (FX_INT32 j=0; j<num*3; j++)
- {
- pts[j].x *= fWidth;
- pts[j].x += crBBox.left;
-
- pts[j].y *= fHeight;
- pts[j].y += crBBox.bottom;
- }
-
- csAP << pts[0].x << " " << pts[0].y << " m\n";
-
- for (FX_INT32 i=0; i<num; i++)
- {
- FX_INT32 nCur = i*3;
- FX_INT32 n1 = i*3 + 1;
- FX_INT32 n2 = i*3 + 2;
- FX_INT32 nNext = (i < num-1 ? (i+1)*3 : 0);
-
- FX_FLOAT px1 = pts[n1].x - pts[nCur].x;
- FX_FLOAT py1 = pts[n1].y - pts[nCur].y;
- FX_FLOAT px2 = pts[n2].x - pts[nNext].x;
- FX_FLOAT py2 = pts[n2].y - pts[nNext].y;
-
- csAP << pts[nCur].x + px1 * PWL_BEZIER << " " << pts[nCur].y + py1 * PWL_BEZIER << " "
- << pts[nNext].x + px2 * PWL_BEZIER << " " << pts[nNext].y + py2 * PWL_BEZIER << " "
- << pts[nNext].x << " " << pts[nNext].y << " c\n";
- }
-
- return csAP.GetByteString();
-}
-
-CFX_ByteString CPWL_Utils::GetAP_Circle(const CPDF_Rect & crBBox)
-{
- CFX_ByteTextBuf csAP;
-
- FX_FLOAT fWidth = crBBox.right - crBBox.left;
- FX_FLOAT fHeight = crBBox.top - crBBox.bottom;
-
- CPDF_Point pt1(crBBox.left,crBBox.bottom + fHeight / 2);
- CPDF_Point pt2(crBBox.left + fWidth / 2,crBBox.top);
- CPDF_Point pt3(crBBox.right,crBBox.bottom + fHeight / 2);
- CPDF_Point pt4(crBBox.left + fWidth / 2,crBBox.bottom);
-
- csAP << pt1.x << " " << pt1.y << " m\n";
-
- FX_FLOAT px = pt2.x - pt1.x;
- FX_FLOAT py = pt2.y - pt1.y;
-
- csAP << pt1.x << " " << pt1.y + py * PWL_BEZIER << " "
- << pt2.x - px * PWL_BEZIER << " " << pt2.y << " "
- << pt2.x << " " << pt2.y << " c\n";
-
- px = pt3.x - pt2.x;
- py = pt2.y - pt3.y;
-
- csAP << pt2.x + px * PWL_BEZIER << " " << pt2.y << " "
- << pt3.x << " " << pt3.y + py * PWL_BEZIER << " "
- << pt3.x << " " << pt3.y << " c\n";
-
- px = pt3.x - pt4.x;
- py = pt3.y - pt4.y;
-
- csAP << pt3.x << " " << pt3.y - py * PWL_BEZIER << " "
- << pt4.x + px * PWL_BEZIER << " " << pt4.y << " "
- << pt4.x << " " << pt4.y << " c\n";
-
- px = pt4.x - pt1.x;
- py = pt1.y - pt4.y;
-
- csAP << pt4.x - px * PWL_BEZIER << " " << pt4.y << " "
- << pt1.x << " " << pt1.y - py * PWL_BEZIER << " "
- << pt1.x << " " << pt1.y << " c\n";
-
- return csAP.GetByteString();
-}
-
-CFX_ByteString CPWL_Utils::GetAP_Cross(const CPDF_Rect & crBBox)
-{
- CFX_ByteTextBuf csAP;
-
- csAP << crBBox.left << " " << crBBox.top << " m\n";
- csAP << crBBox.right << " " << crBBox.bottom << " l\n";
- csAP << crBBox.left << " " << crBBox.bottom << " m\n";
- csAP << crBBox.right << " " << crBBox.top << " l\n";
-
- return csAP.GetByteString();
-}
-
-CFX_ByteString CPWL_Utils::GetAP_Diamond(const CPDF_Rect & crBBox)
-{
- CFX_ByteTextBuf csAP;
-
- FX_FLOAT fWidth = crBBox.right - crBBox.left;
- FX_FLOAT fHeight = crBBox.top - crBBox.bottom;
-
- CPDF_Point pt1(crBBox.left,crBBox.bottom + fHeight / 2);
- CPDF_Point pt2(crBBox.left + fWidth / 2,crBBox.top);
- CPDF_Point pt3(crBBox.right,crBBox.bottom + fHeight / 2);
- CPDF_Point pt4(crBBox.left + fWidth / 2,crBBox.bottom);
-
- csAP << pt1.x << " " << pt1.y << " m\n";
- csAP << pt2.x << " " << pt2.y << " l\n";
- csAP << pt3.x << " " << pt3.y << " l\n";
- csAP << pt4.x << " " << pt4.y << " l\n";
- csAP << pt1.x << " " << pt1.y << " l\n";
-
- return csAP.GetByteString();
-}
-
-CFX_ByteString CPWL_Utils::GetAP_Square(const CPDF_Rect & crBBox)
-{
- CFX_ByteTextBuf csAP;
-
- csAP << crBBox.left << " " << crBBox.top << " m\n";
- csAP << crBBox.right << " " << crBBox.top << " l\n";
- csAP << crBBox.right << " " << crBBox.bottom << " l\n";
- csAP << crBBox.left << " " << crBBox.bottom << " l\n";
- csAP << crBBox.left << " " << crBBox.top << " l\n";
-
- return csAP.GetByteString();
-}
-
-CFX_ByteString CPWL_Utils::GetAP_Star(const CPDF_Rect & crBBox)
-{
- CFX_ByteTextBuf csAP;
-
- FX_FLOAT fRadius = (crBBox.top - crBBox.bottom)/(1+(FX_FLOAT)cos(PWL_PI/5.0f));
- CPDF_Point ptCenter = CPDF_Point((crBBox.left + crBBox.right) / 2.0f,(crBBox.top + crBBox.bottom) / 2.0f);
-
- FX_FLOAT px[5],py[5];
-
- FX_FLOAT fAngel = PWL_PI/10.0f;
-
- for (FX_INT32 i=0; i<5; i++)
- {
- px[i] = ptCenter.x + fRadius * (FX_FLOAT)cos(fAngel);
- py[i] = ptCenter.y + fRadius * (FX_FLOAT)sin(fAngel);
-
- fAngel += PWL_PI * 2 / 5.0f;
- }
-
- csAP << px[0] << " " << py[0] << " m\n";
-
- FX_INT32 nNext = 0;
- for (FX_INT32 j=0; j<5; j++)
- {
- nNext += 2;
- if (nNext >= 5) nNext -= 5;
- csAP << px[nNext] << " " << py[nNext] << " l\n";
- }
-
- return csAP.GetByteString();
-}
-
-CFX_ByteString CPWL_Utils::GetAP_HalfCircle(const CPDF_Rect & crBBox,FX_FLOAT fRotate)
-{
- CFX_ByteTextBuf csAP;
-
- FX_FLOAT fWidth = crBBox.right - crBBox.left;
- FX_FLOAT fHeight = crBBox.top - crBBox.bottom;
-
- CPDF_Point pt1(-fWidth/2,0);
- CPDF_Point pt2(0,fHeight/2);
- CPDF_Point pt3(fWidth/2,0);
-
- FX_FLOAT px,py;
-
- csAP << cos(fRotate) << " " << sin(fRotate) << " " << -sin(fRotate) << " " << cos(fRotate) << " "
- << crBBox.left + fWidth / 2 << " " << crBBox.bottom + fHeight / 2 << " cm\n";
-
-
- csAP << pt1.x << " " << pt1.y << " m\n";
-
- px = pt2.x - pt1.x;
- py = pt2.y - pt1.y;
-
- csAP << pt1.x << " " << pt1.y + py * PWL_BEZIER << " "
- << pt2.x - px * PWL_BEZIER << " " << pt2.y << " "
- << pt2.x << " " << pt2.y << " c\n";
-
- px = pt3.x - pt2.x;
- py = pt2.y - pt3.y;
-
- csAP << pt2.x + px * PWL_BEZIER << " " << pt2.y << " "
- << pt3.x << " " << pt3.y + py * PWL_BEZIER << " "
- << pt3.x << " " << pt3.y << " c\n";
-
- return csAP.GetByteString();
-}
-
-
-CPDF_Rect CPWL_Utils::InflateRect(const CPDF_Rect & rcRect, FX_FLOAT fSize)
-{
- if (rcRect.IsEmpty()) return rcRect;
-
- CPDF_Rect rcNew(rcRect.left - fSize,
- rcRect.bottom - fSize,
- rcRect.right + fSize,
- rcRect.top + fSize);
- rcNew.Normalize();
- return rcNew;
-}
-
-CPDF_Rect CPWL_Utils::DeflateRect(const CPDF_Rect & rcRect, FX_FLOAT fSize)
-{
- if (rcRect.IsEmpty()) return rcRect;
-
- CPDF_Rect rcNew(rcRect.left + fSize,
- rcRect.bottom + fSize,
- rcRect.right - fSize,
- rcRect.top - fSize);
- rcNew.Normalize();
- return rcNew;
-}
-
-CPDF_Rect CPWL_Utils::ScaleRect(const CPDF_Rect & rcRect,FX_FLOAT fScale)
-{
- FX_FLOAT fHalfWidth = (rcRect.right - rcRect.left) / 2.0f;
- FX_FLOAT fHalfHeight = (rcRect.top - rcRect.bottom) / 2.0f;
-
- CPDF_Point ptCenter = CPDF_Point((rcRect.left + rcRect.right) / 2,(rcRect.top + rcRect.bottom) / 2);
-
- return CPDF_Rect(ptCenter.x - fHalfWidth * fScale,
- ptCenter.y - fHalfHeight * fScale,
- ptCenter.x + fHalfWidth * fScale,
- ptCenter.y + fHalfHeight * fScale);
-}
-
-CFX_ByteString CPWL_Utils::GetRectFillAppStream(const CPDF_Rect & rect,const CPWL_Color & color)
-{
- CFX_ByteTextBuf sAppStream;
-
- CFX_ByteString sColor = GetColorAppStream(color,TRUE);
- if (sColor.GetLength() > 0)
- {
- sAppStream << "q\n" << sColor;
- sAppStream << rect.left << " " << rect.bottom << " "
- << rect.right - rect.left << " " << rect.top - rect.bottom << " re f\nQ\n";
- }
-
- return sAppStream.GetByteString();
-}
-
-CFX_ByteString CPWL_Utils::GetCircleFillAppStream(const CPDF_Rect & rect,const CPWL_Color & color)
-{
- CFX_ByteTextBuf sAppStream;
-
- CFX_ByteString sColor = GetColorAppStream(color,TRUE);
- if (sColor.GetLength() > 0)
- {
- sAppStream << "q\n" << sColor << CPWL_Utils::GetAP_Circle(rect) << "f\nQ\n";
- }
-
- return sAppStream.GetByteString();
-}
-
-CPDF_Rect CPWL_Utils::GetCenterSquare(const CPDF_Rect & rect)
-{
- FX_FLOAT fWidth = rect.right - rect.left;
- FX_FLOAT fHeight = rect.top - rect.bottom;
-
- FX_FLOAT fCenterX = (rect.left + rect.right)/2.0f;
- FX_FLOAT fCenterY = (rect.top + rect.bottom)/2.0f;
-
- FX_FLOAT fRadius = (fWidth > fHeight) ? fHeight / 2 : fWidth / 2;
-
- return CPDF_Rect(fCenterX - fRadius,fCenterY - fRadius,fCenterX + fRadius,fCenterY + fRadius);
-}
-
-CFX_ByteString CPWL_Utils::GetEditAppStream(IFX_Edit* pEdit, const CPDF_Point & ptOffset, const CPVT_WordRange * pRange,
- FX_BOOL bContinuous, FX_WORD SubWord)
-{
- return IFX_Edit::GetEditAppearanceStream(pEdit,ptOffset,pRange,bContinuous,SubWord);
-}
-
-CFX_ByteString CPWL_Utils::GetEditSelAppStream(IFX_Edit* pEdit, const CPDF_Point & ptOffset,
- const CPVT_WordRange * pRange)
-{
- return IFX_Edit::GetSelectAppearanceStream(pEdit,ptOffset,pRange);
-}
-
-static CFX_ByteString GetSquigglyAppearanceStream(FX_FLOAT fStartX, FX_FLOAT fEndX, FX_FLOAT fY, FX_FLOAT fStep)
-{
- CFX_ByteTextBuf sRet;
-
- sRet << "0 w\n" << fStartX << " " << fY << " m\n";
-
- FX_FLOAT fx;
- FX_INT32 i;
-
- for (i=1,fx=fStartX+fStep; fx<fEndX; fx+=fStep,i++)
- {
- sRet << fx << " " << fY + (i&1)*fStep << " l\n";
- }
-
- sRet << "S\n";
-
- return sRet.GetByteString();
-}
-
-static CFX_ByteString GetWordSpellCheckAppearanceStream(IFX_Edit_Iterator* pIterator, const CPDF_Point & ptOffset,
- const CPVT_WordRange & wrWord)
-{
- CFX_ByteTextBuf sRet;
-
- FX_FLOAT fStartX = 0.0f;
- FX_FLOAT fEndX = 0.0f;
- FX_FLOAT fY = 0.0f;
- FX_FLOAT fStep = 0.0f;
-
- FX_BOOL bBreak = FALSE;
-
- if (pIterator)
- {
- pIterator->SetAt(wrWord.BeginPos);
-
- do
- {
- CPVT_WordPlace place = pIterator->GetAt();
-
- CPVT_Line line;
- if (pIterator->GetLine(line))
- {
- fY = line.ptLine.y;
- fStep = (line.fLineAscent - line.fLineDescent) / 16.0f;
- }
-
- if (place.LineCmp(wrWord.BeginPos) == 0)
- {
- pIterator->SetAt(wrWord.BeginPos);
- CPVT_Word word;
- if (pIterator->GetWord(word))
- {
- fStartX = word.ptWord.x;
- }
- }
- else
- {
- fStartX = line.ptLine.x;
- }
-
- if (place.LineCmp(wrWord.EndPos) == 0)
- {
- pIterator->SetAt(wrWord.EndPos);
- CPVT_Word word;
- if (pIterator->GetWord(word))
- {
- fEndX = word.ptWord.x + word.fWidth;
- }
-
- bBreak = TRUE;
- }
- else
- {
- fEndX = line.ptLine.x + line.fLineWidth;
- }
-
- sRet << GetSquigglyAppearanceStream(fStartX + ptOffset.x, fEndX + ptOffset.x, fY + ptOffset.y,fStep);
-
- if (bBreak) break;
- }
- while (pIterator->NextLine());
- }
-
- return sRet.GetByteString();
-}
-
-CFX_ByteString CPWL_Utils::GetSpellCheckAppStream(IFX_Edit* pEdit, IPWL_SpellCheck* pSpellCheck, const CPDF_Point & ptOffset,
- const CPVT_WordRange * pRange)
-{
- ASSERT(pEdit != NULL);
- ASSERT(pSpellCheck != NULL);
-
- CFX_ByteTextBuf sRet;
-
- if (pRange && pRange->IsExist())
- {
- if (IFX_Edit_Iterator* pIterator = pEdit->GetIterator())
- {
- pIterator->SetAt(pRange->BeginPos);
-
- FX_BOOL bLatinWord = FALSE;
- CPVT_WordPlace wpWordStart;
- CFX_ByteString sWord;
-
- CPVT_WordPlace oldplace;
- while (pIterator->NextWord())
- {
- CPVT_WordPlace place = pIterator->GetAt();
- if (pRange && place.WordCmp(pRange->EndPos) > 0) break;
-
- CPVT_Word word;
- if (pIterator->GetWord(word))
- {
- if (FX_EDIT_ISLATINWORD(word.Word))
- {
- if (!bLatinWord)
- {
- wpWordStart = place;
- bLatinWord = TRUE;
- }
-
- sWord += (char)word.Word;
- oldplace = place;
- }
- else
- {
- if (bLatinWord)
- {
- if (!pSpellCheck->CheckWord(sWord))
- {
- sRet << GetWordSpellCheckAppearanceStream(pIterator,ptOffset,CPVT_WordRange(wpWordStart,oldplace));
- pIterator->SetAt(place);
- }
- bLatinWord = FALSE;
- }
-
- sWord.Empty();
- }
- }
- else
- {
- if (bLatinWord)
- {
- if (!pSpellCheck->CheckWord(sWord))
- sRet << GetWordSpellCheckAppearanceStream(pIterator,ptOffset,CPVT_WordRange(wpWordStart,oldplace));
- bLatinWord = FALSE;
- sWord.Empty();
- }
- }
- }
-
- if (bLatinWord)
- {
- if (!pSpellCheck->CheckWord(sWord))
- sRet << GetWordSpellCheckAppearanceStream(pIterator,ptOffset,CPVT_WordRange(wpWordStart,oldplace));
-
- bLatinWord = FALSE;
- sWord.Empty();
- }
- }
- }
-
- return sRet.GetByteString();
-}
-
-CFX_ByteString CPWL_Utils::GetTextAppStream(const CPDF_Rect & rcBBox,IFX_Edit_FontMap * pFontMap,
- const CFX_WideString & sText, FX_INT32 nAlignmentH, FX_INT32 nAlignmentV,
- FX_FLOAT fFontSize, FX_BOOL bMultiLine, FX_BOOL bAutoReturn, const CPWL_Color & crText)
-{
- CFX_ByteTextBuf sRet;
-
- if (IFX_Edit * pEdit = IFX_Edit::NewEdit())
- {
- pEdit->SetFontMap(pFontMap);
-
- pEdit->SetPlateRect(rcBBox);
- pEdit->SetAlignmentH(nAlignmentH);
- pEdit->SetAlignmentV(nAlignmentV);
- pEdit->SetMultiLine(bMultiLine);
- pEdit->SetAutoReturn(bAutoReturn);
- if (IsFloatZero(fFontSize))
- pEdit->SetAutoFontSize(TRUE);
- else
- pEdit->SetFontSize(fFontSize);
- pEdit->Initialize();
-
- pEdit->SetText(sText);
-
- CFX_ByteString sEdit = CPWL_Utils::GetEditAppStream(pEdit, CPDF_Point(0.0f,0.0f));
- if (sEdit.GetLength() > 0)
- {
- sRet << "BT\n" << CPWL_Utils::GetColorAppStream(crText) << sEdit << "ET\n";
- }
-
- IFX_Edit::DelEdit(pEdit);
- }
-
- return sRet.GetByteString();
-}
-
-CFX_ByteString CPWL_Utils::GetPushButtonAppStream(const CPDF_Rect & rcBBox,
- IFX_Edit_FontMap * pFontMap,
- CPDF_Stream * pIconStream,
- CPDF_IconFit & IconFit,
- const CFX_WideString & sLabel,
- const CPWL_Color & crText,
- FX_FLOAT fFontSize,
- FX_INT32 nLayOut)
-{
- const FX_FLOAT fAutoFontScale = 1.0f / 3.0f;
-
- if (IFX_Edit * pEdit = IFX_Edit::NewEdit())
- {
- pEdit->SetFontMap(pFontMap);
-
- pEdit->SetAlignmentH(1);
- pEdit->SetAlignmentV(1);
- pEdit->SetMultiLine(FALSE);
- pEdit->SetAutoReturn(FALSE);
- if (IsFloatZero(fFontSize))
- pEdit->SetAutoFontSize(TRUE);
- else
- pEdit->SetFontSize(fFontSize);
- pEdit->Initialize();
- pEdit->SetText(sLabel);
-
- CPDF_Rect rcLabelContent = pEdit->GetContentRect();
-
- CPWL_Icon Icon;
- PWL_CREATEPARAM cp;
- cp.dwFlags = PWS_VISIBLE;
- Icon.Create(cp);
- Icon.SetIconFit(&IconFit);
- Icon.SetPDFStream(pIconStream);
-
- CPDF_Rect rcLabel = CPDF_Rect(0,0,0,0);
- CPDF_Rect rcIcon = CPDF_Rect(0,0,0,0);
- FX_FLOAT fWidth = 0.0f;
- FX_FLOAT fHeight = 0.0f;
-
- switch (nLayOut)
- {
- case PPBL_LABEL:
- rcLabel = rcBBox;
- rcIcon = CPDF_Rect(0,0,0,0);
- break;
- case PPBL_ICON:
- rcIcon = rcBBox;
- rcLabel = CPDF_Rect(0,0,0,0);
- break;
- case PPBL_ICONTOPLABELBOTTOM:
-
- if (pIconStream)
- {
- if (IsFloatZero(fFontSize))
- {
- fHeight = rcBBox.top - rcBBox.bottom;
- rcLabel = CPDF_Rect(rcBBox.left,rcBBox.bottom,rcBBox.right,rcBBox.bottom + fHeight * fAutoFontScale);
- rcIcon = CPDF_Rect(rcBBox.left,rcLabel.top,rcBBox.right,rcBBox.top);
- }
- else
- {
- fHeight = rcLabelContent.Height();
-
- if (rcBBox.bottom + fHeight > rcBBox.top)
- {
- rcIcon = CPDF_Rect(0,0,0,0);
- rcLabel = rcBBox;
- }
- else
- {
- rcLabel = CPDF_Rect(rcBBox.left,rcBBox.bottom,rcBBox.right,rcBBox.bottom + fHeight);
- rcIcon = CPDF_Rect(rcBBox.left,rcLabel.top,rcBBox.right,rcBBox.top);
- }
- }
- }
- else
- {
- rcLabel = rcBBox;
- rcIcon = CPDF_Rect(0,0,0,0);
- }
-
- break;
- case PPBL_LABELTOPICONBOTTOM:
-
- if (pIconStream)
- {
- if (IsFloatZero(fFontSize))
- {
- fHeight = rcBBox.top - rcBBox.bottom;
- rcLabel = CPDF_Rect(rcBBox.left,rcBBox.top - fHeight * fAutoFontScale ,rcBBox.right,rcBBox.top);
- rcIcon = CPDF_Rect(rcBBox.left,rcBBox.bottom,rcBBox.right,rcLabel.bottom);
- }
- else
- {
- fHeight = rcLabelContent.Height();
-
- if (rcBBox.bottom + fHeight > rcBBox.top)
- {
- rcIcon = CPDF_Rect(0,0,0,0);
- rcLabel = rcBBox;
- }
- else
- {
- rcLabel = CPDF_Rect(rcBBox.left,rcBBox.top - fHeight,rcBBox.right,rcBBox.top);
- rcIcon = CPDF_Rect(rcBBox.left,rcBBox.bottom,rcBBox.right,rcLabel.bottom);
- }
- }
- }
- else
- {
- rcLabel = rcBBox;
- rcIcon = CPDF_Rect(0,0,0,0);
- }
-
- break;
- case PPBL_ICONLEFTLABELRIGHT:
-
- if (pIconStream)
- {
- if (IsFloatZero(fFontSize))
- {
- fWidth = rcBBox.right - rcBBox.left;
- rcLabel = CPDF_Rect(rcBBox.right - fWidth * fAutoFontScale,rcBBox.bottom,rcBBox.right,rcBBox.top);
- rcIcon = CPDF_Rect(rcBBox.left,rcBBox.bottom,rcLabel.left,rcBBox.top);
-
- if (rcLabelContent.Width() < fWidth * fAutoFontScale)
- {
- }
- else
- {
- if (rcLabelContent.Width() < fWidth)
- {
- rcLabel = CPDF_Rect(rcBBox.right - rcLabelContent.Width(),rcBBox.bottom,rcBBox.right,rcBBox.top);
- rcIcon = CPDF_Rect(rcBBox.left,rcBBox.bottom,rcLabel.left,rcBBox.top);
- }
- else
- {
- rcLabel = rcBBox;
- rcIcon = CPDF_Rect(0,0,0,0);
- }
- }
- }
- else
- {
- fWidth = rcLabelContent.Width();
-
- if (rcBBox.left + fWidth > rcBBox.right)
- {
- rcLabel = rcBBox;
- rcIcon = CPDF_Rect(0,0,0,0);
- }
- else
- {
- rcLabel = CPDF_Rect(rcBBox.right - fWidth,rcBBox.bottom,rcBBox.right,rcBBox.top);
- rcIcon = CPDF_Rect(rcBBox.left,rcBBox.bottom,rcLabel.left,rcBBox.top);
- }
- }
- }
- else
- {
- rcLabel = rcBBox;
- rcIcon = CPDF_Rect(0,0,0,0);
- }
-
- break;
- case PPBL_LABELLEFTICONRIGHT:
-
- if (pIconStream)
- {
- if (IsFloatZero(fFontSize))
- {
- fWidth = rcBBox.right - rcBBox.left;
- rcLabel = CPDF_Rect(rcBBox.left,rcBBox.bottom,rcBBox.left + fWidth * fAutoFontScale,rcBBox.top);
- rcIcon = CPDF_Rect(rcLabel.right,rcBBox.bottom,rcBBox.right,rcBBox.top);
-
- if (rcLabelContent.Width() < fWidth * fAutoFontScale)
- {
- }
- else
- {
- if (rcLabelContent.Width() < fWidth)
- {
- rcLabel = CPDF_Rect(rcBBox.left,rcBBox.bottom,rcBBox.left + rcLabelContent.Width(),rcBBox.top);
- rcIcon = CPDF_Rect(rcLabel.right,rcBBox.bottom,rcBBox.right,rcBBox.top);
- }
- else
- {
- rcLabel = rcBBox;
- rcIcon = CPDF_Rect(0,0,0,0);
- }
- }
- }
- else
- {
- fWidth = rcLabelContent.Width();
-
- if (rcBBox.left + fWidth > rcBBox.right)
- {
- rcLabel = rcBBox;
- rcIcon = CPDF_Rect(0,0,0,0);
- }
- else
- {
- rcLabel = CPDF_Rect(rcBBox.left,rcBBox.bottom,rcBBox.left + fWidth,rcBBox.top);
- rcIcon = CPDF_Rect(rcLabel.right,rcBBox.bottom,rcBBox.right,rcBBox.top);
- }
- }
- }
- else
- {
- rcLabel = rcBBox;
- rcIcon = CPDF_Rect(0,0,0,0);
- }
-
- break;
- case PPBL_LABELOVERICON:
- rcLabel = rcBBox;
- rcIcon = rcBBox;
- break;
- }
-
- CFX_ByteTextBuf sAppStream,sTemp;
-
- if (!rcIcon.IsEmpty())
- {
- Icon.Move(rcIcon, FALSE, FALSE);
- sTemp << Icon.GetImageAppStream();
- }
-
- Icon.Destroy();
-
- if (!rcLabel.IsEmpty())
- {
- pEdit->SetPlateRect(rcLabel);
- CFX_ByteString sEdit = CPWL_Utils::GetEditAppStream(pEdit,CPDF_Point(0.0f,0.0f));
- if (sEdit.GetLength() > 0)
- {
- sTemp << "BT\n" << CPWL_Utils::GetColorAppStream(crText) << sEdit << "ET\n";
- }
- }
-
- IFX_Edit::DelEdit(pEdit);
-
- if (sTemp.GetSize() > 0)
- {
- sAppStream << "q\n" << rcBBox.left << " " << rcBBox.bottom << " "
- << rcBBox.right - rcBBox.left << " " << rcBBox.top - rcBBox.bottom << " re W n\n";
- sAppStream << sTemp << "Q\n";
- }
-
- return sAppStream.GetByteString();
- }
-
- return "";
-}
-
-CFX_ByteString CPWL_Utils::GetColorAppStream(const CPWL_Color & color,const FX_BOOL & bFillOrStroke)
-{
- CFX_ByteTextBuf sColorStream;
-
- switch (color.nColorType)
- {
- case COLORTYPE_RGB:
- sColorStream << color.fColor1 << " " << color.fColor2 << " " << color.fColor3 << " "
- << (bFillOrStroke ? "rg" : "RG") << "\n";
- break;
- case COLORTYPE_GRAY:
- sColorStream << color.fColor1 << " " << (bFillOrStroke ? "g" : "G") << "\n";
- break;
- case COLORTYPE_CMYK:
- sColorStream << color.fColor1 << " " << color.fColor2 << " " << color.fColor3 << " " << color.fColor4 << " "
- << (bFillOrStroke ? "k" : "K") << "\n";
- break;
- }
-
- return sColorStream.GetByteString();
-}
-
-CFX_ByteString CPWL_Utils::GetBorderAppStream(const CPDF_Rect & rect, FX_FLOAT fWidth,
- const CPWL_Color & color, const CPWL_Color & crLeftTop, const CPWL_Color & crRightBottom,
- FX_INT32 nStyle, const CPWL_Dash & dash)
-{
- CFX_ByteTextBuf sAppStream;
- CFX_ByteString sColor;
-
- FX_FLOAT fLeft = rect.left;
- FX_FLOAT fRight = rect.right;
- FX_FLOAT fTop = rect.top;
- FX_FLOAT fBottom = rect.bottom;
-
- if (fWidth > 0.0f)
- {
- FX_FLOAT fHalfWidth = fWidth / 2.0f;
-
- sAppStream << "q\n";
-
- switch (nStyle)
- {
- default:
- case PBS_SOLID:
- sColor = CPWL_Utils::GetColorAppStream(color,TRUE);
- if (sColor.GetLength() > 0)
- {
- sAppStream << sColor;
- sAppStream << fLeft << " " << fBottom << " " << fRight - fLeft << " " << fTop - fBottom << " re\n";
- sAppStream << fLeft + fWidth << " " << fBottom + fWidth << " "
- << fRight - fLeft - fWidth * 2 << " " << fTop - fBottom - fWidth * 2 << " re\n";
- sAppStream << "f*\n";
- }
- break;
- case PBS_DASH:
- sColor = CPWL_Utils::GetColorAppStream(color,FALSE);
- if (sColor.GetLength() > 0)
- {
- sAppStream << sColor;
- sAppStream << fWidth << " w" << " [" << dash.nDash << " " << dash.nGap << "] " << dash.nPhase << " d\n";
- sAppStream << fLeft + fWidth / 2 << " " << fBottom + fWidth / 2 << " m\n";
- sAppStream << fLeft + fWidth / 2 << " " << fTop - fWidth / 2 << " l\n";
- sAppStream << fRight - fWidth / 2 << " " << fTop - fWidth / 2 << " l\n";
- sAppStream << fRight - fWidth / 2 << " " << fBottom + fWidth / 2 << " l\n";
- sAppStream << fLeft + fWidth / 2 << " " << fBottom + fWidth / 2 << " l S\n";
- }
- break;
- case PBS_BEVELED:
- case PBS_INSET:
- sColor = CPWL_Utils::GetColorAppStream(crLeftTop,TRUE);
- if (sColor.GetLength() > 0)
- {
- sAppStream << sColor;
- sAppStream << fLeft + fHalfWidth << " " << fBottom + fHalfWidth << " m\n";
- sAppStream << fLeft + fHalfWidth << " " << fTop - fHalfWidth << " l\n";
- sAppStream << fRight - fHalfWidth << " " << fTop - fHalfWidth << " l\n";
- sAppStream << fRight - fHalfWidth * 2 << " " << fTop - fHalfWidth * 2 << " l\n";
- sAppStream << fLeft + fHalfWidth * 2 << " " << fTop - fHalfWidth * 2 << " l\n";
- sAppStream << fLeft + fHalfWidth * 2 << " " << fBottom + fHalfWidth * 2 << " l f\n";
- }
-
- sColor = CPWL_Utils::GetColorAppStream(crRightBottom,TRUE);
- if (sColor.GetLength() > 0)
- {
- sAppStream << sColor;
- sAppStream << fRight - fHalfWidth << " " << fTop - fHalfWidth << " m\n";
- sAppStream << fRight - fHalfWidth << " " << fBottom + fHalfWidth << " l\n";
- sAppStream << fLeft + fHalfWidth << " " << fBottom + fHalfWidth << " l\n";
- sAppStream << fLeft + fHalfWidth * 2 << " " << fBottom + fHalfWidth * 2 << " l\n";
- sAppStream << fRight - fHalfWidth * 2 << " " << fBottom + fHalfWidth * 2 << " l\n";
- sAppStream << fRight - fHalfWidth * 2 << " " << fTop - fHalfWidth * 2 << " l f\n";
- }
-
- sColor = CPWL_Utils::GetColorAppStream(color,TRUE);
- if (sColor.GetLength() > 0)
- {
- sAppStream << sColor;
- sAppStream << fLeft << " " << fBottom << " " << fRight - fLeft << " " << fTop - fBottom << " re\n";
- sAppStream << fLeft + fHalfWidth << " " << fBottom + fHalfWidth << " "
- << fRight - fLeft - fHalfWidth * 2 << " " << fTop - fBottom - fHalfWidth * 2 << " re f*\n";
- }
- break;
- case PBS_UNDERLINED:
- sColor = CPWL_Utils::GetColorAppStream(color,FALSE);
- if (sColor.GetLength() > 0)
- {
- sAppStream << sColor;
- sAppStream << fWidth << " w\n";
- sAppStream << fLeft << " " << fBottom + fWidth / 2 << " m\n";
- sAppStream << fRight << " " << fBottom + fWidth / 2 << " l S\n";
- }
- break;
- }
-
- sAppStream << "Q\n";
- }
-
- return sAppStream.GetByteString();
-}
-
-CFX_ByteString CPWL_Utils::GetCircleBorderAppStream(const CPDF_Rect & rect, FX_FLOAT fWidth,
- const CPWL_Color & color, const CPWL_Color & crLeftTop, const CPWL_Color & crRightBottom,
- FX_INT32 nStyle, const CPWL_Dash & dash)
-{
- CFX_ByteTextBuf sAppStream;
- CFX_ByteString sColor;
-
-
-
-
-
-
- if (fWidth > 0.0f)
- {
- sAppStream << "q\n";
-
- switch (nStyle)
- {
- default:
- case PBS_SOLID:
- case PBS_UNDERLINED:
- {
- sColor = CPWL_Utils::GetColorAppStream(color,FALSE);
- if (sColor.GetLength() > 0)
- {
- sAppStream << "q\n" << fWidth << " w\n" << sColor
- << CPWL_Utils::GetAP_Circle(CPWL_Utils::DeflateRect(rect,fWidth / 2.0f))
- << " S\nQ\n";
- }
- }
- break;
- case PBS_DASH:
- {
- sColor = CPWL_Utils::GetColorAppStream(color,FALSE);
- if (sColor.GetLength() > 0)
- {
- sAppStream << "q\n" << fWidth << " w\n"
- << "[" << dash.nDash << " " << dash.nGap << "] " << dash.nPhase << " d\n"
- << sColor << CPWL_Utils::GetAP_Circle(CPWL_Utils::DeflateRect(rect,fWidth / 2.0f))
- << " S\nQ\n";
- }
- }
- break;
- case PBS_BEVELED:
- {
- FX_FLOAT fHalfWidth = fWidth / 2.0f;
-
- sColor = CPWL_Utils::GetColorAppStream(color,FALSE);
- if (sColor.GetLength() > 0)
- {
- sAppStream << "q\n" << fHalfWidth << " w\n"
- << sColor << CPWL_Utils::GetAP_Circle(rect)
- << " S\nQ\n";
- }
-
- sColor = CPWL_Utils::GetColorAppStream(crLeftTop,FALSE);
- if (sColor.GetLength() > 0)
- {
- sAppStream << "q\n" << fHalfWidth << " w\n"
- << sColor << CPWL_Utils::GetAP_HalfCircle(CPWL_Utils::DeflateRect(rect,fHalfWidth * 0.75f),PWL_PI/4.0f)
- << " S\nQ\n";
- }
-
- sColor = CPWL_Utils::GetColorAppStream(crRightBottom,FALSE);
- if (sColor.GetLength() > 0)
- {
- sAppStream << "q\n" << fHalfWidth << " w\n"
- << sColor << CPWL_Utils::GetAP_HalfCircle(CPWL_Utils::DeflateRect(rect,fHalfWidth * 0.75f),PWL_PI*5/4.0f)
- << " S\nQ\n";
- }
- }
- break;
- case PBS_INSET:
- {
- FX_FLOAT fHalfWidth = fWidth / 2.0f;
-
- sColor = CPWL_Utils::GetColorAppStream(color,FALSE);
- if (sColor.GetLength() > 0)
- {
- sAppStream << "q\n" << fHalfWidth << " w\n"
- << sColor << CPWL_Utils::GetAP_Circle(rect)
- << " S\nQ\n";
- }
-
- sColor = CPWL_Utils::GetColorAppStream(crLeftTop,FALSE);
- if (sColor.GetLength() > 0)
- {
- sAppStream << "q\n" << fHalfWidth << " w\n"
- << sColor << CPWL_Utils::GetAP_HalfCircle(CPWL_Utils::DeflateRect(rect,fHalfWidth * 0.75f),PWL_PI/4.0f)
- << " S\nQ\n";
- }
-
- sColor = CPWL_Utils::GetColorAppStream(crRightBottom,FALSE);
- if (sColor.GetLength() > 0)
- {
- sAppStream << "q\n" << fHalfWidth << " w\n"
- << sColor << CPWL_Utils::GetAP_HalfCircle(CPWL_Utils::DeflateRect(rect,fHalfWidth * 0.75f),PWL_PI*5/4.0f)
- << " S\nQ\n";
- }
- }
- break;
- }
-
- sAppStream << "Q\n";
- }
-
- return sAppStream.GetByteString();
-}
-
-CPWL_Color CPWL_Utils::SubstractColor(const CPWL_Color & sColor,FX_FLOAT fColorSub)
-{
- CPWL_Color sRet;
- sRet.nColorType = sColor.nColorType;
-
- switch (sColor.nColorType)
- {
- case COLORTYPE_TRANSPARENT:
- sRet.nColorType = COLORTYPE_RGB;
- sRet.fColor1 = PWL_MAX(1 - fColorSub,0.0f);
- sRet.fColor2 = PWL_MAX(1 - fColorSub,0.0f);
- sRet.fColor3 = PWL_MAX(1 - fColorSub,0.0f);
- break;
- case COLORTYPE_RGB:
- case COLORTYPE_GRAY:
- case COLORTYPE_CMYK:
- sRet.fColor1 = PWL_MAX(sColor.fColor1 - fColorSub,0.0f);
- sRet.fColor2 = PWL_MAX(sColor.fColor2 - fColorSub,0.0f);
- sRet.fColor3 = PWL_MAX(sColor.fColor3 - fColorSub,0.0f);
- sRet.fColor4 = PWL_MAX(sColor.fColor4 - fColorSub,0.0f);
- break;
- }
-
- return sRet;
-}
-
-CPWL_Color CPWL_Utils::DevideColor(const CPWL_Color & sColor,FX_FLOAT fColorDevide)
-{
- CPWL_Color sRet;
- sRet.nColorType = sColor.nColorType;
-
- switch (sColor.nColorType)
- {
- case COLORTYPE_TRANSPARENT:
- sRet.nColorType = COLORTYPE_RGB;
- sRet.fColor1 = 1 / fColorDevide;
- sRet.fColor2 = 1 / fColorDevide;
- sRet.fColor3 = 1 / fColorDevide;
- break;
- case COLORTYPE_RGB:
- case COLORTYPE_GRAY:
- case COLORTYPE_CMYK:
- sRet = sColor;
- sRet.fColor1 /= fColorDevide;
- sRet.fColor2 /= fColorDevide;
- sRet.fColor3 /= fColorDevide;
- sRet.fColor4 /= fColorDevide;
- break;
- }
-
- return sRet;
-}
-
-CFX_ByteString CPWL_Utils::GetAppStream_Check(const CPDF_Rect & rcBBox, const CPWL_Color & crText)
-{
- CFX_ByteTextBuf sAP;
- sAP << "q\n" << CPWL_Utils::GetColorAppStream(crText,TRUE) << CPWL_Utils::GetAP_Check(rcBBox) << "f\nQ\n";
- return sAP.GetByteString();
-}
-
-CFX_ByteString CPWL_Utils::GetAppStream_Circle(const CPDF_Rect & rcBBox, const CPWL_Color & crText)
-{
- CFX_ByteTextBuf sAP;
- sAP << "q\n" << CPWL_Utils::GetColorAppStream(crText,TRUE) << CPWL_Utils::GetAP_Circle(rcBBox) << "f\nQ\n";
- return sAP.GetByteString();
-}
-
-CFX_ByteString CPWL_Utils::GetAppStream_Cross(const CPDF_Rect & rcBBox, const CPWL_Color & crText)
-{
- CFX_ByteTextBuf sAP;
- sAP << "q\n" << CPWL_Utils::GetColorAppStream(crText,FALSE) << CPWL_Utils::GetAP_Cross(rcBBox) << "S\nQ\n";
- return sAP.GetByteString();
-}
-
-CFX_ByteString CPWL_Utils::GetAppStream_Diamond(const CPDF_Rect & rcBBox, const CPWL_Color & crText)
-{
- CFX_ByteTextBuf sAP;
- sAP << "q\n1 w\n" << CPWL_Utils::GetColorAppStream(crText,TRUE) << CPWL_Utils::GetAP_Diamond(rcBBox) << "f\nQ\n";
- return sAP.GetByteString();
-}
-
-CFX_ByteString CPWL_Utils::GetAppStream_Square(const CPDF_Rect & rcBBox, const CPWL_Color & crText)
-{
- CFX_ByteTextBuf sAP;
- sAP << "q\n" << CPWL_Utils::GetColorAppStream(crText,TRUE) << CPWL_Utils::GetAP_Square(rcBBox) << "f\nQ\n";
- return sAP.GetByteString();
-}
-
-CFX_ByteString CPWL_Utils::GetAppStream_Star(const CPDF_Rect & rcBBox, const CPWL_Color & crText)
-{
- CFX_ByteTextBuf sAP;
- sAP << "q\n" << CPWL_Utils::GetColorAppStream(crText,TRUE) << CPWL_Utils::GetAP_Star(rcBBox) << "f\nQ\n";
- return sAP.GetByteString();
-}
-
-CFX_ByteString CPWL_Utils::GetCheckBoxAppStream(const CPDF_Rect & rcBBox,
- FX_INT32 nStyle,
- const CPWL_Color & crText)
-{
- CPDF_Rect rcCenter = GetCenterSquare(rcBBox);
- switch (nStyle)
- {
- default:
- case PCS_CHECK:
- return GetAppStream_Check(rcCenter,crText);
- case PCS_CIRCLE:
- return GetAppStream_Circle(ScaleRect(rcCenter,2.0f/3.0f),crText);
- case PCS_CROSS:
- return GetAppStream_Cross(rcCenter,crText);
- case PCS_DIAMOND:
- return GetAppStream_Diamond(ScaleRect(rcCenter,2.0f/3.0f),crText);
- case PCS_SQUARE:
- return GetAppStream_Square(ScaleRect(rcCenter,2.0f/3.0f),crText);
- case PCS_STAR:
- return GetAppStream_Star(ScaleRect(rcCenter,2.0f/3.0f),crText);
- }
-}
-
-CFX_ByteString CPWL_Utils::GetRadioButtonAppStream(const CPDF_Rect & rcBBox,
- FX_INT32 nStyle,
- const CPWL_Color & crText)
-{
- CPDF_Rect rcCenter = GetCenterSquare(rcBBox);
- switch (nStyle)
- {
- default:
- case PCS_CHECK:
- return GetAppStream_Check(rcCenter,crText);
- case PCS_CIRCLE:
- return GetAppStream_Circle(ScaleRect(rcCenter,1.0f/2.0f),crText);
- case PCS_CROSS:
- return GetAppStream_Cross(rcCenter,crText);
- case PCS_DIAMOND:
- return GetAppStream_Diamond(ScaleRect(rcCenter,2.0f/3.0f),crText);
- case PCS_SQUARE:
- return GetAppStream_Square(ScaleRect(rcCenter,2.0f/3.0f),crText);
- case PCS_STAR:
- return GetAppStream_Star(ScaleRect(rcCenter,2.0f/3.0f),crText);
- }
-}
-
-CFX_ByteString CPWL_Utils::GetDropButtonAppStream(const CPDF_Rect & rcBBox)
-{
- CFX_ByteTextBuf sAppStream;
-
- if (!rcBBox.IsEmpty())
- {
- sAppStream << "q\n" << CPWL_Utils::GetColorAppStream(CPWL_Color(COLORTYPE_RGB,220.0f/255.0f,220.0f/255.0f,220.0f/255.0f),TRUE);
- sAppStream << rcBBox.left << " " << rcBBox.bottom << " "
- << rcBBox.right - rcBBox.left << " " << rcBBox.top - rcBBox.bottom << " re f\n";
- sAppStream << "Q\n";
-
- sAppStream << "q\n" <<
- CPWL_Utils::GetBorderAppStream(rcBBox,2,CPWL_Color(COLORTYPE_GRAY,0),CPWL_Color(COLORTYPE_GRAY,1),CPWL_Color(COLORTYPE_GRAY,0.5),PBS_BEVELED,CPWL_Dash(3,0,0))
- << "Q\n";
-
- CPDF_Point ptCenter = CPDF_Point((rcBBox.left + rcBBox.right)/2,(rcBBox.top + rcBBox.bottom)/2);
- if (IsFloatBigger(rcBBox.right - rcBBox.left,6) && IsFloatBigger(rcBBox.top - rcBBox.bottom,6))
- {
- sAppStream << "q\n" << " 0 g\n";
- sAppStream << ptCenter.x - 3 << " " << ptCenter.y + 1.5f << " m\n";
- sAppStream << ptCenter.x + 3 << " " << ptCenter.y + 1.5f << " l\n";
- sAppStream << ptCenter.x << " " << ptCenter.y - 1.5f << " l\n";
- sAppStream << ptCenter.x - 3 << " " << ptCenter.y + 1.5f << " l f\n";
- sAppStream << "Q\n";
- }
- }
-
- return sAppStream.GetByteString();
-}
-
-void CPWL_Utils::ConvertCMYK2GRAY(FX_FLOAT dC,FX_FLOAT dM,FX_FLOAT dY,FX_FLOAT dK,FX_FLOAT &dGray)
-{
- if (dC<0 || dC>1 || dM<0 || dM>1 || dY < 0 || dY >1 || dK < 0 || dK >1)
- return;
- dGray = 1.0f - FX_MIN(1.0f,0.3f*dC+0.59f * dM + 0.11f*dY+dK);
-}
-
-void CPWL_Utils::ConvertGRAY2CMYK(FX_FLOAT dGray,FX_FLOAT &dC,FX_FLOAT &dM,FX_FLOAT &dY,FX_FLOAT &dK)
-{
- if (dGray <0 || dGray >1)
- return;
- dC = 0.0f;
- dM = 0.0f;
- dY = 0.0f;
- dK = 1.0f-dGray;
-}
-
-void CPWL_Utils::ConvertGRAY2RGB(FX_FLOAT dGray,FX_FLOAT &dR,FX_FLOAT &dG,FX_FLOAT &dB)
-{
- if (dGray <0 || dGray >1)
- return;
- dR = dGray;
- dG = dGray;
- dB = dGray;
-}
-
-void CPWL_Utils::ConvertRGB2GRAY(FX_FLOAT dR,FX_FLOAT dG,FX_FLOAT dB,FX_FLOAT &dGray)
-{
- if (dR<0 || dR>1 || dG<0 || dG > 0 || dB < 0 || dB >1)
- return;
- dGray = 0.3f*dR+0.59f*dG+0.11f*dB;
-}
-
-void CPWL_Utils::ConvertCMYK2RGB(FX_FLOAT dC,FX_FLOAT dM,FX_FLOAT dY,FX_FLOAT dK,FX_FLOAT &dR,FX_FLOAT &dG,FX_FLOAT &dB)
-{
- if (dC <0 || dC>1 || dM < 0 || dM > 1 || dY < 0 || dY > 1 || dK < 0 || dK > 1 )
- return;
- dR = 1.0f - FX_MIN(1.0f, dC + dK);
- dG = 1.0f - FX_MIN(1.0f, dM + dK);
- dB = 1.0f - FX_MIN(1.0f, dY + dK);
-}
-
-void CPWL_Utils::ConvertRGB2CMYK(FX_FLOAT dR,FX_FLOAT dG,FX_FLOAT dB,FX_FLOAT &dC,FX_FLOAT &dM,FX_FLOAT &dY,FX_FLOAT &dK)
-{
- if (dR<0 || dR>1 || dG<0 || dG>1 || dB<0 || dB>1)
- return;
-
- dC = 1.0f - dR;
- dM = 1.0f - dG;
- dY = 1.0f - dB;
- dK = FX_MIN(dC, FX_MIN(dM, dY));
-}
-
-void CPWL_Utils::PWLColorToARGB(const CPWL_Color& color, FX_INT32& alpha, FX_FLOAT& red, FX_FLOAT& green, FX_FLOAT& blue)
-{
- switch (color.nColorType)
- {
- case COLORTYPE_TRANSPARENT:
- {
- alpha = 0;
- }
- break;
- case COLORTYPE_GRAY:
- {
- ConvertGRAY2RGB(color.fColor1, red, green, blue);
- }
- break;
- case COLORTYPE_RGB:
- {
- red = color.fColor1;
- green = color.fColor2;
- blue = color.fColor3;
- }
- break;
- case COLORTYPE_CMYK:
- {
- ConvertCMYK2RGB(color.fColor1, color.fColor2, color.fColor3, color.fColor4,
- red, green, blue);
- }
- break;
- }
-}
-
-FX_COLORREF CPWL_Utils::PWLColorToFXColor(const CPWL_Color& color, FX_INT32 nTransparancy)
-{
- FX_INT32 nAlpha = nTransparancy;
- FX_FLOAT dRed = 0;
- FX_FLOAT dGreen = 0;
- FX_FLOAT dBlue = 0;
-
- PWLColorToARGB(color, nAlpha, dRed, dGreen, dBlue);
-
- return ArgbEncode(nAlpha, (FX_INT32)(dRed*255), (FX_INT32)(dGreen*255), (FX_INT32)(dBlue*255));
-}
-
-void CPWL_Utils::DrawFillRect(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,const CPDF_Rect & rect,
- const FX_COLORREF & color)
-{
- CFX_PathData path;
- CPDF_Rect rcTemp(rect);
- path.AppendRect(rcTemp.left,rcTemp.bottom,rcTemp.right,rcTemp.top);
- pDevice->DrawPath(&path, pUser2Device, NULL, color, 0, FXFILL_WINDING);
-}
-
-void CPWL_Utils::DrawFillArea(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
- const CPDF_Point* pPts, FX_INT32 nCount, const FX_COLORREF& color)
-{
- CFX_PathData path;
- path.SetPointCount(nCount);
-
- path.SetPoint(0, pPts[0].x, pPts[0].y, FXPT_MOVETO);
- for (FX_INT32 i=1; i<nCount; i++)
- path.SetPoint(i, pPts[i].x, pPts[i].y, FXPT_LINETO);
-
- pDevice->DrawPath(&path, pUser2Device, NULL, color, 0, FXFILL_ALTERNATE);
-}
-
-void CPWL_Utils::DrawStrokeRect(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,const CPDF_Rect & rect,
- const FX_COLORREF & color, FX_FLOAT fWidth)
-{
- CFX_PathData path;
- CPDF_Rect rcTemp(rect);
- path.AppendRect(rcTemp.left,rcTemp.bottom,rcTemp.right,rcTemp.top);
-
- CFX_GraphStateData gsd;
- gsd.m_LineWidth = fWidth;
-
- pDevice->DrawPath(&path, pUser2Device, &gsd, 0, color, FXFILL_ALTERNATE);
-}
-
-void CPWL_Utils::DrawStrokeLine(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
- const CPDF_Point & ptMoveTo, const CPDF_Point & ptLineTo, const FX_COLORREF & color, FX_FLOAT fWidth)
-{
- CFX_PathData path;
- path.SetPointCount(2);
- path.SetPoint(0, ptMoveTo.x, ptMoveTo.y, FXPT_MOVETO);
- path.SetPoint(1, ptLineTo.x, ptLineTo.y, FXPT_LINETO);
-
- CFX_GraphStateData gsd;
- gsd.m_LineWidth = fWidth;
-
- pDevice->DrawPath(&path, pUser2Device, &gsd, 0, color, FXFILL_ALTERNATE);
-}
-
-void CPWL_Utils::DrawFillRect(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,const CPDF_Rect & rect,
- const CPWL_Color & color, FX_INT32 nTransparancy)
-{
- CPWL_Utils::DrawFillRect(pDevice,pUser2Device,rect,PWLColorToFXColor(color,nTransparancy));
-}
-
-void CPWL_Utils::DrawShadow(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
- FX_BOOL bVertical, FX_BOOL bHorizontal, CPDF_Rect rect,
- FX_INT32 nTransparancy, FX_INT32 nStartGray, FX_INT32 nEndGray)
-{
- FX_FLOAT fStepGray = 1.0f;
-
- if (bVertical)
- {
- fStepGray = (nEndGray - nStartGray) / rect.Height();
-
- for (FX_FLOAT fy=rect.bottom+0.5f; fy<=rect.top-0.5f; fy+=1.0f)
- {
- FX_INT32 nGray = nStartGray + (FX_INT32)(fStepGray * (fy-rect.bottom));
- CPWL_Utils::DrawStrokeLine(pDevice, pUser2Device, CPDF_Point(rect.left, fy),
- CPDF_Point(rect.right, fy), ArgbEncode(nTransparancy, nGray, nGray, nGray), 1.5f);
- }
- }
-
- if (bHorizontal)
- {
- fStepGray = (nEndGray - nStartGray) / rect.Width();
-
- for (FX_FLOAT fx=rect.left+0.5f; fx<=rect.right-0.5f; fx+=1.0f)
- {
- FX_INT32 nGray = nStartGray + (FX_INT32)(fStepGray * (fx-rect.left));
- CPWL_Utils::DrawStrokeLine(pDevice, pUser2Device, CPDF_Point(fx, rect.bottom),
- CPDF_Point(fx, rect.top), ArgbEncode(nTransparancy, nGray, nGray, nGray), 1.5f);
- }
- }
-}
-
-void CPWL_Utils::DrawBorder(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
- const CPDF_Rect & rect, FX_FLOAT fWidth,
- const CPWL_Color & color, const CPWL_Color & crLeftTop, const CPWL_Color & crRightBottom,
- FX_INT32 nStyle, const CPWL_Dash & dash, FX_INT32 nTransparancy)
-{
- FX_FLOAT fLeft = rect.left;
- FX_FLOAT fRight = rect.right;
- FX_FLOAT fTop = rect.top;
- FX_FLOAT fBottom = rect.bottom;
-
- if (fWidth > 0.0f)
- {
- FX_FLOAT fHalfWidth = fWidth / 2.0f;
-
- switch (nStyle)
- {
- default:
- case PBS_SOLID:
- {
- CFX_PathData path;
- path.AppendRect(fLeft, fBottom, fRight, fTop);
- path.AppendRect(fLeft + fWidth, fBottom + fWidth, fRight - fWidth, fTop - fWidth);
- pDevice->DrawPath(&path, pUser2Device, NULL, PWLColorToFXColor(color,nTransparancy), 0, FXFILL_ALTERNATE);
- }
- break;
- case PBS_DASH:
- {
- CFX_PathData path;
-
- path.SetPointCount(5);
- path.SetPoint(0, fLeft + fWidth / 2.0f, fBottom + fWidth / 2.0f, FXPT_MOVETO);
- path.SetPoint(1, fLeft + fWidth / 2.0f, fTop - fWidth / 2.0f, FXPT_LINETO);
- path.SetPoint(2, fRight - fWidth / 2.0f, fTop - fWidth / 2.0f, FXPT_LINETO);
- path.SetPoint(3, fRight - fWidth / 2.0f, fBottom + fWidth / 2.0f, FXPT_LINETO);
- path.SetPoint(4, fLeft + fWidth / 2.0f, fBottom + fWidth / 2.0f, FXPT_LINETO);
-
- CFX_GraphStateData gsd;
- gsd.SetDashCount(2);
- gsd.m_DashArray[0] = 3.0f;
- gsd.m_DashArray[1] = 3.0f;
- gsd.m_DashPhase = 0;
-
- gsd.m_LineWidth = fWidth;
- pDevice->DrawPath(&path, pUser2Device, &gsd, 0, PWLColorToFXColor(color,nTransparancy), FXFILL_WINDING);
- }
- break;
- case PBS_BEVELED:
- case PBS_INSET:
- {
- CFX_GraphStateData gsd;
- gsd.m_LineWidth = fHalfWidth;
-
- CFX_PathData pathLT;
-
- pathLT.SetPointCount(7);
- pathLT.SetPoint(0, fLeft + fHalfWidth, fBottom + fHalfWidth, FXPT_MOVETO);
- pathLT.SetPoint(1, fLeft + fHalfWidth, fTop - fHalfWidth, FXPT_LINETO);
- pathLT.SetPoint(2, fRight - fHalfWidth, fTop - fHalfWidth, FXPT_LINETO);
- pathLT.SetPoint(3, fRight - fHalfWidth * 2, fTop - fHalfWidth * 2, FXPT_LINETO);
- pathLT.SetPoint(4, fLeft + fHalfWidth * 2, fTop - fHalfWidth * 2, FXPT_LINETO);
- pathLT.SetPoint(5, fLeft + fHalfWidth * 2, fBottom + fHalfWidth * 2, FXPT_LINETO);
- pathLT.SetPoint(6, fLeft + fHalfWidth, fBottom + fHalfWidth, FXPT_LINETO);
-
- pDevice->DrawPath(&pathLT, pUser2Device, &gsd, PWLColorToFXColor(crLeftTop,nTransparancy), 0, FXFILL_ALTERNATE);
-
- CFX_PathData pathRB;
-
- pathRB.SetPointCount(7);
- pathRB.SetPoint(0, fRight - fHalfWidth, fTop - fHalfWidth, FXPT_MOVETO);
- pathRB.SetPoint(1, fRight - fHalfWidth, fBottom + fHalfWidth, FXPT_LINETO);
- pathRB.SetPoint(2, fLeft + fHalfWidth, fBottom + fHalfWidth, FXPT_LINETO);
- pathRB.SetPoint(3, fLeft + fHalfWidth * 2, fBottom + fHalfWidth * 2, FXPT_LINETO);
- pathRB.SetPoint(4, fRight - fHalfWidth * 2, fBottom + fHalfWidth * 2, FXPT_LINETO);
- pathRB.SetPoint(5, fRight - fHalfWidth * 2, fTop - fHalfWidth * 2, FXPT_LINETO);
- pathRB.SetPoint(6, fRight - fHalfWidth, fTop - fHalfWidth, FXPT_LINETO);
-
- pDevice->DrawPath(&pathRB, pUser2Device, &gsd, PWLColorToFXColor(crRightBottom,nTransparancy), 0, FXFILL_ALTERNATE);
-
- CFX_PathData path;
-
- path.AppendRect(fLeft, fBottom, fRight, fTop);
- path.AppendRect(fLeft + fHalfWidth, fBottom + fHalfWidth, fRight - fHalfWidth, fTop - fHalfWidth);
-
- pDevice->DrawPath(&path, pUser2Device, &gsd, PWLColorToFXColor(color,nTransparancy), 0, FXFILL_ALTERNATE);
- }
- break;
- case PBS_UNDERLINED:
- {
- CFX_PathData path;
-
- path.SetPointCount(2);
- path.SetPoint(0, fLeft, fBottom + fWidth / 2, FXPT_MOVETO);
- path.SetPoint(1, fRight, fBottom + fWidth / 2, FXPT_LINETO);
-
- CFX_GraphStateData gsd;
- gsd.m_LineWidth = fWidth;
-
- pDevice->DrawPath(&path, pUser2Device, &gsd,0, PWLColorToFXColor(color,nTransparancy), FXFILL_ALTERNATE);
- }
- break;
- case PBS_SHADOW:
- {
- CFX_PathData path;
- path.AppendRect(fLeft, fBottom, fRight, fTop);
- path.AppendRect(fLeft + fWidth, fBottom + fWidth, fRight - fWidth, fTop - fWidth);
- pDevice->DrawPath(&path, pUser2Device, NULL, PWLColorToFXColor(color,nTransparancy/2), 0, FXFILL_ALTERNATE);
- }
- break;
- }
- }
-}
-
-static void AddSquigglyPath(CFX_PathData & PathData, FX_FLOAT fStartX, FX_FLOAT fEndX, FX_FLOAT fY, FX_FLOAT fStep)
-{
- PathData.AddPointCount(1);
- PathData.SetPoint(PathData.GetPointCount() - 1, fStartX, fY, FXPT_MOVETO);
-
- FX_FLOAT fx;
- FX_INT32 i;
-
- for (i=1,fx=fStartX+fStep; fx<fEndX; fx+=fStep,i++)
- {
- PathData.AddPointCount(1);
- PathData.SetPoint(PathData.GetPointCount() - 1, fx, fY + (i&1)*fStep, FXPT_LINETO);
- }
-}
-
-static void AddSpellCheckObj(CFX_PathData & PathData, IFX_Edit* pEdit, const CPVT_WordRange& wrWord)
-{
- FX_FLOAT fStartX = 0.0f;
- FX_FLOAT fEndX = 0.0f;
- FX_FLOAT fY = 0.0f;
- FX_FLOAT fStep = 0.0f;
-
- FX_BOOL bBreak = FALSE;
-
- if (IFX_Edit_Iterator* pIterator = pEdit->GetIterator())
- {
- pIterator->SetAt(wrWord.BeginPos);
-
- do
- {
- CPVT_WordPlace place = pIterator->GetAt();
-
- CPVT_Line line;
- if (pIterator->GetLine(line))
- {
- fY = line.ptLine.y;
- fStep = (line.fLineAscent - line.fLineDescent) / 16.0f;
- }
-
- if (place.LineCmp(wrWord.BeginPos) == 0)
- {
- pIterator->SetAt(wrWord.BeginPos);
- CPVT_Word word;
- if (pIterator->GetWord(word))
- {
- fStartX = word.ptWord.x;
- }
- }
- else
- {
- fStartX = line.ptLine.x;
- }
-
- if (place.LineCmp(wrWord.EndPos) == 0)
- {
- pIterator->SetAt(wrWord.EndPos);
- CPVT_Word word;
- if (pIterator->GetWord(word))
- {
- fEndX = word.ptWord.x + word.fWidth;
- }
-
- bBreak = TRUE;
- }
- else
- {
- fEndX = line.ptLine.x + line.fLineWidth;
- }
-
- AddSquigglyPath(PathData, fStartX, fEndX, fY, fStep);
-
- if (bBreak) break;
- }
- while (pIterator->NextLine());
- }
-}
-
-void CPWL_Utils::DrawEditSpellCheck(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, IFX_Edit* pEdit,
- const CPDF_Rect& rcClip, const CPDF_Point& ptOffset, const CPVT_WordRange* pRange,
- IPWL_SpellCheck * pSpellCheck)
-{
- const FX_COLORREF crSpell = ArgbEncode(255,255,0,0);
-
- //for spellcheck
- FX_BOOL bLatinWord = FALSE;
- CPVT_WordPlace wpWordStart;
- CFX_ByteString sLatinWord;
-
- CFX_PathData pathSpell;
-
- pDevice->SaveState();
-
- if (!rcClip.IsEmpty())
- {
- CPDF_Rect rcTemp = rcClip;
- pUser2Device->TransformRect(rcTemp);
- FX_RECT rcDevClip;
- rcDevClip.left = (FX_INT32)rcTemp.left;
- rcDevClip.right = (FX_INT32)rcTemp.right;
- rcDevClip.top = (FX_INT32)rcTemp.top;
- rcDevClip.bottom = (FX_INT32)rcTemp.bottom;
- pDevice->SetClip_Rect(&rcDevClip);
- }
-
- if (IFX_Edit_Iterator* pIterator = pEdit->GetIterator())
- {
- if (pEdit->GetFontMap())
- {
- if (pRange)
- pIterator->SetAt(pRange->BeginPos);
- else
- pIterator->SetAt(0);
-
- CPVT_WordPlace oldplace;
-
- while (pIterator->NextWord())
- {
- CPVT_WordPlace place = pIterator->GetAt();
- if (pRange && place.WordCmp(pRange->EndPos) > 0) break;
-
- CPVT_Word word;
- if (pIterator->GetWord(word))
- {
- if (FX_EDIT_ISLATINWORD(word.Word))
- {
- if (!bLatinWord)
- {
- wpWordStart = place;
- bLatinWord = TRUE;
- }
-
- sLatinWord += (char)word.Word;
- }
- else
- {
- if (bLatinWord)
- {
- if (!sLatinWord.IsEmpty())
- {
- if (pSpellCheck && !pSpellCheck->CheckWord(sLatinWord))
- {
- AddSpellCheckObj(pathSpell,pEdit,CPVT_WordRange(wpWordStart,oldplace));
- pIterator->SetAt(place);
- }
- }
- bLatinWord = FALSE;
- }
-
- sLatinWord.Empty();
- }
-
- oldplace = place;
- }
- else
- {
- if (bLatinWord)
- {
- if (!sLatinWord.IsEmpty())
- {
- if (pSpellCheck && !pSpellCheck->CheckWord(sLatinWord))
- {
- AddSpellCheckObj(pathSpell,pEdit,CPVT_WordRange(wpWordStart,oldplace));
- pIterator->SetAt(place);
- }
- }
- bLatinWord = FALSE;
- }
-
- sLatinWord.Empty();
- }
- }
-
- if (!sLatinWord.IsEmpty())
- {
- if (pSpellCheck && !pSpellCheck->CheckWord(sLatinWord))
- {
- AddSpellCheckObj(pathSpell,pEdit,CPVT_WordRange(wpWordStart,oldplace));
- }
- }
- }
- }
-
- CFX_GraphStateData gsd;
- gsd.m_LineWidth = 0;
- if (pathSpell.GetPointCount() > 0)
- pDevice->DrawPath(&pathSpell, pUser2Device, &gsd, 0, crSpell, FXFILL_ALTERNATE);
-
- pDevice->RestoreState();
-}
-
-FX_BOOL CPWL_Utils::IsBlackOrWhite(const CPWL_Color& color)
-{
- switch (color.nColorType)
- {
- case COLORTYPE_TRANSPARENT:
- return FALSE;
- case COLORTYPE_GRAY:
- return color.fColor1 < 0.5f;
- case COLORTYPE_RGB:
- return color.fColor1 + color.fColor2 + color.fColor3 < 1.5f;
- case COLORTYPE_CMYK:
- return color.fColor1 + color.fColor2 + color.fColor3 + color.fColor4 > 2.0f;
- }
-
- return TRUE;
-}
-
-CPWL_Color CPWL_Utils::GetReverseColor(const CPWL_Color& color)
-{
- CPWL_Color crRet = color;
-
- switch (color.nColorType)
- {
- case COLORTYPE_GRAY:
- crRet.fColor1 = 1.0f - crRet.fColor1;
- break;
- case COLORTYPE_RGB:
- crRet.fColor1 = 1.0f - crRet.fColor1;
- crRet.fColor2 = 1.0f - crRet.fColor2;
- crRet.fColor3 = 1.0f - crRet.fColor3;
- break;
- case COLORTYPE_CMYK:
- crRet.fColor1 = 1.0f - crRet.fColor1;
- crRet.fColor2 = 1.0f - crRet.fColor2;
- crRet.fColor3 = 1.0f - crRet.fColor3;
- crRet.fColor4 = 1.0f - crRet.fColor4;
- break;
- }
-
- return crRet;
-}
-
-CFX_ByteString CPWL_Utils::GetIconAppStream(FX_INT32 nType, const CPDF_Rect& rect, const CPWL_Color& crFill,
- const CPWL_Color& crStroke)
-{
- CFX_ByteString sAppStream = CPWL_Utils::GetColorAppStream(crStroke, FALSE);
- sAppStream += CPWL_Utils::GetColorAppStream(crFill, TRUE);
-
- CFX_ByteString sPath;
- CFX_PathData path;
-
- switch (nType)
- {
- case PWL_ICONTYPE_CHECKMARK:
- GetGraphics_Checkmark(sPath, path, rect, PWLPT_STREAM);
- break;
- case PWL_ICONTYPE_CIRCLE:
- GetGraphics_Circle(sPath, path, rect, PWLPT_STREAM);
- break;
- case PWL_ICONTYPE_COMMENT:
- GetGraphics_Comment(sPath, path, rect, PWLPT_STREAM);
- break;
- case PWL_ICONTYPE_CROSS:
- GetGraphics_Cross(sPath, path, rect, PWLPT_STREAM);
- break;
- case PWL_ICONTYPE_HELP:
- GetGraphics_Help(sPath, path, rect, PWLPT_STREAM);
- break;
- case PWL_ICONTYPE_INSERTTEXT:
- GetGraphics_InsertText(sPath, path, rect, PWLPT_STREAM);
- break;
- case PWL_ICONTYPE_KEY:
- GetGraphics_Key(sPath, path, rect, PWLPT_STREAM);
- break;
- case PWL_ICONTYPE_NEWPARAGRAPH:
- GetGraphics_NewParagraph(sPath, path, rect, PWLPT_STREAM);
- break;
- case PWL_ICONTYPE_TEXTNOTE:
- GetGraphics_TextNote(sPath, path, rect, PWLPT_STREAM);
- break;
- case PWL_ICONTYPE_PARAGRAPH:
- GetGraphics_Paragraph(sPath, path, rect, PWLPT_STREAM);
- break;
- case PWL_ICONTYPE_RIGHTARROW:
- GetGraphics_RightArrow(sPath, path, rect, PWLPT_STREAM);
- break;
- case PWL_ICONTYPE_RIGHTPOINTER:
- GetGraphics_RightPointer(sPath, path, rect, PWLPT_STREAM);
- break;
- case PWL_ICONTYPE_STAR:
- GetGraphics_Star(sPath, path, rect, PWLPT_STREAM);
- break;
- case PWL_ICONTYPE_UPARROW:
- GetGraphics_UpArrow(sPath, path, rect, PWLPT_STREAM);
- break;
- case PWL_ICONTYPE_UPLEFTARROW:
- GetGraphics_UpLeftArrow(sPath, path, rect, PWLPT_STREAM);
- break;
- case PWL_ICONTYPE_GRAPH:
- GetGraphics_Graph(sPath, path, rect, PWLPT_STREAM);
- break;
- case PWL_ICONTYPE_PAPERCLIP:
- GetGraphics_Paperclip(sPath, path, rect, PWLPT_STREAM);
- break;
- case PWL_ICONTYPE_ATTACHMENT:
- GetGraphics_Attachment(sPath, path, rect, PWLPT_STREAM);
- break;
- case PWL_ICONTYPE_TAG:
- GetGraphics_Tag(sPath, path, rect, PWLPT_STREAM);
- break;
- case PWL_ICONTYPE_FOXIT:
- GetGraphics_Foxit(sPath, path, rect, PWLPT_STREAM);
- break;
- }
-
- sAppStream += sPath;
- if (crStroke.nColorType != COLORTYPE_TRANSPARENT)
- sAppStream += "B*\n";
- else
- sAppStream += "f*\n";
-
- return sAppStream;
-}
-
-void CPWL_Utils::DrawIconAppStream(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
- FX_INT32 nType, const CPDF_Rect & rect, const CPWL_Color& crFill, const CPWL_Color& crStroke, const FX_INT32 nTransparancy)
-{
- CFX_GraphStateData gsd;
- gsd.m_LineWidth = 1.0f;
-
- CFX_ByteString sPath;
- CFX_PathData path;
-
- switch (nType)
- {
- case PWL_ICONTYPE_CHECKMARK:
- GetGraphics_Checkmark(sPath, path, rect, PWLPT_PATHDATA);
- break;
- case PWL_ICONTYPE_CIRCLE:
- GetGraphics_Circle(sPath, path, rect, PWLPT_PATHDATA);
- break;
- case PWL_ICONTYPE_COMMENT:
- GetGraphics_Comment(sPath, path, rect, PWLPT_PATHDATA);
- break;
- case PWL_ICONTYPE_CROSS:
- GetGraphics_Cross(sPath, path, rect, PWLPT_PATHDATA);
- break;
- case PWL_ICONTYPE_HELP:
- GetGraphics_Help(sPath, path, rect, PWLPT_PATHDATA);
- break;
- case PWL_ICONTYPE_INSERTTEXT:
- GetGraphics_InsertText(sPath, path, rect, PWLPT_PATHDATA);
- break;
- case PWL_ICONTYPE_KEY:
- GetGraphics_Key(sPath, path, rect, PWLPT_PATHDATA);
- break;
- case PWL_ICONTYPE_NEWPARAGRAPH:
- GetGraphics_NewParagraph(sPath, path, rect, PWLPT_PATHDATA);
- break;
- case PWL_ICONTYPE_TEXTNOTE:
- GetGraphics_TextNote(sPath, path, rect, PWLPT_PATHDATA);
- break;
- case PWL_ICONTYPE_PARAGRAPH:
- GetGraphics_Paragraph(sPath, path, rect, PWLPT_PATHDATA);
- break;
- case PWL_ICONTYPE_RIGHTARROW:
- GetGraphics_RightArrow(sPath, path, rect, PWLPT_PATHDATA);
- break;
- case PWL_ICONTYPE_RIGHTPOINTER:
- GetGraphics_RightPointer(sPath, path, rect, PWLPT_PATHDATA);
- break;
- case PWL_ICONTYPE_STAR:
- GetGraphics_Star(sPath, path, rect, PWLPT_PATHDATA);
- break;
- case PWL_ICONTYPE_UPARROW:
- GetGraphics_UpArrow(sPath, path, rect, PWLPT_PATHDATA);
- break;
- case PWL_ICONTYPE_UPLEFTARROW:
- GetGraphics_UpLeftArrow(sPath, path, rect, PWLPT_PATHDATA);
- break;
- case PWL_ICONTYPE_GRAPH:
- GetGraphics_Graph(sPath, path, rect, PWLPT_PATHDATA);
- break;
- case PWL_ICONTYPE_PAPERCLIP:
- GetGraphics_Paperclip(sPath, path, rect, PWLPT_PATHDATA);
- break;
- case PWL_ICONTYPE_ATTACHMENT:
- GetGraphics_Attachment(sPath, path, rect, PWLPT_PATHDATA);
- break;
- case PWL_ICONTYPE_TAG:
- GetGraphics_Tag(sPath, path, rect, PWLPT_PATHDATA);
- break;
- case PWL_ICONTYPE_FOXIT:
- GetGraphics_Foxit(sPath, path, rect, PWLPT_PATHDATA);
- break;
- default:
- return;
- }
-
- pDevice->DrawPath(&path, pUser2Device, &gsd,
- PWLColorToFXColor(crFill,nTransparancy), PWLColorToFXColor(crStroke,nTransparancy), FXFILL_ALTERNATE);
-}
-
-void CPWL_Utils::GetGraphics_Checkmark(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type)
-{
- FX_FLOAT fWidth = crBBox.right - crBBox.left;
- FX_FLOAT fHeight = crBBox.top - crBBox.bottom;
-
- CPWL_PathData PathArray[] =
- {
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 15.0f, crBBox.bottom + fHeight * 2 / 5.0f),PWLPT_MOVETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 15.0f + PWL_BEZIER*(fWidth / 7.0f - fWidth / 15.0f),
- crBBox.bottom + fHeight * 2 / 5.0f + PWL_BEZIER*(fHeight * 2 / 7.0f - fHeight * 2 / 5.0f)), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 4.5f + PWL_BEZIER*(fWidth / 5.0f - fWidth / 4.5f),
- crBBox.bottom + fHeight / 16.0f + PWL_BEZIER*(fHeight / 5.0f - fHeight / 16.0f)), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 4.5f, crBBox.bottom + fHeight / 16.0f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 4.5f + PWL_BEZIER*(fWidth / 4.4f - fWidth / 4.5f),
- crBBox.bottom + fHeight / 16.0f - PWL_BEZIER*fHeight / 16.0f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 3.0f + PWL_BEZIER*(fWidth / 4.0f - fWidth / 3.0f),
- crBBox.bottom), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 3.0f, crBBox.bottom), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 3.0f + PWL_BEZIER*fWidth*(1/7.0f + 2/15.0f),
- crBBox.bottom + PWL_BEZIER*fHeight * 4 / 5.0f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 14 / 15.0f + PWL_BEZIER*fWidth*(1/7.0f - 7/15.0f),
- crBBox.bottom + fHeight * 15/16.0f + PWL_BEZIER*(fHeight * 4/5.0f - fHeight * 15/16.0f)), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 14 / 15.0f,crBBox.bottom + fHeight * 15 / 16.0f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 14 / 15.0f + PWL_BEZIER*(fWidth * 7 / 15.0f - fWidth * 14 / 15.0f),
- crBBox.bottom + fHeight * 15 / 16.0f + PWL_BEZIER*(fHeight * 8 / 7.0f - fHeight * 15 / 16.0f)), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 3.6f + PWL_BEZIER*(fWidth / 3.4f - fWidth / 3.6f),
- crBBox.bottom + fHeight / 3.5f + PWL_BEZIER*(fHeight / 3.5f - fHeight / 3.5f)), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 3.6f,crBBox.bottom + fHeight / 3.5f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 3.6f,
- crBBox.bottom + fHeight / 3.5f + PWL_BEZIER*(fHeight / 4.0f - fHeight / 3.5f)), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 15.0f + PWL_BEZIER*(fWidth / 3.5f - fWidth / 15.0f),
- crBBox.bottom + fHeight * 2 / 5.0f + PWL_BEZIER*(fHeight * 3.5f / 5.0f - fHeight * 2 / 5.0f)), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 15.0f,crBBox.bottom + fHeight * 2 / 5.0f), PWLPT_BEZIERTO)
- };
-
- if(type == PWLPT_STREAM)
- sPathData = GetAppStreamFromArray(PathArray, 16);
- else
- GetPathDataFromArray(path, PathArray, 16);
-}
-
-void CPWL_Utils::GetGraphics_Circle(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type)
-{
- FX_FLOAT fWidth = crBBox.right - crBBox.left;
- FX_FLOAT fHeight = crBBox.top - crBBox.bottom;
-
- CPWL_PathData PathArray[] =
- {
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/15.0f,crBBox.bottom + fHeight/2.0f), PWLPT_MOVETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/15.0f,
- crBBox.bottom + fHeight/2.0f + PWL_BEZIER*(fHeight*14/15.0f - fHeight/2.0f)), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f - PWL_BEZIER*(fWidth/2.0f - fWidth/15.0f), crBBox.top - fHeight/15.0f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f,crBBox.top - fHeight/15.0f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f + PWL_BEZIER*(fWidth*14/15.0f - fWidth/2.0f), crBBox.top - fHeight/15.0f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth/15.0f, crBBox.bottom + fHeight/2.0f + PWL_BEZIER*(fHeight*14/15.0f - fHeight/2.0f)), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth/15.0f, crBBox.bottom + fHeight/2.0f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth/15.0f, crBBox.bottom + fHeight/2.0f - PWL_BEZIER*(fHeight/2.0f - fHeight/15.0f)), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f + PWL_BEZIER*(fWidth*14/15.0f - fWidth/2.0f), crBBox.bottom + fHeight/15.0f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f, crBBox.bottom + fHeight/15.0f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f - PWL_BEZIER*(fWidth/2.0f - fWidth/15.0f), crBBox.bottom + fHeight/15.0f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/15.0f, crBBox.bottom + fHeight/2.0f - PWL_BEZIER*(fHeight/2.0f - fHeight/15.0f)), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/15.0f,crBBox.bottom + fHeight/2.0f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*3/15.0f, crBBox.bottom + fHeight/2.0f), PWLPT_MOVETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*3/15.0f, crBBox.bottom + fHeight/2.0f + PWL_BEZIER*(fHeight*4/5.0f - fHeight/2.0f)), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f - PWL_BEZIER*(fWidth/2.0f - fWidth*3/15.0f), crBBox.top - fHeight*3/15.0f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f, crBBox.top - fHeight*3/15.0f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f + PWL_BEZIER*(fWidth*4/5.0f - fWidth/2.0f), crBBox.top - fHeight*3/15.0f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth*3/15.0f, crBBox.bottom + fHeight/2.0f + PWL_BEZIER*(fHeight*4/5.0f - fHeight/2.0f)), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth*3/15.0f, crBBox.bottom + fHeight/2.0f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth*3/15.0f, crBBox.bottom + fHeight/2.0f - PWL_BEZIER*(fHeight*4/5.0f - fHeight/2.0f)), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f + PWL_BEZIER*(fWidth*4/5.0f - fWidth/2.0f), crBBox.bottom + fHeight*3/15.0f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f, crBBox.bottom + fHeight*3/15.0f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f - PWL_BEZIER*(fWidth*4/5.0f - fWidth/2.0f), crBBox.bottom + fHeight*3/15.0f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*3/15.0f, crBBox.bottom + fHeight/2.0f - PWL_BEZIER*(fHeight*4/5.0f - fHeight/2.0f)), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*3/15.0f, crBBox.bottom + fHeight/2.0f), PWLPT_BEZIERTO)
- };
-
- if(type == PWLPT_STREAM)
- sPathData = GetAppStreamFromArray(PathArray, 26);
- else
- GetPathDataFromArray(path, PathArray, 26);
-}
-
-void CPWL_Utils::GetGraphics_Comment(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type)
-{
- FX_FLOAT fWidth = crBBox.right - crBBox.left;
- FX_FLOAT fHeight = crBBox.top - crBBox.bottom;
-
- CPWL_PathData PathArray[] =
- {
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/15.0f, crBBox.top - fHeight/6.0f), PWLPT_MOVETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/15.0f, crBBox.top - fHeight/6.0f + PWL_BEZIER*(fHeight/6.0f - fHeight/10.0f)), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*2/15.0f - PWL_BEZIER*fWidth/15.0f, crBBox.top - fHeight/10.0f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*2/15.0f, crBBox.top - fHeight/10.0f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth*2/15.0f, crBBox.top - fHeight/10.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth*2/15.0f + PWL_BEZIER*fWidth/15.0f, crBBox.top - fHeight/10.0f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth/15.0f, crBBox.top - fHeight/6 + PWL_BEZIER*(fHeight/6.0f - fHeight/10.0f)), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth/15.0f, crBBox.top - fHeight/6.0f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth/15.0f, crBBox.bottom + fHeight/3.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth/15.0f, crBBox.bottom + fHeight*4/15.0f + PWL_BEZIER*fHeight/15.0f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth*2/15.0f + PWL_BEZIER*fWidth/15.0f, crBBox.bottom + fHeight*4/15.0f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth*2/15.0f, crBBox.bottom + fHeight*4/15.0f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*5/15.0f, crBBox.bottom + fHeight*4/15.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*5/15.0f, crBBox.bottom + fHeight*2/15 + PWL_BEZIER*fHeight*2/15.0f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*5/15.0f - PWL_BEZIER*fWidth*2/15.0f, crBBox.bottom + fHeight*2/15.0f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*6/30.0f, crBBox.bottom + fHeight*2/15.0f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*7/30.0f + PWL_BEZIER*fWidth/30.0f, crBBox.bottom + fHeight*2/15.0f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*7/30.0f, crBBox.bottom + fHeight*2/15.0f + PWL_BEZIER*fHeight*2/15.0f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*7/30.0f, crBBox.bottom + fHeight*4/15.0f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*2/15.0f, crBBox.bottom + fHeight*4/15.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*2/15.0f - PWL_BEZIER*fWidth/15.0f, crBBox.bottom + fHeight*4/15.0f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/15.0f, crBBox.bottom + fHeight/3.0f - PWL_BEZIER*fHeight/15.0f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/15.0f, crBBox.bottom + fHeight/3.0f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/15.0f, crBBox.top - fHeight/6.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*2/15.0f, crBBox.top - fHeight*8/30.0f), PWLPT_MOVETO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth*2/15.0f, crBBox.top - fHeight*8/30.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*2/15, crBBox.top - fHeight*25/60.0f), PWLPT_MOVETO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth*2/15.0f, crBBox.top - fHeight*25/60.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*2/15.0f, crBBox.top - fHeight*17/30.0f), PWLPT_MOVETO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth*4/15.0f, crBBox.top - fHeight*17/30.0f), PWLPT_LINETO)
- };
-
- if(type == PWLPT_STREAM)
- sPathData = GetAppStreamFromArray(PathArray, 30);
- else
- GetPathDataFromArray(path, PathArray, 30);
-}
-
-void CPWL_Utils::GetGraphics_Cross(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type)
-{
- FX_FLOAT fWidth = crBBox.right - crBBox.left;
- FX_FLOAT fHeight = crBBox.top - crBBox.bottom;
- //FX_FLOAT fcatercorner = (FX_FLOAT)sqrt(fWidth*fWidth + fHeight*fHeight);
- CPWL_Point center_point(crBBox.left + fWidth/2, crBBox.bottom + fHeight/2);
-
- CPWL_PathData PathArray[] =
- {
- CPWL_PathData(CPWL_Point(center_point.x, center_point.y + fHeight/10.0f), PWLPT_MOVETO),
- CPWL_PathData(CPWL_Point(center_point.x + fWidth*0.3f, center_point.y + fHeight/10.0f + fWidth*0.3f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(center_point.x + fWidth/10.0f + fWidth*0.3f, center_point.y + fHeight*0.3f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(center_point.x + fWidth/10.0f, center_point.y), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(center_point.x + fWidth/10.0f + fWidth*0.3f, center_point.y - fHeight*0.3f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(center_point.x + fWidth*0.3f, center_point.y - fHeight/10.0f - fHeight*0.3f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(center_point.x, center_point.y - fHeight/10.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(center_point.x - fWidth*0.3f, center_point.y - fHeight/10 - fHeight*0.3f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(center_point.x - fWidth/10.0f - fWidth*0.3f, center_point.y - fHeight*0.3f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(center_point.x - fWidth/10, center_point.y), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(center_point.x - fWidth/10 - fWidth*0.3f, center_point.y + fHeight*0.3f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(center_point.x - fWidth*0.3f, center_point.y + fHeight/10.0f + fHeight*0.3f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(center_point.x, center_point.y + fHeight/10.0f), PWLPT_LINETO)
- };
-
- if(type == PWLPT_STREAM)
- sPathData = GetAppStreamFromArray(PathArray, 13);
- else
- GetPathDataFromArray(path, PathArray, 13);
-}
-
-void CPWL_Utils::GetGraphics_Help(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type)
-{
- FX_FLOAT fWidth = crBBox.right - crBBox.left;
- FX_FLOAT fHeight = crBBox.top - crBBox.bottom;
-
- CPWL_PathData PathArray[] =
- {
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/60.0f, crBBox.bottom + fHeight/2.0f), PWLPT_MOVETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/60.0f, crBBox.bottom + fHeight/2.0f + PWL_BEZIER*(fHeight/60.0f - fHeight/2.0f)), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f - PWL_BEZIER*(fWidth/2.0f - fWidth/60.0f), crBBox.bottom + fHeight/60.0f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f, crBBox.bottom + fHeight/60.0f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f + PWL_BEZIER*fWidth*29/60.0f, crBBox.bottom + fHeight/60.0f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth/60.0f, crBBox.bottom + fHeight/2.0f + PWL_BEZIER*(fHeight/60.0f - fHeight/2.0f)), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth/60.0f, crBBox.bottom + fHeight/2.0f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth/60.0f, crBBox.bottom + fHeight/2.0f + PWL_BEZIER*fHeight*29/60.0f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f + PWL_BEZIER*fWidth*29/60.0f, crBBox.top - fHeight/60.0f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f, crBBox.top - fHeight/60.0f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f - PWL_BEZIER*fWidth*29/60.0f, crBBox.top - fHeight/60.0f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/60.0f, crBBox.bottom + fHeight/2.0f + PWL_BEZIER*fHeight*29/60.0f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/60.0f, crBBox.bottom + fHeight/2.0f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.27f, crBBox.top - fHeight*0.36f), PWLPT_MOVETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.27f, crBBox.top - fHeight*0.36f + PWL_BEZIER*fHeight*0.23f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.5f - PWL_BEZIER*fWidth*0.23f, crBBox.bottom + fHeight*0.87f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.5f, crBBox.bottom + fHeight*0.87f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.5f + PWL_BEZIER*fWidth*0.23f, crBBox.bottom + fHeight*0.87f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.27f, crBBox.top - fHeight*0.36f + PWL_BEZIER*fHeight*0.23f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.27f, crBBox.top - fHeight*0.36f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.27f - fWidth*0.08f*0.2f, crBBox.top - fHeight*0.36f - fHeight*0.15f*0.7f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.35f + fWidth*0.08f*0.2f, crBBox.top - fHeight*0.51f + fHeight*0.15f*0.2f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.35f, crBBox.top - fHeight*0.51f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.35f - fWidth*0.1f*0.5f, crBBox.top - fHeight*0.51f - fHeight*0.15f*0.3f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.45f - fWidth*0.1f*0.5f, crBBox.top - fHeight*0.68f + fHeight*0.15f*0.5f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.45f, crBBox.top - fHeight*0.68f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.45f, crBBox.bottom + fHeight*0.30f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.45f, crBBox.bottom + fHeight*0.30f - fWidth*0.1f*0.7f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.55f, crBBox.bottom + fHeight*0.30f - fWidth*0.1f*0.7f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.55f, crBBox.bottom + fHeight*0.30f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.55f, crBBox.top - fHeight*0.66f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.55f - fWidth*0.1f*0.05f, crBBox.top - fHeight*0.66f + fHeight*0.18f*0.5f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.45f - fWidth*0.1f*0.05f, crBBox.top - fHeight*0.48f - fHeight*0.18f*0.3f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.45f, crBBox.top - fHeight*0.48f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.45f + fWidth*0.08f*0.2f, crBBox.top - fHeight*0.48f + fHeight*0.18f*0.2f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.37f - fWidth*0.08f*0.2f, crBBox.top - fHeight*0.36f - fHeight*0.18f*0.7f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.37f, crBBox.top - fHeight*0.36f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.37f, crBBox.top - fHeight*0.36f + PWL_BEZIER*fHeight*0.13f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.5f + PWL_BEZIER*fWidth*0.13f, crBBox.bottom + fHeight*0.77f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.5f, crBBox.bottom + fHeight*0.77f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.5f - PWL_BEZIER*fWidth*0.13f, crBBox.bottom + fHeight*0.77f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.37f, crBBox.top - fHeight*0.36f + PWL_BEZIER*fHeight*0.13f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.37f, crBBox.top - fHeight*0.36f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.37f, crBBox.top - fHeight*0.36f - fWidth*0.1f*0.6f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.27f, crBBox.top - fHeight*0.36f - fWidth*0.1f*0.6f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.27f, crBBox.top - fHeight*0.36f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.56f, crBBox.bottom + fHeight*0.13f), PWLPT_MOVETO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.56f, crBBox.bottom + fHeight*0.13f + PWL_BEZIER*fHeight*0.055f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.505f - PWL_BEZIER*fWidth*0.095f, crBBox.bottom + fHeight*0.185f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.505f, crBBox.bottom + fHeight*0.185f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.505f + PWL_BEZIER*fWidth*0.065f, crBBox.bottom + fHeight*0.185f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.44f, crBBox.bottom + fHeight*0.13f + PWL_BEZIER*fHeight*0.055f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.44f, crBBox.bottom + fHeight*0.13f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.44f, crBBox.bottom + fHeight*0.13f - PWL_BEZIER*fHeight*0.055f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.505f + PWL_BEZIER*fWidth*0.065f, crBBox.bottom + fHeight*0.075f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.505f, crBBox.bottom + fHeight*0.075f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.505f - PWL_BEZIER*fWidth*0.065f, crBBox.bottom + fHeight*0.075f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.56f, crBBox.bottom + fHeight*0.13f - PWL_BEZIER*fHeight*0.055f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.56f, crBBox.bottom + fHeight*0.13f), PWLPT_BEZIERTO)
- };
-
- if(type == PWLPT_STREAM)
- sPathData = GetAppStreamFromArray(PathArray, 59);
- else
- GetPathDataFromArray(path, PathArray, 59);
-}
-
-void CPWL_Utils::GetGraphics_InsertText(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type)
-{
- FX_FLOAT fWidth = crBBox.right - crBBox.left;
- FX_FLOAT fHeight = crBBox.top - crBBox.bottom;
-
- CPWL_PathData PathArray[] =
- {
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/10, crBBox.bottom + fHeight/10), PWLPT_MOVETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2, crBBox.top - fHeight*2/15), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth/10, crBBox.bottom + fHeight/10), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/10, crBBox.bottom + fHeight/10), PWLPT_LINETO)
- };
-
- if(type == PWLPT_STREAM)
- sPathData = GetAppStreamFromArray(PathArray, 4);
- else
- GetPathDataFromArray(path, PathArray, 4);
-}
-
-void CPWL_Utils::GetGraphics_Key(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type)
-{
- FX_FLOAT fWidth = crBBox.right - crBBox.left;
- FX_FLOAT fHeight = crBBox.top - crBBox.bottom;
- FX_FLOAT k = -fHeight/fWidth;
- CPWL_Point tail;
- CPWL_Point CicleCenter;
- tail.x = crBBox.left + fWidth*0.9f;
- tail.y = k*(tail.x - crBBox.right) + crBBox.bottom;
- CicleCenter.x = crBBox.left + fWidth*0.15f;
- CicleCenter.y = k*(CicleCenter.x - crBBox.right) + crBBox.bottom;
-
- CPWL_PathData PathArray[] =
- {
- CPWL_PathData(CPWL_Point(tail.x + fWidth/30.0f, -fWidth/30.0f/k + tail.y), PWLPT_MOVETO),
- CPWL_PathData(CPWL_Point(tail.x + fWidth/30.0f - fWidth*0.18f, -k*fWidth*0.18f - fWidth/30/k + tail.y), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(tail.x + fWidth/30 - fWidth*0.18f + fWidth*0.07f,
- -fWidth*0.07f/k - k*fWidth*0.18f - fWidth/30/k + tail.y), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(tail.x + fWidth/30 - fWidth*0.18f - fWidth/20 + fWidth*0.07f,
- -fWidth*0.07f/k - k*fWidth/20 - k*fWidth*0.18f - fWidth/30/k + tail.y), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(tail.x + fWidth/30 - fWidth*0.18f - fWidth/20,
- -k*fWidth/20 - k*fWidth*0.18f - fWidth/30/k + tail.y), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(tail.x + fWidth/30 - fWidth*0.18f - fWidth/20 - fWidth/15,
- -k*fWidth/15 - k*fWidth/20 - k*fWidth*0.18f - fWidth/30/k + tail.y), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(tail.x + fWidth/30 - fWidth*0.18f - fWidth/20 - fWidth/15 + fWidth*0.07f,
- -fWidth*0.07f/k - k*fWidth/15 - k*fWidth/20 - k*fWidth*0.18f - fWidth/30/k + tail.y), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(tail.x + fWidth/30 - fWidth*0.18f - fWidth/20 - fWidth/15 - fWidth/20 + fWidth*0.07f,
- -fWidth*0.07f/k + -k*fWidth/20 + -k*fWidth/15 - k*fWidth/20 - k*fWidth*0.18f - fWidth/30/k + tail.y), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(tail.x + fWidth/30 - fWidth*0.18f - fWidth/20 - fWidth/15 - fWidth/20,
- -k*fWidth/20 + -k*fWidth/15 - k*fWidth/20 - k*fWidth*0.18f - fWidth/30/k + tail.y), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(tail.x + fWidth/30 - fWidth*0.45f, -k*fWidth*0.45f - fWidth/30/k + tail.y), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(tail.x + fWidth/30 - fWidth*0.45f + fWidth*0.2f,
- -fWidth*0.4f/k - k*fWidth*0.45f - fWidth/30/k + tail.y), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(CicleCenter.x + fWidth*0.2f, - fWidth*0.1f/k + CicleCenter.y), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(CicleCenter.x, CicleCenter.y), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(CicleCenter.x - fWidth/60.0f, -k*fWidth/60 + CicleCenter.y), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(CicleCenter.x - fWidth/60, -k*fWidth/60 + CicleCenter.y), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(CicleCenter.x, CicleCenter.y), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(CicleCenter.x - fWidth*0.22f, fWidth*0.35f/k + CicleCenter.y - fHeight*0.05f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(tail.x - fWidth/30 - fWidth*0.45f - fWidth*0.18f, fWidth*0.05f/k - k*fWidth*0.45f + fWidth/30/k + tail.y - fHeight*0.05f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(tail.x - fWidth/30.0f - fWidth*0.45f, -k*fWidth*0.45f + fWidth/30.0f/k + tail.y), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(tail.x - fWidth/30.0f, fWidth/30.0f/k + tail.y), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(tail.x + fWidth/30, -fWidth/30/k + tail.y), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(CicleCenter.x + fWidth*0.08f, k*fWidth*0.08f + CicleCenter.y), PWLPT_MOVETO),
- CPWL_PathData(CPWL_Point(CicleCenter.x + fWidth*0.08f + fWidth*0.1f, -fWidth*0.1f/k + k*fWidth*0.08f + CicleCenter.y), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(CicleCenter.x + fWidth*0.22f + fWidth*0.1f, k*fWidth*0.22f + CicleCenter.y - fWidth*0.1f/k), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(CicleCenter.x + fWidth*0.22f, k*fWidth*0.22f + CicleCenter.y), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(CicleCenter.x + fWidth*0.22f - fWidth*0.1f, fWidth*0.1f/k + k*fWidth*0.22f + CicleCenter.y), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(CicleCenter.x + fWidth*0.08f - fWidth*0.1f, fWidth*0.1f/k + k*fWidth*0.08f + CicleCenter.y), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(CicleCenter.x + fWidth*0.08f, k*fWidth*0.08f + CicleCenter.y), PWLPT_BEZIERTO)
- };
-
- if(type == PWLPT_STREAM)
- sPathData = GetAppStreamFromArray(PathArray, 28);
- else
- GetPathDataFromArray(path, PathArray, 28);
-}
-
-void CPWL_Utils::GetGraphics_NewParagraph(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type)
-{
- FX_FLOAT fWidth = crBBox.right - crBBox.left;
- FX_FLOAT fHeight = crBBox.top - crBBox.bottom;
-
- CPWL_PathData PathArray[] =
- {
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f, crBBox.top - fHeight/20.0f), PWLPT_MOVETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/10.0f, crBBox.top - fHeight/2.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth/10.0f, crBBox.top - fHeight/2.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f, crBBox.top - fHeight/20.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.12f, crBBox.top - fHeight*17/30.0f), PWLPT_MOVETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.12f, crBBox.bottom + fHeight/10.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.22f, crBBox.bottom + fHeight/10.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.22f, crBBox.top - fHeight*17/30.0f - fWidth*0.14f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.38f, crBBox.bottom + fHeight/10.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.48f, crBBox.bottom + fHeight/10.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.48f, crBBox.top - fHeight*17/30.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.38f, crBBox.top - fHeight*17/30.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.38f, crBBox.bottom + fWidth*0.24f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.22f, crBBox.top - fHeight*17/30.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.12f, crBBox.top - fHeight*17/30.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.6f, crBBox.bottom + fHeight/10.0f), PWLPT_MOVETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.7f, crBBox.bottom + fHeight/10.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.7f, crBBox.bottom + fHeight/10.0f + fHeight/7.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.97f, crBBox.bottom + fHeight/10.0f + fHeight/7.0f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.97f, crBBox.top - fHeight*17/30.0f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.7f, crBBox.top - fHeight*17/30.0f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.6f, crBBox.top - fHeight*17/30.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.6f, crBBox.bottom + fHeight/10.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.7f, crBBox.bottom + fHeight/7 + fHeight*0.18f), PWLPT_MOVETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.85f, crBBox.bottom + fHeight/7 + fHeight*0.18f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.85f, crBBox.top - fHeight*17/30.0f - fHeight*0.08f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.7f, crBBox.top - fHeight*17/30.0f - fHeight*0.08f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.7f, crBBox.bottom + fHeight/7 + fHeight*0.18f), PWLPT_LINETO)
- };
-
- if(type == PWLPT_STREAM)
- sPathData = GetAppStreamFromArray(PathArray, 28);
- else
- GetPathDataFromArray(path, PathArray, 28);
-}
-
-void CPWL_Utils::GetGraphics_TextNote(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type)
-{
- FX_FLOAT fWidth = crBBox.right - crBBox.left;
- FX_FLOAT fHeight = crBBox.top - crBBox.bottom;
-
- CPWL_PathData PathArray[] =
- {
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth*3/10.0f, crBBox.bottom + fHeight/15.0f), PWLPT_MOVETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*7/10.0f, crBBox.bottom + fHeight*4/15.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth/10.0f, crBBox.bottom + fHeight*4/15.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth/10.0f, crBBox.top - fHeight/15.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/10.0f, crBBox.top - fHeight/15.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/10.0f, crBBox.bottom + fHeight/15.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth*3/10.0f, crBBox.bottom + fHeight/15.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth/10.0f, crBBox.bottom + fHeight*4/15.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth*3/10.0f, crBBox.bottom + fHeight/15.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth*3/10.0f, crBBox.bottom + fHeight*4/15.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth/10.0f, crBBox.bottom + fHeight*4/15.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/5.0f, crBBox.top - fHeight*4/15.0f), PWLPT_MOVETO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth/5.0f, crBBox.top - fHeight*4/15.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/5.0f, crBBox.top - fHeight*7/15.0f), PWLPT_MOVETO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth/5.0f, crBBox.top - fHeight*7/15.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/5.0f, crBBox.top - fHeight*10/15.0f), PWLPT_MOVETO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth*3/10.0f, crBBox.top - fHeight*10/15.0f), PWLPT_LINETO)
- };
-
- if(type == PWLPT_STREAM)
- sPathData = GetAppStreamFromArray(PathArray, 17);
- else
- GetPathDataFromArray(path, PathArray, 17);
-}
-
-void CPWL_Utils::GetGraphics_Paragraph(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type)
-{
- FX_FLOAT fWidth = crBBox.right - crBBox.left;
- FX_FLOAT fHeight = crBBox.top - crBBox.bottom;
-
- CPWL_PathData PathArray[] =
- {
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f, crBBox.top - fHeight/15.0f), PWLPT_MOVETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.7f, crBBox.top - fHeight/15.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.7f, crBBox.bottom + fHeight/15.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.634f, crBBox.bottom + fHeight/15.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.634f, crBBox.top - fHeight*2/15.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.566f, crBBox.top - fHeight*2/15.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.566f, crBBox.bottom + fHeight/15.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f, crBBox.bottom + fHeight/15.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f, crBBox.top - fHeight/15.0f - fHeight*0.4f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.2f, crBBox.top - fHeight/15.0f - fHeight*0.4f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.2f, crBBox.top - fHeight/15.0f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f, crBBox.top - fHeight/15.0f), PWLPT_BEZIERTO)
- };
-
- if(type == PWLPT_STREAM)
- sPathData = GetAppStreamFromArray(PathArray, 12);
- else
- GetPathDataFromArray(path, PathArray, 12);
-}
-
-void CPWL_Utils::GetGraphics_RightArrow(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type)
-{
- FX_FLOAT fWidth = crBBox.right - crBBox.left;
- FX_FLOAT fHeight = crBBox.top - crBBox.bottom;
-
- CPWL_PathData PathArray[] =
- {
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth/15.0f, crBBox.top - fHeight/2.0f), PWLPT_MOVETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f + fWidth/8.0f, crBBox.bottom + fHeight/5.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f, crBBox.bottom + fHeight/5.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth/15.0f - fWidth*0.15f, crBBox.top - fHeight/2.0f - fWidth/25.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.1f, crBBox.top - fHeight/2.0f - fWidth/25.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.1f, crBBox.top - fHeight/2.0f + fWidth/25.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth/15.0f - fWidth*0.15f, crBBox.top - fHeight/2.0f + fWidth/25.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f, crBBox.top - fHeight/5.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f + fWidth/8.0f, crBBox.top - fHeight/5.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth/15.0f, crBBox.top - fHeight/2.0f), PWLPT_LINETO)
- };
-
- if(type == PWLPT_STREAM)
- sPathData = GetAppStreamFromArray(PathArray, 10);
- else
- GetPathDataFromArray(path, PathArray, 10);
-}
-
-void CPWL_Utils::GetGraphics_RightPointer(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type)
-{
- FX_FLOAT fWidth = crBBox.right - crBBox.left;
- FX_FLOAT fHeight = crBBox.top - crBBox.bottom;
-
- CPWL_PathData PathArray[] =
- {
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth/30.0f, crBBox.top - fHeight/2.0f), PWLPT_MOVETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/30.0f, crBBox.bottom + fHeight/6.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*4/15.0f, crBBox.top - fHeight/2.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/30.0f, crBBox.top - fHeight/6.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth/30.0f, crBBox.top - fHeight/2.0f), PWLPT_LINETO)
- };
-
- if(type == PWLPT_STREAM)
- sPathData = GetAppStreamFromArray(PathArray, 5);
- else
- GetPathDataFromArray(path, PathArray, 5);
-}
-
-void CPWL_Utils::GetGraphics_Star(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type)
-{
- FX_FLOAT fLongRadius = (crBBox.top - crBBox.bottom)/(1+(FX_FLOAT)cos(PWL_PI/5.0f));
- fLongRadius = fLongRadius * 0.7f;
- FX_FLOAT fShortRadius = fLongRadius * 0.55f;
- CPDF_Point ptCenter = CPDF_Point((crBBox.left + crBBox.right) / 2.0f,(crBBox.top + crBBox.bottom) / 2.0f);
-
- FX_FLOAT px1[5], py1[5];
- FX_FLOAT px2[5], py2[5];
-
- FX_FLOAT fAngel = PWL_PI/10.0f;
-
- for (FX_INT32 i=0; i<5; i++)
- {
- px1[i] = ptCenter.x + fLongRadius * (FX_FLOAT)cos(fAngel);
- py1[i] = ptCenter.y + fLongRadius * (FX_FLOAT)sin(fAngel);
-
- fAngel += PWL_PI * 2 / 5.0f;
- }
-
- fAngel = PWL_PI/5.0f + PWL_PI/10.0f;
-
- for (FX_INT32 j=0; j<5; j++)
- {
- px2[j] = ptCenter.x + fShortRadius * (FX_FLOAT)cos(fAngel);
- py2[j] = ptCenter.y + fShortRadius * (FX_FLOAT)sin(fAngel);
-
- fAngel += PWL_PI * 2 / 5.0f;
- }
-
- CPWL_PathData PathArray[11];
- PathArray[0] = CPWL_PathData(CPWL_Point(px1[0], py1[0]), PWLPT_MOVETO);
- PathArray[1] = CPWL_PathData(CPWL_Point(px2[0], py2[0]), PWLPT_LINETO);
-
- for(FX_INT32 k = 0; k < 4; k++)
- {
- PathArray[(k+1)*2] = CPWL_PathData(CPWL_Point(px1[k+1], py1[k+1]), PWLPT_LINETO);
- PathArray[(k+1)*2 + 1] = CPWL_PathData(CPWL_Point(px2[k+1], py2[k+1]), PWLPT_LINETO);
- }
-
- PathArray[10] = CPWL_PathData(CPWL_Point(px1[0], py1[0]), PWLPT_LINETO);
-
- if(type == PWLPT_STREAM)
- sPathData = GetAppStreamFromArray(PathArray, 11);
- else
- GetPathDataFromArray(path, PathArray, 11);
-}
-
-void CPWL_Utils::GetGraphics_UpArrow(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type)
-{
- FX_FLOAT fWidth = crBBox.right - crBBox.left;
- FX_FLOAT fHeight = crBBox.top - crBBox.bottom;
-
- CPWL_PathData PathArray[] =
- {
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f, crBBox.top - fHeight/15.0f), PWLPT_MOVETO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth/10.0f, crBBox.top - fWidth*3/5.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.6f, crBBox.top - fWidth*3/5.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.6f, crBBox.bottom + fHeight/15.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.4f, crBBox.bottom + fHeight/15.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.4f, crBBox.top - fWidth*3/5.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/10, crBBox.top - fWidth*3/5.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f, crBBox.top - fHeight/15.0f), PWLPT_LINETO)
- };
-
- if(type == PWLPT_STREAM)
- sPathData = GetAppStreamFromArray(PathArray, 8);
- else
- GetPathDataFromArray(path, PathArray, 8);
-}
-
-void CPWL_Utils::GetGraphics_UpLeftArrow(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type)
-{
- FX_FLOAT fWidth = crBBox.right - crBBox.left;
- FX_FLOAT fHeight = crBBox.top - crBBox.bottom;
- CPWL_Point leftup(crBBox.left, crBBox.top);
- CPWL_Point rightdown(crBBox.right, crBBox.bottom);
- FX_FLOAT k = -fHeight/fWidth;
- CPWL_Point tail;
- tail.x = crBBox.left + fWidth*4/5.0f;
- tail.y = k*(tail.x - crBBox.right) + rightdown.y;
-
- CPWL_PathData PathArray[] =
- {
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/20.0f, k*(crBBox.left + fWidth/20.0f - rightdown.x) + rightdown.y), PWLPT_MOVETO),
- CPWL_PathData(CPWL_Point(fHeight*17/60.0f/k + tail.x + fWidth/10.0f + fWidth/5.0f,
- -fWidth/5.0f/k + tail.y - fWidth/10.0f/k + fHeight*17/60.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(fHeight*17/60.0f/k + tail.x + fWidth/10.0f,
- tail.y - fWidth/10.0f/k + fHeight*17/60.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(tail.x + fWidth/10.0f, tail.y - fWidth/10.0f/k), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(tail.x - fWidth/10.0f, tail.y + fWidth/10.0f/k), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(fHeight*17/60.0f/k + tail.x - fWidth/10.0f, tail.y + fWidth/10.0f/k + fHeight*17/60.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(fHeight*17/60.0f/k + tail.x - fWidth/10.0f - fWidth/5.0f,
- fWidth/5.0f/k + tail.y + fWidth/10.0f/k + fHeight*17/60.0f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/20.0f, k*(crBBox.left + fWidth/20.0f - rightdown.x) + rightdown.y), PWLPT_LINETO)
- };
-
- if(type == PWLPT_STREAM)
- sPathData = GetAppStreamFromArray(PathArray, 8);
- else
- GetPathDataFromArray(path, PathArray, 8);
-}
-
-void CPWL_Utils::GetGraphics_Graph(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type)
-{
- FX_FLOAT fWidth = crBBox.right - crBBox.left;
- FX_FLOAT fHeight = crBBox.top - crBBox.bottom;
-
- CPWL_PathData PathArray[] =
- {
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.05f, crBBox.top - fWidth*0.15f), PWLPT_MOVETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.25f, crBBox.top - fHeight*0.15f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.275f, crBBox.bottom + fHeight*0.08f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.05f, crBBox.bottom + fHeight*0.08f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.05f, crBBox.top - fWidth*0.15f), PWLPT_LINETO),
-
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.275f, crBBox.top - fWidth*0.45f), PWLPT_MOVETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.475f, crBBox.top - fWidth*0.45f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.475f, crBBox.bottom + fHeight*0.08f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.275f, crBBox.bottom + fHeight*0.08f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.275f, crBBox.top - fWidth*0.45f), PWLPT_LINETO),
-
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.5f, crBBox.top - fHeight*0.05f), PWLPT_MOVETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.7f, crBBox.top - fHeight*0.05f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.7f, crBBox.bottom + fHeight*0.08f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.5f, crBBox.bottom + fHeight*0.08f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.5f, crBBox.top - fHeight*0.05f), PWLPT_LINETO),
-
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.725f, crBBox.top - fWidth*0.35f), PWLPT_MOVETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.925f, crBBox.top - fWidth*0.35f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.925f, crBBox.bottom + fHeight*0.08f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.725f, crBBox.bottom + fHeight*0.08f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.725f, crBBox.top - fWidth*0.35f), PWLPT_LINETO)
- };
-
- if(type == PWLPT_STREAM)
- sPathData = GetAppStreamFromArray(PathArray, 20);
- else
- GetPathDataFromArray(path, PathArray, 20);
-}
-
-void CPWL_Utils::GetGraphics_Paperclip(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type)
-{
- FX_FLOAT fWidth = crBBox.right - crBBox.left;
- FX_FLOAT fHeight = crBBox.top - crBBox.bottom;
-
- CPWL_PathData PathArray[] =
- {
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/60, crBBox.top - fHeight*0.25f), PWLPT_MOVETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/60, crBBox.bottom + fHeight*0.25f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/60, crBBox.bottom + fHeight*0.25f - fWidth*57/60.0f*0.35f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth/30, crBBox.bottom + fHeight*0.25f - fWidth*57/60.0f*0.35f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth/30, crBBox.bottom + fHeight*0.25f), PWLPT_BEZIERTO),
-
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth/30, crBBox.top - fHeight*0.33f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth/30, crBBox.top - fHeight*0.33f + fHeight/15*0.5f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth/30 - fWidth*0.12f, crBBox.top - fHeight*0.33f + fHeight/15*0.5f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth/30 - fWidth*0.12f, crBBox.top - fHeight*0.33f), PWLPT_BEZIERTO),
-
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth/30 - fWidth*0.12f, crBBox.bottom + fHeight*0.2f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth/30 - fWidth*0.12f, crBBox.bottom + fHeight*0.2f - (fWidth*57/60.0f - fWidth*0.24f)*0.25f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/60 + fWidth*0.12f, crBBox.bottom + fHeight*0.2f - (fWidth*57/60.0f - fWidth*0.24f)*0.25f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/60 + fWidth*0.12f, crBBox.bottom + fHeight*0.2f), PWLPT_BEZIERTO),
-
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/60 + fWidth*0.12f, crBBox.top - fHeight*0.2f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/60 + fWidth*0.12f, crBBox.top - fHeight*0.2f + (fWidth*11/12.0f - fWidth*0.36f)*0.25f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth/15 - fWidth*0.24f, crBBox.top - fHeight*0.2f + (fWidth*11/12.0f - fWidth*0.36f)*0.25f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth/15 - fWidth*0.24f, crBBox.top - fHeight*0.2f), PWLPT_BEZIERTO),
-
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth/15 - fWidth*0.24f, crBBox.bottom + fHeight*0.25f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth/15 - fWidth*0.24f, crBBox.bottom + fHeight*0.25f - (fWidth*14/15.0f - fWidth*0.53f)*0.25f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.29f, crBBox.bottom + fHeight*0.25f - (fWidth*14/15.0f - fWidth*0.53f)*0.25f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.29f, crBBox.bottom + fHeight*0.25f), PWLPT_BEZIERTO),
-
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.29f, crBBox.top - fHeight*0.33f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.29f, crBBox.top - fHeight*0.33f + fWidth*0.12f*0.35f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.17f, crBBox.top - fHeight*0.33f + fWidth*0.12f*0.35f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.17f, crBBox.top - fHeight*0.33f), PWLPT_BEZIERTO),
-
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.17f, crBBox.bottom + fHeight*0.3f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.17f, crBBox.bottom + fHeight*0.3f - fWidth*(14/15.0f - 0.29f)*0.35f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth/15 - fWidth*0.12f, crBBox.bottom + fHeight*0.3f - fWidth*(14/15.0f - 0.29f)*0.35f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth/15 - fWidth*0.12f, crBBox.bottom + fHeight*0.3f), PWLPT_BEZIERTO),
-
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth/15 - fWidth*0.12f, crBBox.top - fHeight*0.25f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth/15 - fWidth*0.12f, crBBox.top - fHeight*0.25f + fWidth*0.35f*(11/12.0f - 0.12f)), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/60, crBBox.top - fHeight*0.25f + fWidth*0.35f*(11/12.0f - 0.12f)), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth/60, crBBox.top - fHeight*0.25f), PWLPT_BEZIERTO)
- };
-
- if(type == PWLPT_STREAM)
- sPathData = GetAppStreamFromArray(PathArray, 33);
- else
- GetPathDataFromArray(path, PathArray, 33);
-}
-
-void CPWL_Utils::GetGraphics_Attachment(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type)
-{
- FX_FLOAT fWidth = crBBox.right - crBBox.left;
- FX_FLOAT fHeight = crBBox.top - crBBox.bottom;
-
- CPWL_PathData PathArray[] =
- {
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.25f, crBBox.top - fHeight*0.1f), PWLPT_MOVETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.4f, crBBox.top - fHeight*0.23f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.4f, crBBox.top - fHeight*0.5f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.4f, crBBox.top - fHeight*0.5f + fWidth*0.04f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.6f, crBBox.top - fHeight*0.5f + fWidth*0.04f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.6f, crBBox.top - fHeight*0.5f), PWLPT_BEZIERTO),
-
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.6f, crBBox.top - fHeight*0.23f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.25f, crBBox.top - fHeight*0.1f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.25f, crBBox.top - fHeight*0.1f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.4f, crBBox.top - fHeight*0.23f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.6f, crBBox.top - fHeight*0.23f), PWLPT_LINETO),
-
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.4f, crBBox.top - fHeight*0.5f), PWLPT_MOVETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.4f - fWidth*0.25f*0.4f, crBBox.top - fHeight*0.5f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.15f, crBBox.top - fHeight*0.65f + fHeight*0.15f*0.4f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.15f, crBBox.top - fHeight*0.65f), PWLPT_BEZIERTO),
-
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.15f, crBBox.top - fHeight*0.65f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.15f, crBBox.top - fHeight*0.65f + fHeight*0.15f*0.4f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.6f + fWidth*0.25f*0.4f, crBBox.top - fHeight*0.5f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.6f, crBBox.top - fHeight*0.5f), PWLPT_BEZIERTO),
-
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.6f, crBBox.top - fHeight*0.5f + fWidth*0.04f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.4f, crBBox.top - fHeight*0.5f + fWidth*0.04f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.4f, crBBox.top - fHeight*0.5f), PWLPT_BEZIERTO),
-
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.5f, crBBox.top - fHeight*0.65f), PWLPT_MOVETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.5f, crBBox.bottom + fHeight*0.1f), PWLPT_LINETO)
- };
-
- if(type == PWLPT_STREAM)
- sPathData = GetAppStreamFromArray(PathArray, 24);
- else
- GetPathDataFromArray(path, PathArray, 24);
-}
-
-void CPWL_Utils::GetGraphics_Tag(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type)
-{
- FX_FLOAT fWidth = crBBox.right - crBBox.left;
- FX_FLOAT fHeight = crBBox.top - crBBox.bottom;
-
- CPWL_PathData PathArray[] =
- {
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.4f, crBBox.top - fHeight*0.1f), PWLPT_MOVETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.1f, crBBox.top - fHeight*0.5f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.3f, crBBox.bottom + fHeight*0.1f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.1f, crBBox.bottom + fHeight*0.1f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.1f, crBBox.top - fHeight*0.1f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.4f, crBBox.top - fHeight*0.1f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.4f, crBBox.top - fHeight*0.3f), PWLPT_MOVETO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.2f, crBBox.top - fHeight*0.3f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.4f, crBBox.top - fHeight*0.5f), PWLPT_MOVETO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.2f, crBBox.top - fHeight*0.5f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.4f, crBBox.top - fHeight*0.7f), PWLPT_MOVETO),
- CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.2f, crBBox.top - fHeight*0.7f), PWLPT_LINETO)
- };
-
- if(type == PWLPT_STREAM)
- sPathData = GetAppStreamFromArray(PathArray, 12);
- else
- GetPathDataFromArray(path, PathArray, 12);
-}
-
-void CPWL_Utils::GetGraphics_Foxit(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type)
-{
- FX_FLOAT fOutWidth = crBBox.right - crBBox.left;
- FX_FLOAT fOutHeight = crBBox.top - crBBox.bottom;
-
- CPDF_Rect crInBox = crBBox;
- crInBox.left = crBBox.left + fOutWidth*0.08f;
- crInBox.right = crBBox.right - fOutWidth*0.08f;
- crInBox.top = crBBox.top - fOutHeight*0.08f;
- crInBox.bottom = crBBox.bottom + fOutHeight*0.08f;
-
- FX_FLOAT fWidth = crInBox.right - crInBox.left;
- FX_FLOAT fHeight = crInBox.top - crInBox.bottom;
-
- CPWL_PathData PathArray[] =
- {
- CPWL_PathData(CPWL_Point(crInBox.left, crInBox.top), PWLPT_MOVETO),
- CPWL_PathData(CPWL_Point(crInBox.left + fWidth*0.45f, crInBox.top), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crInBox.left + fWidth*0.45f, crInBox.top - PWL_BEZIER * fHeight * 0.4f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crInBox.left + fWidth*0.45f - PWL_BEZIER * fWidth * 0.45f, crInBox.top - fHeight*0.4f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crInBox.left, crInBox.top - fHeight*0.4f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crInBox.left, crInBox.top), PWLPT_LINETO),
-
- CPWL_PathData(CPWL_Point(crInBox.left + fWidth*0.60f, crInBox.top), PWLPT_MOVETO),
- CPWL_PathData(CPWL_Point(crInBox.left + fWidth*0.75f, crInBox.top), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crInBox.left + fWidth*0.75f, crInBox.top - PWL_BEZIER * fHeight * 0.7f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crInBox.left + fWidth*0.75f - PWL_BEZIER * fWidth * 0.75f, crInBox.top - fHeight*0.7f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crInBox.left, crInBox.top - fHeight*0.7f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crInBox.left, crInBox.top - fHeight*0.55f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crInBox.left + PWL_BEZIER * fWidth*0.60f, crInBox.top - fHeight*0.55f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crInBox.left + fWidth * 0.60f, crInBox.top - PWL_BEZIER * fHeight * 0.55f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crInBox.left + fWidth * 0.60f, crInBox.top), PWLPT_BEZIERTO),
-
- CPWL_PathData(CPWL_Point(crInBox.left + fWidth*0.90f, crInBox.top), PWLPT_MOVETO),
- CPWL_PathData(CPWL_Point(crInBox.left + fWidth*0.90f, crInBox.top - PWL_BEZIER * fHeight * 0.85f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crInBox.left + fWidth*0.90f - PWL_BEZIER * fWidth * 0.90f, crInBox.top - fHeight*0.85f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crInBox.left, crInBox.top - fHeight*0.85f), PWLPT_BEZIERTO),
- CPWL_PathData(CPWL_Point(crInBox.left, crInBox.bottom), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crInBox.right, crInBox.bottom), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crInBox.right, crInBox.top), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crInBox.left + fWidth*0.90f, crInBox.top), PWLPT_LINETO),
-
- /*
- CPWL_PathData(CPWL_Point(crBBox.left, crBBox.top), PWLPT_MOVETO),
- CPWL_PathData(CPWL_Point(crBBox.right, crBBox.top), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.right, crBBox.bottom), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left, crBBox.bottom), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left, crBBox.top), PWLPT_LINETO),
-
- CPWL_PathData(CPWL_Point(crBBox.left+fOutWidth*0.04f, crBBox.top-fOutHeight*0.04f), PWLPT_MOVETO),
- CPWL_PathData(CPWL_Point(crBBox.right-fOutWidth*0.04f, crBBox.top-fOutHeight*0.04f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.right-fOutWidth*0.04f, crBBox.bottom+fOutHeight*0.04f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left+fOutWidth*0.04f, crBBox.bottom+fOutHeight*0.04f), PWLPT_LINETO),
- CPWL_PathData(CPWL_Point(crBBox.left+fOutWidth*0.04f, crBBox.top-fOutHeight*0.04f), PWLPT_LINETO),
- */
- };
-
- if(type == PWLPT_STREAM)
- sPathData = GetAppStreamFromArray(PathArray, 23);
- else
- GetPathDataFromArray(path, PathArray, 23);
-}
-
-void CPWL_Color::ConvertColorType(FX_INT32 nColorType)
-{
- switch (this->nColorType)
- {
- case COLORTYPE_TRANSPARENT:
- break;
- case COLORTYPE_GRAY:
- switch (nColorType)
- {
- case COLORTYPE_RGB:
- CPWL_Utils::ConvertGRAY2RGB(this->fColor1, this->fColor1, this->fColor2, this->fColor3);
- break;
- case COLORTYPE_CMYK:
- CPWL_Utils::ConvertGRAY2CMYK(this->fColor1, this->fColor1, this->fColor2, this->fColor3, this->fColor4);
- break;
- }
- break;
- case COLORTYPE_RGB:
- switch (nColorType)
- {
- case COLORTYPE_GRAY:
- CPWL_Utils::ConvertRGB2GRAY(this->fColor1, this->fColor2, this->fColor3, this->fColor1);
- break;
- case COLORTYPE_CMYK:
- CPWL_Utils::ConvertRGB2CMYK(this->fColor1, this->fColor2, this->fColor3, this->fColor1, this->fColor2, this->fColor3, this->fColor4);
- break;
- }
- break;
- case COLORTYPE_CMYK:
- switch (nColorType)
- {
- case COLORTYPE_GRAY:
- CPWL_Utils::ConvertCMYK2GRAY(this->fColor1, this->fColor2, this->fColor3, this->fColor4, this->fColor1);
- break;
- case COLORTYPE_RGB:
- CPWL_Utils::ConvertCMYK2RGB(this->fColor1, this->fColor2, this->fColor3, this->fColor4, this->fColor1, this->fColor2, this->fColor3);
- break;
- }
- break;
- }
- this->nColorType = nColorType;
-}
-
-
+// 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
+
+#include "../../include/pdfwindow/PDFWindow.h"
+#include "../../include/pdfwindow/PWL_Wnd.h"
+#include "../../include/pdfwindow/PWL_Utils.h"
+#include "../../include/pdfwindow/PWL_Icon.h"
+
+#define IsFloatZero(f) ((f) < 0.0001 && (f) > -0.0001)
+#define IsFloatBigger(fa,fb) ((fa) > (fb) && !IsFloatZero((fa) - (fb)))
+#define IsFloatSmaller(fa,fb) ((fa) < (fb) && !IsFloatZero((fa) - (fb)))
+#define IsFloatEqual(fa,fb) IsFloatZero((fa)-(fb))
+
+/* ---------------------------- CPWL_Utils ------------------------------ */
+
+CFX_ByteString CPWL_Utils::GetAppStreamFromArray(const CPWL_PathData* pPathData, FX_INT32 nCount)
+{
+ CFX_ByteTextBuf csAP;
+
+ for (FX_INT32 i=0; i<nCount; i++)
+ {
+ switch (pPathData[i].type)
+ {
+ case PWLPT_MOVETO:
+ csAP << pPathData[i].point.x << " " << pPathData[i].point.y << " m\n";
+ break;
+ case PWLPT_LINETO:
+ csAP << pPathData[i].point.x << " " << pPathData[i].point.y << " l\n";
+ break;
+ case PWLPT_BEZIERTO:
+ csAP << pPathData[i].point.x << " " << pPathData[i].point.y << " "
+ << pPathData[i+1].point.x << " " << pPathData[i+1].point.y << " "
+ << pPathData[i+2].point.x << " " << pPathData[i+2].point.y << " c\n";
+
+ i += 2;
+ break;
+ default:
+ break;
+ }
+ }
+
+ return csAP.GetByteString();
+}
+
+void CPWL_Utils::GetPathDataFromArray(CFX_PathData& path, const CPWL_PathData* pPathData, FX_INT32 nCount)
+{
+ path.SetPointCount(nCount);
+
+ for (FX_INT32 i=0; i<nCount; i++)
+ {
+ switch (pPathData[i].type)
+ {
+ case PWLPT_MOVETO:
+ path.SetPoint(i, pPathData[i].point.x, pPathData[i].point.y, FXPT_MOVETO);
+ break;
+ case PWLPT_LINETO:
+ path.SetPoint(i, pPathData[i].point.x, pPathData[i].point.y, FXPT_LINETO);
+ break;
+ case PWLPT_BEZIERTO:
+ path.SetPoint(i, pPathData[i].point.x, pPathData[i].point.y, FXPT_BEZIERTO);
+ break;
+ default:
+ break;
+ }
+ }
+}
+
+
+CPDF_Rect CPWL_Utils::MaxRect(const CPDF_Rect & rect1,const CPDF_Rect & rect2)
+{
+ CPDF_Rect rcRet;
+
+ rcRet.left = PWL_MIN(rect1.left,rect2.left);
+ rcRet.bottom = PWL_MIN(rect1.bottom,rect2.bottom);
+ rcRet.right = PWL_MAX(rect1.right,rect2.right);
+ rcRet.top = PWL_MAX(rect1.top,rect2.top);
+
+ return rcRet;
+}
+
+CPDF_Rect CPWL_Utils::OffsetRect(const CPDF_Rect & rect,FX_FLOAT x,FX_FLOAT y)
+{
+ return CPDF_Rect(rect.left + x,rect.bottom + y,
+ rect.right + x,rect.top + y);
+}
+
+FX_BOOL CPWL_Utils::ContainsRect(const CPDF_Rect& rcParent, const CPDF_Rect& rcChild)
+{
+ return rcChild.left >= rcParent.left && rcChild.bottom >= rcParent.bottom &&
+ rcChild.right <= rcParent.right && rcChild.top <= rcParent.top;
+}
+
+FX_BOOL CPWL_Utils::IntersectRect(const CPDF_Rect& rect1, const CPDF_Rect& rect2)
+{
+ FX_FLOAT left = rect1.left > rect2.left ? rect1.left : rect2.left;
+ FX_FLOAT right = rect1.right < rect2.right ? rect1.right : rect2.right;
+ FX_FLOAT bottom = rect1.bottom > rect2.bottom ? rect1.bottom : rect2.bottom;
+ FX_FLOAT top = rect1.top < rect2.top ? rect1.top : rect2.top;
+
+ return left < right && bottom < top;
+}
+
+CPDF_Point CPWL_Utils::OffsetPoint(const CPDF_Point& point,FX_FLOAT x,FX_FLOAT y)
+{
+ return CPDF_Point(point.x + x,point.y + y);
+}
+
+CPVT_WordRange CPWL_Utils::OverlapWordRange(const CPVT_WordRange & wr1, const CPVT_WordRange & wr2)
+{
+ CPVT_WordRange wrRet;
+
+ if (wr2.EndPos.WordCmp(wr1.BeginPos) < 0 || wr2.BeginPos.WordCmp(wr1.EndPos) > 0) return wrRet;
+ if (wr1.EndPos.WordCmp(wr2.BeginPos) < 0 || wr1.BeginPos.WordCmp(wr2.EndPos) > 0) return wrRet;
+
+ if (wr1.BeginPos.WordCmp(wr2.BeginPos) < 0)
+ {
+ wrRet.BeginPos = wr2.BeginPos;
+ }
+ else
+ {
+ wrRet.BeginPos = wr1.BeginPos;
+ }
+
+ if (wr1.EndPos.WordCmp(wr2.EndPos) < 0)
+ {
+ wrRet.EndPos = wr1.EndPos;
+ }
+ else
+ {
+ wrRet.EndPos = wr2.EndPos;
+ }
+
+ return wrRet;
+}
+
+CFX_ByteString CPWL_Utils::GetAP_Check(const CPDF_Rect & crBBox)
+{
+ CFX_ByteTextBuf csAP;
+
+ FX_FLOAT fWidth = crBBox.right - crBBox.left;
+ FX_FLOAT fHeight = crBBox.top - crBBox.bottom;
+
+ const FX_INT32 num = 8;
+
+ CPWL_Point pts[num*3] =
+ {
+ //1
+ CPWL_Point(0.28f, 0.52f),
+ CPWL_Point(0.27f, 0.48f),
+ CPWL_Point(0.29f, 0.40f),
+
+ //2
+ CPWL_Point(0.30f, 0.33f),
+ CPWL_Point(0.31f, 0.29f),
+ CPWL_Point(0.31f, 0.28f),
+
+ //3
+ CPWL_Point(0.39f, 0.28f),
+ CPWL_Point(0.49f, 0.29f),
+ CPWL_Point(0.77f, 0.67f),
+
+ //4
+ CPWL_Point(0.76f, 0.68f),
+ CPWL_Point(0.78f, 0.69f),
+ CPWL_Point(0.76f, 0.75f),
+
+ //5
+ CPWL_Point(0.76f, 0.75f),
+ CPWL_Point(0.73f, 0.80f),
+ CPWL_Point(0.68f, 0.75f),
+
+ //6
+ CPWL_Point(0.68f, 0.74f),
+ CPWL_Point(0.68f, 0.74f),
+ CPWL_Point(0.44f, 0.47f),
+
+ //7
+ CPWL_Point(0.43f, 0.47f),
+ CPWL_Point(0.40f, 0.47f),
+ CPWL_Point(0.41f, 0.58f),
+
+ //8
+ CPWL_Point(0.40f, 0.60f),
+ CPWL_Point(0.28f, 0.66f),
+ CPWL_Point(0.30f, 0.56f)
+ };
+
+ for (FX_INT32 j=0; j<num*3; j++)
+ {
+ pts[j].x *= fWidth;
+ pts[j].x += crBBox.left;
+
+ pts[j].y *= fHeight;
+ pts[j].y += crBBox.bottom;
+ }
+
+ csAP << pts[0].x << " " << pts[0].y << " m\n";
+
+ for (FX_INT32 i=0; i<num; i++)
+ {
+ FX_INT32 nCur = i*3;
+ FX_INT32 n1 = i*3 + 1;
+ FX_INT32 n2 = i*3 + 2;
+ FX_INT32 nNext = (i < num-1 ? (i+1)*3 : 0);
+
+ FX_FLOAT px1 = pts[n1].x - pts[nCur].x;
+ FX_FLOAT py1 = pts[n1].y - pts[nCur].y;
+ FX_FLOAT px2 = pts[n2].x - pts[nNext].x;
+ FX_FLOAT py2 = pts[n2].y - pts[nNext].y;
+
+ csAP << pts[nCur].x + px1 * PWL_BEZIER << " " << pts[nCur].y + py1 * PWL_BEZIER << " "
+ << pts[nNext].x + px2 * PWL_BEZIER << " " << pts[nNext].y + py2 * PWL_BEZIER << " "
+ << pts[nNext].x << " " << pts[nNext].y << " c\n";
+ }
+
+ return csAP.GetByteString();
+}
+
+CFX_ByteString CPWL_Utils::GetAP_Circle(const CPDF_Rect & crBBox)
+{
+ CFX_ByteTextBuf csAP;
+
+ FX_FLOAT fWidth = crBBox.right - crBBox.left;
+ FX_FLOAT fHeight = crBBox.top - crBBox.bottom;
+
+ CPDF_Point pt1(crBBox.left,crBBox.bottom + fHeight / 2);
+ CPDF_Point pt2(crBBox.left + fWidth / 2,crBBox.top);
+ CPDF_Point pt3(crBBox.right,crBBox.bottom + fHeight / 2);
+ CPDF_Point pt4(crBBox.left + fWidth / 2,crBBox.bottom);
+
+ csAP << pt1.x << " " << pt1.y << " m\n";
+
+ FX_FLOAT px = pt2.x - pt1.x;
+ FX_FLOAT py = pt2.y - pt1.y;
+
+ csAP << pt1.x << " " << pt1.y + py * PWL_BEZIER << " "
+ << pt2.x - px * PWL_BEZIER << " " << pt2.y << " "
+ << pt2.x << " " << pt2.y << " c\n";
+
+ px = pt3.x - pt2.x;
+ py = pt2.y - pt3.y;
+
+ csAP << pt2.x + px * PWL_BEZIER << " " << pt2.y << " "
+ << pt3.x << " " << pt3.y + py * PWL_BEZIER << " "
+ << pt3.x << " " << pt3.y << " c\n";
+
+ px = pt3.x - pt4.x;
+ py = pt3.y - pt4.y;
+
+ csAP << pt3.x << " " << pt3.y - py * PWL_BEZIER << " "
+ << pt4.x + px * PWL_BEZIER << " " << pt4.y << " "
+ << pt4.x << " " << pt4.y << " c\n";
+
+ px = pt4.x - pt1.x;
+ py = pt1.y - pt4.y;
+
+ csAP << pt4.x - px * PWL_BEZIER << " " << pt4.y << " "
+ << pt1.x << " " << pt1.y - py * PWL_BEZIER << " "
+ << pt1.x << " " << pt1.y << " c\n";
+
+ return csAP.GetByteString();
+}
+
+CFX_ByteString CPWL_Utils::GetAP_Cross(const CPDF_Rect & crBBox)
+{
+ CFX_ByteTextBuf csAP;
+
+ csAP << crBBox.left << " " << crBBox.top << " m\n";
+ csAP << crBBox.right << " " << crBBox.bottom << " l\n";
+ csAP << crBBox.left << " " << crBBox.bottom << " m\n";
+ csAP << crBBox.right << " " << crBBox.top << " l\n";
+
+ return csAP.GetByteString();
+}
+
+CFX_ByteString CPWL_Utils::GetAP_Diamond(const CPDF_Rect & crBBox)
+{
+ CFX_ByteTextBuf csAP;
+
+ FX_FLOAT fWidth = crBBox.right - crBBox.left;
+ FX_FLOAT fHeight = crBBox.top - crBBox.bottom;
+
+ CPDF_Point pt1(crBBox.left,crBBox.bottom + fHeight / 2);
+ CPDF_Point pt2(crBBox.left + fWidth / 2,crBBox.top);
+ CPDF_Point pt3(crBBox.right,crBBox.bottom + fHeight / 2);
+ CPDF_Point pt4(crBBox.left + fWidth / 2,crBBox.bottom);
+
+ csAP << pt1.x << " " << pt1.y << " m\n";
+ csAP << pt2.x << " " << pt2.y << " l\n";
+ csAP << pt3.x << " " << pt3.y << " l\n";
+ csAP << pt4.x << " " << pt4.y << " l\n";
+ csAP << pt1.x << " " << pt1.y << " l\n";
+
+ return csAP.GetByteString();
+}
+
+CFX_ByteString CPWL_Utils::GetAP_Square(const CPDF_Rect & crBBox)
+{
+ CFX_ByteTextBuf csAP;
+
+ csAP << crBBox.left << " " << crBBox.top << " m\n";
+ csAP << crBBox.right << " " << crBBox.top << " l\n";
+ csAP << crBBox.right << " " << crBBox.bottom << " l\n";
+ csAP << crBBox.left << " " << crBBox.bottom << " l\n";
+ csAP << crBBox.left << " " << crBBox.top << " l\n";
+
+ return csAP.GetByteString();
+}
+
+CFX_ByteString CPWL_Utils::GetAP_Star(const CPDF_Rect & crBBox)
+{
+ CFX_ByteTextBuf csAP;
+
+ FX_FLOAT fRadius = (crBBox.top - crBBox.bottom)/(1+(FX_FLOAT)cos(PWL_PI/5.0f));
+ CPDF_Point ptCenter = CPDF_Point((crBBox.left + crBBox.right) / 2.0f,(crBBox.top + crBBox.bottom) / 2.0f);
+
+ FX_FLOAT px[5],py[5];
+
+ FX_FLOAT fAngel = PWL_PI/10.0f;
+
+ for (FX_INT32 i=0; i<5; i++)
+ {
+ px[i] = ptCenter.x + fRadius * (FX_FLOAT)cos(fAngel);
+ py[i] = ptCenter.y + fRadius * (FX_FLOAT)sin(fAngel);
+
+ fAngel += PWL_PI * 2 / 5.0f;
+ }
+
+ csAP << px[0] << " " << py[0] << " m\n";
+
+ FX_INT32 nNext = 0;
+ for (FX_INT32 j=0; j<5; j++)
+ {
+ nNext += 2;
+ if (nNext >= 5) nNext -= 5;
+ csAP << px[nNext] << " " << py[nNext] << " l\n";
+ }
+
+ return csAP.GetByteString();
+}
+
+CFX_ByteString CPWL_Utils::GetAP_HalfCircle(const CPDF_Rect & crBBox,FX_FLOAT fRotate)
+{
+ CFX_ByteTextBuf csAP;
+
+ FX_FLOAT fWidth = crBBox.right - crBBox.left;
+ FX_FLOAT fHeight = crBBox.top - crBBox.bottom;
+
+ CPDF_Point pt1(-fWidth/2,0);
+ CPDF_Point pt2(0,fHeight/2);
+ CPDF_Point pt3(fWidth/2,0);
+
+ FX_FLOAT px,py;
+
+ csAP << cos(fRotate) << " " << sin(fRotate) << " " << -sin(fRotate) << " " << cos(fRotate) << " "
+ << crBBox.left + fWidth / 2 << " " << crBBox.bottom + fHeight / 2 << " cm\n";
+
+
+ csAP << pt1.x << " " << pt1.y << " m\n";
+
+ px = pt2.x - pt1.x;
+ py = pt2.y - pt1.y;
+
+ csAP << pt1.x << " " << pt1.y + py * PWL_BEZIER << " "
+ << pt2.x - px * PWL_BEZIER << " " << pt2.y << " "
+ << pt2.x << " " << pt2.y << " c\n";
+
+ px = pt3.x - pt2.x;
+ py = pt2.y - pt3.y;
+
+ csAP << pt2.x + px * PWL_BEZIER << " " << pt2.y << " "
+ << pt3.x << " " << pt3.y + py * PWL_BEZIER << " "
+ << pt3.x << " " << pt3.y << " c\n";
+
+ return csAP.GetByteString();
+}
+
+
+CPDF_Rect CPWL_Utils::InflateRect(const CPDF_Rect & rcRect, FX_FLOAT fSize)
+{
+ if (rcRect.IsEmpty()) return rcRect;
+
+ CPDF_Rect rcNew(rcRect.left - fSize,
+ rcRect.bottom - fSize,
+ rcRect.right + fSize,
+ rcRect.top + fSize);
+ rcNew.Normalize();
+ return rcNew;
+}
+
+CPDF_Rect CPWL_Utils::DeflateRect(const CPDF_Rect & rcRect, FX_FLOAT fSize)
+{
+ if (rcRect.IsEmpty()) return rcRect;
+
+ CPDF_Rect rcNew(rcRect.left + fSize,
+ rcRect.bottom + fSize,
+ rcRect.right - fSize,
+ rcRect.top - fSize);
+ rcNew.Normalize();
+ return rcNew;
+}
+
+CPDF_Rect CPWL_Utils::ScaleRect(const CPDF_Rect & rcRect,FX_FLOAT fScale)
+{
+ FX_FLOAT fHalfWidth = (rcRect.right - rcRect.left) / 2.0f;
+ FX_FLOAT fHalfHeight = (rcRect.top - rcRect.bottom) / 2.0f;
+
+ CPDF_Point ptCenter = CPDF_Point((rcRect.left + rcRect.right) / 2,(rcRect.top + rcRect.bottom) / 2);
+
+ return CPDF_Rect(ptCenter.x - fHalfWidth * fScale,
+ ptCenter.y - fHalfHeight * fScale,
+ ptCenter.x + fHalfWidth * fScale,
+ ptCenter.y + fHalfHeight * fScale);
+}
+
+CFX_ByteString CPWL_Utils::GetRectFillAppStream(const CPDF_Rect & rect,const CPWL_Color & color)
+{
+ CFX_ByteTextBuf sAppStream;
+
+ CFX_ByteString sColor = GetColorAppStream(color,TRUE);
+ if (sColor.GetLength() > 0)
+ {
+ sAppStream << "q\n" << sColor;
+ sAppStream << rect.left << " " << rect.bottom << " "
+ << rect.right - rect.left << " " << rect.top - rect.bottom << " re f\nQ\n";
+ }
+
+ return sAppStream.GetByteString();
+}
+
+CFX_ByteString CPWL_Utils::GetCircleFillAppStream(const CPDF_Rect & rect,const CPWL_Color & color)
+{
+ CFX_ByteTextBuf sAppStream;
+
+ CFX_ByteString sColor = GetColorAppStream(color,TRUE);
+ if (sColor.GetLength() > 0)
+ {
+ sAppStream << "q\n" << sColor << CPWL_Utils::GetAP_Circle(rect) << "f\nQ\n";
+ }
+
+ return sAppStream.GetByteString();
+}
+
+CPDF_Rect CPWL_Utils::GetCenterSquare(const CPDF_Rect & rect)
+{
+ FX_FLOAT fWidth = rect.right - rect.left;
+ FX_FLOAT fHeight = rect.top - rect.bottom;
+
+ FX_FLOAT fCenterX = (rect.left + rect.right)/2.0f;
+ FX_FLOAT fCenterY = (rect.top + rect.bottom)/2.0f;
+
+ FX_FLOAT fRadius = (fWidth > fHeight) ? fHeight / 2 : fWidth / 2;
+
+ return CPDF_Rect(fCenterX - fRadius,fCenterY - fRadius,fCenterX + fRadius,fCenterY + fRadius);
+}
+
+CFX_ByteString CPWL_Utils::GetEditAppStream(IFX_Edit* pEdit, const CPDF_Point & ptOffset, const CPVT_WordRange * pRange,
+ FX_BOOL bContinuous, FX_WORD SubWord)
+{
+ return IFX_Edit::GetEditAppearanceStream(pEdit,ptOffset,pRange,bContinuous,SubWord);
+}
+
+CFX_ByteString CPWL_Utils::GetEditSelAppStream(IFX_Edit* pEdit, const CPDF_Point & ptOffset,
+ const CPVT_WordRange * pRange)
+{
+ return IFX_Edit::GetSelectAppearanceStream(pEdit,ptOffset,pRange);
+}
+
+static CFX_ByteString GetSquigglyAppearanceStream(FX_FLOAT fStartX, FX_FLOAT fEndX, FX_FLOAT fY, FX_FLOAT fStep)
+{
+ CFX_ByteTextBuf sRet;
+
+ sRet << "0 w\n" << fStartX << " " << fY << " m\n";
+
+ FX_FLOAT fx;
+ FX_INT32 i;
+
+ for (i=1,fx=fStartX+fStep; fx<fEndX; fx+=fStep,i++)
+ {
+ sRet << fx << " " << fY + (i&1)*fStep << " l\n";
+ }
+
+ sRet << "S\n";
+
+ return sRet.GetByteString();
+}
+
+static CFX_ByteString GetWordSpellCheckAppearanceStream(IFX_Edit_Iterator* pIterator, const CPDF_Point & ptOffset,
+ const CPVT_WordRange & wrWord)
+{
+ CFX_ByteTextBuf sRet;
+
+ FX_FLOAT fStartX = 0.0f;
+ FX_FLOAT fEndX = 0.0f;
+ FX_FLOAT fY = 0.0f;
+ FX_FLOAT fStep = 0.0f;
+
+ FX_BOOL bBreak = FALSE;
+
+ if (pIterator)
+ {
+ pIterator->SetAt(wrWord.BeginPos);
+
+ do
+ {
+ CPVT_WordPlace place = pIterator->GetAt();
+
+ CPVT_Line line;
+ if (pIterator->GetLine(line))
+ {
+ fY = line.ptLine.y;
+ fStep = (line.fLineAscent - line.fLineDescent) / 16.0f;
+ }
+
+ if (place.LineCmp(wrWord.BeginPos) == 0)
+ {
+ pIterator->SetAt(wrWord.BeginPos);
+ CPVT_Word word;
+ if (pIterator->GetWord(word))
+ {
+ fStartX = word.ptWord.x;
+ }
+ }
+ else
+ {
+ fStartX = line.ptLine.x;
+ }
+
+ if (place.LineCmp(wrWord.EndPos) == 0)
+ {
+ pIterator->SetAt(wrWord.EndPos);
+ CPVT_Word word;
+ if (pIterator->GetWord(word))
+ {
+ fEndX = word.ptWord.x + word.fWidth;
+ }
+
+ bBreak = TRUE;
+ }
+ else
+ {
+ fEndX = line.ptLine.x + line.fLineWidth;
+ }
+
+ sRet << GetSquigglyAppearanceStream(fStartX + ptOffset.x, fEndX + ptOffset.x, fY + ptOffset.y,fStep);
+
+ if (bBreak) break;
+ }
+ while (pIterator->NextLine());
+ }
+
+ return sRet.GetByteString();
+}
+
+CFX_ByteString CPWL_Utils::GetSpellCheckAppStream(IFX_Edit* pEdit, IPWL_SpellCheck* pSpellCheck, const CPDF_Point & ptOffset,
+ const CPVT_WordRange * pRange)
+{
+ ASSERT(pEdit != NULL);
+ ASSERT(pSpellCheck != NULL);
+
+ CFX_ByteTextBuf sRet;
+
+ if (pRange && pRange->IsExist())
+ {
+ if (IFX_Edit_Iterator* pIterator = pEdit->GetIterator())
+ {
+ pIterator->SetAt(pRange->BeginPos);
+
+ FX_BOOL bLatinWord = FALSE;
+ CPVT_WordPlace wpWordStart;
+ CFX_ByteString sWord;
+
+ CPVT_WordPlace oldplace;
+ while (pIterator->NextWord())
+ {
+ CPVT_WordPlace place = pIterator->GetAt();
+ if (pRange && place.WordCmp(pRange->EndPos) > 0) break;
+
+ CPVT_Word word;
+ if (pIterator->GetWord(word))
+ {
+ if (FX_EDIT_ISLATINWORD(word.Word))
+ {
+ if (!bLatinWord)
+ {
+ wpWordStart = place;
+ bLatinWord = TRUE;
+ }
+
+ sWord += (char)word.Word;
+ oldplace = place;
+ }
+ else
+ {
+ if (bLatinWord)
+ {
+ if (!pSpellCheck->CheckWord(sWord))
+ {
+ sRet << GetWordSpellCheckAppearanceStream(pIterator,ptOffset,CPVT_WordRange(wpWordStart,oldplace));
+ pIterator->SetAt(place);
+ }
+ bLatinWord = FALSE;
+ }
+
+ sWord.Empty();
+ }
+ }
+ else
+ {
+ if (bLatinWord)
+ {
+ if (!pSpellCheck->CheckWord(sWord))
+ sRet << GetWordSpellCheckAppearanceStream(pIterator,ptOffset,CPVT_WordRange(wpWordStart,oldplace));
+ bLatinWord = FALSE;
+ sWord.Empty();
+ }
+ }
+ }
+
+ if (bLatinWord)
+ {
+ if (!pSpellCheck->CheckWord(sWord))
+ sRet << GetWordSpellCheckAppearanceStream(pIterator,ptOffset,CPVT_WordRange(wpWordStart,oldplace));
+
+ bLatinWord = FALSE;
+ sWord.Empty();
+ }
+ }
+ }
+
+ return sRet.GetByteString();
+}
+
+CFX_ByteString CPWL_Utils::GetTextAppStream(const CPDF_Rect & rcBBox,IFX_Edit_FontMap * pFontMap,
+ const CFX_WideString & sText, FX_INT32 nAlignmentH, FX_INT32 nAlignmentV,
+ FX_FLOAT fFontSize, FX_BOOL bMultiLine, FX_BOOL bAutoReturn, const CPWL_Color & crText)
+{
+ CFX_ByteTextBuf sRet;
+
+ if (IFX_Edit * pEdit = IFX_Edit::NewEdit())
+ {
+ pEdit->SetFontMap(pFontMap);
+
+ pEdit->SetPlateRect(rcBBox);
+ pEdit->SetAlignmentH(nAlignmentH);
+ pEdit->SetAlignmentV(nAlignmentV);
+ pEdit->SetMultiLine(bMultiLine);
+ pEdit->SetAutoReturn(bAutoReturn);
+ if (IsFloatZero(fFontSize))
+ pEdit->SetAutoFontSize(TRUE);
+ else
+ pEdit->SetFontSize(fFontSize);
+ pEdit->Initialize();
+
+ pEdit->SetText(sText);
+
+ CFX_ByteString sEdit = CPWL_Utils::GetEditAppStream(pEdit, CPDF_Point(0.0f,0.0f));
+ if (sEdit.GetLength() > 0)
+ {
+ sRet << "BT\n" << CPWL_Utils::GetColorAppStream(crText) << sEdit << "ET\n";
+ }
+
+ IFX_Edit::DelEdit(pEdit);
+ }
+
+ return sRet.GetByteString();
+}
+
+CFX_ByteString CPWL_Utils::GetPushButtonAppStream(const CPDF_Rect & rcBBox,
+ IFX_Edit_FontMap * pFontMap,
+ CPDF_Stream * pIconStream,
+ CPDF_IconFit & IconFit,
+ const CFX_WideString & sLabel,
+ const CPWL_Color & crText,
+ FX_FLOAT fFontSize,
+ FX_INT32 nLayOut)
+{
+ const FX_FLOAT fAutoFontScale = 1.0f / 3.0f;
+
+ if (IFX_Edit * pEdit = IFX_Edit::NewEdit())
+ {
+ pEdit->SetFontMap(pFontMap);
+
+ pEdit->SetAlignmentH(1);
+ pEdit->SetAlignmentV(1);
+ pEdit->SetMultiLine(FALSE);
+ pEdit->SetAutoReturn(FALSE);
+ if (IsFloatZero(fFontSize))
+ pEdit->SetAutoFontSize(TRUE);
+ else
+ pEdit->SetFontSize(fFontSize);
+ pEdit->Initialize();
+ pEdit->SetText(sLabel);
+
+ CPDF_Rect rcLabelContent = pEdit->GetContentRect();
+
+ CPWL_Icon Icon;
+ PWL_CREATEPARAM cp;
+ cp.dwFlags = PWS_VISIBLE;
+ Icon.Create(cp);
+ Icon.SetIconFit(&IconFit);
+ Icon.SetPDFStream(pIconStream);
+
+ CPDF_Rect rcLabel = CPDF_Rect(0,0,0,0);
+ CPDF_Rect rcIcon = CPDF_Rect(0,0,0,0);
+ FX_FLOAT fWidth = 0.0f;
+ FX_FLOAT fHeight = 0.0f;
+
+ switch (nLayOut)
+ {
+ case PPBL_LABEL:
+ rcLabel = rcBBox;
+ rcIcon = CPDF_Rect(0,0,0,0);
+ break;
+ case PPBL_ICON:
+ rcIcon = rcBBox;
+ rcLabel = CPDF_Rect(0,0,0,0);
+ break;
+ case PPBL_ICONTOPLABELBOTTOM:
+
+ if (pIconStream)
+ {
+ if (IsFloatZero(fFontSize))
+ {
+ fHeight = rcBBox.top - rcBBox.bottom;
+ rcLabel = CPDF_Rect(rcBBox.left,rcBBox.bottom,rcBBox.right,rcBBox.bottom + fHeight * fAutoFontScale);
+ rcIcon = CPDF_Rect(rcBBox.left,rcLabel.top,rcBBox.right,rcBBox.top);
+ }
+ else
+ {
+ fHeight = rcLabelContent.Height();
+
+ if (rcBBox.bottom + fHeight > rcBBox.top)
+ {
+ rcIcon = CPDF_Rect(0,0,0,0);
+ rcLabel = rcBBox;
+ }
+ else
+ {
+ rcLabel = CPDF_Rect(rcBBox.left,rcBBox.bottom,rcBBox.right,rcBBox.bottom + fHeight);
+ rcIcon = CPDF_Rect(rcBBox.left,rcLabel.top,rcBBox.right,rcBBox.top);
+ }
+ }
+ }
+ else
+ {
+ rcLabel = rcBBox;
+ rcIcon = CPDF_Rect(0,0,0,0);
+ }
+
+ break;
+ case PPBL_LABELTOPICONBOTTOM:
+
+ if (pIconStream)
+ {
+ if (IsFloatZero(fFontSize))
+ {
+ fHeight = rcBBox.top - rcBBox.bottom;
+ rcLabel = CPDF_Rect(rcBBox.left,rcBBox.top - fHeight * fAutoFontScale ,rcBBox.right,rcBBox.top);
+ rcIcon = CPDF_Rect(rcBBox.left,rcBBox.bottom,rcBBox.right,rcLabel.bottom);
+ }
+ else
+ {
+ fHeight = rcLabelContent.Height();
+
+ if (rcBBox.bottom + fHeight > rcBBox.top)
+ {
+ rcIcon = CPDF_Rect(0,0,0,0);
+ rcLabel = rcBBox;
+ }
+ else
+ {
+ rcLabel = CPDF_Rect(rcBBox.left,rcBBox.top - fHeight,rcBBox.right,rcBBox.top);
+ rcIcon = CPDF_Rect(rcBBox.left,rcBBox.bottom,rcBBox.right,rcLabel.bottom);
+ }
+ }
+ }
+ else
+ {
+ rcLabel = rcBBox;
+ rcIcon = CPDF_Rect(0,0,0,0);
+ }
+
+ break;
+ case PPBL_ICONLEFTLABELRIGHT:
+
+ if (pIconStream)
+ {
+ if (IsFloatZero(fFontSize))
+ {
+ fWidth = rcBBox.right - rcBBox.left;
+ rcLabel = CPDF_Rect(rcBBox.right - fWidth * fAutoFontScale,rcBBox.bottom,rcBBox.right,rcBBox.top);
+ rcIcon = CPDF_Rect(rcBBox.left,rcBBox.bottom,rcLabel.left,rcBBox.top);
+
+ if (rcLabelContent.Width() < fWidth * fAutoFontScale)
+ {
+ }
+ else
+ {
+ if (rcLabelContent.Width() < fWidth)
+ {
+ rcLabel = CPDF_Rect(rcBBox.right - rcLabelContent.Width(),rcBBox.bottom,rcBBox.right,rcBBox.top);
+ rcIcon = CPDF_Rect(rcBBox.left,rcBBox.bottom,rcLabel.left,rcBBox.top);
+ }
+ else
+ {
+ rcLabel = rcBBox;
+ rcIcon = CPDF_Rect(0,0,0,0);
+ }
+ }
+ }
+ else
+ {
+ fWidth = rcLabelContent.Width();
+
+ if (rcBBox.left + fWidth > rcBBox.right)
+ {
+ rcLabel = rcBBox;
+ rcIcon = CPDF_Rect(0,0,0,0);
+ }
+ else
+ {
+ rcLabel = CPDF_Rect(rcBBox.right - fWidth,rcBBox.bottom,rcBBox.right,rcBBox.top);
+ rcIcon = CPDF_Rect(rcBBox.left,rcBBox.bottom,rcLabel.left,rcBBox.top);
+ }
+ }
+ }
+ else
+ {
+ rcLabel = rcBBox;
+ rcIcon = CPDF_Rect(0,0,0,0);
+ }
+
+ break;
+ case PPBL_LABELLEFTICONRIGHT:
+
+ if (pIconStream)
+ {
+ if (IsFloatZero(fFontSize))
+ {
+ fWidth = rcBBox.right - rcBBox.left;
+ rcLabel = CPDF_Rect(rcBBox.left,rcBBox.bottom,rcBBox.left + fWidth * fAutoFontScale,rcBBox.top);
+ rcIcon = CPDF_Rect(rcLabel.right,rcBBox.bottom,rcBBox.right,rcBBox.top);
+
+ if (rcLabelContent.Width() < fWidth * fAutoFontScale)
+ {
+ }
+ else
+ {
+ if (rcLabelContent.Width() < fWidth)
+ {
+ rcLabel = CPDF_Rect(rcBBox.left,rcBBox.bottom,rcBBox.left + rcLabelContent.Width(),rcBBox.top);
+ rcIcon = CPDF_Rect(rcLabel.right,rcBBox.bottom,rcBBox.right,rcBBox.top);
+ }
+ else
+ {
+ rcLabel = rcBBox;
+ rcIcon = CPDF_Rect(0,0,0,0);
+ }
+ }
+ }
+ else
+ {
+ fWidth = rcLabelContent.Width();
+
+ if (rcBBox.left + fWidth > rcBBox.right)
+ {
+ rcLabel = rcBBox;
+ rcIcon = CPDF_Rect(0,0,0,0);
+ }
+ else
+ {
+ rcLabel = CPDF_Rect(rcBBox.left,rcBBox.bottom,rcBBox.left + fWidth,rcBBox.top);
+ rcIcon = CPDF_Rect(rcLabel.right,rcBBox.bottom,rcBBox.right,rcBBox.top);
+ }
+ }
+ }
+ else
+ {
+ rcLabel = rcBBox;
+ rcIcon = CPDF_Rect(0,0,0,0);
+ }
+
+ break;
+ case PPBL_LABELOVERICON:
+ rcLabel = rcBBox;
+ rcIcon = rcBBox;
+ break;
+ }
+
+ CFX_ByteTextBuf sAppStream,sTemp;
+
+ if (!rcIcon.IsEmpty())
+ {
+ Icon.Move(rcIcon, FALSE, FALSE);
+ sTemp << Icon.GetImageAppStream();
+ }
+
+ Icon.Destroy();
+
+ if (!rcLabel.IsEmpty())
+ {
+ pEdit->SetPlateRect(rcLabel);
+ CFX_ByteString sEdit = CPWL_Utils::GetEditAppStream(pEdit,CPDF_Point(0.0f,0.0f));
+ if (sEdit.GetLength() > 0)
+ {
+ sTemp << "BT\n" << CPWL_Utils::GetColorAppStream(crText) << sEdit << "ET\n";
+ }
+ }
+
+ IFX_Edit::DelEdit(pEdit);
+
+ if (sTemp.GetSize() > 0)
+ {
+ sAppStream << "q\n" << rcBBox.left << " " << rcBBox.bottom << " "
+ << rcBBox.right - rcBBox.left << " " << rcBBox.top - rcBBox.bottom << " re W n\n";
+ sAppStream << sTemp << "Q\n";
+ }
+
+ return sAppStream.GetByteString();
+ }
+
+ return "";
+}
+
+CFX_ByteString CPWL_Utils::GetColorAppStream(const CPWL_Color & color,const FX_BOOL & bFillOrStroke)
+{
+ CFX_ByteTextBuf sColorStream;
+
+ switch (color.nColorType)
+ {
+ case COLORTYPE_RGB:
+ sColorStream << color.fColor1 << " " << color.fColor2 << " " << color.fColor3 << " "
+ << (bFillOrStroke ? "rg" : "RG") << "\n";
+ break;
+ case COLORTYPE_GRAY:
+ sColorStream << color.fColor1 << " " << (bFillOrStroke ? "g" : "G") << "\n";
+ break;
+ case COLORTYPE_CMYK:
+ sColorStream << color.fColor1 << " " << color.fColor2 << " " << color.fColor3 << " " << color.fColor4 << " "
+ << (bFillOrStroke ? "k" : "K") << "\n";
+ break;
+ }
+
+ return sColorStream.GetByteString();
+}
+
+CFX_ByteString CPWL_Utils::GetBorderAppStream(const CPDF_Rect & rect, FX_FLOAT fWidth,
+ const CPWL_Color & color, const CPWL_Color & crLeftTop, const CPWL_Color & crRightBottom,
+ FX_INT32 nStyle, const CPWL_Dash & dash)
+{
+ CFX_ByteTextBuf sAppStream;
+ CFX_ByteString sColor;
+
+ FX_FLOAT fLeft = rect.left;
+ FX_FLOAT fRight = rect.right;
+ FX_FLOAT fTop = rect.top;
+ FX_FLOAT fBottom = rect.bottom;
+
+ if (fWidth > 0.0f)
+ {
+ FX_FLOAT fHalfWidth = fWidth / 2.0f;
+
+ sAppStream << "q\n";
+
+ switch (nStyle)
+ {
+ default:
+ case PBS_SOLID:
+ sColor = CPWL_Utils::GetColorAppStream(color,TRUE);
+ if (sColor.GetLength() > 0)
+ {
+ sAppStream << sColor;
+ sAppStream << fLeft << " " << fBottom << " " << fRight - fLeft << " " << fTop - fBottom << " re\n";
+ sAppStream << fLeft + fWidth << " " << fBottom + fWidth << " "
+ << fRight - fLeft - fWidth * 2 << " " << fTop - fBottom - fWidth * 2 << " re\n";
+ sAppStream << "f*\n";
+ }
+ break;
+ case PBS_DASH:
+ sColor = CPWL_Utils::GetColorAppStream(color,FALSE);
+ if (sColor.GetLength() > 0)
+ {
+ sAppStream << sColor;
+ sAppStream << fWidth << " w" << " [" << dash.nDash << " " << dash.nGap << "] " << dash.nPhase << " d\n";
+ sAppStream << fLeft + fWidth / 2 << " " << fBottom + fWidth / 2 << " m\n";
+ sAppStream << fLeft + fWidth / 2 << " " << fTop - fWidth / 2 << " l\n";
+ sAppStream << fRight - fWidth / 2 << " " << fTop - fWidth / 2 << " l\n";
+ sAppStream << fRight - fWidth / 2 << " " << fBottom + fWidth / 2 << " l\n";
+ sAppStream << fLeft + fWidth / 2 << " " << fBottom + fWidth / 2 << " l S\n";
+ }
+ break;
+ case PBS_BEVELED:
+ case PBS_INSET:
+ sColor = CPWL_Utils::GetColorAppStream(crLeftTop,TRUE);
+ if (sColor.GetLength() > 0)
+ {
+ sAppStream << sColor;
+ sAppStream << fLeft + fHalfWidth << " " << fBottom + fHalfWidth << " m\n";
+ sAppStream << fLeft + fHalfWidth << " " << fTop - fHalfWidth << " l\n";
+ sAppStream << fRight - fHalfWidth << " " << fTop - fHalfWidth << " l\n";
+ sAppStream << fRight - fHalfWidth * 2 << " " << fTop - fHalfWidth * 2 << " l\n";
+ sAppStream << fLeft + fHalfWidth * 2 << " " << fTop - fHalfWidth * 2 << " l\n";
+ sAppStream << fLeft + fHalfWidth * 2 << " " << fBottom + fHalfWidth * 2 << " l f\n";
+ }
+
+ sColor = CPWL_Utils::GetColorAppStream(crRightBottom,TRUE);
+ if (sColor.GetLength() > 0)
+ {
+ sAppStream << sColor;
+ sAppStream << fRight - fHalfWidth << " " << fTop - fHalfWidth << " m\n";
+ sAppStream << fRight - fHalfWidth << " " << fBottom + fHalfWidth << " l\n";
+ sAppStream << fLeft + fHalfWidth << " " << fBottom + fHalfWidth << " l\n";
+ sAppStream << fLeft + fHalfWidth * 2 << " " << fBottom + fHalfWidth * 2 << " l\n";
+ sAppStream << fRight - fHalfWidth * 2 << " " << fBottom + fHalfWidth * 2 << " l\n";
+ sAppStream << fRight - fHalfWidth * 2 << " " << fTop - fHalfWidth * 2 << " l f\n";
+ }
+
+ sColor = CPWL_Utils::GetColorAppStream(color,TRUE);
+ if (sColor.GetLength() > 0)
+ {
+ sAppStream << sColor;
+ sAppStream << fLeft << " " << fBottom << " " << fRight - fLeft << " " << fTop - fBottom << " re\n";
+ sAppStream << fLeft + fHalfWidth << " " << fBottom + fHalfWidth << " "
+ << fRight - fLeft - fHalfWidth * 2 << " " << fTop - fBottom - fHalfWidth * 2 << " re f*\n";
+ }
+ break;
+ case PBS_UNDERLINED:
+ sColor = CPWL_Utils::GetColorAppStream(color,FALSE);
+ if (sColor.GetLength() > 0)
+ {
+ sAppStream << sColor;
+ sAppStream << fWidth << " w\n";
+ sAppStream << fLeft << " " << fBottom + fWidth / 2 << " m\n";
+ sAppStream << fRight << " " << fBottom + fWidth / 2 << " l S\n";
+ }
+ break;
+ }
+
+ sAppStream << "Q\n";
+ }
+
+ return sAppStream.GetByteString();
+}
+
+CFX_ByteString CPWL_Utils::GetCircleBorderAppStream(const CPDF_Rect & rect, FX_FLOAT fWidth,
+ const CPWL_Color & color, const CPWL_Color & crLeftTop, const CPWL_Color & crRightBottom,
+ FX_INT32 nStyle, const CPWL_Dash & dash)
+{
+ CFX_ByteTextBuf sAppStream;
+ CFX_ByteString sColor;
+
+
+
+
+
+
+ if (fWidth > 0.0f)
+ {
+ sAppStream << "q\n";
+
+ switch (nStyle)
+ {
+ default:
+ case PBS_SOLID:
+ case PBS_UNDERLINED:
+ {
+ sColor = CPWL_Utils::GetColorAppStream(color,FALSE);
+ if (sColor.GetLength() > 0)
+ {
+ sAppStream << "q\n" << fWidth << " w\n" << sColor
+ << CPWL_Utils::GetAP_Circle(CPWL_Utils::DeflateRect(rect,fWidth / 2.0f))
+ << " S\nQ\n";
+ }
+ }
+ break;
+ case PBS_DASH:
+ {
+ sColor = CPWL_Utils::GetColorAppStream(color,FALSE);
+ if (sColor.GetLength() > 0)
+ {
+ sAppStream << "q\n" << fWidth << " w\n"
+ << "[" << dash.nDash << " " << dash.nGap << "] " << dash.nPhase << " d\n"
+ << sColor << CPWL_Utils::GetAP_Circle(CPWL_Utils::DeflateRect(rect,fWidth / 2.0f))
+ << " S\nQ\n";
+ }
+ }
+ break;
+ case PBS_BEVELED:
+ {
+ FX_FLOAT fHalfWidth = fWidth / 2.0f;
+
+ sColor = CPWL_Utils::GetColorAppStream(color,FALSE);
+ if (sColor.GetLength() > 0)
+ {
+ sAppStream << "q\n" << fHalfWidth << " w\n"
+ << sColor << CPWL_Utils::GetAP_Circle(rect)
+ << " S\nQ\n";
+ }
+
+ sColor = CPWL_Utils::GetColorAppStream(crLeftTop,FALSE);
+ if (sColor.GetLength() > 0)
+ {
+ sAppStream << "q\n" << fHalfWidth << " w\n"
+ << sColor << CPWL_Utils::GetAP_HalfCircle(CPWL_Utils::DeflateRect(rect,fHalfWidth * 0.75f),PWL_PI/4.0f)
+ << " S\nQ\n";
+ }
+
+ sColor = CPWL_Utils::GetColorAppStream(crRightBottom,FALSE);
+ if (sColor.GetLength() > 0)
+ {
+ sAppStream << "q\n" << fHalfWidth << " w\n"
+ << sColor << CPWL_Utils::GetAP_HalfCircle(CPWL_Utils::DeflateRect(rect,fHalfWidth * 0.75f),PWL_PI*5/4.0f)
+ << " S\nQ\n";
+ }
+ }
+ break;
+ case PBS_INSET:
+ {
+ FX_FLOAT fHalfWidth = fWidth / 2.0f;
+
+ sColor = CPWL_Utils::GetColorAppStream(color,FALSE);
+ if (sColor.GetLength() > 0)
+ {
+ sAppStream << "q\n" << fHalfWidth << " w\n"
+ << sColor << CPWL_Utils::GetAP_Circle(rect)
+ << " S\nQ\n";
+ }
+
+ sColor = CPWL_Utils::GetColorAppStream(crLeftTop,FALSE);
+ if (sColor.GetLength() > 0)
+ {
+ sAppStream << "q\n" << fHalfWidth << " w\n"
+ << sColor << CPWL_Utils::GetAP_HalfCircle(CPWL_Utils::DeflateRect(rect,fHalfWidth * 0.75f),PWL_PI/4.0f)
+ << " S\nQ\n";
+ }
+
+ sColor = CPWL_Utils::GetColorAppStream(crRightBottom,FALSE);
+ if (sColor.GetLength() > 0)
+ {
+ sAppStream << "q\n" << fHalfWidth << " w\n"
+ << sColor << CPWL_Utils::GetAP_HalfCircle(CPWL_Utils::DeflateRect(rect,fHalfWidth * 0.75f),PWL_PI*5/4.0f)
+ << " S\nQ\n";
+ }
+ }
+ break;
+ }
+
+ sAppStream << "Q\n";
+ }
+
+ return sAppStream.GetByteString();
+}
+
+CPWL_Color CPWL_Utils::SubstractColor(const CPWL_Color & sColor,FX_FLOAT fColorSub)
+{
+ CPWL_Color sRet;
+ sRet.nColorType = sColor.nColorType;
+
+ switch (sColor.nColorType)
+ {
+ case COLORTYPE_TRANSPARENT:
+ sRet.nColorType = COLORTYPE_RGB;
+ sRet.fColor1 = PWL_MAX(1 - fColorSub,0.0f);
+ sRet.fColor2 = PWL_MAX(1 - fColorSub,0.0f);
+ sRet.fColor3 = PWL_MAX(1 - fColorSub,0.0f);
+ break;
+ case COLORTYPE_RGB:
+ case COLORTYPE_GRAY:
+ case COLORTYPE_CMYK:
+ sRet.fColor1 = PWL_MAX(sColor.fColor1 - fColorSub,0.0f);
+ sRet.fColor2 = PWL_MAX(sColor.fColor2 - fColorSub,0.0f);
+ sRet.fColor3 = PWL_MAX(sColor.fColor3 - fColorSub,0.0f);
+ sRet.fColor4 = PWL_MAX(sColor.fColor4 - fColorSub,0.0f);
+ break;
+ }
+
+ return sRet;
+}
+
+CPWL_Color CPWL_Utils::DevideColor(const CPWL_Color & sColor,FX_FLOAT fColorDevide)
+{
+ CPWL_Color sRet;
+ sRet.nColorType = sColor.nColorType;
+
+ switch (sColor.nColorType)
+ {
+ case COLORTYPE_TRANSPARENT:
+ sRet.nColorType = COLORTYPE_RGB;
+ sRet.fColor1 = 1 / fColorDevide;
+ sRet.fColor2 = 1 / fColorDevide;
+ sRet.fColor3 = 1 / fColorDevide;
+ break;
+ case COLORTYPE_RGB:
+ case COLORTYPE_GRAY:
+ case COLORTYPE_CMYK:
+ sRet = sColor;
+ sRet.fColor1 /= fColorDevide;
+ sRet.fColor2 /= fColorDevide;
+ sRet.fColor3 /= fColorDevide;
+ sRet.fColor4 /= fColorDevide;
+ break;
+ }
+
+ return sRet;
+}
+
+CFX_ByteString CPWL_Utils::GetAppStream_Check(const CPDF_Rect & rcBBox, const CPWL_Color & crText)
+{
+ CFX_ByteTextBuf sAP;
+ sAP << "q\n" << CPWL_Utils::GetColorAppStream(crText,TRUE) << CPWL_Utils::GetAP_Check(rcBBox) << "f\nQ\n";
+ return sAP.GetByteString();
+}
+
+CFX_ByteString CPWL_Utils::GetAppStream_Circle(const CPDF_Rect & rcBBox, const CPWL_Color & crText)
+{
+ CFX_ByteTextBuf sAP;
+ sAP << "q\n" << CPWL_Utils::GetColorAppStream(crText,TRUE) << CPWL_Utils::GetAP_Circle(rcBBox) << "f\nQ\n";
+ return sAP.GetByteString();
+}
+
+CFX_ByteString CPWL_Utils::GetAppStream_Cross(const CPDF_Rect & rcBBox, const CPWL_Color & crText)
+{
+ CFX_ByteTextBuf sAP;
+ sAP << "q\n" << CPWL_Utils::GetColorAppStream(crText,FALSE) << CPWL_Utils::GetAP_Cross(rcBBox) << "S\nQ\n";
+ return sAP.GetByteString();
+}
+
+CFX_ByteString CPWL_Utils::GetAppStream_Diamond(const CPDF_Rect & rcBBox, const CPWL_Color & crText)
+{
+ CFX_ByteTextBuf sAP;
+ sAP << "q\n1 w\n" << CPWL_Utils::GetColorAppStream(crText,TRUE) << CPWL_Utils::GetAP_Diamond(rcBBox) << "f\nQ\n";
+ return sAP.GetByteString();
+}
+
+CFX_ByteString CPWL_Utils::GetAppStream_Square(const CPDF_Rect & rcBBox, const CPWL_Color & crText)
+{
+ CFX_ByteTextBuf sAP;
+ sAP << "q\n" << CPWL_Utils::GetColorAppStream(crText,TRUE) << CPWL_Utils::GetAP_Square(rcBBox) << "f\nQ\n";
+ return sAP.GetByteString();
+}
+
+CFX_ByteString CPWL_Utils::GetAppStream_Star(const CPDF_Rect & rcBBox, const CPWL_Color & crText)
+{
+ CFX_ByteTextBuf sAP;
+ sAP << "q\n" << CPWL_Utils::GetColorAppStream(crText,TRUE) << CPWL_Utils::GetAP_Star(rcBBox) << "f\nQ\n";
+ return sAP.GetByteString();
+}
+
+CFX_ByteString CPWL_Utils::GetCheckBoxAppStream(const CPDF_Rect & rcBBox,
+ FX_INT32 nStyle,
+ const CPWL_Color & crText)
+{
+ CPDF_Rect rcCenter = GetCenterSquare(rcBBox);
+ switch (nStyle)
+ {
+ default:
+ case PCS_CHECK:
+ return GetAppStream_Check(rcCenter,crText);
+ case PCS_CIRCLE:
+ return GetAppStream_Circle(ScaleRect(rcCenter,2.0f/3.0f),crText);
+ case PCS_CROSS:
+ return GetAppStream_Cross(rcCenter,crText);
+ case PCS_DIAMOND:
+ return GetAppStream_Diamond(ScaleRect(rcCenter,2.0f/3.0f),crText);
+ case PCS_SQUARE:
+ return GetAppStream_Square(ScaleRect(rcCenter,2.0f/3.0f),crText);
+ case PCS_STAR:
+ return GetAppStream_Star(ScaleRect(rcCenter,2.0f/3.0f),crText);
+ }
+}
+
+CFX_ByteString CPWL_Utils::GetRadioButtonAppStream(const CPDF_Rect & rcBBox,
+ FX_INT32 nStyle,
+ const CPWL_Color & crText)
+{
+ CPDF_Rect rcCenter = GetCenterSquare(rcBBox);
+ switch (nStyle)
+ {
+ default:
+ case PCS_CHECK:
+ return GetAppStream_Check(rcCenter,crText);
+ case PCS_CIRCLE:
+ return GetAppStream_Circle(ScaleRect(rcCenter,1.0f/2.0f),crText);
+ case PCS_CROSS:
+ return GetAppStream_Cross(rcCenter,crText);
+ case PCS_DIAMOND:
+ return GetAppStream_Diamond(ScaleRect(rcCenter,2.0f/3.0f),crText);
+ case PCS_SQUARE:
+ return GetAppStream_Square(ScaleRect(rcCenter,2.0f/3.0f),crText);
+ case PCS_STAR:
+ return GetAppStream_Star(ScaleRect(rcCenter,2.0f/3.0f),crText);
+ }
+}
+
+CFX_ByteString CPWL_Utils::GetDropButtonAppStream(const CPDF_Rect & rcBBox)
+{
+ CFX_ByteTextBuf sAppStream;
+
+ if (!rcBBox.IsEmpty())
+ {
+ sAppStream << "q\n" << CPWL_Utils::GetColorAppStream(CPWL_Color(COLORTYPE_RGB,220.0f/255.0f,220.0f/255.0f,220.0f/255.0f),TRUE);
+ sAppStream << rcBBox.left << " " << rcBBox.bottom << " "
+ << rcBBox.right - rcBBox.left << " " << rcBBox.top - rcBBox.bottom << " re f\n";
+ sAppStream << "Q\n";
+
+ sAppStream << "q\n" <<
+ CPWL_Utils::GetBorderAppStream(rcBBox,2,CPWL_Color(COLORTYPE_GRAY,0),CPWL_Color(COLORTYPE_GRAY,1),CPWL_Color(COLORTYPE_GRAY,0.5),PBS_BEVELED,CPWL_Dash(3,0,0))
+ << "Q\n";
+
+ CPDF_Point ptCenter = CPDF_Point((rcBBox.left + rcBBox.right)/2,(rcBBox.top + rcBBox.bottom)/2);
+ if (IsFloatBigger(rcBBox.right - rcBBox.left,6) && IsFloatBigger(rcBBox.top - rcBBox.bottom,6))
+ {
+ sAppStream << "q\n" << " 0 g\n";
+ sAppStream << ptCenter.x - 3 << " " << ptCenter.y + 1.5f << " m\n";
+ sAppStream << ptCenter.x + 3 << " " << ptCenter.y + 1.5f << " l\n";
+ sAppStream << ptCenter.x << " " << ptCenter.y - 1.5f << " l\n";
+ sAppStream << ptCenter.x - 3 << " " << ptCenter.y + 1.5f << " l f\n";
+ sAppStream << "Q\n";
+ }
+ }
+
+ return sAppStream.GetByteString();
+}
+
+void CPWL_Utils::ConvertCMYK2GRAY(FX_FLOAT dC,FX_FLOAT dM,FX_FLOAT dY,FX_FLOAT dK,FX_FLOAT &dGray)
+{
+ if (dC<0 || dC>1 || dM<0 || dM>1 || dY < 0 || dY >1 || dK < 0 || dK >1)
+ return;
+ dGray = 1.0f - FX_MIN(1.0f,0.3f*dC+0.59f * dM + 0.11f*dY+dK);
+}
+
+void CPWL_Utils::ConvertGRAY2CMYK(FX_FLOAT dGray,FX_FLOAT &dC,FX_FLOAT &dM,FX_FLOAT &dY,FX_FLOAT &dK)
+{
+ if (dGray <0 || dGray >1)
+ return;
+ dC = 0.0f;
+ dM = 0.0f;
+ dY = 0.0f;
+ dK = 1.0f-dGray;
+}
+
+void CPWL_Utils::ConvertGRAY2RGB(FX_FLOAT dGray,FX_FLOAT &dR,FX_FLOAT &dG,FX_FLOAT &dB)
+{
+ if (dGray <0 || dGray >1)
+ return;
+ dR = dGray;
+ dG = dGray;
+ dB = dGray;
+}
+
+void CPWL_Utils::ConvertRGB2GRAY(FX_FLOAT dR,FX_FLOAT dG,FX_FLOAT dB,FX_FLOAT &dGray)
+{
+ if (dR<0 || dR>1 || dG<0 || dG > 0 || dB < 0 || dB >1)
+ return;
+ dGray = 0.3f*dR+0.59f*dG+0.11f*dB;
+}
+
+void CPWL_Utils::ConvertCMYK2RGB(FX_FLOAT dC,FX_FLOAT dM,FX_FLOAT dY,FX_FLOAT dK,FX_FLOAT &dR,FX_FLOAT &dG,FX_FLOAT &dB)
+{
+ if (dC <0 || dC>1 || dM < 0 || dM > 1 || dY < 0 || dY > 1 || dK < 0 || dK > 1 )
+ return;
+ dR = 1.0f - FX_MIN(1.0f, dC + dK);
+ dG = 1.0f - FX_MIN(1.0f, dM + dK);
+ dB = 1.0f - FX_MIN(1.0f, dY + dK);
+}
+
+void CPWL_Utils::ConvertRGB2CMYK(FX_FLOAT dR,FX_FLOAT dG,FX_FLOAT dB,FX_FLOAT &dC,FX_FLOAT &dM,FX_FLOAT &dY,FX_FLOAT &dK)
+{
+ if (dR<0 || dR>1 || dG<0 || dG>1 || dB<0 || dB>1)
+ return;
+
+ dC = 1.0f - dR;
+ dM = 1.0f - dG;
+ dY = 1.0f - dB;
+ dK = FX_MIN(dC, FX_MIN(dM, dY));
+}
+
+void CPWL_Utils::PWLColorToARGB(const CPWL_Color& color, FX_INT32& alpha, FX_FLOAT& red, FX_FLOAT& green, FX_FLOAT& blue)
+{
+ switch (color.nColorType)
+ {
+ case COLORTYPE_TRANSPARENT:
+ {
+ alpha = 0;
+ }
+ break;
+ case COLORTYPE_GRAY:
+ {
+ ConvertGRAY2RGB(color.fColor1, red, green, blue);
+ }
+ break;
+ case COLORTYPE_RGB:
+ {
+ red = color.fColor1;
+ green = color.fColor2;
+ blue = color.fColor3;
+ }
+ break;
+ case COLORTYPE_CMYK:
+ {
+ ConvertCMYK2RGB(color.fColor1, color.fColor2, color.fColor3, color.fColor4,
+ red, green, blue);
+ }
+ break;
+ }
+}
+
+FX_COLORREF CPWL_Utils::PWLColorToFXColor(const CPWL_Color& color, FX_INT32 nTransparancy)
+{
+ FX_INT32 nAlpha = nTransparancy;
+ FX_FLOAT dRed = 0;
+ FX_FLOAT dGreen = 0;
+ FX_FLOAT dBlue = 0;
+
+ PWLColorToARGB(color, nAlpha, dRed, dGreen, dBlue);
+
+ return ArgbEncode(nAlpha, (FX_INT32)(dRed*255), (FX_INT32)(dGreen*255), (FX_INT32)(dBlue*255));
+}
+
+void CPWL_Utils::DrawFillRect(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,const CPDF_Rect & rect,
+ const FX_COLORREF & color)
+{
+ CFX_PathData path;
+ CPDF_Rect rcTemp(rect);
+ path.AppendRect(rcTemp.left,rcTemp.bottom,rcTemp.right,rcTemp.top);
+ pDevice->DrawPath(&path, pUser2Device, NULL, color, 0, FXFILL_WINDING);
+}
+
+void CPWL_Utils::DrawFillArea(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
+ const CPDF_Point* pPts, FX_INT32 nCount, const FX_COLORREF& color)
+{
+ CFX_PathData path;
+ path.SetPointCount(nCount);
+
+ path.SetPoint(0, pPts[0].x, pPts[0].y, FXPT_MOVETO);
+ for (FX_INT32 i=1; i<nCount; i++)
+ path.SetPoint(i, pPts[i].x, pPts[i].y, FXPT_LINETO);
+
+ pDevice->DrawPath(&path, pUser2Device, NULL, color, 0, FXFILL_ALTERNATE);
+}
+
+void CPWL_Utils::DrawStrokeRect(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,const CPDF_Rect & rect,
+ const FX_COLORREF & color, FX_FLOAT fWidth)
+{
+ CFX_PathData path;
+ CPDF_Rect rcTemp(rect);
+ path.AppendRect(rcTemp.left,rcTemp.bottom,rcTemp.right,rcTemp.top);
+
+ CFX_GraphStateData gsd;
+ gsd.m_LineWidth = fWidth;
+
+ pDevice->DrawPath(&path, pUser2Device, &gsd, 0, color, FXFILL_ALTERNATE);
+}
+
+void CPWL_Utils::DrawStrokeLine(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
+ const CPDF_Point & ptMoveTo, const CPDF_Point & ptLineTo, const FX_COLORREF & color, FX_FLOAT fWidth)
+{
+ CFX_PathData path;
+ path.SetPointCount(2);
+ path.SetPoint(0, ptMoveTo.x, ptMoveTo.y, FXPT_MOVETO);
+ path.SetPoint(1, ptLineTo.x, ptLineTo.y, FXPT_LINETO);
+
+ CFX_GraphStateData gsd;
+ gsd.m_LineWidth = fWidth;
+
+ pDevice->DrawPath(&path, pUser2Device, &gsd, 0, color, FXFILL_ALTERNATE);
+}
+
+void CPWL_Utils::DrawFillRect(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,const CPDF_Rect & rect,
+ const CPWL_Color & color, FX_INT32 nTransparancy)
+{
+ CPWL_Utils::DrawFillRect(pDevice,pUser2Device,rect,PWLColorToFXColor(color,nTransparancy));
+}
+
+void CPWL_Utils::DrawShadow(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
+ FX_BOOL bVertical, FX_BOOL bHorizontal, CPDF_Rect rect,
+ FX_INT32 nTransparancy, FX_INT32 nStartGray, FX_INT32 nEndGray)
+{
+ FX_FLOAT fStepGray = 1.0f;
+
+ if (bVertical)
+ {
+ fStepGray = (nEndGray - nStartGray) / rect.Height();
+
+ for (FX_FLOAT fy=rect.bottom+0.5f; fy<=rect.top-0.5f; fy+=1.0f)
+ {
+ FX_INT32 nGray = nStartGray + (FX_INT32)(fStepGray * (fy-rect.bottom));
+ CPWL_Utils::DrawStrokeLine(pDevice, pUser2Device, CPDF_Point(rect.left, fy),
+ CPDF_Point(rect.right, fy), ArgbEncode(nTransparancy, nGray, nGray, nGray), 1.5f);
+ }
+ }
+
+ if (bHorizontal)
+ {
+ fStepGray = (nEndGray - nStartGray) / rect.Width();
+
+ for (FX_FLOAT fx=rect.left+0.5f; fx<=rect.right-0.5f; fx+=1.0f)
+ {
+ FX_INT32 nGray = nStartGray + (FX_INT32)(fStepGray * (fx-rect.left));
+ CPWL_Utils::DrawStrokeLine(pDevice, pUser2Device, CPDF_Point(fx, rect.bottom),
+ CPDF_Point(fx, rect.top), ArgbEncode(nTransparancy, nGray, nGray, nGray), 1.5f);
+ }
+ }
+}
+
+void CPWL_Utils::DrawBorder(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
+ const CPDF_Rect & rect, FX_FLOAT fWidth,
+ const CPWL_Color & color, const CPWL_Color & crLeftTop, const CPWL_Color & crRightBottom,
+ FX_INT32 nStyle, const CPWL_Dash & dash, FX_INT32 nTransparancy)
+{
+ FX_FLOAT fLeft = rect.left;
+ FX_FLOAT fRight = rect.right;
+ FX_FLOAT fTop = rect.top;
+ FX_FLOAT fBottom = rect.bottom;
+
+ if (fWidth > 0.0f)
+ {
+ FX_FLOAT fHalfWidth = fWidth / 2.0f;
+
+ switch (nStyle)
+ {
+ default:
+ case PBS_SOLID:
+ {
+ CFX_PathData path;
+ path.AppendRect(fLeft, fBottom, fRight, fTop);
+ path.AppendRect(fLeft + fWidth, fBottom + fWidth, fRight - fWidth, fTop - fWidth);
+ pDevice->DrawPath(&path, pUser2Device, NULL, PWLColorToFXColor(color,nTransparancy), 0, FXFILL_ALTERNATE);
+ }
+ break;
+ case PBS_DASH:
+ {
+ CFX_PathData path;
+
+ path.SetPointCount(5);
+ path.SetPoint(0, fLeft + fWidth / 2.0f, fBottom + fWidth / 2.0f, FXPT_MOVETO);
+ path.SetPoint(1, fLeft + fWidth / 2.0f, fTop - fWidth / 2.0f, FXPT_LINETO);
+ path.SetPoint(2, fRight - fWidth / 2.0f, fTop - fWidth / 2.0f, FXPT_LINETO);
+ path.SetPoint(3, fRight - fWidth / 2.0f, fBottom + fWidth / 2.0f, FXPT_LINETO);
+ path.SetPoint(4, fLeft + fWidth / 2.0f, fBottom + fWidth / 2.0f, FXPT_LINETO);
+
+ CFX_GraphStateData gsd;
+ gsd.SetDashCount(2);
+ gsd.m_DashArray[0] = 3.0f;
+ gsd.m_DashArray[1] = 3.0f;
+ gsd.m_DashPhase = 0;
+
+ gsd.m_LineWidth = fWidth;
+ pDevice->DrawPath(&path, pUser2Device, &gsd, 0, PWLColorToFXColor(color,nTransparancy), FXFILL_WINDING);
+ }
+ break;
+ case PBS_BEVELED:
+ case PBS_INSET:
+ {
+ CFX_GraphStateData gsd;
+ gsd.m_LineWidth = fHalfWidth;
+
+ CFX_PathData pathLT;
+
+ pathLT.SetPointCount(7);
+ pathLT.SetPoint(0, fLeft + fHalfWidth, fBottom + fHalfWidth, FXPT_MOVETO);
+ pathLT.SetPoint(1, fLeft + fHalfWidth, fTop - fHalfWidth, FXPT_LINETO);
+ pathLT.SetPoint(2, fRight - fHalfWidth, fTop - fHalfWidth, FXPT_LINETO);
+ pathLT.SetPoint(3, fRight - fHalfWidth * 2, fTop - fHalfWidth * 2, FXPT_LINETO);
+ pathLT.SetPoint(4, fLeft + fHalfWidth * 2, fTop - fHalfWidth * 2, FXPT_LINETO);
+ pathLT.SetPoint(5, fLeft + fHalfWidth * 2, fBottom + fHalfWidth * 2, FXPT_LINETO);
+ pathLT.SetPoint(6, fLeft + fHalfWidth, fBottom + fHalfWidth, FXPT_LINETO);
+
+ pDevice->DrawPath(&pathLT, pUser2Device, &gsd, PWLColorToFXColor(crLeftTop,nTransparancy), 0, FXFILL_ALTERNATE);
+
+ CFX_PathData pathRB;
+
+ pathRB.SetPointCount(7);
+ pathRB.SetPoint(0, fRight - fHalfWidth, fTop - fHalfWidth, FXPT_MOVETO);
+ pathRB.SetPoint(1, fRight - fHalfWidth, fBottom + fHalfWidth, FXPT_LINETO);
+ pathRB.SetPoint(2, fLeft + fHalfWidth, fBottom + fHalfWidth, FXPT_LINETO);
+ pathRB.SetPoint(3, fLeft + fHalfWidth * 2, fBottom + fHalfWidth * 2, FXPT_LINETO);
+ pathRB.SetPoint(4, fRight - fHalfWidth * 2, fBottom + fHalfWidth * 2, FXPT_LINETO);
+ pathRB.SetPoint(5, fRight - fHalfWidth * 2, fTop - fHalfWidth * 2, FXPT_LINETO);
+ pathRB.SetPoint(6, fRight - fHalfWidth, fTop - fHalfWidth, FXPT_LINETO);
+
+ pDevice->DrawPath(&pathRB, pUser2Device, &gsd, PWLColorToFXColor(crRightBottom,nTransparancy), 0, FXFILL_ALTERNATE);
+
+ CFX_PathData path;
+
+ path.AppendRect(fLeft, fBottom, fRight, fTop);
+ path.AppendRect(fLeft + fHalfWidth, fBottom + fHalfWidth, fRight - fHalfWidth, fTop - fHalfWidth);
+
+ pDevice->DrawPath(&path, pUser2Device, &gsd, PWLColorToFXColor(color,nTransparancy), 0, FXFILL_ALTERNATE);
+ }
+ break;
+ case PBS_UNDERLINED:
+ {
+ CFX_PathData path;
+
+ path.SetPointCount(2);
+ path.SetPoint(0, fLeft, fBottom + fWidth / 2, FXPT_MOVETO);
+ path.SetPoint(1, fRight, fBottom + fWidth / 2, FXPT_LINETO);
+
+ CFX_GraphStateData gsd;
+ gsd.m_LineWidth = fWidth;
+
+ pDevice->DrawPath(&path, pUser2Device, &gsd,0, PWLColorToFXColor(color,nTransparancy), FXFILL_ALTERNATE);
+ }
+ break;
+ case PBS_SHADOW:
+ {
+ CFX_PathData path;
+ path.AppendRect(fLeft, fBottom, fRight, fTop);
+ path.AppendRect(fLeft + fWidth, fBottom + fWidth, fRight - fWidth, fTop - fWidth);
+ pDevice->DrawPath(&path, pUser2Device, NULL, PWLColorToFXColor(color,nTransparancy/2), 0, FXFILL_ALTERNATE);
+ }
+ break;
+ }
+ }
+}
+
+static void AddSquigglyPath(CFX_PathData & PathData, FX_FLOAT fStartX, FX_FLOAT fEndX, FX_FLOAT fY, FX_FLOAT fStep)
+{
+ PathData.AddPointCount(1);
+ PathData.SetPoint(PathData.GetPointCount() - 1, fStartX, fY, FXPT_MOVETO);
+
+ FX_FLOAT fx;
+ FX_INT32 i;
+
+ for (i=1,fx=fStartX+fStep; fx<fEndX; fx+=fStep,i++)
+ {
+ PathData.AddPointCount(1);
+ PathData.SetPoint(PathData.GetPointCount() - 1, fx, fY + (i&1)*fStep, FXPT_LINETO);
+ }
+}
+
+static void AddSpellCheckObj(CFX_PathData & PathData, IFX_Edit* pEdit, const CPVT_WordRange& wrWord)
+{
+ FX_FLOAT fStartX = 0.0f;
+ FX_FLOAT fEndX = 0.0f;
+ FX_FLOAT fY = 0.0f;
+ FX_FLOAT fStep = 0.0f;
+
+ FX_BOOL bBreak = FALSE;
+
+ if (IFX_Edit_Iterator* pIterator = pEdit->GetIterator())
+ {
+ pIterator->SetAt(wrWord.BeginPos);
+
+ do
+ {
+ CPVT_WordPlace place = pIterator->GetAt();
+
+ CPVT_Line line;
+ if (pIterator->GetLine(line))
+ {
+ fY = line.ptLine.y;
+ fStep = (line.fLineAscent - line.fLineDescent) / 16.0f;
+ }
+
+ if (place.LineCmp(wrWord.BeginPos) == 0)
+ {
+ pIterator->SetAt(wrWord.BeginPos);
+ CPVT_Word word;
+ if (pIterator->GetWord(word))
+ {
+ fStartX = word.ptWord.x;
+ }
+ }
+ else
+ {
+ fStartX = line.ptLine.x;
+ }
+
+ if (place.LineCmp(wrWord.EndPos) == 0)
+ {
+ pIterator->SetAt(wrWord.EndPos);
+ CPVT_Word word;
+ if (pIterator->GetWord(word))
+ {
+ fEndX = word.ptWord.x + word.fWidth;
+ }
+
+ bBreak = TRUE;
+ }
+ else
+ {
+ fEndX = line.ptLine.x + line.fLineWidth;
+ }
+
+ AddSquigglyPath(PathData, fStartX, fEndX, fY, fStep);
+
+ if (bBreak) break;
+ }
+ while (pIterator->NextLine());
+ }
+}
+
+void CPWL_Utils::DrawEditSpellCheck(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, IFX_Edit* pEdit,
+ const CPDF_Rect& rcClip, const CPDF_Point& ptOffset, const CPVT_WordRange* pRange,
+ IPWL_SpellCheck * pSpellCheck)
+{
+ const FX_COLORREF crSpell = ArgbEncode(255,255,0,0);
+
+ //for spellcheck
+ FX_BOOL bLatinWord = FALSE;
+ CPVT_WordPlace wpWordStart;
+ CFX_ByteString sLatinWord;
+
+ CFX_PathData pathSpell;
+
+ pDevice->SaveState();
+
+ if (!rcClip.IsEmpty())
+ {
+ CPDF_Rect rcTemp = rcClip;
+ pUser2Device->TransformRect(rcTemp);
+ FX_RECT rcDevClip;
+ rcDevClip.left = (FX_INT32)rcTemp.left;
+ rcDevClip.right = (FX_INT32)rcTemp.right;
+ rcDevClip.top = (FX_INT32)rcTemp.top;
+ rcDevClip.bottom = (FX_INT32)rcTemp.bottom;
+ pDevice->SetClip_Rect(&rcDevClip);
+ }
+
+ if (IFX_Edit_Iterator* pIterator = pEdit->GetIterator())
+ {
+ if (pEdit->GetFontMap())
+ {
+ if (pRange)
+ pIterator->SetAt(pRange->BeginPos);
+ else
+ pIterator->SetAt(0);
+
+ CPVT_WordPlace oldplace;
+
+ while (pIterator->NextWord())
+ {
+ CPVT_WordPlace place = pIterator->GetAt();
+ if (pRange && place.WordCmp(pRange->EndPos) > 0) break;
+
+ CPVT_Word word;
+ if (pIterator->GetWord(word))
+ {
+ if (FX_EDIT_ISLATINWORD(word.Word))
+ {
+ if (!bLatinWord)
+ {
+ wpWordStart = place;
+ bLatinWord = TRUE;
+ }
+
+ sLatinWord += (char)word.Word;
+ }
+ else
+ {
+ if (bLatinWord)
+ {
+ if (!sLatinWord.IsEmpty())
+ {
+ if (pSpellCheck && !pSpellCheck->CheckWord(sLatinWord))
+ {
+ AddSpellCheckObj(pathSpell,pEdit,CPVT_WordRange(wpWordStart,oldplace));
+ pIterator->SetAt(place);
+ }
+ }
+ bLatinWord = FALSE;
+ }
+
+ sLatinWord.Empty();
+ }
+
+ oldplace = place;
+ }
+ else
+ {
+ if (bLatinWord)
+ {
+ if (!sLatinWord.IsEmpty())
+ {
+ if (pSpellCheck && !pSpellCheck->CheckWord(sLatinWord))
+ {
+ AddSpellCheckObj(pathSpell,pEdit,CPVT_WordRange(wpWordStart,oldplace));
+ pIterator->SetAt(place);
+ }
+ }
+ bLatinWord = FALSE;
+ }
+
+ sLatinWord.Empty();
+ }
+ }
+
+ if (!sLatinWord.IsEmpty())
+ {
+ if (pSpellCheck && !pSpellCheck->CheckWord(sLatinWord))
+ {
+ AddSpellCheckObj(pathSpell,pEdit,CPVT_WordRange(wpWordStart,oldplace));
+ }
+ }
+ }
+ }
+
+ CFX_GraphStateData gsd;
+ gsd.m_LineWidth = 0;
+ if (pathSpell.GetPointCount() > 0)
+ pDevice->DrawPath(&pathSpell, pUser2Device, &gsd, 0, crSpell, FXFILL_ALTERNATE);
+
+ pDevice->RestoreState();
+}
+
+FX_BOOL CPWL_Utils::IsBlackOrWhite(const CPWL_Color& color)
+{
+ switch (color.nColorType)
+ {
+ case COLORTYPE_TRANSPARENT:
+ return FALSE;
+ case COLORTYPE_GRAY:
+ return color.fColor1 < 0.5f;
+ case COLORTYPE_RGB:
+ return color.fColor1 + color.fColor2 + color.fColor3 < 1.5f;
+ case COLORTYPE_CMYK:
+ return color.fColor1 + color.fColor2 + color.fColor3 + color.fColor4 > 2.0f;
+ }
+
+ return TRUE;
+}
+
+CPWL_Color CPWL_Utils::GetReverseColor(const CPWL_Color& color)
+{
+ CPWL_Color crRet = color;
+
+ switch (color.nColorType)
+ {
+ case COLORTYPE_GRAY:
+ crRet.fColor1 = 1.0f - crRet.fColor1;
+ break;
+ case COLORTYPE_RGB:
+ crRet.fColor1 = 1.0f - crRet.fColor1;
+ crRet.fColor2 = 1.0f - crRet.fColor2;
+ crRet.fColor3 = 1.0f - crRet.fColor3;
+ break;
+ case COLORTYPE_CMYK:
+ crRet.fColor1 = 1.0f - crRet.fColor1;
+ crRet.fColor2 = 1.0f - crRet.fColor2;
+ crRet.fColor3 = 1.0f - crRet.fColor3;
+ crRet.fColor4 = 1.0f - crRet.fColor4;
+ break;
+ }
+
+ return crRet;
+}
+
+CFX_ByteString CPWL_Utils::GetIconAppStream(FX_INT32 nType, const CPDF_Rect& rect, const CPWL_Color& crFill,
+ const CPWL_Color& crStroke)
+{
+ CFX_ByteString sAppStream = CPWL_Utils::GetColorAppStream(crStroke, FALSE);
+ sAppStream += CPWL_Utils::GetColorAppStream(crFill, TRUE);
+
+ CFX_ByteString sPath;
+ CFX_PathData path;
+
+ switch (nType)
+ {
+ case PWL_ICONTYPE_CHECKMARK:
+ GetGraphics_Checkmark(sPath, path, rect, PWLPT_STREAM);
+ break;
+ case PWL_ICONTYPE_CIRCLE:
+ GetGraphics_Circle(sPath, path, rect, PWLPT_STREAM);
+ break;
+ case PWL_ICONTYPE_COMMENT:
+ GetGraphics_Comment(sPath, path, rect, PWLPT_STREAM);
+ break;
+ case PWL_ICONTYPE_CROSS:
+ GetGraphics_Cross(sPath, path, rect, PWLPT_STREAM);
+ break;
+ case PWL_ICONTYPE_HELP:
+ GetGraphics_Help(sPath, path, rect, PWLPT_STREAM);
+ break;
+ case PWL_ICONTYPE_INSERTTEXT:
+ GetGraphics_InsertText(sPath, path, rect, PWLPT_STREAM);
+ break;
+ case PWL_ICONTYPE_KEY:
+ GetGraphics_Key(sPath, path, rect, PWLPT_STREAM);
+ break;
+ case PWL_ICONTYPE_NEWPARAGRAPH:
+ GetGraphics_NewParagraph(sPath, path, rect, PWLPT_STREAM);
+ break;
+ case PWL_ICONTYPE_TEXTNOTE:
+ GetGraphics_TextNote(sPath, path, rect, PWLPT_STREAM);
+ break;
+ case PWL_ICONTYPE_PARAGRAPH:
+ GetGraphics_Paragraph(sPath, path, rect, PWLPT_STREAM);
+ break;
+ case PWL_ICONTYPE_RIGHTARROW:
+ GetGraphics_RightArrow(sPath, path, rect, PWLPT_STREAM);
+ break;
+ case PWL_ICONTYPE_RIGHTPOINTER:
+ GetGraphics_RightPointer(sPath, path, rect, PWLPT_STREAM);
+ break;
+ case PWL_ICONTYPE_STAR:
+ GetGraphics_Star(sPath, path, rect, PWLPT_STREAM);
+ break;
+ case PWL_ICONTYPE_UPARROW:
+ GetGraphics_UpArrow(sPath, path, rect, PWLPT_STREAM);
+ break;
+ case PWL_ICONTYPE_UPLEFTARROW:
+ GetGraphics_UpLeftArrow(sPath, path, rect, PWLPT_STREAM);
+ break;
+ case PWL_ICONTYPE_GRAPH:
+ GetGraphics_Graph(sPath, path, rect, PWLPT_STREAM);
+ break;
+ case PWL_ICONTYPE_PAPERCLIP:
+ GetGraphics_Paperclip(sPath, path, rect, PWLPT_STREAM);
+ break;
+ case PWL_ICONTYPE_ATTACHMENT:
+ GetGraphics_Attachment(sPath, path, rect, PWLPT_STREAM);
+ break;
+ case PWL_ICONTYPE_TAG:
+ GetGraphics_Tag(sPath, path, rect, PWLPT_STREAM);
+ break;
+ case PWL_ICONTYPE_FOXIT:
+ GetGraphics_Foxit(sPath, path, rect, PWLPT_STREAM);
+ break;
+ }
+
+ sAppStream += sPath;
+ if (crStroke.nColorType != COLORTYPE_TRANSPARENT)
+ sAppStream += "B*\n";
+ else
+ sAppStream += "f*\n";
+
+ return sAppStream;
+}
+
+void CPWL_Utils::DrawIconAppStream(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,
+ FX_INT32 nType, const CPDF_Rect & rect, const CPWL_Color& crFill, const CPWL_Color& crStroke, const FX_INT32 nTransparancy)
+{
+ CFX_GraphStateData gsd;
+ gsd.m_LineWidth = 1.0f;
+
+ CFX_ByteString sPath;
+ CFX_PathData path;
+
+ switch (nType)
+ {
+ case PWL_ICONTYPE_CHECKMARK:
+ GetGraphics_Checkmark(sPath, path, rect, PWLPT_PATHDATA);
+ break;
+ case PWL_ICONTYPE_CIRCLE:
+ GetGraphics_Circle(sPath, path, rect, PWLPT_PATHDATA);
+ break;
+ case PWL_ICONTYPE_COMMENT:
+ GetGraphics_Comment(sPath, path, rect, PWLPT_PATHDATA);
+ break;
+ case PWL_ICONTYPE_CROSS:
+ GetGraphics_Cross(sPath, path, rect, PWLPT_PATHDATA);
+ break;
+ case PWL_ICONTYPE_HELP:
+ GetGraphics_Help(sPath, path, rect, PWLPT_PATHDATA);
+ break;
+ case PWL_ICONTYPE_INSERTTEXT:
+ GetGraphics_InsertText(sPath, path, rect, PWLPT_PATHDATA);
+ break;
+ case PWL_ICONTYPE_KEY:
+ GetGraphics_Key(sPath, path, rect, PWLPT_PATHDATA);
+ break;
+ case PWL_ICONTYPE_NEWPARAGRAPH:
+ GetGraphics_NewParagraph(sPath, path, rect, PWLPT_PATHDATA);
+ break;
+ case PWL_ICONTYPE_TEXTNOTE:
+ GetGraphics_TextNote(sPath, path, rect, PWLPT_PATHDATA);
+ break;
+ case PWL_ICONTYPE_PARAGRAPH:
+ GetGraphics_Paragraph(sPath, path, rect, PWLPT_PATHDATA);
+ break;
+ case PWL_ICONTYPE_RIGHTARROW:
+ GetGraphics_RightArrow(sPath, path, rect, PWLPT_PATHDATA);
+ break;
+ case PWL_ICONTYPE_RIGHTPOINTER:
+ GetGraphics_RightPointer(sPath, path, rect, PWLPT_PATHDATA);
+ break;
+ case PWL_ICONTYPE_STAR:
+ GetGraphics_Star(sPath, path, rect, PWLPT_PATHDATA);
+ break;
+ case PWL_ICONTYPE_UPARROW:
+ GetGraphics_UpArrow(sPath, path, rect, PWLPT_PATHDATA);
+ break;
+ case PWL_ICONTYPE_UPLEFTARROW:
+ GetGraphics_UpLeftArrow(sPath, path, rect, PWLPT_PATHDATA);
+ break;
+ case PWL_ICONTYPE_GRAPH:
+ GetGraphics_Graph(sPath, path, rect, PWLPT_PATHDATA);
+ break;
+ case PWL_ICONTYPE_PAPERCLIP:
+ GetGraphics_Paperclip(sPath, path, rect, PWLPT_PATHDATA);
+ break;
+ case PWL_ICONTYPE_ATTACHMENT:
+ GetGraphics_Attachment(sPath, path, rect, PWLPT_PATHDATA);
+ break;
+ case PWL_ICONTYPE_TAG:
+ GetGraphics_Tag(sPath, path, rect, PWLPT_PATHDATA);
+ break;
+ case PWL_ICONTYPE_FOXIT:
+ GetGraphics_Foxit(sPath, path, rect, PWLPT_PATHDATA);
+ break;
+ default:
+ return;
+ }
+
+ pDevice->DrawPath(&path, pUser2Device, &gsd,
+ PWLColorToFXColor(crFill,nTransparancy), PWLColorToFXColor(crStroke,nTransparancy), FXFILL_ALTERNATE);
+}
+
+void CPWL_Utils::GetGraphics_Checkmark(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type)
+{
+ FX_FLOAT fWidth = crBBox.right - crBBox.left;
+ FX_FLOAT fHeight = crBBox.top - crBBox.bottom;
+
+ CPWL_PathData PathArray[] =
+ {
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 15.0f, crBBox.bottom + fHeight * 2 / 5.0f),PWLPT_MOVETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 15.0f + PWL_BEZIER*(fWidth / 7.0f - fWidth / 15.0f),
+ crBBox.bottom + fHeight * 2 / 5.0f + PWL_BEZIER*(fHeight * 2 / 7.0f - fHeight * 2 / 5.0f)), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 4.5f + PWL_BEZIER*(fWidth / 5.0f - fWidth / 4.5f),
+ crBBox.bottom + fHeight / 16.0f + PWL_BEZIER*(fHeight / 5.0f - fHeight / 16.0f)), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 4.5f, crBBox.bottom + fHeight / 16.0f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 4.5f + PWL_BEZIER*(fWidth / 4.4f - fWidth / 4.5f),
+ crBBox.bottom + fHeight / 16.0f - PWL_BEZIER*fHeight / 16.0f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 3.0f + PWL_BEZIER*(fWidth / 4.0f - fWidth / 3.0f),
+ crBBox.bottom), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 3.0f, crBBox.bottom), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 3.0f + PWL_BEZIER*fWidth*(1/7.0f + 2/15.0f),
+ crBBox.bottom + PWL_BEZIER*fHeight * 4 / 5.0f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 14 / 15.0f + PWL_BEZIER*fWidth*(1/7.0f - 7/15.0f),
+ crBBox.bottom + fHeight * 15/16.0f + PWL_BEZIER*(fHeight * 4/5.0f - fHeight * 15/16.0f)), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 14 / 15.0f,crBBox.bottom + fHeight * 15 / 16.0f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 14 / 15.0f + PWL_BEZIER*(fWidth * 7 / 15.0f - fWidth * 14 / 15.0f),
+ crBBox.bottom + fHeight * 15 / 16.0f + PWL_BEZIER*(fHeight * 8 / 7.0f - fHeight * 15 / 16.0f)), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 3.6f + PWL_BEZIER*(fWidth / 3.4f - fWidth / 3.6f),
+ crBBox.bottom + fHeight / 3.5f + PWL_BEZIER*(fHeight / 3.5f - fHeight / 3.5f)), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 3.6f,crBBox.bottom + fHeight / 3.5f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 3.6f,
+ crBBox.bottom + fHeight / 3.5f + PWL_BEZIER*(fHeight / 4.0f - fHeight / 3.5f)), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 15.0f + PWL_BEZIER*(fWidth / 3.5f - fWidth / 15.0f),
+ crBBox.bottom + fHeight * 2 / 5.0f + PWL_BEZIER*(fHeight * 3.5f / 5.0f - fHeight * 2 / 5.0f)), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 15.0f,crBBox.bottom + fHeight * 2 / 5.0f), PWLPT_BEZIERTO)
+ };
+
+ if(type == PWLPT_STREAM)
+ sPathData = GetAppStreamFromArray(PathArray, 16);
+ else
+ GetPathDataFromArray(path, PathArray, 16);
+}
+
+void CPWL_Utils::GetGraphics_Circle(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type)
+{
+ FX_FLOAT fWidth = crBBox.right - crBBox.left;
+ FX_FLOAT fHeight = crBBox.top - crBBox.bottom;
+
+ CPWL_PathData PathArray[] =
+ {
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/15.0f,crBBox.bottom + fHeight/2.0f), PWLPT_MOVETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/15.0f,
+ crBBox.bottom + fHeight/2.0f + PWL_BEZIER*(fHeight*14/15.0f - fHeight/2.0f)), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f - PWL_BEZIER*(fWidth/2.0f - fWidth/15.0f), crBBox.top - fHeight/15.0f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f,crBBox.top - fHeight/15.0f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f + PWL_BEZIER*(fWidth*14/15.0f - fWidth/2.0f), crBBox.top - fHeight/15.0f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth/15.0f, crBBox.bottom + fHeight/2.0f + PWL_BEZIER*(fHeight*14/15.0f - fHeight/2.0f)), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth/15.0f, crBBox.bottom + fHeight/2.0f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth/15.0f, crBBox.bottom + fHeight/2.0f - PWL_BEZIER*(fHeight/2.0f - fHeight/15.0f)), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f + PWL_BEZIER*(fWidth*14/15.0f - fWidth/2.0f), crBBox.bottom + fHeight/15.0f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f, crBBox.bottom + fHeight/15.0f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f - PWL_BEZIER*(fWidth/2.0f - fWidth/15.0f), crBBox.bottom + fHeight/15.0f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/15.0f, crBBox.bottom + fHeight/2.0f - PWL_BEZIER*(fHeight/2.0f - fHeight/15.0f)), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/15.0f,crBBox.bottom + fHeight/2.0f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*3/15.0f, crBBox.bottom + fHeight/2.0f), PWLPT_MOVETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*3/15.0f, crBBox.bottom + fHeight/2.0f + PWL_BEZIER*(fHeight*4/5.0f - fHeight/2.0f)), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f - PWL_BEZIER*(fWidth/2.0f - fWidth*3/15.0f), crBBox.top - fHeight*3/15.0f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f, crBBox.top - fHeight*3/15.0f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f + PWL_BEZIER*(fWidth*4/5.0f - fWidth/2.0f), crBBox.top - fHeight*3/15.0f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth*3/15.0f, crBBox.bottom + fHeight/2.0f + PWL_BEZIER*(fHeight*4/5.0f - fHeight/2.0f)), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth*3/15.0f, crBBox.bottom + fHeight/2.0f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth*3/15.0f, crBBox.bottom + fHeight/2.0f - PWL_BEZIER*(fHeight*4/5.0f - fHeight/2.0f)), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f + PWL_BEZIER*(fWidth*4/5.0f - fWidth/2.0f), crBBox.bottom + fHeight*3/15.0f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f, crBBox.bottom + fHeight*3/15.0f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f - PWL_BEZIER*(fWidth*4/5.0f - fWidth/2.0f), crBBox.bottom + fHeight*3/15.0f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*3/15.0f, crBBox.bottom + fHeight/2.0f - PWL_BEZIER*(fHeight*4/5.0f - fHeight/2.0f)), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*3/15.0f, crBBox.bottom + fHeight/2.0f), PWLPT_BEZIERTO)
+ };
+
+ if(type == PWLPT_STREAM)
+ sPathData = GetAppStreamFromArray(PathArray, 26);
+ else
+ GetPathDataFromArray(path, PathArray, 26);
+}
+
+void CPWL_Utils::GetGraphics_Comment(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type)
+{
+ FX_FLOAT fWidth = crBBox.right - crBBox.left;
+ FX_FLOAT fHeight = crBBox.top - crBBox.bottom;
+
+ CPWL_PathData PathArray[] =
+ {
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/15.0f, crBBox.top - fHeight/6.0f), PWLPT_MOVETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/15.0f, crBBox.top - fHeight/6.0f + PWL_BEZIER*(fHeight/6.0f - fHeight/10.0f)), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*2/15.0f - PWL_BEZIER*fWidth/15.0f, crBBox.top - fHeight/10.0f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*2/15.0f, crBBox.top - fHeight/10.0f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth*2/15.0f, crBBox.top - fHeight/10.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth*2/15.0f + PWL_BEZIER*fWidth/15.0f, crBBox.top - fHeight/10.0f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth/15.0f, crBBox.top - fHeight/6 + PWL_BEZIER*(fHeight/6.0f - fHeight/10.0f)), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth/15.0f, crBBox.top - fHeight/6.0f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth/15.0f, crBBox.bottom + fHeight/3.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth/15.0f, crBBox.bottom + fHeight*4/15.0f + PWL_BEZIER*fHeight/15.0f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth*2/15.0f + PWL_BEZIER*fWidth/15.0f, crBBox.bottom + fHeight*4/15.0f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth*2/15.0f, crBBox.bottom + fHeight*4/15.0f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*5/15.0f, crBBox.bottom + fHeight*4/15.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*5/15.0f, crBBox.bottom + fHeight*2/15 + PWL_BEZIER*fHeight*2/15.0f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*5/15.0f - PWL_BEZIER*fWidth*2/15.0f, crBBox.bottom + fHeight*2/15.0f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*6/30.0f, crBBox.bottom + fHeight*2/15.0f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*7/30.0f + PWL_BEZIER*fWidth/30.0f, crBBox.bottom + fHeight*2/15.0f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*7/30.0f, crBBox.bottom + fHeight*2/15.0f + PWL_BEZIER*fHeight*2/15.0f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*7/30.0f, crBBox.bottom + fHeight*4/15.0f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*2/15.0f, crBBox.bottom + fHeight*4/15.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*2/15.0f - PWL_BEZIER*fWidth/15.0f, crBBox.bottom + fHeight*4/15.0f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/15.0f, crBBox.bottom + fHeight/3.0f - PWL_BEZIER*fHeight/15.0f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/15.0f, crBBox.bottom + fHeight/3.0f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/15.0f, crBBox.top - fHeight/6.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*2/15.0f, crBBox.top - fHeight*8/30.0f), PWLPT_MOVETO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth*2/15.0f, crBBox.top - fHeight*8/30.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*2/15, crBBox.top - fHeight*25/60.0f), PWLPT_MOVETO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth*2/15.0f, crBBox.top - fHeight*25/60.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*2/15.0f, crBBox.top - fHeight*17/30.0f), PWLPT_MOVETO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth*4/15.0f, crBBox.top - fHeight*17/30.0f), PWLPT_LINETO)
+ };
+
+ if(type == PWLPT_STREAM)
+ sPathData = GetAppStreamFromArray(PathArray, 30);
+ else
+ GetPathDataFromArray(path, PathArray, 30);
+}
+
+void CPWL_Utils::GetGraphics_Cross(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type)
+{
+ FX_FLOAT fWidth = crBBox.right - crBBox.left;
+ FX_FLOAT fHeight = crBBox.top - crBBox.bottom;
+ //FX_FLOAT fcatercorner = (FX_FLOAT)sqrt(fWidth*fWidth + fHeight*fHeight);
+ CPWL_Point center_point(crBBox.left + fWidth/2, crBBox.bottom + fHeight/2);
+
+ CPWL_PathData PathArray[] =
+ {
+ CPWL_PathData(CPWL_Point(center_point.x, center_point.y + fHeight/10.0f), PWLPT_MOVETO),
+ CPWL_PathData(CPWL_Point(center_point.x + fWidth*0.3f, center_point.y + fHeight/10.0f + fWidth*0.3f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(center_point.x + fWidth/10.0f + fWidth*0.3f, center_point.y + fHeight*0.3f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(center_point.x + fWidth/10.0f, center_point.y), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(center_point.x + fWidth/10.0f + fWidth*0.3f, center_point.y - fHeight*0.3f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(center_point.x + fWidth*0.3f, center_point.y - fHeight/10.0f - fHeight*0.3f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(center_point.x, center_point.y - fHeight/10.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(center_point.x - fWidth*0.3f, center_point.y - fHeight/10 - fHeight*0.3f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(center_point.x - fWidth/10.0f - fWidth*0.3f, center_point.y - fHeight*0.3f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(center_point.x - fWidth/10, center_point.y), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(center_point.x - fWidth/10 - fWidth*0.3f, center_point.y + fHeight*0.3f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(center_point.x - fWidth*0.3f, center_point.y + fHeight/10.0f + fHeight*0.3f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(center_point.x, center_point.y + fHeight/10.0f), PWLPT_LINETO)
+ };
+
+ if(type == PWLPT_STREAM)
+ sPathData = GetAppStreamFromArray(PathArray, 13);
+ else
+ GetPathDataFromArray(path, PathArray, 13);
+}
+
+void CPWL_Utils::GetGraphics_Help(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type)
+{
+ FX_FLOAT fWidth = crBBox.right - crBBox.left;
+ FX_FLOAT fHeight = crBBox.top - crBBox.bottom;
+
+ CPWL_PathData PathArray[] =
+ {
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/60.0f, crBBox.bottom + fHeight/2.0f), PWLPT_MOVETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/60.0f, crBBox.bottom + fHeight/2.0f + PWL_BEZIER*(fHeight/60.0f - fHeight/2.0f)), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f - PWL_BEZIER*(fWidth/2.0f - fWidth/60.0f), crBBox.bottom + fHeight/60.0f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f, crBBox.bottom + fHeight/60.0f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f + PWL_BEZIER*fWidth*29/60.0f, crBBox.bottom + fHeight/60.0f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth/60.0f, crBBox.bottom + fHeight/2.0f + PWL_BEZIER*(fHeight/60.0f - fHeight/2.0f)), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth/60.0f, crBBox.bottom + fHeight/2.0f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth/60.0f, crBBox.bottom + fHeight/2.0f + PWL_BEZIER*fHeight*29/60.0f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f + PWL_BEZIER*fWidth*29/60.0f, crBBox.top - fHeight/60.0f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f, crBBox.top - fHeight/60.0f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f - PWL_BEZIER*fWidth*29/60.0f, crBBox.top - fHeight/60.0f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/60.0f, crBBox.bottom + fHeight/2.0f + PWL_BEZIER*fHeight*29/60.0f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/60.0f, crBBox.bottom + fHeight/2.0f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.27f, crBBox.top - fHeight*0.36f), PWLPT_MOVETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.27f, crBBox.top - fHeight*0.36f + PWL_BEZIER*fHeight*0.23f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.5f - PWL_BEZIER*fWidth*0.23f, crBBox.bottom + fHeight*0.87f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.5f, crBBox.bottom + fHeight*0.87f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.5f + PWL_BEZIER*fWidth*0.23f, crBBox.bottom + fHeight*0.87f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.27f, crBBox.top - fHeight*0.36f + PWL_BEZIER*fHeight*0.23f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.27f, crBBox.top - fHeight*0.36f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.27f - fWidth*0.08f*0.2f, crBBox.top - fHeight*0.36f - fHeight*0.15f*0.7f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.35f + fWidth*0.08f*0.2f, crBBox.top - fHeight*0.51f + fHeight*0.15f*0.2f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.35f, crBBox.top - fHeight*0.51f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.35f - fWidth*0.1f*0.5f, crBBox.top - fHeight*0.51f - fHeight*0.15f*0.3f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.45f - fWidth*0.1f*0.5f, crBBox.top - fHeight*0.68f + fHeight*0.15f*0.5f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.45f, crBBox.top - fHeight*0.68f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.45f, crBBox.bottom + fHeight*0.30f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.45f, crBBox.bottom + fHeight*0.30f - fWidth*0.1f*0.7f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.55f, crBBox.bottom + fHeight*0.30f - fWidth*0.1f*0.7f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.55f, crBBox.bottom + fHeight*0.30f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.55f, crBBox.top - fHeight*0.66f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.55f - fWidth*0.1f*0.05f, crBBox.top - fHeight*0.66f + fHeight*0.18f*0.5f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.45f - fWidth*0.1f*0.05f, crBBox.top - fHeight*0.48f - fHeight*0.18f*0.3f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.45f, crBBox.top - fHeight*0.48f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.45f + fWidth*0.08f*0.2f, crBBox.top - fHeight*0.48f + fHeight*0.18f*0.2f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.37f - fWidth*0.08f*0.2f, crBBox.top - fHeight*0.36f - fHeight*0.18f*0.7f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.37f, crBBox.top - fHeight*0.36f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.37f, crBBox.top - fHeight*0.36f + PWL_BEZIER*fHeight*0.13f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.5f + PWL_BEZIER*fWidth*0.13f, crBBox.bottom + fHeight*0.77f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.5f, crBBox.bottom + fHeight*0.77f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.5f - PWL_BEZIER*fWidth*0.13f, crBBox.bottom + fHeight*0.77f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.37f, crBBox.top - fHeight*0.36f + PWL_BEZIER*fHeight*0.13f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.37f, crBBox.top - fHeight*0.36f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.37f, crBBox.top - fHeight*0.36f - fWidth*0.1f*0.6f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.27f, crBBox.top - fHeight*0.36f - fWidth*0.1f*0.6f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.27f, crBBox.top - fHeight*0.36f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.56f, crBBox.bottom + fHeight*0.13f), PWLPT_MOVETO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.56f, crBBox.bottom + fHeight*0.13f + PWL_BEZIER*fHeight*0.055f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.505f - PWL_BEZIER*fWidth*0.095f, crBBox.bottom + fHeight*0.185f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.505f, crBBox.bottom + fHeight*0.185f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.505f + PWL_BEZIER*fWidth*0.065f, crBBox.bottom + fHeight*0.185f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.44f, crBBox.bottom + fHeight*0.13f + PWL_BEZIER*fHeight*0.055f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.44f, crBBox.bottom + fHeight*0.13f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.44f, crBBox.bottom + fHeight*0.13f - PWL_BEZIER*fHeight*0.055f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.505f + PWL_BEZIER*fWidth*0.065f, crBBox.bottom + fHeight*0.075f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.505f, crBBox.bottom + fHeight*0.075f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.505f - PWL_BEZIER*fWidth*0.065f, crBBox.bottom + fHeight*0.075f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.56f, crBBox.bottom + fHeight*0.13f - PWL_BEZIER*fHeight*0.055f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.56f, crBBox.bottom + fHeight*0.13f), PWLPT_BEZIERTO)
+ };
+
+ if(type == PWLPT_STREAM)
+ sPathData = GetAppStreamFromArray(PathArray, 59);
+ else
+ GetPathDataFromArray(path, PathArray, 59);
+}
+
+void CPWL_Utils::GetGraphics_InsertText(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type)
+{
+ FX_FLOAT fWidth = crBBox.right - crBBox.left;
+ FX_FLOAT fHeight = crBBox.top - crBBox.bottom;
+
+ CPWL_PathData PathArray[] =
+ {
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/10, crBBox.bottom + fHeight/10), PWLPT_MOVETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2, crBBox.top - fHeight*2/15), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth/10, crBBox.bottom + fHeight/10), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/10, crBBox.bottom + fHeight/10), PWLPT_LINETO)
+ };
+
+ if(type == PWLPT_STREAM)
+ sPathData = GetAppStreamFromArray(PathArray, 4);
+ else
+ GetPathDataFromArray(path, PathArray, 4);
+}
+
+void CPWL_Utils::GetGraphics_Key(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type)
+{
+ FX_FLOAT fWidth = crBBox.right - crBBox.left;
+ FX_FLOAT fHeight = crBBox.top - crBBox.bottom;
+ FX_FLOAT k = -fHeight/fWidth;
+ CPWL_Point tail;
+ CPWL_Point CicleCenter;
+ tail.x = crBBox.left + fWidth*0.9f;
+ tail.y = k*(tail.x - crBBox.right) + crBBox.bottom;
+ CicleCenter.x = crBBox.left + fWidth*0.15f;
+ CicleCenter.y = k*(CicleCenter.x - crBBox.right) + crBBox.bottom;
+
+ CPWL_PathData PathArray[] =
+ {
+ CPWL_PathData(CPWL_Point(tail.x + fWidth/30.0f, -fWidth/30.0f/k + tail.y), PWLPT_MOVETO),
+ CPWL_PathData(CPWL_Point(tail.x + fWidth/30.0f - fWidth*0.18f, -k*fWidth*0.18f - fWidth/30/k + tail.y), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(tail.x + fWidth/30 - fWidth*0.18f + fWidth*0.07f,
+ -fWidth*0.07f/k - k*fWidth*0.18f - fWidth/30/k + tail.y), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(tail.x + fWidth/30 - fWidth*0.18f - fWidth/20 + fWidth*0.07f,
+ -fWidth*0.07f/k - k*fWidth/20 - k*fWidth*0.18f - fWidth/30/k + tail.y), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(tail.x + fWidth/30 - fWidth*0.18f - fWidth/20,
+ -k*fWidth/20 - k*fWidth*0.18f - fWidth/30/k + tail.y), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(tail.x + fWidth/30 - fWidth*0.18f - fWidth/20 - fWidth/15,
+ -k*fWidth/15 - k*fWidth/20 - k*fWidth*0.18f - fWidth/30/k + tail.y), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(tail.x + fWidth/30 - fWidth*0.18f - fWidth/20 - fWidth/15 + fWidth*0.07f,
+ -fWidth*0.07f/k - k*fWidth/15 - k*fWidth/20 - k*fWidth*0.18f - fWidth/30/k + tail.y), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(tail.x + fWidth/30 - fWidth*0.18f - fWidth/20 - fWidth/15 - fWidth/20 + fWidth*0.07f,
+ -fWidth*0.07f/k + -k*fWidth/20 + -k*fWidth/15 - k*fWidth/20 - k*fWidth*0.18f - fWidth/30/k + tail.y), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(tail.x + fWidth/30 - fWidth*0.18f - fWidth/20 - fWidth/15 - fWidth/20,
+ -k*fWidth/20 + -k*fWidth/15 - k*fWidth/20 - k*fWidth*0.18f - fWidth/30/k + tail.y), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(tail.x + fWidth/30 - fWidth*0.45f, -k*fWidth*0.45f - fWidth/30/k + tail.y), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(tail.x + fWidth/30 - fWidth*0.45f + fWidth*0.2f,
+ -fWidth*0.4f/k - k*fWidth*0.45f - fWidth/30/k + tail.y), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(CicleCenter.x + fWidth*0.2f, - fWidth*0.1f/k + CicleCenter.y), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(CicleCenter.x, CicleCenter.y), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(CicleCenter.x - fWidth/60.0f, -k*fWidth/60 + CicleCenter.y), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(CicleCenter.x - fWidth/60, -k*fWidth/60 + CicleCenter.y), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(CicleCenter.x, CicleCenter.y), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(CicleCenter.x - fWidth*0.22f, fWidth*0.35f/k + CicleCenter.y - fHeight*0.05f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(tail.x - fWidth/30 - fWidth*0.45f - fWidth*0.18f, fWidth*0.05f/k - k*fWidth*0.45f + fWidth/30/k + tail.y - fHeight*0.05f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(tail.x - fWidth/30.0f - fWidth*0.45f, -k*fWidth*0.45f + fWidth/30.0f/k + tail.y), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(tail.x - fWidth/30.0f, fWidth/30.0f/k + tail.y), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(tail.x + fWidth/30, -fWidth/30/k + tail.y), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(CicleCenter.x + fWidth*0.08f, k*fWidth*0.08f + CicleCenter.y), PWLPT_MOVETO),
+ CPWL_PathData(CPWL_Point(CicleCenter.x + fWidth*0.08f + fWidth*0.1f, -fWidth*0.1f/k + k*fWidth*0.08f + CicleCenter.y), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(CicleCenter.x + fWidth*0.22f + fWidth*0.1f, k*fWidth*0.22f + CicleCenter.y - fWidth*0.1f/k), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(CicleCenter.x + fWidth*0.22f, k*fWidth*0.22f + CicleCenter.y), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(CicleCenter.x + fWidth*0.22f - fWidth*0.1f, fWidth*0.1f/k + k*fWidth*0.22f + CicleCenter.y), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(CicleCenter.x + fWidth*0.08f - fWidth*0.1f, fWidth*0.1f/k + k*fWidth*0.08f + CicleCenter.y), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(CicleCenter.x + fWidth*0.08f, k*fWidth*0.08f + CicleCenter.y), PWLPT_BEZIERTO)
+ };
+
+ if(type == PWLPT_STREAM)
+ sPathData = GetAppStreamFromArray(PathArray, 28);
+ else
+ GetPathDataFromArray(path, PathArray, 28);
+}
+
+void CPWL_Utils::GetGraphics_NewParagraph(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type)
+{
+ FX_FLOAT fWidth = crBBox.right - crBBox.left;
+ FX_FLOAT fHeight = crBBox.top - crBBox.bottom;
+
+ CPWL_PathData PathArray[] =
+ {
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f, crBBox.top - fHeight/20.0f), PWLPT_MOVETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/10.0f, crBBox.top - fHeight/2.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth/10.0f, crBBox.top - fHeight/2.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f, crBBox.top - fHeight/20.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.12f, crBBox.top - fHeight*17/30.0f), PWLPT_MOVETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.12f, crBBox.bottom + fHeight/10.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.22f, crBBox.bottom + fHeight/10.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.22f, crBBox.top - fHeight*17/30.0f - fWidth*0.14f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.38f, crBBox.bottom + fHeight/10.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.48f, crBBox.bottom + fHeight/10.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.48f, crBBox.top - fHeight*17/30.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.38f, crBBox.top - fHeight*17/30.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.38f, crBBox.bottom + fWidth*0.24f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.22f, crBBox.top - fHeight*17/30.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.12f, crBBox.top - fHeight*17/30.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.6f, crBBox.bottom + fHeight/10.0f), PWLPT_MOVETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.7f, crBBox.bottom + fHeight/10.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.7f, crBBox.bottom + fHeight/10.0f + fHeight/7.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.97f, crBBox.bottom + fHeight/10.0f + fHeight/7.0f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.97f, crBBox.top - fHeight*17/30.0f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.7f, crBBox.top - fHeight*17/30.0f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.6f, crBBox.top - fHeight*17/30.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.6f, crBBox.bottom + fHeight/10.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.7f, crBBox.bottom + fHeight/7 + fHeight*0.18f), PWLPT_MOVETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.85f, crBBox.bottom + fHeight/7 + fHeight*0.18f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.85f, crBBox.top - fHeight*17/30.0f - fHeight*0.08f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.7f, crBBox.top - fHeight*17/30.0f - fHeight*0.08f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.7f, crBBox.bottom + fHeight/7 + fHeight*0.18f), PWLPT_LINETO)
+ };
+
+ if(type == PWLPT_STREAM)
+ sPathData = GetAppStreamFromArray(PathArray, 28);
+ else
+ GetPathDataFromArray(path, PathArray, 28);
+}
+
+void CPWL_Utils::GetGraphics_TextNote(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type)
+{
+ FX_FLOAT fWidth = crBBox.right - crBBox.left;
+ FX_FLOAT fHeight = crBBox.top - crBBox.bottom;
+
+ CPWL_PathData PathArray[] =
+ {
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth*3/10.0f, crBBox.bottom + fHeight/15.0f), PWLPT_MOVETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*7/10.0f, crBBox.bottom + fHeight*4/15.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth/10.0f, crBBox.bottom + fHeight*4/15.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth/10.0f, crBBox.top - fHeight/15.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/10.0f, crBBox.top - fHeight/15.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/10.0f, crBBox.bottom + fHeight/15.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth*3/10.0f, crBBox.bottom + fHeight/15.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth/10.0f, crBBox.bottom + fHeight*4/15.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth*3/10.0f, crBBox.bottom + fHeight/15.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth*3/10.0f, crBBox.bottom + fHeight*4/15.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth/10.0f, crBBox.bottom + fHeight*4/15.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/5.0f, crBBox.top - fHeight*4/15.0f), PWLPT_MOVETO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth/5.0f, crBBox.top - fHeight*4/15.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/5.0f, crBBox.top - fHeight*7/15.0f), PWLPT_MOVETO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth/5.0f, crBBox.top - fHeight*7/15.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/5.0f, crBBox.top - fHeight*10/15.0f), PWLPT_MOVETO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth*3/10.0f, crBBox.top - fHeight*10/15.0f), PWLPT_LINETO)
+ };
+
+ if(type == PWLPT_STREAM)
+ sPathData = GetAppStreamFromArray(PathArray, 17);
+ else
+ GetPathDataFromArray(path, PathArray, 17);
+}
+
+void CPWL_Utils::GetGraphics_Paragraph(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type)
+{
+ FX_FLOAT fWidth = crBBox.right - crBBox.left;
+ FX_FLOAT fHeight = crBBox.top - crBBox.bottom;
+
+ CPWL_PathData PathArray[] =
+ {
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f, crBBox.top - fHeight/15.0f), PWLPT_MOVETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.7f, crBBox.top - fHeight/15.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.7f, crBBox.bottom + fHeight/15.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.634f, crBBox.bottom + fHeight/15.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.634f, crBBox.top - fHeight*2/15.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.566f, crBBox.top - fHeight*2/15.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.566f, crBBox.bottom + fHeight/15.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f, crBBox.bottom + fHeight/15.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f, crBBox.top - fHeight/15.0f - fHeight*0.4f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.2f, crBBox.top - fHeight/15.0f - fHeight*0.4f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.2f, crBBox.top - fHeight/15.0f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f, crBBox.top - fHeight/15.0f), PWLPT_BEZIERTO)
+ };
+
+ if(type == PWLPT_STREAM)
+ sPathData = GetAppStreamFromArray(PathArray, 12);
+ else
+ GetPathDataFromArray(path, PathArray, 12);
+}
+
+void CPWL_Utils::GetGraphics_RightArrow(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type)
+{
+ FX_FLOAT fWidth = crBBox.right - crBBox.left;
+ FX_FLOAT fHeight = crBBox.top - crBBox.bottom;
+
+ CPWL_PathData PathArray[] =
+ {
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth/15.0f, crBBox.top - fHeight/2.0f), PWLPT_MOVETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f + fWidth/8.0f, crBBox.bottom + fHeight/5.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f, crBBox.bottom + fHeight/5.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth/15.0f - fWidth*0.15f, crBBox.top - fHeight/2.0f - fWidth/25.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.1f, crBBox.top - fHeight/2.0f - fWidth/25.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.1f, crBBox.top - fHeight/2.0f + fWidth/25.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth/15.0f - fWidth*0.15f, crBBox.top - fHeight/2.0f + fWidth/25.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f, crBBox.top - fHeight/5.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f + fWidth/8.0f, crBBox.top - fHeight/5.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth/15.0f, crBBox.top - fHeight/2.0f), PWLPT_LINETO)
+ };
+
+ if(type == PWLPT_STREAM)
+ sPathData = GetAppStreamFromArray(PathArray, 10);
+ else
+ GetPathDataFromArray(path, PathArray, 10);
+}
+
+void CPWL_Utils::GetGraphics_RightPointer(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type)
+{
+ FX_FLOAT fWidth = crBBox.right - crBBox.left;
+ FX_FLOAT fHeight = crBBox.top - crBBox.bottom;
+
+ CPWL_PathData PathArray[] =
+ {
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth/30.0f, crBBox.top - fHeight/2.0f), PWLPT_MOVETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/30.0f, crBBox.bottom + fHeight/6.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*4/15.0f, crBBox.top - fHeight/2.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/30.0f, crBBox.top - fHeight/6.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth/30.0f, crBBox.top - fHeight/2.0f), PWLPT_LINETO)
+ };
+
+ if(type == PWLPT_STREAM)
+ sPathData = GetAppStreamFromArray(PathArray, 5);
+ else
+ GetPathDataFromArray(path, PathArray, 5);
+}
+
+void CPWL_Utils::GetGraphics_Star(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type)
+{
+ FX_FLOAT fLongRadius = (crBBox.top - crBBox.bottom)/(1+(FX_FLOAT)cos(PWL_PI/5.0f));
+ fLongRadius = fLongRadius * 0.7f;
+ FX_FLOAT fShortRadius = fLongRadius * 0.55f;
+ CPDF_Point ptCenter = CPDF_Point((crBBox.left + crBBox.right) / 2.0f,(crBBox.top + crBBox.bottom) / 2.0f);
+
+ FX_FLOAT px1[5], py1[5];
+ FX_FLOAT px2[5], py2[5];
+
+ FX_FLOAT fAngel = PWL_PI/10.0f;
+
+ for (FX_INT32 i=0; i<5; i++)
+ {
+ px1[i] = ptCenter.x + fLongRadius * (FX_FLOAT)cos(fAngel);
+ py1[i] = ptCenter.y + fLongRadius * (FX_FLOAT)sin(fAngel);
+
+ fAngel += PWL_PI * 2 / 5.0f;
+ }
+
+ fAngel = PWL_PI/5.0f + PWL_PI/10.0f;
+
+ for (FX_INT32 j=0; j<5; j++)
+ {
+ px2[j] = ptCenter.x + fShortRadius * (FX_FLOAT)cos(fAngel);
+ py2[j] = ptCenter.y + fShortRadius * (FX_FLOAT)sin(fAngel);
+
+ fAngel += PWL_PI * 2 / 5.0f;
+ }
+
+ CPWL_PathData PathArray[11];
+ PathArray[0] = CPWL_PathData(CPWL_Point(px1[0], py1[0]), PWLPT_MOVETO);
+ PathArray[1] = CPWL_PathData(CPWL_Point(px2[0], py2[0]), PWLPT_LINETO);
+
+ for(FX_INT32 k = 0; k < 4; k++)
+ {
+ PathArray[(k+1)*2] = CPWL_PathData(CPWL_Point(px1[k+1], py1[k+1]), PWLPT_LINETO);
+ PathArray[(k+1)*2 + 1] = CPWL_PathData(CPWL_Point(px2[k+1], py2[k+1]), PWLPT_LINETO);
+ }
+
+ PathArray[10] = CPWL_PathData(CPWL_Point(px1[0], py1[0]), PWLPT_LINETO);
+
+ if(type == PWLPT_STREAM)
+ sPathData = GetAppStreamFromArray(PathArray, 11);
+ else
+ GetPathDataFromArray(path, PathArray, 11);
+}
+
+void CPWL_Utils::GetGraphics_UpArrow(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type)
+{
+ FX_FLOAT fWidth = crBBox.right - crBBox.left;
+ FX_FLOAT fHeight = crBBox.top - crBBox.bottom;
+
+ CPWL_PathData PathArray[] =
+ {
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f, crBBox.top - fHeight/15.0f), PWLPT_MOVETO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth/10.0f, crBBox.top - fWidth*3/5.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.6f, crBBox.top - fWidth*3/5.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.6f, crBBox.bottom + fHeight/15.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.4f, crBBox.bottom + fHeight/15.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.4f, crBBox.top - fWidth*3/5.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/10, crBBox.top - fWidth*3/5.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f, crBBox.top - fHeight/15.0f), PWLPT_LINETO)
+ };
+
+ if(type == PWLPT_STREAM)
+ sPathData = GetAppStreamFromArray(PathArray, 8);
+ else
+ GetPathDataFromArray(path, PathArray, 8);
+}
+
+void CPWL_Utils::GetGraphics_UpLeftArrow(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type)
+{
+ FX_FLOAT fWidth = crBBox.right - crBBox.left;
+ FX_FLOAT fHeight = crBBox.top - crBBox.bottom;
+ CPWL_Point leftup(crBBox.left, crBBox.top);
+ CPWL_Point rightdown(crBBox.right, crBBox.bottom);
+ FX_FLOAT k = -fHeight/fWidth;
+ CPWL_Point tail;
+ tail.x = crBBox.left + fWidth*4/5.0f;
+ tail.y = k*(tail.x - crBBox.right) + rightdown.y;
+
+ CPWL_PathData PathArray[] =
+ {
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/20.0f, k*(crBBox.left + fWidth/20.0f - rightdown.x) + rightdown.y), PWLPT_MOVETO),
+ CPWL_PathData(CPWL_Point(fHeight*17/60.0f/k + tail.x + fWidth/10.0f + fWidth/5.0f,
+ -fWidth/5.0f/k + tail.y - fWidth/10.0f/k + fHeight*17/60.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(fHeight*17/60.0f/k + tail.x + fWidth/10.0f,
+ tail.y - fWidth/10.0f/k + fHeight*17/60.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(tail.x + fWidth/10.0f, tail.y - fWidth/10.0f/k), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(tail.x - fWidth/10.0f, tail.y + fWidth/10.0f/k), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(fHeight*17/60.0f/k + tail.x - fWidth/10.0f, tail.y + fWidth/10.0f/k + fHeight*17/60.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(fHeight*17/60.0f/k + tail.x - fWidth/10.0f - fWidth/5.0f,
+ fWidth/5.0f/k + tail.y + fWidth/10.0f/k + fHeight*17/60.0f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/20.0f, k*(crBBox.left + fWidth/20.0f - rightdown.x) + rightdown.y), PWLPT_LINETO)
+ };
+
+ if(type == PWLPT_STREAM)
+ sPathData = GetAppStreamFromArray(PathArray, 8);
+ else
+ GetPathDataFromArray(path, PathArray, 8);
+}
+
+void CPWL_Utils::GetGraphics_Graph(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type)
+{
+ FX_FLOAT fWidth = crBBox.right - crBBox.left;
+ FX_FLOAT fHeight = crBBox.top - crBBox.bottom;
+
+ CPWL_PathData PathArray[] =
+ {
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.05f, crBBox.top - fWidth*0.15f), PWLPT_MOVETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.25f, crBBox.top - fHeight*0.15f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.275f, crBBox.bottom + fHeight*0.08f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.05f, crBBox.bottom + fHeight*0.08f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.05f, crBBox.top - fWidth*0.15f), PWLPT_LINETO),
+
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.275f, crBBox.top - fWidth*0.45f), PWLPT_MOVETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.475f, crBBox.top - fWidth*0.45f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.475f, crBBox.bottom + fHeight*0.08f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.275f, crBBox.bottom + fHeight*0.08f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.275f, crBBox.top - fWidth*0.45f), PWLPT_LINETO),
+
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.5f, crBBox.top - fHeight*0.05f), PWLPT_MOVETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.7f, crBBox.top - fHeight*0.05f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.7f, crBBox.bottom + fHeight*0.08f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.5f, crBBox.bottom + fHeight*0.08f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.5f, crBBox.top - fHeight*0.05f), PWLPT_LINETO),
+
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.725f, crBBox.top - fWidth*0.35f), PWLPT_MOVETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.925f, crBBox.top - fWidth*0.35f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.925f, crBBox.bottom + fHeight*0.08f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.725f, crBBox.bottom + fHeight*0.08f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.725f, crBBox.top - fWidth*0.35f), PWLPT_LINETO)
+ };
+
+ if(type == PWLPT_STREAM)
+ sPathData = GetAppStreamFromArray(PathArray, 20);
+ else
+ GetPathDataFromArray(path, PathArray, 20);
+}
+
+void CPWL_Utils::GetGraphics_Paperclip(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type)
+{
+ FX_FLOAT fWidth = crBBox.right - crBBox.left;
+ FX_FLOAT fHeight = crBBox.top - crBBox.bottom;
+
+ CPWL_PathData PathArray[] =
+ {
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/60, crBBox.top - fHeight*0.25f), PWLPT_MOVETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/60, crBBox.bottom + fHeight*0.25f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/60, crBBox.bottom + fHeight*0.25f - fWidth*57/60.0f*0.35f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth/30, crBBox.bottom + fHeight*0.25f - fWidth*57/60.0f*0.35f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth/30, crBBox.bottom + fHeight*0.25f), PWLPT_BEZIERTO),
+
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth/30, crBBox.top - fHeight*0.33f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth/30, crBBox.top - fHeight*0.33f + fHeight/15*0.5f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth/30 - fWidth*0.12f, crBBox.top - fHeight*0.33f + fHeight/15*0.5f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth/30 - fWidth*0.12f, crBBox.top - fHeight*0.33f), PWLPT_BEZIERTO),
+
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth/30 - fWidth*0.12f, crBBox.bottom + fHeight*0.2f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth/30 - fWidth*0.12f, crBBox.bottom + fHeight*0.2f - (fWidth*57/60.0f - fWidth*0.24f)*0.25f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/60 + fWidth*0.12f, crBBox.bottom + fHeight*0.2f - (fWidth*57/60.0f - fWidth*0.24f)*0.25f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/60 + fWidth*0.12f, crBBox.bottom + fHeight*0.2f), PWLPT_BEZIERTO),
+
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/60 + fWidth*0.12f, crBBox.top - fHeight*0.2f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/60 + fWidth*0.12f, crBBox.top - fHeight*0.2f + (fWidth*11/12.0f - fWidth*0.36f)*0.25f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth/15 - fWidth*0.24f, crBBox.top - fHeight*0.2f + (fWidth*11/12.0f - fWidth*0.36f)*0.25f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth/15 - fWidth*0.24f, crBBox.top - fHeight*0.2f), PWLPT_BEZIERTO),
+
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth/15 - fWidth*0.24f, crBBox.bottom + fHeight*0.25f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth/15 - fWidth*0.24f, crBBox.bottom + fHeight*0.25f - (fWidth*14/15.0f - fWidth*0.53f)*0.25f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.29f, crBBox.bottom + fHeight*0.25f - (fWidth*14/15.0f - fWidth*0.53f)*0.25f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.29f, crBBox.bottom + fHeight*0.25f), PWLPT_BEZIERTO),
+
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.29f, crBBox.top - fHeight*0.33f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.29f, crBBox.top - fHeight*0.33f + fWidth*0.12f*0.35f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.17f, crBBox.top - fHeight*0.33f + fWidth*0.12f*0.35f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.17f, crBBox.top - fHeight*0.33f), PWLPT_BEZIERTO),
+
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.17f, crBBox.bottom + fHeight*0.3f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.17f, crBBox.bottom + fHeight*0.3f - fWidth*(14/15.0f - 0.29f)*0.35f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth/15 - fWidth*0.12f, crBBox.bottom + fHeight*0.3f - fWidth*(14/15.0f - 0.29f)*0.35f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth/15 - fWidth*0.12f, crBBox.bottom + fHeight*0.3f), PWLPT_BEZIERTO),
+
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth/15 - fWidth*0.12f, crBBox.top - fHeight*0.25f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth/15 - fWidth*0.12f, crBBox.top - fHeight*0.25f + fWidth*0.35f*(11/12.0f - 0.12f)), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/60, crBBox.top - fHeight*0.25f + fWidth*0.35f*(11/12.0f - 0.12f)), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth/60, crBBox.top - fHeight*0.25f), PWLPT_BEZIERTO)
+ };
+
+ if(type == PWLPT_STREAM)
+ sPathData = GetAppStreamFromArray(PathArray, 33);
+ else
+ GetPathDataFromArray(path, PathArray, 33);
+}
+
+void CPWL_Utils::GetGraphics_Attachment(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type)
+{
+ FX_FLOAT fWidth = crBBox.right - crBBox.left;
+ FX_FLOAT fHeight = crBBox.top - crBBox.bottom;
+
+ CPWL_PathData PathArray[] =
+ {
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.25f, crBBox.top - fHeight*0.1f), PWLPT_MOVETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.4f, crBBox.top - fHeight*0.23f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.4f, crBBox.top - fHeight*0.5f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.4f, crBBox.top - fHeight*0.5f + fWidth*0.04f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.6f, crBBox.top - fHeight*0.5f + fWidth*0.04f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.6f, crBBox.top - fHeight*0.5f), PWLPT_BEZIERTO),
+
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.6f, crBBox.top - fHeight*0.23f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.25f, crBBox.top - fHeight*0.1f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.25f, crBBox.top - fHeight*0.1f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.4f, crBBox.top - fHeight*0.23f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.6f, crBBox.top - fHeight*0.23f), PWLPT_LINETO),
+
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.4f, crBBox.top - fHeight*0.5f), PWLPT_MOVETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.4f - fWidth*0.25f*0.4f, crBBox.top - fHeight*0.5f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.15f, crBBox.top - fHeight*0.65f + fHeight*0.15f*0.4f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.15f, crBBox.top - fHeight*0.65f), PWLPT_BEZIERTO),
+
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.15f, crBBox.top - fHeight*0.65f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.15f, crBBox.top - fHeight*0.65f + fHeight*0.15f*0.4f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.6f + fWidth*0.25f*0.4f, crBBox.top - fHeight*0.5f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.6f, crBBox.top - fHeight*0.5f), PWLPT_BEZIERTO),
+
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.6f, crBBox.top - fHeight*0.5f + fWidth*0.04f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.4f, crBBox.top - fHeight*0.5f + fWidth*0.04f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.4f, crBBox.top - fHeight*0.5f), PWLPT_BEZIERTO),
+
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.5f, crBBox.top - fHeight*0.65f), PWLPT_MOVETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.5f, crBBox.bottom + fHeight*0.1f), PWLPT_LINETO)
+ };
+
+ if(type == PWLPT_STREAM)
+ sPathData = GetAppStreamFromArray(PathArray, 24);
+ else
+ GetPathDataFromArray(path, PathArray, 24);
+}
+
+void CPWL_Utils::GetGraphics_Tag(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type)
+{
+ FX_FLOAT fWidth = crBBox.right - crBBox.left;
+ FX_FLOAT fHeight = crBBox.top - crBBox.bottom;
+
+ CPWL_PathData PathArray[] =
+ {
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.4f, crBBox.top - fHeight*0.1f), PWLPT_MOVETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.1f, crBBox.top - fHeight*0.5f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.3f, crBBox.bottom + fHeight*0.1f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.1f, crBBox.bottom + fHeight*0.1f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.1f, crBBox.top - fHeight*0.1f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.4f, crBBox.top - fHeight*0.1f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.4f, crBBox.top - fHeight*0.3f), PWLPT_MOVETO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.2f, crBBox.top - fHeight*0.3f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.4f, crBBox.top - fHeight*0.5f), PWLPT_MOVETO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.2f, crBBox.top - fHeight*0.5f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.4f, crBBox.top - fHeight*0.7f), PWLPT_MOVETO),
+ CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.2f, crBBox.top - fHeight*0.7f), PWLPT_LINETO)
+ };
+
+ if(type == PWLPT_STREAM)
+ sPathData = GetAppStreamFromArray(PathArray, 12);
+ else
+ GetPathDataFromArray(path, PathArray, 12);
+}
+
+void CPWL_Utils::GetGraphics_Foxit(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type)
+{
+ FX_FLOAT fOutWidth = crBBox.right - crBBox.left;
+ FX_FLOAT fOutHeight = crBBox.top - crBBox.bottom;
+
+ CPDF_Rect crInBox = crBBox;
+ crInBox.left = crBBox.left + fOutWidth*0.08f;
+ crInBox.right = crBBox.right - fOutWidth*0.08f;
+ crInBox.top = crBBox.top - fOutHeight*0.08f;
+ crInBox.bottom = crBBox.bottom + fOutHeight*0.08f;
+
+ FX_FLOAT fWidth = crInBox.right - crInBox.left;
+ FX_FLOAT fHeight = crInBox.top - crInBox.bottom;
+
+ CPWL_PathData PathArray[] =
+ {
+ CPWL_PathData(CPWL_Point(crInBox.left, crInBox.top), PWLPT_MOVETO),
+ CPWL_PathData(CPWL_Point(crInBox.left + fWidth*0.45f, crInBox.top), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crInBox.left + fWidth*0.45f, crInBox.top - PWL_BEZIER * fHeight * 0.4f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crInBox.left + fWidth*0.45f - PWL_BEZIER * fWidth * 0.45f, crInBox.top - fHeight*0.4f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crInBox.left, crInBox.top - fHeight*0.4f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crInBox.left, crInBox.top), PWLPT_LINETO),
+
+ CPWL_PathData(CPWL_Point(crInBox.left + fWidth*0.60f, crInBox.top), PWLPT_MOVETO),
+ CPWL_PathData(CPWL_Point(crInBox.left + fWidth*0.75f, crInBox.top), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crInBox.left + fWidth*0.75f, crInBox.top - PWL_BEZIER * fHeight * 0.7f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crInBox.left + fWidth*0.75f - PWL_BEZIER * fWidth * 0.75f, crInBox.top - fHeight*0.7f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crInBox.left, crInBox.top - fHeight*0.7f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crInBox.left, crInBox.top - fHeight*0.55f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crInBox.left + PWL_BEZIER * fWidth*0.60f, crInBox.top - fHeight*0.55f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crInBox.left + fWidth * 0.60f, crInBox.top - PWL_BEZIER * fHeight * 0.55f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crInBox.left + fWidth * 0.60f, crInBox.top), PWLPT_BEZIERTO),
+
+ CPWL_PathData(CPWL_Point(crInBox.left + fWidth*0.90f, crInBox.top), PWLPT_MOVETO),
+ CPWL_PathData(CPWL_Point(crInBox.left + fWidth*0.90f, crInBox.top - PWL_BEZIER * fHeight * 0.85f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crInBox.left + fWidth*0.90f - PWL_BEZIER * fWidth * 0.90f, crInBox.top - fHeight*0.85f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crInBox.left, crInBox.top - fHeight*0.85f), PWLPT_BEZIERTO),
+ CPWL_PathData(CPWL_Point(crInBox.left, crInBox.bottom), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crInBox.right, crInBox.bottom), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crInBox.right, crInBox.top), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crInBox.left + fWidth*0.90f, crInBox.top), PWLPT_LINETO),
+
+ /*
+ CPWL_PathData(CPWL_Point(crBBox.left, crBBox.top), PWLPT_MOVETO),
+ CPWL_PathData(CPWL_Point(crBBox.right, crBBox.top), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.right, crBBox.bottom), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left, crBBox.bottom), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left, crBBox.top), PWLPT_LINETO),
+
+ CPWL_PathData(CPWL_Point(crBBox.left+fOutWidth*0.04f, crBBox.top-fOutHeight*0.04f), PWLPT_MOVETO),
+ CPWL_PathData(CPWL_Point(crBBox.right-fOutWidth*0.04f, crBBox.top-fOutHeight*0.04f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.right-fOutWidth*0.04f, crBBox.bottom+fOutHeight*0.04f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left+fOutWidth*0.04f, crBBox.bottom+fOutHeight*0.04f), PWLPT_LINETO),
+ CPWL_PathData(CPWL_Point(crBBox.left+fOutWidth*0.04f, crBBox.top-fOutHeight*0.04f), PWLPT_LINETO),
+ */
+ };
+
+ if(type == PWLPT_STREAM)
+ sPathData = GetAppStreamFromArray(PathArray, 23);
+ else
+ GetPathDataFromArray(path, PathArray, 23);
+}
+
+void CPWL_Color::ConvertColorType(FX_INT32 nColorType)
+{
+ switch (this->nColorType)
+ {
+ case COLORTYPE_TRANSPARENT:
+ break;
+ case COLORTYPE_GRAY:
+ switch (nColorType)
+ {
+ case COLORTYPE_RGB:
+ CPWL_Utils::ConvertGRAY2RGB(this->fColor1, this->fColor1, this->fColor2, this->fColor3);
+ break;
+ case COLORTYPE_CMYK:
+ CPWL_Utils::ConvertGRAY2CMYK(this->fColor1, this->fColor1, this->fColor2, this->fColor3, this->fColor4);
+ break;
+ }
+ break;
+ case COLORTYPE_RGB:
+ switch (nColorType)
+ {
+ case COLORTYPE_GRAY:
+ CPWL_Utils::ConvertRGB2GRAY(this->fColor1, this->fColor2, this->fColor3, this->fColor1);
+ break;
+ case COLORTYPE_CMYK:
+ CPWL_Utils::ConvertRGB2CMYK(this->fColor1, this->fColor2, this->fColor3, this->fColor1, this->fColor2, this->fColor3, this->fColor4);
+ break;
+ }
+ break;
+ case COLORTYPE_CMYK:
+ switch (nColorType)
+ {
+ case COLORTYPE_GRAY:
+ CPWL_Utils::ConvertCMYK2GRAY(this->fColor1, this->fColor2, this->fColor3, this->fColor4, this->fColor1);
+ break;
+ case COLORTYPE_RGB:
+ CPWL_Utils::ConvertCMYK2RGB(this->fColor1, this->fColor2, this->fColor3, this->fColor4, this->fColor1, this->fColor2, this->fColor3);
+ break;
+ }
+ break;
+ }
+ this->nColorType = nColorType;
+}
+
+
diff --git a/fpdfsdk/src/pdfwindow/PWL_Wnd.cpp b/fpdfsdk/src/pdfwindow/PWL_Wnd.cpp
index 035ffbbf4d..9bb784c8a6 100644
--- a/fpdfsdk/src/pdfwindow/PWL_Wnd.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_Wnd.cpp
@@ -1,1342 +1,1342 @@
-// 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
-
-#include "../../include/pdfwindow/PDFWindow.h"
-#include "../../include/pdfwindow/PWL_Wnd.h"
-#include "../../include/pdfwindow/PWL_Utils.h"
-#include "../../include/pdfwindow/PWL_ScrollBar.h"
-
-/* -------------------------- CPWL_Timer -------------------------- */
-
-static CFX_MapPtrTemplate<FX_INT32, CPWL_Timer*> g_TimeMap;
-
-CPWL_Timer::CPWL_Timer(CPWL_TimerHandler* pAttached, IFX_SystemHandler* pSystemHandler) :
- m_pAttached(pAttached),
- m_nTimerID(0),
- m_pSystemHandler(pSystemHandler)
-{
- ASSERT(m_pAttached != NULL);
- ASSERT(m_pSystemHandler != NULL);
-}
-
-CPWL_Timer::~CPWL_Timer()
-{
- KillPWLTimer();
-}
-
-FX_INT32 CPWL_Timer::SetPWLTimer(FX_INT32 nElapse)
-{
- if (m_nTimerID != 0) KillPWLTimer();
- m_nTimerID = m_pSystemHandler->SetTimer(nElapse, TimerProc);
- g_TimeMap.SetAt(m_nTimerID, this);
- return m_nTimerID;
-}
-
-void CPWL_Timer::KillPWLTimer()
-{
- if (m_nTimerID != 0)
- {
- m_pSystemHandler->KillTimer(m_nTimerID);
- g_TimeMap.RemoveKey(m_nTimerID);
- m_nTimerID = 0;
- }
-}
-
-void CPWL_Timer::TimerProc(FX_INT32 idEvent)
-{
- CPWL_Timer* pTimer = NULL;
- if (g_TimeMap.Lookup(idEvent, pTimer))
- {
- if (pTimer)
- {
- if (pTimer->m_pAttached)
- pTimer->m_pAttached->TimerProc();
- }
- }
-}
-
-/* -------------------------- CPWL_TimerHandler -------------------------- */
-
-CPWL_TimerHandler::CPWL_TimerHandler() : m_pTimer(NULL)
-{
-}
-
-CPWL_TimerHandler::~CPWL_TimerHandler()
-{
- if (m_pTimer) delete m_pTimer;
-}
-
-void CPWL_TimerHandler::BeginTimer(FX_INT32 nElapse)
-{
- if (!m_pTimer)
- m_pTimer = new CPWL_Timer(this, GetSystemHandler());
-
- if (m_pTimer)
- m_pTimer->SetPWLTimer(nElapse);
-}
-
-void CPWL_TimerHandler::EndTimer()
-{
- if (m_pTimer)
- m_pTimer->KillPWLTimer();
-}
-
-void CPWL_TimerHandler::TimerProc()
-{
-}
-
-/* --------------------------- CPWL_MsgControl ---------------------------- */
-
-class CPWL_MsgControl
-{
- friend class CPWL_Wnd;
-
-public:
- CPWL_MsgControl(CPWL_Wnd * pWnd)
- {
-// PWL_TRACE("new CPWL_MsgControl\n");
- m_pCreatedWnd = pWnd;
- Default();
- }
-
- ~CPWL_MsgControl()
- {
-// PWL_TRACE("~CPWL_MsgControl\n");
- Default();
- }
-
- void Default()
- {
- m_aMousePath.RemoveAll();
- m_aKeyboardPath.RemoveAll();
- m_pMainMouseWnd = NULL;
- m_pMainKeyboardWnd = NULL;
- }
-
- FX_BOOL IsWndCreated(const CPWL_Wnd * pWnd) const
- {
- return m_pCreatedWnd == pWnd;
- }
-
- FX_BOOL IsMainCaptureMouse(const CPWL_Wnd * pWnd) const
- {
- return pWnd == m_pMainMouseWnd;
- }
-
- FX_BOOL IsWndCaptureMouse(const CPWL_Wnd * pWnd) const
- {
- if (pWnd)
- for( FX_INT32 i=0,sz=m_aMousePath.GetSize(); i<sz; i++)
- if (m_aMousePath.GetAt(i) == pWnd)
- return TRUE;
-
- return FALSE;
- }
-
- FX_BOOL IsMainCaptureKeyboard(const CPWL_Wnd * pWnd) const
- {
- return pWnd == m_pMainKeyboardWnd;
- }
-
-
- FX_BOOL IsWndCaptureKeyboard(const CPWL_Wnd * pWnd) const
- {
- if (pWnd)
- for( FX_INT32 i=0,sz=m_aKeyboardPath.GetSize(); i<sz; i++)
- if (m_aKeyboardPath.GetAt(i) == pWnd)
- return TRUE;
-
- return FALSE;
- }
-
- void SetFocus(CPWL_Wnd * pWnd)
- {
- m_aKeyboardPath.RemoveAll();
-
- if (pWnd)
- {
- m_pMainKeyboardWnd = pWnd;
-
- CPWL_Wnd * pParent = pWnd;
- while (pParent)
- {
- m_aKeyboardPath.Add(pParent);
- pParent = pParent->GetParentWindow();
- }
-
- pWnd->OnSetFocus();
- }
- }
-
- void KillFocus()
- {
- if (m_aKeyboardPath.GetSize() > 0)
- if (CPWL_Wnd* pWnd = m_aKeyboardPath.GetAt(0))
- pWnd->OnKillFocus();
-
- m_pMainKeyboardWnd = NULL;
- m_aKeyboardPath.RemoveAll();
- }
-
- void SetCapture(CPWL_Wnd * pWnd)
- {
- m_aMousePath.RemoveAll();
-
- if (pWnd)
- {
- m_pMainMouseWnd = pWnd;
-
- CPWL_Wnd * pParent = pWnd;
- while (pParent)
- {
- m_aMousePath.Add(pParent);
- pParent = pParent->GetParentWindow();
- }
- }
- }
-
- void ReleaseCapture()
- {
- m_pMainMouseWnd = NULL;
- m_aMousePath.RemoveAll();
- }
-
-private:
- CFX_ArrayTemplate<CPWL_Wnd*> m_aMousePath;
- CFX_ArrayTemplate<CPWL_Wnd*> m_aKeyboardPath;
- CPWL_Wnd* m_pCreatedWnd;
- CPWL_Wnd* m_pMainMouseWnd;
- CPWL_Wnd* m_pMainKeyboardWnd;
-};
-
-/* --------------------------- CPWL_Wnd ---------------------------- */
-
-CPWL_Wnd::CPWL_Wnd() :
- m_pVScrollBar(NULL),
- m_rcWindow(),
- m_rcClip(),
- m_bCreated(FALSE),
- m_bVisible(FALSE),
- m_bNotifying(FALSE),
- m_bEnabled(TRUE)
-{
-}
-
-CPWL_Wnd::~CPWL_Wnd()
-{
- ASSERT(m_bCreated == FALSE);
-}
-
-CFX_ByteString CPWL_Wnd::GetClassName() const
-{
- return "CPWL_Wnd";
-}
-
-void CPWL_Wnd::Create(const PWL_CREATEPARAM & cp)
-{
- if (!IsValid())
- {
- m_sPrivateParam = cp;
-
- OnCreate(m_sPrivateParam);
-
- m_sPrivateParam.rcRectWnd.Normalize();
- m_rcWindow = m_sPrivateParam.rcRectWnd;
- m_rcClip = CPWL_Utils::InflateRect(m_rcWindow,1.0f);
-
- CreateMsgControl();
-
- if (m_sPrivateParam.pParentWnd)
- m_sPrivateParam.pParentWnd->OnNotify(this, PNM_ADDCHILD);
-
- PWL_CREATEPARAM ccp = m_sPrivateParam;
-
- ccp.dwFlags &= 0xFFFF0000L; //remove sub styles
- ccp.mtChild = CPDF_Matrix(1,0,0,1,0,0);
-
- CreateScrollBar(ccp);
- CreateChildWnd(ccp);
-
- m_bVisible = HasFlag(PWS_VISIBLE);
-
- OnCreated();
-
- RePosChildWnd();
- m_bCreated = TRUE;
- }
-}
-
-void CPWL_Wnd::OnCreate(PWL_CREATEPARAM & cp)
-{
-}
-
-void CPWL_Wnd::OnCreated()
-{
-}
-
-void CPWL_Wnd::OnDestroy()
-{
-}
-
-void CPWL_Wnd::Destroy()
-{
- KillFocus();
-
- OnDestroy();
-
- if (m_bCreated)
- {
- for (FX_INT32 i = m_aChildren.GetSize()-1; i >= 0; i --)
- {
- if (CPWL_Wnd * pChild = m_aChildren[i])
- {
- pChild->Destroy();
- delete pChild;
- pChild = NULL;
- }
- }
-
- if (m_sPrivateParam.pParentWnd)
- m_sPrivateParam.pParentWnd->OnNotify(this, PNM_REMOVECHILD);
- m_bCreated = FALSE;
- }
-
- DestroyMsgControl();
-
- FXSYS_memset(&m_sPrivateParam, 0, sizeof(PWL_CREATEPARAM));
- m_aChildren.RemoveAll();
- m_pVScrollBar = NULL;
-}
-
-void CPWL_Wnd::Move(const CPDF_Rect & rcNew, FX_BOOL bReset,FX_BOOL bRefresh)
-{
- if (IsValid())
- {
- CPDF_Rect rcOld = this->GetWindowRect();
-
- m_rcWindow = rcNew;
- m_rcWindow.Normalize();
- //m_rcClip = CPWL_Utils::InflateRect(m_rcWindow,1.0f); //for special caret
-
- if (rcOld.left != rcNew.left || rcOld.right != rcNew.right ||
- rcOld.top != rcNew.top || rcOld.bottom != rcNew.bottom)
- {
- if (bReset)
- {
- RePosChildWnd();
- }
-
- }
- if (bRefresh)
- {
- InvalidateRectMove(rcOld,rcNew);
- }
-
- m_sPrivateParam.rcRectWnd = m_rcWindow;
- }
-}
-
-void CPWL_Wnd::InvalidateRectMove(const CPDF_Rect & rcOld, const CPDF_Rect & rcNew)
-{
- CPDF_Rect rcUnion = rcOld;
- rcUnion.Union(rcNew);
-
- InvalidateRect(&rcUnion);
-
- /*
- CPDF_Rect SubArray[4];
-
- rcOld.Substract4(rcNew,SubArray);
- for (FX_INT32 i=0;i<4;i++)
- {
- if (SubArray[i].left == 0 &&
- SubArray[i].right == 0 &&
- SubArray[i].top == 0 &&
- SubArray[i].bottom == 0)continue;
-
- InvalidateRect(&CPWL_Utils::InflateRect(SubArray[i],2));
- }
-
- rcNew.Substract4(rcOld,SubArray);
- for (FX_INT32 j=0;j<4;j++)
- {
- if (SubArray[j].left == 0 &&
- SubArray[j].right == 0 &&
- SubArray[j].top == 0 &&
- SubArray[j].bottom == 0)continue;
-
- InvalidateRect(&CPWL_Utils::InflateRect(SubArray[j],2));
- }
- */
-}
-
-void CPWL_Wnd::GetAppearanceStream(CFX_ByteString & sAppStream)
-{
- if (IsValid())
- {
- CFX_ByteTextBuf sTextBuf;
- GetAppearanceStream(sTextBuf);
- sAppStream += sTextBuf.GetByteString();
- }
-}
-
-void CPWL_Wnd::GetAppearanceStream(CFX_ByteTextBuf & sAppStream)
-{
- if (IsValid() && IsVisible())
- {
- GetThisAppearanceStream(sAppStream);
- GetChildAppearanceStream(sAppStream);
- }
-}
-
-//if don't set,Get default apperance stream
-void CPWL_Wnd::GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream)
-{
- CPDF_Rect rectWnd = GetWindowRect();
- if (!rectWnd.IsEmpty())
- {
- CFX_ByteTextBuf sThis;
-
- if (HasFlag(PWS_BACKGROUND))
- sThis << CPWL_Utils::GetRectFillAppStream(rectWnd,this->GetBackgroundColor());
-
- if (HasFlag(PWS_BORDER))
- sThis << CPWL_Utils::GetBorderAppStream(rectWnd,
- (FX_FLOAT)GetBorderWidth(),
- GetBorderColor(),
- this->GetBorderLeftTopColor(this->GetBorderStyle()),
- this->GetBorderRightBottomColor(this->GetBorderStyle()),
- this->GetBorderStyle(),
- this->GetBorderDash());
-
- sAppStream << sThis;
- }
-}
-
-void CPWL_Wnd::GetChildAppearanceStream(CFX_ByteTextBuf & sAppStream)
-{
- for (FX_INT32 i=0,sz=m_aChildren.GetSize(); i<sz; i++)
- {
- if (CPWL_Wnd * pChild = m_aChildren.GetAt(i))
- {
- pChild->GetAppearanceStream(sAppStream);
- }
- }
-}
-
-void CPWL_Wnd::DrawAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device)
-{
- if (IsValid() && IsVisible())
- {
- DrawThisAppearance(pDevice,pUser2Device);
- DrawChildAppearance(pDevice,pUser2Device);
- }
-}
-
-void CPWL_Wnd::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device)
-{
- CPDF_Rect rectWnd = GetWindowRect();
- if (!rectWnd.IsEmpty())
- {
- if (HasFlag(PWS_BACKGROUND))
- {
- CPDF_Rect rcClient = CPWL_Utils::DeflateRect(rectWnd,(FX_FLOAT)(GetBorderWidth()+GetInnerBorderWidth()));
- CPWL_Utils::DrawFillRect(pDevice,pUser2Device,rcClient,this->GetBackgroundColor(),GetTransparency());
- }
-
- if (HasFlag(PWS_BORDER))
- CPWL_Utils::DrawBorder(pDevice,
- pUser2Device,
- rectWnd,
- (FX_FLOAT)GetBorderWidth(),
- GetBorderColor(),
- this->GetBorderLeftTopColor(this->GetBorderStyle()),
- this->GetBorderRightBottomColor(this->GetBorderStyle()),
- this->GetBorderStyle(),
- this->GetBorderDash(),
- GetTransparency());
- }
-}
-
-void CPWL_Wnd::DrawChildAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device)
-{
- for (FX_INT32 i=0,sz=m_aChildren.GetSize(); i<sz; i++)
- {
- if (CPWL_Wnd * pChild = m_aChildren.GetAt(i))
- {
- CPDF_Matrix mt = pChild->GetChildMatrix();
- if (mt.IsIdentity())
- {
- pChild->DrawAppearance(pDevice,pUser2Device);
- }
- else
- {
- mt.Concat(*pUser2Device);
- pChild->DrawAppearance(pDevice,&mt);
- }
- }
- }
-}
-
-void CPWL_Wnd::InvalidateRect(CPDF_Rect* pRect)
-{
- if (IsValid())
- {
- CPDF_Rect rcRefresh = pRect ? *pRect : GetWindowRect();
-
- if (!HasFlag(PWS_NOREFRESHCLIP))
- {
- CPDF_Rect rcClip = GetClipRect();
- if (!rcClip.IsEmpty())
- {
- rcRefresh.Intersect(rcClip);
- }
- }
-
- FX_RECT rcWin = PWLtoWnd(rcRefresh);
- rcWin.left -= PWL_INVALIDATE_INFLATE;
- rcWin.top -= PWL_INVALIDATE_INFLATE;
- rcWin.right += PWL_INVALIDATE_INFLATE;
- rcWin.bottom += PWL_INVALIDATE_INFLATE;
-
- if (IFX_SystemHandler* pSH = GetSystemHandler())
- {
- if (FX_HWND hWnd = GetAttachedHWnd())
- {
- pSH->InvalidateRect(hWnd, rcWin);
- }
- }
- }
-}
-
-#define PWL_IMPLEMENT_KEY_METHOD(key_method_name)\
-FX_BOOL CPWL_Wnd::key_method_name(FX_WORD nChar, FX_DWORD nFlag)\
-{\
- if (IsValid() && IsVisible() && IsEnabled())\
- {\
- if (IsWndCaptureKeyboard(this))\
- {\
- for (FX_INT32 i=0,sz=m_aChildren.GetSize(); i<sz; i++)\
- {\
- if (CPWL_Wnd * pChild = m_aChildren.GetAt(i))\
- {\
- if (IsWndCaptureKeyboard(pChild))\
- {\
- return pChild->key_method_name(nChar,nFlag);\
- }\
- }\
- }\
- }\
- }\
- return FALSE;\
-}
-
-#define PWL_IMPLEMENT_MOUSE_METHOD(mouse_method_name)\
-FX_BOOL CPWL_Wnd::mouse_method_name(const CPDF_Point & point, FX_DWORD nFlag)\
-{\
- if (IsValid() && IsVisible() && IsEnabled())\
- {\
- if (IsWndCaptureMouse(this))\
- {\
- for (FX_INT32 i=0,sz=m_aChildren.GetSize(); i<sz; i++)\
- {\
- if (CPWL_Wnd * pChild = m_aChildren.GetAt(i))\
- {\
- if (IsWndCaptureMouse(pChild))\
- {\
- return pChild->mouse_method_name(pChild->ParentToChild(point),nFlag);\
- }\
- }\
- }\
- SetCursor();\
- }\
- else\
- {\
- for (FX_INT32 i=0,sz=m_aChildren.GetSize(); i<sz; i++)\
- {\
- if (CPWL_Wnd * pChild = m_aChildren.GetAt(i))\
- {\
- if (pChild->WndHitTest(pChild->ParentToChild(point)))\
- {\
- return pChild->mouse_method_name(pChild->ParentToChild(point),nFlag);\
- }\
- }\
- }\
- if (this->WndHitTest(point))\
- SetCursor();\
- }\
- }\
- return FALSE;\
-}
-
-PWL_IMPLEMENT_KEY_METHOD(OnKeyDown)
-PWL_IMPLEMENT_KEY_METHOD(OnKeyUp)
-PWL_IMPLEMENT_KEY_METHOD(OnChar)
-
-PWL_IMPLEMENT_MOUSE_METHOD(OnLButtonDblClk)
-PWL_IMPLEMENT_MOUSE_METHOD(OnLButtonDown)
-PWL_IMPLEMENT_MOUSE_METHOD(OnLButtonUp)
-PWL_IMPLEMENT_MOUSE_METHOD(OnMButtonDblClk)
-PWL_IMPLEMENT_MOUSE_METHOD(OnMButtonDown)
-PWL_IMPLEMENT_MOUSE_METHOD(OnMButtonUp)
-PWL_IMPLEMENT_MOUSE_METHOD(OnRButtonDblClk)
-PWL_IMPLEMENT_MOUSE_METHOD(OnRButtonDown)
-PWL_IMPLEMENT_MOUSE_METHOD(OnRButtonUp)
-PWL_IMPLEMENT_MOUSE_METHOD(OnMouseMove)
-
-FX_BOOL CPWL_Wnd::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag)
-{
- if (IsValid() && IsVisible() && IsEnabled())
- {
- SetCursor();
- if (IsWndCaptureKeyboard(this))
- {
- for (FX_INT32 i=0,sz=m_aChildren.GetSize(); i<sz; i++)
- {
- if (CPWL_Wnd * pChild = m_aChildren.GetAt(i))
- {
- if (IsWndCaptureKeyboard(pChild))
- {
- return pChild->OnMouseWheel(zDelta,pChild->ParentToChild(point), nFlag);
- }
- }
- }
- }
- }
- return FALSE;
-}
-
-void CPWL_Wnd::AddChild(CPWL_Wnd * pWnd)
-{
- m_aChildren.Add(pWnd);
-}
-
-void CPWL_Wnd::RemoveChild(CPWL_Wnd * pWnd)
-{
- for (FX_INT32 i = m_aChildren.GetSize()-1; i >= 0; i --)
- {
- if (CPWL_Wnd* pChild = m_aChildren.GetAt(i))
- {
- if (pChild == pWnd)
- {
- m_aChildren.RemoveAt(i);
- break;
- }
- }
- }
-}
-
-void CPWL_Wnd::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam, FX_INTPTR lParam)
-{
- switch (msg)
- {
- case PNM_ADDCHILD:
- this->AddChild(pWnd);
- break;
- case PNM_REMOVECHILD:
- this->RemoveChild(pWnd);
- break;
- default:
- break;
- }
-}
-
-FX_BOOL CPWL_Wnd::IsValid() const
-{
- return m_bCreated;
-}
-
-PWL_CREATEPARAM CPWL_Wnd::GetCreationParam() const
-{
- return m_sPrivateParam;
-}
-
-CPWL_Wnd* CPWL_Wnd::GetParentWindow() const
-{
- return m_sPrivateParam.pParentWnd;
-}
-
-CPDF_Rect CPWL_Wnd::GetOriginWindowRect() const
-{
- return m_sPrivateParam.rcRectWnd;
-}
-
-CPDF_Rect CPWL_Wnd::GetWindowRect() const
-{
- return m_rcWindow;
-}
-
-CPDF_Rect CPWL_Wnd::GetClientRect() const
-{
- CPDF_Rect rcWindow = GetWindowRect();
- CPDF_Rect rcClient = CPWL_Utils::DeflateRect(rcWindow,(FX_FLOAT)(GetBorderWidth()+GetInnerBorderWidth()));
-
- if (CPWL_ScrollBar * pVSB = this->GetVScrollBar())
- rcClient.right -= pVSB->GetScrollBarWidth();
-
- rcClient.Normalize();
-
- if (rcWindow.Contains(rcClient))
- return rcClient;
- else
- return CPDF_Rect();
-}
-
-CPDF_Point CPWL_Wnd::GetCenterPoint() const
-{
- CPDF_Rect rcClient = GetClientRect();
-
- return CPDF_Point((rcClient.left + rcClient.right) * 0.5f,
- (rcClient.top + rcClient.bottom) * 0.5f);
-}
-
-CPDF_Rect CPWL_Wnd::GetClientCenterSquare() const
-{
- return CPWL_Utils::GetCenterSquare(GetClientRect());
-}
-
-CPDF_Rect CPWL_Wnd::GetWindowCenterSquare() const
-{
- return CPWL_Utils::GetCenterSquare(CPWL_Utils::DeflateRect(GetWindowRect(),0.1f));
-}
-
-FX_BOOL CPWL_Wnd::HasFlag(FX_DWORD dwFlags) const
-{
- return (m_sPrivateParam.dwFlags & dwFlags) != 0;
-}
-
-void CPWL_Wnd::RemoveFlag(FX_DWORD dwFlags)
-{
- m_sPrivateParam.dwFlags &= ~dwFlags;
-}
-
-void CPWL_Wnd::AddFlag(FX_DWORD dwFlags)
-{
- m_sPrivateParam.dwFlags |= dwFlags;
-}
-
-CPWL_Color CPWL_Wnd::GetBackgroundColor() const
-{
- return m_sPrivateParam.sBackgroundColor;
-}
-
-void CPWL_Wnd::SetBackgroundColor(const CPWL_Color & color)
-{
- m_sPrivateParam.sBackgroundColor = color;
-}
-
-void CPWL_Wnd::SetTextColor(const CPWL_Color & color)
-{
- m_sPrivateParam.sTextColor = color;
-}
-
-void CPWL_Wnd::SetTextStrokeColor(const CPWL_Color & color)
-{
- m_sPrivateParam.sTextStrokeColor = color;
-}
-
-CPWL_Color CPWL_Wnd::GetTextColor() const
-{
- return m_sPrivateParam.sTextColor;
-}
-
-CPWL_Color CPWL_Wnd::GetTextStrokeColor() const
-{
- return m_sPrivateParam.sTextStrokeColor;
-}
-
-FX_INT32 CPWL_Wnd::GetBorderStyle() const
-{
- return m_sPrivateParam.nBorderStyle;
-}
-
-void CPWL_Wnd::SetBorderStyle(FX_INT32 nBorderStyle)
-{
- if (HasFlag(PWS_BORDER))
- m_sPrivateParam.nBorderStyle = nBorderStyle;
-}
-
-FX_INT32 CPWL_Wnd::GetBorderWidth() const
-{
- if (HasFlag(PWS_BORDER))
- return m_sPrivateParam.dwBorderWidth;
-
- return 0;
-}
-
-FX_INT32 CPWL_Wnd::GetInnerBorderWidth() const
-{
- /*
- switch (GetBorderStyle())
- {
- case PBS_BEVELED:
- case PBS_INSET:
- return GetBorderWidth() / 2;
- }
- */
- return 0;
-}
-
-void CPWL_Wnd::SetBorderWidth(FX_INT32 nBorderWidth)
-{
- if (HasFlag(PWS_BORDER))
- m_sPrivateParam.dwBorderWidth = nBorderWidth;
-}
-
-CPWL_Color CPWL_Wnd::GetBorderColor() const
-{
- if (HasFlag(PWS_BORDER))
- return m_sPrivateParam.sBorderColor;
-
- return CPWL_Color();
-}
-
-void CPWL_Wnd::SetBorderColor(const CPWL_Color & color)
-{
- if (HasFlag(PWS_BORDER))
- m_sPrivateParam.sBorderColor = color;
-}
-
-CPWL_Dash CPWL_Wnd::GetBorderDash() const
-{
- return m_sPrivateParam.sDash;
-}
-
-void* CPWL_Wnd::GetAttachedData() const
-{
- return m_sPrivateParam.pAttachedData;
-}
-
-void CPWL_Wnd::SetBorderDash(const CPWL_Dash & sDash)
-{
- if (HasFlag(PWS_BORDER))
- m_sPrivateParam.sDash = sDash;
-}
-
-CPWL_ScrollBar* CPWL_Wnd::GetVScrollBar() const
-{
- if (HasFlag(PWS_VSCROLL))
- return m_pVScrollBar;
-
- return NULL;
-}
-
-void CPWL_Wnd::CreateScrollBar(const PWL_CREATEPARAM & cp)
-{
- CreateVScrollBar(cp);
-}
-
-void CPWL_Wnd::CreateVScrollBar(const PWL_CREATEPARAM & cp)
-{
- if (!m_pVScrollBar && HasFlag(PWS_VSCROLL))
- {
- PWL_CREATEPARAM scp = cp;
-
- //flags
- scp.dwFlags = PWS_CHILD| PWS_BACKGROUND | PWS_AUTOTRANSPARENT | PWS_NOREFRESHCLIP;
-
- scp.pParentWnd = this;
- scp.sBackgroundColor = PWL_DEFAULT_WHITECOLOR;
- scp.eCursorType = FXCT_ARROW;
- scp.nTransparency = PWL_SCROLLBAR_TRANSPARANCY;
-
- if ((m_pVScrollBar = new CPWL_ScrollBar(SBT_VSCROLL)))
- m_pVScrollBar->Create(scp);
- }
-}
-
-void CPWL_Wnd::SetCapture()
-{
- if (CPWL_MsgControl * pMsgCtrl = GetMsgControl())
- pMsgCtrl->SetCapture(this);
-}
-
-void CPWL_Wnd::ReleaseCapture()
-{
- for (FX_INT32 i=0,sz=m_aChildren.GetSize(); i<sz; i++)
- if (CPWL_Wnd* pChild = m_aChildren.GetAt(i))
- pChild->ReleaseCapture();
-
- if (CPWL_MsgControl * pMsgCtrl = GetMsgControl())
- pMsgCtrl->ReleaseCapture();
-}
-
-void CPWL_Wnd::SetFocus()
-{
- if (CPWL_MsgControl * pMsgCtrl = GetMsgControl())
- {
- if (!pMsgCtrl->IsMainCaptureKeyboard(this))
- pMsgCtrl->KillFocus();
- pMsgCtrl->SetFocus(this);
- }
-}
-
-void CPWL_Wnd::KillFocus()
-{
- if (CPWL_MsgControl * pMsgCtrl = GetMsgControl())
- {
- if (pMsgCtrl->IsWndCaptureKeyboard(this))
- pMsgCtrl->KillFocus();
- }
-}
-
-void CPWL_Wnd::OnSetFocus()
-{
-}
-
-void CPWL_Wnd::OnKillFocus()
-{
-}
-
-FX_BOOL CPWL_Wnd::WndHitTest(const CPDF_Point & point) const
-{
- return IsValid() && IsVisible() && GetWindowRect().Contains(point.x,point.y);
-}
-
-FX_BOOL CPWL_Wnd::ClientHitTest(const CPDF_Point & point) const
-{
- return IsValid() && IsVisible() && GetClientRect().Contains(point.x,point.y);
-}
-
-const CPWL_Wnd * CPWL_Wnd::GetRootWnd() const
-{
- if (m_sPrivateParam.pParentWnd)
- return m_sPrivateParam.pParentWnd->GetRootWnd();
- else
- return this;
-}
-
-void CPWL_Wnd::SetVisible(FX_BOOL bVisible)
-{
- if (IsValid())
- {
- for (FX_INT32 i=0,sz=m_aChildren.GetSize(); i<sz; i++)
- {
- if (CPWL_Wnd* pChild = m_aChildren.GetAt(i))
- {
- pChild->SetVisible(bVisible);
- }
- }
-
- if (bVisible != m_bVisible)
- {
- m_bVisible = bVisible;
- RePosChildWnd();
- InvalidateRect();
- }
- }
-}
-
-void CPWL_Wnd::SetClipRect(const CPDF_Rect & rect)
-{
- m_rcClip = rect;
- m_rcClip.Normalize();
-}
-
-CPDF_Rect CPWL_Wnd::GetClipRect() const
-{
- return m_rcClip;
-}
-
-FX_BOOL CPWL_Wnd::IsReadOnly() const
-{
- return HasFlag(PWS_READONLY);
-}
-
-void CPWL_Wnd::RePosChildWnd()
-{
- CPDF_Rect rcContent = CPWL_Utils::DeflateRect(GetWindowRect(),(FX_FLOAT)(GetBorderWidth()+GetInnerBorderWidth()));
-
- CPWL_ScrollBar * pVSB = this->GetVScrollBar();
-
- CPDF_Rect rcVScroll = CPDF_Rect(rcContent.right - PWL_SCROLLBAR_WIDTH,
- rcContent.bottom,
- rcContent.right-1.0f,
- rcContent.top);
-
- if (pVSB) pVSB->Move(rcVScroll,TRUE,FALSE);
-}
-
-void CPWL_Wnd::CreateChildWnd(const PWL_CREATEPARAM & cp)
-{
-}
-
-void CPWL_Wnd::SetCursor()
-{
- if (IsValid())
- {
- if (IFX_SystemHandler* pSH = GetSystemHandler())
- {
- FX_INT32 nCursorType = this->GetCreationParam().eCursorType;
- pSH->SetCursor(nCursorType);
- }
- }
-}
-
-void CPWL_Wnd::CreateMsgControl()
-{
- if (!m_sPrivateParam.pMsgControl)
- m_sPrivateParam.pMsgControl = new CPWL_MsgControl(this);
-}
-
-void CPWL_Wnd::DestroyMsgControl()
-{
- if (CPWL_MsgControl* pMsgControl = GetMsgControl())
- if (pMsgControl->IsWndCreated(this))
- delete pMsgControl;
-}
-
-CPWL_MsgControl* CPWL_Wnd::GetMsgControl() const
-{
- return m_sPrivateParam.pMsgControl;
-}
-
-FX_BOOL CPWL_Wnd::IsCaptureMouse() const
-{
- return IsWndCaptureMouse(this);
-}
-
-FX_BOOL CPWL_Wnd::IsWndCaptureMouse(const CPWL_Wnd * pWnd) const
-{
- if (CPWL_MsgControl * pCtrl = GetMsgControl())
- return pCtrl->IsWndCaptureMouse(pWnd);
-
- return FALSE;
-}
-
-FX_BOOL CPWL_Wnd::IsWndCaptureKeyboard(const CPWL_Wnd * pWnd) const
-{
- if (CPWL_MsgControl * pCtrl = GetMsgControl())
- return pCtrl->IsWndCaptureKeyboard(pWnd);
-
- return FALSE;
-}
-
-FX_BOOL CPWL_Wnd::IsFocused() const
-{
- if (CPWL_MsgControl * pCtrl = GetMsgControl())
- return pCtrl->IsMainCaptureKeyboard(this);
-
- return FALSE;
-}
-
-CPDF_Rect CPWL_Wnd::GetFocusRect() const
-{
- return CPWL_Utils::InflateRect(this->GetWindowRect(),1);
-}
-
-FX_FLOAT CPWL_Wnd::GetFontSize() const
-{
- return this->m_sPrivateParam.fFontSize;
-}
-
-void CPWL_Wnd::SetFontSize(FX_FLOAT fFontSize)
-{
- this->m_sPrivateParam.fFontSize = fFontSize;
-}
-
-IFX_SystemHandler* CPWL_Wnd::GetSystemHandler() const
-{
- return m_sPrivateParam.pSystemHandler;
-}
-
-IPWL_FocusHandler* CPWL_Wnd::GetFocusHandler() const
-{
- return m_sPrivateParam.pFocusHandler;
-}
-
-IPWL_Provider* CPWL_Wnd::GetProvider() const
-{
- return m_sPrivateParam.pProvider;
-}
-
-IFX_Edit_FontMap* CPWL_Wnd::GetFontMap() const
-{
- return m_sPrivateParam.pFontMap;
-}
-
-CPWL_Color CPWL_Wnd::GetBorderLeftTopColor(FX_INT32 nBorderStyle) const
-{
- CPWL_Color color;
-
- switch (nBorderStyle)
- {
- case PBS_SOLID:
- break;
- case PBS_DASH:
- break;
- case PBS_BEVELED:
- color = CPWL_Color(COLORTYPE_GRAY,1);
- break;
- case PBS_INSET:
- color = CPWL_Color(COLORTYPE_GRAY,0.5f);
- break;
- case PBS_UNDERLINED:
- break;
- }
-
- return color;
-}
-
-CPWL_Color CPWL_Wnd::GetBorderRightBottomColor(FX_INT32 nBorderStyle) const
-{
- CPWL_Color color;
-
- switch (nBorderStyle)
- {
- case PBS_SOLID:
- break;
- case PBS_DASH:
- break;
- case PBS_BEVELED:
- color = CPWL_Utils::DevideColor(GetBackgroundColor(),2);
- break;
- case PBS_INSET:
- color = CPWL_Color(COLORTYPE_GRAY,0.75f);
- break;
- case PBS_UNDERLINED:
- break;
- }
-
- return color;
-}
-
-/* ----------------------------------------------------------------- */
-
-FX_INT32 CPWL_Wnd::GetTransparency()
-{
- return m_sPrivateParam.nTransparency;
-}
-
-void CPWL_Wnd::SetTransparency(FX_INT32 nTransparency)
-{
- for (FX_INT32 i=0,sz=m_aChildren.GetSize(); i<sz; i++)
- {
- if (CPWL_Wnd* pChild = m_aChildren.GetAt(i))
- {
- pChild->SetTransparency(nTransparency);
- }
- }
-
- m_sPrivateParam.nTransparency = nTransparency;
-}
-
-CPDF_Matrix CPWL_Wnd::GetWindowMatrix() const
-{
- CPDF_Matrix mt = this->GetChildToRoot();
-
- if (IPWL_Provider* pProvider = GetProvider())
- {
- mt.Concat(pProvider->GetWindowMatrix(GetAttachedData()));
- return mt;
- }
-
-/*
- if (CReader_App* pApp = CPWL_Module::GetReaderApp())
- if (CReader_Document* pDocument = pApp->GetCurrentDocument())
- if (CReader_DocView* pDocView = pDocument->GetCurrentDocView())
- {
- CPDF_Matrix mtPageView;
- pDocView->GetCurrentMatrix(mtPageView);
- mt.Concat(mtPageView);
- return mt;
- }
-
-*/
-
- return mt;
-}
-
-void CPWL_Wnd::PWLtoWnd(const CPDF_Point& point, FX_INT32& x, FX_INT32& y) const
-{
- CPDF_Matrix mt = GetWindowMatrix();
- CPDF_Point pt = point;
- mt.Transform(pt.x,pt.y);
- x = (FX_INT32)(pt.x+0.5);
- y = (FX_INT32)(pt.y+0.5);
-}
-
-FX_RECT CPWL_Wnd::PWLtoWnd(const CPDF_Rect & rect) const
-{
- CPDF_Rect rcTemp = rect;
- CPDF_Matrix mt = GetWindowMatrix();
- mt.TransformRect(rcTemp);
- return FX_RECT((FX_INT32)(rcTemp.left+0.5), (FX_INT32)(rcTemp.bottom+0.5), (FX_INT32)(rcTemp.right+0.5), (FX_INT32)(rcTemp.top+0.5));
-}
-
-FX_HWND CPWL_Wnd::GetAttachedHWnd() const
-{
- return m_sPrivateParam.hAttachedWnd;
-}
-
-CPDF_Point CPWL_Wnd::ChildToParent(const CPDF_Point& point) const
-{
- CPDF_Matrix mt = GetChildMatrix();
- if (mt.IsIdentity())
- return point;
- else
- {
- CPDF_Point pt = point;
- mt.Transform(pt.x,pt.y);
- return pt;
- }
-}
-
-CPDF_Rect CPWL_Wnd::ChildToParent(const CPDF_Rect& rect) const
-{
- CPDF_Matrix mt = GetChildMatrix();
- if (mt.IsIdentity())
- return rect;
- else
- {
- CPDF_Rect rc = rect;
- mt.TransformRect(rc);
- return rc;
- }
-}
-
-CPDF_Point CPWL_Wnd::ParentToChild(const CPDF_Point& point) const
-{
- CPDF_Matrix mt = GetChildMatrix();
- if (mt.IsIdentity())
- return point;
- else
- {
- mt.SetReverse(mt);
- CPDF_Point pt = point;
- mt.Transform(pt.x,pt.y);
- return pt;
- }
-}
-
-CPDF_Rect CPWL_Wnd::ParentToChild(const CPDF_Rect& rect) const
-{
- CPDF_Matrix mt = GetChildMatrix();
- if (mt.IsIdentity())
- return rect;
- else
- {
- mt.SetReverse(mt);
- CPDF_Rect rc = rect;
- mt.TransformRect(rc);
- return rc;
- }
-}
-
-CPDF_Matrix CPWL_Wnd::GetChildToRoot() const
-{
- CPDF_Matrix mt(1,0,0,1,0,0);
-
- if (HasFlag(PWS_CHILD))
- {
- const CPWL_Wnd* pParent = this;
- while (pParent)
- {
- mt.Concat(pParent->GetChildMatrix());
- pParent = pParent->GetParentWindow();
- }
- }
-
- return mt;
-}
-
-CPDF_Matrix CPWL_Wnd::GetChildMatrix() const
-{
- if (HasFlag(PWS_CHILD))
- return m_sPrivateParam.mtChild;
-
- return CPDF_Matrix(1,0,0,1,0,0);
-}
-
-void CPWL_Wnd::SetChildMatrix(const CPDF_Matrix& mt)
-{
- m_sPrivateParam.mtChild = mt;
-}
-
-const CPWL_Wnd* CPWL_Wnd::GetFocused() const
-{
- if (CPWL_MsgControl * pMsgCtrl = GetMsgControl())
- {
- return pMsgCtrl->m_pMainKeyboardWnd;
- }
-
- return NULL;
-}
-
-void CPWL_Wnd::EnableWindow(FX_BOOL bEnable)
-{
- if (m_bEnabled != bEnable)
- {
- for (FX_INT32 i=0,sz=m_aChildren.GetSize(); i<sz; i++)
- {
- if (CPWL_Wnd* pChild = m_aChildren.GetAt(i))
- {
- pChild->EnableWindow(bEnable);
- }
- }
-
- this->m_bEnabled = bEnable;
-
- if (bEnable)
- this->OnEnabled();
- else
- this->OnDisabled();
- }
-}
-
-FX_BOOL CPWL_Wnd::IsEnabled()
-{
- return m_bEnabled;
-}
-
-void CPWL_Wnd::OnEnabled()
-{
-}
-
-void CPWL_Wnd::OnDisabled()
-{
-}
-
-FX_BOOL CPWL_Wnd::IsCTRLpressed(FX_DWORD nFlag) const
-{
- if (IFX_SystemHandler* pSystemHandler = GetSystemHandler())
- {
- return pSystemHandler->IsCTRLKeyDown(nFlag);
- }
-
- return FALSE;
-}
-
-FX_BOOL CPWL_Wnd::IsSHIFTpressed(FX_DWORD nFlag) const
-{
- if (IFX_SystemHandler* pSystemHandler = GetSystemHandler())
- {
- return pSystemHandler->IsSHIFTKeyDown(nFlag);
- }
-
- return FALSE;
-}
-
-FX_BOOL CPWL_Wnd::IsALTpressed(FX_DWORD nFlag) const
-{
- if (IFX_SystemHandler* pSystemHandler = GetSystemHandler())
- {
- return pSystemHandler->IsALTKeyDown(nFlag);
- }
-
- return FALSE;
-}
-
-FX_BOOL CPWL_Wnd::IsINSERTpressed(FX_DWORD nFlag) const
-{
- if (IFX_SystemHandler* pSystemHandler = GetSystemHandler())
- {
- return pSystemHandler->IsINSERTKeyDown(nFlag);
- }
-
- return FALSE;
-}
-
+// 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
+
+#include "../../include/pdfwindow/PDFWindow.h"
+#include "../../include/pdfwindow/PWL_Wnd.h"
+#include "../../include/pdfwindow/PWL_Utils.h"
+#include "../../include/pdfwindow/PWL_ScrollBar.h"
+
+/* -------------------------- CPWL_Timer -------------------------- */
+
+static CFX_MapPtrTemplate<FX_INT32, CPWL_Timer*> g_TimeMap;
+
+CPWL_Timer::CPWL_Timer(CPWL_TimerHandler* pAttached, IFX_SystemHandler* pSystemHandler) :
+ m_pAttached(pAttached),
+ m_nTimerID(0),
+ m_pSystemHandler(pSystemHandler)
+{
+ ASSERT(m_pAttached != NULL);
+ ASSERT(m_pSystemHandler != NULL);
+}
+
+CPWL_Timer::~CPWL_Timer()
+{
+ KillPWLTimer();
+}
+
+FX_INT32 CPWL_Timer::SetPWLTimer(FX_INT32 nElapse)
+{
+ if (m_nTimerID != 0) KillPWLTimer();
+ m_nTimerID = m_pSystemHandler->SetTimer(nElapse, TimerProc);
+ g_TimeMap.SetAt(m_nTimerID, this);
+ return m_nTimerID;
+}
+
+void CPWL_Timer::KillPWLTimer()
+{
+ if (m_nTimerID != 0)
+ {
+ m_pSystemHandler->KillTimer(m_nTimerID);
+ g_TimeMap.RemoveKey(m_nTimerID);
+ m_nTimerID = 0;
+ }
+}
+
+void CPWL_Timer::TimerProc(FX_INT32 idEvent)
+{
+ CPWL_Timer* pTimer = NULL;
+ if (g_TimeMap.Lookup(idEvent, pTimer))
+ {
+ if (pTimer)
+ {
+ if (pTimer->m_pAttached)
+ pTimer->m_pAttached->TimerProc();
+ }
+ }
+}
+
+/* -------------------------- CPWL_TimerHandler -------------------------- */
+
+CPWL_TimerHandler::CPWL_TimerHandler() : m_pTimer(NULL)
+{
+}
+
+CPWL_TimerHandler::~CPWL_TimerHandler()
+{
+ if (m_pTimer) delete m_pTimer;
+}
+
+void CPWL_TimerHandler::BeginTimer(FX_INT32 nElapse)
+{
+ if (!m_pTimer)
+ m_pTimer = new CPWL_Timer(this, GetSystemHandler());
+
+ if (m_pTimer)
+ m_pTimer->SetPWLTimer(nElapse);
+}
+
+void CPWL_TimerHandler::EndTimer()
+{
+ if (m_pTimer)
+ m_pTimer->KillPWLTimer();
+}
+
+void CPWL_TimerHandler::TimerProc()
+{
+}
+
+/* --------------------------- CPWL_MsgControl ---------------------------- */
+
+class CPWL_MsgControl
+{
+ friend class CPWL_Wnd;
+
+public:
+ CPWL_MsgControl(CPWL_Wnd * pWnd)
+ {
+// PWL_TRACE("new CPWL_MsgControl\n");
+ m_pCreatedWnd = pWnd;
+ Default();
+ }
+
+ ~CPWL_MsgControl()
+ {
+// PWL_TRACE("~CPWL_MsgControl\n");
+ Default();
+ }
+
+ void Default()
+ {
+ m_aMousePath.RemoveAll();
+ m_aKeyboardPath.RemoveAll();
+ m_pMainMouseWnd = NULL;
+ m_pMainKeyboardWnd = NULL;
+ }
+
+ FX_BOOL IsWndCreated(const CPWL_Wnd * pWnd) const
+ {
+ return m_pCreatedWnd == pWnd;
+ }
+
+ FX_BOOL IsMainCaptureMouse(const CPWL_Wnd * pWnd) const
+ {
+ return pWnd == m_pMainMouseWnd;
+ }
+
+ FX_BOOL IsWndCaptureMouse(const CPWL_Wnd * pWnd) const
+ {
+ if (pWnd)
+ for( FX_INT32 i=0,sz=m_aMousePath.GetSize(); i<sz; i++)
+ if (m_aMousePath.GetAt(i) == pWnd)
+ return TRUE;
+
+ return FALSE;
+ }
+
+ FX_BOOL IsMainCaptureKeyboard(const CPWL_Wnd * pWnd) const
+ {
+ return pWnd == m_pMainKeyboardWnd;
+ }
+
+
+ FX_BOOL IsWndCaptureKeyboard(const CPWL_Wnd * pWnd) const
+ {
+ if (pWnd)
+ for( FX_INT32 i=0,sz=m_aKeyboardPath.GetSize(); i<sz; i++)
+ if (m_aKeyboardPath.GetAt(i) == pWnd)
+ return TRUE;
+
+ return FALSE;
+ }
+
+ void SetFocus(CPWL_Wnd * pWnd)
+ {
+ m_aKeyboardPath.RemoveAll();
+
+ if (pWnd)
+ {
+ m_pMainKeyboardWnd = pWnd;
+
+ CPWL_Wnd * pParent = pWnd;
+ while (pParent)
+ {
+ m_aKeyboardPath.Add(pParent);
+ pParent = pParent->GetParentWindow();
+ }
+
+ pWnd->OnSetFocus();
+ }
+ }
+
+ void KillFocus()
+ {
+ if (m_aKeyboardPath.GetSize() > 0)
+ if (CPWL_Wnd* pWnd = m_aKeyboardPath.GetAt(0))
+ pWnd->OnKillFocus();
+
+ m_pMainKeyboardWnd = NULL;
+ m_aKeyboardPath.RemoveAll();
+ }
+
+ void SetCapture(CPWL_Wnd * pWnd)
+ {
+ m_aMousePath.RemoveAll();
+
+ if (pWnd)
+ {
+ m_pMainMouseWnd = pWnd;
+
+ CPWL_Wnd * pParent = pWnd;
+ while (pParent)
+ {
+ m_aMousePath.Add(pParent);
+ pParent = pParent->GetParentWindow();
+ }
+ }
+ }
+
+ void ReleaseCapture()
+ {
+ m_pMainMouseWnd = NULL;
+ m_aMousePath.RemoveAll();
+ }
+
+private:
+ CFX_ArrayTemplate<CPWL_Wnd*> m_aMousePath;
+ CFX_ArrayTemplate<CPWL_Wnd*> m_aKeyboardPath;
+ CPWL_Wnd* m_pCreatedWnd;
+ CPWL_Wnd* m_pMainMouseWnd;
+ CPWL_Wnd* m_pMainKeyboardWnd;
+};
+
+/* --------------------------- CPWL_Wnd ---------------------------- */
+
+CPWL_Wnd::CPWL_Wnd() :
+ m_pVScrollBar(NULL),
+ m_rcWindow(),
+ m_rcClip(),
+ m_bCreated(FALSE),
+ m_bVisible(FALSE),
+ m_bNotifying(FALSE),
+ m_bEnabled(TRUE)
+{
+}
+
+CPWL_Wnd::~CPWL_Wnd()
+{
+ ASSERT(m_bCreated == FALSE);
+}
+
+CFX_ByteString CPWL_Wnd::GetClassName() const
+{
+ return "CPWL_Wnd";
+}
+
+void CPWL_Wnd::Create(const PWL_CREATEPARAM & cp)
+{
+ if (!IsValid())
+ {
+ m_sPrivateParam = cp;
+
+ OnCreate(m_sPrivateParam);
+
+ m_sPrivateParam.rcRectWnd.Normalize();
+ m_rcWindow = m_sPrivateParam.rcRectWnd;
+ m_rcClip = CPWL_Utils::InflateRect(m_rcWindow,1.0f);
+
+ CreateMsgControl();
+
+ if (m_sPrivateParam.pParentWnd)
+ m_sPrivateParam.pParentWnd->OnNotify(this, PNM_ADDCHILD);
+
+ PWL_CREATEPARAM ccp = m_sPrivateParam;
+
+ ccp.dwFlags &= 0xFFFF0000L; //remove sub styles
+ ccp.mtChild = CPDF_Matrix(1,0,0,1,0,0);
+
+ CreateScrollBar(ccp);
+ CreateChildWnd(ccp);
+
+ m_bVisible = HasFlag(PWS_VISIBLE);
+
+ OnCreated();
+
+ RePosChildWnd();
+ m_bCreated = TRUE;
+ }
+}
+
+void CPWL_Wnd::OnCreate(PWL_CREATEPARAM & cp)
+{
+}
+
+void CPWL_Wnd::OnCreated()
+{
+}
+
+void CPWL_Wnd::OnDestroy()
+{
+}
+
+void CPWL_Wnd::Destroy()
+{
+ KillFocus();
+
+ OnDestroy();
+
+ if (m_bCreated)
+ {
+ for (FX_INT32 i = m_aChildren.GetSize()-1; i >= 0; i --)
+ {
+ if (CPWL_Wnd * pChild = m_aChildren[i])
+ {
+ pChild->Destroy();
+ delete pChild;
+ pChild = NULL;
+ }
+ }
+
+ if (m_sPrivateParam.pParentWnd)
+ m_sPrivateParam.pParentWnd->OnNotify(this, PNM_REMOVECHILD);
+ m_bCreated = FALSE;
+ }
+
+ DestroyMsgControl();
+
+ FXSYS_memset(&m_sPrivateParam, 0, sizeof(PWL_CREATEPARAM));
+ m_aChildren.RemoveAll();
+ m_pVScrollBar = NULL;
+}
+
+void CPWL_Wnd::Move(const CPDF_Rect & rcNew, FX_BOOL bReset,FX_BOOL bRefresh)
+{
+ if (IsValid())
+ {
+ CPDF_Rect rcOld = this->GetWindowRect();
+
+ m_rcWindow = rcNew;
+ m_rcWindow.Normalize();
+ //m_rcClip = CPWL_Utils::InflateRect(m_rcWindow,1.0f); //for special caret
+
+ if (rcOld.left != rcNew.left || rcOld.right != rcNew.right ||
+ rcOld.top != rcNew.top || rcOld.bottom != rcNew.bottom)
+ {
+ if (bReset)
+ {
+ RePosChildWnd();
+ }
+
+ }
+ if (bRefresh)
+ {
+ InvalidateRectMove(rcOld,rcNew);
+ }
+
+ m_sPrivateParam.rcRectWnd = m_rcWindow;
+ }
+}
+
+void CPWL_Wnd::InvalidateRectMove(const CPDF_Rect & rcOld, const CPDF_Rect & rcNew)
+{
+ CPDF_Rect rcUnion = rcOld;
+ rcUnion.Union(rcNew);
+
+ InvalidateRect(&rcUnion);
+
+ /*
+ CPDF_Rect SubArray[4];
+
+ rcOld.Substract4(rcNew,SubArray);
+ for (FX_INT32 i=0;i<4;i++)
+ {
+ if (SubArray[i].left == 0 &&
+ SubArray[i].right == 0 &&
+ SubArray[i].top == 0 &&
+ SubArray[i].bottom == 0)continue;
+
+ InvalidateRect(&CPWL_Utils::InflateRect(SubArray[i],2));
+ }
+
+ rcNew.Substract4(rcOld,SubArray);
+ for (FX_INT32 j=0;j<4;j++)
+ {
+ if (SubArray[j].left == 0 &&
+ SubArray[j].right == 0 &&
+ SubArray[j].top == 0 &&
+ SubArray[j].bottom == 0)continue;
+
+ InvalidateRect(&CPWL_Utils::InflateRect(SubArray[j],2));
+ }
+ */
+}
+
+void CPWL_Wnd::GetAppearanceStream(CFX_ByteString & sAppStream)
+{
+ if (IsValid())
+ {
+ CFX_ByteTextBuf sTextBuf;
+ GetAppearanceStream(sTextBuf);
+ sAppStream += sTextBuf.GetByteString();
+ }
+}
+
+void CPWL_Wnd::GetAppearanceStream(CFX_ByteTextBuf & sAppStream)
+{
+ if (IsValid() && IsVisible())
+ {
+ GetThisAppearanceStream(sAppStream);
+ GetChildAppearanceStream(sAppStream);
+ }
+}
+
+//if don't set,Get default apperance stream
+void CPWL_Wnd::GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream)
+{
+ CPDF_Rect rectWnd = GetWindowRect();
+ if (!rectWnd.IsEmpty())
+ {
+ CFX_ByteTextBuf sThis;
+
+ if (HasFlag(PWS_BACKGROUND))
+ sThis << CPWL_Utils::GetRectFillAppStream(rectWnd,this->GetBackgroundColor());
+
+ if (HasFlag(PWS_BORDER))
+ sThis << CPWL_Utils::GetBorderAppStream(rectWnd,
+ (FX_FLOAT)GetBorderWidth(),
+ GetBorderColor(),
+ this->GetBorderLeftTopColor(this->GetBorderStyle()),
+ this->GetBorderRightBottomColor(this->GetBorderStyle()),
+ this->GetBorderStyle(),
+ this->GetBorderDash());
+
+ sAppStream << sThis;
+ }
+}
+
+void CPWL_Wnd::GetChildAppearanceStream(CFX_ByteTextBuf & sAppStream)
+{
+ for (FX_INT32 i=0,sz=m_aChildren.GetSize(); i<sz; i++)
+ {
+ if (CPWL_Wnd * pChild = m_aChildren.GetAt(i))
+ {
+ pChild->GetAppearanceStream(sAppStream);
+ }
+ }
+}
+
+void CPWL_Wnd::DrawAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device)
+{
+ if (IsValid() && IsVisible())
+ {
+ DrawThisAppearance(pDevice,pUser2Device);
+ DrawChildAppearance(pDevice,pUser2Device);
+ }
+}
+
+void CPWL_Wnd::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device)
+{
+ CPDF_Rect rectWnd = GetWindowRect();
+ if (!rectWnd.IsEmpty())
+ {
+ if (HasFlag(PWS_BACKGROUND))
+ {
+ CPDF_Rect rcClient = CPWL_Utils::DeflateRect(rectWnd,(FX_FLOAT)(GetBorderWidth()+GetInnerBorderWidth()));
+ CPWL_Utils::DrawFillRect(pDevice,pUser2Device,rcClient,this->GetBackgroundColor(),GetTransparency());
+ }
+
+ if (HasFlag(PWS_BORDER))
+ CPWL_Utils::DrawBorder(pDevice,
+ pUser2Device,
+ rectWnd,
+ (FX_FLOAT)GetBorderWidth(),
+ GetBorderColor(),
+ this->GetBorderLeftTopColor(this->GetBorderStyle()),
+ this->GetBorderRightBottomColor(this->GetBorderStyle()),
+ this->GetBorderStyle(),
+ this->GetBorderDash(),
+ GetTransparency());
+ }
+}
+
+void CPWL_Wnd::DrawChildAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device)
+{
+ for (FX_INT32 i=0,sz=m_aChildren.GetSize(); i<sz; i++)
+ {
+ if (CPWL_Wnd * pChild = m_aChildren.GetAt(i))
+ {
+ CPDF_Matrix mt = pChild->GetChildMatrix();
+ if (mt.IsIdentity())
+ {
+ pChild->DrawAppearance(pDevice,pUser2Device);
+ }
+ else
+ {
+ mt.Concat(*pUser2Device);
+ pChild->DrawAppearance(pDevice,&mt);
+ }
+ }
+ }
+}
+
+void CPWL_Wnd::InvalidateRect(CPDF_Rect* pRect)
+{
+ if (IsValid())
+ {
+ CPDF_Rect rcRefresh = pRect ? *pRect : GetWindowRect();
+
+ if (!HasFlag(PWS_NOREFRESHCLIP))
+ {
+ CPDF_Rect rcClip = GetClipRect();
+ if (!rcClip.IsEmpty())
+ {
+ rcRefresh.Intersect(rcClip);
+ }
+ }
+
+ FX_RECT rcWin = PWLtoWnd(rcRefresh);
+ rcWin.left -= PWL_INVALIDATE_INFLATE;
+ rcWin.top -= PWL_INVALIDATE_INFLATE;
+ rcWin.right += PWL_INVALIDATE_INFLATE;
+ rcWin.bottom += PWL_INVALIDATE_INFLATE;
+
+ if (IFX_SystemHandler* pSH = GetSystemHandler())
+ {
+ if (FX_HWND hWnd = GetAttachedHWnd())
+ {
+ pSH->InvalidateRect(hWnd, rcWin);
+ }
+ }
+ }
+}
+
+#define PWL_IMPLEMENT_KEY_METHOD(key_method_name)\
+FX_BOOL CPWL_Wnd::key_method_name(FX_WORD nChar, FX_DWORD nFlag)\
+{\
+ if (IsValid() && IsVisible() && IsEnabled())\
+ {\
+ if (IsWndCaptureKeyboard(this))\
+ {\
+ for (FX_INT32 i=0,sz=m_aChildren.GetSize(); i<sz; i++)\
+ {\
+ if (CPWL_Wnd * pChild = m_aChildren.GetAt(i))\
+ {\
+ if (IsWndCaptureKeyboard(pChild))\
+ {\
+ return pChild->key_method_name(nChar,nFlag);\
+ }\
+ }\
+ }\
+ }\
+ }\
+ return FALSE;\
+}
+
+#define PWL_IMPLEMENT_MOUSE_METHOD(mouse_method_name)\
+FX_BOOL CPWL_Wnd::mouse_method_name(const CPDF_Point & point, FX_DWORD nFlag)\
+{\
+ if (IsValid() && IsVisible() && IsEnabled())\
+ {\
+ if (IsWndCaptureMouse(this))\
+ {\
+ for (FX_INT32 i=0,sz=m_aChildren.GetSize(); i<sz; i++)\
+ {\
+ if (CPWL_Wnd * pChild = m_aChildren.GetAt(i))\
+ {\
+ if (IsWndCaptureMouse(pChild))\
+ {\
+ return pChild->mouse_method_name(pChild->ParentToChild(point),nFlag);\
+ }\
+ }\
+ }\
+ SetCursor();\
+ }\
+ else\
+ {\
+ for (FX_INT32 i=0,sz=m_aChildren.GetSize(); i<sz; i++)\
+ {\
+ if (CPWL_Wnd * pChild = m_aChildren.GetAt(i))\
+ {\
+ if (pChild->WndHitTest(pChild->ParentToChild(point)))\
+ {\
+ return pChild->mouse_method_name(pChild->ParentToChild(point),nFlag);\
+ }\
+ }\
+ }\
+ if (this->WndHitTest(point))\
+ SetCursor();\
+ }\
+ }\
+ return FALSE;\
+}
+
+PWL_IMPLEMENT_KEY_METHOD(OnKeyDown)
+PWL_IMPLEMENT_KEY_METHOD(OnKeyUp)
+PWL_IMPLEMENT_KEY_METHOD(OnChar)
+
+PWL_IMPLEMENT_MOUSE_METHOD(OnLButtonDblClk)
+PWL_IMPLEMENT_MOUSE_METHOD(OnLButtonDown)
+PWL_IMPLEMENT_MOUSE_METHOD(OnLButtonUp)
+PWL_IMPLEMENT_MOUSE_METHOD(OnMButtonDblClk)
+PWL_IMPLEMENT_MOUSE_METHOD(OnMButtonDown)
+PWL_IMPLEMENT_MOUSE_METHOD(OnMButtonUp)
+PWL_IMPLEMENT_MOUSE_METHOD(OnRButtonDblClk)
+PWL_IMPLEMENT_MOUSE_METHOD(OnRButtonDown)
+PWL_IMPLEMENT_MOUSE_METHOD(OnRButtonUp)
+PWL_IMPLEMENT_MOUSE_METHOD(OnMouseMove)
+
+FX_BOOL CPWL_Wnd::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag)
+{
+ if (IsValid() && IsVisible() && IsEnabled())
+ {
+ SetCursor();
+ if (IsWndCaptureKeyboard(this))
+ {
+ for (FX_INT32 i=0,sz=m_aChildren.GetSize(); i<sz; i++)
+ {
+ if (CPWL_Wnd * pChild = m_aChildren.GetAt(i))
+ {
+ if (IsWndCaptureKeyboard(pChild))
+ {
+ return pChild->OnMouseWheel(zDelta,pChild->ParentToChild(point), nFlag);
+ }
+ }
+ }
+ }
+ }
+ return FALSE;
+}
+
+void CPWL_Wnd::AddChild(CPWL_Wnd * pWnd)
+{
+ m_aChildren.Add(pWnd);
+}
+
+void CPWL_Wnd::RemoveChild(CPWL_Wnd * pWnd)
+{
+ for (FX_INT32 i = m_aChildren.GetSize()-1; i >= 0; i --)
+ {
+ if (CPWL_Wnd* pChild = m_aChildren.GetAt(i))
+ {
+ if (pChild == pWnd)
+ {
+ m_aChildren.RemoveAt(i);
+ break;
+ }
+ }
+ }
+}
+
+void CPWL_Wnd::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam, FX_INTPTR lParam)
+{
+ switch (msg)
+ {
+ case PNM_ADDCHILD:
+ this->AddChild(pWnd);
+ break;
+ case PNM_REMOVECHILD:
+ this->RemoveChild(pWnd);
+ break;
+ default:
+ break;
+ }
+}
+
+FX_BOOL CPWL_Wnd::IsValid() const
+{
+ return m_bCreated;
+}
+
+PWL_CREATEPARAM CPWL_Wnd::GetCreationParam() const
+{
+ return m_sPrivateParam;
+}
+
+CPWL_Wnd* CPWL_Wnd::GetParentWindow() const
+{
+ return m_sPrivateParam.pParentWnd;
+}
+
+CPDF_Rect CPWL_Wnd::GetOriginWindowRect() const
+{
+ return m_sPrivateParam.rcRectWnd;
+}
+
+CPDF_Rect CPWL_Wnd::GetWindowRect() const
+{
+ return m_rcWindow;
+}
+
+CPDF_Rect CPWL_Wnd::GetClientRect() const
+{
+ CPDF_Rect rcWindow = GetWindowRect();
+ CPDF_Rect rcClient = CPWL_Utils::DeflateRect(rcWindow,(FX_FLOAT)(GetBorderWidth()+GetInnerBorderWidth()));
+
+ if (CPWL_ScrollBar * pVSB = this->GetVScrollBar())
+ rcClient.right -= pVSB->GetScrollBarWidth();
+
+ rcClient.Normalize();
+
+ if (rcWindow.Contains(rcClient))
+ return rcClient;
+ else
+ return CPDF_Rect();
+}
+
+CPDF_Point CPWL_Wnd::GetCenterPoint() const
+{
+ CPDF_Rect rcClient = GetClientRect();
+
+ return CPDF_Point((rcClient.left + rcClient.right) * 0.5f,
+ (rcClient.top + rcClient.bottom) * 0.5f);
+}
+
+CPDF_Rect CPWL_Wnd::GetClientCenterSquare() const
+{
+ return CPWL_Utils::GetCenterSquare(GetClientRect());
+}
+
+CPDF_Rect CPWL_Wnd::GetWindowCenterSquare() const
+{
+ return CPWL_Utils::GetCenterSquare(CPWL_Utils::DeflateRect(GetWindowRect(),0.1f));
+}
+
+FX_BOOL CPWL_Wnd::HasFlag(FX_DWORD dwFlags) const
+{
+ return (m_sPrivateParam.dwFlags & dwFlags) != 0;
+}
+
+void CPWL_Wnd::RemoveFlag(FX_DWORD dwFlags)
+{
+ m_sPrivateParam.dwFlags &= ~dwFlags;
+}
+
+void CPWL_Wnd::AddFlag(FX_DWORD dwFlags)
+{
+ m_sPrivateParam.dwFlags |= dwFlags;
+}
+
+CPWL_Color CPWL_Wnd::GetBackgroundColor() const
+{
+ return m_sPrivateParam.sBackgroundColor;
+}
+
+void CPWL_Wnd::SetBackgroundColor(const CPWL_Color & color)
+{
+ m_sPrivateParam.sBackgroundColor = color;
+}
+
+void CPWL_Wnd::SetTextColor(const CPWL_Color & color)
+{
+ m_sPrivateParam.sTextColor = color;
+}
+
+void CPWL_Wnd::SetTextStrokeColor(const CPWL_Color & color)
+{
+ m_sPrivateParam.sTextStrokeColor = color;
+}
+
+CPWL_Color CPWL_Wnd::GetTextColor() const
+{
+ return m_sPrivateParam.sTextColor;
+}
+
+CPWL_Color CPWL_Wnd::GetTextStrokeColor() const
+{
+ return m_sPrivateParam.sTextStrokeColor;
+}
+
+FX_INT32 CPWL_Wnd::GetBorderStyle() const
+{
+ return m_sPrivateParam.nBorderStyle;
+}
+
+void CPWL_Wnd::SetBorderStyle(FX_INT32 nBorderStyle)
+{
+ if (HasFlag(PWS_BORDER))
+ m_sPrivateParam.nBorderStyle = nBorderStyle;
+}
+
+FX_INT32 CPWL_Wnd::GetBorderWidth() const
+{
+ if (HasFlag(PWS_BORDER))
+ return m_sPrivateParam.dwBorderWidth;
+
+ return 0;
+}
+
+FX_INT32 CPWL_Wnd::GetInnerBorderWidth() const
+{
+ /*
+ switch (GetBorderStyle())
+ {
+ case PBS_BEVELED:
+ case PBS_INSET:
+ return GetBorderWidth() / 2;
+ }
+ */
+ return 0;
+}
+
+void CPWL_Wnd::SetBorderWidth(FX_INT32 nBorderWidth)
+{
+ if (HasFlag(PWS_BORDER))
+ m_sPrivateParam.dwBorderWidth = nBorderWidth;
+}
+
+CPWL_Color CPWL_Wnd::GetBorderColor() const
+{
+ if (HasFlag(PWS_BORDER))
+ return m_sPrivateParam.sBorderColor;
+
+ return CPWL_Color();
+}
+
+void CPWL_Wnd::SetBorderColor(const CPWL_Color & color)
+{
+ if (HasFlag(PWS_BORDER))
+ m_sPrivateParam.sBorderColor = color;
+}
+
+CPWL_Dash CPWL_Wnd::GetBorderDash() const
+{
+ return m_sPrivateParam.sDash;
+}
+
+void* CPWL_Wnd::GetAttachedData() const
+{
+ return m_sPrivateParam.pAttachedData;
+}
+
+void CPWL_Wnd::SetBorderDash(const CPWL_Dash & sDash)
+{
+ if (HasFlag(PWS_BORDER))
+ m_sPrivateParam.sDash = sDash;
+}
+
+CPWL_ScrollBar* CPWL_Wnd::GetVScrollBar() const
+{
+ if (HasFlag(PWS_VSCROLL))
+ return m_pVScrollBar;
+
+ return NULL;
+}
+
+void CPWL_Wnd::CreateScrollBar(const PWL_CREATEPARAM & cp)
+{
+ CreateVScrollBar(cp);
+}
+
+void CPWL_Wnd::CreateVScrollBar(const PWL_CREATEPARAM & cp)
+{
+ if (!m_pVScrollBar && HasFlag(PWS_VSCROLL))
+ {
+ PWL_CREATEPARAM scp = cp;
+
+ //flags
+ scp.dwFlags = PWS_CHILD| PWS_BACKGROUND | PWS_AUTOTRANSPARENT | PWS_NOREFRESHCLIP;
+
+ scp.pParentWnd = this;
+ scp.sBackgroundColor = PWL_DEFAULT_WHITECOLOR;
+ scp.eCursorType = FXCT_ARROW;
+ scp.nTransparency = PWL_SCROLLBAR_TRANSPARANCY;
+
+ if ((m_pVScrollBar = new CPWL_ScrollBar(SBT_VSCROLL)))
+ m_pVScrollBar->Create(scp);
+ }
+}
+
+void CPWL_Wnd::SetCapture()
+{
+ if (CPWL_MsgControl * pMsgCtrl = GetMsgControl())
+ pMsgCtrl->SetCapture(this);
+}
+
+void CPWL_Wnd::ReleaseCapture()
+{
+ for (FX_INT32 i=0,sz=m_aChildren.GetSize(); i<sz; i++)
+ if (CPWL_Wnd* pChild = m_aChildren.GetAt(i))
+ pChild->ReleaseCapture();
+
+ if (CPWL_MsgControl * pMsgCtrl = GetMsgControl())
+ pMsgCtrl->ReleaseCapture();
+}
+
+void CPWL_Wnd::SetFocus()
+{
+ if (CPWL_MsgControl * pMsgCtrl = GetMsgControl())
+ {
+ if (!pMsgCtrl->IsMainCaptureKeyboard(this))
+ pMsgCtrl->KillFocus();
+ pMsgCtrl->SetFocus(this);
+ }
+}
+
+void CPWL_Wnd::KillFocus()
+{
+ if (CPWL_MsgControl * pMsgCtrl = GetMsgControl())
+ {
+ if (pMsgCtrl->IsWndCaptureKeyboard(this))
+ pMsgCtrl->KillFocus();
+ }
+}
+
+void CPWL_Wnd::OnSetFocus()
+{
+}
+
+void CPWL_Wnd::OnKillFocus()
+{
+}
+
+FX_BOOL CPWL_Wnd::WndHitTest(const CPDF_Point & point) const
+{
+ return IsValid() && IsVisible() && GetWindowRect().Contains(point.x,point.y);
+}
+
+FX_BOOL CPWL_Wnd::ClientHitTest(const CPDF_Point & point) const
+{
+ return IsValid() && IsVisible() && GetClientRect().Contains(point.x,point.y);
+}
+
+const CPWL_Wnd * CPWL_Wnd::GetRootWnd() const
+{
+ if (m_sPrivateParam.pParentWnd)
+ return m_sPrivateParam.pParentWnd->GetRootWnd();
+ else
+ return this;
+}
+
+void CPWL_Wnd::SetVisible(FX_BOOL bVisible)
+{
+ if (IsValid())
+ {
+ for (FX_INT32 i=0,sz=m_aChildren.GetSize(); i<sz; i++)
+ {
+ if (CPWL_Wnd* pChild = m_aChildren.GetAt(i))
+ {
+ pChild->SetVisible(bVisible);
+ }
+ }
+
+ if (bVisible != m_bVisible)
+ {
+ m_bVisible = bVisible;
+ RePosChildWnd();
+ InvalidateRect();
+ }
+ }
+}
+
+void CPWL_Wnd::SetClipRect(const CPDF_Rect & rect)
+{
+ m_rcClip = rect;
+ m_rcClip.Normalize();
+}
+
+CPDF_Rect CPWL_Wnd::GetClipRect() const
+{
+ return m_rcClip;
+}
+
+FX_BOOL CPWL_Wnd::IsReadOnly() const
+{
+ return HasFlag(PWS_READONLY);
+}
+
+void CPWL_Wnd::RePosChildWnd()
+{
+ CPDF_Rect rcContent = CPWL_Utils::DeflateRect(GetWindowRect(),(FX_FLOAT)(GetBorderWidth()+GetInnerBorderWidth()));
+
+ CPWL_ScrollBar * pVSB = this->GetVScrollBar();
+
+ CPDF_Rect rcVScroll = CPDF_Rect(rcContent.right - PWL_SCROLLBAR_WIDTH,
+ rcContent.bottom,
+ rcContent.right-1.0f,
+ rcContent.top);
+
+ if (pVSB) pVSB->Move(rcVScroll,TRUE,FALSE);
+}
+
+void CPWL_Wnd::CreateChildWnd(const PWL_CREATEPARAM & cp)
+{
+}
+
+void CPWL_Wnd::SetCursor()
+{
+ if (IsValid())
+ {
+ if (IFX_SystemHandler* pSH = GetSystemHandler())
+ {
+ FX_INT32 nCursorType = this->GetCreationParam().eCursorType;
+ pSH->SetCursor(nCursorType);
+ }
+ }
+}
+
+void CPWL_Wnd::CreateMsgControl()
+{
+ if (!m_sPrivateParam.pMsgControl)
+ m_sPrivateParam.pMsgControl = new CPWL_MsgControl(this);
+}
+
+void CPWL_Wnd::DestroyMsgControl()
+{
+ if (CPWL_MsgControl* pMsgControl = GetMsgControl())
+ if (pMsgControl->IsWndCreated(this))
+ delete pMsgControl;
+}
+
+CPWL_MsgControl* CPWL_Wnd::GetMsgControl() const
+{
+ return m_sPrivateParam.pMsgControl;
+}
+
+FX_BOOL CPWL_Wnd::IsCaptureMouse() const
+{
+ return IsWndCaptureMouse(this);
+}
+
+FX_BOOL CPWL_Wnd::IsWndCaptureMouse(const CPWL_Wnd * pWnd) const
+{
+ if (CPWL_MsgControl * pCtrl = GetMsgControl())
+ return pCtrl->IsWndCaptureMouse(pWnd);
+
+ return FALSE;
+}
+
+FX_BOOL CPWL_Wnd::IsWndCaptureKeyboard(const CPWL_Wnd * pWnd) const
+{
+ if (CPWL_MsgControl * pCtrl = GetMsgControl())
+ return pCtrl->IsWndCaptureKeyboard(pWnd);
+
+ return FALSE;
+}
+
+FX_BOOL CPWL_Wnd::IsFocused() const
+{
+ if (CPWL_MsgControl * pCtrl = GetMsgControl())
+ return pCtrl->IsMainCaptureKeyboard(this);
+
+ return FALSE;
+}
+
+CPDF_Rect CPWL_Wnd::GetFocusRect() const
+{
+ return CPWL_Utils::InflateRect(this->GetWindowRect(),1);
+}
+
+FX_FLOAT CPWL_Wnd::GetFontSize() const
+{
+ return this->m_sPrivateParam.fFontSize;
+}
+
+void CPWL_Wnd::SetFontSize(FX_FLOAT fFontSize)
+{
+ this->m_sPrivateParam.fFontSize = fFontSize;
+}
+
+IFX_SystemHandler* CPWL_Wnd::GetSystemHandler() const
+{
+ return m_sPrivateParam.pSystemHandler;
+}
+
+IPWL_FocusHandler* CPWL_Wnd::GetFocusHandler() const
+{
+ return m_sPrivateParam.pFocusHandler;
+}
+
+IPWL_Provider* CPWL_Wnd::GetProvider() const
+{
+ return m_sPrivateParam.pProvider;
+}
+
+IFX_Edit_FontMap* CPWL_Wnd::GetFontMap() const
+{
+ return m_sPrivateParam.pFontMap;
+}
+
+CPWL_Color CPWL_Wnd::GetBorderLeftTopColor(FX_INT32 nBorderStyle) const
+{
+ CPWL_Color color;
+
+ switch (nBorderStyle)
+ {
+ case PBS_SOLID:
+ break;
+ case PBS_DASH:
+ break;
+ case PBS_BEVELED:
+ color = CPWL_Color(COLORTYPE_GRAY,1);
+ break;
+ case PBS_INSET:
+ color = CPWL_Color(COLORTYPE_GRAY,0.5f);
+ break;
+ case PBS_UNDERLINED:
+ break;
+ }
+
+ return color;
+}
+
+CPWL_Color CPWL_Wnd::GetBorderRightBottomColor(FX_INT32 nBorderStyle) const
+{
+ CPWL_Color color;
+
+ switch (nBorderStyle)
+ {
+ case PBS_SOLID:
+ break;
+ case PBS_DASH:
+ break;
+ case PBS_BEVELED:
+ color = CPWL_Utils::DevideColor(GetBackgroundColor(),2);
+ break;
+ case PBS_INSET:
+ color = CPWL_Color(COLORTYPE_GRAY,0.75f);
+ break;
+ case PBS_UNDERLINED:
+ break;
+ }
+
+ return color;
+}
+
+/* ----------------------------------------------------------------- */
+
+FX_INT32 CPWL_Wnd::GetTransparency()
+{
+ return m_sPrivateParam.nTransparency;
+}
+
+void CPWL_Wnd::SetTransparency(FX_INT32 nTransparency)
+{
+ for (FX_INT32 i=0,sz=m_aChildren.GetSize(); i<sz; i++)
+ {
+ if (CPWL_Wnd* pChild = m_aChildren.GetAt(i))
+ {
+ pChild->SetTransparency(nTransparency);
+ }
+ }
+
+ m_sPrivateParam.nTransparency = nTransparency;
+}
+
+CPDF_Matrix CPWL_Wnd::GetWindowMatrix() const
+{
+ CPDF_Matrix mt = this->GetChildToRoot();
+
+ if (IPWL_Provider* pProvider = GetProvider())
+ {
+ mt.Concat(pProvider->GetWindowMatrix(GetAttachedData()));
+ return mt;
+ }
+
+/*
+ if (CReader_App* pApp = CPWL_Module::GetReaderApp())
+ if (CReader_Document* pDocument = pApp->GetCurrentDocument())
+ if (CReader_DocView* pDocView = pDocument->GetCurrentDocView())
+ {
+ CPDF_Matrix mtPageView;
+ pDocView->GetCurrentMatrix(mtPageView);
+ mt.Concat(mtPageView);
+ return mt;
+ }
+
+*/
+
+ return mt;
+}
+
+void CPWL_Wnd::PWLtoWnd(const CPDF_Point& point, FX_INT32& x, FX_INT32& y) const
+{
+ CPDF_Matrix mt = GetWindowMatrix();
+ CPDF_Point pt = point;
+ mt.Transform(pt.x,pt.y);
+ x = (FX_INT32)(pt.x+0.5);
+ y = (FX_INT32)(pt.y+0.5);
+}
+
+FX_RECT CPWL_Wnd::PWLtoWnd(const CPDF_Rect & rect) const
+{
+ CPDF_Rect rcTemp = rect;
+ CPDF_Matrix mt = GetWindowMatrix();
+ mt.TransformRect(rcTemp);
+ return FX_RECT((FX_INT32)(rcTemp.left+0.5), (FX_INT32)(rcTemp.bottom+0.5), (FX_INT32)(rcTemp.right+0.5), (FX_INT32)(rcTemp.top+0.5));
+}
+
+FX_HWND CPWL_Wnd::GetAttachedHWnd() const
+{
+ return m_sPrivateParam.hAttachedWnd;
+}
+
+CPDF_Point CPWL_Wnd::ChildToParent(const CPDF_Point& point) const
+{
+ CPDF_Matrix mt = GetChildMatrix();
+ if (mt.IsIdentity())
+ return point;
+ else
+ {
+ CPDF_Point pt = point;
+ mt.Transform(pt.x,pt.y);
+ return pt;
+ }
+}
+
+CPDF_Rect CPWL_Wnd::ChildToParent(const CPDF_Rect& rect) const
+{
+ CPDF_Matrix mt = GetChildMatrix();
+ if (mt.IsIdentity())
+ return rect;
+ else
+ {
+ CPDF_Rect rc = rect;
+ mt.TransformRect(rc);
+ return rc;
+ }
+}
+
+CPDF_Point CPWL_Wnd::ParentToChild(const CPDF_Point& point) const
+{
+ CPDF_Matrix mt = GetChildMatrix();
+ if (mt.IsIdentity())
+ return point;
+ else
+ {
+ mt.SetReverse(mt);
+ CPDF_Point pt = point;
+ mt.Transform(pt.x,pt.y);
+ return pt;
+ }
+}
+
+CPDF_Rect CPWL_Wnd::ParentToChild(const CPDF_Rect& rect) const
+{
+ CPDF_Matrix mt = GetChildMatrix();
+ if (mt.IsIdentity())
+ return rect;
+ else
+ {
+ mt.SetReverse(mt);
+ CPDF_Rect rc = rect;
+ mt.TransformRect(rc);
+ return rc;
+ }
+}
+
+CPDF_Matrix CPWL_Wnd::GetChildToRoot() const
+{
+ CPDF_Matrix mt(1,0,0,1,0,0);
+
+ if (HasFlag(PWS_CHILD))
+ {
+ const CPWL_Wnd* pParent = this;
+ while (pParent)
+ {
+ mt.Concat(pParent->GetChildMatrix());
+ pParent = pParent->GetParentWindow();
+ }
+ }
+
+ return mt;
+}
+
+CPDF_Matrix CPWL_Wnd::GetChildMatrix() const
+{
+ if (HasFlag(PWS_CHILD))
+ return m_sPrivateParam.mtChild;
+
+ return CPDF_Matrix(1,0,0,1,0,0);
+}
+
+void CPWL_Wnd::SetChildMatrix(const CPDF_Matrix& mt)
+{
+ m_sPrivateParam.mtChild = mt;
+}
+
+const CPWL_Wnd* CPWL_Wnd::GetFocused() const
+{
+ if (CPWL_MsgControl * pMsgCtrl = GetMsgControl())
+ {
+ return pMsgCtrl->m_pMainKeyboardWnd;
+ }
+
+ return NULL;
+}
+
+void CPWL_Wnd::EnableWindow(FX_BOOL bEnable)
+{
+ if (m_bEnabled != bEnable)
+ {
+ for (FX_INT32 i=0,sz=m_aChildren.GetSize(); i<sz; i++)
+ {
+ if (CPWL_Wnd* pChild = m_aChildren.GetAt(i))
+ {
+ pChild->EnableWindow(bEnable);
+ }
+ }
+
+ this->m_bEnabled = bEnable;
+
+ if (bEnable)
+ this->OnEnabled();
+ else
+ this->OnDisabled();
+ }
+}
+
+FX_BOOL CPWL_Wnd::IsEnabled()
+{
+ return m_bEnabled;
+}
+
+void CPWL_Wnd::OnEnabled()
+{
+}
+
+void CPWL_Wnd::OnDisabled()
+{
+}
+
+FX_BOOL CPWL_Wnd::IsCTRLpressed(FX_DWORD nFlag) const
+{
+ if (IFX_SystemHandler* pSystemHandler = GetSystemHandler())
+ {
+ return pSystemHandler->IsCTRLKeyDown(nFlag);
+ }
+
+ return FALSE;
+}
+
+FX_BOOL CPWL_Wnd::IsSHIFTpressed(FX_DWORD nFlag) const
+{
+ if (IFX_SystemHandler* pSystemHandler = GetSystemHandler())
+ {
+ return pSystemHandler->IsSHIFTKeyDown(nFlag);
+ }
+
+ return FALSE;
+}
+
+FX_BOOL CPWL_Wnd::IsALTpressed(FX_DWORD nFlag) const
+{
+ if (IFX_SystemHandler* pSystemHandler = GetSystemHandler())
+ {
+ return pSystemHandler->IsALTKeyDown(nFlag);
+ }
+
+ return FALSE;
+}
+
+FX_BOOL CPWL_Wnd::IsINSERTpressed(FX_DWORD nFlag) const
+{
+ if (IFX_SystemHandler* pSystemHandler = GetSystemHandler())
+ {
+ return pSystemHandler->IsINSERTKeyDown(nFlag);
+ }
+
+ return FALSE;
+}
+
diff --git a/fpdfsdk/src/resource.h b/fpdfsdk/src/resource.h
index e97d1d5451..b58f09272f 100644
--- a/fpdfsdk/src/resource.h
+++ b/fpdfsdk/src/resource.h
@@ -1,21 +1,21 @@
-// 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
-
-//{{NO_DEPENDENCIES}}
-// Microsoft Developer Studio generated include file.
-// Used by fpdfsdkdll.rc
-//
-
-// Next default values for new objects
-//
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 104
-#define _APS_NEXT_COMMAND_VALUE 40001
-#define _APS_NEXT_CONTROL_VALUE 1000
-#define _APS_NEXT_SYMED_VALUE 101
-#endif
-#endif
+// 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
+
+//{{NO_DEPENDENCIES}}
+// Microsoft Developer Studio generated include file.
+// Used by fpdfsdkdll.rc
+//
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE 104
+#define _APS_NEXT_COMMAND_VALUE 40001
+#define _APS_NEXT_CONTROL_VALUE 1000
+#define _APS_NEXT_SYMED_VALUE 101
+#endif
+#endif
diff --git a/samples/pdfium_test.cc b/samples/pdfium_test.cc
index 67c15e0ea5..06799f6bf0 100644
--- a/samples/pdfium_test.cc
+++ b/samples/pdfium_test.cc
@@ -1,309 +1,309 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <limits.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <list>
-#include <string>
-#include <utility>
-
-#include "fpdfsdk/include/fpdf_dataavail.h"
-#include "fpdfsdk/include/fpdf_ext.h"
-#include "fpdfsdk/include/fpdfformfill.h"
-#include "fpdfsdk/include/fpdftext.h"
-#include "fpdfsdk/include/fpdfview.h"
-#include "v8/include/v8.h"
-
-#ifdef _WIN32
- #define snprintf _snprintf
- /* in Windows, rb for open and read binary file */
- #define FOPEN_READ "rb"
-#else
- #define FOPEN_READ "r"
-#endif
-
-static void WritePpm(const char* pdf_name, int num,
- const char* buffer, int stride, int width, int height) {
- if (stride < 0 || width < 0 || height < 0)
- return;
- if (height > 0 && width > INT_MAX / height)
- return;
- int out_len = width * height;
- if (out_len > INT_MAX / 3)
- return;
- out_len *= 3;
-
- char filename[256];
- snprintf(filename, sizeof(filename), "%s.%d.ppm", pdf_name, num);
- FILE* fp = fopen(filename, "w");
- if (!fp)
- return;
- fprintf(fp, "P6\n# PDF test render\n%d %d\n255\n", width, height);
- // Source data is B, G, R, unused.
- // Dest data is R, G, B.
- char* result = new char[out_len];
- if (result) {
- for (int h = 0; h < height; ++h) {
- const char* src_line = buffer + (stride * h);
- char* dest_line = result + (width * h * 3);
- for (int w = 0; w < width; ++w) {
- // R
- dest_line[w * 3] = src_line[(w * 4) + 2];
- // G
- dest_line[(w * 3) + 1] = src_line[(w * 4) + 1];
- // B
- dest_line[(w * 3) + 2] = src_line[w * 4];
- }
- }
- fwrite(result, out_len, 1, fp);
- delete [] result;
- }
- fclose(fp);
-}
-
-int Form_Alert(IPDF_JSPLATFORM*, FPDF_WIDESTRING, FPDF_WIDESTRING, int, int) {
- printf("Form_Alert called.\n");
- return 0;
-}
-
-void Unsupported_Handler(UNSUPPORT_INFO*, int type) {
- std::string feature = "Unknown";
- switch (type) {
- case FPDF_UNSP_DOC_XFAFORM:
- feature = "XFA";
- break;
- case FPDF_UNSP_DOC_PORTABLECOLLECTION:
- feature = "Portfolios_Packages";
- break;
- case FPDF_UNSP_DOC_ATTACHMENT:
- case FPDF_UNSP_ANNOT_ATTACHMENT:
- feature = "Attachment";
- break;
- case FPDF_UNSP_DOC_SECURITY:
- feature = "Rights_Management";
- break;
- case FPDF_UNSP_DOC_SHAREDREVIEW:
- feature = "Shared_Review";
- break;
- case FPDF_UNSP_DOC_SHAREDFORM_ACROBAT:
- case FPDF_UNSP_DOC_SHAREDFORM_FILESYSTEM:
- case FPDF_UNSP_DOC_SHAREDFORM_EMAIL:
- feature = "Shared_Form";
- break;
- case FPDF_UNSP_ANNOT_3DANNOT:
- feature = "3D";
- break;
- case FPDF_UNSP_ANNOT_MOVIE:
- feature = "Movie";
- break;
- case FPDF_UNSP_ANNOT_SOUND:
- feature = "Sound";
- break;
- case FPDF_UNSP_ANNOT_SCREEN_MEDIA:
- case FPDF_UNSP_ANNOT_SCREEN_RICHMEDIA:
- feature = "Screen";
- break;
- case FPDF_UNSP_ANNOT_SIG:
- feature = "Digital_Signature";
- break;
- }
- printf("Unsupported feature: %s.\n", feature.c_str());
-}
-
-bool ParseCommandLine(int argc, const char* argv[], bool* write_images,
- std::list<const char*>* files) {
- *write_images = false;
- files->clear();
-
- int cur_arg = 1;
- if (cur_arg < argc &&
- strcmp(argv[cur_arg], "--write_images") == 0) {
- *write_images = true;
- cur_arg++;
- }
-
- if (cur_arg >= argc)
- return false;
-
- for (int i = cur_arg; i < argc; i++)
- files->push_back(argv[i]);
-
- return true;
-}
-
-class TestLoader {
- public:
- TestLoader(const char* pBuf, size_t len);
-
- const char* m_pBuf;
- size_t m_Len;
-};
-
-TestLoader::TestLoader(const char* pBuf, size_t len)
- : m_pBuf(pBuf), m_Len(len) {
-}
-
-int Get_Block(void* param, unsigned long pos, unsigned char* pBuf,
- unsigned long size) {
- TestLoader* pLoader = (TestLoader*) param;
- if (pos + size < pos || pos + size > pLoader->m_Len) return 0;
- memcpy(pBuf, pLoader->m_pBuf + pos, size);
- return 1;
-}
-
-bool Is_Data_Avail(FX_FILEAVAIL* pThis, size_t offset, size_t size) {
- return true;
-}
-
-void Add_Segment(FX_DOWNLOADHINTS* pThis, size_t offset, size_t size) {
-}
-
-void RenderPdf(const char* name, const char* pBuf, size_t len,
- bool write_images) {
- printf("Rendering PDF file %s.\n", name);
-
- IPDF_JSPLATFORM platform_callbacks;
- memset(&platform_callbacks, '\0', sizeof(platform_callbacks));
- platform_callbacks.version = 1;
- platform_callbacks.app_alert = Form_Alert;
-
- FPDF_FORMFILLINFO form_callbacks;
- memset(&form_callbacks, '\0', sizeof(form_callbacks));
- form_callbacks.version = 1;
- form_callbacks.m_pJsPlatform = &platform_callbacks;
-
- TestLoader loader(pBuf, len);
-
- FPDF_FILEACCESS file_access;
- memset(&file_access, '\0', sizeof(file_access));
- file_access.m_FileLen = len;
- file_access.m_GetBlock = Get_Block;
- file_access.m_Param = &loader;
-
- FX_FILEAVAIL file_avail;
- memset(&file_avail, '\0', sizeof(file_avail));
- file_avail.version = 1;
- file_avail.IsDataAvail = Is_Data_Avail;
-
- FX_DOWNLOADHINTS hints;
- memset(&hints, '\0', sizeof(hints));
- hints.version = 1;
- hints.AddSegment = Add_Segment;
-
- FPDF_DOCUMENT doc;
- FPDF_AVAIL pdf_avail = FPDFAvail_Create(&file_avail, &file_access);
-
- (void) FPDFAvail_IsDocAvail(pdf_avail, &hints);
-
- if (!FPDFAvail_IsLinearized(pdf_avail)) {
- printf("Non-linearized path...\n");
- doc = FPDF_LoadCustomDocument(&file_access, NULL);
- } else {
- printf("Linearized path...\n");
- doc = FPDFAvail_GetDocument(pdf_avail, NULL);
- }
-
- (void) FPDF_GetDocPermissions(doc);
- (void) FPDFAvail_IsFormAvail(pdf_avail, &hints);
-
- FPDF_FORMHANDLE form = FPDFDOC_InitFormFillEnviroument(doc, &form_callbacks);
- FPDF_SetFormFieldHighlightColor(form, 0, 0xFFE4DD);
- FPDF_SetFormFieldHighlightAlpha(form, 100);
-
- int first_page = FPDFAvail_GetFirstPageNum(doc);
- (void) FPDFAvail_IsPageAvail(pdf_avail, first_page, &hints);
-
- int page_count = FPDF_GetPageCount(doc);
- for (int i = 0; i < page_count; ++i) {
- (void) FPDFAvail_IsPageAvail(pdf_avail, i, &hints);
- }
-
- FORM_DoDocumentJSAction(form);
- FORM_DoDocumentOpenAction(form);
-
- for (int i = 0; i < page_count; ++i) {
- FPDF_PAGE page = FPDF_LoadPage(doc, i);
- FPDF_TEXTPAGE text_page = FPDFText_LoadPage(page);
- FORM_OnAfterLoadPage(page, form);
- FORM_DoPageAAction(page, form, FPDFPAGE_AACTION_OPEN);
-
- int width = static_cast<int>(FPDF_GetPageWidth(page));
- int height = static_cast<int>(FPDF_GetPageHeight(page));
- FPDF_BITMAP bitmap = FPDFBitmap_Create(width, height, 0);
- FPDFBitmap_FillRect(bitmap, 0, 0, width, height, 255, 255, 255, 255);
-
- FPDF_RenderPageBitmap(bitmap, page, 0, 0, width, height, 0, 0);
- FPDF_FFLDraw(form, bitmap, page, 0, 0, width, height, 0, 0);
- if (write_images) {
- const char* buffer = reinterpret_cast<const char*>(
- FPDFBitmap_GetBuffer(bitmap));
- int stride = FPDFBitmap_GetStride(bitmap);
- WritePpm(name, i, buffer, stride, width, height);
- }
-
- FPDFBitmap_Destroy(bitmap);
-
- FORM_DoPageAAction(page, form, FPDFPAGE_AACTION_CLOSE);
- FORM_OnBeforeClosePage(page, form);
- FPDFText_ClosePage(text_page);
- FPDF_ClosePage(page);
- }
-
- FORM_DoDocumentAAction(form, FPDFDOC_AACTION_WC);
- FPDFDOC_ExitFormFillEnviroument(form);
- FPDF_CloseDocument(doc);
- FPDFAvail_Destroy(pdf_avail);
-
- printf("Loaded, parsed and rendered %d pages.\n", page_count);
-}
-
-int main(int argc, const char* argv[]) {
- v8::V8::InitializeICU();
- bool write_images = false;
- std::list<const char*> files;
- if (!ParseCommandLine(argc, argv, &write_images, &files)) {
- printf("Usage is: test [--write_images] /path/to/pdf\n");
- printf("--write_images - to write page images <pdf-name>.<page-number>.ppm\n");
- return 1;
- }
-
- FPDF_InitLibrary(NULL);
-
- UNSUPPORT_INFO unsuppored_info;
- memset(&unsuppored_info, '\0', sizeof(unsuppored_info));
- unsuppored_info.version = 1;
- unsuppored_info.FSDK_UnSupport_Handler = Unsupported_Handler;
-
- FSDK_SetUnSpObjProcessHandler(&unsuppored_info);
-
- while (!files.empty()) {
- const char* filename = files.front();
- files.pop_front();
- FILE* file = fopen(filename, FOPEN_READ);
- if (!file) {
- fprintf(stderr, "Failed to open: %s\n", filename);
- continue;
- }
- (void) fseek(file, 0, SEEK_END);
- size_t len = ftell(file);
- (void) fseek(file, 0, SEEK_SET);
- char* pBuf = (char*) malloc(len);
- size_t ret = fread(pBuf, 1, len, file);
- (void) fclose(file);
- if (ret != len) {
- fprintf(stderr, "Failed to read: %s\n", filename);
- } else {
- RenderPdf(filename, pBuf, len, write_images);
- }
- free(pBuf);
- }
-
- FPDF_DestroyLibrary();
-
- return 0;
-}
-
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <list>
+#include <string>
+#include <utility>
+
+#include "fpdfsdk/include/fpdf_dataavail.h"
+#include "fpdfsdk/include/fpdf_ext.h"
+#include "fpdfsdk/include/fpdfformfill.h"
+#include "fpdfsdk/include/fpdftext.h"
+#include "fpdfsdk/include/fpdfview.h"
+#include "v8/include/v8.h"
+
+#ifdef _WIN32
+ #define snprintf _snprintf
+ /* in Windows, rb for open and read binary file */
+ #define FOPEN_READ "rb"
+#else
+ #define FOPEN_READ "r"
+#endif
+
+static void WritePpm(const char* pdf_name, int num,
+ const char* buffer, int stride, int width, int height) {
+ if (stride < 0 || width < 0 || height < 0)
+ return;
+ if (height > 0 && width > INT_MAX / height)
+ return;
+ int out_len = width * height;
+ if (out_len > INT_MAX / 3)
+ return;
+ out_len *= 3;
+
+ char filename[256];
+ snprintf(filename, sizeof(filename), "%s.%d.ppm", pdf_name, num);
+ FILE* fp = fopen(filename, "w");
+ if (!fp)
+ return;
+ fprintf(fp, "P6\n# PDF test render\n%d %d\n255\n", width, height);
+ // Source data is B, G, R, unused.
+ // Dest data is R, G, B.
+ char* result = new char[out_len];
+ if (result) {
+ for (int h = 0; h < height; ++h) {
+ const char* src_line = buffer + (stride * h);
+ char* dest_line = result + (width * h * 3);
+ for (int w = 0; w < width; ++w) {
+ // R
+ dest_line[w * 3] = src_line[(w * 4) + 2];
+ // G
+ dest_line[(w * 3) + 1] = src_line[(w * 4) + 1];
+ // B
+ dest_line[(w * 3) + 2] = src_line[w * 4];
+ }
+ }
+ fwrite(result, out_len, 1, fp);
+ delete [] result;
+ }
+ fclose(fp);
+}
+
+int Form_Alert(IPDF_JSPLATFORM*, FPDF_WIDESTRING, FPDF_WIDESTRING, int, int) {
+ printf("Form_Alert called.\n");
+ return 0;
+}
+
+void Unsupported_Handler(UNSUPPORT_INFO*, int type) {
+ std::string feature = "Unknown";
+ switch (type) {
+ case FPDF_UNSP_DOC_XFAFORM:
+ feature = "XFA";
+ break;
+ case FPDF_UNSP_DOC_PORTABLECOLLECTION:
+ feature = "Portfolios_Packages";
+ break;
+ case FPDF_UNSP_DOC_ATTACHMENT:
+ case FPDF_UNSP_ANNOT_ATTACHMENT:
+ feature = "Attachment";
+ break;
+ case FPDF_UNSP_DOC_SECURITY:
+ feature = "Rights_Management";
+ break;
+ case FPDF_UNSP_DOC_SHAREDREVIEW:
+ feature = "Shared_Review";
+ break;
+ case FPDF_UNSP_DOC_SHAREDFORM_ACROBAT:
+ case FPDF_UNSP_DOC_SHAREDFORM_FILESYSTEM:
+ case FPDF_UNSP_DOC_SHAREDFORM_EMAIL:
+ feature = "Shared_Form";
+ break;
+ case FPDF_UNSP_ANNOT_3DANNOT:
+ feature = "3D";
+ break;
+ case FPDF_UNSP_ANNOT_MOVIE:
+ feature = "Movie";
+ break;
+ case FPDF_UNSP_ANNOT_SOUND:
+ feature = "Sound";
+ break;
+ case FPDF_UNSP_ANNOT_SCREEN_MEDIA:
+ case FPDF_UNSP_ANNOT_SCREEN_RICHMEDIA:
+ feature = "Screen";
+ break;
+ case FPDF_UNSP_ANNOT_SIG:
+ feature = "Digital_Signature";
+ break;
+ }
+ printf("Unsupported feature: %s.\n", feature.c_str());
+}
+
+bool ParseCommandLine(int argc, const char* argv[], bool* write_images,
+ std::list<const char*>* files) {
+ *write_images = false;
+ files->clear();
+
+ int cur_arg = 1;
+ if (cur_arg < argc &&
+ strcmp(argv[cur_arg], "--write_images") == 0) {
+ *write_images = true;
+ cur_arg++;
+ }
+
+ if (cur_arg >= argc)
+ return false;
+
+ for (int i = cur_arg; i < argc; i++)
+ files->push_back(argv[i]);
+
+ return true;
+}
+
+class TestLoader {
+ public:
+ TestLoader(const char* pBuf, size_t len);
+
+ const char* m_pBuf;
+ size_t m_Len;
+};
+
+TestLoader::TestLoader(const char* pBuf, size_t len)
+ : m_pBuf(pBuf), m_Len(len) {
+}
+
+int Get_Block(void* param, unsigned long pos, unsigned char* pBuf,
+ unsigned long size) {
+ TestLoader* pLoader = (TestLoader*) param;
+ if (pos + size < pos || pos + size > pLoader->m_Len) return 0;
+ memcpy(pBuf, pLoader->m_pBuf + pos, size);
+ return 1;
+}
+
+bool Is_Data_Avail(FX_FILEAVAIL* pThis, size_t offset, size_t size) {
+ return true;
+}
+
+void Add_Segment(FX_DOWNLOADHINTS* pThis, size_t offset, size_t size) {
+}
+
+void RenderPdf(const char* name, const char* pBuf, size_t len,
+ bool write_images) {
+ printf("Rendering PDF file %s.\n", name);
+
+ IPDF_JSPLATFORM platform_callbacks;
+ memset(&platform_callbacks, '\0', sizeof(platform_callbacks));
+ platform_callbacks.version = 1;
+ platform_callbacks.app_alert = Form_Alert;
+
+ FPDF_FORMFILLINFO form_callbacks;
+ memset(&form_callbacks, '\0', sizeof(form_callbacks));
+ form_callbacks.version = 1;
+ form_callbacks.m_pJsPlatform = &platform_callbacks;
+
+ TestLoader loader(pBuf, len);
+
+ FPDF_FILEACCESS file_access;
+ memset(&file_access, '\0', sizeof(file_access));
+ file_access.m_FileLen = len;
+ file_access.m_GetBlock = Get_Block;
+ file_access.m_Param = &loader;
+
+ FX_FILEAVAIL file_avail;
+ memset(&file_avail, '\0', sizeof(file_avail));
+ file_avail.version = 1;
+ file_avail.IsDataAvail = Is_Data_Avail;
+
+ FX_DOWNLOADHINTS hints;
+ memset(&hints, '\0', sizeof(hints));
+ hints.version = 1;
+ hints.AddSegment = Add_Segment;
+
+ FPDF_DOCUMENT doc;
+ FPDF_AVAIL pdf_avail = FPDFAvail_Create(&file_avail, &file_access);
+
+ (void) FPDFAvail_IsDocAvail(pdf_avail, &hints);
+
+ if (!FPDFAvail_IsLinearized(pdf_avail)) {
+ printf("Non-linearized path...\n");
+ doc = FPDF_LoadCustomDocument(&file_access, NULL);
+ } else {
+ printf("Linearized path...\n");
+ doc = FPDFAvail_GetDocument(pdf_avail, NULL);
+ }
+
+ (void) FPDF_GetDocPermissions(doc);
+ (void) FPDFAvail_IsFormAvail(pdf_avail, &hints);
+
+ FPDF_FORMHANDLE form = FPDFDOC_InitFormFillEnviroument(doc, &form_callbacks);
+ FPDF_SetFormFieldHighlightColor(form, 0, 0xFFE4DD);
+ FPDF_SetFormFieldHighlightAlpha(form, 100);
+
+ int first_page = FPDFAvail_GetFirstPageNum(doc);
+ (void) FPDFAvail_IsPageAvail(pdf_avail, first_page, &hints);
+
+ int page_count = FPDF_GetPageCount(doc);
+ for (int i = 0; i < page_count; ++i) {
+ (void) FPDFAvail_IsPageAvail(pdf_avail, i, &hints);
+ }
+
+ FORM_DoDocumentJSAction(form);
+ FORM_DoDocumentOpenAction(form);
+
+ for (int i = 0; i < page_count; ++i) {
+ FPDF_PAGE page = FPDF_LoadPage(doc, i);
+ FPDF_TEXTPAGE text_page = FPDFText_LoadPage(page);
+ FORM_OnAfterLoadPage(page, form);
+ FORM_DoPageAAction(page, form, FPDFPAGE_AACTION_OPEN);
+
+ int width = static_cast<int>(FPDF_GetPageWidth(page));
+ int height = static_cast<int>(FPDF_GetPageHeight(page));
+ FPDF_BITMAP bitmap = FPDFBitmap_Create(width, height, 0);
+ FPDFBitmap_FillRect(bitmap, 0, 0, width, height, 255, 255, 255, 255);
+
+ FPDF_RenderPageBitmap(bitmap, page, 0, 0, width, height, 0, 0);
+ FPDF_FFLDraw(form, bitmap, page, 0, 0, width, height, 0, 0);
+ if (write_images) {
+ const char* buffer = reinterpret_cast<const char*>(
+ FPDFBitmap_GetBuffer(bitmap));
+ int stride = FPDFBitmap_GetStride(bitmap);
+ WritePpm(name, i, buffer, stride, width, height);
+ }
+
+ FPDFBitmap_Destroy(bitmap);
+
+ FORM_DoPageAAction(page, form, FPDFPAGE_AACTION_CLOSE);
+ FORM_OnBeforeClosePage(page, form);
+ FPDFText_ClosePage(text_page);
+ FPDF_ClosePage(page);
+ }
+
+ FORM_DoDocumentAAction(form, FPDFDOC_AACTION_WC);
+ FPDFDOC_ExitFormFillEnviroument(form);
+ FPDF_CloseDocument(doc);
+ FPDFAvail_Destroy(pdf_avail);
+
+ printf("Loaded, parsed and rendered %d pages.\n", page_count);
+}
+
+int main(int argc, const char* argv[]) {
+ v8::V8::InitializeICU();
+ bool write_images = false;
+ std::list<const char*> files;
+ if (!ParseCommandLine(argc, argv, &write_images, &files)) {
+ printf("Usage is: test [--write_images] /path/to/pdf\n");
+ printf("--write_images - to write page images <pdf-name>.<page-number>.ppm\n");
+ return 1;
+ }
+
+ FPDF_InitLibrary(NULL);
+
+ UNSUPPORT_INFO unsuppored_info;
+ memset(&unsuppored_info, '\0', sizeof(unsuppored_info));
+ unsuppored_info.version = 1;
+ unsuppored_info.FSDK_UnSupport_Handler = Unsupported_Handler;
+
+ FSDK_SetUnSpObjProcessHandler(&unsuppored_info);
+
+ while (!files.empty()) {
+ const char* filename = files.front();
+ files.pop_front();
+ FILE* file = fopen(filename, FOPEN_READ);
+ if (!file) {
+ fprintf(stderr, "Failed to open: %s\n", filename);
+ continue;
+ }
+ (void) fseek(file, 0, SEEK_END);
+ size_t len = ftell(file);
+ (void) fseek(file, 0, SEEK_SET);
+ char* pBuf = (char*) malloc(len);
+ size_t ret = fread(pBuf, 1, len, file);
+ (void) fclose(file);
+ if (ret != len) {
+ fprintf(stderr, "Failed to read: %s\n", filename);
+ } else {
+ RenderPdf(filename, pBuf, len, write_images);
+ }
+ free(pBuf);
+ }
+
+ FPDF_DestroyLibrary();
+
+ return 0;
+}
+
diff --git a/samples/samples.gyp b/samples/samples.gyp
index f7b7237d8f..e576d99ebf 100644
--- a/samples/samples.gyp
+++ b/samples/samples.gyp
@@ -1,21 +1,21 @@
-# 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.
-
-{
- 'target_defaults': {
- 'type': 'executable',
- 'dependencies': [
- '../pdfium.gyp:fpdfsdk',
- ],
- 'include_dirs': ['<(DEPTH)'],
- },
- 'targets': [
- {
- 'target_name': 'pdfium_test',
- 'sources': [
- 'pdfium_test.cc',
- ],
- },
- ],
+# 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.
+
+{
+ 'target_defaults': {
+ 'type': 'executable',
+ 'dependencies': [
+ '../pdfium.gyp:fpdfsdk',
+ ],
+ 'include_dirs': ['<(DEPTH)'],
+ },
+ 'targets': [
+ {
+ 'target_name': 'pdfium_test',
+ 'sources': [
+ 'pdfium_test.cc',
+ ],
+ },
+ ],
} \ No newline at end of file